Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cvsignore15
-rw-r--r--ChangeLog1858
-rw-r--r--Makefile.am257
-rw-r--r--NEWS1568
-rw-r--r--README240
-rw-r--r--acconfig.h22
-rwxr-xr-xautogen.sh30
-rw-r--r--config.h.in51
-rw-r--r--configure.in1282
-rw-r--r--data/.cvsignore4
-rw-r--r--data/Makefile.am10
-rw-r--r--data/browscap.ini12301
-rw-r--r--data/config.in10
-rw-r--r--data/net_1_1/.cvsignore2
-rw-r--r--data/net_1_1/DefaultWsdlHelpGenerator.aspx1794
-rw-r--r--data/net_1_1/Makefile.am8
-rw-r--r--data/net_1_1/machine.config216
-rw-r--r--data/net_2_0/.cvsignore2
-rw-r--r--data/net_2_0/DefaultWsdlHelpGenerator.aspx1817
-rw-r--r--data/net_2_0/Makefile.am8
-rw-r--r--data/net_2_0/machine.config216
-rw-r--r--doc/.cvsignore4
-rw-r--r--doc/Makefile.am32
-rw-r--r--doc/README17
-rw-r--r--doc/ado-net796
-rw-r--r--doc/anoncvs70
-rwxr-xr-xdoc/asp-net102
-rw-r--r--doc/books37
-rw-r--r--doc/c-sharp223
-rw-r--r--doc/ccvs138
-rw-r--r--doc/class-library190
-rw-r--r--doc/class-status.in26
-rw-r--r--doc/classlib-doc105
-rw-r--r--doc/contact13
-rw-r--r--doc/contributing190
-rw-r--r--doc/devel-faq190
-rw-r--r--doc/documentation62
-rw-r--r--doc/download381
-rw-r--r--doc/faq860
-rw-r--r--doc/gcc-frontend9
-rw-r--r--doc/ideas112
-rw-r--r--doc/index1224
-rwxr-xr-xdoc/java62
-rw-r--r--doc/jit-debug181
-rw-r--r--doc/jit-debug-sample86
-rw-r--r--doc/jit-debug-sample270
-rwxr-xr-xdoc/languages108
-rw-r--r--doc/mailing-lists198
-rwxr-xr-xdoc/mono-build-w32.sh147
-rwxr-xr-xdoc/mono-build.sh183
-rw-r--r--doc/mono-common-problems160
-rw-r--r--doc/mono-contribution-howto505
-rw-r--r--doc/monodoc-xml755
-rw-r--r--doc/papers96
-rw-r--r--doc/passport293
-rw-r--r--doc/pending14
-rwxr-xr-xdoc/plans15
-rw-r--r--doc/porting63
-rw-r--r--doc/ppc30
-rwxr-xr-xdoc/projects24
-rw-r--r--doc/rationale173
-rw-r--r--doc/release-notes/mono-0.346
-rw-r--r--doc/release-notes/mono-0.443
-rw-r--r--doc/resources188
-rw-r--r--doc/resources-pending30
-rw-r--r--doc/roadmap12
-rw-r--r--doc/runtime195
-rw-r--r--doc/status40
-rw-r--r--doc/team2
-rw-r--r--doc/testing46
-rw-r--r--doc/thanks6
-rw-r--r--doc/todo1
-rw-r--r--doc/tools67
-rw-r--r--doc/web/.cvsignore2
-rw-r--r--doc/web/commands43
-rwxr-xr-xdoc/web/deploy/.cvsignore1
-rw-r--r--doc/web/deploy/cm/c.gifbin150 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/cormissing.css182
-rw-r--r--doc/web/deploy/cm/cormissing.js392
-rw-r--r--doc/web/deploy/cm/d.gifbin137 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/e.gifbin861 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/en.gifbin111 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/f.gifbin90 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/i.gifbin90 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/m.gifbin101 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/n.gifbin65 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/p.gifbin111 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/r.gifbin73 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/s.gifbin127 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/sc.gifbin70 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/se.gifbin73 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/sm.gifbin76 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/st.gifbin101 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/sx.gifbin73 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/tb.gifbin49 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/tm.gifbin64 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/tp.gifbin67 -> 0 bytes
-rw-r--r--doc/web/deploy/cm/y.gifbin92 -> 0 bytes
-rw-r--r--doc/web/deploy/images/bgsquares.gifbin4963 -> 0 bytes
-rw-r--r--doc/web/deploy/images/bgsquares.pngbin4643 -> 0 bytes
-rw-r--r--doc/web/deploy/images/bgsquares.xcf.gzbin2775 -> 0 bytes
-rw-r--r--doc/web/deploy/images/mono.gifbin3079 -> 0 bytes
-rw-r--r--doc/web/deploy/images/mono.pngbin4495 -> 0 bytes
-rw-r--r--doc/web/deploy/images/pixel.gifbin49 -> 0 bytes
-rw-r--r--doc/web/deploy/images/pixel.pngbin156 -> 0 bytes
-rw-r--r--doc/web/htmlify33
-rw-r--r--doc/web/icaza.pl76
-rw-r--r--doc/web/images/bgsquares.gifbin4963 -> 0 bytes
-rw-r--r--doc/web/images/bgsquares.pngbin4644 -> 0 bytes
-rw-r--r--doc/web/images/bgsquares.xcf.gzbin2775 -> 0 bytes
-rw-r--r--doc/web/images/mono.gifbin3079 -> 0 bytes
-rw-r--r--doc/web/images/mono.pngbin4496 -> 0 bytes
-rw-r--r--doc/web/images/pixel.gifbin49 -> 0 bytes
-rw-r--r--doc/web/images/pixel.pngbin157 -> 0 bytes
-rwxr-xr-xdoc/web/images/xml.gifbin429 -> 0 bytes
-rw-r--r--doc/web/makefile110
-rwxr-xr-xdoc/web/mono-rss.cs103
-rwxr-xr-xdoc/web/process.pl89
-rwxr-xr-xdoc/web/rss.cs262
-rwxr-xr-xdoc/web/src/.cvsignore1
-rw-r--r--doc/web/template.html.in91
-rw-r--r--doc/winforms90
-rw-r--r--docs/.cvsignore2
-rw-r--r--docs/Makefile.am18
-rwxr-xr-xdocs/abc-removal.txt302
-rw-r--r--docs/aot-compiler.txt44
-rw-r--r--docs/assembly-bundle57
-rw-r--r--docs/embedded-api284
-rw-r--r--docs/exceptions64
-rw-r--r--docs/file-share-modes173
-rw-r--r--docs/gc-variables-in-c96
-rw-r--r--docs/internal-calls81
-rw-r--r--docs/ir-desc75
-rw-r--r--docs/local-regalloc.txt208
-rw-r--r--docs/mini-doc.txt771
-rw-r--r--docs/mini-porting.txt451
-rw-r--r--docs/mono_handle_d98
-rw-r--r--docs/new-regalloc68
-rw-r--r--docs/opcode-decomp.txt113
-rw-r--r--docs/precise-gc77
-rw-r--r--docs/release-notes-1.0.html16
-rw-r--r--docs/remoting26
-rw-r--r--docs/threading156
-rw-r--r--ikvm-jni/.cvsignore3
-rw-r--r--ikvm-jni/ChangeLog29
-rw-r--r--ikvm-jni/Makefile.am15
-rw-r--r--ikvm-jni/mono-jni.c1263
-rw-r--r--man/Makefile.am5
-rw-r--r--man/cert2spc.142
-rwxr-xr-xman/certmgr.175
-rwxr-xr-xman/chktrust.146
-rw-r--r--man/cilc.121
-rw-r--r--man/disco.168
-rw-r--r--man/gacutil.1121
-rw-r--r--man/genxs.1294
-rw-r--r--man/ilasm.144
-rwxr-xr-xman/makecert.1129
-rw-r--r--man/man.xml24
-rw-r--r--man/manpages.source4
-rwxr-xr-xman/mcs.1200
-rw-r--r--man/mono-config.589
-rw-r--r--man/mono.1439
-rw-r--r--man/monop.117
-rw-r--r--man/oldmono.1175
-rw-r--r--man/secutil.145
-rwxr-xr-xman/setreg.138
-rwxr-xr-xman/signcode.193
-rwxr-xr-xman/sn.1155
-rw-r--r--man/soapsuds.1126
-rwxr-xr-xman/sqlsharp.1462
-rw-r--r--man/wsdl.183
-rw-r--r--man/wsdl2.179
-rw-r--r--man/xsd.173
-rwxr-xr-xmcs/AUTHORS16
-rw-r--r--mcs/ChangeLog25
-rwxr-xr-xmcs/README23
-rw-r--r--mcs/class/.cvsignore1
-rw-r--r--mcs/class/Microsoft.VisualBasic/Changelog16
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build40
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs18
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs16
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs314
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs35
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs120
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs27
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs616
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs478
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs37
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs22
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs14
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs41
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs189
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs48
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs16
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs30
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs57
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs39
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs27
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs27
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs28
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs34
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs33
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs41
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs24
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs19
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs51
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs58
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs32
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs80
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs30
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs61
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs39
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs31
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs19
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs32
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs16
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs17
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs17
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs20
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs1110
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs39
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs23
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs19
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs30
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs26
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs29
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs32
-rw-r--r--mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs73
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/.cvsignore1
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/AllTests.cs33
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs535
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs674
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs380
-rw-r--r--mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build63
-rw-r--r--mcs/class/Mono.CSharp.Debugger/AssemblerWriterI386.cs311
-rw-r--r--mcs/class/Mono.CSharp.Debugger/ChangeLog222
-rw-r--r--mcs/class/Mono.CSharp.Debugger/IAssemblerWriter.cs70
-rw-r--r--mcs/class/Mono.CSharp.Debugger/IMonoSymbolWriter.cs200
-rw-r--r--mcs/class/Mono.CSharp.Debugger/Mono.CSharp.Debugger.build24
-rwxr-xr-xmcs/class/Mono.CSharp.Debugger/MonoDwarfFileWriter.cs2425
-rw-r--r--mcs/class/Mono.CSharp.Debugger/MonoSymbolDocumentWriter.cs60
-rwxr-xr-xmcs/class/Mono.CSharp.Debugger/MonoSymbolWriter.cs804
-rw-r--r--mcs/class/Mono.CSharp.Debugger/README43
-rw-r--r--mcs/class/Mono.CSharp.Debugger/README.relocation-table100
-rw-r--r--mcs/class/Mono.CSharp.Debugger/csharp-lang.c189
-rw-r--r--mcs/class/Mono.CSharp.Debugger/csharp-lang.h35
-rw-r--r--mcs/class/Mono.CSharp.Debugger/csharp-mono-lang.c76
-rw-r--r--mcs/class/Mono.CSharp.Debugger/gdb-csharp-support.patch83
-rw-r--r--mcs/class/Mono.CSharp.Debugger/gdb-variable-scopes.patch175
-rw-r--r--mcs/class/Mono.Data.MySql/ChangeLog66
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql.build65
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql/Field.cs66
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySql.cs270
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlCommand.cs328
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlConnection.cs534
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql/TODOAttribute.cs33
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql/Test.cs243
-rw-r--r--mcs/class/Mono.Data.MySql/Mono.Data.MySql/makefile20
-rw-r--r--mcs/class/Mono.Data.MySql/Test/TestMySqlInsert.cs103
-rw-r--r--mcs/class/Mono.Data.MySql/list5
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/ParmUtil.cs176
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs78
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs46
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommand.cs928
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs103
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlConnection.cs722
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs175
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs422
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlError.cs155
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs114
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlException.cs204
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs51
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs19
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameter.cs227
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs276
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs37
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs18
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs43
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs18
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs191
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresLibrary.cs475
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresTypes.cs512
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/ParmUtil.cs176
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs78
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs46
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommand.cs928
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs103
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlConnection.cs722
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs175
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs422
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlError.cs155
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs114
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlException.cs204
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs51
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs19
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameter.cs227
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs276
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs37
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs18
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs43
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs18
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs191
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PostgresLibrary.cs475
-rw-r--r--mcs/class/Mono.Data.PostgreSqlClient/PostgresTypes.cs512
-rw-r--r--mcs/class/Mono.GetOptions/.cvsignore4
-rw-r--r--mcs/class/Mono.GetOptions/AssemblyInfo.cs59
-rw-r--r--mcs/class/Mono.GetOptions/Mono.GetOptions.csproj93
-rw-r--r--mcs/class/Mono.GetOptions/OptionList.cs209
-rw-r--r--mcs/class/README277
-rw-r--r--mcs/class/System.Data/ChangeLog1310
-rwxr-xr-xmcs/class/System.Data/System.Data.Common/ChangeLog10
-rw-r--r--mcs/class/System.Data/System.Data.Common/DataAdapter.cs113
-rw-r--r--mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs64
-rw-r--r--mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs219
-rw-r--r--mcs/class/System.Data/System.Data.Common/DataTableMapping.cs99
-rw-r--r--mcs/class/System.Data/System.Data.Common/DataTableMappingCollection.cs225
-rw-r--r--mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs310
-rw-r--r--mcs/class/System.Data/System.Data.Common/DbDataPermission.cs83
-rw-r--r--mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs36
-rw-r--r--mcs/class/System.Data/System.Data.Common/RowUpdatedEventArgs.cs64
-rw-r--r--mcs/class/System.Data/System.Data.Common/RowUpdatingEventArgs.cs58
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/ChangeLog73
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbCommand.cs201
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs42
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs191
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbDataAdapter.cs18
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs21
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbError.cs18
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs19
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbException.cs20
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventArgs.cs18
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventHandler.cs19
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbLiteral.cs48
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs194
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs192
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs18
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbPermissionAttribute.cs31
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventArgs.cs18
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventHandler.cs19
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventArgs.cs18
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventHandler.cs19
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbSchemaGuid.cs18
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs93
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/OleDbType.cs54
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/TestGDA.cs32
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/TestOleDb.cs20
-rw-r--r--mcs/class/System.Data/System.Data.OleDb/libgda.cs86
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/ParmUtil.cs176
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/PostgresLibrary.cs475
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/PostgresTypes.cs512
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs78
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlClientPermissionAttribute.cs46
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs928
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs103
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs722
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs175
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs422
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlError.cs155
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs114
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlException.cs204
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventArgs.cs51
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventHandler.cs19
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs227
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs276
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventArgs.cs37
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventArgs.cs43
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs191
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/INullable.cs22
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlBinary.cs232
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs377
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs390
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlCompareOptions.cs29
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs249
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs638
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs345
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlGuid.cs215
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs396
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs423
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs398
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs381
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs27
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlSingle.cs332
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs461
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs27
-rw-r--r--mcs/class/System.Data/System.Data.SqlTypes/SqlTypeException.cs27
-rw-r--r--mcs/class/System.Data/System.Data.build40
-rw-r--r--mcs/class/System.Data/System.Data/AcceptRejectRule.cs25
-rw-r--r--mcs/class/System.Data/System.Data/ChangeLog3
-rw-r--r--mcs/class/System.Data/System.Data/CommandBehavior.cs30
-rw-r--r--mcs/class/System.Data/System.Data/CommandType.cs25
-rw-r--r--mcs/class/System.Data/System.Data/ConnectionState.cs30
-rw-r--r--mcs/class/System.Data/System.Data/Constraint.cs62
-rw-r--r--mcs/class/System.Data/System.Data/ConstraintCollection.cs141
-rw-r--r--mcs/class/System.Data/System.Data/ConstraintException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/DBConcurrencyException.cs40
-rw-r--r--mcs/class/System.Data/System.Data/DataColumn.cs334
-rw-r--r--mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs80
-rw-r--r--mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/DataColumnCollection.cs409
-rw-r--r--mcs/class/System.Data/System.Data/DataException.cs37
-rw-r--r--mcs/class/System.Data/System.Data/DataRelation.cs165
-rw-r--r--mcs/class/System.Data/System.Data/DataRelationCollection.cs324
-rw-r--r--mcs/class/System.Data/System.Data/DataRow.cs633
-rw-r--r--mcs/class/System.Data/System.Data/DataRowAction.cs28
-rw-r--r--mcs/class/System.Data/System.Data/DataRowBuilder.cs52
-rw-r--r--mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs41
-rw-r--r--mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/DataRowCollection.cs141
-rw-r--r--mcs/class/System.Data/System.Data/DataRowState.cs26
-rw-r--r--mcs/class/System.Data/System.Data/DataRowVersion.cs23
-rw-r--r--mcs/class/System.Data/System.Data/DataRowView.cs197
-rw-r--r--mcs/class/System.Data/System.Data/DataSet.cs336
-rw-r--r--mcs/class/System.Data/System.Data/DataTable.cs726
-rw-r--r--mcs/class/System.Data/System.Data/DataTableCollection.cs139
-rw-r--r--mcs/class/System.Data/System.Data/DataTableRelationCollection.cs122
-rw-r--r--mcs/class/System.Data/System.Data/DataView.cs230
-rw-r--r--mcs/class/System.Data/System.Data/DataViewManager.cs76
-rw-r--r--mcs/class/System.Data/System.Data/DataViewRowState.cs29
-rw-r--r--mcs/class/System.Data/System.Data/DataViewSetting.cs72
-rwxr-xr-xmcs/class/System.Data/System.Data/DataViewSettingCollection.cs87
-rw-r--r--mcs/class/System.Data/System.Data/DbType.cs44
-rw-r--r--mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/DuplicateNameException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/EvaluateException.cs31
-rwxr-xr-xmcs/class/System.Data/System.Data/FillErrorEventArgs.cs58
-rw-r--r--mcs/class/System.Data/System.Data/FillErrorEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs137
-rw-r--r--mcs/class/System.Data/System.Data/IColumnMapping.cs35
-rw-r--r--mcs/class/System.Data/System.Data/IColumnMappingCollection.cs35
-rw-r--r--mcs/class/System.Data/System.Data/IDataAdapter.cs33
-rw-r--r--mcs/class/System.Data/System.Data/IDataParameter.cs36
-rw-r--r--mcs/class/System.Data/System.Data/IDataParameterCollection.cs28
-rw-r--r--mcs/class/System.Data/System.Data/IDataReader.cs33
-rw-r--r--mcs/class/System.Data/System.Data/IDataRecord.cs71
-rw-r--r--mcs/class/System.Data/System.Data/IDbCommand.cs47
-rw-r--r--mcs/class/System.Data/System.Data/IDbConnection.cs41
-rw-r--r--mcs/class/System.Data/System.Data/IDbDataAdapter.cs25
-rw-r--r--mcs/class/System.Data/System.Data/IDbDataParameter.cs25
-rw-r--r--mcs/class/System.Data/System.Data/IDbTransaction.cs27
-rw-r--r--mcs/class/System.Data/System.Data/ITableMapping.cs23
-rw-r--r--mcs/class/System.Data/System.Data/ITableMappingCollection.cs31
-rw-r--r--mcs/class/System.Data/System.Data/InRowChangingEventException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs118
-rw-r--r--mcs/class/System.Data/System.Data/InvalidConstraintException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/InvalidExpressionException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/IsolationLevel.cs27
-rwxr-xr-xmcs/class/System.Data/System.Data/Locale.cs22
-rw-r--r--mcs/class/System.Data/System.Data/MappingType.cs26
-rw-r--r--mcs/class/System.Data/System.Data/MergeFailedEventArgs.cs38
-rw-r--r--mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/MissingMappingAction.cs24
-rw-r--r--mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs33
-rw-r--r--mcs/class/System.Data/System.Data/MissingSchemaAction.cs25
-rw-r--r--mcs/class/System.Data/System.Data/NoNullAllowedException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/ParameterDirection.cs25
-rw-r--r--mcs/class/System.Data/System.Data/PropertyAttributes.cs28
-rw-r--r--mcs/class/System.Data/System.Data/PropertyCollection.cs31
-rw-r--r--mcs/class/System.Data/System.Data/ReadOnlyException.cs33
-rw-r--r--mcs/class/System.Data/System.Data/RowNotInTableException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/Rule.cs25
-rw-r--r--mcs/class/System.Data/System.Data/SchemaType.cs23
-rw-r--r--mcs/class/System.Data/System.Data/SqlDbType.cs45
-rw-r--r--mcs/class/System.Data/System.Data/StateChangeEventArgs.cs43
-rw-r--r--mcs/class/System.Data/System.Data/StateChangeEventHandler.cs18
-rw-r--r--mcs/class/System.Data/System.Data/StatementType.cs25
-rw-r--r--mcs/class/System.Data/System.Data/StrongTypingException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/SyntaxErrorException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/TODOAttribute.cs33
-rw-r--r--mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/UniqueConstraint.cs119
-rw-r--r--mcs/class/System.Data/System.Data/UpdateRowSource.cs25
-rw-r--r--mcs/class/System.Data/System.Data/UpdateStatus.cs25
-rw-r--r--mcs/class/System.Data/System.Data/VersionNotFoundException.cs32
-rw-r--r--mcs/class/System.Data/System.Data/XmlReadMode.cs27
-rw-r--r--mcs/class/System.Data/System.Data/XmlWriteMode.cs24
-rw-r--r--mcs/class/System.Data/System.Xml/XmlDataDocument.cs232
-rw-r--r--mcs/class/System.Data/TODO134
-rw-r--r--mcs/class/System.Data/Test/.cvsignore2
-rw-r--r--mcs/class/System.Data/Test/AllTests.cs21
-rw-r--r--mcs/class/System.Data/Test/ChangeLog85
-rw-r--r--mcs/class/System.Data/Test/PostgresTest.cs510
-rw-r--r--mcs/class/System.Data/Test/ReadPostgresData.cs585
-rw-r--r--mcs/class/System.Data/Test/SqlSharpCli.cs624
-rw-r--r--mcs/class/System.Data/Test/System.Data.SqlTypes/AllTests.cs27
-rw-r--r--mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt32Test.cs413
-rw-r--r--mcs/class/System.Data/Test/System.Data/AllTests.cs29
-rw-r--r--mcs/class/System.Data/Test/System.Data/DataColumnTest.cs30
-rw-r--r--mcs/class/System.Data/Test/System.Data_test.build75
-rw-r--r--mcs/class/System.Data/Test/TestExecuteScalar.cs149
-rw-r--r--mcs/class/System.Data/Test/TestSqlDataAdapter.cs66
-rw-r--r--mcs/class/System.Data/Test/TestSqlDataReader.cs181
-rw-r--r--mcs/class/System.Data/Test/TestSqlException.cs118
-rw-r--r--mcs/class/System.Data/Test/TestSqlInsert.cs105
-rw-r--r--mcs/class/System.Data/Test/TestSqlIsolationLevel.cs104
-rw-r--r--mcs/class/System.Data/Test/TestSqlParameters.cs127
-rw-r--r--mcs/class/System.Data/Test/TheTests.cs78
-rwxr-xr-xmcs/class/System.Data/list128
-rw-r--r--mcs/class/System.Drawing/ChangeLog6
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Design/UITypeEditorEditStyle.cs15
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog7
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs258
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs453
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs21
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs37
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs79
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog17
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ColorAdjustType.cs19
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ColorChannelFlag.cs17
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ColorMapType.cs14
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrixFlag.cs15
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ColorMode.cs14
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs44
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/EmfPlusRecordType.cs262
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/EmfType.cs15
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameterValueType.cs20
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/EncoderValue.cs36
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs59
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ImageCodecFlags.cs21
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ImageFlags.cs26
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/ImageLockMode.cs16
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/Metafile.cs111
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/MetafileFrameUnit.cs18
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/PaletteFlags.cs15
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs39
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs16
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs125
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs26
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs15
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs17
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnit.cs16
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermissionLevel.cs16
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Text/GenericFontFamilies.cs15
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Text/HotkeyPrefix.cs15
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Text/TextRenderingHint.cs18
-rw-r--r--mcs/class/System.Drawing/System.Drawing.build25
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Bitmap.cs278
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Brush.cs34
-rw-r--r--mcs/class/System.Drawing/System.Drawing/ChangeLog54
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Color.cs1284
-rw-r--r--mcs/class/System.Drawing/System.Drawing/ColorConverter.cs51
-rw-r--r--mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs99
-rw-r--r--mcs/class/System.Drawing/System.Drawing/ContentAlignment.cs22
-rw-r--r--mcs/class/System.Drawing/System.Drawing/FontStyle.cs19
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Graphics.cs18
-rw-r--r--mcs/class/System.Drawing/System.Drawing/GraphicsUnit.cs20
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Image.cs199
-rw-r--r--mcs/class/System.Drawing/System.Drawing/KnownColor.cs182
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing/Pen.cs113
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Point.cs339
-rw-r--r--mcs/class/System.Drawing/System.Drawing/PointF.cs204
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Rectangle.cs584
-rw-r--r--mcs/class/System.Drawing/System.Drawing/RectangleF.cs531
-rw-r--r--mcs/class/System.Drawing/System.Drawing/RotateFlipType.cs29
-rw-r--r--mcs/class/System.Drawing/System.Drawing/Size.cs309
-rw-r--r--mcs/class/System.Drawing/System.Drawing/SizeF.cs249
-rw-r--r--mcs/class/System.Drawing/System.Drawing/StringAligment.cs17
-rw-r--r--mcs/class/System.Drawing/System.Drawing/StringDigitSubstitute.cs18
-rw-r--r--mcs/class/System.Drawing/System.Drawing/StringFormatFlags.cs23
-rw-r--r--mcs/class/System.Drawing/System.Drawing/StringTrimming.cs20
-rw-r--r--mcs/class/System.Drawing/System.Drawing/StringUnit.cs22
-rw-r--r--mcs/class/System.Drawing/Test/System.Drawing/ChangeLog4
-rw-r--r--mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs159
-rwxr-xr-xmcs/class/System.Drawing/list.unix59
-rwxr-xr-xmcs/class/System.Runtime.Serialization.Formatters.Soap/README4
-rwxr-xr-xmcs/class/System.Runtime.Serialization.Formatters.Soap/Sample.txt179
-rwxr-xr-xmcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap.build36
-rwxr-xr-xmcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ObjectSerializer.cs374
-rwxr-xr-xmcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs59
-rwxr-xr-xmcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs222
-rw-r--r--mcs/class/System.Web/.cvsignore4
-rw-r--r--mcs/class/System.Web/ChangeLog98
-rw-r--r--mcs/class/System.Web/System.Web.Caching/Cache.cs520
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs53
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheDependency.cs95
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheEntry.cs363
-rw-r--r--mcs/class/System.Web/System.Web.Caching/CacheExpires.cs145
-rw-r--r--mcs/class/System.Web/System.Web.Caching/ChangeLog17
-rw-r--r--mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs253
-rwxr-xr-xmcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs19
-rw-r--r--mcs/class/System.Web/System.Web.Configuration/ChangeLog4
-rw-r--r--mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs44
-rwxr-xr-xmcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs18
-rwxr-xr-xmcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs19
-rw-r--r--mcs/class/System.Web/System.Web.Configuration/HttpCapabilitiesBase.cs36
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs19
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs33
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/ChangeLog13
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs18
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs21
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs22
-rw-r--r--mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs231
-rw-r--r--mcs/class/System.Web/System.Web.Mail/ChangeLog8
-rw-r--r--mcs/class/System.Web/System.Web.Mail/MailAttachment.cs44
-rw-r--r--mcs/class/System.Web/System.Web.Mail/MailEncoding.cs26
-rw-r--r--mcs/class/System.Web/System.Web.Mail/MailFormat.cs26
-rw-r--r--mcs/class/System.Web/System.Web.Mail/MailMessage.cs106
-rw-r--r--mcs/class/System.Web/System.Web.Mail/MailPriority.cs30
-rw-r--r--mcs/class/System.Web/System.Web.Mail/SmtpMail.cs75
-rw-r--r--mcs/class/System.Web/System.Web.Security/ChangeLog4
-rw-r--r--mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventArgs.cs32
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/ChangeLog17
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs198
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/IReadOnlySessionState.cs15
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/IRequiresSessionState.cs15
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/SessionDictionary.cs93
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/SessionStateMode.cs20
-rw-r--r--mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs31
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog136
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs99
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs70
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs106
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs163
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs23
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs103
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs61
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs68
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs60
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs71
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs54
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs117
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs125
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs97
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs408
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs171
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs129
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs84
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs137
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs118
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/.cvsignore2
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs92
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs17
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs362
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs311
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs275
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs395
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs29
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs109
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/Button.cs169
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs186
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs21
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs1111
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs100
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog557
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs215
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs251
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs50
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs89
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs113
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs776
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumn.cs379
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumnCollection.cs186
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs86
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventArgs.cs37
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs47
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridPagerStyle.cs241
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs47
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataKeyCollection.cs83
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/DataList.cs824
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs93
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListItemCollection.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventArgs.cs37
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs16
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs43
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs156
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs109
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs253
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs63
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs30
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs211
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs81
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs23
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs24
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs158
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs221
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs29
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Image.cs119
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs29
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs181
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Label.cs85
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs27
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs169
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs31
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonInternal.cs55
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs176
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs331
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs252
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs361
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs36
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs62
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs36
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventArgs.cs47
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs16
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs22
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/PagedDataSource.cs470
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs21
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs22
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs97
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs27
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs31
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs125
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs243
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs125
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs93
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs372
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Repeater.cs366
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs72
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemCollection.cs83
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventArgs.cs37
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs60
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/SelectedDatesCollection.cs120
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventArgs.cs47
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Style.cs539
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TODO156
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Table.cs159
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs147
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs181
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs31
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs26
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs172
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs97
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs179
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs229
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs55
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs109
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs230
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs36
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs255
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs65
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs28
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs76
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs26
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs24
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs142
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs23
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs57
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs486
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs203
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/AttributeCollection.cs73
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/BaseParser.cs14
-rw-r--r--mcs/class/System.Web/System.Web.UI/BuildMethod.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI/ChangeLog292
-rw-r--r--mcs/class/System.Web/System.Web.UI/CompiledTemplateBuilder.cs29
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs32
-rw-r--r--mcs/class/System.Web/System.Web.UI/Control.cs658
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ControlBuilder.cs167
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs45
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ControlCollection.cs119
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/CssStyleCollection.cs48
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/DataBinder.cs77
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/DataBinding.cs52
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/DataBindingCollection.cs92
-rw-r--r--mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs49
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs79
-rw-r--r--mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs29
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs30
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs1027
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs54
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs28
-rw-r--r--mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs111
-rw-r--r--mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs20
-rw-r--r--mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs20
-rw-r--r--mcs/class/System.Web/System.Web.UI/INamingContainer.cs18
-rw-r--r--mcs/class/System.Web/System.Web.UI/IParserAccessor.cs19
-rw-r--r--mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs21
-rw-r--r--mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs19
-rw-r--r--mcs/class/System.Web/System.Web.UI/IStateManager.cs22
-rw-r--r--mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs20
-rw-r--r--mcs/class/System.Web/System.Web.UI/ITemplate.cs19
-rw-r--r--mcs/class/System.Web/System.Web.UI/IValidator.cs21
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ImageClickEventArgs.cs25
-rw-r--r--mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web.UI/LiteralControl.cs39
-rw-r--r--mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs23
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/Page.cs505
-rw-r--r--mcs/class/System.Web/System.Web.UI/Pair.cs36
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs72
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/PartialCachingAttribute.cs51
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs50
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/PersistenceMode.cs22
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/PersistenceModeAttribute.cs52
-rw-r--r--mcs/class/System.Web/System.Web.UI/PropertyConverter.cs124
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/RenderMethod.cs13
-rw-r--r--mcs/class/System.Web/System.Web.UI/StateBag.cs242
-rw-r--r--mcs/class/System.Web/System.Web.UI/StateItem.cs47
-rw-r--r--mcs/class/System.Web/System.Web.UI/TODO42
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/TagPrefixAttribute.cs37
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/TemplateContainerAttribute.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/TemplateControl.cs115
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/TemplateParser.cs17
-rw-r--r--mcs/class/System.Web/System.Web.UI/ToolboxDataAttribute.cs58
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/Triplet.cs36
-rw-r--r--mcs/class/System.Web/System.Web.UI/Utils.cs46
-rw-r--r--mcs/class/System.Web/System.Web.UI/ValidationPropertyAttribute.cs27
-rwxr-xr-xmcs/class/System.Web/System.Web.UI/ValidatorCollection.cs62
-rw-r--r--mcs/class/System.Web/System.Web.Utils/.cvsignore1
-rw-r--r--mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs31
-rw-r--r--mcs/class/System.Web/System.Web.Utils/ChangeLog57
-rw-r--r--mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs72
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileAction.cs26
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs43
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs62
-rw-r--r--mcs/class/System.Web/System.Web.Utils/FilePathParser.cs82
-rw-r--r--mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs110
-rw-r--r--mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs17
-rw-r--r--mcs/class/System.Web/System.Web.Utils/UrlUtils.cs283
-rw-r--r--mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs107
-rw-r--r--mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs54
-rw-r--r--mcs/class/System.Web/System.Web.build38
-rw-r--r--mcs/class/System.Web/System.Web/.cvsignore1
-rw-r--r--mcs/class/System.Web/System.Web/BeginEventHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web/ChangeLog173
-rw-r--r--mcs/class/System.Web/System.Web/EndEventHandler.cs13
-rw-r--r--mcs/class/System.Web/System.Web/HttpApplication.cs163
-rw-r--r--mcs/class/System.Web/System.Web/HttpApplicationState.cs232
-rwxr-xr-xmcs/class/System.Web/System.Web/HttpBrowserCapabilities.cs158
-rw-r--r--mcs/class/System.Web/System.Web/HttpCachePolicy.cs14
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs16
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheVaryByHeaders.cs110
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs81
-rw-r--r--mcs/class/System.Web/System.Web/HttpCacheability.cs17
-rw-r--r--mcs/class/System.Web/System.Web/HttpClientCertificate.cs147
-rw-r--r--mcs/class/System.Web/System.Web/HttpContext.cs247
-rw-r--r--mcs/class/System.Web/System.Web/HttpCookie.cs177
-rw-r--r--mcs/class/System.Web/System.Web/HttpCookieCollection.cs139
-rw-r--r--mcs/class/System.Web/System.Web/HttpException.cs59
-rw-r--r--mcs/class/System.Web/System.Web/HttpFileCollection.cs73
-rw-r--r--mcs/class/System.Web/System.Web/HttpHelper.cs48
-rw-r--r--mcs/class/System.Web/System.Web/HttpModuleCollection.cs73
-rw-r--r--mcs/class/System.Web/System.Web/HttpPostedFile.cs56
-rw-r--r--mcs/class/System.Web/System.Web/HttpRequest.cs835
-rw-r--r--mcs/class/System.Web/System.Web/HttpRequestStream.cs142
-rw-r--r--mcs/class/System.Web/System.Web/HttpResponse.cs750
-rw-r--r--mcs/class/System.Web/System.Web/HttpResponseHeader.cs53
-rw-r--r--mcs/class/System.Web/System.Web/HttpResponseStream.cs87
-rw-r--r--mcs/class/System.Web/System.Web/HttpResponseStreamProxy.cs48
-rw-r--r--mcs/class/System.Web/System.Web/HttpRuntime.cs278
-rw-r--r--mcs/class/System.Web/System.Web/HttpServerUtility.cs283
-rw-r--r--mcs/class/System.Web/System.Web/HttpSessionState.cs15
-rw-r--r--mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs64
-rw-r--r--mcs/class/System.Web/System.Web/HttpUtility.cs180
-rw-r--r--mcs/class/System.Web/System.Web/HttpValidationStatus.cs18
-rw-r--r--mcs/class/System.Web/System.Web/HttpValueCollection.cs142
-rw-r--r--mcs/class/System.Web/System.Web/HttpWorkerRequest.cs477
-rw-r--r--mcs/class/System.Web/System.Web/HttpWriter.cs230
-rw-r--r--mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs18
-rw-r--r--mcs/class/System.Web/System.Web/IHttpHandler.cs16
-rw-r--r--mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs19
-rw-r--r--mcs/class/System.Web/System.Web/IHttpModule.cs14
-rw-r--r--mcs/class/System.Web/System.Web/NOTES21
-rw-r--r--mcs/class/System.Web/System.Web/ProcessShutdownReason.cs22
-rw-r--r--mcs/class/System.Web/System.Web/ProcessStatus.cs19
-rw-r--r--mcs/class/System.Web/System.Web/TODO19
-rw-r--r--mcs/class/System.Web/System.Web/TODOAttribute.cs32
-rw-r--r--mcs/class/System.Web/System.Web/TraceContext.cs69
-rw-r--r--mcs/class/System.Web/System.Web/TraceMode.cs16
-rw-r--r--mcs/class/System.Web/System.Web/WebCategoryAttribute.cs38
-rw-r--r--mcs/class/System.Web/System.Web/WebSysDescriptionAttribute.cs44
-rw-r--r--mcs/class/System.Web/Test/test.aspx29
-rw-r--r--mcs/class/System.Web/Test/test2.aspx101
-rw-r--r--mcs/class/System.Web/Test/test3.aspx23
-rw-r--r--mcs/class/System.Web/Test/test4.aspx119
-rw-r--r--mcs/class/System.Web/Test/test5.aspx121
-rw-r--r--mcs/class/System.Web/Test/test6.aspx83
-rwxr-xr-xmcs/class/System.Web/list293
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Application.cs37
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs19
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Control.cs97
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Form.cs831
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs19
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/demo.cs40
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/makefile17
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleEvents.cs59
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleNavigation.cs32
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleObject.cs251
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleRole.cs80
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleSelection.cs30
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleStates.cs59
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AmbientProperties.cs61
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AnchorStyles.cs22
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Appearance.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ApplicationContext.cs84
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs24
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeStartingPosition.cs22
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs770
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BaseCollection.cs73
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Binding.cs101
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BindingContext.cs86
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs124
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BindingMemberInfo.cs148
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BindingsCollection.cs124
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BootMode.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DSide.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DStyle.cs27
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BorderStyle.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/BoundsSpecified.cs25
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBorderStyle.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonState.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CaptionButton.cs29
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog357
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CharacterCasing.cs26
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs185
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CheckState.cs27
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs454
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Clipboard.cs38
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDepth.cs22
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDialog.cs106
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventArgs.cs101
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeader.cs83
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeaderStyle.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs543
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBoxStyle.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CommonDialog.cs81
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventArgs.cs38
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ContextMenu.cs78
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ControlBindingsCollection.cs78
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventArgs.cs37
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs465
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ControlStyles.cs32
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventArgs.cs48
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CreateParams.cs120
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CurrencyManager.cs142
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs163
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/CursorConverter.cs67
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Cursors.cs169
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridCell.cs137
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridLineStyle.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridParentRowsLabelStyle.cs27
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DateRangeEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DateTimePickerFormat.cs6
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DialogResult.cs31
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DockStyle.cs29
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DragAction.cs27
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DragDropEffects.cs30
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DragEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemState.cs36
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DrawMode.cs26
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorBlinkStyle.cs27
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorIconAlignment.cs30
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorProvider.cs245
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FeatureSupport.cs52
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FileDialog.cs222
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FlatStyle.cs27
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FontDialog.cs224
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Form.ControlCollection.cs57
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FormBorderStyle.cs31
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FormStartPosition.cs29
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FormWindowState.cs27
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/FrameStyle.cs25
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Getopt.cs1093
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventArgs.cs61
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs115
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GridItem.cs97
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemCollection.cs54
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemType.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs112
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs206
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/HScrollBar.cs196
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Help.cs53
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventArgs.cs66
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/HelpNavigator.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/HelpProvider.cs128
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/HorizontalAlignment.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IButtonControl.cs17
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ICommandExecutor.cs22
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IComponentEditorPageSite.cs24
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IContainerControl.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridColumnStyleEditingNotificationService.cs17
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridEditingService.cs24
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IDataObject.cs33
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IFeatureSupport.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IFileReaderService.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IMessageFilter.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IWin32Window.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/IWindowTarget.cs25
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ImageIndexConverter.cs227
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.ImageCollection.cs120
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.cs263
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ImageListStreamer.cs33
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ImeMode.cs29
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguage.cs86
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangeEventArgs.cs64
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventArgs.cs64
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageCollection.cs58
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventArgs.cs52
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemActivation.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemBoundsPortion.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventArgs.cs43
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventArgs.cs67
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventArgs.cs63
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventArgs.cs97
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/KeyPressEventArgs.cs61
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Keys.cs202
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/KeysConverter.cs212
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventArgs.cs72
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventArgs.cs58
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LeftRightAlignment.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.LinkAreaConverter.cs192
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.cs145
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkBehavior.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventArgs.cs52
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabel.cs493
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventArgs.cs52
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/LinkState.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs212
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs713
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs284
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs1168
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewAlignment.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItem.cs478
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItemConverter.cs218
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MainMenu.cs257
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MdiLayout.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventArgs.cs129
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Menu.cs373
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MenuGlyph.cs24
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MenuItem.cs515
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MenuMerge.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Message.cs171
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxButtons.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxDefaultButton.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxIcon.cs26
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxOptions.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MethodInvoker.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs2089
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MouseButtons.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventArgs.cs111
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventArgs.cs84
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventArgs.cs105
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/NotifyIcon.cs213
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/NumericUpDown.cs2001
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/OSFeature.cs105
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/OpacityConverter.cs270
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/OpenFileDialog.cs354
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Orientation.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PageSetupDialog.cs274
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventArgs.cs101
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Panel.cs1756
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PictureBoxSizeMode.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs100
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PrintDialog.cs261
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PropertySort.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyTabChangedEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyValueChangedEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventArgs.cs78
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventArgs.cs67
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs320
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs748
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxFinds.cs22
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxScrollBars.cs24
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionAttribute.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionTypes.cs22
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxStreamType.cs22
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxWordPunctuations.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/RightToLeft.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SaveFileDialog.cs83
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Screen.cs127
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBar.cs333
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBars.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollButton.cs23
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventArgs.cs61
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventType.cs26
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SecurityIDType.cs26
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventArgs.cs58
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionMode.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRange.cs79
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRangeConverter.cs212
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SendKeys.cs48
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Shortcut.cs167
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SizeGripStyle.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SortOrder.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Splitter.cs345
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventArgs.cs77
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBar.cs342
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventArgs.cs103
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs121
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelAutoSize.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelBorderStyle.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventArgs.cs101
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelCollection.cs110
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelStyle.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/StructFormat.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/SystemInformation.cs332
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TabAlignment.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TabAppearance.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TabControl.cs438
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TabDrawMode.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TabPage.cs121
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TabSizeMode.cs20
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TextBox.cs136
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TextBoxBase.cs405
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ThreadExceptionDialog.cs28
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TickStyle.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/Timer.cs94
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBar.cs416
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarAppearance.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButton.cs176
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonClickEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonStyle.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarTextAlign.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TrackBar.cs256
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNode.cs315
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs106
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeConverter.cs41
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeView.cs484
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewAction.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventArgs.cs45
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventArgs.cs50
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewImageIndexConverter.cs38
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/UICues.cs24
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventArgs.cs96
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventHandler.cs18
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownBase.cs294
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownEventHandler.cs19
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/UserControl.cs58
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/VScrollBar.cs42
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/View.cs21
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/day.cs25
-rw-r--r--mcs/class/System.XML/.cvsignore6
-rw-r--r--mcs/class/System.XML/ChangeLog23
-rw-r--r--mcs/class/System.XML/Mono.System.XML.csproj475
-rw-r--r--mcs/class/System.XML/Mono.System.XML.sln27
-rwxr-xr-xmcs/class/System.XML/README8
-rw-r--r--mcs/class/System.XML/System.XML.build38
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/BUGS-MS.txt20
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/BUGS.txt5
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/ChangeLog56
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/ValidationEventArgs.cs38
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/ValidationHandler.cs48
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchema.cs704
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs165
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs56
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs145
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs192
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs169
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs91
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs384
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs208
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs126
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs203
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs118
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaCollectionEnumerator.cs47
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs162
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs254
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs256
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs463
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaContent.cs15
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaContentModel.cs19
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs22
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaContentType.cs17
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs24
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs31
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs104
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs625
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaEnumerationFacet.cs87
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaException.cs68
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs62
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs37
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs19
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaFractionDigitsFacet.cs98
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs195
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupBase.cs20
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs156
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs92
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs109
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs97
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaInfo.cs24
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaKey.cs127
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs151
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaLengthFacet.cs96
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.cs96
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.cs96
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxLengthFacet.cs97
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaMinExclusiveFacet.cs96
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaMinInclusiveFacet.cs95
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaMinLengthFacet.cs96
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs158
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaNumericFacet.cs16
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs73
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs82
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectEnumerator.cs49
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectTable.cs51
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs98
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaPatternFacet.cs87
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaReader.cs358
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs151
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs202
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs146
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs190
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs337
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs234
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeContent.cs17
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs152
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs267
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs175
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaTotalDigitsFacet.cs96
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs81
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaUnique.cs126
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs22
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaUtil.cs299
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.cs97
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs104
-rwxr-xr-xmcs/class/System.XML/System.Xml.Schema/XmlSeverityType.cs15
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/AssemblyInfo.cs58
-rwxr-xr-xmcs/class/System.XML/System.Xml.Serialization/ChangeLog4
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs61
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapAttributeOverrides.cs72
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapAttributes.cs88
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapElementAttribute.cs60
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapEnumAttribute.cs40
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapIgnoreAttribute.cs25
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapIncludeAttribute.cs41
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/SoapTypeAttribute.cs59
-rwxr-xr-xmcs/class/System.XML/System.Xml.Serialization/TypeMember.cs54
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventArgs.cs35
-rwxr-xr-xmcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventHandler.cs16
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlAnyAttributeAttribute.cs28
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttribute.cs57
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttributes.cs61
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlArrayAttribute.cs81
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttribute.cs76
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttributes.cs61
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlAttributeAttribute.cs95
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs49
-rwxr-xr-xmcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventHandler.cs16
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlAttributeOverrides.cs60
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlAttributes.cs182
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlChoiceIdentifierAttribute.cs41
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlElementAttribute.cs95
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlElementAttributes.cs54
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs53
-rwxr-xr-xmcs/class/System.XML/System.Xml.Serialization/XmlElementEventHandler.cs16
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlEnumAttribute.cs41
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlIgnoreAttribute.cs26
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlIncludeAttribute.cs37
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs20
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlNamespaceDeclarationsAttribute.cs26
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlNodeEventArgs.cs82
-rwxr-xr-xmcs/class/System.XML/System.Xml.Serialization/XmlNodeEventHandler.cs16
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs73
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs127
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlSerializerNamespaces.cs55
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlTextAttribute.cs52
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlTypeAttribute.cs60
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs42
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/ChangeLog72
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs586
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/Expression.cs1031
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs16
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/Iterator.cs568
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/Parser.cs1086
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/Parser.jay388
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/Tokenizer.cs341
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathDocument.cs66
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathException.cs57
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathExpression.cs50
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathNamespaceScope.cs18
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs212
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathNodeIterator.cs63
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathNodeType.cs25
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XPathResultType.cs22
-rwxr-xr-xmcs/class/System.XML/System.Xml.XPath/XmlCaseOrder.cs33
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XmlDataType.cs17
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/XmlSortOrder.cs17
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/ChangeLog4
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/IXsltContextFunction.cs28
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/IXsltContextVariable.cs27
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs154
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs131
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs56
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs45
-rw-r--r--mcs/class/System.XML/System.Xml.Xsl/XsltException.cs72
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog637
-rw-r--r--mcs/class/System.XML/System.Xml/Driver.cs56
-rwxr-xr-xmcs/class/System.XML/System.Xml/EntityHandling.cs29
-rwxr-xr-xmcs/class/System.XML/System.Xml/Formatting.cs29
-rwxr-xr-xmcs/class/System.XML/System.Xml/IHasXmlNode.cs15
-rw-r--r--mcs/class/System.XML/System.Xml/IXmlLineInfo.cs19
-rwxr-xr-xmcs/class/System.XML/System.Xml/NameTable.cs74
-rw-r--r--mcs/class/System.XML/System.Xml/Profile.cs47
-rw-r--r--mcs/class/System.XML/System.Xml/ReadState.cs41
-rw-r--r--mcs/class/System.XML/System.Xml/TODOAttribute.cs32
-rwxr-xr-xmcs/class/System.XML/System.Xml/ValidationType.cs20
-rw-r--r--mcs/class/System.XML/System.Xml/WhitespaceHandling.cs33
-rwxr-xr-xmcs/class/System.XML/System.Xml/WriteState.cs53
-rw-r--r--mcs/class/System.XML/System.Xml/XmlAttribute.cs195
-rw-r--r--mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs117
-rw-r--r--mcs/class/System.XML/System.Xml/XmlCDataSection.cs54
-rw-r--r--mcs/class/System.XML/System.Xml/XmlChar.cs200
-rw-r--r--mcs/class/System.XML/System.Xml/XmlCharacterData.cs95
-rw-r--r--mcs/class/System.XML/System.Xml/XmlComment.cs58
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlConstructs.cs545
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlConvert.cs254
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDeclaration.cs107
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocument.cs580
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs84
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs311
-rw-r--r--mcs/class/System.XML/System.Xml/XmlDocumentType.cs98
-rw-r--r--mcs/class/System.XML/System.Xml/XmlElement.cs288
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlEntity.cs123
-rw-r--r--mcs/class/System.XML/System.Xml/XmlEntityReference.cs70
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlException.cs81
-rw-r--r--mcs/class/System.XML/System.Xml/XmlImplementation.cs32
-rw-r--r--mcs/class/System.XML/System.Xml/XmlLinkedNode.cs66
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNameTable.cs20
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs104
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs155
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNode.cs385
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeArrayList.cs36
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs27
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs67
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNodeChangedEventHandler.cs14
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeList.cs42
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeListChildren.cs146
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNodeOrder.cs19
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNodeReader.cs247
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNodeType.cs93
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlNotation.cs100
-rw-r--r--mcs/class/System.XML/System.Xml/XmlParserContext.cs186
-rw-r--r--mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs96
-rw-r--r--mcs/class/System.XML/System.Xml/XmlQualifiedName.cs114
-rw-r--r--mcs/class/System.XML/System.Xml/XmlReader.cs241
-rw-r--r--mcs/class/System.XML/System.Xml/XmlResolver.cs32
-rw-r--r--mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs65
-rw-r--r--mcs/class/System.XML/System.Xml/XmlSpace.cs37
-rw-r--r--mcs/class/System.XML/System.Xml/XmlText.cs69
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs1280
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextWriter.cs644
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextWriterOpenElement.cs61
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlTokenizedType.cs27
-rwxr-xr-xmcs/class/System.XML/System.Xml/XmlUrlResolver.cs41
-rw-r--r--mcs/class/System.XML/System.Xml/XmlWhitespace.cs66
-rw-r--r--mcs/class/System.XML/System.Xml/XmlWriter.cs170
-rw-r--r--mcs/class/System.XML/Test/.cvsignore4
-rw-r--r--mcs/class/System.XML/Test/AllTests.cs43
-rw-r--r--mcs/class/System.XML/Test/ChangeLog336
-rw-r--r--mcs/class/System.XML/Test/Microsoft.Test.csproj162
-rw-r--r--mcs/class/System.XML/Test/Mono.Test.csproj167
-rw-r--r--mcs/class/System.XML/Test/MonoMicro.Test.csproj182
-rwxr-xr-xmcs/class/System.XML/Test/NameTableTests.cs91
-rw-r--r--mcs/class/System.XML/Test/System.XML_test.build52
-rw-r--r--mcs/class/System.XML/Test/TheTests.cs93
-rw-r--r--mcs/class/System.XML/Test/XPathNavigatorTests.cs172
-rw-r--r--mcs/class/System.XML/Test/XmlAttributeTests.cs95
-rwxr-xr-xmcs/class/System.XML/Test/XmlCDataSectionTests.cs99
-rwxr-xr-xmcs/class/System.XML/Test/XmlCommentTests.cs107
-rwxr-xr-xmcs/class/System.XML/Test/XmlDeclarationTests.cs130
-rw-r--r--mcs/class/System.XML/Test/XmlDocumentTests.cs354
-rwxr-xr-xmcs/class/System.XML/Test/XmlDocumentTypeTests.cs104
-rw-r--r--mcs/class/System.XML/Test/XmlElementTests.cs131
-rw-r--r--mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs138
-rw-r--r--mcs/class/System.XML/Test/XmlNodeListTests.cs206
-rw-r--r--mcs/class/System.XML/Test/XmlProcessingInstructionTests.cs36
-rwxr-xr-xmcs/class/System.XML/Test/XmlSignificantWhitespaceTests.cs117
-rw-r--r--mcs/class/System.XML/Test/XmlTextReaderTests.cs1785
-rw-r--r--mcs/class/System.XML/Test/XmlTextTests.cs36
-rw-r--r--mcs/class/System.XML/Test/XmlTextWriterTests.cs903
-rwxr-xr-xmcs/class/System.XML/Test/XmlWhiteSpaceTests.cs117
-rwxr-xr-xmcs/class/System.XML/list190
-rwxr-xr-xmcs/class/System.XML/list.unix195
-rw-r--r--mcs/class/System/.cvsignore2
-rw-r--r--mcs/class/System/ChangeLog41
-rw-r--r--mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs760
-rw-r--r--mcs/class/System/Microsoft.CSharp/CSharpCodeProvider.cs55
-rw-r--r--mcs/class/System/Microsoft.CSharp/ChangeLog10
-rwxr-xr-xmcs/class/System/README8
-rwxr-xr-xmcs/class/System/System.CodeDom.Compiler/ChangeLog35
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs69
-rwxr-xr-xmcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs936
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs99
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/CompilerErrorCollection.cs16
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/CompilerOptions.cs16
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/CompilerParameters.cs160
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/CompilerResults.cs87
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs38
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/ICodeCompiler.cs32
-rwxr-xr-xmcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs53
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/ICodeParser.cs20
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/IndentedTextWriter.cs286
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/LanguageOptions.cs18
-rw-r--r--mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs16
-rw-r--r--mcs/class/System/System.CodeDom/ChangeLog229
-rw-r--r--mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs46
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs145
-rw-r--r--mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs56
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAssignStatement.cs55
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttachEventStatement.cs68
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeArgument.cs61
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs100
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs63
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs100
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs21
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs69
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs35
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCastExpression.cs71
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCatchClause.cs81
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs98
-rw-r--r--mcs/class/System/System.CodeDom/CodeComment.cs62
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeCommentStatement.cs57
-rw-r--r--mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs100
-rw-r--r--mcs/class/System/System.CodeDom/CodeCompileUnit.cs60
-rw-r--r--mcs/class/System/System.CodeDom/CodeConditionStatement.cs77
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeConstructor.cs52
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs72
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs64
-rw-r--r--mcs/class/System/System.CodeDom/CodeDirectionExpression.cs59
-rw-r--r--mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs21
-rw-r--r--mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs57
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeExpression.cs21
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeExpressionCollection.cs100
-rw-r--r--mcs/class/System/System.CodeDom/CodeExpressionStatement.cs46
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs59
-rw-r--r--mcs/class/System/System.CodeDom/CodeGotoStatement.cs42
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeIndexerExpression.cs58
-rw-r--r--mcs/class/System/System.CodeDom/CodeIterationStatement.cs81
-rw-r--r--mcs/class/System/System.CodeDom/CodeLabeledStatement.cs62
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeLinePragma.cs56
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberEvent.cs62
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberField.cs67
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberMethod.cs109
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMemberProperty.cs108
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs65
-rw-r--r--mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs59
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs47
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeNamespace.cs92
-rw-r--r--mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs99
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeNamespaceImport.cs57
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs150
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeObject.cs35
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs72
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs88
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs100
-rwxr-xr-xmcs/class/System/System.CodeDom/CodePrimitiveExpression.cs46
-rwxr-xr-xmcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs59
-rw-r--r--mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs21
-rw-r--r--mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs68
-rw-r--r--mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs52
-rw-r--r--mcs/class/System/System.CodeDom/CodeSnippetExpression.cs46
-rw-r--r--mcs/class/System/System.CodeDom/CodeSnippetStatement.cs46
-rw-r--r--mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs46
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeStatement.cs42
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeStatementCollection.cs105
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs28
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs46
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs73
-rw-r--r--mcs/class/System/System.CodeDom/CodeTypeConstructor.cs21
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeDeclaration.cs149
-rw-r--r--mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs99
-rw-r--r--mcs/class/System/System.CodeDom/CodeTypeDelegate.cs55
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeMember.cs81
-rw-r--r--mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs99
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeOfExpression.cs57
-rw-r--r--mcs/class/System/System.CodeDom/CodeTypeReference.cs91
-rw-r--r--mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs99
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs57
-rwxr-xr-xmcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs108
-rw-r--r--mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs46
-rwxr-xr-xmcs/class/System/System.CodeDom/FieldDirection.cs21
-rwxr-xr-xmcs/class/System/System.CodeDom/MemberAttributes.cs38
-rw-r--r--mcs/class/System/System.Collections.Specialized/BitVector32.cs183
-rwxr-xr-xmcs/class/System/System.Collections.Specialized/ChangeLog51
-rw-r--r--mcs/class/System/System.Collections.Specialized/CollectionsUtil.cs38
-rw-r--r--mcs/class/System/System.Collections.Specialized/HybridDictionary.cs183
-rw-r--r--mcs/class/System/System.Collections.Specialized/ListDictionary.cs435
-rw-r--r--mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs512
-rw-r--r--mcs/class/System/System.Collections.Specialized/NameValueCollection.cs367
-rwxr-xr-xmcs/class/System/System.Collections.Specialized/StringCollection.cs293
-rw-r--r--mcs/class/System/System.Collections.Specialized/StringDictionary.cs97
-rw-r--r--mcs/class/System/System.Collections.Specialized/StringEnumerator.cs36
-rw-r--r--mcs/class/System/System.ComponentModel/AttributeCollection.cs92
-rwxr-xr-xmcs/class/System/System.ComponentModel/BrowsableAttribute.cs38
-rwxr-xr-xmcs/class/System/System.ComponentModel/CategoryAttribute.cs227
-rw-r--r--mcs/class/System/System.ComponentModel/ChangeLog165
-rw-r--r--mcs/class/System/System.ComponentModel/CollectionChangeAction.cs20
-rw-r--r--mcs/class/System/System.ComponentModel/CollectionChangeEventArgs.cs38
-rw-r--r--mcs/class/System/System.ComponentModel/CollectionChangeEventHandler.cs14
-rw-r--r--mcs/class/System/System.ComponentModel/Component.cs126
-rw-r--r--mcs/class/System/System.ComponentModel/ComponentCollection.cs21
-rw-r--r--mcs/class/System/System.ComponentModel/Container.cs159
-rwxr-xr-xmcs/class/System/System.ComponentModel/DefaultValueAttribute.cs133
-rwxr-xr-xmcs/class/System/System.ComponentModel/DescriptionAttribute.cs46
-rwxr-xr-xmcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs37
-rwxr-xr-xmcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs16
-rwxr-xr-xmcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs42
-rwxr-xr-xmcs/class/System/System.ComponentModel/EditorBrowsableAttribute.cs53
-rwxr-xr-xmcs/class/System/System.ComponentModel/EditorBrowsableState.cs34
-rw-r--r--mcs/class/System/System.ComponentModel/EventDescriptor.cs26
-rw-r--r--mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs167
-rw-r--r--mcs/class/System/System.ComponentModel/EventHandlerList.cs64
-rw-r--r--mcs/class/System/System.ComponentModel/IBindingList.cs69
-rw-r--r--mcs/class/System/System.ComponentModel/IComponent.cs22
-rw-r--r--mcs/class/System/System.ComponentModel/IContainer.cs24
-rw-r--r--mcs/class/System/System.ComponentModel/ICustomTypeDescriptor.cs38
-rw-r--r--mcs/class/System/System.ComponentModel/IDataErrorInfo.cs18
-rw-r--r--mcs/class/System/System.ComponentModel/IEditableObject.cs20
-rw-r--r--mcs/class/System/System.ComponentModel/IListSource.cs23
-rw-r--r--mcs/class/System/System.ComponentModel/ISite.cs23
-rw-r--r--mcs/class/System/System.ComponentModel/ISupportInitialize.cs23
-rwxr-xr-xmcs/class/System/System.ComponentModel/ISynchronizeInvoke.cs26
-rw-r--r--mcs/class/System/System.ComponentModel/ITypeDescriptorContext.cs29
-rw-r--r--mcs/class/System/System.ComponentModel/ITypedList.cs24
-rwxr-xr-xmcs/class/System/System.ComponentModel/ListChangedEventArgs.cs53
-rwxr-xr-xmcs/class/System/System.ComponentModel/ListChangedEventHandler.cs15
-rwxr-xr-xmcs/class/System/System.ComponentModel/ListChangedType.cs23
-rw-r--r--mcs/class/System/System.ComponentModel/ListSortDirection.cs20
-rwxr-xr-xmcs/class/System/System.ComponentModel/LocalizableAttribute.cs40
-rw-r--r--mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs78
-rwxr-xr-xmcs/class/System/System.ComponentModel/MemberDescriptor.cs120
-rw-r--r--mcs/class/System/System.ComponentModel/PropertyChangedEventArgs.cs29
-rwxr-xr-xmcs/class/System/System.ComponentModel/PropertyDescriptor.cs114
-rw-r--r--mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs229
-rwxr-xr-xmcs/class/System/System.ComponentModel/ReadOnlyAttribute.cs36
-rw-r--r--mcs/class/System/System.ComponentModel/StringConverter.cs34
-rwxr-xr-xmcs/class/System/System.ComponentModel/TypeConverter.cs277
-rw-r--r--mcs/class/System/System.ComponentModel/TypeConverterAttribute.cs53
-rw-r--r--mcs/class/System/System.ComponentModel/TypeDescriptor.cs43
-rwxr-xr-xmcs/class/System/System.ComponentModel/Win32Exception.cs118
-rw-r--r--mcs/class/System/System.Configuration/ChangeLog25
-rw-r--r--mcs/class/System/System.Configuration/ConfigurationException.cs132
-rw-r--r--mcs/class/System/System.Configuration/ConfigurationSettings.cs198
-rw-r--r--mcs/class/System/System.Configuration/DictionarySectionHandler.cs91
-rw-r--r--mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs27
-rw-r--r--mcs/class/System/System.Configuration/IgnoreSectionHandler.cs45
-rw-r--r--mcs/class/System/System.Configuration/NameValueSectionHandler.cs107
-rw-r--r--mcs/class/System/System.Configuration/SingleTagSectionHandler.cs64
-rwxr-xr-xmcs/class/System/System.Diagnostics/BooleanSwitch.cs59
-rw-r--r--mcs/class/System/System.Diagnostics/ChangeLog127
-rw-r--r--mcs/class/System/System.Diagnostics/Debug.cs197
-rw-r--r--mcs/class/System/System.Diagnostics/DefaultTraceListener.cs225
-rw-r--r--mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs41
-rw-r--r--mcs/class/System/System.Diagnostics/EntryWrittenEventArgs.cs34
-rw-r--r--mcs/class/System/System.Diagnostics/EntryWrittenEventHandler.cs21
-rw-r--r--mcs/class/System/System.Diagnostics/EventLog.cs271
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogEntry.cs105
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs57
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogEntryType.cs24
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogInstaller.cs75
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogPermission.cs50
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs23
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs48
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogPermissionEntry.cs37
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogPermissionEntryCollection.cs104
-rw-r--r--mcs/class/System/System.Diagnostics/EventLogTraceListener.cs75
-rwxr-xr-xmcs/class/System/System.Diagnostics/FileVersionInfo.cs274
-rw-r--r--mcs/class/System/System.Diagnostics/ICollectData.cs26
-rwxr-xr-xmcs/class/System/System.Diagnostics/Process.cs545
-rwxr-xr-xmcs/class/System/System.Diagnostics/ProcessModule.cs74
-rwxr-xr-xmcs/class/System/System.Diagnostics/ProcessModuleCollection.cs57
-rwxr-xr-xmcs/class/System/System.Diagnostics/ProcessPriorityClass.cs20
-rwxr-xr-xmcs/class/System/System.Diagnostics/ProcessStartInfo.cs171
-rwxr-xr-xmcs/class/System/System.Diagnostics/ProcessThread.cs118
-rwxr-xr-xmcs/class/System/System.Diagnostics/ProcessThreadCollection.cs56
-rwxr-xr-xmcs/class/System/System.Diagnostics/ProcessWindowStyle.cs18
-rwxr-xr-xmcs/class/System/System.Diagnostics/Switch.cs75
-rw-r--r--mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs107
-rwxr-xr-xmcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs21
-rwxr-xr-xmcs/class/System/System.Diagnostics/ThreadState.cs22
-rwxr-xr-xmcs/class/System/System.Diagnostics/ThreadWaitReason.cs28
-rw-r--r--mcs/class/System/System.Diagnostics/Trace.cs197
-rw-r--r--mcs/class/System/System.Diagnostics/TraceImpl.cs298
-rwxr-xr-xmcs/class/System/System.Diagnostics/TraceLevel.cs24
-rw-r--r--mcs/class/System/System.Diagnostics/TraceListener.cs136
-rw-r--r--mcs/class/System/System.Diagnostics/TraceListenerCollection.cs210
-rwxr-xr-xmcs/class/System/System.Diagnostics/TraceSwitch.cs74
-rwxr-xr-xmcs/class/System/System.Globalization/Locale.cs22
-rw-r--r--mcs/class/System/System.Net.Sockets/AddressFamily.cs50
-rw-r--r--mcs/class/System/System.Net.Sockets/ChangeLog64
-rw-r--r--mcs/class/System/System.Net.Sockets/LingerOption.cs42
-rw-r--r--mcs/class/System/System.Net.Sockets/MulticastOption.cs48
-rw-r--r--mcs/class/System/System.Net.Sockets/NetworkStream.cs307
-rw-r--r--mcs/class/System/System.Net.Sockets/ProtocolFamily.cs47
-rw-r--r--mcs/class/System/System.Net.Sockets/ProtocolType.cs81
-rw-r--r--mcs/class/System/System.Net.Sockets/SelectMode.cs33
-rw-r--r--mcs/class/System/System.Net.Sockets/Socket.cs957
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketException.cs41
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketFlags.cs42
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs37
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketOptionName.cs181
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketShutdown.cs33
-rw-r--r--mcs/class/System/System.Net.Sockets/SocketType.cs45
-rwxr-xr-xmcs/class/System/System.Net.Sockets/TcpClient.cs338
-rwxr-xr-xmcs/class/System/System.Net.Sockets/TcpListener.cs171
-rw-r--r--mcs/class/System/System.Net.Sockets/UdpClient.cs269
-rwxr-xr-xmcs/class/System/System.Net/AuthenticationManager.cs55
-rwxr-xr-xmcs/class/System/System.Net/Authorization.cs52
-rw-r--r--mcs/class/System/System.Net/ChangeLog232
-rwxr-xr-xmcs/class/System/System.Net/ConnectionModes.cs37
-rw-r--r--mcs/class/System/System.Net/Cookie.cs276
-rw-r--r--mcs/class/System/System.Net/CookieCollection.cs110
-rw-r--r--mcs/class/System/System.Net/CookieContainer.cs130
-rw-r--r--mcs/class/System/System.Net/CookieException.cs42
-rw-r--r--mcs/class/System/System.Net/CredentialCache.cs170
-rw-r--r--mcs/class/System/System.Net/Dns.cs146
-rw-r--r--mcs/class/System/System.Net/DnsPermission.cs139
-rw-r--r--mcs/class/System/System.Net/DnsPermissionAttribute.cs38
-rwxr-xr-xmcs/class/System/System.Net/EndPoint.cs40
-rw-r--r--mcs/class/System/System.Net/EndpointPermission.cs326
-rw-r--r--mcs/class/System/System.Net/FileWebRequest.cs295
-rw-r--r--mcs/class/System/System.Net/FileWebResponse.cs139
-rw-r--r--mcs/class/System/System.Net/GlobalProxySelection.cs74
-rw-r--r--mcs/class/System/System.Net/HttpContinueDelegate.cs13
-rwxr-xr-xmcs/class/System/System.Net/HttpStatusCode.cs205
-rw-r--r--mcs/class/System/System.Net/HttpVersion.cs22
-rw-r--r--mcs/class/System/System.Net/HttpWebRequest.cs579
-rw-r--r--mcs/class/System/System.Net/HttpWebResponse.cs271
-rwxr-xr-xmcs/class/System/System.Net/IAuthenticationModule.cs30
-rw-r--r--mcs/class/System/System.Net/ICertificatePolicy.cs22
-rwxr-xr-xmcs/class/System/System.Net/ICredentialLookup.cs18
-rwxr-xr-xmcs/class/System/System.Net/IPAddress.cs231
-rwxr-xr-xmcs/class/System/System.Net/IPEndPoint.cs129
-rw-r--r--mcs/class/System/System.Net/IPHostEntry.cs75
-rw-r--r--mcs/class/System/System.Net/IPv6Address.cs278
-rw-r--r--mcs/class/System/System.Net/IWebProxy.cs24
-rw-r--r--mcs/class/System/System.Net/IWebRequestCreate.cs15
-rw-r--r--mcs/class/System/System.Net/MonoHttpDate.cs33
-rwxr-xr-xmcs/class/System/System.Net/NetworkAccess.cs29
-rwxr-xr-xmcs/class/System/System.Net/NetworkCredential.cs63
-rw-r--r--mcs/class/System/System.Net/ProtocolViolationException.cs38
-rwxr-xr-xmcs/class/System/System.Net/ProxyUseType.cs37
-rw-r--r--mcs/class/System/System.Net/ServicePoint.cs105
-rw-r--r--mcs/class/System/System.Net/ServicePointManager.cs169
-rwxr-xr-xmcs/class/System/System.Net/SocketAddress.cs101
-rw-r--r--mcs/class/System/System.Net/SocketPermission.cs339
-rw-r--r--mcs/class/System/System.Net/SocketPermissionAttribute.cs127
-rwxr-xr-xmcs/class/System/System.Net/TransportType.cs41
-rw-r--r--mcs/class/System/System.Net/WebClient.cs123
-rw-r--r--mcs/class/System/System.Net/WebException.cs74
-rwxr-xr-xmcs/class/System/System.Net/WebExceptionStatus.cs85
-rw-r--r--mcs/class/System/System.Net/WebHeaderCollection.cs310
-rw-r--r--mcs/class/System/System.Net/WebProxy.cs194
-rw-r--r--mcs/class/System/System.Net/WebRequest.cs216
-rw-r--r--mcs/class/System/System.Net/WebResponse.cs69
-rwxr-xr-xmcs/class/System/System.Net/WebStatus.cs77
-rw-r--r--mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog4
-rw-r--r--mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs146
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/ChangeLog34
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs92
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs20
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/arch.cs333
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/cache.cs143
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/category.cs637
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/collections.cs123
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/compiler.cs368
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/debug.cs208
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/interpreter.cs953
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/interval.cs305
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/match.cs157
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/notes.txt45
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/parser.cs1109
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/quicksearch.cs108
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/regex.cs404
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/replace.cs181
-rw-r--r--mcs/class/System/System.Text.RegularExpressions/syntax.cs976
-rwxr-xr-xmcs/class/System/System.Threading/ChangeLog9
-rwxr-xr-xmcs/class/System/System.Threading/ThreadExceptionEventArgs.cs27
-rwxr-xr-xmcs/class/System/System.Threading/ThreadExceptionEventHandler.cs14
-rw-r--r--mcs/class/System/System.build40
-rw-r--r--mcs/class/System/System/ChangeLog45
-rw-r--r--mcs/class/System/System/TODOAttribute.cs32
-rwxr-xr-xmcs/class/System/System/Uri.cs823
-rw-r--r--mcs/class/System/System/UriBuilder.cs247
-rwxr-xr-xmcs/class/System/System/UriFormatException.cs43
-rwxr-xr-xmcs/class/System/System/UriHostNameType.cs41
-rwxr-xr-xmcs/class/System/System/UriPartial.cs33
-rw-r--r--mcs/class/System/Test/.cvsignore1
-rw-r--r--mcs/class/System/Test/AllTests.cs33
-rwxr-xr-xmcs/class/System/Test/BasicOperationsTest.cs165
-rw-r--r--mcs/class/System/Test/ChangeLog84
-rw-r--r--mcs/class/System/Test/System.Collections.Specialized/AllTests.cs31
-rw-r--r--mcs/class/System/Test/System.Collections.Specialized/BitVector32Test.cs140
-rw-r--r--mcs/class/System/Test/System.Collections.Specialized/ChangeLog7
-rw-r--r--mcs/class/System/Test/System.Collections.Specialized/HybridDictionaryTest.cs57
-rw-r--r--mcs/class/System/Test/System.Collections.Specialized/NameValueCollectionTest.cs35
-rw-r--r--mcs/class/System/Test/System.Collections.Specialized/StringCollectionTest.cs157
-rw-r--r--mcs/class/System/Test/System.Diagnostics/AllTests.cs29
-rw-r--r--mcs/class/System/Test/System.Diagnostics/ChangeLog14
-rw-r--r--mcs/class/System/Test/System.Diagnostics/TraceTest.cs155
-rw-r--r--mcs/class/System/Test/System.Net.Sockets/AllTests.cs33
-rw-r--r--mcs/class/System/Test/System.Net.Sockets/ChangeLog6
-rwxr-xr-xmcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs82
-rwxr-xr-xmcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs85
-rw-r--r--mcs/class/System/Test/System.Net/AllTests.cs47
-rw-r--r--mcs/class/System/Test/System.Net/ChangeLog78
-rw-r--r--mcs/class/System/Test/System.Net/CookieCollectionTest.cs123
-rw-r--r--mcs/class/System/Test/System.Net/CookieTest.cs165
-rw-r--r--mcs/class/System/Test/System.Net/CredentialCacheTest.cs120
-rw-r--r--mcs/class/System/Test/System.Net/DnsTest.cs172
-rw-r--r--mcs/class/System/Test/System.Net/FileWebRequestTest.cs306
-rw-r--r--mcs/class/System/Test/System.Net/HttpWebRequestTest.cs101
-rw-r--r--mcs/class/System/Test/System.Net/IPAddressTest.cs234
-rw-r--r--mcs/class/System/Test/System.Net/IPEndPointTest.cs134
-rw-r--r--mcs/class/System/Test/System.Net/ServicePointManagerTest.cs113
-rw-r--r--mcs/class/System/Test/System.Net/ServicePointTest.cs171
-rw-r--r--mcs/class/System/Test/System.Net/SocketPermissionTest.cs113
-rw-r--r--mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs213
-rw-r--r--mcs/class/System/Test/System.Net/WebProxyTest.cs180
-rw-r--r--mcs/class/System/Test/System.Net/WebRequestTest.cs122
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs26
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs40
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs746
-rw-r--r--mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs98
-rw-r--r--mcs/class/System/Test/System/AllTests.cs29
-rw-r--r--mcs/class/System/Test/System/ChangeLog17
-rw-r--r--mcs/class/System/Test/System/UriBuilderTest.cs147
-rw-r--r--mcs/class/System/Test/System/UriTest.cs537
-rw-r--r--mcs/class/System/Test/System_test.build54
-rw-r--r--mcs/class/System/Test/TheTests.cs74
-rwxr-xr-xmcs/class/System/list140
-rwxr-xr-xmcs/class/System/list.unix283
-rw-r--r--mcs/class/corlib/.cvsignore2
-rw-r--r--mcs/class/corlib/ChangeLog88
-rw-r--r--mcs/class/corlib/Linux/ChangeLog27
-rw-r--r--mcs/class/corlib/Linux/Linux.cs484
-rw-r--r--mcs/class/corlib/System.Collections/ArrayList.cs1009
-rw-r--r--mcs/class/corlib/System.Collections/BitArray.cs499
-rw-r--r--mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs77
-rw-r--r--mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs92
-rw-r--r--mcs/class/corlib/System.Collections/ChangeLog285
-rw-r--r--mcs/class/corlib/System.Collections/CollectionBase.cs137
-rw-r--r--mcs/class/corlib/System.Collections/Comparer.cs56
-rwxr-xr-xmcs/class/corlib/System.Collections/DictionaryBase.cs372
-rw-r--r--mcs/class/corlib/System.Collections/DictionaryEntry.cs24
-rw-r--r--mcs/class/corlib/System.Collections/Hashtable.cs1046
-rw-r--r--mcs/class/corlib/System.Collections/ICollection.cs24
-rw-r--r--mcs/class/corlib/System.Collections/IComparer.cs19
-rw-r--r--mcs/class/corlib/System.Collections/IDictionary.cs40
-rw-r--r--mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs20
-rw-r--r--mcs/class/corlib/System.Collections/IEnumerable.cs18
-rw-r--r--mcs/class/corlib/System.Collections/IEnumerator.cs22
-rw-r--r--mcs/class/corlib/System.Collections/IHashCodeProvider.cs18
-rw-r--r--mcs/class/corlib/System.Collections/IList.cs40
-rw-r--r--mcs/class/corlib/System.Collections/Queue.cs342
-rw-r--r--mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs45
-rw-r--r--mcs/class/corlib/System.Collections/SortedList.cs862
-rw-r--r--mcs/class/corlib/System.Collections/Stack.cs321
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs71
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs33
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs33
-rw-r--r--mcs/class/corlib/System.Configuration.Assemblies/ChangeLog6
-rwxr-xr-xmcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs101
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog29
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs19
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs30
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs13
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs38
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs21
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs38
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs26
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs28
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs88
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs25
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs21
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs31
-rw-r--r--mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs21
-rwxr-xr-xmcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs29
-rw-r--r--mcs/class/corlib/System.Diagnostics/ChangeLog67
-rw-r--r--mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs30
-rw-r--r--mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Diagnostics/Debugger.cs94
-rw-r--r--mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs25
-rw-r--r--mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs23
-rw-r--r--mcs/class/corlib/System.Diagnostics/StackFrame.cs321
-rw-r--r--mcs/class/corlib/System.Diagnostics/StackTrace.cs281
-rw-r--r--mcs/class/corlib/System.Globalization/Calendar.cs917
-rw-r--r--mcs/class/corlib/System.Globalization/CalendarWeekRule.cs28
-rw-r--r--mcs/class/corlib/System.Globalization/CalendricalCalculations.cs2120
-rw-r--r--mcs/class/corlib/System.Globalization/ChangeLog109
-rw-r--r--mcs/class/corlib/System.Globalization/CompareInfo.cs23
-rwxr-xr-xmcs/class/corlib/System.Globalization/CompareOptions.cs54
-rw-r--r--mcs/class/corlib/System.Globalization/CultureInfo.cs850
-rwxr-xr-xmcs/class/corlib/System.Globalization/CultureTypes.cs39
-rw-r--r--mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs609
-rw-r--r--mcs/class/corlib/System.Globalization/DateTimeStyles.cs50
-rwxr-xr-xmcs/class/corlib/System.Globalization/DaylightTime.cs51
-rw-r--r--mcs/class/corlib/System.Globalization/GregorianCalendar.cs448
-rwxr-xr-xmcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs45
-rw-r--r--mcs/class/corlib/System.Globalization/HebrewCalendar.cs861
-rw-r--r--mcs/class/corlib/System.Globalization/HijriCalendar.cs870
-rw-r--r--mcs/class/corlib/System.Globalization/JapaneseCalendar.cs783
-rw-r--r--mcs/class/corlib/System.Globalization/JulianCalendar.cs443
-rw-r--r--mcs/class/corlib/System.Globalization/KoreanCalendar.cs444
-rwxr-xr-xmcs/class/corlib/System.Globalization/Locale.cs22
-rw-r--r--mcs/class/corlib/System.Globalization/NumberFormatInfo.cs676
-rw-r--r--mcs/class/corlib/System.Globalization/NumberStyles.cs46
-rw-r--r--mcs/class/corlib/System.Globalization/RegionInfo.cs1689
-rw-r--r--mcs/class/corlib/System.Globalization/TaiwanCalendar.cs745
-rw-r--r--mcs/class/corlib/System.Globalization/ThaiBuddhistCalendar.cs445
-rw-r--r--mcs/class/corlib/System.Globalization/UnicodeCategory.cs44
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog19
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs18
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs78
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs37
-rw-r--r--mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs19
-rwxr-xr-xmcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs38
-rw-r--r--mcs/class/corlib/System.IO/BinaryReader.cs393
-rwxr-xr-xmcs/class/corlib/System.IO/BinaryWriter.cs203
-rw-r--r--mcs/class/corlib/System.IO/BufferedStream.cs162
-rw-r--r--mcs/class/corlib/System.IO/ChangeLog392
-rw-r--r--mcs/class/corlib/System.IO/CheckArgument.cs167
-rw-r--r--mcs/class/corlib/System.IO/CheckPermission.cs87
-rw-r--r--mcs/class/corlib/System.IO/Directory.cs242
-rw-r--r--mcs/class/corlib/System.IO/DirectoryInfo.cs135
-rwxr-xr-xmcs/class/corlib/System.IO/DirectoryNotFoundException.cs38
-rw-r--r--mcs/class/corlib/System.IO/EndOfStreamException.cs43
-rw-r--r--mcs/class/corlib/System.IO/File.cs273
-rw-r--r--mcs/class/corlib/System.IO/FileAccess.cs34
-rw-r--r--mcs/class/corlib/System.IO/FileAttributes.cs35
-rw-r--r--mcs/class/corlib/System.IO/FileInfo.cs141
-rwxr-xr-xmcs/class/corlib/System.IO/FileLoadException.cs102
-rw-r--r--mcs/class/corlib/System.IO/FileMode.cs45
-rwxr-xr-xmcs/class/corlib/System.IO/FileNotFoundException.cs92
-rw-r--r--mcs/class/corlib/System.IO/FileShare.cs28
-rw-r--r--mcs/class/corlib/System.IO/FileStream.cs339
-rw-r--r--mcs/class/corlib/System.IO/FileSystemInfo.cs133
-rw-r--r--mcs/class/corlib/System.IO/IOException.cs43
-rw-r--r--mcs/class/corlib/System.IO/MemoryStream.cs409
-rw-r--r--mcs/class/corlib/System.IO/MonoIO.cs221
-rw-r--r--mcs/class/corlib/System.IO/MonoIOError.cs1798
-rw-r--r--mcs/class/corlib/System.IO/MonoIOStat.cs22
-rw-r--r--mcs/class/corlib/System.IO/Path.cs265
-rw-r--r--mcs/class/corlib/System.IO/PathTooLongException.cs43
-rw-r--r--mcs/class/corlib/System.IO/SearchPattern.cs169
-rw-r--r--mcs/class/corlib/System.IO/SeekOrigin.cs34
-rwxr-xr-xmcs/class/corlib/System.IO/Stream.cs323
-rw-r--r--mcs/class/corlib/System.IO/StreamReader.cs267
-rw-r--r--mcs/class/corlib/System.IO/StreamWriter.cs206
-rw-r--r--mcs/class/corlib/System.IO/StringReader.cs131
-rw-r--r--mcs/class/corlib/System.IO/StringWriter.cs80
-rw-r--r--mcs/class/corlib/System.IO/TextReader.cs84
-rw-r--r--mcs/class/corlib/System.IO/TextWriter.cs271
-rw-r--r--mcs/class/corlib/System.PAL/IOperatingSystem.cs194
-rw-r--r--mcs/class/corlib/System.PAL/Platform.cs23
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs243
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs16
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ChangeLog375
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs143
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs124
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs188
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/EventBuilder.cs85
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/EventToken.cs70
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs128
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/FieldToken.cs70
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/FlowControl.cs63
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs611
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/Label.cs29
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs62
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs173
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/MethodToken.cs70
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs294
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs111
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OpCode.cs125
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs49
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OpCodes.cs486
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/OperandType.cs87
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs8
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/PackingSize.cs41
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs106
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs70
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs124
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs70
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs121
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs70
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs126
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/StringToken.cs70
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs720
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeToken.cs70
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs75
-rwxr-xr-xmcs/class/corlib/System.Reflection.Emit/common.src23
-rwxr-xr-xmcs/class/corlib/System.Reflection/AmbiguousMatchException.cs32
-rw-r--r--mcs/class/corlib/System.Reflection/Assembly.cs279
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs39
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs32
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs30
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs31
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs29
-rwxr-xr-xmcs/class/corlib/System.Reflection/AssemblyName.cs168
-rwxr-xr-xmcs/class/corlib/System.Reflection/AssemblyNameFlags.cs33
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs27
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs29
-rw-r--r--mcs/class/corlib/System.Reflection/Binder.cs13
-rw-r--r--mcs/class/corlib/System.Reflection/BindingFlags.cs92
-rwxr-xr-xmcs/class/corlib/System.Reflection/CallingConventions.cs42
-rw-r--r--mcs/class/corlib/System.Reflection/ChangeLog264
-rw-r--r--mcs/class/corlib/System.Reflection/ConstructorInfo.cs39
-rw-r--r--mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs38
-rw-r--r--mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs29
-rwxr-xr-xmcs/class/corlib/System.Reflection/EventAttributes.cs37
-rwxr-xr-xmcs/class/corlib/System.Reflection/EventInfo.cs87
-rwxr-xr-xmcs/class/corlib/System.Reflection/FieldAttributes.cs102
-rwxr-xr-xmcs/class/corlib/System.Reflection/FieldInfo.cs117
-rwxr-xr-xmcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs25
-rwxr-xr-xmcs/class/corlib/System.Reflection/IReflect.cs44
-rwxr-xr-xmcs/class/corlib/System.Reflection/InterfaceMapping.cs10
-rw-r--r--mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs37
-rw-r--r--mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs37
-rw-r--r--mcs/class/corlib/System.Reflection/MemberFilter.cs7
-rwxr-xr-xmcs/class/corlib/System.Reflection/MemberInfo.cs39
-rwxr-xr-xmcs/class/corlib/System.Reflection/MemberTypes.cs57
-rwxr-xr-xmcs/class/corlib/System.Reflection/MethodAttributes.cs113
-rw-r--r--mcs/class/corlib/System.Reflection/MethodBase.cs127
-rwxr-xr-xmcs/class/corlib/System.Reflection/MethodImplAttributes.cs77
-rw-r--r--mcs/class/corlib/System.Reflection/MethodInfo.cs26
-rw-r--r--mcs/class/corlib/System.Reflection/Missing.cs17
-rw-r--r--mcs/class/corlib/System.Reflection/Module.cs103
-rwxr-xr-xmcs/class/corlib/System.Reflection/MonoEvent.cs77
-rwxr-xr-xmcs/class/corlib/System.Reflection/MonoField.cs99
-rwxr-xr-xmcs/class/corlib/System.Reflection/MonoMethod.cs205
-rwxr-xr-xmcs/class/corlib/System.Reflection/MonoProperty.cs164
-rwxr-xr-xmcs/class/corlib/System.Reflection/ParameterAttributes.cs66
-rw-r--r--mcs/class/corlib/System.Reflection/ParameterInfo.cs88
-rwxr-xr-xmcs/class/corlib/System.Reflection/ParameterModifier.cs26
-rwxr-xr-xmcs/class/corlib/System.Reflection/PropertyAttributes.cs54
-rwxr-xr-xmcs/class/corlib/System.Reflection/PropertyInfo.cs55
-rw-r--r--mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs62
-rwxr-xr-xmcs/class/corlib/System.Reflection/ResourceAttributes.cs30
-rwxr-xr-xmcs/class/corlib/System.Reflection/ResourceLocation.cs34
-rwxr-xr-xmcs/class/corlib/System.Reflection/StrongNameKeyPair.cs39
-rw-r--r--mcs/class/corlib/System.Reflection/TargetException.cs37
-rw-r--r--mcs/class/corlib/System.Reflection/TargetInvocationException.cs23
-rw-r--r--mcs/class/corlib/System.Reflection/TargetParameterCountException.cs38
-rwxr-xr-xmcs/class/corlib/System.Reflection/TypeAttributes.cs138
-rwxr-xr-xmcs/class/corlib/System.Reflection/TypeDelegator.cs204
-rw-r--r--mcs/class/corlib/System.Reflection/TypeFilter.cs13
-rw-r--r--mcs/class/corlib/System.Reflection/common.src25
-rw-r--r--mcs/class/corlib/System.Resources/ChangeLog128
-rw-r--r--mcs/class/corlib/System.Resources/IResourceReader.cs20
-rw-r--r--mcs/class/corlib/System.Resources/IResourceWriter.cs25
-rw-r--r--mcs/class/corlib/System.Resources/MissingManifestResourceException.cs42
-rw-r--r--mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs28
-rw-r--r--mcs/class/corlib/System.Resources/ResourceManager.cs163
-rw-r--r--mcs/class/corlib/System.Resources/ResourceReader.cs265
-rw-r--r--mcs/class/corlib/System.Resources/ResourceSet.cs127
-rw-r--r--mcs/class/corlib/System.Resources/ResourceWriter.cs64
-rw-r--r--mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs27
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog15
-rwxr-xr-xmcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs18
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs23
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs40
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs41
-rw-r--r--mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs26
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs18
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/AutomationProxyAttribute.cs28
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/BINDPTR.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs41
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ChangeLog161
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs35
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceAttribute.cs30
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceType.cs24
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/CoClassAttribute.cs26
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComAliasNameAttribute.cs27
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComConversionLossAttribute.cs21
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComEventInterfaceAttribute.cs34
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComImportAttribute.cs21
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs17
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComMemberType.cs19
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs18
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ComVisible.cs25
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/DESCKIND.cs24
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/DISPPARAMS.cs21
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/DispIdAttribute.cs25
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs33
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/EXCEPINFO.cs25
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ExporterEventKind.cs18
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs50
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs17
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs108
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs38
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs25
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs15
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs15
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs19
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/INVOKEKIND.cs22
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs25
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ITypeLibConverter.cs22
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs18
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs20
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs20
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs26
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs17
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs18
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs29
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/LCIDConversionAttribute.cs27
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs586
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs27
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs10
-rw-r--r--mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs26
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs78
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/PreserveSigAttribute.cs19
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs32
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/ProgIdAttribute.cs28
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs23
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TYPEKIND.cs27
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs16
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncAttribute.cs32
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncFlags.cs25
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeAttribute.cs32
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeFlags.cs26
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibVarAttribute.cs32
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/TypeLibVarFlags.cs26
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/UCOMTypeComp.cs20
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/UCOMTypeInfo.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/UCOMTypeLib.cs27
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs170
-rwxr-xr-xmcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs50
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs19
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs24
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs36
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs17
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs72
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs96
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs23
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs19
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs96
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs74
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog13
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs50
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs20
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageCtrl.cs19
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageSink.cs21
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodCallMessage.cs28
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs55
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs22
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs43
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs232
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs146
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs56
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/ChangeLog8
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/LeaseState.cs41
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs72
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs42
-rw-r--r--mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs50
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/SoapOption.cs30
-rwxr-xr-xmcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs29
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs45
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog5
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs29
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs29
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs30
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs60
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs41
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs33
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs41
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs61
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs33
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs37
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs73
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs89
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs29
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ChangeLog98
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization/Formatter.cs98
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization/FormatterConverter.cs153
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs14
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs66
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs33
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs16
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs15
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs43
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs40
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs62
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs22
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs40
-rwxr-xr-xmcs/class/corlib/System.Runtime.Serialization/SerializationException.cs39
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs261
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs62
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs58
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs56
-rw-r--r--mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs92
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs108
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs45
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs50
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs52
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs52
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/ChangeLog96
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/CipherMode.cs24
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs77
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptoStream.cs120
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs20
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptographicException.cs40
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs35
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CspParameters.cs57
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs20
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/DES.cs587
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs250
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSA.cs101
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs87
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSAParameters.cs38
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs51
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs52
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs27
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs271
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs157
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs49
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/KeySizes.cs61
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/MD5.cs44
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs482
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs22
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs52
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RSA.cs36
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs36
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs36
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/Rijndael.cs25
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs744
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA1.cs44
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs455
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA256.cs45
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs290
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA384.cs45
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs33
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA512.cs45
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs33
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs107
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs256
-rw-r--r--mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs234
-rwxr-xr-xmcs/class/corlib/System.Security.Cryptography/X509Certificates.cs10
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ChangeLog68
-rw-r--r--mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs33
-rw-r--r--mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs38
-rw-r--r--mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs53
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs21
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs47
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs411
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs46
-rw-r--r--mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs68
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs15
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs27
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs34
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs84
-rw-r--r--mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs44
-rw-r--r--mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs69
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/PermissionState.cs29
-rw-r--r--mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs60
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs61
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs42
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs42
-rw-r--r--mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs60
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/SecurityAction.cs57
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs59
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs66
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs216
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs68
-rw-r--r--mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs43
-rw-r--r--mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs56
-rw-r--r--mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs48
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs33
-rwxr-xr-xmcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs37
-rw-r--r--mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs40
-rw-r--r--mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs40
-rwxr-xr-xmcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs86
-rw-r--r--mcs/class/corlib/System.Security.Policy/ApplicationDirectoryMembershipCondition.cs66
-rw-r--r--mcs/class/corlib/System.Security.Policy/ChangeLog64
-rw-r--r--mcs/class/corlib/System.Security.Policy/CodeGroup.cs252
-rw-r--r--mcs/class/corlib/System.Security.Policy/Evidence.cs27
-rw-r--r--mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs135
-rw-r--r--mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs13
-rw-r--r--mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs17
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyException.cs42
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyLevel.cs62
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyStatement.cs61
-rw-r--r--mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs17
-rw-r--r--mcs/class/corlib/System.Security.Principal/ChangeLog3
-rw-r--r--mcs/class/corlib/System.Security.Principal/GenericIdentity.cs46
-rw-r--r--mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs38
-rw-r--r--mcs/class/corlib/System.Security.Principal/IIdentity.cs26
-rw-r--r--mcs/class/corlib/System.Security.Principal/IPrincipal.cs20
-rw-r--r--mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs17
-rw-r--r--mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs18
-rw-r--r--mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs23
-rwxr-xr-xmcs/class/corlib/System.Security/ChangeLog67
-rwxr-xr-xmcs/class/corlib/System.Security/CodeAccessPermission.cs86
-rw-r--r--mcs/class/corlib/System.Security/IEvidenceFactory.cs15
-rwxr-xr-xmcs/class/corlib/System.Security/IPermission.cs24
-rwxr-xr-xmcs/class/corlib/System.Security/ISecurityEncodable.cs18
-rw-r--r--mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs20
-rwxr-xr-xmcs/class/corlib/System.Security/IStackWalk.cs22
-rw-r--r--mcs/class/corlib/System.Security/NamedPermissionSet.cs66
-rw-r--r--mcs/class/corlib/System.Security/PermissionSet.cs202
-rw-r--r--mcs/class/corlib/System.Security/PolicyLevelType.cs18
-rwxr-xr-xmcs/class/corlib/System.Security/SecurityElement.cs340
-rw-r--r--mcs/class/corlib/System.Security/SecurityException.cs79
-rw-r--r--mcs/class/corlib/System.Security/SecurityManager.cs88
-rw-r--r--mcs/class/corlib/System.Security/SecurityZone.cs20
-rw-r--r--mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs15
-rw-r--r--mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs14
-rw-r--r--mcs/class/corlib/System.Security/VerificationException.cs26
-rw-r--r--mcs/class/corlib/System.Security/XmlSyntaxException.cs27
-rwxr-xr-xmcs/class/corlib/System.Text/ASCIIEncoding.cs166
-rwxr-xr-xmcs/class/corlib/System.Text/ChangeLog126
-rw-r--r--mcs/class/corlib/System.Text/Decoder.cs89
-rw-r--r--mcs/class/corlib/System.Text/Encoder.cs99
-rwxr-xr-xmcs/class/corlib/System.Text/Encoding.cs384
-rw-r--r--mcs/class/corlib/System.Text/StringBuilder.cs620
-rwxr-xr-xmcs/class/corlib/System.Text/UTF7Encoding.cs42
-rwxr-xr-xmcs/class/corlib/System.Text/UTF8Encoding.cs38
-rwxr-xr-xmcs/class/corlib/System.Text/UnicodeEncoding.cs55
-rwxr-xr-xmcs/class/corlib/System.Threading/ApartmentState.cs18
-rwxr-xr-xmcs/class/corlib/System.Threading/AutoResetEvent.cs35
-rw-r--r--mcs/class/corlib/System.Threading/ChangeLog149
-rwxr-xr-xmcs/class/corlib/System.Threading/IOCompletionCallback.cs18
-rwxr-xr-xmcs/class/corlib/System.Threading/Interlocked.cs51
-rwxr-xr-xmcs/class/corlib/System.Threading/LockCookie.cs17
-rwxr-xr-xmcs/class/corlib/System.Threading/ManualResetEvent.cs38
-rwxr-xr-xmcs/class/corlib/System.Threading/Monitor.cs219
-rwxr-xr-xmcs/class/corlib/System.Threading/Mutex.cs49
-rwxr-xr-xmcs/class/corlib/System.Threading/NativeEventCalls.cs28
-rwxr-xr-xmcs/class/corlib/System.Threading/NativeOverlapped.cs27
-rwxr-xr-xmcs/class/corlib/System.Threading/Overlapped.cs92
-rwxr-xr-xmcs/class/corlib/System.Threading/ReaderWriterLock.cs109
-rwxr-xr-xmcs/class/corlib/System.Threading/RegisteredWaitHandle.cs28
-rwxr-xr-xmcs/class/corlib/System.Threading/SynchronizationLockException.cs33
-rwxr-xr-xmcs/class/corlib/System.Threading/Thread.cs438
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadAbortException.cs26
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadInterruptedException.cs33
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadPool.cs245
-rw-r--r--mcs/class/corlib/System.Threading/ThreadPriority.cs41
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadStart.cs14
-rw-r--r--mcs/class/corlib/System.Threading/ThreadState.cs55
-rwxr-xr-xmcs/class/corlib/System.Threading/ThreadStateException.cs33
-rwxr-xr-xmcs/class/corlib/System.Threading/Timeout.cs18
-rwxr-xr-xmcs/class/corlib/System.Threading/Timer.cs112
-rwxr-xr-xmcs/class/corlib/System.Threading/TimerCallback.cs14
-rwxr-xr-xmcs/class/corlib/System.Threading/WaitCallback.cs14
-rwxr-xr-xmcs/class/corlib/System.Threading/WaitHandle.cs204
-rwxr-xr-xmcs/class/corlib/System.Threading/WaitOrTimerCallback.cs14
-rw-r--r--mcs/class/corlib/System/Activator.cs124
-rwxr-xr-xmcs/class/corlib/System/AppDomain.cs462
-rwxr-xr-xmcs/class/corlib/System/AppDomainSetup.cs161
-rw-r--r--mcs/class/corlib/System/AppDomainUnloadedException.cs42
-rw-r--r--mcs/class/corlib/System/ApplicationException.cs42
-rw-r--r--mcs/class/corlib/System/ArgumentException.cs78
-rw-r--r--mcs/class/corlib/System/ArgumentNullException.cs38
-rw-r--r--mcs/class/corlib/System/ArgumentOutOfRangeException.cs72
-rw-r--r--mcs/class/corlib/System/ArithmeticException.cs38
-rw-r--r--mcs/class/corlib/System/Array.cs838
-rw-r--r--mcs/class/corlib/System/ArrayTypeMismatchException.cs38
-rwxr-xr-xmcs/class/corlib/System/AssemblyLoadEventArgs.cs34
-rwxr-xr-xmcs/class/corlib/System/AssemblyLoadEventHandler.cs10
-rw-r--r--mcs/class/corlib/System/AsyncCallback.cs13
-rw-r--r--mcs/class/corlib/System/Attribute.cs386
-rw-r--r--mcs/class/corlib/System/AttributeTargets.cs82
-rw-r--r--mcs/class/corlib/System/AttributeUsage.cs50
-rw-r--r--mcs/class/corlib/System/BadImageFormatException.cs93
-rwxr-xr-xmcs/class/corlib/System/BitConverter.cs270
-rw-r--r--mcs/class/corlib/System/Boolean.cs266
-rwxr-xr-xmcs/class/corlib/System/Buffer.cs70
-rw-r--r--mcs/class/corlib/System/Byte.cs251
-rwxr-xr-xmcs/class/corlib/System/CLSCompliantAttribute.cs35
-rw-r--r--mcs/class/corlib/System/CannotUnloadAppDomainException.cs41
-rw-r--r--mcs/class/corlib/System/ChangeLog2233
-rw-r--r--mcs/class/corlib/System/Char.cs399
-rw-r--r--mcs/class/corlib/System/CharEnumerator.cs90
-rw-r--r--mcs/class/corlib/System/Console.cs319
-rw-r--r--mcs/class/corlib/System/ContextBoundObject.cs25
-rw-r--r--mcs/class/corlib/System/ContextMarshalException.cs42
-rwxr-xr-xmcs/class/corlib/System/ContextStaticAttribute.cs28
-rw-r--r--mcs/class/corlib/System/Convert.cs2463
-rwxr-xr-xmcs/class/corlib/System/CrossAppDomainDelegate.cs10
-rw-r--r--mcs/class/corlib/System/DBNull.cs133
-rw-r--r--mcs/class/corlib/System/DateTime.cs1463
-rw-r--r--mcs/class/corlib/System/Decimal.cs1113
-rw-r--r--mcs/class/corlib/System/DecimalFormatter.cs389
-rw-r--r--mcs/class/corlib/System/Delegate.cs195
-rw-r--r--mcs/class/corlib/System/DivideByZeroException.cs38
-rw-r--r--mcs/class/corlib/System/DllNotFoundException.cs42
-rw-r--r--mcs/class/corlib/System/Double.cs428
-rw-r--r--mcs/class/corlib/System/DuplicateWaitObjectException.cs39
-rw-r--r--mcs/class/corlib/System/EntryPointNotFoundException.cs42
-rw-r--r--mcs/class/corlib/System/Enum.cs557
-rw-r--r--mcs/class/corlib/System/Environment.cs291
-rw-r--r--mcs/class/corlib/System/EventArgs.cs26
-rw-r--r--mcs/class/corlib/System/EventHandler.cs16
-rw-r--r--mcs/class/corlib/System/Exception.cs160
-rw-r--r--mcs/class/corlib/System/ExecutionEngineException.cs31
-rw-r--r--mcs/class/corlib/System/FieldAccessException.cs41
-rwxr-xr-xmcs/class/corlib/System/FlagsAttribute.cs29
-rw-r--r--mcs/class/corlib/System/FormatException.cs39
-rwxr-xr-xmcs/class/corlib/System/GC.cs65
-rwxr-xr-xmcs/class/corlib/System/Guid.cs654
-rw-r--r--mcs/class/corlib/System/IAppDomainSetup.cs37
-rw-r--r--mcs/class/corlib/System/IAsyncResult.cs43
-rw-r--r--mcs/class/corlib/System/ICloneable.cs15
-rw-r--r--mcs/class/corlib/System/IComparable.cs15
-rw-r--r--mcs/class/corlib/System/IConvertible.cs55
-rw-r--r--mcs/class/corlib/System/ICustomFormatter.cs15
-rw-r--r--mcs/class/corlib/System/IDisposable.cs17
-rw-r--r--mcs/class/corlib/System/IFormatProvider.cs15
-rw-r--r--mcs/class/corlib/System/IFormattable.cs15
-rw-r--r--mcs/class/corlib/System/IServiceProvider.cs20
-rw-r--r--mcs/class/corlib/System/IndexOutOfRangeException.cs31
-rw-r--r--mcs/class/corlib/System/Int16.cs237
-rw-r--r--mcs/class/corlib/System/Int32.cs490
-rw-r--r--mcs/class/corlib/System/Int64.cs432
-rw-r--r--mcs/class/corlib/System/IntPtr.cs165
-rw-r--r--mcs/class/corlib/System/IntegerFormatter.cs4030
-rw-r--r--mcs/class/corlib/System/InvalidCastException.cs39
-rw-r--r--mcs/class/corlib/System/InvalidOperationException.cs38
-rw-r--r--mcs/class/corlib/System/InvalidProgramException.cs31
-rw-r--r--mcs/class/corlib/System/LoaderOptimization.cs18
-rw-r--r--mcs/class/corlib/System/LoaderOptimizationAttribute.cs34
-rwxr-xr-xmcs/class/corlib/System/LocalDataStoreSlot.cs18
-rw-r--r--mcs/class/corlib/System/MTAThreadAttribute.cs19
-rw-r--r--mcs/class/corlib/System/MarshalByRefObject.cs36
-rw-r--r--mcs/class/corlib/System/Math.cs375
-rw-r--r--mcs/class/corlib/System/MemberAccessException.cs29
-rw-r--r--mcs/class/corlib/System/MethodAccessException.cs42
-rw-r--r--mcs/class/corlib/System/MissingFieldException.cs46
-rw-r--r--mcs/class/corlib/System/MissingMemberException.cs60
-rw-r--r--mcs/class/corlib/System/MissingMethodException.cs38
-rwxr-xr-xmcs/class/corlib/System/MonoCustomAttrs.cs80
-rw-r--r--mcs/class/corlib/System/MonoDummy.cs20
-rw-r--r--mcs/class/corlib/System/MonoType.cs337
-rw-r--r--mcs/class/corlib/System/MulticastDelegate.cs242
-rw-r--r--mcs/class/corlib/System/MulticastNotSupportedException.cs31
-rwxr-xr-xmcs/class/corlib/System/NonSerializedAttribute.cs18
-rw-r--r--mcs/class/corlib/System/NotFiniteNumberException.cs67
-rwxr-xr-xmcs/class/corlib/System/NotImplementedException.cs39
-rw-r--r--mcs/class/corlib/System/NotSupportedException.cs39
-rw-r--r--mcs/class/corlib/System/NullReferenceException.cs39
-rw-r--r--mcs/class/corlib/System/Object.cs108
-rwxr-xr-xmcs/class/corlib/System/ObjectDisposedException.cs60
-rw-r--r--mcs/class/corlib/System/ObsoleteAttribute.cs48
-rw-r--r--mcs/class/corlib/System/OperatingSystem.cs106
-rw-r--r--mcs/class/corlib/System/OutOfMemoryException.cs39
-rw-r--r--mcs/class/corlib/System/OverflowException.cs39
-rw-r--r--mcs/class/corlib/System/ParamArrayAttribute.cs23
-rw-r--r--mcs/class/corlib/System/PlatformID.cs37
-rw-r--r--mcs/class/corlib/System/PlatformNotSupportedException.cs41
-rw-r--r--mcs/class/corlib/System/Random.cs83
-rw-r--r--mcs/class/corlib/System/RankException.cs40
-rw-r--r--mcs/class/corlib/System/ResolveEventArgs.cs29
-rw-r--r--mcs/class/corlib/System/ResolveEventHandler.cs10
-rw-r--r--mcs/class/corlib/System/RuntimeArgumentHandle.cs16
-rwxr-xr-xmcs/class/corlib/System/RuntimeFieldHandle.cs45
-rwxr-xr-xmcs/class/corlib/System/RuntimeMethodHandle.cs34
-rw-r--r--mcs/class/corlib/System/RuntimeTypeHandle.cs31
-rw-r--r--mcs/class/corlib/System/SByte.cs232
-rw-r--r--mcs/class/corlib/System/STAThreadAttribute.cs19
-rwxr-xr-xmcs/class/corlib/System/SerializableAttribute.cs38
-rw-r--r--mcs/class/corlib/System/Single.cs221
-rw-r--r--mcs/class/corlib/System/StackOverflowException.cs39
-rw-r--r--mcs/class/corlib/System/String.cs1097
-rw-r--r--mcs/class/corlib/System/SystemException.cs38
-rw-r--r--mcs/class/corlib/System/TODO22
-rw-r--r--mcs/class/corlib/System/TODOAttribute.cs37
-rw-r--r--mcs/class/corlib/System/ThreadStaticAttribute.cs20
-rw-r--r--mcs/class/corlib/System/TimeSpan.cs551
-rw-r--r--mcs/class/corlib/System/TimeZone.cs194
-rw-r--r--mcs/class/corlib/System/Type.cs930
-rw-r--r--mcs/class/corlib/System/TypeCode.cs93
-rw-r--r--mcs/class/corlib/System/TypeInitializationException.cs40
-rw-r--r--mcs/class/corlib/System/TypeLoadException.cs73
-rw-r--r--mcs/class/corlib/System/TypeUnloadedException.cs43
-rw-r--r--mcs/class/corlib/System/UInt16.cs241
-rw-r--r--mcs/class/corlib/System/UInt32.cs429
-rw-r--r--mcs/class/corlib/System/UInt64.cs359
-rw-r--r--mcs/class/corlib/System/UIntPtr.cs180
-rwxr-xr-xmcs/class/corlib/System/UnauthorizedAccessException.cs39
-rwxr-xr-xmcs/class/corlib/System/UnhandledExceptionEventArgs.cs43
-rwxr-xr-xmcs/class/corlib/System/UnhandledExceptionEventHandler.cs10
-rw-r--r--mcs/class/corlib/System/ValueType.cs48
-rw-r--r--mcs/class/corlib/System/Version.cs277
-rw-r--r--mcs/class/corlib/System/Void.cs15
-rwxr-xr-xmcs/class/corlib/System/WeakReference.cs119
-rwxr-xr-xmcs/class/corlib/System/_AppDomain.cs161
-rw-r--r--mcs/class/corlib/Test/.cvsignore2
-rw-r--r--mcs/class/corlib/Test/AllTests.cs39
-rw-r--r--mcs/class/corlib/Test/ChangeLog216
-rw-r--r--mcs/class/corlib/Test/System.Collections/AllTests.cs39
-rw-r--r--mcs/class/corlib/Test/System.Collections/ArrayListTest.cs1451
-rw-r--r--mcs/class/corlib/Test/System.Collections/BitArrayTest.cs300
-rw-r--r--mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs50
-rw-r--r--mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs57
-rw-r--r--mcs/class/corlib/Test/System.Collections/ChangeLog91
-rw-r--r--mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs236
-rw-r--r--mcs/class/corlib/Test/System.Collections/ComparerTest.cs60
-rw-r--r--mcs/class/corlib/Test/System.Collections/HashtableTest.cs761
-rw-r--r--mcs/class/corlib/Test/System.Collections/QueueTest.cs182
-rw-r--r--mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs49
-rwxr-xr-xmcs/class/corlib/Test/System.Collections/SortedListTest.cs624
-rw-r--r--mcs/class/corlib/Test/System.Collections/StackTest.cs270
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/AllTests.cs32
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/ChangeLog8
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs89
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs350
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs98
-rw-r--r--mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs83
-rw-r--r--mcs/class/corlib/Test/System.Globalization/AllTests.cs28
-rw-r--r--mcs/class/corlib/Test/System.Globalization/CalendarTest.cs602
-rw-r--r--mcs/class/corlib/Test/System.IO/AllTests.cs35
-rw-r--r--mcs/class/corlib/Test/System.IO/ChangeLog95
-rw-r--r--mcs/class/corlib/Test/System.IO/FileTest.cs441
-rw-r--r--mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs154
-rw-r--r--mcs/class/corlib/Test/System.IO/PathTest.cs144
-rw-r--r--mcs/class/corlib/Test/System.IO/StreamReaderTest.cs558
-rw-r--r--mcs/class/corlib/Test/System.IO/StreamWriterTest.cs353
-rw-r--r--mcs/class/corlib/Test/System.IO/StringReaderTest.cs133
-rw-r--r--mcs/class/corlib/Test/System.IO/StringWriterTest.cs56
-rw-r--r--mcs/class/corlib/Test/System.Resources/AllTests.cs28
-rw-r--r--mcs/class/corlib/Test/System.Resources/ChangeLog26
-rw-r--r--mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs144
-rw-r--r--mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs28
-rw-r--r--mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog5
-rwxr-xr-xmcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs91
-rw-r--r--mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs31
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs54
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs75
-rw-r--r--mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs55
-rwxr-xr-xmcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs65
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/ChangeLog18
-rw-r--r--mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs297
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/ChangeLog15
-rw-r--r--mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs248
-rw-r--r--mcs/class/corlib/Test/System.Security/AllTests.cs27
-rw-r--r--mcs/class/corlib/Test/System.Security/ChangeLog10
-rw-r--r--mcs/class/corlib/Test/System.Security/SecurityElementTest.cs228
-rwxr-xr-xmcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs192
-rw-r--r--mcs/class/corlib/Test/System.Text/AllTests.cs30
-rw-r--r--mcs/class/corlib/Test/System.Text/ChangeLog13
-rw-r--r--mcs/class/corlib/Test/System.Text/StringBuilderTest.cs238
-rw-r--r--mcs/class/corlib/Test/System/AllTests.cs61
-rw-r--r--mcs/class/corlib/Test/System/ArrayTest.cs1996
-rwxr-xr-xmcs/class/corlib/Test/System/AttributeTest.cs164
-rwxr-xr-xmcs/class/corlib/Test/System/BitConverterTest.cs545
-rw-r--r--mcs/class/corlib/Test/System/BooleanTest.cs113
-rw-r--r--mcs/class/corlib/Test/System/ByteTest.cs189
-rw-r--r--mcs/class/corlib/Test/System/ChangeLog468
-rwxr-xr-xmcs/class/corlib/Test/System/CharEnumeratorTest.cs123
-rw-r--r--mcs/class/corlib/Test/System/CharTest.cs500
-rw-r--r--mcs/class/corlib/Test/System/ConsoleTest.cs294
-rwxr-xr-xmcs/class/corlib/Test/System/ConvertTest.cs2734
-rwxr-xr-xmcs/class/corlib/Test/System/DateTimeTest.cs358
-rw-r--r--mcs/class/corlib/Test/System/DecimalTest.cs873
-rw-r--r--mcs/class/corlib/Test/System/DecimalTest2.cs3126
-rw-r--r--mcs/class/corlib/Test/System/DoubleTest.cs191
-rw-r--r--mcs/class/corlib/Test/System/EnumTest.cs728
-rw-r--r--mcs/class/corlib/Test/System/ExceptionTest.cs204
-rwxr-xr-xmcs/class/corlib/Test/System/GuidTest.cs247
-rw-r--r--mcs/class/corlib/Test/System/Int16Test.cs193
-rw-r--r--mcs/class/corlib/Test/System/Int32Test.cs238
-rw-r--r--mcs/class/corlib/Test/System/Int64Test.cs363
-rw-r--r--mcs/class/corlib/Test/System/IntegerFormatterTest.cs2016
-rwxr-xr-xmcs/class/corlib/Test/System/MathTest.cs614
-rw-r--r--mcs/class/corlib/Test/System/MulticastDelegate.cs123
-rw-r--r--mcs/class/corlib/Test/System/ObjectTest.cs121
-rw-r--r--mcs/class/corlib/Test/System/RandomTest.cs90
-rw-r--r--mcs/class/corlib/Test/System/ResolveEventArgsTest.cs30
-rw-r--r--mcs/class/corlib/Test/System/SByteTest.cs180
-rw-r--r--mcs/class/corlib/Test/System/StringTest.cs1083
-rwxr-xr-xmcs/class/corlib/Test/System/TimeSpanTest.cs266
-rw-r--r--mcs/class/corlib/Test/System/TimeZoneTest.cs74
-rw-r--r--mcs/class/corlib/Test/System/UInt16Test.cs194
-rw-r--r--mcs/class/corlib/Test/System/UInt32Test.cs236
-rw-r--r--mcs/class/corlib/Test/System/UInt64Test.cs204
-rw-r--r--mcs/class/corlib/Test/System/VersionTest.cs244
-rw-r--r--mcs/class/corlib/Test/corlib_test.build70
-rw-r--r--mcs/class/corlib/Test/resources/AFile.txt39
-rw-r--r--mcs/class/corlib/Test/resources/Empty.resources0
-rw-r--r--mcs/class/corlib/Test/resources/MyResources.resourcesbin412 -> 0 bytes
-rwxr-xr-xmcs/class/corlib/Unix/Errno.cs139
-rw-r--r--mcs/class/corlib/Unix/Wrapper.cs237
-rw-r--r--mcs/class/corlib/Unix/common.src1
-rw-r--r--mcs/class/corlib/Unix/mono.src0
-rw-r--r--mcs/class/corlib/Unix/windows.src0
-rw-r--r--mcs/class/corlib/Windows/Windows.cs694
-rw-r--r--mcs/class/corlib/corlib.build152
-rwxr-xr-xmcs/class/corlib/list588
-rwxr-xr-xmcs/class/corlib/unix.args640
-rw-r--r--mcs/class/library.build41
-rw-r--r--mcs/class/makefile13
-rw-r--r--mcs/class/notes/BitVecto32.txt6
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/CodeGenerator.xml117
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/ICodeGenerator.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeArrayCreateExpression.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeAssignStatement.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttachEventStatement.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgument.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgumentCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeBlock.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclaration.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclarationCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeBaseReferenceExpression.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorExpression.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeCastExpression.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClause.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClauseCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeClass.xml52
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassConstructor.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassDelegate.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMember.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMemberCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeCommentStatement.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeConstructor.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateCreateExpression.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeExpression.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeStatement.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeDetachEventStatement.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpression.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpressionCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeFieldReferenceExpression.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeForLoopStatement.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeIfStatement.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeIndexerExpression.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeLinePragma.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralClassMember.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralExpression.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralNamespace.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralStatement.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberEvent.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberField.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberMethod.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberProperty.xml52
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeExpression.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeStatement.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodReturnStatement.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespace.xml47
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImport.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImportCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeObject.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeObjectCreateExpression.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpression.xml38
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodePrimitiveExpression.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodePropertyReferenceExpression.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatement.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatementCollection.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeThisReferenceExpression.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeThrowExceptionStatement.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeTryCatchFinallyStatement.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeDeclaration.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeMember.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeOfExpression.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeReferenceExpression.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/CodeVariableDeclarationStatement.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/FieldDirection.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.CodeDom/MemberAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/BitVector32.xml51
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/KeysCollection.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/ListDictionary.xml88
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameObjectCollectionBase.xml68
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameValueCollection.xml123
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/Section.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringCollection.xml102
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringDictionary.xml84
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringEnumerator.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/ArrayList.xml326
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/BitArray.xml128
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveComparer.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveHashCodeProvider.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/CollectionBase.xml39
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/Comparer.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/DictionaryBase.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/DictionaryEntry.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/EnumeratorMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/Hashtable.xml192
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/ICollection.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/IComparer.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/IDictionary.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/IDictionaryEnumerator.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/IEnumerable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/IEnumerator.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/IHashCodeProvider.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/IList.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/Queue.xml98
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/ReadOnlyCollectionBase.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/SortedList.xml195
-rw-r--r--mcs/docs/apidocs/xml/en/System.Collections/Stack.xml92
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/BrowsableAttribute.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/CategoryAttribute.xml87
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/Component.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/ComponentCollection.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/Container.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/DescriptionAttribute.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/DesignOnlyAttribute.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibility.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/EventHandlerList.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/IComponent.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/IContainer.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/ISite.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/LocalizableAttribute.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/MemberDescriptor.xml48
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/PropertyDescriptor.xml45
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/TypeConverter.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.ComponentModel/Win32Exception.xml35
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHash.xml44
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHashAlgorithm.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyVersionCompatibility.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/ProcessorID.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationException.xml90
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationSettings.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration/DictionarySectionHandler.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration/IConfigurationSectionHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration/IgnoreSectionHandler.xml20
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration/NameValueSectionHandler.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Configuration/SingleTagSectionHandler.xml20
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/AcceptRejectRule.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/CommandBehavior.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/CommandType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/ConnectionState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventArgs.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataColumnCollection.xml113
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataRowAction.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataRowChangeEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataRowState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataRowVersion.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DataViewRowState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/DbType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/FillErrorEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IColumnMapping.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IColumnMappingCollection.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDBCommand.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDBConnection.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDataAdapter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDataParameter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDataParameterCollection.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDataReader.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDataRecord.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDbDataAdapter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDbDataParameter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IDbTransaction.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/ITableMapping.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/ITableMappingCollection.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/IsolationLevel.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/MappingType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/MergeFailedEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/MissingMappingAction.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/MissingSchemaAction.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/ParameterDirection.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/PropertyAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/Rule.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/SchemaType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/SqlDbType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/StateChangeEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/StatementType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/UpdateRowSource.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/UpdateStatus.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/XmlReadMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Data/XmlWriteMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolBinder.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocument.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolMethod.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolNamespace.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolReader.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolScope.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolVariable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolWriter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymAddressKind.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymDocumentType.xml16
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageType.xml56
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageVendor.xml16
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymbolToken.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/BooleanSwitch.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/ChangeLog18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/ConditionalAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/Debug.xml261
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggableAttribute.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/Debugger.xml44
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerHiddenAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerStepThroughAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/DefaultTraceListener.xml137
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/DiagnosticsConfigurationHandler.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/FileVersionInfo.xml158
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/Process.xml340
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessModule.xml47
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessPriorityClass.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/StackFrame.xml91
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/StackTrace.xml94
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/Switch.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/TextWriterTraceListener.xml179
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/Trace.xml260
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/TraceLevel.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListener.xml223
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListenerCollection.xml132
-rw-r--r--mcs/docs/apidocs/xml/en/System.Diagnostics/TraceSwitch.xml57
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/CCGregorianEraHandler.xml64
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/CCHijriCalendar.xml88
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/Calendar.xml283
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/CalendarWeekRule.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/CompareOptions.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/CultureInfo.xml87
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/CultureTypes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/DateTimeFormatInfo.xml212
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/DateTimeStyles.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/DaylightTime.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendar.xml140
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendarTypes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/HebrewCalendar.xml201
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/HijriCalendar.xml201
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/JapaneseCalendar.xml198
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/JulianCalendar.xml130
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/KoreanCalendar.xml130
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/Month.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/NumberFormatInfo.xml175
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/NumberStyles.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/RegionInfo.xml59
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/TaiwanCalendar.xml198
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/ThaiBuddhistCalendar.xml130
-rw-r--r--mcs/docs/apidocs/xml/en/System.Globalization/UnicodeCategory.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorage.xml48
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageFileStream.xml14
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageScope.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/BinaryReader.xml142
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/BinaryWriter.xml162
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/BufferedStream.xml99
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/Directory.xml146
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/DirectoryInfo.xml99
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/DirectoryNotFoundException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/EndOfStreamException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/File.xml155
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileAccess.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileInfo.xml113
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileLoadException.xml45
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileNotFoundException.xml63
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileShare.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileStream.xml163
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/FileSystemInfo.xml58
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/IOException.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/MemoryStream.xml148
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/Path.xml100
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/PathTooLongException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/SeekOrigin.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/Stream.xml124
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/StreamReader.xml124
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/StreamWriter.xml86
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/StringReader.xml46
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/StringWriter.xml68
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/TextReader.xml59
-rw-r--r--mcs/docs/apidocs/xml/en/System.IO/TextWriter.xml270
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/AddressFamily.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/LingerOption.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/MulticastOption.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/NetworkStream.xml148
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolFamily.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/SelectMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/Socket.xml396
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketException.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketFlags.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionLevel.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionName.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketShutdown.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpClient.xml98
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpListener.xml64
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/Authorization.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/ConnectionModes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/Dns.xml65
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/EndPoint.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/HttpStatusCode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/ICredentials.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/IPAddress.xml103
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/IPEndPoint.xml59
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/IPHostEntry.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/NetworkAccess.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/NetworkCredential.xml47
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/ProxyUseType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/SocketAddress.xml39
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/TransportType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/WebExceptionStatus.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Net/WebStatus.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilder.xml159
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilderAccess.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/ConstructorBuilder.xml169
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/CustomAttributeBuilder.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/EnumBuilder.xml240
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventBuilder.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldBuilder.xml110
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/FlowControl.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/ILGenerator.xml242
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/Label.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/LocalBuilder.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodBuilder.xml143
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/ModuleBuilder.xml128
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCode.xml48
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodeType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodes.xml906
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/OperandType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/PEFileKinds.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/PackingSize.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterBuilder.xml68
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyBuilder.xml164
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureHelper.xml76
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/StackBehaviour.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/StringToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeBuilder.xml403
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeToken.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection.Emit/UnmanagedMarshal.xml62
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AmbiguousMatchException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/Assembly.xml277
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyAlgorithmIdAttribute.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCompanyAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyConfigurationAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCopyrightAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCultureAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDefaultAliasAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDelaySignAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDescriptionAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFileVersionAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFlagsAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyInformationalVersionAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyFileAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyNameAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyName.xml45
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameFlags.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameProxy.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyProductAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTitleAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTrademarkAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/AssemblyVersionAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/Binder.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/BindingFlags.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/CallingConventions.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ConstructorInfo.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/CustomAttributeFormatException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/DefaultMemberAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/EventAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/EventInfo.xml115
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/FieldAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/FieldInfo.xml66
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ICustomAttributeProvider.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/IReflect.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/InterfaceMapping.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/InvalidFilterCriteriaException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ManifestResourceInfo.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MemberFilter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MemberInfo.xml48
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MemberTypes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MethodAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MethodBase.xml126
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MethodImplAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MethodInfo.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/Missing.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/Module.xml158
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/MonoEvent.xml45
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ParameterAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ParameterInfo.xml83
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ParameterModifier.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/PropertyAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/PropertyInfo.xml112
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ReflectionTypeLoadException.xml38
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ResourceAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/ResourceLocation.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/StrongNameKeyPair.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/TargetException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/TargetInvocationException.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/TargetParameterCountException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/TypeAttributes.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/TypeDelegator.xml195
-rw-r--r--mcs/docs/apidocs/xml/en/System.Reflection/TypeFilter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/IResourceReader.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/IResourceWriter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/MissingManifestResourceException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/NeutralResourcesLanguageAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/ResourceManager.xml79
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/ResourceReader.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/ResourceSet.xml69
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/ResourceWriter.xml54
-rw-r--r--mcs/docs/apidocs/xml/en/System.Resources/SatelliteContractVersionAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/IndexerNameAttribute.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodCodeType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplAttribute.xml31
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplOptions.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/RuntimeHelpers.xml20
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/AssemblyRegistrationFlags.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CallingConvention.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CharSet.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceAttribute.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ComInterfaceType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/DllImportAttribute.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExporterEventKind.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExternalException.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/FieldOffsetAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandle.xml53
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandleType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GuidAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomAdapter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomFactory.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomMarshaler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/IRegistrationServices.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibConverter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNameProvider.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNotifySink.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibImporterNotifySink.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ImporterEventKind.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InterfaceTypeAttribute.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/LayoutKind.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/MarshalAsAttribute.xml51
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OptionalAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OutAttribute.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/PInvokeMap.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/StructLayoutAttribute.xml35
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/TypeLibExporterFlags.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/UnmanagedType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/VarEnum.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/ActivatorLevel.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IActivator.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionCallMessage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionReturnMessage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/Context.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/ContextAttribute.xml53
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextAttribute.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextProperty.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicMessageSink.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicProperty.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/SynchronizationAttribute.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/AsyncResult.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/Header.xml45
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageCtrl.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageSink.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodCallMessage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodMessage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodReturnMessage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/LogicalCallContext.xml44
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Proxies/RealProxy.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting/LeaseState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjRef.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjectHandle.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting/RemotingServices.xml21
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapMethodOption.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapOption.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Remoting/WellKnownObjectMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTypeStyle.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/IFieldInfo.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/ISoapMessage.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalArrayTypeE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalElementTypeE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberTypeE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberValueE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalNameSpaceE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectPositionE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectTypeE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseStateE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseTypeE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IDeserializationCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatterConverter.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IObjectReference.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializationSurrogate.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISurrogateSelector.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ObjectIDGenerator.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationBinder.xml15
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationEntry.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfo.xml250
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfoEnumerator.xml38
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContext.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContextStates.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SurrogateSelector.xml46
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography.X509Certificates/X509Certificate.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricAlgorithm.xml57
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureDeformatter.xml38
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureFormatter.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CipherMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoAPITransform.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStream.xml79
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStreamMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicException.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicUnexpectedOperationException.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspParameters.xml51
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspProviderFlags.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DES.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DESCryptoServiceProvider.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSA.xml56
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSACryptoServiceProvider.xml124
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSAParameters.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureDeformatter.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureFormatter.xml35
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/DeriveBytes.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64Transform.xml55
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64TransformMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/HashAlgorithm.xml73
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/ICryptoTransform.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/KeySizes.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5CryptoServiceProvider.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/PaddingMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/RNGCryptoServiceProvider.xml39
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSA.xml59
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSAParameters.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/RandomNumberGenerator.xml35
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/Rijndael.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/RijndaelManaged.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1.xml19
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1CryptoServiceProvider.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256Managed.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384Managed.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512Managed.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SignatureDescription.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/SymmetricAlgorithm.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Cryptography/ToBase64Transform.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/CodeAccessSecurityAttribute.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAccess.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAttribute.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAccess.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAttribute.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermission.xml108
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAccess.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAttribute.xml43
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/IUnrestrictedPermission.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageContainment.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermission.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermissionAttribute.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionSetAttribute.xml43
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/PrinciplePermissionAttribute.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionAttribute.xml38
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionFlag.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAccess.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAttribute.xml38
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAction.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAttribute.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermission.xml62
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermissionFlag.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/SiteIdentityPermissionAttribute.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/StrongNameIdentityPermissionAttribute.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionAttribute.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionClipboard.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionWindow.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/UrlIdentityPermissionAttribute.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Permissions/ZoneIdentityPermissionAttribute.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/AllMembershipCondition.xml63
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/ApplicationDirectoryMembershipCondition.xml63
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/CodeGroup.xml125
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/Evidence.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/FileCodeGroup.xml57
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/IIdentityPermissionFactory.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/IMembershipCondition.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyLevel.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatement.xml58
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatementAttribute.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Principal/GenericIdentity.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Principal/GenericPrincipal.xml25
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Principal/IIdentity.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Principal/IPrincipal.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security.Principal/PrincipalPolicy.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/CodeAccessPermission.xml67
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/IEvidenceFactory.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/IPermission.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/ISecurityEncodable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/ISecurityPolicyEncodable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/IStackWalk.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/NamedPermissionSet.xml62
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/PermissionSet.xml89
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/PolicyLevelType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/SecurityElement.xml94
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/SecurityException.xml58
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/SecurityManager.xml76
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/SecurityZone.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/SuppressUnmanagedCodeSecurityAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/UnverifiableCodeAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/VerificationException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Security/XmlSyntaxException.xml34
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Capture.xml48
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CaptureCollection.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CostDelegate.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Group.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/GroupCollection.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Match.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchCollection.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchEvaluator.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Regex.xml291
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCollectionBase.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCompilationInfo.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexOptions.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/ASCIIEncoding.xml102
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/Decoder.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/Encoder.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/Encoding.xml268
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/StringBuilder.xml412
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/UTF7Encoding.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/UTF8Encoding.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Text/UnicodeEncoding.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ApartmentState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/AutoResetEvent.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/IOCompletionCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/Interlocked.xml77
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/LockCookie.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ManualResetEvent.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/Monitor.xml88
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/Mutex.xml35
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/NativeOverlapped.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/Overlapped.xml64
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ReaderWriterLock.xml96
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/RegisteredWaitHandle.xml14
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/SynchronizationLockException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/Thread.xml179
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadAbortException.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventArgs.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadInterruptedException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadPool.xml114
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadPriority.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadStart.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/ThreadStateException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/Timeout.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/Timer.xml79
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/TimerCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/WaitCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/WaitHandle.xml94
-rw-r--r--mcs/docs/apidocs/xml/en/System.Threading/WaitOrTimerCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/Cache.xml114
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependency.xml53
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependencyCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheEntry.xml106
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheExpires.xml43
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriority.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriorityDecay.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedReason.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresBucket.xml48
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresEntry.xml20
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Caching/Flags.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Configuration/AuthenticationMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Configuration/ClientTargetSectionHandler.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsAuthPasswordFormat.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsProtectionEnum.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventArgs.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdRotator.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseCompareValidator.xml25
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseDataList.xml78
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseValidator.xml64
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BorderStyle.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BoundColumn.xml44
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Button.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumn.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumnType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Calendar.xml167
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarDay.xml53
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarSelectionMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBox.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBoxList.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventArgs.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CompareValidator.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CustomValidator.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGrid.xml208
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumn.xml90
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumnCollection.xml87
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventArgs.xml25
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItem.xml35
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemCollection.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventArgs.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventArgs.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPagerStyle.xml55
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventArgs.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataKeyCollection.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataList.xml197
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventArgs.xml25
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItem.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemCollection.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventArgs.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayNameFormat.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventArgs.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DropDownList.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/EditCommandColumn.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FirstDayOfWeek.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontInfo.xml75
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontNamesConverter.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontSize.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnit.xml150
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnitConverter.xml54
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/GridLines.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HorizontalAlign.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLink.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkColumn.xml60
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkControlBuilder.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/IRepeatInfoUser.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Image.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageAlign.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageButton.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Label.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LabelControlBuilder.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButton.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButtonControlBuilder.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListBox.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListControl.xml77
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItem.xml59
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemCollection.xml133
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemControlBuilder.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListSelectionMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Literal.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LiteralControlBuilder.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventArgs.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/NextPrevFormat.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagedDataSource.xml121
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerPosition.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Panel.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolder.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolderControlBuilder.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButton.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButtonList.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RangeValidator.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RegularExpressionValidator.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatDirection.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatInfo.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatLayout.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Repeater.xml77
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventArgs.xml25
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItem.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemCollection.xml50
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventArgs.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RequiredFieldValidator.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/SelectedDatesCollection.xml80
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventArgs.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Style.xml112
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Table.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCell.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellCollection.xml87
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellControlBuilder.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableHeaderCell.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableItemStyle.xml56
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRow.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRowCollection.xml87
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableStyle.xml66
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TargetConverter.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TemplateColumn.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextAlign.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBox.xml62
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxControlBuilder.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TitleFormat.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Unit.xml127
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitConverter.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatedControlConverter.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationCompareOperator.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationDataType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummary.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummaryDisplayMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatorDisplay.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/VerticalAlign.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebColorConverter.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebControl.xml138
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Xml.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/BuildMethod.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/BuildTemplateMethod.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/Control.xml171
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/DataBindingHandlerAttribute.xml31
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/DesignTimeParseData.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriter.xml409
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterAttribute.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterStyle.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterTag.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/IAttributeAccessor.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/IDataBindingsAccessor.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/INamingContainer.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/IParserAccessor.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackDataHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/IStateManager.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/ITagNameToTypeMapper.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/ITemplate.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/IValidator.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/ImageClickEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/LiteralControl.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/OutputCacheLocation.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/Pair.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/PersistenceMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/PropertyConverter.xml30
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/StateBag.xml78
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/StateItem.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.UI/ToolboxDataAttribute.xml38
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Utils/FileAction.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Utils/FileChangeEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Utils/NativeFileChangeEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Utils/WebEqualComparer.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web.Utils/WebHashCodeProvider.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/BeginEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/EndEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/EndOfSendNotification.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpCacheRevalidation.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpCacheability.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpCookie.xml64
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpCookieCollection.xml63
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpRuntime.xml102
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpServerUtility.xml140
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpValidationStatus.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/HttpWorkerRequest.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/ProcessShutdownReason.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/ProcessStatus.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Web/TraceMode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventArgs.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchema.xml176
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAll.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotated.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotation.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAny.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnyAttribute.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAppInfo.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttribute.xml62
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroup.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroupRef.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaChoice.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollection.xml87
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollectionEnumerator.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContent.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentExtension.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentRestriction.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexType.xml72
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContent.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentModel.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentProcessing.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDatatype.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDerivationMethod.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDocumentation.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaElement.xml97
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaEnumerationFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaException.xml46
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaExternal.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFacet.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaForm.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFractionDigitsFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroup.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupBase.xml13
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupRef.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaIdentityConstraint.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaImport.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaInclude.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKey.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKeyref.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaLengthFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxLengthFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinExclusiveFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinInclusiveFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinLengthFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNotation.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNumericFacet.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObject.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectCollection.xml65
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectEnumerator.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectTable.xml39
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaParticle.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaPatternFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaRedefine.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSequence.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContent.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentExtension.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentRestriction.xml37
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleType.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeContent.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeList.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.xml27
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeUnion.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaTotalDigitsFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaType.xml52
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUnique.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUse.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaXPath.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSeverityType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/IXPathNavigable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathExpression.xml46
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNamespaceScope.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNavigator.xml288
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeIterator.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathResultType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathScanner.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathTokenType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlDataType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlSortOrder.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/EntityHandling.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/Formatting.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/IHasXmlNode.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/IXmlLineInfo.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/NameTable.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/ReadState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/ValidationType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/WhitespaceHandling.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/WriteState.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlAttribute.xml96
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlAttributeCollection.xml79
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlCDataSection.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlCaseOrder.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlCharacterData.xml63
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlComment.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlDeclaration.xml66
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlDocument.xml353
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentFragment.xml56
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentType.xml71
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlElement.xml213
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlEntity.xml81
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlEntityReference.xml56
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlException.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlImplementation.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlLinkedNode.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNameTable.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNamedNodeMap.xml56
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNamespaceManager.xml70
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNode.xml250
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedAction.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventArgs.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNodeList.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNodeOrder.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNodeType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlNotation.xml66
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlParserContext.xml102
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlProcessingInstruction.xml61
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlQualifiedName.xml79
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlReader.xml298
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlResolver.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlSignificantWhitespace.xml46
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlSpace.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlText.xml52
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlTextReader.xml349
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlTextWriter.xml254
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlTokenizedType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlUrlResolver.xml32
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlWhitespace.xml46
-rw-r--r--mcs/docs/apidocs/xml/en/System.Xml/XmlWriter.xml275
-rw-r--r--mcs/docs/apidocs/xml/en/System/AppDomain.xml426
-rw-r--r--mcs/docs/apidocs/xml/en/System/AppDomainSetup.xml67
-rw-r--r--mcs/docs/apidocs/xml/en/System/AppDomainUnloadedException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ApplicationException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ArgumentException.xml48
-rw-r--r--mcs/docs/apidocs/xml/en/System/ArgumentNullException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ArgumentOutOfRangeException.xml42
-rw-r--r--mcs/docs/apidocs/xml/en/System/ArithmeticException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/Array.xml366
-rw-r--r--mcs/docs/apidocs/xml/en/System/ArrayTypeMismatchException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/AssemblyLoadEventArgs.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System/AssemblyLoadEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/AsyncCallback.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/Attribute.xml261
-rw-r--r--mcs/docs/apidocs/xml/en/System/AttributeTargets.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/AttributeUsageAttribute.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System/BadImageFormatException.xml63
-rw-r--r--mcs/docs/apidocs/xml/en/System/BitConverter.xml175
-rw-r--r--mcs/docs/apidocs/xml/en/System/Boolean.xml150
-rw-r--r--mcs/docs/apidocs/xml/en/System/Buffer.xml39
-rw-r--r--mcs/docs/apidocs/xml/en/System/Byte.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/CLSCompliantAttribute.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System/CannotUnloadAppDomainException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/Char.xml344
-rw-r--r--mcs/docs/apidocs/xml/en/System/CharEnumerator.xml28
-rw-r--r--mcs/docs/apidocs/xml/en/System/Console.xml311
-rw-r--r--mcs/docs/apidocs/xml/en/System/ContextBoundObject.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/ContextMarshalException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ContextStaticAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/Convert.xml1924
-rw-r--r--mcs/docs/apidocs/xml/en/System/CrossAppDomainDelegate.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/DBNull.xml35
-rw-r--r--mcs/docs/apidocs/xml/en/System/DateTime.xml565
-rw-r--r--mcs/docs/apidocs/xml/en/System/DayOfWeek.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/Decimal.xml454
-rw-r--r--mcs/docs/apidocs/xml/en/System/DivideByZeroException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/DllNotFoundException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/Double.xml225
-rw-r--r--mcs/docs/apidocs/xml/en/System/DuplicateWaitObjectException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/EntryPointNotFoundException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/Environment.xml117
-rw-r--r--mcs/docs/apidocs/xml/en/System/EventArgs.xml16
-rw-r--r--mcs/docs/apidocs/xml/en/System/EventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/ExecutionEngineException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/FieldAccessException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/FlagsAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/FormatException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/GC.xml14
-rw-r--r--mcs/docs/apidocs/xml/en/System/Guid.xml119
-rw-r--r--mcs/docs/apidocs/xml/en/System/IAppDomainSetup.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IAsyncResult.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/ICloneable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IComparable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IConvertible.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IDisposable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IFormatProvider.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IFormattable.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IServiceProvider.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/IndexOutOfRangeException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/Int16.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/Int32.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/Int64.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/IntPtr.xml120
-rw-r--r--mcs/docs/apidocs/xml/en/System/IntegerFormatter.xml76
-rw-r--r--mcs/docs/apidocs/xml/en/System/InvalidCastException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/InvalidOperationException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/InvalidProgramException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/LoaderOptimization.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/LoaderOptimizationAttribute.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/LocalDataStoreSlot.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/MTAThreadAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/MarshalByRefObject.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System/Math.xml398
-rw-r--r--mcs/docs/apidocs/xml/en/System/MemberAccessException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/MethodAccessException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/MissingFieldException.xml29
-rw-r--r--mcs/docs/apidocs/xml/en/System/MissingMemberException.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System/MissingMethodException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/MonoDummy.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/MonoTODOAttribute.xml22
-rw-r--r--mcs/docs/apidocs/xml/en/System/MulticastNotSupportedException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/NonSerializedAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/NotFiniteNumberException.xml47
-rw-r--r--mcs/docs/apidocs/xml/en/System/NotImplementedException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/NotSupportedException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/NullReferenceException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ObjectDisposedException.xml36
-rw-r--r--mcs/docs/apidocs/xml/en/System/ObsoleteAttribute.xml33
-rw-r--r--mcs/docs/apidocs/xml/en/System/OperatingSystem.xml45
-rw-r--r--mcs/docs/apidocs/xml/en/System/OutOfMemoryException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/OverflowException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ParamArrayAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/PlatformID.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/PlatformNotSupportedException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/Random.xml46
-rw-r--r--mcs/docs/apidocs/xml/en/System/RankException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ResolveEventArgs.xml18
-rw-r--r--mcs/docs/apidocs/xml/en/System/ResolveEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/RuntimeArgumentHandle.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/RuntimeFieldHandle.xml20
-rw-r--r--mcs/docs/apidocs/xml/en/System/RuntimeMethodHandle.xml20
-rw-r--r--mcs/docs/apidocs/xml/en/System/RuntimeTypeHandle.xml20
-rw-r--r--mcs/docs/apidocs/xml/en/System/SByte.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/STAThreadAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/SerializableAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/Single.xml225
-rw-r--r--mcs/docs/apidocs/xml/en/System/SpecialFolder.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/StackOverflowException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/String.xml630
-rw-r--r--mcs/docs/apidocs/xml/en/System/SystemException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/ThreadStaticAttribute.xml12
-rw-r--r--mcs/docs/apidocs/xml/en/System/TimeSpan.xml292
-rw-r--r--mcs/docs/apidocs/xml/en/System/TimeZone.xml60
-rw-r--r--mcs/docs/apidocs/xml/en/System/Type.xml758
-rw-r--r--mcs/docs/apidocs/xml/en/System/TypeCode.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/TypeInitializationException.xml26
-rw-r--r--mcs/docs/apidocs/xml/en/System/TypeLoadException.xml40
-rw-r--r--mcs/docs/apidocs/xml/en/System/TypeUnloadedException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/UInt16.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/UInt32.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/UInt64.xml185
-rw-r--r--mcs/docs/apidocs/xml/en/System/UIntPtr.xml113
-rw-r--r--mcs/docs/apidocs/xml/en/System/UnauthorizedAccessException.xml23
-rw-r--r--mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventArgs.xml24
-rw-r--r--mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventHandler.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/Uri.xml233
-rw-r--r--mcs/docs/apidocs/xml/en/System/UriFormatException.xml17
-rw-r--r--mcs/docs/apidocs/xml/en/System/UriHostNameType.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/UriPartial.xml9
-rw-r--r--mcs/docs/apidocs/xml/en/System/Version.xml133
-rw-r--r--mcs/docs/apidocs/xml/en/System/Void.xml8
-rw-r--r--mcs/docs/apidocs/xml/en/System/WeakReference.xml41
-rw-r--r--mcs/docs/apidocs/xml/en/System/_AppDomain.xml8
-rwxr-xr-xmcs/docs/clr-abi.txt3
-rwxr-xr-xmcs/docs/compiler374
-rwxr-xr-xmcs/docs/order.txt3
-rw-r--r--mcs/doctools/.cvsignore1
-rw-r--r--mcs/doctools/ChangeLog13
-rw-r--r--mcs/doctools/README.build8
-rw-r--r--mcs/doctools/doctools.build70
-rw-r--r--mcs/doctools/etc/gui/AboutMonodoc.pngbin12632 -> 0 bytes
-rw-r--r--mcs/doctools/etc/gui/AssemblyBrowser.pngbin1949 -> 0 bytes
-rw-r--r--mcs/doctools/etc/gui/ErrorExplosion.pngbin9302 -> 0 bytes
-rw-r--r--mcs/doctools/etc/gui/ImageResources.resx504
-rw-r--r--mcs/doctools/etc/gui/TextResources.resx138
-rw-r--r--mcs/doctools/etc/gui/readme.txt20
-rw-r--r--mcs/doctools/etc/monodoc.dtd135
-rwxr-xr-xmcs/doctools/makefile11
-rw-r--r--mcs/doctools/src/Console/docstub.cs693
-rw-r--r--mcs/doctools/src/Console/docval.cs94
-rw-r--r--mcs/doctools/src/Core/.cvsignore3
-rw-r--r--mcs/doctools/src/Core/AbstractClassStructDoc.cs116
-rw-r--r--mcs/doctools/src/Core/AbstractDoc.cs77
-rw-r--r--mcs/doctools/src/Core/AbstractMethodOperatorDoc.cs59
-rw-r--r--mcs/doctools/src/Core/AbstractTypeDoc.cs45
-rw-r--r--mcs/doctools/src/Core/AssemblyInfo.cs79
-rw-r--r--mcs/doctools/src/Core/AssemblyLoader.cs359
-rw-r--r--mcs/doctools/src/Core/ClassDoc.cs36
-rw-r--r--mcs/doctools/src/Core/ConstructorDoc.cs52
-rw-r--r--mcs/doctools/src/Core/Core.csproj223
-rw-r--r--mcs/doctools/src/Core/DelegateDoc.cs45
-rw-r--r--mcs/doctools/src/Core/DocProject.cs327
-rw-r--r--mcs/doctools/src/Core/EnumDoc.cs45
-rw-r--r--mcs/doctools/src/Core/EventDoc.cs47
-rw-r--r--mcs/doctools/src/Core/ExceptionDoc.cs55
-rw-r--r--mcs/doctools/src/Core/FieldDoc.cs36
-rw-r--r--mcs/doctools/src/Core/InterfaceDoc.cs36
-rw-r--r--mcs/doctools/src/Core/MethodDoc.cs36
-rw-r--r--mcs/doctools/src/Core/MonodocException.cs40
-rw-r--r--mcs/doctools/src/Core/NamingFlags.cs36
-rw-r--r--mcs/doctools/src/Core/NotifyArrayList.cs175
-rw-r--r--mcs/doctools/src/Core/NotifyCollection.cs82
-rw-r--r--mcs/doctools/src/Core/NotifyHashtable.cs174
-rw-r--r--mcs/doctools/src/Core/OperatorDoc.cs36
-rw-r--r--mcs/doctools/src/Core/PropertyDoc.cs52
-rw-r--r--mcs/doctools/src/Core/RecursiveFileList.cs105
-rw-r--r--mcs/doctools/src/Core/SortedStringValues.cs85
-rw-r--r--mcs/doctools/src/Core/StructDoc.cs36
-rw-r--r--mcs/doctools/src/Core/TypeNameHelper.cs122
-rw-r--r--mcs/doctools/src/Core/ValueConstrainedArrayList.cs164
-rw-r--r--mcs/doctools/src/Gui/.cvsignore3
-rw-r--r--mcs/doctools/src/Gui/AboutForm.cs82
-rw-r--r--mcs/doctools/src/Gui/AssemblyTreeImages.cs94
-rw-r--r--mcs/doctools/src/Gui/AssemblyTreeLoader.cs461
-rw-r--r--mcs/doctools/src/Gui/DirectorySelectorForm.cs318
-rw-r--r--mcs/doctools/src/Gui/EditPropertyForm.cs182
-rw-r--r--mcs/doctools/src/Gui/ExampleCodeEditorForm.cs166
-rw-r--r--mcs/doctools/src/Gui/GenericEditorForm.cs232
-rw-r--r--mcs/doctools/src/Gui/Gui.csproj238
-rw-r--r--mcs/doctools/src/Gui/GuiDriver.cs45
-rw-r--r--mcs/doctools/src/Gui/GuiResources.cs78
-rw-r--r--mcs/doctools/src/Gui/MainForm.cs898
-rw-r--r--mcs/doctools/src/Gui/MdiToolBar.cs206
-rw-r--r--mcs/doctools/src/Gui/ProjectOptionsForm.cs560
-rw-r--r--mcs/doctools/src/Gui/TypeEditorForm.cs120
-rw-r--r--mcs/doctools/src/Gui/UnexpectedErrorForm.cs203
-rw-r--r--mcs/doctools/src/doctools.sln27
-rwxr-xr-xmcs/errors/1529.cs4
-rw-r--r--mcs/errors/ChangeLog9
-rwxr-xr-xmcs/errors/bug1.cs17
-rw-r--r--mcs/errors/bug10.cs30
-rwxr-xr-xmcs/errors/bug11.cs23
-rwxr-xr-xmcs/errors/bug12.cs19
-rwxr-xr-xmcs/errors/bug13.cs11
-rwxr-xr-xmcs/errors/bug14.cs15
-rwxr-xr-xmcs/errors/bug15.cs25
-rw-r--r--mcs/errors/bug16.cs24
-rwxr-xr-xmcs/errors/bug17.cs10
-rwxr-xr-xmcs/errors/bug18.cs16
-rwxr-xr-xmcs/errors/bug19.cs18
-rwxr-xr-xmcs/errors/bug2.cs29
-rwxr-xr-xmcs/errors/bug3.cs36
-rwxr-xr-xmcs/errors/bug4.cs18
-rwxr-xr-xmcs/errors/bug5.cs23
-rwxr-xr-xmcs/errors/bug6.cs14
-rwxr-xr-xmcs/errors/bug7.cs13
-rwxr-xr-xmcs/errors/bug8.cs20
-rwxr-xr-xmcs/errors/bug9.cs7
-rw-r--r--mcs/errors/cs-11.cs20
-rwxr-xr-xmcs/errors/cs-12.cs34
-rw-r--r--mcs/errors/cs-20.cs35
-rwxr-xr-xmcs/errors/cs0017.cs9
-rwxr-xr-xmcs/errors/cs0019-2.cs20
-rwxr-xr-xmcs/errors/cs0019-3.cs19
-rwxr-xr-xmcs/errors/cs0019-4.cs20
-rwxr-xr-xmcs/errors/cs0019-5.cs16
-rw-r--r--mcs/errors/cs0019.cs14
-rwxr-xr-xmcs/errors/cs0020.cs12
-rw-r--r--mcs/errors/cs0023.cs13
-rwxr-xr-xmcs/errors/cs0026-2.cs10
-rwxr-xr-xmcs/errors/cs0026.cs8
-rwxr-xr-xmcs/errors/cs0028.cs12
-rwxr-xr-xmcs/errors/cs0029.cs12
-rw-r--r--mcs/errors/cs0030.cs15
-rw-r--r--mcs/errors/cs0031.cs14
-rwxr-xr-xmcs/errors/cs0034.cs15
-rwxr-xr-xmcs/errors/cs0039.cs16
-rwxr-xr-xmcs/errors/cs0051.cs15
-rwxr-xr-xmcs/errors/cs0060.cs7
-rw-r--r--mcs/errors/cs0066.cs25
-rw-r--r--mcs/errors/cs0070.cs30
-rwxr-xr-xmcs/errors/cs0107.cs6
-rwxr-xr-xmcs/errors/cs0108.cs10
-rwxr-xr-xmcs/errors/cs0110.cs29
-rw-r--r--mcs/errors/cs0111.cs21
-rwxr-xr-xmcs/errors/cs0113.cs3
-rwxr-xr-xmcs/errors/cs0114.cs9
-rwxr-xr-xmcs/errors/cs0115.cs5
-rwxr-xr-xmcs/errors/cs0117.cs10
-rwxr-xr-xmcs/errors/cs0118.cs11
-rwxr-xr-xmcs/errors/cs0120-2.cs26
-rwxr-xr-xmcs/errors/cs0120.cs15
-rwxr-xr-xmcs/errors/cs0121.cs17
-rwxr-xr-xmcs/errors/cs0122.cs18
-rw-r--r--mcs/errors/cs0126.cs9
-rwxr-xr-xmcs/errors/cs0127.cs8
-rwxr-xr-xmcs/errors/cs0128.cs12
-rwxr-xr-xmcs/errors/cs0131.cs8
-rwxr-xr-xmcs/errors/cs0132.cs7
-rwxr-xr-xmcs/errors/cs0133.cs8
-rwxr-xr-xmcs/errors/cs0136-2.cs9
-rwxr-xr-xmcs/errors/cs0136.cs13
-rw-r--r--mcs/errors/cs0139.cs8
-rwxr-xr-xmcs/errors/cs0144-2.cs13
-rwxr-xr-xmcs/errors/cs0144.cs13
-rw-r--r--mcs/errors/cs0146.cs7
-rw-r--r--mcs/errors/cs0150.cs14
-rwxr-xr-xmcs/errors/cs0151.cs19
-rwxr-xr-xmcs/errors/cs0152.cs13
-rwxr-xr-xmcs/errors/cs0153.cs8
-rwxr-xr-xmcs/errors/cs0157.cs12
-rwxr-xr-xmcs/errors/cs0159-2.cs16
-rwxr-xr-xmcs/errors/cs0159.cs23
-rwxr-xr-xmcs/errors/cs0164.cs9
-rwxr-xr-xmcs/errors/cs0165-2.cs16
-rwxr-xr-xmcs/errors/cs0165.cs11
-rwxr-xr-xmcs/errors/cs0169.cs11
-rwxr-xr-xmcs/errors/cs0171.cs11
-rwxr-xr-xmcs/errors/cs0172.cs25
-rwxr-xr-xmcs/errors/cs0176.cs14
-rw-r--r--mcs/errors/cs0178.cs12
-rwxr-xr-xmcs/errors/cs0179.cs14
-rwxr-xr-xmcs/errors/cs0180.cs12
-rwxr-xr-xmcs/errors/cs0183.cs13
-rwxr-xr-xmcs/errors/cs0184.cs13
-rwxr-xr-xmcs/errors/cs0185.cs11
-rwxr-xr-xmcs/errors/cs0187.cs8
-rwxr-xr-xmcs/errors/cs0191.cs12
-rwxr-xr-xmcs/errors/cs0193.cs13
-rwxr-xr-xmcs/errors/cs0196.cs11
-rwxr-xr-xmcs/errors/cs0198.cs12
-rwxr-xr-xmcs/errors/cs0200.cs15
-rwxr-xr-xmcs/errors/cs0206.cs16
-rwxr-xr-xmcs/errors/cs0214-2.cs7
-rwxr-xr-xmcs/errors/cs0214-3.cs12
-rw-r--r--mcs/errors/cs0214.cs5
-rw-r--r--mcs/errors/cs0215.cs13
-rw-r--r--mcs/errors/cs0216.cs9
-rwxr-xr-xmcs/errors/cs0234.cs4
-rw-r--r--mcs/errors/cs0239.cs34
-rwxr-xr-xmcs/errors/cs0242.cs11
-rw-r--r--mcs/errors/cs0246.cs4
-rwxr-xr-xmcs/errors/cs0255.cs13
-rwxr-xr-xmcs/errors/cs0284.cs9
-rwxr-xr-xmcs/errors/cs0500.cs4
-rwxr-xr-xmcs/errors/cs0501.cs5
-rwxr-xr-xmcs/errors/cs0503.cs5
-rw-r--r--mcs/errors/cs0509.cs8
-rwxr-xr-xmcs/errors/cs0513.cs10
-rwxr-xr-xmcs/errors/cs0515.cs7
-rwxr-xr-xmcs/errors/cs0523.cs12
-rw-r--r--mcs/errors/cs0527-2.cs8
-rw-r--r--mcs/errors/cs0527.cs7
-rwxr-xr-xmcs/errors/cs0528.cs10
-rw-r--r--mcs/errors/cs0529.cs7
-rwxr-xr-xmcs/errors/cs0534.cs11
-rwxr-xr-xmcs/errors/cs0539.cs10
-rwxr-xr-xmcs/errors/cs0540.cs11
-rwxr-xr-xmcs/errors/cs0542.cs6
-rw-r--r--mcs/errors/cs0543.cs14
-rwxr-xr-xmcs/errors/cs0552.cs17
-rw-r--r--mcs/errors/cs0555.cs11
-rw-r--r--mcs/errors/cs0556.cs10
-rw-r--r--mcs/errors/cs0563.cs7
-rwxr-xr-xmcs/errors/cs0574.cs13
-rwxr-xr-xmcs/errors/cs0575.cs12
-rw-r--r--mcs/errors/cs0592.cs29
-rw-r--r--mcs/errors/cs0601.cs11
-rwxr-xr-xmcs/errors/cs0616.cs12
-rw-r--r--mcs/errors/cs0617.cs26
-rwxr-xr-xmcs/errors/cs0621.cs5
-rwxr-xr-xmcs/errors/cs0642.cs6
-rwxr-xr-xmcs/errors/cs0644.cs4
-rwxr-xr-xmcs/errors/cs0645.cs4
-rw-r--r--mcs/errors/cs0646.cs26
-rwxr-xr-xmcs/errors/cs0649.cs11
-rwxr-xr-xmcs/errors/cs0654.cs13
-rw-r--r--mcs/errors/cs0658.cs18
-rwxr-xr-xmcs/errors/cs0664.cs8
-rwxr-xr-xmcs/errors/cs0668.cs28
-rwxr-xr-xmcs/errors/cs0677.cs12
-rwxr-xr-xmcs/errors/cs1001.cs11
-rwxr-xr-xmcs/errors/cs1002.cs10
-rw-r--r--mcs/errors/cs1008.cs14
-rwxr-xr-xmcs/errors/cs1011.cs6
-rwxr-xr-xmcs/errors/cs1012.cs6
-rw-r--r--mcs/errors/cs1019.cs27
-rwxr-xr-xmcs/errors/cs102.cs7
-rw-r--r--mcs/errors/cs1020.cs28
-rwxr-xr-xmcs/errors/cs1032.cs8
-rwxr-xr-xmcs/errors/cs1501-2.cs14
-rwxr-xr-xmcs/errors/cs1501.cs15
-rwxr-xr-xmcs/errors/cs1510.cs13
-rwxr-xr-xmcs/errors/cs1511.cs14
-rwxr-xr-xmcs/errors/cs1513.cs3
-rwxr-xr-xmcs/errors/cs1518.cs6
-rwxr-xr-xmcs/errors/cs1520.cs12
-rwxr-xr-xmcs/errors/cs1523.cs14
-rwxr-xr-xmcs/errors/cs1524.cs15
-rwxr-xr-xmcs/errors/cs1525.cs8
-rwxr-xr-xmcs/errors/cs1526.cs8
-rwxr-xr-xmcs/errors/cs1527.cs4
-rwxr-xr-xmcs/errors/cs1528.cs14
-rwxr-xr-xmcs/errors/cs1529.cs4
-rwxr-xr-xmcs/errors/cs1530.cs7
-rwxr-xr-xmcs/errors/cs1552.cs11
-rwxr-xr-xmcs/errors/cs1579.cs13
-rw-r--r--mcs/errors/cs1593.cs30
-rw-r--r--mcs/errors/cs1594.cs30
-rwxr-xr-xmcs/errors/cs1604.cs14
-rwxr-xr-xmcs/errors/cs5001.cs8
-rwxr-xr-xmcs/errors/errors.txt70
-rwxr-xr-xmcs/errors/fail30
-rwxr-xr-xmcs/errors/makefile31
-rwxr-xr-xmcs/jay/.cvsignore2
-rw-r--r--mcs/jay/ACKNOWLEDGEMENTS25
-rwxr-xr-xmcs/jay/ChangeLog9
-rw-r--r--mcs/jay/NEW_FEATURES46
-rw-r--r--mcs/jay/NOTES9
-rw-r--r--mcs/jay/README9
-rw-r--r--mcs/jay/README.jay55
-rw-r--r--mcs/jay/closure.c295
-rw-r--r--mcs/jay/defs.h308
-rw-r--r--mcs/jay/depend11
-rw-r--r--mcs/jay/error.c335
-rw-r--r--mcs/jay/jay.1120
-rw-r--r--mcs/jay/lalr.c678
-rw-r--r--mcs/jay/lr0.c637
-rw-r--r--mcs/jay/main.c341
-rw-r--r--mcs/jay/makefile14
-rw-r--r--mcs/jay/mkpar.c395
-rw-r--r--mcs/jay/output.c1173
-rw-r--r--mcs/jay/reader.c1627
-rw-r--r--mcs/jay/skeleton268
-rw-r--r--mcs/jay/skeleton.cs352
-rw-r--r--mcs/jay/symtab.c158
-rw-r--r--mcs/jay/verbose.c366
-rw-r--r--mcs/jay/warshall.c122
-rwxr-xr-xmcs/makefile23
-rw-r--r--mcs/mbas/.cvsignore11
-rw-r--r--mcs/mbas/AssemblyInfo.cs66
-rw-r--r--mcs/mbas/ChangeLog75
-rw-r--r--mcs/mbas/assign.cs370
-rw-r--r--mcs/mbas/attribute.cs794
-rw-r--r--mcs/mbas/cfold.cs1013
-rw-r--r--mcs/mbas/class.cs4042
-rw-r--r--mcs/mbas/codegen.cs467
-rw-r--r--mcs/mbas/const.cs208
-rw-r--r--mcs/mbas/constant.cs969
-rw-r--r--mcs/mbas/decl.cs484
-rw-r--r--mcs/mbas/delegate.cs717
-rw-r--r--mcs/mbas/driver.cs853
-rw-r--r--mcs/mbas/ecore.cs3892
-rw-r--r--mcs/mbas/enum.cs470
-rw-r--r--mcs/mbas/expression.cs6371
-rw-r--r--mcs/mbas/genericparser.cs336
-rw-r--r--mcs/mbas/interface.cs852
-rw-r--r--mcs/mbas/literal.cs187
-rw-r--r--mcs/mbas/location.cs151
-rw-r--r--mcs/mbas/makefile62
-rw-r--r--mcs/mbas/mb-parser.jay513
-rw-r--r--mcs/mbas/mb-tokenizer.cs864
-rw-r--r--mcs/mbas/mbas.csproj260
-rw-r--r--mcs/mbas/mbas.icobin2686 -> 0 bytes
-rw-r--r--mcs/mbas/mbas.sln33
-rw-r--r--mcs/mbas/modifiers.cs231
-rw-r--r--mcs/mbas/module.cs74
-rw-r--r--mcs/mbas/namespace.cs139
-rw-r--r--mcs/mbas/parameter.cs419
-rw-r--r--mcs/mbas/pending.cs465
-rw-r--r--mcs/mbas/report.cs195
-rw-r--r--mcs/mbas/rootcontext.cs773
-rw-r--r--mcs/mbas/statement.cs3141
-rw-r--r--mcs/mbas/statementCollection.cs166
-rw-r--r--mcs/mbas/support.cs242
-rw-r--r--mcs/mbas/testmbas/.cvsignore4
-rw-r--r--mcs/mbas/testmbas/AssemblyInfo.vb31
-rw-r--r--mcs/mbas/testmbas/WriteOK.vb17
-rw-r--r--mcs/mbas/tree.cs109
-rw-r--r--mcs/mbas/typemanager.cs1687
-rw-r--r--mcs/mcs/.cvsignore16
-rw-r--r--mcs/mcs/AssemblyInfo.cs8
-rwxr-xr-xmcs/mcs/ChangeLog10371
-rwxr-xr-xmcs/mcs/CryptoConvert.cs406
-rw-r--r--mcs/mcs/Makefile71
-rw-r--r--mcs/mcs/NOTES38
-rw-r--r--mcs/mcs/OTODO239
-rw-r--r--mcs/mcs/PLAN165
-rw-r--r--mcs/mcs/README58
-rw-r--r--mcs/mcs/TODO256
-rw-r--r--mcs/mcs/anonymous.cs1137
-rwxr-xr-xmcs/mcs/assign.cs477
-rw-r--r--mcs/mcs/attribute.cs2373
-rwxr-xr-xmcs/mcs/cfold.cs245
-rwxr-xr-xmcs/mcs/class.cs7627
-rwxr-xr-xmcs/mcs/codegen.cs1191
-rwxr-xr-xmcs/mcs/compiler.csproj79
-rwxr-xr-xmcs/mcs/compiler.csproj.user2
-rwxr-xr-xmcs/mcs/compiler.sln42
-rwxr-xr-xmcs/mcs/const.cs246
-rwxr-xr-xmcs/mcs/constant.cs160
-rw-r--r--mcs/mcs/convert.cs1828
-rwxr-xr-xmcs/mcs/cs-parser.jay2100
-rwxr-xr-xmcs/mcs/cs-tokenizer.cs3599
-rwxr-xr-xmcs/mcs/decl.cs1915
-rw-r--r--mcs/mcs/delegate.cs1682
-rwxr-xr-xmcs/mcs/driver.cs1556
-rwxr-xr-xmcs/mcs/ecore.cs3693
-rwxr-xr-xmcs/mcs/enum.cs510
-rwxr-xr-xmcs/mcs/expression.cs6150
-rw-r--r--mcs/mcs/flowanalysis.cs2306
-rwxr-xr-xmcs/mcs/gen-treedump.cs8
-rw-r--r--mcs/mcs/generic.cs56
-rwxr-xr-xmcs/mcs/interface.cs651
-rw-r--r--mcs/mcs/iterators.cs906
-rwxr-xr-xmcs/mcs/literal.cs61
-rw-r--r--mcs/mcs/location.cs213
-rwxr-xr-xmcs/mcs/makefile99
-rw-r--r--mcs/mcs/mb-parser.jay476
-rw-r--r--mcs/mcs/mb-tokenizer.cs824
-rw-r--r--mcs/mcs/mcs.exe.config3
-rw-r--r--mcs/mcs/mcs.exe.sources36
-rwxr-xr-xmcs/mcs/modifiers.cs46
-rwxr-xr-xmcs/mcs/namespace.cs569
-rwxr-xr-xmcs/mcs/old-code.cs1
-rwxr-xr-xmcs/mcs/parameter.cs443
-rwxr-xr-xmcs/mcs/pending.cs323
-rw-r--r--mcs/mcs/report.cs627
-rwxr-xr-xmcs/mcs/rootcontext.cs415
-rwxr-xr-xmcs/mcs/statement.cs3581
-rwxr-xr-xmcs/mcs/support.cs427
-rw-r--r--mcs/mcs/symbolwriter.cs91
-rwxr-xr-xmcs/mcs/tree.cs83
-rwxr-xr-xmcs/mcs/typemanager.cs2270
-rwxr-xr-xmcs/nant/.cvsignore2
-rw-r--r--mcs/nant/ChangeLog17
-rwxr-xr-xmcs/nant/README-nant.txt62
-rwxr-xr-xmcs/nant/doc/arrow.gifbin58 -> 0 bytes
-rwxr-xr-xmcs/nant/doc/authors.html43
-rwxr-xr-xmcs/nant/doc/changelog.html121
-rwxr-xr-xmcs/nant/doc/index.html43
-rwxr-xr-xmcs/nant/doc/license.html48
-rwxr-xr-xmcs/nant/doc/style.css71
-rwxr-xr-xmcs/nant/doc/todo.html55
-rwxr-xr-xmcs/nant/makefile15
-rwxr-xr-xmcs/nant/readme.txt4
-rwxr-xr-xmcs/nant/src/AssemblyInfo.cs37
-rwxr-xr-xmcs/nant/src/AssemblyInfo.cs~38
-rwxr-xr-xmcs/nant/src/Attributes/BooleanValidatorAttribute.cs42
-rwxr-xr-xmcs/nant/src/Attributes/Int32ValidatorAttribute.cs63
-rwxr-xr-xmcs/nant/src/Attributes/TaskAttributeAttribute.cs78
-rwxr-xr-xmcs/nant/src/Attributes/TaskFileSetAttribute.cs40
-rwxr-xr-xmcs/nant/src/Attributes/TaskNameAttribute.cs45
-rwxr-xr-xmcs/nant/src/Attributes/ValidatorAttribute.cs28
-rwxr-xr-xmcs/nant/src/BuildException.cs85
-rwxr-xr-xmcs/nant/src/DirectoryScanner.cs226
-rwxr-xr-xmcs/nant/src/FileSet.cs132
-rwxr-xr-xmcs/nant/src/Location.cs89
-rwxr-xr-xmcs/nant/src/NAnt.cs107
-rwxr-xr-xmcs/nant/src/NAnt.exebin61440 -> 0 bytes
-rwxr-xr-xmcs/nant/src/Project.cs332
-rwxr-xr-xmcs/nant/src/PropertyDictionary.cs72
-rwxr-xr-xmcs/nant/src/Target.cs115
-rwxr-xr-xmcs/nant/src/TargetCollection.cs35
-rwxr-xr-xmcs/nant/src/Task.cs192
-rwxr-xr-xmcs/nant/src/TaskBuilder.cs84
-rwxr-xr-xmcs/nant/src/TaskBuilderCollection.cs46
-rwxr-xr-xmcs/nant/src/TaskCollection.cs26
-rwxr-xr-xmcs/nant/src/TaskFactory.cs57
-rwxr-xr-xmcs/nant/src/Tasks/CallTask.cs41
-rw-r--r--mcs/nant/src/Tasks/ChangeLog13
-rwxr-xr-xmcs/nant/src/Tasks/CompilerBase.cs195
-rwxr-xr-xmcs/nant/src/Tasks/CopyTask.cs196
-rwxr-xr-xmcs/nant/src/Tasks/CscTask.cs45
-rwxr-xr-xmcs/nant/src/Tasks/DeleteTask.cs173
-rwxr-xr-xmcs/nant/src/Tasks/EchoTask.cs34
-rwxr-xr-xmcs/nant/src/Tasks/ExecTask.cs58
-rwxr-xr-xmcs/nant/src/Tasks/ExternalProgramBase.cs130
-rwxr-xr-xmcs/nant/src/Tasks/FailTask.cs38
-rwxr-xr-xmcs/nant/src/Tasks/IncludeTask.cs134
-rwxr-xr-xmcs/nant/src/Tasks/JscTask.cs40
-rw-r--r--mcs/nant/src/Tasks/McsTask.cs47
-rwxr-xr-xmcs/nant/src/Tasks/MkDirTask.cs49
-rwxr-xr-xmcs/nant/src/Tasks/MoveTask.cs71
-rwxr-xr-xmcs/nant/src/Tasks/NantTask.cs65
-rwxr-xr-xmcs/nant/src/Tasks/PropertyTask.cs37
-rwxr-xr-xmcs/nant/src/Tasks/SleepTask.cs91
-rwxr-xr-xmcs/nant/src/Tasks/StyleTask.cs171
-rwxr-xr-xmcs/nant/src/Tasks/TStampTask.cs43
-rwxr-xr-xmcs/nant/src/Tasks/TaskDefTask.cs42
-rwxr-xr-xmcs/nant/src/Tasks/VbcTask.cs40
-rwxr-xr-xmcs/nant/src/Util/Log.cs155
-rwxr-xr-xmcs/nant/src/Util/XmlNodeTextPositionMap.cs187
-rw-r--r--mcs/nunit/.cvsignore2
-rw-r--r--mcs/nunit/ChangeLog32
-rwxr-xr-xmcs/nunit/RunTests.cs79
-rw-r--r--mcs/nunit/makefile12
-rwxr-xr-xmcs/nunit/nunit.build85
-rw-r--r--mcs/nunit/src/NUnitConsole/AssemblyInfo.cs55
-rwxr-xr-xmcs/nunit/src/NUnitConsole/NUnitConsole.csproj93
-rw-r--r--mcs/nunit/src/NUnitConsole/NUnitConsole.xml146
-rw-r--r--mcs/nunit/src/NUnitConsole/NUnitConsoleMain.cs35
-rw-r--r--mcs/nunit/src/NUnitConsole/TestRunner.cs277
-rw-r--r--mcs/nunit/src/NUnitCore/ActiveTestSuite.cs113
-rw-r--r--mcs/nunit/src/NUnitCore/AssemblyInfo.cs55
-rwxr-xr-xmcs/nunit/src/NUnitCore/AssemblyTestCollector.cs72
-rw-r--r--mcs/nunit/src/NUnitCore/Assertion.cs184
-rw-r--r--mcs/nunit/src/NUnitCore/AssertionFailedError.cs27
-rw-r--r--mcs/nunit/src/NUnitCore/BaseTestRunner.cs323
-rw-r--r--mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs78
-rw-r--r--mcs/nunit/src/NUnitCore/ExceptionTestCase.cs53
-rw-r--r--mcs/nunit/src/NUnitCore/ExpectExceptionAttribute.cs47
-rw-r--r--mcs/nunit/src/NUnitCore/IFailureDetailView.cs21
-rw-r--r--mcs/nunit/src/NUnitCore/IProtectable.cs12
-rw-r--r--mcs/nunit/src/NUnitCore/ITest.cs18
-rw-r--r--mcs/nunit/src/NUnitCore/ITestCollector.cs16
-rw-r--r--mcs/nunit/src/NUnitCore/ITestListener.cs65
-rwxr-xr-xmcs/nunit/src/NUnitCore/ITestLoader.cs58
-rw-r--r--mcs/nunit/src/NUnitCore/ITestSuiteLoader.cs17
-rw-r--r--mcs/nunit/src/NUnitCore/LoadingTestCollector.cs54
-rwxr-xr-xmcs/nunit/src/NUnitCore/NUnitCore.csproj238
-rw-r--r--mcs/nunit/src/NUnitCore/NUnitException.cs51
-rw-r--r--mcs/nunit/src/NUnitCore/ReflectionUtils.cs94
-rw-r--r--mcs/nunit/src/NUnitCore/ReloadingTestSuiteLoader.cs33
-rw-r--r--mcs/nunit/src/NUnitCore/RepeatedTest.cs45
-rw-r--r--mcs/nunit/src/NUnitCore/SimpleTestCollector.cs28
-rwxr-xr-xmcs/nunit/src/NUnitCore/StandardLoader.cs222
-rw-r--r--mcs/nunit/src/NUnitCore/StandardTestSuiteLoader.cs47
-rw-r--r--mcs/nunit/src/NUnitCore/TestCase.cs241
-rw-r--r--mcs/nunit/src/NUnitCore/TestCaseClassLoader.cs208
-rw-r--r--mcs/nunit/src/NUnitCore/TestDecorator.cs71
-rw-r--r--mcs/nunit/src/NUnitCore/TestFailure.cs55
-rw-r--r--mcs/nunit/src/NUnitCore/TestResult.cs249
-rw-r--r--mcs/nunit/src/NUnitCore/TestSetup.cs70
-rw-r--r--mcs/nunit/src/NUnitCore/TestSuite.cs293
-rw-r--r--mcs/nunit/src/NUnitCore/Version.cs23
-rwxr-xr-xmcs/tests/ChangeLog415
-rwxr-xr-xmcs/tests/c1.cs7
-rwxr-xr-xmcs/tests/c2.cs2
-rwxr-xr-xmcs/tests/casts.cs566
-rwxr-xr-xmcs/tests/co1.cs4
-rwxr-xr-xmcs/tests/cs1.cs5
-rwxr-xr-xmcs/tests/csc-casts.outbin5041 -> 0 bytes
-rwxr-xr-xmcs/tests/gen-cast-test.cs99
-rwxr-xr-xmcs/tests/gen-check.cs78
-rw-r--r--mcs/tests/i-recursive.cs5
-rwxr-xr-xmcs/tests/i-three.cs11
-rw-r--r--mcs/tests/i-undefined.cs2
-rwxr-xr-xmcs/tests/i1.cs2
-rwxr-xr-xmcs/tests/i2.cs5
-rwxr-xr-xmcs/tests/i3.cs5
-rwxr-xr-xmcs/tests/i4.cs8
-rwxr-xr-xmcs/tests/i5.cs8
-rwxr-xr-xmcs/tests/i6.cs4
-rwxr-xr-xmcs/tests/interfaces.cs22
-rwxr-xr-xmcs/tests/ix1.cs3
-rwxr-xr-xmcs/tests/ix2.cs15
-rwxr-xr-xmcs/tests/makefile133
-rwxr-xr-xmcs/tests/n1.cs11
-rwxr-xr-xmcs/tests/n2.cs4
-rwxr-xr-xmcs/tests/s1.cs7
-rwxr-xr-xmcs/tests/test-1.cs9
-rw-r--r--mcs/tests/test-10.cs150
-rwxr-xr-xmcs/tests/test-100.cs31
-rw-r--r--mcs/tests/test-101.cs39
-rw-r--r--mcs/tests/test-102.cs35
-rwxr-xr-xmcs/tests/test-103.cs28
-rw-r--r--mcs/tests/test-104.cs14
-rw-r--r--mcs/tests/test-105.cs61
-rw-r--r--mcs/tests/test-106.cs50
-rw-r--r--mcs/tests/test-107.cs45
-rwxr-xr-xmcs/tests/test-108.cs44
-rwxr-xr-xmcs/tests/test-109.cs13
-rw-r--r--mcs/tests/test-11.cs27
-rwxr-xr-xmcs/tests/test-110.cs32
-rwxr-xr-xmcs/tests/test-111.cs11
-rwxr-xr-xmcs/tests/test-112.cs19
-rw-r--r--mcs/tests/test-113.cs30
-rw-r--r--mcs/tests/test-114.cs13
-rwxr-xr-xmcs/tests/test-115.cs42
-rwxr-xr-xmcs/tests/test-116.cs12
-rw-r--r--mcs/tests/test-117.cs28
-rwxr-xr-xmcs/tests/test-118.cs14
-rw-r--r--mcs/tests/test-119.cs50
-rw-r--r--mcs/tests/test-12.cs44
-rwxr-xr-xmcs/tests/test-120.cs56
-rwxr-xr-xmcs/tests/test-121.cs35
-rwxr-xr-xmcs/tests/test-122.cs21
-rwxr-xr-xmcs/tests/test-123.cs47
-rw-r--r--mcs/tests/test-124.cs24
-rw-r--r--mcs/tests/test-125.cs100
-rwxr-xr-xmcs/tests/test-126.cs24
-rwxr-xr-xmcs/tests/test-127.cs23
-rw-r--r--mcs/tests/test-128.cs41
-rwxr-xr-xmcs/tests/test-129.cs17
-rw-r--r--mcs/tests/test-13.cs31
-rwxr-xr-xmcs/tests/test-130.cs30
-rw-r--r--mcs/tests/test-131.cs35
-rwxr-xr-xmcs/tests/test-132.cs14
-rwxr-xr-xmcs/tests/test-133.cs36
-rwxr-xr-xmcs/tests/test-134.cs69
-rwxr-xr-xmcs/tests/test-135.cs29
-rwxr-xr-xmcs/tests/test-136.cs60
-rwxr-xr-xmcs/tests/test-137.cs45
-rw-r--r--mcs/tests/test-14.cs43
-rwxr-xr-xmcs/tests/test-15.cs22
-rw-r--r--mcs/tests/test-16.cs61
-rwxr-xr-xmcs/tests/test-17.cs45
-rw-r--r--mcs/tests/test-18.cs52
-rwxr-xr-xmcs/tests/test-19.cs114
-rwxr-xr-xmcs/tests/test-2.cs7
-rwxr-xr-xmcs/tests/test-20.cs70
-rw-r--r--mcs/tests/test-21.cs35
-rw-r--r--mcs/tests/test-22.cs46
-rw-r--r--mcs/tests/test-23.cs106
-rw-r--r--mcs/tests/test-24.cs35
-rw-r--r--mcs/tests/test-25.cs65
-rw-r--r--mcs/tests/test-26.cs72
-rw-r--r--mcs/tests/test-27.cs97
-rw-r--r--mcs/tests/test-28.cs56
-rw-r--r--mcs/tests/test-29.cs40
-rwxr-xr-xmcs/tests/test-3.cs62
-rw-r--r--mcs/tests/test-30.cs60
-rw-r--r--mcs/tests/test-31.cs41
-rw-r--r--mcs/tests/test-32.cs21
-rw-r--r--mcs/tests/test-33.cs51
-rw-r--r--mcs/tests/test-34.cs90
-rwxr-xr-xmcs/tests/test-35.cs71
-rwxr-xr-xmcs/tests/test-36.cs46
-rwxr-xr-xmcs/tests/test-37.cs136
-rwxr-xr-xmcs/tests/test-38.cs36
-rw-r--r--mcs/tests/test-39.cs38
-rwxr-xr-xmcs/tests/test-4.cs40
-rw-r--r--mcs/tests/test-40.cs79
-rw-r--r--mcs/tests/test-41.cs93
-rwxr-xr-xmcs/tests/test-42.cs184
-rwxr-xr-xmcs/tests/test-43.cs78
-rwxr-xr-xmcs/tests/test-44.cs55
-rw-r--r--mcs/tests/test-45.cs101
-rwxr-xr-xmcs/tests/test-46.cs127
-rwxr-xr-xmcs/tests/test-47.cs95
-rw-r--r--mcs/tests/test-48.cs30
-rwxr-xr-xmcs/tests/test-49.cs503
-rwxr-xr-xmcs/tests/test-5.cs14
-rw-r--r--mcs/tests/test-50.cs15
-rwxr-xr-xmcs/tests/test-51.cs89
-rwxr-xr-xmcs/tests/test-52.cs79
-rwxr-xr-xmcs/tests/test-53.cs119
-rwxr-xr-xmcs/tests/test-54.cs23
-rwxr-xr-xmcs/tests/test-55.cs33
-rwxr-xr-xmcs/tests/test-56.cs96
-rw-r--r--mcs/tests/test-57.cs75
-rwxr-xr-xmcs/tests/test-58.cs25
-rwxr-xr-xmcs/tests/test-59.cs89
-rwxr-xr-xmcs/tests/test-6.cs15
-rwxr-xr-xmcs/tests/test-60.cs20
-rwxr-xr-xmcs/tests/test-61.cs39
-rwxr-xr-xmcs/tests/test-62.cs28
-rwxr-xr-xmcs/tests/test-63.cs31
-rwxr-xr-xmcs/tests/test-64.cs29
-rwxr-xr-xmcs/tests/test-65.cs51
-rwxr-xr-xmcs/tests/test-66.cs134
-rw-r--r--mcs/tests/test-67.cs93
-rwxr-xr-xmcs/tests/test-68.cs23
-rw-r--r--mcs/tests/test-69.cs13
-rw-r--r--mcs/tests/test-7.cs176
-rwxr-xr-xmcs/tests/test-70.cs48
-rwxr-xr-xmcs/tests/test-71.cs28
-rwxr-xr-xmcs/tests/test-72.cs21
-rwxr-xr-xmcs/tests/test-73.cs28
-rwxr-xr-xmcs/tests/test-74.cs22
-rwxr-xr-xmcs/tests/test-75.cs36
-rwxr-xr-xmcs/tests/test-76.cs35
-rwxr-xr-xmcs/tests/test-77.cs38
-rwxr-xr-xmcs/tests/test-78.cs59
-rwxr-xr-xmcs/tests/test-79.cs17
-rw-r--r--mcs/tests/test-8.cs29
-rwxr-xr-xmcs/tests/test-80.cs32
-rw-r--r--mcs/tests/test-81.cs37
-rw-r--r--mcs/tests/test-82.cs40
-rwxr-xr-xmcs/tests/test-83.cs47
-rwxr-xr-xmcs/tests/test-84.cs22
-rwxr-xr-xmcs/tests/test-85.cs23
-rw-r--r--mcs/tests/test-86.cs45
-rwxr-xr-xmcs/tests/test-87.cs47
-rwxr-xr-xmcs/tests/test-88.cs18
-rwxr-xr-xmcs/tests/test-89.cs34
-rwxr-xr-xmcs/tests/test-9.cs24
-rwxr-xr-xmcs/tests/test-90.cs37
-rwxr-xr-xmcs/tests/test-91.cs53
-rwxr-xr-xmcs/tests/test-92.cs20
-rwxr-xr-xmcs/tests/test-93.cs47
-rwxr-xr-xmcs/tests/test-94.cs59
-rwxr-xr-xmcs/tests/test-95.cs18
-rwxr-xr-xmcs/tests/test-96.cs20
-rwxr-xr-xmcs/tests/test-97.cs18
-rwxr-xr-xmcs/tests/test-98.cs18
-rwxr-xr-xmcs/tests/test-99.cs25
-rwxr-xr-xmcs/tests/try.cs53
-rwxr-xr-xmcs/tests/unsafe-1.cs163
-rwxr-xr-xmcs/tests/unsafe-2.cs25
-rw-r--r--mcs/tests/unsafe-3.cs31
-rwxr-xr-xmcs/tests/unsafe-4.cs21
-rw-r--r--mcs/tools/.cvsignore4
-rw-r--r--mcs/tools/ChangeLog124
-rwxr-xr-xmcs/tools/DumpCultureInfo.cs176
-rw-r--r--mcs/tools/EnumCheck.cs132
-rw-r--r--mcs/tools/EnumCheckAssemblyCollection.cs77
-rw-r--r--mcs/tools/GenerateDelegate.cs190
-rw-r--r--mcs/tools/IFaceDisco.cs105
-rw-r--r--mcs/tools/SqlSharp/SqlSharpCli.cs624
-rw-r--r--mcs/tools/XMLUtil.cs36
-rw-r--r--mcs/tools/assemblies.xml20
-rw-r--r--mcs/tools/corcompare/.cvsignore2
-rw-r--r--mcs/tools/corcompare/ChangeLog6
-rw-r--r--mcs/tools/corcompare/CompletionInfo.cs573
-rw-r--r--mcs/tools/corcompare/CorCompare.cs72
-rw-r--r--mcs/tools/corcompare/Makefile11
-rw-r--r--mcs/tools/corcompare/MissingAttribute.cs136
-rw-r--r--mcs/tools/corcompare/MissingBase.cs134
-rw-r--r--mcs/tools/corcompare/MissingConstructor.cs30
-rw-r--r--mcs/tools/corcompare/MissingEvent.cs110
-rw-r--r--mcs/tools/corcompare/MissingField.cs76
-rw-r--r--mcs/tools/corcompare/MissingInterface.cs51
-rw-r--r--mcs/tools/corcompare/MissingMember.cs138
-rw-r--r--mcs/tools/corcompare/MissingMethod.cs58
-rw-r--r--mcs/tools/corcompare/MissingNameSpace.cs159
-rw-r--r--mcs/tools/corcompare/MissingNestedType.cs36
-rw-r--r--mcs/tools/corcompare/MissingProperty.cs108
-rw-r--r--mcs/tools/corcompare/MissingType.cs493
-rw-r--r--mcs/tools/corcompare/TODO16
-rw-r--r--mcs/tools/corcompare/ToDoAssembly.cs199
-rw-r--r--mcs/tools/corcompare/corcompare.build12
-rw-r--r--mcs/tools/corcompare/cormissing.xsl424
-rw-r--r--mcs/tools/corcompare/transform.js11
-rw-r--r--mcs/tools/ictool/Makefile10
-rw-r--r--mcs/tools/ictool/depgraph.cs69
-rw-r--r--mcs/tools/ictool/ictool-config.xml105
-rw-r--r--mcs/tools/ictool/ictool.cs428
-rw-r--r--mcs/tools/ictool/peer.cs284
-rw-r--r--mcs/tools/makefile45
-rw-r--r--mcs/tools/monostyle.cs366
-rwxr-xr-xmcs/tools/sample_cast_const.cs49
-rwxr-xr-xmcs/tools/scan-tests.pl163
-rwxr-xr-xmcs/tools/serialize.cs138
-rw-r--r--mcs/tools/verifier.cs1587
-rw-r--r--mint.pc.in12
-rwxr-xr-xmono-win32-setup-light.bmpbin0 -> 154542 bytes
-rw-r--r--mono.pc.in12
-rw-r--r--mono.spec.in79
-rw-r--r--mono/Makefile.am9
-rw-r--r--mono/arch/ChangeLog250
-rw-r--r--mono/arch/Makefile.am2
-rw-r--r--mono/arch/alpha/.cvsignore4
-rw-r--r--mono/arch/alpha/Makefile.am8
-rw-r--r--mono/arch/alpha/alpha-codegen.h516
-rw-r--r--mono/arch/alpha/test.c152
-rw-r--r--mono/arch/alpha/tramp.c359
-rw-r--r--mono/arch/amd64/.cvsignore3
-rw-r--r--mono/arch/amd64/Makefile.am7
-rw-r--r--mono/arch/amd64/amd64-codegen.h937
-rw-r--r--mono/arch/amd64/tramp.c1054
-rw-r--r--mono/arch/amd64/x86-64-codegen.h409
-rw-r--r--mono/arch/arm/Makefile.am2
-rw-r--r--mono/arch/arm/arm-codegen.c8
-rw-r--r--mono/arch/arm/arm-codegen.h417
-rw-r--r--mono/arch/arm/arm-dis.c35
-rw-r--r--mono/arch/arm/arm-dis.h1
-rwxr-xr-xmono/arch/arm/arm-wmmx.h177
-rw-r--r--mono/arch/arm/cmp_macros.th65
-rw-r--r--mono/arch/arm/dpi_macros.th76
-rwxr-xr-xmono/arch/arm/dpiops.sh2
-rw-r--r--mono/arch/arm/mov_macros.th92
-rw-r--r--mono/arch/arm/tramp.c216
-rw-r--r--mono/arch/hppa/.cvsignore3
-rw-r--r--mono/arch/hppa/Makefile.am7
-rw-r--r--mono/arch/hppa/hppa-codegen.h213
-rw-r--r--mono/arch/hppa/tramp.c778
-rw-r--r--mono/arch/mips/mips-codegen.h340
-rw-r--r--mono/arch/mips/test.c149
-rw-r--r--mono/arch/ppc/ppc-codegen.h534
-rw-r--r--mono/arch/ppc/tramp.c624
-rw-r--r--mono/arch/s390/.cvsignore4
-rw-r--r--mono/arch/s390/ChangeLog4
-rw-r--r--mono/arch/s390/Makefile.am7
-rw-r--r--mono/arch/s390/s390-codegen.h686
-rw-r--r--mono/arch/s390/tramp.c1151
-rw-r--r--mono/arch/s390x/.cvsignore6
-rw-r--r--mono/arch/s390x/ChangeLog4
-rw-r--r--mono/arch/s390x/Makefile.am7
-rw-r--r--mono/arch/s390x/s390x-codegen.h741
-rw-r--r--mono/arch/s390x/tramp.c1148
-rw-r--r--mono/arch/sparc/.cvsignore1
-rw-r--r--mono/arch/sparc/sparc-codegen.h552
-rw-r--r--mono/arch/sparc/tramp.c1293
-rw-r--r--mono/arch/unknown.c5
-rw-r--r--mono/arch/x86/tramp.c300
-rw-r--r--mono/arch/x86/x86-codegen.h78
-rw-r--r--mono/benchmark/Makefile.am32
-rwxr-xr-xmono/benchmark/boxtest.cs19
-rw-r--r--mono/benchmark/cmov1.cs29
-rw-r--r--mono/benchmark/cmov2.cs23
-rw-r--r--mono/benchmark/cmov3.cs14
-rw-r--r--mono/benchmark/cmov4.cs33
-rw-r--r--mono/benchmark/cmov5.cs15
-rw-r--r--mono/benchmark/commute.cs37
-rw-r--r--mono/benchmark/contextbound-perf.cs17
-rw-r--r--mono/benchmark/ctor-bench.cs67
-rw-r--r--mono/benchmark/iconst-byte.cs41
-rw-r--r--mono/benchmark/incr.cs26
-rw-r--r--mono/benchmark/inline-readonly.cs17
-rwxr-xr-xmono/benchmark/inline4.cs34
-rwxr-xr-xmono/benchmark/inline5.cs27
-rwxr-xr-xmono/benchmark/inline6.cs29
-rw-r--r--mono/benchmark/lock.cs13
-rwxr-xr-xmono/benchmark/logic.cs2
-rw-r--r--mono/benchmark/long-muldiv.cs24
-rw-r--r--mono/benchmark/max-min.cs26
-rwxr-xr-xmono/benchmark/pinvoke.cs31
-rw-r--r--mono/benchmark/readonly-byte-array.cs30
-rw-r--r--mono/benchmark/readonly-inst.cs23
-rw-r--r--mono/benchmark/readonly-vt.cs22
-rwxr-xr-xmono/benchmark/readonly.cs27
-rw-r--r--mono/benchmark/regalloc-2.cs40
-rw-r--r--mono/benchmark/regalloc-3.cs65
-rw-r--r--mono/benchmark/regalloc.cs54
-rw-r--r--mono/benchmark/regvar.cs43
-rw-r--r--mono/benchmark/sbperf1.cs17
-rw-r--r--mono/benchmark/sbperf2.cs19
-rwxr-xr-xmono/benchmark/static-fields.cs25
-rw-r--r--mono/benchmark/stelemref.cs15
-rwxr-xr-xmono/benchmark/string1.cs30
-rwxr-xr-xmono/benchmark/switch.cs26
-rwxr-xr-xmono/benchmark/test-driver2
-rw-r--r--mono/benchmark/valuetype-hash-equals.cs75
-rw-r--r--mono/benchmark/vt2.cs26
-rw-r--r--mono/benchmark/vtype1.cs26
-rw-r--r--mono/cil/ChangeLog42
-rw-r--r--mono/cil/Makefile.am4
-rw-r--r--mono/cil/cil-opcodes.xml603
-rw-r--r--mono/cil/make-opcodes-def.pl4
-rw-r--r--mono/cil/opcode.def23
-rw-r--r--mono/dis/ChangeLog493
-rw-r--r--mono/dis/Makefile.am13
-rw-r--r--mono/dis/dis-cil.c69
-rw-r--r--mono/dis/dump.c374
-rw-r--r--mono/dis/dump.h8
-rw-r--r--mono/dis/get.c1331
-rw-r--r--mono/dis/get.h22
-rw-r--r--mono/dis/main.c690
-rw-r--r--mono/dis/meta.h1
-rw-r--r--mono/dis/monodis.122
-rw-r--r--mono/dis/util.c46
-rw-r--r--mono/dis/util.h9
-rw-r--r--mono/handles/ChangeLog5
-rw-r--r--mono/handles/Makefile.am15
-rw-r--r--mono/handles/hps.c56
-rw-r--r--mono/handles/scratch.c16
-rw-r--r--mono/handles/shmdel.c2
-rw-r--r--mono/interpreter/.cvsignore3
-rw-r--r--mono/interpreter/ChangeLog475
-rw-r--r--mono/interpreter/Makefile.am50
-rw-r--r--mono/interpreter/embed.h15
-rw-r--r--mono/interpreter/hacks.h11
-rw-r--r--mono/interpreter/interp.c6228
-rw-r--r--mono/interpreter/interp.h89
-rw-r--r--mono/interpreter/main.c9
-rw-r--r--mono/interpreter/mint.15
-rw-r--r--mono/interpreter/mintops.c120
-rw-r--r--mono/interpreter/mintops.def509
-rw-r--r--mono/interpreter/mintops.h58
-rw-r--r--mono/interpreter/transform.c3041
-rw-r--r--mono/io-layer/.cvsignore2
-rw-r--r--mono/io-layer/ChangeLog1291
-rw-r--r--mono/io-layer/Makefile.am42
-rw-r--r--mono/io-layer/access.h20
-rw-r--r--mono/io-layer/atomic.c96
-rw-r--r--mono/io-layer/atomic.h509
-rw-r--r--mono/io-layer/critical-sections.c31
-rw-r--r--mono/io-layer/critical-sections.h2
-rw-r--r--mono/io-layer/daemon-messages.c230
-rw-r--r--mono/io-layer/daemon-messages.h63
-rw-r--r--mono/io-layer/daemon-private.h24
-rw-r--r--mono/io-layer/daemon.c1249
-rw-r--r--mono/io-layer/error.c162
-rw-r--r--mono/io-layer/error.h12
-rw-r--r--mono/io-layer/event-private.h1
-rw-r--r--mono/io-layer/events.c96
-rw-r--r--mono/io-layer/events.h2
-rw-r--r--mono/io-layer/handles-private.h365
-rw-r--r--mono/io-layer/handles.c1243
-rw-r--r--mono/io-layer/hppa_atomic.s252
-rw-r--r--mono/io-layer/io-layer.h5
-rw-r--r--mono/io-layer/io-private.h26
-rw-r--r--mono/io-layer/io.c2624
-rw-r--r--mono/io-layer/io.h22
-rw-r--r--mono/io-layer/misc-private.h1
-rw-r--r--mono/io-layer/misc.c18
-rw-r--r--mono/io-layer/mono-mutex.c48
-rw-r--r--mono/io-layer/mono-mutex.h15
-rw-r--r--mono/io-layer/mono-spinlock.h20
-rw-r--r--mono/io-layer/mutex-private.h4
-rw-r--r--mono/io-layer/mutexes.c208
-rw-r--r--mono/io-layer/mutexes.h2
-rw-r--r--mono/io-layer/process-private.h3
-rw-r--r--mono/io-layer/processes.c524
-rw-r--r--mono/io-layer/processes.h22
-rw-r--r--mono/io-layer/security.c60
-rw-r--r--mono/io-layer/security.h18
-rw-r--r--mono/io-layer/semaphores.c34
-rw-r--r--mono/io-layer/semaphores.h2
-rw-r--r--mono/io-layer/shared.c557
-rw-r--r--mono/io-layer/shared.h19
-rw-r--r--mono/io-layer/socket-private.h2
-rw-r--r--mono/io-layer/socket-wrappers.h79
-rw-r--r--mono/io-layer/sockets.c1082
-rw-r--r--mono/io-layer/sockets.h98
-rw-r--r--mono/io-layer/status.h58
-rw-r--r--mono/io-layer/system.c8
-rw-r--r--mono/io-layer/system.h4
-rw-r--r--mono/io-layer/thread-private.h7
-rw-r--r--mono/io-layer/threads.c596
-rw-r--r--mono/io-layer/threads.h30
-rw-r--r--mono/io-layer/timed-thread.c235
-rw-r--r--mono/io-layer/timed-thread.h43
-rw-r--r--mono/io-layer/timefuncs-private.h3
-rw-r--r--mono/io-layer/timefuncs.c36
-rw-r--r--mono/io-layer/timefuncs.h5
-rw-r--r--mono/io-layer/uglify.h4
-rw-r--r--mono/io-layer/unicode.c33
-rw-r--r--mono/io-layer/unicode.h19
-rw-r--r--mono/io-layer/wait.c221
-rw-r--r--mono/io-layer/wait.h4
-rw-r--r--mono/io-layer/wapi-private.h111
-rw-r--r--mono/io-layer/wapi.h2
-rw-r--r--mono/jit/.cvsignore2
-rw-r--r--mono/jit/ChangeLog980
-rw-r--r--mono/jit/Makefile.am60
-rw-r--r--mono/jit/README10
-rw-r--r--mono/jit/TODO10
-rw-r--r--mono/jit/debug-dwarf2-plus.c68
-rw-r--r--mono/jit/debug-dwarf2.c1372
-rw-r--r--mono/jit/debug-jit.c198
-rw-r--r--mono/jit/debug-jit.h8
-rw-r--r--mono/jit/debug-private.h94
-rw-r--r--mono/jit/debug-stabs.c217
-rw-r--r--mono/jit/debug.c837
-rw-r--r--mono/jit/debug.h88
-rw-r--r--mono/jit/delegate.c196
-rw-r--r--mono/jit/emit-x86.c370
-rw-r--r--mono/jit/exception.c1033
-rw-r--r--mono/jit/helpers.c68
-rw-r--r--mono/jit/invoke.c655
-rw-r--r--mono/jit/jit.c1228
-rw-r--r--mono/jit/jit.h105
-rw-r--r--mono/jit/ldscript6
-rw-r--r--mono/jit/linear-scan.c4
-rw-r--r--mono/jit/message.c343
-rw-r--r--mono/jit/mono.c204
-rw-r--r--mono/jit/trampoline.c123
-rw-r--r--mono/jit/x86.brg941
-rw-r--r--mono/metadata/.cvsignore3
-rw-r--r--mono/metadata/ChangeLog9792
-rw-r--r--mono/metadata/Makefile.am122
-rw-r--r--mono/metadata/NOTES113
-rw-r--r--mono/metadata/TODO11
-rw-r--r--mono/metadata/appdomain.c1234
-rw-r--r--mono/metadata/appdomain.h227
-rw-r--r--mono/metadata/assembly.c1033
-rw-r--r--mono/metadata/assembly.h42
-rw-r--r--mono/metadata/blob.h7
-rw-r--r--mono/metadata/char-conversions.h2004
-rw-r--r--mono/metadata/cil-coff.h2
-rw-r--r--mono/metadata/class-internals.h521
-rw-r--r--mono/metadata/class.c2993
-rw-r--r--mono/metadata/class.h344
-rw-r--r--mono/metadata/culture-info-tables.h3006
-rw-r--r--mono/metadata/culture-info.h109
-rw-r--r--mono/metadata/debug-helpers.c192
-rw-r--r--mono/metadata/debug-helpers.h9
-rw-r--r--mono/metadata/debug-mono-symfile.c295
-rw-r--r--mono/metadata/debug-mono-symfile.h151
-rw-r--r--mono/metadata/debug-symfile.c856
-rw-r--r--mono/metadata/debug-symfile.h130
-rw-r--r--mono/metadata/decimal.c39
-rw-r--r--mono/metadata/decimal.h15
-rw-r--r--mono/metadata/domain-internals.h216
-rw-r--r--mono/metadata/domain.c811
-rw-r--r--mono/metadata/environment.c66
-rw-r--r--mono/metadata/environment.h18
-rw-r--r--mono/metadata/exception.c300
-rw-r--r--mono/metadata/exception.h60
-rw-r--r--mono/metadata/file-io.c692
-rw-r--r--mono/metadata/file-io.h177
-rw-r--r--mono/metadata/filewatcher.c172
-rw-r--r--mono/metadata/filewatcher.h40
-rw-r--r--mono/metadata/gc-internal.h36
-rw-r--r--mono/metadata/gc.c671
-rw-r--r--mono/metadata/gc.h30
-rw-r--r--mono/metadata/icall.c6077
-rw-r--r--mono/metadata/image.c760
-rw-r--r--mono/metadata/image.h134
-rw-r--r--mono/metadata/loader.c1160
-rw-r--r--mono/metadata/loader.h132
-rw-r--r--mono/metadata/locales.c2078
-rw-r--r--mono/metadata/locales.h51
-rwxr-xr-xmono/metadata/make-bundle.pl104
-rw-r--r--mono/metadata/marshal.c6569
-rw-r--r--mono/metadata/marshal.h377
-rw-r--r--mono/metadata/mempool.c67
-rw-r--r--mono/metadata/mempool.h9
-rw-r--r--mono/metadata/metadata-internals.h273
-rw-r--r--mono/metadata/metadata.c1562
-rw-r--r--mono/metadata/metadata.h236
-rw-r--r--mono/metadata/monitor.c600
-rw-r--r--mono/metadata/monitor.h25
-rw-r--r--mono/metadata/mono-config.c135
-rw-r--r--mono/metadata/mono-config.h3
-rw-r--r--mono/metadata/mono-debug-debugger.c1604
-rw-r--r--mono/metadata/mono-debug-debugger.h334
-rw-r--r--mono/metadata/mono-debug.c493
-rw-r--r--mono/metadata/mono-debug.h103
-rw-r--r--mono/metadata/mono-endian.c1
-rw-r--r--mono/metadata/mono-endian.h21
-rw-r--r--mono/metadata/monosn.c551
-rw-r--r--mono/metadata/object-internals.h966
-rw-r--r--mono/metadata/object.c2420
-rw-r--r--mono/metadata/object.h327
-rw-r--r--mono/metadata/opcodes.c69
-rw-r--r--mono/metadata/opcodes.h23
-rw-r--r--mono/metadata/pedump.c109
-rw-r--r--mono/metadata/private.h2
-rw-r--r--mono/metadata/process.c420
-rw-r--r--mono/metadata/process.h35
-rw-r--r--mono/metadata/profiler-private.h16
-rw-r--r--mono/metadata/profiler.c621
-rw-r--r--mono/metadata/profiler.h28
-rw-r--r--mono/metadata/rand.c264
-rw-r--r--mono/metadata/rand.h7
-rw-r--r--mono/metadata/rawbuffer.c61
-rw-r--r--mono/metadata/rawbuffer.h6
-rw-r--r--mono/metadata/reflection.c6747
-rw-r--r--mono/metadata/reflection.h448
-rw-r--r--mono/metadata/row-indexes.h187
-rw-r--r--mono/metadata/sample-bundle5
-rw-r--r--mono/metadata/security.c934
-rw-r--r--mono/metadata/security.h48
-rw-r--r--mono/metadata/socket-io.c1579
-rw-r--r--mono/metadata/socket-io.h94
-rw-r--r--mono/metadata/string-icalls.c414
-rw-r--r--mono/metadata/string-icalls.h39
-rw-r--r--mono/metadata/sysmath.c110
-rw-r--r--mono/metadata/sysmath.h4
-rw-r--r--mono/metadata/tabledefs.h41
-rw-r--r--mono/metadata/threadpool.c405
-rw-r--r--mono/metadata/threadpool.h28
-rw-r--r--mono/metadata/threads-types.h104
-rw-r--r--mono/metadata/threads.c2226
-rw-r--r--mono/metadata/threads.h97
-rw-r--r--mono/metadata/tokentype.h1
-rw-r--r--mono/metadata/unicode.c427
-rw-r--r--mono/metadata/unicode.h74
-rw-r--r--mono/metadata/verify.c782
-rw-r--r--mono/mini/.cvsignore21
-rw-r--r--mono/mini/ChangeLog4159
-rw-r--r--mono/mini/Makefile.am342
-rw-r--r--mono/mini/README1
-rw-r--r--mono/mini/TODO51
-rw-r--r--mono/mini/TestDriver.cs79
-rw-r--r--mono/mini/abcremoval.c1123
-rw-r--r--mono/mini/abcremoval.h315
-rw-r--r--mono/mini/aot.c1581
-rw-r--r--mono/mini/arrays.cs191
-rw-r--r--mono/mini/basic-calls.cs290
-rw-r--r--mono/mini/basic-float.cs518
-rw-r--r--mono/mini/basic-long.cs840
-rw-r--r--mono/mini/basic-math.cs158
-rw-r--r--mono/mini/basic.cs939
-rw-r--r--mono/mini/bench.cs244
-rw-r--r--mono/mini/cfold.c250
-rw-r--r--mono/mini/cprop.c130
-rw-r--r--mono/mini/cpu-amd64.md581
-rw-r--r--mono/mini/cpu-g4.md552
-rw-r--r--mono/mini/cpu-pentium.md567
-rw-r--r--mono/mini/cpu-s390.md530
-rw-r--r--mono/mini/cpu-s390x.md579
-rw-r--r--mono/mini/cpu-sparc.md591
-rw-r--r--mono/mini/debug-mini.c541
-rw-r--r--mono/mini/dominators.c521
-rw-r--r--mono/mini/driver.c962
-rw-r--r--mono/mini/emullong.brg86
-rw-r--r--mono/mini/exceptions-amd64.c621
-rw-r--r--mono/mini/exceptions-ppc.c1010
-rw-r--r--mono/mini/exceptions-s390.c992
-rw-r--r--mono/mini/exceptions-s390x.c1113
-rw-r--r--mono/mini/exceptions-sparc.c414
-rw-r--r--mono/mini/exceptions-x86.c527
-rw-r--r--mono/mini/exceptions.cs2168
-rw-r--r--mono/mini/genmdesc.c236
-rw-r--r--mono/mini/graph.c339
-rw-r--r--mono/mini/helpers.c113
-rw-r--r--mono/mini/iltests.il527
-rw-r--r--mono/mini/inssel-amd64.brg755
-rw-r--r--mono/mini/inssel-float.brg233
-rw-r--r--mono/mini/inssel-long.brg762
-rw-r--r--mono/mini/inssel-long32.brg924
-rw-r--r--mono/mini/inssel-ppc.brg452
-rw-r--r--mono/mini/inssel-s390.brg692
-rw-r--r--mono/mini/inssel-s390x.brg684
-rw-r--r--mono/mini/inssel-sparc.brg710
-rw-r--r--mono/mini/inssel-x86.brg708
-rw-r--r--mono/mini/inssel.brg1775
-rw-r--r--mono/mini/jit-icalls.c556
-rw-r--r--mono/mini/jit.h23
-rw-r--r--mono/mini/ldscript10
-rw-r--r--mono/mini/linear-scan.c221
-rw-r--r--mono/mini/liveness.c375
-rw-r--r--mono/mini/main.c8
-rw-r--r--mono/mini/mini-amd64.c5593
-rw-r--r--mono/mini/mini-amd64.h229
-rw-r--r--mono/mini/mini-arch.h22
-rw-r--r--mono/mini/mini-exceptions.c521
-rw-r--r--mono/mini/mini-ops.h474
-rw-r--r--mono/mini/mini-ppc.c3821
-rw-r--r--mono/mini/mini-ppc.h87
-rw-r--r--mono/mini/mini-s390.c5337
-rw-r--r--mono/mini/mini-s390.h158
-rw-r--r--mono/mini/mini-s390x.c5685
-rw-r--r--mono/mini/mini-s390x.h156
-rw-r--r--mono/mini/mini-sparc.c4780
-rw-r--r--mono/mini/mini-sparc.h130
-rw-r--r--mono/mini/mini-x86.c3934
-rw-r--r--mono/mini/mini-x86.h163
-rw-r--r--mono/mini/mini.c8640
-rw-r--r--mono/mini/mini.h846
-rw-r--r--mono/mini/mini.prj28
-rw-r--r--mono/mini/objects.cs657
-rw-r--r--mono/mini/regalloc.c113
-rw-r--r--mono/mini/regalloc.h59
-rw-r--r--mono/mini/s390-abi.cs319
-rw-r--r--mono/mini/ssa.c1236
-rw-r--r--mono/mini/test.cs348
-rw-r--r--mono/mini/trace.c525
-rw-r--r--mono/mini/trace.h32
-rw-r--r--mono/mini/tramp-amd64.c491
-rw-r--r--mono/mini/tramp-ppc.c573
-rw-r--r--mono/mini/tramp-s390.c606
-rw-r--r--mono/mini/tramp-s390x.c587
-rw-r--r--mono/mini/tramp-sparc.c386
-rw-r--r--mono/mini/tramp-x86.c486
-rw-r--r--mono/mini/viewstat.pl87
-rw-r--r--mono/monoburg/ChangeLog48
-rw-r--r--mono/monoburg/Makefile.am2
-rw-r--r--mono/monoburg/monoburg.125
-rw-r--r--mono/monoburg/monoburg.c363
-rw-r--r--mono/monoburg/monoburg.h11
-rw-r--r--mono/monoburg/monoburg.y128
-rw-r--r--mono/monoburg/sample.brg3
-rw-r--r--mono/monograph/ChangeLog29
-rw-r--r--mono/monograph/Makefile.am11
-rw-r--r--mono/monograph/monograph.c416
-rw-r--r--mono/os/.cvsignore2
-rw-r--r--mono/os/Makefile.am20
-rw-r--r--mono/os/gc_wrapper.h49
-rw-r--r--mono/os/unix/.cvsignore4
-rw-r--r--mono/os/unix/Makefile.am4
-rw-r--r--mono/os/unix/util.c3
-rw-r--r--mono/os/util.h2
-rw-r--r--mono/os/win32/.cvsignore4
-rw-r--r--mono/os/win32/Makefile.am4
-rw-r--r--mono/os/win32/util.c37
-rw-r--r--mono/profiler/.cvsignore7
-rw-r--r--mono/profiler/ChangeLog12
-rw-r--r--mono/profiler/Makefile.am15
-rw-r--r--mono/profiler/mono-cov.c148
-rw-r--r--mono/tests/.cvsignore3
-rw-r--r--mono/tests/ChangeLog338
-rw-r--r--mono/tests/Makefile.am193
-rw-r--r--mono/tests/appdomain-client.cs3
-rw-r--r--mono/tests/appdomain-unload.cs180
-rw-r--r--mono/tests/appdomain.cs4
-rw-r--r--mono/tests/appdomain1.cs99
-rw-r--r--mono/tests/appdomain2.cs73
-rwxr-xr-xmono/tests/appdomain3.cs20
-rw-r--r--mono/tests/array-cast.cs8
-rw-r--r--mono/tests/array3.cs19
-rw-r--r--mono/tests/async_read.cs45
-rw-r--r--mono/tests/base-definition.cs64
-rwxr-xr-xmono/tests/binwritter.cs40
-rw-r--r--mono/tests/bug-27420.cs32
-rw-r--r--mono/tests/bug-29859.il54
-rw-r--r--mono/tests/bug-42136.cs29
-rwxr-xr-xmono/tests/bug-46781.cs22
-rwxr-xr-xmono/tests/bug-47295.cs85
-rw-r--r--mono/tests/bug-48015.cs48
-rw-r--r--mono/tests/cattr-field.cs32
-rw-r--r--mono/tests/cattr-object.cs41
-rwxr-xr-xmono/tests/checked.cs191
-rw-r--r--mono/tests/ckfiniteTest.il23
-rw-r--r--mono/tests/classinit.cs26
-rw-r--r--mono/tests/classinit2.cs20
-rw-r--r--mono/tests/codegen.cs5
-rw-r--r--mono/tests/context-static.cs36
-rw-r--r--mono/tests/custom-attr.cs38
-rw-r--r--mono/tests/decimal-array.cs28
-rw-r--r--mono/tests/delegate.cs19
-rw-r--r--mono/tests/delegate4.cs16
-rw-r--r--mono/tests/delegate6.cs21
-rw-r--r--mono/tests/delegate7.cs66
-rw-r--r--mono/tests/delegate8.cs31
-rw-r--r--mono/tests/even-odd.il70
-rw-r--r--mono/tests/exception15.cs24
-rwxr-xr-xmono/tests/exception16.cs44
-rwxr-xr-xmono/tests/exiting/appdomain.cs14
-rwxr-xr-xmono/tests/exiting/appdomain.out5
-rwxr-xr-xmono/tests/exiting/delegate-async-exception.cs29
-rwxr-xr-xmono/tests/exiting/delegate-async-exception.outbin0 -> 690 bytes
-rwxr-xr-xmono/tests/exiting/delegate-async-exit.cs29
-rwxr-xr-xmono/tests/exiting/delegate-async-exit.out2
-rwxr-xr-xmono/tests/exiting/delegate-delegate-exception.cs29
-rwxr-xr-xmono/tests/exiting/delegate-delegate-exception.outbin0 -> 754 bytes
-rwxr-xr-xmono/tests/exiting/delegate-delegate-exit.cs30
-rwxr-xr-xmono/tests/exiting/delegate-delegate-exit.out1
-rwxr-xr-xmono/tests/exiting/delegate.cs33
-rwxr-xr-xmono/tests/exiting/delegate.out7
-rwxr-xr-xmono/tests/exiting/finalizer-abort.cs41
-rwxr-xr-xmono/tests/exiting/finalizer-abort.out23
-rwxr-xr-xmono/tests/exiting/finalizer-exception.cs36
-rwxr-xr-xmono/tests/exiting/finalizer-exception.outbin0 -> 1135 bytes
-rwxr-xr-xmono/tests/exiting/finalizer-exit.cs28
-rwxr-xr-xmono/tests/exiting/finalizer-exit.out2
-rwxr-xr-xmono/tests/exiting/main-exit.cs26
-rwxr-xr-xmono/tests/exiting/main-exit.out4
-rwxr-xr-xmono/tests/exiting/main-returns-abort-resetabort.cs62
-rwxr-xr-xmono/tests/exiting/main-returns-abort-resetabort.out13
-rwxr-xr-xmono/tests/exiting/main-returns-background-abort-resetabort.cs64
-rwxr-xr-xmono/tests/exiting/main-returns-background-abort-resetabort.out10
-rwxr-xr-xmono/tests/exiting/main-returns-background-resetabort.cs61
-rwxr-xr-xmono/tests/exiting/main-returns-background-resetabort.out6
-rwxr-xr-xmono/tests/exiting/main-returns-background.cs26
-rwxr-xr-xmono/tests/exiting/main-returns-background.out4
-rwxr-xr-xmono/tests/exiting/main-returns.cs25
-rwxr-xr-xmono/tests/exiting/main-returns.out6
-rwxr-xr-xmono/tests/exiting/subthread-exit.cs20
-rwxr-xr-xmono/tests/exiting/subthread-exit.out2
-rwxr-xr-xmono/tests/fib.cs9
-rw-r--r--mono/tests/float-pop.cs26
-rw-r--r--mono/tests/hostname.cs21
-rw-r--r--mono/tests/iface3.cs4
-rw-r--r--mono/tests/interfacecast.cs23
-rw-r--r--mono/tests/invoke-string-ctors.cs44
-rw-r--r--mono/tests/invoke.cs66
-rw-r--r--mono/tests/invoke2.cs68
-rw-r--r--mono/tests/libtest.c1234
-rw-r--r--mono/tests/loader.cs46
-rw-r--r--mono/tests/many-locals.cs5
-rw-r--r--mono/tests/marshal.cs54
-rwxr-xr-xmono/tests/marshal1.cs3
-rwxr-xr-xmono/tests/marshal2.cs139
-rwxr-xr-xmono/tests/marshal3.cs44
-rw-r--r--mono/tests/marshal5.cs33
-rw-r--r--mono/tests/marshal6.cs34
-rw-r--r--mono/tests/marshal7.cs105
-rw-r--r--mono/tests/marshal8.cs75
-rw-r--r--mono/tests/marshal9.cs122
-rwxr-xr-xmono/tests/pinvoke.cs38
-rwxr-xr-xmono/tests/pinvoke1.cs2
-rwxr-xr-xmono/tests/pinvoke10.cs27
-rw-r--r--mono/tests/pinvoke11.cs147
-rw-r--r--mono/tests/pinvoke13.cs40
-rw-r--r--mono/tests/pinvoke14.cs52
-rw-r--r--mono/tests/pinvoke15.cs39
-rw-r--r--mono/tests/pinvoke17.cs96
-rw-r--r--mono/tests/pinvoke18.cs65
-rwxr-xr-xmono/tests/pinvoke2.cs767
-rwxr-xr-xmono/tests/pinvoke3.cs315
-rw-r--r--mono/tests/pointer.cs10
-rwxr-xr-xmono/tests/process1.cs35
-rwxr-xr-xmono/tests/process2.cs47
-rwxr-xr-xmono/tests/qt-instance.il108
-rw-r--r--mono/tests/reflection-const-field.cs68
-rw-r--r--mono/tests/reinit.cs36
-rw-r--r--mono/tests/remoting1.cs12
-rw-r--r--mono/tests/remoting3.cs1
-rwxr-xr-xmono/tests/remoting4.cs160
-rw-r--r--mono/tests/remoting5.cs90
-rw-r--r--mono/tests/runtime-invoke.cs42
-rw-r--r--mono/tests/setenv.cs23
-rw-r--r--mono/tests/sieve.cs4
-rwxr-xr-xmono/tests/static-constructor.cs25
-rwxr-xr-xmono/tests/struct.cs9
-rwxr-xr-xmono/tests/switch.cs16
-rw-r--r--mono/tests/synchronized.cs90
-rw-r--r--mono/tests/test-byval-in-struct.cs33
-rwxr-xr-xmono/tests/test-driver14
-rw-r--r--mono/tests/tests-config.in5
-rw-r--r--mono/tests/thread-static.cs44
-rw-r--r--mono/tests/thread6.cs74
-rwxr-xr-xmono/tests/threadpool.cs43
-rwxr-xr-xmono/tests/threadpool1.cs60
-rw-r--r--mono/tests/typeof-ptr.cs26
-rw-r--r--mono/tests/vararg.il161
-rw-r--r--mono/utils/.cvsignore3
-rw-r--r--mono/utils/ChangeLog184
-rw-r--r--mono/utils/Makefile.am27
-rw-r--r--mono/utils/mono-codeman.c336
-rw-r--r--mono/utils/mono-codeman.h20
-rw-r--r--mono/utils/mono-digest.h64
-rw-r--r--mono/utils/mono-hash.c119
-rw-r--r--mono/utils/mono-hash.h7
-rw-r--r--mono/utils/mono-logger.c241
-rw-r--r--mono/utils/mono-logger.h92
-rw-r--r--mono/utils/mono-math.c30
-rw-r--r--mono/utils/mono-math.h20
-rw-r--r--mono/utils/mono-md5.c357
-rw-r--r--mono/utils/mono-sha1.c303
-rw-r--r--mono/utils/mono-uri.c95
-rw-r--r--mono/utils/mono-uri.h7
-rw-r--r--mono/utils/monobitset.c65
-rw-r--r--mono/utils/monobitset.h6
-rw-r--r--mono/utils/strenc.c195
-rw-r--r--mono/utils/strenc.h19
-rw-r--r--mono/utils/strtod.c103
-rw-r--r--monowiz.win32.nsi650
-rw-r--r--runtime/.cvsignore2
-rw-r--r--runtime/Makefile.am112
-rw-r--r--runtime/net_1_1/.cvsignore4
-rw-r--r--runtime/net_1_1/Makefile.am116
-rw-r--r--runtime/net_2_0/.cvsignore4
-rw-r--r--runtime/net_2_0/Makefile.am121
-rw-r--r--samples/.cvsignore3
-rw-r--r--samples/Makefile.am8
-rw-r--r--samples/embed/invoke.cs50
-rw-r--r--samples/embed/test-invoke.c356
-rw-r--r--samples/embed/test-metadata.c132
-rw-r--r--samples/embed/test.cs11
-rw-r--r--samples/embed/teste.c81
-rw-r--r--samples/embed/testi.c81
-rw-r--r--samples/profiler/sample.c48
-rw-r--r--scripts/.cvsignore25
-rw-r--r--scripts/Makefile.am62
-rw-r--r--scripts/al.in2
-rw-r--r--scripts/cert2spc.in2
-rw-r--r--scripts/certmgr.in2
-rw-r--r--scripts/chktrust.in2
-rw-r--r--scripts/cilc.in2
-rw-r--r--scripts/disco.in2
-rw-r--r--scripts/gacutil.in2
-rw-r--r--scripts/genxs.in2
-rw-r--r--scripts/gmcs.in2
-rw-r--r--scripts/ilasm.in2
-rw-r--r--scripts/makecert.in2
-rw-r--r--scripts/mbas.in2
-rw-r--r--scripts/mcs.in2
-rw-r--r--scripts/mono-find-provides.in2
-rw-r--r--scripts/mono-find-requires.in2
-rw-r--r--scripts/monop.in2
-rw-r--r--scripts/monoresgen.in2
-rw-r--r--scripts/resgen.in2
-rw-r--r--scripts/secutil.in2
-rw-r--r--scripts/setreg.in2
-rw-r--r--scripts/signcode.in2
-rw-r--r--scripts/sn.in2
-rw-r--r--scripts/soapsuds.in2
-rw-r--r--scripts/sqlsharp.in2
-rw-r--r--scripts/wsdl.in2
-rw-r--r--scripts/wsdl2.in2
-rw-r--r--scripts/xsd.in2
-rwxr-xr-xstatus/ChangeLog21
-rwxr-xr-xstatus/class.xml162
-rw-r--r--support/.cvsignore23
-rw-r--r--support/Makefile.am50
-rw-r--r--support/dirent.c99
-rw-r--r--support/errno.c34
-rw-r--r--support/fcntl.c160
-rw-r--r--support/grp.c280
-rw-r--r--support/macros.c144
-rw-r--r--support/map.c5789
-rw-r--r--support/map.h620
-rw-r--r--support/mph.h133
-rw-r--r--support/old-map.c177
-rw-r--r--support/old-map.h71
-rw-r--r--support/pwd.c264
-rw-r--r--support/stdio.c32
-rw-r--r--support/stdlib.c47
-rw-r--r--support/sys-mman.c36
-rw-r--r--support/sys-mount.c56
-rw-r--r--support/sys-sendfile.c43
-rw-r--r--support/sys-stat.c118
-rw-r--r--support/sys-wait.c59
-rw-r--r--support/time.c56
-rw-r--r--support/unistd.c233
-rw-r--r--support/zlib_macros.c107
-rw-r--r--tools/.cvsignore2
-rw-r--r--tools/Makefile.am1
-rw-r--r--tools/locale-builder/.cvsignore3
-rw-r--r--tools/locale-builder/ChangeLog75
-rw-r--r--tools/locale-builder/CultureInfoEntry.cs94
-rw-r--r--tools/locale-builder/DateTimeFormatEntry.cs124
-rw-r--r--tools/locale-builder/Driver.cs972
-rw-r--r--tools/locale-builder/Entry.cs84
-rw-r--r--tools/locale-builder/Makefile.am43
-rw-r--r--tools/locale-builder/NumberFormatEntry.cs117
-rw-r--r--tools/locale-builder/langs/.cvsignore1
-rwxr-xr-xtools/locale-builder/lcids.xml174
-rw-r--r--tools/locale-builder/locales/.cvsignore1
-rwxr-xr-xtools/locale-builder/supp/ChangeLog70
-rwxr-xr-xtools/locale-builder/supp/af_ZA.xml26
-rw-r--r--tools/locale-builder/supp/ar.xml19
-rw-r--r--tools/locale-builder/supp/ar_AE.xml31
-rw-r--r--tools/locale-builder/supp/ar_BH.xml31
-rw-r--r--tools/locale-builder/supp/ar_DZ.xml33
-rw-r--r--tools/locale-builder/supp/ar_EG.xml31
-rw-r--r--tools/locale-builder/supp/ar_IQ.xml20
-rw-r--r--tools/locale-builder/supp/ar_JO.xml32
-rw-r--r--tools/locale-builder/supp/ar_KW.xml31
-rw-r--r--tools/locale-builder/supp/ar_LB.xml31
-rw-r--r--tools/locale-builder/supp/ar_LY.xml31
-rw-r--r--tools/locale-builder/supp/ar_MA.xml31
-rw-r--r--tools/locale-builder/supp/ar_OM.xml31
-rw-r--r--tools/locale-builder/supp/ar_QA.xml31
-rwxr-xr-xtools/locale-builder/supp/ar_SA.xml15
-rw-r--r--tools/locale-builder/supp/ar_SY.xml31
-rw-r--r--tools/locale-builder/supp/ar_TN.xml33
-rw-r--r--tools/locale-builder/supp/ar_YE.xml31
-rwxr-xr-xtools/locale-builder/supp/be_BY.xml23
-rwxr-xr-xtools/locale-builder/supp/bg.xml17
-rwxr-xr-xtools/locale-builder/supp/ca_ES.xml32
-rwxr-xr-xtools/locale-builder/supp/cs_CZ.xml32
-rwxr-xr-xtools/locale-builder/supp/da.xml32
-rwxr-xr-xtools/locale-builder/supp/de.xml23
-rwxr-xr-xtools/locale-builder/supp/de_AT.xml23
-rwxr-xr-xtools/locale-builder/supp/el.xml32
-rw-r--r--tools/locale-builder/supp/en.xml104
-rwxr-xr-xtools/locale-builder/supp/en_AU.xml23
-rw-r--r--tools/locale-builder/supp/en_CA.xml32
-rwxr-xr-xtools/locale-builder/supp/en_GB.xml23
-rw-r--r--tools/locale-builder/supp/en_IE.xml32
-rwxr-xr-xtools/locale-builder/supp/en_NZ.xml25
-rw-r--r--tools/locale-builder/supp/en_PH.xml40
-rw-r--r--tools/locale-builder/supp/en_US.xml19
-rw-r--r--tools/locale-builder/supp/en_ZA.xml32
-rw-r--r--tools/locale-builder/supp/en_ZW.xml34
-rwxr-xr-xtools/locale-builder/supp/es.xml25
-rwxr-xr-xtools/locale-builder/supp/es_AR.xml23
-rwxr-xr-xtools/locale-builder/supp/es_BO.xml23
-rwxr-xr-xtools/locale-builder/supp/es_CL.xml23
-rwxr-xr-xtools/locale-builder/supp/es_CO.xml23
-rwxr-xr-xtools/locale-builder/supp/es_CR.xml23
-rwxr-xr-xtools/locale-builder/supp/es_DO.xml23
-rwxr-xr-xtools/locale-builder/supp/es_EC.xml23
-rwxr-xr-xtools/locale-builder/supp/es_ES.xml23
-rwxr-xr-xtools/locale-builder/supp/es_GT.xml23
-rwxr-xr-xtools/locale-builder/supp/es_HN.xml23
-rwxr-xr-xtools/locale-builder/supp/es_MX.xml23
-rwxr-xr-xtools/locale-builder/supp/es_NI.xml23
-rwxr-xr-xtools/locale-builder/supp/es_PA.xml23
-rwxr-xr-xtools/locale-builder/supp/es_PE.xml23
-rwxr-xr-xtools/locale-builder/supp/es_PR.xml32
-rwxr-xr-xtools/locale-builder/supp/es_PY.xml23
-rwxr-xr-xtools/locale-builder/supp/es_SV.xml23
-rwxr-xr-xtools/locale-builder/supp/es_UY.xml23
-rwxr-xr-xtools/locale-builder/supp/es_VE.xml23
-rwxr-xr-xtools/locale-builder/supp/et.xml23
-rwxr-xr-xtools/locale-builder/supp/eu_ES.xml23
-rwxr-xr-xtools/locale-builder/supp/fa.xml23
-rwxr-xr-xtools/locale-builder/supp/fi.xml32
-rwxr-xr-xtools/locale-builder/supp/fo_FO.xml23
-rwxr-xr-xtools/locale-builder/supp/fr_BE.xml23
-rwxr-xr-xtools/locale-builder/supp/fr_CA.xml23
-rwxr-xr-xtools/locale-builder/supp/fr_CH.xml23
-rwxr-xr-xtools/locale-builder/supp/fr_FR.xml32
-rwxr-xr-xtools/locale-builder/supp/fr_LU.xml23
-rwxr-xr-xtools/locale-builder/supp/he.xml32
-rwxr-xr-xtools/locale-builder/supp/hi_IN.xml23
-rwxr-xr-xtools/locale-builder/supp/hr.xml23
-rwxr-xr-xtools/locale-builder/supp/hu.xml32
-rwxr-xr-xtools/locale-builder/supp/hy.xml23
-rwxr-xr-xtools/locale-builder/supp/id_ID.xml31
-rwxr-xr-xtools/locale-builder/supp/is.xml23
-rwxr-xr-xtools/locale-builder/supp/it_CH.xml23
-rwxr-xr-xtools/locale-builder/supp/it_IT.xml23
-rwxr-xr-xtools/locale-builder/supp/ja.xml72
-rwxr-xr-xtools/locale-builder/supp/ko_KR.xml39
-rwxr-xr-xtools/locale-builder/supp/lt_LT.xml32
-rwxr-xr-xtools/locale-builder/supp/lv.xml23
-rwxr-xr-xtools/locale-builder/supp/mk.xml23
-rwxr-xr-xtools/locale-builder/supp/nl_BE.xml23
-rwxr-xr-xtools/locale-builder/supp/nl_NL.xml32
-rwxr-xr-xtools/locale-builder/supp/pl.xml34
-rwxr-xr-xtools/locale-builder/supp/pt.xml12
-rwxr-xr-xtools/locale-builder/supp/pt_BR.xml32
-rwxr-xr-xtools/locale-builder/supp/pt_PT.xml23
-rwxr-xr-xtools/locale-builder/supp/ro.xml23
-rw-r--r--tools/locale-builder/supp/root.xml17
-rwxr-xr-xtools/locale-builder/supp/ru.xml23
-rwxr-xr-xtools/locale-builder/supp/sk.xml23
-rwxr-xr-xtools/locale-builder/supp/sl.xml23
-rwxr-xr-xtools/locale-builder/supp/sq.xml23
-rwxr-xr-xtools/locale-builder/supp/sv_FI.xml23
-rwxr-xr-xtools/locale-builder/supp/sv_SE.xml23
-rwxr-xr-xtools/locale-builder/supp/sw_KE.xml23
-rw-r--r--tools/locale-builder/supp/th.xml31
-rwxr-xr-xtools/locale-builder/supp/tr.xml23
-rwxr-xr-xtools/locale-builder/supp/uk.xml23
-rwxr-xr-xtools/locale-builder/supp/vi.xml23
-rw-r--r--tools/locale-builder/supplementalData.xml968
-rw-r--r--web/.cvsignore1
-rwxr-xr-xweb/ChangeLog109
-rw-r--r--web/Makefile.am21
-rw-r--r--web/MonoBeta1PressCoverage.html1
-rw-r--r--web/MonoIcon.png (renamed from mcs/MonoIcon.png)bin448 -> 448 bytes
-rw-r--r--web/README37
-rw-r--r--web/ado-net958
-rw-r--r--web/anoncvs9
-rwxr-xr-xweb/asp-net141
-rw-r--r--web/beta1-press1
-rw-r--r--web/blogs38
-rw-r--r--web/books35
-rw-r--r--web/bugs82
-rw-r--r--web/c-sharp89
-rw-r--r--web/ccvs413
-rw-r--r--web/class-status.in53
-rw-r--r--web/classlib-doc114
-rw-r--r--web/compiling235
-rw-r--r--web/contact2
-rw-r--r--web/contributing113
-rw-r--r--web/crypto335
-rw-r--r--web/delegate23
-rw-r--r--web/documentation208
-rw-r--r--web/download2339
-rw-r--r--web/drawing51
-rwxr-xr-xweb/embedded-api305
-rw-r--r--web/faq1282
-rwxr-xr-xweb/firebird140
-rw-r--r--web/forge72
-rw-r--r--web/gcc-frontend10
-rw-r--r--web/gtk-sharp157
-rw-r--r--web/hackers67
-rwxr-xr-xweb/ibmdb259
-rw-r--r--web/ideas47
-rw-r--r--web/index1503
-rw-r--r--web/issues54
-rwxr-xr-xweb/java4
-rw-r--r--web/jit-debug215
-rw-r--r--web/jit-debug-sample86
-rw-r--r--web/jit-debug-sample270
-rwxr-xr-xweb/languages112
-rw-r--r--web/mailing-lists89
-rw-r--r--web/mbas57
-rw-r--r--web/mono-1.0.html103
-rw-r--r--web/mono-beginning36
-rw-r--r--web/mono-beginning-windows.xml1065
-rw-r--r--web/mono-beginning.xml1294
-rw-r--r--web/mono-build-mac-fw-release.sh217
-rwxr-xr-xweb/mono-build-w32.sh97
-rwxr-xr-xweb/mono-build.sh95
-rw-r--r--web/mono-common-problems160
-rw-r--r--web/mono-contribution-howto538
-rw-r--r--web/mono-hacking-roadmap.html312
-rw-r--r--web/mono-roadmap.html396
-rw-r--r--web/mono-todo266
-rwxr-xr-xweb/mysql181
-rwxr-xr-xweb/odbc218
-rw-r--r--web/oldnews2917
-rwxr-xr-xweb/oledb153
-rwxr-xr-xweb/oracle168
-rw-r--r--web/other42
-rw-r--r--web/papers5
-rw-r--r--web/passport5
-rw-r--r--web/performance215
-rwxr-xr-xweb/plans2
-rw-r--r--web/postgresql365
-rw-r--r--web/ppc29
-rwxr-xr-xweb/print-stack15
-rwxr-xr-xweb/projects2
-rwxr-xr-xweb/provider-factory156
-rw-r--r--web/rationale40
-rw-r--r--web/remap36
-rw-r--r--web/resources105
-rw-r--r--web/runtime143
-rw-r--r--web/screenshots229
-rwxr-xr-xweb/sqlclient263
-rwxr-xr-xweb/sqlite143
-rwxr-xr-xweb/sybase153
-rw-r--r--web/tds-providers164
-rwxr-xr-xweb/tdsclient157
-rw-r--r--web/team2
-rw-r--r--web/testing237
-rw-r--r--web/todo54
-rw-r--r--web/tools69
-rw-r--r--web/web/.cvsignore2
-rw-r--r--web/web/commands80
-rwxr-xr-xweb/web/deploy/.cvsignore2
-rw-r--r--web/web/deploy/cm/cormissing.js5
-rw-r--r--web/web/htmlify8
-rw-r--r--web/web/images/gtk-certview.pngbin0 -> 32425 bytes
-rwxr-xr-xweb/web/images/mono-new.gifbin0 -> 6198 bytes
-rw-r--r--web/web/images/swf-certview.pngbin0 -> 14525 bytes
-rw-r--r--web/web/infos/.cvsignore1
-rw-r--r--web/web/makefile238
-rw-r--r--web/web/masterinfos/.cvsignore1
-rw-r--r--web/web/masterinfos/Makefile96
-rwxr-xr-xweb/web/mono-rss.cs42
-rwxr-xr-xweb/web/process.pl2
-rw-r--r--web/web/render-team-page.cs352
-rwxr-xr-xweb/web/rss.cs17
-rwxr-xr-xweb/web/src/.cvsignore2
-rw-r--r--web/web/team.xml1629
-rwxr-xr-xweb/web/team.xsd30
-rwxr-xr-xweb/web/team/aleksey.pngbin0 -> 6510 bytes
-rw-r--r--web/web/team/cesar.pngbin0 -> 4306 bytes
-rw-r--r--web/web/team/dietmar.pngbin0 -> 3166 bytes
-rwxr-xr-xweb/web/team/duncan.pngbin0 -> 1027 bytes
-rw-r--r--web/web/team/gonzalo.pngbin0 -> 5005 bytes
-rw-r--r--web/web/team/gvaish.pngbin0 -> 4401 bytes
-rw-r--r--web/web/team/hector.pngbin0 -> 4494 bytes
-rw-r--r--web/web/team/jackson.pngbin0 -> 4626 bytes
-rw-r--r--web/web/team/jluke.pngbin0 -> 4767 bytes
-rwxr-xr-xweb/web/team/johannes.pngbin0 -> 6527 bytes
-rw-r--r--web/web/team/jonpryor.pngbin0 -> 4538 bytes
-rw-r--r--web/web/team/jordi.pngbin0 -> 4189 bytes
-rw-r--r--web/web/team/lluis.pngbin0 -> 3425 bytes
-rw-r--r--web/web/team/martin.pngbin0 -> 5571 bytes
-rw-r--r--web/web/team/miguel.pngbin0 -> 4196 bytes
-rw-r--r--web/web/team/mwh.pngbin0 -> 5189 bytes
-rw-r--r--web/web/team/nickd.pngbin0 -> 5134 bytes
-rwxr-xr-xweb/web/team/none.pngbin0 -> 2758 bytes
-rw-r--r--web/web/team/pedro.pngbin0 -> 5722 bytes
-rw-r--r--web/web/team/pedroas.pngbin0 -> 4885 bytes
-rw-r--r--web/web/team/per.pngbin0 -> 4694 bytes
-rw-r--r--web/web/team/peterw.pngbin0 -> 3908 bytes
-rw-r--r--web/web/team/reggie.pngbin0 -> 5811 bytes
-rw-r--r--web/web/team/rpratap.pngbin0 -> 5158 bytes
-rw-r--r--web/web/team/spouliot.pngbin0 -> 5485 bytes
-rwxr-xr-xweb/web/team/tberman.pngbin0 -> 4422 bytes
-rw-r--r--web/web/team/timc.pngbin0 -> 4579 bytes
-rw-r--r--web/web/template.html.in52
-rw-r--r--web/web/transform.cs20
-rw-r--r--web/winforms129
-rwxr-xr-xweb/xml-classes464
5259 files changed, 304544 insertions, 498756 deletions
diff --git a/.cvsignore b/.cvsignore
index ccea8b4dfbe..3481c4d0bc3 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,17 +1,26 @@
+Makefile
+Makefile.in
+_tmpinst
aclocal.m4
+autom4te.cache
config.cache
config.guess
config.h
config.h.in
+config.h.in
config.log
config.status
config.sub
configure
libtool
-ltmain.sh
ltconfig
-Makefile
-Makefile.in
+ltmain.sh
+mint.pc
mono-*.tar.gz
+mono.pc
+mono.spec
+semantic.cache
stamp-h
stamp-h.in
+stamp-h1
+tmpinst-dir.stamp
diff --git a/ChangeLog b/ChangeLog
index 36cda3bdf3c..3fc9cdd00fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,1860 @@
+2004-11-08 Jonathan Pryor <jonpryor@vt.edu>
+
+ * configure.in: Add new function/header/type checks for use by
+ MonoPosixHelper (the support directory).
+ * support/Makefile.am: Add sys-sendfile.c to the build.
+ * support/dirent.c, support/fcntl.c, support/unistd.c: Remove compile-time
+ checks for -64 apis (pread64, etc.), as they're superfluous. GLibc
+ #defines the functions to the appropriate -64 counterpart when necessary,
+ and Darwin is intrinsically large-file-aware, so manual checking on my
+ part is redundant and unnecessary.
+ * support/grp.c: Add checks for non-portable functions getgrnam_r,
+ getgrgid_r.
+ * support/pwd.c: Add checks for non-portable functions getpwnam_r,
+ getpwuid_r.
+ * support/map.c: Remove <poll.h> include. Building on Tigar (Mac OS X 10.4
+ beta) breaks when both <poll.h> and <sys/poll.h> are included, so only use
+ <sys/poll.h>.
+ * support/mph.h: Clean up macro handling for type overflow checking.
+
+2004-11-08 Raja R Harinath <rharinath@novell.com>
+
+ * configure.in (mcs_topdir, mcs_topdir_from_srcdir): New 'subst'ed
+ variables. Used to support both an in-tree mcs/ and a sibling
+ mcs/ directory.
+ * Makefile.am (mcs_topdir): Remove.
+ (dist-hook): Distribute mcs/ as a subdirectory.
+ * runtime/Makefile.am ($(monoone_DATA) $(monotwo_DATA) $(monobins_DATA)):
+ Use mcs_topdir and mcs_topdir_from_srcdir.
+ * runtime/net_1_1/Makefile.am (mscorlib.dll $(gac_assemblies) $(mdb_files)):
+ Likewise.
+ (all-local): Depend on $(mdb_files) too.
+ * runtime/net_2_0/Makefile.am: Likewise.
+
+2004-11-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * runtime/net_2_0/Makefile.am (install-data-local):
+ * runtime/net_1_1/Makefile.am (install-data-local): Applied patch
+ from Götz Waschk (waschk@informatik.uni-rostock.de). Make this work
+ with DESTDIR.
+
+2004-11-05 Jonathan Pryor <jonpryor@vt.edu>
+
+ * support/.cvsignore: Ignore generated files.
+ * support/Makefile.am: Add new INCLUDE directives (for glib headers),
+ source; bump library version (so we don't clobber previous versions of
+ libMonoPosixHelper.so).
+ * support/dirent.c: New file; <dirent.h> wrapper functions;
+ BSD portability fixes.
+ * support/errno.c: New file; <errno.h> wrapper functions
+ * support/fcntl.c: New file; <fcntl.h> wrapper functions;
+ BSD portability fixes.
+ * support/grp.c: New file; <grp.h> wrapper functions;
+ BSD portability fixes.
+ * support/map.c: Updated macro mapping functions (more enums mapped, more
+ error checking, etc.).
+ * support/map.h: Updated macro mapping functions
+ * support/old-map.c: Previous map.c implementation, for backward compatibility
+ Remove spurious warning about redefining _GNU_SOURCE.
+ * support/old-map.h: Previous map.h implementation, for backward compatibility
+ * support/mph.h: New file; Utility types, macros;
+ BSD portability fixes.
+ * support/pwd.c: New file; <pwd.h> wrapper functions;
+ BSD portability fixes.
+ * support/stdio.c: New file; <stdio.h> wrapper functions
+ * support/stdlib.c: New file; <stdlib.h> wrapper functions
+ * support/sys-mman.c: New file; <sys/mman.h> wrapper functions
+ * support/sys-mount.c: New file; <sys/mount.h> wrapper functions;
+ BSD portability fixes.
+ * support/sys-sendfile.c: New file; <sys/sendfile.h> wrapper functions;
+ BSD portability fixes.
+ * support/sys-stat.c: New file; <sys/stat.h> wrapper functions
+ * support/sys-wait.c: New file; <sys/wait.h> wrapper functions
+ * support/time.c: New file; <time.h> wrapper functions;
+ BSD portability fixes.
+ * support/unistd.c: New file; <unistd.h> wrapper functions;
+ BSD portability fixes.
+
+2004-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Fix up --with-jit=no so it actually works. Fixes
+ #61320.
+
+2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * man/mono.1: documented MONO_THREADS_PER_CPU.
+
+2004-10-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add INCLUDED_LIBGC automake conditional.
+
+2004-10-24 Jonathan Pryor <jonpryor@vt.edu>
+
+ * man/mono.1: Add documentation for the MONO_TRACE environment variable.
+
+2004-10-14 Joe Shaw <joeshaw@novell.com>
+
+ * man/mono.1: Fix the syntax of the M: trace syntax
+
+2004-10-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add some checks for cygwin weirdness.
+
+2004-10-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * support/Makefile.am (libMonoPosixHelper_la_SOURCES): Do not build
+ zlib_macros if zlib.h is not found.
+
+ * configure.in: Add check for zlib.h.
+
+2004-09-28 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * mini-s390.c: Fix AND_IMM/OR_IMM/DIV_IMM/REM_IMM
+
+2004-09-28 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am ($(tmpinst)/bin/pedump): New.
+ (mcs-do-run-test-profiles): Depend on it.
+
+2004-09-27 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (mono-do-testjit): New target, unused for now. Runs
+ the mono testsuite in tests/.
+ (tmpinst-dir): Create etc/mono/2.0.
+ ($(tmpinst)/bin/ilasm, $(tmpinst)/etc/mono/2.0/machine.config): New.
+
+2004-09-21 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * configure.in: Cater for S/390 on Linux
+
+2004-09-21 <vargaz@freemail.hu>
+
+ * configure.in: Link with ole32 on windows.
+
+2004-09-20 Jackson Harper <jackson@ximian.com>
+
+ * support/map.c/h: Add poll events map functions. Use values
+ instead of names for defines.
+
+2004-09-17 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am (mcs-do-compiler-tests): Reverted Raja's latest
+ change in this target.
+
+2004-09-14 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (mcs-do-full-build): Pass NO_SIGN_ASSEMBLIES=yes to
+ reduce the number of passes. We will get the assemblies signed in
+ the 'populate-runtime-subdir' phase.
+ (mcs-do-run-test-profiles): Rename from mcs-do-run-tests. Use
+ 'test-profiles' to test all profiles.
+ (mcs-do-compiler-tests): Use 'compiler-tests' target in mcs/.
+ (bootstrap-check): Update.
+ * runtime/Makefile.am ($(monoone_DATA) $(monotwo_DATA) $(monobins_DATA)):
+ Simplify.
+
+2004-09-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (populate-runtime-subdir): Avoid -path argument to find
+ since it is not supported on solaris.
+
+2004-09-03 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am (bootstrap-world): New target.
+
+2004-09-02 Martin Baulig <martin@ximian.com>
+
+ * runtime/net_1_1/Makefile.am (install-data-local): Install
+ mscorlib.dll.mdb into $(corlibdir).
+
+ * runtime/net_2_0/Makefile.am: Likewise.
+
+2004-08-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * scripts/mcs.in: Remove obsolete comment.
+
+2004-08-27 Lluis Sanchez Gual <lluis@novell.com>
+
+ * data/net_1_1/DefaultWsdlHelpGenerator.aspx: Little fix.
+ * data/net_2_0/DefaultWsdlHelpGenerator.aspx: Added information about
+ basic profile compliance.
+ * data/net_2_0/machine.config: Use 2.0 assembly versions.
+
+2004-08-26 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (mcs-do-run-test): Depend on '$(tmpinst)/bin/mbas'.
+ ($(tmpinst)/bin/mbas): Create temporary wrapper file, so that the
+ testcases pick the built 'mbas.exe'.
+
+2004-08-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/os/gc_wrapper.h: Only use thread local alloc if using the included libgc, since the
+ stock one has broken headers.
+
+ * configure.in (PLATFORM_WIN32): Make the included libgc the default on windows.
+
+2004-08-17 Dick Porter <dick@ximian.com>
+
+ * configure.in: Correct intl library for FreeBSD and OpenBSD.
+ Fixes bug 62884, patch by Tom McLaughlin (tmclaugh@sdf.lonestar.org).
+
+2004-08-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Set new automake variable LIBGC_STATIC_LIBS.
+
+2004-08-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in (HAVE_KW_THREAD): Pass USE_COMPILER_TLS to libgc if
+ __thread works.
+
+2004-08-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Fix __thread test.
+
+2004-08-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add proper checks for the 'undefined reference to '__tls_get_addr' problem.
+
+2004-08-06 Geoff Norton <gnorton@customerdna.com>
+
+ * configure.in: Add a kqueue check
+
+2004-08-03 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * configure.in: Enable S/390 64-bit JIT.
+
+2004-07-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Enable AMD64 JIT.
+
+2004-07-30 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am: The symbol writer is now called
+ Mono.CompilerServices.SymbolWriter.dll.
+
+2004-07-30 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/Makefile.am (monoone_DATA): Add mcs.exe.config.
+ (gmcs_exe): Add gmcs.exe.config.
+ ($(monoone_DATA) $(monotwo_DATA) ...): Add location of the .config
+ files too.
+
+2004-07-29 Lluis Sanchez Gual <lluis@novell.com>
+
+ * Makefile.am: Copy machine.config in the correct _tmpinst subdirectory.
+
+2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * configure.in: Added data/net_1_1 and data/net_2_0 to the build.
+ * data/Makefile.am: Removed installation of machine.config and
+ DefaultWsdlHelpGenerator.aspx. Those now are in a version-specific
+ directory.
+ * data/net_1_1/Makefile.am, data/net_2_0/Makefile.am: new makefiles for
+ installing 1.1 and 2.0 makefiles.
+ * runtime/net_1_1/Makefile.am, runtime/net_2_0/Makefile.am: Install mscorlib
+ at the correct version specific directory.
+
+2004-07-27 John Merryweather Cooper <john_m_cooper@yahoo.com>
+ * configure.in: Disable __thread test (TLS) for FreeBSD as
+ it succeeds on FreeBSD 5.x when it should fail. Fix pthread
+ library detection for FreeBSD 4.x since pthread is embedded
+ in libc_r on this platform. Fix some typos in my host
+ regexes for freebsd.
+
+2004-07-23 Dick Porter <dick@ximian.com>
+
+ * configure.in: Changes for FreeBSD thread support by John
+ Merryweather Cooper <john_m_cooper@yahoo.com>.
+
+2004-07-15 Jackson Harper <jackson@ximian.com>
+
+ * man/gacutil.1: MONO_GAC_PREFIX not MONO_GAC_PATH
+
+2004-07-12 Massimiliano Mantione <massi@ximian.com>
+
+ * docs/abc-removal.txt: Updated documentation for ABC removal.
+
+2004-07-12 Massimiliano Mantione <massi@ximian.com>
+
+ * mono/mini/abcremoval.c: Rewritten most of ABC removal.
+ * mono/mini/abcremoval.h: Rewritten most of ABC removal.
+ * mono/mini/build_relations_propagation_table.pl: Deleted (unneeded after the rewrite).
+ * mono/mini/propagated_relations_table.def: Deleted (unneeded after the rewrite).
+
+2004-07-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add --with-tls option to replace the misnamed
+ --with-nptl option.
+
+2004-07-02 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (mcs-do-basic-build, mcs-do-short-build):
+ Pass NO_SIGN_ASSEMBLY=yes to sub-make.
+ ($(tmpinst)/bin/mono) [PLATFORM_WIN32]: Make it work.
+
+2004-07-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * man/mono.1: Added 'aot' to trace options.
+
+2004-06-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Fix trunc check + add SPARC64 defines.
+
+2004-06-29 Jackson Harper <jackson@ximian.com>
+
+ * man/gacutil.1: Update man with new command line options.
+
+2004-06-29 Raja R Harinath <rharinath@novell.com>
+ Atsushi Enomoto <atsushi@ximian.com>
+
+ * runtime/net_1_1/Makefile.am (GAC_ROOT_DIR): Renamed from GAC_DIR.
+ (GAC_DIR): New define that doesn't include $(DESTDIR).
+ (install-data-local,uninstall-local): Use them. Use in-tree mono
+ runtime, not the installed one.
+
+2004-06-29 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/Makefile.am (gmcs_exe): New. Set only if not W32.
+ (monotwo_DATA): Use it.
+ From Atsushi Enomoto.
+
+2004-06-24 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/net_2_0/Makefile.am (gac_assemblies_list): Put back
+ ICSharpCode.SharpZipLib, not that it has a different version.
+
+2004-06-24 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (MCS_DIRS, MCS_FILES): Add back Mono.CSharp.Debugger.
+ (tmpinst-dir-contents, $(tmpinst)/bin/mono.bat): Remove mono.bat
+ in W32. Use 'mono' and 'mcs' in W32 too.
+ (bootstrap) [PLATFORM_WIN32]: Back to single stage bootstrap.
+ * runtime/net_2_0/Makefile.am (gac_assemblies_list): Don't mention
+ nunit.*, IBM.Data.DB2, ICSharpCode.SharpZipLib.
+ Fix for #60443, the GAC .DLL-Hell.
+
+2004-06-22 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (bootstrap) [PLATFORM_WIN32]: Make two-stage.
+
+2004-06-18 Jackson Harper <jackson@ximian.com>
+
+ * man/mono.1: Add MONO_LOG_LEVEL and MONO_LOG_MASK. Add
+ instructions on setting multiple mask values.
+
+Fri Jun 18 19:39:09 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: process data before runtime, so the config file is
+ installed and gacutil has a chance to work (finding symlink).
+
+2004-06-18 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/Makefile.am ($(monoone_DATA) $(monotwo_DATA) $(monobins_DATA)):
+ Test if files exist in the mcs/ tree before creating symlinks.
+ Remove symlinks before creating them again.
+ * runtime/net_1_1/Makefile.am (mscorlib.dll $(gac_assemblies)): Likewise.
+ * runtime/net_2_0/Makefile.am (mscorlib.dll $(gac_assemblies)): Likewise.
+
+2004-06-18 Raja R Harinath <rharinath@novell.com>
+
+ * scripts/Makefile.am (REWRITE): New. Common rewriting 'sed' command.
+ (bin_SCRIPTS): Unify all the script generating rules into one.
+
+2004-06-16 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (bootstrap) [PLATFORM_WIN32]: Open code. Don't
+ build and populate net_2_0 profile.
+ (populate-runtime-subdir): Make into subroutine that takes list of
+ profiles to populate.
+ (faststrap): Update.
+ (MCS_DIRS, MCS_FILES, MONO_CSHARP_DEBUGGER_DIR, MONO_CSHARP_DEBUGGER_FILE):
+ Avoid automake conditional/+= problems.
+ (populate-runtime-subdir): Rewrite sanity check.
+
+2004-06-16 Raja R Harinath <rharinath@novell.com>
+
+ Include prototype completely-untested 'make bootstrap' support for W32.
+ * Makefile.am (bootstrap): Define to fasterstrap for W32.
+ (MCS_DIRS, MCS_FILES): Don't refer to Mono.CSharp.Debugger in W32.
+ (tmpinst-dir): Change sub-make invoke to ...
+ (tmpinst-dir-contents): ... this. Build 'mono.bat' in W32 instead
+ of 'mono' and 'mcs'.
+ ($(tmpinst)/bin/mono.bat): New.
+
+2004-06-15 Dick Porter <dick@ximian.com>
+
+ * configure.in: Check for struct ip_mreqn and struct ip_mreq on
+ windows too. Fixes bug 55040.
+
+Mon Jun 14 18:38:34 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in: better explain that --with-nptl is not related to
+ NPTL, but to __thread support. Set sigaltstack support to off by
+ default.
+
+2004-06-12 Raja R Harinath <harinath@acm.org>
+
+ * Makefile.am (populate-runtime-subdir): Add _tmpinst directory
+ to the PATH.
+
+2004-06-11 Jackson Harper <jackson@ximian.com>
+
+ * runtime/net_2_0/Makefile.am:
+ * runtime/net_1_1/Makefile.am: Remove signing patches
+
+2004-06-11 Jackson Harper <jackson@ximian.com>
+
+ * man/mono.1: Add documentation for MONO_GAC_PREFIX.
+ * runtime/net_2_0/Makefile.am:
+ * runtime/net_1_1/Makefile.am: Sign assemblies before
+ installing. Do not sign ziplib, npgsql, or nunit assemblies. Sign mscorlib.
+
+2004-06-11 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (populate-runtime-subdir): New target. Does a
+ controlled "make install" in the 'mcs/' directory to populate the
+ 'runtime' directory.
+ (fasterstrap): Use it.
+
+2004-06-10 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/Makefile.am ($(monoone_DATA),$(monotwo_DATA),$(monobins_DATA)):
+ Don't copy from prefix. Use $(LN_S) to point to the mcs/ tree.
+ * runtime/net_1_1/Makefile.am (mscorlib.dll,$(gac_assemblies)):
+ Use $(LN_S) to point to the mcs/ tree, rather than copying.
+ * runtime/net_2_0/Makefile.am (mscorlib.dll,$(gac_assemblies)): Likewise.
+
+2004-06-10 Raja R Harinath <rharinath@novell.com>
+
+ Support the new assembly signing setup in mcs/.
+ * Makefile.am (mcs-do-basic-build): Pass 'USE_BOOT_COMPILE' to sub-makes.
+ ($(tmpinst)/etc/mono/machine.config): New target.
+ (tmpinst-dir.stamp): Remove and rewrite into ...
+ ($(tmpinst)/bin/mcs): ... this and ...
+ ($(tmpinst)/bin/mono): ... this. Update to use the in-tree machine.config.
+ (tmpinst-dir): Rewrite to invoke above $(tmpinst)/... targets directly.
+ * configure.in (AC_PROG_LN_S): New check to define $(LN_S).
+
+Thu Jun 3 14:39:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in: libc setting for NetBSD (patch from recht@netbsd.org).
+
+2004-06-01 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (bootstrap,faststrap,fasterstrap): Refactor.
+ Fix 'faststrap' to be corlib-version-change-safe.
+ (one-stage-strap,two-stage-strap,three-stage-strap): Remove.
+ (monolite-bootstrap): Update.
+
+2004-05-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: fixlets for windows.
+
+2004-05-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: export CC instead of passing it to libgc/configure.
+
+2004-05-28 Duncan Mak <duncan@ximian.com>
+
+ * runtime/Makefile.am:
+ * scripts/Makefile.am: Include mono-find-provides and
+ mono-find-requires.
+
+ * scripts/mono-find-provides.in:
+ * scripts/mono-find-requires.in: New wrapper scripts.
+
+2004-05-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Pass CC to libgc configure.
+
+2004-05-27 Gert Driesen (drieseng@users.sourceforge.net)
+
+ * monowiz.win32.nsi: normalized line-endings to unix (LF)
+
+2004-05-27 Gert Driesen (drieseng@users.sourceforge.net)
+
+ * monowiz.win32.nsi: do not include mono subdirectory in
+ MonoConfigDir registry key, to match batch files
+
+2004-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * data/DefaultWsdlHelpGenerator.aspx: fixed querystring attribute
+ values. Now they are URlEncoded.
+
+ * data/browscap.ini.gz: updated.
+
+2004-05-26 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (mcs-do-basic-build): No need to set MCS here.
+ * runtime/net_1_1/Makefile.am (gac_assemblies_list): Update to
+ reflect new names for nunit.util and nunit.framework. Add
+ nunit.core.
+ * runtime/net_2_0/Makefile.am (gac_assemblies_list): Likewise.
+
+2004-05-25 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * config.h.in: remove
+
+2004-05-25 18:30 CET Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * configure.in: Check for trunc instead of truncl (HAVE_TRUNC)
+
+2004-05-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am:
+ * monowiz.win32.nsi: improved windows installer script.
+
+2004-05-21 Raja R Harinath <rharinath@novell.com>
+
+ * README: Update to include instructions for the various new
+ bootstrap-like targets.
+
+2004-05-20 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (get-monolite-latest, monolite-bootstrap):
+ New bootstrap targets to build from monolite.
+ Based on idea from Jaroslaw Kowalski <jaak@zd.com.pl>.
+
+2004-05-20 Raja R Harinath <rharinath@novell.com>
+
+ * configure.in (AC_OUTPUT): Add tools/Makefile and
+ tools/locale-builder/Makefile.
+ * Makefile.am (SUBDIRS): Remove tools.
+ (DIST_SUBDIRS): Add 'tools'.
+ (bootstrap): Rewrite so that we get two new targets.
+ (faststrap): New two-stage build.
+ (fasterstrap): New one-stage build.
+
+2004-05-19 Jackson Harper <jackson@ximain.com>
+
+ * tools/
+ * tools/Makefile.am: Add tools directory
+ * tools/locale-builder: Add the locale-builder tool, this tool is
+ not built by default as it is only needed by people that wish to
+ moidify culture data.
+ * Makefile.am: Add tools to build
+
+Wed May 19 13:22:19 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in: make MacOSX default to use the included libgc.
+
+2004-05-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Get rid of -DMONO_USE_EXC_TABLES.
+
+2004-05-19 Raja R Harinath <rharinath@novell.com>
+
+ * configure.in: Use proper autoconf idiom to pass additional
+ arguments to libgc/configure.
+ (PLATFORM_WIN32, NEED_LINK_UNLINK): Use three-argument AC_DEFINE.
+ * acconfig.h: Update to reflect changes.
+
+2004-05-17 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (tmpinst-dir): Creates _tmpinst tree if
+ necessary. Move body ...
+ (tmpinst-dir.stamp): ... here.
+ (stage3): Don't remove _tmpinst tree.
+ (bootstrap-clean, bootstrap-check): New rules. They run the
+ corresponding rules in the mcs/ tree.
+
+2004-05-14 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am: Revert unlogged unexplained changes.
+ (stage3): Make 'all-profiles' since the mono source tarball
+ carries all the net_2_0 preview dlls.
+
+2004-05-11 Jackson Harper <jackson@ximian.com>
+
+ * runtime/net_1_1/Makefile.am:
+ * runtime/net_2_0/Makefile.am: cscompmgd.dll is lowercase now.
+
+2004-05-10 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (tmpinst-dir): Always add $tmpinst/lib to MONO_PATH.
+ Fix quoting of commands.
+
+2004-05-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * monowiz.win32.nsi: some changes i made to build the 0.91 win32 setup
+ file.
+
+2004-05-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * man/mono.1: mention MONO_EGD_SOCKET
+
+2004-05-07 Raja R Harinath <rharinath@novell.com>
+
+ Goodbye 'fullbuild', hello 'bootstrap'.
+ * Makefile.am (bootstrap): New target for building from CVS. New
+ improved version of 'fullbuild' -- does not install any files.
+ (fullbuild): Obsolete target. Bootstraps and installs tree.
+ (mcs-tree-safe-build,xinstall-runtime,mcs-rest,remove-binaries):
+ Removed.
+ (stage1,stage1-mcs,stage1-mono,stage2,stage3)
+ (tmpinst-dir,tmpinst-runtime): New targets used to implement a
+ two-stage bootstrap.
+
+2004-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: scandir check is no longer needed.
+
+2004-05-05 Bernie Solomon <bernard@ugsolutions.com>
+
+ * configure.in: set LIBC on HPUX
+
+2004-05-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Detect JNI headers in GNU classpath sources as well.
+
+2004-05-05 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/net_2_0/Makefile.am (install-data-local, uninstall-local):
+ Only disable this if INSTALL_2_0 is disabled.
+
+2004-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * data/DefaultWsdlHelpGenerator.aspx: add any cookie in the request to
+ the request we do for the actual web service.
+
+2004-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: check for SIGEV_THREAD being defined before checking
+ for AIO support. Fixes compilation under FreeBSD.
+
+2004-05-04 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/net_1_1/Makefile.am (mono_runtime): Use USE_JIT, not
+ JIT_SUPPORTED.
+ (install-data-local, uninstall-data-local): Run runtime with
+ libtool.
+ * runtime/net_2_0/Makefile.am: Likewise.
+ Report from Urs C Muff <umuff@quark.com>.
+
+2004-05-03 Jackson Harper <jackson@ximian.com>
+
+ * man/gacutil.1: Basic man page for gacutil. This doesn't include
+ the new non-standard options yet.
+
+2004-05-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * data/machine.config: added version and publickeytoken.
+
+2004-05-01 Duncan Mak <duncan@ximian.com>
+
+ * runtime/net_1_1/Makefile.am:
+ * runtime/net_2_0/Makefile.am (gac_assemblies_list): Add NUnit
+ dlls here.
+ (non_gac_assemblies): Removed, every thing is migrated over to gac_assemblies.
+ (EXTRA_DIST): Include only gac_assemblies.
+ (dist_assemblies_DATA): It's referring to $(non_gac_assemblies)
+ and that is no gone now. So remove as well.
+ ($(non_gac_assemblies)): Bye bye.
+
+2004-05-01 Duncan Mak <duncan@ximian.com>
+
+ * runtime/net_1_1/Makefile.am (gac_assemblies_list): Add
+ System.Web.Services. Someone accidentally took the line out.
+
+2004-04-30 Jackson Harper <jackson@ximian.com>
+
+ * runtime/net_1_1/Makefile.am:
+ * runtime/net_2_0/Makefile.am: These assemblies are signed now.
+
+2004-04-30 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/net_1_1/Makefile.am (gac_assemblies_list): Remove .dll
+ suffix.
+ (gac_assemblies, non_gac_assemblies, corlibdir, dist_corlib_DATA):
+ New variables. Use Automake idioms.
+ (dist-hook): Remove.
+ (install-local, uninstall-local): Use mscorlib.dll from current
+ tree when running gacutil.
+ (mono_runtime): New variable. Points to either JIT compiler or
+ interpreter.
+ Report from Bernie Solomon <bernard@ugsolutions.com>
+ * runtime/net_2_0/Makefile.am: Likewise.
+ * runtime/Makefile.am (dist_monobins_DATA): Rename from
+ monobins_DATA.
+ (EXTRA_DIST): Remove.
+ * Makefile.am (fullbuild): Update to changes.
+
+2004-04-30 Jackson Harper <jackson@ximian.com>
+
+ * runtime/net_2_0/Makefile.am:
+ * runtime/net_1_1/Makefile.am: /lib/mono/gac. Dont forget the mono.
+
+2004-04-30 Duncan Mak <duncan@ximian.com>
+
+ * runtime/Makefile.am ($(monobins_DATA)): Add sn.exe and sn.
+
+2004-04-29 Duncan Mak <duncan@ximian.com>
+
+ * scripts/gmcs.in: New file.
+
+ * scripts/Makefile.am (EXTRA_DIST, bin_SCRIPTS, CLEANFILES): Add
+ gmcs script.
+
+2004-04-29 Jackson Harper <jackson@ximian.com>
+
+ * runtime/net_2_0/Makefile.am: install 2.0 corlib to its own
+ special little place.
+
+2004-04-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * acconfig.h configure.in: Add check for scandir.
+
+2004-04-29 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/Makefile.am (monobins_DATA): Add gacutil.exe.
+ (SUBDIRS): Build here before building subdirs.
+ * runtime/net_1_1/Makefile.am (all-local): Copy
+ $(gac_assemblies_list) here.
+ (install-data-local): Install dll from $(srcdir).
+ (gacutil): Pick from current tree.
+ * runtime/net_2_0/Makefile.am: Likewise.
+
+ * Makefile.am (fullbuild): Update to changes in tree layout.
+ * runtime/net_1_1/Makefile.am (install-data-local): Allow empty
+ $(gac_assemblies_list).
+ ($(gac_assemblies_list)): Pick libraries from 'class/lib/default',
+ not 'class/lib/net_1_1'.
+
+2004-04-28 Jackson Harper <jackson@ximian.com>
+
+ * runtime/net_1_1/Makefile.am: Grab libs from proper directory, do
+ not assume gacutil is installed.
+ * runtime/net_2_0/Makefile.am: Do not assume gacutil is installed.
+
+2004-04-28 Jackson Harper <jackson@ximian.com>
+
+ * configure.in: Add new Makefile.amS
+ * runtime/Makefile.am: libs are now in profile dependant
+ directories.
+ * runtime/net_1_1/Makefile.am: Install and Uninstall the .net 1.1
+ libs to the GAC.
+ * runtime/net_2_0/Makefile.am: Install and Uninstall the .net 2.0
+ libs to the GAC.
+ * data/Makefile.am: cleanup browscap.ini
+
+2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
+
+ * configure.in: reword message re EGD support
+ now it is there
+
+2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * config.h.in:
+ * configure.in: added check for sys/aio.h. Also check the field name
+ in 'union sigval'.
+
+2004-04-28 Jackson Harper <jackson@ximian.com>
+
+ * scripts/Makefile.am:
+ * scripts/gacutil.in: Add a gacutil script
+
+2004-04-26 Jackson Harper <jackson@ximian.com>
+
+ * Makefile.am: Grab libraries from lib/default now.
+ * runtime/Makefile.am: Grab libraries from lib/default now.
+
+2004-04-26 Bernie Solomon <bernard@ugsolutions.com>
+
+ * configure.in: move setting of NO_VERSION_SCRIPT
+ until after checking for GNU ld
+
+2004-04-22 Urs C Muff <umuff@quark.com>
+
+ move .net assemblies from $prefix/bin/*.exe to $prefix/lib/*.exe on
+ windows/cygwin refactor .nsi to simply maintenance on script/batch
+ generation
+ * runtime/Makefile.am
+ * script/Makefile.am
+ * monowiz.win32.nsi
+
+2004-04-14 Raja R Harinath <rharinath@novell.com>
+
+ * runtime/Makefile.am ($(assemblies_DATA)): Copy file into
+ $(srcdir). Clean up output.
+ ($(monobins_DATA)): Likewise.
+
+ * Makefile.am (mcs-tree-safe-build): Fix typo.
+
+2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
+
+ * configure.in: Added rules to check for getgrgid_r, getgrnam_r,
+ getpwnam_r, getpwuid_r, getresuid and setresuid.
+
+2004-04-13 Raja R Harinath <rharinath@novell.com>
+
+ Allow 'make fullbuild' to work on non-srcdir build.
+ * Makefile.am (mcs_topdir): New variable.
+ (mcs-tree-safe-build,mcs-rest,remove-binaries): Work in non-srcdir
+ build.
+ (xinstall-runtime): Likewise. Use $(libgc_dir) directly, don't
+ grep for 'libgc'.
+ (fullbuild): Make ordering dependencies explicit.
+
+2004-04-12 Sachin Kumar <skumar1@novell.com>
+
+ * Makefile.am: Added 'web' in SUBDIRS
+
+2004-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: don't try-run the tests for nptl and/or sigaltstack
+ if they are disabled in the command line.
+
+2004-04-05 Jackson Harper <jackson@ximian.com>
+
+ * man/ilasm.1: Show /output instead of /out as the switch for
+ specifying output file names.
+
+2004-04-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Check for pthread_getattr_np and pthread_attr_get_np.
+
+2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * config.h.in: added HAVE_GETPWUID_R
+ * configure.in: check for getpwuid_r.
+
+2004-03-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Fix GNU ld check.
+
+2004-03-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Use amd64 instead of x86-64 as directory name. Fixes
+ #55840.
+
+ * configure.in: Disable -version-script if not using GNU ld. Fixes
+ #55910.
+
+ * configure.in: Speedup successful sigaltstack test.
+
+
+ * configure.in: don't try-run the tests for nptl and/or sigaltstack
+ if they are disabled in the command line.
+
+2004-04-05 Jackson Harper <jackson@ximian.com>
+
+ * man/ilasm.1: Show /output instead of /out as the switch for
+ specifying output file names.
+
+2004-04-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Check for pthread_getattr_np and pthread_attr_get_np.
+
+2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * config.h.in: added HAVE_GETPWUID_R
+ * configure.in: check for getpwuid_r.
+
+2004-03-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Fix GNU ld check.
+
+2004-03-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Use amd64 instead of x86-64 as directory name. Fixes
+ #55840.
+
+ * configure.in: Disable -version-script if not using GNU ld. Fixes
+ #55910.
+
+ * configure.in: Speedup successful sigaltstack test.
+
+2004-03-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: this test for sigaltstack works.
+
+2004-03-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Disable sigaltstack test for now since it can hang.
+
+ * configure.in: Add test for working sigaltstack.
+2004-03-16 Duncan Mak <duncan@ximian.com>
+
+ * runtime/Makefile.am
+ (MakeCert.exe, cert2spc.exe, certmgr.exe, setreg.exe):
+ Remember to install them to mono/runtime.
+
+2004-03-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Enable JIT on sparc.
+
+2004-03-13 Martin Willemoes Hansen <mwh@sysrq.dk>
+
+ * data/config.in: Changed libgtkhtml-3.0.so.2 to libgtkhtml-3.0.so to fix
+ breakage with gtkhtml-3.0.10
+
+2004-03-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in acconfig.h: Add a --with-sigaltstack option for platforms
+ where the sigaltstack based exception handling does not work.
+
+2004-03-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in acconfig.h: Add check for aintl function, which is the
+ solaris equivalent of truncl.
+
+2004-02-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add check for GC_enable.
+
+ * configure.in: Remove amd64/Makefile from AC_OUTPUT to fix build.
+
+2004-02-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add proper support for --with-nptl for people who
+ have linking problems when it is enabled.
+
+2004-02-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add test for __thread keyword and shared libs.
+
+2004-02-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Enable --with-nptl by default.
+
+2004-02-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Applied patch from Adrian Bunk (bunk@fs.tum.de). Fix
+ message for failed gethostbyname2_r check.
+
+Fri Jan 23 16:07:05 EST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in, acconfig.h: check for truncl. Disable
+ version script on MacOSX (see bug #51590 if a check becomes
+ necessary).
+
+Fri Jan 23 21:26:01 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in, acconfig.h: added check for socklen_t.
+
+2004-01-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Do not install mono.pc on platforms without a JIT.
+
+2004-01-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (remove-binaries): Get rid of non-portable >& construct.
+
+2003-12-29 Miguel de Icaza <miguel@ximian.com>
+
+ * scripts/sn.in: Add sn script.
+
+2004-01-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * scripts/Makefile.am: Add al.exe.
+
+ * scripts/al.in: New file.
+
+ * runtime/Makefile.am: Add al.exe.
+
+2004-01-10 Jackson Harper <jackson@ximian.com>
+
+ * data/machine.config: Add trace handler (Trace.axd) add trace
+ configuration handlers.
+
+2004-01-06 Martin Willemoes Hansen <mwh@sysrq.dk>
+
+ * doc/books: Added books on Web Services and ASP.NET
+
+2004-01-04 Daniel Morgan <danielmorgan@verizon.net>
+
+ * monowiz.win32.nsi: update the NSIS installer script for windows
+ to support NSIS 2.0 rc1 and Mono 0.29
+
+2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
+
+ * configure.in: missed in my last change
+
+ * samples/embed/testi.c: interpreter embedding example
+
+ * docs/embedded-api: add info on interpreter embedding
+
+Mon Dec 22 18:27:14 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in, acconfig.h: use mach semaphores on darwin.
+
+2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
+
+ * Makefile.am: Create mint.pc
+ mint.pc.in: Added for embedding the interpreter
+
+2003-12-16 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am: In a Makefile.am, comments are started with `#' and
+ not with `dnl' - I must have been an idiot ...
+
+2003-12-10 Todd Berman <tberman@gentoo.org>
+
+ * configure.in: adding libicu url to the ICU: no message.
+
+2003-12-05 John Luke <jluke@cfl.rr.com>
+
+ * data/config.in: new dll mapping entry for libgstreamer
+
+2003-12-02 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
+
+ * README: tiny fix ;-)
+
+2003-11-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Add -fno-strict-aliasing to CFLAGS.
+
+ * configure.in: Applied patch from recht@netbsd.org. Avoid linking in
+ librt if not neccesary.
+
+2003-11-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Fix signbit check. Fixes #51315.
+
+2003-11-20 Jackson Harper <jackson@ximian.com>
+
+ * data/machine.config: Add OutputCacheModule
+
+2003-11-19 Jackson Harper <jackson@ximian.com>
+
+ * doc/web/team.xml: New email address and job description
+ * doc/web/team/jackson.png: Picture of me debugging...seems appropriate
+
+2003-11-14 Jackson Harper <jackson@ximian.com>
+
+ * Makefile.am: delete mscorlib.dll
+
+2003-11-12 Jackson Harper <jackson@ximian.com>
+
+ * Makefile.am: corlib is now named mscorlib.dll
+
+2003-11-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in acconfig.h: Add check for signbit, which is missing in
+ FreeBSD 4.x.
+
+2003-11-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Remove debugging junk accidently checked in.
+
+ * configure.in: Add new --with-nptl option to enable NPTL only
+ features since auto-detection is not reliable.
+
+ * autogen.sh: Fix previous patch and silence noisy GNU which.
+
+2003-11-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * autogen.sh: tweak glibtool check so it works
+ if which doesn't set return code properly
+
+2003-11-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * autogen.sh: Silence noisy GNU which.
+
+ * autogen.sh: Applied patch from Peter Teichman (peter@ximian.com).
+ Use 'glibtool' instead of 'libtool' on OSX.
+
+2003-11-06 Zoltan Varga <zovarga@ws-zovarga2>
+
+ * mono/benchmark/pinvoke.cs: New benchmark for testing the performance
+ of the managed/unmanaged boundary.
+
+2003-11-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in acconfig.h: Add check for __thread keyword in gcc.
+
+2003-10-29 Dick Porter <dick@ximian.com>
+
+ * man/mono.1: Document MONO_EXTERNAL_ENCODINGS variable
+
+2003-10-16 Miguel de Icaza <miguel@ximian.com>
+
+ * man/mono.1: Document new --trace options
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * configure.in: add hppa support (64bit only)
+ make solaris build work with Forte compiler
+
+2003-10-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Added check for pthread_attr_setstacksize.
+
+ * mono/tests/ChangeLog: New file.
+
+2003-10-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/Makefile.am: Link the tests with the test driver program
+ used for the mini tests.
+
+2003-10-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/libtest.c (mono_test_marshal_delegate): Added test for
+ stdcall calling convention.
+
+2003-10-09 Dick Porter <dick@ximian.com>
+
+ * acconfig.h:
+ * configure.in: Check for ICU availability
+
+2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono/tests/libtest.c: fix after merge of pinvoke2.cs
+
+2003-10-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono/tests/Makefile.am mono/tests/libtest.c
+ mono/tests/pinvoke18.cs: new test for bool marshalling.
+
+2003-10-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono/scripts/Makefile.am mono/scripts/*.in: fix
+ managed .exe paths so they are found under cygwin.
+
+2003-10-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/pinvoke2.cs mono/tests/libtest.c: Fix array of structs
+ test.
+
+2003-10-06 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono/tests/pinvoke2.cs mono/tests/pinvoke11.cs
+ mono/tests/libtest.c: Add more pass by value struct
+ tests for platforms with more complex calling conventions
+ (Sparc V9, HPPA 64 bit).
+
+2003-10-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/pinvoke2.cs mono/tests/libtest.c: Add array of structs
+ marshalling test.
+
+2003-10-04 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono/tests/libtest.c: remove warnings except
+ "no previous prototype"
+
+2003-10-03 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono/tests/libtest.c: (test_lpwstr_marshal) remove undefined
+ behaviour of increment, (mono_test_marshal_char) = should be ==
+
+2003-09-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/remoting1.cs: Added test for interface casts on
+ TransparentProxies.
+
+2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono/tests/pinvoke*.cs, delegate4.cs, marshal10.cs, marshal4.cs
+ marshal5.cs: remove .so from DllImport of libtest to aid portability.
+
+2003-09-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Added check for valgrind headers.
+
+2003-09-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Use $(MAKE) in even more places. Patch by Bernie Solomon
+ (bernard@ugsolutions.com).
+
+2003-08-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Use $(MAKE) instead of make. Patch by Bernie Solomon
+ (bernard@ugsolutions.com).
+
+2003-08-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono.pc.in: Added gthread-2.0.
+
+2003-08-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Added gthread-2.0 to GLIB_CFLAGS and GLIB_LIBS, so we
+ can call g_thread_init ().
+
+2003-08-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/threadpool.cs mono/tests/threadpool1.cs: Make increments
+ of static variables atomic. Fixes bug #47683.
+
+2003-08-21 Johannes Roith <johannes@jroith.de>
+
+ * mono/Makefile.am: small update. make sure, glib makes it in the build, add optional target for dependencies
+
+2003-08-18 Johannes Roith <johannes@jroith.de>
+
+ * mono/Makefile.am: add windows build option
+ * mono/monowiz.win32.nsi: add windows build script
+ * mono/mono-win32-light.bmp: add bitmap
+
+2003-08-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/checked.cs: Added mul.ovf tests.
+
+2003-08-15 Duncan Mak <duncan@ximian.com>
+
+ * doc/mysql: Change references to ByteFX.Data.MySQLClient to the
+ correct ByteFX.Data.MySqlClient (note the change in
+ capitalization). Thanks to Tom Wagner <Tom.Wagner@wacker.com> for
+ spotting the error.
+
+2003-08-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/bug-47295.cs: Regression test for bug #47295.
+
+2003-08-11 Duncan Mak <duncan@ximian.com>
+
+ * runtime/Makefile.am (assemblies_DATA): Add Mono.Cairo.dll.
+
+Sun Aug 3 21:12:13 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
+
+ * configure.in: added FPU test for ARM.
+
+Thu Jul 31 16:19:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in, etc.: portability fixes and support for
+ buidling outside the srcdir from Laurent Morichetti <l_m@pacbell.net>.
+
+2003-07-22 Duncan Mak <duncan@ximian.com>
+
+ * runtime/Makefile.am: Remove sqlsharp as we no longer distribute it.
+
+2003-07-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/Makefile.am: Add missing test. Make tests interruptable
+ by Ctrl-C. Add testinterp target to run the tests with the interpreter.
+ Do not try to build vararg.cs under mcs.
+
+ * configure.in: Fix detection of GC_gcj_malloc.
+
+2003-07-14 Jerome Laban <jlaban@wanadoo.fr>
+
+ * acconfig.h:
+ * configure.in: Check for gethostbyname2_r availability.
+ * data/machine.config: Added section system.net/settings. Added
+ option for IPv6 availability.
+
+2003-07-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/cattr-object.cs: Make it run under both mono and MS.NET.
+
+ * mono/tests/struct.cs: Add test for unboxing trampolines.
+
+ * mono/tests/bug-27420.cs: new regression test.
+
+ * mono/tests/Makefile.am: skip vararg test since it does not compile
+ under mono. Add testinterp target. Add new tests.
+
+2003-07-10 Martin Willemoes Hansen
+
+ * doc/web/team.xml : Modified my tasks a bit.
+
+2003-07-01 Paolo Molaro <lupus@ximian.com>
+
+ * acconfig.h, configure.in: added bundle support.
+
+2003-06-10 Dick Porter <dick@ximian.com>
+
+ * acconfig.h:
+ * configure.in: Check for struct ip_mreq if struct ip_mreqn isn't
+ available.
+
+2003-06-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Define HAVE_GC_GCJ_MALLOC for included libgc.
+
+2003-06-10 Martin Baulig <martin@ximian.com>
+
+ * configure.in: Fall back to boehm if we don't have a libgc
+ subdirectory.
+
+2003-06-10 Martin Baulig <martin@ximian.com>
+
+ * configure.in: Make the libgc stuff actually work; we now create
+ a shared libmonogc.so when using the included libgc.
+
+2003-06-09 Martin Baulig <martin@ximian.com>
+
+ * configure.in: Only check for gc if --with-gc=boehm.
+
+2003-06-08 Martin Baulig <martin@ximian.com>
+
+ * configure.in: Tell libgc's configure about our threads library.
+
+2003-06-08 Martin Baulig <martin@ximian.com>
+
+ * libgc/: Integrate the libgc module here.
+
+ [Note: A simple `cvs update' won't work this time; you either need
+ to re-checkout the `mono' module or manually move the `libgc'
+ module here.]
+
+ * configure.in (--with-gc): Added `included' option to use the
+ included libgc. This is now also the default.
+ (LIBGC_CFLAGS, LIBGC_LIBS): Put the libgc stuff here and AC_SUBST it.
+ (INCLUDED_LIBGC): New automake conditional.
+ (USE_INCLUDED_LIBGC): #define this if appropriate.
+
+ * autogen.sh: Run libgc/autogen.sh.
+
+ * Makefile.am (SUBDIRS): Added libgc.
+
+2003-06-05 Duncan Mak <duncan@ximian.com>
+
+ * mono.spec.in (Requires): Add libxml2 and libxslt dependency on
+ the package.
+
+2003-05-19 Dick Porter <dick@ximian.com>
+
+ * configure.in: Netbsd build fix by marc@informatik.uni-bremen.de.
+
+2003-05-10 Martin Willemoes Hansen <mwh@sysrq.dk>
+
+ * scripts/Makefile.am: Added monoresgen secutil sqlsharp
+ shell wrapper scripts.
+
+2003-05-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono/tests/Makefile.am:
+ - Compile with mcs.
+ - Disable some warnings.
+ - Added executables to clean target.
+ - Make testjit the default target.
+ - Print list of failed tests at the end of a test run.
+ - Abort tests when Ctrl-C is pressed.
+
+ * mono/tests/test-driver: Return with a special exit code when
+ SIGINT is detected.
+
+ * mono/tests/checked.cs: Make it compile.
+
+2003-05-02 Miguel de Icaza <miguel@ximian.com>
+
+ * runtime/Makefile.am ($(monobins_DATA)): Use explicit file names
+ for the target exe binaries.
+
+ Copy cilc.exe and secutil.exe from the right paths to the right
+ location.
+
+ Add missing assemblies.
+
+2003-05-02 Alp Toker <alp@atoker.com>
+
+ * data/config.in: new dll mapping entry for libglade
+
+2003-05-01 Duncan Mak <duncan@ximian.com>
+
+ * scripts/Makefile.am:
+ * runtime/Makefile.am: Install cilc and ilasm.
+
+2003-04-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * mono/tests/Makefile.am (JITTEST_PROG): use mini/mono
+
+2003-04-16 Charles Iliya Krempeaux <charles@reptile.ca>
+
+ * doc/web/team.xml : Added myself to it.
+
+2003-04-10 Duncan Mak <duncan@ximian.com>
+
+ * doc/web/render-team-page.cs: Make the names of the element be
+ lowercase instead. BenM says this makes it XHTML compliant; heck,
+ I'm generating this from an XmlDocument already, why not make it
+ XHTML compliant?
+
+2003-04-10 Duncan Mak <duncan@ximian.com>
+
+ * doc/web/render-team-page.cs (Compare): Correctly fix
+ ContributorComparer.
+ (RenderHtml): Add some SetAttribute loving to make it render prettier.
+
+ * doc/web/team.xml: Revert excessive indenting.
+
+2003-04-07 Martin Baulig <martin@ximian.com>
+
+ * mono/mini/: Added this directory to the build; install `mini'
+ and `libmini.la'.
+
+2003-04-07 Duncan Mak <duncan@ximian.com>
+
+ * doc/web/render-team-page.cs: Fix ContributorComparer.
+
+2003-04-04 Duncan Mak <duncan@ximian.com>
+
+ * doc/web/render-team-page.cs: Make it use 'none.png' if no image
+ are specified in the XML.
+
+ * doc/web/team.xml: Remove the comment.
+
+ * doc/web/render-team-page.cs: Make it not output a full HTML file.
+
+2003-04-04 Duncan Mak <duncan@ximian.com>
+
+ * doc/web/commands:
+ * doc/web/makefile: Add team page information.
+
+ * doc/web/team.xml:
+ * doc/web/render-team-page.cs: Code for rendering a team page.
+
+2003-04-02 Duncan Mak <duncan@ximian.com>
+
+ * doc/web/makefile: Add a new make target for generating a team
+ page on go-mono.com.
+
+2003-04-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * configure.in: Added check for GC_gcj_malloc.
+
+2003-04-04 Martin Willemoes Hansen <mwh@sysrq.dk>
+
+ * man/sqlsharp.1: changed pass= to password= for the
+ PostgreSql provider.
+
+2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * data/machine.config: added SessionStateModule to httpModules section.
+
+2003-02-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * data/machine.config: added default sessionState section and handler.
+
+2003-02-17 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/provider-factory: add new web page
+ about Mono.Data's ProviderFactory
+
+ * doc/web/commands
+ * doc/web/makefile: add provider-factory web page to build
+
+ * doc/ado-net
+ * doc/ibmdb2
+ * doc/postgresql
+ * doc/sqlclient
+ * doc/tdsclient
+ * doc/sybase
+ * doc/mysql
+ * doc/firebird
+ * doc/oracle
+ * doc/oledb
+ * doc/odbc
+ * doc/sqlite: updated web pages
+
+2003-02-16 Martin Baulig <martin@ximian.com>
+
+ * doc/jit-debug-sample
+ * doc/jit-debug-sample2: Removed.
+
+ * doc/jit-debug: Updated.
+
+2003-02-13 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/screenshots
+ * doc/ado-net
+ * doc/oracle
+ * doc/gtk-sharp: update web pages
+
+2003-02-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * data/machine.config: added sample globalization section.
+
+2003-02-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * data/machine.config: added UrlAuthorizationModule and
+ AuthenticationConfigHandler.
+
+2003-02-11 Tim Coleman <tim@timcoleman.com>
+ * data/config.in: Add mapping for Oracle call interface
+ (OCI) native libraries.
+
+2003-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: added check for sys/un.h.
+
+2003-01-29 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/postgresql
+ * doc/mysql
+ * doc/ado-net: updates to web pages
+
+ * man/sqlsharp.1: update to man page
+
+2003-01-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: added WIN32_THREADS flag when building under windows.
+ It seems that the header files of the gc do not always define it when
+ GC_WIN32_THREADS is defined.
+
+2003-01-26 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/index
+ * doc/ado-net
+ * doc/firebird
+ * doc/ibmdb2
+ * doc/mysql
+ * doc/odbc
+ * doc/oledb
+ * doc/oracle
+ * doc/postgresql
+ * doc/sqlclient
+ * doc/sqlite
+ * doc/sybase
+ * doc/tdsclient: corrections
+
+2003-01-26 Duncan Mak <duncan@ximian.com>
+
+ * doc/jit-debug: Update the links. Thanks for Andy Oliver for the report.
+
+2003-01-22 Martin Baulig <martin@ximian.com>
+
+ * configure.in: Set version number to 0.19.1.
+
+ Heads up: I'm going to commit some changes to the debugger
+ which'll require you to use this new runtime, so if you update the
+ debugger from CVS, you also need this new runtime.
+
+2003-01-20 Duncan Mak <duncan@ximian.com>
+
+ * configure.in: Bump the release number to 0.19.
+
+2003-01-19 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/ibmdb2: added file which is new web page
+ about IBM DB2 data provider at Mono.Data.DB2Client
+
+ * makefile
+ * commands: added ibmdb2 web page to go-mono web site
+
+ * doc/ado-net: added a couple more developers email, plus made the
+ email spam resistant, added Mono's DB2 data provider to list,
+ added more info about the ProviderFactory and retrieving data using
+ ADO.NET from ASP.NET, add notes about testing, misc cleanup
+
+ * doc/mysql
+ * doc/postgresql
+ * doc/sqlclient
+ * doc/oracle
+ * doc/tdsclient
+ * doc/firebird
+ * doc/oledb
+ * doc/odbc
+ * doc/sybase
+ * doc/sqlite: added testing notes and C# examples
+
+ * doc/gtk-sharp: added links for GTK# for Windows
+
+ * man/sqlsharp.1: added providers Npgsql and MySQLNet
+
+2003-01-17 Duncan Mak <duncan@ximian.com>
+
+ * runtime/Makefile.am: Add the new Mono.Data.DB2Client.dll.
+
+2003-01-16 Martin Baulig <martin@ximian.com>
+
+ * configure.in (GTHREAD_LIBS, GTHREAD_CFLAGS): Removed the gthread
+ check again, we're now using the mono/io-layer for this.
+
+Wed Jan 15 16:20:54 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in: allow MacOSX (from various people).
+
+2003-01-14 Martin Baulig <martin@ximian.com>
+
+ * configure.in (GTHREAD_LIBS, GTHREAD_CFLAGS): Added check for gthread.
+
+2002-12-27 Jeroen Janssen <japj@darius.demon.nl>
+ * fixed url for System.Windows.Forms in the class status
+
+2002-12-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: moved struct tm field tm_gmtoff check before the check
+ for timezone global variable. This makes Timezone work for me (debian
+ sid, linux, x86, which has both the field and the global variables).
+
+2002-12-10 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/oracle: added file which is
+ a new web page oracle.html
+
+ * doc/ado-net: clean up and add link
+ to oracle.html
+
+ * doc/web/commands
+ * doc/web/makefile: added oracle.html
+
+2002-12-10 Daniel Morgan <danmorg@sc.rr.com>
+
+ * man/Makefile.am: changed sqlsharpcli.1 to sqlsharp.1
+
+ * man/sqlsharpcli.1: renamed to sqlsharp.1
+
+2002-12-09 Tim Haynes <thaynes@openlinksw.co.uk>
+
+ * mono/jit/jit.c
+ * mono/metadata/icall.c: added mono_install_get_config_dir() to
+ utilize the MONO_CFG_DIR environment variable for specifying
+ different machine.configs.
+
+2002-12-06 Duncan Mak <duncan@ximian.com>
+
+ * data/Makefile.am (EXTRA_DIST): Add machine.config
+ (DISTCLEANFILES): Add config.
+
+2002-11-30 Daniel Morgan <danmorg@sc.rr.com>
+
+ * man/sqlsharpcli.1: added file - a man page
+ for SQL# CLI
+
+ * man/Makefile.am: added sqlsharpcli.1 to man_MANS
+
+2002-11-20 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/firebird: updated web page
+
+2002-11-19 Mike Kestner <mkestner@speakeasy.net>
+
+ * data/Config.in : added the gtk# dll mapping entries
+
+2002-11-19 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/firebird: updated web page based on input
+ from the firebird .net data provider author
+
+Mon Nov 18 16:40:34 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in, mono/os/gc_wrapper.h: check that the gc headers have
+ been installed.
+
+2002-11-12 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/oledb
+ * doc/odbc
+ * doc/mysql
+ * doc/sqlite
+ * doc/sqlclient
+ * doc/tdsclient
+ * doc/sybase
+ * doc/firebird: added web pages
+ for each specific data provider
+
+ * doc/ado-net
+ * doc/postgresql: updated web page
+ with current status
+
+ * doc/web/commands
+ * doc/web/makefile: updated to include
+ new web pages
+
+2002-11-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * autogen.sh: make it work when MONO_PATH is set and it has more than
+ one directory or ends in ":". Also check that the directory added to
+ ACLOCAL_FLAGS and PATH exist (aclocal fails if they don't).
+
+2002-10-22 Miguel de Icaza <miguel@ximian.com>
+
+ * configure.in: Also allow the miss-spelled bohem.
+
+2002-10-18 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/ado-net
+ * doc/postgresql
+ * doc/tds-providers: cleaned up the web pages
+
+ * doc/web/commands: postgresql.html page was mistyped
+
+2002-10-18 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/ado-net: updated status of
+ the ADO.NET functionality and providers
+ and added link to tds-providers.html
+
+ * doc/tds-providers: added file to
+ describe the design and status of
+ the SqlClient, SybaseClient, and TdsClient
+ ADO.NET providers.
+
+ * doc/web/makefile
+ * doc/web/command: added new web page
+ tds-providers.html to build of www.go-mono.com web site
+
+2002-10-17 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/web/makefile
+ * doc/web/commands: web page
+ postgresql needed to be added
+
+2002-10-13 Mark Crichton <crichton@gimp.org>
+
+ * doc/index: Even more spelling errors fixed.
+
+2002-10-13 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/adonet: updated status of all providers, added links,
+ and added information
+ about the Mono.Data.SqliteClient provider that
+ Vladimir Vukicevic contributed. Added Brian Ritchie's
+ and Vladimir Vukicevic's email addresses as
+ people to contact about ADO.NET in Mono.
+ Added information about SQL#, configuration tools,
+ and an ADO.NET Multiplexor, etc...
+
+2002-10-10 Daniel Morgan <danmorg@sc.rr.com>
+
+ * doc/index: corrected some mistypes
+
+ * doc/adonet: updated the status and plans of all the ADO.NET providers
+ and moved PostgreSQL specific stuff to doc/postgresql
+
+ * doc/postgresql: added new file to detail
+ the status of the PostgreSQL ADO.NET provider
+ and provide test notes for setting it up
+
+2002-10-09 Daniel Morgan <danmorg@sc.rr.com>
+
+ * data/config.in: add entry for MySQL native shared libraries
+ which are different on Windows and Linux
+
+2002-10-04 Diego Sevilla Ruiz <dsevilla@um.es>
+
+ * doc/ccvs: Fixed some ugly formatting.
+
+2002-10-03 Dick Porter <dick@ximian.com>
+
+ * acconfig.h:
+ * configure.in: Freebsd pthread_t is a pointer
+
+2002-10-01 Duncan Mak <duncan@ximian.com>
+
+ * mono/os/Makefile.am: Add gc_wrapper.h.
+
+ * runtime/Makefile.am: Fix the path for monoresgen.exe.
+
+2002-09-27 Dick Porter <dick@ximian.com>
+
+ * configure.in: Check for semaphore.h. Patch for BSD from
+ jmmv@hispabsd.org (Julio Merino).
+
+2002-09-20 Duncan Mak <duncan@ximian.com>
+
+ * data/config.in: Added reference to libxslt.
+
+2002-09-20 Mark Crichton <crichton@gimp.org>
+
+ * configure.in: added NEED_LINK_UNLINK to make io-layer more portable.
+ Linux has a "virtual fs" for UNIX sockets, Solaris and BSD don't.
+ For systems that do not have such a virtual FS, define
+ NEED_LINK_UNLINK.
+
+ * acconfig.h: added NEED_LINK_UNLINK
+
+Wed Sep 4 18:09:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in: add some needed defines to fix support of
+ threads in the GC.
+
+2002-09-19 Mark Crichton <crichton@gimp.org>
+
+ * configure.in: Added checks for Solaris to use X/Open functionality.
+ Really needed for the io-layer code.
+
+2002-09-15 Andrew Birkett <andy@nobugs.org>
+
+ * man/mcs.1: --probe is now --expect-error.
+
+2002-09-09 Dick Porter <dick@ximian.com>
+
+ * acconfig.h:
+ * configure.in: Simplify thread checks, by using canned rules for
+ particular systems (based on the sleepycat db configure.in).
+ Tested on linux/x86, freebsd and w32. Solaris also added, but I
+ don't have a solaris machine to try it on.
+
+2002-09-04 Juli Mallett <jmallett@FreeBSD.org>
+
+ * configure.in: Include <sys/types.h> when checking <sys/un.h> stuff.
+
+2002-09-02 Diego Sevilla Ruiz <dsevilla@um.es>
+
+ * doc/ccvs: Added how to convert SSH keys (from SSH Communications
+ Security) to the OpenSSH keys required by mono CVS
+ access.
+
+2002-09-01 Juli Mallett <jmallett@FreeBSD.org>
+
+ * configure.in, mono/interpreter/interp.c,
+ mono/io-layer/handles.c, mono/io-layer/processes.c,
+ mono/io-layer/threads.c, mono/io-layer/timed-thread.c,
+ mono/io-layer/wait.c, mono/jit/helpers.c, mono/jit/jit.c,
+ mono/metadata/appdomain.c, mono/metadata/class.c,
+ mono/metadata/domain.c, mono/metadata/gc.c,
+ mono/metadata/object.c, mono/metadata/reflection.c,
+ mono/metadata/threads.c, mono/os/gc_wrapper.h,
+ mono/utils/mono-hash.c: Add a new header, gc_wrapper.h, to
+ wrap inclusion of gc.h for boehm, since from FreeBSD and
+ OpenBSD ports, gc.h is <gc.h>, but on GNU it seems to be
+ in <gc/gc.h>. This will reduce the diffs FreeBSD ports has
+ to apply, and also makes it possible for me to build with
+ GC on OpenBSD/macppc built by hand.
+
+2002-09-01 Juli Mallett <jmallett@FreeBSD.org>
+
+ * configure.in: On BSD don't try to use -ldl, we simply don't use it.
+
+2002-09-01 Juli Mallett <jmallett@FreeBSD.org>
+
+ * mono/dis/dis-cil.c:
+ * configure.in: Check for <wchar.h> via autoconf, don't use it if
+ it isn't there, as it seems to work fine without it on OpenBSD.
+
+2002-08-28 Dick Porter <dick@ximian.com>
+
+ * mono/os/win32/util.c:
+ * mono/os/unix/util.c:
+ * mono/os/util.h: mono_set_rootdir() doesnt take any args now.
+ (It doesn't do anything on unix builds, and the w32 version no
+ longer needs an arg.)
+
+ * configure.in: Add HOST_CC for w32 builds
+
+Tue Aug 27 18:17:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in: remove iconv checks.
+
+2002-08-24 Juli Mallett <jmallett@FreeBSD.org>
+
+ * configure.in: Recognise OpenBSD/macppc as PowerPC.
+
+Tue Aug 20 15:15:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in: patch by noa@metamatrix.se (Daniel Resare)
+ to error out if bison is missing.
+
+2002-08-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * configure.in: don't link against libdl on windoze.
+
+2002-08-12 Dick Porter <dick@ximian.com>
+
+ * mono.pc.in: Add $includedir to Cflags
+
+Fri Jul 19 18:38:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * configure.in, Makefile.am, mono.pc.in: add a mono.pc file for use
+ with pkg-config.
+ * */Makefile.am: makefile overhaul to create a shared libmono library.
+ * */*.h: do not include config.h in headers that should be installed.
+
+2002-07-12 Dick Porter <dick@ximian.com>
+
+ * acconfig.h:
+ * configure.in: Check the size of sockaddr_un.sun_path
+
+2002-06-23 Miguel de Icaza <miguel@ximian.com>
+
+ * man/Makefile.am (man_MANS): Added new man page
+
+ * man/mono-config.5: New manual page describing the mono-config
+ file format.
+
2002-06-10 Jaroslaw Kowalski <jarek@atm.com.pl>
* configure.in: added checks for MSG_NOSIGNAL
@@ -501,3 +2358,4 @@ Wed Jul 11 00:36:36 CEST 2001 Paolo Molaro <lupus@ximian.com>
* NEWS:
+
diff --git a/Makefile.am b/Makefile.am
index b4ab7f57021..a0ea58ebe1a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,258 @@
AUTOMAKE_OPTIONS = foreign
+ACLOCAL_AMFLAGS = -I .
-SUBDIRS = mono doc docs runtime scripts man
+SUBDIRS = $(libgc_dir) mono $(ikvm_jni_dir) docs data runtime scripts man samples support web
+
+# Keep in sync with SUBDIRS
+## 'tools' is not normally built
+DIST_SUBDIRS = libgc mono ikvm-jni docs data runtime scripts man samples support web tools
+
+EXTRA_DIST= mono.pc.in mono.spec.in mint.pc.in
+
+# Distribute the 'mcs' tree too
+dist-hook:
+ test -d $(distdir)/mcs || mkdir $(distdir)/mcs
+ d=`cd $(distdir)/mcs && pwd`; cd $(mcs_topdir) && $(MAKE) distdir=$$d dist-recursive
+
+pkgconfigdir = $(libdir)/pkgconfig
+if JIT_SUPPORTED
+pkgconfig_DATA= mono.pc mint.pc
+else
+pkgconfig_DATA= mint.pc
+endif
+DISTCLEANFILES= mono.pc mint.pc
+
+#
+# The following targets are used to compile and install
+# mono and mcs without running into the out-of-sync
+# problems by doing the compilation in the right order.
+#
+
+.PHONY: bootstrap faststrap fasterstrap bootstrap-clean bootstrap-check get-monolite-latest monolite-bootstrap
+.PHONY: tmpinst-dir tmpinst-mcs-basic-build tmpinst-mcs-short-build tmpinst-mcs-full-build tmpinst-monolite
+.PHONY: mono-do-runtime-only mcs-do-basic-build mcs-do-short-build mcs-do-full-build mcs-do-clean-profiles mcs-do-run-test
+.PHONY: populate-runtime-subdir
+
+if USE_JIT
+mono_runtime = mono/mini/mono
+else
+mono_runtime = mono/interpreter/mint
+endif
+
+# Minimal set of directories to build, and files used to run the 'mcs' compiler
+MCS_BASIC_DIRS = jay mcs class/corlib class/System
+MCS_BASIC_FILES = \
+ $(mcs_topdir)/mcs/mcs.exe \
+ $(mcs_topdir)/class/lib/default/mscorlib.dll \
+ $(mcs_topdir)/class/lib/default/System.dll
+
+# Set of directories and files the 'mcs' compiler can use
+## We build class/System twice to resolve the cyclic dependency of class/System.XML
+MCS_DIRS = $(MCS_BASIC_DIRS) class/System.XML class/System class/Mono.CSharp.Debugger
+MCS_FILES = $(MCS_BASIC_FILES) \
+ $(mcs_topdir)/class/lib/default/System.Xml.dll \
+ $(mcs_topdir)/class/lib/default/Mono.CompilerServices.SymbolWriter.dll
+
+tmpinst = _tmpinst
+
+if PLATFORM_WIN32
+
+populate_profiles = default:net_1_1
+
+# bootstraps using the .NET C# compiler
+bootstrap: tmpinst-dir mono-do-runtime-only
+ $(MAKE) fasterstrap
+
+else
+
+populate_profiles = default:net_1_1 net_2_0:net_2_0
+
+bootstrap: tmpinst-mcs-basic-build mono-do-runtime-only
+ $(MAKE) tmpinst-mcs-short-build
+ $(MAKE) fasterstrap
+
+endif
+
+faststrap: tmpinst-mcs-short-build
+ $(MAKE) mono-do-runtime-only
+ $(MAKE) fasterstrap
+
+fasterstrap: tmpinst-mcs-full-build
+ $(MAKE) populate-runtime-subdir
+ $(MAKE)
+
+bootstrap-clean: clean mcs-do-clean-profiles
+
+bootstrap-check: check mcs-do-run-test-profiles #mono-do-testjit
+
+mono-do-testjit: $(tmpinst)/bin/ilasm
+ tmpinst=`cd $(tmpinst) && pwd` ; \
+ PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
+ cd mono/tests && $(MAKE) test
+
+# building with monolite
+
+get-monolite-latest:
+ wget -O $(srcdir)/../monolite-latest.tar.gz http://www.go-mono.com/daily/monolite-latest.tar.gz
+
+monolite-bootstrap: tmpinst-monolite mono-do-runtime-only
+ rm -f $(MCS_FILES)
+ $(MAKE) tmpinst-mcs-short-build
+ $(MAKE) fasterstrap
+
+compiler-tests:
+ $(MAKE) mcs-do-clean-profiles
+ $(MAKE) bootstrap
+ $(MAKE) mcs-do-compiler-tests
+
+bootstrap-world: compiler-tests
+ $(MAKE) install
+
+# internal targets
+
+tmpinst-mcs-basic-build: mcs-do-basic-build tmpinst-dir
+ mv -f $(MCS_BASIC_FILES) $(tmpinst)/lib
+
+tmpinst-mcs-short-build: mcs-do-short-build tmpinst-dir
+ mv -f $(MCS_FILES) $(tmpinst)/lib
+
+tmpinst-mcs-full-build: mcs-do-full-build tmpinst-dir
+ cp -f $(MCS_FILES) $(tmpinst)/lib
+
+tmpinst-monolite: tmpinst-dir
+ -rm -f $(tmpinst)/lib/mcs.exe $(tmpinst)/lib/*.dll
+ -rm -fr $(tmpinst)/monolite-*
+ srcdir=`cd $(srcdir) && pwd` && cd $(tmpinst) && ( gzip -d -c $$srcdir/../monolite-latest.tar.gz | tar xf - )
+ mv -f $(tmpinst)/monolite-*/mcs.exe $(tmpinst)/monolite-*/*.dll $(tmpinst)/lib
+ rm -fr $(tmpinst)/monolite-*
+
+# Build enough of 'mono' to run the stage1 mcs.exe
+mono-do-runtime-only: $(CONFIG_HEADER)
+ for dir in $(libgc_dir) mono data; do \
+ (cd $$dir && $(MAKE)) || exit 1 ; \
+ done
+
+mcs-do-basic-build:
+ rm -f $(MCS_FILES)
+ for dir in $(MCS_BASIC_DIRS); do \
+ (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes USE_BOOT_COMPILE=yes BOOTSTRAP_MCS="mcs -d:BOOTSTRAP_WITH_OLDLIB") || exit 1 ; \
+ done
+
+mcs-do-short-build:
+ tmpinst=`cd $(tmpinst) && pwd` ; \
+ PATH=$$tmpinst/bin:$$PATH; export PATH ; \
+ for dir in $(MCS_DIRS); do \
+ (cd $(mcs_topdir)/$$dir && $(MAKE) PROFILE=default NO_SIGN_ASSEMBLY=yes) || exit 1 ; \
+ done
+
+mcs-do-full-build:
+ tmpinst=`cd $(tmpinst) && pwd` ; \
+ PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
+ cd $(mcs_topdir) && $(MAKE) NO_SIGN_ASSEMBLY=yes all-profiles
+
+mcs-do-clean-profiles:
+ cd $(mcs_topdir) && $(MAKE) clean-profiles
+
+mcs-do-run-test-profiles: tmpinst-dir $(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm $(tmpinst)/bin/pedump
+ tmpinst=`cd $(tmpinst) && pwd` ; \
+ PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
+ cd $(mcs_topdir) && $(MAKE) run-test-profiles
+
+mcs-do-compiler-tests:
+ tmpinst=`cd $(tmpinst) && pwd` ; \
+ PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
+ cd $(mcs_topdir) && $(MAKE) compiler-tests
+
+populate-runtime-subdir:
+ test -n '$(populate_profiles)'
+ @srcdir=`cd $(srcdir) && pwd`; tmpinst=`pwd`/$(tmpinst) ; \
+ PATH=$$tmpinst/bin:$$PATH ; export PATH ; \
+ for profile in $(populate_profiles); do \
+ ( set fnord `echo $$profile | sed 's,:, ,g'` && \
+ echo "cd $(mcs_topdir) && $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install" && \
+ cd $(mcs_topdir) && \
+ $(MAKE) PROGRAM_INSTALL_DIR=$$srcdir/runtime PROFILE=$$2 LIBRARY_INSTALL_DIR=$$srcdir/runtime/$$3 prefix=$$tmpinst/prefix install ) || exit 1 ; \
+ done
+ find $(tmpinst)/prefix -type f -name '*jay*' -exec rm -f '{}' ';'
+ for i in `find $(tmpinst)/prefix -type d -name '*jay*' -print`; do rm -f $$i/*; done
+ test -z "`find $(tmpinst)/prefix -type f -print`"
+ rm -rf $(tmpinst)/prefix
+
+tmpinst-dir:
+ mkdir -p $(tmpinst) $(tmpinst)/bin $(tmpinst)/lib $(tmpinst)/etc/mono/1.0 $(tmpinst)/etc/mono/2.0
+ $(MAKE) tmpinst-dir-contents
+
+tmpinst-dir-contents: $(tmpinst)/bin/mono $(tmpinst)/bin/mcs $(tmpinst)/etc/mono/1.0/machine.config $(tmpinst)/etc/mono/2.0/machine.config
+
+if PLATFORM_WIN32
+
+$(tmpinst)/bin/mono: $(srcdir)/Makefile.am
+ echo '#! /bin/sh' > $@
+ echo 'builddir="'`pwd`'"; win_builddir="'`cygpath -w -a .`'"' >> $@
+ echo 'tmpinst="$$win_builddir\\$(tmpinst)"' >> $@
+ echo 'if test -z "$$MONO_PATH" ; then MONO_PATH="$$tmpinst\\lib"; else MONO_PATH="$${MONO_PATH};$$tmpinst\\lib" ; fi' >> $@
+ echo 'MONO_CFG_DIR="$$tmpinst\\etc"' >> $@
+ echo 'export MONO_PATH MONO_CFG_DIR' >> $@
+ echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime).exe" "$$@"' >> $@
+ chmod +x $@
+
+else
+
+$(tmpinst)/bin/mono: $(srcdir)/Makefile.am
+ echo '#! /bin/sh' > $@
+ echo 'builddir="'`pwd`'"; tmpinst=$$builddir/$(tmpinst)' >> $@
+ echo 'if test -z "$$MONO_PATH" ; then MONO_PATH=$$tmpinst/lib; else MONO_PATH=$${MONO_PATH}:$$tmpinst/lib ; fi' >> $@
+ echo 'MONO_CFG_DIR=$$tmpinst/etc' >> $@
+ echo 'export MONO_PATH MONO_CFG_DIR' >> $@
+ echo 'exec "$$builddir/libtool" --mode=execute "$$builddir/$(mono_runtime)" --config "$$builddir/data/config" "$$@"' >> $@
+ chmod +x $@
+
+endif
+
+$(tmpinst)/bin/pedump: $(srcdir)/Makefile.am
+ (b=`pwd`; echo '#! /bin/sh'; echo 'exec "'"$$b/libtool"'" --mode=execute "'"$$b/mono/metadata/pedump"'" "$$@"') > $@
+ chmod +x $@
+
+$(tmpinst)/bin/mcs: $(srcdir)/Makefile.am
+ (t=`cd $(tmpinst) && pwd`; echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$t/lib/mcs.exe"'" "$$@"') > $@
+ chmod +x $@
+
+# Used only by 'bootstrap-check' -- so, can safely use runtime/.
+$(tmpinst)/bin/mbas $(tmpinst)/bin/ilasm: $(srcdir)/Makefile.am
+ t=`cd $(tmpinst) && pwd`; r=`cd $(srcdir)/runtime && pwd`; \
+ ( echo '#! /bin/sh'; echo 'exec "'"$$t/bin/mono"'" "'"$$r/$(@F).exe"'" "$$@"' ) > $@
+ chmod +x $@
+
+$(tmpinst)/etc/mono/1.0/machine.config: $(srcdir)/data/net_1_1/machine.config
+ rm -f $@
+ srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono/1.0 && $(LN_S) $$srcdir/data/net_1_1/machine.config machine.config
+
+$(tmpinst)/etc/mono/2.0/machine.config: $(srcdir)/data/net_2_0/machine.config
+ rm -f $@
+ srcdir=`cd $(srcdir) && pwd`; cd $(tmpinst)/etc/mono/2.0 && $(LN_S) $$srcdir/data/net_2_0/machine.config machine.config
+
+# Obsolete target -- don't use.
+.PHONY: fullbuild
+fullbuild: bootstrap
+ $(MAKE) install
+ echo "*** 'fullbuild' is an obsolete target. Use 'make bootstrap && make install'."
+ exit 1
+
+win32getdeps:
+ wget http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip
+ wget http://www.go-mono.com/archive/glib-2.0.4-20020703.zip
+ wget http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip
+ wget http://www.go-mono.com/archive/libiconv-1.7.zip
+ wget http://www.go-mono.com/archive/libiconv-dev-1.7.zip
+ wget http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip
+ wget http://www.jroith.de/nsis4cygwin.zip
+ unzip -n -d / pkgconfig-0.11-20020310.zip
+ unzip -n -d / glib-2.0.4-20020703.zip
+ unzip -n -d / glib-dev-2.0.4-20020703.zip
+ unzip -n -d / libiconv-1.7.zip
+ unzip -n -d / libiconv-dev-1.7.zip
+ unzip -n -d / libintl-0.10.40-20020101.zip
+ unzip -n -d / nsis4cygwin.zip
+
+win32setup:
+ makensis /DMILESTONE=$(VERSION) /DSOURCE_INSTALL_DIR=$(SOURCE_INSTALL_DIR) /DBUILDNUM=$(BUILDNUM) monowiz.win32.nsi
diff --git a/NEWS b/NEWS
index a0597920702..7040b466cb7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,1571 @@
+Hello everyone!
+
+ We are releasing a new version of Mono, Mono 0.22. A new release
+is made today because of the few recent bug-fixes that were committed
+to CVS.
+
+ Source code and binaries for this release can be found on the
+ web page,
+
+ http://www.go-mono.com/download.html
+
+ The URLs for the sources are:
+
+ * MCS package (the Class Libraries, C# and VB.NET compiler
+ and other assorted tools written in Managed code):
+
+ http://www.go-mono.com/archive/mcs-0.22.tar.gz
+
+ * Mono package (the Runtime engine and JIT compiler):
+
+ http://www.go-mono.com/archive/mono-0.22.tar.gz
+
+ RPM packages for this release can be downloaded from the web-page
+as well as from the 'Mono' channel on Red Carpet. Debian packages will
+appear on the download page later, as well as an installer for our
+Windows users.
+
+ Since last Thursday, 320 commits have been made to our CVS
+repository. These following hackers contributed to Mono since version
+0.21:
+
+ Aleksey Demakov, Alexandre Pigolkine, Atsushi Enomoto, Elan
+ Feingeld, Dick Porter, Dietmar Maurer, Duncan Mak, Gonzalo
+ Paniagua, Ian MacLean, Jackson Harper, Jean-Marc Andre, Jerome
+ Laban, Lluis Sanchez, Martin Baulig, Miguel de Icaza, Nick
+ Drochak, Paolo Molaro, Pedro Martinez, Per Ameng, Peter Williams,
+ Rafael Teixeira, Reggie Burnett, Sebastien Pouliot, Tim Coleman
+ and Zoltan Varga.
+
+Highlights:
+
+ * The "MemoryStream" bug.
+ This bug affected a lot of classes, and made them crashy,
+ database code, XML parsing and a few others were
+ crashing. Thanks to Gonzalo for fixing this bug.
+
+ * System.Data:
+ More bug fixes from Aleksey and Tim.
+
+ * Reflection:
+ Zoltan continues to provide fixes to our Reflection.Emit code
+ to host IKVM.
+
+ * Remoting:
+ Lluis added support for activation using activation
+ attributes.
+
+ * PEToolkit:
+ Jackson imported the PEAPI package from the Queensland
+ University of Technology in Australia. This will replace the
+ existing Mono.PEToolkit for our ILasm back-end.
+
+ * Windows Forms:
+ More fixes from Reggie and Alexandre.
+
+ * System.Web.Mail:
+ Per has been working on this namespace. He announces recently
+ that all major parts of System.Web.Mail has now been implemented.
+
+ * System.Web.Mobile:
+ Gaurav continues to make progress here.
+
+ * Misc:
+
+ Ian MacLean contributed a /compile flag to monoresgen and
+ assorted bug-fixes and improvements from the rest of the team.
+
+
+ My name is Duncan Mak, and I just made my first Mono release.
+
+-----------------------------------------------------------------------------
+Hello everyone!
+
+ The Mono Team introduces the best Mono release so far we have
+done. Thanks to everyone who contributed fixes, code, ideas, and bug
+reports.
+
+ Mono 0.20 has been released, it is available at the usual location:
+
+ http://www.go-mono.com/download.html
+
+ This is a truly heroic release of Mono. Major architectural
+chunks that were missing, or were miss-implemented have been fixed in
+this release, and we are very proud of it. Please see the list of
+features, because there is no short way of introducing just how good
+this release is. A big thanks goes to Piers for setting up a
+Tinderbox that monitors problems with the Mono CVS repository.
+
+ We released packages for SuSE 8.0, Mandrake 8.2, and various
+Red Hat releases. It is also available from Red Carpet on the Mono
+channel.
+
+ Source code for Mono, MCS, the Mono Debugger, XSP is available as
+well from that web page. The sources are:
+
+ MCS package (Class Libraries, C# and VB.NET compiler and managed tools):
+
+ http://www.go-mono.com/archive/mcs-0.20.tar.gz
+
+ Mono package (Runtime engine, JIT compiler):
+
+ http://www.go-mono.com/archive/mono-0.20.tar.gz
+
+ XSP package (XSP test web server for ASP.NET webforms):
+
+ http://www.go-mono.com/archive/xsp-0.3.tar.gz
+
+ This release is brought to you by: Alvaro del Castillo, Alan Tam,
+Alp Toker, Alejandro Sánchez, Alexandre Pigolkin, Atsushi Enomoto,
+Brian Ritchie, Christopher Bockner, Daniel Lopez, Daniel Morgan,
+Dennis Hayes, Dick Porter, Dietmar Maurer, Duncan Mak, Gaurav Vaish,
+Gonzalo Paniagua, Jackson Harper, Jaime Anguiano, Jeff Stedfast,
+Johannes Roith, John Sohn, Jonathan Pryor, "Lee Mallabone, "Lluis
+Sanchez, "Marco Ridoni, Mark Crichton, Martin Baulig, Martin Willemoes
+Hansen, Miguel de Icaza, Mike Kestner, Nick Drochak, Paolo Molaro,
+Patrik Torstensson, Pedro Martinez, Per Arneng, Peter Williams, Petr
+Danecek, Piers Haken, Radek Doulik, Rafael Teixeira, Rodrigo Moya,
+Sebastien Pouliot, Tim Coleman, Ville Palo, and Zoltan Varga.
+
+ They commited 1810 changes to CVS patches in the past 33 days.
+
+* New in this release
+
+ * Zoltan and IKVM
+
+ Zoltan's patches to run Jeroen's IKVM (the Java VM that
+ translates JVM bytecodes into .NET bytecodes) are in.
+
+ * Remoting.
+
+ The remoting team's patches that were held off on the previous
+ release are here. Lluis and Patrik have done a fantastic job
+ in getting remoting to work. Many low-level runtime engine
+ changes, and plenty of work on the class-library stuff.
+
+ Lluis has posted a couple of sample applications to the
+ mailing list, you can try those out.
+
+ The new release includes a working BinaryFormatter and
+ BinaryFormatterSink. It means that together with TcpChannel
+ it is possible to make remote calls with any type of
+ parameters and return values, including value types,
+ MarshalByRefObject types (that are properly
+ marshalled/unmarshalled), delegates, enums, etc.
+
+ RemotingConfiguration is partially implemented. It cannot read
+ from config files, but manual configuration using the api is
+ fully working.
+
+ Implemented full support for client activated types and for
+ well known objects (both singleton and single call).
+
+ Lease manager fully working (it manages the lifetime of server
+ objects).
+
+ Implemented interception of the new operator, so it is
+ possible to create a remote object using "new", if the type is
+ properly registered in RemotingConfiguration.
+
+ In Lluis' words: `Basically, 0.20 will have almost all needed
+ for a distributed application with Remoting'
+
+ * New threading semantics, IO-layer
+
+ Dick Porter in a couple of weeks has heroically redone much of
+ the threading support to match the .NET behavior (details are
+ on the .NET threading book as posted on the Mono site).
+
+ He also did a lot of bug fixes in the IO/threading space. The
+ threading implementation now contains a new and faster Monitor
+ implementation, as well as a correct Pulse()/Wait()
+ implementation.
+
+ GC thread finalization has been re-enabled. This means that
+ finalizers will be ran on a separate thread, as done in the
+ Microsoft.NET Framework. This might expose some bugs on
+ existing finalizer code.
+
+ * Moved to NUnit2
+
+ Nick and Gonzalo helped us move to the new NUnit2 platform for
+ all of our tests. A big applause goes to them.
+
+ * Cross Appdomain invocations work now.
+
+ ASP.NET and NUnit2 both used cross appdomain invocations, we
+ have fixed a number of problems, and they are now functional.
+
+ The AppDomain fixes and the Remoting fixes have allowed us to
+ remove a number of hacks in the ASP.NET implementation that
+ were previously there.
+
+ Implemented CrossAppDomainChannel, for calls between domains.
+
+ * C# Compiler and Debugging.
+
+ When generating debugging information in the compiler (with
+ -debug, -g or -debug+) the compiler will embed the debugging
+ information into the resulting executable instead of
+ generating a separate file. Very nice.
+
+ Generating debugging information has also improved vastly
+ performance-wise, and now it is possible to always use
+ debugging builds for software development.
+
+ A number of bugs were fixed on the compiler as well and
+ by using the Mono profiler we have reduced the memory
+ consumption and accelerated the compiler.
+
+ Thanks to Jackson, Martin, Paolo and for helping here.
+
+ * VB.NET Compiler.
+
+ Plenty of new features are included in the compiler in our
+ path to conformance. See <FIXME:get-url-for-posting> for
+ details on the status of the compiler, and the pieces missing.
+
+ * ILasm and Mono.PEToolkit.
+
+ Work on the IL assembler has resumed, but it is not yet ready
+ for production use. The Mono IL Assembler uses the
+ Mono.PEToolkit library done by Sergey and Jackson to
+ manipulate CIL image files.
+
+ * Cryptographic work.
+
+ Sebastien has provided a cert2spc and secutil tools for
+ certificate management. This is the first release that ships
+ an assembly for System.Security
+
+ Also a new internal assembly used only on Windows allows Mono
+ users to use the unmanaged crypto providers.
+
+ * System.XML
+
+ Atsushi has continued to improve the work on our XML
+ implementation: fixing bugs and more closely matching the
+ Microsoft implementation.
+
+ * More PowerPC/Alpha support.
+
+ Taylor Christopher has contributed more code generation macros
+ for PPC and Laramie Leavitt for Alpha.
+
+ * System.XML.Xsl
+
+ Gonzalo continued the implementation of our XSLT transformation
+ API (custom .NET functions are still missing though). It no
+ longer uses temporary files to apply transformations. Thanks
+ to an idea from Zdravko Tashev. Xslt Web controls work as
+ part of this fix.
+
+ * ASP.NET
+
+ Gonzalo has cleaned up a lot the code base, and now our test
+ server supports a --root and --virtual command line options
+ for better control.
+
+ Also, now we generate a much nicer error page on errors. We
+ are looking for volunteers to improve the default look of this
+ page.
+
+ Authentication is now supported
+
+ * Mobile Controls.
+
+ Gaurav Vaish continues on his quest to complete the
+ implementation of the Mobile controls. These controls are
+ required to run a stock IBuySpy application.
+
+ * Class Libraries:
+
+ New Mono.Posix class library that contains classes for working
+ on a Posix systems. Things like Unix domain sockets are here.
+
+ * System.Windows.Forms
+
+ Alexandre Pigolkine continues to contribute more code to our
+ Windows.Forms implementation. Currently it only runs on
+ Windows (or in Linux without GC enabled, due to the
+ pthread/Wine threading library mismatch. This is being
+ actively addressed as part of the Wine work due to the
+ movement to the new thread implementation available in RH 8.1).
+
+ * Database providers
+
+ Christopher Bockner has updated his DB2 database provider (now
+ with prepared statement functionality) and Tim Coleman has
+ continued work on the Oracle database provider (welcome back
+ Tim!)
+
+ * Database code.
+
+ Dan Morgan continues to develop core components in System.Data
+ (and now we welcome Alan Tam to the System.Data core hackers)
+
+ The SQL# tool now supports MySQLNet, Npgsql, DB2Client, and
+ Oracle clients.
+
+ * Runtime
+
+ mono --profile now performs memory allocation profiling too.
+
+ * Runtime fixes.
+
+ We now support multi-module with external file reference
+ assemblies.
+
+ The above in English means that we can now run Eiffel.NET code
+ in Mono.
+
+ * Monograph:
+
+ More statistics supported now.
+
+ * System.Web.Mail
+
+ Per has contributed the code for this namespace.
+
+* Bugs
+
+ Plenty of bugs were closed.
+-------------------------------------------------------------------------
+Hello everyone!
+
+ We have made a new release of Mono available. Despite the fact
+that we just did Mono 0.18, this release is packed with new features.
+
+* Availability.
+
+ Mono 0.19 is available in package format from:
+
+ http://www.go-mono.com/download.html
+
+ We released packages for SuSE 8.0, Mandrake 8.2, Debian and various
+Red Hat releases. It is also available from Red Carpet on the Mono
+channel.
+
+ Source code for Mono, MCS, the Mono Debugger, XSP is available as
+well from that web page.
+
+* New in this release
+
+ * Remoting news:
+
+ Lluis has implemented and documented the Binary formatter
+ Woohoo! He has done a lot of work as well to support
+ remoting.
+
+ Patrik has also been working heavily on fixing a
+ number of remoting related bugs and missing features.
+
+ Ajay also implemented 1-d array serialization in System.Xml
+
+ * New database provider: IBM DB2
+
+ Christopher Bockner has contributed a DB2 data
+ provider for System.Data. We have a very complete
+ range of data providers.
+
+ * System.Web.Mobile
+
+ Gaurav has started work on this assembly, this will
+ allow us to run the unmodified reference ASP.NET
+ applications that were designed to support Mobile
+ browsing.
+
+ * System.Data and System.XML:
+
+ More implementation work on XmlDataDocument from Ville
+ and plenty of fixes from Atsushi.
+
+ * MacOS patches:
+
+ Paolo integrated John Duncan's and Benjamin Reed
+ patches to make Mono run on MacOS X out of the box.
+
+ * IsolatedStorage
+
+ The initial implementation of it was done by Jonathan
+ Pryor and included in this release.
+
+ * Compilers:
+
+ More work on the Mono Visual Basic compiler (it is now
+ included in the packages).
+
+ Plenty of bug fixes from Jackson, Miguel to the C#
+ compiler.
+
+ Patches from Francesco and Daniel to the VB.NET
+ support runtime.
+
+ * Debugger support
+
+ Plenty of updates to run the new Mono Debugger from Martin.
+
+* Main missing bits:
+
+ Some of everyone's favorite patches or code chunks have not yet
+been integrated, hopefully Mono 0.20 will have them:
+
+ * Zoltan's patch to run IKVM is not yet on this release
+
+ * Some parts of Patrik's remoting code did not make it to the
+ release either.
+
+ * Reggie's MySQL native provider is also missing.
+
+Enjoy!
+Miguel.
+-------------------------------------------------------------------------
+Hello everyone!
+
+ We have made a new release of Mono available. Despite the fact
+that we just did Mono 0.18, this release is packed with new features.
+
+* Availability.
+
+ Mono 0.19 is available in package format from:
+
+ http://www.go-mono.com/download.html
+
+ We released packages for SuSE 8.0, Mandrake 8.2, Debian and various
+Red Hat releases. It is also available from Red Carpet on the Mono
+channel.
+
+ Source code for Mono, MCS, the Mono Debugger, XSP is available as
+well from that web page.
+
+* New in this release
+
+ * Remoting news:
+
+ Lluis has implemented and documented the Binary formatter
+ Woohoo! He has done a lot of work as well to support
+ remoting.
+
+ Patrik has also been working heavily on fixing a
+ number of remoting related bugs and missing features.
+
+ Ajay also implemented 1-d array serialization in System.Xml
+
+ * New database provider: IBM DB2
+
+ Christopher Bockner has contributed a DB2 data
+ provider for System.Data. We have a very complete
+ range of data providers.
+
+ * System.Web.Mobile
+
+ Gaurav has started work on this assembly, this will
+ allow us to run the unmodified reference ASP.NET
+ applications that were designed to support Mobile
+ browsing.
+
+ * System.Data and System.XML:
+
+ More implementation work on XmlDataDocument from Ville
+ and plenty of fixes from Atsushi.
+
+ * MacOS patches:
+
+ Paolo integrated John Duncan's and Benjamin Reed
+ patches to make Mono run on MacOS X out of the box.
+
+ * IsolatedStorage
+
+ The initial implementation of it was done by Jonathan
+ Pryor and included in this release.
+
+ * Compilers:
+
+ More work on the Mono Visual Basic compiler (it is now
+ included in the packages).
+
+ Plenty of bug fixes from Jackson, Miguel to the C#
+ compiler.
+
+ Patches from Francesco and Daniel to the VB.NET
+ support runtime.
+
+ * Debugger support
+
+ Plenty of updates to run the new Mono Debugger from Martin.
+
+* Main missing bits:
+
+ Some of everyone's favorite patches or code chunks have not yet
+been integrated, hopefully Mono 0.20 will have them:
+
+ * Zoltan's patch to run IKVM is not yet on this release
+
+ * Some parts of Patrik's remoting code did not make it to the
+ release either.
+
+ * Reggie's MySQL native provider is also missing.
+
+Enjoy!
+Miguel.
+------------------------------------------------------------------------------
+Happy new year!
+
+ The Mono team is proud to release Mono 0.18, with plenty of bug
+ fixes and improvements. If you are a happy 0.17 user, this
+ release is a happiness extension release. Many bugs in the
+ runtime, class libraries and C# compiler have been fixed.
+
+ Also, our special envoy in Japan has reported that there is
+ some naming confussion about the naming of Mono, as can be
+ seen in the following documentary material:
+
+ Atsushi Enomoto shows the source of confussion:
+
+ http://primates.ximian.com/~duncan/gallery/Duncan-in-Tokyo/DSCN0702
+
+ Nick and Duncan echo it:
+
+ http://primates.ximian.com/~duncan/gallery/Duncan-in-Tokyo/DSCN0703
+
+* Availability
+
+ Mono 0.18 packages and source code is available for download from:
+
+ http://www.go-mono.com/download.html
+
+ Those using Red Carpet on Linux can install Mono 0.18 from
+ the Mono channel. The packages have already been pushed for
+ you.
+
+ At release time we have packages for Red Hat 8.0, 7.3,
+ 7.2 and 7.1 and Mandrake 8.2.
+
+* Contributors to this release
+
+ This release is brought to you by:
+
+ Alejandro Sanchez, Alp Toker, Atsushi Enomoto, Cesar Octavio
+ Lopez Netaren, Daniel Lopez (mod_mono), Daniel Morgan, Dennis
+ Hayes, Dick Porter, Dietmar Maurer, Duncan Mak, Eduardo
+ Garcia, Gaurav Vaish, Gonzalo Paniagua, Jackson Harper, Jaime
+ Anguiano, Jeroen Janssen, Johannes Roith, Jonathan Pryor, Juli
+ Mallett, Lluis Sanchez, Marco Ridoni, Martin Baulig, Miguel de
+ Icaza, Nick Drochak, Paolo Molaro, Patrik Torstensson, Piers
+ Haken, Rachel Hestilow, Rafael Teixeira, Ravi Pratap,
+ Sebastian Pouliot, Tim Coleman, Tim Hayes, Ville Palo, Zoltan
+ Varga.
+
+* New in this release
+
+ VB.NET compiler:
+
+ Many improvements to the Mono VB.NET compiler.
+
+ ASP.NET:
+
+ Plenty of bug fixes in ASP.NET. Larger applications
+ can now be run with it. The authentication system has
+ been deployed, most changes are from Gonzalo.
+
+ We have a modified IBuySpy running (without Xslt)
+
+ If you want to run ASP.NET you can run it with either
+ our XSP proof-of-concept server, or with Daniel's
+ Apache module that can be fetched from CVS (module
+ name: mod_apache)
+
+ Type Reflector:
+
+ A Console, Gtk# and Windows.Forms tool to browse
+ compiled assemblies and examine the types on it, from
+ Jonathan Pryor.
+
+ Moving to NUnit 2.0
+
+ Nick continues the work on moving our test suite to NUnit 2.0
+
+ Mobile.Controls:
+
+ Gaurav has started work on the Mobile controls, which
+ are required to run some of the reference applications
+ in full-mode like IBuySpy.
+
+ Remoting:
+
+ The remoting infrastructure has got a big boost from
+ Lluis in this release.
+
+ System.Data/XML
+
+ Ville has been working on improving our System.Data
+ classes in the XML assembly.
+
+ Crypto:
+
+ Plenty of new crypto from Sebastien as well. A new
+ web page in our site can be used to track this.
+
+ http://www.go-mono.com/crypto.html
+
+
+----------------------------------------------------------------------
+Hello!
+
+ Version 0.17 of Mono has been released.
+
+ There are plenty of new features, bug fixes, new classes,
+ performance improvements, optimizations and much more
+ available in this release.
+
+* Stats
+
+ 2605 cvs commits to the Mono repository since October 1st, an
+ average of 37 commits per day including weekends.
+
+ 212 commits to the Mono module.
+ 1438 commits to the MCS module.
+
+* Mono Improvements:
+
+ Work has begun to make the runtime run a finalizer thread and
+ invoke all the finalizers from this thread. This is the same
+ behavior as Java and the Microsoft runtime, but it is disabled
+ on this build.
+
+ Integrated the s390 work from Neale Ferguson.
+
+ Beginning of the work for pre-compiling code (Ahead of time
+ compilation) for Mono (based on the early work of Zoltan).
+
+ New option `--noboundscheck' for benchmark purposes, it
+ disables array bound checks.
+
+ Uses mmap instead of SysV shared memory for the Windows API
+ emulation layer.
+
+ Plenty of bug fixes, improvements and integration with the
+ upper layer class libraries.
+
+ New exception handling code uses the GCC native support for
+ stack-walking if available and gives big performance boost
+ (15% on mcs bootstrap).
+
+ A lot of the work in the new release of Mono is required for
+ the Mono Debugger (which will be released separately). The
+ Mono debugger is interesting, because it can debug both
+ managed and unmanaged applications, but it only supports the
+ JITer for debugging.
+
+ Dick, Dietmar, Gonzalo, Martin and Paolo were in charge of
+ most of these changes.
+
+* Compiler improvements:
+
+ Many bug fixes as usual, better C# compliancy.
+
+ Performance improvements. The new release of the Mono C#
+ compiler is 37% faster than the previous version (self-compile
+ is down to 8 seconds). On my P4 1.8Ghz machine, the Mono C#
+ compiler compiles (342,000 lines per minute).
+
+ Thanks to go Ravi and Martin for helping out with the bug
+ fixing hunt.
+
+* Cryptography and Security classes
+
+ Sebastien Pouliot and Andrew Birkett were extremely busy
+ during the past two months working on the cryptography
+ classes, many of the crypto providers are now working
+
+ Jackson on the other hand helped us with the security
+ classes, he said about those:
+
+ `Writing security classes is the most exciting thing I have
+ ever done, I can not wait to write more of them'.
+
+* ASP.NET:
+
+ We have now moved the code from the XSP server (which was our
+ test bed for ASP.NET) into the right classes inside
+ System.Web, and now any web server that was built by using the
+ System.Web hosting interfaces can be used with Mono.
+
+ The sample XSP server still exists, but it is now just a
+ simple implementation of the WorkerRequest and ApplicationHost
+ classes and can be used to test drive ASP.NET. A big thanks
+ goes to Gonzalo who worked on this night and day (mostly
+ night).
+
+ Gaurav keeps helping us with the Web.Design classes, and
+ improving the existing web controls.
+
+* ADO.NET:
+
+ New providers are available in this release. The relentless
+ System.Data team (Brian, Dan, Rodrigo, Tim and Ville) are
+ hacking non-stop on the databse code. Improving existing
+ providers, and new providers.
+
+ The new providers on this release:
+
+ * Oracle
+ * MS SQL
+ * ODBC
+ * Sybase
+ * Sqlite (for embedded use).
+
+ Many regression tests have been added as well (Ville has been
+ doing a great job here).
+
+ Brian also created a DB provider multiplexor (The ProviderFactory)
+
+ Stuart Caborn contributed Writing XML from a DataSet.
+ Luis Fernandez contributed constraint handling code.
+
+ Also there is new a Gtk# GUI tool from Dan that can be used to
+ try out various providers.
+
+* System.XML:
+
+ Atsushi has taken the lead in fixing and plugging the missing
+ parts of the System.XML namespace, many fixes, many
+ improvements.
+
+* CodeDom and the C# provider.
+
+ Jackson Harper has been helping us with the various interface
+ classes from the CodeDOM to the C# compiler, in this release
+ a new assembly joins us: Cscompmgd. It is a simple assembly,
+ and hence Microsoft decided not to waste an entire "System"
+ "dot" on it.
+
+* Testing
+
+ Nick Drochak has integrated the new NUnit 2.0 system.
+
+* Monograph:
+
+ Monograph now has a --stats option to get statistics on
+ assembly code.
+
+
+CVS Contributors to this release:
+
+ Alejandro Sanchez, Alp Toker, Andrew Birkett, Atsushi Enomoto,
+ Brian Ritchie, Cesar Octavio Lopez Nataren, Chris Toshok,
+ Daniel Morgan, Daniel Stodden, Dennis Hayes, Dick Porter,
+ Diego Sevilla, Dietmar Maurer, Duncan Mak, Eduardo Garcia,
+ Ettore Perazzoli, Gaurav Vaish, Gonzalo Paniagua, Jackson
+ Harper, Jaime Anguiano, Johannes Roith, John Sohn, Jonathan
+ Pryor, Kristian Rietveld, Mads Pultz, Mark Crichton, Martin
+ Baulig, Martin Willemoes Hansen, Miguel de Icaza, Mike
+ Kestner, Nick Drochak, Nick Zigarovich, Paolo Molaro, Patrik
+ Torstensson, Phillip Pearson, Piers Haken, Rachel Hestilow,
+ Radek Doulik, Rafael Teixeira, Ravi Pratap, Rodrigo Moya,
+ Sebastien Pouliot, Tim Coleman, Tim Haynes, Ville Palo,
+ Vladimir Vukicevic, and Zoltan Varga.
+
+ (Am sorry, I could not track everyone from the ChangeLog
+ messages, I apologize in advance for the missing
+ contributors).
+
+------------------------------------------------------------------------
+
+Hello!
+
+ Version 0.16 of Mono has been released! This is mostly a bug
+ fix release, a lot of work has been going on to make existing
+ features more robust and less buggy. Also, contributions are
+ too varied, so it is hard to classify them in groups.
+
+* Stats
+
+ 795 commits to mono and mcs since August 23rd.
+
+* News
+
+ The changes that got in this releases are mostly
+ bugfixes. Miguel, Martin and Ravi attacked lots of bugs in the
+ compiler, Dick fixed a bunch of bugs related to processes and
+ threads. Mark Crichton resumed his work on the SPARC port and
+ made lots of progress there. Juli Mallett has been working on
+ making sure Mono also builds on BSD systems. As usual, Dietmar
+ and Paolo supplied their continuous stream of fixes to the
+ runtime.
+
+ Dietmar has completed the work on the runtime side for
+ remoting support and we ship now with a sample channel, the
+ System.Runtime.Remoting.Sample. This can be used as a
+ reference implementation for anyone interested in implementing
+ other channels (like a CORBA channel).
+
+ Duncan got preliminary XSLT support done by using
+ libxslt.
+
+ Gonzalo (with some help from Patrik) has been working hard
+ making our ASP.NET implementation work on both Mono and MS by
+ migrating the existing xsp code to the class library. Gaurav
+ started working on the classes in System.Design.dll and Chris
+ Toshok checked in Mono.Directory.LDAP, which will be the
+ foundation to implement the System.DirectoryServices assembly.
+
+ Various fixes from Kral, Jason, Piers and Gonzalo were
+ committed to System.Xml; Martin Algiers reports that the
+ upcoming NAnt release will be fully compatible with Mono.
+
+ Miguel imported Sergey Chaban's Mono.PEToolkit and ilasm code
+ to CVS. Nick, as always, continues to refine our testing
+ framework by improving our tests. Andrew Birkett continues to
+ improve the implementation of our security/cryptographic
+ classes. Jonathan Pryor contributed type-reflector the our
+ list of tools.
+
+* Other News From Behind de Curtain.
+
+ While the above is pretty impressive on its own, various other
+ non-released portions of Mono have been undergoing: Adam Treat
+ has been leading the effort to document our class libraries
+ and produce the tools required for it.
+
+ Martin Baulig has been working on the Mono Debugger which is
+ not being released yet. This debugger allows both native
+ Linux application as well as CIL applications to be debugged
+ at the same time (and in fact, you can use this to debug the
+ JIT engine). The debugger is written in C# with some C glue
+
+ In the meant A new JIT engine is under development, focused on
+ adding more of the high-end optimizations which will be
+ integrated on an ahead-of-time-compiler. Dietmar and Paolo
+ have been working on this.
+
+* Contributors to this release
+
+ * Non-Ximian developers: Adam Treat, Andrew Birkett, Dennis
+ Hayes, Diego Sevilla, Franklin Wise, Gaurav Vaish ,Jason
+ Diamond, Johannes Roith, John Sohn, Jonathan Pryor, Juli
+ Mallett, Kral Ferch, Mike Crichton, Nick Drochak, Nick
+ Zigarovich, Piers Haken, Rafael Teixeira, Ricardo Fernandez
+ Pascual, Sergey Chaban, Tim Coleman.
+
+ * Ximian developers: Dietmar, Paolo, Dick, Duncan, Ravi,
+ Miguel, Martin, Chris, Joe, Gonzalo, Rodrigo.
+
+
+---------------------------------------------------------------------------------
+ * Sergey Chaban added thread-safe support to
+ System.Collections.SortedList.
+
+ * Fixes to the compiler by Andrew Birkett.
+
+ * Tim Coleman contributed the OleDb provider for System.Data and started
+ work on System.Web.Services.
+
+ * Radek fixed a lot of problems on the PPC side. [*]
+
+ * Miguel and Martin committed the new type lookup system.
+
+ * Dietmar rewrote the marshalling code. [*]
+
+ * Peter Williams and Martin contributed the new Makefiles, with help
+ from Alp Toker as well.
+
+* Contributors to this release:
+
+ * Non-Ximian developers: Nick Drochak, Martin Baulig, Tim
+ Coleman, Mike Kestner, Alp Toker, Jonathan Pryor, Jaime
+ Anguiano, Piers Haken, Rafael Teixeira, Mark Crichton,
+ Sergey Chabon, Ajay Kumar Dwivedi, Andrew Birkett, Dennis
+ Hayes (SWF), Adam Treat, Johannes Roith and Lawrence Pit.
+
+ * Ximian developers: Duncan, Ravi, Dick, Dietmar, Paolo,
+ Gonzalo, Rachel, Radek, Rodrigo, Jeff, Peter Williams and
+ Miguel.
+
+Special thanks to Duncan for helping me put this release together.
+
+Hello!
+
+ A new version of Mono (0.12), is out.
+
+ Mono is an open source implementation of the Microsoft.NET
+ Framework, and ships with a C# compiler, a runtime engine
+ (with a JIT on x86 cpus) and a set of class libraries.
+
+ Mono is know to work on a number of platforms:
+ x86/Linux, x86/Windows, x86/FreeBSD; sparc/solaris;
+ linuxppc/linux; strongarm/linux.
+
+ There have been many changes since the last release of Mono in
+ late April, thanks to Duncan for assembling the list of new
+ features, any omissions are my fault.
+
+Changes since 0.11:
+
+ It is hard to keep track of the changes, as there are 1632
+ patches that were posted to the mailing list. One third of
+ the total number of patches since we opened mono-patches
+ list. I am sure I missed some stuff and probably missed some
+ contributors. I apologize in advance.
+
+ Runtime:
+
+ Paolo: New Reflection.Emit generation code generates
+ code that can be executed in Windows. Now binaries
+ generated by Mono/MCS will run on Windows.
+
+ Paolo got Activator.CreateInstance to work.
+
+ Sergey's CPU-optimization for CPBLK.
+
+ Many many bug fixes to the runtime from Dick, Dan
+ Lewis, Dietmar, Gonzalo, Martin, Paolo, Radek and Sergey,
+
+ Compiler:
+
+ Many bug fixes: The compiler can now compile Gtk#,
+ Vorbis#, System.Data assembly and System.Xml assembly
+ which previously did not work (Dietmar, Miguel, Paolo,
+ Piers, Ravi, Miguel). Thanks to all the bug
+ reporters.
+
+ Class Libraries:
+
+ Mike started work on System.Xml.XPath
+
+ Christian, Dennis, Daniel and friends got more stubs
+ for System.Windows.Forms in.
+
+ Ajay revamped System.Xml.Schema. And Jason and Duncan
+ updated System.Xml
+
+ Daniel also checked in a working CodeDOM
+ implementation and a C# provider.
+
+ Many bug fixes by everyone. Thanks to Daniel, Duncan,
+ Jonathan, Lawrence, Martin Mike, Nick and Piers. I am
+ missing a lot of contributors that should be listed.
+
+ ASP.NET support
+
+ A lot of work from Gonzalo allows some small and
+ modest ASP.NET applications to run (you still need the
+ unreleased XSP code though).
+
+ System.Data:
+
+ Integrated the MySQL provider from Brad Merryl.
+
+ Lots of work by Dan, Rodrigo, Tim.
+
+ Microsoft.VisualBasic runtime support
+
+ Rafael and Chris have been working on the VisualBasic
+ runtime support DLLs
+
+Hello everyone!
+
+ Mono 0.11 is out!
+
+ This new version has new features:
+
+ * Massive:
+
+ * Ultrich Kunitz implemented the whole calendar set of
+ classes. Yes, thats right. The whole thing, with a
+ complete test suite. Thanks Ultrich!
+
+ * JIT/runtime features:
+
+ * Martin's debugging framework is included (see web
+ site for details on how to use it). (Martin)
+
+ * Transparent Proxy has been implemented for the
+ runtime (lets you run/debug/hack on remoting for Mono) (Dietmar)
+
+ * Inline and constant folding/propagation support
+ in the JIT engine (Dietmar)
+
+ * Profiling support for the JIT engine (--profile).
+
+ * Cool runtime hacks, that made our compiler twice as fast:
+
+ * New string rewrite: faster, speedier, leaner, cooler!
+
+ Paolo had been talking about a new string rewrite,
+ and super hacker Patrik Torstensson started the
+ implementation, Dietmar then switched the object
+ layout and the Mono team helped iron out a few of
+ the details.
+
+ * New array reprensetation: Dan Lewis contributed a new
+ faster and smaller array implementation.
+
+ * Improved Reflection.Emit: Paolo improved our
+ reflection emit code.
+
+ * ADO.NET
+
+ * Daniel Morgan, Rodrigo Moya have some pieces of the
+ Sql classes ready to run. he first signs of life
+ this week (we can connect, insert rows; do transactions:
+ commit/rollback; SQL errors and exceptions work).
+
+ * Http Runtime
+
+ * The HTTP runtime (to be used by our ASP.NET implementation)
+ was contributed by Patrik Torstensson. Patrik not only
+ contributed a massive ammount of classes, but he immediately
+ went on to implement ThreadPools and then helped out with the
+ new String rewrite.
+
+ * XML improvements:
+
+ * Kral Ferch and Duncan Mak contributed more
+ improvements to the XML implementation.
+
+ * Work on Xml Serialization from John Donagher.
+
+ * Documentation:
+
+ * MonoDoc ships for the first time!
+ (John Barnette, Adam Treat and John Sohn)
+
+ * New documentation stubs ready to be filled, and translated
+ included (thanks to our doc team!)
+
+ * General fixes:
+
+ * Piers Haken fixed many of our attributes and many
+ little problems that were exposed by his CorCompare tool
+
+ * Many Mono C# compiler bug fixes.
+
+ * Other improvements:
+
+ * NUnit works on Linux! (Patrik Torstensson)
+
+ * More NUnit tests (Nick Drochak)
+
+ * Windows.Forms progress: Dennis Hayes and Christian
+ Meyer have been contributing stubs for the
+ Windows.Forms work.
+
+ * Full Parse implementations and bug fixing by Gonzalo
+
+ * Dan Lewis contributed some missing classes for the
+ Regexp implementation.
+
+ * Jonathan's trace classes
+
+* This Month's Mono is brought to you by:
+
+ Adam Treat, Chris Podugriel, Christian Meyer, Daniel Lewis,
+ Daniel Morgan, Dennis Hayes, Dick Porter, Dietmar Maurer,
+ Duncan Mak, Guarav Vaish, Gonzalo Paniagua, Jaime Anguiano,
+ Jason Diamond, Joe Shaw, John Barnette, John Donagher, John
+ Sohn, Jonathan Pryor, Kral Ferch, Martin Baulig, Miguel de
+ Icaza, Mike Kestner, Nick Drochak, Paolo Molaro, Patrik
+ Tostensson, Piers Haken, Ravi Pratap, Rodrigo Moya, Sergey
+ Chanben, Ultrich Kunitz, Wictor Wilen.
+
+ I know that I missed some features, there is a lot of work
+ that happens in a month. I apologize in advance for any
+ features I omited by accident.
+
+ Special thanks go to Duncan for helping out with all those
+ little details in the project. And also Nick who has been
+ keeping us in good shape by maintaining and helping new
+ contributors provide more test suites.
+
+* Reporting bugs
+
+ If you find a bug in Mono, please file a bug here:
+
+ http://bugzilla.ximian.com
+
+ That way we wont loose your bug report, and will be able to
+ follow up properly with it. Also try to provide simple test
+ cases whenever possible and try as hard as possible to
+ identify the root of a problem (compiler, runtime, class
+ libraries).
+
+* Forum
+
+ The mono-list-request@ximian.com mailing list is open for
+ those of you who want to discuss the future of Mono.
+
+Hello everyone!
+
+ Mono "Self Hosting" 0.10 is out! (Alex insisted I used the
+ <blink> tag for "Self Hosting", but was dissapointed when he
+ realized most mailers dont support this).
+
+ Too many things have happened since the the 0.9 release,
+ almost an entire month. The big news is that we are shipping
+ a the self-hosting Mono C# compiler. This has been tested on
+ Linux/x86 only.
+
+ Also, we delayed the release for one reason or other, but it
+ turns out that as a extra bonus, Paolo fixed the last
+ outstanding bug in the JIT engine, so the compiler now runs in
+ the JIT engine instead of the interpreter.
+
+ The mono-0.10 release includes the libraries required to run
+ the compiler as well as assorted .NET programs [1].
+
+* What is new
+
+ There is so much stuff in this release that is hard to keep
+ track of it.
+
+ Jason, Kral and Duncan have done an amazing job with
+ System.Xml, up to the point that it is even being used by
+ gtk-sharp's code generator (and it all comes with great test
+ suites to verify that it works!). Ajay's XmlSchema code is
+ also shipped.
+
+ Martin worked on our debugging infrastructure (the JIT can
+ load dwarf files, and our class libraries now generate dwarf
+ debugging info; we are in the process of adding this to the
+ compiler, the patch did not make it to this release though).
+
+ For the first time the System.Web assembly has built without
+ all the excludes, so you can get your hands on Gaurav and
+ Lee's massive code base.
+
+ Lots of new tests to the runtime, class libraries and compiler
+ are included. As always, big thanks go to Nick for continued
+ guidance to new developers, and writing new tests.
+
+ Dan removed the System.PAL dependency, we now have moved to an
+ internalcall setup for all the System.IO calls, and dropped
+ the MonoWrapper shared library.
+
+ Porting wise: Sergey's StrongARM port is included now; Jeff's
+ SPARC port and Radek's PowerPC port have been updated to
+ reflect the new changes in the engine.
+
+ Runtime wise: Dietmar also got us asyncronous delegates
+ implemented. Dick continues his work on our foundation
+ classes, and has resumed his work on the IO layer.
+
+ Paolo is the hero behind self hosting on Linux. Send your
+ congrats (and wine) to him.
+
+ And without the help from Mike, Duco, David, Piers, Nick,
+ Sergey, Mark, Jonathan, John, Adam and Dennis this release
+ would have not been possible.
+
+ This release is mostly ECMA compatible. I did not expect this
+ to happen so soon. I am very grateful to everyone who has
+ made this happen
+
+* The goods
+
+ The runtime sources and binaries to the compiler/libraries:
+
+ http://www.go-mono.com/archive/mono-0.10.tar.gz
+
+ The class and compiler sources:
+
+ http://www.go-mono.com/archive/mcs-0.10.tar.gz
+
+* Requirements:
+
+ You still need glib-2, and pkg-config. If you plan on
+ compiling large applications, getting the Boehm GC is a plus
+ (we will integrate this in a future version, for now it is an
+ external requirement).
+
+ Boehm GC is available in packaged format for Debian and Red
+ Hat systems.
+
+* To compile on Linux
+
+ Do your regular chores with mono-0.10.tar.gz, you know the
+ drill. In the end, after you reach the `make install' phase,
+ now you can do some cool stuff.
+
+ If you want to compile the compiler (just to try it out),
+ untar the sources to the compiler (mcs-0.10.tar.gz) and do
+ manually:
+
+ cd mcs-0.10
+ (cd jay; make)
+ (cd mcs; make monomcs)
+
+ Now you will end up with a nice mcs4.exe in the mcs/mcs
+ directory, that is the compiler. If you want to use that,
+ replace the mcs.exe we distribute with the mcs4.exe you got.
+
+* Gadgets
+
+ Man pages for mcs, mono and mint are included for your
+ enjoyment.
+
+ Particularly of interest is `mint --profile' which is awesome
+ to profile your application, the output is very useful.
+
+ Also, if you want to impress your friends, you might want to
+ run the JIT with the `-d' flag, that shows you how the JITer
+ compiles the code (and shows the basic blocks and the forst of
+ trees as it goes).
+
+* Next steps
+
+ More classes are missing. These are required so we can run
+ nant and nunit natively. Once we achieve that, we will be
+ able to ship a complete environment that compiles on Linux.
+
+ Currently our makefiles still use csc, as we still need
+ nunit/nant to work.
+
+[1] Of course, .NET programs that try to use classes we have not yet
+implemented, will be left wondering `why did this happen to me?'.
+
+Hello!
+
+ I have just uploaded Mono 0.9 to the web server, you can get
+ the goodies here:
+
+ http://www.go-mono.com/archive/mono-0.9.tar.gz
+ http://www.go-mono.com/archive/mcs-0.9.tar.gz
+
+ mono-0.9.tar.gz contains the source code to the runtime (JIT
+ and interpreter) as well as a pre-compiled version of the
+ compiler (mcs.exe) and the class libraries.
+
+ To compile the compiler and the class libraries, you still
+ need Windows with the .NET SDK, as our runtime can not host
+ the compiler completely yet.
+
+* Improved Build System
+
+ You can check http://www.go-mono.com/download.html for the
+ new and fresh compilation instructions. Same requirements as
+ the last version (pkg-config, glib 1.3.xx need to be
+ installed).
+
+* What is new:
+
+ Compiler can compile about 75% of our regression test suite
+ on Linux. Most of this work is on the class libraries and
+ Paolo has been the magician behind the work here.
+
+ JIT can run the compiler now (Dietmar)
+
+ Mint works on Windows now (Dick).
+
+ Application Domains have been implemented (Dietmar)
+
+ * Two modes of operation are available, depending on
+ your needs: share code, or maximize speed (does not
+ share code). This is described by the the
+ LoaderOptimization enumeration in .NET.
+
+ Corlib no longer has references to mscorlib (Daniel Lewis)
+
+ Ports:
+ PowerPC has been updated (Radek Doulik)
+ New SPARC port (Jeffrey Stedfast)
+
+ Documentation system:
+ Adam Treat has been working on finishing the Doctools
+ to maintain the Mono class library documentation. We
+ still need a GUI editor though.
+
+ Tracking progress:
+ Nick's new tools to track progress are included in
+ this release.
+
+ Many new more regression tests for the class library
+ (David Brandt, Mark Crichton, Nick Drochak, Bob Doan,
+ Duco Fijma).
+
+ Lots of new code:
+ Gaurav Vaish (the hacking god behind System.Web),
+ Chris Podugriel (System.Data) and Mark Crichton (Crypto)
+
+ Runtime:
+ Socket layer is finished (Dick Porter)
+
+ Compiler has full support for unsafe code now (Miguel)
+ Still a few things missing: constant folding is not
+ finished everywhere and access permissions are not
+ enforced yet.
+
+ Many many many bug fixes everywhere from everyone on the team:
+
+ Paolo Molaro, Daniel Lewis, Daniel Stodden, Dietmar
+ Maurer, Jeff Stedfast, Nick Drochak, Duco Fijma, Ravi Pratap,
+ Dick Porter, Duncan Mak, Jeff Stedfast and Miguel de Icaza.
+
+ I am sorry if I left a major component out of the
+ announcement, this were some intense 11 days of work.
+
+* What is obviously missing
+
+ Currently our System.Reflection.Emit is lacking array and
+ pointer support, which is why many programs still do not
+ compile, but this should be taken care of next week.
+
+* How can you help
+
+ There are many ways to help the project, check the details
+ documentation in:
+
+ http://www.go-mono.com/contributing.html
+
+ You might also want to stop by our IRC channel on
+ irc.gnome.org, channel #mono if you are interested in
+ contributing.
+
+Have a happy weekend!
+Miguel.
+
+Hey guys!
+
+ Mono 0.7 has been released.
+
+ It has been a long time since the last release of Mono (almost
+three weeks). We have made an incredible ammount of work in the past
+three weeks.
+
+* Highlights of this release:
+
+ * The monoburg: BURS-instruction selector implemented (for our
+ portable JIT engine).
+
+ * JIT engine works for very simple programs (Fibonacci works
+ for instance). It is about 30% faster running than the
+ equivalent code compiled with Kaffe.
+
+ The interesting part is that this was accomplished with the
+ a minimum register allocator, and very simple monoburg
+ rules, so there is a *lot* of room to improve here.
+
+ * The Interpreter has madured a lot. Value Types are fully
+ supported now; We dropped the FFI dependency, as we now
+ have our own code generator.
+
+ * The runtime has been expanded and extended as to support
+ real file I/O (including console I/O). So Hello World works
+ in there.
+
+ * The compiler can generate code for most statements now; It
+ also performs semantic analysis on most expressions.
+ Creation of new objects is supported, access to parameters,
+ fields and local variables works. Method invocation works.
+ Implicit type conversions, assignments and much more.
+
+ Operator overloading is implemented, but broken on this
+ release, hopefully this will be fixed soon.
+
+ Delegates and Attributes are now declared and passed around,
+ but no code generation for those exist yet.
+
+ * More classes (look for details). Sergey and Paolo have been
+ working on various classes in System.Reflection.Emit to get
+ the compiler self-hosting.
+
+ * NUnit is now part of the distribution, so it should be
+ trivial to write test cases (and if you want to help out,
+ this is one way to do it, we really need more tests cases).
+
+ I am going to try to switch to Nick's JB for C# this week or next
+week. But the excitement of having the compiler deal with real C#
+programs is too much to be contained, and I can not keep my hands of
+the code generation in the compiler.
+
+* Availability:
+
+ http://www.go-mono.com/archive/mono-0.7.tar.gz
+ http://www.go-mono.com/archive/mcs-0.7.tar.gz
+
+* Details
+
+ Class Library Changes:
+
+ Many enumerations have been revamped to have the same value
+definitions as those in .NET as those cause problems. They were also
+missing the [Flags] attributes, so we got that right too.
+
+ * System
+ SerializableAttribute impl (Miguel)
+ String updates (Jeff)
+ System.Char (Ravi)
+
+ * System.Configuration
+ ConfigurationSettings impl (Christopher Podurgiel)
+ SingleTagSectionHandler impl (Christopher Podurgiel)
+ DictionarySectionHandler impl (Christopher Podurgiel)
+
+ * System.Collections.Specialized
+ NameObjectCollectionBase impl (Nick Drochak)
+
+ * System.Diagnostics
+ StackFrame stubs (alexk)
+ StackTrace stubs (alexk)
+
+ * System.IO
+ File stubs (Jim Richardson)
+ IOException impl (Paolo)
+ StreamWriter impl (Dietmar)
+ StreamReader stubs (Dietmar)
+
+ * System.Net
+ ConnectionModes (Miguel)
+ ProxyUseType (Miguel)
+ WebStatus (Miguel)
+
+ * System.Reflection
+ Assembly (stubs) (Paolo)
+ MethodBase (Paolo)
+ MethodInfo (Paolo)
+
+ * System.Reflection.Emit
+ EventToken (Sergey)
+ FieldToken (Sergey)
+ FlowControl (Sergey)
+ ILGenerator (stubbed) (Paolo)
+ Label (Paolo)
+ MethodToken (Sergey)
+ OpCode.cs (Sergey)
+ OpCodeType (Sergey)
+ OpCodes.cs (Sergey)
+ OperandType (Sergey)
+ PEFileKinds (Paolo)
+ PackingSize (Sergey)
+ ParameterToken (Sergey)
+ PropertyToken (Sergey)
+ SignatureToken (Sergey)
+ StackBehaviour (Sergey)
+ StringToken (Sergey)
+ TypeToken (Sergey)
+
+ * System.Threading
+
+ Most classes stubbed out by Dick Porter (Dick)
+
+ * System.Web
+ HttpWorkerRequest stubs (Bob Smith)
+
+ * System.Web.Hosting (Bob Smith)
+ AppDomainFactory stubs (Bob Smith)
+ ApplicationHost stubs (Bob Smith)
+ IAppDomainFactory stubs (Bob Smith)
+ IISAPIRuntime stubs (Bob Smith)
+ ISAPIRuntime stubs (Bob Smith)
+ SimpleWorkerRequest stubs (Bob Smith)
+
+ * System.Web.UI
+ LiteralControl implemented (Bob Smith)
+ HtmlContainerControl bugfixes (Bob Smith)
+ BuildMethod
+ BuildTemplateMethod
+ HtmlTextWriterAttribute
+ HtmlTextWriterStyle
+ HtmlTextWriterTag
+ IAttributeAccessor
+ IDataBindingsAccessor
+ INamingContainer
+ IParserAccessor
+ IPostBackDataHandler
+ IPostBackEventHandler
+ IStateManager
+ ITagNameToTypeMapper
+ ITemplate
+ IValidator
+ ImageClickEventHandler
+ OutputCacheLocation
+ PersistanceMode
+ StateItem
+
+ * System.Web.UI.HtmlControls
+ HtmlAnchor impl (Leen Teolen)
+ HtmlTextArea impl (Leen Teolen)
+
+ * System.Web.UI.WebControls
+ WebControl.cs (Gaurav Vaish)
+
+ * System.XML
+ Lots of enumerations (Miguel)
+ (will add later)
+
+ * Add loads of enumerations throughout (Sergey)
+ (will add later)
+
+Compiler Changes:
+
+ * Assignment (Miguel)
+
+ * expression semantic analysis (Miguel)
+
+ * constructor creation, chaining (Miguel)
+
+ * Unified error reporting (Ravi)
+
+ * initial attribute support (Ravi)
+
+ * calling convention support (Miguel)
+
+ * loop construct code generation (Miguel)
+
+ * conditional statement code generation (Miguel)
+
+ * indexer declarations (Ravi)
+
+ * event declarations (Ravi)
+
+ * try/catch parsing fixed (Ravi)
+
+ * initial delegate support (Ravi)
+
+ * operator overload (Ravi)
+
+Tools Changes:
+
+ * Add NUnit windows binaries to distribution (Nick Drochak, Miguel)
+
+Runtime Changes:
+
+ * First JIT implementation (Dietmar, Paolo)
+
+ * value type size calculation (Dietmar)
+
+ * full value type support (Paolo)
+
+ * frequently used types cache (Paolo)
+
+ * FileStream support (Paolo)
+
+ * Console input/output support (Dietmar)
+
+ * print arguments and exception name in stack trace (Paolo)
+
+ * beginnings of virtual call support (Paolo)
+
+ * reimplement pinvoke support (Dietmar)
+
+ * remove libffi dependency (Dietmar)
+
+ * IBURG code generator implementation (Dietmar)
+
+ * new opcodes implemented: starg.s, ldobj, isinst, (Paolo, Miguel)
+ ldarg, starg, ldloc, ldloca, stloc, initobj,
+ cpblk, sizeof, conv.i, conv.i1, conv.i2, conv.i4,
+ conv.i8, conv.u1, conv.u2, conv.u4, conv.r4,
+ conv.r8, ldelema, ceq, cgt, clt.
+
+* This list
+
+ Parts of this list of features were compiled by Alex by following
+the CVS mailing list. My deepest thanks to Alex for helping me out
+with this. I want to apologize for the missing features that I did
+not document here, Mono is moving too fast to keep track of all the
+changes.
+
2002-Feb-11 Miguel de Icaza <miguel@ximian.com>
New release, functional x86-JIT, x86 interpreter, ppc interpreter
diff --git a/README b/README
index 95e4b3806a1..0c1dff13c8a 100644
--- a/README
+++ b/README
@@ -1,24 +1,224 @@
This is Mono.
-Installation:
+1. Installation
+2. Using Mono
+3. Directory Roadmap
- Read doc/download for installation instructions,
- or read the HTML version:
+1. Compilation and Installation
+===============================
- http://www.go-mono.com/download.html
+ a. Build Requirements
+ ---------------------
-A directory roadmap:
+ To build Mono, you will need the following components:
+
+ * pkg-config
+
+ Available from: http://www.freedesktop.org/Software/pkgconfig
+
+ * glib 2.0
+
+ Available from: http://www.gtk.org/
+
+ Optional dependencies:
+
+ * ICU library
+
+ http://oss.software.ibm.com/icu/index.html
+
+ You will need this one to get complete support for the international
+ features of the .NET Framework.
+
+ * Cairo and libgdiplus
+
+ If you want to get support for System.Drawing, you will need to get
+ both Libgdiplus and Cairo.
+
+ b. Building the Software
+ ------------------------
+
+ If you obtained this package as an officially released tarball,
+ this is very simple, use configure and make:
+
+ ./configure --prefix=/usr/local
+ make
+ make install
+
+ Mono supports a JIT engine on x86, SPARC and PowerPC systems.
+ The various commands that ship with Mono default to the JIT engine
+ on x86 and SPARC, to turn it on for PPC systems, use the --with-jit=yes
+ command line option to configure.
+
+ MacOS X Users: you will need to download the latest Boehm GC
+ Alpha release for garbage collection to work properly.
+
+ If you obtained this as a snapshot, you will need an existing
+ Mono installation. To upgrade your installation, unpack both
+ mono and mcs:
+
+ tar xzf mcs-XXXX.tar.gz
+ tar xzf mono-XXXX.tar.gz
+ mv mono-XXX mono
+ mv mcs-XXX mcs
+ cd mono
+ ./autogen.sh --prefix=/usr/local
+ make bootstrap
+
+ c. Building the software from CVS
+ ---------------------------------
+
+ If you are building the software from CVS, make sure that you
+ have up-to-date mcs and mono sources:
+
+ cvs co mono mcs
+
+ Then, go into the mono directory, and configure:
+
+ cd mono
+ ./autogen.sh --prefix=/usr/local
+
+ Depending on whether you have an existing Mono installation or
+ not, you can try the following:
+
+ i. If you have an existing Mono installation
+ -----------------------------------------
+
+ First verify that you have a working installation:
+
+ echo 'class X { static void Main () { System.Console.Write("OK");}}' > x.cs
+
+ Compile:
+
+ mcs x.cs
+
+ And run:
+
+ mono x.exe
+
+ If you get the output `OK' and no errors, and you have mono
+ version 0.31 or later, continue. Otherwise, you can try option
+ (ii) below.
+
+ You are ready to start your CVS upgrade. Compile with
+
+ make bootstrap
+
+ This will automatically go into the mcs/ tree and build the
+ binaries there, and copy them into the appropriate
+ sub-directories of mono/runtime/.
+
+ Now, go to step (iii) below.
+
+ ii. If you don't have a working Mono installation
+ ---------------------------------------------
+
+ If you don't have a working Mono installation, an obvious choice
+ is to install the latest released packages of 'mono' for your
+ distribution and go back to step (i).
+
+ You can also try a slightly more risky approach that should work
+ almost all the time.
+
+ This works by first getting the latest version of the 'monolite'
+ distribution, which contains just enough to run the 'mcs'
+ compiler. You do this by
+
+ make get-monolite-latest
+
+ This should place a monolite-latest.tar.gz in the parent
+ directory of the 'mono' source tree. You can then run:
+
+ make monolite-bootstrap
+
+ This will automatically gunzip and untar the tarball, place the
+ files appropriately, and then complete the bootstrap.
+
+ iii. Testing and Installation
+ ------------------------
+
+ You can run the mono and mcs testsuites with the command:
+
+ make -k bootstrap-check
+
+ Expect to find several testsuite failures, especially in the
+ mcs/ tree. As a sanity check, you can compare the failures you
+ got with
+
+ http://go-mono.com/tests/displayTestResults.php
+
+ You can now install it:
+
+ make install
+
+ Failure to follow these steps will result in a broken installation.
+
+ iv. Other useful "bootstrap"-like facilities
+ ----------------------------------------
+
+ If you have a CVS snapshot that you keep updating periodically,
+ and/or do your development in, you may try using a couple of
+ specialty make targets that may be slightly faster than a
+ "make bootstrap".
+
+ You can try a two-stage bootstrap with:
+
+ make faststrap
+
+ This assumes that you have already run a "make bootstrap" on the
+ tree before.
+
+ If you want to avoid waiting even for that, you can try the
+ riskier one-stage build:
+
+ make fasterstrap
+
+ This should be attempted only if you're sure that the sources of
+ the mcs compiler itself and the sources of the libraries used by
+ it have not been changed.
+
+2. Using Mono
+=============
+
+ Once you have installed the software, you can run a few programs:
+
+ * runtime engine
+
+ mono program.exe
+ or
+ mint program.exe
+
+ * C# compiler
+
+ mcs program.cs
+
+ * CIL Disassembler
+
+ monodis program.exe
+
+ See the man pages for mono(1), mint(1), monodis(1) and mcs(2)
+ for further details.
+
+3. Directory Roadmap
+====================
doc/
- Contains documentation and the web site contents.
+ Contains the web site contents.
+
+ docs/
+ Technical documents about the Mono runtime.
+
+ data/
+ Configuration files installed as part of the Mono runtime.
mono/
- The core of the executable.
+ The core of the Mono Runtime.
metadata/
- The library to deal with executables and libraries for
- .NET
+ The object system and metadata reader.
+
+ jit/
+ The Just in Time Compiler.
dis/
CIL executable Disassembler
@@ -26,6 +226,10 @@ A directory roadmap:
cli/
Common code for the JIT and the interpreter.
+ io-layer/
+ The I/O layer and system abstraction for
+ emulating the .NET IO model.
+
cil/
Common Intermediate Representation, XML
definition of the CIL bytecodes.
@@ -33,20 +237,20 @@ A directory roadmap:
interp/
Interpreter for CLI executables.
-* Using Mono
+ arch/
+ Architecture specific portions.
- Once you have installed the software, you can run a few programs:
-
- monodis program.exe
+ man/
- That will dump the bytecodes for program.exe. Monodis support
- a number of options that dumps various metadata tables
- (chapter 23 of the Partition III).
+ Manual pages for the various Mono commands and programs.
- You can try the interpreter like this:
+ scripts/
- mint program.exe
+ Scripts used to invoke Mono and the corresponding program.
+ runtime/
+ A directory holding a pre-compiled version of the Mono
+ runtime.
diff --git a/acconfig.h b/acconfig.h
index 8f559030546..33d29183c40 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -3,17 +3,35 @@
#undef HAVE_MSG_NOSIGNAL
#undef HAVE_SOL_IP
#undef HAVE_SOL_TCP
+#undef HAVE_SOL_IPV6
#undef HAVE_IP_PKTINFO
#undef HAVE_STRUCT_IP_MREQN
-#undef HAVE_PTHREAD
+#undef HAVE_STRUCT_IP_MREQ
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
#undef USE_MONO_MUTEX
#undef HAVE_LARGE_FILE_SUPPORT
-#undef PLATFORM_WIN32
#undef HAVE_NEW_ICONV
#undef NAME_DEV_RANDOM
#undef HAVE_CRYPT_RNG
#undef HAVE_BOEHM_GC
+#undef USE_INCLUDED_LIBGC
#undef DISABLE_SHARED_HANDLES
#undef HAVE_TIMEZONE
#undef HAVE_TM_GMTOFF
+#undef MONO_SIZEOF_SUNPATH
+#undef MONO_ZERO_ARRAY_LENGTH
+#undef PTHREAD_POINTER_ID
+#undef HAVE_GC_H
+#undef HAVE_GC_GCJ_MALLOC
+#undef HAVE_GC_ENABLE
+#undef WITH_BUNDLE
+#undef HAVE_GETHOSTBYNAME2_R
+#undef HAVE_ICU
+#undef HAVE_KW_THREAD
+#undef HAVE_SIGNBIT
+#undef USE_MACH_SEMA
+#undef HAVE_SOCKLEN_T
+#undef HAVE_TRUNCL
+#undef HAVE_AINTL
+#undef HAVE_SCANDIR
+#undef HAVE_WORKING_SIGALTSTACK
diff --git a/autogen.sh b/autogen.sh
index 6f5d86a5691..ce0c26c87ac 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -8,8 +8,17 @@ srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
if [ -n "$MONO_PATH" ]; then
- ACLOCAL_FLAGS="-I $MONO_PATH/share/aclocal $ACLOCAL_FLAGS"
- PATH="$MONO_PATH/bin:$PATH"
+ # from -> /mono/lib:/another/mono/lib
+ # to -> /mono /another/mono
+ for i in `echo ${MONO_PATH} | tr ":" " "`; do
+ i=`dirname ${i}`
+ if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
+ ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
+ fi
+ if [ -n "{i}" -a -d "${i}/bin" ]; then
+ PATH="${i}/bin:$PATH"
+ fi
+ done
export PATH
fi
@@ -21,8 +30,15 @@ fi
DIE=1
}
+if [ -z "$LIBTOOL" ]; then
+ LIBTOOL=`which glibtool 2>/dev/null`
+ if [ ! -x "$LIBTOOL" ]; then
+ LIBTOOL=`which libtool`
+ fi
+fi
+
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
- (libtool --version) < /dev/null > /dev/null 2>&1 || {
+ ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to compile Mono."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
@@ -82,7 +98,7 @@ esac
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
if test -z "$NO_LIBTOOLIZE" ; then
echo "Running libtoolize..."
- libtoolize --force --copy
+ ${LIBTOOL}ize --force --copy
fi
fi
@@ -108,6 +124,12 @@ automake --add-missing --gnu $am_opt ||
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
+if test -d $srcdir/libgc; then
+ echo Running libgc/autogen.sh ...
+ (cd $srcdir/libgc ; NOCONFIGURE=1 ./autogen.sh "$@")
+ echo Done running libgc/autogen.sh ...
+fi
+
conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
diff --git a/config.h.in b/config.h.in
deleted file mode 100644
index b412155c227..00000000000
--- a/config.h.in
+++ /dev/null
@@ -1,51 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-#undef HAVE_INET_PTON
-#undef HAVE_INET_ATON
-#undef HAVE_SOL_IP
-#undef HAVE_SOL_TCP
-#undef HAVE_IP_PKTINFO
-#undef HAVE_STRUCT_IP_MREQN
-#undef HAVE_PTHREAD
-#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
-#undef USE_MONO_MUTEX
-#undef HAVE_LARGE_FILE_SUPPORT
-#undef PLATFORM_WIN32
-#undef HAVE_NEW_ICONV
-#undef NAME_DEV_RANDOM
-#undef HAVE_CRYPT_RNG
-#undef HAVE_BOEHM_GC
-
-/* The number of bytes in a void *. */
-#undef SIZEOF_VOID_P
-
-/* Define if you have the inet_aton function. */
-#undef HAVE_INET_ATON
-
-/* Define if you have the inet_pton function. */
-#undef HAVE_INET_PTON
-
-/* Define if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define if you have the <sys/filio.h> header file. */
-#undef HAVE_SYS_FILIO_H
-
-/* Define if you have the <sys/sockio.h> header file. */
-#undef HAVE_SYS_SOCKIO_H
-
-/* Define if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
-
-/* Name of package */
-#undef PACKAGE
-
-/* Version number of package */
-#undef VERSION
-
diff --git a/configure.in b/configure.in
index a82c6749548..b80e500f509 100644
--- a/configure.in
+++ b/configure.in
@@ -1,31 +1,205 @@
-
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono, 0.12)
+AM_INIT_AUTOMAKE(mono,1.1.2.99)
AM_MAINTAINER_MODE
-dnl ****************************************
-dnl *** Check if we're building on win32 ***
-dnl ****************************************
-AC_MSG_CHECKING([if building for some Win32 platform])
+AC_PROG_LN_S
+
+dnl
+dnl libgc checks
+dnl
+
+gc_headers=no
+gc=included
+use_included_gc=no
+
+if test -d $srcdir/libgc ; then
+ gc_default=included
+else
+ gc_default=boehm
+fi
+
+#
+# These are the flags that need to be stored in the mono.pc file for
+# compiling code that will embed Mono
+#
+libmono_cflags=""
+libmono_ldflags=""
+AC_SUBST(libmono_cflags)
+AC_SUBST(libmono_ldflags)
+
+dnl if linker handles the version script
+no_version_script=no
+
+# Set to yes if Unix sockets cannot be created in an anonymous namespace
+need_link_unlink=no
+
+# Thread configuration inspired by sleepycat's db
+AC_MSG_CHECKING([host platform characteristics])
+libgc_threads=no
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
- AC_DEFINE(PLATFORM_WIN32)
- CC="gcc -mno-cygwin"
+ AC_DEFINE(PLATFORM_WIN32,1,[Platform is Win32])
+ CC="gcc -mno-cygwin -g"
+ HOST_CC="gcc"
+ # So libgc configure gets -mno-cygwin
+ export CC
+# latest libgc already defines GC_WIN32_THREADS
+# CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS -DWIN32_THREADS"
+ CPPFLAGS="$CPPFLAGS -DWIN32_THREADS"
+ libdl=
+ libgc_threads=win32
+ gc_default=included
+ with_nptl=default
+ with_sigaltstack=no
+ LN_S=cp
+ ;;
+ *-*-*netbsd*)
+ platform_win32=no
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ libmono_cflags="-D_REENTRANT"
+ LDFLAGS="$LDFLAGS -pthread"
+ libmono_ldflags="-pthread"
+ need_link_unlink=yes
+ libdl=
+ libgc_threads=no
+ ;;
+# these flags will work for all versions of -STABLE
+#
+ *-*-*freebsd4*)
+ platform_win32=no
+ if test "x$PTHREAD_CFLAGS" = "x"; then
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
+ libmono_cflags="-D_THREAD_SAFE"
+ else
+ CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
+ libmono_cflags="$PTHREAD_CFLAGS"
+ fi
+ if test "x$PTHREAD_LIBS" = "x"; then
+ LDFLAGS="$LDFLAGS -pthread"
+ libmono_ldflags="-pthread"
+ else
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+ libmono_ldflags="$PTHREAD_LIBS"
+ fi
+ need_link_unlink=yes
+ AC_DEFINE(PTHREAD_POINTER_ID)
+ libdl=
+ libgc_threads=pthreads
+# TLS isn't implemented at all on -STABLE
+ with_nptl=no
+ with_tls=pthread
+ ;;
+# older versions of -CURRENT will break with these flags but testing
+# indicates these older versions won't run Mono anyway
+#
+ *-*-*freebsd5*)
+ platform_win32=no
+ if test "x$PTHREAD_CFLAGS" = "x"; then
+ CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
+ libmono_cflags=
+ else
+ CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
+ libmono_cflags="$PTHREAD_CFLAGS"
+ fi
+ if test "x$PTHREAD_LIBS" = "x"; then
+ LDFLAGS="$LDFLAGS -lpthread"
+ libmono_ldflags="-lpthread"
+ else
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+ libmono_ldflags="$PTHREAD_LIBS"
+ fi
+ need_link_unlink=yes
+ AC_DEFINE(PTHREAD_POINTER_ID)
+ libdl=
+ libgc_threads=pthreads
+# TLS is only partially implemented on -CURRENT (compiler support
+# but NOT library support)
+#
+ with_nptl=no
+ with_tls=pthread
+ ;;
+ *-*-*openbsd*)
+ platform_win32=no
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_FREEBSD_THREADS"
+ libmono_cflags="-D_THREAD_SAFE"
+ LDFLAGS="$LDFLAGS -pthread"
+ libmono_ldflags="-pthread"
+ need_link_unlink=yes
+ AC_DEFINE(PTHREAD_POINTER_ID)
+ libdl=
+ libgc_threads=pthreads
+ ;;
+ *-*-linux*)
+ platform_win32=no
+ CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT"
+ libmono_cflags="-D_REENTRANT"
+ libmono_ldflags="-lpthread"
+ libdl="-ldl"
+ libgc_threads=pthreads
+ ;;
+ *-*-hpux*)
+ platform_win32=no
+ CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
+ CFLAGS="$CFLAGS +ESdbgasm"
+ LDFLAGS="$LDFLAGS -z"
+ libmono_cflags="-D_REENTRANT"
+ libmono_ldflags="-lpthread"
+ libgc_threads=pthreads
+ need_link_unlink=yes
+ ;;
+ *-*-solaris*)
+ platform_win32=no
+ CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
+ need_link_unlink=yes
+ libmono_cflags="-D_REENTRANT"
+ libgc_threads=pthreads
+ ;;
+ *-*-darwin*)
+ platform_win32=no
+ CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS"
+ libmono_cflags="-D_THREAD_SAFE"
+ LDFLAGS="$LDFLAGS -pthread"
+ libmono_ldflags="-pthread"
+ need_link_unlink=yes
+ AC_DEFINE(PTHREAD_POINTER_ID)
+ AC_DEFINE(USE_MACH_SEMA)
+ no_version_script=yes
+ libdl=
+ libgc_threads=pthreads
;;
*)
+ AC_MSG_WARN([*** Please add $host to configure.in checks!])
platform_win32=no
+ libdl="-ldl"
;;
esac
-AC_MSG_RESULT($platform_win32)
+AC_MSG_RESULT(ok)
+
+if test x$need_link_unlink = xyes; then
+ AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
+fi
+
AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_INSTALL
+dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
+: ${CCAS='$(CC)'}
+# Set ASFLAGS if not already set.
+: ${CCASFLAGS='$(CFLAGS)'}
+AC_SUBST(CCAS)
+AC_SUBST(CCASFLAGS)
+
+AC_CHECK_PROG(BISON, bison,yes,no)
+if test "x$BISON" = "xno";
+then
+ AC_MSG_ERROR([You need to install bison])
+fi
dnl may require a specific autoconf version
dnl AC_PROG_CC_FOR_BUILD
@@ -45,18 +219,58 @@ AC_HEADER_STDC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
-AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h)
+# Test whenever ld supports -version-script
+AC_PROG_LD
+AC_PROG_LD_GNU
+if test "x$lt_cv_prog_gnu_ld" = "xno"; then
+ no_version_script=yes
+fi
+
+AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
-AC_CHECK_HEADERS(iconv.h)
-AC_CHECK_HEADERS(giconv.h)
+AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h sys/un.h)
+
+AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
+
+AM_CONDITIONAL(HAVE_ZLIB, test x$have_zlib = xyes)
# for mono/metadata/debug-symfile.c
AC_CHECK_HEADERS(elf.h)
+# for mono/dis
+AC_CHECK_HEADERS(wchar.h)
+
# not 64 bit clean in cross-compile
AC_CHECK_SIZEOF(void *, 4)
-CFLAGS='-g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
+WARN=''
+if test x"$GCC" = xyes; then
+ WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings'
+ # The runtime code does not respect ANSI C strict aliasing rules
+ CFLAGS="$CFLAGS -fno-strict-aliasing"
+else
+ # The Sun Forte compiler complains about inline functions that access static variables
+ # so disable all inlining.
+ case "$host" in
+ *-*-solaris*)
+ CFLAGS="$CFLAGS -Dinline="
+ ;;
+ esac
+fi
+CFLAGS="$CFLAGS -g $WARN"
+
+# Where's the 'mcs' source tree?
+if test -d $srcdir/mcs; then
+ mcsdir=mcs
+else
+ mcsdir=../mcs
+fi
+
+mcs_topdir='$(top_srcdir)/'$mcsdir
+mcs_topdir_from_srcdir='$(top_builddir)/'$mcsdir
+
+AC_SUBST([mcs_topdir])
+AC_SUBST([mcs_topdir_from_srcdir])
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
@@ -65,8 +279,8 @@ fi
dnl for use on the build system
dnl pkg-config is stupid
-BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
-BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
+BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
+BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
AC_SUBST(BUILD_GLIB_CFLAGS)
AC_SUBST(BUILD_GLIB_LIBS)
@@ -88,8 +302,8 @@ GLIB_REQUIRED_VERSION=1.3.11
PKG_CHECK_MODULES(BASE_DEPENDENCIES, glib-2.0 >= $GLIB_REQUIRED_VERSION)
-GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
-GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
+GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
+GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
@@ -98,39 +312,200 @@ AC_SUBST(GLIB_LIBS)
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
-AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes")
-gc=auto
-AC_ARG_WITH(gc, [ --with-gc=boehm,none],[gc=$with_gc])
+if test x$platform_win32 = xyes; then
+ AC_MSG_CHECKING(for cygwin glib2-dev package)
+ if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
+ AC_MSG_RESULT(found)
+ AC_MSG_ERROR([Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure.])
+ else
+ AC_MSG_RESULT(not found, ok)
+ fi
+
+ AC_MSG_CHECKING(for broken gwin32.h)
+ glib_include=`$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`
+ if test -f $glib_include/glib/gwin32.h; then
+ if [ grep ftruncate $glib_include/glib/gwin32.h | grep -q define ]; then
+ AC_MSG_RESULT(failed)
+ hashmark='#'
+ AC_MSG_ERROR([Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure.])
+ fi
+ fi
+ AC_MSG_RESULT(ok)
+fi
+
+AC_ARG_WITH(gc, [ --with-gc=boehm,included,none],[gc=$with_gc],[gc=$gc_default])
+
+# Enable support for fast thread-local storage
+# Some systems have broken support, so we allow to disable it.
+AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage implementation],[],[with_tls=__thread])
+
+# Kept for compatibility
+AC_ARG_WITH(nptl, [ --with-nptl=yes,no deprecated, use --with-tls instead],[],[with_nptl=default])
+
+if test "x$with_nptl" != "xdefault"; then
+ if test "x$with_nptl" = "xyes"; then
+ AC_MSG_WARN([--with-nptl=yes is deprecated, use --with-tls=__thread option instead.])
+ with_tls=__thread
+ fi
+ if test "x$with_nptl" = "xno"; then
+ AC_MSG_WARN([--with-nptl=no is deprecated, use --with-tls=pthread option instead.])
+ with_tls=pthread
+ fi
+fi
+
+# Enable support for using sigaltstack for SIGSEGV and stack overflow handling
+# This does not work on some platforms (bug #55253)
+AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack],[],[with_sigaltstack=no])
+# assembly bundle support, see metadata/make-bundle.pl for more info
+AC_ARG_WITH(bundle, [ --with-bundle=bundle_template],[
+ BUNDLE_FILE=$with_bundle
+ AC_SUBST(BUNDLE_FILE)
+ AC_DEFINE(WITH_BUNDLE)
+],[with_bundle=no])
+AM_CONDITIONAL(WITH_BUNDLE, test x$with_bundle != xno)
+
+LIBGC_CFLAGS=
+LIBGC_LIBS=
+LIBGC_STATIC_LIBS=
+libgc_dir=
case "x$gc" in
- xboehm|xyes)
+ xboehm|xbohem|xyes)
+ AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
+ AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
+
if test "x$found_boehm" != "xyes"; then
- AC_MSG_ERROR("GC requested but libgc not found!")
+ AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
+ fi
+ if test "x$gc_headers" != "xyes"; then
+ AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
fi
AC_DEFINE(HAVE_BOEHM_GC)
AC_SUBST(HAVE_BOEHM_GC)
- LIBS="$LIBS -lgc"
+ LIBGC_LIBS="-lgc $libdl"
+ LIBGC_STATIC_LIBS="$LIBGC_LIBS"
+
+ # AC_CHECK_FUNCS does not work for some reason...
+ AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
+ if test "x$found_gcj_malloc" = "xyes"; then
+ AC_DEFINE(HAVE_GC_GCJ_MALLOC)
+ fi
+ AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
+ if test "x$found_gc_enable" = "xyes"; then
+ AC_DEFINE(HAVE_GC_ENABLE)
+ fi
;;
+
+ xincluded)
+ AC_CONFIG_SUBDIRS(libgc)
+
+ found_boehm=yes
+ gc_headers=yes
+ use_included_gc=yes
+ libgc_dir=libgc
+
+ LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
+ LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
+ LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
+
+ AC_DEFINE(HAVE_BOEHM_GC)
+ AC_SUBST(HAVE_BOEHM_GC)
+
+ AC_DEFINE(HAVE_GC_H)
+ AC_DEFINE(USE_INCLUDED_LIBGC)
+
+ # The included libgc contains GCJ support
+ AC_DEFINE(HAVE_GC_GCJ_MALLOC)
+ AC_DEFINE(HAVE_GC_ENABLE)
+ ;;
+
xnone)
AC_MSG_WARN("Compiling mono without GC.")
;;
*)
-dnl When the JIT works with libgc, use this chunk.
-dnl # If libgc was found, use it. Otherwise just warn.
- if test "x$found_boehm" != "xyes"; then
- AC_MSG_WARN("Compiling mono without GC.")
- else
- AC_DEFINE(HAVE_BOEHM_GC)
- AC_SUBST(HAVE_BOEHM_GC)
- LIBS="$LIBS -lgc"
- gc="boehm"
- fi
-dnl AC_MSG_WARN("Compiling mono without GC.")
+ AC_MSG_ERROR([Invalid argument to --with-gc.])
;;
esac
+
+# tell libgc/configure about what we want
+ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads"
+
+AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
+AC_SUBST(LIBGC_CFLAGS)
+AC_SUBST(LIBGC_LIBS)
+AC_SUBST(LIBGC_STATIC_LIBS)
+AC_SUBST(libgc_dir)
+
+dnl
+dnl End of libgc checks
+dnl
+
if test x$platform_win32 = xno; then
+
+ dnl ******************************************************************
+ dnl *** Checks for the IKVM JNI interface library ***
+ dnl ******************************************************************
+ AC_ARG_WITH(ikvm-jni, [ --with-ikvm-jni=yes,no build the IKVM JNI interface library],[with_ikvm_jni=$withval],[with_ikvm_jni=yes])
+ AC_ARG_WITH(jdk, [ --with-jdk=DIRECTORY Use JDK from DIRECTORY],[with_jdk_dir=$withval],[with_jdk_dir=])
+
+ ikvm_jni_dir=
+ if test x$with_ikvm_jni = xyes; then
+ AC_MSG_CHECKING([JDK headers])
+
+ if test x$with_jdk_dir = x; then
+ # Try JAVA_HOME variable
+ if test x$JAVA_HOME != x; then
+ with_jdk_dir=$JAVA_HOME
+ fi
+ fi
+
+ jdk_platform=
+ if test -d $with_jdk_dir/include; then
+ jdk_headers_found=yes
+
+ if test -d $with_jdk_dir/include/linux; then
+ jdk_platform=linux
+ else
+ if test -d $with_jdk_dir/include/solaris; then
+ jdk_platform=solaris
+ else
+ if test -f $with_jdk_dir/include/jni_md.h; then
+ # GNU Classpath sources
+ jdk_platform=
+ else
+ jdk_headers_found=no
+ fi
+ fi
+ fi
+ else
+ jdk_headers_found=no
+ fi
+
+ if test x$jdk_headers_found = xyes; then
+ AC_MSG_RESULT($with_jdk_dir/include $with_jdk_dir/include/$jdk_platform)
+ else
+ AC_MSG_RESULT(not found)
+ fi
+
+ if test x$jdk_headers_found = xyes; then
+ ikvm_jni_dir=ikvm-jni
+ IKVM_JNI_CFLAGS="-I$with_jdk_dir/include -I$with_jdk_dir/include/$jdk_platform"
+ fi
+ fi
+
+ AC_SUBST(ikvm_jni_dir)
+ AC_SUBST(IKVM_JNI_CFLAGS)
+
+ AC_CHECK_FUNCS(getgrgid_r)
+ AC_CHECK_FUNCS(getgrnam_r)
+ AC_CHECK_FUNCS(getpwnam_r)
+ AC_CHECK_FUNCS(getpwuid_r)
+ AC_CHECK_FUNCS(getresuid)
+ AC_CHECK_FUNCS(setresuid)
+ AC_CHECK_FUNCS(kqueue)
+
dnl ******************************************************************
dnl *** Check for large file support ***
dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
@@ -214,6 +589,21 @@ if test x$platform_win32 = xno; then
])
dnl *****************************
+ dnl *** Checks for SOL_IPV6 ***
+ dnl *****************************
+ AC_MSG_CHECKING(for SOL_IPV6)
+ AC_TRY_COMPILE([#include <netdb.h>], [
+ int level = SOL_IPV6;
+ ], [
+ # Yes, we have it...
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SOL_IPV6)
+ ], [
+ # We'll have to use getprotobyname
+ AC_MSG_RESULT(no)
+ ])
+
+ dnl *****************************
dnl *** Checks for SOL_TCP ***
dnl *****************************
AC_MSG_CHECKING(for SOL_TCP)
@@ -254,7 +644,33 @@ if test x$platform_win32 = xno; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STRUCT_IP_MREQN)
], [
- # We'll just have to use struct ip_mreq
+ # We'll just have to try and use struct ip_mreq
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(for struct ip_mreq)
+ AC_TRY_COMPILE([#include <netinet/in.h>], [
+ struct ip_mreq mreq;
+ mreq.imr_interface.s_addr = 0;
+ ], [
+ # Yes, we have it...
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_STRUCT_IP_MREQ)
+ ], [
+ # No multicast support
+ AC_MSG_RESULT(no)
+ ])
+ ])
+
+ dnl **********************************
+ dnl *** Check for gethostbyname2_r ***
+ dnl **********************************
+ AC_MSG_CHECKING(for gethostbyname2_r)
+ AC_TRY_LINK([#include <netdb.h>], [
+ gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
+ ], [
+ # Yes, we have it...
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GETHOSTBYNAME2_R)
+ ], [
AC_MSG_RESULT(no)
])
@@ -265,126 +681,434 @@ if test x$platform_win32 = xno; then
AC_CHECK_FUNCS(inet_pton inet_aton)
+ dnl ***********************************************
+ dnl *** Checks for size of sockaddr_un.sun_path ***
+ dnl ***********************************************
+ # AC_CHECK_SIZEOF can't cope with struct members :-(
+ AC_MSG_CHECKING(size of sockaddr_un.sun_path)
+ AC_CACHE_VAL(cv_mono_sizeof_sunpath,
+ [AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <stdio.h>
+ #include <sys/un.h>
+
+ int main(void) {
+ struct sockaddr_un sock_un;
+ FILE *f=fopen("conftestval", "w");
+ if(!f) exit(1);
+ fprintf(f, "%d\n", sizeof(sock_un.sun_path));
+ exit(0);
+ }
+ ], cv_mono_sizeof_sunpath=`cat conftestval`,
+ cv_mono_sizeof_sunpath=0,
+ cv_mono_sizeof_sunpath=0)])dnl
+ AC_MSG_RESULT($cv_mono_sizeof_sunpath)
+ AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
+
+ dnl *************************************
+ dnl *** Checks for zero length arrays ***
+ dnl *************************************
+ AC_MSG_CHECKING(whether $CC supports zero length arrays)
+ AC_TRY_COMPILE([
+ struct s {
+ int length;
+ char data [0];
+ };
+ ], [], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 0)
+ ], [
+ AC_MSG_RESULT(no)
+ AC_DEFINE_UNQUOTED(MONO_ZERO_ARRAY_LENGTH, 1)
+ ])
+
+ dnl *****************************
+ dnl *** Checks for libxnet ***
+ dnl *****************************
+ case "${host}" in
+ *solaris* )
+ AC_MSG_CHECKING(for Solaris XPG4 support)
+ if test -f /usr/lib/libxnet.so; then
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
+ CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
+ LIBS="$LIBS -lxnet"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ if test "$GCC" = "yes"; then
+ CFLAGS="$CFLAGS -Wno-char-subscripts"
+ fi
+ ;;
+ esac
+
dnl *****************************
dnl *** Checks for libpthread ***
dnl *****************************
- AC_SEARCH_LIBS(pthread_create, pthread c_r, [
- AM_CONDITIONAL(THREADS_PTHREAD, true)
- AC_DEFINE(HAVE_PTHREAD)
-
- # Need pthread_mutex_timedlock
- pthread_CFLAGS=""
- orig_CPPFLAGS=$CPPFLAGS
- # This is a gcc-specific error, but we already set
- # gcc-specific options in CFLAGS
- CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
- AC_MSG_CHECKING(for pthread_mutex_timedlock)
- AC_TRY_COMPILE([ #include <pthread.h>], [
- pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
- pthread_mutex_timedlock(&mut, NULL);
- ], [
- # Works!
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
- ], [
- AC_MSG_RESULT(no)
+# on FreeBSD -STABLE, the pthreads functions all reside in libc_r
+# and libpthread does not exist
+#
+ case "${host}" in
+ *-*-*freebsd4*)
+ AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
+ ;;
+ *)
+ AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
+ ;;
+ esac
+ AC_CHECK_HEADERS(pthread.h)
+ AC_CHECK_FUNCS(pthread_mutex_timedlock)
+ AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np)
+ AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
+ AC_TRY_COMPILE([ #include <pthread.h>], [
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ ], [
+ AC_MSG_RESULT(ok)
+ ], [
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
+ AC_DEFINE(USE_MONO_MUTEX)
+ ])
+ AC_CHECK_FUNCS(pthread_attr_setstacksize)
- # glibc requires -D_GNU_SOURCE before it will declare
- # this function
- AC_MSG_CHECKING(whether _GNU_SOURCE is needed for pthread_mutex_timedlock)
- CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
- AC_TRY_COMPILE([ #include <pthread.h>], [
- pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
- pthread_mutex_timedlock(&mut, NULL);
- ], [
+ dnl ***********************************
+ dnl *** Checks for working __thread ***
+ dnl ***********************************
+ AC_MSG_CHECKING(for working __thread)
+ if test "x$with_tls" != "x__thread"; then
+ AC_MSG_RESULT(disabled)
+ else
+ AC_TRY_RUN([
+ #include <pthread.h>
+
+ __thread int i;
+ static int res1, res2;
+
+ void thread_main (void *arg)
+ {
+ i = arg;
+ sleep (1);
+ if (arg == 1)
+ res1 = (i == arg);
+ else
+ res2 = (i == arg);
+ }
+
+ int main () {
+ pthread_t t1, t2;
+
+ i = 5;
+
+ pthread_create (&t1, NULL, thread_main, 1);
+ pthread_create (&t2, NULL, thread_main, 2);
+
+ pthread_join (t1, NULL);
+ pthread_join (t2, NULL);
+
+ return !(res1 + res2 == 2);
+ }
+ ], [
AC_MSG_RESULT(yes)
- pthread_CFLAGS="-D_GNU_SOURCE"
- AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
- ], [
+ ], [
AC_MSG_RESULT(no)
- dnl Add other variants here
- AC_MSG_WARN(Working around pthread_mutex_timedlock)
- ])
+ with_tls=pthread
])
- CPPFLAGS=$orig_CPPFLAGS
- CPPFLAGS="$CPPFLAGS $pthread_CFLAGS"
-
- # Need PTHREAD_MUTEX_RECURSIVE
- pthread_CFLAGS=""
- orig_CPPFLAGS=$CPPFLAGS
- # This is a gcc-specific error, but we already set
- # gcc-specific options in CFLAGS
- CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
- AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
- AC_TRY_COMPILE([ #include <pthread.h>], [
- pthread_mutexattr_t attr;
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ fi
+
+ dnl **************************************
+ dnl *** Checks for working sigaltstack ***
+ dnl **************************************
+ AC_MSG_CHECKING(for working sigaltstack)
+ if test "x$with_sigaltstack" != "xyes"; then
+ AC_MSG_RESULT(disabled)
+ else
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <signal.h>
+ #include <pthread.h>
+ #include <sys/wait.h>
+
+ static void
+ sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
+ {
+ exit (0);
+ }
+
+ static void *
+ loop (void *ignored)
+ {
+ char *ptr = NULL;
+
+ *ptr = 0;
+ return NULL;
+ }
+
+ static void
+ child ()
+ {
+ struct sigaction sa;
+ struct sigaltstack sas;
+ pthread_t id;
+ pthread_attr_t attr;
+
+ sa.sa_sigaction = sigsegv_signal_handler;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = SA_SIGINFO | SA_STACK;
+ if (sigaction (SIGSEGV, &sa, NULL) == -1) {
+ perror ("lala");
+ return;
+ }
+
+ sas.ss_sp = malloc (SIGSTKSZ);
+ sas.ss_size = SIGSTKSZ;
+ sas.ss_flags = SS_ONSTACK;
+ if (sigaltstack (&sas, NULL) == -1) {
+ perror ("lala");
+ return;
+ }
+
+ pthread_attr_init (&attr);
+ if (pthread_create(&id, &attr, loop, &attr) != 0) {
+ printf ("failed\n");
+ return;
+ }
+
+ sleep (100);
+ }
+
+ int
+ main ()
+ {
+ pid_t son;
+ int status;
+ int i;
+
+ son = fork ();
+ if (son == -1) {
+ return 1;
+ }
+
+ if (son == 0) {
+ child ();
+ return 0;
+ }
+
+ for (i = 0; i < 3; ++i) {
+ sleep (1);
+ waitpid (son, &status, WNOHANG);
+ if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
+ return 0;
+ }
+
+ kill (son, SIGKILL);
+ return 1;
+ }
+
], [
- # Works!
- AC_MSG_RESULT(ok)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_WORKING_SIGALTSTACK)
], [
- AC_MSG_RESULT(no)
-
- # glibc requires -D_GNU_SOURCE before it will declare
- # this macro
- AC_MSG_CHECKING(whether _GNU_SOURCE is needed for PTHREAD_MUTEX_RECURSIVE)
- CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
- AC_TRY_COMPILE([ #include <pthread.h>], [
- pthread_mutexattr_t attr;
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- ], [
- AC_MSG_RESULT(ok)
- pthread_CFLAGS="-D_GNU_SOURCE"
- ], [
+ with_sigaltstack=no
AC_MSG_RESULT(no)
- dnl Add other variants here
- AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
- AC_DEFINE(USE_MONO_MUTEX)
- ])
])
- CPPFLAGS=$orig_CPPFLAGS
- CPPFLAGS="$CPPFLAGS $pthread_CFLAGS"
- ], [
- AC_MSG_ERROR([libpthread is required on non-win32 hosts])
- ])
+ fi
dnl ********************************
dnl *** Checks for semaphore lib ***
dnl ********************************
- AC_CHECK_LIB(rt, sem_init, LIBS="$LIBS -lrt")
+ # 'Real Time' functions on Solaris
+ # posix4 on Solaris 2.6
+ # pthread (first!) on Linux
+ AC_SEARCH_LIBS(sem_init, pthread rt posix4)
dnl ********************************
dnl *** Checks for timezone stuff **
dnl ********************************
- AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
+ AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
AC_TRY_COMPILE([
#include <time.h>
- ], [
- timezone = 1;
- ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
- if test $ac_cv_var_timezone = yes; then
- AC_DEFINE(HAVE_TIMEZONE)
+ ], [
+ struct tm tm;
+ tm.tm_gmtoff = 1;
+ ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
+ if test $ac_cv_struct_tm_gmtoff = yes; then
+ AC_DEFINE(HAVE_TM_GMTOFF)
else
- AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
+ AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
AC_TRY_COMPILE([
#include <time.h>
- ], [
- struct tm tm;
- tm.tm_gmtoff = 1;
- ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
- if test $ac_cv_struct_tm_gmtoff = yes; then
- AC_DEFINE(HAVE_TM_GMTOFF)
+ ], [
+ timezone = 1;
+ ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
+ if test $ac_cv_var_timezone = yes; then
+ AC_DEFINE(HAVE_TIMEZONE)
else
AC_ERROR(unable to find a way to determine timezone)
fi
fi
+
+ dnl *********************************
+ dnl *** Checks for math functions ***
+ dnl *********************************
+ LIBS="$LIBS -lm";
+ AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
+ AC_TRY_LINK([#include <math.h>],
+ [ finite(0.0); ],
+ AC_DEFINE(HAVE_FINITE) AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no)))
+ AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
+ AC_TRY_LINK([#include <math.h>],
+ [ isfinite(0.0); ],
+ AC_DEFINE(HAVE_ISFINITE) AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no)))
+
+ dnl ****************************************************************
+ dnl *** Checks for working poll() (macosx defines it but doesn't ***
+ dnl *** have it in the library (duh)) ***
+ dnl ****************************************************************
+ AC_CHECK_FUNCS(poll)
+
+ dnl *************************
+ dnl *** Check for signbit ***
+ dnl *************************
+ AC_MSG_CHECKING(for signbit)
+ AC_TRY_LINK([#include <math.h>], [
+ int s = signbit(1.0);
+ ], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SIGNBIT)
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+
+ dnl *********************
+ dnl *** Check for AIO ***
+ dnl *********************
+ AC_MSG_CHECKING([for SIGEV_THREAD definition])
+ dnl Some systems (FreeBSD at least) may have aio_read
+ dnl but don't support/define SIGEV_THREAD.
+ AC_TRY_COMPILE([
+ #include <sys/signal.h>
+ ],[
+ int x = SIGEV_THREAD;
+ ],[
+ ac_cv_c_sigev_thread=yes
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ if test "$ac_cv_c_sigev_thread" = "yes" ; then
+ AC_CHECK_HEADERS(aio.h sys/aio.h)
+ AC_CHECK_LIB(rt, aio_read, [ LIBS="$LIBS -lrt" ],)
+ SIGVAL_PTR="undefined"
+ if test "$ac_cv_header_aio_h" = "yes" -o "$ac_cv_header_sys_aio_h" = "yes" ; then
+ AC_CHECK_MEMBER(union sigval.sigval_ptr,SIGVAL_PTR="sigval_ptr",, [
+ #include <sys/signal.h>
+ ])
+ AC_CHECK_MEMBER(union sigval.sival_ptr,SIGVAL_PTR="sival_ptr",, [
+ #include <sys/signal.h>
+ ])
+ if test "$SIGVAL_PTR" = "undefined" ; then
+ AC_MSG_ERROR([Unable to detect field name in 'union sigval'])
+ fi
+ fi
+ AC_DEFINE_UNQUOTED(SIGVAL_PTR,$SIGVAL_PTR,[Pointer field name in 'union sigval'])
+ fi
+
+ dnl **********************************
+ dnl *** Checks for MonoPosixHelper ***
+ dnl **********************************
+ AC_CHECK_FUNCS(posix_fadvise)
+ AC_CHECK_FUNCS(posix_fallocate)
+ AC_CHECK_FUNCS(fgetgrent)
+ AC_CHECK_FUNCS(fgetpwent)
+ AC_CHECK_FUNCS(fgetpwent)
+ AC_CHECK_HEADERS(sys/sendfile.h)
+ AC_CHECK_FUNCS(sendfile)
+ AC_CHECK_FUNCS(stime)
+ AC_CHECK_FUNCS(ttyname_r)
+ AC_CHECK_SIZEOF(size_t)
else
- AM_CONDITIONAL(THREADS_PTHREAD, false)
- # This is a kludge, we really ought to test for libws2_32, but
- # I can't make AC_CHECK_LIB link (the symbols seem to be mangled
- # with @num suffixes)
- LIBS="$LIBS -lws2_32"
- CFLAGS="$CFLAGS -mno-cygwin"
+ jdk_headers_found=no
+ AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
+ AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
+ AC_CHECK_LIB(ole32, main, LIBS="$LIBS -lole32", AC_ERROR(bad mingw install?))
+
+ dnl *********************************
+ dnl *** Check for struct ip_mreqn ***
+ dnl *********************************
+ AC_MSG_CHECKING(for struct ip_mreqn)
+ AC_TRY_COMPILE([#include <ws2tcpip.h>], [
+ struct ip_mreqn mreq;
+ mreq.imr_address.s_addr = 0;
+ ], [
+ # Yes, we have it...
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_STRUCT_IP_MREQN)
+ ], [
+ # We'll just have to try and use struct ip_mreq
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(for struct ip_mreq)
+ AC_TRY_COMPILE([#include <ws2tcpip.h>], [
+ struct ip_mreq mreq;
+ mreq.imr_interface.s_addr = 0;
+ ], [
+ # Yes, we have it...
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_STRUCT_IP_MREQ)
+ ], [
+ # No multicast support
+ AC_MSG_RESULT(no)
+ ])
+ ])
+fi
+
+dnl socklen_t check
+AC_MSG_CHECKING(for socklen_t)
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+ socklen_t foo;
+],[
+ac_cv_c_socklen_t=yes
+ AC_DEFINE(HAVE_SOCKLEN_T)
+ AC_MSG_RESULT(yes)
+],[
+ AC_MSG_RESULT(no)
+])
+
+AC_MSG_CHECKING(for array element initalizer support)
+AC_TRY_COMPILE([#include <sys/socket.h>], [
+ const int array[] = {[1] = 2,};
+], [
+ # Yes, we have it...
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ARRAY_ELEM_INIT,1,[Supports C99 array initialization])
+], [
+ # We'll have to use signals
+ AC_MSG_RESULT(no)
+])
+
+AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
+ # Simply calling trunc (0.0) is no good since gcc will optimize the call away
+ AC_TRY_LINK([#include <math.h>],
+ [ static void *p = &trunc; ],
+ [
+ AC_DEFINE(HAVE_TRUNC)
+ AC_MSG_RESULT(yes)
+ ac_cv_trunc=yes
+ ],
+ AC_MSG_RESULT(no)))
+
+if test "x$ac_cv_truncl" != "xyes"; then
+ AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL) LIBS="$LIBS -lsunmath"])
fi
dnl ****************************
@@ -405,7 +1129,7 @@ case "{$target}" in
dnl Win32 does not have /dev/random, they have their own method...
*-*-mingw*|*-*-cygwin*)
- ac_cv_have_dev_random = no
+ ac_cv_have_dev_random=no
;;
dnl Everywhere else, it's /dev/random
@@ -448,31 +1172,11 @@ if test "x$ac_cv_have_dev_random" = "xno" \
*** entropy collection in place, please contact <crichton@gimp.org> and
*** provide information about the system and how to access the random device.
***
-*** For those systems who lack a random device, EGD support is forthcoming.
+*** Otherwise you can install either egd or prngd and set the environment
+*** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
***]])
fi
-if test "x$cross_compiling" = "xno"; then
-# check for new iconv version
-AC_MSG_CHECKING(for new iconv)
-AC_CACHE_VAL(new_iconv,[
- AC_TRY_RUN([#include <stdio.h>
- #include <iconv.h>
-
- int main()
- {
- exit (iconv_open ("UTF-16le", "UTF-8") == (iconv_t)-1);
- }
- ],
- new_iconv=yes,new_iconv=)])
-if test -n "$new_iconv"; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_NEW_ICONV)
-else
- AC_MSG_RESULT(no)
-fi
-fi
-
AC_MSG_CHECKING([if inter-process shared handles are requested])
AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
AC_MSG_RESULT($try_shared_handles)
@@ -481,21 +1185,227 @@ if test "x$try_shared_handles" != "xyes"; then
AC_SUBST(DISABLE_SHARED_HANDLES)
fi
+#
+# ICU
+#
+ICU_CFLAGS=""
+ICU_LIBS=""
+enable_icu=no
+
+probe_icu=true
+AC_ARG_WITH(icu, [ --with-icu=yes/no],
+ if test x$with_icu = xno; then
+ probe_icu=false;
+ AC_MSG_RESULT(Will not probe for ICU)
+ fi
+)
+
+if $probe_icu; then
+ AC_PATH_PROG(ICU_CONFIG, icu-config, no)
+ if test "x$ICU_CONFIG" = "xno" -o ! -x "$ICU_CONFIG"; then
+ AC_MSG_WARN([Only invariant locale available; install ICU for I18N support])
+ enable_icu="no, if you want full i18n support download it from: http://oss.software.ibm.com/icu/index.html"
+ else
+ enable_icu="yes. Version: `$ICU_CONFIG --version`"
+ AC_DEFINE(HAVE_ICU)
+ ICU_CFLAGS=`$ICU_CONFIG --cppflags`
+ ICU_LIBS=`$ICU_CONFIG --ldflags`
+ fi
+fi
+AC_SUBST(ICU_CFLAGS)
+AC_SUBST(ICU_LIBS)
+
TARGET="unknown"
ACCESS_UNALIGNED="yes"
+JIT_SUPPORTED=no
+LIBC="libc.so.6"
+INTL="libc.so.6"
+
+jit_wanted=false
+case "$host" in
+# mips-sgi-irix5.* | mips-sgi-irix6.*)
+# TARGET=MIPS;
+# ACCESS_UNALIGNED="no"
+# ;;
+ i*86-*-*)
+ TARGET=X86;
+ arch_target=x86;
+ JIT_SUPPORTED=yes
+ jit_wanted=true
+ ;;
+ x86_64-*-* | amd64-*-*)
+ TARGET=AMD64;
+ arch_target=amd64;
+ JIT_SUPPORTED=yes
+ jit_wanted=true
+ ;;
+ sparc*-*-*)
+ if test "x$ac_cv_sizeof_void_p" = "x8"; then
+ TARGET=SPARC64
+ else
+ TARGET=SPARC
+ fi
+ arch_target=sparc;
+ JIT_SUPPORTED=yes
+ ACCESS_UNALIGNED="no"
+ LIBC="libc.so"
+ INTL="libintl.so"
+ jit_wanted=true
+ ;;
+ alpha*-*-linux* | alpha*-*-osf*)
+ TARGET=ALPHA;
+ ACCESS_UNALIGNED="no"
+ JIT_SUPPORTED=no
+ arch_target=alpha;
+ ;;
+# ia64-*-linux* | ia64-*-hpux*)
+# TARGET=IA64;
+# arch_target=ia64;
+# JIT_SUPPORTED=no;
+# ACCESS_UNALIGNED="no";
+# case "$host_os" in
+# linux*) LIBC="libc.so.6.1";;
+# hpux*) LIBC="libc.so.1";;
+# esac
+# ;;
+# m68k-*-linux*)
+# TARGET=M68K
+# ;;
+ hppa2.0w-hp-hpux11.00 | hppa64-hp-hpux11.00)
+ TARGET=HPPA;
+ arch_target=hppa;
+ LIBC="libc.sl"
+ ACCESS_UNALIGNED="no"
+ ;;
+ hppa*linux*)
+ TARGET=HPPA;
+ arch_target=hppa;
+ ACCESS_UNALIGNED="no"
+ ;;
+ macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | \
+ powerpc-*-sysv* | powerpc-*-darwin*)
+ TARGET=POWERPC;
+ arch_target=ppc;
+ JIT_SUPPORTED=yes
+ jit_wanted=true
+ ;;
+ arm-*-linux-* | armv4l-*-linux-*)
+ TARGET=ARM;
+ arch_target=arm;
+ ACCESS_UNALIGNED="no"
+ ;;
+ s390-*-linux*)
+ TARGET=S390;
+ arch_target=s390;
+ ACCESS_UNALIGNED="no"
+ JIT_SUPPORTED=yes
+ ;;
+ s390x-*-linux*)
+ TARGET=S390x;
+ arch_target=s390x;
+ ACCESS_UNALIGNED="no"
+ JIT_SUPPORTED=yes
+ ;;
+esac
+
+AC_ARG_WITH(jit, [ --with-jit=yes,no If you want to build scripts that default to the JIT],[
+ if test x$withval = xyes; then
+ jit_wanted=true
+ else
+ jit_wanted=false
+ fi
+])
+
+USEJIT=false
+if test x$JIT_SUPPORTED = xyes; then
+ if $jit_wanted; then
+ USEJIT=true
+ jit_status="Building and using the JIT"
+ else
+ jit_status="Building the JIT, defaulting to the interpreter"
+ fi
+else
+ jit_status="interpreter"
+fi
+
+AM_CONDITIONAL(USE_JIT, test x$USEJIT = xtrue)
+
+libsuffix=".so"
+
case "$host" in
-#mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; ACCESS_UNALIGNED="no";;
-i*86-*-*) TARGET=X86; arch_target=x86;;
-sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";;
-#alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
-#m68k-*-linux*) TARGET=M68K;;
-powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
-arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";;
+ powerpc-*-darwin*)
+ libsuffix=".dylib"
+ LIBC="libc.dylib"
+ INTL="libintl.dylib"
+ ;;
+ *-*-*netbsd*)
+ LIBC="libc.so.12"
+ INTL="libintl.so.0"
+ ;;
+ *-*-*freebsd*)
+ LIBC="libc.so"
+ INTL="libintl.so"
+ ;;
+ *-*-*openbsd*)
+ LIBC="libc.so"
+ INTL="libintl.so"
+ ;;
esac
+AC_SUBST(libsuffix)
+
+if test "x$TARGET" != "xAMD64"; then
+ # valgrind headers don't compile under x86-64
+ AC_CHECK_HEADERS(valgrind/memcheck.h)
+fi
+
+if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
+ if test "x$with_tls" = "x__thread"; then
+ #
+ # On some linux distributions, TLS works in executables, but linking
+ # against a shared library containing TLS fails with:
+ # undefined reference to `__tls_get_addr'
+ #
+ rm -f conftest.c conftest.so conftest
+ echo "static __thread int foo; void main () { foo = 5; }" > conftest.c
+ gcc -fPIC --shared -o conftest.so conftest.c > /dev/null 2>&1
+ gcc -o conftest conftest.so > /dev/null 2>&1
+ if test ! -f conftest; then
+ AC_MSG_WARN([Disabling usage of __thread.]);
+ with_tls=pthread
+ fi
+ rm -f conftest.c conftest.so conftest
+ fi
+fi
+
+if test "x$with_tls" = "x__thread"; then
+ AC_DEFINE(HAVE_KW_THREAD)
+ # Pass the information to libgc
+ CPPFLAGS="$CPPFLAGS -DUSE_COMPILER_TLS"
+ export CPPFLAGS
+fi
+
+if test ${TARGET} = ARM; then
+ dnl ******************************************
+ dnl *** Check to see what FPU is available ***
+ dnl ******************************************
+ AC_MSG_CHECKING(which FPU to use)
+
+ AC_TRY_COMPILE([], [
+ __asm__ ("ldfd f0, [r0]");
+ ], fpu=FPA, [
+ AC_TRY_COMPILE([], [
+ __asm__ ("fldd d0, [r0]");
+ ], fpu=VFP, fpu=NONE)
+ ])
+
+ AC_MSG_RESULT($fpu)
+ CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu"
+ unset fpu
+fi
if test ${TARGET} = unknown; then
- CFLAGS="$CFLAGS -DNO_PORT"
+ CPPFLAGS="$CPPFLAGS -DNO_PORT"
AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
fi
@@ -503,20 +1413,45 @@ if test ${ACCESS_UNALIGNED} = no; then
CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
fi
+PREVIEW=no
+AC_ARG_WITH(preview, [ --with-preview=yes,no If you want to install the 2.0 FX preview],[
+ if test x$with_preview = xyes; then
+ PREVIEW=yes
+ fi
+])
+
+AM_CONDITIONAL(INSTALL_2_0, test x$PREVIEW = xyes)
+
AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
+AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
AM_CONDITIONAL(X86, test x$TARGET = xX86)
+AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
+AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
+AM_CONDITIONAL(S390, test x$TARGET = xS390)
+AM_CONDITIONAL(S390x, test x$TARGET = xS390x)
+AM_CONDITIONAL(HPPA, test x$TARGET = xHPPA)
+
+AM_CONDITIONAL(JIT_SUPPORTED, test x$JIT_SUPPORTED = xyes)
+AM_CONDITIONAL(INCLUDED_LIBGC, test x$gc = xincluded)
+
+AC_SUBST(LIBC)
+AC_SUBST(INTL)
AC_SUBST(arch_target)
AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
AC_OUTPUT([
Makefile
+mint.pc
+mono.pc
mono/Makefile
mono/utils/Makefile
mono/metadata/Makefile
@@ -527,26 +1462,51 @@ mono/os/Makefile
mono/os/win32/Makefile
mono/os/unix/Makefile
mono/arch/x86/Makefile
+mono/arch/amd64/Makefile
+mono/arch/hppa/Makefile
mono/arch/ppc/Makefile
mono/arch/sparc/Makefile
+mono/arch/s390/Makefile
+mono/arch/s390x/Makefile
mono/arch/arm/Makefile
+mono/arch/alpha/Makefile
mono/interpreter/Makefile
mono/tests/Makefile
+mono/tests/tests-config
mono/benchmark/Makefile
mono/monoburg/Makefile
mono/monograph/Makefile
-mono/jit/Makefile
mono/io-layer/Makefile
mono/handles/Makefile
+mono/mini/Makefile
+mono/profiler/Makefile
+ikvm-jni/Makefile
runtime/Makefile
+runtime/net_1_1/Makefile
+runtime/net_2_0/Makefile
scripts/Makefile
man/Makefile
-doc/Makefile
+web/Makefile
docs/Makefile
+data/Makefile
+data/net_1_1/Makefile
+data/net_2_0/Makefile
+samples/Makefile
+support/Makefile
+data/config
+mono.spec
+tools/Makefile
+tools/locale-builder/Makefile
])
echo "
-
- GC: $gc
+ mcs source: $mcs_topdir
+ GC: $gc
+ ICU: $enable_icu
+ TLS: $with_tls
+ SIGALTSTACK: $with_sigaltstack
+ Engine: $jit_status
+ 2.0 Alpha: $PREVIEW
+ JNI support: $jdk_headers_found
"
diff --git a/data/.cvsignore b/data/.cvsignore
new file mode 100644
index 00000000000..a0529befba9
--- /dev/null
+++ b/data/.cvsignore
@@ -0,0 +1,4 @@
+Makefile.in
+Makefile
+config
+.cvsignore
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 00000000000..ee78c3f66a9
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,10 @@
+SUBDIRS = net_1_1 net_2_0
+
+monodir = $(sysconfdir)/mono
+
+EXTRA_DIST = config.in \
+ browscap.ini
+
+mono_DATA = config \
+ browscap.ini
+
diff --git a/data/browscap.ini b/data/browscap.ini
new file mode 100644
index 00000000000..81a0321cc02
--- /dev/null
+++ b/data/browscap.ini
@@ -0,0 +1,12301 @@
+;;; Provided courtesy of http://www.GaryKeith.com
+;;; Created on October 24, 2004 at 7:22:55 PM GMT
+
+[GJK_Browscap_Version]
+browser=Browscap Version
+version=2004-10-24 19:22:55 GMT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Alta Vista
+
+[Alta Vista]
+browser=Alta Vista
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Scooter/*]
+parent=Alta Vista
+browser=AltaVista
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ask Jeeves/Teoma
+
+[Ask Jeeves/Teoma]
+browser=Ask Jeeves/Teoma
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/2.0 (compatible; Ask Jeeves)]
+parent=Ask Jeeves/Teoma
+
+[Mozilla/2.0 (compatible; Ask Jeeves/Teoma)]
+parent=Ask Jeeves/Teoma
+browser=Ask Jeeves/Teoma
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Boitho
+
+[Boitho]
+browser=Boitho
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[boitho.com-dc/*]
+parent=Boitho
+
+[boitho.com-robot/*]
+parent=Boitho
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exalead
+
+[Exalead]
+browser=Exalead
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Exalead NG/*]
+parent=Exalead
+browser=Exalead
+
+[NG/*]
+parent=Exalead
+browser=NG
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Excite
+
+[Excite]
+browser=Excite
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.0 (compatible; * sureseeker.com*)]
+parent=Excite
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; fantomas
+
+[fantomas]
+browser=fantomas
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.0 (cloakBrowser)]
+parent=fantomas
+
+[Mozilla/4.0 (fantomas shadowMaker Browser)]
+parent=fantomas
+
+[Mozilla/4.0 (fantomBrowser)]
+parent=fantomas
+
+[Mozilla/4.0 (fantomCrew Browser)]
+parent=fantomas
+
+[Mozilla/4.0 (stealthBrowser)]
+parent=fantomas
+
+[multiBlocker browser*]
+parent=fantomas
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Fast/AllTheWeb
+
+[Fast/AllTheWeb]
+browser=Fast/AllTheWeb
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[FAST Enterprise Crawler*]
+parent=Fast/AllTheWeb
+browser=FAST Enterprise Crawler
+
+[Fast PartnerSite Crawler*]
+parent=Fast/AllTheWeb
+browser=Fast PartnerSite Crawler
+
+[FAST-WebCrawler/* (*crawler at fast dot no;*)]
+parent=Fast/AllTheWeb
+
+[FAST-WebCrawler/*/FirstPage (*crawler at fast dot no;*)]
+parent=Fast/AllTheWeb
+
+[FAST-WebCrawler/*/Fresh (*crawler at fast dot no;*)]
+parent=Fast/AllTheWeb
+
+[FAST-WebCrawler/*?Multimedia*]
+parent=Fast/AllTheWeb
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Galaxy
+
+[Galaxy]
+browser=Galaxy
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[GalaxyBot/*0 (http://www.galaxy.com/galaxybot.html)]
+parent=Galaxy
+
+[Mozilla/* (compatible; MSIE *; www.galaxy.com;*)]
+parent=Galaxy
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Gigablast
+
+[Gigablast]
+browser=Gigablast
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Gigabot/*]
+parent=Gigablast
+
+[Jetbot/*]
+parent=Gigablast
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Google
+
+[Google]
+browser=Google
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Googlebot-Image/*]
+parent=Google
+browser=Googlebot-Image
+
+[Googlebot/2.*]
+parent=Google
+version=2.1
+majorver=2
+minorver=1
+
+[Googlebot/Test*]
+parent=Google
+browser=Googlebot/Test
+
+[Mediapartners-Google/*]
+parent=Google
+browser=Mediapartners-Google
+
+[Mozilla/5.0 (compatible; Googlebot/*; ?http://www.google.com/bot.html)]
+parent=Google
+browser=Googlebot
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Inktomi
+
+[Inktomi]
+browser=Inktomi
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.05*]
+parent=Inktomi
+
+[Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)]
+parent=Inktomi
+
+[Mozilla/5.0 (Slurp/cat; slurp@inktomi.com; http://www.inktomi.com/slurp.html)]
+parent=Inktomi
+
+[Mozilla/5.0 (Slurp/si; slurp@inktomi.com; http://www.inktomi.com/slurp.html)]
+parent=Inktomi
+
+[slurp]
+parent=Inktomi
+
+[YahooSeeker/* (compatible; Mozilla 4.0; MSIE 5.5; http://help.yahoo.com/help/us/shop/merchant/)]
+parent=Inktomi
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Lycos
+
+[Lycos]
+browser=Lycos
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Lycos*]
+parent=Lycos
+browser=Lycos
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MSN
+
+[MSN]
+browser=MSN
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[MicrosoftPrototypeCrawler*]
+parent=MSN
+
+[msnbot/* (?http://search.msn.com/msnbot.htm)]
+parent=MSN
+
+[MSNBOT/* (http://search.msn.com/msnbot.htm)]
+parent=MSN
+
+[MSNPTC/*]
+parent=MSN
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Naver
+
+[Naver]
+browser=Naver
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[*(NaverRobot)/*]
+parent=Naver
+browser=Naver Spoof
+stripper=True
+
+[NaverBot-* (NHN Corp*naver.com)]
+parent=Naver
+
+[NaverBot_dloader/*]
+parent=Naver
+browser=Spoofed
+stripper=True
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[Nutch]
+browser=Nutch
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[NutchCVS/*]
+parent=Nutch
+
+[NutchOrg/*]
+parent=Nutch
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Openfind
+
+[Openfind]
+browser=Openfind
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Gaisbot/*]
+parent=Openfind
+
+[Openbot/*]
+parent=Openfind
+
+[Openfind data gatherer*]
+parent=Openfind
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Relevare
+
+[Relevare]
+browser=Relevare
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[bumblebee/*]
+parent=Relevare
+browser=Relevare
+
+[Bumblebee@relevare.com]
+parent=Relevare
+
+[Zao/*]
+parent=Research Projects
+browser=Zao
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Search Engines
+
+[Search Engines]
+browser=Search Engines
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Abacho*]
+parent=Search Engines
+browser=Abacho
+
+[acontbot]
+parent=Search Engines
+browser=acontbot
+
+[Baiduspider*]
+parent=Search Engines
+browser=BaiDu
+
+[CipinetBot (http://www.cipinet.com/bot.html)]
+parent=Search Engines
+browser=CipinetBot
+
+[DiamondBot]
+parent=Search Engines
+browser=DiamondBot
+stripper=True
+
+[Eule?Robot*]
+parent=Search Engines
+browser=Eule-Robot
+
+[exactseek-pagereaper-* (crawler@exactseek.com)]
+parent=Search Engines
+browser=ExactSeek
+
+[Faxobot/*]
+parent=Search Engines
+browser=Faxo
+stripper=True
+
+[FirstGov.gov Search - POC:firstgov.webmasters@gsa.gov]
+parent=Search Engines
+browser=FirstGov.gov Search
+
+[HenryTheMiragoRobot*]
+parent=Search Engines
+browser=Mirago
+
+[Iltrovatore-?etaccio/*]
+parent=Search Engines
+browser=Iltrovatore-Setaccio
+
+[Infoseek SideWinder/*]
+parent=Search Engines
+browser=Infoseek
+
+[LapozzBot/*]
+parent=Search Engines
+browser=LapozzBot
+
+[Mackster (*)]
+parent=Search Engines
+browser=Mackster
+
+[Mozilla/3.0 (compatible; NetMind-Minder*]
+parent=Search Engines
+browser=NetMind-Minder
+
+[Mozilla/4.0 (compatible; Arachmo)]
+parent=Search Engines
+browser=Arachmo
+
+[Mozilla/4.0 (compatible; MSIE *; Windows NT; Girafabot; girafabot at girafa dot com; http://www.girafa.com)]
+parent=Search Engines
+browser=Girafabot
+
+[Mozilla/4.0 (compatible; MSIE 5.0; www.galaxy.com;*)]
+parent=Search Engines
+browser=Galaxy/LOGIKA Search Engine
+
+[Mozilla/4.0 (compatible; MSIE 5.00; Windows 98]
+parent=Search Engines
+browser=directNIC
+stripper=True
+
+[Mozilla/4.7 (compatible; WhizBang; http://www.whizbang.com/crawler)]
+parent=Search Engines
+browser=WhizBang
+
+[Mozilla/4.7 *(Exabot@exava.com)]
+parent=Search Engines
+browser=Exava
+
+[Mozilla/5.0 (compatible; CXL-FatAssANT (El Robeiro); http://www.conexcol.com/FatAssANT/; ANTid:alfa; v. 0.5.1)]
+parent=Search Engines
+browser=Conexcol.com
+
+[NationalDirectory-*Spider/*]
+parent=Search Engines
+browser=National Directory
+
+[NuSearch Spider*]
+parent=Search Engines
+browser=nuSearch
+stripper=True
+
+[Ocelli/* (http://www.globalspec.com)]
+parent=Search Engines
+browser=GlobalSpec
+
+[PlantyNet*]
+parent=Search Engines
+browser=PlantyNet_WebRobot
+stripper=True
+
+[Pompos/*]
+parent=Search Engines
+browser=Pompos
+
+[Popdexter/*]
+parent=Search Engines
+browser=Popdex
+stripper=True
+
+[QweeryBot*]
+parent=Search Engines
+browser=QweeryBot
+css=0
+
+[search.ch*]
+parent=Search Engines
+browser=Swiss Search Engine
+
+[SearchSpider/*]
+parent=Search Engines
+browser=SearchSpider.com
+
+[Seekbot/*]
+parent=Search Engines
+browser=Seekbot
+
+[Sensis.com.au Web Crawler (search_comments\at\sensis\dot\com\dot\au)]
+parent=Search Engines
+browser=Sensis
+
+[Speedy?Spider (http://www.entireweb.com)]
+parent=Search Engines
+browser=entireweb.com
+
+[Spinne/*]
+parent=Search Engines
+browser=Spinne
+
+[StackRambler/*]
+parent=Search Engines
+browser=StackRambler
+
+[SynoBot]
+parent=Search Engines
+browser=SynoBot
+stripper=True
+
+[Szukacz/*]
+parent=Search Engines
+browser=Szukacz
+
+[Tkensaku/* (http://www.tkensaku.com/q.html)]
+parent=Search Engines
+browser=Tkensaku
+
+[URL Spider Pro/*]
+parent=Search Engines
+browser=URL Spider Pro
+stripper=True
+
+[URL Spider SQL*]
+parent=Search Engines
+browser=Innerprise Enterprise Search
+stripper=True
+
+[WebFindBot(http://www.web-find.com)]
+parent=Search Engines
+browser=WebFindBot
+
+[Wotbox/*]
+parent=Search Engines
+browser=Wotbox
+
+[Yandex/*]
+parent=Search Engines
+browser=Yandex
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Singing Fish
+
+[Singing Fish]
+browser=Singing Fish
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=True
+aol=True
+beta=True
+win16=True
+crawler=True
+stripper=True
+wap=True
+netclr=True
+
+[asterias/*]
+parent=Singing Fish
+
+[Mozilla/* (compatible; *Asterias Crawler v*)*]
+parent=Singing Fish
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Thunderstone
+
+[Thunderstone]
+browser=Thunderstone
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[Mozilla/4.0 (compatible; T-H-U-N-D-E-R-S-T-O-N-E)]
+parent=Thunderstone
+
+[T-H-U-N-D-E-R-S-T-O-N-E]
+parent=Thunderstone
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; wise-guys.nl
+
+[wise-guys.nl]
+browser=wise-guys.nl
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Bilbo]
+parent=wise-guys.nl
+
+[Mozilla/5.0 (compatible; Vagabondo/*; webcrawler at wise-guys dot nl; http://webagent.wise-guys.nl/)]
+parent=wise-guys.nl
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WiseNut
+
+[WiseNut]
+browser=WiseNut
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.0 compatible ZyBorg/* (*)]
+parent=WiseNut
+
+[Mozilla/4.0 compatible ZyBorg/* Dead Link Checker (*)]
+parent=WiseNut
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Yahoo
+
+[Yahoo]
+browser=Yahoo
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Yahoo-MMCrawler/*]
+parent=Yahoo
+browser=Yahoo-MMCrawler
+
+[Yahoo-VerticalCrawler-FormerWebCrawler/*]
+parent=Yahoo
+browser=Yahoo-VerticalCrawler-FormerWebCrawler
+
+[YahooSeeker/* (*http://help.yahoo.com/help/us/shop/merchant/)]
+parent=Yahoo
+browser=YahooSeeker-Merchant
+
+[YahooSeeker/* (*http://search.yahoo.com/yahooseeker.html)]
+parent=Yahoo
+browser=YahooSeeker
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Banned
+
+[Banned]
+browser=Banned
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=True
+wap=False
+netclr=False
+
+[AvantGo]
+parent=Banned
+browser=AvantGo
+
+[Mozilla/4.0 (fuck off; compatible; not MSIE 6.0; not Windows NT 5.1)]
+parent=Banned
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Browscap.ini Version Checkers
+
+[Browscap.ini Version Checkers]
+browser=Various
+css=0
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[amzn_assoc]
+parent=Browscap.ini Version Checkers
+stripper=True
+
+[Automated Browscap.ini Updater. Gary contact me at serge@skycomp.ca with problems.]
+parent=Browscap.ini Version Checkers
+browser=Automated Browscap.ini Updater
+
+[Browser Capabilities Project AutoDownloader; created by Tom Kelleher Consulting, Inc. (tkelleher.com); used with special permission from Gary Joel Keith; uses Microsoft's WinHTTP component]
+parent=Browscap.ini Version Checkers
+browser=TKC AutoDownloader
+
+[Mono Browser Capabilities Updater*]
+parent=Browscap.ini Version Checkers
+browser=Mono Browser Capabilities Updater
+stripper=True
+
+[UpdateBrowscap*]
+parent=Browscap.ini Version Checkers
+browser=UpdateBrowscap
+
+[Woko*]
+parent=Browscap.ini Version Checkers
+browser=Woko robot
+stripper=True
+
+[www.substancia.com AutoHTTPAgent (ver 1.0)]
+parent=Browscap.ini Version Checkers
+browser=Substncia
+version=1.0
+majorver=1
+minorver=0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright & Plagiarism
+
+[Copyright & Plagiarism]
+browser=Copyright & Plagiarism
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[CopyRightCheck*]
+parent=Copyright & Plagiarism
+browser=CopyRightCheck
+
+[FairAd Client*]
+parent=Copyright & Plagiarism
+browser=FairAd Client
+
+[IPiumBot laurion(dot)com]
+parent=Copyright & Plagiarism
+browser=IPiumBot
+
+[oBot]
+parent=Copyright & Plagiarism
+browser=oBot
+
+[SlySearch/*]
+parent=Copyright & Plagiarism
+browser=SlySearch
+
+[TurnitinBot/*]
+parent=Copyright & Plagiarism
+browser=TurnitinBot
+
+[Butch__*]
+parent=Dillo
+browser=Butch
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Download Managers
+
+[Download Managers]
+browser=Download Managers
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[BitBeamer/*]
+parent=Download Managers
+browser=BitBeamer
+
+[DA *]
+parent=Download Managers
+browser=Download Accelerator
+
+[Download Demon*]
+parent=Download Managers
+browser=Download Demon
+
+[Download Express*]
+parent=Download Managers
+browser=Download Express
+
+[Download Master*]
+parent=Download Managers
+browser=Download Master
+
+[Download Ninja*]
+parent=Download Managers
+browser=Download Ninja
+
+[Download Wonder*]
+parent=Download Managers
+browser=Download Wonder
+
+[DownloadSession*]
+parent=Download Managers
+browser=DownloadSession
+
+[EasyDL/*]
+parent=Download Managers
+browser=EasyDL
+
+[FlashGet]
+parent=Download Managers
+browser=FlashGet
+
+[FreshDownload/*]
+parent=Download Managers
+browser=FreshDownload
+
+[GetRight/*]
+parent=Download Managers
+browser=GetRight
+
+[GetSmart/*]
+parent=Download Managers
+browser=GetSmart
+
+[Go!Zilla*]
+parent=Download Managers
+browser=GoZilla
+
+[Gozilla/*]
+parent=Download Managers
+browser=Gozilla
+
+[Internet Ninja*]
+parent=Download Managers
+browser=Internet Ninja
+
+[Kontiki Client*]
+parent=Download Managers
+browser=Kontiki Client
+
+[LightningDownload/*]
+parent=Download Managers
+browser=LightningDownload
+
+[LMQueueBot/*]
+parent=Download Managers
+browser=LMQueueBot
+
+[MetaProducts Download Express/*]
+parent=Download Managers
+browser=Download Express
+
+[Myzilla]
+parent=Download Managers
+browser=Myzilla
+
+[Net Vampire/*]
+parent=Download Managers
+browser=Net Vampire
+
+[Net_Vampire*]
+parent=Download Managers
+browser=Net_Vampire
+
+[NetAnts*]
+parent=Download Managers
+browser=NetAnts
+
+[NetPumper*]
+parent=Download Managers
+browser=NetPumper
+
+[NetSucker*]
+parent=Download Managers
+browser=NetSucker
+
+[NetZip Downloader*]
+parent=Download Managers
+browser=NetZip Downloader
+
+[NexTools WebAgent*]
+parent=Download Managers
+browser=NexTools WebAgent
+
+[P3P Client]
+parent=Download Managers
+browser=P3P Client
+
+[PageDown*]
+parent=Download Managers
+browser=PageDown
+
+[PicaLoader*]
+parent=Download Managers
+browser=PicaLoader
+
+[Prozilla*]
+parent=Download Managers
+browser=Prozilla
+
+[RealDownload/*]
+parent=Download Managers
+browser=RealDownload
+
+[sEasyDL/*]
+parent=Download Managers
+browser=EasyDL
+
+[SmartDownload/*]
+parent=Download Managers
+browser=SmartDownload
+
+[SpeedDownload/*]
+parent=Download Managers
+browser=Speed Download
+
+[Star Downloader*]
+parent=Download Managers
+browser=Star Downloader
+
+[SuperBot/*]
+parent=Download Managers
+browser=SuperBot
+
+[WebZIP*]
+parent=Download Managers
+browser=WebZIP
+
+[Wget*]
+parent=Download Managers
+browser=Wget
+
+[WinTools]
+parent=Download Managers
+browser=WinTools
+
+[Xaldon WebSpider*]
+parent=Download Managers
+browser=Xaldon WebSpider
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; E-Mail Harvesters
+
+[E-Mail Harvesters]
+browser=E-Mail Harvesters
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[*E-Mail Address Extractor*]
+parent=E-Mail Harvesters
+browser=E-Mail Address Extractor
+
+[*Larbin*]
+parent=E-Mail Harvesters
+browser=Larbin
+
+[*www4mail/*]
+parent=E-Mail Harvesters
+browser=www4mail
+
+[CherryPicker*/*]
+parent=E-Mail Harvesters
+browser=CherryPickerElite
+
+[Chilkat/*]
+parent=E-Mail Harvesters
+browser=Chilkat
+
+[ContactBot/*]
+parent=E-Mail Harvesters
+browser=ContactBot
+
+[eCatch*]
+parent=E-Mail Harvesters
+browser=eCatch
+
+[EmailCollector*]
+parent=E-Mail Harvesters
+browser=E-Mail Collector
+
+[EMAILsearcher]
+parent=E-Mail Harvesters
+browser=EMAILsearcher
+
+[EmailSiphon*]
+parent=E-Mail Harvesters
+browser=E-Mail Siphon
+
+[EmailWolf*]
+parent=E-Mail Harvesters
+browser=EMailWolf
+
+[Epsilon SoftWorks' MailMunky]
+parent=E-Mail Harvesters
+browser=MailMunky
+
+[ExtractorPro*]
+parent=E-Mail Harvesters
+browser=ExtractorPro
+
+[Franklin Locator*]
+parent=E-Mail Harvesters
+browser=Franklin Locator
+
+[Green Research, Inc.]
+parent=E-Mail Harvesters
+browser=Green Research, Inc.
+
+[Netprospector*]
+parent=E-Mail Harvesters
+browser=Netprospector
+
+[ProWebWalker*]
+parent=E-Mail Harvesters
+browser=ProWebWalker
+
+[WebEnhancer*]
+parent=E-Mail Harvesters
+browser=WebEnhancer
+
+[WebMiner*]
+parent=E-Mail Harvesters
+browser=WebMiner
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; General Crawlers
+
+[General Crawlers]
+browser=General Crawlers
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[(HTML Validator http://www.searchengineworld.com/validator/)]
+parent=General Crawlers
+browser=Search Engine World HTML Validator
+
+[AaronCarter/*]
+parent=General Crawlers
+browser=AaronCarter
+
+[Aport]
+parent=General Crawlers
+browser=Aport
+
+[Art-Online.com*]
+parent=General Crawlers
+browser=Art-Online.com
+
+[ATA-Translation-Service]
+parent=General Crawlers
+browser=ATA-Translation-Service
+
+[Best Whois (http://www.bestwhois.net/)]
+parent=General Crawlers
+browser=Best Whois
+
+[Botswana*]
+parent=General Crawlers
+browser=Botswana
+
+[BravoBrian BStop*]
+parent=General Crawlers
+browser=BravoBrian BStop
+
+[CacheabilityEngine/*]
+parent=General Crawlers
+browser=CacheabilityEngine
+
+[CerberianDrtrs/*]
+parent=General Crawlers
+browser=Cerberian
+
+[CFM-SearchBot(http://www.cfm-search.com)]
+parent=General Crawlers
+browser=CFM-SearchBot
+
+[CJNetworkQuality; http://www.cj.com/networkquality]
+parent=General Crawlers
+browser=CJNetworkQuality
+frames=True
+tables=True
+cookies=True
+
+[Comodo HTTP(S) Crawler*]
+parent=General Crawlers
+browser=Comodo HTTP Crawler
+
+[Computer_and_Automation_Research_Institute_Crawler]
+parent=General Crawlers
+browser=Computer_and_Automation_Research_Institu
+
+[CrawlConvera*]
+parent=General Crawlers
+browser=CrawlConvera
+
+[CSHttpClient/*]
+parent=General Crawlers
+browser=CSHttpClient
+
+[Cynthia 1.0]
+parent=General Crawlers
+browser=Cynthia
+version=1.0
+majorver=1
+minorver=0
+
+[Diff-Engine*]
+parent=General Crawlers
+
+[Dumbot (version *)]
+parent=General Crawlers
+browser=Dumbfind
+
+[EARTHCOM.info/*]
+parent=General Crawlers
+browser=EarthCom
+
+[FRSEEKBOT]
+parent=General Crawlers
+browser=FRSEEKBOT
+
+[Gaisbot*]
+parent=General Crawlers
+browser=Gaisbot
+
+[Hatena Antenna/*]
+parent=General Crawlers
+browser=Hatena Antenna
+
+[HTTP-Test-Program]
+parent=General Crawlers
+browser=WebBug
+majorver=5
+
+[http://www.almaden.ibm.com/cs/crawler*]
+parent=General Crawlers
+browser=IBM's WebFountain
+
+[ia_archiver*]
+parent=General Crawlers
+browser=Alexa
+
+[Industry+Update+Control]
+parent=General Crawlers
+browser=Microsoft's Software Update Services
+
+[InternetLinkAgent/*]
+parent=General Crawlers
+browser=InternetLinkAgent
+
+[Keyword Density/*]
+parent=General Crawlers
+browser=Keyword Density
+
+[Marvin v0.3]
+parent=General Crawlers
+browser=MedHunt
+majorver=0
+minorver=3
+
+[moget/*]
+parent=General Crawlers
+browser=Goo
+
+[Mozilla/* (compatible; WebCapture*)]
+parent=General Crawlers
+browser=WebCapture
+
+[Mozilla/*.* (compatible; AvantGo*)]
+parent=General Crawlers
+browser=AvantGo
+platform=Palm
+cookies=True
+
+[Mozilla/2.0 (TuringOS; Turing Machine; 0.0)]
+parent=General Crawlers
+browser=Anonymizer
+
+[Mozilla/4.0 (compatible; Cerberian Drtrs*)]
+parent=General Crawlers
+browser=Cerberian Drtrs
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows95)]
+parent=General Crawlers
+
+[Mozilla/4.0 (compatible; MSIE 4.5; Windows 98; )]
+parent=General Crawlers
+
+[Mozilla/4.78 (TuringOS; Turing Machine; 0.0)]
+parent=General Crawlers
+browser=Anonymizer
+majorver=0
+minorver=0
+
+[n4p_bot*]
+parent=General Crawlers
+browser=n4p_bot
+
+[nabot*]
+parent=General Crawlers
+browser=Nabot
+
+[NetCarta_WebMapper/*]
+parent=General Crawlers
+browser=NetCarta_WebMapper
+stripper=True
+
+[NextopiaBOT*]
+parent=General Crawlers
+browser=NextopiaBOT
+
+[NPBot*]
+parent=General Crawlers
+browser=NPBot
+
+[Nudelsalat/*]
+parent=General Crawlers
+browser=Nudelsalat
+stripper=True
+
+[Oracle Ultra Search]
+parent=General Crawlers
+browser=Oracle Ultra Search
+
+[os-heritrix/*]
+parent=General Crawlers
+browser=Wayback Machine
+
+[Radiation Retriever*]
+parent=General Crawlers
+browser=Radiation Retriever
+stripper=True
+
+[Reaper/* (?http://www.sitesearch.ca/reaper)]
+parent=General Crawlers
+browser=Reaper
+
+[Sam Spade*]
+parent=General Crawlers
+browser=Sam Spade
+beta=True
+
+[ScSpider/*]
+parent=General Crawlers
+browser=ScSpider
+
+[Search Engine World Robots.txt Validator*]
+parent=General Crawlers
+browser=Search Engine World Robots.txt Validator
+
+[Search Fst]
+parent=General Crawlers
+browser=Search Fst
+
+[semanticdiscovery/*]
+parent=General Crawlers
+browser=Semantic Discovery
+
+[SeznamBot/*]
+parent=General Crawlers
+browser=SeznamBot
+stripper=True
+
+[sitecheck.internetseer.com*]
+parent=General Crawlers
+browser=Internetseer
+
+[sohu-search]
+parent=General Crawlers
+browser=sohu-search
+stripper=True
+
+[SpankBot*]
+parent=General Crawlers
+browser=SpankBot
+stripper=True
+
+[SurveyBot/*]
+parent=General Crawlers
+browser=SurveyBot
+stripper=True
+
+[SyncMgr]
+parent=General Crawlers
+browser=SyncMgr
+
+[TheInformant*]
+parent=General Crawlers
+browser=TheInformant
+stripper=True
+
+[Tutorial Crawler*]
+parent=General Crawlers
+
+[UbiCrawler/*]
+parent=General Crawlers
+browser=UbiCrawler
+
+[UCmore]
+parent=General Crawlers
+browser=UCmore
+
+[Webclipping.com]
+parent=General Crawlers
+browser=Webclipping.com
+stripper=True
+
+[WebFilter Robot*]
+parent=General Crawlers
+browser=WebFilter Robot
+
+[WebmasterWorldForumBot*]
+parent=General Crawlers
+browser=WebmasterWorldForumBot
+
+[WebTrends/*]
+parent=General Crawlers
+browser=WebTrends
+
+[WhizBang]
+parent=General Crawlers
+browser=WhizBang
+
+[Willow Internet Crawler by Twotrees V2.1]
+parent=General Crawlers
+browser=Willow Internet Crawler
+
+[Zao/* (http://www.kototoi.org/zao/)]
+parent=General Crawlers
+browser=Zao
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Image Crawlers
+
+[Image Crawlers]
+browser=Image Crawlers
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[*PhotoStickies/*]
+parent=Image Crawlers
+browser=PhotoStickies
+
+[favicon finder at http://iconsurf.com/]
+parent=Image Crawlers
+browser=Favicon Finder
+
+[Mister PIX*]
+parent=Image Crawlers
+browser=Mister PIX
+
+[pixfinder/*]
+parent=Image Crawlers
+browser=pixfinder
+
+[psbot/*]
+parent=Image Crawlers
+browser=PSBot
+
+[Web Image Collector*]
+parent=Image Crawlers
+browser=Web Image Collector
+
+[WebPix*]
+parent=Image Crawlers
+browser=Custo
+
+[iSiloX/4.0* MacOS]
+parent=iSiloX
+version=4.0
+majorver=4
+minorver=0
+platform=MacOSX
+
+[iSiloX/4.0* Windows/32]
+parent=iSiloX
+version=4.0
+majorver=4
+minorver=0
+platform=Win32
+
+[iSiloX/4.1* MacOS]
+parent=iSiloX
+version=4.1
+majorver=4
+minorver=1
+platform=MacOSX
+
+[iSiloX/4.1* Windows/32]
+parent=iSiloX
+version=4.1
+majorver=4
+minorver=1
+platform=Win32
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Link Checkers
+
+[Link Checkers]
+browser=Link Checkers
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[*AgentName/*]
+parent=Link Checkers
+browser=AgentName
+
+[*Linkman*]
+parent=Link Checkers
+browser=Linkman
+
+[*Powermarks/*]
+parent=Link Checkers
+browser=Powermarks
+
+[*Web Link Validator*]
+parent=Link Checkers
+browser=Web Link Validator
+
+[*zeus*]
+parent=Link Checkers
+browser=Zeus
+stripper=True
+
+[*Zeus*]
+parent=Link Checkers
+browser=Zeus
+stripper=True
+
+[BMC Link Validator (http://www.briansmodelcars.com/links/)]
+parent=Link Checkers
+browser=BMC Link Validator
+majorver=1
+minorver=0
+platform=Win2000
+
+[Bookmark Buddy*]
+parent=Link Checkers
+browser=Bookmark Buddy
+
+[Bookmark search tool*]
+parent=Link Checkers
+browser=Bookmark search tool
+
+[Bookmark-Manager]
+parent=Link Checkers
+browser=Bookmark-Manager
+
+[Checkbot*]
+parent=Link Checkers
+browser=Checkbot
+
+[CheckLinks/*]
+parent=Link Checkers
+browser=CheckLinks
+
+[CyberSpyder Link Test/*]
+parent=Link Checkers
+browser=CyberSpyder Link Test
+
+[DLC/*]
+parent=Link Checkers
+browser=DLC
+
+[FavOrg]
+parent=Link Checkers
+browser=FavOrg
+
+[FindLinks/*]
+parent=Link Checkers
+browser=FindLinks
+
+[Funnel Web Profiler*]
+parent=Link Checkers
+browser=Funnel Web Profiler
+
+[Html Link Validator (www.lithopssoft.com)]
+parent=Link Checkers
+browser=HTML Link Validator
+
+[IECheck]
+parent=Link Checkers
+browser=IECheck
+
+[JCheckLinks/*]
+parent=Link Checkers
+browser=JCheckLinks
+
+[LinkAlarm/*]
+parent=Link Checkers
+browser=LinkAlarm
+
+[Linkbot*]
+parent=Link Checkers
+browser=Linkbot
+
+[LinkChecker/*]
+parent=Link Checkers
+browser=LinkChecker
+
+[LinkextractorPro*]
+parent=Link Checkers
+browser=LinkextractorPro
+stripper=True
+
+[LinkLint-checkonly/*]
+parent=Link Checkers
+browser=LinkLint
+
+[LinkScan/*]
+parent=Link Checkers
+browser=LinkScan
+
+[LinksManager.com*]
+parent=Link Checkers
+browser=LinksManager
+
+[LinkSweeper*]
+parent=Link Checkers
+browser=Linksweeper
+
+[LinkSweeper/1.0]
+parent=Link Checkers
+browser=LinkSweeper
+
+[LinkWalker*]
+parent=Link Checkers
+browser=LinkWalker
+
+[MetaGer-LinkChecker]
+parent=Link Checkers
+browser=MetaGer-LinkChecker
+
+[Mozilla/4.0 (compatible; SuperCleaner*;*)]
+parent=Link Checkers
+browser=SuperCleaner
+
+[RLinkCheker*]
+parent=Link Checkers
+browser=RLinkCheker
+
+[RPT-HTTPClient/*]
+parent=Link Checkers
+browser=RPT-HTTPClient
+stripper=True
+
+[SafariBookmarkChecker*(?http://www.coriolis.ch/)]
+parent=Link Checkers
+browser=SafariBookmarkChecker
+platform=MacOSX
+css=2
+
+[Simpy/* (Simpy; http://www.simpy.com/?ref=bot; feedback at simpy dot com)]
+parent=Link Checkers
+browser=Simpy
+
+[VSE/*]
+parent=Link Checkers
+browser=VSE Link Tester
+
+[WebTrends Link Analyzer]
+parent=Link Checkers
+browser=WebTrends Link Analyzer
+
+[Xenu* Link Sleuth*]
+parent=Link Checkers
+browser=Xenu's Link Sleuth
+stripper=True
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Log Spammers
+
+[Log Spammers]
+browser=Log Spammers
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[search.golffindit.com*]
+parent=Log Spammers
+browser=Golf Find It
+
+[SpamArrest.com-bot/*]
+parent=Log Spammers
+browser=SpamArrest
+
+[SSM Agent*]
+parent=Log Spammers
+browser=SSM Agent
+
+[Telesoft*]
+parent=Log Spammers
+browser=Telesoft
+
+[webcollage*]
+parent=Log Spammers
+browser=Web Collage
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Media Players
+
+[Media Players]
+browser=Media Players
+css=0
+frames=False
+iframes=False
+tables=False
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[iTunes/* (Windows; ?)]
+parent=Media Players
+browser=iTunes
+platform=Win32
+
+[Microsoft NetShow(TM) Player with RealVideo(R)]
+parent=Media Players
+browser=Microsoft NetShow
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* RealPlayer]
+parent=Media Players
+browser=RealPlayer
+platform=MacOSX
+
+[MPlayer 0.9*]
+parent=Media Players
+browser=MPlayer
+version=0.9
+majorver=0
+minorver=9
+
+[MPlayer 1.*]
+parent=Media Players
+browser=MPlayer
+version=1.0
+majorver=1
+minorver=0
+
+[MPlayer HEAD CVS]
+parent=Media Players
+browser=MPlayer
+
+[NSPlayer/4.*]
+parent=Media Players
+browser=Windows Media Player
+version=4.0
+majorver=4
+minorver=0
+
+[NSPlayer/7.*]
+parent=Media Players
+browser=Windows Media Player
+version=7.0
+majorver=7
+minorver=0
+
+[NSPlayer/8.*]
+parent=Media Players
+browser=Windows Media Player
+version=8.0
+majorver=8
+minorver=0
+
+[NSPlayer/9.*]
+parent=Media Players
+browser=Windows Media Player
+version=9.0
+majorver=9
+minorver=0
+
+[RealPlayer*]
+parent=Media Players
+browser=RealPlayer
+
+[RMA/*]
+parent=Media Players
+browser=RMA
+
+[vobsub]
+parent=Media Players
+browser=vobsub
+stripper=True
+
+[WinampMPEG/*]
+parent=Media Players
+browser=WinAmp
+
+[Windows-Media-Player/10.*]
+parent=Media Players
+browser=Windows-Media-Player
+version=10.0
+majorver=10
+minorver=0
+
+[Windows-Media-Player/7.*]
+parent=Media Players
+browser=Windows Media Player
+version=7.0
+majorver=7
+minorver=0
+
+[Windows-Media-Player/8.*]
+parent=Media Players
+browser=Windows Media Player
+version=8.0
+majorver=8
+minorver=0
+
+[Windows-Media-Player/9.*]
+parent=Media Players
+version=9.0
+majorver=9
+minorver=0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Microsoft
+
+[Microsoft]
+browser=Microsoft
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[MFC Foundation Class Library*]
+parent=Microsoft
+browser=MFC Foundation Class Library
+
+[MFHttpScan]
+parent=Microsoft
+browser=MFHttpScan
+
+[Microsoft Data Access Internet Publishing Provider Cache Manager]
+parent=Microsoft
+browser=MS IPP
+
+[Microsoft Data Access Internet Publishing Provider DAV*]
+parent=Microsoft
+browser=MS IPP DAV
+
+[Microsoft Data Access Internet Publishing Provider Protocol Discovery]
+parent=Microsoft
+browser=MS IPPPD
+
+[Microsoft Internet Explorer]
+parent=Microsoft
+browser=Fake IE
+
+[Microsoft Office Protocol Discovery]
+parent=Microsoft
+browser=MS OPD
+
+[Microsoft URL Control*]
+parent=Microsoft
+browser=Microsoft URL Control
+
+[Microsoft-WebDAV-MiniRedir/*]
+parent=Microsoft
+browser=Microsoft-WebDAV
+
+[MSProxy/*]
+parent=Microsoft
+browser=MS Proxy
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Miscellaneous Browsers
+
+[Miscellaneous Browsers]
+browser=Miscellaneous Browsers
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[*(http://www.avantbrowser.com)]
+parent=Miscellaneous Browsers
+browser=Avant Browser
+
+[Enigma Browser*]
+parent=Miscellaneous Browsers
+browser=Enigma Browser
+
+[Mozilla/* (Win32;*Escape?*; ?)]
+parent=Miscellaneous Browsers
+browser=Escape
+platform=Win32
+
+[NetRecorder*]
+parent=Miscellaneous Browsers
+browser=NetRecorder
+
+[NetSurfer*]
+parent=Miscellaneous Browsers
+browser=NetSurfer
+
+[Sleipnir*]
+parent=Miscellaneous Browsers
+browser=Sleipnir
+
+[SlimBrowser]
+parent=Miscellaneous Browsers
+browser=SlimBrowser
+
+[WWW_Browser/1.69]
+parent=Miscellaneous Browsers
+browser=WWW Browser
+version=1.69
+majorver=1
+minorver=69
+platform=Win16
+css=3
+
+[Cowbot-* (NHN Corp*naver.com)]
+parent=Naver
+browser=Cowbot
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Offline Browsers
+
+[Offline Browsers]
+browser=Offline Browsers
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[*Check&Get*]
+parent=Offline Browsers
+browser=Check&Get
+
+[*HTTrack*]
+parent=Offline Browsers
+browser=HTTrack
+
+[*MSIECrawler*]
+parent=Offline Browsers
+browser=IE Offline Browser
+
+[*TweakMASTER*]
+parent=Offline Browsers
+browser=TweakMASTER
+
+[Go-Ahead-Got-It*]
+parent=Offline Browsers
+browser=Go Ahead Got-It
+
+[iGetter/*]
+parent=Offline Browsers
+browser=iGetter
+
+[Teleport*]
+parent=Offline Browsers
+browser=Teleport
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Page Rippers
+
+[Page Rippers]
+browser=Page Rippers
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[*grub-client*]
+parent=Page Rippers
+browser=grub-client
+
+[*ickHTTP*]
+parent=Page Rippers
+browser=IP*Works
+
+[*Java*]
+parent=Page Rippers
+
+[*java*]
+parent=Page Rippers
+
+[*WinHttpRequest*]
+parent=Page Rippers
+browser=WinHttp
+
+[CFSCHEDULE*]
+parent=Page Rippers
+browser=ColdFusion Task Scheduler
+
+[ColdFusion*]
+parent=Page Rippers
+browser=ColdFusion
+
+[curl/*]
+parent=Page Rippers
+browser=cURL
+
+[ezic.com http agent *]
+parent=Page Rippers
+browser=Ezic.com
+
+[gnome-vfs/*]
+parent=Page Rippers
+browser=gnome-vfs
+
+[HLoader]
+parent=Page Rippers
+browser=HLoader
+
+[HTMLParser/*]
+parent=Page Rippers
+browser=HTMLParser
+
+[http generic]
+parent=Page Rippers
+browser=http generic
+
+[httperf/*]
+parent=Page Rippers
+browser=httperf
+
+[iexplore.exe]
+parent=Page Rippers
+
+[Inet - Eureka App]
+parent=Page Rippers
+browser=Inet - Eureka App
+
+[INetURL/*]
+parent=Page Rippers
+browser=INetURL
+
+[Jakarta Commons-HttpClient/*]
+parent=Page Rippers
+browser=Jakarta Commons-HttpClient
+
+[Libby*/libwww-perl/*]
+parent=Page Rippers
+browser=Libby
+
+[libWeb/clsHTTP*]
+parent=Page Rippers
+browser=libWeb/clsHTTP
+
+[libwww-perl/*]
+parent=Page Rippers
+browser=libwww-perl
+
+[lwp*]
+parent=Page Rippers
+
+[LWP*]
+parent=Page Rippers
+
+[MFC_Tear_Sample]
+parent=Page Rippers
+browser=MFC_Tear_Sample
+
+[Moozilla]
+parent=Page Rippers
+browser=Moozilla
+
+[MovableType/*]
+parent=Page Rippers
+browser=MovableType Web Log
+
+[Mozilla/3.0 (compatible; Indy Library)]
+parent=Page Rippers
+cookies=True
+
+[Pageload*]
+parent=Page Rippers
+browser=PageLoad
+
+[PEAR HTTP_Request*]
+parent=Page Rippers
+browser=PEAR-PHP
+
+[PHP*]
+parent=Page Rippers
+browser=PHP
+
+[Pockey*]
+parent=Page Rippers
+browser=Pockey-GetHTML
+
+[ScoutAbout*]
+parent=Page Rippers
+browser=ScoutAbout
+
+[SOFTWING_TEAR_AGENT*]
+parent=Page Rippers
+browser=AspTear
+
+[SuperHTTP/*]
+parent=Page Rippers
+browser=SuperHTTP
+
+[Tcl http client package*]
+parent=Page Rippers
+browser=Tcl http client package
+
+[URL Control*]
+parent=Page Rippers
+browser=URL Control
+
+[URLCHECK]
+parent=Page Rippers
+browser=URLCHECK
+
+[WinScripter iNet Tools]
+parent=Page Rippers
+browser=WinScripter iNet Tools
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Proxy Servers
+
+[Proxy Servers]
+browser=Proxy Servers
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Anonymizied]
+parent=Proxy Servers
+browser=Anonymizied
+
+[Mozilla/4.0 (compatible; MSIE 5.0; SaferSurf; DigExt)]
+parent=Proxy Servers
+browser=SaferSurf
+
+[Privoxy/*]
+parent=Proxy Servers
+browser=Privoxy
+
+[ProxyTester*]
+parent=Proxy Servers
+browser=ProxyTester
+crawler=True
+stripper=True
+
+[SilentSurf*]
+parent=Proxy Servers
+browser=SilentSurf
+
+[Space*Bison/*]
+parent=Proxy Servers
+browser=Proxomitron
+
+[Sqworm/*]
+parent=Proxy Servers
+browser=Websense
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; QuickTime
+
+[QuickTime]
+browser=QuickTime
+css=0
+frames=False
+iframes=False
+tables=False
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[QuickTime (qtver=5.0*;cpu=PPC;os=Mac 10.*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=MacOSX
+
+[QuickTime (qtver=5.0*;cpu=PPC;os=Mac 9.*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=MacPPC
+
+[QuickTime (qtver=5.0*;os=Windows 95*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=Win95
+
+[QuickTime (qtver=5.0*;os=Windows 98*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=Win98
+
+[QuickTime (qtver=5.0*;os=Windows Me*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=WinME
+
+[QuickTime (qtver=5.0*;os=Windows NT 4.0*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=WinNT
+
+[QuickTime (qtver=5.0*;os=Windows NT 5.0*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=Win2000
+
+[QuickTime (qtver=5.0*;os=Windows NT 5.1*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=WinXP
+
+[QuickTime (qtver=5.0*;os=Windows NT 5.2*)]
+parent=QuickTime
+version=5.0
+majorver=5
+minorver=0
+platform=WinNET
+
+[QuickTime (qtver=6.0*;cpu=PPC;os=Mac 10.*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=MacOSX
+
+[QuickTime (qtver=6.0*;cpu=PPC;os=Mac 9.*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=MacPPC
+
+[QuickTime (qtver=6.0*;os=Windows 95*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=Win95
+
+[QuickTime (qtver=6.0*;os=Windows 98*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=Win98
+
+[QuickTime (qtver=6.0*;os=Windows Me*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=WinME
+
+[QuickTime (qtver=6.0*;os=Windows NT 4.0*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=WinNT
+
+[QuickTime (qtver=6.0*;os=Windows NT 5.0*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=Win2000
+
+[QuickTime (qtver=6.0*;os=Windows NT 5.1*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=WinXP
+
+[QuickTime (qtver=6.0*;os=Windows NT 5.2*)]
+parent=QuickTime
+version=6.0
+majorver=6
+minorver=0
+platform=WinNET
+
+[QuickTime (qtver=6.1*;cpu=PPC;os=Mac 10.*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=MacOSX
+
+[QuickTime (qtver=6.1*;cpu=PPC;os=Mac 9.*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=MacPPC
+
+[QuickTime (qtver=6.1*;os=Windows 95*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=Win95
+
+[QuickTime (qtver=6.1*;os=Windows 98*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=Win98
+
+[QuickTime (qtver=6.1*;os=Windows Me*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=WinME
+
+[QuickTime (qtver=6.1*;os=Windows NT 4.0*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=WinNT
+
+[QuickTime (qtver=6.1*;os=Windows NT 5.0*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=Win2000
+
+[QuickTime (qtver=6.1*;os=Windows NT 5.1*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=WinXP
+
+[QuickTime (qtver=6.1*;os=Windows NT 5.2*)]
+parent=QuickTime
+version=6.1
+majorver=6
+minorver=1
+platform=WinNET
+
+[QuickTime (qtver=6.2*;cpu=PPC;os=Mac 10.*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=MacOSX
+
+[QuickTime (qtver=6.2*;cpu=PPC;os=Mac 9.*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=MacPPC
+
+[QuickTime (qtver=6.2*;os=Windows 95*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=Win95
+
+[QuickTime (qtver=6.2*;os=Windows 98*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=Win98
+
+[QuickTime (qtver=6.2*;os=Windows Me*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=WinME
+
+[QuickTime (qtver=6.2*;os=Windows NT 4.0*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=WinNT
+
+[QuickTime (qtver=6.2*;os=Windows NT 5.0*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=Win2000
+
+[QuickTime (qtver=6.2*;os=Windows NT 5.1*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=WinXP
+
+[QuickTime (qtver=6.2*;os=Windows NT 5.2*)]
+parent=QuickTime
+version=6.2
+majorver=6
+minorver=2
+platform=WinNET
+
+[QuickTime (qtver=6.3*;cpu=PPC;os=Mac 10.*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=MacOSX
+
+[QuickTime (qtver=6.3*;cpu=PPC;os=Mac 9.*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=MacPPC
+
+[QuickTime (qtver=6.3*;os=Windows 95*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=Win95
+
+[QuickTime (qtver=6.3*;os=Windows 98*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=Win98
+
+[QuickTime (qtver=6.3*;os=Windows Me*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=WinME
+
+[QuickTime (qtver=6.3*;os=Windows NT 4.0*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=WinNT
+
+[QuickTime (qtver=6.3*;os=Windows NT 5.0*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=Win2000
+
+[QuickTime (qtver=6.3*;os=Windows NT 5.1*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=WinXP
+
+[QuickTime (qtver=6.3*;os=Windows NT 5.2*)]
+parent=QuickTime
+version=6.3
+majorver=6
+minorver=3
+platform=WinNET
+
+[QuickTime (qtver=6.4*;cpu=PPC;os=Mac 10.*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=MacOSX
+
+[QuickTime (qtver=6.4*;cpu=PPC;os=Mac 9.*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=MacPPC
+
+[QuickTime (qtver=6.4*;os=Windows 95*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=Win95
+
+[QuickTime (qtver=6.4*;os=Windows 98*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=Win98
+
+[QuickTime (qtver=6.4*;os=Windows Me*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=WinME
+
+[QuickTime (qtver=6.4*;os=Windows NT 4.0*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=WinNT
+
+[QuickTime (qtver=6.4*;os=Windows NT 5.0*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=Win2000
+
+[QuickTime (qtver=6.4*;os=Windows NT 5.1*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=WinXP
+
+[QuickTime (qtver=6.4*;os=Windows NT 5.2*)]
+parent=QuickTime
+version=6.4
+majorver=6
+minorver=4
+platform=WinNET
+
+[QuickTime (qtver=6.5*;cpu=PPC;os=Mac 10.*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=MacOSX
+
+[QuickTime (qtver=6.5*;cpu=PPC;os=Mac 9.*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=MacPPC
+
+[QuickTime (qtver=6.5*;os=Windows 95*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=Win95
+
+[QuickTime (qtver=6.5*;os=Windows 98*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=Win98
+
+[QuickTime (qtver=6.5*;os=Windows Me*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=WinME
+
+[QuickTime (qtver=6.5*;os=Windows NT 4.0*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=WinNT
+
+[QuickTime (qtver=6.5*;os=Windows NT 5.0*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=Win2000
+
+[QuickTime (qtver=6.5*;os=Windows NT 5.1*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=WinXP
+
+[QuickTime (qtver=6.5*;os=Windows NT 5.2*)]
+parent=QuickTime
+version=6.5
+majorver=6
+minorver=5
+platform=WinNET
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Research Projects
+
+[Research Projects]
+browser=Research Projects
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[inetbot/* (?http://www.inetbot.com/bot.html)]
+parent=Research Projects
+browser=inetbot
+
+[Lachesis]
+parent=Research Projects
+browser=Lachesis
+
+[Steeler/*]
+parent=Research Projects
+browser=Steeler
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RSS Feeds
+
+[RSS Feeds]
+browser=RSS Feeds
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[*LinkLint*]
+parent=RSS Feeds
+browser=LinkLint
+
+[*NetVisualize*]
+parent=RSS Feeds
+browser=NetVisualize
+
+[FeedDemon/* (http://*bradsoft.com/*; Microsoft Windows *)]
+parent=RSS Feeds
+browser=FeedDemon
+platform=Win32
+
+[Mozilla/5.0 (compatible; Newz Crawler *; http://www.newzcrawler.com/?)]
+parent=RSS Feeds
+browser=Newz Crawler
+
+[Mozilla/5.0 (RSS Reader Panel)]
+parent=RSS Feeds
+browser=RSS Reader Panel
+
+[NetNewsWire Lite/* (Mac OS X)]
+parent=RSS Feeds
+browser=NetNewsWire Lite
+platform=MacOSX
+
+[NetNewsWire/* (Mac OS X*; http://ranchero.com/netnewswire/)]
+parent=RSS Feeds
+browser=NetNewsWire
+platform=MacOSX
+
+[*FDSE robot*]
+parent=Search Engines
+browser=FDSE Robot
+
+[*Fluffy the spider*]
+parent=Search Engines
+browser=SearchHippo
+
+[ah-ha.com crawler (crawler@ah-ha.com)]
+parent=Search Engines
+browser=Ah-Ha
+
+[AnswerBus (http://www.answerbus.com/)]
+parent=Search Engines
+
+[appie*(www.walhello.com)]
+parent=Search Engines
+browser=Walhello
+
+[ASPSeek/*]
+parent=Search Engines
+browser=ASPSeek
+
+[cosmos*]
+parent=Search Engines
+browser=Xyleme
+
+[Hotzonu/*]
+parent=Search Engines
+browser=Hotzonu
+
+[Mnogosearch*]
+parent=Search Engines
+browser=Mnogosearch
+
+[SANSARN (Search Engine www.sansarn.com)]
+parent=Search Engines
+browser=SANSARN
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Site Monitors
+
+[Site Monitors]
+browser=Site Monitors
+frames=False
+iframes=False
+tables=False
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[*EasyRider*]
+parent=Site Monitors
+browser=EasyRider
+
+[*maxamine.com--robot*]
+parent=Site Monitors
+browser=maxamine.com--robot
+stripper=True
+
+[*Netcraft Web Server Survey*]
+parent=Site Monitors
+browser=Netcraft
+
+[*Netcraft Webserver Survey*]
+parent=Site Monitors
+browser=Netcraft Webserver Survey
+stripper=True
+
+[*WebMon 1.*;]
+parent=Site Monitors
+browser=WebMon
+
+[Kenjin Spider*]
+parent=Site Monitors
+browser=Kenjin Spider
+
+[Kevin http://*]
+parent=Site Monitors
+browser=Kevin
+
+[Mozilla/4.0 (compatible; ChangeDetection/*]
+parent=Site Monitors
+browser=ChangeDetection
+
+[Myst Monitor Service v*]
+parent=Site Monitors
+browser=Myst Monitor Service
+
+[Net Probe]
+parent=Site Monitors
+browser=Net Probe
+
+[NetMechanic*]
+parent=Site Monitors
+browser=NetMechanic
+
+[NetReality*]
+parent=Site Monitors
+browser=NetReality
+
+[semanticdiscovery/*]
+parent=Site Monitors
+browser=SemanticDiscovery
+
+[SITECHECKER]
+parent=Site Monitors
+browser=SITECHECKER
+
+[UpTime Checker*]
+parent=Site Monitors
+browser=UpTime Checker
+
+[URL_Access/*]
+parent=Site Monitors
+
+[URLy Warning*]
+parent=Site Monitors
+browser=URLy Warning
+
+[WebPatrol/*]
+parent=Site Monitors
+browser=WebPatrol
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Site Rippers
+
+[Site Rippers]
+browser=Site Rippers
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[*WebGrabber*]
+parent=Site Rippers
+
+[3wGet/*]
+parent=Site Rippers
+browser=3wGet
+
+[ActiveRefresh*]
+parent=Site Rippers
+browser=ActiveRefresh
+
+[b2w/*]
+parent=Site Rippers
+browser=b2w
+
+[CAST]
+parent=Site Rippers
+browser=CAST
+
+[Crawl_Application]
+parent=Site Rippers
+browser=Crawl_Application
+
+[Custo*]
+parent=Site Rippers
+browser=Custo
+
+[DeepIndexer*]
+parent=Site Rippers
+browser=DeepIndexer
+
+[DISCo Pump *]
+parent=Site Rippers
+browser=DISCo Pump
+
+[fetch libfetch/*]
+parent=Site Rippers
+
+[Flaming AttackBot*]
+parent=Site Rippers
+browser=Flaming AttackBot
+
+[Foobot*]
+parent=Site Rippers
+browser=Foobot
+
+[Harvest/*]
+parent=Site Rippers
+browser=Harvest
+
+[Internet Exploiter/*]
+parent=Site Rippers
+
+[Internet Explore *]
+parent=Site Rippers
+browser=Fake IE
+
+[Internet Explorer *]
+parent=Site Rippers
+browser=Fake IE
+
+[JPluck/*]
+parent=Site Rippers
+browser=JPluck
+
+[Kapere (http://www.kapere.com)]
+parent=Site Rippers
+browser=Kapere
+
+[LeechGet*]
+parent=Site Rippers
+browser=LeechGet
+
+[Mozilla/2.0 (compatible; NEWT ActiveX; Win32)]
+parent=Site Rippers
+browser=NEWT ActiveX
+platform=Win32
+
+[Mozilla/3.0 (compatible)]
+parent=Site Rippers
+
+[Mozilla/3.01 (compatible;)]
+parent=Site Rippers
+
+[Mozilla/4.0 (compatible; BorderManager*)]
+parent=Site Rippers
+browser=Novell BorderManager
+
+[Mozilla/4.0 (compatible;)]
+parent=Site Rippers
+
+[Offline Explorer*]
+parent=Site Rippers
+browser=Offline Explorer
+
+[pavuk/*]
+parent=Site Rippers
+browser=Pavuk
+
+[Python*]
+parent=Site Rippers
+browser=Python
+
+[RepoMonkey*]
+parent=Site Rippers
+browser=RepoMonkey
+
+[SiteSnagger*]
+parent=Site Rippers
+browser=SiteSnagger
+
+[SiteSucker/*]
+parent=Site Rippers
+browser=SiteSucker
+
+[SiteWinder*]
+parent=Site Rippers
+browser=SiteWinder
+
+[VCI WebViewer*]
+parent=Site Rippers
+browser=VCI WebViewer
+
+[Web Downloader*]
+parent=Site Rippers
+browser=Web Downloader
+
+[Web Downloader/*]
+parent=Site Rippers
+browser=Web Downloader
+
+[Web Magnet*]
+parent=Site Rippers
+browser=Web Magnet
+
+[webbandit/*]
+parent=Site Rippers
+browser=webbandit
+
+[WebCopier*]
+parent=Site Rippers
+browser=WebCopier
+
+[WebDownloader*]
+parent=Site Rippers
+browser=WebDownloader
+
+[WebFetch]
+parent=Site Rippers
+browser=WebFetch
+
+[webfetch/*]
+parent=Site Rippers
+browser=WebFetch
+
+[WebGatherer*]
+parent=Site Rippers
+browser=WebGatherer
+
+[WebReaper*]
+parent=Site Rippers
+browser=WebReaper
+
+[WebSauger*]
+parent=Site Rippers
+browser=WebSauger
+
+[Website Downloader*]
+parent=Site Rippers
+browser=Website Downloader
+
+[Website eXtractor*]
+parent=Site Rippers
+browser=Website eXtractor
+
+[Website Quester]
+parent=Site Rippers
+browser=Website Quester
+
+[WebsiteExtractor*]
+parent=Site Rippers
+browser=Website eXtractor
+
+[WebSnatcher*]
+parent=Site Rippers
+browser=WebSnatcher
+
+[Webster Pro*]
+parent=Site Rippers
+browser=Webster Pro
+
+[WebStripper*]
+parent=Site Rippers
+browser=WebStripper
+
+[WebWhacker*]
+parent=Site Rippers
+browser=WebWhacker
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Text Browsers
+
+[Text Browsers]
+browser=Text Browsers
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Elinks (0.3; Linux*)]
+parent=Text Browsers
+browser=Elinks
+version=0.3
+majorver=0
+minorver=3
+
+[Elinks (0.3; OS/2*)]
+parent=Text Browsers
+browser=ELinks
+version=0.3
+majorver=0
+minorver=3
+platform=OS/2
+
+[Elinks (0.3; Unix*)]
+parent=Text Browsers
+browser=ELinks
+version=0.3
+majorver=0
+minorver=3
+platform=Unix
+
+[ELinks (0.4*; FreeBSD*)]
+parent=Text Browsers
+browser=ELinks
+version=0.4
+majorver=0
+minorver=4
+platform=FreeBSD
+
+[ELinks (0.4*; Linux*)]
+parent=Text Browsers
+browser=ELinks
+version=0.4
+majorver=0
+minorver=4
+platform=Linux
+
+[ELinks (0.4*; Unix*)]
+parent=Text Browsers
+browser=ELinks
+version=0.4
+majorver=0
+minorver=4
+platform=Unix
+
+[ELinks (0.5*; FreeBSD*)]
+parent=Text Browsers
+platform=FreeBSD
+
+[ELinks (0.5*; Linux*)]
+parent=Text Browsers
+platform=Linux
+
+[ELinks (0.5*; Unix*)]
+parent=Text Browsers
+version=0.5
+majorver=0
+minorver=5
+platform=Unix
+
+[ELinks (0.9*; Linux*)]
+parent=Text Browsers
+browser=ELinks
+version=0.9
+majorver=0
+minorver=9
+platform=Linux
+
+[ELinks/0.9* (textmode; FreeBSD*)]
+parent=Text Browsers
+browser=ELinks
+version=0.9
+majorver=0
+minorver=9
+platform=FreeBSD
+
+[ELinks/0.9* (textmode; Linux*)]
+parent=Text Browsers
+browser=ELinks
+version=0.9
+majorver=0
+minorver=9
+platform=Linux
+
+[ELinks/0.9* (textmode; Unix*)]
+parent=Text Browsers
+browser=ELinks
+version=0.9
+majorver=0
+minorver=9
+platform=Unix
+
+[Links (0.9*; FreeBSD*)]
+parent=Text Browsers
+browser=Links
+version=0.9
+majorver=0
+minorver=9
+platform=FreeBSD
+
+[Links (0.9*; Linux*)]
+parent=Text Browsers
+browser=Links
+version=0.9
+majorver=0
+minorver=9
+platform=Linux
+
+[Links (0.9*; OS/2*)]
+parent=Text Browsers
+browser=Links
+version=0.9
+majorver=0
+minorver=9
+platform=OS/2
+
+[Links (0.9*; Unix*)]
+parent=Text Browsers
+browser=Links
+version=0.9
+majorver=0
+minorver=9
+platform=Unix
+
+[Links (0.9*; Win32*)]
+parent=Text Browsers
+browser=Links
+version=0.9
+majorver=0
+minorver=9
+platform=Win32
+
+[Links (2.0*; Linux*)]
+parent=Text Browsers
+browser=Links
+version=2.0
+majorver=2
+minorver=0
+platform=Linux
+
+[Links (2.1*; FreeBSD*)]
+parent=Text Browsers
+browser=Links
+version=2.1
+majorver=2
+minorver=1
+platform=FreeBSD
+
+[Links (2.1*; Linux *)]
+parent=Text Browsers
+browser=Links
+version=2.1
+majorver=2
+minorver=1
+platform=Linux
+
+[Lynx *]
+parent=Text Browsers
+browser=Lynx
+
+[Lynx/2-4*]
+parent=Text Browsers
+browser=Lynx
+version=2.4
+majorver=2
+minorver=4
+
+[Lynx/2.3*]
+parent=Text Browsers
+browser=Lynx
+version=2.3
+majorver=2
+minorver=3
+
+[Lynx/2.5*]
+parent=Text Browsers
+browser=Lynx
+version=2.5
+majorver=2
+minorver=5
+
+[Lynx/2.6*]
+parent=Text Browsers
+browser=Lynx
+version=2.6
+majorver=2
+minorver=6
+
+[Lynx/2.7*]
+parent=Text Browsers
+browser=Lynx
+version=2.7
+majorver=2
+minorver=7
+
+[Lynx/2.8*]
+parent=Text Browsers
+browser=Lynx
+version=2.8
+majorver=2
+minorver=8
+
+[w3m/0.4*]
+parent=Text Browsers
+browser=w3m
+version=0.4
+majorver=0
+minorver=4
+cookies=True
+
+[w3m/0.5*]
+parent=Text Browsers
+browser=w3m
+version=0.5
+majorver=0
+minorver=5
+cookies=True
+
+[*Webinator*]
+parent=Thunderstone
+browser=Webinator Indexer
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Unknown
+
+[Unknown]
+browser=Unknown
+frames=False
+iframes=False
+tables=False
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=True
+wap=False
+netclr=False
+
+[Beamer * (build *)]
+parent=Unknown
+browser=Beamer
+
+[booch_*]
+parent=Unknown
+browser=booch
+
+[ClariaBot/*]
+parent=Unknown
+browser=ClariaBot
+
+[COMBINE/*]
+parent=Unknown
+browser=COMBINE
+
+[CosmixCrawler/*]
+parent=Unknown
+browser=CosmixCrawler
+
+[CPT_CUM_PROXY_CHECKER*]
+parent=Unknown
+browser=Cum Proxy Toolkit
+
+[Diamond/*]
+parent=Unknown
+browser=Diamond
+
+[Echelon/*]
+parent=Unknown
+
+[Expired Domain Sleuth]
+parent=Unknown
+browser=Expired Domain Sleuth
+
+[falcon/*]
+parent=Unknown
+browser=falcon
+
+[Iria/1.07*]
+parent=Unknown
+browser=Iria
+
+[linko/*]
+parent=Unknown
+browser=linko
+
+[LLUPDATECTRL]
+parent=Unknown
+
+[MindManager]
+parent=Unknown
+browser=MindManager
+
+[Plucker/Py*]
+parent=Unknown
+browser=Plucker/Py
+
+[ProPowerBot/*]
+parent=Unknown
+browser=ProPowerBot
+
+[SURF]
+parent=Unknown
+browser=SURF
+
+[VCIKJZDDLS*]
+parent=Unknown
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Validation Checkers
+
+[Validation Checkers]
+browser=Validation Checkers
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Jigsaw/* W3C_CSS_Validator_JFouffa/*]
+parent=Validation Checkers
+browser=Jigsaw CSS Validator
+
+[W3C_Validator/*]
+parent=Validation Checkers
+browser=W3C Validator
+
+[W3CLineMode/*]
+parent=Validation Checkers
+browser=W3C Line Mode
+
+[WebmasterWorld StickyMail Server Header Checker*]
+parent=Validation Checkers
+browser=WebmasterWorld Server Header Checker
+
+[WWWC/*]
+parent=Validation Checkers
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WAP Devices
+
+[WAP Devices]
+browser=WAP Devices
+platform=WAP
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=True
+netclr=False
+
+[*Blackberry*/1.*]
+parent=WAP Devices
+browser=Blackberry
+version=1.0
+majorver=1
+minorver=0
+
+[*Blackberry*/2.*]
+parent=WAP Devices
+browser=Blackberry
+version=2.0
+majorver=2
+minorver=0
+
+[*Blackberry*/3.*]
+parent=WAP Devices
+browser=Blackberry
+version=3.0
+majorver=3
+minorver=0
+
+[*Blackberry*/4.*]
+parent=WAP Devices
+browser=Blackberry
+version=4.0
+majorver=4
+minorver=0
+
+[*Blazer 1.0*]
+parent=WAP Devices
+browser=Blazer
+version=1.0
+majorver=1
+minorver=0
+platform=WAP
+
+[*Blazer 2.0*]
+parent=WAP Devices
+browser=Blazer
+version=2.0
+majorver=2
+minorver=0
+platform=WAP
+
+[*Blazer 3.0*]
+parent=WAP Devices
+browser=Blazer
+version=3.0
+majorver=3
+minorver=0
+
+[*Google WAP Proxy*]
+parent=WAP Devices
+browser=Google WAP Proxy
+
+[*Nokia-WAP-Toolkit*]
+parent=WAP Devices
+browser=Nokia WAP Toolkit
+
+[*Profile/*MIDP-1.0*]
+parent=WAP Devices
+browser=Profile
+version=1.0
+majorver=1
+minorver=0
+
+[*Profile/*MIDP-2.0*]
+parent=WAP Devices
+browser=Profile
+version=2.0
+majorver=2
+minorver=0
+
+[*ReqwirelessWeb/1.*]
+parent=WAP Devices
+browser=ReqwirelessWeb
+version=1.0
+majorver=1
+minorver=0
+
+[*ReqwirelessWeb/2.*]
+parent=WAP Devices
+browser=ReqwirelessWeb
+version=2.0
+majorver=2
+minorver=0
+
+[*Symbian*Profile/*MIDP-1.0*]
+parent=WAP Devices
+browser=Profile
+version=1.0
+majorver=1
+minorver=0
+platform=SymbianOS
+
+[*Symbian*Profile/*MIDP-2.0*]
+parent=WAP Devices
+browser=Profile
+version=2.0
+majorver=2
+minorver=0
+platform=SymbianOS
+
+[*Symbian*Profile/*MIDP-3.0*]
+parent=WAP Devices
+browser=Profile
+version=3.0
+majorver=3
+minorver=0
+
+[*UP.Browser/2.*]
+parent=WAP Devices
+browser=UP.Browser
+version=2.0
+majorver=2
+minorver=0
+
+[*UP.Browser/3.*]
+parent=WAP Devices
+browser=UP.Browser
+version=3.0
+majorver=3
+minorver=0
+
+[*UP.Browser/4.*]
+parent=WAP Devices
+browser=UP.Browser
+version=4.0
+majorver=4
+minorver=0
+
+[*UP.Browser/5.*]
+parent=WAP Devices
+browser=UP.Browser
+version=5.0
+majorver=5
+minorver=0
+
+[*UP.Browser/6.*]
+parent=WAP Devices
+browser=UP.Browser
+version=6.0
+majorver=6
+minorver=0
+
+[*UP.Link/2.*]
+parent=WAP Devices
+browser=UP.Link
+version=2.0
+majorver=2
+minorver=0
+
+[*UP.Link/3.*]
+parent=WAP Devices
+browser=UP.Link
+version=3.0
+majorver=3
+minorver=0
+
+[*UP.Link/4.*]
+parent=WAP Devices
+browser=UP.Link
+version=4.0
+majorver=4
+minorver=0
+
+[*UP.Link/5.*]
+parent=WAP Devices
+browser=UP.Link
+version=5.0
+majorver=5
+minorver=0
+
+[*UP.Link/6.*]
+parent=WAP Devices
+browser=UP.Link
+version=6.0
+majorver=6
+minorver=0
+
+[BlackBerrySimulator/*]
+parent=WAP Devices
+browser=BlackBerry Simulator
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Amaya
+
+[Amaya]
+browser=Amaya
+css=0
+frames=False
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[amaya/5.0*]
+parent=Amaya
+version=5.0
+majorver=5
+minorver=0
+css=1
+
+[amaya/5.1*]
+parent=Amaya
+version=5.1
+majorver=5
+minorver=1
+css=1
+
+[amaya/5.2*]
+parent=Amaya
+version=5.2
+majorver=5
+minorver=2
+css=1
+
+[amaya/5.3*]
+parent=Amaya
+version=5.3
+majorver=5
+minorver=3
+css=1
+
+[amaya/6.0*]
+parent=Amaya
+version=6.0
+majorver=6
+minorver=0
+css=1
+
+[amaya/6.1*]
+parent=Amaya
+version=6.1
+majorver=6
+minorver=1
+css=1
+
+[amaya/6.2*]
+parent=Amaya
+version=6.2
+majorver=6
+minorver=2
+css=1
+
+[amaya/6.3*]
+parent=Amaya
+version=6.3
+majorver=6
+minorver=3
+css=1
+
+[amaya/6.4*]
+parent=Amaya
+version=6.4
+majorver=6
+minorver=4
+css=1
+
+[amaya/7.0*]
+parent=Amaya
+majorver=7.0
+minorver=7
+authenticodeupdate=0
+css=1
+
+[amaya/7.1*]
+parent=Amaya
+version=7.1
+majorver=7
+minorver=1
+css=1
+
+[amaya/7.2*]
+parent=Amaya
+version=7.2
+majorver=7
+minorver=2
+css=1
+
+[amaya/8.0*]
+parent=Amaya
+version=8.0
+majorver=8
+minorver=0
+css=2
+
+[amaya/8.1*]
+parent=Amaya
+version=8.1
+majorver=8
+minorver=1
+css=2
+
+[amaya/8.2*]
+parent=Amaya
+version=8.2
+majorver=8
+minorver=2
+css=2
+
+[amaya/8.3*]
+parent=Amaya
+version=8.3
+majorver=8
+minorver=3
+css=2
+
+[amaya/8.4*]
+parent=Amaya
+version=8.4
+majorver=8
+minorver=4
+css=2
+
+[amaya/8.5*]
+parent=Amaya
+version=8.5
+majorver=8
+minorver=5
+css=2
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AOL16
+
+[AOL16]
+browser=AOL16
+version=3.0
+majorver=3
+minorver=0
+platform=Win16
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=True
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/2.0 * (Compatible; AOL-IWENG 3.0; Win16)]
+parent=AOL16
+
+[Mozilla/2.0 * (Compatible; AOL-IWENG 3.1; Win16)]
+parent=AOL16
+version=3.1
+majorver=3
+minorver=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; AWeb
+
+[AWeb]
+browser=Aweb
+css=0
+frames=False
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[*(Spoofed by Amiga-AWeb/*)]
+parent=AWeb
+
+[Amiga-AWeb/3.0*]
+parent=AWeb
+version=3.0
+majorver=3
+minorver=0
+
+[Amiga-AWeb/3.1*]
+parent=AWeb
+version=3.1
+majorver=3
+minorver=1
+
+[Amiga-AWeb/3.2*]
+parent=AWeb
+version=3.2
+majorver=3
+minorver=2
+
+[Amiga-AWeb/3.3*]
+parent=AWeb
+version=3.3
+majorver=3
+minorver=3
+
+[Amiga-AWeb/3.4*]
+parent=AWeb
+version=3.4
+majorver=3
+minorver=4
+
+[Amiga-AWeb/3.9*]
+parent=AWeb
+version=3.9
+majorver=3
+minorver=9
+javascript=True
+
+[AmigaVoyager/1.0]
+parent=AWeb
+version=1.0
+majorver=1
+minorver=0
+
+[AmigaVoyager/2.95 (AmigaOS/MC680x0)]
+parent=AWeb
+browser=Amiga Voyager
+version=2.95
+majorver=2
+minorver=95
+
+[AmigaVoyager/3.* (AmigaOS/MC680x0)]
+parent=AWeb
+browser=Amiga Voyager
+version=3.0
+majorver=3
+minorver=0
+
+[Mozilla/4.0 (compatible; MSIE 5.5; Amiga-AWeb/3.4APL)]
+parent=AWeb
+version=3.4
+majorver=3
+minorver=4
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Cyberdog
+
+[Cyberdog]
+browser=Cyberdog
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Cyberdog/1.2]
+parent=Cyberdog
+version=1.2
+majorver=1
+minorver=2
+platform=MacPPC
+
+[Cyberdog/2.0 (Macintosh; 68k)]
+parent=Cyberdog
+version=2.0
+majorver=2
+minorver=0
+platform=Mac68K
+
+[Cyberdog/2.0 (Macintosh; PPC)]
+parent=Cyberdog
+version=2.0
+majorver=2
+minorver=0
+platform=MacPPC
+
+[Cyberdog/2.0b1 (Macintosh; 68k)]
+parent=Cyberdog
+version=2.01
+majorver=2
+minorver=01
+platform=Mac68K
+beta=True
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Dillo
+
+[Dillo]
+browser=Dillo
+platform=Linux
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Dillo/0.6.6]
+parent=Dillo
+version=0.6.6
+majorver=0
+minorver=6.6
+
+[Dillo/0.7.2]
+parent=Dillo
+version=0.7.2
+majorver=0
+minorver=7.2
+
+[Dillo/0.7.3]
+parent=Dillo
+version=0.7.3
+majorver=0
+minorver=7.3
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Doris
+
+[Doris]
+browser=Doris Browser
+css=0
+frames=True
+iframes=False
+tables=False
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Doris/1.10 * (Symbian)]
+parent=Doris
+browser=Doris Browser
+majorver=1
+minorver=10
+platform=SymbianOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Dreamcast
+
+[Dreamcast]
+browser=Sega Dreamcast
+platform=Sega
+css=0
+frames=False
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (compatible; Planetweb/1.125 JS SSL US Gold; Dreamcast US)]
+parent=Dreamcast
+version=3
+majorver=3
+minorver=0
+
+[Mozilla/3.0 (Planetweb/2.606 JS SSL VoIP US; Dreamcast US)]
+parent=Dreamcast
+version=2.6
+majorver=2
+minorver=6
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Emacs/W3
+
+[Emacs/W3]
+browser=Emacs/W3
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Emacs/W3/2.* (Unix*]
+parent=Emacs/W3
+version=2.0
+majorver=2
+minorver=0
+platform=Unix
+
+[Emacs/W3/2.* (X11*]
+parent=Emacs/W3
+version=2.0
+majorver=2
+minorver=0
+platform=Linux
+
+[Emacs/W3/3.* (Unix*]
+parent=Emacs/W3
+version=3.0
+majorver=3
+minorver=0
+platform=Unix
+
+[Emacs/W3/3.* (X11*]
+parent=Emacs/W3
+version=3.0
+majorver=3
+minorver=0
+platform=Linux
+
+[Emacs/W3/4.* (Unix*]
+parent=Emacs/W3
+version=4.0
+majorver=4
+minorver=0
+platform=Unix
+
+[Emacs/W3/4.* (X11*]
+parent=Emacs/W3
+version=4.0
+majorver=4
+minorver=0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FrontPage
+
+[FrontPage]
+browser=MS FrontPage
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/2.0 (compatible; FrontPage Express 2.0)]
+parent=FrontPage
+browser=FrontPage Express
+version=2
+majorver=2
+minorver=0
+platform=Win32
+
+[Mozilla/2.0 (compatible; MS FrontPage 2.0)]
+parent=FrontPage
+browser=FrontPage 97
+version=2
+majorver=2
+minorver=0
+platform=Win32
+
+[Mozilla/2.0 (compatible; MS FrontPage 3.0)]
+parent=FrontPage
+browser=FrontPage 98
+version=3
+majorver=3
+minorver=0
+platform=Win32
+
+[Mozilla/2.0 (compatible; MS FrontPage 4.0)]
+parent=FrontPage
+browser=FrontPage 2000
+version=4
+majorver=4
+minorver=0
+platform=Win32
+iframes=True
+
+[Mozilla/2.0 (compatible; MS FrontPage 5.0)]
+parent=FrontPage
+browser=FrontPage 2002
+version=5.0
+majorver=5
+minorver=0
+iframes=True
+
+[Mozilla/2.0 (compatible; MS FrontPage 6.0)]
+parent=FrontPage
+browser=FrontPage XP
+version=6.0
+majorver=6
+minorver=0
+iframes=True
+
+[Mozilla/4.0 (compatible; MS FrontPage 6.0)]
+parent=FrontPage
+version=6.0
+majorver=6
+minorver=0
+iframes=True
+
+[MSFrontPage/3.0]
+parent=FrontPage
+version=3.0
+majorver=3
+minorver=0
+
+[MSFrontPage/4.0]
+parent=FrontPage
+version=4.0
+majorver=4
+minorver=0
+iframes=True
+
+[MSFrontPage/5.0]
+parent=FrontPage
+version=5.0
+majorver=5
+minorver=0
+iframes=True
+
+[MSFrontPage/6.0]
+parent=FrontPage
+version=6.0
+majorver=6
+minorver=0
+iframes=True
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IBrowse
+
+[IBrowse]
+browser=Ibrowse
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Arexx (compatible; MSIE 6.0; AmigaOS5.0) IBrowse 4.0]
+parent=IBrowse
+version=4.0
+majorver=4
+minorver=0
+
+[IBrowse/1.22 (AmigaOS *)]
+parent=IBrowse
+version=1.22
+majorver=1
+minorver=22
+
+[IBrowse/2.1 (AmigaOS *)]
+parent=IBrowse
+version=2.1
+majorver=2
+minorver=1
+
+[IBrowse/2.2 (AmigaOS *)]
+parent=IBrowse
+version=2.2
+majorver=2
+minorver=2
+
+[IBrowse/2.3 (AmigaOS *)]
+parent=IBrowse
+version=2.2
+majorver=2
+minorver=3
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; iCab 2.0
+
+[iCab 2.0]
+browser=iCab
+version=2.0
+majorver=2
+minorver=0
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[iCab]
+parent=iCab 2.0
+
+[iCab/2.7* (Macintosh; ?; 68K)]
+parent=iCab 2.0
+version=2.7
+majorver=2
+minorver=7
+platform=Mac68K
+
+[iCab/2.7* (Macintosh; ?; PPC)]
+parent=iCab 2.0
+version=2.7
+majorver=2
+minorver=7
+platform=MacPPC
+
+[iCab/2.8* (Macintosh; ?; 68K)]
+parent=iCab 2.0
+version=2.8
+majorver=2
+minorver=8
+platform=Mac68K
+
+[iCab/2.8* (Macintosh; ?; Mac OS X)]
+parent=iCab 2.0
+version=2.8
+majorver=2
+minorver=8
+platform=MacOSX
+
+[iCab/2.8* (Macintosh; ?; PPC)]
+parent=iCab 2.0
+version=2.8
+majorver=2
+minorver=8
+platform=MacPPC
+
+[iCab/2.9* (Macintosh; ?; 68K)]
+parent=iCab 2.0
+version=2.9
+majorver=2
+minorver=9
+platform=Mac68K
+
+[iCab/2.9* (Macintosh; ?; Mac OS X)]
+parent=iCab 2.0
+version=2.9
+majorver=2
+minorver=9
+platform=MacOSX
+
+[iCab/2.9* (Macintosh; ?; PPC)]
+parent=iCab 2.0
+platform=MacPPC
+
+[Mozilla/4.5 (compatible; iCab 2.8*; Macintosh; ?; PPC)]
+parent=iCab 2.0
+version=2.8
+majorver=2
+minorver=8
+platform=MacPPC
+
+[Mozilla/4.5 (compatible; iCab 2.8*; Macintosh; ?; PPC; Mac OS X)]
+parent=iCab 2.0
+version=2.8
+majorver=2
+minorver=8
+platform=MacOSX
+
+[Mozilla/4.5 (compatible; iCab 2.9*; Macintosh; ?; PPC)]
+parent=iCab 2.0
+version=2.9
+minorver=9
+platform=MacPPC
+
+[Mozilla/4.5 (compatible; iCab 2.9*; Macintosh; ?; PPC; Mac OS X)]
+parent=iCab 2.0
+platform=MacOSX
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; iSiloX
+
+[iSiloX]
+browser=iSiloX
+frames=True
+iframes=True
+tables=True
+cookies=False
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Konqueror
+
+[Konqueror]
+browser=Konqueror
+css=2
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (compatible; Konqueror/3.0*; *FreeBSD*)*]
+parent=Konqueror
+version=3.0
+majorver=3
+minorver=0
+platform=FreeBSD
+
+[Mozilla/5.0 (compatible; Konqueror/3.0*; *Linux*)*]
+parent=Konqueror
+version=3.0
+majorver=3
+minorver=0
+platform=Linux
+
+[Mozilla/5.0 (compatible; Konqueror/3.1*; *FreeBSD*)*]
+parent=Konqueror
+version=3.1
+majorver=3
+minorver=1
+platform=FreeBSD
+
+[Mozilla/5.0 (compatible; Konqueror/3.1*; *Linux*)*]
+parent=Konqueror
+version=3.1
+majorver=3
+minorver=1
+
+[Mozilla/5.0 (compatible; Konqueror/3.2*; *FreeBSD*) (KHTML, Like Gecko)]
+parent=Konqueror
+version=3.2
+majorver=3
+minorver=2
+platform=FreeBSD
+
+[Mozilla/5.0 (compatible; Konqueror/3.2*; *Linux*) (KHTML, Like Gecko)]
+parent=Konqueror
+version=3.2
+majorver=3
+minorver=2
+platform=Linux
+
+[Mozilla/5.0 (compatible; Konqueror/3.3) (KHTML, Like Gecko)]
+parent=Konqueror
+version=3.3
+majorver=3
+minorver=3
+
+[Mozilla/5.0 (compatible; Konqueror/3.3*; *FreeBSD*) (KHTML, Like Gecko)]
+parent=Konqueror
+version=3.3
+majorver=3
+minorver=3
+platform=FreeBSD
+
+[Mozilla/5.0 (compatible; Konqueror/3.3*; *Linux*) (KHTML, Like Gecko)]
+parent=Konqueror
+version=3.3
+majorver=3
+minorver=3
+platform=Linux
+
+[Mozilla/5.0 (compatible; Konqueror/3.3; *) (KHTML, like Gecko)]
+parent=Konqueror
+version=3.3
+majorver=3
+minorver=3
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Liberate
+
+[Liberate]
+browser=Liberate TV Navigator
+platform=Liberate
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (Liberate DTV 1.1)]
+parent=Liberate
+version=1.1
+majorver=1
+minorver=1
+
+[Mozilla/3.0 (Liberate DTV 1.2)]
+parent=Liberate
+version=1.2
+majorver=1
+minorver=2
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netpliance
+
+[Netpliance]
+browser=Netpliance
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.x (I-Opener 1.1; Netpliance)]
+parent=Netpliance
+browser=I-Opener
+majorver=1
+minorver=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OffByOne
+
+[OffByOne]
+browser=OffByOne
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.7 (compatible; OffByOne; Windows 2000)*]
+parent=OffByOne
+version=3.4
+majorver=3
+minorver=4
+platform=Win2000
+
+[Mozilla/4.7 (compatible; OffByOne; Windows 95)*]
+parent=OffByOne
+version=3.4
+majorver=3
+minorver=4
+platform=Win95
+
+[Mozilla/4.7 (compatible; OffByOne; Windows 98)*]
+parent=OffByOne
+version=3.4
+majorver=3
+minorver=4
+platform=Win98
+
+[Mozilla/4.7 (compatible; OffByOne; Windows ME)*]
+parent=OffByOne
+version=3.4
+majorver=3
+minorver=4
+platform=WinME
+
+[Mozilla/4.7 (compatible; OffByOne; Windows NT 4.0)*]
+parent=OffByOne
+version=3.4
+majorver=3
+minorver=4
+platform=WinNT
+
+[Mozilla/4.7 (compatible; OffByOne; Windows XP)*]
+parent=OffByOne
+version=3.4
+majorver=3
+minorver=4
+platform=WinXP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; OmniWeb
+
+[OmniWeb]
+browser=OmniWeb
+css=2
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.0 (*Mac_PowerPC) OmniWeb/4.1*]
+parent=OmniWeb
+version=4.1
+majorver=4
+minorver=1
+platform=MacPPC
+
+[Mozilla/4.0 (*Mac_PowerPC) OmniWeb/4.2*]
+parent=OmniWeb
+version=4.2
+majorver=4
+minorver=2
+platform=MacPPC
+
+[Mozilla/4.0 (*Mac_PowerPC) OmniWeb/4.3*]
+parent=OmniWeb
+version=4.3
+majorver=4
+minorver=3
+platform=MacPPC
+
+[Mozilla/4.0 (*Mac_PowerPC) OmniWeb/4.4*]
+parent=OmniWeb
+version=4.4
+majorver=4
+minorver=4
+platform=MacPPC
+
+[Mozilla/4.5 (compatible; OmniWeb/4.1*; Mac_PowerPC)]
+parent=OmniWeb
+version=4.1
+majorver=4
+minorver=1
+platform=MacPPC
+
+[Mozilla/4.5 (compatible; OmniWeb/4.2*; Mac_PowerPC)]
+parent=OmniWeb
+version=4.2
+majorver=4
+minorver=2
+platform=MacPPC
+
+[Mozilla/4.5 (compatible; OmniWeb/4.3*; Mac_PowerPC)]
+parent=OmniWeb
+version=4.3
+majorver=4
+minorver=3
+platform=MacPPC
+
+[Mozilla/4.5 (compatible; OmniWeb/4.4*; Mac_PowerPC)]
+parent=OmniWeb
+version=4.4
+majorver=4
+minorver=4
+platform=MacPPC
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X; *) AppleWebKit/* (*) OmniWeb/4.5*]
+parent=OmniWeb
+version=4.5
+majorver=4
+minorver=5
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X; *) AppleWebKit/* (*) OmniWeb/v4*]
+parent=OmniWeb
+version=4.0
+majorver=4
+minorver=0
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X; *) AppleWebKit/* (*) OmniWeb/v5*]
+parent=OmniWeb
+version=5.0
+majorver=5
+minorver=0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Oracle 1.5
+
+[Oracle 1.5]
+browser=Power Browser
+version=1.5
+majorver=1
+minorver=5
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/2.01 (compatible) Oracle(tm) PowerBrowser(tm)/1.0a]
+parent=Oracle 1.5
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PowerTV
+
+[PowerTV]
+browser=PowerTV
+platform=PowerTV
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.0 PowerTV/1.5 (Compatible; Spyglass DM 3.2.1, EXPLORER)]
+parent=PowerTV
+version=1.5
+majorver=1
+minorver=5
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Prodigy Web Browser
+
+[Prodigy Web Browser]
+browser=Prodigy Web Browser
+platform=Prodigy
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[PRODIGY-WB/3.2e]
+parent=Prodigy Web Browser
+version=3
+majorver=3
+minorver=2e
+
+[PRODIGY-WB/WIN32/3.4g]
+parent=Prodigy Web Browser
+version=3
+majorver=3
+minorver=4
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; QNX Voyager
+
+[QNX Voyager]
+browser=QNX Voyager
+platform=QNX RTOS
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.04 (compatible;QNX Voyager 2.03B ;Photon)]
+parent=QNX Voyager
+version=2.03
+majorver=2
+minorver=03
+beta=True
+
+[Mozilla/5.0 (Photon; ?; QNX x86pc; *; rv:*) Gecko/*]
+parent=QNX Voyager
+version=1.0
+majorver=1
+minorver=0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Safari
+
+[Safari]
+browser=Safari
+platform=MacOSX
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/10?*]
+parent=Safari
+version=1.1
+majorver=1
+minorver=1
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/12?*]
+parent=Safari
+version=1.2
+majorver=1
+minorver=2
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/13?*]
+parent=Safari
+version=1.3
+majorver=1
+minorver=3
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/14?*]
+parent=Safari
+version=1.4
+majorver=1
+minorver=4
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/49*]
+parent=Safari
+version=0.49
+majorver=0
+minorver=49
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/50*]
+parent=Safari
+version=0.50
+majorver=0
+minorver=50
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/51*]
+parent=Safari
+version=0.51
+majorver=0
+minorver=51
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/60*]
+parent=Safari
+version=0.60
+majorver=0
+minorver=60
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/61*]
+parent=Safari
+version=0.61
+majorver=0
+minorver=6
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/62*]
+parent=Safari
+version=0.62
+majorver=0
+minorver=62
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/63*]
+parent=Safari
+version=0.63
+majorver=0
+minorver=63
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/64*]
+parent=Safari
+version=0.64
+majorver=0
+minorver=64
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/65*]
+parent=Safari
+version=0.65
+majorver=0
+minorver=65
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/66*]
+parent=Safari
+version=0.66
+majorver=0
+minorver=66
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/67*]
+parent=Safari
+version=0.67
+majorver=0
+minorver=67
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/68*]
+parent=Safari
+version=0.68
+majorver=0
+minorver=68
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/69*]
+parent=Safari
+version=0.69
+majorver=0
+minorver=69
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/70*]
+parent=Safari
+version=0.70
+majorver=0
+minorver=70
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/71*]
+parent=Safari
+version=0.71
+majorver=0
+minorver=71
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/72*]
+parent=Safari
+version=0.72
+majorver=0
+minorver=72
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/73*]
+parent=Safari
+version=0.73
+majorver=0
+minorver=73
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/74*]
+parent=Safari
+version=0.74
+majorver=0
+minorver=74
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/75*]
+parent=Safari
+version=0.75
+majorver=0
+minorver=75
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/76*]
+parent=Safari
+version=0.76
+majorver=0
+minorver=76
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/77*]
+parent=Safari
+version=0.77
+majorver=0
+minorver=77
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/80*]
+parent=Safari
+version=0.80
+majorver=0
+minorver=80
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/83*]
+parent=Safari
+version=0.83
+majorver=0
+minorver=83
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/85*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/90*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/91*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/92*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/93*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/94*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/95*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/96*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/97*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/98*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (Macintosh; U; PPC Mac OS X; *) AppleWebKit/* (*) Safari/99*]
+parent=Safari
+version=1.0
+majorver=1
+minorver=0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Tango
+
+[Tango]
+browser=Tango Browser
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/2.0 (Sextant v3.0 c1.0 Win32 Alis)]
+parent=Tango
+version=3
+majorver=3
+minorver=0
+platform=Win32
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WebExplorer
+
+[WebExplorer]
+browser=WebExplorer
+platform=OS/2
+css=0
+frames=False
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[IBM-WebExplorer-DLL/v1.1h, IBM WebExplorer V 1.1h]
+parent=WebExplorer
+version=1.1h
+majorver=1
+minorver=1h
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WebTV
+
+[WebTV]
+browser=WebTV/MSTV
+platform=WebTV
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/1.22 WebTV/1.0 (compatible; MSIE 2.0)]
+parent=WebTV
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/3.0 WebTV/1.1 (compatible; MSTV 1.0)]
+parent=WebTV
+version=1.1
+majorver=1
+minorver=1
+
+[Mozilla/3.0 WebTV/1.2 (compatible; MSIE 2.0)]
+parent=WebTV
+version=1.2
+majorver=1
+minorver=2
+
+[Mozilla/3.0 WebTV/2.2 (compatible; MSIE 2.0)]
+parent=WebTV
+version=2.2
+majorver=2
+minorver=2
+
+[Mozilla/3.0 WebTV/2.5 (Compatible; MSIE 2.0)]
+parent=WebTV
+version=2.5
+majorver=2
+minorver=5
+
+[Mozilla/4.0 MSTV/1.1 WebTV/2.5 (compatible; MSIE 4.0)]
+parent=WebTV
+version=2.5
+majorver=2
+minorver=5
+css=1
+
+[Mozilla/4.0 WebTV/2.6 (compatible; MSIE 4.0)]
+parent=WebTV
+version=2.6
+majorver=2
+minorver=6
+css=1
+
+[Mozilla/4.0 WebTV/2.7 (compatible; MSIE 4.0)]
+parent=WebTV
+version=2.7
+majorver=2
+minorver=7
+css=1
+
+[Mozilla/4.0 WebTV/2.8 (compatible; MSIE 4.0)]
+parent=WebTV
+version=2.8
+majorver=2
+minorver=8
+css=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 4.0
+
+[Opera 4.0]
+browser=Opera
+version=4
+majorver=4
+minorver=0
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=False
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (Linux*; U) Opera 4.*]
+parent=Opera 4.0
+platform=Linux
+
+[Mozilla/3.0 (Mac_PowerPC; U) Opera 4.*]
+parent=Opera 4.0
+platform=MacPPC
+
+[Mozilla/3.0 (Windows 2000; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win2000
+
+[Mozilla/3.0 (Windows 95; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win95
+
+[Mozilla/3.0 (Windows 98; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win98
+
+[Mozilla/3.0 (Windows ME; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinME
+
+[Mozilla/3.0 (Windows NT 4.0; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinNT
+
+[Mozilla/3.0 (Windows XP; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Linux*) Opera 4.*]
+parent=Opera 4.0
+platform=Linux
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) Opera 4.*]
+parent=Opera 4.0
+platform=MacPPC
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 4.*]
+parent=Opera 4.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 4.*]
+parent=Opera 4.0
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 4.*]
+parent=Opera 4.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows ME) Opera 4.*]
+parent=Opera 4.0
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 4.*]
+parent=Opera 4.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 4.*]
+parent=Opera 4.0
+platform=WinXP
+
+[Mozilla/4.73 (Windows 98; U) Opera 4.*]
+parent=Opera 4.0
+minorver=02
+
+[Mozilla/4.76 (Macintosh;US;PPC) Opera 4.*]
+parent=Opera 4.0
+platform=MacPPC
+
+[Mozilla/4.78 (Linux*; U) Opera 4.*]
+parent=Opera 4.0
+platform=Linux
+
+[Mozilla/4.78 (Mac_PowerPC; U) Opera 4.*]
+parent=Opera 4.0
+platform=MacPPC
+
+[Mozilla/4.78 (Windows 2000; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win2000
+
+[Mozilla/4.78 (Windows 95; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win95
+
+[Mozilla/4.78 (Windows 98; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win98
+
+[Mozilla/4.78 (Windows ME; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinME
+
+[Mozilla/4.78 (Windows NT 4.0; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinNT
+
+[Mozilla/4.78 (Windows XP; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinXP
+
+[Mozilla/5.0 (Linux*; U) Opera 4.*]
+parent=Opera 4.0
+platform=Linux
+
+[Mozilla/5.0 (Mac_PowerPC; U) Opera 4.*]
+parent=Opera 4.0
+platform=MacPPC
+
+[Mozilla/5.0 (Windows 2000; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows 95; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win95
+
+[Mozilla/5.0 (Windows 98; U) Opera 4.*]
+parent=Opera 4.0
+platform=Win98
+
+[Mozilla/5.0 (Windows ME; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinME
+
+[Mozilla/5.0 (Windows NT 4.0; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows XP; U) Opera 4.*]
+parent=Opera 4.0
+platform=WinXP
+
+[Opera/4.* (Linux*; U)*]
+parent=Opera 4.0
+platform=Linux
+
+[Opera/4.* (Mac_PowerPC; U)*]
+parent=Opera 4.0
+platform=MacPPC
+
+[Opera/4.* (Windows 2000; U)*]
+parent=Opera 4.0
+platform=Win2000
+
+[Opera/4.* (Windows 95; U)*]
+parent=Opera 4.0
+platform=Win95
+
+[Opera/4.* (Windows 98; U)*]
+parent=Opera 4.0
+platform=Win98
+
+[Opera/4.* (Windows ME; U)*]
+parent=Opera 4.0
+platform=WinME
+
+[Opera/4.* (Windows NT 4.0; U)*]
+parent=Opera 4.0
+platform=WinNT
+
+[Opera/4.* (Windows XP; U)*]
+parent=Opera 4.0
+platform=WinXP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 5.0
+
+[Opera 5.0]
+browser=Opera
+version=5.0
+majorver=5
+minorver=0
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (Linux*; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Linux
+
+[Mozilla/3.0 (Mac_PowerPC; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=MacPPC
+
+[Mozilla/3.0 (Windows 2000; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win2000
+
+[Mozilla/3.0 (Windows 95; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win95
+
+[Mozilla/3.0 (Windows 98; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win98
+
+[Mozilla/3.0 (Windows ME; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinME
+
+[Mozilla/3.0 (Windows NT 4.0; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinNT
+
+[Mozilla/3.0 (Windows XP; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Linux*) Opera 5.0*]
+parent=Opera 5.0
+platform=Linux
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) Opera 5.0*]
+parent=Opera 5.0
+platform=MacPPC
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 5.0*]
+parent=Opera 5.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 5.0*]
+parent=Opera 5.0
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 5.0*]
+parent=Opera 5.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows ME) Opera 5.0*]
+parent=Opera 5.0
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 5.0*]
+parent=Opera 5.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 5.0*]
+parent=Opera 5.0
+platform=WinXP
+
+[Mozilla/4.76 (Macintosh;US;PPC) Opera 5.0*]
+parent=Opera 5.0
+platform=MacPPC
+
+[Mozilla/4.78 (Linux*; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Linux
+
+[Mozilla/4.78 (Mac_PowerPC; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=MacPPC
+
+[Mozilla/4.78 (Windows 2000; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win2000
+
+[Mozilla/4.78 (Windows 95; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win95
+
+[Mozilla/4.78 (Windows 98; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win98
+
+[Mozilla/4.78 (Windows ME; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinME
+
+[Mozilla/4.78 (Windows NT 4.0; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinNT
+
+[Mozilla/4.78 (Windows XP; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinXP
+
+[Mozilla/5.0 (Linux*; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Linux
+
+[Mozilla/5.0 (Mac_PowerPC; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=MacPPC
+
+[Mozilla/5.0 (SunOS*; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=SunOS
+
+[Mozilla/5.0 (Windows 2000; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows 95; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win95
+
+[Mozilla/5.0 (Windows 98; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=Win98
+
+[Mozilla/5.0 (Windows ME; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinME
+
+[Mozilla/5.0 (Windows NT 4.0; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows XP; ?) Opera 5.0*]
+parent=Opera 5.0
+platform=WinXP
+
+[Opera/5.0*(Linux*; ?)*]
+parent=Opera 5.0
+platform=Linux
+
+[Opera/5.0*(Mac_PowerPC; ?)*]
+parent=Opera 5.0
+platform=MacPPC
+
+[Opera/5.0*(Windows 2000; ?)*]
+parent=Opera 5.0
+platform=Win2000
+
+[Opera/5.0*(Windows 95; ?)*]
+parent=Opera 5.0
+platform=Win95
+
+[Opera/5.0*(Windows 98; ?)*]
+parent=Opera 5.0
+platform=Win98
+
+[Opera/5.0*(Windows ME; ?)*]
+parent=Opera 5.0
+platform=WinME
+
+[Opera/5.0*(Windows NT 4.0; ?)*]
+parent=Opera 5.0
+platform=WinNT
+
+[Opera/5.0*(Windows XP; ?)*]
+parent=Opera 5.0
+platform=WinXP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 5.12
+
+[Opera 5.12]
+browser=Opera
+version=5.12
+majorver=5
+minorver=12
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (Linux*; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Linux
+
+[Mozilla/3.0 (OS/2*; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=OS/2
+
+[Mozilla/3.0 (Windows 2000; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win2000
+
+[Mozilla/3.0 (Windows 95; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win95
+
+[Mozilla/3.0 (Windows 98; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win98
+
+[Mozilla/3.0 (Windows ME; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinME
+
+[Mozilla/3.0 (Windows NT 4.0; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinNT
+
+[Mozilla/3.0 (Windows XP; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Linux*) Opera 5.12*]
+parent=Opera 5.12
+platform=Linux
+
+[Mozilla/4.0 (compatible; MSIE 5.0; OS/2*) Opera 5.12*]
+parent=Opera 5.12
+platform=OS/2
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 5.12*]
+parent=Opera 5.12
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 5.12*]
+parent=Opera 5.12
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 5.12*]
+parent=Opera 5.12
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows ME) Opera 5.12*]
+parent=Opera 5.12
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 5.12*]
+parent=Opera 5.12
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 5.12*]
+parent=Opera 5.12
+platform=WinXP
+
+[Mozilla/4.76 (Macintosh;US;PPC) Opera 5.12*]
+parent=Opera 5.12
+platform=MacPPC
+
+[Mozilla/4.76 (Windows ME; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinME
+
+[Mozilla/4.78 (Linux*; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Linux
+
+[Mozilla/4.78 (OS/2*; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=OS/2
+
+[Mozilla/4.78 (Windows 2000; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win2000
+
+[Mozilla/4.78 (Windows 95; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win95
+
+[Mozilla/4.78 (Windows 98; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win98
+
+[Mozilla/4.78 (Windows ME; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinME
+
+[Mozilla/4.78 (Windows NT 4.0; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinNT
+
+[Mozilla/4.78 (Windows XP; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinXP
+
+[Mozilla/5.0 (Linux*; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Linux
+
+[Mozilla/5.0 (OS/2*; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=OS/2
+
+[Mozilla/5.0 (Windows 2000; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win2000
+
+[Mozilla/5.0 (Windows 95; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win95
+
+[Mozilla/5.0 (Windows 98; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=Win98
+
+[Mozilla/5.0 (Windows ME; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinME
+
+[Mozilla/5.0 (Windows NT 4.0; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinNT
+
+[Mozilla/5.0 (Windows XP; ?) Opera 5.12*]
+parent=Opera 5.12
+platform=WinXP
+
+[Opera/5.12 (Linux*; ?)*]
+parent=Opera 5.12
+platform=Linux
+
+[Opera/5.12 (OS/2*; ?)*]
+parent=Opera 5.12
+platform=OS/2
+
+[Opera/5.12 (Windows 2000; ?)*]
+parent=Opera 5.12
+platform=Win2000
+
+[Opera/5.12 (Windows 95; ?)*]
+parent=Opera 5.12
+platform=Win95
+
+[Opera/5.12 (Windows 98; ?)*]
+parent=Opera 5.12
+platform=Win98
+
+[Opera/5.12 (Windows ME; ?)*]
+parent=Opera 5.12
+platform=WinME
+
+[Opera/5.12 (Windows NT 4.0; ?)*]
+parent=Opera 5.12
+platform=WinNT
+
+[Opera/5.12 (Windows XP; ?)*]
+parent=Opera 5.12
+platform=WinXP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 6.0
+
+[Opera 6.0]
+browser=Opera
+version=6.0
+majorver=6
+minorver=0
+css=1
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (Linux*; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Linux
+
+[Mozilla/3.0 (Mac_PowerPC; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=MacPPC
+
+[Mozilla/3.0 (Windows 2000; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win2000
+
+[Mozilla/3.0 (Windows 95; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win95
+
+[Mozilla/3.0 (Windows 98; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win98
+
+[Mozilla/3.0 (Windows ME; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinME
+
+[Mozilla/3.0 (Windows NT 4.0; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinNT
+
+[Mozilla/3.0 (Windows XP; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Linux*) Opera 6.0*]
+parent=Opera 6.0
+platform=Linux
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) Opera 6.0*]
+parent=Opera 6.0
+platform=MacPPC
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Macintosh; PPC) Opera 6.0*]
+parent=Opera 6.0
+platform=MacPPC
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0*]
+parent=Opera 6.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Opera 6.0*]
+parent=Opera 6.0
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 98) Opera 6.0*]
+parent=Opera 6.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows ME) Opera 6.0*]
+parent=Opera 6.0
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 6.0*]
+parent=Opera 6.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.0*]
+parent=Opera 6.0
+platform=WinXP
+
+[Mozilla/4.76 (Macintosh;US;PPC) Opera 6.0*]
+parent=Opera 6.0
+platform=MacPPC
+
+[Mozilla/4.78 (Linux*; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Linux
+
+[Mozilla/4.78 (Mac_PowerPC; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=MacPPC
+
+[Mozilla/4.78 (Windows 2000; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win2000
+
+[Mozilla/4.78 (Windows 95; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win95
+
+[Mozilla/4.78 (Windows 98; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win98
+
+[Mozilla/4.78 (Windows ME; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinME
+
+[Mozilla/4.78 (Windows NT 4.0; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinNT
+
+[Mozilla/4.78 (Windows XP; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinXP
+
+[Mozilla/5.0 (Linux*; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Linux
+
+[Mozilla/5.0 (Mac_PowerPC; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=MacPPC
+
+[Mozilla/5.0 (Windows 2000; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows 95; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win95
+
+[Mozilla/5.0 (Windows 98; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=Win98
+
+[Mozilla/5.0 (Windows ME; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinME
+
+[Mozilla/5.0 (Windows NT 4.0; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows XP; ?) Opera 6.0*]
+parent=Opera 6.0
+platform=WinXP
+
+[Opera/6.0* (Linux*; ?)*]
+parent=Opera 6.0
+platform=Linux
+
+[Opera/6.0* (Mac_PowerPC; ?)*]
+parent=Opera 6.0
+platform=MacPPC
+
+[Opera/6.0* (Windows 2000; ?)*]
+parent=Opera 6.0
+platform=Win2000
+
+[Opera/6.0* (Windows 95; ?)*]
+parent=Opera 6.0
+platform=Win95
+
+[Opera/6.0* (Windows 98; ?)*]
+parent=Opera 6.0
+platform=Win98
+
+[Opera/6.0* (Windows ME; ?)*]
+parent=Opera 6.0
+platform=WinME
+
+[Opera/6.0* (Windows NT 4.0; ?)*]
+parent=Opera 6.0
+platform=WinNT
+
+[Opera/6.0* (Windows NT 5.0; ?)*]
+parent=Opera 6.0
+platform=Win2000
+
+[Opera/6.0* (Windows NT 5.1; ?)*]
+parent=Opera 6.0
+platform=WinXP
+
+[Opera/6.0* (Windows NT 5.2; ?)*]
+parent=Opera 6.0
+platform=WinNET
+
+[Opera/6.0* (Windows XP; ?)*]
+parent=Opera 6.0
+platform=WinXP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 6.1
+
+[Opera 6.1]
+browser=Opera
+version=6.1
+majorver=6
+minorver=1
+css=1
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (FreeBSD*; ?) Opera 6.1 *]
+parent=Opera 6.1
+platform=FreeBSD
+
+[Mozilla/3.0 (Linux*; ?) Opera 6.1 *]
+parent=Opera 6.1
+platform=Linux
+
+[Mozilla/3.0 (Linux*; ?) Opera 6.11 *]
+parent=Opera 6.1
+version=6.11
+minorver=11
+platform=Linux
+
+[Mozilla/4.0 (compatible; MSIE 5.0; FreeBSD*) Opera 6.1 *]
+parent=Opera 6.1
+platform=FreeBSD
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Linux*) Opera 6.1 *]
+parent=Opera 6.1
+platform=Linux
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Linux*) Opera 6.11 *]
+parent=Opera 6.1
+minorver=11
+platform=Linux
+css=1
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Linux*) Opera 6.12 *]
+parent=Opera 6.1
+version=6.12
+minorver=12
+platform=Linux
+
+[Mozilla/4.0 (compatible; MSIE 5.0; UNIX) Opera 6.1 *]
+parent=Opera 6.1
+platform=Unix
+
+[Mozilla/4.0 (compatible; MSIE 5.0; UNIX) Opera 6.11 *]
+parent=Opera 6.1
+minorver=11
+
+[Mozilla/4.0 (compatible; MSIE 5.0; UNIX) Opera 6.12 *]
+parent=Opera 6.1
+version=6.12
+minorver=12
+platform=Unix
+
+[Mozilla/4.78 (FreeBSD*; ?) Opera 6.1 *]
+parent=Opera 6.1
+platform=FreeBSD
+
+[Mozilla/4.78 (Linux*; ?) Opera 6.1 *]
+parent=Opera 6.1
+platform=Linux
+
+[Mozilla/4.78 (Linux*; ?) Opera 6.11 *]
+parent=Opera 6.1
+version=6.11
+minorver=11
+platform=Linux
+
+[Mozilla/4.78 (Linux*; ?) Opera 6.12 *]
+parent=Opera 6.1
+version=6.12
+minorver=12
+platform=Linux
+
+[Mozilla/4.78 (UNIX; ?) Opera 6.1 *]
+parent=Opera 6.1
+platform=Unix
+
+[Mozilla/5.0 (FreeBSD*; ?) Opera 6.1 *]
+parent=Opera 6.1
+platform=FreeBSD
+
+[Mozilla/5.0 (Linux*; ?) Opera 6.1 *]
+parent=Opera 6.1
+platform=Linux
+
+[Mozilla/5.0 (Linux*; ?) Opera 6.11 *]
+parent=Opera 6.1
+minorver=11
+
+[Mozilla/5.0 (UNIX; ?) Opera 6.11 *]
+parent=Opera 6.1
+version=6.11
+majorver=6
+minorver=11
+platform=Unix
+
+[Opera/6.1 (FreeBSD*; ?)*]
+parent=Opera 6.1
+platform=FreeBSD
+
+[Opera/6.1 (Linux*; ?)*]
+parent=Opera 6.1
+platform=Linux
+
+[Opera/6.1 (UNIX*; ?)*]
+parent=Opera 6.1
+platform=Unix
+
+[Opera/6.11 (FreeBSD*; ?)*]
+parent=Opera 6.1
+version=6.11
+minorver=11
+platform=FreeBSD
+
+[Opera/6.11 (Linux*; ?)*]
+parent=Opera 6.1
+version=6.11
+minorver=11
+platform=Linux
+css=1
+
+[Opera/6.11 (UNIX*; ?)*]
+parent=Opera 6.1
+platform=Unix
+
+[Opera/6.12 (FreeBSD*; ?)*]
+parent=Opera 6.1
+version=6.12
+minorver=12
+platform=FreeBSD
+
+[Opera/6.12 (Linux*; ?)*]
+parent=Opera 6.1
+version=6.12
+minorver=12
+platform=Linux
+
+[Opera/6.12 (OpenBSD*; ?) *]
+parent=Opera 6.1
+version=6.12
+minorver=12
+platform=OpenBSD
+
+[Opera/6.12 (SunOS*; ?)*]
+parent=Opera 6.1
+version=6.12
+majorver=6
+minorver=12
+platform=SunOS
+iframes=False
+
+[Opera/6.12 (UNIX*; ?)*]
+parent=Opera 6.1
+version=6.12
+minorver=12
+platform=Unix
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.0
+
+[Opera 7.0]
+browser=Opera
+version=7.0
+majorver=7
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0 (Windows 2000; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win2000
+
+[Mozilla/3.0 (Windows 95; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win95
+
+[Mozilla/3.0 (Windows 98; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win98
+
+[Mozilla/3.0 (Windows ME; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinME
+
+[Mozilla/3.0 (Windows NT 4.0; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinNT
+
+[Mozilla/3.0 (Windows XP; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows 2000) Opera 7.0*]
+parent=Opera 7.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows 95) Opera 7.0*]
+parent=Opera 7.0
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows 98) Opera 7.0*]
+parent=Opera 7.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows ME) Opera 7.0*]
+parent=Opera 7.0
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0*]
+parent=Opera 7.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.0*]
+parent=Opera 7.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.0*]
+parent=Opera 7.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows XP) Opera 7.0*]
+parent=Opera 7.0
+platform=WinXP
+
+[Mozilla/4.78 (Windows 2000; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win2000
+
+[Mozilla/4.78 (Windows 95; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win95
+
+[Mozilla/4.78 (Windows 98; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win98
+
+[Mozilla/4.78 (Windows ME; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinME
+
+[Mozilla/4.78 (Windows NT 4.0; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinNT
+
+[Mozilla/4.78 (Windows NT 5.1; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinXP
+
+[Mozilla/4.78 (Windows Windows NT 5.0; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win2000
+
+[Mozilla/4.78 (Windows XP; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinXP
+
+[Mozilla/5.0 (Windows 2000; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows 95; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win95
+
+[Mozilla/5.0 (Windows 98; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=Win98
+
+[Mozilla/5.0 (Windows ME; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinME
+
+[Mozilla/5.0 (Windows NT 4.0; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows NT 5.1; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinXP
+
+[Mozilla/5.0 (Windows XP; ?) Opera 7.0*]
+parent=Opera 7.0
+platform=WinXP
+
+[Opera/7.0* (Windows 2000; ?)*]
+parent=Opera 7.0
+platform=Win2000
+
+[Opera/7.0* (Windows 95; ?)*]
+parent=Opera 7.0
+platform=Win95
+
+[Opera/7.0* (Windows 98; ?)*]
+parent=Opera 7.0
+platform=Win98
+
+[Opera/7.0* (Windows ME; ?)*]
+parent=Opera 7.0
+platform=WinME
+
+[Opera/7.0* (Windows NT 4.0; ?)*]
+parent=Opera 7.0
+platform=WinNT
+
+[Opera/7.0* (Windows NT 5.0; ?)*]
+parent=Opera 7.0
+platform=Win2000
+
+[Opera/7.0* (Windows NT 5.1; ?)*]
+parent=Opera 7.0
+platform=WinXP
+
+[Opera/7.0* (Windows XP; ?)*]
+parent=Opera 7.0
+platform=WinXP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.1
+
+[Opera 7.1]
+browser=Opera
+version=7.1
+majorver=7
+minorver=1
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 2000) Opera 7.1*]
+parent=Opera 7.1
+platform=Win2000
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 95) Opera 7.1*]
+parent=Opera 7.1
+platform=Win95
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 98) Opera 7.1*]
+parent=Opera 7.1
+platform=Win98
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows ME) Opera 7.1*]
+parent=Opera 7.1
+platform=WinME
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 4.0) Opera 7.1*]
+parent=Opera 7.1
+platform=WinNT
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.0) Opera 7.1*]
+parent=Opera 7.1
+platform=Win2000
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.1) Opera 7.1*]
+parent=Opera 7.1
+platform=WinXP
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows XP) Opera 7.1*]
+parent=Opera 7.1
+platform=WinXP
+
+[Mozilla/?.* (Windows 2000; ?) Opera 7.1*]
+parent=Opera 7.1
+platform=Win2000
+
+[Mozilla/?.* (Windows 95; ?) Opera 7.1*]
+parent=Opera 7.1
+platform=Win95
+
+[Mozilla/?.* (Windows 98; ?) Opera 7.1*]
+parent=Opera 7.1
+platform=Win98
+
+[Mozilla/?.* (Windows ME; ?) Opera 7.1*]
+parent=Opera 7.1
+platform=WinME
+
+[Mozilla/?.* (Windows NT 4.0; U) Opera 7.1*]
+parent=Opera 7.1
+platform=WinNT
+
+[Mozilla/?.* (Windows NT 5.0; U) Opera 7.1*]
+parent=Opera 7.1
+platform=Win2000
+
+[Mozilla/?.* (Windows NT 5.1; ?) Opera 7.1*]
+parent=Opera 7.1
+platform=WinXP
+
+[Opera/7.1* (Linux*; ?)*]
+parent=Opera 7.1
+platform=Linux
+
+[Opera/7.1* (Windows 95; ?)*]
+parent=Opera 7.1
+platform=Win95
+
+[Opera/7.1* (Windows 98; ?)*]
+parent=Opera 7.1
+platform=Win98
+
+[Opera/7.1* (Windows ME; ?)*]
+parent=Opera 7.1
+platform=WinME
+
+[Opera/7.1* (Windows NT 4.0; ?)*]
+parent=Opera 7.1
+platform=WinNT
+
+[Opera/7.1* (Windows NT 5.0; ?)*]
+parent=Opera 7.1
+platform=Win2000
+
+[Opera/7.1* (Windows NT 5.1; ?)*]
+parent=Opera 7.1
+platform=WinXP
+
+[Opera/7.1* (Windows XP; ?)*]
+parent=Opera 7.1
+platform=WinXP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.2
+
+[Opera 7.2]
+browser=Opera
+version=7.2
+majorver=7
+minorver=2
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/?.* (compatible; MSIE ?.*; Linux*) Opera 7.2*]
+parent=Opera 7.2
+platform=Linux
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 2000) Opera 7.2*]
+parent=Opera 7.2
+platform=Win2000
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 95) Opera 7.2*]
+parent=Opera 7.2
+platform=Win95
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 98) Opera 7.2*]
+parent=Opera 7.2
+platform=Win98
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows ME) Opera 7.2*]
+parent=Opera 7.2
+platform=WinME
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 4.0) Opera 7.2*]
+parent=Opera 7.2
+platform=WinNT
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.0) Opera 7.2*]
+parent=Opera 7.2
+platform=Win2000
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.1) Opera 7.2*]
+parent=Opera 7.2
+platform=WinXP
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.2) Opera 7.2*]
+parent=Opera 7.2
+platform=WinNET
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows XP) Opera 7.2*]
+parent=Opera 7.2
+platform=WinXP
+
+[Mozilla/?.* (Windows 2000; ?) Opera 7.20*]
+parent=Opera 7.2
+platform=Win2000
+
+[Mozilla/?.* (Windows 95; ?) Opera 7.20*]
+parent=Opera 7.2
+platform=Win95
+
+[Mozilla/?.* (Windows 98; ?) Opera 7.20*]
+parent=Opera 7.2
+platform=Win98
+
+[Mozilla/?.* (Windows ME; ?) Opera 7.20*]
+parent=Opera 7.2
+platform=WinME
+
+[Mozilla/?.* (Windows NT 4.0; U) Opera 7.20*]
+parent=Opera 7.2
+platform=WinNT
+
+[Mozilla/?.* (Windows NT 5.0; U) Opera 7.20*]
+parent=Opera 7.2
+platform=Win2000
+
+[Mozilla/?.* (Windows NT 5.1; ?) Opera 7.20*]
+parent=Opera 7.2
+platform=WinXP
+
+[Mozilla/?.* (Windows NT 5.2; ?) Opera 7.20*]
+parent=Opera 7.2
+platform=WinNET
+
+[Opera/7.2* (Linux*; ?)*]
+parent=Opera 7.2
+platform=Linux
+
+[Opera/7.2* (Windows 95; ?)*]
+parent=Opera 7.2
+platform=Win95
+
+[Opera/7.2* (Windows 98; ?)*]
+parent=Opera 7.2
+platform=Win98
+
+[Opera/7.2* (Windows ME; ?)*]
+parent=Opera 7.2
+platform=WinME
+
+[Opera/7.2* (Windows NT 4.0; ?)*]
+parent=Opera 7.2
+platform=WinNT
+
+[Opera/7.2* (Windows NT 5.0; ?)*]
+parent=Opera 7.2
+platform=Win2000
+
+[Opera/7.2* (Windows NT 5.1; ?)*]
+parent=Opera 7.2
+platform=WinXP
+
+[Opera/7.2* (Windows NT 5.2; ?)*]
+parent=Opera 7.2
+platform=WinNET
+
+[Opera/7.2* (Windows XP; ?)*]
+parent=Opera 7.2
+platform=WinXP
+
+[Opera/7.2* (X11; FreeBSD*; ?)*]
+parent=Opera 7.2
+platform=FreeBSD
+
+[Opera/7.20 (X11; Linux*; ?)*]
+parent=Opera 7.2
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Opera 7.5
+
+[Opera 7.5]
+browser=Opera
+version=7.5
+majorver=7
+minorver=5
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/?.* (compatible; MSIE ?.*; Linux*) Opera 7.5*]
+parent=Opera 7.5
+platform=Linux
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 2000) Opera 7.5*]
+parent=Opera 7.5
+platform=Win2000
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 95) Opera 7.5*]
+parent=Opera 7.5
+platform=Win95
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows 98) Opera 7.5*]
+parent=Opera 7.5
+platform=Win98
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows ME) Opera 7.5*]
+parent=Opera 7.5
+platform=WinME
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 4.0) Opera 7.5*]
+parent=Opera 7.5
+platform=WinNT
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.0) Opera 7.5*]
+parent=Opera 7.5
+platform=Win2000
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.1) Opera 7.5*]
+parent=Opera 7.5
+platform=WinXP
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows NT 5.2) Opera 7.5*]
+parent=Opera 7.5
+platform=WinNET
+
+[Mozilla/?.* (compatible; MSIE ?.*; Windows XP) Opera 7.5*]
+parent=Opera 7.5
+platform=WinXP
+
+[Mozilla/?.* (compatible; MSIE ?.*; X11; Linux*) Opera 7.5*]
+parent=Opera 7.5
+platform=Linux
+
+[Mozilla/?.* (Windows 2000; ?) Opera 7.5*]
+parent=Opera 7.5
+platform=Win2000
+
+[Mozilla/?.* (Windows 95; ?) Opera 7.5*]
+parent=Opera 7.5
+platform=Win95
+
+[Mozilla/?.* (Windows 98; ?) Opera 7.5*]
+parent=Opera 7.5
+platform=Win98
+
+[Mozilla/?.* (Windows ME; ?) Opera 7.5*]
+parent=Opera 7.5
+platform=WinME
+
+[Mozilla/?.* (Windows NT 4.0; U) Opera 7.5*]
+parent=Opera 7.5
+platform=WinNT
+
+[Mozilla/?.* (Windows NT 5.0; U) Opera 7.5*]
+parent=Opera 7.5
+platform=Win2000
+
+[Mozilla/?.* (Windows NT 5.1; ?) Opera 7.5*]
+parent=Opera 7.5
+platform=WinXP
+
+[Mozilla/?.* (Windows NT 5.2; ?) Opera 7.5*]
+parent=Opera 7.5
+platform=WinNET
+
+[Opera/7.5* (Linux*; ?)*]
+parent=Opera 7.5
+platform=Linux
+
+[Opera/7.5* (Macintosh; PPC Mac OS X; ?)*]
+parent=Opera 7.5
+platform=MacPPC
+
+[Opera/7.5* (Windows 95; ?)*]
+parent=Opera 7.5
+platform=Win95
+
+[Opera/7.5* (Windows 98; ?)*]
+parent=Opera 7.5
+platform=Win98
+
+[Opera/7.5* (Windows ME; ?)*]
+parent=Opera 7.5
+platform=WinME
+
+[Opera/7.5* (Windows NT 4.0; ?)*]
+parent=Opera 7.5
+platform=WinNT
+
+[Opera/7.5* (Windows NT 5.0; ?)*]
+parent=Opera 7.5
+platform=Win2000
+
+[Opera/7.5* (Windows NT 5.1; ?)*]
+parent=Opera 7.5
+platform=WinXP
+
+[Opera/7.5* (Windows NT 5.2; ?)*]
+parent=Opera 7.5
+platform=WinNET
+
+[Opera/7.5* (Windows XP; ?)*]
+parent=Opera 7.5
+platform=WinXP
+
+[Opera/7.5* (X11; FreeBSD*; ?)*]
+parent=Opera 7.5
+platform=FreeBSD
+
+[Opera/7.5* (X11; Linux*; ?)*]
+parent=Opera 7.5
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 2.0
+
+[Netscape 2.0]
+browser=Netscape
+version=2
+majorver=2
+minorver=0
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/2.0*(16bit; ?)]
+parent=Netscape 2.0
+platform=Win16
+win16=True
+
+[Mozilla/2.0*(Macintosh; ?; 68K)]
+parent=Netscape 2.0
+platform=Mac68K
+
+[Mozilla/2.0*(Macintosh; ?; PPC)]
+parent=Netscape 2.0
+platform=MacPPC
+
+[Mozilla/2.0*(Win95; ?)]
+parent=Netscape 2.0
+platform=Win95
+
+[Mozilla/2.0*(Win95; ?; 16bit)]
+parent=Netscape 2.0
+platform=Win95
+win16=True
+
+[Mozilla/2.0*(Win98; ?)]
+parent=Netscape 2.0
+platform=Win98
+
+[Mozilla/2.0*(Windows; ?; 32bit)]
+parent=Netscape 2.0
+platform=Win16
+win16=True
+
+[Mozilla/2.0*(WinNT; ?)]
+parent=Netscape 2.0
+platform=WinNT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 3.0
+
+[Netscape 3.0]
+browser=Netscape
+version=3
+majorver=3
+minorver=0
+css=0
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/3.0*(Macintosh; ?; 68K)]
+parent=Netscape 3.0
+platform=Mac68K
+
+[Mozilla/3.0*(Macintosh; ?; PPC)]
+parent=Netscape 3.0
+platform=MacPPC
+
+[Mozilla/3.0*(Macintosh; ?; PPC)]
+parent=Netscape 3.0
+platform=MacPPC
+
+[Mozilla/3.0*(Win16; *)]
+parent=Netscape 3.0
+platform=Win16
+win16=True
+
+[Mozilla/3.0*(Win95; *)]
+parent=Netscape 3.0
+platform=Win95
+
+[Mozilla/3.0*(WinNT; *)]
+parent=Netscape 3.0
+platform=WinNT
+
+[Mozilla/3.03*(X11; ?; OpenVMS*)*]
+parent=Netscape 3.0
+version=3.03
+majorver=3
+minorver=03
+
+[Mozilla/3.04 (compatible; NCBrowser/*; ANTFresco/*; RISC OS-NC * Laz1UK1309)]
+parent=Netscape 3.0
+version=3.04
+minorver=04
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 4.0
+
+[Netscape 4.0]
+browser=Netscape
+version=4.0
+majorver=4
+minorver=0
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.0*(Macintosh*]
+parent=Netscape 4.0
+version=4.03
+minorver=03
+platform=MacPPC
+
+[Mozilla/4.0*(Win95;*]
+parent=Netscape 4.0
+platform=Win95
+
+[Mozilla/4.0*(Win98;*]
+parent=Netscape 4.0
+version=4.03
+minorver=03
+platform=Win98
+
+[Mozilla/4.0*(Windows XP 5.1*]
+parent=Netscape 4.0
+platform=WinXP
+
+[Mozilla/4.0*(WinNT*]
+parent=Netscape 4.0
+version=4.03
+minorver=03
+platform=WinNT
+
+[Mozilla/4.0*(X11;*)]
+parent=Netscape 4.0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 4.5
+
+[Netscape 4.5]
+browser=Netscape
+version=4.5
+majorver=4
+minorver=5
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.5*(Macintosh; ?; PPC)]
+parent=Netscape 4.5
+platform=MacPPC
+
+[Mozilla/4.5*(Win2000; ?)]
+parent=Netscape 4.5
+platform=Win2000
+
+[Mozilla/4.5*(Win95; ?)]
+parent=Netscape 4.5
+platform=Win95
+
+[Mozilla/4.5*(Win98; ?)]
+parent=Netscape 4.5
+platform=Win98
+
+[Mozilla/4.5*(WinME; ?)]
+parent=Netscape 4.5
+platform=WinME
+
+[Mozilla/4.5*(WinNT; ?)]
+parent=Netscape 4.5
+platform=WinNT
+
+[Mozilla/4.5*(WinXP; ?)]
+parent=Netscape 4.5
+platform=WinXP
+
+[Mozilla/4.5*(X11*)]
+parent=Netscape 4.5
+platform=Linux
+
+[Mozilla/4.51*(Macintosh; ?; PPC)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+
+[Mozilla/4.51*(Win2000; ?)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+platform=Win2000
+
+[Mozilla/4.51*(Win95; ?)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+platform=Win95
+
+[Mozilla/4.51*(Win98; ?)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+platform=Win98
+
+[Mozilla/4.51*(WinME; ?)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+platform=WinME
+
+[Mozilla/4.51*(WinNT; ?)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+platform=WinNT
+
+[Mozilla/4.51*(WinXP; ?)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+platform=WinXP
+
+[Mozilla/4.51*(X11*)]
+parent=Netscape 4.5
+version=4.51
+minorver=51
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 4.6
+
+[Netscape 4.6]
+browser=Netscape
+version=4.6
+majorver=4
+minorver=6
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.6 * (OS/2; ?)]
+parent=Netscape 4.6
+platform=OS/2
+
+[Mozilla/4.6*(CJPENNYCATE 3.2.11tst 101000562$$)]
+parent=Netscape 4.6
+
+[Mozilla/4.6*(Macintosh; ?; PPC)]
+parent=Netscape 4.6
+platform=MacPPC
+
+[Mozilla/4.6*(Win95; ?)]
+parent=Netscape 4.6
+platform=Win95
+
+[Mozilla/4.6*(Win98; ?)]
+parent=Netscape 4.6
+platform=Win98
+
+[Mozilla/4.6*(WinNT; ?)]
+parent=Netscape 4.6
+platform=WinNT
+
+[Mozilla/4.61*(Macintosh; ?; PPC)]
+parent=Netscape 4.6
+version=4.61
+majorver=4
+minorver=61
+platform=MacPPC
+
+[Mozilla/4.61*(OS/2; ?)]
+parent=Netscape 4.6
+version=4.61
+majorver=4
+minorver=61
+platform=OS/2
+
+[Mozilla/4.61*(Win95; ?)]
+parent=Netscape 4.6
+version=4.61
+majorver=4
+minorver=61
+platform=Win95
+
+[Mozilla/4.61*(Win98; ?)]
+parent=Netscape 4.6
+version=4.61
+platform=Win98
+
+[Mozilla/4.61*(WinNT; ?)]
+parent=Netscape 4.6
+version=4.61
+majorver=4
+minorver=61
+platform=WinNT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 4.7
+
+[Netscape 4.7]
+browser=Netscape
+version=4.7
+majorver=4
+minorver=7
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.7 * (Win2000; ?)]
+parent=Netscape 4.7
+platform=Win2000
+
+[Mozilla/4.7*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=7
+platform=MacPPC
+
+[Mozilla/4.7*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=7
+platform=Win95
+
+[Mozilla/4.7*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=7
+platform=Win98
+
+[Mozilla/4.7*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=7
+platform=WinNT
+
+[Mozilla/4.7*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=7
+platform=Win2000
+
+[Mozilla/4.7*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=7
+platform=WinXP
+
+[Mozilla/4.7*(WinNT; ?)*]
+parent=Netscape 4.7
+platform=WinNT
+
+[Mozilla/4.7*(X11*)*]
+parent=Netscape 4.7
+platform=Linux
+
+[Mozilla/4.7*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+platform=SunOS
+
+[Mozilla/4.71*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=MacPPC
+
+[Mozilla/4.71*(Win95; ?)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=Win95
+
+[Mozilla/4.71*(Win98; ?)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=Win98
+
+[Mozilla/4.71*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=WinNT
+
+[Mozilla/4.71*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=Win2000
+
+[Mozilla/4.71*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=WinXP
+
+[Mozilla/4.71*(WinNT; ?)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=WinNT
+
+[Mozilla/4.71*(X11*)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=Linux
+
+[Mozilla/4.71*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+version=4.71
+minorver=71
+platform=SunOS
+
+[Mozilla/4.72*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=72
+platform=MacPPC
+
+[Mozilla/4.72*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=72
+platform=Win95
+
+[Mozilla/4.72*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=72
+platform=Win98
+
+[Mozilla/4.72*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=72
+platform=WinNT
+
+[Mozilla/4.72*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=72
+platform=Win2000
+
+[Mozilla/4.72*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=72
+platform=WinXP
+
+[Mozilla/4.72*(WinNT; ?)*]
+parent=Netscape 4.7
+minorver=72
+platform=WinNT
+
+[Mozilla/4.72*(X11*)*]
+parent=Netscape 4.7
+minorver=72
+platform=Linux
+
+[Mozilla/4.72*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+minorver=72
+platform=SunOS
+
+[Mozilla/4.73*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=73
+platform=MacPPC
+
+[Mozilla/4.73*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=73
+platform=Win95
+
+[Mozilla/4.73*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=73
+platform=Win98
+
+[Mozilla/4.73*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=73
+platform=WinNT
+
+[Mozilla/4.73*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=73
+platform=Win2000
+
+[Mozilla/4.73*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=73
+platform=WinXP
+
+[Mozilla/4.73*(WinNT; ?)*]
+parent=Netscape 4.7
+minorver=73
+platform=WinNT
+
+[Mozilla/4.73*(X11*)*]
+parent=Netscape 4.7
+minorver=73
+platform=Linux
+
+[Mozilla/4.73*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+minorver=73
+platform=SunOS
+
+[Mozilla/4.74*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=74
+platform=MacPPC
+
+[Mozilla/4.74*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=74
+platform=Win95
+
+[Mozilla/4.74*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=74
+platform=Win98
+
+[Mozilla/4.74*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=74
+platform=WinNT
+
+[Mozilla/4.74*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=74
+platform=Win2000
+
+[Mozilla/4.74*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=74
+platform=WinXP
+
+[Mozilla/4.74*(WinNT; ?)*]
+parent=Netscape 4.7
+minorver=74
+platform=WinNT
+
+[Mozilla/4.74*(X11*)*]
+parent=Netscape 4.7
+minorver=74
+platform=Linux
+
+[Mozilla/4.74*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+minorver=74
+platform=SunOS
+
+[Mozilla/4.75*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=75
+platform=MacPPC
+
+[Mozilla/4.75*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=75
+platform=Win95
+
+[Mozilla/4.75*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=75
+platform=Win98
+
+[Mozilla/4.75*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=75
+platform=WinNT
+
+[Mozilla/4.75*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=75
+platform=Win2000
+
+[Mozilla/4.75*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=75
+platform=WinXP
+
+[Mozilla/4.75*(WinNT; ?)*]
+parent=Netscape 4.7
+minorver=75
+platform=WinNT
+
+[Mozilla/4.75*(X11*)*]
+parent=Netscape 4.7
+minorver=75
+platform=Linux
+
+[Mozilla/4.75*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+minorver=75
+platform=SunOS
+
+[Mozilla/4.76*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=76
+platform=MacPPC
+
+[Mozilla/4.76*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=76
+platform=Win95
+
+[Mozilla/4.76*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=76
+platform=Win98
+
+[Mozilla/4.76*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=76
+platform=WinNT
+
+[Mozilla/4.76*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=76
+platform=Win2000
+
+[Mozilla/4.76*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=76
+platform=WinXP
+
+[Mozilla/4.76*(WinNT; ?)*]
+parent=Netscape 4.7
+minorver=76
+platform=WinNT
+
+[Mozilla/4.76*(X11*)*]
+parent=Netscape 4.7
+minorver=76
+platform=Linux
+
+[Mozilla/4.76*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+minorver=76
+platform=SunOS
+
+[Mozilla/4.77*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=77
+platform=MacPPC
+
+[Mozilla/4.77*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=77
+platform=Win95
+
+[Mozilla/4.77*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=77
+platform=Win98
+
+[Mozilla/4.77*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=77
+platform=WinNT
+
+[Mozilla/4.77*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=77
+platform=Win2000
+
+[Mozilla/4.77*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=77
+platform=WinXP
+
+[Mozilla/4.77*(WinNT; ?)*]
+parent=Netscape 4.7
+minorver=77
+platform=WinNT
+
+[Mozilla/4.77*(X11*)*]
+parent=Netscape 4.7
+minorver=77
+platform=Linux
+
+[Mozilla/4.77*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+minorver=77
+platform=SunOS
+
+[Mozilla/4.78*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+minorver=78
+platform=MacPPC
+
+[Mozilla/4.78*(Win95; ?)*]
+parent=Netscape 4.7
+minorver=78
+platform=Win95
+
+[Mozilla/4.78*(Win98; ?)*]
+parent=Netscape 4.7
+minorver=78
+platform=Win98
+
+[Mozilla/4.78*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+minorver=78
+platform=WinNT
+
+[Mozilla/4.78*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+minorver=78
+platform=Win2000
+
+[Mozilla/4.78*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+minorver=78
+platform=WinXP
+
+[Mozilla/4.78*(WinNT; ?)*]
+parent=Netscape 4.7
+minorver=78
+platform=WinNT
+
+[Mozilla/4.78*(X11*)*]
+parent=Netscape 4.7
+minorver=78
+platform=Linux
+
+[Mozilla/4.78*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+minorver=78
+platform=SunOS
+
+[Mozilla/4.79*(Macintosh; ?; PPC)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=MacPPC
+
+[Mozilla/4.79*(Win95; ?)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=Win95
+
+[Mozilla/4.79*(Win98; ?)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=Win98
+
+[Mozilla/4.79*(Windows NT 4.0; ?)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=WinNT
+
+[Mozilla/4.79*(Windows NT 5.0; ?)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=Win2000
+
+[Mozilla/4.79*(Windows NT 5.1; ?)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=WinXP
+
+[Mozilla/4.79*(WinNT; ?)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=WinNT
+
+[Mozilla/4.79*(X11*)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=Linux
+
+[Mozilla/4.79*(X11; ?; SunOS*)*]
+parent=Netscape 4.7
+version=4.79
+minorver=79
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 4.8
+
+[Netscape 4.8]
+browser=Netscape
+version=4.8
+majorver=4
+minorver=8
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.8*(Macintosh; ?; MacPPC)*]
+parent=Netscape 4.8
+platform=MacPPC
+
+[Mozilla/4.8*(Macintosh; ?; PPC Mac OS X*]
+parent=Netscape 4.8
+platform=MacOSX
+
+[Mozilla/4.8*(Macintosh; ?; PPC)*]
+parent=Netscape 4.8
+platform=MacPPC
+
+[Mozilla/4.8*(Win95; *)*]
+parent=Netscape 4.8
+
+[Mozilla/4.8*(Win98; *)*]
+parent=Netscape 4.8
+platform=Win98
+
+[Mozilla/4.8*(Windows NT 4.0; *)*]
+parent=Netscape 4.8
+platform=WinNT
+
+[Mozilla/4.8*(Windows NT 5.0; *)*]
+parent=Netscape 4.8
+platform=Win2000
+
+[Mozilla/4.8*(Windows NT 5.0; *)*]
+parent=Netscape 4.8
+platform=Win2000
+
+[Mozilla/4.8*(Windows NT 5.1; *)*]
+parent=Netscape 4.8
+platform=WinXP
+
+[Mozilla/4.8*(WinNT; *)*]
+parent=Netscape 4.8
+platform=WinNT
+
+[Mozilla/4.8*(X11; *)*]
+parent=Netscape 4.8
+platform=Linux
+
+[Mozilla/4.8*(X11; U; SunOS 5.8 sun4u; Nav)*]
+parent=Netscape 4.8
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 6.0
+
+[Netscape 6.0]
+browser=Netscape
+version=6.0
+majorver=6
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=WinXP
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape6/6.0*]
+parent=Netscape 6.0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 6.1
+
+[Netscape 6.1]
+browser=Netscape
+version=6.1
+majorver=6
+minorver=1
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=WinXP
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape6/6.1*]
+parent=Netscape 6.1
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 6.2
+
+[Netscape 6.2]
+browser=Netscape
+version=6.2
+majorver=6
+minorver=2
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT5.2; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=WinNET
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape6/6.2*]
+parent=Netscape 6.2
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 7.0
+
+[Netscape 7.0]
+browser=Netscape
+version=7.0
+majorver=7
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X;*) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X;*) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=MacPPC
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=MacPPC
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT5.2; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT5.2; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT5.2; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+platform=WinNET
+
+[Mozilla/5.0 (Windows; U; Win 9x 4.90; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=WinME
+
+[Mozilla/5.0 (Windows; U; Win 9x 4.90; *; rv:*) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+platform=WinME
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS*) Gecko/* Netscape/7.0*]
+parent=Netscape 7.0
+platform=SunOS
+
+[Mozilla/5.0 (X11; ?; SunOS*) Gecko/* Netscape/7.01*]
+parent=Netscape 7.0
+version=7.01
+minorver=01
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS*) Gecko/* Netscape/7.02*]
+parent=Netscape 7.0
+version=7.02
+minorver=02
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 7.1
+
+[Netscape 7.1]
+browser=Netscape
+version=7.1
+majorver=7
+minorver=1
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *; rv:*) Gecko/* Netscape/7.1]
+parent=Netscape 7.1
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X;*) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT5.2; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=WinNET
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS*) Gecko/* Netscape/7.1*]
+parent=Netscape 7.1
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Netscape 7.2
+
+[Netscape 7.2]
+browser=Netscape
+version=7.2
+majorver=7
+minorver=2
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *; rv:*) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X;*) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC;*) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95;*) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win9x 4.90; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Windows NT 4.0; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT5.0; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; WinNT5.1; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT5.2; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=WinNET
+
+[Mozilla/5.0 (X11; ?; *) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS*) Gecko/* Netscape7/7.2*]
+parent=Netscape 7.2
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Beonex
+
+[Beonex]
+browser=Beonex Communicator
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Windows; ?; Win9x; *; Preview) Gecko/* Beonex/0.8-stable]
+parent=Beonex
+version=0.8
+majorver=0
+minorver=8
+platform=Win32
+beta=True
+
+[Mozilla/5.0 (Windows; ?; Win9x; *; Stable) Gecko/* Beonex/0.8.1-stable]
+parent=Beonex
+version=0.8.1
+majorver=0
+minorver=8.1
+platform=Win32
+
+[Mozilla/5.0 (Windows; ?; Win9x; *; Stable) Gecko/* Beonex/0.8.2-stable]
+parent=Beonex
+version=0.8.2
+majorver=0
+minorver=8.2
+platform=Win32
+
+[Mozilla/5.0 (Windows; ?; WinNT; *; Stable) Gecko/* Beonex/0.8.1-stable]
+parent=Beonex
+version=0.8.1
+majorver=0
+minorver=8.1
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT; *; Stable) Gecko/* Beonex/0.8.2-stable]
+parent=Beonex
+version=0.8.2
+majorver=0
+minorver=8.2
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; Stable) Gecko/* Beonex/0.8.1-stable]
+parent=Beonex
+version=0.8.1
+majorver=0
+minorver=8.1
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; Stable) Gecko/* Beonex/0.8.2-stable]
+parent=Beonex
+version=0.8.2
+majorver=0
+minorver=8.2
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *; Stable) Gecko/* Beonex/0.8.1-stable]
+parent=Beonex
+version=0.8.1
+majorver=0
+minorver=8.1
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; Linux*; *; Stable) Gecko/* Beonex/0.8.2-stable]
+parent=Beonex
+version=0.8.2
+majorver=0
+minorver=8.2
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Camino
+
+[Camino]
+browser=Camino
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:*) Gecko/* Camino/0.7]
+parent=Camino
+version=0.7
+majorver=0
+minorver=7
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:*) Gecko/* Camino/0.7+]
+parent=Camino
+majorver=0.7
+minorver=0
+platform=MacOSX
+authenticodeupdate=7
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:*) Gecko/* Camino/0.8]
+parent=Camino
+version=0.8
+majorver=0
+minorver=8
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Chimera
+
+[Chimera]
+browser=Chimera
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:*) Gecko/* Chimera/0.4]
+parent=Chimera
+version=0.4
+majorver=0
+minorver=4
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:*) Gecko/* Chimera/0.5]
+parent=Chimera
+version=0.5
+majorver=0
+minorver=5
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:*) Gecko/* Chimera/0.6]
+parent=Chimera
+version=0.6
+majorver=0
+minorver=6
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:*) Gecko/* Chimera/0.7]
+parent=Chimera
+version=0.7
+majorver=0
+minorver=7
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firebird 0.6
+
+[Firebird 0.6]
+browser=Firebird
+version=0.6
+majorver=0
+minorver=6
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:*) Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:*) Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; NetBSD*; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=NetBSD
+
+[Mozilla/5.0 (X11; ?; OpenBSD*; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=OpenBSD
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=SunOS
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:*) Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+platform=SunOS
+
+[Mozilla/5.0 Gecko/* Firebird Browser/0.6*]
+parent=Firebird 0.6
+
+[Mozilla/5.0 Gecko/* Firebird/0.6*]
+parent=Firebird 0.6
+
+[Mozilla/5.0 Gecko/* Mozilla Firebird/0.6*]
+parent=Firebird 0.6
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firebird 0.7
+
+[Firebird 0.7]
+browser=Firebird
+version=0.7
+majorver=0
+minorver=7
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=MacOSX
+
+[Mozilla/5.0 (OS/2*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=OS/2
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:*) Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+platform=SunOS
+
+[Mozilla/5.0 Gecko/* Firebird/0.7*]
+parent=Firebird 0.7
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firebird 0.8
+
+[Firebird 0.8]
+browser=Firebird
+version=0.8
+majorver=0
+minorver=8
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:*) Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+platform=SunOS
+
+[Mozilla/5.0 Gecko/* Firebird/0.8*]
+parent=Firebird 0.8
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firefox 0.10
+
+[Firefox 0.10]
+browser=Firefox
+version=0.10
+majorver=0
+minorver=10
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *rv:*) Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+platform=SunOS
+
+[Mozilla/5.0 Gecko/* Firefox/0.10*]
+parent=Firefox 0.10
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firefox 0.8
+
+[Firefox 0.8]
+browser=Firefox
+version=0.8
+majorver=0
+minorver=8
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; Linux*; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:*) Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+platform=SunOS
+
+[Mozilla/5.0 Gecko/* Firefox/0.8*]
+parent=Firefox 0.8
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Firefox 0.9
+
+[Firefox 0.9]
+browser=Firefox
+version=0.9
+majorver=0
+minorver=9
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X Mach-O; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win95; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; Linux*rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *rv:*) Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+platform=SunOS
+
+[Mozilla/5.0 Gecko/* Firefox/0.9*]
+parent=Firefox 0.9
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Galeon 0.1
+
+[Galeon 0.1]
+browser=Galeon
+version=0
+majorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 Galeon/0.11.1 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=11.1
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.11.2 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=11.2
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.11.3 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=11.3
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.11.5 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=11.5
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12.1 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12.1
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12.2 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12.2
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12.4 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12.4
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12.5 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12.5
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12.6 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12.6
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12.7 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12.7
+platform=Linux
+
+[Mozilla/5.0 Galeon/0.12.8 (X11; *; ?;) Gecko/*]
+parent=Galeon 0.1
+minorver=12.8
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Galeon 1.0
+
+[Galeon 1.0]
+browser=Galeon
+version=1
+majorver=1
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (X11; U; Linux*) Gecko/* Galeon/1.*]
+parent=Galeon 1.0
+platform=Linux
+
+[Mozilla/5.0 (X11; U; Linux*; Debian/*) Gecko/* Galeon/1.*]
+parent=Galeon 1.0
+platform=Linux
+
+[Mozilla/5.0 Galeon/1.* (X11; Linux*; U;)*]
+parent=Galeon 1.0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HP Secure Web Browser
+
+[HP Secure Web Browser]
+browser=HP Secure Web Browser
+platform=OpenVMS
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (X11; U; OpenVMS*; *; rv:1.0*) Gecko/*]
+parent=HP Secure Web Browser
+version=1.0
+majorver=1
+minorver=0
+
+[Mozilla/5.0 (X11; U; OpenVMS*; *; rv:1.1*) Gecko/*]
+parent=HP Secure Web Browser
+version=1.1
+majorver=1
+minorver=1
+
+[Mozilla/5.0 (X11; U; OpenVMS*; *; rv:1.2*) Gecko/*]
+parent=HP Secure Web Browser
+version=1.2
+majorver=1
+minorver=2
+
+[Mozilla/5.0 (X11; U; OpenVMS*; *; rv:1.3*) Gecko/*]
+parent=HP Secure Web Browser
+version=1.3
+majorver=1
+minorver=3
+
+[Mozilla/5.0 (X11; U; OpenVMS*; *; rv:1.4*) Gecko/*]
+parent=HP Secure Web Browser
+version=1.4
+majorver=1
+minorver=4
+
+[Mozilla/5.0 (X11; U; OpenVMS*; *; rv:1.5*) Gecko/*]
+parent=HP Secure Web Browser
+version=1.5
+majorver=1
+minorver=5
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Lycoris Desktop/LX
+
+[Lycoris Desktop/LX]
+browser=Lycoris Desktop/LX
+css=0
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=True
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.*: Desktop/LX Amethyst) Gecko/*]
+parent=Lycoris Desktop/LX
+version=1.1
+majorver=1
+minorver=1
+platform=Linux
+
+[Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.*; Desktop/LX Amethyst) Gecko/*]
+parent=Lycoris Desktop/LX
+version=1.0
+majorver=1
+minorver=0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mosaic
+
+[Mosaic]
+browser=Mosaic
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/4.0 (VMS_Mosaic)]
+parent=Mosaic
+platform=OpenVMS
+
+[VMS_Mosaic/3.7*]
+parent=Mosaic
+version=3.7
+majorver=3
+minorver=7
+platform=OpenVMS
+
+[VMS_Mosaic/3.8*]
+parent=Mosaic
+version=3.8
+majorver=3
+minorver=8
+platform=OpenVMS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Phoenix
+
+[Phoenix]
+browser=Phoenix
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.*) Gecko/* Phoenix/0.4*]
+parent=Phoenix
+version=0.4
+minorver=4
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.*) Gecko/* Phoenix/0.5*]
+parent=Phoenix
+version=0.5
+minorver=5
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.*) Gecko/* Phoenix/0.4*]
+parent=Phoenix
+version=0.4
+minorver=4
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.*) Gecko/* Phoenix/0.5*]
+parent=Phoenix
+version=0.5
+minorver=5
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.*) Gecko/* Phoenix/0.4*]
+parent=Phoenix
+version=0.4
+minorver=4
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.*) Gecko/* Phoenix/0.5*]
+parent=Phoenix
+version=0.5
+minorver=5
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.*) Gecko/* Phoenix/0.4*]
+parent=Phoenix
+version=0.4
+minorver=4
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.*) Gecko/* Phoenix/0.5*]
+parent=Phoenix
+version=0.5
+minorver=5
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.*) Gecko/* Phoenix/0.4*]
+parent=Phoenix
+version=0.4
+minorver=4
+platform=WinNT
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.*) Gecko/* Phoenix/0.5*]
+parent=Phoenix
+version=0.5
+minorver=5
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; Linux i686; *; rv:1.*) Gecko/* Phoenix/0.4*]
+parent=Phoenix
+version=0.4
+minorver=4
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; Linux i686; *; rv:1.*) Gecko/* Phoenix/0.5*]
+parent=Phoenix
+version=0.5
+minorver=5
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; NetBSD*; *; rv:*) Gecko/* Phoenix/0.5*]
+parent=Phoenix
+version=0.5
+majorver=0
+minorver=5
+platform=NetBSD
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; StarOffice 5.0
+
+[StarOffice 5.0]
+browser=StarOffice
+version=5.0
+majorver=5
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Linux*)]
+parent=StarOffice 5.0
+platform=Linux
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Solaris Sparc)]
+parent=StarOffice 5.0
+platform=SunOS
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Windows 95)]
+parent=StarOffice 5.0
+platform=Win95
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Windows 98)]
+parent=StarOffice 5.0
+platform=Win98
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Windows 98; Win 9x 4.90)]
+parent=StarOffice 5.0
+platform=WinME
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Windows NT 4.0)]
+parent=StarOffice 5.0
+platform=WinNT
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Windows NT 5.0)]
+parent=StarOffice 5.0
+platform=Win2000
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Windows NT 5.1)]
+parent=StarOffice 5.0
+platform=WinXP
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; Windows NT)]
+parent=StarOffice 5.0
+platform=WinNT
+
+[Mozilla/?.0 (compatible; StarOffice/5.*; X11*)]
+parent=StarOffice 5.0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; StarOffice 6.0
+
+[StarOffice 6.0]
+browser=StarOffice
+version=6.0
+majorver=6
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Linux*)]
+parent=StarOffice 6.0
+platform=Linux
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Solaris Sparc)]
+parent=StarOffice 6.0
+platform=SunOS
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Windows 95)]
+parent=StarOffice 6.0
+platform=Win95
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Windows 98)]
+parent=StarOffice 6.0
+platform=Win98
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Windows 98; Win 9x 4.90)]
+parent=StarOffice 6.0
+platform=WinME
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Windows NT 4.0)]
+parent=StarOffice 6.0
+platform=WinNT
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Windows NT 5.0)]
+parent=StarOffice 6.0
+platform=Win2000
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Windows NT 5.1)]
+parent=StarOffice 6.0
+platform=WinXP
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; Windows NT)]
+parent=StarOffice 6.0
+platform=WinNT
+
+[Mozilla/?.0 (compatible; StarOffice/6.*; X11*)]
+parent=StarOffice 6.0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; StarOffice 7.0
+
+[StarOffice 7.0]
+browser=StarOffice
+version=7.0
+majorver=7
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Linux*)]
+parent=StarOffice 7.0
+platform=Linux
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Solaris Sparc)]
+parent=StarOffice 7.0
+platform=SunOS
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Windows 95)]
+parent=StarOffice 7.0
+platform=Win95
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Windows 98)]
+parent=StarOffice 7.0
+platform=Win98
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Windows 98; Win 9x 4.90)]
+parent=StarOffice 7.0
+platform=WinME
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Windows NT 4.0)]
+parent=StarOffice 7.0
+platform=WinNT
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Windows NT 5.0)]
+parent=StarOffice 7.0
+platform=Win2000
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Windows NT 5.1)]
+parent=StarOffice 7.0
+platform=WinXP
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; Windows NT)]
+parent=StarOffice 7.0
+platform=WinNT
+
+[Mozilla/?.0 (compatible; StarOffice/7.*; X11*)]
+parent=StarOffice 7.0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.0
+
+[Mozilla 1.0]
+browser=Mozilla
+version=1.0
+majorver=1
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (BeOS; ?; BeOS BePC; ?????; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=BeOS
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:1.0.?) Gecko/*]
+parent=Mozilla 1.0
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.1
+
+[Mozilla 1.1]
+browser=Mozilla
+version=1.1
+majorver=1
+minorver=1
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux i?86; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=Linux
+
+[Mozilla/5.0 (X11; U; SunOS*; *; rv:1.1*) Gecko/*]
+parent=Mozilla 1.1
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.2
+
+[Mozilla 1.2]
+browser=Mozilla
+version=1.2
+majorver=1
+minorver=2
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; HP-UX*; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=HP-UX
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; NetBSD*; *; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=NetBSD
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; en-US; rv:1.2*) Gecko/*]
+parent=Mozilla 1.2
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.3
+
+[Mozilla 1.3]
+browser=Mozilla
+version=1.3
+majorver=1
+minorver=3
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux *; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=Linux
+
+[Mozilla/5.0 (X11; U; SunOS sun4u; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.3
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.4
+
+[Mozilla 1.4]
+browser=Mozilla
+version=1.4
+majorver=1
+minorver=4
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux i???; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; NetBSD*; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=NetBSD
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:1.4*) Gecko/*]
+parent=Mozilla 1.4
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.5
+
+[Mozilla 1.5]
+browser=Mozilla
+version=1.5
+majorver=1
+minorver=5
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux i???; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; OpenBSD*; *; rv:1.3*) Gecko/*]
+parent=Mozilla 1.5
+platform=OpenBSD
+
+[Mozilla/5.0 (X11; ?; SunOS*; *; rv:1.5*) Gecko/*]
+parent=Mozilla 1.5
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.6
+
+[Mozilla 1.6]
+browser=Mozilla
+version=1.6
+majorver=1
+minorver=6
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux *; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:1.6*) Gecko/*]
+parent=Mozilla 1.6
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.7
+
+[Mozilla 1.7]
+browser=Mozilla
+version=1.7
+majorver=1
+minorver=7
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux i???; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:1.7*) Gecko/*]
+parent=Mozilla 1.7
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla 1.8
+
+[Mozilla 1.8]
+browser=Mozilla
+version=1.8
+majorver=1
+minorver=8
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=True
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X*; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=MacOSX
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.2; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=WinNET
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD*; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux i???; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=Linux
+
+[Mozilla/5.0 (X11; ?; SunOS sun4u; *; rv:1.8*) Gecko/*]
+parent=Mozilla 1.8
+platform=SunOS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Mozilla Pre-Release
+
+[Mozilla Pre-Release]
+browser=Mozilla
+version=0
+majorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+
+[Mozilla/5.0 (BeOS; ?; BeOS BePC; ?????; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=BeOS
+
+[Mozilla/5.0 (Macintosh; ?; PPC Mac OS X; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=MacOSX
+
+[Mozilla/5.0 (Macintosh; ?; PPC; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=MacPPC
+
+[Mozilla/5.0 (Windows; ?; Win 9x 4.90; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=WinME
+
+[Mozilla/5.0 (Windows; ?; Win3.11; *; rv:*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=Win16
+
+[Mozilla/5.0 (Windows; ?; Win95; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=Win95
+
+[Mozilla/5.0 (Windows; ?; Win98; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=Win98
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.0; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=Win2000
+
+[Mozilla/5.0 (Windows; ?; Windows NT 5.1; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=WinXP
+
+[Mozilla/5.0 (Windows; ?; WinNT4.0; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=WinNT
+
+[Mozilla/5.0 (X11; ?; FreeBSD i386; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=FreeBSD
+
+[Mozilla/5.0 (X11; ?; Linux*; *; rv:0.*) Gecko/*]
+parent=Mozilla Pre-Release
+platform=Linux
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 1.5
+
+[IE 1.5]
+browser=IE
+version=1.5
+majorver=1
+minorver=5
+css=0
+frames=False
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=False
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/1.22 (compatible; MSIE 1.5; Windows 95)*]
+parent=IE 1.5
+platform=Win95
+
+[Mozilla/1.22 (compatible; MSIE 1.5; Windows NT)*]
+parent=IE 1.5
+platform=WinNT
+
+[Mozilla/1.22 (compatible; MSIE 2.0d; Windows NT)*]
+parent=IE 1.5
+version=1.22
+minorver=22
+platform=WinNT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 2.0
+
+[IE 2.0]
+browser=IE
+version=2
+majorver=2
+minorver=0
+css=0
+frames=False
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=False
+javaapplets=False
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/1.22 (compatible; MSIE 2.*; Mac_68000)*]
+parent=IE 2.0
+platform=Mac68K
+vbscript=False
+activexcontrols=False
+
+[Mozilla/1.22 (compatible; MSIE 2.*; Mac_PowerPC)*]
+parent=IE 2.0
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/1.22 (compatible; MSIE 2.*; Windows 95)*]
+parent=IE 2.0
+platform=Win95
+
+[Mozilla/1.22 (compatible; MSIE 2.*; Windows NT)*]
+parent=IE 2.0
+platform=WinNT
+
+[Mozilla/1.22 (compatible; MSIE 2.0; Windows 3.1)*]
+parent=IE 2.0
+platform=Win16
+
+[Mozilla/2.0 (compatible; MSIE 2.*; Windows 3.1)*]
+parent=IE 2.0
+platform=Win16
+frames=True
+
+[Mozilla/2.0 (compatible; MSIE 2.*; Mac_68000)*]
+parent=IE 2.0
+platform=Mac68K
+vbscript=False
+activexcontrols=False
+
+[Mozilla/2.0 (compatible; MSIE 2.*; Mac_68000)*]
+parent=IE 2.0
+platform=Mac68K
+vbscript=False
+activexcontrols=False
+
+[Mozilla/2.0 (compatible; MSIE 2.*; Mac_PowerPC)*]
+parent=IE 2.0
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/2.0 (compatible; MSIE 2.1; Windows 3.1)*]
+parent=IE 2.0
+platform=Win16
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 3.0
+
+[IE 3.0]
+browser=IE
+version=3
+majorver=3
+minorver=0
+css=1
+frames=True
+iframes=False
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/2.0 (compatible; MSIE 3.*; Mac_68000)*]
+parent=IE 3.0
+version=3.01
+minorver=01
+platform=Mac68K
+vbscript=False
+activexcontrols=False
+
+[Mozilla/2.0 (compatible; MSIE 3.*; Mac_PowerPC)*]
+parent=IE 3.0
+version=3.01
+minorver=01
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/2.0 (compatible; MSIE 3.*; Win 32)*]
+parent=IE 3.0
+platform=Win32
+
+[Mozilla/2.0 (compatible; MSIE 3.*; Windows 3.1)*]
+parent=IE 3.0
+platform=Win16
+activexcontrols=False
+win16=True
+
+[Mozilla/2.0 (compatible; MSIE 3.*; Windows 95) Modified]
+parent=IE 3.0
+platform=Win95
+
+[Mozilla/2.0 (compatible; MSIE 3.*; Windows 95)*]
+parent=IE 3.0
+platform=Win95
+
+[Mozilla/2.0 (compatible; MSIE 3.*; Windows NT)*]
+parent=IE 3.0
+platform=WinNT
+
+[Mozilla/2.0 (compatible; MSIE 3.0*; AOL *; Windows 3.1)*]
+parent=IE 3.0
+platform=Win16
+aol=True
+win16=True
+
+[Mozilla/2.0 (compatible; MSIE 3.0*; Windows 3.1)*]
+parent=IE 3.0
+platform=Win16
+win16=True
+
+[Mozilla/2.0 (compatible; MSIE 3.0; Windows 3.1)*]
+parent=IE 3.0
+platform=Win16
+win16=True
+
+[Mozilla/2.0 (compatible; MSIE 3.01; Windows 3.1)*]
+parent=IE 3.0
+version=3.01
+majorver=3
+minorver=01
+platform=Win16
+win16=True
+
+[Mozilla/2.0 (compatible; MSIE 3.02; Windows 3.1)*]
+parent=IE 3.0
+version=3.02
+majorver=3
+minorver=02
+platform=Win16
+win16=True
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 4.0
+
+[IE 4.0]
+browser=IE
+version=4
+majorver=4
+minorver=0
+css=1
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=True
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/4.0 (compatible; MSIE 4.0; Windows 3.1)*]
+parent=IE 4.0
+platform=Win16
+win16=True
+
+[Mozilla/4.0 (compatible; MSIE 4.0; Windows 95*]
+parent=IE 4.0
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 4.0; Windows 98*]
+parent=IE 4.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0*]
+parent=IE 4.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 5.0*]
+parent=IE 4.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 5.1*]
+parent=IE 4.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 4.0; Windows NT*]
+parent=IE 4.0
+platform=WinNT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 4.01
+
+[IE 4.01]
+browser=IE
+version=4.01
+majorver=4
+minorver=0
+css=1
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=True
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/4.0 (compatible; MSIE 4.01; *AOL*; Windows 98*]
+parent=IE 4.01
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 4.01; AOL *; Mac_PPC)]
+parent=IE 4.01
+platform=MacPPC
+
+[Mozilla/4.0 (compatible; MSIE 4.01; CS 2000; Windows 95*]
+parent=IE 4.01
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 4.01; MSN*; Windows 98*]
+parent=IE 4.01
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows 2000*]
+parent=IE 4.01
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows 3.1*]
+parent=IE 4.01
+platform=Win16
+win16=True
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows 95*]
+parent=IE 4.01
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows 98*]
+parent=IE 4.01
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 4.0*]
+parent=IE 4.01
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.0*]
+parent=IE 4.01
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows NT 5.1*]
+parent=IE 4.01
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 4.01; Windows NT*]
+parent=IE 4.01
+platform=WinNT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 4.5
+
+[IE 4.5]
+browser=IE
+version=4.5
+majorver=4
+minorver=5
+platform=MacPPC
+css=1
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=False
+javascript=True
+javaapplets=True
+activexcontrols=False
+cdf=False
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC*]
+parent=IE 4.5
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.5 (compatible; MSIE 4.5; Mac_PowerPC*]
+parent=IE 4.5
+vbscript=False
+activexcontrols=False
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 5.0
+
+[IE 5.0]
+browser=IE
+version=5
+majorver=5
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=True
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Win 9x 4.90*)*]
+parent=IE 5.0
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.0
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Win32*)*]
+parent=IE 5.0
+platform=Win32
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Win32*.NET CLR*)*]
+parent=IE 5.0
+platform=Win32
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows 95*)*]
+parent=IE 5.0
+platform=Win95
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows 95*.NET CLR*)*]
+parent=IE 5.0
+platform=Win95
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows 98*)*]
+parent=IE 5.0
+platform=Win98
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows 98*.NET CLR*)*]
+parent=IE 5.0
+platform=Win98
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows 98; Win 9x 4.90*)*]
+parent=IE 5.0
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.0
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT 4.0*)*]
+parent=IE 5.0
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT 4.0*.NET CLR*)*]
+parent=IE 5.0
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT 5.0*)*]
+parent=IE 5.0
+platform=Win2000
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT 5.0*.NET CLR*)*]
+parent=IE 5.0
+platform=Win2000
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT 5.1*)*]
+parent=IE 5.0
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT 5.1*.NET CLR*)*]
+parent=IE 5.0
+platform=WinXP
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT*)*]
+parent=IE 5.0
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows NT*.NET CLR*)*]
+parent=IE 5.0
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows XP*)*]
+parent=IE 5.0
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*AOL *Windows XP*)*]
+parent=IE 5.0
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Win 9x 4.90*)*]
+parent=IE 5.0
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.0
+platform=WinME
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Win32*)*]
+parent=IE 5.0
+platform=Win32
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Win32*.NET CLR*)*]
+parent=IE 5.0
+platform=Win32
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows 95*)*]
+parent=IE 5.0
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows 95*.NET CLR*)*]
+parent=IE 5.0
+platform=Win95
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows 98*)*]
+parent=IE 5.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows 98*.NET CLR*)*]
+parent=IE 5.0
+platform=Win98
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows 98; Win 9x 4.90*)*]
+parent=IE 5.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.0
+platform=Win98
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT 4.0*)*]
+parent=IE 5.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT 4.0*.NET CLR*)*]
+parent=IE 5.0
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT 5.0*)*]
+parent=IE 5.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT 5.0*.NET CLR*)*]
+parent=IE 5.0
+platform=Win2000
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT 5.1*)*]
+parent=IE 5.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT 5.1*.NET CLR*)*]
+parent=IE 5.0
+platform=WinXP
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT*)*]
+parent=IE 5.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows NT*.NET CLR*)*]
+parent=IE 5.0
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows XP*)*]
+parent=IE 5.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.0*;*Windows XP*.NET CLR*)*]
+parent=IE 5.0
+platform=WinXP
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)*]
+parent=IE 5.0
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC; *)*]
+parent=IE 5.0
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Win98*)*]
+parent=IE 5.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.0; Windows 3.1*)*]
+parent=IE 5.0
+platform=Win16
+win16=True
+
+[Mozilla/4.0 (compatible; MSIE 5.0;*SunOS*)*]
+parent=IE 5.0
+platform=SunOS
+
+[Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)*]
+parent=IE 5.0
+minorver=0b1
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+beta=True
+
+[Mozilla/4.0 (compatible; MSIE 5.12; AOL *; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.12
+minorver=12
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.12
+minorver=12
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.13; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.13
+minorver=13
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.14; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.14
+minorver=14
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.15; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.15
+minorver=15
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.16; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.16
+minorver=16
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.17; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.17
+minorver=17
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.1b1; AOL *; Mac_PowerPC)*]
+parent=IE 5.0
+platform=MacPPC
+beta=True
+
+[Mozilla/4.0 (compatible; MSIE 5.1b1; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.1b1
+minorver=1b1
+platform=MacPPC
+beta=True
+
+[Mozilla/4.0 (compatible; MSIE 5.2.2; Mac_OSX)*]
+parent=IE 5.0
+version=5.2.2
+minorver=2.2
+platform=MacOSX
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.2.2; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.2.2
+minorver=2.2
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.2; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.2
+minorver=2
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.21; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.21
+minorver=21
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.22
+minorver=22
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+[Mozilla/4.0 (compatible; MSIE 5.23; Mac_PowerPC)*]
+parent=IE 5.0
+version=5.23
+minorver=23
+platform=MacPPC
+vbscript=False
+activexcontrols=False
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 5.01
+
+[IE 5.01]
+browser=IE
+version=5.01
+majorver=5
+minorver=01
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=True
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Win 9x 4.90*)*]
+parent=IE 5.01
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.01
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Win32*)*]
+parent=IE 5.01
+platform=Win32
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Win32*.NET CLR*)*]
+parent=IE 5.01
+platform=Win32
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows 95*)*]
+parent=IE 5.01
+platform=Win95
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows 95*.NET CLR*)*]
+parent=IE 5.01
+platform=Win95
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows 98*)*]
+parent=IE 5.01
+platform=Win98
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows 98*.NET CLR*)*]
+parent=IE 5.01
+platform=Win98
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows 98; Win 9x 4.90*)*]
+parent=IE 5.01
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.01
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT 4.0*)*]
+parent=IE 5.01
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT 4.0*.NET CLR*)*]
+parent=IE 5.01
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT 5.0*)*]
+parent=IE 5.01
+platform=Win2000
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT 5.0*.NET CLR*)*]
+parent=IE 5.01
+platform=Win2000
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT 5.1*)*]
+parent=IE 5.01
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT 5.1*.NET CLR*)*]
+parent=IE 5.01
+platform=WinXP
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT*)*]
+parent=IE 5.01
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows NT*.NET CLR*)*]
+parent=IE 5.01
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows XP*)*]
+parent=IE 5.01
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*AOL *Windows XP*)*]
+parent=IE 5.01
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Win 9x 4.90*)*]
+parent=IE 5.01
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.01
+platform=WinME
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Win32*)*]
+parent=IE 5.01
+platform=Win32
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Win32*.NET CLR*)*]
+parent=IE 5.01
+platform=Win32
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows 95*)*]
+parent=IE 5.01
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows 95*.NET CLR*)*]
+parent=IE 5.01
+platform=Win95
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows 98*)*]
+parent=IE 5.01
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows 98*.NET CLR*)*]
+parent=IE 5.01
+platform=Win98
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows 98; Win 9x 4.90*)*]
+parent=IE 5.01
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.01
+platform=Win98
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT 4.0*)*]
+parent=IE 5.01
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT 4.0*.NET CLR*)*]
+parent=IE 5.01
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT 5.0*)*]
+parent=IE 5.01
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT 5.0*.NET CLR*)*]
+parent=IE 5.01
+platform=Win2000
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT 5.1*)*]
+parent=IE 5.01
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT 5.1*.NET CLR*)*]
+parent=IE 5.01
+platform=WinXP
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT*)*]
+parent=IE 5.01
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows NT*.NET CLR*)*]
+parent=IE 5.01
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows XP*)*]
+parent=IE 5.01
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.01*;*Windows XP*.NET CLR*)*]
+parent=IE 5.01
+platform=WinXP
+netclr=True
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 5.5
+
+[IE 5.5]
+browser=IE
+version=5.5
+majorver=5
+minorver=5
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=True
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Win 9x 4.90*)*]
+parent=IE 5.5
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.5
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Win32*)*]
+parent=IE 5.5
+platform=Win32
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Win32*.NET CLR*)*]
+parent=IE 5.5
+platform=Win32
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows 95*)*]
+parent=IE 5.5
+platform=Win95
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows 95*.NET CLR*)*]
+parent=IE 5.5
+platform=Win95
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows 98*)*]
+parent=IE 5.5
+platform=Win98
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows 98*.NET CLR*)*]
+parent=IE 5.5
+platform=Win98
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows 98; Win 9x 4.90*)*]
+parent=IE 5.5
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.5
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT 4.0*)*]
+parent=IE 5.5
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT 4.0*.NET CLR*)*]
+parent=IE 5.5
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT 5.0*)*]
+parent=IE 5.5
+platform=Win2000
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT 5.0*.NET CLR*)*]
+parent=IE 5.5
+platform=Win2000
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT 5.1*)*]
+parent=IE 5.5
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT 5.1*.NET CLR*)*]
+parent=IE 5.5
+platform=WinXP
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT*)*]
+parent=IE 5.5
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows NT*.NET CLR*)*]
+parent=IE 5.5
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows XP*)*]
+parent=IE 5.5
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*AOL *Windows XP*)*]
+parent=IE 5.5
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Win 9x 4.90*)*]
+parent=IE 5.5
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.5
+platform=WinME
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Win32*)*]
+parent=IE 5.5
+platform=Win32
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Win32*.NET CLR*)*]
+parent=IE 5.5
+platform=Win32
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows 95*)*]
+parent=IE 5.5
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows 95*.NET CLR*)*]
+parent=IE 5.5
+platform=Win95
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows 98*)*]
+parent=IE 5.5
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows 98*.NET CLR*)*]
+parent=IE 5.5
+platform=Win98
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows 98; Win 9x 4.90*)*]
+parent=IE 5.5
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 5.5
+platform=Win98
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT 4.0*)*]
+parent=IE 5.5
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT 4.0*.NET CLR*)*]
+parent=IE 5.5
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT 5.0*)*]
+parent=IE 5.5
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT 5.0*.NET CLR*)*]
+parent=IE 5.5
+platform=Win2000
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT 5.1*)*]
+parent=IE 5.5
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT 5.1*.NET CLR*)*]
+parent=IE 5.5
+platform=WinXP
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT*)*]
+parent=IE 5.5
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows NT*.NET CLR*)*]
+parent=IE 5.5
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows XP*)*]
+parent=IE 5.5
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 5.5*;*Windows XP*.NET CLR*)*]
+parent=IE 5.5
+platform=WinXP
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)]
+parent=IE 5.5
+browser=IE
+version=5.5
+majorver=5
+minorver=5
+platform=Win2000
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IE 6.0
+
+[IE 6.0]
+browser=IE
+version=6.0
+majorver=6
+minorver=0
+css=2
+frames=True
+iframes=True
+tables=True
+cookies=True
+backgroundsounds=True
+vbscript=True
+javascript=True
+javaapplets=True
+activexcontrols=True
+cdf=True
+aol=False
+beta=False
+win16=False
+crawler=False
+stripper=False
+wap=False
+netclr=False
+AK=False
+SK=False
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Win 9x 4.90*) *]
+parent=IE 6.0
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Win 9x 4.90*.NET CLR*)*]
+parent=IE 6.0
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Win32*)*]
+parent=IE 6.0
+platform=Win32
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Win32*.NET CLR*)*]
+parent=IE 6.0
+platform=Win32
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows 95*)*]
+parent=IE 6.0
+platform=Win95
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows 95*.NET CLR*)*]
+parent=IE 6.0
+platform=Win95
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows 98*)*]
+parent=IE 6.0
+platform=Win98
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows 98*.NET CLR*)*]
+parent=IE 6.0
+platform=Win98
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows 98; Win 9x 4.90*)*]
+parent=IE 6.0
+platform=WinME
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 6.0
+platform=WinME
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT 4.0*)*]
+parent=IE 6.0
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT 4.0*.NET CLR*)*]
+parent=IE 6.0
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT 5.0*)*]
+parent=IE 6.0
+platform=Win2000
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT 5.0*.NET CLR*)*]
+parent=IE 6.0
+platform=Win2000
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT 5.1*)*]
+parent=IE 6.0
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT 5.1*.NET CLR*)*]
+parent=IE 6.0
+platform=WinXP
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT 5.2*.NET CLR*)*]
+parent=IE 6.0
+platform=WinNET
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT*)*]
+parent=IE 6.0
+platform=WinNT
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows NT*.NET CLR*)*]
+parent=IE 6.0
+platform=WinNT
+aol=True
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows XP*)*]
+parent=IE 6.0
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*AOL *Windows XP*)*]
+parent=IE 6.0
+platform=WinXP
+aol=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Win 9x 4.90*)*]
+parent=IE 6.0
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Win 9x 4.90*.NET CLR*)*]
+parent=IE 6.0
+platform=WinME
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Win32*)*]
+parent=IE 6.0
+platform=Win32
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Win32*.NET CLR*)*]
+parent=IE 6.0
+platform=Win32
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows 95*)*]
+parent=IE 6.0
+platform=Win95
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows 95*.NET CLR*)*]
+parent=IE 6.0
+platform=Win95
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows 98*)*]
+parent=IE 6.0
+platform=Win98
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows 98*.NET CLR*)*]
+parent=IE 6.0
+platform=Win98
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows 98; Win 9x 4.90*)*]
+parent=IE 6.0
+platform=WinME
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows 98; Win 9x 4.90*.NET CLR*)*]
+parent=IE 6.0
+platform=WinME
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT 4.0*)*]
+parent=IE 6.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT 4.0*.NET CLR*)*]
+parent=IE 6.0
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT 5.0*)*]
+parent=IE 6.0
+platform=Win2000
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT 5.0*.NET CLR*)*]
+parent=IE 6.0
+platform=Win2000
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT 5.1*)*]
+parent=IE 6.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT 5.1*.NET CLR*)*]
+parent=IE 6.0
+platform=WinXP
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT 5.2*.NET CLR*)*]
+parent=IE 6.0
+platform=WinNET
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT*)*]
+parent=IE 6.0
+platform=WinNT
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows NT*.NET CLR*)*]
+parent=IE 6.0
+platform=WinNT
+netclr=True
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows XP*)*]
+parent=IE 6.0
+platform=WinXP
+
+[Mozilla/4.0 (compatible; MSIE 6.0*;*Windows XP*.NET CLR*)*]
+parent=IE 6.0
+platform=WinXP
+netclr=True
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Default Browser
+
+[*]
+browser=Default Browser
+css = 0
+frames = False
+iframes = False
+tables = True
+cookies = False
+backgroundsounds = False
+vbscript = False
+javascript = False
+javaapplets = False
+activexcontrols = False
+cdf = False
+aol = False
+beta = False
+Win16 = False
+crawler = False
+stripper = False
+wap = False
+netclr = False
diff --git a/data/config.in b/data/config.in
new file mode 100644
index 00000000000..c14657e7ad1
--- /dev/null
+++ b/data/config.in
@@ -0,0 +1,10 @@
+<configuration>
+ <dllmap dll="cygwin1.dll" target="@LIBC@" />
+ <dllmap dll="libc" target="@LIBC@" />
+ <dllmap dll="libintl" target="@INTL@" />
+ <dllmap dll="libxslt.dll" target="libxslt@libsuffix@" />
+ <dllmap dll="libmySQL.dll" target="libmysqlclient@libsuffix@" />
+ <dllmap dll="odbc32.dll" target="libodbc@libsuffix@" />
+ <dllmap dll="oci" target="clntsh" />
+ <dllmap dll="db2cli" target="libdb2_36@libsuffix@"/>
+</configuration>
diff --git a/data/net_1_1/.cvsignore b/data/net_1_1/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/data/net_1_1/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/data/net_1_1/DefaultWsdlHelpGenerator.aspx b/data/net_1_1/DefaultWsdlHelpGenerator.aspx
new file mode 100644
index 00000000000..f0f74e682bc
--- /dev/null
+++ b/data/net_1_1/DefaultWsdlHelpGenerator.aspx
@@ -0,0 +1,1794 @@
+<%--
+//
+// DefaultWsdlHelpGenerator.aspx:
+//
+// Author:
+// Lluis Sanchez Gual (lluis@ximian.com)
+//
+// (C) 2003 Ximian, Inc. http://www.ximian.com
+//
+--%>
+
+<%@ Import Namespace="System.Collections" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Xml.Serialization" %>
+<%@ Import Namespace="System.Xml" %>
+<%@ Import Namespace="System.Xml.Schema" %>
+<%@ Import Namespace="System.Web.Services.Description" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Net" %>
+<%@ Import Namespace="System.Globalization" %>
+<%@ Import Namespace="System.Resources" %>
+<%@ Import Namespace="System.Diagnostics" %>
+<%@ Import Namespace="System.CodeDom" %>
+<%@ Import Namespace="System.CodeDom.Compiler" %>
+<%@ Import Namespace="Microsoft.CSharp" %>
+<%@ Import Namespace="Microsoft.VisualBasic" %>
+<%@ Import Namespace="System.Text.RegularExpressions" %>
+<%@ Assembly name="System.Web.Services" %>
+<%@ Page debug="true" %>
+
+<html>
+<script language="C#" runat="server">
+
+ServiceDescriptionCollection descriptions;
+XmlSchemas schemas;
+
+string WebServiceName;
+string WebServiceDescription;
+string PageName;
+
+string DefaultBinding;
+ArrayList ServiceProtocols;
+
+string CurrentOperationName;
+string CurrentOperationBinding;
+string OperationDocumentation;
+string CurrentOperationFormat;
+bool CurrentOperationSupportsTest;
+ArrayList InParams;
+ArrayList OutParams;
+string CurrentOperationProtocols;
+int CodeTextColumns = 95;
+
+void Page_Load(object sender, EventArgs e)
+{
+ descriptions = (ServiceDescriptionCollection) Context.Items["wsdls"];
+ schemas = (XmlSchemas) Context.Items["schemas"];
+
+ ServiceDescription desc = descriptions [0];
+ if (schemas.Count == 0) schemas = desc.Types.Schemas;
+
+ Service service = desc.Services[0];
+ WebServiceName = service.Name;
+ if (desc.Bindings.Count == 0)
+ return;
+
+ DefaultBinding = desc.Bindings[0].Name;
+ WebServiceDescription = service.Documentation;
+ ServiceProtocols = FindServiceProtocols (null);
+
+ CurrentOperationName = Request.QueryString["op"];
+ CurrentOperationBinding = Request.QueryString["bnd"];
+ if (CurrentOperationName != null) BuildOperationInfo ();
+
+ PageName = HttpUtility.UrlEncode (Path.GetFileName(Request.Path), Encoding.UTF8);
+
+ ArrayList list = new ArrayList ();
+ foreach (ServiceDescription sd in descriptions) {
+ foreach (Binding bin in sd.Bindings)
+ if (bin.Extensions.Find (typeof(SoapBinding)) != null) list.Add (bin);
+ }
+
+ BindingsRepeater.DataSource = list;
+ Page.DataBind();
+}
+
+void BuildOperationInfo ()
+{
+ InParams = new ArrayList ();
+ OutParams = new ArrayList ();
+
+ Port port = FindPort (CurrentOperationBinding, null);
+ Binding binding = descriptions.GetBinding (port.Binding);
+
+ PortType portType = descriptions.GetPortType (binding.Type);
+ Operation oper = FindOperation (portType, CurrentOperationName);
+
+ OperationDocumentation = oper.Documentation;
+ if (OperationDocumentation == null || OperationDocumentation == "")
+ OperationDocumentation = "No additional remarks";
+
+ foreach (OperationMessage opm in oper.Messages)
+ {
+ if (opm is OperationInput)
+ BuildParameters (InParams, opm);
+ else if (opm is OperationOutput)
+ BuildParameters (OutParams, opm);
+ }
+
+ // Protocols supported by the operation
+ CurrentOperationProtocols = "";
+ ArrayList prots = FindServiceProtocols (CurrentOperationName);
+ for (int n=0; n<prots.Count; n++) {
+ if (n != 0) CurrentOperationProtocols += ", ";
+ CurrentOperationProtocols += (string) prots[n];
+ }
+
+ CurrentOperationSupportsTest = prots.Contains ("HttpGet") || prots.Contains ("HttpPost");
+
+ // Operation format
+ OperationBinding obin = FindOperation (binding, CurrentOperationName);
+ if (obin != null)
+ CurrentOperationFormat = GetOperationFormat (obin);
+
+ InputParamsRepeater.DataSource = InParams;
+ InputFormParamsRepeater.DataSource = InParams;
+ OutputParamsRepeater.DataSource = OutParams;
+}
+
+void BuildParameters (ArrayList list, OperationMessage opm)
+{
+ Message msg = descriptions.GetMessage (opm.Message);
+ if (msg.Parts.Count > 0 && msg.Parts[0].Name == "parameters")
+ {
+ MessagePart part = msg.Parts[0];
+ XmlSchemaComplexType ctype;
+ if (part.Element == XmlQualifiedName.Empty)
+ {
+ ctype = (XmlSchemaComplexType) schemas.Find (part.Type, typeof(XmlSchemaComplexType));
+ }
+ else
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (part.Element, typeof(XmlSchemaElement));
+ ctype = (XmlSchemaComplexType) elem.SchemaType;
+ }
+ XmlSchemaSequence seq = ctype.Particle as XmlSchemaSequence;
+ if (seq == null) return;
+
+ foreach (XmlSchemaObject ob in seq.Items)
+ {
+ Parameter p = new Parameter();
+ p.Description = "No additional remarks";
+
+ if (ob is XmlSchemaElement)
+ {
+ XmlSchemaElement selem = GetRefElement ((XmlSchemaElement)ob);
+ p.Name = selem.Name;
+ p.Type = selem.SchemaTypeName.Name;
+ }
+ else
+ {
+ p.Name = "Unknown";
+ p.Type = "Unknown";
+ }
+ list.Add (p);
+ }
+ }
+ else
+ {
+ foreach (MessagePart part in msg.Parts)
+ {
+ Parameter p = new Parameter ();
+ p.Description = "No additional remarks";
+ p.Name = part.Name;
+ if (part.Element == XmlQualifiedName.Empty)
+ p.Type = part.Type.Name;
+ else
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (part.Element, typeof(XmlSchemaElement));
+ p.Type = elem.SchemaTypeName.Name;
+ }
+ list.Add (p);
+ }
+ }
+}
+
+string GetOperationFormat (OperationBinding obin)
+{
+ string format = "";
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ if (sob != null) {
+ format = sob.Style.ToString ();
+ SoapBodyBinding sbb = obin.Input.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
+ if (sbb != null)
+ format += " / " + sbb.Use;
+ }
+ return format;
+}
+
+XmlSchemaElement GetRefElement (XmlSchemaElement elem)
+{
+ if (!elem.RefName.IsEmpty)
+ return (XmlSchemaElement) schemas.Find (elem.RefName, typeof(XmlSchemaElement));
+ else
+ return elem;
+}
+
+ArrayList FindServiceProtocols(string operName)
+{
+ ArrayList table = new ArrayList ();
+ Service service = descriptions[0].Services[0];
+ foreach (Port port in service.Ports)
+ {
+ string prot = null;
+ Binding bin = descriptions.GetBinding (port.Binding);
+ if (bin.Extensions.Find (typeof(SoapBinding)) != null)
+ prot = "Soap";
+ else
+ {
+ HttpBinding hb = (HttpBinding) bin.Extensions.Find (typeof(HttpBinding));
+ if (hb != null && hb.Verb == "POST") prot = "HttpPost";
+ else if (hb != null && hb.Verb == "GET") prot = "HttpGet";
+ }
+
+ if (prot != null && operName != null)
+ {
+ if (FindOperation (bin, operName) == null)
+ prot = null;
+ }
+
+ if (prot != null && !table.Contains (prot))
+ table.Add (prot);
+ }
+ return table;
+}
+
+Port FindPort (string portName, string protocol)
+{
+ Service service = descriptions[0].Services[0];
+ foreach (Port port in service.Ports)
+ {
+ if (portName == null)
+ {
+ Binding binding = descriptions.GetBinding (port.Binding);
+ if (GetProtocol (binding) == protocol) return port;
+ }
+ else if (port.Name == portName)
+ return port;
+ }
+ return null;
+}
+
+string GetProtocol (Binding binding)
+{
+ if (binding.Extensions.Find (typeof(SoapBinding)) != null) return "Soap";
+ HttpBinding hb = (HttpBinding) binding.Extensions.Find (typeof(HttpBinding));
+ if (hb == null) return "";
+ if (hb.Verb == "POST") return "HttpPost";
+ if (hb.Verb == "GET") return "HttpGet";
+ return "";
+}
+
+
+Operation FindOperation (PortType portType, string name)
+{
+ foreach (Operation oper in portType.Operations) {
+ if (oper.Messages.Input.Name != null) {
+ if (oper.Messages.Input.Name == name) return oper;
+ }
+ else
+ if (oper.Name == name) return oper;
+ }
+
+ return null;
+}
+
+OperationBinding FindOperation (Binding binding, string name)
+{
+ foreach (OperationBinding oper in binding.Operations) {
+ if (oper.Input.Name != null) {
+ if (oper.Input.Name == name) return oper;
+ }
+ else
+ if (oper.Name == name) return oper;
+ }
+
+ return null;
+}
+
+string FormatBindingName (string name)
+{
+ if (name == DefaultBinding) return "Methods";
+ else return "Methods for binding<br>" + name;
+}
+
+string GetOpName (object op)
+{
+ OperationBinding ob = op as OperationBinding;
+ if (ob == null) return "";
+ if (ob.Input.Name != null) return ob.Input.Name;
+ else return ob.Name;
+}
+
+bool HasFormResult
+{
+ get { return Request.QueryString ["ext"] == "testform"; }
+}
+
+string GetTestResult ()
+{
+ if (!HasFormResult) return null;
+
+ bool fill = false;
+ string qs = "";
+ for (int n=0; n<Request.QueryString.Count; n++)
+ {
+ if (fill) {
+ if (qs != "") qs += "&";
+ qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
+ }
+ if (Request.QueryString.GetKey(n) == "ext") fill = true;
+ }
+
+ string location = null;
+ ServiceDescription desc = descriptions [0];
+ Service service = desc.Services[0];
+ foreach (Port port in service.Ports)
+ if (port.Name == CurrentOperationBinding)
+ {
+ SoapAddressBinding sbi = (SoapAddressBinding) port.Extensions.Find (typeof(SoapAddressBinding));
+ if (sbi != null)
+ location = sbi.Location;
+ }
+
+ if (location == null)
+ return "Could not locate web service";
+
+ try
+ {
+ WebRequest req = WebRequest.Create (location + "/" + CurrentOperationName + "?" + qs);
+ HttpCookieCollection cookies = Request.Cookies;
+ int last = cookies.Count;
+ if (last > 0) {
+ CookieContainer container = new CookieContainer ();
+ for (int i = 0; i < last; i++) {
+ HttpCookie hcookie = cookies [i];
+ Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
+ container.Add (cookie);
+ }
+ ((HttpWebRequest) req).CookieContainer = container;
+ }
+ WebResponse resp = req.GetResponse();
+ StreamReader sr = new StreamReader (resp.GetResponseStream());
+ string s = sr.ReadToEnd ();
+ sr.Close ();
+ return "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
+ }
+ catch (Exception ex)
+ {
+ string res = "<b style='color:red'>" + ex.Message + "</b>";
+ WebException wex = ex as WebException;
+ if (wex != null)
+ {
+ WebResponse resp = wex.Response;
+ if (resp != null) {
+ StreamReader sr = new StreamReader (resp.GetResponseStream());
+ string s = sr.ReadToEnd ();
+ sr.Close ();
+ res += "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
+ }
+ }
+ return res;
+ }
+}
+
+string GenerateOperationMessages (string protocol, bool generateInput)
+{
+ if (!IsOperationSupported (protocol)) return "";
+
+ Port port;
+ if (protocol != "Soap") port = FindPort (null, protocol);
+ else port = FindPort (CurrentOperationBinding, null);
+
+ Binding binding = descriptions.GetBinding (port.Binding);
+ OperationBinding obin = FindOperation (binding, CurrentOperationName);
+ PortType portType = descriptions.GetPortType (binding.Type);
+ Operation oper = FindOperation (portType, CurrentOperationName);
+
+ HtmlSampleGenerator sg = new HtmlSampleGenerator (descriptions, schemas);
+ string txt = sg.GenerateMessage (port, obin, oper, protocol, generateInput);
+ if (protocol == "Soap") txt = WrapText (txt,CodeTextColumns);
+ txt = ColorizeXml (txt);
+ txt = txt.Replace ("@placeholder!","<span class='literal-placeholder'>");
+ txt = txt.Replace ("!placeholder@","</span>");
+ return txt;
+}
+
+bool IsOperationSupported (string protocol)
+{
+ if (CurrentPage != "op" || CurrentTab != "msg") return false;
+ if (protocol == "Soap") return true;
+
+ Port port = FindPort (null, protocol);
+ if (port == null) return false;
+ Binding binding = descriptions.GetBinding (port.Binding);
+ if (binding == null) return false;
+ return FindOperation (binding, CurrentOperationName) != null;
+}
+
+//
+// Proxy code generation
+//
+
+string GetProxyCode ()
+{
+ CodeNamespace codeNamespace = new CodeNamespace();
+ CodeCompileUnit codeUnit = new CodeCompileUnit();
+
+ codeUnit.Namespaces.Add (codeNamespace);
+
+ ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
+
+ foreach (ServiceDescription sd in descriptions)
+ importer.AddServiceDescription(sd, null, null);
+
+ foreach (XmlSchema sc in schemas)
+ importer.Schemas.Add (sc);
+
+ importer.Import(codeNamespace, codeUnit);
+
+ string langId = Request.QueryString ["lang"];
+ if (langId == null || langId == "") langId = "cs";
+ CodeDomProvider provider = GetProvider (langId);
+ ICodeGenerator generator = provider.CreateGenerator();
+ CodeGeneratorOptions options = new CodeGeneratorOptions();
+
+ StringWriter sw = new StringWriter ();
+ generator.GenerateCodeFromCompileUnit(codeUnit, sw, options);
+
+ return Colorize (WrapText (sw.ToString (), CodeTextColumns), langId);
+}
+
+public string CurrentLanguage
+{
+ get {
+ string langId = Request.QueryString ["lang"];
+ if (langId == null || langId == "") langId = "cs";
+ return langId;
+ }
+}
+
+public string CurrentProxytName
+{
+ get {
+ string lan = CurrentLanguage == "cs" ? "C#" : "Visual Basic";
+ return lan + " Client Proxy";
+ }
+}
+
+private CodeDomProvider GetProvider(string langId)
+{
+ switch (langId.ToUpper())
+ {
+ case "CS": return new CSharpCodeProvider();
+ case "VB": return new VBCodeProvider();
+ default: return null;
+ }
+}
+
+//
+// Document generation
+//
+
+string GenerateDocument ()
+{
+ StringWriter sw = new StringWriter ();
+
+ if (CurrentDocType == "wsdl")
+ descriptions [CurrentDocInd].Write (sw);
+ else if (CurrentDocType == "schema")
+ schemas [CurrentDocInd].Write (sw);
+
+ return Colorize (WrapText (sw.ToString (), CodeTextColumns), "xml");
+}
+
+public string CurrentDocType
+{
+ get { return Request.QueryString ["doctype"] != null ? Request.QueryString ["doctype"] : "wsdl"; }
+}
+
+public int CurrentDocInd
+{
+ get { return Request.QueryString ["docind"] != null ? int.Parse (Request.QueryString ["docind"]) : 0; }
+}
+
+public string CurrentDocumentName
+{
+ get {
+ if (CurrentDocType == "wsdl")
+ return "WSDL document for namespace \"" + descriptions [CurrentDocInd].TargetNamespace + "\"";
+ else
+ return "Xml Schema for namespace \"" + schemas [CurrentDocInd].TargetNamespace + "\"";
+ }
+}
+
+//
+// Pages and tabs
+//
+
+bool firstTab = true;
+ArrayList disabledTabs = new ArrayList ();
+
+string CurrentTab
+{
+ get { return Request.QueryString["tab"] != null ? Request.QueryString["tab"] : "main" ; }
+}
+
+string CurrentPage
+{
+ get { return Request.QueryString["page"] != null ? Request.QueryString["page"] : "main" ; }
+}
+
+void WriteTabs ()
+{
+ if (CurrentOperationName != null)
+ {
+ WriteTab ("main","Overview");
+ WriteTab ("test","Test Form");
+ WriteTab ("msg","Message Layout");
+ }
+}
+
+void WriteTab (string id, string label)
+{
+ if (!firstTab) Response.Write("&nbsp;|&nbsp;");
+ firstTab = false;
+
+ string cname = CurrentTab == id ? "tabLabelOn" : "tabLabelOff";
+ Response.Write ("<a href='" + PageName + "?" + GetPageContext(null) + GetDataContext() + "tab=" + id + "' style='text-decoration:none'>");
+ Response.Write ("<span class='" + cname + "'>" + label + "</span>");
+ Response.Write ("</a>");
+}
+
+string GetTabContext (string pag, string tab)
+{
+ if (tab == null) tab = CurrentTab;
+ if (pag == null) pag = CurrentPage;
+ if (pag != CurrentPage) tab = "main";
+ return "page=" + pag + "&tab=" + tab + "&";
+}
+
+string GetPageContext (string pag)
+{
+ if (pag == null) pag = CurrentPage;
+ return "page=" + pag + "&";
+}
+
+class Tab
+{
+ public string Id;
+ public string Label;
+}
+
+//
+// Syntax coloring
+//
+
+static string keywords_cs =
+ "(\\babstract\\b|\\bevent\\b|\\bnew\\b|\\bstruct\\b|\\bas\\b|\\bexplicit\\b|\\bnull\\b|\\bswitch\\b|\\bbase\\b|\\bextern\\b|" +
+ "\\bobject\\b|\\bthis\\b|\\bbool\\b|\\bfalse\\b|\\boperator\\b|\\bthrow\\b|\\bbreak\\b|\\bfinally\\b|\\bout\\b|\\btrue\\b|" +
+ "\\bbyte\\b|\\bfixed\\b|\\boverride\\b|\\btry\\b|\\bcase\\b|\\bfloat\\b|\\bparams\\b|\\btypeof\\b|\\bcatch\\b|\\bfor\\b|" +
+ "\\bprivate\\b|\\buint\\b|\\bchar\\b|\\bforeach\\b|\\bprotected\\b|\\bulong\\b|\\bchecked\\b|\\bgoto\\b|\\bpublic\\b|" +
+ "\\bunchecked\\b|\\bclass\\b|\\bif\\b|\\breadonly\\b|\\bunsafe\\b|\\bconst\\b|\\bimplicit\\b|\\bref\\b|\\bushort\\b|" +
+ "\\bcontinue\\b|\\bin\\b|\\breturn\\b|\\busing\\b|\\bdecimal\\b|\\bint\\b|\\bsbyte\\b|\\bvirtual\\b|\\bdefault\\b|" +
+ "\\binterface\\b|\\bsealed\\b|\\bvolatile\\b|\\bdelegate\\b|\\binternal\\b|\\bshort\\b|\\bvoid\\b|\\bdo\\b|\\bis\\b|" +
+ "\\bsizeof\\b|\\bwhile\\b|\\bdouble\\b|\\block\\b|\\bstackalloc\\b|\\belse\\b|\\blong\\b|\\bstatic\\b|\\benum\\b|" +
+ "\\bnamespace\\b|\\bstring\\b)";
+
+static string keywords_vb =
+ "(\\bAddHandler\\b|\\bAddressOf\\b|\\bAlias\\b|\\bAnd\\b|\\bAndAlso\\b|\\bAnsi\\b|\\bAs\\b|\\bAssembly\\b|" +
+ "\\bAuto\\b|\\bBoolean\\b|\\bByRef\\b|\\bByte\\b|\\bByVal\\b|\\bCall\\b|\\bCase\\b|\\bCatch\\b|" +
+ "\\bCBool\\b|\\bCByte\\b|\\bCChar\\b|\\bCDate\\b|\\bCDec\\b|\\bCDbl\\b|\\bChar\\b|\\bCInt\\b|" +
+ "\\bClass\\b|\\bCLng\\b|\\bCObj\\b|\\bConst\\b|\\bCShort\\b|\\bCSng\\b|\\bCStr\\b|\\bCType\\b|" +
+ "\\bDate\\b|\\bDecimal\\b|\\bDeclare\\b|\\bDefault\\b|\\bDelegate\\b|\\bDim\\b|\\bDirectCast\\b|\\bDo\\b|" +
+ "\\bDouble\\b|\\bEach\\b|\\bElse\\b|\\bElseIf\\b|\\bEnd\\b|\\bEnum\\b|\\bErase\\b|\\bError\\b|" +
+ "\\bEvent\\b|\\bExit\\b|\\bFalse\\b|\\bFinally\\b|\\bFor\\b|\\bFriend\\b|\\bFunction\\b|\\bGet\\b|" +
+ "\\bGetType\\b|\\bGoSub\\b|\\bGoTo\\b|\\bHandles\\b|\\bIf\\b|\\bImplements\\b|\\bImports\\b|\\bIn\\b|" +
+ "\\bInherits\\b|\\bInteger\\b|\\bInterface\\b|\\bIs\\b|\\bLet\\b|\\bLib\\b|\\bLike\\b|\\bLong\\b|" +
+ "\\bLoop\\b|\\bMe\\b|\\bMod\\b|\\bModule\\b|\\bMustInherit\\b|\\bMustOverride\\b|\\bMyBase\\b|\\bMyClass\\b|" +
+ "\\bNamespace\\b|\\bNew\\b|\\bNext\\b|\\bNot\\b|\\bNothing\\b|\\bNotInheritable\\b|\\bNotOverridable\\b|\\bObject\\b|" +
+ "\\bOn\\b|\\bOption\\b|\\bOptional\\b|\\bOr\\b|\\bOrElse\\b|\\bOverloads\\b|\\bOverridable\\b|\\bOverrides\\b|" +
+ "\\bParamArray\\b|\\bPreserve\\b|\\bPrivate\\b|\\bProperty\\b|\\bProtected\\b|\\bPublic\\b|\\bRaiseEvent\\b|\\bReadOnly\\b|" +
+ "\\bReDim\\b|\\bREM\\b|\\bRemoveHandler\\b|\\bResume\\b|\\bReturn\\b|\\bSelect\\b|\\bSet\\b|\\bShadows\\b|" +
+ "\\bShared\\b|\\bShort\\b|\\bSingle\\b|\\bStatic\\b|\\bStep\\b|\\bStop\\b|\\bString\\b|\\bStructure\\b|" +
+ "\\bSub\\b|\\bSyncLock\\b|\\bThen\\b|\\bThrow\\b|\\bTo\\b|\\bTrue\\b|\\bTry\\b|\\bTypeOf\\b|" +
+ "\\bUnicode\\b|\\bUntil\\b|\\bVariant\\b|\\bWhen\\b|\\bWhile\\b|\\bWith\\b|\\bWithEvents\\b|\\bWriteOnly\\b|\\bXor\\b)";
+
+string Colorize (string text, string lang)
+{
+ if (lang == "xml") return ColorizeXml (text);
+ else if (lang == "cs") return ColorizeCs (text);
+ else if (lang == "vb") return ColorizeVb (text);
+ else return text;
+}
+
+string ColorizeXml (string text)
+{
+ text = text.Replace (" ", "&nbsp;");
+ Regex re = new Regex ("\r\n|\r|\n");
+ text = re.Replace (text, "_br_");
+
+ re = new Regex ("<\\s*(\\/?)\\s*([\\s\\S]*?)\\s*(\\/?)\\s*>");
+ text = re.Replace (text,"{blue:&lt;$1}{maroon:$2}{blue:$3&gt;}");
+
+ re = new Regex ("\\{(\\w*):([\\s\\S]*?)\\}");
+ text = re.Replace (text,"<span style='color:$1'>$2</span>");
+
+ re = new Regex ("\"(.*?)\"");
+ text = re.Replace (text,"\"<span style='color:purple'>$1</span>\"");
+
+
+ text = text.Replace ("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+ text = text.Replace ("_br_", "<br>");
+ return text;
+}
+
+string ColorizeCs (string text)
+{
+ text = text.Replace (" ", "&nbsp;");
+
+ text = text.Replace ("<", "&lt;");
+ text = text.Replace (">", "&gt;");
+
+ Regex re = new Regex ("\"((((?!\").)|\\\")*?)\"");
+ text = re.Replace (text,"<span style='color:purple'>\"$1\"</span>");
+
+ re = new Regex ("//(((.(?!\"</span>))|\"(((?!\").)*)\"</span>)*)(\r|\n|\r\n)");
+ text = re.Replace (text,"<span style='color:green'>//$1</span><br/>");
+
+ re = new Regex (keywords_cs);
+ text = re.Replace (text,"<span style='color:blue'>$1</span>");
+
+ text = text.Replace ("\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+ text = text.Replace ("\n","<br/>");
+
+ return text;
+}
+
+string ColorizeVb (string text)
+{
+ text = text.Replace (" ", "&nbsp;");
+
+/* Regex re = new Regex ("\"((((?!\").)|\\\")*?)\"");
+ text = re.Replace (text,"<span style='color:purple'>\"$1\"</span>");
+
+ re = new Regex ("'(((.(?!\"\\<\\/span\\>))|\"(((?!\").)*)\"\\<\\/span\\>)*)(\r|\n|\r\n)");
+ text = re.Replace (text,"<span style='color:green'>//$1</span><br/>");
+
+ re = new Regex (keywords_vb);
+ text = re.Replace (text,"<span style='color:blue'>$1</span>");
+*/
+ text = text.Replace ("\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+ text = text.Replace ("\n","<br/>");
+ return text;
+}
+
+//
+// Helper methods and classes
+//
+
+string GetDataContext ()
+{
+ return "op=" + CurrentOperationName + "&bnd=" + CurrentOperationBinding + "&";
+}
+
+string GetOptionSel (string v1, string v2)
+{
+ string op = "<option ";
+ if (v1 == v2) op += "selected ";
+ return op + "value='" + v1 + "'>";
+}
+
+string WrapText (string text, int maxChars)
+{
+ text = text.Replace(" />","/>");
+
+ string linspace = null;
+ int lincount = 0;
+ int breakpos = 0;
+ int linstart = 0;
+ bool inquotes = false;
+ char lastc = ' ';
+ string sublineIndent = "";
+ System.Text.StringBuilder sb = new System.Text.StringBuilder ();
+ for (int n=0; n<text.Length; n++)
+ {
+ char c = text [n];
+
+ if (c=='\r' || c=='\n' || n==text.Length-1)
+ {
+ sb.Append (linspace + sublineIndent + text.Substring (linstart, n-linstart+1));
+ linspace = null;
+ lincount = 0;
+ linstart = n+1;
+ breakpos = linstart;
+ sublineIndent = "";
+ lastc = c;
+ continue;
+ }
+
+ if (lastc==',' || lastc=='(')
+ {
+ if (!inquotes) breakpos = n;
+ }
+
+ if (lincount > maxChars && breakpos >= linstart)
+ {
+ if (linspace != null)
+ sb.Append (linspace + sublineIndent);
+ sb.Append (text.Substring (linstart, breakpos-linstart));
+ sb.Append ("\n");
+ sublineIndent = " ";
+ lincount = linspace.Length + sublineIndent.Length + (n-breakpos);
+ linstart = breakpos;
+ }
+
+ if (c==' ' || c=='\t')
+ {
+ if (!inquotes)
+ breakpos = n;
+ }
+ else if (c=='"')
+ {
+ inquotes = !inquotes;
+ }
+ else
+ if (linspace == null) {
+ linspace = text.Substring (linstart, n-linstart);
+ linstart = n;
+ }
+
+ lincount++;
+ lastc = c;
+ }
+ return sb.ToString ();
+}
+
+class Parameter
+{
+ string name;
+ string type;
+ string description;
+
+ public string Name { get { return name; } set { name = value; } }
+ public string Type { get { return type; } set { type = value; } }
+ public string Description { get { return description; } set { description = value; } }
+}
+
+public class HtmlSampleGenerator: SampleGenerator
+{
+ public HtmlSampleGenerator (ServiceDescriptionCollection services, XmlSchemas schemas)
+ : base (services, schemas)
+ {
+ }
+
+ protected override string GetLiteral (string s)
+ {
+ return "@placeholder!" + s + "!placeholder@";
+ }
+}
+
+
+ public class SampleGenerator
+ {
+ protected ServiceDescriptionCollection descriptions;
+ protected XmlSchemas schemas;
+ XmlSchemaElement anyElement;
+ ArrayList queue;
+ SoapBindingUse currentUse;
+ XmlDocument document = new XmlDocument ();
+
+ static readonly XmlQualifiedName anyType = new XmlQualifiedName ("anyType",XmlSchema.Namespace);
+ static readonly XmlQualifiedName arrayType = new XmlQualifiedName ("Array","http://schemas.xmlsoap.org/soap/encoding/");
+ static readonly XmlQualifiedName arrayTypeRefName = new XmlQualifiedName ("arrayType","http://schemas.xmlsoap.org/soap/encoding/");
+ const string SoapEnvelopeNamespace = "http://schemas.xmlsoap.org/soap/envelope/";
+ const string WsdlNamespace = "http://schemas.xmlsoap.org/wsdl/";
+ const string SoapEncodingNamespace = "http://schemas.xmlsoap.org/soap/encoding/";
+
+ class EncodedType
+ {
+ public EncodedType (string ns, XmlSchemaElement elem) { Namespace = ns; Element = elem; }
+ public string Namespace;
+ public XmlSchemaElement Element;
+ }
+
+ public SampleGenerator (ServiceDescriptionCollection services, XmlSchemas schemas)
+ {
+ descriptions = services;
+ this.schemas = schemas;
+ queue = new ArrayList ();
+ }
+
+ public string GenerateMessage (Port port, OperationBinding obin, Operation oper, string protocol, bool generateInput)
+ {
+ OperationMessage msg = null;
+ foreach (OperationMessage opm in oper.Messages)
+ {
+ if (opm is OperationInput && generateInput) msg = opm;
+ else if (opm is OperationOutput && !generateInput) msg = opm;
+ }
+ if (msg == null) return null;
+
+ switch (protocol) {
+ case "Soap": return GenerateHttpSoapMessage (port, obin, oper, msg);
+ case "HttpGet": return GenerateHttpGetMessage (port, obin, oper, msg);
+ case "HttpPost": return GenerateHttpPostMessage (port, obin, oper, msg);
+ }
+ return "Unknown protocol";
+ }
+
+ public string GenerateHttpSoapMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ string req = "";
+
+ if (msg is OperationInput)
+ {
+ SoapAddressBinding sab = port.Extensions.Find (typeof(SoapAddressBinding)) as SoapAddressBinding;
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ req += "POST " + new Uri (sab.Location).AbsolutePath + "\n";
+ req += "SOAPAction: " + sob.SoapAction + "\n";
+ req += "Content-Type: text/xml; charset=utf-8\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n";
+ req += "Host: " + GetLiteral ("string") + "\n\n";
+ }
+ else
+ {
+ req += "HTTP/1.0 200 OK\n";
+ req += "Content-Type: text/xml; charset=utf-8\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n\n";
+ }
+
+ req += GenerateSoapMessage (obin, oper, msg);
+ return req;
+ }
+
+ public string GenerateHttpGetMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ string req = "";
+
+ if (msg is OperationInput)
+ {
+ HttpAddressBinding sab = port.Extensions.Find (typeof(HttpAddressBinding)) as HttpAddressBinding;
+ HttpOperationBinding sob = obin.Extensions.Find (typeof(HttpOperationBinding)) as HttpOperationBinding;
+ string location = new Uri (sab.Location).AbsolutePath + sob.Location + "?" + BuildQueryString (msg);
+ req += "GET " + location + "\n";
+ req += "Host: " + GetLiteral ("string");
+ }
+ else
+ {
+ req += "HTTP/1.0 200 OK\n";
+ req += "Content-Type: text/xml; charset=utf-8\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n\n";
+
+ MimeXmlBinding mxb = (MimeXmlBinding) obin.Output.Extensions.Find (typeof(MimeXmlBinding)) as MimeXmlBinding;
+ if (mxb == null) return req;
+
+ Message message = descriptions.GetMessage (msg.Message);
+ XmlQualifiedName ename = null;
+ foreach (MessagePart part in message.Parts)
+ if (part.Name == mxb.Part) ename = part.Element;
+
+ if (ename == null) return req + GetLiteral("string");
+
+ StringWriter sw = new StringWriter ();
+ XmlTextWriter xtw = new XmlTextWriter (sw);
+ xtw.Formatting = Formatting.Indented;
+ currentUse = SoapBindingUse.Literal;
+ WriteRootElementSample (xtw, ename);
+ xtw.Close ();
+ req += sw.ToString ();
+ }
+
+ return req;
+ }
+
+ public string GenerateHttpPostMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ string req = "";
+
+ if (msg is OperationInput)
+ {
+ HttpAddressBinding sab = port.Extensions.Find (typeof(HttpAddressBinding)) as HttpAddressBinding;
+ HttpOperationBinding sob = obin.Extensions.Find (typeof(HttpOperationBinding)) as HttpOperationBinding;
+ string location = new Uri (sab.Location).AbsolutePath + sob.Location;
+ req += "POST " + location + "\n";
+ req += "Content-Type: application/x-www-form-urlencoded\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n";
+ req += "Host: " + GetLiteral ("string") + "\n\n";
+ req += BuildQueryString (msg);
+ }
+ else return GenerateHttpGetMessage (port, obin, oper, msg);
+
+ return req;
+ }
+
+ string BuildQueryString (OperationMessage opm)
+ {
+ string s = "";
+ Message msg = descriptions.GetMessage (opm.Message);
+ foreach (MessagePart part in msg.Parts)
+ {
+ if (s.Length != 0) s += "&";
+ s += part.Name + "=" + GetLiteral (part.Type.Name);
+ }
+ return s;
+ }
+
+ public string GenerateSoapMessage (OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ SoapBindingStyle style = (sob != null) ? sob.Style : SoapBindingStyle.Document;
+
+ MessageBinding msgbin = (msg is OperationInput) ? (MessageBinding) obin.Input : (MessageBinding)obin.Output;
+ SoapBodyBinding sbb = msgbin.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
+ SoapBindingUse bodyUse = (sbb != null) ? sbb.Use : SoapBindingUse.Literal;
+
+ StringWriter sw = new StringWriter ();
+ XmlTextWriter xtw = new XmlTextWriter (sw);
+ xtw.Formatting = Formatting.Indented;
+
+ xtw.WriteStartDocument ();
+ xtw.WriteStartElement ("soap", "Envelope", SoapEnvelopeNamespace);
+ xtw.WriteAttributeString ("xmlns", "xsi", null, XmlSchema.InstanceNamespace);
+ xtw.WriteAttributeString ("xmlns", "xsd", null, XmlSchema.Namespace);
+
+ if (bodyUse == SoapBindingUse.Encoded)
+ {
+ xtw.WriteAttributeString ("xmlns", "soapenc", null, SoapEncodingNamespace);
+ xtw.WriteAttributeString ("xmlns", "tns", null, msg.Message.Namespace);
+ }
+
+ // Serialize headers
+
+ bool writtenHeader = false;
+ foreach (object ob in msgbin.Extensions)
+ {
+ SoapHeaderBinding hb = ob as SoapHeaderBinding;
+ if (hb == null) continue;
+
+ if (!writtenHeader) {
+ xtw.WriteStartElement ("soap", "Header", SoapEnvelopeNamespace);
+ writtenHeader = true;
+ }
+
+ WriteHeader (xtw, hb);
+ }
+
+ if (writtenHeader)
+ xtw.WriteEndElement ();
+
+ // Serialize body
+ xtw.WriteStartElement ("soap", "Body", SoapEnvelopeNamespace);
+
+ currentUse = bodyUse;
+ WriteBody (xtw, oper, msg, sbb, style);
+
+ xtw.WriteEndElement ();
+ xtw.WriteEndElement ();
+ xtw.Close ();
+ return sw.ToString ();
+ }
+
+ void WriteHeader (XmlTextWriter xtw, SoapHeaderBinding header)
+ {
+ Message msg = descriptions.GetMessage (header.Message);
+ if (msg == null) throw new InvalidOperationException ("Message " + header.Message + " not found");
+ MessagePart part = msg.Parts [header.Part];
+ if (part == null) throw new InvalidOperationException ("Message part " + header.Part + " not found in message " + header.Message);
+
+ currentUse = header.Use;
+
+ if (currentUse == SoapBindingUse.Literal)
+ WriteRootElementSample (xtw, part.Element);
+ else
+ WriteTypeSample (xtw, part.Type);
+ }
+
+ void WriteBody (XmlTextWriter xtw, Operation oper, OperationMessage opm, SoapBodyBinding sbb, SoapBindingStyle style)
+ {
+ Message msg = descriptions.GetMessage (opm.Message);
+ if (msg.Parts.Count > 0 && msg.Parts[0].Name == "parameters")
+ {
+ MessagePart part = msg.Parts[0];
+ if (part.Element == XmlQualifiedName.Empty)
+ WriteTypeSample (xtw, part.Type);
+ else
+ WriteRootElementSample (xtw, part.Element);
+ }
+ else
+ {
+ string elemName = oper.Name;
+ string ns = "";
+ if (opm is OperationOutput) elemName += "Response";
+
+ if (style == SoapBindingStyle.Rpc) {
+ xtw.WriteStartElement (elemName, sbb.Namespace);
+ ns = sbb.Namespace;
+ }
+
+ foreach (MessagePart part in msg.Parts)
+ {
+ if (part.Element == XmlQualifiedName.Empty)
+ {
+ XmlSchemaElement elem = new XmlSchemaElement ();
+ elem.SchemaTypeName = part.Type;
+ elem.Name = part.Name;
+ WriteElementSample (xtw, ns, elem);
+ }
+ else
+ WriteRootElementSample (xtw, part.Element);
+ }
+
+ if (style == SoapBindingStyle.Rpc)
+ xtw.WriteEndElement ();
+ }
+ WriteQueuedTypeSamples (xtw);
+ }
+
+ void WriteRootElementSample (XmlTextWriter xtw, XmlQualifiedName qname)
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (qname, typeof(XmlSchemaElement));
+ if (elem == null) throw new InvalidOperationException ("Element not found: " + qname);
+ WriteElementSample (xtw, qname.Namespace, elem);
+ }
+
+ void WriteElementSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
+ {
+ bool sharedAnnType = false;
+ XmlQualifiedName root;
+
+ if (!elem.RefName.IsEmpty) {
+ XmlSchemaElement refElem = FindRefElement (elem);
+ if (refElem == null) throw new InvalidOperationException ("Global element not found: " + elem.RefName);
+ root = elem.RefName;
+ elem = refElem;
+ sharedAnnType = true;
+ }
+ else
+ root = new XmlQualifiedName (elem.Name, ns);
+
+ if (!elem.SchemaTypeName.IsEmpty)
+ {
+ XmlSchemaComplexType st = FindComplexTyype (elem.SchemaTypeName);
+ if (st != null)
+ WriteComplexTypeSample (xtw, st, root);
+ else
+ {
+ xtw.WriteStartElement (root.Name, root.Namespace);
+ if (currentUse == SoapBindingUse.Encoded)
+ xtw.WriteAttributeString ("type", XmlSchema.InstanceNamespace, GetQualifiedNameString (xtw, elem.SchemaTypeName));
+ xtw.WriteString (GetLiteral (FindBuiltInType (elem.SchemaTypeName)));
+ xtw.WriteEndElement ();
+ }
+ }
+ else if (elem.SchemaType == null)
+ {
+ xtw.WriteStartElement ("any");
+ xtw.WriteEndElement ();
+ }
+ else
+ WriteComplexTypeSample (xtw, (XmlSchemaComplexType) elem.SchemaType, root);
+ }
+
+ void WriteTypeSample (XmlTextWriter xtw, XmlQualifiedName qname)
+ {
+ XmlSchemaComplexType ctype = FindComplexTyype (qname);
+ if (ctype != null) {
+ WriteComplexTypeSample (xtw, ctype, qname);
+ return;
+ }
+
+ XmlSchemaSimpleType stype = (XmlSchemaSimpleType) schemas.Find (qname, typeof(XmlSchemaSimpleType));
+ if (stype != null) {
+ WriteSimpleTypeSample (xtw, stype);
+ return;
+ }
+
+ xtw.WriteString (GetLiteral (FindBuiltInType (qname)));
+ throw new InvalidOperationException ("Type not found: " + qname);
+ }
+
+ void WriteComplexTypeSample (XmlTextWriter xtw, XmlSchemaComplexType stype, XmlQualifiedName rootName)
+ {
+ WriteComplexTypeSample (xtw, stype, rootName, -1);
+ }
+
+ void WriteComplexTypeSample (XmlTextWriter xtw, XmlSchemaComplexType stype, XmlQualifiedName rootName, int id)
+ {
+ string ns = rootName.Namespace;
+
+ if (rootName.Name.IndexOf ("[]") != -1) rootName = arrayType;
+
+ if (currentUse == SoapBindingUse.Encoded) {
+ string pref = xtw.LookupPrefix (rootName.Namespace);
+ if (pref == null) pref = "q1";
+ xtw.WriteStartElement (pref, rootName.Name, rootName.Namespace);
+ ns = "";
+ }
+ else
+ xtw.WriteStartElement (rootName.Name, rootName.Namespace);
+
+ if (id != -1)
+ {
+ xtw.WriteAttributeString ("id", "id" + id);
+ if (rootName != arrayType)
+ xtw.WriteAttributeString ("type", XmlSchema.InstanceNamespace, GetQualifiedNameString (xtw, rootName));
+ }
+
+ WriteComplexTypeAttributes (xtw, stype);
+ WriteComplexTypeElements (xtw, ns, stype);
+
+ xtw.WriteEndElement ();
+ }
+
+ void WriteComplexTypeAttributes (XmlTextWriter xtw, XmlSchemaComplexType stype)
+ {
+ WriteAttributes (xtw, stype.Attributes, stype.AnyAttribute);
+ }
+
+ void WriteComplexTypeElements (XmlTextWriter xtw, string ns, XmlSchemaComplexType stype)
+ {
+ if (stype.Particle != null)
+ WriteParticleComplexContent (xtw, ns, stype.Particle);
+ else
+ {
+ if (stype.ContentModel is XmlSchemaSimpleContent)
+ WriteSimpleContent (xtw, (XmlSchemaSimpleContent)stype.ContentModel);
+ else if (stype.ContentModel is XmlSchemaComplexContent)
+ WriteComplexContent (xtw, ns, (XmlSchemaComplexContent)stype.ContentModel);
+ }
+ }
+
+ void WriteAttributes (XmlTextWriter xtw, XmlSchemaObjectCollection atts, XmlSchemaAnyAttribute anyat)
+ {
+ foreach (XmlSchemaObject at in atts)
+ {
+ if (at is XmlSchemaAttribute)
+ {
+ string ns;
+ XmlSchemaAttribute attr = (XmlSchemaAttribute)at;
+ XmlSchemaAttribute refAttr = attr;
+
+ // refAttr.Form; TODO
+
+ if (!attr.RefName.IsEmpty) {
+ refAttr = FindRefAttribute (attr.RefName);
+ if (refAttr == null) throw new InvalidOperationException ("Global attribute not found: " + attr.RefName);
+ }
+
+ string val;
+ if (!refAttr.SchemaTypeName.IsEmpty) val = FindBuiltInType (refAttr.SchemaTypeName);
+ else val = FindBuiltInType ((XmlSchemaSimpleType) refAttr.SchemaType);
+
+ xtw.WriteAttributeString (refAttr.Name, val);
+ }
+ else if (at is XmlSchemaAttributeGroupRef)
+ {
+ XmlSchemaAttributeGroupRef gref = (XmlSchemaAttributeGroupRef)at;
+ XmlSchemaAttributeGroup grp = (XmlSchemaAttributeGroup) schemas.Find (gref.RefName, typeof(XmlSchemaAttributeGroup));
+ WriteAttributes (xtw, grp.Attributes, grp.AnyAttribute);
+ }
+ }
+
+ if (anyat != null)
+ xtw.WriteAttributeString ("custom-attribute","value");
+ }
+
+ void WriteParticleComplexContent (XmlTextWriter xtw, string ns, XmlSchemaParticle particle)
+ {
+ WriteParticleContent (xtw, ns, particle, false);
+ }
+
+ void WriteParticleContent (XmlTextWriter xtw, string ns, XmlSchemaParticle particle, bool multiValue)
+ {
+ if (particle is XmlSchemaGroupRef)
+ particle = GetRefGroupParticle ((XmlSchemaGroupRef)particle);
+
+ if (particle.MaxOccurs > 1) multiValue = true;
+
+ if (particle is XmlSchemaSequence) {
+ WriteSequenceContent (xtw, ns, ((XmlSchemaSequence)particle).Items, multiValue);
+ }
+ else if (particle is XmlSchemaChoice) {
+ if (((XmlSchemaChoice)particle).Items.Count == 1)
+ WriteSequenceContent (xtw, ns, ((XmlSchemaChoice)particle).Items, multiValue);
+ else
+ WriteChoiceContent (xtw, ns, (XmlSchemaChoice)particle, multiValue);
+ }
+ else if (particle is XmlSchemaAll) {
+ WriteSequenceContent (xtw, ns, ((XmlSchemaAll)particle).Items, multiValue);
+ }
+ }
+
+ void WriteSequenceContent (XmlTextWriter xtw, string ns, XmlSchemaObjectCollection items, bool multiValue)
+ {
+ foreach (XmlSchemaObject item in items)
+ WriteContentItem (xtw, ns, item, multiValue);
+ }
+
+ void WriteContentItem (XmlTextWriter xtw, string ns, XmlSchemaObject item, bool multiValue)
+ {
+ if (item is XmlSchemaGroupRef)
+ item = GetRefGroupParticle ((XmlSchemaGroupRef)item);
+
+ if (item is XmlSchemaElement)
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) item;
+ XmlSchemaElement refElem;
+ if (!elem.RefName.IsEmpty) refElem = FindRefElement (elem);
+ else refElem = elem;
+
+ int num = (elem.MaxOccurs == 1 && !multiValue) ? 1 : 2;
+ for (int n=0; n<num; n++)
+ {
+ if (currentUse == SoapBindingUse.Literal)
+ WriteElementSample (xtw, ns, refElem);
+ else
+ WriteRefTypeSample (xtw, ns, refElem);
+ }
+ }
+ else if (item is XmlSchemaAny)
+ {
+ xtw.WriteString (GetLiteral ("xml"));
+ }
+ else if (item is XmlSchemaParticle) {
+ WriteParticleContent (xtw, ns, (XmlSchemaParticle)item, multiValue);
+ }
+ }
+
+ void WriteChoiceContent (XmlTextWriter xtw, string ns, XmlSchemaChoice choice, bool multiValue)
+ {
+ foreach (XmlSchemaObject item in choice.Items)
+ WriteContentItem (xtw, ns, item, multiValue);
+ }
+
+ void WriteSimpleContent (XmlTextWriter xtw, XmlSchemaSimpleContent content)
+ {
+ XmlSchemaSimpleContentExtension ext = content.Content as XmlSchemaSimpleContentExtension;
+ if (ext != null)
+ WriteAttributes (xtw, ext.Attributes, ext.AnyAttribute);
+
+ XmlQualifiedName qname = GetContentBaseType (content.Content);
+ xtw.WriteString (GetLiteral (FindBuiltInType (qname)));
+ }
+
+ string FindBuiltInType (XmlQualifiedName qname)
+ {
+ if (qname.Namespace == XmlSchema.Namespace)
+ return qname.Name;
+
+ XmlSchemaComplexType ct = FindComplexTyype (qname);
+ if (ct != null)
+ {
+ XmlSchemaSimpleContent sc = ct.ContentModel as XmlSchemaSimpleContent;
+ if (sc == null) throw new InvalidOperationException ("Invalid schema");
+ return FindBuiltInType (GetContentBaseType (sc.Content));
+ }
+
+ XmlSchemaSimpleType st = (XmlSchemaSimpleType) schemas.Find (qname, typeof(XmlSchemaSimpleType));
+ if (st != null)
+ return FindBuiltInType (st);
+
+ throw new InvalidOperationException ("Definition of type " + qname + " not found");
+ }
+
+ string FindBuiltInType (XmlSchemaSimpleType st)
+ {
+ if (st.Content is XmlSchemaSimpleTypeRestriction) {
+ return FindBuiltInType (GetContentBaseType (st.Content));
+ }
+ else if (st.Content is XmlSchemaSimpleTypeList) {
+ string s = FindBuiltInType (GetContentBaseType (st.Content));
+ return s + " " + s + " ...";
+ }
+ else if (st.Content is XmlSchemaSimpleTypeUnion)
+ {
+ //Check if all types of the union are equal. If not, then will use anyType.
+ XmlSchemaSimpleTypeUnion uni = (XmlSchemaSimpleTypeUnion) st.Content;
+ string utype = null;
+
+ // Anonymous types are unique
+ if (uni.BaseTypes.Count != 0 && uni.MemberTypes.Length != 0)
+ return "string";
+
+ foreach (XmlQualifiedName mt in uni.MemberTypes)
+ {
+ string qn = FindBuiltInType (mt);
+ if (utype != null && qn != utype) return "string";
+ else utype = qn;
+ }
+ return utype;
+ }
+ else
+ return "string";
+ }
+
+
+ XmlQualifiedName GetContentBaseType (XmlSchemaObject ob)
+ {
+ if (ob is XmlSchemaSimpleContentExtension)
+ return ((XmlSchemaSimpleContentExtension)ob).BaseTypeName;
+ else if (ob is XmlSchemaSimpleContentRestriction)
+ return ((XmlSchemaSimpleContentRestriction)ob).BaseTypeName;
+ else if (ob is XmlSchemaSimpleTypeRestriction)
+ return ((XmlSchemaSimpleTypeRestriction)ob).BaseTypeName;
+ else if (ob is XmlSchemaSimpleTypeList)
+ return ((XmlSchemaSimpleTypeList)ob).ItemTypeName;
+ else
+ return null;
+ }
+
+ void WriteComplexContent (XmlTextWriter xtw, string ns, XmlSchemaComplexContent content)
+ {
+ XmlQualifiedName qname;
+
+ XmlSchemaComplexContentExtension ext = content.Content as XmlSchemaComplexContentExtension;
+ if (ext != null) qname = ext.BaseTypeName;
+ else {
+ XmlSchemaComplexContentRestriction rest = (XmlSchemaComplexContentRestriction)content.Content;
+ qname = rest.BaseTypeName;
+ if (qname == arrayType) {
+ ParseArrayType (rest, out qname);
+ XmlSchemaElement elem = new XmlSchemaElement ();
+ elem.Name = "Item";
+ elem.SchemaTypeName = qname;
+
+ xtw.WriteAttributeString ("arrayType", SoapEncodingNamespace, qname.Name + "[2]");
+ WriteContentItem (xtw, ns, elem, true);
+ return;
+ }
+ }
+
+ // Add base map members to this map
+ XmlSchemaComplexType ctype = FindComplexTyype (qname);
+ WriteComplexTypeAttributes (xtw, ctype);
+
+ if (ext != null) {
+ // Add the members of this map
+ WriteAttributes (xtw, ext.Attributes, ext.AnyAttribute);
+ if (ext.Particle != null)
+ WriteParticleComplexContent (xtw, ns, ext.Particle);
+ }
+
+ WriteComplexTypeElements (xtw, ns, ctype);
+ }
+
+ void ParseArrayType (XmlSchemaComplexContentRestriction rest, out XmlQualifiedName qtype)
+ {
+ XmlSchemaAttribute arrayTypeAt = FindArrayAttribute (rest.Attributes);
+ XmlAttribute[] uatts = arrayTypeAt.UnhandledAttributes;
+ if (uatts == null || uatts.Length == 0) throw new InvalidOperationException ("arrayType attribute not specified in array declaration");
+
+ XmlAttribute xat = null;
+ foreach (XmlAttribute at in uatts)
+ if (at.LocalName == "arrayType" && at.NamespaceURI == WsdlNamespace)
+ { xat = at; break; }
+
+ if (xat == null)
+ throw new InvalidOperationException ("arrayType attribute not specified in array declaration");
+
+ string arrayType = xat.Value;
+ string type, ns;
+ int i = arrayType.LastIndexOf (":");
+ if (i == -1) ns = "";
+ else ns = arrayType.Substring (0,i);
+
+ int j = arrayType.IndexOf ("[", i+1);
+ if (j == -1) throw new InvalidOperationException ("Cannot parse WSDL array type: " + arrayType);
+ type = arrayType.Substring (i+1);
+ type = type.Substring (0, type.Length-2);
+
+ qtype = new XmlQualifiedName (type, ns);
+ }
+
+ XmlSchemaAttribute FindArrayAttribute (XmlSchemaObjectCollection atts)
+ {
+ foreach (object ob in atts)
+ {
+ XmlSchemaAttribute att = ob as XmlSchemaAttribute;
+ if (att != null && att.RefName == arrayTypeRefName) return att;
+
+ XmlSchemaAttributeGroupRef gref = ob as XmlSchemaAttributeGroupRef;
+ if (gref != null)
+ {
+ XmlSchemaAttributeGroup grp = (XmlSchemaAttributeGroup) schemas.Find (gref.RefName, typeof(XmlSchemaAttributeGroup));
+ att = FindArrayAttribute (grp.Attributes);
+ if (att != null) return att;
+ }
+ }
+ return null;
+ }
+
+ void WriteSimpleTypeSample (XmlTextWriter xtw, XmlSchemaSimpleType stype)
+ {
+ xtw.WriteString (GetLiteral (FindBuiltInType (stype)));
+ }
+
+ XmlSchemaParticle GetRefGroupParticle (XmlSchemaGroupRef refGroup)
+ {
+ XmlSchemaGroup grp = (XmlSchemaGroup) schemas.Find (refGroup.RefName, typeof (XmlSchemaGroup));
+ return grp.Particle;
+ }
+
+ XmlSchemaElement FindRefElement (XmlSchemaElement elem)
+ {
+ if (elem.RefName.Namespace == XmlSchema.Namespace)
+ {
+ if (anyElement != null) return anyElement;
+ anyElement = new XmlSchemaElement ();
+ anyElement.Name = "any";
+ anyElement.SchemaTypeName = anyType;
+ return anyElement;
+ }
+ return (XmlSchemaElement) schemas.Find (elem.RefName, typeof(XmlSchemaElement));
+ }
+
+ XmlSchemaAttribute FindRefAttribute (XmlQualifiedName refName)
+ {
+ if (refName.Namespace == XmlSchema.Namespace)
+ {
+ XmlSchemaAttribute at = new XmlSchemaAttribute ();
+ at.Name = refName.Name;
+ at.SchemaTypeName = new XmlQualifiedName ("string",XmlSchema.Namespace);
+ return at;
+ }
+ return (XmlSchemaAttribute) schemas.Find (refName, typeof(XmlSchemaAttribute));
+ }
+
+ void WriteRefTypeSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
+ {
+ if (elem.SchemaTypeName.Namespace == XmlSchema.Namespace || schemas.Find (elem.SchemaTypeName, typeof(XmlSchemaSimpleType)) != null)
+ WriteElementSample (xtw, ns, elem);
+ else
+ {
+ xtw.WriteStartElement (elem.Name, ns);
+ xtw.WriteAttributeString ("href", "#id" + (queue.Count+1));
+ xtw.WriteEndElement ();
+ queue.Add (new EncodedType (ns, elem));
+ }
+ }
+
+ void WriteQueuedTypeSamples (XmlTextWriter xtw)
+ {
+ for (int n=0; n<queue.Count; n++)
+ {
+ EncodedType ec = (EncodedType) queue[n];
+ XmlSchemaComplexType st = FindComplexTyype (ec.Element.SchemaTypeName);
+ WriteComplexTypeSample (xtw, st, ec.Element.SchemaTypeName, n+1);
+ }
+ }
+
+ XmlSchemaComplexType FindComplexTyype (XmlQualifiedName qname)
+ {
+ if (qname.Name.IndexOf ("[]") != -1)
+ {
+ XmlSchemaComplexType stype = new XmlSchemaComplexType ();
+ stype.ContentModel = new XmlSchemaComplexContent ();
+
+ XmlSchemaComplexContentRestriction res = new XmlSchemaComplexContentRestriction ();
+ stype.ContentModel.Content = res;
+ res.BaseTypeName = arrayType;
+
+ XmlSchemaAttribute att = new XmlSchemaAttribute ();
+ att.RefName = arrayTypeRefName;
+ res.Attributes.Add (att);
+
+ XmlAttribute xat = document.CreateAttribute ("arrayType", WsdlNamespace);
+ xat.Value = qname.Namespace + ":" + qname.Name;
+ att.UnhandledAttributes = new XmlAttribute[] {xat};
+ return stype;
+ }
+
+ return (XmlSchemaComplexType) schemas.Find (qname, typeof(XmlSchemaComplexType));
+ }
+
+ string GetQualifiedNameString (XmlTextWriter xtw, XmlQualifiedName qname)
+ {
+ string pref = xtw.LookupPrefix (qname.Namespace);
+ if (pref != null) return pref + ":" + qname.Name;
+
+ xtw.WriteAttributeString ("xmlns", "q1", null, qname.Namespace);
+ return "q1:" + qname.Name;
+ }
+
+ protected virtual string GetLiteral (string s)
+ {
+ return s;
+ }
+
+ void GetOperationFormat (OperationBinding obin, out SoapBindingStyle style, out SoapBindingUse use)
+ {
+ style = SoapBindingStyle.Document;
+ use = SoapBindingUse.Literal;
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ if (sob != null) {
+ style = sob.Style;
+ SoapBodyBinding sbb = obin.Input.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
+ if (sbb != null)
+ use = sbb.Use;
+ }
+ }
+ }
+
+
+
+
+
+</script>
+
+<head>
+ <link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>
+
+ <title><%=WebServiceName%> Web Service</title>
+ <style type="text/css">
+ BODY { font-family: Arial; margin-left: 20px; margin-top: 20px; font-size: x-small}
+ TABLE { font-size: x-small }
+ .title { color:dimgray; font-family: Arial; font-size:20pt; font-weight:900}
+ .operationTitle { color:dimgray; font-family: Arial; font-size:15pt; font-weight:900}
+ .method { font-size: x-small }
+ .bindingLabel { font-size: x-small; font-weight:bold; color:darkgray; line-height:8pt; display:block; margin-bottom:3px }
+ .label { font-size: small; font-weight:bold; color:darkgray }
+ .paramTable { font-size: x-small }
+ .paramTable TR { background-color: gainsboro }
+ .paramFormTable { font-size: x-small; padding: 10px; background-color: gainsboro }
+ .paramFormTable TR { background-color: gainsboro }
+ .paramInput { border: solid 1px gray }
+ .button {border: solid 1px gray }
+ .smallSeparator { height:3px; overflow:hidden }
+ .panel { background-color:whitesmoke; border: solid 1px silver; border-top: solid 1px silver }
+ .codePanel { background-color: white; font-size:x-small; padding:7px; border:solid 1px silver}
+ .code-xml { font-size:10pt; font-family:courier }
+ .code-cs { font-size:10pt; font-family:courier }
+ .code-vb { font-size:10pt; font-family:courier }
+ .tabLabelOn { font-weight:bold }
+ .tabLabelOff {color: darkgray }
+ .literal-placeholder {color: darkblue; font-weight:bold}
+ A:link { color: black; }
+ A:visited { color: black; }
+ A:active { color: black; }
+ A:hover { color: blue }
+ </style>
+
+<script>
+function clearForm ()
+{
+ document.getElementById("testFormResult").style.display="none";
+}
+</script>
+
+</head>
+
+<body>
+<div class="title" style="margin-left:20px">
+<span class="label">Web Service</span><br>
+<%=WebServiceName%>
+</div>
+
+<!--
+ **********************************************************
+ Left panel
+-->
+
+<table border="0" width="100%" cellpadding="15px" cellspacing="15px">
+<tr valign="top"><td width="150px" class="panel">
+<div style="width:150px"></div>
+<a class="method" href='<%=PageName%>'>Overview</a><br>
+<div class="smallSeparator"></div>
+<a class="method" href='<%=PageName + "?" + GetPageContext("wsdl")%>'>Service Description</a>
+<div class="smallSeparator"></div>
+<a class="method" href='<%=PageName + "?" + GetPageContext("proxy")%>'>Client proxy</a>
+<br><br>
+ <asp:repeater id="BindingsRepeater" runat=server>
+ <itemtemplate name="itemtemplate">
+ <span class="bindingLabel"><%#FormatBindingName(DataBinder.Eval(Container.DataItem, "Name").ToString())%></span>
+ <asp:repeater id="OperationsRepeater" runat=server datasource='<%# ((Binding)Container.DataItem).Operations %>'>
+ <itemtemplate>
+ <a class="method" href="<%#PageName%>?<%#GetTabContext("op",null)%>op=<%#GetOpName(Container.DataItem)%>&bnd=<%#DataBinder.Eval(Container.DataItem, "Binding.Name")%>"><%#GetOpName(Container.DataItem)%></a>
+ <div class="smallSeparator"></div>
+ </itemtemplate>
+ </asp:repeater>
+ <br>
+ </itemtemplate>
+ </asp:repeater>
+
+</td><td class="panel">
+
+<% if (CurrentPage == "main") {%>
+
+<!--
+ **********************************************************
+ Web service overview
+-->
+
+ <p class="label">Web Service Overview</p>
+ <%#WebServiceDescription%>
+
+<%} if (DefaultBinding == null) {%>
+This service does not contain any public web method.
+<%} else if (CurrentPage == "op") {%>
+
+<!--
+ **********************************************************
+ Operation description
+-->
+
+ <span class="operationTitle"><%#CurrentOperationName%></span>
+ <br><br>
+ <% WriteTabs (); %>
+ <br><br><br>
+
+ <% if (CurrentTab == "main") { %>
+ <span class="label">Input Parameters</span>
+ <div class="smallSeparator"></div>
+ <% if (InParams.Count == 0) { %>
+ No input parameters<br>
+ <% } else { %>
+ <table class="paramTable" cellspacing="1" cellpadding="5">
+ <asp:repeater id="InputParamsRepeater" runat=server>
+ <itemtemplate>
+ <tr>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Name")%></td>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Type")%></td>
+ </tr>
+ </itemtemplate>
+ </asp:repeater>
+ </table>
+ <% } %>
+ <br>
+
+ <% if (OutParams.Count > 0) { %>
+ <span class="label">Output Parameters</span>
+ <div class="smallSeparator"></div>
+ <table class="paramTable" cellspacing="1" cellpadding="5">
+ <asp:repeater id="OutputParamsRepeater" runat=server>
+ <itemtemplate>
+ <tr>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Name")%></td>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Type")%></td>
+ </tr>
+ </itemtemplate>
+ </asp:repeater>
+ </table>
+ <br>
+ <% } %>
+
+ <span class="label">Remarks</span>
+ <div class="smallSeparator"></div>
+ <%#OperationDocumentation%>
+ <br><br>
+ <span class="label">Technical information</span>
+ <div class="smallSeparator"></div>
+ Format: <%#CurrentOperationFormat%>
+ <br>Supported protocols: <%#CurrentOperationProtocols%>
+ <% } %>
+
+<!--
+ **********************************************************
+ Operation description - Test form
+-->
+
+ <% if (CurrentTab == "test") {
+ if (CurrentOperationSupportsTest) {%>
+ Enter values for the parameters and click the 'Invoke' button to test this method:<br><br>
+ <form action="<%#PageName%>" method="GET">
+ <input type="hidden" name="page" value="<%#CurrentPage%>">
+ <input type="hidden" name="tab" value="<%#CurrentTab%>">
+ <input type="hidden" name="op" value="<%#CurrentOperationName%>">
+ <input type="hidden" name="bnd" value="<%#CurrentOperationBinding%>">
+ <input type="hidden" name="ext" value="testform">
+ <table class="paramFormTable" cellspacing="0" cellpadding="3">
+ <asp:repeater id="InputFormParamsRepeater" runat=server>
+ <itemtemplate>
+ <tr>
+ <td><%#DataBinder.Eval(Container.DataItem, "Name")%>:&nbsp;</td>
+ <td width="150"><input class="paramInput" type="text" size="20" name="<%#DataBinder.Eval(Container.DataItem, "Name")%>"></td>
+ </tr>
+ </itemtemplate>
+ </asp:repeater>
+ <tr><td></td><td><input class="button" type="submit" value="Invoke">&nbsp;<input class="button" type="button" onclick="clearForm()" value="Clear"></td></tr>
+ </table>
+ </form>
+ <div id="testFormResult" style="display:<%# (HasFormResult?"block":"none") %>">
+ The web service returned the following result:<br/><br/>
+ <div class="codePanel"><%#GetTestResult()%></div>
+ </div>
+ <% } else {%>
+ The test form is not available for this operation because it has parameters with a complex structure.
+ <% } %>
+ <% } %>
+
+<!--
+ **********************************************************
+ Operation description - Message Layout
+-->
+
+ <% if (CurrentTab == "msg") { %>
+
+ The following are sample SOAP requests and responses for each protocol supported by this method:
+ <br/><br/>
+
+ <% if (IsOperationSupported ("Soap")) { %>
+ <span class="label">Soap</span>
+ <br/><br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("Soap", true)%></div></div>
+ <br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("Soap", false)%></div></div>
+ <br/>
+ <% } %>
+ <% if (IsOperationSupported ("HttpGet")) { %>
+ <span class="label">HTTP Get</span>
+ <br/><br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpGet", true)%></div></div>
+ <br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpGet", false)%></div></div>
+ <br/>
+ <% } %>
+ <% if (IsOperationSupported ("HttpPost")) { %>
+ <span class="label">HTTP Post</span>
+ <br/><br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpPost", true)%></div></div>
+ <br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpPost", false)%></div></div>
+ <br/>
+ <% } %>
+
+ <% } %>
+<%} else if (CurrentPage == "proxy") {%>
+<!--
+ **********************************************************
+ Client Proxy
+-->
+ <form action="<%#PageName%>" name="langForm" method="GET">
+ Select the language for which you want to generate a proxy
+ <input type="hidden" name="page" value="<%#CurrentPage%>">&nbsp;
+ <SELECT name="lang" onchange="langForm.submit()">
+ <%#GetOptionSel("cs",CurrentLanguage)%>C#</option>
+ <%#GetOptionSel("vb",CurrentLanguage)%>Visual Basic</option>
+ </SELECT>
+ &nbsp;&nbsp;
+ </form>
+ <br>
+ <span class="label"><%#CurrentProxytName%></span>&nbsp;&nbsp;&nbsp;
+ <a href="<%#PageName + "?code=" + CurrentLanguage%>">Download</a>
+ <br><br>
+ <div class="codePanel">
+ <div class="code-<%#CurrentLanguage%>"><%#GetProxyCode ()%></div>
+ </div>
+<%} else if (CurrentPage == "wsdl") {%>
+<!--
+ **********************************************************
+ Service description
+-->
+ <% if (descriptions.Count > 1 || schemas.Count > 1) {%>
+ The description of this web service is composed by several documents. Click on the document you want to see:
+
+ <ul>
+ <%
+ for (int n=0; n<descriptions.Count; n++)
+ Response.Write ("<li><a href='" + PageName + "?" + GetPageContext(null) + "doctype=wsdl&docind=" + n + "'>WSDL document " + descriptions[n].TargetNamespace + "</a></li>");
+ for (int n=0; n<schemas.Count; n++)
+ Response.Write ("<li><a href='" + PageName + "?" + GetPageContext(null) + "doctype=schema&docind=" + n + "'>Xml Schema " + schemas[n].TargetNamespace + "</a></li>");
+ %>
+ </ul>
+
+ <%} else {%>
+ <%}%>
+ <br>
+ <span class="label"><%#CurrentDocumentName%></span>&nbsp;&nbsp;&nbsp;
+ <a href="<%=PageName + "?" + CurrentDocType + "=" + CurrentDocInd %>">Download</a>
+ <br><br>
+ <div class="codePanel">
+ <div class="code-xml"><%#GenerateDocument ()%></div>
+ </div>
+
+<%}%>
+
+<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+</td>
+<td withd="20px"></td>
+</tr>
+
+</table>
+</body>
+</html>
diff --git a/data/net_1_1/Makefile.am b/data/net_1_1/Makefile.am
new file mode 100644
index 00000000000..f39776299c7
--- /dev/null
+++ b/data/net_1_1/Makefile.am
@@ -0,0 +1,8 @@
+monodir = $(sysconfdir)/mono/1.0
+
+EXTRA_DIST = machine.config \
+ DefaultWsdlHelpGenerator.aspx
+
+mono_DATA = machine.config \
+ DefaultWsdlHelpGenerator.aspx
+
diff --git a/data/net_1_1/machine.config b/data/net_1_1/machine.config
new file mode 100644
index 00000000000..c4666300b0b
--- /dev/null
+++ b/data/net_1_1/machine.config
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+
+ <configSections>
+ <section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="system.runtime.remoting" type="System.Configuration.IgnoreSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
+ <sectionGroup name="system.web">
+ <section name="httpHandlers"
+ type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="httpModules"
+ type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="machineKey"
+ type="System.Web.Configuration.MachineKeyConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="authentication"
+ type="System.Web.Configuration.AuthenticationConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="authorization"
+ type="System.Web.Configuration.AuthorizationConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="globalization"
+ type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="sessionState"
+ type="System.Web.SessionState.SessionStateSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="trace"
+ type="System.Web.Configuration.TraceConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="webServices"
+ type="System.Web.Services.Configuration.WebServicesConfigurationSectionHandler, System.Web.Services, Version=1.0.5000.0 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="webControls"
+ type="System.Web.Configuration.WebControlsSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="compilation"
+ type="System.Web.Configuration.CompilationConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="httpRuntime"
+ type="System.Web.Configuration.HttpRuntimeConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="customErrors"
+ type="System.Web.Configuration.CustomErrorsConfigHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="pages"
+ type="System.Web.Configuration.PagesConfigurationHandler, System.Web, Version=1.0.5000.0, Culture=neutral" />
+ <section name="clientTarget"
+ type="System.Web.Configuration.ClientTargetSectionHandler, System.Web, Version=1.0.5000.0, Culture=neutral" />
+ </sectionGroup>
+ <sectionGroup name="system.net">
+ <section name="settings"
+ type="System.Net.Configuration.NetConfigurationHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="connectionManagement"
+ type="System.Net.Configuration.ConnectionManagementHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="authenticationModules"
+ type="System.Net.Configuration.NetAuthenticationModuleHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="defaultProxy"
+ type="System.Net.Configuration.DefaultProxyHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="webRequestModules"
+ type="System.Net.Configuration.WebRequestModuleHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </sectionGroup>
+ <section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </configSections>
+ <system.net>
+ <connectionManagement>
+ <add address="*" maxconnection="2" />
+ </connectionManagement>
+ <authenticationModules>
+ <add type="System.Net.BasicClient, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add type="System.Net.DigestClient, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add type="System.Net.NtlmClient, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </authenticationModules>
+ <defaultProxy>
+ <proxy />
+ <!-- bypassonlocal and proxyaddress are ok -->
+ <!-- usessystemdefault is not supported -->
+ </defaultProxy>
+ <webRequestModules>
+ <add prefix="http" type="System.Net.HttpRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add prefix="https" type="System.Net.HttpRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </webRequestModules>
+ <settings>
+ <ipv6 enabled="false"/>
+ </settings>
+ </system.net>
+ <system.web>
+ <httpHandlers>
+ <add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
+ <add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
+ <add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ </httpHandlers>
+ <httpModules>
+ <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add name="OutputCache" type="System.Web.Caching.OutputCacheModule, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ </httpModules>
+ <authentication mode="Forms">
+ <forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
+ <credentials passwordFormat="Clear">
+ <!--<user name="gonzalo" password="gonz"/>-->
+ </credentials>
+ </forms>
+ </authentication>
+ <machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
+ <globalization requestEncoding="utf-8"
+ responseEncoding="utf-8"
+ fileEncoding="utf-8"/>
+ <!--
+ culture="en-US"
+ uiculture="en-US" />
+ -->
+ <sessionState mode="InProc" />
+ <webServices>
+ <protocols>
+ <add name="HttpSoap"/>
+ <add name="HttpPost"/>
+ <add name="HttpGet"/>
+ <add name="Documentation"/>
+ </protocols>
+ <wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
+ </webServices>
+ <webControls clientScriptsLocation="/web_scripts" />
+ <compilation debug="false" defaultLanguage="c#">
+ <compilers>
+ <compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
+ type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
+ warningLevel="1" compilerOptions=""
+ type="Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </compilers>
+ <assemblies>
+ <!--<add assembly="mscorlib" /> -->
+ <add assembly="System" />
+ <add assembly="System.Xml" />
+ <add assembly="System.Data" />
+ <add assembly="System.Web" />
+ <add assembly="System.Web.Services" />
+ <add assembly="System.Drawing" />
+ <add assembly="*" /> <!-- Add assemblies in bin directory -->
+ </assemblies>
+ </compilation>
+ <httpRuntime executionTimeout="90"
+ maxRequestLength="4096"
+ useFullyQualifiedRedirectUrl="false"
+ minFreeThreads="8"
+ minLocalRequestFreeThreads="4"
+ appRequestQueueLimit="100" />
+ <pages buffer="true"
+ enableSessionState="true"
+ autoEventWireup="true"
+ validateRequest="true" />
+ <clientTarget>
+ <add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
+ <add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
+ <add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
+ <add alias="downlevel" userAgent="Unknown" />
+ </clientTarget>
+ </system.web>
+
+ <system.runtime.remoting>
+ <application>
+ <channels>
+ <channel ref="http client" displayName="http client (delay loaded)" delayLoadAsClientChannel="true" />
+ <channel ref="tcp client" displayName="tcp client (delay loaded)" delayLoadAsClientChannel="true" />
+ </channels>
+ </application>
+ <channels>
+ <channel id="http" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="http client" type="System.Runtime.Remoting.Channels.Http.HttpClientChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="http server" type="System.Runtime.Remoting.Channels.Http.HttpServerChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="tcp" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="tcp client" type="System.Runtime.Remoting.Channels.Tcp.TcpClientChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="tcp server" type="System.Runtime.Remoting.Channels.Tcp.TcpServerChannel, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </channels>
+ <channelSinkProviders>
+ <clientProviders>
+ <formatter id="soap" type="System.Runtime.Remoting.Channels.SoapClientFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </clientProviders>
+ <serverProviders>
+ <formatter id="soap" type="System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <provider id="wsdl" type="System.Runtime.Remoting.MetadataServices.SdlChannelSinkProvider, System.Runtime.Remoting, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </serverProviders>
+ </channelSinkProviders>
+ </system.runtime.remoting>
+
+ <appSettings>
+ <!--<add key="yourkey" value="your value" /> -->
+ <!--<remove key="a key defined higher in the hierarchy" /> -->
+ <!--<clear/> Removes all defined settings -->
+ </appSettings>
+ <system.diagnostics>
+ <trace autoflush="false" indentsize="4" />
+ </system.diagnostics>
+ <system.drawing>
+ </system.drawing>
+
+ <strongNames>
+ <pubTokenMapping>
+ <!-- ECMA key -->
+ <map Token="b77a5c561934e089" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ <!-- Microsoft (final) key -->
+ <map Token="b03f5f7f11d50a3a" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ <!-- Microsoft (Web Service Enhancement) key -->
+ <map Token="31bf3856ad364e35" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ <!-- IBM (DB2 Data Provider) key -->
+ <map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ </pubTokenMapping>
+ </strongNames>
+</configuration>
+
+
diff --git a/data/net_2_0/.cvsignore b/data/net_2_0/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/data/net_2_0/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/data/net_2_0/DefaultWsdlHelpGenerator.aspx b/data/net_2_0/DefaultWsdlHelpGenerator.aspx
new file mode 100644
index 00000000000..3f529af4e3a
--- /dev/null
+++ b/data/net_2_0/DefaultWsdlHelpGenerator.aspx
@@ -0,0 +1,1817 @@
+<%--
+//
+// DefaultWsdlHelpGenerator.aspx:
+//
+// Author:
+// Lluis Sanchez Gual (lluis@ximian.com)
+//
+// (C) 2003 Ximian, Inc. http://www.ximian.com
+//
+--%>
+
+<%@ Import Namespace="System.Collections" %>
+<%@ Import Namespace="System.IO" %>
+<%@ Import Namespace="System.Xml.Serialization" %>
+<%@ Import Namespace="System.Xml" %>
+<%@ Import Namespace="System.Xml.Schema" %>
+<%@ Import Namespace="System.Web.Services" %>
+<%@ Import Namespace="System.Web.Services.Description" %>
+<%@ Import Namespace="System" %>
+<%@ Import Namespace="System.Net" %>
+<%@ Import Namespace="System.Globalization" %>
+<%@ Import Namespace="System.Resources" %>
+<%@ Import Namespace="System.Diagnostics" %>
+<%@ Import Namespace="System.CodeDom" %>
+<%@ Import Namespace="System.CodeDom.Compiler" %>
+<%@ Import Namespace="Microsoft.CSharp" %>
+<%@ Import Namespace="Microsoft.VisualBasic" %>
+<%@ Import Namespace="System.Text.RegularExpressions" %>
+<%@ Assembly name="System.Web.Services" %>
+<%@ Page debug="true" %>
+
+<html>
+<script language="C#" runat="server">
+
+ServiceDescriptionCollection descriptions;
+XmlSchemas schemas;
+
+string WebServiceName;
+string WebServiceDescription;
+string PageName;
+
+string DefaultBinding;
+ArrayList ServiceProtocols;
+
+string CurrentOperationName;
+string CurrentOperationBinding;
+string OperationDocumentation;
+string CurrentOperationFormat;
+bool CurrentOperationSupportsTest;
+ArrayList InParams;
+ArrayList OutParams;
+string CurrentOperationProtocols;
+int CodeTextColumns = 95;
+BasicProfileViolationCollection ProfileViolations;
+
+void Page_Load(object sender, EventArgs e)
+{
+ descriptions = (ServiceDescriptionCollection) Context.Items["wsdls"];
+ schemas = (XmlSchemas) Context.Items["schemas"];
+
+ ServiceDescription desc = descriptions [0];
+ if (schemas.Count == 0) schemas = desc.Types.Schemas;
+
+ Service service = desc.Services[0];
+ WebServiceName = service.Name;
+ if (desc.Bindings.Count == 0)
+ return;
+
+ DefaultBinding = desc.Bindings[0].Name;
+ WebServiceDescription = service.Documentation;
+ if (WebServiceDescription == "" || WebServiceDescription == null)
+ WebServiceDescription = "Description has not been provided";
+ ServiceProtocols = FindServiceProtocols (null);
+
+ CurrentOperationName = Request.QueryString["op"];
+ CurrentOperationBinding = Request.QueryString["bnd"];
+ if (CurrentOperationName != null) BuildOperationInfo ();
+
+ PageName = HttpUtility.UrlEncode (Path.GetFileName(Request.Path), Encoding.UTF8);
+
+ ArrayList list = new ArrayList ();
+ foreach (ServiceDescription sd in descriptions) {
+ foreach (Binding bin in sd.Bindings)
+ if (bin.Extensions.Find (typeof(SoapBinding)) != null) list.Add (bin);
+ }
+
+ BindingsRepeater.DataSource = list;
+ Page.DataBind();
+
+ ProfileViolations = new BasicProfileViolationCollection ();
+ WebServicesInteroperability.CheckConformance (WsiClaims.BP10, descriptions, ProfileViolations);
+}
+
+void BuildOperationInfo ()
+{
+ InParams = new ArrayList ();
+ OutParams = new ArrayList ();
+
+ Port port = FindPort (CurrentOperationBinding, null);
+ Binding binding = descriptions.GetBinding (port.Binding);
+
+ PortType portType = descriptions.GetPortType (binding.Type);
+ Operation oper = FindOperation (portType, CurrentOperationName);
+
+ OperationDocumentation = oper.Documentation;
+ if (OperationDocumentation == null || OperationDocumentation == "")
+ OperationDocumentation = "No additional remarks";
+
+ foreach (OperationMessage opm in oper.Messages)
+ {
+ if (opm is OperationInput)
+ BuildParameters (InParams, opm);
+ else if (opm is OperationOutput)
+ BuildParameters (OutParams, opm);
+ }
+
+ // Protocols supported by the operation
+ CurrentOperationProtocols = "";
+ ArrayList prots = FindServiceProtocols (CurrentOperationName);
+ for (int n=0; n<prots.Count; n++) {
+ if (n != 0) CurrentOperationProtocols += ", ";
+ CurrentOperationProtocols += (string) prots[n];
+ }
+
+ CurrentOperationSupportsTest = prots.Contains ("HttpGet") || prots.Contains ("HttpPost");
+
+ // Operation format
+ OperationBinding obin = FindOperation (binding, CurrentOperationName);
+ if (obin != null)
+ CurrentOperationFormat = GetOperationFormat (obin);
+
+ InputParamsRepeater.DataSource = InParams;
+ InputFormParamsRepeater.DataSource = InParams;
+ OutputParamsRepeater.DataSource = OutParams;
+}
+
+void BuildParameters (ArrayList list, OperationMessage opm)
+{
+ Message msg = descriptions.GetMessage (opm.Message);
+ if (msg.Parts.Count > 0 && msg.Parts[0].Name == "parameters")
+ {
+ MessagePart part = msg.Parts[0];
+ XmlSchemaComplexType ctype;
+ if (part.Element == XmlQualifiedName.Empty)
+ {
+ ctype = (XmlSchemaComplexType) schemas.Find (part.Type, typeof(XmlSchemaComplexType));
+ }
+ else
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (part.Element, typeof(XmlSchemaElement));
+ ctype = (XmlSchemaComplexType) elem.SchemaType;
+ }
+ XmlSchemaSequence seq = ctype.Particle as XmlSchemaSequence;
+ if (seq == null) return;
+
+ foreach (XmlSchemaObject ob in seq.Items)
+ {
+ Parameter p = new Parameter();
+ p.Description = "No additional remarks";
+
+ if (ob is XmlSchemaElement)
+ {
+ XmlSchemaElement selem = GetRefElement ((XmlSchemaElement)ob);
+ p.Name = selem.Name;
+ p.Type = selem.SchemaTypeName.Name;
+ }
+ else
+ {
+ p.Name = "Unknown";
+ p.Type = "Unknown";
+ }
+ list.Add (p);
+ }
+ }
+ else
+ {
+ foreach (MessagePart part in msg.Parts)
+ {
+ Parameter p = new Parameter ();
+ p.Description = "No additional remarks";
+ p.Name = part.Name;
+ if (part.Element == XmlQualifiedName.Empty)
+ p.Type = part.Type.Name;
+ else
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (part.Element, typeof(XmlSchemaElement));
+ p.Type = elem.SchemaTypeName.Name;
+ }
+ list.Add (p);
+ }
+ }
+}
+
+string GetOperationFormat (OperationBinding obin)
+{
+ string format = "";
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ if (sob != null) {
+ format = sob.Style.ToString ();
+ SoapBodyBinding sbb = obin.Input.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
+ if (sbb != null)
+ format += " / " + sbb.Use;
+ }
+ return format;
+}
+
+XmlSchemaElement GetRefElement (XmlSchemaElement elem)
+{
+ if (!elem.RefName.IsEmpty)
+ return (XmlSchemaElement) schemas.Find (elem.RefName, typeof(XmlSchemaElement));
+ else
+ return elem;
+}
+
+ArrayList FindServiceProtocols(string operName)
+{
+ ArrayList table = new ArrayList ();
+ Service service = descriptions[0].Services[0];
+ foreach (Port port in service.Ports)
+ {
+ string prot = null;
+ Binding bin = descriptions.GetBinding (port.Binding);
+ if (bin.Extensions.Find (typeof(SoapBinding)) != null)
+ prot = "Soap";
+ else
+ {
+ HttpBinding hb = (HttpBinding) bin.Extensions.Find (typeof(HttpBinding));
+ if (hb != null && hb.Verb == "POST") prot = "HttpPost";
+ else if (hb != null && hb.Verb == "GET") prot = "HttpGet";
+ }
+
+ if (prot != null && operName != null)
+ {
+ if (FindOperation (bin, operName) == null)
+ prot = null;
+ }
+
+ if (prot != null && !table.Contains (prot))
+ table.Add (prot);
+ }
+ return table;
+}
+
+Port FindPort (string portName, string protocol)
+{
+ Service service = descriptions[0].Services[0];
+ foreach (Port port in service.Ports)
+ {
+ if (portName == null)
+ {
+ Binding binding = descriptions.GetBinding (port.Binding);
+ if (GetProtocol (binding) == protocol) return port;
+ }
+ else if (port.Name == portName)
+ return port;
+ }
+ return null;
+}
+
+string GetProtocol (Binding binding)
+{
+ if (binding.Extensions.Find (typeof(SoapBinding)) != null) return "Soap";
+ HttpBinding hb = (HttpBinding) binding.Extensions.Find (typeof(HttpBinding));
+ if (hb == null) return "";
+ if (hb.Verb == "POST") return "HttpPost";
+ if (hb.Verb == "GET") return "HttpGet";
+ return "";
+}
+
+
+Operation FindOperation (PortType portType, string name)
+{
+ foreach (Operation oper in portType.Operations) {
+ if (oper.Messages.Input.Name != null) {
+ if (oper.Messages.Input.Name == name) return oper;
+ }
+ else
+ if (oper.Name == name) return oper;
+ }
+
+ return null;
+}
+
+OperationBinding FindOperation (Binding binding, string name)
+{
+ foreach (OperationBinding oper in binding.Operations) {
+ if (oper.Input.Name != null) {
+ if (oper.Input.Name == name) return oper;
+ }
+ else
+ if (oper.Name == name) return oper;
+ }
+
+ return null;
+}
+
+string FormatBindingName (string name)
+{
+ if (name == DefaultBinding) return "Methods";
+ else return "Methods for binding<br>" + name;
+}
+
+string GetOpName (object op)
+{
+ OperationBinding ob = op as OperationBinding;
+ if (ob == null) return "";
+ if (ob.Input.Name != null) return ob.Input.Name;
+ else return ob.Name;
+}
+
+bool HasFormResult
+{
+ get { return Request.QueryString ["ext"] == "testform"; }
+}
+
+string GetTestResult ()
+{
+ if (!HasFormResult) return null;
+
+ bool fill = false;
+ string qs = "";
+ for (int n=0; n<Request.QueryString.Count; n++)
+ {
+ if (fill) {
+ if (qs != "") qs += "&";
+ qs += Request.QueryString.GetKey(n) + "=" + Server.UrlEncode (Request.QueryString [n]);
+ }
+ if (Request.QueryString.GetKey(n) == "ext") fill = true;
+ }
+
+ string location = null;
+ ServiceDescription desc = descriptions [0];
+ Service service = desc.Services[0];
+ foreach (Port port in service.Ports)
+ if (port.Name == CurrentOperationBinding)
+ {
+ SoapAddressBinding sbi = (SoapAddressBinding) port.Extensions.Find (typeof(SoapAddressBinding));
+ if (sbi != null)
+ location = sbi.Location;
+ }
+
+ if (location == null)
+ return "Could not locate web service";
+
+ try
+ {
+ WebRequest req = WebRequest.Create (location + "/" + CurrentOperationName + "?" + qs);
+ HttpCookieCollection cookies = Request.Cookies;
+ int last = cookies.Count;
+ if (last > 0) {
+ CookieContainer container = new CookieContainer ();
+ for (int i = 0; i < last; i++) {
+ HttpCookie hcookie = cookies [i];
+ Cookie cookie = new Cookie (hcookie.Name, hcookie.Value, hcookie.Path, hcookie.Domain);
+ container.Add (cookie);
+ }
+ ((HttpWebRequest) req).CookieContainer = container;
+ }
+ WebResponse resp = req.GetResponse();
+ StreamReader sr = new StreamReader (resp.GetResponseStream());
+ string s = sr.ReadToEnd ();
+ sr.Close ();
+ return "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
+ }
+ catch (Exception ex)
+ {
+ string res = "<b style='color:red'>" + ex.Message + "</b>";
+ WebException wex = ex as WebException;
+ if (wex != null)
+ {
+ WebResponse resp = wex.Response;
+ if (resp != null) {
+ StreamReader sr = new StreamReader (resp.GetResponseStream());
+ string s = sr.ReadToEnd ();
+ sr.Close ();
+ res += "<div class='code-xml'>" + ColorizeXml(WrapText(s,CodeTextColumns)) + "</div>";
+ }
+ }
+ return res;
+ }
+}
+
+string GenerateOperationMessages (string protocol, bool generateInput)
+{
+ if (!IsOperationSupported (protocol)) return "";
+
+ Port port;
+ if (protocol != "Soap") port = FindPort (null, protocol);
+ else port = FindPort (CurrentOperationBinding, null);
+
+ Binding binding = descriptions.GetBinding (port.Binding);
+ OperationBinding obin = FindOperation (binding, CurrentOperationName);
+ PortType portType = descriptions.GetPortType (binding.Type);
+ Operation oper = FindOperation (portType, CurrentOperationName);
+
+ HtmlSampleGenerator sg = new HtmlSampleGenerator (descriptions, schemas);
+ string txt = sg.GenerateMessage (port, obin, oper, protocol, generateInput);
+ if (protocol == "Soap") txt = WrapText (txt,CodeTextColumns);
+ txt = ColorizeXml (txt);
+ txt = txt.Replace ("@placeholder!","<span class='literal-placeholder'>");
+ txt = txt.Replace ("!placeholder@","</span>");
+ return txt;
+}
+
+bool IsOperationSupported (string protocol)
+{
+ if (CurrentPage != "op" || CurrentTab != "msg") return false;
+ if (protocol == "Soap") return true;
+
+ Port port = FindPort (null, protocol);
+ if (port == null) return false;
+ Binding binding = descriptions.GetBinding (port.Binding);
+ if (binding == null) return false;
+ return FindOperation (binding, CurrentOperationName) != null;
+}
+
+//
+// Proxy code generation
+//
+
+string GetProxyCode ()
+{
+ CodeNamespace codeNamespace = new CodeNamespace();
+ CodeCompileUnit codeUnit = new CodeCompileUnit();
+
+ codeUnit.Namespaces.Add (codeNamespace);
+
+ ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
+
+ foreach (ServiceDescription sd in descriptions)
+ importer.AddServiceDescription(sd, null, null);
+
+ foreach (XmlSchema sc in schemas)
+ importer.Schemas.Add (sc);
+
+ importer.Import(codeNamespace, codeUnit);
+
+ string langId = Request.QueryString ["lang"];
+ if (langId == null || langId == "") langId = "cs";
+ CodeDomProvider provider = GetProvider (langId);
+ ICodeGenerator generator = provider.CreateGenerator();
+ CodeGeneratorOptions options = new CodeGeneratorOptions();
+
+ StringWriter sw = new StringWriter ();
+ generator.GenerateCodeFromCompileUnit(codeUnit, sw, options);
+
+ return Colorize (WrapText (sw.ToString (), CodeTextColumns), langId);
+}
+
+public string CurrentLanguage
+{
+ get {
+ string langId = Request.QueryString ["lang"];
+ if (langId == null || langId == "") langId = "cs";
+ return langId;
+ }
+}
+
+public string CurrentProxytName
+{
+ get {
+ string lan = CurrentLanguage == "cs" ? "C#" : "Visual Basic";
+ return lan + " Client Proxy";
+ }
+}
+
+private CodeDomProvider GetProvider(string langId)
+{
+ switch (langId.ToUpper())
+ {
+ case "CS": return new CSharpCodeProvider();
+ case "VB": return new VBCodeProvider();
+ default: return null;
+ }
+}
+
+//
+// Document generation
+//
+
+string GenerateDocument ()
+{
+ StringWriter sw = new StringWriter ();
+
+ if (CurrentDocType == "wsdl")
+ descriptions [CurrentDocInd].Write (sw);
+ else if (CurrentDocType == "schema")
+ schemas [CurrentDocInd].Write (sw);
+
+ return Colorize (WrapText (sw.ToString (), CodeTextColumns), "xml");
+}
+
+public string CurrentDocType
+{
+ get { return Request.QueryString ["doctype"] != null ? Request.QueryString ["doctype"] : "wsdl"; }
+}
+
+public int CurrentDocInd
+{
+ get { return Request.QueryString ["docind"] != null ? int.Parse (Request.QueryString ["docind"]) : 0; }
+}
+
+public string CurrentDocumentName
+{
+ get {
+ if (CurrentDocType == "wsdl")
+ return "WSDL document for namespace \"" + descriptions [CurrentDocInd].TargetNamespace + "\"";
+ else
+ return "Xml Schema for namespace \"" + schemas [CurrentDocInd].TargetNamespace + "\"";
+ }
+}
+
+//
+// Pages and tabs
+//
+
+bool firstTab = true;
+ArrayList disabledTabs = new ArrayList ();
+
+string CurrentTab
+{
+ get { return Request.QueryString["tab"] != null ? Request.QueryString["tab"] : "main" ; }
+}
+
+string CurrentPage
+{
+ get { return Request.QueryString["page"] != null ? Request.QueryString["page"] : "main" ; }
+}
+
+void WriteTabs ()
+{
+ if (CurrentOperationName != null)
+ {
+ WriteTab ("main","Overview");
+ WriteTab ("test","Test Form");
+ WriteTab ("msg","Message Layout");
+ }
+}
+
+void WriteTab (string id, string label)
+{
+ if (!firstTab) Response.Write("&nbsp;|&nbsp;");
+ firstTab = false;
+
+ string cname = CurrentTab == id ? "tabLabelOn" : "tabLabelOff";
+ Response.Write ("<a href='" + PageName + "?" + GetPageContext(null) + GetDataContext() + "tab=" + id + "' style='text-decoration:none'>");
+ Response.Write ("<span class='" + cname + "'>" + label + "</span>");
+ Response.Write ("</a>");
+}
+
+string GetTabContext (string pag, string tab)
+{
+ if (tab == null) tab = CurrentTab;
+ if (pag == null) pag = CurrentPage;
+ if (pag != CurrentPage) tab = "main";
+ return "page=" + pag + "&tab=" + tab + "&";
+}
+
+string GetPageContext (string pag)
+{
+ if (pag == null) pag = CurrentPage;
+ return "page=" + pag + "&";
+}
+
+class Tab
+{
+ public string Id;
+ public string Label;
+}
+
+//
+// Syntax coloring
+//
+
+static string keywords_cs =
+ "(\\babstract\\b|\\bevent\\b|\\bnew\\b|\\bstruct\\b|\\bas\\b|\\bexplicit\\b|\\bnull\\b|\\bswitch\\b|\\bbase\\b|\\bextern\\b|" +
+ "\\bobject\\b|\\bthis\\b|\\bbool\\b|\\bfalse\\b|\\boperator\\b|\\bthrow\\b|\\bbreak\\b|\\bfinally\\b|\\bout\\b|\\btrue\\b|" +
+ "\\bbyte\\b|\\bfixed\\b|\\boverride\\b|\\btry\\b|\\bcase\\b|\\bfloat\\b|\\bparams\\b|\\btypeof\\b|\\bcatch\\b|\\bfor\\b|" +
+ "\\bprivate\\b|\\buint\\b|\\bchar\\b|\\bforeach\\b|\\bprotected\\b|\\bulong\\b|\\bchecked\\b|\\bgoto\\b|\\bpublic\\b|" +
+ "\\bunchecked\\b|\\bclass\\b|\\bif\\b|\\breadonly\\b|\\bunsafe\\b|\\bconst\\b|\\bimplicit\\b|\\bref\\b|\\bushort\\b|" +
+ "\\bcontinue\\b|\\bin\\b|\\breturn\\b|\\busing\\b|\\bdecimal\\b|\\bint\\b|\\bsbyte\\b|\\bvirtual\\b|\\bdefault\\b|" +
+ "\\binterface\\b|\\bsealed\\b|\\bvolatile\\b|\\bdelegate\\b|\\binternal\\b|\\bshort\\b|\\bvoid\\b|\\bdo\\b|\\bis\\b|" +
+ "\\bsizeof\\b|\\bwhile\\b|\\bdouble\\b|\\block\\b|\\bstackalloc\\b|\\belse\\b|\\blong\\b|\\bstatic\\b|\\benum\\b|" +
+ "\\bnamespace\\b|\\bstring\\b)";
+
+static string keywords_vb =
+ "(\\bAddHandler\\b|\\bAddressOf\\b|\\bAlias\\b|\\bAnd\\b|\\bAndAlso\\b|\\bAnsi\\b|\\bAs\\b|\\bAssembly\\b|" +
+ "\\bAuto\\b|\\bBoolean\\b|\\bByRef\\b|\\bByte\\b|\\bByVal\\b|\\bCall\\b|\\bCase\\b|\\bCatch\\b|" +
+ "\\bCBool\\b|\\bCByte\\b|\\bCChar\\b|\\bCDate\\b|\\bCDec\\b|\\bCDbl\\b|\\bChar\\b|\\bCInt\\b|" +
+ "\\bClass\\b|\\bCLng\\b|\\bCObj\\b|\\bConst\\b|\\bCShort\\b|\\bCSng\\b|\\bCStr\\b|\\bCType\\b|" +
+ "\\bDate\\b|\\bDecimal\\b|\\bDeclare\\b|\\bDefault\\b|\\bDelegate\\b|\\bDim\\b|\\bDirectCast\\b|\\bDo\\b|" +
+ "\\bDouble\\b|\\bEach\\b|\\bElse\\b|\\bElseIf\\b|\\bEnd\\b|\\bEnum\\b|\\bErase\\b|\\bError\\b|" +
+ "\\bEvent\\b|\\bExit\\b|\\bFalse\\b|\\bFinally\\b|\\bFor\\b|\\bFriend\\b|\\bFunction\\b|\\bGet\\b|" +
+ "\\bGetType\\b|\\bGoSub\\b|\\bGoTo\\b|\\bHandles\\b|\\bIf\\b|\\bImplements\\b|\\bImports\\b|\\bIn\\b|" +
+ "\\bInherits\\b|\\bInteger\\b|\\bInterface\\b|\\bIs\\b|\\bLet\\b|\\bLib\\b|\\bLike\\b|\\bLong\\b|" +
+ "\\bLoop\\b|\\bMe\\b|\\bMod\\b|\\bModule\\b|\\bMustInherit\\b|\\bMustOverride\\b|\\bMyBase\\b|\\bMyClass\\b|" +
+ "\\bNamespace\\b|\\bNew\\b|\\bNext\\b|\\bNot\\b|\\bNothing\\b|\\bNotInheritable\\b|\\bNotOverridable\\b|\\bObject\\b|" +
+ "\\bOn\\b|\\bOption\\b|\\bOptional\\b|\\bOr\\b|\\bOrElse\\b|\\bOverloads\\b|\\bOverridable\\b|\\bOverrides\\b|" +
+ "\\bParamArray\\b|\\bPreserve\\b|\\bPrivate\\b|\\bProperty\\b|\\bProtected\\b|\\bPublic\\b|\\bRaiseEvent\\b|\\bReadOnly\\b|" +
+ "\\bReDim\\b|\\bREM\\b|\\bRemoveHandler\\b|\\bResume\\b|\\bReturn\\b|\\bSelect\\b|\\bSet\\b|\\bShadows\\b|" +
+ "\\bShared\\b|\\bShort\\b|\\bSingle\\b|\\bStatic\\b|\\bStep\\b|\\bStop\\b|\\bString\\b|\\bStructure\\b|" +
+ "\\bSub\\b|\\bSyncLock\\b|\\bThen\\b|\\bThrow\\b|\\bTo\\b|\\bTrue\\b|\\bTry\\b|\\bTypeOf\\b|" +
+ "\\bUnicode\\b|\\bUntil\\b|\\bVariant\\b|\\bWhen\\b|\\bWhile\\b|\\bWith\\b|\\bWithEvents\\b|\\bWriteOnly\\b|\\bXor\\b)";
+
+string Colorize (string text, string lang)
+{
+ if (lang == "xml") return ColorizeXml (text);
+ else if (lang == "cs") return ColorizeCs (text);
+ else if (lang == "vb") return ColorizeVb (text);
+ else return text;
+}
+
+string ColorizeXml (string text)
+{
+ text = text.Replace (" ", "&nbsp;");
+ Regex re = new Regex ("\r\n|\r|\n");
+ text = re.Replace (text, "_br_");
+
+ re = new Regex ("<\\s*(\\/?)\\s*([\\s\\S]*?)\\s*(\\/?)\\s*>");
+ text = re.Replace (text,"{blue:&lt;$1}{maroon:$2}{blue:$3&gt;}");
+
+ re = new Regex ("\\{(\\w*):([\\s\\S]*?)\\}");
+ text = re.Replace (text,"<span style='color:$1'>$2</span>");
+
+ re = new Regex ("\"(.*?)\"");
+ text = re.Replace (text,"\"<span style='color:purple'>$1</span>\"");
+
+
+ text = text.Replace ("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+ text = text.Replace ("_br_", "<br>");
+ return text;
+}
+
+string ColorizeCs (string text)
+{
+ text = text.Replace (" ", "&nbsp;");
+
+ text = text.Replace ("<", "&lt;");
+ text = text.Replace (">", "&gt;");
+
+ Regex re = new Regex ("\"((((?!\").)|\\\")*?)\"");
+ text = re.Replace (text,"<span style='color:purple'>\"$1\"</span>");
+
+ re = new Regex ("//(((.(?!\"</span>))|\"(((?!\").)*)\"</span>)*)(\r|\n|\r\n)");
+ text = re.Replace (text,"<span style='color:green'>//$1</span><br/>");
+
+ re = new Regex (keywords_cs);
+ text = re.Replace (text,"<span style='color:blue'>$1</span>");
+
+ text = text.Replace ("\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+ text = text.Replace ("\n","<br/>");
+
+ return text;
+}
+
+string ColorizeVb (string text)
+{
+ text = text.Replace (" ", "&nbsp;");
+
+/* Regex re = new Regex ("\"((((?!\").)|\\\")*?)\"");
+ text = re.Replace (text,"<span style='color:purple'>\"$1\"</span>");
+
+ re = new Regex ("'(((.(?!\"\\<\\/span\\>))|\"(((?!\").)*)\"\\<\\/span\\>)*)(\r|\n|\r\n)");
+ text = re.Replace (text,"<span style='color:green'>//$1</span><br/>");
+
+ re = new Regex (keywords_vb);
+ text = re.Replace (text,"<span style='color:blue'>$1</span>");
+*/
+ text = text.Replace ("\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+ text = text.Replace ("\n","<br/>");
+ return text;
+}
+
+//
+// Helper methods and classes
+//
+
+string GetDataContext ()
+{
+ return "op=" + CurrentOperationName + "&bnd=" + CurrentOperationBinding + "&";
+}
+
+string GetOptionSel (string v1, string v2)
+{
+ string op = "<option ";
+ if (v1 == v2) op += "selected ";
+ return op + "value='" + v1 + "'>";
+}
+
+string WrapText (string text, int maxChars)
+{
+ text = text.Replace(" />","/>");
+
+ string linspace = null;
+ int lincount = 0;
+ int breakpos = 0;
+ int linstart = 0;
+ bool inquotes = false;
+ char lastc = ' ';
+ string sublineIndent = "";
+ System.Text.StringBuilder sb = new System.Text.StringBuilder ();
+ for (int n=0; n<text.Length; n++)
+ {
+ char c = text [n];
+
+ if (c=='\r' || c=='\n' || n==text.Length-1)
+ {
+ sb.Append (linspace + sublineIndent + text.Substring (linstart, n-linstart+1));
+ linspace = null;
+ lincount = 0;
+ linstart = n+1;
+ breakpos = linstart;
+ sublineIndent = "";
+ lastc = c;
+ continue;
+ }
+
+ if (lastc==',' || lastc=='(')
+ {
+ if (!inquotes) breakpos = n;
+ }
+
+ if (lincount > maxChars && breakpos >= linstart)
+ {
+ if (linspace != null)
+ sb.Append (linspace + sublineIndent);
+ sb.Append (text.Substring (linstart, breakpos-linstart));
+ sb.Append ("\n");
+ sublineIndent = " ";
+ lincount = linspace.Length + sublineIndent.Length + (n-breakpos);
+ linstart = breakpos;
+ }
+
+ if (c==' ' || c=='\t')
+ {
+ if (!inquotes)
+ breakpos = n;
+ }
+ else if (c=='"')
+ {
+ inquotes = !inquotes;
+ }
+ else
+ if (linspace == null) {
+ linspace = text.Substring (linstart, n-linstart);
+ linstart = n;
+ }
+
+ lincount++;
+ lastc = c;
+ }
+ return sb.ToString ();
+}
+
+class Parameter
+{
+ string name;
+ string type;
+ string description;
+
+ public string Name { get { return name; } set { name = value; } }
+ public string Type { get { return type; } set { type = value; } }
+ public string Description { get { return description; } set { description = value; } }
+}
+
+public class HtmlSampleGenerator: SampleGenerator
+{
+ public HtmlSampleGenerator (ServiceDescriptionCollection services, XmlSchemas schemas)
+ : base (services, schemas)
+ {
+ }
+
+ protected override string GetLiteral (string s)
+ {
+ return "@placeholder!" + s + "!placeholder@";
+ }
+}
+
+
+ public class SampleGenerator
+ {
+ protected ServiceDescriptionCollection descriptions;
+ protected XmlSchemas schemas;
+ XmlSchemaElement anyElement;
+ ArrayList queue;
+ SoapBindingUse currentUse;
+ XmlDocument document = new XmlDocument ();
+
+ static readonly XmlQualifiedName anyType = new XmlQualifiedName ("anyType",XmlSchema.Namespace);
+ static readonly XmlQualifiedName arrayType = new XmlQualifiedName ("Array","http://schemas.xmlsoap.org/soap/encoding/");
+ static readonly XmlQualifiedName arrayTypeRefName = new XmlQualifiedName ("arrayType","http://schemas.xmlsoap.org/soap/encoding/");
+ const string SoapEnvelopeNamespace = "http://schemas.xmlsoap.org/soap/envelope/";
+ const string WsdlNamespace = "http://schemas.xmlsoap.org/wsdl/";
+ const string SoapEncodingNamespace = "http://schemas.xmlsoap.org/soap/encoding/";
+
+ class EncodedType
+ {
+ public EncodedType (string ns, XmlSchemaElement elem) { Namespace = ns; Element = elem; }
+ public string Namespace;
+ public XmlSchemaElement Element;
+ }
+
+ public SampleGenerator (ServiceDescriptionCollection services, XmlSchemas schemas)
+ {
+ descriptions = services;
+ this.schemas = schemas;
+ queue = new ArrayList ();
+ }
+
+ public string GenerateMessage (Port port, OperationBinding obin, Operation oper, string protocol, bool generateInput)
+ {
+ OperationMessage msg = null;
+ foreach (OperationMessage opm in oper.Messages)
+ {
+ if (opm is OperationInput && generateInput) msg = opm;
+ else if (opm is OperationOutput && !generateInput) msg = opm;
+ }
+ if (msg == null) return null;
+
+ switch (protocol) {
+ case "Soap": return GenerateHttpSoapMessage (port, obin, oper, msg);
+ case "HttpGet": return GenerateHttpGetMessage (port, obin, oper, msg);
+ case "HttpPost": return GenerateHttpPostMessage (port, obin, oper, msg);
+ }
+ return "Unknown protocol";
+ }
+
+ public string GenerateHttpSoapMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ string req = "";
+
+ if (msg is OperationInput)
+ {
+ SoapAddressBinding sab = port.Extensions.Find (typeof(SoapAddressBinding)) as SoapAddressBinding;
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ req += "POST " + new Uri (sab.Location).AbsolutePath + "\n";
+ req += "SOAPAction: " + sob.SoapAction + "\n";
+ req += "Content-Type: text/xml; charset=utf-8\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n";
+ req += "Host: " + GetLiteral ("string") + "\n\n";
+ }
+ else
+ {
+ req += "HTTP/1.0 200 OK\n";
+ req += "Content-Type: text/xml; charset=utf-8\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n\n";
+ }
+
+ req += GenerateSoapMessage (obin, oper, msg);
+ return req;
+ }
+
+ public string GenerateHttpGetMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ string req = "";
+
+ if (msg is OperationInput)
+ {
+ HttpAddressBinding sab = port.Extensions.Find (typeof(HttpAddressBinding)) as HttpAddressBinding;
+ HttpOperationBinding sob = obin.Extensions.Find (typeof(HttpOperationBinding)) as HttpOperationBinding;
+ string location = new Uri (sab.Location).AbsolutePath + sob.Location + "?" + BuildQueryString (msg);
+ req += "GET " + location + "\n";
+ req += "Host: " + GetLiteral ("string");
+ }
+ else
+ {
+ req += "HTTP/1.0 200 OK\n";
+ req += "Content-Type: text/xml; charset=utf-8\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n\n";
+
+ MimeXmlBinding mxb = (MimeXmlBinding) obin.Output.Extensions.Find (typeof(MimeXmlBinding)) as MimeXmlBinding;
+ if (mxb == null) return req;
+
+ Message message = descriptions.GetMessage (msg.Message);
+ XmlQualifiedName ename = null;
+ foreach (MessagePart part in message.Parts)
+ if (part.Name == mxb.Part) ename = part.Element;
+
+ if (ename == null) return req + GetLiteral("string");
+
+ StringWriter sw = new StringWriter ();
+ XmlTextWriter xtw = new XmlTextWriter (sw);
+ xtw.Formatting = Formatting.Indented;
+ currentUse = SoapBindingUse.Literal;
+ WriteRootElementSample (xtw, ename);
+ xtw.Close ();
+ req += sw.ToString ();
+ }
+
+ return req;
+ }
+
+ public string GenerateHttpPostMessage (Port port, OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ string req = "";
+
+ if (msg is OperationInput)
+ {
+ HttpAddressBinding sab = port.Extensions.Find (typeof(HttpAddressBinding)) as HttpAddressBinding;
+ HttpOperationBinding sob = obin.Extensions.Find (typeof(HttpOperationBinding)) as HttpOperationBinding;
+ string location = new Uri (sab.Location).AbsolutePath + sob.Location;
+ req += "POST " + location + "\n";
+ req += "Content-Type: application/x-www-form-urlencoded\n";
+ req += "Content-Length: " + GetLiteral ("string") + "\n";
+ req += "Host: " + GetLiteral ("string") + "\n\n";
+ req += BuildQueryString (msg);
+ }
+ else return GenerateHttpGetMessage (port, obin, oper, msg);
+
+ return req;
+ }
+
+ string BuildQueryString (OperationMessage opm)
+ {
+ string s = "";
+ Message msg = descriptions.GetMessage (opm.Message);
+ foreach (MessagePart part in msg.Parts)
+ {
+ if (s.Length != 0) s += "&";
+ s += part.Name + "=" + GetLiteral (part.Type.Name);
+ }
+ return s;
+ }
+
+ public string GenerateSoapMessage (OperationBinding obin, Operation oper, OperationMessage msg)
+ {
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ SoapBindingStyle style = (sob != null) ? sob.Style : SoapBindingStyle.Document;
+
+ MessageBinding msgbin = (msg is OperationInput) ? (MessageBinding) obin.Input : (MessageBinding)obin.Output;
+ SoapBodyBinding sbb = msgbin.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
+ SoapBindingUse bodyUse = (sbb != null) ? sbb.Use : SoapBindingUse.Literal;
+
+ StringWriter sw = new StringWriter ();
+ XmlTextWriter xtw = new XmlTextWriter (sw);
+ xtw.Formatting = Formatting.Indented;
+
+ xtw.WriteStartDocument ();
+ xtw.WriteStartElement ("soap", "Envelope", SoapEnvelopeNamespace);
+ xtw.WriteAttributeString ("xmlns", "xsi", null, XmlSchema.InstanceNamespace);
+ xtw.WriteAttributeString ("xmlns", "xsd", null, XmlSchema.Namespace);
+
+ if (bodyUse == SoapBindingUse.Encoded)
+ {
+ xtw.WriteAttributeString ("xmlns", "soapenc", null, SoapEncodingNamespace);
+ xtw.WriteAttributeString ("xmlns", "tns", null, msg.Message.Namespace);
+ }
+
+ // Serialize headers
+
+ bool writtenHeader = false;
+ foreach (object ob in msgbin.Extensions)
+ {
+ SoapHeaderBinding hb = ob as SoapHeaderBinding;
+ if (hb == null) continue;
+
+ if (!writtenHeader) {
+ xtw.WriteStartElement ("soap", "Header", SoapEnvelopeNamespace);
+ writtenHeader = true;
+ }
+
+ WriteHeader (xtw, hb);
+ }
+
+ if (writtenHeader)
+ xtw.WriteEndElement ();
+
+ // Serialize body
+ xtw.WriteStartElement ("soap", "Body", SoapEnvelopeNamespace);
+
+ currentUse = bodyUse;
+ WriteBody (xtw, oper, msg, sbb, style);
+
+ xtw.WriteEndElement ();
+ xtw.WriteEndElement ();
+ xtw.Close ();
+ return sw.ToString ();
+ }
+
+ void WriteHeader (XmlTextWriter xtw, SoapHeaderBinding header)
+ {
+ Message msg = descriptions.GetMessage (header.Message);
+ if (msg == null) throw new InvalidOperationException ("Message " + header.Message + " not found");
+ MessagePart part = msg.Parts [header.Part];
+ if (part == null) throw new InvalidOperationException ("Message part " + header.Part + " not found in message " + header.Message);
+
+ currentUse = header.Use;
+
+ if (currentUse == SoapBindingUse.Literal)
+ WriteRootElementSample (xtw, part.Element);
+ else
+ WriteTypeSample (xtw, part.Type);
+ }
+
+ void WriteBody (XmlTextWriter xtw, Operation oper, OperationMessage opm, SoapBodyBinding sbb, SoapBindingStyle style)
+ {
+ Message msg = descriptions.GetMessage (opm.Message);
+ if (msg.Parts.Count > 0 && msg.Parts[0].Name == "parameters")
+ {
+ MessagePart part = msg.Parts[0];
+ if (part.Element == XmlQualifiedName.Empty)
+ WriteTypeSample (xtw, part.Type);
+ else
+ WriteRootElementSample (xtw, part.Element);
+ }
+ else
+ {
+ string elemName = oper.Name;
+ string ns = "";
+ if (opm is OperationOutput) elemName += "Response";
+
+ if (style == SoapBindingStyle.Rpc) {
+ xtw.WriteStartElement (elemName, sbb.Namespace);
+ ns = sbb.Namespace;
+ }
+
+ foreach (MessagePart part in msg.Parts)
+ {
+ if (part.Element == XmlQualifiedName.Empty)
+ {
+ XmlSchemaElement elem = new XmlSchemaElement ();
+ elem.SchemaTypeName = part.Type;
+ elem.Name = part.Name;
+ WriteElementSample (xtw, ns, elem);
+ }
+ else
+ WriteRootElementSample (xtw, part.Element);
+ }
+
+ if (style == SoapBindingStyle.Rpc)
+ xtw.WriteEndElement ();
+ }
+ WriteQueuedTypeSamples (xtw);
+ }
+
+ void WriteRootElementSample (XmlTextWriter xtw, XmlQualifiedName qname)
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) schemas.Find (qname, typeof(XmlSchemaElement));
+ if (elem == null) throw new InvalidOperationException ("Element not found: " + qname);
+ WriteElementSample (xtw, qname.Namespace, elem);
+ }
+
+ void WriteElementSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
+ {
+ bool sharedAnnType = false;
+ XmlQualifiedName root;
+
+ if (!elem.RefName.IsEmpty) {
+ XmlSchemaElement refElem = FindRefElement (elem);
+ if (refElem == null) throw new InvalidOperationException ("Global element not found: " + elem.RefName);
+ root = elem.RefName;
+ elem = refElem;
+ sharedAnnType = true;
+ }
+ else
+ root = new XmlQualifiedName (elem.Name, ns);
+
+ if (!elem.SchemaTypeName.IsEmpty)
+ {
+ XmlSchemaComplexType st = FindComplexTyype (elem.SchemaTypeName);
+ if (st != null)
+ WriteComplexTypeSample (xtw, st, root);
+ else
+ {
+ xtw.WriteStartElement (root.Name, root.Namespace);
+ if (currentUse == SoapBindingUse.Encoded)
+ xtw.WriteAttributeString ("type", XmlSchema.InstanceNamespace, GetQualifiedNameString (xtw, elem.SchemaTypeName));
+ xtw.WriteString (GetLiteral (FindBuiltInType (elem.SchemaTypeName)));
+ xtw.WriteEndElement ();
+ }
+ }
+ else if (elem.SchemaType == null)
+ {
+ xtw.WriteStartElement ("any");
+ xtw.WriteEndElement ();
+ }
+ else
+ WriteComplexTypeSample (xtw, (XmlSchemaComplexType) elem.SchemaType, root);
+ }
+
+ void WriteTypeSample (XmlTextWriter xtw, XmlQualifiedName qname)
+ {
+ XmlSchemaComplexType ctype = FindComplexTyype (qname);
+ if (ctype != null) {
+ WriteComplexTypeSample (xtw, ctype, qname);
+ return;
+ }
+
+ XmlSchemaSimpleType stype = (XmlSchemaSimpleType) schemas.Find (qname, typeof(XmlSchemaSimpleType));
+ if (stype != null) {
+ WriteSimpleTypeSample (xtw, stype);
+ return;
+ }
+
+ xtw.WriteString (GetLiteral (FindBuiltInType (qname)));
+ throw new InvalidOperationException ("Type not found: " + qname);
+ }
+
+ void WriteComplexTypeSample (XmlTextWriter xtw, XmlSchemaComplexType stype, XmlQualifiedName rootName)
+ {
+ WriteComplexTypeSample (xtw, stype, rootName, -1);
+ }
+
+ void WriteComplexTypeSample (XmlTextWriter xtw, XmlSchemaComplexType stype, XmlQualifiedName rootName, int id)
+ {
+ string ns = rootName.Namespace;
+
+ if (rootName.Name.IndexOf ("[]") != -1) rootName = arrayType;
+
+ if (currentUse == SoapBindingUse.Encoded) {
+ string pref = xtw.LookupPrefix (rootName.Namespace);
+ if (pref == null) pref = "q1";
+ xtw.WriteStartElement (pref, rootName.Name, rootName.Namespace);
+ ns = "";
+ }
+ else
+ xtw.WriteStartElement (rootName.Name, rootName.Namespace);
+
+ if (id != -1)
+ {
+ xtw.WriteAttributeString ("id", "id" + id);
+ if (rootName != arrayType)
+ xtw.WriteAttributeString ("type", XmlSchema.InstanceNamespace, GetQualifiedNameString (xtw, rootName));
+ }
+
+ WriteComplexTypeAttributes (xtw, stype);
+ WriteComplexTypeElements (xtw, ns, stype);
+
+ xtw.WriteEndElement ();
+ }
+
+ void WriteComplexTypeAttributes (XmlTextWriter xtw, XmlSchemaComplexType stype)
+ {
+ WriteAttributes (xtw, stype.Attributes, stype.AnyAttribute);
+ }
+
+ void WriteComplexTypeElements (XmlTextWriter xtw, string ns, XmlSchemaComplexType stype)
+ {
+ if (stype.Particle != null)
+ WriteParticleComplexContent (xtw, ns, stype.Particle);
+ else
+ {
+ if (stype.ContentModel is XmlSchemaSimpleContent)
+ WriteSimpleContent (xtw, (XmlSchemaSimpleContent)stype.ContentModel);
+ else if (stype.ContentModel is XmlSchemaComplexContent)
+ WriteComplexContent (xtw, ns, (XmlSchemaComplexContent)stype.ContentModel);
+ }
+ }
+
+ void WriteAttributes (XmlTextWriter xtw, XmlSchemaObjectCollection atts, XmlSchemaAnyAttribute anyat)
+ {
+ foreach (XmlSchemaObject at in atts)
+ {
+ if (at is XmlSchemaAttribute)
+ {
+ string ns;
+ XmlSchemaAttribute attr = (XmlSchemaAttribute)at;
+ XmlSchemaAttribute refAttr = attr;
+
+ // refAttr.Form; TODO
+
+ if (!attr.RefName.IsEmpty) {
+ refAttr = FindRefAttribute (attr.RefName);
+ if (refAttr == null) throw new InvalidOperationException ("Global attribute not found: " + attr.RefName);
+ }
+
+ string val;
+ if (!refAttr.SchemaTypeName.IsEmpty) val = FindBuiltInType (refAttr.SchemaTypeName);
+ else val = FindBuiltInType ((XmlSchemaSimpleType) refAttr.SchemaType);
+
+ xtw.WriteAttributeString (refAttr.Name, val);
+ }
+ else if (at is XmlSchemaAttributeGroupRef)
+ {
+ XmlSchemaAttributeGroupRef gref = (XmlSchemaAttributeGroupRef)at;
+ XmlSchemaAttributeGroup grp = (XmlSchemaAttributeGroup) schemas.Find (gref.RefName, typeof(XmlSchemaAttributeGroup));
+ WriteAttributes (xtw, grp.Attributes, grp.AnyAttribute);
+ }
+ }
+
+ if (anyat != null)
+ xtw.WriteAttributeString ("custom-attribute","value");
+ }
+
+ void WriteParticleComplexContent (XmlTextWriter xtw, string ns, XmlSchemaParticle particle)
+ {
+ WriteParticleContent (xtw, ns, particle, false);
+ }
+
+ void WriteParticleContent (XmlTextWriter xtw, string ns, XmlSchemaParticle particle, bool multiValue)
+ {
+ if (particle is XmlSchemaGroupRef)
+ particle = GetRefGroupParticle ((XmlSchemaGroupRef)particle);
+
+ if (particle.MaxOccurs > 1) multiValue = true;
+
+ if (particle is XmlSchemaSequence) {
+ WriteSequenceContent (xtw, ns, ((XmlSchemaSequence)particle).Items, multiValue);
+ }
+ else if (particle is XmlSchemaChoice) {
+ if (((XmlSchemaChoice)particle).Items.Count == 1)
+ WriteSequenceContent (xtw, ns, ((XmlSchemaChoice)particle).Items, multiValue);
+ else
+ WriteChoiceContent (xtw, ns, (XmlSchemaChoice)particle, multiValue);
+ }
+ else if (particle is XmlSchemaAll) {
+ WriteSequenceContent (xtw, ns, ((XmlSchemaAll)particle).Items, multiValue);
+ }
+ }
+
+ void WriteSequenceContent (XmlTextWriter xtw, string ns, XmlSchemaObjectCollection items, bool multiValue)
+ {
+ foreach (XmlSchemaObject item in items)
+ WriteContentItem (xtw, ns, item, multiValue);
+ }
+
+ void WriteContentItem (XmlTextWriter xtw, string ns, XmlSchemaObject item, bool multiValue)
+ {
+ if (item is XmlSchemaGroupRef)
+ item = GetRefGroupParticle ((XmlSchemaGroupRef)item);
+
+ if (item is XmlSchemaElement)
+ {
+ XmlSchemaElement elem = (XmlSchemaElement) item;
+ XmlSchemaElement refElem;
+ if (!elem.RefName.IsEmpty) refElem = FindRefElement (elem);
+ else refElem = elem;
+
+ int num = (elem.MaxOccurs == 1 && !multiValue) ? 1 : 2;
+ for (int n=0; n<num; n++)
+ {
+ if (currentUse == SoapBindingUse.Literal)
+ WriteElementSample (xtw, ns, refElem);
+ else
+ WriteRefTypeSample (xtw, ns, refElem);
+ }
+ }
+ else if (item is XmlSchemaAny)
+ {
+ xtw.WriteString (GetLiteral ("xml"));
+ }
+ else if (item is XmlSchemaParticle) {
+ WriteParticleContent (xtw, ns, (XmlSchemaParticle)item, multiValue);
+ }
+ }
+
+ void WriteChoiceContent (XmlTextWriter xtw, string ns, XmlSchemaChoice choice, bool multiValue)
+ {
+ foreach (XmlSchemaObject item in choice.Items)
+ WriteContentItem (xtw, ns, item, multiValue);
+ }
+
+ void WriteSimpleContent (XmlTextWriter xtw, XmlSchemaSimpleContent content)
+ {
+ XmlSchemaSimpleContentExtension ext = content.Content as XmlSchemaSimpleContentExtension;
+ if (ext != null)
+ WriteAttributes (xtw, ext.Attributes, ext.AnyAttribute);
+
+ XmlQualifiedName qname = GetContentBaseType (content.Content);
+ xtw.WriteString (GetLiteral (FindBuiltInType (qname)));
+ }
+
+ string FindBuiltInType (XmlQualifiedName qname)
+ {
+ if (qname.Namespace == XmlSchema.Namespace)
+ return qname.Name;
+
+ XmlSchemaComplexType ct = FindComplexTyype (qname);
+ if (ct != null)
+ {
+ XmlSchemaSimpleContent sc = ct.ContentModel as XmlSchemaSimpleContent;
+ if (sc == null) throw new InvalidOperationException ("Invalid schema");
+ return FindBuiltInType (GetContentBaseType (sc.Content));
+ }
+
+ XmlSchemaSimpleType st = (XmlSchemaSimpleType) schemas.Find (qname, typeof(XmlSchemaSimpleType));
+ if (st != null)
+ return FindBuiltInType (st);
+
+ throw new InvalidOperationException ("Definition of type " + qname + " not found");
+ }
+
+ string FindBuiltInType (XmlSchemaSimpleType st)
+ {
+ if (st.Content is XmlSchemaSimpleTypeRestriction) {
+ return FindBuiltInType (GetContentBaseType (st.Content));
+ }
+ else if (st.Content is XmlSchemaSimpleTypeList) {
+ string s = FindBuiltInType (GetContentBaseType (st.Content));
+ return s + " " + s + " ...";
+ }
+ else if (st.Content is XmlSchemaSimpleTypeUnion)
+ {
+ //Check if all types of the union are equal. If not, then will use anyType.
+ XmlSchemaSimpleTypeUnion uni = (XmlSchemaSimpleTypeUnion) st.Content;
+ string utype = null;
+
+ // Anonymous types are unique
+ if (uni.BaseTypes.Count != 0 && uni.MemberTypes.Length != 0)
+ return "string";
+
+ foreach (XmlQualifiedName mt in uni.MemberTypes)
+ {
+ string qn = FindBuiltInType (mt);
+ if (utype != null && qn != utype) return "string";
+ else utype = qn;
+ }
+ return utype;
+ }
+ else
+ return "string";
+ }
+
+
+ XmlQualifiedName GetContentBaseType (XmlSchemaObject ob)
+ {
+ if (ob is XmlSchemaSimpleContentExtension)
+ return ((XmlSchemaSimpleContentExtension)ob).BaseTypeName;
+ else if (ob is XmlSchemaSimpleContentRestriction)
+ return ((XmlSchemaSimpleContentRestriction)ob).BaseTypeName;
+ else if (ob is XmlSchemaSimpleTypeRestriction)
+ return ((XmlSchemaSimpleTypeRestriction)ob).BaseTypeName;
+ else if (ob is XmlSchemaSimpleTypeList)
+ return ((XmlSchemaSimpleTypeList)ob).ItemTypeName;
+ else
+ return null;
+ }
+
+ void WriteComplexContent (XmlTextWriter xtw, string ns, XmlSchemaComplexContent content)
+ {
+ XmlQualifiedName qname;
+
+ XmlSchemaComplexContentExtension ext = content.Content as XmlSchemaComplexContentExtension;
+ if (ext != null) qname = ext.BaseTypeName;
+ else {
+ XmlSchemaComplexContentRestriction rest = (XmlSchemaComplexContentRestriction)content.Content;
+ qname = rest.BaseTypeName;
+ if (qname == arrayType) {
+ ParseArrayType (rest, out qname);
+ XmlSchemaElement elem = new XmlSchemaElement ();
+ elem.Name = "Item";
+ elem.SchemaTypeName = qname;
+
+ xtw.WriteAttributeString ("arrayType", SoapEncodingNamespace, qname.Name + "[2]");
+ WriteContentItem (xtw, ns, elem, true);
+ return;
+ }
+ }
+
+ // Add base map members to this map
+ XmlSchemaComplexType ctype = FindComplexTyype (qname);
+ WriteComplexTypeAttributes (xtw, ctype);
+
+ if (ext != null) {
+ // Add the members of this map
+ WriteAttributes (xtw, ext.Attributes, ext.AnyAttribute);
+ if (ext.Particle != null)
+ WriteParticleComplexContent (xtw, ns, ext.Particle);
+ }
+
+ WriteComplexTypeElements (xtw, ns, ctype);
+ }
+
+ void ParseArrayType (XmlSchemaComplexContentRestriction rest, out XmlQualifiedName qtype)
+ {
+ XmlSchemaAttribute arrayTypeAt = FindArrayAttribute (rest.Attributes);
+ XmlAttribute[] uatts = arrayTypeAt.UnhandledAttributes;
+ if (uatts == null || uatts.Length == 0) throw new InvalidOperationException ("arrayType attribute not specified in array declaration");
+
+ XmlAttribute xat = null;
+ foreach (XmlAttribute at in uatts)
+ if (at.LocalName == "arrayType" && at.NamespaceURI == WsdlNamespace)
+ { xat = at; break; }
+
+ if (xat == null)
+ throw new InvalidOperationException ("arrayType attribute not specified in array declaration");
+
+ string arrayType = xat.Value;
+ string type, ns;
+ int i = arrayType.LastIndexOf (":");
+ if (i == -1) ns = "";
+ else ns = arrayType.Substring (0,i);
+
+ int j = arrayType.IndexOf ("[", i+1);
+ if (j == -1) throw new InvalidOperationException ("Cannot parse WSDL array type: " + arrayType);
+ type = arrayType.Substring (i+1);
+ type = type.Substring (0, type.Length-2);
+
+ qtype = new XmlQualifiedName (type, ns);
+ }
+
+ XmlSchemaAttribute FindArrayAttribute (XmlSchemaObjectCollection atts)
+ {
+ foreach (object ob in atts)
+ {
+ XmlSchemaAttribute att = ob as XmlSchemaAttribute;
+ if (att != null && att.RefName == arrayTypeRefName) return att;
+
+ XmlSchemaAttributeGroupRef gref = ob as XmlSchemaAttributeGroupRef;
+ if (gref != null)
+ {
+ XmlSchemaAttributeGroup grp = (XmlSchemaAttributeGroup) schemas.Find (gref.RefName, typeof(XmlSchemaAttributeGroup));
+ att = FindArrayAttribute (grp.Attributes);
+ if (att != null) return att;
+ }
+ }
+ return null;
+ }
+
+ void WriteSimpleTypeSample (XmlTextWriter xtw, XmlSchemaSimpleType stype)
+ {
+ xtw.WriteString (GetLiteral (FindBuiltInType (stype)));
+ }
+
+ XmlSchemaParticle GetRefGroupParticle (XmlSchemaGroupRef refGroup)
+ {
+ XmlSchemaGroup grp = (XmlSchemaGroup) schemas.Find (refGroup.RefName, typeof (XmlSchemaGroup));
+ return grp.Particle;
+ }
+
+ XmlSchemaElement FindRefElement (XmlSchemaElement elem)
+ {
+ if (elem.RefName.Namespace == XmlSchema.Namespace)
+ {
+ if (anyElement != null) return anyElement;
+ anyElement = new XmlSchemaElement ();
+ anyElement.Name = "any";
+ anyElement.SchemaTypeName = anyType;
+ return anyElement;
+ }
+ return (XmlSchemaElement) schemas.Find (elem.RefName, typeof(XmlSchemaElement));
+ }
+
+ XmlSchemaAttribute FindRefAttribute (XmlQualifiedName refName)
+ {
+ if (refName.Namespace == XmlSchema.Namespace)
+ {
+ XmlSchemaAttribute at = new XmlSchemaAttribute ();
+ at.Name = refName.Name;
+ at.SchemaTypeName = new XmlQualifiedName ("string",XmlSchema.Namespace);
+ return at;
+ }
+ return (XmlSchemaAttribute) schemas.Find (refName, typeof(XmlSchemaAttribute));
+ }
+
+ void WriteRefTypeSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
+ {
+ if (elem.SchemaTypeName.Namespace == XmlSchema.Namespace || schemas.Find (elem.SchemaTypeName, typeof(XmlSchemaSimpleType)) != null)
+ WriteElementSample (xtw, ns, elem);
+ else
+ {
+ xtw.WriteStartElement (elem.Name, ns);
+ xtw.WriteAttributeString ("href", "#id" + (queue.Count+1));
+ xtw.WriteEndElement ();
+ queue.Add (new EncodedType (ns, elem));
+ }
+ }
+
+ void WriteQueuedTypeSamples (XmlTextWriter xtw)
+ {
+ for (int n=0; n<queue.Count; n++)
+ {
+ EncodedType ec = (EncodedType) queue[n];
+ XmlSchemaComplexType st = FindComplexTyype (ec.Element.SchemaTypeName);
+ WriteComplexTypeSample (xtw, st, ec.Element.SchemaTypeName, n+1);
+ }
+ }
+
+ XmlSchemaComplexType FindComplexTyype (XmlQualifiedName qname)
+ {
+ if (qname.Name.IndexOf ("[]") != -1)
+ {
+ XmlSchemaComplexType stype = new XmlSchemaComplexType ();
+ stype.ContentModel = new XmlSchemaComplexContent ();
+
+ XmlSchemaComplexContentRestriction res = new XmlSchemaComplexContentRestriction ();
+ stype.ContentModel.Content = res;
+ res.BaseTypeName = arrayType;
+
+ XmlSchemaAttribute att = new XmlSchemaAttribute ();
+ att.RefName = arrayTypeRefName;
+ res.Attributes.Add (att);
+
+ XmlAttribute xat = document.CreateAttribute ("arrayType", WsdlNamespace);
+ xat.Value = qname.Namespace + ":" + qname.Name;
+ att.UnhandledAttributes = new XmlAttribute[] {xat};
+ return stype;
+ }
+
+ return (XmlSchemaComplexType) schemas.Find (qname, typeof(XmlSchemaComplexType));
+ }
+
+ string GetQualifiedNameString (XmlTextWriter xtw, XmlQualifiedName qname)
+ {
+ string pref = xtw.LookupPrefix (qname.Namespace);
+ if (pref != null) return pref + ":" + qname.Name;
+
+ xtw.WriteAttributeString ("xmlns", "q1", null, qname.Namespace);
+ return "q1:" + qname.Name;
+ }
+
+ protected virtual string GetLiteral (string s)
+ {
+ return s;
+ }
+
+ void GetOperationFormat (OperationBinding obin, out SoapBindingStyle style, out SoapBindingUse use)
+ {
+ style = SoapBindingStyle.Document;
+ use = SoapBindingUse.Literal;
+ SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding;
+ if (sob != null) {
+ style = sob.Style;
+ SoapBodyBinding sbb = obin.Input.Extensions.Find (typeof(SoapBodyBinding)) as SoapBodyBinding;
+ if (sbb != null)
+ use = sbb.Use;
+ }
+ }
+ }
+
+
+
+
+
+</script>
+
+<head>
+ <link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>
+
+ <title><%=WebServiceName%> Web Service</title>
+ <style type="text/css">
+ BODY { font-family: Arial; margin-left: 20px; margin-top: 20px; font-size: x-small}
+ TABLE { font-size: x-small }
+ .title { color:dimgray; font-family: Arial; font-size:20pt; font-weight:900}
+ .operationTitle { color:dimgray; font-family: Arial; font-size:15pt; font-weight:900}
+ .method { font-size: x-small }
+ .bindingLabel { font-size: x-small; font-weight:bold; color:darkgray; line-height:8pt; display:block; margin-bottom:3px }
+ .label { font-size: small; font-weight:bold; color:darkgray }
+ .paramTable { font-size: x-small }
+ .paramTable TR { background-color: gainsboro }
+ .paramFormTable { font-size: x-small; padding: 10px; background-color: gainsboro }
+ .paramFormTable TR { background-color: gainsboro }
+ .paramInput { border: solid 1px gray }
+ .button {border: solid 1px gray }
+ .smallSeparator { height:3px; overflow:hidden }
+ .panel { background-color:whitesmoke; border: solid 1px silver; border-top: solid 1px silver }
+ .codePanel { background-color: white; font-size:x-small; padding:7px; border:solid 1px silver}
+ .code-xml { font-size:10pt; font-family:courier }
+ .code-cs { font-size:10pt; font-family:courier }
+ .code-vb { font-size:10pt; font-family:courier }
+ .tabLabelOn { font-weight:bold }
+ .tabLabelOff {color: darkgray }
+ .literal-placeholder {color: darkblue; font-weight:bold}
+ A:link { color: black; }
+ A:visited { color: black; }
+ A:active { color: black; }
+ A:hover { color: blue }
+ </style>
+
+<script>
+function clearForm ()
+{
+ document.getElementById("testFormResult").style.display="none";
+}
+</script>
+
+</head>
+
+<body>
+<div class="title" style="margin-left:20px">
+<span class="label">Web Service</span><br>
+<%=WebServiceName%>
+</div>
+
+<!--
+ **********************************************************
+ Left panel
+-->
+
+<table border="0" width="100%" cellpadding="15px" cellspacing="15px">
+<tr valign="top"><td width="150px" class="panel">
+<div style="width:150px"></div>
+<a class="method" href='<%=PageName%>'>Overview</a><br>
+<div class="smallSeparator"></div>
+<a class="method" href='<%=PageName + "?" + GetPageContext("wsdl")%>'>Service Description</a>
+<div class="smallSeparator"></div>
+<a class="method" href='<%=PageName + "?" + GetPageContext("proxy")%>'>Client proxy</a>
+<br><br>
+ <asp:repeater id="BindingsRepeater" runat=server>
+ <itemtemplate name="itemtemplate">
+ <span class="bindingLabel"><%#FormatBindingName(DataBinder.Eval(Container.DataItem, "Name").ToString())%></span>
+ <asp:repeater id="OperationsRepeater" runat=server datasource='<%# ((Binding)Container.DataItem).Operations %>'>
+ <itemtemplate>
+ <a class="method" href="<%#PageName%>?<%#GetTabContext("op",null)%>op=<%#GetOpName(Container.DataItem)%>&bnd=<%#DataBinder.Eval(Container.DataItem, "Binding.Name")%>"><%#GetOpName(Container.DataItem)%></a>
+ <div class="smallSeparator"></div>
+ </itemtemplate>
+ </asp:repeater>
+ <br>
+ </itemtemplate>
+ </asp:repeater>
+
+</td><td class="panel">
+
+<% if (CurrentPage == "main") {%>
+
+<!--
+ **********************************************************
+ Web service overview
+-->
+
+ <p class="label">Web Service Overview</p>
+ <%#WebServiceDescription%>
+ <br/><br/>
+ <% if (ProfileViolations.Count > 0) { %>
+ <p class="label">Basic Profile Conformance</p>
+ This web service does not conform to WS-I Basic Profile v1.0
+ <%
+ Response.Write ("<ul>");
+ foreach (BasicProfileViolation vio in ProfileViolations) {
+ Response.Write ("<li><b>" + vio.NormativeStatement + "</b>: " + vio.Details);
+ Response.Write ("<ul>");
+ foreach (string ele in vio.Elements)
+ Response.Write ("<li>" + ele + "</li>");
+ Response.Write ("</ul>");
+ Response.Write ("</li>");
+ }
+ Response.Write ("</ul>");
+ }%>
+
+<%} if (DefaultBinding == null) {%>
+This service does not contain any public web method.
+<%} else if (CurrentPage == "op") {%>
+
+<!--
+ **********************************************************
+ Operation description
+-->
+
+ <span class="operationTitle"><%#CurrentOperationName%></span>
+ <br><br>
+ <% WriteTabs (); %>
+ <br><br><br>
+
+ <% if (CurrentTab == "main") { %>
+ <span class="label">Input Parameters</span>
+ <div class="smallSeparator"></div>
+ <% if (InParams.Count == 0) { %>
+ No input parameters<br>
+ <% } else { %>
+ <table class="paramTable" cellspacing="1" cellpadding="5">
+ <asp:repeater id="InputParamsRepeater" runat=server>
+ <itemtemplate>
+ <tr>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Name")%></td>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Type")%></td>
+ </tr>
+ </itemtemplate>
+ </asp:repeater>
+ </table>
+ <% } %>
+ <br>
+
+ <% if (OutParams.Count > 0) { %>
+ <span class="label">Output Parameters</span>
+ <div class="smallSeparator"></div>
+ <table class="paramTable" cellspacing="1" cellpadding="5">
+ <asp:repeater id="OutputParamsRepeater" runat=server>
+ <itemtemplate>
+ <tr>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Name")%></td>
+ <td width="150"><%#DataBinder.Eval(Container.DataItem, "Type")%></td>
+ </tr>
+ </itemtemplate>
+ </asp:repeater>
+ </table>
+ <br>
+ <% } %>
+
+ <span class="label">Remarks</span>
+ <div class="smallSeparator"></div>
+ <%#OperationDocumentation%>
+ <br><br>
+ <span class="label">Technical information</span>
+ <div class="smallSeparator"></div>
+ Format: <%#CurrentOperationFormat%>
+ <br>Supported protocols: <%#CurrentOperationProtocols%>
+ <% } %>
+
+<!--
+ **********************************************************
+ Operation description - Test form
+-->
+
+ <% if (CurrentTab == "test") {
+ if (CurrentOperationSupportsTest) {%>
+ Enter values for the parameters and click the 'Invoke' button to test this method:<br><br>
+ <form action="<%#PageName%>" method="GET">
+ <input type="hidden" name="page" value="<%#CurrentPage%>">
+ <input type="hidden" name="tab" value="<%#CurrentTab%>">
+ <input type="hidden" name="op" value="<%#CurrentOperationName%>">
+ <input type="hidden" name="bnd" value="<%#CurrentOperationBinding%>">
+ <input type="hidden" name="ext" value="testform">
+ <table class="paramFormTable" cellspacing="0" cellpadding="3">
+ <asp:repeater id="InputFormParamsRepeater" runat=server>
+ <itemtemplate>
+ <tr>
+ <td><%#DataBinder.Eval(Container.DataItem, "Name")%>:&nbsp;</td>
+ <td width="150"><input class="paramInput" type="text" size="20" name="<%#DataBinder.Eval(Container.DataItem, "Name")%>"></td>
+ </tr>
+ </itemtemplate>
+ </asp:repeater>
+ <tr><td></td><td><input class="button" type="submit" value="Invoke">&nbsp;<input class="button" type="button" onclick="clearForm()" value="Clear"></td></tr>
+ </table>
+ </form>
+ <div id="testFormResult" style="display:<%# (HasFormResult?"block":"none") %>">
+ The web service returned the following result:<br/><br/>
+ <div class="codePanel"><%#GetTestResult()%></div>
+ </div>
+ <% } else {%>
+ The test form is not available for this operation because it has parameters with a complex structure.
+ <% } %>
+ <% } %>
+
+<!--
+ **********************************************************
+ Operation description - Message Layout
+-->
+
+ <% if (CurrentTab == "msg") { %>
+
+ The following are sample SOAP requests and responses for each protocol supported by this method:
+ <br/><br/>
+
+ <% if (IsOperationSupported ("Soap")) { %>
+ <span class="label">Soap</span>
+ <br/><br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("Soap", true)%></div></div>
+ <br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("Soap", false)%></div></div>
+ <br/>
+ <% } %>
+ <% if (IsOperationSupported ("HttpGet")) { %>
+ <span class="label">HTTP Get</span>
+ <br/><br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpGet", true)%></div></div>
+ <br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpGet", false)%></div></div>
+ <br/>
+ <% } %>
+ <% if (IsOperationSupported ("HttpPost")) { %>
+ <span class="label">HTTP Post</span>
+ <br/><br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpPost", true)%></div></div>
+ <br/>
+ <div class="codePanel"><div class="code-xml"><%#GenerateOperationMessages ("HttpPost", false)%></div></div>
+ <br/>
+ <% } %>
+
+ <% } %>
+<%} else if (CurrentPage == "proxy") {%>
+<!--
+ **********************************************************
+ Client Proxy
+-->
+ <form action="<%#PageName%>" name="langForm" method="GET">
+ Select the language for which you want to generate a proxy
+ <input type="hidden" name="page" value="<%#CurrentPage%>">&nbsp;
+ <SELECT name="lang" onchange="langForm.submit()">
+ <%#GetOptionSel("cs",CurrentLanguage)%>C#</option>
+ <%#GetOptionSel("vb",CurrentLanguage)%>Visual Basic</option>
+ </SELECT>
+ &nbsp;&nbsp;
+ </form>
+ <br>
+ <span class="label"><%#CurrentProxytName%></span>&nbsp;&nbsp;&nbsp;
+ <a href="<%#PageName + "?code=" + CurrentLanguage%>">Download</a>
+ <br><br>
+ <div class="codePanel">
+ <div class="code-<%#CurrentLanguage%>"><%#GetProxyCode ()%></div>
+ </div>
+<%} else if (CurrentPage == "wsdl") {%>
+<!--
+ **********************************************************
+ Service description
+-->
+ <% if (descriptions.Count > 1 || schemas.Count > 1) {%>
+ The description of this web service is composed by several documents. Click on the document you want to see:
+
+ <ul>
+ <%
+ for (int n=0; n<descriptions.Count; n++)
+ Response.Write ("<li><a href='" + PageName + "?" + GetPageContext(null) + "doctype=wsdl&docind=" + n + "'>WSDL document " + descriptions[n].TargetNamespace + "</a></li>");
+ for (int n=0; n<schemas.Count; n++)
+ Response.Write ("<li><a href='" + PageName + "?" + GetPageContext(null) + "doctype=schema&docind=" + n + "'>Xml Schema " + schemas[n].TargetNamespace + "</a></li>");
+ %>
+ </ul>
+
+ <%} else {%>
+ <%}%>
+ <br>
+ <span class="label"><%#CurrentDocumentName%></span>&nbsp;&nbsp;&nbsp;
+ <a href="<%=PageName + "?" + CurrentDocType + "=" + CurrentDocInd %>">Download</a>
+ <br><br>
+ <div class="codePanel">
+ <div class="code-xml"><%#GenerateDocument ()%></div>
+ </div>
+
+<%}%>
+
+<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
+</td>
+<td withd="20px"></td>
+</tr>
+
+</table>
+</body>
+</html>
diff --git a/data/net_2_0/Makefile.am b/data/net_2_0/Makefile.am
new file mode 100644
index 00000000000..b17d1fd9144
--- /dev/null
+++ b/data/net_2_0/Makefile.am
@@ -0,0 +1,8 @@
+monodir = $(sysconfdir)/mono/2.0
+
+EXTRA_DIST = machine.config \
+ DefaultWsdlHelpGenerator.aspx
+
+mono_DATA = machine.config \
+ DefaultWsdlHelpGenerator.aspx
+
diff --git a/data/net_2_0/machine.config b/data/net_2_0/machine.config
new file mode 100644
index 00000000000..5d7143fcd9d
--- /dev/null
+++ b/data/net_2_0/machine.config
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<configuration>
+
+ <configSections>
+ <section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="system.runtime.remoting" type="System.Configuration.IgnoreSectionHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false"/>
+ <sectionGroup name="system.web">
+ <section name="httpHandlers"
+ type="System.Web.Configuration.HttpHandlersSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="httpModules"
+ type="System.Web.Configuration.HttpModulesConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="machineKey"
+ type="System.Web.Configuration.MachineKeyConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="authentication"
+ type="System.Web.Configuration.AuthenticationConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="authorization"
+ type="System.Web.Configuration.AuthorizationConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="globalization"
+ type="System.Web.Configuration.GlobalizationConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="sessionState"
+ type="System.Web.SessionState.SessionStateSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="trace"
+ type="System.Web.Configuration.TraceConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="webServices"
+ type="System.Web.Services.Configuration.WebServicesConfigurationSectionHandler, System.Web.Services, Version=2.0.3600.0 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="webControls"
+ type="System.Web.Configuration.WebControlsSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="compilation"
+ type="System.Web.Configuration.CompilationConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="httpRuntime"
+ type="System.Web.Configuration.HttpRuntimeConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="customErrors"
+ type="System.Web.Configuration.CustomErrorsConfigHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <section name="pages"
+ type="System.Web.Configuration.PagesConfigurationHandler, System.Web, Version=2.0.3600.0, Culture=neutral" />
+ <section name="clientTarget"
+ type="System.Web.Configuration.ClientTargetSectionHandler, System.Web, Version=2.0.3600.0, Culture=neutral" />
+ </sectionGroup>
+ <sectionGroup name="system.net">
+ <section name="settings"
+ type="System.Net.Configuration.NetConfigurationHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="connectionManagement"
+ type="System.Net.Configuration.ConnectionManagementHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="authenticationModules"
+ type="System.Net.Configuration.NetAuthenticationModuleHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="defaultProxy"
+ type="System.Net.Configuration.DefaultProxyHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <section name="webRequestModules"
+ type="System.Net.Configuration.WebRequestModuleHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </sectionGroup>
+ <section name="system.drawing" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </configSections>
+ <system.net>
+ <connectionManagement>
+ <add address="*" maxconnection="2" />
+ </connectionManagement>
+ <authenticationModules>
+ <add type="System.Net.BasicClient, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add type="System.Net.DigestClient, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add type="System.Net.NtlmClient, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </authenticationModules>
+ <defaultProxy>
+ <proxy />
+ <!-- bypassonlocal and proxyaddress are ok -->
+ <!-- usessystemdefault is not supported -->
+ </defaultProxy>
+ <webRequestModules>
+ <add prefix="http" type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add prefix="https" type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <add prefix="file" type="System.Net.FileWebRequestCreator, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </webRequestModules>
+ <settings>
+ <ipv6 enabled="false"/>
+ </settings>
+ </system.net>
+ <system.web>
+ <httpHandlers>
+ <add verb="*" path="Trace.axd" type="System.Web.Handlers.TraceHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.asmx" validate="false" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.asax" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.ascx" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.config" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.cs" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
+ <add verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false" />
+ <add verb="GET,HEAD" path="*" type="System.Web.StaticFileHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add verb="*" path="*" type="System.Web.HttpMethodNotAllowedHandler, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ </httpHandlers>
+ <httpModules>
+ <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <add name="OutputCache" type="System.Web.Caching.OutputCacheModule, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ </httpModules>
+ <authentication mode="Forms">
+ <forms name=".MONOAUTH" loginUrl="login.aspx" protection="All" timeout="30" path="/">
+ <credentials passwordFormat="Clear">
+ <!--<user name="gonzalo" password="gonz"/>-->
+ </credentials>
+ </forms>
+ </authentication>
+ <machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
+ <globalization requestEncoding="utf-8"
+ responseEncoding="utf-8"
+ fileEncoding="utf-8"/>
+ <!--
+ culture="en-US"
+ uiculture="en-US" />
+ -->
+ <sessionState mode="InProc" />
+ <webServices>
+ <protocols>
+ <add name="HttpSoap"/>
+ <add name="HttpPost"/>
+ <add name="HttpGet"/>
+ <add name="Documentation"/>
+ </protocols>
+ <wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx" />
+ </webServices>
+ <webControls clientScriptsLocation="/web_scripts" />
+ <compilation debug="false" defaultLanguage="c#">
+ <compilers>
+ <compiler language="cs;c#;csharp" extension=".cs" warningLevel="1" compilerOptions=""
+ type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
+ warningLevel="1" compilerOptions=""
+ type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </compilers>
+ <assemblies>
+ <!--<add assembly="mscorlib" /> -->
+ <add assembly="System" />
+ <add assembly="System.Xml" />
+ <add assembly="System.Data" />
+ <add assembly="System.Web" />
+ <add assembly="System.Web.Services" />
+ <add assembly="System.Drawing" />
+ <add assembly="*" /> <!-- Add assemblies in bin directory -->
+ </assemblies>
+ </compilation>
+ <httpRuntime executionTimeout="90"
+ maxRequestLength="4096"
+ useFullyQualifiedRedirectUrl="false"
+ minFreeThreads="8"
+ minLocalRequestFreeThreads="4"
+ appRequestQueueLimit="100" />
+ <pages buffer="true"
+ enableSessionState="true"
+ autoEventWireup="true"
+ validateRequest="true" />
+ <clientTarget>
+ <add alias="ie5" userAgent="Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" />
+ <add alias="ie4" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
+ <add alias="uplevel" userAgent="Mozilla/4.0 (compatible; MSIE 4.0; Windows NT 4.0)" />
+ <add alias="downlevel" userAgent="Unknown" />
+ </clientTarget>
+ </system.web>
+
+ <system.runtime.remoting>
+ <application>
+ <channels>
+ <channel ref="http client" displayName="http client (delay loaded)" delayLoadAsClientChannel="true" />
+ <channel ref="tcp client" displayName="tcp client (delay loaded)" delayLoadAsClientChannel="true" />
+ </channels>
+ </application>
+ <channels>
+ <channel id="http" type="System.Runtime.Remoting.Channels.Http.HttpChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="http client" type="System.Runtime.Remoting.Channels.Http.HttpClientChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="http server" type="System.Runtime.Remoting.Channels.Http.HttpServerChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="tcp" type="System.Runtime.Remoting.Channels.Tcp.TcpChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="tcp client" type="System.Runtime.Remoting.Channels.Tcp.TcpClientChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <channel id="tcp server" type="System.Runtime.Remoting.Channels.Tcp.TcpServerChannel, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </channels>
+ <channelSinkProviders>
+ <clientProviders>
+ <formatter id="soap" type="System.Runtime.Remoting.Channels.SoapClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </clientProviders>
+ <serverProviders>
+ <formatter id="soap" type="System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <formatter id="binary" type="System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <provider id="wsdl" type="System.Runtime.Remoting.MetadataServices.SdlChannelSinkProvider, System.Runtime.Remoting, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ </serverProviders>
+ </channelSinkProviders>
+ </system.runtime.remoting>
+
+ <appSettings>
+ <!--<add key="yourkey" value="your value" /> -->
+ <!--<remove key="a key defined higher in the hierarchy" /> -->
+ <!--<clear/> Removes all defined settings -->
+ </appSettings>
+ <system.diagnostics>
+ <trace autoflush="false" indentsize="4" />
+ </system.diagnostics>
+ <system.drawing>
+ </system.drawing>
+
+ <strongNames>
+ <pubTokenMapping>
+ <!-- ECMA key -->
+ <map Token="b77a5c561934e089" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ <!-- Microsoft (final) key -->
+ <map Token="b03f5f7f11d50a3a" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ <!-- Microsoft (Web Service Enhancement) key -->
+ <map Token="31bf3856ad364e35" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ <!-- IBM (DB2 Data Provider) key -->
+ <map Token="7c307b91aa13d208" PublicKey="002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df" />
+ </pubTokenMapping>
+ </strongNames>
+</configuration>
+
+
diff --git a/doc/.cvsignore b/doc/.cvsignore
deleted file mode 100644
index 6d3ceb93234..00000000000
--- a/doc/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-Makefile.in
-Makefile
-all-docs
-pending-classes.in
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index 8ef4e422c5d..00000000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-WEB_FILES= \
- ado-net c-sharp class-library contact contributing documentation download \
- faq gcc-frontend ideas index passport rationale resources \
- roadmap runtime status team testing thanks tools porting anoncvs monodoc-xml winforms
-
-OTHERS= pending resources-pending todo mono-build.sh mono-build-w32.sh
-
-EXTRA_DIST = $(WEB_FILES) README $(OTHERS)
-
-all-docs: $(WEB_FILES)
- cat rationale roadmap c-sharp tools class-library \
- runtime documentation download faq contributing \
- resources status > all-docs
-
-class-status: class-status.in pending-classes Makefile.am
- cat class-status.in pending-classes > class-status
-
-pending-classes:
-
-#pending-classes: pending-classes.in Makefile.am
-# echo "This is a list of pending classes, and links to their documentation on MSDN.Microsoft.com<p><p>" > pending-classes
-# for i in `cat pending-classes.in`; do x=`echo $$i | sed s/\\\.//g`; link=`echo http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrf@@@ClassTopic.asp | sed "s/@@@/$$x/"`; echo " <a href=\"$$link\">$$i</a><br>" >> pending-classes; done
-
-
-webit: dummy
- (cd web; make && make push)
-
-push-notes:
- scp release-notes/mono* www@www:/web/cvsmodules/mono/archive
-
-dummy:
-
diff --git a/doc/README b/doc/README
deleted file mode 100644
index 333d133943f..00000000000
--- a/doc/README
+++ /dev/null
@@ -1,17 +0,0 @@
-To edit the website appearance:
-
-cd doc/web
-edit template.html.in
-make
-
-To edit website content:
-
-cd doc (this directory)
-edit files carefully
-cd web
-make
-
-To publish changes:
-
-cd web
-make push
diff --git a/doc/ado-net b/doc/ado-net
deleted file mode 100644
index 8fe648e1da3..00000000000
--- a/doc/ado-net
+++ /dev/null
@@ -1,796 +0,0 @@
-* ADO.NET
-
- The coordinator for the ADO.NET implementation is <a
- href="mailto:rodrigo@ximian.com">Rodrigo Moya</a>, with
- the collaboration of <a href="mailto:danmorg@sc.rr.com">Daniel
- Morgan</a> and <a href="mailto:tim@timcoleman.com">Tim Coleman</a>.
-
-
-* Action plan
-
- The current plan to implement ADO.NET is as follows:
-
- <b>Step 1:</b> Initial <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatasqlclient.asp?frame=true">System.Data.SqlClient</a> Provider:
-
- <ul>
- * Initial implementation of System.Data.SqlClient is based on
- the <a href="http://www.postgresql.org/idocs/">PostgreSQL C API</a> which is a
- client API to the PostgreSQL DBMS. PostgreSQL was chosen so we could quickly
- create and test the System.Data classes.
-
- * Once the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatasqlclient.asp?frame=true">System.Data.SqlClient</a>
- code is functional and is usable by other people, we willl move it to
- Mono.Data.PostgreSQL, and will convert the existing
- System.Data.SqlClient to be just a wrapper around
- Mono.Data.PostgreSQL.
-
- </ul>
-
- <b>Step 2:</b> <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataOleDb.asp?frame=true">System.Data.OleDb</a> Provider:
-
- <ul>
- * <p>On Unix systems: System.Data.OleDb will use the
- <a href="http://www.gnome-db.org/">LibGDA</a>
- engine.
-
- <p>LibGDA is a data access engine like ADO/OLE-DB, but for Unix. The
- GDA in libGDA stands for GNU/GNOME Data Access, but it does not require GNOME.
- It only requires glib2 and libxml2. LibGDA is used by
- libgnomedb, GNOME-DB, and gaSQL.
-
- <p>There is work under way to get libgda working under
- Windows using Cygwin by the GNOME-DB developers.
-
- <p>LibGDA has providers for MySQL, PostgreSQL, XML, ODBC,
- and MDB Tools (MS Access support).
-
- * On Windows systems: System.Data.OleDb will use OLE-DB as
- its engine. It may have the option of using libgda too.
- </ul>
-
- <b>Step 3:</b> <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatasqlclient.asp?frame=true">System.Data.SqlClient</a> Provider:
-
- <ul>
- * <p>System.Data.SqlClient will then become a managed
- provider for Microsoft SQL Server, both on Windows and
- Linux, to be compatible with applications written
- for the Microsoft .NET Development Framework.
-
- <p>Once Step 1 has been completed and the PostgreSQL
- provider support has been moved to its own place at
- System.Data.PostgreSQL, we will use
- <a href="http://www.freetds.org/">FreeTDS</a> as the basis
- for providing access to Microsoft SQL Server databases.
-
- <P>FreeTDS is a C API for Unix and Windows that implements
- the TDS (Tabular Data Stream) protocol used in accessing
- Microsoft SQL Server and Sybase databases. A .NET Data Provider could be
- created for Sybase databases as well, but this would be put in Mono.Data.Sybase.
- </ul>
-
- <b>Step 4:</b> <a href="http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/668/msdncompositedoc.xml&frame=true">System.Data.Odbc</a> Provider:
-
- <ul>
- * We will create a .NET Managaed Provider for ODBC
- in System.Data.Odbc for those using ODBC.
- On Unix and Windows, <a href="http://www.unixodbc.org/">unixODBC</a> mabye used.
- iODBC is an alternative to using unixODBC.
-
- <p>unixODBC works on Unix and Windows. Well, I have not actually
- used it on Cygwin, but it does build and install without problems.
-
- <p>unixODBC has providers for:
- Oracle, Microsoft SQL Server and Sybase via FreeTDS,
- MySQL, PostgreSQL, Informix, IBM DB2 (Universal Database),
- Interbase, miniSQL (mSQL), AdabasD, Empress, YARD SQL, and others.
-
- </ul>
-
- <b>Step 5:</b> Other System.Data providers:
-
- <ul>
- * <p>The idea in Microsoft .NET System.Data is to have
- a managed provider for each supported DBMS. System.Data.SqlClient
- for Microsoft SQL Server.
- System.Data.OracleClient for Oracle 8i and 9i.
-
- <p>We will need to have Mono.Data.MySQL, Mono.Data.PostgreSQL,
- Mono.Data.DB2, and Mono.Data.miniSQL. Others,
- of course, are welcomed.
-
- <p>System.Data has been designed so
- non-database providers can be created too.
- </ul>
-
-* Current Status
-
- <p>We are working on Steps 1, 2, and 5. We have only just begun on
- steps 2 and 5 though. We still have tons and tons of stuff to do.
- If you have any ideas, let us know.
-
- <p>For Step 1, the PostgreSQL is starting to come together - it
- still needs a lot of work.
-
- <p>For Step 2, Rodrigo Moya has begun System.Data.OleDb which will use libgda
- which is an OLE-DB/ADO data access for Unix. The C-Sharp bindings to libgda
- currently work - meaning they can compile, run, and you can connect to a
- PostgreSQL database via libgda via the C-Sharp bindings to libgda. He has also
- added class stubs for System.Data.OleDb to cvs.
-
- <p>For Step 3, we need someone to start the FreeTDS .NET Data Provider so
- we can have data access to Microsoft SQL Server and Sybase databases, or either
- add the support in libgda.
-
- <p>For Step 4, we need someone to start the unixODBC .NET Data Provider, or add
- the support in libgda.
-
- <p>For Step 5, we have just begun creating a Mono.Data .NET Provider - a MySQL
- .NET Provider that uses the MySQL C Client Library. This provider is
- found in Mono.Data.MySql. We can currently connect and do a SQL INSERT and insert
- a row into a MySQL database. However, it currently only works on Cygwin because
- the MySQL client library libmySQL.dll is different
- from the library on Linux libmysqlclient.dll. Another problem, mysql thread functions
- do not load for some reason. Also, the provider only runs if you use "mint" (the Mono
- runtime interpreter). It does not work on "mono" (the Mono Just-In-Time compiler).
- The C# Bindings to MySQL are thanks to Brad Meril.
-
- <p>We are able to do simple CREATE TABLE, DROP TABLE, UPDATE, INSERT, and
- DELETE SQL commands using the ExecuteNonQuery method in SqlCommand.
-
- <p>We can execute multiple queries and do a NextResult() in SqlDataReader()
- to get the next result set.
-
- <p>We are also able to do simple aggregate functions,
- ie, count(), sum(), min(), and max()
- in a simple SELECT SQL query using the ExecuteScalar() now.
-
- <p>We are also able to retrieve data with a simple SELECT SQL query
- using ExecuteReader() which returns a SqlDataReader. We are able to
- use GetSchemaTable() to get the meta data about the table columns.
- We are able to Read() to get each row from the result set.
-
- <p>Here is a sample of code that is based on PostgresTest.cs and
- TestSqlDataReader.cs tests:
-<pre>
-
- static void SelectData (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- selectCommand.CommandType = CommandType.Text;
- selectCommand.CommandText =
- "select * from pg_user;" +
- "select * from pg_tables;" +
- "select * from pg_database";
-
- reader = selectCommand.ExecuteReader ();
-
- do {
- // get the DataTable that holds
- // the schema
- DataTable dt = rdr.GetSchemaTable();
-
- if(rdr.RecordsAffected != -1) {
- // Results for
- // SQL INSERT, UPDATE, DELETE Commands
- // have RecordsAffected >= 0
- Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- }
- else if (dt == null)
- Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- else {
- // Results for
- // SQL not INSERT, UPDATE, nor DELETE
- // have RecordsAffected = -1
- Console.WriteLine("Result is from a SQL SELECT Query. Records Affected: " + rdr.RecordsAffected);
-
- // Results for a SQL Command (CREATE TABLE, SET, etc)
- // will have a null reference returned from GetSchemaTable()
- //
- // Results for a SQL SELECT Query
- // will have a DataTable returned from GetSchemaTable()
-
- results++;
- Console.WriteLine("Result Set " + results + "...");
-
- // number of columns in the table
- Console.WriteLine(" Total Columns: " +
- dt.Columns.Count);
-
- // display the schema
- foreach (DataRow schemaRow in dt.Rows) {
- foreach (DataColumn schemaCol in dt.Columns)
- Console.WriteLine(schemaCol.ColumnName +
- " = " +
- schemaRow[schemaCol]);
- Console.WriteLine();
- }
-
- int nRows = 0;
- string output, metadataValue, dataValue;
- // Read and display the rows
- Console.WriteLine("Gonna do a Read() now...");
- while(rdr.Read()) {
- Console.WriteLine(" Row " + nRows + ": ");
-
- for(c = 0; c < rdr.FieldCount; c++) {
- // column meta data
- DataRow dr = dt.Rows[c];
- metadataValue =
- " Col " +
- c + ": " +
- dr["ColumnName"];
-
- // column data
- if(rdr.IsDBNull(c) == true)
- dataValue = " is NULL";
- else
- dataValue =
- ": " +
- rdr.GetValue(c);
-
- // display column meta data and data
- output = metadataValue + dataValue;
- Console.WriteLine(output);
- }
- nRows++;
- }
- Console.WriteLine(" Total Rows: " +
- nRows);
- }
- } while(rdr.NextResult());
- Console.WriteLine("Total Result sets: " + results);
-
- rdr.Close();
- }
-
-</pre>
-
- <p>We are able to get
- String data (char, character, text, varchar), Int16 (smallint),
- Int32 (integer), Int64 (bigint), DateTime (time, date, timestamp),
- Boolean (boolean), Single (float), and Double (double).
- More data types will come later. Note, the types that do work still
- need thorough testing.
-
- <p>Rows that are returned which contain columns that are NULL are handled now.
- The SqlDataReader method IsDBNull() needs to be called to determine
- if a field IS NULL before trying to read data from that field.
-
- <p>Calling PostgreSQL stored procedures works. It does not work perfectly. It may not
- even work to specification - yet. If you want to test it yourself, look at
- TestSqlDataReader.cs or PostgresTest.cs in
- mcs/class/System.Data/Test.
-
- <p>Below, I have some sample code you can
- use to call a PostgreSQL stored procedure named "version". This stored
- procedure returns a string containing the PostgreSQL server version. Notice
- the CommandType is StoredProcedure and the method ExecuteScalar() is called.
-
- <p>ExecuteScalar() is a lightweight method in class SqlCommand that only returns
- one row and one column as one object - even if there is more than row or column.
-
-<pre>
- static string GetDatabaseServerVersion (SqlConnection cnc)
- {
- SqlCommand cmd = cnc.CreateCommand ();
- string data;
-
- cmd.CommandType = CommandType.StoredProcedure;
- cmd.CommandText = "version";
-
- data = (string) cmd.ExecuteScalar ();
-
- return data;
- }
-</pre>
-
- <p>We have the beginnings of Parameters support PostgreSQL. Only
- Input Parameters are currently supported. Output, Input/Output,
- and Return parameters still need to be done.
-
- <p>A lot of functionality in System.Data is missing, but the
- infrastructure is starting to come together.
-
- <p>A lot of Exceptions need to be thrown for various exceptions. However,
- SqlException, SqlErrorCollection, and SqlError have been partially
- implemented.
-
- <p>Tim Coleman and Rodrigo Moya got the beginnings of the
- SqlDataAdapter/DataSet/DataTable/DataRow to work. Currently,
- the SqlDataAdapter can Fill() relational data into a DataTable in a DataSet.
- See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.
- Below, I show a snippets from the test:
-
-<pre>
- string connectionString;
- string sqlQuery;
- SqlDataAdapter adapter;
- DataSet dataSet = null;
-
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- sqlQuery = "select * from pg_tables";
-
- adapter = new SqlDataAdapter (sqlQuery,
- connectionString);
-
- dataSet = new DataSet ();
-
- adapter.Fill (dataSet);
-
- if (dataSet != null) {
- foreach (DataRow row in dataSet.Tables["Table"].Rows)
- Console.WriteLine("tablename: " + row["tablename"]);
- }
-</pre>
-
- <p>We do need help on the DataSet/DataAdaptor/DataTable/DataRelation/XML
- functionality so we can integrate with
- the ASP.NET controls and Windows.Forms controls by allowing the controls to bind
- to a data source. Gonzalo, Gaurav, Leen, Patrik, Duncan, and others are
- working very hard on the ASP.NET support. If you want to help,
- contact <a href="mailto:gonzalo@ximian.com">Gonzalo Paniagua Javier</a>
-
- <P>Need to add XML support in System.Data. This involves working on
- the classes: DataSet and XmlDataDocument and the ExecuteXmlReader() in SqlCommand.
-
- <p>The System.Data.dll gets built with the rest of the class library.
- To compile the System.Data.dll assembly separately, you need:
-
- <b>On Unix</b>
-
- <ul>
- * update your mono sources. Be sure you have latest mcs.exe
- and .dll's, since there have been many fixes needed for
- compilation on Linux.
-
- * compile System.Data.dll:
-<pre>
- cd mcs/class/System.Data<br>
- mcs --target library -o System.Data.dll @list
-</pre>
- </ul>
-
- <b>On Windows</b>
-
- <ul>
- * update your mono sources. Be sure you have latest mcs.exe
- and .dll's. You can use the same method as Linux,
- or you can use NAnt.
-
- * To use NAnt:
-
-<pre>
- cd mcs/class/System.Data
- ../../nant/NAnt.exe
-</pre>
-
- This will automatically copy the System.Data.dll to Test.
- If you need to do a clean for the System.Data.dll assembly,<br><br>
-
-<pre>
- cd mcs/class/System.Data
- ../../nant/NAnt.exe clean
-</pre>
- </ul>
-
-* Testing
-
- <p>In order to test System.Data.SqlClient, you will need to have
- access to a remote PostgreSQL DBMS, or you will have to install
- one locally. PostgreSQL is the DBMS used for the initial
- implementation of System.Data.SqlClient.
-
- <p>Why? Because it is open source, has a client
- library that is easy to use, PostgreSQL is easy to install on
- Unix and Windows (using the Cygwin install program), not difficult to setup after
- installation, and it runs under: Linux,
- Windows (via cygwin and ipc-daemon), Unix, and
- others. This allowed us to create the
- System.Data functionality in Mono much quicker.
-
- <p>If you plan on using a remote PostgreSQL DBMS Server,
- than you will need to have the PostgreSQL client software on your
- local computer that includes libpq.so (pq.dll on Windows).
-
- <p>The System.Data tests use this connection string to connect
- to the PostgreSQL database named "test" at host "localhost" as
- user "postgres".
-
-<pre>
-"host=localhost;dbname=test;user=postgres"
-</pre>
-
- <p>Installation instructions for PostgreSQL DBMS:
-
- <b>On Unix</b>
-
- <ul>
- * Read the PostgreSQL Installation Instructions
- at \usr\doc\postgresql-x.x.x\html\installation.html
-
- * Depending on your Unix system,
- PostgreSQL maybe already installed, a database user 'postgres' created,
- a linux user 'postgres' created and initdb ran. Or maybe not.
-
-<pre>
- su
- adduser postgres
- mkdir /usr/local/pgsql/data
- chown postgres /usr/local/pgsql/data
- su - postgres
- initdb -D /usr/local/pgsql/data
- postmaster -i -D /usr/local/pgsql/data
- createdb test
- psql test
-</pre>
-
- * Make sure you have a database user named postgres. It is best to install
- the PostgreSQL DBMS under linux user postgres. When you run the postmaster,
- run it under the user postgres as well. If this was not done, then you
- will need to create a user named postgres for the System.Data tests.
-
- * If you already installed PostgeSQL and you do not have a database
- user named postgres, then you can create user postgres using psql:
-
-<pre>
-psql test
-create user postgres with password 'fun2db';
-</pre>
-
- * The postmaster must be run with -i option.
-
- * In the /usr/local/pgsql/data/pg_hba.conf file, you need
- to have the AUTH_TYPE set to md5. You can read more on this at
- /usr/doc/postgresql-7.2.1/html/client-authentication.html
- or wherever your
- PostgreSQL html docs are located. See the 2nd line below,
- host 127.0.0.1 has an AUTH_TYPE md5 in pg_hba.conf.
-
-<pre>
- # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE
-
- local all trust
- host all 127.0.0.1 255.255.255.255 md5
-</pre>
-
- * If you can not find your PostgreSQL documentation locally or you
- did not install it, then you
- can get it <a href="http://www.postgresql.org/idocs/">here</a>.
-
- </ul>
-
- <b>On Windows</b>
-
- <ul>
- * Use the <a href="http://www.cygwin.com/">Cygwin</a> installer to
- install the PostgreSQL DBMS. It is
- found in the database category.
-
- * <p>Read the file postgres-x.x.README at /usr/doc/Cygwin and read
- the requirements to install PostgreSQL. Those requirements
- are included with cygwin except cygipc. A default installtion
- of cygwin does not install everything you will need, so on the
- safe side, just include everything when installing cygwin.
-
- * <p>The -x.x in postgres-x.x is the version of your PostgreSQL DBMS.
-
- * <p>Once Cygwin has installed the PostgreSQL DBMS on your computer,
- read the file FAQ_MSWIN which is available
- in /usr/doc/postgres-x.x
-
- * <p>Important notes from this file are:
-
- <ul>
- <p><b>2.</b> - Install the latest <a href="http://www.neuro.gatech.edu/users/cwilson/cygutils/OBSOLETE/V1.1/cygipc/index.html">CygIPC</a> package.
-
- <p>The cygipc package contains the ipc-daemon you will need
- to run before you can
- run the PostgreSQL DBMS Server daemon (postmaster) or run
- initdb which initializes the PostgreSQL database.
-
- <p><b>3.</b> The Cygwin bin directory has to be placed in
- the path before the Windows program directories,
- for example, C:\cygwin\bin
-
- <p><b>My own note.</b> In the Windows control panel, I set
- the environment variables PATH to my cygwin /usr/local/bin,
- /usr/bin, and /bin. I also set my LD_LIBRARY_PATH to
- /usr/local/lib and /usr/lib. For example:
-
- <p>
-<pre>
-PATH=c:\cygwin\usr\local\bin;c:\cygwin\usr\bin;c:\cygwin\bin;
-LD_LIBRARY_PATH=c:\cygwin\usr\local\lib;c:\cygwin\usr\lib;
-</pre>
-
- <p><b>4.</b> Start the ipc-daemon that came with the cygipc
- package. There
- are two ways to do this: run it from the command line as:
-
- <p>
-<pre>
-ipc-daemon &
-</pre>
- <p>or you can set it up as a Windows service. See the
- file cygrunsrv.README at /usr/doc/Cygwin on how to do this
- for ipc-daemon and postmaster. Note the
- troubleshooting section at the end of
- the cygrunsrv.README file.
-
- <p>To install ipc-daemon as a service,
- you just have to run
-
- <p>
-<pre>
-ipc-daemon --install-as-service' (--remove-as-service)
-</pre>
-
- <p>and then run
-
-<pre>
-net start ipc-daemon
-</pre>
- </ul>
-
- <p>Read the installation.html file
- at /usr/doc/postgresql-x.x/html/installation.html
-
- <p>You will see in this file that you will need to
- run the following commands:
-
- <p>
-<pre>
-mkdir /usr/local/pgsql/data
-initdb -D /usr/local/pgsql/data
-postmaster -D /usr/local/pgsql/data
-createdb test
-psql test
-</pre>
-
- <p>When you need to connect to the database,
- you will need ipc-daemon and postmaster running. Start ipc-daemon
- before any of the command above. If you restart your computer, you
- need to start ipc-daemon and postmaster either manually or as a
- service.
-
- <p>psql is a command-line PostgreSQL client tool to
- enter and run SQL commands and queries.
-
- <p>If there is no database user named postgres, create a user named
- postgres with the following SQL command in the client tool psql:
-
- <p>
-<pre>
-psql test
-create user postgres with password 'fun2db';
-</pre>
- <p>The only reason I say this is so you can easily use the System.Data tests
- without having to change the database, userid, etc.
- </ul>
-
- <p>In the path mcs/class/System.Data/Test
- there is a PostgreSQL test program named
- PostgreTest.cs. Thanks goes to Gonzalo for creating the original
- PostgreSQL test.
-
- <p>To use it to test System.Data, you
- modify the file to your PostgreSQL database
- connection requirements:
-
- <p>
- <ul>
- <li><b>dbname</b> database, ie., test</li>
- <li><b>host</b> hostname of the PostgreSQL DBMS Server to connect to, ie., localhost</li>
- <li><b>user</b> username, ie., someuser</li>
- <li><b>password</b> password, ie., mypass1234</li>
- </ul>
-
- <p>The connection string is in OLE-DB connection string format. Internally,
- SqlConnection converts this to the PostgreSQL connection string format.
-
- <p>
-<pre>
- OLE-DB: "host=localhost;dbname=test;user=joe;password=smoe"
-PostgreSQL: "host=localhost dbname=test user=joe password=smoe"
-</pre>
-
- <p>
- Note that OLE-DB includes the semicolons while PostgreSQL's connection
- string does not.
-
- <p>
- To compile the PostgresTest.cs program, do:
-
- <p>
-<pre>
-mcs PostgresTest.cs -r System.Data.dll
-</pre>
-
- <p>
- To run using mint, do:
-
- <p>
-<pre>
-mint PostgresTest.exe
-</pre>
-
- <p>
- To run using mono, do:
-<pre>
-mono PostgresTest.exe
-</pre>
-
- <p>Below, I show how the output from PostgresTest. I have omitted a lot
- of the meta data for the columns except two columns. The classes
- used were from System.Data.SqlClient and were used to connect to a
- PostgreSQL database and retrieve data.
-
-<p>
-<pre>
-
-danmorg@DANPC ~/mono/mcs/class/System.Data/Test
-$ mcs PostgresTest.cs -r System.Data.dll
-
-danmorg@DANPC ~/mono/mcs/class/System.Data/Test
-$ mono PostgresTest.exe
- Postgres provider specific tests...
-
- Drop table:
-Error (don't worry about this one)SqlError:PGRES_FATAL_ERROR ERROR: table "mono
-_postgres_test" does not exist
- <Stack Trace>
-
- Create table with all supported types:
-OK
- Insert values for all known types:
-OK
- Update values:
-OK
- Insert values for all known types:
-OK
-Aggregate: count(*)
-Agg Result: 2
-Aggregate: min(text_value)
-Agg Result: This is a text
-Aggregate: max(int4_value)
-Agg Result: 1048000
-Aggregate: sum(int4_value)
-Agg Result: 1048003
- Select values from the database:
-Result is from a SELECT SQL Query. Records Affected: -1
-Result Set 1...
- Total Columns: 28
-ColumnName = boolean_value
-ColumnOrdinal = 1
-ColumnSize = 1
-NumericPrecision = 0
-NumericScale = 0
-IsUnique = False
-IsKey =
-BaseCatalogName =
-BaseColumnName = boolean_value
-BaseSchemaName =
-BaseTableName =
-DataType = System.Boolean
-AllowDBNull = False
-ProviderType = 16
-IsAliased = False
-IsExpression = False
-IsIdentity = False
-IsAutoIncrement = False
-IsRowVersion = False
-IsHidden = False
-IsLong = False
-IsReadOnly = False
-
- ...
-
- ColumnName = null_timestamp_value
- ColumnOrdinal = 28
- ColumnSize = 8
- NumericPrecision = 0
- NumericScale = 0
- IsUnique = False
- IsKey =
- BaseCatalogName =
- BaseColumnName = null_timestamp_value
- BaseSchemaName =
- BaseTableName =
- DataType = System.DateTime
- AllowDBNull = False
- ProviderType = 1184
- IsAliased = False
- IsExpression = False
- IsIdentity = False
- IsAutoIncrement = False
- IsRowVersion = False
- IsHidden = False
- IsLong = False
- IsReadOnly = False
-
- Gonna do a Read() now...
- Row 0:
- Col 0: boolean_value: False
- Col 1: int2_value: 5
- Col 2: int4_value: 3
- Col 3: bigint_value: 9
- Col 4: float_value: 3.141590
- Col 5: double_value: 3.14159
- Col 6: numeric_value: 123456789012.345
- Col 7: char_value: Mono.Data!
- Col 8: varchar_value: It was not me!
- Col 9: text_value: We got data!
- Col 10: point_value: (1,0)
- Col 11: time_value: 01/01/1 21:13:14
- Col 12: date_value: 02/29/2000 00:00:00
- Col 13: timestamp_value: 02/29/2004 14:00:11
- Col 14: null_boolean_value is NULL
- Col 15: null_int2_value is NULL
- Col 16: null_int4_value is NULL
- Col 17: null_bigint_value is NULL
- Col 18: null_float_value is NULL
- Col 19: null_double_value is NULL
- Col 20: null_numeric_value is NULL
- Col 21: null_char_value is NULL
- Col 22: null_varchar_value is NULL
- Col 23: null_text_value is NULL
- Col 24: null_point_value is NULL
- Col 25: null_time_value is NULL
- Col 26: null_date_value is NULL
- Col 27: null_timestamp_value is NULL
- Row 1:
- Col 0: boolean_value: True
- Col 1: int2_value: -22
- Col 2: int4_value: 1048000
- Col 3: bigint_value: 123456789012345
- Col 4: float_value: 3.141590
- Col 5: double_value: 3.14159
- Col 6: numeric_value: 123456789012.345
- Col 7: char_value: This is a char
- Col 8: varchar_value: This is a varchar
- Col 9: text_value: This is a text
- Col 10: point_value: (1,0)
- Col 11: time_value: 01/01/1 21:13:14
- Col 12: date_value: 02/29/2000 00:00:00
- Col 13: timestamp_value: 02/29/2004 14:00:11
- Col 14: null_boolean_value is NULL
- Col 15: null_int2_value is NULL
- Col 16: null_int4_value is NULL
- Col 17: null_bigint_value is NULL
- Col 18: null_float_value is NULL
- Col 19: null_double_value is NULL
- Col 20: null_numeric_value is NULL
- Col 21: null_char_value is NULL
- Col 22: null_varchar_value is NULL
- Col 23: null_text_value is NULL
- Col 24: null_point_value is NULL
- Col 25: null_time_value is NULL
- Col 26: null_date_value is NULL
- Col 27: null_timestamp_value is NULL
- Total Rows Retrieved: 2
- Total Result sets: 1
- Call ExecuteReader with a SQL Command. (Not INSERT,UPDATE,DELETE
- ).
- Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: -1
- Total Result sets: 0
- Call ExecuteReader with a SQL Command. (Is INSERT,UPDATE,DELETE)
- .
- Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: 1
- Total Result sets: 0
- Calling stored procedure version()
- Result: PostgreSQL 7.2.1 on i686-pc-cygwin, compiled by GCC 2.95.3-5
- Database Server Version: PostgreSQL 7.2.1 on i686-pc-cygwin, compiled by GCC 2.9
- 5.3-5
- Clean up...
- Drop table...
- OK
- RESULT: 0
-
-</pre>
-
diff --git a/doc/anoncvs b/doc/anoncvs
deleted file mode 100644
index ed70a4c0074..00000000000
--- a/doc/anoncvs
+++ /dev/null
@@ -1,70 +0,0 @@
-* Anonymous CVS access
-
- Anonymous access to the Mono is available currently from three
- servers (anoncvs-spain-1.go-mono.com,
- anoncvs-spain-2.go-mono.com and anoncvs-us-1.go-mono.com).
-
- You can also use `anoncvs.go-mono.com', and that will pick a
- server automatically for you.
-
- Sources are currently being updated every hour.
-
-** Checking out the sources
-
- To check out the sources for the first time from the
- repository, use this command:
-
-<pre>
- export CVSROOT=:pserver:anonymous@anoncvs.go-mono.com:/mono
- cvs login
- cvs -z3 co mcs mono gtk-sharp
-</pre>
-
- That will get you the compiler and class libraries (mcs), the
- interpreter and JITer (mono) and the Gtk# bindings.
-
- The server is located in Spain.
-
-** Updating the sources
-
- To update your sources every day, you use this command:
-
-<pre>
- export CVSROOT=:pserver:anonymous@reypastor.hispalinux.es:/mono
- cvs -z3 update -dP mcs mono gtk-sharp
-</pre>
-
-** Thanks
-
- Thanks to <a href="http://www.hispalinux.es">HispaLinux</a>
- for providing this Anon CVS server. The server is located in
- Spain.
-
- Special thanks to Jesus Climent, Rodrigo Moya, Juantomás
- García and Ismael Olea for making this happen.
-
-<a name="#mirror">
-** Becoming an AnonCVS mirror
-
- To become an AnonCVS mirror, you currently need about 20
- megabytes of free disk space and bandwidth that you do not
- mind sharing (you probably want enough to spare).
-
- I need to be able to rsync to your machine from the main CVS
- server. The preferred method to rsync is to setup ssh in your
- machine.
-
- The requirements are:
- <ul>
- * An account where we can ssh into.
-
- * rsync.
-
- * AnonCVS setup with the same paths as the rest of the
- servers.
-
- * Currently, about 40 megabytes of disk space, but this
- will likely grow as the project evolves.
-
- * A sysadmin contact e-mail address.
- </ul>
diff --git a/doc/asp-net b/doc/asp-net
deleted file mode 100755
index 258c9725be6..00000000000
--- a/doc/asp-net
+++ /dev/null
@@ -1,102 +0,0 @@
-* ASP.NET
-
- The classes for running ASP.NET are being actively written.
- Gaurav, Leen and Patrik have been building the classes
- required to run ASP.NET web application as well as a small
- embeddable web server.
-
- There are a couple of components to the puzzle:
-
- <ul>
- * .aspx page parser (converts .aspx to C# code).
-
- * System.Web.HttpRuntime support.
-
- * Web controls (System.Web.UI.HtmlControls and
- System.Web.UI.WebControls).
-
- * Underlying infrastructure for the controls (System.Web.UI).
-
- * HttpRuntime.ProcessRequest is the core of the ASP.NET
- implementation.
- </ul>
-
-
- Gonzalo has been working on an ASP.NET parser that takes .aspx
- files and generated the code required to run them (the code lives in
- module `xsp' along with a little web server for testing).
-
- Most of the runtime support was mostly written by Patrik Torstensson
- (now at Intel). This was interesting, because in order to implement
- some of its features, Patrik had to go into the runtime/JIT engine and
- he spent a few weeks doing work there.
-
- Duncan got our System.Web assembly to compile.
-
-** HttpRuntime
-
- Patrik has authored most of the HttpRuntime support (both on
- the System.Web and on the foundation) but it is still not
- ready to run.
-
-** XSP
-
- Currently XSP provides the .aspx compiler to C#. It would be
- interesting to see if it makes sense to extend the ASP.NET
- syntax to make it simpler to develop applications.
-
- Gonzalo is in charge of the compiler.
-
-** Controls
-
- A lot of work has been put in the various classes that
- implement the controls (UI.HtmlControls and UI.WebControls),
- but they have been coded mostly in the dark, and without being
- able to test them in real life: Gaurav and Leen worked very
- hard on this namespace, but needs to be finished.
-
- We can now render all HtmlControls and some WebControls. Work is
- ongoing to make all WebControls render HTML.
-
-** Extending ASP.NET
-
- Currently you have to reference in your ASP.NET the control
- and all of its properties, which works fine if you have a GUI
- designer, but is harder for people used to develop using text
- editors.
-
- Since we have a parser, we could extend this parser to allow
- people to still use ASP.NET controls, using a simpler syntax.
- For example people doing blogs and editing their templates
- over the web probably do not want to use direct ASP.NET but a
- wrapper around it.
-
-** Roadmap
-
- 1. The Parser.
-
- 2. Get the parser to generate output compatible with ASP.NET.
-
- 3. Run the sample output with the real Microsoft runtime
- but using our generated page.
-
- 4. Run the sample with our classes with the .NET runtime.
- <b>We are here</b>.
-
- 5. Finish HttpRuntime.
-
- 6. Running our sample code with our classes with our runtime.
-
-** How to Help
-
- Currently we are testing and fixing HtmlControls, WebControls and
- validators.
-
- In the CVS module XSP you can find the aspx to C# page parser,
- a little web server used for testing and a directory containing
- sample aspx pages.
-
- You have some documentation under doc directory and in the README
- file of each directory. They explain how to test our System.Web.
- Testing is really easy!
-
diff --git a/doc/books b/doc/books
deleted file mode 100644
index d5933e79836..00000000000
--- a/doc/books
+++ /dev/null
@@ -1,37 +0,0 @@
-* C# Books
-
- A Programmer's Introduction to C# - Second Edition: Eric Gunnerson
-
-* Remoting
-
- <a href="http://www.dotnetremoting.cc/book/AdvancedDotNetRemoting.asp">
- Advanced .NET Remoting: Ingo Rammer</a>
-
-* Compiler Implementation
-
- Compilers - Principles, Techniques, and Tools: Alfred V. Aho, Ravi Sethi,
- Jeffrey D. Ullman
-
- Advanced Compiler Design Implementation: Steven S. Muchnick
-
- Modern Compiler Implementation in C: Andrew W. Appel
-
- A Retargetable C Compiler - Design and Implementation: C. Fraser, David
- Hanson
-
-* Reference Manuals
-
- <a
- href="http://developer.intel.com/design/pentium/manuals/24319101.pdf">Intel
- Architecture Software Developer's Manual, Volume 2 - Instruction Set Reference Manual</a>
-
- <a
- href="http://www.caldera.com/developers/devspecs/abi386-4.pdf">System V ABI
- - i386 Architecture Processor Supplement</a>
-
- <a
- href="http://www.caldera.com/developers/devspecs/mipsabi.pdf">System V ABI -
- MIPS Processor supplement</a>
-
- <a href="http://www.sparc.org/standards/V8.pdf">The SPARC Architecture
- Manual Version 8</a> \ No newline at end of file
diff --git a/doc/c-sharp b/doc/c-sharp
deleted file mode 100644
index fa4dad1d732..00000000000
--- a/doc/c-sharp
+++ /dev/null
@@ -1,223 +0,0 @@
-* MCS: The Ximian C# compiler
-
- MCS is currently able to compile itself and many more C#
- programs (there is a test suite included that you can use).
-
- We are in feature completion mode right now. There are still
- a couple of areas that are not covered by the Mono compiler, but
- they are very very few at this point.
-
- MCS was able to parse itself on April 2001, MCS compiled itself
- for the first time on December 28 2001. MCS became self hosting
- on January 3rd, 2002.
-
- The Mono Runtime and the Mono execution engine were able to make
- our compiler self hosting on March 12, 2002.
-
- A test suite is maintained to track the progress of
- the compiler and various programs are routinely compiled and
- ran.
-
-** Obtaining MCS
-
- The Mono C# compiler is part of the `mcs' module in the Mono CVS
- you can get it from our <a href="anoncvs.html">Anonymous CVS</a> server,
- or you can get nightly <a href="download.html">download page</a>.
-
-** Running MCS
-
- MCS is written in C# and uses heavily the .NET APIs. MCS runs
- on Linux (with the Mono runtime) and Windows (with the .NET
- framework runtime)
-
-** Reporting Bugs in MCS
-
- When you report a bug, try to provide a small test case that would
- show the error so we can include this as part of the Mono C# regression
- test suite.
-
- If the bug is an error or a warning that we do not flag, write
- a sample program called `csXXXX.cs' where XXXX is the code number
- that is used by the Microsoft C# compiler that illustrates the
- problem. That way we can also do regression tests on the invalid
- input.
-
-** Phases of the compiler
-
- The compiler has a number of phases:
-
- <ul>
- * Lexical analyzer: hand-coded lexical analyzer that
- provides tokens to the parser.
-
- * The Parser: the parser is implemented using Jay (A
- Berkeley Yacc port to Java, that I ported to C#).
- The parser does minimal work and syntax checking,
- and only constructs a parsed tree.
-
- Each language element gets its own class. The code
- convention is to use an uppercase name for the
- language element. So a C# class and its associated
- information is kept in a "Class" class, a "struct"
- in a "Struct" class and so on. Statements derive
- from the "Statement" class, and Expressions from the
- Expr class.
-
- * Parent class resolution: before the actual code
- generation, we need to resolve the parents and
- interfaces for interface, classe and struct
- definitions.
-
- * Semantic analysis: since C# can not resolve in a
- top-down pass what identifiers actually mean, we
- have to postpone this decision until the above steps
- are finished.
-
- * Code generation: The code generation is done through
- the System.Reflection.Emit API.
- </ul>
-
-** CIL Optimizations.
-
- The compiler performs a number of simple optimizations on its input:
- constant folding (this is required by the C# language spec) and
- can perform dead code elimination.
-
- Other more interesting optimizations like hoisting are not possible
- at this point since the compiler output at this point does not
- generate an intermediate representation that is suitable to
- perform basic block computation.
-
- Adding an intermediate layer to enable the basic block
- computation to the compiler should be a simple task, but we
- are considering having a generic CIL optimizer. Since all the
- information that is required to perform basic block-based
- optimizations is available at the CIL level, we might just skip
- this step altogether and have just a generic IL optimizer that
- would perform hoisting on arbitrary CIL programs, not only
- those produced by MCS.
-
- If this tool is further expanded to perform constant folding
- (not needed for our C# compiler, as it is already in there)
- and dead code elimination, other compiler authors might be
- able to use this generic CIL optimizer in their projects
- reducing their time to develop a production compiler.
-
-<a name="tasks">
-** Current pending tasks
-
- Simple tasks:
-
- <ul>
- * Redo the way we deal with built-in operators.
- </ul>
-
- Larger tasks:
- <ul>
-
- * Jay does not work correctly with `error'
- productions, making parser errors hard to point. It
- would be best to port the Bison-To-Java compiler to
- become Bison-to-C# compiler.
-
- Nick Drochak has started a project on SourceForge for this.
- You can find the project at: <a href="http://sourceforge.net/projects/jb2csharp/">
- http://sourceforge.net/projects/jb2csharp/</a>
-
- * Semantic Analysis: Return path coverage and
- initialization before use coverage are two great
- features of C# that help reduce the number of bugs
- in applications. It is one interesting hack.
-
- </ul>
-
-** Questions and Answers
-
-Q: Why not write a C# front-end for GCC?
-
-A: I wanted to learn about C#, and this was an exercise in this
- task. The resulting compiler is highly object-oriented, which has
- lead to a very nice, easy to follow and simple implementation of
- the compiler.
-
- I found that the design of this compiler is very similar to
- Guavac's implementation.
-
- Targeting the CIL/MSIL byte codes would require to re-architecting
- GCC, as GCC is mostly designed to be used for register machines.
-
- The GCC Java engine that generates Java byte codes cheats: it does
- not use the GCC backend; it has a special backend just for Java, so
- you can not really generate Java bytecodes from the other languages
- supported by GCC.
-
-Q: If your C# compiler is written in C#, how do you plan on getting
- this working on a non-Microsoft environment.
-
- We will do this through an implementation of the CLI Virtual
- Execution System for Unix (our JIT engine).
-
- Our JIT engine is working for the purposes of using the compiler.
- The supporting class libraries are being worked on to fully support
- the compiler.
-
-Q: Do you use Bison?
-
-A: No, currently I am using Jay which is a port of Berkeley Yacc to
- Java that I later ported to C#. This means that error recovery is
- not as nice as I would like to, and for some reason error
- productions are not being caught.
-
- In the future I want to port one of the Bison/Java ports to C# for
- the parser.
-
-Q: Should someone work on a GCC front-end to C#?
-
-A: I would love if someone does, and we would love to help anyone that
- takes on that task, but we do not have the time or expertise to
- build a C# compiler with the GCC engine. I find it a lot more fun
- personally to work on C# on a C# compiler, which has an intrinsic
- beauty.
-
- We can provide help and assistance to anyone who would like to work
- on this task.
-
-Q: Should someone make a GCC backend that will generate CIL images?
-
-A: I would love to see a backend to GCC that generates CIL images. It
- would provide a ton of free compilers that would generate CIL
- code. This is something that people would want to look into
- anyways for Windows interoperation in the future.
-
- Again, we would love to provide help and assistance to anyone
- interested in working in such a project.
-
-Q: What about making a front-end to GCC that takes CIL images and
- generates native code?
-
-A: I would love to see this, specially since GCC supports this same
- feature for Java Byte Codes. You could use the metadata library
- from Mono to read the byte codes (ie, this would be your
- "front-end") and generate the trees that get passed to the
- optimizer.
-
- Ideally our implementation of the CLI will be available as a shared
- library that could be linked with your application as its runtime
- support.
-
- Again, we would love to provide help and assistance to anyone
- interested in working in such a project.
-
-Q: But would this work around the GPL in the GCC compiler and allow
- people to work on non-free front-ends?
-
-A: People can already do this by targeting the JVM byte codes (there
- are about 130 compilers for various languages that target the JVM).
-
-Q: Why are you writing a JIT engine instead of a front-end to GCC?
-
-A: The JIT engine and runtime engine will be able to execute CIL
- executables generated on Windows.
-
-You might also want to look at the <a href="faq.html#gcc">GCC</a>
-section on the main FAQ
diff --git a/doc/ccvs b/doc/ccvs
deleted file mode 100644
index c7710b56601..00000000000
--- a/doc/ccvs
+++ /dev/null
@@ -1,138 +0,0 @@
-* CVS Access
-
- If you are an active Mono developer, you can get a CVS account
- that hosts the Mono source code.
-
- If you are not a developer, but want to track the development, please
- see the <a href="anoncvs.html">AnonCVS</a> instructions.
-
- Send an e-mail to miguel with your public SSH key for this
- purpose. Please specify if the key was generated with SSH1 or SSH2.
-
- If you are using SSH2, please generate your key using:
-
-<pre>
- ssh-keygen -t rsa
-</pre>
-
- And mail me the id_rsa.pub file.
-
- If you are using SSH1, run:
-<pre>
- ssh-keygen
-</pre>
-
- And mail me your identity.pub file.
-
- You will need CVS and SSH. Windows users can get both by
- installing Cygwin (<a
- href="http://www.cygwin.com">http://www.cygwin.com</a>)
-
- Unix users will probably have those tools installed already.
-
-** Checking out the sources
-
- To check out the sources for the first time from the
- repository, use this command:
-
-<pre>
- export CVS_RSH=ssh
- export CVSROOT=username@mono-cvs.ximian.com:/cvs/public
- cvs -z3 co mcs mono
-</pre>
-
-** Updating your sources
-
- Every day people will be making changes, to get your latest
- updated sources, use:
-
-<pre>
- cvs -z3 update -Pd mcs mono
-</pre>
-
- Note: The '-z3' enables compression for the whole cvs action.
- The '-Pd' makes the update operation (P)rune directories that
- have been deleted and get new (d)irectories added to the
- repository.
-
-** Making patches
-
- Usually you will want to make a patch to contribute, and let
- other people review it before commiting it. To obtain such a
- "patch", you type:
-
-<pre>
- cd directory-you-want-to-diff
- cvs -z3 diff -u > file.diff
- mail mono-list@ximian.com < file.diff
-</pre>
-
-** Keeping track of changes.
-
- We provide two e-mail based mechanisms to keep track of
- changes to the code base:
-
- <ul>
- * <a href="mailto:mono-patches-request@ximian.com">
- mono-patches@ximian.com</a>: This mailing list receives
- in patch form all the changes that are being made to the
- CVS.
-
- * <a href="mailto:mono-cvs-list-request@ximian.com">
- mono-cvs-list@ximian.com</a>: This mailing list only
- receives the CVS commit logs with a list of files
- modified.
- </ul>
-
- We hope to offer LXR and Bonsai in the future as well.
-
-** Commiting your work
-
- Once you get approval to commit to the CVS, or if you are
- commiting code that you are the maintainer of, you will want
- to commit your code to CVS.
-
- To do this, you have to "add" any new files that you created:
-
-<pre>
- cvs add new-file.cs
-</pre>
-
- And then commit your changes to the repository:
-
-<pre>
- cvs commit file-1.cs file-2.cs
-</pre>
-
-** The Mailing List
-
- To keep track of the various development and changes to the
- CVS tree, you can subscribe to the mono-cvs-list@ximian.com.
- To subscribe, send an email message to
- mono-cvs-list-request@ximian.com and in the body of the
- message put `subscribe'.
-
- This will send you an email message every time a change is
- made to the CVS repository, together with the information that
- the author of the changes submitted.
-
-** Recommendations
-
- Please do not commit code that would break the compile to the
- CVS, because that normally wastes everybody's time. Two things
- are important in this step: trying to build your sources and making
- sure that you add all the new files before you do a commit.
-
- To build the sources, most of the type trying the `make' command
- is enough. In some cases (the class libraries) we use nant, so
- you need to run nant manually.
-
- Use ChangeLog entries so we can keep textual descriptions of
- your work, and use the contents of your ChangeLog file as the
- CVS commit message (ie, paste the contents of this into the
- editor buffer).
-
- If you are making changes to someone else's code, please make
- sure you get in touch with the maintainer of that code before
- applying patches. You want to avoid commiting conflicting
- work to someone else's code.
diff --git a/doc/class-library b/doc/class-library
deleted file mode 100644
index 95b56cacf9d..00000000000
--- a/doc/class-library
+++ /dev/null
@@ -1,190 +0,0 @@
-* The Class Library
-
- The Class Library should be compatible with Microsoft's .NET
- implementation.
-
- Please see the <a href="class-status.html">Class Status</a>
- page for a status of who is working on which classes.
-
- We will write as much code as possible in C#. We may need to
- interface with code written in C to gain access to the
- functionality of libraries like libart, Gtk+, and libc.
-
-** Contributing
-
- We welcome contributions to the the Class Library. To get
- started, check the status page for information about which
- APIs are being worked on, and how to get in touch with
- individual maintainers.
-
- If you want to work on a class, first check the <a
- href="download.html">Classes Distribution</a> to see if it is
- not implemented yet, if not, check the <a
- href="class-status.html">Class Status</a> to see if someone is
- already working on it, and maybe contact them.
-
- If nobody is working on it, mail <a
- href="mailto:mono-list@ximian.com">mono-list@ximian.com</a>
- with the class you want to implement and CC <a
- href="mailto:miguel@ximian.com">miguel@ximian.com</a>.
-
- You can also track live the activities of the Mono CVS module
- by subscribing to the <a
- href="http://lists.ximian.com/mailman/listinfo/mono-cvs-list">mono-cvs-list</a>
-
-
-** Missing features
-
- Our class libraries miss some features, for example, most classes
- do not implement the serialization bits at all, it would be a good
- contribution to add this to each class.
-
- This is a simple task, but it needs to be done in a compatible way
- with the Microsoft.NET classes: using the same arguments to serialize
- and reincarnate data.
-
-** Layout
-
- The Class Library resides in the `mcs' module in the directoy
- `class'.
-
- Each directory in the directory represents the assembly where
- the code belongs to, and inside each directory we divide the
- code based on the namespace they implement.
-
- There are two cases when we should consider portability: when
- we are dealing with a couple of classes only that differ from
- system to system (Consider System.Net and System.IO for Win32
- and Unix). In those cases we will just place the files for
- example on <t>corlib/System/System.IO/Unix-Console.cs</t> and
- <t>corlib/System/System.IO/Win32-Console.cs</t>.
-
- For classes that might differ more (for example, the
- implementation of Windows.Forms), we might have different
- directories altogether: <t>System.Windows.Forms/Win32</t>,
- <t>System.Windows.Forms/Gtk+</t> and
- <t>System.Windows.Forms/Cocoa</t>.
-
-** Using existing components from GNOME.
-
- Our current plan is to implement the GUI tools on top of
- Gtk+. The only obstacle here is that applications from Windows
- might expect to be able to pull the HWND property from the
- widgets and use PInvoke to call Windows functions.
-
-** Class Library and Win32 dependencies.
-
- There are a few spots where the Win32 foundation is exposed to
- the class library (for example, the HDC and HWND properties in
- the GDI+). Casual inspection suggests that these can be
- safely mapped to Gdk's GC and GdkWindow pointers without
- breaking anything.
-
- The only drawback is that support for PInvoke of Win32 code
- won't be available. An alternate solution would be to use
- portions of Wine, or even to use Wine as our toolkit.
-
-*** Initial GDI+ and WinForms implementation
-
- The initial implementation will use Gtk+ as the underlying
- toolkit. Since GTK+ has already been ported to many windowing
- systems other than X (including frame buffer, Win32, and BeOS)
- its use should cover most applications for most users.
-
-*** Database access
-
- We will implement ADO.NET functionality by reusing <a
- href="http://www.gnome-db.org">GNOME-DB</a>. This is an ideal
- choice, since GNOME-DB was implemented precisely to provide an
- ADO-like system for GNOME.
-
-*** Component Integration
-
- We will provide a new namespace to use GNOME specific features
- as well as a namespace to host Bonobo interfaces and classes
- in Mono.
-
-** Licensing
-
- The class library is being licensed under the terms of the
- <a
- href="http://www.opensource.org/licenses/mit-license.html">MIT
- license.</a> This is the same license used by the X11 window
- system.
-
-** Class Library testing
-
- We need to write regression tests that will verify
- the correctness of the class library, compiler, and JIT
- engine.
-
- Please write your regression tests using <a
- href="http://nunit.sourceforge.net">NUnit</a>
-
-** Coding conventions
-
- Please follow the conventions on the ECMA specification (On
- the Annex Partition) for your coding your libraries.
-
- Use 8 space tabs for writing your code (hopefully we can keep
- this consistent). If you are modifying someone else's code, try
- to keep the coding style similar.
-
- For a rationale on 8 space tabs, read Linus Torvald's Coding
- Style guidelines in the Linux kernel source for a rationale.
-
-*** Missing implementation bits
-
- If you implement a class and you are missing implementation bits,
- please put in the code the word "TODO" and a description of what
- is missing to be implemented.
-
-*** Tagging buggy code
-
- If there is a bug in your implementation tag the problem by using
- the word "FIXME" in the code, together with a description of the
- problem.
-
- Do not use XXX or obscure descriptions, because otherwise people
- will not be able to understand what you mean.
-
-*** Tagging Lame specs
-
- Sometimes the specification will be lame (consider Version.ToString (fieldCount)
- where there is no way of knowing how many fields are available, making the API
- not only stupid, but leading to unreliable code).
-
- In those cases, use the keyword "LAMESPEC".
-
-** Namespaces
-
- We are using a number of namespaces in the class libraries for
- private classes when we need them, you are encouraged to use these:
-
-<pre>
-Mono
- .Languages // General Compiler classes
- .CSharp // Specific C# parsing/tokenizing classes
- .MonoBASIC // Specific VB.NET/MonoBASIC parsing/tokenizing classes
- .Python // Specific Python parsing/tokenizing classes
- .Runtime
- .LateBind // General latebinding-support for MonoBASIC/Python
- .MonoBASIC // Specific runtime classes for MonoBASIC programs
- .Python // Specific runtime classes for Python programs
- .Web
- .UI
- .Utils // Gaurav utility classes
-</pre>
-
-** FAQ
-
-Frequently asked questions about the class library:
-
-Q: I am writing a new class that overrides one of the system classes,
- and I am getting a 1595 warning from the compiler. Should we use a
- different namespace?
-
-A: There is a quick solution to the problem, you can pass the command
- line argument /nowarn:1595 and this will effectively let you use
- your implementation of the code, while overriding the ones from the
- system assemblies. \ No newline at end of file
diff --git a/doc/class-status.in b/doc/class-status.in
deleted file mode 100644
index a66aa18092e..00000000000
--- a/doc/class-status.in
+++ /dev/null
@@ -1,26 +0,0 @@
-* Status of the various pieces of the class library
-
- You can browse the status of the class library and see who has
- registered to work on what parts of the system. These list
- work-in-progress components currently.
-
- Browse the current <a href="class-status/index.html">status</a>.
-
- You can also download the XML <a
- href="class-status/maintainers.xml">maintainers</a> file that
- contains the actual maintainers list.
-
- You can also download the master <a
- href="class-status/class.xml">Class Status XML</a> file.
-
-* List of not-implemented classes
-
- Pick from the list of assemblies in the menu on the left to
- view the current status of that assembly.
-
- The tree shows items that are either missing or that have TODO
- attributes associated with them.
- You can use the checkboxes to show only missing or only TODO items.
-
- Clicking on a name will take you to the <a href="http://msdn.microsoft.com/">MSDN documentation</a> for that item.
- CTRL-Clicking will take you to the <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?cvsroot=Mono">mono CVS tree</a>.
diff --git a/doc/classlib-doc b/doc/classlib-doc
deleted file mode 100644
index 14fdc9e7191..00000000000
--- a/doc/classlib-doc
+++ /dev/null
@@ -1,105 +0,0 @@
-* Class Library Documentation
-
-** Summary
-
- <em>
- [This documentation is in progress. Comments to
- <a href="mailto:jbarn@httcb.net">jbarn@httcb.net</a>.]
- </em>
-
- While using inline XML tags to document classes is certainly
- convenient, properly verbose documentation quickly overwhelms
- the code, making the source quite difficult to read. Furthermore,
- multilingual documentation makes for significant additional text.
-
- With these considerations in mind, Mono will use external XML files
- for type documentation, rather than documenting the source inline.
-
- Several tools will be created for managing, verifying, generating,
- and updating class library documentation, including:
-
- <ul>
- <li><a href="#docstub">docstub</a></li>
- <li><a href="#docverify">docverify</a></li>
- <li><a href="#docconv">docconv</a></li>
- <li><a href="#docgen">docgen</a></li>
- <li><a href="#monodoc">monodoc</a></li>
- </ul>
-
-** XML Documentation Files and Formats
-
-
-*** Monodoc XML
- This XML is similar to the XML documentation described in the
- C# standard, with added tags for internationalization and a
- slightly different structure. Documentation and a DTD/Schema
- for Monodoc XML is forthcoming.
-
- Monodoc XML does not contain any definitive type information,
- and is only useful in conjunction with the Type definition for
- whatever is being documented.
-
- This XML could be generated by hand, by monostub, or by monodoc.
-
-*** Assembly XML
- This XML is generated by combining runtime type information for
- an Assembly with a collection of Monodoc XML files. The resultant
- XML (in the best of cases) contains both complete type and
- documentary information for each type in the assembly.
-
- This XML contains enough information to be transformed into
- user-accessible documentation. It is likely that scripts
- will be created to generate reference docs as HTML and other
- formats.
-
- Documentation and a DTD/Schema for Assembly XML is forthcoming.
-
-** Documentation Tools
-
-*** <a name="docstub">docstub</a>
- Given a type name and an assembly, generates stub Monodoc XML
- documentation for the type. Optionally, docstub can attempt to
- populate initial documentation from an XML file in the format
- published along with the ECMA standard.
-
-*** <a name="docverify">docverify</a>
- Given a Monodoc XML file and an assembly, verifies that the
- documentation matches the compiled type. Checks signatures,
- parameters, et cetera.
-
-*** <a name="docconv">docconv</a>
- Converts from Monodoc XML to the standard C# compiler-emitted
- XML format and vice versa.
-
-*** <a name="docgen">docgen</a>
- Given an assembly and a collection of Monodoc XML files, creates
- an Assembly XML file containing all documentation and type information
- available. This output is suitable for transforming into user
- documentation.
-
-*** <a name="monodoc">monodoc</a>
- A GUI tool for documentation and translation, this encapsulates
- the capabilities of docstub, docverify, docconv, and docgen in
- a friendly user interface. In addition, monodoc provides features
- to ease translation, such as side-by-side editing and coverage
- statistics.
-
-** Status and Roadmap
-
-*** 2 January 2002
-
- As I write the initial version of this document, very little has been
- implemented. Currently, there is a:
-
- <ul>
- <li>Preliminary version of the Monodoc XML format</li>
- <li>Preliminary version of the docstub utility</li>
- </ul>
-
- Here's hoping for frequent, productive updates.
-
-** Get Involved
-
- Help us define Mono's documentation structure! Subscribe to
- <a href="http://lists.ximian.com/mailman/listinfo/mono-docs-list">mono-docs-list</a>
- and wade right in.
diff --git a/doc/contact b/doc/contact
deleted file mode 100644
index 74e09d9a195..00000000000
--- a/doc/contact
+++ /dev/null
@@ -1,13 +0,0 @@
-* Contacting the Mono team.
-
- You can contact the general forum of discussion by sending
- e-mail to <a href="mailto:mono-list@ximian.com">mono-list@ximian.com</a>
-
- You can contact me (Miguel de Icaza) by sending e-mail to <a
- href="mailto:miguel@ximian.com">miguel@ximian.com</a>. My web
- page is <a
- href="http://primates.ximian.com/~miguel">http://primates.ximian.com/~miguel"</a>
-
- You can also <a
- href="http://www.ximian.com/about/contact.php3">reach Ximian.</a>
-
diff --git a/doc/contributing b/doc/contributing
deleted file mode 100644
index ffadd989e98..00000000000
--- a/doc/contributing
+++ /dev/null
@@ -1,190 +0,0 @@
-* Contributing to the Mono project
-
- There are many ways in which you can help in the Mono project:
-
- <ul>
- * <b>Programmers:</b> You can work on a free
- implementation of the <a
- href="class-library.html">class libraries</a>, the
- <a href="runtime.html">runtime engine</a>, <a
- href="tools.html">the tools</a>, the <a
- href="testing.html">testing framework</a>
-
- * <b>Writers:</b> You can help us bywriting <a
- href="documentation.html">documentation</a>.
- </ul>
-
- Those are just broad things that need to be worked on, but
- something that would help tremendously would be to help with
- small duties in the project that need to be addressed.
-
- You can see what needs to be done in the class libraries <a href="class-status.html">here</a>
-
-** To start contributing
-
- As a programmer, you can contribute in three different scenarios to Mono:
-
- <ul>
- * If you only have Linux/Unix.
- * If you only have Windows.
-
- * If you have both Linux and Windows.
- </ul>
-
- You might also want to check our <a href="#setup">common
- setups</a> section that describes some common setups that people
- use while working on Mono.
-
-*** Contributing to the class library, regression tests or the compiler
-
- This only requires Windows currently.
-
- To start developing classes or to contribute to the compiler,
- you only need Windows and the .NET Framework 1.0 SDK. Please notice
- that you do not need Visual Studio (although you can use it if
- you want). The .NET Framework SDK requires some version of
- Windows XP or Windows NT. If you are running Windows 98, 95
- or Me, you could use instead the <a
- href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/829/msdncompositedoc.xml">.NET Redist package</a>, but it
- lacks the documentation browser and the ildasm program (C#, VB, JScript and IL
- assembler are included).
-
- You can get it <a href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">here</a>
-
- If you are new to .NET, writing regression tests is a good way
- of starting to contribute: it will help you get used to C# as
- well as getting comfortable with the .NET APIs.
-
- This helps because at this point you might be the best
- qualified person to fix a problem found by the regression
- test, or you might have a new class to implement in the .NET
- world that only has a test suite.
-
- To get started writing tests see the <a href="testing.html">Test Suite</a>
- section. <a href="mono-contribution-howto">Here</a> there is a good All-In-One introduction to the art of writing tests.
-
-
-*** Contributing to the runtime engine
-
- This only requires Linux, currently some tasks are easier if you
- have access to Windows as well.
-
- Here are a few things you can do:
- <ul>
- * Port the runtime to other architectures.
- * Port the runtime to other operating systems.
- * Finish the IL code verifier in the runtime.
- * Hack the JIT, improve the code generator, add new
- pattern rules, improve the register allocator.
- * Implement the debugging interfaaces
- </ul>
-
-** Bug reporting
-
- If you find bugs in Mono, please make sure you enter a bug
- report so we can keep track of problems in Mono.
-
- To enter bug reports go to <a href="http://bugzilla.ximian.com">
- http://bugzilla.ximian.com</a> and enter bug reports against
- your favorite component (Mono, Runtime, C# compiler).
-
- You can review the list of current bugs by going <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FMCS&product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=%27Importance%27&form_name=query">here</a>
-
-** Small tasks
-
- A few smaller tasks are here, dropped in no particular order:
- <ul>
- * <b>Mono/doc and web site:</b> They need to be
- packaged up in the official `distribution'
-
- * Adding serialization support to all the classes.
-
- We have many classes, but we have not implemented in
- many cases the serialization and re-incarnation support in
- them (this is pretty straight forward code, and simple,
- but there is a lot to be done here).
- </ul>
-
-* Emacs support
-
- Brad Merryl's C# mode for Emacs is available: <a
- href="http://www.cybercom.net/~zbrad/DotNet/Emacs/">http://www.cybercom.net/~zbrad/DotNet/Emacs/</a>
-
-* Books on C# and DotNet.
-
- <ul>
- * Dotnet Books (<a href="http://www.dotnetbooks.com">http://www.dotnetbooks.com</a>)
-
- * Dotnet Resources (<a href="http://www.dotnetexperts.com/resources/">
- http://www.dotnetexperts.com/resources</a>)
-
- * O'Reilly C# Essentials (<a href="http://www.oreilly.com/catalog/csharpess/">
- http://www.oreally.com/catalog/csharpess</a>)
-
- * O'Really .NET Essentials (<a href="http://www.oreilly.com/catalog/dotnetfrmess/">
- http://www.oreally.com/catalog/dotnetfrmess</a>)
- </ul>
-
-<a name="setup">
-* Common Setups
-
- People running both Linux and Windows while contributing to
- Mono use a number of tricks to increase their productivity.
-
- Scenarios:
-
- <ul>
- * <b>Linux host and Windows host</b>
-
- The Windows file system is shared (right click on
- your hard drive icon, and select sharing, allow this
- to be shared).
-
- The Windows machine has the required build tools
- (cygwin, and the .NET framework). On the Windows
- machine, you want to setup the ssh server (run the
- ssh-host-config program to configure your ssh) and
- run it (from a cygwin terminal, type: /usr/sbin/sshd).
-
- From the Linux side, you want to mount the Windows
- file system, using something like this:
-
-<tt><pre>
- mount -t smbfs -o uid=miguel,username="Miguel de Icaza" "//quack/c$" /mnt
-</pre></tt>
-
- In the above example, my Linux user name is
- `miguel', and this will allow this user to have
- read/write access to the share.
-
- The host name is `quack', and the name of the share
- is `c$' (that is the C: partition).
-
- The file system is accessible on /mnt.
-
- You can perform your cvs update and cvs commits from
- the /mnt directory, and run Emacs or your favorite
- Linux text editor on the Unix side in this way.
-
- Then from another terminal, you can ssh into your
- Windows box using ssh, like this: ssh "Miguel de Icaza@quack"
- </ul>
-
-* Special Note
-
- If you have looked at Microsoft's implementation of .NET or
- their shared source code, you may not be able to contribute
- to Mono. Details will follow when we know more about this.
-
- In general be careful when you are implementing free software
- and you have access to proprietary code. We need to make sure
- that we are not using someone else's copyrighted code
- accidentally.
-
- Please do not use the <b>ildasm</b> program to disassemble
- proprietary code when you are planning to reimplement a class
- for Mono. If you have done this, we might not be able to use
- your code.
-
- Please stick to published documentation for implementing any
- classes.
diff --git a/doc/devel-faq b/doc/devel-faq
deleted file mode 100644
index 9ca89285219..00000000000
--- a/doc/devel-faq
+++ /dev/null
@@ -1,190 +0,0 @@
-* Developer FAQ
-
-** New classes
-
-Q: Should we write classes which are not part of the .NET or ECMA specs?
-
-A: Yes. The ECMA and .NET specifications are far from complete, and
- to produce a complete platform we will need a number of other
- classes and components.
-
- Any new classes that are not part of .NET or ECMA should be
- designed to be reusable on anyone's CLI implementation. So that
- Windows developers can also use any new classes that we come up
- with.
-
- We have a few existing <a href="ideas.html">Ideas on missing
- classes</a>
-
-** Language Compatibility
-
-Q: What is the magic that allow multiple languages to co-exist?
-
-A: From Fergus Henderson:
-
-<i><blockquote>
-There are different levels of interoperability.
-The ECMA spec defines different categories of
-CLS (Common Language Specification) conformance.
-There are also some useful categories that don't
-correspond to any of the levels defined in the ECMA spec.
-In increasing degree of difficulty, your language implementation
-can
-
- <ul>
- * (a) just generate IL
-
- * (b) be a CLS "consumer", which means that it can read in
- meta-data describing component interfaces,
- and that it provides a way to declare variables of
- CLS-complaint types and to call CLS-complaint methods.
-
- * (c) be a CLS "extender", which means that it can in addition
- derive from CLS-compliant classes
- and implement CLS-compliant interfaces
-
- * (d) be able to produce components with *any* CLS-compliant
- component interface.
- </ul>
-
-Supporting some of these may require extending your language. However,
-you can get quite a lot of interoperability by just putting appropriate
-functionality in your compiler, without extending your language.
-
-For some things, e.g. ASP.NET, your language implementation also needs to be
-able to
-
- <ul>
- * (e) consume CodeDom trees. CodeDom trees are an abstract
- representation of programs in a form similar to a C# parse
- tree, with embedded code snippets (unparsed strings).
- Given a CodeDom tree, with the snippets in your language,
- your language implementation needs to generate a (i) .NET
- assembly and possibly also (ii) a source file in your language.
-
- * (f) produce CodeDom trees. For some applications,
- your language implementation also needs to be able to
- round-trip from CodeDom -> your language -> CodeDom.
- </ul>
-
-and for some things it needs to
-
- <ul>
- * (g) generate *verifiable* IL
- </ul>
-
-So when you hear all the hype about how language XYZ is a
-".NET language", make sure you ask which of these different
-things are supported.
-
-[For the record, Mercury currently supports (a). We're working on
-(b) and (g), and on parts of (c) and (e). We're never going to do (f), I very
-strongly doubt we'll ever do (d), and for (c) we might only ever support
-implementing interfaces, not deriving from classes.]
-
-</blockquote></i>
-
-** PInvoke
-
-Q: What are the two major initiatives to implement PInvoke?
-
-A: Fergus Henderson answers:
-
-<i><blockquote>
-Many of the .NET APIs will need to be implemented using code that calls C/Unix
-APIs, such as stat(). The standard way of interfacing with native code from
-.NET code is to use "PInvoke". However, there is a difficulty: many of
-these APIs are defined in terms of types such as C's `long' or `size_t'
-or the Posix `struct stat' whose representation varies depending on the
-platform (architecture/OS/C compiler). There's no *portable* way of
-accessing those from .NET managed code.
-
-So, there are a couple of different approaches.
-One possibility is to access such routines by writing a wrapper, e.g. in C,
-that provides the same functionality without using types with a system-dependent
-representation. The wrapper can then be directly accessed from portable
-.NET code. The .NET code remains both source- and binary-portable;
-the wrapper code is source-portable, but needs to be compiled
-seperately for each target platform. The drawback of this approach is
-that you have to write a lot of cumbersome wrapper code.
-
-Another possibility is to extend the .NET VM with support for an
-additional custom attribute, e.g. "[PosixType]". The VM would then
-represent types tagged with this attribute in the same way that the
-underlying system represents those types. With this approach, no
-wrapper code would be needed. A drawback of this approach is that it
-pushes quite a bit of complexity into the VM; the VM would have to know
-the native representation of all types annotated with this attribute.
-Another drawback is that code using this extension might not work on
-different VMs.
-
-There have also been some other suggestions, but those are the two that
-I think are the best.
-</blockquote></i>
-
-Q: What is the problem implementing PInvoke?
-
-A: Again, from Fergus Henderson:
-
-<i><blockquote>
-There's no problem implementing PInvoke as specified in the ECMA
-specs and/or MS documentation. It's just that PInvoke by itself
-doesn't solve all of the problems; in particular it doesn't solve
-the problem of C types whose representation is different on different
-systems.
-</blockquote></i>
-
-** CVS use
-
-Q: Why do we keep ChangeLogs and make the CVS commit messages be the
- same? One could be generated from the other
-
-A: There are a number of reasons for keeping ChangeLog files as well as
- CVS commit files:
-
- <ul>
- * Offline programming: when people are traveling, CVS logs are
- not available.
-
- * Slow CVS access: Many people work over modem lines (very
- typical for contributors in Europe, Asia, Latin America)
- using CVS is slow and might not be available to you (cvs
- server down, no anoncvs server available).
-
- * ChangeLogs travel in a released tarball package, so it is
- possible to study the rationale of changes even after a
- project is long "released", or you only have the sources for
- the code.
-
- * ChangeLog are not metadata for each file, they are live
- files that you can browse in the package that is being
- distributed.
- </ul>
-
-Making the CVS commit message be the same as the ChangeLog has other
-benefits:
-
- <ul>
- * You can track down with `cvs log' what things were changed,
- and match those to meaningful reports on the intentions of
- the commit.
-
- * When reading the commits-list, you can get a glimpse of the
- changes without having to diff out or cvs update your tree.
-
- * You can read off-line the changes that are being made
- (asyncrouns operation).
- </ul>
-
-This mechanism works very well for GNOME and other projects.
-
-Q: Should I use any of the special RCS keywords like $Id: devel-faq,v 1.1 2001/07/31 21:13:05 miguel Exp $, $Author: miguel $,
- $Date: 2001/07/31 21:13:05 $, or $Revision: 1.1 $?
-
-A: Please avoid using those in the source code in the CVS. They
- are not really useful, and they cause a lot of conflicts when
- people have separate CVS trees.
-
- It was a nightmare with the Linux kernel when two people had their
- private CVS trees and were submitting patches to the core.
-
diff --git a/doc/documentation b/doc/documentation
deleted file mode 100644
index 4ed2e6a6639..00000000000
--- a/doc/documentation
+++ /dev/null
@@ -1,62 +0,0 @@
-* Documentation
-
- Although most of the concepts from Microsoft.NET can
- be applied to the completed Mono platform, we do need to
- have a complete set of free documentation written specifically
- for Mono.
-
- The documentation license we have chosen is the GNU Free
- Documentation License (FDL), the standard for most documents
- in the free software world.
-
- We need documentation on a number of topics:
-
- <ul>
-
- * The development tools (compilers, assembler tools,
- language reference, design time features).
-
- * Frequently Asked Question compilations.
-
- * HOWTO documents.
-
- * The Class Libraries
-
- * Tutorials on Mono and the specifics of running it.
-
- * A guide to Mono as compared to the Microsoft.NET
- Framework SDK
-
- </ul>
-
-** Class Library documentation
-
- We are moving to a new setup for documenting the class libraries,
- and you can read about it <a href="classlib-doc.html">here</a>.
-
- A few words of warning and advice for class documentors:
-
- A well-documented API can ease hours of frustration; as Mono
- matures, robust and complete class library documentation will
- become increasingly important. As you write API documentation,
- whether it is embedded in source files or in external Monodoc XML,
- please keep the following in mind:
-
- Plagarism, even if it's unintentional, is a Bad Thing(TM).
- Microsoft's .NET Framework Class Library documentation is an
- excellent resource for understanding the behavior and properties of
- a type, and a lot of hard work went in to creating this (copyrighted)
- resource. Please don't copy from Microsoft's reference when
- documenting a type.
-
- To avoid this, I (<a href="mailto:jbarn@httcb.net">jbarn@httcb.net</a>)
- suggest that you read the complete Microsoft documentation for a type,
- ponder it for a while, and write the Mono documentation in your own
- words. While it's certainly okay to refer to the Microsoft
- documentation to clarify your understanding of behavior or properties,
- please don't open the Microsoft docs and refer to them for each member
- you document.
-
- There's a lot of domain expertise among the class library contributors;
- let's put the same personal stamp on the class library documentation
- that we have on the class libraries themselves. \ No newline at end of file
diff --git a/doc/download b/doc/download
deleted file mode 100644
index c4eff0e7c18..00000000000
--- a/doc/download
+++ /dev/null
@@ -1,381 +0,0 @@
-* Software Availability
-
- The Virtual Execution System is available in package `mono'.
- Currently this contains a metadata library and the
- disassembler. Please refer to our <a
- href="runtime.html">Runtime</a> description for more details
- on this part of the project.
-
- The code for the C# compiler as well as the language error
- test suite and the class library are in the `mcs' package, we
- will move this later into `mono' itself.
-
- In order to make mcs and the class libraries you will need a computer
- running Windows with the <strong>GNU make tools</strong> from the
- <strong>Cygwin</strong> environment, <strong>Microsoft's .NET Framework
- SDK</strong>, <strong>GLIB 2.0</strong> and
- <strong>pkg-config</strong>.
-
- When installing Cygwin, don't forget to include
- <tt>mingw-runtime</tt>. If you omit this, you will encounter
- configure problems regarding not being able to generate
- executables.
-
-<a name="sources">
-*** Sources
-
- Stay up to date on the Mono team's development using the
- <a href="http://lists.ximian.com/mailman/listinfo/mono-cvs-list">
- mono-cvs-list</a> mailing list. The CVS source code can also
- be browsed <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?cvsroot=Mono#dirlist">here</a>
-
-<a name="jun-7">
- <b>Mono 0.12</b>
-
- New packaged versions of the Mono C# compiler and Mono runtime
- are now available. The latest version is 0.12.
-
- <ul>
- * <a href="archive/mono-0.12">Mono 0.12 release notes</a>
-
- * <a href="archive/mcs-0.12.tar.gz">mcs-0.12.tar.gz</a>
- Mono C# compiler with class library source code.
-
- * <a href="archive/mono-0.12.tar.gz">mono-0.12.tar.gz</a>
- Mono runtime.
- </ul>
-
-* Snapshots
-
- Volunteers package up daily the sources:
-
- <ul>
- * <a href="http://www.atoker.com/mono">Debian Linux</a>
- * <a href="http://mono.baselabs.org/index.php/software">Red Hat Linux</a>
- * <a href="http://www.superin.formativ.net/mono/mono.htm">Windows</a> (works without cygwin!)
- </ul>
-
-<a name="snapshots">
- For up to date sources, it is recommended that you use the Mono
- source code from either the
- <a href="http://www.go-mono.com/snapshots">nightly snapshots</a> or
- the <a href="anoncvs.html">Anonymous CVS</a>. The nightly
- snapshots are done every night at 10pm EST (Boston Time).
-
- The nightly snapshots are not guaranteed to build, but most of the
- time they should. They should give you a window to see what we are
- up to.
-
- You can download the GNU make tools and the Cygwin environment from
- <a href="http://www.cygwin.com">www.cygwin.com</a>.
-
- You can download Microsoft's .NET Framework SDK from
- <a href="http://msdn.microsoft.com/downloads">
- msdn.microsoft.com/downloads</a>.
-
- There are scripts to help build mono for both Unix and Windows. Get
- <a href="mono-build.sh">mono-build.sh</a> for Unix, or <a
- href="mono-build-w32.sh">mono-build-w32.sh</a> for Windows.
- These scripts automate the installation of GLIB and pkgconfig
- (building from source on Unix, and using binary packages
- provided by the GIMP for Windows project on Windows.) To use
- the script, follow these simple steps:
-
- <ul>
- * Save the script for your platform somewhere (e.g. /usr/local/bin)
- * Make the script executable (i.e chmod 755 /usr/local/bin/mono-build.sh)
- * Create a directory to hold the mono source, and the compiled binaries (e.g. mkdir ~/mono)
- * Change to the new directory (i.e. cd ~/mono)
- * run the script (i.e. /usr/local/bin/mono-build.sh)
- </ul>
-
- The script requires wget on either platform, and building the
- software requires make, gcc, automake, autoconf, and libtool.
- You should install these packages from your distribution or
- with the cygwin installer.
-
- The script will download required packages from
- www.go-mono.com and do a cvs checkout of mono in the current
- directory. The cvs server chosen defaults to anonymous cvs;
- set your CVSROOT environment variable before running the script to
- select a particular cvs server.
-
-** Mono Regression Test Suite
-
- You can get binaries for the Mono Regression Test Suite <a
- href="archive/mono-tests.tar.gz">here</a>
-
-<a name="install">
-** Building the software manually
-
-*** Download the required software.
-
- <ul>
-
- * Microsoft's .NET Framework SDK from
- <a href="http://msdn.microsoft.com/downloads">
- msdn.microsoft.com/downloads</a>.
-
- * Cygwin and the GNU Make tools from
- <a href="http://www.cygwin.com">www.cygwin.com</a>.
- Some people observed problems with autoconf 2.52. Installing
- autoconf 2.13 helped in those cases.
-
- * Precompiled GLIB 1.3 and pkg-config packages (and
- their dependencies) by the <a href="http://www.gimp.org/~tml/gimp/win32//index.html">GIMP for Windows</a> project from
- <a href="http://www.go-mono.com/archive/pkgconfig-0.80-tml-20020101.zip">http://www.go-mono.com/archive/pkgconfig-0.80-tml-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/glib-1.3.12-20020101.zip">http://www.go-mono.com/archive/glib-1.3.12-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/glib-dev-1.3.12-20020101.zip">http://www.go-mono.com/archive/glib-dev-1.3.12-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/libiconv-1.7.zip">http://www.go-mono.com/archive/libiconv-1.7.zip</a>
- <a href="http://www.go-mono.com/archive/libiconv-dev-1.7.zip">http://www.go-mono.com/archive/libiconv-dev-1.7-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip">http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip</a>
-
- * Download the Mono source code from the
- <a href="#feb-11">packaged versions</a> or
- the <a href="http://www.go-mono.com/snapshots">
- nightly snapshots</a> or the <a href="anoncvs.html">
- Anonymous CVS</a>. The nightly snapshots are done every
- night at 10pm EST (Boston Time). The nightly snapshots are
- not guaranteed to build, but most of the time they should.
-
-
- </ul>
-
-
-*** Install Cygwin and the GNU build tools, Microsoft's .NET Framework SDK and the precompiled GLIB 1.3 and pkg-config libraries.
-
- <ul>
-
- * Install <a href="http://www.cygwin.com">Cygwin</a>.
-
- * Install <a href="http://msdn.microsoft.com/downloads">
- Microsoft .NET Framework SDK</a>.
-
- * Change to the <strong>/usr/local</strong> directory
- of your Cygwin installation.<br>
- Unzip the precompiled packages listed above.
-
- </ul>
-
-*** On Windows, to install and work on the compiler and the class libraries:
-
- <ul>
-
- * If you downloaded the Mono
- <a href="http://www.go-mono.com/snapshots">nightly snapshot
- </a>, untar the snapshot.
-
- * Change directories to <strong>"mcs"</strong>.
-
- * Compile:
-
-<pre>
-<strong>make windows</strong>
-</pre>
-
- </ul>
-
-*** On Windows, to compile the mono runtime:
-
- <ul>
-
- * If you downloaded the Mono
- <a href="http://www.go-mono.com/snapshots">nightly snapshot
- </a>, untar the snapshot.
-
- * Change directories to <strong>"mono"</strong>.
-
- * Configure, compile and install:
-
-<pre><strong>
-./configure --prefix=c:/mono
-make
-make install
-</strong></pre>
-
- </ul>
-
-*** On Unix, to compile the mono runtime:
-
- <ul>
-
- * Install <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a>.
-
- * Install glib 1.3. You can download it
- from <a href="ftp://ftp.gtk.org/pub/gtk/v1.3/glib-1.3.12.tar.gz">ftp.gtk.org</a>. Maybe you need
- to modify your ACLOCAL_FLAGS for pkg-config, for example if
- your install prefix is /usr/local:
-<pre>
-<strong>export ACLOCAL_FLAGS="-I /usr/local/share/aclocal"</strong>
-</pre>
-
- * If you downloaded the Mono
- <a href="http://www.go-mono.com/snapshots">nightly snapshots
- </a>, untar the snapshot.
-
- * Change directories to <strong>"mono"</strong>.
-
- * Configure, compile and install:
-<pre><strong>
-./configure
-make
-make install</strong>
-</pre>
- </ul>
-
-*** Notes on compiling GLIB 1.3 and pkg-config from source:
-
-
- <ul>
-
- * Some people observed problems with autoconf 2.52. Installing
- autoconf 2.13 helped in those cases (don't forget to do a
- `make maintainer-clean' after the update).
-
- * Download, compile and install <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a> from source.
- (I had to change line 674 of
- <nobr><tt>pkg-config-0.8.0/glib-1.2.8/gstrfuncs.c</tt></nobr> from
- <nobr><tt>extern char *strsignal (int sig);</tt></nobr> to
- <nobr><tt>extern const char *strsignal (int sig);</tt></nobr>.
-
-<pre><strong>
-tar xzvf pkg-config-0.8.0.tar.gz
-cd pkg-config-0.8.0
-./configure --prefix=/usr
-make
-make install</strong>
-</pre>
-
- * Download, compile and install <a href="ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.7.tar.gz">libiconv</a> from source.<br>
- If you dont have MS Visual C/C++ 4.0 or 5.0 or 6.0 you can also try
- the binary package available at <a
- href="http://www.gimp.org/win32/libiconv-dev-20001007.zip">
- http://www.gimp.org/win32/libiconv-dev-20001007.zip</a>.
-
-
- * Download, compile and install the
- <a href="ftp://ftp.gtk.org/pub/gtk/v1.3/glib-1.3.12.tar.gz">
- glib 1.3</a> from source.
-
- </ul>
-
-
-<a name="oldreleases">
-
-*** Old releases.
-
- <ul>
-
- <ul>
- <a name="apr-24">
- <b>Mono 0.11; April 24, 2002</b>
- * <a href="archive/mono-0.11">Mono 0.11 release notes</a>
-
- * <a href="archive/mcs-0.11.tar.gz">mcs-0.11.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.11.tar.gz">mono-0.11.tar.gz</a>
- Mono runtime
- </ul>
-
- <ul>
- <a name="mar-27">
- <b>Mono 0.10; March 27, 2002</b>
- * <a href="archive/mono-0.10">Mono 0.10 release notes</a>
- * <a href="archive/mcs-0.10.tar.gz">mcs-0.10.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.10.tar.gz">mono-0.10.tar.gz</a>
- Mono runtime
- </ul>
-
- <ul>
- <a name="feb-22">
- <b>Mono 0.9; February 22, 2002</b>
- * <a href="archive/mono-0.9">Mono 0.9 release notes</a>
-
- * <a href="archive/mcs-0.9.tar.gz">mcs-0.9.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.9.tar.gz">mono-0.9.tar.gz</a>
- Mono runtime
- </ul>
-
- <a name="feb-11">
- <b>February 11, 2002</b>
- * <a href="archive/mcs-0.8.tar.gz">mcs-0.8.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.8.tar.gz">mono-0.8.tar.gz</a>
- Mono runtime
- </ul>
-
- <a name="sep-18">
- <b>September 18, 2001</b>
- <ul>
- * <a href="archive/mono-0.7.tar.gz">mono-0.7.tar.gz</a>: Mono Runtime 0.7 release.
- * <a href="archive/mcs-0.7.tar.gz">mcs-0.7.tar.gz</a>: Mono Compiler and Classes 0.7 release.
- * <a href="archive/mono-0.7">Release Notes.</a>
- </ul>
-
- <a name="august-22">
- <b>August 22, 2001</b>
- <ul>
- * <a href="archive/mono-0.6.tar.gz">mono-0.6.tar.gz</a>: Mono Runtime 0.6 release.
- * <a href="archive/mono-compiler-classes-0.6.tar.gz">mono-compiler-classes-0.6.tar.gz</a>: Mono Compiler and Classes 0.6 release.
- * <a href="archive/mono-0.6">Release Notes.</a>
- </ul>
-
-
- <a name="july-29">
- <b>July 29, 2001</b>
- <ul>
- * <a href="archive/mono-0.5.tar.gz">mono-0.5.tar.gz</a>: Mono Runtime 0.5 release.
- * <a href="archive/mono-0.5">Release Notes.</a>
- </ul>
-
-
- <a name="july-22">
- <b>July 22, 2001</b>
- <ul>
- * <a href="archive/mcs-22-Jul-2001.tar.gz">mcs-22-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mcs-Jul-22-Jul-19-2001.tar.gz">Differences since 19</a>: CVS snapshot.
- * <a href="archive/mcs-22">Release Notes.</a>
- </ul>
-
- <a name="july-19">
- <b>July 19th, 2001</b>
- <ul>
- * <a href="archive/mcs-19-Jul-2001.tar.gz">mcs-19-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mcs-Jul-17-Jul-19-2001.tar.gz">Differences since 17</a>: CVS snapshot.
- * <a href="archive/mcs-19">Release Notes.</a>
- </ul>
-
- <a name="july-17">
- <b>July 17th, 2001</b>
- <ul>
- * <a href="archive/mcs-17-Jul-2001.tar.gz">mcs-17-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mcs-Jul-15-Jul-17-2001.tar.gz">Differences since 15</a>: CVS snapshot.
- * <a href="archive/mcs-17">Release Notes.</a>
- </ul>
-
- <a name="july-15">
- <b>July 15th, 2001</b>
- <ul>
- * <a href="archive/mcs-15-Jul-2001.tar.gz">mcs-15-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mono-0.4.tar.gz">mono-0.4.tar.gz</a>: Packaged Source Code.
- * <a href="archive/mono-0.4">Release Notes.</a>
- </ul>
-
- <a name="july-14">
- <b>July 14th, 2001</b>
- <ul>
- * <a href="archive/mcs-12-Jul-2001.tar.gz">mcs-12-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mono-0.3.tar.gz">mono-0.3.tar.gz</a>: Packaged Source Code.
- </ul>
-
- <a name="july-8">
- <b>July 8th, 2001</b>
-
- <ul>
- * <a href="archive/mcs-08-Jul-2001.tar.gz">mcs-08-Jul-2001.tar.gz</a>: CVS Snapshot
- * <a href="archive/mono-08-Jul-2001.tar.gz">mono-08-Jul-2001.tar.gz</a>: CVS Snapshot
- </ul>
- </ul>
-
diff --git a/doc/faq b/doc/faq
deleted file mode 100644
index f07c9822b24..00000000000
--- a/doc/faq
+++ /dev/null
@@ -1,860 +0,0 @@
-<a href="#basics">Basics</a><br>
-<a href="#ximian">The Ximian Role in the Mono project</a><br>
-<a href="#gnome">Mono and GNOME</a><br>
-<a href="#gui">Building GUI applications with Mono</a><br>
-<a href="#msft">Mono and Microsoft</a><br>
-<a href="#pnpproject">Mono and the Portable.NET Project</a><br>
-<a href="#webservices">Web Services</a><br>
-<a href="#asp">Mono and ASP.NET</a><br>
-<a href="#devel">Development Tools and Issues</a><br>
-<a href="#java">Mono and Java</a><br>
-<a href="#extending">Extending Mono</a><br>
-<a href="#portability">Portability</a><br>
-<a href="#reuse">Reusing Existing Code</a><br>
-<a href="#gcc">Mono and GCC</a><br>
-<a href="#performance">Performance</a><br>
-<a href="#licensing">Licensing</a><br>
-<a href="#patents">Patents</a><br>
-<a href="#etc">Miscellaneous Questions</a><br>
-
-
-<a name="basics"></a>
-** Basics
-
-Q: What is Mono exactly?
-
-A: The Mono Project is an open development initiative sponsored by
- Ximian that is working to develop an open source, Unix
- version of the Microsoft .NET development platform. Its objective
- is to enable Unix developers to build and
- deploy cross-platform .NET Applications. The project will
- implement various technologies developed by Microsoft that have now
- been submitted to the ECMA for standardization.
-
-Q: What is the difference between Mono and the .NET Initiative?
-
-A: The ".NET Initiative" is a somewhat nebulous company-wide effort by
- Microsoft, one part of which is a cross-platform development
- framework. Mono is an implementation of the development framework,
- but not an implementation of anything else related to the .NET
- Initiative, such as Passport, software-as-a-service, or
- corporate rebranding.
-
-Q: What technologies are included in Mono?
-
-A: Mono contains a number of components useful for building new
- software:
-
- <ul>
- * A Common Language Infrastructure (CLI) virtual
- machine that contains a class loader, Just-in-time
- compiler, and a garbage collecting runtime.
-
- * A class library that can work with any language
- which works on the CLR.
-
- * A compiler for the C# language. In the future we
- might work on other compilers that target the Common
- Language Runtime.
- </ul>
-
-
- Windows has compilers that target the virtual machine from <a
- href="http://msdn.microsoft.com/net/thirdparty/default.asp#lang">a
- number of languages:</a> Managed C++, Java Script, Eiffel,
- Component Pascal, APL, Cobol, Oberon, Perl, Python, Scheme,
- Smalltalk, Standard ML, Haskell, Mercury and Oberon.
-
- The CLR and the Common Type System (CTS) enables applications and
- libraries to be written in a collection of different languages that
- target the byte code
-
- This means for example that if you define a class to do algebraic
- manipulation in C#, that class can be reused from any other
- language that supports the CLI. You could create a class in C#,
- subclass it in C++ and instantiate it in an Eiffel program.
-
- A single object system, threading system, class libraries, and
- garbage collection system can be shared across all these languages.
-
-Q: Where can I find the specification for these technologies?
-
-A: You can find the work-in-progress documentation from the T3G ECMA
- group here:
-
- <a href="http://www.dotnetexperts.com">http://www.dotnetexperts.com</a>
-
-Q: Will you implement the .NET Framework SDK class libraries?
-
-A: Yes, we will be implementing the APIs of the .NET Framework SDK
- class libraries.
-
-Q: Will you offer an ECMA-compliant set of class libraries?
-
-A: Eventually we will. Our current focus is on interoperating
- with the Microsoft SDK, but we will also offer an ECMA compliant
- set of libraries.
-
-Q: What does the name "Mono" mean?
-
-A: Mono is the word for `monkey' in Spanish. We like monkeys.
-
-Q: Is Mono usable?
-
-A: The JIT engine is usable on Intel x86 machines. An interpreter
- can be used on other non-Intel x86 machines.
-
- The class libraries are mature enough to run some real applications
- (the compiler for instance, and every day more and more applications
- are natively developed with Mono).
-
-Q: When will you ship it?
-
-A: Different parts of Mono will achieve usability at different stages,
- once we are comfortable with the compiler, we will release "Mono Core",
- which contains everything needed to develop applications with the base
- class libraries. This should be available at some point during 2002.
-
- Other higher level class libraries (ASP.NET, ADO.NET, Windows.Forms) will
- be released when they become stable.
-
-Q: What major components will you include in Mono?
-
-A: Hopefully eveyrthing that Microsoft ships on their Framework
- (ADO.NET, ASP.NET, Windows.Forms), and
- we encourage third party developers to create reusable components that
- work on both Mono and Windows.
-
-Q: How can I contribute?
-
-A: Check the <a href="contributing.html">contributing</a> section.
-
-Q: Aren't you just copying someone else's work?
-
-A: We are interested in providing the best tools for programmers to
- develop applications for Free Operating Systems. We also want to help
- provide the interoperability that will allow those systems to fit in
- with other standards.
-
- For more background, read the <a href="http://www.go-mono.com/rationale.html">Mono
- Project white paper</a>.
- the project.
-
-Q: Miguel said once that Mono was being implemented in COBOL. Is that true?.
-
-A: No. It was a joke.
-
-
-<a name="ximian"></a>
-
-** The Ximian Role in the Mono Project
-
-Q: Why is Ximian working on .NET?
-
-A: Ximian is interested in providing the best tools for programmers to
- develop applications for Free Operating Systems.
-
- For more information, read the project <a
- href="rationale.html">rationale</a> page.
-
-Q: Will Ximian be able to take on a project of this size?
-
-A: Of course not. Ximian a supporter of the Mono project, but the only way
- to implement something of this size is for the entire free software
- community to get involved. Visit the <a href="contributing.html">contributing</a>
- page if you'd like to help out.
-
-Q: What pieces will Ximian be working on?
-
-A: We will devote most of our resources to work on the pieces which are
- on the critical path to release a development and execution
- environment. Once the project is at a stage where it is useful in
- the real world, it will achieve a critical mass of developers to
- improve it further.
-
-Q: Will Ximian offer Mono commercially?
-
-A: When Mono is ready to be shipped Ximian will offer a commercial
- support and services for Mono.
-
-Q: Does Ximian provide consulting services around Mono?
-
-A: Yes, Ximian does provide consulting services around Mono to
- make it suitable to your needs. Porting the runtime engine,
- customizing it, working on specific classes or tuning the code
- for your particular needs.
-
-Q: Will you wait until Mono is finished?
-
-A: Mono will ship on various stages as they mature. Some people
- require only a subset of the technologies, those will ship first.
-
- More advanced features will take more time to develop. A support
- timeline will be available in June 2002.
-
-<a name="gnome"></a>
-** Mono and GNOME
-
-Q: How is Mono related to GNOME?
-
-A: In a number of ways. This project was born out of the need of
- providing improved tools for the GNOME community, and will use
- existing components that have been developed for GNOME when they
- are available. For example, we plan to use Gtk+ and Libart to
- implement Winforms and the Drawing2D API and are considering
- GObject support.
-
-Q: Has the GNOME Foundation or the GNOME team adopted Mono?
-
-A: Mono is too new to be adopted by those groups. We hope that the
- tools that we will provide will be adopted by free software
- programmers including the GNOME Foundation members and the GNOME
- project generally.
-
-Q: Should GNOME programmers switch over to Mono now?
-
-A: It is still far to early for discussions of "switching over." No
- pieces of Mono will be ready within the next six months, and a
- complete implementation is roughly one year away.
-
- We encourage GNOME developers to continue using the existing tools,
- libraries and components. Improvements made to GNOME will have an
- impact on Mono, as they would be the "backend" for various classes.
-
-Q: Will Mono include compatibility with Bonobo components? What is the
- relationship between Mono and Bonobo?
-
-A: Yes, we will provide a set of classes for implementing and using
- Bonobo components from within Mono. Mono should allow you to write
- Bonobo components more easily, just like .NET on Windows allows you
- to export .NET components to COM.
-
-Q: Does Mono depend on GNOME?
-
-A: No, Mono does not depend on GNOME. We use a few packages produced by
- the GNOME team like the `glib' library.
-
-Q: But will I be able to build GNOME applications?
-
-A: Yes, we will enable people to write GNOME applications using Mono.
-
-<a name="gui"></a>
-** GUI applications
-
-Q: Will Mono enable GUI applications to be authored?
-
-A: Yes, you will be able to build GUI applications. Indeed, that is our
- main focus. We will provide both the Windows.Forms API and the Gtk# API.
-
-Q: What is the difference between Gtk# and System.Windows.Forms?
-
-A: Gtk# is a set of bindings for the Gtk+ toolkit for C# (and other
- CIL-enabled languages). System.Windows.Forms is an API defined
- by Microsoft to build GUI applications.
-
-Q: Will I be able to run my smart clients on systems powered by Mono?
-
-A: As long as your applications are 100% .NET and do not make use
- of P/Invoke to call Win32 functions, your smart client applications
- will run on Mono platforms.
-
-Q: Where can I learn mora about Gtk#?
-
-A: The following <a href="http://gtk-sharp.sourceforge.net>link</a> sends you to the page of the project.
-
-Q: What can I do with Gtk#?.
-
-A: Gtk# is becoming very usable and you can create applications and
- applets like those you see in a GNOME desktop environment. It's
- easy to install so it's worth a try.
-
-Q: How can I compile my HelloWorld.cs which uses Gtk#?.
-
-A: Try: mcs --unsafe -o HelloWorld.exe -r glib-sharp -r pango-sharp -r
- atk-sharp -r gdk-sharp -r gtk-sharp -r gdk-imaging-sharp
- HelloWorld.cs
-
-
-<a name="msft"></a>
-** Mono and Microsoft
-
-Q: Is Microsoft helping Ximian with this project?
-
-A: No. Ximian CTO Miguel de Icaza had a friendly conversation with
- Microsoft software architect David Stutz, but that's about the
- extent of the contact. Microsoft is interested in other
- implementations of .NET and are willing to help make the ECMA spec
- more accurate for this purpose.
-
- Ximian representatives have also spoken with Sam Ruby at the ECMA
- TG3 committee to discuss the same issues.
-
-Q: Is Microsoft or Corel paying Ximian to do this?
-
-A: No.
-
-Q: Do you fear that Microsoft will change the spec and render Mono
- useless?
-
-A: No. Microsoft proved with the CLI and the C# language that it was
- possible to create a powerful foundation for many languages to
- interoperate. We will always have that.
-
- Even if changes happened in the platform which were undocumented,
- the existing platform would a value on its own.
-
-Q: Are you writing Mono from the ECMA specs?
-
-A: Yes, we are writing them from the ECMA specs and the published
- materials in print about .NET.
-
-Q: If my applications use Mono, will I have to pay a service fee?
-
-A: No. Mono is not related to Microsoft's initiative of
- software-as-a-service.
-
-Q: Is the Mono Project is related to the Microsoft Hailstorm effort? Is
- Ximian endorsing Hailstorm?
-
-A: No. The Mono Project is focused on providing a compatible set of
- tools for the Microsoft .NET development platform. It does not
- address, require, or otherwise endorse the MS Passport-based
- Hailstorm single sign-on system that is part of Windows XP and
- other services.
-
-Q: Will Mono or .NET applications depend on Microsoft Passport?
-
-A: No. MS Passport is unrelated to running .NET compatible applications
- produced with the Mono tools. The only thing you will need is a
- just-in-time compiler (JIT).
-
-Q: What is a 100% .NET application?
-
-A: A `100% .NET application' is one that only uses the APIs defined
- under the System namespace and does not use PInvoke. These
- applications would in theory run unmodified on Windows, Linux,
- HP-UX, Solaris, MacOS X and others.
-
-Q: If Microsoft will release a port of their .NET platform under the
- `Shared Source' license, why should I bother with anything else?
-
-A: The Shared Source implementation will be expensive and its uses
- will be tightly restricted, especially for commercial use. We are
- working towards an implementation that will grant a number of
- important rights to recipients: use for any purpose,
- redistribution, modification, and redistribution of modifications.
-
- This is what we call <a
- href="http://www.gnu.org/philosophy/free-sw.html">Free Software</a>
-
-Q: Is Mono a free implementation of Passport?
-
-A: No. Mono is just a runtime, a compiler and a set of class
- libraries.
-
-Q: Will the System.Web.Security.PassportIdentity class mean
- that my software will depend on Passport?
-
-A: No. Applications may use that API to contact a Passport site, but
- are not required to do so.
-
- As long as your application does not use Passport, you will not
- need Passport.
-
-Q: Will Mono running on Linux make Passport available for Linux?
-
-A: No. However, the Passport toolkit for Linux-based web servers is
- available from Microsoft.
-
-Q: Will Mono allow me to run Microsoft Office on Linux?
-
-A: No, it will not. Microsoft Office is a Windows application. To
- learn more about running Windows applications on Intel Unix systems
- refer to <a href="http://www.winehq.com">the Wine Project</a>.
-
-<a name="pnpproject"></a>
-** Mono and Portable.NET
-
-Q: What are the differences between Mono and Portable.NET?
-
-A: Most of Mono is being written using C#, with only
- a few parts written in C (The JIT engine, the runtime, the
- interfaces to the garbage collection system).
-
- It is easier to describe what is unique about Mono:
- <ul>
- <li> A self-hosting C# compiler written in C#, which is clean, easy
- to maintain.
-
- <li> A multi-platform runtime engine: both a JIT engine and an
- interpreter exist. The JIT engine runs currently on x86
- systems, while the interpreter works on Sparc, StrongARM and
- PowerPC systems.
-
- <li> Supports Linux, Windows and Solaris at this point.
-
- <li> The JIT engine is written using a portable instruction
- selector which not only generates good code (we are told
- that we are faster than Rotor, but it is hard to tell) but
- is also the foundation to retarget the JIT engine to other
- systems.
-
- The system employed is described in various compiler
- books and it is very similar to what is described in the
- book that covers LCC, the Ansi C retargetable C compiler.
-
- <li> The JIT engine supports inlining, constant folding and propagation,
-
- <li> Full support for remoting in the runtime, but the class
- libraries are still behind.
-
- <li> The C# compiler, the JIT engine and the class libraries are
- mature enough that the whole system is self-hosting, ie, that
- it can be fully developed with itself at this point.
-
- <li> We are not yet done, and there is a lot of work left to be
- done
-
- <li> We have a great community of developers, without which Mono
- would not be possible.
-
- <li> We will provide an ahead of time compilation mode in the
- future.
- </ul>
-
-<a name="webservices"></a>
-** Web Services
-
-Q: How is Mono related to Web Services?
-
-A: Mono is only related to Web Services in that it will implement the
- same set of classes that have been authored in the .NET Framework
- to simplify and streamline the process of building Web Services.
-
- But most importantly, Mono is an Open Source implementation of the
- .NET Framework.
-
-Q: Can I author Web Services with Mono?
-
-A: You will be able to write Web Services on .NET that run on Mono and
- viceversa.
-
-Q: If Mono implements the SDK classes, will I be able to write and
- execute .NET Web Services with it?
-
-A: Yes. When the project is finished, you will be able to use the
- same technologies that are available through the .NET Framework SDK
- on Windows to write Web Services.
-
-Q: What about Soup? Can I use Soup without Mono?
-
-A: Soup is a library for GNOME applications to create SOAP servers and
- SOAP clients, and can be used without Mono. You can browse the
- source code for soup using <a
- href="http://cvs.gnome.org/bonsai">GNOME's Bonsai</a>.
-
-Q: Can I use CORBA?
-
-A: Yes. The CLI contains enough information about a class that
- exposing it to other RPC systems (like CORBA) is really simple, and
- does not even require support from an object.
-
- We will be implementing CORBA interoperation as an extension to the
- Mono classes so that we can integrate with Bonobo, just like
- Microsoft provides COM interoperation classes and support
- mechanisms.
-
-Q: Can I serialize my objects to other things other than XML?
-
-A: Yes, although the serializing tools have not yet been planned, and
-you would probably have to implement them yourself.
-
-Q: Will Mono use ORBit?
-
-A: No. Mono will be using a new implementation of CORBA that isn't still started.
-
-<a name="devel"></a>
-** Development Tools and Issues
-
-Q: Will it be possible to use the CLI features without using bytecodes
- or the JIT?
-
-A: Yes. The CLI engine will be made available as a shared library.
- The garbage collection engine, the threading abstraction, the
- object system, the dynamic type code system and the JIT will be
- available for C developers to integreate with their applications if
- they wish to do so.
-
-Q: Will you have new development tools?
-
-A: With any luck, Free Software enthusiasts will contribute tools to
- improve the developer environment. These tools could be developed
- initially using the Microsoft implementation of the CLI and then
- executed later with Mono.
-
-Q: What kind of rules make the Common Intermediate Language useful for
- JITers?
-
-A: The main rule is that the stack in the CLI is not a general purpose
- stack. You are not allowed to use it for other purposes than
- computing values and passing arguments to functions or return
- values.
-
- At any given call or return instruction, the types on the stack
- have to be the same independently of the flow of execution of your
- code.
-
-Q: Is it true that the CIL is ideal for JITing and not efficient for
- interpreters?
-
-A: The CIL is better suited to be JITed than JVM byte codes, but you
- can interpret them as trivially as you can interpret JVM byte
- codes.
-
-Q: Isn't it a little bit confusing to have the name of "XSP" (the same
- as in the Apache Project) for the ASP.NET support in Mono?.
-
-A: In Mono, xsp is just the name of the C# code generator for ASP.NET
- pages. In the Apache Project, it is a term for the "eXtensible Server
- Pages" technology so as they are very different things, they don't
- conflict.
-
-Q: What about using something like Jabber instead of the System.Messaging
- namespace?.
-
-A: In short, MSMQ is not something like Jabber, but asynchronous messaging
- through queues. Usefull queues do more than serialize messages, they are
- also platform bridges.
-
-Q: Are you supporting XMLDocument and relatives?.
-
-A: Currently, we aren't implementing them yet. It would require updates to
- most of the XmlNode derivatives so it's not a trivial task. We are
- currently focusing on getting XPath support working.
-
-Q: Is there any plan to develop an aspx server for Mono?.
-
-A: The webserver turned out to be very simple compared to the rest of the
- work. Gonzalo has got the page generator mostly done (a module called
- xsp, who has nothing to do with the XSP term used in the Apache Project).
- Patrik has done a lot of the work to get the ProcessRequest to work.
- You can try to help in the final touches to the System.Web classes and
- writing regression tests for the widgets we have.
-
-<a name="asp">
-** Mono and ASP.NET
-
-Q: Is Mono supporting ASP.NET?
-
-A: Yes. The development of the support for ASP.NET comes in various stages,
- here is what Gonzalo has been working on: 1. The Parser. 2. Getting the
- parser to generate output compatible with ASP.NET. 3. Running the sample
- output with the real Microsoft runtime but using our generated page. 4.
- Running the sample with our classes with the .NET runtime. 5. Running
- our sample code with our classes with our runtime. This is the process
- we are following. Currently Gonzalo has reached point 3.
-
-Q: I have heard that their is a webserver developed with Mono. Is it true?.
-
-A: Yes. You can find it <a href="http://home.adelphia.net/~aljames/webserver.htm">here</a>
- Read the README for more info.
-
-<a name="java">
-** Mono and Java
-
-Q: Why don't you use Java? After all, there are many languages that
- target the Java VM.
-
-A: You can get very good tools for doing Java development on free
- systems right now. <a href="http://www.redhat.com">Red Hat</a> has
- contributed a <a href="http://gcc.gnu.org">GCC</a> <a
- href="http://gcc.gnu.org/java">frontend for Java</a> that can take
- Java sources or Java byte codes and generate native executables; <a
- href="http://www.transvirtual.com">Transvirtual</a> has implemented
- <a href="http://www.kaffe.org">Kaffe</a> a JIT engine for Java;
- Intel also has a Java VM called <a
- href="http://www.intel.com/research/mrl/orp">ORP</a>.
-
- The JVM is not designed to be a general purpose virtual machine.
- The Common Intermediate Language (CIL), on the other hand, is
- designed to be a target for a
- wide variety of programming languages, and has a set of rules
- designed to be optimal for JITers.
-
-Q: Could Java target the CLI?
-
-A: Yes, Java could target the CLI. We have details on a <a
- href="ideas.html#guavac">project</a> that someone could take on to
- make this happen.
-
- Microsoft has an implemenation of the Java language called J# that
- can target the CIL execution engine.
-
-Q: Is it possible to write a JVM byte code to CIL convertor?
-
-A: Yes, it is possible. Here are a few starting point:
-
- <ul>
- * A byte code representation is really a flattened forest of
- trees. Look at the Mono JIT engine to see how we compute
- the basic blocks (this is used to figure out the "trees").
-
- The forest is just an array of trees.
-
- Indeed, run the JIT engine with -d (mono -d prog.exe) and
- you will see how these trees look like.
-
- You will have to do something similar for Java.
-
- * Each "forest of trees" has a meaning. This meaning can now
- be translated into the equivalent "meaning" in CLR-land.
- </ul>
-
-Q: Could mono become a hybrid cil/java platform?
-
-A: No. It is quite far from the philosophy of the project. The idea of Mono
- is, to have only _one_ VM, on which all can run. And if there existing a
- binary-converter from Java-.class to IL and if there existing something
- like J-Sharp on Mono, you can write programs in Java, which than can run
- on Mono. You do not need two bindings (like your example: GTK-Sharp _and_
- Java-Gnome). You need only _one_ of it (GTK-Sharp). Thats the idea of Mono.
- An other point is, that there are no people, who use OpenSource-JVMs. They
- all prefer Suns original. But for Unix there don't exist a .NET-Framework.
- So it is possible, that in the future Mono is the standard .NET for unixes.
-
-<a name="extending"></a>
-** Extending Mono
-
-Q: Would you allow other classes other than those in the
- specification?
-
-A: Yes. The Microsoft class collection is very big, but it is by no
- means complete. It would be nice to have a port of `Camel' (the
- Mail API used by Evolution inspired by Java Mail) for Mono
- applications.
-
- You might also want to look into implementing CORBA for Mono. Not
- only because it would be useful, but because it sounds like a fun
- thing to do, given the fact that the CLI is such a type rich
- system.
-
- For more information on extending Mono, see our <a
- href="ideas.html">ideas</a> page.
-
-Q: Do you plan to Embrace and Extend .NET?
-
-A: Embracing a good technology is good. Extending technologies in
- incompatible ways is bad for the users, so we do not plan on
- extending the technologies.
-
- If you have innovative ideas, and want to create new classes, we
- encourage you to make those classes operate correctly well in both
- Mono and .NET
-
-<a name="portability"></a>
-** Portability
-
-Q: Will Mono only work on Linux?
-
-A: Currently, we are doing our work on Linux-based systems and
- Windows. We do not expect many Linux-isms in the code, so it
- should be easy to port Mono to other UNIX variants.
-
-Q: What about Mono on non Linux-based systems?
-
-A: Our main intention at Ximian is to be able to develop GNOME
- applications with Mono, but if you are interested in providing a
- port of the Winform classes to other platforms (frame buffer or
- MacOS X for example), we would gladly integrate them, as long
- they are under an open source license.
-
-Q: What operating systems/CPUs do you support
-
-A: Mono currently runs on Linux, Windows, Solaris and FreeBSD.
- There is a JIT engine available for x86 processors that can
- generate code and optimizations tailored for a particular CPU.
-
- Interpreters exist for the SPARC, PowerPC and StrongARM cpus.
-
-Q: Does Mono run on Windows?
-
-A: Yes. The Compiler and the runtime both run on Windows.
-
-Q: When will mono and mcs compile on Linux?.
-
-A: That happend a long time ago. Know you can download and compile
- them or even install them from already made binary packages for
- Windows and for Linux (RPM/DEB).
-
-Q: Will I require Cygwin to run mono?
-
-A: No. While you'll need it to compile it, it runs without cygwin and does not even require cygwin1.dll
-
-Q: Will Mono depend on GNOME?
-
-A: It will depend only if you are using a particular assembly (for
- example, for doing GUI applications). If you are just interested
- in Mono for implementing a `Hello World Enterprise P2P Web
- Service', you will not need any GNOME components.
-
-<a name="reuse"></a>
-** Reusing Existing Code
-
-Q: What projects will you reuse or build upon?
-
-A: We want to get Mono in the hands of programmers soon. We are
- interested in reusing existing open source software.
-
-Q: What about Intel's research JIT framework, ORP?
-
-A: At this time, we are investigating whether we can use elements of
- ORP for Mono. ORP is a research JIT engine that has a clearly
- defined API that splits the JIT from the GC system and the actual
- byte code implementation.
-
- We are using some pieces of ORP (Their code generation interface)
- and we use it as a source of inspiration for optimizations. Paolo
- and Dietmar consider ORP as being one of the best JIT engines out
- there (and their research work and papers are very useful if you are
- interested in JIT technology).
-
-Q: What about using GNU Lightning?
-
-A: We are not using GNU Lightning. Our JIT is using an instruction
- selector based on tree-pattern matching, and a code generation
- interface that is very tied to the current architecture.
-
-<a name="gcc"></a>
-** Mono and GCC
-
-Q: Are you working on a GCC front-end to C#? A GCC backend that will
- generate CIL images? What about making a front-end to GCC that
- takes CIL images and generates native code?
-
-A: We are currently seeking volunteers for those projects.
- Visit the <a href="contributing.html">contributing</a> section if
- you are interested.
-
-Q: But would this work around the GPL in the GCC compiler and allow
- people to work on non-free front-ends?
-
-A: People can already do this by targeting the JVM byte codes (there
- are about 130 compilers for various languages that target the JVM).
-
-Q: Why are you writing a JIT engine instead of a front-end to GCC?
-
-A: We want the JIT engine and runtime engine because they will be able
- to execute CIL executables generated on Windows, and so no recompilation
- will be necessary.
-
-<a name="performance"></a>
-** Performance
-
-Q: How fast will Mono be?
-
-A: We can not predict the future, but a conservative estimate is that
- it would be at least `as fast as other JIT engines'.
-
- We would like to ship various JIT engines with Mono, just like
- Microsoft has done with their .NET development platform. We could
- provide a faster, JIT for fast load times but lower performance,
- and an and an optimizing JIT that would be slower at generating
- code but produce more optimal output.
-
- The CIL has some advantages over the Java byte code: it is really
- an intermediate representation and there are a number of
- restrictions on how you can emit CIL code that simplify creating
- better JIT engines.
-
- For example, on the CIL, the stack is not really an abstraction
- available for the code generator to use at will. Rather, it is a
- way of creating a postfix representation of the parsed tree. At
- any given call point or return point, the contents of the stack are
- expected to contain the same object types independently of how the
- instruction was reached.
-
-<a name="licensing"></a>
-** Licensing
-
-Q: Will I be able to write proprietary applications that run with
- Mono?
-
-A: Yes. The licensing scheme is planned to allow proprietary
- developers to write applications with Mono.
-
-Q: What license or licenses are you using for the Mono Project?
-
-A: The C# Compiler is released under the terms of the <a
- href="http://www.opensource.org/licenses/gpl-license.html">GNU GPL</a>. The runtime
- libraries are under the <a
- href="http://www.opensource.org/licenses/lgpl-license.html">GNU
- Library GPL</a>. And the class libraries are released
- under the terms of the <a
- href="http://www.opensource.org/licenses/mit-license.html">MIT X11</a>
- license.
-
-Q: I would like to contribute code to Mono under a particular
- license. What licenses will you accept?
-
-A: We will have to evaluate the licenses for compatibility first,
- but as a general rule, we will accept the code under the same
- terms of the "container" module.
-
-<a name="patents></a>
-** Patents
-
-Q: Could patents be used to completely disable Mono (either submarine
- patents filed now, or changes made by Microsoft specifically to
- create patent problems)?
-
-A: No. First, its basic functional capabilities have pre-existed too
- long to be held up by patents. The basic components of Mono are
- technologically equivalent to Sun's Java technology, which has been
- around for years. Mono will also implement multi-language and
- multi-architecture support, but there are previous technologies
- such as UCSD p-code and ANDF that also support multiple languages
- using a common intermediate language. The libraries are similar
- to other language's libraries, so again, they're too similar to
- be patentable in large measure.
-
- However, if Microsoft does patent some technology, then our plan is
- to either (1) work around it, (2) chop out patented pieces, (3)
- find prior art that would render the patent useless.
-
- Not providing a patented capability would weaken the
- interoperability, but it would still provide the free software /
- open source software community with good development tools, which
- is the primary reason for developing Mono.
-
-<a name="etc"></a>
-** Miscellaneous Questions
-
-Q: You say that the CLI allows multiple languages to execute on the
- same environment. Isn't this the purpose of CORBA?
-
-A: The key difference between CORBA (and COM) and the CLI is that the
- CLI allows "data-level interoperability" because every
- language/component uses the same data layout and memory management.
-
- This means you can operate directly upon the datatypes that someone
- else provides, without having to go via their interfaces. It also
- means you don't have to "marshall" (convert) parameters (data
- layouts are the same, so you can just pass components directly) and
- you don't have to worry about memory managment, because all
- languages/components share the same garbage collector and address
- space. This means much less copying and no need for reference
- counting.
-
-Q: Will you support COM?
-
-A: The runtime will support XPCOM on Unix systems and COM on Windows.
- Most of the code for dynamic trampolines exists already.
-
-Q: Will Ximian offer certifications on Mono or related technologies?.
-
-A: It's possible. But there is no plan about this. So the short answer is no.
-
-Q: Are there any Boehm's gc binaries?
-
-A: Yes. You can find them <a href="http://java.thn.htu.se/~toor/">here</a>
-
diff --git a/doc/gcc-frontend b/doc/gcc-frontend
deleted file mode 100644
index 2b15346db69..00000000000
--- a/doc/gcc-frontend
+++ /dev/null
@@ -1,9 +0,0 @@
-* The GCC front-end
-
- The GCC front-end will accept input in a binary file with
- codes in the Common Intermediate Language (CIL), and generate
- native code.
-
- This will allow pre-compilation and full optimization to take
- place before a program is executed.
-
diff --git a/doc/ideas b/doc/ideas
deleted file mode 100644
index 0a97cdcc4d2..00000000000
--- a/doc/ideas
+++ /dev/null
@@ -1,112 +0,0 @@
-* Ideas
-
- There are many pending classes that need to be implemented. Those have
- the highest impact in the Mono project: the sooner they are done,
- the sooner we can start using this platform to create new and
- exciting applications.
-
- That being said, if you are not very excited about working on class
- libraries, here is a list of other related projects or tools that might
- be useful to the Mono project.
-
- Here are a few ideas of tools, classes and projects that you
- could start. More are forthcoming.
-
-<a name="runtime">
-** Runtime
-
- We need a verifier that can be run on an executable (assembly)
- and tells whether the metadata for the executable is correct
- or not. It should report any anomalies.
-
- For a list of anomalies in assemblies, check the various assertions
- that are described on the ECMA documentation.
-
- This will help test our generated executables and can be also
- used as an external verifier.
-
-<a name="classes">
-** Classes
-
- <ul>
-TODO=jxta,The JXTA Peer to Peer foundation
- * Implement a JXTA protocol implementation:
- <a href="http://www.jxta.org">http://www.jxta.org</a>
-
-TODO=camel,Mail API
- * Implement a Mail API, similar to Camel or JavaMail (Camel has
- significant architecture features that are required on a real
- mailer).
-
- You can check the current C
- <a href="http://cvs.gnome.org/bonsai/rview.cgi?dir=evolution%2Fcamel">
- Camel implementation</a>.
-
- Such an implementation could be used both with
- Microsoft .NET and Mono.
-
-TODO=multimedia
- * Interfacing to Multimedia systems. You might want
- to look into the Quicktime API. I know <a
- href="mailto:vladimir@ximian.com">Vladimir</a> has
- researched the problem before
-
- </ul>
-
-<a name="projects">
-** Projects
-
- <ul>
-TODO=xmlStorage,
- * Implement an xmlStorageSystem for the CLI:
- <a href="http://www.soapware.org/xmlStorageSystem">
- http://www.soapware.org/xmlStorageSystem</a>
-
-TODO=guavac,Java compiler for .NET
- * You could take one of the existing Java compilers
- (Guavac comes to mind as it is so nice) and modify
- it to generate .NET code rather than JVM byte
- codes.
-
- This should be a pretty straightforward task.
- Guavac has the advantage of being written in C++ and
- it could be compiled with the Microsoft Managed C++
- compiler and produce a .NET executable with it.
-
-TODO=CORBA,CORBA implementation
- * Build a CORBA interoperability engine for the CLR.
- You do not need to do all of the work, just talking
- the protocol will get us a long way (<a
- href="http://www.omg.org">The OMG site</a> has the
- CORBA specs).
-
- Get in touch with David Taylor (dtaylo11 at bigpond
- dot net dot au) as he has been working on this
- project.
-
-TODO=Bonobo,Bonobo for Mono
- * Once CORBA is done, implement the Bonobo interfaces
- to allow people to use Bonobo components in Mono and
- Mono components with Bonobo. The best of both worlds!
-
-TODO=moniker,Object Naming System with Monikers
- * A naming space for Mono. An object naming space is
- a very powerful tool. Bonobo implements a moniker
- system that is more powerful than the original
- moniker concept that was pioneered by COM/OLE in the
- Microsoft world.
-
- Our implementation builds on a concept, and we have
- made it simpler, more powerful, more extensible and
- a much better mechanism than the equivalent monikers
- on Windows.
-
- Implementing Mono monikers would benefit both
- Windows users using .NET and Mono users on Unix and
- Windows.
-
- Here is <a
- href="http://primates.ximian.com/~miguel/monikers.html">an
- overview of the moniker system</a> in Bonobo.
-
- </ul>
diff --git a/doc/index b/doc/index
deleted file mode 100644
index b67e5f3dec3..00000000000
--- a/doc/index
+++ /dev/null
@@ -1,1224 +0,0 @@
-<link rel="alternate" type="application/rss+xml" title="RSS" href="index.rss"/>
-
-<table>
- <tr>
- <td>
- <a href="http://www.ximian.com">Ximian</a> announced the
- launch of the Mono project, an effort to create an open source
- implementation of the .NET Development Framework.
-
- Mono includes: <a href="c-sharp.html">a compiler</a> for the
- C# language, a <a href="runtime.html">runtime</a> for the
- Common Language Infrastructure (the CLR) and a set of <a
- href="class-library.html">class libraries</a>.
-
- You can read our <a href="rationale.html">rationale</a> for
- this project. If you have questions about the project, please
- read our list of <a href="faq.html">Frequently Asked
- Questions</a> or <a href="mailto:mono-list@ximian.com">contact us.</a>
-
- You might also want to <a href="download.html">Download the
- source</a> for our work so far. Grab a <a
- href="snapshots">snapshot</a> of our current work, or <a
- href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=Mono">browse
- the sources</a>
-
- You might want to <a
- href="mailing-lists.html">subscribe</a> to our mono-list
- and mono-announce-list
-
- You can contact the team at: <a
- href="mailto:mono-list@ximian.com">mono-list@ximian.com</a>
- </td>
- <td>
- <table border=1>
- <tr>
- <td>
- <b><a href="c-sharp.html">C# Compiler</a></b>
- </td>
- <td>
- <b>Self hosting on Linux</b><br>
- Self hosting on .NET.
- </td>
- </tr>
- <tr>
- <td>
- <b>JIT</b>
- </td>
- <td>
- Linux/x86 working.
- </td>
- </tr>
- <tr>
- <td>
- <b>Interpreter</b>
- </td>
- <td>
- Working:<br>
- Linux/x86, Linux/PPC<br>
- In progress: StrongARM, SPARC.
- </td>
- </tr>
- <tr>
- <td>
- <b><a href="class-status.html">Classes</a></b>
- </td>
- <td>
- Corlib is self hosting.
- </td>
- </tr>
- <tr>
- <td>
- RSS feed:
- </td>
- <td>
- <a href="index.rss"><img src="images/xml.gif"></a>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-
-@item Jun 24, 2002
-
- Duncan has written a few sample <a
- href="http://primates.ximian.com/~duncan/Mono">gtk# demo apps</a>..
-
-@item Jun 20, 2002
-
- Gonzalo has got the Mono ASP.NET implementation can now render all Html
- Controls, and 21 out of the 26 Web Controls. Session tracking is
- next. Look in xsp/test for a collection of tests that render with Mono.
-
- Ajay has been very busy improving and extending the
- XmlSerialization code. All fields had to be re-ordered to
- match the Microsoft implementation.
-
-@item Jun 19, 2002
-
- You can now download a fresh tarball of the libraries and the MCS
- compiler daily from <a href="http://www.atoker.com/mono/">Alp Toker's
- website</a>.
-
- New libgc RPMS for Redhat 7.3 are available on <a href="
- http://java.thn.htu.se/~toor/">Richard Torkar's site</a>.
-
-@item Jun 10, 2002
-
- Ajay <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-June/000128.html">announced</a>
- today that the reading code for XmlSchemas is almost complete.
-
-@item Jun 7, 2002
-
- <b>Mono 0.12 is out!</b> More classes! More working code!
- Better compiler! Faster runtime! Less bugs!
-
- You can get it <a
- href="download.html#jun-7">Here</a> (quick links: <a
- href="archive/mono-0.12.tar.gz">runtime</a> and <a
- href="archive/mcs-0.12.tar.gz">compiler/classes</a>).
-
-@item Jun 3rd, 2002
-
- CodeDOM implementation from Daniel Stodden has got C# output support.
-
-@item May 31, 2002
-
- Gonzalo got the Mono XSP page parser to render its first ASP.NET
- .aspx file today without using MS System.Web.Hosting classes.
- It is currently on its infancy. But very good news, now we need to
- upgrade our System.Web runtime to run natively on Linux.
-
- Sergey's code for architecture and size-specific CPBLK has
- been checked into CVS.
-
- Paolo has checked the configuration code for Mono (to map
- PInvoke dlls to other libraries).
-
- <a href="ado-net.html">ADO support</a>: Daniel has checked in
- a modified version of the MySQL data provider from Brad. And Rodrigo
- started the OleDB using LibGDA.
-
-@item May 27, 2002
-
- An <a href="index.rss">RSS feed</a> is now available for the
- Mono news. I find it surprising that there are so many tools
- that process this data.
-
- Binaries for <a href="http://www.superin.formativ.net/mono/mono.htm">Windows</a> are
- now location independent, do not require Cygwin and come with a Wizard.
-
-@item May 26, 2002
-
- Daniel Morgan checked in his Sql# Cli tool into the
- System.Data class library.
-
-@item May 24, 2002
-
- Ajay <a
- href="http://lists.ximian.com/archives/public/mono-patches/2002-May/003953.html">has
- checked in</a> a major update to the System.Xml.Schema namespace.
-
- Gonzalo moved XSP along this week: Added support for
- templates, columns inside DataGrid, HTML comments, code render
- and data binding tags, style properties in style tags,
- ListItem inside list controls, float and double properties.
-
-@item May 22, 2002
-
- <a href="http://monologo.sourceforge.net/">MonoLogo</a> runs
- on the Mono runtime. This <a
- href="http://monologo.sourceforge.net/gtk.png">screenshot</a> shows
- MonoLogo running Gtk#.
-
-@item May 21, 2002
-
- Martin has improved the debugging infrastructure in Mono, now
- it is possible to get <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-May/005717.html">line
- number</a> information on stack traces.
-
-@item May 20, 2002
-
- XSP <a href="asp-net">our ASP.NET</a> .aspx page parser is now
- available on the AnonCVS servers. This is part of the ASP.NET
- support in Mono. Gonzalo is the developer on charge of it.
-
- Many updates to the <a href="ado-net.html">ADO.NET
- implementation</a> from Dan, Tim and Rodrigo.
-
- Radek got the Mono C# compiler running on Linux/PPC and
- compiling most of our regression test suite.
-
- Lawrence has been working really hard in fixing, improving and
- polishing the underlying network infrastructure.
-
- The Rafael and Chris have commited the beginning of the
- VisualBasic.NET runtime support to CVS.
-
- Jesus has contributed the beginning of the SoapFormatter
-
-@item May 9, 2002
-
- Linear register allocator has been deployed in the Mono JIT
- engine. Read <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-May/005489.html">about
- it</a>
-
-@item May 5, 2002
-
- We are able to retrieve simple data from the database
- using our ADO.NET like functionality. Only string and integer data
- types are supported right now but more are in the works.
-
- You can find more information
- at <a href="http://www.go-mono.com/ado-net.html">The Mono ADO-NET Page</a>
-
- Thanks goes to Chris, Daniel, Duncan, Gonzalo, Miguel, Rodrigo, Tim,
- and others for these bits.
-
-@item May 4th, 2002
-
- Rodrigo Moya announced <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-May/005366.html">new
- LibGDA</a>: LibGDA is an ADO-like library for Unix systems.
- This one removes all the CORBA and GConf dependencies, which
- should make it easier to use and compile.
-
- This is another milestone for our <a
- href="ado-net.html">ADO.NET implementation plans</a>
-
- We have a little surprise for everyone tracking the news on tuesday ;-)
-
-@item May 2nd, 2002
-
- Mark Crichton csvorbis port (C# port of Vorbis player) and
- Richard Hestilow's <a href="http://monologo.sf.net">MonoLogo compiler</a> are now
- on the CVS, and you can get them from AnonCVS.
-
- Dick implemented inter-process sharing of handles as well as
- simplifying the implementation of WaitForMultipleObjects, now
- we have a `handles' subsystem in Mono. This is needed to fully
- emulate the handle behavior that Win32 exposes, and that the .NET API
- expose to applications.
-
- News from the <a
- href="http://gtk-sharp.sourceforge.net">Gtk#</a> front: <a
- href="http://gtk-sharp.sourceforge.net/menu.png">Menu
- support</a>, Mike <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-May/000064.html">tells
- the story</a>
-
-@item May 1st, 2002
-
- Daily packages for <a href="http://www.debian.org">Debian</a> are available
- <a href="http://www.atoker.com/mono/">here</a>
-
-@item Apr 26, 2002
-
- Binary packages of Mono 0.11 are available for <a
- href="http://www.superin.formativ.net/mono/mono.htm">Windows</a>
- (Thanks to Johannes Roith) and for
- <a
- href="http://mono.baselabs.org/index.php/software/">Linux</a> (thanks
- to BaseLabs).
-
-@item Apr 24, 2002
-
- <b>Mono 0.11 is out!</b> Mostly performance improvements, bug
- fixes and more classes are included.
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure. Binaries are
- included. The <a href="archive/mono-0.11">Release Notes</a>
- are available.
-
- You can get it <a
- href="download.html#apr-24">Here</a> (quick links: <a
- href="archive/mono-0.11.tar.gz">runtime</a> and <a
- href="archive/mcs-0.11.tar.gz">compiler/classes</a>).
-
-@item Apr 23, 2002
-
- SharpDevelop 0.88a <a href="http://www.icsharpcode.net/OpenSource/SD">is out!</a>
-
- Congratulations to the developers behind SharpDevelop for
- their new release.
-
-@item Apr 20, 2002
-
- Some updates from the hacking lines:
-
- <b>The web:</b> Patrik Torstensson last week contributed the
- http runtime support and started work on thread pools. This
- is part of the ASP.NET support.
-
- <b>Docs:</b> John Barnette, John Sohn and Adam Treat have been
- hacking on MonoDoc.
-
- <b>ADO.NET:</b> Daniel Morgan and Rodrigo Moya have been
- working on the <a href="ado-net">ADO.NET</a> support, and got
- the first signs of life this week (we can connect, insert
- rows; do transactions: commit/rollback; SQL errors and
- exceptions work). Check <a
- href="mailing-lists.html">mono-patches</a> for all the
- goodies.
-
- <b>Optimizations:</b> A number of optimizations in the runtime
- made the compiler twice as fast this week:
-
- Early this week Patrik started the string
- rewrite in the runtime. Today Dietmar finished the
- constructors and deployed the new layout.
-
- Paolo got the JIT engine to generate profiles, which were in
- turn used to find hot spots in Reflection, which he improved.
-
- Daniel Lewis (of Regex fame) noticed the performance issues
- with our current array layout, and contributed a new array
- representation.
-
- At the same time Dietmar started the the JIT inline code and
- implemented constant propagation. These two optimizations
- together are very powerful.
-
- <b>Bug fixing:</b> And of course everyone has been helping out
- with the bug fixing (Duncan, Gonzalo, Jonathan, Miguel, Nick,
- Ravi, Sergey)
-
-
-@item Apr 18, 2002
-
- Dietmar's inlining for the JIT engine just landed into
- CVS. This is only a first cut and more improvements will come later.
-
- Patrik, Paolo, Dietmar and Gonzalo have been busy optimizing
- our class libraries and runtime engine to become faster. Many changes
- on CVS as well.
-
-@item Apr 11, 2002
-
- Gtk# 0.1 "ButtonHook" has been <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-April/000048.html">released</a>
-
- Binaries for the Mono Regression Test Suite are <a
- href="archive/mono-tests.tar.gz">available</a> for
- people porting the Mono Runtime to new platforms.
-
-@item Apr 6, 2002
-
- <a href="http://www.dotnetremoting.cc/book/AdvancedDotNetRemoting.asp">
- Advanced .NET Remoting</a> from Ingo Rammer is now available. Ingo
- helped us to implement the proxy support and the book is a valuable
- resource for anyone interested in remoting.
-
-@item Apr 5, 2002
-
- Transparent proxy support has been finished, congrats to
- Dietmar. Our JIT engine on CVS contains the implementation.
- This should enable people to test the remoting framework on
- Mono.
-
-@item Mar 28, 2002
-
- Debugging information is now generated by the compiler thanks
- to Martin's work. The resulting dwarf file can be used to
- single step C# code in GDB. A document will be shortly published with
- the details.
-
-@item Mar 27, 2002
-
- <b>Mono 0.10 is out!</b> The self hosting release of Mono has
- been released.
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure. Binaries are
- included. The <a href="archive/mono-0.10">Release Notes</a>
- are available.
-
- You can get it <a
- href="download.html#mar-27">Here</a> (quick links: <a
- href="archive/mono-0.10.tar.gz">runtime</a> and <a
- href="archive/mcs-0.10.tar.gz">compiler/classes</a>).
-
-@item Mar 26, 2002
-
- Paolo finally fixed the last bug in the JITer that stopped
- us from using it to run the Mono C# compiler. Goodies are on
- CVS.
-
- <a href="http://gtk-sharp.sourceforge.net">Gtk#</a> runs <a
- href="http://gtk-sharp.sourceforge.net/gtk-hello-world.png">Hello
- World</a>. Mike posted some <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-March/000034.html">details.</a>
-
-
-@item Mar 19, 2002
-
- Martin has been working on our debugging infrastructure, both
- on the JIT side of things (adding dward support) as well as on
- the class libraries (so that MCS can start generating
- debugging information).
-
- Jason and Kral keep working on the System.Xml namespace,
- allowing Mike to move more to self-hosting his Gtk# code.
-
- The System.Web classes are now part of the build (and they are
- also part of the class status now). Ajay contributed a large
- chunk of code to the System.Xml.Schema namespace
-
- Dan (of regex fame) has been working on internal calls
- support: moving more code from the old monowrapper to become
- internal calls.
-
- Paolo and Dietmar are working steadily on our runtime
- environment, fixing bugs, adding missing features and allowing
- us to run the compiler on Linux.
-
- Remember to post your bug reports.
-
- The nice class status on the right is brought to you by
- endless hacking hours from Piers and Nick. These status
- report pages have been helping us track down various mistakes
- in our classes (very useful, check it out for yourself)
-
-@item Mar 12, 2002
-
- At midnight, in Italy, Paolo got the Mono C# compiler to self
- host on Linux, the last bug has been squashed to self
- hostingness. We have now a fully self hosting compiler in Linux.
-
- A release will follow up shortly.
-
-@item Mar 9, 2002
-
- Updated the <a href="class-status.html">class status</a>, now
- it is possible to use the right-side menu to browse a specific
- assembly.
-
-@item Mar 7, 2002
-
- MCS compiles on Linux!
-
- Today Paolo got the <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-March/003726.html">MCS
- compiler compiling itself on Linux</a>
- completely for the first time! The resulting image still contains
- some errors, but the whole compiler process goes now. Later in the day
- and a couple of small optimizations and bug fixes, the compile
- speed was improved in 400%
-
- We are very close to have a complete self hosting environment now.
-
- Mono is temporarly using the Bohem GC garbage collector while
- we deploy the more advanced ORP one.
-
-@item Mar 5, 2002
-
- The CVS repository <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=Mono">can be browsed</a>
-
- Jason has got an incredible amount of work on the Xml
- classes during the weekend, and Gaurav is very close to have
- the complete System.Web.UI.WebControls namespace implemented.
-
- Martin and Duco have been killing bugs by using the recently
- revamped regression test suite.
-
- Piers has updated our <a href="class-status.html">class
- status</a> page again, with even more information available.
-
- The C# compiler has full constant folding implemented now and Ravi
- killed bugs of bugs in the <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FMCS&product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=%27Importance%27&form_name=query">Mono Bug List</a>
-
-@item Mar 1, 2002
-
- RPMs of Mono 0.9 are available at <a href="http://mono.baselabs.org/#download">mono.baselabs.com</a>
-
-@item Feb 28, 2002
-
- <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/003464.html">Christophe</a>
- has setup his <a href="http://mono.baselabs.org">First Steps in Mono</a> web site, which
- shows you a step-by-step process on getting Mono running on your system.
-
- RPMs of Mono 0.9 are available at <a href="http://mono.baselabs.org/index.php/software/">mono.baselabs.org</a>
-
-@item Feb 27, 2002
-
- New <a href="class-status.html">class status</a> engine that
- provides detailed information about missing functionality in
- our class libraries. Nick built the cormissing tool and Piers
- did the XSLT and DHTML magic.
-
- More compiler progress on Linux: our support runtime now
- enables the compiler to compile `MIS' on Linux (MIS being
- Dick's Mono sample HTTP server ;-)
-
-@item Feb 26, 2002
-
- Paolo posted a list of <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/003266.html">ways
- you can help</a> if you do not have Windows right now. Sergey followed up with
- <a href="http://lists.ximian.com/archives/public/mono-list/2002-February/003268.html">his</a>
- suggestions.
-
-@item Feb 25, 2002
-
- StrongARM port from Sergey Chaban has been checked into CVS.
-
-@item Feb 24, 2002
-
- SPARC: 44 out of 74 tests pass now (Jeff)
-
- Power PC: delegates are working now (Radek)
-
-@item Feb 22, 2002
-
- <b>Mono 0.9 has been released!</b>
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure. The <a
- href="archive/mono-0.9">Release Notes</a>
-
- You can get it <a
- href="download.html#feb-22">Here</a> (quick links: <a
- href="archive/mono-0.9.tar.gz">runtime</a> and <a
- href="archive/mcs-0.9.tar.gz">compiler/classes</a>).
-
-@item Feb 21, 2002
-
- Paolo got our compiler natively to compile 117 of our tests.
- Self hosting is closer every day.
-
- Unsafe support is finished in the C# compiler.
-
-@item Feb 20, 2002
-
- Gaurav got DataGrid and DataGridItemCollection done.
-
- C# compiler: Unsafe support is mostly complete (only stackalloc is missing).
-
- New easy to run scripts for compiling Mono on Unix and Windows
- is <a href="download.html">available</a>. We can now easily compile
- Mono on Windows and Linux. If you had trouble before, use the
- above scripts which will get the setup right for you.
-
- There are now three machines that can provide AnonCVS, just
- use anoncvs.go-mono.com as the hostname for your CVSROOT and
- you will get one of the machines.
-
-@item Feb 19, 2002
-
- Do you want to see what <a href="http://people.debian.org/~lupus/mono/">Mono Looks Like?</a>
-
-@item Feb 18, 2002
-
- Application Domains now support the two LoaderOptimization
- modes: share code or do not share code, and you can control
- this with the --share-code command line option.
-
- Paolo has now 100+ test cases run on Linux now with our class
- libraries.
-
- PowerPC and SPARC ports are moving along (Radek and Jeff)
-
-@item Feb 13, 2002
-
- Excellent news since the 11th, here is a quick rundown:
-
- AppDomains have been deployed (Dietmar). Socket work is done
- (Dick). Corlib compiled with no refs to mscorlib (Dan). New
- comprehensive tests for colib bits (David). Nick is driving the
- regression test suite efforts and class library completeness.
- New System.Data work (Chris). Bug fixes (Paolo, Duncan, Ravi, Miguel)
-
- Miguel is off to the <a
- href="http://www.fosdem.org">FOSDEM</a> conference in Brussels.
-
-@item Feb 11, 2002
-
- <b>Mono 0.8 has been released!</b>
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure.
-
- You can get it <a
- href="download.html#feb-11">Here</a> (quick links: <a
- href="archive/mono-0.8.tar.gz">runtime</a> and <a
- href="archive/mcs-0.8.tar.gz">compiler/classes</a>)
-
-@item Feb 11, 2002
-
- We would like to welcome all the new developers that have
- joined the project in the last couple of days. The classes
- are rapidly moving.
-
- An explanation of the relationship between <a
- href="http://mail.gnome.org/archives/gnome-hackers/2002-February/msg00031.html">GNOME
- and Mono</a>.
-
- Nick is still leading our test suite platform. I can not
- stress how important it is to have a good regression test suite
- for our platform, as buggy class libraries are what are
- stopping the compiler from running completely on Linux.
-
- We are of course psyched to see Mono run on
- non-Linux systems. Work is moving on native code generation
- for StrongARM, PowerPC, and SPARC as well as porting Mono to
- other systems.
-
- There are a couple of debates on the Mono list on implementing
- a set of web server classes for <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/002911.html">enabling
- ASP.NET</a> on Mono.
-
- Paolo also <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/002944.html">
- posted a list of pending tasks</a> to enable the compiler to run on Linux
-
-@item Feb 10, 2002
-
- Mike Kestner has posted an <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-February/000024.html">Update
- on his Gtk#</a> activities.
-
-@item Feb 4, 2002
-
- Adam has done <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/002808.html">Qt
- bindings</a> for .NET. Adam is cool.
-
-@item Jan 29, 2002
-
- Dan Lewis has contributed a major missing set of classes to
- Mono: <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-January/002745.html">
- System.Text.RegularExpressions</a>.
-
- This is a fully .NET compatible implementation of the .NET regular expressions,
- fully Unicode aware. This contribution is very appreciated, as implementing this
- was not entirely trivial (supporting Unicode, plus a regex engine which is a super
- set of the Perl regex engine).
-
-@item Jan 28, 2002
-
- The Mono contributors have relicensed the Class Libraries under
- the terms of the
- <a href="http://www.opensource.org/licenses/mit-license.html">MIT X11</a> license.
-
- This license is an Open Source license, and is used by other projects
- (most notably, the XFree86 project).
-
- The runtime (JIT, metadata library, interpreter) remains under
- the LGPL and the C# compiler remains under the GPL.
-
- Our <a
- href="http://www.ximian.com/about_us/press_center/press_releases/mono_partners.html">Press
- Release</a>
-
- Press coverage: <a
- href="http://news.com.com/2100-1001-823734.html">CNet</a>, <a
- href="http://www.wired.com/news/technology/0,1282,50037-2,00.html">Wired</a>,
- <a href="http://www.infoworld.com/articles/hn/xml/02/01/28/020128hnopennet.xml">InfoWorld</a>,
- <a href="http://www.newsforge.com/article.pl?sid=02/01/27/2232231">NewsForge</a>.
-
-@item Jan 23, 2002
-
- New mailing list: <a href="mailto:mono-patches-request@ximian.com">mono-patches@ximian.com</a>.
- This mailing list will receive automatically the patches that are submitted
- to the Mono CVS to any of its modules.
-
- This allows anyone who wants to participate in the peer-review of the
- code submitted to CVS to receive patches on e-mail. It should also
- expose to everyone the changes that are being done by the team every day.
-
-@item Jan 21, 2002
-
- Dick has got a simple web server running with Mono (`MIS: Mono
- Internet Server') that is mostly used to test our IO layer, a
- <a href="http://primates.ximian.com/~miguel/dick-mis-server.png">screenshot</a>
-
- Paolo and Dietmar are busy making our runtime self sufficient on
- non-Windows platforms.
-
- C# compiler front: A lot of focus in the past weeks after
- the C# became self hosting has been in making the compiler a useful
- tool for development: improve error handling, provide better error
- reports, fixing all known bugs, and finally profiling of the compiler
- has begun.
-
-@item Jan 8, 2002
-
- Our compiler has been self-supporting since January 3rd. In
- the meantime, we have been busy working on making it run on
- Linux. Today Paolo got more work done on Reflection.Emit and
- the compiler compiled `console.cs' (a sample Mono program) on
- Linux.
-
-@item Jan 4, 2002
-
- Dietmar landed the Unicode support patch. Class libraries and
- runtimes are now fully Unicode aware. The details are <a href=
- "http://lists.ximian.com/archives/public/mono-list/2002-January/002409.html">
- here</a>
-
- Last minute breaking news: Paolo got our compiler in Linux to
- compile fib.cs, patches are comming tomorrow once we have
- ChangeLog entries.
-
-@item Jan 4, 2002
-
- Mike Kestner posted an update on Gtk# <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-January/000021.html"><i>New
- year, new direction</i></a>.
-
- Gtk# will be our foundation on which we will be implementing
- System.Windows.Forms.
-
-@item Jan 3, 2002
-
- Mono C# compiler becomes self-sufficient. We can now continue
- development of the compiler with itself.
-
- Work on the class libraries is still underway for having a full
- self hosting system. We hope to achieve our goal of self-hosting
- on Linux before the end of the month.
-
- Join the fun by downloading either tonight's <a
- href="snapshots">snapshot</a> or getting your sources from our
- <a href="anoncvs.html">Anonymous CVS server</a>.
-
-@item Dec 28, 2001
-
- After a lot of work, the C# compiler can compile itself.
- There are still errors in the generated image, but they are
- being fixed quickly.
-
- We will soon have the first non-Microsoft C# implementation!
-
-@item Dec 18, 2001
-
- JIT: More work on our IO abstraction layer (Dick).
-
- JIT: exception handling for unmanaged code (Dietmar)
-
- System.Reflection: Support for PropertyInfo and
- PropertyBuilder as well as the various queries for MethodBase.
-
- C#: Pre-processor; Rewrite of MemberLookup which fixed many of
- the outstanding issues. More bug fixing allows it to compile
- more programs.
-
-@item Dec 14, 2001
-
- Dietmar has improved the register allocation and now Mono performs
- two to three times as fast as it did yesterday. Amazing.
-
- The compiler keeps moving along, explicit interface
- implementation is there.
-
-@item Dec 11, 2001
-
- The JIT engine can now run all the compiler regression tests as
- well as assorted other programs, many more opcodes added
- recently. Currently the JIT engine uses a very simplistic register
- allocator (just enough to allow us to focus on feature completeness)
- and that will be the next major task to improve performance and
- reduce spills and reloads.
-
- On the C# compiler front: language features are now pretty
- much complete. The big missing tasks are unsafe code support,
- visibility, explicit interface implementation plus static flow
- analysis. There are many small bugs that need to be addressed.
-
- You can get your copy of the <a href="snapshots">latest Mono</a>
-
- More work is also required on fixing the foundation class
- libraries, it is easy to find spots now since Nick got the
- `make test' going.
-
-@item Dec 1, 2001
-
- AnonCVS access to Mono is here (updated every hour). Thanks
- to <a href="http://www.hispalinux.es">HispaLinux</a> and Jesus
- Climent for helping to set this up.
-
-@item Nov 30, 2001
-
- All tests from the mono runtime work with the JIT engine now
- (Dietmar).
-
- Recursive enumeration definition in the C# compiler are
- working now (Ravi).
-
- More work on the Web classes (Gaurav).
-
-@item Nov 28, 2001
-
- JIT land: Paolo got GDB support into the JIT engine while
- Dietmar added exceptions support to it.
-
- The C# compiler supports all array initializations now, and the
- switch statement as well as fixing many existing bugs. Many
- new more tests.
-
- Nick keeps working on improving our class library test suite.
-
- Dick has almost completed the Mono IO layer.
-
-@item Nov 16, 2001
-
-<blockquote>
- Mike Kestner has posted an <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2001-November/000015.html">update</a>
- on Gtk# development.
-</blockquote>
-
-@item Nov 14, 2001
-
-<blockquote>
- Paolo today got the Mono C# compiler running <a
- href="http://lists.ximian.com/archives/public/mono-list/2001-November/001941.html">on
- Linux</a>. It compiles a sample program and then the sample
- program is executed.
-
- Mutator unary operators (++ and --) in the compiler are fully
- functional, they used to only work on variables, and now they
- are complete.
-
- To sum things up: The Mono C# compiler is written in C# and
- uses the .NET classes to get its work done. To make this work
- on Linux work has to happen in various fronts:
-<ul>
- * The C# compiler is being worked on and can compile
- many programs now (our test suite at this point is
- made up of 40 tests).
-
- * The class libraries need to be mature enough to support
- the compiler, particularly System.Reflection.Emit (which is
- what Paolo has been working on lately).
-
- The compiler currently requires 103 classes from the
- .NET runtime (you can get the list by running: <b>monodis --typeref mcs.exe</b>
-
- * The interpreter should be mature enough to run the actual
- compiler byte codes and the corlib bytecodes.
-</ul>
-
- At the same time, Dietmar is working on the JIT engine which will
- replace our interpreter in production.
-</blockquote>
-
-@item Nov 12, 2001
-
-<blockquote>
- Dietmar got value types working on the JIT engine. Sean has
- got assembly loading in the runtime (required for NUnit).
-
- More progress on enumerations and attributes from Ravi.
-
- Nick keeps working on improving our class libraries.
-</blockquote>
-
-@item Nov 8, 2001
-
-<blockquote>
- Enumerations, array access and attributes for the C# compiler are into the CVS now.
-
- Full array support is not complete, but moving along.
-</blockquote>
-
-@item Nov 5, 2001
-
-<blockquote>
- Dietmar's new set of patches to the JIT have 20 out of 33
- tests running now.
-</blockquote>
-
-@item Nov 4, 2001
-
-<blockquote>
- Mike Kestner, main Gtk# contributor has posted a very interesting <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2001-November/000013.html">
- update</a> on his work on Gtk#.
-
- Ravi commited the initial support for Attributes in the
- compiler.
-
- Many HTML Controls from Leen checked into CVS.
-
- Paolo checked in his new System.Reflection and
- System.Reflection.Emit implementations. He has been working
- steadily on this huge task for a few weeks now. This is the
- foundation for the Mono C# compiler, and hence a very
- important piece of the puzzle.
-</blockquote>
-
-@item Nov 3, 2001
-
-<blockquote>
- Many clean ups have been going into the class library by Nick Drochak.
-
- Mega patch from Dietmar: he commited the flow analysis code
- for the JITer.
-
- A lot of work has been going into the WebControls by Gaurav (4
- new controls plus improved and bug fixed base classes).
-</blockquote>
-
-@item Nov 1, 2001
-
-<blockquote>
- Ravi commited the caller-side method selection of methods with
- variable length arguments. Now he depends on Miguel finishing
- the array handling support.
-</blockquote>
-
-@item Oct 27, 2001
-
-<blockquote>
- Lots of classes for System.Web from Gaurav were commited this
- morning.
-
- Some large recent developments:
-
- The Decimal implementation from Martin Weindel has been
- partially integrated (we need to put the internalcalls in
- place now and compile and link the decimal code).
-
- Derek Holden commited recently the IntegerFormatter code into
- the CVS, so we got a pretty comprehensive integer formatting
- engine that we can finally use all over the place.
-
- Compiler got support for lock as well as assorted bug fixes.
- Ravi is still working on array support (and then we can
- optimize foreach for the array case).
-
- Dietmar is busy working on flow analysis on the JITer, the
- previous mechanism of generating the forest was wrong. Paolo
- has been a busy bee reworking the System.Reflection.Emit
- support code, and we should have some pretty nice stuff next
- week. Dick on the other hand is still working on the
- WaitOne/WaitAll emulation code. WaitAll is like select on
- steroids: it can wait for different kinds of objects: files,
- mutexes, events and a couple of others.
-
- Mike Kestner is busy working on Gtk# which is now using the
- .defs files to quickly wrap the API.
-</blockquote>
-
-@item Oct 18, 2001
-
-<blockquote>
- Reworking expressions to support cleanly indexers and
- properties. <a href="http://www.nat.org/evolution.php3">11
- days</a> until Evolution 1.0 ships.
-
- Ximian users around the world <!--a
- href="http://www.bez.it/IMAGES/nora.jpg"-->rejoice<!--/a--> with
- recent C# compiler progress.
-</blockquote>
-
-@item Oct 17, 2001
-
-<blockquote>
- Delegate support has been checked into the compiler
- (definition and invocation); break/continue implemented.
-</blockquote>
-
-@item Oct 15, 2001
-
-<blockquote>
- JIT engine supports many of the object constructs now (object
- creation, vtable setup, interface table setup).
-
- The C# compiler now has almost full property support (only
- missing bit are pre-post increment/decrement operations),
- delegates are now created (still missing delegate invocation).
- try/catch/finally is also supported in the compiler now.
-
- System.Decimal implementation is in, as well as many crypto
- classes.
-</blockquote>
-
-@item Oct 5, 2001
-
-<blockquote>
- Sergey has released his first version of the <b>ilasm</b>
- assembler written in C#. You can get it from his web page:
- <a
- href="http://mono.eurosoft.od.ua">http://mono.eurosoft.od.ua</a>.
-
- The plan is to integrate ildasm into the Mono CVS soon. This
- component should in theory also be reusable for SharpDevelop
- eventually.
-</blockquote>
-
-@item Oct 4, 2001
-
-<blockquote>
- Our System.Reflection.Emit implementation created its first
- executable today. This means that a very simple .NET program
- that was compiled on Windows was able to generate a .NET program
- while running on Linux using the Mono runtime.
-
- The various piece of the puzzle are starting to get together:
- the compiler can compile simple programs now and we are
- basically focusing on completeness now.
-</blockquote>
-
-@item Sep 28, 2001
-
-<blockquote>
- <a
- href="http://www.icsharpcode.net/OpenSource/SD/default.asp">Sharp
- Develop 0.80</a> was released today.
-</blockquote>
-
-@item Sep 26, 2001
-
-<blockquote>
- More progress: more opcodes are working (Paolo); The compiler
- runs up to a point in Mint (Paolo); operator overloading works
- (both unary and binary) all over the place (Miguel); Completed decimal
- type conversions (Miguel); New build system in place based on
- Ant (Sean and Sergey); Refactored and documented the
- internals of the JIT engine (Dietmar); StatementExpressions
- handled correctly (Miguel).
-</blockquote>
-
-@item Sep 21, 2001
-
-<blockquote>
- A couple of news-worthy items: Dick got the initial thread
- support into mint; Paolo implemented many new opcodes; Dietmar
- got long operations and mul/div working on the JITer; Ravi rewrote
- the Method selector for expressions to be conformant; Miguel
- got i++ working. All in tonight's snapshot
-</blockquote>
-
-@item Sep 19, 2001
-
-<blockquote>
- Paolo has written a section on <a href="porting.html">Porting
- Mono</a> to othre architectures.
-</blockquote>
-
-@item Sep 18, 2001
-
-<blockquote>
- <A a href="download.html#sep-18">Mono 0.7</a> has been
- released (runtime engine, class libraries
- and C# compiler). Check the <a href="archive/mono-0.7">Mono
- 0.7 announcement</a> for details
-</blockquote>
-
-@item Sep 17, 2001
-
-<blockquote>
- Mike Kestner's Gtk# (Gtk-sharp) was checked into the CVS
- repository. Gtk# can run a simple hello world application.
- The binding is nice, as it maps Gtk+ signals to delegates in
- C#. You can see the Gtk# Hello World program <a href="src/HelloWorld.cs">here</a>
-
- Gtk-sharp should be available on the next snapshot set.
-</blockquote>
-
-@item Sep 10, 2001
-
-<blockquote>
- Dietmar checked in his CIL tree/forest regeneration and most
- importantly, the x86 instruction selector burg grammar.
-</blockquote>
-
-
-@item Sep 5, 2001
-
-<blockquote>
- The MCS compiler <b>can compile the sample Hello World</b>
- application and generate a Windows/CIL executable that runs!
-
- This executable runs with the Mono Interpreter of course (see
- August 28)
-</blockquote>
-
-@item Sep 4, 2001
-
-<blockquote>
- Dietmar checked into CVS the `monoburg' architecture
- independent instruction selector for the JIT engine.
-</blockquote>
-
-@item Aug 28, 2001
-
-<blockquote>
- <b>.NET Hello World is working under Mono!</b> The latest snapshots
- will let you run it.
-
- Hello World consits of 1821 CIL instructions,
- performs 66 subroutine calls and loads 12 classes from the corlib.dll
-
- Good work Mono team!
-</blockquote>
-
-@item Aug 23, 2001
-
-<blockquote>
- Lloyd Dupont has announced his OpenGL bindings for C#, they
- are available here: <a
- href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
-</blockquote>
-
-@item Aug 22, 2001
-
-<blockquote>
- New version of the Mono Runtime, Compiler and Classes has been
- <a
- href="download.html#august-22">released.</a> Check the <a
- href="archive/mono-0.6">0.6 announcement</a>.
-</blockquote>
-
-@item Aug 20, 2001
-
-<blockquote>
- A new <a href="contributing.html#compile-service">Compilation
- service</a> has been made available by Derek to allow people
- without access to the <a
- href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">.NET SDK</a>
-</blockquote>
-
-@item Aug 3, 2001
-
-<blockquote>
- Daily snapshots of mcs and mono are now available, they will
- run every night at 10pm Boston time.
-</blockquote>
-
-@item Jul 29, 2001
-
-<blockquote>
- Mono Runtime 0.5 has been <a
- href="download.html#july-29">released.</a> Check the <a
- href="archive/mono-0.5">release notes</a>
-</blockquote>
-
-@item Jul 25, 2001
-
-<blockquote>
- The slides for <A href="Presentations/O-Reilly">my
- presentation</a> at <a href="http://www.oreilly.com">O'Reilly
- Open Source Software Convention</a>
-</blockquote>
-
-@item Jul 22, 2001
-
-<blockquote>
- Another release of the class libraries is out, check the <a
- href="archive/mcs-22">MCS 22-July Release Notes</a>. You can
- get the new class libraries from <a
- href="download.html#july-22">here</a>
-</blockquote>
-
-@item Jul 19, 2001
-
-<blockquote>
- Another release of the class libraries is out, check the <a
- href="archive/mcs-19">MCS 19-July Release Notes</a>. You can
- get the new class libraries from <a
- href="download.html#july-19">here</a>
-</blockquote>
-
-@item Jul 17, 2001
-
-<blockquote>
- Another release of the class libraries is out, check the <a
- href="archive/mcs-17">MCS 17-July Release Notes</a>. You can
- get the new class libraries from <a
- href="download.html#july-17">here</a>
-
- Do not forget to check out the updated <a href="faq.html">FAQ</a>.
-
- Got Sean's new Class
- Status web pages up. These are a lot better than mine, and
- we are now keeping better track of contributors.
-</blockquote>
-
-@item Jul 15, 2001
-
-<blockquote>
- Another release of Mono is out, check the <a
- href="archive/mono-0.4">Mono 0.4 Release Notes</a>. Get it <a
- href="download.html#july-15">here</a>.
-</blockquote>
-
-@item Jul 14, 2001
-
-<blockquote>
- A <a
- href="http://lists.ximian.com/archives/public/mono-list/2001-July/000399.html">new
- release</a> of the
- runtime, compiler and classes has been made. Get it <a href="download.html#july-14">here</a>
-</blockquote>
-
-@item Jul 12, 2001
-
-<blockquote>
- I keep getting questions about my opinion on Passport, even when
- Mono has <b>nothing</b> to do with it. I finally <a
- href="passport.html">wrote something.</a>
-</blockquote>
-
-@item Jul 9, 2001
-
-<blockquote>
- Project launched.
-</blockquote>
-
-@item O'Reilly
-
-<blockquote>
- Brian posted a story on <a
- href="http://www.oreillynet.com/dotnet">O'Reilly Network .NET</a>
-</blockquote>
diff --git a/doc/java b/doc/java
deleted file mode 100755
index cf1afa1a39e..00000000000
--- a/doc/java
+++ /dev/null
@@ -1,62 +0,0 @@
-* Java
-
- It would be interesting to support the Java language as part
- of the Mono project.
-
- You have to think of Java as various pieces: Java the
- language and Java the virtual machine.
-
- It is possible to compile Java to .NET, as shown by the
- Microsoft J# compiler. We could then allow the migration of
- Java applications to the Mono runtime.
-
-** Native compiler
-
- Although a native compiler can be built, and probably should be
- built using an existing compiler, a short term solution is to
- build a translator from Java class files to the ECMA CIL images.
-
- This has the advantage that we can use an existing and tested
- Java compiler to generate the code, and then we can use an automated
- code compiler that compiles Java VM bytecodes to CIL bytecodes.
-
-** The translator.
-
- It would be interesting to write a semantic translator that
- converts java byte codes into CIL opcodes. This is possible
- because the Java byte codes are a subset of the CIL ones.
-
- A semantic tree needs to be constructed (very much in the
- spirit of what is done in mono_analize_stack in
- <tt>mono/mono/jit/jit.c</tt>. Once such a semantic tree is
- constructed, we could generate the equivalent Java code.
-
- This has a number of interesting side effects: people can
- continue to use their existing Java compilers to compile their
- code, and a simple tool that converts their .class files into
- a .NET assembly can be used.
-
-** Libraries
-
- We could translate the GNU Classpath libraries with the above
- tools to provide the Java runtime required to host into the
- Mono runtime. Some special treatment would be required for
- core data types like integers, arrays and strings, and of
- course reuse where possible existing classes from .NET to make
- them compatible.
-
-** JILC - Java to IL Compiler
-
- This is an attempt to make the java bytecode available for the
- .NET environment.
-
- The project attempts to generate the IL code / bytecode from the
- compiled java class files. It has reached the stage of code-generation.
- The issues that needs to be addressed is the mapping of java objects
- to the IL objects, eg: java.lang.String to System.String.
-
- Gaurav Vaish and Abhaya Agarwal are currently leading this project.
- The project is currently hosted at <a href="http://sourceforge.net/projects/jilc">SourceForge.Net</a>.
- The official home page of the project is
- <a href="http://jilc.sourceforge.net">http://jilc.sourceforge.net</a>.
-
diff --git a/doc/jit-debug b/doc/jit-debug
deleted file mode 100644
index 867738101ae..00000000000
--- a/doc/jit-debug
+++ /dev/null
@@ -1,181 +0,0 @@
-* How to debug your C# application with the JIT engine
-
- To debug a C# application you need to run the JIT in your debugger.
-
- Before you can do anything useful in a debugger, you need a symbol
- file which tells your debugger about functions, types, line numbers
- and such. Unfortunately, this symbol file needs to be recreated each
- time the JIT compiles a new method since it doesn't know anything
- about this method (especially not its memory address) before actually
- compiling it.
-
- You have two ways of creating a symbol file:
-
-** Letting the JIT dynamically create the symbol file
-
- This'll give you a symbol file which is suitable for debugging IL byte
- code - you won't see your C# source code.
-
- However, this method has the advantage that it works with every assembly,
- no matter whether it has been compiled with Mono's C# compiler (MCS) or
- with any other compiler. It's currently the only way to debug
- <tt>corlib.dll</tt> or any other library which cannot be compiled with
- our compiler yet.
-
- All that you need is a dump of the IL bytecode for each assembly (including
- all assemblies this assembly is referencing). This is done by using the
- <tt>monodis</tt> utility:
-
- <pre>
- monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il<br>
- monodis /home/export/martin/MONO-LINUX/lib/System.dll > System.il<br>
- monodis /home/export/martin/MONO-LINUX/bin/mcs.exe > mcs.il
- </pre>
-
- Make sure that all the .il files have the same name as their corresponding
- assembly and that they're all created in the current directory.
-
- The JIT supports two different debugging file formats:
-
- <ul>
- * STABS: This is a very simple debugging format, but it may be the only one
- which is supported on your system. It is limited to source files of no more
- than 65.535 lines and it's type support is also very limited. You should only
- use this if your debugger doesn't support DWARF 2.
-
- To generate STABS output, use the <tt>--stabs</tt> command line argument.
-
-
- * DWARF 2: The DWARF 2 debugging format is a very powerful debugging format
- which can handle source files of arbitrary size and has a highly sophisticated
- type support. It's the recommended format unless you need to use STABS because
- your debugger doesn't support DWARF 2.
-
- To generate DWARF 2 output, use the <tt>--dwarf</tt> command line argument.
- </ul>
-
-
- You need to regenerate the symbol file each time the JIT compiled a new
- method and each time you restart the JIT. You cannot reuse your symbol file
- if you start the JIT a second file, not even if you're running the same
- application with the same input data a second time.
-
- Regenerating the symbol file is done by calling the JIT's
- <tt>mono_debug_make_symbols ()</tt> function from within your debugger and
- then reloading the symbol files. This function creates a <tt>filename-dwarf.s</tt>
- (or <tt>filename-stabs.s</tt>) assembler input file in the current directory and
- an object file in <tt>/tmp/filename.o</tt> - you need to tell your debugger to
- add this object file as symbol file.
-
- If you're using the GNU debugger, this is done like this:
-
- <pre>
- call mono_debug_make_symbols ()
- add-symbol-file /tmp/corlib.o
- add-symbol-file /tmp/mcs.o
- add-symbol-file /tmp/Mono.CSharp.Debugger.o
- </pre>
-
- You can also write a GDB macro like this:
-
- <pre>
- define reload
- call mono_debug_make_symbols ()
- add-symbol-file /tmp/corlib.o
- add-symbol-file /tmp/mcs.o
- add-symbol-file /tmp/Mono.CSharp.Debugger.o
- end
- </pre>
-
- Then you can just say <tt>reload</tt> to have GDB recreate the symbol file.
-
- There's also an <a href="jit-debug-sample.html">example debugging session</a> using
- the GNU debugger.
-
-** Using a symbol file which have been created by the Mono C# compiler
-
- If you compiled your application with Mono's C# compiler (MCS), you can tell it to
- create a symbol file which is then processed and rewritten by the JIT engine.
-
- To do this, you must give MCS the <tt>-g</tt> option:
-
- <pre>
- $ mcs -g Foo.cs
- </pre>
-
- This creates a <tt>Foo-debug.s</tt> assembler input file.
-
- To use this in the JIT, you must first copy it to the target machine (the machine
- where you want to run the JIT to debug your application) and run it through the
- assembler to produce an object file <tt>Foo-debug.o</tt>. This object file must be
- in the current directory.
-
- Then start the JIT in your debugger and give it the <tt>--dwarf-plus</tt> command
- line argument.
-
- Each time you call <tt>mono_debug_make_symbols ()</tt> from withing your debugger,
- the JIT will read this <tt>Foo-debug.o</tt>, fix some machine dependent things like
- memory addresses etc. in it and write it back to disk.
-
- If you're using the GNU debugger, you'll want to use a macro like this:
-
- <pre>
- define relocate
- call mono_debug_make_symbols ()
- add-symbol-file /tmp/corlib.o
- add-symbol-file mcs-debug.o
- add-symbol-file Mono.CSharp.Debugger-debug.o
- end
- </pre>
-
- If there is no <tt>assembly-debug.o</tt> file, but an <tt>assembly.il</tt> one, the
- JIT will fall back to normal DWARF 2 (in the example above, <tt>corlib.dll</tt> was
- compiled with Microsoft's compiler and the JIT is thus using DWARF to debug it).
-
- This debugging method only works if you compiled your assembly with MCS, but it'll
- allow you to actually debug your C# source code :-)
-
- Here's an <a href="jit-debug-sample2.html">example debugging session</a> using
- the GNU debugger.
-
-** Breakpoints and single stepping
-
- The JIT has a <tt>--debug</tt> command line argument to insert a breakpoint at the
- beginning of this method. It takes a <tt>Namespace.Class:Method</tt> argument which
- is the method. This argument can be given multiple times.
-
- However, once your application is stopped in GDB you may want to insert a breakpoint
- the next time the JIT compiles a method. There's a global variable
- <tt>mono_debug_insert_breakpoint</tt> which you can modify in your debugger.
-
- If this variable is set to a non-zero value, the JIT's <tt>arch_compile_method</tt>
- will insert a breakpoint the next time it is called, ie. at the top of the next
- method it compiles. If this value has a positive value, it acts as a counter and is
- decremented after inserting the breakpoint - setting it to a negative value will let
- the JIT insert the breakpoint each time it compiles a new method.
-
- There's also global variable <tt>mono_debug_last_breakpoint_address</tt> which always
- contains the address of the last inserted breakpoint. You may manually override this
- address with a <tt>nop</tt> instruction to delete the breakpoint.
-
- For instance, I have a GDB macro called <tt>enter</tt> which I use to enter a method
- rather than stepping over it:
-
- <pre>
- define enter
- set mono_debug_insert_breakpoint = 1
- continue
- set *mono_debug_last_breakpoint_address = 0x90
- relocate
- frame
- </pre>
-
- Btw. speaking of single stepping - you should use your debuggers <tt>next</tt> command,
- not its <tt>step</tt> command for single stepping unless you compiled the JIT without
- debugging support. The reason for this is that the JIT creates machine code which contains
- calls to JIT methods such as <tt>mono_object_new_wrapper</tt> at places where you don't
- expect them - so unless the JIT is compiled at least without line numbers, your debugger
- will enter such methods if you use <tt>step</tt> rather than <tt>next</tt>.
-
-
-
diff --git a/doc/jit-debug-sample b/doc/jit-debug-sample
deleted file mode 100644
index a0c5d2d8b48..00000000000
--- a/doc/jit-debug-sample
+++ /dev/null
@@ -1,86 +0,0 @@
-* A debugging session using a dynamically generated symbol file.
-
- Let's assume we have the following C# application which we want to debug:
-
- <pre>
- using System;
-
- public class Foo
- {
- public struct MyStruct {
- int a;
- long b;
- double c;
- }
-
- public static void Main ()
- {
- Int32 value = 5;
- long test = 512;
-
- MyStruct my_struct;
- my_struct.a = 5;
- my_struct.b = test;
- my_struct.c = 23323.5235;
- }
- }
- </pre>
-
- First of all, we need to compile it and create the .il files:
-
- <pre>
- $ mcs ./Foo.cs
- $ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
- $ monodis Foo.exe > Foo.il
- </pre>
-
- Now we can start the JIT in the debugger:
-
- <pre>
- $ gdb ~/monocvs/mono/mono/jit/mono
- (gdb) r --dwarf --debug Foo:Main ./Foo.exe
- Starting program: /home/martin/monocvs/mono/mono/jit/mono --dwarf --debug Foo:Main ./Foo.exe
- 0x081e8911 in ?? ()
- (gdb) call mono_debug_make_symbols ()
- (gdb) add-symbol-file /tmp/Foo.o
- Reading symbols from /tmp/Foo.o...done.
- Current language: auto; currently c++
- (gdb) frame
- #0 Foo.Main () at Foo.il:26
- 26 // method line 2
- (gdb) n
- Foo.Main () at Foo.il:38
- 38 IL_0000: ldc.i4.5
- (gdb) list
- 33 .maxstack 2
- 34 .locals (
- 35 int32 V_0,
- 36 int64 V_1,
- 37 valuetype MyStruct V_2)
- 38 IL_0000: ldc.i4.5
- 39 IL_0001: stloc.0
- 40 IL_0002: ldc.i4 512
- 41 IL_0007: conv.i8
- 42 IL_0008: stloc.1
- 43 IL_0009: ldloca.s 2
- 44 IL_000b: ldc.i4.5
- 45 IL_000c: stfld int32 .MyStruct::a
- 46 IL_0011: ldloca.s 2
- 47 IL_0013: ldloc.1
- 48 IL_0014: stfld int64 .MyStruct::b
- 49 IL_0019: ldloca.s 2
- 50 IL_001b: ldc.r8 23323.5
- 51 IL_0024: stfld float64 .MyStruct::c
- 52 IL_0029: ret
- (gdb) until 52
- Foo.Main () at Foo.il:53
- 53 }
- (gdb) info locals
- V_0 = 5
- V_1 = 512
- V_2 = {a = 5, b = 512, c = 23323.523499999999}
- </pre>
-
- As you see in this example, you need to know IL code to use this debugging method - but
- it may be the only way to debug a library.
-
diff --git a/doc/jit-debug-sample2 b/doc/jit-debug-sample2
deleted file mode 100644
index ae75ceed591..00000000000
--- a/doc/jit-debug-sample2
+++ /dev/null
@@ -1,70 +0,0 @@
-* A debugging session using a symbol file which has been created by MCS.
-
- Let's assume we have the following C# application which we want to debug:
-
- <pre>
- using System;
-
- public class Foo
- {
- public struct MyStruct {
- int a;
- long b;
- double c;
- }
-
- public static void Main ()
- {
- Int32 value = 5;
- long test = 512;
-
- MyStruct my_struct;
- my_struct.a = 5;
- my_struct.b = test;
- my_struct.c = 23323.5235;
- }
- }
- </pre>
-
- First of all, we need to compile it with MCS, assemble the generated .s file and
- create the .il files for all referenced assemblies which were not compiled with MCS:
-
- <pre>
- $ mcs -g ./Foo.cs
- $ as -o Foo-debug.o Foo-debug.s
- $ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
- </pre>
-
- Now we can start the JIT in the debugger:
-
- <pre>
- $ gdb ~/monocvs/mono/mono/jit/mono
- (gdb) r --dwarf-plus --debug Foo:Main ./Foo.exe
- Starting program: /home/martin/monocvs/mono/mono/jit/mono --dwarf-plus --debug Foo:Main ./Foo.exe
- Program received signal SIGTRAP, Trace/breakpoint trap.
- 0x081e8681 in ?? ()
- (gdb) call mono_debug_make_symbols ()
- (gdb) add-symbol-file Foo-debug.o
- (gdb) add-symbol-file /tmp/corlib.o
-` (gdb) frame
- #0 Main () at ./Foo.cs:11
- 11 public static void Main ()
- (gdb) n
- Main () at ./Foo.cs:13
- 13 Int32 value = 5;
- (gdb)
- 14 long test = 512;
- (gdb)
- 17 my_struct.a = 5;
- (gdb)
- 18 my_struct.b = test;
- (gdb)
- 19 my_struct.c = 23323.5235;
- (gdb)
- 20 }
- (gdb) info locals
- value = 5
- test = 512
- my_struct = { a = 5, b = 512, c = 23323.5235 }
- </pre>
-
diff --git a/doc/languages b/doc/languages
deleted file mode 100755
index 5325bdbdc57..00000000000
--- a/doc/languages
+++ /dev/null
@@ -1,108 +0,0 @@
-* Compilers for other languages
-
- Here are some other free compilers for other languages that
- target .NET and should work with Mono with no problem:
-
- <ul>
- * <a href="#ComponentPascal">Component Pascal</a>
- * <a href="#MonoLogo">MonoLogo</a>
- * <a href="#Oberon">Oberon</a>
- * <a href="#Forth">Forth</a>
- </ul>
-
- Languages we would like to have supported, with links to resources:
-
- <ul>
- * <a href="#JavaScript">Java Script</a>
- * <a href="java.html">Java</a>
- * <a href="#c">C</a>
- </ul>
-
- Some experimental languages:
-
- <ul>
- * <a href="#Tachy">Tachy</a> (scheme-like)
- </ul>
-
-<a name="MonoLogo">
-** MonoLogo
-
- An implementation of Logo for Mono (and .NET)
-
- The <A href="http://monologo.sf.net">Mono Logo</a> compiler is
- hosted in the <a href="ccvs.html">Mono CVS</a> repository
- and also available on the <a href="anoncvs.html">AnonCVS</a> mirrors.
-
-<a name="Oberon">
-** Oberon
-
- This Oberon compiler is written in Oberon.NET (another self
- hosting compiler):
-
- <a href="http://www.superin.formativ.net/mono/oberon/oberon.zip">http://www.superin.formativ.net/mono/oberon/oberon.zip</a>
-
-<a name="ComponentPascal">
-** Component Pascal
-
- The Component Pascal compiler: <a
- href="http://www2.fit.qut.edu.au/CompSci/PLAS/ComponentPascal">Home
- Page</a>, you can <a
- href="http://www2.fit.qut.edu.au/CompSci/PLAS/ComponentPascal/gpcp1.1.4-netRTM.zip">
- download it</a>
-
-<a name="Forth">
-** Delta Forth
-
- The Delta Forth.NET project: <a
- href="http://www.codeproject.com/dotnet/dforthnet.asp">Home
- Page</a> and <a href="http://www.dataman.ro/dforth/index.html">more
- details here</a>.
-
-
-<a name="Tachy">
-** Tachy
-
- A subset of Scheme language called <a
- href="http://radio.weblogs.com/0101156/stories/2002/03/19/tachy.html">Tachy</a>
-
-* Missing languages
-
- Here is a list of a few languages that we would like to see
- supported. We will try to maintain a set of links here with
- technical information for those interested in porting,
- implementing or adapting a compiler for any of these
- languages:
-
-<a name="JavaScript">
-* Java Script
-
- The Mozilla project has an implementation of JavaScript
- written in Java called <a
- href="http://www.mozilla.org/rhino/">Rhino</a>.
-
- You could port this code from Java to C#.
-
- Note that since JavaScript allows for evaluation at runtime,
- the compiler has to be built as a class that can be invoked at
- runtime.
-
-<a name="c">
-* C
-
- Ideally GCC could be modified to generate CIL, but it is a
- big task. That would give us various compilers in one pass.
-
- Rumor is that the next version of the LCC compiler will
- include an IL backend. We do not know how extensive the support
- for integration with .NET will be, but it would be an interesting
- excercise to add an extension to C to call into .NET code.
-
- LCC is not an open source compiler, but it is free as long as you
- do not profit from selling it.
-
-<a name="Java">
-* Java
-
- We have a <a href="java.html">separate page</a> for Java.
-
-
diff --git a/doc/mailing-lists b/doc/mailing-lists
deleted file mode 100644
index 6e7d1e6598b..00000000000
--- a/doc/mailing-lists
+++ /dev/null
@@ -1,198 +0,0 @@
-* Mailing Lists
-
- There are a number of mailing lists for Mono
-
- <table>
- <tr>
- <td>
- <b><a
- href="http://lists.ximian.com/mailman/listinfo/mono-list">mono-list</a></b>
- </td>
- <td>
- The general Mono discussion list.
- </td>
- </tr>
- <tr>
- <td>
- <b><a
- href="http://lists.ximian.com/mailman/listinfo/mono-announce-list">mono-announce-list</a></b>
- </td>
- <td>
- Announcements of Mono developments.
- </td>
- </tr>
- <tr>
- <td>
- <b><a
- href="http://lists.ximian.com/mailman/listinfo/mono-gc-list">mono-gc-list</a></b>
- </td>
- <td>
- Discussion on the GC system of Mono.
- </td>
- </tr>
- <tr>
- <td>
- <b><a
- href="http://lists.ximian.com/mailman/listinfo/mono-patches">mono-patches</a></b>
- </td>
- <td>
- Track the CVS activity of Mono on this mailing list (patches are sent to recipients).
- You can get <a href="http://www.go-mono.com/snapshots">daily snapshots</a> as well.
- </td>
- </tr>
- <tr>
- <td>
- <b><a
- href="http://lists.ximian.com/mailman/listinfo/mono-cvs-list">mono-cvs-list</a></b>
- </td>
- <td>
- Track the CVS activity of Mono on this mailing list.
- </td>
- </tr>
- <tr>
- <td>
- <b><a
- href="http://lists.ximian.com/mailman/listinfo/mono-docs-list">mono-docs-list</a></b>
- </td>
- <td>
- Discussion on the documentation of Mono.
- </td>
- </tr>
- <tr>
- <td>
- <b><a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs</a></b>
- </td>
- <td>
- This mailing list is used to keep track of the bugs in Mono as reported
- in <a href="http://bugzilla.ximian.com">Bugzilla.ximian.com</a>
- </td>
- </tr>
- </table>
-
- Other mailing lists of interest:
-
- <ul>
- * <b><a
- href="http://discuss.develop.com/dotnet.html">Dotnet mailing
- list at Develop.com:</a></b> The guys at Develop Mentor run
- this general purpose mailing list.
- </ul>
- </ul>
-
-* Google search of the archives
-
-<!-- Google Search with mods -->
-<center>
-
-<table>
-<tr>
-<td><a href="http://www.google.com/search"><img src="mailing-lists_files/Logo_40wht.gif" border="0" alt="Google" align="middle"></a></td>
-
-<td>
-<table>
-
-<tr><td>
-<FORM method=GET action=http://www.google.com/custom>
-<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
-<tr valign=top>
-<td>
-<INPUT TYPE=text name=q size=31 maxlength=255 value="">
-<INPUT TYPE=hidden name=q size=31 maxlength=255 value="mono">
-<INPUT type=submit name=sa VALUE="Search">
-<input type="hidden" name="cof" value="GIMP:#00ff00;T:#ffffff;LW:401;BIMG:http://www.go-mono.com/images/bgsquares.gif;ALC:#ffffff;L:http://www.go-mono.com/images/mono.gif;GFNT:#cc7700;LC:#ee9900;LH:80;BGC:#444444;AH:center;VLC:#cccccc;S:http://www.go-mono.com;GALT:#eeee00;AWFID:45753ce73241ef7a;">
-<font face="arial,sans-serif" size="-1"><input type="hidden" name="domains" value="www.go-mono.com;lists.ximian.com"><br><input type="radio" name="sitesearch" value="www.go-mono.com"> Search www.go-mono.com <input type="radio" name="sitesearch" value="lists.ximian.com"> Search lists.ximian.com </font><br>
-</td></tr></TABLE>
-</FORM>
-</tr></td>
-
-<tr><td>
-<FORM method=GET action=http://www.google.com/custom>
-<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
-<tr valign=top>
-<td>
-<INPUT TYPE=text name=q size=31 maxlength=255 value="">
-<INPUT TYPE=hidden name=q size=31 maxlength=255 value="mono-list">
-<INPUT type=submit name=sa VALUE="Search">
-<input type="hidden" name="cof" value="GIMP:#00ff00;T:#ffffff;LW:401;BIMG:http://www.go-mono.com/images/bgsquares.gif;ALC:#ffffff;L:http://www.go-mono.com/images/mono.gif;GFNT:#cc7700;LC:#ee9900;LH:80;BGC:#444444;AH:center;VLC:#cccccc;S:http://www.go-mono.com;GALT:#eeee00;AWFID:45753ce73241ef7a;">
-<font face=arial,sans-serif size=-1><input type=hidden name=domains value="lists.ximian.com"><br> <input type=hidden name=sitesearch value="lists.ximian.com"> Search mono-<b>list</b> </font><br>
-</td></tr></TABLE>
-</FORM>
-</tr></td>
-
-<tr><td>
-<FORM method=GET action=http://www.google.com/custom>
-<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
-<tr valign=top>
-<td>
-<INPUT TYPE=text name=q size=31 maxlength=255 value="">
-<INPUT TYPE=hidden name=q size=31 maxlength=255 value="mono-announce-list">
-<INPUT type=submit name=sa VALUE="Search">
-<input type="hidden" name="cof" value="GIMP:#00ff00;T:#ffffff;LW:401;BIMG:http://www.go-mono.com/images/bgsquares.gif;ALC:#ffffff;L:http://www.go-mono.com/images/mono.gif;GFNT:#cc7700;LC:#ee9900;LH:80;BGC:#444444;AH:center;VLC:#cccccc;S:http://www.go-mono.com;GALT:#eeee00;AWFID:45753ce73241ef7a;">
-<font face=arial,sans-serif size=-1><input type=hidden name=domains value="lists.ximian.com"><br> <input type=hidden name=sitesearch value="lists.ximian.com"> Search mono-<b>announce-list</b> </font><br>
-</td></tr></TABLE>
-</FORM>
-</tr></td>
-
-<tr><td>
-<FORM method=GET action=http://www.google.com/custom>
-<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
-<tr valign=top>
-<td>
-<INPUT TYPE=text name=q size=31 maxlength=255 value="">
-<INPUT TYPE=hidden name=q size=31 maxlength=255 value="mono-bugs">
-<INPUT type=submit name=sa VALUE="Search">
-<input type="hidden" name="cof" value="GIMP:#00ff00;T:#ffffff;LW:401;BIMG:http://www.go-mono.com/images/bgsquares.gif;ALC:#ffffff;L:http://www.go-mono.com/images/mono.gif;GFNT:#cc7700;LC:#ee9900;LH:80;BGC:#444444;AH:center;VLC:#cccccc;S:http://www.go-mono.com;GALT:#eeee00;AWFID:45753ce73241ef7a;">
-<font face=arial,sans-serif size=-1><input type=hidden name=domains value="lists.ximian.com"><br> <input type=hidden name=sitesearch value="lists.ximian.com"> Search mono-<b>bugs</b> </font><br>
-</td></tr></TABLE>
-</FORM>
-</tr></td>
-
-<tr><td>
-<FORM method=GET action=http://www.google.com/custom>
-<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
-<tr valign=top>
-<td>
-<INPUT TYPE=text name=q size=31 maxlength=255 value="">
-<INPUT TYPE=hidden name=q size=31 maxlength=255 value="mono-gc-list">
-<INPUT type=submit name=sa VALUE="Search">
-<input type="hidden" name="cof" value="GIMP:#00ff00;T:#ffffff;LW:401;BIMG:http://www.go-mono.com/images/bgsquares.gif;ALC:#ffffff;L:http://www.go-mono.com/images/mono.gif;GFNT:#cc7700;LC:#ee9900;LH:80;BGC:#444444;AH:center;VLC:#cccccc;S:http://www.go-mono.com;GALT:#eeee00;AWFID:45753ce73241ef7a;">
-<font face=arial,sans-serif size=-1><input type=hidden name=domains value="lists.ximian.com"><br> <input type=hidden name=sitesearch value="lists.ximian.com"> Search mono-<b>gc-list</b> </font><br>
-</td></tr></TABLE>
-</FORM>
-</tr></td>
-
-<tr><td>
-<FORM method=GET action=http://www.google.com/custom>
-<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
-<tr valign=top>
-<td>
-<INPUT TYPE=text name=q size=31 maxlength=255 value="">
-<INPUT TYPE=hidden name=q size=31 maxlength=255 value="mono-cvs-list">
-<INPUT type=submit name=sa VALUE="Search">
-<input type="hidden" name="cof" value="GIMP:#00ff00;T:#ffffff;LW:401;BIMG:http://www.go-mono.com/images/bgsquares.gif;ALC:#ffffff;L:http://www.go-mono.com/images/mono.gif;GFNT:#cc7700;LC:#ee9900;LH:80;BGC:#444444;AH:center;VLC:#cccccc;S:http://www.go-mono.com;GALT:#eeee00;AWFID:45753ce73241ef7a;">
-<font face=arial,sans-serif size=-1><input type=hidden name=domains value="lists.ximian.com"><br> <input type=hidden name=sitesearch value="lists.ximian.com"> Search mono-<b>cvs-list</b> </font><br>
-</td></tr></TABLE>
-</FORM>
-</tr></td>
-
-<tr><td>
-<FORM method=GET action=http://www.google.com/custom>
-<TABLE bgcolor=#FFFFFF cellspacing=0 border=0>
-<tr valign=top>
-<td>
-<INPUT TYPE=text name=q size=31 maxlength=255 value="">
-<INPUT TYPE=hidden name=q size=31 maxlength=255 value="mono-patches">
-<INPUT type=submit name=sa VALUE="Search">
-<input type="hidden" name="cof" value="GIMP:#00ff00;T:#ffffff;LW:401;BIMG:http://www.go-mono.com/images/bgsquares.gif;ALC:#ffffff;L:http://www.go-mono.com/images/mono.gif;GFNT:#cc7700;LC:#ee9900;LH:80;BGC:#444444;AH:center;VLC:#cccccc;S:http://www.go-mono.com;GALT:#eeee00;AWFID:45753ce73241ef7a;">
-<font face=arial,sans-serif size=-1><input type=hidden name=domains value="lists.ximian.com"><br> <input type=hidden name=sitesearch value="lists.ximian.com"> Search mono-<b>patches</b> </font><br>
-</td></tr></TABLE>
-</FORM>
-</tr></td>
-
-
-</table>
-</tr>
-</table>
-
-</center>
-<!-- /Google Search with mods -->
diff --git a/doc/mono-build-w32.sh b/doc/mono-build-w32.sh
deleted file mode 100755
index 28768d97df8..00000000000
--- a/doc/mono-build-w32.sh
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/bash
-
-# Script to automate the building of mono and its dependencies on
-# cygwin. Relies on wget being installed (could make it fall back to
-# using lynx, links, w3, curl etc), assumes that gcc, make, tar,
-# automake, etc are already installed too (may be worth testing for
-# all that right at the top and bailing out if missing/too old/too new
-# etc).
-
-
-# See where we are. This will become the top level directory for the
-# installation, unless we are given an alternative location
-here=$1
-test -z "$here" && here=`pwd`
-
-echo "Building Mono and dependencies in $here, installing to $here/install"
-
-PATH=$here/install/bin:$here/install/lib:$PATH
-
-# Check mono out first, so we can run aclocal from inside the mono dir (it
-# needs to see which version of the real aclocal to run)
-test -z "$CVSROOT" && CVSROOT=:pserver:anonymous@anoncvs.go-mono.com:/mono
-export CVSROOT
-
-echo "Updating mono"
-
-# cvs checkout does the same as cvs update, except that it copes with
-# new modules being added
-
-# Older versions of cvs insist on a cvs login for :pserver: methods
-# Make sure cvs is using ssh for :ext: methods
-
-if [ ${CVSROOT:0:5} = ":ext:" ]; then
- CVS_RSH=ssh
- export CVS_RSH
-elif [ ${CVSROOT:0:9} = ":pserver:" ]; then
- if ! grep $CVSROOT ~/.cvspass > /dev/null 2>&1 ; then
- echo "Logging into CVS server. Anonymous CVS password is probably empty"
- cvs login || exit -1
- fi
-fi
-
-cvs checkout mono || exit -1
-
-if [ ! -z "${AUTO_STABLE}" -o -e /usr/autotool/stable ]; then
- export AUTO_STABLE=${AUTO_STABLE:-/usr/autotool/stable}
- export AUTO_DEVEL=${AUTO_STABLE}
-fi
-
-# Need to install pkgconfig and set ACLOCAL_FLAGS if there is not a
-# pkgconfig installed already. Otherwise set PKG_CONFIG_PATH to the
-# glib we're about to install in $here/install. This script could
-# attempt to be clever and see if glib 2 is already installed, too.
-
-
-# --print-ac-dir was added in 1.2h according to the ChangeLog. This
-# should mean that any automake new enough for us has it.
-
-# This sets ACLOCAL_FLAGS to point to the freshly installed pkgconfig
-# if it doesnt already exist on the system (otherwise auto* breaks if
-# it finds two copies of the m4 macros). The GIMP for Windows
-# pkgconfig sets its prefix based on the location of its binary, so we
-# dont need PKG_CONFIG_PATH (the internal pkgconfig config file
-# $prefix is handled similarly).
-
-function aclocal_scan () {
- # Quietly ignore the rogue '-I' and other aclocal flags that
- # aren't actually directories...
- #
- # cd into mono/ so that the aclocal wrapper can work out which version
- # of aclocal to run
- for i in `(cd mono && aclocal --print-ac-dir)` $ACLOCAL_FLAGS
- do
- if [ -f $i/$1 ]; then
- return 0
- fi
- done
-
- return 1
-}
-
-function install_package() {
- zipfile=$1
- markerfile=$2
- name=$3
-
- echo "Installing $name..."
- if [ ! -f $here/$zipfile ]; then
- wget http://www.go-mono.com/archive/$zipfile
- fi
-
- # Assume that the package is installed correctly if the marker
- # file is there
- if [ ! -f $here/install/$markerfile ]; then
- (cd $here/install || exit -1; unzip -o $here/$zipfile || exit -1) || exit -1
- fi
-}
-
-if ! aclocal_scan pkg.m4 ; then
- ACLOCAL_FLAGS="-I $here/install/share/aclocal $ACLOCAL_FLAGS"
-fi
-
-export PATH
-export ACLOCAL_FLAGS
-
-# Grab pkg-config, glib etc
-if [ ! -d $here/install ]; then
- mkdir $here/install || exit -1
-fi
-
-# Fetch and install pkg-config, glib, iconv, intl
-
-install_package pkgconfig-0.80-tml-20020101.zip bin/pkg-config.exe pkgconfig
-install_package glib-1.3.12-20020101.zip lib/libglib-1.3-12.dll glib
-install_package glib-dev-1.3.12-20020101.zip lib/glib-1.3.lib glib-dev
-install_package libiconv-1.7.zip lib/iconv.dll iconv
-install_package libiconv-dev-1.7.zip lib/iconv.lib iconv-dev
-install_package libintl-0.10.40-20020101.zip lib/libintl-1.dll intl
-install_package libgc-dev.zip lib/gc.dll gc-dev
-
-# Needed to find the libiconv bits
-CPPFLAGS="$CPPFLAGS -I$here/install/include"
-LDFLAGS="$LDFLAGS -L$here/install/lib"
-export CPPFLAGS
-export LDFLAGS
-
-# Make sure we build native w32, not cygwin
-#CC="gcc -mno-cygwin"
-#export CC
-
-# --prefix is used to set the class library dir in mono, and it needs
-# to be in windows-native form. It also needs to have '\' turned into
-# '/' to avoid quoting issues during the build.
-prefix=`cygpath -w $here/install | sed -e 's@\\\\@/@g'`
-
-# Build and install mono
-echo "Building and installing mono"
-
-(cd $here/mono; ./autogen.sh --prefix=$prefix || exit -1; make || exit -1; make install || exit -1) || exit -1
-
-
-echo ""
-echo ""
-echo "All done."
-echo "Add $here/install/bin and $here/install/lib to \$PATH"
-echo "Don't forget to copy the class libraries to $here/install/lib"
-
diff --git a/doc/mono-build.sh b/doc/mono-build.sh
deleted file mode 100755
index 10878bf2780..00000000000
--- a/doc/mono-build.sh
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/bin/bash
-
-# Script to automate the building of mono and its dependencies.
-# Relies on wget being installed (could make it fall back to using
-# lynx, links, w3, curl etc), assumes that gcc, make, tar, automake,
-# etc are already installed too (may be worth testing for all that
-# right at the top and bailing out if missing/too old/too new etc).
-
-
-# See where we are. This will become the top level directory for the
-# installation, unless we are given an alternative location
-here=$1
-test -z "$here" && here=`pwd`
-
-echo "Building Mono and dependencies in $here, installing to $here/install"
-
-PATH=$here/install/bin:$PATH
-LD_LIBRARY_PATH=$here/install/lib:$LD_LIBRARY_PATH
-
-# Need to install pkgconfig and set ACLOCAL_FLAGS if there is not a
-# pkgconfig installed already. Otherwise set PKG_CONFIG_PATH to the
-# glib we're about to install in $here/install. This script could
-# attempt to be clever and see if glib 2 is already installed, too.
-
-
-# --print-ac-dir was added in 1.2h according to the ChangeLog. This
-# should mean that any automake new enough for us has it.
-
-function aclocal_scan () {
- # Quietly ignore the rogue '-I' and other aclocal flags that
- # aren't actually directories...
- for i in `aclocal --print-ac-dir` $ACLOCAL_FLAGS
- do
- if [ -f $i/$1 ]; then
- return 0
- fi
- done
-
- return 1
-}
-
-function pkgconfig_scan () {
- module=$1
-
- echo "Finding pkgconfig files for $module..."
-
- # Should we use locate? or just a list of well-known directories?
- # locate has the problem of false positives in src dirs
- for i in /usr/lib/pkgconfig /usr/local/lib/pkgconfig
- do
- echo "Looking in $i..."
- if [ -f $i/${module}.pc ]; then
- echo $i
- return
- fi
- done
-}
-
-function install_package() {
- tarfile=$1
- dirname=$2
- name=$3
- configure_options=$4
-
- echo "Installing $name..."
- if [ ! -f $here/$tarfile ]; then
- wget http://www.go-mono.org/archive/$tarfile
- fi
-
- # Assume that the package built correctly if the dir is there
- if [ ! -d $here/$dirname ]; then
- # Build and install package
- tar xzf $here/$tarfile || exit -1
- (cd $here/$dirname; ./configure --prefix=$here/install $configure_options || exit -1; make || exit -1; make install || exit -1)
- success=$?
- if [ $success -ne 0 ]; then
- echo "***** $name build failure. Run rm -rf $here/$dirname to have this script attempt to build $name again next time"
- exit -1
- fi
- fi
-}
-
-if aclocal_scan pkg.m4 ; then
- install_pkgconfig=no
-else
- install_pkgconfig=yes
-fi
-
-if aclocal_scan glib-2.0.m4 ; then
- install_glib=no
- if [ $install_pkgconfig = "yes" ]; then
- # We have to tell the newly-installed pkgconfig about the
- # system-installed glib
- PKG_CONFIG_PATH=`pkgconfig_scan glib-2.0`:$PKG_CONFIG_PATH
- fi
-else
- install_glib=yes
- PKG_CONFIG_PATH="$here/install/lib/pkgconfig:$PKG_CONFIG_PATH"
-fi
-
-if [ -f /usr/include/gc/gc.h ]; then
- install_libgc=no
-else
- install_libgc=yes
-fi
-
-if [ $install_pkgconfig = "yes" -o $install_glib = "yes" ]; then
- ACLOCAL_FLAGS="-I $here/install/share/aclocal $ACLOCAL_FLAGS"
-fi
-
-export PATH
-export LD_LIBRARY_PATH
-export ACLOCAL_FLAGS
-export PKG_CONFIG_PATH
-
-CPPFLAGS="$CPPFLAGS -I$here/install/include"
-LDFLAGS="$LDFLAGS -L$here/install/lib"
-export CPPFLAGS
-export LDFLAGS
-
-# Grab pkg-config-0.8, glib-1.3.12 if necessary
-
-if [ $install_pkgconfig = "yes" ]; then
- install_package pkgconfig-0.8.0.tar.gz pkgconfig-0.8.0 pkgconfig ""
-else
- echo "Not installing pkgconfig, you already seem to have it installed"
-fi
-
-if [ $install_glib = "yes" ]; then
- install_package glib-1.3.13.tar.gz glib-1.3.13 glib ""
-else
- echo "Not installing glib, you already seem to have it installed"
-fi
-
-if [ $install_libgc = "yes" ]; then
- LIBS="-ldl" install_package gc6.0.tar.gz gc6.0 libgc "--enable-threads=pthreads"
- # make install didnt do the headers!
- mkdir -p $here/install/include/gc
- cp -r $here/gc6.0/include/* $here/install/include/gc
-else
- echo "Not installing libgc, you already seem to have it installed"
-fi
-
-# End of build dependencies, now get the latest mono checkout and build that
-
-test -z "$CVSROOT" && CVSROOT=:pserver:anonymous@anoncvs.go-mono.com:/mono
-export CVSROOT
-
-echo "Updating mono"
-
-# cvs checkout does the same as cvs update, except that it copes with
-# new modules being added
-
-# Older versions of cvs insist on a cvs login for :pserver: methods
-# Make sure cvs is using ssh for :ext: methods
-
-if [ ${CVSROOT:0:5} = ":ext:" ]; then
- CVS_RSH=ssh
- export CVS_RSH
-elif [ ${CVSROOT:0:9} = ":pserver:" ]; then
- # Chop off the trailing /mono because cvs 1.11 adds the port number
- # into the .cvspass line
- if ! grep ${CVSROOT%:/mono} ~/.cvspass > /dev/null 2>&1 ; then
- echo "Logging into CVS server. Anonymous CVS password is probably empty"
- cvs login
- fi
-fi
-
-cvs checkout mono || exit -1
-
-# Build and install mono
-echo "Building and installing mono"
-
-(cd $here/mono; ./autogen.sh --prefix=$here/install || exit -1; make || exit -1; make install || exit -1) || exit -1
-
-
-echo ""
-echo ""
-echo "All done."
-echo "Add $here/install/bin to \$PATH"
-echo "Add $here/install/lib to \$LD_LIBRARY_PATH"
-echo "Don't forget to copy the class libraries to $here/install/lib"
-
diff --git a/doc/mono-common-problems b/doc/mono-common-problems
deleted file mode 100644
index b528a6cebed..00000000000
--- a/doc/mono-common-problems
+++ /dev/null
@@ -1,160 +0,0 @@
- Common Problems with Mono (see the bottom)
- ------------------------------------------
-
-
- (c) 2002, Jaime Anguiano Olarra
- <jaime@geneura.ugr.es>
-
-
-Getting it:
-
- There are several ways to get Mono running on your computer.
- Although the purpose of this document I will add some info
- here for completness. After all you need the software if you
- want to get in trouble :).
-
- RPMs or DEBs can be found at Baselabs <a href="http://mono.baselabs.org/index.php/software">http://mono.baselabs.org/index.php/software</a>.
-
- See <a href="http://www.go-mono.com/download">http://www.go-mono.com/download</a> for more information.
-
-Installing it:
-
- Here comes the real fun. This is what some people have claimed for as
- a 'foolproff way to get started'.
-
- First, assume you have the packages.
- You must know that:
-
- 1.- Mono can be compiled in Linux and Windows but mcs
- cannot. Please don't write to the list telling that
- you have downloaded the mcs-X.XX.tar.gz and that
- you can't build it. It's a 'status' problem. The
- mcs compiler can't be compiled under Linux yet.
- This means, entering in mcs-X.XX and running 'make'
- will show you something as:
-
- [jaime@localhost mcs-0.12]$ make
- for i in jay nant mcs class nunit tools; do
- \ (cd $i; make linux) || exit 1; \
- done
- make[1]: Cambiando a directorio `/home/jaime/utils/mcs-0.12/jay'
- make[1]: No se hace nada para `linux'.
- make[1]: Saliendo directorio `/home/jaime/utils/mcs-0.12/jay'
- make[1]: Cambiando a directorio `/home/jaime/utils/mcs-0.12/nant'
- csc /out:NAnt.exe /recurse:*.cs
- /bin/sh: csc: command not found
- make[1]: *** [NAnt.exe] Error 127
- make[1]: Saliendo directorio `/home/jaime/utils/mcs-0.12/nant'
- make: *** [linux] Error 1
-
-
- 2.- You need to get the packages refered in the Mono
- download page. These are: glib 1.3, pkgconfig...
-
- Second, read all the READMEs and INSTALLs.
-
- For short, you will normally will be able to install the RPMs and DEBs as
- usual:
-
- rpm -Uhv mono-X.XX_baselabs-XXXXXXXX.rpm
-
- See the BaseLabs page for a full explanation.
-
- Building your own binaries it's easy too!.
- Unzip and untar the tarball (will work only for Mono, remember!!)
-
- tar -zxvf mono-X.XX.tar.gz
-
- Enter the directory where the sources reside:
-
- cd mono-X.XX
-
- Run the configure script:
-
- ./configure.in
-
- Then make the package:
-
- make
-
- Now you are able to install it:
-
- make install
-
- Remember once again. mcs cannot be compiled under Linux. You need a Windows system
- where to build it. The only way for you to get the mcs in Linux without building
- it by your own in a Windows machine (including the VMWare alternative) is to install
- the binaries from the BaseLabs page. It's also important to say that there are
- NUnit packages too in that site but that you probably won't need to care about that
- if you are reading this document.
-
-Running it:
-
- If you want to compile a little program using the mcs, let's say "konnichiwa.cs"
- do this:
-
- mcs konnichiwa.cs
-
- The output will depend on wether your program is compilable or not, if it is a
- "RESULT: 0" will be printed in your gnome-terminal (or whatever 'console' you use).
- You should see a file called "konnichiwa.exe" in the same directory (folder) where
- the source (konnichiwa.cs) is.
-
- To run the binary you have to options. The most used is:
-
- mono konnichiwa.exe
-
- but it might be better to use this other approach instead (calling the interpreter):
-
- mint konnichiwa.exe
-
- That's it. The Mono mcs compiler allows you to perform more complicated compilations
- and I will show an example using three source files. Suppose you have three files:
- person.cs, employee.cs, Test.cs. The first one could contain an abstract class Person
- while the second one could be the source for a concrete class derived from Person and
- called Employee. The last one, Test.cs could be a simple class to show how the classes
- work and it contains an entry point (the Main() method, signed with the appropiate
- attributes 'public static' and the correct type 'void'). Then you could get the
- Text.exe program by calling:
-
- mcs Test.cs person.cs employee.cs
-
- You might want to see my slides, source code and other material from the course on
- CSharp I am preparing to teach at the University of Granada, Spain. If you are a newbie
- HTH.
-
-A note about problems:
-
- First see the <a href="http://bugzilla.ximian.com">Ximian Bugzilla</a> page in order
- to get know if the bug has already been reported.
-
- Second, read this document.
-
- Third, visit the mono mailing lists' archives and do a little research in there for
- threads talking about the problems you are having.
-
- Fourth if you still cannot override the problem, contact the lists.
-
-Known problems:
-
- 1.- mcs fails to compile in Linux.
-
- sol. mcs cannot compile in Linux. Try to install the already made packages
- from http://mono.baselabs.org/index.php/software
-
- 2.- mono fails to compile in my Linux box.
-
- sol. Uhg... a generic 'question'. Proceed as above. (note for geeks: GOTO: 1.-)
-
- 3.- I cannot install mono under RedHat 7.3.
-
- sol. Try to upgrade your libc6 packages. In general, check that you have the
- right versions for the packages glib, pkgconfig, libc...
-
- 4.- I cannot compile mcs nor mono under Windows. Are you fooling me?.
-
- sol. No, we are not. Have you read carefully the <a href="http://www.go-mono.com">download</a>
- page?. You need CygWin among other things. Check all of that before
- trying to compile.
-
-
diff --git a/doc/mono-contribution-howto b/doc/mono-contribution-howto
deleted file mode 100644
index 7a48fcd32aa..00000000000
--- a/doc/mono-contribution-howto
+++ /dev/null
@@ -1,505 +0,0 @@
-
- <Mono newbie coders start file>
-
-
- For those who are new to Mono and are impatient to contribute
- with code (uhh... you are brave!!) here is the document you
- should read.
-
-
- You will see all Mono hackers say the same (great minds have
- similar way of thinking): First, DO WRITE TESTS!!!. In order
- to do that:
-
- <ul>
- * Start with the NUnit Tests Guidelines. In the cvs
- they are located at: mcs/class/doc/NUnitGuideli...
-
- But wait, this is a document for impatient
- people. So EVERYTHING should be here. Well, it is.
- </ul>
-
--------------------- cut here --------------------
-
-Mono NUnit Test Guidelines and Best Practices
-
-Authors: Nick Drochak <ndrochak@gol.com>
- Martin Baulig <martin@gnome.org>
-Last Update: 2002-03-02
-Rev: 0.3
-
-* Purpose
-
-This document captures all the good ideas people have had about
-writing NUnit tests for the mono project. This document will be useful
-for anyone who writes or maintains unit tests.
-
-* Other resources
- - mcs/class/README has an explanation of the build process and
- how it relates to the tests.
- - http://nunit.sourceforge.net is the place to find out about NUnit
-
-* Getting Started
-
-If you are new to writing NUnit tests, there is a template you may use
-to help get started. The file is:
-
- mcs/class/doc/TemplateTest.cs
-
-
- (2.- This is the point two!. This file is just after the end of the
- guidelines. Copy/paste it in another buffer. And keep reading.)
-
-
-Save a copy of this file in the appropriate test subdirecty (see
-below), and replace all the [text] markers with appropriate
-code. Comments in the template are there to guide you. You should also
-look at existing tests to see how other people have written them.
-mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs is a
-small one that might help.
-
- (3.- You reached the third point. And as expected, it's just here to
- tell you that the content of CollectionBaseTest.cs is after the
- TemplateTest.cs code at the end of these guidelines.)
-
-The directory that will contain your new file depends on the
-assembly/namespace of the class for which you are creating the
-tests. Under mcs/class there is a directory for each assembly. In each
-assembly there is a Test directory, e.g. mcs/class/corlib/Test. In the
-Test directory there are sub-directories for each namespace in the
-assembly, e.g. mcs/class/corlib/Test/Sytem. Put your new test file in
-the appropriate sub-directory under Test for the class you are
-testing.
-
-Once your test class is complete, you need to add it to the
-AllTests.cs file in the same directory as your new test. Add a call to
-"suite.AddTest()" passing the name of your new test class's suite
-property as the parameter. You will see examples in the AllTests.cs
-file, so just copy and paste inside there.
-
-Once all of that is done, you can do a 'make test' from the top mcs
-directory. Your test class will be automagically included in the
-build and the tests will be run along with all the others.
-
-* Tips
-
-** Provide an unique error message for Assert()
-
-Include an unique message for each Assert() so that when the assert
-fails, it is trivial to locate the failing one. Otherwise, it may be
-difficult to determine which part of the test is failing. A good way
-to ensure unique messages is to use something like #A01, #A02 etc.
-
- Bad:
-<pre>
- AssertEquals("array match", compare[0], i1[0]);
- AssertEquals("array match", compare[1], i1[1]);
- AssertEquals("array match", compare[2], i1[2]);
- AssertEquals("array match", compare[3], i1[3]);
-</pre>
- Good:
-<pre>
- AssertEquals("#A01", compare[0], i1[0]);
- AssertEquals("#A02", compare[1], i1[1]);
- AssertEquals("#A03", compare[2], i1[2]);
- AssertEquals("#A04", compare[3], i1[3]);
-</pre>
-Once you used such a number in an Assert(), don't change it later on -
-people might use it it identify the test in bug reports or in mailing
-lists.
-
-** Use AssertEquals() to compare things, not Assert().
-
-Never compare two values with Assert() - if the test fails, people
-have no idea what went wrong while AssertEquals() reports the failed
-value.
-
- Bad:
-<pre>
- Assert ("A01", myTicks[0] == t1.Ticks);
-</pre>
- Good:
-<pre>
- AssertEquals ("A01", myTicks[0], t1.Ticks);
-</pre>
-
-** Constructors
-
-When writing your testcase, please make sure to provide a constructor
-which takes no arguments:
-
-<pre>
- public class DateTimeTest : TestCase
- {
-
- public DateTimeTest() : base ("[MonoTests.System.DateTimeTest]") {}
- public DateTimeTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- TestSuite suite = new TestSuite ();
- return suite;
- }
- }
- }
-</pre>
-
-* Namespace
-
- Please keep the namespace within each test directory
- consistent - all tests which are referenced in the same
- AllTests.cs must be in the same namespace. Of course you can
- use subnamespaces as you like - especially for subdirectories
- of your testsuite.
-
- For instance, if your AllTests.cs is in namespace "MonoTests"
- and you have a subdirectory called "System", you can put all
- the tests in that dir into namespace "MonoTests.System".
-
-* Test your test with the microsoft runtime
-
- If possible, try to run your testsuite with the Microsoft
- runtime on Windows and make sure all tests in it pass. This is
- especially important if you're writing a totally new testcase
- - without this check you can never be sure that your testcase
- contains no bugs ....
-
- Don't worry if you're writing your test on Linux, other people
- can test it for you on Windows.
-
- Sometimes you may discover that a test doesn't show the
- expected result when run with the Microsoft runtime - either
- because there is a bug in their runtime or something is
- misleading or wrong in their documentation. In this case,
- please put a detailed description of the problem to
- mcs/class/doc/API-notes and do also report it to the list -
- we'll forward this to the Microsoft people from time to time
- to help them fix their documentation and runtime.
-
--------------------- cut here ------------------------
-
-<pre>
--------------------- TemplateTest.cs begins ----------
-
-// this is a template for making NUnit tests. Text enclosed in square
-// brackets (and the brackets themselves) should be replaced by appropiate
-// code.
-
-// [File Name].cs - NUnit Test Cases for [explain here]
-//
-// [Author Name] ([Author email Address])
-//
-// (C) [Copyright holder]
-//
-
-// these are the standard namespaces you will need. You may need to add more
-// depending on your tests.
-using NUnit.Framework;
-using System;
-
-// all test namespaces start with "MonoTests." Append the Namespace that
-// contains the class you are testing, e.g. MonoTests.System.Collections
-namespace MonoTests.[Namespace]
-{
-
-// the class name should end with "Test" and start with the name of the class
-// you are testing, e.g. CollectionBaseTest
-public class [Class to be tested]Test : TestCase {
-
- // there should be two constructors for your class. The first one
- // (without parameters) should set the name to something unique.
- // Of course the name of the method is the same as the name of the
- // class
- public [Constructor]() : base ("[Namespace.Class]") {}
- public [Constructor](string name) : base(name) {}
-
- // this method is run before each Test* method is called. You can put
- // variable initialization, etc. here that is common to each test.
- // Just leave the method empty if you don't need to use it.
- protected override void SetUp() {}
-
- // this method is run after each Test* method is called. You can put
- // clean-up code, etc. here. Whatever needs to be done after each test.
- // Just leave the method empty if you don't need to use it.
- protected override void TearDown() {}
-
- // this property is required. You need change the parameter for
- // typeof() below to be your class.
- public static ITest Suite {
- get {
- return new TestSuite(typeof([Classname here]));
- }
- }
-
- // this is just one of probably many test methods in your test class.
- // each test method must start with "Test". All methods in your class
- // which start with "Test" will be automagically called by the NUnit
- // framework.
- public void Test[Something] {
- // inside here you will exercise your class and then call Assert()
- }
-}
-
----------------------- TemplateTest.cs ends --------------
----------------------- CollectionBaseTest.cs begins ------
-//
-// System.Collections.CollectionBase
-// Test suite for System.Collections.CollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
-
-public class CollectionBaseTest : TestCase
-{
- public CollectionBaseTest () : base ("System.Collection.CollectionBase testsuite") {}
- public CollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteCollection : CollectionBase
- {
- // These fields are used as markers to test the On* hooks.
- public bool onClearFired;
- public bool onClearCompleteFired;
-
- public bool onInsertFired;
- public int onInsertIndex;
- public bool onInsertCompleteFired;
- public int onInsertCompleteIndex;
-
- public bool onRemoveFired;
- public int onRemoveIndex;
- public bool onRemoveCompleteFired;
- public int onRemoveCompleteIndex;
-
- public bool onSetFired;
- public int onSetOldValue;
- public int onSetNewValue;
- public bool onSetCompleteFired;
- public int onSetCompleteOldValue;
- public int onSetCompleteNewValue;
-
- // This constructor is used to test OnValid()
- public ConcreteCollection()
- {
- IList listObj;
- listObj = this;
- listObj.Add(null);
- }
-
- // This constructor puts consecutive integers into the list
- public ConcreteCollection(int i) {
- IList listObj;
- listObj = this;
-
- int j;
- for (j = 0; j< i; j++) {
- listObj.Add(j);
- }
- }
-
- // A helper method to look at a value in the list at a specific index
- public int PeekAt(int index)
- {
- IList listObj;
- listObj = this;
- return (int) listObj[index];
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClear() {
- this.onClearFired = true;
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClearComplete()
- {
- this.onClearCompleteFired = true;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsert(int index, object value)
- {
- this.onInsertFired = true;
- this.onInsertIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsertComplete(int index, object value)
- {
- this.onInsertCompleteFired = true;
- this.onInsertCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemove(int index, object value)
- {
- this.onRemoveFired = true;
- this.onRemoveIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemoveComplete(int index, object value)
- {
- this.onRemoveCompleteFired = true;
- this.onRemoveCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSet(int index, object oldValue, object newValue)
- {
- this.onSetFired = true;
- this.onSetOldValue = (int) oldValue;
- this.onSetNewValue = (int) newValue;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSetComplete(int index, object oldValue, object newValue)
- {
- this.onSetCompleteFired = true;
- this.onSetCompleteOldValue = (int) oldValue;
- this.onSetCompleteNewValue = (int) newValue;
- }
- } // public class ConcreteCollection
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof(CollectionBaseTest));
- }
- }
-
- // Check the count property
- public void TestCount() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(4 == myCollection.Count);
- }
-
- // Make sure GetEnumerator returns an object
- public void TestGetEnumerator() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(null != myCollection.GetEnumerator());
- }
-
- // OnValid disallows nulls
- public void TestOnValid() {
- ConcreteCollection myCollection;
- try {
- myCollection = new ConcreteCollection();
- }
- catch (ArgumentNullException) {
- }
- }
-
- // Test various Insert paths
- public void TestInsert() {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // The constructor inserts
- myCollection = new ConcreteCollection(numberOfItems);
- Assert(myCollection.onInsertFired);
- Assert(myCollection.onInsertCompleteFired);
-
- // Using the IList interface, check inserts in the middle
- IList listObj = myCollection;
- listObj.Insert(1, 9);
- Assert(myCollection.onInsertIndex == 1);
- Assert(myCollection.onInsertCompleteIndex == 1);
- Assert(myCollection.PeekAt(1) == 9);
- }
-
- // Test Clear and it's hooks
- public void TestClear()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 1;
- myCollection = new ConcreteCollection(numberOfItems);
- myCollection.Clear();
- Assert(myCollection.Count == 0);
- Assert(myCollection.onClearFired);
- Assert(myCollection.onClearCompleteFired);
- }
-
- // Test RemoveAt, other removes and the hooks
- public void TestRemove()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // Set up a test collection
- myCollection = new ConcreteCollection(numberOfItems);
-
- // The list is 0-based. So if we remove the second one
- myCollection.RemoveAt(1);
-
- // We should see the original third one in it's place
- Assert(myCollection.PeekAt(1) == 2);
- Assert(myCollection.onRemoveFired);
- Assert(myCollection.onRemoveIndex == 1);
- Assert(myCollection.onRemoveCompleteFired);
- Assert(myCollection.onRemoveCompleteIndex == 1);
- IList listObj = myCollection;
- listObj.Remove(0);
- // Confirm parameters are being passed to the hooks
- Assert(myCollection.onRemoveIndex == 0);
- Assert(myCollection.onRemoveCompleteIndex == 0);
- }
-
- // Test the random access feature
- public void TestSet()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- myCollection = new ConcreteCollection(numberOfItems);
- IList listObj = myCollection;
- listObj[0] = 99;
- Assert((int) listObj[0] == 99);
- Assert(myCollection.onSetFired);
- Assert(myCollection.onSetCompleteFired);
- Assert(myCollection.onSetOldValue == 0);
- Assert(myCollection.onSetCompleteOldValue == 0);
- Assert(myCollection.onSetNewValue == 99);
- Assert(myCollection.onSetCompleteNewValue == 99);
- }
-}
-
-}
------------------------ CollectionBaseTest.cs ends --------
-</pre>
- <ul>
- * If you use Emacs, you might want to use the .emacs file and the
- package developed by Brad Merrill mailto:zbrad@cybercom.net. It
- will allow you to highlight and indent in C# style in your Emacs
- editor. (XEmacs will still work but it'll also complain).
-
- * CSharpDevelop is a GPLed IDE developed by IC#Code. Search for it
- at sourceforge if you are interested in it.
-
- * For those who Java: "A comparison of Microsoft's C# programming
- language to Sun Microsystem's Java Programming language" by Dare
- Obasanjo is a really good (very complete) text to read.
-
- * Suggest this point and more, now I can't think of anything more.
- </ul>
-
- Enjoy!!.
-
- (c) Jaime Anguiano Olarra.
-
- The parts included in this document are property of their respective authors.
-
diff --git a/doc/monodoc-xml b/doc/monodoc-xml
deleted file mode 100644
index e8a5ffe2c71..00000000000
--- a/doc/monodoc-xml
+++ /dev/null
@@ -1,755 +0,0 @@
-* MonoDoc XML Tag Reference
-
-** Introduction
-
-<em>
-[This documentation is in progress. Comments to
-<a href="mailto:jbarn@httcb.net">jbarn@httcb.net</a> and/or
-<a href="mailto:mono-docs-list@ximian.com">mono-docs-list@ximian.com</a>.]
-</em>
-
-MonoDoc XML, our format for multilingual API documentation stored outside of
-source files, is very similar to the output of Microsoft's csc /doc. Minor
-alterations have been made to ease human parsing and hand-editing, but
-the majority of the tags are identical. In fact, many of the descriptions
-and examples below are taken from the ECMA C# Language Specification with
-little or no alteration.
-
-This document provides a list of all available MonoDoc XML tags, with
-syntax and examples. A complete example can be found in
-<a href="#appendix-a">Appendix A</a>, and both a <a href="#">DTD</a> and
-<a href="#">XSD schema</a> will be available very shortly.
-
-** MonoDoc XML Tags
-
-<dl>
-<dt><code><a href="#c">&lt;c&gt;</a></code></dt>
-<dd>Mark short sections of text as code.</dd>
-
-<dt><code><code><a href="#code">&lt;code&gt;</a></code></dt></code>
-<dd>Mark one or more lines as code or output.</dd>
-
-<dt><code><a href="#doc">&lt;doc&gt;</a></dt></code>
-<dd>Root element of documentation XML.</dd>
-
-<dt><code><a href="#event">&lt;event&gt;</a></dt></code>
-<dd>Describe an event.</dd>
-
-<dt><code><a href="#example">&lt;example&gt;</a></dt></code>
-<dd>An example.</dd>
-
-<dt><code><a href="#exception">&lt;exception&gt;</a></dt></code>
-<dd>Specify an exception a method can throw.</dd>
-
-<dt><code><a href="#field">&lt;field&gt;</a></dt></code>
-<dd>Describe a field.</dd>
-
-<dt><code><a href="#list">&lt;list&gt;</a></dt></code>
-<dd>Create a list or table.</dd>
-
-<dt><code><a href="#method">&lt;method&gt;</a></dt></code>
-<dd>Describe a method.</dd>
-
-<dt><code><a href="#para">&lt;para&gt;</a></dt></code>
-<dd>Allow text to be structured in paragraphs.</dd>
-
-<dt><code><a href="#param">&lt;param&gt;</a></dt></code>
-<dd>Specify a parameter for a method.</dd>
-
-<dt><code><a href="#paramref">&lt;paramref&gt;</a></dt></code>
-<dd>Mark a word as a parameter.</dd>
-
-<dt><code><a href="#permission">&lt;permission&gt;</a></dt></code>
-<dd>Define the access level of a member.</dd>
-
-<dt><code><a href="#property">&lt;property&gt;</a></dt></code>
-<dd>Describe a property.</dd>
-
-<dt><code><a href="#remarks">&lt;remarks&gt;</a></dt></code>
-<dd>Provide verbose information for a type or member.</dd>
-
-<dt><code><a href="#returns">&lt;returns&gt;</a></dt></code>
-<dd>Specify the return value of a method.</dd>
-
-<dt><code><a href="#see">&lt;see&gt;</a></dt></code>
-<dd>Specify a link.</dd>
-
-<dt><code><a href="#seealso">&lt;seealso&gt;</a></dt></code>
-<dd>Specify a 'see also' entry.</dd>
-
-<dt><code><a href="#summary">&lt;summary&gt;</a></dt></code>
-<dd>Provide a brief (usually one sentence) description of a member or type.</dd>
-
-<dt><code><a href="#type">&lt;type&gt;</a></dt></code>
-<dd>Describe a type.</dd>
-</dl>
-
-** Definitions and Examples
-
-*** <a name="c">&lt;c&gt;</a>
-
-This tag can be used to mark short, inline fragments of text that should
-be considered source code or program output. User agents should render
-this tag in a special -- likely monospace -- font. For larger sections,
-use <a href="#code"><code>&lt;code&gt;</code></a>.
-
-**** Syntax
-
-<pre>
-&lt;c&gt;code or output text&lt;/c&gt;
-</pre>
-
-**** Example
-
-<pre>
-&lt;remarks&gt;
- Class &lt;c&gt;Point&lt;/c&gt; models a point in two-dimensional space.
-&lt;/remarks&gt;
-</pre>
-
-*** <a name="code">&lt;code&gt;</a>
-
-This tag can be used to mark one or more lines of text as source code or
-program output. User agents should render this tag in a special (likely
-monospace) font, and preserve both whitespace and newlines.
-
-**** Syntax
-
- <code>&lt;code&gt;source or program output&lt;/code&gt;</code>
-
-**** Example
-
-<pre>
-&lt;summary&gt;
- This method changes the point's location by the given
- x- and y-offsets.
- &lt;example lang="C#"&gt;
- A C# example:
- &lt;code&gt;
- Point p = new Point(3, 5);
- p.Translate(-1, 3);
- // p == (2, 8);
- &lt;/code&gt;
- &lt;/example&gt;
-&lt;/summary&gt;
-</pre>
-
-*** <a name="doc">&lt;doc&gt;</a>
-
-This tag is the root element of the documentation file. It can contain
-any number of &lt;type&gt; elements.
-
-**** Syntax
-
-<code>&lt;doc lang="language" assembly="assembly"&gt;typedocs&lt;/doc&gt;</code>
-
-<blockquote>
-<em>lang="language"</em><br />
-The two-letter ISO code that specifies what language the contained
-documentation is written in.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;doc lang="en"&gt;
- &lt;type name="Graphics.Point"&gt;
- &lt;!-- ... --&gt;
- &lt;/type&gt;
-&lt;/doc&gt;
-</pre>
-
-*** <a name="event">&lt;event&gt;</a>
-
-This tag documents an event.
-
-**** Syntax
-
-<code>&lt;event name="eventname"&gt;documentation&lt;/event&gt;</code>
-
-<blockquote>
-<em>name="eventname"</em><br />
-The name of the event being documented.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;event name="Click"&gt;
- &lt;summary&gt;
- Occurs when the control is clicked.
- &lt;/summary&gt;
- &lt;data&gt;
- The event handler receives an argument of type EventArgs
- containing data related to this event.
- &lt;/data&gt;
- &lt;remarks&gt;
- &lt;para&gt;The ControlStyles.StandardClick style must be set
- for this event to be raised.&lt;/para&gt;
- &lt;para&gt;For more information about handling events, see
- Consuming Events.&lt;/para&gt;
- &lt;/remarks&gt;
-&lt;/event&gt;
-</pre>
-
-*** <a name="example">&lt;example&gt;</a>
-
-This tag marks a section of text as an example, and optionally specifies
-what programming language <code><a href="#code">&lt;code&gt;</a></code> portions of the example are written in.
-
-**** Syntax
-
-<code><example lang="language">example text and code</example></code>
-
-<blockquote>
-<em>lang="language"</em><br />
-(optional) The name of the programming language <code><a href="#code">&lt;code&gt;</a></code> blocks in this example
-use. This information can be used by user agents to provide
-intelligent access to examples in multiple languages.
-</blockquote>
-
-**** Example
-
-See <code><a href="#code">&lt;code&gt;<a/></code> for an example.
-
-*** <a name="exception">&lt;exception&gt;</a>
-
-This tag provides a way to specify the exceptions a method can throw.
-
-**** Syntax
-
-<code>&lt;exception cref="exception-type"&gt;description&lt;/exception&gt;</code>
-
-<blockquote>
-<em>cref="exception-type"</em><br />
-The name of an exception type.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;exception cref="System.IO.FileNotFoundException"&gt;
- Thrown when the requested file is not found.
-&lt;/exception&gt;
-</pre>
-
-*** <a name="field">&lt;field&gt;</a>
-
-This tag is used to describe a field.
-
-**** Syntax
-
-<code>&lt;field name="fieldname"&gt;documentation&lt;/field&gt;</code>
-
-<blockquote>
-<em>name="fieldname"</em><br />
-The name of the field being documented.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;field name="x"&gt;
- &lt;summary&gt;
- Instance variable &lt;c&gt;x&lt;/c&gt; represents the point's
- x-coordinate.
- &lt;/summary&gt;
-&lt;/field&gt;
-</pre>
-
-*** <a name="list">&lt;list&gt;</a>
-
-This tag is used to create a list or table of items. It may contain a
-<code>&lt;listheader&gt;</code> block to define the heading row of either a table or
-definition list. (When defining a table, only an entry for 'term' in the
-heading need be supplied.)
-
-Each item in the list is specified with an <code>&lt;item&gt;</code> block. When creating a
-definition list, both <code>&lt;term&gt;</code> and <code>&ltdescription&gt;</code> must be specified.
-However, for a table, bulleted list, or numbered list, only <code>&lt;description&gt;</code>
-need be specified.
-
-**** Syntax
-
-<pre>
-&lt;list type="bullet" | "number" | "table"&gt;
- &lt;listheader&gt;
- &lt;term&gt;term&lt;/term&gt;
- &lt;description&gt;description&lt;/description&gt;
- &lt;/listheader&gt;
- &lt;item&gt;
- &lt;term&gt;term&lt;/term&gt;
- &lt;description&gt;description&lt;/description&gt;
- &lt;/item&gt;
-
- ...
-
-&lt;/list&gt;
-</pre>
-
-<blockquote>
-<em>term</em><br />
-The term to define, whose definition is in <code>&lt;description&gt;</code>.
-<br /><br />
-<em>description</em><br />
-Either an item in a bullet or numbered list, or the definition of a <code>&lt;term&gt;</code>.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;list type="bullet"&gt;
- &lt;item&gt;
- &lt;description&gt;Item 1&lt;/description&gt;
- &lt;/item&gt;
- &lt;item&gt;
- &lt;description&gt;Item 2&lt;/description&gt;
- &lt;/item&gt;
-&lt;/list&gt;
-</pre>
-
-*** <a name="method">&lt;method&gt;</a>
-
-This tag is the overall containing tag for documenting a method.
-
-**** Syntax
-
-<code>&lt;method name="methodname"&gt;documentation&lt;/method&gt;</code>
-
-**** Example
-
-<pre>
-&lt;method name="op_Equality(Graphics.Point,Graphics.Point)"&gt;
- &lt;summary&gt;
- This operator determines whether two points have
- the same location.
- &lt;/summary&gt;
- &lt;param name="p1"&gt;
- &lt;c&gt;p1&lt;/c&gt; is the first Point to be compared.
- &lt;/param&gt;
- &lt;param name="p2"&gt;
- &lt;c&gt;p2&lt;/c&gt; is the second Point to be compared.
- &lt;/param&gt;
- &lt;returns&gt;
- True if the points have the same location and they
- have the exact same type; otherwise, false.
- &lt;/returns&gt;
- &lt;seealso cref="Equals(System.Object)" /&gt;
- &lt;seealso cref="op_Inequality(Graphics.Point,Graphics.Point)" /&gt;
-&lt;/method&gt;
-</pre>
-
-*** <a name="para">&lt;para&gt;</a>
-
-
-This tag is for use inside other tags such as <code>&lt;remarks&gt;</code> or <code>&lt;returns&gt;</code>, and
-allows text to be structured into paragraphs.
-
-**** Syntax
-
-<code>&lt;para&gt;text&lt;/para&gt;</code>
-
-**** Example
-
-<pre>
-&lt;summary&gt;
- &lt;para&gt;
- This is the entry point of the &lt;c&gt;Point&lt;/c&gt; class testing
- program.
- &lt;/para&gt;
- &lt;para&gt;
- This program tests each method and operator, and
- is intended to be run after any non-trivial maintenance has
- been performed on the &lt;c&gt;Point&lt;/c&gt; class.
- &lt;/para&gt;
-&lt;/summary&gt;
-</pre>
-
-*** <a name="param">&lt;param&gt;</a>
-
-This tag is used to describe a parameter for a method, constructor, or
-indexer.
-
-**** Syntax
-
-<code>&lt;param name="name"&gt;description&lt;/param&gt;</code>
-
-<blockquote>
-<em>name</em><br />
-The name of the parameter.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;summary&gt;
- This is the entry point of the &lt;c&gt;Point&lt;/c&gt;
- class.
-&lt;/summary&gt;
-&lt;param name="xor"&gt;&lt;c&gt;xor&lt;/c&gt; is the new x-coordinate.&lt;/param&gt;
-&lt;param name "yor"&gt;&lt;c&gt;yor&lt;/c&gt; is the new y-coordinate.&lt;/param&gt;
-</pre>
-
-*** <a name="paramref">&lt;paramref&gt;</a>
-
-This tag is used to indicate that a word is a parameter. User agents
-could use this information for special formatting or hyperlink insertion.
-
-**** Syntax
-
-<code>&lt;paramref name="name" /&gt;</code>
-
-<blockquote>
-<em>name</em><br />
-The name of the parameter.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;summary&gt;
- This constructor initializes the new Point to
- (&lt;paramref name="xor" /&gt;,&lt;paramref name="yor" /&gt;).
-&lt;/summary&gt;
-&lt;param name="xor"&gt;&lt;c&gt;xor&lt;/c&gt; is the new x-coordinate.&lt;/param&gt;
-&lt;param name "yor"&gt;&lt;c&gt;yor&lt;/c&gt; is the new y-coordinate.&lt;/param&gt;
-</pre>
-
-*** <a name="permission">&lt;permission&gt;</a>
-
-This tag allows the security accessibility of a member to be documented.
-
-**** Syntax
-
-<code>&lt;permission cref="member"&gt;description&lt;/permission&gt;</code>
-
-<blockquote>
-<em>cref="member"</em><br />
-The name of a member.</br>
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;permission cref="System.Security.PermissionSet"&gt;
- Everyone can access this method.
-&lt;/permission&gt;
-</pre>
-
-*** <a name="property">&ltproperty&gt;</a>
-
-This tag is the overall containing tag for documenting a property.
-
-**** Syntax
-
-<code>&lt;property name="propertyname"&gt;documentation&lt;/property&gt;</code>
-
-<blockquote>
-<em>name="propertyname"</em><br />
-The name of the property.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;property name="X"&gt;
- &lt;summary&gt;
- Gets or sets the point's x-coordinate.
- &lt;value&gt;
- The point's x-coordinate.
- &lt;/value&gt;
-&lt;/property&gt;
-</pre>
-
-
-*** <a name="remarks">&lt;remarks&gt;</a>
-
-This tag contains extended discussion and information about a member or
-a type. <em>[jbarn: This differs from both the ECMA docs and
-portions of Microsoft's documentation, but seems consistent with both
-common usage, and, more importantly, NDoc convention.]</em>
-
-**** Syntax
-
-<code>&lt;remarks&gt;description&lt;/remarks&gt;</code>
-
-**** Example
-
-<pre>
-&lt;type name="Graphics.Point"&gt;
- &lt;summary&gt;
- Models a point in a two-dimensional plane.
- &lt;/summary&gt;
- &lt;remarks&gt;
- Herein I might have an extended discussion of
- the validity of Cartesian coordinate systems,
- with examples pro and con, and perhaps
- some code.
- &lt;/remarks&gt;
-
- &lt;!-- ... --&gt;
-&lt;/type&gt;
-</pre>
-
-*** <a name="returns">&lt;returns&gt;</a>
-
-This tag is used to describe the return value of a method.
-
-**** Syntax
-
-<code>&lt;returns&gt;description&lt;/returns&gt;</code>
-
-**** Example
-
-<pre>
-&lt;method name="op_Inequality(Graphics.Point,Graphics.Point)"&gt;
- &lt;summary&gt;
- This operator determines whether two points have the
- same location.
- &lt;/summary&gt;
- &lt;param name="p1"&gt;&lt;c&gt;p1&lt;/c&gt; is the first Point to be compared.&lt;/param&gt;
- &lt;param name="p2"&gt;&lt;c&gt;p2&lt;/c&gt; is the second Point to be compared.&lt;/param&gt;
- &lt;returns&gt;
- True if the points do not have the same location and they
- have the exact same type; otherwise, false.
- &lt;/returns&gt;
-&lt;/method&gt;
-</pre>
-
-*** <a name="see">&lt;see&gt;</a>
-
-This tag allows a link to be specified within documentation text. (Use
-<code>&lt;seealso&gt;</code> to indicate links that should appear in a 'See Also' section.)
-
-**** Syntax
-
-<code>&lt;see cref="destination" /&gt;</code>
-
-<blockquote>
-<em>cref="destination"</em><br />
-A destination, such as a type or a member of a type.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;summary&gt;
- This method changes the point's location to the given
- coordinates. This is an asinine way to insert a link,
- but &lt;see cref="Equals(Object)" /&gt; to understand
- how points are compared.
-&lt;/summary&gt;
-</pre>
-
-*** <a name="seealso">&lt;seealso&gt;</a>
-
-This tag allows an entry to be generated for the 'See Also' section. (Use
-<code>&lt;see&gt;</code> to specify a link from within text.)
-
-**** Syntax
-
-<code>&lt;seealso cref="destination" /&gt;</code>
-
-<blockquote>
-<em>cref="destination"</em><br />
-A destination, such as a type or a member of a type.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;summary&gt;
- This method determines whether two Points have the
- same location.
-&lt;/summary&gt;
-&lt;seealso cref="op_Equality(Graphics.Point,Graphics.Point)" /&gt;
-&lt;seealso cref="op_Inequality(Graphics.Point,Graphics.Point" /&gt;
-</pre>
-
-*** <a name="summary">&lt;summary&gt;</a>
-
-This tag contains a short summary of a member or type,
-often one sentence. <em>[jbarn: This differs from both the ECMA docs and
-portions of Microsoft's documentation, but seems consistent with both
-common usage, and, more importantly, NDoc convention.]</em>
-
-**** Syntax
-
-<code>&lt;summary&gt;description&lt;/summary&gt;</code>
-
-**** Example
-
-<pre>
-&lt;summary&gt;
- This is the entry point of the &lt;c&gt;Point&lt;/c&gt; class testing
- program.
-&lt;/summary&gt;
-&lt;remarks&gt;
- This program tests each method an operator, and is intended
- to be run after any non-trivial maintenance is performed
- on the &lt;c&gt;Point&lt;/c&gt; class.
-&lt;/remarks&gt;
-</pre>
-
-*** <a name="type">&lt;type&gt;</a>
-
-This tag is the overall containing tag for documenting a type.
-
-**** Syntax
-
-<code>&lttype name="typename" assembly="assemblyname"&gt;documentation&lt;/type&gt;</code>
-
-<blockquote>
-<em>name="typename"</em><br />
-The name of the type being documented.
-<br /><br />
-<em>assembly="assemblyname"</em><br />
-The assembly this type resides in. This attribute is not required for nested types.
-</blockquote>
-
-**** Example
-
-<pre>
-&lt;type name="Graphics.Point" assembly="Point"&gt;
- &lt;summary&gt;
- Models a point in two-dimensional space.
- &lt;/summary&gt;
-
- &lt;!-- members --&gt;
-
- &lt;field name="x"&gt;
- &lt;summary&gt;
- Represents the point's x-coordinate.
- &lt;/summary&gt;
- &lt;/field&gt;
-&lt;/type&gt;
-</pre>
-
-** <a name="appendix-a">Appendix A: Complete Example</a>
-
-<em>[jbarn: Please, please, don't take the human-readable portions of
-this example to be good guidelines for writing your own documentation.
-this XML is intended only to show structure.]</em>
-
-<pre>
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;doc lang="en"&gt;
- &lt;type name="Graphics.Point" assembly="Point"&gt;
- &lt;summary&gt;
- Models a point in a two-dimensional plane.
- &lt;/summary&gt;
- &lt;remarks&gt;
- No useful remarks.
- &lt;/remarks&gt;
-
- &lt;!-- fields --&gt;
- &lt;field name="x"&gt;
- &lt;summary&gt;
- Instance variable &lt;c&gt;x&lt;/c&gt; represents the point's x-coordinate.
- &lt;/summary&gt;
- &lt;/field&gt;
-
- &lt;field name="y"&gt;
- &lt;summary&gt;
- Instance variable &lt;c&gt;y&lt;/c&gt; represents the point's y-coordinate.
- &lt;/summary&gt;
- &lt;/field&gt;
-
- &lt;!-- methods --&gt;
- &lt;method name="#ctor"&gt;
- &lt;summary&gt;
- Initializes the new point to &lt;c&gt;(0,0)&lt;/c&gt;.
- &lt;/summary&gt;
- &lt;/method&gt;
-
- &lt;method name="#ctor(System.Int32,System.Int32)"&gt;
- &lt;summary&gt;
- Initializes the new Point to (&lt;paramref name="xor" /&gt;,&lt;paramref name="yor" /&gt;).
- &lt;/summary&gt;
- &lt;param name="xor"&gt;&lt;c&gt;xor&lt;/c&gt; is the new x-coordinate.&lt;/param&gt;
- &lt;param name="yor"&gt;&lt;c&gt;yor&lt;/c&gt; is the new y-coordinate.&lt;/param&gt;
- &lt;/method&gt;
-
- &lt;method name="Move(System.Int32,System.Int32)"&gt;
- &lt;summary&gt;
- This method changes the point's location to the given coordinates.
- &lt;/summary&gt;
- &lt;param name="xor"&gt;&lt;c&gt;xor&lt;/c&gt; is the new x-coordinate.&lt;/param&gt;
- &lt;param name="yor"&gt;&lt;c&gt;yor&lt;/c&gt; is the new y-coordinate.&lt;/param&gt;
- &lt;seealso cref="Translate(System.Int32,System.Int32)" /&gt;
- &lt;/method&gt;
-
- &lt;method name="Translate(System.Int32,System.Int32)"&gt;
- &lt;summary&gt;This method changes the point's location by the given x- and y-offsets.&lt;/summary&gt;
- &lt;remarks&gt;
- &lt;example lang="C#"&gt;
- A C# example:
- &lt;code&gt;
- Point p = new Point(3, 5);
- p.Translate(-1, 3);
- &lt;/code&gt;
- This code results in &lt;c&gt;p&lt;/c&gt; having the value (2,8).
- &lt;/example&gt;
- &lt;/remarks&gt;
- &lt;param name="xor"&gt;&lt;c&gt;xor&lt;/c&gt; is the relative x-offset.&lt;/param&gt;
- &lt;param name="yor"&gt;&lt;c&gt;yor&lt;/c&gt; is the relative y-offset.&lt;/param&gt;
- &lt;seealso cref="Move(System.Int32,System.Int32)" /&gt;
- &lt;/method&gt;
-
- &lt;method name="Equals(System.Object)"&gt;
- &lt;summary&gt;This method determines whether two points have the same location.&lt;/summary&gt;
- &lt;param name="o"&gt;&lt;c&gt;o&lt;/c&gt; is the object to be compared to the current object.&lt;/param&gt;
- &lt;returns&gt;True if the Points have the same location and they have the exact same
- type; otherwise, false.&lt;/returns&gt;
- &lt;seealso cref="op_Equality(Graphics.Point,Graphics.Point)" /&gt;
- &lt;seealso cref="op_Inequality(Graphics.Point,Graphics.Point" /&gt;
- &lt;/method&gt;
-
- &lt;method name="ToString"&gt;
- &lt;summary&gt;Report a point's location as a string.&lt;/summary&gt;
- &lt;returns&gt;A string representing a point's location, in the form (x,y), without any
- leading, trailing, or embedded whitespace.&lt;/returns&gt;
- &lt;/method&gt;
-
- &lt;method name="op_Equality(Graphics.Point,Graphics.Point)"&gt;
- &lt;summary&gt;This operator determines whether two points have the same location.&lt;/summary&gt;
- &lt;param name="p1"&gt;&lt;c&gt;p1&lt;/c&gt; is the first Point to be compared.&lt;/param&gt;
- &lt;param name="p2"&gt;&lt;c&gt;p2&lt;/c&gt; is the second Point to be compared.&lt;/param&gt;
- &lt;returns&gt;True if the points have the same location and they have the exact same
- type; otherwise, false.&lt;/returns&gt;
- &lt;seealso cref="Equals(System.Object)" /&gt;
- &lt;seealso cref="op_Inequality(Graphics.Point,Graphics.Point)" /&gt;
- &lt;/method&gt;
-
- &lt;method name="op_Inequality(Graphics.Point,Graphics.Point)"&gt;
- &lt;summary&gt;This operator determines whether two points have the same location.&lt;/summary&gt;
- &lt;param name="p1"&gt;&lt;c&gt;p1&lt;/c&gt; is the first Point to be compared.&lt;/param&gt;
- &lt;param name="p2"&gt;&lt;c&gt;p2&lt;/c&gt; is the second Point to be compared.&lt;/param&gt;
- &lt;returns&gt;True if the points do not have the same location and they have the exact same
- type; otherwise, false.&lt;/returns&gt;
- &lt;seealso cref="Equals(System.Object)" /&gt;
- &lt;seealso cref="op_Equality(Graphics.Point,Graphics.Point)" /&gt;
- &lt;/method&gt;
-
- &lt;method name="Main"&gt;
- &lt;summary&gt;
- This is the entry point of the Point class testing program.
- &lt;/summary&gt;
- &lt;remarks&gt;
- &lt;para&gt;This program tests each method and operator, and is intended to be run after
- any non-trivial maintenance has been performed on the Point class.&lt;/para&gt;
- &lt;/remarks&gt;
- &lt;/method&gt;
-
- &lt;!-- properties --&gt;
- &lt;property name="X"&gt;
- &lt;value&gt;Property &lt;c&gt;X&lt;/c&gt; represents the point's x-coordinate.&lt;/value&gt;
- &lt;/property&gt;
-
- &lt;property name="Y"&gt;
- &lt;value&gt;Property &lt;c&gt;y&lt;/c&gt; represents the point's y-coordinate.&lt;/value&gt;
- &lt;/property&gt;
- &lt;/type&gt;
-&lt;/doc&gt;
-</pre>
-
diff --git a/doc/papers b/doc/papers
deleted file mode 100644
index 36a31988e83..00000000000
--- a/doc/papers
+++ /dev/null
@@ -1,96 +0,0 @@
-* JIT Compiler
-
- <a
- href="http://citeseer.nj.nec.com/vitek97efficient.html">
- Efficient Type Inclusion Tests: Jahn Vitek, R. Nigel Horspool, Andres
- Krall</a>
-
- <a
- href="http://citeseer.nj.nec.com/cytron91efficiently.html">
- Efficiently Computing Static Single Assignment Form and the Control
- Dependence Graph: Ron Cytron, Jeanne Ferrante</a>
-
- <a
- href="http://citeseer.nj.nec.com/193349.html">
- Practical Improvements to the Construction and Destruction of Static Single Assignment Form: Preston Briggs,
- Keith Cooper, Timothy Harvey, Taylor Simpson</a>
-
- <a
- href="http://citeseer.nj.nec.com/krall98efficient.html">
- Efficient JavaVM Just-in-Time Compilation: Andreas Krall</a>
-
- <a
- href="http://citeseer.nj.nec.com/452617.html">Java for
- Large-Scale Scientific Computations: Andreas Krall, Phillip Thomsich</a>
-
- <a
- href="http://citeseer.nj.nec.com/117522.html">
- Engineering Simple, Efficient Code Generator Generator: Christopher
- W. Fraser, David R. Hanson, Todd A. Proebsting</a>
-
- <a
- href="http://citeseer.nj.nec.com/proebsting92code.html">
- Code Generation Techniques: Todd Alan Proebsting</a>
-
- <a
- href="http://citeseer.nj.nec.com/74629.html">Fast,
- Effective Code Generation in a Just-In-Time Java Compiler: Ali-Reza
- Adl-Tabatabai Guei-Yuan Lueh, Vishesh M. Parikh, James M. Stichnoth...</a>
-
- <a
- href="http://citeseer.nj.nec.com/bodik00abcd.html">
- ABCD: Eliminating Array-Bounds Checks on Demand: Rastislav Bodik, Rajiv Gupta, Vivek Sarkar</a>
-
-* Register Allocation
-
- <a
- href="http://citeseer.nj.nec.com/poletto99linear.html">
- Linear Scan Register Allocation: Massimiliano Poletto, Vivek Sarkar</a>
-
- <a
- href="http://citeseer.nj.nec.com/traub98quality.html">
- Quality and Speed in Linear-scan Register Allocation: Omri Traub, Glenn
- Holloway, Michael D. Smith</a>
-
-* Loop Transformations
-
- <a
- href="http://citeseer.nj.nec.com/bacon93compiler.html">
- Compiler Transformations for High-Performance Computing: David Bacon</a>
-
-* Interpreter
-
- <a
- href="http://citeseer.nj.nec.com/470069.html">
- vmgen-A Generator of Efficient Virtual Machine Interpreters: M. Anton
- Ertl, David Gregg, Andreas Krall, Bernd Paysan</a>
-
-* Synchronization
-
- <a
- href="http://citeseer.nj.nec.com/krall98monitors.html">
- Monitors and Exceptions - How to implement Java efficiently: Andreas Krall,
- Mark Probst</a>
-
- <a
- href="http://citeseer.nj.nec.com/bacon98thin.html">
- Thin Locks: Featherweight Synchronization for Java: David Bacon</a>
-
- <a
- href="http://citeseer.nj.nec.com/278639.html">
- Featherweight Monitors with Bacon Bits: David Bacon</a>
-
-* Garbage Collection
-
- <a
- href="http://citeseer.nj.nec.com/wilson92uniprocessor.html">
- Uniprocessor Garbage Collection Techniques: Paul Wilson</a>
-
- <a
- href="http://citeseer.nj.nec.com/41666.html">
- A Language-Independent Garbage Collector Toolkit: Richard Hudson, Eliot Moss, Amer Diwan, Christopher Weight</a>
-
- <a
- href="http://citeseer.nj.nec.com/seligmann95incremental.html">
- Incremental Collection of Mature Objects: Richard Hudson, Eliot Moss</a>
-
diff --git a/doc/passport b/doc/passport
deleted file mode 100644
index fd402772293..00000000000
--- a/doc/passport
+++ /dev/null
@@ -1,293 +0,0 @@
-* Updates
-
- <b>Sep 20, 2001:</b> Microsoft has just announced some changes
- to passport that are rather interesting. This document
- reflects the Passport system without taking into account the
- new changes.
-
- Read about it <a href="http://www.microsoft.com/presspass/features/2001/sep01/09-20passport.asp">here</a>.
-
- For an analysis of security problems with passport, check <a
- href="http://avirubin.com/passport.html">http://avirubin.com/passport.html</a>.
- The bottom line is that you should not put any sensitive
- information on passport.
-
- I have received many comments from people, and I have updated
- the page accordingly. From removing incorrect statements, to
- fixing typos, to include mentions to other software pieces.
-
- I also corrected my statement about IIS and a trojan horse, I
- should read a more educated press in the future. My apologies
- to Microsoft and its employees on this particular topic. IIS
- did not have a trojan horse built in.
-
-* Microsoft Hailstorm and Passport
-
- Microsoft Passport is a centralized database hosted by
- Microsoft that enhances the consumer experience with the Web
- by providing a single logon system that they can use across a
- number of participant web sites.
-
- As you might know by now from our extensive <a
- href="faq.html">FAQ</a>, the Mono project has nothing to do
- with Microsoft Hailstorm or <a
- href="http://www.passport.com">Microsoft Passport.</a>
-
- Still a lot of people have asked us our opinion on them.
-
-** Passport
-
- Passport is important not because of it being a breakthrough
- technologically speaking, but because the company is in a
- position to drive most people toward being suscribers of it.
-
- At the time of this writing passport is required to use the
- free mail service <a href="http://www.hotmail.com">Hotmail</a>
- to get customized support for the <a
- href="http://www.msn.com">MSN portal</a>, <a
- href="http://msdn.microsoft.com">Microsoft Developers
- Network</a> and according to the original announcement from
- Microsoft <a href="http://www.americanexpress.com">American
- Express</a> and <a href="http://www.ebay.com">EBay</a> will be
- adopting it.
-
- There is already a <a
- href="http://www.passport.com/Directory/Default.asp?PPDir=C&lc=1033">Large
- list</a> of participating sites.
-
- There are many current users of it and Microsoft will be
- driving more users towards Passport as it <a
- href="http://news.cnet.com/news/0-1003-200-6343275.html">integrates
- it</a> in their upcoming release of Windows.
-
- Microsoft has also <a
- href="http://www.passport.com/Business/JoinPassportNetwork.asp?lc=1033">developed
- a toolkit</a> to enable current web merchants to integrate
- their services with passport.
-
- To the end user, there is a clear benefit: they only have to
- log into a single network and not remember multiple passwords
- across sites on the internet. Companies that adopt passport
- will have a competition advantage over those that dont.
- Microsoft lists a list of <a
- href="http://www.passport.com/Business/Default.asp?lc=1033">benefits</a>
- to companies.
-
-
-** The problems of Passport
-
- There are a number of concerns that different groups have over
- Passport. Sometimes I have some, sometimes I do not. But
- overall, consumers and businesses can have better solutions.
-
- <ul>
- * <b>Single Point of Failure:</b> As more services and
- components depend on remote servers, functionality can
- grind to a halt if there is a failure on the
- centralized Passport system.
-
- Such a failure was predicted, and we recently <a
- href="http://news.cnet.com/news/0-1005-200-6473003.html">witnessed</a>
- got a lot of people worried.
-
- The outgage lasted for seven days. Think what this
- could do to your business.
-
- * <b>Trust:</b> Not everyone trusts Microsoft to keep
- their information confidential. Concerns are not only
- at the corporate level policy, but also the fact that
- the source code for Microsoft products is not
- available, means that trojans or worms could be built
- into the products by malicious engineers.
-
- * <b>Security:</b> With a centralized system like
- Passport, imagine the repercussions of a malicious
- hacker gaining access to the Passport database.
- Personal information and credit card information about
- almost everyone using a computer could be stored there.
-
- Hackers have already <a
- href="http://slashdot.org/articles/00/10/27/1147248.shtml">broken
- into Microsoft</a> in the past. And the company was
- unable to figure out for how long their systems had
- been hacked.
-
- Security holes have been found in <a
- href="http://slashdot.org/articles/00/04/14/0619206.shtml">IIS
- in the past.</a> If all the world's data is stored on
- a central location, when a single security hole is
- detected, it would allow an intruder to install a
- backdoor within seconds into the corporate network
- without people ever noticing.
-
- Microsoft itself has been recently hit by worms,
- imagine if all your business depended on a single
- provider for providing all or your authentication
- needs
- </ul>
-
- Microsoft might or might not realize this. The idea behind
- Passport is indeed a good one (I can start to get rid of my
- file that keeps track of the 30 logins and passwords or so
- that I use across the various services on the net myself).
-
-** Alternatives to Microsoft Passport
-
- An alternative to Microsoft Passport needs to take the above
- problems into consideration. Any solution of the form `We
- will just have a competing offering' will not work.
-
- The system thus has to be:
-
- <ul>
- * <b>Distributed:</b> The entire authentication
- system should not create an internet `blackout' in the
- case of failure.
-
- A distributed system using different software
- platforms and different vendors would be more
- resistent to an attack, as holes in a particular
- implementation of the server software would not affect
- every person at the same time.
-
- A security hole attack might not even be relevant to
- other software vendors software.
-
- * <b>Allow for multiple registrars:</b> Users should
- be able to choose a registrar (their banks, local
- phone company, service provider, Swiss bank, or any
- other entity they trust.
-
- * <b>Mandate good security measures:</b> As a
- principle, only Open Source software should be used
- for servers in the registrar, and they should conform
- to a standard set of tools and software that can be
- examined by third parties.
- </ul>
-
- An implementation of this protocol could use the DNS or a
- DNS-like setup to distribute the information of users with the
- possibility of replicating and caching public information
- about the user.
-
- For instant messaging (another piece of the Hailstorm bit),
- you want to use a non-centralized system like Sun's <a
- href="http://www.jxta.org">JXTA</a>. Some people mailed me to
- mention Jabber as a messaging platform and other people
- pointed out to the <a
- href="http://java.sun.com/products/jms/">Java Message
- Service</a>. The JMS does support a number of very
- interesting features that are worth researching.
-
- It could also just use the user e-mail address as the `key' to
- choose the registrar (msn.com, hotmail.com -> passport.com;
- aol.com -> aol.passport.com; you get the idea).
-
- The <a
- href="http://www.soapware.org/xmlStorageSystem">xmlStorage</a>
- idea from <a href="http://www.scripting.com">Dave Winer</a>
- could be used to store the information.
-
- A toolkit for various popular web servers could be provided,
- authenticated and should be open sourced (for those of you who
- think that a binary program would give more security and would
- prevent people from tampering: you are wrong. You can always
- use a proxy system that "behaves" like the binary, and passes
- information back and forth from the real program, and snoops
- in-transit information).
-
- Good cryptographers need to be involved in this problem to
- figure out the details and the possible insecure pieces of a
- proposal like this.
-
-** Implementation: In short
-
- To keep it short: <b>DNS, JXTA, xmlStorage.</b>
-
-
-** Deploying it
-
- The implementation of such a system should be a pretty
- straightforward task once security cryptographers have
- designed such a beast.
-
- The major problems are:
-
- <ul>
- * <b>People might just not care:</b> In a poll to US
- citizens a couple of decades ago, it was found that
- most people did not care about the rights they were
- given by the Bill of Rights, which lead to a number of
- laws to be passed in the US that eliminated most of
- the rights people had.
-
- * <b>The industry will move way too slow:</b>
- Microsoft's implementation is out in the open now: it
- is being deployed, and soon it will be insinuated to
- many, many users. The industry needs to get together
- soon if they care about this issue.
-
- By the time the industry reacts, it might be too
- late.
- </ul>
-
-** Passport and Mono
-
- The .NET class libraries include a Passport class that
- applications might use to authenticate with Passport. Since
- we do not have information at this point on the exact protocol
- of Passport, it is not even feasible to implement it.
-
- If at some point the information is disclosed, it could be
- implemented.
-
- If a competing system to Passport existed, we could probably
- hide all the authentication information to use a number of
- different passport-like systems.
-
- If a user does not want to use Passport at all, he could
- always turn it off (or completely remove the class from the
- library). After all, this is free software.
-
- Currently, we are too far from the point where this is a real
- issue.
-
-** Passport and endangering Open Source.
-
- A few people have said: `Mono will allow Passport to be
- available for Linux and that is bad'. This is plain
- misinformation.
-
- Currently, you can obtain Passport for Linux from Microsoft
- itself and deploy it today on your Web server. Mono does not
- even enter the picture here. Go to passport.com and download
- the toolkit and you will see with your own eyes that passport
- is <B>already</b> available for Linux.
-
-** Disclaimer
-
- This is just a group of personal thoughts of mine that I have
- placed here because I get asked this question a lot lately.
- The views of this page are not a statement from my employer
- (Ximian, Inc).
-
- This is not part of Mono. We are not trying to deal with this
- problem.
-
- Nat Friedman (Ximian's co-founder) has his own ideas on how a
- competing system to Passport could be designed, but I will let
- <a href="http://www.nat.org/">him</a> post his own story.
-
-** Other Passport Comments
-
- An interesting study on the security of passport is available at: <a
- href="http://avirubin.com/passport.html">http://avirubin.com/passport.html</a>
-
-** Other Alternatives
-
- Some people have pointed out <a
- href="http://www.xns.org">XNS</a>
-
-Send comments to me: Miguel de Icaza (<a
- href="mailto:miguel@ximian.com">miguel@ximian.com</a>)
-
diff --git a/doc/pending b/doc/pending
deleted file mode 100644
index e243a10dedf..00000000000
--- a/doc/pending
+++ /dev/null
@@ -1,14 +0,0 @@
-** Microsoft and GNU and Linux.
-
-Q: Does this mean that Microsoft is better than Linux?
-
-A: Many of us are working on <a
- href="http://www.gnu.org/philosophy/free-sw.html">free software<a>
- and want to have an <a href="http://www.opensource.org">open
- source</a> environment that we can change, modify, improve, learn
- from, and share with others. Some of us also think that this will
- lead on the long run to better software: more efficient, faster,
- more robust and more.
-
- We are willing to take good ideas from any source they come from.
-
diff --git a/doc/plans b/doc/plans
deleted file mode 100755
index db6f6dde7c8..00000000000
--- a/doc/plans
+++ /dev/null
@@ -1,15 +0,0 @@
-* Plans
-
- Here we are tracking some plans to particular pieces of
- technology that are part of Mono.
-
- This is just a repository of information that is handy for
- contributors.
-
- Currently you can read our plans for <a
- href="ado-net.html">ADO.NET</a>, <a
- href="asp-net">ASP.NET</a>, <a href="java.html">Java</a> and
- <a href="winforms.html">WinForms</a>.
-
-
-
diff --git a/doc/porting b/doc/porting
deleted file mode 100644
index a09ab69deaa..00000000000
--- a/doc/porting
+++ /dev/null
@@ -1,63 +0,0 @@
-* How to port Mono to your preferred architecture
-
-** Endian, 64 bits and unaligned access issues
-
- The first thing to do is to check that the metadata handling
- library works on your target processor. You may use the disassembler
- on simple programs and check that you get sensible results
- (assuming it compiles at all on your system:-).
-
- The main issue is to write macros that read unaligned
- little endian shorts/ints/longs/float/doubles: look into
- mono/metadata/endian.h. There may be other spots in the code that are
- unsafe at reading/writing to some datatypes that require special
- alignment, but there should be few such issues and they need to be fixed.
-
- Once this stuff is sorted out, you should be able to run the interpreter
- on simple programs that don't require delegates, P/Invoke functions etc..
-
-** Generating assembly bytecodes for the target processor
-
- Next, you need to provide the support code for generating assembly bytecode
- for your target platform (in mono/arch/{ppc,sparc,alpha,*}).
- The code should be more or less like the code in x86-codegen.h:
- macros that produce fast in-line code. You don't need to provide
- code to create every possible code, at first, just the code to
- create trampolines and execute them is fine (you'll need to research
- how the call convention works on your platform): that would be, for
- example, the prolog and epilog code in a function, code to pass function
- parameters and deal with the return value and so on.
-
- libffi in gcc or the xptcall sources in mozilla may be helpful to
- understand how the calling convention works, if you can't find a specification.
- You'd need a processor manual to know how to create the assembly binary data.
- This requires a lot of reading if you're not familiar with the assembly for your
- target platform. Manuals for many processors are available as PDF files on the
- web site of the respective vendors. Note that some processors require you to
- flush the I-cache before executing the code: have a look at how the same thing is
- done in GNU lightning.
-
-** Getting the interpreter to work
-
- Once you can generate binary code, you can start working on a
- mono_create_trampoline() function for your platform: this function will receive
- a MonoMethod that describes the arguments and the return type of a C function
- and will create the code to call such function. When this function is complete
- you'll be able to run more sample programs, that use System.IO, P/Invoke
- functions etc.
-
- To support delegates you'll need to write a mono_create_method_pointer()
- function that creates a native function: this can be used to call the
- method using the runtime's calling convention (it's basically the reverse
- of mono_create_trampoline()).
-
-** The final step: porting the JIT
-
- At this point you'd need to have a more complete code generation header file
- and you can start writing the machine description file for the monoburg
- system. This code (jit/tesjit.c) will require some machine specific tweaks,
- but hopefully all you have to do is create the grammar that emit assembly
- code from the IR tree. Work is at the early stages also for x86 on this stuff
- as we are still testing various solutions: you'd want to read about burg-like
- code-generator generators (the LCC book is a good starting point).
-
diff --git a/doc/ppc b/doc/ppc
deleted file mode 100644
index 44c9ac4cd9a..00000000000
--- a/doc/ppc
+++ /dev/null
@@ -1,30 +0,0 @@
-
-* Mono PowerPC Port
-
-** Status
-
-78 test(s) passed. 11 test(s) failed. (same as x86 :-)
-
-mcs in interpreter could compile hello world application.
-
-** To do
-
-*** Interpreter
-
-Up to date.
-
-*** Jitter
-
-Start the port
-
-** Documentation
-
-<B>PowerPC architecture:</B>
-
- <A HREF="http://e-www.motorola.com/brdata/PDFDB/docs/MPCFPE32B.pdf">PowerPC Programming environments manual</A><BR>
- <A HREF="http://e-www.motorola.com/brdata/PDFDB/docs/MPC7410UM.pdf">G4 (7410) User's manual</A>
-
-<B>Calling conventions:</B>
-
- &lt;add me&gt;
-
diff --git a/doc/projects b/doc/projects
deleted file mode 100755
index 47df1e71098..00000000000
--- a/doc/projects
+++ /dev/null
@@ -1,24 +0,0 @@
-* Open Projects
-
- The .NET framework is a good first in terms of a new
- development foundation, but it falls short of providing
- higher-level components or building blocks for people to
- reuse.
-
- A few ideas of projects and classes that would be useful to
- develop applications follows:
-
-** EOG component
-
-** XmlStorageSystem component
-
-* Gtk# related projects
-
- Gnome Canvas Bindings.
-
- Bezier Canvas Item Binding.
-
-* Graphical bindings
-
- Binding for the Libart library
-
diff --git a/doc/rationale b/doc/rationale
deleted file mode 100644
index d63cf225a59..00000000000
--- a/doc/rationale
+++ /dev/null
@@ -1,173 +0,0 @@
-
-* The Mono Project
-
-** Background.
-
- The GNOME project goal was to bring missing technologies to
- Unix and make it competitive in the current market place for
- desktop applications. We also realized early on that language
- independence was important, and that is why GNOME APIs were
- coded using a standard that allowed the APIs to be easily
- wrapped for other languages. Our APIs are available to most
- programming languages on Unix (Perl, Python, Scheme, C++,
- Objective-C, Ada).
-
- Later on we decided to use better methods for encapsulating
- our APIs, and we started to use CORBA to define interfaces to
- components. We complemented it with policy and a set of
- standard GNOME interfaces for easily creating reusable,
- language independent components, controls and compound
- documents. This technology is known as <a
- href="http://developer.ximian.com/tech/bonobo.html">Bonobo</a>.
- Interfaces to Bonobo exist for C, Perl, Python, and
- Java.
-
- CORBA is good when you define coarse interfaces, and most
- Bonobo interfaces are coarse. The only problem is that
- Bonobo/CORBA interfaces are not good for small interfaces.
- For example, an XML parsing Bonobo/CORBA component would be
- inefficient compared to a C API.
-
-** Another explanation
-
- I recently explained our motivations to Dave Winer, and he posted
- it <a
- href="http://scriptingnews.userland.com/stories/storyReader$1275">here</a>
-
-** Microsoft's .NET
-
- The Microsoft .NET initiative is confusing because it is a
- company wide effort that ranges from development tools to end
- user applications. .NET is a branding formative that
- has been applied to:
-
- <ul>
- * The .NET development platform, a new platform for
- writing software.
-
- * Web services.
-
- * Microsoft Server Applications.
-
- * New tools that use the new development platform.
-
- * Hailstorm, the Passport centralized single-signon
- system that is being integrated into Windows XP.
-
- </ul>
-
- Mono is an implementation of the .NET development platform.
-
-** The Common Language Infrastructure platform.
-
- Microsoft has created a new development platform. The
- highlights of this new development platform are:
-
- <ul>
- * A runtime environment that provides garbage
- collection, threading and a virtual machine
- specification (The Virtual Execution System, VES)
-
- * A comprehensive class library.
-
- * A new language, C#. Very similar to Java, C#
- allows programmers to use all the features available
- on the .NET runtime.
-
- * A language specification that compilers can
- follow if they want to generate classes and code
- that can interoperate with other programming
- languages (The Common Language Specification: CLS)
- </ul>
-
- The Common Language Infrastructure platform is similar to the
- goals we had in GNOME of giving language independence to
- programmers. It is more mature, documented, larger in scope,
- and has a consistent design.
-
- Any API that is written using a CLS provider language can be
- used by any language that is a CLS consumer. Compilers
- generate code in a format called Common Intermediate Language
- (CIL) which is an intermediate representation of a compiled
- program and is easy to compile to native code or compiled
- using Just-in-Time (JIT) engines. The restrictions placed by
- the runtime on the CIL byte codes ensures that it is possible
- to do a good job at optimizing the code in a JIT compiler.
-
- There is not really a lot of innovation in this platform: we
- have seen all of these concepts before, and we are all
- familiar with how these things work.
-
- What makes the Common Language Infrastructure development
- platform interesting is that it is a good mix of technologies
- that have been nicely integrated.
-
- The .NET development platform is essentially a new foundation
- for program development that gives Microsoft a room to grow
- for the coming years.
-
-** ECMA standards.
-
- Microsoft has submitted the
- specifications of C#, the runtime, the metadata and the
- other various bits of the .NET development platform to the
- <a href="http://www.ecma.ch">ECMA</a> for standarization.
-
- You can get a copy of the specifications submitted to ECMA
- from: <a href="http://www.dotnetexperts.com/ecma">http://www.dotnetexperts.com/ecma</a>
-
-** Mono: an Open Source Common Language Infrastructure implementation.
-
- Ximian has begun work on Mono, a project that aims to bring
- the Common Language Infrastructure platform to free systems.
-
- When the GNU project was launched, they picked the best
- operating system that was available out there, and they
- began to clone it: Unix.
-
- The .NET development platform is a very rich, powerful, and
- well designed platform that would help improve the free
- software development platform. Just like the GNU project
- began to clone Unix sixteen years ago, we will be cloning the
- .NET development platform because it is a great platform to
- build on.
-
-** What makes up Mono?
-
- There are various pieces that will make up Mono:
-
- <ul>
- * A C# compiler.
-
- * The Virtual Execution System: that will have the
- Just-in-Time compiler, garbage collector, loader,
- threading engine.
-
- A byte code interpreter will be provided for quickly
- porting Mono to new systems and debugging the JIT
- purposes, but it is not intended to be the ideal
- execution environment.
-
- * An implemenation of the .NET class library.
-
- * Visual development tools.
-
- * A CIL GCC frontend.
- </ul>
-
-** Why use GNOME components?
-
- GNOME is an umbrella project that consists of infrastructural
- components (GUI toolkit, XML libraries, CORBA implementation,
- printing architecture, imaging system), a desktop environment,
- and productivity applications.
-
- The GNOME infrastructural components can be used to quickly
- implement various pieces of the class libraries without reinventing
- the wheel, and since all those components are licensed under
- the terms of the GNU LGPL it is a perfect fit.
-
- Libart will be used to implement the Drawing.2D API; Gtk+ and
- the GNOME libraries will be used to implement the WinForms
- API and of course Glib and libxml will be used in various
- places. \ No newline at end of file
diff --git a/doc/release-notes/mono-0.3 b/doc/release-notes/mono-0.3
deleted file mode 100644
index 4976037b957..00000000000
--- a/doc/release-notes/mono-0.3
+++ /dev/null
@@ -1,46 +0,0 @@
-To: mono-list@ximian.com, mono-announce-list@ximian.com
-Subject: July 12 snapshots.
-FCC: ~/Mail/outbox.txt
-X-Windows: Sometimes you fill a vacuum and it still sucks.
---text follows this line--
-
-Hey!
-
- July 12 snapshots of class libraries, the compiler and the mono
-runtime are available.
-
-New on this release:
-
- * Runtime (module: mono)
-
- The beginning of a simple interpreter that Paolo started
- workign on (can run really simple .NET programs).
-
- Disassembler copes with more elements of the binary format and
- more tokens are decoded. Paolo is working now on moving some
- of these to the metadata library.
-
- More tables are dumped.
-
- * Class libraries (module: mcs/class)
-
- Many new more classes are in from Joe, Vladimir, Jeff, Sean
- and yours truly.
-
- Sean fixed the build process, and it is now possible to
- compile with a single command the assemblies. We will be
- revisiting this mechanism in the future to compile per-OS
- assemblies (ie, Unix, Windows, MacOS, etc).
-
- * Compiler (module mcs/mcs)
-
- Not much done this week, just a few fixes here and there, and
- more work to make it easy to compiler.
-
- * Documentation (module: mono/doc)
-
- All the changes to the web site are there for your browsing
- pleasure. We still need to integrate the status system in
- there.
-
-Miguel.
diff --git a/doc/release-notes/mono-0.4 b/doc/release-notes/mono-0.4
deleted file mode 100644
index 1d7e1cea5f1..00000000000
--- a/doc/release-notes/mono-0.4
+++ /dev/null
@@ -1,43 +0,0 @@
-To: mono-list@ximian.com
-Subject: Sunday snapshot available.
-Gcc: mail.2001-07
---text follows this line--
-
-Hey guys,
-
- I promise I will not be doing these so often once we have the CVS
-server up. In the meantime:
-
- * MCS
-
- Sean got the classes to compile in a single go. You
- will need CygWin (www.cygwin.org) to compile though
- (GNU make and stuff is required).
-
- System.Xml.XmlReader contribution from Jason
- (WOOHHOO!!). It also contains a nice test-suite for
- his functions, and in his new code bit, his
- implementation is faster than Microsoft's
-
- We now ship `jay' as part of the distribution to allow
- you to compile the compiler with the same `make'
- command. Small fixes to the parser as well were
- introduced.
-
- * Mono 0.4
-
- Paolo's interpreter supports call instructions and has
- the test suite program that he posted about.
-
-
- All documentation ships now in the mono-0.4.tar.gz
-
-Notes:
-
- As usual, MCS is targeted to be compiled on a Windows machine
- (you will need Cygwin).
-
- Mono is targeted to be compiled on a Unix machine or a Windows
- machine running Cygwin.
-
-Miguel. \ No newline at end of file
diff --git a/doc/resources b/doc/resources
deleted file mode 100644
index 7efc6d8909d..00000000000
--- a/doc/resources
+++ /dev/null
@@ -1,188 +0,0 @@
-
-* Resources
-
- There are a number of resources available for those of you who
- want to contribute to the Mono project. Here are a few links.
-
- If you want to send suggestions for links, address them to <a
- mailto="web-mono@ximian.com">web-mono@ximian.com</a>.
-
-** Microsoft .NET
-
- The <a href="http://msdn.microsoft.com/net">Microsoft.NET site.</a>
-
- The Microsoft .NET Framework 1.0 can be downloaded <a href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">here</a>
-
- New methods that are not documented in 1.0, are documented <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/framewrkaddend.asp">here</a>
-
-** IRC
-
- Various Mono contributors get together on channel #mono on
- irc.gnome.org
-
-** Mono related sites.
-
- Sergey's web page on Mono resources:
-
- <a href="http://mono.eurosoft.od.ua">http://mono.eurosoft.od.ua</a>
-
- Got Dot Net:
-
- <a href="http://www.gotdotnet.com">Got Dot Net</a>
-
- MonoMail:
-
- <a href="http://sourceforge.net/projects/monomail/">http://sourceforge.net/projects/monomail/</a>
-
- Zip classes:
-
- Mike's port to .NET: <a
- href="http://www.icsharpcode.net/OpenSource/NZipLib/default.asp">NZipLib</a>
-
- .NET Security:
-
- A nice overview paper on the <a
- href="http://www.foundstone.com/pdf/dotnet-security-framework.pdf">.NET
- security architecture</a>.
-
-** Presentations
-
- Currently the <a href="Presentations/O-Reilly">O'Reilly</a>
- presentation on Mono is available. Arturo Espinosa has given
- a talk on Mono in Mexico and made <a
- href="http://construct.ximian.com/~arturo/Presentations/Mono.OLS/html">spanish
- slides</a>
-
-** ECMA Documentation.
-
- You can get the documentation for the ECMA specs from:
-
- <ul>
- * <a href="http://www.ecma.ch/ecma1/STAND/ecma-334.htm">C# Language Specification</a>
- * <a href="http://www.ecma.ch/ecma1/STAND/ecma-335.htm">Common Language Infrastructure</a>
- </ul>
-
-
- Older copies of the standard are available here:
-
- <ul>
- * <a href="http://msdn.microsoft.com/net/ecma">At MSDN</a>
- * <a href="http://www.dotnetexperts.com">Dot Net Experts</a>
- * <a href="http://developer.intel.com/software/idap/ecma">Intel</a>
- * <a href="http://lightning.csse.monash.edu.au/.net/CLI">Monash University</a>
- </ul>
-
- These contain specifications for the assembler, the metadata,
- byte codes supported by the CLI virtual machine, the C#
- language and the core class libraries.
-
- For details on the .NET class libraries, you can
- visit the Microsoft's Developer Network:
-
- <ul>
- * <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/cpref_start.asp">.NET Framework Class Library</a>
- </ul>
-
- You can also get this information if you install the Beta2
- release of the .NET Framework.
-
-** Discussion Groups.
-
- <ul>
-
- * <a href="http://www.oreillynet.com">O'Reilly
- Network</a> has a <a
- href="http://www.oreillynet.com/dotnet">section devoted to
- .NET</a>
- * <a
- href="http://msdn.microsoft.com/newsgroups">MSDN</a> also
- lists various newsgroups related to .NET</ul>
- </ul>
-
-** Other .NET related projects
-
- There are a number of related projects to Mono:
-
- <ul>
- * <a
- href="http://www.icsharpcode.net/OpenSource/SD/default.asp">Sharp
- Develop:</a> an IDE for the C# language written in C#.
-
- * <a
- href="http://www.improve-technologies.com/alpha/esharp/">Eclipse
- Plugin for C#</a>
-
- * <a
- href="http://janet-js.sourceforge.net/">Janet:</a>
- an implemention of ECMAScript (the standarized
- version of JavaScript) in C#
-
- * <a
- href="http://xmarks.sourceforge.net/doc.html">XMarks DOC.NET:</a> For
- creating online documentation you can browse for your own classes.
-
- * <a href="http://nunit.sourceforge.net">NUnit:</a> A
- testing framework for .NET classes.
-
- * <a href="http://www.kaffe.org">Kaffe:</a> A popular
- Free Software JIT engine for Java.
-
- * <a href="http://www.intel.com/research/mrl/orp">ORP:</a> A research
- JIT/VM/GC system from Intel.
-
- * C# bindings for OpenGL and SDL are available here: <a
- href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
-
- * <a
- href="http://www.southern-storm.com.au/portable_net.html">Portable.NET:</a>
- Another implementation of the CLI and C# compiler.
-
- </ul>
-
-** GNOME Documentation
-
- Documnetation on GNOME, and the GNOME APIs is available from
- the <a href="http://developer.gnome.org">developer</a> site at
- GNOME:
-
- <ul>
- * <a href="http://developer.gnome.org/doc/API/">GNOME
- API documentation</a>
-
- * <a href="http://developer.gnome.org/doc/books">GNOME
- Online books</a>
-
- * <A
- href="http://developer.gnome.org/arch/">Architecture Overview</a>
- </ul>
-
-** Assembly Language Manuals online
-
- <ul>
- * <a href="http://www.agner.org/assem/#optimize">
- Pentium optimization tutorial</a> by Agner Fog
-
- * <a href="http://webster.cs.ucr.edu/">
- Art of Assembly</a> (x86 only)
-
- * Documentation for various CPUs
- (<a href="http://www.mit.edu/afs/sipb/contrib/doc/specs/ic/cpu/">
- x86, IA64, MIPS, ARM, Alpha</a>)
-
- * <a href="http://www.heyrick.co.uk/assembler/">
- ARM Assembler</a> tutorial
-
- * PowerPC
- <a href="http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/852569B20050FF7785256996007558C6">
- Compiler Writer's Guide</a>
-
- * <a href="http://www.lightsoft.co.uk/Fantasm/Beginners/begin1.html">
- Beginners Guide to PowerPC Assembler</a>
- </ul>
-
-** Win32
-
- <ul>
- * Win32 <a href="http://www.jorgon.freeserve.co.uk/ExceptFrame.htm">
- Structured Exception Handling (SEH)</a> internals (x86 specific)
- </ul>
diff --git a/doc/resources-pending b/doc/resources-pending
deleted file mode 100644
index fd9b9073d64..00000000000
--- a/doc/resources-pending
+++ /dev/null
@@ -1,30 +0,0 @@
-** MacOS Documentation
-
-** Assembly Language Manuals online
- Intel
- MIPS
- SPARC
-
-** Microsoft
- msdn.microsoft.com/net
- Research.microsoft.com
-
-** Related Technologies
-
- <ul>
-
- * The CLI allows people to create Web Services using the SOAP
- protocol. SOAP is based on XML, XML schemas an the HTTP
- protocol.
- <ul>
- * XML specification.
- * XML Namespaces.
- * XML Schemas.
- * SOAP Specification.
- </ul>
- </ul>
-
-** Compiler Information
- GCC
- GCC Sample front-end tutorial
-
diff --git a/doc/roadmap b/doc/roadmap
deleted file mode 100644
index 6cdfa1366a8..00000000000
--- a/doc/roadmap
+++ /dev/null
@@ -1,12 +0,0 @@
-* Roadmap
-
- We are working on the following three projects at Ximian:
-
- The C# Compiler (mcs/mcs)
-
- A .NET compatible Class Library (mcs/class)
-
- The JIT/interpreter (mono)
-
-
- \ No newline at end of file
diff --git a/doc/runtime b/doc/runtime
deleted file mode 100644
index 908600e8f84..00000000000
--- a/doc/runtime
+++ /dev/null
@@ -1,195 +0,0 @@
-* The Mono runtime
-
- The Mono runtime implements a JIT engine for the CIL virtual
- machine (as well as a byte code interpreter, this is to
- quickly port it to new systems), the class loader, the garbage
- collector, threading system and metadata access libraries.
-
- We currently have two runtimes:
-
- <ul>
- * <b>mono:</b> The Just In Time compiler implemented
- using a BURS instruction selector. We only support
- x86 machines in the JIT engine at this point.
-
- * <b>mint:</b> The Mono interpreter. This is an
- easy-to-port runtime engine.
- </ul>
-
- Currently we are using the Bohem conservative garbage
- collector, but we working on incorporating the ORP GC engine.
-
-** Executing MSIL/CIL images
-
- The code will load an executable and map the references to
- external assemblies to our own version of the assemblies on
- Linux.
-
- Our roadmap looks like this, this has been updated as of
- <b>Dec 18, 2001</b>:
-
- <ul>
-
- * Milestone 1: <b>Done</b> Fully read and parse all CIL byte-codes
- and metadata tokens (ie, a disassembler).
-
- * Milestone 2: <b>Done</b> Complete an interpreter for CIL byte
- codes. This interpreter can be used temporarly to
- run CIL byte code on a system where no JIT is
- available.
-
- * Milestone 3: <b>Done</b>Define an <i>lburg</i>-like
- instruction selector for the JITer for Intel.
-
- * Milestone 4: <b>Done</b> Implement JITer. This is where our
- current efforts are focused on, the JITer currently runs
- all of the code we have tested on it. The major limitation
- is that our class libraries are not complete, and hence not
- every application can be ran.
-
- * Milestone 5: Port of the JITer to non IA32 systems.
- </ul>
-
- A setup similar to the Kaffe JIT engine will be used to
- layout the code to support non-IA32 architectures. Our work
- will be focused on getting a IA32 version running first.
-
- The JIT engine works on Linux and Win32, although you
- will need to install the CygWin32 development tools to get a
- Unix-like compilation environment (mostly we use GNU make in
- a few of the makefiles).
-
-** JIT Engine (<b>updated, April 21, 2002</b>)
-
- The JIT engine uses a code-generator generator approach for
- compilation. Given the properties of CIL byte codes, we can
- take full advantage of a real instruction selector for our
- code generator.
-
- The JIT engine implements a number of optimizations:
-
- <ul>
- * Opcode cost estimates (our architecture allows
- us to generate different code paths depending
- on the target CPU dynamically).
-
- * Inlining.
-
- * Constant folding.
-
- Although compilers typically do
- constant folding, the combination of inlining with
- constant folding gives some very good results.
- </ul>
-
- There are a couple of books that deal with this technique: "A
- Retargetable C Compiler" and "Advanced Compiler Design and
- Implementation" are good references. You can also get a
- technical description of <a
- href="http://research.microsoft.com/copyright/accept.asp?path=http://www.research.microsoft.com/~drh/pubs/iburg.pdf&pub=ACM">lbrug</a>.
-
- A few papers that describe the instruction selector:
-
- <ul>
- * <a href="http://research.microsoft.com/copyright/accept.asp?path=http://www.research.microsoft.com/~drh/pubs/interface.pdf&pub=wiley">A code generation interface for ANSI C</a>
-
-
- * <a href="http://research.microsoft.com/copyright/accept.asp?path=http://www.research.microsoft.com/~drh/pubs/iburg.pdf&pub=ACM">Engineering efficient code generators using tree matching and dynamic programming.</a>
-
- </ul>
-
-** Future plans
-
- We are evaluating the future directions for the JIT engine:
- both from our needs (optimizations like inlining, better register allocation,
- instruction scheduling, and porting to other CPUs).
-
- We have not yet decided how we will evolve the JIT engine. We
- might just upgrade our current architecture, and provide optimizations as
- an extra layer.
-
-** Garbage Collection
-
- Currently we are using the Boehm conservative GC. Although our plans
- are to move to the Intel ORP GC engine, our plans on a next generation
- dual-JIT engine have to be taken into account.
-
- We will be using the Intel ORP GC engine as it provides a precise
- garbage collector engine, similar to what is available on the
- .NET environment.
-
- Although using a conservative garbage collector like Bohem's
- would work, all the type information is available at runtime,
- so we can actually implement a better collector than a
- conservative collector.
-
- <ul>
- * Garbage collection list and FAQ:<br>
- <a href="http://www.iecc.com/gclist/">http://www.iecc.com/gclist/</a>
-
- * "GC points in a Threaded Environment":<br>
- <a href="http://research.sun.com/techrep/1998/abstract-70.html">
- http://research.sun.com/techrep/1998/abstract-70.html</a>
-
- * "A Generational Mostly-concurrent Garbage Collector":
- <a href="http://research.sun.com/techrep/2000/abstract-88.html">
- http://research.sun.com/techrep/2000/abstract-88.html</a>
-
- * Details on The Microsoft .NET Garbage Collection Implementation:<br>
- <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI.asp</a>
- <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI2.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmag00/html/GCI2.asp</a>
- </ul>
-
-** IO and threading
-
- The ECMA runtime and the .NET runtime assume an IO model and a
- threading model that is very similar to the Win32 API.
-
- Dick Porter has been working on the Mono abstraction layer
- that allows our runtime to execute code that depend on this
- behaviour.
-
-** Useful links
-
- Paolo Molaro found a few interesting links:
-
- <ul>
- * On compilation of stack-based languages:<br>
- <a href="http://www.complang.tuwien.ac.at/projects/rafts.html">
- http://www.complang.tuwien.ac.at/projects/rafts.html</a>
-
- * A paper on fast JIT compilation of a stack-based language:<br>
- <a href="http://www.research.microsoft.com/~cwfraser/pldi99codegen.pdf">
- http://www.research.microsoft.com/~cwfraser/pldi99codegen.pdf</a>
-
- * Vmgen generates much of the code for efficient virtual machine (VM)
- interpreters from simple descriptions of the VM instructions:<br>
- <a href="http://www.complang.tuwien.ac.at/anton/vmgen/">
- http://www.complang.tuwien.ac.at/anton/vmgen</a>
- </ul>
-
-** PInvoke
-
- PInvoke is the mechanism we are using to wrap Unix API calls
- as well as talking to system libraries.
-
- Initially we used libffi, but it was fairly slow, so we have
- reused parts of the JIT work to create efficient PInvoke trampolines.
-
-** Remoting
-
- Mono has support for remoting and proxy objects, just like
- .NET does. The runtime provides these facilities.
-
-** Porting
-
- If you are interested in porting the Mono runtime to other
- platforms, you might find the pre-compiled <a
- href="archive/mono-tests.tar.gz">Mono regression test
- suite</a> useful to debug your implementation.
-
-* COM and XPCOM
-
- We plan on adding support for XPCOM on Unix and COM on Microsoft
- Windows later in our development process.
-
diff --git a/doc/status b/doc/status
deleted file mode 100644
index 64948ba312f..00000000000
--- a/doc/status
+++ /dev/null
@@ -1,40 +0,0 @@
-* Project Status
-
-
- Pieces of Mono that have been implemented:
-
- <ul>
- * C# compiler: The C# compiler is mostly complete, a
- few features are still missing (for a list, check the
- <a href="c-sharp.html">C# compiler</a> web page.
-
- * The Mono JIT engine (<b>mono</b>. The JIT engine is
- the real
- virtual machine that we support. It is
- currently functional, and we are improving its speed,
- and making it feature complete.
-
- * A CIL bytecode interpreter (<b>mint</b>). This
- currently can be used to run most .NET programs
- (modulo the fact that our class libraries are not
- complete enough).
-
- <b>mint</b> can currently run the Mono C# compiler and
- the compiler generates valid code.
-
- We use <b>mint</b> as a reference implementation of
- the runtime environment and to quickly support
- non-Intel platforms.
-
- * Metadata library: Can currently parse
- and load information from .NET modules (executables
- and DLL files).
-
- * Disassembler: Can disassemble .NET modules. Still
- lacking exception handling as well as useful debugging
- tools (hex dumping, token dumping).
-
- * Class Libraries: You can check the current status in the
- <a href="class-status.html">Class Status page</a>.
- </ul>
-
diff --git a/doc/team b/doc/team
deleted file mode 100644
index eff7bc9d3d5..00000000000
--- a/doc/team
+++ /dev/null
@@ -1,2 +0,0 @@
-* The MonoNet Team
-
diff --git a/doc/testing b/doc/testing
deleted file mode 100644
index f97902ec306..00000000000
--- a/doc/testing
+++ /dev/null
@@ -1,46 +0,0 @@
-* Testing
-
- Testing is an important part of the Mono project: every one of its
- three major components has a test suite tailored for its needs. This
- is very helpful, because in the course of developing the software it
- is very common to introduce bugs in existing code. A test suite
- helps us fix the bugs as soon as they are introduced.
-
-** Class Library Tests
-
- All classes in Mono libraries should have comprehensive unit test
- suites to go with them. Unit testing is a software engineering
- methodology that makes it easier to build correct code. Every
- method in every class should have a set of tests to verify
- that they work correctly. Mono also needs a testing framework
- to make it easy to write and run lots of tests.
-
- Try <a href="http://nunit.sourceforge.net">NUnit</a>
-
- Why do unit testing? It becomes simple to run automated tests
- for the whole library. Unit tests are a safety net - you can
- change part of the code and verify that you haven't broken
- anything. Ideally, tests are written before the actual library
- code itself. And every time a bug is discovered, a test should
- be written to demonstrate the bug and its fix. Then, if
- you ever reintroduce the bug, you will know immediately. For
- more info, read <a
- href="http://junit.sourceforge.net/doc/testinfected/testing.htm">
- JUnit Test Infected: Programmers Love Writing Tests</a>.
-
-
-** Getting Started
-
- We welcome all contributions to the Class Libary Test Suite.
-
- There is information to help you get started in CVS at
- mcs/class/doc/NUnitGuidelines. Once you have written your test, please
- post it to <a href="mailing-lists.html">mono-list</a>.
-
- Someone will make sure to add the file or apply the patch as
- appropriate. If you plan to be an on-going contributor and
- would like to get cvs account, email <a href="mailto:miguel@ximian.com">miguel</a>.
-
- Normally, after you send a couple of well-written new files
- and/or patches to the list, you will be given cvs access.
-
diff --git a/doc/thanks b/doc/thanks
deleted file mode 100644
index 5f2df36f9cd..00000000000
--- a/doc/thanks
+++ /dev/null
@@ -1,6 +0,0 @@
-* Thanks
-
- We would like to thank Tim O'Reilly, Brian Jepson and Nathan
- Torkington for their help.
-
- Dave Winer for provided interesting comments and a to read.
diff --git a/doc/todo b/doc/todo
deleted file mode 100644
index abae8cdfb40..00000000000
--- a/doc/todo
+++ /dev/null
@@ -1 +0,0 @@
-Discuss with write new JIT \ No newline at end of file
diff --git a/doc/tools b/doc/tools
deleted file mode 100644
index eabef48bb88..00000000000
--- a/doc/tools
+++ /dev/null
@@ -1,67 +0,0 @@
-* Tools
-
- We need a number of tools to make people productive using a
- Mono-based solution. Some of these tools can be developed on
- Windows before Mono is fully finished.
-
- All of these tools should be written using C#.
-
- For the tools that are typically command line tools: Try to
- write these as components that could load their input from
- streams or collections of streams, and implement the command
- line tools as wrappers around those classes.
-
- For example, we will be making the C# compiler a component
- that could be reused by applications that might have a use for
- the various bits of the compiler (either to embed the
- compiler, or reuse the code generator part of it).
-
- This is important so that these components (compiler,
- assembler, linker, etc) can be integrated later into the
- visual development environment (hopefully with the help of the
- SharpDevelop hackers).
-
-TODO=ilasm,IL Assembler
-** IL Assembler.
-
- This assembler should basically take as input a file
- containing IL bytecodes as specified in the `Partition II' of
- the ECMA spec, and produce a binary file.
-
-TODO=al,Assembly Linker
-** Assembly Linker.
-
- This tool is used to construct assemblies, which are basically
- deployment units for CLI executables.
-
-TODO=debugger,Debugger
-** Debugger
-
- We will need a debugging API to debug CLI applications and
- then a debugger component that can be used in an IDE
- environment.
-
-TODO=ide,Integrated Development Environment
-** Integrated Development Environment
-
- There is already a project to create a C# development
- environment: <a
- href="http://www.icsharpcode.net/OpenSource/SD/default.asp">SharpDevelop</a>.
- People should work with the SharpDevelop hackers to produce a
- unified development environment.
-
- Please work with the SharpDevelop hackers to build a good IDE.
- We will work on creating an embedable compiler component and
- an embeddable debugger component that can be used withing
- SharpDevelop
-
-TODO=hbrowser,Help Browser
-** Help Browser
-
- We need a good help browser that can be used to browse
- documentation. Ideally this help browser can accept as input
- XML Docbook input and an assorted set of file formats
- (Microsoft Help, Unix manual pages, Unix Info pages)
-
- Look at the GNOME DevHelp for a good set of ideas on how to
- implement this. \ No newline at end of file
diff --git a/doc/web/.cvsignore b/doc/web/.cvsignore
deleted file mode 100644
index a023a6f9c7c..00000000000
--- a/doc/web/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.src
-*.html
diff --git a/doc/web/commands b/doc/web/commands
deleted file mode 100644
index 75c6bc1a02b..00000000000
--- a/doc/web/commands
+++ /dev/null
@@ -1,43 +0,0 @@
-0,Home,index.html,index.src
-1,FAQ,faq.html,faq.src
-0,Mono,rationale.html,rationale.src
-1,Runtime,runtime.html,runtime.src
-1,Classes,class-library.html,class-library.src
-1,Gtk#,http://gtk-sharp.sourceforge.net
-1,Class Status,class-status.html,class-status.src,cm/cormissing.css,cm/cormissing.js
-2,corlib,class-status-corlib.html,class-status-corlib.src,cm/cormissing.css,cm/cormissing.js
-2,System,class-status-System.html,class-status-System.src,cm/cormissing.css,cm/cormissing.js
-2,System.Xml,class-status-System.Xml.html,class-status-System.Xml.src,cm/cormissing.css,cm/cormissing.js
-2,System.Data,class-status-System.Data.html,class-status-System.Data.src,cm/cormissing.css,cm/cormissing.js
-2,System.Drawing,class-status-System.Drawing.html,class-status-System.Drawing.src,cm/cormissing.css,cm/cormissing.js
-2,System.Web,class-status-System.Web.html,class-status-System.Web.src,cm/cormissing.css,cm/cormissing.js
-1,C# Compiler,c-sharp.html,c-sharp.src
-1,Status,status.html,status.src
-0,Download,download.html,download.src
-1,CVS access,ccvs.html,ccvs.src
-1,AnonCVS access,anoncvs.html,anoncvs.src
-0,Contributing,contributing.html,contributing.src
-1,Documentation,documentation.html,documentation.src
-1,Class Docs,classlib-doc.html,classlib-doc.src
-1,Doc format,monodoc-xml.html,monodoc-xml.src
-1,Test Suite,testing.html,testing.src
-1,Tools,tools.html,tools.src
-1,Porting,porting.html,porting.src
-2,PowerPC,ppc.html,ppc.src
-1,HOWTO,mono-contribution-howto.html,mono-contribution-howto.src
-0,Plans,plans.html,plans.src
-1,ADO.NET,ado-net.html,ado-net.src
-1,ASP.NET,asp-net.html,asp-net.src
-1,Java,java.html,java.src
-1,Windows.Forms,winforms.html,winforms.src
-0,Resources,resources.html,resources.src
-1,Mailing Lists,mailing-lists.html,mailing-lists.src
-1,Ideas,ideas.html,ideas.src
-1,Passport,passport.html,passport.src
-1,Books,books.html,books.src
-1,Papers,papers.html,papers.src
-1,Languages,languages.html,languages.src
-1,Debugging,jit-debug.html,jit-debug.src
-2,Example 1,jit-debug-sample.html,jit-debug-sample.src
-2,Example 2,jit-debug-sample2.html,jit-debug-sample2.src
-0,Contact,contact.html,contact.src
diff --git a/doc/web/deploy/.cvsignore b/doc/web/deploy/.cvsignore
deleted file mode 100755
index 2d19fc766d9..00000000000
--- a/doc/web/deploy/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.html
diff --git a/doc/web/deploy/cm/c.gif b/doc/web/deploy/cm/c.gif
deleted file mode 100644
index 02c347efd0b..00000000000
--- a/doc/web/deploy/cm/c.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/cormissing.css b/doc/web/deploy/cm/cormissing.css
deleted file mode 100644
index 1f22da54273..00000000000
--- a/doc/web/deploy/cm/cormissing.css
+++ /dev/null
@@ -1,182 +0,0 @@
-.y IMG
-{
- border: 0px;
- padding: 0px;
- margin: 0px;
- margin-right: 4px;
- vertical-align: middle;
-}
-
-.y, .y_,
-.n, .n_,
-.c, .c_,
-.c, .c_,
-.d, .d_,
-.en, .en_,
-.i, .i_,
-.s, .s_,
-.e, .e_,
-.f, .f_,
-.m, .m_,
-.o, .o_,
-.p, .p_,
-.r, .r_,
-.x, .x_
-{
- FONT: 10px 'Verdana';
- margin-left: 20px;
-}
-
-.y_ .n,
-.y_ .n_,
-.n_ .c,
-.n_ .c_,
-.n_ .s,
-.n_ .s_,
-.n_ .d,
-.n_ .d_,
-.n_ .en,
-.n_ .en_,
-.n_ .i,
-.n_ .i_,
-.c_ .c,
-.c_ .c_,
-.c_ .e,
-.c_ .e_,
-.c_ .f,
-.c_ .f_,
-.c_ .m,
-.c_ .m_,
-.c_ .o,
-.c_ .o_,
-.c_ .p,
-.c_ .p_,
-.c_ .r,
-.c_ .r_,
-.c_ .x,
-.c_ .x_,
-.c_ .i,
-.c_ .i_,
-.d_ .c,
-.d_ .c_,
-.d_ .e,
-.d_ .e_,
-.d_ .f,
-.d_ .f_,
-.d_ .m,
-.d_ .m_,
-.d_ .o,
-.d_ .o_,
-.d_ .p,
-.d_ .p_,
-.d_ .r,
-.d_ .r_,
-.d_ .x,
-.d_ .x_,
-.en_ .c,
-.en_ .c_,
-.en_ .e,
-.en_ .e_,
-.en_ .f,
-.en_ .f_,
-.en_ .m,
-.en_ .m_,
-.en_ .o,
-.en_ .o_,
-.en_ .p,
-.en_ .p_,
-.en_ .r,
-.en_ .r_,
-.en_ .x,
-.en_ .x_,
-.i_ .c,
-.i_ .c_,
-.i_ .e,
-.i_ .e_,
-.i_ .f,
-.i_ .f_,
-.i_ .m,
-.i_ .m_,
-.i_ .o,
-.i_ .o_,
-.i_ .p,
-.i_ .p_,
-.i_ .r,
-.i_ .r_,
-.i_ .x,
-.i_ .x_,
-.i_ .i,
-.i_ .i_,
-.s_ .c,
-.s_ .c_,
-.s_ .e,
-.s_ .e_,
-.s_ .f,
-.s_ .f_,
-.s_ .m,
-.s_ .m_,
-.s_ .o,
-.s_ .o_,
-.s_ .p,
-.s_ .p_,
-.s_ .r,
-.s_ .r_,
-.s_ .x,
-.s_ .x_,
-.s_ .i,
-.s_ .i_,
-
-.e_ .r,
-.e_ .r_,
-.e_ .o,
-.e_ .o_,
-.f_ .r,
-.f_ .r_,
-.f_ .o,
-.f_ .o_,
-.m_ .r,
-.m_ .r_,
-.m_ .o,
-.m_ .o_,
-.o_ .r,
-.o_ .r_,
-.o_ .o,
-.o_ .o_,
-.p_ .r,
-.p_ .r_,
-.p_ .o,
-.p_ .o_,
-.r_ .r,
-.r_ .r_,
-.r_ .o,
-.r_ .o_,
-.x_ .r,
-.x_ .r_,
-.x_ .o,
-.x_ .o_
-{
- display: none;
-}
-
-.t
-{
- cursor: pointer;
- margin-right: 8px;
-}
-
-.filter
-{
- cursor: pointer;
- vertical-align: middle;
-}
-
-
-.st
-{
- margin-left: 20px;
-}
-
-.l
-{
- cursor: pointer;
-}
diff --git a/doc/web/deploy/cm/cormissing.js b/doc/web/deploy/cm/cormissing.js
deleted file mode 100644
index e6b12ac4fd2..00000000000
--- a/doc/web/deploy/cm/cormissing.js
+++ /dev/null
@@ -1,392 +0,0 @@
-function toggle (elt)
-{
- if (elt == null)
- return;
-
- var eltLink = elt.firstChild;
- if (eltLink != null && eltLink.className == 't') // toggle
- {
- var ich = elt.className.indexOf ('_');
- if (ich < 0)
- {
- eltLink.src = 'cm/tp.gif';
- elt.className += '_';
- }
- else
- {
- eltLink.src = 'cm/tm.gif';
- elt.className = elt.className.slice (0, ich);
- }
- }
-}
-
-function setView (elt, fView)
-{
- var eltLink = elt.firstChild;
- if (eltLink != null && eltLink.className == 't') // toggle
- {
- var ich = elt.className.indexOf ('_');
- if (ich < 0 && !fView)
- {
- eltLink.src = 'cm/tp.gif';
- elt.className += '_';
- }
- else if (ich >= 0 && fView)
- {
- eltLink.src = 'cm/tm.gif';
- elt.className = elt.className.slice (0, ich);
- }
- }
-}
-
-function trimSrc (strSrc)
-{
- return strSrc.slice (strSrc.lastIndexOf ('/') + 1, strSrc.lastIndexOf ('.'));
-}
-
-function getChildrenByTagName (elt, strTag)
-{
- strTag = strTag.toLowerCase ();
- var rgChildren = new Array ();
- var eltChild = elt.firstChild;
- while (eltChild)
- {
- if (eltChild.tagName && eltChild.tagName.toLowerCase () == strTag)
- rgChildren.push (eltChild);
- eltChild = eltChild.nextSibling;
- }
- return rgChildren;
-}
-
-function viewAll (elt, dictTypes)
-{
- var fView = false;
- var rgImages = getChildrenByTagName (elt, 'IMG');
- var cImages = rgImages.length;
- for (var iImage = 0; iImage < cImages; iImage++)
- {
- var strImage = trimSrc (rgImages [iImage].src);
- if (dictTypes [strImage])
- {
- fView = true;
- break;
- }
- }
- var rgElts = getChildrenByTagName (elt, 'DIV');
- var cElts = rgElts.length;
- if (cElts != 0)
- {
- var iElt;
- for (iElt = 0; iElt < cElts; iElt ++)
- fView |= viewAll (rgElts [iElt], dictTypes);
- }
- elt.style.display = fView ? '' : 'none';
- return fView;
-}
-
-function getView (elt)
-{
- var eltLink = elt.firstChild;
- if (eltLink != null && eltLink.className == 't') // toggle
- {
- var ich = elt.className.indexOf ('_');
- if (ich < 0)
- return true;
- }
- return false;
-}
-
-function getParentDiv (elt)
-{
- if (elt)
- {
- do
- {
- elt = elt.parentNode;
- }
- while (elt && elt.tagName != 'DIV');
- }
-
- return elt;
-}
-
-function getName (elt)
-{
- var rgSpans = getChildrenByTagName (elt, 'SPAN');
- for (var iSpan = 0; iSpan < rgSpans.length; iSpan ++)
- {
- var span = rgSpans [iSpan];
- if (span.className == 'l') // label
- {
- if (span.innerText)
- return span.innerText;
- else
- return span.firstChild.nodeValue;
- }
- }
- return null;
-}
-
-function clickHandler (evt)
-{
- var elt;
- if (document.layers)
- elt = evt.taget;
- else if (window.event && window.event.srcElement)
- {
- elt = window.event.srcElement;
- evt = window.event;
- }
- else if (evt && evt.stopPropagation)
- elt = evt.target;
-
- if (!elt.className && elt.parentNode)
- elt = elt.parentNode;
-
- if (elt.className == 'l') // label
- {
- var strClass;
- var strField;
- var strNamespace;
- var strAssembly;
-
- elt = getParentDiv (elt);
- var strEltClass = elt.className;
- if (strEltClass.charAt (strEltClass.length - 1) == '_')
- strEltClass = strEltClass.slice (0, strEltClass.length - 1);
-
- if (strEltClass == 'x') // constructor
- {
- strField = 'ctor';
- elt = getParentDiv (elt);
- }
- else
- if (strEltClass == 'm' || // method
- strEltClass == 'p' || // property
- strEltClass == 'e' || // event
- strEltClass == 'f') // field
- {
- strField = getName (elt).toLowerCase ();
- var match = strField.match ( /[\.A-Z0-9_]*/i );
- if (match)
- strField = match [0];
- elt = getParentDiv (elt);
-
- }
-
- var strEltClass = elt.className;
- if (strEltClass.charAt (strEltClass.length - 1) == '_')
- strEltClass = strEltClass.slice (0, strEltClass.length - 1);
-
- if (strEltClass == 'c' || // class
- strEltClass == 's' || // struct
- strEltClass == 'i' || // struct
- strEltClass == 'd' || // delegate
- strEltClass == 'en') // enum
- {
- strClass = getName (elt);
- if (strEltClass == 'en')
- strField = null;
- elt = getParentDiv (elt);
- }
-
- var strEltClass = elt.className;
- if (strEltClass.charAt (strEltClass.length - 1) == '_')
- strEltClass = strEltClass.slice (0, strEltClass.length - 1);
-
- if (strEltClass == 'n')
- {
- strNamespace = getName (elt);
- elt = getParentDiv (elt);
- }
-
- var strEltClass = elt.className;
- if (strEltClass.charAt (strEltClass.length - 1) == '_')
- strEltClass = strEltClass.slice (0, strEltClass.length - 1);
-
- if (strEltClass == 'y')
- {
- strAssembly = getName (elt);
- }
-
- if (evt.ctrlKey)
- {
- var strRoot = 'http://cvs.hispalinux.es/cgi-bin/cvsweb/mcs/class/';
- var strExtra = '?cvsroot=Mono';
-
- if (strAssembly)
- {
- strRoot = strRoot + strAssembly + '/';
- if (strNamespace)
- {
- strRoot = strRoot + strNamespace + '/';
- if (strClass)
- {
- strRoot += strClass + '.cs';
- strExtra += '&rev=1';
- }
- }
- window.open (strRoot + strExtra, 'CVS');
- }
- }
- else if (strNamespace)
- {
- var re = /\./g ;
- strNamespace = strNamespace.toLowerCase ().replace (re, '');
- if (strClass)
- strNamespace += strClass.toLowerCase () + 'class';
- if (strField)
- strNamespace += strField;
- if (strClass || strField)
- strNamespace += 'topic';
-
- window.open ('http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrf' + strNamespace + '.asp', 'MSDN');
- }
- }
- else
- {
- if (elt.parentNode && elt.parentNode.className == 't') // toggle
- elt = elt.parentNode;
- else if (elt.className != 't') // toggle
- return;
-
- while (elt != null && elt.tagName != 'DIV')
- elt = elt.parentNode;
-
- if (evt.shiftKey)
- {
- var rgElts = getChildrenByTagName (elt, 'DIV');
- var cElts = rgElts.length;
- if (cElts != 0)
- {
- var fView = false;
- var iElt;
- for (iElt = 0; iElt < cElts; iElt ++)
- {
- if (getView (rgElts [iElt]))
- {
- fView = true;
- break;
- }
- }
- for (iElt = 0; iElt < cElts; iElt ++)
- {
- setView (rgElts [iElt], !fView);
- }
- }
- }
- else if (evt.ctrlKey)
- {
- setView (elt, true);
- var eltParent = getParentDiv (elt);
- while (eltParent)
- {
- var rgSiblings = getChildrenByTagName (eltParent, 'DIV');
- var cSiblings = rgSiblings.length;
- for (var iSibling = 0; iSibling < cSiblings; iSibling++)
- {
- var eltSibling = rgSiblings [iSibling];
- if (eltSibling != elt)
- {
- setView (eltSibling, false);
- }
- }
- elt = eltParent;
- eltParent = getParentDiv (elt);
- }
- }
- else
- toggle (elt);
- }
-
- return false;
-}
-
-function filterTree ()
-{
- var eltMissing = document.getElementById ('missing');
- var eltTodo = document.getElementById ('todo');
- var eltExtra = document.getElementById ('extra');
- var eltErrors = document.getElementById ('errors');
-
- var dictTypes = new Object ();
- if (eltMissing.checked)
- dictTypes ['sm'] = true;
- if (eltTodo.checked)
- dictTypes ['st'] = true;
- if (eltErrors.checked)
- dictTypes ['se'] = true;
- if (eltExtra.checked)
- dictTypes ['sx'] = true;
-// dictTypes ['sc'] = true;
-
- viewAll (document.getElementById ('ROOT'), dictTypes);
-}
-
-function selectMissing ()
-{
- toggleFilter ('missing');
-}
-
-function selectTodo ()
-{
- toggleFilter ('todo');
-}
-
-function selectExtra ()
-{
- toggleFilter ('extra');
-}
-
-function selectErrors ()
-{
- toggleFilter ('errors');
-}
-
-function toggleFilter (strFilter)
-{
- var eltTodo = document.getElementById ('todo');
- var eltMissing = document.getElementById ('missing');
- var eltExtra = document.getElementById ('extra');
- var eltErrors = document.getElementById ('errors');
-
- var eltToggle = document.getElementById (strFilter);
- if (window && window.event && window.event.shiftKey)
- {
- eltMissing.checked = eltTodo.checked = eltExtra.checked = eltErrors.checked = false;
- eltToggle.checked = true;
- }
- else
- if (!eltTodo.checked && !eltMissing.checked && !eltExtra.checked && !eltErrors.checked)
- {
- eltMissing.checked = eltTodo.checked = eltExtra.checked = eltErrors.checked = true;
- eltToggle.checked = false;
- }
- filterTree ();
-}
-
-function onLoad ()
-{
- var eltMissing = document.getElementById ('missing');
- var eltTodo = document.getElementById ('todo');
- var eltExtra = document.getElementById ('extra');
- var eltErrors = document.getElementById ('errors');
- eltMissing.checked = eltTodo.checked = eltExtra.checked = eltErrors.checked = true;
-}
-
-if (document.layers)
-{
- document.captureEvents (Event.MOUSEUP);
- document.onmouseup = clickHandler;
-}
-else if (document.attachEvent)
-{
- document.attachEvent('onclick', clickHandler);
-}
-else if (document.addEventListener)
-{
- document.addEventListener('click', clickHandler, false);
-}
-else
- document.onclick = clickHandler;
-
diff --git a/doc/web/deploy/cm/d.gif b/doc/web/deploy/cm/d.gif
deleted file mode 100644
index c9735952f33..00000000000
--- a/doc/web/deploy/cm/d.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/e.gif b/doc/web/deploy/cm/e.gif
deleted file mode 100644
index 1137246bfae..00000000000
--- a/doc/web/deploy/cm/e.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/en.gif b/doc/web/deploy/cm/en.gif
deleted file mode 100644
index 00026b77300..00000000000
--- a/doc/web/deploy/cm/en.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/f.gif b/doc/web/deploy/cm/f.gif
deleted file mode 100644
index f78a2f53bbc..00000000000
--- a/doc/web/deploy/cm/f.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/i.gif b/doc/web/deploy/cm/i.gif
deleted file mode 100644
index 56cd032a565..00000000000
--- a/doc/web/deploy/cm/i.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/m.gif b/doc/web/deploy/cm/m.gif
deleted file mode 100644
index 75fe3586d48..00000000000
--- a/doc/web/deploy/cm/m.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/n.gif b/doc/web/deploy/cm/n.gif
deleted file mode 100644
index f6fa746304d..00000000000
--- a/doc/web/deploy/cm/n.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/p.gif b/doc/web/deploy/cm/p.gif
deleted file mode 100644
index b79d0dd7edb..00000000000
--- a/doc/web/deploy/cm/p.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/r.gif b/doc/web/deploy/cm/r.gif
deleted file mode 100644
index a3ef0f38ef0..00000000000
--- a/doc/web/deploy/cm/r.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/s.gif b/doc/web/deploy/cm/s.gif
deleted file mode 100644
index f2fd5c8aee2..00000000000
--- a/doc/web/deploy/cm/s.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/sc.gif b/doc/web/deploy/cm/sc.gif
deleted file mode 100644
index b02afd9b2e0..00000000000
--- a/doc/web/deploy/cm/sc.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/se.gif b/doc/web/deploy/cm/se.gif
deleted file mode 100644
index 1c46eaa5887..00000000000
--- a/doc/web/deploy/cm/se.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/sm.gif b/doc/web/deploy/cm/sm.gif
deleted file mode 100644
index 0c7194786d5..00000000000
--- a/doc/web/deploy/cm/sm.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/st.gif b/doc/web/deploy/cm/st.gif
deleted file mode 100644
index 067582cb398..00000000000
--- a/doc/web/deploy/cm/st.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/sx.gif b/doc/web/deploy/cm/sx.gif
deleted file mode 100644
index 2c8ca547929..00000000000
--- a/doc/web/deploy/cm/sx.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/tb.gif b/doc/web/deploy/cm/tb.gif
deleted file mode 100644
index ee68c5a356b..00000000000
--- a/doc/web/deploy/cm/tb.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/tm.gif b/doc/web/deploy/cm/tm.gif
deleted file mode 100644
index 3c8f18aecea..00000000000
--- a/doc/web/deploy/cm/tm.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/tp.gif b/doc/web/deploy/cm/tp.gif
deleted file mode 100644
index 8b7435361b7..00000000000
--- a/doc/web/deploy/cm/tp.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/cm/y.gif b/doc/web/deploy/cm/y.gif
deleted file mode 100644
index 08f00d4ea11..00000000000
--- a/doc/web/deploy/cm/y.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/images/bgsquares.gif b/doc/web/deploy/images/bgsquares.gif
deleted file mode 100644
index 864bcd44038..00000000000
--- a/doc/web/deploy/images/bgsquares.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/images/bgsquares.png b/doc/web/deploy/images/bgsquares.png
deleted file mode 100644
index a9e2bb94dbb..00000000000
--- a/doc/web/deploy/images/bgsquares.png
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/images/bgsquares.xcf.gz b/doc/web/deploy/images/bgsquares.xcf.gz
deleted file mode 100644
index 200b5805615..00000000000
--- a/doc/web/deploy/images/bgsquares.xcf.gz
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/images/mono.gif b/doc/web/deploy/images/mono.gif
deleted file mode 100644
index 298976a07b7..00000000000
--- a/doc/web/deploy/images/mono.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/images/mono.png b/doc/web/deploy/images/mono.png
deleted file mode 100644
index 21709009d60..00000000000
--- a/doc/web/deploy/images/mono.png
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/images/pixel.gif b/doc/web/deploy/images/pixel.gif
deleted file mode 100644
index a4f37d7e02e..00000000000
--- a/doc/web/deploy/images/pixel.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/deploy/images/pixel.png b/doc/web/deploy/images/pixel.png
deleted file mode 100644
index 85cfd14929a..00000000000
--- a/doc/web/deploy/images/pixel.png
+++ /dev/null
Binary files differ
diff --git a/doc/web/htmlify b/doc/web/htmlify
deleted file mode 100644
index e4e61961f3b..00000000000
--- a/doc/web/htmlify
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl
-$q = 1;
-
-while (<>){
- chop;
- if (/^\* (.*)$/){
- print "<h1>$1</h1>\n";
- } elsif (/^\*\* (.*)$/) {
- print "<h2>$1</h2>\n";
- } elsif (/^\*\*\* (.*)$/) {
- print "<h3>$1</h3>\n";
- } elsif (/^\*\*\*\* (.*)$/) {
- print "<h4>$1</h4>\n";
- } elsif (/^$/) {
- print "<p>\n";
- } elsif (/^\t\t\* (.*)$/) {
- print "<li>$1\n";
- } elsif (/^\@item (.*)$/){
- $name = $link = $1;
- $link =~ s/ //g;
- print "<a name=\"$link\">\n";
- print "<h2>$name</h2>\n";
- } elsif (/^Q: (.*)$/){
- print "<p><a name=\"q$q\"></a><b>Question $q:</b> $1\n";
- $q++;
- } elsif (/^A: (.*)$/){
- print "$1\n";
- } elsif (/^TODO=(.*),$/){
- print "<a name=\"$1\">\n";
- } else {
- print "$_\n";
- }
-}
diff --git a/doc/web/icaza.pl b/doc/web/icaza.pl
deleted file mode 100644
index ce8b87c44da..00000000000
--- a/doc/web/icaza.pl
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/perl
-$q = 1;
-
-# Modified by Edwin Lima (edwinlima@hotmail.com; edwin.lima@nec-computers.com)
-# Date: 08/21/01, The Netherlands
-# $f: Variable used as a flag to create the list of questions on top of the question-answers set. This
-# is the only way that I found to scan the questions which have a <CR><LF>, in such a way that I will not
-# scan the answer together at same time.
-# @aname: Buffer used to store the question-answers set to print them out just after the print of the
-# questions.
-# @href: Buffer used to store the anchors (only questions) to the questions-answers set on the bottom
-# of the page.
-# I opened explicitly the file for input (input.txt) but U can change this as it was originally.
-#
-#
-
-#comment this line if you are not open the file explicitly
-#open(IN, "input.txt") || die "cannot open file input.txt" ;
-
-print("<A name=TOP>") ;
-
-#Uncomment line bellow to make it work as it was originally.
-while (<>){
-
-#comment line bellow
-
-#while (<IN>){
- chop;
- if (/^\* (.*)$/){
- push(@aname,"<h1>$1</h1>\n");
-# print $body;
- } elsif (/^\*\* (.*)$/) {
- push(@aname, "<h2>$1</h2>\n");
- push(@href, "<h2>$1</h2>\n");
- } elsif (/^\*\*\* (.*)$/) {
- push(@aname, "<h3>$1</h3>\n");
-
- } elsif (/^$/) {
- push(@aname, "<p>\n");
-# push(@href, "<p>\n"); NOT NEEDED
- } elsif (/^\t\t\* (.*)$/) {
- push(@aname, "<li>$1\n");
- } elsif (/^Q: (.*)$/){
- push(@aname, "<p><a name=\"q$q\"></a><b>Question $q:</b> $1\n");
- push(@href,"<p><a href=\"#q$q\"><b>Question $q:</b></a> $1\n");
- $f=1;
- $q++;
- } elsif (/^A: (.*)$/){
- push(@aname,"<P>\n<A HREF=#TOP>Top</A>\n<P>");
- push(@aname,"$1\n");
- $f=0;
- } elsif (/^TODO=(.*),$/){
- push(@aname, "<a name=\"$1\">\n");
- #push(@href, "<a name=\"$1\">\n");
- } else {
- push(@aname,"$_\n");
- if ($f==1) {
- push(@href,"$_\n");
- }
- }
-}
-
-foreach $line (@href) #"\n\n";
-{
- print $line;
- }
-
-foreach $line (@aname) #"\n\n";
-{
- print $line;
- }
-
-
-#comment this line if you are not open the file explicitly
-# close(IN) || die "cannot close file" ;
-
diff --git a/doc/web/images/bgsquares.gif b/doc/web/images/bgsquares.gif
deleted file mode 100644
index 864bcd44038..00000000000
--- a/doc/web/images/bgsquares.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/images/bgsquares.png b/doc/web/images/bgsquares.png
deleted file mode 100644
index 54de2ad1e6d..00000000000
--- a/doc/web/images/bgsquares.png
+++ /dev/null
Binary files differ
diff --git a/doc/web/images/bgsquares.xcf.gz b/doc/web/images/bgsquares.xcf.gz
deleted file mode 100644
index 200b5805615..00000000000
--- a/doc/web/images/bgsquares.xcf.gz
+++ /dev/null
Binary files differ
diff --git a/doc/web/images/mono.gif b/doc/web/images/mono.gif
deleted file mode 100644
index 298976a07b7..00000000000
--- a/doc/web/images/mono.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/images/mono.png b/doc/web/images/mono.png
deleted file mode 100644
index a19e38acedd..00000000000
--- a/doc/web/images/mono.png
+++ /dev/null
Binary files differ
diff --git a/doc/web/images/pixel.gif b/doc/web/images/pixel.gif
deleted file mode 100644
index a4f37d7e02e..00000000000
--- a/doc/web/images/pixel.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/images/pixel.png b/doc/web/images/pixel.png
deleted file mode 100644
index d8f33a2a3e4..00000000000
--- a/doc/web/images/pixel.png
+++ /dev/null
Binary files differ
diff --git a/doc/web/images/xml.gif b/doc/web/images/xml.gif
deleted file mode 100755
index ecb09575418..00000000000
--- a/doc/web/images/xml.gif
+++ /dev/null
Binary files differ
diff --git a/doc/web/makefile b/doc/web/makefile
deleted file mode 100644
index 41e55a59bf7..00000000000
--- a/doc/web/makefile
+++ /dev/null
@@ -1,110 +0,0 @@
-CSCRIPT = $(SYSTEMROOT)/system32/cscript.exe
-CSC=csc
-CORCOMPARE=../../../mcs/tools/corcompare
-
-OBJECTS= \
- deploy/ado-net.html \
- deploy/anoncvs.html \
- deploy/asp-net.html \
- deploy/books.html \
- deploy/contributing.html \
- deploy/class-status.html \
- deploy/class-status-corlib.html \
- deploy/class-status-System.html \
- deploy/class-status-System.Xml.html \
- deploy/class-status-System.Drawing.html \
- deploy/class-status-System.Data.html \
- deploy/class-status-System.Web.html \
- deploy/class-library.html \
- deploy/classlib-doc.html \
- deploy/contact.html \
- deploy/c-sharp.html \
- deploy/ccvs.html \
- deploy/documentation.html \
- deploy/download.html \
- deploy/faq.html \
- deploy/gcc-frontend.html \
- deploy/index.html \
- deploy/ideas.html \
- deploy/java.html \
- deploy/jit-debug.html \
- deploy/jit-debug-sample.html \
- deploy/jit-debug-sample2.html \
- deploy/languages.html \
- deploy/mailing-lists.html \
- deploy/mono-contribution-howto.html \
- deploy/monodoc-xml.html \
- deploy/papers.html \
- deploy/passport.html \
- deploy/plans.html \
- deploy/porting.html \
- deploy/ppc.html \
- deploy/rationale.html \
- deploy/resources.html \
- deploy/roadmap.html \
- deploy/runtime.html \
- deploy/status.html \
- deploy/testing.html \
- deploy/tools.html \
- deploy/winforms.html
-
-# deploy/class-status-System.html \
-
-NON_HTML_SOURCES= \
- ../mono-build.sh \
- ../mono-build-w32.sh
-
-
-all: $(OBJECTS) deploy/index.rss
- perl process.pl commands template.html.in deploy
-
-deploy/index.rss: mono-rss.exe ../index
- ./mono-rss.exe ../index deploy/index.rss
-
-mono-rss.exe: mono-rss.cs rss.cs
- $(CSC) mono-rss.cs rss.cs
-
-clean:
- rm -f $(OBJECTS) $(patsubst deploy/%.html,src/%.src, $(OBJECTS)) src/*.xml src/*.html.in ../class-status-* ../class-status
-
-push:
- cp -f $(NON_HTML_SOURCES) deploy
- echo scp -P 2200 -r deploy/* www@www.ximian.com:/web/cvsmodules/mono
- (cd deploy; rsync --verbose --recursive --checksum --update --rsh='ssh -p 2200' . www@www.ximian.com:/web/cvsmodules/mono )
-
-push2:
- scp -r deploy/* primates:public_html/xxx
-
-$(OBJECTS): $(patsubst deploy/%.html,src/%.src, $(OBJECTS))
-
-#.PRECIOUS: $(patsubst deploy/%.html,src/%.src, $(OBJECTS))
-
-
-
-.PRECIOUS: src/%.src
-src/%.src: ../% commands makefile template.html.in
- perl htmlify $< > $@
-
-
-
-.PRECIOUS: ../class-status-%
-../class-status-%: src/%.html.in ../class-status.in
- cat ../class-status.in $< > $@
-
-
-.PRECIOUS: src/%.html.in
-src/%.html.in: src/%.xml $(CORCOMPARE)/transform.js $(CORCOMPARE)/cormissing.xsl
- $(CSCRIPT) /nologo $(CORCOMPARE)/transform.js $< $(CORCOMPARE)/cormissing.xsl > $@
-
-
-
-.PRECIOUS: src/%.xml
-src/%.xml: ../../../mcs/class/lib/%.dll $(CORCOMPARE)/CorCompare.exe
- $(CORCOMPARE)/CorCompare.exe -x $@ $<
-
-src/corlib.xml: ../../../mcs/class/lib/corlib_cmp.dll $(CORCOMPARE)/CorCompare.exe
- $(CORCOMPARE)/CorCompare.exe -f corlib -ms mscorlib -x $@ $<
-
-
-../class-status: ../class-status.in
- cp -f $< $@
diff --git a/doc/web/mono-rss.cs b/doc/web/mono-rss.cs
deleted file mode 100755
index a4fdd49c365..00000000000
--- a/doc/web/mono-rss.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Generates the Mono RSS feed
-//
-// Miguel de Icaza
-//
-using System;
-using System.IO;
-using System.Xml;
-using RSS;
-
-class X {
- static RSS.RSS rss;
- static Channel c;
- static int item_count;
-
- static void PopulateRSS (StreamReader input)
- {
- string s;
-
- while ((s = input.ReadLine ()) != null){
- if (s.StartsWith ("@item "))
- break;
- }
-
- if (s == null || !s.StartsWith ("@item ")){
- Console.WriteLine ("Could not find beginning of text to RSS");
- return;
- }
-
- Item i = null;
- string description = "";
- do {
- if (s.StartsWith ("@item ")){
- if (item_count++ > 25)
- break;
-
- if (i != null){
- i.Description = description;
- description = "";
- }
-
- string title = s.Substring (6);
- string link = "http://www.go-mono.com/index.html#";
- foreach (char ch in title){
- if (ch != ' ')
- link += ch;
- }
-
- i = c.NewItem ();
- i.Title = title;
- i.Link = link;
- } else {
- description += "\n" + (s == "\n" ? "<p>" : s);
- }
- } while ((s = input.ReadLine ()) != null);
-
- if (i != null){
- i.Description = description;
- }
- }
-
- static void MakeRSS (string input, string output)
- {
- rss = new RSS.RSS ();
- c = rss.NewChannel ("Mono Project News", "http://www.go-mono.com");
-
- c.Title = "Mono Project News";
- c.Link = "http://www.go-mono.com";
- c.Description =
- "News from the Mono project: a portable implementation of the .NET Framework";
- c.WebMaster = "webmaster@go-mono.com";
- c.ManagingEditor = "miguel@ximian.com";
- string t = File.GetLastWriteTime (input).ToString ("r");
- c.PubDate = t;
- c.LastBuildDate = t;
-
- using (FileStream fs = new FileStream (input, FileMode.Open)){
- using (StreamReader input_stream = new StreamReader (fs)){
- PopulateRSS (input_stream);
- }
- }
-
- rss.XmlDocument.Save (output);
- }
-
- static int Main (string [] args)
- {
- switch (args.Length){
- case 0:
- MakeRSS ("index", "index.rss");
- break;
- case 2:
- MakeRSS (args [0], args [1]);
- break;
-
- default:
- Console.WriteLine ("Usage is: mono-rss [input output.rss]");
- return 1;
- }
-
- return 0;
- }
-}
diff --git a/doc/web/process.pl b/doc/web/process.pl
deleted file mode 100755
index 9739f9b4384..00000000000
--- a/doc/web/process.pl
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/perl
-#
-# Author:
-# Sean MacIsaac
-#
-
-use strict;
-
-my $full_expand = 1;
-my @template;
-my $n;
-
-if ($#ARGV != 2) {
- print "process.pl command_file template_file directory_prefix\n";
- exit ();
-}
-
-my $menu = "";
-
-open COMMANDS, $ARGV[0] || die "Can not open $ARGV[0]";
-while (<COMMANDS>) {
- chop;
- my @command = split /,/;
- if ($command[0] != -1) {
- $menu .= "\t\t";
- $menu .= "<tr><td valign=\"top\" class=\"navi" . $command[0];
- $menu .= "\"><a class=\"navi" . $command[0];
- $menu .= "\"";
- $menu .= "HREF=\"$command[2]\">$command[1]</A></td></tr>\n\n";
- }
-}
-close COMMANDS;
-
-open TEMPLATE, $ARGV[1] || die "Can not open $ARGV[1]";
-while (<TEMPLATE>) {
- push @template, $_;
-}
-close TEMPLATE;
-
-open COMMANDS, $ARGV[0] || die "Can not open $ARGV[0]";
-while (<COMMANDS>) {
- chop;
- my @command = split /,/;
-
- if ($command[2] =~ /^http:/){
- } else {
- $n = $ARGV[2] . "/" . $command[2];
- open OUTPUT, ">" . $n || die "Can not create $n";
-
- my $content = "";
- open INPUT, "src/$command[3]" || die "Can not open $command[3]";
- while (<INPUT>) {
- $content .= $_;
- }
- close INPUT;
-
- my $line;
- my $temp;
- my $tit;
- my $title;
- my $css;
- my $script;
-
- $tit = $command[1];
- $css = $command[4];
- $script = $command[5];
-
- foreach $line (@template) {
- $temp = $line;
- $title = "$tit / Mono";
- $temp =~ s/#TITLE#/$title/;
- $temp =~ s/#CONTENT#/$content/;
- $temp =~ s/#MENU#/$menu/;
- if ($css) {
- $temp =~ s/#CSS#/<LINK rel="stylesheet" type="text\/css" href="$css">/;
- } else {
- $temp =~ s/#CSS#//;
- }
-
- if ($script) {
- $temp =~ s/#SCRIPT#/<SCRIPT src="$script"><\/SCRIPT>/;
- } else {
- $temp =~ s/#SCRIPT#//;
- }
- print OUTPUT $temp;
- }
- }
- close OUTPUT;
-}
diff --git a/doc/web/rss.cs b/doc/web/rss.cs
deleted file mode 100755
index c8966e51e52..00000000000
--- a/doc/web/rss.cs
+++ /dev/null
@@ -1,262 +0,0 @@
-//
-// RSS.cs: Some utility classes to generate RSS feeds
-//
-// (C) 2002 Miguel de Icaza (miguel@gnu.org)
-//
-//
-using System;
-using System.Xml;
-using System.IO;
-
-namespace RSS {
-
- public class Item {
- XmlDocument doc;
- XmlNode item;
- XmlText title, link, description;
-
- public Item (XmlDocument doc, XmlNode item)
- {
- this.doc = doc;
- this.item = item;
- }
-
- XmlText MakeTextElement (string name)
- {
- XmlNode node = doc.CreateElement (name);
- XmlText text = doc.CreateTextNode ("");
-
- item.AppendChild (node);
- node.AppendChild (text);
-
- return text;
- }
-
- public string Title {
- get {
- if (title == null)
- return null;
-
- return title.Value;
- }
-
- set {
- if (title == null)
- title = MakeTextElement ("title");
- title.Value = value;
- }
- }
-
- public string Link {
- get {
- if (link == null)
- return null;
-
- return link.Value;
- }
-
- set {
- if (link == null)
- link = MakeTextElement ("link");
- link.Value = value;
- }
- }
-
- public string Description {
- get {
- if (description == null)
- return null;
-
- return description.Value;
- }
-
- set {
- if (description == null)
- description = MakeTextElement ("description");
- description.Value = value;
- }
- }
- }
-
- public class Channel {
- XmlDocument doc;
- XmlNode channel;
- XmlText title, link, description, language, pubDate, lastBuildDate;
- XmlText managingEditor, webMaster;
-
- XmlText MakeTextElement (string name)
- {
- XmlNode node = doc.CreateElement (name);
- XmlText text = doc.CreateTextNode ("");
-
- channel.AppendChild (node);
- node.AppendChild (text);
-
- return text;
- }
-
- public Channel (XmlDocument doc, XmlNode node)
- {
- this.channel = node;
- this.doc = doc;
-
- title = MakeTextElement ("title");
- link = MakeTextElement ("link");
- description = MakeTextElement ("description");
- }
-
- public Item NewItem ()
- {
- XmlNode node = doc.CreateElement ("item");
- Item item;
-
- channel.AppendChild (node);
- item = new Item (doc, node);
-
- return item;
- }
-
- public string Title {
- get {
- return title.Value;
- }
-
- set {
- title.Value = value;
- }
- }
-
- public string Link {
- get {
- return link.Value;
- }
-
- set {
- link.Value = value;
- }
- }
-
- public string Description {
- get {
- return description.Value;
- }
-
- set {
- description.Value = value;
- }
- }
-
-#region Optional Values
- public string ManagingEditor {
- get {
- if (managingEditor == null)
- return null;
-
- return managingEditor.Value;
- }
-
- set {
- if (managingEditor == null)
- managingEditor = MakeTextElement ("managingEditor");
-
- managingEditor.Value = value;
- }
- }
-
- public string WebMaster {
- get {
- if (webMaster == null)
- return null;
-
- return webMaster.Value;
- }
-
- set {
- if (webMaster == null)
- webMaster = MakeTextElement ("webMaster");
- webMaster.Value = value;
- }
- }
-
- public string PubDate {
- get {
- if (pubDate == null)
- return null;
-
- return pubDate.Value;
- }
-
- set {
- if (pubDate == null)
- pubDate = MakeTextElement ("pubDate");
- pubDate.Value = value;
- }
- }
-
- public string LastBuildDate {
- get {
- if (lastBuildDate == null)
- return null;
-
- return lastBuildDate.Value;
- }
-
- set {
- if (lastBuildDate == null)
- lastBuildDate = MakeTextElement ("lastBuildDate");
- lastBuildDate.Value = value;
- }
- }
-
- public string Language {
- get {
- if (language == null)
- return null;
-
- return language.Value;
- }
-
- set {
- if (language == null)
- language = MakeTextElement ("language");
- language.Value = value;
- }
- }
-#endregion
- }
-
- class RSS {
- XmlDocument doc;
- XmlNode rss;
-
- const string rss_base =
- "<?xml version=\"1.0\"?> <rss version=\"0.92\"></rss>";
-
- public RSS ()
- {
- doc = new XmlDocument ();
-
- doc.LoadXml (rss_base);
- rss = doc.DocumentElement;
- }
-
- public Channel NewChannel (string title, string url)
- {
- XmlNode node = doc.CreateElement ("channel");
- Channel c;
-
- rss.AppendChild (node);
- c = new Channel (doc, node);
-
- return c;
- }
-
- public XmlDocument XmlDocument {
- get {
- return doc;
- }
- }
- }
-}
-
-
diff --git a/doc/web/src/.cvsignore b/doc/web/src/.cvsignore
deleted file mode 100755
index 5053fb08904..00000000000
--- a/doc/web/src/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.src
diff --git a/doc/web/template.html.in b/doc/web/template.html.in
deleted file mode 100644
index 16508b36201..00000000000
--- a/doc/web/template.html.in
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>#TITLE#</title>
-<style type="text/css">
-<!--
- body { font-family: "trebuchet ms", lucida, verdana, helvetica;
- background-image: url("images/bgsquares.gif");
- background-attachment: fixed; }
- body, td, table { font-family: "trebuchet ms", lucida, verdana, helvetica;
- font-size: 14px; }
-
- .navi0 { font-size: 14px; font-weight: bold; background: #444444; }
- .navi1 { font-size: 14px; font-weight: bold; left-margin: 10pt}
- .navi2 { font-size: 10px; font-weight: bold; left-margin: 20pt}
- .footnote { font-size: 12px; color: #aaaaaa; }
-
- a.navi0 { color: #ffffff; text-decoration: none}
- a.navi0:visited { color: #cccccc; }
- a.navi0:hover { color: #ee9900; text-decoration: underline; }
-
- a.navi1 { color: #ffffff; text-decoration: none; margin-left: 7px;}
- a.navi1:visited { color: #cccccc; }
- a.navi1:hover { color: #ee9900; text-decoration: underline; }
-
- a.navi2 { color: #ffffff; text-decoration: none; margin-left: 20px;}
- a.navi2:visited { color: #cccccc; }
- a.navi2:hover { color: #ee9900; text-decoration: underline; }
-
-// -->
-</style>
-#CSS#
-#SCRIPT#
-</head>
-<body bgcolor="#555555" text="#000000">
-
-<table cellpadding="0" cellspacing="0" border="0" width="100%">
- <tr>
- <td><img src="images/pixel.gif" alt=""></td><!-- left border -->
- <td colspan="4">
- <a href="http://www.go-mono.com"><img src="images/mono.gif"
- alt="mono-logo" border="0"></a></td>
- <td><img src="images/pixel.gif" alt=""></td><!-- right border -->
- </tr>
- <tr>
- <td><img src="images/pixel.gif" width="1" height="1" alt=""></td>
- <td colspan="3" bgcolor="black"><img src="images/pixel.gif"
- height="2" alt=""></td>
- <td bgcolor="black"><img src="images/pixel.gif" width="1" alt=""></td>
- <td><img src="images/pixel.gif" alt=""></td>
- </tr>
- <tr>
- <td width="100"><img src="images/pixel.gif" alt=""></td>
- <td valign="top">
- <table cellpadding="2" valign="top" cellspacing="0" border="0">
- #MENU#
- </table>
- </td>
- <td bgcolor="black" width="1"><img src="images/pixel.gif"
- width="1" alt=""></td>
- <td bgcolor="white" align="left" width="80%" valign="top">
- <table cellpadding="16">
- <tr><td>
- #CONTENT#
- </td></tr>
- </table>
- </td>
- <td bgcolor="black"><img src="images/pixel.gif" width="1" alt=""></td>
- <td width="100"><img src="images/pixel.gif" alt=""></td>
- </tr>
- <tr>
- <td colspan="2">
- <img src="images/pixel.gif" alt=""></td>
- <td colspan="2" bgcolor="black"><img src="images/pixel.gif"
- height="1" alt=""></td>
- <td bgcolor="black"><img src="images/pixel.gif" width="1" alt=""></td>
- <td><img src="images/pixel.gif" alt=""></td>
- </tr>
-
- <tr>
- <td colspan="2"></td>
- <td colspan="2" align="center">
- <a class="footnote" href="mailto:webmaster@go-mono.com">webmaster@go-mono.com</a>
- </td>
- <td colspan="2"></td>
- </tr>
- </tr>
-</table>
-
-</body>
-</html>
diff --git a/doc/winforms b/doc/winforms
deleted file mode 100644
index 2d8c1e3d79d..00000000000
--- a/doc/winforms
+++ /dev/null
@@ -1,90 +0,0 @@
-* System.Windows.Forms
-
- System.Windows.Forms eventually will support multiple
- toolkits. Ximian will be delivering a product that will allow
- for System.Windows.Forms applications to integrate with GNOME
- through Gtk and MacOS X using Cocoa.
-
- There are no current plans to support embedded devices, but
- Gtk/FrameBuffer is an option. If you have suggestions or
- recommendations, please let us <a
- href="mailto:mono-hackers-list@ximian.com">let us know</a>
-
-* Contributing
-
- Currently Ximian developers are busy making our JIT engine
- feature complete, and dealing with the low-level details of
- the Mono runtime.
-
- If you are interested in contributing, you can start stubbing
- out classes and providing enumerations. That will help us
- significantly when we start working on the actual bindings.
-
- Christian Meyer is currently organizing this effort.
-
-* System.Drawing
-
- Using existing libraries to implement some of the functionality required
-
- <ul>
- * gdk-pixbuf is a generic image loader that loads an image
- and leaves it into an RGB buffer. It hides all the details
- about what image file format is being loaded.
-
- * Libart is a general framework for rendering RGB/RGBA
- buffers into RGB buffers and rendering postscript-like paths into
- RGB/RGBA buffers.
- </ul>
-
- We want to use gdk-pixbuf as the image loader for the image
- classes, and then we need operations to render that into the
- windowing system (Gtk+, MacOS, etc). But notice how there is
- very little dependnecies in Gdk-pixbuf on gtk, and libart has
- none.
-
- They are pretty independent from a windowing system
- (gdk-pixbuf comes with some "helper" routines for rendering
- data into a pixmap and to load pixmaps into RGB buffers).
-
- A few things to keep in mind:
-
- <ul>
-
- * gdk-pixbuf can be used to load images for Gtk+,
- MacOS X and Windows, it should be pretty portable,
- although we might need in the future to back-port
- some new features from Gtk head.
-
- * Libart is probably only going to be used with X11,
- as the MacOS X provides the same features in Quartz,
- and Win32 *probably* has that in GDI+. If not, we
- should use libart in Win32 as well (or for older
- Windows systems).
- </ul>
-
-* Directory Layout
-
- System.Drawing (assembly directory)
- System.Drawing.Blah
- Common code for "Blah"
- Stubs for "Blah" to ease ports.
-
- Gtk
- System.Drawing.Blah.
- Gtk ports of "System.Drawing.Blah"
- MacOS
- System.Drawing.Blah
- MacOS ports of "System.Drawing.Blah"
- Win32
- System.Drawing.Blah
- Win32 ports of "System.Drawing.Blah"
-
- Then we use nant targets to include/exclude the right set of
- files to create the assembly.
-
-* Open questions:
-
- I believe that the graphics contexts that are used to render
- can accept either libart-like rendering operations and
- X11-like rendering operations. This complicates matters, but
- I am not sure. Someone needs to investigate this.
diff --git a/docs/.cvsignore b/docs/.cvsignore
new file mode 100644
index 00000000000..282522db034
--- /dev/null
+++ b/docs/.cvsignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 1ea3eaee8b2..81521631cff 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,3 +1,15 @@
-EXTRA_DIST = gc-issues jit-thoughts object-layout unmanaged-calls \
- exceptions jit-trampolines stack-alignment
-
+EXTRA_DIST = \
+ aot-compiler.txt \
+ assembly-bundle \
+ embedded-api \
+ exceptions \
+ gc-issues \
+ jit-thoughts \
+ jit-trampolines \
+ local-regalloc.txt \
+ mini-doc.txt \
+ mini-porting.txt \
+ opcode-decomp.txt \
+ object-layout \
+ unmanaged-calls \
+ stack-alignment \ No newline at end of file
diff --git a/docs/abc-removal.txt b/docs/abc-removal.txt
new file mode 100755
index 00000000000..8c10579eace
--- /dev/null
+++ b/docs/abc-removal.txt
@@ -0,0 +1,302 @@
+
+Here "abc" stays for "array bounds check", or "array bound checks", or
+some combination of the two...
+
+------------------------------------------------------------------------------
+USAGE
+
+Simply use the "abcrem" optimization invoking mono.
+
+To see if bound checks are actually removed, use "mono -v" and grep for
+"ARRAY-ACCESS" in the output, there should be a message for each check
+that has been removed.
+
+To trace the algorithm execution, use "-v -v -v", and be prepared to be
+totally submersed by debugging messages...
+
+------------------------------------------------------------------------------
+EFFECTIVENESS
+
+The abc removal code can now always remove bound checks from "clean"
+array scans in loops, and generally anyway there are clear conditions that
+already state that the index is "safe".
+
+To be clearer, and give an idea of what the algorithm can and cannot do
+without describing it in detail... keep in mind that only "redunant" checks
+cannot be removed. By "redundant", I mean "already explicitly checked" in
+the method code.
+
+Unfortunately, analyzing complex expressions is not so easy (see below for
+details), so the capabilities of this "abc remover" are limited.
+
+These are simple guidelines:
+- Only expressions of the following kinds are handled:
+ - constant
+ - variable [+/- constant]
+- Only comparisons between "handled" expressions are understood.
+- "switch" statements are not yet handled.
+
+This means that code like this will be handled well:
+
+for (int i = 0; i < a.Length; i++) {
+ a [i] = .....
+}
+
+The "i" variable could be declared out of the "for", the "for" could be a
+"while", and maybe even implemented with "goto", the array could be scanned
+in reverse order, and everything would still work.
+I could have a temporary variable storing the array length, and check on
+it inside the loop, and the abc removal would still occurr, like this:
+
+int i = 0;
+int l = a.Length;
+while ( i < l ) {
+ a [i] ......
+}
+
+or this:
+
+int l = a.Length;
+for (int i = l; i > 0; i--) {
+ a [i] = .....
+}
+
+The following two examples would work:
+
+for (int i = 0; i < (a.Length -1); i++) .....
+for (int i = 0; i < a.Length; i += 2) .....
+
+But just something like this
+
+int delta = -1;
+for (int i = 0; i < (a.Length + delta); i++) .....
+
+or like this
+
+int delta = +2;
+for (int i = 0; i < a.Length; i += delta) .....
+
+would not work, the check would stay there, sorry :-(
+(unless a combination of cfold, consprop and copyprop is used, too, which
+would make the constant value of "delta" explicit).
+
+Just to make you understand how things are tricky... this would work!
+
+int limit = a.Length - 1;
+for (int i = 0; i < limit; i++) {
+ a [i] = .....
+}
+
+
+A detailed explanation of the reason why things are done like this is given
+below...
+
+------------------------------------------------------------------------------
+THE ALGORITHM
+
+This array bound check removal (abc removal) algorithm is based on
+symbolic execution concepts. I handle the removal like an "unreachable
+code elimination" (and in fact the optimization could be extended to remove
+also other unreachable sections of code, due to branches that "always go the
+same way").
+
+In symbolic execution, variables do not have actual (numeric) values, but
+instead symbolic expressions (like "a", or "x+y").
+Also, branch conditions are handled like symbolic conditions (like "i<k"),
+which state relations between variable values.
+
+The SSA representation inside mini is somewhat close to a symbolic
+representation of the execution of the compiled method.
+Particularly, the representation of variable values is exactly a symbolic
+one. It is enough to find all CEE_STIND_* instructions which store to a
+local variable, and their second argument is exactly the variable value.
+Actually, "cfg->vars [<variable-index>]->def" should contain exactly
+those store instructions, and the "get_variable_value_from_ssa_store"
+function extracts the variable value from there.
+
+On the other hand, the conditions under which each basic block is
+executed are not made fully explicit.
+
+However, it is not difficult to make them so.
+Each BB that has more than one exit BB, in practice must end either with
+a conditional branch instruction or with a switch instruction.
+In the first case, the BB has exactly two exit BBs, and their execution
+conditions are easy to get from the condition of the branch (see the
+"get_relation_from_branch_instruction" function, and expecially the end of
+"analyze_block" in abcremoval.c.
+If there is a switch, the jump condition of every exit BB is the equality
+of the switch argument with the particular index associated with its case
+(but the current implementation does not handle switch statements yet).
+
+These individual conditions are in practice associated to each arc that
+connects BBs in the CFG (with the simple case that unconditional branches
+have a "TRUE" condition, because they always happen).
+
+So, for each BB, its *proper* entry condition is the union of all the
+conditions associated to arcs that enter the BB. The "union" is like a
+logical "or", in the sense that either of the condition could be true,
+they are not necessarily all true. This means that if I can enter a BB
+in two ways, and in one case I know that "x>0", and in the other that
+"x==0", actually in the BB I know that "x>=0", which is a weaker
+condition (the union of the two).
+
+Also, the *complete* entry condition for a BB is the "intersection" of all
+the entry conditions of its dominators. This is true because each dominator
+is the only way to reach the BB, so the entry condition of each dominator
+must be true if the control flow reached the BB. This translates to the
+logical "and" of all the "proper" conditions of the BBs met walking up in the
+dominator tree. So, if one says "x>0", and another "x==1", then I know
+that "x==1", which is a stronger condition (the intersection of the two).
+Note that, if the two conditions were "x>0" and "x==0", then the block would
+be unreachable (the intersection is empty), because some branch is impossible.
+
+Another observation is that, inside each BB, every variable is subject to the
+complete entry condition of that very same BB, and not the one in which it is
+defined (with the "complete entry condition" being the thing I defined before,
+sorry if these terms "proper" and "complete" are strange, I found nothing
+better).
+This happens because the branch conditions are related to the control flow.
+I can define "i=a", and if I am in a BB where "a>0", then "i>0", but not
+otherwise.
+
+So, intuitively, if the available conditions say "i>=0", and i is used as an
+index in an array access, then the lower bound check can be omitted.
+If the condition also says "(i>=0)&&(i<array.length)", the abc removal can
+occur.
+
+So, a complete solution to the problem of abc removal would be the following:
+for each array access, build a system of equations containing:
+[1] all the symbolic variable definitions
+[2] the complete entry condition of the BB in which the array access occurs
+[3] the two "goal functions" ("index >=0" and "index < array.length")
+If the system is valid for *each possible* variable value, then the goal
+functions are always true, and the abc can be removed.
+
+All this discussion is useful to give a precise specification to the problem
+we are trying to solve.
+The trouble is that, in the general case, the resulting system of equations
+is like a predicate in first order logic, which is semi-decidable, and its
+general solution is anyway too complex to be attempted in a JIT compiler
+(which should not contain a full fledged theorem prover).
+
+Therefore, we must cut some corner.
+
+
+By the way, there is also another big problem, which is caused by "recursive"
+symbolic definitions. These definition can (and generally do) happen every
+time there is a loop. For instance, in the following piece of code
+
+for ( int i = 0; i < array.length; i++ ) {
+ Console.WriteLine( "array [i] = " + array [i] );
+}
+
+one of the definitions of i is a PHI that can be either 0 or "i + 1".
+
+Now, we know that mathematically "i = i + 1" does not make sense, and in
+fact symbolic values are not "equations", they are "symbolic definitions".
+
+The actual symbolic value of i is a generic "n", where "n" is the number of
+iterations of the loop, but this is terrible to handle (and in more complex
+examples the symbolic value of i simply cannot be written, because i is
+calculated in an iterative way).
+
+However, the definition "i = i + 1" tells us something about i: it tells us
+that i "grows". So (from the PHI definition) we know that i is either 0, or
+"grows". This is enough to tell that "i>=0", which is what we want!
+It is important to note that recursive definitions can only occurr inside
+PHI definitions, because actually a variable cannot be defined *only* in terms
+of itself!
+
+
+At this point, I can explain which corners I want to cut to make the
+problem solvable. It will not remove all the abc that could theoretically
+be removed, but at least it will work.
+
+The easiest way to cut corners is to only handle expressions which are
+"reasonably simple", and ignore the rest.
+Keep in mind that ignoring an expression is not harmful in itself.
+The algorithm will be simply "less powerful", because it will ignore
+conditions that could have caused to the removal of an abc, but will
+not remove checks "by mistake" (so the resulting code will be in any case
+correct).
+
+The expressions we handle are the following (all of integer type):
+- constant
+- variable
+- variable + constant
+- constant + variable
+- variable - constant
+
+And, of course, PHI definitions.
+Any other expression causes the introduction of an "any" value in the
+evaluation, which makes all values that depend from it unknown as well.
+
+We will call these kind of definitions "summarizable" definitions.
+
+In a first attempt, we can consider only branch conditions that have the
+simplest possible form (the comparison of two summarizable expressions).
+
+We can also simplify the effect of variable definitions, keeping only
+what is relevant to know: their value range with respect to zero and with
+respect to the length of the array we are currently handling.
+
+One particular note on PHI functions: they work (obviously) like the logical
+"or" of their definitions, and therefore are equivalent to the "logical or"
+of the summarization of their definitions.
+
+About recursive definitions (which, believe me, are the worst thing in all
+this mess), we handle only "monotonic" ones. That is, we try to understand
+if the recursive definition (which, as we said above, must happen because
+of a loop) always "grows" or "gets smaller". In all other cases, we decide
+we cannot handle it.
+
+
+One critical thing, once we have defined all these data structures, is how
+the evaluation is actually performed.
+
+In a first attempt I coded a "brute force" approach, which for each BB
+tried to examine all possible conditions between all variables, filling
+a sort of "evaluation matrix". The problem was that the complexity of this
+evaluation was quadratic (or worse) on the number of variables, and that
+many wariables were examined even if they were not involved in any array
+access.
+
+Following the ABCD paper (http://citeseer.ist.psu.edu/bodik00abcd.html),
+I rewrote the algorithm in a more "sparse" way.
+Now, the main data structure is a graph of relations between variables, and
+each attempt to remove a check performs a traversal of the graph, looking
+for a path from the index to the array length that satisfies the properties
+"index >= 0" and "index < length". If such a path is found, the check is
+removed. It is true that in theory *each* traversal has a complexity which
+is exponential on the number of variables, but in practice the graph is not
+very connected, so the traversal terminates quickly.
+
+
+Then, the algorithm to optimize one method looks like this:
+
+[1] Preparation:
+ [1a] Build the SSA representation.
+ [1b] Prepare the evaluation graph (empty)
+ [1b] Summarize each varible definition, and put the resulting relations
+ in the evaluation graph
+[2] Analyze each BB, starting from the entry point and following the
+ dominator tree:
+ [2a] Summarize its entry condition, and put the resulting relations
+ in the evaluation graph (this is the reason why the BBs are examined
+ following the dominator tree, so that conditions are added to the
+ graph in a "cumulative" way)
+ [2b] Scan the BB instructions, and for each array access perform step [3]
+ [2c] Process children BBs following the dominator tree (step [2])
+ [2d] Remove from the evaluation area the conditions added at step [2a]
+ (so that backtracking along the tree the area is properly cleared)
+[3] Attempt the removal:
+ [3a] Summarize the index expression, to see if we can handle it; there
+ are three cases: the index is either a constant, or a variable (with
+ an optional delta) or cannot be handled (is a "any")
+ [3b] If the index can be handled, traverse the evaluation area searching
+ a path from the index variable to the array length (if the index is
+ a constant, just examine the array length to see if it has some
+ relation with this constant)
+ [3c] Use the results of step [3b] to decide if the check is redundant
+
+
diff --git a/docs/aot-compiler.txt b/docs/aot-compiler.txt
new file mode 100644
index 00000000000..ab1af90d965
--- /dev/null
+++ b/docs/aot-compiler.txt
@@ -0,0 +1,44 @@
+Mono Ahead Of Time Compiler
+===========================
+
+The new mono JIT has sophisticated optimization features. It uses SSA and has a
+pluggable architecture for further optimizations. This makes it possible and
+efficient to use the JIT also for AOT compilation.
+
+
+* file format: We use the native object format of the platform. That way it is
+ possible to reuse existing tools like objdump and the dynamic loader. All we
+ need is a working assembler, i.e. we write out a text file which is then
+ passed to gas (the gnu assembler) to generate the object file.
+
+* file names: we simply add ".so" to the generated file. For example:
+ basic.exe -> basic.exe.so
+ corlib.dll -> corlib.dll.so
+
+* staring the AOT compiler: mini --aot assembly_name
+
+The following things are saved in the object file:
+
+* version infos:
+
+* native code: this is labeled with method_XXXXXXXX: where XXXXXXXX is the
+ hexadecimal token number of the method.
+
+* additional informations needed by the runtime: For example we need to store
+ the code length and the exception tables. We also need a way to patch
+ constants only available at runtime (for example vtable and class
+ addresses). This is stored i a binary blob labeled method_info_XXXXXXXX:
+
+PROBLEMS:
+
+- all precompiled methods must be domain independent, or we add patch infos to
+ patch the target doamin.
+
+- the main problem is how to patch runtime related addresses, for example:
+
+ - current application domain
+ - string objects loaded with LDSTR
+ - address of MonoClass data
+ - static field offsets
+ - method addreses
+ - virtual function and interface slots
diff --git a/docs/assembly-bundle b/docs/assembly-bundle
new file mode 100644
index 00000000000..3e64e147cb1
--- /dev/null
+++ b/docs/assembly-bundle
@@ -0,0 +1,57 @@
+
+ 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.
+
+
diff --git a/docs/embedded-api b/docs/embedded-api
new file mode 100644
index 00000000000..76f45f8be73
--- /dev/null
+++ b/docs/embedded-api
@@ -0,0 +1,284 @@
+
+ Embedding the Mono runtime, preliminary version
+ Miguel de Icaza (miguel@ximian.com),
+ Paolo Molaro (lupus@ximian.com)
+
+ This document describes how to embed the Mono runtime in your
+ application, and how to invoke CIL methods from C, and how to
+ invoke C code from CIL. Both the JIT and interpreter can be
+ embedded in very similar ways so most of what is described
+ here can be used in either case.
+
+* Embedding the runtime.
+
+ Embedding the runtime consists of various steps:
+
+ * Compiling and linking the Mono runtime
+
+ * Initializing the Mono runtime
+
+ * Optionally expose C code to the C#/CIL universe.
+
+ These are discussed in detail next.
+
+** Compiling and Linking
+
+ To embed the runtime, you have to link your code against the
+ Mono runtime libraries. To do this, you want to pass the
+ flags returned by pkg-config to your compiler:
+
+ pkg-config --cflags --libs mono
+
+ is used to get the flags for the JIT runtime and
+
+ pkg-config --cflags --libs mint
+
+ for the interpreted runtime.
+
+ Like this:
+
+ gcc sample.c `pkg-config --cflags --libs mono`
+
+ You can separate the compilation flags from the linking flags, for
+ instance, you can use the following macros in your makefile:
+
+ CFLAGS=`pkg-config --cflags mono`
+ LDFLAGS=`pkg-config --libs mono`
+
+** Initializing the Mono runtime
+
+ To initialize the JIT runtime, call mono_jit_init, like this:
+
+ #include <mono/mini/jit.h>
+
+ MonoDomain *domain;
+
+ domain = mono_jit_init ("domain-name");
+
+ For the interpreted runtime use mono_interp_init instead:
+
+ #include <mono/interpreter/embed.h>
+
+ MonoDomain *domain;
+
+ domain = mono_interp_init ("domain-name");
+
+ That will return a MonoDomain where your code will be
+ executed. You can create multiple domains. Each domain is
+ isolated from the other domains and code in one domain will
+ not interfere with code in other domains. This is useful if
+ you want to host different applications in your program.
+
+ Now, it is necessary to transfer control to Mono, and setup
+ the threading infrastructure, you do this like this:
+
+ void *user_data = NULL;
+
+ mono_runtime_exec_managed_code (domain, main_thread_handler, user_data);
+
+ Where your main_thread_handler can load your assembly and execute it:
+
+ static void main_thread_handler (gpointer user_data)
+
+ MonoAssembly *assembly;
+
+ assembly = mono_domain_assembly_open (domain, "file.dll");
+ if (!assembly)
+ error ();
+
+ In the above example, the contents of `file.dll' will be
+ loaded into the domain. This only loads the code, but it will
+ not execute anything yet. You can replace `file.dll' with
+ another transport file, like `file.exe'
+
+ To start executing code, you must invoke a method in the
+ assembly, or if you have provided a static Main method (an
+ entry point), you can use the convenience function:
+
+ retval = mono_jit_exec (domain, assembly, argc - 1, argv + 1);
+
+ or when using the interpreter use:
+
+ retval = mono_interp_exec (domain, assembly, argc - 1, argv + 1);
+
+ If you want to invoke a different method, look at the
+ `Invoking Methods in the CIL universe' section later on.
+
+** Shutting down the runtime
+
+ To shutdown the Mono runtime, you have to clean up all the
+ domains that were created, use this function:
+
+ mono_jit_cleanup (domain);
+
+ Or in the case of the interpreted runtime use:
+
+ mono_interp_cleanup (domain);
+
+** Applications that use threads.
+
+ The Boehm GC system needs to catch your calls to the pthreads
+ layer, so in each file where you use pthread.h you should
+ include the <gc/gc.h> file.
+
+ If you can not do this for any reasons, just remember that you
+ can not store pointers to Mono Objects on the stack, you can
+ store them safely in the heap, or in global variables though
+
+* Exposing C code to the CIL universe
+
+ The Mono runtime provides two mechanisms to expose C code to
+ the CIL universe: internal calls and native C code. Internal
+ calls are tightly integrated with the runtime, and have the
+ least overhead, as they use the same data types that the
+ runtime uses.
+
+ The other option is to use the Platform Invoke (P/Invoke) to
+ call C code from the CIL universe, using the standard P/Invoke
+ mechanisms.
+
+ To register an internal call, use this call in the C code:
+
+ mono_add_internal_call ("Hello::Sample", sample);
+
+ Now, you need to declare this on the C# side:
+
+ using System;
+ using System.Runtime.CompilerServices;
+
+ class Hello {
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static string Sample ();
+ }
+
+ Since this routine returns a string, here is the C definition:
+
+ static MonoString*
+ Sample ()
+ {
+ return mono_string_new (mono_domain_get (), "Hello!");
+ }
+
+ Notice that we have to return a `MonoString', and we use the
+ `mono_string_new' API call to obtain this from a string.
+
+* Invoking Methods in the CIL universe
+
+ Calling a method in the CIL universe from C requires a number of steps:
+
+ * Obtaining the MonoMethod handle to the method.
+
+ * The method invocation.
+
+** Obtaining a MonoMethod
+
+ To get a MonoMethod there are several ways.
+
+ You can get a MonoClass (the structure representing a type)
+ using:
+
+ MonoClass *
+ mono_class_from_name (MonoImage *image, const char* name_space, const char *name);
+
+ and then loop in the returned class method array until you get
+ the one you're looking for. There are examples of such
+ searches as static functions in several C files in
+ metadata/*.c: we need to expose one through the API and remove
+ the duplicates.
+
+ The other, simpler, way is to use the functions in
+ debug-helpers.h: there are examples of their use in monograph,
+ mint and the jit as well. You basically use a string
+ description of the method, like:
+
+ "System.Object:GetHashCode()"
+
+ and create a MonoMethodDesc out of it with:
+
+ MonoMethodDesc* mono_method_desc_new (const char *name, gboolean include_namespace);
+
+ You can then use:
+
+ MonoMethod* mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass);
+ MonoMethod* mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image);
+
+ to search for the method in a class or in an image. You would
+ tipically do this just once at the start of the program and
+ store the result for reuse somewhere.
+
+** Invoking a Method
+
+ There are two functions to call a managed method:
+
+ MonoObject*
+ mono_runtime_invoke (MonoMethod *method, void *obj, void **params,
+ MonoObject **exc);
+ and
+ MonoObject*
+ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
+ MonoObject **exc);
+
+ obj is the 'this' pointer, it should be NULL for static
+ methods, a MonoObject* for object instances and a pointer to
+ the value type for value types.
+
+ These functions can be used in both the JIT and the interpreted
+ environments.
+
+ The params array contains the arguments to the method with the
+ same convention: MonoObject* pointers for object instances and
+ pointers to the value type otherwise. The _invoke_array
+ variant takes a C# object[] as the params argument (MonoArray
+ *params): in this case the value types are boxed inside the
+ respective reference representation.
+
+ From unmanaged code you'll usually use the
+ mono_runtime_invoke() variant.
+
+ Note that this function doesn't handle virtual methods for
+ you, it will exec the exact method you pass: we still need to
+ expose a function to lookup the derived class implementation
+ of a virtual method (there are examples of this in the code,
+ though).
+
+ You can pass NULL as the exc argument if you don't want to
+ catch exceptions, otherwise, *exc will be set to the exception
+ thrown, if any. if an exception is thrown, you can't use the
+ MonoObject* result from the function.
+
+ If the method returns a value type, it is boxed in an object
+ reference.
+
+ We have plans for providing an additional method that returns
+ an unmanaged->managed thunk like this:
+
+ void* mono_method_get_unmanaged_thunk (MonoMethod *method);
+
+ You'll be able to store the returned pointer in a function
+ pointer with the proper signature and call that directly from
+ C:
+
+ typedef gint32 (*GetHashCode) (MonoObject *obj);
+
+ GetHashCode func = mono_method_get_unmanaged_thunk (System_Object_GetHashCode_method);
+
+ gint32 hashvalue = func (myobject);
+
+ It may not be possible to manage exceptions in that case,
+ though. I need to think more about it.
+
+** Threading issues
+
+ If your application creates threads on its own, and you want them to
+ be able to call code into the CIL universe with Mono, you have to
+ register the thread with Mono before issuing the call.
+
+ To do so, call the mono_thread_attach() function before you execute
+ any managed code from the thread
+
+* Samples
+
+ See the sample programs in mono/sample/embed for examples of
+ embedding the Mono runtime in your application.
+
+
diff --git a/docs/exceptions b/docs/exceptions
index 05f1be03bba..d5ecaeead43 100644
--- a/docs/exceptions
+++ b/docs/exceptions
@@ -1,5 +1,6 @@
-Author: Dietmar Maurer (dietmar@ximian.com)
-(C) 2001 Ximian, Inc.
+ Exception Implementation in the Mono Runtime
+ Dietmar Maurer (dietmar@ximian.com)
+ (C) 2001 Ximian, Inc.
Exception implementation (jit):
===============================
@@ -56,15 +57,54 @@ leave: is simply translated into a branch to the target. If the leave
instruction is inside a finally block (but not inside another handler)
we call the finally handler before we branch to the target.
-finally/endfinally: is translated into subroutine ending with a "return"
-statement. The subroutine does not save EBP/ESP, because we need access to the
-local variables of the enclosing method. We have to use a "call"
-instruction to execute such finally handlers. This makes it possible to
-execute them inside the stack unwinding code.
+finally/endfinally, filter/endfilter: is translated into subroutine ending with
+a "return" statement. The subroutine does not save EBP, because we need access
+to the local variables of the enclosing method. Its is possible that
+instructions inside those handlers modify the stack pointer, thus we save the
+stack pointer at the start of the handler, and restore it at the end. We have
+to use a "call" instruction to execute such finally handlers. This makes it
+also possible to execute them inside the stack unwinding code. The exception
+object for filters is passed in a local variable (cfg->exvar).
-throw: we first save all regs into a sigcontext struct (we pass the
-exception object in register ECX), and then call the stack unwinding
-code.
+throw: we first save all regs into a sigcontext struct and then call the stack
+unwinding code.
-catch handler: receives the exception object in ECX. They store that
-object into a local variable, so that rethrow can access the object.
+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
diff --git a/docs/file-share-modes b/docs/file-share-modes
new file mode 100644
index 00000000000..7be1919912d
--- /dev/null
+++ b/docs/file-share-modes
@@ -0,0 +1,173 @@
+Rules for opening shared files
+==============================
+
+File is already open, with share set to none:
+
+ Can not open again
+
+
+File is already open for reading, with read share:
+
+ Can open for reading only, share must include read (can have write too)
+
+
+File is already open for reading, with write share:
+
+ Can open for writing only, share must include read (can have write too)
+
+
+File is already open for reading, with read + write share:
+
+ Can open for read, writing or both, share must include read (can have write too)
+
+
+File is already open for writing, with read share:
+
+ Can open for reading only, share must include write (can have read too)
+
+
+File is already open for writing, with write share:
+
+ Can open for writing only, share must include write (can have read too)
+
+
+File is already open for writing, with read + write share:
+
+ Can open for reading, writing or both, share must include write (can have read too)
+
+
+File is already open for reading + writing, with read share:
+
+ Can open for reading only, share must be read + write
+
+
+File is already open for reading + writing, with write share:
+
+ Can open for for writing only, share must be read + write
+
+
+File is already open for reading + writing, with read + write share:
+
+ Can open for read, writing or both, share must be read + write
+
+
+
+Executive Summary
+-----------------
+
+ Second open must have access within first share, must set second share to at least first access
+
+
+
+
+Documenting code
+----------------
+
+
+#include <stdio.h>
+#include <windows.h>
+
+int access[] = {
+ GENERIC_READ,
+ GENERIC_WRITE,
+ GENERIC_READ | GENERIC_WRITE
+};
+
+char *access_names[] = {
+ "G_READ",
+ "G_WRITE",
+ "G_READ|G_WRITE"
+};
+
+int share[] = {
+ FILE_SHARE_READ,
+ FILE_SHARE_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE
+};
+
+char *share_names[] = {
+ "SHARE_READ",
+ "SHARE_WRITE",
+ "SHARE_READ|SHARE_WRITE"
+};
+
+void lockfiles(int access1, int share1, int access2, int share2)
+{
+ HANDLE h1, h2;
+ BOOL ret;
+
+ if (access2 == 0 && share2 == 0) {
+ printf("\n");
+ printf("%22.22s\n%22.22s", access_names[access1], share_names[share1]);
+ }
+
+ h1 = CreateFile("lockedfile",
+ access[access1],
+ share[share1],
+ NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h1 == INVALID_HANDLE_VALUE) {
+ printf("Open1 failed: %d\n", GetLastError());
+ return;
+ }
+
+ h2 = CreateFile("lockedfile",
+ access[access2],
+ share[share2],
+ NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h2 == INVALID_HANDLE_VALUE) {
+ printf(" %4.4s", "");
+ } else {
+ printf(" %4.4s", "OK");
+ CloseHandle(h2);
+ }
+
+ CloseHandle(h1);
+}
+
+int main(int argc, char **argv)
+{
+ int i, j, k, l;
+
+ printf("\t\t\t\t\t\t\tSecond Open\n");
+ printf("%22.22s G_RE G_RE G_RE G_WR G_WR G_WR G_RW G_RW G_RW\n", "");
+ printf("%22.22s S_RE S_WR S_RW S_RE S_WR S_RW S_RE S_WR S_RW", "First open --v ");
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 3; j++) {
+ for (k = 0; k < 3; k++) {
+ for (l = 0; l < 3; l++) {
+ lockfiles(i, j, k, l);
+ }
+ }
+ }
+ }
+
+ return(0);
+}
+
+
+
+Code output
+-----------
+
+ Second Open
+ G_RE G_RE G_RE G_WR G_WR G_WR G_RW G_RW G_RW
+ First open --v S_RE S_WR S_RW S_RE S_WR S_RW S_RE S_WR S_RW
+ G_READ
+ SHARE_READ OK OK
+ G_READ
+ SHARE_WRITE OK OK
+ G_READ
+SHARE_READ|SHARE_WRITE OK OK OK OK OK OK
+ G_WRITE
+ SHARE_READ OK OK
+ G_WRITE
+ SHARE_WRITE OK OK
+ G_WRITE
+SHARE_READ|SHARE_WRITE OK OK OK OK OK OK
+ G_READ|G_WRITE
+ SHARE_READ OK
+ G_READ|G_WRITE
+ SHARE_WRITE OK
+ G_READ|G_WRITE
+SHARE_READ|SHARE_WRITE OK OK OK
+
diff --git a/docs/gc-variables-in-c b/docs/gc-variables-in-c
new file mode 100644
index 00000000000..61a7802fc18
--- /dev/null
+++ b/docs/gc-variables-in-c
@@ -0,0 +1,96 @@
+ Handling GC allocated objects in C
+
+As part of an effort to improve our GC, we need to keep track
+precisely of where objects are stored, so we can incrementally move
+from the current conservative GC to a more advanced precise and moving GC.
+Previously, all global C variables were considered GC roots, but this makes
+the GC less efficient and increases the chances false references are found
+to GC memory, hence retaining more memory than needed.
+We need to tell the GC that some object is supposed to be kept alive
+as if it was referenced in a global variable.
+
+For Mono embedders
+------------------
+
+In C#, if you say:
+class T {
+ static object o;
+}
+
+Any object which is stored in `o' is considered to be alive -- it will
+not be collected. `o' is a member of the root set for the GC.
+
+However, in C code, this is not the case. If you have:
+
+static MonoObject* o = NULL;
+
+The object in `o' will *NOT* be scanned.
+
+If you need to store an object in a C variable and prevent it from being
+collected, you need to acquire a GC handle for it.
+
+ guint32 handle = mono_gchandle_new (my_object, TRUE);
+
+TRUE means the object will be pinned, so it won't move in memory
+when we'll use a moving GC. You can access the MonoObject* referenced by
+a handle with:
+
+ MonoObject* obj = mono_gchandle_get_target (handle);
+
+When you don't need the handle anymore you need to call:
+
+ mono_gchandle_free (handle);
+
+Note that if you assign a new object to the C var, you need to get a new
+handle, it's not enough to store a new object in the C var.
+
+So code that looked like this:
+
+ static MonoObject* o = NULL;
+ ...
+ o = mono_object_new (...);
+ /* use o */
+ ...
+ /* when done to allow the GC to collect o */
+ o = NULL;
+
+should now be changed to:
+
+ static guint32 o_handle;
+ ...
+ MonoObject *o = mono_object_new (...);
+ o_handle = mono_gchandle_new (o, TRUE);
+ /* use o or mono_gchandle_get_target (o_handle) */
+ ...
+ /* when done to allow the GC to collect o */
+ mono_gchandle_free (o_handle);
+
+
+For Mono runtime developers
+---------------------------
+
+There are two kinds of static vars used to store pointers to GC memory
+that we need to consider:
+*) objects
+*) other memory chunks allocated with GC_MALLOC().
+
+Objects should be dealt with the GC handle support as detailed above.
+Other items should register the static pointer as an area to be considered
+part of the root set with the following:
+
+ static gpointer my_gc_data = NULL;
+ ...
+ MONO_GC_REGISTER_ROOT (my_gc_data);
+ my_gc_data = GC_MALLOC (...);
+
+Note that this registration is not necessary for *LOCAL* variables,
+as they are stored on the stack. It is only necessary for global variables,
+as they are not a part of the GC's root set.
+
+Once you have done the MONO_GC_REGISTER_ROOT, the variable is just like
+a static variable in C#. To keep an object alive, you have the variable reference
+the GC memory, to remove the reference, set the variable to NULL.
+
+As we prepare the code for a precise GC, GC_MALLOC () will not be used anymore
+in this way in most cases: we'll have a mechanism to specify exactly where
+references to GC memory is stored. \ No newline at end of file
diff --git a/docs/internal-calls b/docs/internal-calls
index 2f3d4abbda0..1fed33078e4 100644
--- a/docs/internal-calls
+++ b/docs/internal-calls
@@ -1,7 +1,19 @@
+ Internal Call Topics
-* How to map C# types for use in the C implementation of internal calls
+* Introduction
+
+ The Common Language Infrastructure allows for methods to be
+ implemented in unmanaged code. Unlike the Platform Invocation
+ services which provide marshalling and unmarshalling of data
+ from managed to unmanaged and viceversa the Internal calls do
+ not perform any kind of marshalling.
+
+* Basic Type mapping
+
+ The following lists how the C# types are exposed to the C API.
C# type C type
+ -----------------------------
char gunichar2
bool MonoBoolean
sbyte signed char
@@ -16,44 +28,57 @@
object MonoObject*
string MonoString*
-For ref and out paramaters you'll use the corresponding pointer type.
-Arrays of any type must be described with a MonoArray* and the elements
-must be accessed with the mono_array_* macros.
-Any other type that has a matching C structure representation, should use
-a pointer to the struct instead of a generic MonoObject pointer.
+* Pointers
-Instance methods that are internal calls will receive as first argument
-the instance object, so you must account for it in the C method signature:
+ For ref and out paramaters you'll use the corresponding
+ pointer type.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override int GetHashCode ();
+ So if you have a C# type listed as "ref int", you should use
+ "int *" in your implementation.
-becaomes:
+* Arrays
- gint32 ves_icall_System_String_GetHashCode (MonoString *this);
+ Arrays of any type must be described with a MonoArray* and the
+ elements must be accessed with the mono_array_* macros.
+* Other Structures
+ Any other type that has a matching C structure representation,
+ should use a pointer to the struct instead of a generic
+ MonoObject pointer.
-* How to hook internal calls with the runtime
-
-Once you require an internal call in corlib, you need to create a C
-implementation for it and register it in a static table in metadata/icall.c.
-Add an entry in the table like:
+* Instance Methods.
- "System.String::GetHashCode", ves_icall_System_String_GetHashCode,
+ Instance methods that are internal calls will receive as first argument
+ the instance object, so you must account for it in the C method signature:
-Note that you need to include the full namespace.name of the class.
-If there are overloaded methods, you need also to specify the signature
-of _all_ of them:
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public extern override int GetHashCode ();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override void DoSomething ();
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override void DoSomething (bool useful);
+ becomes:
-should be mapped with:
+ gint32 ves_icall_System_String_GetHashCode (MonoString *this);
- "Namespace.ClassName::DoSomething()", ves_icall_Namespace_ClassName_DoSomething,
- "Namespace.ClassName::DoSomething(bool)", ves_icall_Namespace_ClassName_DoSomething_bool,
+* How to hook internal calls with the runtime
+ Once you require an internal call in corlib, you need to
+ create a C implementation for it and register it in a static
+ table in metadata/icall.c. Add an entry in the table like:
+
+ "System.String::GetHashCode", ves_icall_System_String_GetHashCode,
+
+ Note that you need to include the full namespace.name of the
+ class. If there are overloaded methods, you need also to
+ specify the signature of _all_ of them:
+
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public extern override void DoSomething ();
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ public extern override void DoSomething (bool useful);
+
+ should be mapped with:
+
+ "Namespace.ClassName::DoSomething()", ves_icall_Namespace_ClassName_DoSomething,
+ "Namespace.ClassName::DoSomething(bool)", ves_icall_Namespace_ClassName_DoSomething_bool,
+
diff --git a/docs/ir-desc b/docs/ir-desc
new file mode 100644
index 00000000000..0c1ab531f0b
--- /dev/null
+++ b/docs/ir-desc
@@ -0,0 +1,75 @@
+Mono Intermediate Representation Documentation
+
+Operation: OP_ADDCC_IMM
+
+ Add immediate that will set the carry flag.
+
+ dreg:
+ Destination register
+ inst_imm
+ Immediate value to add.
+ sreg1:
+ Source register to add.
+
+Operation: OP_CALL_HANDLER.
+
+ cil_code:
+ Points to the CIL where the LEAVE or LEAVE_S
+ instruction was found.
+
+ inst_target_bb:
+ The target basic block for this invocation.
+
+ This instruction must call the target basic block.
+
+Operation: OP_CISINST
+
+ Implements the CEE_MONO_CISINST opcode that is decoded from
+ the CIL stream.
+
+ This opcode takes as input an object reference and a class,
+ and leaves on the assigned register:
+
+ 0. if the object is an instance of the class,
+ 1. if the object is not instance of the class,
+ 2. if the object is a proxy whose type cannot be determined.
+
+Operation: OP_CCASTCLASS
+
+ Implements the CEE_MONO_CCASTCLASS opcode that is decoded from
+ the CIL stream.
+
+ This opcode takes as input an object reference and a class,
+ and leaves on the assigned register:
+
+ 0. if the object is an instance of the class,
+ 1. if the object is a proxy whose type cannot be determined
+
+ throws an InvalidCastException exception otherwise.
+
+Operation: OP_LOCALLOC
+ inst_left:
+ The value
+ ins->inst_left = *sp;
+ ins->cil_code = ip;
+
+ This is the equivalent of alloca() in a C implementation: it
+ allocates a bunch of bytes on the stack dynamically. Local
+ variables are allocated statically in the stack instead.
+
+ It is implemented by moving the stack pointer according to the
+ platform ABI: you may need to keep a specific frame register
+ to address local variables when LOCALLOC is used (the PPC code
+ does this, for example: ifyou're doing the s390 port I suggest
+ starting from that)
+
+Operation: OP_SUBCC_IMM
+
+ Substract immediate that will set the borrow flag.
+
+ dreg:
+ Destination register
+ inst_imm
+ Immediate value to add.
+ sreg1:
+ Source register to add.
diff --git a/docs/local-regalloc.txt b/docs/local-regalloc.txt
new file mode 100644
index 00000000000..a6e523557fe
--- /dev/null
+++ b/docs/local-regalloc.txt
@@ -0,0 +1,208 @@
+
+* 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
diff --git a/docs/mini-doc.txt b/docs/mini-doc.txt
new file mode 100644
index 00000000000..bd4b489777e
--- /dev/null
+++ b/docs/mini-doc.txt
@@ -0,0 +1,771 @@
+
+ A new JIT compiler for the Mono Project
+
+ Miguel de Icaza (miguel@{ximian.com,gnome.org}),
+ Paolo Molaro (lupus@{ximian.com,debian.org})
+
+
+* Abstract
+
+ Mini is a new compilation engine for the Mono runtime. The
+ new engine is designed to bring new code generation
+ optimizations, portability and pre-compilation.
+
+ In this document we describe the design decisions and the
+ architecture of the new compilation engine.
+
+* Introduction
+
+ Mono is a Open Source implementation of the .NET Framework: it
+ is made up of a runtime engine that implements the ECMA Common
+ Language Infrastructure (CLI), a set of compilers that target
+ the CLI and a large collection of class libraries.
+
+ This article discusses the new code generation facilities that
+ have been added to the Mono runtime.
+
+ First we discuss the overall architecture of the Mono runtime,
+ and how code generation fits into it; Then we discuss the
+ development and basic architecture of our first JIT compiler
+ for the ECMA CIL framework. The next section covers the
+ objectives for the work on the new JIT compiler, then we
+ discuss the new features available in the new JIT compiler,
+ and finally a technical description of the new code generation
+ engine.
+
+* Architecture of the Mono Runtime
+
+ The Mono runtime is an implementation of the ECMA Common
+ Language Infrastructure (CLI), whose aim is to be a common
+ platform for executing code in multiple languages.
+
+ Languages that target the CLI generate images that contain
+ code in high-level intermediate representation called the
+ "Common Intermediate Language". This intermediate language is
+ rich enough to allow for programs and pre-compiled libraries
+ to be reflected. The execution environment allows for an
+ object oriented execution environment with single inheritance
+ and multiple interface implementations.
+
+ This runtime provides a number of services for programs that
+ are targeted to it: Just-in-Time compilation of CIL code into
+ native code, garbage collection, thread management, I/O
+ routines, single, double and decimal floating point,
+ asynchronous method invocation, application domains, and a
+ framework for building arbitrary RPC systems (remoting) and
+ integration with system libraries through the Platform Invoke
+ functionality.
+
+ The focus of this document is on the services provided by the
+ Mono runtime to transform CIL bytecodes into code that is
+ native to the underlying architecture.
+
+ The code generation interface is a set of macros that allow a
+ C programmer to generate code on the fly, this is done
+ through a set of macros found in the mono/jit/arch/ directory.
+ These macros are used by the JIT compiler to generate native
+ code.
+
+ The platform invocation code is interesting, as it generates
+ CIL code on the fly to marshal parameters, and then this
+ code is in turned processed by the JIT engine.
+
+* Previous Experiences
+
+ Mono has built a JIT engine, which has been used to bootstrap
+ Mono since January, 2002. This JIT engine has reasonable
+ performance, and uses an tree pattern matching instruction
+ selector based on the BURS technology. This JIT compiler was
+ designed by Dietmar Maurer, Paolo Molaro and Miguel de Icaza.
+
+ The existing JIT compiler has three phases:
+
+ * Re-creation of the semantic tree from CIL
+ byte-codes.
+
+ * Instruction selection, with a cost-driven
+ engine.
+
+ * Code generation and register allocation.
+
+ It is also hooked into the rest of the runtime to provide
+ services like marshaling, just-in-time compilation and
+ invocation of "internal calls".
+
+ This engine constructed a collection of trees, which we
+ referred to as the "forest of trees", this forest is created by
+ "hydrating" the CIL instruction stream.
+
+ The first step was to identify the basic blocks on the method,
+ and computing the control flow graph (cfg) for it. Once this
+ information was computed, a stack analysis on each basic block
+ was performed to create a forest of trees for each one of
+ them.
+
+ So for example, the following statement:
+
+ int a, b;
+ ...
+ b = a + 1;
+
+ Which would be represented in CIL as:
+
+ ldloc.0
+ ldc.i4.1
+ add
+ stloc.1
+
+ After the stack analysis would create the following tree:
+
+ (STIND_I4 ADDR_L[EBX|2] (
+ ADD (LDIND_I4 ADDR_L[ESI|1])
+ CONST_I4[1]))
+
+ This tree contains information from the stack analysis: for
+ instance, notice that the operations explicitly encode the
+ data types they are operating on, there is no longer an
+ ambiguity on the types, because this information has been
+ inferred.
+
+ At this point the JIT would pass the constructed forest of
+ trees to the architecture-dependent JIT compiler.
+
+ The architecture dependent code then performed register
+ allocation (optionally using linear scan allocation for
+ variables, based on life analysis).
+
+ Once variables had been assigned, a tree pattern matching with
+ dynamic programming is used (the tree pattern matcher is
+ custom build for each architecture, using a code
+ generator: monoburg). The instruction selector used cost
+ functions to select the best instruction patterns.
+
+ The instruction selector is able to produce instructions that
+ take advantage of the x86 instruction indexing instructions
+ for example.
+
+ One problem though is that the code emitter and the register
+ allocator did not have any visibility outside the current
+ tree, which meant that some redundant instructions were
+ generated. A peephole optimizer with this architecture was
+ hard to write, given the tree-based representation that is
+ used.
+
+ This JIT was functional, but it did not provide a good
+ architecture to base future optimizations on. Also the
+ line between architecture neutral and architecture
+ specific code and optimizations was hard to draw.
+
+ The JIT engine supported two code generation modes to support
+ the two optimization modes for applications that host multiple
+ application domains: generate code that will be shared across
+ application domains, or generate code that will not be shared
+ across application domains.
+
+* Objectives of the new JIT engine.
+
+ We wanted to support a number of features that were missing:
+
+ * Ahead-of-time compilation.
+
+ The idea is to allow developers to pre-compile their code
+ to native code to reduce startup time, and the working
+ set that is used at runtime in the just-in-time compiler.
+
+ Although in Mono this has not been a visible problem, we
+ wanted to pro-actively address this problem.
+
+ When an assembly (a Mono/.NET executable) is installed in
+ the system, it would then be possible to pre-compile the
+ code, and have the JIT compiler tune the generated code
+ to the particular CPU on which the software is
+ installed.
+
+ This is done in the Microsoft.NET world with a tool
+ called ngen.exe
+
+ * Have a good platform for doing code optimizations.
+
+ The design called for a good architecture that would
+ enable various levels of optimizations: some
+ optimizations are better performed on high-level
+ intermediate representations, some on medium-level and
+ some at low-level representations.
+
+ Also it should be possible to conditionally turn these on
+ or off. Some optimizations are too expensive to be used
+ in just-in-time compilation scenarios, but these
+ expensive optimizations can be turned on for
+ ahead-of-time compilations or when using profile-guided
+ optimizations on a subset of the executed methods.
+
+ * Reduce the effort required to port the Mono code
+ generator to new architectures.
+
+ For Mono to gain wide adoption in the Unix world, it is
+ necessary that the JIT engine works in most of today's
+ commercial hardware platforms.
+
+* Features of the new JIT engine.
+
+ The new JIT engine was architected by Dietmar Maurer and Paolo
+ Molaro, based on the new objectives.
+
+ Mono provides a number of services to applications running
+ with the new JIT compiler:
+
+ * Just-in-Time compilation of CLI code into native code.
+
+ * Ahead-of-Time compilation of CLI code, to reduce
+ startup time of applications.
+
+ A number of software development features are also available:
+
+ * Execution time profiling (--profile)
+
+ Generates a report of the times consumed by routines,
+ as well as the invocation times, as well as the
+ callers.
+
+ * Memory usage profiling (--profile)
+
+ Generates a report of the memory usage by a program
+ that is ran under the Mono JIT.
+
+ * Code coverage (--coverage)
+
+ * Execution tracing.
+
+ People who are interested in developing and improving the Mini
+ JIT compiler will also find a few useful routines:
+
+ * Compilation times
+
+ This is used to time the execution time for the JIT
+ when compiling a routine.
+
+ * Control Flow Graph and Dominator Tree drawing.
+
+ These are visual aids for the JIT developer: they
+ render representations of the Control Flow graph, and
+ for the more advanced optimizations, they draw the
+ dominator tree graph.
+
+ This requires Dot (from the graphwiz package) and Ghostview.
+
+ * Code generator regression tests.
+
+ The engine contains support for running regression
+ tests on the virtual machine, which is very helpful to
+ developers interested in improving the engine.
+
+ * Optimization benchmark framework.
+
+ The JIT engine will generate graphs that compare
+ various benchmarks embedded in an assembly, and run the
+ various tests with different optimization flags.
+
+ This requires Perl, GD::Graph.
+
+* Flexibility
+
+ This is probably the most important component of the new code
+ generation engine. The internals are relatively easy to
+ replace and update, even large passes can be replaced and
+ implemented differently.
+
+* New code generator
+
+ Compiling a method begins with the `mini_method_to_ir' routine
+ that converts the CIL representation into a medium
+ intermediate representation.
+
+ The mini_method_to_ir routine performs a number of operations:
+
+ * Flow analysis and control flow graph computation.
+
+ Unlike the previous version, stack analysis and control
+ flow graphs are computed in a single pass in the
+ mini_method_to_ir function, this is done for performance
+ reasons: although the complexity increases, the benefit
+ for a JIT compiler is that there is more time available
+ for performing other optimizations.
+
+ * Basic block computation.
+
+ mini_method_to_ir populates the MonoCompile structure
+ with an array of basic blocks each of which contains
+ forest of trees made up of MonoInst structures.
+
+ * Inlining
+
+ Inlining is no longer restricted to methods containing
+ one single basic block, instead it is possible to inline
+ arbitrary complex methods.
+
+ The heuristics to choose what to inline are likely going
+ to be tuned in the future.
+
+ * Method to opcode conversion.
+
+ Some method call invocations like `call Math.Sin' are
+ transformed into an opcode: this transforms the call
+ into a semantically rich node, which is later inline
+ into an FPU instruction.
+
+ Various Array methods invocations are turned into
+ opcodes as well (The Get, Set and Address methods)
+
+ * Tail recursion elimination
+
+ Basic blocks ****
+
+ The MonoInst structure holds the actual decoded instruction,
+ with the semantic information from the stack analysis.
+ MonoInst is interesting because initially it is part of a tree
+ structure, here is a sample of the same tree with the new JIT
+ engine:
+
+ (stind.i4 regoffset[0xffffffd4(%ebp)]
+ (add (ldind.i4 regoffset[0xffffffd8(%ebp)])
+ iconst[1]))
+
+ This is a medium-level intermediate representation (MIR).
+
+ Some complex opcodes are decomposed at this stage into a
+ collection of simpler opcodes. Not every complex opcode is
+ decomposed at this stage, as we need to preserve the semantic
+ information during various optimization phases.
+
+ For example a NEWARR opcode carries the length and the type of
+ the array that could be used later to avoid type checking or
+ array bounds check.
+
+ There are a number of operations supported on this
+ representation:
+
+ * Branch optimizations.
+
+ * Variable liveness.
+
+ * Loop optimizations: the dominator trees are
+ computed, loops are detected, and their nesting
+ level computed.
+
+ * Conversion of the method into static single assignment
+ form (SSA form).
+
+ * Dead code elimination.
+
+ * Constant propagation.
+
+ * Copy propagation.
+
+ * Constant folding.
+
+ Once the above optimizations are optionally performed, a
+ decomposition phase is used to turn some complex opcodes into
+ internal method calls. In the initial version of the JIT
+ engine, various operations on longs are emulated instead of
+ being inlined. Also the newarr invocation is turned into a
+ call to the runtime.
+
+ At this point, after computing variable liveness, it is
+ possible to use the linear scan algorithm for allocating
+ variables to registers. The linear scan pass uses the
+ information that was previously gathered by the loop nesting
+ and loop structure computation to favor variables in inner
+ loops. This process updates the basic block `nesting' field
+ which is later used during liveness analysis.
+
+ Stack space is then reserved for the local variables and any
+ temporary variables generated during the various
+ optimizations.
+
+** Instruction selection
+
+ At this point, the BURS instruction selector is invoked to
+ transform the tree-based representation into a list of
+ instructions. This is done using a tree pattern matcher that
+ is generated for the architecture using the `monoburg' tool.
+
+ Monoburg takes as input a file that describes tree patterns,
+ which are matched against the trees that were produced by the
+ engine in the previous stages.
+
+ The pattern matching might have more than one match for a
+ particular tree. In this case, the match selected is the one
+ whose cost is the smallest. A cost can be attached to each
+ rule, and if no cost is provided, the implicit cost is one.
+ Smaller costs are selected over higher costs.
+
+ The cost function can be used to select particular blocks of
+ code for a given architecture, or by using a prohibitive high
+ number to avoid having the rule match.
+
+ The various rules that our JIT engine uses transform a tree of
+ MonoInsts into a list of monoinsts:
+
+ +-----------------------------------------------------------+
+ | Tree List |
+ | of ===> Instruction selection ===> of |
+ | MonoInst MonoInst. |
+ +-----------------------------------------------------------+
+
+ During this process various "types" of MonoInst kinds
+ disappear and turned into lower-level representations. The
+ JIT compiler just happens to reuse the same structure (this is
+ done to reduce memory usage and improve memory locality).
+
+ The instruction selection rules are split in a number of
+ files, each one with a particular purpose:
+
+ inssel.brg
+ Contains the generic instruction selection
+ patterns.
+
+ inssel-x86.brg
+ Contains x86 specific rules.
+
+ inssel-ppc.brg
+ Contains PowerPC specific rules.
+
+ inssel-long32.brg
+ burg file for 64bit instructions on 32bit architectures.
+
+ inssel-long.brg
+ burg file for 64bit architectures.
+
+ inssel-float.brg
+ burg file for floating point instructions
+
+ For a given build, a set of those files would be included.
+ For example, for the build of Mono on the x86, the following
+ set is used:
+
+ inssel.brg inssel-x86.brg inssel-long32.brg inssel-float.brg
+
+** Native method generation
+
+ The native method generation has a number of steps:
+
+ * Architecture specific register allocation.
+
+ The information about loop nesting that was
+ previously gathered is used here to hint the
+ register allocator.
+
+ * Generating the method prolog/epilog.
+
+ * Optionally generate code to introduce tracing facilities.
+
+ * Hooking into the debugger.
+
+ * Performing any pending fixups.
+
+ * Code generation.
+
+*** Code Generation
+
+ The actual code generation is contained in the architecture
+ specific portion of the compiler. The input to the code
+ generator is each one of the basic blocks with its list of
+ instructions that were produced in the instruction selection
+ phase.
+
+ During the instruction selection phase, virtual registers are
+ assigned. Just before the peephole optimization is performed,
+ physical registers are assigned.
+
+ A simple peephole and algebraic optimizer is ran at this
+ stage.
+
+ The peephole optimizer removes some redundant operations at
+ this point. This is possible because the code generation at
+ this point has visibility into the basic block that spans the
+ original trees.
+
+ The algebraic optimizer performs some simple algebraic
+ optimizations that replace expensive operations with cheaper
+ operations if possible.
+
+ The rest of the code generation is fairly simple: a switch
+ statement is used to generate code for each of the MonoInsts,
+ in the mono/mini/mini-ARCH.c files, the method is called
+ "mono_arch_output_basic_block".
+
+ We always try to allocate code in sequence, instead of just using
+ malloc. This way we increase spatial locality which gives a massive
+ speedup on most architectures.
+
+*** Ahead of Time compilation
+
+ Ahead-of-Time compilation is a new feature of our new
+ compilation engine. The compilation engine is shared by the
+ Just-in-Time (JIT) compiler and the Ahead-of-Time compiler
+ (AOT).
+
+ The difference is on the set of optimizations that are turned
+ on for each mode: Just-in-Time compilation should be as fast
+ as possible, while Ahead-of-Time compilation can take as long
+ as required, because this is not done at a time critical
+ time.
+
+ With AOT compilation, we can afford to turn all of the
+ computationally expensive optimizations on.
+
+ After the code generation phase is done, the code and any
+ required fixup information is saved into a file that is
+ readable by "as" (the native assembler available on all
+ systems). This assembly file is then passed to the native
+ assembler, which generates a loadable module.
+
+ At execution time, when an assembly is loaded from the disk,
+ the runtime engine will probe for the existence of a
+ pre-compiled image. If the pre-compiled image exists, then it
+ is loaded, and the method invocations are resolved to the code
+ contained in the loaded module.
+
+ The code generated under the AOT scenario is slightly
+ different than the JIT scenario. It generates code that is
+ application-domain relative and that can be shared among
+ multiple thread.
+
+ This is the same code generation that is used when the runtime
+ is instructed to maximize code sharing on a multi-application
+ domain scenario.
+
+* SSA-based optimizations
+
+ SSA form simplifies many optimization because each variable
+ has exactly one definition site. This means that each
+ variable is only initialized once.
+
+ For example, code like this:
+
+ a = 1
+ ..
+ a = 2
+ call (a)
+
+ Is internally turned into:
+
+ a1 = 1
+ ..
+ a2 = 2
+ call (a2)
+
+ In the presence of branches, like:
+
+ if (x)
+ a = 1
+ else
+ a = 2
+
+ call (a)
+
+ The code is turned into:
+
+ if (x)
+ a1 = 1;
+ else
+ a2 = 2;
+ a3 = phi (a1, a2)
+ call (a3)
+
+ All uses of a variable are "dominated" by its definition
+
+ This representation is useful as it simplifies the
+ implementation of a number of optimizations like conditional
+ constant propagation, array bounds check removal and dead code
+ elimination.
+
+* Register allocation.
+
+ Global register allocation is performed on the medium
+ intermediate representation just before instruction selection
+ is performed on the method. Local register allocation is
+ later performed at the basic-block level on the
+
+ Global register allocation uses the following input:
+
+ 1) set of register-sized variables that can be allocated to a
+ register (this is an architecture specific setting, for x86
+ these registers are the callee saved register ESI, EDI and
+ EBX).
+
+ 2) liveness information for the variables
+
+ 3) (optionally) loop info to favor variables that are used in
+ inner loops.
+
+ During instruction selection phase, symbolic registers are
+ assigned to temporary values in expressions.
+
+ Local register allocation assigns hard registers to the
+ symbolic registers, and it is performed just before the code
+ is actually emitted and is performed at the basic block level.
+ A CPU description file describes the input registers, output
+ registers, fixed registers and clobbered registers by each
+ operation.
+
+* BURG Code Generator Generator
+
+ monoburg was written by Dietmar Maurer. It is based on the
+ papers from Christopher W. Fraser, Robert R. Henry and Todd
+ A. Proebsting: "BURG - Fast Optimal Instruction Selection and
+ Tree Parsing" and "Engineering a Simple, Efficient Code
+ Generator Generator".
+
+ The original BURG implementation is unable to work on DAGs, instead only
+ trees are allowed. Our monoburg implementations is able to generate tree
+ matcher which works on DAGs, and we use this feature in the new
+ JIT. This simplifies the code because we can directly pass DAGs and
+ don't need to convert them to trees.
+
+* Adding IL opcodes: an excercise (from a post by Paolo Molaro)
+
+ mini.c is the file that read the IL code stream and decides
+ how any single IL instruction is implemented
+ (mono_method_to_ir () func), so you always have to add an
+ entry to the big switch inside the function: there are plenty
+ of examples in that file.
+
+ An IL opcode can be implemented in a number of ways, depending
+ on what it does and how it needs to do it.
+
+ Some opcodes are implemented using a helper function: one of
+ the simpler examples is the CEE_STELEM_REF implementation.
+
+ In this case the opcode implementation is written in a C
+ function. You will need to register the function with the jit
+ before you can use it (mono_register_jit_call) and you need to
+ emit the call to the helper using the mono_emit_jit_icall()
+ function.
+
+ This is the simpler way to add a new opcode and it doesn't
+ require any arch-specific change (though it's limited to what
+ you can do in C code and the performance may be limited by the
+ function call).
+
+ Other opcodes can be implemented with one or more of the already
+ implemented low-level instructions.
+
+ An example is the OP_STRLEN opcode which implements
+ String.Length using a simple load from memory. In this case
+ you need to add a rule to the appropriate burg file,
+ describing what are the arguments of the opcode and what is,
+ if any, it's 'return' value.
+
+ The OP_STRLEN case is:
+
+ reg: OP_STRLEN (reg) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE, state->reg1,
+ state->left->reg1, G_STRUCT_OFFSET (MonoString, length));
+ }
+
+ The above means: the OP_STRLEN takes a register as an argument
+ and returns its value in a register. And the implementation
+ of this is included in the braces.
+
+ The opcode returns a value in an integer register
+ (state->reg1) by performing a int32 load of the length field
+ of the MonoString represented by the input register
+ (state->left->reg1): before the burg rules are applied, the
+ internal representation is based on trees, so you get the
+ left/right pointers (state->left and state->right
+ respectively, the result is stored in state->reg1).
+
+ This instruction implementation doesn't require arch-specific
+ changes (it is using the MONO_EMIT_LOAD_MEMBASE_OP which is
+ available on all platforms), and usually the produced code is
+ fast.
+
+ Next we have opcodes that must be implemented with new low-level
+ architecture specific instructions (either because of performance
+ considerations or because the functionality can't get implemented in
+ other ways).
+
+ You also need a burg rule in this case, too. For example,
+ consider the OP_CHECK_THIS opcode (used to raise an exception
+ if the this pointer is null). The burg rule simply reads:
+
+ stmt: OP_CHECK_THIS (reg) {
+ mono_bblock_add_inst (s->cbb, tree);
+ }
+
+ Note that this opcode does not return a value (hence the
+ "stmt") and it takes a register as input.
+
+ mono_bblock_add_inst (s->cbb, tree) just adds the instruction
+ (the tree variable) to the current basic block (s->cbb). In
+ mini this is the place where the internal representation
+ switches from the tree format to the low-level format (the
+ list of simple instructions).
+
+ In this case the actual opcode implementation is delegated to
+ the arch-specific code. A low-level opcode needs an entry in
+ the machine description (the *.md files in mini/). This entry
+ describes what kind of registers are used if any by the
+ instruction, as well as other details such as constraints or
+ other hints to the low-level engine which are architecture
+ specific.
+
+ cpu-pentium.md, for example has the following entry:
+
+ checkthis: src1:b len:3
+
+ This means the instruction uses an integer register as a base
+ pointer (basically a load or store is done on it) and it takes
+ 3 bytes of native code to implement it.
+
+ Now you just need to provide the low-level implementation for
+ the opcode in one of the mini-$arch.c files, in the
+ mono_arch_output_basic_block() function. There is a big switch
+ here too. The x86 implementation is:
+
+ case OP_CHECK_THIS:
+ /* ensure ins->sreg1 is not NULL */
+ x86_alu_membase_imm (code, X86_CMP, ins->sreg1, 0, 0);
+ break;
+
+ If the $arch-codegen.h header file doesn't have the code to
+ emit the low-level native code, you'll need to write that as
+ well.
+
+ Complex opcodes with register constraints may require other
+ changes to the local register allocator, but usually they are
+ not needed.
+
+* Future
+
+ Profile-based optimization is something that we are very
+ interested in supporting. There are two possible usage
+ scenarios:
+
+ * Based on the profile information gathered during
+ the execution of a program, hot methods can be compiled
+ with the highest level of optimizations, while bootstrap
+ code and cold methods can be compiled with the least set
+ of optimizations and placed in a discardable list.
+
+ * Code reordering: this profile-based optimization would
+ only make sense for pre-compiled code. The profile
+ information is used to re-order the assembly code on disk
+ so that the code is placed on the disk in a way that
+ increments locality.
+
+ This is the same principle under which SGI's cord program
+ works.
+
+ The nature of the CIL allows the above optimizations to be
+ easy to implement and deploy. Since we live and define our
+ universe for these things, there are no interactions with
+ system tools required, nor upgrades on the underlying
+ infrastructure required.
+
+ Instruction scheduling is important for certain kinds of
+ processors, and some of the framework exists today in our
+ register allocator and the instruction selector to cope with
+ this, but has not been finished. The instruction selection
+ would happen at the same time as local register allocation. < \ No newline at end of file
diff --git a/docs/mini-porting.txt b/docs/mini-porting.txt
new file mode 100644
index 00000000000..7cf14775b1d
--- /dev/null
+++ b/docs/mini-porting.txt
@@ -0,0 +1,451 @@
+ Mono JIT porting guide.
+ Paolo Molaro (lupus@ximian.com)
+
+* Introduction
+
+ This documents describes the process of porting the mono JIT
+ to a new CPU architecture. The new mono JIT has been designed
+ to make porting easier though at the same time enable the port
+ to take full advantage from the new architecture features and
+ instructions. Knowledge of the mini architecture (described in
+ the mini-doc.txt file) is a requirement for understanding this
+ guide, as well as an earlier document about porting the mono
+ interpreter (available on the web site).
+
+ There are six main areas that a port needs to implement to
+ have a fully-functional JIT for a given architecture:
+
+ 1) instruction selection
+ 2) native code emission
+ 3) call conventions and register allocation
+ 4) method trampolines
+ 5) exception handling
+ 6) minor helper methods
+
+ To take advantage of some not-so-common processor features
+ (for example conditional execution of instructions as may be
+ found on ARM or ia64), it may be needed to develop an
+ high-level optimization, but doing so is not a requirement for
+ getting the JIT to work.
+
+ We'll see in more details each of the steps required, note,
+ though, that a new port may just as well start from a
+ cut&paste of an existing port to a similar architecture (for
+ example from x86 to amd64, or from powerpc to sparc).
+
+ The architecture specific code is split from the rest of the
+ JIT, for example the x86 specific code and data is all
+ included in the following files in the distribution:
+
+ mini-x86.h mini-x86.c
+ inssel-x86.brg
+ cpu-pentium.md
+ tramp-x86.c
+ exceptions-x86.c
+
+ I suggest a similar split for other architectures as well.
+
+ Note that this document is still incomplete: some sections are
+ only sketched and some are missing, but the important info to
+ get a port going is already described.
+
+
+* Architecture-specific instructions and instruction selection.
+
+ The JIT already provides a set of instructions that can be
+ easily mapped to a great variety of different processor
+ instructions. Sometimes it may be necessary or advisable to
+ add a new instruction that represent more closely an
+ instruction in the architecture. Note that a mini instruction
+ can be used to represent also a short sequence of CPU
+ low-level instructions, but note that each instruction
+ represents the minimum amount of code the instruction
+ scheduler will handle (i.e., the scheduler won't schedule the
+ instructions that compose the low-level sequence as individual
+ instructions, but just the whole sequence, as an indivisible
+ block).
+
+ New instructions are created by adding a line in the
+ mini-ops.h file, assigning an opcode and a name. To specify
+ the input and output for the instruction, there are two
+ different places, depending on the context in which the
+ instruction gets used.
+
+ If the instruction is used in the tree representation, the
+ input and output types are defined by the BURG rules in the
+ *.brg files (the usual non-terminals are 'reg' to represent a
+ normal register, 'lreg' to represent a register or two that
+ hold a 64 bit value, freg for a floating point register).
+
+ If an instruction is used as a low-level CPU instruction, the
+ info is specified in a machine description file. The
+ description file is processed by the genmdesc program to
+ provide a data structure that can be easily used from C code
+ to query the needed info about the instruction.
+
+ As an example, let's consider the add instruction for both x86
+ and ppc:
+
+ x86 version:
+ add: dest:i src1:i src2:i len:2 clob:1
+ ppc version:
+ add: dest:i src1:i src2:i len:4
+
+ Note that the instruction takes two input integer registers on
+ both CPU, but on x86 the first source register is clobbered
+ (clob:1) and the length in bytes of the instruction differs.
+
+ Note that integer adds and floating point adds use different
+ opcodes, unlike the IL language (64 bit add is done with two
+ instructions on 32 bit architectures, using a add that sets
+ the carry and an add with carry).
+
+ A specific CPU port may assign any meaning to the clob field
+ for an instruction since the value will be processed in an
+ arch-specific file anyway.
+
+ See the top of the existing cpu-pentium.md file for more info
+ on other fields: the info may or may not be applicable to a
+ different CPU, in this latter case the info can be ignored.
+
+ The code in mini.c together with the BURG rules in inssel.brg,
+ inssel-float.brg and inssel-long32.brg provides general
+ purpose mappings from the tree representation to a set of
+ instructions that should be easily implemented in any
+ architecture. To allow for additional arch-specific
+ functionality, an arch-specific BURG file can be used: in this
+ file arch-specific instructions can be selected that provide
+ better performance than the general instructions or that
+ provide functionality that is needed by the JIT but that
+ cannot be expressed in a general enough way.
+
+ As an example, x86 has the special instruction "push" to make
+ it easier to implement the default call convention (passing
+ arguments on the stack): almost all the other architectures
+ don't have such an instruction (and don't need it anyway), so
+ we added a special rule in the inssel-x86.brg file for it.
+
+ So, one of the first things needed in a port is to write a
+ cpu-$(arch).md machine description file and fill it with the
+ needed info. As a start, only a few instructions can be
+ specified, like the ones required to do simple integer
+ operations. The default rules of the instruction selector will
+ emit the common instructions and so we're ready to go for the
+ next step in porting the JIT.
+
+
+*) Native code emission
+
+ Since the first step in porting mono to a new CPU is to port
+ the interpreter, there should be already a file that allows
+ the emission of binary native code in a buffer for the
+ architecture. This file should be placed in the
+
+ mono/arch/$(arch)/
+
+ directory.
+
+ The bulk of the code emission happens in the mini-$(arch).c
+ file, in a function called mono_arch_output_basic_block
+ (). This function takes a basic block, walks the list of
+ instructions in the block and emits the binary code for each.
+ Optionally a peephole optimization pass is done on the basic
+ block, but this can be left for later, when the port actually
+ works.
+
+ This function is very simple, there is just a big switch on
+ the instruction opcode and in the corresponding case the
+ functions or macros to emit the binary native code are
+ used. Note that in this function the lengths of the
+ instructions are used to determine if the buffer for the code
+ needs enlarging.
+
+ To complete the code emission for a method, a few other
+ functions need implementing as well:
+
+ mono_arch_emit_prolog ()
+ mono_arch_emit_epilog ()
+ mono_arch_patch_code ()
+
+ mono_arch_emit_prolog () will emit the code to setup the stack
+ frame for a method, optionally call the callbacks used in
+ profiling and tracing, and move the arguments to their home
+ location (in a caller-save register if the variable was
+ allocated to one, or in a stack location if the argument was
+ passed in a volatile register and wasn't allocated a
+ non-volatile one). caller-save registers used by the function
+ are saved in the prolog as well.
+
+ mono_arch_emit_epilog () will emit the code needed to return
+ from the function, optionally calling the profiling or tracing
+ callbacks. At this point the basic blocks or the code that was
+ moved out of the normal flow for the function can be emitted
+ as well (this is usually done to provide better info for the
+ static branch predictor). In the epilog, caller-save
+ registers are restored if they were used.
+
+ Note that, to help exception handling and stack unwinding,
+ when there is a transition from managed to unmanaged code,
+ some special processing needs to be done (basically, saving
+ all the registers and setting up the links in the Last Managed
+ Frame structure).
+
+ When the epilog has been emitted, the upper level code
+ arranges for the buffer of memory that contains the native
+ code to be copied in an area of executable memory and at this
+ point, instructions that use relative addressing need to be
+ patched to have the right offsets: this work is done by
+ mono_arch_patch_code ().
+
+
+* Call conventions and register allocation
+
+ To account for the differences in the call conventions, a few functions need to
+ be implemented.
+
+ mono_arch_allocate_vars () assigns to both arguments and local
+ variables the offset relative to the frame register where they
+ are stored, dead variables are simply discarded. The total
+ amount of stack needed is calculated.
+
+ mono_arch_call_opcode () is the function that more closely
+ deals with the call convention on a given system. For each
+ argument to a function call, an instruction is created that
+ actually puts the argument where needed, be it the stack or a
+ specific register. This function can also re-arrange th order
+ of evaluation when multiple arguments are involved if needed
+ (like, on x86 arguments are pushed on the stack in reverse
+ order). The function needs to carefully take into accounts
+ platform specific issues, like how structures are returned as
+ well as the differences in size and/or alignment of managed
+ and corresponding unmanaged structures.
+
+ The other chunk of code that needs to deal with the call
+ convention and other specifics of a CPU, is the local register
+ allocator, implemented in a function named
+ mono_arch_local_regalloc (). The local allocator deals with a
+ basic block at a time and basically just allocates registers
+ for temporary values during expression evaluation, spilling
+ and unspilling as necessary.
+
+ The local allocator needs to take into account clobbering
+ information, both during simple instructions and during
+ function calls and it needs to deal with other
+ architecture-specific weirdnesses, like instructions that take
+ inputs only in specific registers or output only is some.
+
+ Some effort will be put later in moving most of the local
+ register allocator to a common file so that the code can be
+ shared more for similar, risc-like CPUs. The register
+ allocator does a first pass on the instructions in a block,
+ collecting liveness information and in a backward pass on the
+ same list performs the actual register allocation, inserting
+ the instructions needed to spill values, if necessary.
+
+ When this part of code is implemented, some testing can be
+ done with the generated code for the new architecture. Most
+ helpful is the use of the --regression command line switch to
+ run the regression tests (basic.cs, for example).
+
+ Note that the JIT will try to initialize the runtime, but it
+ may not be able yet to compile and execute complex code:
+ commenting most of the code in the mini_init() function in
+ mini.c is needed to let the JIT just compile the regression
+ tests. Also, using multiple -v switches on the command line
+ makes the JIT dump an increasing amount of information during
+ compilation.
+
+
+* Method trampolines
+
+ To get better startup performance, the JIT actually compiles a
+ method only when needed. To achieve this, when a call to a
+ method is compiled, we actually emit a call to a magic
+ trampoline. The magic trampoline is a function written in
+ assembly that invokes the compiler to compile the given method
+ and jumps to the newly compiled code, ensuring the arguments
+ it received are passed correctly to the actual method.
+
+ Before jumping to the new code, though, the magic trampoline
+ takes care of patching the call site so that next time the
+ call will go directly to the method instead of the
+ trampoline. How does this all work?
+
+ mono_arch_create_jit_trampoline () creates a small function
+ that just preserves the arguments passed to it and adds an
+ additional argument (the method to compile) before calling the
+ generic trampoline. This small function is called the specific
+ trampoline, because it is method-specific (the method to
+ compile is hard-code in the instruction stream).
+
+ The generic trampoline saves all the arguments that could get
+ clobbered and calls a C function that will do two things:
+
+ *) actually call the JIT to compile the method
+ *) identify the calling code so that it can be patched to call directly
+ the actual method
+
+ If the 'this' argument to a method is a boxed valuetype that
+ is passed to a method that expects just a pointer to the data,
+ an additional unboxing trampoline will need to be inserted as
+ well.
+
+
+* Exception handling
+
+ Exception handling is likely the most difficult part of the
+ port, as it needs to deal with unwinding (both managed and
+ unmanaged code) and calling catch and filter blocks. It also
+ needs to deal with signals, because mono takes advantage of
+ the MMU in the CPU and of the operation system to handle
+ dereferences of the NULL pointer. Some of the function needed
+ to implement the mechanisms are:
+
+ mono_arch_get_throw_exception () returns a function that takes
+ an exception object and invokes an arch-specific function that
+ will enter the exception processing. To do so, all the
+ relevant registers need to be saved and passed on.
+
+ mono_arch_handle_exception () this function takes the
+ exception thrown and a context that describes the state of the
+ CPU at the time the exception was thrown. The function needs
+ to implement the exception handling mechanism, so it makes a
+ search for an handler for the exception and if none is found,
+ it follows the unhandled exception path (that can print a
+ trace and exit or just abort the current thread). The
+ difficulty here is to unwind the stack correctly, by restoring
+ the register state at each call site in the call chain,
+ calling finally, filters and handler blocks while doing so.
+
+ As part of exception handling a couple of internal calls need
+ to be implemented as well.
+
+ ves_icall_get_frame_info () returns info about a specific
+ frame.
+
+ mono_jit_walk_stack () walks the stack and calls a callback with info for
+ each frame found.
+
+ ves_icall_get_trace () return an array of StackFrame objects.
+
+** Code generation for filter/finally handlers
+
+ Filter and finally handlers are called from 2 different locations:
+
+ 1.) from within the method containing the exception clauses
+ 2.) from the stack unwinding code
+
+ To make this possible we implement them like subroutines,
+ ending with a "return" statement. The subroutine does not save
+ the base pointer, because we need access to the local
+ variables of the enclosing method. Its is possible that
+ instructions inside those handlers modify the stack pointer,
+ thus we save the stack pointer at the start of the handler,
+ and restore it at the end. We have to use a "call" instruction
+ to execute such finally handlers.
+
+ The MIR code for filter and finally handlers looks like:
+
+ OP_START_HANDLER
+ ...
+ OP_END_FINALLY | OP_ENDFILTER(reg)
+
+ OP_START_HANDLER: should save the stack pointer somewhere
+ OP_END_FINALLY: restores the stack pointers and returns.
+ OP_ENDFILTER (reg): restores the stack pointers and returns the value in "reg".
+
+** Calling finally/filter handlers
+
+ There is a special opcode to call those handler, its called
+ OP_CALL_HANDLER. It simple emits a call instruction.
+
+ Its a bit more complex to call handler from outside (in the
+ stack unwinding code), because we have to restore the whole
+ context of the method first. After that we simply emit a call
+ instruction to invoke the handler. Its usually possible to use
+ the same code to call filter and finally handlers (see
+ arch_get_call_filter).
+
+** Calling catch handlers
+
+ Catch handlers are always called from the stack unwinding
+ code. Unlike finally clauses or filters, catch handler never
+ return. Instead we simply restore the whole context, and
+ restart execution at the catch handler.
+
+** Passing Exception objects to catch handlers and filters.
+
+ We use a local variable to store exception objects. The stack
+ unwinding code must store the exception object into this
+ variable before calling catch handler or filter.
+
+* Minor helper methods
+
+ A few minor helper methods are referenced from the arch-independent code.
+ Some of them are:
+
+ *) mono_arch_cpu_optimizations ()
+ This function returns a mask of optimizations that
+ should be enabled for the current CPU and a mask of
+ optimizations that should be excluded, instead.
+
+ *) mono_arch_regname ()
+ Returns the name for a numeric register.
+
+ *) mono_arch_get_allocatable_int_vars ()
+ Returns a list of variables that can be allocated to
+ the integer registers in the current architecture.
+
+ *) mono_arch_get_global_int_regs ()
+ Returns a list of caller-save registers that can be
+ used to allocate variables in the current method.
+
+ *) mono_arch_instrument_mem_needs ()
+ *) mono_arch_instrument_prolog ()
+ *) mono_arch_instrument_epilog ()
+ Functions needed to implement the profiling interface.
+
+
+* Writing regression tests
+
+ Regression tests for the JIT should be written for any bug
+ found in the JIT in one of the *.cs files in the mini
+ directory. Eventually all the operations of the JIT should be
+ tested (including the ones that get selected only when some
+ specific optimization is enabled).
+
+
+* Platform specific optimizations
+
+ An example of a platform-specific optimization is the peephole
+ optimization: we look at a small window of code at a time and
+ we replace one or more instructions with others that perform
+ better for the given architecture or CPU.
+
+* 64 bit support tips, by Zoltan Varga (vargaz@gmail.com)
+
+ For a 64-bit port of the Mono runtime, you will typically do
+ the following:
+
+ * need to use inssel-long.brg instead of
+ inssel-long32.brg.
+
+ * need to implement lots of new opcodes:
+ OP_I<OP> is 32 bit op
+ OP_L<OP> and CEE_<OP> are 64 bit ops
+
+
+ The 64 bit version of an existing port might share the code
+ with the 32 bit port (for example SPARC/SPARV9), or it might
+ be separate (x86/AMD64).
+
+ That will depend on the similarities of the two instructions
+ sets/ABIs etc.
+
+ The runtime and most parts of the JIT are 64 bit clean
+ at this point, so the only parts which require changing are
+ the arch dependent files.
+
+
+
+ \ No newline at end of file
diff --git a/docs/mono_handle_d b/docs/mono_handle_d
new file mode 100644
index 00000000000..a8f97b141c3
--- /dev/null
+++ b/docs/mono_handle_d
@@ -0,0 +1,98 @@
+=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
diff --git a/docs/new-regalloc b/docs/new-regalloc
new file mode 100644
index 00000000000..b687c2b50c6
--- /dev/null
+++ b/docs/new-regalloc
@@ -0,0 +1,68 @@
+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.
+
diff --git a/docs/opcode-decomp.txt b/docs/opcode-decomp.txt
new file mode 100644
index 00000000000..48968d17ab9
--- /dev/null
+++ b/docs/opcode-decomp.txt
@@ -0,0 +1,113 @@
+
+* 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...)
+
diff --git a/docs/precise-gc b/docs/precise-gc
new file mode 100644
index 00000000000..8f84ea3203b
--- /dev/null
+++ b/docs/precise-gc
@@ -0,0 +1,77 @@
+While the Boehm GC is quite good, we need to move to a
+precise, generational GC for better performance and smaller
+memory usage (no false-positives memory retentions with big
+allocations).
+
+This is a large task, but it can be done in steps.
+
+1) use the GCJ support to mark reference fields in objects, so
+scanning the heap is faster. This is mostly done already, needs
+checking that it is always used correctly (big objects, arrays).
+There are also some data structures we use in the runtime that are
+currently untyped that are allocated in the Gc heap and used to
+keep references to GC objects. We need to make them typed as to
+precisely track GC references or make them non-GC memory,
+by using more the GC hnadle support code (MonoGHashTable, MonoDomain,
+etc).
+
+2) don't include in the static roots the .bss and .data segments
+to save in scanning time and limit false-positives. This is mostly
+done already.
+
+3) keep track precisely of stack locations and registers in native
+code generation. This basically requires the regalloc rewrite code
+first, if we don't want to duplicate much of it. This is the hardest
+task of all, since proving it's correctness is very hard. Some tricks,
+like having a build that injects GC.Collect() after every few simple
+operations may help. We also need to decide if we want to handle safe
+points at calls and back jumps only or at every instruction. The latter
+case is harder to implement and requires we keep around much more data
+(it potentially makes for faster stop-the-world phases).
+The first case requires us to be able to advance a thread until it
+reaches the next safe point: this can be done with the same techniques
+used by a debugger. We already need something like this to handle
+safely aborts happening in the middle of a prolog in managed code,
+for example, so this could be an additional sub-task that can be done
+separately from the GC work.
+Note that we can adapt the libgc code to use the info we collect
+when scanning the stack in managed methods and still use the conservative
+approach for the unmanaged stack, until we have our own collector,
+which requires we define a proper icall interface to switch from managed
+to unmanaged code (hwo to we handle object references in the icall
+implementations, for example).
+
+4) we could make use of the generational capabilities of the
+Boehm GC, but not with the current method involving signals which
+may create incompatibilities and is not supported on all platforms.
+We need to start using write barriers: they will be required anyway
+for the generational GC we'll use. When a field holding a reference
+is changed in an object (or an item in an array), we mark the card
+or page where the field is stored as dirty. Later, when a collection
+is run, only objects in pages marked as dirty are scanned for
+references instead of the whole heap. This could take a few days to
+implement and probably much more time to debug if all the cases were
+not catched:-)
+
+5) actually write the new generational and precise collector. There are
+several examples out there as open source projects, though the CLR
+needs some specific semantics so the code needs to be written from
+scratch anyway. Compared to item 3 this is relatively easer and it can
+be tested outside of mono, too, until mono is ready to use it.
+The important features needed:
+*) precise, so there is no false positive memory retention
+*) generational to reduce collection times
+*) pointer-hopping allocation to reduce alloc time
+*) possibly per-thread lock-free allocation
+*) handle weakrefs and finalizers with the CLR semantics
+
+Note: some GC engines use a single mmap area, because it makes
+handling generations and the implementation much easier, but this also
+limits the expension of the heap, so people may need to use a command-line
+option to set the max heap size etc. It would be better to have a design
+that allows mmapping a few megabytes chunks at a time.
+
+The different tasks can be done in parallel. 1, 2 and 4 can be done in time
+for the mono 1.2 release. Parts of 3 and 5 could be done as well.
+The complete switch is supposed to happen with the mono 2.0 release.
+
diff --git a/docs/release-notes-1.0.html b/docs/release-notes-1.0.html
new file mode 100644
index 00000000000..9c305433c51
--- /dev/null
+++ b/docs/release-notes-1.0.html
@@ -0,0 +1,16 @@
+<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
diff --git a/docs/remoting b/docs/remoting
new file mode 100644
index 00000000000..806e4015286
--- /dev/null
+++ b/docs/remoting
@@ -0,0 +1,26 @@
+Runtime support for Remoting
+============================
+
+The runtime supports a special objects called "TransparentProxy". You can
+create objects of this type by calling GetTransparentProxy() on a "RealProxy"
+object.
+
+LDFLD/STFLD for transparent proxies
+===================================
+
+Access to fields must be redirected to the remote object. System.Object has
+some special methods for that:
+
+void FieldGetter (string typeName, string fieldName, ref object val);
+
+void FieldSetter (string typeName, string fieldName, object val);
+
+This methods are never called on actual object. The are only used to pack
+LDFLD/STFLD operations into method call messages, which are then passed to the
+RealProxy::Invoke() method.
+
+There are two helper methods which can be used by the JIT and the interpreter
+to convert LDFLD/STFLD operations into messages and then call
+RealProxy::Invoke(): mono_store_remote_field() and mono_load_remote_field().
+
+
diff --git a/docs/threading b/docs/threading
new file mode 100644
index 00000000000..30f439fa4e0
--- /dev/null
+++ b/docs/threading
@@ -0,0 +1,156 @@
+
+Threading in Mono
+=================
+
+ 0. Terminology
+ --------------
+
+ "Main thread" - The initial OS-native thread that the
+ application started with.
+
+ "Helper thread" - A native thread created internally
+ by the runtime, such as the finalizer thread, or an
+ asynchronous delegate invocation thread. These
+ threads can run managed code.
+
+ "Primary CLR thread" - The native thread that called
+ the Main() method when executing an assembly.
+
+ "Secondary CLR thread" - A native thread created by a
+ program that instantiates a System.Threading.Thread object
+ and calls its Start() method.
+
+ 1. Thread exit behaviour in the standalone mono runtime
+ -------------------------------------------------------
+
+ The correct behaviour of the runtime should be:
+
+ a) If Main() returns, the runtime should wait for all
+ foreground secondary CLR threads to finish. The
+ wording in the class documentation states: "Once all
+ foreground threads belonging to a process have
+ terminated, the common language runtime ends the
+ process by invoking Abort on any background threads
+ that are still alive." Testing seems to indicate that
+ the background thread can't cancel the Abort by
+ catching the ThreadAbortException and calling
+ ResetAbort here. Indeed, not even the finally block
+ seems to be executed.
+
+ b) if any of the primary CLR thread, a secondary CLR
+ thread or a helper thread calls
+ System.Environment.Exit(), the application should
+ terminate immediately without waiting for foreground
+ primary or secondary CLR threads to finish.
+
+ c) if the primary CLR thread throws an uncaught
+ exception, the application should terminate
+ immediately without waiting for secondary CLR threads
+ to finish. This might be implemented internally by
+ pretending that all the running secondary CLR threads
+ are background threads.
+
+ d) if a secondary CLR thread throws an uncaught
+ exception that thread should terminate and all other
+ threads should continue to execute.
+
+ e) if a helper thread throws an uncaught exception and
+ that thread happens to be the GC finalizer thread,
+ testing seems to indicate that the exception stack
+ trace is displayed as normal, and the exception is
+ then ignored (as though there is a try {} catch{}
+ around all finalizers that just prints the stack
+ trace.) Calling Abort() on the GC finalizer thread
+ also does not cause it to exit: it behaves as though
+ the ThreadAbortException is caught and ResetAbort is
+ called. Asynchronous delegate helper threads should
+ behave as secondary CLR threads, but uncaught
+ exceptions should be rethrown on the thread that calls
+ EndInvoke().
+
+
+ The difficulties happen with cases b) and c):
+
+ The current implementation of
+ System.Environment.Exit() calls exit(2) directly,
+ which is rather unfriendly: it prevents any runtime
+ cleanup, statistics gathering, etc. and is pretty
+ obnoxious to embedded code.
+
+ The current exception handling code calls ExitThread()
+ (emulated with pthread_exit() in the io-layer) if an
+ exception is not caught.
+
+ When called from the main thread, both POSIX
+ pthread_exit() and w32 ExitThread() block if there are
+ other threads still running (in the w32 case, if there
+ are other foreground threads still running; threads
+ can set as background.) If the main thread is also
+ the primary CLR thread, then the application will
+ block until all other threads (including helper
+ threads) terminate. Some helper threads will not
+ terminate until specifically told to by the runtime:
+ for example, the GC finalizer thread needs to run
+ until all of the primary and secondary CLR threads
+ have finished.
+
+ Also, if the main thread is also the primary CLR
+ thread, the runtime loses the opportunity to do any
+ cleaning up. Adding a special case to call exit(2)
+ instead of ExitThread() in the primary CLR thread
+ suffers from the same problems as
+ System.Environment.Exit() calling exit(2).
+
+
+ The simple solution is to run the primary CLR thread
+ in a new native thread, leaving the main thread free
+ for housekeeping duties. There still needs to be some
+ special handling for the case where the primary CLR
+ thread fails to catch an exception: the secondary CLR
+ threads then need to be terminated.
+
+ When the primary and secondary CLR threads have all
+ terminated, the helper threads can be killed off and
+ the runtime can clean itself up and exit.
+
+
+
+ 2. Thread initialisation
+ ------------------------
+
+ Threads have to undergo some initialisation before
+ managed code can be executed. A
+ System.Threading.Thread object must be created, and
+ the thread details need to be stored so that the
+ threads can be managed later. The JIT needs to record
+ the last managed frame stack pointer in a TLS slot,
+ and the current Thread object is also recorded.
+
+ New threads created by managed calls to
+ System.Threading.Thread methods will have all needed
+ initialisation performed. Threads created by the
+ runtime with calls to mono_thread_create() will too.
+ Existing threads can be passed to the runtime; these
+ must call mono_thread_attach() before any CLR code can
+ be executed on that thread.
+
+
+ 3. Constraints on embedding the Mono runtime
+ --------------------------------------------
+
+ The discussion above concerning application behaviour
+ in the event of threads terminating, whether by
+ returning from the start function, throwing uncaught
+ exceptions or by calling System.Environment.Exit(),
+ only really applies to the standalone Mono runtime.
+
+ An embedding application should specify what behaviour
+ is required when, for example,
+ System.Environment.Exit() is called. The application
+ is also responsible for its own thread management, and
+ it should be prepared for any of the primary CLR
+ thread or secondary CLR threads to terminate at any
+ time. The application should also take into account
+ that the runtime will create helper threads as needed,
+ as this may cause pthread_exit() or ExitThread() to
+ block indefinitely, as noted above.
diff --git a/ikvm-jni/.cvsignore b/ikvm-jni/.cvsignore
new file mode 100644
index 00000000000..e440fafdac7
--- /dev/null
+++ b/ikvm-jni/.cvsignore
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps
diff --git a/ikvm-jni/ChangeLog b/ikvm-jni/ChangeLog
new file mode 100644
index 00000000000..11e1723de3b
--- /dev/null
+++ b/ikvm-jni/ChangeLog
@@ -0,0 +1,29 @@
+2004-11-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-jni.c (GET_SET_ARRAY_ELEMENTS): Fix compilation errors on
+ gcc 3.3.5.
+
+2004-06-24 David Waite <mass@akuma.org>
+
+ * mono-jni.c: change to C90-style comments from C99/C++-style
+
+Fri Jun 18 13:46:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-jni.c: updates for the API cleanups.
+
+2004-05-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-jni.c: Implement some missing JNI functions.
+
+2004-04-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-jni.c: Use <stdarg.h> instead of <varargs.h>.
+
+2004-04-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-jni.c: Fix compilation under gcc 2.95 + fix warnings.
+
+2004-04-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-jni.c Makefile.am: New files.
+
diff --git a/ikvm-jni/Makefile.am b/ikvm-jni/Makefile.am
new file mode 100644
index 00000000000..573a2d19908
--- /dev/null
+++ b/ikvm-jni/Makefile.am
@@ -0,0 +1,15 @@
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ $(IKVM_JNI_CFLAGS) \
+ $(GMODULE_CFLAGS) \
+ $(GLIB_CFLAGS)
+
+if JIT_SUPPORTED
+
+lib_LTLIBRARIES = libmono-ikvm-jni.la
+endif
+
+libmono_ikvm_jni_la_SOURCES = mono-jni.c
+libmono_ikvm_jni_la_LIBADD = $(top_builddir)/mono/mini/libmono.la
+
diff --git a/ikvm-jni/mono-jni.c b/ikvm-jni/mono-jni.c
new file mode 100644
index 00000000000..77c8afadbd2
--- /dev/null
+++ b/ikvm-jni/mono-jni.c
@@ -0,0 +1,1263 @@
+/*
+ * mono-jni.c: native methods required by the mono JNI implementation.
+ *
+ *
+ */
+
+#include <jni.h>
+#include <gmodule.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/appdomain.h>
+
+#include <string.h>
+#include <stdarg.h>
+
+/*
+ * PROTOTYPES
+ */
+
+void * native_load_native_library (char *filename);
+
+int native_lookup_symbol (GModule *module, char *symbol_name, gpointer *symbol);
+void mono_jni_jnienv_init (
+ void *makelocalref_func,
+ void *unwrap_func,
+ void *makeglobalref_func,
+ void *deleteref_func,
+ void *getfieldcookie_func,
+ void *getmethodcookie_func,
+ void *setfieldvalue_func,
+ void *getfieldvalue_func,
+ void *getclassfromobject_func,
+ void *exceptioncheck_func,
+ void *getpendingexception_func,
+ void *setpendingexception_func,
+ void *invokemethod_func,
+ void *getmethodarglist_func,
+ void *findclass_func,
+ void *getjnienv_func,
+ void *allocobject_func);
+
+void* mono_jni_get_func_table (void);
+
+void mono_jni_set_jnifunc (int index, void *func);
+
+jint JNICALL GetJavaVM (JNIEnv *env, JavaVM **vm);
+
+
+void *
+native_load_native_library (char *filename)
+{
+ return g_module_open (filename, 0);
+}
+
+int
+native_lookup_symbol (GModule *module, char *symbol_name, gpointer *symbol)
+{
+ gboolean res = g_module_symbol (module, symbol_name, symbol);
+ return res;
+}
+
+typedef struct MonoJniFunctions {
+ int (*MakeLocalRef) (JNIEnv *env, void *obj);
+ void * (*UnwrapRef) (JNIEnv *env, void *ref);
+ int (*MakeGlobalRef) (void *obj);
+ void (*DeleteRef) (JNIEnv *env, void *ref);
+ int (*GetFieldCookie) (void *klass, void *name, void *sig, gboolean is_static);
+ int (*GetMethodCookie) (void *klass, void *name, void *sig, gboolean is_static);
+ void (*SetFieldValue) (void *cookie, void *obj, void *val);
+ void * (*GetFieldValue) (void *cookie, void *obj);
+ void * (*GetClassFromObject) (void *obj);
+ jboolean (*ExceptionCheck) (JNIEnv *env);
+ void * (*GetPendingException) (JNIEnv *env);
+ void (*SetPendingException) (JNIEnv *env, void *obj);
+ void * (*InvokeMethod) (JNIEnv *env, void *cookie, void *obj, void *args, int virtual);
+ void * (*GetMethodArgList) (void *cookie);
+ void * (*FindClass) (void *name);
+ void * (*GetJniEnv) (void);
+ void * (*AllocObject) (void *klass);
+} MonoJniFunctions;
+
+static MonoJniFunctions jniFuncs;
+
+void
+mono_jni_jnienv_init (
+ void *makelocalref_func,
+ void *unwrap_func,
+ void *makeglobalref_func,
+ void *deleteref_func,
+ void *getfieldcookie_func,
+ void *getmethodcookie_func,
+ void *setfieldvalue_func,
+ void *getfieldvalue_func,
+ void *getclassfromobject_func,
+ void *exceptioncheck_func,
+ void *getpendingexception_func,
+ void *setpendingexception_func,
+ void *invokemethod_func,
+ void *getmethodarglist_func,
+ void *findclass_func,
+ void *getjnienv_func,
+ void *allocobject_func)
+{
+ jniFuncs.MakeLocalRef = makelocalref_func;
+ jniFuncs.UnwrapRef = unwrap_func;
+ jniFuncs.MakeGlobalRef = makeglobalref_func;
+ jniFuncs.DeleteRef = deleteref_func;
+ jniFuncs.GetFieldCookie = getfieldcookie_func;
+ jniFuncs.GetMethodCookie = getmethodcookie_func;
+ jniFuncs.SetFieldValue = setfieldvalue_func;
+ jniFuncs.GetFieldValue = getfieldvalue_func;
+ jniFuncs.GetClassFromObject = getclassfromobject_func;
+ jniFuncs.ExceptionCheck = exceptioncheck_func;
+ jniFuncs.GetPendingException = getpendingexception_func;
+ jniFuncs.SetPendingException = setpendingexception_func;
+ jniFuncs.InvokeMethod = invokemethod_func;
+ jniFuncs.GetMethodArgList = getmethodarglist_func;
+ jniFuncs.FindClass = findclass_func;
+ jniFuncs.GetJniEnv = getjnienv_func;
+ jniFuncs.AllocObject = allocobject_func;
+}
+
+static void *jni_func_table[256];
+
+static void ***jni_ptr = NULL;
+
+static void *vm_func_table[64];
+
+static void ***vm_ptr = NULL;
+
+void*
+mono_jni_get_func_table (void)
+{
+ if (!jni_ptr) {
+ jni_ptr = (void***)&jni_func_table;
+ }
+
+ return jni_ptr;
+}
+
+void
+mono_jni_set_jnifunc (int index, void *func)
+{
+ jni_func_table [index] = func;
+}
+
+static MonoString *
+StringFromUTF8 (const char* psz)
+{
+ /* TODO: */
+ return mono_string_new (mono_domain_get (), psz);
+#if 0
+ /* Sun's modified UTF8 encoding is not compatible with System::Text::Encoding::UTF8, so */
+ /* we need to roll our own */
+ int len, res_len, i;
+ int *res;
+
+ len = strlen (psz);
+ res = g_malloc (len * sizeof (int));
+ res_len = 0;
+ for (i = 0; i < len; i++) {
+ int c = (unsigned char)*psz++;
+ int char2, char3;
+ switch (c >> 4)
+ {
+ case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
+ /* 0xxxxxxx */
+ break;
+ case 12: case 13:
+ /* 110x xxxx 10xx xxxx */
+ char2 = *psz++;
+ i++;
+ c = (((c & 0x1F) << 6) | (char2 & 0x3F));
+ break;
+ case 14:
+ /* 1110 xxxx 10xx xxxx 10xx xxxx */
+ char2 = *psz++;
+ char3 = *psz++;
+ i++;
+ i++;
+ c = (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
+ break;
+ }
+
+ res [res_len ++] = c;
+ }
+
+ return mono_string_new_utf16 (mono_domain_get (), res, res_len);
+#endif
+}
+
+/***************************************************************************/
+/* JNI FUNCTIONS */
+/***************************************************************************/
+
+
+static jint JNICALL GetVersion (JNIEnv *env) { printf ("JNI Function GetVersion is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jclass JNICALL DefineClass (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len) { printf ("JNI Function DefineClass is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jclass JNICALL FindClass (JNIEnv *env, const char *name)
+{
+ return (jclass)(jniFuncs.MakeLocalRef (env, jniFuncs.FindClass (StringFromUTF8(name))));
+}
+
+static jmethodID JNICALL FromReflectedMethod (JNIEnv *env, jobject method) { printf ("JNI Function FromReflectedMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jfieldID JNICALL FromReflectedField (JNIEnv *env, jobject field) { printf ("JNI Function FromReflectedField is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jobject JNICALL ToReflectedMethod (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic) { printf ("JNI Function ToReflectedMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jclass JNICALL GetSuperclass (JNIEnv *env, jclass sub) { printf ("JNI Function GetSuperclass is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jboolean JNICALL IsAssignableFrom (JNIEnv *env, jclass sub, jclass sup) { printf ("JNI Function IsAssignableFrom is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jobject JNICALL ToReflectedField (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic) { printf ("JNI Function ToReflectedField is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jint JNICALL Throw (JNIEnv *env, jthrowable obj) { printf ("JNI Function Throw is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jint JNICALL ThrowNew (JNIEnv *env, jclass clazz, const char *msg) { printf ("JNI Function ThrowNew is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jthrowable JNICALL ExceptionOccurred (JNIEnv *env)
+{
+ return (jthrowable)jniFuncs.MakeLocalRef (env, jniFuncs.GetPendingException (env));
+}
+
+static void JNICALL ExceptionDescribe (JNIEnv *env) { printf ("JNI Function ExceptionDescribe is not implemented.\n"); g_assert_not_reached (); }
+static void JNICALL ExceptionClear (JNIEnv *env) { printf ("JNI Function ExceptionClear is not implemented.\n"); g_assert_not_reached (); }
+static void JNICALL FatalError (JNIEnv *env, const char *msg) { printf ("JNI Function FatalError is not implemented.\n"); g_assert_not_reached (); }
+
+static jint JNICALL PushLocalFrame (JNIEnv *env, jint capacity) { printf ("JNI Function PushLocalFrame is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jobject JNICALL PopLocalFrame (JNIEnv *env, jobject result) { printf ("JNI Function PopLocalFrame is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jobject JNICALL NewGlobalRef (JNIEnv *env, jobject lobj)
+{
+ return (jobject)jniFuncs.MakeGlobalRef (jniFuncs.UnwrapRef (env, lobj));
+}
+
+static void JNICALL DeleteGlobalRef (JNIEnv *env, jobject gref)
+{
+ jniFuncs.DeleteRef (env, gref);
+}
+
+static void JNICALL DeleteLocalRef (JNIEnv *env, jobject obj)
+{
+ jniFuncs.DeleteRef (env, obj);
+}
+
+static jboolean JNICALL IsSameObject (JNIEnv *env, jobject obj1, jobject obj2) { printf ("JNI Function IsSameObject is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jobject JNICALL NewLocalRef (JNIEnv *env, jobject ref) { printf ("JNI Function NewLocalRef is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jint JNICALL EnsureLocalCapacity (JNIEnv *env, jint capacity) { printf ("JNI Function EnsureLocalCapacity is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jobject JNICALL AllocObject (JNIEnv *env, jclass clazz) { printf ("JNI Function EnsureLocalCapacity is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jclass JNICALL GetObjectClass (JNIEnv *env, jobject obj)
+{
+ g_assert (obj);
+
+ return (jclass)jniFuncs.MakeLocalRef (env, jniFuncs.GetClassFromObject (jniFuncs.UnwrapRef (env, obj)));
+}
+
+static jboolean JNICALL IsInstanceOf (JNIEnv *env, jobject obj, jclass clazz) { printf ("JNI Function IsInstanceOf is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jobject JNICALL CallObjectMethodA (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args) { printf ("JNI Function CallObjectMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+#define BOXED_VALUE(obj) ((char*)(obj) + sizeof (MonoObject))
+
+static MonoObject *
+box_Boolean (jboolean val)
+{
+ return mono_value_box (mono_domain_get (), mono_get_boolean_class (), &val);
+}
+
+static MonoObject *
+box_Byte (jbyte val)
+{
+ /* Sbyte ! */
+ return mono_value_box (mono_domain_get (), mono_get_sbyte_class (), &val);
+}
+
+static MonoObject *
+box_Char (jchar val)
+{
+ return mono_value_box (mono_domain_get (), mono_get_char_class (), &val);
+}
+
+static MonoObject *
+box_Short (jshort val)
+{
+ return mono_value_box (mono_domain_get (), mono_get_int16_class (), &val);
+}
+
+static MonoObject *
+box_Int (jint val)
+{
+ return mono_value_box (mono_domain_get (), mono_get_int32_class (), &val);
+}
+
+static MonoObject *
+box_Long (jlong val)
+{
+ return mono_value_box (mono_domain_get (), mono_get_int64_class (), &val);
+}
+
+static MonoObject *
+box_Float (jfloat val)
+{
+ return mono_value_box (mono_domain_get (), mono_get_single_class (), &val);
+}
+
+static MonoObject *
+box_Double (jdouble val)
+{
+ return mono_value_box (mono_domain_get (), mono_get_double_class (), &val);
+}
+
+static int
+GetMethodArgs (jmethodID methodID, char* sig)
+{
+ char *res;
+
+ res = jniFuncs.GetMethodArgList (methodID);
+ strcpy (sig, res);
+ return strlen (sig);
+}
+
+static MonoObject*
+InvokeHelper (JNIEnv *env, jobject object, jmethodID methodID, jvalue* args)
+{
+ char sig[257];
+ int argc, i;
+ MonoObject **argarray;
+ MonoArray *args2;
+
+/* assert(!pLocalRefs->PendingException); */
+ g_assert(methodID);
+
+ argc = GetMethodArgs(methodID, sig);
+ argarray = g_new (MonoObject*, argc);
+ for(i = 0; i < argc; i++)
+ {
+ switch(sig[i])
+ {
+ case 'Z': {
+ jboolean val = args[i].z != JNI_FALSE;
+ argarray[i] = box_Boolean (val);
+ break;
+ }
+ case 'B':
+ argarray[i] = box_Byte (args[i].b);
+ break;
+ case 'C':
+ argarray[i] = box_Char (args[i].c);
+ break;
+ case 'S':
+ argarray[i] = box_Short (args[i].s);
+ break;
+ case 'I':
+ argarray[i] = box_Int (args[i].i);
+ break;
+ case 'J':
+ argarray[i] = box_Long (args[i].j);
+ break;
+ case 'F':
+ argarray[i] = box_Float (args[i].f);
+ break;
+ case 'D':
+ argarray[i] = box_Double (args[i].d);
+ break;
+ case 'L':
+ argarray[i] = jniFuncs.UnwrapRef (env, args[i].l);
+ break;
+ }
+ }
+
+ args2 = mono_array_new (mono_domain_get (), mono_get_object_class (), argc);
+ for (i = 0; i < argc; ++i)
+ mono_array_set (args2, MonoObject*, i, argarray [i]);
+
+ return jniFuncs.InvokeMethod (env, methodID, jniFuncs.UnwrapRef (env, object), args2, FALSE);
+}
+
+#define METHOD_IMPL_MANAGED(Type,type,cpptype) \
+static type JNICALL Call##Type##MethodA(JNIEnv *env, jobject obj, jmethodID methodID, jvalue* args)\
+{\
+ MonoObject* ret = InvokeHelper(env, obj, methodID, args);\
+ if(ret) return *(type*)BOXED_VALUE(ret);\
+ return 0;\
+}
+
+#define METHOD_IMPL(Type,type) \
+static type JNICALL Call##Type##MethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)\
+{\
+ char sig[257];\
+ int i;\
+ int argc = GetMethodArgs(methodID, sig);\
+ jvalue* argarray = (jvalue*)alloca(argc * sizeof(jvalue));\
+ for(i = 0; i < argc; i++)\
+ {\
+ switch(sig[i])\
+ {\
+ case 'Z':\
+ case 'B':\
+ case 'S':\
+ case 'C':\
+ case 'I':\
+ argarray[i].i = va_arg(args, int);\
+ break;\
+ case 'J':\
+ argarray[i].j = va_arg(args, gint64);\
+ break;\
+ case 'L':\
+ argarray[i].l = va_arg(args, jobject);\
+ break;\
+ case 'D':\
+ argarray[i].d = va_arg(args, double);\
+ break;\
+ case 'F':\
+ argarray[i].f = (float)va_arg(args, double);\
+ break;\
+ }\
+ }\
+ return Call##Type##MethodA(env, obj, methodID, argarray);\
+}\
+static type Call##Type##Method(JNIEnv *env, jobject obj, jmethodID methodID, ...) \
+{\
+ va_list args;\
+ type ret;\
+ va_start(args, methodID);\
+ ret = Call##Type##MethodV(env, obj, methodID, args);\
+ va_end(args);\
+ return ret;\
+}\
+static type JNICALL CallNonvirtual##Type##Method (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) \
+{\
+ printf ("JNI Function CallNonvirtual" #Type "Method is not implemented.\n"); g_assert_not_reached ();\
+ return 0;\
+}\
+static type JNICALL CallNonvirtual##Type##MethodV (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) \
+{\
+ printf ("JNI Function CallNonvirtual" #Type "MethodV is not implemented.\n"); g_assert_not_reached ();\
+ return 0;\
+}\
+static type JNICALL CallNonvirtual##Type##MethodA (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, jvalue *args) \
+{\
+ printf ("JNI Function CallNonvirtual" #Type "MethodA is not implemented.\n"); g_assert_not_reached ();\
+ return 0;\
+}
+
+METHOD_IMPL_MANAGED(Boolean,jboolean,gboolean)
+METHOD_IMPL_MANAGED(Byte,jbyte,gchar)
+METHOD_IMPL_MANAGED(Char,jchar,gunichar2)
+METHOD_IMPL_MANAGED(Short,jshort,gint16)
+METHOD_IMPL_MANAGED(Int,jint,gint32)
+METHOD_IMPL_MANAGED(Long,jlong,gint64)
+METHOD_IMPL_MANAGED(Float,jfloat,float)
+METHOD_IMPL_MANAGED(Double,jdouble,double)
+
+METHOD_IMPL(Object,jobject)
+METHOD_IMPL(Boolean,jboolean)
+METHOD_IMPL(Byte,jbyte)
+METHOD_IMPL(Char,jchar)
+METHOD_IMPL(Short,jshort)
+METHOD_IMPL(Int,jint)
+METHOD_IMPL(Long,jlong)
+METHOD_IMPL(Float,jfloat)
+METHOD_IMPL(Double,jdouble)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* TODO: These should be put into the macros above... */
+static void JNICALL CallVoidMethodA (JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args) {
+ InvokeHelper(env, obj, methodID, args);
+}
+
+static void JNICALL CallVoidMethodV (JNIEnv *env, jobject obj, jmethodID methodID, va_list args) {
+ char sig[257];
+ int argc, i;
+ jvalue* argarray;
+
+ argc = GetMethodArgs(methodID, sig);
+ argarray = (jvalue*)alloca(argc * sizeof(jvalue));
+
+ for(i = 0; i < argc; i++)
+ {
+ switch(sig[i])
+ {
+ case 'Z':
+ case 'B':
+ case 'S':
+ case 'C':
+ case 'I':
+ argarray[i].i = va_arg(args, int);
+ break;
+ case 'J':
+ argarray[i].j = va_arg(args, gint64);
+ break;
+ case 'L':
+ argarray[i].l = va_arg(args, jobject);
+ break;
+ case 'D':
+ argarray[i].d = va_arg(args, double);
+ break;
+ case 'F':
+ argarray[i].f = (float)va_arg(args, double);
+ break;
+ }
+ }
+ CallVoidMethodA(env, obj, methodID, argarray);
+}
+
+static void JNICALL CallVoidMethod (JNIEnv *env, jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ va_start(args, methodID);
+ CallVoidMethodV(env, obj, methodID, args);
+ va_end(args);
+}
+
+static void JNICALL CallNonvirtualVoidMethod (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallNonvirtualVoidMethod is not implemented.\n"); g_assert_not_reached (); }
+static void JNICALL CallNonvirtualVoidMethodV (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallNonvirtualVoidMethodV is not implemented.\n"); g_assert_not_reached (); }
+static void JNICALL CallNonvirtualVoidMethodA (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, jvalue * args) { printf ("JNI Function CallNonvirtualVoidMethodA is not implemented.\n"); g_assert_not_reached (); }
+
+static jfieldID FindFieldID(JNIEnv *env, jclass cls, const char* name, const char* sig, gboolean isstatic)
+{
+ return (jfieldID)jniFuncs.GetFieldCookie (jniFuncs.UnwrapRef (env, cls), StringFromUTF8 (name), StringFromUTF8 (sig), isstatic);
+}
+
+static jmethodID FindMethodID(JNIEnv *env, jclass cls, const char* name, const char* sig, gboolean isstatic)
+{
+ return (jmethodID)jniFuncs.GetMethodCookie (
+ jniFuncs.UnwrapRef (env, cls), StringFromUTF8(name), StringFromUTF8(sig), isstatic);
+}
+
+static jmethodID JNICALL GetMethodID (JNIEnv *env, jclass clazz, const char *name, const char *sig)
+{
+ return FindMethodID (env, clazz, name, sig, FALSE);
+}
+
+
+static jfieldID JNICALL GetFieldID (JNIEnv *env, jclass clazz, const char *name, const char *sig)
+{
+ return FindFieldID (env, clazz, name, sig, FALSE);
+}
+
+static jfieldID JNICALL GetStaticFieldID (JNIEnv *env, jclass clazz, const char *name, const char *sig)
+{
+ return FindFieldID (env, clazz, name, sig, TRUE);
+}
+
+static jmethodID JNICALL GetStaticMethodID (JNIEnv *env, jclass clazz, const char *name, const char *sig)
+{
+ return FindMethodID (env, clazz, name, sig, TRUE);
+}
+
+#define GET_SET_FIELD(Type,type,cpptype) \
+static void JNICALL Set##Type##Field(JNIEnv *env, jobject obj, jfieldID fieldID, type val)\
+{\
+ jniFuncs.SetFieldValue (fieldID, jniFuncs.UnwrapRef (env, obj), \
+ box_##Type (val));\
+}\
+static type JNICALL Get##Type##Field(JNIEnv *env, jobject obj, jfieldID fieldID)\
+{\
+ return *(cpptype*)BOXED_VALUE(jniFuncs.GetFieldValue (fieldID, jniFuncs.UnwrapRef (env, obj)));\
+}\
+static void JNICALL SetStatic##Type##Field (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value)\
+{\
+ jniFuncs.SetFieldValue (fieldID, NULL, \
+ box_##Type (value));\
+}\
+static type JNICALL GetStatic##Type##Field(JNIEnv *env, jclass clazz, jfieldID fieldID)\
+{\
+ return *(cpptype*)BOXED_VALUE(jniFuncs.GetFieldValue (fieldID, NULL));\
+}\
+
+
+
+/* return *(cpptype*)BOXED_VALUE (jniFuncs.GetFieldValue (fieldID, jniFuncs.UnwrapRef (obj))); */
+
+GET_SET_FIELD(Boolean,jboolean,gboolean)
+GET_SET_FIELD(Byte,jbyte, gchar)
+GET_SET_FIELD(Char,jchar, gunichar2)
+GET_SET_FIELD(Short,jshort,gshort)
+GET_SET_FIELD(Int,jint,int)
+GET_SET_FIELD(Long,jlong, gint64)
+GET_SET_FIELD(Float,jfloat,float)
+GET_SET_FIELD(Double,jdouble,double)
+
+static jobject JNICALL GetObjectField (JNIEnv *env, jobject obj, jfieldID fieldID)
+{
+ return (jobject)(jniFuncs.MakeLocalRef (env, jniFuncs.GetFieldValue (fieldID, jniFuncs.UnwrapRef (env, obj))));
+}
+
+static void JNICALL SetObjectField (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val)
+{
+ jniFuncs.SetFieldValue (fieldID, jniFuncs.UnwrapRef (env, obj), jniFuncs.UnwrapRef (env, val));
+}
+
+static jobject JNICALL GetStaticObjectField (JNIEnv *env, jclass clazz, jfieldID fieldID)
+{
+ return (jobject)(jniFuncs.MakeLocalRef (env, jniFuncs.GetFieldValue (fieldID, NULL)));
+}
+
+static void JNICALL SetStaticObjectField (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value)
+{
+ jniFuncs.SetFieldValue (fieldID, NULL, jniFuncs.UnwrapRef (env, value));
+}
+
+
+
+static jobject JNICALL CallStaticObjectMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticObjectMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jobject JNICALL CallStaticObjectMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticObjectMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jobject JNICALL CallStaticObjectMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticObjectMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jboolean JNICALL CallStaticBooleanMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticBooleanMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jboolean JNICALL CallStaticBooleanMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticBooleanMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jboolean JNICALL CallStaticBooleanMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticBooleanMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jbyte JNICALL CallStaticByteMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticByteMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jbyte JNICALL CallStaticByteMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticByteMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jbyte JNICALL CallStaticByteMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticByteMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jchar JNICALL CallStaticCharMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticCharMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jchar JNICALL CallStaticCharMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticCharMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jchar JNICALL CallStaticCharMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticCharMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jshort JNICALL CallStaticShortMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticShortMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jshort JNICALL CallStaticShortMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticShortMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jshort JNICALL CallStaticShortMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticShortMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jint JNICALL CallStaticIntMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticIntMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jint JNICALL CallStaticIntMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticIntMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jint JNICALL CallStaticIntMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticIntMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jlong JNICALL CallStaticLongMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticLongMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jlong JNICALL CallStaticLongMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticLongMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jlong JNICALL CallStaticLongMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticLongMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jfloat JNICALL CallStaticFloatMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticFloatMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jfloat JNICALL CallStaticFloatMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticFloatMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jfloat JNICALL CallStaticFloatMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticFloatMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jdouble JNICALL CallStaticDoubleMethod (JNIEnv *env, jclass clazz, jmethodID methodID, ...) { printf ("JNI Function CallStaticDoubleMethod is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jdouble JNICALL CallStaticDoubleMethodV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticDoubleMethodV is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jdouble JNICALL CallStaticDoubleMethodA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args) { printf ("JNI Function CallStaticDoubleMethodA is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static void JNICALL CallStaticVoidMethod (JNIEnv *env, jclass cls, jmethodID methodID, ...) { printf ("JNI Function CallStaticVoidMethod is not implemented.\n"); g_assert_not_reached (); }
+static void JNICALL CallStaticVoidMethodV (JNIEnv *env, jclass cls, jmethodID methodID, va_list args) { printf ("JNI Function CallStaticVoidMethodV is not implemented.\n"); g_assert_not_reached (); }
+static void JNICALL CallStaticVoidMethodA (JNIEnv *env, jclass cls, jmethodID methodID, jvalue * args) { printf ("JNI Function CallStaticVoidMethodA is not implemented.\n"); g_assert_not_reached (); }
+
+static jstring JNICALL NewString (JNIEnv *env, const jchar *unicode, jsize len) { printf ("JNI Function NewString is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jsize JNICALL GetStringLength (JNIEnv *env, jstring str) { printf ("JNI Function GetStringLength is not implemented.\n"); g_assert_not_reached (); return 0; }
+static const jchar *JNICALL GetStringChars (JNIEnv *env, jstring str, jboolean *isCopy) { printf ("JNI Function GetStringChars is not implemented.\n"); g_assert_not_reached (); return 0; }
+static void JNICALL ReleaseStringChars (JNIEnv *env, jstring str, const jchar *chars) { printf ("JNI Function ReleaseStringChars is not implemented.\n"); g_assert_not_reached (); }
+
+static jstring JNICALL NewStringUTF (JNIEnv *env, const char *utf)
+{
+ return (jstring)jniFuncs.MakeLocalRef (env, StringFromUTF8 (utf));
+}
+
+static jsize JNICALL GetStringUTFLength (JNIEnv *env, jstring str) { printf ("JNI Function GetStringUTFLength is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static const char* JNICALL GetStringUTFChars (JNIEnv *env, jstring str, jboolean *isCopy)
+{
+ MonoString *s;
+ char *buf;
+ int i, j, e;
+
+ s = jniFuncs.UnwrapRef (env, str);
+ buf = g_malloc (mono_string_length (s) * 3 + 1);
+
+ j = 0;
+ for(i = 0, e = mono_string_length (s); i < e; i++)
+ {
+ jchar ch = mono_string_chars (s)[i];
+ if ((ch != 0) && (ch <=0x7f))
+ {
+ buf[j++] = (char)ch;
+ }
+ else if (ch <= 0x7FF)
+ {
+ /* 11 bits or less. */
+ unsigned char high_five = ch >> 6;
+ unsigned char low_six = ch & 0x3F;
+ buf[j++] = high_five | 0xC0; /* 110xxxxx */
+ buf[j++] = low_six | 0x80; /* 10xxxxxx */
+ }
+ else
+ {
+ /* possibly full 16 bits. */
+ char high_four = ch >> 12;
+ char mid_six = (ch >> 6) & 0x3F;
+ char low_six = ch & 0x3f;
+ buf[j++] = high_four | 0xE0; /* 1110xxxx */
+ buf[j++] = mid_six | 0x80; /* 10xxxxxx */
+ buf[j++] = low_six | 0x80; /* 10xxxxxx*/
+ }
+ }
+ buf[j] = 0;
+ if(isCopy)
+ {
+ *isCopy = JNI_TRUE;
+ }
+
+ return buf;
+}
+
+static void JNICALL ReleaseStringUTFChars (JNIEnv *env, jstring str, const char* chars)
+{
+ g_free ((char*)chars);
+}
+
+static jsize JNICALL GetArrayLength (JNIEnv *env, jarray array)
+{
+ MonoArray *arr = jniFuncs.UnwrapRef (env, array);
+ return mono_array_length (arr);
+}
+
+static jobject JNICALL GetObjectArrayElement (JNIEnv *env, jobjectArray array, jsize index) { printf ("JNI Function GetObjectArrayElement is not implemented.\n"); g_assert_not_reached (); return 0; }
+static void JNICALL SetObjectArrayElement (JNIEnv *env, jobjectArray array, jsize index, jobject val) { printf ("JNI Function SetObjectArrayElement is not implemented.\n"); g_assert_not_reached (); }
+
+static int new_java_array (JNIEnv *env, MonoClass *eclass, jsize len)
+{
+ return jniFuncs.MakeLocalRef (env, mono_array_new (mono_domain_get (), eclass, len));
+}
+
+static jobjectArray JNICALL NewObjectArray (JNIEnv *env, jsize len, jclass clazz, jobject init) { printf ("JNI Function NewObjectArray is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jbooleanArray JNICALL NewBooleanArray (JNIEnv *env, jsize len)
+{
+ return (jbooleanArray)new_java_array (env, mono_get_boolean_class (), len);
+}
+
+static jbyteArray JNICALL NewByteArray (JNIEnv *env, jsize len)
+{
+ return (jbyteArray)new_java_array (env, mono_get_sbyte_class (), len);
+}
+
+static jcharArray JNICALL NewCharArray (JNIEnv *env, jsize len)
+{
+ return (jcharArray)new_java_array (env, mono_get_char_class (), len);
+}
+
+static jshortArray JNICALL NewShortArray (JNIEnv *env, jsize len)
+{
+ return (jshortArray)new_java_array (env, mono_get_int16_class (), len);
+}
+
+static jintArray JNICALL NewIntArray (JNIEnv *env, jsize len)
+{
+ return (jintArray)new_java_array (env, mono_get_int32_class (), len);
+}
+
+static jlongArray JNICALL NewLongArray (JNIEnv *env, jsize len)
+{
+ return (jlongArray)new_java_array (env, mono_get_int64_class (), len);
+}
+
+static jfloatArray JNICALL NewFloatArray (JNIEnv *env, jsize len)
+{
+ return (jfloatArray)new_java_array (env, mono_get_single_class (), len);
+}
+
+static jdoubleArray JNICALL NewDoubleArray (JNIEnv *env, jsize len)
+{
+ return (jdoubleArray)new_java_array (env, mono_get_double_class (), len);
+}
+
+/* Original version with copy */
+#if 0
+#define GET_SET_ARRAY_ELEMENTS(Type,type,cpptype) \
+static type* JNICALL Get##Type##ArrayElements(JNIEnv *env, type##Array array, jboolean *isCopy)\
+{\
+ int i; \
+ MonoArray *obj; \
+ type *res; \
+\
+ obj = jniFuncs.UnwrapRef ((void*)array); \
+ res = g_new (type, mono_array_length (obj) + 1); \
+ for (i = 0; i < mono_array_length (obj); ++i) { \
+ res [i] = mono_array_get (obj, cpptype, i); \
+ } \
+\
+ if (isCopy) \
+ *isCopy = JNI_TRUE; \
+ return res; \
+} \
+\
+static void JNICALL Release##Type##ArrayElements(JNIEnv *env, type##Array array, type *elems, jint mode)\
+{\
+ int i; \
+ MonoArray *obj; \
+ type *res; \
+\
+ obj = jniFuncs.UnwrapRef ((void*)array); \
+ if(mode == 0)\
+ {\
+ for (i = 0; i < mono_array_length (obj); ++i) \
+ mono_array_get (obj, cpptype, i) = elems [i]; \
+ g_free (elems); \
+ }\
+ else if(mode == JNI_COMMIT)\
+ {\
+ for (i = 0; i < mono_array_length (obj); ++i) \
+ mono_array_get (obj, cpptype, i) = elems [i]; \
+ }\
+ else if(mode == JNI_ABORT)\
+ {\
+ g_free (elems);\
+ }\
+}
+#endif
+
+
+/*
+ * Fast version with no copy. Works because the mono garbage collector is
+ * non-copying.
+ */
+#define GET_SET_ARRAY_ELEMENTS(Type,type,cpptype) \
+static type* JNICALL Get##Type##ArrayElements(JNIEnv *env, type##Array array, jboolean *isCopy)\
+{\
+ MonoArray *obj; \
+\
+ obj = jniFuncs.UnwrapRef (env, (void*)array); \
+ if (isCopy) \
+ *isCopy = JNI_FALSE;\
+ return (type*)mono_array_addr (obj, cpptype, 0); \
+} \
+\
+static void JNICALL Release##Type##ArrayElements(JNIEnv *env, type##Array array, type *elems, jint mode)\
+{\
+ return; \
+} \
+static void JNICALL Get##Type##ArrayRegion (JNIEnv *env, type##Array array, jsize start, jsize l, type *buf) \
+{\
+ MonoArray *obj; \
+ obj = jniFuncs.UnwrapRef (env, (void*)array); \
+ memcpy (buf, mono_array_addr (obj, type, start), (sizeof (type) * l)); \
+} \
+static void JNICALL Set##Type##ArrayRegion (JNIEnv *env, type##Array array, jsize start, jsize l, type *buf) \
+{ \
+ MonoArray *obj; \
+ obj = jniFuncs.UnwrapRef (env, (void*)array); \
+ memcpy (mono_array_addr (obj, type, start), buf, (sizeof (type) * l)); \
+}
+
+GET_SET_ARRAY_ELEMENTS(Boolean,jboolean,gboolean)
+GET_SET_ARRAY_ELEMENTS(Byte,jbyte,gchar)
+GET_SET_ARRAY_ELEMENTS(Char,jchar,gunichar2)
+GET_SET_ARRAY_ELEMENTS(Short,jshort,short)
+GET_SET_ARRAY_ELEMENTS(Int,jint,int)
+GET_SET_ARRAY_ELEMENTS(Long,jlong,glong)
+GET_SET_ARRAY_ELEMENTS(Float,jfloat,float)
+GET_SET_ARRAY_ELEMENTS(Double,jdouble,double)
+
+static void * JNICALL GetPrimitiveArrayCritical (JNIEnv *env, jarray array, jboolean *isCopy) {
+ MonoArray *obj;
+
+ obj = jniFuncs.UnwrapRef (env, (void*)array);
+ if (isCopy)
+ *isCopy = JNI_FALSE;
+ return mono_array_addr (obj, void*, 0);
+}
+
+static void JNICALL ReleasePrimitiveArrayCritical (JNIEnv *env, jarray array, void *carray, jint mode) {
+}
+
+static const jchar * JNICALL GetStringCritical (JNIEnv *env, jstring string, jboolean *isCopy) {
+ MonoString *obj;
+
+ obj = jniFuncs.UnwrapRef (env, (void*)string);
+
+ if (isCopy)
+ *isCopy = JNI_FALSE;
+
+ return mono_string_chars (obj);
+}
+
+static void JNICALL ReleaseStringCritical (JNIEnv *env, jstring string, const jchar *cstring)
+{
+}
+
+static jobject JNICALL NewObjectA (JNIEnv *env, jclass clazz, jmethodID methodID, jvalue *args)
+{
+ return (jobject)jniFuncs.MakeLocalRef (env, InvokeHelper (env, NULL, methodID, args));
+}
+
+static jobject JNICALL NewObjectV (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
+{
+ char sig[257];
+ int i;
+ jvalue *argarray;
+ int argc;
+
+ argc = GetMethodArgs(methodID, sig);
+ argarray = (jvalue*)alloca(argc * sizeof(jvalue));
+ for(i = 0; i < argc; i++)
+ {
+ switch(sig[i])
+ {
+ case 'Z':
+ case 'B':
+ case 'S':
+ case 'C':
+ case 'I':
+ argarray[i].i = va_arg(args, int);
+ break;
+ case 'J':
+ argarray[i].j = va_arg(args, gint64);
+ break;
+ case 'L':
+ argarray[i].l = va_arg(args, jobject);
+ break;
+ case 'D':
+ argarray[i].d = va_arg(args, double);
+ break;
+ case 'F':
+ argarray[i].f = (float)va_arg(args, double);
+ break;
+ }
+ }
+
+ return NewObjectA (env, clazz, methodID, argarray);
+}
+
+static jobject JNICALL NewObject (JNIEnv *env, jclass clazz, jmethodID methodID, ...)
+{
+ va_list args;
+ jobject o;
+ va_start(args, methodID);
+ o = NewObjectV(env, clazz, methodID, args);
+ va_end(args);
+ return o;
+}
+
+static jint JNICALL RegisterNatives (JNIEnv *env, jclass clazz, const JNINativeMethod *methods, jint nMethods) { printf ("JNI Function RegisterNatives is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jint JNICALL UnregisterNatives (JNIEnv *env, jclass clazz) { printf ("JNI Function UnregisterNatives is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+static jint JNICALL MonitorEnter (JNIEnv *env, jobject obj) { printf ("JNI Function MonitorEnter is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jint JNICALL MonitorExit (JNIEnv *env, jobject obj) { printf ("JNI Function MonitorExit is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+jint JNICALL GetJavaVM (JNIEnv *env, JavaVM **vm)
+{
+ if (!vm_ptr)
+ vm_ptr = (void***)&vm_func_table;
+
+ *vm = (JavaVM*)&vm_ptr;
+
+ return JNI_OK;
+}
+
+static void JNICALL GetStringRegion (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf) { printf ("JNI Function GetStringRegion is not implemented.\n"); g_assert_not_reached (); }
+static void JNICALL GetStringUTFRegion (JNIEnv *env, jstring str, jsize start, jsize len, char *buf) { printf ("JNI Function GetStringUTFRegion is not implemented.\n"); g_assert_not_reached (); }
+
+static jweak JNICALL NewWeakGlobalRef (JNIEnv *env, jobject obj) { printf ("JNI Function NewWeakGlobalRef is not implemented.\n"); g_assert_not_reached (); return 0; }
+static void JNICALL DeleteWeakGlobalRef (JNIEnv *env, jweak ref) { printf ("JNI Function DeleteWeakGlobalRef is not implemented.\n"); g_assert_not_reached (); }
+
+static jboolean JNICALL ExceptionCheck (JNIEnv *env) {
+ return jniFuncs.ExceptionCheck (env);
+}
+
+static jobject JNICALL NewDirectByteBuffer (JNIEnv* env, void* address, jlong capacity) { printf ("JNI Function NewDirectByteBuffer is not implemented.\n"); g_assert_not_reached (); return 0; }
+static void* JNICALL GetDirectBufferAddress (JNIEnv* env, jobject buf) { printf ("JNI Function GetDirectBufferAddress is not implemented.\n"); g_assert_not_reached (); return 0; }
+static jlong JNICALL GetDirectBufferCapacity (JNIEnv* env, jobject buf) { printf ("JNI Function GetDirectBufferCapacity is not implemented.\n"); g_assert_not_reached (); return 0; }
+
+
+/***************************************************************************/
+/* VM FUNCTIONS */
+/***************************************************************************/
+
+static jint DestroyJavaVM (void *vm)
+{
+ g_assert_not_reached ();
+ return 0;
+}
+
+static jint AttachCurrentThread (void *vm, void **penv, void *args)
+{
+ g_assert_not_reached ();
+ return 0;
+}
+
+static jint DetachCurrentThread (void *vm)
+{
+ g_assert_not_reached ();
+ return 0;
+}
+
+static jint GetEnv (void *vm, void **penv, jint version)
+{
+ void *env = jniFuncs.GetJniEnv ();
+ if (env) {
+ *penv = env;
+ return JNI_OK;
+ }
+ else {
+ *penv = NULL;
+ return JNI_EDETACHED;
+ }
+}
+
+static jint AttachCurrentThreadAsDaemon (void *vm, void **penv, void *args)
+{
+ g_assert_not_reached ();
+ return 0;
+}
+
+
+
+/*****************************************************************************/
+
+static void *jni_func_table[256] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ (void*)&GetVersion,
+ (void*)&DefineClass,
+ (void*)&FindClass,
+ (void*)&FromReflectedMethod,
+ (void*)&FromReflectedField,
+ (void*)&ToReflectedMethod,
+ (void*)&GetSuperclass,
+ (void*)&IsAssignableFrom,
+ (void*)&ToReflectedField,
+ (void*)&Throw,
+ (void*)&ThrowNew,
+ (void*)&ExceptionOccurred,
+ (void*)&ExceptionDescribe,
+ (void*)&ExceptionClear,
+ (void*)&FatalError,
+ (void*)&PushLocalFrame,
+ (void*)&PopLocalFrame,
+ (void*)&NewGlobalRef,
+ (void*)&DeleteGlobalRef,
+ (void*)&DeleteLocalRef,
+ (void*)&IsSameObject,
+ (void*)&NewLocalRef,
+ (void*)&EnsureLocalCapacity,
+ (void*)&AllocObject,
+ (void*)&NewObject,
+ (void*)&NewObjectV,
+ (void*)&NewObjectA,
+ (void*)&GetObjectClass,
+ (void*)&IsInstanceOf,
+ (void*)&GetMethodID,
+ (void*)&CallObjectMethod,
+ (void*)&CallObjectMethodV,
+ (void*)&CallObjectMethodA,
+ (void*)&CallBooleanMethod,
+ (void*)&CallBooleanMethodV,
+ (void*)&CallBooleanMethodA,
+ (void*)&CallByteMethod,
+ (void*)&CallByteMethodV,
+ (void*)&CallByteMethodA,
+ (void*)&CallCharMethod,
+ (void*)&CallCharMethodV,
+ (void*)&CallCharMethodA,
+ (void*)&CallShortMethod,
+ (void*)&CallShortMethodV,
+ (void*)&CallShortMethodA,
+ (void*)&CallIntMethod,
+ (void*)&CallIntMethodV,
+ (void*)&CallIntMethodA,
+ (void*)&CallLongMethod,
+ (void*)&CallLongMethodV,
+ (void*)&CallLongMethodA,
+ (void*)&CallFloatMethod,
+ (void*)&CallFloatMethodV,
+ (void*)&CallFloatMethodA,
+ (void*)&CallDoubleMethod,
+ (void*)&CallDoubleMethodV,
+ (void*)&CallDoubleMethodA,
+ (void*)&CallVoidMethod,
+ (void*)&CallVoidMethodV,
+ (void*)&CallVoidMethodA,
+ (void*)&CallNonvirtualObjectMethod,
+ (void*)&CallNonvirtualObjectMethodV,
+ (void*)&CallNonvirtualObjectMethodA,
+ (void*)&CallNonvirtualBooleanMethod,
+ (void*)&CallNonvirtualBooleanMethodV,
+ (void*)&CallNonvirtualBooleanMethodA,
+ (void*)&CallNonvirtualByteMethod,
+ (void*)&CallNonvirtualByteMethodV,
+ (void*)&CallNonvirtualByteMethodA,
+ (void*)&CallNonvirtualCharMethod,
+ (void*)&CallNonvirtualCharMethodV,
+ (void*)&CallNonvirtualCharMethodA,
+ (void*)&CallNonvirtualShortMethod,
+ (void*)&CallNonvirtualShortMethodV,
+ (void*)&CallNonvirtualShortMethodA,
+ (void*)&CallNonvirtualIntMethod,
+ (void*)&CallNonvirtualIntMethodV,
+ (void*)&CallNonvirtualIntMethodA,
+ (void*)&CallNonvirtualLongMethod,
+ (void*)&CallNonvirtualLongMethodV,
+ (void*)&CallNonvirtualLongMethodA,
+ (void*)&CallNonvirtualFloatMethod,
+ (void*)&CallNonvirtualFloatMethodV,
+ (void*)&CallNonvirtualFloatMethodA,
+ (void*)&CallNonvirtualDoubleMethod,
+ (void*)&CallNonvirtualDoubleMethodV,
+ (void*)&CallNonvirtualDoubleMethodA,
+ (void*)&CallNonvirtualVoidMethod,
+ (void*)&CallNonvirtualVoidMethodV,
+ (void*)&CallNonvirtualVoidMethodA,
+ (void*)&GetFieldID,
+ (void*)&GetObjectField,
+ (void*)&GetBooleanField,
+ (void*)&GetByteField,
+ (void*)&GetCharField,
+ (void*)&GetShortField,
+ (void*)&GetIntField,
+ (void*)&GetLongField,
+ (void*)&GetFloatField,
+ (void*)&GetDoubleField,
+ (void*)&SetObjectField,
+ (void*)&SetBooleanField,
+ (void*)&SetByteField,
+ (void*)&SetCharField,
+ (void*)&SetShortField,
+ (void*)&SetIntField,
+ (void*)&SetLongField,
+ (void*)&SetFloatField,
+ (void*)&SetDoubleField,
+ (void*)&GetStaticMethodID,
+ (void*)&CallStaticObjectMethod,
+ (void*)&CallStaticObjectMethodV,
+ (void*)&CallStaticObjectMethodA,
+ (void*)&CallStaticBooleanMethod,
+ (void*)&CallStaticBooleanMethodV,
+ (void*)&CallStaticBooleanMethodA,
+ (void*)&CallStaticByteMethod,
+ (void*)&CallStaticByteMethodV,
+ (void*)&CallStaticByteMethodA,
+ (void*)&CallStaticCharMethod,
+ (void*)&CallStaticCharMethodV,
+ (void*)&CallStaticCharMethodA,
+ (void*)&CallStaticShortMethod,
+ (void*)&CallStaticShortMethodV,
+ (void*)&CallStaticShortMethodA,
+ (void*)&CallStaticIntMethod,
+ (void*)&CallStaticIntMethodV,
+ (void*)&CallStaticIntMethodA,
+ (void*)&CallStaticLongMethod,
+ (void*)&CallStaticLongMethodV,
+ (void*)&CallStaticLongMethodA,
+ (void*)&CallStaticFloatMethod,
+ (void*)&CallStaticFloatMethodV,
+ (void*)&CallStaticFloatMethodA,
+ (void*)&CallStaticDoubleMethod,
+ (void*)&CallStaticDoubleMethodV,
+ (void*)&CallStaticDoubleMethodA,
+ (void*)&CallStaticVoidMethod,
+ (void*)&CallStaticVoidMethodV,
+ (void*)&CallStaticVoidMethodA,
+ (void*)&GetStaticFieldID,
+ (void*)&GetStaticObjectField,
+ (void*)&GetStaticBooleanField,
+ (void*)&GetStaticByteField,
+ (void*)&GetStaticCharField,
+ (void*)&GetStaticShortField,
+ (void*)&GetStaticIntField,
+ (void*)&GetStaticLongField,
+ (void*)&GetStaticFloatField,
+ (void*)&GetStaticDoubleField,
+ (void*)&SetStaticObjectField,
+ (void*)&SetStaticBooleanField,
+ (void*)&SetStaticByteField,
+ (void*)&SetStaticCharField,
+ (void*)&SetStaticShortField,
+ (void*)&SetStaticIntField,
+ (void*)&SetStaticLongField,
+ (void*)&SetStaticFloatField,
+ (void*)&SetStaticDoubleField,
+ (void*)&NewString,
+ (void*)&GetStringLength,
+ (void*)&GetStringChars,
+ (void*)&ReleaseStringChars,
+ (void*)&NewStringUTF,
+ (void*)&GetStringUTFLength,
+ (void*)&GetStringUTFChars,
+ (void*)&ReleaseStringUTFChars,
+ (void*)&GetArrayLength,
+ (void*)&NewObjectArray,
+ (void*)&GetObjectArrayElement,
+ (void*)&SetObjectArrayElement,
+ (void*)&NewBooleanArray,
+ (void*)&NewByteArray,
+ (void*)&NewCharArray,
+ (void*)&NewShortArray,
+ (void*)&NewIntArray,
+ (void*)&NewLongArray,
+ (void*)&NewFloatArray,
+ (void*)&NewDoubleArray,
+ (void*)&GetBooleanArrayElements,
+ (void*)&GetByteArrayElements,
+ (void*)&GetCharArrayElements,
+ (void*)&GetShortArrayElements,
+ (void*)&GetIntArrayElements,
+ (void*)&GetLongArrayElements,
+ (void*)&GetFloatArrayElements,
+ (void*)&GetDoubleArrayElements,
+ (void*)&ReleaseBooleanArrayElements,
+ (void*)&ReleaseByteArrayElements,
+ (void*)&ReleaseCharArrayElements,
+ (void*)&ReleaseShortArrayElements,
+ (void*)&ReleaseIntArrayElements,
+ (void*)&ReleaseLongArrayElements,
+ (void*)&ReleaseFloatArrayElements,
+ (void*)&ReleaseDoubleArrayElements,
+ (void*)&GetBooleanArrayRegion,
+ (void*)&GetByteArrayRegion,
+ (void*)&GetCharArrayRegion,
+ (void*)&GetShortArrayRegion,
+ (void*)&GetIntArrayRegion,
+ (void*)&GetLongArrayRegion,
+ (void*)&GetFloatArrayRegion,
+ (void*)&GetDoubleArrayRegion,
+ (void*)&SetBooleanArrayRegion,
+ (void*)&SetByteArrayRegion,
+ (void*)&SetCharArrayRegion,
+ (void*)&SetShortArrayRegion,
+ (void*)&SetIntArrayRegion,
+ (void*)&SetLongArrayRegion,
+ (void*)&SetFloatArrayRegion,
+ (void*)&SetDoubleArrayRegion,
+ (void*)&RegisterNatives,
+ (void*)&UnregisterNatives,
+ (void*)&MonitorEnter,
+ (void*)&MonitorExit,
+ (void*)&GetJavaVM,
+ (void*)&GetStringRegion,
+ (void*)&GetStringUTFRegion,
+ (void*)&GetPrimitiveArrayCritical,
+ (void*)&ReleasePrimitiveArrayCritical,
+ (void*)&GetStringCritical,
+ (void*)&ReleaseStringCritical,
+ (void*)&NewWeakGlobalRef,
+ (void*)&DeleteWeakGlobalRef,
+ (void*)&ExceptionCheck,
+ (void*)&NewDirectByteBuffer,
+ (void*)&GetDirectBufferAddress,
+ (void*)&GetDirectBufferCapacity
+};
+
+static void *vm_func_table[64] = {
+ NULL,
+ NULL,
+ NULL,
+ (void*)&DestroyJavaVM,
+ (void*)&AttachCurrentThread,
+ (void*)&DetachCurrentThread,
+ (void*)&GetEnv,
+ (void*)&AttachCurrentThreadAsDaemon
+};
+
diff --git a/man/Makefile.am b/man/Makefile.am
index bb1642c1177..9efab233809 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,5 @@
-man_MANS = mcs.1 mono.1 monostyle.1
+man_MANS = mcs.1 mono.1 monostyle.1 mono-config.5 sqlsharp.1 oldmono.1 ilasm.1 \
+ cert2spc.1 cilc.1 genxs.1 wsdl.1 disco.1 soapsuds.1 makecert.1 \
+ chktrust.1 setreg.1 sn.1 secutil.1 signcode.1 certmgr.1 monop.1 xsd.1 gacutil.1
EXTRA_DIST = $(man_MANS)
-
diff --git a/man/cert2spc.1 b/man/cert2spc.1
new file mode 100644
index 00000000000..9329e9da3c4
--- /dev/null
+++ b/man/cert2spc.1
@@ -0,0 +1,42 @@
+.\"
+.\" cert2spc manual page.
+.\" Copyright 2002, 2003 Motus Technologies
+.\" Author:
+.\" Sebastien Pouliot (spouliot@motus.com)
+.\"
+.TH Mono "cert2spc"
+.SH NAME
+cert2spc \- Transform multiple X.509 certificates to a Software
+Publisher Certificate
+.SH SYNOPSIS
+.PP
+.B cert2spc certificate|crl [certificate|crl ...] outputfile.spc
+.SH DESCRIPTION
+Combine a list of X.509 certificates or X.509 CRL (Certificate
+Revocation List) into a Software Publisher Certificate (PKCS#7
+file). The SPC file is required for signing a PE file (like an
+assembly) using signcode.
+.SH PARAMETERS
+.TP
+.I "certificate"
+One (or more) X.509 certificate to add (space separated).
+.TP
+.I "crl"
+One (or more) X.509 CRL to add (space separated).
+.TP
+.I "output.spc"
+Software Publisher Certificate to output. If the specified file
+exists it will be overwritten.
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2002, 2003 Motus Technologies.
+Released under BSD license.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR makecert(1), signcode(1)
+
+
diff --git a/man/certmgr.1 b/man/certmgr.1
new file mode 100755
index 00000000000..442bea26496
--- /dev/null
+++ b/man/certmgr.1
@@ -0,0 +1,75 @@
+.\"
+.\" certmgr manual page.
+.\" Copyright 2004 Novell
+.\" Author:
+.\" Sebastien Pouliot <sebastien@ximian.com>
+.\"
+.TH Mono "certmgr"
+.SH NAME
+certmgr \- Mono Certificate Manager (CLI version)
+.SH SYNOPSIS
+.PP
+.B certmgr [action] [object type] [options] store [filename]
+.SH DESCRIPTION
+This tool allow to add, remove or extract certificates, certificate revocation
+lists (CRL) or certificate trust lists (CTL) to/from a certificate store.
+Certificate stores are used to build and validate certificate chains for
+Authenticode(r) code signing validation and SSL server certificates.
+.SH ACTIONS
+.TP
+.I "-add"
+Add a certificate, CRL or CTL to specified store.
+.TP
+.I "-del"
+Remove a certificate, CRL or CTL from specified store.
+.TP
+.I "-put"
+Copy a certificate, CRL or CTL from a store to a file.
+.SH OBJECT TYPES
+.TP
+.I "-c", "-cert", "-certificate"
+Add, Delete or Put certificates. That is the specified file must/will contains
+X.509 certificates in DER binary encoding.
+.TP
+.I "-crl"
+Add, Delete or Put certificate revocation lists (CRL). That is the specified
+file must/will contains X.509 CRL in DER binary encoding.
+.TP
+.I "-ctl"
+Add, Delete or Put certificate trust lists (CRL). UNSUPPORTED.
+.SH OPTIONS
+.TP
+.I "-v", "-verbose"
+More details displayed on the console.
+.TP
+.I "-help", "-h", "-?", "/?"
+Display help about this tool.
+.SH FILES
+.B WARNING: This details the current behavior of Mono and could change between releases.
+The only safe way to interact with certificate stores is to use the certmgr
+tool. The current releases of Mono keeps all the user certificate stores in
+separates directories under
+.I ~/.mono/certs/
+.TP
+For example the trusted root certificates for a user would be kept under
+.I ~/.mono/certs/Trust/
+.TP
+Certificates files are kept in DER (binary) format (extension .cer).
+.TP
+The filenames either starts with
+.I tbp
+(thumbprint) or
+.I ski
+(subject key identifier).
+.TP
+The rest of the filename is the base64-encoded value (tbp or ski).
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2004 Novell.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR makecert(1), setreg(1)
diff --git a/man/chktrust.1 b/man/chktrust.1
new file mode 100755
index 00000000000..64ea33f1335
--- /dev/null
+++ b/man/chktrust.1
@@ -0,0 +1,46 @@
+.\"
+.\" chktrust manual page.
+.\" Copyright 2003 Motus Technologies
+.\" Copyright 2004 Novell
+.\" Author:
+.\" Sebastien Pouliot (sebastien@ximian.com)
+.\"
+.TH Mono "chktrust"
+.SH NAME
+chktrust \- Check the trust of a PE executable.
+.SH SYNOPSIS
+.PP
+.B chktrust [options] filename
+.SH DESCRIPTION
+Verify if an PE executable (CLR assembly, Win32 EXE or DLL) has a valid
+Authenticode(r) signature that can be traced back to a trusted certificate
+authority (CA). This means that
+.TP
+(a) the signature is valid (i.e. file integrity) and,
+.TP
+(b) the code-signing certificate can be chained back to one of the
+certificates in the Trust store.
+.SH OPTIONS
+.TP
+.I "-q", "-quiet"
+Quiet mode. Limited display on console.
+.TP
+.I "-v", "-verbose"
+Verbose mode. More details displayed on the console.
+.TP
+.I "-help", "-h", "-?", "/?"
+Display help about this tool.
+.SH KNOWN RESTRICTIONS
+chktrust cannot validate Authenticode signatures on CAB files.
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2003 Motus Technologies.
+Copyright (C) 2004 Novell.
+Released under BSD license.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR signcode(1), makecert(1), certmgr(1), setreg(1)
diff --git a/man/cilc.1 b/man/cilc.1
new file mode 100644
index 00000000000..faa351f419c
--- /dev/null
+++ b/man/cilc.1
@@ -0,0 +1,21 @@
+.TH "cilc" 1
+.SH NAME
+cilc \- Mono CIL-to-C binding generator
+.SH SYNOPSIS
+.B cilc
+[options]
+.I assembly
+.I target
+.SH DESCRIPTION
+cilc is the Mono CIL-to-C binding generator. It takes a CIL assembly as input
+and generates a directory of C sources which, when compiled, provide a C
+interface to the classes contained within that assembly by means of a shared
+object library.
+.PP
+Generated sources make use of the Mono embedding API. Thus a complete Mono
+development environment must be available on the development system and a
+complete Mono runtime environment must be available on target systems.
+.SH AUTHOR
+Written by Alp Toker <alp@atoker.com>
+.SH SEE ALSO
+mono(1)
diff --git a/man/disco.1 b/man/disco.1
new file mode 100644
index 00000000000..e8e319ccc65
--- /dev/null
+++ b/man/disco.1
@@ -0,0 +1,68 @@
+.\"
+.\" disco manual page.
+.\" (C) 2003 Novell, Inc.
+.\" Author:
+.\" Lluis Sanchez Gual (lluis@ximian.com)
+.\"
+.TH disco 1
+.SH NAME
+disco \- Mono's Web Service Discovery Tool
+.SH SYNOPSIS
+.PP
+.B disco
+[options] url
+.SH DESCRIPTION
+.I disco
+is a tool for discovering web services and for retireving the documents that
+describe those services.
+.PP
+.I url
+is the location of a DISCO document, which includes a list of WSDL documents,
+XML schemas and references to other DISCO documents.
+.PP
+.I disco
+downloads the DISCO document and all referenced documents (unless
+the
+.I "-nosave"
+option is specified), and saves them to disk.
+.SH OPTIONS
+The following options are available:
+.TP
+.I "-nologo"
+Supress the startup logo.
+.TP
+.I "-nosave"
+Do not save the discovered documents to disk. The default is to save the documents.
+.TP
+.I "-o:directory", "-out:directory"
+The directory where to save the discovered documents.
+By default, documents are saved in the current directory.
+.TP
+.I "-u:username", "-user:username"
+The user name to use when connecting to the server.
+.TP
+.I "-p:password", "-password:password"
+The password to use when connecting to the server.
+.TP
+.I "-d:domain", "-domain:domain"
+The domain to use when connecting to the server.
+.TP
+.I "-proxy:url"
+The url of the proxy server to use for http requests.
+.TP
+.I "-proxyusername:username"
+The user name to use when connecting to the proxy.
+.TP
+.I "-proxypassword:password"
+The password to use when connecting to the proxy.
+.TP
+.I "-proxydomain:domain"
+The domain to use when connecting to the proxy.
+.SH AUTHORS
+Lluis Sanchez Gual (lluis@ximian.com)
+.PP
+.SH LICENSE
+disco is released under the terms of the GNU GPL.
+.PP
+.SH SEE ALSO
+wsdl(1), soapsuds(1), mono(1), mcs(1)
diff --git a/man/gacutil.1 b/man/gacutil.1
new file mode 100644
index 00000000000..2b696533f3c
--- /dev/null
+++ b/man/gacutil.1
@@ -0,0 +1,121 @@
+..\"
+.\" gacutil manual page.
+.\" (C) 2004 Novell, Inc.
+.\" Author:
+.\" Miguel de Icaza (miguel@gnu.org)
+.\"
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.TH gacutil "Mono 1.0"
+.SH NAME
+gacutil \- Global Asssembly Cache management utility.
+.SH SYNOPSIS
+.PP
+.B gacutil [-user] [command] [options]
+.SH DESCRIPTION
+\fIgacutil\fP is a tool used by developers to install assemblies into
+the system Global Assembly Cache (GAC) to become part of the
+assemblies that are available for all applications at runtime.
+.PP
+Notice that they are not directly available to the compiler, the
+convention is that assemblies must also be placed in a separate
+directory for being accessed to the compiler. This is done with the
+-package directive to gacutil.
+.PP
+The tool allows for installation, removal, and listing of the
+contents of the assembly cache.
+.PP
+The GAC is relative to the Mono installation prefix:
+mono_prefix/lib/mono.
+.PP
+.SH COMMANDS
+.I -i <assembly_path> [-check_refs] [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
+.Sp
+ Installs an assembly into the global assembly cache. <assembly_path>
+is the name of the file that contains the assembly manifest
+.Sp
+The -package option can be used to also create a directory in in
+prefix/lib/mono with the name NAME, and a symlink is created from
+NAME/assembly_name to the assembly on the GAC. This is used so
+developers can reference a set of libraries at once.
+.Sp
+The -root option is used by developers integrating this with automake
+tools or packaging tools that require a prefix directory to be
+specified. The root represents the "libdir" component of a prefix
+(typically prefix/lib).
+.Sp
+The -gacdir option is used to specify the GACs base directory. Once an
+assembly has been installed to a non standard gacdir the MONO_GAC_PREFIX
+environment variable must be used to access the assembly.
+.Sp
+The -check_refs option is used to ensure that the assembly being
+installed into the GAC does not reference any non strong named
+assemblies. Assemblies being installed to the GAC should not reference
+non strong named assemblies, however the is an optional check.
+.fi
+.PP
+.I "-l" [assembly_name] [-root ROOTDIR] [-gacdir GACDIR]
+.Sp
+Lists the contents of the global assembly cache. When the
+<assembly_name> parameter is specified only matching assemblies are
+listed.
+.PP
+.I "-u" <assembly_display_name> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
+.Sp
+Uninstalls an assembly from the global assembly cache.
+<assembly_display_name> is the name of the assembly (partial or
+fully qualified) to remove from the global assembly cache. If a
+partial name is specified all matching assemblies will be
+uninstalled. As opposed to the install option that takes a filename,
+this takes as an argument the assembly name, which looks like this:
+.nf
+ MyLibrary.Something, version=1.0.0.0, publicKeyToken=xxxx,culture=neutral
+.fi
+.Sp
+Notice that you can have spaces in the command line, there is no need
+to quote them.
+.Sp
+The removal performs a greedy removal, if you only specifiy one
+component like, "MyLibrary.Something", it will remove all versions of
+the library.
+.Sp
+.I "-us" <assembly_path> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
+Uninstalls an assembly using the specifed assemblies full name.
+<assembly path> is the path to an assembly. The full assembly name
+is retrieved from the specified assembly if there is an assembly in
+the GAC with a matching name, it is removed. Unlike the -u option this
+option takes a file name, like this:
+.nf
+ Example: -us myDll.dll
+.fi
+.Sp
+.I "-ul" <assembly_list_file> [-package NAME] [-root ROOTDIR] [-gacdir GACDIR]
+Uninstalls one or more assemblies from the global assembly cache.
+<assembly_list_file> is the path to a test file containing a list of
+assembly names on separate lines.
+.nf
+Example -ul assembly_list.txt
+.fi
+.nf
+assembly_list.txt contents:
+ assembly1,Version=1.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef
+ assembly2,Version=2.0.0.0,Culture=en,PublicKeyToken=0123456789abcdef
+.fi
+.SH FILES
+On Unix assemblies are loaded from the installation lib directory. If you set
+`prefix' to /usr, the assemblies will be located in /usr/lib. On
+Windows, the assemblies are loaded from the directory where mono and
+mint live.
+.PP
+/etc/mono/config, ~/.mono/config
+.PP
+Mono runtime configuration file. See the mono-config(5) manual page
+for more information.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR mcs(1), mono(1)
+
+
diff --git a/man/genxs.1 b/man/genxs.1
new file mode 100644
index 00000000000..26b6d6066b5
--- /dev/null
+++ b/man/genxs.1
@@ -0,0 +1,294 @@
+.\"
+.\" genxs manual page.
+.\" (C) Lluis Sanchez Gual (lluis@ximian.com)
+.\"
+.TH genxs 1
+.SH NAME
+genxs \- Mono's Xml Serializer Generator
+.SH SYNOPSIS
+.PP
+.B genxs
+configurationFile [destinationFolder]
+.SH DESCRIPTION
+.I genxs
+is a tool for generating custom XML serialization writers and readers for
+classes.
+.PP
+.I configurationFile
+is configuration file which specifies several
+information, such as the class for which to generate the reader and writer, the
+name and namespace of the classes to generate, and a collection of hooks to
+apply. By using hooks it is possible to customize the
+behavior of the serializer without needing to modify the generated file, so you
+can safely regenerate it if the source class is modified.
+.PP
+.I destinationFolder
+specifies the folder where the files will be generated.
+.PP
+.B NOTE:
+This tool only runs in the Mono runtime, since it uses some internal
+classes not available in other runtimes.
+.SH CONFIGURATION FILE FORMAT
+The configuration file is an xml document based on the following grammar
+("?" means optional, "*" 0 or more):
+.PP
+.nf
+ <configuration>
+ <serializer class="name" assembly="name"> *
+ <reader>name</reader> ?
+ <writer>name</writer> ?
+ <namespace>name</namespace> ?
+ <outFileName>name</outFileName> ?
+ <readerHooks> ?
+ <hook ...> *
+ </readerHooks>
+ <writerHooks> ?
+ <hook ...> *
+ </writerHooks>
+ </serializer>
+ </configuration>
+.fi
+.PP
+A configuration file can have multiple "serializer" elements, each of which
+specifies the class for which to generate a serializer together with several
+generation options. The source class is specified in the following attributes:
+.PP
+.IP " *" 5
+.I class
+: name of the class (including namespace).
+.IP " *" 5
+.I assembly
+: assembly name. It can include the complete path.
+.PP
+Generation options are specified in child elements:
+.PP
+.IP " *" 5
+.I reader
+: name of the reader class.
+.IP " *" 5
+.I writer
+: name of the writer class.
+.IP " *" 5
+.I namespace
+: namespace of the reader and writer classes.
+.IP " *" 5
+.I outFileName
+: name of the generated file.
+.IP " *" 5
+.I readerHooks
+: a list of hooks to apply to the reader.
+.IP " *" 5
+.I writerHooks
+: a list of hooks to apply to the writer.
+.SH SPECIFYING HOOKS
+Using hooks you can customize the behavior of readers and writers.
+A hook specification follows this grammar:
+.PP
+.nf
+ <hook type="name">
+ <select> ?
+ <typeName>name</typeName> ?
+ <typeAttribute>name</typeAttribute> *
+ <typeMember>name</typeMember> ?
+ </select>
+ <replace>source code</replace> ?
+ <insertBefore>source code</insertBefore> ?
+ <insertAfter>source code</insertAfter> ?
+ </hook>
+.fi
+.PP
+The "type" attribute specifies the context in which the hook is applied. It can
+be one of the following:
+.PP
+.IP " *" 5
+.I attributes
+: hook is applied where attributes are serialized/deserialized.
+.IP " *" 5
+.I elements
+: hook is applied where elements are serialized/deserialized.
+.IP " *" 5
+.I unknownAttribute
+: hook is applied where unknown attributes are processed.
+.IP " *" 5
+.I unknownElement
+: hook is applied where unknown elements are processed.
+.IP " *" 5
+.I member
+: hook is applied where a member is serialized/deserialized.
+.IP " *" 5
+.I type
+: hook is applied for the whole type.
+.PP
+The "select" element specifies the classes and members to which the hook has
+to be added. It can contain the following elements:
+.PP
+.IP " *" 5
+.I typeName
+: the class with that name will be selected (must include namespace)
+.IP " *" 5
+.I typeAttribute
+: all classes which have that attribute applied will be selected (specify the
+full attribute class name, including namespace). Several attribute names can be
+specified.
+.IP " *" 5
+.I typeMember
+: name of the class member for which the hook must be added.
+.PP
+The hook source code can be specified using any of the following elements:
+.PP
+.IP " *" 5
+.I replace
+: the provided source code will replace all serialization/deserialization
+operations in the hook context.
+.IP " *" 5
+.I insertBefore
+: the source code will be added before the hook context.
+.IP " *" 5
+.I insertAfter
+: the source code will be added after the hook context.
+.PP
+When writing the code for a hook you can use some special variables that are
+defined during the code generation process. The variables are the following:
+.PP
+.IP " *" 5
+.I $TYPE:
+name of the class being generated, without namespace.
+.IP " *" 5
+.I $FULLTYPE:
+full name of the class being generated, including namespace.
+.IP " *" 5
+.I $OBJECT:
+the object being serialized or deserialized. When using a replace
+reader hook of type "type", the hook code must assign the deserialized object
+to this variable.
+.IP " *" 5
+-I $ELEMENT:
+name of the element of the object being serialized/deserialized.
+.IP " *" 5
+.I $NAMESPACE:
+namespace of the element of the object being serialized/deserialized.
+.IP " *" 5
+.I $MEMBER:
+name of the member being serialized/deserialized. Only valid in the "member"
+context.
+.SH HOOK EXAMPLES
+The following example adds a call to a Validate method after the deserialization
+of any object:
+.PP
+.nf
+<hook type="type">
+ <insertAfter>
+ System.Xml.Schema.XmlSchema.Validate$TYPE ($OBJECT);
+ </insertAfter>
+</hook>
+.fi
+.PP
+This example specifies the code to be used to deserialize the XmlSchema class:
+.PP
+.nf
+<hook type="type">
+ <select>
+ <typeName>System.Xml.Schema.XmlSchema</typeName>
+ </select>
+ <replace>
+ $OBJECT = System.Xml.Schema.XmlSchema.Read (Reader, null);
+ </replace>
+</hook>
+.fi
+.PP
+That one specifies the code to be used to read XmlSchema instances:
+.PP
+.nf
+<hook type="type">
+ <select>
+ <typeName>System.Xml.Schema.XmlSchema</typeName>
+ </select>
+ <replace>$OBJECT.Write (Writer);</replace>
+</hook>
+.fi
+.PP
+With this two hooks the serializer will print some information when serializing
+the class "MyClass":
+.PP
+.nf
+<hook type="type">
+ <select>
+ <typeName>MyNamespace.MyClass</typeName>
+ </select>
+ <insertBefore>Console.WriteLine ("Serializing MyClass");</replace>
+ <insertAfter>Console.WriteLine ("MyClass serialized");</insertAfter>
+</hook>
+<hook type="member">
+ <select>
+ <typeName>MyNamespace.MyClass</typeName>
+ </select>
+ <insertAfter>
+ Console.WriteLine ("Serialized member $MEMBER");
+ </insertAfter>
+</hook>
+.fi
+.PP
+This hook writes an additional element for all types that have the custom
+attribute "MyAttribute":
+.PP
+.nf
+<hook type="elements">
+ <select>
+ <typeAttribute>MyNamespace.MyAttribute</typeAttribute>
+ </select>
+ <insertAfter>
+ Writer.WriteStartElement ("privateData");
+ Writer.WriteString ($OBJECT.PrivateData);
+ Writer.WriteEndElement ();
+ </insertAfter>
+</hook>
+.fi
+.SH CONFIGURATION FILE EXAMPLE
+This is the configuration file used to generate the serializer for ServiceDescription:
+.PP
+.nf
+<configuration>
+ <serializer class="System.Web.Services.Description.ServiceDescription" assembly="System.Web.Services">
+ <reader>ServiceDescriptionReaderBase</reader>
+ <writer>ServiceDescriptionWriterBase</writer>
+ <namespace>System.Web.Services.Description</namespace>
+ <outFileName>ServiceDescriptionSerializerBase.cs</outFileName>
+ <readerHooks>
+ <hook type="unknownElement">
+ <select>
+ <typeAttribute>System.Web.Services.Configuration.XmlFormatExtensionPointAttribute</typeAttribute>
+ </select>
+ <replace>ServiceDescription.ReadExtension (Reader, $OBJECT);</replace>
+ </hook>
+ <hook type="type">
+ <select>
+ <typeName>System.Xml.Schema.XmlSchema</typeName>
+ </select>
+ <replace>$OBJECT = System.Xml.Schema.XmlSchema.Read (Reader, null);</replace>
+ </hook>
+ </readerHooks>
+ <writerHooks>
+ <hook type="elements">
+ <select>
+ <typeAttribute>System.Web.Services.Configuration.XmlFormatExtensionPointAttribute</typeAttribute>
+ </select>
+ <insertBefore>ServiceDescription.WriteExtensions (Writer, $OBJECT);</insertBefore>
+ </hook>
+ <hook type="type">
+ <select>
+ <typeName>System.Xml.Schema.XmlSchema</typeName>
+ </select>
+ <replace>$OBJECT.Write (Writer);</replace>
+ </hook>
+ </writerHooks>
+ </serializer>
+</configuration>
+.fi
+.SH AUTHORS
+Lluis Sanchez Gual (lluis@ximian.com)
+.PP
+.SH LICENSE
+GenXS is released under the terms of the GNU GPL.
+.PP
+.SH SEE ALSO
+mono(1), mcs(1)
diff --git a/man/ilasm.1 b/man/ilasm.1
new file mode 100644
index 00000000000..73dabf139a2
--- /dev/null
+++ b/man/ilasm.1
@@ -0,0 +1,44 @@
+.TH "ilasm" 1
+.SH NAME
+ilasm \- Mono IL assembler
+.SH SYNOPSIS
+.B ilasm
+[option] [source-files]
+.SH DESCRIPTION
+ilasm is the Mono ILAsm assembler. You can pass one or more options to
+drive the compiler, and a set of source files.
+
+The Mono ILAsm assembler accepts options starting with / or - for mosted
+options.
+
+The Mono ILAsm assembler generates images (.exe and .dll files) that contain
+CIL byte code that can be executed by any system that implemented a Common
+Language Infrastructure virtual machine.
+.SH OPTIONS
+.TP
+.B \//output:<file_name>
+Specify the output file name.
+.TP
+.B \//exe
+Generate an exe
+.TP
+.B \//dll
+Generate a library
+.TP
+.B \//scan_only
+Just scan the IL code and display tokens.
+.TP
+.B \//show_tokens
+Show tokens as they are parsed.
+.TP
+.B \//show_method_def
+Display method information when a method is defined.
+.TP
+.B \//show_method_ref
+Display method information when a method is referenced
+.TP
+.B \--about
+Display information about ilasm
+.TP
+.B \--version
+Display ilasm version
diff --git a/man/makecert.1 b/man/makecert.1
new file mode 100755
index 00000000000..3a1b1053036
--- /dev/null
+++ b/man/makecert.1
@@ -0,0 +1,129 @@
+.\"
+.\" makecert manual page.
+.\" Copyright 2003 Motus Technologies
+.\" Copyright 2004 Novell
+.\" Author:
+.\" Sebastien Pouliot (sebastien@ximian.com)
+.\"
+.TH Mono "MakeCert"
+.SH NAME
+MakeCert \- Create X.509 certificates for test purposes
+.SH SYNOPSIS
+.PP
+.B makecert [options] certificate
+.SH DESCRIPTION
+Create an X.509 certificate using the provided informations. This
+is useful for testing Authenticode signatures, SSL and S/MIME
+technologies.
+.SH PARAMETERS
+.TP
+.I "-# num"
+Specify the certificate serial number.
+.TP
+.I "-n dn"
+Specify the subject Distinguished Name (DN).
+.TP
+.I "-in dn"
+Specify the issuer Distinguished Name (DN).
+.TP
+.I "-r"
+Create a self-signed, also called root, certificate.
+.TP
+.I "-iv pvkfile"
+Specify the private key file (.PVK) for the issuer. The private key in the
+specified file will be used to sign the new certificate.
+.TP
+.I "-ic certfile"
+Extract the issuer's name from the specified certificate file - i.e. the
+subject name of the specified certificate becomes the issuer name of the
+new certificate.
+.TP
+.I "-in name"
+Use the issuer's name from the specified parameter.
+.TP
+.I "-ik container"
+Specify the key container name to be used for the issuer.
+.TP
+.I "-iky [signature | exchange | #]"
+Specify the key number to be used in the provider (when used with -ik).
+.TP
+.I "-ip provider"
+Specify the cryptographic provider to be used for the issuer.
+.TP
+.I "-ir [localmachine | currentuser]"
+Specify the provider will search the user or the machine keys containers for
+the issuer.
+.TP
+.I "-iy number"
+Specify the provider type to be used for the issuer.
+.TP
+.I "-sv pkvfile"
+Specify the private key file (.PVK) for the subject. The public part of the
+key will be inserted into the created certificate. If non-existant the
+specified file will be created with a new key pair (default to 1024 bits RSA
+key pair).
+.TP
+.I "-sk container"
+Specify the key container name to be used for the subject.
+.TP
+.I "-sky [signature | exchange | #]"
+Specify the key number to be used in the provider (when used with -sk).
+.TP
+.I "-sp provider"
+Specify the cryptographic provider to be used for the subject.
+.TP
+.I "-sr [localmachine | currentuser]"
+Specify the provider will search the user or the machine keys containers for
+the subject.
+.TP
+.I "-sy number"
+Specify the provider type to be used for the issuer.
+.TP
+.I "-a hash"
+Select hash algorithm. Only MD5 and SHA1 algorithms are supported.
+.TP
+.I "-b date"
+The date since when the certificate is valid (notBefore).
+.TP
+.I "-e date"
+The date until when the certificate is valid (notAfter).
+.TP
+.I "-m number"
+Specify the certificate validity period in months. This is added to the
+notBefore validity date which can be set with -b or will default to the
+current date/time.
+.TP
+.I "-cy [authority|end]"
+Basic constraints. Select Authority or End-Entity certificate. Only Authority
+certificates can be used to sign other certificates (-ic). End-Entity can
+be used by clients (e.g. Authenticode, S/MIME) or servers (e.g. SSL).
+.TP
+.I "-h number"
+Add a path length restriction to the certificate chain. This is only
+applicable for certificates that have BasicConstraint set to Authority (-cy
+authority). This is used to limit the chain of certificates than can be
+issued under this authority.
+.TP
+.I "-eku oid[,oid]"
+Add some extended key usage OID to the certificate.
+.TP
+.I "-?"
+Help (display this help message)
+.TP
+.I "-!"
+Extended help (for advanced options)
+.SH KNOWN RESTRICTIONS
+Compared to the Windows version some options aren't supported (-$, -d, -l,
+-nscp, -is, -sc, -ss). Also PVK files with passwords aren't supported.
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2003 Motus Technologies.
+Copyright (C) 2004 Novell.
+Released under BSD license.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR signcode(1)
diff --git a/man/man.xml b/man/man.xml
new file mode 100644
index 00000000000..18e7d975076
--- /dev/null
+++ b/man/man.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<manpages>
+<manpage name="Mono" page="mono.1" />
+<manpage name="Mint" page="mono.1" />
+<manpage name="Mcs" page="mcs.1" />
+<manpage name="Ilasm" page="ilasm.1" />
+<manpage name="Monodis" page="mono.1" />
+<manpage name="Cilc" page="cilc.1" />
+<manpage name="Sql#" page="sqlsharp.1" />
+<manpage name="SecUtil" page="secutil.1" />
+<manpage name="MonoStyle" page="monostyle.1" />
+<manpage name="genxs" page="genxs.1" />
+<manpage name="cert2spc" page="cert2spc.1" />
+<manpage name="makecert" page="makecert.1" />
+<manpage name="chktrust" page="chktrust.1" />
+<manpage name="signcode" page="signcode.1" />
+<manpage name="sn" page="sn.1" />
+<manpage name="wsdl" page="wsdl.1" />
+<manpage name="disco" page="disco.1" />
+<manpage name="soapsuds" page="soapsuds.1" />
+<manpage name="setreg" page="setreg.1" />
+<manpage name="certmgr" page="certmgr.1" />
+<manpage name="xsd" page="xsd.1" />
+</manpages>
diff --git a/man/manpages.source b/man/manpages.source
new file mode 100644
index 00000000000..bfb47cc44c8
--- /dev/null
+++ b/man/manpages.source
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<monodoc>
+ <source provider="man" basefile="tree" path="manpages"/>
+</monodoc>
diff --git a/man/mcs.1 b/man/mcs.1
index 796bc0e2ca0..c3f9484b17a 100755
--- a/man/mcs.1
+++ b/man/mcs.1
@@ -11,6 +11,13 @@ compiler, and a set of source files. Extra options or arguments can
be provided in a response file. Response files are referenced by
prepending the @ symbol to the response file name.
.PP
+The Mono C# compiler accepts the same options than the Microsoft C#
+compiler does. Those options can start with a slash or a dash
+(/checked is the same as -checked). Additionally to this, the
+GNU-like options are supported, those begin with "--". All
+MCS-specific flags which are not available in the Microsoft C#
+compiler are available only with the GNU-style options.
+.PP
C# source files must end with a ".cs" extension. Compilation of C#
source code requires all the files that make up a library, module or
executable to be provided on the command line. There is no support
@@ -29,90 +36,197 @@ Executables are not bound to a specific CPU or operating system.
.I \-\-about
Displays information about the Mono C# compiler
.TP
-.I \-\-checked
+.I \-\-addmodule:MODULE1[,MODULE2]
+Includes the specified modules in the resulting assembly.
+.TP
+.I -checked, -checked+
Sets the default compilation mode to `checked'. This makes all
the math operations checked (the default is unchecked).
.TP
-.I \-\-define SYMBOL
-Defines a symbol named SYMBOL. This can be tested in the source code
-by the pre-processor.
+.I -checked-
+Sets the default compilation mode to `unchecked'. This makes all
+the math operations unchecked (this is the default).
+.TP
+.I -codepage:ID
+Specifies the code page used to process the input files from the
+point it is specified on. By default files will be processed in the
+Latin-1 code page. The compiler will also automatically detect
+Unicode files that have an embedded byte mark at the beginning. The
+special ID "utf8" can be used to switch to utf8 and the ID "reset"
+restores the automatic handling of code pages.
+.TP
+.I \-define:SYMLIST, -d:SYMLIST
+Defines the symbol listed by the semi-colon separeted list SYMLIST
+SYMBOL. This can be tested in the source code by the pre-processor,
+or can be used by methods that have been tagged with the Conditional
+attribute.
+.TP
+.I \-debug, \-debug+, \-g
+Generate debugging information. To obtain stack traces with debugging
+information, you need to invoke the mono runtime with the `--debug'
+flag. This debugging information is stored inside the assembly as a
+resource.
+.TP
+.I \-debug-
+Do not generate debugging information.
.TP
-.I \-\-debug or \-g
-Generate debugging information.
+.I \-delaysign+
+Only embed the strongname public key into the assembly. The actual
+signing must be done in a later stage using the SN tool. This is useful
+to protect the private key during development. Note that delay signing
+can only be done using a strongname key file (not a key container). The
+option is equivalent to including [assembly: AssemblyDelaySign (true)]
+in your source code. Compiler option takes precedence over the
+attributes.
.TP
+.I \-delaysign-
+Default. Strongname (sign) the assembly using the strong name key file
+(or container). The option is equivalent to including [assembly:
+AssemblyDelaySign (false)] in your source code. Compiler option takes
+precedence over the attributes.
+.TP
+.I \-\-expect-error X L
+The compiler will expect the code to generate an error
+named `X' in line `L'. This is only used by the test suite.
+.TP
.I \-\-fatal
This is used for debugging the compiler. This makes the error emission
generate an exception that can be caught by a debugger.
.TP
-.I \-\-stacktrace
-Generates a stack trace at the time the error is reported, useful for
-debugging the compiler.
+.I \-keyfile:KEYFILE
+Strongname (sign) the output assembly using the key pair present in
+the specified strong name key file (snk). A full key pair is required
+by default (or when using delaysign-). A file containing only the
+public key can be used with delaysign+. The option is equivalent to
+including [assembly: AssemblyKeyFile ("KEYFILE")] in your source code.
+Compiler option takes precedence over the attributes.
+.TP
+.I \-keycontainer:CONTAINER
+Strongname (sign) the output assembly using the key pair present in
+the specified container. Note that delaysign+ is ignored when using
+key containers. The option is equivalent to including [assembly:
+AssemblyKeyName ("CONTAINER")] in your source code. Compiler option
+takes precedence over the attributes.
+.TP
+.I \-langversion:TEXT
+The option specifies the version of the language to use. The feature
+set is different in each C# version. This switch can be used to force
+the compiler to allow only a subset of the features.
+The possible values are:
+.nf
+
+Default - Instruct compiler to use the latest version. Equivalent
+is to omit the switch.
+
+ISO-1 - Restrict compiler to use only ISO standardized features.
+The usage of features such as generics, static classes, anonymous
+methods will lead to error.
+.TP
+.I -lib:PATHLIST
+Each path specified in the comma-separated list will direct the
+compiler to look for libraries in that specified path.
.TP
.I \-L PATH
Directs the compiler to look for libraries in the specified path.
-Multiple paths can be provided.
+Multiple paths can be provided by using the option multiple times.
.TP
-.I \-\-nostdlib
+.I \-main:CLASS
+Tells the compiler which CLASS contains the entry point. Useful when
+you are compiling several classes with a Main method.
+.TP
+.I \-nostdlib, -nostdlib+
Use this flag if you want to compile the core library. This makes the
compiler load its internal types from the assembly being compiled.
.TP
-.I \-\-noconfig
+.I \-noconfig, \-noconfig+
Disables the default compiler configuration to be loaded. The
compiler by default has references to the system assemblies.
.TP
-.I \-\-nowarn XXX
-Makes the compiler ignore warning XXX.
+.I \-nowarn:WARNLIST
+Makes the compiler ignore warnings specified in the comma-separeted
+list WARNLIST>
.TP
-.I \-o FNAME
+.I -out:FNAME, -o FNAME
Names the output file to be generated.
.TP
-.I \-\-optimize
-Turns on optimizations in the compiler.
-.TP
.I \-\-parse
Used for benchmarking. The compiler will only parse its input files.
.TP
-.I \-\-probe X L
-Probes for the code to generate an error named `X' in line `L'. This
-is only used by the test suite.
+.I \-pkg:package1[,packageN]
+The compiler will invoke pkg-config --libs on the set of packages
+specified on the command line to obtain libraries and directories to
+compile the code.
+.PP
+This is typically used with third party components, like this:
+.nf
+ $ mcs -pkg:gtk-sharp demo.cs
+.fi
.TP
-.I \-\-recurse PATTERN
+.I -resource:RESOURCE[,ID]
+Embeds to the given resource file. The optional ID can be used to
+give a different name to the resource. If not specified, the resource
+name will be the file name.
+.TP
+.I -linkresource:RESOURCE[,ID]
+Links to the specified RESOURCE. The optional ID can be used to give
+a name to the linked resource.
+.TP
+.I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
+Reference the named assemblies. Use this to use classes from the named
+assembly in your program. The assembly will be loaded from either the
+system directory where all the assemblies live, or from the path
+explicitly given with the -L option.
+.PP
+You can also use a semicolon to separate the assemblies instead of a
+comma.
+.TP
+.I \-recurse:PATTERN, --recurse PATTERN
Does recursive compilation using the specified pattern. In Unix the
shell will perform globbing, so you migth want to use it like this:
.PP
.nf
- bash$ mcs --recurse '*.cs'
+ $ mcs -recurse:'*.cs'
.fi
.TP
-.I \-\-resource FILE
-Adds FILE as a resource of the resulting assembly.
+.I \-\-stacktrace
+Generates a stack trace at the time the error is reported, useful for
+debugging the compiler.
.TP
-.I \-\-target KIND
-Used to specify the desired target. The possible values are: exe,
-winexe, library and module.
+.I \-target:KIND, \-t:KIND
+Used to specify the desired target. The possible values are: exe
+(plain executable), winexe (Windows.Forms executable), library
+(component libraries) and module (partial library).
.TP
.I \-\-timestamp
Another debugging flag. Used to display the times at various points
in the compilation process.
.TP
-.I \-\-unsafe
+.I \-unsafe, -unsafe+
Enables compilation of unsafe code.
.TP
-.I \-\-werror
+.I \-v
+Debugging. Turns on verbose yacc parsing.
+.TP
+.I \-v2
+Turns on C# 2.0 language features.
+.TP
+.I \-\-version
+Shows the compiler version.
+.TP
+.I \-warnaserror, \-warnaserror+
Treat warnings as errors.
.TP
-.I \-\-wlevel LEVEL
+.I \-warn:LEVEL
Sets the warning level. 0 is the lowest warning level, and 4 is the
highest. The default is 2.
.TP
-.I \-r ASSEMBLY
-Reference the named assembly. Use this to use classes from the named
-assembly in your program. The assembly will be loaded from either the
-system directory where all the assemblies live, or from the path
-explicitly given with the -L option.
+.I \-win32res:FILE
+Specifies a Win32 resource file (.res) to be bundled into the
+resulting assembly.
.TP
-.I \-v
-Debugging. Turns on verbose yacc parsing.
+.I \-win32icon:FILE
+Attaches the icon specified in FILE on the output into the resulting
+assembly.
.TP
.I \-\-
Use this to stop option parsing, and allow option-looking parameters
@@ -151,10 +265,12 @@ for details on how to use this file.
.SH NOTES
During compilation the MCS compiler defines the __MonoCS__ symbol,
this can be used by pre-processor instructions to compile Mono C#
-compiler specific code.
+compiler specific code. Please note that this symbol is only to test
+for the compiler, and is not useful to distinguish compilation or
+deployment platforms.
.SH AUTHORS
-The Mono C# Compiler was written by Miguel de Icaza and Ravi Pratap at
-Ximian.
+The Mono C# Compiler was written by Miguel de Icaza, Ravi Pratap and
+Martin Baulig at Ximian.
.PP
.SH LICENSE
The Mono Compiler Suite is released under the terms of the GNU GPL.
@@ -162,7 +278,7 @@ Please read the accompanying `COPYING' file for details. Alternative
licenses are available from Ximian.
.PP
.SH SEE ALSO
-mono(1), mint(1)
+mono(1), mint(1), sn(1)
.PP
.SH BUGS
To report bugs in the compiler, you can use `bug-buddy', or you can
diff --git a/man/mono-config.5 b/man/mono-config.5
new file mode 100644
index 00000000000..1229a104b21
--- /dev/null
+++ b/man/mono-config.5
@@ -0,0 +1,89 @@
+.\"
+.\" mono-config configuration page.
+.\" (C) Ximian, Inc.
+.\" Author:
+.\" Miguel de Icaza (miguel@gnu.org)
+.\" Paolo Molaro (lupus@ximian.com)
+.\"
+.TH Mono "Mono 1.0"
+.SH NAME
+mono-config \- Mono runtime file format configuration
+.SH DESCRIPTION
+The Mono runtime will load configuration data from the
+installation prefix /etc/mono/config file, the ~/.mono/config or from
+the file pointed by the MONO_CONFIG environment variable.
+.PP
+For each assembly loaded a config file with the name:
+/path/to/the/assembly.exe.config is loaded, too.
+.PP
+This file controls the behavior of the runtime.
+.PP
+The file contains an XML-like file with various sections, all of them
+contained inside a
+.B<configuration>
+section (It actually uses GMarkup
+to parse the file).
+.SH <dllmap> directive
+You use the dllmap directive to map shared libraries referenced by
+P/Invoke in your assemblies to a different shared library.
+.PP
+This is typically used to map Windows libraries to Unix library names.
+The
+.B dllmap
+element takes two attributes:
+.TP
+.I dll
+This should be the same string used in the DllImport attribute
+.TP
+.I target
+This should be the name of the library where the function can be found:
+this name should be suitable for use with the platform native shared library
+loading routines (dlopen etc.), so you may want to check the manpages for that, too.
+.SH <dllentry> directive
+This directive can be used to map a specific dll/function pair to a different
+library and also a different function name. It should appear inside a
+.B dllmap
+element with only the dll attribute specified.
+.PP
+The
+.B dllentry
+element takes 3 attributes:
+.TP
+.I dll
+This is the target library, where the function can be found.
+.TP
+.I name
+This is the name of the fuction as it appears in the metadata: it is the name
+of the P/Invoke method.
+.TP
+.I target
+This is the name of the function to lookup instead of the name specified in the
+P/Invoke method.
+.SH EXAMPLES
+The following example maps references to the `cygwin1.dll' shared
+library to the `libc.so.6' file.
+.nf
+<configuration>
+ <dllmap dll="cygwin1.dll" target="libc.so.6"/>
+</configuration>
+.fi
+.PP
+This one maps the following C# method:
+.nf
+ [DllImport ("libc")]
+ static extern void somefunction ();
+.fi
+to
+.B differentfunction
+in
+.B libdifferent.so.
+.nf
+<configuration>
+ <dllmap dll="libc">
+ <dllentry dll="libdifferent.so" name="somefunction" target="differentfunction" />
+ </dllmap>
+</configuration>
+.fi
+
+.SH SEE ALSO
+.BR mono(1), monodis(1), mint(1)
diff --git a/man/mono.1 b/man/mono.1
index 0d6dc2f20b7..1379258a04f 100644
--- a/man/mono.1
+++ b/man/mono.1
@@ -1,148 +1,393 @@
.\"
.\" mono manual page.
-.\" (C) Ximian, Inc.
+.\" (C) 2003 Ximian, Inc.
.\" Author:
.\" Miguel de Icaza (miguel@gnu.org)
.\"
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
.TH Mono "Mono 1.0"
.SH NAME
-mono \- Mono ECMA-CLI Just in Time compiler.
+mono \- Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-of-Time)
.SH SYNOPSIS
.PP
-.B mono
-[\-\-help] [\-d] [\-\-debug-asm] [\-\-debug-forest] [\-\-trace-calls]
-[\-\-compile name] [\-\-ncompile num] [\-\-noinline] [\-\-profile]
-[\-\-debug=[format]] [\-\-debug-args args] [\-\-break name] [\-\-precompile name]
-[\-\-config filename]
-program.exe [arguments...]
+.B mono [options] file [arguments...]
.SH DESCRIPTION
-The \fImono\fP program is a Just in Time compiler for ECMA CLI byte
-codes. It translates dynamically a CIL stream into native code.
-.I program.exe
+\fImono\fP is a runtime implementation of the ECMA Common Language
+Infrastructure. This can be used to run ECMA and .NET applications.
+.PP
+The runtime contains a native code generator that transforms the
+Common Intermediate Language into native code.
+.PP
+The code generator can operate in two modes: just in time compilation
+(JIT) or ahead of time compilation (AOT). Since code can be
+dynamically loaded, the runtime environment and the JIT are always
+present, even if code is compiled ahead of time.
+.PP
+The runtime loads ths specified
+.I file
and optionally passes
the
.I arguments
-to it.
-.SH OPTIONS
-The following options are supported:
+to it. The
+.I file
+is an ECMA assembly. They typically have a .exe or .dll extension.
+.PP
+The runtime provides a number of configuration options for running
+applications, for developping and debugging, and for testing and
+debugging the runtime itself.
+.SH RUNTIME OPTIONS
+The following options are available:
.TP
-.I "--help", "-h"
-Displays usage instructions.
-.I "--share-code"
-This mode makes the LoaderOptimization for Application Domains default
-to sharing code. This results in slower code, but enables code
-sharing across application domains. The default is to maximize for
-speed, but disallow JITed code sharing across domains. See
-System.LoaderOptimization for more information
+.I "--aot"
+This option is used to precompile the CIL code in the specified
+assembly to native code. The generated code is stored in a file with
+the extension .so. This file will be automatically picked up by the
+runtime when the assembly is executed.
+.Sp
+Ahead-of-Time compilation is most useful if you use it in combination
+with the -O=all,-shared flag which enables all of the optimizations in
+the code generator to be performed. Some of those optimizations are
+not practical for Just-in-Time compilation since they might be very
+time consuming.
+.Sp
+Unlike the .NET Framework, Ahead-of-Time compilation will not generate
+domain independent code: it generates the same code that the
+Just-in-Time compiler would produce. Since most applications use a
+single domain, this is fine. If you want to optimize the generated
+code for use in multi-domain applications, consider using the
+-O=shared flag.
+.Sp
+This pre-compiles the methods, but the original assembly is still
+required to execute as this one contains the metadata and exception
+information which is not availble on the generated file. When
+precompiling code, you might want to compile with all optimizations
+(-O=all). Pre-compiled code is position independent code.
+.Sp
+Pre compilation is just a mechanism to reduce startup time, and avoid
+just-in-time compilation costs. The original assembly must still be
+present, as the metadata is contained there.
.TP
.I "--config filename"
Load the specified configuration file instead of the default one(s).
The default files are /etc/mono/config and ~/.mono/config or the file
-specified in the MONO_CONFIG environment variable, if set.
+specified in the MONO_CONFIG environment variable, if set. See the
+mono-config(5) man page for details on the format of this file.
.TP
-.I "--noinline"
-Disables the code inliner.
-.SH DEBUGGING OPTIONS
-The following options are used to debug, or perfomance test the JIT
-compiler:
+.I "--help", "-h"
+Displays usage instructions.
.TP
-.I "--trace-calls"
-Shows method names as they are invoked.
+.I "--optimize=MODE", "-O=mode"
+MODE is a comma separated list of optimizations. They also allow
+optimizations to be turned off by prefixing the optimization name with
+a minus sign.
+.Sp
+The following optimizations are implemented:
+.nf
+ all Turn on all optimizations
+ peephole Peephole postpass
+ branch Branch optimizations
+ inline Inline method calls
+ cfold Constant folding
+ consprop Constant propagation
+ copyprop Copy propagation
+ deadce Dead code elimination
+ linears Linear scan global reg allocation
+ cmov Conditional moves
+ shared Emit per-domain code
+ sched Instruction scheduling
+ intrins Intrinsic method implementations
+ tailc Tail recursion and tail calls
+ loop Loop related optimizations
+ leaf Leaf procedures optimizations
+ profile Use profiling information
+.fi
+.Sp
+For example, to enable all the optimization but dead code
+elimination and inlining, you can use:
+.nf
+ -O=all,-deadce,-inline
+.fi
.TP
-.I "--dump-asm"
-Displays the generated code as methods are invoked.
+.I "-V", "--version"
+Prints JIT version information.
+
+
+.SH DEVELOPMENT OPTIONS
+The following options are used to help when developing a JITed application.
.TP
-.I "--dump-forest"
-Displays the basic blocks and the forest of trees that is
-created from a stream of CIL opcodes.
+.I "--debug"
+Turns on the debugging mode in the runtime. If an assembly was
+compiled with debugging information, it will produce line number
+information for stack traces.
+.TP
+.I "--profile[=profiler[:profiler_args]]"
+Instructs the runtime to collect profiling information about execution
+times and memory allocation, and dump it at the end of the execution.
+If a profiler is not specified, the default profiler is used. profiler_args
+is a profiler-specific string of options for the profiler itself.
+.PP
+The default profiler accepts -time and -alloc to options to disable
+the time profiling or the memory allocation profilng.
+.SH JIT MAINTAINER OPTIONS
+The maintainer options are only used by those developing the runtime
+itself, and not typically of interest to runtime users or developers.
.TP
.I "--compile name"
-Compiles the method on the given class (namespace.name:methodname) or
-all classes in the given image (@imagename).
+This compiles a method (namespace.name:methodname), this is used for
+testing the compiler performance or to examine the output of the code
+generator.
.TP
-.I "--ncompile"
-Compiles the method a number of times. If no argument is specified,
-the method will be compiled a thousand times.
-.SH DEVELOPMENT OPTIONS
-The following options are used to debug a JITed application. They're
-only useful when running the JIT in a debugger:
+.I "--compileall"
+Compiles all the methods in an assembly. This is used to test the
+compiler performance or to examine the output of the code generator
+.TP
+.I "--graph=TYPE METHOD"
+This generates a postscript file with a graph with the details about
+the specified method (namespace.name:methodname). This requires `dot'
+and ghostview to be installed (it expects Ghostview to be called
+"gv").
+.PP
+The following graphs are available:
+.nf
+ cfg Control Flow Graph (CFG)
+ dtree Dominator Tree
+ code CFG showing code
+ ssa CFG showing code after SSA translation
+ optcode CFG showing code after IR optimizations
+.fi
+.Sp
+Some graphs will only be available if certain optimizations are turned
+on.
.TP
-.I "--debug=[format]"
-Writes out debug information in the given format or in the default format.
-See DEBUGGING FORMATS for details.
+.I "--ncompile"
+Instruct the runtime on the number of times that the method specified
+by --compile (or all the methods if --compileall is used) to be
+compiled. This is used for testing the code generator performance.
.TP
-.I "--debug-args args"
-Comma-separated list of additional arguments for the symbol writer.
-See DEBUGGING FORMATS for details.
+.I "-v", "--verbose"
+Increases the verbosity level, each time it is listed, increases the
+verbosity level to include more information (including, for example,
+a disassembly of the native code produced, code selector info etc.).
.TP
.I "--break method"
Inserts a breakpoint before the method whose name is `method'
-(namespace.class:methodname).
+(namespace.class:methodname). Use `Main' as method name to insert a
+breakpoint on the application's main method.
+.TP
+.I "--breakonex"
+Inserts a breakpoint on exceptions. This allows you to debug your
+application with a native debugger when an exception is thrown.
+.TP
+.I "--trace[=expression]"
+Shows method names as they are invoked. By default all methods are
+traced.
+.PP
+The trace can be customized to include or exclude methods, classes or
+assemblies. A trace expression is a comma separated list of targets,
+each target can be prefixed with a minus sign to turn off a particular
+target. The words `program' and `all' have special meaning.
+`program' refers to the main program being executed, and `all' means
+all the method calls.
+.PP
+Assemblies are specified by their name, for example, to trace all
+calls in the System assembly, use:
+.nf
+
+ mono --trace=System app.exe
+
+.fi
+Classes are specified with the T: prefix. For example, to trace all
+calls to the System.String class, use:
+.nf
+
+ mono --trace=T:System.String app.exe
+
+.fi
+And individual methods are referenced with the M: prefix, and the
+standar method notation:
+.nf
+
+ mono --trace=M:System.Console:WriteLine app.exe
+
+.fi
+As previously noted, various rules can be specified at once:
+.nf
+
+ mono --trace=T:System.String,T:System.Random app.exe
+
+.fi
+You can exclude pieces, the next example traces calls to
+System.String except for the System.String:Concat method.
+.nf
+
+ mono --trace=T:System.String,-M:System.String:Concat
+
+.fi
+Finally, namespaces can be specified using the N: prefix:
+.nf
+
+ mono --trace=N:System.Xml
+
+.fi
+.SH DEBUGGING
+.PP
+If you are interested in debugging P/Invoke problems with your
+application, you might want to use:
+.nf
+ $ MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono glue.exe
+.fi
+.SH SERIALIZATION
+Mono's XML serialization engine by default will use a reflection-based
+approach to serialize which might be slow for continous processing
+(web service applications). The serialization engine will determine
+when a class must use a hand-tuned serializer based on a few
+parameters and if needed it will produce a customized C# serializer
+for your types at runtime. This customized serializer then gets
+dynamically loaded into your application.
+.PP
+You can control this with the MONO_XMLSERIALIZER_THS environment
+variable.
+.PP
+The possible values are `no' to disable the use of a C# customized
+serializer, or an integer that is the minimum number of uses before
+the runtime will produce a custom serializer (0 will produce a
+custom serializer on the first access, 50 will produce a serializer on
+the 50th use).
+.SH ENVIRONMENT VARIABLES
.TP
-.I "--precompile name"
-Compiles the given class (namespace.name), method (namespace.name:methodname)
-or all classes in the given image (@imagename) before executing the main
-application.
+.I "GC_DONT_GC"
+Turns off the garbage collection in Mono. This should be only used
+for debugging purposes
.TP
-.I "--profile"
-Collect profiling information and dump it at the end of the process.
-.SH DEBUGGING FORMATS
-The following debugging formats are currently supported:
+.I "MONO_ASPNET_NODELETE"
+If set to any value, temporary source files generated by ASP.NET support
+classes will not be removed. They will be kept in the user's temporary
+directory.
.TP
-.I "stabs"
-Writes out stabs debug information.
+.I "MONO_CFG_DIR"
+If set, this variable overrides the default system configuration directory
+($PREFIX/etc). It's used to locate machine.config file.
.TP
-.I "dwarf"
-Writes out dwarf debug information.
+.I "MONO_CONFIG"
+If set, this variable overrides the default runtime configuration file
+($PREFIX/etc/mono/config). The --config command line options overrides the
+environment variable.
.TP
-.I "dwarf-plus"
-Uses an extended debugging information file which has been generated
-by MCS. This extended debugging information will allow you to debug
-C# source code rather than IL code. To use it, just run the JIT in
-your debugger and call "mono_debug_make_symbols" each time the program
-stops.
-.PP
-The "stabs" and "dwarf" formats support the following options:
+.I "MONO_DEBUG"
+If set, enables some features of the runtime useful for debugging.
+It makes the runtime display the stack traces for all the threads
+running and exit when mono is interrupted (Ctrl-C) and print some
+additional messages on error conditions. It may not exit cleanly. Use at
+your own risk.
.TP
-.I "filename=FILENAME"
-Write debugging information into FILENAME. This file must be run through
-the assembler to create an object file.
+.I "MONO_DISABLE_AIO"
+If set, tells mono NOT to attempt using native asynchronous I/O services. In
+that case, the threadpool is used for asynchronous I/O on files and sockets.
.TP
-.I "objfile=FILENAME"
-When automatically assembling the symbol file, write the resulting object
-file into FILENAME.
+.I "MONO_DISABLE_SHM"
+If this variable is set, it disables the shared memory part of the
+Windows I/O Emulation layer, and handles (files, events, mutexes,
+pipes) will not be shared across processes. Process creation is also
+disabled. This option is only available on Unix.
.TP
-.I "dont_assemble"
-Normally, the symbol file is automatically assembled to an object file
-when you call "mono_debug_make_symbols". Use this option to disable this
-behaviour.
+.I "MONO_EGD_SOCKET"
+For platforms that do not otherwise have a way of obtaining random bytes
+this can be set to the name of a file system socket on which an egd or
+prngd daemon is listening.
.TP
-.I "install_il_files"
-Put the generated *.il files in the same directory than the assembly they
-came from. The default is to put them into the current working directory.
+.I "MONO_EXTERNAL_ENCODINGS"
+If set, contains a colon-separated list of text encodings to try when
+turning externally-generated text (e.g. command-line arguments or
+filenames) into Unicode. The encoding names come from the list
+provided by iconv, and the special case "default_locale" which refers
+to the current locale's default encoding.
+.IP
+When reading externally-generated text strings UTF-8 is tried first,
+and then this list is tried in order with the first successful
+conversion ending the search. When writing external text (e.g. new
+filenames or arguments to new processes) the first item in this list
+is used, or UTF-8 if the environment variable is not set.
.TP
-.I "dont_update_il_files"
-Normally, the *.il files are recreated if their assemblies have changed
-when you call "mono_debug_make_symbols". Use this option to disable this
-behaviour.
+.I "MONO_GAC_PREFIX"
+Provides a prefix the runtime uses to look for Global Assembly Caches.
+Directories are separated by the platform path separator (colons on
+unix). MONO_GAC_PREFIX should point to the top directory of a prefixed
+install. Or to the directory provided in the gacutil /gacdir command. Example:
+.B /home/username/.mono:/usr/local/mono/
.TP
-.I "dont_create_il_files"
-Update the *.il files if their assemblies have changed, but only if the
-file already exists.
+.I "MONO_LOG_LEVEL"
+If set, the logging level is changed to the set value. Possible values
+are "error", "critical", "warning", "message", "info", "debug". The
+default value is "error". Messages with a logging level greater then
+or equal to the log level will be printed to stdout/stderr.
.PP
-The "dwarf-plus" format supports the following options:
+Use info to track the dynamic loading of assemblies.
.TP
-.I "dont_fallback"
-Don't fallback to normal dwarf2 if the symbol file cannot be found.
-.PP
+.I "MONO_LOG_MASK"
+If set, the log mask is changed to the set value. Possible values are
+"asm" (assembly loader), "type", "dll" (native library loader), "gc"
+(garbage collector), "cfg" (config file loader), "aot" (precompiler), "all".
+The default value is "all". Changing the mask value allows you to display only
+messages for a certain component. You can use multiple masks by comma
+separating them. For example to see config file messages and assembly loader
+messages set you mask to "asm,cfg".
+.TP
+.I "MONO_MANAGED_WATCHER"
+If set to any value, System.IO.FileSystemWatcher will use the default
+managed implementation (slow). If unset, mono will try to use FAM under
+Unix systems and native API calls on Windows, falling back to the
+managed implementation on error.
+.TP
+.I "MONO_THREADS_PER_CPU"
+Sets the maximum number of threads in the threadpool per CPU. The default is
+50 for non-windows systems and 25 for windows.
+.TP
+.I "MONO_TRACE"
+If set, enables the System.Diagnostics.DefaultTraceListener, which will
+print the output of the System.Diagnostics Trace and Debug classes.
+It can be set to a filename, and to Console.Out or Console.Error to display
+output to standard output or standard error, respectively.
+See the System.Diagnostics.DefaultTraceListener documentation for more
+information.
+.TP
+.I "MONO_SHARED_DIR"
+If set its the directory where the ".wapi" handle state is stored.
+This is the directory where the Windows I/O Emulation layer stores its
+shared state data (files, events, mutexes, pipes). By default Mono
+will store the ".wapi" directory in the users's home directory.
+.TP
+.I "MONO_PATH"
+Provides a search path to the runtime where to look for library files.
+Directories are separated by the platform path separator (colons on unix). Example:
+.B /home/username/lib:/usr/local/mono/lib
+.TP
+.I "MONO_XMLSERIALIZER_THS"
+Controls the threshold for the XmlSerializer to produce a custom
+serializer for a given class instead of using the Reflection-based
+interpreter. The possible values are `no' to disable the use of a
+custom serializer or a number to indicate when the XmlSerializer
+should start serializing. The default value is 50, which means that
+the a custom serializer will be produced on the 50th use.
.SH FILES
-Assemblies are lodaed from the installation lib directory. If you set
-`prefix' to /usr, the assemblies will be located in /usr/lib.
+On Unix assemblies are loaded from the installation lib directory. If you set
+`prefix' to /usr, the assemblies will be located in /usr/lib. On
+Windows, the assemblies are loaded from the directory where mono and
+mint live.
+.PP
+/etc/mono/config, ~/.mono/config
+.PP
+Mono runtime configuration file. See the mono-config(5) manual page
+for more information.
.SH MAILING LISTS
Visit http://mail.ximian.com/mailman/mono-list for details.
.SH WEB SITE
Visit: http://www.go-mono.com for details
.SH SEE ALSO
-.BR mint(1), monodis(1)
+.BR mcs(1), mint(1), monodis(1), mono-config(5).
+.PP
+For ASP.NET-related documentation, see the xsp(1) manual page
diff --git a/man/monop.1 b/man/monop.1
new file mode 100644
index 00000000000..89ab4d8072b
--- /dev/null
+++ b/man/monop.1
@@ -0,0 +1,17 @@
+.TH "monop" 1
+.SH NAME
+monop \- Mono Class Outline Viewer
+.SH SYNOPSIS
+.B monop
+[-r:assembly] class
+.SH OPTIONS
+.TP
+.I \-r:assembly
+Specifies the assembly to use for looking up the type
+.PP
+.SH DESCRIPTION
+Monop is a tool that allows you to view the outline of a class. You can see the
+signature of each member of the class.
+.PP
+The tool takes one option, the class to view. You must specify the full name of the
+class, including namespace.
diff --git a/man/oldmono.1 b/man/oldmono.1
new file mode 100644
index 00000000000..f640e6ad0ad
--- /dev/null
+++ b/man/oldmono.1
@@ -0,0 +1,175 @@
+.\"
+.\" mono manual page.
+.\" (C) Ximian, Inc.
+.\" Author:
+.\" Miguel de Icaza (miguel@gnu.org)
+.\"
+.TH Mono "Mono 1.0"
+.SH NAME
+mono \- Mono ECMA-CLI Just in Time compiler.
+.SH SYNOPSIS
+.PP
+.B mono
+[\-\-help] [\-d] [\-\-debug-asm] [\-\-debug-forest] [\-\-trace-calls]
+[\-\-compile name] [\-\-ncompile num] [\-\-noinline] [\-\-profile]
+[\-\-debug=[format]] [\-\-debug-args args] [\-\-break name] [\-\-precompile name]
+[\-\-config filename]
+program.exe [arguments...]
+.SH DESCRIPTION
+The \fImono\fP program is a Just in Time compiler for ECMA CLI byte
+codes. It translates dynamically a CIL stream into native code.
+.I program.exe
+and optionally passes
+the
+.I arguments
+to it.
+.SH OPTIONS
+The following options are supported:
+.TP
+.I "--help", "-h"
+Displays usage instructions.
+.TP
+.I "--share-code"
+This mode makes the LoaderOptimization for Application Domains default
+to sharing code. This results in slower code, but enables code
+sharing across application domains. The default is to maximize for
+speed, but disallow JITed code sharing across domains. See
+System.LoaderOptimization for more information
+.TP
+.I "--config filename"
+Load the specified configuration file instead of the default one(s).
+The default files are /etc/mono/config and ~/.mono/config or the file
+specified in the MONO_CONFIG environment variable, if set.
+.TP
+.I "--noinline"
+Disables the code inliner.
+.TP
+.SH DEBUGGING OPTIONS
+The following options are used to debug, or perfomance test the JIT
+compiler:
+.TP
+.I "--trace-calls"
+Shows method names as they are invoked.
+.TP
+.I "--dump-asm"
+Displays the generated code as methods are invoked.
+.TP
+.I "--dump-forest"
+Displays the basic blocks and the forest of trees that is
+created from a stream of CIL opcodes.
+.TP
+.I "--compile name"
+Compiles the method on the given class (namespace.name:methodname) or
+all classes in the given image (@imagename).
+.TP
+.I "--ncompile"
+Compiles the method a number of times. If no argument is specified,
+the method will be compiled a thousand times.
+.SH DEVELOPMENT OPTIONS
+The following options are used to debug a JITed application. They're
+only useful when running the JIT in a debugger:
+.TP
+.I "--debug"
+Writes out debug information in the given format or in the default format.
+See DEBUGGING FORMATS for details.
+.TP
+.I "--debug-args args"
+Comma-separated list of additional arguments for the symbol writer.
+See DEBUGGING FORMATS for details.
+.TP
+.I "--break method"
+Inserts a breakpoint before the method whose name is `method'
+(namespace.class:methodname). Use `Main' as method name to insert a breakpoint on the
+application's main method.
+.TP
+.I "--precompile name"
+Compiles the given class (namespace.name), method (namespace.name:methodname)
+or all classes in the given image (@imagename) before executing the main
+application.
+.TP
+.I "--profile"
+Collect profiling information and dump it at the end of the process.
+.SH DEBUGGING FORMATS
+The following debugging formats are currently supported:
+.TP
+.I "stabs"
+Writes out stabs debug information.
+.TP
+.I "dwarf"
+Writes out dwarf debug information.
+.TP
+.I "mono"
+Use a symbol file which has been created by MCS. It can be used to get
+source lines in stack traces.
+.PP
+The "stabs" and "dwarf" formats support the following options:
+.TP
+.I "filename=FILENAME"
+Write debugging information into FILENAME. This file must be run through
+the assembler to create an object file.
+.TP
+.I "objfile=FILENAME"
+When automatically assembling the symbol file, write the resulting object
+file into FILENAME.
+.TP
+.I "dont_assemble"
+Normally, the symbol file is automatically assembled to an object file
+when you call "mono_debug_make_symbols". Use this option to disable this
+behaviour.
+.TP
+.I "install_il_files"
+Put the generated *.il files in the same directory than the assembly they
+came from. The default is to put them into the current working directory.
+.TP
+.I "dont_update_il_files"
+Normally, the *.il files are recreated if their assemblies have changed
+when you call "mono_debug_make_symbols". Use this option to disable this
+behaviour.
+.TP
+.I "dont_create_il_files"
+Update the *.il files if their assemblies have changed, but only if the
+file already exists.
+.PP
+.SH ENVIRONMENT VARIABLES
+.TP
+.I "MONO_PATH"
+Provides a search path to mono and mint where to look for library files.
+Directories are separated by the platform path separator (colons on unix). Example:
+.B /home/username/lib:/usr/local/mono/lib
+.PP
+.TP
+.I "MONO_DISABLE_SHM"
+If this variable is set, it disables the Windows I/O Emulation layer,
+and handles (files, events, mutexes, pipes) will not be shared across
+processes. This option is only available on Unix.
+.TP
+.I "MONO_CFG_DIR"
+If set, this variable overrides the default system configuration directory
+($PREFIX/etc). It's used to locate machine.config file.
+.TP
+.I "GC_DONT_GC"
+Turns off the garbage collection in Mono. This should be only used
+for debugging purposes
+.TP
+.I "MONO_CONFIG"
+If set, this variable overrides the default runtime configuration file
+($PREFIX/etc/mono/config). The --config command line options overrides the
+environment variable.
+.SH FILES
+On Unix assemblies are loaded from the installation lib directory. If you set
+`prefix' to /usr, the assemblies will be located in /usr/lib. On
+Windows, the assemblies are loaded from the directory where mono and
+mint live.
+.PP
+/etc/mono/config, ~/.mono/config
+.IP
+Mono runtime configuration file. See the mono-config(5) manual page
+for more information.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR mcs(1), mint(1), monodis(1), mono-config(5)
+
+
diff --git a/man/secutil.1 b/man/secutil.1
new file mode 100644
index 00000000000..9469721505d
--- /dev/null
+++ b/man/secutil.1
@@ -0,0 +1,45 @@
+.\"
+.\" secutil manual page.
+.\" Copyright 2002, 2003 Motus Technologies
+.\" Author:
+.\" Sebastien Pouliot (spouliot@motus.com)
+.\"
+.TH Mono "secutil"
+.SH NAME
+secutil \- Extract X.509 certificates and strongnames from assemblies.
+.SH SYNOPSIS
+.PP
+.B secutil [options] filename
+.SH DESCRIPTION
+Extract X.509 certificates and strongnames from assemblies in a
+format that can be easily re-used in source code (C# or VB.NET syntax).
+.SH OPTIONS
+.TP
+.I "-s assembly", "-strongname assembly"
+Display strongname informations about the assembly.
+.TP
+.I "-x assembly", "-x509certificate assembly"
+Display the X509 Authenticode certificate for the assembly.
+.TP
+.I "-a", "-array"
+Display data in a decimal array (default).
+.TP
+.I "-v", "-vbmode"
+Display data in a VisualBasic friendly format.
+.TP
+.I "-c", "-cmode"
+Display data in a C/C++/C# friendly format (default).
+.TP
+.I "-help", "-h", "-?"
+Display help about this tool.
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2002, 2003 Motus Technologies.
+Released under BSD license.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR sn(1), signcode(1)
diff --git a/man/setreg.1 b/man/setreg.1
new file mode 100755
index 00000000000..45f2af10415
--- /dev/null
+++ b/man/setreg.1
@@ -0,0 +1,38 @@
+.\"
+.\" setreg manual page.
+.\" Copyright 2004 Novell
+.\" Author:
+.\" Sebastien Pouliot <sebastien@ximian.com>
+.\"
+.TH Mono "setreg"
+.SH NAME
+setreg \- Change settings for public key cryptography
+.SH SYNOPSIS
+.PP
+.B setreg [options] [feature] [true|false]
+.SH DESCRIPTION
+Allow to configure some optional settings for public key cryptography
+parameters used in Mono.
+.SH OPTIONS
+.TP
+.I "-q"
+Quiet mode. Limited display on console.
+.TP
+.I "-help", "-h", "-?", "/?"
+Display help about this tool.
+.SH FEATURES
+.TP
+.I "1"
+Trust the test root certificates (both Microsoft and Mono). Depending on the
+value this will add (TRUE) or remove (FALSE) the two self-signed certificates
+from the current user Trust store.
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2004 Novell.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR chktrust(1), certmgr(1), makecert(1)
diff --git a/man/signcode.1 b/man/signcode.1
new file mode 100755
index 00000000000..1226d55c1b9
--- /dev/null
+++ b/man/signcode.1
@@ -0,0 +1,93 @@
+.\"
+.\" signcode manual page.
+.\" Copyright 2003 Motus Technologies
+.\" Copyright 2004 Novell
+.\" Author:
+.\" Sebastien Pouliot (sebastien@ximian.com)
+.\"
+.TH Mono "signcode"
+.SH NAME
+signcode \- Digitally sign an PE executable using an X.509 certificate.
+.SH SYNOPSIS
+.PP
+.B signcode [options] filename
+.SH DESCRIPTION
+Digitally sign an PE executable (CLR assembly, Win32 EXE or DLL) using an
+X.509 certificate and it's associated private key. The signature is compatible
+with Authenticode(r) and can be validated with chktrust (either on Windows or
+on any platform supported by Mono).
+.SH OPTIONS
+.TP
+.I "-spc spcfile"
+The Software Publisher File (spc) that contains the X.509 certificate chain
+used to digitally sign the PE executable.
+.TP
+.I "-v pvkfile"
+The Private Key File (pvk) that contains the private key used to digitally
+sign the PE executable. This private key must match the public key inside the
+publisher X.509 certificate.
+.TP
+.I "-a md5 | sha1"
+The hash algorithm used in the digital signature of the PE executable. The
+default algorithm is MD5.
+.TP
+.I "-$ individual | commercial"
+Add information about the publisher, i.e. if the signature is generated by an
+individual or a commercial entity.
+.TP
+.I "-n description"
+Add a textual description of the signed file.
+.TP
+.I "-i url"
+Add a URL associated to the publisher or the signed file.
+.TP
+.I "-t url"
+URL to a timestamp service to countersign the PE executable. Countersignature
+is required if you want the PE executable signature to be valid after the
+publisher certificate expires. The countersignature proves that the publisher
+had a valid (non-expired) certificate when the PE executable was signed.
+.TP
+.I "-tr #"
+Number of retries to get a timestamp for the countersignature.
+.TP
+.I "-tw #"
+Delay (in seconds) between the retries to get a timestamp for the countersignature.
+.TP
+.I "-k name"
+CryptoAPI key container name (when not using -v).
+.TP
+.I "-p name"
+CryptoAPI provider name (when not using -v).
+.TP
+.I "-y #"
+CryptoAPI provider type (when not using -v or -p).
+.TP
+.I "-ky signature | exchange | #"
+CryptoAPI key type (when not using -v).
+.TP
+.I "-r localMachine | currentUser"
+CryptoAPI key location (when not using -v).
+.TP
+.I "-help", "-h", "-?", "/?"
+Display help about this tool.
+.SH OTHER CODE SIGNING TECHNOLOGIES
+Assemblies are PE files that can also be strongnamed using the sn.exe tool. The
+order of code signature is important if a file requires both an Authenticode
+and a strongname signature. Strongname must be applied before the Authenticode
+signature. Applying a strongname after the Authenticode signature, like
+re-signing an assembly (e.g. delay-sign), will invalidate the Authenticode
+signature.
+.SH KNOWN RESTRICTIONS
+signcode cannot generate Authenticode signatures for CAB files.
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2003 Motus Technologies.
+Copyright (C) 2004 Novell.
+Released under BSD license.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR chktrust(1), makecert(1), cert2spc(1)
diff --git a/man/sn.1 b/man/sn.1
new file mode 100755
index 00000000000..3d777e27d09
--- /dev/null
+++ b/man/sn.1
@@ -0,0 +1,155 @@
+.\"
+.\" sn manual page.
+.\" Copyright 2003 Motus Technologies
+.\" Copyright 2004 Novell
+.\" Author:
+.\" Sebastien Pouliot <sebastien@ximian.com>
+.\"
+.TH Mono "sn"
+.SH NAME
+sn \- Digitally sign/verify/compare strongname on CLR assemblies.
+.SH SYNOPSIS
+.PP
+.B sn [-q | -quiet] [options] [parameters]
+.SH DESCRIPTION
+Digitally sign, verify or compare, CLR assemblies using strongnames.
+.SH CONFIGURATION OPTIONS
+Configuration options are stored in the machine.config configuration file
+under /configuration/strongNames.
+.TP
+.I "-c provider"
+Change the default CSP (Crypto Service Provider). Currently not supported
+in Mono.
+.TP
+.I "-m [y|n]"
+Use a machine [y] key container or a user [n] key container. Currently not
+supported in Mono.
+.TP
+.I "-Vl"
+List the verification options. The list is kept under /configuration/
+strongNames/verificationSettings in machine.config.
+.TP
+.I "-Vr assembly [userlist]"
+Exempt the specified assembly from verification for the specified user list.
+Currently not supported by sn, you must edit machine.config manually if you
+require this.
+.TP
+.I "-Vu assembly"
+Remove the exemption entry for the specified assembly. Currently not
+supported by sn, you must edit machine.config manually if you require this.
+.TP
+.I "-Vx"
+Remove all exemptions entries. Currently not supported by sn, you must edit
+machine.config manually if you require this.
+.SH CSP RELATED OPTIONS
+.TP
+.I "-d container"
+Delete the keypair present in the specified key container.
+.TP
+.I "-i keypair.snk container"
+Import the specified strongname file into the specified container.
+.TP
+.I "-pc container publickey"
+Export the public key from the specified CSP container to the specified file.
+.SH CONVERTION OPTIONS
+.TP
+.I "-e assembly output.pub"
+Export the assembly public key to the specified output file.
+.TP
+.I "-p keypair.snk output.pub"
+Export the public key from the specified strongname key file (SNK) to the
+specified output file.
+.TP
+.I "-o input output.txt"
+Convert the input file to a CSV file (using decimal).
+.TP
+.I "-oh input output.txt"
+Convert the input file to a CSV file (using hexadecimal).
+.SH STRONGNAME SIGNING OPTIONS
+.TP
+.I "-D assembly1 assembly2"
+Compare if assembly1 and assembly are the same exception for their signature.
+This is done by comparing the hash of the metadata of both assembly.
+.TP
+.I "-k keypair.snk"
+Create a new strongname keypair (a 1024 bits RSA keypair) in the specified
+file.
+.TP
+.I "-R assembly keypair.snk"
+Resign the specified assembly using the specified strongname keypair file
+(SNK). You can only sign an assembly with the private key (SNK) that match
+the public key inside the assembly (unless it's public key token has been
+remapped in machine.config).
+.TP
+.I "-Rc assembly container"
+Resign the specified assembly using the specified strongname container.
+.TP
+.I "-t file"
+Show the public key from the specified file.
+.TP
+.I "-tp file"
+Show the public key and the public key token from the specified file.
+.TP
+.I "-T assembly"
+Show the public key from the specified assembly.
+.TP
+.I "-Tp assembly"
+Show the public key and the public key token from the specified assembly.
+.TP
+.I "-v assembly"
+Verify the specified assembly signature.
+.TP
+.I "-vf assembly"
+Verify the specified assembly signature (even if disabled).
+.SH HELP OPTIONS
+.TP
+.I "-h", "-?"
+Display basic help about this tool.
+.TP
+.I "-h config", "-? config"
+Display configuration related help about this tool.
+.TP
+.I "-h csp", "-? csp"
+Display Cryptographic Service Provider related help about this tool.
+.TP
+.I "-h convert", "-? convert"
+Display convertion related help about this tool.
+.TP
+.I "-h sn", "-? sn"
+Display strongname related help about this tool.
+.SH CONFIGURATION FILE
+.TP
+Strongnames configuration is kept in "machine.config" file. Currently two
+features can be configured.
+.TP
+.I "/configuration/strongNames/pubTokenMapping"
+This mechanism let Mono remap a public key token, like the ECMA token, to
+another public key for verification. This is useful in two scenarios. First
+assemblies signed with the "ECMA key" needs to be verified by the "runtime"
+key (as the ECMA key isn't a public key). Second, many assemblies are signed
+with private keys that Mono can't use (e.g. System.Security.dll assembly).
+A new key cannot be used because it should change thr strongname (a new key
+pair would have a new public key which would produce a new token). Public
+key token remapping is the solution for both problems. Each token must be
+configured in a "map" entry similar to this one: <map Token="b77a5c561934e089"
+PublicKey="00..." />
+.TP
+.I "/configuration/strongNames/verificationSettings"
+It is often useful during development to use delay signed assemblies.
+Normally* the runtime wouldn't allow delay-signed assemblies to be loaded.
+This feature allows some delay-signed assemblies (based on their public key
+token, optionally assembly name and user name) to be used like they were
+fully signed assemblies. [*] Note that Mono 1.0 "runtime" doesn't validate
+strongname signatures so this option shouldn't be required in most scenarios.
+.SH AUTHOR
+Written by Sebastien Pouliot
+.SH COPYRIGHT
+Copyright (C) 2003 Motus Technologies.
+Copyright (C) 2004 Novell.
+Released under BSD license.
+.SH MAILING LISTS
+Visit http://mail.ximian.com/mailman/mono-list for details.
+.SH WEB SITE
+Visit: http://www.go-mono.com for details
+.SH SEE ALSO
+.BR secutil(1)
diff --git a/man/soapsuds.1 b/man/soapsuds.1
new file mode 100644
index 00000000000..3159cd2256c
--- /dev/null
+++ b/man/soapsuds.1
@@ -0,0 +1,126 @@
+.\"
+.\" soapsuds manual page.
+.\" (C) 2003 Novell, Inc.
+.\" Author:
+.\" Lluis Sanchez Gual (lluis@ximian.com)
+.\"
+.TH soapsuds 1
+.SH NAME
+soapsuds \- Mono's Remoting Proxy Generator
+.SH SYNOPSIS
+.PP
+.B soapsuds
+[options] [inputs] [outputs]
+.SH DESCRIPTION
+.I soapsuds
+is a tool for generating WSDL documents and client proxies for remoting services.
+A WSDL document describes the methods that a service provides together with XML schemas
+of all referenced data structures. A client proxy is a class which offers the same methods
+as the service it represents, but provides no implementation, it just forwards calls to the
+remote service.
+.PP
+Generated client proxies are not strictly necessary, since the runtime can
+automatically generate proxies from the original service types. However, it implies the need
+of distributing the service class to all clients. In some scenarios a better approach is
+to use soapsuds to generate a proxy class which has the same interface as the service,
+but without any implementation.
+.PP
+.I soapsuds
+can generate a WSDL document from a set of types specified with the option
+.I -types
+or can extract the types from an assembly specified with
+.I -inputassemblyfile.
+In this last case, soapsuds will include schemas for all serializable classes in
+the WSDL document.
+.PP
+Taking as input a WSDL document (or anything from which such document can be generated)
+the tool can generate source code for the client proxy (using the
+.I -gc
+option) or it can directly generate an assembly that implements the proxy (with the
+.I -outputassemblyfile
+option). soapsuds will also generate fake serializable classes for all types defined
+in the schema. However, beware that those classes will lack the semantics of the
+original classes, since only data structure is generated.
+.PP
+.SH INPUT SOURCES
+The following sources are available (only one can be specified):
+.TP
+.I "-urltoschema:url" "-url:url"
+Url from which to retrieve the WSDL document.
+.TP
+.I "-types:type1,assembly[,serviceEndPoint][;type2,assembly[,serviceEndPoint]]..."
+Specifies types for which to generate a schema or proxy. If no service endpoint is
+provided, the one provided with the
+.I -serviceendpoint
+option is used.
+.TP
+.I "-inputassemblyfile:file", "-ia:file"
+Assembly that contains the types to export.
+.TP
+.I "-inputschemafile:schena", "-is:schema"
+Schema from which to generate proxy classes.
+.SH INPUT OPTIONS
+The following options are available:
+.TP
+.I "-inputdirectory:directory", "-id:directory"
+Directory where DLLs are located.
+.TP
+.I "-serviceendpoint:url", "-se:url"
+Url of the service to be placed in the WSDL document.
+.SH OUTPUTS
+The following output options are available (more than one can be specified):
+.TP
+.I "-outputassemblyfile:file", "-oa:file"
+Generates the proxy code and compiles it into an assembly with the provided name.
+.TP
+.I "-outputschemafile:file", "-os:file"
+Generates a WSDL document that represents the provided types.
+.TP
+.I "-generatecode", "-gc"
+Generates proxy source code for the provided WSDL document or types.
+.SH OUTPUT OPTIONS
+The following options are available:
+.TP
+.I "-outputdirectory:directory", "-od:directory"
+Directory where generated files will be placed.
+.TP
+.I "-proxynamespace:namespace", "-pn:namespace"
+Namespace of the generated proxy.
+.TP
+.I "-nowrappedproxy", "-nowp"
+Do not generate a wrapped proxy.
+.TP
+.I "-wrappedproxy", "-wp"
+Generate a wrapped proxy.
+.TP
+.I "-strongnamefile:file", "-sn:file"
+Strong name file.
+.SH GENERAL OPTIONS
+The following options are available:
+.TP
+.I "-nologo"
+Supress the startup logo.
+.TP
+.I "-u:username", "-user:username"
+The user name to use when connecting to the server.
+.TP
+.I "-p:password", "-password:password"
+The password to use when connecting to the server.
+.TP
+.I "-d:domain", "-domain:domain"
+The domain to use when connecting to the server.
+.TP
+.I "-httpproxyname:name", "-hpn:name"
+Name of the http proxy.
+.TP
+.I "-httpproxyport:port", "-hpp:port"
+Port of the http proxy.
+.PP
+.SH AUTHORS
+Lluis Sanchez Gual (lluis@ximian.com)
+.PP
+.SH LICENSE
+wsdl is released under the terms of the GNU GPL.
+.PP
+.SH SEE ALSO
+wsdl(1), disco(1), mono(1), mcs(1)
diff --git a/man/sqlsharp.1 b/man/sqlsharp.1
new file mode 100755
index 00000000000..48c85c5f336
--- /dev/null
+++ b/man/sqlsharp.1
@@ -0,0 +1,462 @@
+.TH sqlsharp 1 "21 October 2004"
+.SH NAME
+sqlsharp \- Mono SQL Query command-line tool
+.SH SYNOPSIS
+.B sqlsharp
+[\-f filename] [\-o filename] [\-s]
+.SH DESCRIPTION
+sqlsharp is a Mono SQL tool used for entering SQL queries
+to a database using Mono data providers.
+.PP
+.SH OPTIONS
+The following options are supported:
+.TP
+.I "-f filename"
+Output file to load SQL commands from.
+.TP
+.I "-o filename"
+Output file to send results.
+.TP
+.I "-s"
+Silent mode.
+.PP
+.SH HOW TO USE
+The SQL tool accepts commands via its command line interface. Commands
+begin with a backslash followed by the command name.
+.PP
+Example:
+.nf
+ \\open
+
+.fi
+.PP
+Basically, there are five commands a user should know:
+ \\provider, \\connectionstring, \\open, \\quit, and \\help
+.PP
+To connect to a database, you need to do the following:
+.PP
+1. set your data provider via \\provider
+.PP
+.nf
+ Example:
+ SQL# \\provider mysql
+
+.fi
+.PP
+2. set your connection string via \\connectionstring
+.PP
+.nf
+ Example:
+ SQL# \\connectionstring Database=test
+
+.fi
+.PP
+3. open a connection to the database via \\open
+.PP
+.nf
+ Example:
+ SQL# \\open
+
+.fi
+.PP
+.SH CONNECTION AND PROVIDER COMMANDS
+These commands are used to setup the provider,
+connection string, and open/close the database connnection
+.TP
+.I "ConnectionString"
+Sets the Connection String
+.nf
+
+Example:
+ SQL# \\ConnectionString Database=testdb
+
+For more examples, see section CONNECTION STRING EXAMPLES.
+
+.fi
+.TP
+.I "Provider"
+Sets the Provider of the Data Source. For list of Providers, see section PROVIDERS.
+.nf
+
+Example: to set the provider for MySQL:
+ SQL# \\provider mysql
+
+Note: if you need to load an external provider in SQL#,
+ see the SQL# command \\loadextprovider
+
+.fi
+.TP
+.I "LoadExtProvider"
+ASSEMBLY CLASS to load an external provider. Use the complete name
+of its assembly and its Connection class.
+.nf
+
+Example: to load the MySQL provider Mono.Data.MySql
+ SQL# \\loadextprovider Mono.Data.MySql Mono.Data.MySql.MySqlConnection
+
+.fi
+.TP
+.I "Open"
+Opens a connection to the database
+.nf
+
+Example:
+ SQL# \\open
+
+.fi
+.TP
+.I "Close"
+Closes the connection to the database
+.nf
+
+Example:
+ SQL# \\close
+
+.fi
+.TP
+.I "Default"
+show default variables, such as, Provider and ConnectionString.
+.nf
+
+Example:
+ SQL# \\defaults
+
+.fi
+.TP
+.I "Q"
+Quit
+.nf
+
+Example:
+ SQL# \\q
+
+.fi
+.SH SQL EXECUTION COMMANDS
+Commands to execute SQL statements
+.PP
+.TR
+.I "e"
+execute SQL query (SELECT)
+.nf
+
+Example: to execute a query
+
+ SQL# SELECT * FROM EMPLOYEE
+ SQL# \\e
+
+Note: to get \\e to automatically work after entering a query, put a
+ semicolon ; at the end of the query.
+
+Example: to enter and exectue query at the same time
+
+ SQL# SELECT * FROM EMPLOYEE;
+
+.fi
+.TP
+.I "exenonquery"
+execute a SQL non query (not a SELECT)
+.nf
+
+Example: to insert a row into a table:
+
+ SQL# INSERT INTO SOMETABLE (COL1, COL2) VALUES('ABC','DEF')
+ SQL# \\exenonquery
+
+Note: this can be used for those providers that are new and do not have
+ the ability to execute queries yet.
+
+.fi
+.TP
+.I "exescalar"
+execute SQL to get a single row and single column.
+.nf
+
+Example: to execute a Maxium aggregate
+ SQL# SELECT MAX(grade) FROM class
+ SQL# \\exescalar
+
+.fi
+.TP
+.I "exexml"
+FILENAME to execute SQL and save output to XML file
+.nf
+
+Example:
+ SQL# SELECT fname, lname, hire_date FROM employee
+ SQL# \\exexml employee.xml
+
+Note: this depends on DataAdapter, DataTable, and DataSet
+ to be working properly
+
+.fi
+.TP
+.SH FILE COMMANDS
+Commands for importing commands from file to SQL# and vice versa
+.TP
+.I "f"
+FILENAME to read a batch of SQL# commands from file
+.nf
+
+Example:
+ SQL# \\f batch.sql#
+
+Note: the SQL# commands are interpreted as they are read. If there is
+ any SQL statements, the are executed.
+
+.fi
+.TP
+.I "o"
+FILENAME to write result of commands executed to file.
+.nf
+
+Example:
+ SQL# \\o result.txt
+
+.fi
+.TP
+.I "load"
+FILENAME to load from file SQL commands into SQL buffer.
+.nf
+
+Example:
+ SQL# \\load commands.sql
+
+.fi
+.TP
+.I "save"
+FILENAME to save SQL commands from SQL buffer to file.
+
+.nf
+Example:
+ SQL# \\save commands.sql
+
+.fi
+.SH GENERAL PURPOSE COMMANDS
+General commands to use.
+.TP
+.I "h"
+show help (all commands).
+.nf
+
+Example:
+ SQL# \\h
+
+.fi
+.TP
+.I "s"
+TRUE, FALSE to silent messages.
+.nf
+
+Example 1:
+ SQL# \\s true
+
+Example 2:
+ SQL# \\s false
+
+.fi
+.TP
+.I "r"
+reset or clear the query buffer.
+.nf
+
+Example:
+ SQL# \\r
+
+.fi
+.TP
+.I "print"
+show what's in the SQL buffer now.
+.nf
+
+Example:
+ SQL# \\print
+
+.fi
+SH VARIABLES WHICH CAN BE USED AS PARAMETERS
+Commands to set variables which can be used as Parameters in an SQL statement. If the
+SQL contains any parameters, the parameter does not have a variable set, the
+user will be prompted for the value for each missing parameter.
+.TP
+.I "set"
+NAME VALUE to set an internal variable.
+.nf
+
+Example:
+ SQL# \\set sFirstName John
+
+.fi
+.TP
+.I "unset"
+NAME to remove an internal variable.
+.nf
+
+Example:
+ SQL# \\unset sFirstName
+
+.fi
+.TP
+.I "variable"
+NAME to display the value of an internal variable.
+.nf
+
+Example:
+ SQL# \\variable sFirstName
+
+.fi
+.SH PROVIDER SUPPORT OPTIONS
+Enable or Disble support for a particular provider option
+.TP
+.I "UseParameters"
+TRUE,FALSE to use parameters when executing SQL which
+use the variables that were set.
+.PP
+If this option is true, the SQL
+contains parameters, and for each parameter
+which does not have a SQL# variable set, the
+user will be prompted to enter the value
+For that parameter.
+.nf
+
+Example:
+ SQL# \\useparameter true
+
+.fi
+.PP
+Default: false
+.TP
+.I "UseSimpleReader"
+TRUE,FALSE to use simple reader when displaying results.
+.nf
+
+Example:
+ SQL# \\usesimplereader true
+
+.fi
+.PP
+Default: false. Mostly, this is dependent on the provider. If the provider
+does not have enough of IDataReader implemented to have
+the normal reader working, then the simple reader can be used.
+Providers like SqlClient, MySQL, and PostgreSQL have this
+ption defaulting to true.
+.PP
+.SH PROVIDERS
+.nf
+
+PROVIDER NAME NAMESPACE ASSEMBLY
+
+Oracle Oracle 8i System.Data.OracleClient System.Data.OracleClient
+PostgreSql NetPostgreSQL Npgsql Npgsql
+MySQL ByteFX MySQL ByteFX.Data.MySqlClient ByteFX.Data
+SqlClient MS SQL 7/2000 System.Data.SqlClient System.Data
+Odbc ODBC System.Data.Odbc System.Data
+Sqlite SQL Lite Mono.Data.SqliteClient Mono.Data.SqliteClient
+Sybase Sybase Mono.Data.SybaseClient Mono.Data.SybaseClient
+OleDb OLE DB System.Data.OleDb System.Data
+Tds TDS Generic Mono.Data.TdsClient Mono.Data.TdsClient
+MSOdbc MS ODBC Microsoft.Data.Odbc Microsoft.Data.Odbc
+Firebird Firebird SQL FirebirdSql.Data.FirebirdSql FirebirdSql.Data.Firebird
+
+NOTES
+
+Npgsql maps to PostgreSql above.
+MySqlNet maps to MySql above.
+Odbc is treated as an external provider for .NET 1.1 and above.
+MSODBC is an external provider for compatibility with .NET 1.0
+Firebird is not included with Mono.
+
+.fi
+.SH CONNECTION STRING SAMPLES
+Example connection strings for various providers to be used via the
+command \\ConnectionString
+.nf
+
+Example of usage:
+ \\connectionstring Database=testdb
+
+
+Connection String examples:
+
+
+Microsoft SQL Server via System.Data.SqlClient
+or Mono.Data.TdsClient provider:
+
+ Server=DANPC;Database=pubs;User ID=saPassword=
+
+
+ODBC via System.Data.Odbc provider using
+a DSN named "MSSQLDSN" I set up
+in the Windows control panel's ODBC Data Sources
+which connects to Microsoft SQL Server 2000:
+
+ DSN=MSSQLDSN;UID=danmorg;PWD=freetds
+
+
+SQL Lite via Mono.Data.SqliteClient
+provider which connects to the
+database file SqliteTest.db; if not found,
+the file is created:
+
+ URI=file:SqliteTest.db
+
+
+OLE DB via System.Data.OleDb provider
+which connects to a PostgreSQL database:
+
+ Provider=PostgreSQL;Addr=127.0.0.1;Database=rodrigo
+
+
+Oracle via System.Data.OracleClient
+
+ Data Source=testdb;User ID=scott;Password=tiger
+
+
+Npgsql (.NET PostgreSQL) from
+http://gborg.postgresql.org/project/npgsql/projdisplay.php
+
+ Server=localhost;Database=test;User ID=postgres;Password=fun2db
+
+
+MySQLNet (ByteFX MySQL) from
+http://sourceforge.net/projects/mysqlnet/
+
+ Server=localhost;Database=test;User ID=mysql;Password=
+
+FirebirdSql via FirebirdSql.Data.Firebird (not included with Mono)
+
+ Database=C:\\FIREBIRD\\EXAMPLES\\EMPLOYEE.FDB;User=SYSDBA;Password=masterkey;Dialect=3;Server=localhost
+
+
+.fi
+.SH TRACING SUPPORT
+No support for tracing right now.
+.SH AUTHORS
+The Mono SQL Query Tool was written
+.nf
+by Daniel Morgan <danielmorgan@verizon.net>
+.fi
+.PP
+.SH LICENSE
+The Mono SQL Query Tool is released under the terms of the GNU GPL.
+Please read the accompanying `COPYING' file for details. Alternative
+licenses are available from Novell or Daniel Morgan.
+.SH BUGS
+To report bugs in the compiler, you can use `bug-buddy', or you can
+file bug reports in our bug tracking system:
+.nf
+http://bugzilla.ximian.com.
+.fi
+.PP
+.SH MAILING LISTS
+For details, visit:
+.nf
+http://mail.ximian.com/mailman/mono-list
+.fi
+.SH WEB SITE
+For details, visit:
+.nf
+http://www.mono-project.com
+.fi
+.PP
+.SH SEE ALSO
+mono(1), mint(1)
+
diff --git a/man/wsdl.1 b/man/wsdl.1
new file mode 100644
index 00000000000..151d730b2cc
--- /dev/null
+++ b/man/wsdl.1
@@ -0,0 +1,83 @@
+\"
+.\" wsdl manual page.
+.\" (C) 2003 Novell, Inc.
+.\" Author:
+.\" Lluis Sanchez Gual (lluis@ximian.com)
+.\"
+.TH wsdl 1
+.SH NAME
+wsdl \- Mono's Web Service Proxy Generator
+.SH SYNOPSIS
+.PP
+.B wsdl
+[options] [path | url]
+.SH DESCRIPTION
+.I wsdl
+is a tool for generating proxy classes that can be used to access to
+web services. The tool reads a WSDL document from the provided path
+or url, and downloads referenced schemas or other WSDL documents if
+needed.
+.PP
+This tool is used to target the 1.x API, for targetting the 2.x API,
+please use the wsdl2 tool.
+.PP
+.SH OPTIONS
+The following options are available:
+.TP
+.I "-appsettingurlkey:key" "-urlkey:key"
+Specifies that the url for the services should be read from the <appsettings> section
+of the configuration file, using the provided key.
+.TP
+.I "-appsettingbaseurl:url", "-baseurl:url"
+Specifies a base URL for the service. The final URL will be constructed by
+combining this value with the URL read from the
+.I -appsettingurlkey
+option, and the
+.I "-type:typename, assembly"
+Generate a proxy for a compiled web service class. The URL parameter
+can be used to providethe location of the service.
+.I location
+attribute specified in the WSDL document.
+.TP
+.I "-language:language", "-l"
+Language of the code to generate. It can be CS (default) or VB.
+.TP
+.I "-namespace:name", "-n:name"
+The namespace of the generated classes. If none is specified, the default
+namespace is used.
+.TP
+.I "-out:filename", "-o:filename"
+The target file for generated code.
+.TP
+.I "-protocol:protocol", "-p:protocol"
+The protocol for which to generate code. It can be Soap (default), HttpGet or
+HttpPost.
+.TP
+.I "-sample:METHOD"
+This will display XML request and reply of the sample invocations to
+that SOAP message. You can use the -protocol: option to render the
+message in different forms.
+.TP
+.I "-server"
+Generate a server skeleton instead of a client proxy.
+.TP
+.I "-nologo"
+Supress the startup logo.
+.TP
+.I "-u:username", "-user:username"
+The user name to use when connecting to the server.
+.TP
+.I "-p:password", "-password:password"
+The password to use when connecting to the server.
+.TP
+.I "-d:domain", "-domain:domain"
+The domain to use when connecting to the server.
+.PP
+.SH AUTHORS
+Lluis Sanchez Gual (lluis@ximian.com)
+.PP
+.SH LICENSE
+wsdl is released under the terms of the GNU GPL.
+.PP
+.SH SEE ALSO
+disco(1), soapsuds(1), mono(1), mcs(1), wsdl2(1)
diff --git a/man/wsdl2.1 b/man/wsdl2.1
new file mode 100644
index 00000000000..bb0218e4fe7
--- /dev/null
+++ b/man/wsdl2.1
@@ -0,0 +1,79 @@
+.\"
+.\" wsdl manual page.
+.\" (C) 2003 Novell, Inc.
+.\" Author:
+.\" Lluis Sanchez Gual (lluis@ximian.com)
+.\"
+.TH wsdl 1
+.SH NAME
+wsdl \- Mono's Web Service Proxy Generator
+.SH SYNOPSIS
+.PP
+.B wsdl
+[options] [path | url]
+.SH DESCRIPTION
+.I wsdl
+is a tool for generating proxy classes that can be used to access to web services.
+The tool reads a WSDL document from the provided path or url, and downloads
+referenced schemas or other WSDL documents if needed.
+.PP
+This tool is used to target the 2.x API, for targetting the 1.x API,
+please use the wsdl tool.
+.PP
+.SH OPTIONS
+The following options are available:
+.TP
+.I "-appsettingurlkey:key" "-urlkey:key"
+Specifies that the url for the services should be read from the <appsettings> section
+of the configuration file, using the provided key.
+.TP
+.I "-appsettingbaseurl:url", "-baseurl:url"
+Specifies a base URL for the service. The final URL will be constructed by
+combining this value with the URL read from the
+.I -appsettingurlkey
+option, and the
+.I location
+attribute specified in the WSDL document.
+.TP
+.I "-language:language", "-l"
+Language of the code to generate. It can be CS (default) or VB.
+.TP
+.I "-namespace:name", "-n:name"
+The namespace of the generated classes. If none is specified, the default
+namespace is used.
+.TP
+.I "-out:filename", "-o:filename"
+The target file for generated code.
+.TP
+.I "-protocol:protocol", "-p:protocol"
+The protocol for which to generate code. It can be Soap (default), HttpGet or
+HttpPost.
+.TP
+.I "-sample:METHOD"
+This will display XML request and reply of the sample invocations to
+that SOAP message. You can use the -protocol: option to render the
+message in different forms.
+.TP
+.I "-server"
+Generate a server skeleton instead of a client proxy.
+.TP
+.I "-nologo"
+Supress the startup logo.
+.TP
+.I "-u:username", "-user:username"
+The user name to use when connecting to the server.
+.TP
+.I "-p:password", "-password:password"
+The password to use when connecting to the server.
+.TP
+.I "-d:domain", "-domain:domain"
+The domain to use when connecting to the server.
+.PP
+.SH AUTHORS
+Lluis Sanchez Gual (lluis@ximian.com)
+.PP
+.SH LICENSE
+wsdl is released under the terms of the GNU GPL.
+.PP
+.SH SEE ALSO
+disco(1), soapsuds(1), mono(1), mcs(1), wsdl(1)
diff --git a/man/xsd.1 b/man/xsd.1
new file mode 100644
index 00000000000..2af1b7a0146
--- /dev/null
+++ b/man/xsd.1
@@ -0,0 +1,73 @@
+.\" xsd manual page.
+.\" (C) 2004 Novell, Inc.
+.\" Author:
+.\" Lluis Sanchez Gual (lluis@ximian.com)
+.\"
+.TH "xsd" "1" "" "" ""
+.SH "NAME"
+xsd \- Mono's utility for generating schema or class files
+.SH "SYNOPSIS"
+.PP
+.B xsd
+<schema.xsd> /classes [options]
+.PP
+.B xsd
+<schema.xsd> /dataset [options]
+.PP
+.B xsd
+<assembly>.dll|<assembly>.exe [options]
+.PP
+.B xsd
+<instance.xml> [<instance.xml> ...] [options]
+.PP
+.SH "DESCRIPTION"
+.I xsd
+is a tool for intended to complement the XML serialization support of Mono. It can do the following tasks:
+.TP
+Generate serializable classes
+From a given XML schema, generate a class that can be used to read and write xml documents that conform that schema (/classes option).
+.TP
+Generate typed datasets
+From a given XML schema, generate a typed DataSet class that can be used to read and write xml documents that conform that schema (/dataset option).
+.TP
+Generate XML schemas
+From a given assembly and an optional type name, generate an XML schema that can be used to validate the xml documents that can be obtained by serializing objects of that type. If no type is provided, xsd generates a schema for all types in the assembly. When specifying the assembly name do not include the file extension (.dll or .exe). xsd will look for the assembly using the standard assembly loading rules.
+.TP
+Infer XML schemas
+From a given set of XML documents, infer the XML schema that can be used to validate those documents.
+
+.SH "OPTIONS"
+The following options are available:
+.TP
+.I "/element:name" "/e:name"
+Specifies the name of the XML schema element for which a class or a dataset has to be generated.
+.TP
+.TP
+.I "/namespace:name" "/n:name"
+Specifies the namespace of the XML schema element for which a class or a dataset has to be generated.
+.TP
+.I "/language:name" "/l:name"
+Specifies the programming language to use for the generated code. The only supported languages are CS (C#) and VB (Visual Basic.NET).
+.TP
+.I "/generator:type,assembly" "/g:type,assembly"
+Indicates xsd.exe to use custom CodeDomProvider to generate code. The type name must be full name. Assembly name is a local file name that is going to be loaded. The specified Type must have the default constructor.
+.TP
+.I "/outputdir:path" "/o:path"
+Specifies the directory where to generate the code or schemas.
+.TP
+.I "/type:name" "/t:name"
+Specifies the full name of the type (including namespace) for which to generate the XML schema.
+.TP
+.I "/help" "/h"
+Show usage help.
+.PP
+.SH "AUTHORS"
+Lluis Sanchez Gual (lluis@ximian.com)
+.br
+Atsushi Enomoto (atsushi@ximian.com)
+.PP
+.SH "LICENSE"
+xsd is released under the terms of the GNU GPL.
+.PP
+.SH "SEE ALSO"
+disco(1), soapsuds(1), mono(1), mcs(1), wsdl(1)
diff --git a/mcs/AUTHORS b/mcs/AUTHORS
deleted file mode 100755
index bce371f17b5..00000000000
--- a/mcs/AUTHORS
+++ /dev/null
@@ -1,16 +0,0 @@
-C# Compiler:
- Miguel de Icaza (miguel@ximian.com)
- Ravi Pratap (ravi@ximian.com)
-
-Class Libraries:
- Patrik Torstensson <patrik.torstensson@labs2.com>
- Gaurav Vaish <gvaish@iitk.ac.in>
- Jeff Stedfast (fejj@ximian.com)
- Joe Shaw (joe@ximian.com)
- Miguel de Icaza (miguel@ximian.com)
- Sean MacIsaac (macisaac@ximian.com)
- Vladimir Vukicevic (vladimir@ximian.com)
- Garrett Rooney (rooneg@electricjellyfish.net)
- Bob Smith (bob@thestuff.net)
- John Barnette (jbarn@httcb.net)
- Daniel Morgan <danmorg@sc.rr.com>
diff --git a/mcs/ChangeLog b/mcs/ChangeLog
deleted file mode 100644
index 728248f3d0f..00000000000
--- a/mcs/ChangeLog
+++ /dev/null
@@ -1,25 +0,0 @@
-2002-05-09 Daniel Morgan <danmorg@sc.rr.com>
-
- * AUTHORS: add me to class libraries list
-
-2002-03-26 Dick Porter <dick@ximian.com>
-
- * makefile (linux): Abandon the build if any of the subdir makes fail
-
-2002-03-07 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Change order of build so corlib is built before nunit since
- Nunit needs corlib now.
-
-2002-02-14 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Build mcs/doctools too when one does 'make'
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * on the 'test' target, make sure NUnit is built first before building
- and running tests
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * add nunit directory to the list of dirs to build in \ No newline at end of file
diff --git a/mcs/README b/mcs/README
deleted file mode 100755
index c3d344552c2..00000000000
--- a/mcs/README
+++ /dev/null
@@ -1,23 +0,0 @@
-
-This contains the Mono C# compiler as well as the Mono runtime
-library.
-
-Layout:
-
- class/
- Class libraries
-
- errors/
- Sample programs that should generate errors by the compiler.
-
- jay/
- Yacc-based parser generator.
-
- mcs/
- The Mono C# compiler
-
- tests/
- Sample tests
-
-Thanks a lot to Sergey Chaban for his help during the development of
-the C# compiler.
diff --git a/mcs/class/.cvsignore b/mcs/class/.cvsignore
deleted file mode 100644
index a65b41774ad..00000000000
--- a/mcs/class/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-lib
diff --git a/mcs/class/Microsoft.VisualBasic/Changelog b/mcs/class/Microsoft.VisualBasic/Changelog
deleted file mode 100644
index 745bb64c4e2..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Changelog
+++ /dev/null
@@ -1,16 +0,0 @@
-2002-05-12 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
-
- * Microsoft.VisualBasic.Strings: Strings.cs - Merged all method implementations provided
- by Martin Adoue, with method signatures (specially attributes) provided
- by Chris J. Breisch. Some tweaking for the Mid member (two overloads versus third optional parameter).
-
-
-
-2002-05-18 Chris J Breisch <cjbreisch@altavista.net>
-
- * Microsoft.VisualBasic: *.cs/Test/*.cs - Cleaned up code, added
- implementations for Collection.cs, Conversion.cs and NUnit Tests
- for both
-
-
-
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build
deleted file mode 100644
index bc0ddd3e961..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.build
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.dll -->
-
-<project name="System" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/Microsoft.VisualBasic.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
-
- <!-- cor compare dies with these currently -->
- <!--<arg value="/nostdlib"/>--> <!-- don't reference mscorlib -->
- <!--<arg value="/lib:../lib/"/>-->
- <!--<arg value="/r:..\lib\corlib.dll"/>-->
- <!--<arg value="/r:..\lib\System.dll"/>-->
- <arg value="/r:System.dll"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- </sources>
- <references>
- <!--<includes name="../lib/corlib.dll"/>-->
- <!--<includes name="../lib/System.dll"/>-->
- </references>
- </csc>
- <copy file="../lib/Microsoft.VisualBasic.dll" tofile="Test/Microsoft.VisualBasic.dll"/>
- </target>
-
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="clean">
- <nant basedir="Test" target="clean"/>
- <delete file="../lib/Microsoft.VisualBasic.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs
deleted file mode 100644
index 210ee7d8e4a..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/AppWinStyle.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// AppWinStyle.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum AppWinStyle : short {
- Hide = 0,
- NormalFocus = 1,
- MinimizedFocus = 2,
- MaximizedFocus = 3,
- NormalNoFocus = 4,
- MinimizedNoFocus = 6
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs
deleted file mode 100644
index d726be52606..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CallType.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// CallType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum CallType : int {
- Method = 1,
- Get = 2,
- Let = 4,
- Set = 8
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs
deleted file mode 100644
index 29e171b0b38..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Collection.cs
+++ /dev/null
@@ -1,314 +0,0 @@
-//
-// Collection.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-using System;
-using System.Runtime.InteropServices;
-using System.Collections;
-using System.ComponentModel;
-
-
-namespace Microsoft.VisualBasic {
- sealed public class Collection : ICollection, IList {
- //
- // <summary>
- // Collection : The BASIC Collection Object
- // </summary>
- //
- // <remarks>
- // </remarks>
- // Declarations
- private Hashtable m_Hashtable = new Hashtable();
- private ArrayList m_HashIndexers = new ArrayList();
- internal bool Modified = false;
-
- private class ColEnumerator: IEnumerator
- //
- // <summary>
- // ColEnumerator : This internal class is used
- // for enumerating through our Collection
- // </summary>
- //
- // <remarks>
- // </remarks>
- {
- private int Index;
- private Collection Col;
- private object Item;
-
- public ColEnumerator(Collection coll)
- {
- Col = coll;
- Index = 0;
- Col.Modified = false;
- }
-
- public void Reset()
- {
- if (Col.Modified)
- {
- // FIXME : spec says throw exception, MS doesn't
- // throw new InvalidOperationException();
- }
- Index = 0;
- }
-
- public bool MoveNext()
- {
- if (Col.Modified)
- {
- // FIXME : spec says throw exception, MS doesn't
- // throw new InvalidOperationException();
- }
- Index++;
- try {
- Item = Col[Index];
- }
- catch {
- // do nothing
- }
-
- return Index <= Col.Count;
- }
-
- public object Current {
- get {
- if (Index == 0) {
- // FIXME : spec says throw InvalidOperation,
- // but MS throws IndexOutOfRange
- throw new IndexOutOfRangeException();
- // throw new InvalidOperationException();
- }
- else {
- return Item;
- }
- }
- }
-
- // The current property on the IEnumerator interface:
- object IEnumerator.Current {
- get {
- return(Current);
- }
- }
- }
- // Constructors
- // Properties
- System.Boolean IList.IsReadOnly {
- get {return false;}
- }
-
- System.Boolean ICollection.IsSynchronized {
- get {return m_Hashtable.IsSynchronized;}
- }
-
- System.Object ICollection.SyncRoot {
- get {return m_Hashtable.SyncRoot;}
- }
-
- System.Boolean IList.IsFixedSize {
- get {return false;}
- }
-
- public System.Int32 Count {
- get {return m_HashIndexers.Count;}
- }
-
- [ReadOnly(true)]
- [System.Runtime.CompilerServices.IndexerName("Item")]
- public System.Object this [System.Int32 Index] {
- get {
- try {
- // Collections are 1-based
- return m_Hashtable[m_HashIndexers[Index-1]];
- }
- catch {
- throw new IndexOutOfRangeException();
- }
- }
- set {throw new NotImplementedException();}
- }
-
- [System.Runtime.CompilerServices.IndexerName("Item")]
- public System.Object this [System.Object Index]
- {
- get {
- if (Index is string) {
- if (m_HashIndexers.IndexOf(Index) < 0) {
- // throw new IndexOutOfRangeException();
- // FIXME : Spec Says IndexOutOfRange...MS throws Argument
- throw new ArgumentException();
- }
- return m_Hashtable[Index];
- }
- else {
- throw new ArgumentException();
- }
- }
- }
-
- // Methods
- System.Int32 IList.IndexOf (System.Object value)
- {
- int LastPos = 0;
- bool Found = false;
-
- while (!Found) {
- LastPos = m_HashIndexers.IndexOf(value.GetHashCode(), LastPos);
- if (LastPos == -1) {
- Found = true;
- } else if (m_Hashtable[m_HashIndexers[LastPos]] == value) {
- Found = true;
- }
- }
- return LastPos;
- }
-
- System.Boolean IList.Contains (System.Object value)
- {
- return m_Hashtable.ContainsValue(value);
- }
-
- void IList.Clear ()
- {
- m_Hashtable.Clear();
- m_HashIndexers.Clear();
- }
-
- public void Remove (System.String Key)
- {
- int Index;
-
- try {
- Index = m_HashIndexers.IndexOf(Key) + 1;
- Remove(Index);
- }
- catch {
- throw new ArgumentException();
- }
- }
-
- public void Remove (System.Int32 Index)
- {
- try {
- // Collections are 1-based
- m_Hashtable.Remove(m_HashIndexers[Index-1]);
- m_HashIndexers.RemoveAt(Index-1);
- Modified = true;
- }
- catch {
- throw new IndexOutOfRangeException();
- }
- }
-
- void IList.Remove (System.Object value)
- {
- if (!(value is string)) {
- throw new ArgumentException();
- }
- Remove((string)value);
- }
-
- void IList.RemoveAt (System.Int32 index)
- {
- Remove(index);
- }
-
- void IList.Insert (System.Int32 index, System.Object value)
- {
- Insert(index, value, value.GetHashCode().ToString());
- }
-
- void Insert(System.Int32 index, System.Object value, string Key)
- {
- m_HashIndexers.Insert(index -1, Key);
- m_Hashtable.Add(Key, value);
- Modified = true;
- }
-
- System.Int32 IList.Add (System.Object Item)
- {
- return Add(Item, Item.GetHashCode().ToString());
- }
-
- System.Int32 Add(System.Object Item, string Key)
- {
- m_Hashtable.Add(Key, Item);
- Modified = true;
-
- return m_HashIndexers.Add(Key);
- }
-
- private int GetIndexPosition(System.Object Item)
- {
- int Position = int.MinValue;
-
- if (Item is string) {
- Position = m_HashIndexers.IndexOf(Item) + 1;
- }
- else if (Item is int) {
- Position = Convert.ToInt32(Item);
- }
- else {
- throw new InvalidCastException();
- }
- if (Position < 0) {
- throw new ArgumentException();
- }
- return Position;
- }
-
- public void Add (System.Object Item,
- [Optional] [DefaultValue(null)] String Key,
- [Optional] [DefaultValue(null)] System.Object Before,
- [Optional] [DefaultValue(null)] System.Object After)
- {
- int Position = int.MinValue;
-
- // check for valid args
- if (Before != null && After != null) {
- throw new ArgumentException();
- }
- if (Key != null && m_HashIndexers.IndexOf(Key) != -1) {
- throw new ArgumentException();
- }
- if (Before != null) {
- Position = GetIndexPosition(Before);
- }
- if (After != null) {
- Position = GetIndexPosition(After) + 1;
- }
- if (Key == null) {
- Key = Item.GetHashCode().ToString();
- }
-
- if (Position > (m_HashIndexers.Count+1) || Position == int.MinValue) {
- Add(Item, Key);
- }
- else {
- Insert(Position, Item, Key);
- }
- }
-
- void ICollection.CopyTo (System.Array array, System.Int32 index)
- {
- System.Array NewArray =
- Array.CreateInstance(typeof(System.Object),
- m_HashIndexers.Count - index);
-
- // Collections are 1-based
- for (int i = index -1; i < m_HashIndexers.Count; i++) {
- NewArray.SetValue(m_Hashtable[m_HashIndexers[i]], i - index);
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new ColEnumerator(this);
- }
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs
deleted file mode 100644
index efd694246b4..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ComClassAttribute.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// ComClassAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic {
- [System.AttributeUsageAttribute(System.AttributeTargets.Class)]
- sealed public class ComClassAttribute : System.Attribute {
- // Declarations
- // Constructors
- [MonoTODO]
- ComClassAttribute(System.String _ClassID) { throw new NotImplementedException (); }
- [MonoTODO]
- ComClassAttribute(System.String _ClassID, System.String _InterfaceID) { throw new NotImplementedException (); }
- [MonoTODO]
- ComClassAttribute(System.String _ClassID, System.String _InterfaceID, System.String _EventId) { throw new NotImplementedException (); }
- // Properties
- [MonoTODO]
- public System.String EventID { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.Boolean InterfaceShadows { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.String ClassID { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.String InterfaceID { get { throw new NotImplementedException (); } }
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs
deleted file mode 100644
index 5b93a2351ef..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/CompareMethod.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// CompareMethod.cs
-//
-// Author:
-// Martin Adoue (martin@cwanet.com)
-//
-// (C) 2002 Martin Adoue
-//
-namespace Microsoft.VisualBasic {
-
- /// <summary>
- /// The CompareMethod enumeration contains constants used to determine the
- /// way strings are compared when using functions such as InStr and StrComp.
- /// These constants can be used anywhere in your code.
- /// </summary>
- public enum CompareMethod : int {
- /// <summary>
- /// Performs a binary comparison
- /// </summary>
- Binary = 0,
- /// <summary>
- /// Performs a textual comparison
- /// </summary>
- Text = 1
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs
deleted file mode 100644
index a5d78e04404..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Constants.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// Constants.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class Constants {
- // Declarations
- public const System.Int32 vbObjectError = (System.Int32)(-2147221504);
- public const System.String vbCrLf = "\n\r";
- public const System.String vbNewLine = "\n\r";
- public const System.String vbCr = "\n";
- public const System.String vbLf = "\r";
- public const System.String vbBack = "\b";
- public const System.String vbFormFeed = "\f";
- public const System.String vbTab = "\t";
- public const System.String vbVerticalTab = "\v";
- public const System.String vbNullChar = "\0";
- public const System.String vbNullString = (System.String)null;
- public const Microsoft.VisualBasic.AppWinStyle vbHide = (Microsoft.VisualBasic.AppWinStyle)(0);
- public const Microsoft.VisualBasic.AppWinStyle vbNormalFocus = (Microsoft.VisualBasic.AppWinStyle)(1);
- public const Microsoft.VisualBasic.AppWinStyle vbMinimizedFocus = (Microsoft.VisualBasic.AppWinStyle)(2);
- public const Microsoft.VisualBasic.AppWinStyle vbMaximizedFocus = (Microsoft.VisualBasic.AppWinStyle)(3);
- public const Microsoft.VisualBasic.AppWinStyle vbNormalNoFocus = (Microsoft.VisualBasic.AppWinStyle)(4);
- public const Microsoft.VisualBasic.AppWinStyle vbMinimizedNoFocus = (Microsoft.VisualBasic.AppWinStyle)(6);
- public const Microsoft.VisualBasic.CallType vbMethod = (Microsoft.VisualBasic.CallType)(1);
- public const Microsoft.VisualBasic.CallType vbGet = (Microsoft.VisualBasic.CallType)(2);
- public const Microsoft.VisualBasic.CallType vbLet = (Microsoft.VisualBasic.CallType)(4);
- public const Microsoft.VisualBasic.CallType vbSet = (Microsoft.VisualBasic.CallType)(8);
- public const Microsoft.VisualBasic.CompareMethod vbBinaryCompare = (Microsoft.VisualBasic.CompareMethod)(0);
- public const Microsoft.VisualBasic.CompareMethod vbTextCompare = (Microsoft.VisualBasic.CompareMethod)(1);
- public const Microsoft.VisualBasic.DateFormat vbGeneralDate = (Microsoft.VisualBasic.DateFormat)(0);
- public const Microsoft.VisualBasic.DateFormat vbLongDate = (Microsoft.VisualBasic.DateFormat)(1);
- public const Microsoft.VisualBasic.DateFormat vbShortDate = (Microsoft.VisualBasic.DateFormat)(2);
- public const Microsoft.VisualBasic.DateFormat vbLongTime = (Microsoft.VisualBasic.DateFormat)(3);
- public const Microsoft.VisualBasic.DateFormat vbShortTime = (Microsoft.VisualBasic.DateFormat)(4);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbUseSystemDayOfWeek = (Microsoft.VisualBasic.FirstDayOfWeek)(0);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbSunday = (Microsoft.VisualBasic.FirstDayOfWeek)(1);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbMonday = (Microsoft.VisualBasic.FirstDayOfWeek)(2);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbTuesday = (Microsoft.VisualBasic.FirstDayOfWeek)(3);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbWednesday = (Microsoft.VisualBasic.FirstDayOfWeek)(4);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbThursday = (Microsoft.VisualBasic.FirstDayOfWeek)(5);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbFriday = (Microsoft.VisualBasic.FirstDayOfWeek)(6);
- public const Microsoft.VisualBasic.FirstDayOfWeek vbSaturday = (Microsoft.VisualBasic.FirstDayOfWeek)(7);
- public const Microsoft.VisualBasic.FileAttribute vbNormal = (Microsoft.VisualBasic.FileAttribute)(0);
- public const Microsoft.VisualBasic.FileAttribute vbReadOnly = (Microsoft.VisualBasic.FileAttribute)(1);
- public const Microsoft.VisualBasic.FileAttribute vbHidden = (Microsoft.VisualBasic.FileAttribute)(2);
- public const Microsoft.VisualBasic.FileAttribute vbSystem = (Microsoft.VisualBasic.FileAttribute)(4);
- public const Microsoft.VisualBasic.FileAttribute vbVolume = (Microsoft.VisualBasic.FileAttribute)(8);
- public const Microsoft.VisualBasic.FileAttribute vbDirectory = (Microsoft.VisualBasic.FileAttribute)(16);
- public const Microsoft.VisualBasic.FileAttribute vbArchive = (Microsoft.VisualBasic.FileAttribute)(32);
- public const Microsoft.VisualBasic.FirstWeekOfYear vbUseSystem = (Microsoft.VisualBasic.FirstWeekOfYear)(0);
- public const Microsoft.VisualBasic.FirstWeekOfYear vbFirstJan1 = (Microsoft.VisualBasic.FirstWeekOfYear)(1);
- public const Microsoft.VisualBasic.FirstWeekOfYear vbFirstFourDays = (Microsoft.VisualBasic.FirstWeekOfYear)(2);
- public const Microsoft.VisualBasic.FirstWeekOfYear vbFirstFullWeek = (Microsoft.VisualBasic.FirstWeekOfYear)(3);
- public const Microsoft.VisualBasic.VbStrConv vbUpperCase = (Microsoft.VisualBasic.VbStrConv)(1);
- public const Microsoft.VisualBasic.VbStrConv vbLowerCase = (Microsoft.VisualBasic.VbStrConv)(2);
- public const Microsoft.VisualBasic.VbStrConv vbProperCase = (Microsoft.VisualBasic.VbStrConv)(3);
- public const Microsoft.VisualBasic.VbStrConv vbWide = (Microsoft.VisualBasic.VbStrConv)(4);
- public const Microsoft.VisualBasic.VbStrConv vbNarrow = (Microsoft.VisualBasic.VbStrConv)(8);
- public const Microsoft.VisualBasic.VbStrConv vbKatakana = (Microsoft.VisualBasic.VbStrConv)(16);
- public const Microsoft.VisualBasic.VbStrConv vbHiragana = (Microsoft.VisualBasic.VbStrConv)(32);
- public const Microsoft.VisualBasic.VbStrConv vbSimplifiedChinese = (Microsoft.VisualBasic.VbStrConv)(256);
- public const Microsoft.VisualBasic.VbStrConv vbTraditionalChinese = (Microsoft.VisualBasic.VbStrConv)(512);
- public const Microsoft.VisualBasic.VbStrConv vbLinguisticCasing = (Microsoft.VisualBasic.VbStrConv)(1024);
- public const Microsoft.VisualBasic.TriState vbUseDefault = (Microsoft.VisualBasic.TriState)(-2);
- public const Microsoft.VisualBasic.TriState vbTrue = (Microsoft.VisualBasic.TriState)(-1);
- public const Microsoft.VisualBasic.TriState vbFalse = (Microsoft.VisualBasic.TriState)(0);
- public const Microsoft.VisualBasic.VariantType vbEmpty = (Microsoft.VisualBasic.VariantType)(0);
- public const Microsoft.VisualBasic.VariantType vbNull = (Microsoft.VisualBasic.VariantType)(1);
- public const Microsoft.VisualBasic.VariantType vbInteger = (Microsoft.VisualBasic.VariantType)(3);
- public const Microsoft.VisualBasic.VariantType vbLong = (Microsoft.VisualBasic.VariantType)(20);
- public const Microsoft.VisualBasic.VariantType vbSingle = (Microsoft.VisualBasic.VariantType)(4);
- public const Microsoft.VisualBasic.VariantType vbDouble = (Microsoft.VisualBasic.VariantType)(5);
- public const Microsoft.VisualBasic.VariantType vbCurrency = (Microsoft.VisualBasic.VariantType)(6);
- public const Microsoft.VisualBasic.VariantType vbDate = (Microsoft.VisualBasic.VariantType)(7);
- public const Microsoft.VisualBasic.VariantType vbString = (Microsoft.VisualBasic.VariantType)(8);
- public const Microsoft.VisualBasic.VariantType vbObject = (Microsoft.VisualBasic.VariantType)(9);
- public const Microsoft.VisualBasic.VariantType vbBoolean = (Microsoft.VisualBasic.VariantType)(11);
- public const Microsoft.VisualBasic.VariantType vbVariant = (Microsoft.VisualBasic.VariantType)(12);
- public const Microsoft.VisualBasic.VariantType vbDecimal = (Microsoft.VisualBasic.VariantType)(14);
- public const Microsoft.VisualBasic.VariantType vbByte = (Microsoft.VisualBasic.VariantType)(17);
- public const Microsoft.VisualBasic.VariantType vbUserDefinedType = (Microsoft.VisualBasic.VariantType)(36);
- public const Microsoft.VisualBasic.VariantType vbArray = (Microsoft.VisualBasic.VariantType)(8192);
- public const Microsoft.VisualBasic.MsgBoxResult vbOK = (Microsoft.VisualBasic.MsgBoxResult)(1);
- public const Microsoft.VisualBasic.MsgBoxResult vbCancel = (Microsoft.VisualBasic.MsgBoxResult)(2);
- public const Microsoft.VisualBasic.MsgBoxResult vbAbort = (Microsoft.VisualBasic.MsgBoxResult)(3);
- public const Microsoft.VisualBasic.MsgBoxResult vbRetry = (Microsoft.VisualBasic.MsgBoxResult)(4);
- public const Microsoft.VisualBasic.MsgBoxResult vbIgnore = (Microsoft.VisualBasic.MsgBoxResult)(5);
- public const Microsoft.VisualBasic.MsgBoxResult vbYes = (Microsoft.VisualBasic.MsgBoxResult)(6);
- public const Microsoft.VisualBasic.MsgBoxResult vbNo = (Microsoft.VisualBasic.MsgBoxResult)(7);
- public const Microsoft.VisualBasic.MsgBoxStyle vbOKOnly = (Microsoft.VisualBasic.MsgBoxStyle)(0);
- public const Microsoft.VisualBasic.MsgBoxStyle vbOKCancel = (Microsoft.VisualBasic.MsgBoxStyle)(1);
- public const Microsoft.VisualBasic.MsgBoxStyle vbAbortRetryIgnore = (Microsoft.VisualBasic.MsgBoxStyle)(2);
- public const Microsoft.VisualBasic.MsgBoxStyle vbYesNoCancel = (Microsoft.VisualBasic.MsgBoxStyle)(3);
- public const Microsoft.VisualBasic.MsgBoxStyle vbYesNo = (Microsoft.VisualBasic.MsgBoxStyle)(4);
- public const Microsoft.VisualBasic.MsgBoxStyle vbRetryCancel = (Microsoft.VisualBasic.MsgBoxStyle)(5);
- public const Microsoft.VisualBasic.MsgBoxStyle vbCritical = (Microsoft.VisualBasic.MsgBoxStyle)(16);
- public const Microsoft.VisualBasic.MsgBoxStyle vbQuestion = (Microsoft.VisualBasic.MsgBoxStyle)(32);
- public const Microsoft.VisualBasic.MsgBoxStyle vbExclamation = (Microsoft.VisualBasic.MsgBoxStyle)(48);
- public const Microsoft.VisualBasic.MsgBoxStyle vbInformation = (Microsoft.VisualBasic.MsgBoxStyle)(64);
- public const Microsoft.VisualBasic.MsgBoxStyle vbDefaultButton1 = (Microsoft.VisualBasic.MsgBoxStyle)(0);
- public const Microsoft.VisualBasic.MsgBoxStyle vbDefaultButton2 = (Microsoft.VisualBasic.MsgBoxStyle)(256);
- public const Microsoft.VisualBasic.MsgBoxStyle vbDefaultButton3 = (Microsoft.VisualBasic.MsgBoxStyle)(512);
- public const Microsoft.VisualBasic.MsgBoxStyle vbApplicationModal = (Microsoft.VisualBasic.MsgBoxStyle)(0);
- public const Microsoft.VisualBasic.MsgBoxStyle vbSystemModal = (Microsoft.VisualBasic.MsgBoxStyle)(4096);
- public const Microsoft.VisualBasic.MsgBoxStyle vbMsgBoxHelp = (Microsoft.VisualBasic.MsgBoxStyle)(16384);
- public const Microsoft.VisualBasic.MsgBoxStyle vbMsgBoxRight = (Microsoft.VisualBasic.MsgBoxStyle)(524288);
- public const Microsoft.VisualBasic.MsgBoxStyle vbMsgBoxRtlReading = (Microsoft.VisualBasic.MsgBoxStyle)(1048576);
- public const Microsoft.VisualBasic.MsgBoxStyle vbMsgBoxSetForeground = (Microsoft.VisualBasic.MsgBoxStyle)(65536);
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs
deleted file mode 100644
index 480e4be1b25..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ControlChars.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// ControlChars.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- sealed public class ControlChars {
- // Declarations
- public const System.String CrLf = "\n\r";
- public const System.String NewLine = "\n\r";
- public const System.Char Cr = '\n';
- public const System.Char Lf = '\r';
- public const System.Char Back = '\b';
- public const System.Char FormFeed = '\f';
- public const System.Char Tab = '\t';
- public const System.Char VerticalTab = '\v';
- public const System.Char NullChar = '\0';
- public const System.Char Quote = '"';
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs
deleted file mode 100644
index 38308a61605..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Conversion.cs
+++ /dev/null
@@ -1,616 +0,0 @@
-//
-// Conversion.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-using System.Text.RegularExpressions;
-
-namespace Microsoft.VisualBasic {
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class Conversion {
- //
- // <summary>
- // Collection : The BASIC Collection Object
- // </summary>
- //
- // <remarks>
- // </remarks>
- // Declarations
- private static readonly char[] _HexDigits = {
- '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
- };
- private static readonly char[] _OctDigits = {
- '0', '1', '2', '3', '4', '5', '6', '7'
- };
- private static readonly long[] _Maxes = {
- 32767, 2147483647, 9223372036854775807
- };
- private enum SizeIndexes {
- Int16 = 0,
- Int32 = 1,
- Int64 = 2
- };
-
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static string ErrorToString () {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static string ErrorToString (
- System.Int32 ErrorNumber) {
- throw new NotImplementedException ();
- }
-
- // Return whether d is +/- Could do this with a macro,
- // but this is cleaner
- private static int Sign(double d) { return d > 0 ? 1 : -1;}
-
- // try to cast an Object to a string...used in several places
- private static string CastToString (System.Object Expression) {
- try {
- return (string)Expression;
- }
- catch {
- throw new InvalidCastException();
- }
- }
-
- // Fix on Integer types doesn't do anything
- public static short Fix (short Number) { return Number; }
- public static int Fix (int Number) { return Number; }
- public static long Fix (long Number) { return Number; }
-
- // Fix on other numberic types = Sign(Number) * Int(Abs(Number))
- public static double Fix (double Number) {
- return Sign(Number) * Int (Math.Abs (Number));
- }
- public static float Fix (float Number) {
- return Sign(Number) * Int (Math.Abs (Number));
- }
- public static decimal Fix (decimal Number) {
- return Sign((double)Number) * Int (Math.Abs (Number));
- }
-
- // Fix on an Object type is trickier
- // first we have to cast it to the right type
- public static System.Object Fix (System.Object Number)
- {
- // always start out by throwing an exception
- // if Number is null
- if (Number == null) {
- throw new ArgumentNullException ("Number",
- "Value cannot be null");
- }
-
- TypeCode TC = Type.GetTypeCode (Number.GetType ());
-
- // switch on TypeCode and call appropriate Fix method
- switch (TC) {
- case TypeCode.Decimal:
- return Fix (Convert.ToDecimal (Number));
- case TypeCode.Double:
- return Fix (Convert.ToDouble (Number));
- case TypeCode.Single:
- return Fix (Convert.ToSingle (Number));
- case TypeCode.String:
- return Fix (Double.Parse (
- CastToString (Number)));
-
- // for integer types, don't need to do anything
- case TypeCode.Byte:
- case TypeCode.Int16:
- case TypeCode.Int32:
- case TypeCode.Int64:
- case TypeCode.SByte:
- case TypeCode.UInt16:
- case TypeCode.UInt32:
- case TypeCode.UInt64:
- return Number;
-
- // spec defines Empty as returning 0
- case TypeCode.Empty:
- return 0;
-
- // we can't convert these types
- case TypeCode.Boolean:
- case TypeCode.Char:
- case TypeCode.DateTime:
- case TypeCode.DBNull:
- case TypeCode.Object:
- default:
- throw new ArgumentException (
- "Type of argument 'Number' is '"
- + Number.GetType().FullName +
- "', which is not numeric.");
- }
- }
-
- // Int on Integer types doesn't do anything
- public static short Int (short Number) { return Number; }
- public static int Int (int Number) { return Number; }
- public static long Int (long Number) { return Number; }
-
- // Int on other numberic types is same thing as "Floor"
- public static double Int (double Number) {
- return (double) Math.Floor(Number);
- }
- public static float Int (float Number) {
- return (float) Math.Floor(Number);
- }
- public static decimal Int (decimal Number) {
- return Decimal.Floor(Number);
- }
-
- // doing an Int on an Object is trickier
- // first we have to cast to the correct type
- public static System.Object Int (System.Object Number) {
- // always start out by throwing an exception
- // if Number is null
- if (Number == null) {
- throw new ArgumentNullException("Number",
- "Value cannot be null");
- }
-
- TypeCode TC = Type.GetTypeCode (Number.GetType ());
-
- // switch on TypeCode and call appropriate Int method
- switch (TC) {
- case TypeCode.Decimal:
- return Int (Convert.ToDecimal (Number));
- case TypeCode.Double:
- return Int (Convert.ToDouble (Number));
- case TypeCode.Single:
- return Int (Convert.ToSingle (Number));
- case TypeCode.String:
- return Int (Double.Parse (
- CastToString(Number)));
-
- // Int on integer types does nothing
- case TypeCode.Byte:
- case TypeCode.Int16:
- case TypeCode.Int32:
- case TypeCode.Int64:
- case TypeCode.SByte:
- case TypeCode.UInt16:
- case TypeCode.UInt32:
- case TypeCode.UInt64:
- return Number;
-
- // Spec defines Empty as returning 0
- case TypeCode.Empty:
- return 0;
-
- // otherwise, it's we can't cast to a numeric
- case TypeCode.Boolean:
- case TypeCode.Char:
- case TypeCode.DateTime:
- case TypeCode.DBNull:
- case TypeCode.Object:
- default:
- throw new ArgumentException (
- "Type of argument 'Number' is '" +
- Number.GetType().FullName +
- "', which is not numeric.");
- }
- }
-
- // we use this internally to get a string
- // representation of a number in a specific base
- private static string ToBase (ulong Number, int Length,
- char[] BaseDigits, uint Base) {
- int i;
- ulong r;
- // we use a char array here for performance
- char [] c = new Char[Length];
- string s = null;
-
-
- for (i = Length - 1; i >= 0; i--) {
- r = Number % Base;
- Number = Number / Base;
- c[i] = BaseDigits[r];
- if (Number == 0) {
- s = new string (c, i, Length - i);
- break;
- }
- }
- if (s == null) {
- return new string (c);
- }
- else {
- return s;
- }
- }
-
-
- // convert a number to Hex
- // a little bit of magic goes on here with negative #'s
- private static string ToHex(long Number, int Digits,
- SizeIndexes Size) {
- ulong UNumber;
-
- if (Number < 0) {
- // we add maxint of the Number's type
- // twice and then 2 more...this has the
- // effect of turning it into a ulong
- // that has the same hex representation
- UNumber = (ulong)((Number + 2) +
- _Maxes[(int)Size]) +
- (ulong)_Maxes[(int)Size];
- }
- else {
- UNumber = (ulong)Number;
- }
- return ToBase(UNumber, Digits, _HexDigits, 16);
- }
-
- // call our private function,
- // passing it the size of the item to convert
- public static string Hex (short Number) {
- return ToHex(Number, 4, SizeIndexes.Int16);
- }
- public static string Hex (byte Number) {
- return ToHex(Number, 2, SizeIndexes.Int16);
- }
- public static string Hex (int Number) {
- return ToHex(Number, 8, SizeIndexes.Int32);
- }
- public static string Hex (long Number) {
- return ToHex(Number, 16, SizeIndexes.Int64);
- }
-
- // Objects are trickier
- // first we have to cast to appropriate type
- public static System.String Hex (System.Object Number) {
- // always start out by throwing an exception
- // if Number is null
- if (Number == null) {
- throw new ArgumentNullException ("Number",
- "Value cannot be null");
- }
-
- TypeCode TC = Type.GetTypeCode (Number.GetType ());
-
- switch (TC) {
- // try to parse the string as an Int32,
- // then an Int64, if that fails
- case TypeCode.String:
- try {
- return Hex (
- Int32.Parse (
- CastToString (Number)));
- }
- catch {
- return Hex (
- Int64.Parse (
- CastToString (Number)));
- }
-
- // for the int types,
- // just call the normal "Hex" for that type
- case TypeCode.Byte:
- return Hex ((byte)Number);
- case TypeCode.Int16:
- return Hex ((short)Number);
- case TypeCode.Int32:
- return Hex ((int)Number);
- case TypeCode.Int64:
- return Hex ((long)Number);
-
- // empty is defined as returning 0
- case TypeCode.Empty:
- return "0";
-
- // we can't do any of these types
- case TypeCode.Boolean:
- case TypeCode.Char:
- case TypeCode.DBNull:
- case TypeCode.DateTime:
- case TypeCode.Decimal:
- case TypeCode.Double:
- case TypeCode.Object:
- case TypeCode.SByte:
- case TypeCode.Single:
- case TypeCode.UInt16:
- case TypeCode.UInt32:
- case TypeCode.UInt64:
- default:
- throw new ArgumentException (
- "Type of argument 'Number' is '" +
- Number.GetType().FullName +
- "', which is not numeric.");
- }
- }
-
- // ToOct works just like ToHex, only in Octal.
- private static string ToOct(long Number, int Digits,
- SizeIndexes Size) {
- ulong UNumber;
-
- if (Number < 0) {
- // for neg numbers add the maxint of
- // the appropriate size twice, and then two more
- // this has the effect of turning it
- // into a ulong with the same oct representation
- UNumber = (ulong)((Number + 2) +
- _Maxes[(int)Size]) +
- (ulong)(_Maxes[(int)Size]);
- }
- else {
- UNumber = (ulong)Number;
- }
- return ToBase (UNumber, Digits, _OctDigits, 8);
- }
-
- // call ToOct with appropriate information
- public static string Oct (short Number) {
- return ToOct(Number, 6, SizeIndexes.Int16);
- }
- public static string Oct (byte Number) {
- return ToOct(Number, 3, SizeIndexes.Int16);
- }
- public static string Oct (int Number) {
- return ToOct(Number, 11, SizeIndexes.Int32);
- }
- public static string Oct (long Number) {
- return ToOct(Number, 22, SizeIndexes.Int64);
- }
-
- // Objects are always trickier
- // first need to cast to appropriate type
- public static string Oct (System.Object Number) {
- // first, always throw an exception if Number is null
- if (Number == null) {
- throw new ArgumentNullException("Number",
- "Value cannot be null");
- }
-
- TypeCode TC = Type.GetTypeCode (Number.GetType ());
-
- switch (TC) {
- // try to parse a string as an Int32
- // and then an Int64
- case TypeCode.String:
- try {
- return Oct (
- Int32.Parse (
- CastToString (Number)));
- }
- catch {
- return Oct (
- Int64.Parse (
- CastToString (Number)));
- }
-
- // integer types just call the appropriate "Oct"
- case TypeCode.Byte:
- return Oct ((byte)Number);
- case TypeCode.Int16:
- return Oct ((short)Number);
- case TypeCode.Int32:
- return Oct ((int)Number);
- case TypeCode.Int64:
- return Oct ((long)Number);
-
- // Empty is defined as returning 0
- case TypeCode.Empty:
- return "0";
-
- // We can't convert these to Octal
- case TypeCode.Boolean:
- case TypeCode.Char:
- case TypeCode.DBNull:
- case TypeCode.DateTime:
- case TypeCode.Decimal:
- case TypeCode.Double:
- case TypeCode.Object:
- case TypeCode.SByte:
- case TypeCode.Single:
- case TypeCode.UInt16:
- case TypeCode.UInt32:
- case TypeCode.UInt64:
- default:
- throw new ArgumentException (
- "Type of argument 'Number' is '" +
- Number.GetType().FullName +
- "', which is not numeric.");
- }
- }
-
- // Str is pretty easy now that we have a language
- // with a ToString method()
- public static string Str (System.Object Number) {
-
- // check for null as always and throw an exception
- if (Number == null) {
- throw new ArgumentNullException("Number");
- }
-
- switch (Type.GetTypeCode (Number.GetType ())) {
- // for unsigned types, just call ToString
- case TypeCode.Byte:
- case TypeCode.UInt16:
- case TypeCode.UInt32:
- case TypeCode.UInt64:
- return Number.ToString();
-
- // for signed types, we have to leave a
- // space for the missing + sign
- case TypeCode.Decimal:
- return ((decimal)Number > 0 ? " " : "")
- + Number.ToString();
- case TypeCode.Double:
- return ((double)Number > 0 ? " " : "")
- + Number.ToString();
- case TypeCode.Int16:
- return ((short)Number > 0 ? " " : "")
- + Number.ToString();
- case TypeCode.Int32:
- return ((int)Number > 0 ? " " : "")
- + Number.ToString();
- case TypeCode.Int64:
- return ((long)Number > 0 ? " " : "")
- + Number.ToString();
- case TypeCode.SByte:
- return ((sbyte)Number > 0 ? " " : "")
- + Number.ToString();
- case TypeCode.Single:
- return ((float)Number > 0 ? " " : "")
- + Number.ToString();
-
- // can't cast anything else to a Number
- default:
- throw new InvalidCastException(
- "Argument 'Number' cannot be converted to a numeric value.");
- }
- }
-
- // The Val function is pretty bizarre
- // Val ("&HFF") = 255
- // Val ("&O377") = 255
- // Val ("1234 Any Street") = 1234
- // Val (" 12 45 . 90 7 E + 0 0 2 ") = 1245.907e+002 = 124590.7
- public static double Val (string InputStr) {
- int i;
- int Base;
- int NumChars = 0;
- char c;
- int Length = InputStr.Length;
- char[] Number = new char[Length];
- bool FoundRadixPrefix = false;
- Regex NumberReg;
- Match NumberMatch;
-
- Base = 10;
- Number[0] = '\0';
-
- // go through string
- for (i = 0; i < Length; i++) {
- c = InputStr[i];
-
- // look for Radix prefix "&"
- if (i == 0 && c == '&') {
- FoundRadixPrefix = true;
- }
-
- // look for an H or O following the prefix
- else if (FoundRadixPrefix && i == 1 &&
- (char.ToLower(c) == 'h' ||
- char.ToLower(c) == 'o')) {
- if (c == 'H') {
- Base = 16;
- }
- else {
- Base = 8;
- }
- }
-
- // if we didn't find a radix prefix,
- // ignore whitespace
- else if (char.IsWhiteSpace(c) && (Base == 10)) {
- continue;
- }
-
- // mash what's left together
- else {
- Number[NumChars++] = c;
- }
- }
-
- // now we have a string to parse
- switch (Base) {
- // FIXME : for Octal and Hex,
- // Regex is probably overkill
- // Even for base 10, it might be faster
- // to write our own parser
- case 8:
- NumberReg = new Regex ("^[0-7]*");
- NumberMatch = NumberReg.Match (
- new string(Number, 0, NumChars));
- break;
- case 16:
- NumberReg = new Regex ("^[0-9a-f]*",
- RegexOptions.IgnoreCase);
- NumberMatch = NumberReg.Match (
- new string(Number, 0, NumChars));
- break;
- case 10:
- default:
- NumberReg = new Regex (
- "^[+-]?\\d*\\.?\\d*(e?[+-]?\\d*)",
- RegexOptions.IgnoreCase);
- NumberMatch = NumberReg.Match (
- new string(Number, 0, NumChars));
- break;
-
-
- }
-
- // we found a match, try to convert it
- if (NumberMatch.Success) {
- try {
- switch (Base) {
- case 10:
- return
- Convert.ToDouble (
- NumberMatch.Value);
- case 8:
- case 16:
- return (double)
- Convert.ToInt64 (
- NumberMatch.Value,
- Base);
- default:
- return (double)0;
- }
- }
- catch {
- throw new OverflowException();
- }
- }
- else {
- return (double)0;
- }
- }
-
- // Val on a char type is pretty simple '9' = 9, 'a' = exception
- public static int Val (char Expression) {
- if (char.IsDigit(Expression)) {
- return Expression - '0';
- }
- else {
- throw new ArgumentException();
- }
- }
-
- // if it's an object, and we can't convert
- // it to a string, it's an exception
- public static double Val (System.Object Expression) {
- // always check for null first
- if (Expression == null) {
- throw new ArgumentNullException ("Expression",
- "Value cannot be null");
- }
-
- try {
- return Val (CastToString (Expression));
- }
- catch {
- throw new ArgumentException(
- "Type of argument 'Expression' is '" +
- Expression.GetType().FullName +
- "', which can nt be converted to numeric.");
- }
- }
- // Events
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs
deleted file mode 100644
index 6d809db4923..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateAndTime.cs
+++ /dev/null
@@ -1,478 +0,0 @@
-//
-// DateAndTime.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-using System.Globalization;
-
-namespace Microsoft.VisualBasic
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class DateAndTime {
- public static string DateString {
- get {
- return DateTime.Today.ToString("MM-dd-yyyy");
- }
-
- set {
- string [] formats = { "M-d-yyyy", "M-d-y", "M/d/yyyy", "M/d/y" };
-
- try {
- DateTime dtToday = DateTime.ParseExact(value, formats,
- DateTimeFormatInfo.CurrentInfo,
- DateTimeStyles.None);
-
- Today = dtToday;
- }
- catch {
- throw new InvalidCastException();
- }
- }
- }
-
- public static System.DateTime Today {
- get { return DateTime.Today; }
- set {
- // FIXME: This needs to use some OS specific code
- // I've already written it for Windows
- // and Unix won't be hard, but need an
- // OS object from the compiler
- // OS specific code needs to check permissions
- // too, and throw an ArgumentOutOfRangeException
- // if no permissions
-// DateTime dtNow = DateTime.Now;
-//
-// SysTime.LocalTime = new DateTime(value.Year,
-// value.Month, value.Day, dtNow.Hour,
-// dtNow.Minute, dtNow.Second, dtNow.Millisecond);
- throw new NotImplementedException();
- }
- }
-
- public static double Timer {
- get {
- DateTime DTNow = DateTime.Now;
-
- return DTNow.Hour * 3600 + DTNow.Minute * 60 +
- DTNow.Second + DTNow.Millisecond /
- 1000D;
- }
- }
-
- public static System.DateTime Now {
- get { return DateTime.Now; }
- }
-
- public static System.DateTime TimeOfDay {
- get {
- TimeSpan TSpan = DateTime.Now.TimeOfDay;
-
- return new DateTime(1, 1, 1, TSpan.Hours,
- TSpan.Minutes, TSpan.Seconds,
- TSpan.Milliseconds);
- }
- set {
- // FIXME: This needs to use some OS specific code
- // I've already written it for Windows
- // and Unix won't be hard, but need an
- // OS object from the compiler
- // OS specific code needs to check permissions
- // too, and throw an ArgumentOutOfRangeException
- // if no permissions
-// DateTime dtToday = DateTime.Today;
-//
-// SysTime.LocalTime = new DateTime(dtToday.Year,
-// dtToday.Month, dtToday.Day, value.Hour,
-// value.Minute, value.Second, value.Millisecond);
- throw new NotImplementedException();
- }
- }
-
- public static string TimeString {
- get { return DateTime.Now.ToString("HH:mm:ss"); }
- set {
- string format = "HH:mm:ss";
-
- try {
- DateTime dtToday = DateTime.ParseExact(value, format,
- DateTimeFormatInfo.CurrentInfo,
- DateTimeStyles.None);
-
- TimeOfDay = dtToday;
- }
- catch {
- throw new InvalidCastException();
- }
- }
- }
-
- // Methods
- public static System.DateTime DateAdd (DateInterval Interval,
- double Number, System.DateTime DateValue) {
-
- switch (Interval) {
- case DateInterval.Year:
- return DateValue.AddYears((int)Number);
- case DateInterval.Quarter:
- return DateValue.AddMonths((int)Number * 3);
- case DateInterval.Month:
- return DateValue.AddMonths((int)Number);
- case DateInterval.WeekOfYear:
- return DateValue.AddDays(Number * 7);
- case DateInterval.Day:
- case DateInterval.DayOfYear:
- case DateInterval.Weekday:
- return DateValue.AddDays(Number);
- case DateInterval.Hour:
- return DateValue.AddHours(Number);
- case DateInterval.Minute:
- return DateValue.AddMinutes(Number);
- case DateInterval.Second:
- return DateValue.AddSeconds(Number);
- default:
- throw new ArgumentException();
- }
- }
-
- private static DayOfWeek GetDayRule(FirstDayOfWeek StartOfWeek, DayOfWeek DayRule)
- {
- switch (StartOfWeek) {
- case FirstDayOfWeek.System:
- return DayRule;
- case FirstDayOfWeek.Sunday:
- return DayOfWeek.Sunday;
- case FirstDayOfWeek.Monday:
- return DayOfWeek.Monday;
- case FirstDayOfWeek.Tuesday:
- return DayOfWeek.Tuesday;
- case FirstDayOfWeek.Wednesday:
- return DayOfWeek.Wednesday;
- case FirstDayOfWeek.Thursday:
- return DayOfWeek.Thursday;
- case FirstDayOfWeek.Friday:
- return DayOfWeek.Friday;
- case FirstDayOfWeek.Saturday:
- return DayOfWeek.Saturday;
- default:
- throw new ArgumentException();
- }
- }
-
- private static CalendarWeekRule GetWeekRule(FirstWeekOfYear StartOfYear, CalendarWeekRule WeekRule)
- {
- switch (StartOfYear) {
- case FirstWeekOfYear.System:
- return WeekRule;
- case FirstWeekOfYear.FirstFourDays:
- return CalendarWeekRule.FirstFourDayWeek;
- case FirstWeekOfYear.FirstFullWeek:
- return CalendarWeekRule.FirstFullWeek;
- case FirstWeekOfYear.Jan1:
- return CalendarWeekRule.FirstDay;
- default:
- throw new ArgumentException();
- }
- }
-
- public static long DateDiff (DateInterval Interval,
- System.DateTime Date1, System.DateTime Date2,
- [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
- FirstDayOfWeek StartOfWeek,
- [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
- FirstWeekOfYear StartOfYear)
- {
-
- int YearMonths;
- int YearQuarters;
- int YearWeeks;
- CalendarWeekRule WeekRule = CalendarWeekRule.FirstDay;
- DayOfWeek DayRule = DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek;
- Calendar CurCalendar = CultureInfo.CurrentCulture.Calendar;
-
- switch (Interval) {
- case DateInterval.Year:
- return Date2.Year - Date1.Year;
- case DateInterval.Quarter:
- YearQuarters = (Date2.Year - Date1.Year) * 4;
- return Date2.Month / 4 - Date1.Month / 4 + YearQuarters;
- case DateInterval.Month:
- YearMonths = (Date2.Year - Date1.Year) * 12;
- return Date2.Month - Date1.Month + YearMonths;
- case DateInterval.WeekOfYear:
- YearWeeks = (Date2.Year - Date1.Year) * 53;
- DayRule = GetDayRule(StartOfWeek, DayRule);
- WeekRule = GetWeekRule(StartOfYear, WeekRule);
- return CurCalendar.GetWeekOfYear(Date2, WeekRule, DayRule) -
- CurCalendar.GetWeekOfYear(Date1,WeekRule, DayRule) +
- YearWeeks;
- case DateInterval.Weekday:
- return ((TimeSpan)(Date2.Subtract(Date1))).Days / 7;
- case DateInterval.DayOfYear:
- case DateInterval.Day:
- return ((TimeSpan)(Date2.Subtract(Date1))).Days;
- case DateInterval.Hour:
- return ((TimeSpan)(Date2.Subtract(Date1))).Hours;
- case DateInterval.Minute:
- return ((TimeSpan)(Date2.Subtract(Date1))).Minutes;
- case DateInterval.Second:
- return ((TimeSpan)(Date2.Subtract(Date1))).Seconds;
- default:
- throw new ArgumentException();
- }
- }
-
- private static int ConvertWeekDay(DayOfWeek Day, int Offset)
- {
-
- int Weekday = (int)Day + Offset;
-
- if (Weekday > 7) {
- Weekday -= 7;
- }
-
- switch((DayOfWeek)Weekday) {
- case DayOfWeek.Sunday:
- return (int)FirstDayOfWeek.Sunday;
- case DayOfWeek.Monday:
- return (int)FirstDayOfWeek.Monday;
- case DayOfWeek.Tuesday:
- return (int)FirstDayOfWeek.Tuesday;
- case DayOfWeek.Wednesday:
- return (int)FirstDayOfWeek.Wednesday;
- case DayOfWeek.Thursday:
- return (int)FirstDayOfWeek.Thursday;
- case DayOfWeek.Friday:
- return (int)FirstDayOfWeek.Friday;
- case DayOfWeek.Saturday:
- return (int)FirstDayOfWeek.Saturday;
- default:
- throw new ArgumentException();
- }
-
- }
-
- public static int DatePart
- (
- Microsoft.VisualBasic.DateInterval Interval,
- System.DateTime DateValue,
- [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
- FirstDayOfWeek StartOfWeek,
- [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
- FirstWeekOfYear StartOfYear) {
-
- CalendarWeekRule WeekRule = CalendarWeekRule.FirstDay;
- DayOfWeek DayRule = DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek;
- Calendar CurCalendar = CultureInfo.CurrentCulture.Calendar;
-
- switch (Interval) {
- case DateInterval.Year:
- return DateValue.Year;
- case DateInterval.Quarter:
- return DateValue.Month / 4 + 1;
- case DateInterval.Month:
- return DateValue.Month;
- case DateInterval.WeekOfYear:
- DayRule = GetDayRule(StartOfWeek, DayRule);
- WeekRule = GetWeekRule(StartOfYear, WeekRule);
- return CurCalendar.GetWeekOfYear(DateValue, WeekRule, DayRule);
- case DateInterval.Weekday:
- return ConvertWeekDay(DateValue.DayOfWeek, (int)DayRule);
- case DateInterval.DayOfYear:
- return DateValue.DayOfYear;
- case DateInterval.Day:
- return DateValue.Day;
- case DateInterval.Hour:
- return DateValue.Hour;
- case DateInterval.Minute:
- return DateValue.Minute;
- case DateInterval.Second:
- return DateValue.Second;
- default:
- throw new ArgumentException();
- }
- }
-
- private static DateInterval DateIntervalFromString(string Interval)
- {
- switch (Interval) {
- case "yyyy":
- return DateInterval.Year;
- case "q":
- return DateInterval.Quarter;
- case "m":
- return DateInterval.Month;
- case "ww":
- return DateInterval.WeekOfYear;
- case "w":
- return DateInterval.Weekday;
- case "d":
- return DateInterval.Day;
- case "y":
- return DateInterval.DayOfYear;
- case "h":
- return DateInterval.Hour;
- case "n":
- return DateInterval.Minute;
- case "s":
- return DateInterval.Second;
- default:
- throw new ArgumentException();
- }
- }
-
- public static System.DateTime DateAdd (string Interval,
- double Number, System.Object DateValue)
- {
- if (DateValue == null) {
- throw new ArgumentNullException("DateValue", "Value can not be null.");
- }
- if (!(DateValue is DateTime)) {
- throw new InvalidCastException();
- }
-
- return DateAdd(DateIntervalFromString(Interval), Number, (DateTime)DateValue);
- }
-
- public static System.Int64 DateDiff (string Interval,
- System.Object Date1, System.Object Date2,
- [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
- FirstDayOfWeek StartOfWeek,
- [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
- FirstWeekOfYear StartOfYear)
- {
- if (Date1 == null) {
- throw new ArgumentNullException("Date1", "Value can not be null.");
- }
- if (Date2 == null) {
- throw new ArgumentNullException("Date2", "Value can not be null.");
- }
- if (!(Date1 is DateTime)) {
- throw new InvalidCastException();
- }
- if (!(Date2 is DateTime)) {
- throw new InvalidCastException();
- }
-
- return DateDiff(DateIntervalFromString(Interval), (DateTime)Date1,
- (DateTime)Date2, StartOfWeek, StartOfYear);
-
- }
-
- public static System.Int32 DatePart (string Interval,
- System.Object DateValue,
- [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
- FirstDayOfWeek StartOfWeek,
- [Optional] [DefaultValue(FirstWeekOfYear.Jan1)]
- FirstWeekOfYear StartOfYear)
- {
- if (DateValue == null) {
- throw new ArgumentNullException("DateValue", "Value can not be null.");
- }
- if (!(DateValue is DateTime)) {
- throw new InvalidCastException();
- }
-
-
- return DatePart(DateIntervalFromString(Interval),
- (DateTime)DateValue, StartOfWeek, StartOfYear);
- }
-
- public static System.DateTime DateSerial (int Year, int Month, int Day)
- {
- return new DateTime(Year, Month, Day);
- }
-
- public static System.DateTime TimeSerial (int Hour, int Minute, int Second)
- {
- return new DateTime(1, 1, 1, Hour, Minute, Second);
- }
-
- public static System.DateTime DateValue (string StringDate)
- {
- return DateTime.Parse(StringDate);
- }
-
- public static System.DateTime TimeValue (string StringTime)
- {
- return DateTime.Parse(StringTime);
- }
-
- public static int Year (System.DateTime DateValue)
- {
- return DateValue.Year;
- }
-
- public static int Month (System.DateTime DateValue)
- {
- return DateValue.Month;
- }
-
- public static int Day (System.DateTime DateValue)
- {
- return DateValue.Day;
- }
-
- public static int Hour (System.DateTime TimeValue)
- {
- return TimeValue.Hour;
- }
-
- public static int Minute (System.DateTime TimeValue)
- {
- return TimeValue.Minute;
- }
-
- public static int Second (System.DateTime TimeValue)
- {
- return TimeValue.Second;
- }
-
- public static int Weekday (System.DateTime DateValue,
- [Optional] [DefaultValue(FirstDayOfWeek.Sunday)]
- FirstDayOfWeek StartOfWeek)
- {
- return DatePart(DateInterval.Weekday, DateValue, StartOfWeek, FirstWeekOfYear.System);
- }
-
- public static System.String MonthName (int Month,
- [Optional] [DefaultValue(false)] bool Abbreviate)
- {
- if (Month < 1 || Month > 13) {
- throw new ArgumentException();
- }
- if (Abbreviate) {
- return CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedMonthName(Month);
- }
- else {
- return CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Month);
- }
- }
-
- public static System.String WeekdayName (int Weekday,
- [Optional] [DefaultValue(false)] System.Boolean Abbreviate,
- [Optional] [DefaultValue(FirstDayOfWeek.System)]
- FirstDayOfWeek FirstDayOfWeekValue)
- {
- if (Weekday < 1 || Weekday > 7) {
- throw new ArgumentException();
- }
- Weekday += (int)FirstDayOfWeekValue;
- if (Weekday > 7) {
- Weekday -= 7;
- }
- if (Abbreviate) {
- return CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedDayName((DayOfWeek)Weekday);
- }
- else {
- return CultureInfo.CurrentCulture.DateTimeFormat.GetDayName((DayOfWeek)Weekday);
- }
- }
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs
deleted file mode 100644
index 9ffcd7ebf10..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateFormat.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// DateFormat.cs
-//
-// Author:
-// Martin Adoue (martin@cwanet.com)
-//
-// (C) 2002 Martin Adoue
-//
-namespace Microsoft.VisualBasic {
-
- /// <summary>
- /// When you call the DateValue function, you can use the following
- /// enumeration members in your code in place of the actual values.
- /// </summary>
- public enum DateFormat : int {
- /// <summary>
- /// For real numbers, displays a date and time. If the number has no fractional part, displays only a date. If the number has no integer part, displays time only. Date and time display is determined by your computer's regional settings.
- /// </summary>
- GeneralDate = 0,
- /// <summary>
- /// Displays a date using the long-date format specified in your computer's regional settings.
- /// </summary>
- LongDate = 1,
- /// <summary>
- /// Displays a date using the short-date format specified in your computer's regional settings.
- /// </summary>
- ShortDate = 2,
- /// <summary>
- /// Displays a time using the long-time format specified in your computer's regional settings.
- /// </summary>
- LongTime = 3,
- /// <summary>
- /// Displays a time using the short-time format specified in your computer's regional settings.
- /// </summary>
- ShortTime = 4
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs
deleted file mode 100644
index 2c86a14733e..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DateInterval.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// DateInterval.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum DateInterval : int {
- Year = 0,
- Quarter = 1,
- Month = 2,
- DayOfYear = 3,
- Day = 4,
- WeekOfYear = 5,
- Weekday = 6,
- Hour = 7,
- Minute = 8,
- Second = 9
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs
deleted file mode 100644
index 82bc60f988e..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/DueDate.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// DueDate.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum DueDate : int {
- EndOfPeriod = 0,
- BegOfPeriod = 1
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs
deleted file mode 100644
index 8883f938833..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/ErrObject.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// ErrObject.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- sealed public class ErrObject {
- // Declarations
- // Constructors
- // Properties
- [MonoTODO]
- public System.Int32 HelpContext { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.Int32 LastDllError { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.Int32 Number { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.Int32 Erl { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.String Source { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.String HelpFile { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.String Description { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
- // Methods
- [MonoTODO]
- public System.Exception GetException () { throw new NotImplementedException (); }
- [MonoTODO]
- public void Clear () { throw new NotImplementedException (); }
- [MonoTODO]
- public void Raise (System.Int32 Number, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Source, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Description, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpFile, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object HelpContext) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs
deleted file mode 100644
index 96dc29a3f4e..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// FileAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- [System.FlagsAttribute]
- public enum FileAttribute : int {
- Normal = 0,
- ReadOnly = 1,
- Hidden = 2,
- System = 4,
- Volume = 8,
- Directory = 16,
- Archive = 32
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs
deleted file mode 100644
index 80cc1a297d8..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FileSystem.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-//
-// FileSystem.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class FileSystem {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static void ChDir (System.String Path) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void ChDrive (System.Char Drive) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void ChDrive (System.String Drive) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String CurDir () { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String CurDir (System.Char Drive) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String Dir () { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String Dir (System.String Pathname, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void MkDir (System.String Path) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void RmDir (System.String Path) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileCopy (System.String Source, System.String Destination) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.DateTime FileDateTime (System.String PathName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int64 FileLen (System.String PathName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static Microsoft.VisualBasic.FileAttribute GetAttr (System.String PathName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Kill (System.String PathName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void SetAttr (System.String PathName, Microsoft.VisualBasic.FileAttribute Attributes) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileOpen (System.Int32 FileNumber, System.String FileName, Microsoft.VisualBasic.OpenMode Mode, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenAccess Access, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] Microsoft.VisualBasic.OpenShare Share, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 RecordLength) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileClose (params System.Int32[] FileNumbers) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGetObject (System.Int32 FileNumber, ref System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] ref System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileGet (System.Int32 FileNumber, ref System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] ref System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePutObject (System.Int32 FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- [System.ObsoleteAttribute("Use FilePutObject to write Object types, or coerce FileNumber and RecordNumber to Integer for writing non-Object types", false)]
- public static void FilePut (System.Object FileNumber, System.Object Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Object RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.ValueType Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Array Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean ArrayIsDynamic, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Boolean Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Byte Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Int16 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Int32 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Int64 Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Char Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Single Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Double Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.Decimal Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.String Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean StringIsFixedLength) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FilePut (System.Int32 FileNumber, System.DateTime Value, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int64 RecordNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Print (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void PrintLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Object Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Boolean Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Byte Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Int16 Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Int32 Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Int64 Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Char Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Single Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Double Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.Decimal Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.String Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Input (System.Int32 FileNumber, ref System.DateTime Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Write (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void WriteLine (System.Int32 FileNumber, params System.Object[] Output) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String InputString (System.Int32 FileNumber, System.Int32 CharCount) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String LineInput (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Lock (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Lock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Lock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Unlock (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Unlock (System.Int32 FileNumber, System.Int64 Record) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Unlock (System.Int32 FileNumber, System.Int64 FromRecord, System.Int64 ToRecord) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void FileWidth (System.Int32 FileNumber, System.Int32 RecordWidth) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int32 FreeFile () { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Seek (System.Int32 FileNumber, System.Int64 Position) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int64 Seek (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean EOF (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int64 Loc (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int64 LOF (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static Microsoft.VisualBasic.TabInfo TAB () { throw new NotImplementedException (); }
- [MonoTODO]
- public static Microsoft.VisualBasic.TabInfo TAB (System.Int16 Column) { throw new NotImplementedException (); }
- [MonoTODO]
- public static Microsoft.VisualBasic.SpcInfo SPC (System.Int16 Count) { throw new NotImplementedException (); }
- [MonoTODO]
- public static Microsoft.VisualBasic.OpenMode FileAttr (System.Int32 FileNumber) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Reset () { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Rename (System.String OldPath, System.String NewPath) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs
deleted file mode 100644
index 613c49ea716..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Financial.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Financial.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class Financial {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.Double DDB (System.Double Cost, System.Double Salvage, System.Double Life, System.Double Period, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(2)] System.Double Factor) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double FV (System.Double Rate, System.Double NPer, System.Double Pmt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double IPmt (System.Double Rate, System.Double Per, System.Double NPer, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double IRR (ref System.Double[] ValueArray, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0.1)] ref System.Double Guess) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double MIRR (ref System.Double[] ValueArray, ref System.Double FinanceRate, ref System.Double ReinvestRate) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double NPer (System.Double Rate, System.Double Pmt, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double NPV (System.Double Rate, ref System.Double[] ValueArray) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double Pmt (System.Double Rate, System.Double NPer, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double PPmt (System.Double Rate, System.Double Per, System.Double NPer, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double PV (System.Double Rate, System.Double NPer, System.Double Pmt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double Rate (System.Double NPer, System.Double Pmt, System.Double PV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] System.Double FV, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.DueDate Due, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0.1)] System.Double Guess) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double SLN (System.Double Cost, System.Double Salvage, System.Double Life) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double SYD (System.Double Cost, System.Double Salvage, System.Double Life, System.Double Period) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs
deleted file mode 100644
index 05cf55c0c35..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstDayOfWeek.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// FirstDayOfWeek.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum FirstDayOfWeek : int {
- System = 0,
- Sunday = 1,
- Monday = 2,
- Tuesday = 3,
- Wednesday = 4,
- Thursday = 5,
- Friday = 6,
- Saturday = 7
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs
deleted file mode 100644
index 035e5bd5feb..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/FirstWeekOfYear.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// FirstWeekOfYear.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum FirstWeekOfYear : int {
- System = 0,
- Jan1 = 1,
- FirstFourDays = 2,
- FirstFullWeek = 3
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs
deleted file mode 100644
index 2c89b994d4e..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Globals.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// Globals.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class Globals {
- // Declarations
- // Constructors
- // Properties
- [MonoTODO]
- public static System.String ScriptEngine { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public static System.Int32 ScriptEngineMajorVersion { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public static System.Int32 ScriptEngineMinorVersion { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public static System.Int32 ScriptEngineBuildVersion { get { throw new NotImplementedException (); } }
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs
deleted file mode 100644
index 165fbad52e0..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Information.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Information.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class Information {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static Microsoft.VisualBasic.ErrObject Err () { throw new NotImplementedException (); }
- [MonoTODO]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- public static System.Int32 Erl () { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean IsArray (System.Object VarName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean IsDate (System.Object Expression) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean IsDBNull (System.Object Expression) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean IsNothing (System.Object Expression) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean IsError (System.Object Expression) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean IsReference (System.Object Expression) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean IsNumeric (System.Object Expression) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int32 LBound (System.Array Array, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(1)] System.Int32 Rank) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int32 UBound (System.Array Array, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(1)] System.Int32 Rank) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String TypeName (System.Object VarName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String SystemTypeName (System.String VbName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String VbTypeName (System.String UrtName) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int32 QBColor (System.Int32 Color) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int32 RGB (System.Int32 Red, System.Int32 Green, System.Int32 Blue) { throw new NotImplementedException (); }
- [MonoTODO]
- public static Microsoft.VisualBasic.VariantType VarType (System.Object VarName) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
deleted file mode 100644
index ad17f86ceef..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Interaction.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
- sealed public class Interaction {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Int32 Shell (System.String Pathname, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(2)] Microsoft.VisualBasic.AppWinStyle Style, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(false)] System.Boolean Wait, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 Timeout) { return 0;}
- public static void AppActivate (System.Int32 ProcessId) { }
- public static void AppActivate (System.String Title) { }
- public static System.String Command () { return "";}
- public static System.String Environ (System.Int32 Expression) { return "";}
- public static System.String Environ (System.String Expression) { return "";}
- public static void Beep () { }
- public static System.String InputBox (System.String Prompt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String Title, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String DefaultResponse, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 XPos, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(-1)] System.Int32 YPos) { return "";}
- public static Microsoft.VisualBasic.MsgBoxResult MsgBox (System.Object Prompt, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(0)] Microsoft.VisualBasic.MsgBoxStyle Buttons, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.Object Title) { return 0;}
- public static System.Object CallByName (System.Object ObjectRef, System.String ProcName, Microsoft.VisualBasic.CallType UseCallType, params System.Object[] Args) { return null;}
- public static System.Object Choose (System.Double Index, params System.Object[] Choice) { return null;}
- public static System.Object IIf (System.Boolean Expression, System.Object TruePart, System.Object FalsePart) { return null;}
- public static System.String Partition (System.Int64 Number, System.Int64 Start, System.Int64 Stop, System.Int64 Interval) { return "";}
- public static System.Object Switch (params System.Object[] VarExpr) { return null;}
- public static void DeleteSetting (System.String AppName, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String Section, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String Key) { }
- public static System.String[,] GetAllSettings (System.String AppName, System.String Section) { return null;}
- public static System.String GetSetting (System.String AppName, System.String Section, System.String Key, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String Default) { return "";}
- public static void SaveSetting (System.String AppName, System.String Section, System.String Key, System.String Setting) { }
- public static System.Object CreateObject (System.String ProgId, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue("")] System.String ServerName) { return null;}
- public static System.Object GetObject ([System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String PathName, [System.Runtime.InteropServices.Optional] [System.ComponentModel.DefaultValue(null)] System.String Class) { return null;}
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs
deleted file mode 100644
index d64b642912f..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/BooleanType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// BooleanType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class BooleanType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Boolean FromString (System.String Value) { return System.Boolean.Parse(Value); }
- [MonoTODO]
- public static System.Boolean FromObject (System.Object Value) { throw new NotImplementedException(); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs
deleted file mode 100644
index 631a19665c2..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ByteType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// ByteType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class ByteType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Byte FromString (System.String Value) { return System.Byte.Parse(Value); }
- [MonoTODO]
- public static System.Byte FromObject (System.Object Value) { throw new NotImplementedException(); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs
deleted file mode 100644
index 0ff4c50c3b5..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharArrayType.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// CharArrayType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class CharArrayType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.Char[] FromString (System.String Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Char[] FromObject (System.Object Value) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs
deleted file mode 100644
index a493a84f45c..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/CharType.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// CharType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class CharType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.Char FromString (System.String Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Char FromObject (System.Object Value) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs
deleted file mode 100644
index 4acff1409e9..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DateType.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// DateType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class DateType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.DateTime FromString (System.String Value) { return System.DateTime.Parse(Value); }
- [MonoTODO]
- public static System.DateTime FromString (System.String Value, System.Globalization.CultureInfo culture) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.DateTime FromObject (System.Object Value) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs
deleted file mode 100644
index 670f406f42b..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DecimalType.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// DecimalType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class DecimalType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.Decimal FromBoolean (System.Boolean Value) { throw new NotImplementedException (); }
- public static System.Decimal FromString (System.String Value) { return System.Decimal.Parse(Value); }
- [MonoTODO]
- public static System.Decimal FromString (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Decimal FromObject (System.Object Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Decimal FromObject (System.Object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Decimal Parse (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs
deleted file mode 100644
index 1d0e2b99fa3..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/DoubleType.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// DoubleType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class DoubleType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Double FromString (System.String Value) { return System.Double.Parse(Value); }
- [MonoTODO]
- public static System.Double FromString (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double FromObject (System.Object Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Double FromObject (System.Object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- public static System.Double Parse (System.String Value) { return System.Double.Parse(Value); }
- [MonoTODO]
- public static System.Double Parse (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs
deleted file mode 100644
index 03442b7382f..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ExceptionUtils.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// ExceptionUtils.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic.CompilerServices {
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
- sealed public class ExceptionUtils {
- // Declarations
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
deleted file mode 100644
index 50f5ff3b23f..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// FlowControl.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class FlowControl {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.Boolean ForNextCheckR4 (System.Single count, System.Single limit, System.Single StepValue) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean ForNextCheckR8 (System.Double count, System.Double limit, System.Double StepValue) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean ForNextCheckDec (System.Decimal count, System.Decimal limit, System.Decimal StepValue) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean ForLoopInitObj (System.Object Counter, System.Object Start, System.Object Limit, System.Object StepValue, ref System.Object LoopForResult, ref System.Object CounterResult) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean ForNextCheckObj (System.Object Counter, System.Object LoopObj, ref System.Object CounterResult) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Collections.IEnumerator ForEachInArr (System.Array ary) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Collections.IEnumerator ForEachInObj (System.Object obj) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean ForEachNextObj (ref System.Object obj, ref System.Collections.IEnumerator enumerator) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void CheckForSyncLockOnValueType (System.Object obj) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs
deleted file mode 100644
index 49145ede7e9..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/HostServices.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// HostServices.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class HostServices {
- // Declarations
- // Constructors
- // Properties
- [MonoTODO]
- public static Microsoft.VisualBasic.CompilerServices.IVbHost VBHost { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs
deleted file mode 100644
index abff24de804..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IVbHost.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// IVbHost.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic.CompilerServices {
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- public interface IVbHost {
- // Declarations
- // Constructors
- // Properties
- // Methods
- System.String GetWindowTitle ();
- // System.Windows.Forms.IWin32Window GetParentWindow ();
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs
deleted file mode 100644
index e22ac728bc1..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IncompleteInitialization.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// IncompleteInitialization.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic.CompilerServices {
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [MonoTODO]
- sealed public class IncompleteInitialization : System.Exception, System.Runtime.Serialization.ISerializable {
- // Declarations
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs
deleted file mode 100644
index 14330f9a368..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/IntegerType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// IntegerType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class IntegerType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Int32 FromString (System.String Value) { return System.Int32.Parse(Value); }
- [MonoTODO]
- public static System.Int32 FromObject (System.Object Value) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs
deleted file mode 100644
index 22ce2f3faf3..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LateBinding.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// LateBinding.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class LateBinding {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- [System.Diagnostics.DebuggerHiddenAttribute]
- [System.Diagnostics.DebuggerStepThroughAttribute]
- public static System.Object LateGet (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames, System.Boolean[] CopyBack) { throw new NotImplementedException (); }
- [MonoTODO]
- [System.Diagnostics.DebuggerStepThroughAttribute]
- [System.Diagnostics.DebuggerHiddenAttribute]
- public static void LateSetComplex (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames, System.Boolean OptimisticSet, System.Boolean RValueBase) { throw new NotImplementedException (); }
- [MonoTODO]
- [System.Diagnostics.DebuggerStepThroughAttribute]
- [System.Diagnostics.DebuggerHiddenAttribute]
- public static void LateSet (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames) { throw new NotImplementedException (); }
- [MonoTODO]
- [System.Diagnostics.DebuggerStepThroughAttribute]
- [System.Diagnostics.DebuggerHiddenAttribute]
- public static System.Object LateIndexGet (System.Object o, System.Object[] args, System.String[] paramnames) { throw new NotImplementedException (); }
- [MonoTODO]
- [System.Diagnostics.DebuggerHiddenAttribute]
- [System.Diagnostics.DebuggerStepThroughAttribute]
- public static void LateIndexSetComplex (System.Object o, System.Object[] args, System.String[] paramnames, System.Boolean OptimisticSet, System.Boolean RValueBase) { throw new NotImplementedException (); }
- [MonoTODO]
- [System.Diagnostics.DebuggerStepThroughAttribute]
- [System.Diagnostics.DebuggerHiddenAttribute]
- public static void LateIndexSet (System.Object o, System.Object[] args, System.String[] paramnames) { throw new NotImplementedException (); }
- [MonoTODO]
- [System.Diagnostics.DebuggerStepThroughAttribute]
- [System.Diagnostics.DebuggerHiddenAttribute]
- public static void LateCall (System.Object o, System.Type objType, System.String name, System.Object[] args, System.String[] paramnames, System.Boolean[] CopyBack) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs
deleted file mode 100644
index e90edd154c6..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/LongType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// LongType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class LongType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Int64 FromString (System.String Value) { return System.Int64.Parse(Value); }
- [MonoTODO]
- public static System.Int64 FromObject (System.Object Value) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs
deleted file mode 100644
index c709c80f44e..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// ObjectType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class ObjectType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.Int32 ObjTst (System.Object o1, System.Object o2, System.Boolean TextCompare) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object PlusObj (System.Object obj) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object NegObj (System.Object obj) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object NotObj (System.Object obj) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object BitAndObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object BitOrObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object BitXorObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object AddObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object SubObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object MulObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object DivObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object PowObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object ModObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object IDivObj (System.Object o1, System.Object o2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object XorObj (System.Object obj1, System.Object obj2) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean LikeObj (System.Object vLeft, System.Object vRight, Microsoft.VisualBasic.CompareMethod CompareOption) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object StrCatObj (System.Object vLeft, System.Object vRight) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object GetObjectValuePrimitive (System.Object o) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs
deleted file mode 100644
index ab0fbca18cb..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionCompareAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// OptionCompareAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-// Martin Adoue (martin@cwanet.com)
-//
-// (C) 2002 Ximian Inc.
-//
-using System;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.VisualBasic.CompilerServices {
- [MonoTODO]
- [EditorBrowsable(EditorBrowsableState.Never)]
- [AttributeUsage(AttributeTargets.Parameter)]
- [StructLayoutAttribute(LayoutKind.Auto)]
- sealed public class OptionCompareAttribute : Attribute {
- // Declarations
- // Constructors
- // Properties
- // Methods
- // Events
- public OptionCompareAttribute()
- {
- //FIXME: should this do something?
- throw new NotImplementedException();
- }
- };
-
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs
deleted file mode 100644
index 97ac0cc262f..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/OptionTextAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// OptionTextAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic.CompilerServices {
- [System.AttributeUsageAttribute(System.AttributeTargets.Class)]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [MonoTODO]
- sealed public class OptionTextAttribute : System.Attribute {
- // Declarations
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs
deleted file mode 100644
index d56bbabf583..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ProjectData.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// ProjectData.cs
-//
-// Authors:
-// Martin Adoue (martin@cwanet.com)
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Ximian Inc.
-//
-
-using System;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- /// <summary>
- /// FIXME: Summary description for ProjectData.
- /// </summary>
-
- [MonoTODO]
- [EditorBrowsable(EditorBrowsableState.Never)]
- [StructLayout(LayoutKind.Auto)]
- public class ProjectData{
-
- private static System.Exception projectError;
- private static int erl;
-
- /// <summary>
- /// FIXME: Summary description for ClearProjectError
- /// </summary>
- public static void ClearProjectError()
- {
- projectError = null;
- erl = 0;
- }
-
- /// <summary>
- /// FIXME: Summary description for SetProjectError
- /// </summary>
- /// <param name="ex">FIXME: Required. Summary description for ex</param>
- [MonoTODO]
- public static void SetProjectError(System.Exception ex)
- {
- SetProjectError(ex, 0);
- }
-
- /// <summary>
- /// FIXME: Summary description for SetProjectError
- /// </summary>
- /// <param name="ex">FIXME: Required. Summary description for ex</param>
- /// <param name="lErl">FIXME: Required. Summary description for lErl</param>
- [MonoTODO]
- public static void SetProjectError(System.Exception ex, int lErl)
- {
- projectError = ex;
- erl = lErl;
-
- }
-
- /*
- [MonoTODO]
- public static void EndApp()
- {
- //FIXME
- }
- */
-
- /*
- [MonoTODO]
- protected static void Finalize()
- {
- //FIXME
- }
- */
-
-
-
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs
deleted file mode 100644
index a06e424af7c..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ShortType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// ShortType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- sealed public class ShortType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Int16 FromString (System.String Value) { return System.Int16.Parse(Value); }
- [MonoTODO]
- public static System.Int16 FromObject (System.Object Value) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs
deleted file mode 100644
index 134db71e4d4..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/SingleType.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// SingleType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class SingleType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- public static System.Single FromString (System.String Value) { return System.Single.Parse(Value); }
- [MonoTODO]
- public static System.Single FromString (System.String Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Single FromObject (System.Object Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Single FromObject (System.Object Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs
deleted file mode 100644
index 0da5cc2b145..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StandardModuleAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// StandardModuleAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic.CompilerServices {
- [System.AttributeUsageAttribute(System.AttributeTargets.Class)]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
- sealed public class StandardModuleAttribute : System.Attribute {
- // Declarations
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs
deleted file mode 100644
index 42fa6300a68..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StaticLocalInitFlag.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// StaticLocalInitFlag.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic.CompilerServices {
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Auto)]
- sealed public class StaticLocalInitFlag {
- // Declarations
- public System.Int16 State = (System.Int16)(0);
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs
deleted file mode 100644
index e4148aba258..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// StringType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class StringType {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.String FromBoolean (System.Boolean Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromByte (System.Byte Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromChar (System.Char Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromShort (System.Int16 Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromInteger (System.Int32 Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromLong (System.Int64 Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromSingle (System.Single Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromDouble (System.Double Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromSingle (System.Single Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromDouble (System.Double Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromDate (System.DateTime Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromDecimal (System.Decimal Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromDecimal (System.Decimal Value, System.Globalization.NumberFormatInfo NumberFormat) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String FromObject (System.Object Value) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Int32 StrCmp (System.String sLeft, System.String sRight, System.Boolean TextCompare) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean StrLike (System.String Source, System.String Pattern, Microsoft.VisualBasic.CompareMethod CompareOption) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean StrLikeBinary (System.String Source, System.String Pattern) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Boolean StrLikeText (System.String Source, System.String Pattern) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void MidStmtStr (ref System.String sDest, ref System.Int32 StartPosition, ref System.Int32 MaxInsertLength, ref System.String sInsert) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs
deleted file mode 100644
index fe572f886c7..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/TODOAttribute.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- public class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs
deleted file mode 100644
index 6d13fa195a2..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// Utils.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic.CompilerServices
-{
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class Utils {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static void ThrowException (System.Int32 hr) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Object SetCultureInfo (System.Globalization.CultureInfo Culture) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Array CopyArray (System.Array arySrc, System.Array aryDest) { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.String MethodToString (System.Reflection.MethodBase Method) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs
deleted file mode 100644
index 2f2094c748b..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxResult.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// MsgBoxResult.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum MsgBoxResult : int {
- OK = 1,
- Cancel = 2,
- Abort = 3,
- Retry = 4,
- Ignore = 5,
- Yes = 6,
- No = 7
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs
deleted file mode 100644
index 91042bcdb93..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/MsgBoxStyle.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// MsgBoxStyle.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- [System.FlagsAttribute]
- public enum MsgBoxStyle : int {
- ApplicationModal = 0,
- DefaultButton1 = 0,
- OKOnly = 0,
- OKCancel = 1,
- AbortRetryIgnore = 2,
- YesNoCancel = 3,
- YesNo = 4,
- RetryCancel = 5,
- Critical = 16,
- Question = 32,
- Exclamation = 48,
- Information = 64,
- DefaultButton2 = 256,
- DefaultButton3 = 512,
- SystemModal = 4096,
- MsgBoxHelp = 16384,
- MsgBoxSetForeground = 65536,
- MsgBoxRight = 524288,
- MsgBoxRtlReading = 1048576
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs
deleted file mode 100644
index 0db6fd0ccae..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenAccess.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// OpenAccess.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum OpenAccess : int {
- Read = 1,
- Write = 2,
- ReadWrite = 3,
- Default = -1
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs
deleted file mode 100644
index 4374a0bccdc..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenMode.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// OpenMode.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum OpenMode : int {
- Input = 1,
- Output = 2,
- Random = 4,
- Append = 8,
- Binary = 32
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs
deleted file mode 100644
index 02d828f8188..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/OpenShare.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// OpenShare.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum OpenShare : int {
- LockReadWrite = 0,
- LockWrite = 1,
- LockRead = 2,
- Shared = 3,
- Default = -1
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs
deleted file mode 100644
index 65b3d2bba5c..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/SpcInfo.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// SpcInfo.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [MonoTODO]
- public struct SpcInfo {
- // Declarations
- public System.Int16 Count;
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs
deleted file mode 100644
index 838089f4673..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Strings.cs
+++ /dev/null
@@ -1,1110 +0,0 @@
-//
-// Strings.cs
-//
-// Authors:
-// Martin Adoue (martin@cwanet.com)
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Ximian Inc.
-//
-
-using System;
-using System.Text;
-using System.ComponentModel;
-
-using System.Runtime.InteropServices;
-using Microsoft.VisualBasic.CompilerServices;
-
-namespace Microsoft.VisualBasic
-{
- /// <summary>
- /// The Strings module contains procedures used to perform string operations.
- /// </summary>
-
- [StandardModule]
- [StructLayout(LayoutKind.Auto)]
- public class Strings
- {
- private Strings()
- {
- //Do nothing. Nobody should be creating this.
- }
-
-
- /// <summary>
- /// Returns an Integer value representing the character code corresponding to a character.
- /// </summary>
- /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
- [MonoTODO]
- public static int Asc(char String)
- {
- //FIXME: Check the docs, it says something about Locales, DBCS, etc.
- throw new NotImplementedException();
- }
-
-
-
- /// <summary>
- /// Returns an Integer value representing the character code corresponding to a character.
- /// </summary>
- /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
- [MonoTODO]
- public static int Asc(string String)
- {
- if ((String == null) || (String.Length != 1))
- throw new ArgumentException("Length of argument 'String' must be one.", "String");
-
- //FIXME: Check the docs, it says something about Locales, DBCS, etc.
- return (int) String.ToCharArray(0, 1)[0];
- //why? check http://bugzilla.ximian.com/show_bug.cgi?id=23540
- }
-
-
- /// <summary>
- /// Returns an Integer value representing the character code corresponding to a character.
- /// </summary>
- /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
- [MonoTODO("Needs testing")]
- public static int AscW(char String)
- {
- /*
- * AscW returns the Unicode code point for the input character.
- * This can be 0 through 65535. The returned value is independent
- * of the culture and code page settings for the current thread.
- */
-
- return (int) String;
- }
-
- /// <summary>
- /// Returns an Integer value representing the character code corresponding to a character.
- /// </summary>
- /// <param name="String">Required. Any valid Char or String expression. If String is a String expression, only the first character of the string is used for input. If String is Nothing or contains no characters, an ArgumentException error occurs.</param>
- [MonoTODO("Needs testing")]
- public static int AscW(string String)
- {
- /*
- * AscW returns the Unicode code point for the input character.
- * This can be 0 through 65535. The returned value is independent
- * of the culture and code page settings for the current thread.
- */
- if ((String == null) || (String.Length == 0))
- throw new ArgumentException("Length of argument 'String' must be at leasr one.", "String");
- return (int) String.ToCharArray(0, 1)[0];
-
- }
-
- /// <summary>
- /// Returns the character associated with the specified character code.
- /// </summary>
- /// <param name="CharCode">Required. An Integer expression representing the code point, or character code, for the character. If CharCode is outside the range -32768 through 65535, an ArgumentException error occurs.</param>
- [MonoTODO]
- public static char Chr(int CharCode)
- {
-
- // According to docs (ms-help://MS.VSCC/MS.MSDNVS/vblr7/html/vafctchr.htm)
- // Chr and ChrW should throw ArgumentException if ((CharCode < -32768) || (CharCode > 65535))
- // Instead, VB.net throws an OverflowException. I'm following the implementation
- // instead of the docs.
-
- if ((CharCode < -32768) || (CharCode > 65535))
- throw new OverflowException("Value was either too large or too small for a character.");
-
- //FIXME: Check the docs, it says something about Locales, DBCS, etc.
- return System.Convert.ToChar(CharCode);
- }
-
- /// <summary>
- /// Returns the character associated with the specified character code.
- /// </summary>
- /// <param name="CharCode">Required. An Integer expression representing the code point, or character code, for the character. If CharCode is outside the range -32768 through 65535, an ArgumentException error occurs.</param>
- [MonoTODO("Needs testing")]
- public static char ChrW(int CharCode )
- {
- /*
- * According to docs ()
- * Chr and ChrW should throw ArgumentException if ((CharCode < -32768) || (CharCode > 65535))
- * Instead, VB.net throws an OverflowException. I'm following the implementation
- * instead of the docs
- */
- if ((CharCode < -32768) || (CharCode > 65535))
- throw new OverflowException("Value was either too large or too small for a character.");
-
- /*
- * ChrW takes CharCode as a Unicode code point. The range is independent of the
- * culture and code page settings for the current thread. Values from -32768 through
- * -1 are treated the same as values in the range +32768 through +65535.
- */
- if (CharCode < 0)
- CharCode += 0x10000;
-
- return System.Convert.ToChar(CharCode);
- }
-
- /// <summary>
- /// Returns a zero-based array containing a subset of a String array based on specified filter criteria.
- /// </summary>
- /// <param name="Source">Required. One-dimensional array of strings to be searched.</param>
- /// <param name="Match">Required. String to search for.</param>
- /// <param name="Include">Optional. Boolean value indicating whether to return substrings that include or exclude Match. If Include is True, the Filter function returns the subset of the array that contains Match as a substring. If Include is False, the Filter function returns the subset of the array that does not contain Match as a substring.</param>
- /// <param name="Compare">Optional. Numeric value indicating the kind of string comparison to use. See Settings for values.</param>
- [MonoTODO("Needs testing")]
- public static string[] Filter(object[] Source,
- string Match,
- [Optional]
- [DefaultValue(true)]
- bool Include,
- [OptionCompare] [Optional]
- [DefaultValue(CompareMethod.Binary)]
- CompareMethod Compare)
- {
-
- if (Source == null)
- throw new ArgumentException("Argument 'Source' can not be null.", "Source");
- if (Source.Rank > 1)
- throw new ArgumentException("Argument 'Source' can have only one dimension.", "Source");
-
- string[] strings;
- strings = new string[Source.Length];
-
- Source.CopyTo(strings, 0);
- return Filter(strings, Match, Include, Compare);
-
- }
-
- /// <summary>
- /// Returns a zero-based array containing a subset of a String array based on specified filter criteria.
- /// </summary>
- /// <param name="Source">Required. One-dimensional array of strings to be searched.</param>
- /// <param name="Match">Required. String to search for.</param>
- /// <param name="Include">Optional. Boolean value indicating whether to return substrings that include or exclude Match. If Include is True, the Filter function returns the subset of the array that contains Match as a substring. If Include is False, the Filter function returns the subset of the array that does not contain Match as a substring.</param>
- /// <param name="Compare">Optional. Numeric value indicating the kind of string comparison to use. See Settings for values.</param>
- public static string[] Filter(string[] Source,
- string Match,
- [Optional]
- [DefaultValue(true)]
- bool Include,
- [Optional]
- [DefaultValue(CompareMethod.Binary)]
- CompareMethod Compare)
- {
-
- if (Source == null)
- throw new ArgumentException("Argument 'Source' can not be null.", "Source");
- if (Source.Rank > 1)
- throw new ArgumentException("Argument 'Source' can have only one dimension.", "Source");
-
- /*
- * Well, I don't like it either. But I figured that two iterations
- * on the array would be better than many aloocations. Besides, this
- * way I can isolate the special cases.
- * I'd love to hear from a different approach.
- */
-
- int count = Source.Length;
- bool[] matches = new bool[count];
- int matchesCount = 0;
-
- for (int i = 0; i < count; i++)
- {
- if (InStr(1, Match, Source[i], Compare) != 0)
- {
- //found one more
- matches[i] = true;
- matchesCount ++;
- }
- else
- {
- matches[i] = false;
- }
- }
-
- if (matchesCount == 0)
- {
- if (Include)
- return new string[0];
- else
- return Source;
- }
- else
- {
- if (matchesCount == count)
- {
- if (Include)
- return Source;
- else
- return new string[0];
- }
- else
- {
- string[] ret;
- int j = 0;
- if (Include)
- ret = new string [matchesCount];
- else
- ret = new string [count - matchesCount];
-
- for (int i=0; i < count; i++)
- {
- if ((matches[i] && Include) || !(matches[i] || Include))
- {
- ret[j] = Source[i];
- j++;
- }
- }
- return ret;
- }
- }
- }
-
- /// <summary>
- /// Returns a string formatted according to instructions contained in a format String expression.
- /// </summary>
- /// <param name="Expression">Required. Any valid expression.</param>
- /// <param name="Style">Optional. A valid named or user-defined format String expression. </param>
- [MonoTODO]
- public static string Format(object Expression,
- [Optional]
- [DefaultValue("")]
- string Style)
- {
- //FIXME
- throw new NotImplementedException();
- }
-
-
- /// <summary>
- /// Returns an expression formatted as a currency value using the currency symbol defined in the system control panel.
- /// </summary>
- /// <param name="Expression">Required. Expression to be formatted.</param>
- /// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
- /// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
- /// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
- /// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
- [MonoTODO]
- public static string FormatCurrency(object Expression,
- [Optional]
- [DefaultValue(-1)]
- int NumDigitsAfterDecimal,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState IncludeLeadingDigit,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState UseParensForNegativeNumbers,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState GroupDigits)
- {
- //FIXME
- throw new NotImplementedException();
- //throws InvalidCastException
- //throws ArgumentException
- }
-
- /// <summary>
- /// Returns an expression formatted as a date or time.
- /// </summary>
- /// <param name="Expression">Required. Date expression to be formatted. </param>
- /// <param name="NamedFormat">Optional. Numeric value that indicates the date or time format used. If omitted, GeneralDate is used.</param>
- [MonoTODO]
- public static string FormatDateTime(DateTime Expression,
- [Optional]
- [DefaultValue(DateFormat.GeneralDate)]
- DateFormat NamedFormat)
- {
- switch(NamedFormat)
- {
- case DateFormat.GeneralDate:
- //FIXME: WTF should I do with it?
- throw new NotImplementedException();
- case DateFormat.LongDate:
- return Expression.ToLongDateString();
- case DateFormat.ShortDate:
- return Expression.ToShortDateString();
- case DateFormat.LongTime:
- return Expression.ToLongTimeString();
- case DateFormat.ShortTime:
- return Expression.ToShortTimeString();
- default:
- throw new ArgumentException("Argument 'NamedFormat' must be a member of DateFormat", "NamedFormat");
- }
- }
-
- /// <summary>
- /// Returns an expression formatted as a number.
- /// </summary>
- /// <param name="Expression">Required. Expression to be formatted.</param>
- /// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
- /// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
- /// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
- /// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
- [MonoTODO]
- public static string FormatNumber(object Expression,
- [Optional]
- [DefaultValue(-1)]
- int NumDigitsAfterDecimal,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState IncludeLeadingDigit,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState UseParensForNegativeNumbers,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState GroupDigits)
- {
- //FIXME
- throw new NotImplementedException();
- //throws InvalidCastException
- }
-
- /// <summary>
- /// Returns an expression formatted as a percentage (that is, multiplied by 100) with a trailing % character.
- /// </summary>
- /// <param name="Expression">Required. Expression to be formatted.</param>
- /// <param name="NumDigitsAfterDecimal">Optional. Numeric value indicating how many places are displayed to the right of the decimal. Default value is –1, which indicates that the computer's regional settings are used.</param>
- /// <param name="IncludeLeadingDigit">Optional. Tristate enumeration that indicates whether or not a leading zero is displayed for fractional values. See Settings for values.</param>
- /// <param name="UseParensForNegativeNumbers">Optional. Tristate enumeration that indicates whether or not to place negative values within parentheses. See Settings for values.</param>
- /// <param name="GroupDigits">Optional. Tristate enumeration that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings for values.</param>
- [MonoTODO]
- public static string FormatPercent(object Expression,
- [Optional]
- [DefaultValue(-1)]
- int NumDigitsAfterDecimal,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState IncludeLeadingDigit,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState UseParensForNegativeNumbers,
- [Optional]
- [DefaultValue(TriState.UseDefault)]
- TriState GroupDigits)
- {
- //FIXME
- throw new NotImplementedException();
- //throws InvalidCastException
- }
-
- /// <summary>
- /// Returns a Char value representing the character from the specified index in the supplied string.
- /// </summary>
- /// <param name="Str">Required. Any valid String expression.</param>
- /// <param name="Index">Required. Integer expression. The (1-based) index of the character in Str to be returned.</param>
- [MonoTODO("Needs testing")]
- public static char GetChar(string Str,
- int Index)
- {
-
- if ((Str == null) || (Str.Length == 0))
- throw new ArgumentException("Length of argument 'Str' must be greater than zero.", "Sre");
- if (Index < 1)
- throw new ArgumentException("Argument 'Index' must be greater than or equal to 1.", "Index");
- if (Index > Str.Length)
- throw new ArgumentException("Argument 'Index' must be less than or equal to the length of argument 'String'.", "Index");
-
- return Str.ToCharArray(Index -1, 1)[0];
- }
-
-
- /// <summary>
- /// Returns an integer specifying the start position of the first occurrence of one string within another.
- /// </summary>
- /// <param name="Start">Required. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. The start index is 1 based.</param>
- /// <param name="String1">Required. String expression being searched.</param>
- /// <param name="String2">Required. String expression sought.</param>
- /// <param name="Compare">Optional. Specifies the type of string comparison. If Compare is omitted, the Option Compare setting determines the type of comparison. Specify a valid LCID (LocaleID) to use locale-specific rules in the comparison. </param>
- [MonoTODO("Needs testing")]
- public static int InStr(int Start,
- string String1,
- string String2,
- [OptionCompare]
- [Optional]
- [DefaultValue(CompareMethod.Binary)]
- CompareMethod Compare)
- {
- if (Start < 1)
- throw new ArgumentException("Argument 'Start' must be non-negative.", "Start");
-
- /*
- * FIXME: ms-help://MS.VSCC/MS.MSDNVS/vblr7/html/vafctinstr.htm
- * If Compare is omitted, the Option Compare setting determines the type of comparison. Specify
- * a valid LCID (LocaleID) to use locale-specific rules in the comparison.
- * How do I do this?
- */
-
- /*
- * If InStr returns
- *
- * String1 is zero length or Nothing 0
- * String2 is zero length or Nothing start
- * String2 is not found 0
- * String2 is found within String1 Position where match begins
- * Start > String2 0
- */
-
- //FIXME: someone with a non US setup should test this.
-
- switch (Compare)
- {
- case CompareMethod.Text:
- return System.Globalization.CultureInfo.CurrentCulture.CompareInfo.IndexOf(String2, String1, Start - 1) + 1;
-
- case CompareMethod.Binary:
- return String2.IndexOf(String1, Start - 1) + 1;
- default:
- throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
- }
-
-
- }
-
- /// <summary>
- /// Returns the position of the first occurrence of one string within another, starting from the right side of the string.
- /// </summary>
- /// <param name="StringCheck">Required. String expression being searched.</param>
- /// <param name="StringMatch">Required. String expression being searched for.</param>
- /// <param name="Start">Optional. Numeric expression that sets the one-based starting position for each search, starting from the left side of the string. If Start is omitted, –1 is used, which means that the search begins at the last character position. Search then proceeds from right to left.</param>
- /// <param name="Compare">Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is performed. See Settings for values.</param>
- [MonoTODO]
- public static int InStrRev(string StringCheck,
- string StringMatch,
- string String2,
- [Optional]
- [DefaultValue(-1)]
- int Start,
- [OptionCompare]
- [Optional]
- [DefaultValue(CompareMethod.Binary)]
- CompareMethod Compare)
- {
- if ((Start == 0) || (Start < -1))
- throw new ArgumentException("Argument 'Start' must be greater than 0 or equal to -1", "Start");
-
- //FIXME: Use LastIndexOf()
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Returns a string created by joining a number of substrings contained in an array.
- /// </summary>
- /// <param name="SourceArray">Required. One-dimensional array containing substrings to be joined.</param>
- /// <param name="Delimiter">Optional. String used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If Delimiter is a zero-length string (""), all items in the list are concatenated with no delimiters.</param>
- [MonoTODO("Needs testing")]
- public static string Join(string[] SourceArray,
- [Optional]
- [DefaultValue(" ")]
- string Delimiter)
- {
- if (SourceArray == null)
- throw new ArgumentException("Argument 'SourceArray' can not be null.", "SourceArray");
- if (SourceArray.Rank > 1)
- throw new ArgumentException("Argument 'SourceArray' can have only one dimension.", "SourceArray");
-
- return string.Join(Delimiter, SourceArray);
- }
- /// <summary>
- /// Returns a string created by joining a number of substrings contained in an array.
- /// </summary>
- /// <param name="SourceArray">Required. One-dimensional array containing substrings to be joined.</param>
- /// <param name="Delimiter">Optional. String used to separate the substrings in the returned string. If omitted, the space character (" ") is used. If Delimiter is a zero-length string (""), all items in the list are concatenated with no delimiters.</param>
- [MonoTODO("Needs testing")]
- public static string Join(object[] SourceArray,
- [Optional]
- [DefaultValue(" ")]
- string Delimiter)
- {
-
- if (SourceArray == null)
- throw new ArgumentException("Argument 'SourceArray' can not be null.", "SourceArray");
- if (SourceArray.Rank > 1)
- throw new ArgumentException("Argument 'SourceArray' can have only one dimension.", "SourceArray");
-
- string[] dest;
- dest = new string[SourceArray.Length];
-
- SourceArray.CopyTo(dest, 0);
- return string.Join(Delimiter, dest);
- }
-
- /// <summary>
- /// Returns a string or character converted to lowercase.
- /// </summary>
- /// <param name="Value">Required. Any valid String or Char expression.</param>
- [MonoTODO("Needs testing")]
- public static char LCase(char Value)
- {
- return char.ToLower(Value);
- }
-
- /// <summary>
- /// Returns a string or character converted to lowercase.
- /// </summary>
- /// <param name="Value">Required. Any valid String or Char expression.</param>
- [MonoTODO("Needs testing")]
- public static string LCase(string Value)
- {
- if ((Value == null) || (Value.Length == 0))
- return String.Empty; // VB.net does this.
-
- return Value.ToLower();
- }
-
-
- /// <summary>
- /// Returns a string containing a specified number of characters from the left side of a string.
- /// </summary>
- /// <param name="Str">Required. String expression from which the leftmost characters are returned.</param>
- /// <param name="Length">Required. Integer expression. Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in Str, the entire string is returned.</param>
- [MonoTODO]
- public static string Left(string Str,
- int Length)
- {
- if (Length < 0)
- throw new ArgumentException("Argument 'Length' must be non-negative.", "Length");
- if ((Str == null) || (Str.Length == 0))
- return String.Empty; // VB.net does this.
-
- return Str.Substring(0, Length);
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(bool Expression)
- {
- return 2; //sizeof(bool)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(byte Expression)
- {
- return 1; //sizeof(byte)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(char Expression)
- {
- return 2; //sizeof(char)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(double Expression)
- {
- return 8; //sizeof(double)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(int Expression)
- {
- return 4; //sizeof(int)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(long Expression)
- {
- return 8; //sizeof(long)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO]
- public static int Len(object Expression)
- {
- // FIXME:
- // With user-defined types and Object variables, the Len function returns the size as it will
- // be written to the file. If an Object contains a String, it will return the length of the string.
- // If an Object contains any other type, it will return the size of the object as it will be written
- // to the file.
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(short Expression)
- {
- return 2; //sizeof(short)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(Single Expression)
- {
- return 4; //sizeof(Single)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(string Expression)
- {
- return Expression.Length; //length of the string
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(DateTime Expression)
- {
- return 8; //sizeof(DateTime)
- }
-
- /// <summary>
- /// Returns an integer containing either the number of characters in a string or the number of bytes required to store a variable.
- /// </summary>
- /// <param name="Expression">Any valid String expression or variable name. If Expression is of type Object, the Len function returns the size as it will be written to the file.</param>
- [MonoTODO("Needs testing")]
- public static int Len(decimal Expression)
- {
- return 16; //sizeof(decimal)
- }
-
- /// <summary>
- /// Returns a left-aligned string containing the specified string adjusted to the specified length.
- /// </summary>
- /// <param name="Source">Required. String expression. Name of string variable.</param>
- /// <param name="Length">Required. Integer expression. Length of returned string.</param>
- [MonoTODO("Needs testing")]
- public static string LSet(string Source,
- int Length)
- {
- if (Length < 0)
- throw new ArgumentOutOfRangeException("Length", "Length must be must be non-negative.");
- if (Source == null)
- Source = String.Empty;
-
- return Source.PadRight(Length);
- }
-
- /// <summary>
- /// Returns a string containing a copy of a specified string with no leading spaces.
- /// </summary>
- /// <param name="Str">Required. Any valid String expression.</param>
- [MonoTODO("Needs testing")]
- public static string LTrim(string Str)
- {
- if ((Str == null) || (Str.Length == 0))
- return String.Empty; // VB.net does this.
-
- Str.TrimStart(null);
- return Str;
- }
-
- /// <summary>
- /// Returns a string containing a copy of a specified string with no trailing spaces.
- /// </summary>
- /// <param name="Str">Required. Any valid String expression.</param>
- [MonoTODO("Needs testing")]
- public static string RTrim(string Str)
- {
- if ((Str == null) || (Str.Length == 0))
- return String.Empty; // VB.net does this.
-
- Str.TrimEnd(null);
- return Str;
- }
-
- /// <summary>
- /// Returns a string containing a copy of a specified string with no leading or trailing spaces.
- /// </summary>
- /// <param name="Str">Required. Any valid String expression.</param>
- [MonoTODO("Needs testing")]
- public static string Trim(string Str)
- {
- if ((Str == null) || (Str.Length == 0))
- return String.Empty; // VB.net does this.
-
- Str.Trim();
- return Str;
- }
-
- /// <summary>
- /// Returns a string containing a specified number of characters from a string.
- /// </summary>
- /// <param name="Str">Required. String expression from which characters are returned.</param>
- /// <param name="Start">Required. Integer expression. Character position in Str at which the part to be taken starts. If Start is greater than the number of characters in Str, the Mid function returns a zero-length string (""). Start is one based.</param>
- /// <param name="Length">Required Integer expression. Number of characters to return. If there are fewer than Length characters in the text (including the character at position Start), all characters from the start position to the end of the string are returned.</param>
- [MonoTODO("Verify if this is the correct behaviour for Length==0...[Rafael]")]
- public static string Mid(string Str,
- int Start,
- int Length)
- {
-
- if (Length < 0)
- throw new System.ArgumentException("Argument 'Length' must be greater or equal to zero.", "Length");
- if (Start <= 0)
- throw new System.ArgumentException("Argument 'Start' must be greater than zero.", "Start");
- if ((Str == null) || (Str.Length == 0))
- return String.Empty; // VB.net does this.
-
- if ((Length == 0) || (Start > Str.Length))
- return String.Empty;
-
- if (Length > (Str.Length - Start))
- Length = (Str.Length - Start) + 1;
-
- return Str.Substring(Start - 1, Length);
-
- }
-
- /// <summary>
- /// Returns a string containing all characters from a string beyond an start point.
- /// </summary>
- /// <param name="Str">Required. String expression from which characters are returned.</param>
- /// <param name="Start">Required. Integer expression. Character position in Str at which the part to be taken starts. If Start is greater than the number of characters in Str, the Mid function returns a zero-length string (""). Start is one based.</param>
- [MonoTODO("Needs testing")]
- public static string Mid (string Str, int Start)
- {
- if (Start <= 0)
- throw new System.ArgumentException("Argument 'Start' must be greater than zero.", "Start");
- if ((Str == null) || (Str.Length == 0))
- return String.Empty; // VB.net does this.
-
- if (Start > Str.Length)
- return String.Empty;
-
- return Str.Substring(Start - 1);
- }
-
- /// <summary>
- /// Returns a string in which a specified substring has been replaced with another substring a specified number of times.
- /// </summary>
- /// <param name="Expression">Required. String expression containing substring to replace.</param>
- /// <param name="Find">Required. Substring being searched for.</param>
- /// <param name="Replacement">Required. Replacement substring.</param>
- /// <param name="Start">Optional. Position within Expression where substring search is to begin. If omitted, 1 is assumed.</param>
- /// <param name="Count">Optional. Number of substring substitutions to perform. If omitted, the default value is –1, which means make all possible substitutions.</param>
- /// <param name="Compare">Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings for values.</param>
- [MonoTODO("Needs testing")]
- public static string Replace(string Expression,
- string Find,
- string Replacement,
- [Optional]
- [DefaultValue(1)]
- int Start,
- [Optional]
- [DefaultValue(-1)]
- int Count,
- [OptionCompare]
- [Optional]
- [DefaultValue(CompareMethod.Binary)]
- CompareMethod Compare)
- {
-
- if (Count < -1)
- throw new ArgumentException("Argument 'Count' must be greater than or equal to -1.", "Count");
- if (Start <= 0)
- throw new ArgumentException("Argument 'Start' must be greater than zero.", "Start");
-
- if ((Expression == null) || (Expression.Length == 0))
- return String.Empty; // VB.net does this.
- if ((Find == null) || (Find.Length == 0))
- return Expression; // VB.net does this.
- if (Replacement == null)
- Replacement = String.Empty; // VB.net does this.
-
- return Expression.Replace(Find, Replacement);
- }
-
- /// <summary>
- /// Returns a string containing a specified number of characters from the right side of a string.
- /// </summary>
- /// <param name="Str">Required. String expression from which the rightmost characters are returned.</param>
- /// <param name="Length">Required. Integer. Numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in Str, the entire string is returned.</param>
- [MonoTODO("Needs testing")]
- public static string Right(string Str,
- int Length)
- {
- if (Length < 0)
- throw new ArgumentException("Argument 'Length' must be greater or equal to zero.", "Length");
-
- //FIXME
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Returns a right-aligned string containing the specified string adjusted to the specified length.
- /// </summary>
- /// <param name="Source">Required. String expression. Name of string variable.</param>
- /// <param name="Length">Required. Integer expression. Length of returned string.</param>
- [MonoTODO("Needs testing")]
- public static string RSet(string Source,
- int Length)
- {
-
- if (Source == null)
- Source = String.Empty;
- if (Length < 0)
- throw new ArgumentOutOfRangeException("Length", "Length must be non-negative.");
-
- return Source.PadLeft(Length);
- }
-
- /// <summary>
- /// Returns a string consisting of the specified number of spaces.
- /// </summary>
- /// <param name="Number">Required. Integer expression. The number of spaces you want in the string.</param>
- [MonoTODO("Needs testing")]
- public static string Space(int Number)
- {
- if (Number < 0)
- throw new ArgumentException("Argument 'Number' must be greater or equal to zero.", "Number");
-
- return new string((char) ' ', Number);
- }
-
- /// <summary>
- /// Returns a zero-based, one-dimensional array containing a specified number of substrings.
- /// </summary>
- /// <param name="Expression">Required. String expression containing substrings and delimiters. If Expression is a zero-length string (""), the Split function returns an array with no elements and no data.</param>
- /// <param name="Delimiter">Optional. Single character used to identify substring limits. If Delimiter is omitted, the space character (" ") is assumed to be the delimiter. If Delimiter is a zero-length string, a single-element array containing the entire Expression string is returned.</param>
- /// <param name="Limit">Optional. Number of substrings to be returned; the default, –1, indicates that all substrings are returned.</param>
- /// <param name="Compare">Optional. Numeric value indicating the comparison to use when evaluating substrings. See Settings for values.</param>
- [MonoTODO]
- public static string[] Split(string Expression,
- [Optional]
- [DefaultValue(" ")]
- string Delimiter,
- [Optional]
- [DefaultValue(-1)]
- int Limit,
- [OptionCompare]
- [Optional]
- [DefaultValue(CompareMethod.Binary)]
- CompareMethod Compare)
- {
-
-
- if (Expression == null)
- return new string[0];
- if ((Delimiter == null) || (Delimiter.Length == 0))
- {
- string [] ret = new string[0];
- ret[0] = Expression;
- return ret;
- }
- if (Limit == 0)
- Limit = 1; // VB.net does this. I call it a bug.
-
- /*
- * FIXME: VB.net does NOT do this. It simply fails with AritmethicException.
- * What should I do?
- */
- if (Limit < -1)
- throw new ArgumentOutOfRangeException("Limit", "Argument 'Limit' must be -1 or greater than zero.");
-
- switch (Compare)
- {
- case CompareMethod.Binary:
- return Expression.Split(Delimiter.ToCharArray(0, 1), Limit);
- case CompareMethod.Text:
- //FIXME
- throw new NotImplementedException();
- default:
- throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text.", "Compare");
- }
-
-
- }
-
- /// <summary>
- /// Returns -1, 0, or 1, based on the result of a string comparison.
- /// </summary>
- /// <param name="String1">Required. Any valid String expression.</param>
- /// <param name="String2">Required. Any valid String expression.</param>
- /// <param name="Compare">Optional. Specifies the type of string comparison. If compare is omitted, the Option Compare setting determines the type of comparison.</param>
- [MonoTODO("Needs testing")]
- public static int StrComp(string String1,
- string String2,
- [OptionCompare]
- [Optional]
- [DefaultValue(CompareMethod.Binary)]
- CompareMethod Compare)
- {
-
- switch (Compare)
- {
- case CompareMethod.Binary:
- return string.Compare(String1, String2, true);
- case CompareMethod.Text:
- //FIXME: someone with a non US setup should test this.
- return System.Globalization.CultureInfo.CurrentCulture.CompareInfo.Compare(String1, String2);
- default:
- throw new System.ArgumentException("Argument 'Compare' must be CompareMethod.Binary or CompareMethod.Text", "Compare");
- }
-
- }
-
- /// <summary>
- /// Returns a string converted as specified.
- /// </summary>
- /// <param name="Str">Required. String expression to be converted.</param>
- /// <param name="Conversion">Required. VbStrConv member. The enumeration value specifying the type of conversion to perform. </param>
- /// <param name="LocaleID">Optional. The LocaleID value, if different from the system LocaleID value. (The system LocaleID value is the default.)</param>
- [MonoTODO("Not impemented")]
- public static string StrConv (string str,
- VbStrConv Conversion,
- [Optional]
- [DefaultValue(0)]
- int LocaleID)
- {
- //FIXME
- throw new NotImplementedException();
- //throws ArgumentException
- }
-
- /// <summary>
- /// Returns a string or object consisting of the specified character repeated the specified number of times.
- /// </summary>
- /// <param name="Number">Required. Integer expression. The length to the string to be returned.</param>
- /// <param name="Character">Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value.</param>
- [MonoTODO("Needs testing")]
- public static string StrDup(int Number,
- char Character)
- {
- if (Number < 0)
- throw new ArgumentException("Argument 'Number' must be non-negative.", "Number");
-
- return new string(Character, Number);
- }
- /// <summary>
- /// Returns a string or object consisting of the specified character repeated the specified number of times.
- /// </summary>
- /// <param name="Number">Required. Integer expression. The length to the string to be returned.</param>
- /// <param name="Character">Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value.</param>
- [MonoTODO("Needs testing")]
- public static string StrDup(int Number,
- string Character)
- {
- if (Number < 0)
- throw new ArgumentException("Argument 'Number' must be greater or equal to zero.", "Number");
- if ((Character == null) || (Character.Length == 0))
- throw new ArgumentNullException("Character", "Length of argument 'Character' must be greater than zero.");
-
- return new string(Character.ToCharArray()[0], Number);
- }
-
- /// <summary>
- /// Returns a string or object consisting of the specified character repeated the specified number of times.
- /// </summary>
- /// <param name="Number">Required. Integer expression. The length to the string to be returned.</param>
- /// <param name="Character">Required. Any valid Char, String, or Object expression. Only the first character of the expression will be used. If Character is of type Object, it must contain either a Char or a String value.</param>
- [MonoTODO("Needs testing")]
- public static object StrDup(int Number,
- object Character)
- {
- if (Number < 0)
- throw new ArgumentException("Argument 'Number' must be non-negative.", "Number");
-
- if (Character is string)
- {
- string sCharacter = (string) Character;
- if ((sCharacter == null) || (sCharacter.Length == 0))
- throw new ArgumentNullException("Character", "Length of argument 'Character' must be greater than zero.");
-
- return StrDup(Number, sCharacter);
- }
- else
- {
- if (Character is char)
- {
- return StrDup(Number, (char) Character);
- }
- else
- {
- // "If Character is of type Object, it must contain either a Char or a String value."
- throw new ArgumentException("Argument 'Character' is not a valid value.", "Character");
- }
- }
- }
-
- /// <summary>
- /// Returns a string in which the character order of a specified string is reversed.
- /// </summary>
- /// <param name="Expression">Required. String expression whose characters are to be reversed. If Expression is a zero-length string (""), a zero-length string is returned.</param>
- public static string StrReverse(string Expression)
- {
-
- if (Expression == null)
- return String.Empty; // "If Expression is a zero-length string (""), a zero-length string is returned."
-
- int count = Expression.Length;
-
- if (count == 0)
- return String.Empty; // "If Expression is a zero-length string (""), a zero-length string is returned."
-
- /*
- * This would be much faster if I had access to the internal array.
- * I'd just reverse the array. Maybe as strings are inmutable in .net (is this true in Mono?)
- * it'll be the same. Comments?
- */
- char[] chars = new char[count - 1];
- chars = Expression.ToCharArray();
-
- System.Array.Reverse (chars);
-
- return new string(chars);
-
- }
-
- /// <summary>
- /// Returns a string or character containing the specified string converted to uppercase.
- /// </summary>
- /// <param name="Value">Required. Any valid String or Char expression.</param>
- public static char UCase(char Value)
- {
- return char.ToUpper(Value);
- }
-
- /// <summary>
- /// Returns a string or character containing the specified string converted to uppercase.
- /// </summary>
- /// <param name="Value">Required. Any valid String or Char expression.</param>
- public static string UCase(string Value)
- {
- if ((Value == null) || (Value.Length == 0))
- return String.Empty; // VB.net does this.
-
- return Value.ToUpper();
- }
-
-
-
- }
-
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs
deleted file mode 100644
index a38969af212..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TODOAttribute.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace Microsoft.VisualBasic {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- public class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs
deleted file mode 100644
index d14dd2f0b03..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TabInfo.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// TabInfo.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace Microsoft.VisualBasic {
- [EditorBrowsable(EditorBrowsableState.Never)]
- [MonoTODO]
- public struct TabInfo {
- // Declarations
- public System.Int16 Column;
- // Constructors
- // Properties
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs
deleted file mode 100644
index 9773ea3552e..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/TriState.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// TriState.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- /// <summary>
- /// When you call number-formatting functions, you can use the following enumeration
- /// members in your code in place of the actual values.
- /// </summary>
- public enum TriState : int {
- False = 0,
- UseDefault = -2,
- True = -1
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs
deleted file mode 100644
index dbc879b4e2e..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedArrayAttribute.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// VBFixedArrayAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- [System.AttributeUsageAttribute(System.AttributeTargets.Field)]
- sealed public class VBFixedArrayAttribute : System.Attribute {
- // Declarations
- // Constructors
- [MonoTODO]
- VBFixedArrayAttribute(System.Int32 UpperBound1) { throw new NotImplementedException (); }
- [MonoTODO]
- VBFixedArrayAttribute(System.Int32 UpperBound1, System.Int32 UpperBound2) { throw new NotImplementedException (); }
- // Properties
- [MonoTODO]
- public System.Int32 Length { get { throw new NotImplementedException (); } }
- [MonoTODO]
- public System.Int32[] Bounds { get { throw new NotImplementedException (); } }
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs
deleted file mode 100644
index c4de1009ebd..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBFixedStringAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// VBFixedStringAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- [System.AttributeUsageAttribute(System.AttributeTargets.Field)]
- sealed public class VBFixedStringAttribute : System.Attribute {
- // Declarations
- // Constructors
- [MonoTODO]
- VBFixedStringAttribute(System.Int32 Length) { throw new NotImplementedException (); }
- // Properties
- [MonoTODO]
- public System.Int32 Length { get { throw new NotImplementedException (); } }
- // Methods
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs
deleted file mode 100644
index 49be95781b9..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VBMath.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// VBMath.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-
-using System;
-
-namespace Microsoft.VisualBasic {
- [Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute]
- sealed public class VBMath {
- // Declarations
- // Constructors
- // Properties
- // Methods
- [MonoTODO]
- public static System.Single Rnd () { throw new NotImplementedException (); }
- [MonoTODO]
- public static System.Single Rnd (System.Single Number) { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Randomize () { throw new NotImplementedException (); }
- [MonoTODO]
- public static void Randomize (System.Double Number) { throw new NotImplementedException (); }
- // Events
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs
deleted file mode 100644
index 7eab4e4c86a..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VariantType.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// VariantType.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace Microsoft.VisualBasic {
- public enum VariantType : int {
- Empty = 0,
- Null = 1,
- Short = 2,
- Integer = 3,
- Single = 4,
- Double = 5,
- Currency = 6,
- Date = 7,
- String = 8,
- Object = 9,
- Error = 10,
- Boolean = 11,
- Variant = 12,
- DataObject = 13,
- Decimal = 14,
- Byte = 17,
- Char = 18,
- Long = 20,
- UserDefinedType = 36,
- Array = 8192
- };
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs b/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs
deleted file mode 100644
index a61d2db79da..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/VbStrConv.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// VbStrConv.cs
-//
-// Authors:
-// Martin Adoue (martin@cwanet.com)
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Ximian Inc.
-//
-
-using System;
-
-namespace Microsoft.VisualBasic
-{
- /// <summary>
- /// When you call the StrConv function, you can use the following enumeration
- /// members in your code in place of the actual values.
- /// </summary>
- [System.FlagsAttribute]
- public enum VbStrConv : int {
- /// <summary>
- /// Performs no conversion
- /// </summary>
- None = 0,
- /// <summary>
- /// Uses linguistic rules for casing, rather than File System (default). Valid with UpperCase and LowerCase only.
- /// </summary>
- LinguisticCasing = 1024,
- /// <summary>
- /// Converts the string to uppercase characters.
- /// </summary>
- UpperCase = 1,
- /// <summary>
- /// Converts the string to lowercase characters.
- /// </summary>
- LowerCase = 2,
- /// <summary>
- /// Converts the first letter of every word in string to uppercase.
- /// </summary>
- ProperCase = 3,
- /// <summary>
- /// Converts narrow (half-width) characters in the string to wide (full-width) characters. (Applies to Asian locales.)
- /// </summary>
- Wide = 4, //*
- /// <summary>
- /// Converts wide (full-width) characters in the string to narrow (half-width) characters. (Applies to Asian locales.)
- /// </summary>
- Narrow = 8, //*
- /// <summary>
- /// Converts Hiragana characters in the string to Katakana characters. (Applies to Japan only.)
- /// </summary>
- Katakana = 16, //**
- /// <summary>
- /// Converts Katakana characters in the string to Hiragana characters. (Applies to Japan only.)
- /// </summary>
- Hiragana = 32, //**
- /// <summary>
- /// Converts Traditional Chinese characters to Simplified Chinese. (Applies to Asian locales.)
- /// </summary>
- SimplifiedChinese =256, //*
- /// <summary>
- /// Converts Simplified Chinese characters to Traditional Chinese. (Applies to Asian locales.)
- /// </summary>
- TraditionalChinese = 512 //*
- /*
-
- * Applies to Asian locales.
- ** Applies to Japan only.
-
- */
- }
-
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/.cvsignore b/mcs/class/Microsoft.VisualBasic/Test/.cvsignore
deleted file mode 100644
index 6a7461313bb..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Test/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.dll
diff --git a/mcs/class/Microsoft.VisualBasic/Test/AllTests.cs b/mcs/class/Microsoft.VisualBasic/Test/AllTests.cs
deleted file mode 100644
index ba8e35d1604..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Test/AllTests.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// MonoTests.AllTests, Microsoft.VisualBasic.dll
-//
-// Author:
-// Mario Martinez (mariom925@home.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-
-namespace MonoTests
-{
- /// <summary>
- /// Combines all unit tests for the Microsoft.VisualBasic.dll assembly
- /// into one test suite.
- /// </summary>
- public class AllTests : TestCase
- {
- public AllTests(string name) : base(name) {}
- public AllTests() : base("Microsoft.VisualBasic.AllTests") {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
- suite.AddTest (Microsoft.VisualBasic.CollectionTest.Suite);
- suite.AddTest (Microsoft.VisualBasic.ConversionTest.Suite);
- suite.AddTest (Microsoft.VisualBasic.DateAndTimeTest.Suite);
-
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs b/mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs
deleted file mode 100644
index 457bc821b75..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Test/CollectionTest.cs
+++ /dev/null
@@ -1,535 +0,0 @@
-// Collection.cs - NUnit Test Cases for Microsoft.VisualBasic.Collection
-//
-// Author:
-// Chris J. Breisch (cjbreisch@altavista.net)
-//
-// (C) Chris J. Breisch
-//
-
-using NUnit.Framework;
-using System;
-using Microsoft.VisualBasic;
-using System.Collections;
-
-namespace MonoTests.Microsoft.VisualBasic
-{
-
- public class CollectionTest : TestCase
- {
-
- public CollectionTest() : base ("Microsoft.VisualBasic.Collection") {}
- public CollectionTest(string name) : base(name) {}
-
- protected override void SetUp() {}
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CollectionTest));
- }
- }
-
- // Test Constructor
- public void TestNew ()
- {
- Collection c;
-
- c = new Collection();
-
- AssertNotNull("#N01", c);
- AssertEquals("#N02", 0, c.Count);
- }
-
- // Test Add method with Key == null
- public void TestAddNoKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add(typeof(int), null, null, null);
- c.Add(typeof(double), null, null, null);
- c.Add(typeof(string), null, null, null);
-
- AssertEquals("#ANK01", 3, c.Count);
-
- // Collection class is 1-based
- AssertEquals("#ANK02", typeof(string), c[3]);
-
- }
-
- // Test Add method with Key specified
- public void TestAddKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add("Baseball", "Base", null, null);
- c.Add("Football", "Foot", null, null);
- c.Add("Basketball", "Basket", null, null);
- c.Add("Volleyball", "Volley", null, null);
-
- AssertEquals("#AK01", 4, c.Count);
-
- // Collection class is 1-based
- AssertEquals("#AK02", "Baseball", c[1]);
- AssertEquals("#AK03", "Volleyball", c["Volley"]);
-
- }
-
- // Test Add method with Before specified and Key == null
- public void TestAddBeforeNoKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add(typeof(int), null, null, null);
- c.Add(typeof(double), null, 1, null);
- c.Add(typeof(string), null, 2, null);
- c.Add(typeof(object), null, 2, null);
-
- AssertEquals("#ABNK01", 4, c.Count);
-
- // Collection class is 1-based
- AssertEquals("#ABNK02", typeof(int), c[4]);
- AssertEquals("#ABNK03", typeof(double), c[1]);
- AssertEquals("#ABNK04", typeof(object), c[2]);
-
- }
-
- // Test Add method with Before and Key
- public void TestAddBeforeKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add("Baseball", "Base", null, null);
- c.Add("Football", "Foot", 1, null);
- c.Add("Basketball", "Basket", 1, null);
- c.Add("Volleyball", "Volley", 3, null);
-
- AssertEquals("#ABK01", 4, c.Count);
- AssertEquals("#ABK02", "Basketball", c[1]);
- AssertEquals("#ABK03", "Baseball", c[4]);
- AssertEquals("#ABK04", "Volleyball", c["Volley"]);
- AssertEquals("#ABK05", "Football", c["Foot"]);
-
- }
-
- // Test Add method with After specified and Key == null
- public void TestAddAfterNoKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add(typeof(int), null, null, 0);
- c.Add(typeof(double), null, null, 1);
- c.Add(typeof(string), null, null, 1);
- c.Add(typeof(object), null, null, 3);
-
- AssertEquals("#AANK01", 4, c.Count);
-
- // Collection class is 1-based
- AssertEquals("#AANK02", typeof(object), c[4]);
- AssertEquals("#AANK03", typeof(int), c[1]);
- AssertEquals("#AANK04", typeof(string), c[2]);
-
- }
-
- // Test Add method with After and Key
- public void TestAddAfterKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add("Baseball", "Base", null, 0);
- c.Add("Football", "Foot", null, 1);
- c.Add("Basketball", "Basket", null, 1);
- c.Add("Volleyball", "Volley", null, 2);
-
- AssertEquals("#AAK01", 4, c.Count);
-
- // Collection class is 1-based
- AssertEquals("#AAK02", "Baseball", c[1]);
- AssertEquals("#AAK03", "Football", c[4]);
- AssertEquals("#AAK04", "Basketball", c["Basket"]);
- AssertEquals("#AAK05", "Volleyball", c["Volley"]);
- }
-
- // Test GetEnumerator method
- public void TestGetEnumerator ()
- {
- Collection c;
- IEnumerator e;
- object[] o = new object[4] {typeof(int),
- typeof(double), typeof(string), typeof(object)};
- int i = 0;
-
- c = new Collection();
-
- c.Add(typeof(int), null, null, null);
- c.Add(typeof(double), null, null, null);
- c.Add(typeof(string), null, null, null);
- c.Add(typeof(object), null, null, null);
-
- e = c.GetEnumerator();
-
- AssertNotNull("#GE01", e);
-
- while (e.MoveNext()) {
- AssertEquals("#GE02." + i.ToString(), o[i], e.Current);
- i++;
- }
-
- e.Reset();
- e.MoveNext();
-
- AssertEquals("#GE03", o[0], e.Current);
-
- }
-
- // Test GetEnumerator method again, this time using foreach
- public void Testforeach ()
- {
- Collection c;
- object[] o = new object[4] {typeof(int),
- typeof(double), typeof(string), typeof(object)};
- int i = 0;
-
- c = new Collection();
-
- c.Add(typeof(int), null, null, null);
- c.Add(typeof(double), null, null, null);
- c.Add(typeof(string), null, null, null);
- c.Add(typeof(object), null, null, null);
-
-
- foreach (object item in c) {
- AssertEquals("#fe01." + i.ToString(), o[i], item);
- i++;
- }
-
- }
-
- // Test Remove method with Index
- public void TestRemoveNoKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add(typeof(int), null, null, null);
- c.Add(typeof(double), null, null, null);
- c.Add(typeof(string), null, null, null);
- c.Add(typeof(object), null, null, null);
-
- AssertEquals("#RNK01", 4, c.Count);
-
- c.Remove(3);
-
- AssertEquals("#RNK02", 3, c.Count);
-
- // Collection class is 1-based
- AssertEquals("#RNK03", typeof(object), c[3]);
-
- c.Remove(1);
-
- AssertEquals("#RNK04", 2, c.Count);
- AssertEquals("#RNK05", typeof(double), c[1]);
- AssertEquals("#RNK06", typeof(object), c[2]);
-
- c.Remove(2);
-
- AssertEquals("#RNK07", 1, c.Count);
- AssertEquals("#RNK08", typeof(double), c[1]);
-
- c.Remove(1);
-
- AssertEquals("#RNK09", 0, c.Count);
-
- }
-
- // Test Remove method with Key
- public void TestRemoveKey ()
- {
- Collection c;
-
- c = new Collection();
-
- c.Add("Baseball", "Base", null, null);
- c.Add("Football", "Foot", null, null);
- c.Add("Basketball", "Basket", null, null);
- c.Add("Volleyball", "Volley", null, null);
-
- AssertEquals("#RK01", 4, c.Count);
-
- c.Remove("Foot");
-
- AssertEquals("#RK02", 3, c.Count);
- AssertEquals("#RK03", "Basketball", c["Basket"]);
-
- // Collection class is 1-based
- AssertEquals("#RK04", "Volleyball", c[3]);
-
- c.Remove("Base");
-
- AssertEquals("#RK05", 2, c.Count);
- AssertEquals("#RK06", "Basketball", c[1]);
- AssertEquals("#RK07", "Volleyball", c["Volley"]);
-
- c.Remove(2);
-
- AssertEquals("#RK08", 1, c.Count);
- AssertEquals("#RK09", "Basketball", c[1]);
- AssertEquals("#RK10", "Basketball", c["Basket"]);
-
- c.Remove(1);
-
- AssertEquals("#RK11", 0, c.Count);
- }
-
- // Test all the Exceptions we're supposed to throw
- public void TestException ()
- {
- Collection c;
- bool caughtException = false;
-
- c = new Collection();
-
- try {
- // nothing in Collection yet
- object o = c[0];
- }
- catch (Exception e) {
- AssertEquals("#E01", typeof(IndexOutOfRangeException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E02", true, caughtException);
-
- c.Add("Baseball", "Base", null, null);
- c.Add("Football", "Foot", null, null);
- c.Add("Basketball", "Basket", null, null);
- c.Add("Volleyball", "Volley", null, null);
-
- caughtException = false;
-
- try {
- // only 4 elements
- object o = c[5];
- }
- catch (Exception e) {
- AssertEquals("#E03", typeof(IndexOutOfRangeException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E04", true, caughtException);
-
- caughtException = false;
-
- try {
- // Collection class is 1-based
- object o = c[0];
- }
- catch (Exception e) {
- AssertEquals("#E05", typeof(IndexOutOfRangeException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E06", true, caughtException);
-
- caughtException = false;
-
- try {
- // no member with Key == "Kick"
- object o = c["Kick"];
- }
- catch (Exception e) {
- // FIXME
- // VB Language Reference says IndexOutOfRangeException
- // here, but MS throws ArgumentException
- // AssertEquals("#E07", typeof(IndexOutOfRangeException), e.GetType());
- AssertEquals("#E07", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E08", true, caughtException);
-
- caughtException = false;
-
- try {
- // Even though Indexer is an object, really it's a string
- object o = c[typeof(int)];
- }
- catch (Exception e) {
- AssertEquals("#E09", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E10", true, caughtException);
-
- caughtException = false;
-
- try {
- // can't specify both Before and After
- c.Add("Kickball", "Kick", "Volley", "Foot");
- }
- catch (Exception e) {
- AssertEquals("#E11", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E12", true, caughtException);
-
- caughtException = false;
-
- try {
- // Key "Foot" already exists
- c.Add("Kickball", "Foot", null, null);
- }
- catch (Exception e) {
- AssertEquals("#E13", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E14", true, caughtException);
-
- caughtException = false;
-
- try {
- // Even though Before is object, it's really a string
- c.Add("Dodgeball", "Dodge", typeof(int), null);
- }
- catch (Exception e) {
- AssertEquals("#E15", typeof(InvalidCastException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E16", true, caughtException);
-
- caughtException = false;
-
- try {
- // Even though After is object, it's really a string
- c.Add("Wallyball", "Wally", null, typeof(int));
- }
- catch (Exception e) {
- AssertEquals("#E17", typeof(InvalidCastException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E18", true, caughtException);
-
- caughtException = false;
-
- try {
- // have to pass a legitimate value to remove
- c.Remove(null);
- }
- catch (Exception e) {
- AssertEquals("#E19", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E20", true, caughtException);
-
- caughtException = false;
-
- try {
- // no Key "Golf" exists
- c.Remove("Golf");
- }
- catch (Exception e) {
- AssertEquals("#E21", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E22", true, caughtException);
-
- caughtException = false;
-
- try {
- // no Index 10 exists
- c.Remove(10);
- }
- catch (Exception e) {
- AssertEquals("#E23", typeof(IndexOutOfRangeException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E24", true, caughtException);
-
- caughtException = false;
-
- try {
- IEnumerator e = c.GetEnumerator();
-
- // Must MoveNext before Current
- object item = e.Current;
- }
- catch (Exception e) {
- // FIXME
- // On-line help says InvalidOperationException here,
- // but MS throws IndexOutOfRangeException
- // AssertEquals("#E25", typeof(InvalidOperationException), e.GetType());
- AssertEquals("#E25", typeof(IndexOutOfRangeException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#E26", true, caughtException);
-
- caughtException = false;
-
- try {
- IEnumerator e = c.GetEnumerator();
- e.MoveNext();
-
- c.Add("Paintball", "Paint", null, null);
-
- // Can't MoveNext if Collection has been modified
- e.MoveNext();
- }
- catch (Exception e) {
- // FIXME
- // On-line help says this should throw an error. MS doesn't.
- AssertEquals("#E27", typeof(InvalidOperationException), e.GetType());
- caughtException = true;
- }
-
- // FIXME
- // What to do about this? MS doesn't throw an error
- // AssertEquals("#E28", true, caughtException);
- AssertEquals("#E28", false, caughtException);
-
- caughtException = false;
-
- try {
- IEnumerator e = c.GetEnumerator();
- e.MoveNext();
-
- c.Add("Racketball", "Racket", null, null);
-
- // Can't Reset if Collection has been modified
- e.Reset();
- }
- catch (Exception e) {
- // FIXME
- // On-line help says this should throw an error. MS doesn't.
- AssertEquals("#E29", typeof(InvalidOperationException), e.GetType());
- caughtException = true;
- }
-
- // FIXME
- // What to do about this? MS doesn't throw an error
- // AssertEquals("#E30", true, caughtException);
- AssertEquals("#E30", false, caughtException);
-
- caughtException = false;
- }
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs b/mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs
deleted file mode 100644
index 991e6e82f61..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Test/ConversionTest.cs
+++ /dev/null
@@ -1,674 +0,0 @@
-// Collection.cs - NUnit Test Cases for Microsoft.VisualBasic.Collection
-//
-// Author:
-// Chris J. Breisch (cjbreisch@altavista.net)
-//
-// (C) Chris J. Breisch
-//
-
-using NUnit.Framework;
-using System;
-using Microsoft.VisualBasic;
-
-namespace MonoTests.Microsoft.VisualBasic
-{
-
- public class ConversionTest : TestCase
- {
-
- public ConversionTest() : base ("Microsoft.VisualBasic.Conversion") {}
- public ConversionTest(string name) : base(name) {}
-
- protected override void SetUp() {}
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ConversionTest));
- }
- }
-
- public void TestErrorToStringEmpty() {
- // FIXME : Do something here, but write the ErrorToString code first :-)
- }
-
- public void TestErrorToStringNumber() {
- // FIXME : Do something here, but write the ErrorToString code first :-)
- }
-
- // Test the Fix function
- public void TestFix() {
- System.Single Sng;
- System.Double Dbl;
- System.Decimal Dec;
- System.String S;
- System.Object O;
-
- AssertEquals("#F01", System.Int16.MaxValue, Conversion.Fix(System.Int16.MaxValue));
- AssertEquals("#F02", System.Int16.MinValue, Conversion.Fix(System.Int16.MinValue));
- AssertEquals("#F03", System.Int32.MaxValue, Conversion.Fix(System.Int32.MaxValue));
- AssertEquals("#F04", System.Int32.MinValue, Conversion.Fix(System.Int32.MinValue));
- AssertEquals("#F05", System.Int64.MaxValue, Conversion.Fix(System.Int64.MaxValue));
- AssertEquals("#F06", System.Int64.MinValue, Conversion.Fix(System.Int64.MinValue));
- AssertEquals("#F07", (System.Single)Math.Floor(System.Single.MaxValue), Conversion.Fix(System.Single.MaxValue));
- AssertEquals("#F08", -1 * (System.Single)Math.Floor(-1 * System.Single.MinValue), Conversion.Fix(System.Single.MinValue));
- AssertEquals("#F09", Math.Floor(System.Double.MaxValue), Conversion.Fix(System.Double.MaxValue));
- AssertEquals("#F10", -1 * Math.Floor(-1 * System.Double.MinValue), Conversion.Fix(System.Double.MinValue));
- AssertEquals("#F11", Decimal.Floor(System.Decimal.MaxValue), Conversion.Fix(System.Decimal.MaxValue));
- AssertEquals("#F12", -1 * Decimal.Floor(-1 * System.Decimal.MinValue), Conversion.Fix(System.Decimal.MinValue));
-
- Sng = 99.1F;
-
- AssertEquals("#F13", 99F, Conversion.Fix(Sng));
-
- Sng = 99.6F;
-
- AssertEquals("#F14", 99F, Conversion.Fix(Sng));
-
- Sng = -99.1F;
-
- AssertEquals("#F15", -99F, Conversion.Fix(Sng));
-
- Sng = -99.6F;
-
- AssertEquals("#F16", -99F, Conversion.Fix(Sng));
-
- Dbl = 99.1;
-
- AssertEquals("#F17", 99D, Conversion.Fix(Dbl));
-
- Dbl = 99.6;
-
- AssertEquals("#F18", 99D, Conversion.Fix(Dbl));
-
- Dbl = -99.1;
-
- AssertEquals("#F19", -99D, Conversion.Fix(Dbl));
-
- Dbl = -99.6;
-
- AssertEquals("#F20", -99D, Conversion.Fix(Dbl));
-
- Dec = 99.1M;
-
- AssertEquals("#F21", 99M, Conversion.Fix(Dec));
-
- Dec = 99.6M;
-
- AssertEquals("#F22", 99M, Conversion.Fix(Dec));
-
- Dec = -99.1M;
-
- AssertEquals("#F23", -99M, Conversion.Fix(Dec));
-
- Dec = -99.6M;
-
- AssertEquals("#F24", -99M, Conversion.Fix(Dec));
-
- Dbl = 99.1;
- S = Dbl.ToString();
-
- AssertEquals("#F25", 99D, Conversion.Fix(S));
-
- Dbl = 99.6;
- S = Dbl.ToString();
-
- AssertEquals("#F26", 99D, Conversion.Fix(S));
-
- Dbl = -99.1;
- S = Dbl.ToString();
-
- AssertEquals("#F27", -99D, Conversion.Fix(S));
-
- Dbl = -99.6;
- S = Dbl.ToString();
-
- AssertEquals("#F28", -99D, Conversion.Fix(S));
-
- Dbl = 99.1;
- O = Dbl;
-
- AssertEquals("#F29", 99D, Conversion.Fix(O));
-
- Sng = 99.6F;
- O = Sng;
-
- AssertEquals("#F30", (System.Object)99F, Conversion.Fix(O));
-
- Dbl = -99.1;
- O = Dbl;
-
- AssertEquals("#F31", -99D, Conversion.Fix(O));
-
- Dec = -99.6M;
- O = Dec;
-
- AssertEquals("#F32", (System.Object)(-99M), Conversion.Fix(O));
-
- O = typeof(int);
-
- // test for Exceptions
- bool caughtException = false;
- try {
- Conversion.Fix(O);
- }
- catch (Exception e) {
- AssertEquals("#F33", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#F34", true, caughtException);
-
- caughtException = false;
- try {
- Conversion.Fix(null);
- }
- catch (Exception e) {
- AssertEquals("#F35", typeof(ArgumentNullException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#F36", true, caughtException);
-
- }
-
- // Test the Int function
- public void TestInt() {
- System.Single Sng;
- System.Double Dbl;
- System.Decimal Dec;
- System.String S;
- System.Object O;
-
- AssertEquals("#I01", System.Int16.MaxValue, Conversion.Int(System.Int16.MaxValue));
- AssertEquals("#I02", System.Int16.MinValue, Conversion.Int(System.Int16.MinValue));
- AssertEquals("#I03", System.Int32.MaxValue, Conversion.Int(System.Int32.MaxValue));
- AssertEquals("#I04", System.Int32.MinValue, Conversion.Int(System.Int32.MinValue));
- AssertEquals("#I05", System.Int64.MaxValue, Conversion.Int(System.Int64.MaxValue));
- AssertEquals("#I06", System.Int64.MinValue, Conversion.Int(System.Int64.MinValue));
- AssertEquals("#I07", (System.Single)Math.Floor(System.Single.MaxValue), Conversion.Int(System.Single.MaxValue));
- AssertEquals("#I08", (System.Single)Math.Floor(System.Single.MinValue), Conversion.Int(System.Single.MinValue));
- AssertEquals("#I09", Math.Floor(System.Double.MaxValue), Conversion.Int(System.Double.MaxValue));
- AssertEquals("#I10", Math.Floor(System.Double.MinValue), Conversion.Int(System.Double.MinValue));
- AssertEquals("#I11", Decimal.Floor(System.Decimal.MaxValue), Conversion.Int(System.Decimal.MaxValue));
- AssertEquals("#I12", Decimal.Floor(System.Decimal.MinValue), Conversion.Int(System.Decimal.MinValue));
-
- Sng = 99.1F;
-
- AssertEquals("#I13", 99F, Conversion.Int(Sng));
-
- Sng = 99.6F;
-
- AssertEquals("#I14", 99F, Conversion.Int(Sng));
-
- Sng = -99.1F;
-
- AssertEquals("#I15", -100F, Conversion.Int(Sng));
-
- Sng = -99.6F;
-
- AssertEquals("#I16", -100F, Conversion.Int(Sng));
-
- Dbl = 99.1;
-
- AssertEquals("#I17", 99D, Conversion.Int(Dbl));
-
- Dbl = 99.6;
-
- AssertEquals("#I18", 99D, Conversion.Int(Dbl));
-
- Dbl = -99.1;
-
- AssertEquals("#I19", -100D, Conversion.Int(Dbl));
-
- Dbl = -99.6;
-
- AssertEquals("#I20", -100D, Conversion.Int(Dbl));
-
- Dec = 99.1M;
-
- AssertEquals("#I21", 99M, Conversion.Int(Dec));
-
- Dec = 99.6M;
-
- AssertEquals("#I22", 99M, Conversion.Int(Dec));
-
- Dec = -99.1M;
-
- AssertEquals("#I23", -100M, Conversion.Int(Dec));
-
- Dec = -99.6M;
-
- AssertEquals("#I24", -100M, Conversion.Int(Dec));
-
- Dbl = 99.1;
- S = Dbl.ToString();
-
- AssertEquals("#I25", 99D, Conversion.Int(S));
-
- Dbl = 99.6;
- S = Dbl.ToString();
-
- AssertEquals("#I26", 99D, Conversion.Int(S));
-
- Dbl = -99.1;
- S = Dbl.ToString();
-
- AssertEquals("#I27", -100D, Conversion.Int(S));
-
- Dbl = -99.6;
- S = Dbl.ToString();
-
- AssertEquals("#I28", -100D, Conversion.Int(S));
-
- Dbl = 99.1;
- O = Dbl;
-
- AssertEquals("#I29", 99D, Conversion.Int(O));
-
- Sng = 99.6F;
- O = Sng;
-
- AssertEquals("#I30", 99F, Conversion.Int(O));
-
- Dbl = -99.1;
- O = Dbl;
-
- AssertEquals("#I31", -100D, Conversion.Int(O));
-
- Dec = -99.6M;
- O = Dec;
-
- AssertEquals("#I32", -100M, Conversion.Int(O));
-
- // test the exceptions it's supposed to throw
-
- O = typeof(int);
- bool caughtException = false;
-
- try {
- Conversion.Fix(O);
- }
- catch (Exception e) {
- AssertEquals("#I33", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#I34", true, caughtException);
-
- caughtException = false;
- try {
- Conversion.Int(null);
- }
- catch (Exception e) {
- AssertEquals("#I35", typeof(ArgumentNullException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#I36", true, caughtException);
-
-
- }
-
- // test the Hex function
- public void TestHex() {
- AssertEquals("#H01", "FF", Conversion.Hex(System.Byte.MaxValue));
- AssertEquals("#H02", "0", Conversion.Hex(System.Byte.MinValue));
- AssertEquals("#H03", "7FFF", Conversion.Hex(System.Int16.MaxValue));
- AssertEquals("#H04", "8000", Conversion.Hex(System.Int16.MinValue));
- AssertEquals("#H05", "7FFFFFFF", Conversion.Hex(System.Int32.MaxValue));
- AssertEquals("#H06", "80000000", Conversion.Hex(System.Int32.MinValue));
- AssertEquals("#H07", "7FFFFFFFFFFFFFFF", Conversion.Hex(System.Int64.MaxValue));
- AssertEquals("#H08", "8000000000000000", Conversion.Hex(System.Int64.MinValue));
-
- System.Byte UI8;
- System.Int16 I16;
- System.Int32 I32;
- System.Int64 I64;
- System.Object O;
- System.String S;
-
- UI8 = 15;
- AssertEquals("#H09", "F", Conversion.Hex(UI8));
-
- I16 = System.Byte.MaxValue;
- AssertEquals("#H10", "FF", Conversion.Hex(I16));
-
- I16 = (System.Int16)((I16 + 1) * -1);
- AssertEquals("#H11", "FF00", Conversion.Hex(I16));
-
- I16 = -2;
- AssertEquals("#H12", "FFFE", Conversion.Hex(I16));
-
- I32 = System.UInt16.MaxValue;
- AssertEquals("#H13", "FFFF", Conversion.Hex(I32));
-
- I32 = (I32 + 1) * -1;
- AssertEquals("#H14", "FFFF0000", Conversion.Hex(I32));
-
- I32 = -2;
- AssertEquals("#H15", "FFFFFFFE", Conversion.Hex(I32));
-
- I64 = System.UInt32.MaxValue;
- AssertEquals("#H16", "FFFFFFFF", Conversion.Hex(I64));
-
- I64 = (I64 + 1) * -1;
- AssertEquals("#H17", "FFFFFFFF00000000", Conversion.Hex(I64));
-
- I64 = -2;
- AssertEquals("#H18", "FFFFFFFFFFFFFFFE", Conversion.Hex(I64));
-
- I16 = System.Byte.MaxValue;
- S = I16.ToString();
- AssertEquals("#H19", "FF", Conversion.Hex(S));
-
- I16 = (System.Int16)((I16 + 1) * -1);
- S = I16.ToString();
- AssertEquals("#H20", "FFFFFF00", Conversion.Hex(S));
-
- I16 = -1;
- S = I16.ToString();
- AssertEquals("#H21", "FFFFFFFF", Conversion.Hex(S));
-
- I32 = System.UInt16.MaxValue;
- S = I32.ToString();
- AssertEquals("#H22", "FFFF", Conversion.Hex(S));
-
- I32 = (I32 + 1) * -1;
- S = I32.ToString();
- AssertEquals("#H23", "FFFF0000", Conversion.Hex(S));
-
- I32 = -2;
- S = I32.ToString();
- AssertEquals("#H24", "FFFFFFFE", Conversion.Hex(S));
-
- I64 = System.UInt32.MaxValue;
- S = I64.ToString();
- AssertEquals("#H25", "FFFFFFFF", Conversion.Hex(S));
-
- I64 = (I64 + 1) * -1;
- S = I64.ToString();
- AssertEquals("#H26", "FFFFFFFF00000000", Conversion.Hex(S));
-
- UI8 = System.Byte.MaxValue;
- O = UI8;
- AssertEquals("#H27", "FF", Conversion.Hex(O));
-
- I16 = System.Byte.MaxValue;
- O = I16;
- AssertEquals("#H28", "FF", Conversion.Hex(O));
-
- I16 = (System.Int16)((I16 + 1) * -1);
- O = I16;
- AssertEquals("#H29", "FF00", Conversion.Hex(O));
-
- I16 = -2;
- O = I16;
- AssertEquals("#H30", "FFFE", Conversion.Hex(O));
-
- I32 = System.UInt16.MaxValue;
- O = I32;
- AssertEquals("#H31", "FFFF", Conversion.Hex(O));
-
- I32 = (I32 + 1) * -1;
- O = I32;
- AssertEquals("#H32", "FFFF0000", Conversion.Hex(O));
-
- I32 = -2;
- O = I32;
- AssertEquals("#H33", "FFFFFFFE", Conversion.Hex(O));
-
- I64 = System.UInt32.MaxValue;
- O = I64;
- AssertEquals("#H34", "FFFFFFFF", Conversion.Hex(O));
-
- I64 = (I64 + 1) * -1;
- O = I64;
- AssertEquals("#H35", "FFFFFFFF00000000", Conversion.Hex(O));
-
- I64 = -2;
- O = I64;
- // FIXME : MS doesn't pass this test
- //AssertEquals("#H35", "FFFFFFFFFFFFFFFE", Conversion.Hex(O));
-
- O = typeof(int);
-
- bool caughtException = false;
- try {
- Conversion.Hex(O);
- }
- catch (Exception e) {
- AssertEquals("#H36", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#H37", true, caughtException);
-
- caughtException = false;
-
- try {
- Conversion.Hex(null);
- }
- catch (Exception e) {
- AssertEquals("#H38", typeof(ArgumentNullException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#H39", true, caughtException);
- }
-
- // test the Oct function
- public void TestOct() {
- AssertEquals("#O01", "377", Conversion.Oct(System.Byte.MaxValue));
- AssertEquals("#O02", "0", Conversion.Oct(System.Byte.MinValue));
- AssertEquals("#O03", "77777", Conversion.Oct(System.Int16.MaxValue));
- AssertEquals("#O04", "100000", Conversion.Oct(System.Int16.MinValue));
- AssertEquals("#O05", "17777777777", Conversion.Oct(System.Int32.MaxValue));
- AssertEquals("#O06", "20000000000", Conversion.Oct(System.Int32.MinValue));
- AssertEquals("#O07", "777777777777777777777", Conversion.Oct(System.Int64.MaxValue));
- //AssertEquals("#O08", "1000000000000000000000", Conversion.Oct(System.Int64.MinValue));
-
- System.Byte UI8;
- System.Int16 I16;
- System.Int32 I32;
- System.Int64 I64;
- System.Object O;
- System.String S;
-
- UI8 = 15;
- AssertEquals("#O09", "17", Conversion.Oct(UI8));
-
- I16 = System.Byte.MaxValue;
- AssertEquals("#O10", "377", Conversion.Oct(I16));
-
- I16 = (System.Int16)((I16 + 1) * -1);
- AssertEquals("#O11", "177400", Conversion.Oct(I16));
-
- I16 = -2;
- AssertEquals("#O12", "177776", Conversion.Oct(I16));
-
- I32 = System.UInt16.MaxValue;
- AssertEquals("#O13", "177777", Conversion.Oct(I32));
-
- I32 = (I32 + 1) * -1;
- AssertEquals("#O14", "37777600000", Conversion.Oct(I32));
-
- I32 = -2;
- AssertEquals("#O15", "37777777776", Conversion.Oct(I32));
-
- I64 = System.UInt32.MaxValue;
- AssertEquals("#O16", "37777777777", Conversion.Oct(I64));
-
- I64 = (I64 + 1) * -1;
- AssertEquals("#O17", "1777777777740000000000", Conversion.Oct(I64));
-
- I64 = -2;
- AssertEquals("#O18", "1777777777777777777776", Conversion.Oct(I64));
-
- I16 = System.Byte.MaxValue;
- S = I16.ToString();
- AssertEquals("#O19", "377", Conversion.Oct(S));
-
- I16 = (System.Int16)((I16 + 1) * -1);
- S = I16.ToString();
- AssertEquals("#O20", "37777777400", Conversion.Oct(S));
-
- I16 = -2;
- S = I16.ToString();
- AssertEquals("#O21", "37777777776", Conversion.Oct(S));
-
- I32 = System.UInt16.MaxValue;
- S = I32.ToString();
- AssertEquals("#O22", "177777", Conversion.Oct(S));
-
- I32 = (I32 + 1) * -1;
- S = I32.ToString();
- AssertEquals("#O23", "37777600000", Conversion.Oct(S));
-
- I32 = -2;
- S = I32.ToString();
- AssertEquals("#O24", "37777777776", Conversion.Oct(S));
-
- I64 = System.UInt32.MaxValue;
- S = I64.ToString();
- AssertEquals("#O25", "37777777777", Conversion.Oct(S));
-
- I64 = (I64 + 1) * -1;
- S = I64.ToString();
- AssertEquals("#O26", "1777777777740000000000", Conversion.Oct(S));
-
- UI8 = System.Byte.MaxValue;
- O = UI8;
- AssertEquals("#O27", "377", Conversion.Oct(O));
-
- I16 = System.Byte.MaxValue;
- O = I16;
- AssertEquals("#O28", "377", Conversion.Oct(O));
-
- I16 = (System.Int16)((I16 + 1) * -1);
- O = I16;
- AssertEquals("#O29", "177400", Conversion.Oct(O));
-
- I16 = -2;
- O = I16;
- AssertEquals("#O29", "177776", Conversion.Oct(O));
-
- I32 = System.UInt16.MaxValue;
- O = I32;
- AssertEquals("#O30", "177777", Conversion.Oct(O));
-
- I32 = (I32 + 1) * -1;
- O = I32;
- AssertEquals("#O31", "37777600000", Conversion.Oct(O));
-
- I32 = -2;
- O = I32;
- AssertEquals("#O32", "37777777776", Conversion.Oct(O));
-
- I64 = System.UInt32.MaxValue;
- O = I64;
- AssertEquals("#O33", "37777777777", Conversion.Oct(O));
-
- I64 = (I64 + 1) * -1;
- O = I64;
- AssertEquals("#O34", "1777777777740000000000", Conversion.Oct(O));
-
- I64 = -2;
- O = I64;
-
- // FIXME: MS doesn't pass this test
- // AssertEquals("#O35", "1777777777777777777776", Conversion.Oct(O));
-
- O = typeof(int);
-
- bool caughtException = false;
- try {
- Conversion.Oct(O);
- }
- catch (Exception e) {
- AssertEquals("#O36", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#O37", true, caughtException);
-
- caughtException = false;
-
- try {
- Conversion.Oct(null);
- }
- catch (Exception e) {
- AssertEquals("#O38", typeof(ArgumentNullException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#O39", true, caughtException);
- }
-
- // test the Str function
- public void TestStr() {
- AssertEquals("#S01", "-1", Conversion.Str(-1));
- AssertEquals("#S02", " 1", Conversion.Str(1));
-
- bool caughtException = false;
- Object O = typeof(int);
-
- try {
- Conversion.Str(O);
- }
- catch (Exception e) {
- AssertEquals("#S03", typeof(InvalidCastException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#S04", true, caughtException);
-
- caughtException = false;
-
- try {
- Conversion.Str(null);
- }
- catch (Exception e) {
- AssertEquals("#S05", typeof(ArgumentNullException), e.GetType());
- caughtException = true;
- }
- }
-
- // Test the Val function
- public void TestVal() {
- AssertEquals("#V01", 4, Conversion.Val('4'));
- AssertEquals("#V02", -3542.76, Conversion.Val(" - 3 5 .4 2 7 6E+ 0 0 2 "));
- AssertEquals("#V03", 255D, Conversion.Val("&HFF"));
- AssertEquals("#V04", 255D, Conversion.Val("&o377"));
-
- System.Object O = " - 3 5 .4 7 6E+ 0 0 3";
-
- AssertEquals("#V05", -35476D, Conversion.Val(O));
-
- bool caughtException;
-
- caughtException = false;
-
- try {
- Conversion.Val("3E+9999999");
- }
- catch (Exception e) {
- AssertEquals("#V06", typeof(OverflowException), e.GetType());
- caughtException = true;
- }
-
- AssertEquals("#V07", true, caughtException);
-
- caughtException = false;
-
- try {
- Conversion.Val(typeof(int));
- }
- catch (Exception e) {
- AssertEquals("#V08", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
- AssertEquals("#V09", true, caughtException);
- }
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs b/mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs
deleted file mode 100644
index 63dc4162884..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Test/DateAndTimeTest.cs
+++ /dev/null
@@ -1,380 +0,0 @@
-// Collection.cs - NUnit Test Cases for Microsoft.VisualBasic.Collection
-//
-// Author:
-// Chris J. Breisch (cjbreisch@altavista.net)
-//
-// (C) Chris J. Breisch
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using Microsoft.VisualBasic;
-
-namespace MonoTests.Microsoft.VisualBasic
-{
-
- public class DateAndTimeTest : TestCase {
-
- public DateAndTimeTest() : base ("Microsoft.VisualBasic.DateAndTime") {}
- public DateAndTimeTest(string name) : base(name) {}
-
- protected override void SetUp() {}
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(DateAndTimeTest));
- }
- }
-
- public void TestDateString() {
- string s = DateAndTime.DateString;
- DateTime dtNow = DateTime.Today;
- AssertEquals("#DS01", dtNow.ToShortDateString(), DateTime.Parse(s).ToShortDateString());
-
- // TODO: Add a test for setting the date string too
- }
-
- public void TestToday() {
- AssertEquals("#TO01", DateTime.Today, DateAndTime.Today);
-
- // TODO: Add a test for setting Today
- }
-
- public void TestTimer() {
- double secTimer = DateAndTime.Timer;
- DateTime dtNow = DateTime.Now;
- double secNow = dtNow.Hour * 3600 + dtNow.Minute * 60 + dtNow.Second + (dtNow.Millisecond + 1) / 1000D;
- double secTimer2 = DateAndTime.Timer + .001;
-
- // waste a little time
- for (int i = 0; i < int.MaxValue; i++);
-
- // get another timer
- double secTimer3 = DateAndTime.Timer;
-
- // should be same time within a reasonable tolerance
- Assert("#TI01", secNow >= secTimer);
- Assert("#TI02", secTimer2 >= secNow);
-
- // third timer should be greater than the first
- Assert("#TI03", secTimer3 > secTimer);
- }
-
- public void TestNow() {
- DateTime dtNow = DateTime.Now;
- DateTime dtTest = DateAndTime.Now;
- DateTime dtNow2 = DateTime.Now;
-
- Assert("#N01", dtTest >= dtNow);
- Assert("#N02", dtNow2 >= dtTest);
- }
-
- public void TestTimeOfDay() {
- DateTime dtNow = DateTime.Now;
- TimeSpan tsNow = new TimeSpan(dtNow.Hour, dtNow.Minute, dtNow.Second);
- DateTime dtTest = DateAndTime.TimeOfDay;
- TimeSpan tsTest = new TimeSpan(dtTest.Hour, dtTest.Minute, dtTest.Second);
- DateTime dtNow2 = DateTime.Now;
- TimeSpan tsNow2 = new TimeSpan(dtNow2.Hour, dtNow2.Minute, dtNow2.Second);
-
- Assert("#TOD01", tsTest.Ticks >= tsNow.Ticks);
- Assert("#TOD02", tsNow2.Ticks >= tsTest.Ticks);
-
- // TODO: add a test case for setting time of day
- }
-
- public void TestTimeString() {
- DateTime dtNow = DateTime.Now;
- TimeSpan tsNow = new TimeSpan(dtNow.Hour, dtNow.Minute, dtNow.Second);
- string s = DateAndTime.TimeString;
- DateTime dtTest = DateTime.Parse(s);
- TimeSpan tsTest = new TimeSpan(dtTest.Hour, dtTest.Minute, dtTest.Second);
- DateTime dtNow2 = DateTime.Now;
- TimeSpan tsNow2 = new TimeSpan(dtNow2.Hour, dtNow2.Minute, dtNow2.Second);
-
- Assert("#TS01", tsTest.Ticks >= tsNow.Ticks);
- Assert("#TS02", tsNow2.Ticks >= tsTest.Ticks);
-
- // TODO: add a test case for setting TimeString
- }
-
- public void TestDateAdd() {
- DateTime dtNow = DateTime.Now;
-
- AssertEquals("#DA01", dtNow.AddYears(1), DateAndTime.DateAdd(DateInterval.Year, 1, dtNow));
- AssertEquals("#DA02", dtNow.AddYears(-1), DateAndTime.DateAdd("yyyy", -1, dtNow));
-
-
- bool caughtException = false;
-
- try {
- DateAndTime.DateAdd("foo", 1, dtNow);
- }
- catch (Exception e) {
- AssertEquals("#DA03", e.GetType(), typeof(ArgumentException));
- caughtException = true;
- }
-
- AssertEquals("#DA04", caughtException, true);
-
- AssertEquals("#DA05", dtNow.AddMonths(6), DateAndTime.DateAdd(DateInterval.Quarter, 2, dtNow));
- AssertEquals("#DA06", dtNow.AddMonths(-6), DateAndTime.DateAdd("q", -2, dtNow));
-
- AssertEquals("#DA07", dtNow.AddMonths(3), DateAndTime.DateAdd(DateInterval.Month, 3, dtNow));
- AssertEquals("#DA08", dtNow.AddMonths(-3), DateAndTime.DateAdd("m", -3, dtNow));
-
- AssertEquals("#DA09", dtNow.AddDays(28), DateAndTime.DateAdd(DateInterval.WeekOfYear, 4, dtNow));
- AssertEquals("#DA10", dtNow.AddDays(-28), DateAndTime.DateAdd("ww", -4, dtNow));
-
- AssertEquals("#DA11", dtNow.AddDays(5), DateAndTime.DateAdd(DateInterval.Weekday, 5, dtNow));
- AssertEquals("#DA12", dtNow.AddDays(-5), DateAndTime.DateAdd("w", -5, dtNow));
-
- AssertEquals("#DA13", dtNow.AddDays(6), DateAndTime.DateAdd(DateInterval.DayOfYear, 6, dtNow));
- AssertEquals("#DA14", dtNow.AddDays(-6), DateAndTime.DateAdd("y", -6, dtNow));
-
- AssertEquals("#DA15", dtNow.AddDays(7), DateAndTime.DateAdd(DateInterval.Day, 7, dtNow));
- AssertEquals("#DA16", dtNow.AddDays(-7), DateAndTime.DateAdd("d", -7, dtNow));
-
- AssertEquals("#DA17", dtNow.AddHours(8), DateAndTime.DateAdd(DateInterval.Hour, 8, dtNow));
- AssertEquals("#DA18", dtNow.AddHours(-8), DateAndTime.DateAdd(DateInterval.Hour, -8, dtNow));
-
- AssertEquals("#DA19", dtNow.AddMinutes(9), DateAndTime.DateAdd(DateInterval.Minute, 9, dtNow));
- AssertEquals("#DA20", dtNow.AddMinutes(-9), DateAndTime.DateAdd("n", -9, dtNow));
-
- AssertEquals("#DA21", dtNow.AddSeconds(10), DateAndTime.DateAdd(DateInterval.Second, 10, dtNow));
- AssertEquals("#DA22", dtNow.AddSeconds(-10), DateAndTime.DateAdd("s", -10, dtNow));
-
- caughtException = false;
-
- try {
- DateAndTime.DateAdd(DateInterval.Year, int.MinValue, dtNow);
- }
- catch (Exception e) {
- caughtException = true;
- AssertEquals("#DA23", e.GetType(), typeof(Exception));
- }
-
- // AssertEquals("#DA24", caughtException, true);
- }
-
- public void TestDateDiff () {
- DateTime dtNow = DateTime.Now;
- DateTime dtOld = dtNow.AddYears(-1);
-
- // TODO: Test this better
- long diff = DateAndTime.DateDiff(DateInterval.Year, dtOld, dtNow, FirstDayOfWeek.System, FirstWeekOfYear.System);
-
- AssertEquals("#DD01", dtNow, dtOld.AddYears((int)diff));
-
- DateTime dtJan1 = new DateTime(2002, 1, 1);
- DateTime dtDec31 = new DateTime(2001, 12, 31);
-
- diff = DateAndTime.DateDiff(DateInterval.Year, dtDec31, dtJan1, FirstDayOfWeek.System, FirstWeekOfYear.System);
-
- AssertEquals("#DD02", 1L, diff);
-
- diff = DateAndTime.DateDiff(DateInterval.Quarter, dtDec31, dtJan1, FirstDayOfWeek.System, FirstWeekOfYear.System);
-
- AssertEquals("#DD03", 1L, diff);
-
- diff = DateAndTime.DateDiff(DateInterval.Month, dtDec31, dtJan1, FirstDayOfWeek.System, FirstWeekOfYear.System);
-
- AssertEquals("#DD04", 1L, diff);
-
- DateTime dtJan4 = new DateTime(2001, 1, 4); // This is a Thursday
- DateTime dtJan9 = new DateTime(2001, 1, 9); // This is the next Tuesday
-
-
- long WD = DateAndTime.DateDiff(DateInterval.Weekday, dtJan4, dtJan9, FirstDayOfWeek.System, FirstWeekOfYear.System);
-
- AssertEquals ("#DD05", 0L, WD);
-
- long WY = DateAndTime.DateDiff(DateInterval.WeekOfYear, dtJan4, dtJan9, FirstDayOfWeek.System, FirstWeekOfYear.System);
-
- AssertEquals ("#DD06", 1L, WY);
- }
-
- public void TestDatePart () {
- DateTime dtJan4 = new DateTime(2001, 1, 4);
-
- // TODO: Test this better
-
- AssertEquals("#DP01", 2001, DateAndTime.DatePart(DateInterval.Year, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
- AssertEquals("#DP02", 1, DateAndTime.DatePart(DateInterval.Quarter, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
- AssertEquals("#DP03", 1, DateAndTime.DatePart(DateInterval.Month, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
- AssertEquals("#DP04", 1, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP05", 53, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.FirstFullWeek));
- AssertEquals("#DP06", 1, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.Jan1));
- AssertEquals("#DP07", 1, DateAndTime.DatePart(DateInterval.WeekOfYear, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.System));
- AssertEquals("#DP08", 7, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Friday, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP09", 6, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Saturday, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP10", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Sunday, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP11", 4, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Monday, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP12", 3, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Tuesday, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP13", 2, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Wednesday, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP14", 1, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.Thursday, FirstWeekOfYear.FirstFourDays));
- AssertEquals("#DP15", 5, DateAndTime.DatePart(DateInterval.Weekday, dtJan4, FirstDayOfWeek.System, FirstWeekOfYear.FirstFourDays));
-
-
- }
-
- public void TestDateSerial () {
- DateTime dtJan4 = new DateTime(2001, 1, 4);
- DateTime dtSerial = DateAndTime.DateSerial(2001, 1, 4);
-
- AssertEquals("#DS01", dtJan4, dtSerial);
- }
-
- public void TestTimeSerial () {
- bool caughtException = false;
-
- try {
- DateAndTime.TimeSerial(0, -1440, -1);
- }
- catch (Exception e) {
- AssertEquals("#TS01", e.GetType(), typeof(ArgumentOutOfRangeException));
- caughtException = true;
- }
- AssertEquals("#TS02", true, caughtException);
-
- AssertEquals("#TS03", new DateTime(1, 1, 1, 1, 1, 1), DateAndTime.TimeSerial(1, 1, 1));
-
- }
-
- public void TestDateValue () {
- bool caughtException = false;
-
- try {
- DateAndTime.DateValue("This is not a date.");
- }
- catch (Exception e) {
- AssertEquals ("#DV01", e.GetType(), typeof(InvalidCastException));
- caughtException = true;
- }
- AssertEquals("#DV02", true, caughtException);
-
- AssertEquals("#DV03", new DateTime(1969, 2, 12), DateAndTime.DateValue("February 12, 1969"));
- }
-
- public void TestTimeValue () {
- bool caughtException = false;
-
- try {
- DateAndTime.TimeValue("This is not a time.");
- }
- catch (Exception e) {
- AssertEquals ("#TV01", e.GetType(), typeof(InvalidCastException));
- caughtException = true;
- }
- AssertEquals("#TV02", true, caughtException);
-
- AssertEquals("#TV03", new DateTime(1, 1, 1, 16, 35, 17), DateAndTime.TimeValue("4:35:17 PM"));
- }
-
- public void TestYear () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#Y01", jan1.Year, DateAndTime.Year(jan1));
- }
-
- public void TestMonth () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#MO01", jan1.Month, DateAndTime.Month(jan1));
- }
-
- public void TestDay () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#D01", jan1.Day, DateAndTime.Day(jan1));
- }
-
- public void TestHour () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#H01", jan1.Hour, DateAndTime.Hour(jan1));
- }
-
- public void TestMinute () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#MI01", jan1.Minute, DateAndTime.Minute(jan1));
- }
-
- public void TestSecond () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#S01", jan1.Second, DateAndTime.Second(jan1));
- }
-
- public void TestWeekday () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#W01", (int)jan1.DayOfWeek + 1, DateAndTime.Weekday(jan1, FirstDayOfWeek.System));
- }
-
- public void TestMonthName () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#MN01", CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedMonthName(jan1.Month),
- DateAndTime.MonthName(jan1.Month, true));
- AssertEquals("#MN02", CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(jan1.Month),
- DateAndTime.MonthName(jan1.Month, false));
-
- bool caughtException = false;
-
- try {
- DateAndTime.MonthName(0, false);
- }
- catch (Exception e) {
- AssertEquals("#MN03", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
- AssertEquals("#MN04", true, caughtException);
-
- caughtException = false;
-
- try {
- DateAndTime.MonthName(14, false);
- }
- catch (Exception e) {
- AssertEquals("#MN05", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
- AssertEquals("#MN06", true, caughtException);
-
- //AssertEquals("#MN07", "", DateAndTime.MonthName(13, false));
- }
-
- public void TestWeekdayName () {
- DateTime jan1 = new DateTime(2001, 1, 1, 1, 1, 1);
- AssertEquals("#WN01", CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedDayName(jan1.DayOfWeek),
- DateAndTime.WeekdayName((int)jan1.DayOfWeek + 1, true, FirstDayOfWeek.System));
- AssertEquals("#WN02", CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(jan1.DayOfWeek),
- DateAndTime.WeekdayName((int)jan1.DayOfWeek + 1, false, FirstDayOfWeek.System));
-
- bool caughtException = false;
-
- try {
- DateAndTime.WeekdayName(0, false, FirstDayOfWeek.System);
- }
- catch (Exception e) {
- AssertEquals("#WN03", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
- AssertEquals("#WN04", true, caughtException);
-
- caughtException = false;
-
- try {
- DateAndTime.WeekdayName(8, false, FirstDayOfWeek.System);
- }
- catch (Exception e) {
- AssertEquals("#WN05", typeof(ArgumentException), e.GetType());
- caughtException = true;
- }
- AssertEquals("#WN06", true, caughtException);
-
- AssertEquals("#WN07", "Monday", DateAndTime.WeekdayName((int)jan1.DayOfWeek + 1, false, FirstDayOfWeek.System));
- }
-
-
-
-
-
- }
-}
diff --git a/mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build b/mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build
deleted file mode 100644
index 3e205b08b8f..00000000000
--- a/mcs/class/Microsoft.VisualBasic/Test/Microsoft.VisualBasic_test.build
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.Data_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="System.Data_test" default="build">
- <property name="debug" value="false"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- </target>
-
- <target name="assemblies">
- <csc target="library" output="Microsoft.VisualBasic_test.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="TheTests.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
- <!--<arg value="/lib:../../lib/"/>-->
-
- <!-- cor compare dies with these currently -->
- <!--<arg value="/nostdlib"/>--> <!-- don't reference mscorlib -->
- <!--<arg value="/r:corlib.dll"/>-->
- <arg value="/r:System.dll"/>
- <arg value="/r:.\Microsoft.VisualBasic.dll"/>
- </csc>
-
-<!--
- <csc target="exe" output="RunTests.Microsoft.VisualBasic.exe" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="AllTests.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitBase.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- <arg value="/noconfig"/>
- <arg value="/r:..\..\lib\corlib.dll"/>
- <arg value="/r:..\..\lib\System.dll"/>
- <arg value="/r:..\..\lib\Microsoft.VisualBasic.dll"/>
- </csc>
-
--->
- </target>
-
- <target name="test" depends="assemblies">
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,Microsoft.VisualBasic_test.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="Microsoft.VisualBasic.dll" failonerror="false"/>
- <delete file="Microsoft.VisualBasic_test.dll" failonerror="false"/>
- <delete file="corlib.dll" failonerror="false"/>
- <delete file="System.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/Mono.CSharp.Debugger/AssemblerWriterI386.cs b/mcs/class/Mono.CSharp.Debugger/AssemblerWriterI386.cs
deleted file mode 100644
index 58ce935bdd0..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/AssemblerWriterI386.cs
+++ /dev/null
@@ -1,311 +0,0 @@
-//
-// Mono.CSharp.Debugger/AssemblerWriterI386.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// IAssemblerWriter implementation for the Intel i386.
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.IO;
-
-namespace Mono.CSharp.Debugger
-{
- public class AssemblerWriterI386 : IAssemblerWriter
- {
- public AssemblerWriterI386 (StreamWriter writer) {
- this.writer = writer;
- writer.WriteLine ("#NOAPP");
- }
-
- private StreamWriter writer;
- private static int next_anon_label_idx = 0;
- private bool in_section = false;
-
- public void WriteLabel (string label)
- {
- writer.WriteLine (".L_" + label + ":");
- }
-
- public int GetNextLabelIndex ()
- {
- return ++next_anon_label_idx;
- }
-
- public int WriteLabel ()
- {
- int index = ++next_anon_label_idx;
-
- WriteLabel (index);
-
- return index;
- }
-
- public void WriteLabel (int index)
- {
- char[] output = { '.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
- ':', '\n' };
-
- unchecked {
- int value = (int) index;
- output [3] = hex [(value & 0xf00000) >> 20];
- output [4] = hex [(value & 0x0f0000) >> 16];
- output [5] = hex [(value & 0x00f000) >> 12];
- output [6] = hex [(value & 0x000f00) >> 8];
- output [7] = hex [(value & 0x0000f0) >> 4];
- output [8] = hex [(value & 0x00000f)];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- private static readonly char[] hex = { '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-
- public void WriteUInt8 (bool value)
- {
- WriteUInt8 (value ? 1 : 0);
- }
-
- public void WriteUInt8 (int value)
- {
- char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
- '0', 'x', '\0', '\0',
- '\n' };
-
- unchecked {
- output [9] = hex [(value & 0xf0) >> 4];
- output [10] = hex [value & 0x0f];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- public void WriteInt8 (int value)
- {
- char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
- '0', 'x', '\0', '\0',
- '\n' };
-
- unchecked {
- uint uvalue = (uint) value;
- output [9] = hex [(uvalue & 0xf0) >> 4];
- output [10] = hex [uvalue & 0x0f];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- public void Write2Bytes (int a, int b)
- {
- char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
- '0', 'x', '\0', '\0', ',', ' ',
- '0', 'x', '\0', '\0',
- '\n' };
-
- unchecked {
- uint ua = (uint) a;
- uint ub = (uint) b;
- output [9] = hex [(ua & 0xf0) >> 4];
- output [10] = hex [ua & 0x0f];
- output [15] = hex [(ub & 0xf0) >> 4];
- output [16] = hex [ub & 0x0f];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- public void WriteUInt16 (int value)
- {
- writer.WriteLine ("\t.word " + value);
- }
-
- public void WriteInt16 (int value)
- {
- writer.WriteLine ("\t.word " + value);
- }
-
- public void WriteUInt32 (int value)
- {
- char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
- '0', 'x', '\0', '\0', '\0', '\0', '\0', '\0',
- '\0', '\0', '\n' };
-
- unchecked {
- output [9] = hex [(value & 0xf0000000) >> 28];
- output [10] = hex [(value & 0x0f000000) >> 24];
- output [11] = hex [(value & 0x00f00000) >> 20];
- output [12] = hex [(value & 0x000f0000) >> 16];
- output [13] = hex [(value & 0x0000f000) >> 12];
- output [14] = hex [(value & 0x00000f00) >> 8];
- output [15] = hex [(value & 0x000000f0) >> 4];
- output [16] = hex [(value & 0x0000000f)];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- public void WriteInt32 (int value)
- {
- char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
- '0', 'x', '\0', '\0', '\0', '\0', '\0', '\0',
- '\0', '\0', '\n' };
-
- unchecked {
- uint uvalue = (uint) value;
- output [9] = hex [(uvalue & 0xf0000000) >> 28];
- output [10] = hex [(uvalue & 0x0f000000) >> 24];
- output [11] = hex [(uvalue & 0x00f00000) >> 20];
- output [12] = hex [(uvalue & 0x000f0000) >> 16];
- output [13] = hex [(uvalue & 0x0000f000) >> 12];
- output [14] = hex [(uvalue & 0x00000f00) >> 8];
- output [15] = hex [(uvalue & 0x000000f0) >> 4];
- output [16] = hex [(uvalue & 0x0000000f)];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- public void WriteSLeb128 (int value)
- {
- writer.WriteLine ("\t.sleb128 " + value);
- }
-
- public void WriteULeb128 (int value)
- {
- writer.WriteLine ("\t.uleb128 " + value);
- }
-
- public void WriteAddress (int value)
- {
- if (value == 0)
- writer.WriteLine ("\t.long 0");
- else
- writer.WriteLine ("\t.long " + value);
- }
-
- public void WriteString (string value)
- {
- writer.WriteLine ("\t.string \"" + value + "\"");
- }
-
- public void WriteSectionStart (String section)
- {
- if (in_section)
- throw new Exception ();
- in_section = true;
- writer.WriteLine ("\t.section ." + section);
- }
-
- public void WriteSectionEnd ()
- {
- in_section = false;
- }
-
- public void WriteRelativeOffset (int start_label, int end_label)
- {
- char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
- '.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
- ' ', '-', ' ',
- '.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
- '\n' };
-
- unchecked {
- output [10] = hex [(end_label & 0xf00000) >> 20];
- output [11] = hex [(end_label & 0x0f0000) >> 16];
- output [12] = hex [(end_label & 0x00f000) >> 12];
- output [13] = hex [(end_label & 0x000f00) >> 8];
- output [14] = hex [(end_label & 0x0000f0) >> 4];
- output [15] = hex [(end_label & 0x00000f)];
- output [22] = hex [(start_label & 0xf00000) >> 20];
- output [23] = hex [(start_label & 0x0f0000) >> 16];
- output [24] = hex [(start_label & 0x00f000) >> 12];
- output [25] = hex [(start_label & 0x000f00) >> 8];
- output [26] = hex [(start_label & 0x0000f0) >> 4];
- output [27] = hex [(start_label & 0x00000f)];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- public void WriteShortRelativeOffset (int start_label, int end_label)
- {
- char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
- '.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
- ' ', '-', ' ',
- '.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
- '\n' };
-
- unchecked {
- output [10] = hex [(end_label & 0xf00000) >> 20];
- output [11] = hex [(end_label & 0x0f0000) >> 16];
- output [12] = hex [(end_label & 0x00f000) >> 12];
- output [13] = hex [(end_label & 0x000f00) >> 8];
- output [14] = hex [(end_label & 0x0000f0) >> 4];
- output [15] = hex [(end_label & 0x00000f)];
- output [22] = hex [(start_label & 0xf00000) >> 20];
- output [23] = hex [(start_label & 0x0f0000) >> 16];
- output [24] = hex [(start_label & 0x00f000) >> 12];
- output [25] = hex [(start_label & 0x000f00) >> 8];
- output [26] = hex [(start_label & 0x0000f0) >> 4];
- output [27] = hex [(start_label & 0x00000f)];
- }
-
- writer.Write (output, 0, output.Length);
- }
-
- public void WriteAbsoluteOffset (string label)
- {
- writer.WriteLine ("\t.long .L_" + label);
- }
-
- public void WriteAbsoluteOffset (int index)
- {
- char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
- '.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
- '\n' };
-
- unchecked {
- output [10] = hex [(index & 0xf00000) >> 20];
- output [11] = hex [(index & 0x0f0000) >> 16];
- output [12] = hex [(index & 0x00f000) >> 12];
- output [13] = hex [(index & 0x000f00) >> 8];
- output [14] = hex [(index & 0x0000f0) >> 4];
- output [15] = hex [(index & 0x00000f)];
- }
-
- writer.Write (output, 0, output.Length);
-
- }
-
- public object StartSubsectionWithSize ()
- {
- int start_index = ++next_anon_label_idx;
- int end_index = ++next_anon_label_idx;
-
- WriteRelativeOffset (start_index, end_index);
- WriteLabel (start_index);
-
- return end_index;
- }
-
- public object StartSubsectionWithShortSize ()
- {
- int start_index = ++next_anon_label_idx;
- int end_index = ++next_anon_label_idx;
-
- WriteShortRelativeOffset (start_index, end_index);
- WriteLabel (start_index);
-
- return end_index;
- }
-
- public void EndSubsection (object end_index)
- {
- WriteLabel ((int) end_index);
- }
- }
-}
diff --git a/mcs/class/Mono.CSharp.Debugger/ChangeLog b/mcs/class/Mono.CSharp.Debugger/ChangeLog
deleted file mode 100644
index fd1fc4d8c99..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/ChangeLog
+++ /dev/null
@@ -1,222 +0,0 @@
-2002-05-30 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter (IMonoSymbolWriter): Added custom `Initialize' method.
-
- * MonoSymbolWriter.cs (Initialize): The ISymbolWriter's `Initialize' method
- is no longer supported and throws an exception.
- (Initialize (string, string[])): New custom initialization function.
-
- * MonoDwarfFileWriter.cs (DwarfFileWriter): Added `string[] args' argument
- to the constructor to pass command line arguments.
-
- * gdb-csharp-support.patch: Updated for GDB 5.2.
-
-2002-05-30 Martin Baulig <martin@gnome.org>
-
- * MonoSymbolWriter.cs (MonoSymbolWriter): The constructor now get's the
- AssemblyBuilder's `methods' array as third argument.
- (OpenMethod): Use this array to get the method builder rather than using an
- interncall for it.
- (get_method_builder): Removed this interncall.
-
-2002-05-25 Martin Baulig <martin@gnome.org>
-
- * MonoDwarfFileWriter.cs: Finished the type rewrite, put back strings and arrays.
-
-2002-05-24 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (ISourceMethod): Added `FullName' and `Parameters'.
- (ITypeHandle): New interface.
-
- * DwarfFileWriter.cs: Largely reorganized the type writing code. Types are
- now represented by ITypeHandle objects which are stored in a per-dwarf-writer
- hash table. At the moment, all types still need to be in one compile unit due
- to lacking support in gdb - but this new type code here already supports this.
-
- * MonoSymbolWriter.cs: Moved all the subclasses to the top-level and made them
- public, cleaned up the code, put everything into one compile unit.
- (DefineLocalVariable): Added a version of this function which takes useful args.
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (IMonoSymbolWriter): Added `Sources' and `Methods'
- properties.
-
- * MonoDwarfFileWriter.cs (WriteSymbolTable): New public method. Moved the
- code that writes the "mono_line_numbers" section here from the LineNumberEngine.
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (IVariable): Replaced Token with `ISourceMethod Method'.
-
- * MonoSymbolWriter.cs (MonoSymbolWriter): The constructor now has an additional
- ModuleBuilder argument.
- (OpenMethod): Immediately call the `get_method' interncall to get the MethodBase
- from the token, then store the MethodBase instead of the token. The token may
- still change during the metadata library's fixup process.
- (DoFixups): When the image has been written to disk, call the GetToken () method
- on all MethodBuilders and all ConstructorBuilders to get the final metadata tokens.
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * AssemblerWriterI386.cs: Don't use GNU extensions and produce assembler
- output which is free of comments and extra whitespaces so that it's suitable
- for `as -f'.
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (ISourceMethod): Replaced `MethodInfo MethodInfo' with
- `MethodBase MethodBase' and added `Type ReturnType'. We're now correctly
- dealing with constructors and not crashing anymore.
-
-2002-05-21 Martin Baulig <martin@gnome.org>
-
- * MonoDwarfFileWriter.cs: Write a special line number table which can be read
- in by the metadata library to get line number information in backtraces.
-
-2002-05-06 Martin Baulig <martin@gnome.org>
-
- * MonoSymbolWriter.cs (MonoSymbolWriter.Close): Use Assembly.LoadFrom (), not
- AppDomain.Load () to load the assembly.
-
-2002-04-26 Martin Baulig <martin@gnome.org>
-
- * gdb-csharp-support.patch: A patch for GDB (against the latest CVS version)
- to implement C# support.
-
- * csharp-lang.c, csharp-lang.h, csharp-mono-lang.c: Copy these into your GDB
- source directory after applying the patch.
-
-2002-04-26 Martin Baulig <martin@gnome.org>
-
- * MonoDwarfFileWriter.cs (DieInternalString): Removed.
-
-2002-04-25 Martin Baulig <martin@gnome.org>
-
- * MonoDwarfFileWriter.cs: Reflect latest MonoString changes.
-
-2002-04-13 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (ISourceBlock): Added `Blocks' property and `AddBlock'
- method to support nested blocks.
-
- * MonoSymbolWriter.cs: Correctly handle nested blocks.
-
- * MonoDwarfFileWriter.cs (DieMember): Provide info for all fields, not just for
- public ones; also added DW_AT_accessibility.
- (DieVariable): Reflected latest debug-symfile.c changes.
-
-2002-04-12 Martin Baulig <martin@gnome.org>
-
- * gdb-variable-scopes.patch: A patch for GDB (against the latest CVS version)
- to implement variable lifetimes.
-
-2002-04-12 Martin Baulig <martin@gnome.org>
-
- * MonoDwarfFileWriter.cs (DieVariable): Provide info about the variable's
- lifetime using DW_AT_begin_scope and a new baulig extension DW_AT_end_scope.
-
-2002-03-29 Martin Baulig <martin@gnome.org>
-
- * AssemblerWriterI386.cs: Rewrote most of the string output function, do the
- number->string conversion manually. It's now taking about 15 seconds to write
- a symbol file for MCS, no longer more than a minute.
-
- * MonoDwarfFileWriter.cs: Added some profiling code, speeded things up, fixed
- a few bugs.
-
-2002-03-25 Martin Baulig <martin@gnome.org>
-
- * MonoDwarfFileWriter.cs (CreateType): Return a `DieType'.
- (RegisterType): Add the type to the type hash before creating dependency types
- so we don't get recursion loops.
- (RegisterPointerType): New func to register a "pointer to type" type.
- (DieTypeDef, DiePointerType, DieArrayType, DieStringType, DieClassType): New
- types; added support for strings, arrays and basic support for classes.
-
-2002-03-24 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs: Killed all methods in this interface, no longer needed.
-
- * MonoSymbolWriter.cs (MonoSymbolWriter): The constructor now takes a string
- argument which is the full pathname of the assembly - you must call Close()
- after the assembly has been written to disk since the symbol writer needs to
- load the finished assembly to get its metadata.
-
- * MonoDwarfFileWriter.cs: Added support for enums and structs.
-
-2002-03-24 Martin Baulig <martin@gnome.org>
-
- * MonoDwarfFileWriter.cs: Added support for method parameters.
-
-2002-03-24 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (IMonoSymbolWriter): Removed my custom OpenMethod(),
- we're now using the ISymbolWriter's method.
- (IVariable): Added `byte[] Signature' property.
-
- * MonoSymbolWriter.cs (SetAssembly): New method. This must be called before
- Close(); the assembly parameter is the already-written assembly, ie. it must
- contain the full metadata.
- (OpenMethod): Only take the token argument and set MethodInfo later in DoFixups.
- (SetMethodSourceRange): You must call this function to tell the symbol writer
- in which source file the method is defined.
- (DefineLocal): Store the signature in the local.
- (DoFixups): Use two new interncalls to set the SourceMethod's MethodInfo field
- and the LocalVariable's Type field.
-
-2002-03-23 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (ISourceBlock): New interface.
- (ILocalVariable): Renamed this interface to IVariable.
- (IVariable): Added Line, Type, Token.
- (ILocalVariable, IMethodParameter): New interfaces, derive from IVariable.
- (ISourceMethod): Added Blocks. Renamed FirstLine and LastLine to Start and End,
- changed their type to ISourceLine. Removed CodeSize.
- (ISourceLine): Renamed Line to Row, added Column. Added OffsetType and Offset.
-
- * MonoDwarfFileWriter.cs (MonoDwarfFileWriter.DieLexicalBlock): New class.
- (MonoDwarfFileWriter.DieMethodVariable): New class.
-
- * MonoSymbolWriter.cs (OpenScope, CloseScope): Implemented.
- Reflected latest IMonoSymbolWriter interface changes.
-
-2002-03-20 Martin Baulig <martin@gnome.org>
-
- * IAssemblerWriter.cs: New interface.
-
- * AssemblerWriterI386.cs: New class.
-
- * MonoDwarfFileWriter.cs: Use the IAssemblerWriter interface to make this class
- platform and assembler independent.
-
-2002-03-20 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (ISourceMethod): Added FirstLine, LastLine, CodeSize and
- Token properties.
-
- * MonoDwarfFileWriter.cs: Implemented line number support.
-
-2002-03-19 Martin Baulig <martin@gnome.org>
-
- * IMonoSymbolWriter.cs (ISourceFile, ISourceMethod, ISourceLine, ILocalVariable):
- New interfaces.
-
- * IMonoSymbolWriter.cs (OpenMethod): Take a System.Reflection.MethodInfo, not
- a string.
-
-2002-03-19 Martin Baulig <martin@gnome.org>
-
- This is an implementation of the System.Diagnostics.SymbolStore.SymbolWriter
- interface. It's still work in progress and not yet used anywhere.
-
- There is some preliminary documentation in the source files and some more
- docu in the README and README.relocation-table files.
-
- * IMonoSymbolWriter.cs: New file.
- * MonoDwarfFileWriter.cs: New file.
- * MonoSymbolDocumentWriter.cs: New file.
- * MonoSymbolWriter.cs: New file.
-
- * README, README.relocation-table: Documentation.
-
diff --git a/mcs/class/Mono.CSharp.Debugger/IAssemblerWriter.cs b/mcs/class/Mono.CSharp.Debugger/IAssemblerWriter.cs
deleted file mode 100644
index 169b9fc073e..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/IAssemblerWriter.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// Mono.CSharp.Debugger/IAssemblerWriter.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// This is a platform and assembler independent assembler output interface.
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-using System.IO;
-
-namespace Mono.CSharp.Debugger
-{
- public interface IAssemblerWriter
- {
- int GetNextLabelIndex ();
-
- void WriteLabel (int index);
-
- void WriteLabel (string label);
-
- int WriteLabel ();
-
- void WriteUInt8 (bool value);
-
- void WriteUInt8 (int value);
-
- void WriteInt8 (int value);
-
- void Write2Bytes (int a, int b);
-
- void WriteUInt16 (int value);
-
- void WriteInt16 (int value);
-
- void WriteUInt32 (int value);
-
- void WriteInt32 (int value);
-
- void WriteSLeb128 (int value);
-
- void WriteULeb128 (int value);
-
- void WriteAddress (int value);
-
- void WriteString (string value);
-
- void WriteSectionStart (String section);
-
- void WriteSectionEnd ();
-
- void WriteRelativeOffset (int start_label, int end_label);
-
- void WriteShortRelativeOffset (int start_label, int end_label);
-
- void WriteAbsoluteOffset (int index);
-
- void WriteAbsoluteOffset (string label);
-
- object StartSubsectionWithSize ();
-
- object StartSubsectionWithShortSize ();
-
- void EndSubsection (object end_index);
- }
-}
diff --git a/mcs/class/Mono.CSharp.Debugger/IMonoSymbolWriter.cs b/mcs/class/Mono.CSharp.Debugger/IMonoSymbolWriter.cs
deleted file mode 100644
index 31870f7f56b..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/IMonoSymbolWriter.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-//
-// System.Diagnostics.SymbolStore/IMonoSymbolWriter.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// This interface is derived from System.Diagnostics.SymbolStore.ISymbolWriter.
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics.SymbolStore;
-using System.Collections;
-using System.IO;
-
-namespace Mono.CSharp.Debugger
-{
- public interface IMonoSymbolWriter : ISymbolWriter
- {
- ISourceMethod[] Methods {
- get;
- }
-
- ISourceFile[] Sources {
- get;
- }
-
- void Initialize (string filename, string[] args);
- }
-
- public interface ISourceFile
- {
- string FileName {
- get;
- }
-
- ISourceMethod[] Methods {
- get;
- }
-
- void AddMethod (ISourceMethod method);
- }
-
- public interface ISourceMethod
- {
- ISourceLine[] Lines {
- get;
- }
-
- void AddLine (ISourceLine line);
-
- ISourceBlock[] Blocks {
- get;
- }
-
- ILocalVariable[] Locals {
- get;
- }
-
- void AddLocal (ILocalVariable local);
-
-
- ISourceLine Start {
- get;
- }
-
- ISourceLine End {
- get;
- }
-
- string FullName {
- get;
- }
-
- int Token {
- get;
- }
-
- Type ReturnType {
- get;
- }
-
- ParameterInfo[] Parameters {
- get;
- }
-
- MethodBase MethodBase {
- get;
- }
-
- ISourceFile SourceFile {
- get;
- }
- }
-
- public interface ISourceBlock
- {
- ISourceMethod SourceMethod {
- get;
- }
-
- ILocalVariable[] Locals {
- get;
- }
-
- void AddLocal (ILocalVariable local);
-
- ISourceBlock[] Blocks {
- get;
- }
-
- void AddBlock (ISourceBlock block);
-
- ISourceLine Start {
- get;
- }
-
- ISourceLine End {
- get;
- }
-
- int ID {
- get;
- }
- }
-
- public enum SourceOffsetType
- {
- OFFSET_NONE,
- OFFSET_IL,
- OFFSET_LOCAL,
- OFFSET_PARAMETER
- }
-
- public interface ISourceLine
- {
- SourceOffsetType OffsetType {
- get;
- }
-
- int Offset {
- get;
- }
-
- int Row {
- get;
- }
-
- int Column {
- get;
- }
- }
-
- public interface ITypeHandle
- {
- string Name {
- get;
- }
-
- Type Type {
- get;
- }
-
- int Token {
- get;
- }
- }
-
- public interface IVariable
- {
- string Name {
- get;
- }
-
- ISourceLine Line {
- get;
- }
-
- ITypeHandle TypeHandle {
- get;
- }
-
- ISourceMethod Method {
- get;
- }
-
- int Index {
- get;
- }
- }
-
- public interface ILocalVariable : IVariable
- { }
-
- public interface IMethodParameter : IVariable
- { }
-}
diff --git a/mcs/class/Mono.CSharp.Debugger/Mono.CSharp.Debugger.build b/mcs/class/Mono.CSharp.Debugger/Mono.CSharp.Debugger.build
deleted file mode 100644
index 04c1931126a..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/Mono.CSharp.Debugger.build
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for Mono.CSharp.Debugger.dll -->
-
-<project name="Mono.CSharp.Debugger" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <csc target="library" output="../lib/Mono.CSharp.Debugger.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- </sources>
- <references>
- <includes name="../lib/corlib.dll"/>
- </references>
- </csc>
- </target>
- <target name="clean">
- <delete file="../lib/Mono.CSharp.Debugger.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/Mono.CSharp.Debugger/MonoDwarfFileWriter.cs b/mcs/class/Mono.CSharp.Debugger/MonoDwarfFileWriter.cs
deleted file mode 100755
index ceaee9619c1..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/MonoDwarfFileWriter.cs
+++ /dev/null
@@ -1,2425 +0,0 @@
-//
-// System.Diagnostics.SymbolStore/MonoDwarfWriter.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// This is the default implementation of the System.Diagnostics.SymbolStore.ISymbolWriter
-// interface.
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Diagnostics.SymbolStore;
-using System.Collections;
-using System.Text;
-using System.IO;
-
-namespace Mono.CSharp.Debugger
-{
- public class DwarfFileWriter
- {
- protected const string producer_id = "Mono C# Compiler 0.01 03-18-2002";
-
- protected ArrayList compile_units = new ArrayList ();
- protected ArrayList line_number_engines = new ArrayList ();
- protected StreamWriter writer = null;
- protected IAssemblerWriter aw = null;
- protected string symbol_file = null;
-
- public bool timestamps = false;
- public bool use_gnu_extensions = false;
-
- // Write a generic file which contains no machine dependant stuff but
- // only function and type declarations.
- protected readonly bool DoGeneric = false;
-
- public readonly TypeHandle void_type;
- public readonly TypeHandle int_type;
- public readonly TypeHandle char_type;
- public readonly TypeHandle array_type;
- public readonly TypeHandle array_bounds_type;
- public readonly TypeHandle string_type;
- public readonly DieCompileUnit DieGlobalCompileUnit;
-
- //
- // DwarfFileWriter public interface
- //
- public DwarfFileWriter (string symbol_file, string[] args)
- {
- foreach (string arg in args) {
- if (arg.StartsWith ("output="))
- symbol_file = arg.Substring (7);
- else if (arg == "timestamp")
- timestamps = true;
- else if (arg == "gnu_extensions")
- use_gnu_extensions = true;
- else if (arg == "generic")
- DoGeneric = true;
- else
- Console.WriteLine ("Symbol writer warning: Unknown argument: " + arg);
- }
-
- this.symbol_file = symbol_file;
- this.writer = new StreamWriter (symbol_file, false, Encoding.ASCII);
- this.aw = new AssemblerWriterI386 (this.writer);
- this.last_time = DateTime.Now;
-
- CompileUnit compile_unit = new CompileUnit (this, symbol_file);
- DieGlobalCompileUnit = new DieCompileUnit (compile_unit);
-
- void_type = RegisterType (typeof (void));
- RegisterType (typeof (bool));
- char_type = RegisterType (typeof (char));
- RegisterType (typeof (SByte));
- RegisterType (typeof (Byte));
- RegisterType (typeof (Int16));
- RegisterType (typeof (UInt16));
- int_type = RegisterType (typeof (Int32));
- RegisterType (typeof (UInt32));
- RegisterType (typeof (Int64));
- RegisterType (typeof (UInt64));
- RegisterType (typeof (Single));
- RegisterType (typeof (Double));
- array_type = RegisterType (typeof (MonoArray));
- array_bounds_type = RegisterType (typeof (MonoArrayBounds));
- string_type = RegisterType (typeof (MonoString));
- }
-
- DateTime last_time;
- void ShowTime (string msg)
- {
- DateTime now = DateTime.Now;
- TimeSpan span = now - last_time;
- last_time = now;
-
- Console.WriteLine (
- "MonoDwarfFileWriter [{0:00}:{1:000}] {2}",
- (int) span.TotalSeconds, span.Milliseconds, msg);
- }
-
- public void CreateTypes ()
- {
- types_closed = true;
- }
-
- // Writes the final dwarf file.
- public void Close ()
- {
- CreateTypes ();
-
- if (timestamps)
- ShowTime ("Emitting compile units");
-
- foreach (CompileUnit compile_unit in compile_units)
- compile_unit.Emit ();
-
- if (timestamps)
- ShowTime ("Done");
-
- foreach (LineNumberEngine line_number_engine in line_number_engines)
- line_number_engine.Emit ();
-
- if (timestamps)
- ShowTime ("Done emitting " + LineNumberEngine.count + " line numbers");
-
- WriteAbbrevDeclarations ();
- if (timestamps)
- ShowTime ("Done writing abbrev declarations");
-
- WriteRelocEntries ();
- if (timestamps)
- ShowTime ("Done writing " + reloc_entries.Count + " reloc entries");
-
- writer.Close ();
- }
-
- // Adds a new compile unit to this dwarf file
- public void AddCompileUnit (CompileUnit compile_unit)
- {
- compile_units.Add (compile_unit);
- }
-
- // Adds a new line number engine to this dwarf file
- public void AddLineNumberEngine (LineNumberEngine line_number_engine)
- {
- line_number_engines.Add (line_number_engine);
- }
-
- public IAssemblerWriter AssemblerWriter {
- get {
- return aw;
- }
- }
-
- // This string is written into the generated dwarf file to identify the
- // producer and version number.
- public string ProducerID {
- get {
- return producer_id;
- }
- }
-
- private Hashtable type_hash = new Hashtable ();
- private bool types_closed = false;
-
- public TypeHandle RegisterType (Type type)
- {
- if (types_closed)
- throw new InvalidOperationException ();
-
- if (type_hash.Contains (type))
- return (TypeHandle) type_hash [type];
-
- TypeHandle handle = new TypeHandle (type);
- type_hash.Add (type, handle);
-
- if (type.IsArray && (type != typeof (Array)))
- handle.CreateArrayType (RegisterType (type.GetElementType ()));
- else if (type.Equals (typeof (MonoString)))
- handle.CreateStringType (char_type);
-
- handle.CreateType (DieGlobalCompileUnit);
-
- return handle;
- }
-
- //
- // This is used to reference types.
- //
-
- public class TypeHandle : ITypeHandle
- {
- protected readonly Type type;
- protected DieType type_die;
- protected int token;
- protected Die pointer_die;
- protected TypeHandle array_bounds_type;
- protected TypeHandle array_vector_type;
- protected TypeHandle array_element_type;
-
- public TypeHandle (Type type)
- {
- this.type = type;
- }
-
- public void CreateArrayType (TypeHandle element_type)
- {
- this.array_element_type = element_type;
- this.array_bounds_type = new TypeHandle_ArrayBounds (type.GetArrayRank ());
- this.array_vector_type = new TypeHandle_ArrayVector (array_element_type);
- }
-
- public void CreateStringType (TypeHandle element_type)
- {
- this.array_element_type = element_type;
- this.array_vector_type = new TypeHandle_ArrayVector (element_type);
- }
-
- public string Name {
- get {
- return type.FullName;
- }
- }
-
- public Type Type {
- get {
- return type;
- }
- }
-
- public int Token {
- get {
- if (token == 0)
- throw new InvalidOperationException ();
- else
- return token;
- }
- }
-
- public DieType TypeDie {
- get {
- if (type_die == null)
- throw new InvalidOperationException ();
- else
- return type_die;
- }
- }
-
- public ITypeHandle ArrayBoundsType {
- get {
- if (array_bounds_type == null)
- throw new InvalidOperationException ();
- else
- return array_bounds_type;
- }
- }
-
- public ITypeHandle ArrayElementType {
- get {
- if (array_element_type == null)
- throw new InvalidOperationException ();
- else
- return array_element_type;
- }
- }
-
- public ITypeHandle ArrayVectorType {
- get {
- if (array_vector_type == null)
- throw new InvalidOperationException ("FUCK: " + type);
- else
- return array_vector_type;
- }
- }
-
- public Die PointerDie {
- get {
- return pointer_die;
- }
- }
-
- public virtual void CreateType (DieCompileUnit parent_die)
- {
- if (type_die != null)
- return;
-
- if (array_bounds_type != null)
- array_bounds_type.CreateType (parent_die);
- if (array_element_type != null)
- array_element_type.CreateType (parent_die);
- if (array_vector_type != null)
- array_vector_type.CreateType (parent_die);
-
- ITypeHandle void_type = parent_die.Writer.void_type;
- ITypeHandle array_type = parent_die.Writer.array_type;
-
- if ((type.IsPrimitive && !type.IsByRef) || (type == typeof (void))) {
- type_die = new DieBaseType (parent_die, this);
- return;
- } else if (type.Equals (typeof (string))) {
- type_die = new DieStringType (parent_die, this);
- pointer_die = new DieInternalPointer (parent_die, type_die);
- type_die.CreateType ();
- return;
- } else if (type.IsArray && (type != typeof (Array))) {
- type_die = new DieArrayType (parent_die, this);
- pointer_die = new DieInternalPointer (parent_die, type_die);
- type_die.CreateType ();
- return;
- } else if (type.Equals (typeof (MonoArrayBounds))) {
- type_die = new DieArrayBoundsType (parent_die, this);
- pointer_die = new DieInternalPointer (parent_die, type_die);
- type_die.CreateType ();
- return;
- } else if (!(type is TypeBuilder)) {
- type_die = new DieTypeDef (parent_die, void_type, type.FullName);
- type_die.CreateType ();
- return;
- }
-
- token = ((TypeBuilder) type).TypeToken.Token;
-
- if (type.IsPointer || type.IsByRef)
- type_die = new DiePointerType (parent_die, this);
- else if (type.IsEnum)
- type_die = new DieEnumType (parent_die, this);
- else if (type.IsValueType)
- type_die = new DieStructureType (parent_die, this);
- else if (type.IsClass) {
- type_die = new DieClassType (parent_die, this);
- pointer_die = new DieInternalPointer (parent_die, type_die);
- } else
- type_die = new DieTypeDef (parent_die, void_type, type.FullName);
-
- type_die.CreateType ();
- }
- }
-
- public class TypeHandle_ArrayBounds : TypeHandle
- {
- private readonly int rank;
-
- public TypeHandle_ArrayBounds (int rank)
- : base (typeof (MonoArrayBounds))
- {
- this.rank = rank;
- }
-
- public override void CreateType (DieCompileUnit parent_die)
- {
- ITypeHandle int_type = parent_die.Writer.int_type;
- ITypeHandle array_bounds_type = parent_die.Writer.array_bounds_type;
-
- type_die = new DieInternalArray (parent_die, array_bounds_type);
- new DieSubRangeType (type_die, int_type, 0, rank);
-
- type_die.CreateType ();
- }
- }
-
- public class TypeHandle_ArrayVector : TypeHandle
- {
- TypeHandle element_type;
-
- public TypeHandle_ArrayVector (TypeHandle element_type)
- : base (element_type.Type)
- {
- this.element_type = element_type;
- }
-
- public override void CreateType (DieCompileUnit parent_die)
- {
- ITypeHandle int_type = parent_die.Writer.int_type;
-
- type_die = new DieInternalArray (parent_die, element_type);
- new DieSubRangeType (type_die, int_type, 0, -1);
-
- type_die.CreateType ();
- }
- }
-
- //
- // A compile unit refers to a single C# source file.
- //
- public class CompileUnit
- {
- protected DwarfFileWriter dw;
- protected IAssemblerWriter aw;
- protected string source_file;
- protected ArrayList dies = new ArrayList ();
-
- public readonly int ReferenceIndex;
-
- public CompileUnit (DwarfFileWriter dw, string source_file, Die[] dies)
- {
- this.dw = dw;
- this.aw = dw.AssemblerWriter;
- this.source_file = source_file;
- if (dies != null)
- this.dies.AddRange (dies);
-
- this.ReferenceIndex = this.aw.GetNextLabelIndex ();
-
- dw.AddCompileUnit (this);
- }
-
- //
- // Construct a new compile unit for source file @source_file.
- //
- // This constructor automatically adds the newly created compile
- // unit to the DwarfFileWriter's list of compile units.
- //
- public CompileUnit (DwarfFileWriter dw, string source_file)
- : this (dw, source_file, null)
- { }
-
- public string SourceFile {
- get {
- return source_file;
- }
- }
-
- public string ProducerID {
- get {
- return dw.ProducerID;
- }
- }
-
- public DwarfFileWriter DwarfFileWriter
- {
- get {
- return dw;
- }
- }
-
- // Add a new debugging information entry to this compile unit.
- public void AddDie (Die die)
- {
- dies.Add (die);
- }
-
- // Write the whole compile unit to the dwarf file.
- public void Emit ()
- {
- object start_index, end_index;
-
- dw.WriteSectionStart (Section.DEBUG_INFO);
-
- aw.WriteLabel (ReferenceIndex);
-
- start_index = aw.WriteLabel ();
-
- end_index = aw.StartSubsectionWithSize ();
- aw.WriteUInt16 (2);
- aw.WriteAbsoluteOffset ("debug_abbrev_b");
- if (dw.DoGeneric)
- aw.WriteUInt8 (4);
- else {
- dw.AddRelocEntry (RelocEntryType.TARGET_ADDRESS_SIZE);
- aw.WriteUInt8 (4);
- }
-
- if (dies != null)
- foreach (Die die in dies)
- die.Emit ();
-
- aw.EndSubsection (end_index);
-
- aw.WriteSectionEnd ();
- }
- }
-
- public class LineNumberEngine
- {
- public readonly int ReferenceIndex;
-
- public readonly int LineBase = 1;
- public readonly int LineRange = 8;
-
- protected DwarfFileWriter dw;
- protected IAssemblerWriter aw;
-
- public readonly int[] StandardOpcodeSizes = {
- 0, 0, 1, 1, 1, 1, 0, 0, 0, 0
- };
-
- public readonly int OpcodeBase;
-
- public static int count = 0;
-
- private Hashtable _sources = new Hashtable ();
- private Hashtable _directories = new Hashtable ();
- private Hashtable _methods = new Hashtable ();
-
- private int next_source_id;
- private int next_directory_id;
-
- private int next_method_id;
-
- private enum DW_LNS {
- LNS_extended_op = 0,
- LNS_copy = 1,
- LNS_advance_pc = 2,
- LNS_advance_line = 3,
- LNS_set_file = 4,
- LNS_set_column = 5,
- LNS_negate_stmt = 6,
- LNS_set_basic_block = 7,
- LNS_const_add_pc = 8,
- LNS_fixed_advance_pc = 9
- };
-
- private enum DW_LNE {
- LNE_end_sequence = 1,
- LNE_set_address = 2,
- LNE_define_file = 3
- };
-
- public ISourceFile[] Sources {
- get {
- ISourceFile[] retval = new ISourceFile [_sources.Count];
-
- foreach (ISourceFile source in _sources.Keys)
- retval [(int) _sources [source] - 1] = source;
-
- return retval;
- }
- }
-
- public string[] Directories {
- get {
- string[] retval = new string [_directories.Count];
-
- foreach (string directory in _directories.Keys)
- retval [(int) _directories [directory] - 1] = directory;
-
- return retval;
- }
- }
-
- public ISourceMethod[] Methods {
- get {
- ISourceMethod[] retval = new ISourceMethod [_methods.Count];
-
- foreach (ISourceMethod method in _methods.Keys) {
- retval [(int) _methods [method] - 1] = method;
- }
-
- return retval;
- }
- }
-
- public LineNumberEngine (DwarfFileWriter writer)
- {
- this.dw = writer;
- this.aw = writer.AssemblerWriter;
- this.ReferenceIndex = aw.GetNextLabelIndex ();
-
- dw.AddLineNumberEngine (this);
- }
-
- public int LookupSource (ISourceFile source)
- {
- if (_sources.ContainsKey (source))
- return (int) _sources [source];
-
- int index = ++next_source_id;
- _sources.Add (source, index);
- return index;
- }
-
- public int LookupDirectory (string directory)
- {
- if (_directories.ContainsKey (directory))
- return (int) _directories [directory];
-
- int index = ++next_directory_id;
- _directories.Add (directory, index);
- return index;
- }
-
- public void AddMethod (ISourceMethod method)
- {
- LookupSource (method.SourceFile);
-
- int index = ++next_method_id;
- _methods.Add (method, index);
- }
-
- private void SetFile (ISourceFile source)
- {
- aw.WriteInt8 ((int) DW_LNS.LNS_set_file);
- aw.WriteULeb128 (LookupSource (source));
- }
-
- private int st_line = 1;
-
- private void SetLine (int line)
- {
- aw.WriteInt8 ((int) DW_LNS.LNS_advance_line);
- aw.WriteSLeb128 (line - st_line);
- st_line = line;
- }
-
- private void SetAddress (int token, int address)
- {
- aw.WriteUInt8 (0);
- object end_index = aw.StartSubsectionWithShortSize ();
- aw.WriteUInt8 ((int) DW_LNE.LNE_set_address);
- dw.AddRelocEntry (RelocEntryType.IL_OFFSET, token, address);
- aw.WriteAddress (0);
- aw.EndSubsection (end_index);
- }
-
- private void SetStartAddress (int token)
- {
- aw.WriteUInt8 (0);
- object end_index = aw.StartSubsectionWithShortSize ();
- aw.WriteUInt8 ((int) DW_LNE.LNE_set_address);
- dw.AddRelocEntry (RelocEntryType.METHOD_START_ADDRESS, token);
- aw.WriteAddress (0);
- aw.EndSubsection (end_index);
- }
-
- private void SetEndAddress (int token)
- {
- aw.WriteUInt8 (0);
- object end_index = aw.StartSubsectionWithShortSize ();
- aw.WriteUInt8 ((int) DW_LNE.LNE_set_address);
- dw.AddRelocEntry (RelocEntryType.METHOD_END_ADDRESS, token);
- aw.WriteAddress (0);
- aw.EndSubsection (end_index);
- }
-
- private void SetBasicBlock ()
- {
- aw.WriteUInt8 ((int) DW_LNS.LNS_set_basic_block);
- }
-
- private void EndSequence ()
- {
- aw.WriteUInt8 (0);
- aw.WriteUInt8 (1);
- aw.WriteUInt8 ((int) DW_LNE.LNE_end_sequence);
-
- st_line = 1;
- }
-
- private void Commit ()
- {
- aw.WriteUInt8 ((int) DW_LNS.LNS_copy);
- }
-
- private void WriteOneLine (int token, int line, int offset)
- {
- aw.WriteInt8 ((int) DW_LNS.LNS_advance_line);
- aw.WriteSLeb128 (line - st_line);
- aw.WriteUInt8 (0);
- object end_index = aw.StartSubsectionWithShortSize ();
- aw.WriteUInt8 ((int) DW_LNE.LNE_set_address);
- dw.AddRelocEntry (RelocEntryType.IL_OFFSET, token, offset);
- aw.WriteAddress (0);
- aw.EndSubsection (end_index);
-
- aw.Write2Bytes ((int) DW_LNS.LNS_set_basic_block,
- (int) DW_LNS.LNS_copy);
-
- st_line = line;
- }
-
- public void Emit ()
- {
- dw.WriteSectionStart (Section.DEBUG_LINE);
- aw.WriteLabel (ReferenceIndex);
- object end_index = aw.StartSubsectionWithSize ();
-
- aw.WriteUInt16 (2);
- object start_index = aw.StartSubsectionWithSize ();
- aw.WriteUInt8 (1);
- aw.WriteUInt8 (1);
- aw.WriteInt8 (LineBase);
- aw.WriteUInt8 (LineRange);
- aw.WriteUInt8 (StandardOpcodeSizes.Length);
- for (int i = 1; i < StandardOpcodeSizes.Length; i++)
- aw.WriteUInt8 (StandardOpcodeSizes [i]);
-
- foreach (string directory in Directories)
- aw.WriteString (directory);
- aw.WriteUInt8 (0);
-
- foreach (ISourceFile source in Sources) {
- aw.WriteString (source.FileName);
- aw.WriteULeb128 (0);
- aw.WriteULeb128 (0);
- aw.WriteULeb128 (0);
- }
-
- aw.WriteUInt8 (0);
-
- aw.EndSubsection (start_index);
-
- foreach (ISourceMethod method in Methods) {
- if (method.Start == null || method.Start.Row == 0)
- continue;
-
- SetFile (method.SourceFile);
- SetLine (method.Start.Row);
- SetStartAddress (method.Token);
- SetBasicBlock ();
- Commit ();
-
- foreach (ISourceLine line in method.Lines) {
- count++;
- WriteOneLine (method.Token, line.Row, line.Offset);
- // SetLine (line.Row);
- // SetAddress (method.Token, line.Offset);
- // SetBasicBlock ();
- // Commit ();
- }
-
- SetLine (method.End.Row);
- SetEndAddress (method.Token);
- SetBasicBlock ();
- Commit ();
-
- EndSequence ();
- }
-
- aw.EndSubsection (end_index);
- aw.WriteSectionEnd ();
- }
- }
-
- // DWARF tag from the DWARF 2 specification.
- public enum DW_TAG {
- TAG_array_type = 0x01,
- TAG_class_type = 0x02,
- TAG_enumeration_type = 0x04,
- TAG_formal_parameter = 0x05,
- TAG_lexical_block = 0x0b,
- TAG_member = 0x0d,
- TAG_pointer_type = 0x0f,
- TAG_compile_unit = 0x11,
- TAG_string_type = 0x12,
- TAG_structure_type = 0x13,
- TAG_typedef = 0x16,
- TAG_inheritance = 0x1c,
- TAG_subrange_type = 0x21,
- TAG_base_type = 0x24,
- TAG_enumerator = 0x28,
- TAG_subprogram = 0x2e,
- TAG_variable = 0x34
- }
-
- // DWARF attribute from the DWARF 2 specification.
- public enum DW_AT {
- AT_location = 0x02,
- AT_name = 0x03,
- AT_byte_size = 0x0b,
- AT_stmt_list = 0x10,
- AT_low_pc = 0x11,
- AT_high_pc = 0x12,
- AT_language = 0x13,
- AT_string_length = 0x19,
- AT_const_value = 0x1c,
- AT_lower_bound = 0x22,
- AT_producer = 0x25,
- AT_start_scope = 0x2c,
- AT_upper_bound = 0x2f,
- AT_accessibility = 0x32,
- AT_artificial = 0x34,
- AT_data_member_location = 0x38,
- AT_declaration = 0x3c,
- AT_encoding = 0x3e,
- AT_external = 0x3f,
- AT_type = 0x49,
- AT_data_location = 0x50,
- AT_end_scope = 0x2121
- }
-
- // DWARF form from the DWARF 2 specification.
- public enum DW_FORM {
- FORM_addr = 0x01,
- FORM_block4 = 0x04,
- FORM_data4 = 0x06,
- FORM_string = 0x08,
- FORM_data1 = 0x0b,
- FORM_flag = 0x0c,
- FORM_sdata = 0x0d,
- FORM_udata = 0x0f,
- FORM_ref4 = 0x13
- }
-
- public enum DW_LANG {
- LANG_C_plus_plus = 0x04,
- LANG_C_sharp = 0x9001
- }
-
- public enum DW_OP {
- OP_deref = 0x06,
- OP_const1u = 0x08,
- OP_const1s = 0x09,
- OP_const2u = 0x0a,
- OP_const2s = 0x0b,
- OP_const4u = 0x0c,
- OP_const4s = 0x0d,
- OP_const8u = 0x0e,
- OP_const8s = 0x0f,
- OP_constu = 0x10,
- OP_consts = 0x11,
- OP_plus = 0x22,
- OP_plus_uconst = 0x23,
- OP_fbreg = 0x91,
- }
-
- public enum DW_ACCESS {
- ACCESS_public = 1,
- ACCESS_protected = 2,
- ACCESS_private = 3
- };
-
- protected enum MRI_string {
- offset_length = 0x00,
- offset_chars = 0x01
- }
-
- protected enum MRI_array {
- offset_bounds = 0x00,
- offset_max_length = 0x01,
- offset_vector = 0x02
- }
-
- protected enum MRI_array_bounds {
- offset_lower = 0x00,
- offset_length = 0x01
- }
-
- // Abstract base class for a "debugging information entry" (die).
- public abstract class Die
- {
- protected DwarfFileWriter dw;
- protected IAssemblerWriter aw;
- protected ArrayList child_dies = new ArrayList ();
- public readonly Die Parent;
-
- protected readonly int abbrev_id;
- protected readonly AbbrevDeclaration abbrev_decl;
-
- public readonly int ReferenceIndex;
-
- //
- // Create a new die If @parent is not null, add the newly
- // created die to the parent's list of child dies.
- //
- // @abbrev_id is the abbreviation id for this die class.
- // Derived classes should call the DwarfFileWriter's static
- // RegisterAbbrevDeclaration function in their static constructor
- // to get an abbrev id. Once you registered an abbrev entry, it'll
- // be automatically written to the debug_abbrev section.
- //
- public Die (DwarfFileWriter dw, Die parent, int abbrev_id)
- {
- this.dw = dw;
- this.aw = dw.AssemblerWriter;
- this.Parent = parent;
- this.abbrev_id = abbrev_id;
- this.abbrev_decl = GetAbbrevDeclaration (abbrev_id);
- this.ReferenceIndex = this.aw.GetNextLabelIndex ();
-
- if (parent != null)
- parent.AddChildDie (this);
- }
-
- public Die (DwarfFileWriter dw, int abbrev_id)
- : this (dw, null, abbrev_id)
- { }
-
- public Die (Die parent, int abbrev_id)
- : this (parent.dw, parent, abbrev_id)
- { }
-
- protected void AddChildDie (Die die)
- {
- child_dies.Add (die);
- }
-
- public override bool Equals (object o)
- {
- if (!(o is Die))
- return false;
-
- return ((Die) o).ReferenceIndex == ReferenceIndex;
- }
-
- public override int GetHashCode ()
- {
- return ReferenceIndex;
- }
-
- //
- // Write this die and all its children to the dwarf file.
- //
- public virtual void Emit ()
- {
- aw.WriteLabel (ReferenceIndex);
-
- aw.WriteULeb128 (abbrev_id);
- DoEmit ();
-
- if (abbrev_decl.HasChildren) {
- foreach (Die child in child_dies)
- child.Emit ();
-
- aw.WriteUInt8 (0);
- }
- }
-
- //
- // Derived classes must implement this function to actually
- // write themselves to the dwarf file.
- //
- // Note that the abbrev id has already been written in Emit() -
- // if you don't like this, you must override Emit() as well.
- //
- public abstract void DoEmit ();
-
- //
- // Gets the compile unit of this die.
- //
- public virtual DieCompileUnit GetCompileUnit ()
- {
- Die die = this;
-
- while (die.Parent != null)
- die = die.Parent;
-
- if (die is DieCompileUnit)
- return (DieCompileUnit) die;
- else
- return null;
- }
-
- public DieCompileUnit DieCompileUnit {
- get {
- return GetCompileUnit ();
- }
- }
-
- public DwarfFileWriter Writer {
- get {
- return dw;
- }
- }
- }
-
- // DW_TAG_compile_unit
- public class DieCompileUnit : Die
- {
- private static int my_abbrev_id;
-
- protected Hashtable types = new Hashtable ();
- protected Hashtable pointer_types = new Hashtable ();
-
- static DieCompileUnit ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_producer, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_language, DW_FORM.FORM_udata),
- new AbbrevEntry (DW_AT.AT_stmt_list, DW_FORM.FORM_ref4)
- };
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_compile_unit, true, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- public readonly CompileUnit CompileUnit;
- public readonly bool DoGeneric;
- public readonly LineNumberEngine LineNumberEngine;
-
- //
- // Create a new DW_TAG_compile_unit debugging information entry
- // and add it to the @compile_unit.
- //
- public DieCompileUnit (CompileUnit compile_unit)
- : base (compile_unit.DwarfFileWriter, my_abbrev_id)
- {
- this.CompileUnit = compile_unit;
- this.DoGeneric = dw.DoGeneric;
- compile_unit.AddDie (this);
-
- LineNumberEngine = new LineNumberEngine (dw);
- }
-
- public void WriteRelativeDieReference (Die target_die)
- {
- if (!this.Equals (target_die.GetCompileUnit ()))
- throw new ArgumentException ("Target die must be in the same "
- + "compile unit");
-
- aw.WriteRelativeOffset (CompileUnit.ReferenceIndex,
- target_die.ReferenceIndex);
- }
-
- public void WriteTypeReference (ITypeHandle ihandle)
- {
- if (!(ihandle is TypeHandle))
- throw new NotSupportedException ();
-
- TypeHandle handle = (TypeHandle) ihandle;
-
- if (handle.PointerDie != null)
- WriteRelativeDieReference (handle.PointerDie);
- else
- WriteRelativeDieReference (handle.TypeDie);
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (CompileUnit.SourceFile);
- aw.WriteString (CompileUnit.ProducerID);
- if (dw.use_gnu_extensions)
- aw.WriteULeb128 ((int) DW_LANG.LANG_C_sharp);
- else
- aw.WriteULeb128 ((int) DW_LANG.LANG_C_plus_plus);
- aw.WriteAbsoluteOffset (LineNumberEngine.ReferenceIndex);
- }
- }
-
- // DW_TAG_subprogram
- public class DieSubProgram : Die
- {
- private static int my_abbrev_id_1;
- private static int my_abbrev_id_2;
- private static int my_abbrev_id_3;
- private static int my_abbrev_id_4;
-
- static DieSubProgram ()
- {
- // Method without return value
- AbbrevEntry[] entries_1 = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_external, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_low_pc, DW_FORM.FORM_addr),
- new AbbrevEntry (DW_AT.AT_high_pc, DW_FORM.FORM_addr)
- };
- // Method with return value
- AbbrevEntry[] entries_2 = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_external, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_low_pc, DW_FORM.FORM_addr),
- new AbbrevEntry (DW_AT.AT_high_pc, DW_FORM.FORM_addr),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4)
- };
- // Method declaration without return value
- AbbrevEntry[] entries_3 = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_external, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_declaration, DW_FORM.FORM_flag)
- };
- // Method declaration with return value
- AbbrevEntry[] entries_4 = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_external, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_declaration, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4)
- };
-
-
- AbbrevDeclaration decl_1 = new AbbrevDeclaration (
- DW_TAG.TAG_subprogram, true, entries_1);
- AbbrevDeclaration decl_2 = new AbbrevDeclaration (
- DW_TAG.TAG_subprogram, true, entries_2);
- AbbrevDeclaration decl_3 = new AbbrevDeclaration (
- DW_TAG.TAG_subprogram, true, entries_3);
- AbbrevDeclaration decl_4 = new AbbrevDeclaration (
- DW_TAG.TAG_subprogram, true, entries_4);
-
- my_abbrev_id_1 = RegisterAbbrevDeclaration (decl_1);
- my_abbrev_id_2 = RegisterAbbrevDeclaration (decl_2);
- my_abbrev_id_3 = RegisterAbbrevDeclaration (decl_3);
- my_abbrev_id_4 = RegisterAbbrevDeclaration (decl_4);
- }
-
- private static int get_abbrev_id (DieCompileUnit parent_die, ISourceMethod method)
- {
- if (parent_die.DoGeneric)
- if (method.ReturnType == typeof (void))
- return my_abbrev_id_3;
- else
- return my_abbrev_id_4;
- else
- if (method.ReturnType == typeof (void))
- return my_abbrev_id_1;
- else
- return my_abbrev_id_2;
- }
-
- protected ISourceMethod method;
- protected ITypeHandle retval_type;
-
- //
- // Create a new DW_TAG_subprogram debugging information entry
- // for method @name (which has a void return value) and add it
- // to the @parent_die
- //
- public DieSubProgram (DieCompileUnit parent_die, ISourceMethod method)
- : base (parent_die, get_abbrev_id (parent_die, method))
- {
- this.method = method;
-
- if (method.ReturnType != typeof (void))
- retval_type = dw.RegisterType (method.ReturnType);
-
- if (!method.MethodBase.IsStatic)
- new DieMethodVariable (this, method);
-
- foreach (ParameterInfo param in method.Parameters) {
- MethodParameter mp = new MethodParameter (dw, method, param);
-
- new DieMethodVariable (this, mp);
- }
-
- DieCompileUnit.LineNumberEngine.AddMethod (method);
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (method.FullName);
- aw.WriteUInt8 (true);
- if (dw.DoGeneric)
- aw.WriteUInt8 (true);
- else {
- dw.AddRelocEntry (RelocEntryType.METHOD_START_ADDRESS, method.Token);
- aw.WriteAddress (0);
- dw.AddRelocEntry (RelocEntryType.METHOD_END_ADDRESS, method.Token);
- aw.WriteAddress (0);
- }
- if (method.ReturnType != typeof (void))
- DieCompileUnit.WriteTypeReference (retval_type);
- }
- }
-
- // DW_TAG_base_type
- public class DieBaseType : DieType
- {
- private static int my_abbrev_id;
-
- static DieBaseType ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_encoding, DW_FORM.FORM_data1),
- new AbbrevEntry (DW_AT.AT_byte_size, DW_FORM.FORM_data1)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_base_type, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected Type type;
- protected string name;
-
- //
- // Create a new DW_TAG_base_type debugging information entry
- //
- public DieBaseType (DieCompileUnit parent_die, ITypeHandle type)
- : this (parent_die, type, type.Name)
- { }
-
- public DieBaseType (DieCompileUnit parent_die, ITypeHandle type, string name)
- : base (parent_die, type, my_abbrev_id)
- {
- this.type = type.Type;
- this.name = name;
- }
-
- protected enum DW_ATE {
- ATE_void = 0x00,
- ATE_address = 0x01,
- ATE_boolean = 0x02,
- ATE_complex_float = 0x03,
- ATE_float = 0x04,
- ATE_signed = 0x05,
- ATE_signed_char = 0x06,
- ATE_unsigned = 0x07,
- ATE_unsigned_char = 0x08
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (name);
- if (type == typeof (void)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_address);
- aw.WriteUInt8 (0);
- } else if (type == typeof (bool)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_boolean);
- aw.WriteUInt8 (1);
- } else if (type == typeof (char)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_unsigned_char);
- aw.WriteUInt8 (2);
- } else if (type == typeof (sbyte)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_signed);
- aw.WriteUInt8 (1);
- } else if (type == typeof (byte)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_unsigned);
- aw.WriteUInt8 (1);
- } else if (type == typeof (short)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_signed);
- aw.WriteUInt8 (2);
- } else if (type == typeof (ushort)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_unsigned);
- aw.WriteUInt8 (2);
- } else if (type == typeof (int)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_signed);
- aw.WriteUInt8 (4);
- } else if (type == typeof (uint)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_unsigned);
- aw.WriteUInt8 (4);
- } else if (type == typeof (long)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_signed);
- aw.WriteUInt8 (8);
- } else if (type == typeof (ulong)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_unsigned);
- aw.WriteUInt8 (8);
- } else if (type == typeof (float)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_float);
- aw.WriteUInt8 (4);
- } else if (type == typeof (double)) {
- aw.WriteUInt8 ((int) DW_ATE.ATE_float);
- aw.WriteUInt8 (8);
- } else
- throw new ArgumentException ("Not a base type: " + type);
- }
- }
-
- //
- // Abstract base class for types.
- //
-
- public abstract class DieType : Die
- {
- private readonly ITypeHandle type_handle;
-
- public DieType (Die parent_die, Type type, int abbrev_id)
- : this (parent_die, parent_die.Writer.RegisterType (type), abbrev_id)
- { }
-
- public DieType (Die parent_die, ITypeHandle type_handle, int abbrev_id)
- : base (parent_die, abbrev_id)
- {
- this.type_handle = type_handle;
- }
-
- public virtual void CreateType ()
- { }
-
- public ITypeHandle TypeHandle {
- get {
- return type_handle;
- }
- }
- }
-
-
- // DW_TAG_pointer_type
- public class DiePointerType : DieType
- {
- private static int my_abbrev_id;
-
- static DiePointerType ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_pointer_type, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- public DiePointerType (DieCompileUnit parent_die, ITypeHandle type)
- : base (parent_die, type, my_abbrev_id)
- { }
-
- public override void DoEmit ()
- {
- DieCompileUnit.WriteTypeReference (TypeHandle);
- }
- }
-
- public class DieTypeDef : DieType
- {
- private static int my_abbrev_id;
-
- static DieTypeDef ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_typedef, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected string name;
-
- public DieTypeDef (Die parent_die, ITypeHandle type, string name)
- : base (parent_die, type, my_abbrev_id)
- {
- this.name = name;
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (name);
- DieCompileUnit.WriteTypeReference (TypeHandle);
- }
- }
-
- public class DieInternalPointer : Die
- {
- private static int my_abbrev_id;
-
- static DieInternalPointer ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_pointer_type, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected Die type_die;
-
- public DieInternalPointer (DieCompileUnit parent_die, Die type_die)
- : base (parent_die, my_abbrev_id)
- {
- this.type_die = type_die;
- }
-
- public override void DoEmit ()
- {
- DieCompileUnit.WriteRelativeDieReference (type_die);
- }
- }
-
- // DW_TAG_enumeration_type
- public class DieEnumType : DieType
- {
- private static int my_abbrev_id;
-
- static DieEnumType ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_byte_size, DW_FORM.FORM_data1)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_enumeration_type, true, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- public DieEnumType (DieCompileUnit parent_die, ITypeHandle type)
- : base (parent_die, type, my_abbrev_id)
- {
- Array values = Enum.GetValues (type.Type);
- string[] names = Enum.GetNames (type.Type);
-
- foreach (object value in values) {
- int intval;
- string name = null;
-
- if (value is int)
- intval = (int) value;
- else
- intval = System.Convert.ToInt32 (value);
-
- for (int i = 0; i < values.Length; ++i)
- if (value.Equals (values.GetValue (i))) {
- name = names [i];
- break;
- }
-
- if (name == null)
- throw new ArgumentException ();
-
- new DieEnumerator (this, name, intval);
- }
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (TypeHandle.Name);
- dw.AddRelocEntry_TypeSize (TypeHandle);
- aw.WriteUInt8 (0);
- }
- }
-
- // DW_TAG_enumerator
- public class DieEnumerator : Die
- {
- private static int my_abbrev_id;
-
- static DieEnumerator ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_const_value, DW_FORM.FORM_data4)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_enumerator, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected string name;
- protected int value;
-
- public DieEnumerator (DieEnumType parent_die, string name, int value)
- : base (parent_die, my_abbrev_id)
- {
- this.name = name;
- this.value = value;
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (name);
- aw.WriteInt32 (value);
- }
- }
-
- // DW_TAG_structure_type
- public class DieStructureType : DieType
- {
- private static int my_abbrev_id;
-
- static DieStructureType ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_byte_size, DW_FORM.FORM_data1)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_structure_type, true, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected readonly Type type;
- protected string name;
- protected FieldInfo[] fields;
- protected ITypeHandle[] field_types;
- protected Die[] field_dies;
-
- protected const BindingFlags FieldBindingFlags =
- BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static |
- BindingFlags.Instance;
-
- public override void CreateType ()
- {
- fields = this.type.GetFields (FieldBindingFlags);
- field_types = new ITypeHandle [fields.Length];
- field_dies = new Die [fields.Length];
-
- for (int i = 0; i < fields.Length; i++) {
- Type field_type = fields [i].FieldType;
- field_types [i] = dw.RegisterType (field_type);
- DW_ACCESS access;
-
- if (fields [i].IsPublic)
- access = DW_ACCESS.ACCESS_public;
- else if (fields [i].IsPrivate)
- access = DW_ACCESS.ACCESS_private;
- else
- access = DW_ACCESS.ACCESS_protected;
-
- field_dies [i] = new DieMember (this, fields [i].Name, i,
- field_types [i], access);
- }
-
- base.CreateType ();
- }
-
- public DieStructureType (DieCompileUnit parent_die, ITypeHandle type)
- : this (parent_die, type, type.Name, my_abbrev_id)
- { }
-
- protected DieStructureType (DieCompileUnit parent_die, ITypeHandle type,
- int abbrev_id)
- : this (parent_die, type, type.Name, abbrev_id)
- { }
-
- protected DieStructureType (DieCompileUnit parent_die, ITypeHandle type,
- string name)
- : this (parent_die, type, name, my_abbrev_id)
- { }
-
- protected DieStructureType (DieCompileUnit parent_die, ITypeHandle type,
- string name, int abbrev_id)
- : base (parent_die, type, abbrev_id)
- {
- this.type = type.Type;
- this.name = name;
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (name);
- dw.AddRelocEntry_TypeSize (TypeHandle);
- aw.WriteUInt8 (0);
- }
- }
-
- public class DieArrayType : DieStructureType
- {
- protected new readonly ITypeHandle type;
- protected ITypeHandle element_type;
- protected int rank;
-
- public DieArrayType (DieCompileUnit parent_die, ITypeHandle type)
- : this (parent_die, type, type.Type.GetArrayRank ())
- { }
-
- private DieArrayType (DieCompileUnit parent_die, ITypeHandle type, int rank)
- : base (parent_die, parent_die.Writer.array_type, type.Name)
- {
- this.type = type;
- this.rank = rank;
- }
-
- public override void CreateType ()
- {
- element_type = ((TypeHandle) type).ArrayElementType;
-
- new DieMember (this, "Bounds",
- (int) MRI_array.offset_bounds,
- ((TypeHandle) type).ArrayBoundsType);
-
- new DieMember (this, "MaxLength",
- (int) MRI_array.offset_max_length,
- dw.int_type);
-
- new DieMember (this, "Vector",
- (int) MRI_array.offset_vector,
- ((TypeHandle) type).ArrayVectorType);
-
- base.CreateType ();
- }
- }
-
- public class DieArrayBoundsType : DieStructureType
- {
- public DieArrayBoundsType (DieCompileUnit parent_die, ITypeHandle type)
- : base (parent_die, type, type.Name)
- { }
-
- public override void CreateType ()
- {
- new DieMember (this, "Lower",
- (int) MRI_array_bounds.offset_lower,
- dw.int_type);
-
- new DieMember (this, "Length",
- (int) MRI_array_bounds.offset_length,
- dw.int_type);
-
- base.CreateType ();
- }
- }
-
- public class DieStringType : DieStructureType
- {
- protected new readonly ITypeHandle type;
-
- public DieStringType (DieCompileUnit parent_die, ITypeHandle type)
- : base (parent_die, parent_die.Writer.string_type, "MonoString")
- {
- this.type = type;
- }
-
- public override void CreateType ()
- {
- new DieMember (this, "Length",
- (int) MRI_string.offset_length,
- dw.int_type);
-
- new DieMember (this, "Chars",
- (int) MRI_string.offset_chars,
- dw.string_type.ArrayVectorType);
-
- base.CreateType ();
- }
- }
-
- protected class DieInternalArray : DieType
- {
- private static int my_abbrev_id;
-
- static DieInternalArray ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4),
- new AbbrevEntry (DW_AT.AT_byte_size, DW_FORM.FORM_data1)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_array_type, true, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- public DieInternalArray (Die parent_die, ITypeHandle type)
- : base (parent_die, type, my_abbrev_id)
- { }
-
- public override void DoEmit ()
- {
- aw.WriteString (TypeHandle.Name);
- DieCompileUnit.WriteTypeReference (TypeHandle);
- aw.WriteUInt8 (4);
- }
- }
-
- public class DieSubRangeType : DieType
- {
- private static int my_abbrev_id;
-
- static DieSubRangeType ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4),
- new AbbrevEntry (DW_AT.AT_lower_bound, DW_FORM.FORM_data4),
- new AbbrevEntry (DW_AT.AT_upper_bound, DW_FORM.FORM_data4)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_subrange_type, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected int lower;
- protected int upper;
-
- public DieSubRangeType (Die parent_die, ITypeHandle type, int lower, int upper)
- : base (parent_die, type, my_abbrev_id)
- {
- this.lower = lower;
- this.upper = upper;
- }
-
- public override void DoEmit ()
- {
- DieCompileUnit.WriteTypeReference (TypeHandle);
- aw.WriteInt32 (lower);
- aw.WriteInt32 (upper);
- }
- }
-
- // DW_TAG_class_type
- public class DieClassType : DieStructureType
- {
- private static int my_abbrev_id;
-
- static DieClassType ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_byte_size, DW_FORM.FORM_data1)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_class_type, true, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- ITypeHandle base_type;
-
- public DieClassType (DieCompileUnit parent_die, ITypeHandle type_handle)
- : base (parent_die, type_handle, my_abbrev_id)
- {
- }
-
- public override void CreateType ()
- {
- Type baset = TypeHandle.Type.BaseType;
-
- if ((baset != null) && !baset.Equals (typeof (object)) && !baset.Equals (typeof (System.Array))) {
- base_type = dw.RegisterType (baset);
-
- new DieInheritance (this, base_type);
- }
-
- base.CreateType ();
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (TypeHandle.Name);
- dw.AddRelocEntry_TypeSize (TypeHandle);
- aw.WriteUInt8 (0);
- }
- }
-
- // DW_TAG_inheritance
- public class DieInheritance : DieType
- {
- private static int my_abbrev_id;
-
- static DieInheritance ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4),
- new AbbrevEntry (DW_AT.AT_data_member_location, DW_FORM.FORM_block4)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_inheritance, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- public DieInheritance (Die parent_die, ITypeHandle type)
- : base (parent_die, type, my_abbrev_id)
- { }
-
- public override void DoEmit ()
- {
- DieCompileUnit.WriteTypeReference (TypeHandle);
-
- object end_index = aw.StartSubsectionWithSize ();
- aw.WriteUInt8 ((int) DW_OP.OP_const1u);
- aw.WriteUInt8 (0);
- aw.EndSubsection (end_index);
- }
- }
-
- // DW_TAG_member
- public class DieMember : DieType
- {
- private static int my_abbrev_id;
-
- static DieMember ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4),
- new AbbrevEntry (DW_AT.AT_accessibility, DW_FORM.FORM_data1),
- new AbbrevEntry (DW_AT.AT_data_member_location, DW_FORM.FORM_block4)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_member, false, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected string name;
- protected int index;
- protected DW_ACCESS access;
- protected DieType parent_die;
-
- public DieMember (DieType parent_die, string name, int index,
- ITypeHandle type, DW_ACCESS access)
- : base (parent_die, type, my_abbrev_id)
- {
- this.name = name;
- this.index = index;
- this.access = access;
- this.parent_die = parent_die;
- }
-
- public DieMember (DieType parent_die, string name, int index, ITypeHandle type)
- : this (parent_die, name, index, type,
- DW_ACCESS.ACCESS_public)
- { }
-
- public override void DoEmit ()
- {
- aw.WriteString (name);
- DieCompileUnit.WriteTypeReference (TypeHandle);
- aw.WriteUInt8 ((int) access);
-
- object end_index = aw.StartSubsectionWithSize ();
- aw.WriteUInt8 ((int) DW_OP.OP_const4u);
- dw.AddRelocEntry_TypeFieldOffset (parent_die.TypeHandle, index);
- aw.WriteInt32 (0);
- aw.EndSubsection (end_index);
- }
- }
-
- // DW_TAG_lexical_block
- public class DieLexicalBlock : Die
- {
- private static int my_abbrev_id;
-
- static DieLexicalBlock ()
- {
- AbbrevEntry[] entries = {
- new AbbrevEntry (DW_AT.AT_low_pc, DW_FORM.FORM_addr),
- new AbbrevEntry (DW_AT.AT_high_pc, DW_FORM.FORM_addr)
- };
-
- AbbrevDeclaration decl = new AbbrevDeclaration (
- DW_TAG.TAG_lexical_block, true, entries);
-
- my_abbrev_id = RegisterAbbrevDeclaration (decl);
- }
-
- protected ISourceBlock block;
-
- public DieLexicalBlock (Die parent_die, ISourceBlock block)
- : base (parent_die, my_abbrev_id)
- {
- this.block = block;
- }
-
- public override void DoEmit ()
- {
- int token = block.SourceMethod.Token;
- int start_offset = block.Start.Offset;
- int end_offset = block.End.Offset;
-
- dw.AddRelocEntry (RelocEntryType.IL_OFFSET, token, start_offset);
- aw.WriteAddress (0);
- dw.AddRelocEntry (RelocEntryType.IL_OFFSET, token, end_offset);
- aw.WriteAddress (0);
- }
- }
-
- public abstract class DieVariable : Die
- {
- private static int my_abbrev_id_this;
- private static int my_abbrev_id_local;
- private static int my_abbrev_id_param;
-
- public enum VariableType {
- VARIABLE_THIS,
- VARIABLE_PARAMETER,
- VARIABLE_LOCAL
- };
-
- static int get_abbrev_id (VariableType vtype)
- {
- switch (vtype) {
- case VariableType.VARIABLE_THIS:
- return my_abbrev_id_this;
- case VariableType.VARIABLE_PARAMETER:
- return my_abbrev_id_param;
- case VariableType.VARIABLE_LOCAL:
- return my_abbrev_id_local;
- default:
- throw new ArgumentException ();
- }
- }
-
- static DieVariable ()
- {
- AbbrevEntry[] entries_1 = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4),
- new AbbrevEntry (DW_AT.AT_external, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_location, DW_FORM.FORM_block4),
- new AbbrevEntry (DW_AT.AT_start_scope, DW_FORM.FORM_addr),
- new AbbrevEntry (DW_AT.AT_end_scope, DW_FORM.FORM_addr)
- };
- AbbrevEntry[] entries_2 = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4),
- new AbbrevEntry (DW_AT.AT_external, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_location, DW_FORM.FORM_block4),
- };
- AbbrevEntry[] entries_3 = {
- new AbbrevEntry (DW_AT.AT_name, DW_FORM.FORM_string),
- new AbbrevEntry (DW_AT.AT_type, DW_FORM.FORM_ref4),
- new AbbrevEntry (DW_AT.AT_artificial, DW_FORM.FORM_flag),
- new AbbrevEntry (DW_AT.AT_location, DW_FORM.FORM_block4),
- };
-
- AbbrevDeclaration decl_local = new AbbrevDeclaration (
- DW_TAG.TAG_variable, false, entries_1);
- AbbrevDeclaration decl_param = new AbbrevDeclaration (
- DW_TAG.TAG_formal_parameter, false, entries_2);
- AbbrevDeclaration decl_this = new AbbrevDeclaration (
- DW_TAG.TAG_formal_parameter, false, entries_3);
-
-
- my_abbrev_id_local = RegisterAbbrevDeclaration (decl_local);
- my_abbrev_id_param = RegisterAbbrevDeclaration (decl_param);
- my_abbrev_id_this = RegisterAbbrevDeclaration (decl_this);
- }
-
- protected string name;
- protected ITypeHandle type_handle;
- protected VariableType vtype;
-
- public DieVariable (Die parent_die, string name, Type type, VariableType vtype)
- : this (parent_die, name, parent_die.Writer.RegisterType (type), vtype)
- { }
-
- public DieVariable (Die parent_die, string name, ITypeHandle handle, VariableType vtype)
- : base (parent_die, get_abbrev_id (vtype))
- {
- this.name = name;
- this.type_handle = handle;
- this.vtype = vtype;
- }
-
- public override void DoEmit ()
- {
- aw.WriteString (name);
- DieCompileUnit.WriteTypeReference (type_handle);
- switch (vtype) {
- case VariableType.VARIABLE_LOCAL:
- aw.WriteUInt8 (false);
- DoEmitLocation ();
- DoEmitScope ();
- break;
- case VariableType.VARIABLE_PARAMETER:
- aw.WriteUInt8 (false);
- DoEmitLocation ();
- break;
- case VariableType.VARIABLE_THIS:
- aw.WriteUInt8 (true);
- DoEmitLocation ();
- break;
- }
- }
-
- protected abstract void DoEmitLocation ();
- protected abstract void DoEmitScope ();
- }
-
- public class DieMethodVariable : DieVariable
- {
- public DieMethodVariable (Die parent_die, ILocalVariable local)
- : base (parent_die, local.Name, local.TypeHandle,
- VariableType.VARIABLE_LOCAL)
- {
- this.var = local;
- }
-
- public DieMethodVariable (Die parent_die, IMethodParameter param)
- : base (parent_die, param.Name, param.TypeHandle,
- VariableType.VARIABLE_PARAMETER)
- {
- this.var = param;
- }
-
- public DieMethodVariable (Die parent_die, ISourceMethod method)
- : base (parent_die, "this", method.MethodBase.ReflectedType,
- VariableType.VARIABLE_THIS)
- {
- this.method = method;
- }
-
- protected IVariable var;
- protected ISourceMethod method;
-
- protected override void DoEmitLocation ()
- {
- object end_index = aw.StartSubsectionWithSize ();
- // These relocation entries expect a location description
- // of exactly 8 bytes.
- switch (vtype) {
- case VariableType.VARIABLE_LOCAL:
- dw.AddRelocEntry (RelocEntryType.LOCAL_VARIABLE,
- var.Method.Token, var.Index);
- break;
- case VariableType.VARIABLE_PARAMETER:
- dw.AddRelocEntry (RelocEntryType.METHOD_PARAMETER,
- var.Method.Token, var.Index);
- break;
- case VariableType.VARIABLE_THIS:
- dw.AddRelocEntry (RelocEntryType.METHOD_PARAMETER,
- method.Token, 0);
- break;
- }
- // This looks a bit strange, but OP_fbreg takes a sleb128
- // agument and we can't fields of variable size.
- aw.WriteUInt8 ((int) DW_OP.OP_fbreg);
- aw.WriteSLeb128 (0);
- aw.WriteUInt8 ((int) DW_OP.OP_const4s);
- aw.WriteInt32 (0);
- aw.WriteUInt8 ((int) DW_OP.OP_plus);
- aw.EndSubsection (end_index);
- }
-
- protected override void DoEmitScope ()
- {
- dw.AddRelocEntry (RelocEntryType.VARIABLE_START_SCOPE,
- var.Method.Token, var.Index);
- aw.WriteAddress (0);
- dw.AddRelocEntry (RelocEntryType.VARIABLE_END_SCOPE,
- var.Method.Token, var.Index);
- aw.WriteAddress (0);
- }
- }
-
- protected const int reloc_table_version = 12;
-
- protected enum Section {
- DEBUG_INFO = 0x01,
- DEBUG_ABBREV = 0x02,
- DEBUG_LINE = 0x03,
- MONO_RELOC_TABLE = 0x04,
- MONO_LINE_NUMBERS = 0x05
- }
-
- public struct AbbrevEntry {
- public AbbrevEntry (DW_AT attribute, DW_FORM form)
- {
- this._attribute = attribute;
- this._form = form;
- }
-
- private DW_AT _attribute;
- private DW_FORM _form;
-
- public DW_AT Attribute {
- get {
- return _attribute;
- }
- }
-
- public DW_FORM Form {
- get {
- return _form;
- }
- }
- }
-
- public struct AbbrevDeclaration {
- public AbbrevDeclaration (DW_TAG tag, bool has_children, AbbrevEntry[] entries)
- {
- this._tag = tag;
- this._has_children = has_children;
- this._entries = entries;
- }
-
- private DW_TAG _tag;
- private bool _has_children;
- private AbbrevEntry[] _entries;
-
- public DW_TAG Tag {
- get {
- return _tag;
- }
- }
-
- public bool HasChildren {
- get {
- return _has_children;
- }
- }
-
- public AbbrevEntry[] Entries {
- get {
- return _entries;
- }
- }
- }
-
-
- protected enum RelocEntryType {
- NONE,
- // Size of an address on the target machine
- TARGET_ADDRESS_SIZE = 0x01,
- // Map an IL offset to a machine address
- IL_OFFSET = 0x02,
- // Start address of machine code for this method
- METHOD_START_ADDRESS = 0x03,
- // End address of machine code for this method
- METHOD_END_ADDRESS = 0x04,
- // Stack offset of local variable
- LOCAL_VARIABLE = 0x05,
- // Stack offset of method parameter
- METHOD_PARAMETER = 0x06,
- // Sizeof (type)
- TYPE_SIZEOF = 0x07,
- TYPE_FIELD_OFFSET = 0x08,
- MONO_STRING_SIZEOF = 0x09,
- MONO_STRING_OFFSET = 0x0a,
- MONO_ARRAY_SIZEOF = 0x0b,
- MONO_ARRAY_OFFSET = 0x0c,
- MONO_ARRAY_BOUNDS_SIZEOF = 0x0d,
- MONO_ARRAY_BOUNDS_OFFSET = 0x0e,
- VARIABLE_START_SCOPE = 0x0f,
- VARIABLE_END_SCOPE = 0x10,
- MONO_STRING_FIELDSIZE = 0x11,
- MONO_ARRAY_FIELDSIZE = 0x12,
- TYPE_FIELD_FIELDSIZE = 0x13
- }
-
- protected class RelocEntry {
- public RelocEntry (RelocEntryType type, int token, int original,
- Section section, int index)
- {
- _type = type;
- _section = section;
- _token = token;
- _original = original;
- _index = index;
- }
-
- public RelocEntryType RelocType {
- get {
- return _type;
- }
- }
-
- public Section Section {
- get {
- return _section;
- }
- }
-
- public int Index {
- get {
- return _index;
- }
- }
-
- public int Token {
- get {
- return _token;
- }
- }
-
- public int Original {
- get {
- return _original;
- }
- }
-
- private RelocEntryType _type;
- private Section _section;
- private int _token;
- private int _index;
- private int _original;
- }
-
- private Section current_section;
- private ArrayList reloc_entries = new ArrayList ();
-
- private static ArrayList abbrev_declarations = new ArrayList ();
-
- protected string GetSectionName (Section section)
- {
- switch (section) {
- case Section.DEBUG_INFO:
- return "debug_info";
- case Section.DEBUG_ABBREV:
- return "debug_abbrev";
- case Section.DEBUG_LINE:
- return "debug_line";
- case Section.MONO_RELOC_TABLE:
- return "mono_reloc_table";
- case Section.MONO_LINE_NUMBERS:
- return "mono_line_numbers";
- default:
- throw new ArgumentException ();
- }
- }
-
- protected void AddRelocEntry (RelocEntry entry)
- {
- reloc_entries.Add (entry);
- }
-
- protected void AddRelocEntry (RelocEntryType type, int token, int original,
- Section section, int index)
- {
- AddRelocEntry (new RelocEntry (type, token, original, section, index));
- }
-
- protected void AddRelocEntry (RelocEntryType type, int token, int original)
- {
- AddRelocEntry (type, token, original, current_section, aw.WriteLabel ());
- }
-
- protected void AddRelocEntry (RelocEntryType type, int token)
- {
- AddRelocEntry (type, token, 0);
- }
-
- protected void AddRelocEntry (RelocEntryType type)
- {
- AddRelocEntry (type, 0);
- }
-
- protected void AddRelocEntry (RelocEntryType entry_type, ITypeHandle type)
- {
- AddRelocEntry (entry_type, type, 0);
- }
-
- protected void AddRelocEntry (RelocEntryType entry_type, ITypeHandle type, int original)
- {
- AddRelocEntry (entry_type, type.Token, original);
- }
-
- protected void AddRelocEntry_TypeSize (ITypeHandle type)
- {
- if (type == string_type)
- AddRelocEntry (RelocEntryType.MONO_STRING_SIZEOF);
- else if (type == array_type)
- AddRelocEntry (RelocEntryType.MONO_ARRAY_SIZEOF);
- else if (type.Type.Equals (typeof (MonoArrayBounds)))
- AddRelocEntry (RelocEntryType.MONO_ARRAY_BOUNDS_SIZEOF);
- else
- AddRelocEntry (RelocEntryType.TYPE_SIZEOF, type);
- }
-
- protected void AddRelocEntry_TypeFieldOffset (ITypeHandle type, int index)
- {
- if (type == string_type)
- AddRelocEntry (RelocEntryType.MONO_STRING_OFFSET, index);
- else if (type == array_type)
- AddRelocEntry (RelocEntryType.MONO_ARRAY_OFFSET, index);
- else if (type.Type.Equals (typeof (MonoArrayBounds)))
- AddRelocEntry (RelocEntryType.MONO_ARRAY_BOUNDS_OFFSET, index);
- else
- AddRelocEntry (RelocEntryType.TYPE_FIELD_OFFSET, type, index);
- }
-
- protected void AddRelocEntry_TypeFieldSize (ITypeHandle type, int index)
- {
- if (type == string_type)
- AddRelocEntry (RelocEntryType.MONO_STRING_FIELDSIZE, index);
- else if (type == array_type)
- AddRelocEntry (RelocEntryType.MONO_ARRAY_FIELDSIZE, index);
- else
- AddRelocEntry (RelocEntryType.TYPE_FIELD_FIELDSIZE, type, index);
- }
-
- //
- // Mono relocation table. See the README.relocation-table file in this
- // directory for a detailed description of the file format.
- //
- protected void WriteRelocEntries ()
- {
- WriteSectionStart (Section.MONO_RELOC_TABLE);
- aw.WriteUInt16 (reloc_table_version);
- aw.WriteUInt8 (0);
- object end_index = aw.StartSubsectionWithSize ();
-
- int count = 0;
-
- foreach (RelocEntry entry in reloc_entries) {
- count++;
-
- aw.WriteUInt8 ((int) entry.RelocType);
- object tmp_index = aw.StartSubsectionWithSize ();
-
- aw.WriteUInt8 ((int) entry.Section);
- aw.WriteAbsoluteOffset (entry.Index);
-
- switch (entry.RelocType) {
- case RelocEntryType.METHOD_START_ADDRESS:
- case RelocEntryType.METHOD_END_ADDRESS:
- case RelocEntryType.TYPE_SIZEOF:
- aw.WriteUInt32 (entry.Token);
- break;
- case RelocEntryType.IL_OFFSET:
- case RelocEntryType.LOCAL_VARIABLE:
- case RelocEntryType.METHOD_PARAMETER:
- case RelocEntryType.TYPE_FIELD_OFFSET:
- case RelocEntryType.VARIABLE_START_SCOPE:
- case RelocEntryType.VARIABLE_END_SCOPE:
- case RelocEntryType.TYPE_FIELD_FIELDSIZE:
- aw.WriteUInt32 (entry.Token);
- aw.WriteUInt32 (entry.Original);
- break;
- case RelocEntryType.MONO_STRING_SIZEOF:
- case RelocEntryType.MONO_ARRAY_SIZEOF:
- case RelocEntryType.MONO_ARRAY_BOUNDS_SIZEOF:
- break;
- case RelocEntryType.MONO_STRING_OFFSET:
- case RelocEntryType.MONO_ARRAY_OFFSET:
- case RelocEntryType.MONO_ARRAY_BOUNDS_OFFSET:
- case RelocEntryType.MONO_STRING_FIELDSIZE:
- case RelocEntryType.MONO_ARRAY_FIELDSIZE:
- aw.WriteUInt32 (entry.Token);
- break;
- }
-
- aw.EndSubsection (tmp_index);
- }
-
- aw.EndSubsection (end_index);
- aw.WriteSectionEnd ();
- }
-
- //
- // Registers a new abbreviation declaration.
- //
- // This function should be called by a static constructor in one of
- // Die's subclasses.
- //
- protected static int RegisterAbbrevDeclaration (AbbrevDeclaration decl)
- {
- return abbrev_declarations.Add (decl) + 1;
- }
-
- protected static AbbrevDeclaration GetAbbrevDeclaration (int index)
- {
- return (AbbrevDeclaration) abbrev_declarations [index - 1];
- }
-
- protected void WriteAbbrevDeclarations ()
- {
- aw.WriteSectionStart (GetSectionName (Section.DEBUG_ABBREV));
- aw.WriteLabel ("debug_abbrev_b");
-
- for (int index = 0; index < abbrev_declarations.Count; index++) {
- AbbrevDeclaration decl = (AbbrevDeclaration) abbrev_declarations [index];
-
- aw.WriteULeb128 (index + 1);
- aw.WriteULeb128 ((int) decl.Tag);
- aw.WriteUInt8 (decl.HasChildren);
-
- foreach (AbbrevEntry entry in decl.Entries) {
- aw.WriteULeb128 ((int) entry.Attribute);
- aw.WriteULeb128 ((int) entry.Form);
- }
-
- aw.WriteUInt8 (0);
- aw.WriteUInt8 (0);
- }
-
- aw.WriteSectionEnd ();
- }
-
- protected void WriteSectionStart (Section section)
- {
- aw.WriteSectionStart (GetSectionName (section));
- current_section = section;
- }
-
- public void WriteSymbolTable (IMonoSymbolWriter symwriter)
- {
- WriteSectionStart (Section.MONO_LINE_NUMBERS);
- aw.WriteUInt16 (reloc_table_version);
-
- Hashtable sources = new Hashtable ();
-
- foreach (ISourceFile source in symwriter.Sources) {
- if (sources.ContainsKey (source))
- continue;
-
- sources.Add (source, aw.GetNextLabelIndex ());
- }
-
- object line_number_end_index = aw.StartSubsectionWithSize ();
-
- Hashtable method_labels = new Hashtable ();
-
- foreach (ISourceMethod method in symwriter.Methods) {
- if (method.Start == null || method.Start.Row == 0)
- continue;
-
- int label = aw.GetNextLabelIndex ();
- aw.WriteUInt32 (method.Token);
- aw.WriteAbsoluteOffset ((int) sources [method.SourceFile]);
- aw.WriteUInt32 (method.Start.Row);
- aw.WriteAbsoluteOffset (label);
-
- method_labels [method] = label;
- }
-
- aw.EndSubsection (line_number_end_index);
-
- foreach (ISourceMethod method in method_labels.Keys) {
- aw.WriteLabel ((int) method_labels [method]);
-
- foreach (ISourceLine line in method.Lines) {
- aw.WriteUInt32 (line.Row);
- aw.WriteUInt32 (line.Offset);
- }
-
- aw.WriteUInt32 (0);
- aw.WriteUInt32 (0);
- }
-
- foreach (ISourceFile source in sources.Keys) {
- aw.WriteLabel ((int) sources [source]);
-
- aw.WriteString (source.FileName);
- }
-
- aw.WriteSectionEnd ();
- }
- }
-
- internal struct MonoString
- { }
-
- internal struct MonoArrayBounds
- { }
-
- internal struct MonoArray
- { }
-}
diff --git a/mcs/class/Mono.CSharp.Debugger/MonoSymbolDocumentWriter.cs b/mcs/class/Mono.CSharp.Debugger/MonoSymbolDocumentWriter.cs
deleted file mode 100644
index 27c4ea48749..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/MonoSymbolDocumentWriter.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Diagnostics.SymbolStore/MonoSymbolDocumentWriter.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// This is the default implementation of the
-// System.Diagnostics.SymbolStore.ISymbolDocumentWriter interface.
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics.SymbolStore;
-using System.IO;
-
-namespace Mono.CSharp.Debugger
-{
-
- public class MonoSymbolDocumentWriter : ISymbolDocumentWriter
- {
- protected string url;
-
- //
- // Constructor
- //
- public MonoSymbolDocumentWriter (string url)
- {
- this.url = url;
- }
-
- public string FileName {
- get {
- return url;
- }
- }
-
- //
- // Interface ISymbolDocumentWriter
- //
-
- //
- // MonoSymbolWriter creates a DWARF 2 debugging file and DWARF operates
- // on file names, but has no way to include a whole source file in the
- // symbol file.
- //
-
- public void SetCheckSum (Guid algorithmId, byte[] checkSum)
- {
- throw new NotSupportedException ();
- }
-
- public void SetSource (byte[] source)
- {
- throw new NotSupportedException ();
- }
- }
-}
diff --git a/mcs/class/Mono.CSharp.Debugger/MonoSymbolWriter.cs b/mcs/class/Mono.CSharp.Debugger/MonoSymbolWriter.cs
deleted file mode 100755
index f5c8e7a1df7..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/MonoSymbolWriter.cs
+++ /dev/null
@@ -1,804 +0,0 @@
-//
-// System.Diagnostics.SymbolStore/MonoSymbolWriter.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// This is the default implementation of the System.Diagnostics.SymbolStore.ISymbolWriter
-// interface.
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Diagnostics.SymbolStore;
-using System.Collections;
-using System.IO;
-
-namespace Mono.CSharp.Debugger
-{
- public class SourceFile : ISourceFile
- {
- private ArrayList _methods = new ArrayList ();
- private string _file_name;
-
- public SourceFile (string filename)
- {
- this._file_name = filename;
- }
-
- public override string ToString ()
- {
- return _file_name;
- }
-
- // interface ISourceFile
-
- public string FileName {
- get {
- return _file_name;
- }
- }
-
- public ISourceMethod[] Methods {
- get {
- ISourceMethod[] retval = new ISourceMethod [_methods.Count];
- _methods.CopyTo (retval);
- return retval;
- }
- }
-
- public void AddMethod (ISourceMethod method)
- {
- _methods.Add (method);
- }
- }
-
- public class SourceBlock : ISourceBlock
- {
- static private int next_index;
- private readonly int _index;
-
- public SourceBlock (ISourceMethod method, ISourceLine start, ISourceLine end)
- {
- this._method = method;
- this._start = start;
- this._end = end;
- this._index = ++next_index;
- }
-
- internal SourceBlock (ISourceMethod method, int startOffset)
- {
- this._method = method;
- this._start = new SourceLine (startOffset);
- this._index = ++next_index;
- }
-
- public override string ToString ()
- {
- return "SourceBlock #" + ID + " (" + Start + " - " + End + ")";
- }
-
- private readonly ISourceMethod _method;
- private ArrayList _blocks = new ArrayList ();
- internal ISourceLine _start;
- internal ISourceLine _end;
-
- private ArrayList _locals = new ArrayList ();
-
- public ISourceMethod SourceMethod {
- get {
- return _method;
- }
- }
-
- public ISourceBlock[] Blocks {
- get {
- ISourceBlock[] retval = new ISourceBlock [_blocks.Count];
- _blocks.CopyTo (retval);
- return retval;
- }
- }
-
- public void AddBlock (ISourceBlock block)
- {
- _blocks.Add (block);
- }
-
- public ISourceLine Start {
- get {
- return _start;
- }
- }
-
- public ISourceLine End {
- get {
- return _end;
- }
- }
-
- public int ID {
- get {
- return _index;
- }
- }
-
- public ILocalVariable[] Locals {
- get {
- ILocalVariable[] retval = new ILocalVariable [_locals.Count];
- _locals.CopyTo (retval);
- return retval;
- }
- }
-
- public void AddLocal (ILocalVariable local)
- {
- _locals.Add (local);
- }
- }
-
- public class SourceLine : ISourceLine
- {
- public SourceLine (int row, int column)
- : this (0, row, column)
- {
- this._type = SourceOffsetType.OFFSET_NONE;
- }
-
- public SourceLine (int offset, int row, int column)
- {
- this._offset = offset;
- this._row = row;
- this._column = column;
- this._type = SourceOffsetType.OFFSET_IL;
- }
-
- internal SourceLine (int offset)
- : this (offset, 0, 0)
- { }
-
- public override string ToString ()
- {
- return "SourceLine (" + _offset + "@" + _row + ":" + _column + ")";
- }
-
- internal SourceOffsetType _type;
- internal int _offset;
- internal int _row;
- internal int _column;
-
- // interface ISourceLine
-
- public SourceOffsetType OffsetType {
- get {
- return _type;
- }
- }
-
- public int Offset {
- get {
- return _offset;
- }
- }
-
- public int Row {
- get {
- return _row;
- }
- }
-
- public int Column {
- get {
- return _column;
- }
- }
- }
-
- public class Variable : IVariable
- {
- public Variable (string name, ITypeHandle handle, ISourceMethod method, int index)
- : this (name, handle, method, index, null)
- { }
-
- public Variable (string name, ITypeHandle handle, ISourceMethod method,
- int index, ISourceLine line)
- {
- this._name = name;
- this._handle = handle;
- this._method = method;
- this._line = line;
- this._index = index;
- }
-
- private readonly string _name;
- private readonly ITypeHandle _handle;
- private readonly ISourceMethod _method;
- private readonly ISourceLine _line;
- private readonly int _index;
-
- // interface IVariable
-
- public string Name {
- get {
- return _name;
- }
- }
-
- public ISourceMethod Method {
- get {
- return _method;
- }
- }
-
- public int Index {
- get {
- return _index;
- }
- }
-
- public ITypeHandle TypeHandle {
- get {
- return _handle;
- }
- }
-
- public ISourceLine Line {
- get {
- return _line;
- }
- }
- }
-
- public class LocalVariable : Variable, ILocalVariable
- {
- public LocalVariable (string name, ITypeHandle handle, ISourceMethod method,
- int index, ISourceLine line)
- : base (name, handle, method, index, line)
- { }
-
- public override string ToString ()
- {
- return "LocalVariable (" + Index + "," + Name + ")";
- }
- }
-
- public class MethodParameter : Variable, IMethodParameter
- {
- private static int get_index (ISourceMethod method, ParameterInfo param)
- {
- return method.MethodBase.IsStatic ? param.Position - 1 :
- param.Position;
- }
-
- public MethodParameter (DwarfFileWriter writer, ISourceMethod method,
- ParameterInfo param)
- : base (param.Name, writer.RegisterType (param.ParameterType),
- method, get_index (method, param))
- {
- this._method = method;
- this._param = param;
- }
-
- private readonly ISourceMethod _method;
- private readonly ParameterInfo _param;
- }
-
- public class SourceMethod : ISourceMethod
- {
- private ArrayList _lines = new ArrayList ();
- private ArrayList _blocks = new ArrayList ();
- private Hashtable _block_hash = new Hashtable ();
- private Stack _block_stack = new Stack ();
-
- internal readonly MethodBase _method_base;
- internal ISourceFile _source_file;
- internal int _token;
-
- private SourceBlock _implicit_block;
-
- public SourceMethod (MethodBase method_base, ISourceFile source_file)
- : this (method_base)
- {
- this._source_file = source_file;
- }
-
- internal SourceMethod (MethodBase method_base)
- {
- this._method_base = method_base;
-
- this._implicit_block = new SourceBlock (this, 0);
- }
-
- public void SetSourceRange (ISourceFile sourceFile,
- int startLine, int startColumn,
- int endLine, int endColumn)
- {
- _source_file = sourceFile;
- _implicit_block._start = new SourceLine (startLine, startColumn);
- _implicit_block._end = new SourceLine (endLine, endColumn);
- }
-
-
- public void StartBlock (ISourceBlock block)
- {
- _block_stack.Push (block);
- }
-
- public void EndBlock (int endOffset) {
- SourceBlock block = (SourceBlock) _block_stack.Pop ();
-
- block._end = new SourceLine (endOffset);
-
- if (_block_stack.Count > 0) {
- ISourceBlock parent = (ISourceBlock) _block_stack.Peek ();
-
- parent.AddBlock (block);
- } else
- _blocks.Add (block);
-
- _block_hash.Add (block.ID, block);
- }
-
- public void SetBlockRange (int BlockID, int startOffset, int endOffset)
- {
- SourceBlock block = (SourceBlock) _block_hash [BlockID];
- ((SourceLine) block.Start)._offset = startOffset;
- ((SourceLine) block.End)._offset = endOffset;
- }
-
- public ISourceBlock CurrentBlock {
- get {
- if (_block_stack.Count > 0)
- return (ISourceBlock) _block_stack.Peek ();
- else
- return _implicit_block;
- }
- }
-
- // interface ISourceMethod
-
- public ISourceLine[] Lines {
- get {
- ISourceLine[] retval = new ISourceLine [_lines.Count];
- _lines.CopyTo (retval);
- return retval;
- }
- }
-
- public void AddLine (ISourceLine line)
- {
- _lines.Add (line);
- }
-
- public ISourceBlock[] Blocks {
- get {
- ISourceBlock[] retval = new ISourceBlock [_blocks.Count];
- _blocks.CopyTo (retval);
- return retval;
- }
- }
-
- public ILocalVariable[] Locals {
- get {
- return _implicit_block.Locals;
- }
- }
-
- public void AddLocal (ILocalVariable local)
- {
- _implicit_block.AddLocal (local);
- }
-
- public MethodBase MethodBase {
- get {
- return _method_base;
- }
- }
-
- public string FullName {
- get {
- return _method_base.DeclaringType.FullName + "." + _method_base.Name;
- }
- }
-
- public Type ReturnType {
- get {
- if (_method_base is MethodInfo)
- return ((MethodInfo)_method_base).ReturnType;
- else if (_method_base is ConstructorInfo)
- return _method_base.DeclaringType;
- else
- throw new NotSupportedException ();
- }
- }
-
- public ParameterInfo[] Parameters {
- get {
- if (_method_base == null)
- return new ParameterInfo [0];
-
- ParameterInfo [] retval = _method_base.GetParameters ();
- if (retval == null)
- return new ParameterInfo [0];
- else
- return retval;
- }
- }
-
- public ISourceFile SourceFile {
- get {
- return _source_file;
- }
- }
-
- public int Token {
- get {
- if (_token != 0)
- return _token;
- else
- throw new NotSupportedException ();
- }
- }
-
- public ISourceLine Start {
- get {
- return _implicit_block.Start;
- }
- }
-
- public ISourceLine End {
- get {
- return _implicit_block.End;
- }
- }
- }
-
- public class MonoSymbolWriter : IMonoSymbolWriter
- {
- protected Assembly assembly;
- protected ModuleBuilder module_builder;
- protected ArrayList locals = null;
- protected ArrayList orphant_methods = null;
- protected ArrayList methods = null;
- protected Hashtable sources = null;
- protected DwarfFileWriter writer = null;
- private ArrayList mbuilder_array = null;
-
- public ISourceMethod[] Methods {
- get {
- ISourceMethod[] retval = new ISourceMethod [methods.Count];
- methods.CopyTo (retval);
- return retval;
- }
- }
-
- public ISourceFile[] Sources {
- get {
- ISourceFile[] retval = new ISourceFile [sources.Count];
- sources.Values.CopyTo (retval, 0);
- return retval;
- }
- }
-
- public DwarfFileWriter DwarfFileWriter {
- get {
- return writer;
- }
- }
-
- protected SourceMethod current_method = null;
- private readonly string assembly_filename = null;
-
- //
- // Interface IMonoSymbolWriter
- //
-
- public MonoSymbolWriter (ModuleBuilder mb, string filename, ArrayList mbuilder_array)
- {
- this.assembly_filename = filename;
- this.module_builder = mb;
- this.methods = new ArrayList ();
- this.sources = new Hashtable ();
- this.orphant_methods = new ArrayList ();
- this.locals = new ArrayList ();
- this.mbuilder_array = mbuilder_array;
- }
-
- public void Close () {
- if (assembly == null)
- assembly = Assembly.LoadFrom (assembly_filename);
-
- DoFixups (assembly);
-
- CreateDwarfFile (assembly);
- }
-
- public void CloseNamespace () {
- }
-
- // Create and return a new IMonoSymbolDocumentWriter.
- public ISymbolDocumentWriter DefineDocument (string url,
- Guid language,
- Guid languageVendor,
- Guid documentType)
- {
- return new MonoSymbolDocumentWriter (url);
- }
-
- public void DefineField (
- SymbolToken parent,
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3)
- {
- }
-
- public void DefineGlobalVariable (
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3)
- {
- }
-
- public void DefineLocalVariable (string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3,
- int startOffset,
- int endOffset)
- {
- throw new NotSupportedException ();
- }
-
- public void DefineLocalVariable (string name,
- LocalBuilder local,
- FieldAttributes attributes,
- int position,
- int startOffset,
- int endOffset)
- {
- if (current_method == null)
- return;
-
- ITypeHandle type = writer.RegisterType (local.LocalType);
-
- LocalVariable local_info = new LocalVariable (name, type, current_method,
- position, null);
-
- current_method.CurrentBlock.AddLocal (local_info);
- locals.Add (local_info);
- }
-
-
- public void DefineParameter (string name,
- ParameterAttributes attributes,
- int sequence,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3)
- {
- throw new NotSupportedException ();
- }
-
- public void DefineSequencePoints (ISymbolDocumentWriter document,
- int[] offsets,
- int[] lines,
- int[] columns,
- int[] endLines,
- int[] endColumns)
- {
- SourceLine source_line = new SourceLine (offsets [0], lines [0], columns [0]);
-
- if (current_method != null)
- current_method.AddLine (source_line);
- }
-
- public void Initialize (IntPtr emitter, string filename, bool fFullBuild)
- {
- throw new NotSupportedException ();
- }
-
- public void Initialize (string filename, string[] args)
- {
- this.writer = new DwarfFileWriter (filename, args);
- }
-
- public void OpenMethod (SymbolToken symbol_token)
- {
- int token = symbol_token.GetToken ();
-
- if ((token & 0xff000000) != 0x06000000)
- throw new ArgumentException ();
-
- int index = (token & 0xffffff) - 1;
-
- MethodBuilder mb = (MethodBuilder) mbuilder_array [index];
-
- current_method = new SourceMethod (mb);
-
- methods.Add (current_method);
- }
-
- public void SetMethodSourceRange (ISymbolDocumentWriter startDoc,
- int startLine, int startColumn,
- ISymbolDocumentWriter endDoc,
- int endLine, int endColumn)
- {
- if (current_method == null)
- return;
-
- if ((startDoc == null) || (endDoc == null))
- throw new NullReferenceException ();
-
- if (!(startDoc is MonoSymbolDocumentWriter) || !(endDoc is MonoSymbolDocumentWriter))
- throw new NotSupportedException ("both startDoc and endDoc must be of type "
- + "MonoSymbolDocumentWriter");
-
- if (!startDoc.Equals (endDoc))
- throw new NotSupportedException ("startDoc and endDoc must be the same");
-
- string source_file = ((MonoSymbolDocumentWriter) startDoc).FileName;
- SourceFile source_info;
-
- if (sources.ContainsKey (source_file))
- source_info = (SourceFile) sources [source_file];
- else {
- source_info = new SourceFile (source_file);
- sources.Add (source_file, source_info);
- }
-
- current_method.SetSourceRange (source_info, startLine, startColumn,
- endLine, endColumn);
-
- source_info.AddMethod (current_method);
- }
-
- public void CloseMethod () {
- current_method = null;
- }
-
- public void OpenNamespace (string name)
- {
- }
-
- public int OpenScope (int startOffset)
- {
- if (current_method == null)
- return 0;
-
- ISourceBlock block = new SourceBlock (current_method, startOffset);
- current_method.StartBlock (block);
-
- return block.ID;
- }
-
- public void CloseScope (int endOffset) {
- if (current_method == null)
- return;
-
- current_method.EndBlock (endOffset);
- }
-
- public void SetScopeRange (int scopeID, int startOffset, int endOffset)
- {
- if (current_method == null)
- return;
-
- current_method.SetBlockRange (scopeID, startOffset, endOffset);
- }
-
- public void SetSymAttribute (SymbolToken parent, string name, byte[] data)
- {
- }
-
- public void SetUnderlyingWriter (IntPtr underlyingWriter)
- {
- throw new NotSupportedException ();
- }
-
- public void SetUserEntryPoint (SymbolToken entryMethod)
- {
- }
-
- public void UsingNamespace (string fullName)
- {
- }
-
- //
- // MonoSymbolWriter implementation
- //
- protected void WriteLocal (DwarfFileWriter.Die parent_die, ILocalVariable local)
- {
- DwarfFileWriter.DieMethodVariable die;
-
- die = new DwarfFileWriter.DieMethodVariable (parent_die, local);
- }
-
- protected void WriteBlock (DwarfFileWriter.Die parent_die, ISourceBlock block)
- {
- DwarfFileWriter.DieLexicalBlock die;
-
- die = new DwarfFileWriter.DieLexicalBlock (parent_die, block);
-
- foreach (ILocalVariable local in block.Locals)
- WriteLocal (die, local);
-
- foreach (ISourceBlock subblock in block.Blocks)
- WriteBlock (die, subblock);
- }
-
- protected void WriteMethod (ISourceMethod method)
- {
- DwarfFileWriter.DieCompileUnit parent_die = writer.DieGlobalCompileUnit;
- DwarfFileWriter.DieSubProgram die;
-
- die = new DwarfFileWriter.DieSubProgram (parent_die, method);
-
- foreach (ILocalVariable local in method.Locals)
- WriteLocal (die, local);
-
- foreach (ISourceBlock block in method.Blocks)
- WriteBlock (die, block);
- }
-
- protected void WriteSource (DwarfFileWriter writer, ISourceFile source)
- {
- foreach (ISourceMethod method in source.Methods)
- WriteMethod (method);
- }
-
- protected void DoFixups (Assembly assembly)
- {
- foreach (SourceMethod method in methods) {
- if (method._method_base is MethodBuilder) {
- MethodBuilder mb = (MethodBuilder) method._method_base;
- method._token = mb.GetToken ().Token;
- } else if (method._method_base is ConstructorBuilder) {
- ConstructorBuilder cb = (ConstructorBuilder) method._method_base;
- method._token = cb.GetToken ().Token;
- } else
- throw new NotSupportedException ();
-
- if (method.SourceFile == null)
- orphant_methods.Add (method);
- }
- }
-
- protected void CreateDwarfFile (Assembly assembly)
- {
- foreach (ISourceFile source in sources.Values)
- WriteSource (writer, source);
-
- if (orphant_methods.Count > 0) {
- SourceFile source = new SourceFile ("<unknown>");
-
- foreach (SourceMethod orphant in orphant_methods) {
- orphant._source_file = source;
- source.AddMethod (orphant);
- }
-
- WriteSource (writer, source);
- }
-
- writer.WriteSymbolTable (this);
-
- writer.Close ();
- }
- }
-}
-
diff --git a/mcs/class/Mono.CSharp.Debugger/README b/mcs/class/Mono.CSharp.Debugger/README
deleted file mode 100644
index 4fb2043099f..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/README
+++ /dev/null
@@ -1,43 +0,0 @@
-This is an implementation of the System.Diagnostics.SymbolStore.ISymbolWriter
-interface which writes a dwarf debugging information file.
-
-Unfortunately there are several major problems with this interface and I'm
-unsure how to solve them:
-
-1.) The interface contains a constructor method `Initialize' which has an
- 'IntPtr' emitter argument which seems to be a pointer to the actual
- symbol writer which resides in a proprietary, undocumented DLL (I spent
- almost 3 hours browsing the ".NET Framework SDK Documentation" and
- msdn.microsoft.com - without success.
-
- A short test showed me that mscorlib doesn't like passing zero, this
- won't give you the system's default implementation.
-
- To solve this problem, I created a derived interface IMonoSymbolWriter
- which contains an additional constructor which only takes the name of
- the symbol file as argument.
-
- void Initialize (string filename);
-
-2.) You seem to get an instance of a class implementing this interface by
- creating a new instance of System.Reflection.Emit.ModuleBuilder (with the
- `bool createSymbolFile' argument) and then calling GetSymWriter() on
- the returned object.
-
- So far so good, but how does this method find out which symbol writer
- to use ?
-
-3.) According to the documentation, some of the methods of
- System.Reflection.Emit.ILGenerator and System.Reflection.Emit.LocalBuilder
- seem to use the symbol writer to emit symbol debugging information.
-
- But again, how do these objects get the symbol writer ?
-
-Currently, there are two ways to use this assembly:
-
-a.) Fix the problems outlined above and dynamically load this assembly
- (Mono.CSharp.Debugger.dll) when a new symbol writer is created.
-
-b.) Reference this assembly in your application and manually create the
- symbol writer using the constructor.
-
diff --git a/mcs/class/Mono.CSharp.Debugger/README.relocation-table b/mcs/class/Mono.CSharp.Debugger/README.relocation-table
deleted file mode 100644
index f9a875784fa..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/README.relocation-table
+++ /dev/null
@@ -1,100 +0,0 @@
-This is an implementation of the System.Diagnostics.SymbolStore.ISymbolWriter
-interface which writes a symbol file in the dwarf format.
-
-The output is an assembler input file containing dwarf data with an
-additional ELF section called ".mono_reloc_table". This section is
-read by the JIT engine to map IL offsets and such to machine
-addresses.
-
-The mono relocation table contains of
-
-1. A 2-byte unsigned integer containing a version number, currently 2.
-
-2. A 1-byte unsigned integer containing a flag specifying whether the
- object file containing this section has already been relocated.
-
- The symbol writer sets this flag to zero, you must change it to 1
- if you write the relocated file back to disk.
-
-3. A 4-byte unsigned integer containing the total size of the
- relocation table, but not including the size field itself.
-
-4. One or more relocation entries.
-
-Each entry in the relocation table has the following form:
-
-1. A 1-byte unsigned integer specifying the type of this entry.
-
-2. A 4-byte unsigned integer containing the size of this entry, but
- not including the size field itself.
-
-3. A 1-byte unsigned integer specifying the ELF section of this entry.
-
-4. A 4-byte unsigned offset from the beginning of the ELF section to
- the location which needs to be relocated. This is called the target.
-
-5. Optional additional data depending on the type of the entry.
-
-The following entry types are currently defined:
-
-a) TARGET_ADDRESS_SIZE - 0x01
-
- The target is a 1-byte unsigned integer containing the size in
- bytes of an address on the target machine.
-
-b) IL_OFFSET - 0x02
-
- The target is an integer of appropriate size to hold an address on
- the target machine (the assembler ensures that the object has the
- correct size) and contains an IL offset from the beginning of the
- current method which needs to be replaced with the corresponding
- machine address.
-
- This entry has a 4-byte unsigned integer argument containing the
- metadata token of the current method and a 4-byte unsigned integer
- argument containing the IL offset.
-
-c) METHOD_START_ADDRESS - 0x03
-d) METHOD_END_ADDRESS - 0x04
-
- The target is an integer of appropriate size to hold an address on
- the target machine (the assembler ensures that the object has the
- correct size).
-
- This entry has a 4-byte unsigned integer argument containing the
- metadata token of the current method.
-
-To use the generated object file, the JIT must:
-
-* Check whether the file contains a ".mono_reloc_table" section.
- If not, the file cannot be used (you need to change the address size
- field in each compilation unit header).
-
-* Check whether the flag field of the relocation table (the 3rd byte
- of the relocation table) is zero. If it is 1, the file has already
- been relocated. In this case, it's best to reject the file.
-
-* Set the flag field to 1.
-
-* Process all relocation entries.
-
-* Write the modified file back to disk.
-
-To do the relocation, the JIT can assume that:
-
-1.) All the relevant ELF sections are physically contiguous
- (a requirement from the DWARF 2 specification).
-
-2.) All relocation targets holding addresses are suitable of holding
- an address on the target machine.
-
- This means that you can do something like
-
- * (void **) ptr = map_to_machine (* (void **) ptr)
-
-3.) There are no other changes needed in the object file - so you can
- just write it back to disk once you're done with the relocation.
-
-
-Last changed March 19th, 2002
-Martin Baulig <martin@gnome.org>
diff --git a/mcs/class/Mono.CSharp.Debugger/csharp-lang.c b/mcs/class/Mono.CSharp.Debugger/csharp-lang.c
deleted file mode 100644
index 16468ce1d20..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/csharp-lang.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- mode: C; c-basic-offset: 2 -*-
-
- C# language support for Mono.
- Copyright 2002 Ximian, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "gdbtypes.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdb_string.h"
-#include "value.h"
-#include "csharp-lang.h"
-#include "c-lang.h"
-#include "gdbcore.h"
-#include <ctype.h>
-
-/* Print the character C on STREAM as part of the contents of a literal
- string whose delimiter is QUOTER. Note that that format for printing
- characters and strings is language specific. */
-
-void
-csharp_emit_char (int c, struct ui_file *stream, int quoter)
-{
- switch (c)
- {
- case '\\':
- case '\'':
- fprintf_filtered (stream, "\\%c", c);
- break;
- case '\b':
- fputs_filtered ("\\b", stream);
- break;
- case '\t':
- fputs_filtered ("\\t", stream);
- break;
- case '\n':
- fputs_filtered ("\\n", stream);
- break;
- case '\f':
- fputs_filtered ("\\f", stream);
- break;
- case '\r':
- fputs_filtered ("\\r", stream);
- break;
- default:
- if (isprint (c))
- fputc_filtered (c, stream);
- else
- fprintf_filtered (stream, "\\u%.4x", (unsigned int) c);
- break;
- }
-}
-
-int
-csharp_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
-{
- struct type *type;
- CORE_ADDR address;
- int i;
- char *name;
-
- type = VALUE_TYPE (val);
- address = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
-
- /* If it's type String, print it */
-
- if (TYPE_CODE (type) == TYPE_CODE_PTR
- && TYPE_TARGET_TYPE (type)
- && TYPE_TAG_NAME (TYPE_TARGET_TYPE (type))
- && strcmp (TYPE_TAG_NAME (TYPE_TARGET_TYPE (type)), "MonoString") == 0
- && (format == 0 || format == 's')
- && address != 0
- && value_as_address (val) != 0)
- {
- struct value *data_val;
- CORE_ADDR data;
- struct value *count_val;
- unsigned long count;
- struct value *mark;
-
- mark = value_mark (); /* Remember start of new values */
-
- data_val = value_struct_elt (&val, NULL, "Chars", NULL, NULL);
- data = VALUE_ADDRESS (data_val) + VALUE_OFFSET (data_val);
-
- count_val = value_struct_elt (&val, NULL, "Length", NULL, NULL);
- count = value_as_address (count_val);
-
- value_free_to_mark (mark); /* Release unnecessary values */
-
- val_print_string (data, count, 2, stream);
-
- return 0;
- }
-
- return (val_print (type, VALUE_CONTENTS (val), 0, address,
- stream, format, 1, 0, pretty));
-}
-
-
-/* Print data of type TYPE located at VALADDR (within GDB), which came from
- the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter or 0 for natural format). The data at VALADDR is in
- target byte order.
-
- If the data are a string pointer, returns the number of string characters
- printed.
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
-
-int
-csharp_val_print (struct type *type, char *valaddr, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
-{
- register unsigned int i = 0; /* Number of characters printed */
- struct type *target_type;
- LONGEST length;
- CORE_ADDR addr;
-
- CHECK_TYPEDEF (type);
- switch (TYPE_CODE (type))
- {
-#if 0
- case TYPE_CODE_CSHARP_STRING:
- addr = address + TYPE_CSHARP_STRING_LENGTH_OFFSET (type);
- length = read_memory_integer (addr, TYPE_CSHARP_STRING_LENGTH_BYTESIZE (type));
-
- addr = address + TYPE_CSHARP_STRING_DATA_OFFSET (type);
-
- return val_print_string (addr, length, 2, stream);
-
- case TYPE_CODE_PTR:
- addr = unpack_pointer (type, valaddr);
- target_type = check_typedef (TYPE_TARGET_TYPE (type));
-
- if (deref_ref && addr != 0)
- {
- if (TYPE_CODE (target_type) == TYPE_CODE_CSHARP_STRING)
- return csharp_val_print (target_type, NULL, 0, addr, stream,
- format, deref_ref, recurse, pretty);
- else
- return 0;
- }
-
- return c_val_print (type, valaddr, embedded_offset, address, stream,
- format, deref_ref, recurse, pretty);
-#endif
-
- default:
- return c_val_print (type, valaddr, embedded_offset, address, stream,
- format, deref_ref, recurse, pretty);
- }
-
- return 0;
-}
-
-/* Table mapping opcodes into strings for printing operators
- and precedences of the operators. */
-
-const struct op_print csharp_op_print_tab[] =
-{
- {NULL, 0, 0, 0}
-};
diff --git a/mcs/class/Mono.CSharp.Debugger/csharp-lang.h b/mcs/class/Mono.CSharp.Debugger/csharp-lang.h
deleted file mode 100644
index d5ef7f1f795..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/csharp-lang.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- mode: C; c-basic-offset: 2 -*-
-
- C# language support for Mono.
- Copyright 2002 Ximian, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef CSHARP_LANG_H
-#define CSHARP_LANG_H
-
-extern const struct op_print csharp_op_print_tab[];
-
-extern void csharp_emit_char (int c, struct ui_file *stream, int quoter);
-
-extern int csharp_val_print (struct type *type, char *valaddr, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty);
-
-extern int csharp_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty);
-
-#endif
diff --git a/mcs/class/Mono.CSharp.Debugger/csharp-mono-lang.c b/mcs/class/Mono.CSharp.Debugger/csharp-mono-lang.c
deleted file mode 100644
index 5512ca8dc09..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/csharp-mono-lang.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- mode: C; c-basic-offset: 2 -*-
-
- C# language support for Mono.
- Copyright 2002 Ximian, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "symtab.h"
-#include "gdbtypes.h"
-#include "expression.h"
-#include "parser-defs.h"
-#include "language.h"
-#include "gdbtypes.h"
-#include "symtab.h"
-#include "symfile.h"
-#include "objfiles.h"
-#include "gdb_string.h"
-#include "value.h"
-#include "csharp-lang.h"
-#include "c-lang.h"
-#include "gdbcore.h"
-#include <ctype.h>
-
-/* Local functions */
-
-extern void _initialize_csharp_mono_language (void);
-
-const struct language_defn csharp_mono_language_defn =
-{
- "csharp-mono", /* Language name */
- language_csharp_mono,
- c_builtin_types,
- range_check_off,
- type_check_off,
- case_sensitive_on,
- c_parse,
- c_error,
- evaluate_subexp_standard,
- c_printchar, /* Print a character constant */
- c_printstr, /* Function to print string constant */
- csharp_emit_char, /* Function to print a single character */
- c_create_fundamental_type, /* Create fundamental type in this language */
- c_print_type, /* Print a type using appropriate syntax */
- csharp_val_print, /* Print a value using appropriate syntax */
- csharp_value_print, /* Print a top-level value */
- {"", "", "", ""}, /* Binary format info */
- {"0%lo", "0", "o", ""}, /* Octal format info */
- {"%ld", "", "d", ""}, /* Decimal format info */
- {"0x%lx", "0x", "x", ""}, /* Hex format info */
- csharp_op_print_tab, /* expression operators for printing */
- 0, /* not c-style arrays */
- 0, /* String lower bound */
- &builtin_type_char, /* Type of string elements */
- LANG_MAGIC
-};
-
-void
-_initialize_csharp_mono_language (void)
-{
- add_language (&csharp_mono_language_defn);
-}
-
diff --git a/mcs/class/Mono.CSharp.Debugger/gdb-csharp-support.patch b/mcs/class/Mono.CSharp.Debugger/gdb-csharp-support.patch
deleted file mode 100644
index c4634bf8d64..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/gdb-csharp-support.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-diff -ru gdb-5.2.orig/gdb/Makefile.in gdb-5.2/gdb/Makefile.in
---- gdb-5.2.orig/gdb/Makefile.in Mon Feb 25 19:15:52 2002
-+++ gdb-5.2/gdb/Makefile.in Thu May 30 22:33:31 2002
-@@ -548,7 +548,8 @@
- tui/tui-file.h tui/tui-file.c tui/tui-out.c tui/tui-hooks.c \
- ui-file.h ui-file.c \
- frame.c doublest.c \
-- gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c
-+ gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c \
-+ csharp-lang.c csharp-mono-lang.c
-
- LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
-
-@@ -670,7 +671,8 @@
- vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \
- vx-share/vxWorks.h vx-share/wait.h vx-share/xdr_ld.h \
- vx-share/xdr_ptrace.h vx-share/xdr_rdb.h gdbthread.h \
-- dcache.h remote-utils.h top.h somsolib.h
-+ dcache.h remote-utils.h top.h somsolib.h \
-+ csharp-lang.h
-
- # Header files that already have srcdir in them, or which are in objdir.
-
-@@ -722,7 +724,8 @@
- nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o \
- ui-file.o \
- frame.o doublest.o \
-- gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o
-+ gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o \
-+ csharp-lang.o csharp-mono-lang.o
-
- OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
-
-diff -ru gdb-5.2.orig/gdb/defs.h gdb-5.2/gdb/defs.h
---- gdb-5.2.orig/gdb/defs.h Mon Mar 25 17:50:20 2002
-+++ gdb-5.2/gdb/defs.h Thu May 30 22:32:57 2002
-@@ -209,7 +209,8 @@
- language_m2, /* Modula-2 */
- language_asm, /* Assembly language */
- language_scm, /* Scheme / Guile */
-- language_pascal /* Pascal */
-+ language_pascal, /* Pascal */
-+ language_csharp_mono /* C# using Mono */
- };
-
- enum precision_type
-diff -ru gdb-5.2.orig/gdb/dwarf2read.c gdb-5.2/gdb/dwarf2read.c
---- gdb-5.2.orig/gdb/dwarf2read.c Thu Feb 28 12:21:16 2002
-+++ gdb-5.2/gdb/dwarf2read.c Thu May 30 22:32:57 2002
-@@ -3822,6 +3822,9 @@
- case DW_LANG_Java:
- cu_language = language_java;
- break;
-+ case DW_LANG_CSharp_Mono:
-+ cu_language = language_csharp_mono;
-+ break;
- case DW_LANG_Ada83:
- case DW_LANG_Cobol74:
- case DW_LANG_Cobol85:
-diff -ru gdb-5.2.orig/gdb/language.c gdb-5.2/gdb/language.c
---- gdb-5.2.orig/gdb/language.c Wed Feb 13 19:49:30 2002
-+++ gdb-5.2/gdb/language.c Thu May 30 22:32:57 2002
-@@ -865,6 +865,7 @@
- case language_chill:
- case language_m2:
- case language_pascal:
-+ case language_csharp_mono:
- return TYPE_CODE (type) != TYPE_CODE_CHAR ? 0 : 1;
-
- case language_c:
-diff -ru gdb-5.2.orig/include/elf/dwarf2.h gdb-5.2/include/elf/dwarf2.h
---- gdb-5.2.orig/include/elf/dwarf2.h Tue Jan 29 00:26:53 2002
-+++ gdb-5.2/include/elf/dwarf2.h Thu May 30 22:32:57 2002
-@@ -675,7 +675,8 @@
- DW_LANG_Ada95 = 0x000d,
- DW_LANG_Fortran95 = 0x000e,
- /* MIPS. */
-- DW_LANG_Mips_Assembler = 0x8001
-+ DW_LANG_Mips_Assembler = 0x8001,
-+ DW_LANG_CSharp_Mono = 0x9001
- };
-
-
diff --git a/mcs/class/Mono.CSharp.Debugger/gdb-variable-scopes.patch b/mcs/class/Mono.CSharp.Debugger/gdb-variable-scopes.patch
deleted file mode 100644
index fc9612b0148..00000000000
--- a/mcs/class/Mono.CSharp.Debugger/gdb-variable-scopes.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-Index: include/elf/ChangeLog
-===================================================================
-RCS file: /cvs/src/src/include/elf/ChangeLog,v
-retrieving revision 1.121
-diff -u -u -p -r1.121 ChangeLog
---- include/elf/ChangeLog 13 Feb 2002 18:14:48 -0000 1.121
-+++ include/elf/ChangeLog 12 Apr 2002 19:50:31 -0000
-@@ -1,3 +1,7 @@
-+2002-04-12 Martin Baulig <martin@gnome.org>
-+
-+ * dwarf2.h (DW_AT_end_scope): Added as GNU extension.
-+
- 2002-02-13 Matt Fredette <fredette@netbsd.org>
-
- * m68k.h (EF_M68000): Define.
-Index: include/elf/dwarf2.h
-===================================================================
-RCS file: /cvs/src/src/include/elf/dwarf2.h,v
-retrieving revision 1.8
-diff -u -u -p -r1.8 dwarf2.h
---- include/elf/dwarf2.h 28 Jan 2002 23:26:53 -0000 1.8
-+++ include/elf/dwarf2.h 12 Apr 2002 19:50:32 -0000
-@@ -328,6 +328,8 @@ enum dwarf_attribute
- DW_AT_src_coords = 0x2104,
- DW_AT_body_begin = 0x2105,
- DW_AT_body_end = 0x2106,
-+ DW_AT_end_scope = 0x2121,
-+
- /* VMS Extensions. */
- DW_AT_VMS_rtnbeg_pd_address = 0x2201
- };
-Index: gdb/ChangeLog
-===================================================================
-RCS file: /cvs/src/src/gdb/ChangeLog,v
-retrieving revision 1.2421
-diff -u -u -p -r1.2421 ChangeLog
---- gdb/ChangeLog 12 Apr 2002 07:37:17 -0000 1.2421
-+++ gdb/ChangeLog 12 Apr 2002 19:50:38 -0000
-@@ -1,3 +1,14 @@
-+2002-04-12 Martin Baulig <martin@gnome.org>
-+
-+ * dwarf2read.c (new_symbol): If DW_AT_start_scope and DW_AT_end_scope
-+ are specified, set SYMBOL_RANGES().
-+
-+ * findvar.c (read_var_value): Check whether the current PC is within
-+ the SYMBOL_RANGES(), return NULL if not.
-+
-+ * stack.c (print_block_frame_locals): Only print vars if the current PC
-+ is in their SYMBOL_RANGES().
-+
- 2002-04-12 Kevin Buettner <kevinb@redhat.com>
-
- From Jimi X <jimix@watson.ibm.com>:
-Index: gdb/dwarf2read.c
-===================================================================
-RCS file: /cvs/src/src/gdb/dwarf2read.c,v
-retrieving revision 1.52
-diff -u -u -p -r1.52 dwarf2read.c
---- gdb/dwarf2read.c 4 Apr 2002 22:26:43 -0000 1.52
-+++ gdb/dwarf2read.c 12 Apr 2002 19:50:44 -0000
-@@ -4394,6 +4394,19 @@ new_symbol (struct die_info *die, struct
- add_symbol_to_list (sym, list_in_scope);
- break;
- }
-+ attr = dwarf_attr (die, DW_AT_start_scope);
-+ attr2 = dwarf_attr (die, DW_AT_end_scope);
-+ if (attr && attr2)
-+ {
-+ struct range_list *r = (struct range_list *)
-+ obstack_alloc (&objfile->type_obstack,
-+ sizeof (struct range_list));
-+
-+ r->start = DW_ADDR (attr);
-+ r->end = DW_ADDR (attr2);
-+
-+ SYMBOL_RANGES (sym) = r;
-+ }
- attr = dwarf_attr (die, DW_AT_location);
- if (attr)
- {
-Index: gdb/findvar.c
-===================================================================
-RCS file: /cvs/src/src/gdb/findvar.c,v
-retrieving revision 1.31
-diff -u -u -p -r1.31 findvar.c
---- gdb/findvar.c 9 Apr 2002 03:06:13 -0000 1.31
-+++ gdb/findvar.c 12 Apr 2002 19:50:45 -0000
-@@ -417,9 +417,11 @@ struct value *
- read_var_value (register struct symbol *var, struct frame_info *frame)
- {
- register struct value *v;
-+ register struct range_list *r;
- struct type *type = SYMBOL_TYPE (var);
- CORE_ADDR addr;
- register int len;
-+ int range_ok = 0;
-
- v = allocate_value (type);
- VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */
-@@ -429,6 +431,23 @@ read_var_value (register struct symbol *
-
- if (frame == NULL)
- frame = selected_frame;
-+
-+ if (!SYMBOL_RANGES (var))
-+ range_ok = 1;
-+ else
-+ {
-+ for (r = SYMBOL_RANGES (var); r; r = r->next)
-+ {
-+ if (r->start <= frame->pc && r->end > frame->pc)
-+ {
-+ range_ok = 1;
-+ break;
-+ }
-+ }
-+ }
-+
-+ if (!range_ok)
-+ return NULL;
-
- switch (SYMBOL_CLASS (var))
- {
-Index: gdb/stack.c
-===================================================================
-RCS file: /cvs/src/src/gdb/stack.c,v
-retrieving revision 1.33
-diff -u -u -p -r1.33 stack.c
---- gdb/stack.c 10 Apr 2002 23:32:33 -0000 1.33
-+++ gdb/stack.c 12 Apr 2002 19:50:47 -0000
-@@ -1173,14 +1173,36 @@ print_block_frame_locals (struct block *
- case LOC_REGISTER:
- case LOC_STATIC:
- case LOC_BASEREG:
-- values_printed = 1;
-- for (j = 0; j < num_tabs; j++)
-- fputs_filtered ("\t", stream);
-- fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
-- fputs_filtered (" = ", stream);
-- print_variable_value (sym, fi, stream);
-- fprintf_filtered (stream, "\n");
-- break;
-+ {
-+ struct range_list *r;
-+ int range_ok = 0;
-+
-+ if (!SYMBOL_RANGES (sym))
-+ range_ok = 1;
-+ else
-+ {
-+ for (r = SYMBOL_RANGES (sym); r; r = r->next)
-+ {
-+ if (r->start <= fi->pc && r->end > fi->pc)
-+ {
-+ range_ok = 1;
-+ break;
-+ }
-+ }
-+ }
-+
-+ if (range_ok)
-+ {
-+ values_printed = 1;
-+ for (j = 0; j < num_tabs; j++)
-+ fputs_filtered ("\t", stream);
-+ fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
-+ fputs_filtered (" = ", stream);
-+ print_variable_value (sym, fi, stream);
-+ fprintf_filtered (stream, "\n");
-+ }
-+ break;
-+ }
-
- default:
- /* Ignore symbols which are not locals. */
diff --git a/mcs/class/Mono.Data.MySql/ChangeLog b/mcs/class/Mono.Data.MySql/ChangeLog
deleted file mode 100644
index 6331e362295..00000000000
--- a/mcs/class/Mono.Data.MySql/ChangeLog
+++ /dev/null
@@ -1,66 +0,0 @@
-2002-05-30 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql.build: modified
- need to copy Mono.Data.MySql.dll to mcs/class/System.Data/Test
- so the SqlSharpCli test program can use MySql too
-
-2002-05-30 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/TestMySqlInsert.cs: added test
- to do an SQL INSERT to insert a row into table.
- Works on cygwin compiled using mcs and mono and
- runs on mint, but it fails running on mono.
-
- * Mono.Data.MySql/MySqlCommand.cs
- * Mono.Data.MySql/TODOAttribute.cs
- * Mono.Data.MySql/MySqlConnection.cs: added
-
- * list: added
- so can build with mcs/mono on linux
- I only tested it on Cygwin though.
- To work on linux, the library name in the pinvokes
- in MySql.cs will need to be changed.
-
- * Mono.Data.MySql.build: modified
- exclude files from build. also copy Mono.Data.MySql.dll
- to Mono.Data.MySql so you can build and run Test.cs
-
- * Mono.Data.MySql/MySql.cs: modified
- tweaks to compile under mcs/mono and run under mint or mono.
- Runs under mint, but not mono. Had to comment out
- mysql_thread_begin/mysql_thread_end functions because they refused
- to load in mono. Until this is fixed, a memory leak will occur.
- Can not retrieve field data from MySQL because the PtrToStructure()
- needs to be implemented in System.Runtime.InteropServices.Marshal class.
- However, this will be very complicated to do. So, we connect to
- MySQL and execute SQL Commands, but we can not do Queries yet.
-
- * Mono.Data.MySql/Test.cs: modified
- tweaks to test C# bindings with compiling mcs/mono and
- running on mint and mono. Runs on mint, but not mono.
-
-2002-05-28 Daniel Morgan <danmorg@sc.rr.com>
-
- * Mono.Data.MySql
- * Mono.Data.MySql/Mono.Data.MySql: add directories
- for the Mono.Data.MySql assembly and namespace. This
- will contain the MySql .NET Data Provider which will use
- C# bindings to libMySQL
-
- * Mono.Data.MySql/Test.cs: added file to
- test the C# bindings to MySQL
-
- * Mono.Data.MySql/MySql.cs
- * Mono.Data.MySql/Field.cs: added files
- for the beginnings of C# bindings to MySQL
-
- * Mono.Data.MySql/makefile: added file
- to build the MySQL C# bindings on csc/Microsoft.NET
-
- These C# bindings to the MySQL libMySQL.dll were created by
- Brad Merrill <zbrad@cybercom.net>
- and can be downloaded from
- http://www.cybercom.net/~zbrad/DotNet/MySql/
- and put into the Mono Class Library under the X11/MIT License
- with Brad Merril's permission.
-
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql.build b/mcs/class/Mono.Data.MySql/Mono.Data.MySql.build
deleted file mode 100644
index 1ffa819f7d0..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql.build
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for Mono.Data.MySql.dll -->
-
-<project name="Mono.Data.MySql" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <csc target="library" output="../lib/Mono.Data.MySql.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0067"/>
- <arg value="/nowarn:0109"/>
- <arg value="/nowarn:0169"/>
- <arg value="/nowarn:0649"/>
- <arg value="/unsafe"/>
- <arg value="/noconfig"/>
- <arg value="/r:System.dll"/>
- <arg value="/r:System.Xml.dll"/>
- <arg value="/r:System.Data.dll"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <excludes name="Mono.Data.MySql/Test.cs"/>
- <excludes name="Mono.Data.MySql/MySqlClientPermission.cs"/>
- <excludes name="Mono.Data.MySql/MySqlClientPermissionAttribute.cs"/>
- <excludes name="Mono.Data.MySql/MySqlCommandBuilder.cs"/>
- <excludes name="Mono.Data.MySql/MySqlDataAdapter.cs"/>
- <excludes name="Mono.Data.MySql/MySqlDataReader.cs"/>
- <excludes name="Mono.Data.MySql/MySqlError.cs"/>
- <excludes name="Mono.Data.MySql/MySqlErrorCollection.cs"/>
- <excludes name="Mono.Data.MySql/MySqlException.cs"/>
- <excludes name="Mono.Data.MySql/MySqlInfoMessageEventArgs.cs"/>
- <excludes name="Mono.Data.MySql/MySqlInfoMessageEventHandler.cs"/>
- <excludes name="Mono.Data.MySql/MySqlParameter.cs"/>
- <excludes name="Mono.Data.MySql/MySqlParameterCollection.cs"/>
- <excludes name="Mono.Data.MySql/MySqlRowUpdatedEventArgs.cs"/>
- <excludes name="Mono.Data.MySql/MySqlRowUpdatedEventHandler.cs"/>
- <excludes name="Mono.Data.MySql/MySqlRowUpdatingEventArgs.cs"/>
- <excludes name="Mono.Data.MySql/MySqlRowUpdatingEventHandler.cs"/>
- <excludes name="Mono.Data.MySql/MySqlTransaction.cs"/>
-
- </sources>
- <references>
- <includes name="../lib/corlib.dll"/>
- <includes name="../lib/System.dll"/>
- <includes name="../lib/System.Xml.dll"/>
- <includes name="../lib/System.Data.dll"/>
- </references>
- </csc>
- <copy file="../lib/System.Data.dll" tofile="Test/System.Data.dll"/>
- <copy file="../lib/Mono.Data.MySql.dll" tofile="Test/Mono.Data.MySql.dll"/>
- <copy file="../lib/Mono.Data.MySql.dll" tofile="Mono.Data.MySql/Mono.Data.MySql.dll"/>
- <copy file="../lib/Mono.Data.MySql.dll" tofile="../System.Data/Test/Mono.Data.MySql.dll"/>
- </target>
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
- <target name="clean">
- <delete file="../lib/System.Data.dll" failonerror="false"/>
- <delete file="Test/System.Data.dll" failonerror="false"/>
- <delete file="../lib/Mono.Data.MySql.dll" failonerror="false"/>
- <delete file="Test/Mono.Data.MySql.dll" failonerror="false"/>
-
- </target>
-</project>
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/Field.cs b/mcs/class/Mono.Data.MySql/Mono.Data.MySql/Field.cs
deleted file mode 100644
index 518dbfa292d..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/Field.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Field.cs
-//
-// Provide definition for the Field class
-// Part of the C# bindings to MySQL library libMySQL.dll
-//
-// Author:
-// Brad Merrill <zbrad@cybercom.net>
-//
-// (C)Copyright 2002 Brad Merril
-//
-// http://www.cybercom.net/~zbrad/DotNet/MySql/
-//
-// Mono has gotten permission from Brad Merrill to include in
-// the Mono Class Library
-// his C# bindings to MySQL under the X11 License
-//
-// Mono can be found at http://www.go-mono.com/
-// The X11/MIT License can be found
-// at http://www.opensource.org/licenses/mit-license.html
-//
-
-
-namespace Mono.Data.MySql {
- using System.Runtime.InteropServices;
-
- ///<remarks>
- ///<para>
- /// MySql P/Invoke implementation test program
- /// Brad Merrill
- /// 3-Mar-2002
- ///</para>
- ///<para>
- /// This structure contains information about a field, such as the
- /// field's name, type, and size. Its members are described in more
- /// detail below. You may obtain the <see cref="Field"/> structures for
- /// each field by calling
- /// <see cref="MySql.FetchField"/>
- /// repeatedly.
- /// Field values are not part of this structure;
- /// they are contained in a Row structure.
- ///</para>
- ///</remarks>
- [StructLayout(LayoutKind.Sequential)]
- public class Field {
- ///<value>name of column</value>
- [MarshalAs(UnmanagedType.LPStr)]
- public string Name;
- ///<value>table of column</value>
- [MarshalAs(UnmanagedType.LPStr)]
- public string Table;
- ///<value>default value</value>
- [MarshalAs(UnmanagedType.LPStr)]
- public string Def;
- ///<value>type of field</value>
- public int FieldTypes;
- ///<value>width of column</value>
- public uint Length;
- ///<value>max width of selected set</value>
- public uint MaxLength;
- ///<value>div flags</value>
- public uint Flags;
- ///<value>number of decimals in field</value>
- public uint Decimals;
- }
-}
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySql.cs b/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySql.cs
deleted file mode 100644
index 70392b464cd..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySql.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// MySql.cs
-//
-// Provides the core of C# bindings
-// to the MySQL library libMySQL.dll
-//
-// Author:
-// Brad Merrill <zbrad@cybercom.net>
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C)Copyright 2002 Brad Merril
-// (C)Copyright 2002 Daniel Morgan
-//
-// http://www.cybercom.net/~zbrad/DotNet/MySql/
-//
-// Mono has gotten permission from Brad Merrill to include in
-// the Mono Class Library
-// his C# bindings to MySQL under the X11 License
-//
-// Mono can be found at http://www.go-mono.com/
-// The X11/MIT License can be found
-// at http://www.opensource.org/licenses/mit-license.html
-//
-
-// Things to do:
-// =============
-// FIXME: mysql_thread_init() and mysql_thread_end()
-// for some reason can not be loaded from the libMySQL.dll
-// using Mono. Until this is fixed, there will be a
-// resource leak.
-//
-// TODO: method IntPtr PtrToStructure(IntPtr, Type) needs to
-// be implemented in assembly corlib.dll
-// in class System.Runtime.InteropServices.Marshal
-// which requires also an internal call in the runtime
-// for it too.
-// This is so we can retrieve Field data from MySQL.
-//
-// TODO: more functions in the MySQL C Client API
-// (libmysqlclient.so on linux and libmySQL.dll on cygwin)
-// need to be added here as C# pinvoke methods.
-// Other data structures may need to be added as well.
-//
-// TODO: handle the name of the MySQL client library for
-// different platforms because it is named differently
-// on each platform.
-// We maybe using a config file for this.
-//
-
-namespace Mono.Data.MySql {
- using System;
- using System.Security;
- using System.Runtime.InteropServices;
-
- ///<remarks>
- ///<para>
- /// MySql P/Invoke implementation
- /// Brad Merrill
- /// 3-Mar-2002
- ///</para>
- ///<para>
- /// This is an incomplete implementation of the mysql C api,
- /// but sufficient to run the Test sample application.
- ///</para>
- ///</remarks>
- internal sealed class MySql {
- ///<value>protocol version</value>
- public static readonly uint ProtocolVersion = 10;
- ///<value>server version</value>
- public static readonly string ServerVersion = "3.23.49";
- ///<value>server suffix</value>
- public static readonly string ServerSuffix = "";
- ///<value>server version as int</value>
- public static readonly uint VersionId = 32349;
- ///<value>server port number</value>
- public static readonly uint Port = 3306;
- ///<value>unix named socket</value>
- public static readonly string UnixAddr = "/tmp/mysql.sock";
- ///<value>character set</value>
- public static readonly string CharSet = "latin1";
-
- ///<summary>Gets or initializes a `MySql' structure</summary>
- ///<returns>An initialized `MYSQL*' handle. IntPtr.Zero if there was insufficient memory to allocate a new object.</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL", EntryPoint="mysql_init", ExactSpelling=true)]
- public static extern IntPtr Init(IntPtr db);
-
- ///<summary>Connects to a MySql server</summary>
- ///<returns><paramref name="db"/> value on success, else returns IntPtr.Zero</returns>
- [SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_connect", ExactSpelling=true)]
- public static extern IntPtr Connect(IntPtr db,
- [In] string host, [In] string user, [In] string passwd,
- [In] string dbname,
- uint port, [In] string socketName, uint flags
- );
-
- ///<summary>Selects a database</summary>
- ///<returns>Zero for success. Non-zero if an error occurred.</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_select_db", ExactSpelling=true)]
- public static extern int SelectDb(IntPtr conn, [In] string db);
-
- ///<summary>Closes a server connection</summary>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL", EntryPoint="mysql_close", ExactSpelling=true)]
- public static extern void Close(IntPtr db);
-
- ///<summary>Executes a SQL query specified as a string</summary>
- ///<returns>number of rows changed, -1 if zero</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_query", ExactSpelling=true)]
- public static extern int Query(IntPtr conn, [In] string query);
-
- ///<summary>Retrieves a complete result set to the client</summary>
- ///<returns>An IntPtr result structure with the results. IntPtr.Zero if an error occurred.</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_store_result", ExactSpelling=true)]
- public static extern IntPtr StoreResult(IntPtr conn);
-
- ///<returns>Returns the number of rows in a result set</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_num_rows", ExactSpelling=true)]
- public static extern int NumRows(IntPtr r);
-
- ///<returns>Returns the number of columns in a result set</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_num_fields", ExactSpelling=true)]
- public static extern int NumFields(IntPtr r);
-
- ///<returns>Returns an IntPtr to all field structures</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_fetch_field", ExactSpelling=true)]
- public static extern IntPtr FetchField(IntPtr r);
-
- ///<summary>Retrieves the next row of a result set</summary>
- ///<returns>An IntPtr structure for the next row. IntPtr.Zero if there are no more rows to retrieve or if an error occurred.</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_fetch_row", ExactSpelling=true)]
- public static extern IntPtr FetchRow(IntPtr r);
-
- ///<summary>Frees the memory allocated for a result set by <see cref="StoreResult"/></summary>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_free_result", ExactSpelling=true)]
- public static extern void FreeResult(IntPtr r);
-
- ///<returns>Returns a string that represents the client library version</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_get_client_info", ExactSpelling=true)]
- public static extern string GetClientInfo();
-
- ///<returns></returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_get_host_info", ExactSpelling=true)]
- public static extern string GetHostInfo(IntPtr db);
-
- ///<returns>A string describing the type of connection in use, including the server host name.</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_get_server_info", ExactSpelling=true)]
- public static extern string GetServerInfo(IntPtr db);
-
- ///<returns>A string describing the server status. null if an error occurred.</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_stat", ExactSpelling=true)]
- public static extern string Stat(IntPtr db);
-
- ///<summary>
- /// Returns a result set describing the current server
- /// threads. This is the same kind of information as that
- /// reported by `mysqladmin processlist' or a `SHOW PROCESSLIST'
- /// query. You must free the result set with
- /// <see cref="FreeResult"/>.
- ///</summary>
- ///<returns>
- /// A IntPtr result set for success. IntPtr.Zero if an error
- /// occurred.
- ///</returns>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_list_processes", ExactSpelling=true)]
- public static extern IntPtr ListProcesses(IntPtr db);
-
- ///<summary>
- ///<para>
- /// Returns a result set consisting of table names in
- /// the current database that match the simple regular expression
- /// specified by the <paramref name="wild"/> parameter.
- /// <paramref name="wild"/>may contain the wild-card characters
- /// "%" or "_", or may be a null pointer to match all tables.
- ///</para>
- ///<para>
- /// Calling <see cref="ListTables"/> is similar to executing
- /// the query "SHOW tables [LIKE wild]".
- ///</para>
- ///<para>
- /// You must free the result set with <see cref="FreeResult"/>.
- ///</para>
- ///</summary>
- //[SuppressUnmanagedCodeSecurity]
- [DllImport("libmySQL",
- EntryPoint="mysql_list_tables", ExactSpelling=true)]
- public static extern IntPtr ListTables(IntPtr db, [In] string wild);
-
- ///<summary>
- /// For the connection specified by <paramref name="db"/>,
- /// <see cref="Error"/> returns the
- /// error message for the most recently invoked API function
- /// that can succeed or fail. An empty string ("") is
- /// returned if no error occurred.
- ///</summary>
- ///<returns>
- /// A string that describes the error. An empty string if no error occurred.
- ///</returns>
- [DllImport("libmySQL",
- CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- EntryPoint="mysql_error", ExactSpelling=true)]
- public static extern string Error(IntPtr db);
-
- ///<summary>
- ///<para>
- /// This function needs to be called before exiting
- /// to free memory allocated explicitly by
- /// <see cref="ThreadInit"/> or implicitly by
- /// <see cref="Init"/>.
- ///</para>
- ///<para>
- /// Note that this function is NOT invoked automatically by the client
- /// library!
- ///</para>
- ///</summary>
- //[DllImport("libmySQL",
- // CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- // EntryPoint="mysql_thread_end", ExactSpelling=true)]
- //public static extern void ThreadEnd();
-
- ///<summary>
- ///<para>
- /// This function needs to be called for each created thread
- /// to initialize thread specific variables.
- ///</para>
- ///<para>
- /// This is automatically called by <see cref="Init"/>.
- ///</para>
- ///</summary>
- //[DllImport("libmySQL",
- // CharSet=System.Runtime.InteropServices.CharSet.Ansi,
- // EntryPoint="mysql_thread_init", ExactSpelling=true)]
- //public static extern void ThreadInit();
- }
-}
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlCommand.cs b/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlCommand.cs
deleted file mode 100644
index 40e7096e94b..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlCommand.cs
+++ /dev/null
@@ -1,328 +0,0 @@
-//
-// Mono.Data.MySql.MySqlCommand.cs
-//
-// Author:
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Daniel Morgan, 2002
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Data.MySql {
- // public sealed class MySqlCommand : Component, IDbCommand, ICloneable
- public sealed class MySqlCommand : IDbCommand {
-
- #region Fields
-
- private string sql = "";
- private int timeout = 30;
- // default is 30 seconds
- // for command execution
-
- private MySqlConnection conn = null;
- //private MySqlTransaction trans = null;
- private CommandType cmdType = CommandType.Text;
- private bool designTime = false;
- //private MySqlParameterCollection parmCollection = new
- // MySqlParameterCollection();
-
- // MySqlDataReader state data for ExecuteReader()
- //private MySqlDataReader dataReader = null;
- private string[] queries = null;
- private int currentQuery = -1;
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- //private ParmUtil parmUtil = null;
-
- #endregion // Fields
-
- #region Constructors
-
- public MySqlCommand() {
- sql = "";
- }
-
- public MySqlCommand (string cmdText) {
- sql = cmdText;
- }
-
- public MySqlCommand (string cmdText, MySqlConnection connection) {
- sql = cmdText;
- conn = connection;
- }
-
- /*
- public MySqlCommand (string cmdText, MySqlConnection connection,
- MySqlTransaction transaction) {
- sql = cmdText;
- conn = connection;
- trans = transaction;
- }
- */
-
- #endregion // Constructors
-
- #region Methods
-
- [MonoTODO]
- public void Cancel () {
- // FIXME: use non-blocking Exec for this
- throw new NotImplementedException ();
- }
-
- // FIXME: is this the correct way to return a stronger type?
- [MonoTODO]
- IDbDataParameter IDbCommand.CreateParameter () {
- //return CreateParameter ();
- return null;
- }
-
- /*
- [MonoTODO]
- public SqlParameter CreateParameter () {
- return new SqlParameter ();
- }
- */
-
- [MonoTODO]
- public int ExecuteNonQuery () {
- int rowsRetrieved = -1;
- //TODO: need to do this correctly
- // this is just something quick
- // thrown together to see if we can
- // execute a SQL Command
- Console.WriteLine("Insert SQL: " + sql);
- Console.Out.Flush();
- int rcq = MySql.Query(conn.NativeMySqlInitStruct, sql);
- if (rcq != 0) {
- // TODO: throw an exception here?
- Console.WriteLine("Error: Couldn't execute ["+sql+"] on server.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(conn.NativeMySqlInitStruct));
- Console.Out.Flush();
- return 0;
- }
- return rowsRetrieved;
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader () {
- //return ExecuteReader ();
- return null;
- }
-
- /*
- [MonoTODO]
- public MySqlDataReader ExecuteReader () {
- return ExecuteReader(CommandBehavior.Default);
- }
- */
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader (
- CommandBehavior behavior) {
- //return ExecuteReader (behavior);
- return null;
- }
-
- /*
- [MonoTODO]
- public MySqlDataReader ExecuteReader (CommandBehavior behavior) {
-
- }
- */
-
- [MonoTODO]
- public object ExecuteScalar () {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public XmlReader ExecuteXmlReader () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Prepare () {
- // FIXME: parameters have to be implemented for this
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public MySqlCommand Clone () {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
-
- #region Properties
-
- public string CommandText {
- get {
- return sql;
- }
-
- set {
- sql = value;
- }
- }
-
- public int CommandTimeout {
- get {
- return timeout;
- }
-
- set {
- // FIXME: if value < 0, throw
- // ArgumentException
- // if (value < 0)
- // throw ArgumentException;
- timeout = value;
- }
- }
-
- public CommandType CommandType {
- get {
- return cmdType;
- }
-
- set {
- cmdType = value;
- }
- }
-
- // FIXME: for property Connection, is this the correct
- // way to handle a return of a stronger type?
- IDbConnection IDbCommand.Connection {
- get {
- return Connection;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during a
- // transaction in progress
-
- // csc
- Connection = (MySqlConnection) value;
- // mcs
- // Connection = value;
-
- // FIXME: set Transaction property to null
- }
- }
-
- public MySqlConnection Connection {
- get {
- // conn defaults to null
- return conn;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during
- // a transaction in progress
- conn = value;
- // FIXME: set Transaction property to null
- }
- }
-
- public bool DesignTimeVisible {
- get {
- return designTime;
- }
-
- set{
- designTime = value;
- }
- }
-
- // FIXME; for property Parameters, is this the correct
- // way to handle a stronger return type?
- IDataParameterCollection IDbCommand.Parameters {
- get {
- //return Parameters;
- return null;
- }
- }
-
- //public SqlParameterCollection Parameters {
- // get {
- // return parmCollection;
- // }
- //}
-
- // FIXME: for property Transaction, is this the correct
- // way to handle a return of a stronger type?
- IDbTransaction IDbCommand.Transaction {
- get {
- //return Transaction;
- return null;
- }
-
- set {
- // FIXME: error handling - do not allow
- // setting of transaction if transaction
- // has already begun
-
- //Transaction = (MySqlTransaction) value;
- throw new NotImplementedException();
- }
- }
-
- /*
- public MySqlTransaction Transaction {
- get {
- return trans;
- }
-
- set {
- // FIXME: error handling
- trans = value;
- }
- }
- */
-
- [MonoTODO]
- public UpdateRowSource UpdatedRowSource {
- // FIXME: do this once DbDataAdaptor
- // and DataRow are done
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Inner Classes
-
- #endregion // Inner Classes
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose() {
- // FIXME: need proper way to release resources
- // Dispose(true);
- }
-
- [MonoTODO]
- ~MySqlCommand() {
- // FIXME: need proper way to release resources
- // Dispose(false);
- }
-
- #endregion //Destructors
- }
-}
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlConnection.cs b/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlConnection.cs
deleted file mode 100644
index 1d6d2276803..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/MySqlConnection.cs
+++ /dev/null
@@ -1,534 +0,0 @@
-//
-// Mono.Data.MySql.MyConnection.cs
-//
-// Author:
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Daniel Morgan 2002
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace Mono.Data.MySql {
-
- public sealed class MySqlConnection : Component, IDbConnection,
- ICloneable {
-
- #region Fields
-
- private IntPtr mysqlInitStruct = IntPtr.Zero;
- private IntPtr mysqlConn = IntPtr.Zero;
-
- private string connectionString = "";
- private string mysqlConnectionString = "";
-
- //private MySqlTransaction trans = null;
- private int connectionTimeout = 15;
- // default for 15 seconds
-
- // MySQL connection string parameters
- string host = "";
- string user = "";
- string passwd = "";
- string dbname = "";
- uint port = MySql.Port;
- string socketName = "";
- uint flags = 0;
-
- // connection state
- private ConnectionState conState = ConnectionState.Closed;
-
- // DataReader state
- //private MySqlDataReader rdr = null;
- private bool dataReaderOpen = false;
- // FIXME: if true, throw an exception if SqlConnection
- // is used for anything other than reading
- // data using SqlDataReader
-
- private string versionString = "Unknown";
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- // A lot of the defaults were initialized in the Fields
- [MonoTODO]
- public MySqlConnection () {
-
- }
-
- [MonoTODO]
- public MySqlConnection (String connectionString) {
- SetConnectionString (connectionString);
- }
-
- #endregion // Constructors
-
- #region Destructors
-
- // aka Finalize
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- [MonoTODO]
- ~MySqlConnection() {
- // FIXME: this class need
- // a destructor to release resources
- // Also, take a look at Dispose
- Dispose (false);
- }
-
- #endregion // Destructors
-
- #region Public Methods
-
- IDbTransaction IDbConnection.BeginTransaction () {
- // return BeginTransaction ();
- return null;
- }
-
- //public MySqlTransaction BeginTransaction () {
- // return TransactionBegin (); // call private method
- //}
-
- IDbTransaction IDbConnection.BeginTransaction (IsolationLevel
- il) {
- //return BeginTransaction (il);
- return null;
- }
-
- //public MySqlTransaction BeginTransaction (IsolationLevel il) {
- // return TransactionBegin (il); // call private method
- //}
-
- //[MonoTODO]
- //public MySqlTransaction BeginTransaction(string transactionName) {
- // return TransactionBegin (); // call private method
- //}
-
- //[MonoTODO]
- //public MySqlTransaction BeginTransaction(IsolationLevel iso,
- // string transactionName) {
- // return TransactionBegin (iso); // call private method
- //}
-
- [MonoTODO]
- public void ChangeDatabase (string databaseName) {
- throw new NotImplementedException ();
- }
-
- object ICloneable.Clone() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Close () {
- if(dataReaderOpen == true) {
- // TODO: what do I do if
- // the user Closes the connection
- // without closing the Reader first?
-
- }
- CloseDataSource ();
- }
-
- IDbCommand IDbConnection.CreateCommand () {
- return CreateCommand ();
- }
-
- public MySqlCommand CreateCommand () {
- MySqlCommand sqlcmd = new MySqlCommand ("", this);
-
- return sqlcmd;
- }
-
- [MonoTODO]
- public void Open () {
- if(dbname.Equals(""))
- throw new InvalidOperationException(
- "dbname missing");
- else if(conState == ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is already Open");
-
- // FIXME: check to make sure we have
- // everything to connect,
- // otherwise, throw an exception
-
- mysqlInitStruct = MySql.Init(IntPtr.Zero);
- if (mysqlInitStruct == IntPtr.Zero) {
- // TODO: throw exception instead
- Console.WriteLine("MySQL Init failed.");
- return;
- }
-
-
- // *** this is what it should be ***
- //mysqlConn = MySql.Connect(mysqlInitStruct,
- // host.Equals("") ? null : host,
- // user.Equals("") ? null : user,
- // passwd.Equals("") ? null : passwd,
- // dbname.Equals("") ? null : dbname,
- // port,
- // socketName.Equals("") ? null : socketName,
- // flags);
- //
- mysqlConn = MySql.Connect(mysqlInitStruct,
- host,
- user,
- passwd,
- dbname,
- port,
- socketName,
- flags);
- if (mysqlConn == IntPtr.Zero) {
- // TODO: throw exception instead
- Console.WriteLine("MySQL Connect failed, "+MySql.Error(mysqlInitStruct));
- return;
- }
-
- Console.WriteLine("MySql Selecting Database: " + dbname + "...");
- Console.Out.Flush();
- int sdb = MySql.SelectDb(mysqlInitStruct, dbname);
- if (sdb != 0) {
- Console.WriteLine("Error: Can not select the "+dbname+" database.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(mysqlInitStruct));
- Console.Out.Flush();
- return;
- }
-
- // Successfully Connected
- SetupConnection();
- }
-
- #endregion // Public Methods
-
- #region Protected Methods
-
- [MonoTODO]
-
- protected override void Dispose(bool disposing) {
- if(!this.disposed)
- try {
- if(disposing) {
- // release any managed resources
- }
- // release any unmanaged resources
- // close any handles
-
- this.disposed = true;
- }
- finally {
- base.Dispose(disposing);
- }
- }
-
- #endregion
-
- #region Internal Methods
-
- // Used to prevent MySqlConnection
- // from doing anything while
- // MySqlDataReader is open.
- // Open the Reader. (called from MySqlCommand)
- /*
- internal void OpenReader(MySqlDataReader reader) {
- if(dataReaderOpen == true) {
- // TODO: throw exception here?
- // because a reader
- // is already open
- }
- else {
- rdr = reader;
- dataReaderOpen = true;
- }
- }
- */
-
- // Used to prevent MySqlConnection
- // from doing anything while
- // MySqlDataReader is open
- // Close the Reader (called from MySqlCommand)
- // if closeConnection true, Close() the connection
- // this is based on CommandBehavior.CloseConnection
- internal void CloseReader(bool closeConnection) {
- if(closeConnection == true)
- CloseDataSource();
- else
- dataReaderOpen = false;
- }
-
- #endregion // Internal Methods
-
- #region Private Methods
-
- private void SetupConnection() {
- conState = ConnectionState.Open;
-
- versionString = GetDatabaseServerVersion();
-
- // May need to set DateTime format to ISO
- // "YYYY-MM-DD hh:mi:ss.ms"
- }
-
- private string GetDatabaseServerVersion() {
- //MySqlCommand cmd = new MySqlCommand("select version()",this);
- //return (string) cmd.ExecuteScalar();
- return "";
- }
-
- private void CloseDataSource () {
- // FIXME: just a quick hack
- if(conState == ConnectionState.Open) {
- /*
- if(trans != null)
- if(trans.DoingTransaction == true) {
- trans.Rollback();
- // trans.Dispose();
- trans = null;
- }
- */
- conState = ConnectionState.Closed;
- MySql.Close(mysqlInitStruct);
- // MySql.ThreadEnd();
- mysqlConn = IntPtr.Zero;
- }
- }
-
- private void SetConnectionString (string connectionString) {
-
- this.connectionString = connectionString;
- mysqlConnectionString = ConvertStringToMySql (
- connectionString);
- }
-
- private String ConvertStringToMySql (String
- oleDbConnectionString) {
- StringBuilder mysqlConnection =
- new StringBuilder();
- string result;
- string[] connectionParameters;
-
- char[] semicolon = new Char[1];
- semicolon[0] = ';';
-
- // FIXME: what is the max number of value pairs
- // can there be for the OLE DB
- // connnection string? what about libgda max?
- // what about postgres max?
-
- // FIXME: currently assuming value pairs are like:
- // "key1=value1;key2=value2;key3=value3"
- // Need to deal with values that have
- // single or double quotes. And error
- // handling of that too.
- // "key1=value1;key2='value2';key=\"value3\""
-
- // FIXME: put the connection parameters
- // from the connection
- // string into a
- // Hashtable (System.Collections)
- // instead of using private variables
- // to store them
- connectionParameters = oleDbConnectionString.
- Split (semicolon);
- foreach (string sParameter in connectionParameters) {
- if(sParameter.Length > 0) {
- BreakConnectionParameter (sParameter);
- mysqlConnection.
- Append (sParameter +
- " ");
- }
- }
- result = mysqlConnection.ToString ();
- return result;
- }
-
- private bool BreakConnectionParameter (String sParameter) {
- bool addParm = true;
- int index;
-
- index = sParameter.IndexOf ("=");
- if (index > 0) {
- string parmKey, parmValue;
-
- // separate string "key=value" to
- // string "key" and "value"
- parmKey = sParameter.Substring (0, index);
- parmValue = sParameter.Substring (index + 1,
- sParameter.Length - index - 1);
-
- /*
- * string host
- * string user
- * string passwd
- * string dbname
- * unit port
- * string socketName
- * unit flags (can be multiple)
- */
- switch(parmKey.ToLower()) {
- case "port":
- port = UInt32.Parse(parmValue);
- break;
-
- case "host":
- // set DataSource property
- host = parmValue;
- break;
-
- case "dbname":
- // set Database property
- dbname = parmValue;
- break;
-
- case "user":
- user = parmValue;
- break;
-
- case "passwd":
- passwd = parmValue;
- break;
-
- case "socketName":
- socketName = parmValue;
- break;
-
- default:
- // throw an exception?
- break;
- }
- }
- return addParm;
- }
-
- /*
- private MySqlTransaction TransactionBegin () {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new SqlTransaction ();
- // using internal methods of SqlTransaction
- trans.SetConnection (this);
- trans.Begin();
-
- return trans;
- }
-
- private MySqlTransaction TransactionBegin (IsolationLevel il) {
- // FIXME: need to keep track of
- // transaction in-progress
- TransactionBegin();
- trans.SetIsolationLevel (il);
-
- return trans;
- }
- */
-
- #endregion
-
- #region Public Properties
-
- [MonoTODO]
- public ConnectionState State {
- get {
- return conState;
- }
- }
-
- public string ConnectionString {
- get {
- return connectionString;
- }
- set {
- SetConnectionString (value);
- }
- }
-
- public int ConnectionTimeout {
- get {
- return connectionTimeout;
- }
- }
-
- public string Database {
- get {
- return dbname;
- }
- }
-
- public string DataSource {
- get {
- return host;
- }
- }
-
- public int PacketSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string ServerVersion {
- get {
- return versionString;
- }
- }
-
- #endregion // Public Properties
-
- #region Internal Properties
-/*
- // For Mono.Data.MySql classes
- // to get the current transaction
- // in progress - if any
- internal MySqlTransaction Transaction {
- get {
- return trans;
- }
- }
-*/
- // For Mono.Data.MySql classes
- // to get the unmanaged MySql connection
- internal IntPtr NativeMySqlConnection {
- get {
- return mysqlConn;
- }
- }
-
- // For Mono.Data.MySql classes
- // to get the unmanaged MySql connection
- internal IntPtr NativeMySqlInitStruct {
- get {
- return mysqlInitStruct;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- internal bool IsReaderOpen {
- get {
- return dataReaderOpen;
- }
- }
-
- #endregion // Internal Properties
-
- #region Events
-/*
- public event
- MyInfoMessageEventHandler InfoMessage;
-
- public event
- StateChangeEventHandler StateChange;
-*/
- #endregion
-
- }
-}
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/TODOAttribute.cs b/mcs/class/Mono.Data.MySql/Mono.Data.MySql/TODOAttribute.cs
deleted file mode 100644
index 22481a86a83..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/TODOAttribute.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-using System;
-
-namespace Mono.Data.MySql {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/Test.cs b/mcs/class/Mono.Data.MySql/Mono.Data.MySql/Test.cs
deleted file mode 100644
index 74671a7b953..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/Test.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-// Test.cs
-//
-// Used to Test the C# bindings to MySQL. This test
-// is based on the test that comes with MySQL.
-// Part of the C# bindings to MySQL library libMySQL.dll
-//
-// Author:
-// Brad Merrill <zbrad@cybercom.net>
-//
-// (C)Copyright 2002 Brad Merril
-//
-// http://www.cybercom.net/~zbrad/DotNet/MySql/
-//
-// Mono has gotten permission from Brad Merrill to include in
-// the Mono Class Library
-// his C# bindings to MySQL under the X11 License
-//
-// Mono can be found at http://www.go-mono.com/
-// The X11/MIT License can be found
-// at http://www.opensource.org/licenses/mit-license.html
-//
-
-// define MYSQL_CANDO_QUERY if the runtime can do a query
-// define MYSQL_CANDO_THREADS if the runtime can use mysql_thread_* functions
-//#define MYSQL_CANDO_QUERY
-//#define MYSQL_CANDO_THREADS
-
-using System;
-using System.Runtime.InteropServices;
-using Mono.Data.MySql;
-
-///<remarks>
-///<para>
-/// MySql P/Invoke implementation test program
-/// Brad Merrill
-/// 3-Mar-2002
-///</para>
-///<para>
-/// This is based on the myTest.c program in the
-/// libmysqltest example directory of the mysql distribution.
-///</para>
-///<para>
-/// I noticed during implementation that the C api libraries are
-/// thread sensitive, in that they store information in the
-/// currently executing thread local storage. This is
-/// incompatible with the thread pool model in the CLR, in which
-/// you could be executing the same context on different
-/// threads.
-///</para>
-///<para>
-/// A better implementation would be to rewrite the libmysql
-/// layer in managed code, and do all the socket APIs, and mysql
-/// protocol using the .NET Framework APIs. However, that's a
-/// bit more than a weekend of work.
-///</para>
-///</remarks>
-public class Test {
- [STAThread]
- public static int Main() {
- Console.WriteLine("Test for MySQL C# Bindings started...");
- Console.Out.Flush();
-
- string myDb = "test";
- string myStmt = "SELECT * FROM db";
- string insertStmt = "INSERT INTO SOMETABLE (TID,TDESC,AINT) VALUES ('MySQL','Mono.Data',12)";
-
- Console.WriteLine("MySql Init...");
- Console.Out.Flush();
- IntPtr db = MySql.Init(IntPtr.Zero);
- if (db == IntPtr.Zero) {
- Console.WriteLine("Error: Init failed.");
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("MySql Connection...");
- Console.Out.Flush();
- IntPtr conn = MySql.Connect(db, "", "", "", "", MySql.Port,
- "", (uint)0);
- //IntPtr conn = MySql.mysql_connect(db, null, null, null, null, MySql.Port,
- // null, (uint)0);
- if (conn == IntPtr.Zero) {
- Console.WriteLine("Error: Connect failed.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("MySql Selecting Database: " + myDb + "...");
- Console.Out.Flush();
- int sdb = MySql.SelectDb(db, myDb);
- if (sdb != 0) {
- Console.WriteLine("Error: Can not select the "+myDb+" database.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("Insert SQL: "+insertStmt);
- Console.Out.Flush();
- int rcq = MySql.Query(db, insertStmt);
- if (rcq != 0) {
- Console.WriteLine("Couldn't execute ["+insertStmt+"] on server.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
-#if MYSQL_CANDO_QUERY
- Console.WriteLine("Query: "+myStmt);
- Console.Out.Flush();
- int rcq = MySql.Query(db, myStmt);
- if (rcq != 0) {
- Console.WriteLine("?Couldn't execute ["+myStmt+"] on server.");
- Console.Out.Flush();
- Console.WriteLine("MySql Error: " + MySql.Error(db));
- Console.Out.Flush();
- return 1;
- }
-
- Console.WriteLine("Process Results...");
- Console.Out.Flush();
- procResults(db);
-
- Console.WriteLine("==== Diagnostic info ====");
- Console.Out.Flush();
- Console.WriteLine("Client info: "+MySql.GetClientInfo());
- Console.WriteLine("Host info: "+MySql.GetHostInfo(db));
- Console.WriteLine("Server info: "+MySql.GetServerInfo(db));
- Console.Out.Flush();
-
- Console.WriteLine("List Processes...");
- Console.Out.Flush();
- listProcesses(db);
- Console.WriteLine("List Tables...");
- Console.Out.Flush();
- listTables(db);
-#endif // MYSQL_CANDO_QUERY
-
- Console.WriteLine("MySql Stat...");
- Console.Out.Flush();
- Console.WriteLine(MySql.Stat(db));
-
- Console.WriteLine("MySql Close...");
- Console.Out.Flush();
- MySql.Close(db);
-#if MYSQL_CANDO_THREADS
- Console.WriteLine("MySql Thread End...");
- Console.Out.Flush();
- MySql.ThreadEnd();
-#endif // MYSQL_CANDO_THREADS
- Console.WriteLine("Exiting...");
- Console.Out.Flush();
-
- return 0;
- }
-
-#if MYSQL_CANDO_QUERY
- static void procResults(IntPtr db) {
- IntPtr res = MySql.StoreResult(db);
- int numRows = MySql.NumRows(res);
- Console.WriteLine("Number of records found: " + numRows);
- int numFields = MySql.NumFields(res);
- string[] fields = new string[numFields];
- for (int i = 0; i < numFields; i++) {
- Field fd = (Field) Marshal.PtrToStructure(MySql.FetchField(res), typeof(Field));
- fields[i] = fd.Name;
- }
- IntPtr row;
- int recCnt = 1;
- while ((row = MySql.FetchRow(res)) != IntPtr.Zero) {
- Console.WriteLine("Record #" + recCnt + ":");
- for (int i = 0, j = 1; i < numFields; i++, j++) {
- Console.WriteLine(" Fld #"+j+" ("+fields[i]+"): "+rowVal(row, i));
- }
- Console.WriteLine("==============================");
- }
- MySql.FreeResult(res);
- }
-
- static string rowVal(IntPtr res, int index) {
- IntPtr str = Marshal.ReadIntPtr(res, index*IntPtr.Size);
- if (str == IntPtr.Zero)
- return "NULL";
- string s = Marshal.PtrToStringAnsi(str);
- return s;
- }
-
- static void listProcesses(IntPtr db) {
- IntPtr res = MySql.ListProcesses(db);
- if (res == IntPtr.Zero) {
- Console.WriteLine("Got error "+MySql.Error(db)+" when retreiving processlist");
- return;
- }
- int numRows = MySql.NumRows(res);
- // Console.WriteLine("Number of records found: "+i);
- int numFields = MySql.NumFields(res);
- string[] fields = new string[numFields];
- for (int i = 0; i < numFields; i++) {
- Field fd = (Field) Marshal.PtrToStructure(MySql.FetchField(res), typeof(Field));
- fields[i] = fd.Name;
- }
- IntPtr row;
- int recCnt = 1;
- while ((row = MySql.FetchRow(res)) != IntPtr.Zero) {
- Console.WriteLine("Process #" + recCnt + ":");
- for (int i = 0, j = 1; i < numFields; i++, j++) {
- Console.WriteLine(" Fld #"+j+" ("+fields[i]+"): "+rowVal(row, i));
- }
- Console.WriteLine("==============================");
- }
- MySql.FreeResult(res);
- }
-
- static void listTables(IntPtr db) {
- IntPtr res = MySql.ListTables(db, "%");
- if (res == IntPtr.Zero)
- return;
- int numRows = MySql.NumRows(res);
- // Console.WriteLine("Number of records found: "+i);
- int numFields = MySql.NumFields(res);
- string[] fields = new string[numFields];
- for (int i = 0; i < numFields; i++) {
- Field fd = (Field) Marshal.PtrToStructure(MySql.FetchField(res), typeof(Field));
- fields[i] = fd.Name;
- }
- IntPtr row;
- int recCnt = 1;
- while ((row = MySql.FetchRow(res)) != IntPtr.Zero) {
- Console.WriteLine("Process #" + recCnt + ":");
- for (int i = 0, j = 1; i < numFields; i++, j++) {
- Console.WriteLine(" Fld #"+j+" ("+fields[i]+"): "+rowVal(row, i));
- }
- Console.WriteLine("==============================");
- }
- MySql.FreeResult(res);
- }
-#endif // MYSQL_CANDO_QUERY
-}
diff --git a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/makefile b/mcs/class/Mono.Data.MySql/Mono.Data.MySql/makefile
deleted file mode 100644
index 78547a30cd3..00000000000
--- a/mcs/class/Mono.Data.MySql/Mono.Data.MySql/makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-
-SRCLIST = MySql.cs Test.cs
-
-.SUFFIXES: .exe .dll .cs .lex .txt
-
-#DEBUG = /debug
-
-.cs.dll:
- csc $(DEBUG) /t:dll $*.cs
-
-.cs.exe:
- csc $(DEBUG) /t:exe $*.cs
-
-all : Test.exe MySql.dll
-
-Test.exe : Test.cs MySql.dll
- csc $(DEBUG) /t:exe /r:MySql.dll Test.cs
-
-MySql.dll : MySql.cs Field.cs
- csc $(DEBUG) /t:library /doc:MySql.xml MySql.cs Field.cs
diff --git a/mcs/class/Mono.Data.MySql/Test/TestMySqlInsert.cs b/mcs/class/Mono.Data.MySql/Test/TestMySqlInsert.cs
deleted file mode 100644
index 30d6267bf4d..00000000000
--- a/mcs/class/Mono.Data.MySql/Test/TestMySqlInsert.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// TestSqlInsert.cs
-//
-// To Test MySqlConnection and MySqlCommand by connecting
-// to a MySQL database
-// and then executing an INSERT SQL statement
-//
-// To use:
-// change strings to your database, userid, tables, etc...:
-// connectionString
-// insertStatement
-//
-// To test:
-// mcs TestMySqlInsert.cs -r Mono.Data.MySql.dll
-// mint TestMySqlInsert.exe
-//
-// Author:
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C)Copyright 2002 Daniel Morgan
-//
-
-using System;
-using System.Data;
-using Mono.Data.MySql;
-
-namespace TestMonoDataMysql
-{
- class TestMySqlInsert
- {
- [STAThread]
- static void Main(string[] args)
- {
- MySqlConnection conn;
- MySqlCommand cmd;
- //MySqlTransaction trans;
-
- int rowsAffected;
-
- String connectionString;
- String insertStatement;
- String deleteStatement;
-
- connectionString =
- "dbname=test";
-
- insertStatement =
- "insert into sometable " +
- "(tid, tdesc) " +
- "values ('beer', 'Beer for All!') ";
-
- deleteStatement =
- "delete from sometable " +
- "where tid = 'beer' ";
-
- // Connect to a MySQL database
- Console.WriteLine ("Connect to database...");
- conn = new MySqlConnection(connectionString);
- conn.Open();
-
- // begin transaction
- //Console.WriteLine ("Begin Transaction...");
- //trans = conn.BeginTransaction();
-
- // create SQL DELETE command
- Console.WriteLine ("Create Command initializing " +
- "with an DELETE statement...");
- //cmd = new MySqlCommand (deleteStatement, conn);
- cmd = new MySqlCommand (deleteStatement, conn);
-
- // execute the DELETE SQL command
- Console.WriteLine ("Execute DELETE SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // change the SQL command to an SQL INSERT Command
- Console.WriteLine ("Now use INSERT SQL Command...");
- cmd.CommandText = insertStatement;
-
- // execute the INSERT SQL command
- Console.WriteLine ("Execute INSERT SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // if successfull at INSERT, commit the transaction,
- // otherwise, do a rollback the transaction using
- // trans.Rollback();
- // FIXME: need to have exceptions working in
- // Mono.Data.MySql classes before you can do rollback
- //Console.WriteLine ("Commit transaction...");
- //trans.Commit();
-
- // Close connection to database
- Console.WriteLine ("Close database connection...");
- conn.Close();
-
- Console.WriteLine ("Assuming everything " +
- "was successful.");
- Console.WriteLine ("Verify data in database to " +
- "see if row is there.");
- }
- }
-}
diff --git a/mcs/class/Mono.Data.MySql/list b/mcs/class/Mono.Data.MySql/list
deleted file mode 100644
index 1434f89e678..00000000000
--- a/mcs/class/Mono.Data.MySql/list
+++ /dev/null
@@ -1,5 +0,0 @@
-Mono.Data.MySql/Field.cs
-Mono.Data.MySql/MySqlCommand.cs
-Mono.Data.MySql/MySqlConnection.cs
-Mono.Data.MySql/MySql.cs
-Mono.Data.MySql/TODOAttribute.cs
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/ParmUtil.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/ParmUtil.cs
deleted file mode 100644
index 3dabac7853e..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/ParmUtil.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-//
-// ParmUtil.cs - utility to bind variables in a SQL statement to parameters in C# code
-// This is in the PostgreSQL .NET Data provider in Mono
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-// comment DEBUG_ParmUtil for production, for debug messages, uncomment
-//#define DEBUG_ParmUtil
-
-using System;
-using System.Data;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- enum PostgresBindVariableCharacter {
- Semicolon,
- At,
- QuestionMark
- }
-
- public class ParmUtil {
-
- private string sql = "";
- private string resultSql = "";
- private SqlParameterCollection parmsCollection = null;
-
- static private PostgresBindVariableCharacter PgbindChar = PostgresBindVariableCharacter.Semicolon;
- static char bindChar;
-
- // static constructor
- static ParmUtil() {
- switch(PgbindChar) {
- case PostgresBindVariableCharacter.Semicolon:
- bindChar = ':';
- break;
- case PostgresBindVariableCharacter.At:
- bindChar = '@';
- break;
- case PostgresBindVariableCharacter.QuestionMark:
- // this doesn't have named parameters,
- // they must be in order
- bindChar = '?';
- break;
- }
- }
-
- public ParmUtil(string query, SqlParameterCollection parms) {
- sql = query;
- parmsCollection = parms;
- }
-
- public string ResultSql {
- get {
- return resultSql;
- }
- }
-
- // TODO: currently only works for input variables,
- // need to do input/output, output, and return
- public string ReplaceWithParms() {
-
- StringBuilder result = new StringBuilder();
- char[] chars = sql.ToCharArray();
- bool bStringConstFound = false;
-
- for(int i = 0; i < chars.Length; i++) {
- if(chars[i] == '\'') {
- if(bStringConstFound == true)
- bStringConstFound = false;
- else
- bStringConstFound = true;
-
- result.Append(chars[i]);
- }
- else if(chars[i] == bindChar &&
- bStringConstFound == false) {
-#if DEBUG_ParmUtil
- Console.WriteLine("Bind Variable character found...");
-#endif
- StringBuilder parm = new StringBuilder();
- i++;
- while(i <= chars.Length) {
- char ch;
- if(i == chars.Length)
- ch = ' '; // a space
- else
- ch = chars[i];
-
-#if DEBUG_ParmUtil
- Console.WriteLine("Is char Letter or digit?");
-#endif
- if(Char.IsLetterOrDigit(ch)) {
-#if DEBUG_ParmUtil
- Console.WriteLine("Char IS letter or digit. " +
- "Now, append char to parm StringBuilder");
-#endif
- parm.Append(ch);
- }
- else {
-#if DEBUG_ParmUtil
- Console.WriteLine("Char is NOT letter or char. " +
- "thus we got rest of bind variable name. ");
-
- // replace bind variable placeholder
- // with data value constant
- Console.WriteLine("parm StringBuilder to string p...");
-#endif
- string p = parm.ToString();
-#if DEBUG_ParmUtil
- Console.WriteLine("calling BindReplace...");
-#endif
- bool found = BindReplace(result, p);
-#if DEBUG_ParmUtil
- Console.WriteLine(" Found = " + found);
-#endif
- if(found == true)
- break;
- else {
- // *** Error Handling
- Console.WriteLine("Error: parameter not found: " + p);
- return "";
- }
- }
- i++;
- }
- i--;
- }
- else
- result.Append(chars[i]);
- }
-
- resultSql = result.ToString();
- return resultSql;
- }
-
- public bool BindReplace (StringBuilder result, string p) {
- // bind variable
- bool found = false;
-
-#if DEBUG_ParmUtil
- Console.WriteLine("Does the parmsCollection contain the parameter???: " + p);
-#endif
- if(parmsCollection.Contains(p) == true) {
- // parameter found
-#if DEBUG_ParmUtil
- Console.WriteLine("Parameter Found: " + p);
-#endif
- SqlParameter prm = parmsCollection[p];
-
-#if DEBUG_ParmUtil
- // DEBUG
- Console.WriteLine(" Value: " + prm.Value);
- Console.WriteLine(" Direction: " + prm.Direction);
-#endif
- // convert object to string and place
- // into SQL
- if(prm.Direction == ParameterDirection.Input) {
- string strObj = PostgresHelper.
- ObjectToString(prm.DbType,
- prm.Value);
- result.Append(strObj);
- }
- else
- result.Append(bindChar + p);
-
- found = true;
- }
- return found;
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs
deleted file mode 100644
index 20b9e02a6d0..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermission.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
- public sealed class SqlClientPermission : DBDataPermission {
-
- [MonoTODO]
- public SqlClientPermission() {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public SqlClientPermission(PermissionState state) {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public SqlClientPermission(PermissionState state,
- bool allowBlankPassword) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Copy() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void FromXml(SecurityElement
- securityElement) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Intersect(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool IsSubsetOf(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override SecurityElement ToXml() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Union(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ~SqlClientPermission() {
- // FIXME: destructor to release resources
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs
deleted file mode 100644
index 149613c5f2e..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
- [AttributeUsage(AttributeTargets.Assembly |
- AttributeTargets.Class |
- AttributeTargets.Struct |
- AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class SqlClientPermissionAttribute :
- DBDataPermissionAttribute {
-
- [MonoTODO]
- public SqlClientPermissionAttribute(SecurityAction action) :
- base(action)
- {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public override IPermission CreatePermission() {
- throw new NotImplementedException ();
- }
-
- //[MonoTODO]
- //~SqlClientPermissionAttribute() {
- // // FIXME: destructor to release resources
- //}
- }
-
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommand.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
deleted file mode 100644
index af2771c3fa2..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
+++ /dev/null
@@ -1,928 +0,0 @@
-//
-// System.Data.SqlClient.SqlCommand.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002 http://www.ximian.com/
-// (C) Daniel Morgan, 2002
-// (C) Copyright 2002 Tim Coleman
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// use #define DEBUG_SqlCommand if you want to spew debug messages
-// #define DEBUG_SqlCommand
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-namespace System.Data.SqlClient {
- /// <summary>
- /// Represents a SQL statement that is executed
- /// while connected to a SQL database.
- /// </summary>
- // public sealed class SqlCommand : Component, IDbCommand, ICloneable
- public sealed class SqlCommand : IDbCommand {
-
- #region Fields
-
- private string sql = "";
- private int timeout = 30;
- // default is 30 seconds
- // for command execution
-
- private SqlConnection conn = null;
- private SqlTransaction trans = null;
- private CommandType cmdType = CommandType.Text;
- private bool designTime = false;
- private SqlParameterCollection parmCollection = new
- SqlParameterCollection();
-
- // SqlDataReader state data for ExecuteReader()
- private SqlDataReader dataReader = null;
- private string[] queries = null;
- private int currentQuery = -1;
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- private ParmUtil parmUtil = null;
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlCommand() {
- sql = "";
- }
-
- public SqlCommand (string cmdText) {
- sql = cmdText;
- }
-
- public SqlCommand (string cmdText, SqlConnection connection) {
- sql = cmdText;
- conn = connection;
- }
-
- public SqlCommand (string cmdText, SqlConnection connection,
- SqlTransaction transaction) {
- sql = cmdText;
- conn = connection;
- trans = transaction;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- [MonoTODO]
- public void Cancel () {
- // FIXME: use non-blocking Exec for this
- throw new NotImplementedException ();
- }
-
- // FIXME: is this the correct way to return a stronger type?
- [MonoTODO]
- IDbDataParameter IDbCommand.CreateParameter () {
- return CreateParameter ();
- }
-
- [MonoTODO]
- public SqlParameter CreateParameter () {
- return new SqlParameter ();
- }
-
- public int ExecuteNonQuery () {
- IntPtr pgResult; // PGresult
- int rowsAffected = -1;
- ExecStatusType execStatus;
- String rowsAffectedString;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK ||
- execStatus == ExecStatusType.PGRES_TUPLES_OK ) {
-
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
-
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
-
- return rowsAffected;
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader () {
- return ExecuteReader ();
- }
-
- [MonoTODO]
- public SqlDataReader ExecuteReader () {
- return ExecuteReader(CommandBehavior.Default);
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader (
- CommandBehavior behavior) {
- return ExecuteReader (behavior);
- }
-
- [MonoTODO]
- public SqlDataReader ExecuteReader (CommandBehavior behavior)
- {
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- cmdBehavior = behavior;
-
- queries = null;
- currentQuery = -1;
- dataReader = new SqlDataReader(this);
-
- queries = sql.Split(new Char[] {';'});
-
- dataReader.NextResult();
-
- return dataReader;
- }
-
- internal SqlResult NextResult()
- {
- SqlResult res = new SqlResult();
- res.Connection = this.Connection;
- res.Behavior = cmdBehavior;
- string statement;
-
- currentQuery++;
-
- res.CurrentQuery = currentQuery;
-
- if(currentQuery < queries.Length && queries[currentQuery].Equals("") == false) {
- res.SQL = queries[currentQuery];
- statement = TweakQuery(queries[currentQuery], cmdType);
- ExecuteQuery(statement, res);
- res.ResultReturned = true;
- }
- else {
- res.ResultReturned = false;
- }
-
- return res;
- }
-
- private string TweakQuery(string query, CommandType commandType) {
- string statement = "";
- StringBuilder td;
-
-#if DEBUG_SqlCommand
- Console.WriteLine("---------[][] TweakQuery() [][]--------");
- Console.WriteLine("CommandType: " + commandType + " CommandBehavior: " + cmdBehavior);
- Console.WriteLine("SQL before command type: " + query);
-#endif
- // finish building SQL based on CommandType
- switch(commandType) {
- case CommandType.Text:
- statement = query;
- break;
- case CommandType.StoredProcedure:
- statement =
- "SELECT " + query + "()";
- break;
- case CommandType.TableDirect:
- // NOTE: this is for the PostgreSQL provider
- // and for OleDb, according to the docs,
- // an exception is thrown if you try to use
- // this with SqlCommand
- string[] directTables = query.Split(
- new Char[] {','});
-
- td = new StringBuilder("SELECT * FROM ");
-
- for(int tab = 0; tab < directTables.Length; tab++) {
- if(tab > 0)
- td.Append(',');
- td.Append(directTables[tab]);
- // FIXME: if multipe tables, how do we
- // join? based on Primary/Foreign Keys?
- // Otherwise, a Cartesian Product happens
- }
- statement = td.ToString();
- break;
- default:
- // FIXME: throw an exception?
- statement = query;
- break;
- }
-#if DEBUG_SqlCommand
- Console.WriteLine("SQL after command type: " + statement);
-#endif
- // TODO: this parameters utility
- // currently only support input variables
- // need todo output, input/output, and return.
-#if DEBUG_SqlCommand
- Console.WriteLine("using ParmUtil in TweakQuery()...");
-#endif
- parmUtil = new ParmUtil(statement, parmCollection);
-#if DEBUG_SqlCommand
- Console.WriteLine("ReplaceWithParms...");
-#endif
-
- statement = parmUtil.ReplaceWithParms();
-
-#if DEBUG_SqlCommand
- Console.WriteLine("SQL after ParmUtil: " + statement);
-#endif
- return statement;
- }
-
- private void ExecuteQuery (string query, SqlResult res)
- {
- IntPtr pgResult;
-
- ExecStatusType execStatus;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- res.ExecStatus = execStatus;
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK ||
- execStatus == ExecStatusType.PGRES_COMMAND_OK) {
-
- res.BuildTableSchema(pgResult);
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
- }
-
- // since SqlCommand has resources so SqlDataReader
- // can do Read() and NextResult(), need to free
- // those resources. Also, need to allow this SqlCommand
- // and this SqlConnection to do things again.
- internal void CloseReader() {
- dataReader = null;
- queries = null;
-
- if((cmdBehavior & CommandBehavior.CloseConnection) == CommandBehavior.CloseConnection) {
- conn.CloseReader(true);
- }
- else {
- conn.CloseReader(false);
- }
- }
-
- // only meant to be used between SqlConnectioin,
- // SqlCommand, and SqlDataReader
- internal void OpenReader(SqlDataReader reader) {
- conn.OpenReader(reader);
- }
-
- /// <summary>
- /// ExecuteScalar is used to retrieve one object
- /// from one result set
- /// that has one row and one column.
- /// It is lightweight compared to ExecuteReader.
- /// </summary>
- [MonoTODO]
- public object ExecuteScalar () {
- IntPtr pgResult; // PGresult
- ExecStatusType execStatus;
- object obj = null; // return
- int nRow = 0; // first row
- int nCol = 0; // first column
- String value;
- int nRows;
- int nFields;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK) {
- // result was a SQL Command
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- return null; // return null reference
- }
- else if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- // result was a SQL Query
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- if(nRows > 0 && nFields > 0) {
-
- // get column name
- //String fieldName;
- //fieldName = PostgresLibrary.
- // PQfname(pgResult, nCol);
-
- int oid;
- string sType;
- DbType dbType;
- // get PostgreSQL data type (OID)
- oid = PostgresLibrary.
- PQftype(pgResult, nCol);
- sType = PostgresHelper.
- OidToTypname (oid, conn.Types);
- dbType = PostgresHelper.
- TypnameToSqlDbType(sType);
-
- int definedSize;
- // get defined size of column
- definedSize = PostgresLibrary.
- PQfsize(pgResult, nCol);
-
- // get data value
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- nRow, nCol);
-
- int columnIsNull;
- // is column NULL?
- columnIsNull = PostgresLibrary.
- PQgetisnull(pgResult,
- nRow, nCol);
-
- int actualLength;
- // get Actual Length
- actualLength = PostgresLibrary.
- PQgetlength(pgResult,
- nRow, nCol);
-
- obj = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- value);
- }
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
-
- return obj;
- }
-
- [MonoTODO]
- public XmlReader ExecuteXmlReader () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Prepare () {
- // FIXME: parameters have to be implemented for this
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand Clone () {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
-
- #region Properties
-
- public string CommandText {
- get {
- return sql;
- }
-
- set {
- sql = value;
- }
- }
-
- public int CommandTimeout {
- get {
- return timeout;
- }
-
- set {
- // FIXME: if value < 0, throw
- // ArgumentException
- // if (value < 0)
- // throw ArgumentException;
- timeout = value;
- }
- }
-
- public CommandType CommandType {
- get {
- return cmdType;
- }
-
- set {
- cmdType = value;
- }
- }
-
- // FIXME: for property Connection, is this the correct
- // way to handle a return of a stronger type?
- IDbConnection IDbCommand.Connection {
- get {
- return Connection;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during a
- // transaction in progress
-
- // csc
- Connection = (SqlConnection) value;
- // mcs
- // Connection = value;
-
- // FIXME: set Transaction property to null
- }
- }
-
- public SqlConnection Connection {
- get {
- // conn defaults to null
- return conn;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during
- // a transaction in progress
- conn = value;
- // FIXME: set Transaction property to null
- }
- }
-
- public bool DesignTimeVisible {
- get {
- return designTime;
- }
-
- set{
- designTime = value;
- }
- }
-
- // FIXME; for property Parameters, is this the correct
- // way to handle a stronger return type?
- IDataParameterCollection IDbCommand.Parameters {
- get {
- return Parameters;
- }
- }
-
- public SqlParameterCollection Parameters {
- get {
- return parmCollection;
- }
- }
-
- // FIXME: for property Transaction, is this the correct
- // way to handle a return of a stronger type?
- IDbTransaction IDbCommand.Transaction {
- get {
- return Transaction;
- }
-
- set {
- // FIXME: error handling - do not allow
- // setting of transaction if transaction
- // has already begun
-
- // csc
- Transaction = (SqlTransaction) value;
- // mcs
- // Transaction = value;
- }
- }
-
- public SqlTransaction Transaction {
- get {
- return trans;
- }
-
- set {
- // FIXME: error handling
- trans = value;
- }
- }
-
- [MonoTODO]
- public UpdateRowSource UpdatedRowSource {
- // FIXME: do this once DbDataAdaptor
- // and DataRow are done
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Inner Classes
-
- #endregion // Inner Classes
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose() {
- // FIXME: need proper way to release resources
- // Dispose(true);
- }
-
- [MonoTODO]
- ~SqlCommand() {
- // FIXME: need proper way to release resources
- // Dispose(false);
- }
-
- #endregion //Destructors
- }
-
- // SqlResult is used for passing Result Set data
- // from SqlCommand to SqlDataReader
- internal class SqlResult {
-
- private DataTable dataTableSchema = null; // only will contain the schema
- private IntPtr pg_result = IntPtr.Zero; // native PostgreSQL PGresult
- private int rowCount = 0;
- private int fieldCount = 0;
- private string[] pgtypes = null; // PostgreSQL types (typname)
- private bool resultReturned = false;
- private SqlConnection con = null;
- private int rowsAffected = -1;
- private ExecStatusType execStatus = ExecStatusType.PGRES_FATAL_ERROR;
- private int currentQuery = -1;
- private string sql = "";
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- internal CommandBehavior Behavior {
- get {
- return cmdBehavior;
- }
- set {
- cmdBehavior = value;
- }
- }
-
- internal string SQL {
- get {
- return sql;
- }
- set {
- sql = value;
- }
- }
-
- internal ExecStatusType ExecStatus {
- get {
- return execStatus;
- }
- set {
- execStatus = value;
- }
- }
-
- internal int CurrentQuery {
- get {
- return currentQuery;
- }
-
- set {
- currentQuery = value;
- }
-
- }
-
- internal SqlConnection Connection {
- get {
- return con;
- }
-
- set {
- con = value;
- }
- }
-
- internal int RecordsAffected {
- get {
- return rowsAffected;
- }
- }
-
- internal bool ResultReturned {
- get {
- return resultReturned;
- }
- set {
- resultReturned = value;
- }
- }
-
- internal DataTable Table {
- get {
- return dataTableSchema;
- }
- }
-
- internal IntPtr PgResult {
- get {
- return pg_result;
- }
- }
-
- internal int RowCount {
- get {
- return rowCount;
- }
- }
-
- internal int FieldCount {
- get {
- return fieldCount;
- }
- }
-
- internal string[] PgTypes {
- get {
- return pgtypes;
- }
- }
-
- internal void BuildTableSchema (IntPtr pgResult) {
- pg_result = pgResult;
-
- // need to set IDataReader.RecordsAffected property
- string rowsAffectedString;
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- // Only Results from SQL SELECT Queries
- // get a DataTable for schema of the result
- // otherwise, DataTable is null reference
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
-
- dataTableSchema = new DataTable ();
- dataTableSchema.Columns.Add ("ColumnName", typeof (string));
- dataTableSchema.Columns.Add ("ColumnOrdinal", typeof (int));
- dataTableSchema.Columns.Add ("ColumnSize", typeof (int));
- dataTableSchema.Columns.Add ("NumericPrecision", typeof (int));
- dataTableSchema.Columns.Add ("NumericScale", typeof (int));
- dataTableSchema.Columns.Add ("IsUnique", typeof (bool));
- dataTableSchema.Columns.Add ("IsKey", typeof (bool));
- DataColumn dc = dataTableSchema.Columns["IsKey"];
- dc.AllowDBNull = true; // IsKey can have a DBNull
- dataTableSchema.Columns.Add ("BaseCatalogName", typeof (string));
- dataTableSchema.Columns.Add ("BaseColumnName", typeof (string));
- dataTableSchema.Columns.Add ("BaseSchemaName", typeof (string));
- dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
- dataTableSchema.Columns.Add ("DataType", typeof(string));
- dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (int));
- dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
- dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
- dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
- dataTableSchema.Columns.Add ("IsAutoIncrement", typeof (bool));
- dataTableSchema.Columns.Add ("IsRowVersion", typeof (bool));
- dataTableSchema.Columns.Add ("IsHidden", typeof (bool));
- dataTableSchema.Columns.Add ("IsLong", typeof (bool));
- dataTableSchema.Columns.Add ("IsReadOnly", typeof (bool));
-
- fieldCount = PostgresLibrary.PQnfields (pgResult);
- rowCount = PostgresLibrary.PQntuples(pgResult);
- pgtypes = new string[fieldCount];
-
- // TODO: for CommandBehavior.SingleRow
- // use IRow, otherwise, IRowset
- if(fieldCount > 0)
- if((cmdBehavior & CommandBehavior.SingleRow) == CommandBehavior.SingleRow)
- fieldCount = 1;
-
- // TODO: for CommandBehavior.SchemaInfo
- if((cmdBehavior & CommandBehavior.SchemaOnly) == CommandBehavior.SchemaOnly)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SingleResult
- if((cmdBehavior & CommandBehavior.SingleResult) == CommandBehavior.SingleResult)
- if(currentQuery > 0)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SequentialAccess - used for reading Large OBjects
- //if((cmdBehavior & CommandBehavior.SequentialAccess) == CommandBehavior.SequentialAccess) {
- //}
-
- DataRow schemaRow;
- int oid;
- DbType dbType;
- Type typ;
-
- for (int i = 0; i < fieldCount; i += 1 ) {
- schemaRow = dataTableSchema.NewRow ();
-
- string columnName = PostgresLibrary.PQfname (pgResult, i);
-
- schemaRow["ColumnName"] = columnName;
- schemaRow["ColumnOrdinal"] = i+1;
- schemaRow["ColumnSize"] = PostgresLibrary.PQfsize (pgResult, i);
- schemaRow["NumericPrecision"] = 0;
- schemaRow["NumericScale"] = 0;
- // TODO: need to get KeyInfo
- if((cmdBehavior & CommandBehavior.KeyInfo) == CommandBehavior.KeyInfo) {
- bool IsUnique, IsKey;
- GetKeyInfo(columnName, out IsUnique, out IsKey);
- }
- else {
- schemaRow["IsUnique"] = false;
- schemaRow["IsKey"] = DBNull.Value;
- }
- schemaRow["BaseCatalogName"] = "";
- schemaRow["BaseColumnName"] = columnName;
- schemaRow["BaseSchemaName"] = "";
- schemaRow["BaseTableName"] = "";
-
- // PostgreSQL type to .NET type stuff
- oid = PostgresLibrary.PQftype (pgResult, i);
- pgtypes[i] = PostgresHelper.OidToTypname (oid, con.Types);
- dbType = PostgresHelper.TypnameToSqlDbType (pgtypes[i]);
-
- typ = PostgresHelper.DbTypeToSystemType (dbType);
- string st = typ.ToString();
- schemaRow["DataType"] = st;
-
- schemaRow["AllowDBNull"] = false;
- schemaRow["ProviderType"] = oid;
- schemaRow["IsAliased"] = false;
- schemaRow["IsExpression"] = false;
- schemaRow["IsIdentity"] = false;
- schemaRow["IsAutoIncrement"] = false;
- schemaRow["IsRowVersion"] = false;
- schemaRow["IsHidden"] = false;
- schemaRow["IsLong"] = false;
- schemaRow["IsReadOnly"] = false;
- schemaRow.AcceptChanges();
- dataTableSchema.Rows.Add (schemaRow);
- }
-
-#if DEBUG_SqlCommand
- Console.WriteLine("********** DEBUG Table Schema BEGIN ************");
- foreach (DataRow myRow in dataTableSchema.Rows) {
- foreach (DataColumn myCol in dataTableSchema.Columns)
- Console.WriteLine(myCol.ColumnName + " = " + myRow[myCol]);
- Console.WriteLine();
- }
- Console.WriteLine("********** DEBUG Table Schema END ************");
-#endif // DEBUG_SqlCommand
-
- }
- }
-
- // TODO: how do we get the key info if
- // we don't have the tableName?
- private void GetKeyInfo(string columnName, out bool isUnique, out bool isKey) {
- isUnique = false;
- isKey = false;
-
- string sql;
-
- sql =
- "SELECT i.indkey, i.indisprimary, i.indisunique " +
- "FROM pg_class c, pg_class c2, pg_index i " +
- "WHERE c.relname = ':tableName' AND c.oid = i.indrelid " +
- "AND i.indexrelid = c2.oid ";
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs
deleted file mode 100644
index d2b028bc652..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.Data.SqlClient.SqlCommandBuilder.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.ComponentModel;
-
-namespace System.Data.SqlClient {
-
- /// <summary>
- /// Builder of one command
- /// that will be used in manipulating a table for
- /// a DataSet that is assoicated with a database.
- /// </summary>
- public sealed class SqlCommandBuilder : Component {
-
- [MonoTODO]
- public SqlCommandBuilder() {
-
- }
-
- [MonoTODO]
- public SqlCommandBuilder(SqlDataAdapter adapter) {
-
- }
-
- [MonoTODO]
- public SqlDataAdapter DataAdapter {
- get {
- throw new NotImplementedException ();
- }
-
- set{
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string QuotePrefix {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string QuoteSuffix {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static void DeriveParameters(SqlCommand command) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetDeleteCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetInsertCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetUpdateCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RefreshSchema() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override void Dispose(bool disposing) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ~SqlCommandBuilder() {
- // FIXME: create destructor - release resources
- }
- }
-}
-
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlConnection.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlConnection.cs
deleted file mode 100644
index 0bd37605cc6..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlConnection.cs
+++ /dev/null
@@ -1,722 +0,0 @@
-//
-// System.Data.SqlClient.SqlConnection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// use #define DEBUG_SqlConnection if you want to spew debug messages
-// #define DEBUG_SqlConnection
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- /// <summary>
- /// Represents an open connection to a SQL data source
- /// </summary>
- public sealed class SqlConnection : Component, IDbConnection,
- ICloneable
- {
- // FIXME: Need to implement class Component,
- // and interfaces: ICloneable and IDisposable
-
- #region Fields
-
- private PostgresTypes types = null;
- private IntPtr pgConn = IntPtr.Zero;
-
- // PGConn (Postgres Connection)
- private string connectionString = "";
- // OLE DB Connection String
- private string pgConnectionString = "";
- // PostgreSQL Connection String
- private SqlTransaction trans = null;
- private int connectionTimeout = 15;
- // default for 15 seconds
-
- // connection parameters in connection string
- private string host = "";
- // Name of host to connect to
- private string hostaddr = "";
- // IP address of host to connect to
- // should be in "n.n.n.n" format
- private string port = "";
- // Port number to connect to at the server host
- private string dbname = ""; // The database name.
- private string user = ""; // User name to connect as.
- private string password = "";
- // Password to be used if the server
- // demands password authentication.
- private string options = "";
- // Trace/debug options to be sent to the server.
- private string tty = "";
- // A file or tty for optional
- // debug output from the backend.
- private string requiressl = "";
- // Set to 1 to require
- // SSL connection to the backend.
- // Libpq will then refuse to connect
- // if the server does not
- // support SSL. Set to 0 (default) to
- // negotiate with server.
-
- // connection state
- private ConnectionState conState = ConnectionState.Closed;
-
- // DataReader state
- private SqlDataReader rdr = null;
- private bool dataReaderOpen = false;
- // FIXME: if true, throw an exception if SqlConnection
- // is used for anything other than reading
- // data using SqlDataReader
-
- private string versionString = "Unknown";
-
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- // A lot of the defaults were initialized in the Fields
- [MonoTODO]
- public SqlConnection () {
-
- }
-
- [MonoTODO]
- public SqlConnection (String connectionString) {
- SetConnectionString (connectionString);
- }
-
- #endregion // Constructors
-
- #region Destructors
-
- protected override void Dispose(bool disposing) {
- if(!this.disposed)
- try {
- if(disposing) {
- // release any managed resources
- }
- // release any unmanaged resources
- // close any handles
-
- this.disposed = true;
- }
- finally {
- base.Dispose(disposing);
- }
- }
-
- // aka Finalize()
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- [MonoTODO]
- ~SqlConnection() {
- Dispose (false);
- }
-
- #endregion // Destructors
-
- #region Public Methods
-
- IDbTransaction IDbConnection.BeginTransaction () {
- return BeginTransaction ();
- }
-
- public SqlTransaction BeginTransaction () {
- return TransactionBegin (); // call private method
- }
-
- IDbTransaction IDbConnection.BeginTransaction (IsolationLevel
- il) {
- return BeginTransaction (il);
- }
-
- public SqlTransaction BeginTransaction (IsolationLevel il) {
- return TransactionBegin (il); // call private method
- }
-
- // PostgreSQL does not support named transactions/savepoint
- // nor nested transactions
- [Obsolete]
- public SqlTransaction BeginTransaction(string transactionName) {
- return TransactionBegin (); // call private method
- }
-
- [Obsolete]
- public SqlTransaction BeginTransaction(IsolationLevel iso,
- string transactionName) {
- return TransactionBegin (iso); // call private method
- }
-
- [MonoTODO]
- public void ChangeDatabase (string databaseName) {
- throw new NotImplementedException ();
- }
-
- object ICloneable.Clone() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Close () {
- if(dataReaderOpen == true) {
- // TODO: what do I do if
- // the user Closes the connection
- // without closing the Reader first?
-
- }
- CloseDataSource ();
- }
-
- IDbCommand IDbConnection.CreateCommand () {
- return CreateCommand ();
- }
-
- public SqlCommand CreateCommand () {
- SqlCommand sqlcmd = new SqlCommand ("", this);
-
- return sqlcmd;
- }
-
- [MonoTODO]
- public void Open () {
- if(dbname.Equals(""))
- throw new InvalidOperationException(
- "dbname missing");
- else if(conState == ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is already Open");
-
- ConnStatusType connStatus;
-
- // FIXME: check to make sure we have
- // everything to connect,
- // otherwise, throw an exception
-
- pgConn = PostgresLibrary.PQconnectdb
- (pgConnectionString);
-
- // FIXME: should we use PQconnectStart/PQconnectPoll
- // instead of PQconnectdb?
- // PQconnectdb blocks
- // PQconnectStart/PQconnectPoll is non-blocking
-
- connStatus = PostgresLibrary.PQstatus (pgConn);
- if(connStatus == ConnStatusType.CONNECTION_OK) {
- // Successfully Connected
- disposed = false;
- SetupConnection();
- }
- else {
- String errorMessage = PostgresLibrary.
- PQerrorMessage (pgConn);
- errorMessage += ": Could not connect to database.";
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- host, "SqlConnection", 0);
- }
- }
-
- #endregion // Public Methods
-
- #region Internal Methods
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open.
- // Open the Reader. (called from SqlCommand)
- internal void OpenReader(SqlDataReader reader)
- {
- if(dataReaderOpen == true) {
- // TODO: throw exception here?
- // because a reader
- // is already open
- }
- else {
- rdr = reader;
- dataReaderOpen = true;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- // Close the Reader (called from SqlCommand)
- // if closeConnection true, Close() the connection
- // this is based on CommandBehavior.CloseConnection
- internal void CloseReader(bool closeConnection)
- { if(closeConnection == true)
- CloseDataSource();
- else
- dataReaderOpen = false;
- }
-
- #endregion // Internal Methods
-
- #region Private Methods
-
- private void SetupConnection() {
-
- conState = ConnectionState.Open;
-
- // FIXME: load types into hashtable
- types = new PostgresTypes(this);
- types.Load();
-
- versionString = GetDatabaseServerVersion();
-
- // set DATE style to YYYY/MM/DD
- IntPtr pgResult = IntPtr.Zero;
- pgResult = PostgresLibrary.PQexec (pgConn, "SET DATESTYLE TO 'ISO'");
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- private string GetDatabaseServerVersion()
- {
- SqlCommand cmd = new SqlCommand("select version()",this);
- return (string) cmd.ExecuteScalar();
- }
-
- private void CloseDataSource () {
- // FIXME: just a quick hack
- if(conState == ConnectionState.Open) {
- if(trans != null)
- if(trans.DoingTransaction == true) {
- trans.Rollback();
- // trans.Dispose();
- trans = null;
- }
-
- conState = ConnectionState.Closed;
- PostgresLibrary.PQfinish (pgConn);
- pgConn = IntPtr.Zero;
- }
- }
-
- private void SetConnectionString (string connectionString) {
- // FIXME: perform error checking on string
- // while translating string from
- // OLE DB format to PostgreSQL
- // connection string format
- //
- // OLE DB: "host=localhost;dbname=test;user=joe;password=smoe"
- // PostgreSQL: "host=localhost dbname=test user=joe password=smoe"
- //
- // For OLE DB, you would have the additional
- // "provider=postgresql"
- // OleDbConnection you would be using libgda
- //
- // Also, parse the connection string into properties
-
- // FIXME: if connection is open, you can
- // not set the connection
- // string, throw an exception
-
- this.connectionString = connectionString;
- pgConnectionString = ConvertStringToPostgres (
- connectionString);
-
-#if DEBUG_SqlConnection
- Console.WriteLine(
- "OLE-DB Connection String [in]: " +
- this.ConnectionString);
- Console.WriteLine(
- "Postgres Connection String [out]: " +
- pgConnectionString);
-#endif // DEBUG_SqlConnection
- }
-
- private String ConvertStringToPostgres (String
- oleDbConnectionString) {
- StringBuilder postgresConnection =
- new StringBuilder();
- string result;
- string[] connectionParameters;
-
- char[] semicolon = new Char[1];
- semicolon[0] = ';';
-
- // FIXME: what is the max number of value pairs
- // can there be for the OLE DB
- // connnection string? what about libgda max?
- // what about postgres max?
-
- // FIXME: currently assuming value pairs are like:
- // "key1=value1;key2=value2;key3=value3"
- // Need to deal with values that have
- // single or double quotes. And error
- // handling of that too.
- // "key1=value1;key2='value2';key=\"value3\""
-
- // FIXME: put the connection parameters
- // from the connection
- // string into a
- // Hashtable (System.Collections)
- // instead of using private variables
- // to store them
- connectionParameters = oleDbConnectionString.
- Split (semicolon);
- foreach (string sParameter in connectionParameters) {
- if(sParameter.Length > 0) {
- BreakConnectionParameter (sParameter);
- postgresConnection.
- Append (sParameter +
- " ");
- }
- }
- result = postgresConnection.ToString ();
- return result;
- }
-
- private bool BreakConnectionParameter (String sParameter) {
- bool addParm = true;
- int index;
-
- index = sParameter.IndexOf ("=");
- if (index > 0) {
- string parmKey, parmValue;
-
- // separate string "key=value" to
- // string "key" and "value"
- parmKey = sParameter.Substring (0, index);
- parmValue = sParameter.Substring (index + 1,
- sParameter.Length - index - 1);
-
- switch(parmKey.ToLower()) {
- case "hostaddr":
- hostaddr = parmValue;
- break;
-
- case "port":
- port = parmValue;
- break;
-
- case "host":
- // set DataSource property
- host = parmValue;
- break;
-
- case "dbname":
- // set Database property
- dbname = parmValue;
- break;
-
- case "user":
- user = parmValue;
- break;
-
- case "password":
- password = parmValue;
- // addParm = false;
- break;
-
- case "options":
- options = parmValue;
- break;
-
- case "tty":
- tty = parmValue;
- break;
-
- case "requiressl":
- requiressl = parmValue;
- break;
- }
- }
- return addParm;
- }
-
- private SqlTransaction TransactionBegin () {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new SqlTransaction ();
- // using internal methods of SqlTransaction
- trans.SetConnection (this);
- trans.Begin();
-
- return trans;
- }
-
- private SqlTransaction TransactionBegin (IsolationLevel il) {
- // FIXME: need to keep track of
- // transaction in-progress
- TransactionBegin();
- trans.SetIsolationLevel (il);
-
- return trans;
- }
-
- #endregion
-
- #region Public Properties
-
- [MonoTODO]
- public ConnectionState State {
- get {
- return conState;
- }
- }
-
- public string ConnectionString {
- get {
- return connectionString;
- }
- set {
- SetConnectionString (value);
- }
- }
-
- public int ConnectionTimeout {
- get {
- return connectionTimeout;
- }
- }
-
- public string Database {
- get {
- return dbname;
- }
- }
-
- public string DataSource {
- get {
- return host;
- }
- }
-
- public int PacketSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string ServerVersion {
- get {
- return versionString;
- }
- }
-
- #endregion // Public Properties
-
- #region Internal Properties
-
- // For System.Data.SqlClient classes
- // to get the current transaction
- // in progress - if any
- internal SqlTransaction Transaction {
- get {
- return trans;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the unmanaged PostgreSQL connection
- internal IntPtr PostgresConnection {
- get {
- return pgConn;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the list PostgreSQL types
- // so can look up based on OID to
- // get the .NET System type.
- internal ArrayList Types {
- get {
- return types.List;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- internal bool IsReaderOpen {
- get {
- return dataReaderOpen;
- }
- }
-
- #endregion // Internal Properties
-
- #region Events
-
- public event
- SqlInfoMessageEventHandler InfoMessage;
-
- public event
- StateChangeEventHandler StateChange;
-
- #endregion
-
- #region Inner Classes
-
- private class PostgresTypes {
- // TODO: create hashtable for
- // PostgreSQL types to .NET types
- // containing: oid, typname, SqlDbType
-
- private Hashtable hashTypes;
- private ArrayList pgTypes;
- private SqlConnection con;
-
- // Got this SQL with the permission from
- // the authors of libgda
- private const string SEL_SQL_GetTypes =
- "SELECT oid, typname FROM pg_type " +
- "WHERE typrelid = 0 AND typname !~ '^_' " +
- " AND typname not in ('SET', 'cid', " +
- "'int2vector', 'oidvector', 'regproc', " +
- "'smgr', 'tid', 'unknown', 'xid') " +
- "ORDER BY typname";
-
- internal PostgresTypes(SqlConnection sqlcon) {
-
- con = sqlcon;
- hashTypes = new Hashtable();
- }
-
- private void AddPgType(Hashtable types,
- string typname, DbType dbType) {
-
- PostgresType pgType = new PostgresType();
-
- pgType.typname = typname;
- pgType.dbType = dbType;
-
- types.Add(pgType.typname, pgType);
- }
-
- private void BuildTypes(IntPtr pgResult,
- int nRows, int nFields) {
-
- String value;
-
- int r;
- for(r = 0; r < nRows; r++) {
- PostgresType pgType =
- new PostgresType();
-
- // get data value (oid)
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 0);
-
- pgType.oid = Int32.Parse(value);
-
- // get data value (typname)
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 1);
- pgType.typname = String.Copy(value);
- pgType.dbType = PostgresHelper.
- TypnameToSqlDbType(
- pgType.typname);
-
- pgTypes.Add(pgType);
- }
- pgTypes = ArrayList.ReadOnly(pgTypes);
- }
-
- internal void Load() {
- pgTypes = new ArrayList();
- IntPtr pgResult = IntPtr.Zero; // PGresult
-
- if(con.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (con.PostgresConnection, SEL_SQL_GetTypes);
-
- if(pgResult.Equals(IntPtr.Zero)) {
- throw new SqlException(0, 0,
- "No Resultset from PostgreSQL", 0, "",
- con.DataSource, "SqlConnection", 0);
- }
- else {
- ExecStatusType execStatus;
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- int nRows;
- int nFields;
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- BuildTypes (pgResult, nRows, nFields);
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- con.DataSource, "SqlConnection", 0);
- }
- }
- }
-
- public ArrayList List {
- get {
- return pgTypes;
- }
- }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs
deleted file mode 100644
index 44d43068ea9..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-//
-// System.Data.SqlClient.SqlDataAdapter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a set of command-related properties that are used
- /// to fill the DataSet and update a data source, all this
- /// from a SQL database.
- /// </summary>
- public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter
- {
- #region Fields
-
- SqlCommand deleteCommand;
- SqlCommand insertCommand;
- SqlCommand selectCommand;
- SqlCommand updateCommand;
-
- static readonly object EventRowUpdated = new object();
- static readonly object EventRowUpdating = new object();
-
- #endregion
-
- #region Constructors
-
- public SqlDataAdapter ()
- : this (new SqlCommand ())
- {
- }
-
- public SqlDataAdapter (SqlCommand selectCommand)
- {
- DeleteCommand = new SqlCommand ();
- InsertCommand = new SqlCommand ();
- SelectCommand = selectCommand;
- UpdateCommand = new SqlCommand ();
- }
-
- public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection)
- : this (new SqlCommand (selectCommandText, selectConnection))
- {
- }
-
- public SqlDataAdapter (string selectCommandText, string selectConnectionString)
- : this (selectCommandText, new SqlConnection (selectConnectionString))
- {
- }
-
- #endregion
-
- #region Properties
-
- public new SqlCommand DeleteCommand {
- get { return deleteCommand; }
- set { deleteCommand = value; }
- }
-
- public new SqlCommand InsertCommand {
- get { return insertCommand; }
- set { insertCommand = value; }
- }
-
- public new SqlCommand SelectCommand {
- get { return selectCommand; }
- set { selectCommand = value; }
- }
-
- public new SqlCommand UpdateCommand {
- get { return updateCommand; }
- set { updateCommand = value; }
- }
-
- IDbCommand IDbDataAdapter.DeleteCommand {
- get { return DeleteCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- DeleteCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.InsertCommand {
- get { return InsertCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- InsertCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.SelectCommand {
- get { return SelectCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- SelectCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.UpdateCommand {
- get { return UpdateCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- UpdateCommand = (SqlCommand)value;
- }
- }
-
-
- ITableMappingCollection IDataAdapter.TableMappings {
- get { return TableMappings; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new SqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
- }
-
-
- protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new SqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
- }
-
- protected override void OnRowUpdated (RowUpdatedEventArgs value)
- {
- SqlRowUpdatedEventHandler handler = (SqlRowUpdatedEventHandler) Events[EventRowUpdated];
- if ((handler != null) && (value is SqlRowUpdatedEventArgs))
- handler(this, (SqlRowUpdatedEventArgs) value);
- }
-
- protected override void OnRowUpdating (RowUpdatingEventArgs value)
- {
- SqlRowUpdatingEventHandler handler = (SqlRowUpdatingEventHandler) Events[EventRowUpdating];
- if ((handler != null) && (value is SqlRowUpdatingEventArgs))
- handler(this, (SqlRowUpdatingEventArgs) value);
- }
-
- #endregion // Methods
-
- #region Events and Delegates
-
- public event SqlRowUpdatedEventHandler RowUpdated {
- add { Events.AddHandler (EventRowUpdated, value); }
- remove { Events.RemoveHandler (EventRowUpdated, value); }
- }
-
- public event SqlRowUpdatingEventHandler RowUpdating {
- add { Events.AddHandler (EventRowUpdating, value); }
- remove { Events.RemoveHandler (EventRowUpdating, value); }
- }
-
- #endregion // Events and Delegates
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
deleted file mode 100644
index 28d0e1bc4e7..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
+++ /dev/null
@@ -1,422 +0,0 @@
-//
-// System.Data.SqlClient.SqlDataReader.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_SqlDataReader
-
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-
-namespace System.Data.SqlClient {
- /// <summary>
- /// Provides a means of reading one or more forward-only streams
- /// of result sets obtained by executing a command
- /// at a SQL database.
- /// </summary>
- //public sealed class SqlDataReader : MarshalByRefObject,
- // IEnumerable, IDataReader, IDisposable, IDataRecord
- public sealed class SqlDataReader : IEnumerable,
- IDataReader, IDataRecord {
- #region Fields
-
- private SqlCommand cmd;
- private DataTable table = null;
-
- // columns in a row
- private object[] fields; // data value in a .NET type
- private string[] types; // PostgreSQL Type
- private bool[] isNull; // is NULL?
- private int[] actualLength; // ActualLength of data
- private DbType[] dbTypes; // DB data type
- // actucalLength = -1 is variable-length
-
- private bool open = false;
- IntPtr pgResult; // PGresult
- private int rows;
- private int cols;
-
- private int recordsAffected = -1; // TODO: get this value
-
- private int currentRow = -1; // no Read() has been done yet
-
- #endregion // Fields
-
- #region Constructors
-
- internal SqlDataReader (SqlCommand sqlCmd) {
-
- cmd = sqlCmd;
- open = true;
- cmd.OpenReader(this);
- }
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Close() {
- open = false;
-
- // free SqlDataReader resources in SqlCommand
- // and allow SqlConnection to be used again
- cmd.CloseReader();
-
- // TODO: get parameters from result
-
- // clear unmanaged PostgreSQL result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- [MonoTODO]
- public DataTable GetSchemaTable() {
- return table;
- }
-
- [MonoTODO]
- public bool NextResult() {
- SqlResult res;
- currentRow = -1;
- bool resultReturned;
-
- // reset
- table = null;
- pgResult = IntPtr.Zero;
- rows = 0;
- cols = 0;
- types = null;
- recordsAffected = -1;
-
- res = cmd.NextResult();
- resultReturned = res.ResultReturned;
-
- if(resultReturned == true) {
- table = res.Table;
- pgResult = res.PgResult;
- rows = res.RowCount;
- cols = res.FieldCount;
- types = res.PgTypes;
- recordsAffected = res.RecordsAffected;
- }
-
- res = null;
- return resultReturned;
- }
-
- [MonoTODO]
- public bool Read() {
-
- string dataValue;
- int c = 0;
-
- if(currentRow < rows - 1) {
-
- currentRow++;
-
- // re-init row
- fields = new object[cols];
- //dbTypes = new DbType[cols];
- actualLength = new int[cols];
- isNull = new bool[cols];
-
- for(c = 0; c < cols; c++) {
-
- // get data value
- dataValue = PostgresLibrary.
- PQgetvalue(
- pgResult,
- currentRow, c);
-
- // is column NULL?
- //isNull[c] = PostgresLibrary.
- // PQgetisnull(pgResult,
- // currentRow, c);
-
- // get Actual Length
- actualLength[c] = PostgresLibrary.
- PQgetlength(pgResult,
- currentRow, c);
-
- DbType dbType;
- dbType = PostgresHelper.
- TypnameToSqlDbType(types[c]);
-
- if(dataValue == null) {
- fields[c] = null;
- isNull[c] = true;
- }
- else if(dataValue.Equals("")) {
- fields[c] = null;
- isNull[c] = true;
- }
- else {
- isNull[c] = false;
- fields[c] = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- dataValue);
- }
- }
- return true;
- }
- return false; // EOF
- }
-
- [MonoTODO]
- public byte GetByte(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetBytes(int i, long fieldOffset,
- byte[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public char GetChar(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetChars(int i, long fieldOffset,
- char[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IDataReader GetData(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string GetDataTypeName(int i) {
- return types[i];
- }
-
- [MonoTODO]
- public DateTime GetDateTime(int i) {
- return (DateTime) fields[i];
- }
-
- [MonoTODO]
- public decimal GetDecimal(int i) {
- return (decimal) fields[i];
- }
-
- [MonoTODO]
- public double GetDouble(int i) {
- return (double) fields[i];
- }
-
- [MonoTODO]
- public Type GetFieldType(int i) {
-
- DataRow row = table.Rows[i];
- return Type.GetType((string)row["DataType"]);
- }
-
- [MonoTODO]
- public float GetFloat(int i) {
- return (float) fields[i];
- }
-
- [MonoTODO]
- public Guid GetGuid(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public short GetInt16(int i) {
- return (short) fields[i];
- }
-
- [MonoTODO]
- public int GetInt32(int i) {
- return (int) fields[i];
- }
-
- [MonoTODO]
- public long GetInt64(int i) {
- return (long) fields[i];
- }
-
- [MonoTODO]
- public string GetName(int i) {
-
- DataRow row = table.Rows[i];
- return (string) row["ColumnName"];
- }
-
- [MonoTODO]
- public int GetOrdinal(string name) {
-
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(((string) row["ColumnName"]).Equals(name))
- return i;
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return i;
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
-
- [MonoTODO]
- public string GetString(int i) {
- return (string) fields[i];
- }
-
- [MonoTODO]
- public object GetValue(int i) {
- return fields[i];
- }
-
- [MonoTODO]
- public int GetValues(object[] values)
- {
- Array.Copy (fields, values, fields.Length);
- return fields.Length;
- }
-
- [MonoTODO]
- public bool IsDBNull(int i) {
- return isNull[i];
- }
-
- [MonoTODO]
- public bool GetBoolean(int i) {
- return (bool) fields[i];
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose () {
- }
-
- //[MonoTODO]
- //~SqlDataReader() {
- //}
-
- #endregion // Destructors
-
- #region Properties
-
- public int Depth {
- [MonoTODO]
- get {
- return 0; // always return zero, unless
- // this provider will allow
- // nesting of a row
- }
- }
-
- public bool IsClosed {
- [MonoTODO]
- get {
- if(open == false)
- return true;
- else
- return false;
- }
- }
-
- public int RecordsAffected {
- [MonoTODO]
- get {
- return recordsAffected;
- }
- }
-
- public int FieldCount {
- [MonoTODO]
- get {
- return cols;
- }
- }
-
- public object this[string name] {
- [MonoTODO]
- get {
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(row["ColumnName"].Equals(name))
- return fields[i];
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return fields[i];
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
- }
-
- public object this[int i] {
- [MonoTODO]
- get {
- return fields[i];
- }
- }
-
- #endregion // Properties
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlError.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlError.cs
deleted file mode 100644
index e7c722285a9..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlError.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// System.Data.SqlClient.SqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class SqlError
- {
- byte theClass = 0;
- int lineNumber = 0;
- string message = "";
- int number = 0;
- string procedure = "";
- string server = "";
- string source = "";
- byte state = 0;
-
- internal SqlError(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
- this.theClass = theClass;
- this.lineNumber = lineNumber;
- this.message = message;
- this.number = number;
- this.procedure = procedure;
- this.server = server;
- this.source = source;
- this.state = state;
- }
-
- #region Properties
-
- [MonoTODO]
- /// <summary>
- /// severity level of the error
- /// </summary>
- public byte Class {
- get {
- return theClass;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- return lineNumber;
- }
- }
-
- [MonoTODO]
- public string Message {
- get {
- return message;
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- return number;
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- return procedure;
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- return server;
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- return source;
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- return state;
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString ()
- {
- String toStr;
- String stackTrace;
- stackTrace = " <Stack Trace>";
- // FIXME: generate the correct SQL error string
- toStr = "SqlError:" + message + stackTrace;
- return toStr;
- }
-
- internal void SetClass(byte theClass) {
- this.theClass = theClass;
- }
-
- internal void SetLineNumber(int lineNumber) {
- this.lineNumber = lineNumber;
- }
-
- internal void SetMessage(string message) {
- this.message = message;
- }
-
- internal void SetNumber(int number) {
- this.number = number;
- }
-
- internal void SetProcedure(string procedure) {
- this.procedure = procedure;
- }
-
- internal void SetServer(string server) {
- this.server = server;
- }
-
- internal void SetSource(string source) {
- this.source = source;
- }
-
- internal void SetState(byte state) {
- this.state = state;
- }
-
- #endregion
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs
deleted file mode 100644
index 7050d5d08fa..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// System.Data.SqlClient.SqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-using System;
-using System.Collections;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class SqlErrorCollection : ICollection, IEnumerable
- {
- ArrayList errorList = new ArrayList();
-
- internal SqlErrorCollection() {
- }
-
- internal SqlErrorCollection(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public int Count {
- get {
- return errorList.Count;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index) {
- throw new NotImplementedException ();
- }
-
- // [MonoTODO]
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- // [MonoTODO]
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- // Index property (indexer)
- // [MonoTODO]
- public SqlError this[int index] {
- get {
- return (SqlError) errorList[index];
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString()
- {
- throw new NotImplementedException ();
- }
- #endregion
-
- internal void Add(SqlError error) {
- errorList.Add(error);
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- SqlError error = new SqlError(theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- Add(error);
- }
-
- #region Destructors
-
- [MonoTODO]
- ~SqlErrorCollection()
- {
- // FIXME: do the destructor - release resources
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlException.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlException.cs
deleted file mode 100644
index e447b599372..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlException.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// System.Data.SqlClient.SqlException.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc
-//
-using System;
-using System.Data;
-using System.Runtime.Serialization;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Exceptions, as returned by SQL databases.
- /// </summary>
- public sealed class SqlException : SystemException
- {
- private SqlErrorCollection errors;
-
- internal SqlException()
- : base("a SQL Exception has occurred") {
- errors = new SqlErrorCollection();
- }
-
- internal SqlException(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state)
- : base(message) {
-
- errors = new SqlErrorCollection (theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public byte Class {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- else
- return errors[0].Class;
- }
-
- set {
- errors[0].SetClass(value);
- }
- }
-
- [MonoTODO]
- public SqlErrorCollection Errors {
- get {
- return errors;
- }
-
- set {
- errors = value;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- return errors[0].LineNumber;
- }
-
- set {
- errors[0].SetLineNumber(value);
- }
- }
-
- [MonoTODO]
- public override string Message {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else {
- String msg = "";
- int i = 0;
-
- for(i = 0; i < errors.Count - 1; i++) {
- msg = msg + errors[i].Message + "\n";
- }
- msg = msg + errors[i].Message;
-
- return msg;
- }
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].Number;
- }
-
- set {
- errors[0].SetNumber(value);
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Procedure;
- }
-
- set {
- errors[0].SetProcedure(value);
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Server;
- }
-
- set {
- errors[0].SetServer(value);
- }
- }
-
- [MonoTODO]
- public override string Source {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Source;
- }
-
- set {
- errors[0].SetSource(value);
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].State;
- }
-
- set {
- errors[0].SetState(value);
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public override void GetObjectData(SerializationInfo si,
- StreamingContext context) {
- // FIXME: to do
- }
-
- // [Serializable]
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- public override string ToString() {
- String toStr = "";
- for (int i = 0; i < errors.Count; i++) {
- toStr = toStr + errors[i].ToString() + "\n";
- }
- return toStr;
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- errors.Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- [MonoTODO]
- ~SqlException() {
- // FIXME: destructor to release resources
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs
deleted file mode 100644
index df69dff1d35..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Data.SqlClient.SqlInfoMessageEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlInfoMessageEventArgs : EventArgs
- {
- [MonoTODO]
- public SqlErrorCollection Errors {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Message
- {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- // representation of InfoMessage event
- return "'ToString() for SqlInfoMessageEventArgs Not Implemented'";
- }
-
- //[MonoTODO]
- //~SqlInfoMessageEventArgs() {
- // FIXME: destructor needs to release resources
- //}
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs
deleted file mode 100644
index c9862d61c03..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Data.SqlClient.SqlInfoMessageEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void
- SqlInfoMessageEventHandler (object sender,
- SqlInfoMessageEventArgs e);
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameter.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameter.cs
deleted file mode 100644
index f79dad0dbfb..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameter.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// System.Data.SqlClient.SqlParameter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a parameter to a Command object, and optionally,
- /// its mapping to DataSet columns; and is implemented by .NET
- /// data providers that access data sources.
- /// </summary>
- //public sealed class SqlParameter : MarshalByRefObject,
- // IDbDataParameter, IDataParameter, ICloneable
- public sealed class SqlParameter : IDbDataParameter, IDataParameter
- {
- private string parmName;
- private SqlDbType dbtype;
- private DbType theDbType;
- private object objValue;
- private int size;
- private string sourceColumn;
- private ParameterDirection direction;
- private bool isNullable;
- private byte precision;
- private byte scale;
- private DataRowVersion sourceVersion;
- private int offset;
-
- [MonoTODO]
- public SqlParameter () {
-
- }
-
- [MonoTODO]
- public SqlParameter (string parameterName, object value) {
- this.parmName = parameterName;
- this.objValue = value;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType) {
- this.parmName = parameterName;
- this.dbtype = dbType;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size, string sourceColumn) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size, ParameterDirection direction,
- bool isNullable, byte precision,
- byte scale, string sourceColumn,
- DataRowVersion sourceVersion, object value) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- this.direction = direction;
- this.isNullable = isNullable;
- this.precision = precision;
- this.scale = scale;
- this.sourceVersion = sourceVersion;
- this.objValue = value;
- }
-
- [MonoTODO]
- public DbType DbType {
- get {
- return theDbType;
- }
- set {
- theDbType = value;
- }
- }
-
- [MonoTODO]
- public ParameterDirection Direction {
- get {
- return direction;
- }
- set {
- direction = value;
- }
- }
-
- [MonoTODO]
- public bool IsNullable {
- get {
- return isNullable;
- }
- }
-
- [MonoTODO]
- public int Offset {
- get {
- return offset;
- }
-
- set {
- offset = value;
- }
- }
-
- [MonoTODO]
- public string ParameterName {
- get {
- return parmName;
- }
-
- set {
- parmName = value;
- }
- }
-
- [MonoTODO]
- public string SourceColumn {
- get {
- return sourceColumn;
- }
-
- set {
- sourceColumn = value;
- }
- }
-
- [MonoTODO]
- public DataRowVersion SourceVersion {
- get {
- return sourceVersion;
- }
-
- set {
- sourceVersion = value;
- }
- }
-
- [MonoTODO]
- public SqlDbType SqlDbType {
- get {
- return dbtype;
- }
-
- set {
- dbtype = value;
- }
- }
-
- [MonoTODO]
- public object Value {
- get {
- return objValue;
- }
-
- set {
- objValue = value;
- }
- }
-
- [MonoTODO]
- public byte Precision {
- get {
- return precision;
- }
-
- set {
- precision = value;
- }
- }
-
- [MonoTODO]
- public byte Scale {
- get {
- return scale;
- }
-
- set {
- scale = value;
- }
- }
-
- [MonoTODO]
- public int Size
- {
- get {
- return size;
- }
-
- set {
- size = value;
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- return parmName;
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs
deleted file mode 100644
index 1ccfae90c9a..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// System.Data.SqlClient.SqlParameterCollection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Collects all parameters relevant to a Command object
- /// and their mappings to DataSet columns.
- /// </summary>
- // public sealed class SqlParameterCollection : MarshalByRefObject,
- // IDataParameterCollection, IList, ICollection, IEnumerable
- public sealed class SqlParameterCollection : IDataParameterCollection
- {
- private ArrayList parameterList = new ArrayList();
- private Hashtable parameterNames = new Hashtable();
-
-/*
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int IndexOf(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- public bool Contains(string parameterName)
- {
- return parameterNames.ContainsKey(parameterName);
- }
-*/
-
- [MonoTODO]
- public IEnumerator GetEnumerator()
- {
- throw new NotImplementedException ();
- }
-
-
- public int Add( object value)
- {
- // Call the add version that receives a SqlParameter
-
- // Check if value is a SqlParameter.
- CheckType(value);
- Add((SqlParameter) value);
-
- return IndexOf (value);
- }
-
-
- public SqlParameter Add(SqlParameter value)
- {
- parameterList.Add(value);
- parameterNames.Add(value.ParameterName, parameterList.Add(value));
- return value;
- }
-
-
- public SqlParameter Add(string parameterName, object value)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.Value = value;
- // TODO: Get the dbtype and Sqldbtype from system type of value.
-
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName, SqlDbType sqlDbType)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size, string sourceColumn)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- sqlparam.SourceColumn = sourceColumn;
- return Add(sqlparam);
- }
-
- [MonoTODO]
- public void Clear()
- {
- throw new NotImplementedException ();
- }
-
-
- public bool Contains(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return Contains(((SqlParameter)value).ParameterName);
- }
-
-
- [MonoTODO]
- public bool Contains(string value)
- {
- return parameterNames.ContainsKey(value);
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
-
- public int IndexOf(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return IndexOf(((SqlParameter)value).ParameterName);
- }
-
-
- public int IndexOf(string parameterName)
- {
- return parameterList.IndexOf(parameterName);
- }
-
- [MonoTODO]
- public void Insert(int index, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove(object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Count {
- get {
- return parameterList.Count;
- }
- }
-
- object IList.this[int index] {
- [MonoTODO]
- get {
- return (SqlParameter) this[index];
- }
-
- [MonoTODO]
- set {
- this[index] = (SqlParameter) value;
- }
- }
-
- public SqlParameter this[int index] {
- get {
- return (SqlParameter) parameterList[index];
- }
-
- set {
- parameterList[index] = (SqlParameter) value;
- }
- }
-
- object IDataParameterCollection.this[string parameterName] {
- [MonoTODO]
- get {
- return (SqlParameter) this[parameterName];
- }
-
- [MonoTODO]
- set {
- this[parameterName] = (SqlParameter) value;
- }
- }
-
- public SqlParameter this[string parameterName] {
- get {
- if(parameterNames.ContainsKey(parameterName))
- return (SqlParameter) parameterList[(int)parameterNames[parameterName]];
- else
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
-
- set {
- if(parameterNames.ContainsKey(parameterName))
- parameterList[(int)parameterNames[parameterName]] = (SqlParameter) value;
- else
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
- }
-
- bool IList.IsFixedSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool IList.IsReadOnly {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// This method checks if the parameter value is of
- /// SqlParameter type. If it doesn't, throws an InvalidCastException.
- /// </summary>
- private void CheckType(object value)
- {
- if(!(value is SqlParameter))
- throw new InvalidCastException("Only SQLParameter objects can be used.");
- }
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs
deleted file mode 100644
index dbc5789aa95..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatedEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient {
- public sealed class SqlRowUpdatedEventArgs : RowUpdatedEventArgs
- {
- [MonoTODO]
- public SqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new SqlCommand Command {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- ~SqlRowUpdatedEventArgs ()
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs
deleted file mode 100644
index 8cad2f1cbca..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatedEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void SqlRowUpdatedEventHandler(object sender,
- SqlRowUpdatedEventArgs e);
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs
deleted file mode 100644
index 6194ca1f95d..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatingEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlRowUpdatingEventArgs : RowUpdatingEventArgs
- {
- [MonoTODO]
- public SqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new SqlCommand Command {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- ~SqlRowUpdatingEventArgs()
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs
deleted file mode 100644
index 69c0228534d..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatingEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void SqlRowUpdatingEventHandler(object sender,
- SqlRowUpdatingEventArgs e);
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs
deleted file mode 100644
index 3a485b299c5..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// System.Data.SqlClient.SqlTransaction.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-// use #define DEBUG_SqlTransaction if you want to spew debug messages
-// #define DEBUG_SqlTransaction
-
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a transaction to be performed on a SQL database.
- /// </summary>
- // public sealed class SqlTransaction : MarshalByRefObject,
- // IDbTransaction, IDisposable
- public sealed class SqlTransaction : IDbTransaction
- {
- #region Fields
-
- private bool doingTransaction = false;
- private SqlConnection conn = null;
- private IsolationLevel isolationLevel =
- IsolationLevel.ReadCommitted;
- // There are only two IsolationLevel's for PostgreSQL:
- // ReadCommitted and Serializable,
- // but ReadCommitted is the default
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Commit ()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Commit transaction.");
-
- SqlCommand cmd = new SqlCommand("COMMIT", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- [MonoTODO]
- public void Rollback()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Rollback transaction.");
-
- SqlCommand cmd = new SqlCommand("ROLLBACK", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- // For PostgreSQL, Rollback(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Rollback(string transactionName) {
- // throw new NotImplementedException ();
- Rollback();
- }
-
- // For PostgreSQL, Save(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Save (string savePointName) {
- // throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Internal Methods to System.Data.dll Assembly
-
- internal void Begin()
- {
- if(doingTransaction == true)
- throw new InvalidOperationException(
- "Transaction has begun " +
- "and PostgreSQL does not " +
- "support nested transactions.");
-
- SqlCommand cmd = new SqlCommand("BEGIN", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = true;
- }
-
- internal void SetIsolationLevel(IsolationLevel isoLevel)
- {
- String sSql = "SET TRANSACTION ISOLATION LEVEL ";
-
- switch (isoLevel)
- {
- case IsolationLevel.ReadCommitted:
- sSql += "READ COMMITTED";
- break;
-
- case IsolationLevel.Serializable:
- sSql += "SERIALIZABLE";
- break;
-
- default:
- // FIXME: generate exception here
- // PostgreSQL only supports:
- // ReadCommitted or Serializable
- break;
- }
- SqlCommand cmd = new SqlCommand(sSql, conn);
- cmd.ExecuteNonQuery();
-
- this.isolationLevel = isoLevel;
- }
-
- internal void SetConnection(SqlConnection connection)
- {
- this.conn = connection;
- }
-
- #endregion // Internal Methods to System.Data.dll Assembly
-
- #region Properties
-
- IDbConnection IDbTransaction.Connection {
- get {
- return Connection;
- }
- }
-
- public SqlConnection Connection {
- get {
- return conn;
- }
- }
-
- public IsolationLevel IsolationLevel {
- get {
- return isolationLevel;
- }
- }
-
- internal bool DoingTransaction {
- get {
- return doingTransaction;
- }
- }
-
- #endregion Properties
-
- #region Destructors
-
- // Destructors aka Finalize and Dispose
-
- [MonoTODO]
- public void Dispose()
- {
- // FIXME: need to properly release resources
- // Dispose(true);
- }
-
- // Destructor
- [MonoTODO]
- // [Serializable]
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- ~SqlTransaction() {
- // FIXME: need to properly release resources
- // Dispose(false);
- }
-
- #endregion // Destructors
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresLibrary.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresLibrary.cs
deleted file mode 100644
index 493afcd49e2..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresLibrary.cs
+++ /dev/null
@@ -1,475 +0,0 @@
-//
-// System.Data.SqlClient.PostgresLibrary.cs
-//
-// PInvoke methods to libpq
-// which is PostgreSQL client library
-//
-// May also contain enumerations,
-// data types, or wrapper methods.
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_PostgresLibrary
-
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Collections;
-
-namespace System.Data.SqlClient {
-
- /* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
-
- internal enum ConnStatusType
- {
- CONNECTION_OK,
- CONNECTION_BAD,
- CONNECTION_STARTED,
- CONNECTION_MADE,
- CONNECTION_AWAITING_RESPONSE,
- CONNECTION_AUTH_OK,
- CONNECTION_SETENV
- }
-
- internal enum PostgresPollingStatusType
- {
- PGRES_POLLING_FAILED = 0,
- PGRES_POLLING_READING,
- PGRES_POLLING_WRITING,
- PGRES_POLLING_OK,
- PGRES_POLLING_ACTIVE
- }
-
- internal enum ExecStatusType
- {
- PGRES_EMPTY_QUERY = 0,
- PGRES_COMMAND_OK,
- PGRES_TUPLES_OK,
- PGRES_COPY_OUT,
- PGRES_COPY_IN,
- PGRES_BAD_RESPONSE,
- PGRES_NONFATAL_ERROR,
- PGRES_FATAL_ERROR
- }
-
- sealed internal class PostgresLibrary
- {
- #region PInvoke Functions
-
- // pinvoke prototypes to PostgreSQL client library
- // pq.dll on windows and libpq.so on linux
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectStart (string conninfo);
- // PGconn *PQconnectStart(const char *conninfo);
-
- [DllImport("pq")]
- public static extern PostgresPollingStatusType PQconnectPoll (IntPtr conn);
- // PostgresPollingStatusType PQconnectPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectdb (string conninfo);
- // PGconn *PQconnectdb(const char *conninfo);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetdbLogin (string pghost,
- string pgport, string pgoptions,
- string pgtty, string dbName,
- string login, string pwd);
- // PGconn *PQsetdbLogin(const char *pghost,
- // const char *pgport, const char *pgoptions,
- // const char *pgtty, const char *dbName,
- // const char *login, const char *pwd);
-
- [DllImport("pq")]
- public static extern void PQfinish (IntPtr conn);
- // void PQfinish(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconndefaults ();
- // PQconninfoOption *PQconndefaults(void);
-
- [DllImport("pq")]
- public static extern void PQconninfoFree (IntPtr connOptions);
- // void PQconninfoFree(PQconninfoOption *connOptions);
-
- [DllImport("pq")]
- public static extern int PQresetStart (IntPtr conn);
- // int PQresetStart(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQresetPoll (IntPtr conn);
- // PostgresPollingStatusType PQresetPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQreset (IntPtr conn);
- // void PQreset(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQrequestCancel (IntPtr conn);
- // int PQrequestCancel(PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQdb (IntPtr conn);
- // char *PQdb(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQuser (IntPtr conn);
- // char *PQuser(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQpass (IntPtr conn);
- // char *PQpass(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQhost (IntPtr conn);
- // char *PQhost(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQport (IntPtr conn);
- // char *PQport(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQtty (IntPtr conn);
- // char *PQtty(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQoptions (IntPtr conn);
- // char *PQoptions(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern ConnStatusType PQstatus (IntPtr conn);
- // ConnStatusType PQstatus(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQerrorMessage (IntPtr conn);
- // char *PQerrorMessage(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsocket (IntPtr conn);
- // int PQsocket(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQbackendPID (IntPtr conn);
- // int PQbackendPID(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQclientEncoding (IntPtr conn);
- // int PQclientEncoding(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetClientEncoding (IntPtr conn,
- string encoding);
- // int PQsetClientEncoding(PGconn *conn,
- // const char *encoding);
-
- //FIXME: when loading, causes runtime exception
- //[DllImport("pq")]
- //public static extern IntPtr PQgetssl (IntPtr conn);
- // SSL *PQgetssl(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQtrace (IntPtr conn,
- IntPtr debug_port);
- // void PQtrace(PGconn *conn,
- // FILE *debug_port);
-
- [DllImport("pq")]
- public static extern void PQuntrace (IntPtr conn);
- // void PQuntrace(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetNoticeProcessor (IntPtr conn,
- IntPtr proc, IntPtr arg);
- // PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
- // PQnoticeProcessor proc, void *arg);
-
- [DllImport("pq")]
- public static extern int PQescapeString (string to,
- string from, int length);
- // size_t PQescapeString(char *to,
- // const char *from, size_t length);
-
- [DllImport("pq")]
- public static extern string PQescapeBytea (string bintext,
- int binlen, IntPtr bytealen);
- // unsigned char *PQescapeBytea(unsigned char *bintext,
- // size_t binlen, size_t *bytealen);
-
- [DllImport("pq")]
- public static extern IntPtr PQexec (IntPtr conn,
- string query);
- // PGresult *PQexec(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQnotifies (IntPtr conn);
- // PGnotify *PQnotifies(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQfreeNotify (IntPtr notify);
- // void PQfreeNotify(PGnotify *notify);
-
- [DllImport("pq")]
- public static extern int PQsendQuery (IntPtr conn,
- string query);
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQgetResult (IntPtr conn);
- // PGresult *PQgetResult(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQisBusy (IntPtr conn);
- // int PQisBusy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQconsumeInput (IntPtr conn);
- // int PQconsumeInput(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQgetline (IntPtr conn,
- string str, int length);
- // int PQgetline(PGconn *conn,
- // char *string, int length);
-
- [DllImport("pq")]
- public static extern int PQputline (IntPtr conn,
- string str);
- // int PQputline(PGconn *conn,
- // const char *string);
-
- [DllImport("pq")]
- public static extern int PQgetlineAsync (IntPtr conn,
- string buffer, int bufsize);
- // int PQgetlineAsync(PGconn *conn, char *buffer,
- // int bufsize);
-
- [DllImport("pq")]
- public static extern int PQputnbytes (IntPtr conn,
- string buffer, int nbytes);
- // int PQputnbytes(PGconn *conn,
- //const char *buffer, int nbytes);
-
- [DllImport("pq")]
- public static extern int PQendcopy (IntPtr conn);
- // int PQendcopy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetnonblocking (IntPtr conn,
- int arg);
- // int PQsetnonblocking(PGconn *conn, int arg);
-
- [DllImport("pq")]
- public static extern int PQisnonblocking (IntPtr conn);
- // int PQisnonblocking(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQflush (IntPtr conn);
- // int PQflush(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQfn (IntPtr conn, int fnid,
- IntPtr result_buf, IntPtr result_len,
- int result_is_int, IntPtr args,
- int nargs);
- // PGresult *PQfn(PGconn *conn, int fnid,
- // int *result_buf, int *result_len,
- // int result_is_int, const PQArgBlock *args,
- // int nargs);
-
- [DllImport("pq")]
- public static extern ExecStatusType PQresultStatus (IntPtr res);
- // ExecStatusType PQresultStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQresStatus (ExecStatusType status);
- // char *PQresStatus(ExecStatusType status);
-
- [DllImport("pq")]
- public static extern string PQresultErrorMessage (IntPtr res);
- // char *PQresultErrorMessage(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQntuples (IntPtr res);
- // int PQntuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQnfields (IntPtr res);
- // int PQnfields(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQbinaryTuples (IntPtr res);
- // int PQbinaryTuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQfname (IntPtr res,
- int field_num);
- // char *PQfname(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfnumber (IntPtr res,
- string field_name);
- // int PQfnumber(const PGresult *res,
- // const char *field_name);
-
- [DllImport("pq")]
- public static extern int PQftype (IntPtr res,
- int field_num);
- // Oid PQftype(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfsize (IntPtr res,
- int field_num);
- // int PQfsize(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfmod (IntPtr res, int field_num);
- // int PQfmod(const PGresult *res, int field_num);
-
- [DllImport("pq")]
- public static extern string PQcmdStatus (IntPtr res);
- // char *PQcmdStatus(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQoidStatus (IntPtr res);
- // char *PQoidStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQoidValue (IntPtr res);
- // Oid PQoidValue(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQcmdTuples (IntPtr res);
- // char *PQcmdTuples(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQgetvalue (IntPtr res,
- int tup_num, int field_num);
- // char *PQgetvalue(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetlength (IntPtr res,
- int tup_num, int field_num);
- // int PQgetlength(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetisnull (IntPtr res,
- int tup_num, int field_num);
- // int PQgetisnull(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern void PQclear (IntPtr res);
- // void PQclear(PGresult *res);
-
- [DllImport("pq")]
- public static extern IntPtr PQmakeEmptyPGresult (IntPtr conn,
- IntPtr status);
- // PGresult *PQmakeEmptyPGresult(PGconn *conn,
- // ExecStatusType status);
-
- [DllImport("pq")]
- public static extern void PQprint (IntPtr fout,
- IntPtr res, IntPtr ps);
- // void PQprint(FILE *fout,
- // const PGresult *res, const PQprintOpt *ps);
-
- [DllImport("pq")]
- public static extern void PQdisplayTuples (IntPtr res,
- IntPtr fp, int fillAlign, string fieldSep,
- int printHeader, int quiet);
- // void PQdisplayTuples(const PGresult *res,
- // FILE *fp, int fillAlign, const char *fieldSep,
- // int printHeader, int quiet);
-
- [DllImport("pq")]
- public static extern void PQprintTuples (IntPtr res,
- IntPtr fout, int printAttName, int terseOutput,
- int width);
- // void PQprintTuples(const PGresult *res,
- // FILE *fout, int printAttName, int terseOutput,
- // int width);
-
- [DllImport("pq")]
- public static extern int lo_open (IntPtr conn,
- int lobjId, int mode);
- // int lo_open(PGconn *conn,
- // Oid lobjId, int mode);
-
- [DllImport("pq")]
- public static extern int lo_close (IntPtr conn, int fd);
- // int lo_close(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_read (IntPtr conn,
- int fd, string buf, int len);
- // int lo_read(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_write (IntPtr conn,
- int fd, string buf, int len);
- // int lo_write(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_lseek (IntPtr conn,
- int fd, int offset, int whence);
- // int lo_lseek(PGconn *conn,
- // int fd, int offset, int whence);
-
- [DllImport("pq")]
- public static extern int lo_creat (IntPtr conn,
- int mode);
- // Oid lo_creat(PGconn *conn,
- // int mode);
-
- [DllImport("pq")]
- public static extern int lo_tell (IntPtr conn, int fd);
- // int lo_tell(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_unlink (IntPtr conn,
- int lobjId);
- // int lo_unlink(PGconn *conn,
- // Oid lobjId);
-
- [DllImport("pq")]
- public static extern int lo_import (IntPtr conn,
- string filename);
- // Oid lo_import(PGconn *conn,
- // const char *filename);
-
- [DllImport("pq")]
- public static extern int lo_export (IntPtr conn,
- int lobjId, string filename);
- // int lo_export(PGconn *conn,
- // Oid lobjId, const char *filename);
-
- [DllImport("pq")]
- public static extern int PQmblen (string s,
- int encoding);
- // int PQmblen(const unsigned char *s,
- // int encoding);
-
- [DllImport("pq")]
- public static extern int PQenv2encoding ();
- // int PQenv2encoding(void);
-
- #endregion
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresTypes.cs b/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresTypes.cs
deleted file mode 100644
index 6a086a82a42..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PostgresTypes.cs
+++ /dev/null
@@ -1,512 +0,0 @@
-//
-// PostgresTypes.cs - holding methods to convert
-// between PostgreSQL types and .NET types
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-// Note: this might become PostgresType and PostgresTypeCollection
-// also, the PostgresTypes that exist as an inner internal class
-// within SqlConnection maybe moved here in the future
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-using System.Data.SqlClient;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- internal struct PostgresType {
- public int oid;
- public string typname;
- public DbType dbType;
- }
-
- sealed internal class PostgresHelper {
-
- // translates the PostgreSQL typname to System.Data.DbType
- public static DbType TypnameToSqlDbType(string typname) {
- DbType sqlType;
-
- // FIXME: use hashtable here?
-
- switch(typname) {
-
- case "abstime":
- sqlType = DbType.Int32;
- break;
-
- case "aclitem":
- sqlType = DbType.String;
- break;
-
- case "bit":
- sqlType = DbType.String;
- break;
-
- case "bool":
- sqlType = DbType.Boolean;
- break;
-
- case "box":
- sqlType = DbType.String;
- break;
-
- case "bpchar":
- sqlType = DbType.String;
- break;
-
- case "bytea":
- sqlType = DbType.String;
- break;
-
- case "char":
- sqlType = DbType.String;
- break;
-
- case "cidr":
- sqlType = DbType.String;
- break;
-
- case "circle":
- sqlType = DbType.String;
- break;
-
- case "date":
- sqlType = DbType.Date;
- break;
-
- case "float4":
- sqlType = DbType.Single;
- break;
-
- case "float8":
- sqlType = DbType.Double;
- break;
-
- case "inet":
- sqlType = DbType.String;
- break;
-
- case "int2":
- sqlType = DbType.Int16;
- break;
-
- case "int4":
- sqlType = DbType.Int32;
- break;
-
- case "int8":
- sqlType = DbType.Int64;
- break;
-
- case "interval":
- sqlType = DbType.String;
- break;
-
- case "line":
- sqlType = DbType.String;
- break;
-
- case "lseg":
- sqlType = DbType.String;
- break;
-
- case "macaddr":
- sqlType = DbType.String;
- break;
-
- case "money":
- sqlType = DbType.Decimal;
- break;
-
- case "name":
- sqlType = DbType.String;
- break;
-
- case "numeric":
- sqlType = DbType.Decimal;
- break;
-
- case "oid":
- sqlType = DbType.Int32;
- break;
-
- case "path":
- sqlType = DbType.String;
- break;
-
- case "point":
- sqlType = DbType.String;
- break;
-
- case "polygon":
- sqlType = DbType.String;
- break;
-
- case "refcursor":
- sqlType = DbType.String;
- break;
-
- case "reltime":
- sqlType = DbType.String;
- break;
-
- case "text":
- sqlType = DbType.String;
- break;
-
- case "time":
- sqlType = DbType.Time;
- break;
-
- case "timestamp":
- sqlType = DbType.DateTime;
- break;
-
- case "timestamptz":
- sqlType = DbType.DateTime;
- break;
-
- case "timetz":
- sqlType = DbType.DateTime;
- break;
-
- case "tinterval":
- sqlType = DbType.String;
- break;
-
- case "varbit":
- sqlType = DbType.String;
- break;
-
- case "varchar":
- sqlType = DbType.String;
- break;
-
- default:
- sqlType = DbType.String;
- break;
- }
- return sqlType;
- }
-
- // Converts data value from database to .NET System type.
- public static object ConvertDbTypeToSystem (DbType typ, String value) {
- object obj = null;
-
- // FIXME: more types need
- // to be converted
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- // FIXME: need to handle a NULL for each type
- // maybe setting obj to System.DBNull.Value ?
-
-
- if(value == null) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is null");
- return null;
- }
- else if(value.Equals("")) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is string empty");
- return null;
- }
-
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value: " + value);
-
- // Date, Time, and DateTime
- // are parsed based on ISO format
- // "YYYY-MM-DD hh:mi:ss.ms"
-
- switch(typ) {
- case DbType.String:
- obj = String.Copy(value);
- break;
- case DbType.Boolean:
- obj = value.Equals("t");
- break;
- case DbType.Int16:
- obj = Int16.Parse(value);
- break;
- case DbType.Int32:
- obj = Int32.Parse(value);
- break;
- case DbType.Int64:
- obj = Int64.Parse(value);
- break;
- case DbType.Decimal:
- obj = Decimal.Parse(value);
- break;
- case DbType.Single:
- obj = Single.Parse(value);
- break;
- case DbType.Double:
- obj = Double.Parse(value);
- break;
- case DbType.Date:
- String[] sd = value.Split(new Char[] {'-'});
- obj = new DateTime(
- Int32.Parse(sd[0]), Int32.Parse(sd[1]), Int32.Parse(sd[2]),
- 0,0,0);
- break;
- case DbType.Time:
- String[] st = value.Split(new Char[] {':'});
- obj = new DateTime(0001,01,01,
- Int32.Parse(st[0]),Int32.Parse(st[1]),Int32.Parse(st[2]));
- break;
- case DbType.DateTime:
- Int32 YYYY,MM,DD,hh,mi,ss,ms;
- YYYY = Int32.Parse(value.Substring(0,4));
- MM = Int32.Parse(value.Substring(5,2));
- DD = Int32.Parse(value.Substring(8,2));
- hh = Int32.Parse(value.Substring(11,2));
- mi = Int32.Parse(value.Substring(14,2));
- ss = Int32.Parse(value.Substring(17,2));
- ms = Int32.Parse(value.Substring(20,2));
- obj = new DateTime(YYYY,MM,DD,hh,mi,ss,ms);
- break;
- default:
- obj = String.Copy(value);
- break;
- }
-
- return obj;
- }
-
- // Translates System.Data.DbType to System.Type
- public static Type DbTypeToSystemType (DbType dType) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- Type typ = null;
-
- switch(dType) {
- case DbType.String:
- typ = typeof(String);
- break;
- case DbType.Boolean:
- typ = typeof(Boolean);
- break;
- case DbType.Int16:
- typ = typeof(Int16);
- break;
- case DbType.Int32:
- typ = typeof(Int32);
- break;
- case DbType.Int64:
- typ = typeof(Int64);
- break;
- case DbType.Decimal:
- typ = typeof(Decimal);
- break;
- case DbType.Single:
- typ = typeof(Single);
- break;
- case DbType.Double:
- typ = typeof(Double);
- break;
- case DbType.Date:
- case DbType.Time:
- case DbType.DateTime:
- typ = typeof(DateTime);
- break;
- default:
- typ = typeof(String);
- break;
- }
- return typ;
- }
-
- // Find DbType for oid
- // which requires a look up of PostgresTypes
- // DbType <-> typname <-> oid
- public static string OidToTypname (int oid, ArrayList pgTypes) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- string typname = "text"; // default
- int i;
- for(i = 0; i < pgTypes.Count; i++) {
- PostgresType pt = (PostgresType) pgTypes[i];
- if(pt.oid == oid) {
- typname = pt.typname;
- break;
- }
- }
-
- return typname;
- }
-
- // Convert a .NET System value type (Int32, String, Boolean, etc)
- // to a string that can be included within a SQL statement.
- // This is to methods provides the parameters support
- // for the PostgreSQL .NET Data provider
- public static string ObjectToString(DbType dbtype, object obj) {
-
- // TODO: how do we handle a NULL?
- //if(isNull == true)
- // return "NULL";
-
- string s;
-
- // Date, Time, and DateTime are expressed in ISO format
- // which is "YYYY-MM-DD hh:mm:ss.ms";
- DateTime dt;
- StringBuilder sb;
-
- const string zero = "0";
-
- switch(dbtype) {
- case DbType.String:
- s = "'" + obj + "'";
- break;
- case DbType.Boolean:
- if((bool)obj == true)
- s = "'t'";
- else
- s = "'f'";
- break;
- case DbType.Int16:
- s = obj.ToString();
- break;
- case DbType.Int32:
- s = obj.ToString();
- break;
- case DbType.Int64:
- s = obj.ToString();
- break;
- case DbType.Decimal:
- s = obj.ToString();
- break;
- case DbType.Single:
- s = obj.ToString();
- break;
- case DbType.Double:
- s = obj.ToString();
- break;
- case DbType.Date:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // year
- if(dt.Year < 10)
- sb.Append("000" + dt.Year);
- else if(dt.Year < 100)
- sb.Append("00" + dt.Year);
- else if(dt.Year < 1000)
- sb.Append("0" + dt.Year);
- else
- sb.Append(dt.Year);
- sb.Append("-");
- // month
- if(dt.Month < 10)
- sb.Append(zero + dt.Month);
- else
- sb.Append(dt.Month);
- sb.Append("-");
- // day
- if(dt.Day < 10)
- sb.Append(zero + dt.Day);
- else
- sb.Append(dt.Day);
- sb.Append('\'');
- s = sb.ToString();
- break;
- case DbType.Time:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // hour
- if(dt.Hour < 10)
- sb.Append(zero + dt.Hour);
- else
- sb.Append(dt.Hour);
- sb.Append(":");
- // minute
- if(dt.Minute < 10)
- sb.Append(zero + dt.Minute);
- else
- sb.Append(dt.Minute);
- sb.Append(":");
- // second
- if(dt.Second < 10)
- sb.Append(zero + dt.Second);
- else
- sb.Append(dt.Second);
- sb.Append('\'');
- s = sb.ToString();
- break;
- case DbType.DateTime:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // year
- if(dt.Year < 10)
- sb.Append("000" + dt.Year);
- else if(dt.Year < 100)
- sb.Append("00" + dt.Year);
- else if(dt.Year < 1000)
- sb.Append("0" + dt.Year);
- else
- sb.Append(dt.Year);
- sb.Append("-");
- // month
- if(dt.Month < 10)
- sb.Append(zero + dt.Month);
- else
- sb.Append(dt.Month);
- sb.Append("-");
- // day
- if(dt.Day < 10)
- sb.Append(zero + dt.Day);
- else
- sb.Append(dt.Day);
- sb.Append(" ");
- // hour
- if(dt.Hour < 10)
- sb.Append(zero + dt.Hour);
- else
- sb.Append(dt.Hour);
- sb.Append(":");
- // minute
- if(dt.Minute < 10)
- sb.Append(zero + dt.Minute);
- else
- sb.Append(dt.Minute);
- sb.Append(":");
- // second
- if(dt.Second < 10)
- sb.Append(zero + dt.Second);
- else
- sb.Append(dt.Second);
- sb.Append(".");
- // millisecond
- if(dt.Millisecond < 10)
- sb.Append(zero + dt.Millisecond);
- else
- sb.Append(dt.Millisecond);
- sb.Append('\'');
- s = sb.ToString();
- break;
- default:
- // default to DbType.String
- s = "'" + obj + "'";
- break;
- }
- return s;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/ParmUtil.cs b/mcs/class/Mono.Data.PostgreSqlClient/ParmUtil.cs
deleted file mode 100644
index 3dabac7853e..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/ParmUtil.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-//
-// ParmUtil.cs - utility to bind variables in a SQL statement to parameters in C# code
-// This is in the PostgreSQL .NET Data provider in Mono
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-// comment DEBUG_ParmUtil for production, for debug messages, uncomment
-//#define DEBUG_ParmUtil
-
-using System;
-using System.Data;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- enum PostgresBindVariableCharacter {
- Semicolon,
- At,
- QuestionMark
- }
-
- public class ParmUtil {
-
- private string sql = "";
- private string resultSql = "";
- private SqlParameterCollection parmsCollection = null;
-
- static private PostgresBindVariableCharacter PgbindChar = PostgresBindVariableCharacter.Semicolon;
- static char bindChar;
-
- // static constructor
- static ParmUtil() {
- switch(PgbindChar) {
- case PostgresBindVariableCharacter.Semicolon:
- bindChar = ':';
- break;
- case PostgresBindVariableCharacter.At:
- bindChar = '@';
- break;
- case PostgresBindVariableCharacter.QuestionMark:
- // this doesn't have named parameters,
- // they must be in order
- bindChar = '?';
- break;
- }
- }
-
- public ParmUtil(string query, SqlParameterCollection parms) {
- sql = query;
- parmsCollection = parms;
- }
-
- public string ResultSql {
- get {
- return resultSql;
- }
- }
-
- // TODO: currently only works for input variables,
- // need to do input/output, output, and return
- public string ReplaceWithParms() {
-
- StringBuilder result = new StringBuilder();
- char[] chars = sql.ToCharArray();
- bool bStringConstFound = false;
-
- for(int i = 0; i < chars.Length; i++) {
- if(chars[i] == '\'') {
- if(bStringConstFound == true)
- bStringConstFound = false;
- else
- bStringConstFound = true;
-
- result.Append(chars[i]);
- }
- else if(chars[i] == bindChar &&
- bStringConstFound == false) {
-#if DEBUG_ParmUtil
- Console.WriteLine("Bind Variable character found...");
-#endif
- StringBuilder parm = new StringBuilder();
- i++;
- while(i <= chars.Length) {
- char ch;
- if(i == chars.Length)
- ch = ' '; // a space
- else
- ch = chars[i];
-
-#if DEBUG_ParmUtil
- Console.WriteLine("Is char Letter or digit?");
-#endif
- if(Char.IsLetterOrDigit(ch)) {
-#if DEBUG_ParmUtil
- Console.WriteLine("Char IS letter or digit. " +
- "Now, append char to parm StringBuilder");
-#endif
- parm.Append(ch);
- }
- else {
-#if DEBUG_ParmUtil
- Console.WriteLine("Char is NOT letter or char. " +
- "thus we got rest of bind variable name. ");
-
- // replace bind variable placeholder
- // with data value constant
- Console.WriteLine("parm StringBuilder to string p...");
-#endif
- string p = parm.ToString();
-#if DEBUG_ParmUtil
- Console.WriteLine("calling BindReplace...");
-#endif
- bool found = BindReplace(result, p);
-#if DEBUG_ParmUtil
- Console.WriteLine(" Found = " + found);
-#endif
- if(found == true)
- break;
- else {
- // *** Error Handling
- Console.WriteLine("Error: parameter not found: " + p);
- return "";
- }
- }
- i++;
- }
- i--;
- }
- else
- result.Append(chars[i]);
- }
-
- resultSql = result.ToString();
- return resultSql;
- }
-
- public bool BindReplace (StringBuilder result, string p) {
- // bind variable
- bool found = false;
-
-#if DEBUG_ParmUtil
- Console.WriteLine("Does the parmsCollection contain the parameter???: " + p);
-#endif
- if(parmsCollection.Contains(p) == true) {
- // parameter found
-#if DEBUG_ParmUtil
- Console.WriteLine("Parameter Found: " + p);
-#endif
- SqlParameter prm = parmsCollection[p];
-
-#if DEBUG_ParmUtil
- // DEBUG
- Console.WriteLine(" Value: " + prm.Value);
- Console.WriteLine(" Direction: " + prm.Direction);
-#endif
- // convert object to string and place
- // into SQL
- if(prm.Direction == ParameterDirection.Input) {
- string strObj = PostgresHelper.
- ObjectToString(prm.DbType,
- prm.Value);
- result.Append(strObj);
- }
- else
- result.Append(bindChar + p);
-
- found = true;
- }
- return found;
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs
deleted file mode 100644
index 20b9e02a6d0..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermission.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermission.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
- public sealed class SqlClientPermission : DBDataPermission {
-
- [MonoTODO]
- public SqlClientPermission() {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public SqlClientPermission(PermissionState state) {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public SqlClientPermission(PermissionState state,
- bool allowBlankPassword) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Copy() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void FromXml(SecurityElement
- securityElement) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Intersect(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool IsSubsetOf(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override SecurityElement ToXml() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Union(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ~SqlClientPermission() {
- // FIXME: destructor to release resources
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs
deleted file mode 100644
index 149613c5f2e..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlClientPermissionAttribute.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
- [AttributeUsage(AttributeTargets.Assembly |
- AttributeTargets.Class |
- AttributeTargets.Struct |
- AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class SqlClientPermissionAttribute :
- DBDataPermissionAttribute {
-
- [MonoTODO]
- public SqlClientPermissionAttribute(SecurityAction action) :
- base(action)
- {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public override IPermission CreatePermission() {
- throw new NotImplementedException ();
- }
-
- //[MonoTODO]
- //~SqlClientPermissionAttribute() {
- // // FIXME: destructor to release resources
- //}
- }
-
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommand.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
deleted file mode 100644
index af2771c3fa2..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
+++ /dev/null
@@ -1,928 +0,0 @@
-//
-// System.Data.SqlClient.SqlCommand.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002 http://www.ximian.com/
-// (C) Daniel Morgan, 2002
-// (C) Copyright 2002 Tim Coleman
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// use #define DEBUG_SqlCommand if you want to spew debug messages
-// #define DEBUG_SqlCommand
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-namespace System.Data.SqlClient {
- /// <summary>
- /// Represents a SQL statement that is executed
- /// while connected to a SQL database.
- /// </summary>
- // public sealed class SqlCommand : Component, IDbCommand, ICloneable
- public sealed class SqlCommand : IDbCommand {
-
- #region Fields
-
- private string sql = "";
- private int timeout = 30;
- // default is 30 seconds
- // for command execution
-
- private SqlConnection conn = null;
- private SqlTransaction trans = null;
- private CommandType cmdType = CommandType.Text;
- private bool designTime = false;
- private SqlParameterCollection parmCollection = new
- SqlParameterCollection();
-
- // SqlDataReader state data for ExecuteReader()
- private SqlDataReader dataReader = null;
- private string[] queries = null;
- private int currentQuery = -1;
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- private ParmUtil parmUtil = null;
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlCommand() {
- sql = "";
- }
-
- public SqlCommand (string cmdText) {
- sql = cmdText;
- }
-
- public SqlCommand (string cmdText, SqlConnection connection) {
- sql = cmdText;
- conn = connection;
- }
-
- public SqlCommand (string cmdText, SqlConnection connection,
- SqlTransaction transaction) {
- sql = cmdText;
- conn = connection;
- trans = transaction;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- [MonoTODO]
- public void Cancel () {
- // FIXME: use non-blocking Exec for this
- throw new NotImplementedException ();
- }
-
- // FIXME: is this the correct way to return a stronger type?
- [MonoTODO]
- IDbDataParameter IDbCommand.CreateParameter () {
- return CreateParameter ();
- }
-
- [MonoTODO]
- public SqlParameter CreateParameter () {
- return new SqlParameter ();
- }
-
- public int ExecuteNonQuery () {
- IntPtr pgResult; // PGresult
- int rowsAffected = -1;
- ExecStatusType execStatus;
- String rowsAffectedString;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK ||
- execStatus == ExecStatusType.PGRES_TUPLES_OK ) {
-
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
-
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
-
- return rowsAffected;
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader () {
- return ExecuteReader ();
- }
-
- [MonoTODO]
- public SqlDataReader ExecuteReader () {
- return ExecuteReader(CommandBehavior.Default);
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader (
- CommandBehavior behavior) {
- return ExecuteReader (behavior);
- }
-
- [MonoTODO]
- public SqlDataReader ExecuteReader (CommandBehavior behavior)
- {
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- cmdBehavior = behavior;
-
- queries = null;
- currentQuery = -1;
- dataReader = new SqlDataReader(this);
-
- queries = sql.Split(new Char[] {';'});
-
- dataReader.NextResult();
-
- return dataReader;
- }
-
- internal SqlResult NextResult()
- {
- SqlResult res = new SqlResult();
- res.Connection = this.Connection;
- res.Behavior = cmdBehavior;
- string statement;
-
- currentQuery++;
-
- res.CurrentQuery = currentQuery;
-
- if(currentQuery < queries.Length && queries[currentQuery].Equals("") == false) {
- res.SQL = queries[currentQuery];
- statement = TweakQuery(queries[currentQuery], cmdType);
- ExecuteQuery(statement, res);
- res.ResultReturned = true;
- }
- else {
- res.ResultReturned = false;
- }
-
- return res;
- }
-
- private string TweakQuery(string query, CommandType commandType) {
- string statement = "";
- StringBuilder td;
-
-#if DEBUG_SqlCommand
- Console.WriteLine("---------[][] TweakQuery() [][]--------");
- Console.WriteLine("CommandType: " + commandType + " CommandBehavior: " + cmdBehavior);
- Console.WriteLine("SQL before command type: " + query);
-#endif
- // finish building SQL based on CommandType
- switch(commandType) {
- case CommandType.Text:
- statement = query;
- break;
- case CommandType.StoredProcedure:
- statement =
- "SELECT " + query + "()";
- break;
- case CommandType.TableDirect:
- // NOTE: this is for the PostgreSQL provider
- // and for OleDb, according to the docs,
- // an exception is thrown if you try to use
- // this with SqlCommand
- string[] directTables = query.Split(
- new Char[] {','});
-
- td = new StringBuilder("SELECT * FROM ");
-
- for(int tab = 0; tab < directTables.Length; tab++) {
- if(tab > 0)
- td.Append(',');
- td.Append(directTables[tab]);
- // FIXME: if multipe tables, how do we
- // join? based on Primary/Foreign Keys?
- // Otherwise, a Cartesian Product happens
- }
- statement = td.ToString();
- break;
- default:
- // FIXME: throw an exception?
- statement = query;
- break;
- }
-#if DEBUG_SqlCommand
- Console.WriteLine("SQL after command type: " + statement);
-#endif
- // TODO: this parameters utility
- // currently only support input variables
- // need todo output, input/output, and return.
-#if DEBUG_SqlCommand
- Console.WriteLine("using ParmUtil in TweakQuery()...");
-#endif
- parmUtil = new ParmUtil(statement, parmCollection);
-#if DEBUG_SqlCommand
- Console.WriteLine("ReplaceWithParms...");
-#endif
-
- statement = parmUtil.ReplaceWithParms();
-
-#if DEBUG_SqlCommand
- Console.WriteLine("SQL after ParmUtil: " + statement);
-#endif
- return statement;
- }
-
- private void ExecuteQuery (string query, SqlResult res)
- {
- IntPtr pgResult;
-
- ExecStatusType execStatus;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- res.ExecStatus = execStatus;
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK ||
- execStatus == ExecStatusType.PGRES_COMMAND_OK) {
-
- res.BuildTableSchema(pgResult);
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
- }
-
- // since SqlCommand has resources so SqlDataReader
- // can do Read() and NextResult(), need to free
- // those resources. Also, need to allow this SqlCommand
- // and this SqlConnection to do things again.
- internal void CloseReader() {
- dataReader = null;
- queries = null;
-
- if((cmdBehavior & CommandBehavior.CloseConnection) == CommandBehavior.CloseConnection) {
- conn.CloseReader(true);
- }
- else {
- conn.CloseReader(false);
- }
- }
-
- // only meant to be used between SqlConnectioin,
- // SqlCommand, and SqlDataReader
- internal void OpenReader(SqlDataReader reader) {
- conn.OpenReader(reader);
- }
-
- /// <summary>
- /// ExecuteScalar is used to retrieve one object
- /// from one result set
- /// that has one row and one column.
- /// It is lightweight compared to ExecuteReader.
- /// </summary>
- [MonoTODO]
- public object ExecuteScalar () {
- IntPtr pgResult; // PGresult
- ExecStatusType execStatus;
- object obj = null; // return
- int nRow = 0; // first row
- int nCol = 0; // first column
- String value;
- int nRows;
- int nFields;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK) {
- // result was a SQL Command
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- return null; // return null reference
- }
- else if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- // result was a SQL Query
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- if(nRows > 0 && nFields > 0) {
-
- // get column name
- //String fieldName;
- //fieldName = PostgresLibrary.
- // PQfname(pgResult, nCol);
-
- int oid;
- string sType;
- DbType dbType;
- // get PostgreSQL data type (OID)
- oid = PostgresLibrary.
- PQftype(pgResult, nCol);
- sType = PostgresHelper.
- OidToTypname (oid, conn.Types);
- dbType = PostgresHelper.
- TypnameToSqlDbType(sType);
-
- int definedSize;
- // get defined size of column
- definedSize = PostgresLibrary.
- PQfsize(pgResult, nCol);
-
- // get data value
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- nRow, nCol);
-
- int columnIsNull;
- // is column NULL?
- columnIsNull = PostgresLibrary.
- PQgetisnull(pgResult,
- nRow, nCol);
-
- int actualLength;
- // get Actual Length
- actualLength = PostgresLibrary.
- PQgetlength(pgResult,
- nRow, nCol);
-
- obj = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- value);
- }
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
-
- return obj;
- }
-
- [MonoTODO]
- public XmlReader ExecuteXmlReader () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Prepare () {
- // FIXME: parameters have to be implemented for this
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand Clone () {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
-
- #region Properties
-
- public string CommandText {
- get {
- return sql;
- }
-
- set {
- sql = value;
- }
- }
-
- public int CommandTimeout {
- get {
- return timeout;
- }
-
- set {
- // FIXME: if value < 0, throw
- // ArgumentException
- // if (value < 0)
- // throw ArgumentException;
- timeout = value;
- }
- }
-
- public CommandType CommandType {
- get {
- return cmdType;
- }
-
- set {
- cmdType = value;
- }
- }
-
- // FIXME: for property Connection, is this the correct
- // way to handle a return of a stronger type?
- IDbConnection IDbCommand.Connection {
- get {
- return Connection;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during a
- // transaction in progress
-
- // csc
- Connection = (SqlConnection) value;
- // mcs
- // Connection = value;
-
- // FIXME: set Transaction property to null
- }
- }
-
- public SqlConnection Connection {
- get {
- // conn defaults to null
- return conn;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during
- // a transaction in progress
- conn = value;
- // FIXME: set Transaction property to null
- }
- }
-
- public bool DesignTimeVisible {
- get {
- return designTime;
- }
-
- set{
- designTime = value;
- }
- }
-
- // FIXME; for property Parameters, is this the correct
- // way to handle a stronger return type?
- IDataParameterCollection IDbCommand.Parameters {
- get {
- return Parameters;
- }
- }
-
- public SqlParameterCollection Parameters {
- get {
- return parmCollection;
- }
- }
-
- // FIXME: for property Transaction, is this the correct
- // way to handle a return of a stronger type?
- IDbTransaction IDbCommand.Transaction {
- get {
- return Transaction;
- }
-
- set {
- // FIXME: error handling - do not allow
- // setting of transaction if transaction
- // has already begun
-
- // csc
- Transaction = (SqlTransaction) value;
- // mcs
- // Transaction = value;
- }
- }
-
- public SqlTransaction Transaction {
- get {
- return trans;
- }
-
- set {
- // FIXME: error handling
- trans = value;
- }
- }
-
- [MonoTODO]
- public UpdateRowSource UpdatedRowSource {
- // FIXME: do this once DbDataAdaptor
- // and DataRow are done
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Inner Classes
-
- #endregion // Inner Classes
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose() {
- // FIXME: need proper way to release resources
- // Dispose(true);
- }
-
- [MonoTODO]
- ~SqlCommand() {
- // FIXME: need proper way to release resources
- // Dispose(false);
- }
-
- #endregion //Destructors
- }
-
- // SqlResult is used for passing Result Set data
- // from SqlCommand to SqlDataReader
- internal class SqlResult {
-
- private DataTable dataTableSchema = null; // only will contain the schema
- private IntPtr pg_result = IntPtr.Zero; // native PostgreSQL PGresult
- private int rowCount = 0;
- private int fieldCount = 0;
- private string[] pgtypes = null; // PostgreSQL types (typname)
- private bool resultReturned = false;
- private SqlConnection con = null;
- private int rowsAffected = -1;
- private ExecStatusType execStatus = ExecStatusType.PGRES_FATAL_ERROR;
- private int currentQuery = -1;
- private string sql = "";
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- internal CommandBehavior Behavior {
- get {
- return cmdBehavior;
- }
- set {
- cmdBehavior = value;
- }
- }
-
- internal string SQL {
- get {
- return sql;
- }
- set {
- sql = value;
- }
- }
-
- internal ExecStatusType ExecStatus {
- get {
- return execStatus;
- }
- set {
- execStatus = value;
- }
- }
-
- internal int CurrentQuery {
- get {
- return currentQuery;
- }
-
- set {
- currentQuery = value;
- }
-
- }
-
- internal SqlConnection Connection {
- get {
- return con;
- }
-
- set {
- con = value;
- }
- }
-
- internal int RecordsAffected {
- get {
- return rowsAffected;
- }
- }
-
- internal bool ResultReturned {
- get {
- return resultReturned;
- }
- set {
- resultReturned = value;
- }
- }
-
- internal DataTable Table {
- get {
- return dataTableSchema;
- }
- }
-
- internal IntPtr PgResult {
- get {
- return pg_result;
- }
- }
-
- internal int RowCount {
- get {
- return rowCount;
- }
- }
-
- internal int FieldCount {
- get {
- return fieldCount;
- }
- }
-
- internal string[] PgTypes {
- get {
- return pgtypes;
- }
- }
-
- internal void BuildTableSchema (IntPtr pgResult) {
- pg_result = pgResult;
-
- // need to set IDataReader.RecordsAffected property
- string rowsAffectedString;
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- // Only Results from SQL SELECT Queries
- // get a DataTable for schema of the result
- // otherwise, DataTable is null reference
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
-
- dataTableSchema = new DataTable ();
- dataTableSchema.Columns.Add ("ColumnName", typeof (string));
- dataTableSchema.Columns.Add ("ColumnOrdinal", typeof (int));
- dataTableSchema.Columns.Add ("ColumnSize", typeof (int));
- dataTableSchema.Columns.Add ("NumericPrecision", typeof (int));
- dataTableSchema.Columns.Add ("NumericScale", typeof (int));
- dataTableSchema.Columns.Add ("IsUnique", typeof (bool));
- dataTableSchema.Columns.Add ("IsKey", typeof (bool));
- DataColumn dc = dataTableSchema.Columns["IsKey"];
- dc.AllowDBNull = true; // IsKey can have a DBNull
- dataTableSchema.Columns.Add ("BaseCatalogName", typeof (string));
- dataTableSchema.Columns.Add ("BaseColumnName", typeof (string));
- dataTableSchema.Columns.Add ("BaseSchemaName", typeof (string));
- dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
- dataTableSchema.Columns.Add ("DataType", typeof(string));
- dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (int));
- dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
- dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
- dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
- dataTableSchema.Columns.Add ("IsAutoIncrement", typeof (bool));
- dataTableSchema.Columns.Add ("IsRowVersion", typeof (bool));
- dataTableSchema.Columns.Add ("IsHidden", typeof (bool));
- dataTableSchema.Columns.Add ("IsLong", typeof (bool));
- dataTableSchema.Columns.Add ("IsReadOnly", typeof (bool));
-
- fieldCount = PostgresLibrary.PQnfields (pgResult);
- rowCount = PostgresLibrary.PQntuples(pgResult);
- pgtypes = new string[fieldCount];
-
- // TODO: for CommandBehavior.SingleRow
- // use IRow, otherwise, IRowset
- if(fieldCount > 0)
- if((cmdBehavior & CommandBehavior.SingleRow) == CommandBehavior.SingleRow)
- fieldCount = 1;
-
- // TODO: for CommandBehavior.SchemaInfo
- if((cmdBehavior & CommandBehavior.SchemaOnly) == CommandBehavior.SchemaOnly)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SingleResult
- if((cmdBehavior & CommandBehavior.SingleResult) == CommandBehavior.SingleResult)
- if(currentQuery > 0)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SequentialAccess - used for reading Large OBjects
- //if((cmdBehavior & CommandBehavior.SequentialAccess) == CommandBehavior.SequentialAccess) {
- //}
-
- DataRow schemaRow;
- int oid;
- DbType dbType;
- Type typ;
-
- for (int i = 0; i < fieldCount; i += 1 ) {
- schemaRow = dataTableSchema.NewRow ();
-
- string columnName = PostgresLibrary.PQfname (pgResult, i);
-
- schemaRow["ColumnName"] = columnName;
- schemaRow["ColumnOrdinal"] = i+1;
- schemaRow["ColumnSize"] = PostgresLibrary.PQfsize (pgResult, i);
- schemaRow["NumericPrecision"] = 0;
- schemaRow["NumericScale"] = 0;
- // TODO: need to get KeyInfo
- if((cmdBehavior & CommandBehavior.KeyInfo) == CommandBehavior.KeyInfo) {
- bool IsUnique, IsKey;
- GetKeyInfo(columnName, out IsUnique, out IsKey);
- }
- else {
- schemaRow["IsUnique"] = false;
- schemaRow["IsKey"] = DBNull.Value;
- }
- schemaRow["BaseCatalogName"] = "";
- schemaRow["BaseColumnName"] = columnName;
- schemaRow["BaseSchemaName"] = "";
- schemaRow["BaseTableName"] = "";
-
- // PostgreSQL type to .NET type stuff
- oid = PostgresLibrary.PQftype (pgResult, i);
- pgtypes[i] = PostgresHelper.OidToTypname (oid, con.Types);
- dbType = PostgresHelper.TypnameToSqlDbType (pgtypes[i]);
-
- typ = PostgresHelper.DbTypeToSystemType (dbType);
- string st = typ.ToString();
- schemaRow["DataType"] = st;
-
- schemaRow["AllowDBNull"] = false;
- schemaRow["ProviderType"] = oid;
- schemaRow["IsAliased"] = false;
- schemaRow["IsExpression"] = false;
- schemaRow["IsIdentity"] = false;
- schemaRow["IsAutoIncrement"] = false;
- schemaRow["IsRowVersion"] = false;
- schemaRow["IsHidden"] = false;
- schemaRow["IsLong"] = false;
- schemaRow["IsReadOnly"] = false;
- schemaRow.AcceptChanges();
- dataTableSchema.Rows.Add (schemaRow);
- }
-
-#if DEBUG_SqlCommand
- Console.WriteLine("********** DEBUG Table Schema BEGIN ************");
- foreach (DataRow myRow in dataTableSchema.Rows) {
- foreach (DataColumn myCol in dataTableSchema.Columns)
- Console.WriteLine(myCol.ColumnName + " = " + myRow[myCol]);
- Console.WriteLine();
- }
- Console.WriteLine("********** DEBUG Table Schema END ************");
-#endif // DEBUG_SqlCommand
-
- }
- }
-
- // TODO: how do we get the key info if
- // we don't have the tableName?
- private void GetKeyInfo(string columnName, out bool isUnique, out bool isKey) {
- isUnique = false;
- isKey = false;
-
- string sql;
-
- sql =
- "SELECT i.indkey, i.indisprimary, i.indisunique " +
- "FROM pg_class c, pg_class c2, pg_index i " +
- "WHERE c.relname = ':tableName' AND c.oid = i.indrelid " +
- "AND i.indexrelid = c2.oid ";
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs
deleted file mode 100644
index d2b028bc652..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommandBuilder.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.Data.SqlClient.SqlCommandBuilder.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.ComponentModel;
-
-namespace System.Data.SqlClient {
-
- /// <summary>
- /// Builder of one command
- /// that will be used in manipulating a table for
- /// a DataSet that is assoicated with a database.
- /// </summary>
- public sealed class SqlCommandBuilder : Component {
-
- [MonoTODO]
- public SqlCommandBuilder() {
-
- }
-
- [MonoTODO]
- public SqlCommandBuilder(SqlDataAdapter adapter) {
-
- }
-
- [MonoTODO]
- public SqlDataAdapter DataAdapter {
- get {
- throw new NotImplementedException ();
- }
-
- set{
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string QuotePrefix {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string QuoteSuffix {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static void DeriveParameters(SqlCommand command) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetDeleteCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetInsertCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetUpdateCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RefreshSchema() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override void Dispose(bool disposing) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ~SqlCommandBuilder() {
- // FIXME: create destructor - release resources
- }
- }
-}
-
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlConnection.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlConnection.cs
deleted file mode 100644
index 0bd37605cc6..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlConnection.cs
+++ /dev/null
@@ -1,722 +0,0 @@
-//
-// System.Data.SqlClient.SqlConnection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// use #define DEBUG_SqlConnection if you want to spew debug messages
-// #define DEBUG_SqlConnection
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- /// <summary>
- /// Represents an open connection to a SQL data source
- /// </summary>
- public sealed class SqlConnection : Component, IDbConnection,
- ICloneable
- {
- // FIXME: Need to implement class Component,
- // and interfaces: ICloneable and IDisposable
-
- #region Fields
-
- private PostgresTypes types = null;
- private IntPtr pgConn = IntPtr.Zero;
-
- // PGConn (Postgres Connection)
- private string connectionString = "";
- // OLE DB Connection String
- private string pgConnectionString = "";
- // PostgreSQL Connection String
- private SqlTransaction trans = null;
- private int connectionTimeout = 15;
- // default for 15 seconds
-
- // connection parameters in connection string
- private string host = "";
- // Name of host to connect to
- private string hostaddr = "";
- // IP address of host to connect to
- // should be in "n.n.n.n" format
- private string port = "";
- // Port number to connect to at the server host
- private string dbname = ""; // The database name.
- private string user = ""; // User name to connect as.
- private string password = "";
- // Password to be used if the server
- // demands password authentication.
- private string options = "";
- // Trace/debug options to be sent to the server.
- private string tty = "";
- // A file or tty for optional
- // debug output from the backend.
- private string requiressl = "";
- // Set to 1 to require
- // SSL connection to the backend.
- // Libpq will then refuse to connect
- // if the server does not
- // support SSL. Set to 0 (default) to
- // negotiate with server.
-
- // connection state
- private ConnectionState conState = ConnectionState.Closed;
-
- // DataReader state
- private SqlDataReader rdr = null;
- private bool dataReaderOpen = false;
- // FIXME: if true, throw an exception if SqlConnection
- // is used for anything other than reading
- // data using SqlDataReader
-
- private string versionString = "Unknown";
-
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- // A lot of the defaults were initialized in the Fields
- [MonoTODO]
- public SqlConnection () {
-
- }
-
- [MonoTODO]
- public SqlConnection (String connectionString) {
- SetConnectionString (connectionString);
- }
-
- #endregion // Constructors
-
- #region Destructors
-
- protected override void Dispose(bool disposing) {
- if(!this.disposed)
- try {
- if(disposing) {
- // release any managed resources
- }
- // release any unmanaged resources
- // close any handles
-
- this.disposed = true;
- }
- finally {
- base.Dispose(disposing);
- }
- }
-
- // aka Finalize()
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- [MonoTODO]
- ~SqlConnection() {
- Dispose (false);
- }
-
- #endregion // Destructors
-
- #region Public Methods
-
- IDbTransaction IDbConnection.BeginTransaction () {
- return BeginTransaction ();
- }
-
- public SqlTransaction BeginTransaction () {
- return TransactionBegin (); // call private method
- }
-
- IDbTransaction IDbConnection.BeginTransaction (IsolationLevel
- il) {
- return BeginTransaction (il);
- }
-
- public SqlTransaction BeginTransaction (IsolationLevel il) {
- return TransactionBegin (il); // call private method
- }
-
- // PostgreSQL does not support named transactions/savepoint
- // nor nested transactions
- [Obsolete]
- public SqlTransaction BeginTransaction(string transactionName) {
- return TransactionBegin (); // call private method
- }
-
- [Obsolete]
- public SqlTransaction BeginTransaction(IsolationLevel iso,
- string transactionName) {
- return TransactionBegin (iso); // call private method
- }
-
- [MonoTODO]
- public void ChangeDatabase (string databaseName) {
- throw new NotImplementedException ();
- }
-
- object ICloneable.Clone() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Close () {
- if(dataReaderOpen == true) {
- // TODO: what do I do if
- // the user Closes the connection
- // without closing the Reader first?
-
- }
- CloseDataSource ();
- }
-
- IDbCommand IDbConnection.CreateCommand () {
- return CreateCommand ();
- }
-
- public SqlCommand CreateCommand () {
- SqlCommand sqlcmd = new SqlCommand ("", this);
-
- return sqlcmd;
- }
-
- [MonoTODO]
- public void Open () {
- if(dbname.Equals(""))
- throw new InvalidOperationException(
- "dbname missing");
- else if(conState == ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is already Open");
-
- ConnStatusType connStatus;
-
- // FIXME: check to make sure we have
- // everything to connect,
- // otherwise, throw an exception
-
- pgConn = PostgresLibrary.PQconnectdb
- (pgConnectionString);
-
- // FIXME: should we use PQconnectStart/PQconnectPoll
- // instead of PQconnectdb?
- // PQconnectdb blocks
- // PQconnectStart/PQconnectPoll is non-blocking
-
- connStatus = PostgresLibrary.PQstatus (pgConn);
- if(connStatus == ConnStatusType.CONNECTION_OK) {
- // Successfully Connected
- disposed = false;
- SetupConnection();
- }
- else {
- String errorMessage = PostgresLibrary.
- PQerrorMessage (pgConn);
- errorMessage += ": Could not connect to database.";
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- host, "SqlConnection", 0);
- }
- }
-
- #endregion // Public Methods
-
- #region Internal Methods
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open.
- // Open the Reader. (called from SqlCommand)
- internal void OpenReader(SqlDataReader reader)
- {
- if(dataReaderOpen == true) {
- // TODO: throw exception here?
- // because a reader
- // is already open
- }
- else {
- rdr = reader;
- dataReaderOpen = true;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- // Close the Reader (called from SqlCommand)
- // if closeConnection true, Close() the connection
- // this is based on CommandBehavior.CloseConnection
- internal void CloseReader(bool closeConnection)
- { if(closeConnection == true)
- CloseDataSource();
- else
- dataReaderOpen = false;
- }
-
- #endregion // Internal Methods
-
- #region Private Methods
-
- private void SetupConnection() {
-
- conState = ConnectionState.Open;
-
- // FIXME: load types into hashtable
- types = new PostgresTypes(this);
- types.Load();
-
- versionString = GetDatabaseServerVersion();
-
- // set DATE style to YYYY/MM/DD
- IntPtr pgResult = IntPtr.Zero;
- pgResult = PostgresLibrary.PQexec (pgConn, "SET DATESTYLE TO 'ISO'");
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- private string GetDatabaseServerVersion()
- {
- SqlCommand cmd = new SqlCommand("select version()",this);
- return (string) cmd.ExecuteScalar();
- }
-
- private void CloseDataSource () {
- // FIXME: just a quick hack
- if(conState == ConnectionState.Open) {
- if(trans != null)
- if(trans.DoingTransaction == true) {
- trans.Rollback();
- // trans.Dispose();
- trans = null;
- }
-
- conState = ConnectionState.Closed;
- PostgresLibrary.PQfinish (pgConn);
- pgConn = IntPtr.Zero;
- }
- }
-
- private void SetConnectionString (string connectionString) {
- // FIXME: perform error checking on string
- // while translating string from
- // OLE DB format to PostgreSQL
- // connection string format
- //
- // OLE DB: "host=localhost;dbname=test;user=joe;password=smoe"
- // PostgreSQL: "host=localhost dbname=test user=joe password=smoe"
- //
- // For OLE DB, you would have the additional
- // "provider=postgresql"
- // OleDbConnection you would be using libgda
- //
- // Also, parse the connection string into properties
-
- // FIXME: if connection is open, you can
- // not set the connection
- // string, throw an exception
-
- this.connectionString = connectionString;
- pgConnectionString = ConvertStringToPostgres (
- connectionString);
-
-#if DEBUG_SqlConnection
- Console.WriteLine(
- "OLE-DB Connection String [in]: " +
- this.ConnectionString);
- Console.WriteLine(
- "Postgres Connection String [out]: " +
- pgConnectionString);
-#endif // DEBUG_SqlConnection
- }
-
- private String ConvertStringToPostgres (String
- oleDbConnectionString) {
- StringBuilder postgresConnection =
- new StringBuilder();
- string result;
- string[] connectionParameters;
-
- char[] semicolon = new Char[1];
- semicolon[0] = ';';
-
- // FIXME: what is the max number of value pairs
- // can there be for the OLE DB
- // connnection string? what about libgda max?
- // what about postgres max?
-
- // FIXME: currently assuming value pairs are like:
- // "key1=value1;key2=value2;key3=value3"
- // Need to deal with values that have
- // single or double quotes. And error
- // handling of that too.
- // "key1=value1;key2='value2';key=\"value3\""
-
- // FIXME: put the connection parameters
- // from the connection
- // string into a
- // Hashtable (System.Collections)
- // instead of using private variables
- // to store them
- connectionParameters = oleDbConnectionString.
- Split (semicolon);
- foreach (string sParameter in connectionParameters) {
- if(sParameter.Length > 0) {
- BreakConnectionParameter (sParameter);
- postgresConnection.
- Append (sParameter +
- " ");
- }
- }
- result = postgresConnection.ToString ();
- return result;
- }
-
- private bool BreakConnectionParameter (String sParameter) {
- bool addParm = true;
- int index;
-
- index = sParameter.IndexOf ("=");
- if (index > 0) {
- string parmKey, parmValue;
-
- // separate string "key=value" to
- // string "key" and "value"
- parmKey = sParameter.Substring (0, index);
- parmValue = sParameter.Substring (index + 1,
- sParameter.Length - index - 1);
-
- switch(parmKey.ToLower()) {
- case "hostaddr":
- hostaddr = parmValue;
- break;
-
- case "port":
- port = parmValue;
- break;
-
- case "host":
- // set DataSource property
- host = parmValue;
- break;
-
- case "dbname":
- // set Database property
- dbname = parmValue;
- break;
-
- case "user":
- user = parmValue;
- break;
-
- case "password":
- password = parmValue;
- // addParm = false;
- break;
-
- case "options":
- options = parmValue;
- break;
-
- case "tty":
- tty = parmValue;
- break;
-
- case "requiressl":
- requiressl = parmValue;
- break;
- }
- }
- return addParm;
- }
-
- private SqlTransaction TransactionBegin () {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new SqlTransaction ();
- // using internal methods of SqlTransaction
- trans.SetConnection (this);
- trans.Begin();
-
- return trans;
- }
-
- private SqlTransaction TransactionBegin (IsolationLevel il) {
- // FIXME: need to keep track of
- // transaction in-progress
- TransactionBegin();
- trans.SetIsolationLevel (il);
-
- return trans;
- }
-
- #endregion
-
- #region Public Properties
-
- [MonoTODO]
- public ConnectionState State {
- get {
- return conState;
- }
- }
-
- public string ConnectionString {
- get {
- return connectionString;
- }
- set {
- SetConnectionString (value);
- }
- }
-
- public int ConnectionTimeout {
- get {
- return connectionTimeout;
- }
- }
-
- public string Database {
- get {
- return dbname;
- }
- }
-
- public string DataSource {
- get {
- return host;
- }
- }
-
- public int PacketSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string ServerVersion {
- get {
- return versionString;
- }
- }
-
- #endregion // Public Properties
-
- #region Internal Properties
-
- // For System.Data.SqlClient classes
- // to get the current transaction
- // in progress - if any
- internal SqlTransaction Transaction {
- get {
- return trans;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the unmanaged PostgreSQL connection
- internal IntPtr PostgresConnection {
- get {
- return pgConn;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the list PostgreSQL types
- // so can look up based on OID to
- // get the .NET System type.
- internal ArrayList Types {
- get {
- return types.List;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- internal bool IsReaderOpen {
- get {
- return dataReaderOpen;
- }
- }
-
- #endregion // Internal Properties
-
- #region Events
-
- public event
- SqlInfoMessageEventHandler InfoMessage;
-
- public event
- StateChangeEventHandler StateChange;
-
- #endregion
-
- #region Inner Classes
-
- private class PostgresTypes {
- // TODO: create hashtable for
- // PostgreSQL types to .NET types
- // containing: oid, typname, SqlDbType
-
- private Hashtable hashTypes;
- private ArrayList pgTypes;
- private SqlConnection con;
-
- // Got this SQL with the permission from
- // the authors of libgda
- private const string SEL_SQL_GetTypes =
- "SELECT oid, typname FROM pg_type " +
- "WHERE typrelid = 0 AND typname !~ '^_' " +
- " AND typname not in ('SET', 'cid', " +
- "'int2vector', 'oidvector', 'regproc', " +
- "'smgr', 'tid', 'unknown', 'xid') " +
- "ORDER BY typname";
-
- internal PostgresTypes(SqlConnection sqlcon) {
-
- con = sqlcon;
- hashTypes = new Hashtable();
- }
-
- private void AddPgType(Hashtable types,
- string typname, DbType dbType) {
-
- PostgresType pgType = new PostgresType();
-
- pgType.typname = typname;
- pgType.dbType = dbType;
-
- types.Add(pgType.typname, pgType);
- }
-
- private void BuildTypes(IntPtr pgResult,
- int nRows, int nFields) {
-
- String value;
-
- int r;
- for(r = 0; r < nRows; r++) {
- PostgresType pgType =
- new PostgresType();
-
- // get data value (oid)
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 0);
-
- pgType.oid = Int32.Parse(value);
-
- // get data value (typname)
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 1);
- pgType.typname = String.Copy(value);
- pgType.dbType = PostgresHelper.
- TypnameToSqlDbType(
- pgType.typname);
-
- pgTypes.Add(pgType);
- }
- pgTypes = ArrayList.ReadOnly(pgTypes);
- }
-
- internal void Load() {
- pgTypes = new ArrayList();
- IntPtr pgResult = IntPtr.Zero; // PGresult
-
- if(con.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (con.PostgresConnection, SEL_SQL_GetTypes);
-
- if(pgResult.Equals(IntPtr.Zero)) {
- throw new SqlException(0, 0,
- "No Resultset from PostgreSQL", 0, "",
- con.DataSource, "SqlConnection", 0);
- }
- else {
- ExecStatusType execStatus;
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- int nRows;
- int nFields;
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- BuildTypes (pgResult, nRows, nFields);
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- con.DataSource, "SqlConnection", 0);
- }
- }
- }
-
- public ArrayList List {
- get {
- return pgTypes;
- }
- }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs
deleted file mode 100644
index 44d43068ea9..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataAdapter.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-//
-// System.Data.SqlClient.SqlDataAdapter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a set of command-related properties that are used
- /// to fill the DataSet and update a data source, all this
- /// from a SQL database.
- /// </summary>
- public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter
- {
- #region Fields
-
- SqlCommand deleteCommand;
- SqlCommand insertCommand;
- SqlCommand selectCommand;
- SqlCommand updateCommand;
-
- static readonly object EventRowUpdated = new object();
- static readonly object EventRowUpdating = new object();
-
- #endregion
-
- #region Constructors
-
- public SqlDataAdapter ()
- : this (new SqlCommand ())
- {
- }
-
- public SqlDataAdapter (SqlCommand selectCommand)
- {
- DeleteCommand = new SqlCommand ();
- InsertCommand = new SqlCommand ();
- SelectCommand = selectCommand;
- UpdateCommand = new SqlCommand ();
- }
-
- public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection)
- : this (new SqlCommand (selectCommandText, selectConnection))
- {
- }
-
- public SqlDataAdapter (string selectCommandText, string selectConnectionString)
- : this (selectCommandText, new SqlConnection (selectConnectionString))
- {
- }
-
- #endregion
-
- #region Properties
-
- public new SqlCommand DeleteCommand {
- get { return deleteCommand; }
- set { deleteCommand = value; }
- }
-
- public new SqlCommand InsertCommand {
- get { return insertCommand; }
- set { insertCommand = value; }
- }
-
- public new SqlCommand SelectCommand {
- get { return selectCommand; }
- set { selectCommand = value; }
- }
-
- public new SqlCommand UpdateCommand {
- get { return updateCommand; }
- set { updateCommand = value; }
- }
-
- IDbCommand IDbDataAdapter.DeleteCommand {
- get { return DeleteCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- DeleteCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.InsertCommand {
- get { return InsertCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- InsertCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.SelectCommand {
- get { return SelectCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- SelectCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.UpdateCommand {
- get { return UpdateCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- UpdateCommand = (SqlCommand)value;
- }
- }
-
-
- ITableMappingCollection IDataAdapter.TableMappings {
- get { return TableMappings; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new SqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
- }
-
-
- protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new SqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
- }
-
- protected override void OnRowUpdated (RowUpdatedEventArgs value)
- {
- SqlRowUpdatedEventHandler handler = (SqlRowUpdatedEventHandler) Events[EventRowUpdated];
- if ((handler != null) && (value is SqlRowUpdatedEventArgs))
- handler(this, (SqlRowUpdatedEventArgs) value);
- }
-
- protected override void OnRowUpdating (RowUpdatingEventArgs value)
- {
- SqlRowUpdatingEventHandler handler = (SqlRowUpdatingEventHandler) Events[EventRowUpdating];
- if ((handler != null) && (value is SqlRowUpdatingEventArgs))
- handler(this, (SqlRowUpdatingEventArgs) value);
- }
-
- #endregion // Methods
-
- #region Events and Delegates
-
- public event SqlRowUpdatedEventHandler RowUpdated {
- add { Events.AddHandler (EventRowUpdated, value); }
- remove { Events.RemoveHandler (EventRowUpdated, value); }
- }
-
- public event SqlRowUpdatingEventHandler RowUpdating {
- add { Events.AddHandler (EventRowUpdating, value); }
- remove { Events.RemoveHandler (EventRowUpdating, value); }
- }
-
- #endregion // Events and Delegates
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
deleted file mode 100644
index 28d0e1bc4e7..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
+++ /dev/null
@@ -1,422 +0,0 @@
-//
-// System.Data.SqlClient.SqlDataReader.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_SqlDataReader
-
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-
-namespace System.Data.SqlClient {
- /// <summary>
- /// Provides a means of reading one or more forward-only streams
- /// of result sets obtained by executing a command
- /// at a SQL database.
- /// </summary>
- //public sealed class SqlDataReader : MarshalByRefObject,
- // IEnumerable, IDataReader, IDisposable, IDataRecord
- public sealed class SqlDataReader : IEnumerable,
- IDataReader, IDataRecord {
- #region Fields
-
- private SqlCommand cmd;
- private DataTable table = null;
-
- // columns in a row
- private object[] fields; // data value in a .NET type
- private string[] types; // PostgreSQL Type
- private bool[] isNull; // is NULL?
- private int[] actualLength; // ActualLength of data
- private DbType[] dbTypes; // DB data type
- // actucalLength = -1 is variable-length
-
- private bool open = false;
- IntPtr pgResult; // PGresult
- private int rows;
- private int cols;
-
- private int recordsAffected = -1; // TODO: get this value
-
- private int currentRow = -1; // no Read() has been done yet
-
- #endregion // Fields
-
- #region Constructors
-
- internal SqlDataReader (SqlCommand sqlCmd) {
-
- cmd = sqlCmd;
- open = true;
- cmd.OpenReader(this);
- }
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Close() {
- open = false;
-
- // free SqlDataReader resources in SqlCommand
- // and allow SqlConnection to be used again
- cmd.CloseReader();
-
- // TODO: get parameters from result
-
- // clear unmanaged PostgreSQL result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- [MonoTODO]
- public DataTable GetSchemaTable() {
- return table;
- }
-
- [MonoTODO]
- public bool NextResult() {
- SqlResult res;
- currentRow = -1;
- bool resultReturned;
-
- // reset
- table = null;
- pgResult = IntPtr.Zero;
- rows = 0;
- cols = 0;
- types = null;
- recordsAffected = -1;
-
- res = cmd.NextResult();
- resultReturned = res.ResultReturned;
-
- if(resultReturned == true) {
- table = res.Table;
- pgResult = res.PgResult;
- rows = res.RowCount;
- cols = res.FieldCount;
- types = res.PgTypes;
- recordsAffected = res.RecordsAffected;
- }
-
- res = null;
- return resultReturned;
- }
-
- [MonoTODO]
- public bool Read() {
-
- string dataValue;
- int c = 0;
-
- if(currentRow < rows - 1) {
-
- currentRow++;
-
- // re-init row
- fields = new object[cols];
- //dbTypes = new DbType[cols];
- actualLength = new int[cols];
- isNull = new bool[cols];
-
- for(c = 0; c < cols; c++) {
-
- // get data value
- dataValue = PostgresLibrary.
- PQgetvalue(
- pgResult,
- currentRow, c);
-
- // is column NULL?
- //isNull[c] = PostgresLibrary.
- // PQgetisnull(pgResult,
- // currentRow, c);
-
- // get Actual Length
- actualLength[c] = PostgresLibrary.
- PQgetlength(pgResult,
- currentRow, c);
-
- DbType dbType;
- dbType = PostgresHelper.
- TypnameToSqlDbType(types[c]);
-
- if(dataValue == null) {
- fields[c] = null;
- isNull[c] = true;
- }
- else if(dataValue.Equals("")) {
- fields[c] = null;
- isNull[c] = true;
- }
- else {
- isNull[c] = false;
- fields[c] = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- dataValue);
- }
- }
- return true;
- }
- return false; // EOF
- }
-
- [MonoTODO]
- public byte GetByte(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetBytes(int i, long fieldOffset,
- byte[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public char GetChar(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetChars(int i, long fieldOffset,
- char[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IDataReader GetData(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string GetDataTypeName(int i) {
- return types[i];
- }
-
- [MonoTODO]
- public DateTime GetDateTime(int i) {
- return (DateTime) fields[i];
- }
-
- [MonoTODO]
- public decimal GetDecimal(int i) {
- return (decimal) fields[i];
- }
-
- [MonoTODO]
- public double GetDouble(int i) {
- return (double) fields[i];
- }
-
- [MonoTODO]
- public Type GetFieldType(int i) {
-
- DataRow row = table.Rows[i];
- return Type.GetType((string)row["DataType"]);
- }
-
- [MonoTODO]
- public float GetFloat(int i) {
- return (float) fields[i];
- }
-
- [MonoTODO]
- public Guid GetGuid(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public short GetInt16(int i) {
- return (short) fields[i];
- }
-
- [MonoTODO]
- public int GetInt32(int i) {
- return (int) fields[i];
- }
-
- [MonoTODO]
- public long GetInt64(int i) {
- return (long) fields[i];
- }
-
- [MonoTODO]
- public string GetName(int i) {
-
- DataRow row = table.Rows[i];
- return (string) row["ColumnName"];
- }
-
- [MonoTODO]
- public int GetOrdinal(string name) {
-
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(((string) row["ColumnName"]).Equals(name))
- return i;
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return i;
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
-
- [MonoTODO]
- public string GetString(int i) {
- return (string) fields[i];
- }
-
- [MonoTODO]
- public object GetValue(int i) {
- return fields[i];
- }
-
- [MonoTODO]
- public int GetValues(object[] values)
- {
- Array.Copy (fields, values, fields.Length);
- return fields.Length;
- }
-
- [MonoTODO]
- public bool IsDBNull(int i) {
- return isNull[i];
- }
-
- [MonoTODO]
- public bool GetBoolean(int i) {
- return (bool) fields[i];
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose () {
- }
-
- //[MonoTODO]
- //~SqlDataReader() {
- //}
-
- #endregion // Destructors
-
- #region Properties
-
- public int Depth {
- [MonoTODO]
- get {
- return 0; // always return zero, unless
- // this provider will allow
- // nesting of a row
- }
- }
-
- public bool IsClosed {
- [MonoTODO]
- get {
- if(open == false)
- return true;
- else
- return false;
- }
- }
-
- public int RecordsAffected {
- [MonoTODO]
- get {
- return recordsAffected;
- }
- }
-
- public int FieldCount {
- [MonoTODO]
- get {
- return cols;
- }
- }
-
- public object this[string name] {
- [MonoTODO]
- get {
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(row["ColumnName"].Equals(name))
- return fields[i];
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return fields[i];
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
- }
-
- public object this[int i] {
- [MonoTODO]
- get {
- return fields[i];
- }
- }
-
- #endregion // Properties
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlError.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlError.cs
deleted file mode 100644
index e7c722285a9..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlError.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// System.Data.SqlClient.SqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class SqlError
- {
- byte theClass = 0;
- int lineNumber = 0;
- string message = "";
- int number = 0;
- string procedure = "";
- string server = "";
- string source = "";
- byte state = 0;
-
- internal SqlError(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
- this.theClass = theClass;
- this.lineNumber = lineNumber;
- this.message = message;
- this.number = number;
- this.procedure = procedure;
- this.server = server;
- this.source = source;
- this.state = state;
- }
-
- #region Properties
-
- [MonoTODO]
- /// <summary>
- /// severity level of the error
- /// </summary>
- public byte Class {
- get {
- return theClass;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- return lineNumber;
- }
- }
-
- [MonoTODO]
- public string Message {
- get {
- return message;
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- return number;
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- return procedure;
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- return server;
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- return source;
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- return state;
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString ()
- {
- String toStr;
- String stackTrace;
- stackTrace = " <Stack Trace>";
- // FIXME: generate the correct SQL error string
- toStr = "SqlError:" + message + stackTrace;
- return toStr;
- }
-
- internal void SetClass(byte theClass) {
- this.theClass = theClass;
- }
-
- internal void SetLineNumber(int lineNumber) {
- this.lineNumber = lineNumber;
- }
-
- internal void SetMessage(string message) {
- this.message = message;
- }
-
- internal void SetNumber(int number) {
- this.number = number;
- }
-
- internal void SetProcedure(string procedure) {
- this.procedure = procedure;
- }
-
- internal void SetServer(string server) {
- this.server = server;
- }
-
- internal void SetSource(string source) {
- this.source = source;
- }
-
- internal void SetState(byte state) {
- this.state = state;
- }
-
- #endregion
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs
deleted file mode 100644
index 7050d5d08fa..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlErrorCollection.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// System.Data.SqlClient.SqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-using System;
-using System.Collections;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class SqlErrorCollection : ICollection, IEnumerable
- {
- ArrayList errorList = new ArrayList();
-
- internal SqlErrorCollection() {
- }
-
- internal SqlErrorCollection(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public int Count {
- get {
- return errorList.Count;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index) {
- throw new NotImplementedException ();
- }
-
- // [MonoTODO]
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- // [MonoTODO]
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- // Index property (indexer)
- // [MonoTODO]
- public SqlError this[int index] {
- get {
- return (SqlError) errorList[index];
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString()
- {
- throw new NotImplementedException ();
- }
- #endregion
-
- internal void Add(SqlError error) {
- errorList.Add(error);
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- SqlError error = new SqlError(theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- Add(error);
- }
-
- #region Destructors
-
- [MonoTODO]
- ~SqlErrorCollection()
- {
- // FIXME: do the destructor - release resources
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlException.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlException.cs
deleted file mode 100644
index e447b599372..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlException.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// System.Data.SqlClient.SqlException.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc
-//
-using System;
-using System.Data;
-using System.Runtime.Serialization;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Exceptions, as returned by SQL databases.
- /// </summary>
- public sealed class SqlException : SystemException
- {
- private SqlErrorCollection errors;
-
- internal SqlException()
- : base("a SQL Exception has occurred") {
- errors = new SqlErrorCollection();
- }
-
- internal SqlException(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state)
- : base(message) {
-
- errors = new SqlErrorCollection (theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public byte Class {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- else
- return errors[0].Class;
- }
-
- set {
- errors[0].SetClass(value);
- }
- }
-
- [MonoTODO]
- public SqlErrorCollection Errors {
- get {
- return errors;
- }
-
- set {
- errors = value;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- return errors[0].LineNumber;
- }
-
- set {
- errors[0].SetLineNumber(value);
- }
- }
-
- [MonoTODO]
- public override string Message {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else {
- String msg = "";
- int i = 0;
-
- for(i = 0; i < errors.Count - 1; i++) {
- msg = msg + errors[i].Message + "\n";
- }
- msg = msg + errors[i].Message;
-
- return msg;
- }
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].Number;
- }
-
- set {
- errors[0].SetNumber(value);
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Procedure;
- }
-
- set {
- errors[0].SetProcedure(value);
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Server;
- }
-
- set {
- errors[0].SetServer(value);
- }
- }
-
- [MonoTODO]
- public override string Source {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Source;
- }
-
- set {
- errors[0].SetSource(value);
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].State;
- }
-
- set {
- errors[0].SetState(value);
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public override void GetObjectData(SerializationInfo si,
- StreamingContext context) {
- // FIXME: to do
- }
-
- // [Serializable]
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- public override string ToString() {
- String toStr = "";
- for (int i = 0; i < errors.Count; i++) {
- toStr = toStr + errors[i].ToString() + "\n";
- }
- return toStr;
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- errors.Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- [MonoTODO]
- ~SqlException() {
- // FIXME: destructor to release resources
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs
deleted file mode 100644
index df69dff1d35..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventArgs.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Data.SqlClient.SqlInfoMessageEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlInfoMessageEventArgs : EventArgs
- {
- [MonoTODO]
- public SqlErrorCollection Errors {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Message
- {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- // representation of InfoMessage event
- return "'ToString() for SqlInfoMessageEventArgs Not Implemented'";
- }
-
- //[MonoTODO]
- //~SqlInfoMessageEventArgs() {
- // FIXME: destructor needs to release resources
- //}
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs
deleted file mode 100644
index c9862d61c03..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlInfoMessageEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Data.SqlClient.SqlInfoMessageEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void
- SqlInfoMessageEventHandler (object sender,
- SqlInfoMessageEventArgs e);
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameter.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameter.cs
deleted file mode 100644
index f79dad0dbfb..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameter.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// System.Data.SqlClient.SqlParameter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a parameter to a Command object, and optionally,
- /// its mapping to DataSet columns; and is implemented by .NET
- /// data providers that access data sources.
- /// </summary>
- //public sealed class SqlParameter : MarshalByRefObject,
- // IDbDataParameter, IDataParameter, ICloneable
- public sealed class SqlParameter : IDbDataParameter, IDataParameter
- {
- private string parmName;
- private SqlDbType dbtype;
- private DbType theDbType;
- private object objValue;
- private int size;
- private string sourceColumn;
- private ParameterDirection direction;
- private bool isNullable;
- private byte precision;
- private byte scale;
- private DataRowVersion sourceVersion;
- private int offset;
-
- [MonoTODO]
- public SqlParameter () {
-
- }
-
- [MonoTODO]
- public SqlParameter (string parameterName, object value) {
- this.parmName = parameterName;
- this.objValue = value;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType) {
- this.parmName = parameterName;
- this.dbtype = dbType;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size, string sourceColumn) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size, ParameterDirection direction,
- bool isNullable, byte precision,
- byte scale, string sourceColumn,
- DataRowVersion sourceVersion, object value) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- this.direction = direction;
- this.isNullable = isNullable;
- this.precision = precision;
- this.scale = scale;
- this.sourceVersion = sourceVersion;
- this.objValue = value;
- }
-
- [MonoTODO]
- public DbType DbType {
- get {
- return theDbType;
- }
- set {
- theDbType = value;
- }
- }
-
- [MonoTODO]
- public ParameterDirection Direction {
- get {
- return direction;
- }
- set {
- direction = value;
- }
- }
-
- [MonoTODO]
- public bool IsNullable {
- get {
- return isNullable;
- }
- }
-
- [MonoTODO]
- public int Offset {
- get {
- return offset;
- }
-
- set {
- offset = value;
- }
- }
-
- [MonoTODO]
- public string ParameterName {
- get {
- return parmName;
- }
-
- set {
- parmName = value;
- }
- }
-
- [MonoTODO]
- public string SourceColumn {
- get {
- return sourceColumn;
- }
-
- set {
- sourceColumn = value;
- }
- }
-
- [MonoTODO]
- public DataRowVersion SourceVersion {
- get {
- return sourceVersion;
- }
-
- set {
- sourceVersion = value;
- }
- }
-
- [MonoTODO]
- public SqlDbType SqlDbType {
- get {
- return dbtype;
- }
-
- set {
- dbtype = value;
- }
- }
-
- [MonoTODO]
- public object Value {
- get {
- return objValue;
- }
-
- set {
- objValue = value;
- }
- }
-
- [MonoTODO]
- public byte Precision {
- get {
- return precision;
- }
-
- set {
- precision = value;
- }
- }
-
- [MonoTODO]
- public byte Scale {
- get {
- return scale;
- }
-
- set {
- scale = value;
- }
- }
-
- [MonoTODO]
- public int Size
- {
- get {
- return size;
- }
-
- set {
- size = value;
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- return parmName;
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs
deleted file mode 100644
index 1ccfae90c9a..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlParameterCollection.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// System.Data.SqlClient.SqlParameterCollection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Collects all parameters relevant to a Command object
- /// and their mappings to DataSet columns.
- /// </summary>
- // public sealed class SqlParameterCollection : MarshalByRefObject,
- // IDataParameterCollection, IList, ICollection, IEnumerable
- public sealed class SqlParameterCollection : IDataParameterCollection
- {
- private ArrayList parameterList = new ArrayList();
- private Hashtable parameterNames = new Hashtable();
-
-/*
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int IndexOf(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- public bool Contains(string parameterName)
- {
- return parameterNames.ContainsKey(parameterName);
- }
-*/
-
- [MonoTODO]
- public IEnumerator GetEnumerator()
- {
- throw new NotImplementedException ();
- }
-
-
- public int Add( object value)
- {
- // Call the add version that receives a SqlParameter
-
- // Check if value is a SqlParameter.
- CheckType(value);
- Add((SqlParameter) value);
-
- return IndexOf (value);
- }
-
-
- public SqlParameter Add(SqlParameter value)
- {
- parameterList.Add(value);
- parameterNames.Add(value.ParameterName, parameterList.Add(value));
- return value;
- }
-
-
- public SqlParameter Add(string parameterName, object value)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.Value = value;
- // TODO: Get the dbtype and Sqldbtype from system type of value.
-
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName, SqlDbType sqlDbType)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size, string sourceColumn)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- sqlparam.SourceColumn = sourceColumn;
- return Add(sqlparam);
- }
-
- [MonoTODO]
- public void Clear()
- {
- throw new NotImplementedException ();
- }
-
-
- public bool Contains(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return Contains(((SqlParameter)value).ParameterName);
- }
-
-
- [MonoTODO]
- public bool Contains(string value)
- {
- return parameterNames.ContainsKey(value);
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
-
- public int IndexOf(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return IndexOf(((SqlParameter)value).ParameterName);
- }
-
-
- public int IndexOf(string parameterName)
- {
- return parameterList.IndexOf(parameterName);
- }
-
- [MonoTODO]
- public void Insert(int index, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove(object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Count {
- get {
- return parameterList.Count;
- }
- }
-
- object IList.this[int index] {
- [MonoTODO]
- get {
- return (SqlParameter) this[index];
- }
-
- [MonoTODO]
- set {
- this[index] = (SqlParameter) value;
- }
- }
-
- public SqlParameter this[int index] {
- get {
- return (SqlParameter) parameterList[index];
- }
-
- set {
- parameterList[index] = (SqlParameter) value;
- }
- }
-
- object IDataParameterCollection.this[string parameterName] {
- [MonoTODO]
- get {
- return (SqlParameter) this[parameterName];
- }
-
- [MonoTODO]
- set {
- this[parameterName] = (SqlParameter) value;
- }
- }
-
- public SqlParameter this[string parameterName] {
- get {
- if(parameterNames.ContainsKey(parameterName))
- return (SqlParameter) parameterList[(int)parameterNames[parameterName]];
- else
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
-
- set {
- if(parameterNames.ContainsKey(parameterName))
- parameterList[(int)parameterNames[parameterName]] = (SqlParameter) value;
- else
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
- }
-
- bool IList.IsFixedSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool IList.IsReadOnly {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// This method checks if the parameter value is of
- /// SqlParameter type. If it doesn't, throws an InvalidCastException.
- /// </summary>
- private void CheckType(object value)
- {
- if(!(value is SqlParameter))
- throw new InvalidCastException("Only SQLParameter objects can be used.");
- }
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs
deleted file mode 100644
index dbc5789aa95..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventArgs.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatedEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient {
- public sealed class SqlRowUpdatedEventArgs : RowUpdatedEventArgs
- {
- [MonoTODO]
- public SqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new SqlCommand Command {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- ~SqlRowUpdatedEventArgs ()
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs
deleted file mode 100644
index 8cad2f1cbca..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatedEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatedEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void SqlRowUpdatedEventHandler(object sender,
- SqlRowUpdatedEventArgs e);
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs
deleted file mode 100644
index 6194ca1f95d..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatingEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlRowUpdatingEventArgs : RowUpdatingEventArgs
- {
- [MonoTODO]
- public SqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new SqlCommand Command {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- ~SqlRowUpdatingEventArgs()
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs
deleted file mode 100644
index 69c0228534d..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlRowUpdatingEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatingEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void SqlRowUpdatingEventHandler(object sender,
- SqlRowUpdatingEventArgs e);
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs b/mcs/class/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs
deleted file mode 100644
index 3a485b299c5..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PgSqlTransaction.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// System.Data.SqlClient.SqlTransaction.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-// use #define DEBUG_SqlTransaction if you want to spew debug messages
-// #define DEBUG_SqlTransaction
-
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a transaction to be performed on a SQL database.
- /// </summary>
- // public sealed class SqlTransaction : MarshalByRefObject,
- // IDbTransaction, IDisposable
- public sealed class SqlTransaction : IDbTransaction
- {
- #region Fields
-
- private bool doingTransaction = false;
- private SqlConnection conn = null;
- private IsolationLevel isolationLevel =
- IsolationLevel.ReadCommitted;
- // There are only two IsolationLevel's for PostgreSQL:
- // ReadCommitted and Serializable,
- // but ReadCommitted is the default
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Commit ()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Commit transaction.");
-
- SqlCommand cmd = new SqlCommand("COMMIT", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- [MonoTODO]
- public void Rollback()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Rollback transaction.");
-
- SqlCommand cmd = new SqlCommand("ROLLBACK", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- // For PostgreSQL, Rollback(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Rollback(string transactionName) {
- // throw new NotImplementedException ();
- Rollback();
- }
-
- // For PostgreSQL, Save(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Save (string savePointName) {
- // throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Internal Methods to System.Data.dll Assembly
-
- internal void Begin()
- {
- if(doingTransaction == true)
- throw new InvalidOperationException(
- "Transaction has begun " +
- "and PostgreSQL does not " +
- "support nested transactions.");
-
- SqlCommand cmd = new SqlCommand("BEGIN", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = true;
- }
-
- internal void SetIsolationLevel(IsolationLevel isoLevel)
- {
- String sSql = "SET TRANSACTION ISOLATION LEVEL ";
-
- switch (isoLevel)
- {
- case IsolationLevel.ReadCommitted:
- sSql += "READ COMMITTED";
- break;
-
- case IsolationLevel.Serializable:
- sSql += "SERIALIZABLE";
- break;
-
- default:
- // FIXME: generate exception here
- // PostgreSQL only supports:
- // ReadCommitted or Serializable
- break;
- }
- SqlCommand cmd = new SqlCommand(sSql, conn);
- cmd.ExecuteNonQuery();
-
- this.isolationLevel = isoLevel;
- }
-
- internal void SetConnection(SqlConnection connection)
- {
- this.conn = connection;
- }
-
- #endregion // Internal Methods to System.Data.dll Assembly
-
- #region Properties
-
- IDbConnection IDbTransaction.Connection {
- get {
- return Connection;
- }
- }
-
- public SqlConnection Connection {
- get {
- return conn;
- }
- }
-
- public IsolationLevel IsolationLevel {
- get {
- return isolationLevel;
- }
- }
-
- internal bool DoingTransaction {
- get {
- return doingTransaction;
- }
- }
-
- #endregion Properties
-
- #region Destructors
-
- // Destructors aka Finalize and Dispose
-
- [MonoTODO]
- public void Dispose()
- {
- // FIXME: need to properly release resources
- // Dispose(true);
- }
-
- // Destructor
- [MonoTODO]
- // [Serializable]
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- ~SqlTransaction() {
- // FIXME: need to properly release resources
- // Dispose(false);
- }
-
- #endregion // Destructors
-
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PostgresLibrary.cs b/mcs/class/Mono.Data.PostgreSqlClient/PostgresLibrary.cs
deleted file mode 100644
index 493afcd49e2..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PostgresLibrary.cs
+++ /dev/null
@@ -1,475 +0,0 @@
-//
-// System.Data.SqlClient.PostgresLibrary.cs
-//
-// PInvoke methods to libpq
-// which is PostgreSQL client library
-//
-// May also contain enumerations,
-// data types, or wrapper methods.
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_PostgresLibrary
-
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Collections;
-
-namespace System.Data.SqlClient {
-
- /* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
-
- internal enum ConnStatusType
- {
- CONNECTION_OK,
- CONNECTION_BAD,
- CONNECTION_STARTED,
- CONNECTION_MADE,
- CONNECTION_AWAITING_RESPONSE,
- CONNECTION_AUTH_OK,
- CONNECTION_SETENV
- }
-
- internal enum PostgresPollingStatusType
- {
- PGRES_POLLING_FAILED = 0,
- PGRES_POLLING_READING,
- PGRES_POLLING_WRITING,
- PGRES_POLLING_OK,
- PGRES_POLLING_ACTIVE
- }
-
- internal enum ExecStatusType
- {
- PGRES_EMPTY_QUERY = 0,
- PGRES_COMMAND_OK,
- PGRES_TUPLES_OK,
- PGRES_COPY_OUT,
- PGRES_COPY_IN,
- PGRES_BAD_RESPONSE,
- PGRES_NONFATAL_ERROR,
- PGRES_FATAL_ERROR
- }
-
- sealed internal class PostgresLibrary
- {
- #region PInvoke Functions
-
- // pinvoke prototypes to PostgreSQL client library
- // pq.dll on windows and libpq.so on linux
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectStart (string conninfo);
- // PGconn *PQconnectStart(const char *conninfo);
-
- [DllImport("pq")]
- public static extern PostgresPollingStatusType PQconnectPoll (IntPtr conn);
- // PostgresPollingStatusType PQconnectPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectdb (string conninfo);
- // PGconn *PQconnectdb(const char *conninfo);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetdbLogin (string pghost,
- string pgport, string pgoptions,
- string pgtty, string dbName,
- string login, string pwd);
- // PGconn *PQsetdbLogin(const char *pghost,
- // const char *pgport, const char *pgoptions,
- // const char *pgtty, const char *dbName,
- // const char *login, const char *pwd);
-
- [DllImport("pq")]
- public static extern void PQfinish (IntPtr conn);
- // void PQfinish(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconndefaults ();
- // PQconninfoOption *PQconndefaults(void);
-
- [DllImport("pq")]
- public static extern void PQconninfoFree (IntPtr connOptions);
- // void PQconninfoFree(PQconninfoOption *connOptions);
-
- [DllImport("pq")]
- public static extern int PQresetStart (IntPtr conn);
- // int PQresetStart(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQresetPoll (IntPtr conn);
- // PostgresPollingStatusType PQresetPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQreset (IntPtr conn);
- // void PQreset(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQrequestCancel (IntPtr conn);
- // int PQrequestCancel(PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQdb (IntPtr conn);
- // char *PQdb(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQuser (IntPtr conn);
- // char *PQuser(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQpass (IntPtr conn);
- // char *PQpass(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQhost (IntPtr conn);
- // char *PQhost(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQport (IntPtr conn);
- // char *PQport(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQtty (IntPtr conn);
- // char *PQtty(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQoptions (IntPtr conn);
- // char *PQoptions(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern ConnStatusType PQstatus (IntPtr conn);
- // ConnStatusType PQstatus(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQerrorMessage (IntPtr conn);
- // char *PQerrorMessage(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsocket (IntPtr conn);
- // int PQsocket(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQbackendPID (IntPtr conn);
- // int PQbackendPID(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQclientEncoding (IntPtr conn);
- // int PQclientEncoding(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetClientEncoding (IntPtr conn,
- string encoding);
- // int PQsetClientEncoding(PGconn *conn,
- // const char *encoding);
-
- //FIXME: when loading, causes runtime exception
- //[DllImport("pq")]
- //public static extern IntPtr PQgetssl (IntPtr conn);
- // SSL *PQgetssl(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQtrace (IntPtr conn,
- IntPtr debug_port);
- // void PQtrace(PGconn *conn,
- // FILE *debug_port);
-
- [DllImport("pq")]
- public static extern void PQuntrace (IntPtr conn);
- // void PQuntrace(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetNoticeProcessor (IntPtr conn,
- IntPtr proc, IntPtr arg);
- // PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
- // PQnoticeProcessor proc, void *arg);
-
- [DllImport("pq")]
- public static extern int PQescapeString (string to,
- string from, int length);
- // size_t PQescapeString(char *to,
- // const char *from, size_t length);
-
- [DllImport("pq")]
- public static extern string PQescapeBytea (string bintext,
- int binlen, IntPtr bytealen);
- // unsigned char *PQescapeBytea(unsigned char *bintext,
- // size_t binlen, size_t *bytealen);
-
- [DllImport("pq")]
- public static extern IntPtr PQexec (IntPtr conn,
- string query);
- // PGresult *PQexec(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQnotifies (IntPtr conn);
- // PGnotify *PQnotifies(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQfreeNotify (IntPtr notify);
- // void PQfreeNotify(PGnotify *notify);
-
- [DllImport("pq")]
- public static extern int PQsendQuery (IntPtr conn,
- string query);
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQgetResult (IntPtr conn);
- // PGresult *PQgetResult(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQisBusy (IntPtr conn);
- // int PQisBusy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQconsumeInput (IntPtr conn);
- // int PQconsumeInput(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQgetline (IntPtr conn,
- string str, int length);
- // int PQgetline(PGconn *conn,
- // char *string, int length);
-
- [DllImport("pq")]
- public static extern int PQputline (IntPtr conn,
- string str);
- // int PQputline(PGconn *conn,
- // const char *string);
-
- [DllImport("pq")]
- public static extern int PQgetlineAsync (IntPtr conn,
- string buffer, int bufsize);
- // int PQgetlineAsync(PGconn *conn, char *buffer,
- // int bufsize);
-
- [DllImport("pq")]
- public static extern int PQputnbytes (IntPtr conn,
- string buffer, int nbytes);
- // int PQputnbytes(PGconn *conn,
- //const char *buffer, int nbytes);
-
- [DllImport("pq")]
- public static extern int PQendcopy (IntPtr conn);
- // int PQendcopy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetnonblocking (IntPtr conn,
- int arg);
- // int PQsetnonblocking(PGconn *conn, int arg);
-
- [DllImport("pq")]
- public static extern int PQisnonblocking (IntPtr conn);
- // int PQisnonblocking(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQflush (IntPtr conn);
- // int PQflush(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQfn (IntPtr conn, int fnid,
- IntPtr result_buf, IntPtr result_len,
- int result_is_int, IntPtr args,
- int nargs);
- // PGresult *PQfn(PGconn *conn, int fnid,
- // int *result_buf, int *result_len,
- // int result_is_int, const PQArgBlock *args,
- // int nargs);
-
- [DllImport("pq")]
- public static extern ExecStatusType PQresultStatus (IntPtr res);
- // ExecStatusType PQresultStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQresStatus (ExecStatusType status);
- // char *PQresStatus(ExecStatusType status);
-
- [DllImport("pq")]
- public static extern string PQresultErrorMessage (IntPtr res);
- // char *PQresultErrorMessage(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQntuples (IntPtr res);
- // int PQntuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQnfields (IntPtr res);
- // int PQnfields(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQbinaryTuples (IntPtr res);
- // int PQbinaryTuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQfname (IntPtr res,
- int field_num);
- // char *PQfname(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfnumber (IntPtr res,
- string field_name);
- // int PQfnumber(const PGresult *res,
- // const char *field_name);
-
- [DllImport("pq")]
- public static extern int PQftype (IntPtr res,
- int field_num);
- // Oid PQftype(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfsize (IntPtr res,
- int field_num);
- // int PQfsize(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfmod (IntPtr res, int field_num);
- // int PQfmod(const PGresult *res, int field_num);
-
- [DllImport("pq")]
- public static extern string PQcmdStatus (IntPtr res);
- // char *PQcmdStatus(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQoidStatus (IntPtr res);
- // char *PQoidStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQoidValue (IntPtr res);
- // Oid PQoidValue(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQcmdTuples (IntPtr res);
- // char *PQcmdTuples(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQgetvalue (IntPtr res,
- int tup_num, int field_num);
- // char *PQgetvalue(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetlength (IntPtr res,
- int tup_num, int field_num);
- // int PQgetlength(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetisnull (IntPtr res,
- int tup_num, int field_num);
- // int PQgetisnull(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern void PQclear (IntPtr res);
- // void PQclear(PGresult *res);
-
- [DllImport("pq")]
- public static extern IntPtr PQmakeEmptyPGresult (IntPtr conn,
- IntPtr status);
- // PGresult *PQmakeEmptyPGresult(PGconn *conn,
- // ExecStatusType status);
-
- [DllImport("pq")]
- public static extern void PQprint (IntPtr fout,
- IntPtr res, IntPtr ps);
- // void PQprint(FILE *fout,
- // const PGresult *res, const PQprintOpt *ps);
-
- [DllImport("pq")]
- public static extern void PQdisplayTuples (IntPtr res,
- IntPtr fp, int fillAlign, string fieldSep,
- int printHeader, int quiet);
- // void PQdisplayTuples(const PGresult *res,
- // FILE *fp, int fillAlign, const char *fieldSep,
- // int printHeader, int quiet);
-
- [DllImport("pq")]
- public static extern void PQprintTuples (IntPtr res,
- IntPtr fout, int printAttName, int terseOutput,
- int width);
- // void PQprintTuples(const PGresult *res,
- // FILE *fout, int printAttName, int terseOutput,
- // int width);
-
- [DllImport("pq")]
- public static extern int lo_open (IntPtr conn,
- int lobjId, int mode);
- // int lo_open(PGconn *conn,
- // Oid lobjId, int mode);
-
- [DllImport("pq")]
- public static extern int lo_close (IntPtr conn, int fd);
- // int lo_close(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_read (IntPtr conn,
- int fd, string buf, int len);
- // int lo_read(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_write (IntPtr conn,
- int fd, string buf, int len);
- // int lo_write(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_lseek (IntPtr conn,
- int fd, int offset, int whence);
- // int lo_lseek(PGconn *conn,
- // int fd, int offset, int whence);
-
- [DllImport("pq")]
- public static extern int lo_creat (IntPtr conn,
- int mode);
- // Oid lo_creat(PGconn *conn,
- // int mode);
-
- [DllImport("pq")]
- public static extern int lo_tell (IntPtr conn, int fd);
- // int lo_tell(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_unlink (IntPtr conn,
- int lobjId);
- // int lo_unlink(PGconn *conn,
- // Oid lobjId);
-
- [DllImport("pq")]
- public static extern int lo_import (IntPtr conn,
- string filename);
- // Oid lo_import(PGconn *conn,
- // const char *filename);
-
- [DllImport("pq")]
- public static extern int lo_export (IntPtr conn,
- int lobjId, string filename);
- // int lo_export(PGconn *conn,
- // Oid lobjId, const char *filename);
-
- [DllImport("pq")]
- public static extern int PQmblen (string s,
- int encoding);
- // int PQmblen(const unsigned char *s,
- // int encoding);
-
- [DllImport("pq")]
- public static extern int PQenv2encoding ();
- // int PQenv2encoding(void);
-
- #endregion
- }
-}
diff --git a/mcs/class/Mono.Data.PostgreSqlClient/PostgresTypes.cs b/mcs/class/Mono.Data.PostgreSqlClient/PostgresTypes.cs
deleted file mode 100644
index 6a086a82a42..00000000000
--- a/mcs/class/Mono.Data.PostgreSqlClient/PostgresTypes.cs
+++ /dev/null
@@ -1,512 +0,0 @@
-//
-// PostgresTypes.cs - holding methods to convert
-// between PostgreSQL types and .NET types
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-// Note: this might become PostgresType and PostgresTypeCollection
-// also, the PostgresTypes that exist as an inner internal class
-// within SqlConnection maybe moved here in the future
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-using System.Data.SqlClient;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- internal struct PostgresType {
- public int oid;
- public string typname;
- public DbType dbType;
- }
-
- sealed internal class PostgresHelper {
-
- // translates the PostgreSQL typname to System.Data.DbType
- public static DbType TypnameToSqlDbType(string typname) {
- DbType sqlType;
-
- // FIXME: use hashtable here?
-
- switch(typname) {
-
- case "abstime":
- sqlType = DbType.Int32;
- break;
-
- case "aclitem":
- sqlType = DbType.String;
- break;
-
- case "bit":
- sqlType = DbType.String;
- break;
-
- case "bool":
- sqlType = DbType.Boolean;
- break;
-
- case "box":
- sqlType = DbType.String;
- break;
-
- case "bpchar":
- sqlType = DbType.String;
- break;
-
- case "bytea":
- sqlType = DbType.String;
- break;
-
- case "char":
- sqlType = DbType.String;
- break;
-
- case "cidr":
- sqlType = DbType.String;
- break;
-
- case "circle":
- sqlType = DbType.String;
- break;
-
- case "date":
- sqlType = DbType.Date;
- break;
-
- case "float4":
- sqlType = DbType.Single;
- break;
-
- case "float8":
- sqlType = DbType.Double;
- break;
-
- case "inet":
- sqlType = DbType.String;
- break;
-
- case "int2":
- sqlType = DbType.Int16;
- break;
-
- case "int4":
- sqlType = DbType.Int32;
- break;
-
- case "int8":
- sqlType = DbType.Int64;
- break;
-
- case "interval":
- sqlType = DbType.String;
- break;
-
- case "line":
- sqlType = DbType.String;
- break;
-
- case "lseg":
- sqlType = DbType.String;
- break;
-
- case "macaddr":
- sqlType = DbType.String;
- break;
-
- case "money":
- sqlType = DbType.Decimal;
- break;
-
- case "name":
- sqlType = DbType.String;
- break;
-
- case "numeric":
- sqlType = DbType.Decimal;
- break;
-
- case "oid":
- sqlType = DbType.Int32;
- break;
-
- case "path":
- sqlType = DbType.String;
- break;
-
- case "point":
- sqlType = DbType.String;
- break;
-
- case "polygon":
- sqlType = DbType.String;
- break;
-
- case "refcursor":
- sqlType = DbType.String;
- break;
-
- case "reltime":
- sqlType = DbType.String;
- break;
-
- case "text":
- sqlType = DbType.String;
- break;
-
- case "time":
- sqlType = DbType.Time;
- break;
-
- case "timestamp":
- sqlType = DbType.DateTime;
- break;
-
- case "timestamptz":
- sqlType = DbType.DateTime;
- break;
-
- case "timetz":
- sqlType = DbType.DateTime;
- break;
-
- case "tinterval":
- sqlType = DbType.String;
- break;
-
- case "varbit":
- sqlType = DbType.String;
- break;
-
- case "varchar":
- sqlType = DbType.String;
- break;
-
- default:
- sqlType = DbType.String;
- break;
- }
- return sqlType;
- }
-
- // Converts data value from database to .NET System type.
- public static object ConvertDbTypeToSystem (DbType typ, String value) {
- object obj = null;
-
- // FIXME: more types need
- // to be converted
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- // FIXME: need to handle a NULL for each type
- // maybe setting obj to System.DBNull.Value ?
-
-
- if(value == null) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is null");
- return null;
- }
- else if(value.Equals("")) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is string empty");
- return null;
- }
-
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value: " + value);
-
- // Date, Time, and DateTime
- // are parsed based on ISO format
- // "YYYY-MM-DD hh:mi:ss.ms"
-
- switch(typ) {
- case DbType.String:
- obj = String.Copy(value);
- break;
- case DbType.Boolean:
- obj = value.Equals("t");
- break;
- case DbType.Int16:
- obj = Int16.Parse(value);
- break;
- case DbType.Int32:
- obj = Int32.Parse(value);
- break;
- case DbType.Int64:
- obj = Int64.Parse(value);
- break;
- case DbType.Decimal:
- obj = Decimal.Parse(value);
- break;
- case DbType.Single:
- obj = Single.Parse(value);
- break;
- case DbType.Double:
- obj = Double.Parse(value);
- break;
- case DbType.Date:
- String[] sd = value.Split(new Char[] {'-'});
- obj = new DateTime(
- Int32.Parse(sd[0]), Int32.Parse(sd[1]), Int32.Parse(sd[2]),
- 0,0,0);
- break;
- case DbType.Time:
- String[] st = value.Split(new Char[] {':'});
- obj = new DateTime(0001,01,01,
- Int32.Parse(st[0]),Int32.Parse(st[1]),Int32.Parse(st[2]));
- break;
- case DbType.DateTime:
- Int32 YYYY,MM,DD,hh,mi,ss,ms;
- YYYY = Int32.Parse(value.Substring(0,4));
- MM = Int32.Parse(value.Substring(5,2));
- DD = Int32.Parse(value.Substring(8,2));
- hh = Int32.Parse(value.Substring(11,2));
- mi = Int32.Parse(value.Substring(14,2));
- ss = Int32.Parse(value.Substring(17,2));
- ms = Int32.Parse(value.Substring(20,2));
- obj = new DateTime(YYYY,MM,DD,hh,mi,ss,ms);
- break;
- default:
- obj = String.Copy(value);
- break;
- }
-
- return obj;
- }
-
- // Translates System.Data.DbType to System.Type
- public static Type DbTypeToSystemType (DbType dType) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- Type typ = null;
-
- switch(dType) {
- case DbType.String:
- typ = typeof(String);
- break;
- case DbType.Boolean:
- typ = typeof(Boolean);
- break;
- case DbType.Int16:
- typ = typeof(Int16);
- break;
- case DbType.Int32:
- typ = typeof(Int32);
- break;
- case DbType.Int64:
- typ = typeof(Int64);
- break;
- case DbType.Decimal:
- typ = typeof(Decimal);
- break;
- case DbType.Single:
- typ = typeof(Single);
- break;
- case DbType.Double:
- typ = typeof(Double);
- break;
- case DbType.Date:
- case DbType.Time:
- case DbType.DateTime:
- typ = typeof(DateTime);
- break;
- default:
- typ = typeof(String);
- break;
- }
- return typ;
- }
-
- // Find DbType for oid
- // which requires a look up of PostgresTypes
- // DbType <-> typname <-> oid
- public static string OidToTypname (int oid, ArrayList pgTypes) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- string typname = "text"; // default
- int i;
- for(i = 0; i < pgTypes.Count; i++) {
- PostgresType pt = (PostgresType) pgTypes[i];
- if(pt.oid == oid) {
- typname = pt.typname;
- break;
- }
- }
-
- return typname;
- }
-
- // Convert a .NET System value type (Int32, String, Boolean, etc)
- // to a string that can be included within a SQL statement.
- // This is to methods provides the parameters support
- // for the PostgreSQL .NET Data provider
- public static string ObjectToString(DbType dbtype, object obj) {
-
- // TODO: how do we handle a NULL?
- //if(isNull == true)
- // return "NULL";
-
- string s;
-
- // Date, Time, and DateTime are expressed in ISO format
- // which is "YYYY-MM-DD hh:mm:ss.ms";
- DateTime dt;
- StringBuilder sb;
-
- const string zero = "0";
-
- switch(dbtype) {
- case DbType.String:
- s = "'" + obj + "'";
- break;
- case DbType.Boolean:
- if((bool)obj == true)
- s = "'t'";
- else
- s = "'f'";
- break;
- case DbType.Int16:
- s = obj.ToString();
- break;
- case DbType.Int32:
- s = obj.ToString();
- break;
- case DbType.Int64:
- s = obj.ToString();
- break;
- case DbType.Decimal:
- s = obj.ToString();
- break;
- case DbType.Single:
- s = obj.ToString();
- break;
- case DbType.Double:
- s = obj.ToString();
- break;
- case DbType.Date:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // year
- if(dt.Year < 10)
- sb.Append("000" + dt.Year);
- else if(dt.Year < 100)
- sb.Append("00" + dt.Year);
- else if(dt.Year < 1000)
- sb.Append("0" + dt.Year);
- else
- sb.Append(dt.Year);
- sb.Append("-");
- // month
- if(dt.Month < 10)
- sb.Append(zero + dt.Month);
- else
- sb.Append(dt.Month);
- sb.Append("-");
- // day
- if(dt.Day < 10)
- sb.Append(zero + dt.Day);
- else
- sb.Append(dt.Day);
- sb.Append('\'');
- s = sb.ToString();
- break;
- case DbType.Time:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // hour
- if(dt.Hour < 10)
- sb.Append(zero + dt.Hour);
- else
- sb.Append(dt.Hour);
- sb.Append(":");
- // minute
- if(dt.Minute < 10)
- sb.Append(zero + dt.Minute);
- else
- sb.Append(dt.Minute);
- sb.Append(":");
- // second
- if(dt.Second < 10)
- sb.Append(zero + dt.Second);
- else
- sb.Append(dt.Second);
- sb.Append('\'');
- s = sb.ToString();
- break;
- case DbType.DateTime:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // year
- if(dt.Year < 10)
- sb.Append("000" + dt.Year);
- else if(dt.Year < 100)
- sb.Append("00" + dt.Year);
- else if(dt.Year < 1000)
- sb.Append("0" + dt.Year);
- else
- sb.Append(dt.Year);
- sb.Append("-");
- // month
- if(dt.Month < 10)
- sb.Append(zero + dt.Month);
- else
- sb.Append(dt.Month);
- sb.Append("-");
- // day
- if(dt.Day < 10)
- sb.Append(zero + dt.Day);
- else
- sb.Append(dt.Day);
- sb.Append(" ");
- // hour
- if(dt.Hour < 10)
- sb.Append(zero + dt.Hour);
- else
- sb.Append(dt.Hour);
- sb.Append(":");
- // minute
- if(dt.Minute < 10)
- sb.Append(zero + dt.Minute);
- else
- sb.Append(dt.Minute);
- sb.Append(":");
- // second
- if(dt.Second < 10)
- sb.Append(zero + dt.Second);
- else
- sb.Append(dt.Second);
- sb.Append(".");
- // millisecond
- if(dt.Millisecond < 10)
- sb.Append(zero + dt.Millisecond);
- else
- sb.Append(dt.Millisecond);
- sb.Append('\'');
- s = sb.ToString();
- break;
- default:
- // default to DbType.String
- s = "'" + obj + "'";
- break;
- }
- return s;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/Mono.GetOptions/.cvsignore b/mcs/class/Mono.GetOptions/.cvsignore
deleted file mode 100644
index 97274c3c4a6..00000000000
--- a/mcs/class/Mono.GetOptions/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.pdb
-*.dll
-*.csproj.user
-
diff --git a/mcs/class/Mono.GetOptions/AssemblyInfo.cs b/mcs/class/Mono.GetOptions/AssemblyInfo.cs
deleted file mode 100644
index e8a5b7d3153..00000000000
--- a/mcs/class/Mono.GetOptions/AssemblyInfo.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
-
diff --git a/mcs/class/Mono.GetOptions/Mono.GetOptions.csproj b/mcs/class/Mono.GetOptions/Mono.GetOptions.csproj
deleted file mode 100644
index 695df1ee57b..00000000000
--- a/mcs/class/Mono.GetOptions/Mono.GetOptions.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{8D3008AB-7C0F-4DBE-A305-752926C366A7}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "Mono.GetOptions"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- RootNamespace = "Mono.GetOptions"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.XML"
- HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AssemblyInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "OptionList.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/class/Mono.GetOptions/OptionList.cs b/mcs/class/Mono.GetOptions/OptionList.cs
deleted file mode 100644
index 40751e656a7..00000000000
--- a/mcs/class/Mono.GetOptions/OptionList.cs
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// OptionList.cs
-//
-// Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// (C) 2002 Rafael Teixeira
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-
-namespace Mono.GetOptions
-{
- [AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
- public class AuthorAttribute : System.Attribute
- {
- public string Name;
- public string SubProject;
-
- public AuthorAttribute(string Name)
- {
- this.Name = Name;
- this.SubProject = null;
- }
-
- public AuthorAttribute(string Name, string SubProject)
- {
- this.Name = Name;
- this.SubProject = SubProject;
- }
-
- public override string ToString()
- {
- if (SubProject == null)
- return Name;
- else
- return Name + " (" + SubProject + ")";
- }
- }
-
- enum OptionParameterType
- {
- None,
- Integer,
- Decimal, // look XML Schemas for better names
- String,
- Symbol,
- FilePath,
- FileMask,
- AssemblyName,
- AssemblyFileName,
- AssemblyNameOrFileName
- }
-
- public delegate bool OptionFound(object Value);
-
- /// <summary>
- /// Summary description for Class1.
- /// </summary>
- public class OptionList
- {
- struct OptionDetails
- {
- public char ShortForm;
- public string LongForm;
- public string ShortDescription;
- public OptionParameterType ParameterType;
- public int MinOccurs;
- public int MaxOccurs; // negative means there is no limit
- public object DefaultValue;
- public OptionFound Dispatcher;
-
- }
-
- private string appTitle = "Add a [assembly: AssemblyTitle(\"Here goes the application name\")] to your assembly";
- private string appCopyright = "Add a [assembly: AssemblyCopyright(\"(c)200n Here goes the copyright holder name\")] to your assembly";
- private string appDescription = "Add a [assembly: AssemblyDescription(\"Here goes the short description\")] to your assembly";
- private string[] appAuthors;
-
- public readonly string usageFormat;
- public readonly string aboutDetails;
-
- private SortedList list = new SortedList();
-
- private object[] GetAssemblyAttributes(Type type)
- {
- Assembly entry = Assembly.GetEntryAssembly();
- return entry.GetCustomAttributes(type, false);
- }
-
- private string[] GetAssemblyAttributeStrings(Type type)
- {
- object[] result = GetAssemblyAttributes(type);
-
- if ((result == null) || (result.Length == 0))
- return new string[0];
-
- int i = 0;
- string[] var = new string[result.Length];
-
- foreach(object o in result)
- var[i++] = o.ToString();
-
- return var;
- }
-
- private void GetAssemblyAttributeValue(Type type, string propertyName, ref string var)
- {
- object[] result = GetAssemblyAttributes(type);
-
- if ((result != null) && (result.Length > 0))
- var = (string)(string)type.InvokeMember(propertyName, BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty | BindingFlags.Instance, null, result[0], new object [] {}); ;
- }
-
- public OptionList(string aboutDetails, string usageFormat)
- {
- this.aboutDetails = aboutDetails;
- this.usageFormat = usageFormat;
-
- GetAssemblyAttributeValue(typeof(AssemblyTitleAttribute), "Title", ref appTitle);
- GetAssemblyAttributeValue(typeof(AssemblyCopyrightAttribute), "Copyright", ref appCopyright);
- GetAssemblyAttributeValue(typeof(AssemblyDescriptionAttribute), "Description", ref appDescription);
- appAuthors = GetAssemblyAttributeStrings(typeof(AuthorAttribute));
- if (appAuthors.Length == 0)
- {
- appAuthors = new String[1];
- appAuthors[0] = "Add one or more [assembly: Mono.GetOptions.Author(\"Here goes the author name\")] to your assembly";
- }
- }
-
- private void AddGenericOption(
- char shortForm,
- string longForm,
- string shortDescription,
- OptionParameterType parameterType,
- int minOccurs,
- int maxOccurs,
- object defaultValue,
- OptionFound dispatcher)
- {
- OptionDetails option = new OptionDetails();
-
- option.ShortForm = shortForm;
- option.LongForm = longForm;
- option.ShortDescription = shortDescription;
- option.ParameterType = parameterType;
- option.MinOccurs = minOccurs;
- option.MaxOccurs = maxOccurs;
- option.DefaultValue = defaultValue;
- option.Dispatcher = dispatcher;
-
- if (shortForm == ' ')
- list.Add(longForm, option);
- else
- list.Add(shortForm.ToString(), option);
- }
-
- public void AddAbout(char shortForm, string longForm, string shortDescription)
- {
- AddGenericOption(shortForm, longForm, shortDescription, OptionParameterType.None, 0, 1, null, new OptionFound(DoAbout));
- }
-
- public void AddBooleanSwitch(char shortForm, string longForm, string shortDescription, bool defaultValue, OptionFound switcher)
- {
- AddGenericOption(shortForm, longForm, shortDescription, OptionParameterType.None, 0, 1, defaultValue, switcher);
- }
-
- public void ShowAbout()
- {
- Console.WriteLine(appTitle + " - " + appCopyright);
- Console.WriteLine(appDescription);
- Console.WriteLine();
- Console.WriteLine(aboutDetails);
- Console.WriteLine();
- Console.WriteLine("Authors:");
- foreach(string s in appAuthors)
- Console.WriteLine ("\t" + s);
- }
-
- private bool DoAbout(object nothing)
- {
- ShowAbout();
- return true;
- }
-
- public void ShowUsage()
- {
- Console.WriteLine(appTitle + " - " + appCopyright);
- Console.Write("Usage: ");
- Console.WriteLine(usageFormat);
- // TODO: list registered options here
- foreach (DictionaryEntry option in list)
- Console.WriteLine(option.Value.ToString());
- }
-
- public void ShowUsage(string errorMessage)
- {
- Console.WriteLine(errorMessage);
- ShowUsage();
- }
-
- public void ProcessArgs(string[] args)
- {
- ShowAbout();
- }
- }
-}
diff --git a/mcs/class/README b/mcs/class/README
deleted file mode 100644
index 97382f10b20..00000000000
--- a/mcs/class/README
+++ /dev/null
@@ -1,277 +0,0 @@
-The class libraries are grouped together in the assemblies they belong.
-
-Each directory here represents an assembly, and inside each directory we
-divide the code based on the namespace they implement.
-
-In addition, each assembly directory contains a Test directory that holds the
-NUnit tests for that assembly.
-
-The nant build file for an assembly creates two versions of the dll for that
-assembly. One version is a "full" dll. The full dll contains (almost) all
-of the classes, regardless of how complete the classes are. The name of this
-dll is the normal name you would expect, like "corlib.dll" or "System.dll".
-These full dll's are created in the /mcs/class/lib directory.
-
-The other dll which is built is a "restricted" dll. The restricted dll
-omits incomplete classes that would prevent the NUnit testrunner from actually
-running the tests. These restricted dll's are created in the Test directory
-of their respective assembly and named with a "_res" suffix. So, for example,
-the NUnit-testable dll for corlib is /mcs/class/corlib/Test/corlib_res.dll.
-
-The final dll which is built is the one which houses the actual NUnit tests.
-This dll is built from all of the classes in the Test directory and below, and
-is named with a "_test" suffix. So, for example, the NUnit tests for corlib
-are in /mcs/class/corlib/Test/corlib_test.dll. This dll is also linked with
-the restricted dll found in the same directory.
-
-
-* Missing implementation bits
-
- If you implement a class and you are missing implementation bits,
- please use the attribute [MonoTODO]. This attribute can be used
- to programatically generate our status web pages:
-
- [MonoTODO]
- int MyFunction ()
- {
- throw new NotImplementedException ();
- }
-
-* Tagging buggy code
-
- If there is a bug in your implementation tag the problem by using
- the word "FIXME" in the code, together with a description of the
- problem.
-
- Do not use XXX or obscure descriptions, because otherwise people
- will not be able to understand what you mean.
-
-* Tagging Problematic specs.
-
- If the documentation and the Microsoft implementation do
- differ (you wrote a test case to prove this), I suggest that you edit
- the file `mcs/class/doc/API-notes' so we can keep track of these problems
- and submit our comments to ECMA or Microsoft and seek clarification.
-
- Sometimes the documentation might be buggy, and sometimes the implementation
- might be buggy. Lets try to identify and pinpoint which one
- is the correct one.
-
- Sometimes the specification will be lame (consider Version.ToString (fieldCount)
- where there is no way of knowing how many fields are available, making the API
- not only stupid, but leading to unreliable code).
-
- In those cases, use the keyword "LAMESPEC".
-
-
-* Coding considerations and style.
-
- In order to keep the code consistent, please use the following
- conventions. From here on `good' and `bad' are used to attribute
- things that would make the coding style match, or not match. It is not
- a judgement call on your coding abilities, but more of a style and
- look call. Please try to follow these guidelines to ensure prettiness.
-
- Use 8 space tabs for writing your code (hopefully we can keep
- this consistent). If you are modifying someone else's code, try
- to keep the coding style similar.
-
- Since we are using 8-space tabs, you might want to consider the Linus
- Torvals trick to reduce code nesting. Many times in a loop, you will
- find yourself doing a test, and if the test is true, you will nest.
- Many times this can be changed. Example:
-
-
- for (i = 0; i < 10; i++) {
- if (something (i)) {
- do_more ();
- }
- }
-
- This take precious space, instead write it like this:
-
- for (i = 0; i < 10; i++) {
- if (!something (i))
- continue;
- do_more ();
- }
-
- A few guidelines:
-
- * Use a space before an opening parenthesis when calling
- functions, or indexing, like this:
-
- method (a);
- b [10];
-
- * Do not put a space after the opening parenthesis and the
- closing one, ie:
-
- good: method (a); array [10];
-
- bad: method ( a ); array[ 10 ];
-
- * Inside a code block, put the opening brace on the same line
- as the statement:
-
- good:
- if (a) {
- code ();
- code ();
- }
-
- bad:
- if (a)
- {
- code ();
- code ();
- }
-
- * Avoid using unecessary open/close braces, vertical space
- is usually limited:
-
- good:
- if (a)
- code ();
-
- bad:
- if (a) {
- code ();
- }
-
- * When defining a method, use the C style for brace placement,
- that means, use a new line for the brace, like this:
-
- good:
- void Method ()
- {
- }
-
- bad:
- void Method () {
- }
-
- * Properties and indexers are an exception, keep the
- brace on the same line as the property declaration.
- Rationale: this makes it visually
- simple to distinguish them.
-
- good:
- int Property {
- get {
- return value;
- }
- }
-
- bad:
- int Property
- {
- get {
- return value;
- }
- }
-
- Notice how the accessor "get" also keeps its brace on the same
- line.
-
- For very small properties, you can compress things:
-
- ok:
- int Property {
- get { return value; }
- set { x = value; }
- }
-
- * Use white space in expressions liberally, except in the presence
- of parenthesis:
-
- good:
-
- if (a + 5 > method (blah () + 4))
-
- bad:
- if (a+5>method(blah()+4))
-
- * For any new files, please use a descriptive introduction, like
- this:
-
- //
- // System.Comment.cs: Handles comments in System files.
- //
- // Author:
- // Juan Perez (juan@address.com)
- //
- // (C) 2002 Address, Inc (http://www.address.com)
- //
-
- * If you are modyfing someone else's code, and your contribution
- is significant, please add yourself to the Authors list.
-
- * Switch statements have the case at the same indentation as the
- switch:
-
- switch (x) {
- case 'a':
- ...
- case 'b':
- ...
- }
-
- * Argument names should use the camel casing for
- identifiers, like this:
-
- good:
- void Method (string myArgument)
-
- bad:
- void Method (string lpstrArgument)
- void Method (string my_string)
-
- Here are a couple of examples:
-
-class X : Y {
-
- bool Method (int argument_1, int argument_2)
- {
- if (argument_1 == argument_2)
- throw new Exception (Locale.GetText ("They are equal!");
-
- if (argument_1 < argument_2) {
- if (argument_1 * 3 > 4)
- return true;
- else
- return false;
- }
-
- //
- // This sample helps keep your sanity while using 8-spaces for tabs
- //
- VeryLongIdentifierWhichTakesManyArguments (
- Argument1, Argument2, Argument3,
- NestedCallHere (
- MoreNested));
- }
-
- bool MyProperty {
- get {
- return x;
- }
-
- set {
- x = value;
- }
- }
-
- void AnotherMethod ()
- {
- if ((a + 5) != 4) {
- }
-
- while (blah) {
- if (a)
- continue;
- b++;
- }
- }
-}
- \ No newline at end of file
diff --git a/mcs/class/System.Data/ChangeLog b/mcs/class/System.Data/ChangeLog
deleted file mode 100644
index e3b8cac01af..00000000000
--- a/mcs/class/System.Data/ChangeLog
+++ /dev/null
@@ -1,1310 +0,0 @@
-2002-06-06 Rodrigo Moya <rodrigo@ximian.com>
-
- * list: added missing PostgresTypes.cs file.
-
-2002-06-02 Francisco Jr. <fxjrlists@yahoo.com.br>
-
- * System.Data.SqlClient/SqlParameterCollection.cs: implemented missing
- methods.
-
-2002-05-30 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlConnection.cs: modifed -
- start to implement the interfaces properly and
- properly doing a Close(), Dispose(), and
- releasing resources
-
- * Test/SqlSharpCli.cs: modified -
- add support for MySQL in Mono.Data.MySql
- and OleDb support in System.Data.OleDb. However,
- the OleDb support is commented right now.
- When the program starts up, a shorter help menu should
- display the most important commands: help and quit
-
-2002-05-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.build: exclude System.Data.OleDb files.
-
-2002-05-27 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlCommand.cs: typo
- should be CommandBehavior.KeyInfo
-
- * Test/SqlSharpCli.cs: refactored and added a few more
- features.
-
-2002-05-27 Tim Coleman <tim@timcoleman.com>
- * list: update to compile properly (add missing
- files and switch path delimiter from '\' to '/').
-
-2002-05-26 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data/DataRow.cs
- * System.Data.Common/DbDataAdapter.cs: fix to
- get Test/TestSqlDataAdapter.cs to work again
-
- * Test/TestSqlDataAdapter.cs: removed comment
- about SqlDataReader:NextResult() not being implemented; it
- bas been implemented
-
-2002-05-26 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data/DataRow.cs: modified
- support setting of DBNull.Value
- using the Item indexer this[DataColumn]
-
- * System.Data.SqlClient/SqlCommand.cs: modified
- tweaks to show TODO's for other CommandBehavior.
- Set AllowDBNull column to true for IsKey row
- in schema DataTable.
-
- * System.Data.SqlClient/SqlConnection.cs: modified
- if transaction is in progress when a Close() is called,
- do a transaction Rollback.
-
-2002-05-26 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/SqlSharpCli.cs: added file
- My new toy. SQL# is a command-line tool to enter
- SQL commands and queries using Mono System.Data.
- It also serves as a test for Mono System.Data.
-
- * System.Data.SqlClient/SqlCommand.cs: modified
- - ExecuteNonQuery(), ExecuteScalar(), and ExecuteReader()
- should handle the results from SQL Commands and Queries.
- - Internal class SqlResult should not create schema Table
- for the result from a SQL Command. Also, set the RecordsRetrieved
- property for SqlDataReader.
- - Closing the SqlDataReader should Close() the SqlConnection for
- a CommandBehavior.CloseConnection.
- - Set defaults for SqlResult
-
- * System.Data.SqlClient/SqlConnection.cs: modified -
- when SqlDataReader is Close()
- should Close() the SqlConnection for
- a CommandBehavior.CloseConnection. Changed internal Property
- from OpenReader get/set to IsReaderOpen get and created
- internal methods OpenReader()/CloseReader() for SqlCommand to call.
- SqlConnection needs to be prevented from doing while SqlDataReader
- is being used.
-
- * System.Data.SqlClient/SqlDataReader.cs: modified -
- call SqlCommand's OpenReader() internal method. get
- RecordsRetrieved from SqlResult. set/reset default
- values for SqlDataReader.
-
- * Test/PostgresTest.cs
- * Test/TestExecuteScalar.cs
- * Test/TestSqlDataReader.cs: modified
- for the Execute...() methods in SqlCommand
- to test SQL Queries and Commands
-
- * Test/System.Data_test.build: modified
- exclude new file Test/SqlSharpCli.cs from
- test build
-
-2002-05-24 Tim Coleman <tim@timcoleman.com>
- * System.Data.Common/DbDataAdapter.cs: remove IDbCommands, except
- for get accessors. These should be implemented in derived classes. See
- SqlDataAdapter for clues.
- * System.Data.SqlClient/SqlDataAdapter.cs: implement IDbDataAdapter
- * System.Data.Common/DataAdapter.cs:
- * System.Data.Common/DataTableMappingCollection.cs:
- * System.Data.Common/DataTableMapping.cs:
- * System.Data.Common/DataColumnMappingCollection.cs:
- * System.Data.Common/DataColumnMapping.cs:
- Properly (I hope!) implement all of the appropriate interfaces
- for these classes.
-
-
-2002-05-23 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlClient/SqlCommand.cs: include
- the BaseColumnName in the schema table. Was missed before.
- * System.Data.Common/DbDataAdapter.cs: Use DataTable
- mappings so that the DataSet and DataTable are more closely tied.
- Get schema information from the DataTable using GetSchemaTable ()
- Various other little fixes
- * System.Data.Common/DataColumnMappingCollection.cs:
- * System.Data.Common/DataTableMapping.cs:
- * System.Data.Common/DataTableMappingCollection.cs: Some
- implementation, enough to be used by DbDataAdapter.
-
-2002-05-23 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlCommand.cs: set
- the "ProviderType" to the PostgreSQL type oid
-
- * System.Data.SqlClient/SqlDataReader.cs: fix
- for various properties and methods that
- return meta data: Item indexers this[name] and this[index],
- GetFieldType, GetName, and GetOrdinal. SqlDataAdapter
- should work again.
-
-2002-05-22 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data/DataRow.cs: change suggested
- by tim: in Item indexer, do an EndEdit()
-
- * System.Data.SqlClient/SqlCommand.cs: more
- fixes to SqlResult. After setting each item in
- the DataRow, do an AcceptChanges() to commit
- the changes in the DataRow. For DataType, use a Type
- of System.String since System.Type nor System.Object
- seems to work.
-
- * Test/TestSqlDataReader.cs
- * Test/PostgresTest.cs: updated to to be on
- the way schema table is suppose to work
-
-2002-05-22 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlCommand.cs: more work on
- building the schema table
-
-2002-05-22 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlClient/SqlCommand.cs: preliminary work
- on getting the schema table correctly built.
-
-2002-05-21 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/ParmUtil.cs: added file - to
- provide utility for conversion of input parameters
-
- * System.Data.SqlClient/PostgresTypes.cs: added file -
- moved the PostgreHelper class to here. May eventually
- move the internal class PostgresTypes that's inside the
- SqlConnection to here as well.
- Handling of PostgreSQL <-> .NET types need to be though
- out more. Also, the PostgreHelper has a method to convert
- from .NET types to a string which can be put into used in
- an SQL statement to execute against a PostgreSQL database.
- This is the beginnings of parameters support. It currently
- only supports input parameters. Still need to do output,
- input/output, and return parameters.
-
- * Test/TestSqlParameters.cs: new test to test the input
- parameters in System.Data.SqlClient against a
- PostgreSQL db.
-
- * System.Data.SqlClient/PostgresLibrary.cs: moved
- PostgresHelper class to file PostgresTypes.cs. Also
- moved struct PostgresType there too.
-
- * System.Data.SqlClient/SqlCommand.cs: added input
- parameters support
-
- * System.Data.SqlClient/SqlParameter.cs: got
- SqlParameter to work
-
- * System.Data.SqlClient/SqlParameterCollection.cs: got
- SqlParameterCollection to work
-
- * Test/System.Data_test.build: added files to exclude
- from test build
-
- * System.Data.SqlClient/SqlConnection.cs: release resources
- no longer used
-
-2002-05-18 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Xml: added directory for classes with namespace
- System.Xml to go into the System.Data.dll assembly
-
- * System.Xml/XmlDataDocument: added file
- for stubbed concrete class XmlDataDocument which
- inherits from XmlDocument. Its purpose is to provide
- a W3C XML DOM Document for relational data and interacting
- with a DataSet
-
-2002-05-18 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlCommand.cs: handle CommandTypes
- Text, TableDirect, and StoredProcedure
-
- * Test/PostgresTest.cs: changed call to version()
- stored procedure to use the CommandType of StoredProcedure
-
- * Test/TestSqlDataReader.cs: test all the CommandTypes
-
-2002-05-18 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.build: took out all excluded
- files except the ones in the Test directory
- because all files compile now. It does not
- mean they all work or have implementations
- though.
-
- * System.Data/DataRelationCollection.cs
- * System.Data/DataTableRelationCollection.cs
- * System.Data/InternalDataCollectionBase.cs
- * System.Data.Common/DbDataPermission.cs
- * System.Data.SqlClient/SqlInfoMessageEventArgs.cs
- * System.Data.SqlClient/SqlClientPermission.cs
- * System.Data.SqlClient/SqlClientPermissionAttribute.cs: changes
- to get all System.Data* files to compile.
-
- * System.Data.SqlClient/SqlCommand.cs: started coding
- to prevent SqlConnection and SqlCommand from doing
- anyting while fetching data using SqlDataReader. Also,
- started coding to undo this prevention once the
- SqlDataReader is closed.
-
- * System.Data.SqlClient/SqlConnection.cs: get database server
- version. Started coding to prevent connection from
- doing anything while fetching data and undo once the reader
- is closed. Include events SqlInfoMessage and StateChange.
-
- * System.Data.SqlClient/SqlDataReader.cs: start coding to
- prevent connection and command from doing anything while
- fetching data, and undo when closed.
-
- * Test/PostgresTest.cs: added test to get ServerVersion
- property from SqlConnection
-
-2002-05-18 Tim Coleman <tim@timcoleman.com>
- * System.Data/DataRow.cs: More implementation,
- as well as boundary checks and small semantic
- repairs
-
-2002-05-18 Tim Coleman <tim@timcoleman.com>
- * System.Data/DataRow.cs: Try to reduce memory
- usage by only creating the original and proposed
- arrays as required in BeginEdit, and then destroying
- proposed during EndEdit, and original during AcceptChanges.
- * System.Data.Common/DbDataAdapter.cs: Make the
- startRecord and maxRecords parameters work correctly.
-
-2002-05-18 Tim Coleman <tim@timcoleman.com>
- * System.Data/DataRow.cs: Move the null check in
- ItemArray set to above the Invalid Cast check, so
- that we don't get null reference exceptions.
-
-2002-05-17 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/PostgresLibrary.cs: handle
- data value from database being NULL
-
- * System.Data.SqlClient/SqlCommand.cs: for ExecuteReader,
- allow multiple result sets. Added new internal class
- SqlResult to pass result set data from SqlCommand
- to SqlDataReader.
-
- * System.Data.SqlClient/SqlDataReader.cs: allow
- multiple result sets.
-
- * System.Data.SqlClient/SqlConnection.cs: moved
- things around. Implement IDisposable.
-
- * Test/TestSqlDataReader.cs: test for execution
- of multiple result sets and display the results
- of these multiple results sets
-
- * Test/TestSqlDataAdapter.cs: tweaks
-
-2002-05-17 Tim Coleman <tim@timcoleman.com>
- * System.Data.Common/DbDataAdapter.cs:
- - More implementation of Fill methods
- - Get rid of isDirty flag, because we can just check
- if the table exists
- - Do *not* remove DataTables before Filling them
- - Implicitly open the connection before doing a Fill
- if it does not exist.
- * System.Data.SqlClient/SqlDataAdapter.cs:
- - Minor fixup
- * System.Data/DataTableCollection.cs:
- - Add DataSet to internal, undocumented constructor
- - When a table is created, set its DataSet property
- - Default table name for creation is "Table1" (see .NET)
- - Inherit the ArrayList list from InternalDataCollecitonBase
- and maintain a hashtable between table names and
- DataTables
- * System.Data/DataTable.cs:
- - Add internal dataSet field. This is used by
- DataTableCollection when the DataTable is constructed.
- * System.Data/DataSet.cs:
- - Pass a reference to the DataSet when constructing the
- DataTableCollection.
-
-2002-05-16 Tim Coleman <tim@timcoleman.com>
- * System.Data.Common/DbDataAdapter.cs:
- Use table.Rows.Add (itemArray) instead of
- table.Rows.Add (thisRow) to provide better
- abstraction.
- * System.Data/DataRowCollection.cs:
- Some implementation of this class.
- * System.Data/InternalDataCollectionBase.cs:
- Some implementation. Most notably, this now
- has an enumerator so we can use foreach (DataRow row in table.Rows)
- in the test classes.
- * System.Data/DataTable.cs:
- Since DataRowCollection now accepts a DataTable in
- its internal constructor, we must pass one in.
-
-2002-05-16 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/TestSqlDataAdapter.cs: added new test
- for SqlDataAdapter, DataSet, DataTableCollection, DataTable,
- DataRowCollection, and DataRow. It tests retrieving data
- based on a SQL SELECT query. This test is based on Tim Coleman's
- test he sent to me.
-
-2002-05-16 Tim Coleman <tim@timcoleman.com>
- * System.Data.Common/DbDataAdapter.cs:
- Use table.Rows.Add (thisRow) instead of
- table.ImportRow (thisRow)
- * System.Data/DataRowCollection.cs:
- Construct the ArrayList before using it
-
-2002-05-16 Tim Coleman <tim@timcoleman.com>
- * System.Data/DataTable.cs:
- Construct the DataRowCollection in the DataTable
- constructor. Otherwise, it's a null reference.
-
-2002-05-16 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlClient/SqlDataReader.cs:
- Modify GetValues to use Array.Copy() to copy
- the results from fields to values, rather than
- an assignment, which results in loss of data.
-
-2002-05-16 Tim Coleman <tim@timcoleman.com>
- * System.Data/DataRow.cs:
- More implementation and documentation. It should
- work more like expected, although there is no way
- to demonstrate this well yet. DataTable requires
- more work.
-
-2002-05-15 Tim Coleman <tim@timcoleman.com>
- * System.Data/DataRow.cs:
- Minor tweaks as I determine exactly how to
- implement this class.
-
-
-2002-05-14 Duncan Mak <duncan@ximian.com>
-
- * System.Data/DataTable.cs (NewRow): Added missing paren to fix build.
-
-2002-05-14 Tim Coleman
- * System.Data/DataRow.cs:
- * System.Data/DataRowBuilder.cs:
- * System.Data/DataTable.cs:
- More implementation of these classes. DataRow
- can now (possibly) do some useful things.
- Still not sure what DataRowBuilder is all about,
- other than passing a DataTable in.
-
-2002-05-14 Tim Coleman
- * System.Data/DataRowBuilder.cs:
- Add stubb for this internal class.
-
-2002-05-13 Tim Coleman
- * System.Data.Common/DbDataAdapter.cs:
- The maxRecords check was not correct.
-
-2002-05-13 Tim Coleman
- * System.Data/DataTableCollection.cs:
- Fix an issue when adding a DataTable and size == 0.
- Now explicitly checks if size > 0 before doing Array.Copy ()
- * System.Data.Common/DbDataAdapter.cs:
- Move closer to a working implementation.
- Make the IDbCommand fields protected so that they can
- be inherited.
- * System.Data.SqlClient/SqlDataAdapter.cs:
- This should inherit the IDbCommands instead of having its
- own. An explicit cast is used to force conversion between
- IDbCommand and SqlCommand
-
-2002-05-13 Tim Coleman
- * System.Data.Common/DataTableMappingCollection.cs:
- Some implementation to allow progress with DbDataAdapter
-
-2002-05-13 Tim Coleman
- * System.Data.Common/DbDataAdapter.cs:
- Modify to not break compile.
-
-2002-05-13 Tim Coleman
- * System.Data.build:
- include SqlDataAdapter, SqlRowUpdatedEventArgs,
- SqlRowUpdatingEventArgs, SqlRowUpdatedEventHandler,
- SqlRowUpdatingEventHandler in the build.
-
-2002-05-13 Tim Coleman
- * System.Data.Common/DbDataAdapter.cs:
- More implementation.
- * System.Data.Common/DataAdapter.cs:
- Correction of some of the stubbing, as well as a
- little bit more implementation
-
-2002-05-11 Tim Coleman
- * System.Data.SqlClient/SqlDataAdapter.cs:
- * System.Data.Common/DbDataAdapter.cs:
- Moved methods that weren't supposed to
- be in SqlDataAdapter out. They should be implemented
- in DbDataAdapter.
-
-
-2002-05-11 Tim Coleman
- * System.Data.SqlClient/SqlDataAdapter.cs:
- some implementation of this class. Note
- that none of the functionality has been
- tested yet, but I felt it should be checked
- in at this point as it compiles.
- * System.Data.SqlClient/SqlRowUpdatingEventArgs.cs:
- * System.Data.SqlClient/SqlRowUpdatedEventArgs.cs:
- Modified so that they will compile properly.
- Needed to include SqlDataAdapter in the build.
-
-2002-05-11 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataTable.cs (Clear): implemented.
- (DataTable): removed repeated code in constructors, and call the
- basic constructor from the others.
-
- * System.Data/DataColumn.cs: some tweaks.
-
- * System.Data/DataRow.cs (RowState): implemented.
- (CancelEdit): set rowState property back to Unchanged.
- (RejectChanges): call CancelEdit.
- (Delete): set rowState to Deleted.
-
-2002-05-11 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.build: added copy of System.Data.dll to Test directory
- for easy testing. Also, added clean for it too.
-
- * System.Data.SqlClient/PostgresLibrary.cs: changed setting of boolean
- from PostgreSQL data type to .NET type.
-
- * System.Data.SqlClient/SqlDataReader.cs: beginnings
- handling of a NULL value from the database
-
- * Test/PostgresTest.cs: added tests for NULL values retrieved
- from the database
-
- * Test/ReadPostgresData.cs
- * Test/TestExecuteScalar.cs
- * Test/TestSqlDataReader.cs
- * Test/TestSqlException.cs
- * Test/TestSqlIsolationLevel.cs: updated tests to use databas user
- "postgres". These tests may eventually be removed since they
- are not flexible.
-
-2002-05-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.build: removed reference to non-existant
- TestDataColumn.cs file.
-
- * System.Data/DataSet.cs: added some implementation.
-
-2002-05-09 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/PostgresLibrary.cs: got
- PostgreSQL data types time, date, timestamp (DateTime like)
- mapped to .NET System.DateTime working based
- on ISO DateTime formatting "YYYY-MM-DD hh:mi:ss.ms"
- Also mapped pg type boolean to .net Boolean
-
- * SqlClient/SqlConnection.cs: run SQL command to set
- Date style to ISO
-
- * Test/PostgresTest.cs: added test for an UPDATE SQL command,
- added tests for aggregates min(), max(), sum(), count(). could
- not get avg() to work due to some formatting error; someone claimed
- that it was my locale settings. added tests for SELECT of columns
- of type boolean, float, double, date, time, and timestamp. They
- have not been fully tested, but its a start.
-
-2002-05-09 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlTypes/SqlDecimal.cs: Implementations of
- addition, subtraction, and multiplication for the
- SqlDecimal type, as well as modification of some other
- operations. More to come on this one.
-
-2002-05-08 Rodrigo Moya <rodrigo@ximian.com>
-
- * Test/System.Data_test.build: excluded TestDataColumn, which
- should be replaced with a nunit test.
-
- * Test/TestDataColumn.cs: added basic test for DataColumn.cs.
-
-2002-05-07 Tim Coleman <tim@timcoleman.com>
- * SqlBinary.cs:
- * SqlBoolean.cs:
- * SqlByte.cs:
- * SqlDateTime.cs:
- * SqlDecimal.cs:
- * SqlDouble.cs:
- * SqlGuid.cs:
- * SqlInt16.cs:
- * SqlInt32.cs:
- * SqlInt64.cs:
- * SqlMoney.cs:
- * SqlSingle.cs:
- * SqlString.cs:
- Fix the broken build I made before. Bad
- me.
-
-2002-05-07 Tim Coleman <tim@timcoleman.com>
- * SqlString.cs:
- Fix a symantic error I made in SqlString
- Equals where I copied and pasted wrongly
-
-2002-05-07 Tim Coleman <tim@timcoleman.com>
- * INullable.cs:
- * SqlBinary.cs:
- * SqlBoolean.cs:
- * SqlByte.cs:
- * SqlCompareOptions.cs:
- * SqlDateTime.cs:
- * SqlDecimal.cs:
- * SqlDouble.cs:
- * SqlGuid.cs:
- * SqlInt16.cs:
- * SqlInt32.cs:
- * SqlInt64.cs:
- * SqlMoney.cs:
- * SqlSingle.cs:
- * SqlString.cs:
- Implement CompareTo, Equals, and String conversions
- for many types
-
-2002-05-05 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/PostgresTest.cs: modified to run completely. There
- are many TODOs in System.Data, so not all data types are
- included in the SELECT SQL query. Also, I made it to where
- it would connect
- using "host=localhost;dbname=test;user=postgres"
- instead of my userid and password. When more types are included,
- update this test.
-
-2002-05-05 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/PostgresTest.cs: added - ported
- libgda postgres-test.c originally by
- Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
- to C#.
-
-2002-05-05 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlTypes/SqlBinary.cs:
- * System.Data.SqlTypes/SqlBoolean.cs:
- * System.Data.SqlTypes/SqlByte.cs:
- * System.Data.SqlTypes/SqlDateTime.cs:
- * System.Data.SqlTypes/SqlDecimal.cs:
- * System.Data.SqlTypes/SqlDouble.cs:
- * System.Data.SqlTypes/SqlGuid.cs:
- * System.Data.SqlTypes/SqlInt16.cs:
- * System.Data.SqlTypes/SqlInt32.cs:
- * System.Data.SqlTypes/SqlInt64.cs:
- * System.Data.SqlTypes/SqlMoney.cs:
- * System.Data.SqlTypes/SqlSingle.cs:
- * System.Data.SqlTypes/SqlString.cs:
- More implementation, and code clean-up for consistency.
- Also, I had implemented many conversions as explicit
- that should have been implicit. This should remove
- many of the red X's and green pluses from the
- System.Data.SqlTypes namespace.
-
-2002-05-05 Miguel de Icaza <miguel@ximian.com>
-
- * System.Data/DataSet.cs: Remove [Serializable] attributes from
- methods, those only apply to structs or classes.
-
- Stub out ISerializable, ISupportInitialize, and IListSource methods
-
- * System.Data/DataRowView.cs: Stub out interface methods for
- IEditableObject, ICustomTypeDescriptor and IDataErrorInfo
-
- * System.Data/DataView.cs: Comment out non-implemented
- interfaces.
-
- * System.Data/DataViewSettingsCollection.cs: Type cast variables
- to the correct type to make it compile.
-
- * System.Data/DataViewSettings.cs: remove reference to
- non-existance type ApplyDefaultSort, it is a boolean.
-
-
-2002-05-05 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlTypes/SqlBinary.cs:
- * System.Data.SqlTypes/SqlBoolean.cs:
- * System.Data.SqlTypes/SqlByte.cs:
- * System.Data.SqlTypes/SqlDecimal.cs:
- * System.Data.SqlTypes/SqlDouble.cs:
- * System.Data.SqlTypes/SqlGuid.cs:
- * System.Data.SqlTypes/SqlInt16.cs:
- * System.Data.SqlTypes/SqlInt32.cs:
- * System.Data.SqlTypes/SqlInt64.cs:
- * System.Data.SqlTypes/SqlMoney.cs:
- * System.Data.SqlTypes/SqlSingle.cs:
- * System.Data.SqlTypes/SqlString.cs:
- Various fixes, including adding the SqlNullValueException
- when trying to retrieve the value of a null SqlType,
- and when casting values, a Null of type A converts to a
- Null of type B.
-
-2002-05-04 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/PostgresLibrary.cs
- * System.Data.SqlClient/SqlCommand.cs
- * System.Data.SqlClient/SqlConnection.cs
- * System.Data.SqlClient/SqlDataReader.cs
- oid should not be hard coded because they
- can change from one version of PostgreSQL
- to the next. Use the typname's instead.
- The PostgreSQL type data retrieves
- at database connection time. Any unimplemented
- types just default to string. These were things
- suggested by Gonzalo.
-
- * Test/ReadPostgresData.cs - stuff
- * Test/TestSqlDataReader.cs - stuff
-
- * System.Data.SqlTypes/SqlInt32.cs - added a using
-
-2002-05-03 Tim Coleman <tim@timcoleman.com>
- * System.Data.build: Fix the build so that test depends on build
-
-2002-05-03 Tim Coleman <tim@timcoleman.com>
- * System.Data.SqlTypes/SqlByte.cs:
- * System.Data.SqlTypes/SqlDateTime.cs:
- * System.Data.SqlTypes/SqlDecimal.cs:
- * System.Data.SqlTypes/SqlDouble.cs:
- * System.Data.SqlTypes/SqlGuid.cs:
- * System.Data.SqlTypes/SqlInt16.cs:
- * System.Data.SqlTypes/SqlInt64.cs:
- * System.Data.SqlTypes/SqlMoney.cs:
- * System.Data.SqlTypes/SqlSingle.cs:
- These files were mysteriously excluded from the last
- patch I made and sent to Rodrigo
- * System.Data.build: include the System.Data.SqlTypes in the build
-
-2002-05-03 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.build: removed comments
-
- * System.Data.SqlClient/PostgresLibrary.cs: changed
- the hard-coded PostgreSQL oid type int's to using an
- enum. Also, added PostgreSQL bpchar (character) type.
-
- * Test/TestSqlDataReader.cs: updated test
- to include new bpchar PostgreSQL type
-
-2002-05-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.SqlTypes/SqlBinary.cs:
- * System.Data.SqlTypes/SqlBoolean.cs:
- * System.Data.SqlTypes/SqlInt32.cs:
- * System.Data.SqlTypes/SqlString.cs: more implementation, by
- Tim Coleman <tcoleman@opentext.com>.
-
-2002-05-03 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/TestExecuteScalar.cs: added test for
- method ExecuteScalar in class SqlCommand.
-
- * System.Data/DataColumnCollection.cs - it should
- inherit properties from base InternalDataCollectionBase
- and use them instead of overriding them, such as, List.
-
- * System.Data/DataColumn.cs
- * System.Data/DataTable.cs: tweaks to retrieve
- meta data from the database
-
- * System.Data.SqlClient/PostgresLibrary.cs -
- added method OidToType to convert PostgreSQL oid type
- to System.Type. Renamed method OidTypeToSystem
- to ConvertPgTypeToSystem for converting the data value
- from a PostgreSQL type to a .NET System type.
-
- * System.Data.SqlClient/SqlCommand.cs: implemented
- method ExecuteReader which returns a SqlDataReader
- for a light forward only read only result set.
- It works on types int4 ==> Int32 and
- varchar ==> String. Other types
- will come later.
-
- * System.Data.SqlClient/SqlConnection.cs: added comment
-
- * System.Data.SqlClient/SqlDataReader.cs: implemented
- class. It works, but still lots to do.
-
- * Test/ReadPostgresData.cs: stuff
-
- * Test/TestSqlDataReader.cs: updated test for SqlDataReader
- to display meta data and the data
-
-2002-05-03 Duncan Mak <duncan@ximian.com>
-
- * TODO: Took out all the Exceptions. They should be all done now.
-
- * System.Data/ConstraintException.cs:
- * System.Data/DBConcurrencyException.cs:
- * System.Data/DataException.cs:
- * System.Data/DeletedRowInaccessibleException.cs:
- * System.Data/DuplicateNameException.cs:
- * System.Data/EvaluateException.cs:
- * System.Data/InRowChangingEventException.cs:
- * System.Data/InvalidConstraintException.cs:
- * System.Data/InvalidExpressionException.cs:
- * System.Data/MissingPrimaryKeyException.cs:
- * System.Data/NoNullAllowedException.cs:
- * System.Data/ReadOnlyException.cs:
- * System.Data/RowNotInTableException.cs:
- * System.Data/StrongTypingException.cs:
- * System.Data/SyntaxErrorException.cs:
- * System.Data/TypeDataSetGeneratorException.cs:
- * System.Data/VersionNotFoundException.cs: Added to CVS.
-
- * System.Data.SqlTypes/SqlNullValueException.cs:
- * System.Data.SqlTypes/SqlTruncateException.cs:
- * System.Data.SqlTypes/SqlTypeException.cs: Added to CVS.
-
-2002-05-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataViewSettingCollection.cs: implemented.
-
- * System.Data/DataRowView.cs: new stubs.
-
- * System.Data.SqlTypes/SqlByte.cs:
- * System.Data.SqlTypes/SqlDateTime.cs:
- * System.Data.SqlTypes/SqlDecimal.cs:
- * System.Data.SqlTypes/SqlDouble.cs:
- * System.Data.SqlTypes/SqlGuid.cs:
- * System.Data.SqlTypes/SqlInt16.cs:
- * System.Data.SqlTypes/SqlInt64.cs:
- * System.Data.SqlTypes/SqlMoney.cs:
- * System.Data.SqlTypes/SqlSingle.cs: new stubs, contributed
- by Tim Coleman <tcoleman@opentext.com>
-
- * System.Data.build: excluded newly-added files.
-
-2002-05-02 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/PostgresLibrary.cs: included new
- internal class that will be a helper class in using
- PostgreSQL. PostgresLibrary is used for the
- pinvoke methods to the PostgreSQL Client
- native C library libpq while the class PostgresHelper
- is used for wrapper or helper methods. It currently only
- has one static method OidTypeToSystem in converting
- PostgreSQL types to .NET System.<type>s, such as,
- a PostgreSQL int8 becomes a .NET System.Int64.
- Only a few types have been added, such as, int2,
- int4, int8, varchar, text, bool, and char. Other types
- will come later.
-
- * System.Data.SqlClient/SqlCommand.cs: implemented
- method ExecuteScalar which allows us to do aggregate
- functions, such as, count, avg, min, max, and sum. We
- also are able to retrieve the result, convert it to the .NET type
- as an object. The user of the returned object must explicitly cast.
-
- * Test/ReadPostgresData.cs: updated sample
- to help us learn to retrieve data in System.Data.SqlClient
- classes
-
-2002-05-01 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.build: added /nowarn: nnnn arguments
- so you will not get a ton of warnings. The warnings
- being excluded are: 1595, 0067, 0109, 0169, and 0649
-
-2002-05-01 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.build: modified to exclude more
- files from the build
-
-2002-05-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.SqlClient/SqlClientPermission.cs: added missing
- 'using's.
-
- * System.Data/MergeFailedEventArgs.cs: new class, contributed
- by John Dugaw <jdugaw@unizenconsulting.com>.
-
- * System.Data.build: excluded new files from build.
-
-2002-04-29 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/ReadPostgresData.cs: added - Uses the
- PostgresLibrary to retrieve a recordset.
- This is not meant to be used in Production, but as a
- learning aid in coding
- class System.Data.SqlClient.SqlDataReader.
- This sample does work.
-
- * Test/TestSqlDataReader.cs: added - used
- to test SqlDataReader (does not work yet)
- Forgot to add to ChangeLog on last commit.
-
-2002-04-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataViewSetting.cs: new class.
-
-2002-04-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataViewManager.cs: new class.
-
- * System.Data.SqlTypes/INullable.cs: properties for interfaces
- don't have implementation.
-
- * System.Data.SqlTypes/SqlInt32.cs:
- * System.Data.SqlTypes/SqlString.cs:
- * System.Data.SqlTypes/SqlBoolean.cs: removed destructor, since
- these are strctures.
-
- * System.Data.SqlClient/SqlClientPermissionAttribute.cs: added
- missing 'using's.
-
-2002-04-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataTableRelationCollection.cs: use 'new' keyword
- for correctly hiding parent class' members.
- (AddRange): use 'override' keyword on overriden method.
- (Clear): likewise.
- (Contains): likewise.
- (IndexOf): likewise.
- (OnCollectionChanged): likewise.
- (OnCollectionChanging): likewise.
- (RemoveCore): likewise.
-
- * System.Data/DataColumnCollection.cs: use 'new' keyword.
-
- * System.Data/DataSet.cs: added missing 'using's.
-
-2002-04-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataSet.cs:
- * System.Data/DataTableCollection.cs:
- * System.Data/DataView.cs: compilation fixes on Linux.
-
-2002-04-28 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data/DataRelation.cs
- * System.Data/ForeignKeyConstraint.cs
- * System.Data/UniqueConstraint.cs: added more stubs
-
- * System.Data/DataTableRelationCollection.cs: added back to cvs
- and modified for compile errors. DataRelationCollection is an
- abstract class and there must be a class that implements for
- DataTable/DataSet. DataTableRelationCollection was changed
- to an internal class.
-
- * System.Data.build: modified - new files added
- also wanted to include files/classes in the build
- so we can get a compilable forward read only result set.
- It compiles now using csc/nant with warnings, but this
- is a start for adding functionality for the result set.
- Classes associated with/and DataSet are still excluded.
-
- * TODO: modified - updated to do list for System.Data
-
- * System.Data/Constraint.cs
- * System.Data/ConstraintCollection.cs
- * System.Data/DataRelationCollection.cs
- * System.Data/DataRow.cs
- * System.Data/DataRowChangeEventArgs.cs
- * System.Data/DataRowCollection.cs
- * System.Data/DataTable.cs
- * System.Data/DataTableCollection.cs
- * System.Data/InternalDataCollectionBase.cs
- * System.Data/PropertyCollection.cs: modified -
- changes to compile SqlDataReader/DataTable and
- dependencies
-
- * System.Data/IDbCommand.cs
- * System.Data.SqlClient/SqlCommand.cs: modified -
- un-commented overloaded methods ExecuteReader
- which returns a SqlDataReader
-
-2002-04-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataTableCollection.cs: more implementation.
- (Count): added 'override' keyword, as pointer out by Martin.
-
- * System.Data.Common/DataColumnMappingCollection.cs (Add, AddRange):
- only call Array.Copy when there is really stuff to be copied.
- (CopyTo): don't create the temporary array, it's not needed.
-
- * System.Data.build: excluded newly added file from build.
-
-2002-04-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataTableRelationCollection.cs: removed, it's not
- on MS SDK documentation.
-
- * System.Data/DataTableCollection.cs: new class.
-
-2002-04-27 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data/DataRowChangeEventArgs.cs
- * System.Data/DataRowCollection.cs
- * System.Data/DataView.cs
- * System.Data/PropertyCollection.cs: added new stubs
-
- * System.Data.build: modified - added new files to exclude
- from build
-
- * TODO: modified - removed files from TODO list
- that were stubbed above
-
- * System.Data/DataColumn.cs
- * System.Data/DataRow.cs: modified - various tweaks
- and added internal method SetTable to set the reference
- to a DataTable
-
- * System.Data/DataSet.cs: modified - class was not
- completely stubbed.
-
- * System.Data/DataTable.cs: modified - temporarily commented
- DataSet and DataView references - trying to compile a SqlDataReader,
- DataTable, and dependencies for a forward read-only result set.
- SqlDataAdapter, DataSet, and DataView will come later once we can get
- a forward read only result set working.
-
- * System.Data/IDataRecord.cs: modified - source code lines should
- not be > 80
-
- * System.Data/InternalDataCollectionBase.cs: modified - started
- implementing this base class for collection of data rows,
- columns, tables, relations, and constraints
-
- * System.Data.SqlClient/SqlException.cs: modified -
- call base(message) so a unhandled exception displays
- the message of a SQL error instead of the
- default SystemException message
-
- * Test/TestSqlException.cs: modified -
- handle the rollback properly for a SqlException on a
- failure to connect
-
-2002-04-23 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.build: modified - added new
- files to exclude from build
-
- * System.Data/Constraint.cs
- * System.Data/ConstraintCollection.cs
- * System.Data/InternalDataCollectionBase.cs: added -
- stubs which are needed to build DataTable.cs
-
- * TODO: modified - added more classes TODO and
- added more stuff TODO, such as, create script
- to create test database monotestdb for testing
- classes in System.Data
-
-2002-04-23 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.Common/DataAdapter.cs:
- * System.Data.Common/DataColumnMappingCollection.cs:
- * System.Data.Common/DataTableMappingCollection.cs:
- * System.Data.Common/DbDataPermission.cs:
- * System.Data.Common/DbDataPermissionAttribute.cs: some
- compilation errors fixed.
-
-2002-04-23 Daniel Morgan <danmorg@sc.rr.com>
-
- * TODO: modified - added classes TODO, and
- a poor attempt at System.Data plan
-
-2002-04-23 Daniel Morgan <danmorg@sc.rr.com>
-
- * ChangeLog: modified - put tabs where they belong
-
- * System.Data.SqlClient/SqlDataReader.cs
- * System.Data/DataColumn.cs: modified - compile errors
- trying to compile SqlDataAdapter and dependencies
-
-2002-04-23 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlTypes/SqlBoolean.cs
- * System.Data.SqlTypes/SqlCompareOptions.cs
- * System.Data.SqlTypes/SqlInt32.cs
- * System.Data.SqlTypes/SqlString.cs: added - new stubs
-
- * System.Data/DataTable.cs
- * System.Data.SqlClient/SqlCommand.cs
- * System.Data.SqlClient/SqlConnection.cs
- * System.Data.SqlClient/SqlError.cs
- * System.Data.SqlClient/SqlTransaction.cs: modified -
- misc. tweaks
-
- * System.Data.SqlClient/SqlException.cs: modified -
- missing Message on indexer for Message property
-
-2002-04-21 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlCommand.cs: modified - to
- compile using mcs. This problem is
- returning a stronger type in csc vs. msc
-
- * System.Data.SqlClient/SqlConnection.cs: modified - msc
- can not do a using PGconn = IntPtr; and then declare
- with PGconn pgConn = IntPtr.Zero;
- Thiw works under csc though. Had to comment using and
- changed declaration to IntPtr pgConn = IntPtr.Zero;
- Also, got rid of compile warnings for hostaddr and port.
-
- * System.Data.SqlClient/SqlErrorCollection.cs: modified - got
- rid of compile warnings. Commented MonoTODO attribute because mcs
- doesn't seem to work with C# array property indexer (Item)
- this[int index]
-
- * System.Data.SqlClient/SqlParameterCollection.cs: modified -
- commented MonoTODO attribute for indexer for mcs compiling
-
- * Test/TestSqlIsolationLevel.cs:
- * Test/TestSqlInsert.cs:
- * Test/TestSqlException.cs: modified -
- removed extra ExecuteNonQuery which caused two inserted rows
-
-2002-04-20 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data/StateChangeEventArgs.cs - added
- needed to compile System.Data.dll with mcs.
-
-2002-04-20 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.OleDb: added directory - for OleDb database
- provider classes
-
- * System.Data.SqlClient/SqlClientPermission.cs
- * System.Data.SqlClient/SqlClientPermissionAttribute.cs
- * System.Data.SqlClient/SqlCommandBuilder.cs
- * System.Data.SqlClient/SqlInfoMessageEventHandler.cs
- * System.Data.SqlClient/SqlRowUpdatedEventArgs.cs
- * System.Data.SqlClient/SqlRowUpdatedEventHandler.cs
- * System.Data.SqlClient/SqlRowUpdatingEventArgs.cs
- * System.Data.SqlClient/SqlRowUpdatingEventHandler.cs
- * Test/TestSqlException.cs
- * Test/TestSqlIsolationLevel.cs: added - more tests
-
- * System.Data.build: modified - added new files - excludes these too
-
- * System.Data.SqlClient/PostgresLibrary.cs - modified - comment
-
- * System.Data.SqlClient/SqlConnection.cs
- * System.Data.SqlClient/SqlCommand.cs
- * System.Data.SqlClient/SqlTransaction.cs
- * System.Data.SqlClient/SqlException.cs
- * System.Data.SqlClient/SqlErrorCollection.cs
- * System.Data.SqlClient/SqlError.cs: modified - transaction and
- exception/error handling. SqlConnection(connectionString)
- constructor should not automatically connect.
-
- * System.Data.SqlClient/SqlDataReader.cs
- * System.Data.SqlClient/SqlDataAdapter.cs
- * System.Data.SqlClient/SqlParameter.cs
- * System.Data.SqlClient/SqlParameterCollection.cs: modified -
- added using System.ComponentModel;
-
- * Test/TestSqlInsert.cs: modified - to use transaction
-
-2002-04-17 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data/DataRow.cs: new skeletons.
-
- * System.Data.Common/DataAdapter.cs:
- * System.Data.Common/DataColumnMapping.cs:
- * System.Data.Common/DataColumnMappingCollection.cs:
- * System.Data.Common/DataTableMapping.cs:
- * System.Data.Common/DataTableMappingCollection.cs:
- * System.Data.Common/DbDataAdapter.cs:
- * System.Data.Common/RowUpdatedEventArgs.cs:
- * System.Data.SqlClient/SqlDataAdapter.cs:
- * System.Data.SqlClient/SqlInfoMessageEventArgs.cs: compilation
- fixes for Linux.
-
- * System.Data.Common/DbDataRecord.cs:
- * System.Data.Common/DbEnumerator.cs: removed MS implementation
- internal classes.
-
-2002-04-17 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/TestSqlInsert.cs: modified - do
- a SQL DELETE before SQL INSERT of row so you can use this
- test over and over.
-
- * System.Data.SqlClient/SqlTransaction.cs: modified - default
- IsolationLevel for PostgreSQL is ReadCommitted. However,
- PostgreSQL allows Serializable as well.
- (Thanks to Gonzalo for that!)
-
- * System.Data.SqlClient/SqlConnection.cs: modified
- * System.Data.SqlClient/SqlCommand.cs: modified
- * System.Data.SqlClient/SqlTransaction.cs: modified - got transactions
- working; however, we still need to implement SQL errors
- and exceptions to properly handle transactions. Also, added
- status and error message support from the PostgreSQL database.
- Currently, this does a Console.WriteLine() to display the
- status and error messages, but this is a TODO
- for SQL errors and exceptions.
-
- * System.Data/TODOAttribute.cs: added - needed MonoTODO
- attribute for System.Data.dll assembly
-
- * System.Data/IDbCommand.cs: modified - commented
- overloaded method ExecuteReader
- so System.Data.SqlClient.SqlCommand can compile
-
- * System.Data/IDbCommand.cs: modified
- * System.Data/IDbConnection.cs: modified - added using System;
- * System.Data/IDataParameter.cs
-
- * System.Data.build: modified - build classes
- in System.Data.SqlClient and exclude others in System.Data
-
- * System.Data.SqlClient/PostgresLibrary.cs: modified - change
- parameter data type from IntPtr to enum ExecStatusType
-
- * ChangeLog: modified - corrected previous entries in log
-
-2002-04-16 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.Common/DataColumnMappingCollection.cs: added basic
- implementation. Still missing some stuff.
-
-2002-04-16 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlConnection.cs: modified - got
- to compile, run, and connect to PostgreSQL database
-
- * System.Data.SqlClient/SqlCommand.cs: modified - got
- to compile, run, and execute a SQL INSERT command
- which successfully inserted a row
- into the PostgreSQL database
-
- * System.Data.SqlClient/SqlTransaction.cs: modified
- * System.Data.SqlClient/SqlParameter.cs: modified
- * System.Data.SqlClient/SqlParameterCollection.cs: modified
- * System.Data.SqlClient/SqlError.cs: modified
- * System.Data.SqlClient/SqlErrorCollection.cs: modified
- * System.Data.SqlClient/SqlException.cs: modified
- * System.Data.SqlClient/PostgresLibrary.cs: modified - to compile
-
- * System.Data.SqlClient/SqlAdapter: modified
- * System.Data.SqlClient/SqlReader: modified - add more stubs
-
-2002-04-16 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/TestSqlInsert.cs: added
-
-2002-04-15 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/SqlInfoMessageEventArgs.cs: added - using in
- class SqlConnecition
- * System.Data.SqlClient/SqlErrorCollection.cs: added
- * System.Data.SqlClient/SqlErrors.cs: removed - no such class SqlErrors
-
-2002-04-15 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * System.Data.IDbDataParameter: Added Interface to IDataParameter.
- * System.Data.IDbTransaction: Added Interface to IDisposable.
- * System.Data.IDbCommand: Fixed Capitalization of class name.
- * System.Data.IDbConnection: Fixed Capitalization of class name.
-
-2002-04-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.Common/DbDataPermissionAttribute.cs:
- * System.Data.Common/DataAdapter.cs:
- * System.Data.Common/DataColumnMapping.cs:
- * System.Data.Common/DbDataPermission.cs: added some implementation.
-
-2002-04-15 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.SqlClient/SqlConnection.cs: fixed constructor chaining
- syntax, as pointed out by Levent Camlibel.
-
-2002-04-14 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.SqlTypes/SqlBinary.cs:
- * System.Data.SqlTypes/INullable.cs: new skeletons.
-
-2002-04-14 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlClient/PostgresLibrary.cs: new internal class, which
- contains all calls the the PostgreSQL client library, to be used
- everywhere in System.Data.SqlClient.
-
-2002-03-30 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.SqlClient/SqlConnection.cs: implemented basic
- constructors.
-
- * System.Data.SqlTypes/SqlNullValueException.cs: new skeletons.
-
-2002-03-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.Common/DbDataRecord.cs:
- * System.Data.Common/DbEnumerator.cs:
- * System.Data.Common/RowUpdatedEventArgs.cs:
- * System.Data.Common/RowUpdatingEventArgs.cs:
- * System.Data.Common/DbDataPermissionAttribute.cs: new skeletons.
-
-2002-03-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.Common/DataTableMappingCollection.cs:
- * System.Data.Common/DbDataAdapter.cs:
- * System.Data.Common/DbDataPermission.cs:
- * System.Data.Common/DataTableMapping.cs: new skeletons.
-
- * System.Data.SqlClient/SqlDataAdapter.cs:
- * System.Data.SqlClient/SqlDataReader.cs:
- * System.Data.SqlClient/SqlErrors.cs:
- * System.Data.SqlClient/SqlError.cs:
- * System.Data.SqlClient/SqlException.cs:
- * System.Data.SqlClient/SqlParameter.cs:
- * System.Data.SqlClient/SqlParameterCollection.cs:
- * System.Data.SqlClient/SqlTransaction.cs:
- * System.Data.SqlClient/SqlCommand.cs: fixed skeletons.
-
-2002-03-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.Common/DataColumnMapping.cs:
- * System.Data.Common/DataColumnMappingCollection.cs:
- * System.Data.Common/DataAdapter.cs: created skeletons.
-
- * System.Data.build: exclude new directories from build.
-
-2002-03-27 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.SqlClient/SqlTransaction.cs: started implementation.
-
- * System.Data.SqlClient/SqlConnection.cs (BeginTransaction):
- implemented (2 methods).
-
-2002-03-24 Duncan Mak <duncan@ximian.com>
-
- * System.Data.build: Excluded System.Data.SqlClient from the build.
- The stubs are incomplete and they are stopping the build.
-
- * System.Data.SqlClient/SqlCommand.cs: Replaced 'implements' with ':'.
-
-2002-03-24 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.Data.SqlClient/*: added skeletons for the SQL managed
- provider for ADO.Net, to be based initially in PostgreSQL.
-
-2002-03-15 Christopher Podurgiel <cpodurgiel@msn.com>
-
- Changed the Namespace on some Enums from mono.System.Data to System.Data
-
-2002-03-01 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * DataColumnCollection.cs : When an existing DataColumn is added, will now Assign a
- default name if the ColumnName is null.
- * DataSet.cs : Added
- * DataTable.cs : Added
- * DataRelationCollection.cs : Added
- * DataTableRelationCollection.cs : Added
- * DataColumn : Added
-
-2002-02-11 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * DataColumnChangeEventArgs.cs : Added
- * DataColumnCollection.cs : Added
-
-2002-02-10 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * Removed *.cs from System.Data as the correct files are in mcs/class/System.Data/System.Data
- * Updated all Enums, Interfaces, and Delegates in System.Data
diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog
deleted file mode 100755
index f0950b30657..00000000000
--- a/mcs/class/System.Data/System.Data.Common/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2002-05-05 Miguel de Icaza <miguel@ximian.com>
-
- * DataTableMapping.cs, DataTableMappingCollection.cs: comment out
- interfaces we do not implement yet.
-
- * DbDataAdapter.cs: Stub IEnumerable, comment out interfaces
- we do not implement yet.
-
- * DbDataPermissionAttribute.cs: call base constructor.
-
diff --git a/mcs/class/System.Data/System.Data.Common/DataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DataAdapter.cs
deleted file mode 100644
index 2ec749be1c0..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DataAdapter.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// System.Data.Common.DataAdapter
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System.ComponentModel;
-using System.Data;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
- /// </summary>
- public abstract class DataAdapter : Component, IDataAdapter
- {
- #region Fields
-
- private bool acceptChangesDuringFill;
- private bool continueUpdateOnError;
- private MissingMappingAction missingMappingAction;
- private MissingSchemaAction missingSchemaAction;
- private DataTableMappingCollection tableMappings;
-
- #endregion
-
- #region Constructors
-
- protected DataAdapter ()
- {
- acceptChangesDuringFill = true;
- continueUpdateOnError = false;
- missingMappingAction = MissingMappingAction.Passthrough;
- missingSchemaAction = MissingSchemaAction.Add;
- tableMappings = new DataTableMappingCollection ();
- }
-
- #endregion
-
- #region Properties
-
- public bool AcceptChangesDuringFill {
- get { return acceptChangesDuringFill; }
- set { acceptChangesDuringFill = value; }
- }
-
- public bool ContinueUpdateOnError {
- get { return continueUpdateOnError; }
- set { continueUpdateOnError = value; }
- }
-
- public MissingMappingAction MissingMappingAction {
- get { return missingMappingAction; }
- set { missingMappingAction = value; }
- }
-
- public MissingSchemaAction MissingSchemaAction {
- get { return missingSchemaAction; }
- set { missingSchemaAction = value; }
- }
-
- public DataTableMappingCollection TableMappings {
- get { return tableMappings; }
- }
-
- ITableMappingCollection IDataAdapter.TableMappings {
- get { return TableMappings; }
- }
-
- #endregion
-
- #region Methods
-
-
- [MonoTODO]
- protected virtual DataAdapter CloneInternals ()
- {
- throw new NotImplementedException ();
- }
-
- protected virtual DataTableMappingCollection CreateTableMappings ()
- {
- tableMappings = new DataTableMappingCollection ();
- return tableMappings;
- }
-
- [MonoTODO]
- protected override void Dispose (bool disposing)
- {
- throw new NotImplementedException ();
- }
-
- public abstract int Fill (DataSet dataSet);
- public abstract DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType);
- public abstract IDataParameter[] GetFillParameters ();
-
- [MonoTODO]
- protected virtual bool ShouldSerializeTableMappings ()
- {
- throw new NotImplementedException ();
- }
-
- public abstract int Update (DataSet dataSet);
-
- #endregion
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs b/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs
deleted file mode 100644
index b38f62532ec..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Data.Common.DataColumnMapping
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Data;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Contains a generic column mapping for an object that inherits from DataAdapter. This class cannot be inherited.
- /// </summary>
- public sealed class DataColumnMapping : MarshalByRefObject, IColumnMapping, ICloneable
- {
- private string srcColumn;
- private string dsColumn;
-
- public DataColumnMapping () {
- srcColumn = null;
- dsColumn = null;
- }
-
- public DataColumnMapping(string sc, string dc) {
- srcColumn = sc;
- dsColumn = dc;
- }
-
- [MonoTODO]
- public DataColumn GetDataColumnBySchemaAction (
- DataTable dataTable,
- Type dataType,
- MissingSchemaAction schemaAction) {
- throw new NotImplementedException ();
- }
-
- public string DataSetColumn {
- get {
- return this.dsColumn;
- }
- set {
- this.dsColumn = value;
- }
- }
-
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException ();
- }
-
- public string SourceColumn {
- get {
- return this.srcColumn;
- }
- set {
- this.srcColumn = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs b/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs
deleted file mode 100644
index cf3a7ac7a8f..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DataColumnMappingCollection.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-//
-// System.Data.Common.DataColumnCollection
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System;
-using System.Collections;
-using System.Data;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Contains a collection of DataColumnMapping objects. This class cannot be inherited.
- /// </summary>
- public sealed class DataColumnMappingCollection : MarshalByRefObject, IColumnMappingCollection , IList, ICollection, IEnumerable
- {
- #region Fields
-
- ArrayList list;
- Hashtable sourceColumns;
- Hashtable dataSetColumns;
-
- #endregion
-
- #region Constructors
-
- public DataColumnMappingCollection ()
- {
- list = new ArrayList ();
- sourceColumns = new Hashtable ();
- dataSetColumns = new Hashtable ();
- }
-
- #endregion
-
- #region Properties
-
- public int Count {
- get { return list.Count; }
- }
-
- public DataColumnMapping this[int index] {
- get { return (DataColumnMapping)(list[index]); }
- set {
- DataColumnMapping mapping = (DataColumnMapping)(list[index]);
- sourceColumns[mapping] = value;
- dataSetColumns[mapping] = value;
- list[index] = value;
- }
- }
-
- public DataColumnMapping this[string sourceColumn] {
- get { return (DataColumnMapping)(sourceColumns[sourceColumn]); }
- set { this[list.IndexOf (sourceColumns[sourceColumn])] = value; }
- }
-
- object ICollection.SyncRoot {
- get { return list.SyncRoot; }
- }
-
- bool ICollection.IsSynchronized {
- get { return list.IsSynchronized; }
- }
-
- object IColumnMappingCollection.this[string sourceColumn] {
- get { return this[sourceColumn]; }
- set {
- if (!(value is DataColumnMapping))
- throw new ArgumentException ();
- this[sourceColumn] = (DataColumnMapping)value;
- }
- }
-
- object IList.this[int index] {
- get { return this[index]; }
- set {
- if (!(value is DataColumnMapping))
- throw new ArgumentException ();
- this[index] = (DataColumnMapping)value;
- }
- }
-
- bool IList.IsReadOnly {
- get { return false; }
- }
-
- bool IList.IsFixedSize {
- get { return false; }
- }
-
-
- #endregion
-
- #region Methods
-
- public int Add (object value)
- {
- if (!(value is DataColumnMapping))
- throw new InvalidCastException ();
-
- list.Add (value);
- sourceColumns[((DataColumnMapping)value).SourceColumn] = value;
- dataSetColumns[((DataColumnMapping)value).DataSetColumn] = value;
- return list.IndexOf (value);
- }
-
- public DataColumnMapping Add (string sourceColumn, string dataSetColumn)
- {
- DataColumnMapping mapping = new DataColumnMapping (sourceColumn, dataSetColumn);
- Add (mapping);
- return mapping;
- }
-
- public void AddRange (DataColumnMapping[] values)
- {
- foreach (DataColumnMapping mapping in values)
- Add (mapping);
- }
-
- public void Clear ()
- {
- list.Clear ();
- }
-
- public bool Contains (object value)
- {
- return (list.Contains (value));
- }
-
- public bool Contains (string value)
- {
- return (sourceColumns.Contains (value));
- }
-
- public void CopyTo (Array array, int index)
- {
- ((DataColumn[])(list.ToArray())).CopyTo (array, index);
- }
-
- public DataColumnMapping GetByDataSetColumn (string value)
- {
- return (DataColumnMapping)(dataSetColumns[value]);
- }
-
- public static DataColumnMapping GetColumnMappingBySchemaAction (DataColumnMappingCollection columnMappings, string sourceColumn, MissingMappingAction mappingAction)
- {
- if (columnMappings.Contains (sourceColumn))
- return columnMappings[sourceColumn];
-
- if (mappingAction == MissingMappingAction.Ignore)
- return null;
-
- if (mappingAction == MissingMappingAction.Error)
- throw new SystemException ();
-
- return new DataColumnMapping (sourceColumn, sourceColumn);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
- IColumnMapping IColumnMappingCollection.Add (string sourceColumnName, string dataSetColumnName)
- {
- return Add (sourceColumnName, dataSetColumnName);
- }
-
- IColumnMapping IColumnMappingCollection.GetByDataSetColumn (string dataSetColumnName)
- {
- return GetByDataSetColumn (dataSetColumnName);
- }
-
- public int IndexOf (object value)
- {
- return list.IndexOf (value);
- }
-
- public int IndexOf (string sourceColumn)
- {
- return list.IndexOf (sourceColumns[sourceColumn]);
- }
-
- public int IndexOfDataSetColumn (string value)
- {
- return list.IndexOf (dataSetColumns[value]);
- }
-
- public void Insert (int index, object value)
- {
- list.Insert (index, value);
- sourceColumns[((DataColumnMapping)value).SourceColumn] = value;
- dataSetColumns[((DataColumnMapping)value).DataSetColumn] = value;
- }
-
- public void Remove (object value)
- {
- sourceColumns.Remove(((DataColumnMapping)value).SourceColumn);
- dataSetColumns.Remove(((DataColumnMapping)value).DataSetColumn);
- list.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- Remove (list[index]);
- }
-
- public void RemoveAt (string sourceColumn)
- {
- RemoveAt (list.IndexOf (sourceColumns[sourceColumn]));
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DataTableMapping.cs b/mcs/class/System.Data/System.Data.Common/DataTableMapping.cs
deleted file mode 100644
index 426406e958d..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DataTableMapping.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.Data.Common.DataTableMapping.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Data;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Contains a description of a mapped relationship between a source table and a DataTable. This class is used by a DataAdapter when populating a DataSet.
- /// </summary>
- public sealed class DataTableMapping : MarshalByRefObject, ITableMapping, ICloneable
- {
- #region Fields
-
- string sourceTable;
- string dataSetTable;
- DataColumnMappingCollection columnMappings;
-
- #endregion
-
- #region Constructors
-
- public DataTableMapping ()
- {
- dataSetTable = String.Empty;
- sourceTable = String.Empty;
- columnMappings = new DataColumnMappingCollection ();
- }
-
- public DataTableMapping (string sourceTable, string dataSetTable)
- : this ()
- {
- this.sourceTable = sourceTable;
- this.dataSetTable = dataSetTable;
- }
-
- public DataTableMapping (string sourceTable, string dataSetTable, DataColumnMapping[] columnMappings)
- : this (sourceTable, dataSetTable)
- {
- this.columnMappings.AddRange (columnMappings);
- }
-
- #endregion
-
- #region Properties
-
- public DataColumnMappingCollection ColumnMappings {
- get { return columnMappings; }
- }
-
- public string DataSetTable {
- get { return dataSetTable; }
- set { dataSetTable = value; }
- }
-
- public string SourceTable {
- get { return sourceTable; }
- set { sourceTable = value; }
- }
-
- IColumnMappingCollection ITableMapping.ColumnMappings {
- get { return ColumnMappings; }
- }
-
- #endregion
-
- #region Methods
-
- public DataColumnMapping GetColumnMappingBySchemaAction (string sourceColumn, MissingMappingAction mappingAction)
- {
- return DataColumnMappingCollection.GetColumnMappingBySchemaAction (columnMappings, sourceColumn, mappingAction);
- }
-
- [MonoTODO]
- public DataTable GetDataTableBySchemaAction (DataSet dataSet, MissingSchemaAction schemaAction)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return SourceTable;
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DataTableMappingCollection.cs b/mcs/class/System.Data/System.Data.Common/DataTableMappingCollection.cs
deleted file mode 100644
index 614b979a1b9..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DataTableMappingCollection.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-//
-// System.Data.Common.DataTableMappingCollection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System;
-using System.Collections;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// A collection of DataTableMapping objects. This class cannot be inherited.
- /// </summary>
- public sealed class DataTableMappingCollection : MarshalByRefObject, ITableMappingCollection, IList, ICollection, IEnumerable
- {
- #region Fields
-
- ArrayList mappings;
- Hashtable sourceTables;
- Hashtable dataSetTables;
-
- #endregion
-
- #region Constructors
-
- public DataTableMappingCollection()
- {
- mappings = new ArrayList ();
- sourceTables = new Hashtable ();
- dataSetTables = new Hashtable ();
- }
-
- #endregion
-
- #region Properties
-
- public int Count
- {
- get { return mappings.Count; }
- }
-
- public DataTableMapping this[int index] {
- get { return (DataTableMapping)(mappings[index]); }
- set {
- DataTableMapping mapping = (DataTableMapping)(mappings[index]);
- sourceTables[mapping.SourceTable] = value;
- dataSetTables[mapping.DataSetTable] = value;
- mappings[index] = value;
- }
- }
-
- [MonoTODO]
- public DataTableMapping this[string sourceTable] {
- get { return (DataTableMapping)(sourceTables[sourceTable]); }
- set { this[mappings.IndexOf(sourceTables[sourceTable])] = value; }
- }
-
-
- object IList.this[int index] {
- get { return (object)(this[index]); }
- set {
- if (!(value is DataTableMapping))
- throw new ArgumentException ();
- this[index] = (DataTableMapping)value;
- }
- }
-
- bool IList.IsReadOnly {
- get { return false; }
- }
-
- bool IList.IsFixedSize {
- get { return false; }
- }
-
- object ICollection.SyncRoot {
- get { return mappings.SyncRoot; }
- }
-
- bool ICollection.IsSynchronized {
- get { return mappings.IsSynchronized; }
- }
-
- object ITableMappingCollection.this[string sourceTable] {
- get { return this[sourceTable]; }
- set {
- if (!(value is DataTableMapping))
- throw new ArgumentException ();
- this[sourceTable] = (DataTableMapping)(value);
- }
- }
-
- #endregion
-
- #region Methods
-
- public int Add (object value)
- {
- if (!(value is System.Data.Common.DataTableMapping))
- throw new SystemException ("The object passed in was not a DataTableMapping object.");
-
- sourceTables[((DataTableMapping)value).SourceTable] = value;
- dataSetTables[((DataTableMapping)value).DataSetTable] = value;
- return mappings.Add (value);
- }
-
- public DataTableMapping Add (string sourceTable, string dataSetTable)
- {
- DataTableMapping mapping = new DataTableMapping (sourceTable, dataSetTable);
- Add (mapping);
- return mapping;
- }
-
- public void AddRange(DataTableMapping[] values)
- {
- foreach (DataTableMapping dataTableMapping in values)
- this.Add (dataTableMapping);
- }
-
- public void Clear()
- {
- sourceTables.Clear ();
- dataSetTables.Clear ();
- mappings.Clear ();
- }
-
- public bool Contains (object value)
- {
- return mappings.Contains (value);
- }
-
- public bool Contains (string value)
- {
- return sourceTables.Contains (value);
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
- public DataTableMapping GetByDataSetTable (string dataSetTable)
- {
- return (DataTableMapping)(dataSetTables[dataSetTable]);
- }
-
- public static DataTableMapping GetTableMappingBySchemaAction (DataTableMappingCollection tableMappings, string sourceTable, string dataSetTable, MissingMappingAction mappingAction)
- {
- if (tableMappings.Contains (sourceTable))
- return tableMappings[sourceTable];
- if (mappingAction == MissingMappingAction.Error)
- throw new InvalidOperationException ();
- if (mappingAction == MissingMappingAction.Ignore)
- return null;
- return new DataTableMapping (sourceTable, dataSetTable);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return mappings.GetEnumerator ();
- }
-
- public int IndexOf (object value)
- {
- return mappings.IndexOf (value);
- }
-
- public int IndexOf (string sourceTable)
- {
- return IndexOf (sourceTables[sourceTable]);
- }
-
- public int IndexOfDataSetTable (string dataSetTable)
- {
- return IndexOf ((DataTableMapping)(dataSetTables[dataSetTable]));
- }
-
- [MonoTODO]
- public void Insert (int index, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ITableMapping ITableMappingCollection.Add (string sourceTableName, string dataSetTableName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ITableMapping ITableMappingCollection.GetByDataSetTable (string dataSetTableName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt (int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt (string index)
- {
- throw new NotImplementedException ();
- }
-
-
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
deleted file mode 100644
index a6af3ff84ab..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-// System.Data.Common.DbDataAdapter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System.Collections;
-using System.Data;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Aids implementation of the IDbDataAdapter interface. Inheritors of DbDataAdapter implement a set of functions to provide strong typing, but inherit most of the functionality needed to fully implement a DataAdapter.
- /// </summary>
- public abstract class DbDataAdapter : DataAdapter, ICloneable
- {
- #region Fields
-
- public const string DefaultSourceTableName = "Table";
-
- #endregion
-
- #region Constructors
-
- protected DbDataAdapter()
- {
- }
-
- #endregion
-
- #region Properties
-
- IDbCommand DeleteCommand {
- get { return ((IDbDataAdapter)this).DeleteCommand; }
- }
-
- IDbCommand InsertCommand {
- get { return ((IDbDataAdapter)this).InsertCommand; }
- }
-
- IDbCommand SelectCommand {
- get { return ((IDbDataAdapter)this).SelectCommand; }
- }
-
-
- IDbCommand UpdateCommand {
- get { return ((IDbDataAdapter)this).UpdateCommand; }
- }
-
- #endregion
-
- #region Methods
-
- protected abstract RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping);
- protected abstract RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping);
-
- [MonoTODO]
- protected override void Dispose (bool disposing)
- {
- throw new NotImplementedException ();
- }
-
- public override int Fill (DataSet dataSet)
- {
- return Fill (dataSet, DefaultSourceTableName);
- }
-
- public int Fill (DataTable dataTable)
- {
- return Fill (dataTable.DataSet, dataTable.TableName);
- }
-
- public int Fill (DataSet dataSet, string srcTable)
- {
- return Fill (dataSet, 0, 0, srcTable);
- }
-
- protected virtual int Fill (DataTable dataTable, IDataReader dataReader)
- {
- return Fill (dataTable.DataSet, dataTable.TableName, dataReader, 0, 0);
- }
-
- protected virtual int Fill (DataTable dataTable, IDbCommand command, CommandBehavior behavior)
- {
- return Fill (dataTable.DataSet, 0, 0, dataTable.TableName, command, behavior);
- }
-
- public int Fill (DataSet dataSet, int startRecord, int maxRecords, string srcTable)
- {
- return this.Fill (dataSet, startRecord, maxRecords, srcTable, SelectCommand, CommandBehavior.Default);
- }
-
- protected virtual int Fill (DataSet dataSet, string srcTable, IDataReader dataReader, int startRecord, int maxRecords)
- {
- if (startRecord < 0)
- throw new ArgumentException ("The startRecord parameter was less than 0.");
- if (maxRecords < 0)
- throw new ArgumentException ("The maxRecords parameter was less than 0.");
-
- DataTable table;
- int readCount = 0;
- int resultCount = 0;
-
- string tableName = srcTable;
- string baseColumnName;
- string columnName;
- ArrayList primaryKey;
- bool resultsFound;
- object[] itemArray;
- DataTableMapping tableMapping;
-
- DataRow row; // FIXME needed for incorrect operation below.
-
- do
- {
- if (dataSet.Tables.Contains (tableName))
- table = dataSet.Tables[tableName];
- else
- table = new DataTable (tableName);
-
- primaryKey = new ArrayList ();
-
- foreach (DataRow schemaRow in dataReader.GetSchemaTable ().Rows)
- {
- // generate a unique column name in the dataset table.
- baseColumnName = (string)(schemaRow["BaseColumnName"]);
- if (baseColumnName == "")
- baseColumnName = "Column";
-
- columnName = baseColumnName;
-
- for (int i = 1; table.Columns.Contains (columnName); i += 1)
- columnName = String.Format ("{0}{1}", baseColumnName, i);
-
-
- tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (TableMappings, tableName, (string)(schemaRow["BaseTableName"]), MissingMappingAction);
-
- // check to see if the column mapping exists
- if (tableMapping.ColumnMappings.IndexOfDataSetColumn (baseColumnName) < 0)
- {
- if (MissingSchemaAction == MissingSchemaAction.Error)
- throw new SystemException ();
-
- table.Columns.Add (columnName, Type.GetType ((string)(schemaRow["DataType"])));
- tableMapping.ColumnMappings.Add (columnName, baseColumnName);
-
- }
-
- if (!TableMappings.Contains (tableMapping))
- TableMappings.Add (tableMapping);
-
- if ((schemaRow["IsKey"]).Equals(DBNull.Value) == false)
- if ((bool)(schemaRow["IsKey"]))
- primaryKey.Add (table.Columns[columnName]);
- }
-
- if (MissingSchemaAction == MissingSchemaAction.AddWithKey && primaryKey.Count > 0)
- table.PrimaryKey = (DataColumn[])(primaryKey.ToArray());
-
-
- for (int k = 0; k < startRecord; k += 1)
- dataReader.Read ();
-
- resultsFound = false;
-
- itemArray = new object[dataReader.FieldCount];
-
- while (dataReader.Read () && !(maxRecords > 0 && readCount >= maxRecords))
- {
- dataReader.GetValues (itemArray);
- row = table.Rows.Add (itemArray);
- if (AcceptChangesDuringFill)
- row.AcceptChanges ();
-
- /* FIXME
-
- this is the way it should be done, but LoadDataRow has not been implemented yet.
-
- table.BeginLoadData ();
- table.LoadDataRow (itemArray, AcceptChangesDuringFill);
- table.EndLoadData ();
- */
-
- readCount += 1;
- resultsFound = true;
- }
-
- if (resultsFound)
- {
- dataSet.Tables.Add (table);
- tableName = String.Format ("{0}{1}", srcTable, ++resultCount);
- }
-
-
- startRecord = 0;
- maxRecords = 0;
- } while (dataReader.NextResult ());
-
- dataReader.Close ();
- return readCount;
- }
-
- protected virtual int Fill (DataSet dataSet, int startRecord, int maxRecords, string srcTable, IDbCommand command, CommandBehavior behavior)
- {
- if (command.Connection.State == ConnectionState.Closed)
- {
- command.Connection.Open ();
- behavior |= CommandBehavior.CloseConnection;
- }
-
- return this.Fill (dataSet, srcTable, command.ExecuteReader (behavior), startRecord, maxRecords);
- }
-
- [MonoTODO]
- public override DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataTable FillSchema (DataTable dataTable, SchemaType schemaType)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType, string srcTable)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual DataTable FillSchema (DataTable dataTable, SchemaType schemaType, IDbCommand command, CommandBehavior behavior)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType, IDbCommand command, string srcTable, CommandBehavior behavior)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IDataParameter[] GetFillParameters ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (DataRow[] dataRows)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int Update (DataSet ds)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (DataTable dt)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual int Update (DataRow[] row, DataTableMapping dtm)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Update (DataSet ds, string s)
- {
- throw new NotImplementedException ();
- }
-
-
-
- [MonoTODO]
- protected virtual void OnFillError (FillErrorEventArgs value)
- {
- throw new NotImplementedException ();
- }
-
- protected abstract void OnRowUpdated (RowUpdatedEventArgs value);
- protected abstract void OnRowUpdating (RowUpdatingEventArgs value);
-
- #endregion
-
- #region Events
-
- public event FillErrorEventHandler FillError;
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataPermission.cs b/mcs/class/System.Data/System.Data.Common/DbDataPermission.cs
deleted file mode 100644
index 72f92da0d8a..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DbDataPermission.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// System.Data.Common.DbDataAdapter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Provides the capability for a .NET data provider to ensure that a user has a security level adequate for accessing data.
- /// </summary>
- public abstract class DBDataPermission : CodeAccessPermission,
- IUnrestrictedPermission
- {
- private bool allowBlankPassword;
- private PermissionState permissionState;
-
- protected DBDataPermission () {
- allowBlankPassword = false;
- permissionState = PermissionState.None;
- }
-
- protected DBDataPermission (PermissionState state) {
- allowBlankPassword = false;
- permissionState = state;
- }
-
- public DBDataPermission (PermissionState state, bool abp) {
- allowBlankPassword = abp;
- permissionState = state;
- }
-
- public override IPermission Copy () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void FromXml (SecurityElement securityElement) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Intersect (IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool IsSubsetOf (IPermission target) {
- throw new NotImplementedException ();
- }
-
- public bool IsUnrestricted () {
- if (permissionState == PermissionState.Unrestricted)
- return true;
- return false;
- }
-
- [MonoTODO]
- public override SecurityElement ToXml () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Union (IPermission target) {
- throw new NotImplementedException ();
- }
-
- public bool AllowBlankPassword {
- get {
- return allowBlankPassword;
- }
- set {
- allowBlankPassword = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs b/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs
deleted file mode 100644
index 6968ba77ec3..00000000000
--- a/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Data.Common.DbDataPermissionAttribute.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Security.Permissions;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Associates a security action with a custom security attribute.
- /// </summary>
- public abstract class DBDataPermissionAttribute : CodeAccessSecurityAttribute
- {
- private SecurityAction securityAction;
- private bool allowBlankPassword;
-
- protected DBDataPermissionAttribute (SecurityAction action) : base (action) {
- securityAction = action;
- allowBlankPassword = false;
- }
-
- public bool AllowBlankPassword {
- get {
- return allowBlankPassword;
- }
- set {
- allowBlankPassword = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/RowUpdatedEventArgs.cs b/mcs/class/System.Data/System.Data.Common/RowUpdatedEventArgs.cs
deleted file mode 100644
index ab3aebe4451..00000000000
--- a/mcs/class/System.Data/System.Data.Common/RowUpdatedEventArgs.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Data.Common.RowUpdatedEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Data;
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Provides data for the RowUpdated event of a .NET data provider.
- /// </summary>
- public abstract class RowUpdatedEventArgs : EventArgs
- {
- [MonoTODO]
- protected RowUpdatedEventArgs(DataRow dataRow,
- IDbCommand command,
- StatementType statementType,
- DataTableMapping tableMapping) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IDbCommand Command {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public Exception Errors {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public int RecordsAffected {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DataRow Row {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public StatementType StatementType {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public UpdateStatus Status {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DataTableMapping TableMapping {
- get { throw new NotImplementedException (); }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.Common/RowUpdatingEventArgs.cs b/mcs/class/System.Data/System.Data.Common/RowUpdatingEventArgs.cs
deleted file mode 100644
index 6d5eae65d84..00000000000
--- a/mcs/class/System.Data/System.Data.Common/RowUpdatingEventArgs.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Data.Common.RowUpdatingEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-namespace System.Data.Common
-{
- /// <summary>
- /// Provides the data for the RowUpdating event of a .NET data provider.
- /// </summary>
- public abstract class RowUpdatingEventArgs : EventArgs
- {
- [MonoTODO]
- protected RowUpdatingEventArgs(DataRow dataRow,
- IDbCommand command,
- StatementType statementType,
- DataTableMapping tableMapping) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IDbCommand Command {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public Exception Errors {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DataRow Row {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public StatementType StatementType {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public UpdateStatus Status {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public DataTableMapping TableMapping {
- get { throw new NotImplementedException (); }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/ChangeLog b/mcs/class/System.Data/System.Data.OleDb/ChangeLog
deleted file mode 100644
index 3a6f8344d76..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/ChangeLog
+++ /dev/null
@@ -1,73 +0,0 @@
-2002-06-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * OleDbParameterCollection.cs (GetEnumerator, SyncRoot,
- IsSynchronized): implemented.
-
-2002-06-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * OleDbTransaction.cs (Dispose): added missing method.
-
- * OleDbCommand.cs (Clone): added missing methods.
- (Parameters, Transaction, Connection): made these overload
- IDbCommand's ones.
-
- * OleDbParameterCollection.cs (IndexOf, Remove, RemoveAt):
- call m_list methods, not own ones.
-
- * OleDbParameter.cs: more implementation.
-
-2002-06-02 Rodrigo Moya <rodrigo@ximian.com>
-
- * OleDbTransaction.cs (Connection, IsolationLevel, Begin,
- Commit, Rollback): implemented.
- (GdaConnection): added new internal property.
-
- * OleDbParameter.cs:
- * OleDbParameterCollection.cs: implemented some methods and
- properties.
-
- * libgda.cs: added yet more libgda API functions.
-
-2002-06-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * libgda.cs: added new libgda API functions.
-
- * OleDbConnection.cs (Provider): implemented.
- (BeginTransaction): made it overload IDbConnection methods.
- (ChangeDatabase): new stub, needs some work on libgda for being
- implemented.
- (Clone): new stub.
- (Close): implemented.
- (CreateCommand): implemented.
- (GetOleDbSchemaTable): new stub, until I understand what to do here.
- (Open): implemented basic stuff, which is just supporting connection
- strings that represent a GDA data source name. More to come.
- (InfoMessage, StateChange): added events.
-
- * TestOleDb.cs: test program for System.Data.OleDb.
-
-2002-05-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * libgda.cs: added static constructor.
- (GdaClient): new static property to get the underlying GdaClient
- object.
-
- * OleDbConnection.cs: removed GDA initialization, which belongs to
- the static 'libgda' class.
-
-2002-05-29 Rodrigo Moya <rodrigo@ximian.com>
-
- * libgda.cs: static class for libgda API calls.
-
- * OleDbConnection.cs: implemented constructors.
- (ConnectionString, Connectiontimeout, Database, State):
- implemented class properties.
- (BeginTransaction): implemented.
-
- * OleDbTransaction.cs: implemented protected constructors.
-
- * TestGDA.cs: simple test for libgda API.
-
-2002-05-27 Rodrigo Moya <rodrigo@ximian.com>
-
- Started System.Data.OleDb provider, based on libgda.
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbCommand.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbCommand.cs
deleted file mode 100644
index 15cc1a2bda4..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbCommand.cs
+++ /dev/null
@@ -1,201 +0,0 @@
-//
-// System.Data.OleDb.OleDbCommand
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- /// <summary>
- /// Represents an SQL statement or stored procedure to execute against a data source.
- /// </summary>
- public sealed class OleDbCommand : Component, ICloneable, IDbCommand
- {
- private string m_command_string = null;
- private OleDbConnection m_connection = null;
- private OleDbTransaction m_transaction = null;
- private int m_timeout = 30; // 30 is the default, as per .NET docs
- private CommandType m_type = CommandType.Text;
- private OleDbParameterCollection m_parameters;
-
- /*
- * Constructors
- */
-
- public OleDbCommand ()
- {
- m_parameters = new OleDbParameterCollection ();
- }
-
- public OleDbCommand (string s) : this ()
- {
- m_command_string = s;
- }
-
- public OleDbCommand (string s, OleDbConnection cnc) : this ()
- {
- m_command_string = s;
- m_connection = cnc;
- }
-
- public OleDbCommand (string s,
- OleDbConnection cnc,
- OleDbTransaction xtrans) : this ()
- {
- m_command_string = s;
- m_connection = cnc;
- m_transaction = xtrans;
- }
-
- /*
- * Properties
- */
-
- string IDbCommand.CommandText
- {
- get {
- return m_command_string;
- }
- set {
- m_command_string = value;
- }
- }
-
- int IDbCommand.CommandTimeout
- {
- get {
- return m_timeout;
- }
- set {
- m_timeout = value;
- }
- }
-
- CommandType IDbCommand.CommandType
- {
- get {
- return m_type;
- }
- set {
- m_type = value;
- }
- }
-
- IDbConnection IDbCommand.Connection
- {
- get {
- return m_connection;
- }
- set {
- m_connection = (OleDbConnection) value;
- }
- }
-
- public bool DesignTimeVisible
- {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- IDataParameterCollection IDbCommand.Parameters
- {
- get {
- return m_parameters;
- }
- }
-
- IDbTransaction IDbCommand.Transaction
- {
- get {
- return m_transaction;
- }
- set {
- m_transaction = (OleDbTransaction) value;
- }
- }
-
- UpdateRowSource IDbCommand.UpdatedRowSource
- {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- /*
- * Methods
- */
-
- [MonoTODO]
- void IDbCommand.Cancel ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException ();
- }
-
- IDbDataParameter IDbCommand.CreateParameter ()
- {
- return new OleDbParameter ();
- }
-
-
- int IDbCommand.ExecuteNonQuery ()
- {
- if (m_command_string == null)
- return -1;
-
- // FIXME
- return 0;
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader (CommandBehavior behavior)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- object IDbCommand.ExecuteScalar ()
- {
- throw new NotImplementedException ();
- }
-
- void IDbCommand.Prepare ()
- {
- // FIXME: prepare string with parameters
- }
-
- public void ResetCommandTimeout ()
- {
- m_timeout = 30;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs
deleted file mode 100644
index 60a3d4e5e68..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbCommandBuilder.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Data.OleDb.OleDbCommandBuilder
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- /// <summary>
- /// Provides a means of automatically generating single-table commands used to reconcile changes made to a DataSet with the associated database. This class cannot be inherited.
- /// </summary>
- public sealed class OleDbCommandBuilder : Component
- {
- private OleDbDataAdapter m_adapter = null;
-
- public OleDbCommandBuilder ()
- {
- }
-
- public OleDbCommandBuilder (OleDbDataAdapter adapter) : this ()
- {
- m_adapter = adapter;
- }
-
- public OleDbDataAdapter DataAdapter
- {
- get {
- return m_adapter;
- }
- set {
- m_adapter = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs
deleted file mode 100644
index 77ca8c77f95..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbConnection.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// System.Data.OleDb.OleDbConnection
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Exception;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbConnection : Component, ICloneable, IDbConnection
- {
- private IntPtr m_gdaConnection = IntPtr.Zero;
- private string m_string = "";
- private int m_timeout = 15; // default is 15 seconds
-
- /*
- * Constructors
- */
-
- public OleDbConnection ()
- {
- }
-
- /*
- * Properties
- */
-
- public OleDbConnection (string cnc_string) : this ()
- {
- m_string = cnc_string;
- }
-
- string IDbConnection.ConnectionString
- {
- get {
- return m_string;
- }
- set {
- m_string = value;
- }
- }
-
- int IDbConnection.ConnectionTimeout
- {
- get {
- return m_timeout;
- }
- }
-
- string IDbConnection.Database
- {
- get {
- if (m_gdaConnection != IntPtr.Zero
- && libgda.gda_connection_is_open (m_gdaConnection)) {
- return libgda.gda_connection_get_database (m_gdaConnection);
- }
-
- return null;
- }
- }
-
- public string DataSource
- {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string Provider
- {
- get {
- if (m_gdaConnection != IntPtr.Zero
- && libgda.gda_connection_is_open (m_gdaConnection)) {
- return libgda.gda_connection_get_provider (m_gdaConnection);
- }
-
- return null;
- }
- }
-
- public string ServerVersion
- {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- ConnectionState IDbConnection.State
- {
- get {
- if (m_gdaConnection != IntPtr.Zero) {
- if (libgda.gda_connection_is_open (m_gdaConnection))
- return ConnectionState.Open;
- }
-
- return ConnectionState.Closed;
- }
- }
-
- internal IntPtr GdaConnection
- {
- get {
- return m_gdaConnection;
- }
- }
-
- /*
- * Methods
- */
-
- IDbTransaction IDbConnection.BeginTransaction ()
- {
- if (m_gdaConnection != IntPtr.Zero)
- return new OleDbTransaction (this);
-
- return null;
- }
-
- IDbTransaction IDbConnection.BeginTransaction (IsolationLevel level)
- {
- if (m_gdaConnection != IntPtr.Zero)
- return new OleDbTransaction (this, level);
-
- return null;
- }
-
- void IDbConnection.ChangeDatabase (string name)
- {
- // FIXME: see http://bugzilla.gnome.org/show_bug.cgi?id=83315
- }
-
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException();
- }
-
- void IDbConnection.Close ()
- {
- if (m_gdaConnection != IntPtr.Zero) {
- libgda.gda_connection_close (m_gdaConnection);
- m_gdaConnection = IntPtr.Zero;
- }
- }
-
- IDbCommand IDbConnection.CreateCommand ()
- {
- if (m_gdaConnection != IntPtr.Zero
- && libgda.gda_connection_is_open (m_gdaConnection)) {
- return new OleDbCommand ();
- }
-
- return null;
- }
-
- [MonoTODO]
- public DataTable GetOleDbSchemaTable (Guid schema,
- object[] restrictions)
- {
- throw new NotImplementedException ();
- }
-
- void IDbConnection.Open ()
- {
- if (m_gdaConnection != IntPtr.Zero ||
- libgda.gda_connection_is_open (m_gdaConnection))
- throw new InvalidOperationException ();
-
- m_gdaConnection = libgda.gda_client_open_connection (
- libgda.GdaClient,
- m_string,
- "", "");
- }
-
- /*
- * Events
- */
-
- public event OleDbInfoMessageEventHandler InfoMessage;
- public event StateChangeEventHandler StateChange;
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbDataAdapter.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbDataAdapter.cs
deleted file mode 100644
index 0142cce91aa..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbDataAdapter.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.OleDb.OleDbDataAdapter
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbDataAdapter : DbDataAdapter, IDbDataAdapter
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs
deleted file mode 100644
index aa44e268b2c..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Data.OleDb.OleDbDataReader
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbDataReader : MarshalByRefObject,
- IDataReader, IDisposable, IDataRecord, IEnumerable
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs
deleted file mode 100644
index ad6b97c1a93..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbError.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.OleDb.OleDbError
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbError
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs
deleted file mode 100644
index e7e796a5a8d..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbErrorCollection.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Data.OleDb.OleDbErrorCollection
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbErrorCollection : ICollection, IEnumerable
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs
deleted file mode 100644
index edb036cb998..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbException.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Data.OleDb.OleDbException
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.OleDb
-{
- [Serializable]
- public sealed class OleDbException : ExternalException
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventArgs.cs
deleted file mode 100644
index 1d6fda59dff..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventArgs.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.OleDb.OleDbInfoMessageEventArgs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbInfoMessageEventArgs : EventArgs
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventHandler.cs
deleted file mode 100644
index e10f3950314..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbInfoMessageEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Data.OleDb.OleDbInfoMessageEventHandler
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- [Serializable]
- public delegate void OleDbInfoMessageEventHandler (
- object sender,
- OleDbInfoMessageEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbLiteral.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbLiteral.cs
deleted file mode 100644
index b9b2da42d27..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbLiteral.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Data.OleDb.OleDbLiteral
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public enum OleDbLiteral {
- Binary_Literal,
- Catalog_Name,
- Catalog_Separator,
- Char_Literal,
- Column_Alias,
- Column_Name,
- Correlation_Name,
- Cube_Name,
- Cursor_Name,
- Dimension_Name,
- Escape_Percent_Prefix,
- Escape_Percent_Suffix,
- Escape_Underscore_Prefix,
- Escape_Underscore_Suffix,
- Hierarchy_Name,
- Index_Name,
- Invalid,
- Level_Name,
- Like_Percent,
- Like_Underscore,
- Member_Name,
- Procedure_Name,
- Property_Name,
- Quote_Prefix,
- Quote_Suffix,
- Schema_Name,
- Schema_Separator,
- Table_Name,
- Text_Command,
- User_Name,
- View_Name
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs
deleted file mode 100644
index 02aaf32d60b..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbParameter.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// System.Data.OleDb.OleDbParameter
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbParameter : MarshalByRefObject,
- IDbDataParameter, IDataParameter, ICloneable
- {
- private string m_name = null;
- private object m_value = null;
- private int m_size = 0;
- private bool m_isNullable = true;
- private byte m_precision = 0;
- private byte m_scale = 0;
- private DataRowVersion m_sourceVersion;
- private string m_sourceColumn = null;
- private ParameterDirection m_direction;
- private DbType m_type;
-
- /*
- * Constructors
- */
-
- public OleDbParameter ()
- {
- }
-
- public OleDbParameter (string name, object value) : this ()
- {
- m_name = name;
- m_value = value;
- }
-
- public OleDbParameter (string name, OleDbType type) : this ()
- {
- m_name = name;
- m_type = (DbType) type;
- }
-
- public OleDbParameter (string name, OleDbType type, int width)
- : this (name, type)
- {
- m_size = width;
- }
-
- public OleDbParameter (string name, OleDbType type,
- int width, string src_col)
- : this (name, type, width)
- {
- m_name = name;
- m_type = (DbType) type;
- m_size = width;
- m_sourceColumn = src_col;
- }
-
- public OleDbParameter(string name, OleDbType type,
- int width, ParameterDirection direction,
- bool is_nullable, byte precision,
- byte scale, string src_col,
- DataRowVersion src_version, object value)
- : this (name, type, width, src_col)
- {
- m_direction = direction;
- m_isNullable = is_nullable;
- m_precision = precision;
- m_scale = scale;
- m_sourceVersion = src_version;
- m_value = value;
- }
-
- /*
- * Properties
- */
-
- DbType IDataParameter.DbType
- {
- get {
- return m_type;
- }
- set {
- m_type = value;
- }
- }
-
- ParameterDirection IDataParameter.Direction
- {
- get {
- return m_direction;
- }
- set {
- m_direction = value;
- }
- }
-
- bool IDataParameter.IsNullable
- {
- get {
- return m_isNullable;
- }
- set {
- m_isNullable = value;
- }
- }
-
- string IDataParameter.ParameterName
- {
- get {
- return m_name;
- }
- set {
- m_name = value;
- }
- }
-
- byte IDbDataParameter.Precision
- {
- get {
- return m_precision;
- }
- set {
- m_precision = value;
- }
- }
-
- byte IDbDataParameter.Scale
- {
- get {
- return m_scale;
- }
- set {
- m_scale = value;
- }
- }
-
- int IDbDataParameter.Size
- {
- get {
- return m_size;
- }
- set {
- m_size = value;
- }
- }
-
- string IDataParameter.SourceColumn
- {
- get {
- return m_sourceColumn;
- }
- set {
- m_sourceColumn = value;
- }
- }
-
- DataRowVersion IDataParameter.SourceVersion
- {
- get {
- return m_sourceVersion;
- }
- set {
- m_sourceVersion = value;
- }
- }
-
- object IDataParameter.Value
- {
- get {
- return m_value;
- }
- set {
- m_value = value;
- }
- }
-
- /*
- * Methods
- */
-
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs
deleted file mode 100644
index f22196a2c04..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbParameterCollection.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// System.Data.OleDb.OleDbParameterCollection
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbParameterCollection : MarshalByRefObject,
- IDataParameterCollection, IList, ICollection, IEnumerable
- {
- private ArrayList m_list = new ArrayList ();
-
- /*
- * Properties
- */
-
- int ICollection.Count {
- get {
- return m_list.Count;
- }
- }
-
- bool IList.IsFixedSize
- {
- get {
- return false;
- }
- }
-
- bool IList.IsReadOnly
- {
- get {
- return false;
- }
- }
-
- bool ICollection.IsSynchronized
- {
- get {
- return m_list.IsSynchronized;
- }
- }
-
- object ICollection.SyncRoot
- {
- get {
- return m_list.SyncRoot;
- }
- }
-
- object IList.this[int index]
- {
- get {
- return m_list[index];
- }
- set {
- m_list[index] = value;
- }
- }
-
- object IDataParameterCollection.this[string name]
- {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- /*
- * Methods
- */
-
- int IList.Add (object value)
- {
- if (!(value is IDataParameter))
- throw new InvalidCastException ();
-
- m_list.Add (value);
- return m_list.IndexOf (value);
- }
-
- public OleDbParameter Add (OleDbParameter parameter)
- {
- m_list.Add (parameter);
- return parameter;
- }
-
- public OleDbParameter Add (string name, object value)
- {
- OleDbParameter parameter = new OleDbParameter (name, value);
- m_list.Add (parameter);
- return parameter;
- }
-
- public OleDbParameter Add (string name, OleDbType type)
- {
- OleDbParameter parameter = new OleDbParameter (name, type);
- m_list.Add (parameter);
- return parameter;
- }
-
- public OleDbParameter Add (string name, OleDbType type, int width)
- {
- OleDbParameter parameter = new OleDbParameter (name, type, width);
- m_list.Add (parameter);
- return parameter;
- }
-
- public OleDbParameter Add (string name, OleDbType type,
- int width, string src_col)
- {
- OleDbParameter parameter = new OleDbParameter (name, type, width, src_col);
- m_list.Add (parameter);
- return parameter;
- }
-
- void IList.Clear ()
- {
- m_list.Clear ();
- }
-
- bool IList.Contains (object value)
- {
- return m_list.Contains (value);
- }
-
- bool IDataParameterCollection.Contains (string value)
- {
- for (int i = 0; i < m_list.Count; i++) {
- IDataParameter parameter;
-
- parameter = (IDataParameter) m_list[i];
- if (parameter.ParameterName == value)
- return true;
- }
-
- return false;
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- ((OleDbParameter[])(m_list.ToArray ())).CopyTo (array, index);
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return m_list.GetEnumerator ();
- }
-
- int IList.IndexOf (object value)
- {
- return m_list.IndexOf (value);
- }
-
- int IDataParameterCollection.IndexOf (string name)
- {
- return m_list.IndexOf (((IDataParameterCollection) this)[name]);
- }
-
- void IList.Insert (int index, object value)
- {
- m_list.Insert (index, value);
- }
-
- void IList.Remove (object value)
- {
- m_list.Remove (value);
- }
-
- void IList.RemoveAt (int index)
- {
- m_list.Remove ((object) m_list[index]);
- }
-
- void IDataParameterCollection.RemoveAt (string name)
- {
- m_list.Remove (((IDataParameterCollection) this)[name]);
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs
deleted file mode 100644
index d399380e58b..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.OleDb.OleDbPermission
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbPermission : DBDataPermission
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbPermissionAttribute.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbPermissionAttribute.cs
deleted file mode 100644
index fa023e78942..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbPermissionAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Data.OleDb.OleDbPermissionAttribute
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-using System.Security;
-
-namespace System.Data.OleDb
-{
- [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
- | AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class OleDbPermissionAttribute : DBDataPermissionAttribute
- {
- [MonoTODO]
- [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
- | AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public override IPermission CreatePermission () {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventArgs.cs
deleted file mode 100644
index 806565ef45f..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventArgs.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatedEventArgs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbRowUpdatedEventArgs : RowUpdatedEventArgs
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventHandler.cs
deleted file mode 100644
index fc911b7c6c6..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatedEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatedEventHandler
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- [Serializable]
- public delegate void OleDbRowUpdatedEventHandler (
- object sender,
- OleDbRowUpdatedEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventArgs.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventArgs.cs
deleted file mode 100644
index 840c4b3aefd..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventArgs.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatingEventArgs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbRowUpdatingEventArgs : RowUpdatingEventArgs
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventHandler.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventHandler.cs
deleted file mode 100644
index 42e42fcc628..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbRowUpdatingEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Data.OleDb.OleDbRowUpdatingEventHandler
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- [Serializable]
- public delegate void OleDbRowUpdatingEventHandler (
- object sender,
- OleDbRowUpdatingEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbSchemaGuid.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbSchemaGuid.cs
deleted file mode 100644
index 4ed1ca09d11..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbSchemaGuid.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.OleDb.OleDbSchemaGuid
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbSchemaGuid
- {
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs
deleted file mode 100644
index b3eb2c672f5..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// System.Data.OleDb.OleDbTransaction
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-using System.Exception;
-
-namespace System.Data.OleDb
-{
- public sealed class OleDbTransaction : MarshalByRefObject,
- IDbTransaction, IDisposable
- {
- private OleDbConnection m_connection = null;
- private IsolationLevel m_level = IsolationLevel.ReadCommitted;
-
- /*
- * Constructors
- */
-
- protected OleDbTransaction (OleDbConnection cnc)
- {
- m_connection = cnc;
- libgda.gda_connection_begin_transaction (m_connection.GdaConnection,
- null);
- }
-
- protected OleDbTransaction (OleDbConnection cnc,
- IsolationLevel level) : this (cnc)
- {
- m_level = level;
- }
-
- /*
- * Properties
- */
-
- IDbConnection IDbTransaction.Connection
- {
- get {
- return m_connection;
- }
- }
-
- IsolationLevel IDbTransaction.IsolationLevel
- {
- get {
- return m_level;
- }
- }
-
- /*
- * Methods
- */
-
- public OleDbTransaction Begin ()
- {
- return new OleDbTransaction (m_connection);
- }
-
- public OleDbTransaction Begin (IsolationLevel level)
- {
- return new OleDbTransaction (m_connection, level);
- }
-
- void IDbTransaction.Commit ()
- {
- if (!libgda.gda_connection_commit_transaction (
- m_connection.GdaConnection,
- null))
- throw new InvalidOperationException ();
- }
-
- void IDbTransaction.Rollback ()
- {
- if (!libgda.gda_connection_rollback_transaction (
- m_connection.GdaConnection,
- null))
- throw new InvalidOperationException ();
- }
-
- [MonoTODO]
- void IDisposable.Dispose ()
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbType.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbType.cs
deleted file mode 100644
index d65cce70078..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/OleDbType.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Data.OleDb.OleDbType
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.OleDb
-{
- public enum OleDbType {
- BigInt,
- Binary,
- Boolean,
- BSTR,
- Char,
- Currency,
- Date,
- DBDate,
- DBTime,
- DBTimeStamp,
- Decimal,
- Double,
- Empty,
- Error,
- Filetime,
- Guid,
- IDispatch,
- Integer,
- IUnknown,
- LongVarBinary,
- LongVarChar,
- LongVarWChar,
- Numeric,
- PropVariant,
- Single,
- SmallInt,
- Tinyint,
- UnsignedBigInt,
- UnsignedInt,
- UnsignedSmallInt,
- UnisgnedTinyInt,
- VarBinary,
- VarChar,
- Variant,
- VarNumeric,
- VarWChar,
- WChar
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/TestGDA.cs b/mcs/class/System.Data/System.Data.OleDb/TestGDA.cs
deleted file mode 100644
index 19eea663949..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/TestGDA.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Data.OleDb;
-
-namespace Mono.Data.GDA.Test
-{
- public class TestGDA
- {
- private IntPtr m_gdaClient = IntPtr.Zero;
- private IntPtr m_gdaConnection = IntPtr.Zero;
-
- static void Main (string[] args)
- {
- TestGDA test = new TestGDA ();
-
- /* initialization */
- libgda.gda_init ("TestGDA#", "0.1", args.Length, args);
- test.m_gdaClient = libgda.gda_client_new ();
-
- /* open connection */
- test.m_gdaConnection = libgda.gda_client_open_connection (
- test.m_gdaClient,
- "PostgreSQL",
- "", "");
- if (test.m_gdaConnection != IntPtr.Zero) {
- System.Console.Write ("Connection successful!");
-
- /* close connection */
- libgda.gda_connection_close (test.m_gdaConnection);
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/TestOleDb.cs b/mcs/class/System.Data/System.Data.OleDb/TestOleDb.cs
deleted file mode 100644
index 8b63827d043..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/TestOleDb.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Data.OleDb;
-
-namespace System.Data.OleDb.Test
-{
- public class TestOleDb
- {
- private OleDbConnection m_cnc;
-
- private TestOleDb ()
- {
- m_cnc = new OleDbConnection ("PostgreSQL");
- }
-
- static void Main (string[] args)
- {
- TestOleDb test = new TestOleDb ();
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.OleDb/libgda.cs b/mcs/class/System.Data/System.Data.OleDb/libgda.cs
deleted file mode 100644
index 7b7e1d8a9fe..00000000000
--- a/mcs/class/System.Data/System.Data.OleDb/libgda.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.Data.OleDb.libgda
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// Copyright (C) Rodrigo Moya, 2002
-//
-
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.OleDb
-{
- sealed internal class libgda
- {
- private static IntPtr m_gdaClient = IntPtr.Zero;
-
- static libgda ()
- {
- gda_init ("System.Data.OleDb", "0.1", 0, null);
- }
-
- public static IntPtr GdaClient
- {
- get {
- if (m_gdaClient == IntPtr.Zero)
- m_gdaClient = gda_client_new ();
-
- return m_gdaClient;
- }
- }
-
- [DllImport("gda-2")]
- public static extern void gda_init (string app_id,
- string version,
- int nargs,
- string[] args);
-
- [DllImport("gda-2")]
- public static extern IntPtr gda_client_new ();
-
- [DllImport("gda-2")]
- public static extern IntPtr gda_client_open_connection (IntPtr client,
- string dsn,
- string username,
- string password);
-
- [DllImport("gda-2")]
- public static extern bool gda_connection_is_open (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern bool gda_connection_close (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern string gda_connection_get_database (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern string gda_connection_get_dsn (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern string gda_connection_get_cnc_string (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern string gda_connection_get_provider (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern string gda_connection_get_username (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern string gda_connection_get_password (IntPtr cnc);
-
- [DllImport("gda-2")]
- public static extern bool gda_connection_begin_transaction (IntPtr cnc,
- string name);
-
- [DllImport("gda-2")]
- public static extern bool gda_connection_commit_transaction (IntPtr cnc,
- string name);
-
- [DllImport("gda-2")]
- public static extern bool gda_connection_rollback_transaction (IntPtr cnc,
- string name);
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ParmUtil.cs b/mcs/class/System.Data/System.Data.SqlClient/ParmUtil.cs
deleted file mode 100644
index 3dabac7853e..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/ParmUtil.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-//
-// ParmUtil.cs - utility to bind variables in a SQL statement to parameters in C# code
-// This is in the PostgreSQL .NET Data provider in Mono
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-// comment DEBUG_ParmUtil for production, for debug messages, uncomment
-//#define DEBUG_ParmUtil
-
-using System;
-using System.Data;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- enum PostgresBindVariableCharacter {
- Semicolon,
- At,
- QuestionMark
- }
-
- public class ParmUtil {
-
- private string sql = "";
- private string resultSql = "";
- private SqlParameterCollection parmsCollection = null;
-
- static private PostgresBindVariableCharacter PgbindChar = PostgresBindVariableCharacter.Semicolon;
- static char bindChar;
-
- // static constructor
- static ParmUtil() {
- switch(PgbindChar) {
- case PostgresBindVariableCharacter.Semicolon:
- bindChar = ':';
- break;
- case PostgresBindVariableCharacter.At:
- bindChar = '@';
- break;
- case PostgresBindVariableCharacter.QuestionMark:
- // this doesn't have named parameters,
- // they must be in order
- bindChar = '?';
- break;
- }
- }
-
- public ParmUtil(string query, SqlParameterCollection parms) {
- sql = query;
- parmsCollection = parms;
- }
-
- public string ResultSql {
- get {
- return resultSql;
- }
- }
-
- // TODO: currently only works for input variables,
- // need to do input/output, output, and return
- public string ReplaceWithParms() {
-
- StringBuilder result = new StringBuilder();
- char[] chars = sql.ToCharArray();
- bool bStringConstFound = false;
-
- for(int i = 0; i < chars.Length; i++) {
- if(chars[i] == '\'') {
- if(bStringConstFound == true)
- bStringConstFound = false;
- else
- bStringConstFound = true;
-
- result.Append(chars[i]);
- }
- else if(chars[i] == bindChar &&
- bStringConstFound == false) {
-#if DEBUG_ParmUtil
- Console.WriteLine("Bind Variable character found...");
-#endif
- StringBuilder parm = new StringBuilder();
- i++;
- while(i <= chars.Length) {
- char ch;
- if(i == chars.Length)
- ch = ' '; // a space
- else
- ch = chars[i];
-
-#if DEBUG_ParmUtil
- Console.WriteLine("Is char Letter or digit?");
-#endif
- if(Char.IsLetterOrDigit(ch)) {
-#if DEBUG_ParmUtil
- Console.WriteLine("Char IS letter or digit. " +
- "Now, append char to parm StringBuilder");
-#endif
- parm.Append(ch);
- }
- else {
-#if DEBUG_ParmUtil
- Console.WriteLine("Char is NOT letter or char. " +
- "thus we got rest of bind variable name. ");
-
- // replace bind variable placeholder
- // with data value constant
- Console.WriteLine("parm StringBuilder to string p...");
-#endif
- string p = parm.ToString();
-#if DEBUG_ParmUtil
- Console.WriteLine("calling BindReplace...");
-#endif
- bool found = BindReplace(result, p);
-#if DEBUG_ParmUtil
- Console.WriteLine(" Found = " + found);
-#endif
- if(found == true)
- break;
- else {
- // *** Error Handling
- Console.WriteLine("Error: parameter not found: " + p);
- return "";
- }
- }
- i++;
- }
- i--;
- }
- else
- result.Append(chars[i]);
- }
-
- resultSql = result.ToString();
- return resultSql;
- }
-
- public bool BindReplace (StringBuilder result, string p) {
- // bind variable
- bool found = false;
-
-#if DEBUG_ParmUtil
- Console.WriteLine("Does the parmsCollection contain the parameter???: " + p);
-#endif
- if(parmsCollection.Contains(p) == true) {
- // parameter found
-#if DEBUG_ParmUtil
- Console.WriteLine("Parameter Found: " + p);
-#endif
- SqlParameter prm = parmsCollection[p];
-
-#if DEBUG_ParmUtil
- // DEBUG
- Console.WriteLine(" Value: " + prm.Value);
- Console.WriteLine(" Direction: " + prm.Direction);
-#endif
- // convert object to string and place
- // into SQL
- if(prm.Direction == ParameterDirection.Input) {
- string strObj = PostgresHelper.
- ObjectToString(prm.DbType,
- prm.Value);
- result.Append(strObj);
- }
- else
- result.Append(bindChar + p);
-
- found = true;
- }
- return found;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/PostgresLibrary.cs b/mcs/class/System.Data/System.Data.SqlClient/PostgresLibrary.cs
deleted file mode 100644
index 493afcd49e2..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/PostgresLibrary.cs
+++ /dev/null
@@ -1,475 +0,0 @@
-//
-// System.Data.SqlClient.PostgresLibrary.cs
-//
-// PInvoke methods to libpq
-// which is PostgreSQL client library
-//
-// May also contain enumerations,
-// data types, or wrapper methods.
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_PostgresLibrary
-
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Collections;
-
-namespace System.Data.SqlClient {
-
- /* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
-
- internal enum ConnStatusType
- {
- CONNECTION_OK,
- CONNECTION_BAD,
- CONNECTION_STARTED,
- CONNECTION_MADE,
- CONNECTION_AWAITING_RESPONSE,
- CONNECTION_AUTH_OK,
- CONNECTION_SETENV
- }
-
- internal enum PostgresPollingStatusType
- {
- PGRES_POLLING_FAILED = 0,
- PGRES_POLLING_READING,
- PGRES_POLLING_WRITING,
- PGRES_POLLING_OK,
- PGRES_POLLING_ACTIVE
- }
-
- internal enum ExecStatusType
- {
- PGRES_EMPTY_QUERY = 0,
- PGRES_COMMAND_OK,
- PGRES_TUPLES_OK,
- PGRES_COPY_OUT,
- PGRES_COPY_IN,
- PGRES_BAD_RESPONSE,
- PGRES_NONFATAL_ERROR,
- PGRES_FATAL_ERROR
- }
-
- sealed internal class PostgresLibrary
- {
- #region PInvoke Functions
-
- // pinvoke prototypes to PostgreSQL client library
- // pq.dll on windows and libpq.so on linux
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectStart (string conninfo);
- // PGconn *PQconnectStart(const char *conninfo);
-
- [DllImport("pq")]
- public static extern PostgresPollingStatusType PQconnectPoll (IntPtr conn);
- // PostgresPollingStatusType PQconnectPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectdb (string conninfo);
- // PGconn *PQconnectdb(const char *conninfo);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetdbLogin (string pghost,
- string pgport, string pgoptions,
- string pgtty, string dbName,
- string login, string pwd);
- // PGconn *PQsetdbLogin(const char *pghost,
- // const char *pgport, const char *pgoptions,
- // const char *pgtty, const char *dbName,
- // const char *login, const char *pwd);
-
- [DllImport("pq")]
- public static extern void PQfinish (IntPtr conn);
- // void PQfinish(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconndefaults ();
- // PQconninfoOption *PQconndefaults(void);
-
- [DllImport("pq")]
- public static extern void PQconninfoFree (IntPtr connOptions);
- // void PQconninfoFree(PQconninfoOption *connOptions);
-
- [DllImport("pq")]
- public static extern int PQresetStart (IntPtr conn);
- // int PQresetStart(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQresetPoll (IntPtr conn);
- // PostgresPollingStatusType PQresetPoll(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQreset (IntPtr conn);
- // void PQreset(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQrequestCancel (IntPtr conn);
- // int PQrequestCancel(PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQdb (IntPtr conn);
- // char *PQdb(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQuser (IntPtr conn);
- // char *PQuser(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQpass (IntPtr conn);
- // char *PQpass(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQhost (IntPtr conn);
- // char *PQhost(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQport (IntPtr conn);
- // char *PQport(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQtty (IntPtr conn);
- // char *PQtty(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQoptions (IntPtr conn);
- // char *PQoptions(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern ConnStatusType PQstatus (IntPtr conn);
- // ConnStatusType PQstatus(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern string PQerrorMessage (IntPtr conn);
- // char *PQerrorMessage(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsocket (IntPtr conn);
- // int PQsocket(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQbackendPID (IntPtr conn);
- // int PQbackendPID(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQclientEncoding (IntPtr conn);
- // int PQclientEncoding(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetClientEncoding (IntPtr conn,
- string encoding);
- // int PQsetClientEncoding(PGconn *conn,
- // const char *encoding);
-
- //FIXME: when loading, causes runtime exception
- //[DllImport("pq")]
- //public static extern IntPtr PQgetssl (IntPtr conn);
- // SSL *PQgetssl(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQtrace (IntPtr conn,
- IntPtr debug_port);
- // void PQtrace(PGconn *conn,
- // FILE *debug_port);
-
- [DllImport("pq")]
- public static extern void PQuntrace (IntPtr conn);
- // void PQuntrace(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQsetNoticeProcessor (IntPtr conn,
- IntPtr proc, IntPtr arg);
- // PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
- // PQnoticeProcessor proc, void *arg);
-
- [DllImport("pq")]
- public static extern int PQescapeString (string to,
- string from, int length);
- // size_t PQescapeString(char *to,
- // const char *from, size_t length);
-
- [DllImport("pq")]
- public static extern string PQescapeBytea (string bintext,
- int binlen, IntPtr bytealen);
- // unsigned char *PQescapeBytea(unsigned char *bintext,
- // size_t binlen, size_t *bytealen);
-
- [DllImport("pq")]
- public static extern IntPtr PQexec (IntPtr conn,
- string query);
- // PGresult *PQexec(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQnotifies (IntPtr conn);
- // PGnotify *PQnotifies(PGconn *conn);
-
- [DllImport("pq")]
- public static extern void PQfreeNotify (IntPtr notify);
- // void PQfreeNotify(PGnotify *notify);
-
- [DllImport("pq")]
- public static extern int PQsendQuery (IntPtr conn,
- string query);
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- [DllImport("pq")]
- public static extern IntPtr PQgetResult (IntPtr conn);
- // PGresult *PQgetResult(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQisBusy (IntPtr conn);
- // int PQisBusy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQconsumeInput (IntPtr conn);
- // int PQconsumeInput(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQgetline (IntPtr conn,
- string str, int length);
- // int PQgetline(PGconn *conn,
- // char *string, int length);
-
- [DllImport("pq")]
- public static extern int PQputline (IntPtr conn,
- string str);
- // int PQputline(PGconn *conn,
- // const char *string);
-
- [DllImport("pq")]
- public static extern int PQgetlineAsync (IntPtr conn,
- string buffer, int bufsize);
- // int PQgetlineAsync(PGconn *conn, char *buffer,
- // int bufsize);
-
- [DllImport("pq")]
- public static extern int PQputnbytes (IntPtr conn,
- string buffer, int nbytes);
- // int PQputnbytes(PGconn *conn,
- //const char *buffer, int nbytes);
-
- [DllImport("pq")]
- public static extern int PQendcopy (IntPtr conn);
- // int PQendcopy(PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQsetnonblocking (IntPtr conn,
- int arg);
- // int PQsetnonblocking(PGconn *conn, int arg);
-
- [DllImport("pq")]
- public static extern int PQisnonblocking (IntPtr conn);
- // int PQisnonblocking(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern int PQflush (IntPtr conn);
- // int PQflush(PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQfn (IntPtr conn, int fnid,
- IntPtr result_buf, IntPtr result_len,
- int result_is_int, IntPtr args,
- int nargs);
- // PGresult *PQfn(PGconn *conn, int fnid,
- // int *result_buf, int *result_len,
- // int result_is_int, const PQArgBlock *args,
- // int nargs);
-
- [DllImport("pq")]
- public static extern ExecStatusType PQresultStatus (IntPtr res);
- // ExecStatusType PQresultStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQresStatus (ExecStatusType status);
- // char *PQresStatus(ExecStatusType status);
-
- [DllImport("pq")]
- public static extern string PQresultErrorMessage (IntPtr res);
- // char *PQresultErrorMessage(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQntuples (IntPtr res);
- // int PQntuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQnfields (IntPtr res);
- // int PQnfields(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQbinaryTuples (IntPtr res);
- // int PQbinaryTuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQfname (IntPtr res,
- int field_num);
- // char *PQfname(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfnumber (IntPtr res,
- string field_name);
- // int PQfnumber(const PGresult *res,
- // const char *field_name);
-
- [DllImport("pq")]
- public static extern int PQftype (IntPtr res,
- int field_num);
- // Oid PQftype(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfsize (IntPtr res,
- int field_num);
- // int PQfsize(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfmod (IntPtr res, int field_num);
- // int PQfmod(const PGresult *res, int field_num);
-
- [DllImport("pq")]
- public static extern string PQcmdStatus (IntPtr res);
- // char *PQcmdStatus(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQoidStatus (IntPtr res);
- // char *PQoidStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQoidValue (IntPtr res);
- // Oid PQoidValue(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQcmdTuples (IntPtr res);
- // char *PQcmdTuples(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQgetvalue (IntPtr res,
- int tup_num, int field_num);
- // char *PQgetvalue(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetlength (IntPtr res,
- int tup_num, int field_num);
- // int PQgetlength(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetisnull (IntPtr res,
- int tup_num, int field_num);
- // int PQgetisnull(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern void PQclear (IntPtr res);
- // void PQclear(PGresult *res);
-
- [DllImport("pq")]
- public static extern IntPtr PQmakeEmptyPGresult (IntPtr conn,
- IntPtr status);
- // PGresult *PQmakeEmptyPGresult(PGconn *conn,
- // ExecStatusType status);
-
- [DllImport("pq")]
- public static extern void PQprint (IntPtr fout,
- IntPtr res, IntPtr ps);
- // void PQprint(FILE *fout,
- // const PGresult *res, const PQprintOpt *ps);
-
- [DllImport("pq")]
- public static extern void PQdisplayTuples (IntPtr res,
- IntPtr fp, int fillAlign, string fieldSep,
- int printHeader, int quiet);
- // void PQdisplayTuples(const PGresult *res,
- // FILE *fp, int fillAlign, const char *fieldSep,
- // int printHeader, int quiet);
-
- [DllImport("pq")]
- public static extern void PQprintTuples (IntPtr res,
- IntPtr fout, int printAttName, int terseOutput,
- int width);
- // void PQprintTuples(const PGresult *res,
- // FILE *fout, int printAttName, int terseOutput,
- // int width);
-
- [DllImport("pq")]
- public static extern int lo_open (IntPtr conn,
- int lobjId, int mode);
- // int lo_open(PGconn *conn,
- // Oid lobjId, int mode);
-
- [DllImport("pq")]
- public static extern int lo_close (IntPtr conn, int fd);
- // int lo_close(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_read (IntPtr conn,
- int fd, string buf, int len);
- // int lo_read(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_write (IntPtr conn,
- int fd, string buf, int len);
- // int lo_write(PGconn *conn,
- // int fd, char *buf, size_t len);
-
- [DllImport("pq")]
- public static extern int lo_lseek (IntPtr conn,
- int fd, int offset, int whence);
- // int lo_lseek(PGconn *conn,
- // int fd, int offset, int whence);
-
- [DllImport("pq")]
- public static extern int lo_creat (IntPtr conn,
- int mode);
- // Oid lo_creat(PGconn *conn,
- // int mode);
-
- [DllImport("pq")]
- public static extern int lo_tell (IntPtr conn, int fd);
- // int lo_tell(PGconn *conn, int fd);
-
- [DllImport("pq")]
- public static extern int lo_unlink (IntPtr conn,
- int lobjId);
- // int lo_unlink(PGconn *conn,
- // Oid lobjId);
-
- [DllImport("pq")]
- public static extern int lo_import (IntPtr conn,
- string filename);
- // Oid lo_import(PGconn *conn,
- // const char *filename);
-
- [DllImport("pq")]
- public static extern int lo_export (IntPtr conn,
- int lobjId, string filename);
- // int lo_export(PGconn *conn,
- // Oid lobjId, const char *filename);
-
- [DllImport("pq")]
- public static extern int PQmblen (string s,
- int encoding);
- // int PQmblen(const unsigned char *s,
- // int encoding);
-
- [DllImport("pq")]
- public static extern int PQenv2encoding ();
- // int PQenv2encoding(void);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/PostgresTypes.cs b/mcs/class/System.Data/System.Data.SqlClient/PostgresTypes.cs
deleted file mode 100644
index 6a086a82a42..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/PostgresTypes.cs
+++ /dev/null
@@ -1,512 +0,0 @@
-//
-// PostgresTypes.cs - holding methods to convert
-// between PostgreSQL types and .NET types
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-// Note: this might become PostgresType and PostgresTypeCollection
-// also, the PostgresTypes that exist as an inner internal class
-// within SqlConnection maybe moved here in the future
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.Common;
-using System.Data.SqlClient;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- internal struct PostgresType {
- public int oid;
- public string typname;
- public DbType dbType;
- }
-
- sealed internal class PostgresHelper {
-
- // translates the PostgreSQL typname to System.Data.DbType
- public static DbType TypnameToSqlDbType(string typname) {
- DbType sqlType;
-
- // FIXME: use hashtable here?
-
- switch(typname) {
-
- case "abstime":
- sqlType = DbType.Int32;
- break;
-
- case "aclitem":
- sqlType = DbType.String;
- break;
-
- case "bit":
- sqlType = DbType.String;
- break;
-
- case "bool":
- sqlType = DbType.Boolean;
- break;
-
- case "box":
- sqlType = DbType.String;
- break;
-
- case "bpchar":
- sqlType = DbType.String;
- break;
-
- case "bytea":
- sqlType = DbType.String;
- break;
-
- case "char":
- sqlType = DbType.String;
- break;
-
- case "cidr":
- sqlType = DbType.String;
- break;
-
- case "circle":
- sqlType = DbType.String;
- break;
-
- case "date":
- sqlType = DbType.Date;
- break;
-
- case "float4":
- sqlType = DbType.Single;
- break;
-
- case "float8":
- sqlType = DbType.Double;
- break;
-
- case "inet":
- sqlType = DbType.String;
- break;
-
- case "int2":
- sqlType = DbType.Int16;
- break;
-
- case "int4":
- sqlType = DbType.Int32;
- break;
-
- case "int8":
- sqlType = DbType.Int64;
- break;
-
- case "interval":
- sqlType = DbType.String;
- break;
-
- case "line":
- sqlType = DbType.String;
- break;
-
- case "lseg":
- sqlType = DbType.String;
- break;
-
- case "macaddr":
- sqlType = DbType.String;
- break;
-
- case "money":
- sqlType = DbType.Decimal;
- break;
-
- case "name":
- sqlType = DbType.String;
- break;
-
- case "numeric":
- sqlType = DbType.Decimal;
- break;
-
- case "oid":
- sqlType = DbType.Int32;
- break;
-
- case "path":
- sqlType = DbType.String;
- break;
-
- case "point":
- sqlType = DbType.String;
- break;
-
- case "polygon":
- sqlType = DbType.String;
- break;
-
- case "refcursor":
- sqlType = DbType.String;
- break;
-
- case "reltime":
- sqlType = DbType.String;
- break;
-
- case "text":
- sqlType = DbType.String;
- break;
-
- case "time":
- sqlType = DbType.Time;
- break;
-
- case "timestamp":
- sqlType = DbType.DateTime;
- break;
-
- case "timestamptz":
- sqlType = DbType.DateTime;
- break;
-
- case "timetz":
- sqlType = DbType.DateTime;
- break;
-
- case "tinterval":
- sqlType = DbType.String;
- break;
-
- case "varbit":
- sqlType = DbType.String;
- break;
-
- case "varchar":
- sqlType = DbType.String;
- break;
-
- default:
- sqlType = DbType.String;
- break;
- }
- return sqlType;
- }
-
- // Converts data value from database to .NET System type.
- public static object ConvertDbTypeToSystem (DbType typ, String value) {
- object obj = null;
-
- // FIXME: more types need
- // to be converted
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- // FIXME: need to handle a NULL for each type
- // maybe setting obj to System.DBNull.Value ?
-
-
- if(value == null) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is null");
- return null;
- }
- else if(value.Equals("")) {
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value is string empty");
- return null;
- }
-
- //Console.WriteLine("ConvertDbTypeToSystemDbType typ: " +
- // typ + " value: " + value);
-
- // Date, Time, and DateTime
- // are parsed based on ISO format
- // "YYYY-MM-DD hh:mi:ss.ms"
-
- switch(typ) {
- case DbType.String:
- obj = String.Copy(value);
- break;
- case DbType.Boolean:
- obj = value.Equals("t");
- break;
- case DbType.Int16:
- obj = Int16.Parse(value);
- break;
- case DbType.Int32:
- obj = Int32.Parse(value);
- break;
- case DbType.Int64:
- obj = Int64.Parse(value);
- break;
- case DbType.Decimal:
- obj = Decimal.Parse(value);
- break;
- case DbType.Single:
- obj = Single.Parse(value);
- break;
- case DbType.Double:
- obj = Double.Parse(value);
- break;
- case DbType.Date:
- String[] sd = value.Split(new Char[] {'-'});
- obj = new DateTime(
- Int32.Parse(sd[0]), Int32.Parse(sd[1]), Int32.Parse(sd[2]),
- 0,0,0);
- break;
- case DbType.Time:
- String[] st = value.Split(new Char[] {':'});
- obj = new DateTime(0001,01,01,
- Int32.Parse(st[0]),Int32.Parse(st[1]),Int32.Parse(st[2]));
- break;
- case DbType.DateTime:
- Int32 YYYY,MM,DD,hh,mi,ss,ms;
- YYYY = Int32.Parse(value.Substring(0,4));
- MM = Int32.Parse(value.Substring(5,2));
- DD = Int32.Parse(value.Substring(8,2));
- hh = Int32.Parse(value.Substring(11,2));
- mi = Int32.Parse(value.Substring(14,2));
- ss = Int32.Parse(value.Substring(17,2));
- ms = Int32.Parse(value.Substring(20,2));
- obj = new DateTime(YYYY,MM,DD,hh,mi,ss,ms);
- break;
- default:
- obj = String.Copy(value);
- break;
- }
-
- return obj;
- }
-
- // Translates System.Data.DbType to System.Type
- public static Type DbTypeToSystemType (DbType dType) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- Type typ = null;
-
- switch(dType) {
- case DbType.String:
- typ = typeof(String);
- break;
- case DbType.Boolean:
- typ = typeof(Boolean);
- break;
- case DbType.Int16:
- typ = typeof(Int16);
- break;
- case DbType.Int32:
- typ = typeof(Int32);
- break;
- case DbType.Int64:
- typ = typeof(Int64);
- break;
- case DbType.Decimal:
- typ = typeof(Decimal);
- break;
- case DbType.Single:
- typ = typeof(Single);
- break;
- case DbType.Double:
- typ = typeof(Double);
- break;
- case DbType.Date:
- case DbType.Time:
- case DbType.DateTime:
- typ = typeof(DateTime);
- break;
- default:
- typ = typeof(String);
- break;
- }
- return typ;
- }
-
- // Find DbType for oid
- // which requires a look up of PostgresTypes
- // DbType <-> typname <-> oid
- public static string OidToTypname (int oid, ArrayList pgTypes) {
- // FIXME: more types need
- // to be mapped
- // from PostgreSQL oid type
- // to .NET System.<type>
-
- string typname = "text"; // default
- int i;
- for(i = 0; i < pgTypes.Count; i++) {
- PostgresType pt = (PostgresType) pgTypes[i];
- if(pt.oid == oid) {
- typname = pt.typname;
- break;
- }
- }
-
- return typname;
- }
-
- // Convert a .NET System value type (Int32, String, Boolean, etc)
- // to a string that can be included within a SQL statement.
- // This is to methods provides the parameters support
- // for the PostgreSQL .NET Data provider
- public static string ObjectToString(DbType dbtype, object obj) {
-
- // TODO: how do we handle a NULL?
- //if(isNull == true)
- // return "NULL";
-
- string s;
-
- // Date, Time, and DateTime are expressed in ISO format
- // which is "YYYY-MM-DD hh:mm:ss.ms";
- DateTime dt;
- StringBuilder sb;
-
- const string zero = "0";
-
- switch(dbtype) {
- case DbType.String:
- s = "'" + obj + "'";
- break;
- case DbType.Boolean:
- if((bool)obj == true)
- s = "'t'";
- else
- s = "'f'";
- break;
- case DbType.Int16:
- s = obj.ToString();
- break;
- case DbType.Int32:
- s = obj.ToString();
- break;
- case DbType.Int64:
- s = obj.ToString();
- break;
- case DbType.Decimal:
- s = obj.ToString();
- break;
- case DbType.Single:
- s = obj.ToString();
- break;
- case DbType.Double:
- s = obj.ToString();
- break;
- case DbType.Date:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // year
- if(dt.Year < 10)
- sb.Append("000" + dt.Year);
- else if(dt.Year < 100)
- sb.Append("00" + dt.Year);
- else if(dt.Year < 1000)
- sb.Append("0" + dt.Year);
- else
- sb.Append(dt.Year);
- sb.Append("-");
- // month
- if(dt.Month < 10)
- sb.Append(zero + dt.Month);
- else
- sb.Append(dt.Month);
- sb.Append("-");
- // day
- if(dt.Day < 10)
- sb.Append(zero + dt.Day);
- else
- sb.Append(dt.Day);
- sb.Append('\'');
- s = sb.ToString();
- break;
- case DbType.Time:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // hour
- if(dt.Hour < 10)
- sb.Append(zero + dt.Hour);
- else
- sb.Append(dt.Hour);
- sb.Append(":");
- // minute
- if(dt.Minute < 10)
- sb.Append(zero + dt.Minute);
- else
- sb.Append(dt.Minute);
- sb.Append(":");
- // second
- if(dt.Second < 10)
- sb.Append(zero + dt.Second);
- else
- sb.Append(dt.Second);
- sb.Append('\'');
- s = sb.ToString();
- break;
- case DbType.DateTime:
- dt = (DateTime) obj;
- sb = new StringBuilder();
- sb.Append('\'');
- // year
- if(dt.Year < 10)
- sb.Append("000" + dt.Year);
- else if(dt.Year < 100)
- sb.Append("00" + dt.Year);
- else if(dt.Year < 1000)
- sb.Append("0" + dt.Year);
- else
- sb.Append(dt.Year);
- sb.Append("-");
- // month
- if(dt.Month < 10)
- sb.Append(zero + dt.Month);
- else
- sb.Append(dt.Month);
- sb.Append("-");
- // day
- if(dt.Day < 10)
- sb.Append(zero + dt.Day);
- else
- sb.Append(dt.Day);
- sb.Append(" ");
- // hour
- if(dt.Hour < 10)
- sb.Append(zero + dt.Hour);
- else
- sb.Append(dt.Hour);
- sb.Append(":");
- // minute
- if(dt.Minute < 10)
- sb.Append(zero + dt.Minute);
- else
- sb.Append(dt.Minute);
- sb.Append(":");
- // second
- if(dt.Second < 10)
- sb.Append(zero + dt.Second);
- else
- sb.Append(dt.Second);
- sb.Append(".");
- // millisecond
- if(dt.Millisecond < 10)
- sb.Append(zero + dt.Millisecond);
- else
- sb.Append(dt.Millisecond);
- sb.Append('\'');
- s = sb.ToString();
- break;
- default:
- // default to DbType.String
- s = "'" + obj + "'";
- break;
- }
- return s;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs
deleted file mode 100644
index 20b9e02a6d0..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermission.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
- public sealed class SqlClientPermission : DBDataPermission {
-
- [MonoTODO]
- public SqlClientPermission() {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public SqlClientPermission(PermissionState state) {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public SqlClientPermission(PermissionState state,
- bool allowBlankPassword) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Copy() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void FromXml(SecurityElement
- securityElement) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Intersect(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool IsSubsetOf(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override SecurityElement ToXml() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override IPermission Union(IPermission target) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ~SqlClientPermission() {
- // FIXME: destructor to release resources
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermissionAttribute.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermissionAttribute.cs
deleted file mode 100644
index 149613c5f2e..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermissionAttribute.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Data.SqlClient.SqlClientPermissionAttribute.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Data.SqlClient {
-
- [AttributeUsage(AttributeTargets.Assembly |
- AttributeTargets.Class |
- AttributeTargets.Struct |
- AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class SqlClientPermissionAttribute :
- DBDataPermissionAttribute {
-
- [MonoTODO]
- public SqlClientPermissionAttribute(SecurityAction action) :
- base(action)
- {
- // FIXME: do constructor
- }
-
- [MonoTODO]
- public override IPermission CreatePermission() {
- throw new NotImplementedException ();
- }
-
- //[MonoTODO]
- //~SqlClientPermissionAttribute() {
- // // FIXME: destructor to release resources
- //}
- }
-
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
deleted file mode 100644
index af2771c3fa2..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
+++ /dev/null
@@ -1,928 +0,0 @@
-//
-// System.Data.SqlClient.SqlCommand.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002 http://www.ximian.com/
-// (C) Daniel Morgan, 2002
-// (C) Copyright 2002 Tim Coleman
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// use #define DEBUG_SqlCommand if you want to spew debug messages
-// #define DEBUG_SqlCommand
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Xml;
-
-namespace System.Data.SqlClient {
- /// <summary>
- /// Represents a SQL statement that is executed
- /// while connected to a SQL database.
- /// </summary>
- // public sealed class SqlCommand : Component, IDbCommand, ICloneable
- public sealed class SqlCommand : IDbCommand {
-
- #region Fields
-
- private string sql = "";
- private int timeout = 30;
- // default is 30 seconds
- // for command execution
-
- private SqlConnection conn = null;
- private SqlTransaction trans = null;
- private CommandType cmdType = CommandType.Text;
- private bool designTime = false;
- private SqlParameterCollection parmCollection = new
- SqlParameterCollection();
-
- // SqlDataReader state data for ExecuteReader()
- private SqlDataReader dataReader = null;
- private string[] queries = null;
- private int currentQuery = -1;
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- private ParmUtil parmUtil = null;
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlCommand() {
- sql = "";
- }
-
- public SqlCommand (string cmdText) {
- sql = cmdText;
- }
-
- public SqlCommand (string cmdText, SqlConnection connection) {
- sql = cmdText;
- conn = connection;
- }
-
- public SqlCommand (string cmdText, SqlConnection connection,
- SqlTransaction transaction) {
- sql = cmdText;
- conn = connection;
- trans = transaction;
- }
-
- #endregion // Constructors
-
- #region Methods
-
- [MonoTODO]
- public void Cancel () {
- // FIXME: use non-blocking Exec for this
- throw new NotImplementedException ();
- }
-
- // FIXME: is this the correct way to return a stronger type?
- [MonoTODO]
- IDbDataParameter IDbCommand.CreateParameter () {
- return CreateParameter ();
- }
-
- [MonoTODO]
- public SqlParameter CreateParameter () {
- return new SqlParameter ();
- }
-
- public int ExecuteNonQuery () {
- IntPtr pgResult; // PGresult
- int rowsAffected = -1;
- ExecStatusType execStatus;
- String rowsAffectedString;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK ||
- execStatus == ExecStatusType.PGRES_TUPLES_OK ) {
-
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
-
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
-
- return rowsAffected;
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader () {
- return ExecuteReader ();
- }
-
- [MonoTODO]
- public SqlDataReader ExecuteReader () {
- return ExecuteReader(CommandBehavior.Default);
- }
-
- [MonoTODO]
- IDataReader IDbCommand.ExecuteReader (
- CommandBehavior behavior) {
- return ExecuteReader (behavior);
- }
-
- [MonoTODO]
- public SqlDataReader ExecuteReader (CommandBehavior behavior)
- {
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- cmdBehavior = behavior;
-
- queries = null;
- currentQuery = -1;
- dataReader = new SqlDataReader(this);
-
- queries = sql.Split(new Char[] {';'});
-
- dataReader.NextResult();
-
- return dataReader;
- }
-
- internal SqlResult NextResult()
- {
- SqlResult res = new SqlResult();
- res.Connection = this.Connection;
- res.Behavior = cmdBehavior;
- string statement;
-
- currentQuery++;
-
- res.CurrentQuery = currentQuery;
-
- if(currentQuery < queries.Length && queries[currentQuery].Equals("") == false) {
- res.SQL = queries[currentQuery];
- statement = TweakQuery(queries[currentQuery], cmdType);
- ExecuteQuery(statement, res);
- res.ResultReturned = true;
- }
- else {
- res.ResultReturned = false;
- }
-
- return res;
- }
-
- private string TweakQuery(string query, CommandType commandType) {
- string statement = "";
- StringBuilder td;
-
-#if DEBUG_SqlCommand
- Console.WriteLine("---------[][] TweakQuery() [][]--------");
- Console.WriteLine("CommandType: " + commandType + " CommandBehavior: " + cmdBehavior);
- Console.WriteLine("SQL before command type: " + query);
-#endif
- // finish building SQL based on CommandType
- switch(commandType) {
- case CommandType.Text:
- statement = query;
- break;
- case CommandType.StoredProcedure:
- statement =
- "SELECT " + query + "()";
- break;
- case CommandType.TableDirect:
- // NOTE: this is for the PostgreSQL provider
- // and for OleDb, according to the docs,
- // an exception is thrown if you try to use
- // this with SqlCommand
- string[] directTables = query.Split(
- new Char[] {','});
-
- td = new StringBuilder("SELECT * FROM ");
-
- for(int tab = 0; tab < directTables.Length; tab++) {
- if(tab > 0)
- td.Append(',');
- td.Append(directTables[tab]);
- // FIXME: if multipe tables, how do we
- // join? based on Primary/Foreign Keys?
- // Otherwise, a Cartesian Product happens
- }
- statement = td.ToString();
- break;
- default:
- // FIXME: throw an exception?
- statement = query;
- break;
- }
-#if DEBUG_SqlCommand
- Console.WriteLine("SQL after command type: " + statement);
-#endif
- // TODO: this parameters utility
- // currently only support input variables
- // need todo output, input/output, and return.
-#if DEBUG_SqlCommand
- Console.WriteLine("using ParmUtil in TweakQuery()...");
-#endif
- parmUtil = new ParmUtil(statement, parmCollection);
-#if DEBUG_SqlCommand
- Console.WriteLine("ReplaceWithParms...");
-#endif
-
- statement = parmUtil.ReplaceWithParms();
-
-#if DEBUG_SqlCommand
- Console.WriteLine("SQL after ParmUtil: " + statement);
-#endif
- return statement;
- }
-
- private void ExecuteQuery (string query, SqlResult res)
- {
- IntPtr pgResult;
-
- ExecStatusType execStatus;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- res.ExecStatus = execStatus;
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK ||
- execStatus == ExecStatusType.PGRES_COMMAND_OK) {
-
- res.BuildTableSchema(pgResult);
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
- }
-
- // since SqlCommand has resources so SqlDataReader
- // can do Read() and NextResult(), need to free
- // those resources. Also, need to allow this SqlCommand
- // and this SqlConnection to do things again.
- internal void CloseReader() {
- dataReader = null;
- queries = null;
-
- if((cmdBehavior & CommandBehavior.CloseConnection) == CommandBehavior.CloseConnection) {
- conn.CloseReader(true);
- }
- else {
- conn.CloseReader(false);
- }
- }
-
- // only meant to be used between SqlConnectioin,
- // SqlCommand, and SqlDataReader
- internal void OpenReader(SqlDataReader reader) {
- conn.OpenReader(reader);
- }
-
- /// <summary>
- /// ExecuteScalar is used to retrieve one object
- /// from one result set
- /// that has one row and one column.
- /// It is lightweight compared to ExecuteReader.
- /// </summary>
- [MonoTODO]
- public object ExecuteScalar () {
- IntPtr pgResult; // PGresult
- ExecStatusType execStatus;
- object obj = null; // return
- int nRow = 0; // first row
- int nCol = 0; // first column
- String value;
- int nRows;
- int nFields;
- string query;
-
- if(conn.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- query = TweakQuery(sql, cmdType);
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (conn.PostgresConnection, query);
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
- if(execStatus == ExecStatusType.PGRES_COMMAND_OK) {
- // result was a SQL Command
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- return null; // return null reference
- }
- else if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- // result was a SQL Query
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- if(nRows > 0 && nFields > 0) {
-
- // get column name
- //String fieldName;
- //fieldName = PostgresLibrary.
- // PQfname(pgResult, nCol);
-
- int oid;
- string sType;
- DbType dbType;
- // get PostgreSQL data type (OID)
- oid = PostgresLibrary.
- PQftype(pgResult, nCol);
- sType = PostgresHelper.
- OidToTypname (oid, conn.Types);
- dbType = PostgresHelper.
- TypnameToSqlDbType(sType);
-
- int definedSize;
- // get defined size of column
- definedSize = PostgresLibrary.
- PQfsize(pgResult, nCol);
-
- // get data value
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- nRow, nCol);
-
- int columnIsNull;
- // is column NULL?
- columnIsNull = PostgresLibrary.
- PQgetisnull(pgResult,
- nRow, nCol);
-
- int actualLength;
- // get Actual Length
- actualLength = PostgresLibrary.
- PQgetlength(pgResult,
- nRow, nCol);
-
- obj = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- value);
- }
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- conn.DataSource, "SqlCommand", 0);
- }
-
- return obj;
- }
-
- [MonoTODO]
- public XmlReader ExecuteXmlReader () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Prepare () {
- // FIXME: parameters have to be implemented for this
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand Clone () {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
-
- #region Properties
-
- public string CommandText {
- get {
- return sql;
- }
-
- set {
- sql = value;
- }
- }
-
- public int CommandTimeout {
- get {
- return timeout;
- }
-
- set {
- // FIXME: if value < 0, throw
- // ArgumentException
- // if (value < 0)
- // throw ArgumentException;
- timeout = value;
- }
- }
-
- public CommandType CommandType {
- get {
- return cmdType;
- }
-
- set {
- cmdType = value;
- }
- }
-
- // FIXME: for property Connection, is this the correct
- // way to handle a return of a stronger type?
- IDbConnection IDbCommand.Connection {
- get {
- return Connection;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during a
- // transaction in progress
-
- // csc
- Connection = (SqlConnection) value;
- // mcs
- // Connection = value;
-
- // FIXME: set Transaction property to null
- }
- }
-
- public SqlConnection Connection {
- get {
- // conn defaults to null
- return conn;
- }
-
- set {
- // FIXME: throw an InvalidOperationException
- // if the change was during
- // a transaction in progress
- conn = value;
- // FIXME: set Transaction property to null
- }
- }
-
- public bool DesignTimeVisible {
- get {
- return designTime;
- }
-
- set{
- designTime = value;
- }
- }
-
- // FIXME; for property Parameters, is this the correct
- // way to handle a stronger return type?
- IDataParameterCollection IDbCommand.Parameters {
- get {
- return Parameters;
- }
- }
-
- public SqlParameterCollection Parameters {
- get {
- return parmCollection;
- }
- }
-
- // FIXME: for property Transaction, is this the correct
- // way to handle a return of a stronger type?
- IDbTransaction IDbCommand.Transaction {
- get {
- return Transaction;
- }
-
- set {
- // FIXME: error handling - do not allow
- // setting of transaction if transaction
- // has already begun
-
- // csc
- Transaction = (SqlTransaction) value;
- // mcs
- // Transaction = value;
- }
- }
-
- public SqlTransaction Transaction {
- get {
- return trans;
- }
-
- set {
- // FIXME: error handling
- trans = value;
- }
- }
-
- [MonoTODO]
- public UpdateRowSource UpdatedRowSource {
- // FIXME: do this once DbDataAdaptor
- // and DataRow are done
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Inner Classes
-
- #endregion // Inner Classes
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose() {
- // FIXME: need proper way to release resources
- // Dispose(true);
- }
-
- [MonoTODO]
- ~SqlCommand() {
- // FIXME: need proper way to release resources
- // Dispose(false);
- }
-
- #endregion //Destructors
- }
-
- // SqlResult is used for passing Result Set data
- // from SqlCommand to SqlDataReader
- internal class SqlResult {
-
- private DataTable dataTableSchema = null; // only will contain the schema
- private IntPtr pg_result = IntPtr.Zero; // native PostgreSQL PGresult
- private int rowCount = 0;
- private int fieldCount = 0;
- private string[] pgtypes = null; // PostgreSQL types (typname)
- private bool resultReturned = false;
- private SqlConnection con = null;
- private int rowsAffected = -1;
- private ExecStatusType execStatus = ExecStatusType.PGRES_FATAL_ERROR;
- private int currentQuery = -1;
- private string sql = "";
- private CommandBehavior cmdBehavior = CommandBehavior.Default;
-
- internal CommandBehavior Behavior {
- get {
- return cmdBehavior;
- }
- set {
- cmdBehavior = value;
- }
- }
-
- internal string SQL {
- get {
- return sql;
- }
- set {
- sql = value;
- }
- }
-
- internal ExecStatusType ExecStatus {
- get {
- return execStatus;
- }
- set {
- execStatus = value;
- }
- }
-
- internal int CurrentQuery {
- get {
- return currentQuery;
- }
-
- set {
- currentQuery = value;
- }
-
- }
-
- internal SqlConnection Connection {
- get {
- return con;
- }
-
- set {
- con = value;
- }
- }
-
- internal int RecordsAffected {
- get {
- return rowsAffected;
- }
- }
-
- internal bool ResultReturned {
- get {
- return resultReturned;
- }
- set {
- resultReturned = value;
- }
- }
-
- internal DataTable Table {
- get {
- return dataTableSchema;
- }
- }
-
- internal IntPtr PgResult {
- get {
- return pg_result;
- }
- }
-
- internal int RowCount {
- get {
- return rowCount;
- }
- }
-
- internal int FieldCount {
- get {
- return fieldCount;
- }
- }
-
- internal string[] PgTypes {
- get {
- return pgtypes;
- }
- }
-
- internal void BuildTableSchema (IntPtr pgResult) {
- pg_result = pgResult;
-
- // need to set IDataReader.RecordsAffected property
- string rowsAffectedString;
- rowsAffectedString = PostgresLibrary.
- PQcmdTuples (pgResult);
- if(rowsAffectedString != null)
- if(rowsAffectedString.Equals("") == false)
- rowsAffected = int.Parse(rowsAffectedString);
-
- // Only Results from SQL SELECT Queries
- // get a DataTable for schema of the result
- // otherwise, DataTable is null reference
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
-
- dataTableSchema = new DataTable ();
- dataTableSchema.Columns.Add ("ColumnName", typeof (string));
- dataTableSchema.Columns.Add ("ColumnOrdinal", typeof (int));
- dataTableSchema.Columns.Add ("ColumnSize", typeof (int));
- dataTableSchema.Columns.Add ("NumericPrecision", typeof (int));
- dataTableSchema.Columns.Add ("NumericScale", typeof (int));
- dataTableSchema.Columns.Add ("IsUnique", typeof (bool));
- dataTableSchema.Columns.Add ("IsKey", typeof (bool));
- DataColumn dc = dataTableSchema.Columns["IsKey"];
- dc.AllowDBNull = true; // IsKey can have a DBNull
- dataTableSchema.Columns.Add ("BaseCatalogName", typeof (string));
- dataTableSchema.Columns.Add ("BaseColumnName", typeof (string));
- dataTableSchema.Columns.Add ("BaseSchemaName", typeof (string));
- dataTableSchema.Columns.Add ("BaseTableName", typeof (string));
- dataTableSchema.Columns.Add ("DataType", typeof(string));
- dataTableSchema.Columns.Add ("AllowDBNull", typeof (bool));
- dataTableSchema.Columns.Add ("ProviderType", typeof (int));
- dataTableSchema.Columns.Add ("IsAliased", typeof (bool));
- dataTableSchema.Columns.Add ("IsExpression", typeof (bool));
- dataTableSchema.Columns.Add ("IsIdentity", typeof (bool));
- dataTableSchema.Columns.Add ("IsAutoIncrement", typeof (bool));
- dataTableSchema.Columns.Add ("IsRowVersion", typeof (bool));
- dataTableSchema.Columns.Add ("IsHidden", typeof (bool));
- dataTableSchema.Columns.Add ("IsLong", typeof (bool));
- dataTableSchema.Columns.Add ("IsReadOnly", typeof (bool));
-
- fieldCount = PostgresLibrary.PQnfields (pgResult);
- rowCount = PostgresLibrary.PQntuples(pgResult);
- pgtypes = new string[fieldCount];
-
- // TODO: for CommandBehavior.SingleRow
- // use IRow, otherwise, IRowset
- if(fieldCount > 0)
- if((cmdBehavior & CommandBehavior.SingleRow) == CommandBehavior.SingleRow)
- fieldCount = 1;
-
- // TODO: for CommandBehavior.SchemaInfo
- if((cmdBehavior & CommandBehavior.SchemaOnly) == CommandBehavior.SchemaOnly)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SingleResult
- if((cmdBehavior & CommandBehavior.SingleResult) == CommandBehavior.SingleResult)
- if(currentQuery > 0)
- fieldCount = 0;
-
- // TODO: for CommandBehavior.SequentialAccess - used for reading Large OBjects
- //if((cmdBehavior & CommandBehavior.SequentialAccess) == CommandBehavior.SequentialAccess) {
- //}
-
- DataRow schemaRow;
- int oid;
- DbType dbType;
- Type typ;
-
- for (int i = 0; i < fieldCount; i += 1 ) {
- schemaRow = dataTableSchema.NewRow ();
-
- string columnName = PostgresLibrary.PQfname (pgResult, i);
-
- schemaRow["ColumnName"] = columnName;
- schemaRow["ColumnOrdinal"] = i+1;
- schemaRow["ColumnSize"] = PostgresLibrary.PQfsize (pgResult, i);
- schemaRow["NumericPrecision"] = 0;
- schemaRow["NumericScale"] = 0;
- // TODO: need to get KeyInfo
- if((cmdBehavior & CommandBehavior.KeyInfo) == CommandBehavior.KeyInfo) {
- bool IsUnique, IsKey;
- GetKeyInfo(columnName, out IsUnique, out IsKey);
- }
- else {
- schemaRow["IsUnique"] = false;
- schemaRow["IsKey"] = DBNull.Value;
- }
- schemaRow["BaseCatalogName"] = "";
- schemaRow["BaseColumnName"] = columnName;
- schemaRow["BaseSchemaName"] = "";
- schemaRow["BaseTableName"] = "";
-
- // PostgreSQL type to .NET type stuff
- oid = PostgresLibrary.PQftype (pgResult, i);
- pgtypes[i] = PostgresHelper.OidToTypname (oid, con.Types);
- dbType = PostgresHelper.TypnameToSqlDbType (pgtypes[i]);
-
- typ = PostgresHelper.DbTypeToSystemType (dbType);
- string st = typ.ToString();
- schemaRow["DataType"] = st;
-
- schemaRow["AllowDBNull"] = false;
- schemaRow["ProviderType"] = oid;
- schemaRow["IsAliased"] = false;
- schemaRow["IsExpression"] = false;
- schemaRow["IsIdentity"] = false;
- schemaRow["IsAutoIncrement"] = false;
- schemaRow["IsRowVersion"] = false;
- schemaRow["IsHidden"] = false;
- schemaRow["IsLong"] = false;
- schemaRow["IsReadOnly"] = false;
- schemaRow.AcceptChanges();
- dataTableSchema.Rows.Add (schemaRow);
- }
-
-#if DEBUG_SqlCommand
- Console.WriteLine("********** DEBUG Table Schema BEGIN ************");
- foreach (DataRow myRow in dataTableSchema.Rows) {
- foreach (DataColumn myCol in dataTableSchema.Columns)
- Console.WriteLine(myCol.ColumnName + " = " + myRow[myCol]);
- Console.WriteLine();
- }
- Console.WriteLine("********** DEBUG Table Schema END ************");
-#endif // DEBUG_SqlCommand
-
- }
- }
-
- // TODO: how do we get the key info if
- // we don't have the tableName?
- private void GetKeyInfo(string columnName, out bool isUnique, out bool isKey) {
- isUnique = false;
- isKey = false;
-
- string sql;
-
- sql =
- "SELECT i.indkey, i.indisprimary, i.indisunique " +
- "FROM pg_class c, pg_class c2, pg_index i " +
- "WHERE c.relname = ':tableName' AND c.oid = i.indrelid " +
- "AND i.indexrelid = c2.oid ";
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
deleted file mode 100644
index d2b028bc652..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.Data.SqlClient.SqlCommandBuilder.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.ComponentModel;
-
-namespace System.Data.SqlClient {
-
- /// <summary>
- /// Builder of one command
- /// that will be used in manipulating a table for
- /// a DataSet that is assoicated with a database.
- /// </summary>
- public sealed class SqlCommandBuilder : Component {
-
- [MonoTODO]
- public SqlCommandBuilder() {
-
- }
-
- [MonoTODO]
- public SqlCommandBuilder(SqlDataAdapter adapter) {
-
- }
-
- [MonoTODO]
- public SqlDataAdapter DataAdapter {
- get {
- throw new NotImplementedException ();
- }
-
- set{
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string QuotePrefix {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string QuoteSuffix {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static void DeriveParameters(SqlCommand command) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetDeleteCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetInsertCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlCommand GetUpdateCommand() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RefreshSchema() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override void Dispose(bool disposing) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- ~SqlCommandBuilder() {
- // FIXME: create destructor - release resources
- }
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
deleted file mode 100644
index 0bd37605cc6..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
+++ /dev/null
@@ -1,722 +0,0 @@
-//
-// System.Data.SqlClient.SqlConnection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// use #define DEBUG_SqlConnection if you want to spew debug messages
-// #define DEBUG_SqlConnection
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System.Data.SqlClient {
-
- /// <summary>
- /// Represents an open connection to a SQL data source
- /// </summary>
- public sealed class SqlConnection : Component, IDbConnection,
- ICloneable
- {
- // FIXME: Need to implement class Component,
- // and interfaces: ICloneable and IDisposable
-
- #region Fields
-
- private PostgresTypes types = null;
- private IntPtr pgConn = IntPtr.Zero;
-
- // PGConn (Postgres Connection)
- private string connectionString = "";
- // OLE DB Connection String
- private string pgConnectionString = "";
- // PostgreSQL Connection String
- private SqlTransaction trans = null;
- private int connectionTimeout = 15;
- // default for 15 seconds
-
- // connection parameters in connection string
- private string host = "";
- // Name of host to connect to
- private string hostaddr = "";
- // IP address of host to connect to
- // should be in "n.n.n.n" format
- private string port = "";
- // Port number to connect to at the server host
- private string dbname = ""; // The database name.
- private string user = ""; // User name to connect as.
- private string password = "";
- // Password to be used if the server
- // demands password authentication.
- private string options = "";
- // Trace/debug options to be sent to the server.
- private string tty = "";
- // A file or tty for optional
- // debug output from the backend.
- private string requiressl = "";
- // Set to 1 to require
- // SSL connection to the backend.
- // Libpq will then refuse to connect
- // if the server does not
- // support SSL. Set to 0 (default) to
- // negotiate with server.
-
- // connection state
- private ConnectionState conState = ConnectionState.Closed;
-
- // DataReader state
- private SqlDataReader rdr = null;
- private bool dataReaderOpen = false;
- // FIXME: if true, throw an exception if SqlConnection
- // is used for anything other than reading
- // data using SqlDataReader
-
- private string versionString = "Unknown";
-
- private bool disposed = false;
-
- #endregion // Fields
-
- #region Constructors
-
- // A lot of the defaults were initialized in the Fields
- [MonoTODO]
- public SqlConnection () {
-
- }
-
- [MonoTODO]
- public SqlConnection (String connectionString) {
- SetConnectionString (connectionString);
- }
-
- #endregion // Constructors
-
- #region Destructors
-
- protected override void Dispose(bool disposing) {
- if(!this.disposed)
- try {
- if(disposing) {
- // release any managed resources
- }
- // release any unmanaged resources
- // close any handles
-
- this.disposed = true;
- }
- finally {
- base.Dispose(disposing);
- }
- }
-
- // aka Finalize()
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- [MonoTODO]
- ~SqlConnection() {
- Dispose (false);
- }
-
- #endregion // Destructors
-
- #region Public Methods
-
- IDbTransaction IDbConnection.BeginTransaction () {
- return BeginTransaction ();
- }
-
- public SqlTransaction BeginTransaction () {
- return TransactionBegin (); // call private method
- }
-
- IDbTransaction IDbConnection.BeginTransaction (IsolationLevel
- il) {
- return BeginTransaction (il);
- }
-
- public SqlTransaction BeginTransaction (IsolationLevel il) {
- return TransactionBegin (il); // call private method
- }
-
- // PostgreSQL does not support named transactions/savepoint
- // nor nested transactions
- [Obsolete]
- public SqlTransaction BeginTransaction(string transactionName) {
- return TransactionBegin (); // call private method
- }
-
- [Obsolete]
- public SqlTransaction BeginTransaction(IsolationLevel iso,
- string transactionName) {
- return TransactionBegin (iso); // call private method
- }
-
- [MonoTODO]
- public void ChangeDatabase (string databaseName) {
- throw new NotImplementedException ();
- }
-
- object ICloneable.Clone() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Close () {
- if(dataReaderOpen == true) {
- // TODO: what do I do if
- // the user Closes the connection
- // without closing the Reader first?
-
- }
- CloseDataSource ();
- }
-
- IDbCommand IDbConnection.CreateCommand () {
- return CreateCommand ();
- }
-
- public SqlCommand CreateCommand () {
- SqlCommand sqlcmd = new SqlCommand ("", this);
-
- return sqlcmd;
- }
-
- [MonoTODO]
- public void Open () {
- if(dbname.Equals(""))
- throw new InvalidOperationException(
- "dbname missing");
- else if(conState == ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is already Open");
-
- ConnStatusType connStatus;
-
- // FIXME: check to make sure we have
- // everything to connect,
- // otherwise, throw an exception
-
- pgConn = PostgresLibrary.PQconnectdb
- (pgConnectionString);
-
- // FIXME: should we use PQconnectStart/PQconnectPoll
- // instead of PQconnectdb?
- // PQconnectdb blocks
- // PQconnectStart/PQconnectPoll is non-blocking
-
- connStatus = PostgresLibrary.PQstatus (pgConn);
- if(connStatus == ConnStatusType.CONNECTION_OK) {
- // Successfully Connected
- disposed = false;
- SetupConnection();
- }
- else {
- String errorMessage = PostgresLibrary.
- PQerrorMessage (pgConn);
- errorMessage += ": Could not connect to database.";
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- host, "SqlConnection", 0);
- }
- }
-
- #endregion // Public Methods
-
- #region Internal Methods
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open.
- // Open the Reader. (called from SqlCommand)
- internal void OpenReader(SqlDataReader reader)
- {
- if(dataReaderOpen == true) {
- // TODO: throw exception here?
- // because a reader
- // is already open
- }
- else {
- rdr = reader;
- dataReaderOpen = true;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- // Close the Reader (called from SqlCommand)
- // if closeConnection true, Close() the connection
- // this is based on CommandBehavior.CloseConnection
- internal void CloseReader(bool closeConnection)
- { if(closeConnection == true)
- CloseDataSource();
- else
- dataReaderOpen = false;
- }
-
- #endregion // Internal Methods
-
- #region Private Methods
-
- private void SetupConnection() {
-
- conState = ConnectionState.Open;
-
- // FIXME: load types into hashtable
- types = new PostgresTypes(this);
- types.Load();
-
- versionString = GetDatabaseServerVersion();
-
- // set DATE style to YYYY/MM/DD
- IntPtr pgResult = IntPtr.Zero;
- pgResult = PostgresLibrary.PQexec (pgConn, "SET DATESTYLE TO 'ISO'");
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- private string GetDatabaseServerVersion()
- {
- SqlCommand cmd = new SqlCommand("select version()",this);
- return (string) cmd.ExecuteScalar();
- }
-
- private void CloseDataSource () {
- // FIXME: just a quick hack
- if(conState == ConnectionState.Open) {
- if(trans != null)
- if(trans.DoingTransaction == true) {
- trans.Rollback();
- // trans.Dispose();
- trans = null;
- }
-
- conState = ConnectionState.Closed;
- PostgresLibrary.PQfinish (pgConn);
- pgConn = IntPtr.Zero;
- }
- }
-
- private void SetConnectionString (string connectionString) {
- // FIXME: perform error checking on string
- // while translating string from
- // OLE DB format to PostgreSQL
- // connection string format
- //
- // OLE DB: "host=localhost;dbname=test;user=joe;password=smoe"
- // PostgreSQL: "host=localhost dbname=test user=joe password=smoe"
- //
- // For OLE DB, you would have the additional
- // "provider=postgresql"
- // OleDbConnection you would be using libgda
- //
- // Also, parse the connection string into properties
-
- // FIXME: if connection is open, you can
- // not set the connection
- // string, throw an exception
-
- this.connectionString = connectionString;
- pgConnectionString = ConvertStringToPostgres (
- connectionString);
-
-#if DEBUG_SqlConnection
- Console.WriteLine(
- "OLE-DB Connection String [in]: " +
- this.ConnectionString);
- Console.WriteLine(
- "Postgres Connection String [out]: " +
- pgConnectionString);
-#endif // DEBUG_SqlConnection
- }
-
- private String ConvertStringToPostgres (String
- oleDbConnectionString) {
- StringBuilder postgresConnection =
- new StringBuilder();
- string result;
- string[] connectionParameters;
-
- char[] semicolon = new Char[1];
- semicolon[0] = ';';
-
- // FIXME: what is the max number of value pairs
- // can there be for the OLE DB
- // connnection string? what about libgda max?
- // what about postgres max?
-
- // FIXME: currently assuming value pairs are like:
- // "key1=value1;key2=value2;key3=value3"
- // Need to deal with values that have
- // single or double quotes. And error
- // handling of that too.
- // "key1=value1;key2='value2';key=\"value3\""
-
- // FIXME: put the connection parameters
- // from the connection
- // string into a
- // Hashtable (System.Collections)
- // instead of using private variables
- // to store them
- connectionParameters = oleDbConnectionString.
- Split (semicolon);
- foreach (string sParameter in connectionParameters) {
- if(sParameter.Length > 0) {
- BreakConnectionParameter (sParameter);
- postgresConnection.
- Append (sParameter +
- " ");
- }
- }
- result = postgresConnection.ToString ();
- return result;
- }
-
- private bool BreakConnectionParameter (String sParameter) {
- bool addParm = true;
- int index;
-
- index = sParameter.IndexOf ("=");
- if (index > 0) {
- string parmKey, parmValue;
-
- // separate string "key=value" to
- // string "key" and "value"
- parmKey = sParameter.Substring (0, index);
- parmValue = sParameter.Substring (index + 1,
- sParameter.Length - index - 1);
-
- switch(parmKey.ToLower()) {
- case "hostaddr":
- hostaddr = parmValue;
- break;
-
- case "port":
- port = parmValue;
- break;
-
- case "host":
- // set DataSource property
- host = parmValue;
- break;
-
- case "dbname":
- // set Database property
- dbname = parmValue;
- break;
-
- case "user":
- user = parmValue;
- break;
-
- case "password":
- password = parmValue;
- // addParm = false;
- break;
-
- case "options":
- options = parmValue;
- break;
-
- case "tty":
- tty = parmValue;
- break;
-
- case "requiressl":
- requiressl = parmValue;
- break;
- }
- }
- return addParm;
- }
-
- private SqlTransaction TransactionBegin () {
- // FIXME: need to keep track of
- // transaction in-progress
- trans = new SqlTransaction ();
- // using internal methods of SqlTransaction
- trans.SetConnection (this);
- trans.Begin();
-
- return trans;
- }
-
- private SqlTransaction TransactionBegin (IsolationLevel il) {
- // FIXME: need to keep track of
- // transaction in-progress
- TransactionBegin();
- trans.SetIsolationLevel (il);
-
- return trans;
- }
-
- #endregion
-
- #region Public Properties
-
- [MonoTODO]
- public ConnectionState State {
- get {
- return conState;
- }
- }
-
- public string ConnectionString {
- get {
- return connectionString;
- }
- set {
- SetConnectionString (value);
- }
- }
-
- public int ConnectionTimeout {
- get {
- return connectionTimeout;
- }
- }
-
- public string Database {
- get {
- return dbname;
- }
- }
-
- public string DataSource {
- get {
- return host;
- }
- }
-
- public int PacketSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string ServerVersion {
- get {
- return versionString;
- }
- }
-
- #endregion // Public Properties
-
- #region Internal Properties
-
- // For System.Data.SqlClient classes
- // to get the current transaction
- // in progress - if any
- internal SqlTransaction Transaction {
- get {
- return trans;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the unmanaged PostgreSQL connection
- internal IntPtr PostgresConnection {
- get {
- return pgConn;
- }
- }
-
- // For System.Data.SqlClient classes
- // to get the list PostgreSQL types
- // so can look up based on OID to
- // get the .NET System type.
- internal ArrayList Types {
- get {
- return types.List;
- }
- }
-
- // Used to prevent SqlConnection
- // from doing anything while
- // SqlDataReader is open
- internal bool IsReaderOpen {
- get {
- return dataReaderOpen;
- }
- }
-
- #endregion // Internal Properties
-
- #region Events
-
- public event
- SqlInfoMessageEventHandler InfoMessage;
-
- public event
- StateChangeEventHandler StateChange;
-
- #endregion
-
- #region Inner Classes
-
- private class PostgresTypes {
- // TODO: create hashtable for
- // PostgreSQL types to .NET types
- // containing: oid, typname, SqlDbType
-
- private Hashtable hashTypes;
- private ArrayList pgTypes;
- private SqlConnection con;
-
- // Got this SQL with the permission from
- // the authors of libgda
- private const string SEL_SQL_GetTypes =
- "SELECT oid, typname FROM pg_type " +
- "WHERE typrelid = 0 AND typname !~ '^_' " +
- " AND typname not in ('SET', 'cid', " +
- "'int2vector', 'oidvector', 'regproc', " +
- "'smgr', 'tid', 'unknown', 'xid') " +
- "ORDER BY typname";
-
- internal PostgresTypes(SqlConnection sqlcon) {
-
- con = sqlcon;
- hashTypes = new Hashtable();
- }
-
- private void AddPgType(Hashtable types,
- string typname, DbType dbType) {
-
- PostgresType pgType = new PostgresType();
-
- pgType.typname = typname;
- pgType.dbType = dbType;
-
- types.Add(pgType.typname, pgType);
- }
-
- private void BuildTypes(IntPtr pgResult,
- int nRows, int nFields) {
-
- String value;
-
- int r;
- for(r = 0; r < nRows; r++) {
- PostgresType pgType =
- new PostgresType();
-
- // get data value (oid)
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 0);
-
- pgType.oid = Int32.Parse(value);
-
- // get data value (typname)
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- r, 1);
- pgType.typname = String.Copy(value);
- pgType.dbType = PostgresHelper.
- TypnameToSqlDbType(
- pgType.typname);
-
- pgTypes.Add(pgType);
- }
- pgTypes = ArrayList.ReadOnly(pgTypes);
- }
-
- internal void Load() {
- pgTypes = new ArrayList();
- IntPtr pgResult = IntPtr.Zero; // PGresult
-
- if(con.State != ConnectionState.Open)
- throw new InvalidOperationException(
- "ConnnectionState is not Open");
-
- // FIXME: PQexec blocks
- // while PQsendQuery is non-blocking
- // which is better to use?
- // int PQsendQuery(PGconn *conn,
- // const char *query);
-
- // execute SQL command
- // uses internal property to get the PGConn IntPtr
- pgResult = PostgresLibrary.
- PQexec (con.PostgresConnection, SEL_SQL_GetTypes);
-
- if(pgResult.Equals(IntPtr.Zero)) {
- throw new SqlException(0, 0,
- "No Resultset from PostgreSQL", 0, "",
- con.DataSource, "SqlConnection", 0);
- }
- else {
- ExecStatusType execStatus;
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus == ExecStatusType.PGRES_TUPLES_OK) {
- int nRows;
- int nFields;
-
- nRows = PostgresLibrary.
- PQntuples(pgResult);
-
- nFields = PostgresLibrary.
- PQnfields(pgResult);
-
- BuildTypes (pgResult, nRows, nFields);
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
- else {
- String errorMessage;
-
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
-
- throw new SqlException(0, 0,
- errorMessage, 0, "",
- con.DataSource, "SqlConnection", 0);
- }
- }
- }
-
- public ArrayList List {
- get {
- return pgTypes;
- }
- }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
deleted file mode 100644
index 44d43068ea9..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-//
-// System.Data.SqlClient.SqlDataAdapter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc 2002
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a set of command-related properties that are used
- /// to fill the DataSet and update a data source, all this
- /// from a SQL database.
- /// </summary>
- public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter
- {
- #region Fields
-
- SqlCommand deleteCommand;
- SqlCommand insertCommand;
- SqlCommand selectCommand;
- SqlCommand updateCommand;
-
- static readonly object EventRowUpdated = new object();
- static readonly object EventRowUpdating = new object();
-
- #endregion
-
- #region Constructors
-
- public SqlDataAdapter ()
- : this (new SqlCommand ())
- {
- }
-
- public SqlDataAdapter (SqlCommand selectCommand)
- {
- DeleteCommand = new SqlCommand ();
- InsertCommand = new SqlCommand ();
- SelectCommand = selectCommand;
- UpdateCommand = new SqlCommand ();
- }
-
- public SqlDataAdapter (string selectCommandText, SqlConnection selectConnection)
- : this (new SqlCommand (selectCommandText, selectConnection))
- {
- }
-
- public SqlDataAdapter (string selectCommandText, string selectConnectionString)
- : this (selectCommandText, new SqlConnection (selectConnectionString))
- {
- }
-
- #endregion
-
- #region Properties
-
- public new SqlCommand DeleteCommand {
- get { return deleteCommand; }
- set { deleteCommand = value; }
- }
-
- public new SqlCommand InsertCommand {
- get { return insertCommand; }
- set { insertCommand = value; }
- }
-
- public new SqlCommand SelectCommand {
- get { return selectCommand; }
- set { selectCommand = value; }
- }
-
- public new SqlCommand UpdateCommand {
- get { return updateCommand; }
- set { updateCommand = value; }
- }
-
- IDbCommand IDbDataAdapter.DeleteCommand {
- get { return DeleteCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- DeleteCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.InsertCommand {
- get { return InsertCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- InsertCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.SelectCommand {
- get { return SelectCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- SelectCommand = (SqlCommand)value;
- }
- }
-
- IDbCommand IDbDataAdapter.UpdateCommand {
- get { return UpdateCommand; }
- set {
- if (!(value is SqlCommand))
- throw new ArgumentException ();
- UpdateCommand = (SqlCommand)value;
- }
- }
-
-
- ITableMappingCollection IDataAdapter.TableMappings {
- get { return TableMappings; }
- }
-
- #endregion // Properties
-
- #region Methods
-
- protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new SqlRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
- }
-
-
- protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- {
- return new SqlRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
- }
-
- protected override void OnRowUpdated (RowUpdatedEventArgs value)
- {
- SqlRowUpdatedEventHandler handler = (SqlRowUpdatedEventHandler) Events[EventRowUpdated];
- if ((handler != null) && (value is SqlRowUpdatedEventArgs))
- handler(this, (SqlRowUpdatedEventArgs) value);
- }
-
- protected override void OnRowUpdating (RowUpdatingEventArgs value)
- {
- SqlRowUpdatingEventHandler handler = (SqlRowUpdatingEventHandler) Events[EventRowUpdating];
- if ((handler != null) && (value is SqlRowUpdatingEventArgs))
- handler(this, (SqlRowUpdatingEventArgs) value);
- }
-
- #endregion // Methods
-
- #region Events and Delegates
-
- public event SqlRowUpdatedEventHandler RowUpdated {
- add { Events.AddHandler (EventRowUpdated, value); }
- remove { Events.RemoveHandler (EventRowUpdated, value); }
- }
-
- public event SqlRowUpdatingEventHandler RowUpdating {
- add { Events.AddHandler (EventRowUpdating, value); }
- remove { Events.RemoveHandler (EventRowUpdating, value); }
- }
-
- #endregion // Events and Delegates
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
deleted file mode 100644
index 28d0e1bc4e7..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
+++ /dev/null
@@ -1,422 +0,0 @@
-//
-// System.Data.SqlClient.SqlDataReader.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-//
-// Credits:
-// SQL and concepts were used from libgda 0.8.190 (GNOME Data Access)
-// http://www.gnome-db.org/
-// with permission from the authors of the
-// PostgreSQL provider in libgda:
-// Michael Lausch <michael@lausch.at>
-// Rodrigo Moya <rodrigo@gnome-db.org>
-// Vivien Malerba <malerba@gnome-db.org>
-// Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
-//
-
-// *** uncomment #define to get debug messages, comment for production ***
-//#define DEBUG_SqlDataReader
-
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data;
-
-namespace System.Data.SqlClient {
- /// <summary>
- /// Provides a means of reading one or more forward-only streams
- /// of result sets obtained by executing a command
- /// at a SQL database.
- /// </summary>
- //public sealed class SqlDataReader : MarshalByRefObject,
- // IEnumerable, IDataReader, IDisposable, IDataRecord
- public sealed class SqlDataReader : IEnumerable,
- IDataReader, IDataRecord {
- #region Fields
-
- private SqlCommand cmd;
- private DataTable table = null;
-
- // columns in a row
- private object[] fields; // data value in a .NET type
- private string[] types; // PostgreSQL Type
- private bool[] isNull; // is NULL?
- private int[] actualLength; // ActualLength of data
- private DbType[] dbTypes; // DB data type
- // actucalLength = -1 is variable-length
-
- private bool open = false;
- IntPtr pgResult; // PGresult
- private int rows;
- private int cols;
-
- private int recordsAffected = -1; // TODO: get this value
-
- private int currentRow = -1; // no Read() has been done yet
-
- #endregion // Fields
-
- #region Constructors
-
- internal SqlDataReader (SqlCommand sqlCmd) {
-
- cmd = sqlCmd;
- open = true;
- cmd.OpenReader(this);
- }
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Close() {
- open = false;
-
- // free SqlDataReader resources in SqlCommand
- // and allow SqlConnection to be used again
- cmd.CloseReader();
-
- // TODO: get parameters from result
-
- // clear unmanaged PostgreSQL result set
- PostgresLibrary.PQclear (pgResult);
- pgResult = IntPtr.Zero;
- }
-
- [MonoTODO]
- public DataTable GetSchemaTable() {
- return table;
- }
-
- [MonoTODO]
- public bool NextResult() {
- SqlResult res;
- currentRow = -1;
- bool resultReturned;
-
- // reset
- table = null;
- pgResult = IntPtr.Zero;
- rows = 0;
- cols = 0;
- types = null;
- recordsAffected = -1;
-
- res = cmd.NextResult();
- resultReturned = res.ResultReturned;
-
- if(resultReturned == true) {
- table = res.Table;
- pgResult = res.PgResult;
- rows = res.RowCount;
- cols = res.FieldCount;
- types = res.PgTypes;
- recordsAffected = res.RecordsAffected;
- }
-
- res = null;
- return resultReturned;
- }
-
- [MonoTODO]
- public bool Read() {
-
- string dataValue;
- int c = 0;
-
- if(currentRow < rows - 1) {
-
- currentRow++;
-
- // re-init row
- fields = new object[cols];
- //dbTypes = new DbType[cols];
- actualLength = new int[cols];
- isNull = new bool[cols];
-
- for(c = 0; c < cols; c++) {
-
- // get data value
- dataValue = PostgresLibrary.
- PQgetvalue(
- pgResult,
- currentRow, c);
-
- // is column NULL?
- //isNull[c] = PostgresLibrary.
- // PQgetisnull(pgResult,
- // currentRow, c);
-
- // get Actual Length
- actualLength[c] = PostgresLibrary.
- PQgetlength(pgResult,
- currentRow, c);
-
- DbType dbType;
- dbType = PostgresHelper.
- TypnameToSqlDbType(types[c]);
-
- if(dataValue == null) {
- fields[c] = null;
- isNull[c] = true;
- }
- else if(dataValue.Equals("")) {
- fields[c] = null;
- isNull[c] = true;
- }
- else {
- isNull[c] = false;
- fields[c] = PostgresHelper.
- ConvertDbTypeToSystem (
- dbType,
- dataValue);
- }
- }
- return true;
- }
- return false; // EOF
- }
-
- [MonoTODO]
- public byte GetByte(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetBytes(int i, long fieldOffset,
- byte[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public char GetChar(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public long GetChars(int i, long fieldOffset,
- char[] buffer, int bufferOffset,
- int length) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IDataReader GetData(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string GetDataTypeName(int i) {
- return types[i];
- }
-
- [MonoTODO]
- public DateTime GetDateTime(int i) {
- return (DateTime) fields[i];
- }
-
- [MonoTODO]
- public decimal GetDecimal(int i) {
- return (decimal) fields[i];
- }
-
- [MonoTODO]
- public double GetDouble(int i) {
- return (double) fields[i];
- }
-
- [MonoTODO]
- public Type GetFieldType(int i) {
-
- DataRow row = table.Rows[i];
- return Type.GetType((string)row["DataType"]);
- }
-
- [MonoTODO]
- public float GetFloat(int i) {
- return (float) fields[i];
- }
-
- [MonoTODO]
- public Guid GetGuid(int i) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public short GetInt16(int i) {
- return (short) fields[i];
- }
-
- [MonoTODO]
- public int GetInt32(int i) {
- return (int) fields[i];
- }
-
- [MonoTODO]
- public long GetInt64(int i) {
- return (long) fields[i];
- }
-
- [MonoTODO]
- public string GetName(int i) {
-
- DataRow row = table.Rows[i];
- return (string) row["ColumnName"];
- }
-
- [MonoTODO]
- public int GetOrdinal(string name) {
-
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(((string) row["ColumnName"]).Equals(name))
- return i;
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return i;
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
-
- [MonoTODO]
- public string GetString(int i) {
- return (string) fields[i];
- }
-
- [MonoTODO]
- public object GetValue(int i) {
- return fields[i];
- }
-
- [MonoTODO]
- public int GetValues(object[] values)
- {
- Array.Copy (fields, values, fields.Length);
- return fields.Length;
- }
-
- [MonoTODO]
- public bool IsDBNull(int i) {
- return isNull[i];
- }
-
- [MonoTODO]
- public bool GetBoolean(int i) {
- return (bool) fields[i];
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Destructors
-
- [MonoTODO]
- public void Dispose () {
- }
-
- //[MonoTODO]
- //~SqlDataReader() {
- //}
-
- #endregion // Destructors
-
- #region Properties
-
- public int Depth {
- [MonoTODO]
- get {
- return 0; // always return zero, unless
- // this provider will allow
- // nesting of a row
- }
- }
-
- public bool IsClosed {
- [MonoTODO]
- get {
- if(open == false)
- return true;
- else
- return false;
- }
- }
-
- public int RecordsAffected {
- [MonoTODO]
- get {
- return recordsAffected;
- }
- }
-
- public int FieldCount {
- [MonoTODO]
- get {
- return cols;
- }
- }
-
- public object this[string name] {
- [MonoTODO]
- get {
- int i;
- DataRow row;
-
- for(i = 0; i < table.Rows.Count; i++) {
- row = table.Rows[i];
- if(row["ColumnName"].Equals(name))
- return fields[i];
- }
-
- for(i = 0; i < table.Rows.Count; i++) {
- string ta;
- string n;
-
- row = table.Rows[i];
- ta = ((string) row["ColumnName"]).ToUpper();
- n = name.ToUpper();
-
- if(ta.Equals(n)) {
- return fields[i];
- }
- }
-
- throw new MissingFieldException("Missing field: " + name);
- }
- }
-
- public object this[int i] {
- [MonoTODO]
- get {
- return fields[i];
- }
- }
-
- #endregion // Properties
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlError.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlError.cs
deleted file mode 100644
index e7c722285a9..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlError.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// System.Data.SqlClient.SqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class SqlError
- {
- byte theClass = 0;
- int lineNumber = 0;
- string message = "";
- int number = 0;
- string procedure = "";
- string server = "";
- string source = "";
- byte state = 0;
-
- internal SqlError(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
- this.theClass = theClass;
- this.lineNumber = lineNumber;
- this.message = message;
- this.number = number;
- this.procedure = procedure;
- this.server = server;
- this.source = source;
- this.state = state;
- }
-
- #region Properties
-
- [MonoTODO]
- /// <summary>
- /// severity level of the error
- /// </summary>
- public byte Class {
- get {
- return theClass;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- return lineNumber;
- }
- }
-
- [MonoTODO]
- public string Message {
- get {
- return message;
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- return number;
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- return procedure;
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- return server;
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- return source;
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- return state;
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString ()
- {
- String toStr;
- String stackTrace;
- stackTrace = " <Stack Trace>";
- // FIXME: generate the correct SQL error string
- toStr = "SqlError:" + message + stackTrace;
- return toStr;
- }
-
- internal void SetClass(byte theClass) {
- this.theClass = theClass;
- }
-
- internal void SetLineNumber(int lineNumber) {
- this.lineNumber = lineNumber;
- }
-
- internal void SetMessage(string message) {
- this.message = message;
- }
-
- internal void SetNumber(int number) {
- this.number = number;
- }
-
- internal void SetProcedure(string procedure) {
- this.procedure = procedure;
- }
-
- internal void SetServer(string server) {
- this.server = server;
- }
-
- internal void SetSource(string source) {
- this.source = source;
- }
-
- internal void SetState(byte state) {
- this.state = state;
- }
-
- #endregion
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs
deleted file mode 100644
index 7050d5d08fa..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// System.Data.SqlClient.SqlError.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-using System;
-using System.Collections;
-using System.Data;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Describes an error from a SQL database.
- /// </summary>
- [MonoTODO]
- public sealed class SqlErrorCollection : ICollection, IEnumerable
- {
- ArrayList errorList = new ArrayList();
-
- internal SqlErrorCollection() {
- }
-
- internal SqlErrorCollection(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public int Count {
- get {
- return errorList.Count;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index) {
- throw new NotImplementedException ();
- }
-
- // [MonoTODO]
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- // [MonoTODO]
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- // Index property (indexer)
- // [MonoTODO]
- public SqlError this[int index] {
- get {
- return (SqlError) errorList[index];
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override string ToString()
- {
- throw new NotImplementedException ();
- }
- #endregion
-
- internal void Add(SqlError error) {
- errorList.Add(error);
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- SqlError error = new SqlError(theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- Add(error);
- }
-
- #region Destructors
-
- [MonoTODO]
- ~SqlErrorCollection()
- {
- // FIXME: do the destructor - release resources
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs
deleted file mode 100644
index e447b599372..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// System.Data.SqlClient.SqlException.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc
-//
-using System;
-using System.Data;
-using System.Runtime.Serialization;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Exceptions, as returned by SQL databases.
- /// </summary>
- public sealed class SqlException : SystemException
- {
- private SqlErrorCollection errors;
-
- internal SqlException()
- : base("a SQL Exception has occurred") {
- errors = new SqlErrorCollection();
- }
-
- internal SqlException(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state)
- : base(message) {
-
- errors = new SqlErrorCollection (theClass,
- lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- #region Properties
-
- [MonoTODO]
- public byte Class {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- else
- return errors[0].Class;
- }
-
- set {
- errors[0].SetClass(value);
- }
- }
-
- [MonoTODO]
- public SqlErrorCollection Errors {
- get {
- return errors;
- }
-
- set {
- errors = value;
- }
- }
-
- [MonoTODO]
- public int LineNumber {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception here?
- return errors[0].LineNumber;
- }
-
- set {
- errors[0].SetLineNumber(value);
- }
- }
-
- [MonoTODO]
- public override string Message {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else {
- String msg = "";
- int i = 0;
-
- for(i = 0; i < errors.Count - 1; i++) {
- msg = msg + errors[i].Message + "\n";
- }
- msg = msg + errors[i].Message;
-
- return msg;
- }
- }
- }
-
- [MonoTODO]
- public int Number {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].Number;
- }
-
- set {
- errors[0].SetNumber(value);
- }
- }
-
- [MonoTODO]
- public string Procedure {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Procedure;
- }
-
- set {
- errors[0].SetProcedure(value);
- }
- }
-
- [MonoTODO]
- public string Server {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Server;
- }
-
- set {
- errors[0].SetServer(value);
- }
- }
-
- [MonoTODO]
- public override string Source {
- get {
- if(errors.Count == 0)
- return ""; // FIXME: throw exception?
- else
- return errors[0].Source;
- }
-
- set {
- errors[0].SetSource(value);
- }
- }
-
- [MonoTODO]
- public byte State {
- get {
- if(errors.Count == 0)
- return 0; // FIXME: throw exception?
- else
- return errors[0].State;
- }
-
- set {
- errors[0].SetState(value);
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public override void GetObjectData(SerializationInfo si,
- StreamingContext context) {
- // FIXME: to do
- }
-
- // [Serializable]
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- public override string ToString() {
- String toStr = "";
- for (int i = 0; i < errors.Count; i++) {
- toStr = toStr + errors[i].ToString() + "\n";
- }
- return toStr;
- }
-
- internal void Add(byte theClass, int lineNumber,
- string message, int number, string procedure,
- string server, string source, byte state) {
-
- errors.Add (theClass, lineNumber, message,
- number, procedure,
- server, source, state);
- }
-
- [MonoTODO]
- ~SqlException() {
- // FIXME: destructor to release resources
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventArgs.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventArgs.cs
deleted file mode 100644
index df69dff1d35..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventArgs.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Data.SqlClient.SqlInfoMessageEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlInfoMessageEventArgs : EventArgs
- {
- [MonoTODO]
- public SqlErrorCollection Errors {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Message
- {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Source {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- // representation of InfoMessage event
- return "'ToString() for SqlInfoMessageEventArgs Not Implemented'";
- }
-
- //[MonoTODO]
- //~SqlInfoMessageEventArgs() {
- // FIXME: destructor needs to release resources
- //}
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventHandler.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventHandler.cs
deleted file mode 100644
index c9862d61c03..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlInfoMessageEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Data.SqlClient.SqlInfoMessageEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void
- SqlInfoMessageEventHandler (object sender,
- SqlInfoMessageEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
deleted file mode 100644
index f79dad0dbfb..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// System.Data.SqlClient.SqlParameter.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Runtime.InteropServices;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a parameter to a Command object, and optionally,
- /// its mapping to DataSet columns; and is implemented by .NET
- /// data providers that access data sources.
- /// </summary>
- //public sealed class SqlParameter : MarshalByRefObject,
- // IDbDataParameter, IDataParameter, ICloneable
- public sealed class SqlParameter : IDbDataParameter, IDataParameter
- {
- private string parmName;
- private SqlDbType dbtype;
- private DbType theDbType;
- private object objValue;
- private int size;
- private string sourceColumn;
- private ParameterDirection direction;
- private bool isNullable;
- private byte precision;
- private byte scale;
- private DataRowVersion sourceVersion;
- private int offset;
-
- [MonoTODO]
- public SqlParameter () {
-
- }
-
- [MonoTODO]
- public SqlParameter (string parameterName, object value) {
- this.parmName = parameterName;
- this.objValue = value;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType) {
- this.parmName = parameterName;
- this.dbtype = dbType;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size, string sourceColumn) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- }
-
- [MonoTODO]
- public SqlParameter(string parameterName, SqlDbType dbType,
- int size, ParameterDirection direction,
- bool isNullable, byte precision,
- byte scale, string sourceColumn,
- DataRowVersion sourceVersion, object value) {
-
- this.parmName = parameterName;
- this.dbtype = dbType;
- this.size = size;
- this.sourceColumn = sourceColumn;
- this.direction = direction;
- this.isNullable = isNullable;
- this.precision = precision;
- this.scale = scale;
- this.sourceVersion = sourceVersion;
- this.objValue = value;
- }
-
- [MonoTODO]
- public DbType DbType {
- get {
- return theDbType;
- }
- set {
- theDbType = value;
- }
- }
-
- [MonoTODO]
- public ParameterDirection Direction {
- get {
- return direction;
- }
- set {
- direction = value;
- }
- }
-
- [MonoTODO]
- public bool IsNullable {
- get {
- return isNullable;
- }
- }
-
- [MonoTODO]
- public int Offset {
- get {
- return offset;
- }
-
- set {
- offset = value;
- }
- }
-
- [MonoTODO]
- public string ParameterName {
- get {
- return parmName;
- }
-
- set {
- parmName = value;
- }
- }
-
- [MonoTODO]
- public string SourceColumn {
- get {
- return sourceColumn;
- }
-
- set {
- sourceColumn = value;
- }
- }
-
- [MonoTODO]
- public DataRowVersion SourceVersion {
- get {
- return sourceVersion;
- }
-
- set {
- sourceVersion = value;
- }
- }
-
- [MonoTODO]
- public SqlDbType SqlDbType {
- get {
- return dbtype;
- }
-
- set {
- dbtype = value;
- }
- }
-
- [MonoTODO]
- public object Value {
- get {
- return objValue;
- }
-
- set {
- objValue = value;
- }
- }
-
- [MonoTODO]
- public byte Precision {
- get {
- return precision;
- }
-
- set {
- precision = value;
- }
- }
-
- [MonoTODO]
- public byte Scale {
- get {
- return scale;
- }
-
- set {
- scale = value;
- }
- }
-
- [MonoTODO]
- public int Size
- {
- get {
- return size;
- }
-
- set {
- size = value;
- }
- }
-
- [MonoTODO]
- public override string ToString() {
- return parmName;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs
deleted file mode 100644
index 1ccfae90c9a..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// System.Data.SqlClient.SqlParameterCollection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.ComponentModel;
-using System.Data;
-using System.Data.Common;
-using System.Collections;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Collects all parameters relevant to a Command object
- /// and their mappings to DataSet columns.
- /// </summary>
- // public sealed class SqlParameterCollection : MarshalByRefObject,
- // IDataParameterCollection, IList, ICollection, IEnumerable
- public sealed class SqlParameterCollection : IDataParameterCollection
- {
- private ArrayList parameterList = new ArrayList();
- private Hashtable parameterNames = new Hashtable();
-
-/*
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int IndexOf(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- public bool Contains(string parameterName)
- {
- return parameterNames.ContainsKey(parameterName);
- }
-*/
-
- [MonoTODO]
- public IEnumerator GetEnumerator()
- {
- throw new NotImplementedException ();
- }
-
-
- public int Add( object value)
- {
- // Call the add version that receives a SqlParameter
-
- // Check if value is a SqlParameter.
- CheckType(value);
- Add((SqlParameter) value);
-
- return IndexOf (value);
- }
-
-
- public SqlParameter Add(SqlParameter value)
- {
- parameterList.Add(value);
- parameterNames.Add(value.ParameterName, parameterList.Add(value));
- return value;
- }
-
-
- public SqlParameter Add(string parameterName, object value)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.Value = value;
- // TODO: Get the dbtype and Sqldbtype from system type of value.
-
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName, SqlDbType sqlDbType)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- return Add(sqlparam);
- }
-
-
- public SqlParameter Add(string parameterName,
- SqlDbType sqlDbType, int size, string sourceColumn)
- {
- SqlParameter sqlparam = new SqlParameter();
- sqlparam.ParameterName = parameterName;
- sqlparam.SqlDbType = sqlDbType;
- sqlparam.Size = size;
- sqlparam.SourceColumn = sourceColumn;
- return Add(sqlparam);
- }
-
- [MonoTODO]
- public void Clear()
- {
- throw new NotImplementedException ();
- }
-
-
- public bool Contains(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return Contains(((SqlParameter)value).ParameterName);
- }
-
-
- [MonoTODO]
- public bool Contains(string value)
- {
- return parameterNames.ContainsKey(value);
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
-
- public int IndexOf(object value)
- {
- // Check if value is a SqlParameter
- CheckType(value);
- return IndexOf(((SqlParameter)value).ParameterName);
- }
-
-
- public int IndexOf(string parameterName)
- {
- return parameterList.IndexOf(parameterName);
- }
-
- [MonoTODO]
- public void Insert(int index, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove(object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(string parameterName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Count {
- get {
- return parameterList.Count;
- }
- }
-
- object IList.this[int index] {
- [MonoTODO]
- get {
- return (SqlParameter) this[index];
- }
-
- [MonoTODO]
- set {
- this[index] = (SqlParameter) value;
- }
- }
-
- public SqlParameter this[int index] {
- get {
- return (SqlParameter) parameterList[index];
- }
-
- set {
- parameterList[index] = (SqlParameter) value;
- }
- }
-
- object IDataParameterCollection.this[string parameterName] {
- [MonoTODO]
- get {
- return (SqlParameter) this[parameterName];
- }
-
- [MonoTODO]
- set {
- this[parameterName] = (SqlParameter) value;
- }
- }
-
- public SqlParameter this[string parameterName] {
- get {
- if(parameterNames.ContainsKey(parameterName))
- return (SqlParameter) parameterList[(int)parameterNames[parameterName]];
- else
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
-
- set {
- if(parameterNames.ContainsKey(parameterName))
- parameterList[(int)parameterNames[parameterName]] = (SqlParameter) value;
- else
- throw new IndexOutOfRangeException("The specified name does not exist: " + parameterName);
- }
- }
-
- bool IList.IsFixedSize {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool IList.IsReadOnly {
- get {
- throw new NotImplementedException ();
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// This method checks if the parameter value is of
- /// SqlParameter type. If it doesn't, throws an InvalidCastException.
- /// </summary>
- private void CheckType(object value)
- {
- if(!(value is SqlParameter))
- throw new InvalidCastException("Only SQLParameter objects can be used.");
- }
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventArgs.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventArgs.cs
deleted file mode 100644
index dbc5789aa95..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventArgs.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatedEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient {
- public sealed class SqlRowUpdatedEventArgs : RowUpdatedEventArgs
- {
- [MonoTODO]
- public SqlRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new SqlCommand Command {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- ~SqlRowUpdatedEventArgs ()
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventHandler.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventHandler.cs
deleted file mode 100644
index 8cad2f1cbca..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatedEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatedEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void SqlRowUpdatedEventHandler(object sender,
- SqlRowUpdatedEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventArgs.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventArgs.cs
deleted file mode 100644
index 6194ca1f95d..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatingEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- public sealed class SqlRowUpdatingEventArgs : RowUpdatingEventArgs
- {
- [MonoTODO]
- public SqlRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
- : base (row, command, statementType, tableMapping)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public new SqlCommand Command {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- ~SqlRowUpdatingEventArgs()
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventHandler.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventHandler.cs
deleted file mode 100644
index 69c0228534d..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlRowUpdatingEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.SqlClient.SqlRowUpdatingEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-
-namespace System.Data.SqlClient
-{
- public delegate void SqlRowUpdatingEventHandler(object sender,
- SqlRowUpdatingEventArgs e);
-}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs
deleted file mode 100644
index 3a485b299c5..00000000000
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlTransaction.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-//
-// System.Data.SqlClient.SqlTransaction.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-// use #define DEBUG_SqlTransaction if you want to spew debug messages
-// #define DEBUG_SqlTransaction
-
-
-using System;
-using System.Data;
-using System.Data.Common;
-
-namespace System.Data.SqlClient
-{
- /// <summary>
- /// Represents a transaction to be performed on a SQL database.
- /// </summary>
- // public sealed class SqlTransaction : MarshalByRefObject,
- // IDbTransaction, IDisposable
- public sealed class SqlTransaction : IDbTransaction
- {
- #region Fields
-
- private bool doingTransaction = false;
- private SqlConnection conn = null;
- private IsolationLevel isolationLevel =
- IsolationLevel.ReadCommitted;
- // There are only two IsolationLevel's for PostgreSQL:
- // ReadCommitted and Serializable,
- // but ReadCommitted is the default
-
- #endregion
-
- #region Public Methods
-
- [MonoTODO]
- public void Commit ()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Commit transaction.");
-
- SqlCommand cmd = new SqlCommand("COMMIT", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- [MonoTODO]
- public void Rollback()
- {
- if(doingTransaction == false)
- throw new InvalidOperationException(
- "Begin transaction was not " +
- "done earlier " +
- "thus PostgreSQL can not " +
- "Rollback transaction.");
-
- SqlCommand cmd = new SqlCommand("ROLLBACK", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = false;
- }
-
- // For PostgreSQL, Rollback(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Rollback(string transactionName) {
- // throw new NotImplementedException ();
- Rollback();
- }
-
- // For PostgreSQL, Save(string) will not be implemented
- // because PostgreSQL does not support Savepoints
- [Obsolete]
- public void Save (string savePointName) {
- // throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Internal Methods to System.Data.dll Assembly
-
- internal void Begin()
- {
- if(doingTransaction == true)
- throw new InvalidOperationException(
- "Transaction has begun " +
- "and PostgreSQL does not " +
- "support nested transactions.");
-
- SqlCommand cmd = new SqlCommand("BEGIN", conn);
- cmd.ExecuteNonQuery();
-
- doingTransaction = true;
- }
-
- internal void SetIsolationLevel(IsolationLevel isoLevel)
- {
- String sSql = "SET TRANSACTION ISOLATION LEVEL ";
-
- switch (isoLevel)
- {
- case IsolationLevel.ReadCommitted:
- sSql += "READ COMMITTED";
- break;
-
- case IsolationLevel.Serializable:
- sSql += "SERIALIZABLE";
- break;
-
- default:
- // FIXME: generate exception here
- // PostgreSQL only supports:
- // ReadCommitted or Serializable
- break;
- }
- SqlCommand cmd = new SqlCommand(sSql, conn);
- cmd.ExecuteNonQuery();
-
- this.isolationLevel = isoLevel;
- }
-
- internal void SetConnection(SqlConnection connection)
- {
- this.conn = connection;
- }
-
- #endregion // Internal Methods to System.Data.dll Assembly
-
- #region Properties
-
- IDbConnection IDbTransaction.Connection {
- get {
- return Connection;
- }
- }
-
- public SqlConnection Connection {
- get {
- return conn;
- }
- }
-
- public IsolationLevel IsolationLevel {
- get {
- return isolationLevel;
- }
- }
-
- internal bool DoingTransaction {
- get {
- return doingTransaction;
- }
- }
-
- #endregion Properties
-
- #region Destructors
-
- // Destructors aka Finalize and Dispose
-
- [MonoTODO]
- public void Dispose()
- {
- // FIXME: need to properly release resources
- // Dispose(true);
- }
-
- // Destructor
- [MonoTODO]
- // [Serializable]
- // [ClassInterface(ClassInterfaceType.AutoDual)]
- ~SqlTransaction() {
- // FIXME: need to properly release resources
- // Dispose(false);
- }
-
- #endregion // Destructors
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/INullable.cs b/mcs/class/System.Data/System.Data.SqlTypes/INullable.cs
deleted file mode 100644
index cc4b6f9bb8f..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/INullable.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Data.SqlTypes.INullable
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Data.SqlTypes
-{
- /// <summary>
- /// All of the System.Data.SqlTypes objects and structures implement the INullable interface,
- /// reflecting the fact that, unlike the corresponding system types, SqlTypes can legally contain the value null.
- /// </summary>
- public interface INullable
- {
- bool IsNull {
- get;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlBinary.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlBinary.cs
deleted file mode 100644
index 47a7b2b43ff..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlBinary.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-//
-// System.Data.SqlTypes.SqlBinary
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc.
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- /// <summary>
- /// Represents a variable-length stream of binary data to be stored in or retrieved from a database.
- /// </summary>
- public struct SqlBinary : INullable, IComparable
- {
-
- #region Fields
-
- byte[] value;
-
- public static readonly SqlBinary Null;
-
- #endregion
-
- #region Constructors
-
- public SqlBinary (byte[] value)
- {
- this.value = value;
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public byte this[int index] {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ("The property contains Null.");
- else if (index >= this.Length)
- throw new SqlNullValueException ("The index parameter indicates a position beyond the length of the byte array.");
- else
- return value [index];
- }
- }
-
- public int Length {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ("The property contains Null.");
- else
- return value.Length;
- }
- }
-
- public byte[] Value
- {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ("The property contains Null.");
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public int CompareTo (object value)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlBinary Concat (SqlBinary x, SqlBinary y)
- {
- return (x + y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlBinary))
- return false;
- else
- return (bool) (this == (SqlBinary)value);
- }
-
- public static SqlBoolean Equals(SqlBinary x, SqlBinary y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- throw new NotImplementedException ();
- }
-
- #endregion
-
- #region Operators
-
- public static SqlBoolean GreaterThan (SqlBinary x, SqlBinary y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlBinary x, SqlBinary y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlBinary x, SqlBinary y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlBinary x, SqlBinary y)
- {
- return (x <= y);
- }
-
- public static SqlBoolean NotEquals (SqlBinary x, SqlBinary y)
- {
- return (x != y);
- }
-
- public SqlGuid ToSqlGuid ()
- {
- return new SqlGuid (value);
- }
-
- [MonoTODO]
- public override string ToString ()
- {
- throw new NotImplementedException ();
- }
-
- #endregion
-
- #region Operators
-
- [MonoTODO]
- public static SqlBinary operator + (SqlBinary x, SqlBinary y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator == (SqlBinary x, SqlBinary y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator > (SqlBinary x, SqlBinary y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator >= (SqlBinary x, SqlBinary y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator != (SqlBinary x, SqlBinary y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator < (SqlBinary x, SqlBinary y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator <= (SqlBinary x, SqlBinary y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- public static explicit operator byte[] (SqlBinary x)
- {
- return x.Value;
- }
-
- [MonoTODO]
- public static explicit operator SqlBinary (SqlGuid x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlBinary (byte[] x)
- {
- return new SqlBinary (x);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs
deleted file mode 100644
index 863d23f0227..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlBoolean.cs
+++ /dev/null
@@ -1,377 +0,0 @@
-//
-// System.Data.SqlTypes.SqlBoolean
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc. 2002
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- /// <summary>
- /// Represents an integer value that is either 1 or 0
- /// to be stored in or retrieved from a database.
- /// </summary>
- public struct SqlBoolean : INullable, IComparable
- {
-
- #region Fields
-
- byte value;
-
- public static readonly SqlBoolean False = new SqlBoolean (false);
- public static readonly SqlBoolean Null;
- public static readonly SqlBoolean One = new SqlBoolean (1);
- public static readonly SqlBoolean True = new SqlBoolean (true);
- public static readonly SqlBoolean Zero = new SqlBoolean (0);
-
- #endregion // Fields
-
- #region Constructors
-
- public SqlBoolean (bool value)
- {
- this.value = (byte) (value ? 1 : 0);
- }
-
- public SqlBoolean (int value)
- {
- this.value = (byte) (value != 0 ? 1 : 0);
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public byte ByteValue {
- get {
- if (this.IsNull)
- throw new SqlNullValueException( "The property is set to null.");
- else
- return value;
- }
- }
-
- public bool IsFalse {
- get {
- if (this.IsNull)
- return false;
- else
- return (value == 0);
- }
- }
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public bool IsTrue {
- get {
- if (this.IsNull)
- return false;
- else
- return (value != 0);
- }
- }
-
- public bool Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException( "The property is set to null.");
- else
- return this.IsTrue;
- }
- }
-
- #endregion // Properties
-
- public static SqlBoolean And (SqlBoolean x, SqlBoolean y)
- {
- return (x & y);
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlBoolean))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlBoolean"));
- else if (((SqlBoolean)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlBoolean)value).ByteValue);
- }
-
- public override bool Equals(object value)
- {
- if (!(value is SqlByte))
- return false;
- else
- return (bool) (this == (SqlBoolean)value);
- }
-
- public static SqlBoolean Equals(SqlBoolean x, SqlBoolean y)
- {
- return (x == y);
- }
-
- public override int GetHashCode()
- {
- return (int)value;
- }
-
- public static SqlBoolean NotEquals(SqlBoolean x, SqlBoolean y)
- {
- return (x != y);
- }
-
- public static SqlBoolean OnesComplement(SqlBoolean x)
- {
- return ~x;
- }
-
- public static SqlBoolean Or(SqlBoolean x, SqlBoolean y)
- {
- return (x | y);
- }
-
- public static SqlBoolean Parse(string s)
- {
- return new SqlBoolean (Boolean.Parse (s));
- }
-
- public SqlByte ToSqlByte()
- {
- return new SqlByte (value);
- }
-
- // **************************************************
- // Conversion from SqlBoolean to other SqlTypes
- // **************************************************
-
- public SqlDecimal ToSqlDecimal()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt16 ToSqlInt16()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle()
- {
- return ((SqlSingle)this);
- }
-
- [MonoTODO]
- public SqlString ToSqlString()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ToString()
- {
- throw new NotImplementedException ();
- }
-
- // Bitwise exclusive-OR (XOR)
- public static SqlBoolean Xor(SqlBoolean x, SqlBoolean y)
- {
- return (x ^ y);
- }
-
- // **************************************************
- // Public Operators
- // **************************************************
-
- // Bitwise AND
- public static SqlBoolean operator & (SqlBoolean x, SqlBoolean y)
- {
- return new SqlBoolean (x.Value & y.Value);
- }
-
- // Bitwise OR
- public static SqlBoolean operator | (SqlBoolean x, SqlBoolean y)
- {
- return new SqlBoolean (x.Value | y.Value);
-
- }
-
- // Compares two instances for equality
- public static SqlBoolean operator == (SqlBoolean x, SqlBoolean y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- // Bitwize exclusive-OR (XOR)
- public static SqlBoolean operator ^ (SqlBoolean x, SqlBoolean y)
- {
- return new SqlBoolean (x.Value ^ y.Value);
- }
-
- // test Value of SqlBoolean to determine it is false.
- public static bool operator false (SqlBoolean x)
- {
- return x.IsFalse;
- }
-
- // in-equality
- public static SqlBoolean operator != (SqlBoolean x, SqlBoolean y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value != y.Value);
- }
-
- // Logical NOT
- public static SqlBoolean operator ! (SqlBoolean x)
- {
- if (x.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (!x.Value);
- }
-
- // One's Complement
- public static SqlBoolean operator ~ (SqlBoolean x)
- {
- return new SqlBoolean (~x.ByteValue);
- }
-
- // test to see if value is true
- public static bool operator true (SqlBoolean x)
- {
- return x.IsTrue;
- }
-
- // ****************************************
- // Type Conversion
- // ****************************************
-
-
- // SqlBoolean to Boolean
- public static explicit operator bool (SqlBoolean x)
- {
- return x.Value;
- }
-
-
- // SqlByte to SqlBoolean
- public static explicit operator SqlBoolean (SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean ((int)x.Value);
- }
-
- // SqlDecimal to SqlBoolean
- public static explicit operator SqlBoolean (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean ((int)x.Value);
- }
-
- // SqlDouble to SqlBoolean
- public static explicit operator SqlBoolean (SqlDouble x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean ((int)x.Value);
- }
-
- // SqlInt16 to SqlBoolean
- public static explicit operator SqlBoolean (SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean ((int)x.Value);
- }
-
- // SqlInt32 to SqlBoolean
- public static explicit operator SqlBoolean (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean (x.Value);
- }
-
- // SqlInt64 to SqlBoolean
- public static explicit operator SqlBoolean (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean ((int)x.Value);
- }
-
- // SqlMoney to SqlBoolean
- public static explicit operator SqlBoolean (SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean ((int)x.Value);
- }
-
- // SqlSingle to SqlBoolean
- public static explicit operator SqlBoolean (SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlBoolean ((int)x.Value);
- }
-
- // SqlString to SqlBoolean
- [MonoTODO]
- public static explicit operator SqlBoolean (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- // Boolean to SqlBoolean
- public static implicit operator SqlBoolean (bool x)
- {
- return new SqlBoolean (x);
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs
deleted file mode 100644
index feb5a339931..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlByte.cs
+++ /dev/null
@@ -1,390 +0,0 @@
-//
-// System.Data.SqlTypes.SqlByte
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlByte : INullable, IComparable
- {
- #region Fields
-
- byte value;
- public static readonly SqlByte MaxValue = new SqlByte (0xff);
- public static readonly SqlByte MinValue = new SqlByte (0);
- public static readonly SqlByte Null;
- public static readonly SqlByte Zero = new SqlByte (0);
-
- #endregion
-
- #region Constructors
-
- public SqlByte (byte value)
- {
- this.value = value;
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public byte Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public static SqlByte Add (SqlByte x, SqlByte y)
- {
- return (x + y);
- }
-
- public static SqlByte BitwiseAnd (SqlByte x, SqlByte y)
- {
- return (x & y);
- }
-
- public static SqlByte BitwiseOr (SqlByte x, SqlByte y)
- {
- return (x | y);
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlByte))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlByte"));
- else if (((SqlByte)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlByte)value).Value);
- }
-
- public static SqlByte Divide (SqlByte x, SqlByte y)
- {
- return (x / y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlByte))
- return false;
- else
- return (bool) (this == (SqlByte)value);
- }
-
- public static SqlBoolean Equals (SqlByte x, SqlByte y)
- {
- return (x == y);
- }
-
- public override int GetHashCode ()
- {
- return (int)value;
- }
-
- public static SqlBoolean GreaterThan (SqlByte x, SqlByte y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlByte x, SqlByte y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlByte x, SqlByte y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlByte x, SqlByte y)
- {
- return (x <= y);
- }
-
- public static SqlByte Mod (SqlByte x, SqlByte y)
- {
- return (x % y);
- }
-
- public static SqlByte Multiply (SqlByte x, SqlByte y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals (SqlByte x, SqlByte y)
- {
- return (x != y);
- }
-
- public static SqlByte OnesComplement (SqlByte x)
- {
- return ~x;
- }
-
- [MonoTODO]
- public static SqlByte Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlByte Subtract (SqlByte x, SqlByte y)
- {
- return (x - y);
- }
-
- public SqlBoolean ToSqlBoolean ()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlDecimal ToSqlDecimal ()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble ()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt16 ToSqlInt16 ()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32 ()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64 ()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney ()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle ()
- {
- return ((SqlSingle)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- public static SqlByte Xor (SqlByte x, SqlByte y)
- {
- return (x ^ y);
- }
-
- public static SqlByte operator + (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value + y.Value));
- }
-
- public static SqlByte operator & (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value & y.Value));
- }
-
- public static SqlByte operator | (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value | y.Value));
- }
-
- public static SqlByte operator / (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value / y.Value));
- }
-
- public static SqlBoolean operator == (SqlByte x, SqlByte y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- public static SqlByte operator ^ (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value ^ y.Value));
- }
-
- public static SqlBoolean operator > (SqlByte x, SqlByte y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value > y.Value);
- }
-
- public static SqlBoolean operator >= (SqlByte x, SqlByte y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- public static SqlBoolean operator != (SqlByte x, SqlByte y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- public static SqlBoolean operator < (SqlByte x, SqlByte y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value < y.Value);
- }
-
- public static SqlBoolean operator <= (SqlByte x, SqlByte y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- public static SqlByte operator % (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value % y.Value));
- }
-
- public static SqlByte operator * (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value * y.Value));
- }
-
- public static SqlByte operator ~ (SqlByte x)
- {
- return new SqlByte ((byte) ~x.Value);
- }
-
- public static SqlByte operator - (SqlByte x, SqlByte y)
- {
- return new SqlByte ((byte) (x.Value - y.Value));
- }
-
- public static explicit operator SqlByte (SqlBoolean x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte (x.ByteValue);
- }
-
- public static explicit operator byte (SqlByte x)
- {
- return x.Value;
- }
-
- public static explicit operator SqlByte (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte ((byte)x.Value);
- }
-
- public static explicit operator SqlByte (SqlDouble x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte ((byte)x.Value);
- }
-
- public static explicit operator SqlByte (SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte ((byte)x.Value);
- }
-
- public static explicit operator SqlByte (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte ((byte)x.Value);
- }
-
- public static explicit operator SqlByte (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte ((byte)x.Value);
- }
-
- public static explicit operator SqlByte (SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte ((byte)x.Value);
- }
-
- public static explicit operator SqlByte (SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlByte ((byte)x.Value);
- }
-
- [MonoTODO]
- public static explicit operator SqlByte (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlByte (byte x)
- {
- return new SqlByte (x);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlCompareOptions.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlCompareOptions.cs
deleted file mode 100644
index c07a93e220c..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlCompareOptions.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Data.SqlTypes.SqlCompareOptions.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-namespace System.Data.SqlTypes
-{
- /// <summary>
- /// compare option values for SqlString
- /// </summary>
- [Flags]
- [Serializable]
- public enum SqlCompareOptions {
- BinarySort,
- IgnoreCase,
- IgnoreKanaType,
- IgnoreNonSpace,
- IgnoreWidth,
- None
- }
-
-}
-
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
deleted file mode 100644
index ca53e300153..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlDateTime.cs
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// System.Data.SqlTypes.SqlDateTime
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlDateTime : INullable, IComparable
- {
- #region Fields
- private DateTime value;
-
- public static readonly SqlDateTime MaxValue = new SqlDateTime (9999,12,31);
- public static readonly SqlDateTime MinValue = new SqlDateTime (1753,1,1);
- public static readonly SqlDateTime Null;
- public static readonly int SQLTicksPerHour;
- public static readonly int SQLTicksPerMinute;
- public static readonly int SQLTicksPerSecond;
-
- #endregion
-
- #region Constructors
-
- public SqlDateTime (DateTime value)
- {
- this.value = value;
- }
-
- [MonoTODO]
- public SqlDateTime (int dayTicks, int timeTicks)
- {
- throw new NotImplementedException ();
- }
-
- public SqlDateTime (int year, int month, int day)
- {
- this.value = new DateTime (year, month, day);
- }
-
- public SqlDateTime (int year, int month, int day, int hour, int minute, int second)
- {
- this.value = new DateTime (year, month, day, hour, minute, second);
- }
-
- [MonoTODO]
- public SqlDateTime (int year, int month, int day, int hour, int minute, int second, double millisecond)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SqlDateTime (int year, int month, int day, int hour, int minute, int second, int bilisecond)
- {
- throw new NotImplementedException ();
- }
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- public int DayTicks {
- get { throw new NotImplementedException (); }
- }
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- [MonoTODO]
- public int TimeTicks {
- get { throw new NotImplementedException (); }
- }
-
- public DateTime Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ("The property contains Null.");
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlDateTime))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlDateTime"));
- else if (((SqlDateTime)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlDateTime)value).Value);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlDateTime))
- return false;
- else
- return (bool) (this == (SqlDateTime)value);
- }
-
- public static SqlBoolean Equals (SqlDateTime x, SqlDateTime y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return 42;
- }
-
- public static SqlBoolean GreaterThan (SqlDateTime x, SqlDateTime y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlDateTime x, SqlDateTime y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlDateTime x, SqlDateTime y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlDateTime x, SqlDateTime y)
- {
- return (x <= y);
- }
-
- public static SqlBoolean NotEquals (SqlDateTime x, SqlDateTime y)
- {
- return (x != y);
- }
-
- [MonoTODO]
- public static SqlDateTime Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- [MonoTODO]
- public static SqlDateTime operator + (SqlDateTime x, TimeSpan t)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlBoolean operator == (SqlDateTime x, SqlDateTime y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- public static SqlBoolean operator > (SqlDateTime x, SqlDateTime y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value > y.Value);
- }
-
- public static SqlBoolean operator >= (SqlDateTime x, SqlDateTime y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- public static SqlBoolean operator != (SqlDateTime x, SqlDateTime y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- public static SqlBoolean operator < (SqlDateTime x, SqlDateTime y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value < y.Value);
- }
-
- public static SqlBoolean operator <= (SqlDateTime x, SqlDateTime y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- [MonoTODO]
- public static SqlDateTime operator - (SqlDateTime x, TimeSpan t)
- {
- throw new NotImplementedException ();
- }
-
- public static explicit operator DateTime (SqlDateTime x)
- {
- return x.Value;
- }
-
- [MonoTODO]
- public static explicit operator SqlDateTime (SqlString x)
- {
- throw new NotImplementedException();
- }
-
- public static implicit operator SqlDateTime (DateTime x)
- {
- return new SqlDateTime (x);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs
deleted file mode 100644
index 93017993f35..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlDecimal.cs
+++ /dev/null
@@ -1,638 +0,0 @@
-//
-// System.Data.SqlTypes.SqlDecimal
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlDecimal : INullable, IComparable
- {
- #region Fields
-
- int[] value;
- byte precision;
- byte scale;
- bool positive;
-
- // borrowed from System.Decimal
- const int SCALE_SHIFT = 16;
- const int SIGN_SHIFT = 31;
- const int RESERVED_SS32_BITS = 0x7F00FFFF;
-
- public static readonly byte MaxPrecision = 38;
- public static readonly byte MaxScale = 28;
- public static readonly SqlDecimal MaxValue = new SqlDecimal (79228162514264337593543950335.0);
- public static readonly SqlDecimal MinValue = new SqlDecimal (-79228162514264337593543950335.0);
- public static readonly SqlDecimal Null;
-
- #endregion
-
- #region Constructors
-
- public SqlDecimal (decimal value)
- {
- int[] binData = Decimal.GetBits (value);
-
- this.precision = MaxPrecision; // this value seems unclear
-
- this.scale = (byte)(binData[3] >> SCALE_SHIFT);
- if (this.scale > MaxScale || (this.scale & RESERVED_SS32_BITS) != 0)
- throw new ArgumentException(Locale.GetText ("Invalid scale"));
-
- this.positive = ((binData[3] >> SIGN_SHIFT) > 0);
- this.value = new int[4];
- this.value[0] = binData[0];
- this.value[1] = binData[1];
- this.value[2] = binData[2];
- this.value[3] = 0;
- }
-
- public SqlDecimal (double value) : this ((decimal)value) { }
- public SqlDecimal (int value) : this ((decimal)value) { }
- public SqlDecimal (long value) : this ((decimal)value) { }
-
- public SqlDecimal (byte bPrecision, byte bScale, bool fPositive, int[] bits) : this (bPrecision, bScale, fPositive, bits[0], bits[1], bits[2], bits[3]) { }
-
- public SqlDecimal (byte bPrecision, byte bScale, bool fPositive, int data1, int data2, int data3, int data4)
- {
- this.precision = bPrecision;
- this.scale = bScale;
- this.positive = fPositive;
- this.value = new int[4];
- this.value[0] = data1;
- this.value[1] = data2;
- this.value[2] = data3;
- this.value[3] = data4;
- }
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- public byte[] BinData {
- get { throw new NotImplementedException (); }
- }
-
- public int[] Data {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return (value);
- }
- }
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public bool IsPositive {
- get { return positive; }
- }
-
- public byte Precision {
- get { return precision; }
- }
-
- public byte Scale {
- get { return scale; }
- }
-
- public decimal Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- if (this.value[3] > 0)
- throw new OverflowException ();
- else
- System.Console.WriteLine( "boo!" );
- return new decimal (value[0], value[1], value[2], !positive, scale);
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public static SqlDecimal Abs (SqlDecimal n)
- {
- throw new NotImplementedException();
- }
-
- public static SqlDecimal Add (SqlDecimal x, SqlDecimal y)
- {
- return (x + y);
- }
-
- [MonoTODO]
- public static SqlDecimal AdjustScale (SqlDecimal n, int digits, bool fRound)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlDecimal Ceiling (SqlDecimal n)
- {
- throw new NotImplementedException();
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlDecimal))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlDecimal"));
- else if (((SqlDecimal)value).IsNull)
- return 1;
- else
- return this.Value.CompareTo (((SqlDecimal)value).Value);
- }
-
- [MonoTODO]
- public static SqlDecimal ConvertToPrecScale (SqlDecimal n, int precision, int scale)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlDecimal Divide (SqlDecimal x, SqlDecimal y)
- {
- return (x / y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlDecimal))
- return false;
- else
- return (bool) (this == (SqlDecimal)value);
- }
-
- public static SqlBoolean Equals (SqlDecimal x, SqlDecimal y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public static SqlDecimal Floor (SqlDecimal n)
- {
- throw new NotImplementedException ();
- }
-
- public override int GetHashCode ()
- {
- return (int)this.Value;
- }
-
- public static SqlBoolean GreaterThan (SqlDecimal x, SqlDecimal y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlDecimal x, SqlDecimal y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlDecimal x, SqlDecimal y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlDecimal x, SqlDecimal y)
- {
- return (x <= y);
- }
-
- public static SqlDecimal Multiply (SqlDecimal x, SqlDecimal y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals (SqlDecimal x, SqlDecimal y)
- {
- return (x != y);
- }
-
- [MonoTODO]
- public static SqlDecimal Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlDecimal Power (SqlDecimal n, double exp)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlDecimal Round (SqlDecimal n, int position)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlInt32 Sign (SqlDecimal n)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlDecimal Subtract (SqlDecimal x, SqlDecimal y)
- {
- return (x - y);
- }
-
- public double ToDouble ()
- {
- return ((double)this.Value);
- }
-
- public SqlBoolean ToSqlBoolean ()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte ()
- {
- return ((SqlByte)this);
- }
-
- public SqlDouble ToSqlDouble ()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt16 ToSqlInt16 ()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32 ()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64 ()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney ()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle ()
- {
- return ((SqlSingle)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- [MonoTODO]
- public static SqlDecimal Truncate (SqlDecimal n, int position)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlDecimal operator + (SqlDecimal x, SqlDecimal y)
- {
- // if one of them is negative, perform subtraction
- if (x.IsPositive && !y.IsPositive) return x - y;
- if (y.IsPositive && !x.IsPositive) return y - x;
-
- // adjust the scale to the smaller of the two beforehand
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- // set the precision to the greater of the two
- byte resultPrecision;
- if (x.Precision > y.Precision)
- resultPrecision = x.Precision;
- else
- resultPrecision = y.Precision;
-
- int[] xData = x.Data;
- int[] yData = y.Data;
- int[] resultBits = new int[4];
-
- ulong res;
- ulong carry = 0;
-
- // add one at a time, and carry the results over to the next
- for (int i = 0; i < 4; i +=1)
- {
- carry = 0;
- res = (ulong)(xData[i]) + (ulong)(yData[i]) + carry;
- if (res > Int32.MaxValue)
- {
- carry = res - Int32.MaxValue;
- res = Int32.MaxValue;
- }
- resultBits [i] = (int)res;
- }
-
- // if we have carry left, then throw an exception
- if (carry > 0)
- throw new OverflowException ();
- else
- return new SqlDecimal (resultPrecision, x.Scale, x.IsPositive, resultBits);
- }
-
- [MonoTODO]
- public static SqlDecimal operator / (SqlDecimal x, SqlDecimal y)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlBoolean operator == (SqlDecimal x, SqlDecimal y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
-
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- for (int i = 0; i < 4; i += 1)
- {
- if (x.Data[i] != y.Data[i])
- return new SqlBoolean (false);
- }
- return new SqlBoolean (true);
- }
-
- public static SqlBoolean operator > (SqlDecimal x, SqlDecimal y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
-
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- for (int i = 3; i >= 0; i -= 1)
- {
- if (x.Data[i] == 0 && y.Data[i] == 0)
- continue;
- else
- return new SqlBoolean (x.Data[i] > y.Data[i]);
- }
- return new SqlBoolean (false);
- }
-
- public static SqlBoolean operator >= (SqlDecimal x, SqlDecimal y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
-
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- for (int i = 3; i >= 0; i -= 1)
- {
- if (x.Data[i] == 0 && y.Data[i] == 0)
- continue;
- else
- return new SqlBoolean (x.Data[i] >= y.Data[i]);
- }
- return new SqlBoolean (true);
- }
-
- public static SqlBoolean operator != (SqlDecimal x, SqlDecimal y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
-
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- for (int i = 0; i < 4; i += 1)
- {
- if (x.Data[i] != y.Data[i])
- return new SqlBoolean (true);
- }
- return new SqlBoolean (false);
- }
-
- public static SqlBoolean operator < (SqlDecimal x, SqlDecimal y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
-
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- for (int i = 3; i >= 0; i -= 1)
- {
- if (x.Data[i] == 0 && y.Data[i] == 0)
- continue;
-
- return new SqlBoolean (x.Data[i] < y.Data[i]);
- }
- return new SqlBoolean (false);
- }
-
- public static SqlBoolean operator <= (SqlDecimal x, SqlDecimal y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
-
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- for (int i = 3; i >= 0; i -= 1)
- {
- if (x.Data[i] == 0 && y.Data[i] == 0)
- continue;
- else
- return new SqlBoolean (x.Data[i] <= y.Data[i]);
- }
- return new SqlBoolean (true);
- }
-
- public static SqlDecimal operator * (SqlDecimal x, SqlDecimal y)
- {
- // adjust the scale to the smaller of the two beforehand
- if (x.Scale > y.Scale)
- x = SqlDecimal.AdjustScale(x, y.Scale - x.Scale, true);
- else if (y.Scale > x.Scale)
- y = SqlDecimal.AdjustScale(y, x.Scale - y.Scale, true);
-
- // set the precision to the greater of the two
- byte resultPrecision;
- if (x.Precision > y.Precision)
- resultPrecision = x.Precision;
- else
- resultPrecision = y.Precision;
-
- int[] xData = x.Data;
- int[] yData = y.Data;
- int[] resultBits = new int[4];
-
- ulong res;
- ulong carry = 0;
-
- // multiply one at a time, and carry the results over to the next
- for (int i = 0; i < 4; i +=1)
- {
- carry = 0;
- res = (ulong)(xData[i]) * (ulong)(yData[i]) + carry;
- if (res > Int32.MaxValue)
- {
- carry = res - Int32.MaxValue;
- res = Int32.MaxValue;
- }
- resultBits [i] = (int)res;
- }
-
- // if we have carry left, then throw an exception
- if (carry > 0)
- throw new OverflowException ();
- else
- return new SqlDecimal (resultPrecision, x.Scale, (x.IsPositive == y.IsPositive), resultBits);
-
- }
-
- public static SqlDecimal operator - (SqlDecimal x, SqlDecimal y)
- {
- if (x.IsPositive && !y.IsPositive) return x + y;
- if (!x.IsPositive && y.IsPositive) return -(x + y);
- if (!x.IsPositive && !y.IsPositive) return y - x;
-
- // otherwise, x is positive and y is positive
- bool resultPositive = (bool)(x > y);
- int[] yData = y.Data;
-
- for (int i = 0; i < 4; i += 1) yData[i] = -yData[i];
-
- SqlDecimal yInverse = new SqlDecimal (y.Precision, y.Scale, y.IsPositive, yData);
-
- if (resultPositive)
- return x + yInverse;
- else
- return -(x + yInverse);
- }
-
- public static SqlDecimal operator - (SqlDecimal n)
- {
- return new SqlDecimal (n.Precision, n.Scale, !n.IsPositive, n.Data);
- }
-
- public static explicit operator SqlDecimal (SqlBoolean x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.ByteValue);
- }
-
- public static explicit operator Decimal (SqlDecimal n)
- {
- return n.Value;
- }
-
- public static explicit operator SqlDecimal (SqlDouble x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.Value);
- }
-
- public static explicit operator SqlDecimal (SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.Value);
- }
-
- [MonoTODO]
- public static explicit operator SqlDecimal (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlDecimal (decimal x)
- {
- return new SqlDecimal (x);
- }
-
- public static implicit operator SqlDecimal (SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.Value);
- }
-
- public static implicit operator SqlDecimal (SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.Value);
- }
-
- public static implicit operator SqlDecimal (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.Value);
- }
-
- public static implicit operator SqlDecimal (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.Value);
- }
-
- public static implicit operator SqlDecimal (SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDecimal ((decimal)x.Value);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs
deleted file mode 100644
index 427d13c0e17..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlDouble.cs
+++ /dev/null
@@ -1,345 +0,0 @@
-//
-// System.Data.SqlTypes.SqlDouble
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlDouble : INullable, IComparable
- {
- #region Fields
- double value;
-
- public static readonly SqlDouble MaxValue = new SqlDouble (1.79E+308);
- public static readonly SqlDouble MinValue = new SqlDouble (-1.79E+308);
- public static readonly SqlDouble Null;
- public static readonly SqlDouble Zero = new SqlDouble (0);
-
- #endregion
-
- #region Constructors
-
- public SqlDouble (double value)
- {
- this.value = value;
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public double Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public static SqlDouble Add (SqlDouble x, SqlDouble y)
- {
- return (x + y);
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlDouble))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlDouble"));
- else if (((SqlDouble)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlDouble)value).Value);
- }
-
- public static SqlDouble Divide (SqlDouble x, SqlDouble y)
- {
- return (x / y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlDouble))
- return false;
- else
- return (bool) (this == (SqlDouble)value);
- }
-
- public static SqlBoolean Equals (SqlDouble x, SqlDouble y)
- {
- return (x == y);
- }
-
- public override int GetHashCode ()
- {
- return (int)value;
- }
-
- public static SqlBoolean GreaterThan (SqlDouble x, SqlDouble y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlDouble x, SqlDouble y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlDouble x, SqlDouble y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlDouble x, SqlDouble y)
- {
- return (x <= y);
- }
-
- public static SqlDouble Multiply (SqlDouble x, SqlDouble y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals (SqlDouble x, SqlDouble y)
- {
- return (x != y);
- }
-
- [MonoTODO]
- public static SqlDouble Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlDouble Subtract (SqlDouble x, SqlDouble y)
- {
- return (x - y);
- }
-
- public SqlBoolean ToSqlBoolean ()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte ()
- {
- return ((SqlByte)this);
- }
-
- public SqlDecimal ToSqlDecimal ()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlInt16 ToSqlInt16 ()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32 ()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64 ()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney ()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle ()
- {
- return ((SqlSingle)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- public static SqlDouble operator + (SqlDouble x, SqlDouble y)
- {
- return new SqlDouble (x.Value + y.Value);
- }
-
- public static SqlDouble operator / (SqlDouble x, SqlDouble y)
- {
- return new SqlDouble (x.Value / y.Value);
- }
-
- public static SqlBoolean operator == (SqlDouble x, SqlDouble y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- public static SqlBoolean operator > (SqlDouble x, SqlDouble y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value > y.Value);
- }
-
- public static SqlBoolean operator >= (SqlDouble x, SqlDouble y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- public static SqlBoolean operator != (SqlDouble x, SqlDouble y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- public static SqlBoolean operator < (SqlDouble x, SqlDouble y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value < y.Value);
- }
-
- public static SqlBoolean operator <= (SqlDouble x, SqlDouble y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- public static SqlDouble operator * (SqlDouble x, SqlDouble y)
- {
- return new SqlDouble (x.Value * y.Value);
- }
-
- public static SqlDouble operator - (SqlDouble x, SqlDouble y)
- {
- return new SqlDouble (x.Value - y.Value);
- }
-
- public static SqlDouble operator - (SqlDouble n)
- {
- return new SqlDouble (-(n.Value));
- }
-
- public static explicit operator SqlDouble (SqlBoolean x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.ByteValue);
- }
-
- public static explicit operator double (SqlDouble x)
- {
- return x.Value;
- }
-
- [MonoTODO]
- public static explicit operator SqlDouble (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlDouble (double x)
- {
- return new SqlDouble (x);
- }
-
- public static implicit operator SqlDouble (SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.Value);
- }
-
- public static implicit operator SqlDouble (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.Value);
- }
-
- public static implicit operator SqlDouble (SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.Value);
- }
-
- public static implicit operator SqlDouble (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.Value);
- }
-
- public static implicit operator SqlDouble (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.Value);
- }
-
- public static implicit operator SqlDouble (SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.Value);
- }
-
- public static implicit operator SqlDouble (SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlDouble ((double)x.Value);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlGuid.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlGuid.cs
deleted file mode 100644
index 5c020c57127..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlGuid.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// System.Data.SqlTypes.SqlGuid
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlGuid : INullable, IComparable
- {
- #region Fields
-
- Guid value;
-
- public static readonly SqlGuid Null;
-
- #endregion
-
- #region Constructors
-
- public SqlGuid (byte[] value)
- {
- this.value = new Guid (value);
- }
-
- public SqlGuid (Guid g)
- {
- this.value = g;
- }
-
- public SqlGuid (string s)
- {
- this.value = new Guid (s);
- }
-
- public SqlGuid (int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k)
- {
- this.value = new Guid (a, b, c, d, e, f, g, h, i, j, k);
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == SqlGuid.Null); }
- }
-
- public Guid Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ("The property contains Null.");
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlGuid))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlGuid"));
- else if (((SqlGuid)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlGuid)value).Value);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlGuid))
- return false;
- else
- return (bool) (this == (SqlGuid)value);
- }
-
- public static SqlBoolean Equals (SqlGuid x, SqlGuid y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return 42;
- }
-
- public static SqlBoolean GreaterThan (SqlGuid x, SqlGuid y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlGuid x, SqlGuid y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlGuid x, SqlGuid y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlGuid x, SqlGuid y)
- {
- return (x <= y);
- }
-
- public static SqlBoolean NotEquals (SqlGuid x, SqlGuid y)
- {
- return (x != y);
- }
-
- [MonoTODO]
- public static SqlGuid Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public byte[] ToByteArray()
- {
- throw new NotImplementedException ();
- }
-
- public SqlBinary ToSqlBinary ()
- {
- return ((SqlBinary)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- public static SqlBoolean operator == (SqlGuid x, SqlGuid y)
- {
- if (x.IsNull || y.IsNull) return SqlBoolean.Null;
- return new SqlBoolean (x.Value == y.Value);
- }
-
- [MonoTODO]
- public static SqlBoolean operator > (SqlGuid x, SqlGuid y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator >= (SqlGuid x, SqlGuid y)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlBoolean operator != (SqlGuid x, SqlGuid y)
- {
- if (x.IsNull || y.IsNull) return SqlBoolean.Null;
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- [MonoTODO]
- public static SqlBoolean operator < (SqlGuid x, SqlGuid y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static SqlBoolean operator <= (SqlGuid x, SqlGuid y)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static explicit operator SqlGuid (SqlBinary x)
- {
- throw new NotImplementedException ();
- }
-
- public static explicit operator Guid (SqlGuid x)
- {
- return x.Value;
- }
-
- [MonoTODO]
- public static explicit operator SqlGuid (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlGuid (Guid x)
- {
- return new SqlGuid (x);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs
deleted file mode 100644
index 725f9d08023..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlInt16.cs
+++ /dev/null
@@ -1,396 +0,0 @@
-//
-// System.Data.SqlTypes.SqlInt16
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlInt16 : INullable, IComparable
- {
- #region Fields
-
- short value;
-
- public static readonly SqlInt16 MaxValue = new SqlInt16 (32767);
- public static readonly SqlInt16 MinValue = new SqlInt16 (-32768);
- public static readonly SqlInt16 Null;
- public static readonly SqlInt16 Zero = new SqlInt16 (0);
-
- #endregion
-
- #region Constructors
-
- public SqlInt16 (short value)
- {
- this.value = value;
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public short Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public static SqlInt16 Add (SqlInt16 x, SqlInt16 y)
- {
- return (x + y);
- }
-
- public static SqlInt16 BitwiseAnd (SqlInt16 x, SqlInt16 y)
- {
- return (x & y);
- }
-
- public static SqlInt16 BitwiseOr (SqlInt16 x, SqlInt16 y)
- {
- return (x | y);
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlInt16))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlInt16"));
- else if (((SqlInt16)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlInt16)value).Value);
- }
-
- public static SqlInt16 Divide (SqlInt16 x, SqlInt16 y)
- {
- return (x / y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlInt16))
- return false;
- else
- return (bool) (this == (SqlInt16)value);
- }
-
- public static SqlBoolean Equals (SqlInt16 x, SqlInt16 y)
- {
- return (x == y);
- }
-
- public override int GetHashCode ()
- {
- return (int)value;
- }
-
- public static SqlBoolean GreaterThan (SqlInt16 x, SqlInt16 y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlInt16 x, SqlInt16 y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlInt16 x, SqlInt16 y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlInt16 x, SqlInt16 y)
- {
- return (x <= y);
- }
-
- public static SqlInt16 Mod (SqlInt16 x, SqlInt16 y)
- {
- return (x % y);
- }
-
- public static SqlInt16 Multiply (SqlInt16 x, SqlInt16 y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals (SqlInt16 x, SqlInt16 y)
- {
- return (x != y);
- }
-
- public static SqlInt16 OnesComplement (SqlInt16 x)
- {
- return ~x;
- }
-
- [MonoTODO]
- public static SqlInt16 Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlInt16 Subtract (SqlInt16 x, SqlInt16 y)
- {
- return (x - y);
- }
-
- public SqlBoolean ToSqlBoolean ()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte ()
- {
- return ((SqlByte)this);
- }
-
- public SqlDecimal ToSqlDecimal ()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble ()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt32 ToSqlInt32 ()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64 ()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney ()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle ()
- {
- return ((SqlSingle)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- public static SqlInt16 Xor (SqlInt16 x, SqlInt16 y)
- {
- return (x ^ y);
- }
-
- public static SqlInt16 operator + (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x.Value + y.Value));
- }
-
- public static SqlInt16 operator & (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x.value & y.Value));
- }
-
- public static SqlInt16 operator | (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x | y));
- }
-
- public static SqlInt16 operator / (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x.Value / y.Value));
- }
-
- public static SqlBoolean operator == (SqlInt16 x, SqlInt16 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- public static SqlInt16 operator ^ (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x.Value ^ y.Value));
- }
-
- public static SqlBoolean operator > (SqlInt16 x, SqlInt16 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value > y.Value);
- }
-
- public static SqlBoolean operator >= (SqlInt16 x, SqlInt16 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- public static SqlBoolean operator != (SqlInt16 x, SqlInt16 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- public static SqlBoolean operator < (SqlInt16 x, SqlInt16 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value < y.Value);
- }
-
- public static SqlBoolean operator <= (SqlInt16 x, SqlInt16 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- public static SqlInt16 operator % (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x.Value % y.Value));
- }
-
- public static SqlInt16 operator * (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x.Value * y.Value));
- }
-
- public static SqlInt16 operator ~ (SqlInt16 x)
- {
- return new SqlInt16 ((short) (~x.Value));
- }
-
- public static SqlInt16 operator - (SqlInt16 x, SqlInt16 y)
- {
- return new SqlInt16 ((short) (x.Value - y.Value));
- }
-
- public static SqlInt16 operator - (SqlInt16 n)
- {
- return new SqlInt16 ((short) (-n.Value));
- }
-
- public static explicit operator SqlInt16 (SqlBoolean x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.ByteValue);
- }
-
- public static explicit operator SqlInt16 (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.Value);
- }
-
- public static explicit operator SqlInt16 (SqlDouble x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.Value);
- }
-
- public static explicit operator short (SqlInt16 x)
- {
- return x.Value;
- }
-
- public static explicit operator SqlInt16 (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.Value);
- }
-
- public static explicit operator SqlInt16 (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.Value);
- }
-
- public static explicit operator SqlInt16 (SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.Value);
- }
-
- public static explicit operator SqlInt16 (SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.Value);
- }
-
- [MonoTODO]
- public static explicit operator SqlInt16 (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlInt16 (short x)
- {
- return new SqlInt16 (x);
- }
-
- public static implicit operator SqlInt16 (SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt16 ((short)x.Value);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs
deleted file mode 100644
index 5319eb82774..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlInt32.cs
+++ /dev/null
@@ -1,423 +0,0 @@
-//
-// System.Data.SqlTypes.SqlInt32
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc. 2002
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
-
- /// <summary>
- /// a 32-bit signed integer to be used in reading or writing
- /// of data from a database
- /// </summary>
- public struct SqlInt32 : INullable, IComparable
- {
- #region Fields
-
- int value;
-
- public static readonly SqlInt32 MaxValue = new SqlInt32 (2147483647);
- public static readonly SqlInt32 MinValue = new SqlInt32 (-2147483648);
- public static readonly SqlInt32 Null;
- public static readonly SqlInt32 Zero = new SqlInt32 (0);
-
- #endregion
-
- #region Constructors
-
- public SqlInt32(int value)
- {
- this.value = value;
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public int Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public static SqlInt32 Add (SqlInt32 x, SqlInt32 y)
- {
- return (x + y);
- }
-
- public static SqlInt32 BitwiseAnd(SqlInt32 x, SqlInt32 y)
- {
- return (x & y);
- }
-
- public static SqlInt32 BitwiseOr(SqlInt32 x, SqlInt32 y)
- {
- return (x | y);
- }
-
- public int CompareTo(object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlInt32))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlInt32"));
- else if (((SqlInt32)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlInt32)value).Value);
- }
-
- public static SqlInt32 Divide(SqlInt32 x, SqlInt32 y)
- {
- return (x / y);
- }
-
- public override bool Equals(object value)
- {
- if (!(value is SqlInt32))
- return false;
- else
- return (bool) (this == (SqlInt32)value);
- }
-
- public static SqlBoolean Equals(SqlInt32 x, SqlInt32 y)
- {
- return (x == y);
- }
-
- public override int GetHashCode()
- {
- return value;
- }
-
- public static SqlBoolean GreaterThan (SqlInt32 x, SqlInt32 y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlInt32 x, SqlInt32 y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan(SqlInt32 x, SqlInt32 y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual(SqlInt32 x, SqlInt32 y)
- {
- return (x <= y);
- }
-
- public static SqlInt32 Mod(SqlInt32 x, SqlInt32 y)
- {
- return (x % y);
- }
-
- public static SqlInt32 Multiply(SqlInt32 x, SqlInt32 y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals(SqlInt32 x, SqlInt32 y)
- {
- return (x != y);
- }
-
- public static SqlInt32 OnesComplement(SqlInt32 x)
- {
- return ~x;
- }
-
- public static SqlInt32 Parse(string s)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlInt32 Subtract(SqlInt32 x, SqlInt32 y)
- {
- return (x - y);
- }
-
- public SqlBoolean ToSqlBoolean()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte()
- {
- return ((SqlByte)this);
- }
-
- public SqlDecimal ToSqlDecimal()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt16 ToSqlInt16()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt64 ToSqlInt64()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle()
- {
- return ((SqlSingle)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- public static SqlInt32 Xor(SqlInt32 x, SqlInt32 y)
- {
- return (x ^ y);
- }
-
- #endregion
-
- #region Operators
-
- // Compute Addition
- public static SqlInt32 operator + (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value + y.Value);
- }
-
- // Bitwise AND
- public static SqlInt32 operator & (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value & y.Value);
- }
-
- // Bitwise OR
- public static SqlInt32 operator | (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value | y.Value);
- }
-
- // Compute Division
- public static SqlInt32 operator / (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value / y.Value);
- }
-
- // Compare Equality
- public static SqlBoolean operator == (SqlInt32 x, SqlInt32 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- // Bitwise Exclusive-OR (XOR)
- public static SqlInt32 operator ^ (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value ^ y.Value);
- }
-
- // > Compare
- public static SqlBoolean operator >(SqlInt32 x, SqlInt32 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value > y.Value);
- }
-
- // >= Compare
- public static SqlBoolean operator >= (SqlInt32 x, SqlInt32 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- // != Inequality Compare
- public static SqlBoolean operator != (SqlInt32 x, SqlInt32 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value != y.Value);
- }
-
- // < Compare
- public static SqlBoolean operator < (SqlInt32 x, SqlInt32 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value < y.Value);
- }
-
- // <= Compare
- public static SqlBoolean operator <= (SqlInt32 x, SqlInt32 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- // Compute Modulus
- public static SqlInt32 operator % (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value % y.Value);
- }
-
- // Compute Multiplication
- public static SqlInt32 operator * (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value * y.Value);
- }
-
- // Ones Complement
- public static SqlInt32 operator ~ (SqlInt32 x)
- {
- return new SqlInt32 (~x.Value);
- }
-
- // Subtraction
- public static SqlInt32 operator - (SqlInt32 x, SqlInt32 y)
- {
- return new SqlInt32 (x.Value - y.Value);
- }
-
- // Negates the Value
- public static SqlInt32 operator - (SqlInt32 x)
- {
- return new SqlInt32 (-x.Value);
- }
-
- // Type Conversions
- public static explicit operator SqlInt32 (SqlBoolean x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.ByteValue);
- }
-
- public static explicit operator SqlInt32 (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.Value);
- }
-
- public static explicit operator SqlInt32 (SqlDouble x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.Value);
- }
-
- public static explicit operator int (SqlInt32 x)
- {
- return x.Value;
- }
-
- public static explicit operator SqlInt32 (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.Value);
- }
-
- public static explicit operator SqlInt32(SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.Value);
- }
-
- public static explicit operator SqlInt32(SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.Value);
- }
-
- [MonoTODO]
- public static explicit operator SqlInt32(SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlInt32(int x)
- {
- return new SqlInt32 (x);
- }
-
- public static implicit operator SqlInt32(SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.Value);
- }
-
- public static implicit operator SqlInt32(SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlInt32 ((int)x.Value);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs
deleted file mode 100644
index aea159d17d4..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlInt64.cs
+++ /dev/null
@@ -1,398 +0,0 @@
-//
-// System.Data.SqlTypes.SqlInt64
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlInt64 : INullable, IComparable
- {
- #region Fields
-
- long value;
-
- [MonoTODO]
- public static readonly SqlInt64 MaxValue; // 2^63 - 1
-
- [MonoTODO]
- public static readonly SqlInt64 MinValue; // -2^63
-
- public static readonly SqlInt64 Null;
- public static readonly SqlInt64 Zero = new SqlInt64 (0);
-
- #endregion
-
- #region Constructors
-
- public SqlInt64 (long value)
- {
- this.value = value;
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public long Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public static SqlInt64 Add (SqlInt64 x, SqlInt64 y)
- {
- return (x + y);
- }
-
- public static SqlInt64 BitwiseAnd (SqlInt64 x, SqlInt64 y)
- {
- return (x & y);
- }
-
- public static SqlInt64 BitwiseOr (SqlInt64 x, SqlInt64 y)
- {
- return (x | y);
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlInt64))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlInt64"));
- else if (((SqlInt64)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlInt64)value).Value);
- }
-
- public static SqlInt64 Divide (SqlInt64 x, SqlInt64 y)
- {
- return (x / y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlInt64))
- return false;
- else
- return (bool) (this == (SqlInt64)value);
- }
-
- public static SqlBoolean Equals (SqlInt64 x, SqlInt64 y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return (int)value;
- }
-
- public static SqlBoolean GreaterThan (SqlInt64 x, SqlInt64 y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlInt64 x, SqlInt64 y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlInt64 x, SqlInt64 y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlInt64 x, SqlInt64 y)
- {
- return (x <= y);
- }
-
- public static SqlInt64 Mod (SqlInt64 x, SqlInt64 y)
- {
- return (x % y);
- }
-
- public static SqlInt64 Multiply (SqlInt64 x, SqlInt64 y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals (SqlInt64 x, SqlInt64 y)
- {
- return (x != y);
- }
-
- public static SqlInt64 OnesComplement (SqlInt64 x)
- {
- return ~x;
- }
-
- [MonoTODO]
- public static SqlInt64 Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlInt64 Subtract (SqlInt64 x, SqlInt64 y)
- {
- return (x - y);
- }
-
- public SqlBoolean ToSqlBoolean ()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte ()
- {
- return ((SqlByte)this);
- }
-
- public SqlDecimal ToSqlDecimal ()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble ()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt16 ToSqlInt16 ()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32 ()
- {
- return ((SqlInt32)this);
- }
-
- public SqlMoney ToSqlMoney ()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle ()
- {
- return ((SqlSingle)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- return value.ToString ();
- }
-
- public static SqlInt64 Xor (SqlInt64 x, SqlInt64 y)
- {
- return (x ^ y);
- }
-
- public static SqlInt64 operator + (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64 (x.Value + y.Value);
- }
-
- public static SqlInt64 operator & (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64 (x.value & y.Value);
- }
-
- public static SqlInt64 operator | (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64 (x.value | y.Value);
- }
-
- public static SqlInt64 operator / (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64 (x.Value / y.Value);
- }
-
- public static SqlBoolean operator == (SqlInt64 x, SqlInt64 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- public static SqlInt64 operator ^ (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64 (x.Value ^ y.Value);
- }
-
- public static SqlBoolean operator > (SqlInt64 x, SqlInt64 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value > y.Value);
- }
-
- public static SqlBoolean operator >= (SqlInt64 x, SqlInt64 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- public static SqlBoolean operator != (SqlInt64 x, SqlInt64 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- public static SqlBoolean operator < (SqlInt64 x, SqlInt64 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value < y.Value);
- }
-
- public static SqlBoolean operator <= (SqlInt64 x, SqlInt64 y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- public static SqlInt64 operator % (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64(x.Value % y.Value);
- }
-
- public static SqlInt64 operator * (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64 (x.Value * y.Value);
- }
-
- public static SqlInt64 operator ~ (SqlInt64 x)
- {
- return new SqlInt64 (~(x.Value));
- }
-
- public static SqlInt64 operator - (SqlInt64 x, SqlInt64 y)
- {
- return new SqlInt64 (x.Value - y.Value);
- }
-
- public static SqlInt64 operator - (SqlInt64 n)
- {
- return new SqlInt64 (-(n.Value));
- }
-
- public static explicit operator SqlInt64 (SqlBoolean x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.ByteValue);
- }
-
- public static explicit operator SqlInt64 (SqlDecimal x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.Value);
- }
-
- public static explicit operator SqlInt64 (SqlDouble x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.Value);
- }
-
- public static explicit operator long (SqlInt64 x)
- {
- return x.Value;
- }
-
- public static explicit operator SqlInt64 (SqlMoney x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.Value);
- }
-
- public static explicit operator SqlInt64 (SqlSingle x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.Value);
- }
-
- [MonoTODO]
- public static explicit operator SqlInt64 (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlInt64 (long x)
- {
- return new SqlInt64 (x);
- }
-
- public static implicit operator SqlInt64 (SqlByte x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.Value);
- }
-
- public static implicit operator SqlInt64 (SqlInt16 x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.Value);
- }
-
- public static implicit operator SqlInt64 (SqlInt32 x)
- {
- if (x.IsNull)
- return SqlInt64.Null;
- else
- return new SqlInt64 ((long)x.Value);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs
deleted file mode 100644
index 1767ee099db..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlMoney.cs
+++ /dev/null
@@ -1,381 +0,0 @@
-//
-// System.Data.SqlTypes.SqlMoney
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlMoney : INullable, IComparable
- {
- #region Fields
-
- decimal value;
-
- public static readonly SqlMoney MaxValue = new SqlMoney (922337203685475.5807);
- public static readonly SqlMoney MinValue = new SqlMoney (-922337203685477.5808);
- public static readonly SqlMoney Null;
- public static readonly SqlMoney Zero = new SqlMoney (0);
-
- #endregion
-
- #region Constructors
-
- public SqlMoney (decimal value)
- {
- this.value = value;
- }
-
- public SqlMoney (double value)
- {
- this.value = (decimal)value;
- }
-
- public SqlMoney (int value)
- {
- this.value = (decimal)value;
- }
-
- public SqlMoney (long value)
- {
- this.value = (decimal)value;
- }
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public decimal Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public static SqlMoney Add (SqlMoney x, SqlMoney y)
- {
- return (x + y);
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlMoney))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlMoney"));
- else if (((SqlMoney)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlMoney)value).Value);
- }
-
- public static SqlMoney Divide (SqlMoney x, SqlMoney y)
- {
- return (x / y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlMoney))
- return false;
- else
- return (bool) (this == (SqlMoney)value);
- }
-
- public static SqlBoolean Equals (SqlMoney x, SqlMoney y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return (int)value;
- }
-
- public static SqlBoolean GreaterThan (SqlMoney x, SqlMoney y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlMoney x, SqlMoney y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlMoney x, SqlMoney y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlMoney x, SqlMoney y)
- {
- return (x <= y);
- }
-
- public static SqlMoney Multiply (SqlMoney x, SqlMoney y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals (SqlMoney x, SqlMoney y)
- {
- return (x != y);
- }
-
- [MonoTODO]
- public static SqlMoney Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlMoney Subtract (SqlMoney x, SqlMoney y)
- {
- return (x - y);
- }
-
- public decimal ToDecimal ()
- {
- return value;
- }
-
- public double ToDouble ()
- {
- return (double)value;
- }
-
- public int ToInt32 ()
- {
- return (int)value;
- }
-
- public long ToInt64 ()
- {
- return (long)value;
- }
-
- public SqlBoolean ToSqlBoolean ()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte ()
- {
- return ((SqlByte)this);
- }
-
- public SqlDecimal ToSqlDecimal ()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble ()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt16 ToSqlInt16 ()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32 ()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64 ()
- {
- return ((SqlInt64)this);
- }
-
- public SqlSingle ToSqlSingle ()
- {
- return ((SqlSingle)this);
- }
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- if (this.IsNull)
- return String.Empty;
- else
- return value.ToString ();
- }
-
- public static SqlMoney operator + (SqlMoney x, SqlMoney y)
- {
- return new SqlMoney (x.Value + y.Value);
- }
-
- public static SqlMoney operator / (SqlMoney x, SqlMoney y)
- {
- return new SqlMoney (x.Value / y.Value);
- }
-
- public static SqlBoolean operator == (SqlMoney x, SqlMoney y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- public static SqlBoolean operator > (SqlMoney x, SqlMoney y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value > y.Value);
- }
-
- public static SqlBoolean operator >= (SqlMoney x, SqlMoney y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- public static SqlBoolean operator != (SqlMoney x, SqlMoney y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- public static SqlBoolean operator < (SqlMoney x, SqlMoney y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value < y.Value);
- }
-
- public static SqlBoolean operator <= (SqlMoney x, SqlMoney y)
- {
- if (x.IsNull || y.IsNull) return SqlBoolean.Null;
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- public static SqlMoney operator * (SqlMoney x, SqlMoney y)
- {
- return new SqlMoney (x.Value * y.Value);
- }
-
- public static SqlMoney operator - (SqlMoney x, SqlMoney y)
- {
- return new SqlMoney (x.Value - y.Value);
- }
-
- public static SqlMoney operator - (SqlMoney n)
- {
- return new SqlMoney (-(n.Value));
- }
-
- public static explicit operator SqlMoney (SqlBoolean x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney ((decimal)x.ByteValue);
- }
-
- public static explicit operator SqlMoney (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney (x.Value);
- }
-
- public static explicit operator SqlMoney (SqlDouble x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney ((decimal)x.Value);
- }
-
- public static explicit operator decimal (SqlMoney x)
- {
- return x.Value;
- }
-
- public static explicit operator SqlMoney (SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney ((decimal)x.Value);
- }
-
- [MonoTODO]
- public static explicit operator SqlMoney (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlMoney (decimal x)
- {
- return new SqlMoney (x);
- }
-
- public static implicit operator SqlMoney (SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney ((decimal)x.Value);
- }
-
- public static implicit operator SqlMoney (SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney ((decimal)x.Value);
- }
-
- public static implicit operator SqlMoney (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney ((decimal)x.Value);
- }
-
- public static implicit operator SqlMoney (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlMoney ((decimal)x.Value);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs
deleted file mode 100644
index 19c3c13ed4d..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.SqlNullValueException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data.SqlTypes {
-
- [Serializable]
- public class SqlNullValueException : SqlTypeException
- {
- public SqlNullValueException ()
- : base (Locale.GetText ("The value property is null"))
- {
- }
-
- public SqlNullValueException (string message)
- : base (message)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlSingle.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlSingle.cs
deleted file mode 100644
index 4b5f05537d2..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlSingle.cs
+++ /dev/null
@@ -1,332 +0,0 @@
-//
-// System.Data.SqlTypes.SqlSingle
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- public struct SqlSingle : INullable, IComparable
- {
- #region Fields
-
- float value;
-
- public static readonly SqlSingle MaxValue = new SqlSingle (3.40E+38);
- public static readonly SqlSingle MinValue = new SqlSingle (-3.40E+38);
- public static readonly SqlSingle Null;
- public static readonly SqlSingle Zero = new SqlSingle (0);
-
- #endregion
-
- #region Constructors
-
- public SqlSingle (double value)
- {
- this.value = (float)value;
- }
-
- public SqlSingle (float value)
- {
- this.value = value;
- }
-
- #endregion
-
- #region Properties
-
- public bool IsNull {
- get { return (bool) (this == Null); }
- }
-
- public float Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ();
- else
- return value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public static SqlSingle Add (SqlSingle x, SqlSingle y)
- {
- return (x + y);
- }
-
- public int CompareTo (object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlSingle))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlSingle"));
- else if (((SqlSingle)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlSingle)value).Value);
- }
-
- public static SqlSingle Divide (SqlSingle x, SqlSingle y)
- {
- return (x / y);
- }
-
- public override bool Equals (object value)
- {
- if (!(value is SqlSingle))
- return false;
- else
- return (bool) (this == (SqlSingle)value);
- }
-
- public static SqlBoolean Equals (SqlSingle x, SqlSingle y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return (int)value;
- }
-
- public static SqlBoolean GreaterThan (SqlSingle x, SqlSingle y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual (SqlSingle x, SqlSingle y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan (SqlSingle x, SqlSingle y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual (SqlSingle x, SqlSingle y)
- {
- return (x <= y);
- }
-
- public static SqlSingle Multiply (SqlSingle x, SqlSingle y)
- {
- return (x * y);
- }
-
- public static SqlBoolean NotEquals (SqlSingle x, SqlSingle y)
- {
- return (x != y);
- }
-
- [MonoTODO]
- public static SqlSingle Parse (string s)
- {
- throw new NotImplementedException ();
- }
-
- public static SqlSingle Subtract (SqlSingle x, SqlSingle y)
- {
- return (x - y);
- }
-
- public SqlBoolean ToSqlBoolean ()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte ()
- {
- return ((SqlByte)this);
- }
-
- public SqlDecimal ToSqlDecimal ()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble ()
- {
- return ((SqlDouble)this);
- }
-
- public SqlInt16 ToSqlInt16 ()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32 ()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64 ()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney ()
- {
- return ((SqlMoney)this);
- }
-
-
- public SqlString ToSqlString ()
- {
- return ((SqlString)this);
- }
-
- public override string ToString ()
- {
- return value.ToString ();
- }
-
- public static SqlSingle operator + (SqlSingle x, SqlSingle y)
- {
- return new SqlSingle (x.Value + y.Value);
- }
-
- public static SqlSingle operator / (SqlSingle x, SqlSingle y)
- {
- return new SqlSingle (x.Value / y.Value);
- }
-
- public static SqlBoolean operator == (SqlSingle x, SqlSingle y)
- {
- if (x.IsNull || y .IsNull) return SqlBoolean.Null;
- return new SqlBoolean (x.Value == y.Value);
- }
-
- public static SqlBoolean operator > (SqlSingle x, SqlSingle y)
- {
- if (x.IsNull || y .IsNull) return SqlBoolean.Null;
- return new SqlBoolean (x.Value > y.Value);
- }
-
- public static SqlBoolean operator >= (SqlSingle x, SqlSingle y)
- {
- if (x.IsNull || y .IsNull) return SqlBoolean.Null;
- return new SqlBoolean (x.Value >= y.Value);
- }
-
- public static SqlBoolean operator != (SqlSingle x, SqlSingle y)
- {
- if (x.IsNull || y .IsNull) return SqlBoolean.Null;
- return new SqlBoolean (!(x.Value == y.Value));
- }
-
- public static SqlBoolean operator < (SqlSingle x, SqlSingle y)
- {
- if (x.IsNull || y .IsNull) return SqlBoolean.Null;
- return new SqlBoolean (x.Value < y.Value);
- }
-
- public static SqlBoolean operator <= (SqlSingle x, SqlSingle y)
- {
- if (x.IsNull || y .IsNull) return SqlBoolean.Null;
- return new SqlBoolean (x.Value <= y.Value);
- }
-
- public static SqlSingle operator * (SqlSingle x, SqlSingle y)
- {
- return new SqlSingle (x.Value * y.Value);
- }
-
- public static SqlSingle operator - (SqlSingle x, SqlSingle y)
- {
- return new SqlSingle (x.Value - y.Value);
- }
-
- public static SqlSingle operator - (SqlSingle n)
- {
- return new SqlSingle (-(n.Value));
- }
-
- public static explicit operator SqlSingle (SqlBoolean x)
- {
- return new SqlSingle((float)x.ByteValue);
- }
-
- public static explicit operator SqlSingle (SqlDouble x)
- {
- return new SqlSingle((float)x.Value);
- }
-
- public static explicit operator float (SqlSingle x)
- {
- return x.Value;
- }
-
- [MonoTODO]
- public static explicit operator SqlSingle (SqlString x)
- {
- throw new NotImplementedException ();
- }
-
- public static implicit operator SqlSingle (float x)
- {
- return new SqlSingle (x);
- }
-
- public static implicit operator SqlSingle (SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlSingle((float)x.Value);
- }
-
- public static implicit operator SqlSingle (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlSingle((float)x.Value);
- }
-
- public static implicit operator SqlSingle (SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlSingle((float)x.Value);
- }
-
- public static implicit operator SqlSingle (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlSingle((float)x.Value);
- }
-
- public static implicit operator SqlSingle (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlSingle((float)x.Value);
- }
-
- public static implicit operator SqlSingle (SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlSingle((float)x.Value);
- }
-
- #endregion
- }
-}
-
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs
deleted file mode 100644
index 46f5c2f0d92..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs
+++ /dev/null
@@ -1,461 +0,0 @@
-//
-// System.Data.SqlTypes.SqlString
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Ximian, Inc. 2002
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Data.SqlTypes
-{
- /// <summary>
- /// A variable-length stream of characters
- /// to be stored in or retrieved from the database
- /// </summary>
- public struct SqlString : INullable, IComparable
- {
-
- #region Fields
-
- string value;
-
- public static readonly int BinarySort;
- public static readonly int IgnoreCase;
- public static readonly int IgnoreKanaType;
- public static readonly int IgnoreNonSpace;
- public static readonly int IgnoreWidth;
- public static readonly SqlString Null;
-
- #endregion // Fields
-
- #region Constructors
-
- // init with a string data
- public SqlString (string data)
- {
- this.value = data;
- }
-
- // init with a string data and locale id values.
- [MonoTODO]
- public SqlString (string data, int lcid)
- {
- throw new NotImplementedException ();
- }
-
- // init with locale id, compare options,
- // and an array of bytes data
- [MonoTODO]
- public SqlString (int lcid, SqlCompareOptions compareOptions, byte[] data)
- {
- throw new NotImplementedException ();
- }
-
- // init with string data, locale id, and compare options
- [MonoTODO]
- public SqlString (string data, int lcid, SqlCompareOptions compareOptions)
- {
- throw new NotImplementedException ();
- }
-
- // init with locale id, compare options, array of bytes data,
- // and whether unicode is encoded or not
- [MonoTODO]
- public SqlString (int lcid, SqlCompareOptions compareOptions, byte[] data, bool fUnicode)
- {
- throw new NotImplementedException ();
- }
-
- // init with locale id, compare options, array of bytes data,
- // starting index in the byte array,
- // and number of bytes to copy
- [MonoTODO]
- public SqlString (int lcid, SqlCompareOptions compareOptions, byte[] data, int index, int count)
- {
- throw new NotImplementedException ();
- }
-
- // init with locale id, compare options, array of bytes data,
- // starting index in the byte array, number of byte to copy,
- // and whether unicode is encoded or not
- [MonoTODO]
- public SqlString (int lcid, SqlCompareOptions compareOptions, byte[] data, int index, int count, bool fUnicode)
- {
- throw new NotImplementedException ();
- }
-
- #endregion // Constructors
-
-
- #region Public Properties
-
- public CompareInfo CompareInfo {
- [MonoTODO]
- get { throw new NotImplementedException ();
- }
- }
-
- public CultureInfo CultureInfo {
- [MonoTODO]
- get { throw new NotImplementedException ();
- }
- }
-
- public bool IsNull {
- get { return (bool) (this == SqlString.Null); }
- }
-
- // geographics location and language (locale id)
- public int LCID {
- [MonoTODO]
- get { throw new NotImplementedException ();
- }
- }
-
- public SqlCompareOptions SqlCompareOptions {
- [MonoTODO]
- get { throw new NotImplementedException ();
- }
- }
-
- public string Value {
- get {
- if (this.IsNull)
- throw new SqlNullValueException ("The property contains Null.");
- else
- return value;
- }
- }
-
- #endregion // Public Properties
-
- #region Public Methods
-
- [MonoTODO]
- public SqlString Clone()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static CompareOptions CompareOptionsFromSqlCompareOptions (SqlCompareOptions compareOptions)
- {
- throw new NotImplementedException ();
- }
-
- // **********************************
- // Comparison Methods
- // **********************************
-
- public int CompareTo(object value)
- {
- if (value == null)
- return 1;
- else if (!(value is SqlString))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Data.SqlTypes.SqlString"));
- else if (((SqlString)value).IsNull)
- return 1;
- else
- return this.value.CompareTo (((SqlString)value).Value);
- }
-
- public static SqlString Concat(SqlString x, SqlString y)
- {
- return (x + y);
- }
-
- public override bool Equals(object value)
- {
- if (!(value is SqlString))
- return false;
- else
- return (bool) (this == (SqlString)value);
- }
-
- public static SqlBoolean Equals(SqlString x, SqlString y)
- {
- return (x == y);
- }
-
- [MonoTODO]
- public override int GetHashCode()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public byte[] GetNonUnicodeBytes()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public byte[] GetUnicodeBytes()
- {
- throw new NotImplementedException ();
- }
-
- public static SqlBoolean GreaterThan(SqlString x, SqlString y)
- {
- return (x > y);
- }
-
- public static SqlBoolean GreaterThanOrEqual(SqlString x, SqlString y)
- {
- return (x >= y);
- }
-
- public static SqlBoolean LessThan(SqlString x, SqlString y)
- {
- return (x < y);
- }
-
- public static SqlBoolean LessThanOrEqual(SqlString x, SqlString y)
- {
- return (x <= y);
- }
-
- public static SqlBoolean NotEquals(SqlString x, SqlString y)
- {
- return (x != y);
- }
-
- // ****************************************
- // Type Conversions From SqlString To ...
- // ****************************************
-
- public SqlBoolean ToSqlBoolean()
- {
- return ((SqlBoolean)this);
- }
-
- public SqlByte ToSqlByte()
- {
- return ((SqlByte)this);
- }
-
- public SqlDateTime ToSqlDateTime()
- {
- return ((SqlDateTime)this);
- }
-
- public SqlDecimal ToSqlDecimal()
- {
- return ((SqlDecimal)this);
- }
-
- public SqlDouble ToSqlDouble()
- {
- return ((SqlDouble)this);
- }
-
- public SqlGuid ToSqlGuid()
- {
- return ((SqlGuid)this);
- }
-
- public SqlInt16 ToSqlInt16()
- {
- return ((SqlInt16)this);
- }
-
- public SqlInt32 ToSqlInt32()
- {
- return ((SqlInt32)this);
- }
-
- public SqlInt64 ToSqlInt64()
- {
- return ((SqlInt64)this);
- }
-
- public SqlMoney ToSqlMoney()
- {
- return ((SqlMoney)this);
- }
-
- public SqlSingle ToSqlSingle()
- {
- return ((SqlSingle)this);
- }
-
- public override string ToString()
- {
- return ((string)this);
- }
-
- // ***********************************
- // Operators
- // ***********************************
-
- // Concatenates
- public static SqlString operator + (SqlString x, SqlString y)
- {
- return new SqlString (x.Value + y.Value);
- }
-
- // Equality
- public static SqlBoolean operator == (SqlString x, SqlString y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value == y.Value);
- }
-
- // Greater Than
- public static SqlBoolean operator > (SqlString x, SqlString y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- // Greater Than Or Equal
- public static SqlBoolean operator >= (SqlString x, SqlString y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- public static SqlBoolean operator != (SqlString x, SqlString y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- return new SqlBoolean (x.Value != y.Value);
- }
-
- // Less Than
- public static SqlBoolean operator < (SqlString x, SqlString y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- // Less Than Or Equal
- public static SqlBoolean operator <= (SqlString x, SqlString y)
- {
- if (x.IsNull || y.IsNull)
- return SqlBoolean.Null;
- else
- throw new NotImplementedException ();
- }
-
- // **************************************
- // Type Conversions
- // **************************************
-
- public static explicit operator SqlString (SqlBoolean x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.ByteValue.ToString ());
- }
-
- public static explicit operator SqlString (SqlByte x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlDateTime x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlDecimal x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlDouble x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlGuid x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlInt16 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlInt32 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlInt64 x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlMoney x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator SqlString (SqlSingle x)
- {
- if (x.IsNull)
- return Null;
- else
- return new SqlString (x.Value.ToString ());
- }
-
- public static explicit operator string (SqlString x)
- {
- return x.Value;
- }
-
- public static implicit operator SqlString (string x)
- {
- return new SqlString (x);
- }
-
- #endregion // Public Methods
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs
deleted file mode 100644
index 067b9195f17..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.SqlTruncateException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data.SqlTypes {
-
- [Serializable]
- public class SqlTruncateException : SqlTypeException
- {
- public SqlTruncateException ()
- : base (Locale.GetText ("This value is being truncated"))
- {
- }
-
- public SqlTruncateException (string message)
- : base (message)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlTypeException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlTypeException.cs
deleted file mode 100644
index 6cb4b3f86aa..00000000000
--- a/mcs/class/System.Data/System.Data.SqlTypes/SqlTypeException.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.SqlTypeException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data.SqlTypes {
-
- [Serializable]
- public class SqlTypeException : SystemException
- {
- public SqlTypeException (string message)
- : base (message)
- {
- }
-
- protected SqlTypeException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data.build b/mcs/class/System.Data/System.Data.build
deleted file mode 100644
index e9e4048babd..00000000000
--- a/mcs/class/System.Data/System.Data.build
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.Data.dll -->
-
-<project name="System.Data" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <csc target="library" output="../lib/System.Data.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0067"/>
- <arg value="/nowarn:0109"/>
- <arg value="/nowarn:0169"/>
- <arg value="/nowarn:0649"/>
- <arg value="/unsafe"/>
- <arg value="/noconfig"/>
- <arg value="/r:System.dll"/>
- <arg value="/r:System.Xml.dll"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <excludes name="System.Data.OleDb/*.cs"/>
- </sources>
- <references>
- <includes name="../lib/corlib.dll"/>
- <includes name="../lib/System.dll"/>
- <includes name="../lib/System.Xml.dll"/>
- </references>
- </csc>
- <copy file="../lib/System.Data.dll" tofile="Test/System.Data.dll"/>
- </target>
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
- <target name="clean">
- <delete file="../lib/System.Data.dll" failonerror="false"/>
- <delete file="Test/System.Data.dll" failonerror="false"/>
-
- </target>
-</project>
diff --git a/mcs/class/System.Data/System.Data/AcceptRejectRule.cs b/mcs/class/System.Data/System.Data/AcceptRejectRule.cs
deleted file mode 100644
index c4481175a6c..00000000000
--- a/mcs/class/System.Data/System.Data/AcceptRejectRule.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.AcceptRejectRule.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
-
- /// <summary>
- /// Determines the action that occurs when
- /// the AcceptChanges or RejectChanges method
- /// is invoked on a DataTable with a ForeignKeyConstraint.
- /// </summary>
- [Serializable]
- public enum AcceptRejectRule
- {
- Cascade = 1,
- None = 0
- }
-
-}
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog
deleted file mode 100644
index e676f3a3eab..00000000000
--- a/mcs/class/System.Data/System.Data/ChangeLog
+++ /dev/null
@@ -1,3 +0,0 @@
-2002-05-18 Nick Drochak <ndrochak@gol.com>
-
- * DataRow.cs: Fix typo.
diff --git a/mcs/class/System.Data/System.Data/CommandBehavior.cs b/mcs/class/System.Data/System.Data/CommandBehavior.cs
deleted file mode 100644
index 918722e1937..00000000000
--- a/mcs/class/System.Data/System.Data/CommandBehavior.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Data.CommandBehavior.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
-
- /// <summary>
- /// Specifies a description of the results and the affect on the database of the query command.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum CommandBehavior
- {
- Default = 0,
- SingleResult = 1,
- SchemaOnly = 2,
- KeyInfo = 4,
- SingleRow = 8,
- SequentialAccess = 16,
- CloseConnection = 32
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/CommandType.cs b/mcs/class/System.Data/System.Data/CommandType.cs
deleted file mode 100644
index 61bf5be81cb..00000000000
--- a/mcs/class/System.Data/System.Data/CommandType.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.CommandType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies how a command string is interpreted.
- /// </summary>
- [Serializable]
- public enum CommandType
- {
- Text = 1,
- StoredProcedure = 4,
- TableDirect = 512
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/ConnectionState.cs b/mcs/class/System.Data/System.Data/ConnectionState.cs
deleted file mode 100644
index 63f51af0ea8..00000000000
--- a/mcs/class/System.Data/System.Data/ConnectionState.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Data.ConnectionState.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
-
- /// <summary>
- /// Returns the current state of the connection to a data source.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum ConnectionState
- {
- Closed = 0,
- Open = 1,
- Connecting = 2,
- Executing = 4,
- Fetching = 8,
- Broken = 16
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/Constraint.cs b/mcs/class/System.Data/System.Data/Constraint.cs
deleted file mode 100644
index d6ce3b24307..00000000000
--- a/mcs/class/System.Data/System.Data/Constraint.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Data.Constraint.cs
-//
-// Author:
-// Daniel Morgan
-//
-// (C) Ximian, Inc. 2002
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
- [Serializable]
- public abstract class Constraint {
-
- protected string name = null;
- protected PropertyCollection properties = null;
-
- [MonoTODO]
- protected Constraint() {
- properties = new PropertyCollection();
- }
-
- public virtual string ConstraintName {
- [MonoTODO]
- get{
- return name;
- }
-
- [MonoTODO]
- set{
- name = value;
- }
- }
-
- public PropertyCollection ExtendedProperties {
- [MonoTODO]
- get {
- return properties;
- }
- }
-
- public abstract DataTable Table {
- get;
- }
-
- [MonoTODO]
- public override string ToString() {
- return name;
- }
-
- //[MonoTODO]
- //[ClassInterface(ClassInterfaceType.AutoDual)]
- //~Constraint() {
- //}
- }
-}
diff --git a/mcs/class/System.Data/System.Data/ConstraintCollection.cs b/mcs/class/System.Data/System.Data/ConstraintCollection.cs
deleted file mode 100644
index 7e9385e7e6b..00000000000
--- a/mcs/class/System.Data/System.Data/ConstraintCollection.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// System.Data.ConstraintCollection.cs
-//
-// Author:
-// Daniel Morgan
-//
-// (C) Ximian, Inc. 2002
-// (C) 2002 Daniel Morgan
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// hold collection of constraints for data table
- /// </summary>
- public class ConstraintCollection : InternalDataCollectionBase {
-
- public virtual Constraint this[string name] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual Constraint this[int index] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- // Overloaded Add method (5 of them)
- // to add Constraint object to the collection
-
- [MonoTODO]
- public void Add(Constraint constraint) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual Constraint Add(string name,
- DataColumn column, bool primaryKey) {
-
- throw new NotImplementedException ();
-
- }
-
- [MonoTODO]
- public virtual Constraint Add(string name,
- DataColumn primaryKeyColumn,
- DataColumn foreignKeyColumn) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual Constraint Add(string name,
- DataColumn[] columns, bool primaryKey) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual Constraint Add(string name,
- DataColumn[] primaryKeyColumns,
- DataColumn[] foreignKeyColumns) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void AddRange(Constraint[] constraints) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool CanRemove(Constraint constraint) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Clear() {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool Contains(string name) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int IndexOf(Constraint constraint) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual int IndexOf(string constraintName) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove(Constraint constraint) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Remove(string name) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(int index) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public event CollectionChangeEventHandler CollectionChanged;
-
- protected override ArrayList List {
- [MonoTODO]
- get{
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- protected virtual void OnCollectionChanged(
- CollectionChangeEventArgs ccevent) {
-
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/ConstraintException.cs b/mcs/class/System.Data/System.Data/ConstraintException.cs
deleted file mode 100644
index 12293ddd655..00000000000
--- a/mcs/class/System.Data/System.Data/ConstraintException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.ConstraintException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class ConstraintException : DataException
- {
- public ConstraintException ()
- : base (Locale.GetText ("This operation violates a constraint"))
- {
- }
-
- public ConstraintException (string message)
- : base (message)
- {
- }
-
- protected ConstraintException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DBConcurrencyException.cs b/mcs/class/System.Data/System.Data/DBConcurrencyException.cs
deleted file mode 100644
index 5fd78826b48..00000000000
--- a/mcs/class/System.Data/System.Data/DBConcurrencyException.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Data.DBConcurrencyException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class DBConcurrencyException : SystemException
- {
- public DBConcurrencyException (string message)
- : base (message)
- {
- }
-
- public DBConcurrencyException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- DataRow row;
-
- public DataRow Row {
- get { return row; }
- set { row = value;} // setting the row has no effect
- }
-
- [MonoTODO]
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataColumn.cs b/mcs/class/System.Data/System.Data/DataColumn.cs
deleted file mode 100644
index 91d99f31ec3..00000000000
--- a/mcs/class/System.Data/System.Data/DataColumn.cs
+++ /dev/null
@@ -1,334 +0,0 @@
-//
-// System.Data.DataColumn.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Chris Podurgiel
-// (C) Ximian, Inc 2002
-//
-
-
-using System;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Summary description for DataColumn.
- /// </summary>
- public class DataColumn : MarshalByValueComponent
- {
- #region Fields
-
- private bool allowDBNull = true;
- private bool autoIncrement = false;
- private long autoIncrementSeed = 0;
- private long autoIncrementStep = 1;
- private string caption = null;
- private MappingType columnMapping = MappingType.Element;
- private string columnName = null;
- private Type dataType = null;
- private object defaultValue = null;
- private string expression = null;
- private PropertyCollection extendedProperties = null;
- private int maxLength = -1;
- private string nameSpace = null;
- private int ordinal = -1;
- private string prefix = null;
- private bool readOnly = false;
- private DataTable table = null;
- private bool unique = false;
-
- #endregion // Fields
-
- #region Constructors
-
- public DataColumn()
- {
- }
-
- public DataColumn(string columnName): this()
- {
- ColumnName = columnName;
- }
-
- public DataColumn(string columnName, Type dataType): this(columnName)
- {
- if(dataType == null) {
- throw new ArgumentNullException();
- }
-
- DataType = dataType;
-
- }
-
- public DataColumn( string columnName, Type dataType,
- string expr): this(columnName, dataType)
- {
- Expression = expr;
- }
-
- public DataColumn(string columnName, Type dataType,
- string expr, MappingType type): this(columnName, dataType, expr)
- {
- ColumnMapping = type;
- }
- #endregion
-
- #region Properties
-
- public bool AllowDBNull
- {
- get {
- return allowDBNull;
- }
- set {
- allowDBNull = value;
- }
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether the column automatically increments the value of the column for new rows added to the table.
- /// </summary>
- /// <remarks>
- /// If the type of this column is not Int16, Int32, or Int64 when this property is set,
- /// the DataType property is coerced to Int32. An exception is generated if this is a computed column
- /// (that is, the Expression property is set.) The incremented value is used only if the row's value for this column,
- /// when added to the columns collection, is equal to the default value.
- /// </remarks>
- public bool AutoIncrement
- {
- get {
- return autoIncrement;
- }
- set {
- autoIncrement = value;
- if(autoIncrement == true)
- {
- if(Expression != null)
- {
- throw new Exception();
- }
- if(Type.GetTypeCode(dataType) != TypeCode.Int16 &&
- Type.GetTypeCode(dataType) != TypeCode.Int32 &&
- Type.GetTypeCode(dataType) != TypeCode.Int64)
- {
- Int32 dtInt = new Int32();
- dataType = dtInt.GetType();
- }
- }
- }
- }
-
- public long AutoIncrementSeed
- {
- get {
- return autoIncrementSeed;
- }
- set {
- autoIncrementSeed = value;
- }
- }
-
- public long AutoIncrementStep
- {
- get {
- return autoIncrementStep;
- }
- set {
- autoIncrementStep = value;
- }
- }
-
- public string Caption
- {
- get {
- if(caption == null)
- return columnName;
- else
- return caption;
- }
- set {
- caption = value;
- }
- }
-
- public virtual MappingType ColumnMapping
- {
- get {
- return columnMapping;
- }
- set {
- columnMapping = value;
- }
- }
-
- public string ColumnName
- {
- get {
- return columnName;
- }
- set {
- columnName = value;
- }
- }
-
- public Type DataType
- {
- get {
- return dataType;
- }
- set {
- if(AutoIncrement == true &&
- Type.GetTypeCode(value) != TypeCode.Int32)
- {
- throw new Exception();
- }
- dataType = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <remarks>When AutoIncrement is set to true, there can be no default value.</remarks>
- public object DefaultValue
- {
- get {
- return defaultValue;
- }
- set {
- defaultValue = value;
- }
- }
-
- public string Expression
- {
- get {
- return expression;
- }
- set {
- expression = value;
- }
- }
-
- public PropertyCollection ExtendedProperties
- {
- get {
- return extendedProperties;
- }
- }
-
- public int MaxLength
- {
- get {
- return maxLength;
- }
- set {
- maxLength = value;
- }
- }
-
- public string Namespace
- {
- get {
- return nameSpace;
- }
- set {
- nameSpace = value;
- }
- }
-
- //Need a good way to set the Ordinal when the column is added to a columnCollection.
- public int Ordinal
- {
- get {
- return ordinal;
- }
- }
-
- public string Prefix
- {
- get {
- return prefix;
- }
- set {
- prefix = value;
- }
- }
-
- public bool ReadOnly
- {
- get {
- return readOnly;
- }
- set {
- readOnly = value;
- }
- }
-
- public DataTable Table
- {
- get {
- return table;
- }
- }
-
- public bool Unique
- {
- get {
- return unique;
- }
- set {
- unique = value;
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- protected internal void CheckNotAllowNull() {
- }
-
- [MonoTODO]
- protected void CheckUnique() {
- }
-
- [MonoTODO]
- protected internal virtual void
- OnPropertyChanging (PropertyChangedEventArgs pcevent) {
- }
-
- [MonoTODO]
- protected internal void RaisePropertyChanging(string name) {
- }
-
- /// <summary>
- /// Gets the Expression of the column, if one exists.
- /// </summary>
- /// <returns>The Expression value, if the property is set;
- /// otherwise, the ColumnName property.</returns>
- [MonoTODO]
- public override string ToString()
- {
- if (expression != null)
- return expression;
-
- return columnName;
- }
-
- [MonoTODO]
- internal void SetTable(DataTable table) {
- this.table = table;
- // FIXME: this will get called by DataTable
- }
-
- #endregion // Methods
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs b/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs
deleted file mode 100644
index f79d27eaf1e..00000000000
--- a/mcs/class/System.Data/System.Data/DataColumnChangeEventArgs.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.Data.DataColumnChangeEventArgs.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Provides data for the ColumnChanging event.
- /// </summary>
- public class DataColumnChangeEventArgs : EventArgs
- {
-
- private DataColumn _column = null;
- private DataRow _row = null;
- private object _proposedValue = null;
-
- /// <summary>
- /// Initializes a new instance of the DataColumnChangeEventArgs class.
- /// </summary>
- /// <param name="row"></param>
- /// <param name="column"></param>
- /// <param name="value"></param>
- public DataColumnChangeEventArgs(DataRow row, DataColumn column, object value)
- {
- _column = column;
- _row = row;
- _proposedValue = value;
- }
-
- /// <summary>
- /// Gets the DataColumn with a changing value.
- /// </summary>
- public DataColumn Column
- {
- get
- {
- return _column;
- }
- }
-
-
- /// <summary>
- /// Gets or sets the proposed new value for the column.
- /// </summary>
- public object ProposedValue
- {
- get
- {
- return _proposedValue;
- }
- set
- {
- _proposedValue = value;
- }
- }
-
-
- /// <summary>
- /// Gets the DataRow of the column with a changing value.
- /// </summary>
- public DataRow Row
- {
- get
- {
- return _row;
- }
- }
-
-
-
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs b/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs
deleted file mode 100644
index 1932d38f2fe..00000000000
--- a/mcs/class/System.Data/System.Data/DataColumnChangeEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.DataColumnChangeEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the the ColumnChanging event.
- /// </summary>
- [Serializable]
- public delegate void DataColumnChangeEventHandler(object sender, DataColumnChangeEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataColumnCollection.cs b/mcs/class/System.Data/System.Data/DataColumnCollection.cs
deleted file mode 100644
index 616669aaec1..00000000000
--- a/mcs/class/System.Data/System.Data/DataColumnCollection.cs
+++ /dev/null
@@ -1,409 +0,0 @@
-//
-// System.Data.DataColumnCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a collection of DataColumn objects for a DataTable.
- /// </summary>
- public class DataColumnCollection : InternalDataCollectionBase
- {
- // The defaultNameIndex is used to create a default name for a column if one wasn't given.
- private int defaultNameIndex;
-
- //table should be the DataTable this DataColumnCollection belongs to.
- private DataTable parentTable = null;
-
- // Internal Constructor. This Class can only be created from other classes in this assembly.
- internal DataColumnCollection(DataTable table):base()
- {
- defaultNameIndex = 1;
- parentTable = table;
- }
-
-
-
- /// <summary>
- /// Gets the DataColumn from the collection at the specified index.
- /// </summary>
- public virtual DataColumn this[int index]
- {
- get
- {
- return (DataColumn) base.List[index];
- }
- }
-
- /// <summary>
- /// Gets the DataColumn from the collection with the specified name.
- /// </summary>
- public virtual DataColumn this[string name]
- {
- get
- {
- foreach (DataColumn column in base.List)
- {
- if (column.ColumnName == name)
- {
- return column;
- }
- }
-
- return null;
-
- }
- }
-
-
- /// <summary>
- /// Gets a list of the DataColumnCollection items.
- /// </summary>
- protected override ArrayList List
- {
- get
- {
- return base.List;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object to the DataColumnCollection.
- /// </summary>
- /// <returns></returns>
- public virtual DataColumn Add()
- {
- DataColumn column = new DataColumn("Column" + defaultNameIndex.ToString());
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- base.List.Add(column);
- OnCollectionChanged(e);
- defaultNameIndex++;
- return column;
- }
-
- /// <summary>
- /// Creates and adds the specified DataColumn object to the DataColumnCollection.
- /// </summary>
- /// <param name="column">The DataColumn to add.</param>
- public void Add(DataColumn column)
- {
- if(Contains(column.ColumnName))
- {
- throw new DuplicateNameException("A column named " + column.ColumnName + " already belongs to this DataTable.");
- }
- else
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- base.List.Add(column);
- OnCollectionChanged(e);
- return;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object with the specified name to the DataColumnCollection.
- /// </summary>
- /// <param name="columnName">The name of the column.</param>
- /// <returns>The newly created DataColumn.</returns>
- public virtual DataColumn Add(string columnName)
- {
-
- if (columnName == null || columnName == String.Empty)
- {
- columnName = "Column" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- if(Contains(columnName))
- {
- throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
- }
- else
- {
- DataColumn column = new DataColumn(columnName);
-
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- base.List.Add(column);
- OnCollectionChanged(e);
- return column;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object with the specified name and type to the DataColumnCollection.
- /// </summary>
- /// <param name="columnName">The ColumnName to use when cretaing the column.</param>
- /// <param name="type">The DataType of the new column.</param>
- /// <returns>The newly created DataColumn.</returns>
- public virtual DataColumn Add(string columnName, Type type)
- {
- if (columnName == null || columnName == "")
- {
- columnName = "Column" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- if(Contains(columnName))
- {
- throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
- }
- else
- {
- DataColumn column = new DataColumn(columnName, type);
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- base.List.Add(column);
- OnCollectionChanged(e);
- return column;
- }
- }
-
- /// <summary>
- /// Creates and adds a DataColumn object with the specified name, type, and expression to the DataColumnCollection.
- /// </summary>
- /// <param name="columnName">The name to use when creating the column.</param>
- /// <param name="type">The DataType of the new column.</param>
- /// <param name="expression">The expression to assign to the Expression property.</param>
- /// <returns>The newly created DataColumn.</returns>
- public virtual DataColumn Add(string columnName, Type type, string expression)
- {
- if (columnName == null || columnName == "")
- {
- columnName = "Column" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- if(Contains(columnName))
- {
- throw new DuplicateNameException("A column named " + columnName + " already belongs to this DataTable.");
- }
- else
- {
- DataColumn column = new DataColumn(columnName, type, expression);
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- base.List.Add(column);
- OnCollectionChanged(e);
- return column;
- }
- }
-
- /// <summary>
- /// Copies the elements of the specified DataColumn array to the end of the collection.
- /// </summary>
- /// <param name="columns">The array of DataColumn objects to add to the collection.</param>
- public void AddRange(DataColumn[] columns)
- {
- foreach (DataColumn column in columns)
- {
- Add(column);
- }
- return;
- }
-
- /// <summary>
- /// Checks whether a given column can be removed from the collection.
- /// </summary>
- /// <param name="column">A DataColumn in the collection.</param>
- /// <returns>true if the column can be removed; otherwise, false.</returns>
- public bool CanRemove(DataColumn column)
- {
-
- //Check that the column does not have a null reference.
- if (column == null)
- {
- return false;
- }
-
-
- //Check that the column is part of this collection.
- if (!Contains(column.ColumnName))
- {
- return false;
- }
-
-
-
- //Check if this column is part of a relationship. (this could probably be written better)
- foreach (DataRelation childRelation in parentTable.ChildRelations)
- {
- foreach (DataColumn childColumn in childRelation.ChildColumns)
- {
- if (childColumn == column)
- {
- return false;
- }
- }
-
- foreach (DataColumn parentColumn in childRelation.ParentColumns)
- {
- if (parentColumn == column)
- {
- return false;
- }
- }
- }
-
- //Check if this column is part of a relationship. (this could probably be written better)
- foreach (DataRelation parentRelation in parentTable.ParentRelations)
- {
- foreach (DataColumn childColumn in parentRelation.ChildColumns)
- {
- if (childColumn == column)
- {
- return false;
- }
- }
-
- foreach (DataColumn parentColumn in parentRelation.ParentColumns)
- {
- if (parentColumn == column)
- {
- return false;
- }
- }
- }
-
-
- //Check if another column's expression depends on this column.
-
- foreach (DataColumn dataColumn in List)
- {
- if (dataColumn.Expression.ToString().IndexOf(column.ColumnName) > 0)
- {
- return false;
- }
- }
-
-
- return true;
- }
-
- /// <summary>
- /// Clears the collection of any columns.
- /// </summary>
- public void Clear()
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Refresh, this);
- base.List.Clear();
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Checks whether the collection contains a column with the specified name.
- /// </summary>
- /// <param name="name">The ColumnName of the column to check for.</param>
- /// <returns>true if a column exists with this name; otherwise, false.</returns>
- public bool Contains(string name)
- {
- return (IndexOf(name) != -1);
- }
-
- /// <summary>
- /// Gets the index of a column specified by name.
- /// </summary>
- /// <param name="column">The name of the column to return.</param>
- /// <returns>The index of the column specified by column if it is found; otherwise, -1.</returns>
- public virtual int IndexOf(DataColumn column)
- {
- return base.List.IndexOf(column);
- }
-
- /// <summary>
- /// Gets the index of the column with the given name (the name is not case sensitive).
- /// </summary>
- /// <param name="columnName">The name of the column to find.</param>
- /// <returns>The zero-based index of the column with the specified name, or -1 if the column doesn't exist in the collection.</returns>
- public int IndexOf(string columnName)
- {
-
- DataColumn column = this[columnName];
-
- if (column != null)
- {
- return IndexOf(column);
- }
- else
- {
- return -1;
- }
- }
-
- /// <summary>
- /// Raises the OnCollectionChanged event.
- /// </summary>
- /// <param name="ccevent">A CollectionChangeEventArgs that contains the event data.</param>
- protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent)
- {
- if (CollectionChanged != null)
- {
- // Invokes the delegate.
- CollectionChanged(this, ccevent);
- }
- }
-
- /// <summary>
- /// Raises the OnCollectionChanging event.
- /// </summary>
- /// <param name="ccevent">A CollectionChangeEventArgs that contains the event data.</param>
- protected internal virtual void OnCollectionChanging(CollectionChangeEventArgs ccevent)
- {
- if (CollectionChanged != null)
- {
- // Invokes the delegate.
- CollectionChanged(this, ccevent);
- }
- }
-
- /// <summary>
- /// Removes the specified DataColumn object from the collection.
- /// </summary>
- /// <param name="column">The DataColumn to remove.</param>
- public void Remove(DataColumn column)
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Remove, this);
- base.List.Remove(column);
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Removes the DataColumn object with the specified name from the collection.
- /// </summary>
- /// <param name="name">The name of the column to remove.</param>
- public void Remove(string name)
- {
- DataColumn column = this[name];
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Remove, this);
- base.List.Remove(column);
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Removes the column at the specified index from the collection.
- /// </summary>
- /// <param name="index">The index of the column to remove.</param>
- public void RemoveAt(int index)
- {
- CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Remove, this);
- base.List.RemoveAt(index);
- OnCollectionChanged(e);
- return;
- }
-
- /// <summary>
- /// Occurs when the columns collection changes, either by adding or removing a column.
- /// </summary>
- public event CollectionChangeEventHandler CollectionChanged;
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataException.cs b/mcs/class/System.Data/System.Data/DataException.cs
deleted file mode 100644
index 3a512de87f0..00000000000
--- a/mcs/class/System.Data/System.Data/DataException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Data.DataException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class DataException : SystemException
- {
- public DataException ()
- : base (Locale.GetText ("A Data exception has occurred"))
- {
- }
-
- public DataException (string message)
- : base (message)
- {
- }
-
- protected DataException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public DataException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRelation.cs b/mcs/class/System.Data/System.Data/DataRelation.cs
deleted file mode 100644
index bbc1f2eae5a..00000000000
--- a/mcs/class/System.Data/System.Data/DataRelation.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.Data.DataRelation.cs
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) 2002 Daniel Morgan
-// (C) 2002 Ximian, Inc.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
- /// <summary>
- /// DataRelation is used for a parent/child relationship
- /// between two DataTable objects
- /// </summary>
- [Serializable]
- public class DataRelation {
-
- #region Constructors
-
- [MonoTODO]
- public DataRelation(string relationName,
- DataColumn parentColumn, DataColumn childColumn) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRelation(string relationName,
- DataColumn[] parentColumns,
- DataColumn[] childColumns) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRelation(string relationName,
- DataColumn parentColumn, DataColumn childColumn,
- bool createConstraints) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRelation(string relationName,
- DataColumn[] parentColumns, DataColumn[] childColumns,
- bool createConstraints) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRelation(string relationName,
- string parentTableName, string childTableName,
- string[] parentColumnNames, string[] childColumnNames,
- bool nested) {
-
- throw new NotImplementedException ();
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public virtual DataColumn[] ChildColumns {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual ForeignKeyConstraint ChildKeyConstraint {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DataTable ChildTable {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DataSet DataSet {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public PropertyCollection ExtendedProperties {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual bool Nested {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DataColumn[] ParentColumns {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual UniqueConstraint ParentKeyConstraint {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DataTable ParentTable {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual string RelationName {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void CheckStateForProperty() {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRelationCollection.cs b/mcs/class/System.Data/System.Data/DataRelationCollection.cs
deleted file mode 100644
index 6952e9829ac..00000000000
--- a/mcs/class/System.Data/System.Data/DataRelationCollection.cs
+++ /dev/null
@@ -1,324 +0,0 @@
-//
-// System.Data.DataRelationCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) Chris Podurgiel
-// (C) 2002 Daniel Morgan
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the collection of DataRelation objects for this DataSet.
- /// </summary>
- [Serializable]
- public abstract class DataRelationCollection : InternalDataCollectionBase
- {
- private int defaultNameIndex;
- private bool inTransition;
-
- /// <summary>
- /// Initializes a new instance of the DataRelationCollection class.
- /// </summary>
- internal DataRelationCollection() : base()
- {
- defaultNameIndex = 1;
- inTransition = false;
- }
-
- /// <summary>
- /// Gets the DataRelation object specified by name.
- /// </summary>
- public abstract DataRelation this[string name]{get;}
-
- /// <summary>
- /// Gets the DataRelation object at the specified index.
- /// </summary>
- public abstract DataRelation this[int index]{get;}
-
-
- #region Add Methods
- /// <summary>
- /// Adds a DataRelation to the DataRelationCollection.
- /// </summary>
- /// <param name="relation">The DataRelation to add to the collection.</param>
- [MonoTODO]
- public void Add(DataRelation relation)
- {
- if(List != null)
- {
- //CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- List.Add(relation);
- //OnCollectionChanged(e);
- }
- return;
- }
-
- /// <summary>
- /// Creates a relation given the parameters and adds it to the collection. The name is defaulted.
- /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
- /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
- /// The CollectionChanged event is fired if it succeeds.
- /// </summary>
- /// <param name="parentColumn">parent column of relation.</param>
- /// <param name="childColumn">child column of relation.</param>
- /// <returns>The created DataRelation.</returns>
- [MonoTODO]
- public virtual DataRelation Add(DataColumn parentColumn, DataColumn childColumn)
- {
-
- if(parentColumn == null)
- {
- throw new ArgumentNullException("parentColumn");
- }
- else if( childColumn == null)
- {
- throw new ArgumentNullException("childColumn");
- }
-
- // FIXME: temporarily commented so we can compile
- /*
- if(parentColumn.Table.DataSet != childColumn.Table.DataSet)
- {
- throw new InvalidConstraintException("my ex");
- }
- */
-
- DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumn, childColumn);
- //CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
- List.Add(dataRelation);
- //OnCollectionChanged(e);
- defaultNameIndex++;
- return dataRelation;
- }
-
- /// <summary>
- /// Creates a relation given the parameters and adds it to the collection. The name is defaulted.
- /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
- /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
- /// The CollectionChanged event is raised if it succeeds.
- /// </summary>
- /// <param name="parentColumns">An array of parent DataColumn objects.</param>
- /// <param name="childColumns">An array of child DataColumn objects.</param>
- /// <returns>The created DataRelation.</returns>
- [MonoTODO]
- public virtual DataRelation Add(DataColumn[] parentColumns, DataColumn[] childColumns)
- {
- DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumns, childColumns);
- List.Add(dataRelation);
- defaultNameIndex++;
- return dataRelation;
- }
-
- /// <summary>
- /// Creates a relation given the parameters and adds it to the collection.
- /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
- /// A DuplicateNameException is generated if this collection already has a relation with the same name (case insensitive).
- /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
- /// The CollectionChanged event is raised if it succeeds.
- /// </summary>
- /// <param name="name">The name of the relation.</param>
- /// <param name="parentColumn">parent column of relation.</param>
- /// <returns>The created DataRelation.</returns>
- /// <returns></returns>
- [MonoTODO]
- public virtual DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn)
- {
- //If no name was supplied, give it a default name.
- if ((name == null) || (name == ""))
- {
- name = "Relation" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn);
- List.Add(dataRelation);
- return dataRelation;
- }
-
- /// <summary>
- /// Creates a DataRelation with the specified name, and arrays of parent and child columns, and adds it to the collection.
- /// </summary>
- /// <param name="name">The name of the DataRelation to create.</param>
- /// <param name="parentColumns">An array of parent DataColumn objects.</param>
- /// <param name="childColumns">An array of child DataColumn objects.</param>
- /// <returns>The created DataRelation.</returns>
- [MonoTODO]
- public virtual DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns)
- {
- //If no name was supplied, give it a default name.
- if ((name == null) || (name == ""))
- {
- name = "Relation" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns);
- List.Add(dataRelation);
- return dataRelation;
- }
-
- /// <summary>
- /// Creates a relation given the parameters and adds it to the collection.
- /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
- /// A DuplicateNameException is generated if this collection already has a relation with the same name (case insensitive).
- /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
- /// The CollectionChanged event is raised if it succeeds.
- /// </summary>
- /// <param name="name">The name of the relation.</param>
- /// <param name="parentColumn">parent column of relation.</param>
- /// <param name="childColumn">child column of relation.</param>
- /// <param name="createConstraints">true to create constraints; otherwise false. (default is true)</param>
- /// <returns>The created DataRelation.</returns>
- [MonoTODO]
- public virtual DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn, bool createConstraints)
- {
- //If no name was supplied, give it a default name.
- if ((name == null) || (name == ""))
- {
- name = "Relation" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn, createConstraints);
- List.Add(dataRelation);
- return dataRelation;
- }
-
- /// <summary>
- /// Creates a DataRelation with the specified name, arrays of parent and child columns,
- /// and value specifying whether to create a constraint, and adds it to the collection.
- /// </summary>
- /// <param name="name">The name of the DataRelation to create.</param>
- /// <param name="parentColumns">An array of parent DataColumn objects.</param>
- /// <param name="childColumns">An array of child DataColumn objects.</param>
- /// <param name="createConstraints">true to create a constraint; otherwise false.</param>
- /// <returns>The created DataRelation.</returns>
- [MonoTODO]
- public virtual DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns, bool createConstraints)
- {
- //If no name was supplied, give it a default name.
- if ((name == null) || (name == ""))
- {
- name = "Relation" + defaultNameIndex.ToString();
- defaultNameIndex++;
- }
-
- DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns, createConstraints);
- AddCore(dataRelation);
- List.Add(dataRelation);
- return dataRelation;
- }
- #endregion
-
- /// <summary>
- /// Performs verification on the table.
- /// </summary>
- /// <param name="relation">The relation to check.</param>
- [MonoTODO]
- protected virtual void AddCore(DataRelation relation)
- {
- if (relation == null)
- {
- //TODO: Issue a good exception message.
- throw new ArgumentNullException();
- }
- else if(List.IndexOf(relation) != -1)
- {
- //TODO: Issue a good exception message.
- throw new ArgumentException();
- }
- else if(List.Contains(relation.RelationName))
- {
- //TODO: Issue a good exception message.
- throw new DuplicateNameException("A Relation named " + relation.RelationName + " already belongs to this DataSet.");
- }
- }
-
- /// <summary>
- /// Copies the elements of the specified DataRelation array to the end of the collection.
- /// </summary>
- /// <param name="relations">The array of DataRelation objects to add to the collection.</param>
- [MonoTODO]
- public virtual void AddRange(DataRelation[] relations)
- {
- //TODO: Implement
-
- DataSet dataSet = GetDataSet();
-
- throw new NotImplementedException ();
-
- /*
- foreach(DataRelation dataRelation in relations)
- {
-
- }
- */
-
- }
-
- [MonoTODO]
- public virtual bool CanRemove(DataRelation relation)
- {
- //TODO: Implement.
- return false;
- }
-
- public virtual void Clear()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool Contains(string name)
- {
- return false;
- }
-
- protected abstract DataSet GetDataSet();
-
- public virtual int IndexOf(DataRelation relation)
- {
- return List.IndexOf(relation);
- }
-
- public virtual int IndexOf(string relationName)
- {
- return List.IndexOf(this[relationName]);
- }
-
- [MonoTODO]
- protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected internal virtual void OnCollectionChanging(CollectionChangeEventArgs ccevent)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt(int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual void RemoveCore(DataRelation relation)
- {
- throw new NotImplementedException ();
- }
-
- public event CollectionChangeEventHandler CollectionChanged;
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRow.cs b/mcs/class/System.Data/System.Data/DataRow.cs
deleted file mode 100644
index 8ac508d243c..00000000000
--- a/mcs/class/System.Data/System.Data/DataRow.cs
+++ /dev/null
@@ -1,633 +0,0 @@
-//
-// System.Data.DataRow.cs
-//
-// Author:
-// Rodrigo Moya <rodrigo@ximian.com>
-// Daniel Morgan <danmorg@sc.rr.com>
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Ximian, Inc 2002
-// (C) Daniel Morgan 2002
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System;
-using System.Collections;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a row of data in a DataTable.
- /// </summary>
- public class DataRow
- {
- #region Fields
-
- DataTable table;
-
- object[] original;
- object[] proposed;
- object[] current;
-
- string[] columnErrors;
- string rowError;
- DataRowState rowState;
-
- #endregion
-
- #region Constructors
-
- /// <summary>
- /// This member supports the .NET Framework infrastructure and is not intended to be
- /// used directly from your code.
- /// </summary>
- protected internal DataRow (DataRowBuilder builder)
- {
- table = builder.Table;
-
- original = null;
- proposed = null;
- current = new object[table.Columns.Count];
-
- columnErrors = new string[table.Columns.Count];
- rowError = String.Empty;
-
- rowState = DataRowState.Unchanged;
- }
-
- #endregion
-
- #region Properties
-
- /// <summary>
- /// Gets a value indicating whether there are errors in a row.
- /// </summary>
- public bool HasErrors {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// Gets or sets the data stored in the column specified by name.
- /// </summary>
- public object this[string columnName] {
- get { return this[columnName, DataRowVersion.Current]; }
- set {
- DataColumn column = table.Columns[columnName];
- if (column == null)
- throw new IndexOutOfRangeException ();
- this[column] = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the data stored in specified DataColumn
- /// </summary>
- public object this[DataColumn column] {
- get { return this[column, DataRowVersion.Current]; }
- set {
- bool objIsDBNull = value.Equals(DBNull.Value);
- if (column == null)
- throw new ArgumentNullException ();
- int columnIndex = table.Columns.IndexOf (column);
- if (columnIndex == -1)
- throw new ArgumentException ();
- if(column.DataType != value.GetType ()) {
- if(objIsDBNull == true && column.AllowDBNull == false)
- throw new InvalidCastException ();
- else if(objIsDBNull == false)
- throw new InvalidCastException ();
- }
- if (rowState == DataRowState.Deleted)
- throw new DeletedRowInaccessibleException ();
-
- BeginEdit (); // implicitly called
- if(objIsDBNull)
- proposed[columnIndex] = DBNull.Value;
- else
- proposed[columnIndex] = value;
- EndEdit (); // is this the right thing to do?
- }
- }
-
- /// <summary>
- /// Gets or sets the data stored in column specified by index.
- /// </summary>
- public object this[int columnIndex] {
- get { return this[columnIndex, DataRowVersion.Current]; }
- set {
- DataColumn column = table.Columns[columnIndex];
- if (column == null)
- throw new IndexOutOfRangeException ();
- this[column] = value;
- }
- }
-
- /// <summary>
- /// Gets the specified version of data stored in the named column.
- /// </summary>
- public object this[string columnName, DataRowVersion version] {
- get {
- DataColumn column = table.Columns[columnName];
- if (column == null)
- throw new IndexOutOfRangeException ();
- return this[column, version];
- }
- }
-
- /// <summary>
- /// Gets the specified version of data stored in the specified DataColumn.
- /// </summary>
- public object this[DataColumn column, DataRowVersion version] {
- get {
- if (column == null)
- throw new ArgumentNullException ();
-
- int columnIndex = table.Columns.IndexOf (column);
-
- if (columnIndex == -1)
- throw new ArgumentException ();
-
- if (version == DataRowVersion.Default)
- return column.DefaultValue;
-
- if (!HasVersion (version))
- throw new VersionNotFoundException ();
-
- switch (version)
- {
- case DataRowVersion.Proposed:
- return proposed[columnIndex];
- case DataRowVersion.Current:
- return current[columnIndex];
- case DataRowVersion.Original:
- return original[columnIndex];
- default:
- throw new ArgumentException ();
- }
- }
- }
-
- /// <summary>
- /// Gets the data stored in the column, specified by index and version of the data to
- /// retrieve.
- /// </summary>
- public object this[int columnIndex, DataRowVersion version] {
- get {
- DataColumn column = table.Columns[columnIndex];
- if (column == null)
- throw new IndexOutOfRangeException ();
- return this[column, version];
- }
- }
-
- /// <summary>
- /// Gets or sets all of the values for this row through an array.
- /// </summary>
- public object[] ItemArray {
- get { return current; }
- set {
- if (value.Length > table.Columns.Count)
- throw new ArgumentException ();
- if (rowState == DataRowState.Deleted)
- throw new DeletedRowInaccessibleException ();
-
- for (int i = 0; i < value.Length; i += 1)
- {
- if (table.Columns[i].ReadOnly && value[i] != this[i])
- throw new ReadOnlyException ();
-
- if (value[i] == null)
- {
- if (!table.Columns[i].AllowDBNull)
- throw new NoNullAllowedException ();
- continue;
- }
-
- if (table.Columns[i].DataType != value[i].GetType())
- throw new InvalidCastException ();
- }
-
- BeginEdit (); // implicitly called
- proposed = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the custom error description for a row.
- /// </summary>
- public string RowError {
- get { return rowError; }
- set { rowError = value; }
- }
-
- /// <summary>
- /// Gets the current state of the row in regards to its relationship to the
- /// DataRowCollection.
- /// </summary>
- public DataRowState RowState {
- get { return rowState; }
- }
-
- /// <summary>
- /// Gets the DataTable for which this row has a schema.
- /// </summary>
- public DataTable Table {
- get { return table; }
- }
-
- #endregion
-
- #region Methods
-
- /// <summary>
- /// Commits all the changes made to this row since the last time AcceptChanges was
- /// called.
- /// </summary>
- public void AcceptChanges ()
- {
- this.EndEdit ();
-
- switch (rowState)
- {
- case DataRowState.Added:
- rowState = DataRowState.Unchanged;
- break;
- case DataRowState.Modified:
- rowState = DataRowState.Unchanged;
- break;
- case DataRowState.Deleted:
- table.Rows.Remove (this);
- break;
- }
-
- original = null;
- }
-
- /// <summary>
- /// Begins an edit operation on a DataRow object.
- /// </summary>
- public void BeginEdit()
- {
- if (rowState == DataRowState.Deleted)
- throw new DeletedRowInaccessibleException ();
-
- if (!HasVersion (DataRowVersion.Proposed))
- {
- proposed = new object[table.Columns.Count];
- Array.Copy (current, proposed, table.Columns.Count);
- }
-
- if (!HasVersion (DataRowVersion.Original))
- {
- original = new object[table.Columns.Count];
- Array.Copy (current, original, table.Columns.Count);
- }
- }
-
- /// <summary>
- /// Cancels the current edit on the row.
- /// </summary>
- public void CancelEdit ()
- {
- if (HasVersion (DataRowVersion.Proposed))
- {
- original = null;
- proposed = null;
- rowState = DataRowState.Unchanged;
- }
- }
-
- /// <summary>
- /// Clears the errors for the row, including the RowError and errors set with
- /// SetColumnError.
- /// </summary>
- public void ClearErrors ()
- {
- rowError = String.Empty;
- columnErrors = new String[table.Columns.Count];
- }
-
- /// <summary>
- /// Deletes the DataRow.
- /// </summary>
- public void Delete ()
- {
- if (rowState == DataRowState.Deleted)
- throw new DeletedRowInaccessibleException ();
-
- rowState = DataRowState.Deleted;
- }
-
- /// <summary>
- /// Ends the edit occurring on the row.
- /// </summary>
- public void EndEdit ()
- {
- if (HasVersion (DataRowVersion.Proposed))
- {
- rowState = DataRowState.Modified;
- Array.Copy (proposed, current, table.Columns.Count);
- proposed = null;
- }
- }
-
- /// <summary>
- /// Gets the child rows of this DataRow using the specified DataRelation.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetChildRows (DataRelation relation)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the child rows of a DataRow using the specified RelationName of a
- /// DataRelation.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetChildRows (string relationName)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the child rows of a DataRow using the specified DataRelation, and
- /// DataRowVersion.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetChildRows (DataRelation relation, DataRowVersion version)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the child rows of a DataRow using the specified RelationName of a
- /// DataRelation, and DataRowVersion.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetChildRows (string relationName, DataRowVersion version)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the error description of the specified DataColumn.
- /// </summary>
- public string GetColumnError (DataColumn column)
- {
- return GetColumnError (table.Columns.IndexOf(column));
- }
-
- /// <summary>
- /// Gets the error description for the column specified by index.
- /// </summary>
- public string GetColumnError (int columnIndex)
- {
- if (columnIndex < 0 || columnIndex >= columnErrors.Length)
- throw new IndexOutOfRangeException ();
-
- return columnErrors[columnIndex];
- }
-
- /// <summary>
- /// Gets the error description for the column, specified by name.
- /// </summary>
- public string GetColumnError (string columnName)
- {
- return GetColumnError (table.Columns.IndexOf(columnName));
- }
-
- /// <summary>
- /// Gets an array of columns that have errors.
- /// </summary>
- public DataColumn[] GetColumnsInError ()
- {
- ArrayList dataColumns = new ArrayList ();
-
- for (int i = 0; i < columnErrors.Length; i += 1)
- {
- if (columnErrors[i] != String.Empty)
- dataColumns.Add (table.Columns[i]);
- }
-
- return (DataColumn[])(dataColumns.ToArray ());
- }
-
- /// <summary>
- /// Gets the parent row of a DataRow using the specified DataRelation.
- /// </summary>
- [MonoTODO]
- public DataRow GetParentRow (DataRelation relation)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the parent row of a DataRow using the specified RelationName of a
- /// DataRelation.
- /// </summary>
- [MonoTODO]
- public DataRow GetParentRow (string relationName)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the parent row of a DataRow using the specified DataRelation, and
- /// DataRowVersion.
- /// </summary>
- [MonoTODO]
- public DataRow GetParentRow (DataRelation relation, DataRowVersion version)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the parent row of a DataRow using the specified RelationName of a
- /// DataRelation, and DataRowVersion.
- /// </summary>
- [MonoTODO]
- public DataRow GetParentRow (string relationName, DataRowVersion version)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the parent rows of a DataRow using the specified DataRelation.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetParentRows (DataRelation relation)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the parent rows of a DataRow using the specified RelationName of a
- /// DataRelation.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetParentRows (string relationName)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the parent rows of a DataRow using the specified DataRelation, and
- /// DataRowVersion.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetParentRows (DataRelation relation, DataRowVersion version)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the parent rows of a DataRow using the specified RelationName of a
- /// DataRelation, and DataRowVersion.
- /// </summary>
- [MonoTODO]
- public DataRow[] GetParentRows (string relationName, DataRowVersion version)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets a value indicating whether a specified version exists.
- /// </summary>
- public bool HasVersion (DataRowVersion version)
- {
- switch (version)
- {
- case DataRowVersion.Default:
- return true;
- case DataRowVersion.Proposed:
- return (proposed != null);
- case DataRowVersion.Current:
- return (current != null);
- case DataRowVersion.Original:
- return (original != null);
- }
- return false;
- }
-
- /// <summary>
- /// Gets a value indicating whether the specified DataColumn contains a null value.
- /// </summary>
- public bool IsNull (DataColumn column)
- {
- return (this[column] == null);
- }
-
- /// <summary>
- /// Gets a value indicating whether the column at the specified index contains a null
- /// value.
- /// </summary>
- public bool IsNull (int columnIndex)
- {
- return (this[columnIndex] == null);
- }
-
- /// <summary>
- /// Gets a value indicating whether the named column contains a null value.
- /// </summary>
- public bool IsNull (string columnName)
- {
- return (this[columnName] == null);
- }
-
- /// <summary>
- /// Gets a value indicating whether the specified DataColumn and DataRowVersion
- /// contains a null value.
- /// </summary>
- public bool IsNull (DataColumn column, DataRowVersion version)
- {
- return (this[column, version] == null);
- }
-
- /// <summary>
- /// Rejects all changes made to the row since AcceptChanges was last called.
- /// </summary>
- public void RejectChanges ()
- {
- // If original is null, then nothing has happened since AcceptChanges
- // was last called. We have no "original" to go back to.
- if (original != null)
- {
- Array.Copy (original, current, table.Columns.Count);
- CancelEdit ();
- switch (rowState)
- {
- case DataRowState.Added:
- table.Rows.Remove (this);
- break;
- case DataRowState.Modified:
- rowState = DataRowState.Unchanged;
- break;
- case DataRowState.Deleted:
- rowState = DataRowState.Unchanged;
- break;
- }
- }
- }
-
- /// <summary>
- /// Sets the error description for a column specified as a DataColumn.
- /// </summary>
- public void SetColumnError (DataColumn column, string error)
- {
- SetColumnError (table.Columns.IndexOf (column), error);
- }
-
- /// <summary>
- /// Sets the error description for a column specified by index.
- /// </summary>
- public void SetColumnError (int columnIndex, string error)
- {
- if (columnIndex < 0 || columnIndex >= columnErrors.Length)
- throw new IndexOutOfRangeException ();
- columnErrors[columnIndex] = error;
- }
-
- /// <summary>
- /// Sets the error description for a column specified by name.
- /// </summary>
- public void SetColumnError (string columnName, string error)
- {
- SetColumnError (table.Columns.IndexOf (columnName), error);
- }
-
- /// <summary>
- /// Sets the value of the specified DataColumn to a null value.
- /// </summary>
- [MonoTODO]
- protected void SetNull (DataColumn column)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Sets the parent row of a DataRow with specified new parent DataRow.
- /// </summary>
- [MonoTODO]
- public void SetParentRow (DataRow parentRow)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Sets the parent row of a DataRow with specified new parent DataRow and
- /// DataRelation.
- /// </summary>
- [MonoTODO]
- public void SetParentRow (DataRow parentRow, DataRelation relation)
- {
- throw new NotImplementedException ();
- }
-
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowAction.cs b/mcs/class/System.Data/System.Data/DataRowAction.cs
deleted file mode 100644
index b6423b374ca..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowAction.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Data.DataRowAction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Describes the action taken on a DataRow.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DataRowAction
- {
- Nothing = 0,
- Delete = 1,
- Change = 2,
- Rollback = 4,
- Commit = 8,
- Add = 16
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowBuilder.cs b/mcs/class/System.Data/System.Data/DataRowBuilder.cs
deleted file mode 100644
index 37c4621cafb..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowBuilder.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Data.DataRowBuilder
-//
-// Author:
-// Tim Coleman <tim@timcoleman.com>
-//
-// Copyright (C) 2002 Tim Coleman
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// A supporting class that exists solely to support
- /// DataRow and DataTable
- /// Implementation of something meaningful will follow.
- /// Presumably, what that is will become apparent when
- /// constructing DataTable and DataRow.
- /// </summary>
-
- public class DataRowBuilder
- {
- #region Fields
-
- DataTable table;
-
- #endregion
-
- #region Constructors
-
- // DataRowBuilder on .NET takes 3 arguments, a
- // DataTable and two Int32. For consistency, this
- // class will also take those arguments.
-
- protected internal DataRowBuilder (DataTable table, int x, int y)
- {
- this.table = table;
- }
-
- #endregion
-
- #region Properties
-
- protected internal DataTable Table {
- get { return table; }
- }
-
- #endregion
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs b/mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs
deleted file mode 100644
index 5466ec822bf..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Data.DataRowChangeEventArgs.cs
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) Ximian, Inc 2002
-//
-
-namespace System.Data
-{
- /// <summary>
- /// argument data for events RowChanged, RowChanging,
- /// OnRowDeleting, and OnRowDeleted
- /// </summary>
- public class DataRowChangeEventArgs : EventArgs {
-
- [MonoTODO]
- public DataRowChangeEventArgs(DataRow row,
- DataRowAction action) {
-
- throw new NotImplementedException ();
- }
-
- public DataRowAction Action {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public DataRow Row {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs b/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs
deleted file mode 100644
index 4959e38f3bf..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowChangeEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.DataRowChangeEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the RowChanging, RowChanged, RowDeleting, and RowDeleted events of a DataTable.
- /// </summary>
- [Serializable]
- public delegate void DataRowChangeEventHandler(object sender, DataRowChangeEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowCollection.cs b/mcs/class/System.Data/System.Data/DataRowCollection.cs
deleted file mode 100644
index a69999ad237..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowCollection.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// System.Data.DataRowCollection.cs
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Ximian, Inc 2002
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Collection of DataRows in a DataTable
- /// </summary>
- [Serializable]
- public class DataRowCollection : InternalDataCollectionBase
- {
- private DataTable table;
-
- /// <summary>
- /// Internal constructor used to build a DataRowCollection.
- /// </summary>
- protected internal DataRowCollection (DataTable table) : base ()
- {
- this.table = table;
- }
-
- /// <summary>
- /// Gets the row at the specified index.
- /// </summary>
- public DataRow this[int index]
- {
- get { return (DataRow) list[index]; }
- }
-
- /// <summary>
- /// This member overrides InternalDataCollectionBase.List
- /// </summary>
- protected override ArrayList List
- {
- get { return list; }
- }
-
- /// <summary>
- /// Adds the specified DataRow to the DataRowCollection object.
- /// </summary>
- public void Add (DataRow row)
- {
- list.Add (row);
- }
-
- /// <summary>
- /// Creates a row using specified values and adds it to the DataRowCollection.
- /// </summary>
- public virtual DataRow Add (object[] values)
- {
- DataRow row = table.NewRow ();
- row.ItemArray = values;
- Add (row);
- return row;
- }
-
- /// <summary>
- /// Clears the collection of all rows.
- /// </summary>
- [MonoTODO]
- public void Clear ()
- {
- list.Clear ();
- }
-
- /// <summary>
- /// Gets a value indicating whether the primary key of any row in the collection contains
- /// the specified value.
- /// </summary>
- [MonoTODO]
- public bool Contains (object key)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets a value indicating whether the primary key column(s) of any row in the
- /// collection contains the values specified in the object array.
- /// </summary>
- [MonoTODO]
- public bool Contains (object[] keys)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the row specified by the primary key value.
- /// </summary>
- [MonoTODO]
- public DataRow Find (object key)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Gets the row containing the specified primary key values.
- /// </summary>
- [MonoTODO]
- public DataRow Find (object[] keys)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Inserts a new row into the collection at the specified location.
- /// </summary>
- public void InsertAt (DataRow row, int pos)
- {
- list.Insert (pos, row);
- }
-
- /// <summary>
- /// Removes the specified DataRow from the collection.
- /// </summary>
- public void Remove (DataRow row)
- {
- list.Remove (row);
- }
-
- /// <summary>
- /// Removes the row at the specified index from the collection.
- /// </summary>
- public void RemoveAt (int index)
- {
- list.RemoveAt (index);
- }
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataRowState.cs b/mcs/class/System.Data/System.Data/DataRowState.cs
deleted file mode 100644
index 4e77e406203..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowState.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Data.DataRowState.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Gets the state of a DataRow object.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DataRowState
- {
- Detached = 1,
- Unchanged = 2,
- Added = 4,
- Deleted = 8,
- Modified = 16
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowVersion.cs b/mcs/class/System.Data/System.Data/DataRowVersion.cs
deleted file mode 100644
index ad757946bcb..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowVersion.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.DataRowVersion.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Describes the version of a DataRow.
- /// </summary>
- [Serializable]
- public enum DataRowVersion
- {
- Original = 256,
- Current = 512,
- Proposed = 1024,
- Default = 1536
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataRowView.cs b/mcs/class/System.Data/System.Data/DataRowView.cs
deleted file mode 100644
index f5301fdf234..00000000000
--- a/mcs/class/System.Data/System.Data/DataRowView.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-//
-// System.Data.DataRowView.cs
-//
-// Author:
-// Rodrigo Moya <rodrigo@ximian.com>
-// Miguel de Icaza <miguel@ximian.com>
-//
-// (C) Ximian, Inc 2002
-//
-
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a customized view of a DataRow exposed as a fully featured Windows Forms control.
- /// </summary>
- public class DataRowView : ICustomTypeDescriptor, IEditableObject, IDataErrorInfo
- {
- [MonoTODO]
- public void BeginEdit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void CancelEdit ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataView CreateChildView (DataRelation relation)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataView CreateChildView (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Delete ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void EndEdit ()
- {
- throw new NotImplementedException ();
- }
-
- public DataView DataView
- {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public bool IsEdit {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public bool IsNew {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public string this[string column] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public string Error {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public object this[int column] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public DataRow Row {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public DataRowVersion RowVersion {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- //
- // ICustomTypeDescriptor implementations
- //
-
- [MonoTODO]
- AttributeCollection ICustomTypeDescriptor.GetAttributes ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- string ICustomTypeDescriptor.GetClassName ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- string ICustomTypeDescriptor.GetComponentName ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- TypeConverter ICustomTypeDescriptor.GetConverter ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- EventDescriptorCollection ICustomTypeDescriptor.GetEvents (Attribute [] attributes)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute [] attributes)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs
deleted file mode 100644
index eb484562085..00000000000
--- a/mcs/class/System.Data/System.Data/DataSet.cs
+++ /dev/null
@@ -1,336 +0,0 @@
-//
-// System.Data/DataSet.cs
-//
-// Author:
-// Christopher Podurgiel <cpodurgiel@msn.com>
-// Daniel Morgan <danmorg@sc.rr.com>
-// Rodrigo Moya <rodrigo@ximian.com>
-//
-// (C) Ximian, Inc. 2002
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Xml;
-
-namespace System.Data
-{
- /// <summary>
- /// an in-memory cache of data
- /// </summary>
- [Serializable]
- public class DataSet : MarshalByValueComponent, IListSource,
- ISupportInitialize, ISerializable {
-
- private string dataSetName;
- private bool caseSensitive;
- private bool enforceConstraints;
- private DataTableCollection tableCollection;
- // private DataTableRelationCollection relationCollection;
- private PropertyCollection properties;
-
- #region Constructors
-
- [MonoTODO]
- public DataSet() {
- tableCollection = new DataTableCollection (this);
- }
-
- [MonoTODO]
- public DataSet(string name) : this () {
- dataSetName = name;
- }
-
- [MonoTODO]
- protected DataSet(SerializationInfo info, StreamingContext context) : this () {
- throw new NotImplementedException ();
- }
-
- #endregion // Constructors
-
- #region Public Properties
-
- public bool CaseSensitive {
- get {
- return caseSensitive;
- }
- set {
- caseSensitive = value;
- }
- }
-
- public string DataSetName {
- get {
- return dataSetName;
- }
-
- set {
- dataSetName = value;
- }
- }
-
- public DataViewManager DefaultViewManager {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public bool EnforceConstraints {
- get {
- return enforceConstraints;
- }
-
- set {
- enforceConstraints = value;
- }
- }
-
- public PropertyCollection ExtendedProperties {
- [MonoTODO]
- get {
- return properties;
- }
- }
-
- public bool HasErrors {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public CultureInfo Locale {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public string Namespace {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public string Prefix {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public DataRelationCollection Relations {
- [MonoTODO]
- get{
- //return relationCollection;
- throw new NotImplementedException();
- }
- }
-
- public override ISite Site {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public DataTableCollection Tables {
- get {
- return tableCollection;
- }
- }
-
- #endregion // Public Properties
-
- #region Public Methods
-
- public void AcceptChanges()
- {
- throw new NotImplementedException ();
- }
-
- public void Clear()
- {
- throw new NotImplementedException ();
- }
-
- public virtual DataSet Clone()
- {
- throw new NotImplementedException ();
- }
-
- public DataSet Copy()
- {
- throw new NotImplementedException ();
- }
-
- public DataSet GetChanges()
- {
- throw new NotImplementedException ();
- }
-
-
- public DataSet GetChanges(DataRowState rowStates)
- {
- throw new NotImplementedException ();
- }
-
- public string GetXml()
- {
- throw new NotImplementedException ();
- }
-
- public string GetXmlSchema()
- {
- throw new NotImplementedException ();
- }
-
- public virtual void RejectChanges()
- {
- throw new NotImplementedException ();
- }
-
- public virtual void Reset()
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(Stream stream)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(string fileName)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(TextWriter writer)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(XmlWriter writer)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(Stream stream, XmlWriteMode mode)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(string fileName, XmlWriteMode mode)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(TextWriter writer, XmlWriteMode mode)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXml(XmlWriter writer, XmlWriteMode mode)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXmlSchema(Stream stream)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXmlSchema(string fileName)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteXmlSchema(TextWriter writer)
- {
- }
-
- public void WriteXmlSchema(XmlWriter writer)
- {
- throw new NotImplementedException ();
- }
-
- #endregion // Public Methods
-
- #region Public Events
-
- public event MergeFailedEventHandler MergeFailed;
-
- #endregion // Public Events
-
- #region Destructors
-
- ~DataSet()
- {
- }
-
- #endregion Destructors
-
- #region IListSource methods
- IList IListSource.GetList ()
- {
- throw new NotImplementedException ();
- }
-
- bool IListSource.ContainsListCollection {
- get {
- throw new NotImplementedException ();
- }
- }
- #endregion IListSource methods
-
- #region ISupportInitialize methods
- void ISupportInitialize.BeginInit ()
- {
- throw new NotImplementedException ();
- }
-
- void ISupportInitialize.EndInit ()
- {
- throw new NotImplementedException ();
- }
- #endregion
-
- #region ISerializable
- void ISerializable.GetObjectData (SerializationInfo si, StreamingContext sc)
- {
- throw new NotImplementedException ();
- }
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs
deleted file mode 100644
index cb26dc15966..00000000000
--- a/mcs/class/System.Data/System.Data/DataTable.cs
+++ /dev/null
@@ -1,726 +0,0 @@
-//
-// System.Data.DataTable.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-// Daniel Morgan <danmorg@sc.rr.com>
-// Rodrigo Moya <rodrigo@ximian.com>
-//
-// (C) Chris Podurgiel
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents one table of in-memory data.
- /// </summary>
- [Serializable]
- public class DataTable : ISerializable
- //MarshalByValueComponent, IListSource, ISupportInitialize
- {
-
- private bool _caseSensitive;
- private DataColumnCollection _columnCollection;
- private ConstraintCollection _constraintCollection;
- // FIXME: temporarily commented
-
- internal DataSet dataSet;
-
- // private DataView _defaultView;
- private string _displayExpression;
- private PropertyCollection _extendedProperties;
- private bool _hasErrors;
- private CultureInfo _locale;
- private int _minimumCapacity;
- private string _nameSpace;
- // FIXME: temporarily commented
- // private DataTableRelationCollection _childRelations;
- // private DataTableRelationCollection _parentRelations;
- private string _prefix;
- private DataColumn[] _primaryKey;
- private DataRowCollection rows;
- private ISite _site;
- private string _tableName;
- private bool _containsListCollection;
- private string _encodedTableName;
-
- /// <summary>
- /// Initializes a new instance of the DataTable class with no arguments.
- /// </summary>
-
- public DataTable()
- {
- dataSet = null;
- // _defaultView = null; // FIXME: temporarily commented
- _columnCollection = new DataColumnCollection(this);
- //_constraintCollection = new ConstraintCollection(); TODO: uncomment after ConstraintCollection is built.
- _extendedProperties = null;
- _tableName = "";
- _nameSpace = null;
- _caseSensitive = false;
- _displayExpression = null;
- _primaryKey = null;
- rows = new DataRowCollection (this);
-
- // FIXME: temporaily commented DataTableRelationCollection
- // _childRelations = new DataTableRelationCollection();
- // _parentRelations = new DataTableRelationCollection();
-
- //_nextRowID = 1;
- //_elementColumnCount = 0;
- //_caseSensitiveAmbient = true;
- //_culture = null; // _locale??
- //_compareFlags = 25; // why 25??
- //_fNestedInDataset = true; // what?
- //_encodedTableName = null; //??
- //_xmlText = null; //??
- //_colUnique = null; //??
- //_textOnly = false; //??
- //repeatableElement = false; //??
- //zeroIntegers[]
- //zeroColumns[]
- //primaryIndex[]
- //delayedSetPrimaryKey = null; //??
- }
-
- /// <summary>
- /// Intitalizes a new instance of the DataTable class with the specified table name.
- /// </summary>
-
- public DataTable(string tableName) : this ()
- {
- _tableName = tableName;
- }
-
- /// <summary>
- /// Initializes a new instance of the DataTable class with the SerializationInfo and the StreamingContext.
- /// </summary>
-
- protected DataTable(SerializationInfo info, StreamingContext context)
- : this ()
- {
- //
- // TODO: Add constructor logic here
- //
- }
-
- /// <summary>
- /// Indicates whether string comparisons within the table are case-sensitive.
- /// </summary>
-
- public bool CaseSensitive
- {
- get {
- return _caseSensitive;
- }
- set {
- _caseSensitive = value;
- }
- }
-
-
- /// <summary>
- /// Gets the collection of child relations for this DataTable.
- /// </summary>
-
- public DataRelationCollection ChildRelations
- {
- get {
- // FIXME: temporarily commented to compile
- // return (DataRelationCollection)_childRelations;
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// Gets the collection of columns that belong to this table.
- /// </summary>
-
- public DataColumnCollection Columns
- {
- get {
- return _columnCollection;
- }
- }
-
- /// <summary>
- /// Gets the collection of constraints maintained by this table.
- /// </summary>
-
- public ConstraintCollection Constraints
- {
- get {
- return _constraintCollection;
- }
- }
-
- /// <summary>
- /// Gets the DataSet that this table belongs to.
- /// </summary>
- public DataSet DataSet {
- get { return dataSet; }
- }
-
- /*
-
- /// <summary>
- /// Gets a customized view of the table which may
- /// include a filtered view, or a cursor position.
- /// </summary>
-
- public DataView DefaultView
- {
- get
- {
- return _defaultView;
- }
- }
- */
-
- /// <summary>
- /// Gets or sets the expression that will return
- /// a value used to represent this table in the user interface.
- /// </summary>
-
- public string DisplayExpression
- {
- get {
- return _displayExpression;
- }
- set {
- _displayExpression = value;
- }
- }
-
- /// <summary>
- /// Gets the collection of customized user information.
- /// </summary>
- public PropertyCollection ExtendedProperties
- {
- get {
- return _extendedProperties;
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether there are errors in
- /// any of the rows in any of the tables of the DataSet to
- /// which the table belongs.
- /// </summary>
- public bool HasErrors
- {
- get {
- return _hasErrors;
- }
- }
-
- /// <summary>
- /// Gets or sets the locale information used to
- /// compare strings within the table.
- /// </summary>
- public CultureInfo Locale
- {
- get {
- return _locale;
- }
- set {
- _locale = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the initial starting size for this table.
- /// </summary>
- public int MinimumCapacity
- {
- get {
- return _minimumCapacity;
- }
- set {
- _minimumCapacity = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the namespace for the XML represenation
- /// of the data stored in the DataTable.
- /// </summary>
- public string Namespace
- {
- get {
- return _nameSpace;
- }
- set {
- _nameSpace = value;
- }
- }
-
- /// <summary>
- /// Gets the collection of parent relations for
- /// this DataTable.
- /// </summary>
- public DataRelationCollection ParentRelations
- {
- get {
- // FIXME: temporarily commented to compile
- // return _parentRelations;
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// Gets or sets the namespace for the XML represenation
- /// of the data stored in the DataTable.
- /// </summary>
- public string Prefix
- {
- get {
- return _prefix;
- }
- set {
- _prefix = value;
- }
- }
-
- /// <summary>
- /// Gets or sets an array of columns that function as
- /// primary keys for the data table.
- /// </summary>
- public DataColumn[] PrimaryKey
- {
- get {
- return _primaryKey;
- }
- set {
- _primaryKey = value;
- }
- }
-
- /// <summary>
- /// Gets the collection of rows that belong to this table.
- /// </summary>
-
- public DataRowCollection Rows
- {
- get { return rows; }
- }
-
- /// <summary>
- /// Gets or sets an System.ComponentModel.ISite
- /// for the DataTable.
- /// </summary>
-
- public virtual ISite Site
- {
- get {
- return _site;
- }
- set {
- _site = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the name of the the DataTable.
- /// </summary>
-
- public string TableName
- {
- get {
- return _tableName;
- }
- set {
- _tableName = value;
- }
- }
-
- /* FIXME: implement IListSource
- public bool IListSource.ContainsListCollection
- {
- get {
- return _containsListCollection;
- }
- }
- */
-
- /// <summary>
- /// Commits all the changes made to this table since the
- /// last time AcceptChanges was called.
- /// </summary>
-
- public void AcceptChanges()
- {
- }
-
- /// <summary>
- /// Begins the initialization of a DataTable that is used
- /// on a form or used by another component. The initialization
- /// occurs at runtime.
- /// </summary>
-
- public void BeginInit()
- {
- }
-
- /// <summary>
- /// Turns off notifications, index maintenance, and
- /// constraints while loading data.
- /// </summary>
-
- public void BeginLoadData()
- {
- }
-
- /// <summary>
- /// Clears the DataTable of all data.
- /// </summary>
-
- public void Clear()
- {
- rows.Clear ();
- }
-
- /// <summary>
- /// Clones the structure of the DataTable, including
- /// all DataTable schemas and constraints.
- /// </summary>
-
- public virtual DataTable Clone()
- {
- return this;
- }
-
- /// <summary>
- /// Computes the given expression on the current rows that
- /// pass the filter criteria.
- /// </summary>
-
- public object Compute(string expression, string filter)
- {
- object obj = "a";
- return obj;
- }
-
- /// <summary>
- /// Copies both the structure and data for this DataTable.
- /// </summary>
-
- public DataTable Copy()
- {
- return this;
- }
-
- /// <summary>
- /// Ends the initialization of a DataTable that is used
- /// on a form or used by another component. The
- /// initialization occurs at runtime.
- /// </summary>
-
- public void EndInit()
- {
- }
-
- /// <summary>
- /// Turns on notifications, index maintenance, and
- /// constraints after loading data.
- /// </summary>
-
- public void EndLoadData()
- {
- }
-
- /// <summary>
- /// Gets a copy of the DataTable that contains all
- /// changes made to it since it was loaded or
- /// AcceptChanges was last called.
- /// </summary>
-
- public DataTable GetChanges()
- {
- return this;
- }
-
- /// <summary>
- /// Gets a copy of the DataTable containing all
- /// changes made to it since it was last loaded, or
- /// since AcceptChanges was called, filtered by DataRowState.
- /// </summary>
-
- public DataTable GetChanges(DataRowState rowStates)
- {
- return this;
- }
-
- /// <summary>
- /// Gets an array of DataRow objects that contain errors.
- /// </summary>
-
- public DataRow[] GetErrors()
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// This member supports the .NET Framework infrastructure
- /// and is not intended to be used directly from your code.
- /// </summary>
-
- //protected virtual Type GetRowType()
- //{
- //}
-
- /// <summary>
- /// This member supports the .NET Framework infrastructure
- /// and is not intended to be used directly from your code.
- /// </summary>
-
- /* FIXME: implement IListSource
- public IList IListSource.GetList()
- {
- IList list = null;
- return list;
- }
- */
-
- /// <summary>
- /// Copies a DataRow into a DataTable, preserving any
- /// property settings, as well as original and current values.
- /// </summary>
-
- public void ImportRow(DataRow row)
- {
- }
-
- /// <summary>
- /// This member supports the .NET Framework infrastructure
- /// and is not intended to be used directly from your code.
- /// </summary>
-
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
- {
- }
-
- /// <summary>
- /// Finds and updates a specific row. If no matching row
- /// is found, a new row is created using the given values.
- /// </summary>
- public DataRow LoadDataRow(object[] values, bool fAcceptChanges)
- {
- DataRow dataRow = null;
- return dataRow;
- }
-
- /// <summary>
- /// Creates a new DataRow with the same schema as the table.
- /// </summary>
- public DataRow NewRow()
- {
- return this.NewRowFromBuilder (new DataRowBuilder (this, 0, 0));
- }
-
- /// <summary>
- /// This member supports the .NET Framework infrastructure
- /// and is not intended to be used directly from your code.
- /// </summary>
- protected internal DataRow[] NewRowArray(int size)
- {
- DataRow[] dataRows = {null};
- return dataRows;
- }
-
- /// <summary>
- /// Creates a new row from an existing row.
- /// </summary>
-
- protected virtual DataRow NewRowFromBuilder(DataRowBuilder builder)
- {
- return new DataRow (builder);
- }
-
-
- /// <summary>
- /// Raises the ColumnChanged event.
- /// </summary>
- protected virtual void OnColumnChanged(DataColumnChangeEventArgs e)
- {
- }
-
- /// <summary>
- /// Raises the ColumnChanging event.
- /// </summary>
-
- protected virtual void OnColumnChanging(DataColumnChangeEventArgs e)
- {
- }
-
- /// <summary>
- /// Raises the PropertyChanging event.
- /// </summary>
-
- protected internal virtual void OnPropertyChanging(PropertyChangedEventArgs pcevent)
- {
- }
-
- /// <summary>
- /// Notifies the DataTable that a DataColumn is being removed.
- /// </summary>
-
- protected internal virtual void OnRemoveColumn(DataColumn column)
- {
- }
-
- /// <summary>
- /// Raises the RowChanged event.
- /// </summary>
-
- protected virtual void OnRowChanged(DataRowChangeEventArgs e)
- {
- }
-
- /// <summary>
- /// Raises the RowChanging event.
- /// </summary>
-
- protected virtual void OnRowChanging(DataRowChangeEventArgs e)
- {
- }
-
- /// <summary>
- /// Raises the RowDeleted event.
- /// </summary>
-
- protected virtual void OnRowDeleted(DataRowChangeEventArgs e)
- {
- }
-
- /// <summary>
- /// Raises the RowDeleting event.
- /// </summary>
-
- protected virtual void OnRowDeleting(DataRowChangeEventArgs e)
- {
- }
-
- /// <summary>
- /// Rolls back all changes that have been made to the
- /// table since it was loaded, or the last time AcceptChanges
- /// was called.
- /// </summary>
-
- public void RejectChanges()
- {
- }
-
- /// <summary>
- /// Resets the DataTable to its original state.
- /// </summary>
-
- public virtual void Reset()
- {
- }
-
- /// <summary>
- /// Gets an array of all DataRow objects.
- /// </summary>
-
- public DataRow[] Select()
- {
- DataRow[] dataRows = {null};
- return dataRows;
- }
-
- /// <summary>
- /// Gets an array of all DataRow objects that match
- /// the filter criteria in order of primary key (or
- /// lacking one, order of addition.)
- /// </summary>
-
- public DataRow[] Select(string filterExpression)
- {
- DataRow[] dataRows = {null};
- return dataRows;
- }
-
- /// <summary>
- /// Gets an array of all DataRow objects that
- /// match the filter criteria, in the the
- /// specified sort order.
- /// </summary>
-
- public DataRow[] Select(string filterExpression, string sort)
- {
- DataRow[] dataRows = {null};
- return dataRows;
- }
-
- /// <summary>
- /// Gets an array of all DataRow objects that match
- /// the filter in the order of the sort, that match
- /// the specified state.
- /// </summary>
-
- public DataRow[] Select(string filterExpression, string sort, DataViewRowState recordStates)
- {
- DataRow[] dataRows = {null};
- return dataRows;
- }
-
- /// <summary>
- /// Gets the TableName and DisplayExpression, if
- /// there is one as a concatenated string.
- /// </summary>
-
- public override string ToString()
- {
- return "";
- }
-
- /* FIXME: temporarily commented - so we can get a
- * a simple forward read only result set
- /// <summary>
- /// Occurs when after a value has been changed for
- /// the specified DataColumn in a DataRow.
- /// </summary>
-
- public event DataColumnChangeEventHandler ColumnChanged;
-
- /// <summary>
- /// Occurs when a value is being changed for the specified
- /// DataColumn in a DataRow.
- /// </summary>
-
- public event DataColumnChangeEventHandler ColumnChanging;
-
- /// <summary>
- /// Occurs after a DataRow has been changed successfully.
- /// </summary>
-
- public event DataRowChangeEventHandler RowChanged;
-
- /// <summary>
- /// Occurs when a DataRow is changing.
- /// </summary>
-
- public event DataRowChangeEventHandler RowChanging;
-
- /// <summary>
- /// Occurs after a row in the table has been deleted.
- /// </summary>
-
- public event DataRowChangeEventHandler RowDeleted;
-
- /// <summary>
- /// Occurs before a row in the table is about to be deleted.
- /// </summary>
-
- public event DataRowChangeEventHandler RowDeleting;
- */
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataTableCollection.cs b/mcs/class/System.Data/System.Data/DataTableCollection.cs
deleted file mode 100644
index 646f10f7d4d..00000000000
--- a/mcs/class/System.Data/System.Data/DataTableCollection.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// System.Data.DataTableCollection.cs
-//
-// Authors:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Chris Podurgiel
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the collection of tables for the DataSet.
- /// </summary>
- public class DataTableCollection : InternalDataCollectionBase
- {
- DataSet dataSet;
- const string defaultTableName = "Table1";
- Hashtable tables;
-
- #region Constructors
-
- // LAMESPEC: This constructor is undocumented
- protected internal DataTableCollection (DataSet dataSet)
- : base ()
- {
- this.dataSet = dataSet;
- this.tables = new Hashtable ();
- }
-
- #endregion
-
- #region Properties
-
- public override int Count {
- get { return list.Count; }
- }
-
- public DataTable this[int index] {
- get { return (DataTable)(list[index]); }
- }
-
- public DataTable this[string name] {
- get { return (DataTable)(tables[name]); }
- }
-
- protected override ArrayList List {
- get { return list; }
- }
-
- #endregion
-
- #region Methods
-
- public virtual DataTable Add ()
- {
- return this.Add (defaultTableName);
- }
-
- public virtual void Add (DataTable table)
- {
- list.Add (table);
- table.dataSet = dataSet;
- tables[table.TableName] = table;
- }
-
- public virtual DataTable Add (string name)
- {
- DataTable table = new DataTable (name);
- this.Add (table);
- return table;
- }
-
- public void AddRange (DataTable[] tables)
- {
- foreach (DataTable table in tables)
- this.Add (table);
- }
-
- [MonoTODO]
- public bool CanRemove (DataTable table)
- {
- throw new NotImplementedException ();
- }
-
- public void Clear ()
- {
- list.Clear ();
- tables.Clear ();
- }
-
- public bool Contains (string name)
- {
- return tables.Contains (name);
- }
-
- public virtual int IndexOf (DataTable table)
- {
- return list.IndexOf (table);
- }
-
- public virtual int IndexOf (string name)
- {
- return list.IndexOf (tables[name]);
- }
-
- public void Remove (DataTable table)
- {
- this.Remove (table.TableName);
- }
-
- public void Remove (string name)
- {
- list.Remove (tables[name]);
- tables.Remove (name);
- }
-
- public void RemoveAt (int index)
- {
- tables.Remove (((DataTable)(list[index])).TableName);
- list.RemoveAt (index);
- }
-
- #endregion
-
- #region Events
-
- public event CollectionChangeEventHandler CollectionChanged;
- public event CollectionChangeEventHandler CollectionChanging;
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataTableRelationCollection.cs b/mcs/class/System.Data/System.Data/DataTableRelationCollection.cs
deleted file mode 100644
index 5f23fc1204f..00000000000
--- a/mcs/class/System.Data/System.Data/DataTableRelationCollection.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// System.Data.DataTableRelationCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Data.Common;
-
-namespace System.Data
-{
- /// <summary>
- /// Summary description for DataTableRelationCollection.
- /// </summary>
- internal class DataTableRelationCollection : DataRelationCollection
- {
- /// <summary>
- /// Initializes a new instance of the DataRelationCollection class.
- /// </summary>
- [MonoTODO]
- internal DataTableRelationCollection():base()
- {
- // TODO: need to the constructor
- }
-
- /// <summary>
- /// Gets the DataRelation object specified by name.
- /// </summary>
- [MonoTODO]
- public override DataRelation this[string name]
- {
- get
- {
- foreach (DataRelation dataRelation in list)
- {
- if (dataRelation.RelationName == name)
- {
- return dataRelation;
- }
- }
-
- return null;
- }
- }
-
- /// <summary>
- /// Gets the DataRelation object at the specified index.
- /// </summary>
- [MonoTODO]
- public override DataRelation this[int index]
- {
- get
- {
- return (DataRelation)list[index];
- }
- }
-
- /// <summary>
- /// Copies the elements of the specified DataRelation array to the end of the collection.
- /// </summary>
- /// <param name="relations">The array of DataRelation objects to add to the collection.</param>
- [MonoTODO]
- public override void AddRange(DataRelation[] relations)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool CanRemove(DataRelation relation)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void Clear()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool Contains(string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override DataSet GetDataSet()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int IndexOf(DataRelation relation)
- {
- return list.IndexOf(relation);
- }
-
- [MonoTODO]
- public override int IndexOf(string relationName)
- {
- return list.IndexOf(this[relationName]);
- }
-
- [MonoTODO]
- protected override void OnCollectionChanged(CollectionChangeEventArgs ccevent)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected internal override void OnCollectionChanging(CollectionChangeEventArgs ccevent)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataView.cs b/mcs/class/System.Data/System.Data/DataView.cs
deleted file mode 100644
index 4d438c662bc..00000000000
--- a/mcs/class/System.Data/System.Data/DataView.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-//
-// System.Data.DataView.cs
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) Ximian, Inc 2002
-//
-
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// A DataView is used in the binding of data between
- /// a DataTable and Windows Forms or Web Forms allowing
- /// a view of a DataTable for editing, filtering,
- /// navigation, searching, and sorting.
- /// </summary>
- public class DataView : MarshalByValueComponent, //IBindingList,
- IEnumerable, // ITypedList, IList, ICollection,
- ISupportInitialize {
-
- public DataView() {
- }
-
- public DataView(DataTable table) {
- }
-
- public DataView(DataTable table, string RowFilter,
- string Sort, DataViewRowState RowState) {
- }
-
- public bool AllowDelete {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- public bool AllowEdit {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- public bool AllowNew {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- public bool ApplyDefaultSort {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- public int Count {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public DataViewManager DataViewManager {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- // Item indexer
- public DataRowView this[int recordIndex] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual string RowFilter {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- public DataViewRowState RowStateFilter {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- public string Sort {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- public DataTable Table {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- }
- }
-
- [MonoTODO]
- public virtual DataRowView AddNew() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void BeginInit() {
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index) {
- }
-
- [MonoTODO]
- public void Delete(int index) {
- }
-
- [MonoTODO]
- public void EndInit() {
- }
-
- [MonoTODO]
- public int Find(object key) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Find(object[] key) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRowView[] FindRows(object key) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public DataRowView[] FindRows(object[] key) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public event ListChangedEventHandler ListChanged;
-
- protected bool IsOpen {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- protected void Close() {
- }
-
- [MonoTODO]
- protected virtual void ColumnCollectionChanged(
- object sender, CollectionChangeEventArgs e) {
- }
-
- protected override void Dispose (bool disposing)
- {
- }
-
- [MonoTODO]
- protected virtual void IndexListChanged(object sender, ListChangedEventArgs e)
- {
- }
-
- [MonoTODO]
- protected virtual void OnListChanged(ListChangedEventArgs e)
- {
- }
-
- [MonoTODO]
- protected void Open() {
- }
-
- }
-
-}
diff --git a/mcs/class/System.Data/System.Data/DataViewManager.cs b/mcs/class/System.Data/System.Data/DataViewManager.cs
deleted file mode 100644
index cb4575bb128..00000000000
--- a/mcs/class/System.Data/System.Data/DataViewManager.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// System.Data.DataViewManager
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Contains a default DataViewSettingCollection for each DataTable in a DataSet.
- /// </summary>
- public class DataViewManager : MarshalByValueComponent
- // IBindingList, ICollection, IList, ITypedList, IEnumerable
- {
- private DataSet dataSet;
-
- public DataViewManager () {
- dataSet = null;
- }
-
- public DataViewManager (DataSet ds) {
- dataSet = ds;
- }
-
- [MonoTODO]
- public DataView CreateDataView (DataTable table) {
- return new DataView (table);
- }
-
- protected virtual void OnListChanged (ListChangedEventArgs e) {
- }
-
- protected virtual void RelationCollectionChanged (
- object sender,
- CollectionChangeEventArgs e) {
- }
-
- protected virtual void TableCollectionChanged (object sender,
- CollectionChangeEventArgs e) {
- }
-
- public DataSet DataSet {
- get {
- return dataSet;
- }
- set {
- dataSet = value;
- }
- }
-
- [MonoTODO]
- public string DataViewSettingCollectionString {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public DataViewSettingCollection DataViewSettings {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public event ListChangedEventHandler ListChanged;
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataViewRowState.cs b/mcs/class/System.Data/System.Data/DataViewRowState.cs
deleted file mode 100644
index 2768fbe0e0f..00000000000
--- a/mcs/class/System.Data/System.Data/DataViewRowState.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Data.DataViewRowState.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Describes the version of data in a DataRow.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DataViewRowState
- {
- None = 0,
- Unchanged = 2,
- Added = 4,
- Deleted = 8,
- ModifiedCurrent = 16,
- CurrentRows = 22,
- ModifiedOriginal = 32,
- OriginalRows = 42
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DataViewSetting.cs b/mcs/class/System.Data/System.Data/DataViewSetting.cs
deleted file mode 100644
index 4db37d934fc..00000000000
--- a/mcs/class/System.Data/System.Data/DataViewSetting.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.Data.DataViewSetting
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the default settings for ApplyDefaultSort, DataViewManager, RowFilter, RowStateFilter, Sort, and Table for DataViews created from the DataViewManager.
- /// </summary>
- public class DataViewSetting
- {
- private bool defaultSort;
- private DataViewManager viewManager;
- private string rowFilter;
- private DataViewRowState rowStateFilter;
- private string sortString;
-
- public bool ApplyDefaultSort {
- get {
- return defaultSort;
- }
- set {
- defaultSort = value;
- }
- }
-
- public DataViewManager DataViewManager {
- get {
- return viewManager;
- }
- }
-
- public string RowFilter {
- get {
- return rowFilter;
- }
- set {
- rowFilter = value;
- }
- }
-
- public DataViewRowState RowStateFilter {
- get {
- return rowStateFilter;
- }
- set {
- rowStateFilter = value;
- }
- }
-
- public string Sort {
- get {
- return sortString;
- }
- set {
- sortString = value;
- }
- }
-
- [MonoTODO]
- public DataTable Table {
- get {
- throw new NotImplementedException ();
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DataViewSettingCollection.cs b/mcs/class/System.Data/System.Data/DataViewSettingCollection.cs
deleted file mode 100755
index c2528878a39..00000000000
--- a/mcs/class/System.Data/System.Data/DataViewSettingCollection.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.Data.DataViewSettingCollection.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-// Authors:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Miguel de Icaza (miguel@gnome.org)
-//
-
-using System;
-using System.Collections;
-
-namespace System.Data {
- /// <summary>
- /// Contains a read-only collection of DataViewSetting objects for each DataTable in a DataSet.
- /// </summary>
- public class DataViewSettingCollection : ICollection, IEnumerable {
- private ArrayList settingList;
-
- public void CopyTo (Array ar, int index) {
- settingList.CopyTo (ar, index);
- }
-
- public IEnumerator GetEnumerator () {
- return settingList.GetEnumerator ();
- }
-
- public virtual int Count {
- get {
- return settingList.Count;
- }
- }
-
- public bool IsReadOnly {
- get {
- return settingList.IsReadOnly;
- }
- }
-
- public bool IsSynchronized {
- get {
- return settingList.IsSynchronized;
- }
- }
-
- public virtual DataViewSetting this [DataTable dt] {
- get {
- for (int i = 0; i < settingList.Count; i++) {
- DataViewSetting dvs = (DataViewSetting) settingList[i];
- if (dvs.Table == dt)
- return dvs;
- }
- return null;
- }
- set {
- this[dt] = value;
- }
- }
-
- public virtual DataViewSetting this[string name] {
- get {
- for (int i = 0; i < settingList.Count; i++) {
- DataViewSetting dvs = (DataViewSetting) settingList[i];
- if (dvs.Table.TableName == name)
- return dvs;
- }
- return null;
- }
- }
-
- public virtual DataViewSetting this[int index] {
- get {
- return (DataViewSetting) settingList[index];
- }
- set {
- settingList[index] = value;
- }
- }
-
- public object SyncRoot {
- get {
- return settingList.SyncRoot;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DbType.cs b/mcs/class/System.Data/System.Data/DbType.cs
deleted file mode 100644
index 9a0cad9a631..00000000000
--- a/mcs/class/System.Data/System.Data/DbType.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Data.DbType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Gets the data type of a field, a property, or a Parameter object of a .NET data provider.
- /// </summary>
- [Serializable]
- public enum DbType
- {
- AnsiString = 0,
- Binary = 1,
- Byte = 2,
- Boolean = 3,
- Currency = 4,
- Date = 5,
- DateTime = 6,
- Decimal = 7,
- Double = 8,
- Guid = 9,
- Int16 = 10,
- Int32 = 11,
- Int64 = 12,
- Object = 13,
- SByte = 14,
- Single = 15,
- String = 16,
- Time = 17,
- UInt16 = 18,
- UInt32 = 19,
- UInt64 = 20,
- VarNumeric = 21,
- AnsiStringFixedLength = 22,
- StringFixedLength = 23
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs b/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs
deleted file mode 100644
index 4088cc700b0..00000000000
--- a/mcs/class/System.Data/System.Data/DeletedRowInaccessibleException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.DeletedRowInaccessibleException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class DeletedRowInaccessibleException : DataException
- {
- public DeletedRowInaccessibleException ()
- : base (Locale.GetText ("This DataRow has been deleted"))
- {
- }
-
- public DeletedRowInaccessibleException (string message)
- : base (message)
- {
- }
-
- protected DeletedRowInaccessibleException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/DuplicateNameException.cs b/mcs/class/System.Data/System.Data/DuplicateNameException.cs
deleted file mode 100644
index 660840716e3..00000000000
--- a/mcs/class/System.Data/System.Data/DuplicateNameException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.DuplicateNameException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class DuplicateNameException : DataException
- {
- public DuplicateNameException ()
- : base (Locale.GetText ("There is a database object with the same name"))
- {
- }
-
- public DuplicateNameException (string message)
- : base (message)
- {
- }
-
- protected DuplicateNameException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/EvaluateException.cs b/mcs/class/System.Data/System.Data/EvaluateException.cs
deleted file mode 100644
index 426742eb90a..00000000000
--- a/mcs/class/System.Data/System.Data/EvaluateException.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Data.EvaluateException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
- [Serializable]
- public class EvaluateException : InvalidExpressionException
- {
- public EvaluateException ()
- : base (Locale.GetText ("This expression cannot be evaluated"))
- {
- }
-
- public EvaluateException (string message)
- : base (message)
- {
- }
-
- protected EvaluateException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/FillErrorEventArgs.cs b/mcs/class/System.Data/System.Data/FillErrorEventArgs.cs
deleted file mode 100755
index 4950d833916..00000000000
--- a/mcs/class/System.Data/System.Data/FillErrorEventArgs.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Data.FillErrorEventArgs.cs
-//
-// Author:
-// Miguel de Icaza <miguel@ximian.com>
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-
-namespace System.Data
-{
- public class FillErrorEventArgs : EventArgs {
- DataTable data_table;
- object [] values;
- Exception errors;
- bool f_continue;
-
- public FillErrorEventArgs (DataTable dataTable, object [] values)
- {
- this.data_table = dataTable;
- this.values = values;
- }
-
- public bool Continue {
- get {
- return f_continue;
- }
-
- set {
- f_continue = value;
- }
- }
-
- public DataTable DataTable {
- get {
- return data_table;
- }
- }
-
- public Exception Errors {
- get {
- return errors;
- }
-
- set {
- errors = value;
- }
- }
-
- public object [] Values {
- get {
- return values;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs b/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs
deleted file mode 100644
index 8f63a935cdb..00000000000
--- a/mcs/class/System.Data/System.Data/FillErrorEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.FillErrorEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the FillError event.
- /// </summary>
- [Serializable]
- public delegate void FillErrorEventHandler(object sender, FillErrorEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs b/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs
deleted file mode 100644
index 591398afa9c..00000000000
--- a/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// System.Data.ForeignKeyConstraint.cs
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) 2002 Daniel Morgan
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-
-namespace System.Data
-{
-
- [Serializable]
- public class ForeignKeyConstraint : Constraint {
-
- #region Constructors
-
- [MonoTODO]
- public ForeignKeyConstraint(DataColumn parentColumn,
- DataColumn childColumn) {
- }
-
- [MonoTODO]
- public ForeignKeyConstraint(DataColumn[] parentColumns,
- DataColumn[] childColumns) {
- }
-
- [MonoTODO]
- public ForeignKeyConstraint(string constraintName,
- DataColumn parentColumn, DataColumn childColumn) {
- }
-
- [MonoTODO]
- public ForeignKeyConstraint(string constraintName,
- DataColumn[] parentColumns,
- DataColumn[] childColumns) {
- }
-
- [MonoTODO]
- public ForeignKeyConstraint(string constraintName,
- string parentTableName, string[] parentColumnNames,
- string[] childColumnNames,
- AcceptRejectRule acceptRejectRule, Rule deleteRule,
- Rule updateRule) {
- }
-
- #endregion // Constructors
-
- #region Properites
-
- public virtual AcceptRejectRule AcceptRejectRule {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DataColumn[] Columns {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual Rule DeleteRule {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DataColumn[] RelatedColumns {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual DataTable RelatedTable {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public override DataTable Table {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual Rule UpdateRule {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public override bool Equals(object key) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int GetHashCode() {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
- }
-
-}
diff --git a/mcs/class/System.Data/System.Data/IColumnMapping.cs b/mcs/class/System.Data/System.Data/IColumnMapping.cs
deleted file mode 100644
index 2e307763533..00000000000
--- a/mcs/class/System.Data/System.Data/IColumnMapping.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Data.IColumnMapping.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Associates a data source column with a DataSet column, and is implemented by the DataColumnMapping class, which is used in common by .NET data providers.
- /// </summary>
- public interface IColumnMapping
- {
- /// <summary>
- /// Gets or sets the name of the column within the DataSet to map to.
- /// </summary>
- string DataSetColumn
- {
- get;
- set;
- }
-
- /// <summary>
- /// Gets or sets the name of the column within the data source to map from. The name is case-sensitive.
- /// </summary>
- string SourceColumn
- {
- get;
- set;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs b/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs
deleted file mode 100644
index a23a2ae6056..00000000000
--- a/mcs/class/System.Data/System.Data/IColumnMappingCollection.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Data.IColumnMappingCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System.Collections;
-
-namespace System.Data
-{
- /// <summary>
- /// Contains a collection of ColumnMapping objects, and is implemented by the DataColumnMappingCollection, which is used in common by .NET data providers.
- /// </summary>
- public interface IColumnMappingCollection : IList, ICollection, IEnumerable
- {
- IColumnMapping Add(string sourceColumnName, string dataSetColumnName);
-
- bool Contains(string sourceColumnName);
-
- IColumnMapping GetByDataSetColumn(string dataSetColumnName);
-
- int IndexOf(string sourceColumnName);
-
- void RemoveAt(string sourceColumnName);
-
- object this[string index]
- {
- get;
- set;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IDataAdapter.cs b/mcs/class/System.Data/System.Data/IDataAdapter.cs
deleted file mode 100644
index be6f09036b0..00000000000
--- a/mcs/class/System.Data/System.Data/IDataAdapter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Data.IDataAdapter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Allows an object to implement a DataAdapter, and represents a set of methods and mapping action-related properties used to fill and refresh a DataSet and update a data source.
- /// </summary>
- public interface IDataAdapter
- {
- int Fill(DataSet dataSet);
-
- DataTable[] FillSchema(DataSet dataSet, SchemaType schemaType);
-
- IDataParameter[] GetFillParameters();
-
- int Update(DataSet dataSet);
-
- MissingMappingAction MissingMappingAction{get;set;}
-
- MissingSchemaAction MissingSchemaAction{get;set;}
-
- ITableMappingCollection TableMappings{get;}
-
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataParameter.cs b/mcs/class/System.Data/System.Data/IDataParameter.cs
deleted file mode 100644
index 3528cb2f246..00000000000
--- a/mcs/class/System.Data/System.Data/IDataParameter.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Data.IDataParameter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a parameter to a Command object, and optionally, its mapping to DataSet columns; and is implemented by .NET data providers that access data sources.
- /// </summary>
- public interface IDataParameter
- {
-
- DbType DbType{get;set;}
-
- ParameterDirection Direction{get;set;}
-
- bool IsNullable{get;}
-
- string ParameterName{get;set;}
-
- string SourceColumn{get;set;}
-
- DataRowVersion SourceVersion {get;set;}
-
- object Value {get;set;}
-
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataParameterCollection.cs b/mcs/class/System.Data/System.Data/IDataParameterCollection.cs
deleted file mode 100644
index 41da8ab9d77..00000000000
--- a/mcs/class/System.Data/System.Data/IDataParameterCollection.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Data.IDataParameterCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Collections;
-
-namespace System.Data
-{
- /// <summary>
- /// Collects all parameters relevant to a Command object and their mappings to DataSet columns, and is implemented by .NET data providers that access data sources.
- /// </summary>
- public interface IDataParameterCollection : IList, ICollection, IEnumerable
- {
- void RemoveAt(string parameterName);
-
- int IndexOf(string parameterName);
-
- bool Contains(string parameterName);
-
- object this[string parameterName]{get; set;}
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IDataReader.cs b/mcs/class/System.Data/System.Data/IDataReader.cs
deleted file mode 100644
index 746d0d72ed6..00000000000
--- a/mcs/class/System.Data/System.Data/IDataReader.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Data.IDataReader.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDataReader : IDisposable, IDataRecord
- {
- void Close();
-
- DataTable GetSchemaTable();
-
- bool NextResult();
-
- bool Read();
-
- int Depth{get;}
-
- bool IsClosed{get;}
-
- int RecordsAffected{get;}
-
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDataRecord.cs b/mcs/class/System.Data/System.Data/IDataRecord.cs
deleted file mode 100644
index 0bb6376da12..00000000000
--- a/mcs/class/System.Data/System.Data/IDataRecord.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// System.Data.IDataRecord.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Provides access to the column values within
- /// each row for a DataReader, and is implemented by .NET data
- /// providers that access relational databases.
- /// </summary>
- public interface IDataRecord
- {
- bool GetBoolean(int i);
-
- byte GetByte(int i);
-
- long GetBytes(int i, long fieldOffset, byte[] buffer,
- int bufferOffset, int length);
-
- char GetChar(int i);
-
- long GetChars(int i, long fieldOffset, char[] buffer,
- int bufferOffset, int length);
-
- IDataReader GetData(int i);
-
- string GetDataTypeName(int i);
-
- DateTime GetDateTime(int i);
-
- decimal GetDecimal(int i);
-
- double GetDouble(int i);
-
- Type GetFieldType(int i);
-
- float GetFloat(int i);
-
- Guid GetGuid(int i);
-
- short GetInt16(int i);
-
- int GetInt32(int i);
-
- long GetInt64(int i);
-
- string GetName(int i);
-
- int GetOrdinal(string name);
-
- string GetString(int i);
-
- object GetValue(int i);
-
- int GetValues(object[] values);
-
- bool IsDBNull(int i);
-
- int FieldCount{get;}
-
- object this[string name]{get;}
-
- object this[int i]{get;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbCommand.cs b/mcs/class/System.Data/System.Data/IDbCommand.cs
deleted file mode 100644
index 547d702af67..00000000000
--- a/mcs/class/System.Data/System.Data/IDbCommand.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Data.IDBCommand.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a SQL statement that is executed while connected to a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDbCommand
- {
- void Cancel();
-
- IDbDataParameter CreateParameter();
-
- int ExecuteNonQuery();
-
- IDataReader ExecuteReader();
-
- IDataReader ExecuteReader(CommandBehavior behavior);
-
- object ExecuteScalar();
-
- void Prepare();
-
- string CommandText{get; set;}
-
- int CommandTimeout{get; set;}
-
- CommandType CommandType{get; set;}
-
- IDbConnection Connection{get; set;}
-
- IDataParameterCollection Parameters{get;}
-
- IDbTransaction Transaction{get; set;}
-
- UpdateRowSource UpdatedRowSource{get; set;}
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IDbConnection.cs b/mcs/class/System.Data/System.Data/IDbConnection.cs
deleted file mode 100644
index 5a67874102b..00000000000
--- a/mcs/class/System.Data/System.Data/IDbConnection.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Data.IDBConnection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents an open connection to a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDbConnection
- {
- IDbTransaction BeginTransaction();
-
- IDbTransaction BeginTransaction(IsolationLevel il);
-
- void ChangeDatabase(string databaseName);
-
- void Close();
-
- IDbCommand CreateCommand();
-
- void Open();
-
-
- string ConnectionString{get; set;}
-
- int ConnectionTimeout{get;}
-
- string Database{get;}
-
- ConnectionState State{get;}
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IDbDataAdapter.cs b/mcs/class/System.Data/System.Data/IDbDataAdapter.cs
deleted file mode 100644
index 78c1173da09..00000000000
--- a/mcs/class/System.Data/System.Data/IDbDataAdapter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.IDbDataAdapter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a set of command-related properties that are used to fill the DataSet and update a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDbDataAdapter : IDataAdapter
- {
- IDbCommand DeleteCommand{get; set;}
-
- IDbCommand InsertCommand{get; set;}
-
- IDbCommand SelectCommand{get; set;}
-
- IDbCommand UpdateCommand{get; set;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbDataParameter.cs b/mcs/class/System.Data/System.Data/IDbDataParameter.cs
deleted file mode 100644
index 5eeba691179..00000000000
--- a/mcs/class/System.Data/System.Data/IDbDataParameter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.IDbDataParameter.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Used by the Visual Basic .NET Data Designers to represent a parameter to a Command object, and optionally, its mapping to DataSet columns.
- /// </summary>
- public interface IDbDataParameter : IDataParameter
- {
- byte Precision{get; set;}
-
- byte Scale{get; set;}
-
- int Size{get; set;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/IDbTransaction.cs b/mcs/class/System.Data/System.Data/IDbTransaction.cs
deleted file mode 100644
index 792a78052b0..00000000000
--- a/mcs/class/System.Data/System.Data/IDbTransaction.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.IDbTransaction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Represents a transaction to be performed at a data source, and is implemented by .NET data providers that access relational databases.
- /// </summary>
- public interface IDbTransaction : IDisposable
- {
- void Commit();
-
- void Rollback();
-
- IDbConnection Connection{get;}
-
- IsolationLevel IsolationLevel{get;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ITableMapping.cs b/mcs/class/System.Data/System.Data/ITableMapping.cs
deleted file mode 100644
index 82f5329b083..00000000000
--- a/mcs/class/System.Data/System.Data/ITableMapping.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.ITableMapping.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Associates a source table with a table in a DataSet, and is implemented by the DataTableMapping class, which is used in common by .NET data providers.
- /// </summary>
- public interface ITableMapping
- {
- IColumnMappingCollection ColumnMappings{get;}
-
- string DataSetTable{get; set;}
-
- string SourceTable{get; set;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/ITableMappingCollection.cs b/mcs/class/System.Data/System.Data/ITableMappingCollection.cs
deleted file mode 100644
index 5ca052f94ab..00000000000
--- a/mcs/class/System.Data/System.Data/ITableMappingCollection.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Data.ITableMappingCollection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System.Collections;
-
-namespace System.Data
-{
- /// <summary>
- /// Contains a collection of TableMapping objects, and is implemented by the DataTableMappingCollection, which is used in common by .NET data providers.
- /// </summary>
- public interface ITableMappingCollection : IList, ICollection, IEnumerable
- {
- ITableMapping Add(string sourceTableName, string dataSetTableName);
-
- bool Contains(string sourceTableName);
-
- ITableMapping GetByDataSetTable(string dataSetTableName);
-
- int IndexOf(string sourceTableName);
-
- void RemoveAt(string sourceTableName);
-
- object this[string index]{get; set;}
- }
-}
diff --git a/mcs/class/System.Data/System.Data/InRowChangingEventException.cs b/mcs/class/System.Data/System.Data/InRowChangingEventException.cs
deleted file mode 100644
index 8c7be400702..00000000000
--- a/mcs/class/System.Data/System.Data/InRowChangingEventException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.InRowChangingEventException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class InRowChangingEventException : DataException
- {
- public InRowChangingEventException ()
- : base (Locale.GetText ("Cannot EndEdit within a RowChanging event"))
- {
- }
-
- public InRowChangingEventException (string message)
- : base (message)
- {
- }
-
- protected InRowChangingEventException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs b/mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs
deleted file mode 100644
index 9434f671759..00000000000
--- a/mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// System.Data.InternalDataCollectionBase.cs
-//
-// Base class for:
-// DataRowCollection
-// DataColumnCollection
-// DataTableCollection
-// DataRelationCollection
-// DataConstraintCollection
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-// Tim Coleman <tim@timcoleman.com>
-//
-// (C) Copyright 2002 Daniel Morgan
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// Base class for System.Data collection classes
- /// that are used within a DataTable object
- /// to represent a collection of
- /// relations, tables, rows, columns, and constraints
- /// </summary>
-
- public class InternalDataCollectionBase : ICollection, IEnumerable
- {
- #region Fields
-
- protected ArrayList list = null;
- protected bool readOnly = false;
- protected bool synchronized = false;
-
- #endregion
-
- #region Constructors
-
- [MonoTODO]
- public InternalDataCollectionBase()
- {
- list = new ArrayList();
- }
-
- #endregion
-
- #region Properties
-
- /// <summary>
- /// Gets the total number of elements in a collection.
- /// </summary>
- public virtual int Count {
- get { return list.Count; }
- }
-
- /// <summary>
- /// Gets a value indicating whether the InternalDataCollectionBase is read-only.
- /// </summary>
- public bool IsReadOnly {
- get { return readOnly; }
- }
-
- /// <summary>
- /// Gets a value indicating whether the InternalDataCollectionBase is synchronized.
- /// </summary>
- public bool IsSynchronized {
- get { return synchronized; }
- }
-
- /// <summary>
- /// Gets the items of the collection as a list.
- /// </summary>
- protected virtual ArrayList List {
- get { return list; }
- }
-
- /// <summary>
- /// Gets an object that can be used to synchronize the collection.
- /// </summary>
- public object SyncRoot {
- [MonoTODO]
- get {
- // FIXME: how do we sync?
- throw new NotImplementedException ();
- }
- }
-
-
- #endregion
-
- #region Methods
-
- /// <summary>
- /// Copies all the elements in the current InternalDataCollectionBase to a one-
- /// dimensional Array, starting at the specified InternalDataCollectionBase index.
- /// </summary>
- public void CopyTo(Array ar, int index)
- {
- list.CopyTo (ar, index);
-
- }
-
- /// <summary>
- /// Gets an IEnumerator for the collection.
- /// </summary>
- public IEnumerator GetEnumerator()
- {
- return list.GetEnumerator ();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.Data/System.Data/InvalidConstraintException.cs b/mcs/class/System.Data/System.Data/InvalidConstraintException.cs
deleted file mode 100644
index 2327b7d2a9e..00000000000
--- a/mcs/class/System.Data/System.Data/InvalidConstraintException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.InvalidConstraintException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class InvalidConstraintException : DataException
- {
- public InvalidConstraintException ()
- : base (Locale.GetText ("Cannot access or create this relation"))
- {
- }
-
- public InvalidConstraintException (string message)
- : base (message)
- {
- }
-
- protected InvalidConstraintException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/InvalidExpressionException.cs b/mcs/class/System.Data/System.Data/InvalidExpressionException.cs
deleted file mode 100644
index ac383cba5fe..00000000000
--- a/mcs/class/System.Data/System.Data/InvalidExpressionException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.InvalidExpressionException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class InvalidExpressionException : DataException
- {
- public InvalidExpressionException ()
- : base (Locale.GetText ("This Expression is invalid"))
- {
- }
-
- public InvalidExpressionException (string message)
- : base (message)
- {
- }
-
- protected InvalidExpressionException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/IsolationLevel.cs b/mcs/class/System.Data/System.Data/IsolationLevel.cs
deleted file mode 100644
index 3a25ef9cc0e..00000000000
--- a/mcs/class/System.Data/System.Data/IsolationLevel.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.IsolationLevel.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies the transaction locking behavior for the connection.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum IsolationLevel
- {
- Unspecified = -1,
- Chaos = 16,
- ReadUncommitted = 256,
- ReadCommitted = 4096,
- RepeatableRead = 65536,
- Serializable = 1048576
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/Locale.cs b/mcs/class/System.Data/System.Data/Locale.cs
deleted file mode 100755
index 539184dbde4..00000000000
--- a/mcs/class/System.Data/System.Data/Locale.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Globalization.Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Globalization {
-
- internal class Locale {
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/MappingType.cs b/mcs/class/System.Data/System.Data/MappingType.cs
deleted file mode 100644
index dbdeb9fc23e..00000000000
--- a/mcs/class/System.Data/System.Data/MappingType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Data.MappingType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies how a DataColumn is mapped.
- /// </summary>
- [Serializable]
- public enum MappingType
- {
- Element = 1,
- Attribute = 2,
- SimpleContent = 3,
- Hidden = 4
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MergeFailedEventArgs.cs b/mcs/class/System.Data/System.Data/MergeFailedEventArgs.cs
deleted file mode 100644
index 9e58aa76928..00000000000
--- a/mcs/class/System.Data/System.Data/MergeFailedEventArgs.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Data.MergeFailedEventArgs.cs
-//
-// Author:
-// Miguel de Icaza <miguel@ximian.com>
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-
-namespace System.Data
-{
- public class MergeFailedEventArgs : EventArgs {
- DataTable data_table;
- string conflict;
- Exception errors;
- bool f_continue;
-
- public MergeFailedEventArgs (DataTable dataTable, string conflict)
- {
- this.data_table = dataTable;
- this.conflict = conflict;
- }
-
- public DataTable DataTable {
- get {
- return data_table;
- }
- }
-
- public string Conflict {
- get {
- return conflict;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs b/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs
deleted file mode 100644
index 3ec7962496a..00000000000
--- a/mcs/class/System.Data/System.Data/MergeFailedEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.MergeFailedEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the MergeFailed event.
- /// </summary>
- [Serializable]
- public delegate void MergeFailedEventHandler(object sender, MergeFailedEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MissingMappingAction.cs b/mcs/class/System.Data/System.Data/MissingMappingAction.cs
deleted file mode 100644
index 74ce838d9c9..00000000000
--- a/mcs/class/System.Data/System.Data/MissingMappingAction.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Data.MissingMappingAction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Determines the action that occurs when a mapping is missing from a source table or a source column.
- /// </summary>
- [Serializable]
- public enum MissingMappingAction
- {
- Passthrough = 1,
- Ignore = 2,
- Error = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs b/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs
deleted file mode 100644
index dcb0b3aca59..00000000000
--- a/mcs/class/System.Data/System.Data/MissingPrimaryKeyException.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Data.MissingPrimaryKeyException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
-
- [Serializable]
- public class MissingPrimaryKeyException : DataException
- {
- public MissingPrimaryKeyException ()
- : base (Locale.GetText ("This table has no primary key"))
- {
- }
-
- public MissingPrimaryKeyException (string message)
- : base (message)
- {
- }
-
- protected MissingPrimaryKeyException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/MissingSchemaAction.cs b/mcs/class/System.Data/System.Data/MissingSchemaAction.cs
deleted file mode 100644
index 52051457961..00000000000
--- a/mcs/class/System.Data/System.Data/MissingSchemaAction.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.MissingSchemaAction.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies the action to take when adding data to the DataSet and the required DataTable or DataColumn is missing.
- /// </summary>
- [Serializable]
- public enum MissingSchemaAction
- {
- Add = 1,
- Ignore = 2,
- Error = 3,
- AddWithKey = 4
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/NoNullAllowedException.cs b/mcs/class/System.Data/System.Data/NoNullAllowedException.cs
deleted file mode 100644
index 3a5593285d3..00000000000
--- a/mcs/class/System.Data/System.Data/NoNullAllowedException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.NoNullAllowedException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class NoNullAllowedException : DataException
- {
- public NoNullAllowedException ()
- : base (Locale.GetText ("Cannot insert a NULL value"))
- {
- }
-
- public NoNullAllowedException (string message)
- : base (message)
- {
- }
-
- protected NoNullAllowedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/ParameterDirection.cs b/mcs/class/System.Data/System.Data/ParameterDirection.cs
deleted file mode 100644
index 7de26dfc868..00000000000
--- a/mcs/class/System.Data/System.Data/ParameterDirection.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.ParameterDirection.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies the type of a parameter within a query relative to the DataSet.
- /// </summary>
- [Serializable]
- public enum ParameterDirection
- {
- Input = 1,
- Output = 2,
- InputOutput = 3,
- ReturnValue = 6
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/PropertyAttributes.cs b/mcs/class/System.Data/System.Data/PropertyAttributes.cs
deleted file mode 100644
index 6e43646100e..00000000000
--- a/mcs/class/System.Data/System.Data/PropertyAttributes.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Data.PropertyAttributes.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies the attributes of a property.
- /// This enumeration has a FlagsAttribute that allows a bitwise combination of its member values
- /// </summary>
- [Flags]
- [Serializable]
- public enum PropertyAttributes
- {
- NotSupported = 0,
- Required = 1,
- Optional = 2,
- Read = 512,
- Write = 1024
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/PropertyCollection.cs b/mcs/class/System.Data/System.Data/PropertyCollection.cs
deleted file mode 100644
index ef720923387..00000000000
--- a/mcs/class/System.Data/System.Data/PropertyCollection.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Data.PropertyCollection.cs
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c) Ximian, Inc. 2002
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Data
-{
- /// <summary>
- /// a collection of properties that can be added to
- /// DataColumn, DataSet, or DataTable.
- /// The ExtendedProperties property of a
- /// DataColumn, DataSet, or DataTable class can
- /// retrieve a PropertyCollection.
- /// </summary>
- public class PropertyCollection : Hashtable {
- [MonoTODO]
- public PropertyCollection() {
- }
-
- // the only public methods and properties
- // are all inherited from Hashtable
- }
-}
diff --git a/mcs/class/System.Data/System.Data/ReadOnlyException.cs b/mcs/class/System.Data/System.Data/ReadOnlyException.cs
deleted file mode 100644
index a45f5d22d17..00000000000
--- a/mcs/class/System.Data/System.Data/ReadOnlyException.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Data.ReadOnlyException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
-
- [Serializable]
- public class ReadOnlyException : DataException
- {
- public ReadOnlyException ()
- : base (Locale.GetText ("Cannot change a value in a read-only column"))
- {
- }
-
- public ReadOnlyException (string message)
- : base (message)
- {
- }
-
- protected ReadOnlyException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/RowNotInTableException.cs b/mcs/class/System.Data/System.Data/RowNotInTableException.cs
deleted file mode 100644
index 9209312d0ca..00000000000
--- a/mcs/class/System.Data/System.Data/RowNotInTableException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.RowNotInTableException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class RowNotInTableException : DataException
- {
- public RowNotInTableException ()
- : base (Locale.GetText ("This DataRow is not in this DataTable"))
- {
- }
-
- public RowNotInTableException (string message)
- : base (message)
- {
- }
-
- protected RowNotInTableException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/Rule.cs b/mcs/class/System.Data/System.Data/Rule.cs
deleted file mode 100644
index e8fc4166f34..00000000000
--- a/mcs/class/System.Data/System.Data/Rule.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.Rule.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Indicates the action that occurs when a ForeignKeyConstraint is enforced.
- /// </summary>
- [Serializable]
- public enum Rule
- {
- None = 0,
- Cascade = 1,
- SetNull = 2,
- SetDefault = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/SchemaType.cs b/mcs/class/System.Data/System.Data/SchemaType.cs
deleted file mode 100644
index 8c0d1dbf904..00000000000
--- a/mcs/class/System.Data/System.Data/SchemaType.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Data.SchemaType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies how to handle existing schema mappings when performing a FillSchema operation.
- /// </summary>
- [Serializable]
- public enum SchemaType
- {
- Source = 1,
- Mapped = 2
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/SqlDbType.cs b/mcs/class/System.Data/System.Data/SqlDbType.cs
deleted file mode 100644
index 9c4afccf5e0..00000000000
--- a/mcs/class/System.Data/System.Data/SqlDbType.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Data.SqlDbType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies SQL Server data types.
- /// </summary>
- [Serializable]
- public enum SqlDbType
- {
- BigInt = 0,
- Binary = 1,
- Bit = 2,
- Char = 3,
- DateTime = 4,
- Decimal = 5,
- Float = 6,
- Image = 7,
- Int = 8,
- Money = 9,
- NChar = 10,
- NText = 11,
- NVarChar = 12,
- Real = 13,
- UniqueIdentifier = 14,
- SmallDateTime = 15,
- SmallInt = 16,
- SmallMoney = 17,
- Text = 18,
- Timestamp = 19,
- TinyInt = 20,
- VarBinary = 21,
- VarChar = 22,
- Variant = 23
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/StateChangeEventArgs.cs b/mcs/class/System.Data/System.Data/StateChangeEventArgs.cs
deleted file mode 100644
index c21e4abbc76..00000000000
--- a/mcs/class/System.Data/System.Data/StateChangeEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Data.SqlRowUpdatingEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-
-namespace System.Data {
- public sealed class StateChangeEventArgs : EventArgs {
-
- [MonoTODO]
- public StateChangeEventArgs(ConnectionState originalState,
- ConnectionState currentState) {
- // FIXME: do me
- }
-
- [MonoTODO]
- public ConnectionState CurrentState {
- get {
- // FIXME: do me
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public ConnectionState OriginalState {
- get {
- // FIXME: do me
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- ~StateChangeEventArgs() {
- // FIXME: do me
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs b/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs
deleted file mode 100644
index 29ad7703030..00000000000
--- a/mcs/class/System.Data/System.Data/StateChangeEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Data.StateChangeEventHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-namespace System.Data
-{
- /// <summary>
- /// Represents the method that will handle the StateChange event.
- /// </summary>
- [Serializable]
- public delegate void StateChangeEventHandler(object sender, StateChangeEventArgs e);
-
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/StatementType.cs b/mcs/class/System.Data/System.Data/StatementType.cs
deleted file mode 100644
index 11cc51c1bba..00000000000
--- a/mcs/class/System.Data/System.Data/StatementType.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.StatementType.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies the type of SQL query to be used by the OleDbRowUpdatedEventArgs, OleDbRowUpdatingEventArgs, SqlRowUpdatedEventArgs, or SqlRowUpdatingEventArgs class.
- /// </summary>
- [Serializable]
- public enum StatementType
- {
- Select = 0,
- Insert = 1,
- Update = 2,
- Delete = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/StrongTypingException.cs b/mcs/class/System.Data/System.Data/StrongTypingException.cs
deleted file mode 100644
index 65749b68ac8..00000000000
--- a/mcs/class/System.Data/System.Data/StrongTypingException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.StrongTypingException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class StrongTypingException : DataException
- {
- public StrongTypingException ()
- : base (Locale.GetText ("Trying to access a DBNull value in a strongly-typed DataSet"))
- {
- }
-
- public StrongTypingException (string message)
- : base (message)
- {
- }
-
- protected StrongTypingException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/SyntaxErrorException.cs b/mcs/class/System.Data/System.Data/SyntaxErrorException.cs
deleted file mode 100644
index 6f97458d654..00000000000
--- a/mcs/class/System.Data/System.Data/SyntaxErrorException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.SyntaxErrorException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
- [Serializable]
- public class SyntaxErrorException : InvalidExpressionException
- {
- public SyntaxErrorException ()
- : base (Locale.GetText ("There is a syntax error in this Expression"))
- {
- }
-
- public SyntaxErrorException (string message)
- : base (message)
- {
- }
-
- protected SyntaxErrorException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- }
-}
diff --git a/mcs/class/System.Data/System.Data/TODOAttribute.cs b/mcs/class/System.Data/System.Data/TODOAttribute.cs
deleted file mode 100644
index 9aae1ca30bb..00000000000
--- a/mcs/class/System.Data/System.Data/TODOAttribute.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-using System;
-
-namespace System.Data {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs b/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs
deleted file mode 100644
index b46e17c385a..00000000000
--- a/mcs/class/System.Data/System.Data/TypeDataSetGeneratorException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.TypedDataSetGeneratorException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class TypedDataSetGeneratorException : DataException
- {
- public TypedDataSetGeneratorException ()
- : base (Locale.GetText ("There is a name conflict"))
- {
- }
-
- public TypedDataSetGeneratorException (string message)
- : base (message)
- {
- }
-
- protected TypedDataSetGeneratorException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/UniqueConstraint.cs b/mcs/class/System.Data/System.Data/UniqueConstraint.cs
deleted file mode 100644
index 60ec2e9c3a5..00000000000
--- a/mcs/class/System.Data/System.Data/UniqueConstraint.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// System.Data.UniqueConstraint.cs
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) 2002 Daniel Morgan
-//
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-
-namespace System.Data
-{
- public class UniqueConstraint : Constraint {
-
- #region Constructors
-
- [MonoTODO]
- public UniqueConstraint(DataColumn column) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(DataColumn[] columns) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(DataColumn column,
- bool isPrimaryKey) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(DataColumn[] columns, bool isPrimaryKey) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(string name, DataColumn column) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(string name, DataColumn[] columns) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(string name, DataColumn column,
- bool isPrimaryKey) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(string name,
- DataColumn[] columns, bool isPrimaryKey) {
-
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public UniqueConstraint(string name,
- string[] columnNames, bool isPrimaryKey) {
-
- throw new NotImplementedException ();
- }
-
- #endregion // Constructors
-
- #region Properties
-
- public virtual DataColumn[] Columns {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public bool IsPrimaryKey {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public override DataTable Table {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- #endregion // Properties
-
- #region Methods
-
- [MonoTODO]
- public override bool Equals(object key2) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int GetHashCode() {
- throw new NotImplementedException ();
- }
-
- #endregion // Methods
- }
-}
diff --git a/mcs/class/System.Data/System.Data/UpdateRowSource.cs b/mcs/class/System.Data/System.Data/UpdateRowSource.cs
deleted file mode 100644
index 6ccf40d5306..00000000000
--- a/mcs/class/System.Data/System.Data/UpdateRowSource.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.UpdateRowSource.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies how query command results are applied to the row being updated.
- /// </summary>
- [Serializable]
- public enum UpdateRowSource
- {
- None = 0,
- OutputParameters = 1,
- FirstReturnedRecord = 2,
- Both = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/UpdateStatus.cs b/mcs/class/System.Data/System.Data/UpdateStatus.cs
deleted file mode 100644
index f686d6cd1aa..00000000000
--- a/mcs/class/System.Data/System.Data/UpdateStatus.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Data.UpdateStatus.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies the action to take with regard to the current and remaining rows during an Update.
- /// </summary>
- [Serializable]
- public enum UpdateStatus
- {
- Continue = 0,
- ErrorsOccurred = 1,
- SkipCurrentRow = 2,
- SkipAllRemainingRows = 3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/VersionNotFoundException.cs b/mcs/class/System.Data/System.Data/VersionNotFoundException.cs
deleted file mode 100644
index f26a642eb53..00000000000
--- a/mcs/class/System.Data/System.Data/VersionNotFoundException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Data.VersionNotFoundException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Data {
-
- [Serializable]
- public class VersionNotFoundException : DataException
- {
- public VersionNotFoundException ()
- : base (Locale.GetText ("This DataRow has been deleted"))
- {
- }
-
- public VersionNotFoundException (string message)
- : base (message)
- {
- }
-
- protected VersionNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/System.Data/System.Data/XmlReadMode.cs b/mcs/class/System.Data/System.Data/XmlReadMode.cs
deleted file mode 100644
index d8db21dbd19..00000000000
--- a/mcs/class/System.Data/System.Data/XmlReadMode.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Data.XmlReadMode.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Specifies how to read XML data and a relational schema into a DataSet.
- /// </summary>
- [Serializable]
- public enum XmlReadMode
- {
- Auto = 0,
- ReadSchema = 1,
- IgnoreSchema = 2,
- InferSchema = 3,
- DiffGram = 4,
- Fragment = 5
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Data/XmlWriteMode.cs b/mcs/class/System.Data/System.Data/XmlWriteMode.cs
deleted file mode 100644
index f70b9c5850b..00000000000
--- a/mcs/class/System.Data/System.Data/XmlWriteMode.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Data.XmlWriteMode.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-
-namespace System.Data
-{
- /// <summary>
- /// Use the members of this enumeration when setting the WriteMode parameter of the WriteXml method.
- /// </summary>
- [Serializable]
- public enum XmlWriteMode
- {
- WriteSchema = 0,
- IgnoreSchema = 1,
- DiffGram = 2
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Data/System.Xml/XmlDataDocument.cs b/mcs/class/System.Data/System.Xml/XmlDataDocument.cs
deleted file mode 100644
index 8b028c96e7f..00000000000
--- a/mcs/class/System.Data/System.Xml/XmlDataDocument.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-//
-// mcs/class/System.Data/System.Xml/XmlDataDocument.cs
-//
-// Purpose: Provides a W3C XML DOM Document to interact with
-// relational data in a DataSet
-//
-// class: XmlDataDocument
-// assembly: System.Data.dll
-// namespace: System.Xml
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-// XmlDataDocument is included within the Mono Class Library.
-//
-
-using System;
-using System.Data;
-using System.IO;
-using System.Text;
-using System.Xml.XPath;
-
-namespace System.Xml {
-
- public class XmlDataDocument : XmlDocument {
-
- #region Fields
-
- private DataSet dataSet;
-
- #endregion // Fields
-
- #region Constructors
-
- public XmlDataDocument() {
- dataSet = new DataSet();
- }
-
- public XmlDataDocument(DataSet dataset) {
- this.dataSet = dataset;
- }
-
- #endregion // Constructors
-
- #region Public Properties
-
- public override string BaseURI {
- [MonoTODO]
- get {
- // TODO: why are we overriding?
- return base.BaseURI;
- }
- }
-
- public DataSet DataSet {
- [MonoTODO]
- get {
- return dataSet;
- }
- }
-
- // override inheritted method from XmlDocument
- public override string InnerXml {
- [MonoTODO]
- get {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- set {
- throw new NotImplementedException();
- }
- }
-
- public override bool IsReadOnly {
- [MonoTODO]
- get {
- throw new NotImplementedException();
- }
-
- }
-
- // Item indexer
- public override XmlElement this[string name] {
- [MonoTODO]
- get {
- throw new NotImplementedException();
- }
- }
-
- // Item indexer
- public override XmlElement this[string localname, string ns] {
- [MonoTODO]
- get {
- throw new NotImplementedException();
- }
- }
-
- public override string LocalName {
- [MonoTODO]
- get {
- throw new NotImplementedException();
- }
- }
-
- public override string Name {
- [MonoTODO]
- get {
- throw new NotImplementedException();
- }
- }
-
- public override XmlDocument OwnerDocument {
- [MonoTODO]
- get {
- return null;
- }
- }
-
- #endregion // Public Properties
-
- #region Public Methods
-
- [MonoTODO]
- public override XmlNode CloneNode(bool deep)
- {
- throw new NotImplementedException();
- }
-
- #region overloaded CreateElement methods
-
- [MonoTODO]
- public new XmlElement CreateElement(string prefix,
- string localName, string namespaceURI)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public new XmlElement CreateElement(string qualifiedName,
- string namespaceURI)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public new XmlElement CreateElement(string name)
- {
- throw new NotImplementedException();
- }
-
- #endregion // overloaded CreateElement Methods
-
- // will not be supported
- public override XmlEntityReference CreateEntityReference(string name)
- {
- throw new NotSupportedException();
- }
-
- // will not be supported
- public override XmlElement GetElementById(string elemId)
- {
- throw new NotSupportedException();
- }
-
- // get the XmlElement associated with the DataRow
- public XmlElement GetElementFromRow(DataRow r)
- {
- throw new NotImplementedException();
- }
-
- // get the DataRow associated with the XmlElement
- [MonoTODO]
- public DataRow GetRowFromElement(XmlElement e)
- {
- throw new NotImplementedException();
- }
-
- #region overload Load methods
-
- [MonoTODO]
- public override void Load(Stream inStream) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public override void Load(string filename) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public override void Load(TextReader txtReader) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public override void Load(XmlReader reader) {
- throw new NotImplementedException();
- }
-
- #endregion // overloaded Load methods
-
- [MonoTODO]
- public override void WriteContentTo(XmlWriter xw) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public override void WriteTo(XmlWriter w) {
- throw new NotImplementedException();
- }
-
- #endregion // Public Methods
-
- #region Protected Methods
-
- [MonoTODO]
- protected override XPathNavigator CreateNavigator(XmlNode node) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public new XPathNavigator CreateNavigator() {
- throw new NotImplementedException();
- }
-
- #endregion // Protected Methods
-
- }
-}
diff --git a/mcs/class/System.Data/TODO b/mcs/class/System.Data/TODO
deleted file mode 100644
index acd1a7f4234..00000000000
--- a/mcs/class/System.Data/TODO
+++ /dev/null
@@ -1,134 +0,0 @@
-System.Data TODO List
-=====================
-
-Update this file as needed...
-
-* To get ExecuteReader() in a SqlCommand object to return
- a SqlDataReader object which can Read() data and get a String or
- Int32 from the database. Other types can be done later.
-
- A class (SqlDataReader) that implements IDataReader/IDataRecord
- only has one row in memory at a time.
-
-In order to do this, we need to compile and edit these classes:
- SqlDataReader DataTable DataRowCollection DataRow
- DataColumnCollection DataColumn
- DataConstraintCollection DataConstraint
- DataRelationCollection DataRelation
- DataTableCollection
- and dependencies...
-
-System.Data.Common classes that need to be implemented:
- - implement DataAdapter.cs
- - implement DataColumnMapping.cs
- - implement DataColumnMappingCollection.cs
- - implement DataTableMapping.cs
- - implement DataTableMappingCollection.cs
- - implement DbDataAdapter.cs
- - implement DbDataPermission.cs
- - implement DbDataPermissionAttribute.cs
- - implement RowUpdatedEventArgs.cs
- - implement RowUpdatingEventArgs.cs
-
-The following classes implement InternalDataCollectionBase:
- * DataRowCollection
- * DataColumnCollection
- * DataTableCollection
- * DataRelationCollection - an abstract class used by DataTable and DataSet
- * ConstraintCollection
-
-DataTableRelationCollection is an internal class that implements DataRelationCollection
-and is used by DataTable for parent/child relations. Don't know if it will/will not
-be used by DataSet.
-
-Other classes, structs, etc. that are missing:
- DataRowView
- DataSysDescriptionAttribute
- DataViewManager
- DataViewSetting
- FillErrorEventArgs
- MergeFailedEventArgs
- TypedDataSetGenerator
-
-The additional System.Data.SqlTypes classes need to be implemented:
- SqlByte
- SqlDataTime
- SqlDecimal
- SqlDouble
- SqlGuid
- SqlInt16
- SqlInt64
- SqlMoney
- SqlSingle
-
-* provide a standard scheme for storing
- connection string data
-
-* allow Execute methods in SqlCommand to
- call a stored procedure
-
-* Create a script for testing System.Data:
- - calls script to create
- a test database named monotestdb
- - set up nunit for testing System.Data
- - set up System.Data.Config or some other
- file to hold connection strings and other
- configuration settings for the testing System.Data
- - any other stuff needed...
-
-* get SqlParameter/SqlParameterCollection
- working so you can:
- - for queries/commands that have parameters:
- o input
- o output
- o return
- o input/output
- - call a stored procedure with parameters
-
-* be able to return a XmlReader from
- using method ExecuteXmlReader of
- a SqlCommand object
-
-* get SqlDataAdapter/DataSet working
-
-* Create Library for PInvoking into libgda
- This will be used by System.Data.OleDb classes
-
-* Begin System.Data.OleDb classes:
- - OleDbConnection
- - OleDbCommand
- - OleDbTransaction
-
-* Do more of the OleDb classes to
- retrieve a OleDbDataReader object
- from a query (SELECT FROM):
- - OleDbDataReader
- - others...
-
-* Do more OleDb classes for DataSet:
- - OleDbDataAdapter
- - others...
-
-* Security Audit of System.Data
-
-* Create a MySQL ADO.NET Provider
-
-* Create an Oracle ADO.NET Provider
-
-* Create an Interbase ADO.NET Provider
-
-* Create a Sybase ADO.NET Provider (TDS?)
-
-* Create an IBM UDB DB2 ADO.NET Provider
-
-* Create other ADO.NET providers...
-
-Integration
-===========
-
-* get System.Data to work with ASP.NET's
- System.Web.UI.WebControls.DataGrid
-
-* get System.Data to work with GUI
- System.Windows.Forms.DataGrid
-
diff --git a/mcs/class/System.Data/Test/.cvsignore b/mcs/class/System.Data/Test/.cvsignore
deleted file mode 100644
index 335c71fd7fa..00000000000
--- a/mcs/class/System.Data/Test/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.dll
-*.pdb
diff --git a/mcs/class/System.Data/Test/AllTests.cs b/mcs/class/System.Data/Test/AllTests.cs
deleted file mode 100644
index 3d64c22297d..00000000000
--- a/mcs/class/System.Data/Test/AllTests.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Author: Tim Coleman (tim@timcoleman.com)
-// Copyright 2002 Tim Coleman
-
-using System;
-using System.Data;
-using System.Data.SqlTypes;
-using NUnit.Framework;
-
-namespace MonoTests {
- public class AllTests : TestCase {
- public AllTests (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (System.Data.SqlTypes.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/ChangeLog b/mcs/class/System.Data/Test/ChangeLog
deleted file mode 100644
index 8b362897dba..00000000000
--- a/mcs/class/System.Data/Test/ChangeLog
+++ /dev/null
@@ -1,85 +0,0 @@
-2002-05-27 Tim Coleman <tim@timcoleman.com>
- * TestSqlDataAdapter.cs: remove explicit opening of connection.
- This should occur implicitly now.
-
-2002-05-23 Daniel Morgan <danmorg@sc.rr.com>
-
- * TestSqlParameters.cs: read and display the schema columns
- correctly
-
-2002-05-16 Tim Coleman <tim@timcoleman.com>
- * TestSqlDataAdapter.cs: Added the foreach loop to iterate through
- all of the DataRows in the DataSet table "Table", as the
- GetEnumerator method of InternalDataCollectionBase has now been
- implemented.
-
-
-2002/05/17 Nick Drochak <ndrochak@gol.com>
-
- * System.Data_test.build: Remove RunTests from the default build. We
- can add this later, but it keeps the build from breaking for now.
-
- * TestSqlDataAdapter.cs: Fix build breaker.
-
-2002-05-11 Daniel Morgan <danmorg@sc.rr.com>
-
- * Test/PostgresTest.cs: added call to PostgreSQL stored procedure
- version() which returns the version of the PostgreSQL DBMS you
- are connected to. This works and I did not realize it. Thanks
- goes to Gonzalo.
-
-2002-05-11 Daniel Morgan <danmorg@sc.rr.com>
-
- * AllTests.cs: needed a using for System.Data and System.Data.SqlClient,
- changed SqlTypes.AllTests.Suite to System.Data.SqlTypes.AllTests.Suite
-
- * System.Data/DataColumnTest.cs: changed typeof to DataColumnTest
-
-2002-05-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * TestDataColumn.cs: removed.
-
- * System.Data_test.build: removed reference to TestDataColumn.
-
- * TheTests.cs: added RunDataColumnTest class.
- (RunAllTests.AddAllTests): added test for RunDataColumnTest.
-
- * System.Data/AllTests.cs: test suite for System.Data.
-
- * System.Data/DataColumnTest.cs: NUnit test for DataColumn.
-
-2002-05-09 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data_test.build: exclude file TestDataColumn.cs
- test.build files have two places where a file needs to
- be excluded
-
-2002-05-06 Daniel Morgan <danmorg@sc.rr.com>
-
- * System.Data.SqlTypes.SqlInt32Test.cs: missing
- declaration for SqlInt32 z which was a test build blocker
-
- * PostgresTest.cs: got rid of warning about missing e
-
- * Test/PostgresTest.cs: exclude PostgresTest.cs
- from test build
-
-2002-05-05 Tim Coleman <tim@timcoleman.com>
- * TheTests.cs:
- * System.Data.SqlTypes/SqlInt32Test.cs:
- More test cases for System.Data.SqlTypes.SqlInt32
-
-2002-05-03 Tim Coleman <tim@timcoleman.com>
- * Added ChangeLog to test dir
- * Added NUnit framework necessary for make test
- * Added subdirectory for System.Data.SqlTypes
- * New files:
- ChangeLog
- AllTests.cs
- TheTests.cs
- System.Data_test.build
- System.Data.SqlTypes
- System.Data.SqlTypes/AllTests.cs
- System.Data.SqlTypes/SqlInt32Test.cs
-
-
diff --git a/mcs/class/System.Data/Test/PostgresTest.cs b/mcs/class/System.Data/Test/PostgresTest.cs
deleted file mode 100644
index 645673185e6..00000000000
--- a/mcs/class/System.Data/Test/PostgresTest.cs
+++ /dev/null
@@ -1,510 +0,0 @@
-/* PostgresTest.cs - based on the postgres-test.c in libgda
- *
- * Copyright (C) 2002 Gonzalo Paniagua Javier
- * Copyright (C) 2002 Daniel Morgan
- *
- * ORIGINAL AUTHOR:
- * Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
- * PORTING FROM C TO C# AUTHOR:
- * Daniel Morgan <danmorg@sc.rr.com>
- *
- * Permission was given from the original author, Gonzalo Paniagua Javier,
- * to port and include his original work in Mono.
- *
- * The original work falls under the LGPL, but the port to C# falls
- * under the X11 license.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program 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 General Public
- * License along with this program; see the file COPYING. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-using System;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient {
-
- class PostgresTest {
-
- // execute SQL CREATE TABLE Command using ExecuteNonQuery()
- static void CreateTable (IDbConnection cnc) {
-
- IDbCommand createCommand = cnc.CreateCommand();
-
- createCommand.CommandText =
- "create table mono_postgres_test (" +
- "boolean_value boolean, " +
- "int2_value smallint, " +
- "int4_value integer, " +
- "bigint_value bigint, " +
- "float_value real, " +
- "double_value double precision, " +
- "numeric_value numeric(15, 3), " +
- "char_value char(50), " +
- "varchar_value varchar(20), " +
- "text_value text, " +
- "point_value point, " +
- "time_value time, " +
- "date_value date, " +
- "timestamp_value timestamp, " +
- "null_boolean_value boolean, " +
- "null_int2_value smallint, " +
- "null_int4_value integer, " +
- "null_bigint_value bigint, " +
- "null_float_value real, " +
- "null_double_value double precision, " +
- "null_numeric_value numeric(15, 3), " +
- "null_char_value char(50), " +
- "null_varchar_value varchar(20), " +
- "null_text_value text, " +
- "null_point_value point, " +
- "null_time_value time, " +
- "null_date_value date, " +
- "null_timestamp_value timestamp " +
- ")";
-
- createCommand.ExecuteNonQuery ();
- }
-
- // execute SQL DROP TABLE Command using ExecuteNonQuery
- static void DropTable (IDbConnection cnc) {
-
- IDbCommand dropCommand = cnc.CreateCommand ();
-
- dropCommand.CommandText =
- "drop table mono_postgres_test";
-
- dropCommand.ExecuteNonQuery ();
- }
-
- // execute stored procedure using ExecuteScalar()
- static object CallStoredProcedure (IDbConnection cnc) {
-
- IDbCommand callStoredProcCommand = cnc.CreateCommand ();
- object data;
-
- callStoredProcCommand.CommandType =
- CommandType.StoredProcedure;
- callStoredProcCommand.CommandText =
- "version";
-
- data = callStoredProcCommand.ExecuteScalar ();
-
- return data;
- }
-
- // execute SQL INSERT Command using ExecuteNonQuery()
- static void InsertData (IDbConnection cnc) {
-
- IDbCommand insertCommand = cnc.CreateCommand();
-
- insertCommand.CommandText =
- "insert into mono_postgres_test (" +
- "boolean_value, " +
- "int2_value, " +
- "int4_value, " +
- "bigint_value, " +
- "float_value, " +
- "double_value, " +
- "numeric_value, " +
- "char_value, " +
- "varchar_value, " +
- "text_value, " +
- "time_value, " +
- "date_value, " +
- "timestamp_value, " +
- "point_value " +
- ") values (" +
- "'T', " +
- "-22, " +
- "1048000, " +
- "123456789012345, " +
- "3.141592, " +
- "3.1415926969696, " +
- "123456789012.345, " +
- "'This is a char', " +
- "'This is a varchar', " +
- "'This is a text', " +
- "'21:13:14', " +
- "'2000-02-29', " +
- "'2004-02-29 14:00:11.31', " +
- "'(1,0)' " +
- ")";
-
- insertCommand.ExecuteNonQuery ();
- }
-
- // execute a SQL SELECT Query using ExecuteReader() to retrieve
- // a IDataReader so we retrieve data
- static IDataReader SelectData (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- // FIXME: System.Data classes need to handle NULLs
- // this would be done by System.DBNull ?
- // FIXME: System.Data needs to handle more data types
- /*
- selectCommand.CommandText =
- "select * " +
- "from mono_postgres_test";
- */
-
- selectCommand.CommandText =
- "select " +
- "boolean_value, " +
- "int2_value, " +
- "int4_value, " +
- "bigint_value, " +
- "float_value, " +
- "double_value, " +
- "numeric_value, " +
- "char_value, " +
- "varchar_value, " +
- "text_value, " +
- "point_value, " +
- "time_value, " +
- "date_value, " +
- "timestamp_value, " +
- "null_boolean_value, " +
- "null_int2_value, " +
- "null_int4_value, " +
- "null_bigint_value, " +
- "null_float_value, " +
- "null_double_value, " +
- "null_numeric_value, " +
- "null_char_value, " +
- "null_varchar_value, " +
- "null_text_value, " +
- "null_point_value, " +
- "null_time_value, " +
- "null_date_value, " +
- "null_timestamp_value " +
- "from mono_postgres_test";
-
- reader = selectCommand.ExecuteReader ();
-
- return reader;
- }
-
- // Tests a SQL Command (INSERT, UPDATE, DELETE)
- // executed via ExecuteReader
- static IDataReader SelectDataUsingInsertCommand (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- // This is a SQL INSERT Command, not a Query
- selectCommand.CommandText =
- "insert into mono_postgres_test (" +
- "boolean_value, " +
- "int2_value, " +
- "int4_value, " +
- "bigint_value, " +
- "float_value, " +
- "double_value, " +
- "numeric_value, " +
- "char_value, " +
- "varchar_value, " +
- "text_value, " +
- "time_value, " +
- "date_value, " +
- "timestamp_value, " +
- "point_value " +
- ") values (" +
- "'T', " +
- "-22, " +
- "1048000, " +
- "123456789012345, " +
- "3.141592, " +
- "3.1415926969696, " +
- "123456789012.345, " +
- "'This is a char', " +
- "'This is a varchar', " +
- "'This is a text', " +
- "'21:13:14', " +
- "'2000-02-29', " +
- "'2004-02-29 14:00:11.31', " +
- "'(1,0)' " +
- ")";
-
- reader = selectCommand.ExecuteReader ();
-
- return reader;
- }
-
- // Tests a SQL Command not (INSERT, UPDATE, DELETE)
- // executed via ExecuteReader
- static IDataReader SelectDataUsingCommand (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- // This is a SQL Command, not a Query
- selectCommand.CommandText =
- "SET DATESTYLE TO 'ISO'";
-
- reader = selectCommand.ExecuteReader ();
-
- return reader;
- }
-
-
- // execute an SQL UPDATE Command using ExecuteNonQuery()
- static void UpdateData (IDbConnection cnc) {
-
- IDbCommand updateCommand = cnc.CreateCommand();
-
- updateCommand.CommandText =
- "update mono_postgres_test " +
- "set " +
- "boolean_value = 'F', " +
- "int2_value = 5, " +
- "int4_value = 3, " +
- "bigint_value = 9, " +
- "char_value = 'Mono.Data!' , " +
- "varchar_value = 'It was not me!', " +
- "text_value = 'We got data!' " +
- "where int2_value = -22";
-
- updateCommand.ExecuteNonQuery ();
- }
-
- // used to do a min(), max(), count(), sum(), or avg()
- // execute SQL SELECT Query using ExecuteScalar
- static object SelectAggregate (IDbConnection cnc, String agg) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- object data;
-
- Console.WriteLine("Aggregate: " + agg);
-
- selectCommand.CommandType = CommandType.Text;
- selectCommand.CommandText =
- "select " + agg +
- "from mono_postgres_test";
-
- data = selectCommand.ExecuteScalar ();
-
- Console.WriteLine("Agg Result: " + data);
-
- return data;
- }
-
- // used internally by ReadData() to read each result set
- static void ReadResult(IDataReader rdr, DataTable dt) {
-
- // number of columns in the table
- Console.WriteLine(" Total Columns: " +
- dt.Rows.Count);
-
- // display the schema
- foreach (DataRow schemaRow in dt.Rows) {
- foreach (DataColumn schemaCol in dt.Columns)
- Console.WriteLine(schemaCol.ColumnName +
- " = " +
- schemaRow[schemaCol]);
- Console.WriteLine();
- }
-
- int nRows = 0;
- int c = 0;
- string output, metadataValue, dataValue;
- // Read and display the rows
- Console.WriteLine("Gonna do a Read() now...");
- while(rdr.Read()) {
- Console.WriteLine(" Row " + nRows + ": ");
-
- for(c = 0; c < rdr.FieldCount; c++) {
- // column meta data
- DataRow dr = dt.Rows[c];
- metadataValue =
- " Col " +
- c + ": " +
- dr["ColumnName"];
-
- // column data
- if(rdr.IsDBNull(c) == true)
- dataValue = " is NULL";
- else
- dataValue =
- ": " +
- rdr.GetValue(c);
-
- // display column meta data and data
- output = metadataValue + dataValue;
- Console.WriteLine(output);
- }
- nRows++;
- }
- Console.WriteLine(" Total Rows Retrieved: " +
- nRows);
- }
-
- // Used to read data from IDataReader after calling IDbCommand:ExecuteReader()
- static void ReadData(IDataReader rdr) {
-
- int results = 0;
- if(rdr == null) {
-
- Console.WriteLine("IDataReader has a Null Reference.");
- }
- else {
- do {
- DataTable dt = rdr.GetSchemaTable();
- if(rdr.RecordsAffected != -1) {
- // Results for
- // SQL INSERT, UPDATE, DELETE Commands
- // have RecordsAffected >= 0
- Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- }
- else if(dt == null)
- // Results for
- // SQL Commands not INSERT, UPDATE, nor DELETE
- // have RecordsAffected == -1
- // and GetSchemaTable() returns a null reference
- Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- else {
- // Results for
- // SQL SELECT Queries
- // have RecordsAffected = -1
- // and GetSchemaTable() returns a reference to a DataTable
- Console.WriteLine("Result is from a SELECT SQL Query. Records Affected: " + rdr.RecordsAffected);
-
- results++;
- Console.WriteLine("Result Set " + results + "...");
-
- ReadResult(rdr, dt);
- }
-
- } while(rdr.NextResult());
- Console.WriteLine("Total Result sets: " + results);
-
- rdr.Close();
- }
- }
-
- /* Postgres provider tests */
- static void DoPostgresTest (IDbConnection cnc) {
-
- IDataReader reader;
- Object oDataValue;
-
- Console.WriteLine ("\tPostgres provider specific tests...\n");
-
- /* Drops the gda_postgres_test table. */
- Console.WriteLine ("\t\tDrop table: ");
- try {
- DropTable (cnc);
- Console.WriteLine ("OK");
- }
- catch (SqlException e) {
- Console.WriteLine("Error (don't worry about this one)" + e);
- }
-
- try {
- /* Creates a table with all supported data types */
- Console.WriteLine ("\t\tCreate table with all supported types: ");
- CreateTable (cnc);
- Console.WriteLine ("OK");
-
- /* Inserts values */
- Console.WriteLine ("\t\tInsert values for all known types: ");
- InsertData (cnc);
- Console.WriteLine ("OK");
-
- /* Update values */
- Console.WriteLine ("\t\tUpdate values: ");
- UpdateData (cnc);
- Console.WriteLine ("OK");
-
- /* Inserts values */
- Console.WriteLine ("\t\tInsert values for all known types: ");
- InsertData (cnc);
- Console.WriteLine ("OK");
-
- /* Select aggregates */
- SelectAggregate (cnc, "count(*)");
- // FIXME: still having a problem with avg()
- // because it returns a decimal.
- // It may have something to do
- // with culture not being set
- // properly.
- //SelectAggregate (cnc, "avg(int4_value)");
- SelectAggregate (cnc, "min(text_value)");
- SelectAggregate (cnc, "max(int4_value)");
- SelectAggregate (cnc, "sum(int4_value)");
-
- /* Select values */
- Console.WriteLine ("\t\tSelect values from the database: ");
- reader = SelectData (cnc);
- ReadData(reader);
-
- /* SQL Command via ExecuteReader/SqlDataReader */
- /* Command is not INSERT, UPDATE, or DELETE */
- Console.WriteLine("\t\tCall ExecuteReader with a SQL Command. (Not INSERT,UPDATE,DELETE).");
- reader = SelectDataUsingCommand(cnc);
- ReadData(reader);
-
- /* SQL Command via ExecuteReader/SqlDataReader */
- /* Command is INSERT, UPDATE, or DELETE */
- Console.WriteLine("\t\tCall ExecuteReader with a SQL Command. (Is INSERT,UPDATE,DELETE).");
- reader = SelectDataUsingInsertCommand(cnc);
- ReadData(reader);
-
- // Call a Stored Procedure named Version()
- Console.WriteLine("\t\tCalling stored procedure version()");
- object obj = CallStoredProcedure(cnc);
- Console.WriteLine("Result: " + obj);
-
- Console.WriteLine("Database Server Version: " +
- ((SqlConnection)cnc).ServerVersion);
-
- /* Clean up */
- Console.WriteLine ("Clean up...");
- Console.WriteLine ("\t\tDrop table...");
- DropTable (cnc);
- Console.WriteLine("OK");
- }
- catch(Exception e) {
- Console.WriteLine("Exception caught: " + e);
- }
- }
-
- [STAThread]
- static void Main(string[] args) {
- SqlConnection cnc = new SqlConnection ();
-
- /*
- string connectionString =
- "host=hostname;" +
- "dbname=database;" +
- "user=userid;" +
- "password=password";
- */
-
- string connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres;";
-
- cnc.ConnectionString = connectionString;
-
- cnc.Open();
- DoPostgresTest(cnc);
- cnc.Close();
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/ReadPostgresData.cs b/mcs/class/System.Data/Test/ReadPostgresData.cs
deleted file mode 100644
index c1fc05b0a19..00000000000
--- a/mcs/class/System.Data/Test/ReadPostgresData.cs
+++ /dev/null
@@ -1,585 +0,0 @@
-//
-// ReadPostgresData.cs
-//
-// Uses the PostgresLibrary to retrieve a recordset.
-// This is not meant to be used in Production, but as a
-// learning aid in coding class System.Data.SqlClient.SqlDataReader.
-//
-// Bits of code were borrowed from libgda.
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) 2002 Daniel Morgan
-//
-
-using System;
-using System.Data;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-
-namespace LearnToCreateSqlDataReader
-{
- sealed public class PostgresHelper {
-
- public static object OidTypeToSystem (int oid, string value) {
- object obj = null;
-
- Console.WriteLine("===== oid: " + oid + " value: " + value);
-
- switch(oid) {
- case 1043: // varchar
- Console.WriteLine("oid 1023 varchar ==> String found");
- obj = (object) String.Copy(value); // String
- break;
- case 25: // text
- Console.WriteLine("oid 25 text ==> String found");
- obj = (object) String.Copy(value); // String
- break;
- case 18: // char
- Console.WriteLine("oid 18 char ==> String found");
- obj = (object) String.Copy(value); // String
- break;
- case 16: // bool
- Console.WriteLine("oid 16 bool ==> Boolean found");
- obj = (object) Boolean.Parse(value);
- break;
- case 21: // int2
- Console.WriteLine("oid 21 int2 ==> Int16 found");
- obj = (object) Int16.Parse(value);
- break;
- case 23: // int4
- Console.WriteLine("oid 23 int4 ==> Int32 found");
- obj = (object) Int32.Parse(value);
- break;
- case 20: // int8
- Console.WriteLine("oid 20 int8 ==> Int64 found");
- obj = (object) Int64.Parse(value);
- break;
- default:
- Console.WriteLine("OidTypeToSystem Not Done Yet: oid: " +
- oid + " Value: " + value);
- break;
-
- }
-
- return obj;
- }
-
- public static Type OidToType (int oid) {
- Type typ = null;
-
- switch(oid) {
- case 1043: // varchar
- case 25: // text
- case 18: // char
- typ = typeof(String);
- break;
- case 16: // bool
- typ = typeof(Boolean);
- break;
- case 21: // int2
- typ = typeof(Int16);
- break;
- case 23: // int4
- typ = typeof(Int32);
- break;
- case 20: // int8
- typ = typeof(Int64);
- break;
- default:
- throw new NotImplementedException(
- "PGNI2: PostgreSQL oid type " + oid +
- " not mapped to .NET System Type.");
- }
- return typ;
- }
-
- }
-
- sealed public class PostgresLibrary {
-
- public enum ConnStatusType {
- CONNECTION_OK,
- CONNECTION_BAD,
- CONNECTION_STARTED,
- CONNECTION_MADE,
- CONNECTION_AWAITING_RESPONSE,
- CONNECTION_AUTH_OK,
- CONNECTION_SETENV
- }
-
- public enum PostgresPollingStatusType {
- PGRES_POLLING_FAILED = 0,
- PGRES_POLLING_READING,
- PGRES_POLLING_WRITING,
- PGRES_POLLING_OK,
- PGRES_POLLING_ACTIVE
- }
-
- public enum ExecStatusType {
- PGRES_EMPTY_QUERY = 0,
- PGRES_COMMAND_OK,
- PGRES_TUPLES_OK,
- PGRES_COPY_OUT,
- PGRES_COPY_IN,
- PGRES_BAD_RESPONSE,
- PGRES_NONFATAL_ERROR,
- PGRES_FATAL_ERROR
- }
-
-
- [DllImport("pq")]
- public static extern string PQerrorMessage (IntPtr conn);
- // char *PQerrorMessage(const PGconn *conn);
-
- [DllImport("pq")]
- public static extern IntPtr PQconnectdb(String conninfo);
- // PGconn *PQconnectdb(const char *conninfo)
-
- [DllImport("pq")]
- public static extern void PQfinish(IntPtr conn);
- // void PQfinish(PGconn *conn)
-
- [DllImport("pq")]
- public static extern IntPtr PQexec(IntPtr conn,
- String query);
- // PGresult *PQexec(PGconn *conn, const char *query);
-
- [DllImport("pq")]
- public static extern int PQntuples (IntPtr res);
- // int PQntuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQnfields (IntPtr res);
- // int PQnfields(const PGresult *res);
-
- [DllImport("pq")]
- public static extern ConnStatusType PQstatus (IntPtr conn);
- // ConnStatusType PQstatus(const PGconn *conn);
- [DllImport("pq")]
- public static extern ExecStatusType PQresultStatus (IntPtr res);
- // ExecStatusType PQresultStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQresStatus (ExecStatusType status);
- // char *PQresStatus(ExecStatusType status);
-
- [DllImport("pq")]
- public static extern string PQresultErrorMessage (IntPtr res);
- // char *PQresultErrorMessage(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQbinaryTuples (IntPtr res);
- // int PQbinaryTuples(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQfname (IntPtr res,
- int field_num);
- // char *PQfname(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfnumber (IntPtr res,
- string field_name);
- // int PQfnumber(const PGresult *res,
- // const char *field_name);
-
-
- [DllImport("pq")]
- public static extern int PQfmod (IntPtr res, int field_num);
- // int PQfmod(const PGresult *res, int field_num);
-
- [DllImport("pq")]
- public static extern int PQftype (IntPtr res,
- int field_num);
- // Oid PQftype(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern int PQfsize (IntPtr res,
- int field_num);
- // int PQfsize(const PGresult *res,
- // int field_num);
-
- [DllImport("pq")]
- public static extern string PQcmdStatus (IntPtr res);
- // char *PQcmdStatus(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQoidStatus (IntPtr res);
- // char *PQoidStatus(const PGresult *res);
-
- [DllImport("pq")]
- public static extern int PQoidValue (IntPtr res);
- // Oid PQoidValue(const PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQcmdTuples (IntPtr res);
- // char *PQcmdTuples(PGresult *res);
-
- [DllImport("pq")]
- public static extern string PQgetvalue (IntPtr res,
- int tup_num, int field_num);
- // char *PQgetvalue(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetlength (IntPtr res,
- int tup_num, int field_num);
- // int PQgetlength(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern int PQgetisnull (IntPtr res,
- int tup_num, int field_num);
- // int PQgetisnull(const PGresult *res,
- // int tup_num, int field_num);
-
- [DllImport("pq")]
- public static extern void PQclear (IntPtr res);
- // void PQclear(PGresult *res);
-
-
- }
-
- public class ReadPostgresData
- {
-
- static void Test(String sConnInfo) {
- String errorMessage;
-
- IntPtr pgConn;
- PostgresLibrary.ConnStatusType connStatus;
-
- String sQuery;
- IntPtr pgResult;
-
- sQuery =
- "select tid, tdesc, aint4, abpchar " +
- "from sometable ";
-
- pgConn = PostgresLibrary.PQconnectdb (sConnInfo);
-
- connStatus = PostgresLibrary.PQstatus (pgConn);
- if(connStatus ==
- PostgresLibrary.
- ConnStatusType.CONNECTION_OK) {
-
- Console.WriteLine("CONNECTION_OK");
-
- Console.WriteLine("SQL: " + sQuery);
- pgResult = PostgresLibrary.PQexec(pgConn, sQuery);
-
- PostgresLibrary.ExecStatusType execStatus;
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus ==
- PostgresLibrary.
- ExecStatusType.PGRES_TUPLES_OK)
- {
- Console.WriteLine("PGRES_TUPLES_OK");
-
- int nRows = PostgresLibrary.
- PQntuples(pgResult);
- Console.WriteLine("Rows: " + nRows);
-
- int nFields = PostgresLibrary.
- PQnfields(pgResult);
- Console.WriteLine("Columns: " + nFields);
-
-
- String fieldName;
-
- // get meta data fromm result set (schema)
- // for each column (field)
- for(int fieldIndex = 0;
- fieldIndex < nFields;
- fieldIndex ++) {
-
- // get column name
- fieldName = PostgresLibrary.
- PQfname(pgResult, fieldIndex);
-
- Console.WriteLine("Field " +
- fieldIndex + ": " +
- fieldName);
-
- int oid;
- // get PostgreSQL data type (OID)
- oid = PostgresLibrary.
- PQftype(pgResult, fieldIndex);
-
- Console.WriteLine("Data Type oid: " + oid);
-
- int definedSize;
- // get defined size of column
- definedSize = PostgresLibrary.
- PQfsize(pgResult, fieldIndex);
-
- Console.WriteLine("definedSize: " +
- definedSize);
- }
-
- // for each row and column, get the data value
- for(int row = 0;
- row < nRows;
- row++) {
-
- for(int col = 0;
- col < nFields;
- col++) {
-
- String value;
- // get data value
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- row, col);
-
- Console.WriteLine("Row: " + row +
- " Col: " + col);
- Console.WriteLine("Value: " +
- value);
-
- int columnIsNull;
- // is column NULL?
- columnIsNull = PostgresLibrary.
- PQgetisnull(pgResult,
- row, col);
-
- Console.WriteLine("Data is " +
- (columnIsNull == 0 ? "NOT NULL" : "NULL"));
-
-
- int actualLength;
- // get Actual Length
- actualLength = PostgresLibrary.
- PQgetlength(pgResult,
- row, col);
-
- Console.WriteLine("Actual Length: " +
- actualLength);
- }
- }
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- }
- else {
- // display execution error
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- Console.WriteLine(errorMessage);
- }
-
- // close database conneciton
- PostgresLibrary.PQfinish(pgConn);
-
- }
- else {
- errorMessage = PostgresLibrary.
- PQerrorMessage (pgConn);
- errorMessage += ": Could not connect to database.";
- Console.WriteLine(errorMessage);
- }
-
- }
-
- public static object ExecuteScalar(string sConnInfo, string sQuery) {
- object obj = null; // return
-
- int nRow;
- int nCol;
-
- String errorMessage;
-
- IntPtr pgConn;
- PostgresLibrary.ConnStatusType connStatus;
-
- IntPtr pgResult;
-
- pgConn = PostgresLibrary.PQconnectdb (sConnInfo);
-
- connStatus = PostgresLibrary.PQstatus (pgConn);
- if(connStatus ==
- PostgresLibrary.
- ConnStatusType.CONNECTION_OK) {
-
- Console.WriteLine("CONNECTION_OK");
-
- pgResult = PostgresLibrary.PQexec(pgConn, sQuery);
-
- PostgresLibrary.ExecStatusType execStatus;
-
- execStatus = PostgresLibrary.
- PQresultStatus (pgResult);
-
- if(execStatus ==
- PostgresLibrary.
- ExecStatusType.PGRES_TUPLES_OK) {
-
- Console.WriteLine("PGRES_TUPLES_OK");
-
- int nRows = PostgresLibrary.
- PQntuples(pgResult);
- Console.WriteLine("Rows: " + nRows);
-
- int nFields = PostgresLibrary.
- PQnfields(pgResult);
- Console.WriteLine("Columns: " + nFields);
- if(nRows > 0 && nFields > 0) {
- nRow = 0;
- nCol = 0;
-
- // get column name
- String fieldName;
- fieldName = PostgresLibrary.
- PQfname(pgResult, nCol);
-
- Console.WriteLine("Field " +
- nCol + ": " +
- fieldName);
-
- int oid;
-
- // get PostgreSQL data type (OID)
- oid = PostgresLibrary.
- PQftype(pgResult, nCol);
-
- Console.WriteLine("Data Type oid: " + oid);
-
- int definedSize;
- // get defined size of column
- definedSize = PostgresLibrary.
- PQfsize(pgResult, nCol);
-
- Console.WriteLine("DefinedSize: " +
- definedSize);
-
- String value;
- // get data value
- value = PostgresLibrary.
- PQgetvalue(
- pgResult,
- nRow, nCol);
-
- Console.WriteLine("Row: " + nRow +
- " Col: " + nCol);
- Console.WriteLine("Value: " + value);
-
- int columnIsNull;
- // is column NULL?
- columnIsNull = PostgresLibrary.
- PQgetisnull(pgResult,
- nRow, nCol);
-
- // isNull = *thevalue != '\0' ? FALSE : PQgetisnull (pg_res, rownum, i);
-
- Console.WriteLine("Data is " +
- (columnIsNull == 0 ? "NOT NULL" : "NULL"));
-
- int actualLength;
- // get Actual Length
- actualLength = PostgresLibrary.
- PQgetlength(pgResult,
- nRow, nCol);
-
- Console.WriteLine("Actual Length: " +
- actualLength);
-
- obj = PostgresHelper.
- OidTypeToSystem (oid, value);
- }
-
- // close result set
- PostgresLibrary.PQclear (pgResult);
- }
- else {
- // display execution error
- errorMessage = PostgresLibrary.
- PQresStatus(execStatus);
-
- errorMessage += " " + PostgresLibrary.
- PQresultErrorMessage(pgResult);
-
- Console.WriteLine(errorMessage);
- }
-
- // close database conneciton
- PostgresLibrary.PQfinish(pgConn);
-
- }
- else {
- errorMessage = PostgresLibrary.
- PQerrorMessage (pgConn);
- errorMessage += ": Could not connect to database.";
- Console.WriteLine(errorMessage);
- }
-
- return obj;
- }
-
- static void TestExecuteScalar(String connString) {
- String selectStatement;
-
- try {
- selectStatement =
- "select count(*) " +
- "from sometable";
-
- Int64 myCount = (Int64) ExecuteScalar(connString,
- selectStatement);
- Console.WriteLine("Count: " + myCount);
-
- selectStatement =
- "select max(tdesc) " +
- "from sometable";
- string myMax = (string) ExecuteScalar(connString,
- selectStatement);
- Console.WriteLine("Max: " + myMax);
- }
- catch(Exception e) {
- Console.WriteLine(e);
- }
-
- }
-
- [STAThread]
- static void Main(string[] args)
- {
- // PostgreSQL DBMS Connection String
- // Notice how the parameters are separated with spaces
- // An OLE-DB Connection String uses semicolons to
- // separate parameters.
- String sConnInfo =
- "host=localhost " +
- "dbname=test " +
- "user=postgres";
-
- Test(sConnInfo);
-
- TestExecuteScalar(sConnInfo);
-
- Type t;
- int oid;
-
- oid = 1043;
- t = PostgresHelper.OidToType(oid); // varchar ==> String
- Console.WriteLine("OidToType varchar oid: " + oid +
- " ==> t: " + t.ToString());
-
- oid = 23;
- t = PostgresHelper.OidToType(oid); // int4 ==> Int32
- Console.WriteLine("OidToType int4 oid: " + oid +
- " ==> t: " + t.ToString());
-
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/SqlSharpCli.cs b/mcs/class/System.Data/Test/SqlSharpCli.cs
deleted file mode 100644
index c29cb730847..00000000000
--- a/mcs/class/System.Data/Test/SqlSharpCli.cs
+++ /dev/null
@@ -1,624 +0,0 @@
-//
-// SqlSharpCli.cs - main driver for SqlSharp
-//
-// Currently, only working on a command line interface for SqlSharp
-//
-// However, once GTK# and System.Windows.Forms are good-to-go,
-// I would like to create a SqlSharpGui using this.
-//
-// It would be nice if this is included as part of Mono
-// extra goodies under Mono.Data.SqlSharp.
-//
-// Also, this makes a good Test program for Mono System.Data.
-// For more information about Mono::,
-// visit http://www.go-mono.com/
-//
-// To build SqlSharpCli.cs:
-// $ mcs SqlSharpCli.cs -r System.Data.dll -r Mono.Data.MySql.dll
-//
-// To run with mono:
-// $ mono SqlSharpCli.exe
-//
-// To run with mint:
-// $ mint SqlSharpCli.exe
-//
-// To run batch commands and get the output, do something like:
-// $ cat commands.txt | mono SqlSharpCli.exe > results.txt
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C)Copyright 2002 Daniel Morgan
-//
-
-using Mono.Data.MySql;
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Data.SqlClient;
-using System.IO;
-using System.Text;
-
-namespace Mono.Data.SqlSharp {
-
- // SQL Sharp - Command Line Interface
- public class SqlSharpCli {
-
- private IDbConnection conn = null;
- private string provider = "POSTGRESCLIENT";
- private StringBuilder build = null; // SQL string to build
- private string connectionString =
- "host=localhost;dbname=test;user=postgres";
- private string inputFilename = "";
- private string outputFilename = "";
- private bool silent = false;
-
- // DisplayResult - used to Read() display a result set
- // called by DisplayData()
- public void DisplayResult(IDataReader reader, DataTable schemaTable) {
-
- StringBuilder line = null;
- StringBuilder hdrUnderline = null;
-
- int spacing = 0;
- int columnSize = 0;
- int c;
-
- char spacingChar = ' '; // a space
- char underlineChar = '='; // an equal sign
-
- string dataType; // .NET Type
- string dataTypeName; // native Database type
- DataRow row; // schema row
-
- line = new StringBuilder();
- hdrUnderline = new StringBuilder();
-
- Console.WriteLine("Fields in Query Result: " +
- reader.FieldCount);
- Console.WriteLine();
-
- for(c = 0; c < schemaTable.Rows.Count; c++) {
-
- DataRow schemaRow = schemaTable.Rows[c];
- string columnHeader = (string) schemaRow["ColumnName"];
- int columnHeaderSize = columnHeader.Length;
-
- line.Append(columnHeader);
- hdrUnderline.Append(underlineChar, columnHeaderSize);
-
- // spacing
- columnSize = (int) schemaRow["ColumnSize"];
- dataType = (string) schemaRow["DataType"];
- dataTypeName = reader.GetDataTypeName(c);
-
- // columnSize correction based on data type
- if(dataType.Equals("System.Boolean")) {
- columnSize = 5;
- }
- if(provider.Equals("POSTGRESCLIENT"))
- if(dataTypeName.Equals("text"))
- columnSize = 32; // text will be truncated to 32
-
- if(columnHeaderSize < columnSize) {
- spacing = columnSize - columnHeaderSize;
- line.Append(spacingChar, spacing);
- hdrUnderline.Append(underlineChar, spacing);
- }
- line.Append(" ");
- hdrUnderline.Append(" ");
- }
- Console.WriteLine(line.ToString());
- line = null;
-
- Console.WriteLine(hdrUnderline);
- Console.WriteLine();
- hdrUnderline = null;
-
- // DEBUG - need to know the columnSize
- /*
- line = new StringBuilder();
- foreach(DataRow schemaRow in schemaTable.Rows) {
- columnSize = (int) schemaRow["ColumnSize"];
- line.Append(columnSize.ToString());
- line.Append(" ");
- }
- Console.WriteLine(line.ToString());
- Console.WriteLine();
- line = null;
- */
-
- int rows = 0;
-
- // column data
- while(reader.Read()) {
- rows++;
-
- line = new StringBuilder();
- for(c = 0; c < reader.FieldCount; c++) {
- int dataLen = 0;
- string dataValue;
-
- row = schemaTable.Rows[c];
- string colhdr = (string) row["ColumnName"];
- columnSize = (int) row["ColumnSize"];
- dataType = (string) row["DataType"];
- dataTypeName = reader.GetDataTypeName(c);
-
- // certain types need to have the
- // columnSize adjusted for display
- // so the column will line up for each
- // row and match the column header size
- if(dataType.Equals("System.Boolean")) {
- columnSize = 5;
- }
- if(provider.Equals("POSTGRESCLIENT"))
- if(dataTypeName.Equals("text"))
- columnSize = 32; // text will be truncated to 32
-
- if(reader.IsDBNull(c)) {
- dataValue = "";
- dataLen = 0;
- }
- else {
- object obj = reader.GetValue(c);
-
- dataValue = obj.ToString();
- dataLen = dataValue.Length;
- line.Append(dataValue);
- }
- line.Append(" ");
-
- // spacing
- spacingChar = ' ';
- if(dataLen < columnSize) {
- spacing = columnSize - dataLen;
- line.Append(spacingChar, spacing);
- }
- spacingChar = ' ';
- if(columnSize < colhdr.Length) {
- spacing = colhdr.Length - columnSize;
- line.Append(spacingChar, spacing);
- }
-
- }
- Console.WriteLine(line.ToString());
- line = null;
- }
- Console.WriteLine("\nRows retrieved: " + rows);
- }
-
- // DisplayData - used to display any Result Sets
- // from execution of SQL SELECT Query or Queries
- // called by DisplayData.
- // ExecuteSql() only calls this function
- // for a Query, it does not get
- // for a Command.
- public void DisplayData(IDataReader reader) {
-
- DataTable schemaTable = null;
- int ResultSet = 0;
-
- Console.WriteLine("Display any result sets...");
-
- do {
- // by Default, SqlDataReader has the
- // first Result set if any
-
- ResultSet++;
- Console.WriteLine("Display the result set " + ResultSet);
-
- schemaTable = reader.GetSchemaTable();
-
- if(reader.RecordsAffected >= 0) {
- // SQL Command (INSERT, UPDATE, or DELETE)
- // RecordsAffected >= 0
- Console.WriteLine("SQL Command Records Affected: " + reader.RecordsAffected);
- }
- else if(schemaTable == null) {
- // SQL Command (not INSERT, UPDATE, nor DELETE)
- // RecordsAffected -1 and DataTable has a null reference
- Console.WriteLine("SQL Command Executed.");
- }
- else {
- // SQL Query (SELECT)
- // RecordsAffected -1 and DataTable has a reference
- DisplayResult(reader, schemaTable);
- }
-
- // get next result set (if anymore is left)
- } while(reader.NextResult());
- }
-
- // ExecuteSql - Execute the SQL Command(s) and/or Query(ies)
- public void ExecuteSql(string sql) {
-
- Console.WriteLine("Execute SQL: " + sql);
-
- IDbCommand cmd = null;
- IDataReader reader = null;
-
- // create a Command object based on the provider
- switch(provider) {
- //case "OLEDB":
- // cmd = new OleDbCommand();
- // break;
- case "MYSQL":
- cmd = new MySqlCommand();
- break;
- case "POSTGRESCLIENT":
- cmd = new SqlCommand();
- break;
- default:
- Console.WriteLine("Error: PostgreSQL is only supported, and it through SqlClient.");
- return;
- }
-
- // set command properties
- cmd.CommandType = CommandType.Text;
- cmd.CommandText = sql;
- cmd.Connection = conn;
-
- try {
- reader = cmd.ExecuteReader();
- DisplayData(reader);
- reader.Close();
- //reader = null;
- //cmd.Dispose();
- //cmd = null;
- }
- catch(Exception e) {
- Console.WriteLine("Exception Caught Executing SQL: " + e);
- //if(reader != null) {
- // if(reader.IsClosed == false)
- // reader.Close();
- // reader = null;
- //}
- // cmd.Dispose();
- //cmd = null;
- }
- }
-
- // like ShowHelp - but only show at the beginning
- // only the most important commands are shown
- // like help and quit
- public void StartupHelp() {
- Console.WriteLine(@"Type: \Q to quit");
- Console.WriteLine(@" \ConnectionString to set the ConnectionString");
- Console.WriteLine(@" \Provider to set the Provider:");
- Console.WriteLine(@" {OleDb,SqlClient,MySql,Odbc,");
- Console.WriteLine(@" OracleClient,PostgresClient}");
- Console.WriteLine(@" \Open to open the connection");
- Console.WriteLine(@" \Close to close the connection");
- Console.WriteLine(@" \Execute to execute SQL command(s)/queries(s)");
- Console.WriteLine(@" \h to show this help.");
- Console.WriteLine(@" \defaults to show default variables.");
- Console.WriteLine();
- }
-
- // ShowHelp - show the help - command a user can enter
- public void ShowHelp() {
- Console.WriteLine("");
- Console.WriteLine(@"Type: \Q to quit");
- Console.WriteLine(@" \ConnectionString to set the ConnectionString");
- Console.WriteLine(@" \Provider to set the Provider:");
- Console.WriteLine(@" {OleDb,SqlClient,MySql,Odbc,");
- Console.WriteLine(@" OracleClient,PostgresClient}");
- Console.WriteLine(@" \Open to open the connection");
- Console.WriteLine(@" \Close to close the connection");
- Console.WriteLine(@" \Execute to execute SQL command(s)/queries(s)");
- Console.WriteLine(@" \f FILENAME to read a batch of commands from");
- Console.WriteLine(@" \o FILENAME to read a batch of commands from");
- Console.WriteLine(@" \h to show this help.");
- Console.WriteLine(@" \defaults to show default variables.");
- Console.WriteLine(@" \s {TRUE, FALSE} to silent messages.");
- Console.WriteLine();
- }
-
- // ShowDefaults - show defaults for connection variables
- public void ShowDefaults() {
- Console.WriteLine();
- Console.WriteLine("The default Provider is " + provider);
- Console.WriteLine();
- Console.WriteLine("The default ConnectionString is: ");
- Console.WriteLine(" \"" + connectionString + "\"");
- Console.WriteLine();
- }
-
- // OpenDataSource - open connection to the data source
- public void OpenDataSource() {
-
- Console.WriteLine("Attempt to Open...");
-
- switch(provider) {
- //case "OLEDB":
- // conn = new OleDbConnection();
- // break;
- case "MYSQL":
- conn = new MySqlConnection();
- break;
- case "POSTGRESCLIENT":
- conn = new SqlConnection();
- break;
- default:
- Console.WriteLine("Error: Bad argument or provider not supported.");
- break;
- }
-
- conn.ConnectionString = connectionString;
-
- try {
- conn.Open();
- if(conn.State == ConnectionState.Open)
- Console.WriteLine("Open was successfully.");
- }
- catch(Exception e) {
- Console.WriteLine("Exception Caught Opening. " + e);
- conn = null;
- }
- }
-
- // CloseDataSource - close the connection to the data source
- public void CloseDataSource() {
- Console.WriteLine("Attempt to Close...");
-
- try {
- conn.Close();
- Console.WriteLine("Close was successfull.");
- }
- catch(Exception e) {
- Console.WriteLine("Exeception Caught Closing. " + e);
- }
- conn = null;
- }
-
- // ChangeProvider - change the provider string variable
- public void ChangeProvider(string[] parms) {
-
- if(parms.Length == 2) {
- string parm = parms[1].ToUpper();
- switch(parm) {
- case "ORACLECLIENT":
- case "ODBC":
- case "GDA":
- Console.WriteLine("Error: Provider not currently supported.");
- break;
- case "SQLCLIENT":
- provider = "POSTGRESCLIENT";
- Console.WriteLine("Warning: Currently, the SqlClient provider is the PostgreSQL provider.");
- break;
- //case "OLEDB":
- case "MYSQL":
- case "POSTGRESCLIENT":
- provider = parm;
- break;
- default:
- Console.WriteLine("Error: " + "Bad argument or Provider not supported.");
- break;
- }
- Console.WriteLine("Provider: " + provider);
- }
- else
- Console.WriteLine("Error: provider only has one parameter.");
- }
-
- // ChangeConnectionString - change the connection string variable
- public void ChangeConnectionString(string entry) {
-
- if(entry.Length > 18)
- connectionString = entry.Substring(18, entry.Length - 18);
- else
- connectionString = "";
- }
-
- public void SetupInputFile(string[] parms) {
- if(parms.Length >= 2) {
- Console.WriteLine("Error: wrong number of parameters");
- return;
- }
- inputFilename = parms[1];
- // TODO:
- // open input file
- // while each line, do the SqlSharpCli command or SQL
- // close input file
- }
-
- public void SetupOutputFile(string[] parms) {
- if(parms.Length == 1) {
- outputFilename = "";
- // TODO: close the output file
- }
- else if(parms.Length > 2) {
- Console.WriteLine("Error: wrong number of parameters");
- }
- else {
- outputFilename = parms[1];
- // TODO: open the output file
- }
- }
-
- public void SetupSilentMode(string[] parms) {
- if(parms.Length != 2) {
- Console.WriteLine("Error: wrong number of parameters");
- return;
- }
- string parm = parms[1].ToUpper();
- if(parm.Equals("TRUE"))
- silent = true;
- else if(parm.Equals("FALSE"))
- silent = false;
- else
- Console.WriteLine("Error: invalid parameter.");
- }
-
- public void OutputLine(string line) {
- if(silent == false)
- Console.WriteLine(line);
- }
-
- public void ExecuteBatch() {
- // TODO:
- Console.WriteLine("Error: Execution of Batch Commands not implemented yet");
- }
-
- // HandleCommand - handle SqlSharpCli commands entered
- public void HandleCommand(string entry) {
-
- string[] parms;
-
- // maybe a SQL# Command was found
- parms = entry.Split(new char[1] {' '});
- string userCmd = parms[0].ToUpper();
-
- switch(userCmd) {
- case "\\PROVIDER":
- ChangeProvider(parms);
- break;
- case "\\CONNECTIONSTRING":
- ChangeConnectionString(entry);
- break;
- case "\\OPEN":
- OpenDataSource();
- break;
- case "\\CLOSE":
- CloseDataSource();
- break;
- case "\\S":
- SetupSilentMode(parms);
- break;
- case "\\E":
- case "\\EXECUTE":
- // Execute SQL Commands or Queries
- if(conn == null)
- Console.WriteLine("Error: connection is not Open.");
- else if(conn.State == ConnectionState.Closed)
- Console.WriteLine("Error: connection is not Open.");
- else {
- if(build == null)
- Console.WriteLine("Error: SQL Buffer is empty.");
- else {
- ExecuteSql(build.ToString());
- }
- build = null;
- }
- break;
- case "\\F":
- // Batch Input File: \f FILENAME
- SetupInputFile(parms);
- ExecuteBatch();
- break;
- case "\\O":
- // Batch Output File: \o FILENAME
- SetupOutputFile(parms);
- break;
- case "\\H":
- case "\\HELP":
- // Help
- ShowHelp();
- break;
- case "\\DEFAULTS":
- ShowDefaults();
- break;
- case "\\Q":
- case "\\QUIT":
- // Quit
- break;
- default:
- // Error
- Console.WriteLine("Error: Unknown user command.");
- break;
- }
- }
-
- public void DealWithArgs(string[] args) {
- for(int a = 0; a < args.Length; a++) {
- if(args[a].Substring(0,1).Equals("-")) {
- string arg = args[a].ToUpper().Substring(1, args[a].Length - 1);
- switch(arg) {
- case "S":
- silent = true;
- break;
- case "F":
- if(a + 1 >= args.Length)
- Console.WriteLine("Error: Missing FILENAME for -f switch");
- else {
- inputFilename = args[a + 1];
- ExecuteBatch();
- }
- break;
- case "O":
- if(a + 1 >= args.Length)
- Console.WriteLine("Error: Missing FILENAME for -o switch");
- else
- outputFilename = args[a + 1];
- break;
- default:
- Console.WriteLine("Error: Unknow switch: " + args[a]);
- break;
- }
- }
- }
- }
-
- public void Run(string[] args) {
-
- DealWithArgs(args);
-
- string entry = "";
- build = null;
-
- if(silent == false) {
- Console.WriteLine("Welcome to SQL#. The interactive SQL command-line client ");
- Console.WriteLine("for Mono.Data. See http://www.go-mono.com/ for more details.\n");
-
- StartupHelp();
- ShowDefaults();
- }
-
- while(entry.ToUpper().Equals("\\Q") == false &&
- entry.ToUpper().Equals("\\QUIT") == false) {
-
- Console.Write("\nSQL# ");
- entry = Console.ReadLine();
-
- Console.WriteLine("Entered: " + entry);
-
- if(entry.Substring(0,1).Equals("\\")) {
- HandleCommand(entry);
- }
- else if(entry.IndexOf(";") >= 0) {
- // most likely the end of SQL Command or Query found
- // execute the SQL
- if(conn == null)
- Console.WriteLine("Error: connection is not Open.");
- else if(conn.State == ConnectionState.Closed)
- Console.WriteLine("Error: connection is not Open.");
- else {
- if(build == null) {
- build = new StringBuilder();
- }
- build.Append(entry);
- ExecuteSql(build.ToString());
- build = null;
- }
- }
- else {
- // most likely a part of a SQL Command or Query found
- // append this part of the SQL
- if(build == null) {
- build = new StringBuilder();
- }
- build.Append(entry + " ");
- }
- }
- }
- }
-
- public class SqlSharpDriver {
-
- public static void Main(string[] args) {
- SqlSharpCli sqlCommandLineEngine = new SqlSharpCli();
- sqlCommandLineEngine.Run(args);
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/System.Data.SqlTypes/AllTests.cs b/mcs/class/System.Data/Test/System.Data.SqlTypes/AllTests.cs
deleted file mode 100644
index 41df325d247..00000000000
--- a/mcs/class/System.Data/Test/System.Data.SqlTypes/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Data.SqlTypes
-{
- /// <summary>
- /// Combines all unit tests for the System.Data.dll assembly
- /// into one test suite.
- /// </summary>
- public class AllTests : TestCase
- {
- public AllTests (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (new TestSuite (typeof (SqlInt32Test)));
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt32Test.cs b/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt32Test.cs
deleted file mode 100644
index 4cd335ce17c..00000000000
--- a/mcs/class/System.Data/Test/System.Data.SqlTypes/SqlInt32Test.cs
+++ /dev/null
@@ -1,413 +0,0 @@
-// SqlInt32Test.cs - NUnit Test Cases for System.Data.SqlTypes.SqlInt32
-//
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Tim Coleman
-//
-
-using NUnit.Framework;
-using System;
-using System.Data;
-using System.Data.SqlTypes;
-
-namespace MonoTests.System.Data.SqlTypes
-{
- public class SqlInt32Test : TestCase
- {
-
- public SqlInt32Test() : base ("System.Data.SqlTypes.SqlInt32") {}
- public SqlInt32Test(string name) : base(name) {}
-
- protected override void SetUp() {}
-
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SqlInt32));
- }
- }
-
- public void TestCreate ()
- {
- SqlInt32 foo = new SqlInt32 (5);
- AssertEquals ("Test explicit cast to int", (int)foo, 5);
- }
-
- public void TestAdd ()
- {
- int a = 5;
- int b = 7;
-
- SqlInt32 x;
- SqlInt32 y;
- SqlInt32 z;
-
- x = new SqlInt32 (a);
- y = new SqlInt32 (b);
- z = x + y;
- AssertEquals ("Addition operator does not work correctly", z.Value, a + b);
- z = SqlInt32.Add (x, y);
- AssertEquals ("Addition function does not work correctly", z.Value, a + b);
- }
-
- public void TestBitwiseAnd ()
- {
- int a = 5;
- int b = 7;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 y = new SqlInt32 (b);
- SqlInt32 z = x & y;
- AssertEquals ("Bitwise And operator does not work correctly", z.Value, a & b);
- z = SqlInt32.BitwiseAnd (x, y);
- AssertEquals ("Bitwise And function does not work correctly", z.Value, a & b);
- }
-
- public void TestBitwiseOr ()
- {
- int a = 5;
- int b = 7;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 y = new SqlInt32 (b);
- SqlInt32 z = x | y;
- AssertEquals ("Bitwise Or operator does not work correctly", z.Value, a | b);
- z = SqlInt32.BitwiseOr (x, y);
- AssertEquals ("Bitwise Or function does not work correctly", z.Value, a | b);
- }
-
- public void TestDivide ()
- {
- int a = 5;
- int b = 7;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 y = new SqlInt32 (b);
- SqlInt32 z = x / y;
- AssertEquals ("Division operator does not work correctly", z.Value, a / b);
- z = SqlInt32.Divide (x, y);
- AssertEquals ("Division function does not work correctly", z.Value, a / b);
- }
-
- public void TestEquals ()
- {
- SqlInt32 x;
- SqlInt32 y;
-
- // Case 1: either is SqlInt32.Null
- x = SqlInt32.Null;
- y = new SqlInt32 (5);
- AssertEquals ("Equality operator didn't return Null when one was Null.", x == y, SqlBoolean.Null);
- AssertEquals ("Equality function didn't return Null when one was Null.", SqlInt32.Equals (x, y), SqlBoolean.Null);
-
- // Case 2: both are SqlInt32.Null
- y = SqlInt32.Null;
- AssertEquals ("Equality operator didn't return Null when both were Null.", x == y, SqlBoolean.Null);
- AssertEquals ("Equality function didn't return Null when both were Null.", SqlInt32.Equals (x, y), SqlBoolean.Null);
-
- // Case 3: both are equal
- x = new SqlInt32 (5);
- y = new SqlInt32 (5);
- AssertEquals ("Equality operator didn't return true when they were equal.", x == y, SqlBoolean.True);
- AssertEquals ("Equality function didn't return true when they were equal.", SqlInt32.Equals (x, y), SqlBoolean.True);
-
- // Case 4: inequality
- x = new SqlInt32 (5);
- y = new SqlInt32 (6);
- AssertEquals ("Equality operator didn't return false when they were not equal.", x == y, SqlBoolean.False);
- AssertEquals ("Equality function didn't return false when they were not equal.", SqlInt32.Equals (x, y), SqlBoolean.False);
- }
-
- public void TestGreaterThan ()
- {
- SqlInt32 x;
- SqlInt32 y;
-
- // Case 1: either is SqlInt32.Null
- x = SqlInt32.Null;
- y = new SqlInt32 (5);
- AssertEquals ("Greater Than operator didn't return Null when one was Null.", x > y, SqlBoolean.Null);
- AssertEquals ("Greater Than function didn't return Null when one was Null.", SqlInt32.GreaterThan (x, y), SqlBoolean.Null);
-
- // Case 2: both are SqlInt32.Null
- y = SqlInt32.Null;
- AssertEquals ("Greater Than operator didn't return Null when both were Null.", x > y, SqlBoolean.Null);
- AssertEquals ("Greater Than function didn't return Null when both were Null.", SqlInt32.GreaterThan (x, y), SqlBoolean.Null);
-
- // Case 3: x > y
- x = new SqlInt32 (5);
- y = new SqlInt32 (4);
- AssertEquals ("Greater than operator didn't return true when x > y.", x > y, SqlBoolean.True);
- AssertEquals ("Greater than function didn't return true when x > y.", SqlInt32.GreaterThan (x,y), SqlBoolean.True);
-
- // Case 4: x < y
- x = new SqlInt32 (5);
- y = new SqlInt32 (6);
- AssertEquals ("Greater than operator didn't return false when x < y.", x > y, SqlBoolean.False);
- AssertEquals ("Greater than function didn't return false when x < y.", SqlInt32.GreaterThan (x,y), SqlBoolean.False);
- }
-
- public void TestGreaterThanOrEqual ()
- {
- SqlInt32 x;
- SqlInt32 y;
-
- // Case 1: either is SqlInt32.Null
- x = SqlInt32.Null;
- y = new SqlInt32 (5);
- AssertEquals ("Greater Than Or Equal operator didn't return Null when one was Null.", x >= y, SqlBoolean.Null);
- AssertEquals ("Greater Than Or Equal function didn't return Null when one was Null.", SqlInt32.GreaterThanOrEqual (x, y), SqlBoolean.Null);
-
- // Case 2: both are SqlInt32.Null
- y = SqlInt32.Null;
- AssertEquals ("Greater Than Or Equal operator didn't return Null when both were Null.", x >= y, SqlBoolean.Null);
- AssertEquals ("Greater Than Or Equal function didn't return Null when both were Null.", SqlInt32.GreaterThanOrEqual (x, y), SqlBoolean.Null);
-
- // Case 3: x > y
- x = new SqlInt32 (5);
- y = new SqlInt32 (4);
- AssertEquals ("Greater than or equal operator didn't return true when x > y.", x >= y, SqlBoolean.True);
- AssertEquals ("Greater than or equal function didn't return true when x > y.", SqlInt32.GreaterThanOrEqual (x,y), SqlBoolean.True);
-
- // Case 4: x < y
- x = new SqlInt32 (5);
- y = new SqlInt32 (6);
- AssertEquals ("Greater than or equal operator didn't return false when x < y.", x >= y, SqlBoolean.False);
- AssertEquals ("Greater than or equal function didn't return false when x < y.", SqlInt32.GreaterThanOrEqual (x,y), SqlBoolean.False);
-
- // Case 5: x == y
- x = new SqlInt32 (5);
- y = new SqlInt32 (5);
- AssertEquals ("Greater than or equal operator didn't return true when x == y.", x >= y, SqlBoolean.True);
- AssertEquals ("Greater than or equal function didn't return true when x == y.", SqlInt32.GreaterThanOrEqual (x,y), SqlBoolean.True);
- }
-
- public void TestLessThan ()
- {
- SqlInt32 x;
- SqlInt32 y;
-
- // Case 1: either is SqlInt32.Null
- x = SqlInt32.Null;
- y = new SqlInt32 (5);
- AssertEquals ("Less Than operator didn't return Null when one was Null.", x < y, SqlBoolean.Null);
- AssertEquals ("Less Than function didn't return Null when one was Null.", SqlInt32.LessThan (x, y), SqlBoolean.Null);
-
- // Case 2: both are SqlInt32.Null
- y = SqlInt32.Null;
- AssertEquals ("Less Than operator didn't return Null when both were Null.", x < y, SqlBoolean.Null);
- AssertEquals ("Less Than function didn't return Null when both were Null.", SqlInt32.LessThan (x, y), SqlBoolean.Null);
-
- // Case 3: x > y
- x = new SqlInt32 (5);
- y = new SqlInt32 (4);
- AssertEquals ("Less than operator didn't return false when x > y.", x < y, SqlBoolean.False);
- AssertEquals ("Less than function didn't return false when x > y.", SqlInt32.LessThan (x,y), SqlBoolean.False);
-
- // Case 4: x < y
- x = new SqlInt32 (5);
- y = new SqlInt32 (6);
- AssertEquals ("Less than operator didn't return true when x < y.", x < y, SqlBoolean.True);
- AssertEquals ("Less than function didn't return true when x < y.", SqlInt32.LessThan (x,y), SqlBoolean.True);
- }
-
- public void TestLessThanOrEqual ()
- {
- SqlInt32 x;
- SqlInt32 y;
-
- // Case 1: either is SqlInt32.Null
- x = SqlInt32.Null;
- y = new SqlInt32 (5);
- AssertEquals ("Less Than Or Equal operator didn't return Null when one was Null.", x <= y, SqlBoolean.Null);
- AssertEquals ("Less Than Or Equal function didn't return Null when one was Null.", SqlInt32.LessThanOrEqual (x, y), SqlBoolean.Null);
-
- // Case 2: both are SqlInt32.Null
- y = SqlInt32.Null;
- AssertEquals ("Less Than Or Equal operator didn't return Null when both were Null.", x <= y, SqlBoolean.Null);
- AssertEquals ("Less Than Or Equal function didn't return Null when both were Null.", SqlInt32.LessThanOrEqual (x, y), SqlBoolean.Null);
-
- // Case 3: x > y
- x = new SqlInt32 (5);
- y = new SqlInt32 (4);
- AssertEquals ("Less than or equal operator didn't return false when x > y.", x <= y, SqlBoolean.False);
- AssertEquals ("Less than or equal function didn't return false when x > y.", SqlInt32.LessThanOrEqual (x,y), SqlBoolean.False);
-
- // Case 4: x < y
- x = new SqlInt32 (5);
- y = new SqlInt32 (6);
- AssertEquals ("Less than or equal operator didn't return true when x < y.", x <= y, SqlBoolean.True);
- AssertEquals ("Less than or equal function didn't return true when x < y.", SqlInt32.LessThanOrEqual (x,y), SqlBoolean.True);
-
- // Case 5: x == y
- x = new SqlInt32 (5);
- y = new SqlInt32 (5);
- AssertEquals ("Less than or equal operator didn't return true when x == y.", x <= y, SqlBoolean.True);
- AssertEquals ("Less than or equal function didn't return true when x == y.", SqlInt32.LessThanOrEqual (x,y), SqlBoolean.True);
- }
-
- public void TestMod ()
- {
- int a = 5;
- int b = 7;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 y = new SqlInt32 (b);
- SqlInt32 z = x % y;
- AssertEquals ("Modulus operator does not work correctly", z.Value, a % b);
- z = SqlInt32.Mod (x, y);
- AssertEquals ("Modulus function does not work correctly", z.Value, a % b);
- }
-
- public void TestMultiply ()
- {
- int a = 5;
- int b = 7;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 y = new SqlInt32 (b);
- SqlInt32 z = x * y;
- AssertEquals ("Multiplication operator does not work correctly", z.Value, a * b);
- z = SqlInt32.Multiply (x, y);
- AssertEquals ("Multiplication function does not work correctly", z.Value, a * b);
- }
-
- public void TestNotEquals ()
- {
- SqlInt32 x;
- SqlInt32 y;
-
- x = new SqlInt32 (5);
- y = SqlInt32.Null;
-
- AssertEquals ("Not Equals operator does not return null when one or both of the parameters is Null.", x != y, SqlBoolean.Null);
- AssertEquals ("Not Equals function does not return null when one or both of the parameters is Null.", SqlInt32.NotEquals (x, y), SqlBoolean.Null);
-
- y = new SqlInt32 (5);
- AssertEquals ("Not Equals operator does not return false when x == y.", x != y, SqlBoolean.False);
- AssertEquals ("Not Equals function does not return false when x == y.", SqlInt32.NotEquals (x, y), SqlBoolean.False);
-
- y = new SqlInt32 (6);
- AssertEquals ("Not Equals operator does not return true when x != y.", x != y, SqlBoolean.True);
- AssertEquals ("Not Equals function does not return true when x != y.", SqlInt32.NotEquals (x, y), SqlBoolean.True);
- }
-
- public void TestOnesComplement ()
- {
- int a = 5;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 z = ~x;
- AssertEquals ("Ones Complement operator does not work correctly", z.Value, ~a);
- z = SqlInt32.OnesComplement (x);
- AssertEquals ("Ones Complement function does not work correctly", z.Value, ~a);
- }
-
- public void TestIsNullProperty ()
- {
- SqlInt32 n = SqlInt32.Null;
- Assert ("Null is not defined correctly", n.IsNull);
- }
-
- public void TestSubtract ()
- {
- int a = 7;
- int b = 5;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 y = new SqlInt32 (b);
- SqlInt32 z = x - y;
- AssertEquals ("Subtraction operator does not work correctly", z.Value, a - b);
- z = SqlInt32.Subtract (x, y);
- AssertEquals ("Subtraction function does not work correctly", z.Value, a - b);
- }
-
- public void TestConversionMethods ()
- {
- SqlInt32 x;
-
- // Case 1: SqlInt32.Null -> SqlBoolean == SqlBoolean.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlBoolean does not yield SqlBoolean.Null.", x.ToSqlBoolean (), SqlBoolean.Null );
-
- // Case 2: SqlInt32.Zero -> SqlBoolean == False
- x = SqlInt32.Zero;
- AssertEquals ("SqlInt32.Zero -> SqlBoolean does not yield SqlBoolean.False.", x.ToSqlBoolean (), SqlBoolean.False );
-
- // Case 3: SqlInt32(nonzero) -> SqlBoolean == True
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlBoolean does not yield SqlBoolean.True.", x.ToSqlBoolean (), SqlBoolean.True );
-
- // Case 4: SqlInt32.Null -> SqlByte == SqlByte.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlByte does not yield SqlByte.Null.", x.ToSqlByte (), SqlByte.Null );
-
- // Case 5: Test non-null conversion to SqlByte
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlByte does not yield a value of 27", x.ToSqlByte ().Value, (byte)27);
-
- // Case 6: SqlInt32.Null -> SqlDecimal == SqlDecimal.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlDecimal does not yield SqlDecimal.Null.", x.ToSqlDecimal (), SqlDecimal.Null );
-
- // Case 7: Test non-null conversion to SqlDecimal
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlDecimal does not yield a value of 27", x.ToSqlDecimal ().Value, (decimal)27);
-
- // Case 8: SqlInt32.Null -> SqlDouble == SqlDouble.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlDouble does not yield SqlDouble.Null.", x.ToSqlDouble (), SqlDouble.Null );
-
- // Case 9: Test non-null conversion to SqlDouble
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlDouble does not yield a value of 27", x.ToSqlDouble ().Value, (double)27);
-
- // Case 10: SqlInt32.Null -> SqlInt16 == SqlInt16.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlInt16 does not yield SqlInt16.Null.", x.ToSqlInt16 (), SqlInt16.Null );
-
- // Case 11: Test non-null conversion to SqlInt16
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlInt16 does not yield a value of 27", x.ToSqlInt16 ().Value, (short)27);
-
- // Case 12: SqlInt32.Null -> SqlInt64 == SqlInt64.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlInt64 does not yield SqlInt64.Null.", x.ToSqlInt64 (), SqlInt64.Null );
-
- // Case 13: Test non-null conversion to SqlInt64
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlInt64 does not yield a value of 27", x.ToSqlInt64 ().Value, (long)27);
-
- // Case 14: SqlInt32.Null -> SqlMoney == SqlMoney.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlMoney does not yield SqlMoney.Null.", x.ToSqlMoney (), SqlMoney.Null );
-
- // Case 15: Test non-null conversion to SqlMoney
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlMoney does not yield a value of 27", x.ToSqlMoney ().Value, (decimal)27);
-
- // Case 16: SqlInt32.Null -> SqlSingle == SqlSingle.Null
- x = SqlInt32.Null;
- AssertEquals ("SqlInt32.Null -> SqlSingle does not yield SqlSingle.Null.", x.ToSqlSingle (), SqlSingle.Null );
-
- // Case 17: Test non-null conversion to SqlSingle
- x = new SqlInt32 (27);
- AssertEquals ("SqlInt32 (27) -> SqlSingle does not yield a value of 27", x.ToSqlSingle ().Value, (float)27);
- }
-
- public void TestXor ()
- {
- int a = 5;
- int b = 7;
-
- SqlInt32 x = new SqlInt32 (a);
- SqlInt32 y = new SqlInt32 (b);
- SqlInt32 z = x ^ y;
- AssertEquals ("Xor operator does not work correctly", z.Value, a ^ b);
- z = SqlInt32.Xor (x, y);
- AssertEquals ("Xor function does not work correctly", z.Value, a ^ b);
- }
-
- }
-}
diff --git a/mcs/class/System.Data/Test/System.Data/AllTests.cs b/mcs/class/System.Data/Test/System.Data/AllTests.cs
deleted file mode 100644
index bd607633bf6..00000000000
--- a/mcs/class/System.Data/Test/System.Data/AllTests.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// MonoTests.System.Data.AllTests.cs
-//
-// Author:
-// Rodrigo Moya <rodrigo@ximian.com>
-//
-// (C) Copyright 2002 Rodrigo Moya
-//
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Data
-{
- /// <summary>
- /// Combines all unit tests for the System.Data.dll assembly
- /// into one test suite.
- /// </summary>
- public class AllTests : TestCase
- {
- public AllTests (string name) : base (name) { }
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (new TestSuite (typeof (DataColumnTest)));
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/System.Data/DataColumnTest.cs b/mcs/class/System.Data/Test/System.Data/DataColumnTest.cs
deleted file mode 100644
index 87cf31529fb..00000000000
--- a/mcs/class/System.Data/Test/System.Data/DataColumnTest.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// DataColumnTest.cs - NUnit Test Cases for System.Data.DataColumn
-//
-// Author:
-// Rodrigo Moya <rodrigo@ximian.com>
-//
-// (C) Copyright 2002 Rodrigo Moya
-//
-
-using NUnit.Framework;
-using System;
-using System.Data;
-
-namespace MonoTests.System.Data
-{
- public class DataColumnTest : TestCase
- {
- public DataColumnTest () : base ("System.Data.DataColumn") {}
- public DataColumnTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (DataColumnTest));
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/System.Data_test.build b/mcs/class/System.Data/Test/System.Data_test.build
deleted file mode 100644
index ce77e02c539..00000000000
--- a/mcs/class/System.Data/Test/System.Data_test.build
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.Data_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="System.Data_test" default="build">
- <property name="debug" value="false"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- </target>
-
- <target name="assemblies">
- <csc target="library" output="System.Data_test.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="TheTests.cs"/>
- <excludes name="ReadPostgresData.cs"/>
- <excludes name="TestExecuteScalar.cs"/>
- <excludes name="TestSqlDataReader.cs"/>
- <excludes name="TestSqlException.cs"/>
- <excludes name="TestSqlInsert.cs"/>
- <excludes name="TestSqlIsolationLevel.cs"/>
- <excludes name="TestSqlDataAdapter.cs"/>
- <excludes name="PostgresTest.cs"/>
- <excludes name="TestSqlParameters.cs"/>
- <excludes name="SqlSharpCli.cs"/>
-
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/r:..\..\lib\System.Data.dll"/>
- </csc>
- </target>
-
- <target name="RunTests">
- <csc target="exe" output="RunTests.System.Data.exe" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="**/AllTests.cs"/>
- <excludes name="**/MartinTests.cs"/>
- <excludes name="ReadPostgresData.cs"/>
- <excludes name="TestExecuteScalar.cs"/>
- <excludes name="TestSqlDataReader.cs"/>
- <excludes name="TestSqlException.cs"/>
- <excludes name="TestSqlInsert.cs"/>
- <excludes name="TestSqlIsolationLevel.cs"/>
- <excludes name="PostgresTest.cs"/>
- <excludes name="TestSqlDataAdapter.cs"/>
- <excludes name="TestSqlParameters.cs"/>
- <excludes name="SqlSharpCli.cs"/>
-
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitBase.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- <arg value="/noconfig"/>
- <arg value="/r:..\..\lib\System.Data.dll"/>
- </csc>
-
- </target>
-
- <target name="test" depends="assemblies">
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.System.Data.AllTests,System.Data_test.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="System.Data.dll" failonerror="false"/>
- <delete file="System.Data_test.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.Data/Test/TestExecuteScalar.cs b/mcs/class/System.Data/Test/TestExecuteScalar.cs
deleted file mode 100644
index e350a3c61c5..00000000000
--- a/mcs/class/System.Data/Test/TestExecuteScalar.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// Test/ExecuteScalar.cs
-//
-// Test the ExecuteScalar method in the
-// System.Data.SqlClient.SqlCommand class
-//
-// ExecuteScalar is meant to be lightweight
-// compared to ExecuteReader and only
-// returns one column and one row as one object.
-//
-// It is meant for SELECT SQL statements that
-// use an aggregate/group by function, such as,
-// count(), sum(), avg(), min(), max(), etc...
-//
-// The object that is returned you do an
-// explicit cast. For instance, to retrieve a
-// Count of rows in a PostgreSQL table, you
-// would use "SELECT COUNT(*) FROM SOMETABLE"
-// which returns a number of oid type 20 which is
-// a PostgreSQL int8 which maps to
-// the .NET type System.Int64. You
-// have to explicitly convert this returned object
-// to the type you are expecting, such as, an Int64
-// is returned for a COUNT().
-// would be:
-// Int64 myCount = (Int64) cmd.ExecuteScalar(selectStatement);
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) 2002 Daniel Morgan
-//
-
-using System;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient
-{
- class TestSqlDataReader
- {
-
- static void Test() {
- SqlConnection con = null;
- SqlCommand cmd = null;
-
- String connectionString = null;
- String sql = null;
-
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- try {
- string maxStrValue;
-
- con = new SqlConnection(connectionString);
- con.Open();
-
- // test SQL Query for an aggregate count(*)
- sql = "select count(*) " +
- "from sometable";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- Int64 rowCount = (Int64) cmd.ExecuteScalar();
- Console.WriteLine("Row Count: " + rowCount);
-
- // test SQL Query for an aggregate min(text)
- sql = "select max(tdesc) " +
- "from sometable";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- string minValue = (string) cmd.ExecuteScalar();
- Console.WriteLine("Max Value: " + minValue);
-
- // test SQL Query for an aggregate max(text)
- sql = "select min(tdesc) " +
- "from sometable";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- maxStrValue = (string) cmd.ExecuteScalar();
- Console.WriteLine("Max Value: " + maxStrValue);
-
- // test SQL Query for an aggregate max(int)
- sql = "select min(aint4) " +
- "from sometable";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- int maxIntValue = (int) cmd.ExecuteScalar();
- Console.WriteLine("Max Value: " + maxIntValue.ToString());
-
- // test SQL Query for an aggregate avg(int)
- sql = "select avg(aint4) " +
- "from sometable";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- decimal avgDecValue = (decimal) cmd.ExecuteScalar();
- Console.WriteLine("Max Value: " + avgDecValue.ToString());
-
- // test SQL Query for an aggregate sum(int)
- sql = "select sum(aint4) " +
- "from sometable";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- Int64 summed = (Int64) cmd.ExecuteScalar();
- Console.WriteLine("Max Value: " + summed);
-
- // test a SQL Command is (INSERT, UPDATE, DELETE)
- sql = "insert into sometable " +
- "(tid,tdesc,aint4,atimestamp) " +
- "values('qqq','www',234,NULL)";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- object objResult1 = cmd.ExecuteScalar();
- if(objResult1 == null)
- Console.WriteLine("Result is null. (correct)");
- else
- Console.WriteLine("Result is not null. (not correct)");
-
- // test a SQL Command is not (INSERT, UPDATE, DELETE)
- sql = "SET DATESTYLE TO 'ISO'";
- cmd = new SqlCommand(sql,con);
- Console.WriteLine("Executing: " + sql);
- object objResult2 = cmd.ExecuteScalar();
- if(objResult2 == null)
- Console.WriteLine("Result is null. (correct)");
- else
- Console.WriteLine("Result is not null. (not correct)");
-
- }
- catch(Exception e) {
- Console.WriteLine(e.ToString());
- }
- finally {
- if(con != null)
- if(con.State == ConnectionState.Open)
- con.Close();
- }
- }
-
- [STAThread]
- static void Main(string[] args)
- {
- Test();
- }
-
- }
-}
diff --git a/mcs/class/System.Data/Test/TestSqlDataAdapter.cs b/mcs/class/System.Data/Test/TestSqlDataAdapter.cs
deleted file mode 100644
index 684bfa83485..00000000000
--- a/mcs/class/System.Data/Test/TestSqlDataAdapter.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// TestSqlDataAdapter - tests SqlDataAdapter, DbDataAdapter, DataSet, DataTable,
-// DataRow, and DataRowCollection by retrieving data
-//
-// Authors:
-// Tim Coleman <tim@timcoleman.com>
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Tim Coleman
-// (c)copyright 2002 Daniel Morgan
-//
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient
-{
- public class TestSqlDataAdapter
- {
- public static void Test()
- {
- string connectionString;
- string sqlQuery;
- SqlDataAdapter adapter;
- DataSet dataSet = null;
-
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- sqlQuery = "select * from pg_tables";
-
- System.Console.WriteLine ("new SqlDataAdapter...");
- adapter = new SqlDataAdapter (sqlQuery,
- connectionString);
-
- System.Console.WriteLine ("new DataSet...");
- dataSet = new DataSet ();
-
- try {
- System.Console.WriteLine("Fill...");
- adapter.Fill (dataSet);
-
- }
- catch (NotImplementedException e) {
- Console.WriteLine("Exception Caught: " + e);
- }
-
- System.Console.WriteLine ("get row...");
- if (dataSet != null) {
- foreach (DataRow row in dataSet.Tables["Table"].Rows)
- Console.WriteLine("tablename: " + row["tablename"]);
- System.Console.WriteLine("Done.");
- }
-
- }
-
- public static void Main()
- {
- Test();
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/TestSqlDataReader.cs b/mcs/class/System.Data/Test/TestSqlDataReader.cs
deleted file mode 100644
index 17a61189de1..00000000000
--- a/mcs/class/System.Data/Test/TestSqlDataReader.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// Test/SqlDataRead.cs
-//
-// Test to do read a simple forward read only record set.
-// Using SqlCommand.ExecuteReader() to return a SqlDataReader
-// which can be used to Read a row
-// and Get a String or Int32.
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C) 2002 Daniel Morgan
-//
-
-using System;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient {
- class TestSqlDataReader {
-
- static void Test(SqlConnection con, string sql,
- CommandType cmdType, CommandBehavior behavior,
- string testDesc)
- {
- SqlCommand cmd = null;
- SqlDataReader rdr = null;
-
- int c;
- int results = 0;
-
- Console.WriteLine("Test: " + testDesc);
- Console.WriteLine("[BEGIN SQL]");
- Console.WriteLine(sql);
- Console.WriteLine("[END SQL]");
-
- cmd = new SqlCommand(sql, con);
- cmd.CommandType = cmdType;
-
- Console.WriteLine("ExecuteReader...");
- rdr = cmd.ExecuteReader(behavior);
-
- if(rdr == null) {
-
- Console.WriteLine("IDataReader has a Null Reference.");
- }
- else {
-
- do {
- // get the DataTable that holds
- // the schema
- DataTable dt = rdr.GetSchemaTable();
-
- if(rdr.RecordsAffected != -1) {
- // Results for
- // SQL INSERT, UPDATE, DELETE Commands
- // have RecordsAffected >= 0
- Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- }
- else if (dt == null)
- Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- else {
- // Results for
- // SQL not INSERT, UPDATE, nor DELETE
- // have RecordsAffected = -1
- Console.WriteLine("Result is from a SQL SELECT Query. Records Affected: " + rdr.RecordsAffected);
-
- // Results for a SQL Command (CREATE TABLE, SET, etc)
- // will have a null reference returned from GetSchemaTable()
- //
- // Results for a SQL SELECT Query
- // will have a DataTable returned from GetSchemaTable()
-
- results++;
- Console.WriteLine("Result Set " + results + "...");
-
- // number of columns in the table
- Console.WriteLine(" Total Columns: " +
- dt.Columns.Count);
-
- // display the schema
- foreach (DataRow schemaRow in dt.Rows) {
- foreach (DataColumn schemaCol in dt.Columns)
- Console.WriteLine(schemaCol.ColumnName +
- " = " +
- schemaRow[schemaCol]);
- Console.WriteLine();
- }
-
- int nRows = 0;
- string output, metadataValue, dataValue;
- // Read and display the rows
- Console.WriteLine("Gonna do a Read() now...");
- while(rdr.Read()) {
- Console.WriteLine(" Row " + nRows + ": ");
-
- for(c = 0; c < rdr.FieldCount; c++) {
- // column meta data
- DataRow dr = dt.Rows[c];
- metadataValue =
- " Col " +
- c + ": " +
- dr["ColumnName"];
-
- // column data
- if(rdr.IsDBNull(c) == true)
- dataValue = " is NULL";
- else
- dataValue =
- ": " +
- rdr.GetValue(c);
-
- // display column meta data and data
- output = metadataValue + dataValue;
- Console.WriteLine(output);
- }
- nRows++;
- }
- Console.WriteLine(" Total Rows: " +
- nRows);
- }
- } while(rdr.NextResult());
- Console.WriteLine("Total Result sets: " + results);
-
- rdr.Close();
- }
-
- }
-
- [STAThread]
- static void Main(string[] args) {
- String connectionString = null;
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- SqlConnection con;
- con = new SqlConnection(connectionString);
- con.Open();
-
- string sql;
-
- // Text - only has one query (single query behavior)
- sql = "select * from pg_tables";
- Test(con, sql, CommandType.Text,
- CommandBehavior.SingleResult, "Text1");
-
- // Text - only has one query (default behavior)
- sql = "select * from pg_tables";
- Test(con, sql, CommandType.Text,
- CommandBehavior.Default, "Text2");
-
- // Text - has three queries
- sql =
- "select * from pg_user;" +
- "select * from pg_tables;" +
- "select * from pg_database";
- Test(con, sql, CommandType.Text,
- CommandBehavior.Default, "Text3Queries");
-
- // Table Direct
- sql = "pg_tables";
- Test(con, sql, CommandType.TableDirect,
- CommandBehavior.Default, "TableDirect1");
-
- // Stored Procedure
- sql = "version";
- Test(con, sql, CommandType.StoredProcedure,
- CommandBehavior.Default, "SP1");
-
- // Text - test a SQL Command (default behavior)
- // Note: this not a SQL Query
- sql = "SET DATESTYLE TO 'ISO'";
- Test(con, sql, CommandType.Text,
- CommandBehavior.Default, "TextCmd1");
-
- con.Close();
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/TestSqlException.cs b/mcs/class/System.Data/Test/TestSqlException.cs
deleted file mode 100644
index 294a1ddfba3..00000000000
--- a/mcs/class/System.Data/Test/TestSqlException.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// TestSqlInsert.cs
-//
-// To Test SqlConnection and SqlCommand by connecting
-// to a PostgreSQL database
-// and then executing an INSERT SQL statement
-//
-// To use:
-// change strings to your database, userid, tables, etc...:
-// connectionString
-// insertStatement
-//
-// To test:
-// mcs TestSqlInsert.cs -r System.Data
-// mint TestSqlInsert.exe
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient
-{
- class TestSqlInsert
- {
- [STAThread]
- static void Main(string[] args) {
- SqlConnection conn;
- SqlCommand cmd;
- SqlTransaction trans;
-
- int rowsAffected;
-
- String connectionString;
- String insertStatement;
- String deleteStatement;
-
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- insertStatement =
- "insert into NoSuchTable " +
- "(tid, tdesc) " +
- "values ('beer', 'Beer for All!') ";
-
- deleteStatement =
- "delete from sometable " +
- "where tid = 'beer' ";
-
- try {
- // Connect to a PostgreSQL database
- Console.WriteLine ("Connect to database...");
- conn = new SqlConnection(connectionString);
- conn.Open();
-
- // begin transaction
- Console.WriteLine ("Begin Transaction...");
- trans = conn.BeginTransaction();
-
- // create SQL DELETE command
- Console.WriteLine ("Create Command initializing " +
- "with an DELETE statement...");
- cmd = new SqlCommand (deleteStatement, conn);
-
- // execute the DELETE SQL command
- Console.WriteLine ("Execute DELETE SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // change the SQL command to an SQL INSERT Command
- Console.WriteLine ("Now use INSERT SQL Command...");
- cmd.CommandText = insertStatement;
-
- // execute the INSERT SQL command
- Console.WriteLine ("Execute INSERT SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // if successfull at INSERT, commit the transaction,
- // otherwise, do a rollback the transaction using
- // trans.Rollback();
- Console.WriteLine ("Commit transaction...");
- trans.Commit();
-
- // Close connection to database
- Console.WriteLine ("Close database connection...");
- conn.Close();
-
- Console.WriteLine ("Assuming everything " +
- "was successful.");
- Console.WriteLine ("Verify data in database to " +
- "see if row is there.");
- }
- catch(SqlException e) {
- // Display the SQL Errors and Rollback the database
- Console.WriteLine("SqlException caught: " +
- e.ToString());
- if(trans != null) {
- trans.Rollback();
- Console.WriteLine("Database has been Rolled back!");
- }
- }
- finally {
- if(conn != null)
- if(conn.State == ConnectionState.Open)
- conn.Close();
- }
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/TestSqlInsert.cs b/mcs/class/System.Data/Test/TestSqlInsert.cs
deleted file mode 100644
index d8d31348eff..00000000000
--- a/mcs/class/System.Data/Test/TestSqlInsert.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// TestSqlInsert.cs
-//
-// To Test SqlConnection and SqlCommand by connecting
-// to a PostgreSQL database
-// and then executing an INSERT SQL statement
-//
-// To use:
-// change strings to your database, userid, tables, etc...:
-// connectionString
-// insertStatement
-//
-// To test:
-// mcs TestSqlInsert.cs -r System.Data
-// mint TestSqlInsert.exe
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient
-{
- class TestSqlInsert
- {
- [STAThread]
- static void Main(string[] args)
- {
- SqlConnection conn;
- SqlCommand cmd;
- SqlTransaction trans;
-
- int rowsAffected;
-
- String connectionString;
- String insertStatement;
- String deleteStatement;
-
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- insertStatement =
- "insert into sometable " +
- "(tid, tdesc) " +
- "values ('beer', 'Beer for All!') ";
-
- deleteStatement =
- "delete from sometable " +
- "where tid = 'beer' ";
-
- // Connect to a PostgreSQL database
- Console.WriteLine ("Connect to database...");
- conn = new SqlConnection(connectionString);
- conn.Open();
-
- // begin transaction
- Console.WriteLine ("Begin Transaction...");
- trans = conn.BeginTransaction();
-
- // create SQL DELETE command
- Console.WriteLine ("Create Command initializing " +
- "with an DELETE statement...");
- cmd = new SqlCommand (deleteStatement, conn);
-
- // execute the DELETE SQL command
- Console.WriteLine ("Execute DELETE SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // change the SQL command to an SQL INSERT Command
- Console.WriteLine ("Now use INSERT SQL Command...");
- cmd.CommandText = insertStatement;
-
- // execute the INSERT SQL command
- Console.WriteLine ("Execute INSERT SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // if successfull at INSERT, commit the transaction,
- // otherwise, do a rollback the transaction using
- // trans.Rollback();
- // FIXME: need to have exceptions working in
- // SqlClient classes before you can do rollback
- Console.WriteLine ("Commit transaction...");
- trans.Commit();
-
- // Close connection to database
- Console.WriteLine ("Close database connection...");
- conn.Close();
-
- Console.WriteLine ("Assuming everything " +
- "was successful.");
- Console.WriteLine ("Verify data in database to " +
- "see if row is there.");
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/TestSqlIsolationLevel.cs b/mcs/class/System.Data/Test/TestSqlIsolationLevel.cs
deleted file mode 100644
index 8f0f2823222..00000000000
--- a/mcs/class/System.Data/Test/TestSqlIsolationLevel.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// TestSqlIsolationLevel.
-//
-// To Test Setting Isolation Level of SqlTransaction
-// to a PostgreSQL database
-//
-// To use:
-// change strings to your database, userid, tables, etc...:
-// connectionString
-// insertStatement
-//
-// To test:
-// mcs TestSqlIsolationLevel.cs -r System.Data
-// mint TestSqlIsolationLevel.exe
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-// Daniel Morgan (danmorg@sc.rr.com)
-//
-// (C) Ximian, Inc 2002
-//
-
-using System;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient
-{
- class TestSqlInsert
- {
- [STAThread]
- static void Main(string[] args)
- {
- SqlConnection conn;
- SqlCommand cmd;
- SqlTransaction trans;
-
- int rowsAffected;
-
- String connectionString;
- String insertStatement;
- String deleteStatement;
-
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- insertStatement =
- "insert into sometable " +
- "(tid, tdesc) " +
- "values ('beer', 'Beer for All!') ";
-
- deleteStatement =
- "delete from sometable " +
- "where tid = 'beer' ";
-
- // Connect to a PostgreSQL database
- Console.WriteLine ("Connect to database...");
- conn = new SqlConnection(connectionString);
- conn.Open();
-
- // begin transaction
- Console.WriteLine ("Begin Transaction...");
- trans = conn.BeginTransaction(IsolationLevel.Serializable);
-
- // create SQL DELETE command
- Console.WriteLine ("Create Command initializing " +
- "with an DELETE statement...");
- cmd = new SqlCommand (deleteStatement, conn);
-
- // execute the DELETE SQL command
- Console.WriteLine ("Execute DELETE SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // change the SQL command to an SQL INSERT Command
- Console.WriteLine ("Now use INSERT SQL Command...");
- cmd.CommandText = insertStatement;
-
- // execute the INSERT SQL command
- Console.WriteLine ("Execute INSERT SQL Command...");
- rowsAffected = cmd.ExecuteNonQuery();
- Console.WriteLine ("Rows Affected: " + rowsAffected);
-
- // if successfull at INSERT, commit the transaction,
- // otherwise, do a rollback the transaction using
- // trans.Rollback();
- // FIXME: need to have exceptions working in
- // SqlClient classes before you can do rollback
- Console.WriteLine ("Commit transaction...");
- trans.Commit();
-
- // Close connection to database
- Console.WriteLine ("Close database connection...");
- conn.Close();
-
- Console.WriteLine ("Assuming everything " +
- "was successful.");
- Console.WriteLine ("Verify data in database to " +
- "see if row is there.");
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/TestSqlParameters.cs b/mcs/class/System.Data/Test/TestSqlParameters.cs
deleted file mode 100644
index 50807999592..00000000000
--- a/mcs/class/System.Data/Test/TestSqlParameters.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// TestSqlParameters.cs - test parameters for the PostgreSQL .NET Data Provider in Mono
-// using *Parameter and *ParameterCollection
-//
-// Note: it currently only tests input parameters. Output is next on the list.
-// Then output/input and return parameters.
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (c)copyright 2002 Daniel Morgan
-//
-
-using System;
-using System.Collections;
-using System.Data;
-using System.Data.SqlClient;
-
-namespace TestSystemDataSqlClient {
-
- public class TestParameters {
- public static void Main() {
- Console.WriteLine("** Start Test...");
-
- String connectionString = null;
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- SqlConnection con;
- Console.WriteLine("** Creating connection...");
- con = new SqlConnection(connectionString);
- Console.WriteLine("** opening connection...");
- con.Open();
-
- string tableName = "pg_type";
-
- string sql;
- sql = "SELECT * FROM PG_TABLES WHERE TABLENAME = :inTableName";
-
- Console.WriteLine("** Creating command...");
- SqlCommand cmd = new SqlCommand(sql, con);
-
- // add parameter for inTableName
- Console.WriteLine("** Create parameter...");
- SqlParameter parm = new SqlParameter("inTableName", SqlDbType.Text);
-
- Console.WriteLine("** set dbtype of parameter to string");
- parm.DbType = DbType.String;
-
- Console.WriteLine("** set direction of parameter to input");
- parm.Direction = ParameterDirection.Input;
-
- Console.WriteLine("** set value to the tableName string...");
- parm.Value = tableName;
-
- Console.WriteLine("** add parameter to parameters collection in the command...");
- cmd.Parameters.Add(parm);
-
- SqlDataReader rdr;
- Console.WriteLine("** ExecuteReader()...");
-
- rdr = cmd.ExecuteReader();
-
- Console.WriteLine("[][] And now we are going to our results [][]...");
- int c;
- int results = 0;
- do {
- results++;
- Console.WriteLine("Result Set " + results + "...");
-
- // get the DataTable that holds
- // the schema
- DataTable dt = rdr.GetSchemaTable();
-
- // number of columns in the table
- Console.WriteLine(" Total Columns: " +
- dt.Columns.Count);
-
- // display the schema
- foreach (DataRow schemaRow in dt.Rows) {
- foreach (DataColumn schemaCol in dt.Columns)
- Console.WriteLine(schemaCol.ColumnName +
- " = " +
- schemaRow[schemaCol]);
- Console.WriteLine();
- }
-
- string output, metadataValue, dataValue;
- int nRows = 0;
-
- // Read and display the rows
- while(rdr.Read()) {
- Console.WriteLine(" Row " + nRows + ": ");
-
- for(c = 0; c < rdr.FieldCount; c++) {
- // column meta data
- DataRow dr = dt.Rows[c];
- metadataValue =
- " Col " +
- c + ": " +
- dr["ColumnName"];
-
- // column data
- if(rdr.IsDBNull(c) == true)
- dataValue = " is NULL";
- else
- dataValue =
- ": " +
- rdr.GetValue(c);
-
- // display column meta data and data
- output = metadataValue + dataValue;
- Console.WriteLine(output);
- }
- nRows++;
- }
- Console.WriteLine(" Total Rows: " +
- nRows);
- } while(rdr.NextResult());
- Console.WriteLine("Total Result sets: " + results);
-
- con.Close();
- }
- }
-}
diff --git a/mcs/class/System.Data/Test/TheTests.cs b/mcs/class/System.Data/Test/TheTests.cs
deleted file mode 100644
index c69aedfe873..00000000000
--- a/mcs/class/System.Data/Test/TheTests.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-// Author: Tim Coleman (tim@timcoleman.com)
-// (C) Copyright 2002 Tim Coleman
-
-
-using NUnit.Framework;
-using System;
-using System.Data;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System.Data
-{
- public class RunDataColumnTest : DataColumnTest
- {
- protected override void RunTest ()
- {
- throw new NotImplementedException ();
- }
- }
-}
-
-namespace MonoTests.System.Data.SqlTypes
-{
- public class RunSqlInt32Test : SqlInt32Test
- {
- protected override void RunTest ()
- {
- TestCreate ();
-
- // property tests
-
- TestIsNullProperty ();
-
- // method tests
-
- TestAdd ();
- TestBitwiseAnd ();
- TestBitwiseOr ();
- TestDivide ();
- TestEquals ();
- TestGreaterThan ();
- TestGreaterThanOrEqual ();
- TestLessThan ();
- TestLessThanOrEqual ();
- TestMod ();
- TestMultiply ();
- TestNotEquals ();
- TestOnesComplement ();
- TestSubtract ();
- TestConversionMethods ();
- TestXor ();
- }
- }
-}
-
-namespace MonoTests
-{
- public class RunAllTests
- {
- public static void AddAllTests (TestSuite suite)
- {
- suite.AddTest (new MonoTests.System.Data.RunDataColumnTest ());
- suite.AddTest (new MonoTests.System.Data.SqlTypes.RunSqlInt32Test ());
- }
- }
-}
-
-class MainApp
-{
- public static void Main ()
- {
- TestResult result = new TestResult ();
- TestSuite suite = new TestSuite ();
- MonoTests.RunAllTests.AddAllTests (suite);
- suite.Run (result);
- MonoTests.MyTestRunner.Print (result);
- }
-}
diff --git a/mcs/class/System.Data/list b/mcs/class/System.Data/list
deleted file mode 100755
index 24ff121abc6..00000000000
--- a/mcs/class/System.Data/list
+++ /dev/null
@@ -1,128 +0,0 @@
-System.Data/AcceptRejectRule.cs
-System.Data/CommandBehavior.cs
-System.Data/CommandType.cs
-System.Data/ConnectionState.cs
-System.Data/Constraint.cs
-System.Data/ConstraintCollection.cs
-System.Data/ConstraintException.cs
-System.Data/DataColumn.cs
-System.Data/DataColumnChangeEventArgs.cs
-System.Data/DataColumnChangeEventHandler.cs
-System.Data/DataColumnCollection.cs
-System.Data/DataException.cs
-System.Data/DataRelation.cs
-System.Data/DataRelationCollection.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/DataTable.cs
-System.Data/DataTableCollection.cs
-System.Data/DataView.cs
-System.Data/DataViewManager.cs
-System.Data/DataViewRowState.cs
-System.Data/DataViewSetting.cs
-System.Data/DataViewSettingCollection.cs
-System.Data/DBConcurrencyException.cs
-System.Data/DbType.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/IsolationLevel.cs
-System.Data/ITableMapping.cs
-System.Data/ITableMappingCollection.cs
-System.Data/Locale.cs
-System.Data/MappingType.cs
-System.Data/MergeFailedEventArgs.cs
-System.Data/MergeFailedEventHandler.cs
-System.Data/MissingMappingAction.cs
-System.Data/MissingPrimaryKeyException.cs
-System.Data/MissingSchemaAction.cs
-System.Data/NoNullAllowedException.cs
-System.Data/ParameterDirection.cs
-System.Data/PropertyAttributes.cs
-System.Data/PropertyCollection.cs
-System.Data/ReadOnlyException.cs
-System.Data/RowNotInTableException.cs
-System.Data/Rule.cs
-System.Data/SchemaType.cs
-System.Data/SqlDbType.cs
-System.Data/StateChangeEventArgs.cs
-System.Data/StateChangeEventHandler.cs
-System.Data/StatementType.cs
-System.Data/StrongTypingException.cs
-System.Data/SyntaxErrorException.cs
-System.Data/TODOAttribute.cs
-System.Data/TypeDataSetGeneratorException.cs
-System.Data/UniqueConstraint.cs
-System.Data/UpdateRowSource.cs
-System.Data/UpdateStatus.cs
-System.Data/VersionNotFoundException.cs
-System.Data/XmlReadMode.cs
-System.Data/XmlWriteMode.cs
-System.Data.Common/DataAdapter.cs
-System.Data.Common/DataColumnMapping.cs
-System.Data.Common/DataColumnMappingCollection.cs
-System.Data.Common/DataTableMapping.cs
-System.Data.Common/DataTableMappingCollection.cs
-System.Data.Common/DbDataAdapter.cs
-System.Data.Common/DbDataPermissionAttribute.cs
-System.Data.Common/RowUpdatedEventArgs.cs
-System.Data.Common/RowUpdatingEventArgs.cs
-System.Data.SqlClient/ParmUtil.cs
-System.Data.SqlClient/PostgresLibrary.cs
-System.Data.SqlClient/PostgresTypes.cs
-System.Data.SqlClient/SqlCommand.cs
-System.Data.SqlClient/SqlConnection.cs
-System.Data.SqlClient/SqlDataReader.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/SqlParameter.cs
-System.Data.SqlClient/SqlParameterCollection.cs
-System.Data.SqlClient/SqlTransaction.cs
-System.Data.SqlTypes/INullable.cs
-System.Data.SqlTypes/SqlBinary.cs
-System.Data.SqlTypes/SqlBoolean.cs
-System.Data.SqlTypes/SqlByte.cs
-System.Data.SqlTypes/SqlCompareOptions.cs
-System.Data.SqlTypes/SqlDateTime.cs
-System.Data.SqlTypes/SqlDecimal.cs
-System.Data.SqlTypes/SqlDouble.cs
-System.Data.SqlTypes/SqlGuid.cs
-System.Data.SqlTypes/SqlInt16.cs
-System.Data.SqlTypes/SqlInt32.cs
-System.Data.SqlTypes/SqlInt64.cs
-System.Data.SqlTypes/SqlMoney.cs
-System.Data.SqlTypes/SqlNullValueException.cs
-System.Data.SqlTypes/SqlSingle.cs
-System.Data.SqlTypes/SqlString.cs
-System.Data.SqlTypes/SqlTruncateException.cs
-System.Data.SqlTypes/SqlTypeException.cs
diff --git a/mcs/class/System.Drawing/ChangeLog b/mcs/class/System.Drawing/ChangeLog
deleted file mode 100644
index afd4f8cda2b..00000000000
--- a/mcs/class/System.Drawing/ChangeLog
+++ /dev/null
@@ -1,6 +0,0 @@
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ChangeLog: new file.
-
- * System.Drawing.build: added System.dll dependency
-
diff --git a/mcs/class/System.Drawing/System.Drawing.Design/UITypeEditorEditStyle.cs b/mcs/class/System.Drawing/System.Drawing.Design/UITypeEditorEditStyle.cs
deleted file mode 100644
index 6a571cc7cc4..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Design/UITypeEditorEditStyle.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Drawing.Design.UITypeEditorEditStyle.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Design
-{
- public enum UITypeEditorEditStyle{
- DropDown=1,
- Modal=2,
- None=3
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
deleted file mode 100644
index cf74d68dffe..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
+++ /dev/null
@@ -1,7 +0,0 @@
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * ChangeLog : Add.
-
- * Matrix.cs : MonoTODO everywhere.
-
- * TODOAttribute.cs : Add here too. \ No newline at end of file
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs
deleted file mode 100644
index 3ba9f61892e..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Enums.cs
+++ /dev/null
@@ -1,258 +0,0 @@
-//
-// System.Drawing.Drawing2D.Matrix.cs
-//
-// Author:
-// Stefan Maierhofer <sm@cg.tuwien.ac.at>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Drawing.Drawing2D
-{
-
- public enum CombineMode
- {
- Complement,
- Exclude,
- Intersect,
- Replace,
- Union,
- Xor
- }
-
- public enum CompositingMode
- {
- SourceCopy,
- SourceOver
- }
-
- public enum CompositingQuality
- {
- AssumeLinear,
- Default,
- GammaCorrected,
- HighQuality,
- HighSpeed,
- Invalid
- }
-
- public enum CoordinateSpace
- {
- Device,
- Page,
- World
- }
-
- public enum DashCap
- {
- Flat,
- Round,
- Triangle
- }
-
- public enum DashStyle
- {
- Custom,
- Dash,
- DashDot,
- DashDotDot,
- Dot,
- Solid
- }
-
- public enum FillMode
- {
- Alternate,
- Winding
- }
-
- public enum FlushIntention
- {
- Flush,
- Sync
- }
-
- public enum HatchStyle
- {
- BackwardDiagonal,
- Cross,
- DarkDownwardDiagonal,
- DarkHorizontal,
- DarkUpwardDiagonal,
- DarkVertical,
- DashedDownwardDiagonal,
- DashedHorizontal,
- DashedUpwardDiagonal,
- DashedVertical,
- DiagonalBrick,
- DiagonalCross,
- Divot,
- DottedDiamond,
- DottedGrid,
- ForwardDiagonal,
- Horizontal,
- HorizontalBrick,
- LargeCheckerBoard,
- LargeConfetti,
- LargeGrid,
- LightDownwardDiagonal,
- LightHorizontal,
- LightUpwardDiagonal,
- LightVertical,
- Max,
- Min,
- NarrowHorizontal,
- NarrowVertical,
- OutlinedDiamond,
- Percent05,
- Percent10,
- Percent20,
- Percent25,
- Percent30,
- Percent40,
- Percent50,
- Percent60,
- Percent70,
- Percent75,
- Percent80,
- Percent90,
- Plaid,
- Shingle,
- SmallCheckerBoard,
- SmallConfetti,
- SmallGrid,
- SolidDiamond,
- Sphere,
- Trellis,
- Vertical,
- Wave,
- Weave,
- WideDownwardDiagonal,
- WideUpwardDiagonal,
- ZigZag
- }
-
- public enum InterpolationMode
- {
- Bicubic,
- Bilinear,
- Default,
- High,
- HighQualityBicubic,
- HighQualityBilinear,
- Invalid,
- Low,
- NearestNeighbour
- }
-
- public enum LinearGradientMode
- {
- BackwardDiagonal,
- ForwardDiagonal,
- Horizontal,
- Vertical
- }
-
- public enum LineCap
- {
- AnchorMask,
- ArrowAnchor,
- Custom,
- DiamondAnchor,
- Flat,
- NoAnchor,
- Round,
- RoundAnchor,
- Square,
- SquareAnchor,
- Triangle
- }
-
- public enum LineJoin
- {
- Bevel,
- Miter,
- MiterClipped,
- Round
- }
-
- public enum MatrixOrder
- {
- Append,
- Prepend
- }
-
- public enum PathPointType
- {
- Bezier,
- Bezier3,
- CloseSubpath,
- DashMode,
- Line,
- PathMarker,
- PathTypeMask,
- Start
- }
-
- public enum PenAlignment
- {
- Center,
- Inset,
- Left,
- Outset,
- Right
- }
-
- public enum PenType
- {
- HatchFill,
- LinearGradient,
- PathGradient,
- SolidColor,
- TextureFill
- }
-
- public enum PixelOffsetMode
- {
- Default,
- Half,
- HighQuality,
- HighSpeed,
- Invalid,
- None
- }
-
- public enum QualityMode
- {
- Default,
- Hight,
- Invalid,
- Low
- }
-
- public enum SmoothingMode
- {
- AntiAlias,
- Default,
- HighQuality,
- HighSpeed,
- Invalid,
- None
- }
-
- public enum WarpMode
- {
- Bilinear,
- Perspective
- }
-
- public enum WrapMode
- {
- Clamp,
- Tile,
- TileFlipX,
- TileFlipXY,
- TileFlipY
- }
-
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs
deleted file mode 100644
index 2163ac94984..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/Matrix.cs
+++ /dev/null
@@ -1,453 +0,0 @@
-//
-// System.Drawing.Drawing2D.Matrix.cs
-//
-// Author:
-// Stefan Maierhofer <sm@cg.tuwien.ac.at>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Drawing;
-using System.Runtime.InteropServices;
-
-namespace System.Drawing.Drawing2D
-{
- public sealed class Matrix : MarshalByRefObject, IDisposable
- {
- // initialize to identity
- private float[] m = {1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f};
-
- // constructors
- public Matrix() { }
-
- /* TODO: depends on System.Drawing.Drawing2D.Rectangle
- public Matrix(Rectangle rect , Point[] plgpts)
- {
- // TODO
- }
- */
-
- /* TODO: depends on System.Drawing.Drawing2D.RectangleF
- public Matrix(RectangleF rect , PointF[] pa)
- {
- // TODO
- }
- */
- public Matrix(float m11, float m12,
- float m21, float m22,
- float dx, float dy)
- {
- m[0] = m11; m[1] = m12;
- m[2] = m21; m[3] = m22;
- m[4] = dx; m[5] = dy;
- }
-
- // properties
- public float[] Elements
- {
- get { return m; }
- }
-
- public bool IsIdentity
- {
- get
- {
- if ( (m[0] == 1.0f) && (m[1] == 0.0f) &&
- (m[2] == 0.0f) && (m[3] == 1.0f) &&
- (m[4] == 0.0f) && (m[5] == 0.0f) )
- return true;
- else
- return false;
- }
- }
-
- public bool IsInvertible
- {
- get
- {
- // matrix M is invertible if det(M) != 0
- float det = m[0] * m[3] - m[2] * m[1];
- if (det != 0.0f) return true;
- else return false;
- }
- }
-
- public float OffsetX
- {
- get { return m[4]; }
- }
-
- public float OffsetY
- {
- get { return m[5]; }
- }
-
- // methods
- public Matrix Clone()
- {
- return new Matrix(m[0], m[1], m[2], m[3], m[4], m[5]);
- }
-
- public void Dispose() { }
-
- public override bool Equals(object obj)
- {
- if (obj is Matrix)
- {
- float[] a = ((Matrix)obj).Elements;
- if ( m[0] == a[0] && m[1] == a[1] &&
- m[2] == a[2] && m[3] == a[3] &&
- m[4] == a[4] && m[5] == a[5] )
- return true;
- else
- return false;
- }
- else
- {
- return false;
- }
- }
-
- ~Matrix() {}
-
- [StructLayout(LayoutKind.Explicit)]
- internal struct BitConverter
- {
- [FieldOffset(0)] public float f;
- [FieldOffset(0)] public int i;
- }
-
- public override int GetHashCode()
- {
- BitConverter b;
- // compiler is not smart
- b.i = 0;
- int h = 0;
- for (int i = 0; i < 6; i++)
- {
- b.f = m[i];
- h ^= b.i >> i;
- }
- return h;
- }
-
- public void Invert()
- {
- float det = m[0] * m[3] - m[2] * m[1];
- if (det != 0.0f) // if invertible
- {
- float[] r =
- {
- m[3] / det,
- -m[1] / det,
- -m[2] / det,
- m[0] / det,
- (-m[3] * m[4] + m[1] * m[5]) / det,
- (m[2] * m[4] - m[0] * m[5]) / det
- };
- m = r;
- }
- }
-
- public void Multiply(Matrix matrix)
- {
- Multiply(matrix, MatrixOrder.Prepend);
- }
-
- public void Multiply(Matrix matrix, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = matrix * this
- float[] p = matrix.Elements;
- float[] r0 =
- {
- p[0] * m[0] + p[1] * m[2],
- p[0] * m[1] + p[1] * m[3],
- p[2] * m[0] + p[3] * m[2],
- p[2] * m[1] + p[3] * m[3],
- p[4] * m[0] + p[5] * m[2] + m[4],
- p[4] * m[1] + p[5] * m[3] + m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * matrix
- float[] a = matrix.Elements;
- float[] r1 =
- {
- m[0] * a[0] + m[1] * a[2],
- m[0] * a[1] + m[1] * a[3],
- m[2] * a[0] + m[3] * a[2],
- m[2] * a[1] + m[3] * a[3],
- m[4] * a[0] + m[5] * a[2] + a[4],
- m[4] * a[1] + m[5] * a[3] + a[5]
- };
- m = r1;
- break;
- }
- }
-
- public void Reset()
- {
- m[0] = 1.0f; m[1] = 0.0f;
- m[2] = 0.0f; m[3] = 1.0f;
- m[4] = 0.0f; m[5] = 0.0f;
- }
-
- public void Rotate(float angle)
- {
- Rotate(angle, MatrixOrder.Prepend);
- }
-
- public void Rotate(float angle, MatrixOrder order)
- {
- angle *= (float)(Math.PI / 180.0); // degrees to randians
- float cos = (float)Math.Cos(angle);
- float sin = (float)Math.Sin(angle);
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = rotation * this
- float[] r0 =
- {
- cos * m[0] + sin * m[2],
- cos * m[1] + sin * m[3],
- -sin * m[0] + cos * m[2],
- -sin * m[1] + cos * m[3],
- m[4],
- m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * rotation
- float[] r1 =
- {
- m[0] * cos + m[1] * -sin,
- m[0] * sin + m[1] * cos,
- m[2] * cos + m[3] * -sin,
- m[2] * sin + m[3] * cos,
- m[4] * cos + m[5] * -sin,
- m[4] * sin + m[5] * cos
- };
- m = r1;
- break;
- }
- }
-
- public void RotateAt(float angle, PointF point)
- {
- RotateAt(angle, point, MatrixOrder.Prepend);
- }
-
- public void RotateAt(float angle, PointF point, MatrixOrder order)
- {
- angle *= (float)(Math.PI / 180.0); // degrees to randians
- float cos = (float)Math.Cos(angle);
- float sin = (float)Math.Sin(angle);
- float e4 = -point.X * cos + point.Y * sin + point.X;
- float e5 = -point.X * sin - point.Y * cos + point.Y;
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = rotation * this
- float[] r0 =
- {
- cos * m[0] + sin * m[2],
- cos * m[1] + sin * m[3],
- -sin * m[0] + cos * m[2],
- -sin * m[1] + cos * m[3],
- e4 * m[0] + e5 * m[2] + m[4],
- e4 * m[1] + e5 * m[3] + m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * rotation
- float[] r1 =
- {
- m[0] * cos + m[1] * -sin,
- m[0] * sin + m[1] * cos,
- m[2] * cos + m[3] * -sin,
- m[2] * sin + m[3] * cos,
- m[4] * cos + m[5] * -sin + e4,
- m[4] * sin + m[5] * cos + e5
- };
- m = r1;
- break;
- }
- }
-
- public void Scale(float scaleX, float scaleY)
- {
- Scale(scaleX, scaleY, MatrixOrder.Prepend);
- }
-
- public void Scale(float scaleX, float scaleY, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = scale * this
- m[0] *= scaleX; m[1] *= scaleX;
- m[2] *= scaleY; m[3] *= scaleY;
- break;
- case MatrixOrder.Append:
- // this = this * scale
- m[0] *= scaleX; m[1] *= scaleY;
- m[2] *= scaleX; m[3] *= scaleY;
- m[4] *= scaleX; m[5] *= scaleY;
- break;
- }
- }
-
- public void Shear(float shearX, float shearY)
- {
- Shear(shearX, shearY, MatrixOrder.Prepend);
- }
-
- // LAMESPEC: quote from beta 2 sdk docs: "[To be supplied!]"
- //
- // assuming transformation matrix:
- //
- // (1 shearY 0)
- // (shearX 1 0)
- // (0 0 1)
- //
- public void Shear(float shearX, float shearY, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = shear * this
- float[] r0 =
- {
- m[0] + shearY * m[2],
- m[1] + shearY * m[3],
- shearX * m[0] + m[2],
- shearX * m[1] + m[3],
- m[4],
- m[5]
- };
- m = r0;
- break;
- case MatrixOrder.Append:
- // this = this * shear
- float[] r1 =
- {
- m[0] + m[1] * shearX,
- m[0] * shearY + m[1],
- m[2] + m[3] * shearX,
- m[2] * shearY + m[3],
- m[4] + m[5] * shearX ,
- m[4] * shearY + m[5]
- };
- m = r1;
- break;
- }
- }
-
- public void TransformPoints(Point[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = (float)pts[i].X;
- float y = (float)pts[i].Y;
- pts[i].X = (int)(x * m[0] + y * m[2] + m[4]);
- pts[i].Y = (int)(x * m[1] + y * m[3] + m[5]);
- }
- }
-
- public void TransformPoints(PointF[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = pts[i].X;
- float y = pts[i].Y;
- pts[i].X = x * m[0] + y * m[2] + m[4];
- pts[i].Y = x * m[1] + y * m[3] + m[5];
- }
- }
-
- public void TransformVectors(Point[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = (float)pts[i].X;
- float y = (float)pts[i].Y;
- pts[i].X = (int)(x * m[0] + y * m[2]);
- pts[i].Y = (int)(x * m[1] + y * m[3]);
- }
- }
-
- public void TransformVectors(PointF[] pts)
- {
- for (int i = 0; i < pts.Length; i++)
- {
- float x = pts[i].X;
- float y = pts[i].Y;
- pts[i].X = x * m[0] + y * m[2];
- pts[i].Y = x * m[1] + y * m[3];
- }
- }
-
- public void Translate(float offsetX, float offsetY)
- {
- Translate(offsetX, offsetY, MatrixOrder.Prepend);
- }
-
- public void Translate(float offsetX, float offsetY, MatrixOrder order)
- {
- switch (order)
- {
- case MatrixOrder.Prepend:
- // this = translation * this
- m[4] = offsetX * m[0] + offsetY * m[2] + m[4];
- m[5] = offsetX * m[1] + offsetY * m[3] + m[5];
- break;
- case MatrixOrder.Append:
- // this = this * translation
- m[4] += offsetX;
- m[5] += offsetY;
- break;
- }
- }
-
- // LAMESPEC: quote from beta 2 sdk docs: "[To be supplied!]"
- [MonoTODO]
- public void VectorTransformPoints(Point[] pts)
- {
- // TODO
- }
-
- // some simple test (TODO: remove)
- /*
- public static void Main()
- {
- PointF[] p = {new PointF(1.0f, 2.0f)};
- Console.WriteLine("(" + p[0].X + " " + p[0].Y + ")");
- Matrix m = new Matrix();
-
- m.Translate(1.0f, 1.0f);
- m.Scale(2.0f, 2.0f);
- m.Rotate(180.0f);
-
- m.TransformPoints(p);
- Console.WriteLine("(" + p[0].X + " " + p[0].Y + ")");
- m.Invert();
- m.TransformPoints(p);
- Console.WriteLine("(" + p[0].X + " " + p[0].Y + ")");
-
- Matrix a = new Matrix(1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f);
- Matrix b = new Matrix(2.0f, 0.0f, 0.0f, 2.0f, 0.0f, 0.0f);
-
- Console.WriteLine("h(a) = " + a.GetHashCode());
- Console.WriteLine("h(b) = " + b.GetHashCode());
- }
- */
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs
deleted file mode 100755
index e5f49323e96..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/PenAlignment.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Drawing.Drawing2D.PenAlignment.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Drawing {
-
- public enum PenAlignment {
- Center = 0,
- Inset = 1,
- Outset = 2,
- Left = 3,
- Right =4
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs
deleted file mode 100644
index 0920ce8f92d..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/TODOAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- public class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs
deleted file mode 100755
index d072cde7eb0..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/BitmapData.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.Drawing.Imaging.BitmapData.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Drawing.Imaging
-{
- public sealed class BitmapData {
- int width, height, stride, reserved;
- PixelFormat pixel_format;
- IntPtr address;
-
- public int Height {
- get {
- return height;
- }
-
- set {
- height = value;
- }
- }
-
- public int Width {
- get {
- return width;
- }
-
- set {
- width = value;
- }
- }
-
- public PixelFormat PixelFormat {
- get {
- return pixel_format;
- }
-
- set {
- pixel_format = value;
- }
- }
-
- public int Reserved {
- get {
- return reserved;
- }
-
- set {
- reserved = value;
- }
- }
-
- public IntPtr Scan0 {
- get {
- return address;
- }
-
- set {
- address = value;
- }
- }
-
- public int Stride {
- get {
- return stride;
- }
-
- set {
- stride = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog
deleted file mode 100644
index bbf9f2af2b7..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog
+++ /dev/null
@@ -1,17 +0,0 @@
-2002-05-03 Mike Kestner <mkestner@speakeasy.net>
-
- * Metafile.cs : Use System.IO. Fix exception typos.
-
-2002-04-27 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * Metafile.cs: Copyright now holds Ximian.
-
-2002-04-21 Dennis Hayes <dennish@raytek.com>
-
- * corrected emum values.
-
-2002-04-14 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * ChangeLog: created.
- * Metafile.cs: Added. Wrote some ctors. No impl done, yet.
-
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorAdjustType.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorAdjustType.cs
deleted file mode 100644
index d445a9b5afe..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorAdjustType.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Drawing.Imaging.ColorAdjustType.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ColorAdjustType {
- Any = 6,
- Bitmap = 1,
- Brush = 2,
- Count = 5,
- Default = 0,
- Pen = 3,
- Text = 4
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorChannelFlag.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorChannelFlag.cs
deleted file mode 100644
index 82f07834b68..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorChannelFlag.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Drawing.Imaging.ColorChannelFlag.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ColorChannelFlag {
- ColorChannelC = 0,
- ColorChannelK = 3,
- ColorChannelLast = 4,
- ColorChannelM = 1,
- ColorChannelY = 2
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMapType.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMapType.cs
deleted file mode 100644
index 0943f290da2..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMapType.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Drawing.Imaging.ColorMapType.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ColorMapType{//check
- Brush = 1,
- Default = 0
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrixFlag.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrixFlag.cs
deleted file mode 100644
index f244e02447f..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMatrixFlag.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Drawing.Imaging.ColorMatrixFlag.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ColorMatrixFlag{
- AltGrays = 2,
- Default = 0,
- SkipGrays = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMode.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMode.cs
deleted file mode 100644
index 91872fa6247..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorMode.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Drawing.Imaging.ColorMode.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ColorMode {
- Argb32Mode = 0,
- Argb64Mode = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs
deleted file mode 100755
index 24dcf25d444..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ColorPalette.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Drawing.Imaging.ColorPalette.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com
-//
-
-using System;
-
-namespace System.Drawing.Imaging
-{
- public sealed class ColorPalette {
- // 0x1: the color values in the array contain alpha information
- // 0x2: the color values are grayscale values.
- // 0x4: the colors in the array are halftone values.
-
- int flags;
- Color [] entries;
-
- //
- // There is no public constructor, this will be used somewhere in the
- // drawing code
- //
- internal ColorPalette ()
- {
- flags = 0;
- entries = new Color [0];
- }
-
- public Color [] Entries {
- get {
- return entries;
- }
- }
-
- public int Flags {
- get {
- return flags;
- }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/EmfPlusRecordType.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/EmfPlusRecordType.cs
deleted file mode 100644
index 052604968e7..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/EmfPlusRecordType.cs
+++ /dev/null
@@ -1,262 +0,0 @@
-//
-// System.Drawing.Imaging.EmfPlusRecordType.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum EmfPlusRecordType {
- BeginContainer = 16423,
- BeginContainerNoParams = 16424,
- Clear = 16393,
- Comment = 16387,
- DrawArc = 16402,
- DrawBeziers = 16409,
- DrawClosedCurve = 16407,
- DrawCurve = 16408,
- DrawDriverString = 16438,
- DrawEllipse = 16399,
- DrawImage = 16410,
- DrawImagePoints = 16411,
- DrawLines = 16397,
- DrawPath = 16405,
- DrawPie = 16401,
- DrawRects = 16395,
- DrawString = 16412,
- EmfAbortPath = 68,
- EmfAlphaBlend = 114,
- EmfAngleArc = 41,
- EmfArcTo = 55,
- EmfBeginPath = 59,
- EmfBitBlt = 76,
- EmfChord = 46,
- EmfCloseFigure = 61,
- EmfColorCorrectPalette = 111,
- EmfColorMatchToTargetW = 121,
- EmfCreateBrushIndirect = 39,
- EmfCreateColorSpace = 99,
- EmfCreateColorSpaceW = 122,
- EmfCreateDibPatternBrushPt = 94,
- EmfCreateMonoBrush = 93,
- EmfCreatePalette = 49,
- EmfCreatePen = 38,
- EmfDeleteColorSpace = 101,
- EmfDeleteObject = 40,
- EmfDrawEscape = 105,
- EmfEllipse = 42,
- EmfEndPath = 60,
- EmfEof = 14,
- EmfExcludeClipRect = 29,
- EmfExtCreateFontIndirect = 82,
- EmfExtCreatePen = 95,
- EmfExtEscape = 106,
- EmfExtFloodFill = 53,
- EmfExtSelectClipRgn = 75,
- EmfExtTextOutA = 83,
- EmfExtTextOutW = 84,
- EmfFillPath = 62,
- EmfFillRgn = 71,
- EmfFlattenPath = 65,
- EmfForceUfiMapping = 109,
- EmfFrameRgn = 72,
- EmfGdiComment = 70,
- EmfGlsBoundedRecord = 103,
- EmfGlsRecord = 102,
- EmfGradientFill = 118,
- EmfHeader = 1,
- EmfIntersectClipRect = 30,
- EmfInvertRgn = 73,
- EmfLineTo = 54,
- EmfMaskBlt = 78,
- EmfMin = 1,
- EmfModifyWorldTransform = 36,
- EmfMoveToEx = 27,
- EmfNamedEscpae = 110,
- EmfOffsetClipRgn = 26,
- EmfPaintRgn = 74,
- EmfPie = 47,
- EmfPixelFormat = 104,
- EmfPlgBlt = 79,
- EmfPlusRecordBase = 16384,
- EmfPolyBezier = 2,
- EmfPolyBezier16 = 85,
- EmfPolyBezierTo = 5,
- EmfPolyBezierTo16 = 88,
- EmfPolyDraw = 56,
- EmfPolyDraw16 = 92,
- EmfPolygon = 3,
- EmfPolyPolygon16 = 86,
- EmfPolyPolyline = 4,
- EmfPolyline16 = 87,
- EmfPolyPolygon = 8,
- EmfPolyPolyline16 = 91,
- EmfPolyTextOutA = 96,
- EmfPolyTextOutW = 97,
- EmfRealizePalette = 52,
- EmfRectangle = 43,
- EmfReserved069 = 69,
- EmfReserved117 = 117,
- EmfResizePalette = 51,
- EmfRestoreDC = 34,
- EmfRoundArc = 45,
- EmfRoundRect = 44,
- EmfSaveDC = 33,
- EmfScaleViewportExtEx = 31,
- EmfScaleWindowExtEx = 32,
- EmfSelectClipPath = 67,
- EmfSelectObject = 37,
- EmfSelectPalette = 48,
- EmfSetArcDirection = 57,
- EmfSetBkColor = 25,
- EmfSetBkMode = 18,
- EmfSetBrushOrgEx = 13,
- EmfSetColorAdjustment = 23,
- EmfSetColorSpace = 100,
- EmfSetDIBitsToDevice = 80,
- EmfSetIcmMode = 98,
- EmfSetIcmProfileA = 112,
- EmfSetIcmProfileW = 113,
- EmfSetLayout = 115,
- EmfSetLinkedUfis = 119,
- EmfSetMapMode = 17,
- EmfSetMapperFlags = 16,
- EmfSetMetaRgn = 28,
- EmfSetMiterLimit = 58,
- EmfSetPaletteEntries = 50,
- EmfSetPixelV = 15,
- EmfSetPolyFillMode = 19,
- EmfSetROP2 = 20,
- EmfSetStretchBltMode = 21,
- EmfSetTextAlign = 22,
- EmfSetTextColor = 24,
- EmfSetTextJustification =120 ,
- EmfSetViewportExtEx = 11,
- EmfSetViewportOrgEx = 12,
- EmfSetWindowExtEx = 9,
- EmfSetWindowOrgEx = 10,
- EmfSetWorldTransform = 35,
- EmfSmallTextOut = 108,
- EmfStartDoc = 107,
- EmfStretchBlt = 77,
- EmfStretchDIBits = 81,
- EmfStrokeAndFillPath = 63,
- EmfStrokePath = 64,
- EmfTransparentBlt = 116,
- EmfWidenPath = 66,
- EndContainer = 16425,
- EndOfFile = 16386,
- FillClosedCurve = 16406,
- FillEllipse = 16398,
- FillPath = 16404,
- FillPie = 16400,
- FillPolygon = 16396,
- FillRects = 16394,
- FillRegion = 16403,
- GetDC = 16388,
- Header = 16385,
- Invalid = 16384,
- Max = 16438,
- Min = 16385,
- MultiFormatEnd = 16391,
- MultiFormatSection = 16390,
- MultiFormatStart = 16389,
- MultiplyWorldTransform = 16428,
- Object = 16392,
- OffsetClip = 16437,
- ResetClip = 16433,
- ResetWorldTransform = 16427,
- Restore = 16422,
- RotateWorldTransform = 16431,
- Save = 16421,
- ScaleWorldTransform = 16430,
- SetAntiAliasMode = 16414,
- SetClipPath = 16435,
- SetClipRect = 16434,
- SetClipRegion = 16436,
- SetCompositingMode = 16419,
- SetCompositingQuality = 16420,
- SetInterpolationMode = 16417,
- SetPageTransform = 16432,
- SetPixelOffsetMode = 16418,
- SetRenderingOrigin = 16413,
- SetTextContrast = 16416,
- SetTextRenderingHint = 16415,
- SetWorldTransform = 16426,
- Total = 16439,
- TranslateWorldTransform = 16429,
- WmfAnimatePalette = 66614,
- WmfArc = 67607,
- WmfBitBlt = 67874,
- WmfChord = 67632,
- WmfCreateBrushIndirect = 66300,
- WmfCreateFontIndirect = 66299,
- WmfCreatePalette = 65783,
- WmfCreatePatternBrush = 66041,
- WmfCreatePenIndirect = 66298,
- WmfCreateRegion = 67327,
- WmfDeleteObject = 66032,
- WmfDibBitBlt = 67904,
- WmfDibCreatePatternBrush = 65858,
- WmfFillRegion = 66088,
- WmfFloodFill = 66585,
- WmfFrameRegion = 66601,
- WmfIntersectClipRect = 66582,
- WmfInvertRegion = 65834,
- WmfLineTo = 66067,
- WmfMoveTo = 66068,
- WmfOffsetCilpRgn = 66080,
- WmfOffsetViewportOrg = 66065,
- WmfOffsetWindowOrg = 66063,
- WmfPaintRegion = 65835,
- WmfPatBlt = 67101,
- WmfPie = 67610,
- WmfPolygon = 66340,
- WmfPolyline = 66341,
- WmfPolyPolygon = 66872,
- WmfRealizePalette = 65589,
- WmfRecordBase = 65536,
- WmfRectangle = 66587,
- WmfResizePalette = 65849,
- WmfRestoreDC = 65831,
- WmfRoundRect = 67100,
- WmfSaveDC = 65566,
- WmfScaleViewportExt = 66578,
- WmfScaleWindowExt = 66576,
- WmfSelectClipRegion = 65836,
- WmfSelectObject = 65837,
- WmfSelectPalette = 66100,
- WmfSetBkColor = 66049,
- WmfSetBkMode = 65794,
- WmfSetDibToDev = 68915,
- WmfSetLayout = 65865,
- WmfSetMapMode = 65795,
- WmfSetMapperFlags = 66097,
- WmfSetPalEntries = 65591,
- WmfSetPixel = 66591,
- WmfSetPolyFillMode = 65798,
- WmfSetRelAbs = 65797,
- WmfSetROP2 = 65796,
- WmfSetStretchBltMode = 65799,
- WmfSetTextAlign = 65838,
- WmfSetTextCharExtra = 65800,
- WmfSetTextColor = 66057,
- WmfSetTextJustification = 66058,
- WmfSetViewportExt = 66062,
- WmfSetViewportOrg = 66061,
- WmfSetWindowExt = 66060,
- WmfSetWindowOrg = 66059,
- WmfStretchBlt = 68387,
- WmfStretchDib = 69443,
- WmfTextOut = 66849,
- EmfPolyLineTo = 6,
- EmfPolylineTo16 = 89,
- WmfDibStretchBlt = 68417,
- WmfEllipse = 66584,
- WmfEscape = 67110,
- WmfExcludeClipRect = 66581,
- WmfExtFloodFill = 66888,
- WmfExtTextOut = 68146
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/EmfType.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/EmfType.cs
deleted file mode 100644
index f02a42f4923..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/EmfType.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Drawing.Imaging.EmfType.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum EmfType {
- EmfOnly = 3,
- EmfPlusDual = 5,
- EmfPlusOnly = 4
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameterValueType.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameterValueType.cs
deleted file mode 100644
index 6a0071ad20d..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameterValueType.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Drawing.Imaging.EncoderParameterValueType.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum EncoderParameterValueType {
- ValueTypeAscii = 2,
- ValueTypeByte = 1,
- ValueTypeLong = 4,
- ValueTypeLongRange = 6,
- ValueTypeRational = 5,
- ValueTypeRationalRange = 8,
- ValueTypeShort = 3,
- ValueTypeUndefined = 7
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderValue.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderValue.cs
deleted file mode 100644
index 0e51a47031e..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/EncoderValue.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Drawing.Imaging.EncoderValue.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum EncoderValue {
- ColorTypeCMYK = 0,
- ColorTypeYCCK = 1,
- CompressionCCITT3 = 3,
- CompressionCCITT4 = 4,
- CompressionLZW = 2,
- CompressionNone = 6,
- CompressionRle = 5,
- Flush = 20,
- FrameDimensionPage = 23,
- FrameDimensionResolution = 22,
- FrameDimensionTime = 21,
- LastFrame = 19,
- MultiFrame = 18,
- RenderNonProgressive = 12,
- RenderProgressive = 11,
- ScanMethodInterlaced = 7,
- ScanMethodNonInterlaced = 8,
- TransformFlipHorizontal = 16,
- TransformFlipVertical = 17,
- TransformRotate180 = 14,
- TransformRotate270 = 15,
- TransformRotate90 = 13,
- VersionGif87 = 9,
- VersionGif89 = 10
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs
deleted file mode 100644
index cc431619f31..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/FrameDimension.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// created on 21.02.2002 at 17:06
-//
-// FrameDimension.cs
-//
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-
-namespace System.Drawing.Imaging {
-
-using System;
-
-public sealed class FrameDimension {
-
- // constructor
- public FrameDimension (Guid guid) {}
-
- //properties
- public Guid Guid {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static FrameDimension Page {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static FrameDimension Resolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static FrameDimension Time {
- get {
- throw new NotImplementedException ();
- }
- }
-
- //methods
- public override bool Equals (object o) {
- throw new NotImplementedException ();
- }
-
- public override int GetHashCode () {
- throw new NotImplementedException ();
- }
-
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- //destructor
- ~FrameDimension () {}
-}
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageCodecFlags.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ImageCodecFlags.cs
deleted file mode 100644
index 235ebed2fc0..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageCodecFlags.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Drawing.Imaging.ImageCodecFlags.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ImageCodecFlags {
- BlockingDecode = 32,
- Builtin = 65536,
- Decoder = 2,
- Encoder = 1,
- SeekableEncode = 16,
- SupportBitmap = 4,
- SupportVector = 8,
- System = 131072,
- User = 262144
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageFlags.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ImageFlags.cs
deleted file mode 100644
index 61e0ec878a1..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageFlags.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Drawing.Imaging.ImageFlags.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ImageFlags {
- Caching = 131072,
- ColorSpaceCmyk = 32,
- ColorSpaceGray = 64,
- ColorSpaceRgb = 16,
- ColorSpaceYcbcr = 128,
- ColorSpaceYcck = 256,
- HasAlpha = 2,
- HasRealDpi = 4096,
- HasRealPixelSize = 8192,
- HasTranslucent = 4,
- None = 0,
- PartiallyScalable = 8,
- ReadOnly = 65536,
- Scalable = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageLockMode.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/ImageLockMode.cs
deleted file mode 100644
index 14b720acb2b..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/ImageLockMode.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Drawing.Imaging.ImageLockMode.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum ImageLockMode {
- ReadOnly = 1,
- ReadWrite = 3,
- UserInputBuffer = 4,
- WriteOnly = 2
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/Metafile.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/Metafile.cs
deleted file mode 100644
index cfacd57e73a..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/Metafile.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// System.Drawing.Imaging.Metafile.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-using System;
-using System.IO;
-using System.Reflection;
-
-namespace System.Drawing.Imaging {
-
- public sealed class Metafile : Image {
-
- // constructors
- [MonoTODO]
- public Metafile (Stream stream) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string filename) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr henhmetafile, bool deleteEmf) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHtc, EmfType emfType) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHtc, Rectangle frameRect) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHtc, RectangleF frameRect) {
- throw new NotImplementedException ();
- }
-
- //[MonoTODO]
- //public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader) {
- // throw new NotImplementedException ();
- //}
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHtc) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (String fileName, IntPtr referenceHtc) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, EmfType emfType, string description) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit) {
- throw new NotImplementedException ();
- }
-
- //[MonoTODO]
- //public Metafile (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader, bool deleteWmf) {
- // throw new NotImplementedException ();
- //}
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, EmfType type) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, Rectangle frameRect) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (Stream stream, IntPtr referenceHdc, RectangleF frameRect) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, EmfType type) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Metafile (string fileName, IntPtr referenceHdc, Rectangle frameRect) {
- throw new NotImplementedException ();
- }
-
- // methods
- // properties
- }
-
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/MetafileFrameUnit.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/MetafileFrameUnit.cs
deleted file mode 100644
index 97d59c6c0c1..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/MetafileFrameUnit.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Drawing.Imaging.MetafileFrameUnit.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum MetafileFrameUnit {
- Document = 5,
- GdiCompatible = 7,
- Inch = 4,
- Millimeter = 6,
- Pixel = 2,
- Point = 3
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/PaletteFlags.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/PaletteFlags.cs
deleted file mode 100644
index 007313d0622..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/PaletteFlags.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Drawing.Imaging.PaletteFlags.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Imaging
-{
- public enum PaletteFlags {
- GrayScale = 2,
- Halftone = 4,
- HasAlpha = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs b/mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs
deleted file mode 100644
index abc675c4739..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Imaging/PixelFormat.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// created on 20.02.2002 at 21:18
-//
-// Image.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-// Dennis Hayes
-// dennish@raytek.com
-//
-//
-namespace System.Drawing.Imaging {
-
- public enum PixelFormat {
- Alpha = 262144,
- Canonical = 2097152,
- DontCare = 0,
- Extended = 1048576,
- Format16bppArgb1555 = 397319,
- Format16bppGrayScale = 1052676,
- Format16bppRgb555 = 135173,
- Format16bppRgb565 = 135174,
- Format1bppIndexed = 196865,
- Format24bppRgb = 137224,
- Format32bppArgb = 2498570,
- Format32bppPArgb = 925707,
- Format32bppRgb = 139273,
- Format48bppRgb = 1060876,
- Format4bppIndexed = 197634,
- Format64bppArgb = 3424269,
- Format64bppPArgb = 1851406,
- Format8bppIndexed = 198659,
- Gdi = 131072,
- Indexed = 65536,
- Max = 15,
- PAlpha = 524288,
- Undefined = 0 //shows up in enumcheck as second "dontcare".
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs b/mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs
deleted file mode 100644
index a158382eea3..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Printing/Duplex.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Drawing.Duplex.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Printing
-{
- public enum Duplex {
- Default = -1,
- Horizontal = 3,
- Simplex = 1,
- Vertical = 2
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs
deleted file mode 100644
index 137a0da4a9b..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PaperKind.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// System.Drawing.PaperKind.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Printing
-{
- public enum PaperKind {
- A2 = 66,
- A3 = 8,
- A3Extra = 63,
- A3ExtraTransverse = 68,
- A3Rotated = 76,
- A3Transverse = 67,
- A4 = 9,
- A4Extra = 53,
- A4Plus = 60,
- A4Rotated = 77,
- A4Small = 10,
- A4Transverse = 55,
- A5 = 11,
- A5Extra = 64,
- A5Rotated = 78,
- A5Transverse = 61,
- A6 = 70,
- A6Rotated = 83,
- APlus = 57,
- B4 = 12,
- B4Envelope = 33,
- B4JisRotated = 79,
- B5Extra,
- B5JisRotated = 80,
- B5Transverse = 61,
- B6Envelope = 35,
- B6Jis = 88,
- B6JisRotated = 89,
- BPlus = 58,
- C3Envelope = 29,
- C4Envelope = 30,
- C5Envelope = 34,
- C65Envelope = 32,
- CSheet = 24,
- Custom = 0,
- DLEnvelope = 27,
- DSheet = 25,
- ESheet = 26,
- Executive = 7,
- Folio = 14,
- GermanLegalFanfold = 41,
- GermanStandardFanfold = 40,
- InviteEnvelope = 47,
- IsoB4 = 42,
- JapaneseDoublePostcard = 69,
- JapaneseDoublePostcardRotated = 81,
- JapaneseEnvelopeChouNumber3 = 73,
- JapaneseEnvelopeChouNumber3Rotated = 86,
- JapaneseEnvelopeChouNumber4 = 74,
- JapaneseEnvelopeChouNumber4Rotated = 87,
- JapaneseEnvelopeKakuNumber2 = 71,
- JapaneseEnvelopeKakuNumber2Rotated = 84,
- JapaneseEnvelopeKakuNumber3 = 72,
- JapaneseEnvelopeKakuNumber3Rotated = 85,
- JapaneseEnvelopeYouNumber4 = 91,
- JapaneseEnvelopeYouNumber4Rotated = 92,
- JapanesePostcard = 43,
- JapanesePostcardRotated = 81,
- Ledger = 4,
- Legal = 5,
- LegalExtra = 51,
- Letter = 1,
- LetterExtra = 50,
- LetterExtraTransverse = 56,
- LetterPlus = 59,
- LetterRotated = 75,
- LetterSmall = 2,
- LetterTransverse = 54,
- MonarchEnvelope = 37,
- Note = 18,
- Number10Envelope = 20,
- Number11Envelope = 21,
- Number12Envelope = 22,
- Number14Envelope = 23,
- Number9Envelope = 19,
- PersonalEnvelope = 38,
- Prc16K = 93,
- Prc16KRotated = 106,
- Prc32K = 94,
- Prc32KBig = 95,
- Prc32KBigRotated = 108,
- Prc32KRotated = 107,
- PrcEnvelopeNumber1 = 96,
- PrcEnvelopeNumber10 = 105,
- PrcEnvelopeNumber10Rotated = 118,
- PrcEnvelopeNumber1Rotated = 109,
- PrcEnvelopeNumber2 = 97,
- PrcEnvelopeNumber2Rotated = 110,
- PrcEnvelopeNumber3 = 98,
- PrcEnvelopeNumber3Rotated = 111,
- PrcEnvelopeNumber4 = 99,
- PrcEnvelopeNumber4Rotated = 112,
- PrcEnvelopeNumber5 = 100,
- PrcEnvelopeNumber5Rotated = 113,
- PrcEnvelopeNumber6 = 101,
- PrcEnvelopeNumber6Rotated = 114,
- PrcEnvelopeNumber7 = 102,
- PrcEnvelopeNumber7Rotated = 115,
- PrcEnvelopeNumber8 = 103,
- PrcEnvelopeNumber8Rotated = 116,
- PrcEnvelopeNumber9 = 104,
- PrcEnvelopeNumber9Rotated = 117,
- Quarto = 15,
- Standard10x11 = 45,
- Standard10x14 = 16,
- Standard11x17 = 17,
- Standard12x11 = 90,
- Standard15x11 = 46,
- Standard9x11 = 44,
- Statement = 6,
- Tabloid = 3,
- TabloidExtra = 52,
- USStandardFanfold = 39
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs
deleted file mode 100644
index a8cd9e0e68e..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PaperSourceKind.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Drawing.PaperSourceKind.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Printing
-{
- public enum PaperSourceKind {
- AutomaticFeed = 7,
- Cassette = 14,
- Custom = 257,
- Envelope = 5,
- FormSource = 15,
- LargeCapacity = 11,
- LargeFormat = 10,
- Lower = 2,
- Manual = 4,
- ManualFeed = 6,
- Middle = 3,
- SmallFormat = 9,
- TractorFeed = 8,
- Upper = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs
deleted file mode 100644
index a43f9e8bf88..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PrintRange.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Drawing.PrintRange.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Printing
-{
- public enum PrintRange {
- AllPages = 0,
- Selection = 1,
- SomePages = 2
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs
deleted file mode 100644
index 7580938c71a..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PrinterResolutionKind.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Drawing.PrinterResolutionKind.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Printing
-{
- public enum PrinterResolutionKind {
- Custom = 0,
- Draft = -1,
- High = -4,
- Low = -2,
- Medium = -3
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnit.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnit.cs
deleted file mode 100644
index ae4209301cc..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PrinterUnit.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Drawing.PrinterUnit.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Printing
-{
- public enum PrinterUnit {
- Display = 0,
- HundredthsOfAMillimeter = 2,
- TenthsOfAMillimeter = 3,
- ThousandthsOfAnInch = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermissionLevel.cs b/mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermissionLevel.cs
deleted file mode 100644
index 0f77f63bf6b..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Printing/PrintingPermissionLevel.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Drawing.PrintingPermissionLevel.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Printing
-{
- public enum PrintingPermissionLevel {
- AllPrinting = 3,
- DefaultPrinting = 2,
- NoPrinting = 0,
- SafePrinting = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Text/GenericFontFamilies.cs b/mcs/class/System.Drawing/System.Drawing.Text/GenericFontFamilies.cs
deleted file mode 100644
index 3b76c6b94b0..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Text/GenericFontFamilies.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Drawing.GenericFontFamilies.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Text
-{
- public enum GenericFontFamilies {
- Monospace = 2,
- SansSerif = 1,
- Serif = 0
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Text/HotkeyPrefix.cs b/mcs/class/System.Drawing/System.Drawing.Text/HotkeyPrefix.cs
deleted file mode 100644
index df0418debc3..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Text/HotkeyPrefix.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Drawing.HotkeyPrefix.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Text
-{
- public enum HotkeyPrefix {
- Hide = 2,
- None = 0,
- Show = 1
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.Text/TextRenderingHint.cs b/mcs/class/System.Drawing/System.Drawing.Text/TextRenderingHint.cs
deleted file mode 100644
index 5f11cdcbb73..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.Text/TextRenderingHint.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Drawing.TextRenderingHint.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-using System;
-namespace System.Drawing.Text
-{
- public enum TextRenderingHint {
- AntiAlias = 4,
- AntiAliasGridFit = 3,
- ClearTypeGridFit = 5,
- SingleBitPerPixel = 2,
- SingleBitPerPixelGridFit = 1,
- SystemDefault = 0
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing.build b/mcs/class/System.Drawing/System.Drawing.build
deleted file mode 100644
index 729894ec2a4..00000000000
--- a/mcs/class/System.Drawing/System.Drawing.build
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for SystemDrawing.dll -->
-
-<project name="System" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <csc target="library" output="../lib/System.Drawing.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- </sources>
- <references>
- <includes name="../lib/corlib.dll"/>
- <includes name="../lib/System.dll"/>
- </references>
- </csc>
- </target>
- <target name="clean">
- <delete file="../lib/System.Drawing.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.Drawing/System.Drawing/Bitmap.cs b/mcs/class/System.Drawing/System.Drawing/Bitmap.cs
deleted file mode 100755
index f874c056179..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Bitmap.cs
+++ /dev/null
@@ -1,278 +0,0 @@
-//
-// System.Drawing.Bitmap.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-// No implementation has been done yet. I first want to write the method
-// headers of every System.Drawing.
-//
-//Buid warnings. Note add 6 to line numbers for these comments!
-//C:\cygwin\usr\local\mcs\class\System.Drawing\System.Drawing\Bitmap.cs(47,18): warning CS0649: Field 'System.Drawing.RGBQUAD.rgbBlue' is never assigned to, and will always have its default value 0
-//C:\cygwin\usr\local\mcs\class\System.Drawing\System.Drawing\Bitmap.cs(48,18): warning CS0649: Field 'System.Drawing.RGBQUAD.rgbGreen' is never assigned to, and will always have its default value 0
-//C:\cygwin\usr\local\mcs\class\System.Drawing\System.Drawing\Bitmap.cs(49,18): warning CS0649: Field 'System.Drawing.RGBQUAD.rgbRed' is never assigned to, and will always have its default value 0
-//C:\cygwin\usr\local\mcs\class\System.Drawing\System.Drawing\Bitmap.cs(50,18): warning CS0649: Field 'System.Drawing.RGBQUAD.rgbReserved' is never assigned to, and will always have its default value 0
-//C:\cygwin\usr\local\mcs\class\System.Drawing\System.Drawing\Bitmap.cs(54,20): warning CS0649: Field 'System.Drawing.BITMAPINFO.colorpalette' is never assigned to, and will always have its default value null
-// 2002-03-27 Christian Meyer <Christian.Meyer@cs.tum.edu>
-// I'll have a closer look at it next week.
-//
-using System;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.IO;
-
-namespace System.Drawing {
- struct BITMAPFILEHEADER { // File info header
- public uint bfType; // Specifies the type of file. This member must be BM.
- public uint bfSize; // Specifies the size of the file, in bytes.
- public uint bfReserved1; // Reserved; must be set to zero.
- public uint bfReserved2; // Reserved; must be set to zero.
- public uint bfOffBits; // Specifies the byte offset from the BITMAPFILEHEADER
- // structure to the actual bitmap data in the file.
- }
- struct BITMAPINFOHEADER { // bitmap info header
- public uint biSize;
- public int biWidth;
- public int biHeight;
- public ushort biPlanes;
- public ushort biBitCount;
- public uint biCompression;
- public uint biSizeImage;
- public int biXPelsPerMeter;
- public int biYPelsPerMeter;
- public uint biClrUsed;
- public uint biClrImportant;
- }
-
- struct RGBQUAD {
- public byte rgbBlue;
- public byte rgbGreen;
- public byte rgbRed;
- public byte rgbReserved;
- }
- struct BITMAPINFO { // bitmap info
- public BITMAPINFOHEADER bitmapinfoheader;
- public RGBQUAD[] colorpalette;
- }
- // I do not think pinning is needed execpt for when locked
- // Is layout packed attribute needed here?
- struct bitmapstruct {
- //placed in a struct to keep all 3 (4 including the color table) contugious in memory.)
- public BITMAPFILEHEADER fileheader; //File info header
- //bitmapinfo includes the color table
- public BITMAPINFO info; //bitmap info
- public byte[,] bits; //Actual bitmap bits
- }
- public sealed class Bitmap : Image {
- // TODO: add following to an enum with BI_RLE4 and BI_RLE8
- const int BI_RGB = 0; //? 0 is from example;
- bitmapstruct bitmap = new bitmapstruct();
- private void CommonInit (int width, int height) {
- // Init BITMAPFILEHANDLE
- // document I am working from says tyoe must allways be "BM",
- // the example has this set to 19778.
- // TODO: verify magic number 19778 for "BM" bfType
- bitmap.fileheader.bfType = 19778;
- // TODO: is this the correct file size?
- bitmap.fileheader.bfSize = (uint)
- //bitmap
- (width * height * 4)
- //add color table, 0 for now
- + 0
- // add header
- + 60;
- bitmap.fileheader.bfReserved1 = 0;
- bitmap.fileheader.bfReserved2 = 0;
- // bfOffBits is bytes offset between start of bitmap (bimapfileheader)
- // and start of actual data bits.
- // Example puts it at 118 including 64 bytes of color table.
- // I count 124. What is right?
- // Also I force 32 bit color for first pass, so for now there is no color table (24 bit or greater)
- // TODO: verify magic number 124 for bfOffBits
- // TODO: Could also be sizeof(fileheader and bitmapinfo)
- bitmap.fileheader.bfOffBits = 60; //14 * 4 for ints + 2 * 2 for words.
-
- // Init BITMAPINFO HEADER
- // TODO: document on bitmaps shows only 1, 4, 8, 24 as valid pixel depths
- // TODO; MS's document says 32ppARGB is 32 bits per pixle, the default.
-
- bitmap.info.bitmapinfoheader.biBitCount = 32;
- // biclrused is the number of colors in the bitmap that are actualy used
- // in the bitmap. 0 means all. default to this.
- // TODO: As far as I know, it is fine to leave this as 0, but
- // TODO: that it would be better to do an actual count.
- // TODO: If we open an already created bitmap, we could in a later
- // TODO: version store that.
- bitmap.info.bitmapinfoheader.biClrUsed = 0;
- // biclrused is the number of colors in the bitmap that are importiant
- // in the bitmap. 0 means all. default to this.
- // TODO: As far as I know, it is fine to leave this as 0,
- // TODO: If we open an already created bitmap, we could in a later
- // TODO: version store that.
- // In a new bitmap, I do not know how we would know which colors are importiant.
- bitmap.info.bitmapinfoheader.biClrImportant = 0;
- // Options are BI_RGB for none, BI_RLE8 for 8 bit color ,BI_RLE4 for 4 bit color
- // Only supprt BI_RGB for now;
- // TODO: add definition for BI_***
- // TODO: correctly set biSizeImage before supporting compression.
- bitmap.info.bitmapinfoheader.biCompression = BI_RGB;
- bitmap.info.bitmapinfoheader.biHeight = height;
- bitmap.info.bitmapinfoheader.biWidth = width;
- // TODO: add support for more planes
- bitmap.info.bitmapinfoheader.biPlanes = 1;
- // TODO: replace 40 with a sizeof() call
- bitmap.info.bitmapinfoheader.biSize = 40;// size of this structure.
- // TODO: correctly set biSizeImage so compression can be supported.
- bitmap.info.bitmapinfoheader.biSizeImage = 0; //0 is allowed for BI_RGB (no compression)
- // The example uses 0 for pels per meter, so do I.
- // TODO: support pels per meter
- bitmap.info.bitmapinfoheader.biXPelsPerMeter = 0;
- bitmap.info.bitmapinfoheader.biYPelsPerMeter = 0;
- bitmap.bits = new byte[width*4, height];
- }
- #region constructors
- // constructors
- public Bitmap (int width, int height) {
- CommonInit (width, height);
- }
-
- public Bitmap (int width, int height, Graphics g) {
- //TODO: Error check X,Y
- CommonInit (width,height);
- //TODO: use graphics to set vertial and horzontal resolution.
- //TODO: that is all the spec requires or desires
- }
-
- public Bitmap (int width, int heigth, PixelFormat format) {
- if ((int)format != BI_RGB) {
- throw new NotImplementedException ();
- }
- CommonInit (width, heigth);
- }
-
- public Bitmap (Image origial) {
- throw new NotImplementedException ();
- //this.original = original;
- }
-
- public Bitmap (Stream stream) {
- throw new NotImplementedException ();
- //this.stream = stream;
- }
-
- public Bitmap (string filename) {
- throw new NotImplementedException ();
- //this.filename = filename;
- }
-
- public Bitmap (Image original, Size newSize) {
- throw new NotImplementedException ();
- //this.original = original;
- //this.newSize = newSize;
- }
-
- public Bitmap (Stream stream, bool useIcm) {
- throw new NotImplementedException ();
- //this.stream = stream;
- //this.useIcm = useIcm;
- }
-
- public Bitmap (string filename, bool useIcm) {
- throw new NotImplementedException ();
- //this.filename = filename;
- //this.useIcm = useIcm;
- }
-
- public Bitmap (Type type, string resource) {
- throw new NotImplementedException ();
- //this.type = type;
- //this.resource = resource;
- }
-
- public Bitmap (Image original, int width, int heigth) {
- throw new NotImplementedException ();
- //this.original = original;
- //this.width = width;
- //this.heigth = heigth;
- }
-
-
- public Bitmap (int width, int height, int stride,
- PixelFormat format, IntPtr scan0) {
- throw new NotImplementedException ();
- //this.width = width;
- //this.heigth = heigth;
- //this.stride = stride;
- //this.format = format;
- //this.scan0 = scan0;
- }
- #endregion
- // methods
- public Color GetPixel (int x, int y) {
- //TODO: Error check X,Y
- return Color.FromArgb (bitmap.bits[x,y], bitmap.bits[x+1,y], bitmap.bits[x+2,y], bitmap.bits[x+3,y]);
- }
-
- public void SetPixel (int x, int y, Color color) {
- //TODO: Error check X,Y
- bitmap.bits[x, y] = color.A;
- bitmap.bits[x + 1, y] = color.R;
- bitmap.bits[x + 2, y] = color.G;
- bitmap.bits[x + 2, y] = color.B;
- }
-
- public Bitmap Clone (Rectangle rect,PixelFormat format) {
- throw new NotImplementedException ();
- }
-
- public Bitmap Clone (RectangleF rect, PixelFormat format) {
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromHicon (IntPtr hicon) {
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromResource (IntPtr hinstance,
- string bitmapName) {
- throw new NotImplementedException ();
- }
-
- public IntPtr GetHbitmap () {
- throw new NotImplementedException ();
- }
-
- public IntPtr GetHbitmap (Color background) {
- throw new NotImplementedException ();
- }
-
- public IntPtr GetHicon () {
- throw new NotImplementedException ();
- }
-
- public BitmapData LockBits (Rectangle rect, ImageLockMode flags,
- PixelFormat format) {
- throw new NotImplementedException ();
- }
-
- public void MakeTransparent () {
- throw new NotImplementedException ();
- }
-
- public void MakeTransparent (Color transparentColor) {
- throw new NotImplementedException ();
- }
-
- public void SetResolution (float xDpi, float yDpi) {
- throw new NotImplementedException ();
- }
-
- public void UnlockBits (BitmapData bitmapdata) {
- throw new NotImplementedException ();
- }
-
- // properties
- // needs to be done ###FIXME###
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Brush.cs b/mcs/class/System.Drawing/System.Drawing/Brush.cs
deleted file mode 100755
index 731f2d55408..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Brush.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Drawing.Brush.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Drawing {
-
- public abstract class Brush : MarshalByRefObject, ICloneable, IDisposable {
-
- abstract public object Clone ();
-
- public void Dispose ()
- {
- Dispose (true);
- System.GC.SuppressFinalize (this);
- }
-
- void Dispose (bool disposing)
- {
- // Nothing for now.
- }
-
- ~Brush ()
- {
- Dispose (false);
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog
deleted file mode 100644
index 5e100615ed8..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/ChangeLog
+++ /dev/null
@@ -1,54 +0,0 @@
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Color.cs: added TypeConverter attribute.
-
- * ColorConverter.cs: added constructor.
-
-2002-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ColorConverter.cs: implemented minimal set of features needed by xsp.
-
-2002-05-03 Mike Kestner <mkestner@speakeasy.net>
-
- * Bitmap.cs : using System.IO
- * ColorTranslator.cs : Stubbed off build breakers.
- * Image.cs : Stub off IDisposable and ICloneable.
-
-2002-04-27 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * Bitmap.cs: Ximian is the new copyright holder now.
- * Image.cs: ditto
-
-2002-04-05 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * Uppercased several files.
-
-2002-04-05 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * color.cs: Fixed a typo in GetSaturation ().
-
-2002-02-26 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * Bitmap.cs: Added method headers.
-
-2002-02-25 Christian Meyer <Christian.Meyer@cs.tum.edu>
-
- * Bitmap.cs: Added, no implementation's done, yet.
-
-2001-12-15 Mike Kestner <mkestner@speakeasy.net>
-
- * Rectangle.cs : Add a doc comment.
- * RectangleF.cs : New struct implementation.
-
-2001-12-15 Mike Kestner <mkestner@speakeasy.net>
-
- * Rectangle.cs : New struct implementation.
-
-2001-08-17 Mike Kestner <mkestner@speakeasy.net>
-
- * PointF.cs, Size.cs, SizeF.cs : New struct implementations.
-
-2001-08-16 Mike Kestner <mkestner@speakeasy.net>
-
- * Point.cs : New. Implementation of System.Drawing.Point struct.
-
diff --git a/mcs/class/System.Drawing/System.Drawing/Color.cs b/mcs/class/System.Drawing/System.Drawing/Color.cs
deleted file mode 100644
index 9b03137de1a..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Color.cs
+++ /dev/null
@@ -1,1284 +0,0 @@
-
-//
-// System.Drawing.Color.cs
-//
-// (C) 2002 Dennis Hayes
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// Ben Houston (ben@exocortex.org)
-//
-// TODO: Are the static/non static functions declared correctly
-
-using System;
-using System.ComponentModel;
-using System.Reflection;
-
-namespace System.Drawing
-{
- [TypeConverter("System.Drawing.ColorConverter,System.Drawing")]
- [Serializable]
- public struct Color
- {
- // Private transparancy (A) and R,G,B fields.
- byte a;
- byte r;
- byte g;
- byte b;
-
- // The specs also indicate that all three of these propities are true
- // if created with FromKnownColor or FromNamedColor, false otherwise (FromARGB).
- // Per Microsoft and ECMA specs these varibles are set by which constructor is used, not by their values.
- bool isknowncolor;
- bool isnamedcolor;
- bool issystemcolor;
-
- string myname;
-
- public string Name {
- get{
- return myname;
- }
- }
-
- public bool IsKnownColor {
- get{
- return isknowncolor;
- }
- }
-
- public bool IsSystemColor {
- get{
- return issystemcolor;
- }
- }
-
- public bool IsNamedColor {
- get{
- return isnamedcolor;
- }
- }
-
-
- public static Color FromArgb (int red, int green, int blue)
- {
- //TODO: convert rgb to name format "12345678"
- CheckRGBValues(red, green, blue);
- Color color;
- color.myname = "";
- color.isknowncolor = false;
- color.isnamedcolor = false;
- color.issystemcolor = false;
- color.a = 255;
- color.r = (byte)red;
- color.g = (byte)green;
- color.b = (byte)blue;
- return color;
- }
-
- public static Color FromArgb (int alpha, int red, int green, int blue)
- {
- //TODO: convert rgb to name format "12345678"
- CheckARGBValues(alpha, red, green, blue);
- Color color;
- color.isknowncolor = false;
- color.isnamedcolor = false;
- color.issystemcolor = false;
- color.myname = "";
- color.a = (byte)alpha;
- color.r = (byte)red;
- color.g = (byte)green;
- color.b = (byte)blue;
- return color;
- }
- public int ToArgb()
- {
- return a << 24 | r << 16 | g << 8 | b;
- }
-
- public static Color FromArgb (int alpha, Color baseColor)
- {
- //TODO: convert basecolor rgb to name
- //check alpha, use valid dummy values for rgb.
- CheckARGBValues(alpha, 0, 0, 0);
- Color color;
- color.isknowncolor = false;
- color.isnamedcolor = false;
- color.issystemcolor = false;
- color.myname = "";
- color.a = (byte)alpha;
- color.r = baseColor.r;
- color.g = baseColor.g;
- color.b = baseColor.b;
- return color;
- }
-
- public static Color FromArgb (int argb)
- {
- //TODO: convert irgb to name
- Color color;
- color.isknowncolor = false;
- color.isnamedcolor = false;
- color.issystemcolor = false;
- color.myname = "";
- color.a = (byte) (argb >> 24);
- color.r = (byte) (argb >> 16);
- color.g = (byte) (argb >> 8);
- color.b = (byte)argb;
- return color;
- }
-
- public static Color FromKnownColor (KnownColor KnownColorToConvert)
- {
-// isknowncolor = true;
-// isnamedcolor = true;
-// issystemcolor = true;
-
-// name = KnownColorToConvert.ToString();
-
- return FromName(KnownColorToConvert.ToString());
- }
-
- public KnownColor ToKnownColor () {
- if(isknowncolor){
- // TODO: return correct enumeration of knowncolor. note the return 0 in the else block is correct.
- return (KnownColor)0;
- }
- else{
- return (KnownColor)0;
- }
- //return KnownColor.FromName(KnownColorToConvert.ToString());
- }
- public static Color FromName( string ColorName )
- {
-// isknowncolor = true;
-// isnamedcolor = true;
-// issystemcolor = true;
-
- string name = ColorName;
-
- Type colorType = typeof( Color );
- PropertyInfo[] properties =
- colorType.GetProperties();
- foreach( PropertyInfo property in properties ){
- if( property.Name == name ){
- MethodInfo method = property.GetGetMethod();
- if( method != null &&
- method.IsStatic == true
- &&
- method.ReturnType ==
- colorType ){
- return (Color)
- method.Invoke( null, new object[0] );
- }
- }
- }
- throw new System.ArgumentException(name + " is not a named color","name");
- }
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized Color Structure
- /// </remarks>
-
- public static readonly Color Empty;
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Color objects. The return value is
- /// based on the equivalence of the A,R,G,B properties
- /// of the two Colors.
- /// </remarks>
-
- public static bool operator == (Color colorA, Color colorB)
- {
- return ((colorA.a == colorB.a) && (colorA.r == colorB.r)
- && (colorA.g == colorB.g) && (colorA.b == colorB.b));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Color objects. The return value is
- /// based on the equivalence of the A,R,G,B properties
- /// of the two colors.
- /// </remarks>
-
- public static bool operator != (Color colorA, Color colorB)
- {
- return ((colorA.a != colorB.a) || (colorA.r != colorB.r)
- || (colorA.g != colorB.g) || (colorA.b != colorB.b));
- }
-
- public float GetBrightness (){
- // Intensity is the normalized sum of the three RGB values.;
- return ((float)(r + g + b))/(255*3);
- }
- public float GetSaturation (){
- // S = 1 - I * Min(r,g,b)
- return (255 -
- (((float)(r + g +b))/3)*Math.Min(r,Math.Min(g,b))
- )/255;
- }
-
- public float GetHue (){
- float top = ((float)(2*r-g-b))/(2*255);
- float bottom = (float)Math.Sqrt(((r-g)*(r-g) + (r-b)*(g-b))/255);
- return (float)Math.Acos(top/bottom);
- }
-
- // -----------------------
- // Public Constructors
- // -----------------------
- public Color(int alpha, int red, int green, int blue)
- {
- CheckARGBValues(alpha, red, green, blue);
- a = (byte)alpha;
- r = (byte)red;
- g = (byte)green;
- b = (byte)blue;
- isknowncolor = false;
- isnamedcolor = false;
- issystemcolor = false;
- myname = "";
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates transparent black. R,G,B = 0; A=0?
- /// </remarks>
-
- public bool IsEmpty
- {
- get {
- return (a + r + g + b) == 0;
- }
- }
-
- /// <summary>
- /// A Property
- /// </summary>
- ///
- /// <remarks>
- /// The transparancy of the Color.
- /// </remarks>
-
- public byte A
- {
- get {
- return a;
- }
- }
-
- /// <summary>
- /// R Property
- /// </summary>
- ///
- /// <remarks>
- /// The red value of the Color.
- /// </remarks>
-
- public byte R
- {
- get {
- return r;
- }
- }
-
- /// <summary>
- /// G Property
- /// </summary>
- ///
- /// <remarks>
- /// The green value of the Color.
- /// </remarks>
-
- public byte G
- {
- get {
- return g;
- }
- }
-
- /// <summary>
- /// B Property
- /// </summary>
- ///
- /// <remarks>
- /// The blue value of the Color.
- /// </remarks>
-
- public byte B
- {
- get {
- return b;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Color and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Color))return false;
- return (this == (Color) o);
- }
-
- /// <summary>
- /// Reference Equals Method
- /// Is commented out because this is handled by the base class.
- /// TODO: Is it correct to let the base class handel reference equals
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Color and another object.
- /// </remarks>
- //public bool ReferenceEquals (object o)
- //{
- // if (!(o is Color))return false;
- // return (this == (Color) o);
- //}
-
-
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return ToArgb().GetHashCode();
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Color as a string in ARGB notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1},{2},{3}]", a, r, g, b);
- }
- private static void CheckRGBValues (int red,int green,int blue)
- {
- if( (red > 255) || (red < 0))
- throw new System.ArgumentOutOfRangeException
- ("red",red,"Value must be in the range 0 - 255");
- if( (green > 255) || (green < 0))
- throw new System.ArgumentOutOfRangeException
- ("green",green,"Value must be in the range 0 - 255");
- if( (blue > 255) || (blue < 0))
- throw new System.ArgumentOutOfRangeException
- ("blue",blue,"Value must be in the range 0 - 255");
- }
-
- private static void CheckARGBValues (int alpha,int red,int green,int blue)
- {
- if( (alpha > 255) || (alpha < 0))
- throw new System.ArgumentOutOfRangeException
- ("alpha",alpha,"Value must be in the range 0 - 255");
- CheckRGBValues(red,green,blue);
- }
-
- //Documentation, do not remove!
- //This is the program that was used to generate the C# source code below.
- //static void Main(string[] args)
- //{
- // Type cType = typeof( Color );
- // PropertyInfo[] properties = cType.GetProperties();
- // foreach( PropertyInfo property in properties )
- // {
- // MethodInfo method = property.GetGetMethod();
- // if( method != null && method.IsStatic && method.ReturnType == cType
- // )
- // {
- // Color c = (Color) method.Invoke( null, new object[0] );
- // Debug.WriteLine( "static public Color " + property.Name + " {" );
- // Debug.WriteLine( "\tget{" );
- // Debug.WriteLine( "\t\treturn Color.FromArgb( " + c.A + ", " + c.R
- // + ", " + c.G + ", " + c.B + " );" );
- // Debug.WriteLine( "\t}" );
- // Debug.WriteLine( "}" );
- // }
- // }
- //}
-
- static public Color Transparent
- {
- get {
- return Color.FromArgb( 0, 255, 255, 255 );
- }
- }
- static public Color AliceBlue
- {
- get {
- return Color.FromArgb( 255, 240, 248, 255 );
- }
- }
- static public Color AntiqueWhite
- {
- get {
- return Color.FromArgb( 255, 250, 235, 215 );
- }
- }
- static public Color Aqua
- {
- get {
- return Color.FromArgb( 255, 0, 255, 255 );
- }
- }
- static public Color Aquamarine
- {
- get {
- return Color.FromArgb( 255, 127, 255, 212 );
- }
- }
- static public Color Azure
- {
- get {
- return Color.FromArgb( 255, 240, 255, 255 );
- }
- }
- static public Color Beige
- {
- get {
- return Color.FromArgb( 255, 245, 245, 220 );
- }
- }
- static public Color Bisque
- {
- get {
- return Color.FromArgb( 255, 255, 228, 196 );
- }
- }
- static public Color Black
- {
- get {
- return Color.FromArgb( 255, 0, 0, 0 );
- }
- }
- static public Color BlanchedAlmond
- {
- get {
- return Color.FromArgb( 255, 255, 235, 205 );
- }
- }
- static public Color Blue
- {
- get {
- return Color.FromArgb( 255, 0, 0, 255 );
- }
- }
- static public Color BlueViolet
- {
- get {
- return Color.FromArgb( 255, 138, 43, 226 );
- }
- }
- static public Color Brown
- {
- get {
- return Color.FromArgb( 255, 165, 42, 42 );
- }
- }
- static public Color BurlyWood
- {
- get {
- return Color.FromArgb( 255, 222, 184, 135 );
- }
- }
- static public Color CadetBlue
- {
- get {
- return Color.FromArgb( 255, 95, 158, 160 );
- }
- }
- static public Color Chartreuse
- {
- get {
- return Color.FromArgb( 255, 127, 255, 0 );
- }
- }
- static public Color Chocolate
- {
- get {
- return Color.FromArgb( 255, 210, 105, 30 );
- }
- }
- static public Color Coral
- {
- get {
- return Color.FromArgb( 255, 255, 127, 80 );
- }
- }
- static public Color CornflowerBlue
- {
- get {
- return Color.FromArgb( 255, 100, 149, 237 );
- }
- }
- static public Color Cornsilk
- {
- get {
- return Color.FromArgb( 255, 255, 248, 220 );
- }
- }
- static public Color Crimson
- {
- get {
- return Color.FromArgb( 255, 220, 20, 60 );
- }
- }
- static public Color Cyan
- {
- get {
- return Color.FromArgb( 255, 0, 255, 255 );
- }
- }
- static public Color DarkBlue
- {
- get {
- return Color.FromArgb( 255, 0, 0, 139 );
- }
- }
- static public Color DarkCyan
- {
- get {
- return Color.FromArgb( 255, 0, 139, 139 );
- }
- }
- static public Color DarkGoldenrod
- {
- get {
- return Color.FromArgb( 255, 184, 134, 11 );
- }
- }
- static public Color DarkGray
- {
- get {
- return Color.FromArgb( 255, 169, 169, 169 );
- }
- }
- static public Color DarkGreen
- {
- get {
- return Color.FromArgb( 255, 0, 100, 0 );
- }
- }
- static public Color DarkKhaki
- {
- get {
- return Color.FromArgb( 255, 189, 183, 107 );
- }
- }
- static public Color DarkMagenta
- {
- get {
- return Color.FromArgb( 255, 139, 0, 139 );
- }
- }
- static public Color DarkOliveGreen
- {
- get {
- return Color.FromArgb( 255, 85, 107, 47 );
- }
- }
- static public Color DarkOrange
- {
- get {
- return Color.FromArgb( 255, 255, 140, 0 );
- }
- }
- static public Color DarkOrchid
- {
- get {
- return Color.FromArgb( 255, 153, 50, 204 );
- }
- }
- static public Color DarkRed
- {
- get {
- return Color.FromArgb( 255, 139, 0, 0 );
- }
- }
- static public Color DarkSalmon
- {
- get {
- return Color.FromArgb( 255, 233, 150, 122 );
- }
- }
- static public Color DarkSeaGreen
- {
- get {
- return Color.FromArgb( 255, 143, 188, 139 );
- }
- }
- static public Color DarkSlateBlue
- {
- get {
- return Color.FromArgb( 255, 72, 61, 139 );
- }
- }
- static public Color DarkSlateGray
- {
- get {
- return Color.FromArgb( 255, 47, 79, 79 );
- }
- }
- static public Color DarkTurquoise
- {
- get {
- return Color.FromArgb( 255, 0, 206, 209 );
- }
- }
- static public Color DarkViolet
- {
- get {
- return Color.FromArgb( 255, 148, 0, 211 );
- }
- }
- static public Color DeepPink
- {
- get {
- return Color.FromArgb( 255, 255, 20, 147 );
- }
- }
- static public Color DeepSkyBlue
- {
- get {
- return Color.FromArgb( 255, 0, 191, 255 );
- }
- }
- static public Color DimGray
- {
- get {
- return Color.FromArgb( 255, 105, 105, 105 );
- }
- }
- static public Color DodgerBlue
- {
- get {
- return Color.FromArgb( 255, 30, 144, 255 );
- }
- }
- static public Color Firebrick
- {
- get {
- return Color.FromArgb( 255, 178, 34, 34 );
- }
- }
- static public Color FloralWhite
- {
- get {
- return Color.FromArgb( 255, 255, 250, 240 );
- }
- }
- static public Color ForestGreen
- {
- get {
- return Color.FromArgb( 255, 34, 139, 34 );
- }
- }
- static public Color Fuchsia
- {
- get {
- return Color.FromArgb( 255, 255, 0, 255 );
- }
- }
- static public Color Gainsboro
- {
- get {
- return Color.FromArgb( 255, 220, 220, 220 );
- }
- }
- static public Color GhostWhite
- {
- get {
- return Color.FromArgb( 255, 248, 248, 255 );
- }
- }
- static public Color Gold
- {
- get {
- return Color.FromArgb( 255, 255, 215, 0 );
- }
- }
- static public Color Goldenrod
- {
- get {
- return Color.FromArgb( 255, 218, 165, 32 );
- }
- }
- static public Color Gray
- {
- get {
- return Color.FromArgb( 255, 128, 128, 128 );
- }
- }
- static public Color Green
- {
- get {
- return Color.FromArgb( 255, 0, 128, 0 );
- }
- }
- static public Color GreenYellow
- {
- get {
- return Color.FromArgb( 255, 173, 255, 47 );
- }
- }
- static public Color Honeydew
- {
- get {
- return Color.FromArgb( 255, 240, 255, 240 );
- }
- }
- static public Color HotPink
- {
- get {
- return Color.FromArgb( 255, 255, 105, 180 );
- }
- }
- static public Color IndianRed
- {
- get {
- return Color.FromArgb( 255, 205, 92, 92 );
- }
- }
- static public Color Indigo
- {
- get {
- return Color.FromArgb( 255, 75, 0, 130 );
- }
- }
- static public Color Ivory
- {
- get {
- return Color.FromArgb( 255, 255, 255, 240 );
- }
- }
- static public Color Khaki
- {
- get {
- return Color.FromArgb( 255, 240, 230, 140 );
- }
- }
- static public Color Lavender
- {
- get {
- return Color.FromArgb( 255, 230, 230, 250 );
- }
- }
- static public Color LavenderBlush
- {
- get {
- return Color.FromArgb( 255, 255, 240, 245 );
- }
- }
- static public Color LawnGreen
- {
- get {
- return Color.FromArgb( 255, 124, 252, 0 );
- }
- }
- static public Color LemonChiffon
- {
- get {
- return Color.FromArgb( 255, 255, 250, 205 );
- }
- }
- static public Color LightBlue
- {
- get {
- return Color.FromArgb( 255, 173, 216, 230 );
- }
- }
- static public Color LightCoral
- {
- get {
- return Color.FromArgb( 255, 240, 128, 128 );
- }
- }
- static public Color LightCyan
- {
- get {
- return Color.FromArgb( 255, 224, 255, 255 );
- }
- }
- static public Color LightGoldenrodYellow
- {
- get {
- return Color.FromArgb( 255, 250, 250, 210 );
- }
- }
- static public Color LightGreen
- {
- get {
- return Color.FromArgb( 255, 144, 238, 144 );
- }
- }
- static public Color LightGray
- {
- get {
- return Color.FromArgb( 255, 211, 211, 211 );
- }
- }
- static public Color LightPink
- {
- get {
- return Color.FromArgb( 255, 255, 182, 193 );
- }
- }
- static public Color LightSalmon
- {
- get {
- return Color.FromArgb( 255, 255, 160, 122 );
- }
- }
- static public Color LightSeaGreen
- {
- get {
- return Color.FromArgb( 255, 32, 178, 170 );
- }
- }
- static public Color LightSkyBlue
- {
- get {
- return Color.FromArgb( 255, 135, 206, 250 );
- }
- }
- static public Color LightSlateGray
- {
- get {
- return Color.FromArgb( 255, 119, 136, 153 );
- }
- }
- static public Color LightSteelBlue
- {
- get {
- return Color.FromArgb( 255, 176, 196, 222 );
- }
- }
- static public Color LightYellow
- {
- get {
- return Color.FromArgb( 255, 255, 255, 224 );
- }
- }
- static public Color Lime
- {
- get {
- return Color.FromArgb( 255, 0, 255, 0 );
- }
- }
- static public Color LimeGreen
- {
- get {
- return Color.FromArgb( 255, 50, 205, 50 );
- }
- }
- static public Color Linen
- {
- get {
- return Color.FromArgb( 255, 250, 240, 230 );
- }
- }
- static public Color Magenta
- {
- get {
- return Color.FromArgb( 255, 255, 0, 255 );
- }
- }
- static public Color Maroon
- {
- get {
- return Color.FromArgb( 255, 128, 0, 0 );
- }
- }
- static public Color MediumAquamarine
- {
- get {
- return Color.FromArgb( 255, 102, 205, 170 );
- }
- }
- static public Color MediumBlue
- {
- get {
- return Color.FromArgb( 255, 0, 0, 205 );
- }
- }
- static public Color MediumOrchid
- {
- get {
- return Color.FromArgb( 255, 186, 85, 211 );
- }
- }
- static public Color MediumPurple
- {
- get {
- return Color.FromArgb( 255, 147, 112, 219 );
- }
- }
- static public Color MediumSeaGreen
- {
- get {
- return Color.FromArgb( 255, 60, 179, 113 );
- }
- }
- static public Color MediumSlateBlue
- {
- get {
- return Color.FromArgb( 255, 123, 104, 238 );
- }
- }
- static public Color MediumSpringGreen
- {
- get {
- return Color.FromArgb( 255, 0, 250, 154 );
- }
- }
- static public Color MediumTurquoise
- {
- get {
- return Color.FromArgb( 255, 72, 209, 204 );
- }
- }
- static public Color MediumVioletRed
- {
- get {
- return Color.FromArgb( 255, 199, 21, 133 );
- }
- }
- static public Color MidnightBlue
- {
- get {
- return Color.FromArgb( 255, 25, 25, 112 );
- }
- }
- static public Color MintCream
- {
- get {
- return Color.FromArgb( 255, 245, 255, 250 );
- }
- }
- static public Color MistyRose
- {
- get {
- return Color.FromArgb( 255, 255, 228, 225 );
- }
- }
- static public Color Moccasin
- {
- get {
- return Color.FromArgb( 255, 255, 228, 181 );
- }
- }
- static public Color NavajoWhite
- {
- get {
- return Color.FromArgb( 255, 255, 222, 173 );
- }
- }
- static public Color Navy
- {
- get {
- return Color.FromArgb( 255, 0, 0, 128 );
- }
- }
- static public Color OldLace
- {
- get {
- return Color.FromArgb( 255, 253, 245, 230 );
- }
- }
- static public Color Olive
- {
- get {
- return Color.FromArgb( 255, 128, 128, 0 );
- }
- }
- static public Color OliveDrab
- {
- get {
- return Color.FromArgb( 255, 107, 142, 35 );
- }
- }
- static public Color Orange
- {
- get {
- return Color.FromArgb( 255, 255, 165, 0 );
- }
- }
- static public Color OrangeRed
- {
- get {
- return Color.FromArgb( 255, 255, 69, 0 );
- }
- }
- static public Color Orchid
- {
- get {
- return Color.FromArgb( 255, 218, 112, 214 );
- }
- }
- static public Color PaleGoldenrod
- {
- get {
- return Color.FromArgb( 255, 238, 232, 170 );
- }
- }
- static public Color PaleGreen
- {
- get {
- return Color.FromArgb( 255, 152, 251, 152 );
- }
- }
- static public Color PaleTurquoise
- {
- get {
- return Color.FromArgb( 255, 175, 238, 238 );
- }
- }
- static public Color PaleVioletRed
- {
- get {
- return Color.FromArgb( 255, 219, 112, 147 );
- }
- }
- static public Color PapayaWhip
- {
- get {
- return Color.FromArgb( 255, 255, 239, 213 );
- }
- }
- static public Color PeachPuff
- {
- get {
- return Color.FromArgb( 255, 255, 218, 185 );
- }
- }
- static public Color Peru
- {
- get {
- return Color.FromArgb( 255, 205, 133, 63 );
- }
- }
- static public Color Pink
- {
- get {
- return Color.FromArgb( 255, 255, 192, 203 );
- }
- }
- static public Color Plum
- {
- get {
- return Color.FromArgb( 255, 221, 160, 221 );
- }
- }
- static public Color PowderBlue
- {
- get {
- return Color.FromArgb( 255, 176, 224, 230 );
- }
- }
- static public Color Purple
- {
- get {
- return Color.FromArgb( 255, 128, 0, 128 );
- }
- }
- static public Color Red
- {
- get {
- return Color.FromArgb( 255, 255, 0, 0 );
- }
- }
- static public Color RosyBrown
- {
- get {
- return Color.FromArgb( 255, 188, 143, 143 );
- }
- }
- static public Color RoyalBlue
- {
- get {
- return Color.FromArgb( 255, 65, 105, 225 );
- }
- }
- static public Color SaddleBrown
- {
- get {
- return Color.FromArgb( 255, 139, 69, 19 );
- }
- }
- static public Color Salmon
- {
- get {
- return Color.FromArgb( 255, 250, 128, 114 );
- }
- }
- static public Color SandyBrown
- {
- get {
- return Color.FromArgb( 255, 244, 164, 96 );
- }
- }
- static public Color SeaGreen
- {
- get {
- return Color.FromArgb( 255, 46, 139, 87 );
- }
- }
- static public Color SeaShell
- {
- get {
- return Color.FromArgb( 255, 255, 245, 238 );
- }
- }
- static public Color Sienna
- {
- get {
- return Color.FromArgb( 255, 160, 82, 45 );
- }
- }
- static public Color Silver
- {
- get {
- return Color.FromArgb( 255, 192, 192, 192 );
- }
- }
- static public Color SkyBlue
- {
- get {
- return Color.FromArgb( 255, 135, 206, 235 );
- }
- }
- static public Color SlateBlue
- {
- get {
- return Color.FromArgb( 255, 106, 90, 205 );
- }
- }
- static public Color SlateGray
- {
- get {
- return Color.FromArgb( 255, 112, 128, 144 );
- }
- }
- static public Color Snow
- {
- get {
- return Color.FromArgb( 255, 255, 250, 250 );
- }
- }
- static public Color SpringGreen
- {
- get {
- return Color.FromArgb( 255, 0, 255, 127 );
- }
- }
- static public Color SteelBlue
- {
- get {
- return Color.FromArgb( 255, 70, 130, 180 );
- }
- }
- static public Color Tan
- {
- get {
- return Color.FromArgb( 255, 210, 180, 140 );
- }
- }
- static public Color Teal
- {
- get {
- return Color.FromArgb( 255, 0, 128, 128 );
- }
- }
- static public Color Thistle
- {
- get {
- return Color.FromArgb( 255, 216, 191, 216 );
- }
- }
- static public Color Tomato
- {
- get {
- return Color.FromArgb( 255, 255, 99, 71 );
- }
- }
- static public Color Turquoise
- {
- get {
- return Color.FromArgb( 255, 64, 224, 208 );
- }
- }
- static public Color Violet
- {
- get {
- return Color.FromArgb( 255, 238, 130, 238 );
- }
- }
- static public Color Wheat
- {
- get {
- return Color.FromArgb( 255, 245, 222, 179 );
- }
- }
- static public Color White
- {
- get {
- return Color.FromArgb( 255, 255, 255, 255 );
- }
- }
- static public Color WhiteSmoke
- {
- get {
- return Color.FromArgb( 255, 245, 245, 245 );
- }
- }
- static public Color Yellow
- {
- get {
- return Color.FromArgb( 255, 255, 255, 0 );
- }
- }
- static public Color YellowGreen
- {
- get {
- return Color.FromArgb( 255, 154, 205, 50 );
- }
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs b/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
deleted file mode 100644
index 6a58ba14684..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/ColorConverter.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Drawing.ColorConverter
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-using System;
-using System.ComponentModel;
-using System.Globalization;
-
-namespace System.Drawing {
-
-[MonoTODO]
-public class ColorConverter : TypeConverter
-{
- public ColorConverter ()
- {
- }
-
- [MonoTODO("Only some basic conversion needed by xsp")]
- public override object ConvertFrom (ITypeDescriptorContext context,
- CultureInfo culture,
- object value)
- {
- string s = value as string;
- if (s == null)
- throw new NotImplementedException ();
-
- if (s == "")
- return Color.Empty;
-
- Color c = Color.FromName (s);
- if (!(c.A == c.R && c.R == c.G && c.G == c.B && c.B == 0))
- return c;
-
- int i;
- if (s [0] == '#')
- i = Int32.Parse (s.Substring (1), NumberStyles.HexNumber);
- else
- i = Int32.Parse (s, NumberStyles.Integer);
-
- int A = (int) (i & 0xFF000000) >> 24;
- if (A == 0)
- A = 255;
- return Color.FromArgb (A, (i & 0x00FF0000) >> 16, (i & 0x00FF00) >> 8, (i & 0x0FF));
- }
-}
-}
-
diff --git a/mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs b/mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs
deleted file mode 100644
index 6b0cd084214..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.Drawing.ColorTranslator.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-// Dennis Hayes (dennish@raytek.com)
-// Inital Implimentation 3/25/2002
-// All conversions based on best guess, will improve over time
-//
-using System;
-namespace System.Drawing {
- public class ColorTranslator{
- // From converisons
- /// <summary>
- ///
- /// </summary>
- /// <param name="HtmlFromColor"></param>
- /// <returns></returns>
- public static Color FromHtml(string HtmlFromColor){
- // TODO:
- // If first char is "#"
- //convert "#RRGGBB" to int and use Color.FromARGB(int) to create color
- // else //it is a color name
- //If there is a single digit at the end of the name, remove it.
- // Call Color.FromKnownColor(HtmlFromColor)
-
- //At least some Html strings match .NET Colors,
- // so this should work for those colors.
- // .NET colors, XWindows colors, and WWWC web colors
- // are (according to Charles Pretziod) base the same
- //colors, so many shouold work if any do.
- //return Color.FromKnownColor(HtmlFromColor);
- return Color.Empty;
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="OLEFromColor"></param>
- /// <returns></returns>
- public static Color FromOle(int OLEFromColor){
- int newcolor;
- //TODO: swap RB bytes i.e. AARRGGBB to AABBGGRR
- //return Color.FromArgb(newcolor);
- return Color.Empty;
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="Win32FromColor"></param>
- /// <returns></returns>
- public static Color FromWin32(int Win32FromColor){
- int newcolor;
- //TODO: swap RB bytes i.e. AARRGGBB to AABBGGRR
- //return Color.FromArgb(newcolor);
- return Color.Empty;
- }
-
- // To converisons
- public static string ToHtml(Color HtmlToColor){
- //TODO: html string for unknown color is "#rrgggbb" in hex format.
- //TODO: first pass use same for known color.
- //TODO: second pass return name string for known colors.
- string returnstring;
- if(HtmlToColor.IsKnownColor){
- }
- else{
- }
- //return Color.FromKnownColor(HtmlToColor);
- return String.Empty;
- }
- /// <summary>
- /// converts from BGR to RGB
- /// </summary>
- /// <param name="OleToColor"></param>
- /// <returns></returns>
- public static int ToOle(Color FromColor){
- // TODO: Swap red and blue(from argb), convert to int(toargb)
- // Same as ToWin32
- return (Color.FromArgb(FromColor.B,FromColor.G,FromColor.R)).ToArgb();
- }
-
- /// <summary>
- /// converts from RGB to BGR
- /// </summary>
- /// <param name="Win32ToColor"></param>
- /// <returns></returns>
- public static int ToWin32(Color FromColor){
- // TODO: Swap red and blue(from argb), convert to int(toargb)
- // Same as ToOle
- return (Color.FromArgb(FromColor.B,FromColor.G,FromColor.R)).ToArgb();
- }
- }
-}
-
-
-
-
diff --git a/mcs/class/System.Drawing/System.Drawing/ContentAlignment.cs b/mcs/class/System.Drawing/System.Drawing/ContentAlignment.cs
deleted file mode 100644
index 15f9a600532..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/ContentAlignment.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Drawing.ContentAlignment.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-using System;
-namespace System.Drawing
-{
- public enum ContentAlignment {
- BottomCenter = 1,
- BottomLeft = 2,
- BottomRight = 3,
- MiddleCenter = 4,
- MiddleLeft = 5,
- MiddleRight = 6,
- TopCenter = 7,
- TopLeft = 8,
- TopRight = 9
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/FontStyle.cs b/mcs/class/System.Drawing/System.Drawing/FontStyle.cs
deleted file mode 100644
index 002bbb9fa3d..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/FontStyle.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Drawing.fontStyle.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-
-using System;
-namespace System.Drawing
-{
- public enum FontStyle {
- Bold = 1,
- Italic = 2,
- Regular = 3,
- Strikeout = 4,
- Underline = 5
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.cs
deleted file mode 100755
index b957e69684a..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Graphics.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Drawing.Bitmap.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Just to get things to compile
-//
-namespace System.Drawing {
-
- public sealed class Graphics : MarshalByRefObject, IDisposable {
-
- public void Dispose ()
- {
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/GraphicsUnit.cs b/mcs/class/System.Drawing/System.Drawing/GraphicsUnit.cs
deleted file mode 100644
index a5428c3a603..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/GraphicsUnit.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Drawing.GraphicsUnit.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-using System;
-namespace System.Drawing
-{
- public enum GraphicsUnit {
- Display = 1,
- Document = 2,
- Inch = 3,
- Millimeter = 4,
- Pixel = 5,
- Point = 6,
- World = 7,
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Image.cs b/mcs/class/System.Drawing/System.Drawing/Image.cs
deleted file mode 100644
index 5f3bd7f3f43..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Image.cs
+++ /dev/null
@@ -1,199 +0,0 @@
-//
-// System.Drawing.Image.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-// Author: Christian Meyer
-// eMail: Christian.Meyer@cs.tum.edu
-//
-// Many methods are still commented. I'll care about them when all necessary
-// classes are implemented.
-//
-namespace System.Drawing {
-
-using System;
-using System.Runtime.Remoting;
-using System.Runtime.Serialization;
-using System.Drawing.Imaging;
-
-//[Serializable]
-//[ComVisible(true)]
-
-public abstract class Image : MarshalByRefObject /*, ICloneable, IDisposable, ISerializable */ {
-
- // constructor
- public Image () {}
-
- // public methods
- // static
- public static Image FromFile (string filename)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Image FromFile (string filename, bool useEmbeddedColorManagement)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromHbitmap (IntPtr hbitmap)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static Bitmap FromHbitmap (IntPtr hbitmap, IntPtr hpalette)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static int GetPixelFormatSize (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsAlphaPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsCanonicalPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public static bool IsExtendedPixelFormat (PixelFormat pixfmt)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- // non-static
- public RectangleF GetBounds (ref GraphicsUnit pageUnit)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- //public EncoderParameters GetEncoderParameterList(Guid encoder);
- //public int GetFrameCount(FrameDimension dimension);
- //public PropertyItem GetPropertyItem(int propid);
- /*
- public Image GetThumbnailImage(int thumbWidth, int thumbHeight,
- Image.GetThumbnailImageAbort callback,
- IntPtr callbackData);
- */
-
- public void RemovePropertyItem (int propid)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public void RotateFlip (RotateFlipType rotateFlipType)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- public void Save (string filename)
- {
- // Fixme: implement me
- throw new NotImplementedException ();
- }
-
- //public void Save(Stream stream, ImageFormat format);
- //public void Save(string filename, ImageFormat format);
- //public void Save(Stream stream, ImageCodecInfo encoder,
- // EncoderParameters encoderParams);
- //public void Save(string filename, ImageCodecInfo encoder,
- // EncoderParameters encoderParams);
- //public void SaveAdd(EncoderParameters_ encoderParams);
- //public void SaveAdd(Image image, EncoderParameters_ encoderParams);
- //public int SelectActiveFrame(FrameDimension dimension, int frameIndex);
- //public void SetPropertyItem(PropertyItem propitem);
-
- // destructor
- ~Image() {}
-
- // properties
- public int Flags {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public Guid[] FrameDimensionsList {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public int Height {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public float HorizontalResolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public ColorPalette Palette {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- public SizeF PhysicalDimension {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public PixelFormat PixelFormat {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public int[] PropertyIdList {
- get {
- throw new NotImplementedException ();
- }
- }
-
- //public PropertyItem[] PropertyItems {get;}
- //public ImageFormat RawFormat {get;}
-
- public Size Size {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public float VerticalResolution {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public int Width {
- get {
- throw new NotImplementedException ();
- }
- }
-
-}
-
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/KnownColor.cs b/mcs/class/System.Drawing/System.Drawing/KnownColor.cs
deleted file mode 100644
index 5a60973509f..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/KnownColor.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// System.Drawing.Color.cs
-//
-// (C) 2002 Dennis Hayes
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// Ben Houston (ben@exocortex.org)
-//
-
-using System;
-namespace System.Drawing
-{
- public enum KnownColor {
- ActiveBorder = 1,
- ActiveCaption = 2,
- ActiveCaptionText = 3,
- AppWorkspace = 4,
- Control = 5,
- ControlDark = 6,
- ControlDarkDark = 7,
- ControlLight = 8,
- ControlLightLight = 9,
- ControlText = 10,
- Desktop = 11,
- GrayText = 12,
- Highlight = 13,
- HighlightText = 14,
- HotTrack = 15,
- InactiveBorder = 16,
- InactiveCaption = 17,
- InactiveCaptionText = 18,
- Info = 19,
- InfoText = 20,
- Menu = 21,
- MenuText = 22,
- ScrollBar = 23,
- Window = 24,
- WindowFrame = 25,
- WindowText = 26,
- Transparent = 27,
- AliceBlue = 28,
- AntiqueWhite = 29,
- Aqua = 30,
- Aquamarine = 31,
- Azure = 32,
- Beige = 33,
- Bisque = 34,
- Black = 35,
- BlanchedAlmond = 36,
- Blue = 37,
- BlueViolet = 38,
- Brown = 39,
- BurlyWood = 40,
- CadetBlue = 41,
- Chartreuse = 42,
- Chocolate = 43,
- Coral = 44,
- CornflowerBlue = 45,
- Cornsilk = 46,
- Crimson = 47,
- Cyan = 48,
- DarkBlue = 49,
- DarkCyan = 50,
- DarkGoldenrod = 51,
- DarkGray = 52,
- DarkGreen = 53,
- DarkKhaki = 54,
- DarkMagenta = 55,
- DarkOliveGreen = 56,
- DarkOrange = 57,
- DarkOrchid = 58,
- DarkRed = 59,
- DarkSalmon = 60,
- DarkSeaGreen = 61,
- DarkSlateBlue = 62,
- DarkSlateGray = 63,
- DarkTurquoise = 64,
- DarkViolet = 65,
- DeepPink = 66,
- DeepSkyBlue = 67,
- DimGray = 68,
- DodgerBlue = 69,
- Firebrick = 70,
- FloralWhite = 71,
- ForestGreen = 72,
- Fuchsia = 73,
- Gainsboro = 74,
- GhostWhite = 75,
- Gold = 76,
- Goldenrod = 77,
- Gray = 78,
- Green = 79,
- GreenYellow = 80,
- Honeydew = 81,
- HotPink = 82,
- IndianRed = 83,
- Indigo = 84,
- Ivory = 85,
- Khaki = 86,
- Lavender = 87,
- LavenderBlush = 88,
- LawnGreen = 89,
- LemonChiffon = 90,
- LightBlue = 91,
- LightCoral = 92,
- LightCyan = 93,
- LightGoldenrodYellow = 94,
- LightGreen = 95,
- LightGray = 96,
- LightPink = 97,
- LightSalmon = 98,
- LightSeaGreen = 99,
- LightSkyBlue = 100,
- LightSlateGray = 101,
- LightSteelBlue = 102,
- LightYellow = 103,
- Lime = 104,
- LimeGreen = 105,
- Linen = 106,
- Magenta = 107,
- Maroon = 108,
- MediumAquamarine = 109,
- MediumBlue = 110,
- MediumOrchid = 111,
- MediumPurple = 112,
- MediumSeaGreen = 113,
- MediumSlateBlue = 114,
- MediumSpringGreen = 115,
- MediumTurquoise = 116,
- MediumVioletRed = 117,
- MidnightBlue = 118,
- MintCream = 119,
- MistyRose = 120,
- Moccasin = 121,
- NavajoWhite = 122,
- Navy = 123,
- OldLace = 124,
- Olive = 125,
- OliveDrab = 126,
- Orange = 127,
- OrangeRed = 128,
- Orchid = 129,
- PaleGoldenrod = 130,
- PaleGreen = 131,
- PaleTurquoise = 132,
- PaleVioletRed = 133,
- PapayaWhip = 134,
- PeachPuff = 135,
- Peru = 136,
- Pink = 137,
- Plum = 138,
- PowderBlue = 139,
- Purple = 140,
- Red = 141,
- RosyBrown = 142,
- RoyalBlue = 143,
- SaddleBrown = 144,
- Salmon = 145,
- SandyBrown = 146,
- SeaGreen = 147,
- SeaShell = 148,
- Sienna = 149,
- Silver = 150,
- SkyBlue = 151,
- SlateBlue = 152,
- SlateGray = 153,
- Snow = 154,
- SpringGreen = 155,
- SteelBlue = 156,
- Tan = 157,
- Teal = 158,
- Thistle = 159,
- Tomato = 160,
- Turquoise = 161,
- Violet = 162,
- Wheat = 163,
- White = 164,
- WhiteSmoke = 165,
- Yellow = 166,
- YellowGreen = 167
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Pen.cs b/mcs/class/System.Drawing/System.Drawing/Pen.cs
deleted file mode 100755
index 16c6263b049..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Pen.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// System.Drawing.Pen.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Drawing.Drawing2D;
-
-namespace System.Drawing {
-
- public sealed class Pen : MarshalByRefObject, ICloneable, IDisposable {
- Brush brush;
- Color color;
- float width;
- PenAlignment alignment;
-
- public Pen (Brush brush)
- {
- this.brush = brush;
- width = 1;
- }
-
- public Pen (Color color)
- {
- this.color = color;
- width = 1;
- }
-
- public Pen (Brush brush, float width)
- {
- this.width = width;
- this.brush = brush;
- }
-
- public Pen (Color color, float width)
- {
- this.width = width;
- this.color = color;
- }
-
- //
- // Properties
- //
- public PenAlignment Alignment {
- get {
- return alignment;
- }
-
- set {
- alignment = value;
- }
- }
-
- public Brush Brush {
- get {
- return brush;
- }
-
- set {
- brush = value;
- }
- }
-
- public Color Color {
- get {
- return color;
- }
-
- set {
- color = value;
- }
- }
-
- public float Width {
- get {
- return width;
- }
- set {
- width = value;
- }
- }
-
- public object Clone ()
- {
- Pen p = new Pen (brush, width);
-
- p.color = color;
- p.alignment = alignment;
-
- return p;
- }
-
- public void Dispose ()
- {
- Dispose (true);
- System.GC.SuppressFinalize (this);
- }
-
- void Dispose (bool disposing)
- {
- // Nothing for now.
- }
-
- ~Pen ()
- {
- Dispose (false);
- }
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Point.cs b/mcs/class/System.Drawing/System.Drawing/Point.cs
deleted file mode 100644
index fa0db9abc9b..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Point.cs
+++ /dev/null
@@ -1,339 +0,0 @@
-//
-// System.Drawing.Point.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct Point {
-
- // Private x and y coordinate fields.
- int cx, cy;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized Point Structure.
- /// </remarks>
-
- public static readonly Point Empty;
-
- /// <summary>
- /// Ceiling Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Point structure from a PointF structure by
- /// taking the ceiling of the X and Y properties.
- /// </remarks>
-
- public static Point Ceiling (PointF value)
- {
- int x, y;
- checked {
- x = (int) Math.Ceiling (value.X);
- y = (int) Math.Ceiling (value.Y);
- }
-
- return new Point (x, y);
- }
-
- /// <summary>
- /// Round Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Point structure from a PointF structure by
- /// rounding the X and Y properties.
- /// </remarks>
-
- public static Point Round (PointF value)
- {
- int x, y;
- checked {
- x = (int) Math.Round (value.X);
- y = (int) Math.Round (value.Y);
- }
-
- return new Point (x, y);
- }
-
- /// <summary>
- /// Truncate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Point structure from a PointF structure by
- /// truncating the X and Y properties.
- /// </remarks>
-
- // LAMESPEC: Should this be floor, or a pure cast to int?
-
- public static Point Truncate (PointF value)
- {
- int x, y;
- checked {
- x = (int) value.X;
- y = (int) value.Y;
- }
-
- return new Point (x, y);
- }
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a Point using the Width and Height
- /// properties of the given <typeref>Size</typeref>.
- /// </remarks>
-
- public static Point operator + (Point pt, Size sz)
- {
- return new Point (pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Point objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator == (Point pt_a, Point pt_b)
- {
- return ((pt_a.X == pt_b.X) && (pt_a.Y == pt_b.Y));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Point objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator != (Point pt_a, Point pt_b)
- {
- return ((pt_a.X != pt_b.X) || (pt_a.Y != pt_b.Y));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a Point using the negation of the Width
- /// and Height properties of the given Size.
- /// </remarks>
-
- public static Point operator - (Point pt, Size sz)
- {
- return new Point (pt.X - sz.Width, pt.Y - sz.Height);
- }
-
- /// <summary>
- /// Point to Size Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Returns a Size based on the Coordinates of a given
- /// Point. Requires explicit cast.
- /// </remarks>
-
- public static explicit operator Size (Point pt)
- {
- return new Size (pt.X, pt.Y);
- }
-
- /// <summary>
- /// Point to PointF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Creates a PointF based on the coordinates of a given
- /// Point. No explicit cast is required.
- /// </remarks>
-
- public static implicit operator PointF (Point pt)
- {
- return new PointF (pt.X, pt.Y);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// Point Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Point from an integer which holds the X
- /// coordinate in the high order 16 bits and the Y
- /// coordinate in the low order 16 bits.
- /// </remarks>
-
- public Point (int dw)
- {
- cx = dw >> 16;
- cy = dw & 0xffff;
- }
-
- /// <summary>
- /// Point Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Point from a Size value.
- /// </remarks>
-
- public Point (Size sz)
- {
- cx = sz.Width;
- cy = sz.Height;
- }
-
- /// <summary>
- /// Point Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Point from a specified x,y coordinate pair.
- /// </remarks>
-
- public Point (int x, int y)
- {
- cx = x;
- cy = y;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both X and Y are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((cx == 0) && (cy == 0));
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the Point.
- /// </remarks>
-
- public int X {
- get {
- return cx;
- }
- set {
- cx = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the Point.
- /// </remarks>
-
- public int Y {
- get {
- return cy;
- }
- set {
- cy = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Point and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Point))
- return false;
-
- return (this == (Point) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return cx^cy;
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the Point a specified distance.
- /// </remarks>
-
- public void Offset (int dx, int dy)
- {
- cx += dx;
- cy += dy;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Point as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", cx, cy);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/PointF.cs b/mcs/class/System.Drawing/System.Drawing/PointF.cs
deleted file mode 100644
index 42895bdac4a..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/PointF.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// System.Drawing.PointF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct PointF {
-
- // Private x and y coordinate fields.
- float cx, cy;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized PointF Structure.
- /// </remarks>
-
- public static readonly PointF Empty;
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a PointF using the Width and Height
- /// properties of the given Size.
- /// </remarks>
-
- public static PointF operator + (PointF pt, Size sz)
- {
- return new PointF (pt.X + sz.Width, pt.Y + sz.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two PointF objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator == (PointF pt_a, PointF pt_b)
- {
- return ((pt_a.X == pt_b.X) && (pt_a.Y == pt_b.Y));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two PointF objects. The return value is
- /// based on the equivalence of the X and Y properties
- /// of the two points.
- /// </remarks>
-
- public static bool operator != (PointF pt_a, PointF pt_b)
- {
- return ((pt_a.X != pt_b.X) || (pt_a.Y != pt_b.Y));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Translates a PointF using the negation of the Width
- /// and Height properties of the given Size.
- /// </remarks>
-
- public static PointF operator - (PointF pt, Size sz)
- {
- return new PointF (pt.X - sz.Width, pt.Y - sz.Height);
- }
-
- // -----------------------
- // Public Constructor
- // -----------------------
-
- /// <summary>
- /// PointF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a PointF from a specified x,y coordinate pair.
- /// </remarks>
-
- public PointF (float x, float y)
- {
- cx = x;
- cy = y;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both X and Y are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((cx == 0.0) && (cy == 0.0));
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the PointF.
- /// </remarks>
-
- public float X {
- get {
- return cx;
- }
- set {
- cx = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the PointF.
- /// </remarks>
-
- public float Y {
- get {
- return cy;
- }
- set {
- cy = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this PointF and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is PointF))
- return false;
-
- return (this == (PointF) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return (int) cx ^ (int) cy;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the PointF as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", cx, cy);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs b/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
deleted file mode 100644
index 45f28755102..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Rectangle.cs
+++ /dev/null
@@ -1,584 +0,0 @@
-//
-// System.Drawing.Rectangle.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct Rectangle {
-
- // Private position and size fields.
- private Point loc;
- private Size sz;
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized Rectangle Structure.
- /// </remarks>
-
- public static readonly Rectangle Empty;
-
- /// <summary>
- /// Ceiling Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from a RectangleF
- /// structure by taking the ceiling of the X, Y, Width,
- /// and Height properties.
- /// </remarks>
-
- public static Rectangle Ceiling (RectangleF value)
- {
- int x, y, w, h;
- checked {
- x = (int) Math.Ceiling (value.X);
- y = (int) Math.Ceiling (value.Y);
- w = (int) Math.Ceiling (value.Width);
- h = (int) Math.Ceiling (value.Height);
- }
-
- return new Rectangle (x, y, w, h);
- }
-
- /// <summary>
- /// FromLTRB Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from left, top, right,
- /// and bottom coordinates.
- /// </remarks>
-
- public static Rectangle FromLTRB (int left, int top,
- int right, int bottom)
- {
- return new Rectangle (left, top, right - left,
- bottom - top);
- }
-
- /// <summary>
- /// Inflate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new Rectangle by inflating an existing
- /// Rectangle by the specified coordinate values.
- /// </remarks>
-
- public static Rectangle Inflate (Rectangle rect, int x, int y)
- {
- Rectangle r = new Rectangle (rect.Location, rect.Size);
- r.Inflate (x, y);
- return r;
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the Rectangle by a specified width and height.
- /// </remarks>
-
- public void Inflate (int width, int height)
- {
- Inflate (new Size (width, height));
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the Rectangle by a specified Size.
- /// </remarks>
-
- public void Inflate (Size sz)
- {
- loc -= sz;
- Size ds = new Size (sz.Width * 2, sz.Height * 2);
- this.sz += ds;
- }
-
- /// <summary>
- /// Intersect Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new Rectangle by intersecting 2 existing
- /// Rectangles. Returns null if there is no intersection.
- /// </remarks>
-
- public static Rectangle Intersect (Rectangle r1, Rectangle r2)
- {
- Rectangle r = new Rectangle (r1.Location, r1.Size);
- r.Intersect (r2);
- return r;
- }
-
- /// <summary>
- /// Intersect Method
- /// </summary>
- ///
- /// <remarks>
- /// Replaces the Rectangle with the intersection of itself
- /// and another Rectangle.
- /// </remarks>
-
- public void Intersect (Rectangle r)
- {
- if (!IntersectsWith (r)) {
- loc = Point.Empty;
- sz = Size.Empty;
- }
-
- X = Math.Max (Left, r.Left);
- Y = Math.Max (Top, r.Top);
- Width = Math.Min (Right, r.Right) - X;
- Height = Math.Min (Bottom, r.Bottom) - Y;
- }
-
- /// <summary>
- /// Round Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from a RectangleF by
- /// rounding the X, Y, Width, and Height properties.
- /// </remarks>
-
- public static Rectangle Round (RectangleF value)
- {
- int x, y, w, h;
- checked {
- x = (int) Math.Round (value.X);
- y = (int) Math.Round (value.Y);
- w = (int) Math.Round (value.Width);
- h = (int) Math.Round (value.Height);
- }
-
- return new Rectangle (x, y, w, h);
- }
-
- /// <summary>
- /// Truncate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Rectangle structure from a RectangleF by
- /// truncating the X, Y, Width, and Height properties.
- /// </remarks>
-
- // LAMESPEC: Should this be floor, or a pure cast to int?
-
- public static Rectangle Truncate (RectangleF value)
- {
- int x, y, w, h;
- checked {
- x = (int) value.X;
- y = (int) value.Y;
- w = (int) value.Width;
- h = (int) value.Height;
- }
-
- return new Rectangle (x, y, w, h);
- }
-
- /// <summary>
- /// Union Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new Rectangle from the union of 2 existing
- /// Rectangles.
- /// </remarks>
-
- public static Rectangle Union (Rectangle r1, Rectangle r2)
- {
- return FromLTRB (Math.Min (r1.Left, r2.Left),
- Math.Min (r1.Top, r2.Top),
- Math.Max (r1.Right, r2.Right),
- Math.Max (r1.Bottom, r2.Bottom));
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Rectangle objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two Rectangles.
- /// </remarks>
-
- public static bool operator == (Rectangle r1, Rectangle r2)
- {
- return ((r1.Location == r2.Location) &&
- (r1.Size == r2.Size));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Rectangle objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two Rectangles.
- /// </remarks>
-
- public static bool operator != (Rectangle r1, Rectangle r2)
- {
- return ((r1.Location != r2.Location) ||
- (r1.Size != r2.Size));
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// Rectangle Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Rectangle from Point and Size values.
- /// </remarks>
-
- public Rectangle (Point loc, Size sz)
- {
- this.loc = loc;
- this.sz = sz;
- }
-
- /// <summary>
- /// Rectangle Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Rectangle from a specified x,y location and
- /// width and height values.
- /// </remarks>
-
- public Rectangle (int x, int y, int width, int height)
- {
- loc = new Point (x, y);
- sz = new Size (width, height);
- }
-
-
-
- /// <summary>
- /// Bottom Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the bottom edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Bottom {
- get {
- return Y + Height;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height of the Rectangle.
- /// </remarks>
-
- public int Height {
- get {
- return sz.Height;
- }
- set {
- sz.Height = value;
- }
- }
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if the width or height are zero. Read only.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((sz.Width == 0) || (sz.Height == 0));
- }
- }
-
- /// <summary>
- /// Left Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the left edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Left {
- get {
- return X;
- }
- }
-
- /// <summary>
- /// Location Property
- /// </summary>
- ///
- /// <remarks>
- /// The Location of the top-left corner of the Rectangle.
- /// </remarks>
-
- public Point Location {
- get {
- return loc;
- }
- set {
- loc = value;
- }
- }
-
- /// <summary>
- /// Right Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the right edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Right {
- get {
- return X + Width;
- }
- }
-
- /// <summary>
- /// Size Property
- /// </summary>
- ///
- /// <remarks>
- /// The Size of the Rectangle.
- /// </remarks>
-
- public Size Size {
- get {
- return sz;
- }
- set {
- sz = value;
- }
- }
-
- /// <summary>
- /// Top Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the top edge of the Rectangle.
- /// Read only.
- /// </remarks>
-
- public int Top {
- get {
- return Y;
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width of the Rectangle.
- /// </remarks>
-
- public int Width {
- get {
- return sz.Width;
- }
- set {
- sz.Width = value;
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the Rectangle.
- /// </remarks>
-
- public int X {
- get {
- return loc.X;
- }
- set {
- loc.X = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the Rectangle.
- /// </remarks>
-
- public int Y {
- get {
- return loc.Y;
- }
- set {
- loc.Y = value;
- }
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if an x,y coordinate lies within this Rectangle.
- /// </remarks>
-
- public bool Contains (int x, int y)
- {
- return ((x >= Left) && (x <= Right) &&
- (y >= Top) && (y <= Bottom));
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Point lies within this Rectangle.
- /// </remarks>
-
- public bool Contains (Point pt)
- {
- return Contains (pt.X, pt.Y);
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Rectangle lies entirely within this
- /// Rectangle.
- /// </remarks>
-
- public bool Contains (Rectangle rect)
- {
- return (rect == Intersect (this, rect));
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Rectangle and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Rectangle))
- return false;
-
- return (this == (Rectangle) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return loc.GetHashCode()^sz.GetHashCode();
- }
-
- /// <summary>
- /// IntersectsWith Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Rectangle intersects with this one.
- /// </remarks>
-
- public bool IntersectsWith (Rectangle r)
- {
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the Rectangle a specified distance.
- /// </remarks>
-
- public void Offset (int dx, int dy)
- {
- X += dx;
- Y += dy;
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the Rectangle a specified distance.
- /// </remarks>
-
- public void Offset (Point pt)
- {
- loc.Offset(pt.X, pt.Y);
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Rectangle as a string in (x,y,w,h) notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1},{2},{3}]",
- X, Y, Width, Height);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/RectangleF.cs b/mcs/class/System.Drawing/System.Drawing/RectangleF.cs
deleted file mode 100644
index cfe4a7313ed..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/RectangleF.cs
+++ /dev/null
@@ -1,531 +0,0 @@
-//
-// System.Drawing.RectangleF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct RectangleF {
-
- // Private position and size fields.
- private PointF loc;
- private SizeF sz;
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized RectangleF Structure.
- /// </remarks>
-
- public static readonly RectangleF Empty;
-
-
- /// <summary>
- /// FromLTRB Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a RectangleF structure from left, top, right,
- /// and bottom coordinates.
- /// </remarks>
-
- public static RectangleF FromLTRB (float left, float top,
- float right, float bottom)
- {
- return new RectangleF (left, top, right - left,
- bottom - top);
- }
-
- /// <summary>
- /// Inflate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new RectangleF by inflating an existing
- /// RectangleF by the specified coordinate values.
- /// </remarks>
-
- public static RectangleF Inflate (RectangleF r,
- float x, float y)
- {
- RectangleF ir = new RectangleF (r.Location, r.Size);
- ir.Inflate (x, y);
- return ir;
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the RectangleF by a specified width and height.
- /// </remarks>
-
- public void Inflate (float width, float height)
- {
- Inflate (new SizeF (width, height));
- }
-
- /// <summary>
- /// Inflate Method
- /// </summary>
- ///
- /// <remarks>
- /// Inflates the RectangleF by a specified Size.
- /// </remarks>
-
- public void Inflate (SizeF sz)
- {
- Offset(sz.Width, sz.Height);
- SizeF ds = new SizeF (sz.Width * 2, sz.Height * 2);
- this.sz += ds;
- }
-
- /// <summary>
- /// Intersect Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new RectangleF by intersecting 2 existing
- /// RectangleFs. Returns null if there is no intersection.
- /// </remarks>
-
- public static RectangleF Intersect (RectangleF r1,
- RectangleF r2)
- {
- RectangleF r = new RectangleF (r1.Location, r1.Size);
- r.Intersect (r2);
- return r;
- }
-
- /// <summary>
- /// Intersect Method
- /// </summary>
- ///
- /// <remarks>
- /// Replaces the RectangleF with the intersection of itself
- /// and another RectangleF.
- /// </remarks>
-
- public void Intersect (RectangleF r)
- {
- if (!IntersectsWith (r)) {
- loc = PointF.Empty;
- sz = SizeF.Empty;
- }
-
- X = Math.Max (Left, r.Left);
- Y = Math.Max (Top, r.Top);
- Width = Math.Min (Right, r.Right) - X;
- Height = Math.Min (Bottom, r.Bottom) - Y;
- }
-
- /// <summary>
- /// Union Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a new RectangleF from the union of 2 existing
- /// RectangleFs.
- /// </remarks>
-
- public static RectangleF Union (RectangleF r1, RectangleF r2)
- {
- return FromLTRB (Math.Min (r1.Left, r2.Left),
- Math.Min (r1.Top, r2.Top),
- Math.Max (r1.Right, r2.Right),
- Math.Max (r1.Bottom, r2.Bottom));
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two RectangleF objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two RectangleFs.
- /// </remarks>
-
- public static bool operator == (RectangleF r1, RectangleF r2)
- {
- return ((r1.Location == r2.Location) &&
- (r1.Size == r2.Size));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two RectangleF objects. The return value is
- /// based on the equivalence of the Location and Size
- /// properties of the two RectangleFs.
- /// </remarks>
-
- public static bool operator != (RectangleF r1, RectangleF r2)
- {
- return ((r1.Location != r2.Location) ||
- (r1.Size != r2.Size));
- }
-
- /// <summary>
- /// Rectangle to RectangleF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Converts a Rectangle object to a RectangleF.
- /// </remarks>
-
- public static implicit operator RectangleF (Rectangle r)
- {
- return new RectangleF (r.Location, r.Size);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// RectangleF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a RectangleF from PointF and SizeF values.
- /// </remarks>
-
- public RectangleF (PointF loc, SizeF sz)
- {
- this.loc = loc;
- this.sz = sz;
- }
-
- /// <summary>
- /// RectangleF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a RectangleF from a specified x,y location and
- /// width and height values.
- /// </remarks>
-
- public RectangleF (float x, float y, float width, float height)
- {
- loc = new PointF (x, y);
- sz = new SizeF (width, height);
- }
-
-
-
- /// <summary>
- /// Bottom Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the bottom edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Bottom {
- get {
- return Y + Height;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height of the RectangleF.
- /// </remarks>
-
- public float Height {
- get {
- return sz.Height;
- }
- set {
- sz.Height = value;
- }
- }
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if the width or height are zero. Read only.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((sz.Width == 0) || (sz.Height == 0));
- }
- }
-
- /// <summary>
- /// Left Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the left edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Left {
- get {
- return X;
- }
- }
-
- /// <summary>
- /// Location Property
- /// </summary>
- ///
- /// <remarks>
- /// The Location of the top-left corner of the RectangleF.
- /// </remarks>
-
- public PointF Location {
- get {
- return loc;
- }
- set {
- loc = value;
- }
- }
-
- /// <summary>
- /// Right Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the right edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Right {
- get {
- return X + Width;
- }
- }
-
- /// <summary>
- /// Size Property
- /// </summary>
- ///
- /// <remarks>
- /// The Size of the RectangleF.
- /// </remarks>
-
- public SizeF Size {
- get {
- return sz;
- }
- set {
- sz = value;
- }
- }
-
- /// <summary>
- /// Top Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the top edge of the RectangleF.
- /// Read only.
- /// </remarks>
-
- public float Top {
- get {
- return Y;
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width of the RectangleF.
- /// </remarks>
-
- public float Width {
- get {
- return sz.Width;
- }
- set {
- sz.Width = value;
- }
- }
-
- /// <summary>
- /// X Property
- /// </summary>
- ///
- /// <remarks>
- /// The X coordinate of the RectangleF.
- /// </remarks>
-
- public float X {
- get {
- return loc.X;
- }
- set {
- loc.X = value;
- }
- }
-
- /// <summary>
- /// Y Property
- /// </summary>
- ///
- /// <remarks>
- /// The Y coordinate of the RectangleF.
- /// </remarks>
-
- public float Y {
- get {
- return loc.Y;
- }
- set {
- loc.Y = value;
- }
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if an x,y coordinate lies within this RectangleF.
- /// </remarks>
-
- public bool Contains (float x, float y)
- {
- return ((x >= Left) && (x <= Right) &&
- (y >= Top) && (y <= Bottom));
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a Point lies within this RectangleF.
- /// </remarks>
-
- public bool Contains (PointF pt)
- {
- return Contains (pt.X, pt.Y);
- }
-
- /// <summary>
- /// Contains Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a RectangleF lies entirely within this
- /// RectangleF.
- /// </remarks>
-
- public bool Contains (RectangleF rect)
- {
- return (rect == Intersect (this, rect));
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this RectangleF and an object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is RectangleF))
- return false;
-
- return (this == (RectangleF) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return loc.GetHashCode()^sz.GetHashCode();
- }
-
- /// <summary>
- /// IntersectsWith Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks if a RectangleF intersects with this one.
- /// </remarks>
-
- public bool IntersectsWith (RectangleF r)
- {
- return !((Left > r.Right) || (Right < r.Left) ||
- (Top > r.Bottom) || (Bottom < r.Top));
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the RectangleF a specified distance.
- /// </remarks>
-
- public void Offset (float dx, float dy)
- {
- X += dx;
- Y += dy;
- }
-
- /// <summary>
- /// Offset Method
- /// </summary>
- ///
- /// <remarks>
- /// Moves the RectangleF a specified distance.
- /// </remarks>
-
- public void Offset (PointF pt)
- {
- Offset(pt.X, pt.Y);
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the RectangleF in (x,y,w,h) notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1},{2},{3}]",
- X, Y, Width, Height);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/RotateFlipType.cs b/mcs/class/System.Drawing/System.Drawing/RotateFlipType.cs
deleted file mode 100644
index c50f32b0bc3..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/RotateFlipType.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Drawing.RotateFlipType .cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-using System;
-namespace System.Drawing
-{
- public enum RotateFlipType {
- Rotate180FlipNone = 1,
- Rotate180FlipX = 2,
- Rotate180FlipXY = 3,
- Rotate180FlipY = 4,
- Rotate270FlipNone = 5,
- Rotate270FlipX = 6,
- Rotate270FlipXY = 7,
- Rotate270FlipY = 8,
- Rotate90FlipNone = 9,
- Rotate90FlipX = 10,
- Rotate90FlipXY = 11,
- Rotate90FlipY = 12,
- RotateNoneFlipNone = 13,
- RotateNoneFlipX = 14,
- RotateNoneFlipXY = 15,
- RotateNoneFlipY = 16
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/Size.cs b/mcs/class/System.Drawing/System.Drawing/Size.cs
deleted file mode 100644
index d5b56d3a453..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/Size.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-//
-// System.Drawing.Size.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct Size {
-
- // Private height and width fields.
- int wd, ht;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized Size Structure.
- /// </remarks>
-
- public static readonly Size Empty;
-
- /// <summary>
- /// Ceiling Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Size structure from a SizeF structure by
- /// taking the ceiling of the Width and Height properties.
- /// </remarks>
-
- public static Size Ceiling (SizeF value)
- {
- int w, h;
- checked {
- w = (int) Math.Ceiling (value.Width);
- h = (int) Math.Ceiling (value.Height);
- }
-
- return new Size (w, h);
- }
-
- /// <summary>
- /// Round Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Size structure from a SizeF structure by
- /// rounding the Width and Height properties.
- /// </remarks>
-
- public static Size Round (SizeF value)
- {
- int w, h;
- checked {
- w = (int) Math.Round (value.Width);
- h = (int) Math.Round (value.Height);
- }
-
- return new Size (w, h);
- }
-
- /// <summary>
- /// Truncate Shared Method
- /// </summary>
- ///
- /// <remarks>
- /// Produces a Size structure from a SizeF structure by
- /// truncating the Width and Height properties.
- /// </remarks>
-
- public static Size Truncate (SizeF value)
- {
- int w, h;
- checked {
- w = (int) value.Width;
- h = (int) value.Height;
- }
-
- return new Size (w, h);
- }
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Addition of two Size structures.
- /// </remarks>
-
- public static Size operator + (Size sz1, Size sz2)
- {
- return new Size (sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Size objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator == (Size sz_a, Size sz_b)
- {
- return ((sz_a.Width == sz_b.Width) &&
- (sz_a.Height == sz_b.Height));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Size objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator != (Size sz_a, Size sz_b)
- {
- return ((sz_a.Width != sz_b.Width) ||
- (sz_a.Height != sz_b.Height));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Subtracts two Size structures.
- /// </remarks>
-
- public static Size operator - (Size sz1, Size sz2)
- {
- return new Size (sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-
- /// <summary>
- /// Size to Point Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Returns a Point based on the dimensions of a given
- /// Size. Requires explicit cast.
- /// </remarks>
-
- public static explicit operator Point (Size sz)
- {
- return new Point (sz.Width, sz.Height);
- }
-
- /// <summary>
- /// Size to SizeF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF based on the dimensions of a given
- /// Size. No explicit cast is required.
- /// </remarks>
-
- public static implicit operator SizeF (Size sz)
- {
- return new SizeF (sz.Width, sz.Height);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// Size Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Size from a Point value.
- /// </remarks>
-
- public Size (Point pt)
- {
- wd = pt.X;
- ht = pt.Y;
- }
-
- /// <summary>
- /// Size Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a Size from specified dimensions.
- /// </remarks>
-
- public Size (int width, int height)
- {
- wd = width;
- ht = height;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both Width and Height are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((wd == 0) && (ht == 0));
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width coordinate of the Size.
- /// </remarks>
-
- public int Width {
- get {
- return wd;
- }
- set {
- wd = value;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height coordinate of the Size.
- /// </remarks>
-
- public int Height {
- get {
- return ht;
- }
- set {
- ht = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Size and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Size))
- return false;
-
- return (this == (Size) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return wd^ht;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Size as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", wd, ht);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/SizeF.cs b/mcs/class/System.Drawing/System.Drawing/SizeF.cs
deleted file mode 100644
index 1aa0155c56d..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/SizeF.cs
+++ /dev/null
@@ -1,249 +0,0 @@
-//
-// System.Drawing.SizeF.cs
-//
-// Author:
-// Mike Kestner (mkestner@speakeasy.net)
-//
-// (C) 2001 Mike Kestner
-//
-
-using System;
-
-namespace System.Drawing {
-
- public struct SizeF {
-
- // Private height and width fields.
- float wd, ht;
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Empty Shared Field
- /// </summary>
- ///
- /// <remarks>
- /// An uninitialized SizeF Structure.
- /// </remarks>
-
- public static readonly SizeF Empty;
-
- /// <summary>
- /// Addition Operator
- /// </summary>
- ///
- /// <remarks>
- /// Addition of two SizeF structures.
- /// </remarks>
-
- public static SizeF operator + (SizeF sz1, SizeF sz2)
- {
- return new SizeF (sz1.Width + sz2.Width,
- sz1.Height + sz2.Height);
- }
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two SizeF objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator == (SizeF sz_a, SizeF sz_b)
- {
- return ((sz_a.Width == sz_b.Width) &&
- (sz_a.Height == sz_b.Height));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two SizeF objects. The return value is
- /// based on the equivalence of the Width and Height
- /// properties of the two Sizes.
- /// </remarks>
-
- public static bool operator != (SizeF sz_a, SizeF sz_b)
- {
- return ((sz_a.Width != sz_b.Width) ||
- (sz_a.Height != sz_b.Height));
- }
-
- /// <summary>
- /// Subtraction Operator
- /// </summary>
- ///
- /// <remarks>
- /// Subtracts two SizeF structures.
- /// </remarks>
-
- public static SizeF operator - (SizeF sz1, SizeF sz2)
- {
- return new SizeF (sz1.Width - sz2.Width,
- sz1.Height - sz2.Height);
- }
-
- /// <summary>
- /// SizeF to PointF Conversion
- /// </summary>
- ///
- /// <remarks>
- /// Returns a PointF based on the dimensions of a given
- /// SizeF. Requires explicit cast.
- /// </remarks>
-
- public static explicit operator PointF (SizeF sz)
- {
- return new PointF (sz.Width, sz.Height);
- }
-
-
- // -----------------------
- // Public Constructors
- // -----------------------
-
- /// <summary>
- /// SizeF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF from a PointF value.
- /// </remarks>
-
- public SizeF (PointF pt)
- {
- wd = pt.X;
- ht = pt.Y;
- }
-
- /// <summary>
- /// SizeF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF from an existing SizeF value.
- /// </remarks>
-
- public SizeF (SizeF sz)
- {
- wd = sz.Width;
- ht = sz.Height;
- }
-
- /// <summary>
- /// SizeF Constructor
- /// </summary>
- ///
- /// <remarks>
- /// Creates a SizeF from specified dimensions.
- /// </remarks>
-
- public SizeF (float width, float height)
- {
- wd = width;
- ht = height;
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- /// <summary>
- /// IsEmpty Property
- /// </summary>
- ///
- /// <remarks>
- /// Indicates if both Width and Height are zero.
- /// </remarks>
-
- public bool IsEmpty {
- get {
- return ((wd == 0.0) && (ht == 0.0));
- }
- }
-
- /// <summary>
- /// Width Property
- /// </summary>
- ///
- /// <remarks>
- /// The Width coordinate of the SizeF.
- /// </remarks>
-
- public float Width {
- get {
- return wd;
- }
- set {
- wd = value;
- }
- }
-
- /// <summary>
- /// Height Property
- /// </summary>
- ///
- /// <remarks>
- /// The Height coordinate of the SizeF.
- /// </remarks>
-
- public float Height {
- get {
- return ht;
- }
- set {
- ht = value;
- }
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this SizeF and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is SizeF))
- return false;
-
- return (this == (SizeF) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return (int) wd ^ (int) ht;
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the SizeF as a string in coordinate notation.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", wd, ht);
- }
-
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/StringAligment.cs b/mcs/class/System.Drawing/System.Drawing/StringAligment.cs
deleted file mode 100644
index 08539bc6176..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/StringAligment.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Drawing.StringAligment.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-
-using System;
-namespace System.Drawing
-{
- public enum StringAligment {
- Center = 1,
- Far = 2,
- Near = 3
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/StringDigitSubstitute.cs b/mcs/class/System.Drawing/System.Drawing/StringDigitSubstitute.cs
deleted file mode 100644
index 377894f26f6..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/StringDigitSubstitute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Drawing.StringDigitSubstitute.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-
-using System;
-namespace System.Drawing
-{
- public enum StringDigitSubstitute {
- National = 1,
- None = 2,
- Traditional = 3,
- User = 4
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/StringFormatFlags.cs b/mcs/class/System.Drawing/System.Drawing/StringFormatFlags.cs
deleted file mode 100644
index c323522b838..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/StringFormatFlags.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Drawing.StringFormatFlags.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-
-using System;
-namespace System.Drawing
-{
- public enum StringFormatFlags {
- DirectionRightToLeft = 1,
- DirectionVertical = 2,
- DisplayFormatControl = 3,
- FitBlackBox = 4,
- LineLimit = 5,
- MeasureTrailingSpaces = 6,
- NoClip = 7,
- NoFontFallback = 8,
- NoWrap = 9,
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/StringTrimming.cs b/mcs/class/System.Drawing/System.Drawing/StringTrimming.cs
deleted file mode 100644
index ee4f1bb738a..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/StringTrimming.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Drawing.StringTrimming.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-
-using System;
-namespace System.Drawing
-{
- public enum StringTrimming{
- Character = 1,
- EllipsisCharacter = 2,
- EllipsisPath = 3,
- EllipsisWord = 4,
- None = 5,
- Word = 6
- }
-}
diff --git a/mcs/class/System.Drawing/System.Drawing/StringUnit.cs b/mcs/class/System.Drawing/System.Drawing/StringUnit.cs
deleted file mode 100644
index 82dd42b969d..00000000000
--- a/mcs/class/System.Drawing/System.Drawing/StringUnit.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Drawing.StringUnit.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-// Author: Dennis Hayes (dennish@raytek.com)
-//
-
-
-using System;
-namespace System.Drawing
-{
- public enum StringUnit{
- Display = 1,
- Document = 2,
- Em = 3,
- Inch = 3,
- Millimeter = 4,
- Pixel = 5,
- Point = 6,
- World = 7
- }
-}
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog b/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
deleted file mode 100644
index 62c04eb1808..00000000000
--- a/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2001-10-31 Mike Kestner <mkestner@speakeasy.net>
-
- * TestPoint.cs : Tests I've had in my node forever.
-
diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs
deleted file mode 100644
index 01de794dc02..00000000000
--- a/mcs/class/System.Drawing/Test/System.Drawing/TestPoint.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-// Tests for System.Drawing.Point.cs
-//
-// Author: Mike Kestner (mkestner@speakeasy.net)
-//
-// Copyright (c) 2001 Ximian, Inc.
-
-using NUnit.Framework;
-using System;
-using System.Drawing;
-
-public class PointTest : TestCase {
- Point pt1_1;
- Point pt1_0;
- Point pt0_1;
-
- protected override void SetUp ()
- {
- pt1_1 = new Point (1, 1);
- pt1_0 = new Point (1, 0);
- pt0_1 = new Point (0, 1);
- }
-
- public PointTest(String name) : base (name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (new PointTest ("EqualsTest"));
- suite.AddTest (new PointTest ("EqualityOpTest"));
- suite.AddTest (new PointTest ("InequalityOpTest"));
- suite.AddTest (new PointTest ("CeilingTest"));
- suite.AddTest (new PointTest ("RoundTest"));
- suite.AddTest (new PointTest ("TruncateTest"));
- suite.AddTest (new PointTest ("NullTest"));
- suite.AddTest (new PointTest ("AdditionTest"));
- suite.AddTest (new PointTest ("SubtractionTest"));
- suite.AddTest (new PointTest ("Point2SizeTest"));
- suite.AddTest (new PointTest ("Point2PointFTest"));
- suite.AddTest (new PointTest ("ConstructorTest"));
- suite.AddTest (new PointTest ("PropertyTest"));
- suite.AddTest (new PointTest ("OffsetTest"));
- return suite;
- }
- }
-
- public void EqualsTest ()
- {
- AssertEquals (pt1_1, pt1_1);
- AssertEquals (pt1_1, new Point (1, 1));
- Assert (!pt1_1.Equals (pt1_0));
- Assert (!pt1_1.Equals (pt0_1));
- Assert (!pt1_0.Equals (pt0_1));
- }
-
- public void EqualityOpTest ()
- {
- Assert (pt1_1 == pt1_1);
- Assert (pt1_1 == new Point (1, 1));
- Assert (!(pt1_1 == pt1_0));
- Assert (!(pt1_1 == pt0_1));
- Assert (!(pt1_0 == pt0_1));
- }
-
- public void InequalityOpTest ()
- {
- Assert (!(pt1_1 != pt1_1));
- Assert (!(pt1_1 != new Point (1, 1)));
- Assert (pt1_1 != pt1_0);
- Assert (pt1_1 != pt0_1);
- Assert (pt1_0 != pt0_1);
- }
-
- public void CeilingTest ()
- {
- PointF ptf = new PointF (0.8f, 0.3f);
- AssertEquals (pt1_1, Point.Ceiling (ptf));
- }
-
- public void RoundTest ()
- {
- PointF ptf = new PointF (0.8f, 1.3f);
- AssertEquals (pt1_1, Point.Round (ptf));
- }
-
- public void TruncateTest ()
- {
- PointF ptf = new PointF (0.8f, 1.3f);
- AssertEquals (pt0_1, Point.Truncate (ptf));
- }
-
- public void NullTest ()
- {
- Point pt = new Point (0, 0);
- AssertEquals (pt, Point.Empty);
- }
-
- public void AdditionTest ()
- {
- AssertEquals (pt1_1, pt1_0 + new Size (0, 1));
- AssertEquals (pt1_1, pt0_1 + new Size (1, 0));
- }
-
- public void SubtractionTest ()
- {
- AssertEquals (pt1_0, pt1_1 - new Size (0, 1));
- AssertEquals (pt0_1, pt1_1 - new Size (1, 0));
- }
-
- public void Point2SizeTest ()
- {
- Size sz1 = new Size (1, 1);
- Size sz2 = (Size) pt1_1;
-
- AssertEquals (sz1, sz2);
- }
-
- public void Point2PointFTest ()
- {
- PointF ptf1 = new PointF (1, 1);
- PointF ptf2 = pt1_1;
-
- AssertEquals (ptf1, ptf2);
- }
-
- public void ConstructorTest ()
- {
- int i = (1 << 16) + 1;
- Size sz = new Size (1, 1);
- Point pt_i = new Point (i);
- Point pt_sz = new Point (sz);
-
- AssertEquals (pt_i, pt_sz);
- AssertEquals (pt_i, pt1_1);
- AssertEquals (pt_sz, pt1_1);
- }
-
- public void PropertyTest ()
- {
- Point pt = new Point (0, 0);
-
- Assert (pt.IsEmpty);
- Assert (!pt1_1.IsEmpty);
- AssertEquals (1, pt1_0.X);
- AssertEquals (1, pt0_1.Y);
- }
-
- public void OffsetTest ()
- {
- Point pt = new Point (0, 0);
- pt.Offset (0, 1);
- AssertEquals (pt, pt0_1);
- pt.Offset (1, 0);
- AssertEquals (pt, pt1_1);
- pt.Offset (0, -1);
- AssertEquals (pt, pt1_0);
- }
-}
-
-
diff --git a/mcs/class/System.Drawing/list.unix b/mcs/class/System.Drawing/list.unix
deleted file mode 100755
index 8b14f9f92c4..00000000000
--- a/mcs/class/System.Drawing/list.unix
+++ /dev/null
@@ -1,59 +0,0 @@
--o System.Drawing.dll --target library
-System.Drawing/Point.cs
-System.Drawing/PointF.cs
-System.Drawing/Size.cs
-System.Drawing/SizeF.cs
-System.Drawing/Rectangle.cs
-System.Drawing/RectangleF.cs
-System.Drawing/Brush.cs
-System.Drawing/Pen.cs
-System.Drawing/GraphicsUnit.cs
-System.Drawing/Graphics.cs
-System.Drawing/ColorTranslator.cs
-System.Drawing/Bitmap.cs
-System.Drawing/Image.cs
-System.Drawing/Color.cs
-System.Drawing/ColorConverter.cs
-System.Drawing/KnownColor.cs
-System.Drawing/RotateFlipType.cs
-System.Drawing/StringAligment.cs
-System.Drawing/StringDigitSubstitute.cs
-System.Drawing/StringFormatFlags.cs
-System.Drawing/StringTrimming.cs
-System.Drawing/StringUnit.cs
-System.Drawing/ContentAlignment.cs
-System.Drawing/FontStyle.cs
-System.Drawing.Drawing2D/Enums.cs
-System.Drawing.Drawing2D/Matrix.cs
-System.Drawing.Drawing2D/TODOAttribute.cs
-System.Drawing.Drawing2D/PenAlignment.cs
-System.Drawing.Imaging/FrameDimension.cs
-System.Drawing.Imaging/ColorPalette.cs
-System.Drawing.Imaging/PixelFormat.cs
-System.Drawing.Imaging/Metafile.cs
-System.Drawing.Imaging/BitmapData.cs
-System.Drawing.Imaging/ColorAdjustType.cs
-System.Drawing.Imaging/ColorChannelFlag.cs
-System.Drawing.Imaging/ColorMapType.cs
-System.Drawing.Imaging/ColorMatrixFlag.cs
-System.Drawing.Imaging/ColorMode.cs
-System.Drawing.Imaging/EmfPlusRecordType.cs
-System.Drawing.Imaging/EmfType.cs
-System.Drawing.Imaging/EncoderParameterValueType.cs
-System.Drawing.Imaging/EncoderValue.cs
-System.Drawing.Imaging/ImageCodecFlags.cs
-System.Drawing.Imaging/ImageFlags.cs
-System.Drawing.Imaging/ImageLockMode.cs
-System.Drawing.Imaging/MetafileFrameUnit.cs
-System.Drawing.Imaging/PaletteFlags.cs
-System.Drawing.Design/UITypeEditorEditStyle.cs
-System.Drawing.Text/GenericFontFamilies.cs
-System.Drawing.Text/HotkeyPrefix.cs
-System.Drawing.Text/TextRenderingHint.cs
-System.Drawing.Printing/Duplex.cs
-System.Drawing.Printing/PaperKind.cs
-System.Drawing.Printing/PaperSourceKind.cs
-System.Drawing.Printing/PrintRange.cs
-System.Drawing.Printing/PrinterResolutionKind.cs
-System.Drawing.Printing/PrinterUnit.cs
-System.Drawing.Printing/PrintingPermissionLevel.cs
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/README b/mcs/class/System.Runtime.Serialization.Formatters.Soap/README
deleted file mode 100755
index d4127cf1289..00000000000
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/README
+++ /dev/null
@@ -1,4 +0,0 @@
-The SOAP Serialization Formatter is maintained by
-Jesus Suarez <gsus@brujula.net>
-
-Contact him regarding questions about this module.
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Sample.txt b/mcs/class/System.Runtime.Serialization.Formatters.Soap/Sample.txt
deleted file mode 100755
index dfa9e52a62b..00000000000
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/Sample.txt
+++ /dev/null
@@ -1,179 +0,0 @@
-namespace WindowsApplicationProve
-{
- namespace Cxxx
- {
- [Serializable]
- public struct OtherStruct
- {
- public int FInt;
- }
-
- [Serializable]
- public struct StructSample
- {
- public int FInt;
- public char FChar;
- public object FObj;
- }
- [Serializable]
- public enum EnumSample
- {
- aa,
- bb,
- cc
- }
-
- [Serializable]
- public delegate int DelegateProve(int i);
-
- [Serializable]
- public delegate void OtherDelegate();
-
- public interface ISample
- {
- int FirstMethod(char charParam);
- }
-
-
- [Serializable]
- public class cIntProve: ISample
- {
- public long FLongField;
- public int FirstMethod(char charParam)
- {
- return 6;
- }
- }
-
- public delegate string DlgProve(int i);
-
- [Serializable]
- public class cAgregationClass:BaseClass
- {
- public Char FCharField;
- public string FStr;
- public cSerializableProve Fobj;
- public ISample Fintf;
- //public int[][] FIntList;
- public string DlgCatcher(int i)
- {
- return "Hello";
- }
- }
-
- [Serializable]
- public class BaseClass
- {
- public int FBaseint;
- public cIntProve FIntObj;
- }
- [Serializable]
- public class cXXX
- {
- public int FI;
- }
-
- [Serializable]
- public class cSerializableProve
- {
- public object[] FArrayProve;
- public object[] FNullArray;
- //public ClassProve FOtherAssObj;
- public cAgregationClass FAggField;
- //value types
- public DelegateProve FDelegateProve;
- public event OtherDelegate FEventField;
- public ISample FInterfaceField;
- public string FStrField;
- private int FPintField;
- public int FIntField;
- public uint FUintField;
- public short FShortField;
- public ushort FUShortField;
- public long FLongField;
- public ulong FULongField;
- public bool FBoolField;
- public double FDoubleField;
- public decimal FDecimalField;
- public char FCharField;
- public StructSample FStructField;
- public EnumSample FEnumField;
-
- public cSerializableProve()
- {
- InitReferences();
- InitSimpleTypes();
- InitStructs();
- InitArray();
- }
-
- private void InitReferences()
- {
- FAggField = new cAgregationClass();
- FAggField.FCharField = 'a';
- FAggField.FBaseint = 10;
- FAggField.Fobj= this;
- FAggField.FStr= "Hhhh";
- FStrField= FAggField.FStr;
- FAggField.FIntObj= new cIntProve ();
- FInterfaceField= FAggField.FIntObj;
- FAggField.Fintf= FInterfaceField;
- }
-
- private void InitSimpleTypes()
- {
- FArrayProve= new Object[20];
- FPintField= 10;
- FIntField = 6;
- FUintField = 6;
- FShortField = 6;
- FUShortField = 6;
- FLongField = 6;
- FULongField = 6;
- FDoubleField = 6;
- FDecimalField = 5;
- FBoolField = true;
- FCharField = 'a';
- FEnumField = EnumSample.aa;
- }
-
- private void InitStructs()
- {
- FStructField= new StructSample();
- FStructField.FChar= 'a';
- FStructField.FInt= 10;
- FStructField.FObj= this.FAggField;
- }
-
- private void InitArray()
- {
- FArrayProve[0]= new cAgregationClass();
- ((cAgregationClass)FArrayProve[0]).FStr= "Hello";
- FArrayProve[1]= new cAgregationClass[2];
- ((cAgregationClass[])FArrayProve[1])[0]= this.FAggField;
- FArrayProve[2]= new int[][][]{new int[][]{new int[3], new int[3], new int[3]}, new int[][]{new int[3], new int[3], new int[3]}};
- /*Fill the integer array*/
- ((int[][][])FArrayProve[2])[1][1][1]= 10;
- ((int[][][])FArrayProve[2])[1][1][2]= 10;
- ((int[][][])FArrayProve[2])[1][1][0]= 10;
- FArrayProve[3]= new OtherStruct();
- FArrayProve[4]= 6;
- FArrayProve[5]= true;
- FArrayProve[6]= 2.5;
- FArrayProve[7]= EnumSample.bb;
- FArrayProve[8]= this.FInterfaceField;
- FArrayProve[9]= "Hello";
- FArrayProve[10]= new UInt32();
- FArrayProve[11]= new short();
- FArrayProve[12]= new UInt16();
- FArrayProve[13]= new decimal();
- FArrayProve[15]= new ulong();
- FArrayProve[16]= new char();
- FArrayProve[18]= null;
- }
-
- public void InitDelegates()
- {
- FDelegateProve= new DelegateProve(SIntProve);
- FEventField= new OtherDelegate(OtherProve);
- } \ No newline at end of file
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap.build b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap.build
deleted file mode 100755
index 8e6cbad2525..00000000000
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap.build
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.Runtime.Serialization.Formatters.Soap.dll -->
-
-<project name="System.Runtime.Serialization.Formatters.Soap" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/System.Runtime.Serialization.Formatters.Soap.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/unsafe"/>
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
- <arg value="/lib:../lib/"/>
-
- <!-- cor compare dies with these currently -->
- <!--arg value="/nostdlib"/--> <!-- don't reference mscorlib -->
- <!--arg value="/r:corlib.dll"/-->
- <arg value="/r:System.Xml.dll"/>
- <sources>
- <includes name="**/*.cs"/>
- </sources>
- </csc>
- <copy file="../lib/System.Runtime.Serialization.Formatters.Soap.dll" tofile="Test/System.Runtime.Serialization.Formatters.Soap.dll"/>
- <!--nant basedir="Test" target="build"/-->
- </target>
-
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="clean">
- <nant basedir="Test" target="clean"/>
- <delete file="../lib/System.Runtime.Serialization.Formatters.Soap.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ObjectSerializer.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ObjectSerializer.cs
deleted file mode 100755
index c72ef5a9b6e..00000000000
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/ObjectSerializer.cs
+++ /dev/null
@@ -1,374 +0,0 @@
-/****************************************************/
-/*ObjectSerializer class implementation */
-/*Author: Jesús M. Rodríguez de la Vega */
-/*gsus@brujula.net */
-/****************************************************/
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Reflection;
-using System.Collections;
-
-namespace System.Runtime.Serialization.Formatters.soap
-{
- public class ObjectSerializer
- {
- /*******const's section******/
- const string cStringType = "System.String";
- const string startxmlns = "xmlns:a";
- const string startdoc = "<SOAP-ENV:Envelope " +
- "xmlns:xsi= \"http://www.w3.org/2001/XMLSchema-instance\"" + " " +
- "xmlns:xsd= \"http://www.w3.org/2001/XMLSchema\"" + " " +
- "xmlns:SOAP-ENC= \"http://schemas.xmlsoap.org/soap/encoding/\"" + " " +
- "xmlns:SOAP-ENV= \"http://schemas.xmlsoap.org/soap/envelope/\"" + " " +
- "SOAP-ENV:encodingStyle= \"http://schemas.xmlsoap.org/soap/encoding/\">" + " " +
- "<SOAP-ENV:Body>" + " " +
- "</SOAP-ENV:Body>" + " " +
- "</SOAP-ENV:Envelope>";
- const string xmlnsassem = "http://schemas.microsoft.com/clr/nsassem/";
- const string xmlns = "http://schemas.microsoft.com/clr/ns/";
- const string basicassembly = "mscorlib";
- /*****Delegates const******/
- const string cDelegatesClass = "System.MulticastDelegate";
- const string cDelegateSerClass = "DelegateSerializationHolder";
- const string cDelegateType = "DelegateType";
- const string cDelegateAssembly = "DelegateAssembly";
- const string cTarget = "Target";
- const string cTargetTypAssem = "TargetTypeAssembly";
- const string cTargetTypName = "TargetTypeName";
- const string cMethodName = "MethodName";
- const string cDefaultValue = "_0x00_";
- /******field's sections******/
- private Stream FCurrentStream;
- private ArrayList AssemblyList; //the assemblies's been serialized
- public ArrayList XmlObjectList; //the list of the xml representation of all objects
- private ArrayList FObjectList; //the listof the object been seralized
- private SoapWriter ObjectWrt;
- private string FCurrentXml;// the object's xml representation
- /******method's section******/
- private void AddAssemblyToXml(string assemns)
- {
- XmlDocument xmldoc = new XmlDocument();
- xmldoc.LoadXml(FCurrentXml);
- XmlElement RootElemt = xmldoc.DocumentElement;
- string xmlns = startxmlns + AssemblyList.Count.ToString();
- XmlAttribute NewAttr= xmldoc.CreateAttribute(xmlns);
- RootElemt.SetAttributeNode(NewAttr);
- RootElemt.SetAttribute(xmlns, assemns);
- FCurrentXml= xmldoc.InnerXml;
- }
-
- private int AddAssembly(string assname, string nespname)
- {
- string XmlAssNs;
-
- if(assname == basicassembly)
- XmlAssNs= xmlns + nespname;
- else
- XmlAssNs= xmlnsassem + nespname + '/' + assname;
- int Result= AssemblyList.IndexOf(XmlAssNs);
- if(Result< 0)
- {
- Result= AssemblyList.Add(XmlAssNs);
- AddAssemblyToXml(XmlAssNs);
- }
- return Result;
- }
-
- private int AddObject(object graph, out bool AlreadyExists)
- {
- int index= FObjectList.IndexOf(graph);
- AlreadyExists= true;
- if(index < 0) //is a new object
- {
- AlreadyExists= false;
- index= FObjectList.Add(graph);
- }
- return index;
- }
-
- private int AddString(object StrObject, out bool AlreadyExists)
- {
- int index= FObjectList.IndexOf(StrObject);
- AlreadyExists= true;
- if(index < 0) //is a new object
- {
- AlreadyExists= false;
- index= FObjectList.Add(StrObject);
- }
- return index;
- }
- /******Xml Writer Methods******/
- private void AddObjectTagToXml(object ObjectField, int ParentIndex, string ObjectName)
- {
- }
- private void AddSimpleTagToXml()
- {
- }
- private int AddAssemblytoXml(Type ObjectType)
- {
- string assname, nespname;
- assname = ObjectType.Assembly.GetName().Name;
- nespname = ObjectType.Namespace;
- return AddAssembly(assname, nespname);
- }
- /******Serialization Methods******/
- private void SerializeEnum(object ActualObject, FieldInfo field, int ObjectIndex)
- {
- string FieldName= field.Name;
- string FieldValue= field.GetValue(ActualObject).ToString();
- ObjectWrt.WriteValueTypeToXml(FieldName, FieldValue, ObjectIndex);
- }
-
- private void SerializeStruct(object StructValue, string FieldName, int ObjectIndex, bool IsArrayItem)
- {
- int AssemblyIndex= AddAssemblytoXml(StructValue.GetType()) + 1;
- string StructTypeName= StructValue.GetType().Name;
- ObjectWrt.WriteStructInitTagToXml(FieldName, ObjectIndex, IsArrayItem, AssemblyIndex, StructTypeName);
- FieldInfo[] fieldtypes = StructValue.GetType().GetFields(BindingFlags.NonPublic|BindingFlags.Public|BindingFlags.Instance); //get the fields
- for(int index = 0; index<= fieldtypes.Length - 1; index++)
- {
- if(!fieldtypes[index].IsNotSerialized)
- {
- AssemblyIndex= AddAssemblytoXml(fieldtypes[index].FieldType);
- if(fieldtypes[index].FieldType.IsValueType)//if the field is a value type
- SerializeValueTypes(StructValue, fieldtypes[index], ObjectIndex);
- else
- SerializeReferenceTypes(ObjectIndex, fieldtypes[index].GetValue(StructValue), fieldtypes[index].FieldType, fieldtypes[index].Name);
-
- }
- }
- ObjectWrt.WriteStructEndTagToXml(FieldName, ObjectIndex);
- }
-
- private void SerializeValueTypes(object ActualObject, FieldInfo field, int ObjectIndex) //Serialize the value types
- {
- if(field.FieldType.IsEnum)
- SerializeEnum(ActualObject, field, ObjectIndex);
- else
- {
- if(field.FieldType.Assembly.GetName().Name == basicassembly)//is a simple field
- {
- string FieldName= field.Name;
- string FieldValue= field.GetValue(ActualObject).ToString();
- if(FieldValue.ToString().CompareTo("")==0)
- FieldValue= cDefaultValue;
- ObjectWrt.WriteValueTypeToXml(FieldName, FieldValue, ObjectIndex);
- }
- else //is a struct field
- {
- object StructValue= field.GetValue(ActualObject);
- SerializeStruct(StructValue, field.Name, ObjectIndex, false);
- }
- }
- }
-
- private void SerializeArrayItemValueType(object ArrayItem, int ArrayIndex, int AssemblyIndex, string ArrayItemsType)
- {
- if((ArrayItem.GetType().IsEnum)|(ArrayItem.GetType().Assembly.GetName().Name== basicassembly))
- {
- int ItemAssemblyIndex= AddAssemblytoXml(ArrayItem.GetType()) + 1;
- string ItemValue= ArrayItem.ToString();
- if(ArrayItem.ToString().CompareTo("")==0)
- ItemValue= cDefaultValue;
- ObjectWrt.WriteArrayValueItemToXml(ArrayItem.GetType().Name, ItemValue, ArrayIndex, ArrayItemsType, ItemAssemblyIndex);
- }
- else //is an struct
- SerializeStruct(ArrayItem, "item", ArrayIndex, true);
- }
-
- private void SerializeReferenceTypes(int ObjectIndex, object Instance, Type InstanceType, string InstanceName)
- {
- if(InstanceType.IsArray)
- {
- Array ArrayField= (Array)Instance;
- if(ArrayField!= null)
- {
- int ArrayIndex= SerializeArray(ArrayField);
- ObjectWrt.WriteObjectFieldToXml(InstanceName, ObjectIndex, ArrayIndex);
- }
- else
- ObjectWrt.WriteNullObjectFieldToXml(InstanceName, ObjectIndex);
- }
- else
- {
- if(InstanceType.FullName == cStringType)
- SerializeString(Instance, ObjectIndex, InstanceName);
- else
- {
- if((InstanceType.BaseType != null)&&(InstanceType.BaseType.ToString() == cDelegatesClass))//is a delegate's field
- {
- if(Instance!= null)
- {
- int DlgIndex= SerialializedDelegates(Instance, ObjectIndex);
- ObjectWrt.WriteObjectFieldToXml(InstanceName, ObjectIndex, DlgIndex);
- }
- else
- ObjectWrt.WriteNullObjectFieldToXml(InstanceName, ObjectIndex);
- }
- else
- {
- if((InstanceType.IsClass)||(InstanceType.IsInterface)) //if the field is a class's instance or an interface
- {
- if(Instance != null)
- {
- int FieldIndex= SerializeObject(Instance, ObjectIndex);
- ObjectWrt.WriteObjectFieldToXml(InstanceName, ObjectIndex, FieldIndex);
- }
- else
- ObjectWrt.WriteNullObjectFieldToXml(InstanceName, ObjectIndex);
- }
- }
- }
- }
- }
-
- private int SerializeArray(Array ArrayField)
- {
- int Length= ArrayField.Length;
- int AssemblyIndex= AddAssemblytoXml(ArrayField.GetType()) + 1;
- bool AlreadyExist;
- int ArrayIndex= AddObject(ArrayField, out AlreadyExist) + 1;
- if(!AlreadyExist)
- {
- string ArrayType= ArrayField.GetType().Name;
- string ArrayItemsType= ArrayField.GetType().Name.Substring(0, ArrayField.GetType().Name.IndexOf("["));
- string XmlSchemaArrayType= ObjectWrt.GenerateSchemaArrayType(ArrayType, Length, AssemblyIndex);
- ObjectWrt.WriteArrayToXml(XmlSchemaArrayType, ArrayIndex);
- object ItemValue;
- for(int index= 0; index<= Length - 1; index++)
- {
- ItemValue= ArrayField.GetValue(index);
- if(ItemValue== null)
- ObjectWrt.WriteNullObjectFieldToXml("item", ArrayIndex);
- else
- {
- if(ItemValue.GetType().IsValueType)
- {
- SerializeArrayItemValueType(ItemValue, ArrayIndex, AssemblyIndex, ArrayItemsType);
- }
- else//is a reference type
- {
- SerializeReferenceTypes(ArrayIndex, ItemValue, ItemValue.GetType(), "item");
- }
- }
- }
- }
- return ArrayIndex;
- }
-
- private void SerializeString(object StringObject, int ObjectIndex, string StringName)
- {
- bool AlreadyExits;
- int StringIndex= AddString(StringObject, out AlreadyExits) + 1;
- if(!AlreadyExits)
- {
- ObjectWrt.WriteStringTypeToXml(StringName, StringObject.ToString(), ObjectIndex, StringIndex);
- XmlObjectList.Add("");
- }
- else
- ObjectWrt.WriteObjectFieldToXml(StringName, ObjectIndex, StringIndex);
- }
-
- private void SerializeStringField(string StringName, string StringValue, int ObjectIndex)
- {
- bool AlreadyExits;
- int StringIndex= AddString(StringValue, out AlreadyExits) + 1;
- if(!AlreadyExits)
- {
- ObjectWrt.WriteStringTypeToXml(StringName, StringValue, ObjectIndex, StringIndex);
- XmlObjectList.Add("");
- }
- else
- ObjectWrt.WriteObjectFieldToXml(StringName, ObjectIndex, StringIndex);
- }
-
-
- private int SerialializedDelegates(object DelegateObject, int ParentObjectIndex)
- {
- bool AlreadyExits;
- int AssemblyIndex= AddAssembly(basicassembly, "System") + 1;
- int DelegatesIndex= AddObject(DelegateObject, out AlreadyExits) + 1;
- if(!AlreadyExits)
- {
- MulticastDelegate DelegateObj= (MulticastDelegate)DelegateObject;
- if(DelegateObj != null)
- {
- ObjectWrt.WriteObjectToXml(AssemblyIndex, DelegatesIndex, cDelegateSerClass); //write the delegates's init
- SerializeStringField(cDelegateType, DelegateObj.GetType().FullName, DelegatesIndex); //the delegate type
- SerializeStringField(cDelegateAssembly, DelegateObj.GetType().Assembly.FullName, DelegatesIndex); //the delegate assembly
- int FieldIndex= SerializeObject(DelegateObj.Target, DelegatesIndex); //Serialize the target
- ObjectWrt.WriteObjectFieldToXml(cTarget, DelegatesIndex, FieldIndex);
- SerializeStringField(cTargetTypAssem, DelegateObj.Target.GetType().Assembly.FullName, DelegatesIndex);
- SerializeStringField(cTargetTypName, DelegateObj.Target.GetType().FullName, DelegatesIndex);
- SerializeStringField(cMethodName, DelegateObj.Method.Name, DelegatesIndex);
- }
- }
- return DelegatesIndex;
- }
-
- private int SerializeObject(object graph, int ParentIndex)
- {
- string ClassName;
- int AssemblyIndex, ObjectIndex;
- bool AlreadyExits;
- if(graph.GetType().IsSerializable)
- {
- object ActualObject= graph;
- ObjectIndex= AddObject(ActualObject, out AlreadyExits) + 1; //add the object to the object's list
- if(!AlreadyExits)
- {
- AssemblyIndex= AddAssemblytoXml(ActualObject.GetType()) + 1;//add the assembly to the assemblies's list
- ClassName= graph.GetType().Name; //the class's name
- ObjectWrt.WriteObjectToXml(AssemblyIndex, ObjectIndex, ClassName); //write the object to the xml list
- FieldInfo[] fieldtypes = ActualObject.GetType().GetFields(BindingFlags.NonPublic|BindingFlags.Public|BindingFlags.Instance); //get the fields
- for(int index = 0; index<= fieldtypes.Length - 1; index++)
- {
- if(!fieldtypes[index].IsNotSerialized)
- {
- AssemblyIndex= AddAssemblytoXml(fieldtypes[index].FieldType);
- if(fieldtypes[index].FieldType.IsValueType)//if the field is a value type
- SerializeValueTypes(ActualObject, fieldtypes[index], ObjectIndex);
- else
- SerializeReferenceTypes(ObjectIndex, fieldtypes[index].GetValue(ActualObject), fieldtypes[index].FieldType, fieldtypes[index].Name);
- }
- }
- }
- return ObjectIndex;
- }
- else
- return -15000;
- }
-
- public void BeginWrite() //writes the basic elements of a soap message
- {
- FCurrentXml = startdoc;
- }
-
- public ObjectSerializer(Stream store) //assign the current stream
- {
- FCurrentStream = store;
- AssemblyList = new ArrayList(); //Init the lists
- XmlObjectList = new ArrayList();
- FObjectList = new ArrayList();
- ObjectWrt = new SoapWriter();
- ObjectWrt.FXmlObjectList= XmlObjectList;
- }
-
- public void CleatLists()
- {
- AssemblyList.Clear();
- XmlObjectList.Clear();
- FObjectList.Clear();
- FCurrentXml= "";
- }
-
- public void Serialize(object graph)
- {
- SerializeObject(graph, 0);
- ObjectWrt.WriteObjectListToXml(FCurrentXml, FCurrentStream);
- CleatLists();
- }
- }
-}
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs
deleted file mode 100755
index c4d0c4e9d53..00000000000
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************/
-/*Soapformatter class implementation */
-/*Author: Jesús M. Rodríguez de la Vega */
-/*gsus@brujula.net */
-/****************************************************/
-
-using System;
-using System.Reflection;
-using System.Xml;
-using System.IO;
-using System.Runtime.Serialization.Formatters;
-
-namespace System.Runtime.Serialization.Formatters.soap
-{
- public class SoapFormatter
- {
- private ObjectSerializer ObjSerializer;
- /*this is the soapformater's properties
- the Binder, Context and SurrogateSelector properties
- have not been declared yet*/
-
- public FormatterAssemblyStyle AssemblyFormat
- {
- get{return AssemblyFormat;}
- set{AssemblyFormat= value;}
- }
-
- public ISoapMessage TopObject
- {
- get{return TopObject;}
- set{TopObject= value;}
- }
-
- public FormatterTypeStyle TypeFormat
- {
- get{return TypeFormat;}
- set{TypeFormat= value;}
- }
-
- //the other constructor are not supplied yet
- public SoapFormatter()
- {
- }
-
- public void Serialize(Stream serializationStream, object graph)
- {
- ObjSerializer= new ObjectSerializer(serializationStream);
- ObjSerializer.BeginWrite();
- ObjSerializer.Serialize(graph);
- }
-
- public object Deserialize(Stream serializationStream)
- {
- return null;
- //not implented yet
- }
-
- }
-}
diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
deleted file mode 100755
index b0b3a0a5ae1..00000000000
--- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-/****************************************************/
-/*SoapWritter class implementation */
-/*Author: Jesús M. Rodríguez de la Vega */
-/*gsus@brujula.net */
-/****************************************************/
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Xml;
-using System.IO;
-
-namespace System.Runtime.Serialization.Formatters.soap
-{
-
- public class SoapWriter
- {
- /******const section******/
- const string cNullObject = "xsi:null=\"1\"/";
- const string cSoapEnv = "SOAP-ENV:Body";
- const string cStartTag = "<";
- const string cEndTag = ">";
- const string cNumber = "#";
- const string cEqual = "=";
- const string cTwoColon = ":";
- const string cAssId = "a";
- const string cslash = "/";
- const string cSoapRef = "href";
- const string cObjectRef = "ref-";
- const string cId = "id";
- /******Array's serialization section******/
- const string cItem = "item";
- const string cSoapEncArray = "SOAP-ENC:Array";
- const string cSoapArrayType = "SOAP-ENC:arrayType";
- const string cXsiType = "xsi:type";
- /******field's section******/
- public ArrayList FXmlObjectList;
- public int FReferenceNumber;
- /******method's section******/
- private string ConcatenateObjectList()
- {
- string XmlResult= "";
- object[] XmlList= FXmlObjectList.ToArray();
- for(int index= 0; index<= FXmlObjectList.Count - 1; index++)
- XmlResult= XmlResult + XmlList[index].ToString();
- return XmlResult;
- }
-
- private StringBuilder GetXmlObject(int ObjectIndex)
- {
- object[] XmlList= FXmlObjectList.ToArray();
- string Actstring= XmlList[ObjectIndex - 1].ToString();
- return new StringBuilder(Actstring);
- }
-
- public void WriteObjectToXml(int AssemblyIndex, int ReferenceIndex, string ClassName)
- {
- StringBuilder ObjWriter= new StringBuilder();
- string XmlStartTag= cStartTag + cAssId + AssemblyIndex.ToString() + cTwoColon + ClassName +
- ' ' + cId + cEqual + '"' + cObjectRef + ReferenceIndex + '"' + cEndTag;
- string XmlEndTag= cStartTag + cslash + cAssId + AssemblyIndex.ToString() + cTwoColon + ClassName + cEndTag;
- ObjWriter.Append(XmlStartTag);
- ObjWriter.Append(XmlEndTag);
- FXmlObjectList.Add(ObjWriter.ToString());
- }
-
- public void WriteArrayToXml(string XmlSchemaArrayType, int ArrayIndex)
- {
- StringBuilder ObjWriter= new StringBuilder();
- string XmlStartTag= cStartTag + cSoapEncArray + ' ' + cId + cEqual + '"' +
- cObjectRef + ArrayIndex + '"' + ' ' + cSoapArrayType +
- cEqual + XmlSchemaArrayType + cEndTag;
- string XmlEndTag= cStartTag + cslash + cSoapEncArray + cEndTag;
- ObjWriter.Append(XmlStartTag);
- ObjWriter.Append(XmlEndTag);
- FXmlObjectList.Add(ObjWriter.ToString());
- }
-
- public void WriteStringTypeToXml(string StringName, string StringValue, int ParentObjectIndex, int StringIndex)
- {
- StringBuilder ObjWriter= GetXmlObject(ParentObjectIndex);
- string StrFieldStartTag= cStartTag + StringName + ' ' + cId + cEqual + '"' + cObjectRef + StringIndex + '"' + cEndTag;
- string StrFieldEndTag = cStartTag + cslash + StringName + cEndTag;
- int index= ObjWriter.ToString().LastIndexOf(cStartTag);
- ObjWriter.Insert(index, StrFieldStartTag + StringValue + StrFieldEndTag);
- FXmlObjectList.RemoveAt(ParentObjectIndex - 1);
- FXmlObjectList.Insert(ParentObjectIndex - 1, ObjWriter.ToString());
- }
-
- public void WriteObjectFieldToXml(string FieldName, int ParentObjectIndex, int ObjectIndex)
- {
- StringBuilder ObjWriter= GetXmlObject(ParentObjectIndex);
- string XmlField= cStartTag + FieldName + ' ' + cSoapRef + cEqual
- + '"' + cNumber + cObjectRef + ObjectIndex.ToString() + '"'+ cslash + cEndTag;
- int index= ObjWriter.ToString().LastIndexOf(cStartTag);
- ObjWriter.Insert(index, XmlField);
- FXmlObjectList.RemoveAt(ParentObjectIndex - 1);
- FXmlObjectList.Insert(ParentObjectIndex - 1, ObjWriter.ToString());
- }
-
- public void WriteNullObjectFieldToXml(string FieldName, int ParentObjectIndex)
- {
- StringBuilder ObjWriter= GetXmlObject(ParentObjectIndex);
- string XmlField= cStartTag + FieldName + ' ' + cNullObject + cEndTag;
- int index= ObjWriter.ToString().LastIndexOf(cStartTag);
- ObjWriter.Insert(index, XmlField);
- FXmlObjectList.RemoveAt(ParentObjectIndex - 1);
- FXmlObjectList.Insert(ParentObjectIndex - 1, ObjWriter.ToString());
- }
-
- public void WriteValueTypeToXml(string FieldName, string FieldValue, int ObjectIndex)
- {
- StringBuilder ObjWriter= GetXmlObject(ObjectIndex);
- string XmlField= cStartTag + FieldName + cEndTag + FieldValue +
- cStartTag + cslash + FieldName + cEndTag;
- int index= ObjWriter.ToString().LastIndexOf(cStartTag);
- ObjWriter.Insert(index, XmlField);
- FXmlObjectList.RemoveAt(ObjectIndex - 1);
- FXmlObjectList.Insert(ObjectIndex - 1, ObjWriter.ToString());
- }
-
- public void WriteStructInitTagToXml(string StructName, int ObjectIndex, bool XsiType, int AssemblyIndex, string StructType)
- {
- StringBuilder ObjWriter= GetXmlObject(ObjectIndex);
- string StructInitTag= cStartTag + StructName;
- if(XsiType)
- StructInitTag= StructInitTag + ' ' + cXsiType + cEqual + '"' + "a" + AssemblyIndex + cTwoColon + StructType + '"';
- StructInitTag= StructInitTag + cEndTag;
- int index= ObjWriter.ToString().LastIndexOf(cStartTag);
- ObjWriter.Insert(index, StructInitTag);
- FXmlObjectList.RemoveAt(ObjectIndex - 1);
- FXmlObjectList.Insert(ObjectIndex - 1, ObjWriter.ToString());
- }
-
- public void WriteStructEndTagToXml(string StructName, int ObjectIndex)
- {
- StringBuilder ObjWriter= GetXmlObject(ObjectIndex);
- string StructInitTag= cStartTag + cslash + StructName + cEndTag;
- int index= ObjWriter.ToString().LastIndexOf(cStartTag);
- ObjWriter.Insert(index, StructInitTag);
- FXmlObjectList.RemoveAt(ObjectIndex - 1);
- FXmlObjectList.Insert(ObjectIndex - 1, ObjWriter.ToString());
- }
-
- public void WriteArrayValueItemToXml(string ItemType, string ItemValue, int ArrayIndex, string ArrayItemsType, int AssemblyIndex)
- {
- StringBuilder ObjWriter= GetXmlObject(ArrayIndex);
- string ItemInitTag= cStartTag + cItem;
- if(ArrayItemsType== "Object")
- {
- ItemInitTag= ItemInitTag + ' ' + cXsiType + cEqual + '"' + GenerateXmlSchemaType(ItemType, AssemblyIndex) + '"';
- }
- ItemInitTag= ItemInitTag + cEndTag + ItemValue + cStartTag + cslash + cItem + cEndTag;
- int index= ObjWriter.ToString().LastIndexOf(cStartTag);
- ObjWriter.Insert(index, ItemInitTag);
- FXmlObjectList.RemoveAt(ArrayIndex - 1);
- FXmlObjectList.Insert(ArrayIndex - 1, ObjWriter.ToString());
- }
-
- public void WriteStructTypeToXml(string StructName)
- {
- }
-
- public void WriteObjectListToXml(string SoapDoc, Stream SoapStream)
- {
- string XmlResult= ConcatenateObjectList();
- XmlDocument XmlDoc= new XmlDocument();
- XmlDoc.LoadXml(SoapDoc);
- XmlNode XNode= XmlDoc.DocumentElement.GetElementsByTagName(cSoapEnv).Item(0);
- XNode.InnerXml= XmlResult;
- StreamWriter SoapWrt= new StreamWriter(SoapStream);
- SoapWrt.Write(XmlDoc.InnerXml);
- SoapWrt.Close();
- }
-
- public string GenerateSchemaArrayType(string ArrayType, int ArrayLength, int AssemblyIndex)
- {
- string StrResult= ArrayType;
- string ArrayItems= ArrayType.Substring(0, ArrayType.IndexOf("["));
- string XmlSchType= GenerateXmlSchemaType(ArrayItems, AssemblyIndex);
- StrResult=StrResult.Replace(ArrayItems, XmlSchType);
- StrResult= StrResult.Insert(StrResult.LastIndexOf(']'), ArrayLength.ToString());
- StrResult= '"' + StrResult + '"';
- return StrResult;
- }
-
- public string GenerateXmlSchemaType(string TypeName, int AssemblyIndex)
- {
- string XmlSchType;
- switch(TypeName)
- {
- case "Int32" : XmlSchType= "xsd:int";
- break;
- case "Int16" : XmlSchType= "xsd:short";
- break;
- case "Int64" : XmlSchType= "xsd:long";
- break;
- case "UInt32" : XmlSchType= "xsd:unsignedInt";
- break;
- case "UInt16" : XmlSchType= "xsd:unsignedShort";
- break;
- case "UInt64" : XmlSchType= "xsd:unsignedLong";
- break;
- case "Byte" : XmlSchType= "xsd:byte";
- break;
- case "Decimal" : XmlSchType= "xsd:decimal";
- break;
- case "Double" : XmlSchType= "xsd:double";
- break;
- case "String" : XmlSchType= "xsd:string";
- break;
- case "Boolean" : XmlSchType= "xsd:boolean";
- break;
- case "DateTime" : XmlSchType= "xsd:dateTime";
- break;
- default : XmlSchType= "a" + AssemblyIndex + cTwoColon + TypeName;
- break;
- }
- return XmlSchType;
- }
- }
-}
diff --git a/mcs/class/System.Web/.cvsignore b/mcs/class/System.Web/.cvsignore
deleted file mode 100644
index d57b205f4e1..00000000000
--- a/mcs/class/System.Web/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-Temp.build
-*.dll
-lib
-makefile
diff --git a/mcs/class/System.Web/ChangeLog b/mcs/class/System.Web/ChangeLog
deleted file mode 100644
index 1eb608df778..00000000000
--- a/mcs/class/System.Web/ChangeLog
+++ /dev/null
@@ -1,98 +0,0 @@
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * list: updated and reformatted.
-
-2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Web.build: added /debug flag. I wanna see line numbers in
- exceptions thrown.
-
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Web.Security:
- * System.Web.SessionState: new directories.
-
-2002-05-17 Duncan Mak <duncan@ximian.com>
-
- * System.Web.build: Added new arguments: "/noconfig",
- "/r:System.Drawing.dll" and "/r:System.Xml.dll".
-
-2002-05-10 Duncan Mak <duncan@ximian.com>
-
- * System.Web.build: Include the System.Web.UI.HtmlControls namespace.
-
- * Page.cs:
- * ValidatorCollection.cs: Stubs to make things compile for
- now. Added one dummy method (RegisterClientScriptFile) that's used
- in the existing codebase, but not in MS docs.
-
-2002-04-26 Lawrence Pit <loz@cable.a2000.nl>
-
- * Added directory: System.Web.Mail
-
-2002-04-10 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * System.Web -- Assembly build.
-
- The basic runtime support is now working, we can now start working
- on the runtime flow system (thread pool etc) and also start testing
- the parser and control framework. (224 files are compiled)
-
-2002-03-26 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web.Security: Removed all files. Will do it later.
- May be someone else like to do it for the time being.
-
-2002-03-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web -- Assembly build.
- Another milestone reached. Compiled 195 classes successfully.
- Build includes System.Web.UI.WebControls and all the dependencies
- for the namespace.
-
-2002-03-05 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web.Security: Added directory.
-
-2002-03-04 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web.UI.WebContorls: Virtually complete. See
- System.Web.UI.WebControls/ChangeLog for a comprehensensive
- description of what's left and where. But, don't go for
- a build at this stage. There are a few classes left in
- System.Web namespace that need to be filled-up, though
- I will try to fix up the current state to be able to make
- a build.
-
-2001-12-20 Gaurav Vaish <gvaish@iitk.ac.in>
-
- Did first successful build of System.Web.dll that included
- System.Web.UI.WebControls namespace. Though, not updating
- the System.Web.build file, since with the changes that
- followed, the build again fails :(
-
-2001-11-30 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web.WebUtils: Removed
- * System.Web.Utils : Added --- replacement of WebUtils
-
-2001-11-08 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * System.Web.WebUtils: Added directory
-
-2001-08-22 Bob Smith <bob@thestuff.net>
-
- * Added directory: System.Web.UI.HtmlControls
- * Added directory: Test
-
-2001-08-17 Bob Smith <bob@thestuff.net>
-
- * Added directory: System.Web.UI
-
-2001-08-09 Bob Smith <bob@thestuff.net>
-
- * Added directory: System.Web
-
-2001-07-20 Patrik Torstensson (Patrik.Torstensson@labs2.com)
-
- * Added directory: System.Web.Caching
diff --git a/mcs/class/System.Web/System.Web.Caching/Cache.cs b/mcs/class/System.Web/System.Web.Caching/Cache.cs
deleted file mode 100644
index 5e331aa43c4..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/Cache.cs
+++ /dev/null
@@ -1,520 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Implements a cache for Web applications and other. The difference from the MS.NET implementation is that we
- /// support to use the Cache object as cache in our applications.
- /// </summary>
- /// <remarks>
- /// The Singleton cache is created per application domain, and it remains valid as long as the application domain remains active.
- /// </remarks>
- /// <example>
- /// Usage of the singleton cache:
- ///
- /// Cache objManager = Cache.SingletonCache;
- ///
- /// String obj = "tobecached";
- /// objManager.Add("kalle", obj);
- /// </example>
- public class Cache : System.Collections.IEnumerable, System.IDisposable
- {
- // Declarations
-
- // MS.NET Does only have the cache connected to the HttpRuntime and we don't have the HttpRuntime (yet)
- static Cache objSingletonCache = new Cache();
-
- private bool _boolDisposed;
-
- // Helper objects
- private CacheExpires _objExpires;
-
- // The data storage
- // Todo: Make a specialized storage for the cache entries?
- // todo: allow system to replace the storage?
- private System.Collections.Hashtable _arrEntries;
- private System.Threading.ReaderWriterLock _lockEntries;
-
- static private System.TimeSpan _datetimeOneYear = System.TimeSpan.FromDays(365);
-
- // Number of items in the cache
- private long _longItems;
-
- // Constructor
- public Cache()
- {
- _boolDisposed = false;
- _longItems = 0;
-
- _lockEntries = new System.Threading.ReaderWriterLock();
- _arrEntries = new System.Collections.Hashtable();
-
- _objExpires = new CacheExpires(this);
- }
-
- // Public methods and properties
-
- //
- /// <summary>
- /// Returns a static version of the cache. In MS.NET the cache is stored in the System.Web.HttpRuntime
- /// but we keep it here as a singleton (right now anyway).
- /// </summary>
- public static Cache SingletonCache
- {
- get
- {
- if (objSingletonCache == null)
- {
- throw new System.InvalidOperationException();
- }
-
- return objSingletonCache;
- }
- }
-
- /// <summary>
- /// Used in the absoluteExpiration parameter in an Insert method call to indicate the item should never expire. This field is read-only.
- /// </summary>
- public static readonly System.DateTime NoAbsoluteExpiration = System.DateTime.MaxValue;
-
- /// <summary>
- /// Used as the slidingExpiration parameter in an Insert method call to disable sliding expirations. This field is read-only.
- /// </summary>
- public static readonly System.TimeSpan NoSlidingExpiration = System.TimeSpan.Zero;
-
- /// <summary>
- /// Internal method to create a enumerator and over all public items in the cache and is used by GetEnumerator method.
- /// </summary>
- /// <returns>Returns IDictionaryEnumerator that contains all public items in the cache</returns>
- private System.Collections.IDictionaryEnumerator CreateEnumerator()
- {
- System.Collections.Hashtable objTable;
-
- _lockEntries.AcquireReaderLock(int.MaxValue);
- try
- {
- // Create a new hashtable to return as collection of public items
- objTable = new System.Collections.Hashtable(_arrEntries.Count);
-
- foreach(System.Collections.DictionaryEntry objEntry in _arrEntries)
- {
- if (objEntry.Key != null)
- {
- // Check if this is a public entry
- if (((CacheEntry) objEntry.Value).TestFlag(CacheEntry.Flags.Public))
- {
- // Add to the collection
- objTable.Add(objEntry.Key, ((CacheEntry) objEntry.Value).Item);
- }
- }
- }
- }
- finally
- {
- _lockEntries.ReleaseReaderLock();
- }
-
- return objTable.GetEnumerator();
- }
-
- /// <summary>
- /// Implementation of IEnumerable interface and calls the GetEnumerator that returns
- /// IDictionaryEnumerator.
- /// </summary>
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- /// <summary>
- /// Virtual override of the IEnumerable.GetEnumerator() method, returns a specialized enumerator.
- /// </summary>
- public virtual System.Collections.IDictionaryEnumerator GetEnumerator()
- {
- return CreateEnumerator();
- }
-
- /// <summary>
- /// Touches a object in the cache. Used to update expire time and hit count.
- /// </summary>
- /// <param name="strKey">The identifier for the cache item to retrieve.</param>
- public void Touch(string strKey)
- {
- // Just touch the object
- Get(strKey);
- }
-
- /// <summary>
- /// Adds the specified item to the Cache object with dependencies, expiration and priority policies, and a
- /// delegate you can use to notify your application when the inserted item is removed from the Cache.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- /// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
- /// <param name="enumPriorityDecay">The rate at which an object in the cache decays in importance. Objects that decay quickly are more likely to be removed.</param>
- /// <param name="eventRemoveCallback">A delegate that, if provided, is called when an object is removed from the cache. You can use this to notify applications when their objects are deleted from the cache.</param>
- /// <returns>The Object item added to the Cache.</returns>
- public object Add(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration, CacheItemPriority enumPriority, CacheItemPriorityDecay enumPriorityDecay, CacheItemRemovedCallback eventRemoveCallback)
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.Cache");
- }
-
- if (strKey == null)
- {
- throw new System.ArgumentNullException("strKey");
- }
-
- if (objItem == null)
- {
- throw new System.ArgumentNullException("objItem");
- }
-
- if (slidingExpiration > _datetimeOneYear)
- {
- throw new System.ArgumentOutOfRangeException("slidingExpiration");
- }
-
- CacheEntry objEntry;
- CacheEntry objNewEntry;
-
- long longHitRange = 10000;
-
- // todo: check decay and make up the minHit range
-
- objEntry = new CacheEntry(this, strKey, objItem, objDependency, eventRemoveCallback, absolutExpiration, slidingExpiration, longHitRange, true, enumPriority);
-
- System.Threading.Interlocked.Increment(ref _longItems);
-
- // If we have any kind of expiration add into the CacheExpires class
- if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration)
- {
- // Add it to CacheExpires
- _objExpires.Add(objEntry);
- }
-
- // Check and get the new item..
- objNewEntry = UpdateCache(strKey, objEntry, true, CacheItemRemovedReason.Removed);
-
- if (objNewEntry != null)
- {
- // Return added item
- return objEntry.Item;
- }
- else
- {
- return null;
- }
- }
-
- /// <summary>
- /// Inserts an item into the Cache object with a cache key to reference its location and using default values
- /// provided by the CacheItemPriority and CacheItemPriorityDecay enumerations.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- public void Insert(string strKey, object objItem)
- {
- Add(strKey, objItem, null, System.DateTime.MaxValue, System.TimeSpan.Zero, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
- }
-
- /// <summary>
- /// Inserts an object into the Cache that has file or key dependencies.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- public void Insert(string strKey, object objItem, CacheDependency objDependency)
- {
- Add(strKey, objItem, objDependency, System.DateTime.MaxValue, System.TimeSpan.Zero, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
- }
-
- /// <summary>
- /// Inserts an object into the Cache with dependencies and expiration policies.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- public void Insert(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration)
- {
- Add(strKey, objItem, objDependency, absolutExpiration, slidingExpiration, CacheItemPriority.Default, CacheItemPriorityDecay.Default, null);
- }
-
- /// <summary>
- /// Inserts an object into the Cache object with dependencies, expiration and priority policies, and a delegate
- /// you can use to notify your application when the inserted item is removed from the Cache.
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="absolutExpiration">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="slidingExpiration">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- /// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
- /// <param name="enumPriorityDecay">The rate at which an object in the cache decays in importance. Objects that decay quickly are more likely to be removed.</param>
- /// <param name="eventRemoveCallback">A delegate that, if provided, is called when an object is removed from the cache. You can use this to notify applications when their objects are deleted from the cache.</param>
- public void Insert(string strKey, object objItem, CacheDependency objDependency, System.DateTime absolutExpiration, System.TimeSpan slidingExpiration, CacheItemPriority enumPriority, CacheItemPriorityDecay enumPriorityDecay, CacheItemRemovedCallback eventRemoveCallback)
- {
- Add(strKey, objItem, objDependency, absolutExpiration, slidingExpiration, enumPriority, enumPriorityDecay, eventRemoveCallback);
- }
-
- /// <summary>
- /// Removes the specified item from the Cache object.
- /// </summary>
- /// <param name="strKey">The cache key for the cache item to remove.</param>
- /// <returns>The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.</returns>
- public object Remove(string strKey)
- {
- return Remove(strKey, CacheItemRemovedReason.Removed);
- }
-
- /// <summary>
- /// Internal method that updates the cache, decremenents the number of existing items and call close on the cache entry. This method
- /// is also used from the ExpiresBuckets class to remove an item during GC flush.
- /// </summary>
- /// <param name="strKey">The cache key for the cache item to remove.</param>
- /// <param name="enumReason">Reason why the item is removed.</param>
- /// <returns>The item removed from the Cache. If the value in the key parameter is not found, returns a null reference.</returns>
- internal object Remove(string strKey, CacheItemRemovedReason enumReason)
- {
- CacheEntry objEntry = UpdateCache(strKey, null, true, enumReason);
-
- if (objEntry != null)
- {
- System.Threading.Interlocked.Decrement(ref _longItems);
-
- // Close the cache entry (calls the remove delegate)
- objEntry.Close(enumReason);
-
- return objEntry.Item;
- } else
- {
- return null;
- }
- }
-
- /// <summary>
- /// Retrieves the specified item from the Cache object.
- /// </summary>
- /// <param name="strKey">The identifier for the cache item to retrieve.</param>
- /// <returns>The retrieved cache item, or a null reference.</returns>
- public object Get(string strKey)
- {
- CacheEntry objEntry = UpdateCache(strKey, null, false, CacheItemRemovedReason.Expired);
-
- if (objEntry == null)
- {
- return null;
- } else
- {
- return objEntry.Item;
- }
- }
-
- /// <summary>
- /// Internal method used for removing, updating and adding CacheEntries into the cache.
- /// </summary>
- /// <param name="strKey">The identifier for the cache item to modify</param>
- /// <param name="objEntry">CacheEntry to use for overwrite operation, if this parameter is null and overwrite true the item is going to be removed</param>
- /// <param name="boolOverwrite">If true the objEntry parameter is used to overwrite the strKey entry</param>
- /// <param name="enumReason">Reason why an item was removed</param>
- /// <returns></returns>
- private CacheEntry UpdateCache(string strKey, CacheEntry objEntry, bool boolOverwrite, CacheItemRemovedReason enumReason)
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.Cache", "Can't update item(s) in a disposed cache");
- }
-
- if (strKey == null)
- {
- throw new System.ArgumentNullException("System.Web.Cache");
- }
-
- long ticksNow = System.DateTime.Now.Ticks;
- long ticksExpires = long.MaxValue;
-
- bool boolGetItem = false;
- bool boolExpiried = false;
- bool boolWrite = false;
- bool boolRemoved = false;
-
- // Are we getting the item from the hashtable
- if (boolOverwrite == false && strKey.Length > 0 && objEntry == null)
- {
- boolGetItem = true;
- }
-
- // TODO: Optimize this method, move out functionality outside the lock
- _lockEntries.AcquireReaderLock(int.MaxValue);
- try
- {
- if (boolGetItem)
- {
- objEntry = (CacheEntry) _arrEntries[strKey];
- if (objEntry == null)
- {
- return null;
- }
- }
-
- if (objEntry != null)
- {
- // Check if we have expired
- if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration)
- {
- if (objEntry.Expires < ticksNow)
- {
- // We have expired, remove the item from the cache
- boolWrite = true;
- boolExpiried = true;
- }
- }
- }
-
- // Check if we going to modify the hashtable
- if (boolWrite || (boolOverwrite && !boolExpiried))
- {
- // Upgrade our lock to write
- System.Threading.LockCookie objCookie = _lockEntries.UpgradeToWriterLock(int.MaxValue);
- try
- {
- // Check if we going to just modify an existing entry (or add)
- if (boolOverwrite && objEntry != null)
- {
- _arrEntries[strKey] = objEntry;
- }
- else
- {
- // We need to remove the item, fetch the item first
- objEntry = (CacheEntry) _arrEntries[strKey];
- if (objEntry != null)
- {
- _arrEntries.Remove(strKey);
- }
-
- boolRemoved = true;
- }
- }
- finally
- {
- _lockEntries.DowngradeFromWriterLock(ref objCookie);
- }
- }
-
- // If the entry haven't expired or been removed update the info
- if (!boolExpiried && !boolRemoved)
- {
- // Update that we got a hit
- objEntry.Hits++;
- if (objEntry.HasSlidingExpiration)
- {
- ticksExpires = ticksNow + objEntry.SlidingExpiration;
- }
- }
- }
- finally
- {
- _lockEntries.ReleaseLock();
-
- }
-
- // If the item was removed we need to remove it from the CacheExpired class also
- if (boolRemoved)
- {
- if (objEntry != null)
- {
- if (objEntry.HasAbsoluteExpiration || objEntry.HasSlidingExpiration)
- {
- _objExpires.Remove(objEntry);
- }
- }
-
- // Return the entry, it's not up to the UpdateCache to call Close on the entry
- return objEntry;
- }
-
- // If we have sliding expiration and we have a correct hit, update the expiration manager
- if (objEntry.HasSlidingExpiration)
- {
- _objExpires.Update(objEntry, ticksExpires);
- }
-
- // Return the cache entry
- return objEntry;
- }
-
- /// <summary>
- /// Gets the number of items stored in the cache.
- /// </summary>
- long Count
- {
- get
- {
- return _longItems;
- }
- }
-
- /// <summary>
- /// Gets or sets the cache item at the specified key.
- /// </summary>
- public object this[string strKey]
- {
- get
- {
- return Get(strKey);
- }
-
- set
- {
- Insert(strKey, value);
- }
- }
-
- /// <summary>
- /// Called to close the cache when the AppDomain is closing down or the GC has decided it's time to destroy the object.
- /// </summary>
- public void Dispose()
- {
- _boolDisposed = true;
-
- _lockEntries.AcquireReaderLock(int.MaxValue);
- try
- {
- foreach(System.Collections.DictionaryEntry objEntry in _arrEntries)
- {
- if (objEntry.Key != null)
- {
- // Check if this is active
- if ( ((CacheEntry) objEntry.Value).TestFlag(CacheEntry.Flags.Removed) )
- {
- try
- {
- ((CacheEntry) objEntry.Value).Close(CacheItemRemovedReason.Removed);
- }
- catch (System.Exception objException)
- {
- System.Diagnostics.Debug.Fail("System.Web.Cache.Dispose() Exception when closing cache entry", "Message: " + objException.Message + " Stack: " + objException.StackTrace + " Source:" + objException.Source);
- }
- }
- }
- }
- }
- finally
- {
- _lockEntries.ReleaseReaderLock();
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs b/mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs
deleted file mode 100644
index d59afadc184..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheDefinitions.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Specifies the relative priority of items stored in the Cache.
- /// </summary>
- public enum CacheItemPriority {
- AboveNormal,
- BelowNormal,
- Default,
- High,
- Low,
- Normal,
- NotRemovable
- }
-
- /// <summary>
- /// Specifies the rate at which the priority of items stored in the Cache are downgraded when not accessed frequently.
- /// </summary>
- public enum CacheItemPriorityDecay {
- Default,
- Fast,
- Medium,
- Never,
- Slow
- }
-
- /// <summary>
- /// Specifies the reason an item was removed from the Cache.
- /// </summary>
- public enum CacheItemRemovedReason {
- DependencyChanged,
- Expired,
- Removed,
- Underused
- }
-
- /// <summary>
- /// Defines a callback method for notifying applications when a cached item is removed from the Cache.
- /// </summary>
- /// <param name="key">The index location for the item removed from the cache. </param>
- /// <param name="value">The Object item removed from the cache. </param>
- /// <param name="reason">The reason the item was removed from the cache, as specified by the CacheItemRemovedReason enumeration.</param>
- public delegate void CacheItemRemovedCallback(string key, object value, CacheItemRemovedReason reason);
-
- }
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs b/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
deleted file mode 100644
index 845074be618..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheDependency.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Class to handle cache dependency, right now this class is only a mookup
- /// </summary>
- public class CacheDependency : System.IDisposable
- {
- private bool _boolDisposed;
-
- public CacheDependency()
- {
- _boolDisposed = false;
- }
-
- /// <remarks>
- /// Added by gvaish@iitk.ac.in
- /// </remarks>
- [MonoTODO("Constructor")]
- public CacheDependency(string filename)
- {
- }
-
- /// <remarks>
- /// Added by gvaish@iitk.ac.in
- /// </remarks>
- [MonoTODO("Constructor")]
- public CacheDependency(string[] filenames, string[] cachekeys)
- {
- }
-
- public delegate void CacheDependencyCallback(CacheDependency objDependency);
-
- public event CacheDependencyCallback Changed;
-
- public void OnChanged()
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.CacheDependency");
- }
-
- if (Changed != null)
- {
- Changed(this);
- }
- }
-
- public bool IsDisposed
- {
- get
- {
- return _boolDisposed;
- }
- }
-
- public bool HasEvents
- {
- get
- {
- if (_boolDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.CacheDependency");
- }
-
- if (Changed != null)
- {
- return true;
- }
-
- return false;
- }
- }
-
- public void Dispose()
- {
- _boolDisposed = true;
- }
-
- /// <summary>
- /// Used in testing.
- /// </summary>
- public void Signal()
- {
- OnChanged();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs b/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
deleted file mode 100644
index 0943be5db30..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs
+++ /dev/null
@@ -1,363 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Class responsible for representing a cache entry.
- /// </summary>
- public class CacheEntry
- {
- /// <summary>
- /// Defines the status of the current cache entry
- /// </summary>
- public enum Flags
- {
- Removed = 0,
- Public = 1
- }
-
- private CacheItemPriority _enumPriority;
-
- private long _longHits;
-
- private byte _byteExpiresBucket;
- private int _intExpiresIndex;
-
- private long _ticksExpires;
- private long _ticksSlidingExpiration;
-
- private string _strKey;
- private object _objItem;
-
- private long _longMinHits;
-
- private Flags _enumFlags;
-
- private CacheDependency _objDependency;
- private Cache _objCache;
-
- /// <summary>
- /// Constructs a new cache entry
- /// </summary>
- /// <param name="strKey">The cache key used to reference the item.</param>
- /// <param name="objItem">The item to be added to the cache.</param>
- /// <param name="objDependency">The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this paramter contains a null reference.</param>
- /// <param name="dtExpires">The time at which the added object expires and is removed from the cache. </param>
- /// <param name="tsSpan">The interval between the time the added object was last accessed and when that object expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed.</param>
- /// <param name="longMinHits">Used to detect and control if the item should be flushed due to under usage</param>
- /// <param name="boolPublic">Defines if the item is public or not</param>
- /// <param name="enumPriority">The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost.</param>
- public CacheEntry( Cache objManager, string strKey, object objItem, CacheDependency objDependency, CacheItemRemovedCallback eventRemove,
- System.DateTime dtExpires, System.TimeSpan tsSpan, long longMinHits, bool boolPublic, CacheItemPriority enumPriority )
- {
- if (boolPublic)
- {
- SetFlag(Flags.Public);
- }
-
- _strKey = strKey;
- _objItem = objItem;
- _objCache = objManager;
-
- _onRemoved += eventRemove;
-
- _enumPriority = enumPriority;
-
- _ticksExpires = dtExpires.Ticks;
-
- _ticksSlidingExpiration = tsSpan.Ticks;
-
- // If we have a sliding expiration it overrides the absolute expiration (MS behavior)
- if (tsSpan.Ticks != System.TimeSpan.Zero.Ticks)
- {
- _ticksExpires = System.DateTime.Now.AddTicks(_ticksSlidingExpiration).Ticks;
- }
-
- _objDependency = objDependency;
- if (_objDependency != null)
- {
- if (_objDependency.IsDisposed)
- {
- throw new System.ObjectDisposedException("System.Web.CacheDependency");
- }
-
- // Add the entry to the cache dependency handler (we support multiple entries per handler)
- _objDependency.Changed += new CacheDependency.CacheDependencyCallback(OnChanged);
- }
-
- _longMinHits = longMinHits;
- }
-
- private event CacheItemRemovedCallback _onRemoved;
-
- public void OnChanged(CacheDependency objDependency)
- {
- _objCache.Remove(_strKey, CacheItemRemovedReason.DependencyChanged);
- }
-
- /// <summary>
- /// Cleans up the cache entry, removes the cache dependency and calls the remove delegate.
- /// </summary>
- /// <param name="enumReason">The reason why the cache entry are going to be removed</param>
- public void Close(CacheItemRemovedReason enumReason)
- {
- lock(this)
- {
- // Check if the item already is removed
- if (TestFlag(Flags.Removed))
- {
- return;
- }
-
- SetFlag(Flags.Removed);
-
- if (_onRemoved != null)
- {
- // Call the delegate to tell that we are now removing the entry
- try
- {
- _onRemoved(_strKey, _objItem, enumReason);
- }
- catch (System.Exception objException)
- {
- System.Diagnostics.Debug.Fail("System.Web.CacheEntry.Close() Exception when calling remove delegate", "Message: " + objException.Message + " Stack: " + objException.StackTrace + " Source:" + objException.Source);
- }
- }
-
- // If we have a dependency, remove the entry
- if (_objDependency != null)
- {
- _objDependency.Changed -= new CacheDependency.CacheDependencyCallback(OnChanged);
- if (!_objDependency.HasEvents)
- {
- _objDependency.Dispose();
- }
- }
- }
- }
-
- /// <summary>
- /// Tests a specific flag is set or not.
- /// </summary>
- /// <param name="oFlag">Flag to test agains</param>
- /// <returns>Returns true if the flag is set.</returns>
- public bool TestFlag(Flags oFlag)
- {
- lock(this)
- {
- if ((_enumFlags & oFlag) != 0)
- {
- return true;
- }
-
- return false;
- }
- }
-
- /// <summary>
- /// Sets a specific flag.
- /// </summary>
- /// <param name="oFlag">Flag to set.</param>
- public void SetFlag(Flags oFlag)
- {
- lock (this)
- {
- _enumFlags |= oFlag;
- }
- }
-
- /// <summary>
- /// Returns true if the object has minimum hit usage flushing enabled.
- /// </summary>
- public bool HasUsage
- {
- get {
- if (_longMinHits == System.Int64.MaxValue)
- {
- return false;
- }
-
- return true;
- }
- }
-
- /// <summary>
- /// Returns true if the entry has absolute expiration.
- /// </summary>
- public bool HasAbsoluteExpiration
- {
- get
- {
- if (_ticksExpires == System.DateTime.MaxValue.Ticks)
- {
- return false;
- }
-
- return true;
- }
- }
-
- /// <summary>
- /// Returns true if the entry has sliding expiration enabled.
- /// </summary>
- public bool HasSlidingExpiration
- {
- get
- {
- if (_ticksSlidingExpiration == System.TimeSpan.Zero.Ticks)
- {
- return false;
- }
-
- return true;
- }
- }
-
- /// <summary>
- /// Gets and sets the current expires bucket the entry is active in.
- /// </summary>
- public byte ExpiresBucket
- {
- get
- {
- lock (this)
- {
- return _byteExpiresBucket;
- }
- }
- set
- {
- lock (this)
- {
- _byteExpiresBucket = ExpiresBucket;
- }
- }
- }
-
- /// <summary>
- /// Gets and sets the current index in the expires bucket of the current cache entry.
- /// </summary>
- public int ExpiresIndex
- {
- get
- {
- lock (this)
- {
- return _intExpiresIndex;
- }
- }
-
- set
- {
- lock (this)
- {
- _intExpiresIndex = ExpiresIndex;
- }
- }
- }
-
- /// <summary>
- /// Gets and sets the expiration of the cache entry.
- /// </summary>
- public long Expires
- {
- get
- {
- lock (this)
- {
- return _ticksExpires;
- }
- }
- set
- {
- lock (this)
- {
- _ticksExpires = Expires;
- }
- }
- }
-
- /// <summary>
- /// Gets the sliding expiration value. The return value is in ticks (since 0/0-01 in 100nanosec)
- /// </summary>
- public long SlidingExpiration
- {
- get
- {
- return _ticksSlidingExpiration;
- }
- }
-
- /// <summary>
- /// Returns the current cached item.
- /// </summary>
- public object Item
- {
- get
- {
- return _objItem;
- }
- }
-
- /// <summary>
- /// Returns the current cache identifier.
- /// </summary>
- public string Key
- {
- get
- {
- return _strKey;
- }
- }
-
- /// <summary>
- /// Gets and sets the current number of hits on the cache entry.
- /// </summary>
- public long Hits
- {
- // todo: Could be optimized by using interlocked methods..
- get
- {
- lock (this)
- {
- return _longHits;
- }
- }
- set
- {
- lock (this)
- {
- _longHits = Hits;
- }
- }
- }
-
- /// <summary>
- /// Returns minimum hits for the usage flushing rutine.
- /// </summary>
- public long MinimumHits
- {
- get
- {
- return _longMinHits;
- }
- }
-
- /// <summary>
- /// Returns the priority of the cache entry.
- /// </summary>
- public CacheItemPriority Priority
- {
- get
- {
- return _enumPriority;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs b/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
deleted file mode 100644
index a58eb5c1e69..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Class responsible for handling time based flushing of entries in the cache. The class creates
- /// and manages 60 buckets each holding every item that expires that minute. The bucket calculated
- /// for an entry is one minute more than the timeout just to make sure that the item end up in the
- /// bucket where it should be flushed.
- /// </summary>
- public class CacheExpires : System.IDisposable
- {
- static int _intFlush;
- static long _ticksPerBucket = 600000000;
- static long _ticksPerCycle = _ticksPerBucket * 60;
-
- private ExpiresBucket[] _arrBuckets;
- private System.Threading.Timer _objTimer;
- private Cache _objManager;
-
- /// <summary>
- /// Constructor
- /// </summary>
- /// <param name="objManager">The cache manager, used when flushing items in a bucket.</param>
- public CacheExpires(Cache objManager)
- {
- _objManager = objManager;
- Initialize();
- }
-
- /// <summary>
- /// Initializes the class.
- /// </summary>
- private void Initialize()
- {
- // Create one bucket per minute
- _arrBuckets = new ExpiresBucket[60];
-
- byte bytePos = 0;
- do
- {
- _arrBuckets[bytePos] = new ExpiresBucket(bytePos, _objManager);
- bytePos++;
- } while (bytePos < 60);
-
- // GC Bucket controller
- _intFlush = System.DateTime.Now.Minute - 1;
- _objTimer = new System.Threading.Timer(new System.Threading.TimerCallback(GarbageCleanup), null, 10000, 60000);
- }
-
- /// <summary>
- /// Adds a Cache entry to the correct flush bucket.
- /// </summary>
- /// <param name="objEntry">Cache entry to add.</param>
- public void Add(CacheEntry objEntry)
- {
- long ticksNow = System.DateTime.Now.Ticks;
-
- lock(this)
- {
- // If the entry doesn't have a expires time we assume that the entry is due to expire now.
- if (objEntry.Expires == 0)
- {
- objEntry.Expires = ticksNow;
- }
-
- _arrBuckets[GetHashBucket(objEntry.Expires)].Add(objEntry);
- }
- }
-
- public void Remove(CacheEntry objEntry)
- {
- long ticksNow = System.DateTime.Now.Ticks;
-
- lock(this)
- {
- // If the entry doesn't have a expires time we assume that the entry is due to expire now.
- if (objEntry.Expires == 0)
- {
- objEntry.Expires = ticksNow;
- }
-
- _arrBuckets[GetHashBucket(objEntry.Expires)].Remove(objEntry);
- }
- }
-
- public void Update(CacheEntry objEntry, long ticksExpires)
- {
- long ticksNow = System.DateTime.Now.Ticks;
-
- lock(this)
- {
- // If the entry doesn't have a expires time we assume that the entry is due to expire now.
- if (objEntry.Expires == 0)
- {
- objEntry.Expires = ticksNow;
- }
-
- _arrBuckets[GetHashBucket(objEntry.Expires)].Update(objEntry, ticksExpires);
- }
- }
-
- public void GarbageCleanup(object State)
- {
- ExpiresBucket objBucket;
-
- lock(this)
- {
- // Do cleanup of the bucket
- objBucket = _arrBuckets[(++_intFlush) % 60];
- }
-
- // Flush expired items in the current bucket (defined by _intFlush)
- objBucket.FlushExpiredItems();
- }
-
- private int GetHashBucket(long ticks)
- {
- // Get bucket to add expire item into, add one minute to the bucket just to make sure that we get it in the bucket gc
- return (int) (((((ticks + 60000) % _ticksPerCycle) / _ticksPerBucket) + 1) % 60);
- }
-
- /// <summary>
- /// Called by the cache for cleanup.
- /// </summary>
- public void Dispose()
- {
- lock(this)
- {
- // Cleanup the internal timer
- if (_objTimer != null)
- {
- _objTimer.Dispose();
- _objTimer = null;
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Caching/ChangeLog b/mcs/class/System.Web/System.Web.Caching/ChangeLog
deleted file mode 100644
index 8e43362c21d..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/ChangeLog
+++ /dev/null
@@ -1,17 +0,0 @@
-2002-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * CacheDependency.cs: fixed a couple of typos and don't throw
- NotImplementedException in constructors.
-
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * CacheDependency.cs: Some unimplemented methods to make build
-
-2001-07-20 Patrik Torstensson (Patrik.Torstensson@labs2.com)
-
- * Cache.cs: Implemented. (90% ready)
- * CacheDefinitions.cs: Implemented.
- * CacheDependency.cs: Added. (20% ready)
- * CacheExpires: Implemented.
- * CacheEntry.cs: Implemented. (95% ready, going to be changed due to CacheDependecy support)
- * ExpiresBuckets.cs: Implemented.
diff --git a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs b/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
deleted file mode 100644
index b5b877d455d..00000000000
--- a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs
+++ /dev/null
@@ -1,253 +0,0 @@
-//
-// System.Web.Caching
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-// (C) Copyright Patrik Torstensson, 2001
-//
-namespace System.Web.Caching
-{
- /// <summary>
- /// Responsible for holding a cache entry in the linked list bucket.
- /// </summary>
- public struct ExpiresEntry
- {
- public CacheEntry _objEntry;
- public long _ticksExpires;
- public int _intNext;
- }
-
- /// <summary>
- /// Holds cache entries that has a expiration in a bucket list.
- /// </summary>
- public class ExpiresBucket
- {
- private static int MIN_ENTRIES = 16;
-
- private byte _byteID;
- private int _intSize;
- private int _intCount;
- private int _intNext;
-
- private Cache _objManager;
-
- private ExpiresEntry [] _arrEntries;
-
- /// <summary>
- /// Constructs a new bucket.
- /// </summary>
- /// <param name="bucket">Current bucket ID.</param>
- /// <param name="objManager">Cache manager reponsible for the item(s) in the expires bucket.</param>
- public ExpiresBucket(byte bucket, Cache objManager)
- {
- _objManager = objManager;
- Initialize(bucket);
- }
-
- /// <summary>
- /// Initializes the expires bucket, creates a linked list of MIN_ENTRIES.
- /// </summary>
- /// <param name="bucket">Bucket ID.</param>
- private void Initialize(byte bucket)
- {
- _byteID = bucket;
- _intNext = 0;
- _intCount = 0;
-
- _arrEntries = new ExpiresEntry[MIN_ENTRIES];
- _intSize = MIN_ENTRIES;
-
- int intPos = 0;
- do
- {
- _arrEntries[intPos]._intNext = intPos + 1;
- _arrEntries[intPos]._ticksExpires = System.DateTime.MaxValue.Ticks;
-
- intPos++;
- } while (intPos < _intSize);
-
- _arrEntries[_intSize - 1]._intNext = -1;
- }
-
- /// <summary>
- /// Expands the bucket linked array list.
- /// </summary>
- private void Expand()
- {
- ExpiresEntry [] arrData;
- int intPos = 0;
- int intOldSize;
-
- lock(this)
- {
- intOldSize = _intSize;
- _intSize *= 2;
-
- // Create a new array and copy the old data into the new array
- arrData = new ExpiresEntry[_intSize];
- do
- {
- arrData[intPos] = _arrEntries[intPos];
- intPos++;
- } while (intPos < intOldSize);
-
- _intNext = intPos;
-
- // Initialize the "new" positions.
- do
- {
- arrData[intPos]._intNext = intPos + 1;
- intPos++;
- } while (intPos < _intSize);
-
- arrData[_intSize - 1]._intNext = -1;
-
- _arrEntries = arrData;
- }
- }
-
- /// <summary>
- /// Adds a cache entry into the expires bucket.
- /// </summary>
- /// <param name="objEntry">Cache Entry object to be added.</param>
- public void Add(CacheEntry objEntry)
- {
- if (_intNext == -1)
- {
- Expand();
- }
-
- lock(this)
- {
- _arrEntries[_intNext]._ticksExpires = objEntry.Expires;
- _arrEntries[_intNext]._objEntry = objEntry;
-
- _intNext = _arrEntries[_intNext]._intNext;
-
- _intCount++;
- }
- }
-
- /// <summary>
- /// Removes a cache entry from the expires bucket.
- /// </summary>
- /// <param name="objEntry">Cache entry to be removed.</param>
- public void Remove(CacheEntry objEntry)
- {
- lock(this)
- {
- // Check if this is our bucket
- if (objEntry.ExpiresIndex != _byteID) return;
- if (objEntry.ExpiresIndex == System.Int32.MaxValue) return;
- if (_arrEntries.Length < objEntry.ExpiresIndex) return;
-
- _intCount--;
-
- _arrEntries[objEntry.ExpiresIndex]._objEntry.ExpiresBucket = byte.MaxValue;
- _arrEntries[objEntry.ExpiresIndex]._objEntry.ExpiresIndex = int.MaxValue;
- _arrEntries[objEntry.ExpiresIndex]._objEntry = null;
- _intNext = _arrEntries[objEntry.ExpiresIndex]._intNext;
- }
- }
-
- /// <summary>
- /// Updates a cache entry in the expires bucket, this is called during a hit of an item if the
- /// cache item has a sliding expiration. The function is responsible for updating the cache
- /// entry.
- /// </summary>
- /// <param name="objEntry">Cache entry to update.</param>
- /// <param name="ticksExpires">New expiration value for the cache entry.</param>
- public void Update(CacheEntry objEntry, long ticksExpires)
- {
- lock(this)
- {
- // Check if this is our bucket
- if (objEntry.ExpiresIndex != _byteID) return;
- if (objEntry.ExpiresIndex == System.Int32.MaxValue) return;
- if (_arrEntries.Length < objEntry.ExpiresIndex) return;
-
- _arrEntries[objEntry.ExpiresIndex]._ticksExpires = ticksExpires;
- _arrEntries[objEntry.ExpiresIndex]._objEntry.Expires = ticksExpires;
- }
- }
-
- /// <summary>
- /// Flushes all cache entries that has expired and removes them from the cache manager.
- /// </summary>
- public void FlushExpiredItems()
- {
- ExpiresEntry objEntry;
- CacheEntry [] arrCacheEntries;
-
- int intCachePos;
- int intPos;
- long ticksNow;
-
- ticksNow = System.DateTime.Now.Ticks;
-
- intCachePos = 0;
-
- // Lookup all items that needs to be removed, this is done in a two part
- // operation to minimize the locking time.
- lock (this)
- {
- arrCacheEntries = new CacheEntry[_intSize];
-
- intPos = 0;
- do
- {
- objEntry = _arrEntries[intPos];
- if (objEntry._objEntry != null)
- {
- if (objEntry._ticksExpires < ticksNow)
- {
- arrCacheEntries[intCachePos++] = objEntry._objEntry;
-
- objEntry._objEntry.ExpiresBucket = byte.MaxValue;
- objEntry._objEntry.ExpiresIndex = int.MaxValue;
- objEntry._objEntry = null;
- _intNext = objEntry._intNext;
- }
- }
-
- intPos++;
- } while (intPos < _intSize);
- }
-
- // If we have any entries to remove, go ahead and call the cache manager remove.
- if (intCachePos > 0)
- {
- intPos = 0;
- do
- {
- _objManager.Remove(arrCacheEntries[intPos].Key, CacheItemRemovedReason.Expired);
-
- intPos++;
- } while (intPos < intCachePos);
- }
- }
-
- /// <summary>
- /// Returns the current size of the expires bucket.
- /// </summary>
- public int Size
- {
- get
- {
- return _arrEntries.Length;
- }
- }
-
- /// <summary>
- /// Returns number of items in the bucket.
- /// </summary>
- public int Count
- {
- get
- {
- return _intCount;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs b/mcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs
deleted file mode 100755
index 1bc1d9e9a36..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/AuthenticationMode.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-
-namespace System.Web.Configuration {
-
- /// <summary>
- /// Defines the AuthenticationMode for a Web Application.
- /// </summary>
- public enum AuthenticationMode{
- Forms,
- None,
- Passport,
- Windows
- }
-
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Configuration/ChangeLog b/mcs/class/System.Web/System.Web.Configuration/ChangeLog
deleted file mode 100644
index 3e79ab6bb8e..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Web.Configuration/HttpCapabilitiesBase.cs: New file.
-
diff --git a/mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs b/mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs
deleted file mode 100644
index d30affc8f2d..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/ClientTargetSectionHandler.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-using System;
-using System.Configuration;
-
-namespace System.Web.Configuration
-{
- /// <summary>
- /// Summary description for ClientTargetSectionHandler.
- /// </summary>
- public class ClientTargetSectionHandler: NameValueSectionHandler
- {
- /// <summary>
- /// ClientTargetSectionHandler Constructor
- /// </summary>
- public ClientTargetSectionHandler(){}
-
- /// <summary>
- /// Gets the name of the key in the key-value pair.
- /// </summary>
- protected override string KeyAttributeName
- {
- get
- {
- return "alias";
- }
- }
-
- /// <summary>
- /// Gets the value for the key in the key-value pair.
- /// </summary>
- protected override string ValueAttributeName
- {
- get
- {
- return "userAgent";
- }
- }
-
- }
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs b/mcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs
deleted file mode 100755
index ff416bc6ebc..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/FormsAuthPasswordFormat.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-
-namespace System.Web.Configuration {
-
- /// <summary>
- /// Defines the password encryption format.
- /// </summary>
- public enum FormsAuthPasswordFormat{
- Clear,
- MD5,
- SHA1
- }
-
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs b/mcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs
deleted file mode 100755
index e94950e067e..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/FormsProtectionEnum.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-/* System.Web.Configuration
- * Authors:
- * Leen Toelen (toelen@hotmail.com)
- * Copyright (C) 2001 Leen Toelen
-*/
-
-namespace System.Web.Configuration {
-
- /// <summary>
- /// Defines the method used for securing web forms.
- /// </summary>
- public enum FormsProtectionEnum{
- All,
- Encryption,
- None,
- Validation
- }
-
-} //namespace System.Web.Configuration
diff --git a/mcs/class/System.Web/System.Web.Configuration/HttpCapabilitiesBase.cs b/mcs/class/System.Web/System.Web.Configuration/HttpCapabilitiesBase.cs
deleted file mode 100644
index c328d0f300c..00000000000
--- a/mcs/class/System.Web/System.Web.Configuration/HttpCapabilitiesBase.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Web.Configuration.HttpCapabilitiesBase
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Web.Configuration {
- using System;
- using System.Collections;
- using System.Web;
-
-public class HttpCapabilitiesBase
-{
- protected Hashtable _capabilities;
-
- public HttpCapabilitiesBase ()
- {
- _capabilities = new Hashtable ();
- }
-
- public virtual string this [string key]
- {
- get { return _capabilities [key] as string; }
- }
-
- public static HttpCapabilitiesBase GetConfigCapabilities (string configKey, HttpRequest request)
- {
- throw new NotImplementedException ();
- }
-
-}
-}
-
diff --git a/mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs b/mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs
deleted file mode 100644
index 7cf5b14a9c1..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/AppDomainFactory.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.Hosting.AppDomainFactory.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public sealed class AppDomainFactory : IAppDomainFactory
- {
- public AppDomainFactory();
- public object Create(string module, string typeName, string appId, string appPath, string strUrlOfAppOrigin, int iZone);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs b/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
deleted file mode 100644
index c447a3658e1..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Web.Hosting.ApplicationHost
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-// (class signature from Bob Smith <bob@thestuff.net> (C) )
-//
-
-using System;
-using System.Runtime.Remoting;
-
-namespace System.Web.Hosting {
- public sealed class ApplicationHost {
- [MonoTODO("object CreateApplicationHost() Implement (dummy implementation right now)")]
- public static object CreateApplicationHost(Type HostType, string VirtualPath, string PhysicalPath) {
- // Construct and own AppDomain via DomainFactory? Can be good to have control over the web appdomain
- // Dummy impl: just return a init object..
-
- // TODO: Save in the created app domain....
- System.Threading.Thread.GetDomain().SetData(".ASP.Net.App.VirtualPath", VirtualPath);
- System.Threading.Thread.GetDomain().SetData(".ASP.Net.App.Path", PhysicalPath);
-
- // TODO: Set to the install path of the runtime engine....
- System.Threading.Thread.GetDomain().SetData(".ASP.Net.App.InstallPath", "");
-
- // TODO: Create a name and id for the application...
- // TODO: Copy all of the domain info to our new domain
-
- ObjectHandle obj = System.Threading.Thread.GetDomain().CreateInstance(HostType.Module.Assembly.FullName, HostType.FullName);
- return obj.Unwrap();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/ChangeLog b/mcs/class/System.Web/System.Web.Hosting/ChangeLog
deleted file mode 100644
index 31f38df52c3..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2002-04-10 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * ApplicationHost.cs: Test implementation to support testing.
- * SimpleWorkerRequest.cs: Rewrite and a almost full implementation.
-
-2001-08-30 Bob Smith <bob@thestuff.net>
-
- * AppDomainFactory.cs: Stubbed.
- * ApplicationHost.cs: Stubbed.
- * IAppDomainFactory.cs: Stubbed.
- * IISAPIRuntime.cs: Stubbed.
- * ISAPIRuntime.cs: Implemented.
- * SimpleWorkerRequest.cs: Implemented.
diff --git a/mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs b/mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs
deleted file mode 100644
index 1317ccc6c54..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/IAppDomainFactory.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.Hosting.IAppDomainFactory.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public interface IAppDomainFactory
- {
- object Create(in string module, in string typeName, in string appId, in string appPath, in string strUrlOfAppOrigin, in int iZone);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs b/mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs
deleted file mode 100644
index bad6cc4ef80..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/IISAPIRuntime.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Web.Hosting.IISAPIRuntime.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public interface IISAPIRuntime
- {
- void DoGCCollect();
- int ProcessRequest(in IntPtr ecb, in int useProcessModel);
- void StartProcessing();
- void StopProcessing();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs b/mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs
deleted file mode 100644
index c419344ad25..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/ISAPIRuntime.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.Hosting.ISAPIRuntime.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-
-namespace System.Web.Hosting
-{
- public sealed class ISAPIRuntime : IISAPIRuntime
- {
- public ISAPIRuntime();
- public void DoGCCollect();
- public int ProcessRequest(IntPtr ecb, int iWRType);
- public void StartProcessing();
- public void StopProcessing();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs
deleted file mode 100644
index 7793e189eef..00000000000
--- a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// System.Web.Hosting
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-// (class signature from Bob Smith <bob@thestuff.net> (C) )
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Web.Hosting {
- [MonoTODO("Implement security demands on the path usage functions (and review)")]
- public class SimpleWorkerRequest : HttpWorkerRequest {
- private string _Page;
- private string _Query;
- private string _PathInfo;
- private string _AppVirtualPath;
- private string _AppPhysicalPath;
- private string _AppInstallPath;
- private TextWriter _Output;
- private bool _HasInstallInfo;
-
- private SimpleWorkerRequest() {
- }
-
- public SimpleWorkerRequest(string Page, string Query, TextWriter Output) {
- _Page = Page;
- _Query = Query;
-
- _AppVirtualPath = System.Threading.Thread.GetDomain().GetData(".ASP.Net.App.VirtualPath").ToString();
- _AppInstallPath = AppDomain.CurrentDomain.GetData(".ASP.Net.App.InstallPath").ToString();
- _AppPhysicalPath = CheckAndAddSlash(AppDomain.CurrentDomain.GetData(".ASP.Net.App.Path").ToString());
-
- _Output = Output;
-
- if (_AppPhysicalPath == null) {
- // needs to be in a initialized app domain
- throw new HttpException("Invalid app domain");
- }
-
- _HasInstallInfo = true;
- }
-
- public SimpleWorkerRequest(string AppVirtualPath, string AppPhysicalPath, string Page, string Query, TextWriter Output) {
- if (AppDomain.CurrentDomain.GetData(".ASP.Net.App.Path") == null) {
- // needs to be in a initialized app domain
- throw new HttpException("Invalid app domain");
- }
-
- _Page = Page;
- _Query = Query;
- _AppVirtualPath = AppVirtualPath;
- _AppPhysicalPath = CheckAndAddSlash(AppPhysicalPath);
- _Output = Output;
-
- _HasInstallInfo = true;
- }
-
- [MonoTODO("Implement security")]
- public override string MachineInstallDirectory {
- get {
- if (_HasInstallInfo) {
- return _AppInstallPath;
- }
-
- return null;
- }
- }
-
- [MonoTODO("Get config path from Web.Config class")]
- public override string MachineConfigPath {
- get {
- return MachineConfigPath;
- }
- }
-
- public override void EndOfRequest() {
- }
-
- public override void FlushResponse(bool finalFlush) {
- _Output.Flush();
- }
-
- public override string GetAppPath() {
- return _AppVirtualPath;
- }
-
- [MonoTODO("Implement security")]
- public override string GetAppPathTranslated() {
- return _AppPhysicalPath;
- }
-
- public override string GetFilePath() {
- return CreatePath(false);
- }
-
- [MonoTODO("Implement security")]
- public override string GetFilePathTranslated() {
- return _AppPhysicalPath + _Page.Replace('/', '\\');
- }
-
- public override string GetHttpVerbName() {
- return "GET";
- }
-
- public override string GetHttpVersion() {
- return "HTTP/1.0";
- }
-
- public override string GetLocalAddress() {
- return "127.0.0.1";
- }
-
- public override int GetLocalPort() {
- return 80;
- }
-
- [MonoTODO("Implement security")]
- public override string GetPathInfo() {
- if (null != _PathInfo) {
- return _PathInfo;
- }
-
- return System.String.Empty;
- }
-
- public override string GetQueryString() {
- return _Query;
- }
-
- public override string GetRawUrl() {
- if (null != _Query && _Query.Length > 0) {
- return CreatePath(true) + "?" + _Query;
- }
-
- return CreatePath(true);
- }
-
- public override string GetRemoteAddress() {
- return "127.0.0.1";
- }
-
- public override int GetRemotePort() {
- return 0;
- }
-
- public override string GetServerVariable(string name) {
- return System.String.Empty;
- }
-
- public override string GetUriPath() {
- return CreatePath(true);
- }
-
- public override IntPtr GetUserToken() {
- return System.IntPtr.Zero;
- }
-
- public override string MapPath(string path) {
- string sPath = _AppPhysicalPath.Substring(0, _AppPhysicalPath.Length - 1);
- if (path != null && path.Length > 0 && path != "/") {
- return sPath;
- }
-
- if (path.StartsWith(_AppVirtualPath)) {
- return sPath + path.Substring(_AppVirtualPath.Length).Replace('/', '\\');
- }
-
- return null;
- }
-
- public override void SendKnownResponseHeader(int index, string value) {
- }
-
- public override void SendResponseFromFile(IntPtr handle, long offset, long length) {
- }
-
- public override void SendResponseFromFile(string filename, long offset, long length) {
- }
-
- public override void SendResponseFromMemory(byte[] data, int length) {
- _Output.Write(Encoding.Default.GetChars(data, 0, length));
- }
-
- public override void SendStatus(int statusCode, string statusDescription) {
- }
-
- public override void SendUnknownResponseHeader(string name, string value) {
- }
-
- // Create's a path string
- private string CheckAndAddSlash(string sPath) {
- if (null == sPath) {
- return null;
- }
-
- if (!sPath.EndsWith("\\")) {
- return sPath + "\\";
- }
-
- return sPath;
- }
-
- // Create's a path string
- private string CreatePath(bool bIncludePathInfo) {
- string sPath;
-
- if ("/" == _AppVirtualPath) {
- sPath = _AppVirtualPath + "/" + _Page;
- } else {
- sPath = "/" + _Page;
- }
-
- if (bIncludePathInfo && null != _PathInfo) {
- return sPath + _PathInfo;
- }
-
- return sPath;
- }
-
- // Parses out the string after / know as the "path info"
- private void ParsePathInfo() {
- int iPos = _Page.IndexOf("/");
- if (iPos >= 0) {
- _PathInfo = _Page.Substring(iPos);
- _Page = _Page.Substring(0, iPos);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Mail/ChangeLog b/mcs/class/System.Web/System.Web.Mail/ChangeLog
deleted file mode 100644
index 22aa7695cac..00000000000
--- a/mcs/class/System.Web/System.Web.Mail/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2002-04-26 Lawrence Pit <loz@cable.a2000.nl>
-
- * MailAttachment.cs: Implemented
- * MailEncoding.cs: Implemented
- * MailFormat.cs: Implemented
- * MailMessage.cs: Implemented
- * MailPriority.cs: Implemented
- * SmtpMail.cs: Stubbed
diff --git a/mcs/class/System.Web/System.Web.Mail/MailAttachment.cs b/mcs/class/System.Web/System.Web.Mail/MailAttachment.cs
deleted file mode 100644
index b0f5dfcc3a7..00000000000
--- a/mcs/class/System.Web/System.Web.Mail/MailAttachment.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Web.Mail.MailAttachment.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-namespace System.Web.Mail
-{
- public class MailAttachment
- {
- private string filename;
- private MailEncoding encoding;
-
- public MailAttachment (string filename) :
- this (filename, MailEncoding.Base64)
- {
- }
-
- public MailAttachment (string filename, MailEncoding encoding)
- {
- this.filename = filename;
- this.encoding = encoding;
- try {
- System.IO.File.OpenRead (filename).Close ();
- } catch (Exception) {
- throw new System.Web.HttpException ("Cannot find file: " + filename);
- }
- }
-
- // Properties
- public string Filename
- {
- get { return filename; }
- }
-
- public MailEncoding Encoding
- {
- get { return encoding; }
- }
-
- }
-
-} //namespace System.Web.Mail
diff --git a/mcs/class/System.Web/System.Web.Mail/MailEncoding.cs b/mcs/class/System.Web/System.Web.Mail/MailEncoding.cs
deleted file mode 100644
index 16b1b341a91..00000000000
--- a/mcs/class/System.Web/System.Web.Mail/MailEncoding.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Web.Mail.MailEncoding.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-namespace System.Web.Mail
-{
-
- /// <summary>
- /// </summary>
- public enum MailEncoding
- {
-
- /// <summary>
- /// </summary>
- UUEncode = 0,
-
- /// <summary>
- /// </summary>
- Base64 = 1
-
- }
-
-} //namespace System.Web.Mail
diff --git a/mcs/class/System.Web/System.Web.Mail/MailFormat.cs b/mcs/class/System.Web/System.Web.Mail/MailFormat.cs
deleted file mode 100644
index e1050d78549..00000000000
--- a/mcs/class/System.Web/System.Web.Mail/MailFormat.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Web.Mail.MailFormat.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-namespace System.Web.Mail
-{
-
- /// <summary>
- /// </summary>
- public enum MailFormat
- {
-
- /// <summary>
- /// </summary>
- Text = 0,
-
- /// <summary>
- /// </summary>
- Html = 1
-
- }
-
-} //namespace System.Web.Mail
diff --git a/mcs/class/System.Web/System.Web.Mail/MailMessage.cs b/mcs/class/System.Web/System.Web.Mail/MailMessage.cs
deleted file mode 100644
index 11d85b9c04c..00000000000
--- a/mcs/class/System.Web/System.Web.Mail/MailMessage.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// System.Web.Mail.MailMessage.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-
-namespace System.Web.Mail
-{
- /// <remarks>
- /// </remarks>
- public class MailMessage
- {
- private ArrayList attachments;
- private string bcc;
- private string body;
- private Encoding bodyEncoding;
- private MailFormat bodyFormat;
- private string cc;
- private string from;
- private ListDictionary headers;
- private MailPriority priority;
- private string subject;
- private string to;
- private string urlContentBase;
- private string urlContentLocation;
-
- // Constructor
- public MailMessage ()
- {
- attachments = new ArrayList (8);
- headers = new ListDictionary ();
- }
-
- // Properties
- public IList Attachments {
- get { return (IList) attachments; }
- }
-
- public string Bcc {
- get { return bcc; }
- set { bcc = value; }
- }
-
- public string Body {
- get { return body; }
- set { body = value; }
- }
-
- public Encoding BodyEncoding {
- get { return bodyEncoding; }
- set { bodyEncoding = value; }
- }
-
- public MailFormat BodyFormat {
- get { return bodyFormat; }
- set { bodyFormat = value; }
- }
-
- public string Cc {
- get { return cc; }
- set { cc = value; }
- }
-
- public string From {
- get { return from; }
- set { from = value; }
- }
-
- public IDictionary Headers {
- get { return (IDictionary) headers; }
- }
-
- public MailPriority Priority {
- get { return priority; }
- set { priority = value; }
- }
-
- public string Subject {
- get { return subject; }
- set { subject = value; }
- }
-
- public string To {
- get { return to; }
- set { to = value; }
- }
-
- public string UrlContentBase {
- get { return urlContentBase; }
- set { urlContentBase = value; }
- }
-
- public string UrlContentLocation {
- get { return urlContentLocation; }
- set { urlContentLocation = value; }
- }
-
- }
-
-} //namespace System.Web.Mail
diff --git a/mcs/class/System.Web/System.Web.Mail/MailPriority.cs b/mcs/class/System.Web/System.Web.Mail/MailPriority.cs
deleted file mode 100644
index 6b6c638edf2..00000000000
--- a/mcs/class/System.Web/System.Web.Mail/MailPriority.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Web.Mail.MailPriority.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-namespace System.Web.Mail
-{
-
- /// <summary>
- /// </summary>
- public enum MailPriority
- {
-
- /// <summary>
- /// </summary>
- Normal = 0,
-
- /// <summary>
- /// </summary>
- Low = 1,
-
- /// <summary>
- /// </summary>
- High = 2
-
- }
-
-} //namespace System.Web.Mail
diff --git a/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs b/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs
deleted file mode 100644
index 9884191f171..00000000000
--- a/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.Web.Mail.SmtpMail.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-//
-
-using System;
-using System.Net;
-using System.Reflection;
-
-namespace System.Web.Mail
-{
- /// <remarks>
- /// </remarks>
- public class SmtpMail
- {
- private static string smtpServer;
-
- // Constructor
- private SmtpMail ()
- {
- /* empty */
- }
-
- // Properties
- public static string SmtpServer {
- get { return smtpServer; }
- set { smtpServer = value; }
- }
-
- [MonoTODO]
- public static void Send (MailMessage message)
- {
- // delegate work to loosly coupled component Mono.Mail
-
- // Mono.Mail.Smtp.SmtpSender.Send (smtpServer, message);
-
- // NOTE: Mono.Mail is work in progress, and could be replaced by
- // another component. For now:
-
- throw new NotImplementedException("Mono.Mail component is work in progress");
-
- try {
- // TODO: possibly cache ctor info object..
- Type stype = Type.GetType ("Mono.Mail.Smtp.SmtpSender");
- if (stype == null) {
- throw new Exception ("You must have Mono.Mail installed to send mail.");
- }
- Type[] types = new Type[2];
- types[0] = typeof (string);
- types[1] = message.GetType ();
- ConstructorInfo cinfo =
- stype.GetConstructor(BindingFlags.Instance | BindingFlags.Public, null,
- CallingConventions.HasThis, types, null);
- cinfo.Invoke (new object[] {smtpServer, message});
- } catch (Exception) {
- throw new Exception ("Unable to call Mono.Mail.Smtp.SmtpSender");
- }
- }
-
- public static void Send (string from, string to, string subject, string messageText)
- {
- MailMessage message = new MailMessage ();
- message.From = from;
- message.To = to;
- message.Subject = subject;
- message.Body = messageText;
- Send (message);
- }
-
- }
-
-} //namespace System.Web.Mail
diff --git a/mcs/class/System.Web/System.Web.Security/ChangeLog b/mcs/class/System.Web/System.Web.Security/ChangeLog
deleted file mode 100644
index 1aaf169afc7..00000000000
--- a/mcs/class/System.Web/System.Web.Security/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * DefaultAuthenticationEventArgs.cs: added file.
-
diff --git a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventArgs.cs b/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventArgs.cs
deleted file mode 100644
index 2031b829d9d..00000000000
--- a/mcs/class/System.Web/System.Web.Security/DefaultAuthenticationEventArgs.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Web.Security.DefaultAuthenticationEventArgs
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Web.Security {
- using System;
- using System.Web;
-
-public sealed class DefaultAuthenticationEventArgs : EventArgs
-{
- private HttpContext _context;
-
- public DefaultAuthenticationEventArgs (HttpContext context)
- {
- if (context == null)
- throw new ArgumentNullException ("context");
-
- _context = context;
- }
-
- public HttpContext Context
- {
- get { return _context; }
- }
-}
-}
-
diff --git a/mcs/class/System.Web/System.Web.SessionState/ChangeLog b/mcs/class/System.Web/System.Web.SessionState/ChangeLog
deleted file mode 100644
index 199a6ddd407..00000000000
--- a/mcs/class/System.Web/System.Web.SessionState/ChangeLog
+++ /dev/null
@@ -1,17 +0,0 @@
-2002-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpSessionState.cs: implemented more methods/properties.
- * SessionDictionary.cs: New file.
-
-2002-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Web.SessionState/HttpSessionState.cs:
- * System.Web.SessionState/SessionStateModule.cs: new files with some
- implementation and the rest stubbed.
-
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IReadOnlySessionState.cs:
- * IRequiresSessionState.cs:
- * SessionStateMode.cs: new files.
-
diff --git a/mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs b/mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs
deleted file mode 100644
index 83ca50e4094..00000000000
--- a/mcs/class/System.Web/System.Web.SessionState/HttpSessionState.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// System.Web.SessionState.HttpSessionState
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Threading;
-
-namespace System.Web.SessionState {
-public sealed class HttpSessionState : ICollection, IEnumerable
-{
- private NameValueCollection _state; //FIXME: it should be a ManagementNamedValueCollection
- private string _id;
- private SessionDictionary _dict;
- private HttpStaticObjectsCollection _staticObjects;
- private int _timeout;
- private bool _newSession;
- private bool _isCookieless;
- private SessionStateMode _mode;
- private bool _isReadonly;
- private bool _abandoned;
-
- internal HttpSessionState (string id,
- SessionDictionary dict,
- HttpStaticObjectsCollection staticObjects,
- int timeout,
- bool newSession,
- bool isCookieless,
- SessionStateMode mode,
- bool isReadonly)
- {
- _id = id;
- _dict = dict;
- _staticObjects = staticObjects;
- _timeout = timeout;
- _newSession = newSession;
- _isCookieless = isCookieless;
- _mode = mode;
- _isReadonly = isReadonly;
- }
-
- // Compatibility with ASP
- public int CodePage
- {
- get { return 0; }
- }
-
- public HttpSessionState Contents
- {
- get { return this; }
- }
-
- public int Count
- {
- get { return _state.Count; }
- }
-
- public bool IsAbandoned
- {
- get { return _abandoned; }
- }
-
- public bool IsCookieless
- {
- get { return _isCookieless; }
- }
-
- public bool IsNewSession
- {
- get { return _newSession; }
- }
-
- public bool IsReadOnly
- {
- get { return _isReadonly; }
- }
-
- public bool IsSynchronized
- {
- get { return false; }
- }
-
- public object this [string key]
- {
- get { return _state [key]; }
- set { _state [key] = (string) value; }
- }
-
- public object this [int index]
- {
- get { return _state [index]; }
- set {
- string key = _state.Keys [index];
- _state [key] = (string) value;
- }
- }
-
- public NameObjectCollectionBase.KeysCollection Keys
- {
- get { return _state.Keys; }
- }
-
- public int LCID
- {
- get { return Thread.CurrentThread.CurrentCulture.LCID; }
- set { Thread.CurrentThread.CurrentCulture = new CultureInfo(value); }
- }
-
- public SessionStateMode Mode
- {
- get { return _mode; }
- }
-
- public string SessionID
- {
- get { return _id; }
- }
-
- public HttpStaticObjectsCollection StaticObjects
- {
- get { return _staticObjects; }
- }
-
- public object SyncRoot
- {
- get { return this; }
- }
-
- public int Timeout
- {
- get { return _timeout; }
- set { _timeout = value; }
- }
-
- public void Abandon ()
- {
- _abandoned = true;
- }
-
- public void Add (string name, object value)
- {
- if (_state == null)
- _state = new NameValueCollection ();
-
- _state.Add (name, (string) value);
- }
-
- public void Clear ()
- {
- if (_state != null)
- _state.Clear ();
- }
-
- public void CopyTo (Array array, int index)
- {
- if (_state == null)
- _state = new NameValueCollection ();
-
- _state.CopyTo (array, index);
- }
-
- public IEnumerator GetEnumerator ()
- {
- if (_state == null)
- _state = new NameValueCollection ();
-
- return _state.GetEnumerator ();
- }
-
- public void Remove (string name)
- {
- if (_state != null)
- _state.Remove (name);
- }
-
- public void RemoveAll ()
- {
- if (_state != null)
- foreach (string key in _state.AllKeys)
- _state.Remove (key);
- }
-
- [MonoTODO("Implement ManagementNameValueCollection")]
- public void RemoveAt (int index)
- {
- throw new NotImplementedException ();
- //if (_state != null)
- // _state.RemoveAt (index);
- }
-}
-}
-
diff --git a/mcs/class/System.Web/System.Web.SessionState/IReadOnlySessionState.cs b/mcs/class/System.Web/System.Web.SessionState/IReadOnlySessionState.cs
deleted file mode 100644
index d9eb664a484..00000000000
--- a/mcs/class/System.Web/System.Web.SessionState/IReadOnlySessionState.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Web.SessionState.IReadOnlySessionState
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Web.SessionState {
-public interface IReadOnlySessionState : IRequiresSessionState
-{
-}
-}
-
diff --git a/mcs/class/System.Web/System.Web.SessionState/IRequiresSessionState.cs b/mcs/class/System.Web/System.Web.SessionState/IRequiresSessionState.cs
deleted file mode 100644
index dd9a40b732b..00000000000
--- a/mcs/class/System.Web/System.Web.SessionState/IRequiresSessionState.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Web.SessionState.IRequiresSessionState
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Web.SessionState {
-public interface IRequiresSessionState
-{
-}
-}
-
diff --git a/mcs/class/System.Web/System.Web.SessionState/SessionDictionary.cs b/mcs/class/System.Web/System.Web.SessionState/SessionDictionary.cs
deleted file mode 100644
index 8689d001da9..00000000000
--- a/mcs/class/System.Web/System.Web.SessionState/SessionDictionary.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// System.Web.SessionState.SessionDictionary
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-using System;
-using System.IO;
-using System.Collections.Specialized;
-
-namespace System.Web.SessionState {
-internal class SessionDictionary : NameObjectCollectionBase
-{
- private bool _dirty;
-
- static SessionDictionary ()
- {
- }
-
- public SessionDictionary ()
- {
- }
-
- void Clear ()
- {
- _dirty = true;
- BaseClear ();
- }
-
- [MonoTODO]
- static SessionDictionary Deserialize (BinaryReader r)
- {
- throw new NotImplementedException ();
- }
-
- public string GetKey (int index)
- {
- return BaseGetKey (index);
- }
-
- [MonoTODO]
- static bool IsInmutable (object o)
- {
- throw new NotImplementedException ();
- }
-
- void Remove (string s)
- {
- BaseRemove (s);
- _dirty = true;
- }
-
- void RemoveAt (int index)
- {
- BaseRemoveAt (index);
- _dirty = true;
- }
-
- [MonoTODO]
- void Serialize(BinaryWriter w)
- {
- throw new NotImplementedException ();
- }
-
- bool Dirty
- {
- get { return _dirty; }
- set { _dirty = value; }
- }
-
- object this [string s]
- {
- get { return BaseGet (s); }
- set {
- BaseSet (s, value);
- _dirty = true;
- }
- }
-
- object this [int index]
- {
- get { return BaseGet (index); }
- set {
- BaseSet (index, value);
- _dirty = true;
- }
- }
-}
-
-}
-
diff --git a/mcs/class/System.Web/System.Web.SessionState/SessionStateMode.cs b/mcs/class/System.Web/System.Web.SessionState/SessionStateMode.cs
deleted file mode 100644
index 1a5fcc290c3..00000000000
--- a/mcs/class/System.Web/System.Web.SessionState/SessionStateMode.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.SessionState.SessionStateMode
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Web.SessionState {
-public enum SessionStateMode
-{
- Off = 0,
- InProc = 1,
- StateServer = 2,
- SQLServer = 3
-}
-
-}
-
diff --git a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs b/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs
deleted file mode 100644
index da2654b5089..00000000000
--- a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Web.SessionState.SesionStateModule
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-using System.Web;
-
-namespace System.Web.SessionState {
-public sealed class SessionStateModule : IHttpModule
-{
- public SessionStateModule ()
- {
- }
-
- [MonoTODO()]
- public void Dispose ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO()]
- public void Init (HttpApplication app)
- {
- throw new NotImplementedException ();
- }
-}
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
deleted file mode 100644
index 08e580fe840..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
+++ /dev/null
@@ -1,136 +0,0 @@
-2002-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlForm.cs:
- (RenderChildren): use OnFormRender and OnFormPostRender.
-
-2002-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlSelect.cs:
- (RenderAttributes): new -> override and fixes stack overflow.
- (RenderChildren): only 1 option can be selected at any given time
- except when Multiple property is true.
- (Multiple): the attribute value is either "true" or "false", not
- "multiple".
-
- * HtmlTable.cs:
- (Add):
- (AddAt): allow HtmlTableRow as children, not HtmlTableCell.
-
- * HtmlTableCell.cs:
- (RenderEndTag): new -> override.
-
- * HtmlTableRow.cs:
- (RenderChildren): fixed another stack overflow.
- (RenderEndTag): new -> override.
-
- * HtmlTextArea.cs:
- (RenderAttributes): new -> override.
-
-
-2002-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlInputHidden.cs: fixed constructor.
-
- * HtmlInputRadioButton.cs:
- (RenderAttributes): fixed stack overflow.
-
- (Name):
- (RenderedName): new -> override.
-
- (Value): new property.
-
- * HtmlInputText.cs:
- (RenderAttributes): fixed the same kind of stack overflow and make
- string comparison case insensitive.
-
-2002-06-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlForm.cs: fixed name of Enctype property and render enctype
- enctype attribute.
-
- * HtmlInputControl.cs: tag type is "input", not "type".
-
-2002-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlControl.cs: Render contents moved to new RenderBeginTag method,
- defined in MS docs.
-
- * HtmlForm.cs: Render output when no IE browser.
-
- * HtmlInputButton.cs: added constructor without arguments. Xsp used it,
- though now it always use the other .ctor.
-
- * HtmlInputControl.cs: cosmetic changes and implemented set_Name.
-
-2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlButton.cs: RenderAttributes is an override, not new.
-
- * HtmlContainerControl.cs: use the new Render method in HtmlControl.
-
- * HtmlControl.cs: added Render method to render the tag and its
- attributes. Works for container and non-containers.
-
- * HtmlImage.cs: RenderAttributes don't need to be new. Implemented
- Height property.
-
-2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlContainerControl.cs: some formatting and use HttpUtility.Encode
- instead of Page.Server to encode InnerText.
-
-2002-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlAnchor.cs:
- (RenderAttributes): new -> override and fixed little bug that made
- it cause an stack overflow.
-
- * HtmlContainerControl.cs: reformatted and added tag and attributes
- rendering.
-
- * HtmlGenericControl.cs: removed TagName, which is already in
- HtmlControl.
-
- * HtmlTable.cs:
- (RenderEndTag): new -> override.
-
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Web.UI.HtmlControls/HtmlForm.cs:
- (RenderAttributes): changed new by override.
- (Name): allow setting the property.
-
-2002-05-10 Duncan Mak <duncan@ximian.com>
-
- * HtmlTableCellCollection.cs (this): Updated the indexer to return
- the right type, HtmlTableCell instead of HtmlTableRow.
-
- * HtmlInputImage.cs (OnServerClick): Commented out parts that
- won't compile.
-
- * HtmlForm.cs (RenderAttributes):
- (RenderChildren): Commented out code that doesn't compile.
-
-2002-05-07 Duncan Mak <duncan@ximian.com>
-
- * HtmlSelect.cs (TrackViewState): Added 'new' keyword to avoid
- clashing with the method defined in the parent class.
- (OnDataBinding): Added missing casts.
-
- * HtmlForm.cs (Render): Fixed call too SetAttribute, need to cast
- 'this' to IAttributeAccessor before calling interface method.
- Also renamed some calls to reflect changes in the API.
-
- * HtmlControl.cs (WriteOnClickAttribute): Made it not static and
- fixed a typo.
-
-2001-09-03 Leen Toelen <toelen@hotmail.com>
-
- * HtmlAnchor.cs: Initial implementation.
- * HtmlTextArea.cs: Initial implementation.
-
-2001-08-22 Bob Smith <bob@thestuff.net>
-
- * HtmlContainerControl.cs: Initial implementation.
- * HtmlControl.cs: Initial implementation.
- * HtmlGenericControl.cs: Initial implementation.
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
deleted file mode 100644
index f469b7ee1c2..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlAnchor : HtmlContainerControl, IPostBackEventHandler{
-
- private static readonly object EventServerClick;
-
- static HtmlAnchor(){
- EventServerClick = new Object();
- }
-
- public HtmlAnchor(): base("a"){}
-
- protected virtual void OnServerClick(EventArgs e){
- EventHandler handler;
- handler = (EventHandler) Events[EventServerClick];
- if(handler != null) handler.Invoke(this, e);
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- if ( Events[EventServerClick] != null){
- Attributes.Remove("href");
- base.RenderAttributes(writer);
- writer.WriteAttribute("href", Page.GetPostBackClientHyperlink(this,String.Empty));
- }
- else{
- PreProcessRelativeReference(writer,"href");
- base.RenderAttributes(writer);
- }
- }
-
- void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument){
- OnServerClick(EventArgs.Empty);
- }
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public string HRef{
- get{
- string attr = Attributes["href"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["href"] = AttributeToString(value);
- }
- }
-
- public string Name{
- get{
- string attr = Attributes["name"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["name"] = AttributeToString(value);
- }
- }
-
- public string Target{
- get{
- string attr = Attributes["target"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["target"] = AttributeToString(value);
- }
- }
-
- public string Title{
- get{
- string attr = Attributes["title"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["title"] = AttributeToString(value);
- }
- }
-
- } // class HtmlAnchor
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs
deleted file mode 100644
index b926ef0f184..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlButton : HtmlContainerControl, IPostBackEventHandler{
-
- private static readonly object EventServerClick;
-
- //Checked
- static HtmlButton(){
- EventServerClick = new Object();
- }
- //Checked
- public HtmlButton(): base("button"){}
-
- //Checked
- protected virtual void OnServerClick(EventArgs e){
- EventHandler handler;
- handler = (EventHandler) Events[EventServerClick];
- if(handler != null){
- handler.Invoke(this, e);
- }
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- if (Page != null && Events[EventServerClick] != null){
- /* Got to figure out how to manage events */
- }
- base.RenderAttributes(writer);
- }
-
- void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument){
- if (CausesValidation){
- Page.Validate();
- }
- OnServerClick(EventArgs.Empty);
- }
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public bool CausesValidation{
- get{
- object attr = ViewState["CausesValidation"];
- if (attr != null){
- return (Boolean) attr;
- }
- return true;
- }
- set{
- ViewState["CausesValidation"] = (Boolean) value;
- }
- }
-
- } // class HtmlButton
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
deleted file mode 100644
index 970a48aced9..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// System.Web.UI.HtmlControls.HtmlContainerControl.cs
-//
-// Author
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-//LAMESPEC: The dox talk about HttpException but are very ambigious.
-//TODO: Check to see if Render really is overridden instead of a LiteralControl being added. It apears that this is the
-//case due to testing. Anything inside the block is overwritten by the content of this control, so it doesnt apear
-//to do anything with children.
-// a doc references this. add? protected override ControlCollection CreateControlCollection();
-
-//TODO: If Test.InnerText = Test.InnerHtml without ever assigning anything into InnerHtml, you get this:
-// Exception Details: System.Web.HttpException: Cannot get inner content of Message because the contents are not literal.
-//[HttpException (0x80004005): Cannot get inner content of Message because the contents are not literal.]
-// System.Web.UI.HtmlControls.HtmlContainerControl.get_InnerHtml() +278
-// ASP.test3_aspx.AnchorBtn_Click(Object Source, EventArgs E) in \\genfs2\www24\bobsmith11\test3.aspx:6
-// System.Web.UI.HtmlControls.HtmlAnchor.OnServerClick(EventArgs e) +108
-// System.Web.UI.HtmlControls.HtmlAnchor.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +26
-// System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
-// System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +149
-// System.Web.UI.Page.ProcessRequestMain() +660
-
-
-namespace System.Web.UI.HtmlControls
-{
- public abstract class HtmlContainerControl : HtmlControl{
-
- private string _innerHtml = String.Empty;
- private string _innerText = String.Empty;
- private bool _doText = false;
- private bool _doChildren = true;
-
- public HtmlContainerControl() : base(){}
-
- public HtmlContainerControl(string tag) : base(tag) {}
-
- public virtual string InnerHtml
- {
- get { return _innerHtml; }
- set {
- _innerHtml = value;
- _doText = false;
- _doChildren = false;
- }
- }
-
- public virtual string InnerText
- {
- get { return _innerText; }
- set {
- _innerText = value;
- _doText = true;
- _doChildren = false;
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- base.Render (writer);
- if (_doChildren)
- RenderChildren(writer);
- else if (_doText)
- writer.Write (HttpUtility.HtmlEncode (_innerText));
- else
- writer.Write (_innerHtml);
-
- RenderEndTag (writer);
- }
-
- protected virtual void RenderEndTag (HtmlTextWriter writer)
- {
- writer.WriteEndTag (TagName);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs
deleted file mode 100644
index 4907fabd9fd..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// System.Web.UI.HtmlControls.HtmlControl.cs
-//
-// Author
-// Bob Smith <bob@thestuff.net>
-//
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public abstract class HtmlControl : Control, IAttributeAccessor
- {
- private string _tagName = "span";
- //TODO: Is this correct, or is the StateBag really the ViewState?
- private AttributeCollection _attributes = new AttributeCollection(new StateBag(true));
- private bool _disabled = false;
-
- public HtmlControl(){}
-
- public HtmlControl(string tag)
- {
- if(tag != null && tag != String.Empty) _tagName = tag;
- }
-
- internal static string AttributeToString(int n){
- if (n != -1)return n.ToString(NumberFormatInfo.InvariantInfo);
- return null;
- }
-
- internal static string AttributeToString(string s){
- if (s != null && s.Length != 0) return s;
- return null;
- }
-
- internal void PreProcessRelativeReference(HtmlTextWriter writer, string attribName){
- string attr = Attributes[attribName];
- if (attr != null){
- if (attr.Length != 0){
- try{
- attr = ResolveUrl(attr);
- }
- catch (Exception e) {
- throw new HttpException(attribName + " property had malformed url");
- }
- writer.WriteAttribute(attribName, attr);
- Attributes.Remove(attribName);
- }
- }
- }
-
- string System.Web.UI.IAttributeAccessor.GetAttribute(string name){
- return Attributes[name];
- }
-
- void System.Web.UI.IAttributeAccessor.SetAttribute(string name, string value){
- Attributes[name] = value;
- }
-
- protected virtual void RenderBeginTag (HtmlTextWriter writer)
- {
- writer.WriteBeginTag (TagName);
- RenderAttributes (writer);
- writer.Write ('>');
- }
-
- protected override void Render (HtmlTextWriter writer)
- {
- RenderBeginTag (writer);
- }
-
- protected virtual void RenderAttributes(HtmlTextWriter writer){
- if (ID != null){
- writer.WriteAttribute("id",ClientID);
- }
- Attributes.Render(writer);
- }
-
- public AttributeCollection Attributes
- {
- get { return _attributes; }
- }
-
- public bool Disabled
- {
- get { return _disabled; }
- set { _disabled = value; }
- }
-
- public CssStyleCollection Style
- {
- get { return _attributes.CssStyle; }
- }
-
- public virtual string TagName
- {
- get { return _tagName; }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs
deleted file mode 100644
index 1df7b2f270a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlForm : HtmlContainerControl{
-
- private static string SmartNavIncludeScriptKey = "SmartNavIncludeScript";
-
- public HtmlForm(): base("form"){}
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name",RenderedName);
- Attributes.Remove("name");
- writer.WriteAttribute("method",Method);
- Attributes.Remove("method");
- writer.WriteAttribute("action",Action,true);
- Attributes.Remove("action");
- if (Enctype != null){
- writer.WriteAttribute ("enctype", Enctype);
- Attributes.Remove ("enctype");
- }
-
-
-// string clientOnSubmit = Page.ClientOnSubmitEvent;
-// if (clientOnSubmit != null && clientOnSubmit.Length > 0){
-// if (Attributes["onsubmit"] != null){
-// clientOnSubmit = String.Concat(clientOnSubmit,Attributes["onsubmit"]);
-// Attributes.Remove("onsubmit");
-// }
-// writer.WriteAttribute("language","javascript");
-// writer.WriteAttribute("onsubmit",clientOnSubmit);
-// }
- if (ID == null){
- writer.WriteAttribute("id",ClientID);
- }
- base.RenderAttributes(writer);
- }
-
- protected override void Render(HtmlTextWriter output){
- if (Page.SmartNavigation == false){
- base.Render (output);
- return;
- }
-
- ((IAttributeAccessor) this).SetAttribute("_smartNavigation","true");
- HttpBrowserCapabilities browserCap = Context.Request.Browser;
- if (browserCap.Browser.ToLower() != "ie" && browserCap.MajorVersion < 5){
- base.Render(output);
- return;
- }
- output.WriteLine("<IFRAME ID=_hifSmartNav NAME=_hifSmartNav STYLE=display:none ></IFRAME>");
-
- if (browserCap.MinorVersion < 0.5 && browserCap.MajorVersion != 5)
- Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNavIE5.js");
- else if (Page.IsPostBack) Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNav.js");
- base.Render(output);
- }
-
- protected override void RenderChildren (HtmlTextWriter writer)
- {
- Page.OnFormRender (writer,ClientID);
- base.RenderChildren (writer);
- Page.OnFormPostRender (writer,ClientID);
- }
-
- protected override void OnInit(EventArgs e){
- base.OnInit(e);
- Page.RegisterViewStateHandler();
- }
-
- internal string Action{
- get{
- string executionFilePath = Context.Request.CurrentExecutionFilePath;
- string filePath = Context.Request.FilePath;
- string attr;
- if (String.ReferenceEquals(executionFilePath, filePath) == true){
- attr = filePath;
- int lastSlash = attr.LastIndexOf('/');
- if (lastSlash >= 0)
- attr = attr.Substring(lastSlash + 1);
- }
- else{
- attr = System.Web.Utils.UrlUtils.MakeRelative(filePath,executionFilePath);
- }
- string queryString = Context.Request.QueryStringRaw;
- if (queryString != null && queryString.Length > 0)
- attr = String.Concat(attr, '?', queryString);
- return attr;
- }
- }
-
- public string Enctype{
- get{
- string attr = Attributes["enctype"];
- if (attr != null){
- return attr;
- }
- return null;
- }
- set{
- Attributes["enctype"] = AttributeToString(value);
- }
- }
-
- public string Method{
- get{
- string attr = Attributes["method"];
- if (attr != null){
- return attr;
- }
- return "post";
- }
- set{
- Attributes["method"] = AttributeToString(value);
- }
- }
-
- public string Target{
- get{
- string attr = Attributes["target"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["target"] = AttributeToString(value);
- }
- }
-
- public string Name{
- get{
- string attr = Attributes["name"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set {
- Attributes ["Name"] = value;
- }
- }
-
- internal string RenderedName{
- get{
- string attr = Name;
- if (attr.Length > 0){
- return attr;
- }
- return UniqueID;
- }
- }
-
- } // class HtmlForm
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
deleted file mode 100644
index 619ad693642..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Web.UI.HtmlControls.HtmlGenericControl.cs
-//
-// Author:
- // Bob Smith <bob@thestuff.net>
- //
- // (C) Bob Smith
- //
-
- using System;
- using System.Web;
- using System.Web.UI;
-
- namespace System.Web.UI.HtmlControls{
-
- public class HtmlGenericControl : HtmlContainerControl {
-
- public HtmlGenericControl(){}
-
- public HtmlGenericControl(string tag): base(tag){}
-
- }
- }
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
deleted file mode 100755
index a0ca1f13b3b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlImage : HtmlControl{
-
- public HtmlImage(): base("img"){}
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- PreProcessRelativeReference(writer,"src");
- base.RenderAttributes(writer);
- writer.Write(" /");
- }
-
- public string Align{
- get{
- string attr = Attributes["align"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string Alt{
- get{
- string attr = Attributes["alt"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["alt"] = AttributeToString(value);
- }
- }
-
- public int Border{
- get{
- string attr = Attributes["border"];
- if (attr != null){
- return Int32.Parse(attr,CultureInfo.InvariantCulture);
- }
- return -1;
- }
- set{
- Attributes["border"] = AttributeToString(value);
- }
- }
-
- public int Height
- {
- get {
- string attr = Attributes ["height"];
- if (attr != null)
- return Int32.Parse (attr, CultureInfo.InvariantCulture);
-
- return -1;
- }
-
- set { Attributes["height"] = AttributeToString (value); }
- }
-
- public string Src{
- get{
- string attr = Attributes["src"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["src"] = AttributeToString(value);
- }
- }
-
- public int Width{
- get{
- string attr = Attributes["width"];
- if (attr != null){
- return Int32.Parse(attr,CultureInfo.InvariantCulture);
- }
- return -1;
- }
- set{
- Attributes["width"] = AttributeToString(value);
- }
- }
-
- } // class HtmlImage
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
deleted file mode 100755
index d9e371a7f8a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputButton : HtmlInputControl, IPostBackEventHandler{
-
- private static readonly object EventServerClick;
-
- public HtmlInputButton(): base ("button")
- {
- }
-
- public HtmlInputButton(string type): base(type){}
-
- protected void OnServerClick(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerClick];
- if (handler != null){
- handler.Invoke(this, e);
- }
- }
-
- public void RaisePostBackEvent(string eventArgument){
- if(CausesValidation == true){
- Page.Validate();
- }
- OnServerClick(EventArgs.Empty);
- }
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public bool CausesValidation{
- get{
- object causesVal = ViewState["CausesValidation"];
- if (causesVal != null){
- return (Boolean) causesVal;
- }
- return true;
- }
- set{
- ViewState["CausesValidation"] = (Boolean) value;
- }
- }
-
- } // end of System.Web.UI.HtmlControls.HtmlInputButton
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
deleted file mode 100755
index c73915abc15..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputCheckBox : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputCheckBox(): base("checkbox"){}
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- bool postChecked = false;
- if (postValue != null)
- postChecked = postValue.Length > 0;
- Checked = postChecked;
- return (postChecked == Checked == false);
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null) handler.Invoke(this, e);
- }
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && !Disabled)
- Page.RegisterRequiresPostBack(this);
- if (Events[EventServerChange] != null && !Disabled)
- ViewState.SetItemDirty("checkbox",false);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public bool Checked{
- get{
- string attr = Attributes["checked"];
- if (attr != null)
- return attr.Equals("checked");
- return false;
- }
- set{
- Attributes["checked"] = (value == true)? "checked": null;
- }
- }
-
- } // class HtmlInputCheckBox
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
deleted file mode 100755
index 5d4a6ce95c7..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls
-{
-
- public class HtmlInputControl : HtmlControl
- {
-
- public HtmlInputControl (string type) : base ("input")
- {
- Attributes ["type"] = type;
- }
-
- protected override void RenderAttributes (HtmlTextWriter writer)
- {
- writer.WriteAttribute ("name",RenderedName);
- Attributes.Remove ("name");
- base.RenderAttributes (writer);
- writer.Write (" /");
- }
-
- public virtual string Name
- {
- get { return UniqueID; }
- set { ID = value; } // Is this ok?
- }
-
- protected virtual string RenderedName
- {
- get { return Name; }
- }
-
- public string Type
- {
- get {
- string _type = Attributes ["type"];
- return ((_type != null) ? _type : String.Empty);
- }
- }
-
- public virtual string Value
- {
- get {
- string attr = Attributes ["value"];
- return ((attr != null) ? attr : String.Empty);
- }
-
- set { Attributes["value"] = value; }
- }
- } // class HtmlInputControl
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs
deleted file mode 100755
index b0e4710db6a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputFile : HtmlInputControl, IPostBackDataHandler{
-
- public HtmlInputFile():base("file"){}
-
- public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- if (postValue != null)
- Value = postValue;
- return false;
- }
-
- public virtual void RaisePostDataChangedEvent(){}
-
- public string Accept{
- get{
- string attr = Attributes["accept"];
- if (attr != null)
- return attr;
- return String.Empty;
- }
- set{
- Attributes["accept"] = AttributeToString(value);
- }
- }
-
- public int MaxLength{
- get{
- string attr = Attributes["maxlength"];
- if (attr != null)
- return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["accept"] = AttributeToString(value);
- }
- }
-
- public int Size{
- get{
- string attr = Attributes["size"];
- if (attr != null)
- return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["size"] = AttributeToString(value);
- }
- }
-
- public HttpPostedFile PostedFile{
- get{
- return Context.Request.Files[RenderedName];
- }
- }
-
- } // class HtmlInputFile
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
deleted file mode 100755
index b2ff1bfdba8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputHidden : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputHidden () : base ("hidden")
- {
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- if (postValue != null)
- Value = postValue;
- return false;
- }
-
- public virtual void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null) handler.Invoke(this, e);
- }
-
- protected override void OnPreRender(EventArgs e){
- if (Events[EventServerChange] != null && !Disabled)
- ViewState.SetItemDirty("value",false);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- } // class HtmlInputFile
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
deleted file mode 100755
index 1854a3b4dd2..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputImage : HtmlInputControl, IPostBackEventHandler, IPostBackDataHandler{
-
- private static readonly object EventServerClick;
- private int _x, _y;
-
- public HtmlInputImage(): base("image"){}
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && !Disabled){
- Page.RegisterRequiresPostBack(this);
- }
- }
-
- protected void OnServerClick(ImageClickEventArgs e){
- ImageClickEventHandler handler = (ImageClickEventHandler) Events[EventServerClick];
- // if (handler != null) handler.Invoke(this, e);
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postX = postCollection[String.Concat(RenderedName,".x")];
- string postY = postCollection[String.Concat(RenderedName,".y")];
- if (postX != null && postY != null && postX.Length >= 0 && postY.Length >= 0){
- _x = Int32.Parse(postX, CultureInfo.InvariantCulture);
- _y = Int32.Parse(postY, CultureInfo.InvariantCulture);
- Page.RegisterRequiresRaiseEvent(this);
- }
- return false;
- }
-
- public void RaisePostBackEvent(string eventArgument){
- if (CausesValidation){
- Page.Validate();
- }
- OnServerClick(new ImageClickEventArgs(_x,_y));
- }
-
- public void RaisePostDataChangedEvent(){}
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public string Align{
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string Alt{
- get{
- string attr = Attributes["alt"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["alt"] = AttributeToString(value);
- }
- }
-
- public int Border{
- get{
- string attr = Attributes["border"];
- if (attr != null) return Int32.Parse(attr,CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["border"] = AttributeToString(value);
- }
- }
-
- public bool CausesValidation{
- get{
- object causesVal = ViewState["CausesValidation"];
- if (causesVal != null) return (Boolean) causesVal;
- return true;
- }
- set{
- ViewState["CausesValidation"] = (Boolean) value;
- }
- }
-
- public string Src{
- get{
- string attr = Attributes["src"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["src"] = AttributeToString(value);
- }
- }
- } // class HtmlInputImage
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
deleted file mode 100755
index 780988a8bf1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputRadioButton : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputRadioButton(): base("radio"){}
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && !Disabled){
- Page.RegisterRequiresPostBack(this);
- }
- if (Events[EventServerChange] != null && !Disabled){
- ViewState.SetItemDirty("checked", false);
- }
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null){
- handler.Invoke(this, e);
- }
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("value", Value);
- Attributes.Remove("value");
- base.RenderAttributes(writer);
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string postValue = postCollection[postDataKey];
- bool myBool = false;
- if (postValue != null && postValue.Equals(Value)){
- if (!Checked){
- Checked = true;
- myBool = true;
- }
- }
- else{
- if (Checked){
- Checked = false;
- myBool = false;
- }
- }
- return myBool;
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public bool Checked{
- get{
- string attr = Attributes["checked"];
- if (attr != null){
- return attr.Equals("checked");
- }
- return false;
- }
- set{
- if (value != true){
- Attributes["checked"] = null;
- }
- Attributes["checked"] = "checked";
- }
- }
- public override string Name
- {
- get {
- string attr = Attributes ["name"]; // Gotta use "name" to group radio buttons
- return (attr == null) ? String.Empty : attr;
- }
- set { Attributes ["name"] = value; }
- }
-
- protected override string RenderedName{
- get{
- string attr = base.RenderedName;
- string id = UniqueID;
- int indexOfX = id.LastIndexOf('X');
- if (indexOfX != 0 && indexOfX >= 0){
- attr = String.Concat(attr, id.Substring(0,indexOfX+1));
- }
- return attr;
- }
- }
-
- public override string Value
- {
- get {
- string v = Attributes ["value"];
- if (v != null && v != "")
- return v;
- v = ID;
- Attributes ["value"] = v;
- return v;
- }
-
- set { Attributes ["value"] = value; }
- }
-
- } // class HtmlInputRadioButton
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
deleted file mode 100755
index 355743c5233..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputText : HtmlInputControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlInputText(string type):base(type){}
- public HtmlInputText():base("text"){}
-
- protected override void OnPreRender(EventArgs e){
- if (Events[EventServerChange] != null && !Disabled){
- ViewState.SetItemDirty("value",false);
- }
- }
-
- protected void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null) handler.Invoke(this, e);
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- //hide value when password box
- if (String.Compare (Type, "password",true) != 0)
- ViewState.Remove("value");
- base.RenderAttributes(writer);
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string currentValue = Value;
- string[] postedValue = postCollection.GetValues(postDataKey);
- if (!currentValue.Equals(postedValue)){
- Value = postedValue[0];
- return true;
- }
- return false;
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public int MaxLength{
- get{
- string attr = (String) ViewState["maxlength"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["maxlength"] = AttributeToString(value);
- }
- }
-
- public int Size{
- get{
- string attr = (String) ViewState["size"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["size"] = AttributeToString(value);
- }
- }
-
- public override string Value{
- get{
- string attr = Attributes["value"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["value"] = AttributeToString(value);
- }
- }
-
- } // class HtmlInputText
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
deleted file mode 100755
index 4fd11f8f6fb..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
+++ /dev/null
@@ -1,408 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Web.UI.WebControls;
-using System.Globalization;
-using System.ComponentModel;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlSelect : HtmlContainerControl, IPostBackDataHandler{
-
-
- private int _cachedSelectedIndex;
- private object _dataSource;
- private static readonly object EventServerChange;
- private ListItemCollection _items;
-
- public HtmlSelect():base("select"){
- _cachedSelectedIndex = -1;
- }
-
- protected override void AddParsedSubObject(object obj){
- if (obj as ListItem != null) {
- this.Items.Add((ListItem) obj);
- return;
- }
- throw new HttpException("HtmlSelect cannot have children of Type " + obj.GetType().Name);
- }
-
- protected virtual void ClearSelection(){
- for (int i =0; i<= Items.Count; i++){
- Items[i].Selected = false;
- }
- }
-
- protected override ControlCollection CreateControlCollection(){
- return new EmptyControlCollection(this);
- }
-
- protected override void LoadViewState(object savedState){
- if (savedState != null){
- Triplet state = (Triplet) savedState;
- LoadViewState(state.First);
- Items.LoadViewState(state.Second);
- object thirdState = state.Third;
- if (thirdState != null) Select((int[]) thirdState);
- }
- }
-
- protected override void OnDataBinding(EventArgs e){
- base.OnDataBinding(e);
- IEnumerable resolvedDataSource = System.Web.Utils.DataSourceHelper.GetResolvedDataSource(DataSource, DataMember);
- if ( resolvedDataSource != null){
- string text = DataTextField;
- string value = DataValueField;
- Items.Clear();
- ICollection rdsCollection = resolvedDataSource as ICollection;
- if (rdsCollection != null){
- Items.Capacity = rdsCollection.Count;
- }
- bool valid = false;
- if (text.Length >= 0 && value.Length >= 0)
- valid = true;
- ListItem li = new ListItem();
- IEnumerator current = resolvedDataSource.GetEnumerator();
- while(current.MoveNext()){
- if (valid == true){
- if (text.Length >= 0)
- li.Text = DataBinder.GetPropertyValue(current, text) as string;
- if (value.Length >= 0)
- li.Value = DataBinder.GetPropertyValue(current, value) as string;
- }
- else{
- li.Value = li.Text = current.ToString();
- }
- }
- Items.Add(li);
- }
- if ( _cachedSelectedIndex != -1){
- SelectedIndex = _cachedSelectedIndex;
- _cachedSelectedIndex = -1;
- }
- }
-
- protected override void OnPreRender(EventArgs e){
- if (Page != null && Size >= 0 && !Disabled){
- Page.RegisterRequiresPostBack(this);
- }
- }
-
- protected virtual void OnServerChange(EventArgs e){
- EventHandler handler = (EventHandler) Events[EventServerChange];
- if (handler != null)
- handler.Invoke(this,e);
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name", Name);
- Attributes.Remove("name");
- Attributes.Remove("DataValueField");
- Attributes.Remove("DataTextField");
- Attributes.Remove("DataMember");
- base.RenderAttributes(writer);
- }
-
- protected override void RenderChildren(HtmlTextWriter writer){
- //flush output
- writer.WriteLine();
- // increase indent level, improves readability
- writer.Indent = writer.Indent + 1;
- if (Items.Count >= 0){
- // display all options, and set the selected option
- bool rendered_selected = false;
- foreach (ListItem option in Items){
- //write begin tag with attributes
- writer.WriteBeginTag("option");
- if (!rendered_selected && option.Selected){
- writer.WriteAttribute("selected","selected");
- if (!Multiple)
- rendered_selected = true;
- }
- else if (option.Selected){
- option.Selected = false;
- }
-
- writer.WriteAttribute("value",option.Value,true);
- option.Attributes.Remove("text");
- option.Attributes.Remove("value");
- option.Attributes.Remove("selected");
- option.Attributes.Render(writer);
- writer.Write('>');
- //write the option text
- HttpUtility.HtmlEncode(option.Text, writer);
- //close the current option tag
- writer.WriteEndTag("option");
- //flush output
- writer.WriteLine();
- }
- }
- // set the indent level back to normal
- writer.Indent = writer.Indent - 1;
- }
-
- protected override object SaveViewState(){
- object itemsViewState = SaveViewState();
- object third = null;
- if (Events[EventServerChange] != null && !Disabled && Visible){
- third = SelectedIndices;
- }
- if (third != null && base.SaveViewState() != null && itemsViewState != null){
- return new Triplet(itemsViewState, base.SaveViewState(), third);
- }
- return null;
- }
-
- protected virtual void Select(int[] selectedIndices){
- // unselect all options
- ClearSelection();
- // iterate through options, and set when selected
- foreach (int current in selectedIndices){
- if (current >= 0 && current < Items.Count){
- Items[current].Selected = true;
- }
- }
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- //get the posted selectedIndices[]
- string[] postedValueColl = postCollection.GetValues(postDataKey);
- bool valid = false;
- if (postedValueColl != null){
- if (!Multiple){
- //single selection
- //int postedValue = Items.FindIndexByValue(postedValueColl[0]);
- int postedValue = Items.IndexOf(Items.FindByValue(postedValueColl[0]));
- if (postedValue != SelectedIndex){
- //set the SelectedIndex
- SelectedIndex = postedValue;
- valid = true;
- }
- }
- else{
- //multiple selection
- int postedValueCount = postedValueColl.Length;
- int[] arr= new int[postedValueCount];
- //fill an array with the posted Values
- for (int i = 0; i <= postedValueCount; i++)
- arr[i] = Items.IndexOf(Items.FindByValue(postedValueColl[i]));
- //test if everything went fine
- if( postedValueCount == SelectedIndices.Length)
- for (int i = 0; i <= postedValueCount; i++)
- if(arr[i] == SelectedIndices[i])
- valid = true;
- else
- valid = true;
- //commit the posted Values
- if(valid)
- Select(arr);
- }
- }
- else if (SelectedIndex != -1){
- SelectedIndex = -1;
- valid = true;
- }
- return valid;
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- //starts tracking changes to the viewstate
- internal virtual new void TrackViewState(){
- TrackViewState();
- Items.TrackViewState();
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- public virtual string DataMember{
- get{
- object viewStateDataMember = ViewState["DataMember"];
- if ( viewStateDataMember != null) return (String) viewStateDataMember;
- return String.Empty;
- }
- set{
- Attributes["DataMember"] = HtmlControl.AttributeToString(value);
- }
- }
-
- public virtual object DataSource{
- get{
- return _dataSource;
- }
- set{
- if (value != null && value is IListSource){
- if (value is IEnumerable){
- _dataSource = value;
- }
- else{
- throw new ArgumentException("Invalid dataSource type");
- }
- }
- }
- }
-
- public virtual string DataTextField{
- get{
- string attr = Attributes["DataTextField"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["DataTextField"] = AttributeToString(value);
- }
- }
-
- public virtual string DataValueField{
- get{
- string attr = Attributes["DataValueField"];
- if (attr != null)return attr;
- return String.Empty;
- }
- set{
- Attributes["DataValueField"] = AttributeToString(value);
- }
- }
-
- public override string InnerHtml{
- get{
- throw new NotSupportedException("InnerHtml is not supported by " + this.GetType().Name);
- }
- set{
- throw new NotSupportedException("InnerHtml is not supported by " + this.GetType().Name);
- }
- }
-
- public override string InnerText{
- get{
- throw new NotSupportedException("InnerText is not supported by " + this.GetType().Name);
- }
- set{
- throw new NotSupportedException("InnerText is not supported by " + this.GetType().Name);
- }
- }
-
- public ListItemCollection Items{
- get{
- if (_items == null){
- _items = new ListItemCollection();
- if (IsTrackingViewState) _items.TrackViewState();
- }
- return _items;
- }
- }
-
- public bool Multiple{
- get{
- string attr = Attributes["multiple"];
- if (attr != null) return (0 == String.Compare (attr, "true", true));
- return false;
- }
- set{
- Attributes["multiple"] = value.ToString ();
- }
- }
-
- public string Name{
- get{
- return UniqueID;
- }
- set{
- //LAMESPEC
- return;
- }
- }
-
- public virtual int SelectedIndex {
- get{
- for (int i=0; i<Items.Count; i++){
- if (Items[i].Selected == true) return i;
- }
- if (Size<=1 && !Multiple){
- if(Items.Count > 0) Items[0].Selected = true;
- return 0;
- }
- return -1;
- }
- set{
- if(Items.Count == 0){
- _cachedSelectedIndex = value;
- return;
- }
- else if (value < -1 || value >= Items.Count)
- throw new ArgumentOutOfRangeException();
- ClearSelection();
- if (value >= 0)
- Items[value].Selected = true;
- }
- }
-
- protected virtual int[] SelectedIndices {
- get{
- int[] indices = new int[3];
- int indicesCount = 0;
- for(int i=0; i <= Items.Count; i++){
- if(Items[i].Selected){
- if( indicesCount == (int) indices.Length){
- int[] temp = new int[indicesCount + indicesCount];
- indices.CopyTo(temp,0);
- indices = temp;
- }
- indicesCount++;
- indices[indicesCount] = i;
- }
- }
- int[] arr = new int[indicesCount];
- System.Array.Copy(indices,0,arr,0,indicesCount);
- return arr;
- }
- }
-
- public int Size{
- get{
- string attr = Attributes["size"];
- if (attr != null){
- return Int32.Parse(attr, CultureInfo.InvariantCulture);;
- }
- return -1;
- }
- set{
- Attributes["size"] = AttributeToString(value);
- }
- }
-
- public string Value{
- get{
- int selectedIndex = SelectedIndex;
- if (selectedIndex >=0 && selectedIndex <= Items.Count){
- return Items[selectedIndex].Value;
- }
- return String.Empty;
- }
- set{
- int findValue = Items.IndexOf(Items.FindByValue(value));
- if (findValue >= 0) SelectedIndex = findValue;
- }
- }
-
- } // class HtmlSelect
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
deleted file mode 100755
index 6a70743c2d0..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlTable : HtmlContainerControl {
- private HtmlTableRowCollection _rows;
-
- public HtmlTable():base("table"){}
-
- protected override ControlCollection CreateControlCollection(){
- return new HtmlTableRowControlCollection(this);
- }
-
- protected override void RenderChildren(HtmlTextWriter writer){
- writer.WriteLine();
- writer.Indent = writer.Indent + 1;
- base.RenderChildren(writer);
- writer.Indent = writer.Indent - 1;
- }
-
- protected override void RenderEndTag(HtmlTextWriter writer){
- base.RenderEndTag(writer);
- writer.WriteLine();
- }
-
- public string Align {
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string BgColor {
- get{
- string attr = Attributes["bgcolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bgcolor"] = AttributeToString(value);
- }
- }
-
- public int Border {
- get{
- string attr = Attributes["border"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["border"] = AttributeToString(value);
- }
- }
-
- public string BorderColor {
- get{
- string attr = Attributes["bordercolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bordercolor"] = AttributeToString(value);
- }
- }
-
- public int CellPadding {
- get{
- string attr = Attributes["cellpadding"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["cellpadding"] = AttributeToString(value);
- }
- }
-
- public int CellSpacing {
- get{
- string attr = Attributes["cellspacing"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["cellspacing"] = AttributeToString(value);
- }
- }
-
- public string Height {
- get{
- string attr = Attributes["height"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["height"] = AttributeToString(value);
- }
- }
-
- public override string InnerHtml {
- get{
- throw new NotSupportedException("InnerHtml property not supported by HtmlTable");
- }
- set{
- throw new NotSupportedException("InnerHtml property not supported by HtmlTable");
- }
- }
-
- public override string InnerText {
- get{
- throw new NotSupportedException("InnerText property not supported by HtmlTable");
- }
- set{
- throw new NotSupportedException("InnerText property not supported by HtmlTable");
- }
- }
-
- public virtual HtmlTableRowCollection Rows {
- get{
- if (_rows == null) _rows = new HtmlTableRowCollection(this);
- return _rows;
- }
- }
-
- public string Width {
- get{
- string attr = Attributes["width"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["width"] = AttributeToString(value);
- }
- }
-
- protected class HtmlTableRowControlCollection : ControlCollection {
-
- internal HtmlTableRowControlCollection(Control owner): base(owner){}
-
- public override void Add(Control child){
- if ((child as HtmlTableRow) != null){
- base.Add(child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of type " + child.GetType().Name);
- }
- }
-
- public override void AddAt(int index, Control child){
- if ((child as HtmlTableRow) != null){
- base.AddAt(index,child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of type " + child.GetType().Name);
- }
- }
- } // end of HtmlTableRowControlCollection
- }
- // end of System.Web.UI.HtmlControl
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs
deleted file mode 100755
index 38d77f4f471..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
- public class HtmlTableCell : HtmlContainerControl {
- public HtmlTableCell(): base("td"){}
-
- public HtmlTableCell(string tagName): base(tagName){}
-
- protected override void RenderEndTag(HtmlTextWriter writer){
- base.RenderEndTag(writer);
- writer.WriteLine();
- }
-
- public string Align {
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string BgColor {
- get{
- string attr = Attributes["bgcolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bgcolor"] = AttributeToString(value);
- }
- }
-
- public string BorderColor {
- get{
- string attr = Attributes["bordercolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bordercolor"] = AttributeToString(value);
- }
- }
-
- public int ColSpan {
- get{
- string attr = Attributes["colspan"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["colspan"] = AttributeToString(value);
- }
- }
-
- public string Height {
- get{
- string attr = Attributes["height"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["height"] = AttributeToString(value);
- }
- }
-
- public bool NoWrap {
- get{
- string attr = Attributes["colspan"];
- if (attr != null) return attr.Equals("nowrap");
- return false;
- }
- set{
- if (value == true){
- Attributes["nowrap"] = "nowrap";
- }
- else{
- Attributes["nowrap"] = null;
- }
- }
- }
-
- public int RowSpan {
- get{
- string attr = Attributes["rowspan"];
- if (attr != null) return Int32.Parse(attr, CultureInfo.InvariantCulture);
- return -1;
- }
- set{
- Attributes["rowspan"] = AttributeToString(value);
- }
- }
-
- public string VAlign {
- get{
- string attr = Attributes["valign"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["valign"] = AttributeToString(value);
- }
- }
-
- public string Width {
- get{
- string attr = Attributes["width"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["width"] = AttributeToString(value);
- }
- }
-
- }
- // System.Web.UI.HtmlControls.HtmlTableCell
-
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs
deleted file mode 100755
index e6926f10eb7..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCellCollection.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Collections;
-
-namespace System.Web.UI.HtmlControls{
- public sealed class HtmlTableCellCollection : ICollection {
- private HtmlTableRow _owner;
-
- internal HtmlTableCellCollection(HtmlTableRow owner){
- _owner = owner;
- }
-
- public void Add(HtmlTableCell cell){
- Insert(-1, cell);
- }
-
- public void Clear(){
- if (_owner.HasControls()) _owner.Controls.Clear();
- }
-
- public void CopyTo(Array array, int index){
- IEnumerator tablecell = this.GetEnumerator();
- while(tablecell.MoveNext()){
- index = index + 1;
- array.SetValue(tablecell.Current, index);
- }
- }
-
- public IEnumerator GetEnumerator(){
- return _owner.Controls.GetEnumerator();
- }
-
- public void Insert(int index, HtmlTableCell cell){
- _owner.Controls.AddAt(index,cell);
- }
-
- public void Remove(HtmlTableCell cell){
- _owner.Controls.Remove(cell);
- }
-
- public void RemoveAt(int index){
- _owner.Controls.RemoveAt(index);
- }
-
- public int Count {
- get{
- if (_owner.HasControls()) return _owner.Controls.Count;
- return 0;
- }
- }
-
- public bool IsReadOnly {
- get{
- return false;
- }
- }
-
- public bool IsSynchronized {
- get{
- return false;
- }
- }
-
- public HtmlTableCell this[int index] {
- get{
- return _owner.Controls[index] as HtmlTableCell;
- }
- }
-
- public object SyncRoot {
- get{
- return null;
- }
- }
-
- } // end of System.Web.UI.HtmlControls.HtmlTableCellCollection
-
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs
deleted file mode 100755
index f08f657ee0c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRow.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
- public class HtmlTableRow : HtmlContainerControl {
- private HtmlTableCellCollection _cells;
- public HtmlTableRow():base("tr"){}
-
- protected override ControlCollection CreateControlCollection(){
- return new HtmlTableCellControlCollection(this);
- }
-
- protected override void RenderChildren(HtmlTextWriter writer){
- writer.WriteLine();
- writer.Indent = writer.Indent + 1;
- base.RenderChildren(writer);
- writer.Indent = writer.Indent - 1;
- }
-
- protected override void RenderEndTag(HtmlTextWriter writer){
- base.RenderEndTag(writer);
- writer.WriteLine();
- }
-
- public string Align {
- get{
- string attr = Attributes["align"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["align"] = AttributeToString(value);
- }
- }
-
- public string BgColor {
- get{
- string attr = Attributes["bgcolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bgcolor"] = AttributeToString(value);
- }
- }
-
- public string BorderColor {
- get{
- string attr = Attributes["bordercolor"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["bordercolor"] = AttributeToString(value);
- }
- }
-
- public virtual HtmlTableCellCollection Cells {
- get{
- if (_cells == null) _cells = new HtmlTableCellCollection(this);
- return _cells;
- }
- }
-
- public string Height {
- get{
- string attr = Attributes["height"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["height"] = AttributeToString(value);
- }
- }
-
- public override string InnerHtml {
- get{
- throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
- }
- set{
- throw new NotSupportedException("InnerHtml is not supported by HtmlTableRow");
- }
- }
-
- public override string InnerText {
- get{
- throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
- }
- set{
- throw new NotSupportedException("InnerText is not supported by HtmlTableRow");
- }
- }
-
- public string VAlign {
- get{
- string attr = Attributes["valign"];
- if (attr != null) return attr;
- return String.Empty;
- }
- set{
- Attributes["valign"] = AttributeToString(value);
- }
- }
-
-
-
- protected class HtmlTableCellControlCollection : ControlCollection {
-
- internal HtmlTableCellControlCollection(Control owner): base(owner){}
-
- public override void Add(Control child){
- if (child is HtmlTableCell){
- base.Add(child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
- }
- }
-
- public override void AddAt(int index, Control child){
- if (child is HtmlTableCell){
- base.AddAt(index,child);
- }
- else{
- throw new ArgumentException("HtmlTableRow cannot have children of Type " + child.GetType().Name);
- }
- }
- }
- } // end of System.Web.UI.HtmlControls.HtmlTableRow+HtmlTableCellControlCollection
- // end of System.Web.UI.HtmlControls.HtmlTableRow
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs
deleted file mode 100755
index 987c8aed674..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableRowCollection.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Collections;
-
-namespace System.Web.UI.HtmlControls{
- public sealed class HtmlTableRowCollection : ICollection {
-
- private HtmlTable _owner;
-
- internal HtmlTableRowCollection(HtmlTable owner){
- _owner = owner;
- }
-
- public void Add(HtmlTableRow row){
- Insert(-1, row);
- }
-
- public void Clear(){
- if (_owner.HasControls()) _owner.Controls.Clear();
- }
-
- public void CopyTo(Array array, int index){
- IEnumerator tablerow = this.GetEnumerator();
- while (tablerow.MoveNext()){
- index = index + 1;
- array.SetValue(tablerow.Current, index);
- }
- }
-
- public IEnumerator GetEnumerator(){
- return _owner.Controls.GetEnumerator();
- }
-
- public void Insert(int index, HtmlTableRow row){
- _owner.Controls.AddAt(index,row);
- }
-
- public void Remove(HtmlTableRow row){
- _owner.Controls.Remove(row);
- }
-
- public void RemoveAt(int index){
- _owner.Controls.RemoveAt(index);
- }
-
- public int Count {
- get{
- if (_owner.HasControls()) return _owner.Controls.Count;
- return 0;
- }
- }
-
- public bool IsReadOnly {
- get{
- return false;
- }
- }
-
- public bool IsSynchronized {
- get{
- return false;
- }
- }
-
- public HtmlTableRow this[int index] {
- get{
- return (HtmlTableRow) _owner.Controls[index];
- }
- }
-
- public object SyncRoot {
- get{
- return this;
- }
- }
- }//System.Web.UI.HtmlControls.HtmlTableRowCollection
-}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
deleted file mode 100644
index 9d32d73af0e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-using System.Globalization;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlTextArea : HtmlContainerControl, IPostBackDataHandler{
-
- private static readonly object EventServerChange;
-
- public HtmlTextArea(): base("textarea"){}
-
- public int Cols{
- get{
- string attr = Attributes["cols"];
- if (attr != null){
- return Int32.Parse(attr, CultureInfo.InvariantCulture);
- }
- return -1;
- }
- set{
- Attributes["cols"] = AttributeToString(value);
- }
- }
-
- public int Rows{
- get{
- string attr = Attributes["rows"];
- if (attr != null){
- return Int32.Parse(attr, CultureInfo.InvariantCulture);;
- }
- return -1;
- }
- set{
- Attributes["rows"] = AttributeToString(value);
- }
- }
-
- public string Value{
- get{
- return InnerHtml;
- }
- set{
- InnerHtml = value;
- }
- }
-
- public virtual string Name{
- get{
- if (UniqueID != null){
- return UniqueID;
- }
- return String.Empty;
- }
- set{}
- }
-
- public event EventHandler ServerChange{
- add{
- Events.AddHandler(EventServerChange, value);
- }
- remove{
- Events.RemoveHandler(EventServerChange, value);
- }
- }
-
- protected virtual void OnServerChange(EventArgs e){
- EventHandler handler;
- handler = (EventHandler) Events[EventServerChange];
- if(handler != null){
- handler.Invoke(this, e);
- }
- }
-
- public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
- string currentValue = Value;
- string postedValue = postCollection[postDataKey];
- if (!currentValue.Equals(postedValue) && currentValue != null){
- Value = HttpUtility.HtmlEncode(postedValue);
- return true;
- }
- return false;
- }
-
- protected override void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name", Name);
- Attributes.Remove("name");
- base.RenderAttributes(writer);
- }
-
- public void RaisePostDataChangedEvent(){
- OnServerChange(EventArgs.Empty);
- }
-
- protected override void OnPreRender(EventArgs e){
- if(Events[EventServerChange]==null || Disabled){
- ViewState.SetItemDirty("value",false);
- }
- }
-
- protected override void AddParsedSubObject(object obj){
- if (obj is LiteralControl || obj is DataBoundLiteralControl)
- AddParsedSubObject(obj);
- else
- throw new NotSupportedException("HtmlTextArea cannot have children of Type " + obj.GetType().Name);
- }
-
- } // class HtmlTextArea
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/.cvsignore b/mcs/class/System.Web/System.Web.UI.WebControls/.cvsignore
deleted file mode 100644
index 13fc1fc7660..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.exe
-*.xml
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs
deleted file mode 100755
index d0e94b87f88..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventArgs.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: AdCreatedEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class AdCreatedEventArgs: EventArgs
- {
-
- private IDictionary adProperties;
- private string alternateText;
- private string imageUrl;
- private string navigateUrl;
-
- public AdCreatedEventArgs(IDictionary adProperties): base()
- {
- Initialize();
- this.adProperties = adProperties;
- if(adProperties!=null)
- {
- imageUrl = (string)adProperties["ImageUrl"];
- navigateUrl = (string)adProperties["NavigateUrl"];
- alternateText = (string)adProperties["AlternateText"];
- }
- }
-
- private void Initialize()
- {
- alternateText = string.Empty;
- imageUrl = string.Empty;
- navigateUrl = string.Empty;
- }
-
- public IDictionary AdProperties
- {
- get
- {
- return adProperties;
- }
- }
-
- public string AlternateText
- {
- get
- {
- return alternateText;
- }
- set
- {
- alternateText = value;
- }
- }
-
- public string ImageUrl
- {
- get
- {
- return imageUrl;
- }
- set
- {
- imageUrl = value;
- }
- }
-
- public string NavigateUrl
- {
- get
- {
- return navigateUrl;
- }
- set
- {
- navigateUrl = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs
deleted file mode 100755
index 57359aa5b30..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/AdCreatedEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: AdCreatedEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void AdCreatedEventHandler(object sender, AdCreatedEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
deleted file mode 100755
index 0b107ebcf07..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs
+++ /dev/null
@@ -1,362 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: AdRotator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.Caching;
-using System.Web.UI;
-using System.Xml;
-using System.Web.Utils;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("AdCreated")]
- [DefaultProperty("AdvertisementFile")]
- //TODO: [Designer("??")]
- [ToolboxData("<{0}:AdRotator runat=\"server\" Height=\"60px\" "
- + "Width=\"468\"></{0}:AdRotator>")]
- public class AdRotator: WebControl
- {
-
- private string advertisementFile;
- private static readonly object AdCreatedEvent = new object();
-
- // Will be set values during (On)PreRender-ing
- private string alternateText;
- private string imageUrl;
- private string navigateUrl;
-
- private string fileDirectory;
-
- class AdRecord
- {
- public IDictionary adProps;
- public int hits; // or impressions or clicks
- public string keyword;
-
- public AdRecord(IDictionary adProps)
- {
- this.adProps = adProps;
- hits = 0;
- keyword = String.Empty;
- }
- }
-
-/*
- * Loading / Saving data from/to ad file and all the manipulations wrt to the URL...
- * are incorporated by the following functions.
- * GetData(string)
- * LoadAdFile(string)
- * IsAdMatching(AdRecord)
- * ResolveAdUrl(string)
- * SelectAd()
- * The exact control flow will be detailed. Let me first write the functions
- */
-
- private AdRecord[] LoadAdFile(string file)
- {
- Stream fStream;
- ArrayList list;
- XmlReader reader;
- XmlDocument document;
- XmlNode topNode, innerNode;
- IDictionary hybridDict = null;
- AdRecord[] adsArray = null;
- try
- {
- fStream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read);
- } catch(Exception e)
- {
- throw new HttpException("AdRotator: Unable to open file");
- }
- try
- {
- list = new ArrayList();
- reader = new XmlTextReader(fStream);
- document = new XmlDocument();
- document.Load(reader);
- if(document.DocumentElement!=null)
- {
- if(document.DocumentElement.LocalName=="Advertisements")
- {
- topNode = document.DocumentElement.FirstChild;
- while(topNode!=null)
- {
- if(topNode.LocalName=="Ad")
- {
- innerNode = topNode.FirstChild;
- while(innerNode!=null)
- {
- if(innerNode.NodeType==XmlNodeType.Element)
- {
- if(hybridDict==null)
- {
- hybridDict = new HybridDictionary();
- }
- hybridDict.Add(innerNode.LocalName, innerNode.InnerText);
- }
- innerNode = innerNode.NextSibling;
- }
- if(hybridDict!=null)
- list.Add(hybridDict);
- }
- topNode = topNode.NextSibling;
- }
- }
- }
- if(list.Count>0)
- {
- adsArray = new AdRecord[list.Count];
- for(int i=0; i < list.Count; i++)
- {
- adsArray[i] = new AdRecord((IDictionary)list[i]);
- }
- }
- } catch(Exception e)
- {
- throw new HttpException("AdRotator_Parse_Error" + file);
- } finally
- {
- fStream.Close();
- }
- if(adsArray == null)
- {
- throw new HttpException("AdRotator_No_Advertisements_Found");
- }
- return adsArray;
- }
-
- [MonoTODO("CacheDependency does nothing")]
- private AdRecord[] GetData(string file)
- {
- string physPath = MapPathSecure(file);
- string AdKey = "AdRotatorCache: " + physPath;
- fileDirectory = UrlUtils.GetDirectory(UrlUtils.Combine(TemplateSourceDirectory, file));
- Cache cache = HttpRuntime.Cache;
- AdRecord[] records = (AdRecord[])cache[AdKey];
- if(records==null)
- {
- records = LoadAdFile(physPath);
- if(records==null)
- {
- return null;
- }
- cache.Insert(AdKey, records, new CacheDependency(physPath));
- }
- return records;
- }
-
- private IDictionary SelectAd()
- {
- AdRecord[] records = GetData(AdvertisementFile);
- if(records!=null && records.Length!=0)
- {
- int impressions = 0;
- for(int i=0 ; i < records.Length; i++)
- {
- if(IsAdMatching(records[i]))
- impressions += records[i].hits;
- }
- if(impressions!=0)
- {
- int rnd = (new Random()).Next(impressions) + 1;
- int counter = 0;
- int index = 0;
- for(int i=0; i < records.Length; i++)
- {
- if(IsAdMatching(records[i]))
- {
- if(rnd <= (counter + records[i].hits))
- {
- index = i;
- break;
- }
- counter += records[i].hits;
- }
- }
- return records[index].adProps;
- }
- //FIXME: the line below added. Where should i init hits to make
- //impressions not be 0?
- return records [0].adProps;
- }
- return null;
- }
-
- private bool IsAdMatching(AdRecord currAd)
- {
- if (KeywordFilter != String.Empty)
- return (0 == String.Compare (currAd.keyword, KeywordFilter, true));
-
- return true;
- }
-
- private string ResolveAdUrl(string relativeUrl)
- {
- if(relativeUrl.Length==0 || !UrlUtils.IsRelativeUrl(relativeUrl))
- return relativeUrl;
- string fullUrl = String.Empty;
- if(fileDirectory != null)
- fullUrl = fileDirectory;
- if(fullUrl.Length == 0)
- fullUrl = TemplateSourceDirectory;
- if(fullUrl.Length == 0)
- return relativeUrl;
- return (fullUrl + relativeUrl);
- }
-
- [WebCategory("Action")]
- [WebSysDescription("AdRotator_OnAdCreated")]
- public event AdCreatedEventHandler AdCreated
- {
- add
- {
- Events.AddHandler(AdCreatedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(AdCreatedEvent, value);
- }
- }
-
- public AdRotator(): base()
- {
- advertisementFile = string.Empty;
- fileDirectory = null;
- }
-
- [Bindable(true)]
- [DefaultValue("")]
- //[Editor("??")]
- [WebCategory("Behaviour")]
- [WebSysDescription("AdRotator_AdvertisementFile")]
- public string AdvertisementFile
- {
- get
- {
- return advertisementFile;
- }
- set
- {
- advertisementFile = value;
- }
- }
-
- public override FontInfo Font
- {
- get
- {
- return Font;
- }
- }
-
- [Bindable(true)]
- [DefaultValue("")]
- [WebCategory("Behaviour")]
- [WebSysDescription("AdRotator_KeywordFilter")]
- public string KeywordFilter
- {
- get
- {
- object o = ViewState["KeywordFilter"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- if(value!=null)
- ViewState["KeywordFilter"] = value.Trim();
- }
- }
-
- [Bindable(true)]
- [DefaultValue("")]
- [TypeConverter(typeof(TargetConverter))]
- [WebCategory("Behaviour")]
- [WebSysDescription("AdRotator_Target")]
- public string Target
- {
- get
- {
- object o = ViewState["Target"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Target"] = value;
- }
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new EmptyControlCollection(this);
- }
-
- protected virtual void OnAdCreated(AdCreatedEventArgs e)
- {
- if(Events!=null)
- {
- AdCreatedEventHandler aceh = (AdCreatedEventHandler)(Events[AdCreatedEvent]);
- if(aceh!=null)
- aceh(this, e);
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- if(AdvertisementFile!=String.Empty)
- {
- AdCreatedEventArgs acea = new AdCreatedEventArgs(SelectAd());
- imageUrl = acea.ImageUrl;
- navigateUrl = acea.NavigateUrl;
- alternateText = acea.AlternateText;
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- HyperLink hLink = new HyperLink();
- Image adImage = new Image();
- foreach(IEnumerable current in Attributes.Keys)
- {
- hLink.Attributes[(string)current] = Attributes[(string)current];
- }
- if(ID != null && ID.Length > 0)
- hLink.ID = ID;
- hLink.Target = Target;
- hLink.AccessKey = AccessKey;
- hLink.Enabled = Enabled;
- hLink.TabIndex = TabIndex;
- if (navigateUrl != null && navigateUrl.Length != 0)
- hLink.NavigateUrl = ResolveAdUrl (navigateUrl);
- hLink.RenderBeginTag(writer);
- if(ControlStyleCreated)
- {
- adImage.ApplyStyle(ControlStyle);
- }
- if(imageUrl!=null && imageUrl.Length > 0)
- adImage.ImageUrl = ResolveAdUrl(imageUrl);
- adImage.AlternateText = alternateText;
- adImage.ToolTip = ToolTip;
- adImage.RenderControl(writer);
- hLink.RenderEndTag(writer);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
deleted file mode 100755
index a918280d3e9..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
+++ /dev/null
@@ -1,311 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BaseCompareValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- public abstract class BaseCompareValidator: BaseValidator
- {
- protected BaseCompareValidator(): base()
- {
- }
-
- public static bool CanConvert(string text, ValidationDataType type)
- {
- object o = null;
- return Convert(text, type, out o);
- }
-
- [DefaultValue(ValidationDataType.String)]
- [WebCategory("Behaviour")]
- [WebSysDescription("RangeValidator_Type")]
- public ValidationDataType Type
- {
- get
- {
- object o = ViewState["Type"];
- if(o!=null)
- return (ValidationDataType)o;
- return ValidationDataType.String;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(ValidationDataType), value))
- throw new ArgumentException();
- ViewState["Type"] = value;
- }
- }
-
- protected static int CutoffYear
- {
- get
- {
- return DateTimeFormatInfo.CurrentInfo.Calendar.TwoDigitYearMax;
- }
- }
-
- protected static int GetFullYear(int shortYear)
- {
- int century = DateTime.Today.Year - (DateTime.Today.Year % 100);
- if(century < CutoffYear)
- {
- return (shortYear + century);
- }
- return (shortYear + century - 100);
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(RenderUplevel)
- {
- writer.AddAttribute("type", PropertyConverter.EnumToString(typeof(ValidationDataType), Type));
- NumberFormatInfo currInfo = NumberFormatInfo.CurrentInfo;
- if(Type == ValidationDataType.Double)
- {
- writer.AddAttribute("decimalchar", currInfo.NumberDecimalSeparator);
- return;
- }
- if(Type == ValidationDataType.Currency)
- {
- writer.AddAttribute("decimalchar", currInfo.CurrencyDecimalSeparator);
- string grpSep = currInfo.CurrencyGroupSeparator;
- if(grpSep[0] == 0xA0)
- {
- grpSep = " ";
- }
- writer.AddAttribute("groupchar", grpSep);
- writer.AddAttribute("digits", currInfo.CurrencyDecimalDigits.ToString(NumberFormatInfo.InvariantInfo));
- return;
- }
- if(Type == ValidationDataType.Date)
- {
- writer.AddAttribute("cutoffyear", CutoffYear.ToString());
- writer.AddAttribute("century", ( DateTime.Today.Year - (DateTime.Today.Year % 100) ).ToString());
- return;
- }
- }
- }
-
- protected override bool DetermineRenderUplevel()
- {
- if(Type == ValidationDataType.Date && DateTimeFormatInfo.CurrentInfo.Calendar.GetType() != typeof(GregorianCalendar))
- {
- return false;
- }
- return base.DetermineRenderUplevel();
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- protected static bool Compare(string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type)
- {
- object left = null, right = null;
- if(!Convert(leftText, type, out left))
- {
- return false;
- }
- if(op == ValidationCompareOperator.DataTypeCheck)
- {
- return true;
- }
- if(!Convert(rightText, type, out right))
- {
- return true;
- }
- int compareResult = 0;
- switch(type)
- {
- case ValidationDataType.String:
- compareResult = ((String)left).CompareTo(right);
- break;
- case ValidationDataType.Integer:
- compareResult = ((int)left).CompareTo(right);
- break;
- case ValidationDataType.Double:
- compareResult = ((Double)left).CompareTo(right);
- break;
- case ValidationDataType.Date:
- compareResult = ((DateTime)left).CompareTo(right);
- break;
- case ValidationDataType.Currency:
- compareResult = ((Decimal)left).CompareTo(right);
- break;
- }
- switch(op)
- {
- case ValidationCompareOperator.Equal:
- return (compareResult == 0);
- case ValidationCompareOperator.NotEqual:
- return (compareResult != 0);
- case ValidationCompareOperator.GreaterThan:
- return (compareResult > 0);
- case ValidationCompareOperator.GreaterThanEqual:
- return (compareResult >= 0);
- case ValidationCompareOperator.LessThan:
- return (compareResult < 0);
- case ValidationCompareOperator.LessThanEqual:
- return (compareResult == 0);
- }
- return false;
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- protected static string GetDateElementOrder()
- {
- string pattern = DateTimeFormatInfo.CurrentInfo.ShortDatePattern;
-
- //TODO: What are the various possibilities?
- // I can think of only y*/M*/d*, d*/M*/y*, M*/d*/y*
- if(pattern.IndexOf('y') < pattern.IndexOf('M'))
- {
- return "ymd";
- }
- if(pattern.IndexOf('M') < pattern.IndexOf('d'))
- {
- return "mdy";
- }
- return "dmy";
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- protected static bool Convert(string text, ValidationDataType type, out object convertedValue)
- {
- convertedValue = null;
- try
- {
- switch(type)
- {
- case ValidationDataType.String: convertedValue = text;
- break;
- case ValidationDataType.Integer: convertedValue = Int32.Parse(text, CultureInfo.InvariantCulture);
- break;
- case ValidationDataType.Double:
- Match matchDouble = Regex.Match(text, @"^\s*([-\+])?(\d+)?(\"
- + NumberFormatInfo.CurrentInfo.NumberDecimalSeparator
- + @"(\d+))?\s*$");
- if(matchDouble.Success)
- {
- string sign = (matchDouble.Groups[1].Success ? matchDouble.Groups[1].Value : "+");
- string decPart = (matchDouble.Groups[2].Success ? matchDouble.Groups[2].Value : "0");
- string mantissa = (matchDouble.Groups[4].Success ? matchDouble.Groups[4].Value : "0");
- convertedValue = Double.Parse(sign + decPart + "." + mantissa, CultureInfo.InvariantCulture);
- }
- break;
- case ValidationDataType.Date:
- if(DateTimeFormatInfo.CurrentInfo.Calendar.GetType() != typeof(GregorianCalendar))
- {
- convertedValue = DateTime.Parse(text);
- break;
- }
- string order = GetDateElementOrder();
- int date = 0, mth = 0, year = 0;
- Match matchDate = Regex.Match(text, @"^\s*((\d{4})|(\d{2}))([\.\/-])(\d{1,2})\4(\d{1,2})\s*$");
- if(matchDate.Success && order == "ymd")
- {
- date = Int32.Parse(matchDate.Groups[6].Value, CultureInfo.InvariantCulture);
- mth = Int32.Parse(matchDate.Groups[5].Value, CultureInfo.InvariantCulture);
- year = Int32.Parse((matchDate.Groups[2].Success ? matchDate.Groups[2].Value : matchDate.Groups[3].Value), CultureInfo.InvariantCulture);
- } else
- {
- matchDate = Regex.Match(text, @"^\s*(\d{1,2})([\.\/-])(\d{1,2})\2((\d{4}|\d{2}))\s*$");
- if(matchDate.Success)
- {
- if(order == "dmy")
- {
- date = Int32.Parse(matchDate.Groups[1].Value, CultureInfo.InvariantCulture);
- mth = Int32.Parse(matchDate.Groups[3].Value, CultureInfo.InvariantCulture);
- year = Int32.Parse((matchDate.Groups[5].Success ? matchDate.Groups[5].Value : matchDate.Groups[6].Value), CultureInfo.InvariantCulture);
- }
- if(order == "mdy")
- {
- date = Int32.Parse(matchDate.Groups[3].Value, CultureInfo.InvariantCulture);
- mth = Int32.Parse(matchDate.Groups[1].Value, CultureInfo.InvariantCulture);
- year = Int32.Parse((matchDate.Groups[5].Success ? matchDate.Groups[5].Value : matchDate.Groups[6].Value), CultureInfo.InvariantCulture);
- }
- }
- }
- year = (year < 100 ? GetFullYear(year) : year);
- if(matchDate.Success && date!=0 && mth!=0 && year!=0)
- {
- convertedValue = new DateTime(year, mth, date);
- }
- break;
- case ValidationDataType.Currency:
- string decSep = NumberFormatInfo.CurrentInfo.CurrencyDecimalSeparator;
- string grpSep = NumberFormatInfo.CurrentInfo.CurrencyGroupSeparator;
- int decDig = NumberFormatInfo.CurrentInfo.CurrencyDecimalDigits;
- if(grpSep[0] == 0xA0)
- {
- grpSep = " ";
- }
- string[] patternArray = new string[5];
- patternArray[0] = "^\\s*([-\\+])?(((\\d+)\\";
- patternArray[1] = grpSep;
- patternArray[2] = @")*)(\d+)";
- if(decDig > 0)
- {
- string[] decPattern = new string[5];
- decPattern[0] = "(\\";
- decPattern[1] = decSep;
- decPattern[2] = @"(\d{1,";
- decPattern[3] = decDig.ToString(NumberFormatInfo.InvariantInfo);
- decPattern[4] = @"}))";
- patternArray[3] = String.Concat(decPattern);
-
- } else
- {
- patternArray[3] = String.Empty;
- }
- patternArray[4] = @"?\s*$";
- Match matchCurrency = Regex.Match(text, String.Concat(patternArray));
- if(matchCurrency.Success)
- {
- StringBuilder sb = new StringBuilder();
- sb.Append(matchCurrency.Groups[1]);
- CaptureCollection cc = matchCurrency.Groups[4].Captures;
- foreach(IEnumerable current in cc)
- {
- sb.Append((Capture)current);
- }
- sb.Append(matchCurrency.Groups[5]);
- if(decDig > 0)
- {
- sb.Append(".");
- sb.Append(matchCurrency.Groups[7]);
- }
- convertedValue = Decimal.Parse(sb.ToString(), CultureInfo.InvariantCulture);
- }
- break;
- }
- } catch(Exception e)
- {
- convertedValue = null;
- }
- return (convertedValue != null);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs
deleted file mode 100755
index 509d682a81c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataList.cs
+++ /dev/null
@@ -1,275 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BaseDataList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("SelectedIndexChanged")]
- [DefaultProperty("DataSource")]
- //TODO: [Designer("??")]
- public abstract class BaseDataList: WebControl
- {
- private static readonly object SelectedIndexChangedEvent = new object();
- internal static string ItemCountViewStateKey = "_!ItemCount";
-
- private DataKeyCollection dataKeys;
- private object dataSource;
-
- public BaseDataList() : base()
- {
- }
-
- public static bool IsBindableType(Type type)
- {
- if(type.IsPrimitive || type == typeof(string) || type == typeof(DateTime) || type == typeof(Decimal))
- return true;
- return false;
- }
-
- public override ControlCollection Controls
- {
- get
- {
- EnsureChildControls();
- return Controls;
- }
- }
-
- public override void DataBind()
- {
- OnDataBinding(EventArgs.Empty);
- }
-
- [WebCategory("Action")]
- [WebSysDescription("BaseDataList_OnSelectedIndexChanged")]
- public event EventHandler SelectedIndexChanged
- {
- add
- {
- Events.AddHandler(SelectedIndexChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SelectedIndexChangedEvent, value);
- }
- }
-
- [Bindable(true)]
- [DefaultValue(-1)]
- [WebCategory("Layout")]
- [WebSysDescription("BaseDataList_CellPadding")]
- public virtual int CellPadding
- {
- get
- {
- if(!ControlStyleCreated)
- return -1;
- return ((TableStyle)ControlStyle).CellPadding;
- }
- set
- {
- ((TableStyle)ControlStyle).CellPadding = value;
- }
- }
-
- [Bindable(true)]
- [DefaultValue(-1)]
- [WebCategory("Layout")]
- [WebSysDescription("BaseDataList_CellSpacing")]
- public virtual int CellSpacing
- {
- get
- {
- if(!ControlStyleCreated)
- return -1;
- return ((TableStyle)ControlStyle).CellSpacing;
- }
- set
- {
- ((TableStyle)ControlStyle).CellSpacing = value;
- }
- }
-
- [DefaultValue("")]
- [WebCategory("Data")]
- [WebSysDescription("BaseDataList_DataKeyField")]
- public virtual string DataKeyField
- {
- get
- {
- object o = ViewState["DataKeyField"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataKeyField"] = value;
- }
- }
-
- [Browsable(true)]
- //[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [WebSysDescription("BaseDataList_DataKeys")]
- public DataKeyCollection DataKeys
- {
- get
- {
- if( dataKeys==null )
- dataKeys = new DataKeyCollection(DataKeysArray);
- return dataKeys;
-
- }
- }
-
- [DefaultValue("")]
- [WebCategory("Data")]
- [WebSysDescription("BaseDataList_DataMember")]
- public string DataMember
- {
- get
- {
- object o = ViewState["DataMember"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataMember"] = value;
- }
- }
-
- [Bindable(true)]
- [DefaultValue(null)]
- //[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [WebCategory("Data")]
- [WebSysDescription("BaseDataList_DataSource")]
- public virtual object DataSource
- {
- get
- {
- return dataSource;
- }
- set
- {
- if( (value!=null) && (value is IListSource || value is IEnumerable) )
- {
- dataSource = value;
- } else
- {
- throw new ArgumentException(HttpRuntime.FormatResourceString("Invalid_DataSource_Type", ID));
- }
- }
- }
-
- [Bindable(true)]
- [DefaultValue(GridLines.Both)]
- [WebCategory("Appearance")]
- [WebSysDescription("BaseDataList_GridLines")]
- public virtual GridLines GridLines
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).GridLines;
- return GridLines.Both;
- }
- set
- {
- ((TableStyle)ControlStyle).GridLines = value;
- }
- }
-
- [Bindable(true)]
- [DefaultValue(HorizontalAlign.NotSet)]
- [WebCategory("Layout")]
- [WebSysDescription("BaseDataList_HorizontalAlign")]
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(ControlStyleCreated)
- return ((TableStyle)ControlStyle).HorizontalAlign;
- return HorizontalAlign.NotSet;
- }
- set
- {
- ((TableStyle)ControlStyle).HorizontalAlign = value;
- }
- }
-
- protected ArrayList DataKeysArray
- {
- get
- {
- object o = ViewState["DataKeys"];
- if(o == null)
- {
- o = new ArrayList();
- ViewState["DataKeys"] = o;
- }
- return (ArrayList)o;
- }
- }
-
- protected override void AddParsedSubObject(object o)
- {
- // Preventing literal controls from being added as children.
- }
-
- protected override void CreateChildControls()
- {
- Controls.Clear();
- if(ViewState[ItemCountViewStateKey]!=null)
- {
- CreateControlHierarchy(true);
- ClearChildViewState();
- }
- }
-
- protected override void OnDataBinding(EventArgs e)
- {
- base.OnDataBinding(e);
- Controls.Clear();
- ClearChildViewState();
- CreateControlHierarchy(true);
- ChildControlsCreated = true;
- TrackViewState();
- }
-
- protected virtual void OnSelectedIndexChanged(EventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[SelectedIndexChangedEvent]);
- if(eh!=null)
- eh(this, e);
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- PrepareControlHierarchy();
- base.RenderContents(writer);
- }
-
- protected abstract void PrepareControlHierarchy();
- protected abstract void CreateControlHierarchy(bool useDataSource);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
deleted file mode 100755
index a7d9d6a9bee..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
+++ /dev/null
@@ -1,395 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BaseValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 80%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultProperty("ErrorMessage")]
- //TODO: [Designer("??")]
- public abstract class BaseValidator: Label, IValidator
- {
- private bool isValid;
- private bool isPreRenderCalled;
- private bool isPropertiesChecked;
- private bool propertiesValid;
- private bool renderUplevel;
-
- protected BaseValidator() : base()
- {
- isValid = true;
- ForeColor = Color.Red;
- }
-
- public string ControlToValidate
- {
- get
- {
- object o = ViewState["ControlToValidate"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["ControlToValidate"] = value;
- }
- }
-
- public ValidatorDisplay Display
- {
- get
- {
- object o = ViewState["Display"];
- if(o != null)
- {
- return (ValidatorDisplay)o;
- }
- return ValidatorDisplay.Static;
- }
- set
- {
- if(!Enum.IsDefined(typeof(ValidatorDisplay), value))
- {
- throw new ArgumentException();
- }
- ViewState["ValidatorDisplay"] = value;
- }
- }
-
- public bool EnableClientScript
- {
- get
- {
- object o = ViewState["EnableClientScript"];
- if(o != null)
- {
- return (bool)o;
- }
- return true;
- }
- set
- {
- ViewState["EnableClientScript"] = value;
- }
- }
-
- public override bool Enabled
- {
- get
- {
- return Enabled;
- }
- set
- {
- Enabled = value;
- }
- }
-
- public string ErrorMessage
- {
- get
- {
- object o = ViewState["ErrorMessage"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["ErrorMessage"] = value;
- }
- }
-
- public override Color ForeColor
- {
- get
- {
- return ForeColor;
- }
- set
- {
- ForeColor = value;
- }
- }
-
- public bool IsValid
- {
- get
- {
- object o = ViewState["IsValid"];
- if(o != null)
- {
- return (bool)o;
- }
- return true;
- }
- set
- {
- ViewState["IsValid"] = value;
- }
- }
-
- public static PropertyDescriptor GetValidationProperty(object component)
- {
- ValidationPropertyAttribute attrib = (ValidationPropertyAttribute)((TypeDescriptor.GetAttributes(component))[typeof(ValidationPropertyAttribute)]);
- if(attrib != null && attrib.Name != null)
- {
- return (TypeDescriptor.GetProperties(component, null))[attrib.Name];
- }
- return null;
- }
-
- public void Validate()
- {
- if(!Visible || (Visible && !Enabled))
- {
- IsValid = true;
- }
- Control ctrl = Parent;
- while(ctrl != null)
- {
- if(!ctrl.Visible)
- {
- IsValid = true;
- return;
- }
- ctrl = ctrl.Parent;
- }
- isPropertiesChecked = false;
- if(!PropertiesValid)
- {
- IsValid = true;
- return;
- }
- IsValid = EvaluateIsValid();
- }
-
- protected bool PropertiesValid
- {
- get
- {
- if(!isPropertiesChecked)
- {
- propertiesValid = ControlPropertiesValid();
- isPropertiesChecked = true;
- }
- return propertiesValid;
- }
- }
-
- protected bool RenderUplevel
- {
- get
- {
- return renderUplevel;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- bool enabled = Enabled;
- if(!Enabled)
- {
- Enabled = true;
- }
- AddAttributesToRender(writer);
- if(RenderUplevel)
- {
- if(ID == null)
- {
- writer.AddAttribute("id", ClientID);
- }
- if(ControlToValidate.Length > 0)
- {
- writer.AddAttribute("controltovalidate", GetControlRenderID(ControlToValidate));
- }
- if(ErrorMessage.Length > 0)
- {
- writer.AddAttribute("errormessage", ErrorMessage, true);
- }
- if(Display == ValidatorDisplay.Static)
- {
- writer.AddAttribute("display", Enum.Format(typeof(ValidatorDisplay), Display, "G").Replace('_','-'));
- //writer.AddAttribute("display", PropertyConverter.EnumToString(typeof(ValidatorDisplay), Display));
- }
- if(!IsValid)
- {
- writer.AddAttribute("isvalid", "False");
- }
- if(!enabled)
- {
- writer.AddAttribute("enabled", "False");
- }
- }
- if(!enabled)
- {
- Enabled = false;
- }
- }
-
- [MonoTODO]
- protected void CheckControlValidationProperty(string name, string propertyName)
- {
- Control ctrl = NamingContainer.FindControl(name);
- if(ctrl == null)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Validator_control_not_found",
- name, propertyName/*, ID*/));
- }
- PropertyDescriptor pd = GetValidationProperty(ctrl);
- if(pd == null)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Validator_bad_control_type",
- name, propertyName/*, ID*/));
- }
- }
-
- protected virtual bool ControlPropertiesValid()
- {
- if(ControlToValidate.Length == 0)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Validator_control_blank", ID));
- }
- CheckControlValidationProperty(ControlToValidate, "ControlToValidate");
- return true;
- }
-
- [MonoTODO]
- protected virtual bool DetermineRenderUplevel()
- {
- Page page = Page;
- if(page == null || page.Request == null)
- {
- return false;
- }
- if(EnableClientScript)
- {
- throw new NotImplementedException();
- //TODO: I need to get the (Browser->Dom_version_major >= 4 &&
- // Brower->Ecma_script_version >= 1.2)
- }
- return false;
- }
-
- protected string GetControlRenderID(string name)
- {
- Control ctrl = FindControl(name);
- if(ctrl != null)
- {
- return ctrl.ClientID;
- }
- return String.Empty;
- }
-
- protected string GetControlValidationValue(string name)
- {
- Control ctrl = NamingContainer.FindControl(name);
- if(ctrl != null)
- {
- PropertyDescriptor pd = GetValidationProperty(ctrl);
- if(pd != null)
- {
- object item = pd.GetValue(ctrl);
- if(item is ListItem)
- {
- return ((ListItem)item).Value;
- }
- return item.ToString();
- }
- }
- return null;
- }
-
- protected override void OnInit(EventArgs e)
- {
- OnInit(e);
- Page.Validators.Add(this);
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- OnPreRender(e);
- isPreRenderCalled = true;
- isPropertiesChecked = false;
- renderUplevel = DetermineRenderUplevel();
- if(renderUplevel)
- {
- RegisterValidatorCommonScript();
- }
- }
-
- protected override void OnUnload(EventArgs e)
- {
- if(Page != null)
- {
- Page.Validators.Remove(this);
- }
- OnUnload(e);
- }
-
- [MonoTODO("What_do_I_have_to_do")]
- protected void RegisterValidatorCommonScript()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO("I_have_to_know_javascript_for_this_I_know_it_but_for_ALL_browsers_NO")]
- protected virtual void RegisterValidatorDeclaration()
- {
- throw new NotImplementedException();
- //TODO: Since I have to access document.<ClientID> and register
- // as page validator. Now this is Browser dependent :((
- }
-
- [MonoTODO("Render_ing_always_left")]
- protected override void Render(HtmlTextWriter writer)
- {
- bool valid;
- if(isPreRenderCalled)
- {
- valid = (Enabled && IsValid);
- } else
- {
- isPropertiesChecked = true;
- propertiesValid = true;
- renderUplevel = false;
- valid = true;
- }
- if(PropertiesValid)
- {
- if(Page != null)
- {
- Page.VerifyRenderingInServerForm(this);
- }
- ValidatorDisplay dis = Display;
- if(RenderUplevel)
- {
- throw new NotImplementedException();
- }
- throw new NotImplementedException();
- }
- return;
- }
-
- protected abstract bool EvaluateIsValid();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs
deleted file mode 100755
index 93c04f1f213..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BorderStyle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: BorderStyle
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum BorderStyle
- {
- NotSet,
- None,
- Dotted,
- Dashed,
- Solid,
- Double,
- Groove,
- Ridge,
- Inset,
- Outset
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs
deleted file mode 100755
index 13bcb75f8db..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BoundColumn.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: BoundColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 60%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class BoundColumn : DataGridColumn
- {
- public static readonly string thisExpr = "!";
-
- private string dataField;
- private string dataFormatString;
- private bool readOnly;
-
- private PropertyDescriptor desc;
-
- public BoundColumn(): base()
- {
- //TODO: The start work
- Initialize();
- }
-
- public override void Initialize()
- {
- base.Initialize();
- dataField = String.Empty;
- dataFormatString = String.Empty;
- readOnly = false;
- desc = null;
- }
-
- [MonoTODO]
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- //TODO: What to do?
- InitializeCell(cell, columnIndex, itemType);
-// switch(itemType)
-// {
-// case
-// }
- throw new NotImplementedException();
- }
-
- public virtual string DataField
- {
- get
- {
- return dataField;
- }
- set
- {
- dataField = value;
- }
- }
-
- public virtual string DataFormatString
- {
- get
- {
- return dataFormatString;
- }
- set
- {
- dataFormatString = value;
- }
- }
-
- public virtual bool ReadOnly
- {
- get
- {
- return readOnly;
- }
- set
- {
- readOnly = value;
- }
- }
-
- [MonoTODO]
- protected virtual string FormatDataValue(Object dataValue)
- {
- // TODO: How to extract the value from the object?
- // TODO: Then format the value. Here's a possible solution
- if(dataFormatString == null || dataFormatString.Equals(String.Empty))
- return dataValue.ToString();
- if(dataValue is DateTime)
- return ((DateTime)dataValue).ToString(dataFormatString);
- throw new NotImplementedException();
- // and so on for int, String, double..
- // something's wrong here. there must be some shorter method!
- //string val = dataValue.toString(dataFormatString);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs
deleted file mode 100755
index 64fab223fda..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Button.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Button
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("Click")]
- [DefaultProperty("Text")]
- //TODO: [Designer("??")]
- //TODO: [DataBindingHandler("??UI.Design.TextDataBindingHandler??")]
- [ToolboxData("<{0}:Button runat=\"server\" Text=\"Button\"></{0}:Button>")]
- public class Button : WebControl, IPostBackEventHandler
- {
- private static readonly object ClickEvent = new object();
- private static readonly object CommandEvent = new object();
-
- //private EventHandlerList ehList;
-
- public Button(): base(HtmlTextWriterTag.Button)
- {
- }
-
- public bool CausesValidation
- {
- get
- {
- Object cv = ViewState["CausesValidation"];
- if(cv!=null)
- return (Boolean)cv;
- return true;
- }
- set
- {
- ViewState["CausesValidation"] = value;
- }
- }
-
- public string CommandArgument
- {
- get
- {
- string ca = (string) ViewState["CommandArgument"];
- if(ca!=null)
- return ca;
- return String.Empty;
- }
- set
- {
- ViewState["CommandArgument"] = value;
- }
- }
-
- public string CommandName
- {
- get
- {
- string cn = (string)ViewState["CommandName"];
- if(cn!=null)
- return cn;
- return String.Empty;
- }
- set
- {
- ViewState["CommandName"] = value;
- }
- }
-
- public string Text
- {
- get
- {
- string text = (string)ViewState["Text"];
- if(text!=null)
- return text;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- public event EventHandler Click
- {
- add
- {
- Events.AddHandler(ClickEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ClickEvent, value);
- }
- }
-
- public event CommandEventHandler Command
- {
- add
- {
- Events.AddHandler(CommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CommandEvent, value);
- }
- }
-
- protected virtual void OnClick(EventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[ClickEvent]);
- if(eh!= null)
- eh(this,e);
- }
- }
-
- protected virtual void OnCommand(CommandEventArgs e)
- {
- if(Events != null)
- {
- EventHandler eh = (EventHandler)(Events[CommandEvent]);
- if(eh!= null)
- eh(this,e);
- }
- }
-
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- if(CausesValidation)
- {
- Page.Validate();
- OnClick(new EventArgs());
- OnCommand(new CommandEventArgs(CommandName, CommandArgument));
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Type,"submit");
- writer.AddAttribute(HtmlTextWriterAttribute.Name,base.UniqueID);
- writer.AddAttribute(HtmlTextWriterAttribute.Value,Text);
- if(Page!=null && CausesValidation && Page.Validators.Count > 0)
- {
- writer.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Onclick, Utils.GetClientValidatedEvent(Page));
- writer.AddAttribute("language", "javascript");
- }
- base.AddAttributesToRender(writer);
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- // Preventing subclasses to do anything
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs
deleted file mode 100755
index 23db52724d6..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumn.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ButtonColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ButtonColumn : DataGridColumn
- {
- private PropertyDescriptor textFieldDescriptor;
-
- public ButtonColumn(): base()
- {
- }
-
- public override void Initialize()
- {
- Initialize();
- textFieldDescriptor = null;
- }
-
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- InitializeCell(cell, columnIndex, itemType);
- if(Enum.IsDefined(typeof(ListItemType), itemType) && itemType != ListItemType.Footer)
- {
- WebControl toDisplay = null;
- if(ButtonType == ButtonColumnType.PushButton)
- {
- Button b = new Button();
- b.Text = Text;
- b.CommandName = CommandName;
- b.CausesValidation = false;
- toDisplay = b;
- } else
- {
- LinkButton lb = new LinkButton();
- lb.Text = Text;
- lb.CommandName = CommandName;
- lb.CausesValidation = false;
- toDisplay = lb;
- }
- if(DataTextField.Length > 0)
- {
- toDisplay.DataBinding += new EventHandler(OnDataBindButtonColumn);
- }
- cell.Controls.Add(toDisplay);
- }
- }
-
- private void OnDataBindButtonColumn(object sender, EventArgs e)
- {
- Control ctrl = (Control)sender;
- object item = ((DataGridItem)ctrl.NamingContainer).DataItem;
- if(textFieldDescriptor == null)
- {
- textFieldDescriptor = TypeDescriptor.GetProperties(item).Find(DataTextField, true);
- if(textFieldDescriptor == null && !DesignMode)
- throw new HttpException(HttpRuntime.FormatResourceString("Field_Not_Found", DataTextField));
- }
- string text;
- if(textFieldDescriptor != null)
- {
- text = FormatDataTextValue(textFieldDescriptor.GetValue(item));
- } else
- {
- text = "Sample_DataBound_Text";
- }
- if(ctrl is LinkButton)
- {
- ((LinkButton)ctrl).Text = text;
- }
- else
- {
- ((Button)ctrl).Text = text;
- }
- }
-
- protected virtual string FormatDataTextValue(object dataTextValue)
- {
- string retVal = null;
- if(dataTextValue != null)
- {
- if(DataTextFormatString.Length > 0)
- {
- retVal = String.Format((string)dataTextValue, DataTextFormatString);
- }
- else
- {
- retVal = dataTextValue.ToString();
- }
- }
- return retVal;
- }
-
- public virtual ButtonColumnType ButtonType
- {
- get
- {
- object o = ViewState["ButtonType"];
- if(o!=null)
- return (ButtonColumnType)o;
- return ButtonColumnType.LinkButton;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(ButtonColumnType), value))
- throw new ArgumentException();
- ViewState["ButtonType"] = value;
- }
- }
-
- public virtual string CommandName
- {
- get
- {
- string cn = (string)ViewState["CommandName"];
- if(cn!=null)
- return cn;
- return String.Empty;
- }
- set
- {
- ViewState["CommandName"] = value;
- }
- }
-
- public virtual string DataTextField
- {
- get
- {
- string dtf = (string)ViewState["DataTextField"];
- if(dtf!=null)
- return dtf;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextField"] = value;
- }
- }
-
- public virtual string DataTextFormatString
- {
- get
- {
- string dtfs = (string)ViewState["DataTextFormatString"];
- if(dtfs!=null)
- return dtfs;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextFormatString"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- string text = (string)ViewState["Text"];
- if(text!=null)
- return text;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs
deleted file mode 100755
index ed59eba315b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ButtonColumnType.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ButtonColumnType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ButtonColumnType
- {
- LinkButton,
- PushButton
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
deleted file mode 100755
index ea553cc19b8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
+++ /dev/null
@@ -1,1111 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Calendar
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 98%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Globalization;
-using System.Text;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("SelectionChanged")]
- [DefaultProperty("SelectedDate")]
- //TODO: [Designer("??")]
- //[DataBindingHandler("??")]
- public class Calendar : WebControl, IPostBackEventHandler
- {
- //
- private TableItemStyle dayHeaderStyle;
- private TableItemStyle dayStyle;
- private TableItemStyle nextPrevStyle;
- private TableItemStyle otherMonthDayStyle;
- private SelectedDatesCollection selectedDates;
- private ArrayList selectedDatesList;
- private TableItemStyle selectedDayStyle;
- private TableItemStyle selectorStyle;
- private TableItemStyle titleStyle;
- private TableItemStyle todayDayStyle;
- private TableItemStyle weekendDayStyle;
-
- private static readonly object DayRenderEvent = new object();
- private static readonly object SelectionChangedEvent = new object();
- private static readonly object VisibleMonthChangedEvent = new object();
-
- private Color defaultTextColor;
- private System.Globalization.Calendar globCal;
-
- private static int MASK_WEEKEND = (0x01 << 0);
- private static int MASK_OMONTH = (0x01 << 1);
- private static int MASK_TODAY = (0x01 << 2);
- private static int MASK_SELECTED = (0x01 << 3);
- private static int MASK_DAY = (0x01 << 4);
- private static int MASK_UNIQUE = MASK_WEEKEND | MASK_OMONTH | MASK_TODAY | MASK_SELECTED;
-
- public Calendar(): base()
- {
- //TODO: Initialization
- }
-
- public int CellPadding
- {
- get
- {
- object o = ViewState["CellPadding"];
- if(o!=null)
- return (int)o;
- return 2;
- }
- set
- {
- ViewState["CellPadding"] = value;
- }
- }
-
- public int CellSpacing
- {
- get
- {
- object o = ViewState["CellSpacing"];
- if(o!=null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value<-1)
- throw new ArgumentOutOfRangeException();
- ViewState["CellSpacing"] = value;
- }
- }
-
- public TableItemStyle DayHeaderStyle
- {
- get
- {
- if(dayHeaderStyle==null)
- dayHeaderStyle = new TableItemStyle();
- if(IsTrackingViewState)
- dayHeaderStyle.TrackViewState();
- return dayHeaderStyle;
- }
- }
-
- public DayNameFormat DayNameFormat
- {
- get
- {
- object o = ViewState["DayNameFormat"];
- if(o!=null)
- return (DayNameFormat)o;
- return DayNameFormat.Short;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(DayNameFormat),value))
- throw new ArgumentException();
- ViewState["DayNameFormat"] = value;
- }
- }
-
- public TableItemStyle DayStyle
- {
- get
- {
- if(dayStyle==null)
- dayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- dayStyle.TrackViewState();
- return dayStyle;
- }
- }
-
- public FirstDayOfWeek FirstDayOfWeek
- {
- get
- {
- object o = ViewState["FirstDayOfWeek"];
- if(o!=null)
- return (FirstDayOfWeek)o;
- return FirstDayOfWeek.Default;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(FirstDayOfWeek), value))
- throw new ArgumentException();
- ViewState["FirstDayOfWeek"] = value;
- }
- }
-
- public string NextMonthText
- {
- get
- {
- object o = ViewState["NextMonthText"];
- if(o!=null)
- return (string)o;
- return "&gt;";
- }
- set
- {
- ViewState["NextMonthText"] = value;
- }
- }
-
- public NextPrevFormat NextPrevFormat
- {
- get
- {
- object o = ViewState["NextPrevFormat"];
- if(o!=null)
- return (NextPrevFormat)o;
- return NextPrevFormat.CustomText;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(NextPrevFormat), value))
- throw new ArgumentException();
- ViewState["NextPrevFormat"] = value;
- }
- }
-
- public TableItemStyle NextPrevStyle
- {
- get
- {
- if(nextPrevStyle == null)
- nextPrevStyle = new TableItemStyle();
- if(IsTrackingViewState)
- nextPrevStyle.TrackViewState();
- return nextPrevStyle;
- }
- }
-
- public TableItemStyle OtherMonthDayStyle
- {
- get
- {
- if(otherMonthDayStyle == null)
- otherMonthDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- otherMonthDayStyle.TrackViewState();
- return otherMonthDayStyle;
- }
- }
-
- public string PrevMonthText
- {
- get
- {
- object o = ViewState["PrevMonthText"];
- if(o!=null)
- return (string)o;
- return "&lt;";
- }
- set
- {
- ViewState["PrevMonthText"] = value;
- }
- }
-
- public DateTime SelectedDate
- {
- get
- {
- if(SelectedDates.Count > 0)
- {
- return SelectedDates[0];
- }
- return DateTime.MinValue;
- }
- set
- {
- if(value == DateTime.MinValue)
- {
- SelectedDates.Clear();
- } else
- {
- SelectedDates.SelectRange(value, value);
- }
- }
- }
-
- public SelectedDatesCollection SelectedDates
- {
- get
- {
- if(selectedDates==null)
- {
- if(selectedDatesList == null)
- selectedDatesList = new ArrayList();
- selectedDates = new SelectedDatesCollection(selectedDatesList);
- }
- return selectedDates;
- }
- }
-
- public TableItemStyle SelectedDayStyle
- {
- get
- {
- if(selectedDayStyle==null)
- selectedDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- selectedDayStyle.TrackViewState();
- return selectedDayStyle;
- }
- }
-
- public CalendarSelectionMode SelectionMode
- {
- get
- {
- object o = ViewState["SelectionMode"];
- if(o!=null)
- return (CalendarSelectionMode)o;
- return CalendarSelectionMode.Day;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(CalendarSelectionMode), value))
- throw new ArgumentException();
- ViewState["SelectionMode"] = value;
- }
- }
-
- public string SelectMonthText
- {
- get
- {
- object o = ViewState["SelectMonthText"];
- if(o!=null)
- return (string)o;
- return "&gt;&gt;";
- }
- set
- {
- ViewState["SelectMonthText"] = value;
- }
- }
-
- public TableItemStyle SelectorStyle
- {
- get
- {
- if(selectorStyle==null)
- selectorStyle = new TableItemStyle();
- return selectorStyle;
- }
- }
-
- public string SelectWeekText
- {
- get
- {
- object o = ViewState["SelectWeekText"];
- if(o!=null)
- return (string)o;
- return "&gt;";
- }
- set
- {
- ViewState["SelectWeekText"] = value;
- }
- }
-
- public bool ShowDayHeader
- {
- get
- {
- object o = ViewState["ShowDayHeader"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowDayHeader"] = value;
- }
- }
-
- public bool ShowGridLines
- {
- get
- {
- object o = ViewState["ShowGridLines"];
- if(o!=null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowGridLines"] = value;
- }
- }
-
- public bool ShowNextPrevMonth
- {
- get
- {
- object o = ViewState["ShowNextPrevMonth"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowNextPrevMonth"] = value;
- }
- }
-
- public bool ShowTitle
- {
- get
- {
- object o = ViewState["ShowTitle"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowTitle"] = value;
- }
- }
-
- public TitleFormat TitleFormat
- {
- get
- {
- object o = ViewState["TitleFormat"];
- if(o!=null)
- return (TitleFormat)o;
- return TitleFormat.MonthYear;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(TitleFormat), value))
- throw new ArgumentException();
- ViewState["TitleFormat"] = value;
- }
- }
-
- public TableItemStyle TitleStyle
- {
- get
- {
- if(titleStyle==null)
- titleStyle = new TableItemStyle();
- if(IsTrackingViewState)
- titleStyle.TrackViewState();
- return titleStyle;
- }
- }
-
- public TableItemStyle TodayDayStyle
- {
- get
- {
- if(todayDayStyle==null)
- todayDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- todayDayStyle.TrackViewState();
- return todayDayStyle;
- }
- }
-
- public DateTime TodaysDate
- {
- get
- {
- object o = ViewState["TodaysDate"];
- if(o!=null)
- return (DateTime)o;
- return DateTime.Today;
- }
- set
- {
- ViewState["TodaysDate"] = value;
- }
- }
-
- public DateTime VisibleDate
- {
- get
- {
- object o = ViewState["VisibleDate"];
- if(o!=null)
- return (DateTime)o;
- return DateTime.MinValue;
- }
- set
- {
- ViewState["VisibleDate"] = value;
- }
- }
-
- public TableItemStyle WeekendDayStyle
- {
- get
- {
- if(weekendDayStyle == null)
- weekendDayStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- weekendDayStyle.TrackViewState();
- }
- return weekendDayStyle;
- }
- }
-
- public event DayRenderEventHandler DayRender
- {
- add
- {
- Events.AddHandler(DayRenderEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DayRenderEvent, value);
- }
- }
-
- public event EventHandler SelectionChanged
- {
- add
- {
- Events.AddHandler(SelectionChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SelectionChangedEvent, value);
- }
- }
-
- public event MonthChangedEventHandler VisibleMonthChanged
- {
- add
- {
- Events.AddHandler(VisibleMonthChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(VisibleMonthChangedEvent, value);
- }
- }
-
- protected virtual void OnDayRender(TableCell cell, CalendarDay day)
- {
- if(Events!=null)
- {
- DayRenderEventHandler dreh = (DayRenderEventHandler)(Events[DayRenderEvent]);
- if(dreh!=null)
- dreh(this, new DayRenderEventArgs(cell, day));
- }
- }
-
- protected virtual void OnSelectionChanged()
- {
- if(Events!=null)
- {
- EventHandler eh = (EventHandler)(Events[SelectionChangedEvent]);
- if(eh!=null)
- eh(this, new EventArgs());
- }
- }
-
- protected virtual void OnVisibleMonthChanged(DateTime newDate, DateTime prevDate)
- {
- if(Events!=null)
- {
- MonthChangedEventHandler mceh = (MonthChangedEventHandler)(Events[VisibleMonthChangedEvent]);
- if(mceh!=null)
- mceh(this, new MonthChangedEventArgs(newDate, prevDate));
- }
- }
-
- /// <remarks>
- /// See test6.aspx in Tests directory for verification
- /// </remarks>
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- globCal = DateTimeFormatInfo.CurrentInfo.Calendar;
- DateTime visDate = GetEffectiveVisibleDate();
- //FIXME: Should it be String.Compare(eventArgument, "nextMonth", false);
- if(eventArgument == "nextMonth")
- {
- VisibleDate = globCal.AddMonths(visDate, 1);
- OnVisibleMonthChanged(VisibleDate, visDate);
- return;
- }
- if(eventArgument == "prevMonth")
- {
- VisibleDate = globCal.AddMonths(visDate, -1);
- OnVisibleMonthChanged(VisibleDate, visDate);
- return;
- }
- if(eventArgument == "selectMonth")
- {
- DateTime oldDate = new DateTime(globCal.GetYear(visDate), globCal.GetMonth(visDate), 1, globCal);
- SelectRangeInternal(oldDate, globCal.AddDays(globCal.AddMonths(oldDate, 1), -1), visDate);
- return;
- }
- if(String.Compare(eventArgument, 0, "selectWeek", 0, "selectWeek".Length)==0)
- {
- int week = -1;
- try
- {
- week = Int32.Parse(eventArgument.Substring("selectWeek".Length));
- } catch(Exception e)
- {
- }
- if(week >= 0 && week <= 5)
- {
- DateTime weekStart = globCal.AddDays(GetFirstCalendarDay(visDate), week * 7);
- SelectRangeInternal(weekStart, globCal.AddDays(weekStart, 6), visDate);
- }
- return;
- }
- if(String.Compare(eventArgument, 0, "selectDay", 0, "selectDay".Length)==0)
- {
- int day = -1;
- try
- {
- day = Int32.Parse(eventArgument.Substring("selectDay".Length));
- } catch(Exception e)
- {
- }
- if(day >= 0 && day <= 42)
- {
- DateTime dayStart = globCal.AddDays(GetFirstCalendarDay(visDate), day);
- SelectRangeInternal(dayStart, dayStart, visDate);
- }
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- //TODO: Implement me
- globCal = DateTimeFormatInfo.CurrentInfo.Calendar;
- DateTime visDate = GetEffectiveVisibleDate();
- DateTime firstDate = GetFirstCalendarDay(visDate);
-
- bool isEnabled = false;
- bool isHtmlTextWriter = false;
- if(Page == null || Site == null)
- {
- isEnabled = false;
- isHtmlTextWriter = false;
- } else
- {
- isEnabled = Enabled;
- isHtmlTextWriter = (writer.GetType() != typeof(HtmlTextWriter));
- }
- defaultTextColor = ForeColor;
- if(defaultTextColor == Color.Empty)
- defaultTextColor = Color.Black;
-
- Table calTable = new Table();
- calTable.ID = ID;
- calTable.CopyBaseAttributes(this);
- if(ControlStyleCreated)
- ApplyStyle(ControlStyle);
- calTable.Width = Width;
- calTable.Height = Height;
- calTable.CellSpacing = CellSpacing;
- calTable.CellPadding = CellPadding;
-
- if(ControlStyleCreated && ControlStyle.IsSet(WebControls.Style.BORDERWIDTH) && BorderWidth != Unit.Empty)
- {
- calTable.BorderWidth = BorderWidth;
- } else
- {
- calTable.BorderWidth = Unit.Pixel(1);
- }
-
- if(ShowGridLines)
- calTable.GridLines = GridLines.Both;
- else
- calTable.GridLines = GridLines.None;
-
- calTable.RenderBeginTag(writer);
- if(ShowTitle)
- RenderTitle(writer, visDate, SelectionMode, isEnabled);
- if(ShowDayHeader)
- RenderHeader(writer, firstDate, SelectionMode, isEnabled, isHtmlTextWriter);
- RenderAllDays(writer, firstDate, visDate, SelectionMode, isEnabled, isHtmlTextWriter);
-
- calTable.RenderEndTag(writer);
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new EmptyControlCollection(this);
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(savedState!=null)
- {
- if(ViewState["_CalendarSelectedDates"] != null)
- selectedDates = (SelectedDatesCollection)ViewState["_CalendarSelectedDates"];
-
- object[] states = (object[]) savedState;
- if(states[0] != null)
- base.LoadViewState(states[0]);
- if(states[1] != null)
- DayHeaderStyle.LoadViewState(states[1]);
- if(states[2] != null)
- DayStyle.LoadViewState(states[2]);
- if(states[3] != null)
- NextPrevStyle.LoadViewState(states[3]);
- if(states[4] != null)
- OtherMonthDayStyle.LoadViewState(states[4]);
- if(states[5] != null)
- SelectedDayStyle.LoadViewState(states[5]);
- if(states[6] != null)
- SelectorStyle.LoadViewState(states[6]);
- if(states[7] != null)
- TitleStyle.LoadViewState(states[7]);
- if(states[8] != null)
- TodayDayStyle.LoadViewState(states[8]);
- if(states[9] != null)
- WeekendDayStyle.LoadViewState(states[9]);
- }
- }
-
- protected override object SaveViewState()
- {
- ViewState["_CalendarSelectedDates"] = (SelectedDates.Count > 0 ? selectedDates : null);
- object[] states = new object[11];
- states[0] = base.SaveViewState();
- states[1] = (dayHeaderStyle == null ? null : dayHeaderStyle.SaveViewState());
- states[2] = (dayStyle == null ? null : dayStyle.SaveViewState());
- states[3] = (nextPrevStyle == null ? null : nextPrevStyle.SaveViewState());
- states[4] = (otherMonthDayStyle == null ? null : otherMonthDayStyle.SaveViewState());
- states[5] = (selectedDayStyle == null ? null : selectedDayStyle.SaveViewState());
- states[6] = (selectorStyle == null ? null : selectorStyle.SaveViewState());
- states[7] = (titleStyle == null ? null : titleStyle.SaveViewState());
- states[8] = (todayDayStyle == null ? null : todayDayStyle.SaveViewState());
- states[9] = (weekendDayStyle == null ? null : weekendDayStyle.SaveViewState());
- for(int i=0; i < states.Length; i++)
- {
- if(states[i]!=null)
- return states;
- }
- return null;
- }
-
- protected override void TrackViewState()
- {
- TrackViewState();
- if(titleStyle!=null)
- {
- titleStyle.TrackViewState();
- }
- if(nextPrevStyle!=null)
- {
- nextPrevStyle.TrackViewState();
- }
- if(dayStyle!=null)
- {
- dayStyle.TrackViewState();
- }
- if(dayHeaderStyle!=null)
- {
- dayHeaderStyle.TrackViewState();
- }
- if(todayDayStyle!=null)
- {
- todayDayStyle.TrackViewState();
- }
- if(weekendDayStyle!=null)
- {
- weekendDayStyle.TrackViewState();
- }
- if(otherMonthDayStyle!=null)
- {
- otherMonthDayStyle.TrackViewState();
- }
- if(selectedDayStyle!=null)
- {
- selectedDayStyle.TrackViewState();
- }
- if(selectorStyle!=null)
- {
- selectorStyle.TrackViewState();
- }
- }
-
- [MonoTODO("RenderAllDays")]
- private void RenderAllDays(HtmlTextWriter writer, DateTime firstDay, DateTime activeDate, CalendarSelectionMode mode, bool isActive, bool isDownLevel)
- {
- /*
- TableItemStyle weeksStyle;
- Unit size;
- string weeksCellData;
- bool isWeekMode = (mode == CalendarSelectionMode.DayWeek || mode == CalendarSelectionMode.DayWeekMonth);
- if(isWeekMode)
- {
- weeksStyle = new TableItemStyle();
- weeksStyle.Width = Unit.Percentage(12);
- weeksStyle.HorizontalAlign = HorizontalAlign.Center;
- weeksStyle.CopyFrom(SelectorStyle);
- size = Unit.Percentage(14);
- if(!isDownLevel)
- weeksCellData = GetHtmlForCell(weeksCell, isActive);
- }
- bool dayRenderBool = false;
- if(GetType() != typeof(Calendar) || Events[DayRenderEvent] != null || !isDownLevel)
- dayRenderBool = true;
-
- string[] content = new string[0x01 << 4];
- int definedStyles = MASK_SELECTED;
- if(weekendStyle != null && !weekendStyle.IsEmpty)
- definedStyles |= MASK_WEEKEND;
- if(otherMonthStyle != null && !otherMonthStyle.IsEmpty)
- definedStyles |= MASK_OMONTH;
- if(todayDayStyle != null && todayDayStyle.IsEmpty)
- definedStyles |= MASK_TODAY;
- if(dayStyle != null && !dayStyle.IsEmpty)
- definedStyles |= MASK_DAY;
-
- bool selectDayBool = false;
- if(isActive && mode != CalendarSelectionMode.None)
- {
- selectDayBool = true;
- }
-
- for(int crr = 0; crr < 6; crr++)
- {
- writer.Write("<tr>");
- if(isWeekMode)
- {
- if(isDownLevel)
- {
- string cellText = GetCalendarLinkText("selectWeek" + crr.ToString(), SelectWeekText, isActive, weeksCell.ForeColor);
- weeksCell.Text = cellText;
- RenderCalendarCell(writer, weeksCell, cellText);
- } else
- {
- if(isActive)
- {
- writer.Write(String.Format(weeksCellData, "selectWeek" + crr.ToString(), SelectWeekText));
- } else
- {
- writer.Write(String.Format(weeksCellData, "selectWeek" + crr.ToString()));
- }
- }
- }
- for(int crc = 0; crc < 7; crc++)
- {
- // have to display for each day in the week.
- throw new NotImplementedException();
- }
- }
- */
- throw new NotImplementedException();
- }
-
- private int GetMask(CalendarDay day)
- {
- int retVal = MASK_DAY;
- if(day.IsSelected)
- retVal |= MASK_SELECTED;
- if(day.IsToday)
- retVal |= MASK_TODAY;
- if(day.IsOtherMonth)
- retVal |= MASK_OMONTH;
- if(day.IsWeekend)
- retVal |= MASK_WEEKEND;
- return retVal;
- }
-
- /// <remarks>
- /// Refers to the second line of the calendar, that contains a link
- /// to select whole month, and weekdays as defined by DayNameFormat
- /// </remarks>
- private void RenderHeader(HtmlTextWriter writer, DateTime firstDay, CalendarSelectionMode mode, bool isActive, bool isDownLevel)
- {
- writer.Write("<tr>");
- bool isWeekMode = (mode == CalendarSelectionMode.DayWeek || mode == CalendarSelectionMode.DayWeekMonth);
- TableCell headerCell = new TableCell();
- headerCell.HorizontalAlign = HorizontalAlign.Center;
- string selMthText = String.Empty;
- if(isWeekMode)
- {
- headerCell.ApplyStyle(SelectorStyle);
- selMthText = GetCalendarLinkText("selectMonth", SelectMonthText, SelectorStyle.ForeColor, isActive);
- } else
- {
- headerCell.ApplyStyle(DayHeaderStyle);
- }
- RenderCalendarCell(writer, headerCell, selMthText);
-
- TableCell dayHeaderCell = new TableCell();
- dayHeaderCell.HorizontalAlign = HorizontalAlign.Center;
- string content = null;
- if(!isDownLevel)
- {
- content = GetHtmlForCell(dayHeaderCell, isActive);
- }
- int dayOfWeek = (int)globCal.GetDayOfWeek(firstDay);
- DateTimeFormatInfo currDTInfo = DateTimeFormatInfo.CurrentInfo;
- for(int currDay = dayOfWeek; currDay < dayOfWeek + 7; currDay++)
- {
- DayOfWeek effDay = (DayOfWeek) Enum.ToObject(typeof(DayOfWeek),currDay % 7);
- string currDayContent = String.Empty;
- switch(DayNameFormat)
- {
- case DayNameFormat.Full: currDayContent = currDTInfo.GetDayName(effDay);
- break;
- case DayNameFormat.FirstLetter: currDayContent = currDTInfo.GetDayName(effDay).Substring(0,1);
- break;
- case DayNameFormat.FirstTwoLetters: currDayContent = currDTInfo.GetDayName(effDay).Substring(0,2);
- break;
- case DayNameFormat.Short: goto default;
- default: currDayContent = currDTInfo.GetAbbreviatedDayName(effDay);
- break;
- }
- if(isDownLevel)
- {
- RenderCalendarCell(writer, dayHeaderCell, currDayContent);
- } else
- {
- writer.Write(String.Format(content, currDayContent));
- }
- }
- writer.Write("</tr>");
- }
-
- private void RenderTitle(HtmlTextWriter writer, DateTime visibleDate, CalendarSelectionMode mode, bool isActive)
- {
- writer.Write("<tr>");
- Table innerTable = new Table();
- TableCell titleCell = new TableCell();
- bool isWeekMode = (mode == CalendarSelectionMode.DayWeek || mode == CalendarSelectionMode.DayWeekMonth);
- titleCell.ColumnSpan = (isWeekMode ? 8 : 7);
- titleCell.BackColor = Color.Silver;
-
- innerTable.GridLines = GridLines.None;
- innerTable.Width = Unit.Percentage(100);
- innerTable.CellSpacing = 0;
- ApplyTitleStyle(innerTable, titleCell, TitleStyle);
-
- innerTable.RenderBeginTag(writer);
- titleCell.RenderBeginTag(writer);
-
- writer.Write("<tr>");
- string prevContent = String.Empty;
- if(ShowNextPrevMonth)
- {
- TableCell prevCell = new TableCell();
- prevCell.Width = Unit.Percentage(15);
- prevCell.HorizontalAlign = HorizontalAlign.Left;
- if(NextPrevFormat == NextPrevFormat.CustomText)
- {
- prevContent = PrevMonthText;
- } else
- {
- int pMthInt = globCal.GetMonth(globCal.AddMonths(visibleDate, -1));
- if(NextPrevFormat == NextPrevFormat.FullMonth)
- prevContent = DateTimeFormatInfo.CurrentInfo.GetMonthName(pMthInt);
- else
- prevContent = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(pMthInt);
- }
- prevCell.ApplyStyle(NextPrevStyle);
- RenderCalendarCell(writer, prevCell, GetCalendarLinkText("prevMonth", prevContent, NextPrevStyle.ForeColor, isActive));
- }
- TableCell currCell = new TableCell();
- currCell.Width = Unit.Percentage(70);
- if(TitleStyle.HorizontalAlign == HorizontalAlign.NotSet)
- currCell.HorizontalAlign = HorizontalAlign.Center;
- else
- currCell.HorizontalAlign = TitleStyle.HorizontalAlign;
- currCell.Wrap = TitleStyle.Wrap;
- string currMonthContent = String.Empty;
- if(TitleFormat == TitleFormat.Month)
- {
- currMonthContent = visibleDate.ToString("MMMM");
- } else
- {
- string cmcFmt = DateTimeFormatInfo.CurrentInfo.YearMonthPattern;
- if(cmcFmt.IndexOf(',') >= 0)
- {
- cmcFmt = "MMMM yyyy";
- }
- currMonthContent = visibleDate.ToString(cmcFmt);
- }
- string nextContent = String.Empty;
- if(ShowNextPrevMonth)
- {
- TableCell nextCell = new TableCell();
- nextCell.Width = Unit.Percentage(15);
- nextCell.HorizontalAlign = HorizontalAlign.Left;
- if(NextPrevFormat == NextPrevFormat.CustomText)
- {
- nextContent = PrevMonthText;
- } else
- {
- int nMthInt = globCal.GetMonth(globCal.AddMonths(visibleDate, 1));
- if(NextPrevFormat == NextPrevFormat.FullMonth)
- nextContent = DateTimeFormatInfo.CurrentInfo.GetMonthName(nMthInt);
- else
- nextContent = DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(nMthInt);
- }
- nextCell.ApplyStyle(NextPrevStyle);
- RenderCalendarCell(writer, nextCell, GetCalendarLinkText("nextMonth", nextContent, NextPrevStyle.ForeColor, isActive));
- }
-
- writer.Write("</tr>");
- titleCell.RenderEndTag(writer);
- innerTable.RenderEndTag(writer);
-
- writer.Write("</tr>");
- }
-
- private void ApplyTitleStyle(Table table, TableCell cell, TableItemStyle style)
- {
- if(style.BackColor != Color.Empty)
- {
- cell.BackColor = style.BackColor;
- }
- if(style.BorderStyle != BorderStyle.NotSet)
- {
- cell.BorderStyle = style.BorderStyle;
- }
- if(style.BorderColor != Color.Empty)
- {
- cell.BorderColor = style.BorderColor;
- }
- if(style.BorderWidth != Unit.Empty)
- {
- cell.BorderWidth = style.BorderWidth;
- }
- if(style.Height != Unit.Empty)
- {
- cell.Height = style.Height;
- }
- if(style.VerticalAlign != VerticalAlign.NotSet)
- {
- cell.VerticalAlign = style.VerticalAlign;
- }
-
- if(style.ForeColor != Color.Empty)
- {
- table.ForeColor = style.ForeColor;
- } else if(ForeColor != Color.Empty)
- {
- table.ForeColor = ForeColor;
- }
-
- table.Font.CopyFrom(style.Font);
- table.Font.MergeWith(Font);
- }
-
- private void RenderCalendarCell(HtmlTextWriter writer, TableCell cell, string text)
- {
- cell.RenderBeginTag(writer);
- writer.Write(text);
- cell.RenderEndTag(writer);
- }
-
- private DateTime GetFirstCalendarDay(DateTime visibleDate)
- {
- DayOfWeek firstDay = DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek;
- if(FirstDayOfWeek != FirstDayOfWeek.Default)
- {
- firstDay = (DayOfWeek) Enum.ToObject(typeof(DayOfWeek), (int)FirstDayOfWeek);
- }
- //FIXME: is (int)(Enum) correct?
- int days = (int)globCal.GetDayOfWeek(visibleDate) - (int)firstDay;
- if(days < 0)
- {
- days += 7;
- }
- return globCal.AddDays(visibleDate, -days);
- }
-
- private DateTime GetEffectiveVisibleDate()
- {
- DateTime dt = VisibleDate;
- if(dt.Equals(DateTime.MinValue))
- {
- dt = TodaysDate;
- }
- return new DateTime(globCal.GetYear(dt), globCal.GetMonth(dt), globCal.GetDayOfMonth(dt), globCal);
- }
-
- /// <summary>
- /// Creates text to be displayed, with all attributes if to be
- /// shown as a hyperlink
- /// </summary>
- private string GetCalendarLinkText(string eventArg, string text, Color foreground, bool isLink)
- {
- if(isLink)
- {
- StringBuilder dispVal = new StringBuilder();
- dispVal.Append("<a href=\"");
- dispVal.Append(Page.GetPostBackClientHyperlink(this, eventArg));
- dispVal.Append("\" style=\"color: ");
- if(foreground.IsEmpty)
- {
- dispVal.Append(ColorTranslator.ToHtml(defaultTextColor));
- } else
- {
- dispVal.Append(ColorTranslator.ToHtml(foreground));
- }
- dispVal.Append("\">");
- dispVal.Append(text);
- dispVal.Append("</a>");
- return dispVal.ToString();
- }
- return text;
- }
-
- private string GetHtmlForCell(TableCell cell, bool showLinks)
- {
- StringWriter sw = new StringWriter();
- HtmlTextWriter htw = new HtmlTextWriter(sw);
- cell.RenderBeginTag(htw);
- if(showLinks)
- {
- htw.Write(GetCalendarLinkText("{0}", "{1}", cell.ForeColor, showLinks));
- } else
- {
- htw.Write("{0}");
- }
- cell.RenderEndTag(htw);
- return sw.ToString();
- }
-
- internal void SelectRangeInternal(DateTime fromDate, DateTime toDate, DateTime visibleDate)
- {
- TimeSpan span = fromDate - toDate;
- if(SelectedDates.Count != span.Days || SelectedDates[SelectedDates.Count - 1]!= toDate)
- {
- SelectedDates.SelectRange(fromDate, toDate);
- OnSelectionChanged();
- }
- if(globCal.GetMonth(fromDate) == globCal.GetMonth(fromDate) && globCal.GetMonth(fromDate) != globCal.GetMonth(visibleDate))
- {
- VisibleDate = new DateTime(globCal.GetYear(fromDate), globCal.GetMonth(fromDate), 1, globCal);
- OnVisibleMonthChanged(VisibleDate, visibleDate);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs
deleted file mode 100644
index bcd835c45e3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarDay.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: CalendarDay
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CalendarDay
- {
- private DateTime date;
- private bool isWeekend;
- private bool isToday;
- private bool isSelected;
- private bool isOtherMonth;
- private bool isSelectable;
- private string dayNumberText;
-
- public CalendarDay(DateTime date, bool isWeekend, bool isToday, bool isSelected, bool isOtherMonth, string dayNumberText)
- {
- this.date = date;
- this.isWeekend = isWeekend;
- this.isToday = isToday;
- this.isSelected = isSelected;
- this.isOtherMonth = isOtherMonth;
- this.dayNumberText = dayNumberText;
- }
-
- public DateTime Date
- {
- get
- {
- return date;
- }
- }
-
- public string DayNumberText
- {
- get
- {
- return dayNumberText;
- }
- }
-
- public bool IsOtherMonth
- {
- get
- {
- return isOtherMonth;
- }
- }
-
- public bool IsSelectable
- {
- get
- {
- return isSelectable;
- }
- set
- {
- isSelectable = value;
- }
- }
-
- public bool IsSelected
- {
- get
- {
- return isSelected;
- }
- }
-
- public bool IsToday
- {
- get
- {
- return isToday;
- }
- }
-
- public bool IsWeekend
- {
- get
- {
- return isWeekend;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs
deleted file mode 100755
index 54dd298f2e4..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CalendarSelectionMode.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: CalendarSelectionMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum CalendarSelectionMode
- {
- None,
- Day,
- DayWeek,
- DayWeekMonth
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
deleted file mode 100644
index d0a6ca329cd..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ /dev/null
@@ -1,557 +0,0 @@
-2002-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * WebControl.cs:
- (AddAttributesToRender): call Page.VerifyRenderingInServerForm. All
- WebControl derived classes should be rendered inside a HtmlForm.
-
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Repeater.cs: implemented CreateControlHierarchy. Fixed some event
- processing methods.
-
-2002-06-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * RadioButtonList.cs: implemented IRepeatInfoUser.RenderItem.
- * RepeatInfo.cs: implemented DoHorizontalRendering.
-
-2002-06-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Web.UI.WebControls/Repeater.cs:
- (Controls):
- (OnDataBinding): fixed stack overflow.
-
-2002-06-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * RadioButtonList.cs: implemented IRepeatInfoUser.RenderItem.
- * RepeatInfo.cs: implemented DoHorizontalRendering.
-
-2002-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * WebControl.cs:
- (CopyBaseAttributes): copy Attributes and don't throw exception.
-
-2002-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ListBox.cs: mono-stylized.
- (AddAttributesToRender): call parent class method.
-
-2002-06-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Style.cs: fixed IsEmpty and Width.
-
- * Table.cs: mono-stylized.
- (TableRowControlCollection.AddAt): fixed.
- (AddAttributesToRender): fixed.
-
- * TableCell.cs: mono-stylized.
- (.ctor): use PreventAutoID.
- (AddAttributesToRender): fixed.
- (AddParsedSubObject): fixed.
-
- * TableRow.cs: mono-stylized. Added
- ParseChildren attribute.
-
- * TableStyle.cs:
- (get_GridLine): fixed.
-
-2002-06-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Panel.cs: fixed stack overflow.
- * Unit.cs: use Int32.Parse and Single.Parse instead of Int32Converter
- and SingleConverter.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * RadioButton.cs: mono-stylized and some little fixes.
-
- * TextBox.cs: mono-stylized.
- (MaxLength): fixed typo.
-
- (AddAttributesToRender): don't render the text between the tags for
- SingleLine, use value attribute for it. Don't render the text for
- Password.
-
- (OnPreRender): don't throw exception and call base.OnPreRender.
-
- (Render): for MultiLine, render the text between the opening and
- closing tags encoded as HTML.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ImageButton.cs:
- (AddAttributesToRender): fixer another stack overflow.
-
- * WebControl.cs:
- (TagName): modified to use TagKey instead of tagKey as the property
- can be overriden.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * LinkButton.cs: mono-stylized.
- (AddParsedSubObject):
- (RenderControls): little fixes.
-
- * WebControl.cs:
- (AddAttributesToRender): fixed usage of IEnumerator.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Literal.cs: beautified.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Label.cs: beautified and fixed a couple of 'classic' bugs.
-
- * WebControl.cs: use Span as default tag when no other provided in
- constructor. That is what MS renders.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Button.cs:
- (AddAttributesToRender): fixed (classic) stack overflow.
-
- * CheckBox.cs: mono-stylized.
- (AutoPostBack): fixed stack overflow.
- (Render): fixed alignment issues. Also set the For attribute always
- for the label.
-
-2002-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * AdRotator.cs: GetData does not work as it should, but now it returns
- useful data (only the first ad in the file). Set the NavigateUrl
- property in the hyperlink if available.
-
- * HyperLink.cs: fixed constructor and a couple of stack overflows.
-
- * Image.cs: added an attribute and fixed stack overflow.
-
- * WebControl.cs:
- (RenderBeginTag): fixed.
- (TagName): don't call Enum.IsDefined twice.
-
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * WebControl.cs: added attributes PersistChildrenAttribute and
- ParseChildrenAttribute.
-
-2002-05-24 Duncan Mak <duncan@ximian.com>
-
- * DataGridItem.cs (SetItemType): Changed function signature to
- match 1.0 spec.
-
- * ListItemCollection.cs (this): Changes the visibility level of
- the indexer.
-
- * Repeater.cs (OnItemCommand):
- (OnItemCreated):
- (OnItemDataBound): Added necessary casts.
-
-2002-05-07 Duncan Mak <duncan@ximian.com>
-
- * Button.cs (AddAttributesToRender):
- * ImageButton.cs (AddAttributesToRender): Added a missing argument to the
- GetClientValidatedEvent method.
-
-2002-03-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Removed extra methods, corrected access modifiers to several
- methods.
-
-2002-03-26 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * <SeveralFiles>.cs - Added some attributes
- * FontUnitConverter.cs - Added stubs for GetStandardValues*(..)
- methods. Will complete them later. Right now, busy with
- the attributes part.
- * RepeaterItem.cs - Completed.
-
- Oh God! Mercy! I will die applying attributes. I look at the missing
- part in the class-status - daemon! Kyrie eleison!
-
-2002-03-19 Gaurav Vaish <gvaish@iitk.ac.in>
-
- Some bug fixes
-
- * AdRotator.cs - Added definition for Font.
- * BaseCompareValidator.cs - Added definition for Controls.
- * Calendar.cs - SelectMonthText definition corrected.
- * DataList.cs - Added definition for SeparatorTemplate.
- * BorderStyle.cs - Namespace correction. It belongs not to UI,
- but to UI.WebControls.
-
-2002-03-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- Finally, I have made it. Today I did a second build for the
- System.Web assembly. It compiled 195 classes today.
- I am waiting eagerly for the runtime to come up so that the objects
- may be tested to their last levels. Several of the methods are still
- under the tag of "TODO" throwing NotImplementedException. Well, I
- hope to remove them soon, but how far is this soon - even I don't
- know, though I am happy to make the build a success even before
- the vacations to come.
-
-2002-03-07 Gaurav Vaish <gvaish@iitk.ac.in>
-
- Yesterday and today I tried to do some building of the aseembly,
- but was dumped with uncoutably infinite errors. ;-)
- I have put the copies of the recent errors on my home page, want
- to have a look at them? See:
- http://mastergaurav.virtualave.net/mono/
- I don't know what to do with these errors. Oh! The buggy me! How
- will I overcome myself. Hopefully, by when my vacations over, I
- should have made a repository where the build will not fail.
-
-2002-03-05 Gaurav Vaish <gvaish@iitk.ac.in>
-
- I am now going to do a build that will include the
- System.Web.UI.WebControls namespace. Hoping that I will make it
- soon. My exams are coming near and I have to pack up soon.
-
-
-2002-03-04 Gaurav Vaish <gvaish@iitk.ac.in>
-
-Comments:
- And with this, ie, today's work, all the objects mentioned in the
- namespace appear in the implementation. But it may not be worth
- trying to go for a build because of dependence of several of the
- internal methods that may clash with already available assembly
- System.Web.
-
- Also, the classes lack possible attributes, like those informing
- about child-controls etc. But I have to first create the attribute
- classes before I attach the attributes to the classes.
-
- * CustomValidator.cs - Completed. In process realized that
- I have to complete / rejuvinate BaseValidator class.
- * BaseValidator.cs - Complete rejuvination. Completed 80%
- of the job. All that is left is Render(HtmlTextWriter),
- DetermineRenderUplevel(), RegisterValidatorCommonScript()
- RegisterValidatorDeclaration()
- * DataGridPagerStyle.cs - Completed. That adds one more missle
- in my artillery.
- * DataKeyCollection.cs - Completed. Petty small.
- * Repeater.cs - Work started off. This is a quite
- heavy class. Hooh!
- * DataGridItemEventArgs.cs,
- * DataGridShortCommandEventArgs.cs,
- * DataListItemEventArgs.cs,
- * MonthChangedEventArgs.cs,
- * RepeaterItemEventArgs.cs,
- * ServerValidateEventArgs.cs,
- * DataGridPageChangedEventArgs.cs
- - Damn, I marked them "*", while they
- did not exist.
- * Repeater.cs - Done all except for an undocumented
- method CreateControlHierarchy(bool). Though the method
- is quite clear by its name, but it will take some time
- for me to come with some material to flush in.
-
-2002-03-03 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * SelectedDatesCollection.cs - Completed.
- * PagedDataSource.cs - Completed. Pathetically nice class.
- * RegularExpressionValidator.cs
- - Completed. Ridiculously small and
- annoyinglyc crazy-driving class, basically the method
- EvaluateIsValid().
- * RangeValidator.cs - Completed.
- * DataGridColumn.cs - Completed.
- * EditCommandColumn.cs - All is complete except for the
- InitializeCell(TableCell, int, ListItemType) method.
- * DataListItem.cs - All done except for a longish method
- RenderItem(HtmlTextWriter, bool, bool)
-
-2002-03-02 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * RepeaterItemCollection.cs - Completed.
- I love *Collection classes. I am planning to make a
- program that will generate a *Collection class. It's so
- simple and the same. ;-)
- * DataGridColumnCollection.cs - Completed.
- ... except probably for *ColumnCollection classes, where
- you have to put in some more effort. Still, these class
- generation can be automated.
- * DataListItemCollection.cs - Completed.
- See, how easily, in less than a quarter of a minute, I
- completed this class - manually. Copy-Paste/Cut-Replace.
-
-2002-02-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DataGrid.cs - Following methods implemented:
- TrackViewState(), LoadViewState(object), SaveViewState(),
- On* -- The event raisers.
- OnBubbleEvent(object, EventArgs) is still incomplete.
- * DataGridItem.cs - Initial Implementation
- * DataGridItemCollection.cs - Completed.
-
-2002-02-08 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DataGrid.cs - Initial Implementation. Worked
- primarily with some properties.
-
-2002-02-07 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ListBox.cs - Completed. Implemented
- LoadPostData(string, NameValueCollection)
- * RequiredFieldValidator.cs - Completed. Pretty simple class.
-
-2002-02-06 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ListBox.cs - Implemented the following:
- RaisePostDataChangedEvent()
-
-2002-02-02 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ListBox.cs - Supports the following properties:
- BorderColor, BorderStyle, BorderWidth, Rows, SelectionMode,
- ToolTip.
- Methods:
- AddAttributesToRender(HtmlTextWriter), OnPreRender(EventArgs),
- RenderContents(HtmlTextWriter)
-
-
-2002-02-01 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TargetConverter.cs - Completed
- * TemplateColumn.cs - Completed
- * DataList.cs - Corrected the get-er methods for the
- *Style objects. Corrected the get/set-er methods for ViewState
- related objects.
- Addded support for properties:
- GridLines, HeaderStyle, HeaderTemplate, ItemStyle, ItemTemplate,
- RepeatColumns, RepeatDirection, RepeatLayout, SelectedIndex,
- SelectedItem, SelectedItemStyle, SelectedItemTemplate,
- SeparatorStyle, SeparatorItemTemplate.
- Events:
- CancelCommand, DeleteCommand, EditCommand, ItemCommand,
- ItemCreated, ItemDataBound, UpdateCommand.
- Methods:
- CreateControlStyle(), LoadViewState(object),
- SaveViewState(), TrackViewState
- Event handlers:
- OnBubbleEvent, OnCancelCommand, OnDeleteCommand,
- OnEditCommand, OnItemCommand, OnItemCreated,
- OnItemDataBound, OnUpdateCommand
- Added dummy methods for some undocumented methods:
- CreateControlHierarchy(bool), CreateItem(int, ListItemType),
- CreateItem(int, ListItemType, bool, object),
- PrepareControlHierarchy(), InitializeItem(DataListItem)
- * ListBox.cs - Started working.
-
-
-
-2002-01-31 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * RepeaterInfo.cs - Initial Implementation. Done all
- except for RepeatDirection.Vertical
- * TableStyle.cs - Completed
-
-2002-01-30 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DropDownList.cs - Completed
- * ListItemCollection.cs - Added method FindByValueInternal to
- assist in the derived classes.
- Discovered bug in FindByValue. Removed
- * UnitConverter.cs - Completed
- * PlaceHolder.cs - What can be simpler than this?
- * PlaceHolderControlBuilder.cs
- - Uh! Damn cool one.
- * RadioButtonList.cs - Initial Implementation. All is done
- except for the implementation of
- method IRepeatInfoUser.RenderItem(...)
- * ValidatedControlConverter.cs
- ^^^^^^^^^^^^^^^^^^^^^^^^^ - Looks complete. Doubtful though !!
- * ValidationSummary.cs - Initial Implementation.
- * WebColorConverter.cs - Initial Implementation
-
-2002-01-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * FontNamesConverter.cs - Completed
- * FontUnitConverter.cs - Partial Implementation
- * ListItemControlBuilder.cs - Completed
-
-2002-01-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TextBox.cs - All done except *Render* methods
- * TextBoxControlBuilder.cs - Completed
- * Xml.cs - Partial Implementation
-
-2002-01-26 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * RadioButton.cs - Completed
- * TextBox.cs - Partial Implementation
-
-2002-01-25 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Panel.cs - Completed
- * TableItemStyle.cs - Completed
-
-2002-01-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TableCellCollection.cs - Completed
- * TableRowCollection.cs - Completed
- * TableHeaderCell.cs - Completed
- * TableRow.cs - Completed
-
-2002-01-09 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * TableCellControlBuilder.cs - Completed
- * Table.cs - Completed
- * TableCell.cs - Completed
-
-2002-01-07 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * CheckBoxList.cs - Completed
- * ButtonColumn.cs - Completed
- * Button.cs - Completed
-
-2001-12-28 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * HyperLink.cs - Completed
- * Image.cs - Completed
- * ImageButton.cs - Completed
- * Label.cs - Completed
- * LabelControlBuilder.cs - Completed
- * LinkButton.cs - Completed
- * LinkButtonControlBuilder.cs - Completed
- * Literal.cs - Completed
- * LieteralControlBuilder.cs - Completed
- * FontUnit.cs - Completed
-
-
-2001-12-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Calendar.cs - Completed the functions of Render*,
- ViewStates (Track/View/Save),
- RaisePostBackEvent.
- Left: RenderAllDays (partially)
-
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Calendar.cs - Added some more functions
- * Style.cs - Completed
- * ListItem.cs - Completed
- * ListItemCollection.cs - Completed
-
- Made the first successful build of System.Web.dll that included
- System.Web.UI.WebControls!
-
-2001-12-20 Gaurav Vaish <gvaish@iitk.ac.in>
-
- FontInfo.cs - Complete revamp. Completed
-
-2001-12-19 Gaurav Vaish <gvaish@iitk.ac.in>
-
- ListItemCollection.cs - Completed
- ListItem.cs - Initial Implementation
- Style.cs - Initial Implementation
-
- Right now I am in a total mood to do a successful build. Creating so many
- classes, completing classes in System.Web System.Web.UI namespaces.
-
-2001-12-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- TODO - Properly added
- CheckBox.cs - Completed
- BaseDataList.cs - Completed
- DayRenderEventArgs.cs - Completed
- RepeaterItem.cs - Initial implementation
-
-2001-12-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- BaseCompareValidator.cs - Completed
- AdRotator.cs - Completed
-
-2001-12-15 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CommandEventArgs.cs - Completed
- DataGridCommandEventArgs.cs - Completed
- RepeaterCommandEventArgs.cs - Completed
- DataListCommandEventArgs.cs - Completed
- CompareValidator.cs - Partial Implementation
-
-2001-12-02 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CheckBoxList.cs - Partial Implementation.
- All except "Render"
-
-2001-12-01 Gaurav Vaish <gvaish@iitk.ac.in>
-
- ListControl.cs - Completed
-
-2001-11-30 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CheckBox.cs - Completed
- ListControl.cs - Initial Implementation
- CheckBoxList.cs - Started with it, but first needed
- ListControl. Left it.
-
-2001-11-29 Gaurav Vaish <gvaish@iitk.ac.in>
-
- CalendarDay.cs - Making a note that this
- has been implemented
- Calendar.cs - Making a note that have made some changes.
- Unimplmented functions throw
- NotImplementedException
- CheckBox.cs - Can now "Render" and "LoadPostData"
-
-
-2001-11-08 Gaurav Vaish <gvaish@iitk.ac.in>
- WebControl.cs - Total Revamp, Partial Implementation
- AdRotator.cs - Able to load files
- AdCreatedEventArgs.cs - Implemented
-
-2001-11-05 Gaurav Vaish <gvaish@iitk.ac.in>
- Calendar.cs - Initial Implementation
- ButtonColumn.cs - Initial Implementation
- Button.cs - Initial Implementation
- BoundColumn.cs - Initial Implementation
- BaseCompareValidator.cs - Minor Changes
- DataList.cs, BaseValidator.cs, BaseDataList.cs
- - Added more functions, other changes
-
-2001-10-28 Gaurav Vaish <gvaish@iitk.ac.in>
- WebControl.cs - Initial Implementation
- DataList.cs - Initial Implementation
- BaseValidator.cs - Initial Implementation
- BaseDataList.cs - Initial Implementation
-
-2001-10-27 Gaurav Vaish <gvaish@iitk.ac.in>
-
- AdCreatedEventArgs.cs - Initial Implementation
- AdCratedEventHandler.cs - Implemented
- AdRotator.cs - Initial Implementation
- BorderStyle.cs - Implemented
- ButtonColumnStyle.cs - Implemented
- CalendarSelectionMode.cs - Implemented
- DayNameFormat.cs - Implemented
- FirstDayOfWeek - Implemented
- FontInfo.cs - Partial Implementation
- FontSize.cs - Implemented
- GridLines.cs - Implemented
- HorizontalAlign.cs - Implemented
- HyperLink.cs - Initial Implementation
- ImageAlign.cs - Implemented
- IRepeatInfoUser.cs - Implemented
- ListItemType.cs - Implemented
- ListSelectionMode.cs - Implemented
- NextPrevFormat.cs - Implemented
- PagerMode.cs - Implemented
- PagerPosition.cs - Implemented
- RepeatDirection.cs - Implemented
- RepeatLayout.cs - Implemented
- TextAlign.cs - Implemented
- TextBoxMode.cs - Implemented
- TitleFormat.cs - Implemented
- UnitType.cs - Implemented
- ValidationCompareOperator.cs
- - Implemented
- ValidationDataType.cs - Implemented
- ValidationSummaryDisplayMode.cs
- - Implemented
- ValidatorDisplay.cs - Implemented
- VerticalAlign.cs - Implemented
-
-
-
-// File Created 2001-11-13
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
deleted file mode 100644
index 70931a89d88..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: CheckBox
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- * Thanks to Leen Toelen (toelen@hotmail.com)'s classes that helped me
- * to write the contents of the function LoadPostData(...)
- */
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("CheckedChanged")]
- [DefaultProperty("Text")]
- //[DataBindingHanlder("??")]
- //[Designer("??")]
- public class CheckBox : WebControl, IPostBackDataHandler
- {
- private static readonly object CheckedChangedEvent = new object();
-
- public CheckBox(): base(HtmlTextWriterTag.Input)
- {
- }
-
- public virtual bool AutoPostBack
- {
- get {
- object o = ViewState ["AutoPostBack"];
- return (o == null) ? false : (bool) o;
- }
-
- set { ViewState ["AutoPostBack"] = value; }
- }
-
- public virtual bool Checked
- {
- get {
- object o = ViewState ["Checked"];
- return (o == null) ? false : (bool) o;
- }
-
- set { ViewState ["Checked"] = value; }
- }
-
- public virtual string Text
- {
- get {
- object o = ViewState ["Text"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["Text"] = value; }
- }
-
- private bool SaveCheckedViewState
- {
- get {
- if (Events [CheckedChangedEvent] != null){
- if (!Enabled)
- return true;
-
- Type type = GetType ();
- if (type == typeof (CheckBox))
- return false;
-
- if (type == typeof (RadioButton))
- return false;
- }
- return true;
- }
- }
-
- public virtual TextAlign TextAlign
- {
- get {
- object o = ViewState ["TextAlign"];
- return (o == null) ? TextAlign.Right : (TextAlign) o;
- }
-
- set {
- if (!System.Enum.IsDefined (typeof (TextAlign), value))
- throw new ArgumentException ();
- ViewState ["TextAlign"] = value;
- }
- }
-
- public event EventHandler CheckedChanged
- {
- add { Events.AddHandler (CheckedChangedEvent, value); }
- remove { Events.RemoveHandler (CheckedChangedEvent, value); }
- }
-
- protected virtual void OnCheckedChanged(EventArgs e)
- {
- if(Events != null){
- EventHandler eh = (EventHandler) (Events [CheckedChangedEvent]);
- if(eh != null)
- eh (this, e);
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- if (Page != null && Enabled)
- Page.RegisterRequiresPostBack (this);
-
- if (SaveCheckedViewState)
- ViewState.SetItemDirty ("checked", false);
- }
-
- protected override void Render (HtmlTextWriter writer)
- {
- bool hasBeginRendering = false;
- if(ControlStyleCreated && !ControlStyle.IsEmpty){
- hasBeginRendering = true;
- ControlStyle.AddAttributesToRender (writer, this);
- }
-
- if (!Enabled){
- hasBeginRendering = true;
- writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled");
- }
-
- if (ToolTip.Length > 0){
- hasBeginRendering = true;
- writer.AddAttribute (HtmlTextWriterAttribute.Title, ToolTip);
- }
-
- if (Attributes.Count > 0){
- string val = Attributes ["value"];
- Attributes.Remove ("value");
- if (Attributes.Count > 0){
- hasBeginRendering = true;
- Attributes.AddAttributes (writer);
- }
-
- if (val != null)
- Attributes ["value"] = val;
- }
-
- if (hasBeginRendering)
- writer.RenderBeginTag (HtmlTextWriterTag.Span);
-
- if (Text.Length > 0){
- TextAlign ta = TextAlign;
- if(ta == TextAlign.Right)
- RenderInputTag (writer, ClientID);
- writer.AddAttribute (HtmlTextWriterAttribute.For, ClientID);
- writer.RenderBeginTag (HtmlTextWriterTag.Label);
- writer.Write (Text);
- writer.RenderEndTag ();
- if(ta == TextAlign.Left)
- RenderInputTag (writer, ClientID);
- }
- else
- RenderInputTag (writer, ClientID);
-
- if (hasBeginRendering)
- writer.RenderEndTag ();
- }
-
- internal virtual void RenderInputTag (HtmlTextWriter writer, string clientId)
- {
- writer.AddAttribute (HtmlTextWriterAttribute.Id, clientId);
- writer.AddAttribute( HtmlTextWriterAttribute.Type, "checkbox");
- writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
- if (Checked)
- writer.AddAttribute (HtmlTextWriterAttribute.Checked, "checked");
-
- if (AutoPostBack){
- writer.AddAttribute (HtmlTextWriterAttribute.Onclick,
- Page.GetPostBackClientEvent (this, String.Empty));
- writer.AddAttribute ("language", "javascript");
- }
-
- if (AccessKey.Length > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Accesskey, AccessKey);
-
- if (TabIndex != 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Tabindex,
- TabIndex.ToString (NumberFormatInfo.InvariantInfo));
-
- writer.RenderBeginTag (HtmlTextWriterTag.Input);
- writer.RenderEndTag ();
- }
-
- bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
- {
- string postedVal = postCollection [postDataKey];
- bool postChecked = false;
- if(postedVal != null)
- postChecked = postedVal.Length > 0;
- Checked = postChecked;
- return (postChecked == false);
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnCheckedChanged (EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
deleted file mode 100644
index 58754a0af78..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: CheckBoxList
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Contact: <gvaish@iitk.ac.in>
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CheckBoxList: ListControl, IRepeatInfoUser, INamingContainer, IPostBackDataHandler
- {
- CheckBox checkBoxRepeater;
- bool isChangeNotified;
-
- public CheckBoxList()
- {
- checkBoxRepeater = new CheckBox();
- checkBoxRepeater.ID = "0";
- checkBoxRepeater.EnableViewState = false;
- checkBoxRepeater.Controls.Add(this);
- isChangeNotified = false;
- }
-
- public virtual int CellPadding
- {
- get
- {
- return (ControlStyleCreated ? ((TableStyle)ControlStyle).CellPadding : -1);
- }
- set
- {
- ((TableStyle)ControlStyle).CellPadding = value;
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- return (ControlStyleCreated ? ((TableStyle)ControlStyle).CellSpacing : -1);
- }
- set
- {
- ((TableStyle)ControlStyle).CellSpacing = value;
- }
- }
-
- public virtual int RepeatColumns
- {
- get
- {
- object o = ViewState["RepeatColumns"];
- if(o!=null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException();
- ViewState["RepeatColumns"] = value;
- }
- }
-
- public virtual RepeatDirection RepeatDirection
- {
- get
- {
- object o = ViewState["RepeatDirection"];
- if(o!=null)
- return (RepeatDirection)o;
- return RepeatDirection.Vertical;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(RepeatDirection),value))
- throw new ArgumentException();
- ViewState["RepeatDirection"] = value;
- }
- }
-
- public virtual RepeatLayout RepeatLayout
- {
- get
- {
- object o = ViewState["RepeatLayout"];
- if(o!=null)
- return (RepeatLayout)o;
- return RepeatLayout.Table;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- ViewState["RepeatLayout"] = value;
- }
- }
-
- public virtual TextAlign TextAlign
- {
- get
- {
- object o = ViewState["TextAlign"];
- if(o!=null)
- return (TextAlign)o;
- return TextAlign.Right;
- }
- set
- {
- if(!Enum.IsDefined(typeof(TextAlign), value))
- throw new ArgumentException();
- ViewState["TextAlign"] = value;
- }
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableStyle(ViewState);
- }
-
- protected override Control FindControl(string id, int pathOffset)
- {
- return this;
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- checkBoxRepeater.AutoPostBack = AutoPostBack;
- if(Page!=null)
- {
- for(int i=0; i < Items.Count; i++)
- {
- if(Items[i].Selected)
- {
- checkBoxRepeater.ID = i.ToString(NumberFormatInfo.InvariantInfo);
- Page.RegisterRequiresPostBack(checkBoxRepeater);
- }
- }
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- RepeatInfo ri = new RepeatInfo();
- checkBoxRepeater.TabIndex = TabIndex;
- bool dirtyFlag = false;
- short tTabIndex = TabIndex;
- Style s = (ControlStyleCreated ? ControlStyle : null);
- if(TabIndex > 0)
- {
- if(!ViewState.IsItemDirty("TabIndex"))
- dirtyFlag = true;
- TabIndex = 0;
- }
- ri.RepeatColumns = RepeatColumns;
- ri.RepeatLayout = RepeatLayout;
- ri.RepeatDirection = RepeatDirection;
- ri.RenderRepeater(writer, this, s, this);
- if(tTabIndex > 0)
- {
- TabIndex = tTabIndex;
- }
- if(dirtyFlag)
- {
- ViewState.SetItemDirty("TabIndex", false);
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- int index = Int32.Parse(postDataKey.Substring(UniqueID.Length + 1));
- if(index >= 0 && index < Items.Count)
- {
- bool exists = (postCollection[postDataKey]!=null);
- if(Items[index].Selected != exists)
- {
- Items[index].Selected = exists;
- if(!isChangeNotified)
- {
- isChangeNotified = true;
- return true;
- }
- }
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnSelectedIndexChanged(EventArgs.Empty);
- }
-
- bool IRepeatInfoUser.HasFooter
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasHeader
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasSeparators
- {
- get
- {
- return false;
- }
- }
-
- int IRepeatInfoUser.RepeatedItemCount
- {
- get
- {
- return Items.Count;
- }
- }
-
- Style IRepeatInfoUser.GetItemStyle(ListItemType itemType, int repeatIndex)
- {
- return null;
- }
-
- void IRepeatInfoUser.RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
- {
- checkBoxRepeater.ID = repeatIndex.ToString(NumberFormatInfo.InvariantInfo);
- checkBoxRepeater.Text = Items[repeatIndex].Text;
- checkBoxRepeater.TextAlign = TextAlign;
- checkBoxRepeater.Checked = Items[repeatIndex].Selected;
- checkBoxRepeater.RenderControl(writer);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs
deleted file mode 100644
index 145280eb7e3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventArgs.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: CommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class CommandEventArgs : EventArgs
- {
- private string cmdName;
- private object cmdArg;
-
- public CommandEventArgs(CommandEventArgs e) : this(e.CommandName, e.CommandArgument)
- {
- }
-
- public CommandEventArgs(string commandName, object argument)
- {
- cmdName = commandName;
- cmdArg = argument;
- }
-
- public string CommandName
- {
- get
- {
- return cmdName;
- }
- }
-
- public object CommandArgument
- {
- get
- {
- return cmdArg;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs
deleted file mode 100644
index e806b1e952c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CommandEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: CommandEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void CommandEventHandler(object sender, CommandEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs
deleted file mode 100644
index 46b4a18198a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CompareValidator.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: CompareValidator
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 80%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxData("<{0}:CompareValidator runat=\"server\""
- + "ErrorMessage=\"CompareValidator\"></{0}:CompareValidator>")]
- public class CompareValidator: BaseCompareValidator
- {
- public CompareValidator()
- {
- // Intitalize();
- }
-
- public string ControlToCompare
- {
- get
- {
- object o = ViewState["ControlToCompare"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
-
- set
- {
- ViewState["ControlToCompare"] = value;
- }
- }
-
- public ValidationCompareOperator Operator
- {
- get
- {
- object o = ViewState["Operator"];
- if(o!=null)
- return (ValidationCompareOperator)o;
- return ValidationCompareOperator.Equal;
- }
- set
- {
- if(!System.Enum.IsDefined(typeof(ValidationCompareOperator), value))
- throw new ArgumentException();
- ViewState["Operator"] = value;
- }
- }
-
- public string ValueToCompare
- {
- get
- {
- object o = ViewState["ValueToCompare"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ValueToCompare"] = value;
- }
- }
-
- [MonoTODO]
- protected override bool EvaluateIsValid()
- {
- string ctrl = GetControlValidationValue(ControlToValidate);
- throw new NotImplementedException();
- if(ctrl!=null && ctrl.Length > 0)
- {
- //string
- throw new NotImplementedException();
- }
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs
deleted file mode 100644
index 192cab3bcad..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CustomValidator.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: CustomValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("ServerValidate")]
- [ToolboxData("<{0}:CustomValidator runat=\"server\""
- + "ErrorMessage=\"CustomValidator\">"
- + "</{0}:CustomValidator>")]
- public class CustomValidator : BaseValidator
- {
- private static readonly object ServerValidateEvent = new object();
-
- public CustomValidator()
- {
- }
-
- public string ClientValidationFunction
- {
- get
- {
- object o = ViewState["ClientValidationFunction"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["ClientValidationFunction"] = value;
- }
- }
-
- public event ServerValidateEventHandler ServerValidate
- {
- add
- {
- Events.AddHandler(ServerValidateEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ServerValidateEvent, value);
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(RenderUplevel)
- {
- writer.AddAttribute("evaluationfunction", "CustomValidatorEvaluateIsValid");
- if(ClientValidationFunction.Length > 0)
- {
- writer.AddAttribute("clientvalidationfunction", ClientValidationFunction);
- }
- }
- }
-
- protected override bool ControlPropertiesValid()
- {
- if(ControlToValidate.Length > 0)
- {
- CheckControlValidationProperty(ControlToValidate, "ControlToValidate");
- }
- return true;
- }
-
- protected virtual bool OnServerValidate(string value)
- {
- if(Events != null)
- {
- ServerValidateEventHandler sveh = (ServerValidateEventHandler)(Events[ServerValidateEvent]);
- if(sveh != null)
- {
- ServerValidateEventArgs args = new ServerValidateEventArgs(value, true);
- sveh(this, args);
- return args.IsValid;
- }
- }
- return true;
- }
-
- protected override bool EvaluateIsValid()
- {
- string ctrl = ControlToValidate;
- if(ctrl.Length > 0)
- {
- ctrl = GetControlValidationValue(ctrl);
- if(ctrl== null || ctrl.Length == 0)
- {
- return true;
- }
- }
- return OnServerValidate(ctrl);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs
deleted file mode 100644
index c9da59e129a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs
+++ /dev/null
@@ -1,776 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGrid
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- //TODO: [Designer("??")]
- //TODO: [Editor("??")]
- public class DataGrid : BaseDataList, INamingContainer
- {
- public const string CancelCommandName = "Cancel";
- public const string DeleteCommandName = "Delete";
- public const string EditCommandName = "Edit";
- public const string NextPageCommandArgument = "Next";
- public const string PageCommandName = "Page";
- public const string PrevPageCommandArgument = "Prev";
- public const string SelectCommandName = "Select";
- public const string SortCommandName = "Sort";
- public const string UpdateCommandName = "Update";
-
- private TableItemStyle alternatingItemStyle;
- private TableItemStyle editItemStyle;
- private TableItemStyle headerStyle;
- private TableItemStyle footerStyle;
- private TableItemStyle itemStyle;
- private TableItemStyle selectedItemStyle;
- private DataGridPagerStyle pagerStyle;
-
- private DataGridColumnCollection columns;
- private ArrayList columnsArrayList;
- private DataGridItemCollection items;
- private ArrayList itemsArrayList;
- private PagedDataSource pagedDataSource;
-
- private static readonly object CancelCommandEvent = new object();
- private static readonly object DeleteCommandEvent = new object();
- private static readonly object EditCommandEvent = new object();
- private static readonly object ItemCommandEvent = new object();
- private static readonly object ItemCreatedEvent = new object();
- private static readonly object ItemDataBoundEvent = new object();
- private static readonly object PageIndexChangedEvent = new object();
- private static readonly object SortCommandEvent = new object();
- private static readonly object UpdateCommandEvent = new object();
-
- public DataGrid(): base()
- {
- }
-
- public virtual bool AllowCustomPaging
- {
- get
- {
- object o = ViewState["AllowCustomPaging"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AllowCustomPaging"] = value;
- }
- }
-
- public virtual bool AllowPaging
- {
- get
- {
- object o = ViewState["AllowPaging"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AllowPaging"] = value;
- }
- }
-
- public virtual bool AllowSorting
- {
- get
- {
- object o = ViewState["AllowSorting"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AllowSorting"] = value;
- }
- }
-
- public virtual TableItemStyle AlternatingItemStyle
- {
- get
- {
- if(alternatingItemStyle == null)
- {
- alternatingItemStyle = new TableItemStyle();
- }
- if(IsTrackingViewState)
- {
- alternatingItemStyle.TrackViewState();
- }
- return alternatingItemStyle;
- }
- }
-
- public virtual bool AutoGenerateColumns
- {
- get
- {
- object o = ViewState["AutoGenerateColumns"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AutoGenerateColumns"] = value;
- }
- }
-
- public virtual string BackImageUrl
- {
- get
- {
- object o = ViewState["BackImageUrl"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["BackImageUrl"] = value;
- }
- }
-
- public virtual DataGridColumnCollection Columns
- {
- get
- {
- if(columns == null)
- {
- columnsArrayList = new ArrayList();
- columns = new DataGridColumnCollection(this, columnsArrayList);
- if(IsTrackingViewState)
- {
- ((IStateManager)columns).TrackViewState();
- }
- }
- return columns;
- }
- }
-
- public int CurrentPageIndex
- {
- get
- {
- object o = ViewState["CurrentPageIndex"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException();
- ViewState["CurrentPageIndex"] = value;
- }
- }
-
- public virtual int EditItemIndex
- {
- get
- {
- object o = ViewState["EditItemIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- if(value < -1)
- throw new ArgumentOutOfRangeException();
- ViewState["EditItemIndex"] = value;
- }
- }
-
- public virtual TableItemStyle EditItemStyle
- {
- get
- {
- if(editItemStyle == null)
- {
- editItemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- editItemStyle.TrackViewState();
- }
- }
- return editItemStyle;
- }
- }
-
- public virtual TableItemStyle FooterStyle
- {
- get
- {
- if(footerStyle == null)
- {
- footerStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- footerStyle.TrackViewState();
- }
- }
- return footerStyle;
- }
- }
-
- public virtual TableItemStyle HeaderStyle
- {
- get
- {
- if(headerStyle == null)
- {
- headerStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- headerStyle.TrackViewState();
- }
- }
- return headerStyle;
- }
- }
-
- public virtual DataGridItemCollection Items
- {
- get
- {
- if(items == null)
- {
- if(itemsArrayList == null)
- EnsureChildControls();
- if(itemsArrayList == null)
- {
- itemsArrayList = new ArrayList();
- }
- items = new DataGridItemCollection(itemsArrayList);
- }
- return items;
- }
- }
-
- public virtual TableItemStyle ItemStyle
- {
- get
- {
- if(itemStyle == null)
- {
- itemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- itemStyle.TrackViewState();
- }
- }
- return itemStyle;
- }
- }
-
- public int PageCount
- {
- get
- {
- if(pagedDataSource != null)
- {
- return pagedDataSource.PageCount;
- }
- object o = ViewState["PageCount"];
- if(o != null)
- return (int)o;
- return 0;
- }
- }
-
- public virtual DataGridPagerStyle PagerStyle
- {
- get
- {
- if(pagerStyle == null)
- {
- pagerStyle = new DataGridPagerStyle(this);
- if(IsTrackingViewState)
- {
- pagerStyle.TrackViewState();
- }
- }
- return pagerStyle;
- }
- }
-
- public virtual int PageSize
- {
- get
- {
- object o = ViewState["PageSize"];
- if(o != null)
- return (int)o;
- return 10;
- }
- set
- {
- if(value < 1)
- throw new ArgumentOutOfRangeException();
- ViewState["PageSize"] = value;
- }
- }
-
- public virtual int SelectedIndex
- {
- get
- {
- object o = ViewState["SelectedIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- if(value < -1)
- throw new ArgumentOutOfRangeException();
- int prevVal = SelectedIndex;
- ViewState["SelectedIndex"] = value;
- if(items != null)
- {
- if(prevVal !=-1 && prevVal < items.Count)
- {
- DataGridItem prev = (DataGridItem)items[prevVal];
- if(prev.ItemType != ListItemType.EditItem)
- {
- ListItemType newType = ListItemType.Item;
- if( (prevVal % 2) != 0)
- {
- newType = ListItemType.AlternatingItem;
- }
- prev.SetItemType(newType);
- }
- }
- }
- }
- }
-
- public virtual DataGridItem SelectedItem
- {
- get
- {
- if(SelectedIndex == -1)
- return null;
- return Items[SelectedIndex];
- }
- }
-
- public virtual TableItemStyle SelectedItemStyle
- {
- get
- {
- if(selectedItemStyle == null)
- {
- selectedItemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- selectedItemStyle.TrackViewState();
- }
- }
- return selectedItemStyle;
- }
- }
-
- public virtual bool ShowFooter
- {
- get
- {
- object o = ViewState["ShowFooter"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowFooter"] = value;
- }
- }
-
- public virtual bool ShowHeader
- {
- get
- {
- object o = ViewState["ShowHeader"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowHeader"] = value;
- }
- }
-
- public virtual int VirtualItemCount
- {
- get
- {
- object o = ViewState["VirtualItemCount"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException();
- ViewState["VirtualItemCount"] = value;
- }
- }
-
- public event DataGridCommandEventHandler CancelCommand
- {
- add
- {
- Events.AddHandler(CancelCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CancelCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler DeleteCommand
- {
- add
- {
- Events.AddHandler(DeleteCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DeleteCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler EditCommand
- {
- add
- {
- Events.AddHandler(EditCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(EditCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler ItemCommand
- {
- add
- {
- Events.AddHandler(ItemCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler ItemCreated
- {
- add
- {
- Events.AddHandler(ItemCreatedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCreatedEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler ItemDataBound
- {
- add
- {
- Events.AddHandler(ItemDataBoundEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemDataBoundEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler PageIndexChanged
- {
- add
- {
- Events.AddHandler(PageIndexChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(PageIndexChangedEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler SortCommand
- {
- add
- {
- Events.AddHandler(SortCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SortCommandEvent, value);
- }
- }
-
- public event DataGridCommandEventHandler UpdateCommand
- {
- add
- {
- Events.AddHandler(UpdateCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(UpdateCommandEvent, value);
- }
- }
-
- protected override Style CreateControlStyle()
- {
- TableStyle style = new TableStyle(ViewState);
- style.GridLines = GridLines.Both;
- style.CellSpacing = 0;
- return style;
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(savedState != null)
- {
- object[] states = (object[])savedState;
- if(states != null)
- {
- LoadViewState(states[0]);
- if(columns != null)
- ((IStateManager)columns).LoadViewState(states[1]);
- if(pagerStyle != null)
- pagerStyle.LoadViewState(states[2]);
- if(headerStyle != null)
- headerStyle.LoadViewState(states[3]);
- if(footerStyle != null)
- footerStyle.LoadViewState(states[4]);
- if(itemStyle != null)
- itemStyle.LoadViewState(states[5]);
- if(alternatingItemStyle != null)
- alternatingItemStyle.LoadViewState(states[6]);
- if(selectedItemStyle != null)
- selectedItemStyle.LoadViewState(states[7]);
- if(editItemStyle != null)
- editItemStyle.LoadViewState(states[8]);
- }
- }
- }
-
- protected override object SaveViewState()
- {
- object[] states = new object[9];
- states[0] = SaveViewState();
- states[1] = (columns == null ? null : ((IStateManager)columns).SaveViewState());
- states[2] = (pagerStyle == null ? null : pagerStyle.SaveViewState());
- states[3] = (headerStyle == null ? null : headerStyle.SaveViewState());
- states[4] = (footerStyle == null ? null : footerStyle.SaveViewState());
- states[5] = (itemStyle == null ? null : itemStyle.SaveViewState());
- states[6] = (alternatingItemStyle == null ? null : alternatingItemStyle.SaveViewState());
- states[7] = (selectedItemStyle == null ? null : selectedItemStyle.SaveViewState());
- states[8] = (editItemStyle == null ? null : editItemStyle.SaveViewState());
- return states;
- }
-
- protected override void TrackViewState()
- {
- TrackViewState();
- if(alternatingItemStyle != null)
- {
- alternatingItemStyle.TrackViewState();
- }
- if(editItemStyle != null)
- {
- editItemStyle.TrackViewState();
- }
- if(headerStyle != null)
- {
- headerStyle.TrackViewState();
- }
- if(footerStyle != null)
- {
- footerStyle.TrackViewState();
- }
- if(itemStyle != null)
- {
- itemStyle.TrackViewState();
- }
- if(selectedItemStyle != null)
- {
- selectedItemStyle.TrackViewState();
- }
- if(pagerStyle != null)
- {
- pagerStyle.TrackViewState();
- }
-
- if(columns != null)
- {
- ((IStateManager)columns).TrackViewState();
- }
- }
-
- [MonoTODO]
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- /*
- bool retVal = false;
- if(e is DataGridCommandEventArgs)
- {
- DataGridCommandEventArgs ea = (DataGridCommandEventArgs)e;
- retVal = true;
- OnItemCommand(ea);
- string cmd = ea.CommandName;
- if(cmd == "Select")
- {
- SelectedIndex = ea.Item.SelectedIndex;
- OnSelectedIndexChanged(EventArgs.Empty);
- } else if(cmd == "Page")
- {
- throw new NotImplementedException();
- // Next; Prev; Sort etc
- }
- }
- */
- throw new NotImplementedException();
- //return retVal;
- }
-
- protected virtual void OnCancelCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[CancelCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnDeleteCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[DeleteCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnEditCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[EditCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnItemCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[ItemCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnItemCreated(DataGridItemEventArgs e)
- {
- if(Events != null)
- {
- DataGridItemEventHandler dceh = (DataGridItemEventHandler)(Events[ItemCreatedEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnItemDataBound(DataGridItemEventArgs e)
- {
- if(Events != null)
- {
- DataGridItemEventHandler dceh = (DataGridItemEventHandler)(Events[ItemDataBoundEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnPageIndexChanged(DataGridPageChangedEventArgs e)
- {
- if(Events != null)
- {
- DataGridPageChangedEventHandler dceh = (DataGridPageChangedEventHandler)(Events[PageIndexChangedEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnSortCommand(DataGridSortCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridSortCommandEventHandler dceh = (DataGridSortCommandEventHandler)(Events[SortCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- protected virtual void OnUpdateCommand(DataGridCommandEventArgs e)
- {
- if(Events != null)
- {
- DataGridCommandEventHandler dceh = (DataGridCommandEventHandler)(Events[UpdateCommandEvent]);
- if(dceh != null)
- dceh(this, e);
- }
- }
-
- [MonoTODO]
- protected override void PrepareControlHierarchy()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- protected override void CreateControlHierarchy(bool useDataSource)
- {
- throw new NotImplementedException();
- }
-
- internal void OnColumnsChanged()
- {
- }
-
- internal void OnPagerChanged()
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumn.cs
deleted file mode 100644
index c0adca881d9..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumn.cs
+++ /dev/null
@@ -1,379 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- //TODO: [TypeConverter("??")]
- public class DataGridColumn : IStateManager
- {
- private StateBag viewState;
- private bool marked;
- private TableItemStyle footerStyle;
- private TableItemStyle headerStyle;
- private TableItemStyle itemStyle;
-
- private DataGrid owner;
- private bool designMode;
-
- public DataGridColumn()
- {
- viewState = new StateBag();
- }
-
- public virtual TableItemStyle FooterStyle
- {
- get
- {
- if(footerStyle == null)
- {
- footerStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- footerStyle.TrackViewState();
- }
- }
- return footerStyle;
- }
- }
-
- public virtual TableItemStyle HeaderStyle
- {
- get
- {
- if(headerStyle == null)
- {
- headerStyle= new TableItemStyle();
- if(IsTrackingViewState)
- {
- headerStyle.TrackViewState();
- }
- }
- return headerStyle;
- }
- }
-
- public virtual TableItemStyle ItemStyle
- {
- get
- {
- if(itemStyle == null)
- {
- itemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- {
- itemStyle.TrackViewState();
- }
- }
- return itemStyle;
- }
- }
-
- public virtual string FooterText
- {
- get
- {
- object o = ViewState["FooterText"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["FooterText"] = value;
- OnColumnChanged();
- }
- }
-
- public virtual string HeaderImageUrl
- {
- get
- {
- object o = ViewState["HeaderImageUrl"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["HeaderImageUrl"] = value;
- OnColumnChanged();
- }
- }
-
- public virtual string HeaderText
- {
- get
- {
- object o = ViewState["HeaderText"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["HeaderText"] = value;
- OnColumnChanged();
- }
- }
-
- public virtual string SortExpression
- {
- get
- {
- object o = ViewState["SortExpression"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["SortExpression"] = value;
- OnColumnChanged();
- }
- }
-
- public bool Visible
- {
- get
- {
- object o = ViewState["Visible"];
- if(o != null)
- {
- return (bool)o;
- }
- return true;
- }
- set
- {
- ViewState["Visible"] = value;
- OnColumnChanged();
- }
- }
-
- public virtual void Initialize()
- {
- if(owner != null && owner.Site != null)
- {
- designMode = owner.Site.DesignMode;
- }
- }
-
- public virtual void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- switch(itemType)
- {
- case ListItemType.Header : InitializeCellHeader(cell, columnIndex);
- break;
- case ListItemType.Footer : InitializeCellFooter(cell, columnIndex);
- break;
- default : return;
- }
- }
-
- private void InitializeCellHeader(TableCell cell, int columnIndex)
- {
- WebControl ctrl = null;
- bool sort = true;
- string sortExpr = "";
- ImageButton headButton;
- Image headImage;
- LinkButtonInternal link;
-
- if(owner != null)
- {
- sort = owner.AllowSorting;
- }
- if(sort)
- {
- sortExpr = SortExpression;
- if(sortExpr.Length == 0)
- {
- sort = false;
- }
- }
- if(HeaderImageUrl.Length > 0)
- {
- if(sort)
- {
- headButton = new ImageButton();
- headButton.ImageUrl = HeaderImageUrl;
- headButton.CommandName = "Sort";
- headButton.CommandArgument = sortExpr;
- headButton.CausesValidation = false;
- ctrl = headButton;
- } else
- {
- headImage = new Image();
- headImage.ImageUrl = HeaderImageUrl;
- ctrl = headImage;
- }
- } else
- {
- if(sort)
- {
- link = new LinkButtonInternal();
- link.Text = HeaderText;
- link.CommandName = "Sort";
- link.CommandArgument = sortExpr;
- link.CausesValidation = false;
- ctrl = link;
- } else
- {
- if(HeaderText.Length > 0)
- {
- cell.Text = HeaderText;
- } else
- {
- cell.Text = "&nbsp;";
- }
- }
- }
- if(ctrl != null)
- {
- cell.Controls.Add(ctrl);
- }
- }
-
- private void InitializeCellFooter(TableCell cell, int columnIndex)
- {
- cell.Text = (FooterText.Length > 0 ? FooterText : "&nbsp;");
- }
-
- public override string ToString()
- {
- return String.Empty;
- }
-
- protected bool DesignMode
- {
- get
- {
- return designMode;
- }
- }
-
- protected DataGrid Owner
- {
- get
- {
- return owner;
- }
- }
-
- protected StateBag ViewState
- {
- get
- {
- return viewState;
- }
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- protected void OnColumnChanged()
- {
- if(owner != null)
- {
- owner.OnColumnsChanged();
- }
- }
-
- protected virtual object SaveViewState()
- {
- object[] states = new object[4];
- states[0] = ViewState.SaveViewState();
- states[1] = (footerStyle == null ? null : footerStyle.SaveViewState());
- states[2] = (headerStyle == null ? null : headerStyle.SaveViewState());
- states[3] = (itemStyle == null ? null : itemStyle.SaveViewState());
- return states;
- }
-
- protected virtual void LoadViewState(object savedState)
- {
- if(savedState!= null)
- {
- object[] states = (object[]) savedState;
- if(states != null)
- {
- ViewState.LoadViewState(states[0]);
- FooterStyle.LoadViewState(states[1]);
- HeaderStyle.LoadViewState(states[2]);
- ItemStyle.LoadViewState(states[3]);
- }
- }
- }
-
- protected virtual void TrackViewState()
- {
- marked = true;
- ViewState.TrackViewState();
- if(footerStyle != null)
- {
- footerStyle.TrackViewState();
- }
- if(headerStyle != null)
- {
- headerStyle.TrackViewState();
- }
- if(itemStyle != null)
- {
- itemStyle.TrackViewState();
- }
- }
-
- protected virtual bool IsTrackingViewState
- {
- get
- {
- return marked;
- }
- }
-
- void IStateManager.LoadViewState(object savedState)
- {
- LoadViewState(savedState);
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return IsTrackingViewState;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumnCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumnCollection.cs
deleted file mode 100644
index 3fce0c04af1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridColumnCollection.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridColumnCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataGridColumnCollection : ICollection, IEnumerable, IStateManager
- {
- private DataGrid owner;
- private ArrayList columns;
- private bool trackViewState = false;
-
- public DataGridColumnCollection(DataGrid owner, ArrayList columns)
- {
- this.owner = owner;
- this.columns = columns;
- }
-
- public int Count
- {
- get
- {
- return columns.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public DataGridColumn this[int index]
- {
- get
- {
- return (DataGridColumn)(columns[index]);
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void Add(DataGridColumn column)
- {
- AddAt(-1, column);
- }
-
- public void AddAt(int index, DataGridColumn column)
- {
- if(index == -1)
- {
- columns.Add(column);
- } else
- {
- columns.Insert(index, column);
- }
- //TODO: To put. DataGridColumn class not created!
- //column->owner = owner;
- if(trackViewState)
- {
- ((IStateManager)column).TrackViewState();
- }
- OnColumnsChanged();
- }
-
- internal void OnColumnsChanged()
- {
- if(owner != null)
- {
- owner.OnColumnsChanged();
- }
- }
-
- public void Clear()
- {
- columns.Clear();
- OnColumnsChanged();
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(DataGridColumn current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return columns.GetEnumerator();
- }
-
- public int IndexOf(DataGridColumn column)
- {
- if(column != null)
- {
- return columns.IndexOf(column);
- }
- return -1;
- }
-
- public void Remove(DataGridColumn column)
- {
- if(column != null)
- {
- RemoveAt(IndexOf(column));
- }
- }
-
- public void RemoveAt(int index)
- {
- if(index >= 0 && index < columns.Count)
- {
- columns.RemoveAt(index);
- OnColumnsChanged();
- }
- //This exception is not documented, but thrown
- throw new ArgumentOutOfRangeException("string");
- }
-
- object IStateManager.SaveViewState()
- {
- ArrayList retVal = new ArrayList(columns.Count);
- foreach(DataGridColumn current in this)
- {
- retVal.Add(((IStateManager)current).SaveViewState());
- }
- return retVal;
- }
-
- void IStateManager.LoadViewState(object savedState)
- {
- if(savedState != null && savedState is ArrayList)
- {
- int currentIndex = 0;
- foreach(DataGridColumn current in (ArrayList)savedState)
- {
- ((IStateManager)columns[currentIndex ++]).LoadViewState(current);
- }
- }
- }
-
- void IStateManager.TrackViewState()
- {
- trackViewState = true;
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return trackViewState;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs
deleted file mode 100644
index e5850371123..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventArgs.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: DataGridCommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataGridCommandEventArgs : CommandEventArgs
- {
- DataGridItem dgItem;
- object cmdSrc;
-
- public DataGridCommandEventArgs(DataGridItem item, object commandSource, CommandEventArgs originalArgs): base(originalArgs)
- {
- dgItem = item;
- cmdSrc = originalArgs;
- }
-
- public object CommandSource
- {
- get
- {
- return cmdSrc;
- }
- }
-
- public DataGridItem Item
- {
- get
- {
- return dgItem;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs
deleted file mode 100644
index bd06eed39f4..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridCommandEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DataGridCommandEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridCommandEventHandler(object sender, DataGridCommandEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs
deleted file mode 100644
index 5833b0f5b3b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItem.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridItem
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataGridItem : TableRow, INamingContainer
- {
- private int itemIndex;
- private int dataSetIndex;
- private ListItemType itemType;
- private object dataItem;
-
- public DataGridItem(int itemIndex, int dataSetIndex, ListItemType itemType): base()
- {
- this.itemIndex = itemIndex;
- this.dataSetIndex = dataSetIndex;
- this.itemType = itemType;
- }
-
- public virtual object DataItem
- {
- get
- {
- return dataItem;
- }
- set
- {
- dataItem = value;
- }
- }
-
- public virtual int DataSetIndex
- {
- get
- {
- return dataSetIndex;
- }
- }
-
- public virtual int ItemIndex
- {
- get
- {
- return itemIndex;
- }
- }
-
- public virtual ListItemType ItemType
- {
- get
- {
- return itemType;
- }
- }
-
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- if(e is CommandEventArgs)
- {
- DataGridCommandEventArgs args = new DataGridCommandEventArgs(this, source, (CommandEventArgs)e);
- RaiseBubbleEvent(this, args);
- return true;
- }
- return false;
- }
-
- protected internal virtual void SetItemType(ListItemType itemType)
- {
- this.itemType = itemType;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs
deleted file mode 100644
index 8f73b541336..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemCollection.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridItemCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataGridItemCollection : ICollection, IEnumerable
- {
- private ArrayList items;
-
- public DataGridItemCollection(ArrayList items)
- {
- this.items = items;
- }
-
- public int Count
- {
- get
- {
- return items.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public DataGridItem this[int index]
- {
- get
- {
- return (DataGridItem)(items[index]);
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(DataGridItem current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return items.GetEnumerator();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventArgs.cs
deleted file mode 100644
index 4418b4cf00a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventArgs.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridItemEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataGridItemEventArgs : EventArgs
- {
- DataGridItem item;
-
- public DataGridItemEventArgs(DataGridItem item)
- {
- this.item = item;
- }
-
- public DataGridItem Item
- {
- get
- {
- return item;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs
deleted file mode 100644
index de0f92cfa30..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridItemEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DataGridItemEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridItemEventHandler(object sender, DataGridItemEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs
deleted file mode 100644
index d63ac4940f9..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridPageChangedEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataGridPageChangedEventArgs : EventArgs
- {
- private object source;
- private int npIndex;
-
- public DataGridPageChangedEventArgs(object commandSource, int newPageIndex)
- {
- source = commandSource;
- npIndex = newPageIndex;
- }
-
- public object CommandSource
- {
- get
- {
- return source;
- }
- }
-
- public int NewPageIndex
- {
- get
- {
- return npIndex;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs
deleted file mode 100644
index 83dfc6d0dde..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridPageChangedEventHandler(object sender, DataGridPageChangedEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPagerStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPagerStyle.cs
deleted file mode 100644
index 8e15bb77b79..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridPagerStyle.cs
+++ /dev/null
@@ -1,241 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridPagerStyle
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class DataGridPagerStyle : TableItemStyle
- {
- DataGrid owner;
-
- private static int MODE = (0x01 << 19);
- private static int NEXT_PG_TEXT = (0x01 << 20);
- private static int PG_BTN_COUNT = (0x01 << 21);
- private static int POSITION = (0x01 << 22);
- private static int VISIBLE = (0x01 << 23);
- private static int PREV_PG_TEXT = (0x01 << 24);
-
- internal DataGridPagerStyle(DataGrid owner): base()
- {
- this.owner = owner;
- }
-
- public PagerMode Mode
- {
- get
- {
- if(IsSet(MODE))
- {
- return (PagerMode)ViewState["Mode"];
- }
- return PagerMode.NextPrev;
- }
- set
- {
- if(!Enum.IsDefined(typeof(PagerMode), value))
- {
- throw new NotImplementedException();
- }
- ViewState["Mode"] = value;
- Set(MODE);
- }
- }
-
- public string NextPageText
- {
- get
- {
- if(IsSet(NEXT_PG_TEXT))
- {
- return (string)ViewState["NextPageText"];
- }
- return "&gt;";
- }
- set
- {
- ViewState["NextPageText"] = value;
- Set(NEXT_PG_TEXT);
- }
- }
-
- public string PrevPageText
- {
- get
- {
- if(IsSet(PREV_PG_TEXT))
- {
- return (string)ViewState["PrevPageText"];
- }
- return "&lt;";
- }
- set
- {
- ViewState["PrevPageText"] = value;
- Set(PREV_PG_TEXT);
- }
- }
-
- public int PageButtonCount
- {
- get
- {
- if(IsSet(PG_BTN_COUNT))
- {
- return (int)ViewState["PageButtonCount"];
- }
- return 10;
- }
- set
- {
- ViewState["PageButtonCount"] = value;
- Set(PG_BTN_COUNT);
- }
- }
-
- public PagerPosition Position
- {
- get
- {
- if(IsSet(POSITION))
- {
- return (PagerPosition)ViewState["Position"];
- }
- return PagerPosition.Bottom;
- }
- set
- {
- if(!Enum.IsDefined(typeof(PagerPosition), value))
- {
- throw new ArgumentException();
- }
- ViewState["Position"] = value;
- Set(POSITION);
- }
- }
-
- public bool Visible
- {
- get
- {
- if(IsSet(VISIBLE))
- {
- return (bool)ViewState["Visible"];
- }
- return true;
- }
- set
- {
- ViewState["Visible"] = value;
- Set(PG_BTN_COUNT);
- }
- }
-
- public override void CopyFrom(Style s)
- {
- if(s != null && !s.IsEmpty && s is DataGridPagerStyle)
- {
- base.CopyFrom(s);
- DataGridPagerStyle from = (DataGridPagerStyle)s;
- if(from.IsSet(MODE))
- {
- Mode = from.Mode;
- }
- if(from.IsSet(NEXT_PG_TEXT))
- {
- NextPageText = from.NextPageText;
- }
- if(from.IsSet(PG_BTN_COUNT))
- {
- PageButtonCount = from.PageButtonCount;
- }
- if(from.IsSet(POSITION))
- {
- Position = from.Position;
- }
- if(from.IsSet(VISIBLE))
- {
- Visible = from.Visible;
- }
- if(from.IsSet(PREV_PG_TEXT))
- {
- PrevPageText = from.PrevPageText;
- }
- }
- }
-
- public override void MergeWith(Style s)
- {
- if(s != null && !s.IsEmpty && s is DataGridPagerStyle)
- {
- base.MergeWith(s);
- DataGridPagerStyle with = (DataGridPagerStyle)s;
- if(with.IsSet(MODE) && !IsSet(MODE))
- {
- Mode = with.Mode;
- }
- if(with.IsSet(NEXT_PG_TEXT) && !IsSet(NEXT_PG_TEXT))
- {
- NextPageText = with.NextPageText;
- }
- if(with.IsSet(PG_BTN_COUNT) && !IsSet(PG_BTN_COUNT))
- {
- PageButtonCount = with.PageButtonCount;
- }
- if(with.IsSet(POSITION) && !IsSet(POSITION))
- {
- Position = with.Position;
- }
- if(with.IsSet(VISIBLE) && !IsSet(VISIBLE))
- {
- Visible = with.Visible;
- }
- if(with.IsSet(PREV_PG_TEXT) && !IsSet(PREV_PG_TEXT))
- {
- PrevPageText = with.PrevPageText;
- }
- }
- }
-
- public override void Reset()
- {
- if(IsSet(MODE))
- {
- ViewState.Remove("Mode");
- }
- if(IsSet(NEXT_PG_TEXT))
- {
- ViewState.Remove("NextPageText");
- }
- if(IsSet(PG_BTN_COUNT))
- {
- ViewState.Remove("PageButtonCount");
- }
- if(IsSet(POSITION))
- {
- ViewState.Remove("Position");
- }
- if(IsSet(VISIBLE))
- {
- ViewState.Remove("Visible");
- }
- if(IsSet(PREV_PG_TEXT))
- {
- ViewState.Remove("PrevPageText");
- }
- base.Reset();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs
deleted file mode 100644
index 564451fbb7a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataGridSortCommandEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataGridSortCommandEventArgs : EventArgs
- {
- private object source;
- private string sortExpr;
-
- public DataGridSortCommandEventArgs(object commandSource, DataGridCommandEventArgs dce)
- {
- source = commandSource;
- sortExpr = (string)dce.CommandArgument;
- }
-
- public object CommandSource
- {
- get
- {
- return source;
- }
- }
-
- public string SortExpression
- {
- get
- {
- return sortExpr;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs
deleted file mode 100644
index b9a1d2653b7..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataGridSortCommandEventHandler(object sender, DataGridSortCommandEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataKeyCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataKeyCollection.cs
deleted file mode 100644
index f4a010ac49b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataKeyCollection.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataKeyCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataKeyCollection : ICollection, IEnumerable
- {
- private ArrayList keys;
-
- public DataKeyCollection(ArrayList keys)
- {
- this.keys = keys;
- }
-
- public int Count
- {
- get
- {
- return keys.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public object this[int index]
- {
- get
- {
- return keys[index];
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(object current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return keys.GetEnumerator();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs
deleted file mode 100755
index 1cfda979874..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs
+++ /dev/null
@@ -1,824 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 70%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- //TODO: [Designer("??")]
- //TODO: [Editor("??")]
- public class DataList: BaseDataList, INamingContainer, IRepeatInfoUser
- {
- public const string CancelCommandName = "Cancel";
- public const string DeleteCommandName = "Delete";
- public const string EditCommandName = "Edit";
- public const string SelectCommandName = "Select";
- public const string UpdateCommandName = "Update";
-
- private static readonly object CancelCommandEvent = new object();
- private static readonly object DeleteCommandEvent = new object();
- private static readonly object EditCommandEvent = new object();
- private static readonly object ItemCommandEvent = new object();
- private static readonly object ItemCreatedEvent = new object();
- private static readonly object ItemDataBoundEvent = new object();
- private static readonly object UpdateCommandEvent = new object();
-
- private TableItemStyle alternatingItemStyle;
- private TableItemStyle editItemStyle;
- private TableItemStyle footerStyle;
- private TableItemStyle headerStyle;
- private TableItemStyle itemStyle;
- private TableItemStyle selectedItemStyle;
- private TableItemStyle separatorStyle;
-
- private ITemplate alternatingItemTemplate;
- private ITemplate editItemTemplate;
- private ITemplate footerTemplate;
- private ITemplate headerTemplate;
- private ITemplate itemTemplate;
- private ITemplate selectedItemTemplate;
- private ITemplate separatorTemplate;
- private ITemplate separatorItemTemplate;
-
- private ArrayList itemsArray;
- private DataListItemCollection items;
-
- private bool extractTemplateRows;
-
- public DataList(): base()
- {
- }
-
- public virtual TableItemStyle AlternatingItemStyle
- {
- get
- {
- if(alternatingItemStyle == null)
- {
- alternatingItemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- alternatingItemStyle.TrackViewState();
- }
- return alternatingItemStyle;
- }
- }
-
- public virtual ITemplate AlternatingItemTemplate
- {
- get
- {
- return alternatingItemTemplate;
- }
- set
- {
- alternatingItemTemplate = value;
- }
- }
-
- public virtual int EditItemIndex
- {
- get
- {
- object o = ViewState["EditItemIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- ViewState["EditItemIndex"] = value;
- }
- }
-
- public virtual TableItemStyle EditItemStyle
- {
- get
- {
- if(editItemStyle == null)
- {
- editItemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- editItemStyle.TrackViewState();
- }
- return editItemStyle;
- }
- }
-
- public virtual ITemplate EditItemTemplate
- {
- get
- {
- return editItemTemplate;
- }
- set
- {
- editItemTemplate = value;
- }
- }
-
- public virtual bool ExtractTemplateRows
- {
- get
- {
- object o = ViewState["ExtractTemplateRows"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ExtractTemplateRows"] = value;
- }
- }
-
- public virtual TableItemStyle FooterStyle
- {
- get
- {
- if(footerStyle == null)
- {
- footerStyle = new TableItemStyle();
- if(IsTrackingViewState)
- footerStyle.TrackViewState();
- }
- return footerStyle;
- }
- }
-
- public virtual ITemplate FooterTemplate
- {
- get
- {
- return footerTemplate;
- }
- set
- {
- footerTemplate = value;
- }
- }
-
- public override GridLines GridLines
- {
- get
- {
- return GridLines;
- }
- set
- {
- GridLines = value;
- }
- }
-
- public virtual TableItemStyle HeaderStyle
- {
- get
- {
- if(headerStyle == null)
- {
- headerStyle = new TableItemStyle();
- if(IsTrackingViewState)
- headerStyle.TrackViewState();
- }
- return headerStyle;
- }
- }
-
- public virtual ITemplate HeaderTemplate
- {
- get
- {
- return headerTemplate;
- }
- set
- {
- headerTemplate = value;
- }
- }
-
- public virtual DataListItemCollection Items
- {
- get
- {
- if(items == null)
- {
- if(itemsArray == null)
- {
- EnsureChildControls();
- itemsArray = new ArrayList();
- }
- items = new DataListItemCollection(itemsArray);
- }
- return items;
- }
- }
-
- public virtual TableItemStyle ItemStyle
- {
- get
- {
- if(itemStyle == null)
- {
- itemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- itemStyle.TrackViewState();
- }
- return itemStyle;
- }
- }
-
- public virtual ITemplate ItemTemplate
- {
- get
- {
- return itemTemplate;
- }
- set
- {
- itemTemplate = value;
- }
- }
-
- public virtual int RepeatColumns
- {
- get
- {
- object o = ViewState["RepeatColumns"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException("value");
- ViewState["RepeatColumns"] = value;
- }
- }
-
- public virtual RepeatDirection RepeatDirection
- {
- get
- {
- object o = ViewState["RepeatDirection"];
- if(o != null)
- return (RepeatDirection)o;
- return RepeatDirection.Vertical;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatDirection), value))
- throw new ArgumentException();
- ViewState["RepeatDirection"] = value;
- }
- }
-
- public virtual RepeatLayout RepeatLayout
- {
- get
- {
- object o = ViewState["RepeatLayout"];
- if(o != null)
- return (RepeatLayout)o;
- return RepeatLayout.Table;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- ViewState["RepeatLayout"] = value;
- }
- }
-
- public virtual int SelectedIndex
- {
- get
- {
- object o = ViewState["SelectedIndex"];
- if(o != null)
- return (int)o;
- return -1;
- }
- set
- {
- //FIXME: Looks like a bug in Microsoft's specs.
- // Exception is missing in document. I haven't tested the case
- // But I think exception should follow
- if(value < -1)
- throw new ArgumentOutOfRangeException("value");
- int prevSel = SelectedIndex;
- ViewState["SelectedIndex"] = value;
- DataListItem prevSelItem;
- ListItemType liType;
- if(itemsArray != null)
- {
- if(prevSel >= 0 && prevSel < itemsArray.Count)
- {
- prevSelItem = (DataListItem)itemsArray[prevSel];
- if(prevSelItem.ItemType != ListItemType.EditItem)
- {
- liType = ( (prevSel % 2) == 0 ? ListItemType.AlternatingItem : ListItemType.Item );
- prevSelItem.SetItemType(liType);
- }
- }
- if(value >= 0 && value < itemsArray.Count)
- {
- prevSelItem = (DataListItem) itemsArray[value];
- if(prevSelItem.ItemType != ListItemType.EditItem)
- {
- prevSelItem.SetItemType(ListItemType.SelectedItem);
- }
- }
- }
- }
- }
-
- public virtual DataListItem SelectedItem
- {
- get
- {
- if(SelectedIndex == -1)
- return null;
- return Items[SelectedIndex];
- }
- }
-
- public virtual TableItemStyle SelectedItemStyle
- {
- get
- {
- if(selectedItemStyle == null)
- {
- selectedItemStyle = new TableItemStyle();
- if(IsTrackingViewState)
- selectedItemStyle.TrackViewState();
- }
- return selectedItemStyle;
- }
- }
-
- public virtual ITemplate SelectedItemTemplate
- {
- get
- {
- return selectedItemTemplate;
- }
- set
- {
- selectedItemTemplate = value;
- }
- }
-
- public virtual TableItemStyle SeparatorStyle
- {
- get
- {
- if(separatorStyle == null)
- {
- separatorStyle = new TableItemStyle();
- if(IsTrackingViewState)
- separatorStyle.TrackViewState();
- }
- return separatorStyle;
- }
- }
-
- public virtual ITemplate SeparatorTemplate
- {
- get
- {
- return separatorTemplate;
- }
- set
- {
- separatorTemplate = value;
- }
- }
-
- public virtual ITemplate SeparatorItemTemplate
- {
- get
- {
- return separatorItemTemplate;
- }
- set
- {
- separatorItemTemplate = value;
- }
- }
-
- public virtual bool ShowHeader
- {
- get
- {
- object o = ViewState["ShowHeader"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowHeader"] = value;
- }
- }
-
- public virtual bool ShowFooter
- {
- get
- {
- object o = ViewState["ShowFooter"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowFooter"] = value;
- }
- }
-
- public event DataListCommandEventHandler CancelCommand
- {
- add
- {
- Events.AddHandler(CancelCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CancelCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler DeleteCommand
- {
- add
- {
- Events.AddHandler(DeleteCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DeleteCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler EditCommand
- {
- add
- {
- Events.AddHandler(EditCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(EditCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler ItemCommand
- {
- add
- {
- Events.AddHandler(ItemCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCommandEvent, value);
- }
- }
-
- public event DataListCommandEventHandler ItemCreated
- {
- add
- {
- Events.AddHandler(ItemCreatedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCreatedEvent, value);
- }
- }
-
- public event DataListCommandEventHandler ItemDataBound
- {
- add
- {
- Events.AddHandler(ItemDataBoundEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemDataBoundEvent, value);
- }
- }
-
- public event DataListCommandEventHandler UpdateCommand
- {
- add
- {
- Events.AddHandler(UpdateCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(UpdateCommandEvent, value);
- }
- }
-
- protected override Style CreateControlStyle()
- {
- TableStyle retVal = new TableStyle(ViewState);
- retVal.CellSpacing = 0;
- return retVal;
- }
-
- protected override void LoadViewState(object savedState)
- {
- object[] states;
- if(savedState != null && (states = (object[])savedState) != null)
- {
- if(states[0] != null)
- LoadViewState(states[0]);
- if(states[1] != null)
- alternatingItemStyle.LoadViewState(states[1]);
- if(states[2] != null)
- editItemStyle.LoadViewState(states[2]);
- if(states[3] != null)
- footerStyle.LoadViewState(states[3]);
- if(states[4] != null)
- headerStyle.LoadViewState(states[4]);
- if(states[5] != null)
- itemStyle.LoadViewState(states[5]);
- if(states[6] != null)
- selectedItemStyle.LoadViewState(states[6]);
- if(states[7] != null)
- separatorStyle.LoadViewState(states[7]);
- }
- }
- protected override object SaveViewState()
- {
- object[] states = new object[8];
- states[0] = SaveViewState();
- states[1] = (alternatingItemStyle == null ? null : alternatingItemStyle.SaveViewState());
- states[2] = (editItemStyle == null ? null : editItemStyle.SaveViewState());
- states[3] = (footerStyle == null ? null : footerStyle.SaveViewState());
- states[4] = (headerStyle == null ? null : headerStyle.SaveViewState());
- states[5] = (itemStyle == null ? null : itemStyle.SaveViewState());
- states[6] = (selectedItemStyle == null ? null : selectedItemStyle.SaveViewState());
- states[7] = (separatorStyle == null ? null : separatorStyle.SaveViewState());
- return states;
- }
-
- protected override void TrackViewState()
- {
- TrackViewState();
- if(alternatingItemStyle != null)
- alternatingItemStyle.TrackViewState();
- if(editItemStyle != null)
- editItemStyle.TrackViewState();
- if(footerStyle != null)
- footerStyle.TrackViewState();
- if(headerStyle != null)
- headerStyle.TrackViewState();
- if(itemStyle != null)
- itemStyle.TrackViewState();
- if(selectedItemStyle != null)
- selectedItemStyle.TrackViewState();
- if(separatorStyle != null)
- separatorStyle.TrackViewState();
- }
-
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- bool retVal = false;
- if(e is DataListCommandEventArgs)
- {
- DataListCommandEventArgs dlcea = (DataListCommandEventArgs)e;
- OnItemCommand(dlcea);
- retVal = true;
- if(String.Compare(dlcea.CommandName, "Cancel") == 0)
- {
- OnCancelCommand(dlcea);
- }
- if(String.Compare(dlcea.CommandName, "Delete") == 0)
- {
- OnDeleteCommand(dlcea);
- }
- if(String.Compare(dlcea.CommandName, "Edit") == 0)
- {
- OnEditCommand(dlcea);
- }
- if(String.Compare(dlcea.CommandName, "Select") == 0)
- {
- SelectedIndex = dlcea.Item.ItemIndex;
- OnSelectedIndexChanged(EventArgs.Empty);
- }
- if(String.Compare(dlcea.CommandName, "Update") == 0)
- {
- OnUpdateCommand(dlcea);
- }
- }
- return retVal;
- }
-
- protected virtual void OnCancelCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[CancelCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnDeleteCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[DeleteCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnEditCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[EditCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnItemCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[ItemCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnItemCreated(DataListItemEventArgs e)
- {
- if(Events != null)
- {
- DataListItemEventHandler dlceh = (DataListItemEventHandler)(Events[ItemCreatedEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnItemDataBound(DataListItemEventArgs e)
- {
- if(Events != null)
- {
- DataListItemEventHandler dlceh = (DataListItemEventHandler)(Events[ItemDataBoundEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- protected virtual void OnUpdateCommand(DataListCommandEventArgs e)
- {
- if(Events != null)
- {
- DataListCommandEventHandler dlceh = (DataListCommandEventHandler)(Events[UpdateCommandEvent]);
- if(dlceh != null)
- dlceh(this, e);
- }
- }
-
- [MonoTODO]
- protected override void RenderContents(HtmlTextWriter writer)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- private DataListItem GetItem(ListItemType itemType, int repeatIndex)
- {
- DataListItem retVal = null;
- switch(itemType)
- {
- case ListItemType.Header: retVal = (DataListItem)Controls[0];
- break;
- case ListItemType.Footer: retVal = (DataListItem)Controls[Controls.Count - 1];
- break;
- case ListItemType.Item: goto case ListItemType.EditItem;
- case ListItemType.AlternatingItem: goto case ListItemType.EditItem;
- case ListItemType.SelectedItem: goto case ListItemType.EditItem;
- case ListItemType.EditItem: retVal = (DataListItem)Controls[repeatIndex];
- break;
- case ListItemType.Separator: int index = 2 * repeatIndex + 1;
- if(headerTemplate != null)
- index ++;
- retVal = (DataListItem)Controls[index];
- break;
- }
- return retVal;
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected override void CreateControlHierarchy(bool create)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected DataListItem CreateItem(int itemIndex, ListItemType itemType)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- private DataListItem CreateItem(int itemIndex, ListItemType itemType, bool dataBind, object dataItem)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected override void PrepareControlHierarchy()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- [MonoTODO]
- protected void InitializeItem(DataListItem item)
- {
- throw new NotImplementedException();
- }
-
- bool IRepeatInfoUser.HasFooter
- {
- get
- {
- return !(ShowFooter && footerTemplate!=null);
- }
- }
-
- bool IRepeatInfoUser.HasHeader
- {
- get
- {
- return !(ShowHeader && headerTemplate!=null);
- }
- }
-
- bool IRepeatInfoUser.HasSeparators
- {
- get
- {
- return (separatorItemTemplate!=null);
- }
- }
-
- int IRepeatInfoUser.RepeatedItemCount
- {
- get
- {
- if(itemsArray!=null)
- return itemsArray.Count;
- return 0;
- }
- }
-
- void IRepeatInfoUser.RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer)
- {
- DataListItem item = GetItem(itemType, repeatIndex);
- if(item!=null)
- {
- item.RenderItem(writer, extractTemplateRows, repeatInfo.RepeatLayout == RepeatLayout.Table);
- }
- }
-
- Style IRepeatInfoUser.GetItemStyle(ListItemType itemType, int repeatIndex)
- {
- if(GetItem(itemType, repeatIndex)!=null && ControlStyleCreated)
- return ControlStyle;
- return null;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs
deleted file mode 100644
index 93511a27730..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventArgs.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: DataListCommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataListCommandEventArgs: CommandEventArgs
- {
- private DataListItem dlItem;
- private object cmdSrc;
-
- public DataListCommandEventArgs(DataListItem item, object commandSource, CommandEventArgs originalArgs): base(originalArgs)
- {
- dlItem = item;
- cmdSrc = commandSource;
- }
-
- public object CommandSource
- {
- get
- {
- return cmdSrc;
- }
- }
-
- public DataListItem Item
- {
- get
- {
- return dlItem;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs
deleted file mode 100644
index 59df1b2fe50..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListCommandEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataListCommandEventHandler(object sender, DataListCommandEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs
deleted file mode 100644
index 9928ccc603e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItem.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataListItem
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxItem(false)]
- public class DataListItem : WebControl, INamingContainer
- {
- int itemIndex;
- ListItemType itemType;
- object dataItem;
-
- public DataListItem(int itemIndex, ListItemType itemType)
- {
- this.itemIndex = itemIndex;
- this.itemType = itemType;
- }
-
- public virtual object DataItem
- {
- get
- {
- return dataItem;
- }
- set
- {
- dataItem = value;
- }
- }
-
- public virtual int ItemIndex
- {
- get
- {
- return itemIndex;
- }
- }
-
- public virtual ListItemType ItemType
- {
- get
- {
- return itemType;
- }
- }
-
- [MonoTODO]
- public virtual void RenderItem(HtmlTextWriter writer, bool extractRows, bool tableLayout)
- {
- //TODO: Complete me!
- throw new NotImplementedException();
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableItemStyle();
- }
-
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- if(e is CommandEventArgs)
- {
- RaiseBubbleEvent(this, new DataListCommandEventArgs(this, source, (CommandEventArgs)e));
- return true;
- }
- return false;
- }
-
- internal void SetItemType(ListItemType itemType)
- {
- if(Enum.IsDefined(typeof(ListItemType), itemType))
- {
- this.itemType = itemType;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemCollection.cs
deleted file mode 100644
index b98df0906d1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemCollection.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataListItemCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataListItemCollection : ICollection, IEnumerable
- {
- private ArrayList items;
-
- public DataListItemCollection(ArrayList items)
- {
- this.items = items;
- }
-
- public int Count
- {
- get
- {
- return items.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public DataListItem this[int index]
- {
- get
- {
- return (DataListItem)(items[index]);
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(DataListItem current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return items.GetEnumerator();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventArgs.cs
deleted file mode 100644
index f9488bea1a6..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventArgs.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DataListItemEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DataListItemEventArgs : EventArgs
- {
- private DataListItem item;
-
- public DataListItemEventArgs(DataListItem item)
- {
- this.item = item;
- }
-
- public DataListItem Item
- {
- get
- {
- return item;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs
deleted file mode 100644
index 3310857658d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataListItemEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DataListItemEventHandler(object sender, DataListItemEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs
deleted file mode 100755
index 39aaffb4b83..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DayNameFormat.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: DayNameFormat
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum DayNameFormat
- {
- Full,
- Short,
- FirstLetter,
- FirstTwoLetters
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs
deleted file mode 100644
index a7e50cf9cdd..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DayRenderEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public sealed class DayRenderEventArgs
- {
- private TableCell cell;
- private CalendarDay day;
-
- public DayRenderEventArgs(TableCell cell, CalendarDay day)
- {
- this.cell = cell;
- this.day = day;
- }
-
- public TableCell Cell
- {
- get
- {
- return cell;
- }
- }
-
- public CalendarDay Day
- {
- get
- {
- return day;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs
deleted file mode 100644
index 1501321ffb9..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DayRenderEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Delegate: DayRenderEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void DayRenderEventHandler(object sender, DayRenderEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
deleted file mode 100644
index a128c33cdeb..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: DropDownList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections.Specialized;
-using System.Drawing;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ValidationProperty("SelectedItem")]
- public class DropDownList : ListControl, IPostBackDataHandler
- {
- public DropDownList(): base()
- {
- }
-
- public override Color BorderColor
- {
- get
- {
- return BorderColor;
- }
- set
- {
- BorderColor = value;
- }
- }
-
- public override BorderStyle BorderStyle
- {
- get
- {
- return BorderStyle;
- }
- set
- {
- BorderStyle = value;
- }
- }
-
- public override Unit BorderWidth
- {
- get
- {
- return BorderWidth;
- }
- set
- {
- BorderWidth = value;
- }
- }
-
- public override int SelectedIndex
- {
- get
- {
- return SelectedIndex;
- }
- set
- {
- SelectedIndex = value;
- }
- }
-
- public override string ToolTip
- {
- get
- {
- return ToolTip;
- }
- set
- {
- ToolTip = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- if(Page != null)
- {
- Page.VerifyRenderingInServerForm(this);
- }
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);
- AddAttributesToRender(writer);
-
- if(AutoPostBack && Page != null)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Onchange, Page.GetPostBackClientEvent(this,""));
- writer.AddAttribute("language", "javascript");
- }
- }
-
- protected override ControlCollection CreateControlCollection()
- {
- return new EmptyControlCollection(this);
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- if(Items != null)
- {
- bool selected = false;
- foreach(ListItem current in Items)
- {
- writer.WriteBeginTag("option");
- if(current.Selected)
- {
- if(selected)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Multiselect_In_DropDownList"));
- }
- selected = true;
- writer.WriteAttribute("selected", "selected", false);
- }
- writer.WriteAttribute("value", current.Value, true);
- writer.Write('>');
- HttpUtility.HtmlEncode(current.Text, writer);
- writer.WriteEndTag("option");
- writer.WriteLine();
- }
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string[] vals = postCollection.GetValues(postDataKey);
- if(vals != null)
- {
- int index = Items.FindByValueInternal(vals[0]);
- if(index != SelectedIndex)
- {
- SelectedIndex = index;
- return true;
- }
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- OnSelectedIndexChanged(EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs
deleted file mode 100644
index 7779f07ce11..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/EditCommandColumn.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: EditCommandColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class EditCommandColumn : DataGridColumn
- {
- public EditCommandColumn(): base()
- {
- }
-
- public virtual ButtonColumnType ButtonType
- {
- get
- {
- object o = ViewState["ButtonType"];
- if(o != null)
- {
- return (ButtonColumnType)o;
- }
- return ButtonColumnType.LinkButton;
- }
- set
- {
- if(!Enum.IsDefined(typeof(ButtonColumnType), value))
- {
- throw new ArgumentException();
- }
- ViewState["ButtonType"] = value;
- OnColumnChanged();
- }
- }
-
- public virtual string CancelText
- {
- get
- {
- object o = ViewState["CancelText"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["CancelText"] = value;
- OnColumnChanged();
- }
- }
-
- public virtual string EditText
- {
- get
- {
- object o = ViewState["EditText"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["EditText"] = value;
- OnColumnChanged();
- }
- }
-
- public virtual string UpdateText
- {
- get
- {
- object o = ViewState["UpdateText"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["UpdateText"] = value;
- OnColumnChanged();
- }
- }
-
- [MonoTODO]
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- base.InitializeCell(cell, columnIndex, itemType);
- //TODO: I have to read some documents.
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs
deleted file mode 100755
index 3b618c7acbf..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FirstDayOfWeek.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: FirstDayOfWeek
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum FirstDayOfWeek
- {
- Sunday,
- Monday,
- Tuesday,
- Wednesday,
- Thursday,
- Friday,
- Saturday,
- Default
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
deleted file mode 100755
index 1dcf22b9c7a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs
+++ /dev/null
@@ -1,253 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: FontInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Text;
-using System.Reflection;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public sealed class FontInfo
- {
- private Style infoOwner;
-
- internal FontInfo(Style owner)
- {
- infoOwner = owner;
- }
-
- /// <summary>
- /// Default constructor
- /// <remarks>
- /// The default constructor is made private to prevent any instances being made.
- /// </remarks>
- /// </summary>
- private FontInfo()
- {
- }
-
- public bool Bold
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_BOLD))
- return (bool)(infoOwner.ViewState["FontInfoBold"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoBold"] = value;
- infoOwner.Set(Style.FONT_BOLD);
- }
- }
-
- public bool Italic
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_ITALIC))
- return (bool)(infoOwner.ViewState["FontInfoItalic"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoItalic"] = value;
- infoOwner.Set(Style.FONT_ITALIC);
- }
- }
-
- public bool Overline
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_OLINE))
- return (bool)(infoOwner.ViewState["FontInfoOverline"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoOverline"] = value;
- infoOwner.Set(Style.FONT_OLINE);
- }
- }
-
- public bool Strikeout
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_STRIKE))
- return (bool)(infoOwner.ViewState["FontInfoStrikeout"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoStrikeout"] = value;
- infoOwner.Set(Style.FONT_STRIKE);
- }
- }
-
- public bool Underline
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_ULINE))
- return (bool)(infoOwner.ViewState["FontInfoUnderline"]);
- return false;
- }
- set
- {
- infoOwner.ViewState["FontInfoUnderline"] = value;
- infoOwner.Set(Style.FONT_ULINE);
- }
- }
-
- //TODO: How do I check if the value is negative. FontUnit is struct not enum
- public FontUnit Size
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_SIZE))
- return (FontUnit)(infoOwner.ViewState["FontInfoSize"]);
- return FontUnit.Empty;
- }
- set
- {
- infoOwner.ViewState["FontInfoSize"] = value;
- infoOwner.Set(Style.FONT_SIZE);
- }
- }
-
- public string Name
- {
- get
- {
- if(Names!=null)
- return Names[0];
- return String.Empty;
- }
- set
- {
- if(value == null)
- throw new ArgumentException();
- string[] strArray = null;
- if(value.Length > 0)
- {
- strArray = new string[1];
- strArray[0] = value;
- }
- Names = strArray;
- }
- }
-
- public string[] Names
- {
- get
- {
- if(infoOwner.IsSet(Style.FONT_NAMES))
- return (string[])(infoOwner.ViewState["FontInfoNames"]);
- return (new string[0]);
- }
- set
- {
- if(value!=null)
- {
- infoOwner.ViewState["FontInfoNames"] = value;
- infoOwner.Set(Style.FONT_NAMES);
- }
- }
- }
-
- internal void Reset()
- {
- if(infoOwner.IsSet(Style.FONT_NAMES))
- infoOwner.ViewState.Remove("FontInfoNames");
- if(infoOwner.IsSet(Style.FONT_BOLD))
- infoOwner.ViewState.Remove("FontInfoBold");
- if(infoOwner.IsSet(Style.FONT_ITALIC))
- infoOwner.ViewState.Remove("FontInfoItalic");
- if(infoOwner.IsSet(Style.FONT_STRIKE))
- infoOwner.ViewState.Remove("FontInfoStrikeout");
- if(infoOwner.IsSet(Style.FONT_OLINE))
- infoOwner.ViewState.Remove("FontInfoOverline");
- if(infoOwner.IsSet(Style.FONT_ULINE))
- infoOwner.ViewState.Remove("FontInfoUnderline");
- if(infoOwner.IsSet(Style.FONT_SIZE) && infoOwner.Font.Size != FontUnit.Empty)
- infoOwner.ViewState.Remove("FontInfoSize");
- }
-
- internal Style Owner
- {
- get
- {
- return infoOwner;
- }
- }
-
- public void CopyFrom(FontInfo source)
- {
- if(source!=null)
- {
- if(source.Owner.IsSet(Style.FONT_NAMES))
- Names = source.Names;
- if(source.Owner.IsSet(Style.FONT_BOLD))
- Bold = source.Bold;
- if(source.Owner.IsSet(Style.FONT_ITALIC))
- Italic = source.Italic;
- if(source.Owner.IsSet(Style.FONT_STRIKE))
- Strikeout = source.Strikeout;
- if(source.Owner.IsSet(Style.FONT_OLINE))
- Overline = source.Overline;
- if(source.Owner.IsSet(Style.FONT_ULINE))
- Underline = source.Underline;
- if(source.Owner.IsSet(Style.FONT_SIZE) && source.Size != FontUnit.Empty)
- Size = source.Size;
- }
- }
-
- public void MergeWith(FontInfo with)
- {
- if(with!=null)
- {
- if(with.Owner.IsSet(Style.FONT_NAMES) && !infoOwner.IsSet(Style.FONT_NAMES))
- Names = with.Names;
- if(with.Owner.IsSet(Style.FONT_BOLD) && !infoOwner.IsSet(Style.FONT_BOLD))
- Bold = with.Bold;
- if(with.Owner.IsSet(Style.FONT_ITALIC) && !infoOwner.IsSet(Style.FONT_ITALIC))
- Italic = with.Italic;
- if(with.Owner.IsSet(Style.FONT_STRIKE) && !infoOwner.IsSet(Style.FONT_STRIKE))
- Strikeout = with.Strikeout;
- if(with.Owner.IsSet(Style.FONT_OLINE) && !infoOwner.IsSet(Style.FONT_OLINE))
- Overline = with.Overline;
- if(with.Owner.IsSet(Style.FONT_ULINE) && !infoOwner.IsSet(Style.FONT_ULINE))
- Underline = with.Underline;
- if(with.Owner.IsSet(Style.FONT_SIZE) && with.Size != FontUnit.Empty && !infoOwner.IsSet(Style.FONT_SIZE))
- Size = with.Size;
- }
- }
-
- public bool ShouldSerializeNames()
- {
- return (Names.Length > 0);
- }
-
- public override string ToString()
- {
- return ( (Name.Length > 0) ? (Name.ToString() + ", " + Size.ToString()) : Size.ToString() );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs
deleted file mode 100644
index 3a04e327a56..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontNamesConverter.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: FontNamesConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class FontNamesConverter : TypeConverter
- {
- public FontNamesConverter(): base()
- {
- }
-
- public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
- {
- return (sourceType == typeof(string));
- }
-
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value is string)
- {
- string fontNames = (string)value;
- if(fontNames.Length == 0)
- {
- return (new string[0]);
- }
- string[] names = fontNames.Split(new char[] { ','});
- for(int i=0; i < names.Length; i++)
- {
- names[i] = names[i].Trim();
- }
- return names;
- }
- throw GetConvertFromException(value);
- }
-
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(destinationType == typeof(string))
- {
- if(value == null || ((string[])value) == null)
- return String.Empty;
- return String.Join(",", (string[])value);
- }
- throw GetConvertToException(value, destinationType);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs
deleted file mode 100755
index f72e3d455aa..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontSize.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: FontSize
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum FontSize
- {
- NotSet,
- AsUnit,
- Smaller,
- Larger,
- XXSmall,
- XSmall,
- Small,
- Medium,
- Large,
- XLarge,
- XXLarge
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs
deleted file mode 100644
index b9242e892c4..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs
+++ /dev/null
@@ -1,211 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Struct: FontUnit
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public struct FontUnit
- {
- public static readonly FontUnit Empty = new FontUnit();
- public static readonly FontUnit Large = new FontUnit(FontSize.Large);
- public static readonly FontUnit Larger = new FontUnit(FontSize.Larger);
- public static readonly FontUnit Medium = new FontUnit(FontSize.Medium);
- public static readonly FontUnit Small = new FontUnit(FontSize.Small);
- public static readonly FontUnit Smaller = new FontUnit(FontSize.Smaller);
- public static readonly FontUnit XLarge = new FontUnit(FontSize.XLarge);
- public static readonly FontUnit XSmall = new FontUnit(FontSize.XSmall);
- public static readonly FontUnit XXLarge = new FontUnit(FontSize.XXLarge);
- public static readonly FontUnit XXSmall = new FontUnit(FontSize.XXSmall);
-
- private FontSize type;
- private Unit val;
-
- public FontUnit(FontSize type)
- {
- if(!Enum.IsDefined(typeof(FontSize), type))
- throw new ArgumentException();
- this.type = type;
- if(this.type == FontSize.AsUnit)
- {
- val = Unit.Point(10);
- } else
- {
- val = Unit.Empty;
- }
- }
-
- public FontUnit(int value)
- {
- type = FontSize.AsUnit;
- val = Unit.Point(value);
- }
-
- public FontUnit(string value): this(value, CultureInfo.CurrentCulture)
- {
- }
-
- public FontUnit(Unit value)
- {
- if(value.IsEmpty)
- {
- type = FontSize.NotSet;
- val = Unit.Empty;
- } else
- {
- type = FontSize.AsUnit;
- val = value;
- }
- }
-
- public FontUnit(string value, CultureInfo culture)
- {
- type = FontSize.NotSet;
- val = Unit.Empty;
- if(value != null && value != String.Empty)
- {
- string low = value.ToLower(culture);
- int index = GetTypeFromString(low);
- if( index != -1)
- {
- type = (FontSize)index;
- return;
- } else
- {
- val = new Unit(value, culture, UnitType.Point);
- type = FontSize.AsUnit;
- }
- }
- }
-
- private int GetTypeFromString(string strVal)
- {
- string[] values = {
- "smaller",
- "larger",
- "xx-small",
- "x-small",
- "small",
- "medium",
- "large",
- "xlarge",
- "xxlarge"
- };
- int i = 0;
- foreach(string valType in values)
- {
- if(strVal == valType)
- {
- return (i + 2);
- }
- i++;
- }
- return -1;
- }
-
- public static FontUnit Parse(string s)
- {
- return Parse(s, CultureInfo.CurrentCulture);
- }
-
- public static FontUnit Parse(string s, CultureInfo culture)
- {
- return new FontUnit(s, culture);
- }
-
- public static FontUnit Point(int n)
- {
- return new FontUnit(n);
- }
-
- public static bool operator ==(FontUnit left, FontUnit right)
- {
- return (left.type == right.type && left.val == right.val);
- }
-
- public static bool operator !=(FontUnit left, FontUnit right)
- {
- return !(left == right);
- }
-
- public static implicit operator FontUnit(int n)
- {
- return FontUnit.Point(n);
- }
-
- public override bool Equals(object obj)
- {
- if(obj!= null && obj is FontUnit)
- {
- FontUnit that = (FontUnit)obj;
- return (this.type == that.type && this.val == that.val);
- }
- return false;
- }
-
- public override int GetHashCode()
- {
- return ( (type.GetHashCode() << 2) | val.GetHashCode() );
- }
-
- public override string ToString()
- {
- return ToString(CultureInfo.CurrentCulture);
- }
-
- public string ToString(CultureInfo culture)
- {
- if(IsEmpty)
- {
- return String.Empty;
- }
- //string strRepr = String.Empty;
- switch(type)
- {
- case FontSize.AsUnit: return val.ToString(culture);
- case FontSize.XXSmall: return "XX-Small";
- case FontSize.XSmall: return "X-Small";
- case FontSize.XLarge: return "X-Large";
- case FontSize.XXLarge: return "XX-Large";
- default: return PropertyConverter.EnumToString(typeof(FontSize), type);
- }
- }
-
- public bool IsEmpty
- {
- get
- {
- return (type == FontSize.NotSet);
- }
- }
-
- public FontSize Type
- {
- get
- {
- return type;
- }
- }
-
- public Unit Unit
- {
- get
- {
- return val;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
deleted file mode 100644
index 7197e219b80..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnitConverter.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: FontUnitConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class FontUnitConverter : TypeConverter
- {
- public FontUnitConverter(): base()
- {
- }
-
- public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
- {
- if(sourceType == typeof(string))
- return true;
- return base.CanConvertFrom(context, sourceType);
- }
-
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value == null)
- return null;
- if(value is string)
- {
- string val = ((string)value).Trim();
- if(val.Length == 0)
- {
- return FontUnit.Empty;
- }
- return FontUnit.Parse(val, culture);
- }
- return base.ConvertFrom(context, culture, value);
- }
-
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(value != null && value is FontUnit)
- {
- FontUnit val = (FontUnit)value;
- if(val.Type == FontSize.NotSet)
- {
- return String.Empty;
- }
- return val.ToString(culture);
- }
- return base.ConvertTo(context, culture, value, destinationType);
- }
-
- [MonoTODO("GetStandardValues")]
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- throw new NotImplementedException();
- }
-
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
-
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs b/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs
deleted file mode 100755
index b013b5a1779..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/GridLines.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: GridLines
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum GridLines
- {
- None,
- Horizontal,
- Vertical,
- Both
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs
deleted file mode 100755
index 079e26419c1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HorizontalAlign.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: HorizontalAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum HorizontalAlign
- {
- NotSet,
- Left,
- Center,
- Right,
- Justify
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs
deleted file mode 100755
index a4df948a41f..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLink.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: HyperLink
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: gvaish@iitk.ac.in, myscripts_2001@yahoo.com
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultProperty("Text")]
- //[Designer(??)]
- [ControlBuilder(typeof(HyperLinkControlBuilder))]
- //[DataBindingHandler("??")]
- [ParseChildren(false)]
- [ToolboxData("<{0}:HyperLink runat=\"server\">HyperLink</{0}:HyperLink>")]
- public class HyperLink: WebControl
- {
- public HyperLink(): base(HtmlTextWriterTag.A)
- {
- }
-
- public virtual string ImageUrl
- {
- get
- {
- object o = ViewState["ImageUrl"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ImageUrl"] = value;
- }
- }
-
- public string NavigateUrl
- {
- get
- {
- object o = ViewState["NavigateUrl"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["NavigateUrl"] = value;
- }
- }
-
- public string Target
- {
- get
- {
- object o = ViewState["Target"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Target"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(NavigateUrl.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Href, NavigateUrl);
- }
- if(Target.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Target, Target);
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(HasControls())
- {
- base.AddParsedSubObject(obj);
- return;
- }
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- if(Text.Length > 0)
- {
- base.AddParsedSubObject(Text);
- Text = String.Empty;
- }
- base.AddParsedSubObject (obj);
- }
-
- protected override void LoadViewState(object savedState)
- {
- if(savedState != null)
- {
- base.LoadViewState(savedState);
- object o = ViewState["Text"];
- if(o!=null)
- Text = (string)o;
- }
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- if(ImageUrl.Length > 0)
- {
- Image img = new Image();
- img.ImageUrl = ResolveUrl(ImageUrl);
- if(ToolTip.Length > 0)
- img.ToolTip = ToolTip;
- if(Text.Length > 0)
- img.AlternateText = Text;
- img.RenderControl(writer);
- return;
- }
- if(HasControls())
- {
- base.RenderControl(writer);
- return;
- }
- writer.Write(Text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs
deleted file mode 100644
index a2eb2465950..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkColumn.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: HyperLinkColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 5%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class HyperLinkColumn: DataGridColumn
- {
- PropertyDescriptor textFieldDescriptor;
- PropertyDescriptor urlFieldDescriptor;
-
- public HyperLinkColumn(): base()
- {
- }
-
- public virtual string DataNavigateUrlField
- {
- get
- {
- object o = ViewState["DataNavigateUrlField"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataNavigateUrlField"] = value;
- }
- }
-
- public virtual string DataNavigateUrlFormatString
- {
- get
- {
- object o = ViewState["DataNavigateUrlFormatString"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataNavigateUrlFormatString"] = value;
- }
- }
-
- public virtual string DataTextField
- {
- get
- {
- object o = ViewState["DataTextField"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextField"] = value;
- }
- }
-
- public virtual string DataTextFormatString
- {
- get
- {
- object o = ViewState["DataTextFormatString"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextFormatString"] = value;
- }
- }
-
- public virtual string NavigateUrl
- {
- get
- {
- object o = ViewState["NavigateUrl"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["NavigateUrl"] = value;
- }
- }
-
- public virtual string Target
- {
- get
- {
- object o = ViewState["Target"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Target"] = value;
- }
- }
-
- public virtual string Text
- {
- get
- {
- object o = ViewState["Text"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["Text"] = value;
- }
- }
-
- public override void Initialize()
- {
- textFieldDescriptor = null;
- urlFieldDescriptor = null;
- }
-
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- InitializeCell(cell, columnIndex, itemType);
- if(Enum.IsDefined(typeof(ListItemType), itemType) && itemType != ListItemType.Footer)
- {
- HyperLink toDisplay = new HyperLink();
- toDisplay.Text = Text;
- toDisplay.NavigateUrl = NavigateUrl;
- toDisplay.Target = Target;
- if(DataTextField.Length > 0 || DataNavigateUrlField.Length>0)
- {
- toDisplay.DataBinding += new EventHandler(OnDataBindHyperLinkColumn);
- }
- cell.Controls.Add(toDisplay);
- }
- }
-
- private void OnDataBindHyperLinkColumn(object sender, EventArgs e)
- {
- HyperLink link = (HyperLink)sender;
- object item = ((DataGridItem)link.NamingContainer).DataItem;
- if(textFieldDescriptor == null && urlFieldDescriptor == null)
- {
- textFieldDescriptor = TypeDescriptor.GetProperties(item).Find(DataTextField, true);
- if(textFieldDescriptor == null && !DesignMode)
- throw new HttpException(HttpRuntime.FormatResourceString("Field_Not_Found", DataTextField));
- urlFieldDescriptor = TypeDescriptor.GetProperties(item).Find(DataNavigateUrlField, true);
- if(urlFieldDescriptor == null && !DesignMode)
- throw new HttpException(HttpRuntime.FormatResourceString("Field_Not_Found", DataNavigateUrlField));
- }
-
- if(textFieldDescriptor != null)
- {
- link.Text = FormatDataTextValue(textFieldDescriptor.GetValue(item));
- } else
- {
- link.Text = "Sample_DataBound_Text";
- }
-
- if(urlFieldDescriptor != null)
- {
- link.NavigateUrl = FormatDataNavigateUrlValue(urlFieldDescriptor.GetValue(item));
- } else
- {
- link.NavigateUrl = "url";
- }
- }
-
- protected virtual string FormatDataNavigateUrlValue(object dataUrlValue)
- {
- string retVal = String.Empty;
- if(dataUrlValue != null)
- {
- if(DataNavigateUrlFormatString.Length > 0)
- {
- retVal = String.Format(DataNavigateUrlFormatString, dataUrlValue);
- } else
- {
- retVal = dataUrlValue.ToString();
- }
- }
- return retVal;
- }
-
- protected virtual string FormatDataTextValue(object dataTextValue)
- {
- string retVal = String.Empty;
- if(dataTextValue != null)
- {
- if(DataTextFormatString.Length > 0)
- {
- retVal = String.Format(DataTextFormatString, dataTextValue);
- } else
- {
- retVal = dataTextValue.ToString();
- }
- }
- return retVal;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs
deleted file mode 100644
index cca04d06622..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/HyperLinkControlBuilder.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: HyperLinkControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-namespace System.Web.UI.WebControls
-{
- public class HyperLinkControlBuilder : ControlBuilder
- {
- public HyperLinkControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs b/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs
deleted file mode 100755
index 47526f80d8e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/IRepeatInfoUser.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Interface: IRepeatInfoUser
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public interface IRepeatInfoUser
- {
- bool HasFooter { get; }
- bool HasHeader { get; }
- bool HasSeparators { get; }
- int RepeatedItemCount { get; }
- void RenderItem(ListItemType itemType, int repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer);
- Style GetItemStyle(ListItemType itemType, int repeatIndex);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Image.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Image.cs
deleted file mode 100644
index 9ae5d539544..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Image.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Image
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultProperty("ImageUrl")]
- [ParseChildrenAttribute(false)]
- public class Image : WebControl
- {
- public Image(): base(HtmlTextWriterTag.Img)
- {
- }
-
- public virtual string AlternateText
- {
- get
- {
- object o = ViewState["AlternateText"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["AlternateText"] = value;
- }
- }
-
- public override bool Enabled
- {
- get
- {
- return base.Enabled;
- }
- set
- {
- base.Enabled = value;
- }
- }
-
- public override FontInfo Font
- {
- get
- {
- return base.Font;
- }
- }
-
- public virtual ImageAlign ImageAlign
- {
- get
- {
- object o = ViewState["ImageAlign"];
- if(o!=null)
- return (ImageAlign)o;
- return ImageAlign.NotSet;
- }
- set
- {
- ViewState["ImageAlign"] = value;
- }
- }
-
- public virtual string ImageUrl
- {
- get
- {
- object o = ViewState["ImageUrl"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ImageUrl"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(ImageUrl.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Src, ResolveUrl(ImageUrl));
- }
- if(AlternateText.Length > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Alt, AlternateText);
- }
- if(BorderWidth.IsEmpty)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
- }
- if(ImageAlign != ImageAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, Enum.Format(typeof(ImageAlign), ImageAlign, "G"));
- }
- }
-
- protected override void RenderContents(HtmlTextWriter writer)
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs
deleted file mode 100755
index 5a5fa02db58..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageAlign.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ImageAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ImageAlign
- {
- NotSet,
- Left,
- Right,
- Baseline,
- Top,
- Middle,
- Bottom,
- AbsBottom,
- AbsMiddle,
- TextTop
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
deleted file mode 100644
index c318dd3c002..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageButton.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ImageButton
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("Click")]
- public class ImageButton: Image, IPostBackDataHandler, IPostBackEventHandler
- {
- private static readonly object ClickEvent = new object();
- private static readonly object CommandEvent = new object();
-
- private int x, y;
-
- public ImageButton(): base()
- {
- }
-
- public bool CausesValidation
- {
- get
- {
- object o = ViewState["CausesValidation"];
- if(o!=null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["CausesValidation"] = value;
- }
- }
-
- public string CommandArgument
- {
- get
- {
- object o = ViewState["CommandArgument"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["CommandArgument"] = value;
- }
- }
-
- public string CommandName
- {
- get
- {
- object o = ViewState["CommandName"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["CommandName"] = value;
- }
- }
-
- protected override HtmlTextWriterTag TagKey
- {
- get
- {
- return HtmlTextWriterTag.Input;
- }
- }
-
- public event ImageClickEventHandler Click
- {
- add
- {
- Events.AddHandler(ClickEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ClickEvent, value);
- }
- }
-
- public event CommandEventHandler Command
- {
- add
- {
- Events.AddHandler(CommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(CommandEvent, value);
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Type, "image");
- writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID);
- if(Page != null && CausesValidation)
- {
- if(Page.Validators.Count > 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Onclick, Utils.GetClientValidatedEvent(Page));
- writer.AddAttribute("language", "javascript");
- }
- }
- base.AddAttributesToRender(writer);
- }
-
- protected virtual void OnClick(ImageClickEventArgs e)
- {
- if(Events != null)
- {
- ImageClickEventHandler iceh = (ImageClickEventHandler)(Events[ClickEvent]);
- if(iceh != null)
- iceh(this, e);
- }
- }
-
- protected virtual void OnCommand(CommandEventArgs e)
- {
- if(Events != null)
- {
- CommandEventHandler ceh = (CommandEventHandler)(Events[CommandEvent]);
- if(ceh != null)
- ceh(this, e);
- RaiseBubbleEvent(this, e);
- }
- }
-
- protected override void OnPreRender(EventArgs e)
- {
- if(Page != null)
- {
- Page.RegisterRequiresPostBack(this);
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string xCoord = postCollection[UniqueID + ".x"];
- string yCoord = postCollection[UniqueID + ".y"];
- if(xCoord != null && yCoord != null && xCoord.Length > 0 && yCoord.Length > 0)
- {
- x = Int32.Parse(xCoord);
- y = Int32.Parse(yCoord);
- Page.RegisterRequiresRaiseEvent(this);
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- }
-
- void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
- {
- if(CausesValidation)
- Page.Validate();
- OnClick(new ImageClickEventArgs(x, y));
- OnCommand(new CommandEventArgs(CommandName, CommandArgument));
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Label.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Label.cs
deleted file mode 100644
index 46d64521f47..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Label.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Label
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultProperty("Text")]
- //[Designer("??")]
- [ControlBuilder(typeof(LabelControlBuilder))]
- //[DataBindingHandler("??")]
- [ParseChildren(false)]
- [ToolboxData("<{0}:Label runat=\"server\">Label</{0}:Label>")]
- public class Label : WebControl
- {
- public Label (): base ()
- {
- }
-
- internal Label (HtmlTextWriterTag tagKey) : base (tagKey)
- {
- }
-
- public virtual string Text
- {
- get {
- object o = ViewState ["Text"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["Text"] = value; }
- }
-
- protected override void AddParsedSubObject (object obj)
- {
- if(HasControls ()){
- base.AddParsedSubObject (obj);
- return;
- }
-
- if(obj is LiteralControl){
- Text = ((LiteralControl) obj).Text;
- return;
- }
-
- if(Text.Length > 0){
- base.AddParsedSubObject (new LiteralControl (Text));
- Text = String.Empty;
- }
-
- base.AddParsedSubObject (obj);
- }
-
- protected override void LoadViewState (object savedState)
- {
- if(savedState != null) {
- base.LoadViewState (savedState);
- string savedText = ViewState ["Text"] as string;
- if(savedText != null)
- Text = savedText;
- }
- }
-
- protected override void RenderContents (HtmlTextWriter writer)
- {
- if(HasControls ())
- base.RenderContents (writer);
- else
- writer.Write (Text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs
deleted file mode 100644
index 5ef512cd092..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LabelControlBuilder.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LabelControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public class LabelControlBuilder : ControlBuilder
- {
- public LabelControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs
deleted file mode 100644
index 1706ab46324..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LinkButton
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("Click")]
- [DefaultProperty("Text")]
- //[Designer("??")]
- [ControlBuilder(typeof(LinkButtonControlBuilder))]
- //[DataBindingHandler("??")]
- [ParseChildren(false)]
- [ToolboxData("<{0}:LinkButton runat=\"server\">LinkButton</{0}:LinkButton>")]
- public class LinkButton : WebControl, IPostBackEventHandler
- {
- private static readonly object ClickEvent = new object();
- private static readonly object CommandEvent = new object();
-
- public LinkButton () : base (HtmlTextWriterTag.A)
- {
- }
-
- public bool CausesValidation
- {
- get {
- object o = ViewState ["CausesValidation"];
- return (o == null) ? true : (bool) o;
- }
-
- set { ViewState ["CausesValidation"] = value; }
- }
-
- public string CommandArgument
- {
- get {
- object o = ViewState ["CommandArgument"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["CommandArgument"] = value; }
- }
-
- public string CommandName
- {
- get {
- object o = ViewState ["CommandName"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["CommandName"] = value; }
- }
-
- public virtual string Text
- {
- get {
- object o = ViewState ["Text"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["Text"] = value; }
- }
-
- public event EventHandler Click
- {
- add { Events.AddHandler(ClickEvent, value); }
- remove { Events.RemoveHandler(ClickEvent, value); }
- }
-
- public event CommandEventHandler Command
- {
- add { Events.AddHandler(CommandEvent, value); }
- remove { Events.RemoveHandler(CommandEvent, value); }
- }
-
- protected virtual void OnClick (EventArgs e)
- {
- if(Events != null){
- EventHandler eh = (EventHandler) (Events [ClickEvent]);
- if (eh != null)
- eh (this, e);
- }
- }
-
- protected virtual void OnCommand (CommandEventArgs e)
- {
- if(Events != null){
- CommandEventHandler ceh = (CommandEventHandler) (Events [CommandEvent]);
- if (ceh != null)
- ceh (this, e);
- }
- }
-
- void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
- {
- if (CausesValidation)
- Page.Validate ();
- OnClick (EventArgs.Empty);
- OnCommand (new CommandEventArgs (CommandName, CommandArgument));
- }
-
- protected override void AddAttributesToRender (HtmlTextWriter writer)
- {
- base.AddAttributesToRender (writer);
- if (Enabled && Page != null){
- if (CausesValidation && Page.Validators.Count > 0){
- writer.AddAttribute (HtmlTextWriterAttribute.Href,
- "javascript:" +
- Utils.GetClientValidatedPostBack (this));
- return;
- }
- writer.AddAttribute (HtmlTextWriterAttribute.Href,
- Page.GetPostBackClientHyperlink (this, ""));
- }
- }
-
- protected override void AddParsedSubObject (object obj)
- {
- if (HasControls ()){
- base.AddParsedSubObject (obj);
- return;
- }
-
- if (obj is LiteralControl){
- Text = ((LiteralControl) obj).Text;
- return;
- }
-
- if (Text.Length > 0){
- base.AddParsedSubObject (new LiteralControl (Text));
- Text = String.Empty;
- }
-
- base.AddParsedSubObject (obj);
- }
-
- protected override void LoadViewState (object savedState)
- {
- if (savedState != null){
- base.LoadViewState (savedState);
- string savedText = (string) ViewState ["Text"];
- if (savedText != null)
- Text = savedText;
- }
- }
-
- protected override void RenderContents (HtmlTextWriter writer)
- {
- if (HasControls ()){
- base.RenderContents (writer);
- return;
- }
- writer.Write (Text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs
deleted file mode 100644
index cfb8a69b986..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonControlBuilder.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LinkButtonControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class LinkButtonControlBuilder : ControlBuilder
- {
- public LinkButtonControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonInternal.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonInternal.cs
deleted file mode 100644
index 215d5efd082..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LinkButtonInternal.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LinkButtonInternal
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Drawing;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- internal class LinkButtonInternal : LinkButton
- {
- public LinkButtonInternal() : base()
- {
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- SetForeColor();
- Render(writer);
- }
-
- private void SetForeColor()
- {
- if(!ControlStyle.IsSet(System.Web.UI.WebControls.Style.FORECOLOR))
- {
- Control ctrl = this;
- Color foreCol;
- int ctr = 0;
- //FIXME: this-> LinkButton-> WebControl
- while(ctr < 2)
- {
- ctrl = ctrl.Parent;
- foreCol = ((WebControl)ctrl).ForeColor;
- if(foreCol != Color.Empty)
- {
- ForeColor = foreCol;
- return;
- }
- ctr++;
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
deleted file mode 100644
index 353fb821224..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListBox
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Drawing;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ValidationProperty("SelectedItem")]
- public class ListBox : ListControl, IPostBackDataHandler
- {
- public ListBox () : base ()
- {
- }
-
- public override Color BorderColor
- {
- get { return base.BorderColor; }
- set { base.BorderColor = value; }
- }
-
- public override BorderStyle BorderStyle
- {
- get { return base.BorderStyle; }
- set { base.BorderStyle = value; }
- }
-
- public override Unit BorderWidth
- {
- get { return base.BorderWidth; }
- set { base.BorderWidth = value; }
- }
-
- public virtual int Rows
- {
- get {
- object o = ViewState ["Rows"];
- return (o == null) ? 4 : (int) o;
- }
-
- set {
- if (value < 1 || value > 2000)
- throw new ArgumentOutOfRangeException ();
-
- ViewState ["Rows"] = value;
- }
- }
-
- public virtual ListSelectionMode SelectionMode
- {
- get
- {
- object o = ViewState ["SelectionMode"];
- return (o == null) ? ListSelectionMode.Single : (ListSelectionMode) o;
- }
- set
- {
- if (!Enum.IsDefined (typeof (ListSelectionMode), value))
- throw new ArgumentException ();
- ViewState ["SelectionMode"] = value;
- }
- }
-
- public override string ToolTip
- {
- get { return String.Empty; }
- set { /* Don't do anything. */ }
- }
-
- protected override void AddAttributesToRender (HtmlTextWriter writer)
- {
- if (Page != null)
- Page.VerifyRenderingInServerForm (this);
-
- writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
- base.AddAttributesToRender (writer);
- writer.AddAttribute (HtmlTextWriterAttribute.Size,
- Rows.ToString (NumberFormatInfo.InvariantInfo));
-
- if (SelectionMode == ListSelectionMode.Multiple)
- writer.AddAttribute (HtmlTextWriterAttribute.Multiple, "multiple");
-
- if (AutoPostBack && Page != null){
- writer.AddAttribute (HtmlTextWriterAttribute.Onchange,
- Page.GetPostBackClientEvent (this, ""));
- writer.AddAttribute ("language", "javascript");
- }
- }
-
- protected override void OnPreRender (EventArgs e)
- {
- base.OnPreRender (e);
- if (Page != null && SelectionMode == ListSelectionMode.Multiple && Enabled)
- Page.RegisterRequiresPostBack(this);
- }
-
- protected override void RenderContents (HtmlTextWriter writer)
- {
- bool isMultAllowed = (SelectionMode == ListSelectionMode.Multiple);
- bool selMade = false;
- foreach (ListItem current in Items){
- writer.WriteBeginTag ("option");
- if (current.Selected){
- if (!isMultAllowed && selMade)
- throw new HttpException ("Cannot_MultiSelect_In_Single_Mode");
- selMade = true;
- writer.WriteAttribute ("selected", "selected");
- }
- writer.WriteAttribute ("value", current.Value, true);
- writer.Write ('>');
- writer.Write (HttpUtility.HtmlEncode (current.Text));
- writer.WriteEndTag ("option");
- writer.WriteLine ();
- }
- }
-
- bool IPostBackDataHandler.LoadPostData (string postDataKey,
- NameValueCollection postCollection)
- {
- string[] vals = postCollection.GetValues (postDataKey);
- bool updated = false;
- ArrayList selected = SelectedIndices;
- ArrayList final = new ArrayList (vals.Length);
- if (vals != null){
- if (SelectionMode == ListSelectionMode.Single){
- int index = Items.FindByValueInternal (vals [0]);
- if (SelectedIndex != index){
- SelectedIndex = index;
- updated = true;
- }
- } else {
- foreach (string current in vals)
- final.Add (Items.FindByValueInternal (current));
-
- if (selected != null && selected.Count == vals.Length){
- for (int ctr = 0; ctr < vals.Length; ctr++){
- if (((int) final [ctr]) != ((int) selected [ctr])){
- updated = true;
- break;
- }
- }
- } else {
- updated = true;
- }
- }
- if (!updated)
- Select (final);
- } else {
- if (SelectedIndex != -1)
- SelectedIndex = -1;
- updated = true;
- }
- return updated;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent ()
- {
- OnSelectedIndexChanged (EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
deleted file mode 100644
index 9b118b114a8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
+++ /dev/null
@@ -1,331 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListControl
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-using System.Web.Utils;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("SelectedIndexChanged")]
- [DefaultProperty("DataSource")]
- //[Designer("??")]
- //[DataBindingHandler("??")]
- [ParseChildren(true, "Items")]
- public class ListControl: WebControl
- {
- private static readonly object SelectedIndexChangedEvent = new object();
-
- private object dataSource;
- private ListItemCollection items;
-
- private int cachedSelectedIndex = -1;
-
- public ListControl(): base(HtmlTextWriterTag.Select)
- {
- }
-
- public event EventHandler SelectedIndexChanged
- {
- add
- {
- Events.AddHandler(SelectedIndexChangedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(SelectedIndexChangedEvent, value);
- }
- }
-
- public virtual bool AutoPostBack
- {
- get
- {
- object o = ViewState["AutoPostBack"];
- if(o!=null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["AutoPostBack"] = value;
- }
- }
-
- public virtual string DataMember
- {
- get
- {
- object o = ViewState["DataMember"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataMember"] = value;
- }
- }
-
- public virtual object DataSource
- {
- get
- {
- return dataSource;
- }
- set
- {
- if(value != null)
- {
- if(value is IListSource || value is IEnumerable)
- {
- dataSource = value;
- return;
- }
- }
- throw new ArgumentException(HttpRuntime.FormatResourceString(ID, "Invalid DataSource Type"));
- }
- }
-
- public virtual string DataTextField
- {
- get
- {
- object o = ViewState["DataTextField"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextField"] = value;
- }
- }
-
- public virtual string DataTextFormatString
- {
- get
- {
- object o = ViewState["DataTextFormatString"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataTextFormatString"] = value;
- }
- }
-
- public virtual string DataValueField
- {
- get
- {
- object o = ViewState["DataValueField"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["DataValueField"] = value;
- }
- }
-
- public virtual ListItemCollection Items
- {
- get
- {
- if(items==null)
- {
- items = new ListItemCollection();
- if(IsTrackingViewState)
- {
- items.TrackViewState();
- }
- }
- return items;
- }
- }
-
- public virtual int SelectedIndex
- {
- get
- {
- object o = ViewState["SelectedIndex"];
- if(o!=null)
- return (int)o;
- return -1;
- }
- set
- {
- if(value < -1 || value > Items.Count)
- throw new ArgumentOutOfRangeException();
- ViewState["SelectedIndex"] = value;
- }
- }
-
- public virtual ListItem SelectedItem
- {
- get
- {
- if(SelectedIndex > 0)
- {
- return Items[SelectedIndex];
- }
- return null;
- }
- }
-
- internal virtual ArrayList SelectedIndices
- {
- get
- {
- ArrayList si = new ArrayList();
- for(int i=0; i < Items.Count; i++)
- {
- if(Items[i].Selected)
- si.Add(i);
- }
- return si;
- }
- }
-
- internal void Select(ArrayList indices)
- {
- ClearSelection();
- foreach(object intObj in indices)
- {
- int index = (int)intObj;
- if(index >= 0 && index < Items.Count)
- Items[index].Selected = true;
- }
- }
-
- public virtual void ClearSelection()
- {
- for(int i=0; i < Items.Count; i++)
- {
- Items[i].Selected = false;
- }
- }
-
- protected override void LoadViewState(object savedState)
- {
- //Order: BaseClass, Items (Collection), Indices
- if(savedState != null && savedState is Triplet)
- {
- Triplet state = (Triplet)savedState;
- base.LoadViewState(state.First);
- Items.LoadViewState(state.Second);
- object indices = state.Third;
- if(indices != null)
- {
- Select((ArrayList)indices);
- }
- }
- }
-
- protected override void OnDataBinding(EventArgs e)
- {
- base.OnDataBinding(e);
- IEnumerable resolvedDataSource = DataSourceHelper.GetResolvedDataSource(DataSource, DataMember);
- if(resolvedDataSource != null)
- {
- string dataTextField = DataTextField;
- string dataValueField = DataValueField;
- Items.Clear();
- ICollection rdsCollection = (ICollection)resolvedDataSource;
- if(rdsCollection != null)
- {
- Items.Capacity = rdsCollection.Count;
- }
- bool valid = ( (dataTextField.Length >= 0) && (dataValueField.Length >=0) );
- foreach(IEnumerable current in resolvedDataSource)
- {
- ListItem li = new ListItem();
- if(valid)
- {
- if(dataTextField.Length >= 0)
- {
- li.Text = DataBinder.GetPropertyValue(current, dataTextField, null);
- }
- if(dataValueField.Length >= 0)
- {
- li.Value = DataBinder.GetPropertyValue(current, dataValueField, null);
- }
- } else
- {
- li.Text = dataTextField.ToString();
- li.Value = dataValueField.ToString();
- }
- Items.Add(li);
- }
- }
- if(cachedSelectedIndex != -1)
- {
- SelectedIndex = cachedSelectedIndex;
- cachedSelectedIndex = -1;
- }
- }
-
- protected virtual void OnSelectedIndexChanged(EventArgs e)
- {
- if(Events!=null)
- {
- EventHandler eh = (EventHandler)(Events[SelectedIndexChangedEvent]);
- if(eh!=null)
- eh(this, e);
- }
- }
-
- protected override object SaveViewState()
- {
- //Order: BaseClass, Items (Collection), Indices
- object vs = base.SaveViewState();
- object itemSvs = Items.SaveViewState();
- object indices = null;
- if(SaveSelectedIndicesViewState)
- indices = SelectedIndices;
- if(vs!= null && itemSvs != null && indices != null)
- {
- return new Triplet(vs, itemSvs, indices);
- }
- return null;
- }
-
- protected override void TrackViewState()
- {
- base.TrackViewState();
- Items.TrackViewState();
- }
-
- private bool SaveSelectedIndicesViewState
- {
- get
- {
- if( Events[SelectedIndexChangedEvent] != null && Enabled && Visible)
- {
- Type t = GetType();
- // If I am a derivative, let it take of storing the selected indices.
- if(t == typeof(DropDownList) || t == typeof(ListBox) || t == typeof(CheckBoxList) || t == typeof(RadioButtonList))
- return false;
- }
- return true;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs
deleted file mode 100644
index e58a1917835..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItem.cs
+++ /dev/null
@@ -1,252 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListItem
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [TypeConverter(typeof(ExpandableObjectConverter))]
- [ControlBuilder(typeof(ListItemControlBuilder))]
- public sealed class ListItem : IStateManager, IParserAccessor, IAttributeAccessor
- {
- private static int MARKED = (0x01 << 0);
- private static int SELECTED = (0x01 << 1);
- private static int DIRTY_T = (0x01 << 2);
- private static int DIRTY_V = (0x01 << 3);
-
- private static int selBits;
-
- private AttributeCollection attributes;
- private string text;
- private string val;
-
- public ListItem(string text, string value)
- {
- this.text = text;
- this.val = value;
- selBits = 0x00;
- attributes = null;
- }
-
- public ListItem(string text): this(text, null)
- {
- }
-
- public ListItem(): this(null, null)
- {
- }
-
- public static ListItem FromString(string text)
- {
- return new ListItem(text);
- }
-
- public AttributeCollection Attributes
- {
- get
- {
- if(attributes == null)
- attributes = new AttributeCollection(new StateBag(true));
- return attributes;
- }
- }
-
- public bool Selected
- {
- get
- {
- return IsSet(SELECTED);
- }
- set
- {
- Set(SELECTED);
- }
- }
-
- internal bool Dirty
- {
- get
- {
- return (IsSet(DIRTY_T) && IsSet(DIRTY_V));
- }
- set
- {
- Set(DIRTY_T);
- Set(DIRTY_V);
- }
- }
-
- private bool IsSet(int bit)
- {
- return ( (selBits & bit) != 0x00 );
- }
-
- private void Set(int bit)
- {
- selBits |= bit;
- }
-
- public string Text
- {
- get
- {
- if(text!=null)
- {
- return text;
- }
- if(val!=null)
- {
- return val;
- }
- return String.Empty;
- }
- set
- {
- text = value;
- if(IsTrackingViewState)
- {
- Set(DIRTY_T);
- }
- }
- }
-
- public string Value
- {
- get
- {
- if(val!=null)
- {
- return val;
- }
- if(text!=null)
- {
- return text;
- }
- return String.Empty;
- }
- set
- {
- val = value;
- if(IsTrackingViewState)
- {
- Set(DIRTY_V);
- }
- }
- }
-
- string IAttributeAccessor.GetAttribute(string key)
- {
- return attributes[key];
- }
-
- void IAttributeAccessor.SetAttribute(string key, string value)
- {
- attributes[key] = value;
- }
-
- /// <remarks>
- /// The data is parsed - object must be of type LiteralControl or DataBoundLiteralControl.
- /// In latter case, throw an exception telling that the data cannot be bind-ed.
- /// </remarks>
- void IParserAccessor.AddParsedSubObject(object obj)
- {
- if(obj is LiteralControl)
- {
- Text = ((LiteralControl)obj).Text;
- return;
- }
- if(obj is DataBoundLiteralControl)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Control_Cannot_DataBind","ListItem"));
- }
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "ListItem", obj.GetType().ToString()));
- }
-
- bool IsTrackingViewState
- {
- get
- {
- return IsSet(MARKED);
- }
- }
-
- internal void TrackViewState()
- {
- Set(MARKED);
- }
-
- internal void LoadViewState(object state)
- {
- if(state is Pair)
- {
- Pair tv = (Pair)state;
- if(tv.First!=null)
- {
- Text = (string)tv.First;
- }
- if(tv.Second!=null)
- {
- Value = (string)tv.Second;
- }
- }
- if(state is string)
- {
- Text = (string)state;
- }
- }
-
- internal object SaveViewState()
- {
- if(IsSet(DIRTY_T) && IsSet(DIRTY_V))
- {
- return new Pair(Text, Value);
- }
- if(IsSet(DIRTY_T))
- {
- return Text;
- }
- if(IsSet(DIRTY_V))
- {
- return new Pair(null, Value);
- }
- return null;
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return IsTrackingViewState;
- }
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.LoadViewState(object state)
- {
- LoadViewState(state);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs
deleted file mode 100644
index c0217828ea8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemCollection.cs
+++ /dev/null
@@ -1,361 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListItemCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-using System.Reflection;
-
-namespace System.Web.UI.WebControls
-{
- //[DefaultMember("Item")] I need the this[...] thing...
- //[Editor("??", typeof(Design.WebControls.ListItemCollectionEditor))]
- public class ListItemCollection : IList, ICollection, IEnumerable, IStateManager
- {
- private ArrayList items;
- private bool saveAll;
- private bool marked;
-
- public ListItemCollection()
- {
- items = new ArrayList();
- saveAll = false;
- marked = false;
- }
-
- public int Capacity
- {
- get
- {
- return items.Capacity;
- }
- set
- {
- items.Capacity = value;
- }
- }
-
- public int Count
- {
- get
- {
- return items.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return items.IsReadOnly;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return items.IsSynchronized;
- }
- }
-
- public ListItem this[int index]
- {
- get
- {
- if(index < 0 || index >= Count)
- return null;
- return (ListItem)(items[index]);
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void Add(ListItem item)
- {
- items.Add(item);
- if(marked)
- item.Dirty = true;
- }
-
- public void Add(string item)
- {
- Add(new ListItem(item));
- }
-
- public void AddRange(ListItem[] items)
- {
- foreach(ListItem item in items)
- {
- if(item!=null)
- Add(item);
- }
- }
-
- public void Clear()
- {
- items.Clear();
- if(marked)
- saveAll = true;
- }
-
- public bool Contains(ListItem item)
- {
- return items.Contains(item);
- }
-
- public void CopyTo(Array array, int index)
- {
- items.CopyTo(array, index);
- }
-
- public ListItem FindByText(string text)
- {
- int i=-1;
- foreach(object current in items)
- {
- i++;
- if(((ListItem)current).Text == text)
- break;
- }
- return (i==-1 ? null : (ListItem)items[i]);
- }
-
- public ListItem FindByValue(string value)
- {
- foreach(ListItem current in items)
- {
- if(current.Value == value)
- {
- return current;
- }
- }
- return null;
- }
-
- internal int FindByValueInternal(string value)
- {
- int i = -1;
- foreach(ListItem current in items)
- {
- i++;
- if(current.Value == value)
- {
- return i;
- }
- }
- return -1;
- }
-
- public IEnumerator GetEnumerator()
- {
- return items.GetEnumerator();
- }
-
- public int IndexOf(ListItem item)
- {
- return items.IndexOf(item);
- }
-
- public void Insert(int index, ListItem item)
- {
- items.Insert(index, item);
- if(marked)
- saveAll = true;
- }
-
- public void Insert(int index, string item)
- {
- Insert(index, new ListItem(item));
- }
-
- public void RemoveAt(int index)
- {
- if(index < 0 || index >= items.Count)
- return;
- items.RemoveAt(index);
- if(marked)
- saveAll = true;
- }
-
- public void Remove(ListItem item)
- {
- RemoveAt(IndexOf(item));
- }
-
- public void Remove(string item)
- {
- RemoveAt(IndexOf(ListItem.FromString(item)));
- }
-
- internal object SaveViewState()
- {
- if(saveAll)
- {
- string[] keys = new string[Count];
- string[] vals = new string[Count];
- for(int i=0; i < Count; i++)
- {
- keys[i] = this[i].Text;
- vals[i] = this[i].Value;
- }
- return new Triplet(Count, keys, vals);
- }
- ArrayList indices = new ArrayList();
- ArrayList states = new ArrayList();
- object o;
- for(int i=0; i < Count; i++)
- {
- o = this[i].SaveViewState();
- if(o!=null)
- {
- indices.Add(i);
- states.Add(o);
- }
- }
- if(indices.Count > 0)
- return new Pair(indices, states);
- return null;
- }
-
- internal void LoadViewState(object savedState)
- {
- if(savedState!=null)
- {
- if(savedState is Pair)
- {
- ArrayList indices = (ArrayList)(((Pair)savedState).First);
- ArrayList states = (ArrayList)(((Pair)savedState).Second);
- for(int i=0; i < indices.Count; i++)
- {
- if( (int)indices[i] < Count )
- this[i].LoadViewState(states[i]);
- else
- {
- ListItem temp = new ListItem();
- temp.LoadViewState(states[i]);
- Add(temp);
- }
- }
- }
- if(savedState is Triplet)
- {
- Triplet t = (Triplet)savedState;
- items = new ArrayList((int)t.First);
- saveAll = true;
- string[] text = (string[])t.Second;
- string[] vals = (string[])t.Third;
- for(int i=0; i < text.Length; i++)
- items.Add(new ListItem(text[i], vals[i]));
- }
- }
- }
-
- internal void TrackViewState()
- {
- marked = true;
- foreach(ListItem current in this)
- current.TrackViewState();
- }
-
- bool IList.IsFixedSize
- {
- get
- {
- return false;
- }
- }
-
- object IList.this[int index]
- {
- get
- {
- return this[index];
- }
-
- set
- {
- if(index >= 0 && index < Count)
- if(value is ListItem)
- items[index] = (ListItem) value;
- }
- }
-
- int IList.Add(object item)
- {
- int index = (item is ListItem ? items.Add((ListItem)item) : -1);
- if(index!=-1 && marked)
- ((ListItem)item).Dirty = true;
- return index;
- }
-
- bool IList.Contains(object item)
- {
- if(item is ListItem)
- return Contains((ListItem)item);
- return false;
- }
-
- int IList.IndexOf(object item)
- {
- if(item is ListItem)
- return IndexOf((ListItem)item);
- return -1;
- }
-
- void IList.Insert(int index, object item)
- {
- if(item is ListItem)
- Insert(index, (ListItem)item);
- }
-
- void IList.Remove(object item)
- {
- if(item is string)
- Remove((string)item);
- if(item is ListItem)
- Remove((ListItem)item);
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return marked;
- }
- }
-
- void IStateManager.LoadViewState(object state)
- {
- LoadViewState(state);
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs
deleted file mode 100644
index 16c60a196a7..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemControlBuilder.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ListItemControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ListItemControlBuilder : ControlBuilder
- {
- public ListItemControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
-
- public override bool HtmlDecodeLiterals()
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs
deleted file mode 100755
index 3d45e73693a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListItemType.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ListItemType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ListItemType
- {
- Header,
- Footer,
- Item,
- AlternatingItem,
- SelectedItem,
- EditItem,
- Separator,
- Pager
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs
deleted file mode 100755
index f7c7967356c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListSelectionMode.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ListSelectionMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ListSelectionMode
- {
- Single,
- Multiple
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs
deleted file mode 100644
index a2d4db5cc9e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Literal.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Literal
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultProperty("Text")]
- [ControlBuilder(typeof(LiteralControlBuilder))]
- //[DataBindingHandler("??")]
- public class Literal : Control
- {
- public Literal () : base ()
- {
- }
-
- public string Text
- {
- get {
- object o = ViewState ["Text"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["Text"] = value; }
- }
-
- protected override ControlCollection CreateControlCollection ()
- {
- return new EmptyControlCollection (this);
- }
-
- protected override void AddParsedSubObject (object obj)
- {
- if (!(obj is LiteralControl))
- throw new HttpException (HttpRuntime.FormatResourceString (
- "Cannot_Have_Children_Of_Type", "Literal",
- obj.GetType ().Name.ToString ()));
-
- Text = ((LiteralControl) obj).Text;
- }
-
- protected override void Render (HtmlTextWriter writer)
- {
- if (Text.Length > 0)
- writer.Write (Text);
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs
deleted file mode 100644
index 75dcb77192a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/LiteralControlBuilder.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: LiteralControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class LiteralControlBuilder : ControlBuilder
- {
- public LiteralControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
-
- public override void AppendSubBuilder(ControlBuilder subBuilder)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Control_does_not_allow_children",(typeof(Literal)).ToString()));
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventArgs.cs
deleted file mode 100644
index 8de0d910c4b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventArgs.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: MonthChangedEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class MonthChangedEventArgs
- {
- private DateTime nDate;
- private DateTime pDate;
-
- public MonthChangedEventArgs(DateTime newDate, DateTime previousDate)
- {
- nDate = newDate;
- pDate = previousDate;
- }
-
- public DateTime NewDate
- {
- get
- {
- return nDate;
- }
- }
-
- public DateTime PreviousDate
- {
- get
- {
- return pDate;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs
deleted file mode 100644
index 99a7a27157e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/MonthChangedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void MonthChangedEventHandler(object sender, MonthChangedEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs
deleted file mode 100755
index 91d6cf3003b..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/NextPrevFormat.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: NextPrevFormat
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum NextPrevFormat
- {
- CustomText,
- ShortMonth,
- FullMonth
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagedDataSource.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagedDataSource.cs
deleted file mode 100644
index 41546a4c814..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PagedDataSource.cs
+++ /dev/null
@@ -1,470 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: PagedDataSource
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class PagedDataSource : ICollection, IEnumerable, ITypedList
- {
- private int pageSize;
- private bool allowPaging;
- private int currentPageIndex;
- private bool allowCustomPaging;
- private int virtualCount;
-
- private IEnumerable dataSource;
-
- public PagedDataSource()
- {
- Initialize();
- }
-
- private void Initialize()
- {
- pageSize = 10;
- allowPaging = false;
- currentPageIndex = 0;
- allowCustomPaging = false;
- virtualCount = 0;
- }
-
- public bool AllowCustomPaging
- {
- get
- {
- return allowCustomPaging;
- }
- set
- {
- allowCustomPaging = value;
- }
- }
-
- public bool AllowPaging
- {
- get
- {
- return allowPaging;
- }
- set
- {
- allowPaging = value;
- }
- }
-
- public int Count
- {
- get
- {
- if(dataSource != null)
- {
- if(IsPagingEnabled)
- {
- return DataSourceCount;
- }
- if(IsCustomPagingEnabled)
- {
- return pageSize;
- }
- if(IsLastPage)
- {
- return (DataSourceCount - FirstIndexInPage);
- }
- return pageSize;
- }
- return 0;
- }
- }
-
- public int CurrentPageIndex
- {
- get
- {
- return currentPageIndex;
- }
- }
-
- public IEnumerable DataSource
- {
- get
- {
- return dataSource;
- }
- set
- {
- dataSource = value;
- }
- }
-
- public int DataSourceCount
- {
- get
- {
- if(dataSource != null)
- {
- if(IsCustomPagingEnabled)
- {
- return virtualCount;
- }
- if(dataSource is ICollection)
- {
- return ((ICollection)dataSource).Count;
- }
- throw new HttpException(HttpRuntime.FormatResourceString("PagedDataSource_Cannot_Get_Count"));
- }
- return 0;
- }
- }
-
- public int FirstIndexInPage
- {
- get
- {
- if(dataSource != null && IsPagingEnabled && IsCustomPagingEnabled)
- {
- return (currentPageIndex * pageSize);
- }
- return 0;
- }
- }
-
- public bool IsCustomPagingEnabled
- {
- get
- {
- return (IsPagingEnabled && allowCustomPaging);
- }
- }
-
- public bool IsFirstPage
- {
- get
- {
- return (!IsPagingEnabled || (CurrentPageIndex == 0));
- }
- }
-
- public bool IsLastPage
- {
- get
- {
- return (!IsPagingEnabled || (CurrentPageIndex == PageCount));
- }
- }
-
- public bool IsPagingEnabled
- {
- get
- {
- return (allowPaging && pageSize != 0);
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public int PageCount
- {
- get
- {
- if(dataSource != null)
- {
- int total = DataSourceCount;
- if(!IsPagingEnabled)
- {
- return total;
- }
- return (total + pageSize - 1)/pageSize;
- }
- return 0;
- }
- }
-
- public int PageSize
- {
- get
- {
- return pageSize;
- }
- set
- {
- pageSize = value;
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public int VirtualCount
- {
- get
- {
- return virtualCount;
- }
- set
- {
- virtualCount = value;
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(object current in this)
- {
- array.SetValue(array, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- int fInd = FirstIndexInPage;
- int count = -1;
- if(dataSource is ICollection)
- {
- count = Count;
- }
-
- if(dataSource is IList)
- {
- return (new PrivateListEnumerator((IList)dataSource, fInd, count));
- }
- if(dataSource is Array)
- {
- return (new PrivateArrayEnumerator((object[])dataSource, fInd, count));
- }
- if(dataSource is ICollection)
- {
- return (new PrivateICollectionEnumerator((ICollection)dataSource, fInd, count));
- }
- if(allowCustomPaging)
- {
- return (new PrivateIEnumeratorEnumerator(dataSource.GetEnumerator(), Count));
- }
- return dataSource.GetEnumerator();
- }
-
- class PrivateIEnumeratorEnumerator : IEnumerator
- {
- private int index;
- private int max;
-
- private IEnumerator enumerator;
-
- public PrivateIEnumeratorEnumerator(IEnumerator enumerator, int count)
- {
- this.enumerator = enumerator;
- index = -1;
- max = count;
- }
-
- public bool MoveNext()
- {
- enumerator.MoveNext();
- index++;
- return (index < max);
- }
-
- public void Reset()
- {
- index = -1;
- enumerator.Reset();
- }
-
- public object Current
- {
- get
- {
- return enumerator.Current;
- }
- }
- }
-
- class PrivateICollectionEnumerator : IEnumerator
- {
- private int index;
- private int start;
- private int max;
-
- private ICollection collection;
- private IEnumerator collEnum;
-
- public PrivateICollectionEnumerator(ICollection collection, int start, int count)
- {
- this.collection = collection;
- this.start = start;
- index = -1;
- max = start + count;
- if(max > collection.Count)
- {
- max = collection.Count;
- }
- }
-
- public bool MoveNext()
- {
- if(collEnum == null)
- {
- int cIndex = 0;
- collEnum = collection.GetEnumerator();
- while(cIndex < start)
- {
- collEnum.MoveNext();
- }
- }
- collEnum.MoveNext();
- index++;
- return (start + index < max);
- }
-
- public void Reset()
- {
- index = -1;
- collEnum = null;
- }
-
- public object Current
- {
- get
- {
- return collEnum.Current;
- }
- }
- }
-
- class PrivateArrayEnumerator : IEnumerator
- {
- private int index;
- private int start;
- private int max;
- private object[] values;
-
- public PrivateArrayEnumerator(object[] values, int start, int count)
- {
- this.values = values;
- this.start = start;
- index = -1;
- max = start + count;
- if(max > this.values.Length)
- {
- max = this.values.Length;
- }
- }
-
- public bool MoveNext()
- {
- index++;
- return (index + start < max);
- }
-
- public void Reset()
- {
- index = -1;
- }
-
- public object Current
- {
- get
- {
- if(index >= 0)
- {
- return values[index + start];
- }
- throw new InvalidOperationException("Enumerator_MoveNext_Not_Called");
- }
- }
- }
-
- class PrivateListEnumerator : IEnumerator
- {
- private int index;
- private int start;
- private int max;
- private IList collection;
-
- public PrivateListEnumerator(IList list, int start, int count)
- {
- collection = list;
- this.start = start;
- index = -1;
- max = start + count;
- if(max > list.Count)
- {
- max = list.Count;
- }
- }
-
- public bool MoveNext()
- {
- index++;
- return (index + start < max);
- }
-
- public void Reset()
- {
- index = -1;
- }
-
- public object Current
- {
- get
- {
- if(index >= 0)
- {
- return collection[index + start];
- }
- throw new InvalidOperationException("Enumerator_MoveNext_Not_Called");
- }
- }
- }
-
- public string GetListName(PropertyDescriptor[] listAccessors)
- {
- return String.Empty;
- }
-
- public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
- {
- if(dataSource != null)
- {
- if(dataSource is ITypedList)
- {
- return ((ITypedList)dataSource).GetItemProperties(listAccessors);
- }
- }
- return null;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs
deleted file mode 100755
index 5f99cee5773..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PagerMode.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: PagerMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum PagerMode
- {
- NextPrev,
- NumericPages
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs
deleted file mode 100755
index 2ad9b466413..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PagerPosition.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: PagerPosition
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum PagerPosition
- {
- Bottom,
- Top,
- TopAndBottom
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs
deleted file mode 100644
index 82c7ea11d37..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Panel.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Panel
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- //[Designer("??")]
- [ParseChildren(false)]
- [PersistChildren(true)]
- [ToolboxData("<{0}:Panel runat=\"server\">Panel</{0}:Panel>")]
- public class Panel: WebControl
- {
- public Panel(): base(HtmlTextWriterTag.Div)
- {
- }
-
- public virtual string BackImageUrl
- {
- get
- {
- object o = ViewState["BackImageUrl"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["BackImageUrl"] = value;
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- object o = ViewState["HorizontalAlign"];
- if(o != null)
- return (HorizontalAlign)o;
- return HorizontalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(HorizontalAlign), value))
- {
- throw new ArgumentException();
- }
- ViewState["HorizontalAlign"] = value;
- }
- }
-
- public virtual bool Wrap
- {
- get
- {
- object o = ViewState["Wrap"];
- if(o != null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["Wrap"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(BackImageUrl.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundImage, "url(" + ResolveUrl(BackImageUrl) + ")");
- }
- if(HorizontalAlign != HorizontalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, TypeDescriptor.GetConverter(typeof(HorizontalAlign)).ConvertToString(HorizontalAlign));
- }
- if(Wrap)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Nowrap, "nowrap");
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs
deleted file mode 100644
index fd00a47da9d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolder.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: PlaceHolder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ControlBuilder(typeof(PlaceHolderControlBuilder))]
- public class PlaceHolder : Control
- {
- public PlaceHolder(): base()
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs
deleted file mode 100644
index 3bbd68c6d22..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PlaceHolderControlBuilder.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: PlaceHolderControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class PlaceHolderControlBuilder : ControlBuilder
- {
- public PlaceHolderControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs
deleted file mode 100644
index c999695a8aa..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButton.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RadioButton
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- //[Designer("??")]
- public class RadioButton : CheckBox, IPostBackDataHandler
- {
- public RadioButton () : base ()
- {
- }
-
- public virtual string GroupName
- {
- get {
- object o = ViewState ["GroupName"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["GroupName"] = value; }
- }
-
- protected override void OnPreRender (EventArgs e)
- {
- base.OnPreRender (e);
- if (Page != null && Enabled && !Checked)
- Page.RegisterRequiresPostBack (this);
-
- if(GroupName.Length == 0)
- GroupName = UniqueID;
- }
-
- internal override void RenderInputTag (HtmlTextWriter writer, string id)
- {
- writer.AddAttribute (HtmlTextWriterAttribute.Id, id);
- writer.AddAttribute (HtmlTextWriterAttribute.Type, "radio");
- writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueGroupNamePrivate);
- writer.AddAttribute (HtmlTextWriterAttribute.Value, ValueAttributePrivate);
-
- if (Checked)
- writer.AddAttribute (HtmlTextWriterAttribute.Checked, "checked");
-
- if (AutoPostBack){
- writer.AddAttribute (HtmlTextWriterAttribute.Onclick,
- Page.GetPostBackClientEvent (this, ""));
- writer.AddAttribute ("language", "javascript");
- }
-
- if (AccessKey.Length > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Accesskey, AccessKey);
-
- if (TabIndex > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Tabindex,
- TabIndex.ToString (NumberFormatInfo.InvariantInfo));
-
- writer.RenderBeginTag (System.Web.UI.HtmlTextWriterTag.Input);
- writer.RenderEndTag ();
- }
-
- private string UniqueGroupNamePrivate
- {
- get {
- string retVal = GroupName;
- int unique = UniqueID.LastIndexOf (':');
- if (unique >= 0)
- retVal += UniqueID.Substring (unique + 1);
-
- return retVal;
- }
- }
-
- private string ValueAttributePrivate
- {
- get {
- string retVal = Attributes ["value"];
- if (retVal != null)
- return retVal;
-
- if (ID != null)
- return ID;
-
- return UniqueID;
- }
- }
-
- bool IPostBackDataHandler.LoadPostData (string postDataKey,
- NameValueCollection postCollection)
- {
- bool _checked = Checked;
- if (postCollection [UniqueGroupNamePrivate] == ValueAttributePrivate){
- if (_checked)
- return false;
- Checked = true;
- return true;
- }
-
- if (_checked)
- Checked = false;
- return true;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent ()
- {
- OnCheckedChanged (EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs
deleted file mode 100644
index 0bc441cc5e3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RadioButtonList.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RadioButtonList
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ValidationProperty("SelectedItem")]
- public class RadioButtonList : ListControl, IRepeatInfoUser, INamingContainer, IPostBackDataHandler
- {
- private bool selectionIndexChanged;
- private short tabIndex;
-
- public RadioButtonList(): base()
- {
- selectionIndexChanged = false;
- }
-
- public virtual int CellPadding
- {
- get
- {
- if(ControlStyleCreated)
- {
- return (int)(((TableStyle)ControlStyle).CellPadding);
- }
- return -1;
- }
- set
- {
- ((TableStyle)ControlStyle).CellPadding = value;
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- if(ControlStyleCreated)
- {
- return (int)(((TableStyle)ControlStyle).CellSpacing);
- }
- return -1;
- }
- set
- {
- ((TableStyle)ControlStyle).CellSpacing = value;
- }
- }
-
- public virtual int RepeatColumns
- {
- get
- {
- object o = ViewState["RepeatColumns"];
- if(o != null)
- return (int)o;
- return 0;
- }
- set
- {
- if(value < 0)
- throw new ArgumentOutOfRangeException("value");
- ViewState["RepeatColumns"] = value;
- }
- }
-
- public virtual RepeatDirection RepeatDirection
- {
- get
- {
- object o = ViewState["RepeatDirection"];
- if(o != null)
- return (RepeatDirection)o;
- return RepeatDirection.Vertical;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatDirection), value))
- throw new ArgumentException();
- ViewState["RepeatDirection"] = value;
- }
- }
-
- public virtual RepeatLayout RepeatLayout
- {
- get
- {
- object o = ViewState["RepeatLayout"];
- if(o != null)
- return (RepeatLayout)o;
- return RepeatLayout.Table;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- ViewState["RepeatLayout"] = value;
- }
- }
-
- public virtual TextAlign TextAlign
- {
- get
- {
- object o = ViewState["TextAlign"];
- if(o != null)
- return (TextAlign)o;
- return TextAlign.Right;
- }
- set
- {
- if(!Enum.IsDefined(typeof(TextAlign), value))
- throw new ArgumentException();
- ViewState["TextAlign"] = value;
- }
- }
-
- protected override Style CreateControlStyle()
- {
- return new TableStyle(ViewState);
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- RepeatInfo info = new RepeatInfo();
- Style cStyle = (ControlStyleCreated ? ControlStyle : null);
- bool dirty = false;
- tabIndex = TabIndex;
- if(tabIndex != 0)
- {
- dirty = !ViewState.IsItemDirty("TabIndex");
- TabIndex = 0;
- }
- info.RepeatColumns = RepeatColumns;
- info.RepeatDirection = RepeatDirection;
- info.RenderRepeater(writer, this, cStyle, this);
- if(tabIndex != 0)
- {
- TabIndex = tabIndex;
- }
- if(dirty)
- {
- ViewState.SetItemDirty("TabIndex", false);
- }
- }
-
- bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
- {
- string value = postCollection[postDataKey];
- for(int i=0; i < Items.Count; i++)
- {
- if(Items[i].Value == value)
- {
- if(i != SelectedIndex)
- {
- SelectedIndex = i;
- }
- return true;
- }
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent()
- {
- if(selectionIndexChanged)
- OnSelectedIndexChanged(EventArgs.Empty);
- }
-
- Style IRepeatInfoUser.GetItemStyle(System.Web.UI.WebControls.ListItemType itemType, int repeatIndex)
- {
- return null;
- }
-
- void IRepeatInfoUser.RenderItem (System.Web.UI.WebControls.ListItemType itemType,
- int repeatIndex,
- RepeatInfo repeatInfo,
- HtmlTextWriter writer)
- {
- /* Create a new RadioButton as if it was defined in the page and render it */
- RadioButton button = new RadioButton ();
- button.GroupName = UniqueID;
- button.TextAlign = TextAlign;
- button.AutoPostBack = AutoPostBack;
- button.ID = ClientID + "_" + repeatIndex.ToString (NumberFormatInfo.InvariantInfo);;
- object view_state = ViewState ["TabIndex"];
- if (view_state != null)
- button.TabIndex = (short) view_state;
- ListItem current = Items [repeatIndex];
- button.Text = current.Text;
- button.Attributes ["value"] = current.Value;
- button.Checked = current.Selected;
- button.RenderControl (writer);
- }
-
- bool IRepeatInfoUser.HasFooter
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasHeader
- {
- get
- {
- return false;
- }
- }
-
- bool IRepeatInfoUser.HasSeparators
- {
- get
- {
- return false;
- }
- }
-
- int IRepeatInfoUser.RepeatedItemCount
- {
- get
- {
- return Items.Count;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs
deleted file mode 100644
index 43a496023b5..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RangeValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Xml;
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxData("<{0}:RangeValidator runat=\"server\" "
- + "ErrorMessage=\"RangeValidator\"></{0}:RangeValidator>")]
- public class RangeValidator : BaseCompareValidator
- {
- public RangeValidator(): base()
- {
- }
-
- public string MaximumValue
- {
- get
- {
- object o = ViewState["MaximumValue"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["MaximumValue"] = value;
- }
- }
-
- public string MinimumValue
- {
- get
- {
- object o = ViewState["MinimumValue"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["MinimumValue"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(base.RenderUplevel)
- {
- writer.AddAttribute("evaluationfunction", "RangeValidatorEvaluateIsValid");
- writer.AddAttribute("maximumvalue", MaximumValue);
- writer.AddAttribute("minimumvalue", MinimumValue);
- }
- }
-
- protected override bool ControlPropertiesValid()
- {
- string max = MaximumValue;
- if(!CanConvert(max, Type))
- {
- string[] fmt = new string[4];
- fmt[0] = max;
- fmt[1] = "MaximumValue";
- fmt[2] = ID;
- fmt[3] = PropertyConverter.EnumToString(typeof(ValidationDataType), Type);
- throw new HttpException(HttpRuntime.FormatResourceString("Validator_value_bad_type", fmt));
- }
- string min = MaximumValue;
- if(!CanConvert(min, Type))
- {
- string[] fmt = new string[4];
- fmt[0] = min;
- fmt[1] = "MinimumValue";
- fmt[2] = ID;
- fmt[3] = PropertyConverter.EnumToString(typeof(ValidationDataType), Type);
- throw new HttpException(HttpRuntime.FormatResourceString("Validator_value_bad_type", fmt));
- }
-
- if(Compare(max, min, ValidationCompareOperator.GreaterThan, ValidationDataType.Double))
- {
- string[] fmt = new string[3];
- fmt[0] = min;
- fmt[1] = max;
- fmt[2] = PropertyConverter.EnumToString(typeof(ValidationDataType), Type);
- throw new HttpException(HttpRuntime.FormatResourceString("Validator_range_overalap", fmt));
- }
- return base.ControlPropertiesValid();
- }
-
- protected override bool EvaluateIsValid()
- {
- string ctrl = GetControlValidationValue(ControlToValidate);
- if(ctrl == null || ctrl.Trim().Length == 0)
- {
- return true;
- }
- bool retVal = Compare(ctrl, MinimumValue, ValidationCompareOperator.GreaterThanEqual,
- ValidationDataType.String);
- if(!retVal)
- {
- retVal = Compare(ctrl, MaximumValue, ValidationCompareOperator.LessThanEqual,
- ValidationDataType.String);
- }
- return retVal;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs
deleted file mode 100644
index 961e45def85..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RegularExpressionValidator.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RegularExpressionValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Text.RegularExpressions;
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxData("<{0}:RegularExpressionValidator runat=\"server\" "
- + "ErrorMessage=\"RegularExpressionValidator\">"
- + "</{0}:RegularExpressionValidator>")]
- public class RegularExpressionValidator : BaseValidator
- {
- public RegularExpressionValidator(): base()
- {
- }
-
- public string ValidationExpression
- {
- get
- {
- object o = ViewState["ValidationExpression"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- try
- {
- Regex.IsMatch("", value);
- } catch(Exception)
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Validator_bad_regex", value));
- }
- ViewState["ValidationExpression"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(base.RenderUplevel)
- {
- writer.AddAttribute("evaluationfunction", "RegularExpressionValidatorEvaluateIsValid");
- string exp = ValidationExpression;
- if(exp.Length > 0)
- {
- writer.AddAttribute("validationexpression", exp);
- }
- }
- }
-
- protected override bool EvaluateIsValid()
- {
- string ctrl = GetControlValidationValue(ControlToValidate);
- bool retVal = true;
- if(ctrl == null || ctrl.Trim().Length == 0)
- {
- return true;
- }
- try
- {
- Match match = Regex.Match(ctrl, ValidationExpression);
- if(match.Success && match.Index > 0 && match.Length == ctrl.Length)
- {
- retVal = true;
- } else
- {
- retVal = false;
- }
- } catch(Exception)
- {
- retVal = true;
- }
- return retVal;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs
deleted file mode 100755
index fc26596dafc..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatDirection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: RepeatDirection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum RepeatDirection
- {
- Horizontal,
- Vertical
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs
deleted file mode 100644
index 79ad32eb23d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs
+++ /dev/null
@@ -1,372 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RepeatInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class RepeatInfo
- {
- private bool outerTableImp;
- private int repeatColumns;
- private RepeatDirection repeatDirection;
- private RepeatLayout repeatLayout;
-
- public RepeatInfo()
- {
- outerTableImp = false;
- repeatColumns = 0;
- repeatDirection = RepeatDirection.Vertical;
- repeatLayout = RepeatLayout.Table;
- }
-
- public bool OuterTableImplied
- {
- get
- {
- return outerTableImp;
- }
- set
- {
- outerTableImp = value;
- }
- }
-
- public int RepeatColumns
- {
- get
- {
- return repeatColumns;
- }
- set
- {
- repeatColumns = value;
- }
- }
-
- public RepeatDirection RepeatDirection
- {
- get
- {
- return repeatDirection;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatDirection), value))
- throw new ArgumentException();
- repeatDirection = value;
- }
- }
-
- public RepeatLayout RepeatLayout
- {
- get
- {
- return repeatLayout;
- }
- set
- {
- if(!Enum.IsDefined(typeof(RepeatLayout), value))
- throw new ArgumentException();
- repeatLayout = value;
- }
- }
-
- public void RenderRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
- {
- if(RepeatDirection == RepeatDirection.Vertical)
- {
- DoVerticalRendering(writer, user, controlStyle, baseControl);
- } else
- {
- DoHorizontalRendering(writer, user, controlStyle, baseControl);
- }
- }
-
- private void DoVerticalRendering(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
- {
- int total = user.RepeatedItemCount;
- int colsCount;
- int rowsCount;
- if(repeatColumns == 0 || repeatColumns==1)
- {
- colsCount = 1;
- rowsCount = total;
- } else
- {
- colsCount = repeatColumns;
- rowsCount = (total + repeatColumns - 1) / repeatColumns;
- if(rowsCount ==0 && total != 0)
- {
- rowsCount = 1;
- colsCount = total;
- }
- }
- WebControl ctrl = null;
- bool isTable = true;
- bool hasSeps = user.HasSeparators;
- if(!outerTableImp)
- {
- if(RepeatLayout == RepeatLayout.Table)
- {
- ctrl = new Table();
- } else
- {
- ctrl = new WebControl(HtmlTextWriterTag.Span);
- isTable = false;
- }
- }
-
- if(ctrl != null)
- {
- ctrl.ID = baseControl.ClientID;
- ctrl.CopyBaseAttributes(baseControl);
- ctrl.ApplyStyle(controlStyle);
- ctrl.RenderBeginTag(writer);
- }
-
- Style itemStyle;
- int colSpan = 0;
- if(user.HasHeader)
- {
- if(isTable)
- {
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- if(rowsCount != 1)
- {
- colSpan = rowsCount;
- if(hasSeps)
- colSpan += rowsCount;
- writer.AddAttribute(HtmlTextWriterAttribute.Colspan, colSpan.ToString(NumberFormatInfo.InvariantInfo));
- }
- itemStyle = user.GetItemStyle(ListItemType.Header, -1);
- if(itemStyle != null)
- {
- itemStyle.AddAttributesToRender(writer);
- }
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- user.RenderItem(ListItemType.Header, -1, this, writer);
- if(isTable)
- {
- writer.RenderEndTag();
- writer.RenderEndTag();
- } else
- {
- if(!outerTableImp)
- {
- writer.WriteFullBeginTag("br");
- }
- }
- }
-
- int rowIndex = 0;
- int colIndex = 0;
- int index = 0;
- while(rowIndex < rowsCount)
- {
- if(isTable)
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- colIndex = 0;
- while(colIndex < colsCount)
- {
- index = rowIndex + colIndex * rowsCount;
- if(index < total)
- {
- if(isTable)
- {
- itemStyle = user.GetItemStyle(ListItemType.Item, index);
- if(itemStyle != null)
- {
- itemStyle.AddAttributesToRender(writer);
- }
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- user.RenderItem(ListItemType.Item, index, this, writer);
- if(isTable)
- writer.RenderEndTag();
- if(hasSeps && index != (total - 1))
- {
- if(colsCount == 1)
- {
- writer.RenderEndTag();
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- } else
- {
- writer.WriteFullBeginTag("br");
- }
- if(isTable)
- {
- itemStyle = user.GetItemStyle(ListItemType.Separator, index);
- if(itemStyle != null)
- itemStyle.AddAttributesToRender(writer);
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- if(index < total)
- user.RenderItem(ListItemType.Separator, index, this, writer);
- if(isTable)
- writer.RenderEndTag();
- }
- }
- colIndex++;
- }
- if(isTable)
- writer.RenderEndTag();
- else
- if(rowIndex != (rowsCount - 1) || (user.HasFooter && !outerTableImp))
- writer.WriteFullBeginTag("br");
- rowIndex++;
- }
- if(user.HasFooter)
- {
- if(isTable)
- {
- writer.RenderBeginTag(HtmlTextWriterTag.Tr);
- if(colsCount != 1)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Colspan, colSpan.ToString(NumberFormatInfo.InvariantInfo));
- }
- itemStyle = user.GetItemStyle(ListItemType.Footer, -1);
- if(itemStyle != null)
- {
- itemStyle.AddAttributesToRender(writer);
- }
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
- user.RenderItem(ListItemType.Footer, -1, this, writer);
- if(isTable)
- {
- writer.RenderEndTag();
- writer.RenderEndTag();
- }
- }
- if(ctrl != null)
- {
- ctrl.RenderEndTag(writer);
- }
- }
-
- private void DoHorizontalRendering (HtmlTextWriter writer,
- IRepeatInfoUser user,
- Style controlStyle,
- WebControl baseControl)
- {
- /* Based on DoVerticalRendering */
- int total = user.RepeatedItemCount;
- int colsCount = repeatColumns;
- int rowsCount = 0;
-
- if (colsCount == 0)
- colsCount = total;
- WebControl ctrl = null;
- bool isTable = true;
- bool hasSeps = user.HasSeparators;
- if (!outerTableImp){
- isTable = (RepeatLayout == RepeatLayout.Table);
- ctrl = (isTable) ? new Table () : new WebControl (HtmlTextWriterTag.Span);
- ctrl.ID = baseControl.ClientID;
- ctrl.CopyBaseAttributes (baseControl);
- ctrl.ApplyStyle (controlStyle);
- ctrl.RenderBeginTag (writer);
- }
-
- Style itemStyle;
- int colSpan = 0;
- if (user.HasHeader){
- if (isTable){
- writer.RenderBeginTag (HtmlTextWriterTag.Tr);
- if (rowsCount != 1){
- colSpan = rowsCount;
- if (hasSeps)
- colSpan += rowsCount;
- writer.AddAttribute (HtmlTextWriterAttribute.Colspan,
- colSpan.ToString (NumberFormatInfo.InvariantInfo));
- }
- itemStyle = user.GetItemStyle (ListItemType.Header, -1);
- if (itemStyle != null)
- itemStyle.AddAttributesToRender (writer);
- writer.RenderBeginTag (HtmlTextWriterTag.Td);
- }
-
- user.RenderItem (ListItemType.Header, -1, this, writer);
-
- if (isTable){
- writer.RenderEndTag();
- writer.RenderEndTag();
- } else if (!outerTableImp)
- writer.WriteFullBeginTag ("br");
- }
-
- for (int index = 0; index < total; index++){
- if (isTable && index == 0)
- writer.RenderBeginTag (HtmlTextWriterTag.Tr);
-
- if (isTable){
- itemStyle = user.GetItemStyle (ListItemType.Item, index);
- if (itemStyle != null)
- itemStyle.AddAttributesToRender(writer);
- writer.RenderBeginTag(HtmlTextWriterTag.Td);
- }
-
- user.RenderItem(ListItemType.Item, index, this, writer);
- if (isTable)
- writer.RenderEndTag ();
-
- if (hasSeps && index != (total - 1)){
- if (isTable){
- itemStyle = user.GetItemStyle (ListItemType.Separator, index);
- if (itemStyle != null)
- itemStyle.AddAttributesToRender (writer);
- writer.RenderBeginTag (HtmlTextWriterTag.Td);
- }
- user.RenderItem (ListItemType.Separator, index, this, writer);
- if (isTable)
- writer.RenderEndTag ();
- }
- rowsCount++;
- if (rowsCount == total || index == (total - 1)) {
- if (isTable)
- writer.RenderEndTag ();
- else if (rowsCount < total)
- writer.WriteFullBeginTag ("br");
- rowsCount = 0;
- }
- }
-
- if (user.HasFooter){
- if (isTable){
- writer.RenderBeginTag (HtmlTextWriterTag.Tr);
- if (colsCount != 1)
- writer.AddAttribute (HtmlTextWriterAttribute.Colspan,
- colSpan.ToString(NumberFormatInfo.InvariantInfo));
-
- itemStyle = user.GetItemStyle (ListItemType.Footer, -1);
- if(itemStyle != null)
- itemStyle.AddAttributesToRender (writer);
- writer.RenderBeginTag (HtmlTextWriterTag.Td);
- }
- user.RenderItem (ListItemType.Footer, -1, this, writer);
- if (isTable){
- writer.RenderEndTag ();
- writer.RenderEndTag ();
- }
- }
-
- if (ctrl != null)
- ctrl.RenderEndTag(writer);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs
deleted file mode 100755
index de1e81530e0..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeatLayout.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: RepeatLayout
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum RepeatLayout
- {
- Table,
- Flow
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Repeater.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Repeater.cs
deleted file mode 100644
index 612be547bf9..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Repeater.cs
+++ /dev/null
@@ -1,366 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Repeater
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 90%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.Web.Utils;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultEvent("ItemCommand")]
- [DefaultProperty("DataSource")]
- //[Designer("??")]
- [ParseChildren(true)]
- [PersistChildren(false)]
- public class Repeater : Control, INamingContainer
- {
- private static readonly object ItemCommandEvent = new object();
- private static readonly object ItemCreatedEvent = new object();
- private static readonly object ItemDataBoundEvent = new object();
-
- private static readonly string ITEMCOUNT = "Repeater_Item_Count";
-
- private ITemplate alternatingItemTemplate;
- private ITemplate footerTemplate;
- private ITemplate headerTemplate;
- private ITemplate itemTemplate;
- private ITemplate separatorTemplate;
- private object dataSource;
-
- private RepeaterItemCollection items;
- private ArrayList itemsArrayList;
-
- public Repeater(): base()
- {
- }
-
- public event RepeaterCommandEventHandler ItemCommand
- {
- add
- {
- Events.AddHandler(ItemCommandEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCommandEvent, value);
- }
- }
-
- public event RepeaterItemEventHandler ItemCreated
- {
- add
- {
- Events.AddHandler(ItemCreatedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemCreatedEvent, value);
- }
- }
-
- public event RepeaterItemEventHandler ItemDataBound
- {
- add
- {
- Events.AddHandler(ItemDataBoundEvent, value);
- }
- remove
- {
- Events.RemoveHandler(ItemDataBoundEvent, value);
- }
- }
-
- public virtual ITemplate AlternatingItemTemplate
- {
- get
- {
- return alternatingItemTemplate;
- }
- set
- {
- alternatingItemTemplate = value;
- }
- }
-
- public override ControlCollection Controls
- {
- get
- {
- EnsureChildControls();
- return base.Controls;
- }
- }
-
- public virtual string DataMember
- {
- get
- {
- object o = ViewState["DataMember"];
- if(o != null)
- {
- return (string)o;
- }
- return String.Empty;
- }
- set
- {
- ViewState["DataMember"] = value;
- }
- }
-
- public virtual object DataSource
- {
- get
- {
- return dataSource;
- }
- set
- {
- dataSource = value;
- }
- }
-
- public virtual ITemplate FooterTemplate
- {
- get
- {
- return footerTemplate;
- }
- set
- {
- footerTemplate = value;
- }
- }
-
- public virtual ITemplate HeaderTemplate
- {
- get
- {
- return headerTemplate;
- }
- set
- {
- headerTemplate = value;
- }
- }
-
- public virtual RepeaterItemCollection Items
- {
- get
- {
- if(items != null)
- {
- if(itemsArrayList != null)
- {
- EnsureChildControls();
- }
- items = new RepeaterItemCollection(itemsArrayList);
- }
- return items;
- }
- }
-
- public virtual ITemplate ItemTemplate
- {
- get
- {
- return itemTemplate;
- }
- set
- {
- itemTemplate = value;
- }
- }
-
- public virtual ITemplate SeparatorTemplate
- {
- get
- {
- return separatorTemplate;
- }
- set
- {
- separatorTemplate = value;
- }
- }
-
- public override void DataBind()
- {
- OnDataBinding(EventArgs.Empty);
- }
-
- protected override void CreateChildControls()
- {
- Controls.Clear();
- if(ViewState[ITEMCOUNT] != null)
- {
- CreateControlHierarchy(false);
- } else
- {
- itemsArrayList = new ArrayList();
- }
- ClearChildViewState();
- }
-
- private RepeaterItem CreateItem (int itemIndex,
- ListItemType itemType,
- bool dataBind,
- object dataItem)
- {
- RepeaterItem repeaterItem = new RepeaterItem (itemIndex, itemType);
- RepeaterItemEventArgs repeaterEventArgs = new RepeaterItemEventArgs (repeaterItem);
- InstantiateItem (repeaterItem);
- if (dataBind)
- repeaterItem.DataItem = dataItem;
- OnItemCreated (repeaterEventArgs);
- Controls.Add (repeaterItem);
- if (dataBind) {
- repeaterItem.DataBind ();
- OnItemDataBound (repeaterEventArgs);
- repeaterItem.DataItem = null;
- }
- return repeaterItem;
- }
-
- private void InstantiateItem (RepeaterItem item)
- {
- ITemplate template;
- switch (item.ItemType) {
- case ListItemType.Header:
- template = this.headerTemplate;
- break;
- case ListItemType.Footer:
- template = this.footerTemplate;
- break;
- case ListItemType.Item:
- template = this.itemTemplate;
- break;
- case ListItemType.AlternatingItem:
- template = this.alternatingItemTemplate;
- break;
- case ListItemType.Separator:
- template = this.separatorTemplate;
- break;
- default:
- throw new HttpException ("Unknown ListItemType: " + item.ItemType);
- }
-
- template.InstantiateIn (item);
- }
-
- protected virtual void CreateControlHierarchy (bool useDataSource)
- {
- ArrayList itemList = new ArrayList ();
- items = new RepeaterItemCollection (itemList);
- IEnumerable ds = null;
- if (useDataSource)
- ds = DataSourceHelper.GetResolvedDataSource (DataSource, DataMember);
-
- if (!useDataSource) {
- int itemCount = (int) ViewState [ITEMCOUNT];
- if (itemCount != -1)
- ds = new ArrayList (itemCount);
- }
-
- if (ds == null)
- return;
-
- if (headerTemplate != null)
- CreateItem (-1, ListItemType.Header, useDataSource, null);
-
- bool even = true;
- int index = 0;
- foreach (object item in ds){
- if (separatorTemplate != null && index > 0)
- CreateItem (index - 1, ListItemType.Separator, useDataSource, null);
-
- RepeaterItem repeaterItem;
- ListItemType lType;
- if (!even && alternatingItemTemplate != null)
- lType = ListItemType.AlternatingItem;
- else
- lType = ListItemType.Item;
-
- repeaterItem = CreateItem (index, lType, useDataSource, item);
- itemList.Add (repeaterItem);
- index++;
- even = !even;
- }
-
- if (footerTemplate != null)
- CreateItem (-1, ListItemType.Footer, useDataSource, null);
- }
-
- protected override bool OnBubbleEvent(object sender, EventArgs e)
- {
- bool retVal = false;
- if(e is RepeaterCommandEventArgs)
- {
- OnItemCommand((RepeaterCommandEventArgs)e);
- retVal = true;
- }
- return retVal;
- }
-
- protected override void OnDataBinding(EventArgs e)
- {
- base.OnDataBinding(e);
- Controls.Clear();
- ClearChildViewState();
- CreateControlHierarchy(true);
- ChildControlsCreated = true;
- }
-
- protected virtual void OnItemCommand(RepeaterCommandEventArgs e)
- {
- if(Events != null)
- {
- RepeaterCommandEventHandler rceh = (RepeaterCommandEventHandler)
- Events [ItemCommandEvent];
- if(rceh != null)
- {
- rceh(this, e);
- }
- }
- }
-
- protected virtual void OnItemCreated(RepeaterItemEventArgs e)
- {
- if(Events != null)
- {
- RepeaterItemEventHandler rceh = (RepeaterItemEventHandler)
- Events [ItemCreatedEvent];
- if(rceh != null)
- {
- rceh(this, e);
- }
- }
- }
-
- protected virtual void OnItemDataBound(RepeaterItemEventArgs e)
- {
- if(Events != null)
- {
- RepeaterItemEventHandler rceh = (RepeaterItemEventHandler)
- Events [ItemDataBoundEvent];
- if(rceh != null)
- {
- rceh(this, e);
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs
deleted file mode 100644
index 1d2e5c298ff..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventArgs.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: RepeaterCommandEventArgs
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class RepeaterCommandEventArgs: CommandEventArgs
- {
- private RepeaterItem rItem;
- private object cmdSrc;
-
- public RepeaterCommandEventArgs(RepeaterItem item, object commandSource, CommandEventArgs originalArgs): base(originalArgs)
- {
- rItem = item;
- cmdSrc = commandSource;
- }
-
- public object CommandSource
- {
- get
- {
- return cmdSrc;
- }
- }
-
- public RepeaterItem Item
- {
- get
- {
- return rItem;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs
deleted file mode 100644
index 1d93d3d8a67..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterCommandEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void RepeaterCommandEventHandler(object sender, RepeaterCommandEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs
deleted file mode 100644
index 69adc3bb369..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItem.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
-* Namespace: System.Web.UI.WebControls
-* Class: RepeaterItem
-*
-* Author: Gaurav Vaish
-* Maintainer: gvaish@iitk.ac.in
-* Implementation: yes
-* Status: 100%
-*
-* (C) Gaurav Vaish (2001)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxItem(false)]
- public class RepeaterItem: Control, INamingContainer
- {
- private int itemIndex;
- private ListItemType itemType;
- private object dataItem;
-
- public RepeaterItem(int itemIndex, ListItemType itemType)
- {
- this.itemIndex = itemIndex;
- this.itemType = itemType;
- }
-
- public virtual object DataItem
- {
- get
- {
- return dataItem;
- }
- set
- {
- dataItem = value;
- }
- }
-
- public virtual int ItemIndex
- {
- get
- {
- return itemIndex;
- }
- }
-
- public virtual ListItemType ItemType
- {
- get
- {
- return itemType;
- }
- }
-
- protected override bool OnBubbleEvent(object source, EventArgs e)
- {
- if(e is CommandEventArgs)
- {
- RepeaterCommandEventArgs rcea = new RepeaterCommandEventArgs(this, source, (CommandEventArgs)e);
- RaiseBubbleEvent(source, rcea);
- return true;
- }
- return false;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemCollection.cs
deleted file mode 100644
index a77a5549562..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemCollection.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RepeaterItemCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class RepeaterItemCollection : ICollection, IEnumerable
- {
- private ArrayList items;
-
- public RepeaterItemCollection(ArrayList items)
- {
- this.items = items;
- }
-
- public int Count
- {
- get
- {
- return items.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public RepeaterItem this[int index]
- {
- get
- {
- return (RepeaterItem)(items[index]);
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(RepeaterItem current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return items.GetEnumerator();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventArgs.cs
deleted file mode 100644
index 4ccd5dc1269..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventArgs.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RepeaterItemEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class RepeaterItemEventArgs : EventArgs
- {
- private RepeaterItem item;
-
- public RepeaterItemEventArgs(RepeaterItem item)
- {
- this.item = item;
- }
-
- public RepeaterItem Item
- {
- get
- {
- return item;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs
deleted file mode 100644
index 73f7913171c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RepeaterItemEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void RepeaterItemEventHandler(object sender, RepeaterItemEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs
deleted file mode 100644
index 202741b73fc..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RequiredFieldValidator.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: RequiredFieldValidator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxData("<{0}:RequiredFieldValidator runat=\"server\" "
- + "ErrorMessage=\"RequiredFieldValidator\">"
- + "</{0}:RequiredFieldValidator>")]
- public class RequiredFieldValidator : BaseValidator
- {
- public RequiredFieldValidator(): base()
- {
- }
-
- public string InitialValue
- {
- get
- {
- object o = ViewState["InitialValue"];
- if(o != null)
- return (String)o;
- return String.Empty;
- }
- set
- {
- ViewState["InitialValue"] = value;
- }
- }
-
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- base.AddAttributesToRender(writer);
- if(RenderUplevel)
- {
- writer.AddAttribute("evaluationfunction", "RequiredFieldValidatorEvaluateIsValid");
- writer.AddAttribute("initialvalue", InitialValue);
- }
- }
-
- protected override bool EvaluateIsValid()
- {
- string val = GetControlValidationValue(ControlToValidate);
- if(val != null)
- {
- return (val.Trim() == InitialValue.Trim());
- }
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/SelectedDatesCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/SelectedDatesCollection.cs
deleted file mode 100644
index fa3776a70d8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/SelectedDatesCollection.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: SelectedDatesCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class SelectedDatesCollection : ICollection, IEnumerable
- {
- ArrayList dateList;
-
- public SelectedDatesCollection(ArrayList dateList)
- {
- this.dateList = dateList;
- }
-
- public int Count
- {
- get
- {
- return dateList.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public DateTime this[int index]
- {
- get
- {
- return (DateTime)(dateList[index]);
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public void Add(DateTime date)
- {
- dateList.Add(date);
- }
-
- public void Clear()
- {
- dateList.Clear();
- }
-
- public bool Contains(DateTime date)
- {
- return dateList.Contains(date);
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(DateTime current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return dateList.GetEnumerator();
- }
-
- public void Remove(DateTime date)
- {
- dateList.Remove(date);
- }
-
- public void SelectRange(DateTime fromDate, DateTime toDate)
- {
- dateList.Clear();
- //FIXME: Probable bug in MS implementation. It SHOULD NOT
- // clear the list if fromDate > toDate
- if(fromDate > toDate)
- {
- return;
- }
- DateTime local = fromDate;
- do
- {
- dateList.Add(local);
- local = local.AddDays(1);
- } while(local < toDate);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventArgs.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventArgs.cs
deleted file mode 100644
index 69ac40110e8..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventArgs.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ServerValidateEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class ServerValidateEventArgs : EventArgs
- {
- private bool isValid;
- private string value;
-
- public ServerValidateEventArgs(string value, bool isValid)
- {
- this.value = value;
- this.isValid = isValid;
- }
-
- public bool IsValid
- {
- get
- {
- return isValid;
- }
- }
-
- public string Value
- {
- get
- {
- return value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs
deleted file mode 100644
index b37ffd5f26f..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ServerValidateEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public delegate void ServerValidateEventHandler(object sender, ServerValidateEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
deleted file mode 100644
index 2dbb48b949e..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
+++ /dev/null
@@ -1,539 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Style
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Drawing;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ToolboxItem(false)]
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public class Style : Component , IStateManager
- {
- internal static int MARKED = (0x01 << 0);
- internal static int BACKCOLOR = (0x01 << 1);
- internal static int BORDERCOLOR = (0x01 << 2);
- internal static int BORDERSTYLE = (0x01 << 3);
- internal static int BORDERWIDTH = (0x01 << 4);
- internal static int CSSCLASS = (0x01 << 5);
- internal static int FORECOLOR = (0x01 << 6);
- internal static int HEIGHT = (0x01 << 7);
- internal static int WIDTH = (0x01 << 8);
- internal static int FONT_BOLD = (0x01 << 9);
- internal static int FONT_ITALIC = (0x01 << 10);
- internal static int FONT_NAMES = (0x01 << 11);
- internal static int FONT_SIZE = (0x01 << 12);
- internal static int FONT_STRIKE = (0x01 << 13);
- internal static int FONT_OLINE = (0x01 << 14);
- internal static int FONT_ULINE = (0x01 << 15);
-
- internal static string selectionBitString = "_SystemWebUIWebControlsStyle_SBS";
-
- private StateBag viewState;
- private int selectionBits;
- private bool selfStateBag;
-
- private FontInfo font;
-
- public Style()
- {
- Initialize(null);
- selfStateBag = true;
- }
-
- public Style(StateBag bag): base()
- {
- Initialize(bag);
- selfStateBag = false;
- }
-
- private void Initialize(StateBag bag)
- {
- viewState = bag;
- selectionBits = 0x00;
- }
-
- internal virtual StateBag ViewState
- {
- get
- {
- if(viewState == null)
- {
- viewState = new StateBag(false);
- if(IsTrackingViewState)
- viewState.TrackViewState();
- }
- return viewState;
- }
- }
-
- internal bool IsSet(int bit)
- {
- return ( (selectionBits & bit) != 0x00);
- }
-
- internal virtual void Set(int bit)
- {
- selectionBits |= bit;
- if(IsTrackingViewState)
- selectionBits |= MARKED;
- }
-
- public Color BackColor
- {
- get
- {
- if(IsSet(BACKCOLOR))
- return (Color)ViewState["BackColor"];
- return Color.Empty;
- }
- set
- {
- ViewState["BackColor"] = value;
- Set(BACKCOLOR);
- }
- }
-
- public Color BorderColor
- {
- get
- {
- if(IsSet(BORDERCOLOR))
- return (Color)ViewState["BorderColor"];
- return Color.Empty;
- }
- set
- {
- ViewState["BorderColor"] = value;
- Set(BORDERCOLOR);
- }
- }
-
- public BorderStyle BorderStyle
- {
- get
- {
- if(IsSet(BORDERSTYLE))
- return (BorderStyle)ViewState["BorderStyle"];
- return BorderStyle.NotSet;
- }
- set
- {
- ViewState["BorderStyle"] = value;
- Set(BORDERSTYLE);
- }
- }
-
- public Unit BorderWidth
- {
- get
- {
- if(IsSet(BORDERWIDTH))
- return (Unit)ViewState["BorderWidth"];
- return Unit.Empty;
- }
- set
- {
- ViewState["BorderWidth"] = value;
- Set(BORDERWIDTH);
- }
- }
-
- public string CssClass
- {
- get
- {
- if(IsSet(CSSCLASS))
- return (string)ViewState["CssClass"];
- return string.Empty;
- }
- set
- {
- ViewState["CssClass"] = value;
- Set(CSSCLASS);
- }
- }
-
- public Color ForeColor
- {
- get
- {
- if(IsSet(FORECOLOR))
- return (Color)ViewState["ForeColor"];
- return Color.Empty;
- }
- set
- {
- ViewState["ForeColor"] = value;
- Set(FORECOLOR);
- }
- }
-
- public Unit Height
- {
- get
- {
- if(IsSet(HEIGHT))
- return (Unit)ViewState["Height"];
- return Unit.Empty;
- }
- set
- {
- ViewState["Height"] = value;
- Set(HEIGHT);
- }
- }
-
- public Unit Width
- {
- get
- {
- if(IsSet(WIDTH))
- return (Unit)ViewState["Width"];
- return Unit.Empty;
- }
- set
- {
- ViewState["Width"] = value;
- Set(WIDTH);
- }
- }
-
- public FontInfo Font
- {
- get
- {
- if(font==null)
- font = new FontInfo(this);
- return font;
- }
- }
-
- internal virtual bool IsEmpty
- {
- get { return (selectionBits == 0); }
- }
-
- private void AddColor(HtmlTextWriter writer, HtmlTextWriterStyle style, Color color)
- {
- if(!color.IsEmpty)
- writer.AddStyleAttribute(style, ColorTranslator.ToHtml(color));
- }
-
- private static string StringArrayToString(string[] array, char separator)
- {
- if(array.Length == 0)
- return String.Empty;
- StringBuilder sb = new StringBuilder();
- for(int i=0; i < array.Length; i++)
- {
- if(i==0)
- {
- sb.Append(array[0]);
- } else
- {
- sb.Append(separator);
- sb.Append(array[i]);
- }
- }
- return sb.ToString();
- }
-
- public void AddAttributesToRender(HtmlTextWriter writer)
- {
- AddAttributesToRender(writer, null);
- }
-
- public virtual void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
- {
- if(IsSet(BACKCOLOR))
- {
- AddColor(writer, HtmlTextWriterStyle.BackgroundColor, (Color)ViewState["BackColor"]);
- }
-
- if(IsSet(BORDERCOLOR))
- {
- AddColor(writer, HtmlTextWriterStyle.BorderColor, (Color)ViewState["BorderColor"]);
- }
-
- if(IsSet(FORECOLOR))
- {
- AddColor(writer, HtmlTextWriterStyle.Color, (Color)ViewState["ForeColor"]);
- }
-
- if(IsSet(CSSCLASS))
- {
- string cssClass = (string)ViewState["CssClass"];
- if(cssClass.Length > 0)
- writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
- }
-
- if(!BorderWidth.IsEmpty)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, BorderWidth.ToString(CultureInfo.InvariantCulture));
- if(BorderStyle!=BorderStyle.NotSet)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, Enum.Format(typeof(BorderStyle), BorderStyle, "G"));
- } else
- {
- if(BorderWidth.Value != 0.0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, "solid");
- }
- }
- } else
- {
- if(BorderStyle!=BorderStyle.NotSet)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BorderStyle, Enum.Format(typeof(BorderStyle), BorderStyle, "G"));
- }
- }
-
- if(Font.Names.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontFamily, StringArrayToString(Font.Names,','));
- }
-
- if(!Font.Size.IsEmpty)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontSize, Font.Size.ToString(CultureInfo.InvariantCulture));
- }
-
- if(Font.Bold)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontWeight, "bold");
- }
-
- if(Font.Italic)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.FontStyle, "italic");
- }
-
- string textDecoration = String.Empty;
- if(Font.Strikeout)
- {
- textDecoration += " strikeout";
- }
- if(Font.Underline)
- {
- textDecoration += " underline";
- }
- if(Font.Overline)
- {
- textDecoration += " overline";
- }
- if(textDecoration.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.TextDecoration, textDecoration);
- }
-
- Unit u = Unit.Empty;
- if(IsSet(HEIGHT))
- {
- u = (Unit)ViewState["Height"];
- writer.AddStyleAttribute(HtmlTextWriterStyle.Height, u.ToString(CultureInfo.InvariantCulture));
- }
- if(IsSet(WIDTH))
- {
- u = (Unit)ViewState["Width"];
- writer.AddStyleAttribute(HtmlTextWriterStyle.Width, u.ToString(CultureInfo.InvariantCulture));
- }
- }
-
- public virtual void CopyFrom(Style source)
- {
- if(source!=null && !source.IsEmpty)
- {
- Font.CopyFrom(source.Font);
- if(source.Height!=Unit.Empty)
- {
- Height = source.Height;
- }
- if(source.Width!=Unit.Empty)
- {
- Width = source.Width;
- }
- if(source.BorderColor!=Color.Empty)
- {
- BorderColor = source.BorderColor;
- }
- if(source.BorderWidth!=Unit.Empty)
- {
- BorderWidth = source.BorderWidth;
- }
- if(source.BorderStyle!=BorderStyle.NotSet)
- {
- BorderStyle = source.BorderStyle;
- }
- if(source.BackColor!=Color.Empty)
- {
- BackColor = source.BackColor;
- }
- if(source.CssClass!=String.Empty)
- {
- CssClass = source.CssClass;
- }
- if(source.ForeColor!=Color.Empty)
- {
- ForeColor = source.ForeColor;
- }
- }
- }
-
- public virtual void MergeWith(Style with)
- {
- if(with!=null && !with.IsEmpty)
- {
- if(IsEmpty)
- {
- CopyFrom(with);
- return;
- }
-
- Font.MergeWith(with.Font);
- if(!IsSet(HEIGHT) && with.Height!=Unit.Empty)
- {
- Height = with.Height;
- }
- if(!IsSet(WIDTH) && with.Width!=Unit.Empty)
- {
- Width = with.Width;
- }
- if(!IsSet(BORDERCOLOR) && with.BorderColor!=Color.Empty)
- {
- BorderColor = with.BorderColor;
- }
- if(!IsSet(BORDERWIDTH) && with.BorderWidth!=Unit.Empty)
- {
- BorderWidth = with.BorderWidth;
- }
- if(!IsSet(BORDERSTYLE) && with.BorderStyle!=BorderStyle.NotSet)
- {
- BorderStyle = with.BorderStyle;
- }
- if(!IsSet(BACKCOLOR) && with.BackColor!=Color.Empty)
- {
- BackColor = with.BackColor;
- }
- if(!IsSet(CSSCLASS) && with.CssClass!=String.Empty)
- {
- CssClass = with.CssClass;
- }
- if(!IsSet(FORECOLOR) && with.ForeColor!=Color.Empty)
- {
- ForeColor = with.ForeColor;
- }
- }
- }
-
- public virtual void Reset()
- {
- if(IsSet(BACKCOLOR))
- ViewState.Remove("BackColor");
- if(IsSet(BORDERCOLOR))
- ViewState.Remove("BorderColor");
- if(IsSet(BORDERSTYLE))
- ViewState.Remove("BorderStyle");
- if(IsSet(BORDERWIDTH))
- ViewState.Remove("BorderWidth");
- if(IsSet(CSSCLASS))
- ViewState.Remove("CssClass");
- if(IsSet(FORECOLOR))
- ViewState.Remove("ForeColor");
- if(IsSet(HEIGHT))
- ViewState.Remove("Height");
- if(IsSet(WIDTH))
- ViewState.Remove("Width");
- if(font!=null)
- font.Reset();
- selectionBits = 0x00;
- }
-
- protected bool IsTrackingViewState
- {
- get
- {
- return ( (selectionBits & MARKED) != 0x00 );
- }
- }
-
- protected internal virtual void TrackViewState()
- {
- if(viewState!=null)
- ViewState.TrackViewState();
- Set(MARKED);
- }
-
- protected internal object SaveViewState()
- {
- if(viewState != null)
- {
- if(IsSet(MARKED))
- {
- ViewState[selectionBitString] = selectionBits;
- }
- if(selfStateBag)
- {
- return ViewState.SaveViewState();
- }
- }
- return null;
- }
-
- protected internal void LoadViewState(object state)
- {
- if(state!=null && selfStateBag)
- {
- ViewState.LoadViewState(state);
- }
- if(viewState!=null)
- {
- selectionBits = (int)ViewState[selectionBitString];
- }
- }
-
- void IStateManager.LoadViewState(object state)
- {
- LoadViewState(state);
- }
-
- object IStateManager.SaveViewState()
- {
- return SaveViewState();
- }
-
- void IStateManager.TrackViewState()
- {
- TrackViewState();
- }
-
- bool IStateManager.IsTrackingViewState
- {
- get
- {
- return IsTrackingViewState;
- }
- }
-
- public override string ToString()
- {
- return String.Empty;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TODO b/mcs/class/System.Web/System.Web.UI.WebControls/TODO
deleted file mode 100755
index 05abe9b822a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TODO
+++ /dev/null
@@ -1,156 +0,0 @@
-All Classes, Interfaces, Structures, Delegates and Enumerations
-
-
-<attributesIssue>
- Attributes may have to be supplied to the classes. Some of the attributes
- include DefaultPropertyAttribute, ToolboxItemAttribute, ParseChildrenAttribute
- (to be added to System.Web.UI) etc. Currently, I have not taken care of these
- aspects. They are to be handled later on.
-</attributesIssue>
-
-<disposableItemsIssue>
- I have not taken care of any disposing issues that may be involved. But I think
- it will not be a problem since I am no where using unmanaged code.
-</disposableItemsIssue>
-
-<legends>
-*: Completed
-&: Work in progress. See <item-name>.cs file for maintainer's name
-</legends>
-
-* AdCreatedEventArgs
-* AdRotator
-* BaseCompareValidator
-* BaseDataList
-& BaseValidator
-& BoundColumn
-* Button
-* ButtonColumn
-& Calendar
-* CalendarDay
-* CheckBox
-* CheckBoxList
-* CommandEventArgs
-& CompareValidator
-* CustomValidator
-& DataGrid
-* DataGridColumn
-* DataGridColumnCollection
-* DataGridCommandEventArgs
-& DataGridItem
-* DataGridItemCollection
-* DataGridItemEventArgs
-* DataGridPageChangedEventArgs
-& DataGridPagerStyle
-* DataGridShortCommandEventArgs
-* DataKeyCollection
-& DataList
-* DataListCommandEventArgs
-& DataListItem
-* DataListItemCollecton
-* DataListItemEventArgs
-* DayRenderEventArgs
-* DropDownList
-& EditCommandColumn
-* FontInfo
-* FontNamesConverter
-& FontUnitConverter
-* HyperLink
-* HyperLinkColumn
-* HyperLinkControlBuilder
-* Image
-* ImageButton
-* Label
-* LabelControlBuilder
-* LinkButton
-* LinkButtonControlBuilder
-* ListBox
-* ListControl
-* ListItem
-* ListItemCollection
-* ListItemControlBuilder
-* Literal
-* LiteralControlBuilder
-* MonthChangedEventArgs
-* PagedDataSource
-* Panel
-* PlaceHolder
-* PlaceHolderControlBuilder
-* RadioButton
-& RadioButtonList
-* RangeValidator
-* RegularExpressionValidator
-& Repeater
-* RepeaterCommandEventArgs
-& RepeaterItem
-* RepeaterItemCollection
-* RepeaterItemEventArgs
-& RepeatInfo
-* RequiredFieldValidator
-* SelectedDatesCollection
-* ServerValidateEventArgs
-* Style
-* Table
-* TableCell
-* TableCellCollection
-* TableCellControlBuilder
-* TableHeaderCell
-* TableItemStyle
-* TableRow
-* TableRowCollection
-* TableStyle
-* TargetConverter
-* TemplateColumn
-& TextBox
-* TextBoxControlBuilder
-* UnitConverter
-* ValidatedControlConverter
-& ValidationSummary
-& WebColorConverter
-& WebControl
-& Xml
-
-* IRepeatInfoUser
-
-* FontUnit
-* Unit
-
-* AdCreatedEventHandler
-* CommandEventHandler
-* DataGridCommandEventHandler
-* DataGridItemEventHandler
-* DataGridPageChangedEventHandler
-* DataGridSortCommandEventHandler
-* DataListCommandEventHandler
-* DataListItemEventHandler
-* DayRenderEventHandler
-* MonthChangedEventHandler
-* RepeaterCommandEventHandler
-* RepeaterItemEventHandler
-* ServerValidateEventHandler
-
-* BorderStyle
-* ButtonColumnType
-* CalendarSelectionMode
-* DayNameFormat
-* FirstDayOfWeek
-* FontSize
-* GridLines
-* HorizontalAlign
-* ImageAlign
-* ListItemType
-* ListSelectionMode
-* NextPrevFormat
-* PagerMode
-* PagerPosition
-* RepeatDirection
-* RepeatLayout
-* TextAlign
-* TextBoxMode
-* TitleFormat
-* UnitType
-* ValidationCompareOperator
-* ValidationDataType
-* ValidationSummaryDisplayMode
-* ValidatorDisplay
-* VerticalAlign
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs
deleted file mode 100644
index 53911af24eb..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Table.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Table
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Drawing;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultProperty("Rows")]
- //[Designer("??")]
- [ParseChildren(true, "Rows")]
- public class Table: WebControl
- {
- private TableRowCollection rows;
-
- private class TableRowControlCollection : ControlCollection
- {
- public TableRowControlCollection (Control owner) : base (owner)
- {
- }
-
- public override void Add (Control child)
- {
- if (!(child is TableRow))
- throw new ArgumentException (HttpRuntime.FormatResourceString (
- "Cannot_Have_Children_Of_Type",
- "Table",
- child.GetType ().Name.ToString ()));
- base.Add (child);
- }
-
- public override void AddAt(int index, Control child)
- {
- if (!(child is TableRow))
- throw new ArgumentException (HttpRuntime.FormatResourceString (
- "Cannot_Have_Children_Of_Type",
- "Table",
- child.GetType ().Name.ToString ()));
- base.AddAt (index, child);
- }
- }
-
- public Table () : base (HtmlTextWriterTag.Table)
- {
- }
-
- public virtual string BackImageUrl
- {
- get {
- if (ControlStyleCreated)
- return ((TableStyle) ControlStyle).BackImageUrl;
- return String.Empty;
- }
-
- set { ((TableStyle) ControlStyle).BackImageUrl = value; }
- }
-
- public virtual int CellPadding
- {
- get {
- if (ControlStyleCreated)
- return ((TableStyle) ControlStyle).CellPadding;
- return -1;
- }
-
- set { ((TableStyle) ControlStyle).CellPadding = value; }
- }
-
- public virtual int CellSpacing
- {
- get {
- if (ControlStyleCreated)
- return ((TableStyle) ControlStyle).CellSpacing;
- return -1;
- }
-
- set { ((TableStyle) ControlStyle).CellSpacing = value; }
- }
-
- public virtual GridLines GridLines
- {
- get {
- if (ControlStyleCreated)
- return ((TableStyle) ControlStyle).GridLines;
- return GridLines.None;
- }
-
- set { ((TableStyle) ControlStyle).GridLines = value; }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get {
- if (ControlStyleCreated)
- return ((TableStyle) ControlStyle).HorizontalAlign;
- return HorizontalAlign.NotSet;
- }
-
- set { ((TableStyle) ControlStyle).HorizontalAlign = value; }
- }
-
- public virtual TableRowCollection Rows
- {
- get {
- if (rows == null)
- rows = new TableRowCollection (this);
- return rows;
- }
- }
-
- protected override void AddAttributesToRender (HtmlTextWriter writer)
- {
- base.AddAttributesToRender (writer);
- if(!BorderColor.IsEmpty)
- writer.AddAttribute (HtmlTextWriterAttribute.Bordercolor,
- ColorTranslator.ToHtml (BorderColor));
-
- Unit bw = BorderWidth;
- if (GridLines == GridLines.None)
- bw = Unit.Pixel (0);
- else if (!bw.IsEmpty && bw.Type == UnitType.Pixel)
- bw = Unit.Pixel(1);
-
- writer.AddAttribute (HtmlTextWriterAttribute.Border,
- ((int) bw.Value).ToString (NumberFormatInfo.InvariantInfo));
- }
-
- protected override ControlCollection CreateControlCollection ()
- {
- return new TableRowControlCollection (this);
- }
-
- protected override Style CreateControlStyle ()
- {
- return new TableStyle (ViewState);
- }
-
- protected override void RenderContents (HtmlTextWriter writer)
- {
- foreach (TableRow current in Rows)
- current.RenderControl (writer);
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs
deleted file mode 100644
index cf8c19ae151..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableCell
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- [DefaultProperty("Text")]
- [ToolboxItem(false)]
- [ControlBuilder(typeof(TableCellControlBuilder))]
- [ParseChildren(false)]
- [PersistChildren(true)]
- public class TableCell: WebControl
- {
- public TableCell () : base (HtmlTextWriterTag.Td)
- {
- PreventAutoID ();
- }
-
- internal TableCell (HtmlTextWriterTag tag) : base (tag)
- {
- PreventAutoID ();
- }
-
- public virtual int ColumnSpan
- {
- get {
- object o = ViewState ["ColumnSpan"];
- return (o == null) ? 0 : (int) o;
- }
-
- set { ViewState ["ColumnSpan"] = value; }
- }
-
- public virtual int RowSpan
- {
- get {
- object o = ViewState ["RowSpan"];
- return (o == null) ? 0 : (int) o;
- }
-
- set { ViewState ["RowSpan"] = value; }
- }
-
- public virtual string Text
- {
- get {
- object o = ViewState ["Text"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["Text"] = value; }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get {
- if (ControlStyleCreated)
- return ((TableItemStyle) ControlStyle).HorizontalAlign;
- return HorizontalAlign.NotSet;
- }
- set { ((TableItemStyle) ControlStyle).HorizontalAlign = value; }
- }
-
- public virtual VerticalAlign VerticalAlign
- {
- get {
- if (ControlStyleCreated)
- return ((TableItemStyle) ControlStyle).VerticalAlign;
- return VerticalAlign.NotSet;
- }
-
- set { ((TableItemStyle) ControlStyle).VerticalAlign = value; }
- }
-
- public virtual bool Wrap
- {
- get {
- if (ControlStyleCreated)
- return ((TableItemStyle) ControlStyle).Wrap;
- return true;
- }
- set { ((TableItemStyle) ControlStyle).Wrap = value; }
- }
-
- protected override void AddAttributesToRender (HtmlTextWriter writer)
- {
- base.AddAttributesToRender (writer);
- if (ColumnSpan > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Colspan,
- ColumnSpan.ToString (NumberFormatInfo.InvariantInfo));
-
- if (RowSpan > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Rowspan,
- RowSpan.ToString (NumberFormatInfo.InvariantInfo));
- }
-
- protected override void AddParsedSubObject (object obj)
- {
- if (HasControls ()){
- base.AddParsedSubObject (obj);
- return;
- }
-
- if (obj is LiteralControl){
- Text = ((LiteralControl) obj).Text;
- return;
- }
-
- string text = Text;
- if (text.Length > 0){
- Text = String.Empty;
- base.AddParsedSubObject (new LiteralControl (text));
- }
-
- base.AddParsedSubObject (obj);
- }
-
- protected override Style CreateControlStyle ()
- {
- return new TableItemStyle (ViewState);
- }
-
- protected override void RenderContents (HtmlTextWriter writer)
- {
- if (HasControls ())
- base.RenderContents (writer);
- else
- writer.Write (Text);
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs
deleted file mode 100644
index c3b442b91de..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellCollection.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableCellCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.ComponentModel;
-
-namespace System.Web.UI.WebControls
-{
- //[Editor("??")]
- public sealed class TableCellCollection: IList, ICollection, IEnumerable
- {
- private TableRow owner;
-
- internal TableCellCollection(TableRow owner)
- {
- if(owner == null)
- {
- throw new ArgumentNullException();
- }
- this.owner = owner;
- }
-
- public int Count
- {
- get
- {
- return owner.Controls.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public TableCell this[int index]
- {
- get
- {
- return (TableCell)owner.Controls[index];
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public int Add(TableCell cell)
- {
- AddAt(-1, cell);
- return owner.Controls.Count;
- }
-
- public void AddAt(int index, TableCell cell)
- {
- owner.Controls.AddAt(index, cell);
- }
-
- public void AddRange(TableCell[] cells)
- {
- foreach(TableCell cell in cells)
- {
- Add(cell);
- }
- }
-
- public void Clear()
- {
- if(owner.HasControls())
- {
- owner.Controls.Clear();
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(object cell in this)
- {
- array.SetValue(cell, index++);
- }
- }
-
- public int GetCellIndex(TableCell cell)
- {
- if(!owner.HasControls())
- {
- return -1;
- }
- return owner.Controls.IndexOf(cell);
- }
-
- public IEnumerator GetEnumerator()
- {
- return owner.Controls.GetEnumerator();
- }
-
- public void Remove(TableCell cell)
- {
- owner.Controls.Remove(cell);
- }
-
- public void RemoveAt(int index)
- {
- owner.Controls.RemoveAt(index);
- }
-
- int IList.Add(object o)
- {
- return Add((TableCell)o);
- }
-
- bool IList.Contains(object o)
- {
- return owner.Controls.Contains((TableCell)o);
- }
-
- int IList.IndexOf(object o)
- {
- return owner.Controls.IndexOf((TableCell)o);
- }
-
- void IList.Insert(int index, object o)
- {
- owner.Controls.AddAt(index, (TableCell)o);
- }
-
- void IList.Remove(object o)
- {
- owner.Controls.Remove((TableCell)o);
- }
-
- bool IList.IsFixedSize
- {
- get
- {
- return false;
- }
- }
-
- object IList.this[int index]
- {
- get
- {
- return this[index];
- }
- set
- {
- RemoveAt(index);
- AddAt(index, (TableCell)value);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs
deleted file mode 100644
index 6363462fa51..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCellControlBuilder.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableCellControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableCellControlBuilder: ControlBuilder
- {
- public TableCellControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs
deleted file mode 100644
index e3ccb0c1a93..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableHeaderCell.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableHeaderCell
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableHeaderCell: TableCell
- {
- public TableHeaderCell(): base(HtmlTextWriterTag.Th)
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs
deleted file mode 100644
index 9d848e5f5b0..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableItemStyle.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableItemStyle
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableItemStyle: Style
- {
- private static int H_ALIGN = (0x01 << 16);
- private static int V_ALIGN = (0x01 << 17);
- private static int WRAP = (0x01 << 18);
-
- public TableItemStyle(): base()
- {
- }
-
- public TableItemStyle(StateBag bag): base(bag)
- {
- }
-
- [Bindable(true)]
- [DefaultValue(HorizontalAlign.NotSet)]
- [NotifyParentProperty(true)]
- [WebCategory("Layout")]
- [WebSysDescription("TableItemStyle_HorizontalAlign")]
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(IsSet(H_ALIGN))
- return (HorizontalAlign)ViewState["HorizontalAlign"];
- return HorizontalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(HorizontalAlign), value))
- {
- throw new ArgumentException();
- }
- ViewState["HorizontalAlign"] = value;
- Set(H_ALIGN);
- }
- }
-
- [Bindable(true)]
- [DefaultValue(VerticalAlign.NotSet)]
- [NotifyParentProperty(true)]
- [WebCategory("Layout")]
- [WebSysDescription("TableItemStyle_VerticalAlign")]
- public virtual VerticalAlign VerticalAlign
- {
- get
- {
- if(IsSet(V_ALIGN))
- return (VerticalAlign)ViewState["VerticalAlign"];
- return VerticalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(VerticalAlign), value))
- {
- throw new ArgumentException();
- }
- ViewState["VerticalAlign"] = value;
- Set(V_ALIGN);
- }
- }
-
- [Bindable(true)]
- [DefaultValue(VerticalAlign.NotSet)]
- [NotifyParentProperty(true)]
- [WebCategory("Layout")]
- [WebSysDescription("TableItemStyle_Wrap")]
- public virtual bool Wrap
- {
- get
- {
- if(IsSet(WRAP))
- return (bool)ViewState["Wrap"];
- return true;
- }
- set
- {
- ViewState["Wrap"] = value;
- }
- }
-
- public override void CopyFrom(Style s)
- {
- if(s!=null && s is TableItemStyle && !s.IsEmpty)
- {
- base.CopyFrom(s);
- TableItemStyle from = (TableItemStyle)s;
- if(from.IsSet(H_ALIGN))
- {
- HorizontalAlign = from.HorizontalAlign;
- }
- if(from.IsSet(V_ALIGN))
- {
- VerticalAlign = from.VerticalAlign;
- }
- if(from.IsSet(WRAP))
- {
- Wrap = from.Wrap;
- }
- }
- }
-
- public override void MergeWith(Style s)
- {
- if(s!=null && s is TableItemStyle && !s.IsEmpty)
- {
- base.MergeWith(s);
- TableItemStyle with = (TableItemStyle)s;
- if(with.IsSet(H_ALIGN) && !IsSet(H_ALIGN))
- {
- HorizontalAlign = with.HorizontalAlign;
- }
- if(with.IsSet(V_ALIGN) && !IsSet(V_ALIGN))
- {
- VerticalAlign = with.VerticalAlign;
- }
- if(with.IsSet(WRAP) && !IsSet(WRAP))
- {
- Wrap = with.Wrap;
- }
- }
- }
-
- public override void Reset()
- {
- if(IsSet(H_ALIGN))
- ViewState.Remove("HorizontalAlign");
- if(IsSet(V_ALIGN))
- ViewState.Remove("VerticalAlign");
- if(IsSet(WRAP))
- ViewState.Remove("Wrap");
- base.Reset();
- }
-
- public override void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
- {
- base.AddAttributesToRender(writer, owner);
- if(!Wrap)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Nowrap, "nowrap");
- }
- if(HorizontalAlign != HorizontalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, TypeDescriptor.GetConverter(typeof(HorizontalAlign)).ConvertToString(HorizontalAlign));
- }
- if(VerticalAlign != VerticalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Valign, TypeDescriptor.GetConverter(typeof(VerticalAlign)).ConvertToString(VerticalAlign));
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs
deleted file mode 100644
index 3128f242136..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableRow
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- [ParseChildren(false)]
- public class TableRow: WebControl
- {
- private TableCellCollection cells;
-
- public TableRow() : base (HtmlTextWriterTag.Tr)
- {
- PreventAutoID ();
- }
-
- public virtual TableCellCollection Cells
- {
- get {
- if (cells == null)
- cells = new TableCellCollection (this);
- return cells;
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get {
- object o = ViewState ["HorizontalAlign"];
- return (o == null) ? HorizontalAlign.NotSet : (HorizontalAlign) o;
- }
-
- set { ViewState ["HorizontalAlign"] = value; }
- }
-
- public virtual VerticalAlign VerticalAlign
- {
- get {
- object o = ViewState ["VerticalAlign"];
- return (o == null) ? VerticalAlign.NotSet : (VerticalAlign) o;
- }
-
- set { ViewState ["VerticalAlign"] = value; }
- }
-
- protected override Style CreateControlStyle ()
- {
- return new TableItemStyle (ViewState);
- }
-
- protected override ControlCollection CreateControlCollection ()
- {
- return new CellControlCollection (this);
- }
-
- class CellControlCollection : ControlCollection
- {
- public CellControlCollection (Control owner) : base (owner)
- {
- }
-
- public override void Add (Control child)
- {
- if (!(child is TableCell))
- throw new ArgumentException (HttpRuntime.FormatResourceString (
- "Cannot_Have_Children_Of_Type",
- "TableRow",
- GetType ().Name.ToString ()));
- base.Add (child);
- }
-
- public override void AddAt(int index, Control child)
- {
- if (!(child is TableCell))
- throw new ArgumentException (HttpRuntime.FormatResourceString (
- "Cannot_Have_Children_Of_Type",
- "TableRow",
- GetType ().Name.ToString ()));
- base.AddAt (index, child);
- }
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs
deleted file mode 100644
index b2db6123249..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableRowCollection
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Collections;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public sealed class TableRowCollection: IList, ICollection, IEnumerable
- {
- Table owner;
-
- internal TableRowCollection(Table owner)
- {
- if(owner == null)
- {
- throw new ArgumentNullException();
- }
- this.owner = owner;
- }
-
- public int Count
- {
- get
- {
- return owner.Controls.Count;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public TableRow this[int index]
- {
- get
- {
- return (TableRow)owner.Controls[index];
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- public int Add(TableRow row)
- {
- AddAt(-1, row);
- return owner.Controls.Count;
- }
-
- public void AddAt(int index, TableRow row)
- {
- owner.Controls.AddAt(index, row);
- }
-
- public void AddRange(TableRow[] rows)
- {
- foreach(TableRow row in rows)
- {
- Add(row);
- }
- }
-
- public void Clear()
- {
- if(owner.HasControls())
- {
- owner.Controls.Clear();
- }
- }
-
- public void CopyTo(Array array, int index)
- {
- foreach(object current in this)
- {
- array.SetValue(current, index++);
- }
- }
-
- public int GetRowIndex(TableRow row)
- {
- if(!owner.HasControls())
- {
- return -1;
- }
- return owner.Controls.IndexOf(row);
- }
-
- public IEnumerator GetEnumerator()
- {
- return owner.Controls.GetEnumerator();
- }
-
- public void Remove(TableRow row)
- {
- owner.Controls.Remove(row);
- }
-
- public void RemoveAt(int index)
- {
- owner.Controls.RemoveAt(index);
- }
-
- int IList.Add(object o)
- {
- return Add((TableRow)o);
- }
-
- bool IList.Contains(object o)
- {
- return owner.Controls.Contains((TableRow)o);
- }
-
- int IList.IndexOf(object o)
- {
- return owner.Controls.IndexOf((TableRow)o);
- }
-
- void IList.Insert(int index, object o)
- {
- owner.Controls.AddAt(index, (TableRow)o);
- }
-
- void IList.Remove(object o)
- {
- owner.Controls.Remove((TableRow)o);
- }
-
- bool IList.IsFixedSize
- {
- get
- {
- return false;
- }
- }
-
- object IList.this[int index]
- {
- get
- {
- return this[index];
- }
- set
- {
- RemoveAt(index);
- AddAt(index, (TableRow)value);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
deleted file mode 100644
index 6b1e7cd1415..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
+++ /dev/null
@@ -1,229 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TableStyle
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TableStyle : Style
- {
- private static int IMAGE_URL = (0x01 << 16);
- private static int CELL_PADD = (0x01 << 17);
- private static int CELL_SPAC = (0x01 << 18);
- private static int GRID_LINE = (0x01 << 19);
- private static int HOR_ALIGN = (0x01 << 20);
-
- public TableStyle(): base()
- {
- }
-
- public TableStyle(StateBag bag): base(bag)
- {
- }
-
- public virtual string BackImageUrl
- {
- get
- {
- if(IsSet(IMAGE_URL))
- return (string)(ViewState["BackImageUrl"]);
- return String.Empty;
- }
- set
- {
- if(value == null)
- throw new ArgumentNullException("BackImageUrl");
- ViewState["BackImageUrl"] = value;
- Set(IMAGE_URL);
- }
- }
-
- public virtual int CellPadding
- {
- get
- {
- if(IsSet(CELL_PADD))
- return (int)(ViewState["CellPadding"]);
- return -1;
- }
- set
- {
- if(value < -1)
- throw new ArgumentOutOfRangeException("CellPadding");
- ViewState["CellPadding"] = value;
- Set(CELL_PADD);
- }
- }
-
- public virtual int CellSpacing
- {
- get
- {
- if(IsSet(CELL_SPAC))
- return (int)(ViewState["CellSpacing"]);
- return -1;
- }
- set
- {
- if(value < -1)
- throw new ArgumentOutOfRangeException("CellSpacing");
- ViewState["CellSpacing"] = value;
- Set(CELL_SPAC);
- }
- }
-
- public virtual GridLines GridLines
- {
- get
- {
- if(IsSet(GRID_LINE))
- return (GridLines)(ViewState["GridLines"]);
- return GridLines.None;
- }
- set
- {
- if(!Enum.IsDefined(typeof(GridLines), value))
- throw new ArgumentException();
- ViewState["GridLines"] = value;
- Set(GRID_LINE);
- }
- }
-
- public virtual HorizontalAlign HorizontalAlign
- {
- get
- {
- if(IsSet(HOR_ALIGN))
- return (HorizontalAlign)(ViewState["HorizontalAlign"]);
- return HorizontalAlign.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(HorizontalAlign), value))
- throw new ArgumentException();
- ViewState["HorizontalAlign"] = value;
- Set(HOR_ALIGN);
- }
- }
-
- public override void AddAttributesToRender(HtmlTextWriter writer, WebControl owner)
- {
- base.AddAttributesToRender(writer, owner);
- if(BackImageUrl.Length > 0)
- {
- writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundImage, "url(" + owner.ResolveUrl(BackImageUrl) + ")");
- }
- if(CellSpacing >= 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, CellSpacing.ToString(NumberFormatInfo.InvariantInfo));
- }
- if(CellPadding >= 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, CellPadding.ToString(NumberFormatInfo.InvariantInfo));
- }
- if(HorizontalAlign != HorizontalAlign.NotSet)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Align, Enum.Format(typeof(HorizontalAlign), HorizontalAlign, "G"));
- }
- string gd = "";
- switch(GridLines)
- {
- case GridLines.None: gd = "";
- break;
- case GridLines.Horizontal: gd = "cols";
- break;
- case GridLines.Vertical: gd = "rows";
- break;
- case GridLines.Both: gd = "all";
- break;
- }
- writer.AddAttribute(HtmlTextWriterAttribute.Rules, gd);
- }
-
- public override void CopyFrom(Style s)
- {
- if(s != null && s is TableStyle && !s.IsEmpty)
- {
- base.CopyFrom(s);
- TableStyle from = (TableStyle)s;
- if(from.IsSet(HOR_ALIGN))
- {
- HorizontalAlign = from.HorizontalAlign;
- }
- if(from.IsSet(IMAGE_URL))
- {
- BackImageUrl = from.BackImageUrl;
- }
- if(from.IsSet(CELL_PADD))
- {
- CellPadding = from.CellPadding;
- }
- if(from.IsSet(CELL_SPAC))
- {
- CellSpacing = from.CellSpacing;
- }
- if(from.IsSet(GRID_LINE))
- {
- GridLines = from.GridLines;
- }
- }
- }
-
- public override void MergeWith(Style s)
- {
- if(s != null && s is TableStyle && !s.IsEmpty)
- {
- base.MergeWith(s);
- TableStyle with = (TableStyle)s;
- if(with.IsSet(HOR_ALIGN) && IsSet(HOR_ALIGN))
- {
- HorizontalAlign = with.HorizontalAlign;
- }
- if(with.IsSet(IMAGE_URL) && IsSet(IMAGE_URL))
- {
- BackImageUrl = with.BackImageUrl;
- }
- if(with.IsSet(CELL_PADD) && IsSet(CELL_PADD))
- {
- CellPadding = with.CellPadding;
- }
- if(with.IsSet(CELL_SPAC) && IsSet(CELL_SPAC))
- {
- CellSpacing = with.CellSpacing;
- }
- if(with.IsSet(GRID_LINE) && IsSet(GRID_LINE))
- {
- GridLines = with.GridLines;
- }
- }
- }
-
- public override void Reset()
- {
- if(IsSet(IMAGE_URL))
- ViewState.Remove("BackImageUrl");
- if(IsSet(HOR_ALIGN))
- ViewState.Remove("HorizontalAlign");
- if(IsSet(CELL_PADD))
- ViewState.Remove("CellPadding");
- if(IsSet(CELL_SPAC))
- ViewState.Remove("CellSpacing");
- if(IsSet(GRID_LINE))
- ViewState.Remove("GridLines");
- base.Reset();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs
deleted file mode 100644
index 409dd35a9c0..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TargetConverter.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TargetConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TargetConverter : StringConverter
- {
- private StandardValuesCollection standardValues;
- private string[] values = {
- "_parent",
- "_self",
- "_blank",
- "_search",
- "_top"
- };
-
- public TargetConverter(): base()
- {
- }
-
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- if(standardValues == null)
- {
- standardValues = new StandardValuesCollection(values);
- }
- return standardValues;
- }
-
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
-
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs
deleted file mode 100644
index b64b42bde50..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TemplateColumn.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TemplateColumn
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TemplateColumn : DataGridColumn
- {
- private ITemplate editItemTemplate;
- private ITemplate footerTemplate;
- private ITemplate headerTemplate;
- private ITemplate itemTemplate;
-
- public TemplateColumn(): base()
- {
- }
-
- public virtual ITemplate EditItemTemplate
- {
- get
- {
- return editItemTemplate;
- }
- set
- {
- editItemTemplate = value;
- OnColumnChanged();
- }
- }
-
- public virtual ITemplate FooterTemplate
- {
- get
- {
- return footerTemplate;
- }
- set
- {
- footerTemplate = value;
- OnColumnChanged();
- }
- }
-
- public virtual ITemplate HeaderTemplate
- {
- get
- {
- return headerTemplate;
- }
- set
- {
- headerTemplate = value;
- OnColumnChanged();
- }
- }
-
- public virtual ITemplate ItemTemplate
- {
- get
- {
- return itemTemplate;
- }
- set
- {
- itemTemplate = value;
- OnColumnChanged();
- }
- }
-
- public override void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
- {
- base.InitializeCell(cell, columnIndex, itemType);
- ITemplate toRender = null;
- switch(itemType)
- {
- case ListItemType.Header: toRender = headerTemplate;
- break;
- case ListItemType.Footer: toRender = footerTemplate;
- break;
- case ListItemType.Item: toRender = itemTemplate;
- break;
- case ListItemType.AlternatingItem: toRender = itemTemplate;
- break;
- case ListItemType.SelectedItem: toRender = editItemTemplate;
- break;
- default: toRender = editItemTemplate;
- break;
- }
- if(toRender != null)
- {
- cell.Text = String.Empty;
- toRender.InstantiateIn(cell);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs
deleted file mode 100755
index 906bb73badd..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextAlign.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: TextAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum TextAlign
- {
- Left = 1,
- Right
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs
deleted file mode 100644
index 7b2f2e00a59..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBox.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TextBox
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 80%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TextBox : WebControl, IPostBackDataHandler
- {
- private static readonly object TextChangedEvent = new object ();
-
- public TextBox() : base (HtmlTextWriterTag.Input)
- {
- }
-
- public virtual bool AutoPostBack
- {
- get {
- object o = ViewState ["AutoPostBack"];
- return (o == null) ? false : (bool) o;
- }
-
- set { ViewState ["AutoPostBack"] = value; }
- }
-
- public virtual int Columns
- {
- get {
- object o = ViewState ["Columns"];
- return (o == null) ? 0 : (int) o;
- }
-
- set { ViewState ["Columns"] = value; }
- }
-
- public virtual int MaxLength
- {
- get
- {
- object o = ViewState ["MaxLength"];
- return (o == null) ? 0 : (int) o;
- }
-
- set { ViewState ["MaxLength"] = value; }
- }
-
- public virtual bool ReadOnly
- {
- get
- {
- object o = ViewState ["ReadOnly"];
- return (o == null) ? false : (bool) o;
- }
- set { ViewState ["ReadOnly"] = value; }
- }
-
- public virtual int Rows
- {
- get
- {
- object o = ViewState ["Rows"];
- return (o == null) ? 0 : (int) o;
- }
-
- set { ViewState ["Rows"] = value; }
- }
-
- public virtual string Text
- {
- get {
- object o = ViewState ["Text"];
- return (o == null) ? String.Empty : (string) o;
- }
-
- set { ViewState ["Text"] = value; }
- }
-
- public virtual TextBoxMode TextMode
- {
- get {
- object o = ViewState ["TextMode"];
- return (o == null) ? TextBoxMode.SingleLine : (TextBoxMode) o;
- }
-
- set {
- if(!Enum.IsDefined (typeof(TextBoxMode), value))
- throw new ArgumentException ();
- ViewState ["TextMode"] = value;
- }
- }
-
- public virtual bool Wrap
- {
- get {
- object o = ViewState ["Wrap"];
- return (o == null) ? false : (bool) o;
- }
-
- set { ViewState ["Wrap"] = value; }
- }
-
- public event EventHandler TextChanged
- {
- add { Events.AddHandler (TextChangedEvent, value); }
- remove { Events.RemoveHandler (TextChangedEvent, value); }
- }
-
- protected override HtmlTextWriterTag TagKey
- {
- get {
- if(TextMode == TextBoxMode.MultiLine)
- return HtmlTextWriterTag.Textarea;
- return HtmlTextWriterTag.Input;
- }
- }
-
- protected override void AddAttributesToRender (HtmlTextWriter writer)
- {
- if(Page != null)
- Page.VerifyRenderingInServerForm (this);
-
- writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
- if (TextMode == TextBoxMode.MultiLine){
- if (Rows > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Rows,
- Rows.ToString (
- NumberFormatInfo.InvariantInfo));
-
- if (Columns > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Cols,
- Columns.ToString (
- NumberFormatInfo.InvariantInfo));
-
- if (!Wrap)
- writer.AddAttribute(HtmlTextWriterAttribute.Wrap, "off");
- } else {
- string mode;
- if (TextMode == TextBoxMode.Password)
- mode = "password";
- else {
- mode = "text";
- if (Text.Length > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Value, Text);
- }
-
- writer.AddAttribute (HtmlTextWriterAttribute.Type, mode);
- if (MaxLength > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Maxlength,
- MaxLength.ToString (NumberFormatInfo.InvariantInfo));
-
- if (Columns > 0)
- writer.AddAttribute (HtmlTextWriterAttribute.Size,
- Columns.ToString (NumberFormatInfo.InvariantInfo));
- }
-
- if (ReadOnly)
- writer.AddAttribute (HtmlTextWriterAttribute.ReadOnly, "readonly");
-
- base.AddAttributesToRender (writer);
-
- if (AutoPostBack && Page != null){
- writer.AddAttribute (HtmlTextWriterAttribute.Onchange,
- Page.GetPostBackClientEvent (this, ""));
- writer.AddAttribute ("language", "javascript");
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(!(obj is LiteralControl))
- throw new HttpException (HttpRuntime.FormatResourceString (
- "Cannot_Have_Children_Of_Type", "TextBox",
- GetType ().Name.ToString ()));
-
- Text = ((LiteralControl) obj).Text;
- }
-
- protected override void OnPreRender (EventArgs e)
- {
- base.OnPreRender (e);
- //FIXME
- }
-
- protected virtual void OnTextChanged (EventArgs e)
- {
- if(Events != null){
- EventHandler eh = (EventHandler) (Events [TextChangedEvent]);
- if(eh != null)
- eh (this, e);
- }
- }
-
- protected override void Render (HtmlTextWriter writer)
- {
- RenderBeginTag(writer);
- if (TextMode == TextBoxMode.MultiLine)
- HttpUtility.HtmlEncode (Text, writer);
- RenderEndTag(writer);
- }
-
- bool IPostBackDataHandler.LoadPostData (string postDataKey,
- NameValueCollection postCollection)
- {
- if (postCollection [postDataKey] != Text){
- Text = postCollection [postDataKey];
- return true;
- }
- return false;
- }
-
- void IPostBackDataHandler.RaisePostDataChangedEvent ()
- {
- OnTextChanged (EventArgs.Empty);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs
deleted file mode 100644
index 7c26db6eaf3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxControlBuilder.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: TextBoxControlBuilder
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class TextBoxControlBuilder : ControlBuilder
- {
- public TextBoxControlBuilder(): base()
- {
- }
-
- public override bool AllowWhitespaceLiterals()
- {
- return false;
- }
-
- public override bool HtmlDecodeLiterals()
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs
deleted file mode 100755
index 47b903ec0f2..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TextBoxMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: TextBoxMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum TextBoxMode
- {
- SingleLine,
- MultiLine,
- Password
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs
deleted file mode 100755
index 3cfb9a42f42..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TitleFormat.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: TitleFormat
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum TitleFormat
- {
- Month,
- MonthYear
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs
deleted file mode 100644
index 67c03bbd58d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs
+++ /dev/null
@@ -1,255 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Struct: Unit
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public struct Unit
- {
- public static readonly Unit Empty = new Unit();
-
- private static int Min = -32768;
- private static int Max = +32767;
-
- private UnitType type;
- private double val;
-
- public static Unit Parse(string s)
- {
- return new Unit(s);
- }
-
- public static Unit Parse(string s, CultureInfo culture)
- {
- return new Unit(s, culture);
- }
-
- public static Unit Percentage(double n)
- {
- return new Unit(n);
- }
-
- public static Unit Pixel(int n)
- {
- return new Unit(n);
- }
-
- public static Unit Point(int n)
- {
- return new Unit(n, UnitType.Point);
- }
-
- public static bool operator ==(Unit left, Unit right)
- {
- return (left.type == right.type && left.val == right.val);
- }
-
- public static bool operator !=(Unit left, Unit right)
- {
- return !(left == right);
- }
-
- public static implicit operator Unit(int n)
- {
- return new Unit(n);
- }
-
- public Unit(double value)
- {
- if(value < Min || value > Max)
- {
- throw new ArgumentOutOfRangeException();
- }
- val = value;
- type = UnitType.Pixel;
- }
-
- public Unit(int value)
- {
- if(value < Min || value > Max)
- {
- throw new ArgumentOutOfRangeException();
- }
- val = value;
- type = UnitType.Pixel;
- }
-
- public Unit(string value): this(value, CultureInfo.CurrentCulture)
- {
- }
-
- public Unit(double value, UnitType type)
- {
- if(value < Min || value > Max)
- {
- throw new ArgumentOutOfRangeException();
- }
- val = value;
- this.type = type;
- }
-
- public Unit(string value, CultureInfo culture): this(value, culture, UnitType.Pixel)
- {
- }
-
- internal Unit(string value, CultureInfo culture, UnitType defType)
- {
- this.val = 0;
- this.type = UnitType.Pixel;
- if(value == null || value.Length == 0)
- {
- this.val = 0;
- this.type = UnitType.Pixel;
- }
- if(culture == null)
- culture = CultureInfo.CurrentCulture;
- string strVal = value.Trim().ToLower();
- char c;
- int start = -1;
- //int current = 0;
- for(int i = 0; i < strVal.Length; i++)
- {
- c = strVal[i];
- if( (c >= '0' && c <= '9') || (c == '-' || c == '.' || c == ',') )
- start = i;
- }
- if(start == -1)
- throw new ArgumentException();
- if( (start + 1) < strVal.Length)
- {
- this.type = (UnitType)GetTypeFromString(strVal.Substring(start + 1).Trim());
- this.val = 0;
- } else
- {
- this.type = defType;
- this.val = 0;
- }
- try
- {
- if(type == UnitType.Pixel)
- val = (double) Int32.Parse (strVal.Substring (0, start + 1), culture);
- else
- val = (double) Single.Parse (strVal.Substring (0, start + 1), culture);
- } catch(Exception)
- {
- throw new ArgumentOutOfRangeException();
- }
- if(val < Min || val > Max)
- throw new ArgumentOutOfRangeException();
- }
-
- private UnitType GetTypeFromString(string s)
- {
- if(s == null || s.Length == 0)
- return UnitType.Pixel;
- s = s.ToLower().Trim();
- string[] uTypes = {
- "px",
- "pt",
- "pc",
- "in",
- "mm",
- "cm",
- "%",
- "em",
- "ex"
- };
- int i = 0;
- foreach(string cType in uTypes)
- {
- if(s == cType)
- return (UnitType)Enum.ToObject(typeof(UnitType), (i + 1));
- i++;
- }
- return UnitType.Pixel;
- }
-
- private string GetStringFromPixel(UnitType ut)
- {
- string[] uTypes = {
- "px",
- "pt",
- "pc",
- "in",
- "mm",
- "cm",
- "%",
- "em",
- "ex"
- };
- if( !Enum.IsDefined(typeof(UnitType), ut) )
- return "px";
- return uTypes[(int)ut - 1];
- }
-
- public bool IsEmpty
- {
- get
- {
- return (type == 0);
- }
- }
-
- public UnitType Type
- {
- get
- {
- if(IsEmpty)
- return UnitType.Pixel;
- return type;
- }
- }
-
- public double Value
- {
- get
- {
- return val;
- }
- }
-
- public override bool Equals(object obj)
- {
- if(obj != null && obj is Unit)
- {
- Unit that = (Unit)obj;
- return ( this.type == that.type && this.val == that.val );
- }
- return false;
- }
-
- public override int GetHashCode()
- {
- return ( (type.GetHashCode() << 2) | (val.GetHashCode()) );
- }
-
- public override string ToString()
- {
- if(IsEmpty)
- return String.Empty;
- return ( val.ToString() + GetStringFromPixel(type) );
- }
-
- public string ToString(CultureInfo culture)
- {
- if(IsEmpty)
- return String.Empty;
- return ( val.ToString(culture) + GetStringFromPixel(type) );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
deleted file mode 100644
index b3320bb39ce..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/UnitConverter.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: UnitConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class UnitConverter : TypeConverter
- {
- public UnitConverter(): base()
- {
- }
-
- public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
- {
- if(sourceType == typeof(string))
- return true;
- return CanConvertFrom(context, sourceType);
- }
-
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value == null)
- return null;
- if(value is string)
- {
- string val = ((string)value).Trim();
- if(val.Length == 0)
- {
- return Unit.Empty;
- }
- return (culture == null ? Unit.Parse(val) : Unit.Parse(val, culture));
- }
- return ConvertFrom(context, culture, value);
- }
-
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(destinationType == typeof(string))
- {
- Unit val = (Unit)value;
- if(val == Unit.Empty)
- {
- return String.Empty;
- }
- return val.ToString(culture);
- }
- return ConvertTo(context, culture, value, destinationType);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs
deleted file mode 100755
index 285c1cc7195..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/UnitType.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: UnitType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum UnitType
- {
- Pixel = 1,
- Point,
- Pica,
- Inch,
- Mm,
- Cm,
- Percentage,
- Em,
- Ex
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
deleted file mode 100644
index 883154a7429..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatedControlConverter.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ValidatedControlConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ValidatedControlConverter : StringConverter
- {
- public ValidatedControlConverter(): base()
- {
- }
-
- private object[] GetValues(IContainer container)
- {
- ArrayList values = new ArrayList();
- IEnumerator ie = container.Components.GetEnumerator();
- try
- {
- foreach(IComponent current in container.Components)
- {
- Control ctrl = (Control)current;
- if(ctrl == null || ctrl.ID == null || ctrl.ID.Length == 0)
- continue;
- ValidationPropertyAttribute attrib = (ValidationPropertyAttribute)((TypeDescriptor.GetAttributes(ctrl))[typeof(ValidationPropertyAttribute)]);
- if(attrib == null || attrib.Name == null)
- continue;
- values.Add(String.Copy(ctrl.ID));
- }
- }finally
- {
- if(ie is IDisposable)
- ((IDisposable)ie).Dispose();
- }
- values.Sort();
- return values.ToArray();
- }
-
- public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- {
- if(context != null && context.Container != null)
- {
- object[] values = GetValues(context.Container);
- if(values != null)
- {
- return new StandardValuesCollection(values);
- }
- }
- return null;
- }
-
- public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- {
- return false;
- }
-
- public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs
deleted file mode 100755
index a752aa1df5d..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationCompareOperator.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidationCompareOperator
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidationCompareOperator
- {
- Equal,
- NotEqual,
- GreaterThan,
- GreaterThanEqual,
- LessThan,
- LessThanEqual,
- DataTypeCheck
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs
deleted file mode 100755
index 227133269e1..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationDataType.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidationDataType
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidationDataType
- {
- String,
- Integer,
- Double,
- Date,
- Currency
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
deleted file mode 100644
index a90ce3f20fe..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: ValidationSummary
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Drawing;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class ValidationSummary : WebControl
- {
- private bool uplevelRender;
-
- public ValidationSummary(): base(HtmlTextWriterTag.Div)
- {
- uplevelRender = false;
- ForeColor = Color.Red;
- }
-
- public ValidationSummaryDisplayMode DisplayMode
- {
- get
- {
- object o = ViewState["DisplayMode"];
- if(o != null)
- return (ValidationSummaryDisplayMode)o;
- return ValidationSummaryDisplayMode.BulletList;
- }
- set
- {
- if(!Enum.IsDefined(typeof(ValidationSummaryDisplayMode), value))
- throw new ArgumentException();
- ViewState["DisplayMode"] = value;
- }
- }
-
- public bool EnableClientScript
- {
- get
- {
- object o = ViewState["EnableClientScript"];
- if(o != null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["EnableClientScript"] = value;
- }
- }
-
- public override Color ForeColor
- {
- get
- {
- return ForeColor;
- }
- set
- {
- ForeColor = value;
- }
- }
-
- public bool ShowMessageBox
- {
- get
- {
- object o = ViewState["ShowMessageBox"];
- if(o != null)
- return (bool)o;
- return false;
- }
- set
- {
- ViewState["ShowMessageBox"] = value;
- }
- }
-
- public bool ShowSummary
- {
- get
- {
- object o = ViewState["ShowSummary"];
- if(o != null)
- return (bool)o;
- return true;
- }
- set
- {
- ViewState["ShowSummary"] = value;
- }
- }
-
- public string HeaderText
- {
- get
- {
- object o = ViewState["HeaderText"];
- if(o != null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["HeaderText"] = value;
- }
- }
-
- [MonoTODO("FIXME_See_Comments")]
- protected override void AddAttributesToRender(HtmlTextWriter writer)
- {
- AddAttributesToRender(writer);
- if(uplevelRender)
- {
- //FIXME: This is not the case always. I forgot the case when it is absent.
- // something to do with the ID's value? or ClienID's value itself?
- writer.AddAttribute("id", ClientID);
- if(HeaderText.Length > 0)
- writer.AddAttribute("headertext", HeaderText, true);
- if(ShowMessageBox)
- writer.AddAttribute("showmessagebox", "True");
- if(!ShowSummary)
- writer.AddAttribute("showsummary", "False");
- if(DisplayMode != ValidationSummaryDisplayMode.BulletList)
- {
- writer.AddAttribute("displaymode", PropertyConverter.EnumToString(typeof(ValidationSummaryDisplayMode), DisplayMode));
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs
deleted file mode 100755
index c3cf718395c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidationSummaryDisplayMode
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidationSummaryDisplayMode
- {
- List,
- BulletList,
- SingleParagraph
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs
deleted file mode 100755
index 48086af18bc..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ValidatorDisplay.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: ValidatorDisplay
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum ValidatorDisplay
- {
- None,
- Static,
- Dynamic
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs b/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs
deleted file mode 100755
index a115544e98c..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/VerticalAlign.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Enumeration: VerticalAlign
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.UI.WebControls
-{
- public enum VerticalAlign
- {
- NotSet,
- Top,
- Middle,
- Bottom
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
deleted file mode 100644
index 127633c390a..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: WebColorConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Globalization;
-using System.ComponentModel;
-using System.Drawing;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class WebColorConverter : ColorConverter
- {
- public WebColorConverter(): base()
- {
- }
-
- [MonoTODO("Implement_If_Color_Is_#xxxxxx_OR_A_KnownColor")]
- public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- if(value is string)
- {
- string val = ((string)value).Trim();
- if(val == String.Empty || val.Length == 0)
- {
- return Color.Empty;
- }
- if(val[0] == '#')
- {
- throw new NotImplementedException();
- }
- }
- return ConvertFrom(context, culture, value);
- }
-
- [MonoTODO("Convert_To_For_KnownColor_And_For_#xxxxxx")]
- public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- {
- if(destinationType == null)
- {
- throw new ArgumentNullException("destinationType");
- }
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
deleted file mode 100755
index 8451774a398..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/WebControl.cs
+++ /dev/null
@@ -1,486 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: WebControl
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 40%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-using System.Drawing;
-using System.Collections.Specialized;
-
-namespace System.Web.UI.WebControls
-{
- [PersistChildrenAttribute(false)]
- [ParseChildrenAttribute(true)]
- public class WebControl : Control, IAttributeAccessor
- {
- //TODO: A list of private members may be incomplete
-
- private HtmlTextWriterTag tagKey;
- private string stringTag;
- private AttributeCollection attributes;
- private StateBag attributeState;
- private Style controlStyle;
- private bool enabled;
- private string tagName;
-
- // TODO: The constructors definitions
- protected WebControl () : this (HtmlTextWriterTag.Span)
- {
- }
-
- public WebControl(HtmlTextWriterTag tag): base()
- {
- //FIXME: am i right?
- tagKey = tag;
- //stringTag = null;
- Initialize();
- }
-
- protected WebControl(string tag): base()
- {
- //FIXME: am i right?
- stringTag = tag;
- Initialize();
- }
-
- private void Initialize()
- {
- controlStyle = null;
- enabled = true;
- tagName = stringTag;
- attributeState = null;
- }
-
- public virtual string AccessKey
- {
- get
- {
- object o = ViewState["AccessKey"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["AccessKey"] = value;
- }
- }
-
- [MonoTODO("FIXME_Internal_method_calls")]
- public AttributeCollection Attributes
- {
- get
- {
- if(attributes==null)
- {
- //FIXME: From where to get StateBag and how? I think this method is OK!
- if(attributeState == null)
- {
- attributeState = new StateBag(true);
- //FIXME: Uncomment the following in the final release
- // commented because of the assembly problem.
- //The function TrackViewState() is internal
- /*
- if(IsTrackingViewState)
- {
- attributeState.TrackViewState();
- }
- */
- }
- attributes = new AttributeCollection(attributeState);
- }
- return attributes;
- }
- }
-
- public virtual Color BackColor
- {
- get
- {
- object o = ViewState["BackColor"];
- if(o != null)
- {
- return (Color)o;
- }
- return Color.Empty;
- }
- set
- {
- ViewState["BackColor"] = value;
- }
- }
-
- public virtual Color BorderColor
- {
- get
- {
- object o = ViewState["BorderColor"];
- if(o != null)
- {
- return (Color)o;
- }
- return Color.Empty;
- }
- set
- {
- ViewState["BorderColor"] = value;
- }
- }
-
- [MonoTODO("FIXME_Internal_method_calls")]
- public virtual BorderStyle BorderStyle
- {
- get
- {
- object o = ViewState["BorderStyle"];
- if(o != null)
- {
- return (BorderStyle)o;
- }
- return BorderStyle.NotSet;
- }
- set
- {
- if(!Enum.IsDefined(typeof(BorderStyle), value))
- {
- throw new ArgumentException();
- }
- ViewState["BorderStyle"] = value;
- }
- }
-
- public virtual Unit BorderWidth
- {
- get
- {
- object o = ViewState["BorderWidth"];
- if(o != null)
- {
- return (Unit)o;
- }
- return Unit.Empty;
- }
- set
- {
- if(value.Value < 0)
- {
- throw new ArgumentException();
- }
- ViewState["BorderWidth"] = value;
- }
- }
-
- [MonoTODO("FIXME_Internal_method_calls")]
- public virtual Style ControlStyle
- {
- get
- {
- if(controlStyle == null)
- {
- controlStyle = CreateControlStyle();
- //FIXME: Uncomment the following in the final release
- // commented because of the assembly problem.
- //The functions TrackViewState() and LoadViewState() are internal
- /*
- if(IsTrackingViewState)
- {
- controlStyle.TrackViewState();
- }
- controlStyle.LoadViewState(null);
- */
- }
- return controlStyle;
- }
- }
-
- public bool ControlStyleCreated
- {
- get
- {
- return (controlStyle!=null);
- }
- }
-
- public virtual string CssClass
- {
- get
- {
- return ControlStyle.CssClass;
- }
- set
- {
- ControlStyle.CssClass = value;
- }
- }
-
- public virtual bool Enabled
- {
- get
- {
- return enabled;
- }
- set
- {
- enabled = value;
- }
- }
-
- public virtual FontInfo Font
- {
- get
- {
- return ControlStyle.Font;
- }
- }
-
- public virtual Color ForeColor
- {
- get
- {
- return ControlStyle.ForeColor;
- }
- set
- {
- ControlStyle.ForeColor = value;
- }
- }
-
- public virtual Unit Height
- {
- get
- {
- return ControlStyle.Height;
- }
- set
- {
- ControlStyle.Height = value;
- }
- }
-
- public CssStyleCollection Style
- {
- get
- {
- return Attributes.CssStyle;
- }
- }
-
- public virtual short TabIndex
- {
- get
- {
- object o = ViewState["TabIndex"];
- if(o!=null)
- return (short)o;
- return 0;
- }
- set
- {
- if(value < -32768 || value > 32767)
- throw new ArgumentException();
- ViewState["TabIndex"] = value;
- }
- }
-
- public virtual string ToolTip
- {
- get
- {
- object o = ViewState["ToolTip"];
- if(o!=null)
- return (string)o;
- return String.Empty;
- }
- set
- {
- ViewState["ToolTip"] = value;
- }
- }
-
- public virtual Unit Width
- {
- get
- {
- return ControlStyle.Width;
- }
- set
- {
- ControlStyle.Width = value;
- }
- }
-
- [MonoTODO("FIXME_Internal_method_calls")]
- public void ApplyStyle(Style s)
- {
- /* FIXME: Again internal problem
- if(!ControlStyle.IsEmpty)
- {
- */
- ControlStyle.CopyFrom(s);
- //}
- }
-
- public void CopyBaseAttributes(WebControl controlSrc)
- {
- /*
- * AccessKey, Enabled, ToolTip, TabIndex, Attributes
- */
- AccessKey = controlSrc.AccessKey;
- Enabled = controlSrc.Enabled;
- ToolTip = controlSrc.ToolTip;
- TabIndex = controlSrc.TabIndex;
- attributes = controlSrc.Attributes;
- AttributeCollection otherAtt = controlSrc.Attributes;
- foreach (string key in controlSrc.Attributes.Keys)
- Attributes [key] = otherAtt [key];
- }
-
- public void MergeStyle(Style s)
- {
- ControlStyle.MergeWith(s);
- }
-
- public virtual void RenderBeginTag(HtmlTextWriter writer)
- {
- AddAttributesToRender(writer);
- writer.RenderBeginTag(TagName);
- }
-
- public virtual void RenderEndTag(HtmlTextWriter writer)
- {
- writer.RenderEndTag();
- }
-
- protected virtual HtmlTextWriterTag TagKey
- {
- get
- {
- return tagKey;
- }
- }
-
- protected virtual string TagName
- {
- get
- {
- if(tagName == null && TagKey != 0)
- {
- tagName = Enum.Format(typeof(HtmlTextWriterTag), TagKey, "G").ToString();
- }
- // What if tagName is null and tagKey 0?
- return tagName;
- }
- }
-
- protected virtual void AddAttributesToRender(HtmlTextWriter writer)
- {
- if (Page != null)
- Page.VerifyRenderingInServerForm (this);
-
- if(ID!=null)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
- }
- if(AccessKey.Length>0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, AccessKey);
- }
- if(!Enabled)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled");
- }
- if(ToolTip.Length>0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Title, ToolTip);
- }
- if(TabIndex != 0)
- {
- writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, TabIndex.ToString());
- }
- if(ControlStyleCreated)
- {
- if(!ControlStyle.IsEmpty)
- {
- ControlStyle.AddAttributesToRender(writer, this);
- }
- }
- if(attributeState != null){
- IEnumerator ie = Attributes.Keys.GetEnumerator ();
- while (ie.MoveNext ()){
- string key = (string) ie.Current;
- writer.AddAttribute (key, Attributes [key]);
- }
- }
- }
-
- protected virtual Style CreateControlStyle()
- {
- return new Style(ViewState);
- }
-
- [MonoTODO]
- protected override void LoadViewState(object savedState)
- {
- throw new NotImplementedException();
- //TODO: Load viewStates
- /*
- * May be will have to first look at Control::LoadViewState
- */
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- RenderBeginTag(writer);
- RenderContents(writer);
- RenderEndTag(writer);
- }
-
- protected virtual void RenderContents(HtmlTextWriter writer)
- {
- base.Render(writer);
- }
-
- [MonoTODO]
- protected override object SaveViewState()
- {
- throw new NotImplementedException();
- //TODO: Implement me!
- }
-
- protected override void TrackViewState()
- {
- TrackViewState();
- if(ControlStyleCreated)
- {
- ControlStyle.TrackViewState();
- }
- if(attributeState!=null)
- {
- attributeState.TrackViewState();
- }
- }
-
- string IAttributeAccessor.GetAttribute(string key)
- {
- if(Attributes!=null)
- return (string)Attributes[key];
- return null;
- }
-
- void IAttributeAccessor.SetAttribute(string key, string value)
- {
- Attributes[key] = value;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs
deleted file mode 100644
index 597f984e5d3..00000000000
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Xml.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * Namespace: System.Web.UI.WebControls
- * Class: Xml
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 75%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Xml.Xsl;
-using System.Xml.XPath;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.WebControls
-{
- public class Xml : Control
- {
- private XmlDocument document;
- private string documentContent;
- private string documentSource;
- private XslTransform transform;
- private XsltArgumentList transformArgumentList;
- private string transformSource;
-
- private XPathDocument xpathDoc;
-
- private static XslTransform defaultTransform;
-
- static Xml()
- {
- XmlTextReader reader = new XmlTextReader(new StringReader("<xsl:stylesheet version='1.0' " +
- "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>" +
- "<xsl:template match=\"\">" +
- "<xsl:copy-of select=\".\"/>" +
- "</xsl:template>" +
- "</xsl:stylesheet>"));
- defaultTransform = new XslTransform();
- defaultTransform.Load(reader);
- }
-
- public Xml(): base()
- {
- }
-
- [MonoTODO("Initialize_Document")]
- private void LoadXmlDoc()
- {
- throw new NotImplementedException();
- }
-
- public XmlDocument Document
- {
- get
- {
- if(document == null)
- LoadXmlDoc();
- return document;
- }
- set
- {
- documentSource = null;
- documentContent = null;
- xpathDoc = null;
- document = value;
- }
- }
-
- public string DocumentContent
- {
- get
- {
- return String.Empty;
- }
- set
- {
- document = null;
- xpathDoc = null;
- documentContent = value;
- }
- }
-
- public string DocumentSource
- {
- get
- {
- if(documentSource != null)
- return documentSource;
- return String.Empty;
- }
- set
- {
- document = null;
- documentContent = null;
- xpathDoc = null;
- documentSource = value;
- }
- }
-
- public XslTransform Transform
- {
- get
- {
- return transform;
- }
- set
- {
- transformSource = null;
- transform = value;
- }
- }
-
- public string TransformSource
- {
- get
- {
- if(transformSource != null)
- return transformSource;
- return String.Empty;
- }
- set
- {
- transform = null;
- transformSource = value;
- }
- }
-
- public XsltArgumentList TransformArgumentList
- {
- get
- {
- return transformArgumentList;
- }
- set
- {
- transformArgumentList = value;
- }
- }
-
- protected override void AddParsedSubObject(object obj)
- {
- if(obj is LiteralControl)
- {
- DocumentContent = ((LiteralControl)obj).Text;
- return;
- }
- throw new HttpException(HttpRuntime.FormatResourceString("Cannot_Have_Children_of_Type", "Xml", GetType().Name.ToString()));
- }
-
- [MonoTODO("Initialize_xpathDocument")]
- private void LoadXpathDoc()
- {
- if(documentContent != null && documentContent.Length > 0)
- {
- xpathDoc = new XPathDocument(new StringReader(documentContent));
- return;
- }
- if(documentSource == null || documentSource.Length == 0)
- {
- return;
- }
- throw new NotImplementedException();
- }
-
- [MonoTODO("Initialize_Transform")]
- private void LoadTransform()
- {
- throw new ArgumentException();
- }
-
- [MonoTODO]
- protected override void Render(HtmlTextWriter output)
- {
- if(document == null)
- {
- LoadXpathDoc();
- }
-
- LoadTransform();
- if(document == null || xpathDoc == null)
- {
- return;
- }
- if(transform == null)
- {
- transform = defaultTransform;
- }
- if(document != null)
- {
- Transform.Transform(document, transformArgumentList, output);
- return;
- }
- Transform.Transform(xpathDoc, transformArgumentList, output);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs b/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
deleted file mode 100755
index 8f4df42b9ef..00000000000
--- a/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.Web.UI.AttributeCollection.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI {
-
- public sealed class AttributeCollection
- {
- private StateBag bag;
-
- public AttributeCollection (StateBag bag)
- {
- this.bag = bag;
- }
-
- public int Count {
- get { return bag.Count; }
- }
-
- [MonoTODO]
- public CssStyleCollection CssStyle {
- get { return null; }
- }
-
- public string this [string key] {
- get { return bag [key] as string; }
-
- set { bag.Add (key, value); }
- }
-
- public ICollection Keys {
- get { return bag.Keys; }
- }
-
- public void Add (string key, string value)
- {
- bag.Add (key, value); // if exists, only the value is replaced.
- }
-
- public void AddAttributes (HtmlTextWriter writer)
- {
- foreach (string key in bag.Keys) {
- string value = bag [key] as string;
- writer.AddAttribute (key, value);
- }
- }
-
- public void Clear ()
- {
- bag.Clear ();
- }
-
- public void Remove (string key)
- {
- bag.Remove (key);
- }
-
- public void Render (HtmlTextWriter writer)
- {
- foreach (string key in bag.Keys) {
- string value = bag [key] as string;
- writer.WriteAttribute (key, value);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/BaseParser.cs b/mcs/class/System.Web/System.Web.UI/BaseParser.cs
deleted file mode 100755
index 981cc5d0828..00000000000
--- a/mcs/class/System.Web/System.Web.UI/BaseParser.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Web.UI.BaseParser.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Web.UI {
- public class BaseParser
- {
- // LAMESPEC: We know nothing about this class from the docs.
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/BuildMethod.cs b/mcs/class/System.Web/System.Web.UI/BuildMethod.cs
deleted file mode 100644
index d06a4024166..00000000000
--- a/mcs/class/System.Web/System.Web.UI/BuildMethod.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.UI.BuildMethod.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public delegate Control BuildMethod();
-}
diff --git a/mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs b/mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs
deleted file mode 100644
index 8d53ce41e2e..00000000000
--- a/mcs/class/System.Web/System.Web.UI/BuildTemplateMethod.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.UI.BuildTemplateMethod.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public delegate void BuildTemplateMethod(Control control);
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog
deleted file mode 100644
index 2e32b45cafa..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ChangeLog
+++ /dev/null
@@ -1,292 +0,0 @@
-2002-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs: implemented more properties using information we already
- have in Context.
- (OnFormRender):
- (OnFormPostRender):
- (VerifyRenderingInServerForm): implemented.
-
-2002-06-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs: changed InvokeEventMethod to use a GetMethod that works with
- out runtime. Renamed Page_Init and Page_Load.
-
- After this, we can load a dll and render HTML in linux.
-
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Control.cs:
- (AddedControl): new function that is called whenever a control is
- added to a collection of controls in a container. It sets the defaults
- except for Page.
-
- * ControlCollection.cs: call AddedControl in Add/AddAt.
-
- * DataBoundLiteralControl.cs: implemented constructor, Text, Render,
- SetStaticString and SetDataBoundString.
-
- * Page.cs: removed SetDefaults.
-
-2002-06-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * CompiledTemplateBuilder.cs: new file. Used in the code generated
- by xsp.
-
- * Control.cs:
- (BindingContainer): implemented.
- (EnsureChildControls): avoid stack overflow.
-
- * DataBinder.cs: implemented Eval and PropertyValue.
-
-2002-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HtmlTextWriter.cs: fixed style attributes rendering (almost the same
- bug as in regular attributes).
-
-2002-06-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Control.cs: implemented PreventAutoID.
-
- * Page.cs:
- (SetDefaults): don't set ID automatically if Control.PreventAutoID has
- been called.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs:
- (Validators): if the collection is null, create one.
- (GetPostBackEventReference 2): don't throw exception.
- (GetPostBackClientEvent): return a string with containing the method
- name, the control name and the argument.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs: SetPage is now called SetDefaults and also sets a default
- ID for controls that don't have one yet.
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs:
- (GetPostBackClient):
- (RegisterRequiresPostBack): don't throw NotImplementedException to
- keep going.
- (ProcessRequest): set the current page as the Page property for *all*
- the controls, not just the direct children of the page.
-
-2002-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Control.cs:
- (MapPathSecure): until security is implemented, return the same path
- received as argument.
- (RenderControl): call OnPreRender before rendering the control. So
- AdRotator can read its configuration file.Is there any other place
- where this should be done?
-
- * HtmlTextWriter.cs:
- (AddAttribute): fixed. Now it really stores attributes.
- (RenderBeginTag): fixed a couple of bugs (little ones but hard to find).
-
-2002-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ControlCollection.cs:
- (AddAt): if index is -1 behave as a plain Add.
-
-2002-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs: for each child control to render, assign Control.Page.
- Probably also needed in HtmlContainerControl derived classes.
-
-2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * AttributeCollection.cs: don't need a Hastable. StateBag now works
- fine and takes care of the details.
-
- * Control.cs: added HasChildren property.
-
- * StateBag.cs: fixed a couple of nasty bugs.
-
-2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs: run OnInit, OnLoad y PreRender before rendering the page.
- Invoke Page_Init and/or Page_Load if the user supplied them (though
- this should depend on AutoEventWireUp attribute of Page directive).
-
-2002-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Control.cs: don't throw exception in ControlID. By now, it returns ID.
-
- * Page.cs:
- (ProcessRequest): implemented.
-
-2002-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Web.UI/Page.cs: finished stubbing out. Implemented some
- methods.
-
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Page.cs:
- (FileDependencies): now is public public.
- (EnableViewStateMAC): uncommented and made protected.
- (GetTypeHashCode): added method.
-
-2002-05-24 Duncan Mak <duncan@ximian.com>
-
- * TemplateControl.cs (SetStringResourcePointer): Fixed typo.
-
- * StateBag.cs (Item): Changed the visibility level of the this
- [object] indexer.
-
- Misc. formatting edits, fixing some bugs introduced by the indentation.
-
- * DataBinder.cs (Eval)
- (GetIndexedPropertyValue)
- (GetPropertyValue): Fixed return types.
-
-2002-05-21 Miguel de Icaza <miguel@ximian.com>
-
- * HtmlTextWriter.cs: Use this to change the member instances.
-
-2002-05-17 Duncan Mak <duncan@ximian.com>
-
- * AttributeCollection.cs:
- * ControlCollection.cs:
- * CssStyleCollection.cs:
- * DataBindingCollection.cs:
- * EmptyControlCollection.cs: Added missing Collection classes.
-
-2002-05-17 Duncan Mak <duncan@ximian.com>
-
- * BaseParser.cs:
- * TemplateParser.cs: Implemented. BaseParser is weird because
- there is no documentation on what it does.
-
- * ControlBuilder.cs:
-
- * DataBinder.cs:
- * DataBinding.cs: Added.
-
- * DataBoundLiteralControl.cs:
- * Triplet.cs: Added.
-
- * RenderMethod.cs: Added this delegate for Control.cs
-
-2002-05-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ValidationPropertyAttribute.cs: a couple of fixes to make it compile.
-
-2002-05-14 Duncan Mak <duncan@ximian.com>
-
- * ValidationPropertyAttribute.cs: Added to CVS.
-
-2002-05-10 Duncan Mak <duncan@ximian.com>
-
- * ConstructorNeedsTagAttribute.cs:
- * ControlBuilderAttribute.cs:
- * ImageClickEventArgs.cs:
- * ParseChildrenAttribute.cs:
- * PartialCachingAttribute.cs:
- * PersistChildrenAttribute.cs:
- * PersistenceModeAttribute.cs:
- * TemplateContainerAttribute.cs: Added to CVS.
-
- * PersistanceMode.cs: Removed, fixed typo.
- * PersistenceMode.cs: Replacing above.
-
- * StateBag.cs (this): Fixed indexer, it takes a string as the
- index, not an object.
-
- * ValidatorCollection.cs: Fixed typo, ValidatedCollection to ValidatorCollection.
-
- * Page.cs (Validators): return type should be ValidatorCollection,
- not ValidatedCollection.
-
- * TagPrefixAttribute.cs: Added to CVS.
-
-2002-05-07 Duncan Mak <duncan@ximian.com>
-
- * Utils.cs (GetClientValidatedEvent): Uncommented the 'Page' argument.
-
-2002-03-26 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DataBindingHandlerAttribute.cs
- - Completed
- * ToolboxDataAttribute.cs - Completed
-
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * DesignTimeParseData.cs: initialze static member to avoid compile
- error
- * PropertyConverter.cs: remove uneeded exception variables from
- catch blocks.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * DesignTimeParseData.cs: fix header to show correct class name
-
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * StateBag.cs - Completed
-
-2001-12-19 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * Pair.cs - Small undocumented class. Completed.
-
-2001-12-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * DesignTimeParseData.cs - Initial implementation
- * StateBag.cs - Initial implementation
-
-2001-12-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * PropertyConverter.cs - Undocumented class. Completed.
- * Utils.cs - Undocumented, private class.
- Initial implementation
-
-2001-08-28 Bob Smith <bob@thestuff.net>
- * Control.cs: Figured out some undocumented API.
- * Added TODO.
- * BuildMethod.cs: Initial implementation.
- * BuildTemplateMethod.cs: Initial implementation.
- * HtmlTextWriterAttribute.cs: Initial implementation.
- * HtmlTextWriterStyle.cs: Initial implementation.
- * HtmlTextWriterTag.cs: Initial implementation.
- * IAttributeAccessor.cs: Initial implementation.
- * IDataBindingsAccessor.cs: Initial implementation.
- * ImageClickEventHandler.cs: Initial implementation.
- * INamingContainer.cs: Initial implementation.
- * IParserAccessor.cs: Initial implementation.
- * IPostBackDataHandler.cs: Initial implementation.
- * IPostBackEventHandler.cs: Initial implementation.
- * IStateManager.cs: Initial implementation.
- * ITagNameToTypeMapper.cs: Initial implementation.
- * ITemplate.cs: Initial implementation.
- * IValidator.cs: Initial implementation.
- * OutputCacheLocation.cs: Initial implementation.
- * PersistanceMode.cs: Initial implementation.
- * StateItem.cs: Initial implementation.
-
-2001-08-27 Bob Smith <bob@thestuff.net>
-
- * Control.cs: Bug fixes and implementations.
-
-2001-08-24 Bob Smith <bob@thestuff.net>
-
- * Control.cs: Bug fixes.
-
-2001-08-23 Bob Smith <bob@thestuff.net>
-
- * Control.cs: More implementation. Events reworked for performance.
-
-2001-08-22 Bob Smith <bob@thestuff.net>
-
- * LiteralControl.cs: Implemented.
- * Control.cs: Even more implementation (Events). What a beast.
-
-2001-08-20 Bob Smith <bob@thestuff.net>
-
- * Control.cs: More implementation. Not done yet. Shutter.
-
-2001-08-17 Bob Smith <bob@thestuff.net>
-
- * Control.cs: Partial implementation.
diff --git a/mcs/class/System.Web/System.Web.UI/CompiledTemplateBuilder.cs b/mcs/class/System.Web/System.Web.UI/CompiledTemplateBuilder.cs
deleted file mode 100644
index cbe660d25d4..00000000000
--- a/mcs/class/System.Web/System.Web.UI/CompiledTemplateBuilder.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Web.UI.CompiledTemplateBuilder
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-// This is used in the generated C# code from MS and xsp does the same.
-// It just seems to be a container implementing an ITemplate interface.
-
-namespace System.Web.UI {
-
-public class CompiledTemplateBuilder : ITemplate
-{
- private BuildTemplateMethod templateMethod;
-
- public CompiledTemplateBuilder (BuildTemplateMethod templateMethod)
- {
- this.templateMethod = templateMethod;
- }
-
- public void InstantiateIn (Control ctrl)
- {
- templateMethod (ctrl);
- }
-}
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs b/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs
deleted file mode 100755
index f52a4c6e0b0..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ConstructorNeedsTagAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Web.UI.ConstructorNeedsTagAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class ConstructorNeedsTagAttribute : Attribute
- {
- bool needsTag;
-
- // LAMESPEC: we will default to true for now.
- public ConstructorNeedsTagAttribute ()
- {
- needsTag = true;
- }
-
- public ConstructorNeedsTagAttribute (bool needsTag)
- {
- this.needsTag = needsTag;
- }
-
- public bool NeedsTag {
- get { return needsTag; }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs
deleted file mode 100644
index 257be55c826..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Control.cs
+++ /dev/null
@@ -1,658 +0,0 @@
-//
-// System.Web.UI.Control.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-/*
- * Maintainer: bob@thestuff.net, gvaish@iitk.ac.in
- * (C) Bob Smith, Gaurav Vaish
- */
-
-//notes: view state only tracks changes after OnInit method is executed for the page request. You can read from it at any time, but cant write to it during rendering.
-//even more notes: view state info in trackviewstate method description. read later.
-//Ok, enough notes: what the heck is different between enable view state, and track view state.
-//Well, maybe not. How does the ViewState know when to track changes? Does it look at the property
-//on the owning control, or does it have a method/property of its own that gets called?
-// I think this last question is solved in the Interface for it. Look into this.
-
-//cycle:
-//init is called when control is first created.
-//load view state ic called right after init to populate the view state.
-//loadpostdata is called if ipostbackdatahandler is implemented.
-//load is called when control is loaded into a page
-//raisepostdatachangedevent if ipostbackdatahandler is implemented.
-//raisepostbackevent if ipostbackeventhandler is implemented.
-//prerender is called when the server is about to render its page object
-//SaveViewState is called.
-//Unload then dispose it apears. :)
-
-//Naming Container MUST have some methods. What are they? No clue. Help?
-
-//read this later. http://gotdotnet.com/quickstart/aspplus/
-//This to: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpconattributesdesign-timesupport.asp
-//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpcontracefunctionality.asp
-
-// Isnt life grand? :)
-// See the undocumented methods? Gota love um. ;)
-// ASP.test4_aspx.Page_Load(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.OnLoad(EventArgs e) +67
-// System.Web.UI.Control.LoadRecursive() +73
-// System.Web.UI.Page.ProcessRequestMain() +394
-
-// ASP.test4_aspx.Page_Unload(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.EventHandler.Invoke(Object sender, EventArgs e) +0
-// System.Web.UI.Control.OnUnload(EventArgs e) +67
-// System.Web.UI.Control.UnloadRecursive(Boolean dispose) +78
-// System.Web.UI.Page.ProcessRequest() +194
-// System.Web.UI.Page.ProcessRequest(HttpContext context) +18
-// System.Web.CallHandlerExecutionStep.Execute() +179
-// System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
-
-
-// ASP.test4_aspx.Page_Unload(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.OnUnload(EventArgs e) +67
-// System.Web.UI.Control.UnloadRecursive(Boolean dispose) +78
-// System.Web.UI.Page.ProcessRequest()
-
-// ASP.test4_aspx.Page_Kill(Object Sender, EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.OnPreRender(EventArgs e) +67
-// System.Web.UI.Control.PreRenderRecursiveInternal() +61
-// System.Web.UI.Page.ProcessRequestMain() +753
-
-// ASP.test4_aspx.OnInit(EventArgs e) in \\genfs2\www24\bobsmith11\test4.aspx:6
-// System.Web.UI.Control.InitRecursive(Control namingContainer) +202
-// System.Web.UI.Page.ProcessRequestMain() +120
-
-// ASP.test4_aspx.SaveViewState() in \\genfs2\www24\bobsmith11\test4.aspx:12
-// System.Web.UI.Control.SaveViewStateRecursive() +51
-// System.Web.UI.Page.SavePageViewState() +174
-// System.Web.UI.Page.ProcessRequestMain() +861
-
-// ASP.test_aspx.LoadViewState(Object t) +28
-// System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +125
-// System.Web.UI.Page.LoadPageViewState() +182
-// System.Web.UI.Page.ProcessRequestMain() +256
-
-using System;
-using System.Collections;
-using System.Web;
-using System.ComponentModel;
-
-namespace System.Web.UI
-{
- public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
- {
- private static readonly object DataBindingEvent = new object();
- private static readonly object DisposedEvent = new object();
- private static readonly object InitEvent = new object();
- private static readonly object LoadEvent = new object();
- private static readonly object PreRenderEvent = new object();
- private static readonly object UnloadEvent = new object();
- private string _userId = null;
- private string _cachedUserId = null;
- private string _cachedClientId = null;
- private ControlCollection _controls = null;
- private bool _enableViewState = true;
- private IDictionary _childViewStates = null; //TODO: Not sure datatype. Placeholder guess.
- private bool _isNamingContainer = false;
- private Control _namingContainer = null;
- private Page _page = null;
- private Control _parent = null;
- private ISite _site = null;
- private bool _visible = true;
- private HttpContext _context = null;
- private bool _childControlsCreated = false;
- private StateBag _viewState = null;
- private bool _trackViewState = false;
- private EventHandlerList _events = new EventHandlerList();
- private RenderMethod _renderMethodDelegate = null;
- private bool autoID = true;
- private bool creatingControls = false;
-
- private DataBindingCollection dataBindings = null;
-
- public Control()
- {
- if (this is INamingContainer) _isNamingContainer = true;
- }
-
- public Control BindingContainer
- {
- get {
- Control container = NamingContainer;
- if (_isNamingContainer)
- container = container.BindingContainer;
- return container;
- }
- }
-
- public virtual string ClientID //DIT
- {
- get
- {
- if (_cachedUserId != null && _cachedClientId != null)
- return _cachedClientId;
- _cachedUserId = UniqueID.Replace(':', '_');
- return _cachedUserId;
- }
- }
- public virtual ControlCollection Controls //DIT
- {
- get
- {
- if (_controls == null) _controls = CreateControlCollection();
- return _controls;
- }
- }
- public virtual bool EnableViewState //DIT
- {
- get
- {
- return _enableViewState;
- }
- set
- {
- _enableViewState = value;
- }
- }
- public virtual string ID
- {
- get //DIT
- {
- return _userId;
- }
- set
- {
- if (value == null || value == "") return;
- _userId = value;
- _cachedUserId = null;
- //TODO: Some Naming Container stuff here I think.
- }
- }
- public virtual Control NamingContainer //DIT
- {
- get
- {
- if (_namingContainer == null && _parent != null)
- {
- if (_parent._isNamingContainer == false)
- _namingContainer = _parent.NamingContainer;
- else
- _namingContainer = _parent;
- }
- return _namingContainer;
- }
- }
- public virtual Page Page //DIT
- {
- get
- {
- if (_page == null && _parent != null) _page = _parent.Page;
- return _page;
- }
- set
- {
- _page = value;
- }
- }
- public virtual Control Parent //DIT
- {
- get
- {
- return _parent;
- }
- }
- public ISite Site //DIT
- {
- get
- {
- return _site;
- }
- set
- {
- _site = value;
- }
- }
- public virtual string TemplateSourceDirectory
- {
- get
- {
- return Context.Request.ApplicationPath; //TODO: Dont think this is right.
- }
- }
-
- [MonoTODO]
- public virtual string UniqueID
- {
- get
- {
- //TODO: Some Naming container methods here. What are they? Why arnt they declared?
- //Note: Nuked the old stuff here. Was total crap. :)
- return ID;
- }
- }
- public virtual bool Visible
- { //TODO: Are children visible when parents are not?
- get
- {
- return _visible;
- }
- set
- {
- _visible = value;
- }
- }
- protected bool ChildControlsCreated //DIT
- {
- get
- {
- return _childControlsCreated;
- }
- set
- {
- if (value == false && _childControlsCreated == true)
- _controls.Clear();
- _childControlsCreated = value;
- }
- }
- protected virtual HttpContext Context //DIT
- {
- get
- {
- HttpContext context;
- if (_context != null)
- return _context;
- if (_parent == null)
- return HttpContext.Current;
- context = _parent.Context;
- if (context != null)
- return context;
- return HttpContext.Current;
- }
- }
- protected EventHandlerList Events //DIT
- {
- get
- {
- if (_events == null)
- {
- _events = new EventHandlerList();
- }
- return _events;
- }
- }
- protected bool HasChildViewState //DIT
- {
- get
- {
- if (_childViewStates == null) return false;
- return true;
- }
- }
- protected bool IsTrackingViewState //DIT
- {
- get
- {
- return _trackViewState;
- }
- }
- protected virtual StateBag ViewState
- {
- get
- {
- if(_viewState == null)
- {
- _viewState = new StateBag(ViewStateIgnoresCase);
- if(IsTrackingViewState)
- _viewState.TrackViewState();
- }
- return _viewState;
- }
- }
- protected virtual bool ViewStateIgnoresCase //DIT
- {
- get
- {
- return true;
- }
- }
-
- private int defaultNumberID;
- protected internal virtual void AddedControl (Control control, int index)
- {
- /* Ensure the control don't have more than 1 parent */
- if (control._parent != null)
- control._parent.Controls.Remove (control);
-
- control._parent = this;
- control._page = _page;
-
- // Without this, DataBoundLiteralControl crashes in OnDataBound event.
- Control namingContainer = NamingContainer;
- if (namingContainer != null)
- control._namingContainer = namingContainer;
-
- if (control.AutoID == true && control.ID == null)
- control.ID = "_ctrl_" + defaultNumberID++;
- }
-
- protected virtual void AddParsedSubObject(object obj) //DIT
- {
- Control c = (Control)obj;
- if (c != null) Controls.Add(c);
- }
- protected void BuildProfileTree(string parentId, bool calcViewState)
- {
- //TODO
- }
- protected void ClearChildViewState()
- {
- //TODO
- //Not quite sure about this. an example clears children then calls this, so I think
- //view state is local to the current object, not children.
- }
- protected virtual void CreateChildControls() {} //DIT
- protected virtual ControlCollection CreateControlCollection() //DIT
- {
- return new ControlCollection(this);
- }
-
- protected virtual void EnsureChildControls () //DIT
- {
- if (ChildControlsCreated == false && !creatingControls) {
- creatingControls = true;
- CreateChildControls();
- ChildControlsCreated = true;
- creatingControls = false;
- }
- }
-
- protected virtual Control FindControl(string id, int pathOffset)
- {
- //TODO: I think there is Naming Container stuff here. Redo.
- int i;
- for (i = pathOffset; i < _controls.Count; i++)
- if (_controls[i].ID == id) return _controls[i];
- return null;
- }
- protected virtual void LoadViewState(object savedState)
- {
- //TODO: What should I do by default?
- }
-
- [MonoTODO]
- protected string MapPathSecure(string virtualPath)
- {
- //TODO: Need to read up on security+web.
- //Return the same path. So AdRotator can read its config file.
- return virtualPath;
- }
- protected virtual bool OnBubbleEvent(object source, EventArgs args) //DIT
- {
- return false;
- }
- protected virtual void OnDataBinding(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[DataBindingEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnInit(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[InitEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnLoad(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[LoadEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnPreRender(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[PreRenderEvent]);
- if (eh != null) eh(this, e);
- }
- }
- protected virtual void OnUnload(EventArgs e) //DIT
- {
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[UnloadEvent]);
- if (eh != null) eh(this, e);
- }
- }
-
- [MonoTODO]
- protected void RaiseBubbleEvent(object source, EventArgs args)
- {
- throw new NotImplementedException();
- //return false;
- }
- protected virtual void Render(HtmlTextWriter writer) //DIT
- {
- RenderChildren(writer);
- }
- protected virtual void RenderChildren(HtmlTextWriter writer) //DIT
- {
- if (_renderMethodDelegate != null)
- _renderMethodDelegate(writer, this);
- else if (_controls != null)
- foreach (Control c in _controls)
- c.RenderControl(writer);
- }
- protected virtual object SaveViewState()
- {
- return ViewState;
- }
- protected virtual void TrackViewState()
- {
- _trackViewState = true;
- }
-
- [MonoTODO]
- public virtual void Dispose()
- {
- //TODO: nuke stuff.
- throw new NotImplementedException();
- /*
- if (_events != null)
- {
- EventHandler eh = (EventHandler)(_events[DisposedEvent]);
- if (eh != null) eh(this, e);
- }
- */
- }
-
- public bool HasChildren
- {
- get { return (_controls != null && _controls.Count > 0); }
- }
-
- public event EventHandler DataBinding //DIT
- {
- add
- {
- Events.AddHandler(DataBindingEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DataBindingEvent, value);
- }
- }
- public event EventHandler Disposed //DIT
- {
- add
- {
- Events.AddHandler(DisposedEvent, value);
- }
- remove
- {
- Events.RemoveHandler(DisposedEvent, value);
- }
- }
- public event EventHandler Init //DIT
- {
- add
- {
- Events.AddHandler(InitEvent, value);
- }
- remove
- {
- Events.RemoveHandler(InitEvent, value);
- }
- }
- public event EventHandler Load //DIT
- {
- add
- {
- Events.AddHandler(LoadEvent, value);
- }
- remove
- {
- Events.RemoveHandler(LoadEvent, value);
- }
- }
- public event EventHandler PreRender //DIT
- {
- add
- {
- Events.AddHandler(PreRenderEvent, value);
- }
- remove
- {
- Events.RemoveHandler(PreRenderEvent, value);
- }
- }
- public event EventHandler Unload //DIT
- {
- add
- {
- Events.AddHandler(UnloadEvent, value);
- }
- remove
- {
- Events.RemoveHandler(UnloadEvent, value);
- }
- }
- public virtual void DataBind() //DIT
- {
- OnDataBinding(EventArgs.Empty);
- if (_controls != null)
- foreach (Control c in _controls)
- c.DataBind();
- }
- public virtual Control FindControl(string id) //DIT
- {
- return FindControl(id, 0);
- }
- public virtual bool HasControls() //DIT
- {
- if (_controls != null && _controls.Count >0) return true;
- return false;
- }
- public void RenderControl(HtmlTextWriter writer)
- {
- if (_visible)
- {
- // By now, PreRender is fired here.
- OnPreRender (EventArgs.Empty); //FIXME
- //TODO: Something about tracing here.
- Render(writer);
- }
- }
-
- [MonoTODO]
- public string ResolveUrl(string relativeUrl)
- {
- return relativeUrl;
- }
- public void SetRenderMethodDelegate(RenderMethod renderMethod) //DIT
- {
- _renderMethodDelegate = renderMethod;
- }
- protected void LoadRecursive()
- {
- OnLoad(EventArgs.Empty);
- if (_controls != null) foreach (Control c in _controls) c.LoadRecursive();
- }
- protected void UnloadRecursive(Boolean dispose)
- {
- OnUnload(EventArgs.Empty);
- if (_controls != null) foreach (Control c in _controls) c.UnloadRecursive(dispose);
- if (dispose) Dispose();
- }
- protected void PreRenderRecursiveInternal()
- {
- OnPreRender(EventArgs.Empty);
- if (_controls != null) foreach (Control c in _controls) c.PreRenderRecursiveInternal();
- }
- protected void InitRecursive(Control namingContainer)
- {
- if (_controls != null) foreach (Control c in _controls) c.InitRecursive(namingContainer);
- OnInit(EventArgs.Empty);
- }
-
- [MonoTODO]
- protected object SaveViewStateRecursive()
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- protected void LoadViewStateRecursive(Object savedState)
- {
- throw new NotImplementedException();
- }
-
- void IParserAccessor.AddParsedSubObject(object obj)
- {
- this.AddParsedSubObject(obj);
- }
-
- DataBindingCollection IDataBindingsAccessor.DataBindings
- {
- get
- {
- if(dataBindings == null)
- dataBindings = new DataBindingCollection();
- return dataBindings;
- }
- }
-
- bool IDataBindingsAccessor.HasDataBindings
- {
- get
- {
- return (dataBindings!=null && dataBindings.Count>0);
- }
- }
-
- internal bool AutoID
- {
- get { return autoID; }
- set { autoID = value; }
- }
-
- internal void PreventAutoID()
- {
- AutoID = false;
- }
-
- //TODO: I think there are some needed Interface implementations to do here.
- //TODO: Find api for INamingContainer.
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs b/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs
deleted file mode 100755
index 7acb206a3a3..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// System.Web.UI.ControlBuilder.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI {
-
- public class ControlBuilder
- {
- TemplateParser parser;
- ControlBuilder parentBuilder;
- Type type;
- string tagName;
- string id;
- IDictionary attribs;
- int line;
- string fileName;
-
- public ControlBuilder ()
- {
- }
-
-
- internal ControlBuilder (
- TemplateParser parser, ControlBuilder parentBuilder,
- Type type, string tagName, string id,
- IDictionary attribs, int line, string sourceFileName)
-
- {
- this.parser = parser;
- this.parentBuilder = parentBuilder;
- this.type = type;
- this.tagName = tagName;
- this.id = id;
- this.attribs = attribs;
- this.line = line;
- this.fileName = sourceFileName;
- }
-
- public Type ControlType {
- get { return type; }
- }
-
- [MonoTODO]
- public bool FChildrenAsProperties {
- get { return false; }
- }
-
- [MonoTODO]
- public bool FIsNonParserAccessor {
- get { return false; }
- }
-
- [MonoTODO]
- public bool HasAspCode {
- get { return false; }
- }
-
- public string ID {
- get { return id; }
-
- set { id = value; }
- }
-
- [MonoTODO]
- public bool InDesigner {
- get { return false; }
- }
-
- [MonoTODO]
- public Type NamingContainerType {
- get { return null; }
- }
-
- protected TemplateParser Parser {
- get { return parser; }
- }
-
- public string TagName {
- get { return tagName; }
- }
-
- [MonoTODO]
- public virtual bool AllowWhitespaceLiterals ()
- {
- return false;
- }
-
- [MonoTODO]
- public virtual void AppendLiteralString (string s)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void AppendSubBuilder (ControlBuilder subBuilder)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void CloseControl ()
- {
- }
-
- [MonoTODO]
- public static ControlBuilder CreateBuilderFromType (
- TemplateParser parser, ControlBuilder parentBuilder,
- Type type, string tagName, string id,
- IDictionary attribs, int line, string sourceFileName)
- {
- return new ControlBuilder (parser, parentBuilder, type,
- tagName, id, attribs, line, sourceFileName);
- }
-
- [MonoTODO]
- public virtual Type GetChildControlType (string tagName, IDictionary attribs)
- {
- return attribs [tagName] as Type;
- }
-
- [MonoTODO]
- public virtual bool HasBody ()
- {
- return false;
- }
-
- [MonoTODO]
- public virtual bool HtmlDecodeLiterals ()
- {
- return false;
- }
-
- [MonoTODO]
- public virtual void Init (
- TemplateParser parser, ControlBuilder parentBuilder,
- Type type, string tagName, string id, IDictionary attribs)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool NeedsTagInnerText ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void OnAppendToParentBuilder ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void SetTagInnerText (string text)
- {
- throw new NotImplementedException ();
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs b/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs
deleted file mode 100755
index b5548119b2d..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ControlBuilderAttribute.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Web.UI.ControlBuilderAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class ControlBuilderAttribute : Attribute
- {
- Type builderType;
- public static readonly ControlBuilderAttribute Default;
-
- public ControlBuilderAttribute (Type builderType)
- {
- this.builderType = builderType;
- }
-
- public Type BuilderType {
- get { return builderType; }
- }
-
- [MonoTODO]
- public override bool Equals (object obj)
- {
- return false;
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return 42;
- }
-
- [MonoTODO]
- public override bool IsDefaultAttribute ()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ControlCollection.cs b/mcs/class/System.Web/System.Web.UI/ControlCollection.cs
deleted file mode 100755
index 6806e04762b..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ControlCollection.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// System.Web.UI.ControlCollection.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI {
-
- public class ControlCollection : ICollection, IEnumerable
- {
- ArrayList list = new ArrayList ();
- Control owner;
-
- public ControlCollection (Control owner)
- {
- if (owner == null)
- throw new ArgumentException ();
-
- this.owner = owner;
- }
-
- public int Count {
- get { return list.Count; }
- }
-
- public bool IsReadOnly {
- get { return list.IsReadOnly; }
- }
-
- public bool IsSynchronized {
- get { return list.IsSynchronized; }
- }
-
- public virtual Control this [int index] {
- get { return list [index] as Control; }
- }
-
- protected Control Owner {
- get { return owner; }
- }
-
- public object SyncRoot {
- get { return list.SyncRoot; }
- }
-
- public virtual void Add (Control child)
- {
- if (child == null)
- throw new ArgumentNullException ();
- if (IsReadOnly)
- throw new HttpException ();
-
- list.Add (child);
- owner.AddedControl (child, list.Count - 1);
- }
-
- public virtual void AddAt (int index, Control child)
- {
- if (child == null) // maybe we should check for ! (child is Control)?
- throw new ArgumentNullException ();
-
- if ((index < -1) || (index > Count))
- throw new ArgumentOutOfRangeException ();
-
- if (IsReadOnly)
- throw new HttpException ();
-
- if (index == -1){
- Add (child);
- } else {
- list [index] = child;
- owner.AddedControl (child, index);
- }
- }
-
- public virtual void Clear ()
- {
- list.Clear ();
- }
-
- public virtual bool Contains (Control c)
- {
- return list.Contains (c as object);
- }
-
- public void CopyTo (Array array, int index)
- {
- list.CopyTo (array, index);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
- public virtual int IndexOf (Control c)
- {
- return list.IndexOf (c as object);
- }
-
- public virtual void Remove (Control value)
- {
- list.Remove (value as object);
- }
-
- public virtual void RemoveAt (int index)
- {
- if (IsReadOnly)
- throw new HttpException ();
-
- list.RemoveAt (index);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs b/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs
deleted file mode 100755
index bcf88bbc436..00000000000
--- a/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Web.UI.CssStyleCollection.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI {
-
- public sealed class CssStyleCollection
- {
- Hashtable list = new Hashtable ();
-
- public int Count {
- get { return list.Count; }
- }
-
- public string this [string key] {
-
- get { return list [key] as string; }
-
- set { list [key] = value; }
- }
-
- public ICollection Keys {
- get { return list.Keys; }
- }
-
- public void Add (string key, string value)
- {
- list.Add (key, value);
- }
-
- public void Clear ()
- {
- list.Clear ();
- }
-
- public void Remove (string key)
- {
- list.Remove (key);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/DataBinder.cs b/mcs/class/System.Web/System.Web.UI/DataBinder.cs
deleted file mode 100755
index 37bb71adf51..00000000000
--- a/mcs/class/System.Web/System.Web.UI/DataBinder.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Web.UI.DataBinder.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc. (http://www.ximian.com)
-//
-
-using System;
-using System.Reflection;
-
-namespace System.Web.UI {
-
- public sealed class DataBinder
- {
- public DataBinder ()
- {
- }
-
- public static object Eval (object container, string expression)
- {
- return GetPropertyValue (container, expression);
- }
-
- public static string Eval (object container, string expression, string format)
- {
- return GetPropertyValue (container, expression, format);
- }
-
- [MonoTODO]
- public static object GetIndexedPropertyValue (object container, string expr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string GetIndexedPropertyValue (object container, string expr, string format)
- {
- throw new NotImplementedException ();
- }
-
- public static object GetPropertyValue (object container, string propName)
- {
- if (container == null || propName == null)
- throw new ArgumentException ();
-
- Type type = container.GetType ();
- PropertyInfo prop = type.GetProperty (propName);
- if (prop == null)
- throw new HttpException ("Property " + propName + " not found in " +
- type.ToString ());
- MethodInfo getm = prop.GetGetMethod ();
- if (getm == null)
- throw new HttpException ("Cannot find get accessor for " + propName +
- " in " + type.ToString ());
-
- return getm.Invoke (container, null);
- }
-
- public static string GetPropertyValue (object container, string propName, string format)
- {
- object result;
-
- result = GetPropertyValue (container, propName);
- if (result == null)
- return String.Empty;
-
- if (format == null)
- return result.ToString ();
-
- return String.Format (format, result);
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/DataBinding.cs b/mcs/class/System.Web/System.Web.UI/DataBinding.cs
deleted file mode 100755
index 4acf0b8a088..00000000000
--- a/mcs/class/System.Web/System.Web.UI/DataBinding.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Web.UI.DataBinding.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- public sealed class DataBinding
- {
- string propertyName;
- string propertyType;
- string expression;
-
- public DataBinding (string propertyName, string propertyType,
- string expression)
- {
- this.propertyName = propertyName;
- this.propertyType = propertyType;
- this.expression = expression;
- }
-
- public string Expression {
- get { return expression; }
- }
-
- public string PropertyName {
- get { return propertyName; }
- }
-
- public string PropertyType {
- get { return propertyType; }
- }
-
- public override bool Equals (object obj)
- {
- if (((DataBinding) obj).PropertyName == this.PropertyName)
- return true;
- else
- return false;
- }
-
- public override int GetHashCode ()
- {
- return propertyName.GetHashCode ();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/DataBindingCollection.cs b/mcs/class/System.Web/System.Web.UI/DataBindingCollection.cs
deleted file mode 100755
index 80e86454612..00000000000
--- a/mcs/class/System.Web/System.Web.UI/DataBindingCollection.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Web.UI.DataBindingCollection.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI {
-
- public sealed class DataBindingCollection : ICollection, IEnumerable
- {
- Hashtable list;
- ArrayList removed;
-
- public DataBindingCollection ()
- {
- list = new Hashtable ();
- removed = new ArrayList ();
- }
-
- public int Count {
- get { return list.Count; }
- }
-
- public bool IsReadOnly {
- get { return list.IsReadOnly; }
- }
-
- public bool IsSynchronized {
- get { return list.IsSynchronized; }
- }
-
- public DataBinding this [string propertyName] {
- get { return list [propertyName] as DataBinding; }
- }
-
- public string [] RemovedBindings {
- get { return (string []) removed.ToArray (typeof (string)); }
- }
-
- public object SyncRoot {
- get { return list.SyncRoot; }
- }
-
- public void Add (DataBinding binding)
- {
- list.Add (binding.PropertyName, binding);
- }
-
- public void Clear ()
- {
- list.Clear ();
- }
-
- public void CopyTo (Array array, int index)
- {
- list.CopyTo (array, index);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
- public void Remove (DataBinding binding)
- {
- string key = binding.PropertyName;
- Remove (key);
- }
-
- public void Remove (string propertyName)
- {
- removed.Add (propertyName);
- list.Remove (propertyName);
- }
-
- public void Remove (string propertyName,
- bool addToRemovedList)
- {
- if (addToRemovedList)
- removed.Add (String.Empty); // LAMESPEC
- else
- removed.Add (propertyName);
-
- list.Remove (propertyName);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs b/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs
deleted file mode 100644
index 65af373bc8c..00000000000
--- a/mcs/class/System.Web/System.Web.UI/DataBindingHandlerAttribute.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: DataBindingHandlerAttribute
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Reflection;
-
-namespace System.Web.UI
-{
- [AttributeUsage(AttributeTargets.Class)]
- public sealed class DataBindingHandlerAttribute : Attribute
- {
- public static readonly DataBindingHandlerAttribute Default;
-
- private string handlerTypeName;
-
- public DataBindingHandlerAttribute()
- {
- handlerTypeName = String.Empty;
- }
-
- public DataBindingHandlerAttribute(string typeName)
- {
- handlerTypeName = typeName;
- }
-
- public DataBindingHandlerAttribute(Type type)
- {
- handlerTypeName = type.AssemblyQualifiedName;
- }
-
- public string HandlerTypeName
- {
- get
- {
- return handlerTypeName;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs b/mcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs
deleted file mode 100755
index 0eae61eb1a2..00000000000
--- a/mcs/class/System.Web/System.Web.UI/DataBoundLiteralControl.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.Web.UI.DataBoundLiteralCOntrol.cs
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc. (http://www.ximian.com)
-//
-
-using System;
-using System.Text;
-
-namespace System.Web.UI {
-
- public sealed class DataBoundLiteralControl : Control
- {
- private string [] staticLiterals;
- private string [] dataBoundLiterals;
-
- public DataBoundLiteralControl (int staticLiteralsCount,
- int dataBoundLiteralCount)
- {
- staticLiterals = new string [staticLiteralsCount];
- dataBoundLiterals = new string [dataBoundLiteralCount];
- PreventAutoID ();
- }
-
- public string Text {
- get {
- StringBuilder text = new StringBuilder ();
- int stLength = staticLiterals.Length;
- int dbLength = dataBoundLiterals.Length;
- int max = (stLength > dbLength) ? stLength : dbLength;
- for (int i = 0; i < max; i++){
- if (i < stLength)
- text.Append (staticLiterals [i]);
- if (i < dbLength)
- text.Append (dataBoundLiterals [i]);
- }
-
- return text.ToString ();
- }
- }
-
- protected override ControlCollection CreateControlCollection ()
- {
- return new EmptyControlCollection (this);
- }
-
- [MonoTODO]
- protected override void LoadViewState (object savedState)
- {
- throw new NotImplementedException ();
- }
-
- protected override void Render (HtmlTextWriter output)
- {
- output.Write (Text);
- }
-
- [MonoTODO]
- protected override object SaveViewState ()
- {
- throw new NotImplementedException ();
- }
-
- public void SetDataBoundString (int index, string s)
- {
- dataBoundLiterals [index] = s;
- }
-
- public void SetStaticString (int index, string s)
- {
- staticLiterals [index] = s;
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs b/mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs
deleted file mode 100644
index 901e0c4cb91..00000000000
--- a/mcs/class/System.Web/System.Web.UI/DesignTimeParseData.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: DesignTimeParseData
- *
- * Author: Gaurav Vaish
- * Contact: <gvaish@iitk.ac.in>
- * Status: ?%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public sealed class DesignTimeParseData
- {
- private static bool inDesigner = false;
-
- internal static bool InDesigner
- {
- get
- {
- return inDesigner;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs b/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs
deleted file mode 100755
index 3bf0ec4f731..00000000000
--- a/mcs/class/System.Web/System.Web.UI/EmptyControlCollection.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Web.UI.EmptyControlCollection.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- public class EmptyControlCollection : ControlCollection
- {
- public EmptyControlCollection (Control owner)
- : base (owner)
- {
- }
-
- public override void Add (Control child)
- {
- throw new HttpException ();
- }
-
- public override void AddAt (int index, Control child)
- {
- throw new HttpException ();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
deleted file mode 100644
index f78cffc1b6b..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriter.cs
+++ /dev/null
@@ -1,1027 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI{
-
-public class HtmlTextWriter : System.IO.TextWriter {
-
-static HtmlTextWriter(){
- HtmlTextWriter._tagKeyLookupTable = new Hashtable(97);
- HtmlTextWriter._tagNameLookupArray = new TagInformation[97];
- HtmlTextWriter.RegisterTag("", HtmlTextWriterTag.Unknown, TagType.Other);
- HtmlTextWriter.RegisterTag("a", HtmlTextWriterTag.A, TagType.Inline);
- HtmlTextWriter.RegisterTag("acronym", HtmlTextWriterTag.Acronym, TagType.Inline);
- HtmlTextWriter.RegisterTag("address", HtmlTextWriterTag.Address, TagType.Other);
- HtmlTextWriter.RegisterTag("area", HtmlTextWriterTag.Area, TagType.Other);
- HtmlTextWriter.RegisterTag("b", HtmlTextWriterTag.B, TagType.Inline);
- HtmlTextWriter.RegisterTag("base", HtmlTextWriterTag.Base, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("basefont", HtmlTextWriterTag.Basefont, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("bdo", HtmlTextWriterTag.Bdo, TagType.Inline);
- HtmlTextWriter.RegisterTag("bgsound", HtmlTextWriterTag.Bgsound, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("big", HtmlTextWriterTag.Big, TagType.Inline);
- HtmlTextWriter.RegisterTag("blockquote", HtmlTextWriterTag.Blockquote, TagType.Other);
- HtmlTextWriter.RegisterTag("body", HtmlTextWriterTag.Body, TagType.Other);
- HtmlTextWriter.RegisterTag("br", HtmlTextWriterTag.Br, TagType.Other);
- HtmlTextWriter.RegisterTag("button", HtmlTextWriterTag.Button, TagType.Inline);
- HtmlTextWriter.RegisterTag("caption", HtmlTextWriterTag.Caption, TagType.Other);
- HtmlTextWriter.RegisterTag("center", HtmlTextWriterTag.Center, TagType.Other);
- HtmlTextWriter.RegisterTag("cite", HtmlTextWriterTag.Cite, TagType.Inline);
- HtmlTextWriter.RegisterTag("code", HtmlTextWriterTag.Code, TagType.Inline);
- HtmlTextWriter.RegisterTag("col", HtmlTextWriterTag.Col, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("colgroup", HtmlTextWriterTag.Colgroup, TagType.Other);
- HtmlTextWriter.RegisterTag("del", HtmlTextWriterTag.Del, TagType.Inline);
- HtmlTextWriter.RegisterTag("dd", HtmlTextWriterTag.Dd, TagType.Inline);
- HtmlTextWriter.RegisterTag("dfn", HtmlTextWriterTag.Dfn, TagType.Inline);
- HtmlTextWriter.RegisterTag("dir", HtmlTextWriterTag.Dir, TagType.Other);
- HtmlTextWriter.RegisterTag("div", HtmlTextWriterTag.Div, TagType.Other);
- HtmlTextWriter.RegisterTag("dl", HtmlTextWriterTag.Dl, TagType.Other);
- HtmlTextWriter.RegisterTag("dt", HtmlTextWriterTag.Dt, TagType.Inline);
- HtmlTextWriter.RegisterTag("em", HtmlTextWriterTag.Em, TagType.Inline);
- HtmlTextWriter.RegisterTag("embed", HtmlTextWriterTag.Embed, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("fieldset", HtmlTextWriterTag.Fieldset, TagType.Other);
- HtmlTextWriter.RegisterTag("font", HtmlTextWriterTag.Font, TagType.Inline);
- HtmlTextWriter.RegisterTag("form", HtmlTextWriterTag.Form, TagType.Other);
- HtmlTextWriter.RegisterTag("frame", HtmlTextWriterTag.Frame, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("frameset", HtmlTextWriterTag.Frameset, TagType.Other);
- HtmlTextWriter.RegisterTag("h1", HtmlTextWriterTag.H1, TagType.Other);
- HtmlTextWriter.RegisterTag("h2", HtmlTextWriterTag.H2, TagType.Other);
- HtmlTextWriter.RegisterTag("h3", HtmlTextWriterTag.H3, TagType.Other);
- HtmlTextWriter.RegisterTag("h4", HtmlTextWriterTag.H4, TagType.Other);
- HtmlTextWriter.RegisterTag("h5", HtmlTextWriterTag.H5, TagType.Other);
- HtmlTextWriter.RegisterTag("h6", HtmlTextWriterTag.H6, TagType.Other);
- HtmlTextWriter.RegisterTag("head", HtmlTextWriterTag.Head, TagType.Other);
- HtmlTextWriter.RegisterTag("hr", HtmlTextWriterTag.Hr, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("html", HtmlTextWriterTag.Html, TagType.Other);
- HtmlTextWriter.RegisterTag("i", HtmlTextWriterTag.I, TagType.Inline);
- HtmlTextWriter.RegisterTag("iframe", HtmlTextWriterTag.Iframe, TagType.Other);
- HtmlTextWriter.RegisterTag("img", HtmlTextWriterTag.Img, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("input", HtmlTextWriterTag.Input, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("ins", HtmlTextWriterTag.Ins, TagType.Inline);
- HtmlTextWriter.RegisterTag("isindex", HtmlTextWriterTag.Isindex, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("kbd", HtmlTextWriterTag.Kbd, TagType.Inline);
- HtmlTextWriter.RegisterTag("label", HtmlTextWriterTag.Label, TagType.Inline);
- HtmlTextWriter.RegisterTag("legend", HtmlTextWriterTag.Legend, TagType.Other);
- HtmlTextWriter.RegisterTag("li", HtmlTextWriterTag.Li, TagType.Inline);
- HtmlTextWriter.RegisterTag("link", HtmlTextWriterTag.Link, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("map", HtmlTextWriterTag.Map, TagType.Other);
- HtmlTextWriter.RegisterTag("marquee", HtmlTextWriterTag.Marquee, TagType.Other);
- HtmlTextWriter.RegisterTag("menu", HtmlTextWriterTag.Menu, TagType.Other);
- HtmlTextWriter.RegisterTag("meta", HtmlTextWriterTag.Meta, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("nobr", HtmlTextWriterTag.Nobr, TagType.Inline);
- HtmlTextWriter.RegisterTag("noframes", HtmlTextWriterTag.Noframes, TagType.Other);
- HtmlTextWriter.RegisterTag("noscript", HtmlTextWriterTag.Noscript, TagType.Other);
- HtmlTextWriter.RegisterTag("object", HtmlTextWriterTag.Object, TagType.Other);
- HtmlTextWriter.RegisterTag("ol", HtmlTextWriterTag.Ol, TagType.Other);
- HtmlTextWriter.RegisterTag("option", HtmlTextWriterTag.Option, TagType.Other);
- HtmlTextWriter.RegisterTag("p", HtmlTextWriterTag.P, TagType.Inline);
- HtmlTextWriter.RegisterTag("param", HtmlTextWriterTag.Param, TagType.Other);
- HtmlTextWriter.RegisterTag("pre", HtmlTextWriterTag.Pre, TagType.Other);
- HtmlTextWriter.RegisterTag("q", HtmlTextWriterTag.Q, TagType.Inline);
- HtmlTextWriter.RegisterTag("rt", HtmlTextWriterTag.Rt, TagType.Other);
- HtmlTextWriter.RegisterTag("ruby", HtmlTextWriterTag.Ruby, TagType.Other);
- HtmlTextWriter.RegisterTag("s", HtmlTextWriterTag.S, TagType.Inline);
- HtmlTextWriter.RegisterTag("samp", HtmlTextWriterTag.Samp, TagType.Inline);
- HtmlTextWriter.RegisterTag("script", HtmlTextWriterTag.Script, TagType.Other);
- HtmlTextWriter.RegisterTag("select", HtmlTextWriterTag.Select, TagType.Other);
- HtmlTextWriter.RegisterTag("small", HtmlTextWriterTag.Small, TagType.Other);
- HtmlTextWriter.RegisterTag("span", HtmlTextWriterTag.Span, TagType.Inline);
- HtmlTextWriter.RegisterTag("strike", HtmlTextWriterTag.Strike, TagType.Inline);
- HtmlTextWriter.RegisterTag("strong", HtmlTextWriterTag.Strong, TagType.Inline);
- HtmlTextWriter.RegisterTag("style", HtmlTextWriterTag.Style, TagType.Other);
- HtmlTextWriter.RegisterTag("sub", HtmlTextWriterTag.Sub, TagType.Inline);
- HtmlTextWriter.RegisterTag("sup", HtmlTextWriterTag.Sup, TagType.Inline);
- HtmlTextWriter.RegisterTag("table", HtmlTextWriterTag.Table, TagType.Other);
- HtmlTextWriter.RegisterTag("tbody", HtmlTextWriterTag.Tbody, TagType.Other);
- HtmlTextWriter.RegisterTag("td", HtmlTextWriterTag.Td, TagType.Inline);
- HtmlTextWriter.RegisterTag("textarea", HtmlTextWriterTag.Textarea, TagType.Inline);
- HtmlTextWriter.RegisterTag("tfoot", HtmlTextWriterTag.Tfoot, TagType.Other);
- HtmlTextWriter.RegisterTag("th", HtmlTextWriterTag.Th, TagType.Inline);
- HtmlTextWriter.RegisterTag("thead", HtmlTextWriterTag.Thead, TagType.Other);
- HtmlTextWriter.RegisterTag("title", HtmlTextWriterTag.Title, TagType.Other);
- HtmlTextWriter.RegisterTag("tr", HtmlTextWriterTag.Tr, TagType.Other);
- HtmlTextWriter.RegisterTag("tt", HtmlTextWriterTag.Tt, TagType.Inline);
- HtmlTextWriter.RegisterTag("u", HtmlTextWriterTag.U, TagType.Inline);
- HtmlTextWriter.RegisterTag("ul", HtmlTextWriterTag.Ul, TagType.Other);
- HtmlTextWriter.RegisterTag("var", HtmlTextWriterTag.Var, TagType.Inline);
- HtmlTextWriter.RegisterTag("wbr", HtmlTextWriterTag.Wbr, TagType.NonClosing);
- HtmlTextWriter.RegisterTag("xml", HtmlTextWriterTag.Xml, TagType.Other);
-
- HtmlTextWriter._attrKeyLookupTable = new Hashtable(40);
- HtmlTextWriter._attrNameLookupArray = new AttributeInformation[40];
- HtmlTextWriter.RegisterAttribute("accesskey", HtmlTextWriterAttribute.Accesskey, true);
- HtmlTextWriter.RegisterAttribute("align", HtmlTextWriterAttribute.Align, false);
- HtmlTextWriter.RegisterAttribute("alt", HtmlTextWriterAttribute.Alt, true);
- HtmlTextWriter.RegisterAttribute("background", HtmlTextWriterAttribute.Background, true);
- HtmlTextWriter.RegisterAttribute("bgcolor", HtmlTextWriterAttribute.Bgcolor, false);
- HtmlTextWriter.RegisterAttribute("border", HtmlTextWriterAttribute.Border, false);
- HtmlTextWriter.RegisterAttribute("bordercolor", HtmlTextWriterAttribute.Bordercolor, false);
- HtmlTextWriter.RegisterAttribute("cellpadding", HtmlTextWriterAttribute.Cellpadding, false);
- HtmlTextWriter.RegisterAttribute("cellspacing", HtmlTextWriterAttribute.Cellspacing, false);
- HtmlTextWriter.RegisterAttribute("checked", HtmlTextWriterAttribute.Checked, false);
- HtmlTextWriter.RegisterAttribute("class", HtmlTextWriterAttribute.Class, true);
- HtmlTextWriter.RegisterAttribute("cols", HtmlTextWriterAttribute.Cols, false);
- HtmlTextWriter.RegisterAttribute("colspan", HtmlTextWriterAttribute.Colspan, false);
- HtmlTextWriter.RegisterAttribute("disabled", HtmlTextWriterAttribute.Disabled, false);
- HtmlTextWriter.RegisterAttribute("for", HtmlTextWriterAttribute.For, false);
- HtmlTextWriter.RegisterAttribute("height", HtmlTextWriterAttribute.Height, false);
- HtmlTextWriter.RegisterAttribute("href", HtmlTextWriterAttribute.Href, true);
- HtmlTextWriter.RegisterAttribute("id", HtmlTextWriterAttribute.Id, false);
- HtmlTextWriter.RegisterAttribute("maxlength", HtmlTextWriterAttribute.Maxlength, false);
- HtmlTextWriter.RegisterAttribute("multiple", HtmlTextWriterAttribute.Multiple, false);
- HtmlTextWriter.RegisterAttribute("name", HtmlTextWriterAttribute.Name, false);
- HtmlTextWriter.RegisterAttribute("nowrap", HtmlTextWriterAttribute.Nowrap, false);
- HtmlTextWriter.RegisterAttribute("onchange", HtmlTextWriterAttribute.Onchange, true);
- HtmlTextWriter.RegisterAttribute("onclick", HtmlTextWriterAttribute.Onclick, true);
- HtmlTextWriter.RegisterAttribute("readonly", HtmlTextWriterAttribute.ReadOnly, false);
- HtmlTextWriter.RegisterAttribute("rows", HtmlTextWriterAttribute.Rows, false);
- HtmlTextWriter.RegisterAttribute("rowspan", HtmlTextWriterAttribute.Rowspan, false);
- HtmlTextWriter.RegisterAttribute("rules", HtmlTextWriterAttribute.Rules, false);
- HtmlTextWriter.RegisterAttribute("selected", HtmlTextWriterAttribute.Selected, false);
- HtmlTextWriter.RegisterAttribute("size", HtmlTextWriterAttribute.Size, false);
- HtmlTextWriter.RegisterAttribute("src", HtmlTextWriterAttribute.Src, true);
- HtmlTextWriter.RegisterAttribute("style", HtmlTextWriterAttribute.Style, false);
- HtmlTextWriter.RegisterAttribute("tabindex", HtmlTextWriterAttribute.Tabindex, false);
- HtmlTextWriter.RegisterAttribute("target", HtmlTextWriterAttribute.Target, false);
- HtmlTextWriter.RegisterAttribute("title", HtmlTextWriterAttribute.Title, true);
- HtmlTextWriter.RegisterAttribute("type", HtmlTextWriterAttribute.Type, false);
- HtmlTextWriter.RegisterAttribute("valign", HtmlTextWriterAttribute.Valign, false);
- HtmlTextWriter.RegisterAttribute("value", HtmlTextWriterAttribute.Value, true);
- HtmlTextWriter.RegisterAttribute("width", HtmlTextWriterAttribute.Width, false);
- HtmlTextWriter.RegisterAttribute("wrap", HtmlTextWriterAttribute.Wrap, false);
-
- HtmlTextWriter._styleKeyLookupTable = new Hashtable(14);
- HtmlTextWriter._styleNameLookupArray = new String[14];
- HtmlTextWriter.RegisterStyle("background-color", HtmlTextWriterStyle.BackgroundColor);
- HtmlTextWriter.RegisterStyle("background-image", HtmlTextWriterStyle.BackgroundImage);
- HtmlTextWriter.RegisterStyle("border-collapse", HtmlTextWriterStyle.BorderCollapse);
- HtmlTextWriter.RegisterStyle("border-color", HtmlTextWriterStyle.BorderColor);
- HtmlTextWriter.RegisterStyle("border-style", HtmlTextWriterStyle.BorderStyle);
- HtmlTextWriter.RegisterStyle("border-width", HtmlTextWriterStyle.BorderWidth);
- HtmlTextWriter.RegisterStyle("color", HtmlTextWriterStyle.Color);
- HtmlTextWriter.RegisterStyle("font-family", HtmlTextWriterStyle.FontFamily);
- HtmlTextWriter.RegisterStyle("font-size", HtmlTextWriterStyle.FontSize);
- HtmlTextWriter.RegisterStyle("font-style", HtmlTextWriterStyle.FontStyle);
- HtmlTextWriter.RegisterStyle("font-weight", HtmlTextWriterStyle.FontWeight);
- HtmlTextWriter.RegisterStyle("height", HtmlTextWriterStyle.Height);
- HtmlTextWriter.RegisterStyle("text-decoration", HtmlTextWriterStyle.TextDecoration);
- HtmlTextWriter.RegisterStyle("width", HtmlTextWriterStyle.Width);
-}
-
-public HtmlTextWriter(TextWriter writer):this(writer, " "){}
-
-public HtmlTextWriter(TextWriter writer, string tabString) : base() {
- this.writer = writer;
- this.tabString = tabString;
- indentLevel = 0;
- tabsPending = false;
- _httpWriter = writer as HttpWriter;
- _isDescendant = GetType() == typeof(HtmlTextWriter) == false;
- _attrList = new RenderAttribute[20];
- _attrCount = 0;
- _styleList = new RenderStyle[20];
- _styleCount = 0;
- _endTags = new TagStackEntry[16];
- _endTagCount = 0;
- _inlineCount = 0;
-}
-
-public virtual void AddAttribute(HtmlTextWriterAttribute key, string value){
- if ((int) key >= 0 && (int) key < HtmlTextWriter._attrNameLookupArray.Length) {
- AttributeInformation attrInfo = HtmlTextWriter._attrNameLookupArray[(int) key];
- AddAttribute(attrInfo.name, value, key, attrInfo.encode);
- }
-}
-
-public virtual void AddAttribute(HtmlTextWriterAttribute key, string value, bool fEncode){
- if ((int) key >= 0 && (int) key < HtmlTextWriter._attrNameLookupArray.Length) {
- AddAttribute(HtmlTextWriter._attrNameLookupArray[(int) key].name, value, key, fEncode);
- }
-}
-
-public virtual void AddAttribute(string name, string value){
- HtmlTextWriterAttribute attr = GetAttributeKey(name);
- value = EncodeAttributeValue(GetAttributeKey(name), value);
- AddAttribute(name, value, attr);
-}
-
-public virtual void AddAttribute(string name, string value, bool fEndode){
- value = EncodeAttributeValue(value, fEndode);
- AddAttribute(name, value, GetAttributeKey(name));
-}
-
-protected virtual void AddAttribute(string name, string value, HtmlTextWriterAttribute key){
- AddAttribute(name, value, key, false);
-}
-
-private void AddAttribute(string name, string value, HtmlTextWriterAttribute key, bool encode){
- if (_attrCount >= (int) _attrList.Length) {
- RenderAttribute[] rAttrArr = new RenderAttribute[_attrList.Length * 2];
- System.Array.Copy(_attrList, rAttrArr, (int) _attrList.Length);
- _attrList = rAttrArr;
- }
- RenderAttribute rAttr;
- rAttr.name = name;
- rAttr.value = value;
- rAttr.key = key;
- rAttr.encode = encode;
- _attrList [_attrCount++] = rAttr;
-}
-
-public virtual void AddStyleAttribute(HtmlTextWriterStyle key, string value){
- AddStyleAttribute(GetStyleName(key), value, key);
-}
-
-public virtual void AddStyleAttribute(string name, string value){
- AddStyleAttribute(name, value, GetStyleKey(name));
-}
-
-protected virtual void AddStyleAttribute(string name, string value, HtmlTextWriterStyle key){
- RenderStyle[] tagRender;
- RenderStyle beforeTag;
-
- if (_styleCount >= (int) _styleList.Length) {
- RenderStyle[] rAttrArr = new RenderStyle[_styleList.Length * 2];
- System.Array.Copy(_styleList, rAttrArr, (int) _styleList.Length);
- _styleList = rAttrArr;
- }
- RenderStyle rAttr;
- rAttr.name = name;
- rAttr.value = value;
- rAttr.key = key;
- _styleList [_styleCount++] = rAttr;
-}
-
-public override void Close(){
- writer.Close();
-}
-
-protected virtual string EncodeAttributeValue(HtmlTextWriterAttribute attrKey, string value){
- bool valid = true;
- if (0 <= (int) attrKey && (int) attrKey < HtmlTextWriter._attrNameLookupArray.Length)
- valid = HtmlTextWriter._attrNameLookupArray[(int) attrKey].encode;
- return EncodeAttributeValue(value, valid);
-}
-
-protected string EncodeAttributeValue(string value, bool fEncode){
- if (value == null)
- return null;
- if (!(fEncode))
- return value;
- return System.Web.HttpUtility.HtmlAttributeEncode(value);
-}
-
-protected string EncodeUrl(string url){
- if (url.IndexOf(SpaceChar) < 0)
- return url;
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- for(int i=0; i <= url.Length; i++){
- char temp = url[i];
- if (temp != 32)
- sb.Append(temp);
- else
- sb.Append("%20");
- }
- return sb.ToString();
-}
-
-protected virtual void FilterAttributes(){
- int count = 0;
- for(int i=0; i < _styleCount; i++){
- RenderStyle rStyle = _styleList[i];
- if (OnStyleAttributeRender(rStyle.name, rStyle.value, rStyle.key)) {
- count++;
- }
- }
- _styleCount = count;
- count = 0;
- for(int i=0; i <= _attrCount; i++){
- RenderAttribute rAttr = _attrList[i];
- if (OnAttributeRender(rAttr.name, rAttr.value, rAttr.key)) {
- count++;
- }
- }
- _attrCount = count;
-}
-
-public override void Flush(){
- writer.Flush();
-}
-
-protected HtmlTextWriterAttribute GetAttributeKey(string attrName){
- if (attrName != null && attrName.Length > 0) {
- object attr = HtmlTextWriter._attrKeyLookupTable[attrName.ToLower()];
- if (attr != null)
- return (HtmlTextWriterAttribute) attr;
- }
- return (HtmlTextWriterAttribute) (-1);
-}
-
-protected string GetAttributeName(HtmlTextWriterAttribute attrKey){
- if ((int) attrKey >= 0 && (int) attrKey < HtmlTextWriter._attrNameLookupArray.Length)
- return HtmlTextWriter._attrNameLookupArray[(int) attrKey].name;
- return System.String.Empty;
-}
-
-protected HtmlTextWriterStyle GetStyleKey(string styleName){
- if (styleName != null && styleName.Length > 0) {
- object style = HtmlTextWriter._styleKeyLookupTable[styleName.ToLower()];
- if (style != null)
- return (HtmlTextWriterStyle) style;
- }
- return (HtmlTextWriterStyle) (-1);
-}
-
-protected string GetStyleName(HtmlTextWriterStyle styleKey){
- if ((int) styleKey >= 0 && (int) styleKey < HtmlTextWriter._styleNameLookupArray.Length)
- return HtmlTextWriter._styleNameLookupArray[(int) styleKey];
- return System.String.Empty;
-}
-
-protected virtual HtmlTextWriterTag GetTagKey(string tagName){
- if (tagName != null && tagName.Length > 0) {
- object tag = HtmlTextWriter._tagKeyLookupTable[tagName.ToLower()];
- if (tag != null)
- return (HtmlTextWriterTag) tag;
- }
- return 0;
-}
-
-protected virtual string GetTagName(HtmlTextWriterTag tagKey){
- if ((int) tagKey >= 0 && (int) tagKey < HtmlTextWriter._tagNameLookupArray.Length)
- return HtmlTextWriter._tagNameLookupArray[(int) tagKey].name;
- return System.String.Empty;
-}
-
-protected bool IsAttributeDefined(HtmlTextWriterAttribute key){
- for (int i=0; i < _attrCount; i++) {
- if (_attrList[i].key == key)
- return true;
- }
- return false;
-}
-
-protected bool IsAttributeDefined(HtmlTextWriterAttribute key, ref string value){
- value = null;
- for (int i=0; i < _attrCount; i++) {
- if (_attrList[i].key == key) {
- value = _attrList[i].value;
- return true;
- }
- }
- return false;
-}
-
-protected bool IsStyleAttributeDefined(HtmlTextWriterStyle key){
- for (int i= 0; i < _styleCount; i++) {
- if (_styleList[i].key == key)
- return true;
- }
- return false;
-}
-
-protected bool IsStyleAttributeDefined(HtmlTextWriterStyle key, ref string value){
- value = null;
- for( int i=0; i < _styleCount; i++) {
- if (_styleList[i].key == key) {
- value = _styleList[i].value;
- return true;
- }
- }
- return false;
-}
-
-protected virtual bool OnAttributeRender(string name, string value, HtmlTextWriterAttribute key){
- return true;
-}
-
-protected virtual bool OnStyleAttributeRender(string name, string value, HtmlTextWriterStyle key){
- return true;
-}
-
-protected virtual bool OnTagRender(string name, HtmlTextWriterTag key){
- return true;
-}
-
-protected virtual void OutputTabs(){
- if (tabsPending) {
- for(int i=0; i <= indentLevel; i++) {
- writer.Write(tabString);
- }
- tabsPending = false;
- }
-}
-
-protected string PopEndTag(){
- if (_endTagCount <= 0)
- throw new InvalidOperationException("A PopEndTag was called without a corresponding PushEndTag");
- _endTagCount--;
- TagKey = _endTags[_endTagCount].tagKey;
- return _endTags[_endTagCount].endTagText;
-}
-
-protected void PushEndTag(string endTag){
- if (_endTagCount >= (int) _endTags.Length) {
- TagStackEntry[] temp = new TagStackEntry[(int) _endTags.Length * 2];
- System.Array.Copy(_endTags, temp, (int) _endTags.Length);
- _endTags = temp;
- }
- _endTags[_endTagCount].tagKey = _tagKey;
- _endTags[_endTagCount].endTagText = endTag;
- _endTagCount++;
-}
-
-protected static void RegisterAttribute(string name, HtmlTextWriterAttribute key){
- HtmlTextWriter.RegisterAttribute(name, key, false);
-}
-
-private static void RegisterAttribute(string name, HtmlTextWriterAttribute key, bool fEncode){
- name = name.ToLower();
- HtmlTextWriter._attrKeyLookupTable.Add(name, key);
- if ((int) key < (int) HtmlTextWriter._attrNameLookupArray.Length)
- HtmlTextWriter._attrNameLookupArray[(int) key] = new AttributeInformation(name, fEncode);
-}
-
-protected static void RegisterStyle(string name, HtmlTextWriterStyle key){
- name = name.ToLower();
- HtmlTextWriter._styleKeyLookupTable.Add(name, key);
- if ((int) key < (int) HtmlTextWriter._styleNameLookupArray.Length)
- HtmlTextWriter._styleNameLookupArray[(int) key] = name;
-}
-
-protected static void RegisterTag(string name, HtmlTextWriterTag key){
- HtmlTextWriter.RegisterTag(name, key, TagType.Other);
-}
-
-private static void RegisterTag(string name, HtmlTextWriterTag key, TagType type){
- name = name.ToLower();
- HtmlTextWriter._tagKeyLookupTable.Add(name, key);
- string fullTag = null;
- if ((int) type != 1 && (int) key != 0) {
- fullTag = EndTagLeftChars + name + TagRightChar;
- }
- if ((int) key < HtmlTextWriter._tagNameLookupArray.Length)
- HtmlTextWriter._tagNameLookupArray[(int) key] = new TagInformation(name, type, fullTag);
-}
-
-protected virtual string RenderAfterContent(){
- return null;
-}
-
-protected virtual string RenderAfterTag(){
- return null;
-}
-
-protected virtual string RenderBeforeContent(){
- return null;
-}
-
-protected virtual string RenderBeforeTag(){
- return null;
-}
-
-public virtual void RenderBeginTag(HtmlTextWriterTag tagKey){
- TagKey = tagKey;
- bool tagRendered = true;
- bool tagRender = true;
- if (_isDescendant) {
- tagRender = OnTagRender(_tagName, _tagKey);
- FilterAttributes();
- string beforeTag = RenderBeforeTag();
- if (beforeTag != null) {
- if (tabsPending)
- OutputTabs();
- writer.Write(beforeTag);
- }
- }
- TagInformation currentTag = HtmlTextWriter._tagNameLookupArray[_tagIndex];
- if (tagRender) {
- tagRendered = false;
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(_tagName);
- RenderAttribute rAttr;
- string rAttrValue = null;
- for (int i=0; i < _attrCount; i++) {
- rAttr = _attrList[i];
- if (rAttr.key == HtmlTextWriterAttribute.Style)
- rAttrValue = rAttr.value;
- else {
- writer.Write(SpaceChar);
- writer.Write(rAttr.name);
- if (rAttr.value != null) {
- writer.Write(EqualsChar);
- writer.Write(DoubleQuoteChar);
- if (rAttr.encode) {
- if (_httpWriter == null) {
- System.Web.HttpUtility.HtmlAttributeEncode(rAttr.value, writer);
- }
- else {
- System.Web.HttpUtility.HtmlAttributeEncode(rAttr.value, (TextWriter) _httpWriter);
- }
- }
- else {
- writer.Write(rAttr.value);
- }
- writer.Write(DoubleQuoteChar);
- }
- }
- }
- if (_styleCount > 0 || rAttrValue != null) {
- writer.Write(SpaceChar);
- writer.Write("style");
- writer.Write(EqualsChar);
- writer.Write(DoubleQuoteChar);
- RenderStyle rStyle;
- for (int i=0; i < _styleCount; i++) {
- rStyle = _styleList[i];
- writer.Write(rStyle.name);
- writer.Write(StyleEqualsChar);
- writer.Write(rStyle.value);
- writer.Write(SemicolonChar);
- }
- if (rAttrValue != null)
- writer.Write(rAttrValue);
- writer.Write(DoubleQuoteChar);
- }
- if (currentTag.tagType == TagType.NonClosing) {
- writer.Write(SpaceChar);
- writer.Write(SlashChar);
- writer.Write(TagRightChar);
- }
- else
- writer.Write(TagRightChar);
- }
- string beforeContent = RenderBeforeContent();
- if (beforeContent != null) {
- if (tabsPending)
- OutputTabs();
- writer.Write(beforeContent);
- }
- if (tagRendered) {
- if (currentTag.tagType == TagType.Inline)
- _inlineCount++;
- else {
- WriteLine();
- Indent++;
- }
- if (currentTag.closingTag == null) {
- currentTag.closingTag = EndTagLeftChars + _tagName + TagRightChar;
- }
- }
- if (_isDescendant) {
- string afterContent = RenderAfterContent();
- if (afterContent != null) {
- if (currentTag.closingTag != null)
- currentTag.closingTag = afterContent;
- }
- string afterTag = RenderAfterTag();
- if (afterTag != null) {
- if (currentTag.closingTag != null)
- currentTag.closingTag = afterTag;
- }
- }
- PushEndTag(currentTag.closingTag);
- _attrCount = 0;
- _styleCount = 0;
-}
-
-public virtual void RenderBeginTag(string tagName){
- TagName = tagName;
- RenderBeginTag(_tagKey);
-}
-
-public virtual void RenderEndTag(){
- string endTagText = PopEndTag();
- if (endTagText != null) {
- if (HtmlTextWriter._tagNameLookupArray[_tagIndex].tagType == 0) {
- _inlineCount--;
- Write(endTagText);
- }
- else{
- WriteLine();
- Indent--;
- Write(endTagText);
- }
- }
-}
-
-public override void Write(bool value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(char value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(char[] buffer){
- if (tabsPending)
- OutputTabs();
- writer.Write(buffer);
-}
-
-public override void Write(char[] buffer, int index, int count){
- if (tabsPending)
- OutputTabs();
- writer.Write(buffer, index, count);
-}
-
-public override void Write(double value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(int value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(long value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(object value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(float value){
- if (tabsPending)
- OutputTabs();
- writer.Write(value);
-}
-
-public override void Write(string s){
- if (tabsPending)
- OutputTabs();
- writer.Write(s);
-}
-
-public override void Write(string format, object arg0){
- if (tabsPending)
- OutputTabs();
- writer.Write(format, arg0);
-}
-
-public override void Write(string format, object arg0, object arg1){
- if (tabsPending)
- OutputTabs();
- writer.Write(format, arg0, arg1);
-}
-
-public override void Write(string format, params object[] arg){
- if (tabsPending)
- OutputTabs();
- writer.Write(format, arg);
-}
-
-public virtual void WriteAttribute(string name, string value){
- WriteAttribute(name, value, false);
-}
-
-public virtual void WriteAttribute(string name, string value, bool fEncode){
- writer.Write(SpaceChar);
- writer.Write(name);
- if (value != null) {
- writer.Write(EqualsChar);
- writer.Write(DoubleQuoteChar);
- if (fEncode) {
- if (_httpWriter == null) {
- System.Web.HttpUtility.HtmlAttributeEncode(value, writer);
- }
- else{
- System.Web.HttpUtility.HtmlAttributeEncode(value, (TextWriter) _httpWriter);
- }
- }
- else{
- writer.Write(value);
- }
- writer.Write(DoubleQuoteChar);
- }
-}
-
-public virtual void WriteBeginTag(string tagName){
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(tagName);
-}
-
-public virtual void WriteEndTag(string tagName){
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(SlashChar);
- writer.Write(tagName);
- writer.Write(TagRightChar);
-}
-
-public virtual void WriteFullBeginTag(string tagName){
- if (tabsPending)
- OutputTabs();
- writer.Write(TagLeftChar);
- writer.Write(tagName);
- writer.Write(TagRightChar);
-}
-
-public override void WriteLine(){
- writer.WriteLine();
- tabsPending = true;
-}
-
-public override void WriteLine(bool value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(char value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(char[] buffer){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(buffer);
- tabsPending = true;
-}
-
-public override void WriteLine(char[] buffer, int index, int count){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(buffer, index, count);
- tabsPending = true;
-}
-
-public override void WriteLine(double value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(int value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(long value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(object value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(float value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public override void WriteLine(string s){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(s);
- tabsPending = true;
-}
-
-public override void WriteLine(string format, object arg0){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(format, arg0);
- tabsPending = true;
-}
-
-public override void WriteLine(string format, object arg0, object arg1){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(format, arg0, arg1);
- tabsPending = true;
-}
-
-public override void WriteLine(string format, params object[] arg){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(format, arg);
- tabsPending = true;
-}
-
-[CLSCompliant(false)]
-public override void WriteLine(uint value){
- if (tabsPending)
- OutputTabs();
- writer.WriteLine(value);
- tabsPending = true;
-}
-
-public void WriteLineNoTabs(string s){
- writer.WriteLine(s);
-}
-
-public virtual void WriteStyleAttribute(string name, string value){
- WriteStyleAttribute(name, value, false);
-}
-
-public virtual void WriteStyleAttribute(string name, string value, bool fEncode){
- writer.Write(name);
- writer.Write(StyleEqualsChar);
- if (fEncode) {
- if (_httpWriter == null) {
- System.Web.HttpUtility.HtmlAttributeEncode(value, writer);
- }
- else{
- System.Web.HttpUtility.HtmlAttributeEncode(value, (TextWriter) _httpWriter);
- }
- }
- else {
- writer.Write(value);
- }
- writer.Write(SemicolonChar);
-}
-
-public override System.Text.Encoding Encoding {
- get{
- return writer.Encoding;
- }
-}
-
-public int Indent {
- get{
- return indentLevel;
- }
- set{
- if (value < 0)
- value = 0;
- indentLevel = value;
- }
-}
-
-public TextWriter InnerWriter {
- get{
- return writer;
- }
- set{
- writer = value;
- _httpWriter = value as HttpWriter;
- }
-}
-
-public override string NewLine {
- get{
- return writer.NewLine;
- }
- set{
- writer.NewLine = value;
- }
-}
-
-protected HtmlTextWriterTag TagKey {
- get{
- return _tagKey;
- }
- set{
- _tagIndex = (int) value;
- if (_tagIndex < 0 || _tagIndex >= (int) HtmlTextWriter._tagNameLookupArray.Length)
- throw new ArgumentOutOfRangeException("value");
- _tagKey = value;
- if (value != 0)
- _tagName = HtmlTextWriter._tagNameLookupArray[_tagIndex].name;
- }
-}
-
-protected string TagName {
- get{
- return _tagName;
- }
- set{
- _tagName = value;
- _tagKey = GetTagKey(_tagName);
- _tagIndex = (int) _tagKey;
- }
-}
-
-public const string DefaultTabString = "\t";
-public const char DoubleQuoteChar = '"';
-public const string EndTagLeftChars = "</";
-public const char EqualsChar = '=';
-public const string EqualsDoubleQuoteString = "=\"";
-public const string SelfClosingChars = " /";
-public const string SelfClosingTagEnd = " />";
-public const char SemicolonChar = ';';
-public const char SingleQuoteChar = '\'';
-public const char SlashChar = '/';
-public const char SpaceChar = ' ';
-public const char StyleEqualsChar = ':';
-public const char TagLeftChar = '<';
-public const char TagRightChar = '>';
-
-private int _attrCount;
-private int _endTagCount;
-private int _styleCount;
-private int indentLevel;
-private int _inlineCount;
-private int _tagIndex;
-
-private bool _isDescendant;
-private bool tabsPending;
-
-private HtmlTextWriterTag _tagKey;
-private TextWriter writer;
-private HttpWriter _httpWriter;
-
-private static Hashtable _attrKeyLookupTable;
-private static Hashtable _styleKeyLookupTable;
-private static Hashtable _tagKeyLookupTable;
-
-private string _tagName;
-private string tabString;
-private static string[] _styleNameLookupArray;
-
-private RenderAttribute[] _attrList;
-private static AttributeInformation[] _attrNameLookupArray;
-private static TagInformation[] _tagNameLookupArray;
-private TagStackEntry[] _endTags;
-private RenderStyle[] _styleList;
-
-} //HtmlTextWriter
-
-struct AttributeInformation {
- public bool encode;
- public string name;
-
- public AttributeInformation(string name, bool encode){
- this.encode = encode;
- this.name = name;
- }
-}
-
-struct RenderAttribute {
- public bool encode;
- public HtmlTextWriterAttribute key;
- public string name;
- public string value;
-}
-
-struct RenderStyle {
- public HtmlTextWriterStyle key;
- public string name;
- public string value;
-}
-
-struct TagInformation {
- public string closingTag;
- public string name;
- public TagType tagType;
-
- public TagInformation(string name, TagType tagType, string closingTag){
- this.name = name;
- this.tagType = tagType;
- this.closingTag = closingTag;
- }
-}
-
-struct TagStackEntry {
- public string endTagText;
- public HtmlTextWriterTag tagKey;
-}
-
-enum TagType {
- Inline,
- NonClosing,
- Other
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs
deleted file mode 100644
index 5b82723c5c3..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterAttribute.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-
-namespace System.Web.UI{
-
-public enum HtmlTextWriterAttribute {
-Accesskey,
-Align,
-Alt,
-Background,
-Bgcolor,
-Border,
-Bordercolor,
-Cellpadding,
-Cellspacing,
-Checked,
-Class,
-Cols,
-Colspan,
-Disabled,
-For,
-Height,
-Href,
-Id,
-Maxlength,
-Multiple,
-Name,
-Nowrap,
-Onchange,
-Onclick,
-ReadOnly,
-Rows,
-Rowspan,
-Rules,
-Selected,
-Size,
-Src,
-Style,
-Tabindex,
-Target,
-Title,
-Type,
-Valign,
-Value,
-Width,
-Wrap,
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs
deleted file mode 100644
index 4955422d668..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterStyle.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-
-namespace System.Web.UI{
-
-public enum HtmlTextWriterStyle {
-BackgroundColor,
-BackgroundImage,
-BorderCollapse,
-BorderColor,
-BorderStyle,
-BorderWidth,
-Color,
-FontFamily,
-FontSize,
-FontStyle,
-FontWeight,
-Height,
-TextDecoration,
-Width
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs b/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs
deleted file mode 100644
index f248979246a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/HtmlTextWriterTag.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-/* System.Web.UI
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-
-namespace System.Web.UI{
-
-public enum HtmlTextWriterTag {
-Unknown,
-A,
-Acronym,
-Address,
-Area,
-B,
-Base,
-Basefont,
-Bdo,
-Bgsound,
-Big,
-Blockquote,
-Body,
-Br,
-Button,
-Caption,
-Center,
-Cite,
-Code,
-Col,
-Colgroup,
-Dd,
-Del,
-Dfn,
-Dir,
-Div,
-Dl,
-Dt,
-Em,
-Embed,
-Fieldset,
-Font,
-Form,
-Frame,
-Frameset,
-H1,
-H2,
-H3,
-H4,
-H5,
-H6,
-Head,
-Hr,
-Html,
-I,
-Iframe,
-Img,
-Input,
-Ins,
-Isindex,
-Kbd,
-Label,
-Legend,
-Li,
-Link,
-Map,
-Marquee,
-Menu,
-Meta,
-Nobr,
-Noframes,
-Noscript,
-Object,
-Ol,
-Option,
-P,
-Param,
-Pre,
-Q,
-Rt,
-Ruby,
-S,
-Samp,
-Script,
-Select,
-Small,
-Span,
-Strike,
-Strong,
-Style,
-Sub,
-Sup,
-Table,
-Tbody,
-Td,
-Textarea,
-Tfoot,
-Th,
-Thead,
-Title,
-Tr,
-Tt,
-U,
-Ul,
-Var,
-Wbr,
-Xml
-}
-
-
-} // namespace System.Web.UI.HtmlControls
-
diff --git a/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs b/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs
deleted file mode 100644
index be0984b2c8b..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IAttributeAccessor.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.UI.IAttributeAccessor.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IAttributeAccessor
- {
- string GetAttribute(string key);
- void SetAttribute(string key, string value);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs b/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs
deleted file mode 100644
index 5ff7f00b2da..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IDataBindingsAccessor.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.UI.IDataBindingsAccessor.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IDataBindingsAccessor
- {
- DataBindingCollection DataBindings {get;}
- bool HasDataBindings {get;}
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/INamingContainer.cs b/mcs/class/System.Web/System.Web.UI/INamingContainer.cs
deleted file mode 100644
index 659c5b60bed..00000000000
--- a/mcs/class/System.Web/System.Web.UI/INamingContainer.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.UI.INamingContainer.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface INamingContainer
- {
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs b/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs
deleted file mode 100644
index cad22017e9d..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IParserAccessor.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.UI.IParserAccessor.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IParserAccessor
- {
- void AddParsedSubObject(object obj);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs b/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs
deleted file mode 100644
index 7d105cb7476..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IPostBackDataHandler.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Web.UI.IPostBackDataHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-using System.Collections.Specialized;
-
-namespace System.Web.UI
-{
- public interface IPostBackDataHandler
- {
- bool LoadPostData(string postDataKey, NameValueCollection postCollection);
- void RaisePostDataChangedEvent();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs b/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs
deleted file mode 100644
index daa6f70160c..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IPostBackEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.UI.IPostBackEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IPostBackEventHandler
- {
- void RaisePostBackEvent(string eventArgument);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IStateManager.cs b/mcs/class/System.Web/System.Web.UI/IStateManager.cs
deleted file mode 100644
index 4bcb6b8deb0..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IStateManager.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.UI.IStateManager.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IStateManager
- {
- void LoadViewState(object state);
- object SaveViewState();
- void TrackViewState();
- bool IsTrackingViewState { get; }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs b/mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs
deleted file mode 100644
index da35c6b0ee8..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ITagNameToTypeMapper.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Web.UI.ITagNameToTypeMapper.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-using System.Collections;
-
-namespace System.Web.UI
-{
- public interface ITagNameToTypeMapper
- {
- Type GetControlType(string tagName, IDictionary attribs);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ITemplate.cs b/mcs/class/System.Web/System.Web.UI/ITemplate.cs
deleted file mode 100644
index c9981859b37..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ITemplate.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.UI.ITemplate.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface ITemplate
- {
- void InstantiateIn(Control container);
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/IValidator.cs b/mcs/class/System.Web/System.Web.UI/IValidator.cs
deleted file mode 100644
index 47b418aee39..00000000000
--- a/mcs/class/System.Web/System.Web.UI/IValidator.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Web.UI.IValidator.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public interface IValidator
- {
- void Validate();
- string ErrorMessage {get; set;}
- bool IsValid {get; set;}
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ImageClickEventArgs.cs b/mcs/class/System.Web/System.Web.UI/ImageClickEventArgs.cs
deleted file mode 100755
index d2330bb6615..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ImageClickEventArgs.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Web.UI.ImageClickEventArgs.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
- public sealed class ImageClickEventArgs : EventArgs
- {
- public ImageClickEventArgs (int x, int y)
- {
- X = x;
- Y = y;
- }
-
- public int X;
- public int Y;
- }
-}
-
-
diff --git a/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs b/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs
deleted file mode 100644
index 2bcc75881df..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ImageClickEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.UI.ImageClickEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public delegate void ImageClickEventHandler(object sender, ImageClickEventArgs e);
-}
diff --git a/mcs/class/System.Web/System.Web.UI/LiteralControl.cs b/mcs/class/System.Web/System.Web.UI/LiteralControl.cs
deleted file mode 100644
index 180c700dc9a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/LiteralControl.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Web.UI.LiteralControl.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public class LiteralControl : Control
- {
- private string _text = String.Empty;
- public LiteralControl() {}
- public LiteralControl(string text)
- {
- _text = text;
- }
- public virtual string Text
- {
- get
- {
- return _text;
- }
- set
- {
- _text = value;
- }
- }
- protected override void Render(HtmlTextWriter writer)
- {
- writer.Write(_text);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs b/mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs
deleted file mode 100644
index 734131f2fb0..00000000000
--- a/mcs/class/System.Web/System.Web.UI/OutputCacheLocation.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Web.UI.OutputCacheLocation.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public enum OutputCacheLocation
- {
- Any,
- Client,
- Downstream,
- None,
- Server
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/Page.cs b/mcs/class/System.Web/System.Web.UI/Page.cs
deleted file mode 100755
index c1674bcd3e9..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Page.cs
+++ /dev/null
@@ -1,505 +0,0 @@
-//
-// System.Web.UI.Page
-//
-// Authors:
-// Duncan Mak (duncan@ximian.com)
-// Gonzalo Paniagua (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc. (http://www.ximian.com)
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.IO;
-using System.Reflection;
-using System.Security.Principal;
-using System.Text;
-using System.Web;
-using System.Web.Caching;
-using System.Web.SessionState;
-
-namespace System.Web.UI
-{
-
-public class Page : TemplateControl, IHttpHandler
-{
- private string _culture;
- private bool _viewState = true;
- private bool _viewStateMac = false;
- private string _errorPage;
- private ArrayList _fileDependencies;
- private string _ID;
- private bool _isPostBack;
- private bool _isValid;
- private HttpServerUtility _server;
- private bool _smartNavigation = false;
- private TraceContext _trace;
- private bool _traceEnabled;
- private TraceMode _traceModeValue;
- private int _transactionMode;
- private string _UICulture;
- private HttpContext _context;
- private ValidatorCollection _validators;
- private bool _visible;
- private bool _renderingForm;
- private bool _hasForm;
-
- #region Fields
- protected const string postEventArgumentID = ""; //FIXME
- protected const string postEventSourceID = "";
- #endregion
-
- #region Constructor
- public Page ()
- {
- }
-
- #endregion
-
- #region Properties
-
- public HttpApplicationState Application
- {
- get { return _context.Application; }
- }
-
- bool AspCompatMode
- {
- set { throw new NotImplementedException (); }
- }
-
- bool Buffer
- {
- set { Response.BufferOutput = value; }
- }
-
- public Cache Cache
- {
- get { return _context.Cache; }
- }
-
- [MonoTODO]
- public string ClientTarget
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- int CodePage
- {
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- string ContentType
- {
- set { throw new NotImplementedException (); }
- }
-
- protected override HttpContext Context
- {
- get { return _context; }
- }
-
- string Culture
- {
- set { _culture = value; }
- }
-
- public override bool EnableViewState
- {
- get { return _viewState; }
- set { _viewState = value; }
- }
-
- protected bool EnableViewStateMac
- {
- get { return _viewStateMac; }
- set { _viewStateMac = value; }
- }
-
- public string ErrorPage
- {
- get { return _errorPage; }
- set { _errorPage = value; }
- }
-
- public ArrayList FileDependencies
- {
- set { _fileDependencies = value; }
- }
-
- public override string ID
- {
- get { return _ID; }
- set { _ID = value; }
- }
-
- public bool IsPostBack
- {
- get { return _isPostBack; }
- }
-
- [MonoTODO]
- public bool IsReusable
- {
- get { throw new NotImplementedException (); }
- }
-
- public bool IsValid
- {
- get { return _isValid; }
- }
-
- [MonoTODO]
- int LCID {
- set { throw new NotImplementedException (); }
- }
-
- public HttpRequest Request
- {
- get { return _context.Request; }
- }
-
- public HttpResponse Response
- {
- get { return _context.Response; }
- }
-
- string ResponseEncoding
- {
- set { Response.ContentEncoding = Encoding.GetEncoding (value); }
- }
-
- public HttpServerUtility Server
- {
- get { return _server; }
- }
-
- public virtual HttpSessionState Session
- {
- get { return _context.Session; }
- }
-
- public bool SmartNavigation
- {
- get { return _smartNavigation; }
- set { _smartNavigation = value; }
- }
-
- public TraceContext Trace
- {
- get { return _trace; }
- }
-
- bool TraceEnabled
- {
- set { _traceEnabled = value; }
- }
-
- TraceMode TraceModeValue
- {
- set { _traceModeValue = value; }
- }
-
- int TransactionMode
- {
- set { _transactionMode = value; }
- }
-
- string UICulture
- {
- set { _UICulture = value; }
- }
-
- public IPrincipal User
- {
- get { return _context.User; }
- }
-
- public ValidatorCollection Validators
- {
- get {
- if (_validators == null)
- _validators = new ValidatorCollection ();
- return _validators;
- }
- }
-
- public override bool Visible
- {
- get { return _visible; }
- set { _visible = value; }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- protected IAsyncResult AspCompatBeginProcessRequest (HttpContext context,
- AsyncCallback cb,
- object extraData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void AspcompatEndProcessRequest (IAsyncResult result)
- {
- throw new NotImplementedException ();
- }
-
- protected virtual HtmlTextWriter CreateHtmlTextWriter (TextWriter tw)
- {
- return new HtmlTextWriter (tw);
- }
-
- [MonoTODO]
- public void DesignerInitialize ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual NameValueCollection DeterminePostBackMode ()
- {
- /* Why does this not compile? HttpSessionState has IsNewSession...
- if (_session.IsNewSession)
- return null;
- */
-
- if (IsPostBack)
- return _context.Request.Form; //FIXME: is this enough?
-
- throw new NotImplementedException ("GET method got to parse Request.QueryString");
- }
-
- [MonoTODO]
- public string GetPostBackClientEvent (Control control, string argument)
- {
- // Don't throw the exception. keep going
- //throw new NotImplementedException ();
- StringBuilder result = new StringBuilder ();
- result.AppendFormat ("GetPostBackClientEvent ('{0}', '{1}')", control.ID, argument);
- return result.ToString ();
- }
-
- [MonoTODO]
- public string GetPostBackClientHyperlink (Control control, string argument)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string GetPostBackEventReference (Control control)
- {
- // Don't throw the exception. keep going
- //throw new NotImplementedException ();
- return GetPostBackEventReference (control, "");
- }
-
- [MonoTODO]
- public string GetPostBackEventReference (Control control, string argument)
- {
- // Don't throw the exception. keep going
- //throw new NotImplementedException ();
- StringBuilder result = new StringBuilder ();
- result.AppendFormat ("GetPostBackEventReference ('{0}', '{1}')", control.ID, argument);
- return result.ToString ();
- }
-
- public virtual int GetTypeHashCode ()
- {
- return this.GetHashCode ();
- }
-
- [MonoTODO]
- protected virtual void InitOutputCache (int duration,
- string varyByHeader,
- string varyByCustom,
- OutputCacheLocation location,
- string varyByParam)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool IsClientScriptBlockRegistered (string key)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool IsStartupScriptRegistered (string key)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual object LoadPageStateFromPersistenceMedium ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string MapPath (string virtualPath)
- {
- throw new NotImplementedException ();
- }
-
- private void InvokeEventMethod (string m_name, object sender, EventArgs e)
- {
- Type [] types = new Type [] {typeof (object), typeof (EventArgs)};
- MethodInfo evt_method = GetType ().GetMethod (m_name, types);
-
- if (evt_method != null){
- object [] parms = new object [2];
- parms [0] = sender;
- parms [1] = e;
- evt_method.Invoke (this, parms);
- }
- }
-
- internal void OnFormRender (HtmlTextWriter writer, string formUniqueID)
- {
- if (_hasForm)
- throw new HttpException ("Only 1 HtmlForm is allowed per page.");
-
- _renderingForm = true;
- _hasForm = true;
- }
-
- internal void OnFormPostRender (HtmlTextWriter writer, string formUniqueID)
- {
- _renderingForm = false;
- }
-
-
- private void _Page_Init (object sender, EventArgs e)
- {
- InvokeEventMethod ("Page_Init", sender, e);
- }
-
- private void _Page_Load (object sender, EventArgs e)
- {
- InvokeEventMethod ("Page_Load", sender, e);
- }
-
- public void ProcessRequest (HttpContext context)
- {
- FrameworkInitialize ();
- // This 2 should depend on AutoEventWireUp in Page directive. Defaults to true.
- Init += new EventHandler (_Page_Init);
- Load += new EventHandler (_Page_Load);
-
- //-- Control execution lifecycle in the docs
- OnInit (EventArgs.Empty);
- //LoadViewState ();
- //if (this is IPostBackDataHandler)
- // LoadPostData ();
- OnLoad (EventArgs.Empty);
- //if (this is IPostBackDataHandler)
- // RaisePostBackEvent ();
- OnPreRender (EventArgs.Empty);
-
- //--
- _context = context;
- HtmlTextWriter output = new HtmlTextWriter (context.Response.Output);
- foreach (Control ctrl in Controls){
- ctrl.Page = this;
- ctrl.RenderControl (output);
- }
- }
-
- protected virtual void RaisePostBackEvent (IPostBackEventHandler sourceControl, string eventArgument)
- {
- sourceControl.RaisePostBackEvent (eventArgument);
- }
-
- [MonoTODO]
- public void RegisterArrayDeclaration (string arrayName, string arrayValue)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void RegisterClientScriptBlock (string key, string script)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void RegisterHiddenField (string hiddenFieldName, string hiddenFieldInitialValue)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RegisterClientScriptFile (string a, string b, string c)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RegisterOnSubmitStatement (string key, string script)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RegisterRequiresPostBack (Control control)
- {
- // Don't throw the exception. keep going
- //throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void RegisterRequiresRaiseEvent (IPostBackEventHandler control)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RegisterViewStateHandler ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual void SavePageStatetoPersistenceMedium (object viewState)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void SavePageViewState ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual void Validate ()
- {
- bool all_valid = true;
- foreach (IValidator v in _validators){
- v.Validate ();
- if (v.IsValid == false)
- all_valid = false;
- }
-
- if (all_valid)
- _isValid = true;
- }
-
- public virtual void VerifyRenderingInServerForm (Control control)
- {
- if (!_renderingForm)
- throw new HttpException ("Control '" + control.ClientID +
- "' must be rendered within a HtmlForm");
- }
-
- #endregion
-}
-}
diff --git a/mcs/class/System.Web/System.Web.UI/Pair.cs b/mcs/class/System.Web/System.Web.UI/Pair.cs
deleted file mode 100644
index bf13fabdce8..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Pair.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: Pair
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.Web.UI
-{
- public class Pair
- {
- public object First;
- public object Second;
-
- public Pair(object first, object second)
- {
- First = first;
- Second = second;
- }
-
- public Pair()
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs b/mcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs
deleted file mode 100755
index 4a41b4f51a3..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ParseChildrenAttribute.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.Web.UI.ParseChildrenAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class ParseChildrenAttribute : Attribute
- {
- bool childrenAsProperties;
- string defaultProperty;
-
- // LAMESPEC
- public ParseChildrenAttribute ()
- {
- childrenAsProperties = false;
- defaultProperty = "";
- }
-
- public ParseChildrenAttribute (bool childrenAsProperties)
- {
- this.childrenAsProperties = childrenAsProperties;
- this.defaultProperty = "";
- }
-
- public ParseChildrenAttribute (bool childrenAsProperties,
- string defaultProperty)
- {
- this.childrenAsProperties = childrenAsProperties;
- this.defaultProperty = defaultProperty;
- }
-
- public static readonly ParseChildrenAttribute Default;
-
- public bool ChildrenAsProperties {
-
- get { return childrenAsProperties; }
-
- set { childrenAsProperties = value; }
- }
-
- public string DefaultProperty {
- get { return defaultProperty; }
-
- set { defaultProperty = value; }
- }
-
- [MonoTODO]
- public override bool Equals (object obj)
- {
- return false;
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return 42;
- }
-
- [MonoTODO]
- public override bool IsDefaultAttribute ()
- {
- return false;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/PartialCachingAttribute.cs b/mcs/class/System.Web/System.Web.UI/PartialCachingAttribute.cs
deleted file mode 100755
index be490317e8b..00000000000
--- a/mcs/class/System.Web/System.Web.UI/PartialCachingAttribute.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Web.UI.PartialCachingAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class PartialCachingAttribute : Attribute
- {
- int duration;
- string varyByControls;
- string varyByCustom;
- string varyByParams;
-
- public PartialCachingAttribute (int duration)
- {
- this.duration = duration;
- }
-
- public PartialCachingAttribute (int duration, string varyByParams,
- string varyByControls, string varyByCustom)
- {
- this.duration = duration;
- this.varyByParams = varyByParams;
- this.varyByControls = varyByControls;
- this.varyByCustom = varyByCustom;
- }
-
- public int Duration {
- get { return duration; }
- }
-
- public string VaryByParams {
- get { return varyByParams; }
- }
-
- public string VaryByControls {
- get { return varyByControls; }
- }
-
- public string VaryByCustom {
- get { return varyByCustom; }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs b/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs
deleted file mode 100755
index a38d49c817f..00000000000
--- a/mcs/class/System.Web/System.Web.UI/PersistChildrenAttribute.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Web.UI.PersistChildrenAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class PersistChildrenAttribute : Attribute
- {
- bool persist;
-
- public PersistChildrenAttribute (bool persist)
- {
- this.persist = persist;
- }
-
- public static readonly PersistChildrenAttribute Default;
- public static readonly PersistChildrenAttribute Yes;
- public static readonly PersistChildrenAttribute No;
-
- public bool Persist {
- get { return persist; }
- }
-
- [MonoTODO]
- public override bool Equals (object obj)
- {
- return false;
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return 42;
- }
-
- [MonoTODO]
- public override bool IsDefaultAttribute ()
- {
- return false;
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs b/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs
deleted file mode 100755
index e58f2847489..00000000000
--- a/mcs/class/System.Web/System.Web.UI/PersistenceMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.UI.PersistenceMode.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public enum PersistenceMode
- {
- Attribute = 0,
- InnerProperty = 1,
- InnerDefaultProperty = 2,
- EncodedInnerDefaultProperty = 3,
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/PersistenceModeAttribute.cs b/mcs/class/System.Web/System.Web.UI/PersistenceModeAttribute.cs
deleted file mode 100755
index 1f878f6ef2b..00000000000
--- a/mcs/class/System.Web/System.Web.UI/PersistenceModeAttribute.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Web.UI.PersistenceModeAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class PersistenceModeAttribute : Attribute
- {
- PersistenceMode mode;
-
- public PersistenceModeAttribute (PersistenceMode mode)
- {
- this.mode = mode;
- }
-
- public static readonly PersistenceModeAttribute Attribute;
- public static readonly PersistenceModeAttribute Default;
- public static readonly PersistenceModeAttribute EncodedInnerDefaultProperty;
- public static readonly PersistenceModeAttribute InnerDefaultProperty;
- public static readonly PersistenceModeAttribute InnerProperty;
-
- public PersistenceMode Mode {
- get { return mode; }
- }
-
- [MonoTODO]
- public override bool Equals (object obj)
- {
- return false;
- }
-
- [MonoTODO]
- public override int GetHashCode ()
- {
- return 42;
- }
-
- [MonoTODO]
- public override bool IsDefaultAttribute ()
- {
- return false;
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/PropertyConverter.cs b/mcs/class/System.Web/System.Web.UI/PropertyConverter.cs
deleted file mode 100644
index d98e80f912a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/PropertyConverter.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: PropertyConverter
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.ComponentModel;
-using System.Globalization;
-using System.Reflection;
-
-namespace System.Web.UI
-{
- public sealed class PropertyConverter
- {
- private static Type[] parseMethodTypes;
- private static Type[] parseMethodTypesWithSOP;
-
- static PropertyConverter()
- {
- parseMethodTypes = new Type[1];
- parseMethodTypes[0] = typeof(string);
- parseMethodTypesWithSOP = new Type[2];
- parseMethodTypesWithSOP[0] = typeof(string);
- parseMethodTypesWithSOP[1] = typeof(IServiceProvider);
- }
-
- private PropertyConverter()
- {
- // Prevent any instance
- }
-
- public static object EnumFromString(Type enumType, string enumValue)
- {
- object retVal = null;
- try
- {
- retVal = Enum.Parse(enumType, enumValue, true);
- } catch
- {
- retVal = null;
- }
- return retVal;
- }
-
- public static string EnumToString(Type enumType, object enumValue)
- {
- string retVal = Enum.Format(enumType, enumValue, "G");
- return retVal.Replace('_','-');
- }
-
- public static object ObjectFromString(Type objType, MemberInfo propertyInfo, string objValue)
- {
- if(objValue == null)
- return null;
- if(! (!objType.Equals(typeof(Boolean)) || objValue.Length > 0) )
- {
- return null;
- }
- if(objType.IsEnum)
- {
- return EnumFromString(objType, objValue);
- }
- if(objType.Equals(typeof(string)))
- {
- return objValue;
- }
- PropertyDescriptor pc = null;
- if(propertyInfo != null)
- {
- pc = (TypeDescriptor.GetProperties(propertyInfo.ReflectedType))[propertyInfo.Name];
- }
- if(pc != null)
- {
- TypeConverter converter = pc.Converter;
- if(converter!=null && converter.CanConvertFrom(typeof(string)))
- {
- return converter.ConvertFromInvariantString(objValue);
- }
- }
- MethodInfo mi = objType.GetMethod("Parse", parseMethodTypesWithSOP);
- object o = null;
- if(mi != null)
- {
- object[] parameters = new object[2];
- parameters[0] = objValue;
- parameters[1] = CultureInfo.InvariantCulture;
- try
- {
- o = Utils.InvokeMethod(mi, null, parameters);
- } catch
- {
- }
- }
- if(o == null)
- {
- mi = objType.GetMethod("Parse", parseMethodTypes);
- if(mi!=null)
- {
- object[] parameters = new object[1];
- parameters[0] = objValue;
- try
- {
- o = Utils.InvokeMethod(mi, null, parameters);
- } catch
- {
- }
- }
- }
- if(o == null)
- {
- throw new HttpException(/*HttpRuntime.FormatResourceString(*/"Type_not_creatable_from_string"/*, objType.FullName, objValue, propertyInfo.Name)*/);
- }
- return o;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/RenderMethod.cs b/mcs/class/System.Web/System.Web.UI/RenderMethod.cs
deleted file mode 100755
index 8f2db742cdb..00000000000
--- a/mcs/class/System.Web/System.Web.UI/RenderMethod.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//
-// System.Web.UI.RenderMethod.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Web.UI {
-
- public delegate void RenderMethod (HtmlTextWriter output, Control container);
-}
diff --git a/mcs/class/System.Web/System.Web.UI/StateBag.cs b/mcs/class/System.Web/System.Web.UI/StateBag.cs
deleted file mode 100644
index 44b4a09e060..00000000000
--- a/mcs/class/System.Web/System.Web.UI/StateBag.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: StateBag
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Web;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.Web.UI
-{
- public sealed class StateBag : IStateManager, IDictionary, ICollection, IEnumerable
- {
- private bool ignoreCase;
- private bool marked;
- private IDictionary bag;
-
- public StateBag (bool ignoreCase)
- {
- Initialize (ignoreCase);
- }
-
- public StateBag ()
- {
- Initialize (false);
- }
-
- private void Initialize (bool ignoreCase)
- {
- this.ignoreCase = ignoreCase;
- marked = false;
- bag = new HybridDictionary (ignoreCase);
- }
-
- public int Count {
- get { return bag.Count; }
- }
-
-
- public object this [string key] {
- get {
- if (key == null || key.Length == 0)
- throw new ArgumentException (HttpRuntime.FormatResourceString ("Key_Cannot_Be_Null"));
-
- object val = bag [key];
-
- if (val is StateItem)
- return ((StateItem) val).Value;
-
- return null; //
- }
-
- set { Add (key, value); }
- }
-
- object IDictionary.this [object key] {
- get { return this [(string) key] as object; }
-
- set { Add ((string) key, value); }
- }
-
- public ICollection Keys {
- get { return bag.Keys; }
- }
-
- public ICollection Values {
- get { return bag.Values; }
- }
-
- public StateItem Add (string key, object value)
- {
- if (key == null || key.Length == 0)
- throw new ArgumentException (HttpRuntime.FormatResourceString ("Key_Cannot_Be_Null"));
-
- StateItem val = bag [key] as StateItem; //don't throw exception when null
- if(val == null) {
- if(value != null || marked) {
- val = new StateItem (value);
- bag.Add (key, val);
- }
- }
- else if (value == null && !marked)
- bag.Remove (key);
- else
- val.Value = value;
-
- if (val != null && marked)
- val.IsDirty = true;
-
- return val;
- }
-
- public void Clear ()
- {
- bag.Clear ();
- }
-
- public IDictionaryEnumerator GetEnumerator ()
- {
- return bag.GetEnumerator ();
- }
-
- public bool IsItemDirty (string key)
- {
- object o = bag [key];
-
- if (o is StateItem)
- return ((StateItem) o).IsDirty;
-
- return false;
- }
-
- public void Remove (string key)
- {
- bag.Remove (key);
- }
-
- /// <summary>
- /// Undocumented
- /// </summary>
- public void SetItemDirty (string key, bool dirty)
- {
- if (bag [key] is StateItem)
- ((StateItem) bag [key]).IsDirty = dirty;
- }
-
- internal bool IsTrackingViewState {
- get { return marked; }
- }
-
- internal void LoadViewState (object state)
- {
- if(state!=null) {
- Pair pair = (Pair) state;
- ArrayList keyList = (ArrayList) (pair.First);
- ArrayList valList = (ArrayList) (pair.Second);
- for(int i = 0; i < keyList.Count; i++)
- Add ((string) keyList [i], valList [i]);
- }
- }
-
- internal object SaveViewState ()
- {
- if(bag.Count > 0) {
- ArrayList keyList = null, valList = null;
-
- foreach(IDictionaryEnumerator current in bag) {
- StateItem item = (StateItem)current.Value;
-
- if (item.IsDirty) {
- if (keyList == null) {
- keyList = new ArrayList ();
- valList = new ArrayList ();
- }
-
- keyList.Add (current.Key);
- valList.Add (current.Value);
- }
- }
-
- if (keyList!=null)
- return new Pair (keyList, valList);
- }
- return null;
- }
-
- internal void TrackViewState()
- {
- marked = true;
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- void IStateManager.LoadViewState (object savedState)
- {
- LoadViewState (savedState);
- }
-
- object IStateManager.SaveViewState ()
- {
- return SaveViewState ();
- }
-
- void IStateManager.TrackViewState ()
- {
- TrackViewState ();
- }
-
- bool IStateManager.IsTrackingViewState {
- get { return IsTrackingViewState; }
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- Values.CopyTo (array, index);
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- object ICollection.SyncRoot
- {
- get { return this; }
- }
-
- void IDictionary.Add (object key, object value)
- {
- Add ((string) key, value);
- }
-
- void IDictionary.Remove (object key)
- {
- Remove ((string) key);
- }
-
- bool IDictionary.Contains (object key)
- {
- return bag.Contains ((string) key);
- }
-
- bool IDictionary.IsFixedSize {
- get { return false; }
- }
-
- bool IDictionary.IsReadOnly {
- get { return false; }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/StateItem.cs b/mcs/class/System.Web/System.Web.UI/StateItem.cs
deleted file mode 100644
index 81a425bbaac..00000000000
--- a/mcs/class/System.Web/System.Web.UI/StateItem.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Web.UI.StateItem.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-using System;
-using System.Web;
-
-namespace System.Web.UI
-{
- public sealed class StateItem
- {
- private bool _isDirty = false;
- private object _value = null;
- public bool IsDirty
- {
- get
- {
- return _isDirty;
- }
- set
- {
- _isDirty = value;
- }
- }
- public object Value
- {
- get
- {
- return _value;
- }
- set
- {
- _value = value;
- }
- }
- private StateItem() {}
- internal StateItem(Object value)
- {
- _value = value;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/TODO b/mcs/class/System.Web/System.Web.UI/TODO
deleted file mode 100644
index de529b87f86..00000000000
--- a/mcs/class/System.Web/System.Web.UI/TODO
+++ /dev/null
@@ -1,42 +0,0 @@
-AttributeCollection
-BaseParser
-BasePartialCachingControl
-CompiledTemplateBuilder
-ConstructorNeedsTagAttribute
-ControlBuilder
-ControlBuilderAttribute
-ControlCollection
-CssStyleCollection
-DataBinder
-DataBinding
-DataBindingCollection
-DataBindingHandlerAttribute
-DataBoundLiteralControl
-DesignTimeParseData
-DesignTimeTemplateParser
-EmptyControlCollection
-Html32TextWriter
-HtmlTextWriter
-ImageClickEventArgs
-LosFormatter
-Page
-PageParser
-ParseChildrenAttribute
-PartialCachingAttribute
-PartialCachingControl
-PersistChildrenAttribute
-PersistanceModeAttribute
-RootBuilder
-SimpleWebHandlerParser
-StateBag
-StaticPartialCachingControl
-TagPrefixAttribute
-TemplateBuilder
-TemplateContainerAttribute
-TemplateControl
-TemplateControlParser
-ToolboxDataAttribute
-UserControl
-ValidationPropertyAttribute
-ValidatorCollection
-WebServiceProvider
diff --git a/mcs/class/System.Web/System.Web.UI/TagPrefixAttribute.cs b/mcs/class/System.Web/System.Web.UI/TagPrefixAttribute.cs
deleted file mode 100755
index 0dc56d241f5..00000000000
--- a/mcs/class/System.Web/System.Web.UI/TagPrefixAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Web.UI.TagPrefixAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class TagPrefixAttribute : Attribute
- {
- string namespaceName;
- string tagPrefix;
-
- public TagPrefixAttribute (string namespaceName,
- string tagPrefix)
- {
- if (namespaceName == null || tagPrefix == null)
- throw new ArgumentNullException ();
-
- this.namespaceName = namespaceName;
- this.tagPrefix = tagPrefix;
- }
-
- public string NamespaceName {
- get { return namespaceName; }
- }
-
- public string TagPrefix {
- get { return tagPrefix; }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateContainerAttribute.cs b/mcs/class/System.Web/System.Web.UI/TemplateContainerAttribute.cs
deleted file mode 100755
index 854bcf1419e..00000000000
--- a/mcs/class/System.Web/System.Web.UI/TemplateContainerAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Web.UI.TemplateContainerAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- [AttributeUsage (AttributeTargets.Property)]
- public sealed class TemplateContainerAttribute : Attribute
- {
- Type containerType;
-
- public TemplateContainerAttribute (Type containerType)
- {
- this.containerType = containerType;
- }
-
- public Type ContainerType {
- get { return containerType; }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateControl.cs b/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
deleted file mode 100755
index 21083764136..00000000000
--- a/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// System.Web.UI.TemplateControl.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- public abstract class TemplateControl : Control, INamingContainer
- {
- #region Constructor
- protected TemplateControl ()
- {
- }
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- protected virtual int AutoHandlers {
- get { return 1; }
- set { }
- }
-
- [MonoTODO]
- protected virtual bool SupportAutoEvents {
- get { return false; }
- }
-
- #endregion
-
- #region Methods
-
- protected virtual void Construct ()
- {
- }
-
- [MonoTODO]
- protected virtual LiteralControl CreateResourceBasedLiteralControl (
- int offset, int size, bool fAsciiOnly)
- {
- return null;
- }
-
- [MonoTODO]
- protected virtual void FrameworkInitialize ()
- {
- }
-
- [MonoTODO]
- public Control LoadControl (string virtualPath)
- {
- return null;
- }
-
- [MonoTODO]
- public ITemplate LoadTemplate (string virtualPath)
- {
- return null;
- }
-
- [MonoTODO]
- protected virtual void OnAbortTransaction (EventArgs e)
- {
- }
-
- [MonoTODO]
- protected virtual void OnCommitTransaction (EventArgs e)
- {
- }
-
- [MonoTODO]
- protected virtual void OnError (EventArgs e)
- {
- }
-
- [MonoTODO]
- public Control ParseControl (string content)
- {
- return null;
- }
-
- [MonoTODO]
- public static object ReadStringResource (Type t)
- {
- return null;
- }
-
- [MonoTODO]
- protected void SetStringResourcePointer (object stringResourcePointer,
- int maxResourceOffset)
- {
- }
-
- [MonoTODO]
- protected void WriteUTF8ResourceString (HtmlTextWriter output, int offset,
- int size, bool fAsciiOnly)
- {
- }
-
- #endregion
-
- #region Events
-
- public event EventHandler AbortTransaction;
- public event EventHandler CommitTransaction;
- public event EventHandler Error;
- #endregion
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateParser.cs b/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
deleted file mode 100755
index 9121da5131a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Web.UI.TemplateParser.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- public abstract class TemplateParser : BaseParser
- {
- protected abstract Type CompileIntoType ();
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ToolboxDataAttribute.cs b/mcs/class/System.Web/System.Web.UI/ToolboxDataAttribute.cs
deleted file mode 100644
index 88bdd66227f..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ToolboxDataAttribute.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: ToolboxDataAttribute
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-
-namespace System.Web.UI
-{
- [AttributeUsage(AttributeTargets.Class)]
- public sealed class ToolboxDataAttribute : Attribute
- {
- public static readonly ToolboxDataAttribute Default = new ToolboxDataAttribute("");
-
- private string data;
-
- public ToolboxDataAttribute(string data)
- {
- this.data = data;
- }
-
- public string Data
- {
- get
- {
- return data;
- }
- }
-
- public override bool IsDefaultAttribute()
- {
- return Default.Equals(this);
- }
-
- public override bool Equals(object obj)
- {
- if(obj != null && obj is ToolboxDataAttribute)
- {
- ToolboxDataAttribute tda = (ToolboxDataAttribute)obj;
- return (tda.Data == Data);
- }
- return false;
- }
-
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/Triplet.cs b/mcs/class/System.Web/System.Web.UI/Triplet.cs
deleted file mode 100755
index 28c8546c762..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Triplet.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Web.UI.Triplet.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
-
- public class Triplet
- {
- public object First;
- public object Second;
- public object Third;
-
- public Triplet ()
- {
- }
-
- public Triplet (object x, object y)
- {
- First = x;
- Second = y;
- }
-
- public Triplet (object x, object y, object z)
- {
- First = x;
- Second = y;
- Third = z;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/Utils.cs b/mcs/class/System.Web/System.Web.UI/Utils.cs
deleted file mode 100644
index 5efb7a7919a..00000000000
--- a/mcs/class/System.Web/System.Web.UI/Utils.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Namespace: System.Web.UI
- * Class: Utils
- *
- * Author: Gaurav Vaish
- * Maintainer-> gvaish@iitk.ac.in
- * Implementation: yes
- * Contact: <gvaish@iitk.ac.in>
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Reflection;
-
-namespace System.Web.UI
-{
- internal class Utils
- {
- internal static object InvokeMethod(MethodInfo info, object obj, object[] parameters)
- {
- object retVal = null;
- try
- {
- retVal = info.Invoke(obj, parameters);
- } catch(TargetInvocationException tie)
- {
- throw tie.InnerException;
- }
- return retVal;
- }
-
- internal static string GetClientValidatedEvent(Page page)
- {
- return "if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate();";
- }
-
- internal static string GetClientValidatedPostBack(Control control)
- {
- return (" { if (typeof(Page_ClientValidate) != 'function' || Page_ClientValidate()) " +
- control.Page.GetPostBackEventReference(control) +
- " } " );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.UI/ValidationPropertyAttribute.cs b/mcs/class/System.Web/System.Web.UI/ValidationPropertyAttribute.cs
deleted file mode 100644
index 01281a6f002..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ValidationPropertyAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Web.UI.ValidationPropertyAttribute.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Web.UI {
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class ValidationPropertyAttribute : Attribute
- {
- string name;
-
- public ValidationPropertyAttribute (string name)
- {
- this.name = name;
- }
-
- public string Name {
- get { return name; }
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web.UI/ValidatorCollection.cs b/mcs/class/System.Web/System.Web.UI/ValidatorCollection.cs
deleted file mode 100755
index 8b53ec91566..00000000000
--- a/mcs/class/System.Web/System.Web.UI/ValidatorCollection.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Web.UI.ValidatorCollection.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Collections;
-
-namespace System.Web.UI {
-
- public sealed class ValidatorCollection : ICollection, IEnumerable
- {
-
- public ValidatorCollection ()
- {
- }
-
- public int Count {
- get { return 1; }
- }
-
- public bool IsReadOnly {
- get { return false; }
- }
-
- public bool IsSynchronized {
- get { return false; }
- }
-
- public IValidator this [int index] {
- get { return null; }
- }
-
- public object SyncRoot {
- get { return null; }
- }
-
- public void Add (IValidator validator)
- {
- }
-
- public bool Contains (IValidator validator)
- {
- return false;
- }
-
- public void CopyTo (Array array, int index)
- {
- }
-
- public IEnumerator GetEnumerator ()
- {
- return null;
- }
-
- public void Remove (IValidator validator)
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/.cvsignore b/mcs/class/System.Web/System.Web.Utils/.cvsignore
deleted file mode 100644
index 04bc145deea..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-_*
diff --git a/mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs b/mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs
deleted file mode 100644
index b166b32b8d5..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/ApacheVersionInfo.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: ApacheVersionInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- /// <summary>
- /// Versions of the modules related to Apache
- /// </summary>
- /// <remarks>
- /// At present I don't know what modules are to be loaded and how
- /// </remarks>
- /// <see>
- /// System.Web.Utils.IISVersionInfo
- /// </see>
- internal class ApacheVersionInfo
- {
- public ApacheVersionInfo()
- {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/ChangeLog b/mcs/class/System.Web/System.Web.Utils/ChangeLog
deleted file mode 100644
index e027d138da4..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/ChangeLog
+++ /dev/null
@@ -1,57 +0,0 @@
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * FileChangesMonitor.cs: remove redundant using statement; use int
- for MAXLEN; capitalize correctly 'WebHashCodeProvider';
- fix typo rsLock -> rwLock; Change IsRooted to IsPathRooted;
- set out parameter value where needed
- * FilePathParser.cs: qualify method GetPathRoot() with 'Path.'
- * IISVersionInfo.cs: initialize static member to avoid compile error.
- * WebEqualComparer.cs: static member defC shouldn't be readonly;
- the string comparer had some typos (fixed)
- * WebHashCodeProvider.cs: needed System.Globalization; static member
- defHcp shouldn't be readonly; remove double equal typo.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * FileAction.cs: Use 0x7FFFFFFF as enum value for error. 0xFFFFFFFF
- is too big for Int32.
- * FileChangeEventHandler.cs: put missing 'void' return type on delegate
- FileChangeEventHandler()
- * FileChangedEventArgs.cs: ditto for FileChangedEvent()
- * NativeFileChangeEventHandler.cs: ditto for NativeFileChangeEventHandler()
- * FileChangesMonitor.cs: add needed namespaces and comment out imcomplete
- code.
-
-2001-12-21 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * ApacheVersionInfo.cs - Dummy class, for later use.
- * FileAction.cs:
- * FileChangeEventHandler.cs:
- * FileChangeEventArgs.cs:
- * FileChangesMonitor.cs:
- * NativeFileChangeEventHandler.cs
- - To be used in System.Web/Http* classes.
- Initially needed for HttpRuntime
- * IISVersionInfo.cs - Some useful methods
-
-
-2001-12-17 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * UrlUtils.cs - Added functions Combine and Reduce
-
-2001-12-16 Miguel de Icaza <miguel@ximian.com>
-
- * DataSourceHelper.cs, UrlUtils.cs: Set the correct namespace.
-
-2001-11-30
- Gaurav Vaish <gvaish@iitk.ac.in>
- * DataSourceHelper.cs - Resolving DataSource objects
-
-2001-11-09
- Gaurav Vaish <gvaish@iitk.ac.in>
- * UrlUtil.cs - Some basic functions
-
-2001-11-08
- Gaurav Vaish <gvaish@iitk.ac.in>
- * Namespace - Created the namespace for commonly used,
- otherwise not available functions \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs b/mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs
deleted file mode 100644
index 35efcfa749d..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/DataSourceHelper.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Namespace: System.Web.UI.Utils
- * Class: DataSourceHelper
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Status: 10%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-namespace System.Web.Utils
-{
- internal class DataSourceHelper
- {
- public static IEnumerable GetResolvedDataSource(object source, string member)
- {
- if(source==null)
- return null;
- if(source is IListSource)
- {
- IListSource ils = (IListSource)source;
- IList il = ils.GetList();
- if(ils.ContainsListCollection)
- {
- return il;
- }
- if(il is ITypedList)
- {
- ITypedList itl = (ITypedList)il;
- PropertyDescriptorCollection pdc = itl.GetItemProperties(new PropertyDescriptor[0]);
- PropertyDescriptor pd = null;
- if(pdc != null)
- {
- if(pdc.Count > 0)
- {
- if(member != null)
- {
- if(member.Length > 0)
- {
- pd = pdc.Find(member, true);
- } else
- {
- pd = pdc[0];
- }
- }
- }
- }
- if(pd!=null)
- {
- object o = pd.GetValue(il[0]);
- if(o!=null)
- {
- if(o is IEnumerable)
- return (IEnumerable)o;
- }
- throw new HttpException("ListSource Empty"); // no data in ListSource object
- }
- }
- } else if(source is IEnumerable)
- {
- return (IEnumerable)source;
- }
- return null;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileAction.cs b/mcs/class/System.Web/System.Web.Utils/FileAction.cs
deleted file mode 100644
index 7de90d2aead..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileAction.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FileAction
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- public enum FileAction
- {
- Overwhleming,
- Added,
- Removed,
- Modifiled,
- RenamedOldName,
- RenamedNewName,
- Error = 0x7FFFFFFF
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs b/mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs
deleted file mode 100644
index e202fbcb503..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileChangeEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FileChangeEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- public delegate void FileChangeEventHandler(object sender, int method);
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs b/mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs
deleted file mode 100644
index 909711dbbe2..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileChangedEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FileChangedEventArgs
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- internal class FileChangedEventArgs : EventArgs
- {
- private string filename;
- private FileAction action;
-
- public void FileChangedEvent(FileAction action, string file)
- {
- this.action = action;
- this.filename = file;
- }
-
- public string FileName
- {
- get
- {
- return filename;
- }
- }
-
- public FileAction Action
- {
- get
- {
- return action;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs b/mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs
deleted file mode 100644
index 7d288ca0515..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FileChangesMonitor.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- *
- * Namespace: System.Web.Utils
- * Class: FileChangesMonitor
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.IO;
-using System.Web;
-using System.Runtime.InteropServices;
-using System.Collections;
-using System.Threading;
-
-namespace System.Web.Utils
-{
- internal class FileChangesMonitor
- {
- private static string BIN = "bin";
- private static string BINDIR = "bin/";
- private static int MAXLEN = 260;
-
- private FileChangeEventHandler cbRename;
- private NativeFileChangeEventHandler cbSubDirs;
-
- private int monitoredSubdirs;
- private string rootDir;
- private Hashtable allDirs;
- private GCHandle rootcbSubDirs;
-
- private ReaderWriterLock rwLock;
-
- public FileChangesMonitor()
- {
- allDirs = new Hashtable(WebHashCodeProvider.Default, WebEqualComparer.Default);
- rwLock = new ReaderWriterLock();
- }
-
- /// <param name="file">Name of the file</param>
- /// <param name="mTime">Last modification date</param>
- /// <param name="length">Legnth of the file</param>
- [MonoTODO]
- public void GetFileAttributes(string file, out DateTime mTime, long length)
- {
- if(!Path.IsPathRooted(file))
- {
- throw new HttpException(HttpRuntime.FormatResourceString("Path_must_be_rooted"));
- }
- // TODO: finish this
- mTime = DateTime.Now;
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/FilePathParser.cs b/mcs/class/System.Web/System.Web.Utils/FilePathParser.cs
deleted file mode 100644
index 25bd7740a98..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/FilePathParser.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: FilePathParser
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-using System.IO;
-
-namespace System.Web.Utils
-{
- internal class FilePathParser
- {
- private static char[] pathSeparators = {
- Path.DirectorySeparatorChar,
- Path.AltDirectorySeparatorChar
- };
-
- private string dirName;
- private string fileName;
- private string shortDirName;
- private string shortFileName;
-
- private bool exists;
-
- [MonoTODO]
- public FilePathParser(string path, bool isFile, bool getShortNames)
- {
- path = path.Trim();
- if(Path.GetPathRoot(path).Length < path.Length)
- {
- path = path.TrimEnd(pathSeparators);
- }
- if(!isFile)
- {
- dirName = GetBaseDirOrRoot(path);
- } else
- {
- dirName = path;
- }
- if(getShortNames)
- {
- if(!Directory.Exists(dirName))
- {
- dirName = null;
- return;
- }
- shortDirName = GetShortPathName(dirName);
- if(shortDirName==null)
- {
- dirName = null;
- return;
- }
- if(shortDirName == dirName)
- {
- shortDirName = null;
- } else
- {
- throw new NotImplementedException();
- }
- }
- }
-
- public static string GetBaseDirOrRoot(string file)
- {
- string bDir = Path.GetDirectoryName(file);
- return ( bDir!=null ? bDir : Path.GetPathRoot(file));
- }
-
- [MonoTODO("Native_Call_Required")]
- public static string GetShortPathName(string path)
- {
- //TODO: Native calls required, it's in kernel32.dll for windows
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs b/mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs
deleted file mode 100644
index fce89988b12..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/IISVersionInfo.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
-
- * Namespace: System.Web.Utils
- * Class: IISVersionInfo
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
-
- *
-
- * (C) Gaurav Vaish (2001)
-
- */
-
-
-using System;
-using System.Diagnostics;
-using System.Web;
-using System.Web.Utils;
-
-namespace System.Web.Utils
-{
- //FIXME: This is highly Windows/IIS specific code. What about Apache related stuff?
- internal class IISVersionInfo
- {
- private static string isapiVersion;
- private static string mscoreeVersion;
- private static string systemWebVersion;
-
- private static readonly object lockObj = null;
-
- public IISVersionInfo()
- {
- }
-
- internal static string IsapiVersion
- {
- get
- {
- if(isapiVersion==null)
- {
- lock(lockObj)
- {
- // Recheck - another thread may have set the value
- // before entering lock / exiting previous lock
- if(isapiVersion==null)
- {
- //FIXME: What about Apache? What dll/shared-object to be loaded?
- isapiVersion = GetLoadedModuleVersion("aspnet_isapi.dll");
- }
- }
- }
- return isapiVersion;
- }
- }
-
- internal static string ClrVersion
- {
- get
- {
- if(mscoreeVersion==null)
- {
- lock(lockObj)
- {
- if(mscoreeVersion==null)
- {
- mscoreeVersion = GetLoadedModuleVersion("mscorlib.dll");
- }
- }
- }
- return mscoreeVersion;
- }
- }
-
- internal static string SystemWebVersion
- {
- get
- {
- if(systemWebVersion == null)
- {
- lock(lockObj)
- {
- if(systemWebVersion==null)
- {
- systemWebVersion = (FileVersionInfo.GetVersionInfo((typeof(HttpRuntime)).Module.FullyQualifiedName)).FileVersion;
- }
- }
- }
- return systemWebVersion;
- }
- }
-
- [MonoTODO]
- internal static string GetLoadedModuleVersion(string modulename)
- {
- //TODO: Load the version information from the module
- // Needs native calls - which ones, since the module will not be .Net aware
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- internal static string GetLoadedModuleFilename(string modulename)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs b/mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs
deleted file mode 100644
index 6047a52688b..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/NativeFileChangeEventHandler.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: NativeFileChangeEventHandler
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-namespace System.Web.Utils
-{
- public delegate void NativeFileChangeEventHandler(object sender, int method);
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/UrlUtils.cs b/mcs/class/System.Web/System.Web.Utils/UrlUtils.cs
deleted file mode 100644
index 5da94a47ac6..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/UrlUtils.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * Namespace: System.Web.UI.Utils
- * Class: UrlUtils
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Collections;
-using System.Text;
-
-namespace System.Web.Utils
-{
- internal class UrlUtils
- {
- /*
- * I could not find these functions in the class System.Uri
- * Besides, an instance of Uri will not be formed until and unless the address is of
- * the form protocol://[user:pass]host[:port]/[fullpath]
- * ie, a protocol, and that too without any blanks before,
- * is a must which may not be the case here.
- * Important: Escaped URL is assumed here. nothing like .aspx?path=/something
- * It should be .aspx?path=%2Fsomething
- */
- public static string GetProtocol(string url)
- {
- //Taking code from Java Class java.net.URL
- if(url!=null)
- {
- if(url.Length>0)
- {
-
- int i, start = 0, limit;
- limit = url.Length;
- char c;
- bool aRef = false;
- while( (limit > 0) && (url[limit-1] <= ' '))
- {
- limit --;
- }
- while( (start < limit) && (url[start] <= ' '))
- {
- start++;
- }
- if(RegionMatches(true, url, start, "url:", 0, 4))
- {
- start += 4;
- }
- if(start < url.Length && url[start]=='#')
- {
- aRef = true;
- }
- for(i = start; !aRef && (i < limit) && ((c=url[i]) != '/'); i++)
- {
- if(c==':')
- {
- return url.Substring(start, i - start);
- }
- }
- }
- }
- return String.Empty;
- }
-
- public static bool IsRelativeUrl(string url)
- {
- if(url.IndexOf(':') != -1)
- return !IsRootUrl(url);
- return true;
- }
-
- public static bool IsRootUrl(string url)
- {
- if(url!=null)
- {
- if(url.Length>0)
- {
- return IsValidProtocol(GetProtocol(url).ToLower());
- }
- }
- return true;
- }
-
- public static bool IsRooted(string path)
- {
- if(path!=null && path.Length > 0)
- {
- return (path[0]=='/' || path[0]=='\\');
- }
- return false;
- }
-
- public static void FailIfPhysicalPath(string path)
- {
- if(path!= null && path.Length > 0)
- {
- if(path[0]==':' || path.StartsWith(@"\\"))
- throw new HttpException(HttpRuntime.FormatResourceString("Physical_path_not_allowed", path));
- }
- }
-
- public static string Combine(string basePath, string relPath)
- {
- FailIfPhysicalPath(relPath);
- if(IsRootUrl(relPath))
- {
- if(relPath != null && relPath.Length > 0)
- {
- return Reduce(relPath);
- }
- return String.Empty;
- }
- if(relPath.Length < 3 || relPath[0]!='~' || (relPath[0]!='/' && relPath[0]!='\\'))
- {
- if(basePath==null || basePath.Length==1 || basePath[0]=='/')
- basePath = String.Empty;
- return Reduce(basePath + "/" + relPath);
- }
- string vPath = HttpRuntime.AppDomainAppVirtualPath;
- if(vPath.Length <= 1)
- vPath = String.Empty;
- return Reduce(vPath + "/" + relPath.Substring(2));
- }
-
- public static bool IsValidProtocol(string protocol)
- {
- if(protocol.Length < 1)
- return false;
- char c = protocol[0];
- if(!Char.IsLetter(c))
- {
- return false;
- }
- for(int i=1; i < protocol.Length; i++)
- {
- c = protocol[i];
- if(!Char.IsLetterOrDigit(c) && c!='.' && c!='+' && c!='-')
- {
- return false;
- }
- }
- return true;
- }
-
- /*
- * MakeRelative("http://www.foo.com/bar1/bar2/file","http://www.foo.com/bar1")
- * will return "bar2/file"
- * while MakeRelative("http://www.foo.com/bar1/...","http://www.anotherfoo.com")
- * return 'null' and so does the call
- * MakeRelative("http://www.foo.com/bar1/bar2","http://www.foo.com/bar")
- */
- public static string MakeRelative(string fullUrl, string relativeTo)
- {
- if(fullUrl==relativeTo)
- {
- return String.Empty;
- }
- if(fullUrl.IndexOf(relativeTo)!=0)
- {
- return null;
- }
- string leftOver = fullUrl.Substring(relativeTo.Length);
- if(!fullUrl.EndsWith("/") && !leftOver.StartsWith("/"))
- {
- return null;
- }
- if(leftOver.StartsWith("/"))
- {
- leftOver = leftOver.Substring(1);
- }
- return leftOver;
- }
-
- /*
- * Check JavaDocs for java.lang.String#RegionMatches(bool, int, String, int, int)
- * Could not find anything similar in the System.String class
- */
- public static bool RegionMatches(bool ignoreCase, string source, int start, string match, int offset, int len)
- {
- if(source!=null || match!=null)
- {
- if(source.Length>0 && match.Length>0)
- {
- char[] ta = source.ToCharArray();
- char[] pa = match.ToCharArray();
- if((offset < 0) || (start < 0) || (start > (source.Length - len)) || (offset > (match.Length - len)))
- {
- return false;
- }
- while(len-- > 0)
- {
- char c1 = ta[start++];
- char c2 = pa[offset++];
- if(c1==c2)
- continue;
- if(ignoreCase)
- {
- if(Char.ToUpper(c1)==Char.ToUpper(c2))
- continue;
- // Check for Gregorian Calendar where the above may not hold good
- if(Char.ToLower(c1)==Char.ToLower(c2))
- continue;
- }
- return false;
- }
- return true;
- }
- }
- return false;
- }
-
- public static string Reduce(string path)
- {
- int len = path.Length;
- int dotIndex = -1;
- path = path.Replace('\\','/');
- while(true)
- {
- dotIndex++;
- dotIndex = path.IndexOf('.', dotIndex);
- if(dotIndex < 0)
- {
- return path;
- }
- if(dotIndex != 0 && path[dotIndex -1]=='/')
- continue;
- if(dotIndex+1 == len || path[dotIndex+1]=='/')
- break;
- if(path[dotIndex+1]=='.')
- continue;
- if(dotIndex+2 == len || path[dotIndex+2]=='/')
- break;
- }
- ArrayList list = new ArrayList();
- StringBuilder sb = new StringBuilder();
- dotIndex = 0;
- int temp;
- do
- {
- temp = dotIndex;
- dotIndex = path.IndexOf('/', temp + 1);
- if(dotIndex < 0)
- dotIndex = len;
- if( (dotIndex - temp) <= 3 && (dotIndex < 1 || path[dotIndex - 1]== '.') && ( (temp+1) >= len || path[temp+1]=='.') )
- {
- if(dotIndex - temp == 3)
- continue;
- if(list.Count == 0)
- throw new System.Web.HttpException(System.Web.HttpRuntime.FormatResourceString("Cannot_exit_up_top_directory"));
- sb.Length = (int) list[list.Count - 1];
- list.RemoveRange(list.Count - 1, 1);
- continue;
- }
- list.Add(sb.Length);
- sb.Append(path, temp, dotIndex - temp);
- } while(dotIndex != len);
- return sb.ToString();
- }
-
- public static string GetDirectory(string url)
- {
- if(url==null)
- {
- return null;
- }
- if(url.Length==0)
- {
- return String.Empty;
- }
- url.Replace('\\','/');
- string baseDir = url.Substring(0, url.LastIndexOf('/'));
- if(baseDir.Length==0)
- {
- baseDir = "/";
- }
- return baseDir;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs b/mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs
deleted file mode 100644
index ee570dd34c6..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/WebEqualComparer.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Namespace: System.Web.Utils
- * Class: WebEqualComparer
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: ??%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.Globalization;
-using System.Collections;
-
-namespace System.Web.Utils
-{
- public class WebEqualComparer : IComparer
- {
- private static IComparer defC;
-
- public WebEqualComparer()
- {
- }
-
- public static IComparer Default
- {
- get
- {
- if(defC == null)
- {
- defC = new WebEqualComparer();
- }
- return defC;
- }
- }
-
- /// <summary>
- /// To compare two strings
- /// </summary>
- /// <remarks>
- /// Cannot apply String.Compare(..) since I am at web
- /// </remarks>
- int IComparer.Compare(object left, object right)
- {
- string leftStr, rightStr;
- leftStr = null;
- rightStr = null;
- if(left is string)
- {
- leftStr = (string)left;
- }
- if(right is string)
- {
- rightStr = (string)right;
- }
-
- if(leftStr==null || rightStr==null)
- {
- throw new ArgumentException();
- }
-
- int ll = leftStr.Length;
- int lr = rightStr.Length;
- if(ll==0 && lr==0)
- {
- return 0;
- }
-
- if(ll==0 || lr==0)
- {
- return ( (ll > 0) ? 1 : -1);
- }
-
- char cl,cr;
- int i=0;
- for(i=0; i < leftStr.Length; i++)
- {
- if(i==lr)
- {
- return 1;
- }
- cl = leftStr[i];
- cr = leftStr[i];
- if(cl==cr)
- {
- continue;
- }
- UnicodeCategory ucl = Char.GetUnicodeCategory(cl);
- UnicodeCategory ucr = Char.GetUnicodeCategory(cr);
- if(ucl==ucr)
- {
- return ( (cl > cr) ? 1 : -1 );
- }
- cl = Char.ToLower(cl);
- cr = Char.ToLower(cr);
- if(cl!=cr)
- {
- return ( (cl > cr) ? 1 : -1);
- }
- }
- return ( (i==lr) ? 0 : -1 );
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs b/mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs
deleted file mode 100644
index a2db4a4577f..00000000000
--- a/mcs/class/System.Web/System.Web.Utils/WebHashCodeProvider.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
-
- * Namespace: System.Web.Utils
- * Class: WebHashCodeProvider
- *
-
- * Author: Gaurav Vaish
-
- * Maintainer: gvaish@iitk.ac.in
-
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
-
- * Implementation: yes
-
- * Status: ??%
-
- *
-
- * (C) Gaurav Vaish (2001)
-
- */
-
-
-using System.Collections;
-using System.Globalization;
-
-namespace System.Web.Utils
-{
- public class WebHashCodeProvider : IHashCodeProvider
- {
- private static IHashCodeProvider defHcp;
-
- public WebHashCodeProvider()
- {
- }
-
- int IHashCodeProvider.GetHashCode(object key)
- {
- return Default.GetHashCode(key);
- }
-
- public static IHashCodeProvider Default
- {
- get
- {
- if(defHcp==null)
- {
- defHcp = new CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture);
- }
- return defHcp;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web.build b/mcs/class/System.Web/System.Web.build
deleted file mode 100644
index 7d5bb1ef884..00000000000
--- a/mcs/class/System.Web/System.Web.build
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.Web.dll -->
-
-<project name="System" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/System.Web.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0169"/>
- <arg value="/nowarn:0679"/> <!-- internal virual -->
- <arg value="/nowarn:0168"/> <!-- never used variable -->
- <arg value="/nowarn:0162"/> <!-- unreachable code -->
- <arg value="/unsafe"/>
- <arg value="/noconfig"/>
- <arg value="/debug"/>
- <arg value="/r:System.dll"/>
- <arg value="/r:System.Drawing.dll"/>
- <arg value="/r:System.Xml.dll"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <includes name="System.Web.Hosting/ApplicationHost.cs"/>
- <includes name="System.Web.Hosting/SimpleWorkerRequest.cs.cs"/>
- <excludes name="System.Web.Hosting/ISAPIRuntime.cs"/>
- <excludes name="System.Web.Hosting/IISAPIRuntime.cs"/>
- <excludes name="System.Web.Hosting/IAppDomainFactory.cs"/>
- <excludes name="System.Web.Hosting/AppDomainFactory.cs"/>
- <!--<excludes name="System.Web.UI/**"/>-->
- <!--<excludes name="System.Web.UI.HtmlControls/**"/>-->
- <!--<excludes name="System.Web.UI.WebControls/**"/>-->
- <excludes name="System.Web/HttpCacheValidateHandler.cs"/>
- </sources>
- </csc>
- </target>
-</project>
diff --git a/mcs/class/System.Web/System.Web/.cvsignore b/mcs/class/System.Web/System.Web/.cvsignore
deleted file mode 100644
index 04bc145deea..00000000000
--- a/mcs/class/System.Web/System.Web/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-_*
diff --git a/mcs/class/System.Web/System.Web/BeginEventHandler.cs b/mcs/class/System.Web/System.Web/BeginEventHandler.cs
deleted file mode 100644
index c2bd1ac2782..00000000000
--- a/mcs/class/System.Web/System.Web/BeginEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.BeginEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public delegate IAsyncResult BeginEventHandler(object sender,
- EventArgs e,
- AsyncCallback cb,
- object extraData);
-}
diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog
deleted file mode 100644
index a71d4b8a489..00000000000
--- a/mcs/class/System.Web/System.Web/ChangeLog
+++ /dev/null
@@ -1,173 +0,0 @@
-2002-06-10 Duncan Mak <duncan@ximian.com>
-
- * HttpBrowserCapabilities.cs (BackgroundSounds): Fixed typo.
-
-2002-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpRequest.cs: implemented Browser property.
-
-2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * HttpBrowserCapabilities.cs: stubbed out.
-
-2002-05-18 Miguel de Icaza <miguel@ximian.com>
-
- * HttpRuntime.cs: Reformat file.
-
-2002-05-07 Duncan Mak <duncan@ximian.com>
-
- * HttpBrowserCapabilities.cs: Added, replacing
- HttpBrowserCapabilites because of typo.
-
- * HttpBrowserCapabilites.cs: Removed, replaced by above.
-
- * HttpRequest.cs (Browser): Fixed typo.
-
-2002-04-12 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * HttpApplication.cs: Minor updates
- * HttpApplicationState.cs: Ready.
- * HttpClientCertificate.cs: Signature updates
- * HttpValueCollection.cs: ready
- * HttpStaticObjectsCollection.cs: ready
- * HttpResponseHeader.cs: made internal only
- * HttpResponse.cs: Signature updates
- * HttpPostedFile.cs: ready
- * HttpCacheVaryByHeaders.cs: ready (except communication to policy)
- * HttpCacheVaryByParams.cs: ready (except communication to policy)
-
- System.Web is now over 60% ready..
-
-2002-04-11 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * HttpException.cs: 95% ready, only windows dependent code left
- * HttpFileCollection.cs: Finished.
- * HttpRequest.cs: Minor fixes and fixed signature problems
- * HttpResponse.cs: Implementation of missing methods and signature problems
- * HttpResponseHeader.cs: Fixed signature problems
- * HttpRuntime.cs: Fixed signature problems
- * HttpServerUtility.cs: Added support for HttpApplication
- * HttpSessionState.cs: Fixed signature issues
- * HttpUtility.cs: fixed signature issues
- * HttpValueCollection.cs: Support for cookie parsing and fixed signature issues
- * HttpWorkerRequest.cs: Fixed small signature issue
- * HttpWriter.cs: Fixed signature issue
- * HttpApplication.cs: Basic implementation
- * HttpApplicationState.cs: Small fixes to support major change comming up
- * HttpBrowserCapabilities.cs: Added Type method
- * HttpClientCertificate.cs: Almost ready, needs to parse certificate.
- * HttpContext.cs: Fixed signature issues and added last methods.
- * HttpCookie.cs: Full implementation
- * HttpCookieCollection.cs: Full implementation
- * TraceContext.cs: Methods implemented.
- * HttpPostedFile.cs: Placeholder
- * HttpStaticObjectsCollection.cs: Placeholder
- * HttpModuleCollection.cs: Ready, will be used during the major revamp.
-
- * Fixed a number of other small signature problems also (class status page)
-
-
-2002-04-10 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * HttpWorkerRequest.EndOfSendNotification.cs Removed (included in WorkerRequest)
- * Checkin of all new files (noted in last changenote)
-
-2002-04-10 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * HttpContext.cs: First implementation (basic support, few methods left to impl)
- * HttpException.cs: Partial implementation (basic support)
- * HttpHelper.cs: Header parse helper, used by runtime (non public)
- * HttpRequest.cs: Implementation (all methods there, not all fully impl)
- * HttpRequestStream.cs: Full implementation
- * HttpResponse.cs: Partial implementation(almost all methods)
- * HttpResponseHeader.cs: Header helper
- * HttpResponseStream.cs: Full implementation - Response stream support
- * HttpResponseStreamProxy.cs: Implementation - filter support
- * HttpRuntime.cs: Rewrite to support one IHttpModule (use for testing the runtime)
- * HttpServerUtility.cs: Implemented usage of HttpContext for methods
- and moved encoding functions to HttpUtility.
-
- * HttpUtility.cs: Added encoding/decoding functions from HttpServerUtility and
- added the Attribute encoding functions.
-
- * HttpValueCollection.cs: Implementation.
- * HttpWorkerRequest.cs: Rewrite and implementation of all methods (ready)
- * HttpWriter.cs: Implementation (with filter support)
-
- * HttpFileCollection: Added dummy class (placeholder)
- * HttpApplication.cs: Added dummy class (placeholder)
- * HttpApplicationState.cs: Added dummy class (placeholder)
- * HttpBrowserCapabilities.cs: Added dummy class (placeholder)
- * HtttpCachePolicy.cs: Added dummy class (placeholder)
- * HttpClientCertificate.cs: Added dummy class (placeholder)
- * HttpSessionState.cs: Added dummy class (placeholder)
- * TraceContext.cs: Added dummy class (placeholder)
-
-
-2002/04/10 Nick Drochak <ndrochak@gol.com>
-
- * HttpServerUtility.cs: Fix build breaker.
-
-2002-03-28 Wictor Wilén <wictor@iBizkit.se>
-
- * HttpServerUtils.cs : Added some more functionality
-
-2002-03-28 Martin Baulig <martin@gnome.org>
-
- * HttpServerUtils.cs (UrlDecode): You cannot implicitly cast a
- char to a string, use ToString() instead.
-
-2002-03-16 Gaurav Vaish <gavish@iitk.ac.in>
-
- * WebCategoryAttribute.cs
- : Added private attribute.
-
-2002-03-16 Gaurav Vaish <gavish@iitk.ac.in>
-
- * HttpRuntime.cs : Stubbed methods for
- FormatStringResource(...) in agreement with the various
- overloads available at String.Format(...)
-
-2002-01-08 Gaurav Vaish <gavish@iitk.ac.in>
-
- * TODOAttribute.cs : Added, as an internal class to the assembly
-
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * HttpRuntime.cs: remove uneeded exception variable from catch and
- initialize remaining instance members to avoid compile warnings
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * HttpRuntime.cs: fix spelling error/variable name change.
-
-2001-12-18 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * HttpRuntime.cs : Initial implementation
-
-2001-08-29 Bob Smith <bob@thestuff.net>
-
- * HttpWorkerRequest.cs: Partial Implementation.
-
-2001-08-16 Bob Smith <bob@thestuff.net>
-
- * HttpCookieCollection.cs, HttpCookie.cs: Bug fixes.
-
-2001-08-09 Bob Smith <bob@thestuff.net>
-
- * BeginEventHandler.cs: Implemented.
- * EndEventHandler.cs: Implemented.
- * HttpCacheability.cs: Implemented.
- * HttpCacheRevalidation.cs: Implemented.
- * HttpCacheValidateHandler.cs: Implemented.
- * HttpCookieCollection.cs: Implemented.
- * HttpCookie.cs: Implemented.
- * HttpValidationStatus.cs: Implemented.
- * HttpWorkerRequest.EndOfSendNotification.cs: Implemented.
- * IHttpAsyncHandler.cs: Implemented.
- * IHttpHandler.cs: Implemented.
- * IHttpHandlerFactory.cs: Implemented.
- * IHttpModule.cs: Implemented.
- * ProcessShutdownReason.cs: Implemented.
- * ProcessStatus.cs: Implemented.
- * TraceMode.cs: Implemented.
diff --git a/mcs/class/System.Web/System.Web/EndEventHandler.cs b/mcs/class/System.Web/System.Web/EndEventHandler.cs
deleted file mode 100644
index cd7a51c222a..00000000000
--- a/mcs/class/System.Web/System.Web/EndEventHandler.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// System.Web.EndEventHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public delegate void EndEventHandler(IAsyncResult ar);
-}
diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs
deleted file mode 100644
index 21a20a1c1d6..00000000000
--- a/mcs/class/System.Web/System.Web/HttpApplication.cs
+++ /dev/null
@@ -1,163 +0,0 @@
- //
-// System.Web.HttpApplication
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.ComponentModel;
-
-namespace System.Web {
- [MonoTODO()]
- public class HttpApplication : IHttpAsyncHandler, IHttpHandler, IComponent, IDisposable {
- private bool _CompleteRequest;
-
- private HttpContext _Context;
- private HttpContext _OverrideContext;
-
- private bool _InPreRequestResponseMode;
-
- private ISite _Site;
- private HttpModuleCollection _ModuleCollection;
- private HttpSessionState _Session;
-
- public event EventHandler AcquireRequestState;
- public event EventHandler AuthenticateRequest;
- public event EventHandler AuthorizeRequest;
- public event EventHandler BeginRequest;
- public event EventHandler Disposed;
- public event EventHandler EndRequest;
- public event EventHandler Error;
- public event EventHandler PostRequestHandlerExecute;
- public event EventHandler PreRequestHandlerExecute;
- public event EventHandler PreSendRequestContent;
- public event EventHandler PreSendRequestHeaders;
- public event EventHandler ReleaseRequestState;
- public event EventHandler ResolveRequestCache;
- public event EventHandler UpdateRequestCache;
-
- [MonoTODO()]
- public HttpApplication() {
- // Init HTTP context and the methods from HttpRuntime....
- }
-
- internal void ClearError() {
- // Called from Server Utility
- }
-
- public HttpContext Context {
- get {
- if (null != _OverrideContext) {
- return _OverrideContext;
- }
-
- return _Context;
- }
- }
-
- public HttpModuleCollection Modules {
- get {
- if (null == _ModuleCollection) {
- _ModuleCollection = new HttpModuleCollection();
- }
-
- return _ModuleCollection;
- }
- }
-
- public HttpRequest Request {
- get {
- if (null != _Context && (!_InPreRequestResponseMode)) {
- return _Context.Request;
- }
-
- throw new HttpException("Cant get request object");
- }
- }
-
- public HttpResponse Response {
- get {
- if (null != _Context && (!_InPreRequestResponseMode)) {
- return _Context.Response;
- }
-
- throw new HttpException("Cant get response object");
- }
- }
-
- public HttpServerUtility Server {
- get {
- if (null != _Context) {
- return _Context.Server;
- }
-
- return new HttpServerUtility(this);
- }
- }
-
- public HttpSessionState Session {
- get {
- if (null != _Session) {
- return _Session;
- }
-
- if (null != _Context && null != _Context.Session) {
- return _Context.Session;
- }
-
- throw new HttpException("Failed to get session object");
- }
- }
-
- public virtual string GetVaryByCustomString(HttpContext context, string custom) {
- if (custom.ToLower() == "browser") {
- return context.Request.Browser.Type;
- }
-
- return string.Empty;
- }
-
- [MonoTODO()]
- IAsyncResult IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- void IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- void IHttpHandler.ProcessRequest(HttpContext context) {
- throw new NotImplementedException();
- }
-
- bool IHttpHandler.IsReusable {
- get {
- throw new NotImplementedException();
- }
- }
-
- public ISite Site {
- get {
- return _Site;
- }
-
- set {
- _Site = value;
- }
- }
-
- public void CompleteRequest() {
- _CompleteRequest = true;
- }
-
- [MonoTODO("Cleanup")]
- public virtual void Dispose() {
-
- }
-
- public virtual void Init() {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpApplicationState.cs b/mcs/class/System.Web/System.Web/HttpApplicationState.cs
deleted file mode 100644
index 6131f07c776..00000000000
--- a/mcs/class/System.Web/System.Web/HttpApplicationState.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-//
-// System.Web.HttpApplicationState
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Threading;
-using System.Web;
-using System.Collections.Specialized;
-
-namespace System.Web {
-
- [MonoTODO("Performance - Use SWMR lock here")]
- public sealed class HttpApplicationState : NameObjectCollectionBase {
- private HttpStaticObjectsCollection _AppObjects;
- private HttpStaticObjectsCollection _SessionObjects;
-
- // TODO : Change to ReadWriteLock when ready
- private Mutex _Lock;
-
- private void LockRead() {
- Monitor.Enter(this);
- }
-
- private void LockWrite() {
- Monitor.Enter(this);
- }
-
- private void UnlockRead() {
- Monitor.Exit(this);
- }
-
- private void UnlockWrite() {
- Monitor.Exit(this);
- }
-
- internal HttpApplicationState() {
- _AppObjects = new HttpStaticObjectsCollection();
- _SessionObjects = new HttpStaticObjectsCollection();
- _Lock = new Mutex();
- }
-
- internal HttpApplicationState(HttpStaticObjectsCollection AppObj, HttpStaticObjectsCollection SessionObj) {
- if (null != AppObj) {
- _AppObjects = AppObj;
- } else {
- _AppObjects = new HttpStaticObjectsCollection();
- }
-
- if (null != SessionObj) {
- _SessionObjects = SessionObj;
- } else {
- _SessionObjects = new HttpStaticObjectsCollection();
- }
- _Lock = new Mutex();
- }
-
- public void Add(string name, object value) {
-
- LockWrite();
- try {
- BaseAdd(name, value);
- }
- finally {
- UnlockWrite();
- }
- }
-
- public void Clear() {
-
- LockWrite();
- try {
- BaseClear();
- }
- finally {
- UnlockWrite();
- }
- }
-
- public object Get(string name) {
- object ret = null;
-
- LockRead();
- try {
- ret = BaseGet(name);
- }
- finally {
- UnlockRead();
- }
-
- return ret;
- }
-
- public object Get(int index) {
- object ret = null;
-
- LockRead();
- try {
- ret = BaseGet(index);
- }
- finally {
- UnlockRead();
- }
-
- return ret;
- }
-
- public string GetKey(int index) {
- string ret = null;
-
- LockRead();
- try {
- ret = BaseGetKey(index);
- }
- finally {
- UnlockRead();
- }
-
- return ret;
- }
-
- public void Lock() {
- LockWrite();
- }
-
- public void Remove(string name) {
- LockWrite();
- try {
- BaseRemove(name);
- }
- finally {
- UnlockWrite();
- }
- }
-
- public void RemoveAll() {
- Clear();
- }
-
- public void RemoveAt(int index) {
- LockWrite();
- try {
- BaseRemoveAt(index);
- }
- finally {
- UnlockWrite();
- }
- }
-
- public void Set(string name, object value) {
- LockWrite();
- try {
- BaseSet(name, value);
- }
- finally {
- UnlockWrite();
- }
- }
-
- public void UnLock() {
- UnlockWrite();
- }
-
- public string [] AllKeys {
- get {
- string [] ret = null;
-
- LockRead();
- try {
- ret = BaseGetAllKeys();
- }
- finally {
- UnlockRead();
- }
-
- return ret;
- }
- }
-
- public HttpApplicationState Contents {
- get {
- return this;
- }
- }
-
- override public int Count {
- get {
- int ret = 0;
-
- LockRead();
- try {
- ret = base.Count;
- }
- finally {
- UnlockRead();
- }
-
- return ret;
- }
- }
-
- public object this[string name] {
- get {
- return Get(name);
- }
- set {
- Set(name, value);
- }
- }
-
- public object this[int index] {
- get {
- return Get(index);
- }
- }
-
- // ASP Session based objects
- internal HttpStaticObjectsCollection SessionObjects {
- get {
- return _SessionObjects;
- }
- }
-
- // ASP App based objects
- public HttpStaticObjectsCollection StaticObjects {
- get {
- return _AppObjects;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpBrowserCapabilities.cs b/mcs/class/System.Web/System.Web/HttpBrowserCapabilities.cs
deleted file mode 100755
index a22567bdcfd..00000000000
--- a/mcs/class/System.Web/System.Web/HttpBrowserCapabilities.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-//
-// System.Web.HttpBrowserCapabilities
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-using System;
-using System.Web.Configuration;
-
-namespace System.Web {
-public class HttpBrowserCapabilities : HttpCapabilitiesBase
-{
- public HttpBrowserCapabilities()
- {
- }
-
- public bool ActiveXControls
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public bool AOL
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public bool BackgroundSounds
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public bool Beta
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public string Browser
- {
- get { return "Not Implemented"; }
- }
-
- [MonoTODO()]
- public bool CDF
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public Version ClrVersion
- {
- get { return new Version (0, 0); }
- }
-
- [MonoTODO()]
- public bool Cookies
- {
- get { return true; }
- }
-
- [MonoTODO()]
- public bool Crawler
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public Version EcmaScriptVersion
- {
- get { return new Version (0, 0); }
- }
-
- [MonoTODO()]
- public bool Frames
- {
- get { return true; }
- }
-
- [MonoTODO()]
- public bool JavaApplets
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public bool JavaScript
- {
- get { return true; }
- }
-
- [MonoTODO()]
- public int MajorVersion
- {
- get { return 0; }
- }
-
- [MonoTODO()]
- public double MinorVersion
- {
- get { return 0.0; }
- }
-
- [MonoTODO()]
- public Version MSDomVersion
- {
- get { return new Version (0, 0); }
- }
-
- [MonoTODO()]
- public string Platform
- {
- get { return "mono::"; }
- }
-
- [MonoTODO()]
- public bool Tables
- {
- get { return true; }
- }
-
- [MonoTODO()]
- public string Type
- {
- get { return "4"; }
- }
-
- [MonoTODO()]
- public bool VBScript
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public string Version
- {
- get { return "4.0"; }
- }
-
- [MonoTODO()]
- public bool Win16
- {
- get { return false; }
- }
-
- [MonoTODO()]
- public bool Win32
- {
- get { return true; }
- }
-
-
-
-}
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCachePolicy.cs b/mcs/class/System.Web/System.Web/HttpCachePolicy.cs
deleted file mode 100644
index da3059ea32c..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCachePolicy.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Web.HttpCachePolicy
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-
-namespace System.Web {
- public sealed class HttpCachePolicy {
- internal HttpCachePolicy() {
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs b/mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs
deleted file mode 100644
index 5425d5ebc56..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheRevalidation.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.HttpCacheRevalidation.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web {
- public enum HttpCacheRevalidation {
- AllCaches,
- None,
- ProxyCaches
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs b/mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs
deleted file mode 100644
index 032aea39f6f..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheValidateHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.HttpCacheValidateHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public delegate void HttpCacheValidateHandler(
- HttpContext context,
- object data,
- ref HttpValidationStatus validationStatus);
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCacheVaryByHeaders.cs b/mcs/class/System.Web/System.Web/HttpCacheVaryByHeaders.cs
deleted file mode 100644
index 93ee07a0afe..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheVaryByHeaders.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// System.Web.HttpCacheVaryByHeaders
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections;
-
-namespace System.Web {
- public sealed class HttpCacheVaryByHeaders {
- private Hashtable _Items;
- private bool _Dirty;
- private bool _Wildcard;
-
- // TODO: We need internal methods here to communicate with CachePolicy
-
- internal HttpCacheVaryByHeaders() {
- }
-
- public void VaryByUnspecifiedParameters() {
- _Dirty = true;
- _Wildcard = true;
- _Items = null;
- }
-
- public bool AcceptTypes {
- get {
- return this["Accept"];
- }
-
- set {
- this["Accept"] = value;
- }
- }
-
- public bool this[string header] {
- get {
- if (null == header) {
- throw new ArgumentNullException("header");
- }
-
- if (header == "*") {
- return _Wildcard;
- }
-
- if (null != _Items) {
- return _Items.ContainsKey(header);
- }
-
- return false;
- }
-
- set {
- if (null == header) {
- throw new ArgumentNullException("header");
- }
-
- if (!(value)) {
- return;
- }
-
- _Dirty = true;
-
- if (header == "*") {
- VaryByUnspecifiedParameters();
- return;
- }
-
- if (!_Wildcard) {
- if (null == _Items) {
- _Items = new Hashtable();
- }
-
- _Items[header] = true;
- }
- }
- }
-
- public bool UserAgent {
- get {
- return this["User-Agent"];
- }
-
- set {
- this["User-Agent"] = value;
- }
- }
-
- public bool UserCharSet {
- get {
- return this["Accept-Charset"];
- }
-
- set {
- this["Accept-Charset"] = value;
- }
- }
-
- public bool UserLanguage {
- get {
- return this["Accept-Language"];
- }
-
- set {
- this["Accept-Language"] = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs b/mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs
deleted file mode 100644
index 057ae081d7e..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// System.Web.HttpCacheVaryByParams
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections;
-
-namespace System.Web {
- public sealed class HttpCacheVaryByParams {
- private Hashtable _Items;
- private bool _IgnoreParams;
- private bool _Wildcard;
- private bool _Dirty;
-
- // TODO: We need internal methods here to communicate with CachePolicy
-
- internal HttpCacheVaryByParams() {
- }
-
- public bool IgnoreParams {
- get {
- return _IgnoreParams;
- }
-
- set {
- if (_Wildcard || null != _Items) {
- return;
- }
-
- _Dirty = true;
- _IgnoreParams = value;
- }
- }
-
- public bool this[string header] {
- get {
- if (null == header) {
- throw new ArgumentNullException("header");
- }
-
- if (header == "*") {
- return _Wildcard;
- }
-
- if (null != _Items) {
- return _Items.ContainsKey(header);
- }
-
- return false;
- }
-
- set {
- if (null == header) {
- throw new ArgumentNullException("header");
- }
-
- if (!(value)) {
- return;
- }
-
- _Dirty = true;
-
- if (header == "*") {
- _Wildcard = true;
- _Items = null;
- return;
- }
-
- if (!_Wildcard) {
- if (null == _Items) {
- _Items = new Hashtable();
- }
-
- _Items[header] = true;
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCacheability.cs b/mcs/class/System.Web/System.Web/HttpCacheability.cs
deleted file mode 100644
index cd5d3861239..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCacheability.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Web.HttpCacheability.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web {
- public enum HttpCacheability {
- NoCache,
- Private,
- Public,
- Server
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/HttpClientCertificate.cs b/mcs/class/System.Web/System.Web/HttpClientCertificate.cs
deleted file mode 100644
index 4ffc12c0cd8..00000000000
--- a/mcs/class/System.Web/System.Web/HttpClientCertificate.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// System.Web.HttpClientCertificate
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Web;
-using System.Collections.Specialized;
-
-namespace System.Web {
- [MonoTODO()]
- public class HttpClientCertificate : NameValueCollection {
- private HttpContext _Context;
- private byte [] _BinaryIssuer;
- private int _CertEncoding;
- private byte [] _Certificate;
- private string _Cookie;
- private int _Flags;
- private string _Issuer;
- private int _KeySize;
- private byte [] _PublicKey;
- private int _SecretKeySize;
- private string _SerialNumber;
- private string _ServerIssuer;
- private string _ServerSubject;
- private string _Subject;
-
- private DateTime _ValidFrom;
- private DateTime _ValidTo;
-
- [MonoTODO("Decode ceritificate from Server variables.. CGI standard?")]
- internal HttpClientCertificate(HttpContext Context) {
- _Context = Context;
- _Flags = 0;
- }
-
- public byte [] BinaryIssuer {
- get {
- return _BinaryIssuer;
- }
- }
-
- public int CertEncoding {
- get {
- return _CertEncoding;
- }
- }
-
- public byte [] Certificate {
- get {
- return _Certificate;
- }
- }
-
- public string Cookie {
- get {
- return _Cookie;
- }
- }
-
- public int Flags {
- get {
- return _Flags;
- }
- }
-
- [MonoTODO()]
- public bool IsPresent {
- get {
- return false;
- }
- }
-
- public string Issuer {
- get {
- return _Issuer;
- }
- }
-
- [MonoTODO()]
- public bool IsValid {
- get {
- return false;
- }
- }
-
- public int KeySize {
- get {
- return _KeySize;
- }
- }
-
- public byte [] PublicKey {
- get {
- return _PublicKey;
- }
- }
-
- public int SecretKeySize {
- get {
- return _SecretKeySize;
- }
- }
-
- public string SerialNumber {
- get {
- return _SerialNumber;
- }
- }
-
- public string ServerIssuer {
- get {
- return _ServerIssuer;
- }
- }
-
- public string ServerSubject {
- get {
- return _ServerSubject;
- }
- }
-
- public string Subject {
- get {
- return _Subject;
- }
- }
-
- public DateTime ValidFrom {
- get {
- return _ValidFrom;
- }
- }
-
- public DateTime ValidUntil {
- get {
- return ValidUntil;
- }
- }
-
- [MonoTODO()]
- public override string Get(string s) {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpContext.cs b/mcs/class/System.Web/System.Web/HttpContext.cs
deleted file mode 100644
index 4e6ca908acd..00000000000
--- a/mcs/class/System.Web/System.Web/HttpContext.cs
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// System.Web.HttpContext
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections;
-using System.Security.Principal;
-using System.Web.Caching;
-using System.Threading;
-
-namespace System.Web {
- [MonoTODO("HttpContext - Should also keep the script timeout info")]
- public sealed class HttpContext : IServiceProvider {
- private Exception [] _arrExceptions;
-
- private HttpResponse _oResponse;
- private HttpRequest _oRequest;
- private HttpServerUtility _Server;
- private HttpApplication _oApplication;
- private IHttpHandler _Handler;
- private IPrincipal _User;
-
- private Hashtable _oItems;
- private DateTime _oTimestamp;
-
- public HttpContext(HttpRequest Request, HttpResponse Response) {
- Context = this;
-
- _arrExceptions = null;
- _oItems = null;
- _oTimestamp = DateTime.Now;
- _oRequest = Request;
- _oResponse = Response;
- }
-
- public HttpContext(HttpWorkerRequest WorkerRequest) {
- Context = this;
-
- _arrExceptions = null;
- _oItems = null;
- _oTimestamp = DateTime.Now;
- _oRequest = new HttpRequest(WorkerRequest, this);
- _oResponse = new HttpResponse(WorkerRequest, this);
- }
-
- [MonoTODO("Context - Use System.Remoting.Messaging.CallContext instead of Thread storage")]
- internal static HttpContext Context {
- get {
- return (HttpContext) Thread.GetData(Thread.GetNamedDataSlot("Context"));
- }
-
- set {
- Thread.SetData(Thread.GetNamedDataSlot("Context"), value);
- }
- }
-
- public Exception [] AllErrors {
- get {
- return _arrExceptions;
- }
- }
-
- [MonoTODO("HttpApplicationState Application")]
- public HttpApplicationState Application {
- get {
- // Should get the state from a app factory (or the app it self) static method?
- throw new NotImplementedException();
- }
- }
-
- public HttpApplication ApplicationInstance {
- get {
- return _oApplication;
- }
- set {
- _oApplication = value;
- }
- }
-
- [MonoTODO("HttpCache Cache")]
- public Cache Cache {
- get {
- // Get the cache from the runtime
- throw new NotImplementedException();
- }
- }
-
- public static HttpContext Current {
- get {
- return Context;
- }
- }
-
- public Exception Error {
- get {
- if (_arrExceptions == null) {
- return null;
- }
- else {
- return _arrExceptions[0];
- }
- }
- }
-
- public IHttpHandler Handler {
- get {
- return _Handler;
- }
-
- set {
- _Handler = value;
- }
- }
-
- [MonoTODO("bool IsCustomErrorEnabled")]
- public bool IsCustomErrorEnabled {
- get {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO("bool IsDebuggingEnabled")]
- public bool IsDebuggingEnabled {
- get {
- throw new NotImplementedException();
- }
- }
-
- public IDictionary Items {
- get {
- if (_oItems == null) {
- _oItems = new Hashtable();
- }
-
- return _oItems;
- }
- }
-
- public HttpRequest Request {
- get {
- return _oRequest;
- }
- }
-
- public HttpResponse Response {
- get {
- return _oResponse;
- }
- }
-
- public HttpServerUtility Server {
- get {
- if (null == _Server) {
- _Server = new HttpServerUtility(this);
- }
-
- return _Server;
- }
- }
-
- [MonoTODO("HttpSessionState Session")]
- public HttpSessionState Session {
- get {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO("bool SkipAuthorization")]
- public bool SkipAuthorization {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- public DateTime Timestamp {
- get {
- return _oTimestamp;
- }
- }
-
- [MonoTODO("TraceContext Trace")]
- public TraceContext Trace {
- get {
- // TODO: Should be initialized in the constructor (holds current trace)
- throw new NotImplementedException();
- }
- }
-
- public IPrincipal User {
- get {
- return _User;
- }
- set {
- // TODO: Should check security (ControlPrincipal flag)
- _User = value;
- }
- }
-
- public void AddError(Exception errorInfo) {
- int iSize;
-
- if (_arrExceptions == null) {
- iSize = 1;
- }
- else {
- iSize = _arrExceptions.Length + 1;
- }
-
- Exception [] arrNew = new Exception[iSize];
-
- _arrExceptions.CopyTo(arrNew, 0);
- _arrExceptions = arrNew;
-
- _arrExceptions[iSize - 1] = errorInfo;
- }
-
- public void ClearError() {
- _arrExceptions = null;
- }
-
- [MonoTODO("GetConfig(string name)")]
- public object GetConfig(string name) {
- throw new NotImplementedException();
- }
-
- [MonoTODO("GetAppConfig(string name)")]
- public static object GetAppConfig(string name) {
- throw new NotImplementedException();
- }
-
- [MonoTODO("IServiceProvider.GetService(Type service)")]
- object IServiceProvider.GetService(Type service) {
- throw new NotImplementedException();
- }
-
- [MonoTODO("void RewritePath(string path)")]
- public void RewritePath(string Path) {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCookie.cs b/mcs/class/System.Web/System.Web/HttpCookie.cs
deleted file mode 100644
index f53cdc7ce94..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCookie.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-//
-// System.Web.HttpCookie
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Text;
-using System.Web;
-using System.Collections.Specialized;
-
-namespace System.Web {
- public sealed class HttpCookie {
- private string _Name;
- private string _Value;
- private string _Domain;
- private DateTime _Expires;
- private bool _ExpiresSet;
- private string _Path;
- private bool _Secure = false;
-
- private HttpValueCollection _Values;
-
- internal HttpCookie() {
- _Path = "/";
- }
-
- public HttpCookie(string name) {
- _Path = "/";
- _Name = name;
- }
-
- public HttpCookie(string name, string value) {
- _Name = name;
- _Value = value;
- }
-
- HttpResponseHeader GetCookieHeader() {
- StringBuilder oSetCookie = new StringBuilder();
-
- if (null != _Name && _Name.Length > 0) {
- oSetCookie.Append(_Name);
- oSetCookie.Append("=");
- }
-
- if (null != _Values) {
- oSetCookie.Append(_Values.ToString(false));
- } else if (null != _Value) {
- oSetCookie.Append(_Value);
- }
-
- if (null != _Domain && _Domain.Length > 0) {
- oSetCookie.Append("; domain=");
- oSetCookie.Append(_Domain);
- }
-
- if (null != _Path && Path.Length > 0) {
- oSetCookie.Append("; path=");
- oSetCookie.Append(_Path);
- }
-
- if (_Secure) {
- oSetCookie.Append("; secure");
- }
-
- return new HttpResponseHeader(HttpWorkerRequest.HeaderSetCookie, oSetCookie.ToString());
- }
-
- public string Domain {
- get {
- return _Domain;
- }
- set {
- _Domain = value;
- }
- }
-
- public DateTime Expires {
- get {
- if (!_ExpiresSet) {
- return DateTime.MinValue;
- }
-
- return _Expires;
- }
-
- set {
- _ExpiresSet = true;
- _Expires = value;
- }
- }
-
- public bool HasKeys {
- get {
- return Values.HasKeys();
- }
- }
-
- public string this[string key] {
- get {
- return Values[key];
- }
-
- set {
- Values[key] = value;
- }
- }
-
- public string Name {
- get {
- return _Name;
- }
-
- set {
- _Name = value;
- }
- }
-
- public string Path {
- get {
- return _Path;
- }
-
- set {
- _Path = value;
- }
- }
-
- public bool Secure {
- get {
- return _Secure;
- }
- set {
- _Secure = value;
- }
- }
-
- public string Value {
- get {
- if (null != _Values) {
- return _Values.ToString(false);
- }
-
- return _Value;
- }
- set {
- if (null != _Values) {
- _Values.Reset();
- _Values.Add(null, value);
- return;
- }
-
- _Value = value;
- }
- }
-
- public NameValueCollection Values {
- get {
- if (null == _Values) {
- _Values = new HttpValueCollection();
- if (null != _Value) {
- // Do we have multiple keys
- if (_Value.IndexOf("&") >= 0 || _Value.IndexOf("=") >= 0) {
- _Values.FillFromCookieString(_Value);
- } else {
- _Values.Add(null, _Value);
- }
-
- _Value = null;
- }
- }
-
- return _Values;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpCookieCollection.cs b/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
deleted file mode 100644
index e3918e4a4f0..00000000000
--- a/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// System.Web.HttpCookieCollection
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-// (First impl Bob Smith <bob@thestuff.net>)
-//
-
-using System;
-using System.Web;
-using System.Collections.Specialized;
-
-namespace System.Web {
- public sealed class HttpCookieCollection : NameObjectCollectionBase {
- private HttpCookie [] _AllCookies;
- private string [] _AllKeys;
-
- private HttpResponse _Response;
-
- internal HttpCookieCollection(HttpResponse Response, bool ReadOnly) : base() {
- _Response = Response;
- IsReadOnly = ReadOnly;
- }
-
- public HttpCookieCollection() {
- }
-
- public string [] AllKeys {
- get {
- if (null == _AllKeys) {
- _AllKeys = BaseGetAllKeys();
- }
-
- return _AllKeys;
- }
- }
-
- public HttpCookie this[int index] {
- get {
- return Get(index);
- }
- }
-
- public HttpCookie this[string name] {
- get {
- return Get(name);
- }
- }
-
- public void Add(HttpCookie cookie) {
- if (null != _Response) {
- _Response.GoingToChangeCookieColl();
- }
-
- // empy performance cache
- _AllCookies = null;
- _AllKeys = null;
-
- BaseAdd(cookie.Name, cookie);
-
- if (null != _Response) {
- _Response.OnCookieAdd(cookie);
- }
- }
-
- public void Clear() {
- _AllCookies = null;
- _AllKeys = null;
- this.BaseClear();
- }
-
- public void CopyTo(Array dest, int index) {
- if (null == _AllCookies) {
- _AllCookies = new HttpCookie[Count];
-
- for (int i = 0; i != Count; i++) {
- _AllCookies[i] = Get(i);
- }
- }
-
- if (null != _AllCookies) {
- _AllCookies.CopyTo(dest, index);
- }
- }
-
- public HttpCookie Get(int index) {
- return (HttpCookie) BaseGet(index);
- }
-
- public HttpCookie Get(string name) {
- HttpCookie oRet = (HttpCookie) BaseGet(name);
- if (null == oRet && _Response != null) {
- _AllCookies = null;
- _AllKeys = null;
-
- _Response.GoingToChangeCookieColl();
-
- oRet = new HttpCookie(name);
- BaseAdd(name, oRet);
-
- _Response.OnCookieAdd(oRet);
- }
-
- return oRet;
- }
-
- public string GetKey(int index) {
- return this.BaseGetKey(index);
- }
-
- public void Remove(string name) {
- if (null != _Response) {
- _Response.GoingToChangeCookieColl();
- }
-
- _AllCookies = null;
- _AllKeys = null;
- this.BaseRemove(name);
-
- if (null != _Response) {
- _Response.ChangedCookieColl();
- }
- }
-
- public void Set(HttpCookie cookie) {
- if (null != _Response) {
- _Response.GoingToChangeCookieColl();
- }
-
- _AllCookies = null;
- _AllKeys = null;
- this.BaseSet(cookie.Name, cookie);
-
- if (null != _Response) {
- _Response.ChangedCookieColl();
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpException.cs b/mcs/class/System.Web/System.Web/HttpException.cs
deleted file mode 100644
index 594b825baf3..00000000000
--- a/mcs/class/System.Web/System.Web/HttpException.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Web.HttpException
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.Web {
- [MonoTODO("This class contains a lot of windows specific methods, solve this.. :)")]
- public class HttpException : ExternalException {
- private int _HttpCode;
- private int _HR;
-
- public HttpException() : base() {
- }
-
- public HttpException(string sMessage) : base(sMessage) {
- }
-
- public HttpException(string sMessage, Exception InnerException) : base(sMessage, InnerException) {
- }
-
- public HttpException(int iHttpCode, string sMessage) : base(sMessage) {
- _HttpCode = iHttpCode;
- }
-
- public HttpException(int iHttpCode, string sMessage, int iHR) : base(sMessage) {
- _HttpCode = iHttpCode;
- _HR = iHR;
- }
-
- public HttpException(string sMessage, int iHR) : base(sMessage) {
- _HR = iHR;
- }
-
- public HttpException(int iHttpCode, string sMessage, Exception InnerException) : base(sMessage, InnerException) {
- _HttpCode = iHttpCode;
- }
-
- [MonoTODO("Should get an correct html message depending on error type")]
- public string GetHtmlErrorMessage() {
- throw new NotImplementedException();
- }
-
- [MonoTODO("Check error type and Set the correct error code")]
- public int GetHttpCode() {
- return _HttpCode;
- }
-
- [MonoTODO("Get the last error code")]
- public static HttpException CreateFromLastError(string Message) {
- return new HttpException(Message);
- }
-
-
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpFileCollection.cs b/mcs/class/System.Web/System.Web/HttpFileCollection.cs
deleted file mode 100644
index 423a5d4f605..00000000000
--- a/mcs/class/System.Web/System.Web/HttpFileCollection.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.Web.HttpFileCollection
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections.Specialized;
-
-namespace System.Web {
- public sealed class HttpFileCollection : NameObjectCollectionBase {
- private HttpPostedFile [] _AllFiles;
- private string [] _AllKeys;
-
- internal HttpFileCollection() : base() {
- }
-
- internal void AddFile(string name, HttpPostedFile file) {
- _AllFiles = null;
- _AllKeys = null;
-
- BaseAdd(name, file);
- }
-
- public void CopyTo(Array Dest, int index) {
- if (null == _AllFiles) {
- _AllFiles = new HttpPostedFile[Count];
- for (int i = 0; i != Count; i++) {
- _AllFiles[i] = Get(i);
- }
- }
-
- if (null != _AllFiles) {
- _AllFiles.CopyTo(Dest, index);
- }
- }
-
- public HttpPostedFile Get(string Name) {
- return (HttpPostedFile) BaseGet(Name);
- }
-
- public HttpPostedFile Get(int index) {
- return (HttpPostedFile) BaseGet(index);
- }
-
- public string GetKey(int index) {
- return BaseGetKey(index);
- }
-
- public string [] AllKeys {
- get {
- if (null == _AllKeys) {
- _AllKeys = BaseGetAllKeys();
- }
-
- return _AllKeys;
- }
- }
-
- public HttpPostedFile this [string name] {
- get {
- return Get(name);
- }
- }
-
- public HttpPostedFile this [int index] {
- get {
- return Get(index);
- }
- }
-
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpHelper.cs b/mcs/class/System.Web/System.Web/HttpHelper.cs
deleted file mode 100644
index 9798f8b3b4b..00000000000
--- a/mcs/class/System.Web/System.Web/HttpHelper.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Web.HttpHelper
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections;
-using System.IO;
-
-namespace System.Web {
- internal class HttpHelper {
- internal static string [] ParseMultiValueHeader(string header) {
- if (null == header) {
- return null;
- }
-
- if (header.Length == 0) {
- return null;
- }
-
- // Parse the , chars
- Stack oValues = new Stack();
-
- string sValue;
-
- int iLastPos = -1;
- int iPos = header.IndexOf(",");
-
- while (iPos != -1) {
- sValue = header.Substring(iLastPos + 1, iPos - iLastPos - 1).Trim();
- iLastPos = iPos;
-
- iPos = header.IndexOf(",", iPos + 1);
- oValues.Push(sValue);
- }
-
- sValue = header.Substring(iLastPos + 1).Trim();
- oValues.Push(sValue);
-
- string [] arrValues = new string[oValues.Count];
-
- Array.Copy(oValues.ToArray(), 0, arrValues, 0, oValues.Count);
-
- return arrValues;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpModuleCollection.cs b/mcs/class/System.Web/System.Web/HttpModuleCollection.cs
deleted file mode 100644
index c7dc329abc8..00000000000
--- a/mcs/class/System.Web/System.Web/HttpModuleCollection.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.Web.HttpModuleCollection
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections.Specialized;
-
-namespace System.Web {
- public sealed class HttpModuleCollection : NameObjectCollectionBase {
- private IHttpModule [] _Modules;
- private string [] _Keys;
-
- internal HttpModuleCollection() : base() {
- }
-
- internal void AddModule(string key, IHttpModule m) {
- _Modules = null;
- _Keys = null;
-
- BaseAdd(key, m);
- }
-
- public void CopyTo(Array dest, int index) {
- if (null == _Modules) {
- _Modules = new IHttpModule[Count];
-
- for (int i = 0; i != Count; i++) {
- _Modules[i] = Get(i);
- }
- }
-
- if (null != _Modules) {
- _Modules.CopyTo(dest, index);
- }
- }
-
- public IHttpModule Get(string key) {
- return (IHttpModule) BaseGet(key);
- }
-
- public IHttpModule Get(int index) {
- return (IHttpModule) BaseGet(index);
- }
-
- public string GetKey(int index) {
- return GetKey(index);
- }
-
- public string [] AllKeys {
- get {
- if (null == _Keys) {
- _Keys = BaseGetAllKeys();
- }
-
- return _Keys;
- }
- }
-
- public IHttpModule this [string key] {
- get {
- return Get(key);
- }
- }
-
- public IHttpModule this [int index] {
- get {
- return Get(index);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpPostedFile.cs b/mcs/class/System.Web/System.Web/HttpPostedFile.cs
deleted file mode 100644
index 02c02fc217a..00000000000
--- a/mcs/class/System.Web/System.Web/HttpPostedFile.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Web.HttpPostedFile
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.IO;
-
-namespace System.Web {
- public sealed class HttpPostedFile {
- private HttpRequestStream _Stream;
- private string _ContentType;
- private string _FileName;
-
- internal HttpPostedFile(string file, string type, HttpRequestStream data) {
- _Stream = data;
- _FileName = file;
- _ContentType = type;
- }
-
- public void SaveAs(string filename) {
- FileStream File = new FileStream(filename, FileMode.Create);
- if (_Stream.DataLength > 0) {
- File.Write(_Stream.Data, _Stream.DataOffset, _Stream.DataLength);
- }
-
- File.Flush();
- File.Close();
- }
-
- public int ContentLength {
- get {
- return _Stream.DataLength;
- }
- }
-
- public string ContentType {
- get {
- return _ContentType;
- }
- }
-
- public string FileName {
- get {
- return _FileName;
- }
- }
-
- public Stream InputStream {
- get {
- return _Stream;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs
deleted file mode 100644
index 55f991f031c..00000000000
--- a/mcs/class/System.Web/System.Web/HttpRequest.cs
+++ /dev/null
@@ -1,835 +0,0 @@
-//
-// System.Web.HttpRequest
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.IO;
-using System.Text;
-using System.Web.Configuration;
-
-namespace System.Web {
- [MonoTODO("Review security in all path access function")]
- public sealed class HttpRequest {
- private string [] _arrAcceptTypes;
- private string [] _arrUserLanguages;
-
- private byte [] _arrRawContent;
- private int _iContentLength;
-
- private string _sContentType;
- private string _sHttpMethod;
- private string _sRawUrl;
- private string _sUserAgent;
- private string _sUserHostAddress;
- private string _sUserHostName;
- private string _sPath;
- private string _sPathInfo;
- private string _sFilePath;
- private string _sPathTranslated;
- private string _sQueryStringRaw;
- private string _sRequestType;
- private string _sRequestRootVirtualDir;
-
- private Encoding _oContentEncoding;
-
- private Uri _oUriReferrer;
- private Uri _oUrl;
-
- private int _iTotalBytes;
-
- private HttpContext _oContext;
-
- private HttpWorkerRequest _WorkerRequest;
- private HttpRequestStream _oInputStream;
- private HttpClientCertificate _ClientCert;
-
- private HttpValueCollection _oServerVariables;
- private HttpValueCollection _oHeaders;
- private HttpValueCollection _oQueryString;
- private HttpValueCollection _oFormData;
- private HttpValueCollection _oParams;
-
- private HttpBrowserCapabilities _browser;
-
- public HttpRequest(string Filename, string Url, string Querystring) {
- _iContentLength = -1;
- _iTotalBytes = -1;
-
- _WorkerRequest = null;
- _sPathTranslated = Filename;
- _sRequestType = "GET";
- _sHttpMethod = "GET";
- _oUrl = new Uri(Url);
- _sPath = _oUrl.AbsolutePath;
-
- _sQueryStringRaw = Querystring;
- _oQueryString = new HttpValueCollection(Querystring, true, Encoding.Default);
- }
-
- internal HttpRequest(HttpWorkerRequest WorkRequest, HttpContext Context) {
- _WorkerRequest = WorkRequest;
- _oContext = Context;
-
- _iContentLength = -1;
- _iTotalBytes = -1;
- }
-
- static private string MakeServerVariableFromHeader(string header) {
- return "HTTP_" + header.ToUpper().Replace("-", "_");
- }
-
- [MonoTODO("Need to support non-raw mode also..")]
- private string GetAllHeaders(bool Raw) {
- StringBuilder oData;
-
- if (null == _WorkerRequest) {
- return null;
- }
-
- oData = new StringBuilder(512);
-
- string sHeaderValue;
- string sHeaderName;
- int iCount = 0;
-
- // Add all know headers
- for (; iCount != 40; iCount++) {
- sHeaderValue = _WorkerRequest.GetKnownRequestHeader(iCount);
- if (null != sHeaderValue && sHeaderValue.Length > 0) {
- sHeaderName = _WorkerRequest.GetKnownRequestHeader(iCount);
- if (null != sHeaderName && sHeaderName.Length > 0) {
- oData.Append(sHeaderName);
- oData.Append(": ");
- oData.Append(sHeaderValue);
- oData.Append("\r\n");
- }
- }
- }
-
- // Get all other headers
- string [][] arrUnknownHeaders = _WorkerRequest.GetUnknownRequestHeaders();
- if (null != arrUnknownHeaders) {
- for (iCount = 0; iCount != arrUnknownHeaders.Length; iCount++) {
- oData.Append(arrUnknownHeaders[iCount][0]);
- oData.Append(": ");
- oData.Append(arrUnknownHeaders[iCount][1]);
- oData.Append("\r\n");
- }
- }
-
- return oData.ToString();
- }
-
- [MonoTODO("We need to handly 'dynamic' variables like AUTH_USER, that can be changed during runtime... special collection")]
- private void ParseServerVariables() {
- if (null == _WorkerRequest) {
- return;
- }
-
- if (_oServerVariables == null) {
- string sTmp;
-
- _oServerVariables = new HttpValueCollection();
-
- _oServerVariables.Add("ALL_HTTP", GetAllHeaders(false));
- _oServerVariables.Add("ALL_RAW", GetAllHeaders(true));
-
- _oServerVariables.Add("APPL_MD_PATH", _WorkerRequest.GetServerVariable("APPL_MD_PATH"));
- _oServerVariables.Add("AUTH_PASSWORD", _WorkerRequest.GetServerVariable("AUTH_PASSWORD"));
- _oServerVariables.Add("CERT_COOKIE", _WorkerRequest.GetServerVariable("CERT_COOKIE"));
- _oServerVariables.Add("CERT_FLAGS", _WorkerRequest.GetServerVariable("CERT_FLAGS"));
- _oServerVariables.Add("CERT_ISSUER", _WorkerRequest.GetServerVariable("CERT_ISSUER"));
- _oServerVariables.Add("CERT_KEYSIZE", _WorkerRequest.GetServerVariable("CERT_KEYSIZE"));
- _oServerVariables.Add("CERT_SECRETKEYSIZE", _WorkerRequest.GetServerVariable("CERT_SECRETKEYSIZE"));
- _oServerVariables.Add("CERT_SERIALNUMBER", _WorkerRequest.GetServerVariable("CERT_SERIALNUMBER"));
- _oServerVariables.Add("CERT_SERVER_ISSUER", _WorkerRequest.GetServerVariable("CERT_SERVER_ISSUER"));
- _oServerVariables.Add("CERT_SERVER_SUBJECT", _WorkerRequest.GetServerVariable("CERT_SERVER_SUBJECT"));
- _oServerVariables.Add("CERT_SUBJECT", _WorkerRequest.GetServerVariable("CERT_SUBJECT"));
-
- _oServerVariables.Add("GATEWAY_INTERFACE", _WorkerRequest.GetServerVariable("GATEWAY_INTERFACE"));
- _oServerVariables.Add("HTTPS", _WorkerRequest.GetServerVariable("HTTPS"));
- _oServerVariables.Add("HTTPS_KEYSIZE", _WorkerRequest.GetServerVariable("HTTPS_KEYSIZE"));
- _oServerVariables.Add("HTTPS_SECRETKEYSIZE", _WorkerRequest.GetServerVariable("HTTPS_SECRETKEYSIZE"));
-
- _oServerVariables.Add("CONTENT_TYPE", ContentType);
- _oServerVariables.Add("HTTPS_SERVER_ISSUER", _WorkerRequest.GetServerVariable("HTTPS_SERVER_ISSUER"));
- _oServerVariables.Add("HTTPS_SERVER_SUBJECT", _WorkerRequest.GetServerVariable("HTTPS_SERVER_SUBJECT"));
- _oServerVariables.Add("INSTANCE_ID", _WorkerRequest.GetServerVariable("INSTANCE_ID"));
- _oServerVariables.Add("INSTANCE_META_PATH", _WorkerRequest.GetServerVariable("INSTANCE_META_PATH"));
- _oServerVariables.Add("LOCAL_ADDR", _WorkerRequest.GetLocalAddress());
- _oServerVariables.Add("REMOTE_ADDR", UserHostAddress);
- _oServerVariables.Add("REMOTE_HOST", UserHostName);
- _oServerVariables.Add("REQUEST_METHOD", HttpMethod);
- _oServerVariables.Add("SERVER_NAME", _WorkerRequest.GetServerName());
- _oServerVariables.Add("SERVER_PORT", _WorkerRequest.GetLocalPort().ToString());
- _oServerVariables.Add("SERVER_PROTOCOL", _WorkerRequest.GetHttpVersion());
- _oServerVariables.Add("SERVER_SOFTWARE", _WorkerRequest.GetServerVariable("SERVER_SOFTWARE"));
-
- if (_WorkerRequest.IsSecure()) {
- _oServerVariables.Add("SERVER_PORT_SECURE", "1");
- } else {
- _oServerVariables.Add("SERVER_PORT_SECURE", "0");
- }
-
- sTmp = _WorkerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentLength);
- if (null != sTmp) {
- _oServerVariables.Add("CONTENT_LENGTH", sTmp);
- }
-
- // TODO: Should be dynamic
- if (null != _oContext.User && _oContext.User.Identity.IsAuthenticated) {
- _oServerVariables.Add("AUTH_TYPE", _oContext.User.Identity.AuthenticationType);
- _oServerVariables.Add("AUTH_USER", _oContext.User.Identity.Name);
- } else {
- _oServerVariables.Add("AUTH_TYPE", "");
- _oServerVariables.Add("AUTH_USER", "");
- }
-
- _oServerVariables.Add("PATH_INFO", PathInfo);
- _oServerVariables.Add("PATH_TRANSLATED", PhysicalPath);
- _oServerVariables.Add("QUERY_STRING", QueryStringRaw);
- _oServerVariables.Add("SCRIPT_NAME", FilePath);
- // end dynamic
-
- _oServerVariables.MakeReadOnly();
- }
- }
-
- [MonoTODO("Handle Multipart data also, content-encoding check")]
- private void ParseFormData() {
- if (_oFormData == null) {
- byte [] arrData = GetRawContent();
- _oFormData = new HttpValueCollection(ContentEncoding.GetString(arrData), true, ContentEncoding);
- }
- }
-
- void Dispose() {
-
- }
-
- [MonoTODO("Handle Multipart data, max content length?")]
- private byte [] GetRawContent() {
- if (null == _arrRawContent) {
- if (null == _WorkerRequest) {
- return null;
- }
-
- // TODO: Check max length?
- _arrRawContent = _WorkerRequest.GetPreloadedEntityBody();
- if (!_WorkerRequest.IsEntireEntityBodyIsPreloaded()) {
- byte [] arrTemp;
- byte [] arrBuffer;
-
- arrBuffer = new byte[16384];
- int iLoaded = 16384;
-
- while (iLoaded == arrBuffer.Length) {
- iLoaded = _WorkerRequest.ReadEntityBody(arrBuffer, arrBuffer.Length);
-
- // Save data
- arrTemp = new byte[_arrRawContent.Length + iLoaded];
-
- Array.Copy(_arrRawContent, 0, arrTemp, 0, _arrRawContent.Length);
- Array.Copy(arrBuffer, 0, arrTemp, _arrRawContent.Length, iLoaded);
-
- _arrRawContent = arrTemp;
- }
- }
- }
-
- return _arrRawContent;
- }
-
- public string [] AcceptTypes {
- get {
- if (null == _arrAcceptTypes && null != _WorkerRequest) {
- _arrAcceptTypes = HttpHelper.ParseMultiValueHeader(_WorkerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderAccept));
- }
-
- return _arrAcceptTypes;
-
- }
- }
-
- public string ApplicationPath {
- get {
- if (null != _WorkerRequest) {
- return _WorkerRequest.GetAppPath();
- }
-
- return null;
- }
- }
-
- public HttpBrowserCapabilities Browser
- {
- get { return _browser; }
-
- set { _browser = value; }
- }
-
- public HttpClientCertificate ClientCertificate {
- get {
- if (null == _ClientCert) {
- _ClientCert = new HttpClientCertificate(_oContext);
- }
-
- return _ClientCert;
- }
- }
-
- [MonoTODO("Get content encoding from Syste.Web.Configuration namespace")]
- public Encoding ContentEncoding {
- get {
- if (_oContentEncoding == null) {
- // TODO: Get from config what is the default encoding
- // TODO: Should we get encoding from HttpHeaders? Just get charset from ContentType and the get encoding..
- _oContentEncoding = Encoding.Default;
- }
-
- return _oContentEncoding;
- }
-
- set {
- _oContentEncoding = value;
- }
- }
-
- public int ContentLength {
- get {
- if (_iContentLength == -1 && null != _WorkerRequest) {
- string sLength = _WorkerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentLength);
- if (sLength != null) {
- try {
- _iContentLength = Int32.Parse(sLength);
- }
- catch(Exception) {
- }
- }
- }
-
- if (_iContentLength < 0) {
- _iContentLength = 0;
- }
-
- return _iContentLength;
- }
- }
-
- public string ContentType {
- get {
- if (null == _sContentType) {
- if (null != _WorkerRequest) {
- _sContentType = _WorkerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderContentType);
- }
-
- if (null == _sContentType) {
- _sContentType = string.Empty;
- }
- }
-
- return _sContentType;
- }
- }
-
- [MonoTODO()]
- public HttpCookieCollection Cookies {
- get {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO()]
- public string CurrentExecutionFilePath {
- get {
- throw new NotImplementedException();
- }
- }
-
- public string FilePath {
- get {
- if (null == _sFilePath && null != _WorkerRequest) {
- _sFilePath = _WorkerRequest.GetFilePath();
- }
-
- return _sFilePath;
- }
- }
-
- [MonoTODO()]
- public HttpFileCollection Files {
- get {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO("Use stream filter in the request stream")]
- public Stream Filter {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
-
- public NameValueCollection Form {
- get {
- ParseFormData();
-
- return (NameValueCollection) _oFormData;
- }
- }
-
- public NameValueCollection Headers {
- get {
- if (_oHeaders == null) {
- _oHeaders = new HttpValueCollection();
-
- if (null != _WorkerRequest) {
- string sHeaderValue;
- string sHeaderName;
- int iCount = 0;
-
- // Add all know headers
- for (; iCount != 40; iCount++) {
- sHeaderValue = _WorkerRequest.GetKnownRequestHeader(iCount);
- if (null != sHeaderValue && sHeaderValue.Length > 0) {
- sHeaderName = _WorkerRequest.GetKnownRequestHeader(iCount);
- if (null != sHeaderName && sHeaderName.Length > 0) {
- _oHeaders.Add(sHeaderName, sHeaderValue);
- }
- }
- }
-
- // Get all other headers
- string [][] arrUnknownHeaders = _WorkerRequest.GetUnknownRequestHeaders();
- if (null != arrUnknownHeaders) {
- for (iCount = 0; iCount != arrUnknownHeaders.Length; iCount++) {
- _oHeaders.Add(arrUnknownHeaders[iCount][0], arrUnknownHeaders[iCount][1]);
- }
- }
- }
-
- // Make headers read-only
- _oHeaders.MakeReadOnly();
- }
-
- return (NameValueCollection) _oHeaders;
- }
- }
-
- public string HttpMethod {
- get {
- if (null == _sHttpMethod) {
- if (null != _WorkerRequest) {
- _sHttpMethod = _WorkerRequest.GetHttpVerbName().ToUpper();
- }
-
- if (_sHttpMethod == null) {
- _sHttpMethod = "GET";
- }
- }
-
- return _sHttpMethod;
- }
- }
-
- public Stream InputStream {
- get {
- if (_oInputStream == null) {
- byte [] arrInputData = GetRawContent();
-
- if (null != arrInputData) {
- _oInputStream = new HttpRequestStream(arrInputData, 0, arrInputData.Length);
- } else {
- _oInputStream = new HttpRequestStream(null, 0, 0);
- }
- }
-
- return _oInputStream;
- }
- }
-
- public bool IsAuthenticated {
- get {
- if (_oContext != null && _oContext.User != null && _oContext.User.Identity != null) {
- return _oContext.User.Identity.IsAuthenticated;
- }
-
- return false;
- }
- }
-
- public bool IsSecureConnection {
- get {
- if (null != _WorkerRequest) {
- return _WorkerRequest.IsSecure();
- }
-
- return false;
- }
- }
-
- [MonoTODO("Call item in querystring, form, cookie and servervariables")]
- public string this [string sKey] {
- get {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO("Add cookie collection to our Params collection via merge")]
- public NameValueCollection Params {
- get {
- if (_oParams == null) {
- _oParams = new HttpValueCollection();
-
- _oParams.Merge(QueryString);
- _oParams.Merge(Form);
- _oParams.Merge(ServerVariables);
- // TODO: Cookie
-
- _oParams.MakeReadOnly();
- }
-
- return (NameValueCollection) _oParams;
- }
- }
-
- public string Path {
- get {
- if (_sPath == null) {
- if (null != _WorkerRequest) {
- _sPath = _WorkerRequest.GetUriPath();
- }
-
- if (_sPath == null) {
- _sPath = string.Empty;
- }
- }
-
- return _sPath;
- }
- }
-
- public string PathInfo {
- get {
- if (_sPathInfo == null) {
- if (null != _WorkerRequest) {
- _sPathInfo = _WorkerRequest.GetPathInfo();
- }
-
- if (_sPathInfo == null) {
- _sPathInfo = string.Empty;
- }
- }
-
- return _sPathInfo;
- }
- }
-
- public string PhysicalApplicationPath {
- get {
- if (null != _WorkerRequest) {
- return _WorkerRequest.GetAppPathTranslated();
- }
-
- return null;
- }
- }
-
- public string PhysicalPath {
- get {
- if (null != _WorkerRequest) {
- _sPathTranslated = _WorkerRequest.GetFilePathTranslated();
- if (null == _sPathTranslated) {
- _sPathTranslated = _WorkerRequest.MapPath(FilePath);
- }
- }
-
- return _sPathTranslated;
- }
- }
-
- public NameValueCollection QueryString {
- get {
- if (_oQueryString == null) {
- _oQueryString = new HttpValueCollection(QueryStringRaw, true, Encoding.UTF8);
- }
-
- return _oQueryString;
- }
- }
-
- // Used to parse the querystring
- internal string QueryStringRaw {
- get {
- if (_sQueryStringRaw == null && null != _WorkerRequest) {
- byte [] arrQuerystringBytes = _WorkerRequest.GetQueryStringRawBytes();
- if (null != arrQuerystringBytes && arrQuerystringBytes.Length > 0) {
- _sQueryStringRaw = ContentEncoding.GetString(arrQuerystringBytes);
- } else {
- _sQueryStringRaw = _WorkerRequest.GetQueryString();
- }
- }
-
- if (_sQueryStringRaw == null) {
- _sQueryStringRaw = string.Empty;
- }
-
- return _sQueryStringRaw;
- }
- }
-
- public string RawUrl {
- get {
- if (null == _sRawUrl) {
- if (null != _WorkerRequest) {
- _sRawUrl = _WorkerRequest.GetRawUrl();
- } else {
- _sRawUrl = Path;
- if (QueryStringRaw != null && QueryStringRaw.Length > 0) {
- _sRawUrl = _sRawUrl + "?" + QueryStringRaw;
- }
- }
- }
-
- return _sRawUrl;
- }
- }
-
- public string RequestType {
- get {
- if (null == _sRequestType) {
- return HttpMethod;
- }
-
- return _sRequestType;
- }
-
- set {
- _sRequestType = value;
- }
- }
-
-
- public NameValueCollection ServerVariables {
- get {
- ParseServerVariables();
-
- return (NameValueCollection) _oServerVariables;
- }
- }
-
- public int TotalBytes {
- get {
- if (_iTotalBytes == -1) {
- if (null != InputStream) {
- _iTotalBytes = (int) InputStream.Length;
- } else {
- _iTotalBytes = 0;
- }
- }
-
- return _iTotalBytes;
- }
- }
-
- public Uri Url {
- get {
- if (null == _oUrl) {
- _oUrl = new Uri(RawUrl);
- }
-
- return _oUrl;
- }
- }
-
- public Uri UrlReferrer {
- get {
- if (null == _oUriReferrer && null != _WorkerRequest) {
- string sReferrer = _WorkerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderReferer);
- if (null != sReferrer && sReferrer.Length > 0) {
- try {
- if (sReferrer.IndexOf("://") >= 0) {
- _oUriReferrer = new Uri(sReferrer);
- } else {
- _oUriReferrer = new Uri(this.Url, sReferrer);
- }
- }
- catch (Exception) {
- }
- }
- }
-
- return _oUriReferrer;
- }
- }
-
- public string UserAgent {
- get {
- if (_sUserAgent == null && _WorkerRequest != null) {
- _sUserAgent = _WorkerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderUserAgent);
- }
-
- if (_sUserAgent == null) {
- _sUserAgent = string.Empty;
- }
-
- return _sUserAgent;
- }
- }
-
- public string UserHostAddress {
- get {
- if (_sUserHostAddress == null && null != _WorkerRequest) {
- _sUserHostAddress = _WorkerRequest.GetRemoteAddress();
- }
-
- if (_sUserHostAddress == null || _sUserHostAddress.Length == 0) {
- _sUserHostAddress = "127.0.0.1";
- }
-
- return _sUserHostAddress;
- }
- }
-
- public string UserHostName {
- get {
- if (_sUserHostName == null && null != _WorkerRequest) {
- _sUserHostName = _WorkerRequest.GetRemoteName();
- }
-
- if (_sUserHostName == null || _sUserHostName.Length == 0) {
- _sUserHostName = UserHostAddress;
- }
-
- return _sUserHostName;
- }
- }
-
- public string [] UserLanguages {
- get {
- if (_arrUserLanguages == null && null != _WorkerRequest) {
- _arrUserLanguages = HttpHelper.ParseMultiValueHeader(_WorkerRequest.GetKnownRequestHeader(HttpWorkerRequest.HeaderAcceptLanguage));
- }
-
- return _arrUserLanguages;
- }
- }
-
- public byte [] BinaryRead(int count) {
- int iSize = TotalBytes;
- if (iSize == 0) {
- throw new ArgumentException();
- }
-
- byte [] arrData = new byte[iSize];
-
- int iRetSize = InputStream.Read(arrData, 0, iSize);
- if (iRetSize != iSize) {
- byte [] tmpData = new byte[iRetSize];
- if (iRetSize > 0) {
- Array.Copy(arrData, 0, tmpData, 0, iRetSize);
- }
-
- arrData = tmpData;
- }
-
- return arrData;
- }
-
- public int [] MapImageCoordinates(string ImageFieldName) {
- NameValueCollection oItems;
-
- if (HttpMethod == "GET" || HttpMethod == "HEAD") {
- oItems = QueryString;
- } else if (HttpMethod == "POST") {
- oItems = Form;
- } else {
- return null;
- }
-
- int [] arrRet = null;
- try {
- string sX = oItems.Get(ImageFieldName + ".x");
- string sY = oItems.Get(ImageFieldName + ".y");
-
- if (null != sX && null != sY) {
- int [] arrTmp = new Int32[2];
- arrRet[0] = Int32.Parse(sX);
- arrRet[1] = Int32.Parse(sY);
-
- arrRet = arrTmp;
- }
- }
- catch (Exception) {
- }
-
- return arrRet;
- }
-
- public string MapPath(string VirtualPath) {
- if (null == _sRequestRootVirtualDir) {
- if (null == FilePath || FilePath.Length == 0) {
- throw new ArgumentException("Filepath can't be empty");
- }
-
- if (FilePath[0] != '/') {
- throw new ArgumentException("Filepath must be a root");
- }
-
- _sRequestRootVirtualDir = FilePath.Substring(0, FilePath.LastIndexOf('/'));
- if (_sRequestRootVirtualDir.Length == 0) {
- _sRequestRootVirtualDir = "/";
- }
- }
-
- return MapPath(VirtualPath, _sRequestRootVirtualDir, true);
- }
-
- [MonoTODO("Build a path to send to MapPath in the workerrequest")]
- public string MapPath(string virtualPath, string baseVirtualDir, bool allowCrossAppMapping) {
- throw new NotImplementedException();
- }
-
- public void SaveAs(string filename, bool includeHeaders) {
- FileStream oFile;
- TextWriter oWriter;
- HttpRequestStream oData;
-
- oFile = new FileStream(filename, FileMode.CreateNew);
- if (includeHeaders) {
- oWriter = new StreamWriter(oFile);
- oWriter.Write(HttpMethod + " " + Path);
-
- if (QueryStringRaw != null && QueryStringRaw.Length > 0)
- oWriter.Write("?" + QueryStringRaw);
- if (_WorkerRequest != null) {
- oWriter.Write(" " + _WorkerRequest.GetHttpVersion() + "\r\n");
- oWriter.Write(GetAllHeaders(true));
- } else {
- oWriter.Write("\r\n");
- }
-
- oWriter.Write("\r\n");
- oWriter.Flush();
- }
-
- oData = (HttpRequestStream) InputStream;
-
- if (oData.DataLength > 0) {
- oFile.Write(oData.Data, oData.DataOffset, oData.DataLength);
- }
-
- oFile.Flush();
- oFile.Close();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpRequestStream.cs b/mcs/class/System.Web/System.Web/HttpRequestStream.cs
deleted file mode 100644
index c67281d3dd1..00000000000
--- a/mcs/class/System.Web/System.Web/HttpRequestStream.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// System.Web.HttpRequestStream
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.IO;
-
-namespace System.Web {
- public class HttpRequestStream : Stream {
- private byte [] _arrData;
- private int _iLength;
- private int _iOffset;
- private int _iPos;
-
- internal HttpRequestStream(byte [] buffer, int offset, int length) {
- _iPos = 0;
- _iOffset = offset;
- _iLength = length;
-
- _arrData = buffer;
- }
-
- private void Reset() {
- _iPos = 0;
- _iOffset = 0;
- _iLength = 0;
-
- _arrData = null;
- }
-
- public override void Flush() {
- }
-
- public override void Close() {
- Reset();
- }
-
- public override int Read(byte [] buffer, int offset, int length) {
- int iBytes = length;
-
- if (_iPos + length > _arrData.Length) {
- iBytes = (int) _arrData.Length - _iPos;
- }
-
- if (iBytes <= 0) {
- return 0;
- }
-
- Buffer.BlockCopy(_arrData, _iPos, buffer, offset, iBytes);
- _iPos += iBytes;
-
- return iBytes;
- }
-
- public override long Seek(long offset, SeekOrigin origin) {
- switch (origin) {
- case SeekOrigin.Begin : if (offset > _arrData.Length) {
- throw new ArgumentException();
- }
- _iPos = (int) offset;
- break;
-
- case SeekOrigin.Current : if (((long) _iPos + offset > _arrData.Length) || (_iPos + (int) offset < 0)) {
- throw new ArgumentException();
- }
- _iPos += Convert.ToInt32(offset);
- break;
-
- case SeekOrigin.End: if (_arrData.Length - offset < 0) {
- throw new ArgumentException();
- }
-
- _iPos = Convert.ToInt32( _arrData.Length - offset);
- break;
- }
-
- return (long) _iPos;
- }
-
- public override void SetLength(long length) {
- throw new NotSupportedException();
- }
-
- public override void Write(byte [] buffer, int offset, int length) {
- throw new NotSupportedException();
- }
-
- public override bool CanRead {
- get {
- return true;
- }
- }
-
- public override bool CanSeek {
- get {
- return true;
- }
- }
-
- public override bool CanWrite {
- get {
- return false;
- }
- }
-
- public byte [] Data {
- get {
- return _arrData;
- }
- }
-
- public int DataLength {
- get {
- return _iLength;
- }
- }
-
- public int DataOffset {
- get {
- return _iOffset;
- }
- }
-
- public override long Length {
- get {
- return (long) _arrData.Length;
- }
- }
-
- public override long Position {
- get {
- return (long) _iPos;
- }
-
- set {
- Seek(value, SeekOrigin.Begin);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs
deleted file mode 100644
index ea10cfd42ec..00000000000
--- a/mcs/class/System.Web/System.Web/HttpResponse.cs
+++ /dev/null
@@ -1,750 +0,0 @@
-//
-// System.Web.HttpResponse
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Globalization;
-
-namespace System.Web {
- public sealed class HttpResponse {
- // Chunked encoding static helpers
- private static byte [] s_arrChunkSuffix = { 10, 13 };
- private static byte [] s_arrChunkEnd = { 10 , 13 };
- private static string s_sChunkedPrefix = "\r\n";
-
- private ArrayList _Headers;
-
- private bool _bClientDisconnected;
- private bool _bSuppressHeaders;
- private bool _bSuppressContent;
- private bool _bChunked;
- private bool _bEnded;
- private bool _bBuffering;
- private bool _bHeadersSent;
- private bool _bFlushing;
- private long _lContentLength;
- private int _iStatusCode;
-
- private bool _ClientDisconnected;
-
- private string _sContentType;
- private string _sCacheControl;
- private string _sTransferEncoding;
- private string _sCharset;
- private string _sStatusDescription;
-
- private HttpCookieCollection _Cookies;
- private HttpCachePolicy _CachePolicy;
-
- private Encoding _ContentEncoding;
-
- private HttpContext _Context;
- private HttpWriter _Writer;
- private TextWriter _TextWriter;
-
- private HttpWorkerRequest _WorkerRequest;
-
- [MonoTODO("Verify that this really works")]
- public HttpResponse(TextWriter output) {
- _bBuffering = true;
- _bFlushing = false;
- _bHeadersSent = false;
-
- _Headers = new ArrayList();
-
- _sContentType = "text/html";
-
- _iStatusCode = 200;
- _sCharset = null;
- _sCacheControl = null;
-
- _lContentLength = 0;
- _bSuppressContent = false;
- _bSuppressHeaders = false;
- _bClientDisconnected = false;
-
- _bChunked = false;
-
- _TextWriter = output;
- }
-
- internal HttpResponse(HttpWorkerRequest WorkerRequest, HttpContext Context) {
- _Context = Context;
- _WorkerRequest = WorkerRequest;
-
- _bBuffering = true;
- _bFlushing = false;
- _bHeadersSent = false;
-
- _Headers = new ArrayList();
-
- _sContentType = "text/html";
-
- _iStatusCode = 200;
- _sCharset = null;
- _sCacheControl = null;
-
- _lContentLength = 0;
- _bSuppressContent = false;
- _bSuppressHeaders = false;
- _bClientDisconnected = false;
-
- _bChunked = false;
-
- _Writer = new HttpWriter(this);
- _TextWriter = _Writer;
- }
-
- internal System.Text.Encoder ContentEncoder {
- get {
- return ContentEncoding.GetEncoder();
- }
- }
-
- internal void FinalFlush() {
- Flush(true);
- }
-
- [MonoTODO("We need to add cache headers also")]
- private ArrayList GenerateHeaders() {
- ArrayList oHeaders = new ArrayList(_Headers.ToArray());
-
- // save culture info, we need us info here
- CultureInfo oSavedInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
- System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(0x0409);
-
- oHeaders.Add(new HttpResponseHeader("Date", DateTime.Now.ToUniversalTime().ToString("ddd, d MMM yyyy HH:mm:ss") + " GMT"));
-
- System.Threading.Thread.CurrentThread.CurrentCulture = oSavedInfo;
-
- if (_lContentLength > 0) {
- oHeaders.Add(new HttpResponseHeader(HttpWorkerRequest.HeaderContentLength, _lContentLength.ToString()));
- }
-
- if (_sContentType != null) {
- if (_sContentType.IndexOf("charset=") == -1) {
- if (Charset.Length == 0) {
- Charset = ContentEncoding.HeaderName;
- }
-
- // Time to build our string
- if (Charset.Length > 0) {
- _sContentType += "; charset=" + Charset;
- }
- }
-
- oHeaders.Add(new HttpResponseHeader(HttpWorkerRequest.HeaderContentType, _sContentType));
- }
-
- if (_sCacheControl != null) {
- oHeaders.Add(new HttpResponseHeader(HttpWorkerRequest.HeaderPragma, _sCacheControl));
- }
-
- if (_sTransferEncoding != null) {
- oHeaders.Add(new HttpResponseHeader(HttpWorkerRequest.HeaderTransferEncoding, _sTransferEncoding));
- }
-
- // TODO: Add Cookie headers..
-
- return oHeaders;
- }
-
- private void SendHeaders() {
- _WorkerRequest.SendStatus(StatusCode, StatusDescription);
-
- ArrayList oHeaders = GenerateHeaders();
- foreach (object oHeader in oHeaders) {
- ((HttpResponseHeader) oHeader).SendContent(_WorkerRequest);
- }
-
- _bHeadersSent = true;
- }
-
- public string Status {
- get {
- return StatusCode.ToString() + " " + StatusDescription;
- }
-
- set {
- string sMsg = "OK";
- int iCode = 200;
-
- try {
- iCode = Int32.Parse(value.Substring(0, value.IndexOf(' ')));
- sMsg = value.Substring(value.IndexOf(' ') + 1);
- }
- catch(Exception) {
- throw new HttpException("Invalid status string");
- }
-
- StatusCode = iCode;
- StatusDescription = sMsg;
- }
- }
-
- [MonoTODO()]
- public void AddCacheItemDependencies(ArrayList cacheKeys) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void AddCacheItemDependency(string cacheKey) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void AddFileDependencies(ArrayList filenames) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void AddFileDependency(string filename) {
- throw new NotImplementedException();
- }
-
- public void AddHeader(string name, string value) {
- AppendHeader(name, value);
- }
-
- [MonoTODO()]
- public void AppendCookie(HttpCookie cookie) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void AppendToLog(string param) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public string ApplyAppPathModifier(string virtualPath) {
- throw new NotImplementedException();
- }
-
- public bool Buffer {
- get {
- return BufferOutput;
- }
-
- set {
- BufferOutput = value;
- }
- }
-
- public bool BufferOutput {
- get {
- return _bBuffering;
- }
-
- set {
- if (_Writer != null) {
- _Writer.Update();
- }
-
- _bBuffering = value;
- }
- }
-
- public HttpCachePolicy Cache {
- get {
- if (null == _CachePolicy) {
- _CachePolicy = new HttpCachePolicy();
- }
-
- return _CachePolicy;
- }
- }
-
- [MonoTODO("Set status in the cache policy")]
- public string CacheControl {
- get {
- return _sCacheControl;
- }
-
- set {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- _sCacheControl = value;
- }
- }
-
- public string Charset {
- get {
- if (null == _sCharset) {
- _sCharset = ContentEncoding.WebName;
- }
-
- return _sCharset;
- }
- set {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- _sCharset = value;
- }
- }
-
- public Encoding ContentEncoding {
- get {
- if (_ContentEncoding == null) {
- _ContentEncoding = Encoding.UTF8;
- }
-
- return _ContentEncoding;
- }
-
- set {
- if (value == null) {
- throw new ArgumentException("Can't set a null as encoding");
- }
-
- _ContentEncoding = value;
-
- if (_Writer != null) {
- _Writer.Update();
- }
- }
- }
-
- public string ContentType {
- get {
- return _sContentType;
- }
-
- set {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- _sContentType = value;
- }
- }
-
- public HttpCookieCollection Cookies {
- get {
- if (null == _Cookies) {
- _Cookies = new HttpCookieCollection(this, false);
- }
- return _Cookies;
- }
- }
-
- [MonoTODO("Set expires in the cache policy")]
- public int Expires {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- [MonoTODO("Set expiresabsolute in the cache policy")]
- public int ExpiresAbsolute {
- get {
- throw new NotImplementedException();
- }
-
- set {
- throw new NotImplementedException();
- }
- }
-
- public Stream Filter {
- get {
- if (_Writer != null) {
- return _Writer.GetActiveFilter();
- }
- return null;
- }
-
- set {
- if (_Writer == null) {
- throw new HttpException("Filtering is not allowed");
- }
-
- _Writer.ActivateFilter(value);
- }
- }
-
- public bool IsClientConnected {
- get {
- if (_ClientDisconnected) {
- return false;
- }
-
- if (null != _WorkerRequest && (!_WorkerRequest.IsClientConnected())) {
- _ClientDisconnected = false;
- return false;
- }
-
- return true;
- }
- }
-
- public TextWriter Output {
- get {
- return _TextWriter;
- }
- }
-
- public Stream OutputStream {
- get {
- if (_Writer == null) {
- throw new System.Web.HttpException("a Output stream not available when running with custom text writer");
- }
-
- return _Writer.OutputStream;
- }
- }
-
- public string StatusDescription {
- get {
- if (null == _sStatusDescription) {
- _sStatusDescription = HttpWorkerRequest.GetStatusDescription(_iStatusCode);
- }
-
- return _sStatusDescription;
- }
-
- set {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- _sStatusDescription = value;
- }
- }
-
- public int StatusCode {
- get {
- return _iStatusCode;
- }
- set {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- _sStatusDescription = null;
- _iStatusCode = value;
- }
- }
-
- public bool SuppressContent {
- get {
- return _bSuppressContent;
- }
-
- set {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- _bSuppressContent = true;
- }
- }
-
- public HttpRequest Request {
- get {
- return _Context.Request;
- }
- }
-
- internal void AppendHeader(int iIndex, string value) {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
- switch (iIndex) {
- case HttpWorkerRequest.HeaderContentLength :
- _lContentLength = Int64.Parse(value);
- break;
- case HttpWorkerRequest.HeaderContentEncoding :
- _sContentType = value;
- break;
- case HttpWorkerRequest.HeaderTransferEncoding :
- _sTransferEncoding = value;
- if (value.Equals("chunked")) {
- _bChunked = true;
- } else {
- _bChunked = false;
- }
- break;
-
- case HttpWorkerRequest.HeaderPragma :
- _sCacheControl = value;
- break;
-
- default :
- _Headers.Add(new HttpResponseHeader(iIndex, value));
- break;
- }
-
-
- }
-
- public void AppendHeader(string name, string value) {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- switch (name.ToLower()) {
- case "content-length" : _lContentLength = Int64.Parse(value);
- break;
- case "content-type" : _sContentType = value;
- break;
- case "transfer-encoding" : _sTransferEncoding = value;
- if (value.Equals("chunked")) {
- _bChunked = true;
- } else {
- _bChunked = false;
- }
-
- break;
- case "pragma" : _sCacheControl = value;
- break;
-
- default : _Headers.Add(new HttpResponseHeader(name, value));
- break;
- }
- }
-
- public void BinaryWrite(byte [] buffer) {
- OutputStream.Write(buffer, 0, buffer.Length);
- }
-
- public void Clear() {
- if (_Writer != null) {
- _Writer.Clear();
- }
- }
-
- public void ClearContent() {
- Clear();
- }
-
- public void ClearHeaders() {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- _sContentType = "text/html";
-
- _iStatusCode = 200;
- _sCharset = null;
- _Headers = new ArrayList();
- _sCacheControl = null;
- _sTransferEncoding = null;
-
- _lContentLength = 0;
- _bSuppressContent = false;
- _bSuppressHeaders = false;
- _bClientDisconnected = false;
- }
-
- public void Close() {
- _bClientDisconnected = false;
-
- _WorkerRequest.CloseConnection();
-
- _bClientDisconnected = true;
- }
-
- internal void Dispose() {
- if (_Writer != null) {
- _Writer.Dispose();
- _Writer = null;
- }
- }
-
- [MonoTODO("Handle callbacks into before done with session, needs to have a non ended flush here")]
- internal void FlushAtEndOfRequest()
- {
- Flush(true);
- }
-
- [MonoTODO("Check timeout and if we can cancel the thread...")]
- public void End() {
- if (!_bEnded) {
- Flush();
- _WorkerRequest.CloseConnection();
-
- _bEnded = true;
- }
- }
-
- public void Flush() {
- Flush(false);
- }
-
- private void Flush(bool bFinish) {
- if (_bFlushing) {
- return;
- }
-
- _bFlushing = true;
-
- if (_Writer != null) {
- _Writer.FlushBuffers();
- } else {
- _TextWriter.Flush();
- }
-
- try {
- if (!_bHeadersSent) {
- if (!_bSuppressHeaders && !_bClientDisconnected) {
- if (_Writer != null && BufferOutput) {
- _lContentLength = _Writer.BufferSize;
- }
- else {
- _lContentLength = 0;
- }
-
- if (_lContentLength == 0 && _iStatusCode == 200 && _sTransferEncoding == null) {
- // Check we are going todo chunked encoding
- string sProto = _Context.Request.ServerVariables["SERVER_PROTOCOL"];
- if (sProto != null && sProto == "HTTP/1.1") {
- AppendHeader(HttpWorkerRequest.HeaderTransferEncoding, "chunked");
- }
- else {
- // Just in case, the old browsers sends a HTTP/1.0 request with Connection: Keep-Alive
- AppendHeader(HttpWorkerRequest.HeaderConnection, "Close");
- }
- }
-
- SendHeaders();
- }
- }
- if ((!_bSuppressContent && Request.HttpMethod.Equals("HEAD")) || _Writer == null) {
- _bSuppressContent = true;
- }
-
- if (!_bSuppressContent) {
- _bClientDisconnected = false;
- if (_bChunked) {
- Encoding oASCII = Encoding.ASCII;
-
- byte [] arrPrefix = oASCII.GetBytes(Convert.ToString(_Writer.BufferSize, 16) + s_sChunkedPrefix);
- _WorkerRequest.SendResponseFromMemory(arrPrefix, arrPrefix.Length);
-
- _Writer.SendContent(_WorkerRequest);
-
- _WorkerRequest.SendResponseFromMemory(s_arrChunkSuffix, s_arrChunkSuffix.Length);
- if (bFinish) {
- _WorkerRequest.SendResponseFromMemory(s_arrChunkEnd, s_arrChunkEnd.Length);
- }
- }
- else {
- _Writer.SendContent(_WorkerRequest);
- }
-
- _WorkerRequest.FlushResponse(bFinish);
-
- if (!bFinish) {
- _Writer.Clear();
- }
- }
- }
- finally {
- _bFlushing = false;
- }
- }
-
- public void Pics(string value) {
- AppendHeader("PICS-Label", value);
- }
-
-
- public void Redirect(string url) {
- Redirect(url, true);
- }
-
- public void Redirect(string url, bool endResponse) {
- if (_bHeadersSent) {
- throw new System.Web.HttpException("Headers has been sent to the client");
- }
-
- Clear();
-
- StatusCode = 302;
- AppendHeader(HttpWorkerRequest.HeaderLocation, url);
-
- // Text for browsers that can't handle location header
- Write("<html><head><title>Object moved</title></head><body>\r\n");
- Write("<h2>Object moved to <a href='" + url + "'>here</a></h2>\r\n");
- Write("</body><html>\r\n");
-
- if (endResponse) {
- End();
- }
- }
-
- public void Write(char ch) {
- _TextWriter.Write(ch);
- }
-
- public void Write(object obj) {
- _TextWriter.Write(obj);
- }
-
- public void Write(string str) {
- _TextWriter.Write(str);
- }
-
- public void Write(char [] buffer, int index, int count) {
- _TextWriter.Write(buffer, index, count);
- }
-
- [MonoTODO()]
- public static void RemoveOutputCacheItem(string path) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void SetCookie(HttpCookie cookie) {
- throw new NotImplementedException();
- }
-
- public void WriteFile(string filename) {
- WriteFile(filename, false);
- }
-
- [MonoTODO()]
- public void WriteFile(string filename, bool readIntoMemory) {
- throw new NotImplementedException();
- }
-
- [MonoTODO()]
- public void WriteFile(string filename, long offset, long size) {
- throw new NotImplementedException();
- }
-
- [MonoTODO("Should we support fileHandle ptrs?")]
- public void WriteFile(IntPtr fileHandle, long offset, long size) {
- }
-
- [MonoTODO()]
- internal void OnCookieAdd(HttpCookie cookie) {
- }
-
- [MonoTODO("Do we need this?")]
- internal void OnCookieChange(HttpCookie cookie) {
- }
-
- [MonoTODO()]
- internal void GoingToChangeCookieColl() {
- }
-
- [MonoTODO()]
- internal void ChangedCookieColl() {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpResponseHeader.cs b/mcs/class/System.Web/System.Web/HttpResponseHeader.cs
deleted file mode 100644
index 1d34d8da430..00000000000
--- a/mcs/class/System.Web/System.Web/HttpResponseHeader.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Web.HttpResponseHeader
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-
-namespace System.Web {
- internal class HttpResponseHeader {
- private string _sHeader;
- private string _sValue;
- private int _iKnowHeaderId;
-
- internal HttpResponseHeader(int KnowHeaderId, string value) {
- _iKnowHeaderId = KnowHeaderId;
- _sValue = value;
- }
-
- internal HttpResponseHeader(string header, string value) {
- _sHeader = header;
- _sValue = value;
- }
-
- internal string Name {
- get {
- if (null == _sHeader) {
- return HttpWorkerRequest.GetKnownResponseHeaderName(_iKnowHeaderId);
- }
-
- return _sHeader;
- }
- }
-
- internal string Value {
- get {
- return _sValue;
- }
- }
-
- override public string ToString() {
- return Name + ": " + Value;
- }
-
- internal void SendContent(HttpWorkerRequest WorkerRequest) {
- if (null != _sHeader) {
- WorkerRequest.SendUnknownResponseHeader(_sHeader, _sValue);
- } else {
- WorkerRequest.SendKnownResponseHeader(_iKnowHeaderId, _sValue);
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpResponseStream.cs b/mcs/class/System.Web/System.Web/HttpResponseStream.cs
deleted file mode 100644
index 340a5a50442..00000000000
--- a/mcs/class/System.Web/System.Web/HttpResponseStream.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.Web.HttpResponseStream
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.IO;
-
-namespace System.Web {
- /// <summary>
- /// Simple wrapper around HttpWriter to support the Stream interface
- /// </summary>
- public class HttpResponseStream : Stream {
- private HttpWriter _Writer;
-
- internal HttpResponseStream(HttpWriter Writer) {
- _Writer = Writer;
- }
-
- public override void Flush() {
- _Writer.Flush();
- }
-
- public override void Close() {
- _Writer.Close();
- }
-
- public override int Read(byte [] buffer, int offset, int length) {
- throw new NotSupportedException();
- }
-
- public override long Seek(long offset, SeekOrigin origin) {
- throw new NotSupportedException();
- }
-
- public override void SetLength(long length) {
- throw new NotSupportedException();
- }
-
- public override void Write(byte [] buffer, int offset, int length) {
- if (offset < 0) {
- throw new ArgumentOutOfRangeException("offset");
- }
-
- if (length <= 0) {
- throw new ArgumentOutOfRangeException("length");
- }
-
- _Writer.WriteBytes(buffer, offset, length);
- }
-
- public override bool CanRead {
- get {
- return false;
- }
- }
-
- public override bool CanSeek {
- get {
- return false;
- }
- }
-
- public override bool CanWrite {
- get {
- return true;
- }
- }
-
- public override long Length {
- get {
- throw new NotSupportedException();
- }
- }
-
- public override long Position {
- get {
- throw new NotSupportedException();
- }
-
- set {
- throw new NotSupportedException();
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpResponseStreamProxy.cs b/mcs/class/System.Web/System.Web/HttpResponseStreamProxy.cs
deleted file mode 100644
index 1ef2778f459..00000000000
--- a/mcs/class/System.Web/System.Web/HttpResponseStreamProxy.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Web.HttpResponseStreamProxy
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.IO;
-
-namespace System.Web {
- /// <summary>
- /// Used to detect if there is a valid filter proxy.
- /// </summary>
- public class HttpResponseStreamProxy : HttpResponseStream {
- bool _FilteringActive;
-
- internal HttpResponseStreamProxy(HttpWriter Writer) : base(Writer) {
- _FilteringActive = false;
- }
-
- internal void CheckFilteringState() {
- if (_FilteringActive) {
- throw new HttpException("Invalid response filter state");
- }
- }
-
- internal bool Active {
- get {
- return _FilteringActive;
- }
- set {
- _FilteringActive = value;
- }
- }
-
- public override void Flush() {
- }
-
- public override void Close() {
- }
-
- public override void Write(byte [] buffer, int offset, int length) {
- CheckFilteringState();
-
- Write(buffer, offset, length);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs
deleted file mode 100644
index cf3f805cb8b..00000000000
--- a/mcs/class/System.Web/System.Web/HttpRuntime.cs
+++ /dev/null
@@ -1,278 +0,0 @@
-//
-// System.Web.HttpRuntime
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-// Gaurav Vaish (gvaish@iitk.ac.in)
-//
-using System;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-using System.Web.UI;
-using System.Web.Utils;
-using System.Web.Caching;
-
-namespace System.Web {
-
- [MonoTODO ("Make corrent right now this is a simple impl to give us a base for testing... the methods here are not complete or valid")]
- public sealed class HttpRuntime {
- // Security permission helper objects
- private static IStackWalk appPathDiscoveryStackWalk;
- private static IStackWalk ctrlPrincipalStackWalk;
- private static IStackWalk sensitiveInfoStackWalk;
- private static IStackWalk unmgdCodeStackWalk;
- private static IStackWalk unrestrictedStackWalk;
- private static IStackWalk reflectionStackWalk;
-
- private static HttpRuntime runtime;
- private Cache cache;
-
- // TODO: Temp to test the framework..
- IHttpHandler handler;
-
- static HttpRuntime ()
- {
- appPathDiscoveryStackWalk = null;
- ctrlPrincipalStackWalk = null;
- sensitiveInfoStackWalk = null;
- unmgdCodeStackWalk = null;
- unrestrictedStackWalk = null;
-
- runtime = new HttpRuntime ();
- }
-
- public HttpRuntime ()
- {
- Init ();
- }
-
- private void Init ()
- {
- cache = new Cache ();
- }
-
- public static IHttpHandler Handler {
- get {
- return runtime.handler;
- }
-
- set {
- runtime.handler = value;
- }
- }
-
- public static void ProcessRequest (HttpWorkerRequest Request)
- {
- if (runtime.handler == null)
- throw new ArgumentException ("No handler");
-
- // just a test method to test the framework
-
- HttpContext oContext = new HttpContext (Request);
- runtime.handler.ProcessRequest (oContext);
-
- oContext.Response.FlushAtEndOfRequest ();
- Request.EndOfRequest ();
- }
-
- public static Cache Cache {
- get {
- return runtime.cache;
- }
- }
-
- [MonoTODO]
- public static string AppDomainAppId {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string AppDomainAppPath {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string AppDomainAppVirtualPath {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string AppDomainId {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string AspInstallDirectory {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string BinDirectory {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string ClrInstallDirectory {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string CodegenDir {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static bool IsOnUNCShare {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static string MachineConfigurationDirectory {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public static void Close ()
- {
- throw new NotImplementedException ();
- }
-
- internal static string FormatResourceString (string key)
- {
- return GetResourceString (key);
- }
-
- internal static string FormatResourceString (string key, string arg0)
- {
- string format = GetResourceString (key);
-
- if (format == null)
- return null;
-
- return String.Format (format, arg0);
- }
-
- [MonoTODO ("FormatResourceString (string, string, string)")]
- internal static string FormatResourceString (string key, string arg0, string type) {
- // String.Format (string, object, object);
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("FormatResourceString (string, string, string, string)")]
- internal static string FormatResourceString (string key, string arg0,
- string arg1, string arg2)
- {
- // String.Format (string, object, object, object);
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("FormatResourceString (string, string[]")]
- internal static string FormatResourceString (string key, string[] args)
- {
- // String.Format (string, object[]);
- throw new NotImplementedException ();
- }
-
- private static string GetResourceString (string key) {
- return runtime.GetResourceStringFromResourceManager (key);
- }
-
- [MonoTODO ("GetResourceStringFromResourceManager (string)")]
- private string GetResourceStringFromResourceManager (string key) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("Get Application path from the appdomain object")]
- internal static IStackWalk AppPathDiscovery {
- get {
- if (appPathDiscoveryStackWalk == null) {
- appPathDiscoveryStackWalk = new FileIOPermission (
- FileIOPermissionAccess.PathDiscovery, "<apppath>");
- }
- return appPathDiscoveryStackWalk;
- }
- }
-
- internal static IStackWalk ControlPrincipal {
- get {
- if (ctrlPrincipalStackWalk == null) {
- ctrlPrincipalStackWalk = new SecurityPermission (
- SecurityPermissionFlag.ControlPrincipal);
- }
- return ctrlPrincipalStackWalk;
- }
- }
-
- internal static IStackWalk Reflection {
- get {
- if (reflectionStackWalk == null) {
- reflectionStackWalk = new ReflectionPermission (
- ReflectionPermissionFlag.TypeInformation |
- ReflectionPermissionFlag.MemberAccess);
- }
- return reflectionStackWalk;
- }
- }
-
- internal static IStackWalk SensitiveInformation {
- get {
- if (sensitiveInfoStackWalk == null) {
- sensitiveInfoStackWalk = new EnvironmentPermission (
- PermissionState.Unrestricted);
- }
- return sensitiveInfoStackWalk;
- }
- }
-
- internal static IStackWalk UnmanagedCode {
- get {
- if (unmgdCodeStackWalk == null) {
- unmgdCodeStackWalk = new SecurityPermission (
- SecurityPermissionFlag.UnmanagedCode);
- }
- return unmgdCodeStackWalk;
- }
- }
-
- internal static IStackWalk Unrestricted {
- get {
- if (unrestrictedStackWalk == null) {
- unrestrictedStackWalk = new PermissionSet (
- PermissionState.Unrestricted);
- }
- return unrestrictedStackWalk;
- }
- }
-
- internal static IStackWalk FileReadAccess (string file)
- {
- return new FileIOPermission (FileIOPermissionAccess.Read, file);
- }
-
- internal static IStackWalk PathDiscoveryAccess (string path)
- {
- return new FileIOPermission (FileIOPermissionAccess.PathDiscovery, path);
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpServerUtility.cs b/mcs/class/System.Web/System.Web/HttpServerUtility.cs
deleted file mode 100644
index c41d72d9d56..00000000000
--- a/mcs/class/System.Web/System.Web/HttpServerUtility.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: HttpServerUtility
- *
- * Author: Wictor Wilén
- * Contact: <wictor@ibizkit.se>, <patrik.torstensson@labs2.com>
- * Status: ?%
- *
- * (C) Wictor Wilén (2002)
- * ---------------------------------------
- * 2002-03-27 Wictor Started implementation
- * 2002-04-09 Patrik Added HttpContext constructor
- * 2002-04-10 Patrik Moved encoding to HttpUtility and
- * fixed all functions that used
- * HttpContext
- *
- */
-using System;
-using System.IO;
-
-namespace System.Web {
- public sealed class HttpServerUtility {
-
- private static string _name = "";
-
- private HttpContext _Context;
- private HttpApplication _Application;
-
- [MonoTODO()]
- internal HttpServerUtility(HttpContext Context) {
- _Context = Context;
- }
-
- [MonoTODO()]
- internal HttpServerUtility(HttpApplication app) {
- _Application = app;
- }
-
- // Properties
-
-
- /// <summary>
- /// Gets the server's computer name.
- /// </summary>
- public string MachineName {
- get {
- if(_name.Length == 0) {
- _name = Environment.MachineName;
- }
- return _name;
- }
- }
- /// <summary>
- /// Gets and sets the request time-out in seconds.
- /// </summary>
- [MonoTODO()]
- public int ScriptTimeout {
- get {
- throw new System.NotImplementedException();
- }
- set {
- throw new System.NotImplementedException();
- }
- }
-
- // Methods
-
- /// <summary>
- /// Clears the previous exception.
- /// </summary>
- public void ClearError() {
- if (null != _Context) {
- _Context.ClearError();
- return;
- }
-
- if (null != _Application) {
- _Application.ClearError();
- }
- }
-
-
- /// <summary>
- /// Creates a server instance of a COM object identified by the object's Programmatic Identifier (ProgID).
- /// </summary>
- /// <param name="progID">The class or type of object to be instantiated. </param>
- /// <returns>The new object.</returns>
- public object CreateObject(string progID) {
- return CreateObject(Type.GetTypeFromProgID(progID));
- }
-
-
- /// <summary>
- /// Creates a server instance of a COM object identified by the object's type.
- /// </summary>
- /// <param name="type">A Type representing the object to create. </param>
- /// <returns>The new object.</returns>
- [MonoTODO()]
- public object CreateObject(Type type) {
- Object o;
- o = Activator.CreateInstance(type);
-
- // TODO: Call OnStartPage()
-
- return o;
- }
-
-
- /// <summary>
- /// Creates a server instance of a COM object identified by the object's class identifier (CLSID).
- /// </summary>
- /// <param name="clsid">The class identifier of the object to be instantiated. </param>
- /// <returns>The new object.</returns>
- public object CreateObjectFromClsid(string clsid) {
- Guid guid = new Guid(clsid);
- return CreateObject(Type.GetTypeFromCLSID(guid));
- }
-
-
- /// <summary>
- /// Executes a request to another page using the specified URL path to the page.
- /// </summary>
- /// <param name="path">The URL path of the new request. </param>
- [MonoTODO()]
- public void Execute(string path) {
- throw new System.NotImplementedException();
- }
-
-
- /// <summary>
- /// Executes a request to another page using the specified URL path to the page. A TextWriter captures output from the page.
- /// </summary>
- /// <param name="path">The URL path of the new request. </param>
- /// <param name="writer">The TextWriter to capture the output. </param>
- [MonoTODO()]
- public void Execute(string path, TextWriter writer ) {
- throw new System.NotImplementedException();
- }
-
-
-
- /// <summary>
- /// Returns the previous exception.
- /// </summary>
- /// <returns>The previous exception that was thrown.</returns>
- [MonoTODO()]
- public Exception GetLastError() {
- throw new System.NotImplementedException();
- }
-
-
-
- /// <summary>
- /// Decodes an HTML-encoded string and returns the decoded string.
- /// </summary>
- /// <param name="s">The HTML string to decode. </param>
- /// <returns>The decoded text.</returns>
- [MonoTODO()]
- public string HtmlDecode(string s) {
- return HttpUtility.HtmlDecode(s);
- }
-
-
- /// <summary>
- /// Decodes an HTML-encoded string and sends the resulting output to a TextWriter output stream.
- /// </summary>
- /// <param name="s">The HTML string to decode</param>
- /// <param name="output">The TextWriter output stream containing the decoded string. </param>
- public void HtmlDecode(string s, TextWriter output) {
- output.Write(HttpUtility.HtmlDecode(s));
- }
-
- /// <summary>
- /// HTML-encodes a string and returns the encoded string.
- /// </summary>
- /// <param name="s">The text string to encode. </param>
- /// <returns>The HTML-encoded text.</returns>
- public string HtmlEncode(string s) {
- return HttpUtility.HtmlEncode(s);
- }
-
- /// <summary>
- /// HTML-encodes a string and sends the resulting output to a TextWriter output stream.
- /// </summary>
- /// <param name="s">The string to encode. </param>
- /// <param name="output">The TextWriter output stream containing the encoded string. </param>
- public void HtmlEncode( string s, TextWriter output) {
- output.Write(HtmlEncode(s));
- }
-
-
- /// <summary>
- /// Returns the physical file path that corresponds to the specified virtual path on the Web server.
- /// </summary>
- /// <param name="path">The virtual path on the Web server. </param>
- /// <returns>The physical file path that corresponds to path.</returns>
- public string MapPath(string path) {
- if (null == _Context) {
- throw new HttpException("MapPath is not available");
- }
-
- return _Context.Request.MapPath(path);
- }
-
- /// <summary>
- /// Terminates execution of the current page and begins execution of a new page using the specified URL path to the page.
- /// </summary>
- /// <param name="path">The URL path of the new page on the server to execute. </param>
- [MonoTODO()]
- public void Transfer(string path) {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Terminates execution of the current page and begins execution of a new page using the specified URL path to the page. Specifies whether to clear the QueryString and Form collections.
- /// </summary>
- /// <param name="path">The URL path of the new page on the server to execute. </param>
- /// <param name="preserveForm">If true, the QueryString and Form collections are preserved. If false, they are cleared. The default is false. </param>
- [MonoTODO()]
- public void Transfer(string path, bool preserveForm ) {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// URL-decodes a string and returns the decoded string.
- /// </summary>
- /// <param name="s">The text string to decode. </param>
- /// <returns>The decoded text.</returns>
- /// <remarks>
- /// Post/html encoding @ ftp://ftp.isi.edu/in-notes/rfc1866.txt
- /// Uncomment the line marked with RFC1738 to get pure RFC1738
- /// and it will also consider the RFC1866 (ftp://ftp.isi.edu/in-notes/rfc1866.txt)
- /// `application/x-www-form-urlencoded' format
- /// </remarks>
- public string UrlDecode(string s) {
- return HttpUtility.UrlDecode(s);
- }
-
- /// <summary>
- /// Decodes an HTML string received in a URL and sends the resulting output to a TextWriter output stream.
- /// </summary>
- /// <param name="s"></param>
- /// <param name="output"></param>
- public void UrlDecode(string s, TextWriter output) {
- output.Write(UrlDecode(s));
- }
-
- /// <summary>
- /// URL-encodes a string and returns the encoded string.
- /// </summary>
- /// <param name="s">The text to URL-encode. </param>
- /// <returns>The URL encoded text.</returns>
- public string UrlEncode(string s) {
- return HttpUtility.UrlEncode(s);
- }
-
- /// <summary>
- /// URL encodes a string and sends the resulting output to a TextWriter output stream.
- /// </summary>
- /// <param name="s">The text string to encode. </param>
- /// <param name="output">The TextWriter output stream containing the encoded string. </param>
- public void UrlEncode(string s, TextWriter output) {
- output.Write(UrlEncode(s));
- }
-
- /// <summary>
- /// URL-encodes the path portion of a URL string and returns the encoded string.
- /// </summary>
- /// <param name="s">The text to URL-encode.</param>
- /// <returns>The URL encoded text.</returns>
- /// <remarks>Does not do any browser specific adjustments, just encode everything</remarks>
- public string UrlPathEncode(string s) {
- // find the path portion (?)
- int idx = s.IndexOf("?");
- string s2 = s.Substring(0, idx-1);
- s2 = UrlEncode(s2);
- s2 += s.Substring(idx);
-
- return s2;
- }
-
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpSessionState.cs b/mcs/class/System.Web/System.Web/HttpSessionState.cs
deleted file mode 100644
index 5500050c192..00000000000
--- a/mcs/class/System.Web/System.Web/HttpSessionState.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Web.HttpSessionState
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-
-namespace System.Web {
- [MonoTODO()]
- public class HttpSessionState {
- public HttpSessionState() {
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs b/mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs
deleted file mode 100644
index 30b26fce1ab..00000000000
--- a/mcs/class/System.Web/System.Web/HttpStaticObjectsCollection.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.Collections;
-
-namespace System.Web {
- public sealed class HttpStaticObjectsCollection : ICollection, IEnumerable {
- private Hashtable _Objects;
-
- // Needs to hold object items that can be latebound and can be serialized
- public HttpStaticObjectsCollection() {
- _Objects = new Hashtable();
- }
-
- public object GetObject(string name) {
- return this[name];
- }
-
- [MonoTODO()]
- public IEnumerator GetEnumerator() {
- throw new NotImplementedException();
- }
-
- public void CopyTo(Array array, int index) {
- IEnumerator Enum = GetEnumerator();
- while (Enum.MoveNext()) {
- array.SetValue(Enum.Current, ++index);
- }
- }
-
- internal IDictionary GetObjects() {
- return _Objects;
- }
-
- [MonoTODO()]
- public object this[string name] {
- get {
- throw new NotImplementedException();
- }
- }
-
- public int Count {
- get {
- return _Objects.Count;
- }
- }
-
- public bool IsReadOnly {
- get {
- return true;
- }
- }
-
- public bool IsSynchronized {
- get {
- return false;
- }
- }
-
- public object SyncRoot {
- get {
- return this;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpUtility.cs b/mcs/class/System.Web/System.Web/HttpUtility.cs
deleted file mode 100644
index 206b8abb961..00000000000
--- a/mcs/class/System.Web/System.Web/HttpUtility.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// System.Web.HttpUtility
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-// Wictor Wilén (decode/encode functions) (wictor@ibizkit.se)
-//
-using System;
-using System.Text;
-using System.IO;
-
-namespace System.Web {
- public sealed class HttpUtility {
- // private stuff
- private const string _hex = "0123456789ABCDEF";
- private const string _chars = "<>;:.?=&@*+%/\\";
-
- public HttpUtility() {
- }
-
- public static void HtmlAttributeEncode(string s, TextWriter output) {
- output.Write(HtmlAttributeEncode(s));
- }
-
- public static string HtmlAttributeEncode(string s) {
- if (null == s) {
- return s;
- }
-
- StringBuilder oStr = new StringBuilder(128);
-
- for (int i = 0; i != s.Length; i++) {
- if (s[i] == '&') {
- oStr.Append("&amp;");
- } else
- if (s[i] == '"') {
- oStr.Append("&quot;");
- } else {
- oStr.Append(s[i]);
- }
- }
-
- return oStr.ToString();
- }
-
- public static string UrlDecode(string str) {
- return UrlDecode(str, Encoding.UTF8);
- }
-
- [MonoTODO("Use Encoding")]
- public static string UrlDecode(string s, Encoding Enc) {
- if (null == s) {
- return null;
- }
-
- string dest = "";
- long len = s.Length;
- string tmp = "";
-
-
- for(int i = 0; i < len; i++) {
- if(s[i] == '%') {
- tmp = s[i+1].ToString ();
- tmp += s[i+2];
- dest += char.Parse(tmp);
- }
- else if( s[i] == '+') {
- dest += " ";
- }
- else
- dest += s[i];
-
- }
- return dest;
- }
-
-
-
- public static string UrlEncode(string str) {
- return UrlDecode(str, Encoding.UTF8);
- }
-
- [MonoTODO("Use encoding")]
- public static string UrlEncode(string s, Encoding Enc) {
- if (null == s) {
- return null;
- }
-
- string dest = "";
- long len = s.Length;
- int h1, h2;
-
- for(int i = 0; i < len; i++) {
- if(s[i] == ' ') // space character is replaced with '+'
- dest += "+";
- else if ( _chars.IndexOf(s[i]) >= 0 ) {
- h1 = (int)s[i] % 16;
- h2 = (int)s[i] / 16;
- dest += "%";
- dest += _hex[h1].ToString();
- dest += _hex[h2].ToString();
- }
- else
- dest += s[i].ToString();
-
- }
- return dest;
- }
-
- /// <summary>
- /// Decodes an HTML-encoded string and returns the decoded string.
- /// </summary>
- /// <param name="s">The HTML string to decode. </param>
- /// <returns>The decoded text.</returns>
- [MonoTODO()]
- public static string HtmlDecode(string s) {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Decodes an HTML-encoded string and sends the resulting output to a TextWriter output stream.
- /// </summary>
- /// <param name="s">The HTML string to decode</param>
- /// <param name="output">The TextWriter output stream containing the decoded string. </param>
- [MonoTODO()]
- public static void HtmlDecode(string s, TextWriter output) {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// HTML-encodes a string and returns the encoded string.
- /// </summary>
- /// <param name="s">The text string to encode. </param>
- /// <returns>The HTML-encoded text.</returns>
- public static string HtmlEncode(string s) {
- string dest = "";
- long len = s.Length;
- int v;
-
-
-
- for(int i = 0; i < len; i++) {
- switch(s[i]) {
- case '>':
- dest += "&gt;";
- break;
- case '<':
- dest += "&lt;";
- break;
- case '"':
- dest += "&quot;";
- break;
- case '&':
- dest += "&amp;";
- break;
- default:
- if(s[i] >= 128) {
- dest += "&H";
- v = (int) s[i];
- dest += v.ToString() ;
-
- }
- else
- dest += s[i];
- break;
- }
- }
- return dest;
- }
-
- /// <summary>
- /// HTML-encodes a string and sends the resulting output to a TextWriter output stream.
- /// </summary>
- /// <param name="s">The string to encode. </param>
- /// <param name="output">The TextWriter output stream containing the encoded string. </param>
- public static void HtmlEncode( string s, TextWriter output) {
- output.Write(HtmlEncode(s));
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/HttpValidationStatus.cs b/mcs/class/System.Web/System.Web/HttpValidationStatus.cs
deleted file mode 100644
index 6338b59d613..00000000000
--- a/mcs/class/System.Web/System.Web/HttpValidationStatus.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.HttpValidationStatus.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum HttpValidationStatus
- {
- IgnoreThisRequest,
- Invalid,
- Valid
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/HttpValueCollection.cs b/mcs/class/System.Web/System.Web/HttpValueCollection.cs
deleted file mode 100644
index 018234198b7..00000000000
--- a/mcs/class/System.Web/System.Web/HttpValueCollection.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-//
-// System.Web.HttpValueCollection
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.Collections.Specialized;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace System.Web {
-
- [Serializable]
- public class HttpValueCollection : NameValueCollection {
- private bool _bHeaders;
-
- internal HttpValueCollection() {
- _bHeaders = false;
- }
-
- internal HttpValueCollection(string sData) {
- FillFromQueryString(sData, Encoding.UTF8);
- IsReadOnly = true;
- }
-
- internal HttpValueCollection(string sData, bool ReadOnly, Encoding encoding) {
- FillFromQueryString(sData, encoding);
- IsReadOnly = ReadOnly;
- }
-
- protected HttpValueCollection(SerializationInfo info, StreamingContext context) : base(info, context) {
- }
-
- // string = header1: value1\r\nheader2: value2
- internal void FillFromHeaders(string sHeaders, Encoding encoding) {
- _bHeaders = true;
- char [] arrSplitValue = new char [] {':'};
- string sKey, sValue;
-
- sKey = "";
- sValue = "";
-
- string [] arrValues = sHeaders.Split(new char [] {'\r', '\n'});
- foreach (string sLine in arrValues) {
- string [] arrKeyValue = sLine.Split(arrSplitValue);
- if (arrKeyValue.Length == 1 && arrKeyValue[0].Length == 0) {
- // Empty \r or \n is ignored
- continue;
- }
-
- if (arrKeyValue[0] != sKey && sKey.Length > 0) {
- Add(System.Web.HttpUtility.UrlDecode(sKey, encoding), System.Web.HttpUtility.UrlDecode(sValue, encoding));
- }
-
- if (arrKeyValue.Length == 1) {
- sValue += "\r\n" + arrKeyValue[0].Trim();
- continue;
- }
- else if (arrKeyValue.Length == 2) {
- if (arrKeyValue[0].Length == 0) {
- sValue += arrKeyValue[1].Trim();
- continue;
- }
-
- sKey = arrKeyValue[0].Trim();
- sValue = arrKeyValue[1].Trim();
- }
- }
-
- if (sKey.Length > 0) {
- Add(System.Web.HttpUtility.UrlDecode(sKey, encoding), System.Web.HttpUtility.UrlDecode(sValue, encoding));
- }
- }
-
- internal void FillFromHeaders(string sData) {
- FillFromHeaders(sData, Encoding.UTF8);
- }
-
- // String = test=aaa&kalle=nisse
- internal void FillFromQueryString(string sData, Encoding encoding) {
- _bHeaders = false;
-
- char [] arrSplitValue = new char [] {'='};
-
- string [] arrValues = sData.Split(new char [] {'&'});
- foreach (string sValue in arrValues) {
- string [] arrKeyValue = sValue.Split(arrSplitValue);
- if (arrKeyValue.Length == 1) {
- // Add key only
- Add(System.Web.HttpUtility.UrlDecode(arrKeyValue[0].Trim(), encoding), string.Empty);
- }
- else if (arrKeyValue.Length == 2) {
- Add(System.Web.HttpUtility.UrlDecode(arrKeyValue[0].Trim(), encoding),System.Web.HttpUtility.UrlDecode(arrKeyValue[1].Trim(), encoding));
- }
- else {
- throw new InvalidOperationException("Data is malformed");
- }
- }
- }
-
- internal void FillFromQueryString(string sData) {
- FillFromQueryString(sData, Encoding.UTF8);
- }
-
- internal void FillFromCookieString(string sData) {
- FillFromQueryString(sData, Encoding.UTF8);
- }
-
- internal void MakeReadOnly() {
- IsReadOnly = true;
- }
-
- internal void MakeReadWrite() {
- IsReadOnly = false;
- }
-
- internal void Merge(NameValueCollection oData) {
- foreach (string sKey in oData) {
- Add(sKey, oData[sKey]);
- }
- }
-
- internal void Reset() {
- Clear();
- }
-
- [MonoTODO("string ToString(bool UrlEncode)")]
- internal string ToString(bool UrlEncode) {
- if (_bHeaders) {
- }
-
- // TODO: Should return a correctly formated string (different depending on header flag)
- throw new NotImplementedException();
- }
-
- virtual new public string ToString() {
- return ToString(false);
- }
- }
-
-}
diff --git a/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs b/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
deleted file mode 100644
index e1bf3c981a7..00000000000
--- a/mcs/class/System.Web/System.Web/HttpWorkerRequest.cs
+++ /dev/null
@@ -1,477 +0,0 @@
-//
-// System.Web.HttpResponseStreamProxy
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-// (constants from Bob Smith (bob@thestuff.net))
-//
-using System;
-using System.Collections;
-
-namespace System.Web {
- public abstract class HttpWorkerRequest {
- public delegate void EndOfSendNotification(HttpWorkerRequest wr, object extraData);
-
- public const int HeaderAccept = 20;
- public const int HeaderAcceptCharset = 21;
- public const int HeaderAcceptEncoding = 22;
- public const int HeaderAcceptLanguage = 23;
- public const int HeaderAcceptRanges = 20;
- public const int HeaderAge = 21;
- public const int HeaderAllow = 10;
- public const int HeaderAuthorization = 24;
- public const int HeaderCacheControl = 0;
- public const int HeaderConnection = 1;
- public const int HeaderContentEncoding = 13;
- public const int HeaderContentLanguage = 14;
- public const int HeaderContentLength = 11;
- public const int HeaderContentLocation = 15;
- public const int HeaderContentMd5 = 16;
- public const int HeaderContentRange = 17;
- public const int HeaderContentType = 12;
- public const int HeaderCookie = 25;
- public const int HeaderDate = 2;
- public const int HeaderEtag = 22;
- public const int HeaderExpect = 26;
- public const int HeaderExpires = 18;
- public const int HeaderFrom = 27;
- public const int HeaderHost = 28;
- public const int HeaderIfMatch = 29;
- public const int HeaderIfModifiedSince = 30;
- public const int HeaderIfNoneMatch = 31;
- public const int HeaderIfRange = 32;
- public const int HeaderIfUnmodifiedSince = 33;
- public const int HeaderKeepAlive = 3;
- public const int HeaderLastModified = 19;
- public const int HeaderLocation = 23;
- public const int HeaderMaxForwards = 34;
- public const int HeaderPragma = 4;
- public const int HeaderProxyAuthenticate = 24;
- public const int HeaderProxyAuthorization = 35;
- public const int HeaderRange = 37;
- public const int HeaderReferer = 36;
- public const int HeaderRetryAfter = 25;
- public const int HeaderServer = 26;
- public const int HeaderSetCookie = 27;
- public const int HeaderTe = 38;
- public const int HeaderTrailer = 5;
- public const int HeaderTransferEncoding = 6;
- public const int HeaderUpgrade = 7;
- public const int HeaderUserAgent = 39;
- public const int HeaderVary = 28;
- public const int HeaderVia = 8;
- public const int HeaderWarning = 9;
- public const int HeaderWwwAuthenticate = 29;
- public const int ReasonCachePolicy = 2;
- public const int ReasonCacheSecurity = 3;
- public const int ReasonClientDisconnect = 4;
- public const int ReasonDefault = 0;
- public const int ReasonFileHandleCacheMiss = 1;
- public const int ReasonResponseCacheMiss = 0;
- public const int RequestHeaderMaximum = 40;
- public const int ResponseHeaderMaximum = 30;
-
- static string [][] s_HttpStatusDescriptions;
- static string [] s_HttpRequestHeaderNames;
- static string [] s_HttpResponseHeaderNames;
-
- static Hashtable s_HttpResponseHeadersTable;
- static Hashtable s_HttpRequestHeaderTable;
-
- static HttpWorkerRequest() {
- string[] sSubCodes;
-
- s_HttpStatusDescriptions = new string[6][];
-
- sSubCodes = new String[3];
- sSubCodes[0] = "Continue";
- sSubCodes[1] = "Switching Protocols";
- sSubCodes[2] = "Processing";
- s_HttpStatusDescriptions[1] = sSubCodes;
-
- sSubCodes = new String[8];
- sSubCodes[0] = "OK";
- sSubCodes[1] = "Created";
- sSubCodes[2] = "Accepted";
- sSubCodes[3] = "Non-Authoritative Information";
- sSubCodes[4] = "No Content";
- sSubCodes[5] = "Reset Content";
- sSubCodes[6] = "Partial Content";
- sSubCodes[7] = "Multi-Status";
- s_HttpStatusDescriptions[2] = sSubCodes;
-
- sSubCodes = new String[8];
- sSubCodes[0] = "Multiple Choices";
- sSubCodes[1] = "Moved Permanently";
- sSubCodes[2] = "Found";
- sSubCodes[3] = "See Other";
- sSubCodes[4] = "Not Modified";
- sSubCodes[5] = "Use Proxy";
- sSubCodes[6] = "";
- sSubCodes[7] = "Temporary Redirect";
- s_HttpStatusDescriptions[3] = sSubCodes;
-
- sSubCodes = new String[24];
- sSubCodes[0] = "Bad Request";
- sSubCodes[1] = "Unauthorized";
- sSubCodes[2] = "Payment Required";
- sSubCodes[3] = "Forbidden";
- sSubCodes[4] = "Not Found";
- sSubCodes[5] = "Method Not Allowed";
- sSubCodes[6] = "Not Acceptable";
- sSubCodes[7] = "Proxy Authentication Required";
- sSubCodes[8] = "Request Timeout";
- sSubCodes[9] = "Conflict";
- sSubCodes[10] = "Gone";
- sSubCodes[11] = "Length Required";
- sSubCodes[12] = "Precondition Failed";
- sSubCodes[13] = "Request Entity Too Large";
- sSubCodes[14] = "Request-Uri Too Long";
- sSubCodes[15] = "Unsupported Media Type";
- sSubCodes[16] = "Requested Range Not Satisfiable";
- sSubCodes[17] = "Expectation Failed";
- sSubCodes[18] = "";
- sSubCodes[19] = "";
- sSubCodes[20] = "";
- sSubCodes[21] = "Unprocessable Entity";
- sSubCodes[22] = "Locked";
- sSubCodes[23] = "Failed Dependency";
- s_HttpStatusDescriptions[4] = sSubCodes;
-
- sSubCodes = new String[8];
- sSubCodes[0] = "Internal Server Error";
- sSubCodes[1] = "Not Implemented";
- sSubCodes[2] = "Bad Gateway";
- sSubCodes[3] = "Service Unavailable";
- sSubCodes[4] = "Gateway Timeout";
- sSubCodes[5] = "Http Version Not Supported";
- sSubCodes[6] = "";
- sSubCodes[7] = "Insufficient Storage";
- s_HttpStatusDescriptions[5] = sSubCodes;
-
- InitLookupTables();
- }
-
- protected HttpWorkerRequest() {
- }
-
- static private void InitLookupTables() {
- // Performance arrays
- s_HttpRequestHeaderNames = new string[40];
- s_HttpResponseHeaderNames = new string[30];
-
- // Lookup tables (name -> id)
- s_HttpRequestHeaderTable = new Hashtable();
- s_HttpResponseHeadersTable = new Hashtable();
-
- AddHeader(true, true, 0, "Cache-Control");
- AddHeader(true, true, 1, "Connection");
- AddHeader(true, true, 2, "Date");
- AddHeader(true, true, 3, "Keep-Alive");
- AddHeader(true, true, 4, "Pragma");
- AddHeader(true, true, 5, "Trailer");
- AddHeader(true, true, 6, "Transfer-Encoding");
- AddHeader(true, true, 7, "Upgrade");
- AddHeader(true, true, 8, "Via");
- AddHeader(true, true, 9, "Warning");
- AddHeader(true, true, 10, "Allow");
- AddHeader(true, true, 11, "Content-Length");
- AddHeader(true, true, 12, "Content-Type");
- AddHeader(true, true, 13, "Content-Encoding");
- AddHeader(true, true, 14, "Content-Language");
- AddHeader(true, true, 15, "Content-Location");
- AddHeader(true, true, 16, "Content-MD5");
- AddHeader(true, true, 17, "Content-Range");
- AddHeader(true, true, 18, "Expires");
- AddHeader(true, true, 19, "Last-Modified");
- AddHeader(true, false, 20, "Accept");
- AddHeader(true, false, 21, "Accept-Charset");
- AddHeader(true, false, 22, "Accept-Encoding");
- AddHeader(true, false, 23, "Accept-Language");
- AddHeader(true, false, 24, "Authorization");
- AddHeader(true, false, 25, "Cookie");
- AddHeader(true, false, 26, "Expect");
- AddHeader(true, false, 27, "From");
- AddHeader(true, false, 28, "Host");
- AddHeader(true, false, 29, "If-Match");
- AddHeader(true, false, 30, "If-Modified-Since");
- AddHeader(true, false, 31, "If-None-Match");
- AddHeader(true, false, 32, "If-Range");
- AddHeader(true, false, 33, "If-Unmodified-Since");
- AddHeader(true, false, 34, "Max-Forwards");
- AddHeader(true, false, 35, "Proxy-Authorization");
- AddHeader(true, false, 36, "Referer");
- AddHeader(true, false, 37, "Range");
- AddHeader(true, false, 38, "TE");
- AddHeader(true, false, 39, "User-Agent");
- AddHeader(false, true, 20, "Accept-Ranges");
- AddHeader(false, true, 21, "Age");
- AddHeader(false, true, 22, "ETag");
- AddHeader(false, true, 23, "Location");
- AddHeader(false, true, 24, "Proxy-Authenticate");
- AddHeader(false, true, 25, "Retry-After");
- AddHeader(false, true, 26, "Server");
- AddHeader(false, true, 27, "Set-Cookie");
- AddHeader(false, true, 28, "Vary");
- AddHeader(false, true, 29, "WWW-Authenticate");
- }
-
- static private void AddHeader(bool bRequest, bool bResponse, int iID, string sHeader) {
- if (bResponse) {
- s_HttpResponseHeaderNames[iID] = sHeader;
- s_HttpResponseHeadersTable.Add(sHeader, iID);
- }
-
- if (bRequest) {
- s_HttpRequestHeaderNames[iID] = sHeader;
- s_HttpRequestHeaderTable.Add(sHeader, iID);
- }
- }
-
- public virtual void CloseConnection() {}
- public abstract void EndOfRequest();
- public abstract void FlushResponse(bool finalFlush);
-
- public virtual string GetAppPath() {
- return null;
- }
-
- public virtual string GetAppPathTranslated() {
- return null;
- }
-
- public virtual string GetAppPoolID() {
- return null;
- }
-
- public virtual long GetBytesRead() {
- return 0;
- }
-
- public virtual byte[] GetClientCertificate() {
- return new byte[0];
- }
-
- public virtual byte[] GetClientCertificateBinaryIssuer() {
- return new byte[0];
- }
-
- public virtual int GetClientCertificateEncoding() {
- return 0;
- }
-
- public virtual byte[] GetClientCertificatePublicKey() {
- return new byte[0];
- }
-
- public virtual DateTime GetClientCertificateValidFrom() {
- return DateTime.Now;
- }
-
- public virtual DateTime GetClientCertificateValidUntil() {
- return DateTime.Now;
- }
-
- public virtual long GetConnectionID() {
- return 0;
- }
-
- public virtual string GetFilePath() {
- return GetUriPath();
- }
-
- public virtual string GetFilePathTranslated() {
- return null;
- }
-
- public abstract string GetHttpVerbName();
- public abstract string GetHttpVersion();
-
- public virtual string GetKnownRequestHeader(int index) {
- return null;
- }
-
- public static int GetKnownRequestHeaderIndex(string header) {
- object Index;
- Index = s_HttpRequestHeaderTable[header];
- if (null != Index) {
- return (Int32) Index;
- }
-
- return -1;
- }
-
- public static string GetKnownRequestHeaderName(int index) {
- return s_HttpRequestHeaderNames[index];
- }
-
- public static int GetKnownResponseHeaderIndex(string header) {
- object Index;
-
- Index = s_HttpResponseHeadersTable[header];
- if (null != Index) {
- return (Int32) Index;
- }
-
- return -1;
- }
-
- public static string GetKnownResponseHeaderName(int index) {
- return s_HttpResponseHeaderNames[index];
- }
-
- public abstract string GetLocalAddress();
- public abstract int GetLocalPort();
-
- public virtual string GetPathInfo() {
- return "";
- }
-
- public virtual byte[] GetPreloadedEntityBody() {
- return null;
- }
-
- public virtual string GetProtocol() {
- if (IsSecure()) {
- return "HTTPS";
- }
-
- return "HTTP";
- }
-
- public abstract string GetQueryString();
-
- public virtual byte[] GetQueryStringRawBytes() {
- return null;
- }
-
- public abstract string GetRawUrl();
- public abstract string GetRemoteAddress();
-
- public virtual string GetRemoteName() {
- return GetRemoteAddress();
- }
-
- public abstract int GetRemotePort();
-
- public virtual int GetRequestReason() {
- return 0;
- }
-
- public virtual string GetServerName() {
- return GetLocalAddress();
- }
-
- public virtual string GetServerVariable(string name) {
- return null;
- }
-
- public static string GetStatusDescription(int code) {
- if (code>= 100 && code < 600) {
- int iMajor = code / 100;
- int iMinor = code % 100;
- if (iMinor < (int) s_HttpStatusDescriptions[iMajor].Length) {
- return s_HttpStatusDescriptions[iMajor][iMinor];
- }
- }
-
- return "";
- }
-
- public virtual string GetUnknownRequestHeader(string name) {
- return null;
- }
-
- [CLSCompliant(false)]
- public virtual string[][] GetUnknownRequestHeaders() {
- return null;
- }
-
- public abstract string GetUriPath();
-
- public virtual long GetUrlContextID() {
- return 0;
- }
-
- public virtual IntPtr GetUserToken() {
- throw new NotSupportedException();
- }
-
- public virtual IntPtr GetVirtualPathToken() {
- throw new NotSupportedException();
- }
-
- public bool HasEntityBody() {
- string sContentLength = GetKnownRequestHeader(HeaderContentLength);
- if (null != sContentLength && sContentLength != "0") {
- return true;
- }
-
- if (null != GetKnownRequestHeader(HeaderTransferEncoding)) {
- return true;
- }
-
- if (null != GetPreloadedEntityBody() || IsEntireEntityBodyIsPreloaded()) {
- return true;
- }
-
- return false;
- }
-
- public virtual bool HeadersSent() {
- return true;
- }
-
- public virtual bool IsClientConnected() {
- return true;
- }
-
- public virtual bool IsEntireEntityBodyIsPreloaded() {
- return false;
- }
-
- public virtual bool IsSecure() {
- return false;
- }
-
- public virtual string MapPath(string virtualPath) {
- return null;
- }
-
- public virtual int ReadEntityBody(byte[] buffer, int size) {
- return 0;
- }
-
- public virtual void SendCalculatedContentLength(int contentLength) {
- }
-
- public abstract void SendKnownResponseHeader(int index, string value);
- public abstract void SendResponseFromFile(IntPtr handle, long offset, long length);
- public abstract void SendResponseFromFile(string filename, long offset, long length);
- public abstract void SendResponseFromMemory(byte[] data, int length);
-
- [MonoTODO("Should we support this method? We could just use the stringresource to build a string and then send it via SendResponseFromMemory?")]
- public virtual void SendResponseFromMemory(IntPtr data, int length) {
- throw new NotSupportedException();
- }
-
- public abstract void SendStatus(int statusCode, string statusDescription);
- public abstract void SendUnknownResponseHeader(string name, string value);
-
- public virtual void SetEndOfSendNotification(HttpWorkerRequest.EndOfSendNotification callback, object extraData) {
- }
-
- public virtual string MachineConfigPath {
- get {
- return null;
- }
- }
-
- public virtual string MachineInstallDirectory {
- get {
- return null;
- }
- }
- }
-}
-
diff --git a/mcs/class/System.Web/System.Web/HttpWriter.cs b/mcs/class/System.Web/System.Web/HttpWriter.cs
deleted file mode 100644
index f34dc5c33ed..00000000000
--- a/mcs/class/System.Web/System.Web/HttpWriter.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-//
-// System.Web.HttpWriter
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-using System.IO;
-using System.Text;
-
-namespace System.Web {
- public sealed class HttpWriter : TextWriter {
- private HttpResponse _Response;
-
- private HttpResponseStream _ResponseStream;
-
- private MemoryStream _OutputStream;
- private StreamWriter _OutputHelper;
- private Encoder _Encoder;
- private Encoding _Encoding;
-
- private Stream _OutputFilter;
- private HttpResponseStreamProxy _OutputProxy;
-
- internal HttpWriter(HttpResponse Response) {
- _Response = Response;
-
- _OutputStream = new MemoryStream(32768);
- _OutputHelper = new StreamWriter(_OutputStream, Encoding.Unicode);
- _ResponseStream = new HttpResponseStream(this);
-
- Update();
- }
-
- internal void Dispose() {
- _OutputHelper.Close();
- _OutputStream.Close();
-
- _OutputFilter.Close();
- }
-
- internal Stream GetActiveFilter() {
- if (null == _OutputFilter) {
- if (null == _OutputProxy) {
- // Create a filter proxy to allow us to know if we have a valid filter
- _OutputProxy = new HttpResponseStreamProxy(this);
- }
-
- return _OutputProxy;
- }
-
- return _OutputFilter;
- }
-
- internal void ActivateFilter(Stream OutputFilter) {
- if (null == _OutputProxy) {
- throw new HttpException("Invalid filter usage");
- }
-
- _OutputFilter = OutputFilter;
- }
-
- internal void FilterData(bool CloseStream) {
- // Check if we have any filter at all
- if (null == _OutputFilter) {
- return;
- }
-
- FlushBuffers();
-
- // Save our current data
- byte [] arrData = _OutputStream.ToArray();
-
- // Remove our internal data
- Clear();
-
- // If we have a filter then we have a proxy
- _OutputProxy.Active = true;
-
- try {
- // Call the filter (it does a callback into our HttpWriter again)
- _OutputFilter.Write(arrData, 0, arrData.Length);
-
- if (CloseStream) {
- _OutputFilter.Close();
- }
- }
- finally {
- _OutputProxy.Active = false;
- }
- }
-
- internal void Clear() {
- _OutputHelper.Close();
- _OutputStream.Close();
-
- // Quick way of doing cleanup
- _OutputStream = new MemoryStream(32768);
- _OutputHelper = new StreamWriter(_OutputStream, Encoding.Unicode);
- }
-
- internal byte [] ToArray() {
- if (_OutputStream.Length == 0) {
- return null;
- }
-
- // TODO: Optimize
- byte [] arrStream = _OutputStream.ToArray();
- byte [] arrData = new byte [arrStream.Length - 2];
-
- Buffer.BlockCopy(arrStream, 2, arrData, 0, arrStream.Length - 2);
-
- byte [] arrContent = _Encoding.GetBytes(Encoding.Unicode.GetString(arrData));
-
- return arrContent;
- }
-
- internal void SendContent(HttpWorkerRequest Handler) {
- FlushBuffers();
-
- if (_OutputStream.Length > 0) {
- byte [] arrContent = ToArray();
- Handler.SendResponseFromMemory(arrContent, arrContent.Length);
- }
- }
-
- internal void Update() {
- _Encoder = _Response.ContentEncoder;
- _Encoding = _Response.ContentEncoding;
- }
-
- internal long BufferSize {
- get {
- FlushBuffers();
-
- if (_OutputStream.Length == 0) {
- return 0;
- }
-
- return ToArray().Length;
- }
- }
-
- internal void FlushBuffers() {
- _OutputHelper.Flush();
- _OutputStream.Flush();
- }
-
- public override Encoding Encoding {
- get {
- return _Encoding;
- }
- }
-
- public Stream OutputStream {
- get {
- return _ResponseStream;
- }
- }
-
- public override void Close() {
- FlushBuffers();
-
- _Response.Flush();
- _Response.Close();
- }
-
- public override void Flush() {
- FlushBuffers();
-
- _Response.Flush();
- }
-
- public override void Write(char ch) {
- _OutputHelper.Write(ch);
- if (!_Response.BufferOutput) {
- FlushBuffers();
- _Response.Flush();
- }
- }
-
- public override void Write(object obj) {
- _OutputHelper.Write(obj.ToString());
- if (!_Response.BufferOutput) {
- FlushBuffers();
- _Response.Flush();
- }
- }
-
- public override void Write(string s) {
- _OutputHelper.Write(s);
- if (!_Response.BufferOutput) {
- FlushBuffers();
- _Response.Flush();
- }
- }
-
- public override void Write(char[] buffer, int index, int count) {
- _OutputHelper.Write(buffer, index, count);
- if (!_Response.BufferOutput) {
- FlushBuffers();
- _Response.Flush();
- }
- }
-
- public void WriteBytes(byte[] buffer, int index, int count) {
- _OutputStream.Write(buffer, index, count);
- if (!_Response.BufferOutput) {
- FlushBuffers();
- _Response.Flush();
- }
- }
-
- override public void WriteLine() {
- _OutputHelper.Write("\n\r");
- if (!_Response.BufferOutput) {
- FlushBuffers();
- _Response.Flush();
- }
- }
-
- public void WriteString(string s, int index, int count) {
- _OutputHelper.Write(s.Substring(index, count));
- if (!_Response.BufferOutput) {
- FlushBuffers();
- _Response.Flush();
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs b/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs
deleted file mode 100644
index 06e62cba463..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpAsyncHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Web.IHttpAsyncHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-namespace System.Web
-{
- public interface IHttpAsyncHandler : IHttpHandler
- {
- IAsyncResult BeginProcessRequest(HttpContext context,
- AsyncCallback cb,
- object extraData);
- void EndProcessRequest(IAsyncResult result);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpHandler.cs b/mcs/class/System.Web/System.Web/IHttpHandler.cs
deleted file mode 100644
index 8bad2c1b1bd..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.IHttpHandler.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-namespace System.Web
-{
- public interface IHttpHandler
- {
- bool IsReusable { get; }
- void ProcessRequest(HttpContext context);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs b/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs
deleted file mode 100644
index b8cc4a3d2c5..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpHandlerFactory.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.IHttpHandlerFactory.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-namespace System.Web
-{
- public interface IHttpHandlerFactory
- {
- IHttpHandler GetHandler(HttpContext context,
- string requestType,
- string url,
- string pathTranslated);
- void ReleaseHandler(IHttpHandler handler);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/IHttpModule.cs b/mcs/class/System.Web/System.Web/IHttpModule.cs
deleted file mode 100644
index a98d2f54d29..00000000000
--- a/mcs/class/System.Web/System.Web/IHttpModule.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Web.IHttpModule.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-namespace System.Web {
- public interface IHttpModule {
- void Dispose();
- void Init(HttpApplication context);
- }
-}
diff --git a/mcs/class/System.Web/System.Web/NOTES b/mcs/class/System.Web/System.Web/NOTES
deleted file mode 100644
index 55926bd4ef9..00000000000
--- a/mcs/class/System.Web/System.Web/NOTES
+++ /dev/null
@@ -1,21 +0,0 @@
-Found another namespace not listed. System.Web.Hosting.
-HttpRuntime.ProcessRequest and HttpWorkerRequest seems to be the key.
-
-ASP maintains a pool of HttpApplication objects dirived from Global.asax.
-One is used per request, then reclamed after the request is totally
-complete.
-
-Read:
-http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguidnf/html/cpconaspnetapplications.asp
-
-
-Request notes:
-It apears each http request has its own thread. Need to figure out how to deal with this with apache.
-
-Session notes:
-When a request is finished, the contents of Request.Session are serialized and dumped to the State Server.
-When a request is started, a new Request.Session is created, data is deserialized from the State Server, and the objects are placed back into Request.Session.
-The State Server is accessed via the SessionStateModule which is used for both session ID and state data management.
-HttpApplicationState instance is created the first time a url within the applications virtual directory is accessed. Its accessable through HttpContext.Application.
-HttpApplicationState needs to use lock/unlock explicitly.
-Not shared across machines or multiple processes.
diff --git a/mcs/class/System.Web/System.Web/ProcessShutdownReason.cs b/mcs/class/System.Web/System.Web/ProcessShutdownReason.cs
deleted file mode 100644
index e8c8ed21de2..00000000000
--- a/mcs/class/System.Web/System.Web/ProcessShutdownReason.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Web.ProcessShutdownReason.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web {
- public enum ProcessShutdownReason {
- DeadlockSuspected,
- IdleTimeout,
- MemoryLimitExceeded,
- None,
- PingFailed,
- RequestQueueLimit,
- RequestsLimit,
- Timeout,
- Unexpected
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/ProcessStatus.cs b/mcs/class/System.Web/System.Web/ProcessStatus.cs
deleted file mode 100644
index 79066887e78..00000000000
--- a/mcs/class/System.Web/System.Web/ProcessStatus.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Web.ProcessStatus.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web
-{
- public enum ProcessStatus
- {
- Alive,
- ShutDown,
- ShuttingDown,
- Terminated
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web/TODO b/mcs/class/System.Web/System.Web/TODO
deleted file mode 100644
index 4de26ec8397..00000000000
--- a/mcs/class/System.Web/System.Web/TODO
+++ /dev/null
@@ -1,19 +0,0 @@
-HttpClientCertificate
-HttpApplicationState
-HttpFileCollection
-HttpModuleCollection
-HttpException
-HttpCompileException
-HttpParseException
-HttpUnhandledException
-HttpCapabilitiesBase
-HttpBrowserCapabilities
-HttpApplication
-HttpCachePolicy
-HttpCacheVaryByHeaders
-HttpCacheVaryByParams
-HttpPostedFile
-HttpStaticObjectsCollection
-ProcessInfo
-ProcessModelInfo
-TraceContext
diff --git a/mcs/class/System.Web/System.Web/TODOAttribute.cs b/mcs/class/System.Web/System.Web/TODOAttribute.cs
deleted file mode 100644
index eb2bfa0dda2..00000000000
--- a/mcs/class/System.Web/System.Web/TODOAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Web {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/TraceContext.cs b/mcs/class/System.Web/System.Web/TraceContext.cs
deleted file mode 100644
index 0708227547c..00000000000
--- a/mcs/class/System.Web/System.Web/TraceContext.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Web.TraceContext
-//
-// Author:
-// Patrik Torstensson (Patrik.Torstensson@labs2.com)
-//
-using System;
-
-namespace System.Web {
- public sealed class TraceContext {
- private HttpContext _Context;
- private bool _Enabled;
- private TraceMode _Mode;
-
- public TraceContext(HttpContext Context) {
- _Context = Context;
- _Enabled = true;
- }
-
- public bool IsEnabled {
- get {
- return _Enabled;
- }
-
- set {
- _Enabled = value;
- }
- }
-
- public TraceMode TraceMode {
- get {
- return _Mode;
- }
-
- set {
- _Mode = value;
- }
- }
-
- public void Warn(string msg) {
- Write(String.Empty, msg, null, true);
- }
-
- public void Warn(string category, string msg) {
- Write(category, msg, null, true);
- }
-
- public void Warn(string category, string msg, Exception error) {
- Write(category, msg, error, true);
- }
-
- public void Write(string msg) {
- Write(String.Empty, msg, null, true);
- }
-
- public void Write(string category, string msg) {
- Write(category, msg, null, true);
- }
-
- public void Write(string category, string msg, Exception error) {
- Write(category, msg, error, true);
- }
-
- [MonoTODO("Save the data into a web dataset directly...")]
- private void Write(string category, string msg, Exception error, bool Warning) {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/TraceMode.cs b/mcs/class/System.Web/System.Web/TraceMode.cs
deleted file mode 100644
index 0bc88d0ca64..00000000000
--- a/mcs/class/System.Web/System.Web/TraceMode.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Web.TraceMode.cs
-//
-// Author:
-// Bob Smith <bob@thestuff.net>
-//
-// (C) Bob Smith
-//
-
-namespace System.Web {
- public enum TraceMode {
- Default,
- SortByCategory,
- SortByTime
- }
-}
diff --git a/mcs/class/System.Web/System.Web/WebCategoryAttribute.cs b/mcs/class/System.Web/System.Web/WebCategoryAttribute.cs
deleted file mode 100644
index dd4b9ea5b46..00000000000
--- a/mcs/class/System.Web/System.Web/WebCategoryAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: WebCategoryAttribute
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-
-namespace System.Web
-{
- [AttributeUsage(AttributeTargets.All)]
- internal sealed class WebCategoryAttribute : CategoryAttribute
- {
- public WebCategoryAttribute(string category) : base(category)
- {
- }
-
- [MonoTODO]
- protected override string GetLocalizedString(string value)
- {
- string retVal = base.GetLocalizedString(value);
- if(retVal == null)
- {
- throw new NotImplementedException();
- //retVal = "Category_" + something I don't know how to get!
- }
- return retVal;
- }
- }
-}
diff --git a/mcs/class/System.Web/System.Web/WebSysDescriptionAttribute.cs b/mcs/class/System.Web/System.Web/WebSysDescriptionAttribute.cs
deleted file mode 100644
index 2425607069a..00000000000
--- a/mcs/class/System.Web/System.Web/WebSysDescriptionAttribute.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: WebSysDescriptionAttribute
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 95%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.ComponentModel;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web
-{
- [AttributeUsage(AttributeTargets.All)]
- internal class WebSysDescriptionAttribute : DescriptionAttribute
- {
- private bool isReplaced;
-
- public WebSysDescriptionAttribute(string description) : base(description)
- {
- }
-
- [MonoTODO]
- public override string Description
- {
- get
- {
- if(!isReplaced)
- {
- throw new NotImplementedException();
- //DescriptionValue = Description + do something I donno;
- }
- return Description;
- }
- }
- }
-}
diff --git a/mcs/class/System.Web/Test/test.aspx b/mcs/class/System.Web/Test/test.aspx
deleted file mode 100644
index 363fab9697f..00000000000
--- a/mcs/class/System.Web/Test/test.aspx
+++ /dev/null
@@ -1,29 +0,0 @@
-<%@ page language="c#"%>
-<html>
-<head>
-<title>Test</title>
-<%Response.Write("Test");%>
-
-<script runat="server" language="c#">
- void SubmitBtn_Click(Object sender, EventArgs e) {
- Response.Write("Hi");
- }
-</script>
-
-<form action="test.aspx" method="post" runat="server">
-<asp:button text="Click Me" OnClick="SubmitBtn_Click" runat="server"/>
-</form>
-
-<!-- output
-
-<html>
-<head>
-<title>Test</title>
-Test<form name="ctrl0" method="post" action="test.aspx" id="ctrl0">
-<input type="hidden" name="__VIEWSTATE" value="dDwtMTc0MDc5ODg1Mzs7Pg==" />
-
-<input type="submit" name="ctrl1" value="Click Me" />
-</form>
-
-
---> \ No newline at end of file
diff --git a/mcs/class/System.Web/Test/test2.aspx b/mcs/class/System.Web/Test/test2.aspx
deleted file mode 100644
index 168aa05cb58..00000000000
--- a/mcs/class/System.Web/Test/test2.aspx
+++ /dev/null
@@ -1,101 +0,0 @@
-<%@ Page Language="C#" %>
-<html>
-<head>
-<script language="C#" runat="server">
-void Page_Load(Object Sender, EventArgs e) {
- if (!IsPostBack) {
- ArrayList values = new ArrayList();
-
- values.Add(new PositionData("Microsoft", "Msft"));
- values.Add(new PositionData("Intel", "Intc"));
- values.Add(new PositionData("Dell", "Dell"));
-
- Repeater1.DataSource = values;
- Repeater1.DataBind();
-
- Repeater2.DataSource = values;
- Repeater2.DataBind();
- Response.Write(Repeater1.Controls[0].ClientID);
- Response.Write("<br>");
- Response.Write(Repeater1.Controls[0].UniqueID);
- Response.Write("<br>");
- }
- }
-
- public class PositionData {
-
- private string name;
- private string ticker;
-
- public PositionData(string name, string ticker) {
- this.name = name;
- this.ticker = ticker;
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public string Ticker {
- get {
- return ticker;
- }
- }
- }
-
- </script>
-
-</head>
-<body>
-
-<h3><font face="Verdana">Repeater Example</font></h3>
-
-<form runat=server>
-
-<b>Repeater1:</b>
-
-<p>
-
-<asp:Repeater id=Repeater1 runat="server">
-<HeaderTemplate>
-<table border=1>
-<tr>
-<td><b>Company</b></td>
-<td><b>Symbol</b></td>
-</tr>
-</HeaderTemplate>
-
-<ItemTemplate>
-<tr>
-<td> <%# DataBinder.Eval(Container.DataItem, "Name") %> <asp:label id="test"></td>
-<td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
-</tr>
-</ItemTemplate>
-
-<FooterTemplate>
-</table>
-</FooterTemplate>
-
-</asp:Repeater>
-<p>
-
-<b>Repeater2:</b>
-<p>
-<asp:Repeater id=Repeater2 runat="server">
-
-<HeaderTemplate>
-Company data:
- </HeaderTemplate>
-
-<ItemTemplate>
-<%# DataBinder.Eval(Container.DataItem, "Name") %> (<%# DataBinder.Eval(Container.DataItem, "Ticker") %>)
- </ItemTemplate>
-
-<SeparatorTemplate>, </SeparatorTemplate>
-</asp:Repeater>
-</form>
-</body>
-</html>
-
diff --git a/mcs/class/System.Web/Test/test3.aspx b/mcs/class/System.Web/Test/test3.aspx
deleted file mode 100644
index d8776e45f48..00000000000
--- a/mcs/class/System.Web/Test/test3.aspx
+++ /dev/null
@@ -1,23 +0,0 @@
-<%@ Page Debug="true" %>
-<html>
-<script runat=server language="vb">
-
-Sub AnchorBtn_Click(Source As Object, E as EventArgs)
- Message.InnerText = Message.InnerHtml
- End Sub
-
- </script>
-
-<body>
-<form method=post runat=server>
-
-<a OnServerClick="AnchorBtn_Click" runat=server> Click here at your peril.</a>
-
-<h1>
-<span id="Message" runat=server><span id="Message2" runat=server>narf</span></span>
-</h1>
-
-</form>
-</body>
-</html>
-
diff --git a/mcs/class/System.Web/Test/test4.aspx b/mcs/class/System.Web/Test/test4.aspx
deleted file mode 100644
index f9c020c1d85..00000000000
--- a/mcs/class/System.Web/Test/test4.aspx
+++ /dev/null
@@ -1,119 +0,0 @@
-<%@ Page Language="C#" Debug="true" %>
-<html>
-<head>
-<script language="C#" runat="server">
-// protected override void OnInit(EventArgs e){
-// throw new Exception();
-// }
- protected override void LoadViewState(object savedState){
- throw new Exception();
- }
- protected override object SaveViewState(){
- throw new Exception();
- }
- void Page_Kill(Object Sender, EventArgs e) {
- throw new Exception();
- }
- protected override void OnInit(EventArgs e){
- EnableViewState = true;
- TrackViewState();
- ViewState["test"] = "DIE!";
- }
- void Page_Load(Object Sender, EventArgs e) {
-// ((Control)Sender).PreRender += new EventHandler(Page_Kill);
- if (!IsPostBack) {
- ArrayList values = new ArrayList();
-
- values.Add(new PositionData("Microsoft", "Msft"));
- values.Add(new PositionData("Intel", "Intc"));
- values.Add(new PositionData("Dell", "Dell"));
-
- Repeater1.DataSource = values;
- Repeater1.DataBind();
-
- Repeater2.DataSource = values;
- Repeater2.DataBind();
- Response.Write(Repeater1.Controls[0].ClientID);
- Response.Write("<br>");
- Response.Write(Repeater1.Controls[0].UniqueID);
- Response.Write("<br>");
- }
- }
-
- public class PositionData {
-
- private string name;
- private string ticker;
-
- public PositionData(string name, string ticker) {
- this.name = name;
- this.ticker = ticker;
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public string Ticker {
- get {
- return ticker;
- }
- }
- }
-
- </script>
-
-</head>
-<body>
-
-<h3><font face="Verdana">Repeater Example</font></h3>
-
-<form runat=server>
-
-<b>Repeater1:</b>
-
-<p>
-
-<asp:Repeater id=Repeater1 runat="server">
-<HeaderTemplate>
-<table border=1>
-<tr>
-<td><b>Company</b></td>
-<td><b>Symbol</b></td>
-</tr>
-</HeaderTemplate>
-
-<ItemTemplate>
-<tr>
-<td> <%# DataBinder.Eval(Container.DataItem, "Name") %> <asp:label id="test"></td>
-<td> <%# DataBinder.Eval(Container.DataItem, "Ticker") %> </td>
-</tr>
-</ItemTemplate>
-
-<FooterTemplate>
-</table>
-</FooterTemplate>
-
-</asp:Repeater>
-<p>
-
-<b>Repeater2:</b>
-<p>
-<asp:Repeater id=Repeater2 runat="server">
-
-<HeaderTemplate>
-Company data:
- </HeaderTemplate>
-
-<ItemTemplate>
-<%# DataBinder.Eval(Container.DataItem, "Name") %> (<%# DataBinder.Eval(Container.DataItem, "Ticker") %>)
- </ItemTemplate>
-
-<SeparatorTemplate>, </SeparatorTemplate>
-</asp:Repeater>
-</form>
-</body>
-</html>
-
diff --git a/mcs/class/System.Web/Test/test5.aspx b/mcs/class/System.Web/Test/test5.aspx
deleted file mode 100644
index 2aaf4bf06c2..00000000000
--- a/mcs/class/System.Web/Test/test5.aspx
+++ /dev/null
@@ -1,121 +0,0 @@
-<%@ Page Language="C#" Debug="true" %>
-<html>
-<head>
-<%
-Response.Write(HttpWorkerRequest.HeaderAccept);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptCharset);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptEncoding);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptLanguage);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAcceptRanges);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAge);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAllow);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderAuthorization);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderCacheControl);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderConnection);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentEncoding);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentLanguage);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentLength);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentLocation);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentMd5);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentRange);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderContentType);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderCookie);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderDate);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderEtag);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderExpect);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderExpires);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderFrom);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderHost);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfMatch);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfModifiedSince);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfNoneMatch);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfRange);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderIfUnmodifiedSince);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderKeepAlive);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderLastModified);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderLocation);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderMaxForwards);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderPragma);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderProxyAuthenticate);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderProxyAuthorization);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderRange);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderReferer);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderRetryAfter);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderServer);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderSetCookie);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderTe);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderTrailer);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderTransferEncoding);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderUpgrade);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderUserAgent);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderVary);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderVia);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderWarning);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.HeaderWwwAuthenticate);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonCachePolicy);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonCacheSecurity);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonClientDisconnect);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonDefault);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonFileHandleCacheMiss);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ReasonResponseCacheMiss);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.RequestHeaderMaximum);
-Response.Write("<br>");
-Response.Write(HttpWorkerRequest.ResponseHeaderMaximum);
-Response.Write("<br>");
-%> \ No newline at end of file
diff --git a/mcs/class/System.Web/Test/test6.aspx b/mcs/class/System.Web/Test/test6.aspx
deleted file mode 100644
index 594c4bc7bbb..00000000000
--- a/mcs/class/System.Web/Test/test6.aspx
+++ /dev/null
@@ -1,83 +0,0 @@
-<html>
-<head>
-<!--
- Author: Gaurav Vaish
- Original Source: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIWebControlsCalendarClassSelectedDateTopic.asp
- Copyright: (C) Gaurav Vaish, 2001
--->
- <script language="C#" runat="server">
-
- void Selection_Change(Object sender, EventArgs e)
- {
- Label1.Text = "The selected date is " + Calendar1.SelectedDate.ToShortDateString();
- }
-
- void Selection_Change_Month(Object sender, EventArgs e)
- {
- Label2.Text = "The selected date is " + Calendar2.SelectedDate.ToShortDateString();
- }
-
- void Selection_Change_DWM(Object sender, EventArgs e)
- {
- Label3.Text = "The selected date is " + Calendar3.SelectedDate.ToShortDateString();
- }
-
- </script>
-
-</head>
-<body>
-
- <form runat="server">
-
- <h3><font face="Verdana">Calendar Example</font></h3>
-
- Select a date on the Calendar control.<br><br>
-
- <asp:Calendar ID="Calendar1" runat="server"
- SelectionMode="Day"
- ShowGridLines="True"
- OnSelectionChanged="Selection_Change">
-
- <SelectedDayStyle BackColor="Yellow"
- ForeColor="Red">
- </SelectedDayStyle>
-
- </asp:Calendar>
-
- <asp:Label id="Label1" runat=server />
-
- <hr><br>
-
- <asp:Calendar ID="Calendar2" runat="server"
- SelectionMode="DayWeek"
- ShowGridLines="True"
- OnSelectionChanged="Selection_Change_Month">
-
- <SelectedDayStyle BackColor="Yellow"
- ForeColor="Red">
- </SelectedDayStyle>
-
- </asp:Calendar>
-
- <asp:Label id="Label2" runat=server />
-
- <hr><br>
-
- <asp:Calendar ID="Calendar3" runat="server"
- SelectionMode="DayWeekMonth"
- ShowGridLines="True"
- OnSelectionChanged="Selection_Change_DWM">
-
- <SelectedDayStyle BackColor="Yellow"
- ForeColor="Red">
- </SelectedDayStyle>
-
- </asp:Calendar>
-
- <asp:Label id="Label3" runat=server />
-
- <hr><br>
-
- </form>
-</body>
-</html> \ No newline at end of file
diff --git a/mcs/class/System.Web/list b/mcs/class/System.Web/list
deleted file mode 100755
index f4b20848f96..00000000000
--- a/mcs/class/System.Web/list
+++ /dev/null
@@ -1,293 +0,0 @@
-System.Web/BeginEventHandler.cs
-System.Web/EndEventHandler.cs
-System.Web/HttpCacheRevalidation.cs
-System.Web/HttpCacheability.cs
-System.Web/HttpCookie.cs
-System.Web/HttpCookieCollection.cs
-System.Web/HttpRuntime.cs
-System.Web/HttpServerUtility.cs
-System.Web/HttpValidationStatus.cs
-System.Web/HttpWriter.cs
-System.Web/TraceContext.cs
-System.Web/HttpWorkerRequest.cs
-System.Web/IHttpAsyncHandler.cs
-System.Web/IHttpHandler.cs
-System.Web/IHttpHandlerFactory.cs
-System.Web/IHttpModule.cs
-System.Web/ProcessShutdownReason.cs
-System.Web/ProcessStatus.cs
-System.Web/TODOAttribute.cs
-System.Web/TraceMode.cs
-System.Web/WebCategoryAttribute.cs
-System.Web/WebSysDescriptionAttribute.cs
-System.Web/HttpApplication.cs
-System.Web/HttpApplicationState.cs
-System.Web/HttpBrowserCapabilities.cs
-System.Web/HttpCachePolicy.cs
-System.Web/HttpClientCertificate.cs
-System.Web/HttpContext.cs
-System.Web/HttpException.cs
-System.Web/HttpFileCollection.cs
-System.Web/HttpHelper.cs
-System.Web/HttpRequest.cs
-System.Web/HttpRequestStream.cs
-System.Web/HttpResponse.cs
-System.Web/HttpResponseHeader.cs
-System.Web/HttpResponseStream.cs
-System.Web/HttpResponseStreamProxy.cs
-System.Web/HttpSessionState.cs
-System.Web/HttpUtility.cs
-System.Web/HttpValueCollection.cs
-System.Web/HttpCacheVaryByHeaders.cs
-System.Web/HttpCacheVaryByParams.cs
-System.Web/HttpModuleCollection.cs
-System.Web/HttpPostedFile.cs
-System.Web/HttpStaticObjectsCollection.cs
-System.Web.Caching/Cache.cs
-System.Web.Caching/CacheDefinitions.cs
-System.Web.Caching/CacheDependency.cs
-System.Web.Caching/CacheEntry.cs
-System.Web.Caching/CacheExpires.cs
-System.Web.Caching/ExpiresBuckets.cs
-System.Web.Configuration/AuthenticationMode.cs
-System.Web.Configuration/ClientTargetSectionHandler.cs
-System.Web.Configuration/FormsAuthPasswordFormat.cs
-System.Web.Configuration/FormsProtectionEnum.cs
-System.Web.Configuration/HttpCapabilitiesBase.cs
-System.Web.Hosting/ApplicationHost.cs
-System.Web.Hosting/SimpleWorkerRequest.cs
-System.Web.Mail/MailAttachment.cs
-System.Web.Mail/MailEncoding.cs
-System.Web.Mail/MailFormat.cs
-System.Web.Mail/MailMessage.cs
-System.Web.Mail/MailPriority.cs
-System.Web.Mail/SmtpMail.cs
-System.Web.UI/BuildMethod.cs
-System.Web.UI/BuildTemplateMethod.cs
-System.Web.UI/Control.cs
-System.Web.UI/DataBindingHandlerAttribute.cs
-System.Web.UI/DesignTimeParseData.cs
-System.Web.UI/HtmlTextWriter.cs
-System.Web.UI/HtmlTextWriterAttribute.cs
-System.Web.UI/HtmlTextWriterStyle.cs
-System.Web.UI/HtmlTextWriterTag.cs
-System.Web.UI/IAttributeAccessor.cs
-System.Web.UI/IDataBindingsAccessor.cs
-System.Web.UI/INamingContainer.cs
-System.Web.UI/IParserAccessor.cs
-System.Web.UI/IPostBackDataHandler.cs
-System.Web.UI/IPostBackEventHandler.cs
-System.Web.UI/IStateManager.cs
-System.Web.UI/ITagNameToTypeMapper.cs
-System.Web.UI/ITemplate.cs
-System.Web.UI/IValidator.cs
-System.Web.UI/ImageClickEventHandler.cs
-System.Web.UI/LiteralControl.cs
-System.Web.UI/OutputCacheLocation.cs
-System.Web.UI/Pair.cs
-System.Web.UI/PersistenceMode.cs
-System.Web.UI/PropertyConverter.cs
-System.Web.UI/StateBag.cs
-System.Web.UI/StateItem.cs
-System.Web.UI/ToolboxDataAttribute.cs
-System.Web.UI/Utils.cs
-System.Web.UI/ConstructorNeedsTagAttribute.cs
-System.Web.UI/ControlBuilderAttribute.cs
-System.Web.UI/ImageClickEventArgs.cs
-System.Web.UI/Page.cs
-System.Web.UI/ParseChildrenAttribute.cs
-System.Web.UI/PartialCachingAttribute.cs
-System.Web.UI/PersistChildrenAttribute.cs
-System.Web.UI/PersistenceModeAttribute.cs
-System.Web.UI/TagPrefixAttribute.cs
-System.Web.UI/TemplateContainerAttribute.cs
-System.Web.UI/ValidatorCollection.cs
-System.Web.UI/ValidationPropertyAttribute.cs
-System.Web.UI/AttributeCollection.cs
-System.Web.UI/BaseParser.cs
-System.Web.UI/ControlBuilder.cs
-System.Web.UI/ControlCollection.cs
-System.Web.UI/CssStyleCollection.cs
-System.Web.UI/DataBinder.cs
-System.Web.UI/DataBinding.cs
-System.Web.UI/DataBindingCollection.cs
-System.Web.UI/DataBoundLiteralControl.cs
-System.Web.UI/EmptyControlCollection.cs
-System.Web.UI/RenderMethod.cs
-System.Web.UI/TemplateControl.cs
-System.Web.UI/TemplateParser.cs
-System.Web.UI/Triplet.cs
-System.Web.UI/CompiledTemplateBuilder.cs
-System.Web.UI.HtmlControls/HtmlAnchor.cs
-System.Web.UI.HtmlControls/HtmlButton.cs
-System.Web.UI.HtmlControls/HtmlContainerControl.cs
-System.Web.UI.HtmlControls/HtmlControl.cs
-System.Web.UI.HtmlControls/HtmlForm.cs
-System.Web.UI.HtmlControls/HtmlGenericControl.cs
-System.Web.UI.HtmlControls/HtmlImage.cs
-System.Web.UI.HtmlControls/HtmlInputButton.cs
-System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
-System.Web.UI.HtmlControls/HtmlInputControl.cs
-System.Web.UI.HtmlControls/HtmlInputFile.cs
-System.Web.UI.HtmlControls/HtmlInputHidden.cs
-System.Web.UI.HtmlControls/HtmlInputImage.cs
-System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
-System.Web.UI.HtmlControls/HtmlInputText.cs
-System.Web.UI.HtmlControls/HtmlSelect.cs
-System.Web.UI.HtmlControls/HtmlTable.cs
-System.Web.UI.HtmlControls/HtmlTableCell.cs
-System.Web.UI.HtmlControls/HtmlTableCellCollection.cs
-System.Web.UI.HtmlControls/HtmlTableRow.cs
-System.Web.UI.HtmlControls/HtmlTableRowCollection.cs
-System.Web.UI.HtmlControls/HtmlTextArea.cs
-System.Web.UI.WebControls/AdCreatedEventArgs.cs
-System.Web.UI.WebControls/AdCreatedEventHandler.cs
-System.Web.UI.WebControls/AdRotator.cs
-System.Web.UI.WebControls/BaseCompareValidator.cs
-System.Web.UI.WebControls/BaseDataList.cs
-System.Web.UI.WebControls/BaseValidator.cs
-System.Web.UI.WebControls/BorderStyle.cs
-System.Web.UI.WebControls/BoundColumn.cs
-System.Web.UI.WebControls/Button.cs
-System.Web.UI.WebControls/ButtonColumn.cs
-System.Web.UI.WebControls/ButtonColumnType.cs
-System.Web.UI.WebControls/Calendar.cs
-System.Web.UI.WebControls/CalendarDay.cs
-System.Web.UI.WebControls/CalendarSelectionMode.cs
-System.Web.UI.WebControls/CheckBox.cs
-System.Web.UI.WebControls/CheckBoxList.cs
-System.Web.UI.WebControls/CommandEventArgs.cs
-System.Web.UI.WebControls/CommandEventHandler.cs
-System.Web.UI.WebControls/CompareValidator.cs
-System.Web.UI.WebControls/CustomValidator.cs
-System.Web.UI.WebControls/DataGrid.cs
-System.Web.UI.WebControls/DataGridColumn.cs
-System.Web.UI.WebControls/DataGridColumnCollection.cs
-System.Web.UI.WebControls/DataGridCommandEventArgs.cs
-System.Web.UI.WebControls/DataGridCommandEventHandler.cs
-System.Web.UI.WebControls/DataGridItem.cs
-System.Web.UI.WebControls/DataGridItemCollection.cs
-System.Web.UI.WebControls/DataGridItemEventArgs.cs
-System.Web.UI.WebControls/DataGridItemEventHandler.cs
-System.Web.UI.WebControls/DataGridPageChangedEventArgs.cs
-System.Web.UI.WebControls/DataGridPageChangedEventHandler.cs
-System.Web.UI.WebControls/DataGridPagerStyle.cs
-System.Web.UI.WebControls/DataGridSortCommandEventArgs.cs
-System.Web.UI.WebControls/DataGridSortCommandEventHandler.cs
-System.Web.UI.WebControls/DataKeyCollection.cs
-System.Web.UI.WebControls/DataList.cs
-System.Web.UI.WebControls/DataListCommandEventArgs.cs
-System.Web.UI.WebControls/DataListCommandEventHandler.cs
-System.Web.UI.WebControls/DataListItem.cs
-System.Web.UI.WebControls/DataListItemCollection.cs
-System.Web.UI.WebControls/DataListItemEventArgs.cs
-System.Web.UI.WebControls/DataListItemEventHandler.cs
-System.Web.UI.WebControls/DayNameFormat.cs
-System.Web.UI.WebControls/DayRenderEventArgs.cs
-System.Web.UI.WebControls/DayRenderEventHandler.cs
-System.Web.UI.WebControls/DropDownList.cs
-System.Web.UI.WebControls/EditCommandColumn.cs
-System.Web.UI.WebControls/FirstDayOfWeek.cs
-System.Web.UI.WebControls/FontInfo.cs
-System.Web.UI.WebControls/FontNamesConverter.cs
-System.Web.UI.WebControls/FontSize.cs
-System.Web.UI.WebControls/FontUnit.cs
-System.Web.UI.WebControls/FontUnitConverter.cs
-System.Web.UI.WebControls/GridLines.cs
-System.Web.UI.WebControls/HorizontalAlign.cs
-System.Web.UI.WebControls/HyperLink.cs
-System.Web.UI.WebControls/HyperLinkColumn.cs
-System.Web.UI.WebControls/HyperLinkControlBuilder.cs
-System.Web.UI.WebControls/IRepeatInfoUser.cs
-System.Web.UI.WebControls/Image.cs
-System.Web.UI.WebControls/ImageAlign.cs
-System.Web.UI.WebControls/ImageButton.cs
-System.Web.UI.WebControls/Label.cs
-System.Web.UI.WebControls/LabelControlBuilder.cs
-System.Web.UI.WebControls/LinkButton.cs
-System.Web.UI.WebControls/LinkButtonControlBuilder.cs
-System.Web.UI.WebControls/LinkButtonInternal.cs
-System.Web.UI.WebControls/ListBox.cs
-System.Web.UI.WebControls/ListControl.cs
-System.Web.UI.WebControls/ListItem.cs
-System.Web.UI.WebControls/ListItemCollection.cs
-System.Web.UI.WebControls/ListItemControlBuilder.cs
-System.Web.UI.WebControls/ListItemType.cs
-System.Web.UI.WebControls/ListSelectionMode.cs
-System.Web.UI.WebControls/Literal.cs
-System.Web.UI.WebControls/LiteralControlBuilder.cs
-System.Web.UI.WebControls/MonthChangedEventArgs.cs
-System.Web.UI.WebControls/MonthChangedEventHandler.cs
-System.Web.UI.WebControls/NextPrevFormat.cs
-System.Web.UI.WebControls/PagedDataSource.cs
-System.Web.UI.WebControls/PagerMode.cs
-System.Web.UI.WebControls/PagerPosition.cs
-System.Web.UI.WebControls/Panel.cs
-System.Web.UI.WebControls/PlaceHolder.cs
-System.Web.UI.WebControls/PlaceHolderControlBuilder.cs
-System.Web.UI.WebControls/RadioButton.cs
-System.Web.UI.WebControls/RadioButtonList.cs
-System.Web.UI.WebControls/RangeValidator.cs
-System.Web.UI.WebControls/RegularExpressionValidator.cs
-System.Web.UI.WebControls/RepeatDirection.cs
-System.Web.UI.WebControls/RepeatInfo.cs
-System.Web.UI.WebControls/RepeatLayout.cs
-System.Web.UI.WebControls/Repeater.cs
-System.Web.UI.WebControls/RepeaterCommandEventArgs.cs
-System.Web.UI.WebControls/RepeaterCommandEventHandler.cs
-System.Web.UI.WebControls/RepeaterItem.cs
-System.Web.UI.WebControls/RepeaterItemCollection.cs
-System.Web.UI.WebControls/RepeaterItemEventArgs.cs
-System.Web.UI.WebControls/RepeaterItemEventHandler.cs
-System.Web.UI.WebControls/RequiredFieldValidator.cs
-System.Web.UI.WebControls/SelectedDatesCollection.cs
-System.Web.UI.WebControls/ServerValidateEventArgs.cs
-System.Web.UI.WebControls/ServerValidateEventHandler.cs
-System.Web.UI.WebControls/Style.cs
-System.Web.UI.WebControls/Table.cs
-System.Web.UI.WebControls/TableCell.cs
-System.Web.UI.WebControls/TableCellCollection.cs
-System.Web.UI.WebControls/TableCellControlBuilder.cs
-System.Web.UI.WebControls/TableHeaderCell.cs
-System.Web.UI.WebControls/TableItemStyle.cs
-System.Web.UI.WebControls/TableRow.cs
-System.Web.UI.WebControls/TableRowCollection.cs
-System.Web.UI.WebControls/TableStyle.cs
-System.Web.UI.WebControls/TargetConverter.cs
-System.Web.UI.WebControls/TemplateColumn.cs
-System.Web.UI.WebControls/TextAlign.cs
-System.Web.UI.WebControls/TextBox.cs
-System.Web.UI.WebControls/TextBoxControlBuilder.cs
-System.Web.UI.WebControls/TextBoxMode.cs
-System.Web.UI.WebControls/TitleFormat.cs
-System.Web.UI.WebControls/Unit.cs
-System.Web.UI.WebControls/UnitConverter.cs
-System.Web.UI.WebControls/UnitType.cs
-System.Web.UI.WebControls/ValidatedControlConverter.cs
-System.Web.UI.WebControls/ValidationCompareOperator.cs
-System.Web.UI.WebControls/ValidationDataType.cs
-System.Web.UI.WebControls/ValidationSummary.cs
-System.Web.UI.WebControls/ValidationSummaryDisplayMode.cs
-System.Web.UI.WebControls/ValidatorDisplay.cs
-System.Web.UI.WebControls/VerticalAlign.cs
-System.Web.UI.WebControls/WebColorConverter.cs
-System.Web.UI.WebControls/WebControl.cs
-System.Web.UI.WebControls/Xml.cs
-System.Web.Utils/ApacheVersionInfo.cs
-System.Web.Utils/DataSourceHelper.cs
-System.Web.Utils/FileAction.cs
-System.Web.Utils/FileChangeEventHandler.cs
-System.Web.Utils/FileChangedEventArgs.cs
-System.Web.Utils/FileChangesMonitor.cs
-System.Web.Utils/FilePathParser.cs
-System.Web.Utils/IISVersionInfo.cs
-System.Web.Utils/NativeFileChangeEventHandler.cs
-System.Web.Utils/UrlUtils.cs
-System.Web.Utils/WebEqualComparer.cs
-System.Web.Utils/WebHashCodeProvider.cs
-System.Web.Security/DefaultAuthenticationEventArgs.cs
-System.Web.SessionState/HttpSessionState.cs
-System.Web.SessionState/IReadOnlySessionState.cs
-System.Web.SessionState/IRequiresSessionState.cs
-System.Web.SessionState/SessionStateMode.cs
-System.Web.SessionState/SessionStateModule.cs
diff --git a/mcs/class/System.Windows.Forms/Gtk/Application.cs b/mcs/class/System.Windows.Forms/Gtk/Application.cs
deleted file mode 100644
index 1ce7107ef92..00000000000
--- a/mcs/class/System.Windows.Forms/Gtk/Application.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Windows.Forms.Application
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-using System;
-using System.Drawing;
-using Gtk;
-using GtkSharp;
-using System.ComponentModel;
-
-namespace System.Windows.Forms {
-
- public sealed class Application {
- public static void Run ()
- {
- Gtk.Application.Run ();
- }
-
- static void terminate_event_loop (object o, EventArgs args)
- {
- Gtk.Application.Quit ();
- }
-
- public static void Run (Form form)
- {
- form.Visible = true;
- form.Closed += new EventHandler (terminate_event_loop);
-
- Gtk.Application.Run ();
- }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs b/mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs
deleted file mode 100644
index 4a5cb354be2..00000000000
--- a/mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.Form
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-using System;
-using System.Drawing;
-using Gtk;
-using GtkSharp;
-
-namespace System.Windows.Forms {
-
- public class ContainerControl : ScrollableControl {
- }
-}
diff --git a/mcs/class/System.Windows.Forms/Gtk/Control.cs b/mcs/class/System.Windows.Forms/Gtk/Control.cs
deleted file mode 100644
index a0ef4c6be74..00000000000
--- a/mcs/class/System.Windows.Forms/Gtk/Control.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Windows.Forms.Form
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-using System;
-using System.Drawing;
-using Gtk;
-using GtkSharp;
-using System.ComponentModel;
-
-namespace System.Windows.Forms {
-
- public class Control : Component {
- internal Widget widget;
- Control parent;
- string text;
- int left, top, width, height;
-
- static int init_me;
-
- static Control ()
- {
- init_me = 1;
- Console.WriteLine ("MEEEEEEEEEEEEEEEEEEEEEE");
- }
-
- public Control () : this ("")
- {
- }
-
- public Control (string text) : this (null, text)
- {
- }
-
- public Control (Control parent, string text)
- {
- this.parent = parent;
- this.text = text;
- }
-
- public Control (string text, int left, int top, int width, int height)
- {
- }
-
- public Control (Control parent, string text, int left, int top, int width, int height)
- {
- }
-
- internal Widget Widget {
- get {
- if (widget == null)
- widget = CreateWidget ();
- return widget;
- }
- }
-
- internal virtual Widget CreateWidget ()
- {
- throw new Exception ();
- }
-
- public virtual string Text {
- get {
- return text;
- }
-
- set {
- text = value;
- }
- }
-
- public void Show ()
- {
- Widget.EmitShow ();
- }
-
- public void Hide ()
- {
- Widget.EmitHide ();
- }
-
- public bool Visible {
- get {
- return Widget.Visible;
- }
-
- set {
- Widget.Visible = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/Gtk/Form.cs b/mcs/class/System.Windows.Forms/Gtk/Form.cs
deleted file mode 100644
index d8f7d36708d..00000000000
--- a/mcs/class/System.Windows.Forms/Gtk/Form.cs
+++ /dev/null
@@ -1,831 +0,0 @@
-//
-// System.Windows.Forms.Form
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-using System;
-using System.Drawing;
-using Gtk;
-using GtkSharp;
-
-namespace System.Windows.Forms {
-
- public class Form : ContainerControl {
- Window win;
- string caption;
-
- public Form ()
- {
- }
-
- static Form ()
- {
- Gtk.Application.Init ();
- }
-
- void delete_cb (object o, EventArgs args)
- {
- SignalArgs sa = (SignalArgs) args;
-
- //if (Closing != null)
- //Closing (o, args);
-
- if (Closed != null)
- Closed (o, args);
-
- sa.RetVal = false;
- }
-
- internal override Widget CreateWidget ()
- {
- win = new Window (WindowType.Toplevel);
-
- win.DeleteEvent += new EventHandler (delete_cb);
- win.Title = Text;
- return (Widget) win;
- }
-
- public override string Text {
- get {
- return base.Text;
- }
-
- set {
- base.Text = value;
- if (win != null)
- win.Title = value;
- }
- }
-
- // --- Public Properties
- //
- // [MonoTODO]
- // public IButtonControl AcceptButton {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public static Form ActiveForm {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Form ActiveMdiChild {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool AutoScale {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public virtual Size AtoScaleBaseSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public override bool AutoScroll {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public virtual Color BackColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public IButtonControl CancelButton {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public new Size ClientSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool ControlBox {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Rectangle DesktopBounds {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Point DesktopLocation {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public DialogResult DialogResult {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public FormBorderStyle FormBorderStyle {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool HelpButton {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Icon Icon {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool IsMidiChild {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool IsMidiContainer {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool KeyPreview {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool MaximizeBox {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Size MaximumSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Form[] MdiChildren {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Form MdiParent {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public MainMenu Menu {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public MainMenu MergedMenu {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool MinimizeBox {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Size MinimumSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool Modal {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public double Opacity {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Form[] OwnedForms {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Form Owner {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool ShowInTaskbar {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public override ISite Site {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public SizeGripStyle SizeGripStyle {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public FormStartPosition StartPosition {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool TopLevel {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public bool TopMost {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public Color TransparencyKey {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public FormWindowState WindowState {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- // [MonoTODO]
- // public void Activate()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void AddOwnedForm(Form ownedForm)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void Close()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void Dispose()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public virtual bool Equals(object o);
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public static bool Equals(object o1, object o2);
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public static SizeF GetAutoScaleSize(Font font)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void Invalidate()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public object Invoke()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void LayoutMdi(MdiLayout value)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void PerformLayout()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void RemoveOwnedForm(Form ownedForm)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void ResumeLayout()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void Scale(float f)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void Select()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void SetBounds(int, int, int, int)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public void SetDesktopLocation(int x, int y)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public DialogResult ShowDialog()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public override string ToString()
- // {
- // throw new NotImplementedException ();
- // }
-
- //
- // --- Public Events
- //
- // [MonoTODO]
- // public event EventHandler Activated {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- public event EventHandler Closed;
-
- // public event CancelEventHandler Closing;
-
- // [MonoTODO]
- // public event EventHandler Deactivate {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event InputLanguageChangedEventHandler InputLanguageChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event InputLanguageChangingEventHandler InputLanguageChanging {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- // [MonoTODO]
- // public event EventHandler Load {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event EventHandler MaximizedBoundsChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event EventHandler MaximumSizeChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event EventHandler MdiChildActivate {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event EventHandler MenuComplete {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event EventHandler MenuStart {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // public event EventHandler MinimumSizedChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- // [MonoTODO]
- // protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // protected override ImeMode DefaultImeMode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // [MonoTODO]
- // protected override Size DefaultSize {
- //}
- // [MonoTODO]
- // protected Rectangle MaximizedBounds {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- // [MonoTODO]
- // protected override void AdjustFormScrollbars(bool displayScrollbars)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override ControlCollection CreateControlsInstnace()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void CreateHandle()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void DefWndProc(ref Message m)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void Dispose(bool b)
- // {
- // throw new NotImplementedException ();
- // }
-
- // [MonoTODO]
- // protected virtual void OnClosed(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnClosing(CancelEventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
-
- // [MonoTODO]
- // protected override void OnCreateControl()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void OnFontChanged(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void OnHandleCreated(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void OnHandleDestroyed(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
-
- // [MonoTODO]
- // protected virtual void OnInputLanguageChanged( OnInputLanguageChangedEventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnInputLanguagedChanging( OnInputLanguagedChangingEventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnLoad(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnMaximizedBoundsChanged(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnMaximumSizedChanged(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnMdiChildActive(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnMenuComplete(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnMenuStart(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected virtual void OnMinimumSizeChanged(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
-
- // [MonoTODO]
- // protected override void OnPaint(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void OnResize(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void OnStyleChanged(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void OnTextChanged(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void OnVisibleChanged(EventArgs e)
- // {
- // throw new NotImplementedException ();
- // }
-
- // [MonoTODO]
- // protected override bool ProcessCmdKey( ref Message msg, Keys keyData)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override bool ProcessDialogKey(Keys keyData)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override bool ProcessKeyPreview(ref Message m)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override bool ProcessTabKey(bool forward)
- // {
- // throw new NotImplementedException ();
- // }
-
- // [MonoTODO]
- // protected override void ScaleScore(float x, float y)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void Select(bool b1, bool b2)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void SelectClientSizeCore(int x, int y)
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void SetVisibleCore(bool value)
- // {
- // throw new NotImplementedException ();
- // }
-
- // [MonoTODO]
- // protected void UpdateBounds()
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // protected override void WndProc(ref Message m)
- // {
- // throw new NotImplementedException ();
- // }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs b/mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs
deleted file mode 100644
index aa67a800543..00000000000
--- a/mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.Form
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-using System;
-using System.Drawing;
-using Gtk;
-using GtkSharp;
-
-namespace System.Windows.Forms {
-
- public class ScrollableControl : Control {
- }
-}
diff --git a/mcs/class/System.Windows.Forms/Gtk/demo.cs b/mcs/class/System.Windows.Forms/Gtk/demo.cs
deleted file mode 100644
index 1b442c1bc4a..00000000000
--- a/mcs/class/System.Windows.Forms/Gtk/demo.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Windows.Forms;
-
-class X {
- static void Demo_Window ()
- {
- Form form = new Form ();
-
- form.Text = "hello";
-
- form.Visible = true;
-
- Application.Run ();
- }
-
- static void Demo_AppRun ()
- {
- Form form = new Form ();
-
- form.Text = "hello";
-
- Application.Run (form);
- }
-
- static void Main (string [] args)
- {
- string demo = "window";
-
- if (args.Length > 0)
- demo = args [0];
-
- switch (demo){
- case "window":
- Demo_Window ();
- break;
- case "app_run":
- Demo_AppRun ();
- break;
- }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/Gtk/makefile b/mcs/class/System.Windows.Forms/Gtk/makefile
deleted file mode 100644
index e67531432d6..00000000000
--- a/mcs/class/System.Windows.Forms/Gtk/makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-CSC=csc
-SWFF=/r:gtk-sharp.dll /r:glib-sharp.dll /noconfig /r:System.dll /r:System.Drawing.dll /nowarn:169
-
-SOURCES = \
- Application.cs \
- ContainerControl.cs \
- Control.cs \
- Form.cs \
- ScrollableControl.cs
-
-all: demo.exe
-
-demo.exe: demo.cs System.Windows.Forms.dll
- $(CSC) demo.cs /r:System.Windows.Forms.dll
-
-System.Windows.Forms.dll: $(SOURCES)
- $(CSC) $(SWFF) /target:library /out:System.Windows.Forms.dll $(SOURCES)
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleEvents.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleEvents.cs
deleted file mode 100644
index d39f188ec1d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleEvents.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Windows.Forms.AccessibleEvents.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian = , Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum AccessibleEvents{
- AcceleratorChange = 32786,
- Create = 32768,
- DefaultActionChange = 32765,
- DescriptionChange = 32781,
- Destroy = 32769,
- Focus = 32773,
- HelpChange = 32784,
- Hide = 32771,
- LocationChange = 32779,
- NameChange = 32780,
- ParentChange = 32783,
- Reorder = 32772,
- Selection = 32774,
- SelectionAdd = 32775,
- SelectionRemove = 32776,
- SelectionWithin = 32777,
- Show = 32770,
- StateChange = 32778,
- SystemAlert = 2,
- SystemCaptureEnd = 9,
- SystemCaptureStart = 8,
- SystemContextHelpEnd = 13,
- SystemContextHelpStart = 12,
- SystemDialogEnd = 17,
- SystemDialogStart = 16,
- SystemDragDropEnd = 15,
- SystemDragDropStart = 14,
- SystemForeground = 3,
- SystemMenuEnd = 5,
- SystemMenuPopupEnd = 7,
- SystemMenuPopupStart = 6,
- SystemMenuStart = 4,
- SystemMinimizeEnd = 23,
- SystemMinimizeStart = 22,
- SystemMoveSizeEnd = 11,
- SystemMoveSizeStart = 10,
- SystemScrollingEnd = 19,
- SystemScrollingStart = 18,
- SystemSound = 1,
- SystemSwitchEnd = 21,
- SystemSwitchStart = 20,
- ValueChange = 32782
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleNavigation.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleNavigation.cs
deleted file mode 100644
index 57205d745a4..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleNavigation.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Windows.Forms.AccessibleNavigation.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies a values for navigating among accessible objects.
- /// </summary>
-
- [Serializable]
- public enum AccessibleNavigation
- {
- //Values were verified with enumcheck.
- Down = 2,
- FirstChild = 7,
- LastChild = 8,
- Left = 3,
- Next = 5,
- Previous = 6,
- Right = 4,
- Up = 1
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleObject.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleObject.cs
deleted file mode 100644
index 0c646763d0b..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleObject.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-////
-//// System.Windows.Forms.AccessibleObject.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System;
-//using System.Reflection;
-//using System.Globalization;
-////using System.Windows.Forms.AccessibleObject.IAccessible;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides information that accessibility applications use to adjust an application's UI for users with impairments.
-// ///
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// - IAccessible members not stubbed out
-// /// - MarshalByRefObject members not stubbed out
-// /// MSDN gives little info on the members of IAccessible: "This member supports the .NET Framework infrastructure and is not intended to be used directly from your code."
-// /// </summary>
-// [MonoTODO]
-// public class AccessibleObject : MarshalByRefObject, IReflect/*, [MonoTODO]: */,IAccessible
-// {
-// string name;
-//
-// // --- Properties ---
-// [MonoTODO]
-// public virtual Rectangle Bounds
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public virtual string DefaultAction
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public virtual string Description
-// {
-// get { throw new NotImplementedException (); }
-// }
-// [MonoTODO]
-// public virtual string Help
-// {
-// get { throw new NotImplementedException (); }
-// }
-// [MonoTODO]
-// public virtual string KeyboardShortcut
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// public virtual string Name {
-// get { return name; }
-// set { name = value; }
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleObject Parent
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleRole Role
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleStates State
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public virtual string Value
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-//
-//
-// // --- Constructor ---
-// [MonoTODO]
-// public AccessibleObject()
-// {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-// // --- Methods ---
-// [MonoTODO]
-// public virtual void DoDefaultAction() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleObject GetChild(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual int GetChildCount() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleObject GetFocused() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual int GetHelpTopic(out string fileName) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleObject GetSelected() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleObject HitTest(int x,int y) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual AccessibleObject Navigate(AccessibleNavigation navdir) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual void Select(AccessibleSelection flags) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected void UseStdAccessibleObjects(IntPtr handle,int objid) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-// // --- Methods: object ---
-// [MonoTODO]
-// public override bool Equals (object obj) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-// // --- Methods: IReflect ---
-// [MonoTODO]
-// public FieldInfo GetField( string name,BindingFlags bindingAttr) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public FieldInfo[] GetFields (BindingFlags bindingAttr)
-// {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public MemberInfo[] GetMember( string name, BindingFlags bindingAttr) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public MemberInfo[] GetMembers( BindingFlags bindingAttr) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public MethodInfo GetMethod( string name, BindingFlags bindingAttr) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public MethodInfo GetMethod( string name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public MethodInfo[] GetMethods( BindingFlags bindingAttr) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public PropertyInfo GetProperty( string name, BindingFlags bindingAttr) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public PropertyInfo GetProperty( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
-// // FIXME
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public Type UnderlyingSystemType
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// /*
-// interface IAccessible
-// {
-// void accDoDefaultAction(object childID);
-// ...
-// }
-// */
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleRole.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleRole.cs
deleted file mode 100644
index 8a21d96e95c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleRole.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.Windows.Forms.AccessibleRole.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum AccessibleRole{
- Alert = 8,
- Animation = 54,
- Application = 14,
- Border = 19,
- ButtonDropDownGrid = 58,
- ButtonMenu = 57,
- Caret = 7,
- Cell = 29,
- Character = 32,
- Chart = 17,
- CheckButton = 44,
- Client = 10,
- Clock = 61,
- Column = 27,
- ColumnHeader = 25,
- ComboBox = 46,
- Cursor = 6,
- Default = -1,
- Diagram = 53,
- Dial = 49,
- Dialog = 18,
- Document = 15,
- DropList = 47,
- Equation = 55,
- Graphic = 40,
- Grip = 4,
- Grouping = 20,
- HelpBalloon = 31,
- HotkeyField = 50,
- Indicator = 39,
- Link = 30,
- List = 33,
- ListItem = 34,
- MenuBar = 2,
- MenuItem = 12,
- MenuPopup = 11,
- None = 0,
- Outline = 35,
- OutlineItem = 36,
- PageTab = 37,
- PageTabList = 60,
- Pane = 16,
- ProgressBar = 48,
- PropertyPage = 38,
- PushButton = 43,
- RadioButton = 45,
- Row = 28,
- RowHeader = 26,
- ScrollBar = 3,
- Separator = 21,
- Slider = 51,
- Sound = 5,
- SpinButton = 52,
- StaticText = 41,
- StatusBar = 23,
- Table = 24,
- Text = 42,
- TitleBar = 1,
- ToolBar = 22,
- ToolTip = 13,
- WhiteSpace = 59,
- Window = 9
- }
-
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleSelection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleSelection.cs
deleted file mode 100644
index 713c47b22c8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleSelection.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Windows.Forms.AccessibleSelection.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies how an accessible object is selected or receives focus.
- /// This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum AccessibleSelection
- {
- AddSelection = 1,
- ExtendSelection = 2,
- None = 0,
- RemoveSelection = 4,
- TakeFocus = 8,
- TakeSelection = 16
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleStates.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleStates.cs
deleted file mode 100644
index 49eb44e63bc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AccessibleStates.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Windows.Forms.AccessibleStates.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum AccessibleStates{
- AlertLow = 67108864,
- AlertMedium = 134217728,
- AlertHigh = 268435456,
- Animated = 16384,
- Busy = 2048,
- Checked = 16,
- Collapsed = 1024,
- Default = 256,
- Expanded = 512,
- ExtSelectable = 33554432,
- Floating = 4096,
- Focusable = 1048576,
- Focused = 4,
- HotTracked = 128,
- Indeterminate =32,
- Mixed = 32,
- Invisible = 32768,
- Linked = 4194304,
- Marqueed = 8192,
- Moveable = 262144,
- MultiSelectable = 16777216,
- None = 0,
- Pressed = 8,
- Protected = 536870912,
- ReadOnly = 64,
- Offscreen = 65536,
- Selectable = 2097152,
- Selected = 2,
- SelfVoicing = 524288,
- Sizeable = 131072,
- Traversed =8388608,
- Unavailable = 1,
- Valid = 1073741823,
-
-
- //Where did these come from, are they missing from elsewhere?
- //AddSelection = ,
- //ExtendSelection = ,
- //None = ,
- //RemoveSelection = ,
- //TakeFocus = ,
- //TakeSelection =
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AmbientProperties.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AmbientProperties.cs
deleted file mode 100644
index c182330ec4c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AmbientProperties.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-////
-//// System.Windows.Forms.AmbientProperties
-////
-//// Author:
-//// Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc 2002
-////
-//
-//
-//using System;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides ambient property values to top-level controls.
-// /// </summary>
-//
-// public sealed class AmbientProperties
-// {
-// Color backcolor;
-// Cursor cursor;
-// Font font;
-// Color forecolor;
-//
-//
-// // --- (public) Properties ---
-// public Color BackColor {
-// get { return backcolor; }
-// set { backcolor = value; }
-// }
-//
-// public Cursor Cursor {
-// get { return cursor; }
-// set { cursor = value; }
-// }
-//
-// public Font Font {
-// get { return font; }
-// set { font = value; }
-// }
-//
-// public Color Forecolor {
-// get { return forecolor; }
-// set { forecolor = value; }
-// }
-//
-//
-//
-// // --- Constructor ---
-// public AmbientProperties()
-// {
-// // default values:
-// this.backcolor=Color.Empty;
-// this.cursor=null;
-// this.font=null;
-// this.forecolor=Color.Empty;
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AnchorStyles.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AnchorStyles.cs
deleted file mode 100644
index 2b166e21061..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AnchorStyles.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Windows.Forms.AnchorStyles.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum AnchorStyles{
- Bottom = 2,
- Left = 4,
- None = 0,
- Right = 8,
- Top = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Appearance.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Appearance.cs
deleted file mode 100644
index 9e6c25cf59c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Appearance.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.Appearance.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum Appearance {
- Button = 0,
- Normal = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ApplicationContext.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ApplicationContext.cs
deleted file mode 100644
index 08964ce83c9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ApplicationContext.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-////
-//// System.Windows.Forms.ApplicationContext
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc 2002
-////
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Specifies the contextual information about an application thread.
-// ///
-// /// ToDo note:
-// /// - No methods are implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ApplicationContext
-// {
-// Form mainForm;
-//
-// // --- (public) Properties ---
-// public Form MainForm {
-// get { return mainForm; }
-// set { mainForm = value; }
-// }
-//
-// // --- Constructor ---
-// public ApplicationContext() {
-// mainForm=null;
-// }
-//
-// public ApplicationContext(Form mainForm) : this() {
-// this.mainForm=mainForm;
-// }
-//
-//
-//
-// // --- Methods ---
-// [MonoTODO]
-// public void Dispose() {
-// // see documentation on ApplicationContext.Dispose Method (Boolean)
-// this.Dispose(true);
-// }
-//
-// [MonoTODO]
-// protected virtual void Dispose(bool disposing) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void ExitThread() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void ExitThreadCore() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnMainFormClosed(object sender,EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // --- Methods: object ---
-// [MonoTODO]
-// ~ApplicationContext() {
-// // see documentation on ApplicationContext.Dispose Method (Boolean)
-// this.Dispose(false);
-// }
-//
-//
-//
-// // --- Events ---
-// [MonoTODO]
-// public event EventHandler ThreadExit {
-// add { throw new NotImplementedException (); }
-// remove { throw new NotImplementedException (); }
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs
deleted file mode 100644
index cb8dc7a59be..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeDirection.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Windows.Forms.ArrangeDirection.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
-
- //TODO: Add values for left and up
- //[MonoTodo]
- public enum ArrangeDirection {
- Down = 4,
- Left = 0,
- Right = 0,
- Up = 4
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeStartingPosition.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeStartingPosition.cs
deleted file mode 100644
index a289f785cad..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ArrangeStartingPosition.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Windows.Forms.ArrangeStartingPosition.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ArrangeStartingPosition {
- BottomLeft = 0,
- BottomRight = 1,
- Hide = 8,
- TopLeft = 2,
- TopRight = 3
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs
deleted file mode 100644
index 041dddab239..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/AxHost.cs
+++ /dev/null
@@ -1,770 +0,0 @@
-////
-//// System.Windows.Forms.AxHost
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System;
-//using System.ComponentModel;
-//using System.Drawing;
-//using System.Runtime.Serialization;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Wraps ActiveX controls and exposes them as fully featured Windows Forms controls.
-// ///
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public abstract class AxHost : Control, ISupportInitialize,ICustomTypeDescriptor
-// {
-// /// --- Constructors ---
-// /// Class AxHost does not have a constructor for non-internal purposes.
-// /// Thus, no constructor is stubbed out.
-// /// Here are the two AxHost constructors for supporting .NET Framework infrastructure:
-// /// - AxHost(String clsid);
-// /// - AxHost(string clsid,int flags);
-//
-//
-//
-//
-// /// --- public Properties ---
-// /// Properties supporting .NET framework, only. Not stubbed out:
-// /// - public bool EditMode {get;}
-// [MonoTODO]
-// public override Color BackColor {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override Image BackgroundImage {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public ContainerControl ContainingControl {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override ContextMenu ContextMenu {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// protected override CreateParams CreateParams {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override Cursor Cursor {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// protected override Size DefaultSize {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public virtual bool Enabled {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override Font Font {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override Color ForeColor {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public bool HasAboutBox {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public AxHost.State OcxState {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public virtual bool RightToLeft {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// ISite Site {
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override string Text {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-//
-//
-//
-//
-// /// --- methods ---
-// /// internal .NET framework supporting methods, not stubbed out:
-// /// - protected virtual void CreateSink();
-// /// - protected virtual void DetachSink();
-// /// - public void DoVerb(int verb);
-// /// - protected static Color GetColorFromOleColor(uint color);
-// /// - protected static Font GetFontFromIFont(object font);
-// /// - protected static Font GetFontFromIFontDisp(object font);
-// /// - protected static object GetIFontDispFromFont(Font font);
-// /// - protected static object GetIFontFromFont(Font font);
-// /// - protected static object GetIPictureDispFromPicture(Image image);
-// /// - protected static object GetIPictureFromCursor(Cursor cursor);
-// /// - protected static object GetIPictureFromPicture(Image image);
-// /// - protected static double GetOADateFromTime(DateTime time);
-// /// - protected static uint GetOleColorFromColor(Color color);
-// /// - protected static Image GetPictureFromIPicture(object picture);
-// /// - protected static Image GetPictureFromIPictureDisp(object picture);
-// /// - protected static DateTime GetTimeFromOADate(double date);
-// /// - public void InvokeEditMode();
-// /// - public void MakeDirty();
-// /// - protected bool PropsValid();
-// /// - protected void RaiseOnMouseDown(short button,short shift,int x,int y);
-// /// - protected void RaiseOnMouseDown(short button,short shift,float x,float y);
-// /// - protected void RaiseOnMouseDown(object o1,object o2,object o3,object o4);
-// /// - protected void RaiseOnMouseMove(short button,short shift,int x,int y);
-// /// - protected void RaiseOnMouseMove(short button,short shift,float x,float y);
-// /// - protected void RaiseOnMouseMove(object o1,object o2,object o3,object o4);
-// /// - protected void RaiseOnMouseUp(short button,short shift,int x,int y);
-// /// - protected void RaiseOnMouseUp(short button,short shift,float x,float y);
-// /// - protected void RaiseOnMouseUp(object o1,object o2,object o3,object o4);
-//
-// [MonoTODO]
-// protected virtual void AttachInterfaces() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void BeginInit() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void CreateHandle() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void DestroyHandle() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void Dispose(bool disposing) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public virtual void EndInit() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public object GetOcx() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public bool HasPropertyPages() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override bool IsInputChar(char charCode) {
-// throw new NotImplementedException ();
-// }
-//
-// /// --- methods used with events ---
-// [MonoTODO]
-// protected override void OnBackColorChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnFontChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnForeColorChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnHandleCreated(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnLostFocus(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-// /// --- END OF: methods used with events ---
-//
-// [MonoTODO]
-// public override bool PreProcessMessage(ref Message msg) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override bool ProcessMnemonic(char charCode) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected void SetAboutBoxDelegate(AxHost.AboutBoxDelegate d) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void SetBoundsCore(int x,int y,int width,int height,BoundsSpecified specified) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void SetVisibleCore(bool value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void ShowAboutBox() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void ShowPropertyPages() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void ShowPropertyPages(Control control) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void WndProc(ref Message m) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-//
-// /// --- events ---
-//
-// [MonoTODO]
-// public new event EventHandler BackColorChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-//
-// [MonoTODO]
-// public new event EventHandler BackgroundImageChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler BindingContextChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event UICuesEventHandler ChangeUICues {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler Click {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler ContextMenuChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler CursorChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler DoubleClick {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event DragEventHandler DragDrop {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event DragEventHandler DragEnter {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler DragLeave {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event DragEventHandler DragOver {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler EnabledChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler FontChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler ForeColorChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event GiveFeedbackEventHandler GiveFeedback {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event HelpEventHandler HelpRequested {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler ImeModeChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event KeyEventHandler KeyDown {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event KeyPressEventHandler KeyPress {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event KeyEventHandler KeyUp {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event LayoutEventHandler Layout {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event MouseEventHandler MouseDown {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler MouseEnter {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler MouseHover {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler MouseLeave {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event MouseEventHandler MouseMove {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event MouseEventHandler MouseUp {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event MouseEventHandler MouseWheel {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event PaintEventHandler Paint {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event QueryContinueDragEventHandler QueryContinueDrag {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler RightToLeftChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler StyleChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler TabIndexChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler TabStopChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public new event EventHandler TextChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-//
-//
-//
-//
-// /// --- public delegates ---
-// [Serializable]
-// protected delegate void AboutBoxDelegate();
-//
-//
-//
-//
-// /// --- ICustomTypeDescriptor methods ---
-// /// Note: all of them are supporting .NET framework, but have to be stubbed out for the interface
-//
-// [MonoTODO]
-// AttributeCollection ICustomTypeDescriptor.GetAttributes() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// string ICustomTypeDescriptor.GetClassName() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// string ICustomTypeDescriptor.GetComponentName() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// TypeConverter ICustomTypeDescriptor.GetConverter() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// object ICustomTypeDescriptor.GetEditor(Type editorBaseType) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// EventDescriptorCollection ICustomTypeDescriptor.GetEvents() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-// /// sub-class: AxHost.InvalidActiveXStateException
-// /// <summary>
-// /// The exception that is thrown when the ActiveX control is referenced while in an invalid state.
-// /// </summary>
-// [MonoTODO]
-// public class InvalidActiveXStateException : Exception
-// {
-// /// --- methods ---
-// [MonoTODO]
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-// }
-//
-//
-//
-//
-//
-// /// sub-class: AxHost.State
-// /// <summary>
-// /// Encapsulates the persisted state of an ActiveX control.
-// ///
-// /// Note: the class does not contain any documented methods, just only those supporting .NET framework
-// /// </summary>
-// [MonoTODO]
-// [Serializable]
-// public class State : ISerializable {
-//
-// /// The classes only constructor is supporting .NET framework, and thus not stubbed out:
-// /// - [Serializable] public AxHost.State(Stream ms,int storageType,bool manualUpdate,string licKey);
-//
-// /// --- Methods ---
-// //[Serializable]
-// void ISerializable.GetObjectData(SerializationInfo si,StreamingContext context) {
-// throw new NotImplementedException ();
-// }
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BaseCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BaseCollection.cs
deleted file mode 100644
index b78e9b3883c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BaseCollection.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-////
-//// System.Windows.Forms.BaseCollection
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System;
-//using System.Collections;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides the base functionality for creating data-related collections in the System.Windows.Forms namespace.
-// /// ToDo note:
-// /// - Synchronization is not implemented
-// /// - MarshalByRefObject members not stubbed out
-// /// </summary>
-//
-// [MonoTODO]
-// public class BaseCollection : MarshalByRefObject, ICollection, IEnumerable
-// {
-// ArrayList list;
-//
-//
-// // --- Constructor ---
-// public BaseCollection()
-// {
-// this.list=null;
-// }
-//
-//
-//
-// // --- public and protected Properties ---
-// public virtual int Count {
-// get { return list.Count; }
-// }
-//
-// public bool IsReadOnly {
-// get { return false; }
-// }
-//
-// [MonoTODO]
-// public bool IsSynchronized {
-// // FIXME: should return true if object is synchronized
-// get { return false; }
-// }
-//
-// protected virtual ArrayList List {
-// get { return list; }
-// }
-//
-// [MonoTODO]
-// public object SyncRoot {
-// // FIXME: should return object that can be used with the C# lock keyword
-// get { return this; }
-// }
-//
-//
-//
-// // --- public Methods ---
-// public void CopyTo (Array ar, int index) {
-// list.CopyTo(ar, index);
-// }
-//
-// public IEnumerator GetEnumerator() {
-// return list.GetEnumerator();
-// }
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Binding.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Binding.cs
deleted file mode 100644
index a1d005b3a24..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Binding.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-////
-//// System.Windows.Forms.Binding.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms
-//{
-// public class Binding
-// {
-// /// <summary>
-// /// Represents the simple binding between the property value of an object and the property value of a control.
-// ///
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// - MarshalByRefObject members not stubbed out
-// /// </summary>
-//
-// // --- Constructor
-// //
-// public Binding(string propertyName,object dataSource,string dataMember)
-// {
-// throw new NotImplementedException ();
-// }
-//
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public BindingManagerBase BindingManagerBase
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public BindingMemberInfo BindingMemberInfo
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public Control Control
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public object DataSource
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public bool IsBinding
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public string PropertyName
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// protected virtual void OnFormat(ConvertEventArgs cevent)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnParse(ConvertEventArgs cevent)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event ConvertEventHandler Format
-// {
-// add { throw new NotImplementedException (); }
-// remove { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public event ConvertEventHandler Parse
-// {
-// add { throw new NotImplementedException (); }
-// remove { throw new NotImplementedException (); }
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingContext.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingContext.cs
deleted file mode 100644
index 3c0763c7313..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingContext.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-////
-//// System.Windows.Forms.BindingContext.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms
-//{
-// public class BindingContext
-// {
-// /// <summary>
-// /// Manages the collection of BindingManagerBase objects for any object that inherits from the Control class.
-// /// </summary>
-//
-// // --- Constructor
-// [MonoTODO]
-// public BindingContext ()
-// {
-// throw new NotImplementedException ();
-// }
-//
-//
-// //
-// // --- Public Properties
-// // Following properties not stubbed out, because they are only supporting internal .NET Framework infrastructure.
-// // - bool IsReadOnly {get;}
-// [MonoTODO]
-// public BindingManagerBase this[object dataSource]
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public BindingManagerBase this[object dataSource,string dataMember]
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// //
-// // --- Methods
-// // Following methods not stubbed out, because they are only supporting internal .NET Framework infrastructure.
-// // - protected virtual void AddCore(object dataSource,BindingManagerBase listManager)
-// // - protected virtual void ClearCore()
-// // - void ICollection.CopyTo(Array ar,int index)
-// // - IEnumerator IEnumerable.GetEnumerator()
-// // - protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent)
-// // - protected virtual void RemoveCore(object dataSource)
-// [MonoTODO]
-// protected internal void Add(object dataSource, BindingManagerBase listManager)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected internal void Clear()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public bool Contains(object dataSource)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public bool Contains(object dataSource,string dataMember)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected internal void Remove(object dataSource)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// // Following events not stubbed out, because they are only supporting internal .NET Framework infrastructure
-// // - public event CollectionChangeEventHandler CollectionChanged;
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs
deleted file mode 100644
index d2d51fdcc9e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-////
-//// System.Windows.Forms.BindingManagerBase.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System.ComponentModel;
-//using System.Collections;
-//
-//namespace System.Windows.Forms
-//{
-// [MonoTODO]
-// public abstract class BindingManagerBase
-// {
-//
-// /// <summary>
-// /// Manages all Binding objects that are bound to the same data source and data member. This class is abstract.
-// /// </summary>
-//
-// // --- Constructor
-// [MonoTODO]
-// public BindingManagerBase ()
-// {
-// throw new NotImplementedException ();
-// }
-//
-//
-// //
-// // --- Fields
-// protected EventHandler onCurrentChangedHandler;
-// protected EventHandler onPositionChangedHandler;
-//
-//
-// //
-// // --- Public Properties
-// [MonoTODO]
-// public BindingsCollection Bindings
-// {
-// get { throw new NotImplementedException (); }
-// }
-//
-// public abstract int Count
-// {
-// get;
-// }
-//
-// public abstract object Current
-// {
-// get;
-// }
-//
-// public abstract int Position
-// {
-// get;
-// set;
-// }
-//
-//
-//
-// //
-// // --- Methods
-// public abstract void AddNew();
-//
-// public abstract void CancelCurrentEdit();
-//
-// public abstract void EndCurrentEdit();
-//
-// public abstract PropertyDescriptorCollection GetItemProperties ();
-//
-// [MonoTODO]
-// protected internal virtual PropertyDescriptorCollection GetItemProperties (ArrayList dataSources,ArrayList listAccessors)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual PropertyDescriptorCollection GetItemProperties (Type listType,int offset,ArrayList dataSources,ArrayList listAccessors)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected internal abstract string GetListName(ArrayList listAccessors);
-//
-// protected internal abstract void OnCurrentChanged(EventArgs e);
-//
-// [MonoTODO]
-// protected void PullData()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected void PushData()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public abstract void RemoveAt(int index);
-//
-// public abstract void ResumeBinding();
-//
-// public abstract void SuspendBinding();
-//
-// protected abstract void UpdateIsBinding();
-//
-//
-// //
-// // --- Public Events
-// [MonoTODO]
-// public event EventHandler CurrentChanged {
-// add { throw new NotImplementedException (); }
-// remove { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public event EventHandler PositionChanged {
-// add { throw new NotImplementedException (); }
-// remove { throw new NotImplementedException (); }
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingMemberInfo.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingMemberInfo.cs
deleted file mode 100644
index d4484ee23d1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingMemberInfo.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// System.Drawing.BindingMemberInfo.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-//TODO:
-// 1) Add real values in constructor.
-// 2) Verify nocheck needed in GetHashCode.
-// 3) Verify GetHashCode returns decent and valid hash.
-
-
-using System;
-
-namespace System.Windows.Forms {
-
- public struct BindingMemberInfo {
-
- private string bindingfield;
- private string bindingpath;
- private string bindingmember;
-
- // -----------------------
- // Public Constructor
- // -----------------------
-
- /// <summary>
- ///
- /// </summary>
- ///
- /// <remarks>
- ///
- /// </remarks>
-
- public BindingMemberInfo (string dataMember){
- //TODO: Initilize with real values.
- bindingmember = ("");
- bindingfield = ("");
- bindingpath = ("");
- }
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two BindingMemberInfo objects. The return value is
- /// based on the equivalence of the BindingMember, BindingPath,
- /// and BindingMember properties of the two objects.
- /// </remarks>
-
- public static bool operator == (BindingMemberInfo bmi_a,
- BindingMemberInfo bmi_b)
- {
- return ((bmi_a.bindingfield == bmi_b.bindingfield) &&
- (bmi_a.bindingpath == bmi_b.bindingpath)&&
- (bmi_a.bindingmember == bmi_b.bindingmember));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two BindingMemberInfo objects. The return value is
- /// based on the equivalence of the BindingMember, BindingPath,
- /// and BindingMember properties of the two objects.
- /// </remarks>
- public static bool operator != (BindingMemberInfo bmi_a,
- BindingMemberInfo bmi_b) {
- return ((bmi_a.bindingfield != bmi_b.bindingfield) ||
- (bmi_a.bindingpath != bmi_b.bindingpath)||
- (bmi_a.bindingmember != bmi_b.bindingmember));
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
-
- public string BindingField {
- get{
- return bindingfield;
- }
- }
-
- public string BindingPath {
- get{
- return bindingpath;
- }
- }
-
- public string BindingMember {
- get{
- return bindingmember;
- }
- }
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this BindingMemberInfo and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is BindingMemberInfo))
- return false;
-
- return (this == (BindingMemberInfo) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- unchecked{// MONOTODO: This should not be checked, remove unchecked, if redundant.
- return (int)( bindingfield.GetHashCode() ^ bindingmember.GetHashCode() ^ bindingpath.GetHashCode());
- }
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the BindingMemberInfo as a string.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1},{2}]", bindingpath, bindingfield, bindingmember);
- }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingsCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingsCollection.cs
deleted file mode 100644
index d6d254f0966..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BindingsCollection.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-////
-//// System.Windows.Forms.BindingsCollection.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System.Collections;
-//using System.ComponentModel;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Represents a collection of Binding objects for a control.
-// ///
-// /// ToDo note:
-// /// - most methods are not implemented
-// /// - those few that are implemented need checking
-// /// </summary>
-//
-// [MonoTODO]
-// public class BindingsCollection : BaseCollection
-// {
-// #region Constructors
-// protected internal BindingsCollection () {
-// }
-// #endregion
-//
-// // --- public and protected Properties ---
-// [MonoTODO]
-// public override int Count {
-// // CHECKME:
-// get { return base.Count; }
-// }
-//
-// [MonoTODO]
-// public Binding this[int index] {
-// // CHECKME:
-// get { return (Binding)(base.List[index]); }
-// }
-//
-// [MonoTODO]
-// protected override ArrayList List {
-// // CHECKME:
-// get { return base.List; }
-// }
-//
-//
-//
-// // --- public Methods ---
-// // following internal methods are (will) not be stubbed out:
-// // - protected virtual void AddCore(Binding dataBinding);
-// // - protected virtual void ClearCore();
-// // - protected virtual void RemoveCore(Binding dataBinding);
-// //
-// // CollectionChanged event:
-// // Though it was not documented, here methods Add and Remove
-// // cause the CollectionChanged event to occur, similarily as Clear.
-// // Would be nice if someone checked the exact event behavior of .NET implementation.
-//
-// [MonoTODO]
-// protected internal void Add(Binding binding) {
-// // CHECKME:
-// base.List.Add(binding);
-// OnCollectionChanged(new CollectionChangeEventArgs(
-// CollectionChangeAction.Add,
-// base.List
-// ));
-// }
-//
-// [MonoTODO]
-// protected internal void Clear() {
-// // CHECKME:
-// base.List.Clear();
-// OnCollectionChanged(new CollectionChangeEventArgs(
-// CollectionChangeAction.Refresh,
-// base.List
-// ));
-// }
-//
-// [MonoTODO]
-// protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent) {
-// // CHECKME:
-// if (CollectionChanged != null)
-// CollectionChanged(this, ccevent);
-// }
-//
-// [MonoTODO]
-// protected internal void Remove(Binding binding) {
-// // CHECKME:
-// base.List.Remove(binding);
-// OnCollectionChanged(new CollectionChangeEventArgs(
-// CollectionChangeAction.Remove,
-// base.List
-// ));
-// }
-//
-// [MonoTODO]
-// protected internal void RemoveAt(int index) {
-// // CHECKME:
-// base.List.RemoveAt(index);
-// OnCollectionChanged(new CollectionChangeEventArgs(
-// CollectionChangeAction.Remove,
-// base.List
-// ));
-// }
-//
-// protected internal bool ShouldSerializeMyAll() {
-// if (this.Count>0) return true;
-// else return false;
-// }
-//
-//
-//
-// // public events
-// public event CollectionChangeEventHandler CollectionChanged;
-//
-//
-//
-// }
-//}
-//
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BootMode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BootMode.cs
deleted file mode 100644
index c837768bf2b..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BootMode.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.BootMode.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum BootMode {
- FailSafe = 1,
- FailSafeWithNetwork = 2,
- Normal = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DSide.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DSide.cs
deleted file mode 100644
index 5169430f8de..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DSide.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.Border3DSide.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum Border3DSide {
- All = 2063,
- Bottom = 8,
- Left = 1,
- Middle = 2048,
- Right = 4,
- Top = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DStyle.cs
deleted file mode 100644
index 47ce12902f0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Border3DStyle.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Windows.Forms.Border3DStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum Border3DStyle {
- Adjust = 8192,
- Bump = 9,
- Etched = 6,
- Flat = 16394,
- Raised = 5,
- RaisedInner = 4,
- RaisedOuter = 1,
- Sunken = 10,
- SunkenInner = 8,
- SunkenOuter = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BorderStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BorderStyle.cs
deleted file mode 100644
index ae105c61d4c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BorderStyle.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.BorderStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum BorderStyle {
- Fixed3D = 2,
- FixedSingle = 1,
- None = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/BoundsSpecified.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/BoundsSpecified.cs
deleted file mode 100644
index 797552920e0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/BoundsSpecified.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Windows.Forms.BoundsSpecified.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum BoundsSpecified {
- All = 15,
- Height = 8,
- Location = 3,
- None = 0,
- Size = 12,
- Width = 4,
- X = 1,
- Y = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBorderStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBorderStyle.cs
deleted file mode 100644
index 2ae296ecae4..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonBorderStyle.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.ButtonBorderStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ButtonBorderStyle {
- Dashed = 2,
- Dotted = 1,
- Inset = 4,
- None = 0,
- Outset = 5,
- Solid = 3
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonState.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonState.cs
deleted file mode 100644
index b2f4313eda6..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ButtonState.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.ButtonState.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ButtonState {
- All = 181176,
- Checked = 1024,
- Flat = 16384,
- Inactive = 256,
- Normal = 0,
- Pushed = 512
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CaptionButton.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CaptionButton.cs
deleted file mode 100644
index 3536463f5be..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CaptionButton.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Windows.Forms.CaptionButton.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.CaptionButton
-{
-
- /// <summary>
- /// Specifies the type of caption button to display.
- /// </summary>
-
- [Serializable]
- public enum CaptionButton
- {
- //Values were verified with enumcheck.
- Close = 0,
- Minimize = 1,
- Maximize = 2,
- Restore = 3,
- Help = 4,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
deleted file mode 100644
index 509b5ea995e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ChangeLog
+++ /dev/null
@@ -1,357 +0,0 @@
-2002-04-10 Duncan Mak <duncan@ximian.com>
-
- * CaptionButton.cs:
- * CharacterCasing.cs:
- * CheckState.cs:
- * DataGridParentRowsLabelStyle.cs:
- * DialogResult.cs:
- * DockStyle.cs:
- * DragAction.cs:
- * DragDropEffects.cs:
- * DrawItemState.cs:
- * DrawMode.cs:
- * ErrorBlinkStyle.cs:
- * ErrorIconAlignment.cs:
- * FlatStyle.cs:
- * FormBorderStyle.cs:
- * FormStartPosition.cs:
- * FormWindowState.cs:
- * FrameStyle.cs: Fixed enum layouts with EnumCheck.
-
-2002-4-23 Dennis Hayes <dennish@raytek.com>
-
- * AccessibleNavigation.cs :added to cvs with bad enum values, I will correct.
- * AccessibleSelection.cs :added with good enum values.
- * ContentsResizedEventHandler.cs :Added delagate
- * MainMenu.cs
- * AccessibleObject.cs
- * MeasureItemEventArgs :added stubbed classes. Commented out.
- * IButtonControl.cs : Added interface.
-
-2002-4-23 Dennis Hayes <dennish@raytek.com>
-* added stubbed and commented out classes from F to G *
-
-2002-05-02 Daniel Carrera (dcarrera@math.utoronto.ca)
-* small update to classes [F-H]*
-* added stubbed and commented out classes for [I-L]*
-* added stubbed and commented out classes for R*
-
-* 5-5-2002 Dennis Hayes <dennish@raytek.com>
-* Added enums
-* GridItemType.cs
-* HelpNavigator.cs
-* HorizontalAlignment.cs
-* ImeMode.cs
-* ItemActivation.cs
-* ItemBoundsPortion.cs
-* Keys.cs
-* All correct execpt for Keys.cs which is missing a half dozen
-* duplicate entries that need correcting.
-
-2002-05-07 Daniel Carrera (dcarrera@math.utoronto.ca)
-* Fixed a problem with an "extra byte" problem. It caused an extra '?'
- at the beginning of some lines.
- Classes F-L and Q-R were updated.
-* Added the classes SaveFileDialog.cs and Screen.cs
-
-2002-5-7 Dennis Hayes <dennish@raytek.com>
-* Added duplicate values
-* System.Windows.Forms.Keys.cs
-
-2002-5-7 Dennis Hayes <dennish@raytek.com>
-* LeftRightAlignment.cs
-* LinkBehavior.cs
-* LinkState.cs
-* ListViewAlignment.cs
-* MdiLayout.cs
-* MenuGlyph.cs
-* MenuMerge.cs
-* MessageBoxButtons.cs
-* MessageBoxDefaultButton.cs
-* MessageBoxIcon.cs
-* MessageBoxOptions.cs
-* MouseButtons.cs
-* Orientation.cs
-* PictureBoxSizeMode.cs
-* PropertySort.cs
-* Added some more enums. All have correct values.
-
- 2002-5-8 Dennis Hayes <dennish@raytek.com>
-* RichTextBoxFinds.cs
-* RichTextBoxScrollBars.cs
-* RichTextBoxSelectionAttribute.cs
-* RichTextBoxSelectionTypes.cs
-* RichTextBoxStreamType.cs
-* RichTextBoxWordPunctuations.cs
-* RightToLeft.cs
-* ScrollBars.cs
-* ScrollButton.cs
-* ScrollEventType.cs
-* SecurityIDType.cs
-* SelectionMode.cs
-* Shortcut.cs
-* SizeGripStyle.cs
-* SortOrder.cs
-* StatusBarPanelAutoSize.cs
-* StatusBarPanelBorderStyle.cs
-* StatusBarPanelStyle.cs
-* StructFormat.cs
-* TabAlignment.cs
-* TabAppearance.cs
-* TabDrawMode.cs
-* TabSizeMode.cs
-* TickStyle.cs
-* ToolBarAppearance.cs
-* ToolBarButtonStyle.cs
-* ToolBarTextAlign.cs
-* TreeViewAction.cs
-* UICues.cs
-* View.cs
-* Added enums.
-* All System.Windows.Forms enums complete with correct values.
- 2002-5-8 Dennis Hayes <dennish@raytek.com>
-Dennis Hayes <dennish@raytek.com>
-Checking in new System.Windows.forms classes (a* to c*) for
-Jaak Simm <jaaksimm@firm.ee>
-* AmbientProperties.cs
-* Application.cs
-* ApplicationContext.cs
-* AxHost.cs
-* BaseCollection.cs
-* Binding.cs
-* BindingContext.cs
-* BindingManagerBase.cs
-* BindingsCollection.cs
-* Button.cs
-* ButtonBase.cs
-* CheckBox.cs
-* CheckedListBox.cs
-* Clipboard.cs
-* ColorDialog.cs
-* ColumnClickEventArgs.cs
-* ColumnHeader.cs
-* ComboBox.cs
-* CommonDialog.cs
-* ContainerControl.cs
-* ContentsResizedEventArgs.cs
-* ContextMenu.cs
-* Control.cs
-* ControlBindingsCollection.cs
-* ControlEventArgs.cs
-* ControlPaint.cs
-* ConvertEventArgs.cs
-* CreateParams.cs
-* CurrencyManager.cs
-* Cursor.cs
-* CursorConverter.cs
-* Cursors.cs
-* Classes stubbed and commented out.
-
- 2002-5-8 Dennis Hayes <dennish@raytek.com>
-Dennis Hayes <dennish@raytek.com>
-Checking in new System.Windows.forms classe for John Rebbeck <john@rebent.com>
-
-* UserControl.cs
-Stubbed and commented out
-
- 2002-5-8 Dennis Hayes <dennish@raytek.com>
-Dennis Hayes <dennish@raytek.com>
-Checking in new System.Windows.forms classe for Paul Osman <paul.osmand@sympatico.ca>
-
-* NavigateEventArgs.cs
-* NodeLabelEditEventArgs.cs
-* NotifyIcon.cs
-Stubbed and commented out
-
-2002-5-10 Dennis Hayes
-* added IMessageFilter
-* Interfaces complete
-
-2002-5-27 DennisHayes <dennish@raytek.com>
-Added structs. All structs in System.Windows.Forms done
-* BindingMemberInfo.cs
-* DataGridCell.cs
-* LinkArea.cs
-* Message.cs
-* Complete execpt for Message.cs GetLParam
-* and
-* BindingMemberInfo needs constructor.
-* All need verification of hashcodes.
-
-2002-5-27 DennisHayes <dennish@raytek.com>
-Added delegates. All delegates in System.Windows.Forms done
-* ColumnClickEventHandler.cs
-* ContentsResizedEventHandler.cs
-* ControlEventHandler.cs
-* ConvertEventHandler.cs
-* DateRangeEventHandler.cs
-* DragEventHandler.cs
-* DrawItemEventHandler.cs
-* GiveFeedbackEventHandler.cs
-* HelpEventHandler.cs
-* InputLanguageChangedEventHandler.cs
-* InputLanguageChangingEventHandler.cs
-* InvalidateEventHandler.cs
-* ItemChangedEventHandler.cs
-* ItemCheckEventHandler.cs
-* ItemDragEventHandler.cs
-* KeyEventHandler.cs
-* LabelEditEventHandler.cs
-* LayoutEventHandler.cs
-* LinkClickedEventHandler.cs
-* LinkLabelLinkClickedEventHandler.cs
-
-2002-5-27 DennisHayes <dennish@raytek.com>
- Check in for Paul Osman <paul.osman@sympatico.ca>
-* NumericUpDown.cs
-* OpacityConverter.cs
-* OpenFileDialog.cs
-* OSFeature.cs
-* PageSetupDialog.cs
-* PaintEventArgs.cs
-* MonthCalendar.HitTestInfo.cs
-* MouseEventArgs.cs
-* NativeWindow.cs
-* Stubbed and commented out
-* NativeWindow.cs, MonthCalendar.HitTestInfo.cs, MouseEventArgs.cs,
-* have bad extra byte from old skeleton, need new corrected version.
-* MonthCalendar.HitTestInfo.cs needs to be incorporated into MonthCalendar.
-
-2002-5-27 DennisHayes <dennish@raytek.com>
- Check in for Paul Osman <paul.osman@sympatico.ca>
-* Menu.cs
-* Menu.MenuItemCollection.cs
-* MenuItem.cs
-* MessageBox.cs
-* MonthCalendar.cs
-* Stubbed and commented out
-* MonthCalendar.cs has bad extra byte from old skeleton, need new corrected version.
-* MonthCalendar.HitTestInfo.cs needs to be incorporated into MonthCalendar.
-* Menu.MenuItemCollection.cs needs to be incorporated into Menu.cs.
-
-2002-5-27 DennisHayes <dennish@raytek.com>
- Check in for Paul Osman <paul.osman@sympatico.ca>
-* Panel.cs
-* New class, Stubbed and commented out
-
-2002-5-31 DennisHayes <dennish@raytek.com>
- Check in for Paul Osman <paul.osman@sympatico.ca>
-* Panel.cs
-* New class, Stubbed and commented out
-
-2002-5-31 DennisHayes <dennish@raytek.com>
- Check in for Paul Osman <paul.osman@sympatico.ca>
-* MonthCalendar.cs
-* MonthCalendar.HitTestInfo.cs
-* MouseEventArgs.cs
-* NativeWindow.cs
-* Removed trash byte
-
-2002-5-31 DennisHayes <dennish@raytek.com>
-* ColumnClickEventArgs.cs
-* Fully implmented.
-
-2002-5-31 DennisHayes <dennish@raytek.com>
-* Minor formating in lots of files
-
-2002-5-31 DennisHayes <dennish@raytek.com>
-* ItemChangedEventHandler.cs
-* InvalidateEventHandler.cs
-* ItemChangedEventHandler.cs
-* added new files
-
-2002-6-5 DennisHayes <dennish@raytek.com>
-* TabControl.cs
-* TabPage.cs
-* TextBox.cs
-* TextBoxBase.cs
-* ThreadExceptionDialog.cs
-* Timer.cs
-* added new files for Jackson Harper (jackson@latitudegeo.com)
-* needs to be mono styled, and may have other issues
-
-2002-6-5 DennisHayes <dennish@raytek.com>
-* ErrorProvider.cs
-* PrintControllerWithStatusDialog.cs
-* PrintDialog.cs
-* added new files for paul
-
-2002-6-5 DennisHayes <dennish@raytek.com>
-* StatusBarDrawItemEventArgs.cs
-* StatusBarPanel.cs
-* StatusBarPanelClickEventArgs.cs
-* StatusBarPanelCollection.cs
-* SystemInformation.cs
-* added new files for Richard Baumann (biochem333@nyc.rr.com)
-
-2002-6-5 DennisHayes <dennish@raytek.com>
-* removed, code moved to main class files, Form.cs, ImageList.cs, LinkLabel.cs,
-* ListBox.cs, ListView.cs, ListViewItem.cs, Menu.cs, MonthCalendar.cs, ScrollableControl.cs
-* Form.ControlCollectison.cs
-* ImageList.ImageCollection.c
-* LinkLabel.LinkCollection.cs
-* ListBox.ObjectCollection.cs
-* ListBox.SelectedIndexCollection.cs
-* ListBox.SelectedObjectCollection.cs
-* ListView.CheckedListViewItemCollection.cs
-* ListView.CheckedIndexCollection.cs
-* ListView.ColumnHeaderCollection.cs
-* ListView.ListViewItemCollection.cs
-* ListView.SelectedIndexCollection.cs
-* ListView.SelectedListViewItemCollection.cs
-* ListViewItem.ListViewSubItem.cs
-* ListViewItem.ListViewSubItemCollection.cs
-* Menu.MenuItemCollection.cs
-* MonthCalendar.HitTestInfo.cs
-* ScrollableControl.DockPaddingEdges.cs
-
-2002-6-5 DennisHayes <dennish@raytek.com>
-* Checked in for Jackson Harper (jackson@latitudegeo.com)
-* ToolBar.cs
-* ToolBarButton.cs
-* ToolTip.cs
-* TrackBar.cs
-* TreeNode.cs
-* TreeNodeCollection.cs
-* TreeNodeConverter.cs
-* TreeView.cs
-* TreeViewCancelEventArgs.cs
-* TreeViewEventArgs.cs
-* TreeViewImageIndexConverter.cs
-* Just stubbs
-* New files added, work in progress cleanup and mono style needed.
-
-2002-6-5 DennisHayes <dennish@raytek.com>
-* checked in for Stefan Warnke (StefanW@POBox.com)
-* UICuesEventArgs.cs
-* UpDownBase.cs
-* Just stubbs
-* New files, work in progress, needs cleanup and mono style
-
-2002-6-18 DennisHayes <dennish@raytek.com>
-* checked in for Stefan Warnke (StefanW@POBox.com)
-* UICuesEventArgs.cs
-* UpDownBase.cs
-* Better comments and formatting
-
-2002-6-18 DennisHayes <dennish@raytek.com>
-* Checked in for Jackson Harper (jackson@latitudegeo.com)
-* ToolBar.cs
-* TabControl.cs
-* TabPage.cs
-* Added sub classes
-
-2002-6-24 DennisHayes <dennish@raytek.com>
-* AccessibleStates.cs
-* ArrangeDirection.cs
-* AccessibleEvents.cs
-* Added values for enums
-
-2002-6-24 DennisHayes <dennish@raytek.com>
-* BindingMemberInfo.cs
-* CaptionButton.cs
-* DataGridCell.cs
-* Message.cs
-* MessageBox.cs
-* Fixed bugs preventing compile
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CharacterCasing.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CharacterCasing.cs
deleted file mode 100644
index 7e1c123c39e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CharacterCasing.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Windows.Forms.CharacterCasing.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the case of characters in a TextBox control.
- /// </summary>
- [Serializable]
- public enum CharacterCasing
- {
- //Values were verified with enumcheck.
- Normal = 0,
- Upper = 1,
- Lower = 2,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs
deleted file mode 100644
index cf358f5fad1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckBox.cs
+++ /dev/null
@@ -1,185 +0,0 @@
-////
-//// System.Windows.Forms.CheckBox.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Represents a Windows check box.
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class CheckBox : ButtonBase
-// {
-// // private fields
-// Appearance appearance;
-// bool autoCheck;
-// ContentAlignment checkAlign;
-// bool _checked;
-// CheckState checkState;
-// bool threeState;
-//
-//
-// // --- Constructor ---
-// public CheckBox() : base() {
-// appearance = Appearance.Normal;
-// autoCheck = true;
-// checkAlign = ContentAlignment.MiddleLeft;
-// _checked = false;
-// checkState = CheckState.Unchecked;
-// threeState = false;
-// }
-//
-//
-//
-//
-// // --- CheckBox Properties ---
-// public Appearance Appearance {
-// get { return appearance; }
-// set { appearance=value; }
-// }
-//
-// public bool AutoCheck {
-// get { return autoCheck; }
-// set { autoCheck=value; }
-// }
-//
-// public ContentAlignment CheckAlign {
-// get { return checkAlign; }
-// set { checkAlign=value; }
-// }
-//
-// public bool Checked {
-// get { return _checked; }
-// set { _checked=value; }
-// }
-//
-// public CheckState CheckState {
-// get { return checkState; }
-// set { checkState=value; }
-// }
-//
-// [MonoTODO]
-// protected override CreateParams CreateParams {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// protected override Size DefaultSize {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override ContentAlignment TextAlign {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// public bool ThreeState {
-// get { return threeState; }
-// set { threeState=value; }
-// }
-//
-//
-//
-//
-// // --- CheckBox methods ---
-// [MonoTODO]
-// protected override AccessibleObject CreateAccessibilityInstance() {
-// throw new NotImplementedException ();
-// }
-//
-//
-// // [event methods]
-// [MonoTODO]
-// protected virtual void OnAppearanceChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnCheckedChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnCheckStateChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnClick(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnHandleCreated(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnMouseUp(MouseEventArgs mevent) {
-// throw new NotImplementedException ();
-// }
-// // end of [event methods]
-//
-//
-// [MonoTODO]
-// protected override bool ProcessMnemonic(char charCode) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-// /// --- CheckBox events ---
-// [MonoTODO]
-// public event EventHandler AppearanceChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public event EventHandler CheckedChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public event EventHandler CheckStateChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-//
-//
-//
-// /// --- public class CheckBox.CheckBoxAccessibleObject : ButtonBase.ButtonBaseAccessibleObject ---
-// /// the class is not stubbed, cause it's only used for .NET framework
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckState.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckState.cs
deleted file mode 100644
index fd71da77dc7..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckState.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Windows.Forms.CheckState.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the state of a control, such as a check box,
- /// that can be checked, unchecked, or set to an indeterminate state.
- /// </summary>
- [Serializable]
- public enum CheckState
- {
- //Values were verified with enumcheck.
- Unchecked = 0,
- Checked = 1,
- Indeterminate = 2,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
deleted file mode 100644
index 6435baa3ccc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
+++ /dev/null
@@ -1,454 +0,0 @@
-////
-//// System.Windows.Forms.CheckedListBox.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.Drawing;
-//using System.Collections;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Displays a ListBox in which a check box is displayed to the left of each item.
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class CheckedListBox : ListBox
-// {
-// // private fields
-// bool checkOnClick;
-// bool threeDCheckBoxes;
-//
-//
-// // --- Constructor ---
-// public CheckedListBox() : base() {
-// checkOnClick = false;
-// threeDCheckBoxes = true;
-// }
-//
-//
-//
-//
-// // --- CheckedListBox Properties ---
-// [MonoTODO]
-// public CheckedListBox.CheckedIndexCollection CheckedIndices {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public CheckedListBox.CheckedItemCollection CheckedItems {
-// get { throw new NotImplementedException (); }
-// }
-//
-// public bool CheckOnClick {
-// get { return checkOnClick; }
-// set { checkOnClick=value; }
-// }
-//
-// [MonoTODO]
-// protected override CreateParams CreateParams {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override DrawMode DrawMode {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override int ItemHeight {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public new CheckedListBox.ObjectCollection Items {
-// get { throw new NotImplementedException (); }
-// }
-//
-// public override SelectionMode SelectionMode {
-// set {
-// if (value!=SelectionMode.One && value!=SelectionMode.None)
-// throw new ArgumentException();
-// base.SelectionMode=value;
-// }
-// }
-//
-// public bool ThreeDCheckBoxes {
-// get { return threeDCheckBoxes; }
-// set { threeDCheckBoxes=value; }
-// }
-//
-//
-//
-//
-// // --- CheckedListBox methods ---
-// // following methods were not stubbed out, because they only support .NET framework:
-// // - protected virtual void OnItemCheck(ItemCheckEventArgs ice)
-// // - protected override void WmReflectCommand(ref Message m)
-// [MonoTODO]
-// protected override AccessibleObject CreateAccessibilityInstance() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override ObjectCollection CreateItemCollection() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public bool GetItemChecked(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public CheckState GetItemCheckState(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// // [event methods]
-// [MonoTODO]
-// protected override void OnBackColorChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnClick(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnDrawItem(DrawItemEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnFontChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnHandleCreated(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // only supports .NET framework, thus is not stubbed out
-// /*
-// [MonoTODO]
-// protected virtual void OnItemCheck(ItemCheckEventArgs ice) {
-// throw new NotImplementedException ();
-// }
-// */
-//
-// [MonoTODO]
-// protected override void OnKeyPress(KeyPressEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnMeasureItem(MeasureItemEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnSelectedIndexChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-// // end of [event methods]
-//
-// [MonoTODO]
-// public void SetItemChecked(int index,bool value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void SetItemCheckState(int index,CheckState value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void WndProc(ref Message m) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-// /// --- CheckedListBox events ---
-// /// following events are not stubbed out, because they only support .NET framework:
-// /// - public new event EventHandler Click;
-// /// - public new event DrawItemEventHandler DrawItem;
-// /// - public new event MeasureItemEventHandler MeasureItem;
-// [MonoTODO]
-// public event ItemCheckEventHandler ItemCheck {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-//
-//
-//
-// /// sub-class: CheckedListBox.CheckedIndexCollection
-// /// <summary>
-// /// Encapsulates the collection of indexes of checked items (including items in an indeterminate state) in a CheckedListBox.
-// /// </summary>
-// [MonoTODO]
-// public class CheckedIndexCollection : IList, ICollection, IEnumerable {
-//
-//
-// /// --- CheckedIndexCollection Properties ---
-// [MonoTODO]
-// public int Count {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public bool IsReadOnly {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int this[int index] {
-// get { throw new NotImplementedException (); }
-// }
-//
-// /// --- ICollection properties ---
-// bool IList.IsFixedSize {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-// object IList.this[int index]
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// [MonoTODO] set { throw new NotImplementedException (); }
-// }
-//
-// object ICollection.SyncRoot
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-// bool ICollection.IsSynchronized
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-//
-//
-//
-// /// --- CheckedIndexCollection Methods ---
-// /// Note: IList methods are stubbed out, otherwise does not IList interface cannot be implemented
-// [MonoTODO]
-// public bool Contains(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void CopyTo(Array dest,int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public IEnumerator GetEnumerator() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int IndexOf(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// /// --- CheckedIndexCollection.IList methods ---
-// [MonoTODO]
-// int IList.Add(object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.Clear() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// bool IList.Contains(object index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// int IList.IndexOf(object index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.Insert(int index,object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.Remove(object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.RemoveAt(int index) {
-// throw new NotImplementedException ();
-// }
-// } // --- end of CheckedListBox.CheckedIndexCollection ---
-//
-//
-//
-//
-// /// sub-class: CheckedListBox.CheckedItemCollection
-// /// <summary>
-// /// Encapsulates the collection of checked items (including items in an indeterminate state) in a CheckedListBox control.
-// /// </summary>
-// [MonoTODO]
-// public class CheckedItemCollection : IList, ICollection, IEnumerable {
-//
-//
-// /// --- CheckedItemCollection Properties ---
-// [MonoTODO]
-// public int Count {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public bool IsReadOnly {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int this[int index] {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// /// --- ICollection properties ---
-// bool IList.IsFixedSize {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-// object IList.this[int index]
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// [MonoTODO] set { throw new NotImplementedException (); }
-// }
-//
-// object ICollection.SyncRoot
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-// bool ICollection.IsSynchronized
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-//
-//
-// /// --- CheckedItemCollection Methods ---
-// /// Note: IList methods are stubbed out, otherwise IList interface cannot be implemented
-// [MonoTODO]
-// public bool Contains(int item) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void CopyTo(Array dest,int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public IEnumerator GetEnumerator() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int IndexOf(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// /// --- CheckedItemCollection.IList methods ---
-// [MonoTODO]
-// int IList.Add(object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.Clear() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// bool IList.Contains(object index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// int IList.IndexOf(object index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.Insert(int index,object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.Remove(object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// void IList.RemoveAt(int index) {
-// throw new NotImplementedException ();
-// }
-// } // --- end of CheckedListBox.CheckedItemCollection ---
-//
-//
-//
-// // FIXME:
-// // fix the problem of causing error CS0508.
-// // The error occurs as the ObjectCollection class will change the return type of the overriden method
-// // CheckedListBox.CreateItemCollection().
-//
-// /// sub-class: CheckedListBox.ObjectCollection
-// /// <summary>
-// /// Represents the collection of items in a CheckedListBox.
-// /// </summary>
-// /*
-// [MonoTODO]
-// public class ObjectCollection : ListBox.ObjectCollection {
-//
-// /// --- ObjectCollection.constructor ---
-// [MonoTODO]
-// public ObjectCollection(CheckedListBox owner) {
-// throw new NotImplementedException ();
-// }
-//
-//
-// /// --- methods ---
-// [MonoTODO]
-// public int Add(object item,bool isChecked) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int Add(object item,CheckState check) {
-// throw new NotImplementedException ();
-// }
-// }
-// */
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Clipboard.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Clipboard.cs
deleted file mode 100644
index 47bc18ae144..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Clipboard.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-////
-//// System.Windows.Forms.Clipboard.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited.
-// ///
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public sealed class Clipboard
-// {
-// // --- Methods ---
-// [MonoTODO]
-// public static IDataObject GetDataObject() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void SetDataObject(object data) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void SetDataObject(object data,bool copy) {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDepth.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDepth.cs
deleted file mode 100644
index 9ee4992bb42..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDepth.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Windows.Forms.ColorDepth.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ColorDepth {
- Depth16Bit = 16,
- Depth24Bit = 24,
- Depth32Bit = 32,
- Depth4Bit = 4,
- Depth8Bit = 8
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDialog.cs
deleted file mode 100644
index 6ec5756d322..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColorDialog.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-////
-//// System.Windows.Forms.ColorDialog.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Represents a common dialog box that displays available colors along with controls that allow the user to define custom colors.
-// ///
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ColorDialog : CommonDialog
-// {
-// // private fields
-// bool allowFullOpen;
-// bool anyColor;
-// Color color;
-// int[] customColors;
-// bool fullOpen;
-// bool showHelp;
-// bool solidColorOnly;
-//
-// /// --- Constructor ---
-// protected ColorDialog() : base() {
-// allowFullOpen = true;
-// anyColor = false;
-// color = Color.Black;
-// customColors = null;
-// fullOpen = false;
-// showHelp = false;
-// solidColorOnly = false;
-// }
-//
-//
-//
-//
-// /// --- Properties ---
-// /// following properties are not stubbed out, because they only support .NET framework
-// /// - protected virtual IntPtr Instance {get;}
-// /// - protected virtual int Options {get;}
-// public virtual bool AllowFullOpen {
-// get { return allowFullOpen; }
-// set { allowFullOpen=value; }
-// }
-//
-// public virtual bool AnyColor {
-// get { return anyColor; }
-// set { anyColor=value; }
-// }
-//
-// public Color Color {
-// get { return color; }
-// set { color=value; }
-// }
-//
-// public int[] CustomColors {
-// get { return customColors; }
-// set { customColors=value; }
-// }
-//
-// public virtual bool FullOpen {
-// get { return fullOpen; }
-// set { fullOpen=value; }
-// }
-//
-// public virtual bool ShowHelp {
-// get { return showHelp; }
-// set { showHelp=value; }
-// }
-//
-// public virtual bool SolidColorOnly {
-// get { return solidColorOnly; }
-// set { solidColorOnly=value; }
-// }
-//
-//
-//
-//
-// /// --- ColorDialog methods ---
-// [MonoTODO]
-// public override void Reset() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override bool RunDialog(IntPtr hwndOwner) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventArgs.cs
deleted file mode 100644
index c3043a612e1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventArgs.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// System.Windows.Forms.ColumnClickEventArgs.cs
-//
-// Author:
-// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-// Implmented by Dennis Hayes <dennish@raytek.com>
-//
-// (C) Ximian, Inc., 2002
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Provides data for the ColumnClick event.
- /// </summary>
- public class ColumnClickEventArgs : EventArgs
- {
- private int column;
- /// --- Constructor ---
- protected ColumnClickEventArgs(int Column) : base() {
- column = Column;
- }
-
-
- /// --- Properties ---
- public int Column {
- get {
- return column;
- }
- }
-
- // add. remove comment after modifing for this class
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two ColumnClickEventArgs objects. The return value is
- /// based on the equivalence of the Column properties
- /// of the two ColumnClickEventArgs.
- /// </remarks>
-
- public static bool operator == (ColumnClickEventArgs ColumnClickEventArgsA , ColumnClickEventArgs ColumnClickEventArgsB) {
- return ColumnClickEventArgsA.column == ColumnClickEventArgsB.column;
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two ColumnClickEventArgs objects. The return value is
- /// based on the equivalence of the Column properties
- /// of the two ColumnClickEventArgs.
- /// </remarks>
-
- public static bool operator != (ColumnClickEventArgs ColumnClickEventArgsA, ColumnClickEventArgs ColumnClickEventArgsB) {
- return ColumnClickEventArgsA.column != ColumnClickEventArgsB.column;
- }
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this ColumnClickEventArgs and another object.
- /// </remarks>
-
- public override bool Equals (object o) {
- if (!(o is ColumnClickEventArgs))return false;
- return (this == (ColumnClickEventArgs) o);
- }
-
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
- // If class has only one proprity, just return the hash code of the proprity.
- public override int GetHashCode () {
- return column.GetHashCode();
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the ColumnClickEventArgs as a string.
- /// </remarks>
-
- public override string ToString () {
- return String.Format ("[{0}]", column);
- }
- //end add. remove comment after modifing for this class
-
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventHandler.cs
deleted file mode 100644
index c044171cb13..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnClickEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.ColumnClickEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void ColumnClickEventHandler(
- object sender,
- ColumClickEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeader.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
deleted file mode 100644
index daf9367a9fc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-////
-//// System.Windows.Forms.ColumnHeader.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.ComponentModel;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Displays a single column header in a ListView control.
-// ///
-// /// ToDo note:
-// /// - no methods are implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ColumnHeader : Component, ICloneable
-// {
-// // private fields
-// string text;
-// HorizontalAlignment textAlign;
-//
-// /// --- constructor ---
-// [MonoTODO]
-// public ColumnHeader() : base () {
-// text = null;
-// textAlign = HorizontalAlignment.Left;
-// }
-//
-//
-//
-// // --- Properties ---
-// [MonoTODO]
-// public int Index {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public ListView ListView {
-// get { throw new NotImplementedException (); }
-// }
-//
-// public string Text {
-// get { return text; }
-// set { text=value; }
-// }
-//
-// public HorizontalAlignment TextAlign {
-// get { return textAlign; }
-// set { textAlign=value; }
-// }
-//
-// [MonoTODO]
-// public int Width {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-//
-//
-//
-// /// --- Methods ---
-// [MonoTODO]
-// public object Clone() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void Dispose(bool disposing) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeaderStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeaderStyle.cs
deleted file mode 100644
index c6992925a82..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ColumnHeaderStyle.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.ColumnHeaderStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ColumnHeaderStyle {
- Clickable = 2,
- Nonclickable = 1,
- None = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs
deleted file mode 100644
index 395bc72298e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBox.cs
+++ /dev/null
@@ -1,543 +0,0 @@
-////
-//// System.Windows.Forms.ComboBox.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.ComponentModel;
-//using System.Collections;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Represents a Windows combo box control.
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ComboBox : ListControl
-// {
-// // private fields
-// DrawMode drawMode;
-// ComboBoxStyle dropDownStyle;
-// bool droppedDown;
-// bool integralHeight;
-// bool sorted;
-//
-//
-// // --- Constructor ---
-// public ComboBox() : base() {
-// drawMode = DrawMode.Normal;
-// dropDownStyle = ComboBoxStyle.DropDown;
-// droppedDown = false;
-// integralHeight = true;
-// sorted = false;
-// }
-//
-//
-//
-//
-// // --- Properties ---
-// [MonoTODO]
-// public override Color BackColor {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override Image BackgroundImage {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// protected override CreateParams CreateParams {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// protected override Size DefaultSize {
-// get { throw new NotImplementedException (); }
-// }
-//
-// public DrawMode DrawMode {
-// get { return drawMode; }
-// set { drawMode=value; }
-// }
-//
-// public ComboBoxStyle DropDownStyle {
-// get { return dropDownStyle; }
-// set { dropDownStyle=value; }
-// }
-//
-// [MonoTODO]
-// public int DropDownWidth {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// public bool DroppedDown {
-// get { return droppedDown; }
-// set { droppedDown=value; }
-// }
-//
-// [MonoTODO]
-// public override bool Focused {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override Color ForeColor {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// public bool IntegralHeight {
-// get { return integralHeight; }
-// set { integralHeight=value; }
-// }
-//
-// [MonoTODO]
-// public int ItemHeight {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public ComboBox.ObjectCollection Items {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int MaxDropDownItems {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int MaxLength {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int PreferredHeight {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override int SelectedIndex {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public object SelectedItem {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public string SelectedText {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int SelectionLength {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int SelectionStart {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// public bool Sorted {
-// get { return sorted; }
-// set { sorted=value; }
-// }
-//
-// [MonoTODO]
-// public override string Text {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-//
-//
-//
-// /// --- Methods ---
-// /// internal .NET framework supporting methods, not stubbed out:
-// /// - protected virtual void OnSelectedItemChanged(EventArgs e);
-// /// - protected override void SetItemCore(int index,object value);
-// [MonoTODO]
-// protected virtual void AddItemsCore(object[] value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void BeginUpdate() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void Dispose(bool disposing) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void EndUpdate() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int FindString(string s) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int FindString(string s,int startIndex) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int FindStringExact(string s) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int FindStringExact(string s,int startIndex) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int GetItemHeight(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override bool IsInputKey(Keys keyData) {
-// throw new NotImplementedException ();
-// }
-//
-// /// [methods for events]
-// [MonoTODO]
-// protected override void OnBackColorChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnDataSourceChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnDisplayMemberChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnDrawItem(DrawItemEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnDropDown(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnDropDownStyleChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnFontChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnForeColorChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnHandleCreated(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnHandleDestroyed(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnKeyPress(KeyPressEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnMeasureItem(MeasureItemEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnParentBackColorChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnResize(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void OnSelectedIndexChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnSelectionChangeCommitted(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-// /// end of [methods for events]
-//
-//
-// [MonoTODO]
-// protected override void RefreshItem(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void Select(int start,int length) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void SelectAll() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void SetBoundsCore(int x,int y,int width,int height,BoundsSpecified specified) {
-// throw new NotImplementedException ();
-// }
-//
-// // for IList interface
-// [MonoTODO]
-// protected override void SetItemsCore(IList value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void WndProc(ref Message m) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-// /// --- Button events ---
-// /// commented out, cause it only supports the .NET Framework infrastructure
-// [MonoTODO]
-// public event DrawItemEventHandler DrawItem {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public event EventHandler DropDown {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public event EventHandler DropDownStyleChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public event MeasureItemEventHandler MeasureItem {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// /* only supports .NET framework
-// [MonoTODO]
-// public new event PaintEventHandler Paint;
-// */
-//
-// [MonoTODO]
-// public event EventHandler SelectedIndexChanged {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// [MonoTODO]
-// public event EventHandler SelectionChangeCommitted {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-//
-//
-//
-//
-// /// --- public class ComboBox.ChildAccessibleObject : AccessibleObject ---
-// /// the class is not stubbed, cause it's only used for .NET framework
-//
-//
-//
-//
-// /// sub-class: ComboBox.ObjectCollection
-// /// <summary>
-// /// Represents the collection of items in a ComboBox.
-// /// </summary>
-// [MonoTODO]
-// public class ObjectCollection : IList, ICollection, IEnumerable {
-//
-// /// --- ObjectCollection.constructor ---
-// [MonoTODO]
-// public ObjectCollection (ComboBox owner) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-// /// --- ObjectCollection Properties ---
-// [MonoTODO]
-// public int Count {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public bool IsReadOnly {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public int this[int index] {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// /// --- ICollection properties ---
-// bool IList.IsFixedSize {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-// object IList.this[int index]
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// [MonoTODO] set { throw new NotImplementedException (); }
-// }
-//
-// object ICollection.SyncRoot
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-// bool ICollection.IsSynchronized
-// {
-// [MonoTODO] get { throw new NotImplementedException (); }
-// }
-//
-// /// --- methods ---
-// /// --- ObjectCollection Methods ---
-// /// Note: IList methods are stubbed out, otherwise IList interface cannot be implemented
-// [MonoTODO]
-// public int Add(object item) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void AddRange(object[] items) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void Clear() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public bool Contains(object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void CopyTo(object[] dest,int arrayIndex) {
-// throw new NotImplementedException ();
-// }
-//
-// /// for ICollection:
-// [MonoTODO]
-// void ICollection.CopyTo(Array dest,int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public IEnumerator GetEnumerator() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public int IndexOf(object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void Insert(int index,object item) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void Remove(object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void RemoveAt(int index) {
-// throw new NotImplementedException ();
-// }
-// } // --- end of ComboBox.ObjectCollection ---
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBoxStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBoxStyle.cs
deleted file mode 100644
index 22d36738661..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ComboBoxStyle.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.ComboBoxStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ComboBoxStyle {
- DropDown = 1,
- DropDownList = 2,
- Simple = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CommonDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CommonDialog.cs
deleted file mode 100644
index a5181976912..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CommonDialog.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-////
-//// System.Windows.Forms.CommonDialog.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.ComponentModel;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Specifies the base class used for displaying dialog boxes on the screen.
-// ///
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public abstract class CommonDialog : Component
-// {
-// // private fields
-//
-// /// --- constructor ---
-// [MonoTODO]
-// public CommonDialog() : base () {
-// }
-//
-//
-//
-//
-// /// --- Methods ---
-// [MonoTODO]
-// protected virtual IntPtr HookProc(IntPtr hWnd,int msg,IntPtr wparam,IntPtr lparam) {
-// throw new NotImplementedException ();
-// }
-//
-// // event methods
-// [MonoTODO]
-// protected virtual void OnHelpRequest(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-// // end of event methods
-//
-// [MonoTODO]
-// protected virtual IntPtr OwnerWndProc(IntPtr hWnd,int msg,IntPtr wparam,IntPtr lparam) {
-// throw new NotImplementedException ();
-// }
-//
-// public abstract void Reset();
-//
-// protected abstract bool RunDialog(IntPtr hwndOwner);
-//
-// [MonoTODO]
-// public DialogResult ShowDialog() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public DialogResult ShowDialog(IWin32Window owner) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-//
-// /// events
-// [MonoTODO]
-// public event EventHandler HelpRequest {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventArgs.cs
deleted file mode 100644
index 7397f06efb3..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventArgs.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-////
-//// System.Windows.Forms.ColumnClickEventArgs.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides data for the ContentsResized event.
-// ///
-// /// ToDo note:
-// /// - no methods are implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ContentsResizedEventArgs : EventArgs
-// {
-// /// --- Constructor ---
-// [MonoTODO]
-// protected ContentsResizedEventArgs() : base() {
-// throw new NotImplementedException ();
-// }
-//
-//
-// /// --- Properties ---
-// [MonoTODO]
-// public Rectangle NewRectangle {
-// get { throw new NotImplementedException (); }
-// }
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventHandler.cs
deleted file mode 100644
index 541be06a112..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ContentsResizedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.ContentsResizedEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void ContentsResizedEventHandler(
- object sender,
- ContentsResizedEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ContextMenu.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ContextMenu.cs
deleted file mode 100644
index 20bb9d922cc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ContextMenu.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-////
-//// System.Windows.Forms.ContextMenu.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-////using System.ComponentModel;
-////using System.Collections;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Represents a Windows combo box control.
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ContextMenu : Menu
-// {
-// // private fields
-// RightToLeft rightToLeft;
-//
-// // --- Constructor ---
-// [MonoTODO]
-// public ContextMenu() : base(null) {
-// rightToLeft = RightToLeft.Inherit;
-// }
-//
-// [MonoTODO]
-// public ContextMenu(MenuItem[] menuItems) : base(menuItems) {
-// }
-//
-//
-//
-//
-// // --- Properties ---
-// public virtual RightToLeft RightToLeft {
-// get { return rightToLeft; }
-// set { rightToLeft=value; }
-// }
-//
-// [MonoTODO]
-// public Control SourceControl {
-// get { throw new NotImplementedException (); }
-// }
-//
-//
-//
-//
-// /// --- Methods ---
-// /// internal .NET framework supporting methods, not stubbed out:
-// /// - protected internal virtual void OnPopup(EventArgs e);
-// [MonoTODO]
-// public void Show(Control control,Point pos) {
-// throw new NotImplementedException ();
-// }
-//
-//
-//
-//
-// /// events
-// [MonoTODO]
-// public event EventHandler Popup {
-// add {
-// throw new NotImplementedException ();
-// }
-// remove {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlBindingsCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlBindingsCollection.cs
deleted file mode 100644
index 17f3e9779b1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlBindingsCollection.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-////
-//// System.Windows.Forms.ControlBindingsCollection.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System.Collections;
-//using System.ComponentModel;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Represents the collection of data bindings for a control.
-// ///
-// /// ToDo note:
-// /// - no methods are implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ControlBindingsCollection : BindingsCollection
-// {
-// #region Constructors
-// protected internal ControlBindingsCollection() : base () {
-// }
-// #endregion
-//
-//
-// #region Properties
-// [MonoTODO]
-// public Control Control {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public Binding this[string propertyName] {
-// get { throw new NotImplementedException (); }
-// }
-// #endregion
-//
-//
-//
-//
-// #region Methods
-// /// following methods were not stubbed out, because they only support .NET framework:
-// /// - protected override void AddCore(Binding dataBinding);
-// /// - protected override void ClearCore();
-// /// - protected override void RemoveCore(Binding dataBinding);
-// [MonoTODO]
-// public new void Add(Binding binding) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public Binding Add(string propertyName,object dataSource,string dataMember) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public new void Clear() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public new void Remove(Binding binding) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public new void RemoveAt(int index) {
-// throw new NotImplementedException ();
-// }
-// #endregion
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventArgs.cs
deleted file mode 100644
index 1afdbff8d81..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventArgs.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-////
-//// System.Windows.Forms.ControlEventArgs.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides data for the ControlAdded and ControlRemoved events.
-// /// ToDo note:
-// /// - no methods are implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class ControlEventArgs : EventArgs
-// {
-// #region Constructors
-// [MonoTODO]
-// public ControlEventArgs(Control control) {
-// throw new NotImplementedException ();
-// }
-// #endregion
-//
-//
-// #region Properties
-// [MonoTODO]
-// public Control Control {
-// get { throw new NotImplementedException (); }
-// }
-// #endregion
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventHandler.cs
deleted file mode 100644
index d42d35259c8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.ControlEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void ControlEventHandler (
- object sender,
- ControlEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs
deleted file mode 100644
index d8b20fa630c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlPaint.cs
+++ /dev/null
@@ -1,465 +0,0 @@
-////
-//// System.Windows.Forms.ControlPaint.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc 2002
-////
-//
-//
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides methods used to paint common Windows controls and their elements.
-// ///
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public sealed class ControlPaint
-// {
-// #region Properties
-// [MonoTODO]
-// public static Color ContrastControlDark
-// {
-// get { throw new NotImplementedException (); }
-// }
-// #endregion
-//
-//
-//
-// #region Methods
-// /// following methods were not stubbed out, because they only support .NET framework:
-// /// - public static IntPtr CreateHBitmap16Bit(Bitmap bitmap,Color background)
-// /// - public static IntPtr CreateHBitmapColorMask(Bitmap bitmap,IntPtr monochromeMask);
-// /// - public static IntPtr CreateHBitmapTransparencyMask(Bitmap bitmap);
-// [MonoTODO]
-// public static Color Dark(Color baseColor) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static Color Dark(Color baseColor,float percOfDarkDark) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static Color DarkDark(Color baseColor) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder(
-// Graphics graphics,
-// Rectangle bounds,
-// Color color,
-// ButtonBorderStyle style) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder(
-// Graphics graphics,
-// Rectangle bounds,
-// Color leftColor,
-// int leftWidth,
-// ButtonBorderStyle leftStyle,
-// Color topColor,
-// int topWidth,
-// ButtonBorderStyle topStyle,
-// Color rightColor,
-// int rightWidth,
-// ButtonBorderStyle rightStyle,
-// Color bottomColor,
-// int bottomWidth,
-// ButtonBorderStyle bottomStyle)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder3D(
-// Graphics graphics,
-// Rectangle rectangle)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder3D(
-// Graphics graphics,
-// Rectangle rectangle,
-// Border3DStyle style)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder3D(
-// Graphics graphics,
-// Rectangle rectangle,
-// Border3DStyle style,
-// Border3DSide sides)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder3D(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder3D(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// Border3DStyle style)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawBorder3D(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// Border3DStyle style,
-// Border3DSide sides)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawButton(
-// Graphics graphics,
-// Rectangle rectangle,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawButton(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawCaptionButton(
-// Graphics graphics,
-// Rectangle rectangle,
-// CaptionButton button,
-// ButtonState state) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawCaptionButton(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// CaptionButton button,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawCheckBox(
-// Graphics graphics,
-// Rectangle rectangle,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawCheckBox(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawComboButton(
-// Graphics graphics,
-// Rectangle rectangle,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawComboButton(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawContainerGrabHandle(Graphics graphics,Rectangle bounds) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawFocusRectangle(
-// Graphics graphics,
-// Rectangle rectangle)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawFocusRectangle(
-// Graphics graphics,
-// Rectangle rectangle,
-// Color foreColor,
-// Color backColor) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawGrabHandle(
-// Graphics graphics,
-// Rectangle rectangle,
-// bool primary,
-// bool enabled)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawGrid(
-// Graphics graphics,
-// Rectangle area,
-// Size pixelsBetweenDots,
-// Color backColor)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawImageDisabled(
-// Graphics graphics,
-// Image image,
-// int x,
-// int y,
-// Color background)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawLockedFrame(
-// Graphics graphics,
-// Rectangle rectangle,
-// bool primary)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawMenuGlyph(
-// Graphics graphics,
-// Rectangle rectangle,
-// MenuGlyph glyph)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawMenuGlyph(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// MenuGlyph glyph)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawMixedCheckBox(
-// Graphics graphics,
-// Rectangle rectangle,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawMixedCheckBox(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawRadioButton(
-// Graphics graphics,
-// Rectangle rectangle,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawRadioButton(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawReversibleFrame(
-// Rectangle rectangle,
-// Color backColor,
-// FrameStyle style)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawReversibleLine(
-// Point start,
-// Point end,
-// Color backColor)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawScrollButton(
-// Graphics graphics,
-// Rectangle rectangle,
-// ScrollButton button,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawScrollButton(
-// Graphics graphics,
-// int x,
-// int y,
-// int width,
-// int height,
-// ScrollButton button,
-// ButtonState state)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawSelectionFrame(
-// Graphics graphics,
-// bool active,
-// Rectangle outsideRect,
-// Rectangle insideRect,
-// Color backColor)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawSizeGrip(
-// Graphics graphics,
-// Color backColor,
-// Rectangle bounds)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawSizeGrip(
-// Graphics graphics,
-// Color backColor,
-// int x,
-// int y,
-// int width,
-// int height)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DrawStringDisabled(
-// Graphics graphics,
-// string s,
-// Font font,
-// Color color,
-// RectangleF layoutRectangle,
-// StringFormat format)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void FillReversibleRectangle(
-// Rectangle rectangle,
-// Color backColor)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static Color Light(Color baseColor) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static Color Light(Color baseColor,float percOfLightLight) {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static Color LightLight(Color baseColor) {
-// throw new NotImplementedException ();
-// }
-// #endregion
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlStyles.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlStyles.cs
deleted file mode 100644
index bddb6c49752..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ControlStyles.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Windows.Forms.ControlStyles.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ControlStyles {
- AllPaintingInWmPaint = 8192,
- CacheText = 16384,
- ContainerControl = 1,
- DoubleBuffer = 65536,
- EnableNotifyMessage = 32768,
- FixedHeight = 64,
- FixedWidth = 32,
- Opaque = 4,
- ResizeRedraw = 16,
- Selectable = 512,
- StandardClick = 256,
- StandardDoubleClick = 4096,
- SupportsTransparentBackColor = 2045,
- UserMouse = 1024,
- UserPaint = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventArgs.cs
deleted file mode 100644
index 9b3eed0dc22..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventArgs.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-////
-//// System.Windows.Forms.ConvertEventArgs.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides data for the Format and Parse events.
-// /// ToDo note:
-// /// - no methods are implemented
-// /// </summary>
-//
-// public class ConvertEventArgs : EventArgs
-// {
-// #region Fields
-// Type desiredType;
-// object value;
-// #endregion
-//
-//
-//
-// #region Constructors
-// public ConvertEventArgs(object value,Type desiredType) {
-// this.desiredType = desiredType;
-// this.value = value;
-// }
-// #endregion
-//
-//
-//
-// #region Properties
-// public Type DesiredType {
-// get { return this.desiredType; }
-// }
-//
-// public object Value {
-// get { return this.value; }
-// set { this.value=value; }
-// }
-// #endregion
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventHandler.cs
deleted file mode 100644
index c436d924cb1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ConvertEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.ConvertEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void ConvertEventHandler (
- object sender,
- ConvertEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CreateParams.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CreateParams.cs
deleted file mode 100644
index 796378c1353..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CreateParams.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-////
-//// System.Windows.Forms.CreateParams.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System.Collections;
-//using System.ComponentModel;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Encapsulates the information needed when creating a control.
-// ///
-// /// ToDo note:
-// /// - nothing is imlemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class CreateParams
-// {
-// #region Fields
-// string caption;
-// string className;
-// int classStyle;
-// int exStyle;
-// int height;
-// object param;
-// IntPtr parent;
-// int style;
-// int width;
-// int x;
-// int y;
-// #endregion
-//
-//
-//
-//
-// #region Constructors
-// public CreateParams() {
-// caption = null;
-// className = null;
-// }
-// #endregion
-//
-//
-//
-//
-// #region Properties
-// public string Caption {
-// get { return caption; }
-// set { caption=value; }
-// }
-//
-// public string ClassName {
-// get { return className; }
-// set { className=value; }
-// }
-//
-// public int ClassStyle {
-// get { return classStyle; }
-// set { classStyle=value; }
-// }
-//
-// public int ExStyle {
-// get { return exStyle; }
-// set { exStyle=value; }
-// }
-//
-// public int Height {
-// get { return height; }
-// set { height=value; }
-// }
-//
-// public object Param {
-// get { return param; }
-// set { param=value; }
-// }
-//
-// public IntPtr Parent {
-// get { return parent; }
-// set { parent=value; }
-// }
-//
-// public int Style {
-// get { return style; }
-// set { style=value; }
-// }
-//
-// public int Width {
-// get { return width; }
-// set { width=value; }
-// }
-//
-// public int X {
-// get { return x; }
-// set { x=value; }
-// }
-//
-// public int Y {
-// get { return y; }
-// set { y=value; }
-// }
-// #endregion
-//
-//
-//
-//
-// #region Methods
-// [MonoTODO]
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-// #endregion
-//
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CurrencyManager.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CurrencyManager.cs
deleted file mode 100644
index b87d7ab3180..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CurrencyManager.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-////
-//// System.Windows.Forms.CurrencyManager.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System.ComponentModel;
-//using System.Collections;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Manages a list of Binding objects.
-// /// </summary>
-// [MonoTODO]
-// public class CurrencyManager : BindingManagerBase
-// {
-// #region Fields
-// /* uncomment if needed
-// protected Type finalType;
-// protected int listposition;
-// */
-// #endregion
-//
-//
-//
-// #region Properties
-// [MonoTODO]
-// public override int Count {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override object Current {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public IList List {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public override int Position
-// {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-// #endregion
-//
-//
-//
-//
-// #region Methods
-// [MonoTODO]
-// public override void AddNew() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override void CancelCurrentEdit() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected void CheckEmpty() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override void EndCurrentEdit() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override PropertyDescriptorCollection GetItemProperties() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected /*internal*/ override string GetListName(ArrayList listAccessors) {
-// throw new NotImplementedException ();
-// }
-//
-// /// <methods for events>
-// [MonoTODO]
-// protected /*internal*/ override void OnCurrentChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnItemChanged(ItemChangedEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// /* this method only supports .NET framework
-// [MonoTODO]
-// protected virtual void OnPositionChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }*/
-// /// </methods for events>
-//
-// [MonoTODO]
-// public void Refresh() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override void RemoveAt(int index) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override void ResumeBinding() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override void SuspendBinding() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void UpdateIsBinding() {
-// throw new NotImplementedException ();
-// }
-// #endregion
-//
-//
-//
-// #region Events
-// [MonoTODO]
-// public event ItemChangedEventHandler ItemChanged {
-// add { throw new NotImplementedException (); }
-// remove { throw new NotImplementedException (); }
-// }
-// #endregion
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs
deleted file mode 100644
index 94293dbc7f5..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursor.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-////
-//// System.Windows.Forms.Cursor.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.ComponentModel;
-//using System.Runtime.Serialization;
-//using System.IO;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Represents the image used to paint the mouse pointer.
-// ///
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// [Serializable]
-// public sealed class Cursor : IDisposable, ISerializable
-// {
-// #region Fields
-// #endregion
-//
-//
-//
-// #region Constructors
-// [MonoTODO]
-// public Cursor(IntPtr handle) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public Cursor(Stream stream) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public Cursor(string fileName) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public Cursor(Type type,string resource) {
-// throw new NotImplementedException ();
-// }
-// #endregion
-//
-//
-//
-//
-// #region Properties
-// [MonoTODO]
-// public static Rectangle Clip {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor Current {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public IntPtr Handle {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Point Position {
-// get { throw new NotImplementedException (); }
-// set { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public Size Size {
-// get { throw new NotImplementedException (); }
-// }
-// #endregion
-//
-//
-//
-//
-// #region Methods
-// [MonoTODO]
-// public IntPtr CopyHandle() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void Dispose() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void Draw(Graphics g,Rectangle targetRect) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void DrawStretched(Graphics g,Rectangle targetRect) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override bool Equals(object obj) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// ~Cursor() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override int GetHashCode() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void Hide() {
-// throw new NotImplementedException ();
-// }
-//
-// /// ISerializable.GetObjectData only supports .NET framework:
-// [MonoTODO]
-// void ISerializable.GetObjectData(SerializationInfo si,StreamingContext context) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void Show() {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-// #endregion
-//
-//
-//
-// #region Operators
-// [MonoTODO]
-// public static bool operator ==(Cursor left, Cursor right) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static bool operator !=(Cursor left, Cursor right) {
-// throw new NotImplementedException ();
-// }
-// #endregion
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/CursorConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/CursorConverter.cs
deleted file mode 100644
index 40947964014..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/CursorConverter.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-////
-//// System.Windows.Forms.CursorConverter.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.ComponentModel;
-//using System.Globalization;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides a type converter to convert Cursor objects to and from various other representations.
-// ///
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public class CursorConverter : TypeConverter
-// {
-//
-// #region Constructors
-// [MonoTODO]
-// public CursorConverter() {
-// throw new NotImplementedException ();
-// }
-// #endregion
-//
-//
-//
-// #region Methods
-// [MonoTODO]
-// public override bool CanConvertFrom(ITypeDescriptorContext context,Type sourceType) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override bool CanConvertTo(ITypeDescriptorContext context,Type destinationType) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override object ConvertFrom(ITypeDescriptorContext context,CultureInfo culture,object value) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override object ConvertTo(ITypeDescriptorContext context,CultureInfo culture,object value,Type destinationType) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public override bool GetStandardValuesSupported(ITypeDescriptorContext context) {
-// throw new NotImplementedException ();
-// }
-// #endregion
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursors.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursors.cs
deleted file mode 100644
index bf44f4f06eb..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Cursors.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-////
-//// System.Windows.Forms.Cursors.cs
-////
-//// Author:
-//// stubbed out by Jaak Simm (jaaksimm@firm.ee)
-////
-//// (C) Ximian, Inc., 2002
-////
-//
-//using System.ComponentModel;
-//using System.Runtime.Serialization;
-//using System.IO;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-// /// <summary>
-// /// Provides a collection of Cursor objects for use by a Windows Forms application.
-// ///
-// /// ToDo note:
-// /// - nothing is implemented
-// /// </summary>
-//
-// [MonoTODO]
-// public sealed class Cursors
-// {
-// #region Properties
-// [MonoTODO]
-// public static Cursor AppStarting {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor Arrow {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor Cross {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor Default {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor Hand {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor Help {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor HSplit {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor IBeam {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor No {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor NoMove2D {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor NoMoveHoriz {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor NoMoveVert {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanEast {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanNE {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanNorth {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanNW {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanSE {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanSouth {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanSW {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor PanWest {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor SizeAll {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor SizeNESW {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor SizeNS {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor SizeNWSE {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor SizeWE {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor UpArrow {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor VSplit {
-// get { throw new NotImplementedException (); }
-// }
-//
-// [MonoTODO]
-// public static Cursor WaitCursor {
-// get { throw new NotImplementedException (); }
-// }
-// #endregion
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridCell.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridCell.cs
deleted file mode 100644
index c9f536be2a6..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridCell.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// System.Windows.Forms.DataGridCell.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- public struct DataGridCell {
-
- private int rownumber;
- private int columnnumber;
-
- // -----------------------
- // Public Constructor
- // -----------------------
-
- /// <summary>
- ///
- /// </summary>
- ///
- /// <remarks>
- ///
- /// </remarks>
-
- public DataGridCell (int r, int c){
- rownumber = r;
- columnnumber = c;
- }
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two DataGridCell objects. The return value is
- /// based on the equivalence of the RowNumber and ColumnNumber properties of the two objects.
- /// </remarks>
-
- public static bool operator == (DataGridCell dgc_a,
- DataGridCell dgc_b)
- {
- return ((dgc_a.rownumber == dgc_b.rownumber) &&
- (dgc_a.columnnumber == dgc_b.columnnumber));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two DataGridCell objects. The return value is
- /// based on the equivalence of the RowNumber and ColumnNumber properties of the two objects.
- /// </remarks>
- public static bool operator != (DataGridCell dgc_a,
- DataGridCell dgc_b) {
- return ((dgc_a.rownumber != dgc_b.rownumber) ||
- (dgc_a.columnnumber != dgc_b.columnnumber));
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
-
- public int RowNumber {
- get{
- return rownumber;
- }
- set{
- rownumber = value;
- }
- }
-
- public int ColumeNumber {
- get{
- return columnnumber;
- }
- set{
- columnnumber = value;
- }
- }
-
-
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this DataGridCell and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is DataGridCell))
- return false;
-
- return (this == (DataGridCell) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return (int)( rownumber ^ columnnumber);
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the DataGridCell as a string.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", rownumber, columnnumber );
- }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridLineStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridLineStyle.cs
deleted file mode 100644
index ba799c5e15f..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridLineStyle.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.DataGridLineStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum DataGridLineStyle {
- None = 0,
- Solid = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridParentRowsLabelStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridParentRowsLabelStyle.cs
deleted file mode 100644
index b434b6ca10e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridParentRowsLabelStyle.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Windows.Forms.DataGridParentRowsLabelStyle.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies how the parent row labels of a DataGrid control are displayed.
- /// </summary>
- [Serializable]
- public enum DataGridParentRowsLabelStyle
- {
- //Values were verified with enumcheck.
- None = 0,
- TableName = 1,
- ColumnName = 2,
- Both = 3,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DateRangeEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DateRangeEventHandler.cs
deleted file mode 100644
index b4b7e1a1ad0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DateRangeEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.DateRangeEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void DateRangeEventHandler (
- object sender,
- DateRangeEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DateTimePickerFormat.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DateTimePickerFormat.cs
deleted file mode 100644
index da1add8340d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DateTimePickerFormat.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-monostyle -f file.cs -l <true|false> > output.cs
-
- -f || /-f || --file file.cs The csharp source file to parse.
-
- -l || /-l || --line <true|false> Specifies wether to use line spacing.
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DialogResult.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DialogResult.cs
deleted file mode 100644
index c6f6c777edd..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DialogResult.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Windows.Forms.DialogResult.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Specifies identifiers to indicate the return value of a dialog box.
- /// </summary>
- [Serializable]
- [ComVisible(true)]
- public enum DialogResult
- {
- //Values were verified with enumcheck.
- None = 0,
- OK = 1,
- Cancel = 2,
- Abort = 3,
- Retry = 4,
- Ignore = 5,
- Yes = 6,
- No = 7,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DockStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DockStyle.cs
deleted file mode 100644
index 20faea21955..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DockStyle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Windows.Forms.DockStyle.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the position and manner in which a control is docked.
- /// </summary>
- [Serializable]
- public enum DockStyle
- {
- //Values were verified with enumcheck.
- None = 0,
- Top = 1,
- Bottom = 2,
- left = 3,
- Right = 4,
- Fill = 5,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DragAction.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DragAction.cs
deleted file mode 100644
index b7eb487cd8c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DragAction.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Windows.Forms.DragAction.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies how and if a drag-and-drop operation should continue.
- /// </summary>
- [Serializable]
- [ComVisible(true)]
- public enum DragAction
- {
- //Values were verified with enumcheck.
- Continue = 0,
- Drop = 1,
- Cancel = 2,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DragDropEffects.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DragDropEffects.cs
deleted file mode 100644
index 601389e14c9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DragDropEffects.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Windows.Forms.DragDropEffects.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the effects of a drag-and-drop operation.
- /// This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DragDropEffects
- {
- None = 0,
- Copy = 1,
- Move = 2,
- Link = 4,
- Scroll = -2147483648,
- All = -2147483645,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DragEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DragEventHandler.cs
deleted file mode 100644
index 99c0afdf885..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DragEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.DragEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void DragEventHandler (
- object sender,
- DragEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemEventHandler.cs
deleted file mode 100644
index e0903e7688c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.DrawItemEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void DrawItemEventHandler (
- object sender,
- DrawItemEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemState.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemState.cs
deleted file mode 100644
index 35807740c68..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawItemState.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Windows.Forms.DrawItemState.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the state of an item that is being drawn.
- /// this enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
- /// </summary>
- [Flags]
- [Serializable]
- public enum DrawItemState
- {
- None = 0,
- Selected = 1,
- Grayed = 2,
- Disabled = 4,
- Checked = 8,
- Focus = 16,
- Default = 32,
- HotLight = 64,
- Inactive = 128,
- NoAccelerator = 256,
- NoFocusRect = 512,
- ComboBoxEdit = 1024,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawMode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawMode.cs
deleted file mode 100644
index e84004e18c3..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DrawMode.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Windows.Forms.DrawMode.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies how the elements of a control are drawn.
- /// </summary>
- [Serializable]
- public enum DrawMode
- {
- //Values were verified with enumcheck.
- Normal = 0,
- OwnerDrawFixed = 1,
- OwnerDrawVariable = 2,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorBlinkStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorBlinkStyle.cs
deleted file mode 100644
index 410357e367b..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorBlinkStyle.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Windows.Forms.ErrorBlinkStyle.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies constants indicating when the error icon, supplied by an ErrorProvider,
- /// should blink to alert the user that an error has occurred.
- /// </summary>
- [Serializable]
- public enum ErrorBlinkStyle
- {
- //Values were verified with enumcheck.
- BlinkIfDifferentError = 0,
- AlwaysBlink = 1,
- NeverBlink = 2,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorIconAlignment.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorIconAlignment.cs
deleted file mode 100644
index 811d00ec26c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorIconAlignment.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Windows.Forms.ErrorIconAlignment.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies constants indicating the locations that an error icon can appear
- /// in relation to the control with an error.
- /// </summary>
- [Serializable]
- public enum ErrorIconAlignment
- {
- //Values were verified with enumcheck.
- TopLeft = 0,
- TopRight = 1,
- MiddleLeft = 2,
- MiddleRight = 3,
- BottomLeft = 4,
- BottomRight = 5,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorProvider.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorProvider.cs
deleted file mode 100644
index c00efd52c24..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ErrorProvider.cs
+++ /dev/null
@@ -1,245 +0,0 @@
-////
-//// System.Windows.Forms.ErrorProvider
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class ErrorProvider : Component, IExtenderProvider {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public ErrorProvider()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// ISite Site {
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int BlinkRate {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ErrorBlinkStyle BlinkStyle {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ContainerControl ContainerControl {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string DataMember {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public object DataSource {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Icon Icon {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public void BindToDataAndErrors(object newDataSource, string newDataMember)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool CanExtend(object extendee)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public string GetError(Control control)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public ErrorIconAlignment GetIconAlignment(Control control)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public int GetIconPadding(Control control)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetError(Control control,string value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetIconAlignment(Control control, ErrorIconAlignment value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetIconPadding(Control control, int padding)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void UpdateBinding()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandlerList Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected virtual void Dispose(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~ErrorProvider()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FeatureSupport.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FeatureSupport.cs
deleted file mode 100644
index 9be991fe879..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FeatureSupport.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Windows.Forms.FeatureSupport.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public abstract class FeatureSupport : IFeatureSupport {
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public abstract Version GetVersionPresent(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool IsPresent(object o)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Constructors
- //
- //[MonoTODO]
- //protected FeatureSupport()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FileDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FileDialog.cs
deleted file mode 100644
index 6fb4f2e3732..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FileDialog.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-//
-// System.Windows.Forms.FileDialog.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public abstract class FileDialog : CommonDialog {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool AddExtension {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual bool CheckFileExists {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool CheckPathExists {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string DefaultExt {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool DereferenceLinks {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string FileName {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string[] FileNames {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Filter {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int FilterIndex {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string InitialDirectory {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool RestoreDirectory {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowHelp {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Title {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ValidateNames {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void Reset()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public DialogResult ShowDialog()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public DialogResult ShowDialog(IWin32Window)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event CancelEventHandler FileOk {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override IntPtr HookProc( IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam )
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void OnFileOk( CancelEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool RunDialog( IntPtr hWndOwner)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FlatStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FlatStyle.cs
deleted file mode 100644
index 77cdfc02cd3..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FlatStyle.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Windows.Forms.FlatStyle.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the appearance of a control.
- /// </summary>
- [Serializable]
- public enum FlatStyle
- {
- //Values were verified with enumcheck.
- Flat = 0,
- Popup = 1,
- Standard = 2,
- System = 3,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FontDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FontDialog.cs
deleted file mode 100644
index 18a09e18d54..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FontDialog.cs
+++ /dev/null
@@ -1,224 +0,0 @@
-//
-// System.Windows.Forms.FontDialog.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class FontDialog : CommonDialog {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public FontDialog()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool AllowScriptChange {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AllowSimululations {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AllowVectorForms {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AllowVerticalForms {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color Color {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool FixedPitchOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Font Font {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool FontMustExist {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int MaxSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int MinSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ScriptsOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowApply {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowEffects {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowHelp {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void Reset()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public DialogResult ShowDialog()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler Apply
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override IntPtr HookProc( IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam )
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool RunDialog(IntPtr hWndOwner)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.ControlCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.ControlCollection.cs
deleted file mode 100644
index d19da506642..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Form.ControlCollection.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Windows.Forms.Form.ControlCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class Form.ControlCollection : Control.ControlCollection {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public Form.ControlCollection(Form owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public override void Add(Control value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int GetChildIndex(Control c)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void Remove(Control value)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FormBorderStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FormBorderStyle.cs
deleted file mode 100644
index 26842881dc7..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FormBorderStyle.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Windows.Forms.FormBorderStyle.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the border styles for a form.
- /// </summary>
- [Serializable]
- [ComVisible(true)]
- public enum FormBorderStyle
- {
- //Values were verified with enumcheck.
- None = 0,
- FixedSingle = 1,
- Fixed3D = 2,
- FixedDialog = 3,
- Sizable = 4,
- FixedToolWindows = 5,
- SizableToolWindow = 6
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FormStartPosition.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FormStartPosition.cs
deleted file mode 100644
index 17bd6084835..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FormStartPosition.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Windows.Forms.FormStartPosition.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the initial position of a form.
- /// </summary>
- [Serializable]
- [ComVisible(true)]
- public enum FormStartPosition
- {
- //Values were verified with enumcheck.
- Manual = 0,
- CenterScreen = 1,
- WindowsDefaultLocation = 2,
- WindowsDefaultBounds = 3,
- CenterParent = 4,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FormWindowState.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FormWindowState.cs
deleted file mode 100644
index 3ec6c3212f2..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FormWindowState.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Windows.Forms.FormWindowState.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies how a form window is displayed.
- /// </summary>
- [Serializable]
- [ComVisible(true)]
- public enum FormWindowState
- {
- //Values were verified with enumcheck.
- Normal = 0,
- Maximized = 1,
- Minimized = 2,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/FrameStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/FrameStyle.cs
deleted file mode 100644
index d213ce87a50..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/FrameStyle.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Windows.Forms.FrameStyle.cs
-//
-// Author:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms
-{
-
- /// <summary>
- /// Specifies the frame style of the selected control.
- /// </summary>
- [Serializable]
- public enum FrameStyle
- {
- //Values were verified with enumcheck.
- Dashed = 0,
- Thick = 1,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Getopt.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Getopt.cs
deleted file mode 100644
index 422d2e9a2be..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Getopt.cs
+++ /dev/null
@@ -1,1093 +0,0 @@
-//
-// System.Windows.Forms.Getopt.cs
-//
-// Author:
-// stubbed out by #!/usr/bin/perl -w
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms
-{
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- use Getopt::Long;
- {
- [MonoTODO]
- use strict;
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- #################################################################
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Initialization #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #################################################################
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Command-line options.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- my $o_comments = 0; # Defaults to 'false'.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- my $o_verbose = 0; # Defaults to 'flase'.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- my $o_namespace ='';
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- my $o_exception = 1;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- my $o_shortcuts = 1;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- GetOptions ( 'comments!' => \$o_comments,
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  'v|verbose' => \$o_verbose,
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  'n|namespace=s' => \$o_namespace,
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  'e|exception!' => \$o_exception,
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  's|shortcuts' => \$o_shortcuts );
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- our @lines;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- our %config;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- for my $file (@ARGV) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  @lines = ();
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  next unless (prepare_file($file));
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  obtain_configuration();
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  "<$config>\n";
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  open_output_stream();
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  print_header();
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  parse_markup()
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- }
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- #################################################################
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # F U N C T I O N S #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #################################################################
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Run through the file reading off the '#' variables and the '\'
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- sub prepare_file {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my $file = shift;
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  # Shortcuts -- Unlike variables, these are first replaced and then processed
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # like all other text. e.g. these are sensitive to '='
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my %shortcuts = (
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  ctor => "//\n// --- Constructor\n//",
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  pub_methods => "//\n// --- Public Methods\n//",
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  pub_properties => "//\n// --- Public Properties\n//",
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  pub_events => "//\n// --- Public Events\n//",
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  pro_methods => "//\n// --- Protected Methods\n//",
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  pro_properties => "//\n// --- Protected Properties\n//",
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  dan => 'Daniel Carrera (dcarrera@math.toronto.edu)'
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  );
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  unless(open(INPUT, "<$file")) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  warn "Could not oppen $file. Skipping.\n";
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  return 0;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
-  # First-run processing through the file:
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # - Replace '#' shortcuts.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # - Catenate spaces to one space.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # - Wrap lines terminating in #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my $all_lines = '';
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  while (my $line = <INPUT>) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $line =~ s/[ \t]+/ /g; # catenate spaces to one space.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $line =~ s/#(\w+)/$shortcuts/g if ($o_shortcuts);
- {
- }
-
- [MonoTODO]
-  if ( $line =~ /\\$/) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  chomp($line); # Eliminate new-line character.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  chop($line); # Eliminate }
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $all_lines .= $line;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  @lines = split(/\n/, $all_lines);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  close(INPUT);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  return 1;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- }
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Obtain Configuration
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- sub obtain_configuration {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my @path;
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  until( $config
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- remove { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  until( $config
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
-  # The last entry before ':' is the class name.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $config; # Start with the class definition.
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  $config=~ s/\s*:.*//; # Chop everything after :
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  ($config=~ m/(\S+)$/; # Get the last word.
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
-  unless ($o_namespace) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  if ($^O eq 'linux')
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  elsif ($^O eq 'MSWin32')
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  else
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- remove { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
-  chomp($o_namespace = $path[-1]);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- }
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Open OUTPUT stream.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- sub open_output_stream {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  if ($o_verbose) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  open(OUT,"| tee $config.cs") or warn "Could not open pipe to 'tee'\n";
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  select OUT;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $| = 1; # this sets output to the last selected handle to be unbuffered
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  } else {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  if ( open(OUT,">$config.cs") ) {
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  select OUT
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  } else {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  warn "WARNING: Could not open $config.cs for writing\n".
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  " sending output to STDOUT\n";
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- }
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Print the header.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- sub print_header {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  print <<EOH
- {
- throw new NotImplementedException ();
- }
- //
- // $o_namespace.$config{class}
- //
- // Author:
- // stubbed out by $config{author}
- //
- // (C) 2002 Ximian, Inc
- //
-
- [MonoTODO]
- namespace $o_namespace
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- {
- {
- throw new NotImplementedException ();
- }
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- [MonoTODO]
-  $config
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- EOH
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- ;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- }
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Parse the markup and take appropriate action.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #####
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- sub parse_markup {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  ####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # Variables -- Shortcuts for common commands. These are not affected by '='.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # They must be on a line of their own.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  ####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my %variables = (
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  equals => "public virtual bool Equals(object o);\n".
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  "public static bool Equals(object o1, object o2);\n",
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  ctor => "public $config()\n"
- {
- set { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  );
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  # Print the properties, classes, etc.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my $append='';
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  foreach my $line (@lines) {
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  unless ($line =~ /\S/) # skip blank lines.
- {
- remove { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  if ($line =~ m[^\s*//]) # C# comments.
- {
- remove { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
-  #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # Prepend command:
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # '=public void' causes 'public void' to prepend the following code.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  if ($line =~ m[^=]) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $append = ( ($line =~ m[^=(.+)]) ? "$1 " : '');
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  next;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # Extra variables.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # $var is replaced by the corresponding code ('=' option not applicable).
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  if ($line =~ m[^\$(\S+)]) {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  die "Variable $1 not recognized\n" unless ($variables);
- {
- }
- [MonoTODO]
-  my @lines = split(/\n/, $variables);
- {
- }
- [MonoTODO]
-  for my $line (@lines)
- {
- get { throw new NotImplementedException (); }
- add { throw new NotImplementedException (); }
- remove { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  next;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  # If we get this far than we have real code.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  generate_code( append => $append, line => $line);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  }
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  print "\t}\n}\n";
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- }
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- ####
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- # Parse the actual code.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- #
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- ####
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- sub generate_code {
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my %hash = @_;
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  my $append = $hash;
- {
- add { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  my $line = $hash;
- {
- }
- [MonoTODO]
-  my $throw = "throw new NotImplementedException ();";
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  my $contents = '';
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  # Contains , i.e. property or event.
- {
- }
- [MonoTODO]
-  if ( $line =~ s/
- {
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  else # \0 is a non-priting character.
- {
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
-  my $get = "get ";
- {
- remove { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  my $set = "set ";
- {
- remove { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  my $add = "add ";
- {
- remove { throw new NotImplementedException (); }
- }
- [MonoTODO]
-  my $remove = "remove ";
- {
- remove { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
-  my $c = ($o_comments? "//" : '');
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  # \010 (octal 10) is the backspace character.
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  print <<EOH
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $c \010[MonoTODO]
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $c \010$append$line
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  $c \010{
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- EOH
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- ;
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
-  print "\t\t$c\t$get\n" if ($contents =~ /g/i);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  print "\t\t$c\t$set\n" if ($contents =~ /s/i);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  print "\t\t$c\t$add\n" if ($contents =~ /a/i);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  print "\t\t$c\t$remove\n" if ($contents =~ /r/i);
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
-  print "\t\t$c \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventArgs.cs
deleted file mode 100644
index c91f649fdb7..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventArgs.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Windows.Forms.GiveFeedbackEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class GiveFeedbackEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public GiveFeedbackEventArgs( DragDropEffects effect, bool useDefaultCursors )
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public DragDropEffects effect Effect {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool UseDefaultCursors {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventHandler.cs
deleted file mode 100644
index 9131bcc3f86..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GiveFeedbackEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.GiveFeedbackEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void GiveFeedbackEventHandler (
- object sender,
- GiveFeedbackEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs
deleted file mode 100644
index 7a32ae20b6d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridColumnStylesCollection.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// System.Windows.Forms.GridColumnStylesCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class GridColumnStylesCollection : BaseCollection, IList {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public DataGridColumnStyle Item this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual int Add(DataGridColumnStyle column)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void AddRange(DataGridColumnStyle[] columns[])
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Contains()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(DataGridColumnStyle element)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(DataGridColumnStyle column)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResetPropertyDescriptors()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event CollectionChangeEventHandler CollectionChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override ArrayList List {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void OnCollectionChanged(CollectionChangeEventArgs cevent)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItem.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItem.cs
deleted file mode 100644
index 9acce5a3c78..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItem.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Windows.Forms.GridItem.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public abstract class GridItem {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool Expandable {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Expanded {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public abstract GridItemCollection GridItems {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public abstract GridItemType GridItemType {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public abstract string Label {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public abstract GridItem Parent {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public abstract PropertyDescriptor PropertyDescriptor {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public abstract object Value {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Constructor
- //
- //[MonoTODO]
- //protected GridItem()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemCollection.cs
deleted file mode 100644
index 2f4b99a5763..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemCollection.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Windows.Forms.GridItemCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public abstract class GridItemCollection : ICollection, IEnumerable {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public GridItem this[string str] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemType.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemType.cs
deleted file mode 100644
index 3946e0d9161..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridItemType.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.GridItemType.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum GridItemType {
- ArrayValue = 2,
- Category = 1,
- Property = 0,
- Root = 3
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs
deleted file mode 100644
index 9a79deed1ed..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GridTableStylesCollection.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// System.Windows.Forms.GridTableStylesCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class GridTableStylesCollection : BaseCollection, IList {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public DataGridTableStyle this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public DataGridTableStyle this[string s] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual int Add(DataGridTableStyle table)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void AddRange(DataGridTableStyle[] tables)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(DataGridTableStyle table)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(DataGridTableStyle table)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event CollectionChangeEvnentHandler CollectionChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override ArrayList List {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected void OnCollectionChanged(CollectionChangeEvnentArgs cevent)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs
deleted file mode 100644
index 485a5981404..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/GroupBox.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// System.Windows.Forms.GroupBox.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class GroupBox : Control {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public GroupBox()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override bool AllowDrop {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Rectangle DisplayRectangle {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public FlatStyle FlatStyle {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate d)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate d, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate d)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate d, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int b1, int b2, int b3, int b4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int b1, int b2, int b3, int b4 BoundsSpecified bounds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void Dispose(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnFontChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnPaint(PaintEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool ProcessMnemonic(char charCode)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override virtual void Select(bool b1, bool b2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void UpdateBounds(int b1, int b2, int b3, int b4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void UpdateBounds(int b1, int b2, int b3, int b4, int b5, int b6)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/HScrollBar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/HScrollBar.cs
deleted file mode 100644
index ef5b02593df..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/HScrollBar.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// System.Windows.Forms.HScrollBar.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class HScrollBar : ScrollBar {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public HScrollBar()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public override ISite Site {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int b1, int b2, int b3, int b4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int b1, int b2, int b3, int b4, BoundsSpecified bnds)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override ImeMode DefaultMode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected virtual void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int b1, int b2, int b3, int b4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int b1, int b2, int b3, int b4, int b5, int b6)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Help.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Help.cs
deleted file mode 100644
index c8295217c8e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Help.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Windows.Forms.Help.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class Help {
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static void ShowHelp(Control c, string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static void ShowHelp(Control c, string s, HelpNavigator nav)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static void ShowHelpIndex(Control parent, string url)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventArgs.cs
deleted file mode 100644
index c666d02b407..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventArgs.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Windows.Forms.HelpEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class HelpEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public HelpEventArgs(Point mousePos)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool Handled {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Point MousePos {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventHandler.cs
deleted file mode 100644
index fa9583a42d9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.HelpEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void HelpEventHandler (
- object sender,
- HelpEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpNavigator.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpNavigator.cs
deleted file mode 100644
index fb6d1041616..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpNavigator.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.HelpNavigator.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum HelpNavigator {
- AssociateIndex = -2147483643,
- Find = -2147483644,
- Index = -2147483645,
- KeywordIndex = -2147483642,
- TableOfContents = -2147483646,
- Topic = -2147483647
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpProvider.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpProvider.cs
deleted file mode 100644
index 758be3735e0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/HelpProvider.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// System.Windows.Forms.HelpProvider.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class HelpProvider : Component, IExtenderProvider {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public HelpProvider()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public virtual string HelpNamespace {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string GetHelpKeyword(Control ctl)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual HelpNavigator GetHelpNavigator(Control ctl)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string GetHelpString(Control ctl)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetShowHelp(Control ctl)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void SetHelpKeyword(Control ctl, string keyword)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void SetHelpNavigator(Control ctl, HelpNavigator nav)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void SetHelpString(Control ctl, string helpString)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void SetShowHelp(Control ctl, bool val)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler Disposed {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected virtual void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/HorizontalAlignment.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/HorizontalAlignment.cs
deleted file mode 100644
index 0430f0ae8bc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/HorizontalAlignment.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.HorizontalAlignment.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum HorizontalAlignment {
- Center = 2,
- Left = 0,
- Right = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IButtonControl.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IButtonControl.cs
deleted file mode 100644
index 874d98543c0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IButtonControl.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Windows.Forms.IButtonControl.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
-
- interface IButtonControl {
- void NotifyDefault(bool value);
- void PerformClick();
- DialogResult DialogResult {get; set;}
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ICommandExecutor.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ICommandExecutor.cs
deleted file mode 100644
index 8328f21ea23..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ICommandExecutor.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Windows.Forms.ICommandExecutor.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface ICommandExecutor
- {
- // There is no documentation for this interface's members!
- // Only a note saying that it supports the .NET infrastructure
- // and is not intended to be used directly from your code.
- // The Execute method had its own listing in the documentation;
- // I don't know what other methods and properties there may be.
- void Execute();
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IComponentEditorPageSite.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IComponentEditorPageSite.cs
deleted file mode 100644
index bc10ce8a1ca..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IComponentEditorPageSite.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Windows.Forms.IComponentEditorPageSite.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface IComponentEditorPageSite
- {
- // There is no documentation for this interface's members!
- // Only a note saying that it supports the .NET infrastructure
- // and is not intended to be used directly from your code.
- // The following methods had their own listing in the documentation;
- // I don't know what other methods and properties there may be.
-
- Control GetControl();
- void SetDirty();
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IContainerControl.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IContainerControl.cs
deleted file mode 100644
index 989400c32c0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IContainerControl.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.IContainerControl.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface IContainerControl
- {
- bool ActivateControl(Control active);
- Control ActiveControl {get; set;}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridColumnStyleEditingNotificationService.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridColumnStyleEditingNotificationService.cs
deleted file mode 100644
index 3916aa84bfb..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridColumnStyleEditingNotificationService.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Windows.Forms.IDataGridColumnStyleEditingNotificationService.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface IDataGridColumnStyleEditingNotificationService
- {
- void ColumnStartedEditing(Control editingControl);
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridEditingService.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridEditingService.cs
deleted file mode 100644
index 4105cc18da8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataGridEditingService.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Windows.Forms.IDataGridEditingService.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface IDataGridEditingService
- {
- // There is no documentation for this interface's members!
- // Only a note saying that it supports the .NET infrastructure
- // and is not intended to be used directly from your code.
- // The following methods had their own listing in the documentation;
- // I don't know what other methods and properties there may be.
-
- bool BeginEdit(DataGridColumnStyle gridColumn, int rowNumber);
- bool EndEdit(DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort);
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataObject.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataObject.cs
deleted file mode 100644
index ef9c289cb51..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IDataObject.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Windows.Forms.IDataObject.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- [ComVisible(true)]
- public interface IDataObject
- {
- object GetData(string format);
- object GetData(Type format);
- object GetData(string format, bool autoConvert);
-
- bool GetDataPresent(string format);
- bool GetDataPresent(Type format);
- bool GetDataPresent(string format, bool autoConvert);
-
- string[] GetFormats();
- string[] GetFormats(bool autoConvert);
-
- void SetData(object data);
- void SetData(string format, object data);
- void SetData(Type format, object data);
- void SetData(string format, bool autoConvert, object data);
- }
-}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IFeatureSupport.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IFeatureSupport.cs
deleted file mode 100644
index 01e22f487af..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IFeatureSupport.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.IFeatureSupport.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface IFeatureSupport
- {
- Version GetVersionPresent(object feature);
- bool IsPresent(object feature);
- bool IsPresent(object feature, Version minimumVersion);
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IFileReaderService.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IFileReaderService.cs
deleted file mode 100644
index 1e54a9aa62c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IFileReaderService.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.IFileReaderService.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface IFileReaderService
- {
- // There is no documentation for this interface's members!
- // Only a note saying that it supports the .NET infrastructure
- // and is not intended to be used directly from your code.
- // The following method had its own listing in the documentation;
- // I don't know what other methods and properties there may be.
-
- Stream OpenFileFromSource(string relativePath);
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IMessageFilter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IMessageFilter.cs
deleted file mode 100644
index 3783417ece8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IMessageFilter.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.IMessageFilter.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
-
- interface IMessageFilter {
- bool PreFilterMessage(ref Message m);
- }
-}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IWin32Window.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IWin32Window.cs
deleted file mode 100644
index 6a639f7ccc9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IWin32Window.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.IWin32Window.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- [ComVisible(true)]
- [Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface IWin32Window
- {
- IntPtr Handle {get;}
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/IWindowTarget.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/IWindowTarget.cs
deleted file mode 100644
index 64449de8e24..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/IWindowTarget.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Windows.Forms.IWindowTarget.cs
-//
-// Author:
-// William Lamb (wdlamb@notwires.com)
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- public interface IWindowTarget
- {
- // There is no documentation for this interface's members!
- // Only a note saying that it supports the .NET infrastructure
- // and is not intended to be used directly from your code.
- // The following methods had their own listing in the documentation;
- // I don't know what other methods and properties there may be.
-
- void OnHandleChange(IntPtr newHandle);
- void OnMessage(ref Message m);
- }
-}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageIndexConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageIndexConverter.cs
deleted file mode 100644
index 7be84620d69..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageIndexConverter.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// System.Windows.Forms.ImageIndexConverter.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ImageIndexConverter : Int32Converter {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ImageIndexConverter()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool CanConvertFrom(Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool CanConvertFrom(ITypeDescriptorContext context, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CanConvertTo(Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool CanConvertTo(ITypeDescriptorContext context, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object o )
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFrom(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(ITypeDescriptorContext context , string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString( ITypeDescriptorContext context, string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString( ITypeDescriptorContext context, CultureInfo culture, string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertTo(object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertTo( ITypeDescriptorContext context, CultureInfo culture, object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString( ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString( ITypeDescriptorContext context, CultureInfo culture, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString( ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString( ITypeDescriptorContext context, CultureInfo culture, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CreateInstance(IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CreateInstance( ITypeDescriptorContext context, IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetCreateInstanceSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetCreateInstanceSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetPropertiesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetPropertiesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ICollection GetStandardValues()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesExclusive()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool IsValid(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool IsValid( ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //protected virtual bool IncludeNoneAsStandardValue {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.ImageCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.ImageCollection.cs
deleted file mode 100644
index 438e9e80fbf..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.ImageCollection.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.Windows.Forms.ImageList.ImageCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public sealed class ImageList.ImageCollection : IList, ICollection, IEnumerable {
-
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Empty {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Image this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Add(Icon icon)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Add(Image img)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Add(Image img, Color col)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int AddStrip(Image value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(Image image)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(Image image)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(Image image)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.cs
deleted file mode 100644
index f5328fb81ef..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageList.cs
+++ /dev/null
@@ -1,263 +0,0 @@
-//
-// System.Windows.Forms.ImageList.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public sealed class ImageList : Component {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ImageList()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ImageList(IContainer cont)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public ColorDepth ColorDepth {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public IntPtr Handle {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool HandleCreated {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList.ImageCollection Images {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Size ImageSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageListStreamer ImageStream {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color TransparentColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Draw(Graphics g, Point pt, int n)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Draw(Graphics g, int n1, int n2, int n3)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler RecreateHandle {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected virtual void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
-
-
- ////
- //// System.Windows.Forms.ImageList.ImageCollection.cs
- ////
- //// Author:
- //// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- ////
- //// (C) 2002 Ximian, Inc
- ////
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public sealed class ImageList.ImageCollection : IList, ICollection, IEnumerable {
-
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Empty {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Image this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Add(Icon icon)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Add(Image img)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Add(Image img, Color col)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int AddStrip(Image value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(Image image)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(Image image)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(Image image)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }// End of Subclass
-
- // }//End of class
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageListStreamer.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageListStreamer.cs
deleted file mode 100644
index 11cbc59588a..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImageListStreamer.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Windows.Forms.ImageListStreamer.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public sealed class ImageListStreamer : ISerializable {
-
- //
- // --- Public Methods
- //
- // [MonoTODO]
- // public virtual bool Equals(object o);
- // {
- // throw new NotImplementedException ();
- // }
- // [MonoTODO]
- // public static bool Equals(object o1, object o2);
- // {
- // throw new NotImplementedException ();
- // }
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImeMode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ImeMode.cs
deleted file mode 100644
index bd34afa9430..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ImeMode.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Windows.Forms.ImeMode.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ImeMode {
- Alpha = 8,
- AlphaFull = 7,
- Disable = 3,
- Hangul = 10,
- HangulFull = 9,
- Hiragana = 4,
- Inherit = -1,
- Katakana = 5,
- KatakanaHalf = 6,
- NoControl = 0,
- Off = 2,
- On = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguage.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguage.cs
deleted file mode 100644
index d92860a67e6..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguage.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.Windows.Forms.InputLanguage.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public sealed class InputLanguage {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public CultureInfo Culture {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public static InputLanguage CurrentInputLanguage {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public static InputLanguage DefaultInputLanguage {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public IntPtr Handle {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public static InputLanguageCollection InstalledInputLanguages {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string LayoutName {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static InputLanguage FromCulture(CultureInfo culture)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override int GetHashCode()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangeEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangeEventArgs.cs
deleted file mode 100644
index 9413c600a7d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangeEventArgs.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Windows.Forms.InputLanguageChangeEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class InputLanguageChangeEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public InputLanguageChangeEventArgs ( CultureInfo culture, byte b)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public byte CharSet {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public CultureInfo Culture {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public InputLanguage InputLanguage {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventHandler.cs
deleted file mode 100644
index e53318893b5..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windoes.Forms.InputLanguageChangedEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void InputLanguageChangedEventHandler (
- object sender,
- InputLanguageChangedEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventArgs.cs
deleted file mode 100644
index 6bddffe2e1e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventArgs.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Windows.Forms.InputLanguageChangingEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class InputLanguageChangingEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public InputLanguageChangingEventArgs(CultureInfo culture, bool val)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public CultureInfo Culture {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public InputLanguage InputLanguage {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool SysCharSet {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventHandler.cs
deleted file mode 100644
index de42343d725..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.InputLanguageChangingEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void InputLanguageChangingEventHandler (
- object sender,
- InputLanguageChangingEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageCollection.cs
deleted file mode 100644
index 6b4da5ec661..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InputLanguageCollection.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Windows.Forms.InputLanguageCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class InputLanguageCollection : ReadOnlyCollectionBase {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public InputLanguage this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool Contains(InputLanguage lang)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(InputLanguage[] array, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(InputLanguage lang)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventArgs.cs
deleted file mode 100644
index 922b66a6694..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventArgs.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Windows.Forms.InvalidateEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class InvalidateEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public InvalidateEventArgs(Rectangle invalidRect)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Rectangle InvalidRect {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventHandler.cs
deleted file mode 100644
index 4180423e7a0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/InvalidateEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.InvalidateEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void InvalidateEventHandler (
- object sender,
- InvalidateEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemActivation.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemActivation.cs
deleted file mode 100644
index 8d2b04f65f1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemActivation.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.ItemActivation.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ItemActivation {
- OneClick = 1,
- Standard = 0,
- TwoClick = 2
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemBoundsPortion.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemBoundsPortion.cs
deleted file mode 100644
index 8e9de3f554b..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemBoundsPortion.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.ItemBoundsPortion.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ItemBoundsPortion {
- Entire = 0,
- Icon = 1,
- ItemOnly = 3,
- Label = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventArgs.cs
deleted file mode 100644
index 1633bc39b97..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Windows.Forms.ItemChangedEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ItemChangedEventArgs : EventArgs {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //int Index {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventHandler.cs
deleted file mode 100644
index 632909e7d14..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemChangedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.ItemChangedEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void ItemChangedEventHandler (
- object sender,
- ItemChangedEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventArgs.cs
deleted file mode 100644
index 3c36b812c20..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventArgs.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// System.Windows.Forms.ItemCheckEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ItemCheckEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ItemCheckEventArgs(int index, CheckState newCheckValue CheckState currentValue )
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public CheckState CurrentValue {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Index {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public CheckState NewValue {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventHandler.cs
deleted file mode 100644
index 71f558799fc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemCheckEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Wondows.Forms.ItemCheckEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void ItemCheckEventHandler (
- object sender,
- ItemCheckEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventArgs.cs
deleted file mode 100644
index 7b05c22d0e2..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventArgs.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.Windows.Forms.ItemDragEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ItemDragEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ItemDragEventArgs(MouseButtons bttns)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ItemDragEventArgs(MouseButtons bttns, object o)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public MouseButtons Button {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public object Item {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventHandler.cs
deleted file mode 100644
index 71059cc4218..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ItemDragEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.ItemDragEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void ItemDragEventHandler (
- object sender,
- ItemDragEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventArgs.cs
deleted file mode 100644
index 87a7881ba3b..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventArgs.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// System.Windows.Forms.KeyEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class KeyEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public KeyEventArgs ( Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public virtual bool Alt {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Control {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Handled {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Keys KeyCode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Keys KeyData {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int KeyValue {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Keys Modifiers {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Shift {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventHandler.cs
deleted file mode 100644
index 8feaa3f9334..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.KeyEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void KeyEventHandler (
- object sender,
- KeyEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyPressEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyPressEventArgs.cs
deleted file mode 100644
index 523828377ef..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeyPressEventArgs.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Windows.Forms.KeyPressEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class KeyPressEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public KeyPressEventArgs (char keyChar)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool Handled {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public char KeyChar {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Keys.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Keys.cs
deleted file mode 100644
index f9d8081a250..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Keys.cs
+++ /dev/null
@@ -1,202 +0,0 @@
-//
-// System.Windows.Forms.Keys.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- //TODO:
- //Values not yet implmented
- /// </summary>
- public enum Keys {
- A = 65,
- Add = 107,
- Alt = 262144,
- Apps = 93,
- Attn = 246,
- B = 66,
- Back = 8,
- BrowserBack = 166,
- BrowserFavorites = 171,
- BrowserForward = 167,
- BrowserHome = 172,
- BrowserRefresh = 168,
- BrowserSearch = 170,
- BrowserStop = 169,
- C = 67,
- Cancel = 3,
- Capital = 20,
- CapsLock = 20,
- Clear = 12,
- Control = 131072,
- ControlKey = 17,
- Crsel = 247,
- D = 68,
- D0 = 48,
- D1 = 49,
- D2 = 50,
- D3 = 51,
- D4 = 52,
- D5 = 53,
- D6 = 54,
- D7 = 55,
- D8 = 56,
- D9 = 57,
- Decimal = 110,
- Delete = 46,
- Divide = 111,
- Down = 40,
- E = 69,
- End = 35,
- Enter = 13,
- EraseEof = 249,
- Escape = 27,
- Execute = 43,
- Exsel = 248,
- F = 70,
- 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,
- FinalMode = 24,
- G = 71,
- H = 72,
- HanguelMode = 21,
- HangulMode = 21,
- HanjaMode = 25,
- Help = 47,
- Home = 36,
- I = 73,
- IMEAceept = 30,
- IMEConvert = 28,
- IMEModeChange = 31,
- IMENonconvert = 29,
- Insert = 45,
- J = 74,
- JunjaMode = 23,
- K = 75,
- KanaMode = 21,
- KanjiMode = 25,
- KeyCode = 65535,
- L = 76,
- LaunchApplication1 = 182,
- LaunchApplication2 = 183,
- LaunchMail = 180,
- LButton = 1,
- LControlKey = 162,
- Left = 37,
- LineFeed = 10,
- LShiftKey = 160,
- LMenu = 164,
- LWin = 91,
- M = 77,
- MButton = 4,
- MediaNextTrack = 176,
- MediaPlayPause = 179,
- MediaPreviousTrack = 177,
- MediaStop = 178,
- Menu = 18,
- Modifiers = -65536,
- Multiply = 106,
- N = 78,
- Next = 34,
- NoName = 252,
- None = 0,
- NumLock = 144,
- NumPad0 = 96,
- NumPad1 = 97,
- NumPad2 = 98,
- NumPad3 = 99,
- NumPad4 = 100,
- NumPad5 = 101,
- NumPad6 = 102,
- NumPad7 = 103,
- NumPad8 = 104,
- NumPad9 = 105,
- O = 79,
- Oem8 = 223,
- OemBackslash = 226,
- OemClear = 254,
- OemCloseBrackets = 221,
- Oemcomma = 188,
- OemMinus = 189,
- OemOpenBrackets = 219,
- OemPeriod = 190,
- OemPipe = 220,
- Oemplus = 187,
- OemQuestion = 191,
- OemQuotes = 222,
- OemSemicolon = 186,
- Oemtilde = 192,
- P = 80,
- Pa1 = 253,
- PageDown = 34,
- PageUp = 33,
- Pause = 19,
- Play = 250,
- Print = 42,
- PrintScreen = 44,
- Prior = 33,
- ProcessKey = 229,
- Q = 81,
- R = 82,
- RButton = 2,
- RControlKey = 163,
- Return = 13,
- Right = 39,
- RMenu = 165,
- RShiftKey = 161,
- RWin = 92,
- S = 83,
- Scroll = 145,
- Select = 41,
- SelectMedia = 181,
- Separator = 108,
- Shift = 65536,
- ShiftKey = 16,
- Snapshot = 44,
- Space = 32,
- Subtract = 109,
- T = 84,
- Tab = 9,
- U = 85,
- Up = 38,
- V = 86,
- VolumeDown = 174,
- VolumeMute = 173,
- VolumeUp = 175,
- W = 87,
- X = 88,
- XButton1 = 5,
- XButton2 = 6,
- Y = 89,
- Z = 90,
- Zoom = 251
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeysConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/KeysConverter.cs
deleted file mode 100644
index 86d2f8da876..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/KeysConverter.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// System.Windows.Forms.KeysConverter.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class KeysConverter : TypeConverter, IComparer {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public KeysConverter()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool CanConvertFrom(Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CanConvertFrom(ITypeDescriptorContext context, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CanCompareTo(Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool CanCompareTo(ITypeDescriptorContext context, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Compare(object a, object b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFrom(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString( ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString( ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertTo( object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertTo( ITypeDescriptorContext context, CultureInfo culture, object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString( object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public stirng ConvertToInvariantString( ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString( object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public stirng ConvertToString( ITypeDescriptorContext context , object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CreateInstance(IDicitonary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual object CreateInstance( ITypeDescriptorContext context, IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetCreateInstanceSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetCreateInstanceSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties( ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object o, Attribute[] attributes)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetProertiesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetProertiesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override StandardValuescollection GetStandardValues(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ICollection GetStandardValues()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesExclusive()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool IsValid(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool IsValid(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventArgs.cs
deleted file mode 100644
index e0b2e20c4ae..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventArgs.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.Windows.Forms.LabelEditEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class LabelEditEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public LabelEditEventArgs (int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public LabelEditEventArgs (int val, string str)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool CancelEdit {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Item {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Label {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventHandler.cs
deleted file mode 100644
index 8fb8a5c4b94..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LabelEditEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.LabelEditEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void LabelEditEventHandler (
- object sender,
- LabelEditEventAgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventArgs.cs
deleted file mode 100644
index 3c7fb26f08f..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventArgs.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Windows.Forms.LayoutEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public sealed class LayoutEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public LayoutEventArgs (Control affectedControl, string affectedProperty)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Control AffectedControl {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string AffectedProperty {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventHandler.cs
deleted file mode 100644
index b3342489abd..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LayoutEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Windows.Forms.LayoutEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void LayoutEventHandler (
- object sender,
- LayoutEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LeftRightAlignment.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LeftRightAlignment.cs
deleted file mode 100644
index 2cbb2f15fbe..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LeftRightAlignment.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.LeftRightAlignment.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum LeftRightAlignment {
- Left = 0,
- Right = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.LinkAreaConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.LinkAreaConverter.cs
deleted file mode 100644
index 7e2c8917cf3..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.LinkAreaConverter.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// System.Windows.Forms.LinkArea.LinkAreaConverter.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class LinkArea.LinkAreaConverter : TypeConverter {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public LinkArea.LinkAreaConverter()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool CanConvertFrom(Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CanConvertFrom(ITypeDescriptorContext context, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CanConvertTo(Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CanConvertTo(ITypeDescriptorContext context, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFrom(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture,object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertTo(object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object CreateInstance(ITypeDescriptorContext context, IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CreateInstance(IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetCreateInstanceSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool GetCreateInstanceSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ICollection GetStandardValues()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesExclusive()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Type GetType()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool IsValid(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool IsValid(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.cs
deleted file mode 100644
index 2a50d95ff29..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkArea.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// System.Drawing.LinkArea.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
- [Serializable]
- public struct LinkArea {
-
- private int start;
- private int length;
-
- // -----------------------
- // Public Constructor
- // -----------------------
-
- /// <summary>
- ///
- /// </summary>
- ///
- /// <remarks>
- ///
- /// </remarks>
-
- public LinkArea (int Start, int Length){
- start = Start;
- length = Length;
- }
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two LinkArea objects. The return value is
- /// based on the equivalence of the Start and Length properties of the two objects.
- /// </remarks>
-
- public static bool operator == (LinkArea la_a,
- LinkArea la_b)
- {
- return ((la_a.start == la_b.start) &&
- (la_a.length == la_b.length));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two LinkArea objects. The return value is
- /// based on the equivalence of the Start and Length properties of the two objects.
- /// </remarks>
- public static bool operator != (LinkArea la_a,
- LinkArea la_b) {
- return ((la_a.start != la_b.start) ||
- (la_a.length != la_b.length));
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- public int IsEmpty {
- get{
- // Start can be 0, so no way to know if it is empty.
- // Docs seem to say Start must/should be set before
- // length, os if length is valid, start must also be ok.
- return length!=0;
- }
- }
-
- public int Start {
- get{
- return start;
- }
- set{
- start = value;
- }
- }
-
- public int Length {
- get{
- return length;
- }
- set{
- length = value;
- }
- }
-
-
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this LinkArea and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is LinkArea))
- return false;
-
- return (this == (LinkArea) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return (int)( start ^ length);
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the LinkArea as a string.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1}]", start, length );
- }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkBehavior.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkBehavior.cs
deleted file mode 100644
index 0c994a33cb0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkBehavior.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.LinkBehavior.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum LinkBehavior {
- AlwaysUnderline = 1,
- HoverUnderline = 2,
- NeverUnderline = 3,
- SystemDefault = 0,
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventArgs.cs
deleted file mode 100644
index c6a8235dac5..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventArgs.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Windows.Forms.LinkClickedEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class LinkClickedEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public LinkClickedEventArgs(string linkText)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public string LinkText {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventHandler.cs
deleted file mode 100644
index a93ec7241ef..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkClickedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.LinkClickedEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void LinkClickedEventHandler (
- object sender,
- LinkClickedEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabel.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabel.cs
deleted file mode 100644
index 67132ef0644..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabel.cs
+++ /dev/null
@@ -1,493 +0,0 @@
-//
-// System.Windows.Forms.LinkLabel.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class LinkLabel : Label, IButtonControl {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public LinkLabel()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Color ActiveLinkcolor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color DisabledLinkColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public LinkArea LinkArea {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public LinkBehavior LinkBehavior {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color LinkColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public LinkLabel.LinkCollection Links {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool LinkVisited {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override ISite Site {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color VisitedLinkColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select(bool val2, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int b1, int b2, int b3, int b4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int b1, int b2, int b3, int b4, int b5, int b6)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event LinkLabelLinkClickedEventHandler LinkClicked {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override DefaultImeMode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override AccessabilityObject CreateAccessabilityInstance()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override virtual void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected override void OnEnabledChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnFontChanged( EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnGotFocus( EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnKeyDown (KeyEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnLostFocus (EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseDown (MouseEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- // I think that this should be 'MouseEventArgs'
- // but the documentation says EventArgs.
- //[MonoTODO]
- //protected override void OnMouseLeave(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseMove (MouseEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseUp (MouseEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnPaint (PaintEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnPaintBackground(PaintEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnTextAlignChanged( EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnTextChanged( EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected override bool ProcessDialogKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected ContentAlignment RtlTranslateAlignment(ContentAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected HorizontalAlignment RtlTranslateAlignment( HorizontalAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected LeftRightAlignment RtlTranslateAlignment( LeftRightAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void SetBoundsCare( int x, int y, int width, int height, BoundsSpecified specified)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override WndProc(ref Message msg)
- //{
- // throw new NotImplementedException ();
- //}
-//
-// System.Windows.Forms.LinkLabel.LinkCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class LinkLabel.LinkCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public LinkLabel.LinkCollection(LinkLabel owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual LinkLabel.Link this[ int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public Link Add(int val1, int val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Link Add(int val1, int val2, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(LinkLabel.Link link)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(LinkLabel.Link link)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(LinkLabel.Link value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //}End of subclass
- //} End of Class
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventArgs.cs
deleted file mode 100644
index 50e3cb73dc9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventArgs.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Windows.Forms.LinkLabelLinkClickedEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class LinkLabelLinkClickedEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public LinkLabelLinkClickedEventArgs(LinkLabel.Link link)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public LinkLabel.Link Link {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventHandler.cs
deleted file mode 100644
index 18eee129fdc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkLabelLinkClickedEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.LinkLabelLinkClickEventHandler.cs
-//
-// Author:
-// Dennis hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms {
- [Serializable]
- public delegate void LinkLabelLinkClickEventHandler (
- object sender,
- LinkLabelLinkClickEventArgs e
- );
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkState.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkState.cs
deleted file mode 100644
index 6d5c93de3ae..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/LinkState.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.LinkState.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum LinkState {
- Active = 2,
- Hover = 1,
- Normal = 0,
- Visited = 4
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs
deleted file mode 100644
index 30d740d7984..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// System.Windows.Forms.ListBindingConverter.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListBindingConverter : TypeConverter {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListBindingConverter()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool CanConvertFrom(Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool (ITypeDescriptorContext context, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CanConvertTo(Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CanConvertTo(ITypeDescriptorContext context, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFrom(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(ITypeDescriptorContext context, string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(ITypeDescriptorContext context, string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertTo(object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object o, Type t)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CreateInstance(IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object CreateInstance(ITypeDescriptorContext context, IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetCreateInstanceSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool GetCreateInstanceSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual int GetHashCode()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetPropertiesObject()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetPropertiesObject(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ICollection GetStandardValues()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesExclusive()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool IsValid(object o)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool IsValid(ITypeDescriptorContext context, object o)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs
deleted file mode 100644
index f933e033aa8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListBox.cs
+++ /dev/null
@@ -1,713 +0,0 @@
-//
-// System.Windows.Forms.ListBox.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListBox : ListControl {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListBox()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Fields
- //
- //public const int DefultItemHeight = ??;
- //public const int NoMatches = ??;
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override Color BackColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override RightToLeft RightToLeft {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ScrollAlwaysVisible {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override int SelectedIndex {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListBox.SelectedIndexCollection SelectedIndices {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public object SelectedItem {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListBox.SelectedObjectCollection SelectedItems {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual SelectionMode SelectionMode {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Sorted {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int TopIndex {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool UseTabStops {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void BeginUpdate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ClearSelected()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void EndUpdate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int FindString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int FindString(string str, int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int FindStringExact(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int FindStringExact(string str, int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int GetItemHeight(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Rectangle GetItemRectangle(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetSelected(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexFromPoint(Point pt)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexFromPoint(int val1, int val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str )
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpecified bounds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetSelected(int index, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event DrawItemEventHandler DrawItem {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event MeasureItemEventHandler MeasureItem {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected virtual ObjectCollection CreateItemCollection()
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected override void Dispose(bool val1)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnChangeUICues(UICuesEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnDataSourceChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnDisplayMemberChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnFontChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleDestroyed(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnParentChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnResize(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnSelectedItemChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected void RefreshItem(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected ContentAlignment RtlTranslateAlignment(ContentAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void SetBoundsCore( int x, int y, int width, int height BoundsSpecified specified)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void Sort()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message mgs)
- //{
- // throw new NotImplementedException ();
- //}
-//////////////////////
- //
- // <summary>
- // This is only a template. Nothing is implemented yet.
- // This is a subclass
- // </summary>
-
- //public class ListBox.SelectedObjectCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListBox.SelectedObjectCollection(ListBox owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public object this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool Contains(object selectedObject)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(Array dest, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(object selectedObject)
- //{
- // throw new NotImplementedException ();
- //}
- // }End of subclass
- /////
- ///
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListBox.ObjectCollection : IList, ICollection {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListBox.ObjectCollection(ListBox box)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListBox.ObjectCollection(ListBox box, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual object this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public int Add(object item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void AddRange(object[] items)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void AddRange(ListBox.ObjectCollection collection)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(object value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(object[] dest, int arrayIndex)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(object val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Insert(int index, object item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(object val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- // }//end of SubClass
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListBox.SelectedIndexCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListBox.SelectedIndexCollection(ListBox owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool Contains(int selectedIndex)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(Array dest, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- // }//End of subclass
-
-//////////////////////
-
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs
deleted file mode 100644
index 782ad77a968..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListControl.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-//
-// System.Windows.Forms.ListControl.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public abstract class ListControl : Control {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public object DataSource {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string DisplayMember {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public abstract int SelectedIndex {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public object SelectedValue {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ValueMember {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string GetItemText(object Item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpecified bounds)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler DataSourceChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler DisplayMemberChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Constructor
- //
- //[MonoTODO]
- //protected ListControl()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected CurrencyManager DataManager {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool IsInputkey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnBindingContextChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected abstract void RefreshItem(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected ContentAlignment RtlTranslateAlignment(ContentAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs
deleted file mode 100644
index cdf908cc69c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListView.cs
+++ /dev/null
@@ -1,1168 +0,0 @@
-//
-// System.Windows.Forms.ListView.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListView : Control {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListView()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public ImageActivation Activation {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListViewAlignment Alignment {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AllowColumnReorder {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AutoArrange {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color BackColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public BorderStyle BorderStyle {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool CheckBoxes {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView.CheckedIndexCollection CheckedIndices {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView.CheckedListViewItemCollection CheckedItems {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView.ColumnHeaderCollection Columns {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public overide Color ForeColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool FullRowSelect {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool GridLines {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ColumnHeaderStyle HeaderStyle {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool HideSelection {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool HoverSelection {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView.ListViewItemCollection Items {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool LabelEdit {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool LabelWrap {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList LargeImageList {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool MultiSelect {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Scrollable {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView.SelectedIndexCollection SelectedIndices {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView.SelectedListViewItemCollection SelectedItems {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList SmallImageList {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Sorting {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList StateImageList {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public View View {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void ArrangeIcons()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ArrangeIcons(ListViewAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void BeginUpdate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void EndUpdate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void EnsureVisible(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem GetItemAt(int x, int y)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Rectangle RetItemRect(int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Rectangle RetItemRect(int val, ItemBoundsPortion portion)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect, bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpcified bounds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event LabelEditEventHandler AfterLabelEdit {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event LabelEditEventHandler BeforeLabelEdit {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event ColumnClickEventHandler ColumnClick {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler ItemActivate {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event ItemCheckEventHandler ItemCheck {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event ItemDragEventHandler ItemDrag {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler SelectedIndexChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void Dispose(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool IsInputKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected virtual void OnAfterLabelEdit(LabelEditEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnBeforeLabelEdit(LabelEditEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnColumnClick(ColumnClickEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected override void OnEnabledChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnFontChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleDestroyed(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected virtual void OnItemActivate(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnItemCheck(ItemCheckEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnItemDrag(ItemDragEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnSelectedItemChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected override void OnSystemColorsChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateExtendedStyles()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //start subclasses
- //
- // System.Windows.Forms.ListView.SelectedListViewItemCollection.cs
- //
- // Author:
- // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- //
- // (C) 2002 Ximian, Inc
- //
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListView.SelectedListViewItemCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListView.SelectedListViewItemCollection(ListView owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListViewItem this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(Array dest, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // System.Windows.Forms.ListView.CheckedListViewItemCollection.cs
- //
- // Author:
- // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- //
- // (C) 2002 Ximian, Inc
- //
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListView.CheckedListViewItemCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListView.CheckedListViewItemCollection(ListView owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListViewItem this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool Contains(ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CopyTo(Array dest, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- // }
- //
- // System.Windows.Forms.ListView.ColumnHeaderCollection.cs
- //
- // Author:
- // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- //
- // (C) 2002 Ximian, Inc
- //
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListView.ColumnHeaderCollection : IList, IColleciton, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListView.ColumnHeaderCollection(ListView owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual ColumnHeader this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual int Add(ColumnHeader value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual ColumnHeader Add(string s, int b, HorizontalAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void AddRange(ColumnHeader[] values)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(ColumnHeader value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(ColumnHeader value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Insert(int b, ColumnHeader value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Insert(int val1, string str, int val2, HorizontalAlignment align)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Remove(ColumnHeader value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- // }
- // }
-//
-// System.Windows.Forms.ListView.ListViewItemCollection.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListView.ListViewItemCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListView.ListViewItemCollection (ListView owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual ListViewItem this [int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual ListViewItem Add (ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual ListViewItem Add (string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual ListViewItem Add (string str, int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void AddRange(ListViewItem[] values)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(Array dest, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Remove(ListViewItem item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- // }
- //
- // System.Windows.Forms.ListView.SelectedIndexCollection.cs
- //
- // Author:
- // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- //
- // (C) 2002 Ximian, Inc
- //
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListView.SelectedIndexCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListView.SelectedIndexCollection(ListView owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int this [int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool Contains(ListView item)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(Array dest, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(int index)
- //{
- // throw new NotImplementedException ();
- //}
- // }
- //
- // System.Windows.Forms.ListView.CheckedIndexCollection.cs
- //
- // Author:
- // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- //
- // (C) 2002 Ximian, Inc
- //
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListView.CheckedIndexCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListView.CheckedIndexCollection(ListView owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int this[int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool Contains(int checkedIndex)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(int checkedIndex)
- //{
- // throw new NotImplementedException ();
- //}
- // }
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewAlignment.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewAlignment.cs
deleted file mode 100644
index 13a609ce8be..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewAlignment.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.ListViewAlignment.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ListViewAlignment {
- Default = 0,
- Left = 1,
- SnapToGrid = 5,
- Top = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItem.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItem.cs
deleted file mode 100644
index 72c83e84dcc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItem.cs
+++ /dev/null
@@ -1,478 +0,0 @@
-//
-// System.Windows.Forms.ListViewItem.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListViewItem : ICloneable, ISerializable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListViewItem()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem(string[] strings)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem(ListViewItem.ListViewSubItem[] subItems)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem(string str, int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem(string[] strings, int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem(string[] strings, int val, Color color1, Color color2, Font font)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Color BackColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Rectangle Bounds {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Checked {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Focused {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Font Font {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color Forecolor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int ImageIndex {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList ImageList {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Index {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView ListView {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Selected {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int StateImageIndex {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ListView.ListViewSubItemCollection SubItems {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public object Tag {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool UseItemStyleForSubItems {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void BeginEdit()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Clone()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void EnsureVisible()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Rectangle GetBounds(ItemBoundsPortion portion)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected virtual void Deserialize(SerializationInfo info, StreamingContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Serialize(SerializationInfo info, StreamingContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // System.Windows.Forms.ListViewItem.ListViewSubItemCollection.cs
- //
- // Author:
- // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- //
- // (C) 2002 Ximian, Inc
- //
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListViewItem.ListViewSubItemCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //ListViewItem.ListViewSubItemCollection(ListViewItem owner)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //int Count {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //bool IsReadOnly {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //ListViewItem.ListViewSubItem this [int index] {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //ListViewSubItem Add(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //ListViewSubItem Add(string str, Color color1, Color color2, Font font)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //ListViewSubItem Add(ListViewItem.ListViewSubItem subItem)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //void AddRange(ListViewItem.ListViewSubItem[] items)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //void AddRange(string[] strings)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //void AddRange(string[] strings, Color color1, Color color2, Font font)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //bool Contains(ListViewItem.ListViewSubItem subItem)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //int IndexOf(ListViewItem.ListViewSubItem subItem)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //void Insert(int index, ListViewItem.ListViewSubItem subItem)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //void Remove(ListViewItem.ListViewSubItem subItem)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- // }
- //
- // System.Windows.Forms.ListViewItem.ListViewSubItem.cs
- //
- // Author:
- // stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
- //
- // (C) 2002 Ximian, Inc
- //
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListViewItem.ListViewSubItem {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListViewItem.ListViewSubItem()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem.ListViewSubItem(ListViewItem item, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ListViewItem.ListViewSubItem(ListViewItem item, string str, Color color1, Color color2, Font font)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Color BackColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Font Font {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color ForeColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResetStyle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-
-
-
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItemConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItemConverter.cs
deleted file mode 100644
index 02ba58322bc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ListViewItemConverter.cs
+++ /dev/null
@@ -1,218 +0,0 @@
-//
-// System.Windows.Forms.ListViewItemConverter.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ListViewItemConverter : ExpandableObjectConverter {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ListViewItemConverter()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool CanConvertFrom(Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool CanConvertFrom(ITypeDescriptorContext context, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CanConvertTo(Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CanConvertTo(ITypeDescriptorContext context, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFrom(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertTo(object obj, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object obj, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(ITypeDescriptorContext context, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(ITypeDescriptorContext context, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(ITypeDescriptorContext context, CultureInfo culture, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CreateInstance(IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual object CreateInstance(ITypeDescriptorContext context, IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetCreateInstanceSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetCreateInstanceSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context,object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object obj, Attribute[] attributes)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //public bool GetPropertiesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetPropertiesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ICollection GetStandardValues()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesExclusive()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool IsValid(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool IsValid(ITypeDescriptorContext context, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MainMenu.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MainMenu.cs
deleted file mode 100644
index 09a9eed7c25..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MainMenu.cs
+++ /dev/null
@@ -1,257 +0,0 @@
-////
-//// System.Windows.Forms.MainMenu.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//
-//using System;
-//using System.Reflection;
-//using System.Globalization;
-////using System.Windows.Forms.AccessibleObject.IAccessible;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms {
-//
-// /// <summary>
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// </summary>
-//
-// public class MainMenu : Menu {
-//
-// //
-// // --- Constructors
-// //
-//
-// public MainMenu()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public MainMenu(MenuItem[] items)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Methods
-// //
-//
-// public virtual MainMenu CloneMenu()
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected void MainMenu(Menu m)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public void Dispose()
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected virtual void Dispose(bool b)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public static bool Equals(object o, object o)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public ContextMenu GetContextMenu()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public Form GetForm()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public MainMenu GetMainMenu()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public Type GetType()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual void MergeMenu(Menu menuSrc)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public override string ToString()
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- Protected Methods
-// //
-//
-// protected void CloneMenu(Menu menuSrc)
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected override void Dispose(bool b)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public void Dispose()
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected virtual object GetService()
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- DeConstructor
-// //
-//
-// ~MainMenu()
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- Public Events
-// //
-//
-// public event EventHandler Disposed;
-//
-// //
-// // -- Public Properties
-// //
-//
-// public IContainer Container {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public IntPtr Handle {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public virtual bool IsParent {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public MenuItem MdiListItem {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public Menu.MenuItemCollection MenuItems {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public virtual RightToLeft RightToLeft {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// set
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public virtual ISite Site {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// set
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// //
-// // -- protected Properties
-// //
-//
-// protected bool DesignMode {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// protected EventHandler Events {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-// }
-//}
-//
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MdiLayout.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MdiLayout.cs
deleted file mode 100644
index 628de363de7..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MdiLayout.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.MdiLayout.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum MdiLayout {
- ArrangeIcons = 3,
- Cascade = 0,
- TileHorizontal = 1,
- TileVertical = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventArgs.cs
deleted file mode 100644
index 3b50df446e3..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventArgs.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-////
-//// System.Windows.Forms.MeasureItemEventArgs.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System;
-//using System.Reflection;
-//using System.Globalization;
-////using System.Windows.Forms.AccessibleObject.IAccessible;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms {
-//
-//
-// /// <summary>
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// </summary>
-//
-// public class MeasureItemEventArgs : EventArgs {
-//
-//
-// //
-// // --- Constructors
-// //
-//
-// public MeasureItemEventArgs(Graphics g, int i)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public MeasureItemEventArgs(Graphics g, int i, int i)
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- Public Methods
-// //
-//
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public static bool Equals(object o, object o)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public Type GetType()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual string ToString()
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- Protected Methods
-// //
-//
-// ~MeasureItemEventArgs()
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- Public Properties
-// //
-//
-// public Graphics Graphics {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public int Index {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public int ItemHeight {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// set
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public int ItemWidth {
-//
-// get
-// {
-// throw new NotImplementedException();
-// }
-// set
-// {
-// throw new NotImplementedException();
-// }
-// }
-// }
-//}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventHandler.cs
deleted file mode 100644
index 661f98cc20d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MeasureItemEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.MeasureItemEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the MeasureItem event of the
- /// ListBox, ComboBox, CheckedListBox, or MenuItem controls.
- /// </summary>
- [Serializable]
- public delegate void MeasureItemEventHandler(object sender, MeasureItemEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Menu.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Menu.cs
deleted file mode 100644
index a52d3155a9a..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Menu.cs
+++ /dev/null
@@ -1,373 +0,0 @@
-////
-//// System.Windows.Forms.Menu.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System;
-//using System.Reflection;
-//using System.Globalization;
-////using System.Windows.Forms.AccessibleObject.IAccessible;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms
-//{
-//
-// /// <summary>
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// </summary>
-//
-// public abstract class Menu : Component
-// {
-// //
-// // -- Public Methods
-// //
-//
-// public virtual ObjRef CreateObjRef(Type t)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public void Dispose()
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected virtual void Dispose(bool b)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public static bool Equals(object o, object o)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public ContextMenu GetContextMenu()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public MainMenu GetMainMenu()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public Type GetType()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException();
-// }
-//
-// public virtual void MergeMenu(Menu menuSrc)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public override string ToString()
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- Protected Methods
-// //
-//
-// protected void CloneMenu(Menu menuSrc)
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected override void Dispose(bool b)
-// {
-// throw new NotImplementedException();
-// }
-//
-// public void Dispose()
-// {
-// throw new NotImplementedException();
-// }
-//
-// ~Menu()
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException();
-// }
-//
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException();
-// }
-//
-// //
-// // -- Public Events
-// //
-//
-// public event EventHandler Disposed;
-//
-// //
-// // -- Public Properties
-// //
-//
-// public IContainer Container
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public IntPtr Handle
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public virtual bool IsParent
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public MenuItem MdiListItem
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public Menu.MenuItemCollection MenuItems
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// public virtual ISite Site
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// set
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// //
-// // -- Protected Properties
-// //
-//
-// protected bool DesignMode
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-//
-// protected EventHandlerList Events
-// {
-// get
-// {
-// throw new NotImplementedException();
-// }
-// }
-////
-//// System.Windows.Forms.Menu.MenuItemCollection.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System;
-//using System.Reflection;
-//using System.Globalization;
-////using System.Windows.Forms.AccessibleObject.IAccessible;
-//using System.Drawing;
-//
-// /// <summary>
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// </summary>
-//
-// public class Menu.MenuItemCollection : IList, ICollection, IEnumerable {
-//
-//
-// //
-// // -- Constructor
-// //
-//
-// public Menu.MenuItemCollection(Menu m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // -- Public Methods
-// //
-//
-// public virtual int Add(MenuItem m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual MenuItem Add(string s)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual int Add(int i, MenuItem m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual MenuItem Add(string s, EventHandler e)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual MenuItem Add(string s, MenuItem[] items)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual void AddRange(MenuItem[] items)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual void Clear()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public bool Contains(MenuItem m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public void CopyTo(Array a, int i)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public IEnumerator GetEnumerator()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public int IndexOf(MenuItem m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual void Remove(MenuItem m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual void RemoveAt(int i)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // -- Protected Methods
-// //
-//
-// ~Menu.MenuItemCollection()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // -- Public Properties
-// //
-//
-// public int Count {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public virtual MenuItem this(int i)
-// {
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-// }
-
-// }
-//}
-//
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuGlyph.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuGlyph.cs
deleted file mode 100644
index 13cc3ce1e70..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuGlyph.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-
-//
-// System.Windows.Forms.MenuGlyph.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum MenuGlyph {
- Arrow = 0,
- Bullet = 2,
- Checkmark = 1,
- Max = 2,
- Min = 0
- }
-}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuItem.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuItem.cs
deleted file mode 100644
index a9c70d9d7b1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuItem.cs
+++ /dev/null
@@ -1,515 +0,0 @@
-////
-//// System.Windows.Forms.Menu.MenuItem.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//using System;
-//using System.Reflection;
-//using System.Globalization;
-////using System.Windows.Forms.AccessibleObject.IAccessible;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms {
-//
-// /// <summary>
-// /// ToDo note:
-// /// - Nothing is implemented
-// /// </summary>
-//
-// public class MenuItem : Menu {
-//
-//
-// //
-// // - Constructor
-// //
-//
-// public MenuItem()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public MenuItem(string s)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public MenuItem(string s, EventHandler e)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public MenuItem(string s, MenuItem[])
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public MenuItem(string s, EventHandler e, Shortcut sc)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public MenuItem(MenuMerge mm, int i, Shortcut sc, string s, EventHandler e, EventHandler e1, EventHandler e2, MenuItem[])
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // -- Public Methods
-// //
-//
-// public virtual MenuItem CloneMenu()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual ObjRef CreateObjRef(Type t)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual void Dispose(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public static bool Equals(object o, object o1)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public ContextMenu GetContextMenu()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public MainMenu GetMainMenu()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual MenuItem MergeMenu()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public void MergeMenu(MenuItem m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual void MergeMenu(Menu m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public void PerformClick()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public virtual void PerformSelect()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// public override string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // -- Protected Methods
-// //
-//
-// protected void CloneMenu(MenuItem m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected void CloneMenu(Menu m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected override void Dispose(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// ~MenuItem()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected virtual object GetService(Type t)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected virtual void OnClick(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected virtual void OnDrawItem(DrawEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected virtual void OnMeasureItem(MeasureItemEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected virtual void OnPopUp(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// protected virtual void OnSelect(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // -- Public Properties
-// //
-//
-// public bool BarBreak {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool Break {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool Checked {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public IContainer Container {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool DefaultItem {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool Enabled {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public IntPtr Handle {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public int Index {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public override bool IsParent {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool MdiList {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public MenuItem MdiListItem {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public Menu.MenuItemCollection MenuItems {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public int MergeOrder {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public MenuMerge MergeType {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public char Mnemonic {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool OwnerDraw {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public Menu Parent {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool RadioCheck {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public Shortcut Shortcut {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public virtual ISite Site {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public string Text {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// public bool Visible {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// set
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // -- Protected Properties
-// //
-//
-// protected bool DesignMode {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// protected EventHandlerList Events {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// protected int MenuID {
-//
-// get
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // -- Public Events
-// //
-//
-// public event EventHandler Click {
-//
-// throw new NotImplementedException ();
-// }
-//
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-//
-// public event DrawItemEventHandler DrawItem {
-//
-// throw new NotImplementedException ();
-// }
-//
-// public event MeasureItemEventHandler MeasureItem {
-//
-// throw new NotImplementedException ();
-// }
-//
-// public event EventHandler PopUp {
-//
-// throw new NotImplementedException ();
-// }
-//
-// public event EventHandler Select {
-//
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuMerge.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuMerge.cs
deleted file mode 100644
index 0b77357eacc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MenuMerge.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.MenuMerge.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum MenuMerge {
- Add = 0,
- MergeItems = 2,
- Remove = 3,
- Replace = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Message.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Message.cs
deleted file mode 100644
index 51feab2db62..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Message.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// System.Drawing.Message.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-//TODO uncomment and implment GetLParam.
-using System;
-
-namespace System.Windows.Forms {
- [Serializable]
- public struct Message {
-
- private int msg;
- private intptr hwnd;
- private intptr lparam;
- private intptr wparam;
- private intptr result;
-
-
- // -----------------------
- // Public Shared Members
- // -----------------------
-
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Message objects. The return value is
- /// based on the equivalence of the Msg, HWnd, LParam,
- /// WParam, and Result properties of the two objects.
- /// </remarks>
-
- public static bool operator == (Message msg_a,
- Message msg_b)
- {
- return ((msg_a.msg == msg_b.msg) &&
- (msg_a.hwnd == msg_b.hwnd) &&
- (msg_a.lparam == msg_b.lparam) &&
- (msg_a.wparam == msg_b.wparam) &&
- (msg_a.result == msg_b.result));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two Message objects. The return value is
- /// based on the equivalence of the Msg, HWnd, LParam,
- /// WParam, and Result properties of the two objects.
- /// </remarks>
-
- public static bool operator != (Message msg_a,
- Message msg_b) {
- return ((msg_a.msg != msg_b.msg) ||
- (msg_a.hwnd != msg_b.hwnd) ||
- (msg_a.lparam != msg_b.lparam) ||
- (msg_a.wparam != msg_b.wparam) ||
- (msg_a.result != msg_b.result));
- }
-
- // -----------------------
- // Public Instance Members
- // -----------------------
-
- public int Msg {
- get{
- return msg;
- }
- set{
- msg = value;
- }
- }
-
- public intptr HWnd {
- get{
- return hwnd;
- }
- set{
- hwnd = value;
- }
- }
-
- public intptr LParam {
- get{
- return lparam;
- }
- set{
- lparam = value;
- }
- }
-
- public intptr WParam {
- get{
- return wparam;
- }
- set{
- wparam = value;
- }
- }
-
- public intptr Result {
- get{
- return result;
- }
- set{
- result = value;
- }
- }
-
- public static Message create(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam){
- NewMessage = new Message();
- NewMessage.msg = msg;
- NewMessage.wparm = wparam;
- NewMessage.lparam = lparam;
- NewMessage.hWnd = hWnd;
- return NewMessage;
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this Message and another object.
- /// </remarks>
-
- public override bool Equals (object o)
- {
- if (!(o is Message))
- return false;
-
- return (this == (Message) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
-
- public override int GetHashCode ()
- {
- return (int)( msg ^ lparam ^ wparam ^ result ^ whnd);
- }
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the Message as a string.
- /// </remarks>
-
- public override string ToString ()
- {
- return String.Format ("[{0},{1},{2},{3},{4}]", msg.ToString, lparam.ToString, wparam.ToString, result.ToString, whnd.ToString);
- }
-
-// public object GetLParam(Type cls){
-// // throw new NotImplementedException ();
-// //return (object) lparam;
-// }
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxButtons.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxButtons.cs
deleted file mode 100644
index cc0fa0dfaaf..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxButtons.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.MessageBoxButtons.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
-public enum MessageBoxButtons {
- AbortRetryIgnore = 2,
- OK = 0,
- OKCancel = 1,
- RetryCancel = 5,
- YesNo = 4,
- YesNoCancel = 3
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxDefaultButton.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxDefaultButton.cs
deleted file mode 100644
index cb3357d39fc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxDefaultButton.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.MessageBoxDefaultButton.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum MessageBoxDefaultButton {
- Button1 = 0,
- Button2 = 256,
- Button3 = 512
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxIcon.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxIcon.cs
deleted file mode 100644
index 43f05fc767a..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxIcon.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Windows.Forms.MessageBoxIcon.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum MessageBoxIcon {
- Asterisk = 64,
- Error = 16,
- Exclamation = 48,
- Hand = 16,
- Information = 64,
- None = 0,
- Question = 32,
- Stop = 16,
- Warning = 48
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxOptions.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxOptions.cs
deleted file mode 100644
index 57a638335d2..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MessageBoxOptions.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.MessageBoxOptions.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum MessageBoxOptions {
- DefaultDesktopOnly = 131072,
- RightAlign = 524288,
- RtlReading = 1048576,
- ServiceNotification = 2097152
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MethodInvoker.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MethodInvoker.cs
deleted file mode 100644
index 96b0ac9472d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MethodInvoker.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.MethodInvoker.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that handles the Invoke event for a method.
- /// </summary>
- [Serializable]
- public delegate void MethodInvoker();
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
deleted file mode 100644
index 9aaecae3dc5..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
+++ /dev/null
@@ -1,2089 +0,0 @@
-////
-//// System.Windows.Forms.MonthCalendar.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class MonthCalendar : Control {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public MonthCalendar()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public void AddAnnuallyBoldedDate(DateTime date)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void AddBoldedDate(DateTime date)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void AddMonthlyBoldedDate(DateTime date)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void RemoveAllAnnuallyBoldedDates()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void BringToFront()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void CreateControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Hide()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate(Rectangle r)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate(Region rg)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate(Rectangle r, bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate(Region rg, bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void PerformLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void PerformLayout(Control ctl, string s)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void RemoveAllBoldedDates()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void RemoveAllMonthlyBoldedDates()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void RemoveAnnuallyBoldedDate(Datetime Date)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void RemoveBoldedDate(Datetime Date)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void RemoveMonthlyBoldedDate(Datetime Date)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResetBindings()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResetImeMode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResumeLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResumeLayout(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Scale(float ft)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Scale(float ft, float ft1)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Select()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SendToBack()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetBounds(int i, int i1, int i2, int i3)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetCalendarDimensions(int x, int y)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetDate(Datetime Date)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetSelectionRange(Datetime Date, Datetime Date1)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Show()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SuspendLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Update()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void UpdateBoldedDates()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public IAsyncResult BeginInvoke(Delegate dels)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public IAsyncResult BeginInvoke(Delegate dels, object[] objs)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool Contains(Control ctl)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Graphics CreateGraphics()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DragDropEffects DoDragDrop(object o, DragDropEffects dde)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object EndEnvoke(IAsyncResult asyncResult)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o, object o1)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Form FindForm()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool Focus()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Control GetChildAtPoint(Point pt)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public IContainerControl GetContainerControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public SelectionRange GetDisplayRange(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Control GetNextControl(Control ctl, bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public HitTestInfo HitTest(Point pt)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public HitTestInfo HitTest(int i, int i1)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object Invoke(Delegate d)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object Invoke(Delegate d, object[])
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Point PointToClient(Point pt)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Point PointToScreen(Point pt)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Rectangle RectangleToClient(Rectangle r)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Rectangle RectangleToScreen(Rectangle r)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool SelectNextControl(Control ctl, bool b, bool b1, bool b2, bool b3)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type reqType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool PreProcessMessage(ref Message msg)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void Refresh()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetBackColor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetCursor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetFont()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetForeColor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetRightToLeft()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetText()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void Select(bool b, bool b1)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public AccessibleObject AccessibilityObject {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleDefaultActionDescription {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleDescription {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleName {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public AccessibleRole AccessibleRole {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool AllowDrop {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual AnchorStyles Anchor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime[] AnnuallyBoldedDates {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override Color BackColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override Image BackgroundImage {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual BindingContext BindingContext {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public public DateTime[] BoldedDates {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Bottom {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Rectangle Bounds {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size CalendarDimensions {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CanFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CanSelect {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Capture {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CausesValidation {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Rectangle ClientRectangle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size ClientSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string CompanyName {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ContainsFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual ContextMenu ContextMenu {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control.ControlCollection Controls {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Created {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Cursor Cursor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ControlBindingsCollection DataBindings {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Rectangle DisplayRectangle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Disposing {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual DockStyle Dock {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Enabled {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Day FirstDayOfWeek {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool Focused {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Font Font {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override Color ForeColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IntPtr Handle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool HasChildren {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Height {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool InvokeRequired {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsAccessible {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsDisposed {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsHandleCreated {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Left {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Point Location {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime MaxDate {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int MaxSelectionCount {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime MinDate {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime[] MonthlyBoldedDates {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string Name {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control Parent {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string ProductName {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string ProductVersion {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool RecreatingHandle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Region Region {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Right {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual RightToLeft RightToLeft {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int ScrollChange {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime SelectionEnd {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public SelectionRange SelectionRange {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime SelectionStart {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowToday {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowTodayCircle {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowWeekNumbers {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size SingleMonthSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size Size {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int TabIndex {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool TabStop {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public object Tag {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override string Text {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Color TitleBackColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Color TitleForeColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime TodayDate {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool TodayDateSet {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Top {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control TopLevelControl {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Color TrailingForeColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Visible {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Width {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected override void CreateHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected bool GetStyle(ControlStyles flag)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected bool GetTopLevel()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override bool IsInputKey(Keys KeyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override void OnBackColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override void OnHandleCreated(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected internal virtual bool ProcessKeyMessage(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected ContentAlignment RtlTranslateAlignment(ContentAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected ContentAlignment RtlTranslateContent(ContentAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected HorizontalAlignment RtlTranslateHorizontal(HorizontalAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected LeftRightAlignment RtlTranslateLeftRight(LeftRightAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override void WndProc(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void Dispose(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void InitLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBackgroundImageChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBindingContextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCausesValidationChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnChangeUICues(UICuesEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnClick(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnContextMenuChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnControlAdded(ControlEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnControlRemoved(ControlEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCreateControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCursorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDateChanged(DateRangeEventArgs drevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDateSelected(DateRangeEventArgs drevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDockChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDoubleClick(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragDrop(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragEnter(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragOver(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnEnabledChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnEnter(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnFontChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnForeColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnGiveFeedback(GiveFeedbackEventArgs gfbevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnGotFocus(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHandleDestroyed(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHelpRequested(HelpEventArgs hevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnImeModeChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnInvalidated(InvalidateEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyDown(KeyEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyPress(KeyPressEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void void OnKeyUp(KeyEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLayout(LayoutEventArgs levent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLocationChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLostFocus(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseDown(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseEnter(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseHover(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseMove(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseUp(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseWheel(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMove(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnNotifyMessage(Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnPaint(PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnPaintBackground(PaintEventArgs pevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBackColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBackgroundImageChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBindingContextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentEnabledChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentFontChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentForeColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentRightToLeftChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentVisibleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnResize(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnRightToLeftChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnSizeChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnStyleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnSystemColorsChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTabIndexChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTabStopChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnValidated(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnValidating(CancelEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnVisibleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void ScaleCore(float dx,float dy)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void Select(bool b, bool b1)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetClientSizeCore(int x, int y)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetVisibleCore(bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void AccessibilityNotifyClients(AccessibleEvents accEvent, int i)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeGotFocus(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeLostFocus(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeOnClick(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokePaint(Control c, PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokePaintBackground(Control c, PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void RecreateHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void SetStyle(ControlStyles flag, bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void SetTopLevel(bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds(int, int, int, int);
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds(int, int, int, int, int, int);
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateStyles()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateZOrder()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual AccessibleObject CreateAccessibilityInstance()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual ControlCollection CreateControlsInstance()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void DefWndProc(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void DestroyHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool IsInputChar(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessCmdKey(ref Message msg, Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessDialogChar(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessDialogKey(Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessKeyEventArgs(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessKeyPreview(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessMnemonic(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected override CreateParams CreateParams {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected override ImeMode DefaultImeMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected override Size DefaultSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool ResizeRedraw {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandlerList Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool ShowKeyboardCues {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected int FontHeight {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected virtual bool ShowFocusCues {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler BackColorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler BackgroundImageChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler BindingContextChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler CausesValidationChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event UICuesEventHandler ChangeUICues {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ContextMenuChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event ControlEventHandler ControlAdded {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event ControlEventHandler ControlRemoved {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler CursorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DateRangeEventHandler DateChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DateRangeEventHandler DateSelected {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DockChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DragEventHandler DragDrop {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DragEventHandler DragEnter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DragLeave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DragEventHandler DragOver {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler EnabledChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Enter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler FontChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ForeColorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event GiveFeedbackEventHandler GiveFeedback {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler GotFocus {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HandleCreated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HandleDestroyed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event HelpEventHandler HelpRequested {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ImeModeChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event InvalidateEventHandler Invalidated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event KeyEventHandler KeyDown {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event KeyPressEventHandler KeyPress {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event KeyEventHandler KeyUp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event LayoutEventHandler Layout {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Leave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler LocationChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler LostFocus {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseDown {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseEnter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseHover {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseLeave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseMove {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseUp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseWheel {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Move {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ParentChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event QueryContinueDragEventHandler QueryContinueDrag {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Resize {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler RightToLeftChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler SizeChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler StyleChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler SystemColorsChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TabIndexChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TabStopChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TextChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Validated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event CancelEventHandler Validating {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler VisibleChanged {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~MonthCalendar()
-// {
-// throw new NotImplementedException ();
-// }
-////
-//// System.Windows.Forms.MonthCalendar.HitTestInfo.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public sealed class MonthCalendar.HitTestInfo {
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public MonthCalendar.HitArea HitArea {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Point Point {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public DateTime Time {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual bool Equals(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// public protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~MonthCalendar.HitTestInfo()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseButtons.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseButtons.cs
deleted file mode 100644
index 0e2a1628b69..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseButtons.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.MouseButtons.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum MouseButtons {
- Left = 1048576,
- Middle = 4194304,
- None = 0,
- Right = 2097152,
- XButton1 = 8388608,
- XButton2 = 16777216
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventArgs.cs
deleted file mode 100644
index 8304124424c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventArgs.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-////
-//// System.Windows.Forms.MouseEventArgs.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class MouseEventArgs : EventArgs {
-//
-// [MonoTODO]
-// public MouseEventArgs()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public MouseEventArgs(MouseButtons button, int clicks, int x, int y, int delta)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public MouseButtons Button {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Clicks {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Delta {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int X {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Y {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual bool Equals(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~MouseEventArgs()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventHandler.cs
deleted file mode 100644
index d5759b99555..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/MouseEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.MouseEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the MouseDown, MouseUp, or MouseMove
- /// event of a form, control, or other component.
- /// </summary>
- [Serializable]
- public delegate void MouseEventHandler(object sender, MouseEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventArgs.cs
deleted file mode 100644
index ad87204affe..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventArgs.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-////
-//// System.Windows.Forms.NavigateEventArgs.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class NavigateEventArgs : EventArgs {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public NavigateEventArgs(bool isForward)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public bool Forward {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-// //
-// // --- DeConstructor
-// //
-// [MonoTODO]
-// ~NavigateEventArgs()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventHandler.cs
deleted file mode 100644
index 0bbe0e61edc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/NavigateEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.NavigateEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the NavigateEventArgs event of a DataGrid.
- /// </summary>
- [Serializable]
- public delegate void NavigateEventHandler(object sender, NavigateEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventArgs.cs
deleted file mode 100644
index 9d6d2b6f9f0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventArgs.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-////
-//// System.Windows.Forms.NodeLabelEditEventArgs.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class NodeLabelEditEventArgs : EventArgs {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public NodeLabelEditEventArgs(TreeNode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public NodeLabelEditEventArgs(TreeNode, string)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public bool CancelEdit {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string Label {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public TreeNode Node {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- DeConstructor
-// //
-// [MonoTODO]
-// ~NodeLabelEditEventArgs()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventHandler.cs
deleted file mode 100644
index 420f1040646..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/NodeLabelEditEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.NodeLabelEditEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the BeforeLabelEdit
- /// and AfterLabelEdit events of a TreeView control.
- /// </summary>
- [Serializable]
- public delegate void NodeLabelEditEventHandler(object sender, NodeLabelEditEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/NotifyIcon.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/NotifyIcon.cs
deleted file mode 100644
index 4d940d391a9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/NotifyIcon.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-////
-//// System.Windows.Forms.NotifyIcon.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public sealed class NotifyIcon : Component {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public NotifyIcon()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ContextMenu ContextMenu {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Icon Icon {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string Text {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Visible {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler Click {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DoubleClick {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseDown {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseMove {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseUp {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandlerList Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected virtual void Dispose(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- DeConstructor
-// //
-// [MonoTODO]
-// ~NotifyIcon()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/NumericUpDown.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/NumericUpDown.cs
deleted file mode 100644
index b7f71735a92..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/NumericUpDown.cs
+++ /dev/null
@@ -1,2001 +0,0 @@
-////
-//// System.Windows.Forms.NumericUpDown.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class NumericUpDown : UpDownBase, ISupportInitialize {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public NumericUpDown()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public AccessibleObject AccessibilityObject {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleDefaultActionDescription {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleDescription {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleName {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public AccessibleRole AccessibleRole {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control ActiveControl {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool AllowDrop {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual AnchorStyle Anchor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool AutoScroll {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size AutoScrollMargin {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size AutoScrollMinSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Point AutoScrollPosition {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Color BackColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Image BackgroundImage {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual BindingContext BindingContext {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public BorderStyle BorderStyle {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Bottom {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Rectangle Bounds {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CanFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CanSelect {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Capture {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CausesValidation {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Rectangle ClientRectangle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size ClientSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string CompanyName {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ContainsFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual ContextMenu ContextMenu {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control.ControlCollection Controls {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Created {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Cursor Cursor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ControlBindingsCollection DataBindings {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int DecimalPlaces {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Rectangle DisplayRectangle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Disposing {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual DockStyle Dock {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ScrollableControl.DockPaddingEdges DockPadding {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Enabled {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool Focused {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Font Font {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Color ForeColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IntPtr Handle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool HasChildren {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Height {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Hexadecimal {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ImeMode ImeMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public decimal Increment {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool InterceptArrowKeys {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool InvokeRequired {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsAccessible {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsDisposed {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsHandleCreated {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Left {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Point Location {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public decimal Maximum {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public decimal Minimum {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string Name {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control Parent {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Form ParentForm {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int PreferredHeight {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string ProductName {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string ProductVersion {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ReadOnly {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool RecreatingHandle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Region Region {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Right {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual RightToLeft RightToLeft {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size Size {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int TabIndex {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool TabStop {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public object Tag {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override string Text {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public HorizontalAlignment TextAlign {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ThousandsSeparator {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Top {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control TopLevelControl {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public LeftRightAlignment UpDownAlign {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public decimal Value {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Visible {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Width {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public IAsyncResult BeginInvoke(Delegate)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public IAsyncResult BeginInvoke(Delegate, object[])
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void BringToFront()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool Contains(Control ctl)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void CreateControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Graphics CreateGraphics()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DragDropEffects DoDragDrop(object data, DragDropEffects allowedEffects)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void DownButton()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object EndInvoke(IAsyncResult asyncResult)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Form FindForm()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool Focus()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Control GetChildAtPoint(Point pt)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public IContainerControl GetContainerControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Control GetNextControl(Control ctl, bool forward)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Hide()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object Invoke(Delegate)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void PerformLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void PerformLayout(Control ctl, string s)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Point PointToClient(Point p)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Point PointToScreen(Point p)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool PreProcessMessage(ref Message msg)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Rectangle RectangleToClient(Rectangle r)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Rectangle RectangleToScreen(Rectangle r)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void Refresh()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetBackColor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResetBindings()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetCursor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetFont()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetForeColor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResetImeMode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetRightToLeft()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetText()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResumeLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResumeLayout(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Scale(float flt)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Scale(float flt, float flt1)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Select(int x, int y)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Select()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool SelectNextControl(Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SendToBack()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetAutoScrollMargin(int x, int y)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetBounds(int x, int y, int w, int l)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetBounds(int x, int y, int w, int l, BoundsSpecified)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Show()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SuspendLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void UpButton()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Update()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public vool Validate()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler BackColorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler BackgroundImageChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler BindingContextChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler CausesValidationChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Click {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ContextMenuChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler CursorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DockChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DoubleClick {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DragLeave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler EnabledChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Enter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler FontChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ForeColorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler GotFocus {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HandleCreated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HandleDestroyed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ImeModeChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Leave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler LocationChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler LostFocus {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseEnter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseHover {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseLeave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Move {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ParentChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Resize {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler RightToLeftChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler SizeChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler StyleChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler SystemColorsChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TabIndexChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TabStopChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TextChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Validated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler VisibleChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event CancelEventHandler Validating {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event QueryContinueDragEventHandler QueryContinueDrag {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event PaintEventHandler Paint {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event UICueeEventHandler ChangeUICues {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event ControlEventHandler ControlAdded {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event ControlEventHandler ControlRemoved {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DragEventHandler DragDrop {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DragEventHandler DragEnter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event DragEventHandler DragOver {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event GiveFeedbackEventHandler GiveFeedback {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event HelpEventHandler HelpRequested {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event InvalidateEventHandler Invalidated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event KeyEventHandler KeyDown {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event KeyPressEventHandler KeyPress {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event KeyEventHandler KeyUp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event LayoutEventHandler Layout {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseDown {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseMove {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseUp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event MouseEventHandler MouseWheel {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected bool ChangingText {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected virtual CreateParame CreateParams {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected virtual ImeMode DefaultImeMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected virtual Size DefaultSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandler Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected int FontHeight {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool HScroll {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool ResizeRedraw {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected virtual bool ShowFocusCues {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool ShowKeyboardCues {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool UserEdit {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool VScroll {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected ContentAlignment RtlTranslateAlignment(ContentAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected ContentAlignment RtlTranslateContent(ContentAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected HorizontalAlignment RtlTranslateHorizontal(HorizontalAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected LeftRightAlignment RtlTranslateLeftRight(LeftRightAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void Dispose(bool b)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void Select(bool b, bool b1)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void AccessibilityNotifyClients(AccessibleEvents accEvent, int childID)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void AdjustFormScrollBars(bool displayScrollbars)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override AccessibleObject CreateAccessibilityInstance()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual ControlCollection CreateControlsInstance()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void CreateHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void DefWndProc(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void DestroyHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected bool GetStyle(ControlStyles flag)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected bool GetTopLevel()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void InitLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeGotFocus(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeLostFocus(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeOnClick(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokePaint(Control c, PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokePaintBackground(Control c, PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool IsInputChar(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool IsInputKey(Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override void UpdateEditText()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateStyles()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateZOrder()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override void ValidateEditText()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void WndProc(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBackColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBackgroundImageChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBindingContextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCausesValidationChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnChangeUICues(UICuesEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnClick(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnContextMenuChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnControlAdded(ControlEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnControlRemoved(ControlEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCreateControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCursorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDockChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDoubleClick(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragDrop(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragEnter(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragOver(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnEnabledChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnEnter(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnFontChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnForeColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnGiveFeedback(GiveFeedbackEventArgs gfbevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnGotFocus(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHandleCreated(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHandleDestroyed(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHelpRequested(HelpEventArgs hevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnImeModeChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnInvalidated(InvalidateEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyDown(KeyEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyPress(KeyPressEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyUp(KeyEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLayout(LayoutEventArgs levent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLocationChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLostFocus(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseDown(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseEnter(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseHover(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseMove(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseUp(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseWheel(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMove(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnNotifyMessage(Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnPaint(PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnPaintBackground(PaintEventArgs pevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBackColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBackgroundImageChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBindingContextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentEnabledChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentFontChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentForeColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentRightToLeftChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentVisibleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnResize(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnRightToLeftChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnSizeChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnStyleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnSystemColorsChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTabIndexChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTabStopChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextBoxKeyDown(object source, KeyEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextBoxKeyPress(object source, KeyPressEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextBoxLostFocus(object source, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextBoxResize(object source, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextBoxTextChanged(object source, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnValidated(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnValidating(CancelEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnValueChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnVisibleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetClientSizeCore(int x, int y)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetVisibleCore(bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void ParseEditText()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void RecreateHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void SetTopLevel(bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds(int, int, int, int)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds(int, int, int, int, int, int)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessCmdKey(ref Message msg, Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessDialogChar(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessDialogKey(Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessKeyEventArgs(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessKeyPreview(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessMnemonic(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessTabKey(bool forward)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual ScaleCore(float dx, float dy)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual SetStyle(ControlStyles flag, bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected internal virtual bool ProcessKeyMessage(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~NumericUpDown()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/OSFeature.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/OSFeature.cs
deleted file mode 100644
index ec4e0bab393..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/OSFeature.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-////
-//// System.Windows.Forms.OSFeature.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class OSFeature : FeatureSupport {
-//
-// //
-// // --- Public Fields
-// //
-// [MonoTODO]
-// public static readonly object LayeredWindows {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static readonly object Themes {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public static OSFeature Feature {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override Version GetVersionPresent(object feature)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool IsPresent(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool IsPresent(object o, Version v)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~OSFeature()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/OpacityConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/OpacityConverter.cs
deleted file mode 100644
index 3384eee0ee7..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/OpacityConverter.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-////
-//// System.Windows.Forms.OpacityConverter.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class OpacityConverter : TypeConverter {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public OpacityConverter()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public bool CanConvertFrom(Type)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool CanConvertTo(Type)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object ConvertFrom(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object ConvertFromInvariantString(string)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object ConvertFromString(string)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object ConvertFromString(ITypeDescriptorContext, string)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object ConvertFromString(ITypeDescriptorContext, CultureInfo, string)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object ConvertTo(object, Type)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public string ConvertToInvariantString(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public string ConvertToInvariantString(ITypeDescriptorContext, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public string ConvertToString(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public string ConvertToString(ITypeDescriptorContext, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public string ConvertToString(ITypeDescriptorContext, CultureInfo, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object CreateInstance(IDictionary)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object CreateInstance(ITypeDescriptorContext, IDictionary)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool GetCreateInstanceSupported()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool GetCreateInstanceSupported(ITypeDescriptorContext)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public PropertyDescriptorCollection GetProperties(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public PropertyDescriptorCollection GetProperties(ITypeDescriptorContext, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual PropertyDescriptorCollection GetProperties(ITypeDescriptorContext, object, Attribute[])
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool GetPropertiesSupported()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool GetPropertiesSupported(ITypeDescriptorContext)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public ICollection GetStandardValues()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual StandardValuesCollection GetStandardValues(ITypeDescriptorContext)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool GetStandardValuesExclusive()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool GetStandardValuesExclusive(ITypeDescriptorContext)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool GetStandardValuesSupported()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool GetStandardValuesSupported(ITypeDescriptorContext)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool IsValid(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool IsValid(ITypeDescriptorContext, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool IsValid(object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool IsValid(ITypeDescriptorContext, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override bool CanConvertFrom(ITypeDescriptorContext, Type)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override object ConvertFrom(ITypeDescriptorContext, CultureInfo, object)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override object ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected Exception GetConvertFromException(object value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected Exception GetConvertToException(object value, Type destinationType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected PropertyDescriptorCollection {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected SortProperties(PropertyDescriptorCollection props, string[] names)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~OpacityConverter()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/OpenFileDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/OpenFileDialog.cs
deleted file mode 100644
index 4f933517b2e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/OpenFileDialog.cs
+++ /dev/null
@@ -1,354 +0,0 @@
-////
-//// System.Windows.Forms.OpenFileDialog.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public sealed class OpenFileDialog : FileDialog {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public OpenFileDialog()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string DefaultExt {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string FileName {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string[] FileNames {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string Filter {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int FilterIndex {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string InitialDirectory {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string Title {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool AddExtension {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CheckPathExists {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool DereferenceLinks {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Multiselect {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ReadOnlyChecked {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool RestoreDirectory {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowHelp {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowReadOnly {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ValidateNames {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override bool CheckFileExists {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Stream OpenFile()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void Reset()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DialogResult ShowDialog()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DialogResult ShowDialog(IWin32Window)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event CancelEventHandler FileOk {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HelpRequest {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandlerList Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected virtual void Dispose(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHelpRequest(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual IntPtr HookProc(InPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual IntPtr OwnerWndProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void OnFileOk(CancelEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected abstract bool RunDialog(IntPtr hwndOwner)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~OpenFileDialog()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Orientation.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Orientation.cs
deleted file mode 100644
index eff93094a95..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Orientation.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.Orientation.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum Orientation {
- Horizontal = 0,
- Vertical = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PageSetupDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PageSetupDialog.cs
deleted file mode 100644
index 3795428a43b..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PageSetupDialog.cs
+++ /dev/null
@@ -1,274 +0,0 @@
-////
-//// System.Windows.Forms.PageSetupDialog.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public sealed class PageSetupDialog : CommonDialog {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public PageSetupDialog()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public bool AllowMargins {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool AllowOrientation {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool AllowPaper {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool AllowPrinter {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowHelp {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowNetwork {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public PrintDocument Document {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Margins MinMargins {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public PageSettings PageSettings {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public PrinterSettings PrinterSettings {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void Reset()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DialogResult ShowDialog()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DialogResult ShowDialog(IWin32Window)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HelpRequest {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandlerList Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected virtual void Dispose(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHelpRequest(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual IntPtr OwnerWndProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override bool RunDialog(IntPtr hwndOwner)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~PageSetupDialog()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventArgs.cs
deleted file mode 100644
index b07bf376cf6..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventArgs.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-////
-//// System.Windows.Forms.PaintEventArgs.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class PaintEventArgs : EventArgs, IDisposable {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public PaintEventArgs()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public Rectangle ClipRectangle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Graphics Graphics {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected virtual void Dispose(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~PaintEventArgs()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventHandler.cs
deleted file mode 100644
index eda39e995f7..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PaintEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.PaintEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the Paint event of a Control class.
- /// </summary>
- [Serializable]
- public delegate void PaintEventHandler(object sender, PaintEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Panel.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Panel.cs
deleted file mode 100644
index 08f78ee0647..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Panel.cs
+++ /dev/null
@@ -1,1756 +0,0 @@
-////
-//// System.Windows.Forms.Panel.cs
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class Panel : ScrollableControl {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public Panel()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public AccessibleObject AccessibilityObject {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleDefaultActionDescription {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleDescription {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string AccessibleName {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public AccessibleRole AccessibleRole {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool AllowDrop {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual AnchorStyles Anchor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool AutoScroll {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size AutoScrollMargin {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size AutoScrollMinSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Point AutoScrollPosition {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Color BackColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Image BackgroundImage {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual BindingContext BindingContext {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public BorderStyle BorderStyle {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Bottom {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Rectangle Bounds {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CanFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CanSelect {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Capture {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool CausesValidation {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Rectangle ClientRectangle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Size ClientSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string CompanyName {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ContainsFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual ContextMenu ContextMenu {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control.ControlCollection Controls {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Created {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Cursor Cursor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ControlBindingsCollection DataBindings {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Rectangle DisplayRectangle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Disposing {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual DockStyle Dock {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ScrollableControl.DockPaddingEdges DockPadding {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Enabled {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual bool Focused {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Font Font {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual Color ForeColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IntPtr Handle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool HasChildren {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Height {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public ImeMode ImeMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool InvokeRequired {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsAccessible {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsDisposed {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool IsHandleCreated {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Left {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Point Location {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string Name {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control Parent {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string ProductName {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public string ProductVersion {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool RecreatingHandle {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Region Region {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Right {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual RightToLeft RightToLeft {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int TabIndex {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public object Tag {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public override string Text {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Top {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public Control TopLevelControl {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool Visible {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public int Width {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public IAsyncResult BeginInvoke(Delegate)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public IAsyncResult BeginInvoke(Delegate, object[])
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void BringToFront()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool Contains(Control ctl)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void CreateControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Graphics CreateGraphics()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DragDropEffects DoDragDrop(object data, DragDropEffects allowedEffects)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object EndInvoke(IAsyncResult asyncResult)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Form FindForm()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool Focus()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Control GetChildAtPoint(Point pt)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public IContainerControl GetContainerControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetNextControl(Control ctl, bool forward)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Hide()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Invalidate(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void PerformLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void PerformLayout(Control, string)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Point PointToClient(Point p)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Point PointToScreen(Point p)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool PreProcessMessage(ref Message msg)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Rectangle RectangleToClient(Rectangle r)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Rectangle RectangleToScreen(Rectangle r)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void Refresh()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetBackColor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResetBindings()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetCursor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetFont()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetForeColor()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResetImeMode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetRightToLeft()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual void ResetText()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResumeLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void ResumeLayout(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Scale(float)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Scale(float, float)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Select()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public bool SelectNextControl(Control ctl, bool forward, bool tabStopOnly,bool nested, bool wrap)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SendToBack()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetAutoScrollMargin(int x, int y)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetBounds(int, int, int, int)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SetBounds(int, int, int, int, BoundsSpecified)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Show()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void SuspendLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Update()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler BackColorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler BackgroundImageChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler BindingContextChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler CausesValidationChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Click {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ContextMenuChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler CursorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DockChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DoubleClick {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler DragLeave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler EnabledChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Enter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler FontChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ForeColorChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler GotFocus {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HandleCreated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HandleDestroyed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ImeModeChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Leave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler LocationChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler LostFocus {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseEnter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseHover {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler MouseLeave {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Move {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler ParentChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Resize {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler RightToLeftChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler SizeChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler StyleChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler SystemColorsChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TabIndexChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TabStopChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler TextChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler Validated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler VisibleChanged {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public UICuesEventHandler ChangeUICues {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public ControlEventHandler ControlAdded {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public ControlEventHandler ControlRemoved {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DragEventHandler DragDrop {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DragEventHandler DragEnter {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DragEventHandler DragOver {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public GiveFeedbackEventHandler GiveFeedback {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public HelpEventHandler HelpRequested {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public InvalidateEventHandler Invalidated {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public LayoutEventHandler Layout {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public MouseEventHandler MouseDown {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public MouseEventHandler MouseMove {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public MouseEventHandler MouseUp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public MouseEventHandler MouseWheel {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public PaintEventHandler Paint {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public QueryAccessibilityHelpEventHandler QueryAccessibilityHelp {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public QueryContinueDragEventHandler QueryContinueDrag {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public CancelEventHandler Validating {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected override CreateParams CreateParams {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected virtual ImeMode DefaultImeMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected override Size DefaultSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandlerList Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected int FontHeight {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool HScroll {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool ResizeRedraw {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected virtual bool ShowFocusCues {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool ShowKeyboardCues {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected bool VScroll {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected virtual void Dispose(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void Select(bool, bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void AccessibilityNotifyClients(AccessibleEvents accEvent, int childID)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void AdjustFormScrollbars(bool displayScrollbars)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual AccessibleObject CreateAccessibilityInstance()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual ControlCollection CreateControlsInstance()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void CreateHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void DefWndProc(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void DestroyHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected bool GetStyle(ControlStyles flag)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected bool GetTopLevel()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void InitLayout()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeGotFocus(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeLostFocus(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokeOnClick(Control toInvoke, EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokePaint(Control c, PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void InvokePaintBackground(Control c, PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool IsInputChar(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool IsInputKey(Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBackColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBackgroundImageChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnBindingContextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCausesValidationChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnChangeUICues(UICuesEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnClick(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnContextMenuChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnControlAdded(ControlEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnControlRemoved(ControlEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCreateControl()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnCursorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDockChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDoubleClick(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragDrop(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragEnter(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnDragOver(DragEventArgs drgevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnEnabledChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnEnter(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnFontChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnForeColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnGiveFeedback(GiveFeedbackEventArgs gfbevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnGotFocus(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHandleCreated(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHandleDestroyed(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHelpRequested(HelpEventArgs hevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnImeModeChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnInvalidated(InvalidateEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyDown(KeyEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyPress(KeyPressEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnKeyUp(KeyEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLayout(LayoutEventArgs levent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLocationChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnLostFocus(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseDown(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseEnter(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseHover(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseLeave(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseMove(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseUp(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMouseWheel(MouseEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnMove(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnNotifyMessage(Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnPaint(PaintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnPaintBackground(PaintEventArgs pevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBackColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBackgroundImageChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentBindingContextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentEnabledChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentFontChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentForeColorChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentRightToLeftChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnParentVisibleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override void OnResize(EventArgs eventargs)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnRightToLeftChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnSizeChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnStyleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnSystemColorsChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTabIndexChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTabStopChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnTextChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnValidated(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnValidating(CancelEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnVisibleChanged(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessCmdKey(ref Message msg, Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessDialogChar(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessDialogKey(Keys keyData)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessKeyEventArgs(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected internal virtual bool ProcessKeyMessage(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessKeyPreview(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual bool ProcessMnemonic(char charCode)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void RecreateHandle()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected ContentAlignment RtlTranslateAlignment(ContentAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected ContentAlignment RtlTranslateContent(ContentAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected HorizontalAlignment RtlTranslateHorizontal(HorizontalAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected LeftRightAlignment RtlTranslateLeftRight(LeftRightAlignment align)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void ScaleCore(float dx, float dy)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetBoundsCore(int x, int y, int width, int height,BoundsSpecified specified)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetClientSizeCore(int x, int y)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void SetStyle(ControlStyles flag, bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void SetTopLevel(bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void SetVisibleCore(bool value)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds(int, int, int, int)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateBounds(int, int, int, int, int, int)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateStyles()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected void UpdateZOrder()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void WndProc(ref Message m)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // -- Destructor
-// //
-//
-// [MonoTODO]
-// ~Panel()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PictureBoxSizeMode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PictureBoxSizeMode.cs
deleted file mode 100644
index 4dd862756a5..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PictureBoxSizeMode.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.PictureBoxSizeMode.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum PictureBoxSizeMode {
- AutoSize = 2,
- CenterImage = 3,
- Normal = 0,
- StretchImage = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
deleted file mode 100644
index c28b26cf185..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-////
-//// System.Windows.Forms.PrintControllerWithStatusDialog
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public class PrintControllerWithStatusDialog : PrintController {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public PrintControllerWithStatusDialog(PrintController)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public PrintControllerWithStatusDialog(PrintController, string)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void OnEndPage(PrintDocument document, PrintPageEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void OnEndPrint(PrintDocument document, PrintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void OnStartPrint(PrintDocument document, PrintEventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~PrintControllerWithStatusDialog()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PrintDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PrintDialog.cs
deleted file mode 100644
index 8d6f93e74b4..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PrintDialog.cs
+++ /dev/null
@@ -1,261 +0,0 @@
-////
-//// System.Windows.Forms.PrintDialog
-////
-//// Author:
-//// stubbed out by Paul Osman (paul.osman@sympatico.ca)
-////
-//// (C) 2002 Ximian, Inc
-////
-//
-//namespace System.Windows.Forms {
-//
-// // <summary>
-// // This is only a template. Nothing is implemented yet.
-// //
-// // </summary>
-//
-// public sealed class PrintDialog : CommonDialog {
-//
-// //
-// // --- Constructor
-// //
-// [MonoTODO]
-// public PrintDialog()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Properties
-// //
-// [MonoTODO]
-// public bool AllowPrintToFile {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool AllowSelection {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool AllowSomePages {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public IContainer Container {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public PrintDocument Document {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public PrinterSettings PrinterSettings {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool PrintToFile {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowHelp {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public bool ShowNetwork {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// public virtual ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Public Methods
-// //
-// [MonoTODO]
-// public virtual ObjRef CreateObjRef(Type requestedType)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public void Dispose()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual bool Equals(object o)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public static bool Equals(object o1, object o2)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual int GetHashCode()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public Type GetType()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual string ToString()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public object GetLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public virtual object InitializeLifetimeService()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public override void Reset()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DialogResult ShowDialog()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public DialogResult ShowDialog(IWin32Window)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Public Events
-// //
-// [MonoTODO]
-// public event EventHandler Disposed {
-//
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// public event EventHandler HelpRequest {
-//
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Protected Properties
-// //
-// [MonoTODO]
-// protected bool DesignMode {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// [MonoTODO]
-// protected EventHandlerList Events {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// //
-// // --- Protected Methods
-// //
-// [MonoTODO]
-// protected virtual void Dispose(bool)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual object GetService(Type service)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected object MemberwiseClone()
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual void OnHelpRequest(EventArgs e)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected virtual IntPtr OwnerWndProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
-// {
-// throw new NotImplementedException ();
-// }
-// [MonoTODO]
-// protected override bool RunDialog(IntPtr hwndOwner)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// //
-// // --- Destructor
-// //
-// [MonoTODO]
-// ~PrintDialog()
-// {
-// throw new NotImplementedException ();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertySort.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertySort.cs
deleted file mode 100644
index 19c9dbbc9a6..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertySort.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.PropertySort.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum PropertySort {
- Alphabetical = 1,
- Categorized = 2,
- CategorizedAlphabetical = 3,
- NoSort = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyTabChangedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyTabChangedEventHandler.cs
deleted file mode 100644
index 2d08ca92785..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyTabChangedEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.PropertyTabChangedEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the PropertyTabChanged event of a PropertyGrid.
- /// </summary>
- [Serializable]
- public delegate void PropertyTabChangedEventHandler(object s, PropertyTabChangedEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyValueChangedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyValueChangedEventHandler.cs
deleted file mode 100644
index 70fe58a4c28..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/PropertyValueChangedEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.PropertyValueChangedEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// The event handler class that is invoked when
- /// a property in the grid is modified by the user.
- /// </summary>
- [Serializable]
- public delegate void PropertyValueChangedEventHandler(object s, PropertyValueChangedEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventArgs.cs
deleted file mode 100644
index 17ddb2e8102..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventArgs.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.Windows.Forms.QueryAccessibilityHelpEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class QueryAccessibilityHelpEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public QueryAccessibilityHelpEventArgs()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public QueryAccessibilityHelpEventArgs(string str1, string str2, string str3)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //[ComVisible(true)] public string HelpKeyword {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //[ComVisible(true)] public string HelpNamespace {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //[ComVisible(true)] public string HelpString {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventHandler.cs
deleted file mode 100644
index 952189efa08..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.QueryAccessibilityHelpEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the QueryAccessibilityHelp event of a control.
- /// </summary>
- [Serializable]
- public delegate void QueryAccessibilityHelpEventHandler(object sender, QueryAccessibilityHelpEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventArgs.cs
deleted file mode 100644
index ce634c60f8d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventArgs.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// System.Windows.Forms.QueryContinueDragEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class QueryContinueDragEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //[ComVisible(true)] public QueryContinueDragEventArgs(int keyState, book escapePressed, DragAction action)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //[ComVisible(true)] public DragAction Action {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //[ComVisible(true)] public bool EscapePressed {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //[ComVisible(true)] public int KeyState {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventHandler.cs
deleted file mode 100644
index 8c1eeba2eb8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/QueryContinueDragEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.QueryContinueDragEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the QueryContinueDrag event of a Control.
- /// </summary>
- [Serializable]
- public delegate void QueryContinueDragEventHandler(object sender, QueryContinueDragEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs
deleted file mode 100644
index 8edb8168eba..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RadioButton.cs
+++ /dev/null
@@ -1,320 +0,0 @@
-//
-// System.Windows.Forms.RadioButton.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class RadioButton : ButtonBase {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public RadioButton()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Appearance Appearance {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AutoCheck {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ContentAlignment CheckAlign {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Checked {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override ContentAlignment TextAlign {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegage del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegage del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformClick()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpecified bounds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public overriden string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler AppearanceChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler CheckedChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override ImeMode DefaultImeMode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override AccessableObject CreateAccessabilityInstance()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnCheckedChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnClick(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnEnter(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseUp(MouseEventArgs mevent)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool ProcessMnemonic(char charCode)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected ContentAlignment RtlTranslateAlignment(ContentAlignment calign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment halign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment lralign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs
deleted file mode 100644
index f4d159dec01..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs
+++ /dev/null
@@ -1,748 +0,0 @@
-//
-// System.Windows.Forms.RichTextBox.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class RichTextBox : TextBoxBase {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public RichTextBox()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override bool AllowDrop {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override bool AutoSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AutoWordSelection {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int BulletIndent {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool CanRedo {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool DetectUrls {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Font Font {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override int MaxLength {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override bool Multiline {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string RedoActionName {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int RightMargin {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Rtf {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public RichTextBoxScrollBars ScrollBars {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string SelectedRtf {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string SelectedText {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public HorizontalAlignment SelectionAlignment {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool SelectionBullet {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectionCharOffset {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color SelectionColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Font SelectionFont {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectionHangingIndent {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectionIndent {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override int SelectionLength {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool SelectionProtected {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectionRightIndent {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int[] SelectionTabs {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public RichTextBoxSelectionTypes SelectionType {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowSelectionMargin {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override int TextLength {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string UndoActionName {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public float ZoomFactor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CanPaste(DataFormats.Format clipFormat)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Find(char[] chars)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Find(string srt)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Find(char[] chars, int val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Find(string srt, RichTextBoxFinds finds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Find(char[] chars, int val1, int val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Find(string srt, int val, RichTextBoxFinds finds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Find(string srt, int val1, int val2, RichTextBoxFinds finds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public char GetCharFromPosition(Point pt)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int GetLineFromCharIndex(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Point GetPositionFromCharIndex(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegeta del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegeta del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void LoadFile(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void LoadFile(Stream str, RichTextBoxStreamType type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Paste()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Paste(DataFormats.Format format)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Redo()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SaveFile(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SaveFile(Stream str, RichTextBoxStreamType type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SaveFile(string str, RichTextBoxStreamType type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select(int val1, int val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpecified bounds)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event ContentsResizedEventHandler ContentsResized {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler HScroll {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler ImeChange {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event LinkClickedEventHandler LinkClicked {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler Protected {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler SelectionChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler VScroll {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected virtual object CreateRichTextEditOleCallback()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnBackColorChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnContentsResized(ContentsResizedEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnContextMenuChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleDestroyed(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnHScroll(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnImeChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnClicked(LinkClickedEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnProtected(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //protected override void OnRightToLeftChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnSelectionChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnSystemColorsChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnTextChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnVScroll(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected ContentAlignment RtlTranslateAlignment(ContentAlignment calign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment halign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment lralign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxFinds.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxFinds.cs
deleted file mode 100644
index 99792e41cbc..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxFinds.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Windows.Forms.RichTextBoxFinds.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum RichTextBoxFinds {
- MatchCase = 4,
- NoHighlight = 8,
- None = 0,
- Reverse = 16,
- WholeWord = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxScrollBars.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxScrollBars.cs
deleted file mode 100644
index fd1a0a5efdd..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxScrollBars.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Windows.Forms.RichTextBoxScrollBars.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum RichTextBoxScrollBars {
- Both = 3,
- ForcedBoth = 19,
- ForcedHorizontal = 17,
- ForcedVertical = 18,
- Horizontal = 1,
- None = 0,
- Vertical = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionAttribute.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionAttribute.cs
deleted file mode 100644
index d90dd10964c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.RichTextBoxSelectionAttribute.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum RichTextBoxSelectionAttribute {
- All = 1,
- Mixed = -1,
- None = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionTypes.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionTypes.cs
deleted file mode 100644
index a3031154599..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxSelectionTypes.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Windows.Forms.RichTextBoxSelectionTypes.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum RichTextBoxSelectionTypes {
- Empty = 0,
- MultiChar = 4,
- MultiObject = 8,
- Object = 2,
- Text = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxStreamType.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxStreamType.cs
deleted file mode 100644
index 949ff8d693a..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxStreamType.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Windows.Forms.RichTextBoxStreamType.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum RichTextBoxStreamType {
- RichNoOleObjs = 2,
- PlainText = 1,
- RichText = 0,
- TextTextOleObjs = 3,
- UnicodePlainText = 4
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxWordPunctuations.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxWordPunctuations.cs
deleted file mode 100644
index e310593f4b4..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBoxWordPunctuations.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.RichTextBoxWordPunctuations.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum RichTextBoxWordPunctuations {
- All = 896,
- Custom = 512,
- Level1 =128,
- Level2 = 256
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/RightToLeft.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/RightToLeft.cs
deleted file mode 100644
index bd7b9fb4a12..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/RightToLeft.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.RightToLeft.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum RightToLeft {
- Inherit = 2,
- No =0,
- Yes = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SaveFileDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SaveFileDialog.cs
deleted file mode 100644
index 7a911fd06f9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SaveFileDialog.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// System.Windows.Forms.SaveFileDialog.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public sealed class SaveFileDialog : FileDialog {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public SaveFileDialog()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool CreatePrompt {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool OverwritePrompt {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Stream OpenFile()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void Reset()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public DialogResult ShowDialog()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected virtual void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Screen.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Screen.cs
deleted file mode 100644
index ebb4bd0a724..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Screen.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.Windows.Forms.Screen.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class Screen {
-
- //
- // --- Public Properties
- //
-
- //[MonoTODO]
- //public static Screen[] AllScreens {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Rectangle Bounds {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string DeviceName {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Primary {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public static Screen PrimaryScreen {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Rectangle WorkingArea {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public override bool Equals(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static Screen FormControl(Control ctl)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static Screen FormHandle(IntPtr hwnd)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static Screen FormPoint(Point point)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static Screen FormRectangle(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static Rectangle GetBounds(Control ctl)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static Rectangle GetBounds(Point pt)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static Rectangle GetBounds(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override int GetHashCode()
- //{
- // throw new NotImplementedException ();
- //}
- //[Serializable]
- //[ClassInterface(ClassInterfaceType.AutoDual)]
- //[MonoTODO]
- //public Type GetType()
- //{
- // throw new NotImplementedException ();
- //}
-
- //[MonoTODO]
- //public static Rectangle GetWorkingArea(Control ctl)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBar.cs
deleted file mode 100644
index 8608e7b3217..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBar.cs
+++ /dev/null
@@ -1,333 +0,0 @@
-//
-// System.Windows.Forms.ScrollBar.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ScrollBar : Control {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ScrollBar()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override Color BackColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public new ImeMode ImeMode {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int LastChange {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Maximum {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Minimum {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SmallChange {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Value {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg, bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpecified bounds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event ScrollEventHandler Scroll {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event EventHandler ValueChanged {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //public override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override ImeMode DefaultImeMode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //public override void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void OnEnabledChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //ContentAlignment RtlTranslateAlignment(ContentAlignment calign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment halign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment lralign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void UpdateBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBars.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBars.cs
deleted file mode 100644
index 355b159bbfb..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollBars.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.ScrollBars.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ScrollBars {
- Both = 3,
- Horizontal = 1,
- None = 0,
- Vertical = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollButton.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollButton.cs
deleted file mode 100644
index 3d82228f457..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollButton.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Windows.Forms.ScrollButton.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ScrollButton {
- Down = 1,
- Left = 2,
- Max = 3,
- Min = 0,
- Right = 3,
- Up = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventArgs.cs
deleted file mode 100644
index 4d00a9c4d77..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventArgs.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Windows.Forms.ScrollEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ScrollEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public ScrollEventArgs(ScrollEventType type, int newVal)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int NewValue {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ScrollEventType Type {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventHandler.cs
deleted file mode 100644
index 05fe92b819f..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.ScrollEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that handles the Scroll
- /// event of a ScrollBar, TrackBar, or DataGrid.
- /// </summary>
- [Serializable]
- public delegate void ScrollEventHandler(object sender, ScrollEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventType.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventType.cs
deleted file mode 100644
index f40783b869d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollEventType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Windows.Forms.ScrollEventType.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ScrollEventType {
- EndScroll = 8,
- First = 6,
- LargeDecrement = 2,
- LargeIncrement = 3,
- Last = 7,
- SmallDecrement = 0,
- ThumbPosition = 4,
- SmallIncrement = 1,
- ThumbTrack = 5
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SecurityIDType.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SecurityIDType.cs
deleted file mode 100644
index a55978ce4fe..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SecurityIDType.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Windows.Forms.SecurityIDType.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum SecurityIDType {
- Alias = 4,
- Computer = 9,
- DeletedAccount = 6,
- Domain = 3,
- Group = 2,
- Invalid = 7,
- Unknown = 8,
- User = 1,
- WellKnownGroup = 5
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventArgs.cs
deleted file mode 100644
index 1e4ca6aeaf4..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventArgs.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Windows.Forms.SelectedGridItemChangedEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class SelectedGridItemChangedEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public SelectedGridItemChangedEventArgs(GridItem old, GridItem new)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public GridItem NewSelection {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public GridItem OldSelection {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventHandler.cs
deleted file mode 100644
index c9c86628a23..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectedGridItemChangedEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.SelectedGridItemChangedEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the SelectedGridItemChanged event of a PropertyGrid.
- /// </summary>
- [Serializable]
- public delegate void SelectedGridItemChangedEventHandler(object sender, SelectedGridItemChangedEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionMode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionMode.cs
deleted file mode 100644
index 6685e06bce8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionMode.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.SelectionMode.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum SelectionMode {
- MultiExtended = 3,
- MultiSimple = 2,
- None = 0,
- One = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRange.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRange.cs
deleted file mode 100644
index 18831b4c407..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRange.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.Windows.Forms.SelectionRange.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class SelectionRange {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public SelectionRange()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public SelectionRange(SelectionRange range)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public SelectionRange(DateTime time1,DateTime time2)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public DateTime End {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public DateTime Start {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRangeConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRangeConverter.cs
deleted file mode 100644
index fbdb1c77c25..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SelectionRangeConverter.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// System.Windows.Forms.SelectionRangeConverter.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class SelectionRangeConverter : TypeConverter {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public SelectionRangeConverter()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public bool CanConvertFrom(Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CanConvertFrom(ITypeDescriptorContext context, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CanConvertTo(Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CanConvertTo(ITypeDescriptorContext context, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFrom(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromInvariantString(ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromStrin(string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertFromStrin(ITypeDescriptorContext context, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object ConvertTo(object obj, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertTo( ITypeDescriptorContext context, CultureInfo culture, object obj, Type type)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToInvariantString(ITypeDescriptorContext context, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(ITypeDescriptorContext context, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public string ConvertToString(ITypeDescriptorContext context, CultureInfo culture, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object CreateInstance(IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object CreateInstance(ITypeDescriptorContext context, IDictionary dict)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool CreateInstanceSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool CreateInstanceSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties( object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public PropertyDescriptorCollection GetProperties( ITypeDescriptorContext context, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override PropertyDescriptorCollection GetProperties( ITypeDescriptorContext context, object obj, Attribute[] atts)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetPropertiesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override bool GetPropertiesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ICollection GetStandardValues()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual StandardVauesCollection GetStandardValues (ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesExclusive()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesExclusive(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool GetStandardValuesSupported()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool GetStandardValuesSupported(ITypeDescriptorContext context)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool IsValid(object obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool IsValid(ITypeDescriptorContext context, object obj)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SendKeys.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SendKeys.cs
deleted file mode 100644
index 6c1d0b0fe73..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SendKeys.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Windows.Forms.SendKeys.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class SendKeys {
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //static void Flush()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //static void Send(string keys)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //static void SendWait(string keys)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Shortcut.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Shortcut.cs
deleted file mode 100644
index 782b4f31cde..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Shortcut.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// System.Windows.Forms.Shortcut.cs
-//
-// Author:
-// Dennis Hayes = dennish@raytek.com,
-// = C, 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum Shortcut {
- Alt0 = 262192,
- Alt1 = 262193,
- Alt2 = 262194,
- Alt3 = 262195,
- Alt4 = 262196,
- Alt5 = 262197,
- Alt6 = 262198,
- Alt7 = 262199,
- Alt8 = 262200,
- Alt9 = 262201,
- AltBksp = 262152,
- AltF1 = 262256,
- AltF2 = 262257,
- AltF3 = 262258,
- AltF4 = 262259,
- AltF5 = 262260,
- AltF6 = 262261,
- AltF7 = 262262,
- AltF8 = 262263,
- AltF9 = 262264,
- AltF10 = 262265,
- AltF11 = 262266,
- AltF12 = 262267,
- Ctrl0 = 131120,
- Ctrl1 = 131121,
- Ctrl2 = 131122,
- Ctrl3 = 131123,
- Ctrl4 = 131124,
- Ctrl5 = 131125,
- Ctrl6 = 131126,
- Ctrl7 = 131127,
- Ctrl8 = 131128,
- Ctrl9 = 131129,
- CtrlA = 131137,
- CtrlB = 131138,
- CtrlC = 131139,
- CtrlD = 131140,
- CtrlDel = 131118,
- CtrlE = 131141,
- CtrlF = 131142,
- CtrlF1 = 131184,
- CtrlF2 = 131185,
- CtrlF3 = 131186,
- CtrlF4 = 131187,
- CtrlF5 = 131188,
- CtrlF6 = 131189,
- CtrlF7 = 131190,
- CtrlF8 = 131191,
- CtrlF9 = 131192,
- CtrlF10 = 131193,
- CtrlF11 = 131194,
- CtrlF12 = 131195,
- CtrlG = 131143,
- CtrlH = 131144,
- CtrlI = 131145,
- CtrlIns = 131117,
- CtrlJ = 131146,
- CtrlK = 131147,
- CtrlL = 131148,
- CtrlM = 131149,
- CtrlN = 131150,
- CtrlO = 131151,
- CtrlP = 131152,
- CtrlQ = 131153,
- CtrlR = 131154,
- CtrlS = 131155,
- CtrlT = 131156,
- CtrlU = 131157,
- CtrlV = 131158,
- CtrlW = 131159,
- CtrlX = 131160,
- CtrlY = 131161,
- CtrlZ = 131162,
- CtrlShift0 = 196656,
- CtrlShift1 = 196657,
- CtrlShift2 = 196658,
- CtrlShift3 = 196659,
- CtrlShift4 = 196660,
- CtrlShift5 = 196661,
- CtrlShift6 = 196662,
- CtrlShift7 = 196663,
- CtrlShift8 = 196664,
- CtrlShift9 = 196665,
- CtrlShiftA = 196673,
- CtrlShiftB = 196674,
- CtrlShiftC = 196675,
- CtrlShiftD = 196676,
- CtrlShiftE = 196677,
- CtrlShiftF = 196678,
- CtrlShiftF1 = 196720,
- CtrlShiftF2 = 196721,
- CtrlShiftF3 = 196722,
- CtrlShiftF4 = 196723,
- CtrlShiftF5 = 196724,
- CtrlShiftF6 = 196725,
- CtrlShiftF7 = 196726,
- CtrlShiftF8 = 196727,
- CtrlShiftF9 = 196728,
- CtrlShiftF10 = 196729,
- CtrlShiftF11 = 196730,
- CtrlShiftF12 = 196731,
- CtrlShiftG = 196679,
- CtrlShiftH = 196680,
- CtrlShiftI = 196681,
- CtrlShiftJ = 196682,
- CtrlShiftK = 196683,
- CtrlShiftL = 196684,
- CtrlShiftM = 196685,
- CtrlShiftN = 196686,
- CtrlShiftO = 196687,
- CtrlShiftP = 196688,
- CtrlShiftQ = 196689,
- CtrlShiftR = 196690,
- CtrlShiftS = 196691,
- CtrlShiftT = 196692,
- CtrlShiftU = 196693,
- CtrlShiftV = 196694,
- CtrlShiftW = 196695,
- CtrlShiftX = 196696,
- CtrlShiftY = 196697,
- CtrlShiftZ = 196698,
- Del = 46,
- F1 = 112,
- F2 = 113,
- F3 = 114,
- F4 = 115,
- F5 = 116,
- F6 = 117,
- F7 = 118,
- F8 = 119,
- F9 = 120,
- F10 = 121,
- F11 = 122,
- F12 = 123,
- Ins = 45,
- None = 0,
- ShiftDel = 65582,
- ShiftF1 = 65648,
- ShiftF2 = 65649,
- ShiftF3 = 65650,
- ShiftF4 = 65651,
- ShiftF5 = 65652,
- ShiftF6 = 65653,
- ShiftF7 = 65654,
- ShiftF8 = 65655,
- ShiftF9 = 65656,
- ShiftF10 = 65657,
- ShiftF11 = 65658,
- ShiftF12 = 65659,
- ShiftIns = 65581
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SizeGripStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SizeGripStyle.cs
deleted file mode 100644
index 7883ed12915..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SizeGripStyle.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.SizeGripStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum SizeGripStyle {
- Auto = 0,
- Hide = 2,
- Show = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SortOrder.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SortOrder.cs
deleted file mode 100644
index 58cf0b0f2e1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SortOrder.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.SortOrder.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum SortOrder {
- Ascending = 1,
- Descending = 2,
- Nonoe = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Splitter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Splitter.cs
deleted file mode 100644
index 58a85c121d1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Splitter.cs
+++ /dev/null
@@ -1,345 +0,0 @@
-//
-// System.Windows.Forms.Splitter.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class Splitter : Control, IMessageFilter {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public Splitter()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override bool AllowDrop {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override AnchorStyles Anchor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public BorderStyle BorderStyle {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override DockStyle Dock {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Font Font {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int MinExtra {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int MinSize {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override ISite Site {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SplitPosition {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del, object[] obj)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect, bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpcified bounds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override ImeMode DefaultImeMode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnKeyDown(KeyEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseDown(MouseEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseMove(MouseEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseUp(MouseEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //ContentAlignment RtlTranslateAlignment(ContentAlignment calign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment halign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment lralign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void SetBoundsCore( int x, int y, int width, int height, BoundsSpecified specified)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventArgs.cs
deleted file mode 100644
index ea34fa65b5a..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventArgs.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Windows.Forms.SplitterEventArgs.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //[ComVisible(true)]
- //public class SplitterEventArgs : EventArgs {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public SplitterEventArgs(int x, int y, int splitX, int splitY)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //[ComVisible(true)] public int SplitX {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //[ComVisible(true)] public int SplitY {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //[ComVisible(true)] public int X {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //[ComVisible(true)] public int Y {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventHandler.cs
deleted file mode 100644
index b7799135188..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SplitterEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.SplitterEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the SplitterMoving and SplitterMoved events of a Splitter.
- /// </summary>
- [Serializable]
- public delegate void SplitterEventHandler(object sender, SplitterEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBar.cs
deleted file mode 100644
index 25364f58fa2..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBar.cs
+++ /dev/null
@@ -1,342 +0,0 @@
-//
-// System.Windows.Forms.StatusBar.cs
-//
-// Author:
-// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class StatusBar : Control {
-
- //
- // --- Constructor
- //
- //[MonoTODO]
- //public StatusBar()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override Color BackColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override DockStyle Dock {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Font Font {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override ISite Site {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get {
- // throw new NotImplementedException ();
- // }
- // set {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IAsyncResult BeginInvoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Dispose()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual bool Equals(object o);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static bool Equals(object o1, object o2);
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Region reg)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Invalidate(Rectangle rect, bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public object Invoke(Delegate del, object[] objs)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void PerformLayout(Control ctl, string str)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ResumeLayout(bool b)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Scale(float val1, float val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpcified bounds)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event StatusBarDrawItmeEventHandler DrawItem {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public event StatusBarPanelClickEventHandler PanelClick {
- // add {
- // throw new NotImplementedException ();
- // }
- // remove {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override ImeMode DefaultImeMode {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get {
- // throw new NotImplementedException ();
- // }
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void Dispose(bool val)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnDrawItem(StatusBarDrawItemEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleDestroyed(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnLayout(LayoutEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseDown(MouseEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnPanelClick(StatusBarPanelClickEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnResize(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //ContentAlignment RtlTranslateAlignment(ContentAlignment calign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment halign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment lralign)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void Select(bool val1, bool val2)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- // }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventArgs.cs
deleted file mode 100644
index 20d493f2a13..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventArgs.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.Windows.Forms.StatusBarDrawItemEventArgs
-//
-// Author:
-// stubbed out by Richard Baumann (biochem333@nyc.rr.com)
-//
-// (C) Ximian, Inc., 2002
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Provides data for the DrawItem event.
- /// </summary>
- public class StatusBarDrawItemEventArgs : DrawItemEventArgs
- {
- private StatusBarPanel panel;
-
- /// --- Constructor ---
- public StatusBarDrawItemEventArgs(Graphics g, Font font, Rectangle r, int itemId, DrawItemState itemState, StatusBarPanel panel)
- : base(g, font, r, itemId, itemState) {
- this.panel = panel;
- }
-
- /// --- Properties ---
- public StatusBarPanel Panel {
- get {
- return panel;
- }
- }
-
- // add. remove comment after modifing for this class
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two StatusBarDrawItemEventArgs objects.
- /// The return value is based on the equivalence of
- /// the BackColor, Bounds, Font, ForeColor, Graphics,
- /// Index, Panel, and State properties of the two
- /// StatusBarDrawItemEventArgs.
- /// </remarks>
- public static bool operator == (StatusBarDrawItemEventArgs objA, StatusBarDrawItemEventArgs objB) {
- return ((objA.panel == objB.panel) && ((DrawItemEventArgs) objA == (DrawItemEventArgs) objB));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two StatusBarDrawItemEventArgs objects.
- /// The return value is based on the equivalence of
- /// the BackColor, Bounds, Font, ForeColor, Graphics,
- /// Index, Panel, and State properties of the two
- /// StatusBarDrawItemEventArgs.
- /// </remarks>
- public static bool operator != (StatusBarDrawItemEventArgs objA, StatusBarDrawItemEventArgs objB) {
- return ((objA.panel != objB.panel) || ((DrawItemEventArgs) objA != (DrawItemEventArgs) objB));
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this
- /// StatusBarDrawItemEventArgs and another object.
- /// </remarks>
- public override bool Equals (object o) {
- if (!(o is StatusBarDrawItemEventArgs))return false;
- return (this == (StatusBarDrawItemEventArgs) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
- //[MonoTODO]
- //public override int GetHashCode () {
- // throw new NotImplementedException();
- //}
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the StatusBarDrawItemEventArgs as a string.
- /// </remarks>
- //[MonoTODO]
- //public override string ToString () {
- // throw new NotImplementedException();
- //}
- //end add. remove comment after modifing for this class
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventHandler.cs
deleted file mode 100644
index abe3fff5603..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarDrawItemEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.StatusBarDrawItemEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the DrawItem event of a StatusBar.
- /// </summary>
- [Serializable]
- public delegate void StatusBarDrawItemEventHandler(object sender, StatusBarDrawItemEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs
deleted file mode 100644
index 673c26894a0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// System.Windows.Forms.StatusBarPanel
-//
-// Author:
-// stubbed out by Richard Baumann (biochem333@nyc.rr.com)
-//
-// (C) Ximian, Inc., 2002
-//
-
-namespace System.Windows.Forms
-{
- // <summary>
- // This is only a template. Nothing is implemented yet.
- // Represents a panel in a StatusBar control.
- // </summary>
-
- //public class StatusBarPanel : Component, ISupportInitialize
- //{
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //StatusBarPanel()
- //{
- // throw new NotImplementedException ();
- // // defaults :)
- // alignment = HorizontalAlignment.Left;
- // autoSize = StatusBarPanelAutoSize.None;
- // borderStyle = StatusBarPanelBorderStyle.Sunken;
- // icon = null;
- // minWidth = 10;
- // style = StatusBarPanelStyle.Text;
- // text = "";
- // toolTipText = "";
- // width = 100;
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //~StatusBarPanel()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void Dispose(bool disposing)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public HorizontalAlignment Alignment
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public StatusBarPanelAutoSize AutoSize
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public StatusBarPanelBorderStyle BorderStyle
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public Icon Icon
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public int MinWidth
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public StatusBar Parent
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public StatusBarPanelStyle Style
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public string Text
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public string ToolTipText
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public int Width
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //}
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelAutoSize.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelAutoSize.cs
deleted file mode 100644
index d1f02a8e314..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelAutoSize.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.StatusBarPanelAutoSize.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum StatusBarPanelAutoSize {
- Contents = 3,
- None = 1,
- Spring = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelBorderStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelBorderStyle.cs
deleted file mode 100644
index 19eec69a051..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelBorderStyle.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.StatusBarPanelBorderStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum StatusBarPanelBorderStyle {
- None = 1,
- Raised = 2,
- Sunken =3
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventArgs.cs
deleted file mode 100644
index 5221adf5637..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventArgs.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// System.Windows.Forms.StatusBarPanelClickEventArgs
-//
-// Author:
-// stubbed out by Richard Baumann (biochem333@nyc.rr.com)
-//
-// (C) Ximian, Inc., 2002
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Provides data for the PanelClick event.
- /// </summary>
- public class StatusBarPanelClickEventArgs : MouseEventArgs
- {
- private StatusBarPanel panel;
-
- /// --- Constructor ---
- public StatusBarPanelClickEventArgs(StatusBarPanel panel, MouseButtons button, int clicks, int x, int y) : base(button, clicks, x, y, 0) {
- this.panel = panel;
- }
-
- /// --- Properties ---
- public StatusBarPanel StatusBarPanel {
- get {
- return panel;
- }
- }
-
- // add. remove comment after modifing for this class
- /// <summary>
- /// Equality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two StatusBarPanelClickEventArgs objects.
- /// The return value is based on the equivalence of
- /// the StatusBarPanel, Button, Clicks, X, and Y
- /// properties of the two StatusBarPanelClickEventArgs.
- /// </remarks>
- public static bool operator == (StatusBarPanelClickEventArgs objA, StatusBarPanelClickEventArgs objB) {
- return ((objA.panel == objB.panel) && (objA.Button == objB.Button) && (objA.Clicks == objB.Clicks) && (objA.X == objB.X) && (objA.Y == objB.Y));
- }
-
- /// <summary>
- /// Inequality Operator
- /// </summary>
- ///
- /// <remarks>
- /// Compares two StatusBarPanelClickEventArgs objects.
- /// The return value is based on the equivalence of
- /// the StatusBarPanel, Button, Clicks, X, and Y
- /// properties of the two StatusBarPanelClickEventArgs.
- /// </remarks>
- public static bool operator != (StatusBarPanelClickEventArgs objA, StatusBarPanelClickEventArgs objB) {
- return ((objA.panel != objB.panel) || (objA.Button != objB.Button) || (objA.Clicks != objB.Clicks) || (objA.X != objB.X) || (objA.Y != objB.Y));
- }
-
- /// <summary>
- /// Equals Method
- /// </summary>
- ///
- /// <remarks>
- /// Checks equivalence of this
- /// StatusBarPanelClickEventArgs and another
- /// object.
- /// </remarks>
- public override bool Equals (object o) {
- if (!(o is StatusBarPanelClickEventArgs))return false;
- return (this == (StatusBarPanelClickEventArgs) o);
- }
-
- /// <summary>
- /// GetHashCode Method
- /// </summary>
- ///
- /// <remarks>
- /// Calculates a hashing value.
- /// </remarks>
- //[MonoTODO]
- //public override int GetHashCode () {
- // throw new NotImplementedException();
- //}
-
- /// <summary>
- /// ToString Method
- /// </summary>
- ///
- /// <remarks>
- /// Formats the StatusBarPanelClickEventArgs as a string.
- /// </remarks>
- //[MonoTODO]
- //public override string ToString () {
- // throw new NotImplementedException();
- //}
- //end add. remove comment after modifing for this class
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventHandler.cs
deleted file mode 100644
index ed9fe1b2bee..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelClickEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.StatusBarPanelClickEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the PanelClick event of a StatusBar.
- /// </summary>
- [Serializable]
- public delegate void StatusBarPanelClickEventHandler(object sender, StatusBarPanelClickEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelCollection.cs
deleted file mode 100644
index 33067ae8891..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelCollection.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// System.Windows.Forms.StatusBarPanelCollection
-//
-// Author:
-// stubbed out by Richard Baumann (biochem333@nyc.rr.com)
-//
-// (C) Ximian, Inc., 2002
-//
-
-namespace System.Windows.Forms
-{
- // <summary>
- // This is only a template. Nothing is implemented yet.
- // Represents the collection of panels in a StatusBar control.
- // </summary>
-
- //public class StatusBarPanelCollection : IList, ICollection, IEnumerable
- //{
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //StatusBarPanelCollection(StatusBar owner)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual int Add(StatusBarPanel panel)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual StatusBarPanel Add(string s)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void AddRange(StatusBarPanel[] panels)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(StatusBarPanel panel)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(StatusBarPanel panel)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Insert(int index, StatusBarPanel panel)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Remove(StatusBarPanel panel)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //~StatusBarPanelCollection()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public bool IsReadOnly
- //{
- // get
- // {
- // return false; // for this collection, this is always false
- // }
- //}
- //[MonoTODO]
- //public virtual StatusBarPanel this[int index]
- //{
- // get{ throw new NotImplementedException (); }
- // set{ throw new NotImplementedException (); }
- //}
- //}
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelStyle.cs
deleted file mode 100644
index 1be98572930..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StatusBarPanelStyle.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.StatusBarPanelStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum StatusBarPanelStyle {
- OwnerDraw = 2,
- Text =1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/StructFormat.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/StructFormat.cs
deleted file mode 100644
index 54ebd39caec..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/StructFormat.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.StructFormat.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum StructFormat {
- Ansi = 1,
- Auto = 3,
- Unicode = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/SystemInformation.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/SystemInformation.cs
deleted file mode 100644
index c22138fe910..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/SystemInformation.cs
+++ /dev/null
@@ -1,332 +0,0 @@
-//
-// System.Windows.Forms.SystemInformation
-//
-// Author:
-// stubbed out by Richard Baumann (biochem333@nyc.rr.com)
-//
-// (C) Ximian, Inc., 2002
-//
-
-namespace System.Windows.Forms
-{
- // <summary>
- // This is only a template. Nothing is implemented yet.
- // Provides information about the operating system.
- // </summary>
-
- //public class SystemInformation
- //{
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //~StatusBarPanel()
- //{
- // throw new NotImplementedException ();
- //}
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public static ArrangeDirection ArrangeDirection
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static ArrangeStartingPosition ArrangeStartingPosition
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static BootMode BootMode
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size Border3DSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size BorderSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size CaptionButtonSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int CaptionHeight
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static string ComputerName
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size CursorSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool DbcsEnabled
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool DebugOS
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size DoubleClickSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int DoubleClickTime
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool DragFullWindows
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size DragSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size FixedFrameBorderSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size FrameBorderSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool HighContrast
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int HorizontalScrollBarArrowWidth
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int HorizontalScrollBarHeight
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int HorizontalScrollBarThumbWidth
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size IconSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size IconSpacingSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int KanjiWindowHeight
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size MaxWindowTrackSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size MenuButtonSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size MenuCheckSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Font MenuFont
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int MenuHeight
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool MidEastEnabled
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size MinimizedWindowSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size MinimizedWindowSpacingSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size MinimumWindowSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size MinWindowTrackSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int MonitorCount
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool MonitorsSameDisplayFormat
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int MouseButtons
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool MouseButtonsSwapped
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool MousePresent
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool MouseWheelPresent
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int MouseWheelScrollLines
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool NativeMouseWheelSupport
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool Network
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool PenWindows
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size PrimaryMonitorMaximizedWindowSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size PrimaryMonitorSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool RightAlignedMenus
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool Secure
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool ShowSounds
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size SmallIconSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Size ToolWindowCaptionButtonSize
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int ToolWindowCaptionHeight
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static string UserDomainName
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static bool UserInteractive
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static string UserName
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int VerticalScrollBarArrowHeight
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int VerticalScrollBarThumbHeight
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static int VerticalScrollBarWidth
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Rectangle VirtualScreen
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //[MonoTODO]
- //public static Rectangle WorkingArea
- //{
- // get{ throw new NotImplementedException (); }
- //}
- //}
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabAlignment.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TabAlignment.cs
deleted file mode 100644
index fb7ed7f6b82..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabAlignment.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.TabAlignment.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum TabAlignment {
- Bottom = 1,
- Left = 2,
- Right = 3,
- Top = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabAppearance.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TabAppearance.cs
deleted file mode 100644
index 794256bad2d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabAppearance.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.TabAppearance.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum TabAppearance {
- Buttons = 1,
- FlatButtons = 2,
- Normal =0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabControl.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TabControl.cs
deleted file mode 100644
index b44c4020719..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabControl.cs
+++ /dev/null
@@ -1,438 +0,0 @@
-//
-// System.Windows.Forms.TabControl
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TabControl : Control {
-
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public TabControl()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public TabAlignment Alignment {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TabAppearance Appearance {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color BackColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Rectangle DisplayRectangle {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TabDrawMode DrawMode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool HotTrack {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList ImageList {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Size ItemSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Multiline {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Point Padding {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int RowCount {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectedIndex {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TabPage SelectedTab {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowToolTips {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TabSizeMode SizeMode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int TabCount {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TabControl.TabPageCollection TabPages {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public Rectangle GetTabRect(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event DrawItemEventHandler DrawItem;
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override ControlCollection CreateControlsInstance()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool IsInputKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnDrawItem(DrawItemEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnFontChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleDestroyed(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnKeyDown(KeyEventArgs ke)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnResize(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnSelectedIndexChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnStyleChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool ProcessKeyPreview(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected void RemoveAll()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //public class ControlCollection : Control.ControlCollection {
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public override void Add(Control value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override void Remove(Control value)
- //{
- // throw new NotImplementedException ();
- //}
- //}
- //public class TabPageCollection : IList, ICollection, IEnumerable {
- //
- // --- Public Contructor
- //
- //[MonoTODO]
- //public TabPageCollection(TabControl owner)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual TabPage this[int index] {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Add(TabPage value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void AddRange(TabPage[] pages)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(TabPage page)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(TabPage page)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(TabPage value)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //}
- //}
-}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabDrawMode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TabDrawMode.cs
deleted file mode 100644
index 8fde27d17a8..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabDrawMode.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.TabDrawMode.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum TabDrawMode {
- Normal = 0,
- OwnerDrawfixed =1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabPage.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TabPage.cs
deleted file mode 100644
index f1ed5fc1870..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabPage.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// System.Windows.Forms.TabPage
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TabPage : Panel {
-
- //
- // --- Public Constructor
- //
- //[MonoTODO]
- //public TabPage()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override AnchorStyles Anchor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override DockStyle Dock {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int ImageIndex {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string ToolTipText {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public static TabPage GetTabPageOfComponent(object comp)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override ControlCollection CreateControlsInstance()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
- //{
- // throw new NotImplementedException ();
- //}
- //public class TabPageControlCollection : Control.ControlCollection {
- //
- // --- Public Methods
- //
- //public override void Add(Control value)
- //{
- // throw new NotImplementedException ();
- //}
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabSizeMode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TabSizeMode.cs
deleted file mode 100644
index 54373dcbcc3..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TabSizeMode.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Windows.Forms.TabSizeMode.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum TabSizeMode {
- FillToRight = 1,
- Fixed = 2,
- Normal = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TextBox.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TextBox.cs
deleted file mode 100644
index 474b85b6232..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TextBox.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// System.Windows.Forms.TextBox
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TextBox : TextBoxBase {
-
- //
- // --- Public Constructor
- //
- //[MonoTODO]
- //public TextBox()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool AcceptsReturn {
-
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public CharacterCasing CharacterCasing {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public char PasswordChar {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ScrollBars ScrollBars {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public HorizontalAlignment TextAlign {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler TextAlignChanged;
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override ImeMode DefaultImeMode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Protected Members
- //
- //protected override bool IsInputKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnMouseUp(MouseEventArgs mevent)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnTextAlignChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TextBoxBase.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
deleted file mode 100644
index 4968aa48598..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
+++ /dev/null
@@ -1,405 +0,0 @@
-//
-// System.Windows.Forms.TextBoxBase
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TextBoxBase : Control {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool AcceptsTab {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual bool AutoSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color BackColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public BorderStyle BorderStyle {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool CanUndo {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool HideSelection {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string[] Lines {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual int MaxLength {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Modified {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual bool Multiline {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int PreferredHeight {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ReadOnly {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual string SelectedText {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual int SelectionLength {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectionStart {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual int TextLength {
-
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool WordWrap {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void AppendText(string text)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ClearUndo()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Copy()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Cut()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Paste()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ScrollToCaret()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Select(int start, int length)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void SelectAll()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Undo()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler AcceptsTabChanged;
- //[MonoTODO]
- //public event EventHandler AutoSizeChanged;
- //[MonoTODO]
- //public event EventHandler BorderStyleChanged;
- //[MonoTODO]
- //public new event EventHandler Click;
- //[MonoTODO]
- //public event EventHandler HideSelectionChanged;
- //[MonoTODO]
- //public event EventHandler ModifiedChanged;
- //[MonoTODO]
- //public event EventHandler MultilineChanged;
- //[MonoTODO]
- //public event EventHandler ReadOnlyChanged;
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool IsInputKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnAcceptsTabChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnAutoSizeChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnBorderStyleChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnFontChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleDestroyed(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnHideSelectionChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnModifiedChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnMultilineChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnReadOnlyChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool ProcessDialogKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ThreadExceptionDialog.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ThreadExceptionDialog.cs
deleted file mode 100644
index 788dbbcd43c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ThreadExceptionDialog.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Windows.Forms.ThreadExceptionDialog
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ThreadExceptionDialog : Form {
-
- //
- // --- Public Constructor
- //
- //[MonoTODO]
- //public ThreadExceptionDialog(Exception t)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TickStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TickStyle.cs
deleted file mode 100644
index 10deee97d82..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TickStyle.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.TickStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum TickStyle {
- Both = 3,
- BottemRight = 2,
- none =0,
- TopLeft = 1
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Timer.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Timer.cs
deleted file mode 100644
index 81200969197..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Timer.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// System.Windows.Forms.Timer
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class Timer : Component {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public Timer()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public Timer(IContainer container)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public virtual bool Enabled {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Interval {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void Start()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Stop()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler Tick;
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void Dispose(bool disposing)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnTick(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBar.cs
deleted file mode 100644
index 69f66a5b5fa..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBar.cs
+++ /dev/null
@@ -1,416 +0,0 @@
-//
-// System.Windows.Forms.ToolBar
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ToolBar : Control {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public ToolBar()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public ToolBarAppearance Appearance {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool AutoSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color BackColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage{
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public BorderStyle BorderStyle{
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ToolBar.ToolBarButtonCollection Buttons {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Size ButtonSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Divider {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override DockStyle Dock{
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool DropDownArrows {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList ImageList {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Size ImageSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public new ImeMode ImeMode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override RightToLeft RightToLeft {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowToolTips {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ToolBarTextAlign TextAlign {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Wrappable{
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event ToolBarButtonClickEventHandler ButtonClick;
- //[MonoTODO]
- //public event ToolBarButtonClickEventHandler ButtonDropDown;
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override ImeMode DefaultImeMode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void Dispose(bool disposing)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnButtonClick(ToolBarButtonClickEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnButtonDropDown(ToolBarButtonClickEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnFontChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnResize(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //public class ToolBarButtonCollection : IList, ICollection, IEnumerable {
- //
- // --- Public Constructor
- //
- //[MonoTODO]
- //public ToolBar.ToolBarButtonCollection(ToolBar owner)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual ToolBarButton this[int index] {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public int Add(string text)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int Add(ToolBarButton button)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void AddRange(ToolBarButton[] buttons)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(ToolBarButton button)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(ToolBarButton button)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Insert(int index, ToolBarButton button)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Insert(int index, ToolBarButton button)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(ToolBarButton button)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //}
- //}
-}
-
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarAppearance.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarAppearance.cs
deleted file mode 100644
index 7400821b435..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarAppearance.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.ToolBarAppearance.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ToolBarAppearance {
- Flat = 1,
- Normal = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButton.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
deleted file mode 100644
index dba3fd1c913..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-//
-// System.Windows.Forms.ToolBarButton
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class ToolBarButton : Component {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public ToolBarButton()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public ToolBarButton(string text)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Menu DropDownMenu {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Enabled {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int ImageIndex {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ToolBar Parent {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool PartialPush {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Pushed {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Rectangle Rectangle {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ToolBarButtonStyle Style {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public object Tag {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string ToolTipText {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Visible {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void Dispose(bool disposing)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonClickEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonClickEventHandler.cs
deleted file mode 100644
index 78bd33b1cac..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonClickEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.ToolBarButtonClickEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the ButtonClick event of a ToolBar.
- /// </summary>
- [Serializable]
- public delegate void ToolBarButtonClickEventHandler(object sender, ToolBarButtonClickEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonStyle.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonStyle.cs
deleted file mode 100644
index 954774f964d..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarButtonStyle.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.ToolBarButtonStyle.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ToolBarButtonStyle {
- DropDownButton = 4,
- PushButton = 1,
- Separator = 3,
- ToggleButton =2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarTextAlign.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarTextAlign.cs
deleted file mode 100644
index 76d26fd5aca..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/ToolBarTextAlign.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.ToolBarTextAlign.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum ToolBarTextAlign {
- Right = 1,
- Underneath = 0
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TrackBar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TrackBar.cs
deleted file mode 100644
index ab1bed0fab2..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TrackBar.cs
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-// System.Windows.Forms.TrackBar
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TrackBar : Control, ISupportInitialize {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public TrackBar()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public bool AutoSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Font Font {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int LargeChange {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Maximum {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Minimum {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Orientation Orientation {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SmallChange {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int TickFrequency {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TickStyle TickStyle {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Value {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void SetRange(int minValue, int maxValue)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event EventHandler Scroll;
- //[MonoTODO]
- //public event EventHandler ValueChanged;
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override ImeMode DefaultImeMode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool IsInputKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnBackColorChanged(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnScroll(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNode.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNode.cs
deleted file mode 100644
index 754373bcba1..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNode.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-//
-// System.Windows.Forms.TreeNode
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TreeNode : MarshalByRefObject, ICloneable {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public TreeNode()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public TreeNode(string text)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public TreeNode(string text, TreeNode[] children)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public Color BackColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Rectangle Bounds {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Checked {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode FirstNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Color ForeColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string FullPath {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public IntPtr Handle {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int ImageIndex {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Index {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsEditing {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsExpanded {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsSelected {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsVisible {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode LastNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode NextNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode NextVisibleNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public Font NodeFont {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNodeCollection Nodes {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode Parent {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode PrevNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode PrevVisibleNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectedImageIndex {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public object Tag {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeView TreeView {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void BeginEdit()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual object Clone()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Collapse()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void EndEdit(bool cancel)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void EnsureVisible()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Expand()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ExpandAll()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public static TreeNode FromHandle(TreeView tree, IntPtr handle)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int GetNodeCount(bool includeSubTrees)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Toggle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs
deleted file mode 100644
index bbfbd155d47..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// System.Windows.Forms.TreeNodeCollection
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TreeNodeCollection : IList, ICollection, IEnumerable {
-
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public int Count {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool IsReadOnly {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public virtual TreeNode this[int index] {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public virtual TreeNode Add(string text)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual int Add(TreeNode node)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void AddRange(TreeNode[] nodes)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Clear()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public bool Contains(TreeNode node)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CopyTo(Array dest, int index)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public IEnumerator GetEnumerator()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int IndexOf(TreeNode node)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void Insert(int index, TreeNode node)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void Remove(TreeNode node)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public virtual void RemoveAt(int index)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeConverter.cs
deleted file mode 100644
index 3e94f6919c3..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeNodeConverter.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Windows.Forms.TreeNodeConverter
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TreeNodeConverter : TypeConverter {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public TreeNodeConverter()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeView.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeView.cs
deleted file mode 100644
index 7183cb36771..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeView.cs
+++ /dev/null
@@ -1,484 +0,0 @@
-//
-// System.Windows.Forms.TreeView
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TreeView : Control {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public TreeView()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public override Color BackColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Image BackgroundImage {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public BorderStyle BorderStyle {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool CheckBoxes {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override Color ForeColor {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool FullRowSelect {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool HideSelection {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool HotTracking {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int ImageIndex {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public ImageList ImageList {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int Indent {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int ItemHeight {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool LabelEdit {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNodeCollection Nodes {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public string PathSeparator {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Scrollable {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int SelectedImageIndex {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode SelectedNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowLines {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowPlusMinus {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool ShowRootLines {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public bool Sorted {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public override string Text {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- // set
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode TopNode {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public int VisibleCount {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Public Methods
- //
- //[MonoTODO]
- //public void BeginUpdate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void CollapseAll()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void EndUpdate()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public void ExpandAll()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public TreeNode GetNodeAt(Point pt)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public TreeNode GetNodeAt(int x, int y)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public int GetNodeCount(bool includeSubTrees)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public override string ToString()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Events
- //
- //[MonoTODO]
- //public event TreeViewEventHandler AfterCheck;
- //[MonoTODO]
- //public event TreeViewEventHandler AfterCollapse;
- //[MonoTODO]
- //public event TreeViewEventHandler AfterExpand;
- //[MonoTODO]
- //public event NodeLabelEditEventHandler AfterLabelEdit;
- //[MonoTODO]
- //public event TreeViewEventHandler AfterSelect;
- //[MonoTODO]
- //public event TreeViewCancelEventHandler BeforeCheck;
- //[MonoTODO]
- //public event TreeViewCancelEventHandler BeforeCollapse;
- //[MonoTODO]
- //public event TreeViewCancelEventHandler BeforeExpand;
- //[MonoTODO]
- //public event NodeLabelEditEventHandler BeforeLabelEdit;
- //[MonoTODO]
- //public event TreeViewCancelEventHandler BeforeSelect;
- //[MonoTODO]
- //public event ItemDragEventHandler ItemDrag;
- //[MonoTODO]
- //public new event PaintEventHandler Paint;
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override CreateParams CreateParams {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //protected override Size DefaultSize {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //
- // --- Protected Methods
- //
- //[MonoTODO]
- //protected override void CreateHandle()
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void Dispose(bool disposing)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override bool IsInputKey(Keys keyData)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnAfterCheck(TreeViewEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnAfterCollapse(TreeViewEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnAfterExpand(TreeViewEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnAfterLabelEdit(NodeLabelEditEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnAfterSelect(TreeViewEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnBeforeCheck(TreeViewCancelEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnBeforeCollapse(TreeViewCancelEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnBeforeExpand(TreeViewCancelEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnBeforeLabelEdit(NodeLabelEditEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnBeforeSelect(TreeViewCancelEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleCreated(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnHandleDestroyed(EventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected virtual void OnItemDrag(ItemDragEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnKeyDown(KeyEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnKeyPress(KeyPressEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void OnKeyUp(KeyEventArgs e)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //protected override void WndProc(ref Message m)
- //{
- // throw new NotImplementedException ();
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewAction.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewAction.cs
deleted file mode 100644
index 3b1d2389821..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewAction.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.TreeViewAction.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum TreeViewAction {
- ByKeyboard = 1,
- ByMouse = 2,
- Collapse = 3,
- Expand =4
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventArgs.cs
deleted file mode 100644
index 5c617e0cefd..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventArgs.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Windows.Forms.TreeViewCancelEventArgs
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TreeViewCancelEventArgs : CancelEventArgs {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public TreeViewCancelEventArgs(TreeNode node, bool cancel, TreeViewAction action)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public TreeViewAction Action {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode Node {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventHandler.cs
deleted file mode 100644
index 948f69bc69c..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewCancelEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.TreeViewCancelEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the BeforeCheck,
- /// BeforeCollapse, BeforeExpand, or BeforeSelect event of a TreeView.
- /// </summary>
- [Serializable]
- public delegate void TreeViewCancelEventHandler(object sender, TreeViewCancelEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventArgs.cs
deleted file mode 100644
index a237267e8e6..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventArgs.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Windows.Forms.TreeViewEventArgs
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TreeViewEventArgs : EventArgs {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public TreeViewEventArgs(TreeNode node)
- //{
- // throw new NotImplementedException ();
- //}
- //[MonoTODO]
- //public TreeViewEventArgs(TreeNode node, TreeViewAction action)
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Public Properties
- //
- //[MonoTODO]
- //public TreeViewAction Action {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //[MonoTODO]
- //public TreeNode Node {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventHandler.cs
deleted file mode 100644
index ecbaace79f4..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.TreeViewEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents the method that will handle the
- /// AfterCheck, AfterCollapse, AfterExpand, or AfterSelect event of a TreeView.
- /// </summary>
- [Serializable]
- public delegate void TreeViewEventHandler(object sender, TreeViewEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewImageIndexConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewImageIndexConverter.cs
deleted file mode 100644
index 48b792be000..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TreeViewImageIndexConverter.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Windows.Forms.TreeViewImageIndexConverter
-//
-// Author:
-// stubbed out by Jackson Harper (jackson@latitudegeo.com)
-//
-// (C) 2002 Ximian, Inc
-//
-
-namespace System.Windows.Forms {
-
- // <summary>
- // This is only a template. Nothing is implemented yet.
- //
- // </summary>
-
- //public class TreeViewImageIndexConverter : ImageIndexConverter {
-
- //
- // --- Public Constructors
- //
- //[MonoTODO]
- //public TreeViewImageIndexConverter()
- //{
- // throw new NotImplementedException ();
- //}
- //
- // --- Protected Properties
- //
- //[MonoTODO]
- //protected override bool IncludeNoneAsStandardValue {
- // get
- // {
- // throw new NotImplementedException ();
- // }
- //}
- //}
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/UICues.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/UICues.cs
deleted file mode 100644
index 7bde1f23961..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/UICues.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Windows.Forms.UICues.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum UICues {
- Changed = 12,
- ChangeFocus = 4,
- ChangeKeyboard = 8,
- None = 0,
- ShowFocus = 1,
- ShowKeyboard = 2,
- Shown = 3
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventArgs.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventArgs.cs
deleted file mode 100644
index 27d18c24504..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventArgs.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// System.Windows.Forms.UICuesEventArgs
-//
-// Author:
-// stubbed out by Stefan Warnke (StefanW@POBox.com)
-//
-// (C) Ximian, Inc., 2002
-//
-using System;
-
-
-
-namespace Sytem.Windows.Forms
-{
- // <summary>
- // This is only a template. Nothing is implemented yet.
- // </summary>
-
-
- /// <summary>
- /// UICuesEventArgs specifies which user interface feature changed and its new value.
- /// </summary>
- public class UICuesEventArgs : EventArgs
- {
-// // Specifies the state of the user interface
-// public enum UICues {
-// Changed, // The state of the focus cues and keyboard cues has changed.
-// ChangeFocus, // The state of the focus cues has changed.
-// ChangeKeyboard, // The state of the keyboard cues has changed.
-// None, // No change was made.
-// ShowFocus, // Focus rectangles are displayed after the change.
-// ShowKeyboard, // Keyboard cues are underlined after the change.
-// Shown // Focus rectangles are displayed and keyboard cues are underlined
-// // after the change.
-// };
-//
-// /// --- Constructor ---
-// public UICuesEventArgs(UICues uicues) {
-// throw new NotImplementedException ();
-// }
-//
-// /// --- Destructor ---
-// ~UICuesEventArgs() {
-// throw new NotImplementedException ();
-// }
-//
-// /// --- Public Properties ---
-// #region Public Properties
-//
-// // Gets the bitwise combination of the UICues values
-// public UICues Changed {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets a value indicating whether the state of the focus cues has changed.
-// public bool ChangeFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets a value indicating whether the state of the keyboard cues has changed
-// public bool ChangeKeyboard {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets a value indicating whether focus rectangles are shown after the change
-// public bool ShowFocus {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets a value indicating whether keyboard cues are underlined after the change
-// public bool ShowKeyboard {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-// #endregion // Public Properties
-//
-// /// --- Public Methods ---
-// #region Public Methods
-//
-// // Returns a String that represents the current Object
-// public override string ToString() {
-// throw new NotImplementedException ();
-// }
-// #endregion // Public Methods
-
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventHandler.cs
deleted file mode 100644
index a5ae458266e..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/UICuesEventHandler.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Windows.Forms.UICuesEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// Represents a method that will handle the ChangeUICues event of a Control.
- /// </summary>
- [Serializable]
- public delegate void UICuesEventHandler(object sender, UICuesEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownBase.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownBase.cs
deleted file mode 100644
index 8b5db50e7c0..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownBase.cs
+++ /dev/null
@@ -1,294 +0,0 @@
-//
-// System.Windows.Forms.UICuesEventArgs
-//
-// Author:
-// stubbed out by Stefan Warnke (StefanW@POBox.com)
-//
-// (C) Ximian, Inc., 2002
-//
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-using System.ComponentModel;
-
-namespace Sytem.Windows.Forms
-{
- // <summary>
- // This is only a template. Nothing is implemented yet.
- // </summary>
-
-
- /// <summary>
- /// The up-down control consists of a text box and a small vertical scroll
- /// bar, commonly referred to as a spinner control.
- /// </summary>
- public abstract class UpDownBase : ContainerControl
- {
-// /// --- Constructor ---
-// public UpDownBase() {
-// throw new NotImplementedException ();
-// }
-//
-// /// --- Destructor ---
-// ~UpDownBase() {
-// throw new NotImplementedException ();
-// }
-//
-// /// --- Public Properties ---
-// #region Public Properties
-// // Gets or sets the background color for the control
-// public override Color BackColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the background image displayed in the control
-// public override Image BackgroundImage {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the border style for the up-down control
-// public BorderStyle BorderStyle {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the shortcut menu associated with the control
-// public override ContextMenu ContextMenu {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets a value indicating whether the control has input focus
-// public override bool Focused {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the foreground color of the control
-// public override Color ForeColor {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets a value indicating whether the user can use the
-// // UP ARROW and DOWN ARROW keys to select values
-// public bool InterceptArrowKeys {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets the height of the up-down control
-// public int PreferredHeight {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets a value indicating whether the text may be
-// // changed by the use of the up or down buttons only
-// public bool ReadOnly {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the site of the control.
-// public override ISite Site {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the text displayed in the up-down control
-// public override string Text {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the alignment of the text in the up-down control
-// public HorizontalAlignment TextAlign {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets the alignment of the up and down buttons on the
-// // up-down control
-// public LeftRightAlignment UpDownAlign {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// #endregion // Public Properties
-//
-//
-// /// --- Public Methods ---
-// #region Public Methods
-//
-// // When overridden in a derived class, handles the pressing of the down
-// // button on the up-down control.
-// public abstract void DownButton();
-//
-// // Selects a range of text in the up-down control specifying the
-// // starting position and number of characters to select.
-// public void Select(int start,int length) {
-// throw new NotImplementedException ();
-// }
-//
-// // When overridden in a derived class, handles the pressing of
-// // the up button on the up-down control
-// public abstract void UpButton();
-//
-// #endregion // Public Methods
-//
-//
-// /// --- Protected Properties ---
-// #region Protected Properties
-//
-// // Gets or sets a value indicating whether the text property is being
-// // changed internally by its parent class
-// protected bool ChangingText {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets the required creation parameters when the control handle is created
-// protected override CreateParams CreateParams {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets the default size of the control.
-// protected override Size DefaultSize {
-// get {
-// throw new NotImplementedException ();
-// }
-// }
-//
-// // Gets or sets a value indicating whether a value has been entered by the user
-// protected bool UserEdit {
-// get {
-// throw new NotImplementedException ();
-// }
-// set {
-// throw new NotImplementedException ();
-// }
-// }
-// #endregion // Protected Properties
-//
-//
-// /// --- Protected Methods ---
-// #region Protected Methods
-//
-// // Raises the FontChanged event
-// protected override void OnFontChanged(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the HandleCreated event
-// protected override void OnHandleCreated(EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the Layout event
-// protected override void OnLayout(LayoutEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the MouseWheel event
-// protected override void OnMouseWheel(MouseEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the KeyDown event
-// protected virtual void OnTextBoxKeyDown(object source, KeyEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the KeyPress event
-// protected virtual void OnTextBoxKeyPress(object source, KeyPressEventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the LostFocus event
-// protected virtual void OnTextBoxLostFocus(object source, EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the Resize event
-// protected virtual void OnTextBoxResize(object source, EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // Raises the TextChanged event.
-// protected virtual void OnTextBoxTextChanged(object source, EventArgs e) {
-// throw new NotImplementedException ();
-// }
-//
-// // This member overrides Control.SetBoundsCore.
-// protected override void SetBoundsCore(int x, int y, int width,
-// int height, BoundsSpecified specified) {
-// throw new NotImplementedException ();
-// }
-//
-// // When overridden in a derived class, updates the text displayed in the
-// // up-down control
-// protected abstract void UpdateEditText();
-//
-// // When overridden in a derived class, validates the text displayed in the
-// // up-down control
-// protected virtual void ValidateEditText() {
-// throw new NotImplementedException ();
-// }
-// #endregion // Protected Methods
-//
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownEventHandler.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownEventHandler.cs
deleted file mode 100644
index 40f951b22c9..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/UpDownEventHandler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Windows.Forms.UpDownEventHandler.cs
-//
-// Authors:
-// Jaak Simm (jaaksimm@firm.ee)
-// Dennis Hayes (dennish@Raytek.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Windows.Forms
-{
- /// <summary>
- /// This type supports the .NET Framework infrastructure
- /// and is not intended to be used directly from your code.
- /// </summary>
- [Serializable]
- public delegate void UpDownEventHandler(object sender, UpDownEventArgs e);
-} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/UserControl.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/UserControl.cs
deleted file mode 100644
index de55c2ded01..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/UserControl.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//using System;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms {
-//
-// public class UserControl {
-//
-// // --- Properties ---
-// [MonoTODO]
-// protected override Size DefaultSize {
-//
-// get { throw new NotImplementedException(); }
-// }
-//
-// [MonoTODO]
-// public override string Text {
-//
-// get { throw new NotImplementedException(); }
-// set { throw new NotImplementedException(); }
-// }
-//
-// // --- Constructor ---
-// [MonoTODO]
-// public UserControl()
-// {
-// throw new NotImplementedException();
-// }
-//
-// // --- Methods ---
-// [MonoTODO]
-// protected override void OnCreateControl()
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected virtual void OnLoad(EventArgs e)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected override void OnMouseDown(MouseEventArgs e)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected override void WndProc(ref Message m)
-// {
-// throw new NotImplementedException();
-// }
-//
-// // --- Events ---
-// [MonoTODO]
-// public event EventHandler Load;
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/VScrollBar.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/VScrollBar.cs
deleted file mode 100644
index f648e90ea19..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/VScrollBar.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-////
-//// System.Windows.Forms.StructFormat.cs
-////
-//// Author:
-//// John Rebbeck <john@rebent.com>
-//// (C) 2002 Ximian, Inc. http://www.ximian.com
-////
-//using System;
-//using System.Drawing;
-//
-//namespace System.Windows.Forms {
-//
-// public class VScrollBar : ScrollBar {
-//
-// // --- Properties ---
-// [MonoTODO]
-// protected override CreateParams CreateParams {
-//
-// get { throw new NotImplementedException(); }
-// }
-//
-// [MonoTODO]
-// protected override Size DefaultSize {
-//
-// get { throw new NotImplementedException(); }
-// }
-//
-// [MonoTODO]
-// public override RightToLeft RightToLeft {
-//
-// get { throw new NotImplementedException(); }
-// set { throw new NotImplementedException(); }
-// }
-//
-// // --- Constructor ---
-// [MonoTODO]
-// public VScrollBar()
-// {
-// throw new NotImplementedException();
-// }
-// }
-//}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/View.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/View.cs
deleted file mode 100644
index 14a1ccda845..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/View.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Windows.Forms.View.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum View {
- Details = 1,
- LargeIcon = 0,
- List = 3,
- SmallIcon = 2
- }
-}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/day.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/day.cs
deleted file mode 100644
index e886ae799eb..00000000000
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/day.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Windows.Forms.Day.cs
-//
-// Author:
-// Dennis Hayes (dennish@raytek.com)
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Windows.Forms {
-
- /// <summary>
- /// </summary>
- public enum Day {
- Default = 7,
- Friday = 4,
- Monday = 0,
- Saturday = 5,
- Sunday = 6,
- Thursday = 3,
- Tuesday = 1,
- Wednesday = 2
- }
-}
diff --git a/mcs/class/System.XML/.cvsignore b/mcs/class/System.XML/.cvsignore
deleted file mode 100644
index 36defaa40ed..00000000000
--- a/mcs/class/System.XML/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-*.dll
-list
-*.suo
-*.csproj.user
-bin
-obj
diff --git a/mcs/class/System.XML/ChangeLog b/mcs/class/System.XML/ChangeLog
deleted file mode 100644
index c8346fcf9b7..00000000000
--- a/mcs/class/System.XML/ChangeLog
+++ /dev/null
@@ -1,23 +0,0 @@
-2002-06-20 Ajay kumar Dwivedi <adwiv@yahoo.com>
-
- * System.Xml.Serialization: Added to build target
-
-2002-05-24 Miguel de Icaza <miguel@ximian.com>
-
- * System.Xml.Serialization/XmlElementAttribute.cs: Add allowmultiple
-
-2002-03-06 Jason Diamond <jason@injektilo.org>
-
- * System.XML.build: Disable warning CS0679: Other languages may permit the internal virtual member 'foo' to be overridden.
-
-2002-02-23 Nick Drochak <ndrochak@gol.com>
-
- * System.XML.build: Change dll name to System.Xml.dll from
- System.XML.dll (not easy to notice, btw)
-
-2001-12-07 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * System.XML.build: Add dependancy on linux target to test target. Need to have the dll before we can test it, right? Plus is encourages other to try 'make test'.
-
diff --git a/mcs/class/System.XML/Mono.System.XML.csproj b/mcs/class/System.XML/Mono.System.XML.csproj
deleted file mode 100644
index 18ecafccdae..00000000000
--- a/mcs/class/System.XML/Mono.System.XML.csproj
+++ /dev/null
@@ -1,475 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{0CB7FB41-3C0F-40E8-ACD3-8C5B8BC35B2C}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "System.XML"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- RootNamespace = "System.XML"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "System.Xml\ChangeLog"
- BuildAction = "None"
- />
- <File
- RelPath = "System.Xml\Driver.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\EntityHandling.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\Formatting.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\IHasXmlNode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\IXmlLineInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\NameTable.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\Profile.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\ReadState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\TODOAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\ValidationType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\WhitespaceHandling.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\WriteState.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlAttributeCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlCDataSection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlChar.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlCharacterData.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlComment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlConstructs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlConvert.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlDeclaration.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlDocument.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlDocumentFragment.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlDocumentNavigator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlDocumentType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlElement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlEntity.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlEntityReference.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlException.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlImplementation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlLinkedNode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNamedNodeMap.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNamespaceManager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNameTable.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNode.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeChangedAction.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeChangedEventArgs.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeChangedEventHandler.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeList.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeListChildren.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeOrder.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeReader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNodeType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlNotation.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlParserContext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlProcessingInstruction.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlQualifiedName.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlReader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlResolver.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlSignificantWhitespace.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlSpace.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlText.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlTextReader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlTextWriter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlTextWriterOpenElement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlTokenizedType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlUrlResolver.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlWhitespace.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml\XmlWriter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\ChangeLog"
- BuildAction = "None"
- />
- <File
- RelPath = "System.Xml.XPath\DefaultContext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\Expression.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\Iterator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\IXPathNavigable.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\Parser.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\Parser.jay"
- BuildAction = "None"
- />
- <File
- RelPath = "System.Xml.XPath\Tokenizer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XmlCaseOrder.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XmlDataType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XmlSortOrder.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathDocument.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathException.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathExpression.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathNamespaceScope.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathNavigator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathNodeIterator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathNodeType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathResultType.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "System.Xml.XPath\XPathScanner.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/class/System.XML/Mono.System.XML.sln b/mcs/class/System.XML/Mono.System.XML.sln
deleted file mode 100644
index 0d2c98ae7dd..00000000000
--- a/mcs/class/System.XML/Mono.System.XML.sln
+++ /dev/null
@@ -1,27 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.System.XML", "Mono.System.XML.csproj", "{0CB7FB41-3C0F-40E8-ACD3-8C5B8BC35B2C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoMicro.Test", "Test\MonoMicro.Test.csproj", "{F7734143-3845-4288-B1CA-FE614FFA70F0}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {0CB7FB41-3C0F-40E8-ACD3-8C5B8BC35B2C}.Debug.ActiveCfg = Debug|.NET
- {0CB7FB41-3C0F-40E8-ACD3-8C5B8BC35B2C}.Debug.Build.0 = Debug|.NET
- {0CB7FB41-3C0F-40E8-ACD3-8C5B8BC35B2C}.Release.ActiveCfg = Release|.NET
- {0CB7FB41-3C0F-40E8-ACD3-8C5B8BC35B2C}.Release.Build.0 = Release|.NET
- {F7734143-3845-4288-B1CA-FE614FFA70F0}.Debug.ActiveCfg = Debug|.NET
- {F7734143-3845-4288-B1CA-FE614FFA70F0}.Debug.Build.0 = Debug|.NET
- {F7734143-3845-4288-B1CA-FE614FFA70F0}.Release.ActiveCfg = Release|.NET
- {F7734143-3845-4288-B1CA-FE614FFA70F0}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/mcs/class/System.XML/README b/mcs/class/System.XML/README
deleted file mode 100755
index 498b53d0796..00000000000
--- a/mcs/class/System.XML/README
+++ /dev/null
@@ -1,8 +0,0 @@
-Build instructions for use with the mono runtime.
-
-Run:
- mcs @list.unix
-
-If no errors occourred, copy the generated System.Xml.dll file to the runtime dir
-(probably /usr/local/lib).
-
diff --git a/mcs/class/System.XML/System.XML.build b/mcs/class/System.XML/System.XML.build
deleted file mode 100644
index cee6b79d8b9..00000000000
--- a/mcs/class/System.XML/System.XML.build
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.XML.dll -->
-
-<project name="System.XML" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/System.Xml.dll" debug="${debug}">
- <!-- 'foo' is defined in multiple places; using definition from 'bar' -->
- <arg value="/nowarn:1595"/>
- <!-- Other languages may permit the internal virtual member 'foo' to be overridden -->
- <arg value="/nowarn:0679"/>
- <arg value="/nowarn:0649"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <!--excludes name="System.Xml.Serialization/**"/-->
- </sources>
- </csc>
- <copy file="../lib/System.Xml.dll" tofile="Test/System.XML.dll"/>
- <nant basedir="Test" target="build"/>
- </target>
-
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="clean">
- <nant basedir="Test" target="clean"/>
- <delete file="../lib/System.XML.dll" failonerror="false"/>
- <delete file="../lib/System.Xml.dll" failonerror="false"/>
- <delete file="Test/System.XML.dll" failonerror="false"/>
- <delete file="Test/System.Xml.dll" failonerror="false"/>
- <delete file="../lib/System.XML.pdb" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.XML/System.Xml.Schema/BUGS-MS.txt b/mcs/class/System.XML/System.Xml.Schema/BUGS-MS.txt
deleted file mode 100755
index ad4ece9c910..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/BUGS-MS.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-BUGS in MS Implementation of XmlSchema:
-
-1. Does not allow duplicate values in lists for final* and block* attributes.
- For example "restriction restriction" is not allowed even though its a valid
- value for blockDefault.
-
-2. Resets the minOccurs to 0 if maxOccurs="0", whereas it should raise an error.
-
-3. Allows abstract="true" in the a localElement whereas it is not allowed.
- <?xml version="1.0"?>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xsdtesting" xmlns:x="http://xsdtesting" elementFormDefault="qualified">
- <xsd:element name="doc">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="elem1"/>
- <xsd:element abstract="true" name="elem2"/> <!--This element is not valid -->
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema> \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/BUGS.txt b/mcs/class/System.XML/System.Xml.Schema/BUGS.txt
deleted file mode 100755
index cf602178c3d..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/BUGS.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Bugs in Implementation:
-
-// None of the XmlSchemaObjects except the XmlSchema populate XmlSerializerNamespaces.
-//2. Non schema attributes are not being handled. Need an internal XmlAttribute constructor.
-//3. Documentation and appInfo's Markup is not being read in the Read() Method.
diff --git a/mcs/class/System.XML/System.Xml.Schema/ChangeLog b/mcs/class/System.XML/System.Xml.Schema/ChangeLog
deleted file mode 100755
index 4c1cd1e8e9f..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/ChangeLog
+++ /dev/null
@@ -1,56 +0,0 @@
-2002-06-18 Dwivedi, Ajay kumar <adwiv@yahoo.com>
- * XmlSchema: The Read and Write methods are no more [MonoTODO] :)
-
- * XmlSchemaAppInfo: Xml Markup is now being read.
-
- * XmlSchemaDocumentation: Xml Markup is now being read.
-
- * All: Unhandled attributes are being handled properly.
-
- * All: Reordered the properties in all cs files to match with MS
- Implementation. This was required since the order is importatnt
- for the XmlSerializer.
-
-2002-06-14 Dwivedi, Ajay kumar <adwiv@yahoo.com>
- * General: Fixed a few more Bugs
-
-2002-06-10 Dwivedi, Ajay kumar <adwiv@yahoo.com>
- * XmlSchemaReader: A Wrapper class around XmlReader with customized
- methods to suit reading a schema.
- * General: Implemented Read() method for the schema. There are only
- a few minor bugs remaining.
-
-2002-05-25 Dwivedi, Ajay kumar <adwiv@yahoo.com>
- * BUGS.txt: New file to keep track of bugs
-
- * ALL: All classes are initialized exactly as in .NET except
- 1. inclusion of language attribute in schema
- 2. ComplexContent's Particle is initialized to null whereas .NET
- to some internal implementation. IMO Null is more appropriate
-
- * ALL: Changed the Compile methods to return the count of errors.
-
- * ALL: Complile methods are almost complete. Pass 1453 of 3061 tests.
- This number should shoot up if we write a parser to read the
- Schema instead of using reflection (which is slower too)
-
-2002-05-04 Dwivedi, Ajay kumar <adwiv@yahoo.com>
- * XmlSchemaUtil.cs: New file added.
-
- * Parser.cs: New file Added. Unused at the moment.
-
- * XmlSchemaObjectCollection: Fixed GetEnumerator
-
- * General: Preprocessing for Attributes and SimpleTypes completed.
-
-2002-04-26 Duncan Mak <duncan@ximian.com>
-
- * ValidationHandler.cs: New file.
-
- * XmlSchemaInfo.cs: New file.
-
- * *.cs: More updates from Ajay.
-
-2002-03-27 Duncan Mak <duncan@ximian.com>
-
- * *.cs: Updates from Ajay Dwivedi <AjayKumar.Dwivedi@dresdner-bank.com>.
diff --git a/mcs/class/System.XML/System.Xml.Schema/ValidationEventArgs.cs b/mcs/class/System.XML/System.Xml.Schema/ValidationEventArgs.cs
deleted file mode 100755
index df846514e1e..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/ValidationEventArgs.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for ValidationEventArgs.
- /// </summary>
- public sealed class ValidationEventArgs : EventArgs
- {
- private XmlSchemaException exception;
- private string message;
- private XmlSeverityType severity;
-
- private ValidationEventArgs()
- {}
-
- internal ValidationEventArgs(XmlSchemaException ex, string message, XmlSeverityType severity)
- {
- this.exception = ex;
- this.message = message;
- this.severity = severity;
- }
- public XmlSchemaException Exception
- {
- get{ return exception; }
- }
- public string Message
- {
- get{ return message; }
- }
- public XmlSeverityType Severity
- {
- get{ return severity; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/ValidationHandler.cs b/mcs/class/System.XML/System.Xml.Schema/ValidationHandler.cs
deleted file mode 100755
index 898a10a840f..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/ValidationHandler.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// </summary>
- public delegate void ValidationEventHandler(object sender,ValidationEventArgs e);
-
- /// <summary>
- /// Docs say we need to raise an exception if ValidationEventHandler is not set(null)
- /// So we use this class to raise the events rather than calling the delegate by itself
- /// </summary>
- internal class ValidationHandler
- {
- public static void RaiseValidationEvent(ValidationEventHandler handle, Exception innerException, object sender, string message, XmlSeverityType severity)
- {
- XmlSchemaException ex = new XmlSchemaException(message,innerException);
- ValidationEventArgs e = new ValidationEventArgs(ex,message,severity);
- if(handle == null)
- {
- throw e.Exception;
- }
- else
- {
- handle(sender,e);
- }
- }
- public static void RaiseValidationError(ValidationEventHandler handle, object sender, string message)
- {
- RaiseValidationEvent(handle,null,sender,message,XmlSeverityType.Error);
- }
-
- public static void RaiseValidationError(ValidationEventHandler handle, string message, Exception innerException)
- {
- RaiseValidationEvent(handle, innerException, null, message, XmlSeverityType.Error);
- }
-
- public static void RaiseValidationWarning (ValidationEventHandler handle, object sender, string message)
- {
- RaiseValidationEvent(handle,null,sender,message,XmlSeverityType.Warning);
- }
-
- public static void RaiseValidationWarning(ValidationEventHandler handle, string message, Exception innerException)
- {
- RaiseValidationEvent(handle, innerException, null, message, XmlSeverityType.Warning);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs
deleted file mode 100755
index 4be2c43d77a..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs
+++ /dev/null
@@ -1,704 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-using System.Xml;
-using System.IO;
-using System.Xml.Serialization;
-using System.ComponentModel;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchema.
- /// </summary>
- [XmlRoot("schema",Namespace="http://www.w3.org/2001/XMLSchema")]
- public class XmlSchema : XmlSchemaObject
- {
- //public constants
- public const string Namespace = "http://www.w3.org/2001/XMLSchema";
- public const string InstanceNamespace = "http://www.w3.org/2001/XMLSchema-instance";
-
- //private fields
- private XmlSchemaForm attributeFormDefault ;
- private XmlSchemaObjectTable attributeGroups ;
- private XmlSchemaObjectTable attributes ;
- private XmlSchemaDerivationMethod blockDefault ;
- private XmlSchemaForm elementFormDefault ;
- private XmlSchemaObjectTable elements ;
- private XmlSchemaDerivationMethod finalDefault ;
- private XmlSchemaObjectTable groups ;
- private string id ;
- private XmlSchemaObjectCollection includes ;
- private bool isCompiled ;
- private XmlSchemaObjectCollection items ;
- private XmlSchemaObjectTable notations ;
- private XmlSchemaObjectTable schemaTypes ;
- private string targetNamespace ;
- private XmlAttribute[] unhandledAttributes ;
- private string version;
- private string language;
-
- // Compiler specific things
- private XmlSchemaInfo info;
- private static string xmlname = "schema";
-
- public XmlSchema()
- {
- attributeFormDefault= XmlSchemaForm.None;
- blockDefault = XmlSchemaDerivationMethod.None;
- elementFormDefault = XmlSchemaForm.None;
- finalDefault = XmlSchemaDerivationMethod.None;
- includes = new XmlSchemaObjectCollection();
- isCompiled = false;
- items = new XmlSchemaObjectCollection();
- attributeGroups = new XmlSchemaObjectTable();
- attributes = new XmlSchemaObjectTable();
- elements = new XmlSchemaObjectTable();
- groups = new XmlSchemaObjectTable();
- notations = new XmlSchemaObjectTable();
- schemaTypes = new XmlSchemaObjectTable();
- }
-
- #region Properties
-
- [DefaultValue(XmlSchemaForm.None)]
- [System.Xml.Serialization.XmlAttribute("attributeFormDefault")]
- public XmlSchemaForm AttributeFormDefault
- {
- get{ return attributeFormDefault; }
- set{ this.attributeFormDefault = value;}
- }
-
- [DefaultValue(XmlSchemaDerivationMethod.None)]
- [System.Xml.Serialization.XmlAttribute("blockDefault")]
- public XmlSchemaDerivationMethod BlockDefault
- {
- get{ return blockDefault;}
- set{ blockDefault = value;}
- }
-
- [DefaultValue(XmlSchemaDerivationMethod.None)]
- [System.Xml.Serialization.XmlAttribute("finalDefault")]
- public XmlSchemaDerivationMethod FinalDefault
- {
- get{ return finalDefault;}
- set{ finalDefault = value;}
- }
-
- [DefaultValue(XmlSchemaForm.None)]
- [System.Xml.Serialization.XmlAttribute("elementFormDefault")]
- public XmlSchemaForm ElementFormDefault
- {
- get{ return elementFormDefault;}
- set{ elementFormDefault = value;}
- }
-
- [System.Xml.Serialization.XmlAttribute("targetNamespace")]
- public string TargetNamespace
- {
- get{ return targetNamespace;}
- set{ targetNamespace = value;}
- }
-
- [System.Xml.Serialization.XmlAttribute("version")]
- public string Version
- {
- get{ return version;}
- set{ version = value;}
- }
-
- [XmlElement("include",typeof(XmlSchemaInclude),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("import",typeof(XmlSchemaImport),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("redefine",typeof(XmlSchemaRedefine),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Includes
- {
- get{ return includes;}
- }
-
- [XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("group",typeof(XmlSchemaGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
- //Only Schema's attributeGroup has type XmlSchemaAttributeGroup.
- //Others (complextype, restrictions etc) must have XmlSchemaAttributeGroupRef
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("notation",typeof(XmlSchemaNotation),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("annotation",typeof(XmlSchemaAnnotation),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Items
- {
- get{ return items;}
- }
-
- [XmlIgnore]
- public bool IsCompiled
- {
- get{ return isCompiled;}
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable Attributes
- {
- get{ return attributes;}
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable AttributeGroups
- {
- get{ return attributeGroups; }
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable SchemaTypes
- {
- get{ return schemaTypes; }
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable Elements
- {
- get{ return elements;}
- }
-
- [System.Xml.Serialization.XmlAttribute("id")]
- public string Id
- {
- get{ return id;}
- set{ id = value;}
- }
-
- [XmlAnyAttribute]
- public XmlAttribute[] UnhandledAttributes
- {
- get
- {
- if(unhandledAttributeList != null)
- {
- unhandledAttributes = (XmlAttribute[]) unhandledAttributeList.ToArray(typeof(XmlAttribute));
- unhandledAttributeList = null;
- }
- return unhandledAttributes;
- }
- set
- {
- unhandledAttributes = value;
- unhandledAttributeList = null;
- }
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable Groups
- {
- get{ return groups;}
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable Notations
- {
- get{ return notations;}
- }
-
- // New attribute defined in W3C schema element
- [System.Xml.Serialization.XmlAttribute("xml:lang")]
- public string Language
- {
- get{ return language; }
- set{ language = value; }
- }
-
- #endregion
-
- #region Compile
-
- // Methods
- /// <summary>
- /// This compile method does two things:
- /// 1. It compiles and fills the PSVI dataset
- /// 2. Validates the schema by calling Validate method.
- /// Every XmlSchemaObject has a Compile Method which gets called.
- /// </summary>
- /// <remarks>
- /// 1. blockDefault must be one of #all | List of (extension | restriction | substitution)
- /// 2. finalDefault must be one of (#all | List of (extension | restriction| union| list))
- /// 3. id must be of type ID
- /// 4. targetNamespace should be any uri
- /// 5. version should be a normalizedString
- /// 6. xml:lang should be a language
- /// </remarks>
- [MonoTODO]
- public void Compile(ValidationEventHandler handler)
- {
- // Create the xmlschemainfo object which we use to pass variables like targetnamespace;
- info = new XmlSchemaInfo();
-
- //1. Union and List are not allowed in block default
- if(BlockDefault != XmlSchemaDerivationMethod.All)
- {
- if((BlockDefault & XmlSchemaDerivationMethod.List)!=0 )
- error(handler, "list is not allowed in blockDefault attribute");
- if((BlockDefault & XmlSchemaDerivationMethod.Union)!=0 )
- error(handler, "union is not allowed in blockDefault attribute");
- }
-
- //2. Substitution is not allowed in finaldefault.
- if(FinalDefault != XmlSchemaDerivationMethod.All)
- {
- if((FinalDefault & XmlSchemaDerivationMethod.Substitution)!=0 )
- error(handler, "substitution is not allowed in finalDefault attribute");
- }
-
- //3. id must be of type ID
- XmlSchemaUtil.CompileID(Id, this, info.IDCollection, handler);
-
- //4. targetNamespace should be of type anyURI or absent
- if(TargetNamespace != null)
- {
- if(!XmlSchemaUtil.CheckAnyUri(TargetNamespace))
- error(handler, TargetNamespace+" is not a valid value for targetNamespace attribute of schema");
- else
- info.TargetNamespace = TargetNamespace;
- }
-
- //5. version should be of type normalizedString
- if(!XmlSchemaUtil.CheckNormalizedString(Version))
- error(handler, Version + "is not a valid value for version attribute of schema");
-
- //6. xml:lang must be a language
- if(!XmlSchemaUtil.CheckLanguage(Language))
- error(handler, Language + " is not a valid language");
-
- // elementFormDefault defaults to UnQualified
- if(ElementFormDefault != XmlSchemaForm.Qualified)
- info.ElementFormDefault = XmlSchemaForm.Unqualified;
- else
- info.ElementFormDefault = XmlSchemaForm.Qualified;
-
- // attributeFormDefault defaults to UnQualified
- if(AttributeFormDefault != XmlSchemaForm.Qualified)
- info.AttributeFormDefault = XmlSchemaForm.Unqualified;
- else
- info.AttributeFormDefault = XmlSchemaForm.Qualified;
-
- if(FinalDefault == XmlSchemaDerivationMethod.All)
- info.FinalDefault = XmlSchemaDerivationMethod.All;
- else // If finalDefault is None, info's finalDefault is set to empty
- info.FinalDefault = (FinalDefault & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
-
- if(BlockDefault == XmlSchemaDerivationMethod.All)
- info.BlockDefault = XmlSchemaDerivationMethod.All;
- else // If finalDefault is None, info's blockDefault is set to empty
- info.BlockDefault = (blockDefault & (XmlSchemaDerivationMethod.Extension |
- XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Substitution));
-
- // Compile the content of this schema
- foreach(XmlSchemaObject obj in Includes)
- {
- if(obj is XmlSchemaExternal)
- {
- //FIXME: Kuch to karo! (Do Something ;)
- }
- else
- {
- error(handler,"Object of Type "+obj.GetType().Name+" is not valid in Includes Property of XmlSchema");
- }
- }
- foreach(XmlSchemaObject obj in Items)
- {
- if(obj is XmlSchemaAnnotation)
- {
- int numerr = ((XmlSchemaAnnotation)obj).Compile(handler,info);
- errorCount += numerr;
- if( numerr == 0)
- {
- //FIXME: What PSVI set do we add this to?
- }
- }
- else if(obj is XmlSchemaAttribute)
- {
- XmlSchemaAttribute attr = (XmlSchemaAttribute) obj;
- attr.parentIsSchema = true;
- int numerr = attr.Compile(handler,info);
- errorCount += numerr;
- if(numerr == 0)
- {
- Attributes.Add(attr.QualifiedName, attr);
- }
- }
- else if(obj is XmlSchemaAttributeGroup)
- {
- XmlSchemaAttributeGroup attrgrp = (XmlSchemaAttributeGroup) obj;
- int numerr = attrgrp.Compile(handler,info);
- errorCount += numerr;
- if(numerr == 0)
- {
- AttributeGroups.Add(attrgrp.QualifiedName, attrgrp);
- }
- }
- else if(obj is XmlSchemaComplexType)
- {
- XmlSchemaComplexType ctype = (XmlSchemaComplexType) obj;
- ctype.istoplevel = true;
- int numerr = ctype.Compile(handler,info);
- errorCount += numerr;
- if(numerr == 0)
- {
- schemaTypes.Add(ctype.QualifiedName, ctype);
- }
- }
- else if(obj is XmlSchemaSimpleType)
- {
- XmlSchemaSimpleType stype = (XmlSchemaSimpleType) obj;
- stype.islocal = false; //This simple type is toplevel
- int numerr = stype.Compile(handler,info);
- errorCount += numerr;
- if(numerr == 0)
- {
- SchemaTypes.Add(stype.QualifiedName, stype);
- }
- }
- else if(obj is XmlSchemaElement)
- {
- XmlSchemaElement elem = (XmlSchemaElement) obj;
- elem.parentIsSchema = true;
- int numerr = elem.Compile(handler,info);
- errorCount += numerr;
- if(numerr == 0)
- {
- Elements.Add(elem.QualifiedName,elem);
- }
- }
- else if(obj is XmlSchemaGroup)
- {
- XmlSchemaGroup grp = (XmlSchemaGroup) obj;
- int numerr = grp.Compile(handler,info);
- errorCount += numerr;
- if(numerr == 0)
- {
- Groups.Add(grp.QualifiedName,grp);
- }
- }
- else if(obj is XmlSchemaNotation)
- {
- XmlSchemaNotation ntn = (XmlSchemaNotation) obj;
- int numerr = ntn.Compile(handler,info);
- errorCount += numerr;
- if(numerr == 0)
- {
- Notations.Add(ntn.QualifiedName, ntn);
- }
- }
- else
- {
- ValidationHandler.RaiseValidationError(handler,this,
- "Object of Type "+obj.GetType().Name+" is not valid in Item Property of Schema");
- }
- }
- Validate(handler);
- }
-
- #endregion
-
- [MonoTODO]
- private void Validate(ValidationEventHandler handler)
- {
- foreach(XmlSchemaAttribute attr in Attributes.Values)
- {
- attr.Validate(handler);
- }
- foreach(XmlSchemaAttributeGroup attrgrp in AttributeGroups.Values)
- {
- attrgrp.Validate(handler);
- }
- foreach(XmlSchemaType type in SchemaTypes.Values)
- {
- if(type is XmlSchemaComplexType)
- {
- ((XmlSchemaComplexType)type).Validate(handler);
- }
- else
- ((XmlSchemaSimpleType)type).Validate(handler);
- }
- foreach(XmlSchemaElement elem in Elements.Values)
- {
- elem.Validate(handler);
- }
- foreach(XmlSchemaGroup grp in Groups.Values)
- {
- grp.Validate(handler);
- }
- foreach(XmlSchemaNotation ntn in Notations.Values)
- {
- ntn.Validate(handler);
- }
- }
-
-
- #region Read
-
- public static XmlSchema Read(TextReader reader, ValidationEventHandler validationEventHandler)
- {
- return Read(new XmlTextReader(reader),validationEventHandler);
- }
- public static XmlSchema Read(Stream stream, ValidationEventHandler validationEventHandler)
- {
- return Read(new XmlTextReader(stream),validationEventHandler);
- }
-
- public static XmlSchema Read(XmlReader rdr, ValidationEventHandler validationEventHandler)
- {
- //XmlSerializer xser = new XmlSerializer(typeof(XmlSchema));
- //return (XmlSchema) xser.Deserialize(reader);
- XmlSchemaReader reader = new XmlSchemaReader(rdr, validationEventHandler);
-
- while(reader.ReadNextElement())
- {
- switch(reader.NodeType)
- {
- case XmlNodeType.Element:
- if(reader.LocalName == "schema")
- {
- XmlSchema schema = new XmlSchema();
-
- schema.LineNumber = reader.LineNumber;
- schema.LinePosition = reader.LinePosition;
- schema.SourceUri = reader.BaseURI;
-
- ReadAttributes(schema, reader, validationEventHandler);
- //IsEmptyElement does not behave properly if reader is
- //positioned at an attribute.
- reader.MoveToElement();
- if(!reader.IsEmptyElement)
- {
- ReadContent(schema, reader, validationEventHandler);
- }
- return schema;
- }
- else
- {
- //Schema can't be generated. Throw an exception
- throw new XmlSchemaException("The root element must be schema", null);
- }
- default:
- error(validationEventHandler, "This should never happen. XmlSchema.Read 1 ",null);
- break;
- }
- }
- throw new XmlSchemaException("The top level schema must have namespace "+XmlSchema.Namespace, null);
- }
-
- private static void ReadAttributes(XmlSchema schema, XmlSchemaReader reader, ValidationEventHandler h)
- {
- Exception ex;
-
- reader.MoveToElement();
- while(reader.MoveToNextAttribute())
- {
- switch(reader.Name)
- {
- case "attributeFormDefault" :
- schema.attributeFormDefault = XmlSchemaUtil.ReadFormAttribute(reader,out ex);
- if(ex != null)
- error(h, reader.Value + " is not a valid value for attributeFormDefault.", ex);
- break;
- case "blockDefault" :
- schema.blockDefault = XmlSchemaUtil.ReadDerivationAttribute(reader,out ex, "blockDefault");
- if(ex != null)
- warn(h, ex.Message, ex);
- break;
- case "elementFormDefault":
- schema.elementFormDefault = XmlSchemaUtil.ReadFormAttribute(reader, out ex);
- if(ex != null)
- error(h, reader.Value + " is not a valid value for elementFormDefault.", ex);
- break;
- case "finalDefault":
- schema.finalDefault = XmlSchemaUtil.ReadDerivationAttribute(reader, out ex, "finalDefault");
- if(ex != null)
- warn(h, ex.Message , ex);
- break;
- case "id":
- schema.id = reader.Value;
- break;
- case "targetNamespace":
- schema.targetNamespace = reader.Value;
- break;
- case "version":
- schema.version = reader.Value;
- break;
- case "xml:lang":
- schema.language = reader.Value;
- break;
- default:
- if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- error(h, reader.Name + " attribute is not allowed in schema element",null);
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,schema);
- }
- break;
- }
- }
- }
-
- private static void ReadContent(XmlSchema schema, XmlSchemaReader reader, ValidationEventHandler h)
- {
- reader.MoveToElement();
- if(reader.LocalName != "schema" && reader.NamespaceURI != XmlSchema.Namespace && reader.NodeType != XmlNodeType.Element)
- error(h, "UNREACHABLE CODE REACHED: Method: Schema.ReadContent, " + reader.LocalName + ", " + reader.NamespaceURI,null);
-
- //(include | import | redefine | annotation)*,
- //((simpleType | complexType | group | attributeGroup | element | attribute | notation | annotation)*
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchema.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1)
- {
- if(reader.LocalName == "include")
- {
- XmlSchemaInclude include = XmlSchemaInclude.Read(reader,h);
- if(include != null)
- schema.includes.Add(include);
- continue;
- }
- if(reader.LocalName == "import")
- {
- XmlSchemaImport import = XmlSchemaImport.Read(reader,h);
- if(import != null)
- schema.includes.Add(import);
- continue;
- }
- if(reader.LocalName == "redefine")
- {
- XmlSchemaRedefine redefine = XmlSchemaRedefine.Read(reader,h);
- if(redefine != null)
- schema.includes.Add(redefine);
- continue;
- }
- if(reader.LocalName == "annotation")
- {
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- schema.items.Add(annotation);
- continue;
- }
- }
- if(level <=2)
- {
- level = 2;
- if(reader.LocalName == "simpleType")
- {
- XmlSchemaSimpleType stype = XmlSchemaSimpleType.Read(reader,h);
- if(stype != null)
- schema.items.Add(stype);
- continue;
- }
- if(reader.LocalName == "complexType")
- {
- XmlSchemaComplexType ctype = XmlSchemaComplexType.Read(reader,h);
- if(ctype != null)
- schema.items.Add(ctype);
- continue;
- }
- if(reader.LocalName == "group")
- {
- XmlSchemaGroup group = XmlSchemaGroup.Read(reader,h);
- if(group != null)
- schema.items.Add(group);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- XmlSchemaAttributeGroup attributeGroup = XmlSchemaAttributeGroup.Read(reader,h);
- if(attributeGroup != null)
- schema.items.Add(attributeGroup);
- continue;
- }
- if(reader.LocalName == "element")
- {
- XmlSchemaElement element = XmlSchemaElement.Read(reader,h);
- if(element != null)
- schema.items.Add(element);
- continue;
- }
- if(reader.LocalName == "attribute")
- {
- XmlSchemaAttribute attr = XmlSchemaAttribute.Read(reader,h);
- if(attr != null)
- schema.items.Add(attr);
- continue;
- }
- if(reader.LocalName == "notation")
- {
- XmlSchemaNotation notation = XmlSchemaNotation.Read(reader,h);
- if(notation != null)
- schema.items.Add(notation);
- continue;
- }
- if(reader.LocalName == "annotation")
- {
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- schema.items.Add(annotation);
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- }
- #endregion
-
- #region write
-
- public void Write(System.IO.Stream stream)
- {
- Write(stream,null);
- }
- public void Write(System.IO.TextWriter writer)
- {
- Write(writer,null);
- }
- public void Write(System.Xml.XmlWriter writer)
- {
- Write(writer,null);
- }
- public void Write(System.IO.Stream stream, System.Xml.XmlNamespaceManager namespaceManager)
- {
- Write(new XmlTextWriter(stream,null),namespaceManager);
- }
- public void Write(System.IO.TextWriter writer, System.Xml.XmlNamespaceManager namespaceManager)
- {
- XmlTextWriter xwriter = new XmlTextWriter(writer);
- xwriter.Formatting = Formatting.Indented;
- Write(xwriter,namespaceManager);
- }
- public void Write(System.Xml.XmlWriter writer, System.Xml.XmlNamespaceManager namespaceManager)
- {
- if(Namespaces == null)
- {
- Namespaces = new XmlSerializerNamespaces();
- }
-
- if(namespaceManager != null)
- {
- foreach(string name in namespaceManager)
- {
- //xml and xmlns namespaced are added by default in namespaceManager.
- //So we should ignore them
- if(name!="xml" && name != "xmlns")
- Namespaces.Add(name,namespaceManager.LookupNamespace(name));
- }
- }
-
- XmlSerializer xser = new XmlSerializer(typeof(XmlSchema));
- xser.Serialize(writer,this,Namespaces);
- writer.Flush();
- }
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs
deleted file mode 100755
index 21e52e7e5b6..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAll.
- /// </summary>
- public class XmlSchemaAll : XmlSchemaGroupBase
- {
- private XmlSchemaObjectCollection items;
- private static string xmlname = "all";
-
- public XmlSchemaAll()
- {
- items = new XmlSchemaObjectCollection();
- }
-
- [XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
- public override XmlSchemaObjectCollection Items
- {
- get{ return items; }
- }
-
- /// <remarks>
- /// 1. MaxOccurs must be one. (default is also one)
- /// 2. MinOccurs must be zero or one.
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- //FIXME: Should we reset the values on error??
- if(MaxOccurs != Decimal.One)
- error(h,"maxOccurs must be 1");
- if(MinOccurs != Decimal.One && MinOccurs != Decimal.Zero)
- error(h,"minOccurs must be 0 or 1");
-
- XmlSchemaUtil.CompileID(Id, this, info.IDCollection, h);
-
- foreach(XmlSchemaObject obj in Items)
- {
- if(obj is XmlSchemaElement)
- {
- XmlSchemaElement elem = (XmlSchemaElement)obj;
- if(elem.MaxOccurs != Decimal.One && elem.MaxOccurs != Decimal.Zero)
- {
- elem.error(h,"The {max occurs} of all the elements of 'all' must be 0 or 1. ");
- }
- errorCount += elem.Compile(h,info);
- }
- else
- {
- error(h,"XmlSchemaAll can only contain Items of type Element");
- }
- }
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<all
- // id = ID
- // maxOccurs = 1 : 1
- // minOccurs = (0 | 1) : 1
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, element*)
- //</all>
- internal static XmlSchemaAll Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaAll all = new XmlSchemaAll();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAll.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- all.LineNumber = reader.LineNumber;
- all.LinePosition = reader.LinePosition;
- all.SourceUri = reader.BaseURI;
-
- //Read Attributes
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- all.Id = reader.Value;
- }
- else if(reader.Name == "maxOccurs")
- {
- try
- {
- all.MaxOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for maxOccurs",e);
- }
- }
- else if(reader.Name == "minOccurs")
- {
- try
- {
- all.MinOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for minOccurs",e);
- }
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for all",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,all);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return all;
-
- //Content: (annotation?, element*)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaAll.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- all.Annotation = annotation;
- continue;
- }
- if(level <=2 && reader.LocalName == "element")
- {
- level = 2;
- XmlSchemaElement element = XmlSchemaElement.Read(reader,h);
- if(element != null)
- all.items.Add(element);
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return all;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs
deleted file mode 100755
index 6631dfed480..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAnnotated.
- /// </summary>
-
- public class XmlSchemaAnnotated : XmlSchemaObject
- {
- private XmlSchemaAnnotation annotation;
- private string id;
- private XmlAttribute[] unhandledAttributes;
-
- public XmlSchemaAnnotated()
- {}
-
- [System.Xml.Serialization.XmlAttribute("id")]
- public string Id
- {
- get{ return id; }
- set{ id = value; }
- }
-
- [XmlElement("annotation",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnnotation Annotation
- {
- get{ return annotation; }
- set{ annotation = value; }
- }
-
- [XmlAnyAttribute]
- public XmlAttribute[] UnhandledAttributes
- {
- get
- {
- if(unhandledAttributeList != null)
- {
- unhandledAttributes = (XmlAttribute[]) unhandledAttributeList.ToArray(typeof(XmlAttribute));
- unhandledAttributeList = null;
- }
- return unhandledAttributes;
- }
- set
- {
- unhandledAttributes = value;
- unhandledAttributeList = null;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs
deleted file mode 100755
index 12fe3d26875..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAnnotation.
- /// </summary>
- public class XmlSchemaAnnotation : XmlSchemaObject
- {
- private string id;
- private XmlSchemaObjectCollection items;
- private XmlAttribute[] unhandledAttributes;
- private static string xmlname = "annotation";
- public XmlSchemaAnnotation()
- {
- items = new XmlSchemaObjectCollection();
- }
-
- [System.Xml.Serialization.XmlAttribute("id")]
- public string Id
- {
- get{ return id; }
- set{ id = value; }
- }
-
- [XmlElement("appinfo",typeof(XmlSchemaAppInfo),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("documentation",typeof(XmlSchemaDocumentation),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Items
- {
- get{ return items; }
- }
-
- [XmlAnyAttribute]
- public XmlAttribute[] UnhandledAttributes
- {
- get
- {
- if(unhandledAttributeList != null)
- {
- unhandledAttributes = (XmlAttribute[]) unhandledAttributeList.ToArray(typeof(XmlAttribute));
- unhandledAttributeList = null;
- }
- return unhandledAttributes;
- }
- set
- {
- unhandledAttributes = value;
- unhandledAttributeList = null;
- }
- }
-
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- return 0;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return 0;
- }
-
- //<annotation
- // id = ID
- // {any attributes with non-schema namespace . . .}>
- // Content: (appinfo | documentation)*
- //</annotation>
- internal static XmlSchemaAnnotation Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAnnotation.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- annotation.LineNumber = reader.LineNumber;
- annotation.LinePosition = reader.LinePosition;
- annotation.SourceUri = reader.BaseURI;
-
- //Read Attributes
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- annotation.Id = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for annotation",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,annotation);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return annotation;
-
- //Content: (appinfo | documentation)*
- bool skip = false;
- while(!reader.EOF)
- {
- if(skip)
- skip=false;
- else
- reader.ReadNextElement();
-
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaAnnotation.Read, name="+reader.Name,null);
- break;
- }
- if(reader.LocalName == "appinfo")
- {
- XmlSchemaAppInfo appinfo = XmlSchemaAppInfo.Read(reader,h,out skip);
- if(appinfo != null)
- annotation.items.Add(appinfo);
- continue;
- }
- if(reader.LocalName == "documentation")
- {
- XmlSchemaDocumentation documentation = XmlSchemaDocumentation.Read(reader,h, out skip);
- if(documentation != null)
- annotation.items.Add(documentation);
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return annotation;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs
deleted file mode 100755
index 6f652481669..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-using System.ComponentModel;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAny.
- /// </summary>
- public class XmlSchemaAny : XmlSchemaParticle
- {
- private string nameSpace;
- private XmlSchemaContentProcessing processing;
- private static string xmlname = "any";
-
- public XmlSchemaAny()
- {
- }
-
- [System.Xml.Serialization.XmlAttribute("namespace")]
- public string Namespace
- {
- get{ return nameSpace; }
- set{ nameSpace = value; }
- }
-
- [DefaultValue(XmlSchemaContentProcessing.None)]
- [System.Xml.Serialization.XmlAttribute("processContents")]
- public XmlSchemaContentProcessing ProcessContents
- {
- get{ return processing; }
- set{ processing = value; }
- }
-
- /// <remarks>
- /// 1. id must be of type ID
- /// 2. namespace can have one of the following values:
- /// a) ##any or ##other
- /// b) list of anyURI and ##targetNamespace and ##local
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- //define ##any=1,##other=2,##targetNamespace=4,##local=8,anyURI=16
- int nscount = 0;
- string[] nslist = XmlSchemaUtil.SplitList(Namespace);
- foreach(string ns in nslist)
- {
- switch(ns)
- {
- case "##any":
- nscount |= 1;
- break;
- case "##other":
- nscount |= 2;
- break;
- case "##targetNamespace":
- nscount |= 4;
- break;
- case "##local":
- nscount |= 8;
- break;
- default:
- if(!XmlSchemaUtil.CheckAnyUri(ns))
- error(h,"the namespace is not a valid anyURI");
- else
- nscount |= 16;
- break;
- }
- }
- if((nscount&1) == 1 && nscount != 1)
- error(h,"##any if present must be the only namespace attribute");
- if((nscount&2) == 2 && nscount != 2)
- error(h,"##other if present must be the only namespace attribute");
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<any
- // id = ID
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- // minOccurs = nonNegativeInteger : 1
- // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
- // processContents = (lax | skip | strict) : strict
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</any>
- internal static XmlSchemaAny Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaAny any = new XmlSchemaAny();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAny.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- any.LineNumber = reader.LineNumber;
- any.LinePosition = reader.LinePosition;
- any.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- any.Id = reader.Value;
- }
- else if(reader.Name == "maxOccurs")
- {
- try
- {
- any.MaxOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for maxOccurs",e);
- }
- }
- else if(reader.Name == "minOccurs")
- {
- try
- {
- any.MinOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for minOccurs", e);
- }
- }
- else if(reader.Name == "namespace")
- {
- any.nameSpace = reader.Value;
- }
- else if(reader.Name == "processContents")
- {
- Exception innerex;
- any.processing = XmlSchemaUtil.ReadProcessingAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for processContents",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for any",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,any);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return any;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaAny.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- any.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return any;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs
deleted file mode 100755
index fb1a515e5ca..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.ComponentModel;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAnyAttribute.
- /// </summary>
- public class XmlSchemaAnyAttribute : XmlSchemaAnnotated
- {
- private string nameSpace;
- private XmlSchemaContentProcessing processing;
- private static string xmlname = "anyAttribute";
-
- public XmlSchemaAnyAttribute()
- {
- }
-
- [System.Xml.Serialization.XmlAttribute("namespace")]
- public string Namespace
- {
- get{ return nameSpace; }
- set{ nameSpace = value; }
- }
-
- [DefaultValue(XmlSchemaContentProcessing.None)]
- [System.Xml.Serialization.XmlAttribute("processContents")]
- public XmlSchemaContentProcessing ProcessContents
- {
- get{ return processing; }
- set{ processing = value; }
- }
-
- /// <remarks>
- /// 1. id must be of type ID
- /// 2. namespace can have one of the following values:
- /// a) ##any or ##other
- /// b) list of anyURI and ##targetNamespace and ##local
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- //define ##any=1,##other=2,##targetNamespace=4,##local=8,anyURI=16
- int nscount = 0;
- string[] nslist = XmlSchemaUtil.SplitList(Namespace);
- foreach(string ns in nslist)
- {
- switch(ns)
- {
- case "##any":
- nscount |= 1;
- break;
- case "##other":
- nscount |= 2;
- break;
- case "##targetNamespace":
- nscount |= 4;
- break;
- case "##local":
- nscount |= 8;
- break;
- default:
- if(!XmlSchemaUtil.CheckAnyUri(ns))
- error(h,"the namespace is not a valid anyURI");
- else
- nscount |= 16;
- break;
- }
- }
- if((nscount&1) == 1 && nscount != 1)
- error(h,"##any if present must be the only namespace attribute");
- if((nscount&2) == 2 && nscount != 2)
- error(h,"##other if present must be the only namespace attribute");
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<anyAttribute
- // id = ID
- // namespace = ((##any | ##other) | List of (anyURI | (##targetNamespace | ##local)) ) : ##any
- // processContents = (lax | skip | strict) : strict
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</anyAttribute>
- internal static XmlSchemaAnyAttribute Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaAnyAttribute any = new XmlSchemaAnyAttribute();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAnyAttribute.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- any.LineNumber = reader.LineNumber;
- any.LinePosition = reader.LinePosition;
- any.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- any.Id = reader.Value;
- }
- else if(reader.Name == "namespace")
- {
- any.nameSpace = reader.Value;
- }
- else if(reader.Name == "processContents")
- {
- Exception innerex;
- any.processing = XmlSchemaUtil.ReadProcessingAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for processContents",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for anyAttribute",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,any);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return any;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaAnyAttribute.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- any.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return any;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs
deleted file mode 100755
index da66837c504..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAppInfo.
- /// </summary>
- public class XmlSchemaAppInfo : XmlSchemaObject
- {
- private XmlNode[] markup;
- private string source;
-
- public XmlSchemaAppInfo()
- {
- }
-
- [System.Xml.Serialization.XmlAttribute("source")]
- public string Source
- {
- get{ return source; }
- set{ source = value; }
- }
-
- [XmlAnyElement]
- [XmlText]
- public XmlNode[] Markup
- {
- get{ return markup; }
- set{ markup = value; }
- }
-
- //<appinfo
- // source = anyURI>
- // Content: ({any})*
- //</appinfo>
- internal static XmlSchemaAppInfo Read(XmlSchemaReader reader, ValidationEventHandler h, out bool skip)
- {
- skip = false;
- XmlSchemaAppInfo appinfo = new XmlSchemaAppInfo();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != "appinfo")
- {
- error(h,"Should not happen :1: XmlSchemaAppInfo.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- appinfo.LineNumber = reader.LineNumber;
- appinfo.LinePosition = reader.LinePosition;
- appinfo.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "source")
- {
- appinfo.source = reader.Value;
- }
- else
- {
- error(h,reader.Name + " is not a valid attribute for appinfo",null);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return appinfo;
-
- //Content {any}*
- //FIXME: This is a pure Quick Hack; There must be a another method;
- XmlDocument xmldoc = new XmlDocument();
- xmldoc.AppendChild(xmldoc.ReadNode(reader));
- XmlNode root = xmldoc.FirstChild;
- if(root != null && root.ChildNodes != null)
- {
- appinfo.Markup = new XmlNode[root.ChildNodes.Count];
- for(int i=0;i<root.ChildNodes.Count;i++)
- {
- appinfo.Markup[i] = root.ChildNodes[i];
- }
- }
- if(reader.NodeType == XmlNodeType.Element || reader.NodeType == XmlNodeType.EndElement)
- skip = true;
- return appinfo;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs
deleted file mode 100755
index fb08f0aac82..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs
+++ /dev/null
@@ -1,384 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.ComponentModel;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAttribute.
- /// </summary>
- public class XmlSchemaAttribute : XmlSchemaAnnotated
- {
- private object attributeType;
- private string defaultValue;
- private string fixedValue;
- private XmlSchemaForm form;
- private string name;
- private XmlQualifiedName qualifiedName;
- private XmlQualifiedName refName;
- private XmlSchemaSimpleType schemaType;
- private XmlQualifiedName schemaTypeName;
- private XmlSchemaUse use;
- //Compilation fields
- internal bool parentIsSchema = false;
- private static string xmlname = "attribute";
-
- public XmlSchemaAttribute()
- {
- //FIXME: Docs says the default is optional.
- //Whereas the MS implementation has default None.
- form = XmlSchemaForm.None;
- use = XmlSchemaUse.None;
- schemaTypeName = XmlQualifiedName.Empty;
- qualifiedName = XmlQualifiedName.Empty;
- refName = XmlQualifiedName.Empty;
- }
-
- // Properties
- #region Properties
-
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("default")]
- public string DefaultValue
- {
- get{ return defaultValue;}
- set
- { // Default Value and fixed Value are mutually exclusive
- fixedValue = null;
- defaultValue = value;
- }
- }
-
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("fixed")]
- public string FixedValue
- {
- get{ return fixedValue;}
- set
- { // Default Value and fixed Value are mutually exclusive
- defaultValue = null;
- fixedValue = value;
- }
- }
-
- [DefaultValue(XmlSchemaForm.None)]
- [System.Xml.Serialization.XmlAttribute("form")]
- public XmlSchemaForm Form
- {
- get{ return form;}
- set{ form = value;}
- }
-
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name;}
- set
- {
- name = value;
- }
- }
-
- [System.Xml.Serialization.XmlAttribute("ref")]
- public XmlQualifiedName RefName
- {
- get{ return refName;}
- set
- {
- refName = value;
- }
- }
-
- [System.Xml.Serialization.XmlAttribute("type")]
- public XmlQualifiedName SchemaTypeName
- {
- get{ return schemaTypeName;}
- set{ schemaTypeName = value;}
- }
-
- [XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaSimpleType SchemaType
- {
- get{ return schemaType;}
- set{ schemaType = value;}
- }
-
- [DefaultValue(XmlSchemaUse.None)]
- [System.Xml.Serialization.XmlAttribute("use")]
- public XmlSchemaUse Use
- {
- get{ return use;}
- set{ use = value;}
- }
-
- [XmlIgnore]
- public XmlQualifiedName QualifiedName
- {
- get{ return qualifiedName;}
- }
-
- [XmlIgnore]
- public object AttributeType
- { //FIXME: This is not correct. Is it?
- get{ return attributeType; }
- }
-
- #endregion
-
- /// <remarks>
- /// For an attribute:
- /// a) If the parent is schema
- /// 1-5 are from <xs:complexType name="topLevelAttribute"> in the Schema for Schema
- /// 6-8 are from "Constraints on XML Representations of Attribute Declarations"
- /// 9-10 are from "Attribute Declaration Schema Component"
- /// 11-16 are from "Constraints on Attribute Declaration Schema Components"
- /// 1. ref must be absent
- /// 2. form must be absent
- /// 3. use must be absent
- /// 4. name must be present and of type NCName
- /// 5. *NO CHECK REQUIRED* Only simple types and annotation are allowed as content
- /// 6. default and fixed must not both be present.
- /// 7. *NO CHECK REQUIRED* If default and use are both present... (Not possible since use is absent)
- /// 8. type and <simpleType> must not both be present.
- /// 9. Target Namespace should be schema's targetnamespace or absent
- /// 10. Type Definiton coressponds to <simpletype> element, or type value, or absent
- /// 11. *TO UNDERSTAND* Missing Sub-components
- /// 12. value constraint must be of the same datatype as of type
- /// 13. if the type definition is ID then there should be no value constraint.
- /// 14. name must not be xmlns
- /// 15. Targetnamespace must not be xsi. This implies the target namespace of schema can't be xsi if toplevel attributes are used.
- /// 16. *Exception to rule 15* inbuilt attributes: xsi:nil, xsi:type, xsi:schemaLocation, xsi: noNamespaceSchemaLocation
- /// b) If the parent is complextype and ref is not set
- /// 1. name must be present and of type NCName.
- /// 2. type and <simpleType> must not both be present.
- /// 3. default and fixed must not both be present.
- /// 4. If default and use are both present, use must have the ˇactual valueˇ optional.
- /// 5. name must not be xmlns
- /// 6. Targetnamespace must not be xsi.
- /// 7. *Exception to rule 15* inbuilt attributes: xsi:nil, xsi:type, xsi:schemaLocation, xsi: noNamespaceSchemaLocation
- /// 8. If form has actual value qualified or the schema's formdefault is qualified, targetnamespace
- /// is same as schema's target namespace, otherwise absent.
- /// c) if the parent is not schema and ref is set
- /// 1. name must not be present
- /// 2. all of <simpleType>, form and type must be absent.
- /// 3. default and fixed must not both be present.
- /// 4. If default and use are both present, use must have the ˇactual valueˇ optional.
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- if(parentIsSchema)//a
- {
- if(RefName!= null && !RefName.IsEmpty) // a.1
- error(h,"ref must be absent in the top level <attribute>");
-
- if(Form != XmlSchemaForm.None) // a.2
- error(h,"form must be absent in the top level <attribute>");
-
- if(Use != XmlSchemaUse.None) // a.3
- error(h,"use must be absent in the top level <attribute>");
-
- // TODO: a.10, a.11, a.12, a.13
- CompileCommon(h,info, true);
- }
- else // local
- {
- //FIXME: How to Use of AttributeFormDefault????
- if(RefName == null || RefName.IsEmpty)
- {
- //TODO: b.8
- CompileCommon(h,info, true);
- }
- else
- {
- if(this.name != null)
- error(h,"name must be absent if ref is present");
- if(this.form != XmlSchemaForm.None)
- error(h,"form must be absent if ref is present");
- if(this.schemaType != null)
- error(h,"simpletype must be absent if ref is present");
- if(this.schemaTypeName != null && !this.schemaTypeName.IsEmpty)
- error(h,"type must be absent if ref is present");
- CompileCommon(h,info,false);
- }
- }
-
- return errorCount;
- }
-
- private void CompileCommon(ValidationEventHandler h, XmlSchemaInfo info, bool refIsNotPresent)
- {
- if(refIsNotPresent)
- {
- if(Name == null) //a.4, b.1,
- error(h,"Required attribute name must be present");
- else if(!XmlSchemaUtil.CheckNCName(Name)) // a.4.2, b1.2
- error(h,"attribute name must be NCName");
- else if(Name == "xmlns") // a.14 , b5
- error(h,"attribute name must not be xmlns");
- else
- qualifiedName = new XmlQualifiedName(Name, info.TargetNamespace);
-
- if(SchemaType != null)
- {
- if(SchemaTypeName != null && !SchemaTypeName.IsEmpty) // a.8
- error(h,"attribute can't have both a type and <simpleType> content");
-
- errorCount += SchemaType.Compile(h,info);
- }
-
- if(SchemaTypeName != null && !XmlSchemaUtil.CheckQName(SchemaTypeName))
- error(h,SchemaTypeName+" is not a valid QName");
- }
- else
- {
- if(RefName == null || RefName.IsEmpty)
- error(h,"Error: Should Never Happen. refname must be present");
- else
- qualifiedName = RefName;
- }
-
- if(info.TargetNamespace == XmlSchema.InstanceNamespace && Name != "nil" && Name != "type"
- && Name != "schemaLocation" && Name != "noNamespaceSchemaLocation") // a.15, a.16
- error(h,"targetNamespace can't be " + XmlSchema.InstanceNamespace);
-
- if(DefaultValue != null && FixedValue != null) // a.6, b.3, c.3
- error(h,"default and fixed must not both be present in an Attribute");
-
- if(DefaultValue != null && Use != XmlSchemaUse.None && Use != XmlSchemaUse.Optional)
- error(h,"if default is present, use must be optional");
-
- XmlSchemaUtil.CompileID(Id, this, info.IDCollection, h);
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<attribute
- // default = string
- // fixed = string
- // form = (qualified | unqualified)
- // id = ID
- // name = NCName
- // ref = QName
- // type = QName
- // use = (optional | prohibited | required) : optional
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (simpleType?))
- //</attribute>
- internal static XmlSchemaAttribute Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaAttribute attribute = new XmlSchemaAttribute();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAttribute.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- attribute.LineNumber = reader.LineNumber;
- attribute.LinePosition = reader.LinePosition;
- attribute.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "default")
- {
- attribute.defaultValue = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- attribute.fixedValue = reader.Value;
- }
- else if(reader.Name == "form")
- {
- Exception innerex;
- attribute.form = XmlSchemaUtil.ReadFormAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for form attribute", innerex);
- }
- else if(reader.Name == "id")
- {
- attribute.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- attribute.name = reader.Value;
- }
- else if(reader.Name == "ref")
- {
- Exception innerex;
- attribute.refName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for ref attribute",innerex);
- }
- else if(reader.Name == "type")
- {
- Exception innerex;
- attribute.schemaTypeName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for type attribute",innerex);
- }
- else if(reader.Name == "use")
- {
- Exception innerex;
- attribute.use = XmlSchemaUtil.ReadUseAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for use attribute", innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for attribute",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,attribute);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return attribute;
-
- // Content: (annotation?, (simpleType?))
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaAttribute.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- attribute.Annotation = annotation;
- continue;
- }
- if(level <=2 && reader.LocalName == "simpleType")
- {
- level = 3;
- XmlSchemaSimpleType stype = XmlSchemaSimpleType.Read(reader,h);
- if(stype != null)
- attribute.schemaType = stype;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return attribute;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs
deleted file mode 100755
index ab5d1da1afe..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAttributeGroup.
- /// </summary>
- public class XmlSchemaAttributeGroup : XmlSchemaAnnotated
- {
- private XmlSchemaAnyAttribute any;
- private XmlSchemaObjectCollection attributes;
- private string name;
- private XmlSchemaAttributeGroup redefined;
- private XmlQualifiedName qualifiedName;
- private static string xmlname = "attributeGroup";
-
- public XmlSchemaAttributeGroup()
- {
- attributes = new XmlSchemaObjectCollection();
- }
-
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name;}
- set{ name = value;}
- }
-
- [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Attributes
- {
- get{ return attributes;}
- }
-
- [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnyAttribute AnyAttribute
- {
- get{ return any;}
- set{ any = value;}
- }
-
- //Undocumented property
- [XmlIgnore]
- public XmlSchemaAttributeGroup RedefinedAttributeGroup
- {
- get{ return redefined;}
- }
-
- [XmlIgnore]
- internal XmlQualifiedName QualifiedName
- {
- get{ return qualifiedName;}
- }
-
- /// <remarks>
- /// An Attribute group can only be defined as a child of XmlSchema or in XmlSchemaRedefine.
- /// The other attributeGroup has type XmlSchemaAttributeGroupRef.
- /// 1. Name must be present
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- if(this.Name == null) //1
- error(h,"Name is required in top level simpletype");
- else if(!XmlSchemaUtil.CheckNCName(this.Name)) // b.1.2
- error(h,"name attribute of a simpleType must be NCName");
- else
- this.qualifiedName = new XmlQualifiedName(this.Name,info.TargetNamespace);
-
- if(this.AnyAttribute != null)
- {
- errorCount += this.AnyAttribute.Compile(h,info);
- }
-
- foreach(XmlSchemaObject obj in Attributes)
- {
- if(obj is XmlSchemaAttribute)
- {
- XmlSchemaAttribute attr = (XmlSchemaAttribute) obj;
- errorCount += attr.Compile(h, info);
- }
- else if(obj is XmlSchemaAttributeGroupRef)
- {
- XmlSchemaAttributeGroupRef gref = (XmlSchemaAttributeGroupRef) obj;
- errorCount += gref.Compile(h, info);
- }
- else
- {
- error(h,"invalid type of object in Attributes property");
- }
- }
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<attributeGroup
- // id = ID
- // name = NCName
- // ref = QName // Not present in this class.
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
- //</attributeGroup>
- internal static XmlSchemaAttributeGroup Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaAttributeGroup attrgrp = new XmlSchemaAttributeGroup();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAttributeGroup.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- attrgrp.LineNumber = reader.LineNumber;
- attrgrp.LinePosition = reader.LinePosition;
- attrgrp.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- attrgrp.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- attrgrp.name = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for attributeGroup in this context",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,attrgrp);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return attrgrp;
-
- //Content: 1.annotation?, 2.(attribute | attributeGroup)*, 3.anyAttribute?
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaAttributeGroup.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- attrgrp.Annotation = annotation;
- continue;
- }
- if(level <= 2)
- {
- if(reader.LocalName == "attribute")
- {
- level = 2;
- XmlSchemaAttribute attr = XmlSchemaAttribute.Read(reader,h);
- if(attr != null)
- attrgrp.Attributes.Add(attr);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- level = 2;
- XmlSchemaAttributeGroupRef attr = XmlSchemaAttributeGroupRef.Read(reader,h);
- if(attr != null)
- attrgrp.attributes.Add(attr);
- continue;
- }
- }
- if(level <= 3 && reader.LocalName == "anyAttribute")
- {
- level = 4;
- XmlSchemaAnyAttribute anyattr = XmlSchemaAnyAttribute.Read(reader,h);
- if(anyattr != null)
- attrgrp.AnyAttribute = anyattr;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return attrgrp;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs
deleted file mode 100755
index 0fb4a4261aa..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAttributeGroupRef.
- /// </summary>
- public class XmlSchemaAttributeGroupRef : XmlSchemaAnnotated
- {
- private XmlQualifiedName refName;
- private static string xmlname = "attributeGroup";
- public XmlSchemaAttributeGroupRef()
- {
- refName = XmlQualifiedName.Empty;
- }
-
- [System.Xml.Serialization.XmlAttribute("ref")]
- public XmlQualifiedName RefName
- {
- get{ return refName; }
- set{ refName = value; }
- }
-
- /// <remarks>
- /// 1. ref must be present
- /// 2. The element must be empty. ?? FIXME: Is this correct or annotation is permitted?
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
- if(RefName == null || RefName.IsEmpty)
- error(h, "ref must be present");
- else if(!XmlSchemaUtil.CheckQName(RefName))
- error(h, "ref must be a valid qname");
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
-// if(this.Annotation != null)
-// error(h, "attributegroup with a ref can't have any content");
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<attributeGroup
- // id = ID
- // ref = QName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</attributeGroup>
- internal static XmlSchemaAttributeGroupRef Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaAttributeGroupRef attrgrp = new XmlSchemaAttributeGroupRef();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAttributeGroupRef.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- attrgrp.LineNumber = reader.LineNumber;
- attrgrp.LinePosition = reader.LinePosition;
- attrgrp.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- attrgrp.Id = reader.Value;
- }
- else if(reader.Name == "ref")
- {
- Exception innerex;
- attrgrp.refName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for ref attribute",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for attributeGroup in this context",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,attrgrp);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return attrgrp;
- int level = 1;
-
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaAttributeGroupRef.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- attrgrp.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return attrgrp;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs
deleted file mode 100755
index 040de9d9719..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaAll.
- /// </summary>
- public class XmlSchemaChoice : XmlSchemaGroupBase
- {
- private XmlSchemaObjectCollection items;
- private static string xmlname = "choice";
-
- public XmlSchemaChoice()
- {
- items = new XmlSchemaObjectCollection();
- }
-
- [XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("any",typeof(XmlSchemaAny),Namespace="http://www.w3.org/2001/XMLSchema")]
- public override XmlSchemaObjectCollection Items
- {
- get{ return items; }
- }
-
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- //FIXME: Should we reset the values
- if(MinOccurs > MaxOccurs)
- error(h,"minOccurs must be less than or equal to maxOccurs");
-
- XmlSchemaUtil.CompileID(Id, this, info.IDCollection, h);
-
- foreach(XmlSchemaObject obj in Items)
- {
- if(obj is XmlSchemaElement)
- {
- errorCount += ((XmlSchemaElement)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaGroupRef)
- {
- errorCount += ((XmlSchemaGroupRef)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaChoice)
- {
- errorCount += ((XmlSchemaChoice)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaSequence)
- {
- errorCount += ((XmlSchemaSequence)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaAny)
- {
- errorCount += ((XmlSchemaAny)obj).Compile(h,info);
- }
- }
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<choice
- // id = ID
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- // minOccurs = nonNegativeInteger : 1
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (element | group | choice | sequence | any)*)
- //</choice>
- internal static XmlSchemaChoice Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaChoice choice = new XmlSchemaChoice();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaChoice.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- choice.LineNumber = reader.LineNumber;
- choice.LinePosition = reader.LinePosition;
- choice.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- choice.Id = reader.Value;
- }
- else if(reader.Name == "maxOccurs")
- {
- try
- {
- choice.MaxOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for maxOccurs",e);
- }
- }
- else if(reader.Name == "minOccurs")
- {
- try
- {
- choice.MinOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for minOccurs",e);
- }
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for choice",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,choice);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return choice;
-
- // Content: (annotation?, (element | group | choice | sequence | any)*)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaChoice.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- choice.Annotation = annotation;
- continue;
- }
- if(level <=2)
- {
- if(reader.LocalName == "element")
- {
- level = 2;
- XmlSchemaElement element = XmlSchemaElement.Read(reader,h);
- if(element != null)
- choice.items.Add(element);
- continue;
- }
- if(reader.LocalName == "group")
- {
- level = 2;
- XmlSchemaGroupRef group = XmlSchemaGroupRef.Read(reader,h);
- if(group != null)
- choice.items.Add(group);
- continue;
- }
- if(reader.LocalName == "choice")
- {
- level = 2;
- XmlSchemaChoice ch = XmlSchemaChoice.Read(reader,h);
- if(ch != null)
- choice.items.Add(ch);
- continue;
- }
- if(reader.LocalName == "sequence")
- {
- level = 2;
- XmlSchemaSequence sequence = XmlSchemaSequence.Read(reader,h);
- if(sequence != null)
- choice.items.Add(sequence);
- continue;
- }
- if(reader.LocalName == "any")
- {
- level = 2;
- XmlSchemaAny any = XmlSchemaAny.Read(reader,h);
- if(any != null)
- choice.items.Add(any);
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return choice;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs
deleted file mode 100755
index c4ed836b0e1..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-using System.Xml;
-
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaCollection.
- /// </summary>
- public sealed class XmlSchemaCollection : ICollection, IEnumerable
- {
- //private fields
- private Hashtable htable;
- private XmlNameTable ntable;
-
- [MonoTODO]
- public XmlSchemaCollection()
- {
- htable = new Hashtable();
- ntable = new NameTable();
- }
- public XmlSchemaCollection(XmlNameTable nametable)
- {
- htable = new Hashtable();
- ntable = nametable;
- }
-
- //properties
- public int Count
- {
- get
- {
- return this.htable.Count;
- }
- }
- public XmlNameTable NameTable
- {
- get
- {
- return this.ntable;
- }
- }
- public XmlSchema this[ string ns ]
- {
- get
- {
- return (XmlSchema) this.htable[ns];
- }
- }
-
- // Events
- public event ValidationEventHandler ValidationEventHandler;
-
- // Methods
- [MonoTODO]
- public XmlSchema Add(string ns, XmlReader reader)
- {
- return null;
- }
- [MonoTODO]
- public XmlSchema Add(string ns, string uri)
- {
- return null;
- }
- [MonoTODO]
- public XmlSchema Add(XmlSchema schema)
- {
- return null;
- }
-
- public void Add(XmlSchemaCollection schema)
- {
- XmlSchemaCollectionEnumerator xenum = schema.GetEnumerator();
- while(xenum.MoveNext())
- {
- this.Add(xenum.Current);
- }
- }
-
- public bool Contains(string ns)
- {
- return this.htable.Contains(ns);
- }
- public bool Contains(XmlSchema schema)
- {
- return this.htable.Contains(schema.TargetNamespace);
- }
- public void CopyTo(XmlSchema[] array, int index)
- {
-
- }
- public XmlSchemaCollectionEnumerator GetEnumerator()
- {
- return new XmlSchemaCollectionEnumerator(this.htable);
- }
-
- //assembly Methods
- [MonoTODO]
- void ICollection.CopyTo(Array array, int index)
- {
- }
- bool ICollection.IsSynchronized
- {
- get { return false; }
- }
- IEnumerator IEnumerable.GetEnumerator()
- {
- return this.htable.GetEnumerator();
- }
- Object ICollection.SyncRoot
- {
- get { return this; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollectionEnumerator.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollectionEnumerator.cs
deleted file mode 100755
index 3130c3094ac..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollectionEnumerator.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaCollectionEnumerator.
- /// </summary>
- public sealed class XmlSchemaCollectionEnumerator : IEnumerator
- {
- private IDictionaryEnumerator xenum;
- internal XmlSchemaCollectionEnumerator(Hashtable htable)
- {
- this.xenum = htable.GetEnumerator();
- }
- // Properties
- public XmlSchema Current
- {
- get
- {
- return (XmlSchema) xenum.Current;
- }
- }
- // Methods
- public bool MoveNext()
- {
- return xenum.MoveNext();
- }
-
- //Explicit Interface implementation
- bool IEnumerator.MoveNext()
- {
- return xenum.MoveNext();
- }
- void IEnumerator.Reset()
- {
- xenum.Reset();
- }
- object IEnumerator.Current
- {
- get{return (XmlSchema) xenum.Current;}
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs
deleted file mode 100755
index 45b07b3b1f0..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaComplexContent.
- /// </summary>
- public class XmlSchemaComplexContent : XmlSchemaContentModel
- {
- private XmlSchemaContent content;
- private bool isMixed;
- private static string xmlname = "complexContent";
-
- public XmlSchemaComplexContent()
- {}
-
- [System.Xml.Serialization.XmlAttribute("mixed")]
- public bool IsMixed
- {
- get{ return isMixed; }
- set{ isMixed = value; }
- }
-
- [XmlElement("restriction",typeof(XmlSchemaComplexContentRestriction),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("extension",typeof(XmlSchemaComplexContentExtension),Namespace="http://www.w3.org/2001/XMLSchema")]
- public override XmlSchemaContent Content
- {
- get{ return content; }
- set{ content = value; }
- }
-
- /// <remarks>
- /// 1. Content must be present
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(Content == null)
- {
- error(h, "Content must be present in a complexContent");
- }
- else
- {
- if(Content is XmlSchemaComplexContentRestriction)
- {
- XmlSchemaComplexContentRestriction xscr = (XmlSchemaComplexContentRestriction) Content;
- errorCount += xscr.Compile(h,info);
- }
- else if(Content is XmlSchemaComplexContentExtension)
- {
- XmlSchemaComplexContentExtension xsce = (XmlSchemaComplexContentExtension) Content;
- errorCount += xsce.Compile(h,info);
- }
- else
- error(h,"complexContent can't have any value other than restriction or extention");
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<complexContent
- // id = ID
- // mixed = boolean
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (restriction | extension))
- //</complexContent>
- internal static XmlSchemaComplexContent Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaComplexContent complex = new XmlSchemaComplexContent();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaComplexContent.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- complex.LineNumber = reader.LineNumber;
- complex.LinePosition = reader.LinePosition;
- complex.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- complex.Id = reader.Value;
- }
- else if(reader.Name == "mixed")
- {
- Exception innerex;
- complex.isMixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h,reader.Value + " is an invalid value for mixed",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for complexContent",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,complex);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return complex;
- //Content: (annotation?, (restriction | extension))
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaComplexContent.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- complex.Annotation = annotation;
- continue;
- }
- if(level <=2)
- {
- if(reader.LocalName == "restriction")
- {
- level = 3;
- XmlSchemaComplexContentRestriction restriction = XmlSchemaComplexContentRestriction.Read(reader,h);
- if(restriction != null)
- complex.content = restriction;
- continue;
- }
- if(reader.LocalName == "extension")
- {
- level = 3;
- XmlSchemaComplexContentExtension extension = XmlSchemaComplexContentExtension.Read(reader,h);
- if(extension != null)
- complex.content = extension;
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return complex;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs
deleted file mode 100755
index 4deced9326a..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs
+++ /dev/null
@@ -1,254 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaComplexContentExtension.
- /// </summary>
- public class XmlSchemaComplexContentExtension : XmlSchemaContent
- {
- private XmlSchemaAnyAttribute any;
- private XmlSchemaObjectCollection attributes;
- private XmlQualifiedName baseTypeName;
- private XmlSchemaParticle particle;
- private static string xmlname = "extension";
-
- public XmlSchemaComplexContentExtension()
- {
- attributes = new XmlSchemaObjectCollection();
- baseTypeName = XmlQualifiedName.Empty;
- }
-
- [System.Xml.Serialization.XmlAttribute("base")]
- public XmlQualifiedName BaseTypeName
- {
- get{ return baseTypeName; }
- set{ baseTypeName = value; }
- }
-
- [XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaParticle Particle
- {
- get{ return particle; }
- set{ particle = value; }
- }
-
- [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Attributes
- {
- get{ return attributes; }
- }
-
- [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnyAttribute AnyAttribute
- {
- get{ return any; }
- set{ any = value;}
- }
-
- /// <remarks>
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(BaseTypeName == null || BaseTypeName.IsEmpty)
- {
- error(h, "base must be present and a QName");
- }
- else if(!XmlSchemaUtil.CheckQName(BaseTypeName))
- error(h,"BaseTypeName is not a valid XmlQualifiedName");
-
- if(this.AnyAttribute != null)
- {
- errorCount += AnyAttribute.Compile(h,info);
- }
-
- foreach(XmlSchemaObject obj in Attributes)
- {
- if(obj is XmlSchemaAttribute)
- {
- XmlSchemaAttribute attr = (XmlSchemaAttribute) obj;
- errorCount += attr.Compile(h,info);
- }
- else if(obj is XmlSchemaAttributeGroupRef)
- {
- XmlSchemaAttributeGroupRef atgrp = (XmlSchemaAttributeGroupRef) obj;
- errorCount += atgrp.Compile(h,info);
- }
- else
- error(h,obj.GetType() +" is not valid in this place::ComplexConetnetExtension");
- }
-
- if(Particle != null)
- {
- if(Particle is XmlSchemaGroupRef)
- {
- errorCount += ((XmlSchemaGroupRef)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaAll)
- {
- errorCount += ((XmlSchemaAll)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaChoice)
- {
- errorCount += ((XmlSchemaChoice)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaSequence)
- {
- errorCount += ((XmlSchemaSequence)Particle).Compile(h,info);
- }
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<extension
- // base = QName
- // id = ID
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))
- //</extension>
- internal static XmlSchemaComplexContentExtension Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaComplexContentExtension extension = new XmlSchemaComplexContentExtension();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaComplexContentExtension.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- extension.LineNumber = reader.LineNumber;
- extension.LinePosition = reader.LinePosition;
- extension.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "base")
- {
- Exception innerex;
- extension.baseTypeName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for base attribute",innerex);
- }
- else if(reader.Name == "id")
- {
- extension.Id = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for extension",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,extension);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return extension;
- //Content: 1. annotation?,
- // (2.(group | all | choice | sequence)?, (3.(attribute | attributeGroup)*, 4.anyAttribute?)))
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaComplexContentExtension.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- extension.Annotation = annotation;
- continue;
- }
- if(level <= 2)
- {
- if(reader.LocalName == "group")
- {
- level = 3;
- XmlSchemaGroupRef group = XmlSchemaGroupRef.Read(reader,h);
- if(group != null)
- extension.particle = group;
- continue;
- }
- if(reader.LocalName == "all")
- {
- level = 3;
- XmlSchemaAll all = XmlSchemaAll.Read(reader,h);
- if(all != null)
- extension.particle = all;
- continue;
- }
- if(reader.LocalName == "choice")
- {
- level = 3;
- XmlSchemaChoice choice = XmlSchemaChoice.Read(reader,h);
- if(choice != null)
- extension.particle = choice;
- continue;
- }
- if(reader.LocalName == "sequence")
- {
- level = 3;
- XmlSchemaSequence sequence = XmlSchemaSequence.Read(reader,h);
- if(sequence != null)
- extension.particle = sequence;
- continue;
- }
- }
- if(level <= 3)
- {
- if(reader.LocalName == "attribute")
- {
- level = 3;
- XmlSchemaAttribute attr = XmlSchemaAttribute.Read(reader,h);
- if(attr != null)
- extension.Attributes.Add(attr);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- level = 3;
- XmlSchemaAttributeGroupRef attr = XmlSchemaAttributeGroupRef.Read(reader,h);
- if(attr != null)
- extension.attributes.Add(attr);
- continue;
- }
- }
- if(level <= 4 && reader.LocalName == "anyAttribute")
- {
- level = 5;
- XmlSchemaAnyAttribute anyattr = XmlSchemaAnyAttribute.Read(reader,h);
- if(anyattr != null)
- extension.AnyAttribute = anyattr;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return extension;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs
deleted file mode 100755
index e744a3a47c0..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs
+++ /dev/null
@@ -1,256 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaComplexContentRestriction.
- /// </summary>
- public class XmlSchemaComplexContentRestriction : XmlSchemaContent
- {
- private XmlSchemaAnyAttribute any;
- private XmlSchemaObjectCollection attributes;
- private XmlQualifiedName baseTypeName;
- private XmlSchemaParticle particle;
- private static string xmlname = "restriction";
-
- public XmlSchemaComplexContentRestriction()
- {
- baseTypeName = XmlQualifiedName.Empty;
- attributes = new XmlSchemaObjectCollection();
- }
-
- [System.Xml.Serialization.XmlAttribute("base")]
- public XmlQualifiedName BaseTypeName
- {
- get{ return baseTypeName; }
- set{ baseTypeName = value; }
- }
-
- [XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaParticle Particle
- {
- get{ return particle; }
- set{ particle = value; }
- }
-
- [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Attributes
- {
- get{ return attributes; }
- }
-
- [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnyAttribute AnyAttribute
- {
- get{ return any; }
- set{ any = value; }
- }
-
- /// <remarks>
- /// 1. base must be present
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(BaseTypeName == null || BaseTypeName.IsEmpty)
- {
- error(h, "base must be present and a QName");
- }
- else if(!XmlSchemaUtil.CheckQName(BaseTypeName))
- error(h,"BaseTypeName is not a valid XmlQualifiedName");
-
- if(this.AnyAttribute != null)
- {
- errorCount += AnyAttribute.Compile(h,info);
- }
-
- foreach(XmlSchemaObject obj in Attributes)
- {
- if(obj is XmlSchemaAttribute)
- {
- XmlSchemaAttribute attr = (XmlSchemaAttribute) obj;
- errorCount += attr.Compile(h,info);
- }
- else if(obj is XmlSchemaAttributeGroupRef)
- {
- XmlSchemaAttributeGroupRef atgrp = (XmlSchemaAttributeGroupRef) obj;
- errorCount += atgrp.Compile(h,info);
- }
- else
- error(h,obj.GetType() +" is not valid in this place::ComplexContentRestriction");
- }
-
- if(Particle != null)
- {
- if(Particle is XmlSchemaGroupRef)
- {
- errorCount += ((XmlSchemaGroupRef)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaAll)
- {
- errorCount += ((XmlSchemaAll)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaChoice)
- {
- errorCount += ((XmlSchemaChoice)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaSequence)
- {
- errorCount += ((XmlSchemaSequence)Particle).Compile(h,info);
- }
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<restriction
- // base = QName
- // id = ID
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))
- //</restriction>
- internal static XmlSchemaComplexContentRestriction Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaComplexContentRestriction restriction = new XmlSchemaComplexContentRestriction();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaComplexContentRestriction.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- restriction.LineNumber = reader.LineNumber;
- restriction.LinePosition = reader.LinePosition;
- restriction.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "base")
- {
- Exception innerex;
- restriction.baseTypeName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for base attribute",innerex);
- }
- else if(reader.Name == "id")
- {
- restriction.Id = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for restriction",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,restriction);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return restriction;
- //Content: 1. annotation?,
- // (2.(group | all | choice | sequence)?, (3.(attribute | attributeGroup)*, 4.anyAttribute?)))
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaComplexContentRestriction.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- restriction.Annotation = annotation;
- continue;
- }
- if(level <= 2)
- {
- if(reader.LocalName == "group")
- {
- level = 3;
- XmlSchemaGroupRef group = XmlSchemaGroupRef.Read(reader,h);
- if(group != null)
- restriction.particle = group;
- continue;
- }
- if(reader.LocalName == "all")
- {
- level = 3;
- XmlSchemaAll all = XmlSchemaAll.Read(reader,h);
- if(all != null)
- restriction.particle = all;
- continue;
- }
- if(reader.LocalName == "choice")
- {
- level = 3;
- XmlSchemaChoice choice = XmlSchemaChoice.Read(reader,h);
- if(choice != null)
- restriction.particle = choice;
- continue;
- }
- if(reader.LocalName == "sequence")
- {
- level = 3;
- XmlSchemaSequence sequence = XmlSchemaSequence.Read(reader,h);
- if(sequence != null)
- restriction.particle = sequence;
- continue;
- }
- }
- if(level <= 3)
- {
- if(reader.LocalName == "attribute")
- {
- level = 3;
- XmlSchemaAttribute attr = XmlSchemaAttribute.Read(reader,h);
- if(attr != null)
- restriction.Attributes.Add(attr);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- level = 3;
- XmlSchemaAttributeGroupRef attr = XmlSchemaAttributeGroupRef.Read(reader,h);
- if(attr != null)
- restriction.attributes.Add(attr);
- continue;
- }
- }
- if(level <= 4 && reader.LocalName == "anyAttribute")
- {
- level = 5;
- XmlSchemaAnyAttribute anyattr = XmlSchemaAnyAttribute.Read(reader,h);
- if(anyattr != null)
- restriction.AnyAttribute = anyattr;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return restriction;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs
deleted file mode 100755
index 113aff9f415..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs
+++ /dev/null
@@ -1,463 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.ComponentModel;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaComplexType.
- /// </summary>
- public class XmlSchemaComplexType : XmlSchemaType
- {
- private XmlSchemaAnyAttribute anyAttribute;
- private XmlSchemaObjectCollection attributes;
- private XmlSchemaObjectTable attributeUses;
- private XmlSchemaAnyAttribute attributeWildcard;
- private XmlSchemaDerivationMethod block;
- private XmlSchemaDerivationMethod blockResolved;
- private XmlSchemaContentModel contentModel;
- private XmlSchemaContentType contentType;
- private XmlSchemaParticle contentTypeParticle;
- private bool isAbstract;
- private bool isMixed;
- private XmlSchemaParticle particle;
-
- internal bool istoplevel = false;
- private static string xmlname = "complexType";
-
- public XmlSchemaComplexType()
- {
- attributes = new XmlSchemaObjectCollection();
- block = XmlSchemaDerivationMethod.None;
- attributeUses = new XmlSchemaObjectTable();
- }
-
- #region Attributes
-
- [DefaultValue(false)]
- [System.Xml.Serialization.XmlAttribute("abstract")]
- public bool IsAbstract
- {
- get{ return isAbstract; }
- set{ isAbstract = value; }
- }
- [DefaultValue(XmlSchemaDerivationMethod.None)]
- [System.Xml.Serialization.XmlAttribute("block")]
- public XmlSchemaDerivationMethod Block
- {
- get{ return block; }
- set{ block = value; }
- }
- [DefaultValue(false)]
- [System.Xml.Serialization.XmlAttribute("mixed")]
- public override bool IsMixed
- {
- get{ return isMixed; }
- set{ isMixed = value; }
- }
-
- #endregion
-
- #region Elements
-
- [XmlElement("simpleContent",typeof(XmlSchemaSimpleContent),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("complexContent",typeof(XmlSchemaComplexContent),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaContentModel ContentModel
- {
- get{ return contentModel; }
- set{ contentModel = value; }
- }
-
- //LAMESPEC: The default value for particle in Schema is of Type EmptyParticle (internal?)
- [XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaParticle Particle
- {
- get{ return particle; }
- set{ particle = value; }
- }
-
- [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Attributes
- {
- get{ return attributes; }
- }
-
- [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnyAttribute AnyAttribute
- {
- get{ return anyAttribute; }
- set{ anyAttribute = value; }
- }
-
- #endregion
-
- #region XmlIgnore
- [XmlIgnore]
- public XmlSchemaContentType ContentType
- {
- get{ return contentType; }
- }
- [XmlIgnore]
- public XmlSchemaParticle ContentTypeParticle
- {
- get{ return contentTypeParticle; }
- }
- [XmlIgnore]
- public XmlSchemaDerivationMethod BlockResolved
- {
- get{ return blockResolved; }
- }
- [XmlIgnore]
- public XmlSchemaObjectTable AttributeUses
- {
- get{ return attributeUses; }
- }
- [XmlIgnore]
- public XmlSchemaAnyAttribute AttributeWildcard
- {
- get{ return attributeWildcard; }
- }
- #endregion
-
- /// <remarks>
- /// 1. If ContentModel is present, neither particle nor Attributes nor AnyAttribute can be present.
- /// 2. If particle is present,
- /// a. For a topLevelComplexType
- /// 1. name must be present and type NCName
- /// 2. if block is #all, blockdefault is #all, else List of (extension | restriction)
- /// 3. if final is #all, finaldefault is #all, else List of (extension | restriction)
- /// b. For a local Complex type
- /// 1. abstract must be false
- /// 2. Name must be absent
- /// 3. final must be absent
- /// 4. block must be absent
- ///
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(istoplevel)
- {
- if(this.Name == null || this.Name == string.Empty)
- error(h,"name must be present in a top level complex type");
- else if(!XmlSchemaUtil.CheckNCName(Name))
- error(h,"name must be a NCName");
- else
- this.qName = new XmlQualifiedName(Name,info.TargetNamespace);
-
- if(Block != XmlSchemaDerivationMethod.None)
- {
- if(Block == XmlSchemaDerivationMethod.All)
- {
- blockResolved = XmlSchemaDerivationMethod.All;
- }
- else
- {
- //TODO: Check what all is not allowed
- blockResolved = Block & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction);
- }
- }
- else
- {
- if(info.BlockDefault == XmlSchemaDerivationMethod.All)
- {
- blockResolved = XmlSchemaDerivationMethod.All;
- }
- else
- blockResolved = info.BlockDefault & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction);
- }
- if(Final != XmlSchemaDerivationMethod.None)
- {
- if(Final == XmlSchemaDerivationMethod.All)
- {
- finalResolved = XmlSchemaDerivationMethod.All;
- }
- else
- {
- //TODO: Check what all is not allowed
- finalResolved = Final & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction);
- }
- }
- else
- {
- if(info.FinalDefault == XmlSchemaDerivationMethod.All)
- {
- finalResolved = XmlSchemaDerivationMethod.All;
- }
- else
- {
- finalResolved = info.BlockDefault & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction);
- }
- }
- }
- else // Not Top Level
- {
- if(isAbstract)
- error(h,"abstract must be false in a local complex type");
- if(Name != null)
- error(h,"name must be absent in a local complex type");
- if(Final != XmlSchemaDerivationMethod.None)
- error(h,"final must be absent in a local complex type");
- if(block != XmlSchemaDerivationMethod.None)
- error(h,"block must be absent in a local complex type");
- }
-
- if(ContentModel != null)
- {
- if(anyAttribute != null || Attributes.Count != 0 || Particle != null)
- error(h,"attributes, particles or anyattribute is not allowed if ContentModel is present");
-
- if(ContentModel is XmlSchemaSimpleContent)
- {
- XmlSchemaSimpleContent smodel = (XmlSchemaSimpleContent)ContentModel;
- errorCount += smodel.Compile(h,info);
- }
- else if(ContentModel is XmlSchemaComplexContent)
- {
- XmlSchemaComplexContent cmodel = (XmlSchemaComplexContent)ContentModel;
- errorCount += cmodel.Compile(h,info);
- }
- }
- else
- {
- if(Particle is XmlSchemaGroupRef)
- {
- XmlSchemaGroupRef xsgr = (XmlSchemaGroupRef)Particle;
- errorCount += xsgr.Compile(h,info);
- }
- else if(Particle is XmlSchemaAll)
- {
- XmlSchemaAll xsa = (XmlSchemaAll)Particle;
- errorCount += xsa.Compile(h,info);
- }
- else if(Particle is XmlSchemaChoice)
- {
- XmlSchemaChoice xsc = (XmlSchemaChoice)Particle;
- errorCount += xsc.Compile(h,info);
- }
- else if(Particle is XmlSchemaSequence)
- {
- XmlSchemaSequence xss = (XmlSchemaSequence)Particle;
- errorCount += xss.Compile(h,info);
- }
-
- if(this.anyAttribute != null)
- {
- AnyAttribute.Compile(h,info);
- }
- foreach(XmlSchemaObject obj in Attributes)
- {
- if(obj is XmlSchemaAttribute)
- {
- XmlSchemaAttribute attr = (XmlSchemaAttribute) obj;
- errorCount += attr.Compile(h,info);
- }
- else if(obj is XmlSchemaAttributeGroupRef)
- {
- XmlSchemaAttributeGroupRef atgrp = (XmlSchemaAttributeGroupRef) obj;
- errorCount += atgrp.Compile(h,info);
- }
- else
- error(h,obj.GetType() +" is not valid in this place::ComplexType");
- }
- }
-
- XmlSchemaUtil.CompileID(Id, this, info.IDCollection, h);
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<complexType
- // abstract = boolean : false
- // block = (#all | List of (extension | restriction))
- // final = (#all | List of (extension | restriction))
- // id = ID
- // mixed = boolean : false
- // name = NCName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))))
- //</complexType>
- internal static XmlSchemaComplexType Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaComplexType ctype = new XmlSchemaComplexType();
- reader.MoveToElement();
- Exception innerex;
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaComplexType.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- ctype.LineNumber = reader.LineNumber;
- ctype.LinePosition = reader.LinePosition;
- ctype.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "abstract")
- {
- ctype.IsAbstract = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h,reader.Value + " is invalid value for abstract",innerex);
- }
- else if(reader.Name == "block")
- {
- ctype.block = XmlSchemaUtil.ReadDerivationAttribute(reader,out innerex, "block");
- if(innerex != null)
- warn(h,"some invalid values for block attribute were found",innerex);
- }
- else if(reader.Name == "final")
- {
- ctype.Final = XmlSchemaUtil.ReadDerivationAttribute(reader,out innerex, "block");
- if(innerex != null)
- warn(h,"some invalid values for final attribute were found",innerex);
- }
- else if(reader.Name == "id")
- {
- ctype.Id = reader.Value;
- }
- else if(reader.Name == "mixed")
- {
- ctype.isMixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h,reader.Value + " is invalid value for mixed",innerex);
- }
- else if(reader.Name == "name")
- {
- ctype.Name = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for complexType",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,ctype);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return ctype;
-
- //Content: 1. annotation?,
- // 2. simpleContent | 2. complexContent |
- // (3.(group | all | choice | sequence)?, (4.(attribute | attributeGroup)*, 5.anyAttribute?)))
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaComplexType.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- ctype.Annotation = annotation;
- continue;
- }
- if(level <=2)
- {
- if(reader.LocalName == "simpleContent")
- {
- level = 6;
- XmlSchemaSimpleContent simple = XmlSchemaSimpleContent.Read(reader,h);
- if(simple != null)
- ctype.ContentModel = simple;
- continue;
- }
- if(reader.LocalName == "complexContent")
- {
- level = 6;
- XmlSchemaComplexContent complex = XmlSchemaComplexContent.Read(reader,h);
- if(complex != null)
- ctype.contentModel = complex;
- continue;
- }
- }
- if(level <= 3)
- {
- if(reader.LocalName == "group")
- {
- level = 4;
- XmlSchemaGroupRef group = XmlSchemaGroupRef.Read(reader,h);
- if(group != null)
- ctype.particle = group;
- continue;
- }
- if(reader.LocalName == "all")
- {
- level = 4;
- XmlSchemaAll all = XmlSchemaAll.Read(reader,h);
- if(all != null)
- ctype.particle = all;
- continue;
- }
- if(reader.LocalName == "choice")
- {
- level = 4;
- XmlSchemaChoice choice = XmlSchemaChoice.Read(reader,h);
- if(choice != null)
- ctype.particle = choice;
- continue;
- }
- if(reader.LocalName == "sequence")
- {
- level = 4;
- XmlSchemaSequence sequence = XmlSchemaSequence.Read(reader,h);
- if(sequence != null)
- ctype.particle = sequence;
- continue;
- }
- }
- if(level <= 4)
- {
- if(reader.LocalName == "attribute")
- {
- level = 4;
- XmlSchemaAttribute attr = XmlSchemaAttribute.Read(reader,h);
- if(attr != null)
- ctype.Attributes.Add(attr);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- level = 4;
- XmlSchemaAttributeGroupRef attr = XmlSchemaAttributeGroupRef.Read(reader,h);
- if(attr != null)
- ctype.attributes.Add(attr);
- continue;
- }
- }
- if(level <= 5 && reader.LocalName == "anyAttribute")
- {
- level = 6;
- XmlSchemaAnyAttribute anyattr = XmlSchemaAnyAttribute.Read(reader,h);
- if(anyattr != null)
- ctype.AnyAttribute = anyattr;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return ctype;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContent.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContent.cs
deleted file mode 100755
index ac32916437a..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContent.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaContent.
- /// </summary>
- public abstract class XmlSchemaContent : XmlSchemaAnnotated
- {
- protected XmlSchemaContent()
- {}
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentModel.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentModel.cs
deleted file mode 100755
index 994dd211de5..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentModel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaContentModel.
- /// </summary>
- public abstract class XmlSchemaContentModel : XmlSchemaAnnotated
- {
- protected XmlSchemaContentModel()
- {
- }
- [XmlIgnore]
- public abstract XmlSchemaContent Content {get; set;}
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs
deleted file mode 100755
index 2cd60231a03..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaContentProcessing.
- /// </summary>
- public enum XmlSchemaContentProcessing
- {
- [XmlIgnore]
- None = 0,
- [XmlEnum("skip")]
- Skip = 1,
- [XmlEnum("lax")]
- Lax = 2,
- [XmlEnum("strict")]
- Strict = 3,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentType.cs
deleted file mode 100755
index dc7bda2433e..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentType.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaContentType.
- /// </summary>
- public enum XmlSchemaContentType
- {
- TextOnly = 0,
- Empty = 1,
- ElementOnly = 2,
- Mixed = 3,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs
deleted file mode 100755
index e93428efbce..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaDatatype.
- /// </summary>
- public abstract class XmlSchemaDatatype
- {
- protected XmlSchemaDatatype()
- {
- }
-
- public abstract XmlTokenizedType TokenizedType { get; }
- public abstract Type ValueType { get; }
-
- // Methods
- public abstract object ParseValue(string s,
- XmlNameTable nameTable, XmlNamespaceManager nsmgr);
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs
deleted file mode 100755
index fcd63c899fe..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaDerivationMethod.
- /// </summary>
- [Flags]
- public enum XmlSchemaDerivationMethod
- {
- [XmlEnum("")]
- Empty = 0x00000000,
- [XmlEnum("substitution")]
- Substitution= 0x00000001,
- [XmlEnum("extension")]
- Extension = 0x00000002,
- [XmlEnum("restriction")]
- Restriction = 0x00000004,
- [XmlEnum("list")]
- List = 0x00000008,
- [XmlEnum("union")]
- Union = 0x00000010,
- [XmlEnum("#all")]
- All = 0x000000FF,
- [XmlIgnore]
- None = 0x00000100,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs
deleted file mode 100755
index 7788d6d685b..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaDocumentation.
- /// </summary>
- public class XmlSchemaDocumentation : XmlSchemaObject
- {
- private string language;
- private XmlNode[] markup;
- private string source;
-
- public XmlSchemaDocumentation()
- {
- }
-
- [XmlAnyElement]
- [XmlText]
- public XmlNode[] Markup
- {
- get{ return markup; }
- set{ markup = value; }
- }
-
- [System.Xml.Serialization.XmlAttribute("source")]
- public string Source
- {
- get{ return source; }
- set{ source = value; }
- }
-
- [System.Xml.Serialization.XmlAttribute("xml:lang")]
- public string Language
- {
- get{ return language; }
- set{ language = value; }
- }
-
- //<documentation
- // source = anyURI
- // xml:lang = language>
- // Content: ({any})*
- //</documentation>
- internal static XmlSchemaDocumentation Read(XmlSchemaReader reader, ValidationEventHandler h, out bool skip)
- {
- skip = false;
- XmlSchemaDocumentation doc = new XmlSchemaDocumentation();
-
- reader.MoveToElement();
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != "documentation")
- {
- error(h,"Should not happen :1: XmlSchemaDocumentation.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- doc.LineNumber = reader.LineNumber;
- doc.LinePosition = reader.LinePosition;
- doc.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "source")
- {
- doc.source = reader.Value;
- }
- else if(reader.Name == "xml:lang")
- {
- doc.language = reader.Value;
- }
- else
- {
- error(h,reader.Name + " is not a valid attribute for documentation",null);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return doc;
-
- //Content {any}*
- XmlDocument xmldoc = new XmlDocument();
- xmldoc.AppendChild(xmldoc.ReadNode(reader));
- XmlNode root = xmldoc.FirstChild;
- if(root != null && root.ChildNodes != null)
- {
- doc.Markup = new XmlNode[root.ChildNodes.Count];
- for(int i=0;i<root.ChildNodes.Count;i++)
- {
- doc.Markup[i] = root.ChildNodes[i];
- }
- }
- if(reader.NodeType == XmlNodeType.Element || reader.NodeType == XmlNodeType.EndElement)
- skip = true;
-
- return doc;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
deleted file mode 100755
index 5f95fd66ef2..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
+++ /dev/null
@@ -1,625 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-using System.ComponentModel;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaElement.
- /// </summary>
- public class XmlSchemaElement : XmlSchemaParticle
- {
- private XmlSchemaDerivationMethod block;
- private XmlSchemaDerivationMethod blockResolved;
- private XmlSchemaObjectCollection constraints;
- private string defaultValue;
- private object elementType;
- private XmlSchemaDerivationMethod final;
- private XmlSchemaDerivationMethod finalResolved;
- private string fixedValue;
- private XmlSchemaForm form;
- private bool isAbstract;
- private bool isNillable;
- private string name;
- private XmlQualifiedName qName;
- private XmlQualifiedName refName;
- private XmlSchemaType schemaType;
- private XmlQualifiedName schemaTypeName;
- private XmlQualifiedName substitutionGroup;
- internal bool parentIsSchema = false;
- private string targetNamespace;
- private string hash;
-
- private static string xmlname = "element";
-
- public XmlSchemaElement()
- {
- block = XmlSchemaDerivationMethod.None;
- final = XmlSchemaDerivationMethod.None;
- constraints = new XmlSchemaObjectCollection();
- qName = XmlQualifiedName.Empty;
- refName = XmlQualifiedName.Empty;
- schemaTypeName = XmlQualifiedName.Empty;
- substitutionGroup = XmlQualifiedName.Empty;
- substitutionGroup = XmlQualifiedName.Empty;
- }
-
- #region Attributes
-
- [DefaultValue(false)]
- [System.Xml.Serialization.XmlAttribute("abstract")]
- public bool IsAbstract
- {
- get{ return isAbstract; }
- set{ isAbstract = value; }
- }
-
- [DefaultValue(XmlSchemaDerivationMethod.None)]
- [System.Xml.Serialization.XmlAttribute("block")]
- public XmlSchemaDerivationMethod Block
- {
- get{ return block; }
- set{ block = value; }
- }
-
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("default")]
- public string DefaultValue
- {
- get{ return defaultValue; }
- set{ defaultValue = value; }
- }
-
- [DefaultValue(XmlSchemaDerivationMethod.None)]
- [System.Xml.Serialization.XmlAttribute("final")]
- public XmlSchemaDerivationMethod Final
- {
- get{ return final; }
- set{ final = value; }
- }
-
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("fixed")]
- public string FixedValue
- {
- get{ return fixedValue; }
- set{ fixedValue = value; }
- }
- [DefaultValue(XmlSchemaForm.None)]
- [System.Xml.Serialization.XmlAttribute("form")]
- public XmlSchemaForm Form
- {
- get{ return form; }
- set{ form = value; }
- }
-
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name; }
- set{ name = value; }
- }
-
- [DefaultValue(false)]
- [System.Xml.Serialization.XmlAttribute("nillable")]
- public bool IsNillable
- {
- get{ return isNillable; }
- set{ isNillable = value; }
- }
-
- [System.Xml.Serialization.XmlAttribute("ref")]
- public XmlQualifiedName RefName
- {
- get{ return refName; }
- set{ refName = value;}
- }
-
- [System.Xml.Serialization.XmlAttribute("substitutionGroup")]
- public XmlQualifiedName SubstitutionGroup
- {
- get{ return substitutionGroup; }
- set{ substitutionGroup = value; }
- }
-
- [System.Xml.Serialization.XmlAttribute("type")]
- public XmlQualifiedName SchemaTypeName
- {
- get{ return schemaTypeName; }
- set{ schemaTypeName = value; }
- }
-
- [XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaType SchemaType
- {
- get{ return schemaType; }
- set{ schemaType = value; }
- }
-
- [XmlElement("unique",typeof(XmlSchemaUnique),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("key",typeof(XmlSchemaKey),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("keyref",typeof(XmlSchemaKeyref),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Constraints
- {
- get{ return constraints; }
- }
-
- [XmlIgnore]
- public XmlQualifiedName QualifiedName
- {
- get{ return qName; }
- }
-
- [XmlIgnore]
- public object ElementType
- {
- get{ return elementType; }
- }
-
- [XmlIgnore]
- public XmlSchemaDerivationMethod BlockResolved
- {
- get{ return blockResolved; }
- }
-
- [XmlIgnore]
- public XmlSchemaDerivationMethod FinalResolved
- {
- get{ return finalResolved; }
- }
-
- #endregion
-
- /// <remarks>
- /// a) If Element has parent as schema:
- /// 1. name must be present and of type NCName.
- /// 2. ref must be absent
- /// 3. form must be absent
- /// 4. minOccurs must be absent
- /// 5. maxOccurs must be absent
- /// b) If Element has parent is not schema and ref is absent
- /// 1. name must be present and of type NCName.
- /// 2. if form equals qualified or form is absent and schema's formdefault is qualifed,
- /// targetNamespace is schema's targetnamespace else empty.
- /// 3. type and either <simpleType> or <complexType> are mutually exclusive
- /// 4. default and fixed must not both be present.
- /// 5. substitutiongroup must be absent
- /// 6. final must be absent
- /// 7. abstract must be absent
- /// c) if the parent is not schema and ref is set
- /// 1. name must not be present
- /// 2. all of <simpleType>,<complexType>, <key>, <keyref>, <unique>, nillable,
- /// default, fixed, form, block and type, must be absent.
- /// 3. substitutiongroup is prohibited
- /// 4. final is prohibited
- /// 5. abstract is prohibited
- /// 6. default and fixed must not both be present.(Actually both are absent)
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(this.defaultValue != null && this.fixedValue != null)
- error(h,"both default and fixed can't be present");
-
- if(parentIsSchema)
- {
- if(this.refName != null && !RefName.IsEmpty)
- error(h,"ref must be absent");
-
- if(this.name == null) //b1
- error(h,"Required attribute name must be present");
- else if(!XmlSchemaUtil.CheckNCName(this.name)) // b1.2
- error(h,"attribute name must be NCName");
- else
- this.qName = new XmlQualifiedName(this.name, info.TargetNamespace);
-
- if(form != XmlSchemaForm.None)
- error(h,"form must be absent");
- if(MinOccursString != null)
- error(h,"minOccurs must be absent");
- if(MaxOccursString != null)
- error(h,"maxOccurs must be absent");
-
- XmlSchemaDerivationMethod allfinal = (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction);
- if(final == XmlSchemaDerivationMethod.All)
- finalResolved = allfinal;
- else if(final == XmlSchemaDerivationMethod.None)
- finalResolved = info.BlockDefault & allfinal;
- else
- {
- if((final & ~allfinal) != 0)
- warn(h,"some values for final are invalid in this context");
- finalResolved = final & allfinal;
- }
-
- XmlSchemaDerivationMethod allblock = XmlSchemaDerivationMethod.Extension |
- XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Substitution;
-
- if(block == XmlSchemaDerivationMethod.All)
- blockResolved = allblock;
- else if(block == XmlSchemaDerivationMethod.None)
- blockResolved = info.BlockDefault & allblock;
- else
- {
- if((block & ~allblock) != 0)
- warn(h,"Some of the values for block are invalid in this context");
- blockResolved = block & allblock;
- }
-
- if(schemaType != null && schemaTypeName != null && !schemaTypeName.IsEmpty)
- {
- error(h,"both schemaType and content can't be present");
- }
-
- //Even if both are present, read both of them.
- if(schemaType != null)
- {
- if(schemaType is XmlSchemaSimpleType)
- {
- errorCount += ((XmlSchemaSimpleType)schemaType).Compile(h,info);
- }
- else if(schemaType is XmlSchemaComplexType)
- {
- errorCount += ((XmlSchemaComplexType)schemaType).Compile(h,info);
- }
- else
- error(h,"only simpletype or complextype is allowed");
- }
- if(schemaTypeName != null && !schemaTypeName.IsEmpty)
- {
- if(!XmlSchemaUtil.CheckQName(SchemaTypeName))
- error(h,"SchemaTypeName must be an XmlQualifiedName");
- }
- if(SubstitutionGroup != null && !SubstitutionGroup.IsEmpty)
- {
- if(!XmlSchemaUtil.CheckQName(SubstitutionGroup))
- error(h,"SubstitutionGroup must be a valid XmlQualifiedName");
- }
-
- foreach(XmlSchemaObject obj in constraints)
- {
- if(obj is XmlSchemaUnique)
- errorCount += ((XmlSchemaUnique)obj).Compile(h,info);
- else if(obj is XmlSchemaKey)
- errorCount += ((XmlSchemaKey)obj).Compile(h,info);
- else if(obj is XmlSchemaKeyref)
- errorCount += ((XmlSchemaKeyref)obj).Compile(h,info);
- }
-
-
- }
- else
- {
- if(substitutionGroup != null && !substitutionGroup.IsEmpty)
- error(h,"substitutionGroup must be absent");
- if(final != XmlSchemaDerivationMethod.None)
- error(h,"final must be absent");
- if(isAbstract)
- error(h,"abstract must be absent");
-
- //FIXME: Should we reset the values
- if(MinOccurs > MaxOccurs)
- error(h,"minOccurs must be less than or equal to maxOccurs");
-
- if(refName == null || RefName.IsEmpty)
- {
- if(form == XmlSchemaForm.Qualified || (form == XmlSchemaForm.None && info.ElementFormDefault == XmlSchemaForm.Qualified))
- this.targetNamespace = info.TargetNamespace;
- else
- this.targetNamespace = string.Empty;
-
- if(this.name == null) //b1
- error(h,"Required attribute name must be present");
- else if(!XmlSchemaUtil.CheckNCName(this.name)) // b1.2
- error(h,"attribute name must be NCName");
- else
- this.qName = new XmlQualifiedName(this.name, this.targetNamespace);
-
- XmlSchemaDerivationMethod allblock = XmlSchemaDerivationMethod.Extension |
- XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.Substitution;
-
- if(block == XmlSchemaDerivationMethod.All)
- blockResolved = allblock;
- else if(block == XmlSchemaDerivationMethod.None)
- blockResolved = info.BlockDefault & allblock;
- else
- {
- if((block & ~allblock) != 0)
- warn(h,"Some of the values for block are invalid in this context");
- blockResolved = block & allblock;
- }
-
- if(schemaType != null && schemaTypeName != null && !schemaTypeName.IsEmpty)
- {
- error(h,"both schemaType and content can't be present");
- }
-
- //Even if both are present, read both of them.
- if(schemaType != null)
- {
- if(schemaType is XmlSchemaSimpleType)
- {
- errorCount += ((XmlSchemaSimpleType)schemaType).Compile(h,info);
- }
- else if(schemaType is XmlSchemaComplexType)
- {
- errorCount += ((XmlSchemaComplexType)schemaType).Compile(h,info);
- }
- else
- error(h,"only simpletype or complextype is allowed");
- }
- if(schemaTypeName != null && !schemaTypeName.IsEmpty)
- {
- if(!XmlSchemaUtil.CheckQName(SchemaTypeName))
- error(h,"SchemaTypeName must be an XmlQualifiedName");
- }
- if(SubstitutionGroup != null && !SubstitutionGroup.IsEmpty)
- {
- if(!XmlSchemaUtil.CheckQName(SubstitutionGroup))
- error(h,"SubstitutionGroup must be a valid XmlQualifiedName");
- }
-
- foreach(XmlSchemaObject obj in constraints)
- {
- if(obj is XmlSchemaUnique)
- errorCount += ((XmlSchemaUnique)obj).Compile(h,info);
- else if(obj is XmlSchemaKey)
- errorCount += ((XmlSchemaKey)obj).Compile(h,info);
- else if(obj is XmlSchemaKeyref)
- errorCount += ((XmlSchemaKeyref)obj).Compile(h,info);
- }
- }
- else
- {
- if(!XmlSchemaUtil.CheckQName(RefName))
- error(h,"RefName must be a XmlQualifiedName");
-
- if(name != null)
- error(h,"name must not be present when ref is present");
- if(Constraints.Count != 0)
- error(h,"key, keyref and unique must be absent");
- if(isNillable)
- error(h,"nillable must be absent");
- if(defaultValue != null)
- error(h,"default must be absent");
- if(fixedValue != null)
- error(h,"fixed must be null");
- if(form != XmlSchemaForm.None)
- error(h,"form must be absent");
- if(block != XmlSchemaDerivationMethod.None)
- error(h,"block must be absent");
- if(schemaTypeName != null && !schemaTypeName.IsEmpty)
- error(h,"type must be absent");
- if(SchemaType != null)
- error(h,"simpleType or complexType must be absent");
- }
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<element
- // abstract = boolean : false
- // block = (#all | List of (extension | restriction | substitution))
- // default = string
- // final = (#all | List of (extension | restriction))
- // fixed = string
- // form = (qualified | unqualified)
- // id = ID
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- // minOccurs = nonNegativeInteger : 1
- // name = NCName
- // nillable = boolean : false
- // ref = QName
- // substitutionGroup = QName
- // type = QName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, ((simpleType | complexType)?, (unique | key | keyref)*))
- //</element>
-
- internal static XmlSchemaElement Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaElement element = new XmlSchemaElement();
- Exception innerex;
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaElement.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- element.LineNumber = reader.LineNumber;
- element.LinePosition = reader.LinePosition;
- element.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "abstract")
- {
- element.IsAbstract = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h,reader.Value + " is invalid value for abstract",innerex);
- }
- else if(reader.Name == "block")
- {
- element.block = XmlSchemaUtil.ReadDerivationAttribute(reader,out innerex, "block");
- if(innerex != null)
- warn(h,"some invalid values for block attribute were found",innerex);
- }
- else if(reader.Name == "default")
- {
- element.defaultValue = reader.Value;
- }
- else if(reader.Name == "final")
- {
- element.Final = XmlSchemaUtil.ReadDerivationAttribute(reader,out innerex, "block");
- if(innerex != null)
- warn(h,"some invalid values for final attribute were found",innerex);
- }
- else if(reader.Name == "fixed")
- {
- element.fixedValue = reader.Value;
- }
- else if(reader.Name == "form")
- {
- element.form = XmlSchemaUtil.ReadFormAttribute(reader,out innerex);
- if(innerex != null)
- error(h,reader.Value + " is an invalid value for form attribute",innerex);
- }
- else if(reader.Name == "id")
- {
- element.Id = reader.Value;
- }
- else if(reader.Name == "maxOccurs")
- {
- try
- {
- element.MaxOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for maxOccurs",e);
- }
- }
- else if(reader.Name == "minOccurs")
- {
- try
- {
- element.MinOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for minOccurs",e);
- }
- }
- else if(reader.Name == "name")
- {
- element.Name = reader.Value;
- }
- else if(reader.Name == "nillable")
- {
- element.IsNillable = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h,reader.Value + "is not a valid value for nillable",innerex);
- }
- else if(reader.Name == "ref")
- {
- element.refName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for ref attribute",innerex);
- }
- else if(reader.Name == "substitutionGroup")
- {
- element.substitutionGroup = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for substitutionGroup attribute",innerex);
- }
- else if(reader.Name == "type")
- {
- element.SchemaTypeName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for type attribute",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for element",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,element);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return element;
-
- // Content: annotation?,
- // (simpleType | complexType)?,
- // (unique | key | keyref)*
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaElement.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- element.Annotation = annotation;
- continue;
- }
- if(level <= 2)
- {
- if(reader.LocalName == "simpleType")
- {
- level = 3;
- XmlSchemaSimpleType simple = XmlSchemaSimpleType.Read(reader,h);
- if(simple != null)
- element.SchemaType = simple;
- continue;
- }
- if(reader.LocalName == "complexType")
- {
- level = 3;
- XmlSchemaComplexType complex = XmlSchemaComplexType.Read(reader,h);
- if(complex != null)
- {
- element.SchemaType = complex;
- }
- continue;
- }
- }
- if(level <= 3)
- {
- if(reader.LocalName == "unique")
- {
- level = 3;
- XmlSchemaUnique unique = XmlSchemaUnique.Read(reader,h);
- if(unique != null)
- element.constraints.Add(unique);
- continue;
- }
- else if(reader.LocalName == "key")
- {
- level = 3;
- XmlSchemaKey key = XmlSchemaKey.Read(reader,h);
- if(key != null)
- element.constraints.Add(key);
- continue;
- }
- else if(reader.LocalName == "keyref")
- {
- level = 3;
- XmlSchemaKeyref keyref = XmlSchemaKeyref.Read(reader,h);
- if(keyref != null)
- element.constraints.Add(keyref);
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return element;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaEnumerationFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaEnumerationFacet.cs
deleted file mode 100755
index 512b3c7d70a..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaEnumerationFacet.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaEnumerationFacet.
- /// </summary>
- public class XmlSchemaEnumerationFacet : XmlSchemaFacet
- {
- private static string xmlname = "enumeration";
- public XmlSchemaEnumerationFacet()
- {
- }
-
- //<enumeration
- // id = ID
- // value = anySimpleType
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</enumeration>
- internal static XmlSchemaEnumerationFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaEnumerationFacet enumeration = new XmlSchemaEnumerationFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaEnumerationFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- enumeration.LineNumber = reader.LineNumber;
- enumeration.LinePosition = reader.LinePosition;
- enumeration.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- enumeration.Id = reader.Value;
- }
- else if(reader.Name == "value")
- {
- enumeration.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,enumeration);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return enumeration;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaEnumerationFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- enumeration.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return enumeration;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaException.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaException.cs
deleted file mode 100755
index 4db03456847..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaException.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Runtime.Serialization;
-
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaException.
- /// </summary>
- [Serializable]
- public class XmlSchemaException : System.SystemException
- {
- //fields
- private int lineNumber;
- private int linePosition;
- private XmlSchemaObject sourceObj;
- private string sourceUri;
-
- [MonoTODO]
- protected XmlSchemaException(SerializationInfo info, StreamingContext context){}
-
- internal XmlSchemaException(string message, int lineNumber, int linePosition,
- XmlSchemaObject sourceObject, string sourceUri, Exception innerException)
- : base(message, innerException)
- {
- this.lineNumber = lineNumber;
- this.linePosition = linePosition;
- this.sourceObj = sourceObject;
- this.sourceUri = sourceUri;
- }
- internal XmlSchemaException(string message, XmlSchemaObject sourceObject,
- Exception innerException)
- : base(message, innerException)
- {
- this.lineNumber = sourceObject.LineNumber;
- this.linePosition = sourceObject.LinePosition;
- this.sourceObj = sourceObject;
- this.sourceUri = sourceObject.SourceUri;
- }
-
- public XmlSchemaException(string message, Exception innerException)
- : base(message,innerException){}
-
- // Properties
- public int LineNumber
- {
- get{ return this.lineNumber;}
- }
- public int LinePosition
- {
- get{ return this.linePosition;}
- }
- public XmlSchemaObject SourceSchemaObject
- {
- get{ return this.sourceObj; }
- }
- public string SourceUri
- {
- get{ return this.sourceUri; }
- }
-
- // Methods
- [MonoTODO]
- public override void GetObjectData(SerializationInfo info, StreamingContext context){}
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs
deleted file mode 100755
index 1f691587ea1..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-using System.Collections;
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaExternal.
- /// </summary>
- public abstract class XmlSchemaExternal : XmlSchemaObject
- {
- private string id;
- private XmlSchema schema;
- private string location;
- private XmlAttribute[] unhandledAttributes;
-
- protected XmlSchemaExternal()
- {}
-
- [System.Xml.Serialization.XmlAttribute("schemaLocation")]
- public string SchemaLocation
- {
- get{ return location; }
- set{ location = value; }
- }
-
- [XmlIgnore]
- public XmlSchema Schema
- {
- get{ return schema; }
- set{ schema = value; }
- }
-
- [System.Xml.Serialization.XmlAttribute("id")]
- public string Id
- {
- get{ return id; }
- set{ id = value; }
- }
-
- [XmlAnyAttribute]
- public XmlAttribute[] UnhandledAttributes
- {
- get
- {
- if(unhandledAttributeList != null)
- {
- unhandledAttributes = (XmlAttribute[]) unhandledAttributeList.ToArray(typeof(XmlAttribute));
- unhandledAttributeList = null;
- }
- return unhandledAttributes;
- }
- set
- {
- unhandledAttributes = value;
- unhandledAttributeList = null;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs
deleted file mode 100755
index 076bc74486d..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-using System.ComponentModel;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaFacet.
- /// </summary>
- public abstract class XmlSchemaFacet : XmlSchemaAnnotated
- {
- private bool isFixed;
- private string val;
-
- protected XmlSchemaFacet()
- {
- }
-
- [System.Xml.Serialization.XmlAttribute("value")]
- public string Value
- {
- get{ return val; }
- set{ val = value; }
- }
-
- [DefaultValue(false)]
- [System.Xml.Serialization.XmlAttribute("fixed")]
- public virtual bool IsFixed
- {
- get{ return isFixed; }
- set{ isFixed = value; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs
deleted file mode 100755
index 8efb7e3d548..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaForm.
- /// </summary>
- public enum XmlSchemaForm
- {
- [XmlIgnore]
- None = 0x00000000,
- [XmlEnum("qualified")]
- Qualified = 0x00000001,
- [XmlEnum("unqualified")]
- Unqualified = 0x00000002,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFractionDigitsFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFractionDigitsFacet.cs
deleted file mode 100755
index 319d19fd8e3..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFractionDigitsFacet.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaFractionDigitsFacet.
- /// </summary>
- public class XmlSchemaFractionDigitsFacet : XmlSchemaNumericFacet
- {
- private static string xmlname = "fractionDigits";
-
- public XmlSchemaFractionDigitsFacet()
- {
- }
-
- //<fractionDigits
- // fixed = boolean : false
- // id = ID
- // value = nonNegativeInteger
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</fractionDigits>
- internal static XmlSchemaFractionDigitsFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaFractionDigitsFacet fraction = new XmlSchemaFractionDigitsFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaFractionDigitsFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- fraction.LineNumber = reader.LineNumber;
- fraction.LinePosition = reader.LinePosition;
- fraction.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- fraction.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- fraction.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- fraction.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,fraction);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return fraction;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaFractionDigitsFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- fraction.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return fraction;
- }
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs
deleted file mode 100755
index 9848d6ad319..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// refers to the named group
- /// </summary>
- public class XmlSchemaGroup : XmlSchemaAnnotated
- {
- private string name;
- private XmlSchemaGroupBase particle;
- private XmlQualifiedName qualifiedName;
-
- private static string xmlname = "group";
-
- public XmlSchemaGroup()
- {
- }
-
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name; }
- set{ name = value; }
- }
-
- [XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaGroupBase Particle
- {
- get{ return particle; }
- set{ particle = value; }
- }
-
- [XmlIgnore]
- internal XmlQualifiedName QualifiedName
- {
- get{ return qualifiedName;}
- }
-
- // 1. name must be present
- // 2. MinOccurs & MaxOccurs of the Particle must be absent
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(Name == null)
- error(h,"Required attribute name must be present");
- else if(!XmlSchemaUtil.CheckNCName(this.name))
- error(h,"attribute name must be NCName");
- else
- qualifiedName = new XmlQualifiedName(Name,info.TargetNamespace);
-
- if(Particle == null)
- {
- error(h,"Particle is required");
- }
- else
- {
- if(Particle.MaxOccursString != null)
- Particle.error(h,"MaxOccurs must not be present when the Particle is a child of Group");
- if(Particle.MinOccursString != null)
- Particle.error(h,"MinOccurs must not be present when the Particle is a child of Group");
-
- if(Particle is XmlSchemaChoice)
- {
- errorCount += ((XmlSchemaChoice)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaSequence)
- {
- errorCount += ((XmlSchemaSequence)Particle).Compile(h,info);
- }
- else if(Particle is XmlSchemaAll)
- {
- errorCount += ((XmlSchemaAll)Particle).Compile(h,info);
- }
- else
- {
- error(h,"only all,choice or sequence are allowed");
- }
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //From the Errata
- //<group
- // id = ID
- // name = NCName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (all | choice | sequence)?)
- //</group>
- internal static XmlSchemaGroup Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaGroup group = new XmlSchemaGroup();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaGroup.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- group.LineNumber = reader.LineNumber;
- group.LinePosition = reader.LinePosition;
- group.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- group.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- group.name = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for group",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,group);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return group;
-
-// Content: (annotation?, (all | choice | sequence)?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaGroup.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- group.Annotation = annotation;
- continue;
- }
- if(level <= 2)
- {
- if(reader.LocalName == "all")
- {
- level = 3;
- XmlSchemaAll all = XmlSchemaAll.Read(reader,h);
- if(all != null)
- group.Particle = all;
- continue;
- }
- if(reader.LocalName == "choice")
- {
- level = 3;
- XmlSchemaChoice choice = XmlSchemaChoice.Read(reader,h);
- if(choice != null)
- group.Particle = choice;
- continue;
- }
- if(reader.LocalName == "sequence")
- {
- level = 3;
- XmlSchemaSequence sequence = XmlSchemaSequence.Read(reader,h);
- if(sequence != null)
- group.Particle = sequence;
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return group;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupBase.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupBase.cs
deleted file mode 100755
index 152e3b09f57..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupBase.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaGroupBase.
- /// </summary>
- public abstract class XmlSchemaGroupBase : XmlSchemaParticle
- {
- protected XmlSchemaGroupBase()
- {
- }
-
- [XmlIgnore]
- public abstract XmlSchemaObjectCollection Items { get; }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs
deleted file mode 100755
index 31ceaf8e864..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaGroupRef.
- /// </summary>
- public class XmlSchemaGroupRef : XmlSchemaParticle
- {
- private XmlSchemaGroupBase particle;
- private XmlQualifiedName refName;
- private static string xmlname = "group";
-
- public XmlSchemaGroupRef()
- {
- refName = XmlQualifiedName.Empty;
- }
- [System.Xml.Serialization.XmlAttribute("ref")]
- public XmlQualifiedName RefName
- {
- get{ return refName; }
- set{ refName = value; }
- }
- [XmlIgnore]
- public XmlSchemaGroupBase Particle
- {
- get{ return particle; }
- }
- /// <remarks>
- /// 1. RefName must be present
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- //FIXME: Should we reset the values
- if(MinOccurs > MaxOccurs)
- error(h,"minOccurs must be less than or equal to maxOccurs");
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- if(refName == null || refName.IsEmpty)
- {
- error(h,"ref must be present");
- }
- else if(!XmlSchemaUtil.CheckQName(RefName))
- error(h, "RefName must be a valid XmlQualifiedName");
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- // <group
- // id = ID
- // ref = QName
- // minOccurs = ? : 1
- // maxOccurs = ? : 1>
- // Content: (annotation?)
- // </group>
- internal static XmlSchemaGroupRef Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaGroupRef groupref = new XmlSchemaGroupRef();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaGroup.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- groupref.LineNumber = reader.LineNumber;
- groupref.LinePosition = reader.LinePosition;
- groupref.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- groupref.Id = reader.Value;
- }
- else if(reader.Name == "ref")
- {
- Exception innerex;
- groupref.refName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for ref attribute",innerex);
- }
- else if(reader.Name == "maxOccurs")
- {
- try
- {
- groupref.MaxOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for maxOccurs",e);
- }
- }
- else if(reader.Name == "minOccurs")
- {
- try
- {
- groupref.MinOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for minOccurs", e);
- }
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for group",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,groupref);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return groupref;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaGroupRef.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- groupref.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return groupref;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs
deleted file mode 100755
index f370d62048e..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaIdentityConstraint.
- /// </summary>
- public class XmlSchemaIdentityConstraint : XmlSchemaAnnotated
- {
- private XmlSchemaObjectCollection fields;
- private string name;
- private XmlQualifiedName qName;
- private XmlSchemaXPath selector;
-
- public XmlSchemaIdentityConstraint()
- {
- fields = new XmlSchemaObjectCollection();
- qName = XmlQualifiedName.Empty;
- }
-
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name; }
- set{ name = value; }
- }
-
- [XmlElement("selector",typeof(XmlSchemaXPath),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaXPath Selector
- {
- get{ return selector; }
- set{ selector = value; }
- }
-
- [XmlElement("field",typeof(XmlSchemaXPath),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Fields
- {
- get{ return fields; }
- }
-
- [XmlIgnore]
- public XmlQualifiedName QualifiedName
- {
- get{ return qName; }
- }
- /// <remarks>
- /// 1. name must be present
- /// 2. selector and field must be present
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(Name == null)
- error(h,"Required attribute name must be present");
- else if(!XmlSchemaUtil.CheckNCName(this.name))
- error(h,"attribute name must be NCName");
- else
- this.qName = new XmlQualifiedName(Name,info.TargetNamespace);
-
- //TODO: Compile Xpath.
- if(Selector == null)
- error(h,"selector must be present");
- else
- {
- errorCount += Selector.Compile(h,info);
- }
-
- if(Fields.Count == 0)
- error(h,"atleast one field value must be present");
- else
- {
- foreach(XmlSchemaObject obj in Fields)
- {
- if(obj is XmlSchemaXPath)
- {
- XmlSchemaXPath field = (XmlSchemaXPath)obj;
- errorCount += field.Compile(h,info);
- }
- else
- error(h,"Object of type "+obj.GetType()+" is invalid in the Fields Collection");
- }
- }
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs
deleted file mode 100755
index 7586b2db155..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaImport.
- /// </summary>
- public class XmlSchemaImport : XmlSchemaExternal
- {
- private XmlSchemaAnnotation annotation;
- private string nameSpace;
- private static string xmlname = "import";
-
- public XmlSchemaImport()
- {
- }
-
- [System.Xml.Serialization.XmlAttribute("namespace")]
- public string Namespace
- {
- get{ return nameSpace; }
- set{ nameSpace = value; }
- }
-
- [XmlElement("annotation",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnnotation Annotation
- {
- get{ return annotation; }
- set{ annotation = value; }
- }
- //<import
- // id = ID
- // namespace = anyURI
- // schemaLocation = anyURI
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</import>
- internal static XmlSchemaImport Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaImport import = new XmlSchemaImport();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != "import")
- {
- error(h,"Should not happen :1: XmlSchemaImport.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- import.LineNumber = reader.LineNumber;
- import.LinePosition = reader.LinePosition;
- import.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- import.Id = reader.Value;
- }
- else if(reader.Name == "namespace")
- {
- import.nameSpace = reader.Value;
- }
- else if(reader.Name == "schemaLocation")
- {
- import.SchemaLocation = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for import",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,import);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return import;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaImport.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- import.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return import;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs
deleted file mode 100755
index 8cbb081eb7a..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaInclude.
- /// </summary>
- public class XmlSchemaInclude : XmlSchemaExternal
- {
- private XmlSchemaAnnotation annotation;
- private static string xmlname = "include";
-
- public XmlSchemaInclude()
- {
- }
- [XmlElement("annotation",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnnotation Annotation
- {
- get{ return annotation; }
- set{ annotation = value; }
- }
-
- //<include
- // id = ID
- // schemaLocation = anyURI
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</include>
- internal static XmlSchemaInclude Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaInclude include = new XmlSchemaInclude();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaInclude.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- include.LineNumber = reader.LineNumber;
- include.LinePosition = reader.LinePosition;
- include.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- include.Id = reader.Value;
- }
- else if(reader.Name == "schemaLocation")
- {
- include.SchemaLocation = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for include",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,include);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return include;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaInclude.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- include.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
-
- return include;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInfo.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInfo.cs
deleted file mode 100755
index 5e9960635f7..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInfo.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Xml;
-using System.Collections;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// This class would store the infomation we need during compilation.
- /// </summary>
- internal class XmlSchemaInfo
- {
- internal XmlSchemaInfo()
- {
- IDCollection = new Hashtable();
- }
-
- internal string TargetNamespace = null;
- internal XmlSchemaDerivationMethod FinalDefault = XmlSchemaDerivationMethod.None;
- internal XmlSchemaDerivationMethod BlockDefault = XmlSchemaDerivationMethod.None;
- internal XmlSchemaForm ElementFormDefault = XmlSchemaForm.None;
- internal XmlSchemaForm AttributeFormDefault = XmlSchemaForm.None;
- internal Hashtable IDCollection;
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKey.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKey.cs
deleted file mode 100755
index b883f9e8da7..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKey.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaKey.
- /// </summary>
- public class XmlSchemaKey : XmlSchemaIdentityConstraint
- {
- private static string xmlname = "key";
-
- public XmlSchemaKey()
- {
- }
- /// <remarks>
- /// 1. name must be present
- /// 2. selector and field must be present
- /// </remarks>
- [MonoTODO]
- internal new int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- return base.Compile(h,info);
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- internal new void error(ValidationEventHandler handle, string message)
- {
- errorCount++;
- ValidationHandler.RaiseValidationError(handle, this, message);
- }
-
- //<key
- // id = ID
- // name = NCName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (selector, field+))
- //</key>
- internal static XmlSchemaKey Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaKey key = new XmlSchemaKey();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaKey.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- key.LineNumber = reader.LineNumber;
- key.LinePosition = reader.LinePosition;
- key.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- key.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- key.Name = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for key",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,key);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return key;
-
- // Content: annotation?, selector, field+
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaKey.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- key.Annotation = annotation;
- continue;
- }
- if(level <= 2 && reader.LocalName == "selector")
- {
- level = 3;
- XmlSchemaXPath selector = XmlSchemaXPath.Read(reader,h,"selector");
- if(selector != null)
- key.Selector = selector;
- continue;
- }
- if(level <= 3 && reader.LocalName == "field")
- {
- level = 3;
- if(key.Selector == null)
- error(h,"selector must be defined before field declarations",null);
- XmlSchemaXPath field = XmlSchemaXPath.Read(reader,h,"field");
- if(field != null)
- key.Fields.Add(field);
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return key;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs
deleted file mode 100755
index f22a40f23bd..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaKeyref.
- /// </summary>
- public class XmlSchemaKeyref : XmlSchemaIdentityConstraint
- {
- private XmlQualifiedName refer;
- private static string xmlname = "keyref";
-
- public XmlSchemaKeyref()
- {
- refer = XmlQualifiedName.Empty;
- }
-
- [System.Xml.Serialization.XmlAttribute("refer")]
- public XmlQualifiedName Refer
- {
- get{ return refer; }
- set{ refer = value; }
- }
- /// <remarks>
- /// 1. name must be present
- /// 2. selector and field must be present
- /// 3. refer must be present
- /// </remarks>
- [MonoTODO]
- internal new int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount += base.Compile(h,info);
- if(refer == null || refer.IsEmpty)
- error(h,"refer must be present");
- else if(!XmlSchemaUtil.CheckQName(refer))
- error(h,"Refer is not a valid XmlQualifiedName");
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- internal new void error(ValidationEventHandler handle, string message)
- {
- errorCount++;
- ValidationHandler.RaiseValidationError(handle, this, message);
- }
- //<key
- // id = ID
- // name = NCName
- // refer = QName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (selector, field+))
- //</key>
- internal static XmlSchemaKeyref Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaKeyref keyref = new XmlSchemaKeyref();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaKeyref.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- keyref.LineNumber = reader.LineNumber;
- keyref.LinePosition = reader.LinePosition;
- keyref.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- keyref.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- keyref.Name = reader.Value;
- }
- else if(reader.Name == "refer")
- {
- Exception innerex;
- keyref.refer = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for refer attribute",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for keyref",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,keyref);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return keyref;
-
- // Content: annotation?, selector, field+
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaKeyref.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- keyref.Annotation = annotation;
- continue;
- }
- if(level <= 2 && reader.LocalName == "selector")
- {
- level = 3;
- XmlSchemaXPath selector = XmlSchemaXPath.Read(reader,h,"selector");
- if(selector != null)
- keyref.Selector = selector;
- continue;
- }
- if(level <= 3 && reader.LocalName == "field")
- {
- level = 3;
- if(keyref.Selector == null)
- error(h,"selector must be defined before field declarations",null);
- XmlSchemaXPath field = XmlSchemaXPath.Read(reader,h,"field");
- if(field != null)
- keyref.Fields.Add(field);
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return keyref;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaLengthFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaLengthFacet.cs
deleted file mode 100755
index 263d3c1c58e..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaLengthFacet.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaLengthFacet.
- /// </summary>
- public class XmlSchemaLengthFacet : XmlSchemaNumericFacet
- {
- private static string xmlname = "length";
-
- public XmlSchemaLengthFacet()
- {
- }
-
- //<length
- // fixed = boolean : false
- // id = ID
- // value = nonNegativeInteger
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</length>
- internal static XmlSchemaLengthFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaLengthFacet length = new XmlSchemaLengthFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaLengthFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- length.LineNumber = reader.LineNumber;
- length.LinePosition = reader.LinePosition;
- length.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- length.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- length.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- length.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for group",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,length);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return length;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaLengthFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- length.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return length;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.cs
deleted file mode 100755
index 258c5bf9ccc..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaMaxExclusiveFacet.
- /// </summary>
- public class XmlSchemaMaxExclusiveFacet : XmlSchemaFacet
- {
- private static string xmlname = "maxExclusive";
-
- public XmlSchemaMaxExclusiveFacet()
- {
- }
-
- //<maxExclusive
- // fixed = boolean : false
- // id = ID
- // value = anySimpleType
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</maxExclusive>
- internal static XmlSchemaMaxExclusiveFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaMaxExclusiveFacet maxex = new XmlSchemaMaxExclusiveFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaMaxExclusiveFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- maxex.LineNumber = reader.LineNumber;
- maxex.LinePosition = reader.LinePosition;
- maxex.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- maxex.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- maxex.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- maxex.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,maxex);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return maxex;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaMaxExclusiveFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- maxex.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return maxex;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.cs
deleted file mode 100755
index c080abad8d9..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaMaxInclusiveFacet.
- /// </summary>
- public class XmlSchemaMaxInclusiveFacet : XmlSchemaFacet
- {
- private static string xmlname = "maxInclusive";
-
- public XmlSchemaMaxInclusiveFacet()
- {
- }
-
- //<maxInclusive
- // fixed = boolean : false
- // id = ID
- // value = anySimpleType
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</maxInclusive>
- internal static XmlSchemaMaxInclusiveFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaMaxInclusiveFacet maxi = new XmlSchemaMaxInclusiveFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaMaxInclusiveFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- maxi.LineNumber = reader.LineNumber;
- maxi.LinePosition = reader.LinePosition;
- maxi.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- maxi.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- maxi.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- maxi.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,maxi);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return maxi;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaMaxInclusiveFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- maxi.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return maxi;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxLengthFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxLengthFacet.cs
deleted file mode 100755
index a7bbb98b145..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMaxLengthFacet.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaMaxLengthFacet.
- /// </summary>
- public class XmlSchemaMaxLengthFacet : XmlSchemaNumericFacet
- {
- private static string xmlname = "maxLength";
-
- public XmlSchemaMaxLengthFacet()
- {
- }
-
- //<maxLength
- // fixed = boolean : false
- // id = ID
- // value = nonNegativeInteger
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</maxLength>
- internal static XmlSchemaMaxLengthFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaMaxLengthFacet length = new XmlSchemaMaxLengthFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaMaxLengthFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- length.LineNumber = reader.LineNumber;
- length.LinePosition = reader.LinePosition;
- length.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- length.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- length.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- length.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for group",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,length);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return length;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaMaxLengthFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- length.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return length;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinExclusiveFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinExclusiveFacet.cs
deleted file mode 100755
index ea0cda2c7fa..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinExclusiveFacet.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaMinExclusiveFacet.
- /// </summary>
- public class XmlSchemaMinExclusiveFacet : XmlSchemaFacet
- {
- private static string xmlname = "minExclusive";
-
- public XmlSchemaMinExclusiveFacet()
- {
- }
-
- //<minExclusive
- // fixed = boolean : false
- // id = ID
- // value = anySimpleType
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</minExclusive>
- internal static XmlSchemaMinExclusiveFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaMinExclusiveFacet minex = new XmlSchemaMinExclusiveFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaMinExclusiveFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- minex.LineNumber = reader.LineNumber;
- minex.LinePosition = reader.LinePosition;
- minex.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- minex.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- minex.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- minex.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,minex);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return minex;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaMinExclusiveFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- minex.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return minex;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinInclusiveFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinInclusiveFacet.cs
deleted file mode 100755
index 8459cd3ebe5..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinInclusiveFacet.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaMinInclusiveFacet.
- /// </summary>
- public class XmlSchemaMinInclusiveFacet : XmlSchemaFacet
- {
- private static string xmlname = "minInclusive";
-
- public XmlSchemaMinInclusiveFacet()
- {
- }
- //<minInclusive
- // fixed = boolean : false
- // id = ID
- // value = anySimpleType
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</minInclusive>
- internal static XmlSchemaMinInclusiveFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaMinInclusiveFacet mini = new XmlSchemaMinInclusiveFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaMinInclusiveFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- mini.LineNumber = reader.LineNumber;
- mini.LinePosition = reader.LinePosition;
- mini.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- mini.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- mini.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- mini.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,mini);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return mini;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaMinInclusiveFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- mini.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return mini;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinLengthFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinLengthFacet.cs
deleted file mode 100755
index 51763977a4a..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaMinLengthFacet.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaMinLengthFacet.
- /// </summary>
- public class XmlSchemaMinLengthFacet : XmlSchemaNumericFacet
- {
- private static string xmlname = "minLength";
-
- public XmlSchemaMinLengthFacet()
- {
- }
-
- //<minLength
- // fixed = boolean : false
- // id = ID
- // value = nonNegativeInteger
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</minLength>
- internal static XmlSchemaMinLengthFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaMinLengthFacet length = new XmlSchemaMinLengthFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaMinLengthFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- length.LineNumber = reader.LineNumber;
- length.LinePosition = reader.LinePosition;
- length.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- length.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- length.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- length.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,length);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return length;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaMinLengthFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- length.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return length;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs
deleted file mode 100755
index f07b83213c5..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaNotation.
- /// </summary>
- public class XmlSchemaNotation : XmlSchemaAnnotated
- {
- private string name;
- private string pub;
- private string system;
- private XmlQualifiedName qualifiedName;
- private static string xmlname = "notation";
-
- public XmlSchemaNotation()
- {
- }
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name; }
- set{ name = value; }
- }
- [System.Xml.Serialization.XmlAttribute("public")]
- public string Public
- {
- get{ return pub; }
- set{ pub = value; }
- }
- [System.Xml.Serialization.XmlAttribute("system")]
- public string System
- {
- get{ return system; }
- set{ system = value; }
- }
-
- [XmlIgnore]
- internal XmlQualifiedName QualifiedName
- {
- get{ return qualifiedName;}
- }
-
- // 1. name and public must be present
- // public and system must be anyURI
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(Name == null)
- error(h,"Required attribute name must be present");
- else if(!XmlSchemaUtil.CheckNCName(this.name))
- error(h,"attribute name must be NCName");
- else
- qualifiedName = new XmlQualifiedName(Name,info.TargetNamespace);
-
- if(Public==null)
- error(h,"public must be present");
- else if(!XmlSchemaUtil.CheckAnyUri(Public))
- error(h,"public must be anyURI");
-
- if(system != null && !XmlSchemaUtil.CheckAnyUri(system))
- error(h,"system must be present and of Type anyURI");
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<notation
- // id = ID
- // name = NCName
- // public = anyURI
- // system = anyURI
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</notation>
- internal static XmlSchemaNotation Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaNotation notation = new XmlSchemaNotation();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaInclude.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- notation.LineNumber = reader.LineNumber;
- notation.LinePosition = reader.LinePosition;
- notation.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- notation.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- notation.name = reader.Value;
- }
- else if(reader.Name == "public")
- {
- notation.pub = reader.Value;
- }
- else if(reader.Name == "system")
- {
- notation.system = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for notation",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,notation);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return notation;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaNotation.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- notation.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return notation;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNumericFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNumericFacet.cs
deleted file mode 100755
index 72359a71f16..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNumericFacet.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaNumericFacet.
- /// </summary>
- public abstract class XmlSchemaNumericFacet : XmlSchemaFacet
- {
- protected XmlSchemaNumericFacet()
- {
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs
deleted file mode 100755
index dc99644009e..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaObject.
- /// </summary>
- public abstract class XmlSchemaObject
- {
- private int lineNumber;
- private int linePosition;
- private string sourceUri;
- private XmlSerializerNamespaces namespaces;
- internal ArrayList unhandledAttributeList ;
-
- internal int errorCount = 0;
-
- protected XmlSchemaObject()
- {
- namespaces = new XmlSerializerNamespaces();
- }
- [XmlIgnore]
- public int LineNumber
- {
- get{ return lineNumber; }
- set{ lineNumber = value; }
- }
- [XmlIgnore]
- public int LinePosition
- {
- get{ return linePosition; }
- set{ linePosition = value; }
- }
- [XmlIgnore]
- public string SourceUri
- {
- get{ return sourceUri; }
- set{ sourceUri = value; }
- }
-
- // Undocumented Property
- [XmlNamespaceDeclarations]
- public XmlSerializerNamespaces Namespaces
- {
- get{ return namespaces; }
- set{ namespaces = value; }
- }
-
- internal void error(ValidationEventHandler handle,string message)
- {
- errorCount++;
- ValidationHandler.RaiseValidationError(handle,this,message);
- }
- internal void warn(ValidationEventHandler handle,string message)
- {
- errorCount++;
- ValidationHandler.RaiseValidationWarning(handle,this,message);
- }
- internal static void error(ValidationEventHandler handle, string message, Exception innerException)
- {
- ValidationHandler.RaiseValidationError(handle,message, innerException);
- }
- internal static void warn(ValidationEventHandler handle, string message, Exception innerException)
- {
- ValidationHandler.RaiseValidationWarning(handle,message, innerException);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs
deleted file mode 100755
index 0a5defffc19..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaObjectCollection.
- /// </summary>
- public class XmlSchemaObjectCollection : System.Collections.CollectionBase
- {
- private XmlSchemaObject parent;
-
- public XmlSchemaObjectCollection()
- {
- }
- public XmlSchemaObjectCollection(XmlSchemaObject parent)
- {
- this.parent = parent;
- }
-
- // Properties
- public virtual XmlSchemaObject this[ int index ]
- {
- get
- {
- return (XmlSchemaObject) this.List[index];
- }
- set
- {
- this.List[index] = value;
- }
- }
-
- // Methods
- public int Add(XmlSchemaObject item)
- {
- return this.List.Add(item);
- }
-
- public bool Contains(XmlSchemaObject item)
- {
- return this.List.Contains(item);
- }
-
- public void CopyTo(XmlSchemaObject[] array, int index)
- {
- this.List.CopyTo(array,index);
- }
-
- [MonoTODO]
- public new XmlSchemaObjectEnumerator GetEnumerator()
- {
- return new XmlSchemaObjectEnumerator(this.List);
- }
-
- public int IndexOf(XmlSchemaObject item)
- {
- return this.List.IndexOf(item);
- }
-
- public void Insert(int index, XmlSchemaObject item)
- {
- this.List.Insert(index, item);
- }
-
- [MonoTODO]
- protected override void OnClear(){}
- [MonoTODO]
- protected override void OnInsert(int index,object item){}
- [MonoTODO]
- protected override void OnRemove(int index,object item){}
- [MonoTODO]
- protected override void OnSet(int index,object oldValue,object newValue){}
-
- public void Remove(XmlSchemaObject item)
- {
- this.List.Remove(item);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectEnumerator.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectEnumerator.cs
deleted file mode 100755
index 6c2af9513d5..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectEnumerator.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaObjectEnumerator.
- /// </summary>
- public sealed class XmlSchemaObjectEnumerator : IEnumerator
- {
- private IEnumerator ienum;
- internal XmlSchemaObjectEnumerator(IList list)
- {
- this.ienum = list.GetEnumerator();
- }
- // Properties
- public XmlSchemaObject Current
- {
- get
- {
- return (XmlSchemaObject) ienum.Current;
- }
- }
- // Methods
- public bool MoveNext()
- {
- return ienum.MoveNext();
- }
- public void Reset()
- {
- ienum.Reset();
- }
- //Explicit Interface implementation
- bool IEnumerator.MoveNext()
- {
- return ienum.MoveNext();
- }
- void IEnumerator.Reset()
- {
- ienum.Reset();
- }
- object IEnumerator.Current
- {
- get{return (XmlSchema) ienum.Current;}
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectTable.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectTable.cs
deleted file mode 100755
index 16461b9875c..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectTable.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Collections;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaObjectTable.
- /// </summary>
- public class XmlSchemaObjectTable
- {
- private Hashtable table;
-
- internal XmlSchemaObjectTable()
- {
- table = new Hashtable();
- }
- public int Count
- {
- get{ return table.Count; }
- }
- public XmlSchemaObject this[XmlQualifiedName name]
- {
- get{ return (XmlSchemaObject) table[name]; }
- }
- public ICollection Names
- {
- get{ return table.Keys; }
- }
- public ICollection Values
- {
- get{ return table.Values;}
- }
-
- public bool Contains(XmlQualifiedName name)
- {
- return table.Contains(name);
- }
- public IDictionaryEnumerator GetEnumerator()
- {
- return table.GetEnumerator();
- }
-
- internal void Add(XmlQualifiedName name, XmlSchemaObject value)
- {
- table.Add(name,value);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs
deleted file mode 100755
index 119c335b3c0..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaParticle.
- /// </summary>
- public abstract class XmlSchemaParticle : XmlSchemaAnnotated
- {
- decimal minOccurs, maxOccurs;
- string minstr, maxstr;
-
- protected XmlSchemaParticle()
- {
- minOccurs = decimal.One;
- maxOccurs = decimal.One;
- }
-
- #region Attributes
-
- [System.Xml.Serialization.XmlAttribute("minOccurs")]
- public string MinOccursString
- {
- get{ return minstr; }
- set
- {
- decimal val = decimal.Parse(value);
- if(val >= 0 && (val == Decimal.Truncate(val)))
- {
- minOccurs = val;
- minstr = val.ToString();
- }
- else
- {
- throw new XmlSchemaException
- ("MinOccursString must be a non-negative number",null);
- }
- }
- }
-
- [System.Xml.Serialization.XmlAttribute("maxOccurs")]
- public string MaxOccursString
- {
- get{ return maxstr; }
- set
- {
- if(value == "unbounded")
- {
- maxstr = value;
- maxOccurs = decimal.MaxValue;
- }
- else
- {
- decimal val = decimal.Parse(value);
- if(val >= 0 && (val == Decimal.Truncate(val)))
- {
- maxOccurs = val;
- maxstr = val.ToString();
- }
- else
- {
- throw new XmlSchemaException
- ("MaxOccurs must be a non-negative integer",null);
- }
- }
- }
- }
-
- #endregion
-
- #region XmlIgnore
-
- [XmlIgnore]
- public decimal MinOccurs
- {
- get{ return minOccurs; }
- set
- {
- MinOccursString = value.ToString();
- }
- }
-
- [XmlIgnore]
- public decimal MaxOccurs
- {
- get{ return maxOccurs; }
- set
- {
- MaxOccursString = value.ToString();
- }
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaPatternFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaPatternFacet.cs
deleted file mode 100755
index da2effbb380..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaPatternFacet.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaPatternFacet.
- /// </summary>
- public class XmlSchemaPatternFacet : XmlSchemaFacet
- {
- private static string xmlname = "pattern";
-
- public XmlSchemaPatternFacet()
- {
- }
- //<pattern
- // id = ID
- // value = anySimpleType
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</pattern>
- internal static XmlSchemaPatternFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaPatternFacet pattern = new XmlSchemaPatternFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaPatternFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- pattern.LineNumber = reader.LineNumber;
- pattern.LinePosition = reader.LinePosition;
- pattern.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- pattern.Id = reader.Value;
- }
- else if(reader.Name == "value")
- {
- pattern.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,pattern);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return pattern;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaPatternFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- pattern.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return pattern;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaReader.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaReader.cs
deleted file mode 100755
index fc4375a9767..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaReader.cs
+++ /dev/null
@@ -1,358 +0,0 @@
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// A wrapper around XmlReader
- /// </summary>
- public class XmlSchemaReader : XmlReader, IXmlLineInfo
- {
- XmlReader reader;
- ValidationEventHandler handler;
- bool hasLineInfo;
- public XmlSchemaReader(XmlReader reader,ValidationEventHandler handler)
- {
- this.reader = reader;
- this.handler = handler;
- if(reader is IXmlLineInfo)
- {
- IXmlLineInfo info = (IXmlLineInfo)reader;
- hasLineInfo = info.HasLineInfo();
- }
- }
-
- /// <summary>
- /// Returns the Namespace:LocalName for the object
- /// </summary>
- public string FullName
- {
- get { return NamespaceURI + ":" + LocalName; }
- }
-
- public void RaiseInvalidElementError()
- {
- string errstr = "Element "+FullName + " is invalid in this context.\n";
- if(hasLineInfo)
- errstr += "The error occured on ("+((IXmlLineInfo)reader).LineNumber
- +","+((IXmlLineInfo)reader).LinePosition+")";
- XmlSchemaObject.error(handler, errstr, null);
- SkipToEnd();
- }
- /// <summary>
- /// Reads till the next Element or EndElement. Also checks that the Namespace of the element is
- /// Schema's Namespace.
- /// </summary>
- /// <returns></returns>
- public bool ReadNextElement()
- {
- MoveToElement();
- while(Read())
- {
- if(NodeType == XmlNodeType.Element || NodeType == XmlNodeType.EndElement)
- {
- if(reader.NamespaceURI != XmlSchema.Namespace)
- {
- RaiseInvalidElementError();
- }
- else
- {
- return true;
- }
- }
- }
- return false;
- }
-
- /// <summary>
- /// Skips to the end of the current element
- /// </summary>
- public void SkipToEnd()
- {
- MoveToElement();
- if(IsEmptyElement || NodeType != XmlNodeType.Element)
- return;
- if(NodeType == XmlNodeType.Element)
- {
- int depth = Depth;
- while(Read())
- {
- if(Depth == depth)
- break;
- }
- }
- return;
- }
-
- #region LineInfo
- public bool HasLineInfo()
- {
- return hasLineInfo;
- }
- public int LineNumber
- {
- get { return hasLineInfo?((IXmlLineInfo)reader).LineNumber: 0; }
- }
- public int LinePosition
- {
- get { return hasLineInfo?((IXmlLineInfo)reader).LinePosition: 0; }
- }
- #endregion
-
- #region Delegates
- public override int AttributeCount
- {
- get { return reader.AttributeCount; }
- }
- public override string BaseURI
- {
- get { return reader.BaseURI; }
- }
- public override bool CanResolveEntity
- {
- get { return reader.CanResolveEntity; }
- }
- public override int Depth
- {
- get { return reader.Depth; }
- }
- public override bool EOF
- {
- get { return reader.EOF; }
- }
- public override bool HasAttributes
- {
- get { return reader.HasAttributes; }
- }
- public override bool HasValue
- {
- get { return reader.HasValue; }
- }
- public override bool IsDefault
- {
- get { return reader.IsDefault; }
- }
- public override bool IsEmptyElement
- {
- get { return reader.IsEmptyElement; }
- }
- public override string this[ int i ]
- {
- get { return reader[i]; }
- }
- public override string this[ string name ]
- {
- get { return reader[name]; }
- }
- public override string this[ string name, string namespaceURI ]
- {
- get { return reader[name,namespaceURI]; }
- }
- public override string LocalName
- {
- get { return reader.LocalName; }
- }
- public override string Name
- {
- get { return reader.Name; }
- }
- public override string NamespaceURI
- {
- get { return reader.NamespaceURI; }
- }
- public override XmlNameTable NameTable
- {
- get { return reader.NameTable; }
- }
- public override XmlNodeType NodeType
- {
- get { return reader.NodeType; }
- }
- public override string Prefix
- {
- get { return reader.Prefix; }
- }
- public override char QuoteChar
- {
- get { return reader.QuoteChar; }
- }
- public override ReadState ReadState
- {
- get { return reader.ReadState; }
- }
- public override string Value
- {
- get { return reader.Value; }
- }
- public override string XmlLang
- {
- get { return reader.XmlLang; }
- }
- public override XmlSpace XmlSpace
- {
- get { return reader.XmlSpace; }
- }
-
- public override void Close()
- {
- reader.Close();
- }
-
- public override bool Equals(object obj)
- {
- return reader.Equals(obj);
- }
-
- public override string GetAttribute(int i)
- {
- return reader.GetAttribute(i);
- }
-
- public override string GetAttribute(string name)
- {
- return reader.GetAttribute(name);
- }
-
- public override string GetAttribute(string name, string namespaceURI)
- {
- return reader.GetAttribute(name, namespaceURI);
- }
-
- public override int GetHashCode()
- {
- return reader.GetHashCode();
- }
-
- public override bool IsStartElement()
- {
- return reader.IsStartElement();
- }
-
- public override bool IsStartElement(string localname, string ns)
- {
- return reader.IsStartElement(localname, ns);
- }
-
- public override bool IsStartElement(string name)
- {
- return reader.IsStartElement(name);
- }
-
- public override string LookupNamespace(string prefix)
- {
- return reader.LookupNamespace(prefix);
- }
-
- public override void MoveToAttribute(int i)
- {
- reader.MoveToAttribute(i);
- }
-
- public override bool MoveToAttribute(string name)
- {
- return reader.MoveToAttribute(name);
- }
-
- public override bool MoveToAttribute(string name, string ns)
- {
- return reader.MoveToAttribute(name,ns);
- }
-
- public override System.Xml.XmlNodeType MoveToContent()
- {
- return reader.MoveToContent();
- }
-
- public override bool MoveToElement()
- {
- return reader.MoveToElement();
- }
-
- public override bool MoveToFirstAttribute()
- {
- return reader.MoveToFirstAttribute();
- }
-
- public override bool MoveToNextAttribute()
- {
- return reader.MoveToNextAttribute();
- }
-
- public override bool Read()
- {
- return reader.Read();
- }
-
- public override bool ReadAttributeValue()
- {
- return reader.ReadAttributeValue();
- }
-
- public override string ReadElementString()
- {
- return reader.ReadElementString();
- }
-
- public override string ReadElementString(string localname, string ns)
- {
- return reader.ReadElementString(localname, ns);
- }
-
- public override string ReadElementString(string name)
- {
- return reader.ReadElementString(name);
- }
-
- public override void ReadEndElement()
- {
- reader.ReadEndElement();
- }
-
- public override string ReadInnerXml()
- {
- return reader.ReadInnerXml();
- }
-
- public override string ReadOuterXml()
- {
- return reader.ReadOuterXml();
- }
-
- public override void ReadStartElement()
- {
- reader.ReadStartElement();
- }
-
- public override void ReadStartElement(string localname, string ns)
- {
- reader.ReadStartElement(localname, ns);
- }
-
- public override void ReadStartElement(string name)
- {
- reader.ReadStartElement(name);
- }
-
- public override string ReadString()
- {
- return reader.ReadString();
- }
-
- public override void ResolveEntity()
- {
- reader.ResolveEntity();
- }
-
- public override void Skip()
- {
- reader.Skip();
- }
-
- public override string ToString()
- {
- return reader.ToString();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs
deleted file mode 100755
index bd573ec94ab..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaRedefine.
- /// </summary>
- public class XmlSchemaRedefine : XmlSchemaExternal
- {
- private XmlSchemaObjectTable attributeGroups;
- private XmlSchemaObjectTable groups;
- private XmlSchemaObjectCollection items;
- private XmlSchemaObjectTable schemaTypes;
- private static string xmlname = "redefine";
-
- public XmlSchemaRedefine()
- {
- attributeGroups = new XmlSchemaObjectTable();
- groups = new XmlSchemaObjectTable();
- items = new XmlSchemaObjectCollection(this);
- schemaTypes = new XmlSchemaObjectTable();
- }
-
- [XmlElement("annotation",typeof(XmlSchemaAnnotation),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("group",typeof(XmlSchemaGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
- //NOTE: AttributeGroup and not AttributeGroupRef
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Items
- {
- get{ return items; }
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable AttributeGroups
- {
- get{ return attributeGroups; }
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable SchemaTypes
- {
- get{ return schemaTypes; }
- }
-
- [XmlIgnore]
- public XmlSchemaObjectTable Groups
- {
- get{ return groups; }
- }
-//<redefine
-// id = ID
-// schemaLocation = anyURI
-// {any attributes with non-schema namespace . . .}>
-// Content: (annotation | (simpleType | complexType | group | attributeGroup))*
-//</redefine>
- internal static XmlSchemaRedefine Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaRedefine redefine = new XmlSchemaRedefine();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaRedefine.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- redefine.LineNumber = reader.LineNumber;
- redefine.LinePosition = reader.LinePosition;
- redefine.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- redefine.Id = reader.Value;
- }
- else if(reader.Name == "schemaLocation")
- {
- redefine.SchemaLocation = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for redefine",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,redefine);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return redefine;
-
- //(annotation | (simpleType | complexType | group | attributeGroup))*
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaRedefine.Read, name="+reader.Name,null);
- break;
- }
- if(reader.LocalName == "annotation")
- {
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- redefine.items.Add(annotation);
- continue;
- }
- if(reader.LocalName == "simpleType")
- {
- XmlSchemaSimpleType simpleType = XmlSchemaSimpleType.Read(reader,h);
- if(simpleType != null)
- redefine.items.Add(simpleType);
- continue;
- }
- if(reader.LocalName == "complexType")
- {
- XmlSchemaComplexType complexType = XmlSchemaComplexType.Read(reader,h);
- if(complexType != null)
- redefine.items.Add(complexType);
- continue;
- }
- if(reader.LocalName == "group")
- {
- XmlSchemaGroup group = XmlSchemaGroup.Read(reader,h);
- if(group != null)
- redefine.items.Add(group);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- XmlSchemaAttributeGroup attributeGroup = XmlSchemaAttributeGroup.Read(reader,h);
- if(attributeGroup != null)
- redefine.items.Add(attributeGroup);
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return redefine;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs
deleted file mode 100755
index 769ab66f2b7..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs
+++ /dev/null
@@ -1,202 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSequence.
- /// </summary>
- public class XmlSchemaSequence : XmlSchemaGroupBase
- {
- private XmlSchemaObjectCollection items;
- private static string xmlname = "sequence";
-
- public XmlSchemaSequence()
- {
- items = new XmlSchemaObjectCollection();
- }
-
- [XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("any",typeof(XmlSchemaAny),Namespace="http://www.w3.org/2001/XMLSchema")]
- public override XmlSchemaObjectCollection Items
- {
- get{ return items; }
- }
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- //FIXME: Should we reset the values
- if(MinOccurs > MaxOccurs)
- error(h,"minOccurs must be less than or equal to maxOccurs");
-
- XmlSchemaUtil.CompileID(Id, this, info.IDCollection, h);
-
- foreach(XmlSchemaObject obj in Items)
- {
- if(obj is XmlSchemaElement)
- {
- errorCount += ((XmlSchemaElement)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaGroupRef)
- {
- errorCount += ((XmlSchemaGroupRef)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaChoice)
- {
- errorCount += ((XmlSchemaChoice)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaSequence)
- {
- errorCount += ((XmlSchemaSequence)obj).Compile(h,info);
- }
- else if(obj is XmlSchemaAny)
- {
- errorCount += ((XmlSchemaAny)obj).Compile(h,info);
- }
- }
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<sequence
- // id = ID
- // maxOccurs = (nonNegativeInteger | unbounded) : 1
- // minOccurs = nonNegativeInteger : 1
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (element | group | choice | sequence | any)*)
- //</sequence>
- internal static XmlSchemaSequence Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSequence sequence = new XmlSchemaSequence();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaSequence.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- sequence.LineNumber = reader.LineNumber;
- sequence.LinePosition = reader.LinePosition;
- sequence.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- sequence.Id = reader.Value;
- }
- else if(reader.Name == "maxOccurs")
- {
- try
- {
- sequence.MaxOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for maxOccurs",e);
- }
- }
- else if(reader.Name == "minOccurs")
- {
- try
- {
- sequence.MinOccursString = reader.Value;
- }
- catch(Exception e)
- {
- error(h,reader.Value + " is an invalid value for minOccurs",e);
- }
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for sequence",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,sequence);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return sequence;
-
- // Content: (annotation?, (element | group | choice | sequence | any)*)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSequence.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- sequence.Annotation = annotation;
- continue;
- }
- if(level <=2)
- {
- if(reader.LocalName == "element")
- {
- level = 2;
- XmlSchemaElement element = XmlSchemaElement.Read(reader,h);
- if(element != null)
- sequence.items.Add(element);
- continue;
- }
- if(reader.LocalName == "group")
- {
- level = 2;
- XmlSchemaGroupRef group = XmlSchemaGroupRef.Read(reader,h);
- if(group != null)
- sequence.items.Add(group);
- continue;
- }
- if(reader.LocalName == "choice")
- {
- level = 2;
- XmlSchemaChoice choice = XmlSchemaChoice.Read(reader,h);
- if(choice != null)
- sequence.items.Add(choice);
- continue;
- }
- if(reader.LocalName == "sequence")
- {
- level = 2;
- XmlSchemaSequence seq = XmlSchemaSequence.Read(reader,h);
- if(seq != null)
- sequence.items.Add(seq);
- continue;
- }
- if(reader.LocalName == "any")
- {
- level = 2;
- XmlSchemaAny any = XmlSchemaAny.Read(reader,h);
- if(any != null)
- sequence.items.Add(any);
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return sequence;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs
deleted file mode 100755
index 2c2fce3f933..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleContent.
- /// </summary>
- public class XmlSchemaSimpleContent : XmlSchemaContentModel
- {
- private XmlSchemaContent content;
- private static string xmlname = "simpleContent";
- public XmlSchemaSimpleContent()
- {
- }
-
- [XmlElement("restriction",typeof(XmlSchemaSimpleContentRestriction),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("extension",typeof(XmlSchemaSimpleContentExtension),Namespace="http://www.w3.org/2001/XMLSchema")]
- public override XmlSchemaContent Content
- {
- get{ return content; }
- set{ content = value; }
- }
-
- ///<remarks>
- /// 1. Content must be present and one of restriction or extention
- ///</remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(Content == null)
- {
- error(h, "Content must be present in a simpleContent");
- }
- else
- {
- if(Content is XmlSchemaSimpleContentRestriction)
- {
- XmlSchemaSimpleContentRestriction xscr = (XmlSchemaSimpleContentRestriction) Content;
- errorCount += xscr.Compile(h,info);
- }
- else if(Content is XmlSchemaSimpleContentExtension)
- {
- XmlSchemaSimpleContentExtension xsce = (XmlSchemaSimpleContentExtension) Content;
- errorCount += xsce.Compile(h,info);
- }
- else
- error(h,"simpleContent can't have any value other than restriction or extention");
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<simpleContent
- // id = ID
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (restriction | extension))
- //</simpleContent>
- internal static XmlSchemaSimpleContent Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSimpleContent simple = new XmlSchemaSimpleContent();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaComplexContent.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- simple.LineNumber = reader.LineNumber;
- simple.LinePosition = reader.LinePosition;
- simple.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- simple.Id = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for simpleContent",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,simple);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return simple;
- //Content: (annotation?, (restriction | extension))
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSimpleContent.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- simple.Annotation = annotation;
- continue;
- }
- if(level <=2)
- {
- if(reader.LocalName == "restriction")
- {
- level = 3;
- XmlSchemaSimpleContentRestriction restriction = XmlSchemaSimpleContentRestriction.Read(reader,h);
- if(restriction != null)
- simple.content = restriction;
- continue;
- }
- if(reader.LocalName == "extension")
- {
- level = 3;
- XmlSchemaSimpleContentExtension extension = XmlSchemaSimpleContentExtension.Read(reader,h);
- if(extension != null)
- simple.content = extension;
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return simple;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs
deleted file mode 100755
index 09d10f25ef6..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs
+++ /dev/null
@@ -1,190 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleContentExtension.
- /// </summary>
- public class XmlSchemaSimpleContentExtension : XmlSchemaContent
- {
-
- private XmlSchemaAnyAttribute any;
- private XmlSchemaObjectCollection attributes;
- private XmlQualifiedName baseTypeName;
- private static string xmlname = "extension";
-
- public XmlSchemaSimpleContentExtension()
- {
- baseTypeName = XmlQualifiedName.Empty;
- attributes = new XmlSchemaObjectCollection();
- }
-
- [System.Xml.Serialization.XmlAttribute("base")]
- public XmlQualifiedName BaseTypeName
- {
- get{ return baseTypeName; }
- set{ baseTypeName = value; }
- }
-
- [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Attributes
- {
- get{ return attributes; }
- }
-
- [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnyAttribute AnyAttribute
- {
- get{ return any; }
- set{ any = value; }
- }
-
- ///<remarks>
- /// 1. Base must be present and a QName
- ///</remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(BaseTypeName == null || BaseTypeName.IsEmpty)
- {
- error(h, "base must be present and a QName");
- }
- else if(!XmlSchemaUtil.CheckQName(BaseTypeName))
- error(h,"BaseTypeName must be a QName");
-
- if(this.AnyAttribute != null)
- {
- errorCount += AnyAttribute.Compile(h,info);
- }
-
- foreach(XmlSchemaObject obj in Attributes)
- {
- if(obj is XmlSchemaAttribute)
- {
- XmlSchemaAttribute attr = (XmlSchemaAttribute) obj;
- errorCount += attr.Compile(h,info);
- }
- else if(obj is XmlSchemaAttributeGroupRef)
- {
- XmlSchemaAttributeGroupRef atgrp = (XmlSchemaAttributeGroupRef) obj;
- errorCount += atgrp.Compile(h,info);
- }
- else
- error(h,obj.GetType() +" is not valid in this place::SimpleConentExtension");
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<extension
- //base = QName
- //id = ID
- //{any attributes with non-schema namespace . . .}>
- //Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
- //</extension>
- internal static XmlSchemaSimpleContentExtension Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSimpleContentExtension extension = new XmlSchemaSimpleContentExtension();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaAttributeGroup.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- extension.LineNumber = reader.LineNumber;
- extension.LinePosition = reader.LinePosition;
- extension.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "base")
- {
- Exception innerex;
- extension.baseTypeName= XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for base attribute",innerex);
- }
- else if(reader.Name == "id")
- {
- extension.Id = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for extension in this context",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,extension);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return extension;
-
- //Content: 1.annotation?, 2.(attribute | attributeGroup)*, 3.anyAttribute?
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSimpleContentExtension.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- extension.Annotation = annotation;
- continue;
- }
- if(level <= 2)
- {
- if(reader.LocalName == "attribute")
- {
- level = 2;
- XmlSchemaAttribute attr = XmlSchemaAttribute.Read(reader,h);
- if(attr != null)
- extension.Attributes.Add(attr);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- level = 2;
- XmlSchemaAttributeGroupRef attr = XmlSchemaAttributeGroupRef.Read(reader,h);
- if(attr != null)
- extension.attributes.Add(attr);
- continue;
- }
- }
- if(level <= 3 && reader.LocalName == "anyAttribute")
- {
- level = 4;
- XmlSchemaAnyAttribute anyattr = XmlSchemaAnyAttribute.Read(reader,h);
- if(anyattr != null)
- extension.AnyAttribute = anyattr;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return extension;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs
deleted file mode 100755
index f908b8788ed..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs
+++ /dev/null
@@ -1,337 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleContentRestriction.
- /// </summary>
- public class XmlSchemaSimpleContentRestriction : XmlSchemaContent
- {
-
- private XmlSchemaAnyAttribute any;
- private XmlSchemaObjectCollection attributes;
- private XmlSchemaSimpleType baseType;
- private XmlQualifiedName baseTypeName;
- private XmlSchemaObjectCollection facets;
- private static string xmlname = "restriction";
-
- public XmlSchemaSimpleContentRestriction()
- {
- baseTypeName = XmlQualifiedName.Empty;
- attributes = new XmlSchemaObjectCollection();
- facets = new XmlSchemaObjectCollection();
- }
-
- [System.Xml.Serialization.XmlAttribute("base")]
- public XmlQualifiedName BaseTypeName
- {
- get{ return baseTypeName; }
- set{ baseTypeName = value; }
- }
-
- [XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaSimpleType BaseType
- {
- get{ return baseType; }
- set{ baseType = value; }
- }
-
- [XmlElement("minExclusive",typeof(XmlSchemaMinExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("minInclusive",typeof(XmlSchemaMinInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("maxExclusive",typeof(XmlSchemaMaxExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("maxInclusive",typeof(XmlSchemaMaxInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("totalDigits",typeof(XmlSchemaTotalDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("fractionDigits",typeof(XmlSchemaFractionDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("length",typeof(XmlSchemaLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("minLength",typeof(XmlSchemaMinLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("maxLength",typeof(XmlSchemaMaxLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("enumeration",typeof(XmlSchemaEnumerationFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("whiteSpace",typeof(XmlSchemaWhiteSpaceFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("pattern",typeof(XmlSchemaPatternFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Facets
- {
- get{ return facets; }
- }
-
- [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Attributes
- {
- get{ return attributes; }
- }
-
- [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaAnyAttribute AnyAttribute
- {
- get{ return any; }
- set{ any = value; }
- }
-
- ///<remarks>
- /// 1. Base must be present and a QName
- ///</remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- if(BaseTypeName == null || BaseTypeName.IsEmpty)
- {
- error(h, "base must be present and a QName");
- }
- else if(!XmlSchemaUtil.CheckQName(BaseTypeName))
- error(h,"BaseTypeName must be a QName");
-
- if(BaseType != null)
- {
- errorCount += BaseType.Compile(h,info);
- }
-
- if(this.AnyAttribute != null)
- {
- errorCount += AnyAttribute.Compile(h,info);
- }
-
- foreach(XmlSchemaObject obj in Attributes)
- {
- if(obj is XmlSchemaAttribute)
- {
- XmlSchemaAttribute attr = (XmlSchemaAttribute) obj;
- errorCount += attr.Compile(h,info);
- }
- else if(obj is XmlSchemaAttributeGroupRef)
- {
- XmlSchemaAttributeGroupRef atgrp = (XmlSchemaAttributeGroupRef) obj;
- errorCount += atgrp.Compile(h,info);
- }
- else
- error(h,obj.GetType() +" is not valid in this place::SimpleContentRestriction");
- }
-
- //TODO: Compile Facets: Looks like they are a part of datatypes. So we'll do them with the datatypes
-
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<restriction
- //base = QName
- //id = ID
- //{any attributes with non-schema namespace . . .}>
- //Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*)?, ((attribute | attributeGroup)*, anyAttribute?))
- //</restriction>
- internal static XmlSchemaSimpleContentRestriction Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSimpleContentRestriction restriction = new XmlSchemaSimpleContentRestriction();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaComplexContentRestriction.Read, name="+reader.Name,null);
- reader.SkipToEnd();
- return null;
- }
-
- restriction.LineNumber = reader.LineNumber;
- restriction.LinePosition = reader.LinePosition;
- restriction.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "base")
- {
- Exception innerex;
- restriction.baseTypeName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for base attribute",innerex);
- }
- else if(reader.Name == "id")
- {
- restriction.Id = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for restriction",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,restriction);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return restriction;
-
- //Content: 1.annotation?,
- // 2.simpleType?,
- // 3.(minExclusive |...| enumeration | whiteSpace | pattern)*,
- // 4.(attribute | attributeGroup)*,
- // 5.anyAttribute?
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSimpleContentRestriction.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- restriction.Annotation = annotation;
- continue;
- }
- if(level <=2 && reader.LocalName == "simpleType")
- {
- level = 3;
- XmlSchemaSimpleType stype = XmlSchemaSimpleType.Read(reader,h);
- if(stype != null)
- restriction.baseType = stype;
- continue;
- }
- if(level <= 3)
- {
- if(reader.LocalName == "minExclusive")
- {
- level = 3;
- XmlSchemaMinExclusiveFacet minex = XmlSchemaMinExclusiveFacet.Read(reader,h);
- if(minex != null)
- restriction.facets.Add(minex);
- continue;
- }
- else if(reader.LocalName == "minInclusive")
- {
- level = 3;
- XmlSchemaMinInclusiveFacet mini = XmlSchemaMinInclusiveFacet.Read(reader,h);
- if(mini != null)
- restriction.facets.Add(mini);
- continue;
- }
- else if(reader.LocalName == "maxExclusive")
- {
- level = 3;
- XmlSchemaMaxExclusiveFacet maxex = XmlSchemaMaxExclusiveFacet.Read(reader,h);
- if(maxex != null)
- restriction.facets.Add(maxex);
- continue;
- }
- else if(reader.LocalName == "maxInclusive")
- {
- level = 3;
- XmlSchemaMaxInclusiveFacet maxi = XmlSchemaMaxInclusiveFacet.Read(reader,h);
- if(maxi != null)
- restriction.facets.Add(maxi);
- continue;
- }
- else if(reader.LocalName == "totalDigits")
- {
- level = 3;
- XmlSchemaTotalDigitsFacet total = XmlSchemaTotalDigitsFacet.Read(reader,h);
- if(total != null)
- restriction.facets.Add(total);
- continue;
- }
- else if(reader.LocalName == "fractionDigits")
- {
- level = 3;
- XmlSchemaFractionDigitsFacet fraction = XmlSchemaFractionDigitsFacet.Read(reader,h);
- if(fraction != null)
- restriction.facets.Add(fraction);
- continue;
- }
- else if(reader.LocalName == "length")
- {
- level = 3;
- XmlSchemaLengthFacet length = XmlSchemaLengthFacet.Read(reader,h);
- if(length != null)
- restriction.facets.Add(length);
- continue;
- }
- else if(reader.LocalName == "minLength")
- {
- level = 3;
- XmlSchemaMinLengthFacet minlen = XmlSchemaMinLengthFacet.Read(reader,h);
- if(minlen != null)
- restriction.facets.Add(minlen);
- continue;
- }
- else if(reader.LocalName == "maxLength")
- {
- level = 3;
- XmlSchemaMaxLengthFacet maxlen = XmlSchemaMaxLengthFacet.Read(reader,h);
- if(maxlen != null)
- restriction.facets.Add(maxlen);
- continue;
- }
- else if(reader.LocalName == "enumeration")
- {
- level = 3;
- XmlSchemaEnumerationFacet enumeration = XmlSchemaEnumerationFacet.Read(reader,h);
- if(enumeration != null)
- restriction.facets.Add(enumeration);
- continue;
- }
- else if(reader.LocalName == "whiteSpace")
- {
- level = 3;
- XmlSchemaWhiteSpaceFacet ws = XmlSchemaWhiteSpaceFacet.Read(reader,h);
- if(ws != null)
- restriction.facets.Add(ws);
- continue;
- }
- else if(reader.LocalName == "pattern")
- {
- level = 3;
- XmlSchemaPatternFacet pattern = XmlSchemaPatternFacet.Read(reader,h);
- if(pattern != null)
- restriction.facets.Add(pattern);
- continue;
- }
- }
- if(level <= 4)
- {
- if(reader.LocalName == "attribute")
- {
- level = 4;
- XmlSchemaAttribute attr = XmlSchemaAttribute.Read(reader,h);
- if(attr != null)
- restriction.Attributes.Add(attr);
- continue;
- }
- if(reader.LocalName == "attributeGroup")
- {
- level = 4;
- XmlSchemaAttributeGroupRef attr = XmlSchemaAttributeGroupRef.Read(reader,h);
- if(attr != null)
- restriction.attributes.Add(attr);
- continue;
- }
- }
- if(level <= 5 && reader.LocalName == "anyAttribute")
- {
- level = 6;
- XmlSchemaAnyAttribute anyattr = XmlSchemaAnyAttribute.Read(reader,h);
- if(anyattr != null)
- restriction.AnyAttribute = anyattr;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return restriction;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs
deleted file mode 100755
index 5edeb9c3fbe..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs
+++ /dev/null
@@ -1,234 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleType.
- /// </summary>
- public class XmlSchemaSimpleType : XmlSchemaType
- {
- private XmlSchemaSimpleTypeContent content;
- //compilation vars
- internal bool islocal = true; // Assuming local means we have to specify islocal=false only in XmlSchema
- private static string xmlname = "simpleType";
-
- public XmlSchemaSimpleType()
- {
- }
-
- [XmlElement("restriction",typeof(XmlSchemaSimpleTypeRestriction),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("list",typeof(XmlSchemaSimpleTypeList),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("union",typeof(XmlSchemaSimpleTypeUnion),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaSimpleTypeContent Content
- {
- get{ return content; }
- set{ content = value; }
- }
-
- /// <remarks>
- /// For a simple Type:
- /// 1. Content must be present
- /// 2. id if present, must have be a valid ID
- /// a) If the simpletype is local
- /// 1- are from <xs:complexType name="simpleType"> and <xs:complexType name="localSimpleType">
- /// 1. name is prohibited
- /// 2. final is prohibited
- /// b) If the simpletype is toplevel
- /// 1- are from <xs:complexType name="simpleType"> and <xs:complexType name="topLevelSimpleType">
- /// 1. name is required, type must be NCName
- /// 2. Content is required
- /// 3. final can have values : #all | (list | union | restriction)
- /// 4. If final is set, finalResolved is same as final (but within the values of b.3)
- /// 5. If final is not set, the finalDefault of the schema (ie. only #all and restriction)
- /// 6. Base type is:
- /// 4.1 If restriction is chosen,the base type of restriction or elements
- /// 4.2 otherwise simple ur-type
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- if(this.islocal) // a
- {
- if(this.Name != null) // a.1
- error(h,"Name is prohibited in a local simpletype");
- if(this.Final != XmlSchemaDerivationMethod.None) //a.2
- error(h,"Final is prohibited in a local simpletype");
- }
- else //b
- {
- if(this.Name == null) //b.1
- error(h,"Name is required in top level simpletype");
- else if(!XmlSchemaUtil.CheckNCName(this.Name)) // b.1.2
- error(h,"name attribute of a simpleType must be NCName");
- else
- this.qName = new XmlQualifiedName(this.Name,info.TargetNamespace);
-
- //NOTE: Although the FinalResolved can be Empty, it is not a valid value for Final
- //DEVIATION: If an error occurs, the finaldefault is always consulted. This deviates
- // from the way MS implementation works.
- switch(this.Final) //b.3, b.4
- {
- case XmlSchemaDerivationMethod.All:
- this.finalResolved = XmlSchemaDerivationMethod.All;
- break;
- case XmlSchemaDerivationMethod.List:
- this.finalResolved = XmlSchemaDerivationMethod.List;
- break;
- case XmlSchemaDerivationMethod.Union:
- this.finalResolved = XmlSchemaDerivationMethod.Union;
- break;
- case XmlSchemaDerivationMethod.Restriction:
- this.finalResolved = XmlSchemaDerivationMethod.Restriction;
- break;
- default:
- error(h,"The value of final attribute is not valid for simpleType");
- goto case XmlSchemaDerivationMethod.None;
- // use assignment from finaldefault on schema.
- case XmlSchemaDerivationMethod.None: // b.5
- if(info.FinalDefault == XmlSchemaDerivationMethod.All)
- finalResolved = XmlSchemaDerivationMethod.All;
- else
- finalResolved = info.FinalDefault & (XmlSchemaDerivationMethod.Restriction | XmlSchemaDerivationMethod.List |
- XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Union );
- break;
- }
- }
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- if(this.Content == null) //a.3,b.2
- error(h,"Content is required in a simpletype");
- else if(Content is XmlSchemaSimpleTypeRestriction)
- {
- errorCount += ((XmlSchemaSimpleTypeRestriction)Content).Compile(h,info);
- }
- else if(Content is XmlSchemaSimpleTypeList)
- {
- errorCount += ((XmlSchemaSimpleTypeList)Content).Compile(h,info);
- }
- else if(Content is XmlSchemaSimpleTypeUnion)
- {
- errorCount += ((XmlSchemaSimpleTypeUnion)Content).Compile(h,info);
- }
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- //<simpleType
- // final = (#all | (list | union | restriction))
- // id = ID
- // name = NCName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (restriction | list | union))
- //</simpleType>
- internal static XmlSchemaSimpleType Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSimpleType stype = new XmlSchemaSimpleType();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaGroup.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- stype.LineNumber = reader.LineNumber;
- stype.LinePosition = reader.LinePosition;
- stype.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "final")
- {
- Exception innerex;
- stype.Final = XmlSchemaUtil.ReadDerivationAttribute(reader, out innerex, "final");
- if(innerex != null)
- error(h, "some invalid values not a valid value for final", innerex);
- }
- else if(reader.Name == "id")
- {
- stype.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- stype.Name = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for simpleType",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,stype);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return stype;
-
- // Content: (annotation?, (restriction | list | union))
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSimpleType.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- stype.Annotation = annotation;
- continue;
- }
- if(level <= 2)
- {
- if(reader.LocalName == "restriction")
- {
- level = 3;
- XmlSchemaSimpleTypeRestriction restriction = XmlSchemaSimpleTypeRestriction.Read(reader,h);
- if(restriction != null)
- stype.content = restriction;
- continue;
- }
- if(reader.LocalName == "list")
- {
- level = 3;
- XmlSchemaSimpleTypeList list = XmlSchemaSimpleTypeList.Read(reader,h);
- if(list != null)
- stype.content = list;
- continue;
- }
- if(reader.LocalName == "union")
- {
- level = 3;
- XmlSchemaSimpleTypeUnion union = XmlSchemaSimpleTypeUnion.Read(reader,h);
- if(union != null)
- stype.content = union;
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return stype;
- }
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeContent.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeContent.cs
deleted file mode 100755
index 6068361768c..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeContent.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleTypeContent.
- /// </summary>
- public abstract class XmlSchemaSimpleTypeContent : XmlSchemaAnnotated
- {
- protected XmlSchemaSimpleTypeContent()
- {
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs
deleted file mode 100755
index dea8741a540..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleTypeList.
- /// </summary>
- public class XmlSchemaSimpleTypeList : XmlSchemaSimpleTypeContent
- {
- private XmlSchemaSimpleType itemType;
- private XmlQualifiedName itemTypeName;
- private static string xmlname = "list";
-
- public XmlSchemaSimpleTypeList()
- {
- this.ItemTypeName = XmlQualifiedName.Empty;
- }
-
- [System.Xml.Serialization.XmlAttribute("itemType")]
- public XmlQualifiedName ItemTypeName
- {
- get{ return itemTypeName; }
- set
- {
- itemTypeName = value;
- }
- }
-
- [XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaSimpleType ItemType
- {
- get{ return itemType; }
- set
- {
- itemType = value;
- }
- }
- /// <remarks>
- /// 1. One of itemType or a <simpleType> must be present, but not both.
- /// 2. id must be of type ID
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- if(ItemType != null && !ItemTypeName.IsEmpty)
- error(h, "both itemType and simpletype can't be present");
- if(ItemType == null && ItemTypeName.IsEmpty)
- error(h, "one of itemType or simpletype must be present");
- if(ItemType != null)
- {
- errorCount += ItemType.Compile(h,info);
- }
- if(!XmlSchemaUtil.CheckQName(ItemTypeName))
- error(h,"BaseTypeName must be a XmlQualifiedName");
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<list
- // id = ID
- // itemType = QName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (simpleType?))
- //</list>
- internal static XmlSchemaSimpleTypeList Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSimpleTypeList list = new XmlSchemaSimpleTypeList();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaSimpleTypeList.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- list.LineNumber = reader.LineNumber;
- list.LinePosition = reader.LinePosition;
- list.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- list.Id = reader.Value;
- }
- else if(reader.Name == "itemType")
- {
- Exception innerex;
- list.ItemTypeName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for itemType attribute",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for list",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,list);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return list;
- // Content: annotation?, simpleType?
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSimpleTypeList.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- list.Annotation = annotation;
- continue;
- }
- if(level <= 2 && reader.LocalName == "simpleType")
- {
- level = 3;
- XmlSchemaSimpleType stype = XmlSchemaSimpleType.Read(reader,h);
- if(stype != null)
- list.itemType = stype;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return list;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs
deleted file mode 100755
index b3f78b77129..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs
+++ /dev/null
@@ -1,267 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleTypeRestriction.
- /// </summary>
- public class XmlSchemaSimpleTypeRestriction : XmlSchemaSimpleTypeContent
- {
- private XmlSchemaSimpleType baseType;
- private XmlQualifiedName baseTypeName;
- private XmlSchemaObjectCollection facets;
- private static string xmlname = "restriction";
-
- public XmlSchemaSimpleTypeRestriction()
- {
- baseTypeName = XmlQualifiedName.Empty;
- facets = new XmlSchemaObjectCollection();
- }
-
- [System.Xml.Serialization.XmlAttribute("base")]
- public XmlQualifiedName BaseTypeName
- {
- get{ return baseTypeName; }
- set{ baseTypeName = value; }
- }
-
- [XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaSimpleType BaseType
- {
- get{ return baseType; }
- set{ baseType = value; }
- }
-
- [XmlElement("minExclusive",typeof(XmlSchemaMinExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("minInclusive",typeof(XmlSchemaMinInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("maxExclusive",typeof(XmlSchemaMaxExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("maxInclusive",typeof(XmlSchemaMaxInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("totalDigits",typeof(XmlSchemaTotalDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("fractionDigits",typeof(XmlSchemaFractionDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("length",typeof(XmlSchemaLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("minLength",typeof(XmlSchemaMinLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("maxLength",typeof(XmlSchemaMaxLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("enumeration",typeof(XmlSchemaEnumerationFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("whiteSpace",typeof(XmlSchemaWhiteSpaceFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- [XmlElement("pattern",typeof(XmlSchemaPatternFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection Facets
- {
- get{ return facets; }
- }
-
- /// <remarks>
- /// 1. One of base or simpletype must be present but not both
- /// 2. id must be a valid ID
- /// 3. base must be a valid QName *NO CHECK REQUIRED*
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- if(this.baseType != null && !this.BaseTypeName.IsEmpty)
- error(h, "both base and simpletype can't be set");
- if(this.baseType == null && this.BaseTypeName.IsEmpty)
- error(h, "one of basetype or simpletype must be present");
- if(this.baseType != null)
- {
- errorCount += this.baseType.Compile(h,info);
- }
- if(!XmlSchemaUtil.CheckQName(BaseTypeName))
- error(h,"BaseTypeName must be a XmlQualifiedName");
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<restriction
- // base = QName
- // id = ID
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (simpleType?, (minExclusive | minInclusive | maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength | maxLength | enumeration | whiteSpace | pattern)*))
- //</restriction>
- internal static XmlSchemaSimpleTypeRestriction Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaSimpleTypeRestriction.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- restriction.LineNumber = reader.LineNumber;
- restriction.LinePosition = reader.LinePosition;
- restriction.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- restriction.Id = reader.Value;
- }
- else if(reader.Name == "base")
- {
- Exception innerex;
- restriction.baseTypeName = XmlSchemaUtil.ReadQNameAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for base attribute",innerex);
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for restriction",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,restriction);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return restriction;
-
- // Content: annotation?, simpleType?, (minExclusive |. .. | pattern)*
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSimpleTypeRestriction.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- restriction.Annotation = annotation;
- continue;
- }
- if(level <= 2 && reader.LocalName == "simpleType")
- {
- level = 3;
- XmlSchemaSimpleType stype = XmlSchemaSimpleType.Read(reader,h);
- if(stype != null)
- restriction.baseType = stype;
- continue;
- }
- if(level <= 3)
- {
- if(reader.LocalName == "minExclusive")
- {
- level = 3;
- XmlSchemaMinExclusiveFacet minex = XmlSchemaMinExclusiveFacet.Read(reader,h);
- if(minex != null)
- restriction.facets.Add(minex);
- continue;
- }
- else if(reader.LocalName == "minInclusive")
- {
- level = 3;
- XmlSchemaMinInclusiveFacet mini = XmlSchemaMinInclusiveFacet.Read(reader,h);
- if(mini != null)
- restriction.facets.Add(mini);
- continue;
- }
- else if(reader.LocalName == "maxExclusive")
- {
- level = 3;
- XmlSchemaMaxExclusiveFacet maxex = XmlSchemaMaxExclusiveFacet.Read(reader,h);
- if(maxex != null)
- restriction.facets.Add(maxex);
- continue;
- }
- else if(reader.LocalName == "maxInclusive")
- {
- level = 3;
- XmlSchemaMaxInclusiveFacet maxi = XmlSchemaMaxInclusiveFacet.Read(reader,h);
- if(maxi != null)
- restriction.facets.Add(maxi);
- continue;
- }
- else if(reader.LocalName == "totalDigits")
- {
- level = 3;
- XmlSchemaTotalDigitsFacet total = XmlSchemaTotalDigitsFacet.Read(reader,h);
- if(total != null)
- restriction.facets.Add(total);
- continue;
- }
- else if(reader.LocalName == "fractionDigits")
- {
- level = 3;
- XmlSchemaFractionDigitsFacet fraction = XmlSchemaFractionDigitsFacet.Read(reader,h);
- if(fraction != null)
- restriction.facets.Add(fraction);
- continue;
- }
- else if(reader.LocalName == "length")
- {
- level = 3;
- XmlSchemaLengthFacet length = XmlSchemaLengthFacet.Read(reader,h);
- if(length != null)
- restriction.facets.Add(length);
- continue;
- }
- else if(reader.LocalName == "minLength")
- {
- level = 3;
- XmlSchemaMinLengthFacet minlen = XmlSchemaMinLengthFacet.Read(reader,h);
- if(minlen != null)
- restriction.facets.Add(minlen);
- continue;
- }
- else if(reader.LocalName == "maxLength")
- {
- level = 3;
- XmlSchemaMaxLengthFacet maxlen = XmlSchemaMaxLengthFacet.Read(reader,h);
- if(maxlen != null)
- restriction.facets.Add(maxlen);
- continue;
- }
- else if(reader.LocalName == "enumeration")
- {
- level = 3;
- XmlSchemaEnumerationFacet enumeration = XmlSchemaEnumerationFacet.Read(reader,h);
- if(enumeration != null)
- restriction.facets.Add(enumeration);
- continue;
- }
- else if(reader.LocalName == "whiteSpace")
- {
- level = 3;
- XmlSchemaWhiteSpaceFacet ws = XmlSchemaWhiteSpaceFacet.Read(reader,h);
- if(ws != null)
- restriction.facets.Add(ws);
- continue;
- }
- else if(reader.LocalName == "pattern")
- {
- level = 3;
- XmlSchemaPatternFacet pattern = XmlSchemaPatternFacet.Read(reader,h);
- if(pattern != null)
- restriction.facets.Add(pattern);
- continue;
- }
- }
- reader.RaiseInvalidElementError();
- }
- return restriction;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs
deleted file mode 100755
index f6279ad6bf3..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaSimpleTypeUnion.
- /// </summary>
- public class XmlSchemaSimpleTypeUnion : XmlSchemaSimpleTypeContent
- {
- private XmlSchemaObjectCollection baseTypes;
- private XmlQualifiedName[] memberTypes;
- private static string xmlname = "union";
-
- public XmlSchemaSimpleTypeUnion()
- {
- baseTypes = new XmlSchemaObjectCollection();
- }
-
- [XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaObjectCollection BaseTypes
- {
- get{ return baseTypes; }
- }
-
- [System.Xml.Serialization.XmlAttribute("memberTypes")]
- public XmlQualifiedName[] MemberTypes
- {
- get{ return memberTypes; }
- set{ memberTypes = value; }
- }
- /// <remarks>
- /// 1. Circular union type definition is disallowed. (WTH is this?)
- /// 2. id must be a valid ID
- /// </remarks>
- [MonoTODO]
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- errorCount = 0;
-
- int count = BaseTypes.Count;
-
- foreach(XmlSchemaObject obj in baseTypes)
- {
- if(obj != null && obj is XmlSchemaSimpleType)
- {
- XmlSchemaSimpleType stype = (XmlSchemaSimpleType) obj;
- errorCount += stype.Compile(h,info);
- }
- else
- {
- error(h, "baseTypes can't have objects other than a simpletype");
- }
- }
-
- if(memberTypes!=null)
- {
- for(int i=0; i< memberTypes.Length; i++)
- {
- if(memberTypes[i] == null || !XmlSchemaUtil.CheckQName(MemberTypes[i]))
- {
- warn(h,"Invalid membertype");
- memberTypes[i] = XmlQualifiedName.Empty;
- }
- else
- {
- count += MemberTypes.Length;
- }
- }
- }
-
- if(count == 0)
- error(h, "Atleast one simpletype or membertype must be present");
-
- XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);
-
- return errorCount;
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
- //<union
- // id = ID
- // memberTypes = List of QName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (simpleType*))
- //</union>
- internal static XmlSchemaSimpleTypeUnion Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaSimpleTypeUnion union = new XmlSchemaSimpleTypeUnion();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaSimpleTypeUnion.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- union.LineNumber = reader.LineNumber;
- union.LinePosition = reader.LinePosition;
- union.SourceUri = reader.BaseURI;
-
- //Read Attributes
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- union.Id = reader.Value;
- }
- else if(reader.Name == "memberTypes")
- {
- Exception innerEx;
- string[] names = XmlSchemaUtil.SplitList(reader.Value);
- union.memberTypes = new XmlQualifiedName[names.Length];
- for(int i=0;i<names.Length;i++)
- {
- union.memberTypes[i] = XmlSchemaUtil.ToQName(reader,names[i],out innerEx);
- if(innerEx != null)
- error(h,"'"+names[i] + "' is not a valid memberType",innerEx);
- }
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for union",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,union);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return union;
-
- // Content: annotation?, simpleType*
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaSimpleTypeUnion.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- union.Annotation = annotation;
- continue;
- }
- if(level <=2 && reader.LocalName == "simpleType")
- {
- level = 2;
- XmlSchemaSimpleType stype = XmlSchemaSimpleType.Read(reader,h);
- if(stype != null)
- union.baseTypes.Add(stype);
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return union;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaTotalDigitsFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaTotalDigitsFacet.cs
deleted file mode 100755
index d7ef688b549..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaTotalDigitsFacet.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaTotalDigitsFacet.
- /// </summary>
- public class XmlSchemaTotalDigitsFacet : XmlSchemaNumericFacet
- {
- private static string xmlname = "totalDigits";
-
- public XmlSchemaTotalDigitsFacet()
- {
- }
- //<totalDigits
- // fixed = boolean : false
- // id = ID
- // value = positiveInteger
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</totalDigits>
- internal static XmlSchemaTotalDigitsFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaTotalDigitsFacet td = new XmlSchemaTotalDigitsFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaTotalDigitsFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- td.LineNumber = reader.LineNumber;
- td.LinePosition = reader.LinePosition;
- td.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- td.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- td.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- td.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,td);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return td;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaTotalDigitsFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- td.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return td;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs
deleted file mode 100755
index e1a24b97c17..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-using System.ComponentModel;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaType.
- /// </summary>
- public class XmlSchemaType : XmlSchemaAnnotated
- {
- private object baseSchemaType;
- private XmlSchemaDatatype datatype;
- private XmlSchemaDerivationMethod derivedBy;
- private XmlSchemaDerivationMethod final;
- internal XmlSchemaDerivationMethod finalResolved;
- private bool isMixed;
- private string name;
- internal XmlQualifiedName qName;
-
- public XmlSchemaType()
- {
- final = XmlSchemaDerivationMethod.None;
- qName = XmlQualifiedName.Empty;
- }
-
- #region Attributes
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name; }
- set{ name = value; }
- }
- [DefaultValue(XmlSchemaDerivationMethod.None)]
- [System.Xml.Serialization.XmlAttribute("final")]
- public XmlSchemaDerivationMethod Final
- {
- get{ return final; }
- set{ final = value; }
- }
- [XmlIgnore]
- public XmlQualifiedName QualifiedName
- {
- get{ return qName; }
- }
- [XmlIgnore]
- public XmlSchemaDerivationMethod FinalResolved
- {
- get{ return finalResolved; }
- }
- [XmlIgnore]
- public object BaseSchemaType
- {
- get{ return baseSchemaType; }
- }
- [XmlIgnore]
- public XmlSchemaDerivationMethod DerivedBy
- {
- get{ return derivedBy; }
- }
- [XmlIgnore]
- public XmlSchemaDatatype Datatype
- {
- get{ return datatype; }
- }
- #endregion
-
- #region XmlIgnore
- [XmlIgnore]
- public virtual bool IsMixed
- {
- get{ return isMixed; }
- set{ isMixed = value; }
- }
- #endregion
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUnique.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUnique.cs
deleted file mode 100755
index bb8fd7a6e0d..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUnique.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaUnique.
- /// </summary>
- public class XmlSchemaUnique : XmlSchemaIdentityConstraint
- {
- private static string xmlname = "unique";
-
- public XmlSchemaUnique()
- {
- }
- /// <remarks>
- /// 1. name must be present
- /// 2. selector and field must be present
- /// </remarks>
- [MonoTODO]
- internal new int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- return base.Compile(h,info);
- }
-
- [MonoTODO]
- internal int Validate(ValidationEventHandler h)
- {
- return errorCount;
- }
-
- internal new void error(ValidationEventHandler handle, string message)
- {
- errorCount++;
- ValidationHandler.RaiseValidationError(handle, this, message);
- }
- //<unique
- // id = ID
- // name = NCName
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?, (selector, field+))
- //</unique>
- internal static XmlSchemaUnique Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaUnique unique = new XmlSchemaUnique();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaUnique.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- unique.LineNumber = reader.LineNumber;
- unique.LinePosition = reader.LinePosition;
- unique.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- unique.Id = reader.Value;
- }
- else if(reader.Name == "name")
- {
- unique.Name = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for unique",null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,unique);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return unique;
-
- // Content: annotation?, selector, field+
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaUnion.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- unique.Annotation = annotation;
- continue;
- }
- if(level <= 2 && reader.LocalName == "selector")
- {
- level = 3;
- XmlSchemaXPath selector = XmlSchemaXPath.Read(reader,h,"selector");
- if(selector != null)
- unique.Selector = selector;
- continue;
- }
- if(level <= 3 && reader.LocalName == "field")
- {
- level = 3;
- if(unique.Selector == null)
- error(h,"selector must be defined before field declarations",null);
- XmlSchemaXPath field = XmlSchemaXPath.Read(reader,h,"field");
- if(field != null)
- unique.Fields.Add(field);
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return unique;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs
deleted file mode 100755
index 8015edd8ed2..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaUse.
- /// </summary>
- public enum XmlSchemaUse
- {
- [XmlIgnore]
- None = 0x00000000,
- [XmlEnum("optional")]
- Optional = 0x00000001,
- [XmlEnum("prohibited")]
- Prohibited = 0x00000002,
- [XmlEnum("required")]
- Required = 0x00000003,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUtil.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUtil.cs
deleted file mode 100755
index dc6a7c6a64d..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUtil.cs
+++ /dev/null
@@ -1,299 +0,0 @@
-using System;
-using System.Xml;
-using System.Collections;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// All Methods in this class should use XmlConvert. Some Methods are not present in the
- /// MS Implementation. We should provide them.
- /// </summary>
- internal class XmlSchemaUtil
- {
- private XmlSchemaUtil()
- {}
-
- public static void CompileID(string id, XmlSchemaObject xso, Hashtable idCollection, ValidationEventHandler h)
- {
- //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#ID
- // 1. ID must be a NCName
- // 2. ID must be unique in the schema
- if(id == null)
- return;
- if(!CheckNCName(id))
- xso.error(h,id+" is not a valid id attribute");
- else if(idCollection.ContainsKey(id))
- xso.error(h,"Duplicate id attribute "+id);
- else
- idCollection.Add(id,xso);
- }
-
- [MonoTODO]
- public static bool CheckAnyUri(string uri)
- {
- return true;
- }
-
- public static bool CheckToken(string token)
- {
- //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#token
- return true;
- }
-
- public static bool CheckNormalizedString(string token)
- {
- return true;
- }
-
- public static bool CheckLanguage(string lang)
- {
- //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#language
- return true;
- }
- public static bool CheckNCName(string name)
- {
- //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#NCName
- try
- {
- XmlConvert.VerifyNCName(name);
- return true;
- }
- catch(Exception ex)
- {
- return false;
- }
- }
-
- public static bool CheckQName(XmlQualifiedName qname)
- {
- return true;
- }
- public static bool IsValidQName(string qname)
- {
- foreach(string part in qname.Split(new char[]{':'},2))
- {
- if(!CheckNCName(part))
- return false;
- }
- return true;
- }
-
- //FIXME: First remove all the multiple instances of whitespace and then return the strings.
- //The current method returns empty strings if there are two or more consecutive whitespaces.
- public static string[] SplitList(string list)
- {
- if(list == null || list == string.Empty)
- return new String[0];
-
- string[] listarr = list.Split(new char[]{' ','\t','\n'});
- int pos=0;
- int i = 0;
- for(i=0;i<listarr.Length;i++)
- {
- if(listarr[i] != null && listarr[i] != String.Empty)
- {
- listarr[pos++] = listarr[i];
- }
- }
- if(pos == i)
- return listarr;
- string[] retarr = new String[pos];
- if(pos!=0)
- Array.Copy(listarr, retarr, pos);
- return retarr;
- }
-
- public static void ReadUnhandledAttribute(XmlReader reader, XmlSchemaObject xso)
- {
- if(reader.Prefix == "xmlns")
- xso.Namespaces.Add(reader.LocalName, reader.Value);
- else if(reader.Name == "xmlns")
- xso.Namespaces.Add("",reader.Value);
- else
- {
- if(xso.unhandledAttributeList == null)
- xso.unhandledAttributeList = new System.Collections.ArrayList();
- XmlAttribute attr = new XmlDocument().CreateAttribute(reader.LocalName,reader.NamespaceURI);
- attr.Value = reader.Value;
- xso.unhandledAttributeList.Add(attr);
- }
- }
-
- public static bool ReadBoolAttribute(XmlReader reader, out Exception innerExcpetion)
- {
- innerExcpetion = null;
- try
- {
- bool val = XmlConvert.ToBoolean(reader.Value);
- return val;
- }
- catch(Exception ex)
- {
- innerExcpetion = ex;
- return false;
- }
- }
- public static decimal ReadDecimalAttribute(XmlReader reader, out Exception innerExcpetion)
- {
- innerExcpetion = null;
- try
- {
- decimal val = XmlConvert.ToDecimal(reader.Value);
- return val;
- }
- catch(Exception ex)
- {
- innerExcpetion = ex;
- return decimal.Zero;
- }
- }
-
- // Is some value is read, return it.
- // If no values return empty.
- // If exception, return none
- public static XmlSchemaDerivationMethod ReadDerivationAttribute(XmlReader reader, out Exception innerExcpetion, string name)
- {
- innerExcpetion = null;
- try
- {
- string list = reader.Value;
- string warn = "";
- XmlSchemaDerivationMethod val = 0;
-
- if(list.IndexOf("#all") != -1 && list.Trim() != "#all")
- {
- innerExcpetion = new Exception(list+" is not a valid value for "+ name +". #all if present must be the only value");
- return XmlSchemaDerivationMethod.All;
- }
- foreach(string xsdm in XmlSchemaUtil.SplitList(list))
- {
- switch(xsdm)
- {
- case "":
- val |= XmlSchemaDerivationMethod.Empty; break;
- case "#all":
- val |= XmlSchemaDerivationMethod.All; break;
- case "substitution":
- val |= XmlSchemaDerivationMethod.Substitution; break;
- case "extension":
- val |= XmlSchemaDerivationMethod.Extension; break;
- case "restriction":
- val |= XmlSchemaDerivationMethod.Restriction; break;
- case "list":
- val |= XmlSchemaDerivationMethod.List; break;
- case "union":
- val |= XmlSchemaDerivationMethod.Union; break;
- default:
- warn += xsdm + " "; break;
- }
- }
- if(warn != "")
- innerExcpetion = new Exception(warn + "is/are not valid values for " + name);
- return val;
- }
- catch(Exception ex)
- {
- innerExcpetion = ex;
- return XmlSchemaDerivationMethod.None;
- }
- }
-
- public static XmlSchemaForm ReadFormAttribute(XmlReader reader, out Exception innerExcpetion)
- {
- innerExcpetion = null;
- XmlSchemaForm val = XmlSchemaForm.None;
- switch(reader.Value)
- {
- case "qualified":
- val = XmlSchemaForm.Qualified; break;
- case "unqualified":
- val = XmlSchemaForm.Unqualified; break;
- default:
- innerExcpetion = new Exception("only qualified or unqulified is a valid value"); break;
- }
- return val;
- }
-
- public static XmlSchemaContentProcessing ReadProcessingAttribute(XmlReader reader, out Exception innerExcpetion)
- {
- innerExcpetion = null;
- XmlSchemaContentProcessing val = XmlSchemaContentProcessing.None;
- switch(reader.Value)
- {
- case "lax":
- val = XmlSchemaContentProcessing.Lax; break;
- case "strict":
- val = XmlSchemaContentProcessing.Strict; break;
- case "skip":
- val = XmlSchemaContentProcessing.Skip; break;
- default:
- innerExcpetion = new Exception("only lax , strict or skip are valid values for processContents");
- break;
- }
- return val;
- }
-
- public static XmlSchemaUse ReadUseAttribute(XmlReader reader, out Exception innerExcpetion)
- {
- innerExcpetion = null;
- XmlSchemaUse val = XmlSchemaUse.None;
- switch(reader.Value)
- {
- case "optional":
- val = XmlSchemaUse.Optional; break;
- case "prohibited":
- val = XmlSchemaUse.Prohibited; break;
- case "required":
- val = XmlSchemaUse.Required; break;
- default:
- innerExcpetion = new Exception("only optional , prohibited or required are valid values for use");
- break;
- }
- return val;
- }
- public static XmlQualifiedName ReadQNameAttribute(XmlReader reader, out Exception innerEx)
- {
- return ToQName(reader, reader.Value, out innerEx);
- }
-
- //While Creating a XmlQualifedName, we should check:
- // 1. If a prefix is present, its namespace should be resolvable.
- // 2. If a prefix is not present, and if the defaultNamespace is set,
- public static XmlQualifiedName ToQName(XmlReader reader, string qnamestr, out Exception innerEx)
- {
-
- string ns;
- string name;
- XmlQualifiedName qname;
- innerEx = null;
-
- if(!IsValidQName(qnamestr))
- {
- innerEx = new Exception(qnamestr + " is an invalid QName. Either name or namespace is not a NCName");
- return XmlQualifiedName.Empty;
- }
-
- string[] values = qnamestr.Split(new char[]{':'},2);
-
- if(values.Length == 2)
- {
- ns = reader.LookupNamespace(values[0]);
- if(ns == null)
- {
- innerEx = new Exception("Namespace Prefix '"+values[0]+"could not be resolved");
- return XmlQualifiedName.Empty;
- }
- name = values[1];
- }
- else
- {
- //Default Namespace
- ns = reader.LookupNamespace("");
- name = values[0];
- }
-
- qname = new XmlQualifiedName(name,ns);
- return qname;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.cs
deleted file mode 100755
index df39caba223..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaWhiteSpaceFacet.
- /// </summary>
- public class XmlSchemaWhiteSpaceFacet : XmlSchemaFacet
- {
- private static string xmlname = "whiteSpace";
-
- public XmlSchemaWhiteSpaceFacet()
- {
- }
- // <whiteSpace
- // fixed = boolean : false
- // id = ID
- // value = (collapse | preserve | replace)
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- // </whiteSpace>
- internal static XmlSchemaWhiteSpaceFacet Read(XmlSchemaReader reader, ValidationEventHandler h)
- {
- XmlSchemaWhiteSpaceFacet ws = new XmlSchemaWhiteSpaceFacet();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != xmlname)
- {
- error(h,"Should not happen :1: XmlSchemaWhiteSpaceFacet.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- ws.LineNumber = reader.LineNumber;
- ws.LinePosition = reader.LinePosition;
- ws.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- ws.Id = reader.Value;
- }
- else if(reader.Name == "fixed")
- {
- Exception innerex;
- ws.IsFixed = XmlSchemaUtil.ReadBoolAttribute(reader,out innerex);
- if(innerex != null)
- error(h, reader.Value + " is not a valid value for fixed attribute",innerex);
- }
- else if(reader.Name == "value")
- {
- ws.Value = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+xmlname,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,ws);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return ws;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != xmlname)
- error(h,"Should not happen :2: XmlSchemaWhiteSpaceFacet.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- ws.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return ws;
- }
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs
deleted file mode 100755
index 8f7447e0f53..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-using System.Xml.Serialization;
-using System.ComponentModel;
-using System.Xml;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSchemaXPath.
- /// </summary>
- public class XmlSchemaXPath : XmlSchemaAnnotated
- {
- private string xpath;
-
- public XmlSchemaXPath()
- {
- }
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("xpath")]
- public string XPath
- {
- get{ return xpath; }
- set{ xpath = value; }
- }
-
- internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
- {
- XmlSchemaUtil.CompileID(Id, this, info.IDCollection, h);
- return errorCount;
- }
-
- //<selector
- // id = ID
- // xpath = a subset of XPath expression, see below
- // {any attributes with non-schema namespace . . .}>
- // Content: (annotation?)
- //</selector>
- internal static XmlSchemaXPath Read(XmlSchemaReader reader, ValidationEventHandler h,string name)
- {
- XmlSchemaXPath path = new XmlSchemaXPath();
- reader.MoveToElement();
-
- if(reader.NamespaceURI != XmlSchema.Namespace || reader.LocalName != name)
- {
- error(h,"Should not happen :1: XmlSchemaComplexContentRestriction.Read, name="+reader.Name,null);
- reader.Skip();
- return null;
- }
-
- path.LineNumber = reader.LineNumber;
- path.LinePosition = reader.LinePosition;
- path.SourceUri = reader.BaseURI;
-
- while(reader.MoveToNextAttribute())
- {
- if(reader.Name == "id")
- {
- path.Id = reader.Value;
- }
- else if(reader.Name == "xpath")
- {
- path.xpath = reader.Value;
- }
- else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)
- {
- error(h,reader.Name + " is not a valid attribute for "+name,null);
- }
- else
- {
- XmlSchemaUtil.ReadUnhandledAttribute(reader,path);
- }
- }
-
- reader.MoveToElement();
- if(reader.IsEmptyElement)
- return path;
-
- // Content: (annotation?)
- int level = 1;
- while(reader.ReadNextElement())
- {
- if(reader.NodeType == XmlNodeType.EndElement)
- {
- if(reader.LocalName != name)
- error(h,"Should not happen :2: XmlSchemaXPath.Read, name="+reader.Name,null);
- break;
- }
- if(level <= 1 && reader.LocalName == "annotation")
- {
- level = 2; //Only one annotation
- XmlSchemaAnnotation annotation = XmlSchemaAnnotation.Read(reader,h);
- if(annotation != null)
- path.Annotation = annotation;
- continue;
- }
- reader.RaiseInvalidElementError();
- }
- return path;
- }
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSeverityType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSeverityType.cs
deleted file mode 100755
index f16d15967e8..00000000000
--- a/mcs/class/System.XML/System.Xml.Schema/XmlSeverityType.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-using System;
-
-namespace System.Xml.Schema
-{
- /// <summary>
- /// Summary description for XmlSeverityType.
- /// </summary>
- public enum XmlSeverityType
- {
- Error = 0x00000000,
- Warning = 0x00000001,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/AssemblyInfo.cs b/mcs/class/System.XML/System.Xml.Serialization/AssemblyInfo.cs
deleted file mode 100644
index 177a4f0e70a..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/AssemblyInfo.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
diff --git a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
deleted file mode 100755
index 3382f8f65e6..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2002-06-20 Ajay kumar Dwivedi <adwiv@yahoo.com>
-
- * Soap & XmlOverrides: Implemented using TypeMember as key with
- suggestions from Rafael.
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs
deleted file mode 100644
index 1030d4b668c..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeAttribute.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// SoapAttributeAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for SoapAttributeAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class SoapAttributeAttribute : Attribute
- {
- private string attrName;
- private string dataType;
- private string ns;
-
- public SoapAttributeAttribute ()
- {
- }
-
- public SoapAttributeAttribute (string attrName)
- {
- AttrName = attrName;
- }
-
- public string AttrName {
- get {
- return attrName;
- }
- set {
- attrName = value;
- }
- }
-
- public string DataType {
- get {
- return dataType;
- }
- set {
- dataType = value;
- }
- }
-
- public string Namespace {
- get {
- return ns;
- }
- set {
- ns = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeOverrides.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeOverrides.cs
deleted file mode 100644
index dcbbca6bcb7..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributeOverrides.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// SoapAttributeOverrides.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- ///
- /// </summary>
- public class SoapAttributeOverrides
- {
- /// <summary>
- /// This class requires to store SoapAttrributes indexed by a key containg
- /// both Type and Member Name. There are 3 approaches to this IMO.
- /// 1. Make the key as "FullTypeName..MemberName", with ".." seperating Type and Member.
- /// 2. Use a jagged 2D hashtable. The main hashtable is indexed by Type and each value
- /// contains another hashtable which is indexed by member names. (Too many hashtables)
- /// 3. Use a new class which emcompasses the Type and MemberName. An implementation is there
- /// in TypeMember class in this namespace. (Too many instantiations of the class needed)
- ///
- /// Method 1 is the most elegent, but I am not sure if the seperator is language insensitive.
- /// What if someone writes a language which allows . in the member names.
- /// </summary>
- ///
- private Hashtable overrides;
-
- public SoapAttributeOverrides ()
- {
- overrides = new Hashtable();
- }
-
- public SoapAttributes this [Type type]
- {
- get { return this [type, string.Empty]; }
- }
-
- public SoapAttributes this [Type type, string member]
- {
- get
- {
- return (SoapAttributes) overrides[GetKey(type,member)];
- }
- }
-
- public void Add (Type type, SoapAttributes attributes)
- {
- Add(type, string.Empty, attributes);
- }
-
- public void Add (Type type, string member, SoapAttributes attributes)
- {
- if(overrides[GetKey(type, member)] != null)
- throw new Exception("The attributes for the given type and Member already exist in the collection");
-
- overrides.Add(GetKey(type,member), attributes);
- }
-
- private TypeMember GetKey(Type type, string member)
- {
- return new TypeMember(type, member);
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributes.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapAttributes.cs
deleted file mode 100644
index 786ca2921f3..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapAttributes.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// SoapAttributes.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Reflection;
-using System;
-using System.ComponentModel;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for SoapAttributes.
- /// </summary>
- public class SoapAttributes
- {
- private SoapAttributeAttribute soapAttribute;
- private object soapDefaultValue;
- private SoapElementAttribute soapElement;
- private SoapEnumAttribute soapEnum;
- private bool soapIgnore;
- private SoapTypeAttribute soapType;
-
- public SoapAttributes ()
- {
- }
-
- public SoapAttributes (ICustomAttributeProvider provider)
- {
- object[] attributes = provider.GetCustomAttributes(false);
- foreach(object obj in attributes)
- {
- if(obj is SoapAttributeAttribute)
- soapAttribute = (SoapAttributeAttribute) obj;
- else if(obj is DefaultValueAttribute)
- soapDefaultValue = obj;
- else if(obj is SoapElementAttribute)
- soapElement = (SoapElementAttribute) obj;
- else if(obj is SoapEnumAttribute)
- soapEnum = (SoapEnumAttribute) obj;
- else if(obj is SoapIgnoreAttribute)
- soapIgnore = true;
- else if(obj is SoapTypeAttribute)
- soapType = (SoapTypeAttribute) obj;
- }
- }
-
- public SoapAttributeAttribute SoapAttribute
- {
- get { return soapAttribute; }
- set { soapAttribute = value; }
- }
-
- public object SoapDefaultValue
- {
- get { return soapDefaultValue; }
- set { soapDefaultValue = value; }
- }
-
- public SoapElementAttribute SoapElement
- {
- get { return soapElement; }
- set { soapElement = value; }
- }
-
- public SoapEnumAttribute SoapEnum
- {
- get { return soapEnum; }
- set { soapEnum = value; }
- }
-
- public bool SoapIgnore
- {
- get { return soapIgnore; }
- set { soapIgnore = value; }
- }
-
- public SoapTypeAttribute SoapType
- {
- get { return soapType; }
- set { soapType = value; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapElementAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapElementAttribute.cs
deleted file mode 100644
index fbb6527e821..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapElementAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// SoapElementAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for SoapElementAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class SoapElementAttribute : Attribute
- {
- private string dataType;
- private string elementName;
- private bool isNullable;
-
- public SoapElementAttribute ()
- {
- }
- public SoapElementAttribute (string elementName)
- {
- ElementName = elementName;
- }
-
- public string DataType {
- get {
- return dataType;
- }
- set {
- dataType = value;
- }
- }
-
- public string ElementName {
- get {
- return elementName;
- }
- set {
- elementName = value;
- }
- }
-
- public bool IsNullable {
- get {
- return isNullable;
- }
- set {
- isNullable = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapEnumAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapEnumAttribute.cs
deleted file mode 100644
index fba4f311126..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapEnumAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// SoapEnumAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for SoapEnumAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Field)]
- public class SoapEnumAttribute : Attribute
- {
- private string name;
-
- public SoapEnumAttribute ()
- {
- }
-
- public SoapEnumAttribute (string name)
- {
- Name = name;
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapIgnoreAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapIgnoreAttribute.cs
deleted file mode 100644
index 52798f1dd30..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapIgnoreAttribute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// SoapIgnoreAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for SoapIgnoreAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class SoapIgnoreAttribute : Attribute
- {
- public SoapIgnoreAttribute ()
- {
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapIncludeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapIncludeAttribute.cs
deleted file mode 100644
index 86f21c0b2db..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapIncludeAttribute.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// SoapIncludeAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for SoapIncludeAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Method)]
- public class SoapIncludeAttribute : Attribute
- {
- private Type type;
-
- public SoapIncludeAttribute ()
- {
- }
- public SoapIncludeAttribute( Type type)
- {
- Type = type;
- }
-
- public Type Type
- {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/SoapTypeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/SoapTypeAttribute.cs
deleted file mode 100644
index 038181ab828..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/SoapTypeAttribute.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// SoapTypeAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for SoapTypeAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Enum | AttributeTargets.Interface)]
- public class SoapTypeAttribute : Attribute
- {
- private string ns;
- private string typeName;
- private bool includeInSchema;
-
- public SoapTypeAttribute ()
- {
- }
- public SoapTypeAttribute (string typeName)
- {
- TypeName = typeName;
- }
- public SoapTypeAttribute (string typeName, string ns)
- {
- TypeName = typeName;
- Namespace = ns;
- }
-
- public bool IncludeInSchema
- {
- get { return includeInSchema; }
- set { includeInSchema = value; }
- }
-
- public string Namespace {
- get { return ns;
- }
- set { ns = value;
- }
- }
- public string TypeName {
- get { return typeName;
- }
- set { typeName = value;
- }
- }
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/TypeMember.cs b/mcs/class/System.XML/System.Xml.Serialization/TypeMember.cs
deleted file mode 100755
index 854e31cb511..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/TypeMember.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Collections;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// TypeMember is immutable class which is used as a key in a Hashtable.
- /// </summary>
-
- internal sealed class TypeMember
- {
- Type type;
- string member;
- internal TypeMember(Type type, string member)
- {
- this.type = type;
- this.member = member;
- }
-
- public override int GetHashCode()
- {
- return unchecked (type.GetHashCode() + member.GetHashCode());
- }
-
- public override bool Equals(object obj)
- {
- if(obj is TypeMember)
- return TypeMember.Equals(this,(TypeMember)obj);
-
- return false;
- }
-
- public static bool Equals(TypeMember tm1, TypeMember tm2)
- {
- if(Object.ReferenceEquals(tm1,tm2))
- return true;
- if(Object.ReferenceEquals(tm1,null) || Object.ReferenceEquals(tm2,null))
- return false;
- if(tm1.type == tm2.type && tm1.member == tm2.member)
- return true;
- return false;
- }
-
- public static bool operator==(TypeMember tm1, TypeMember tm2)
- {
- return TypeMember.Equals(tm1,tm2);
- }
-
- public static bool operator!=(TypeMember tm1, TypeMember tm2)
- {
- return !TypeMember.Equals(tm1,tm2);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventArgs.cs b/mcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventArgs.cs
deleted file mode 100644
index b501cb5fea0..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventArgs.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// UnreferencedObjectEventArgs.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for UnreferencedObjectEventArgs.
- /// </summary>
- public class UnreferencedObjectEventArgs : EventArgs
- {
- private object unreferencedObject;
- private string unreferencedId;
-
- public UnreferencedObjectEventArgs(object o, string id)
- {
- unreferencedObject = o;
- unreferencedId = id;
- }
-
- public string UnreferencedId {
- get{ return unreferencedId; }
- }
- public object UnreferencedObject {
- get{ return unreferencedObject; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventHandler.cs b/mcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventHandler.cs
deleted file mode 100755
index 5344f05a746..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/UnreferencedObjectEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// UnreferencedObjectEventHandler.cs:
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-using System;
-
-namespace System.Xml.Serialization {
-
- [Serializable]
- public delegate void UnreferencedObjectEventHandler (object sender, UnreferencedObjectEventArgs e);
-}
-
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAnyAttributeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAnyAttributeAttribute.cs
deleted file mode 100644
index c34e70448d6..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAnyAttributeAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// XmlAnyAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlAnyAttributeAttribute.
- /// </summary>
- ///
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlAnyAttributeAttribute : Attribute
- {
-
- public XmlAnyAttributeAttribute()
- {
-
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttribute.cs
deleted file mode 100644
index 8222a5bcf4c..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttribute.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// filename.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlAnyElementAttribute.
- /// </summary>
- ///
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlAnyElementAttribute : Attribute
- {
- private string elementName;
- private string ns;
-
- public XmlAnyElementAttribute ()
- {
- }
-
- public XmlAnyElementAttribute (string name)
- {
- elementName = name;
- }
-
- public XmlAnyElementAttribute (string name, string ns)
- {
- elementName = name;
- Namespace = ns;
- }
-
- public string Name {
- get {
- return elementName;
- }
- set {
- elementName = value;
- }
- }
- public string Namespace {
- get {
- return ns;
- }
- set {
- ns = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttributes.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttributes.cs
deleted file mode 100644
index db716a4f592..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAnyElementAttributes.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// XmlAnyElementAttributes.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml;
-using System.Xml.Serialization;
-using System.Collections;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlAnyElementAttributes.
- /// </summary>
- public class XmlAnyElementAttributes : CollectionBase
- {
-
- public XmlAnyElementAttribute this[int index]
- {
- get
- {
- return (XmlAnyElementAttribute)List[index];
- }
- set
- {
- List[index] = value;
- }
- }
-
- public int Add(XmlAnyElementAttribute attribute)
- {
- return List.Add(attribute);
- }
-
- public bool Contains(XmlAnyElementAttribute attribute)
- {
- return List.Contains(attribute);
- }
-
- public int IndexOf(XmlAnyElementAttribute attribute)
- {
- return List.IndexOf(attribute);
- }
-
- public void Insert(int index, XmlAnyElementAttribute attribute)
- {
- List.Insert(index, attribute);
- }
-
- public void Remove(XmlAnyElementAttribute attribute)
- {
- List.Remove(attribute);
- }
- }
-
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlArrayAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlArrayAttribute.cs
deleted file mode 100644
index 52d53612f6f..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlArrayAttribute.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// XmlArrayAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml.Schema;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlArrayAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlArrayAttribute : Attribute
- {
- private string elementName;
- private XmlSchemaForm form;
- private bool isNullable;
- private string ns;
-
- public XmlArrayAttribute()
- {
- }
-
- public XmlArrayAttribute(string elementName)
- {
- ElementName = elementName;
- }
-
- public string ElementName
- {
- get
- {
- return elementName;
- }
- set
- {
- elementName = value;
- }
- }
- public XmlSchemaForm Form
- {
- get
- {
- return form;
- }
- set
- {
- form = value;
- }
- }
- public bool IsNullable
- {
- get
- {
- return isNullable;
- }
- set
- {
- isNullable = value;
- }
- }
- public string Namespace
- {
- get
- {
- return ns;
- }
- set
- {
- ns = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttribute.cs
deleted file mode 100644
index d72c06322cb..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttribute.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// XmlArrayItemAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml.Schema;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlArrayItemAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlArrayItemAttribute : Attribute
- {
- private string dataType;
- private string elementName;
- private XmlSchemaForm form;
- private string ns;
- private bool isNullable;
- private int nestingLevel;
- private Type type;
-
- public XmlArrayItemAttribute ()
- {
- }
- public XmlArrayItemAttribute (string elementName)
- {
- ElementName = elementName;
- }
- public XmlArrayItemAttribute (Type type)
- {
- Type = type;
- }
- public XmlArrayItemAttribute (string elementName, Type type)
- {
- ElementName = elementName;
- Type = type;
- }
-
- public string DataType {
- get { return dataType; }
- set { dataType = value; }
- }
- public string ElementName {
- get { return elementName; }
- set { elementName = value; }
- }
- public XmlSchemaForm Form {
- get { return form; }
- set { form = value; }
- }
- public string Namespace {
- get { return ns; }
- set { ns = value; }
- }
- public bool IsNullable {
- get { return isNullable; }
- set { isNullable = value; }
- }
- public Type Type {
- get { return type; }
- set { type = value; }
- }
- public int NestingLevel {
- get { return nestingLevel; }
- set { nestingLevel = value; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttributes.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttributes.cs
deleted file mode 100644
index 51528209a41..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlArrayItemAttributes.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// XmlArrayItemAttributes.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml.Serialization;
-using System.Collections;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlArrayItemAttributes.
- /// </summary>
- public class XmlArrayItemAttributes : CollectionBase
- {
-
- public XmlArrayItemAttribute this [int index] {
- get {
- return (XmlArrayItemAttribute)List [index];
- }
- set {
- List [index] = value;
- }
- }
-
- public int Add (XmlArrayItemAttribute attribute)
- {
- return List.Add(attribute);
- }
-
- public bool Contains(XmlArrayItemAttribute attribute)
- {
- return List.Contains(attribute);
- }
-
- public void CopyTo(XmlArrayItemAttribute[] array, int index)
- {
- List.CopyTo(array, index);
- }
-
- public int IndexOf(XmlArrayItemAttribute attribute)
- {
- return List.IndexOf(attribute);
- }
-
- public void Insert(int index, XmlArrayItemAttribute attribute)
- {
- List.Insert(index, attribute);
- }
-
- public void Remove(XmlArrayItemAttribute attribute)
- {
- List.Remove(attribute);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeAttribute.cs
deleted file mode 100644
index e23ff75890c..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeAttribute.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// XmlAttributeAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml.Schema;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlAttributeAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlAttributeAttribute : Attribute
- {
- private string attributeName;
- private string dataType;
- private Type type;
- private XmlSchemaForm form;
- private string ns;
-
- public XmlAttributeAttribute ()
- {
- }
-
- public XmlAttributeAttribute (string attributeName)
- {
- AttributeName = attributeName;
- }
-
- public XmlAttributeAttribute (Type type)
- {
- Type = type;
- }
-
- public XmlAttributeAttribute (string attributeName, Type type)
- {
- AttributeName = attributeName;
- Type = type;
- }
-
- public string AttributeName {
- get {
- return attributeName;
- }
- set {
- attributeName = value;
- }
- }
- public string DataType {
- get {
- return dataType;
- }
- set {
- dataType = value;
- }
- }
- public XmlSchemaForm Form {
- get {
- return form;
- }
- set {
- if(Namespace != null)
- form = value;
- }
- }
- public string Namespace {
- get {
- return ns;
- }
- set {
- ns = value;
- }
- }
-
- public Type Type
- {
- get
- {
- return type;
- }
- set
- {
- type = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs
deleted file mode 100644
index e39c6811573..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventArgs.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// XmlAttributeEventArgs.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlAttributeEventArgs.
- /// </summary>
- public class XmlAttributeEventArgs : EventArgs
- {
- private XmlAttribute attr;
- private int lineNumber;
- private int linePosition;
- private object obj;
-
- internal XmlAttributeEventArgs(XmlAttribute attr, int lineNum, int linePos, object source)
- {
- this.attr = attr;
- this.lineNumber = lineNum;
- this.linePosition = linePos;
- this.obj = source;
- }
-
- public XmlAttribute Attr {
- get { return attr; }
- }
-
- public int LineNumber {
- get { return lineNumber; }
- }
-
- public int LinePosition {
- get { return linePosition; }
- }
-
- public object ObjectBeingDeserialized {
- get{ return obj; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventHandler.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventHandler.cs
deleted file mode 100755
index 35a0f2d5474..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// XmlAttributeEventHandler.cs:
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-using System;
-
-namespace System.Xml.Serialization {
-
- [Serializable]
- public delegate void XmlAttributeEventHandler (object sender, XmlAttributeEventArgs e);
-}
-
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeOverrides.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeOverrides.cs
deleted file mode 100644
index 75c6112c794..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributeOverrides.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// XmlAttributeOverrides.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlAttributeOverrides.
- /// </summary>
- public class XmlAttributeOverrides
- {
-
- private Hashtable overrides;
-
- public XmlAttributeOverrides ()
- {
- overrides = new Hashtable();
- }
-
- public XmlAttributes this [Type type]
- {
- get { return this [type, string.Empty]; }
- }
-
- public XmlAttributes this [Type type, string member]
- {
- get
- {
- return (XmlAttributes) overrides[GetKey(type,member)];
- }
- }
-
- public void Add (Type type, XmlAttributes attributes)
- {
- Add(type, string.Empty, attributes);
- }
-
- public void Add (Type type, string member, XmlAttributes attributes)
- {
- if(overrides[GetKey(type, member)] != null)
- throw new Exception("The attributes for the given type and Member already exist in the collection");
-
- overrides.Add(GetKey(type,member), attributes);
- }
-
- private TypeMember GetKey(Type type, string member)
- {
- return new TypeMember(type, member);
- }
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributes.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlAttributes.cs
deleted file mode 100644
index 58b5472c9dd..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlAttributes.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// XmlAttributes.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Reflection;
-using System;
-using System.ComponentModel;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlAttributes.
- /// </summary>
- public class XmlAttributes
- {
- private XmlAnyAttributeAttribute xmlAnyAttribute;
- private XmlAnyElementAttributes xmlAnyElements;
- private XmlArrayAttribute xmlArray;
- private XmlArrayItemAttributes xmlArrayItems;
- private XmlAttributeAttribute xmlAttribute;
- private XmlChoiceIdentifierAttribute xmlChoiceIdentifier;
- private object xmlDefaultValue;
- private XmlElementAttributes xmlElements;
- private XmlEnumAttribute xmlEnum;
- private bool xmlIgnore;
- private bool xmlns;
- private XmlRootAttribute xmlRoot;
- private XmlTextAttribute xmlText;
- private XmlTypeAttribute xmlType;
-
- public XmlAttributes ()
- {
- xmlAnyElements = new XmlAnyElementAttributes ();
- xmlArrayItems = new XmlArrayItemAttributes ();
- xmlElements = new XmlElementAttributes ();
- }
-
- public XmlAttributes (ICustomAttributeProvider provider)
- {
- object[] attributes = provider.GetCustomAttributes(false);
- foreach(object obj in attributes)
- {
- if(obj is XmlAnyAttributeAttribute)
- xmlAnyAttribute = (XmlAnyAttributeAttribute) obj;
- else if(obj is XmlAnyElementAttributes)
- xmlAnyElements = (XmlAnyElementAttributes) obj;
- else if(obj is XmlArrayAttribute)
- xmlArray = (XmlArrayAttribute) obj;
- else if(obj is XmlArrayItemAttributes)
- xmlArrayItems = (XmlArrayItemAttributes) obj;
- else if(obj is XmlAttributeAttribute)
- xmlAttribute = (XmlAttributeAttribute) obj;
- else if(obj is XmlChoiceIdentifierAttribute)
- xmlChoiceIdentifier = (XmlChoiceIdentifierAttribute) obj;
- else if(obj is DefaultValueAttribute)
- xmlDefaultValue = obj;
- else if(obj is XmlElementAttributes)
- xmlElements = (XmlElementAttributes) obj;
- else if(obj is XmlEnumAttribute)
- xmlEnum = (XmlEnumAttribute) obj;
- else if(obj is XmlIgnoreAttribute)
- xmlIgnore = true;
- else if(obj is XmlNamespaceDeclarationsAttribute)
- xmlns = true;
- else if(obj is XmlRootAttribute)
- xmlRoot = (XmlRootAttribute) obj;
- else if(obj is XmlTextAttribute)
- xmlText = (XmlTextAttribute) obj;
- else if(obj is XmlTypeAttribute)
- xmlType = (XmlTypeAttribute) obj;
- }
- }
-
- public XmlAnyAttributeAttribute XmlAnyAttribute {
- get {
- return xmlAnyAttribute;
- }
- set {
- xmlAnyAttribute = value;
- }
- }
- public XmlAnyElementAttributes XmlAnyElements {
- get {
- return xmlAnyElements;
- }
- }
- public XmlArrayAttribute XmlArray {
- get {
- return xmlArray;
- }
- set {
- xmlArray = value;
- }
- }
- public XmlArrayItemAttributes XmlArrayItems {
- get {
- return xmlArrayItems;
- }
- }
- public XmlAttributeAttribute XmlAttribute {
- get {
- return xmlAttribute;
- }
- set {
- xmlAttribute = value;
- }
- }
- public XmlChoiceIdentifierAttribute XmlChoiceIdentifier {
- get {
- return xmlChoiceIdentifier;
- }
- set {
- xmlChoiceIdentifier = value;
- }
- }
- public object XmlDefaultValue {
- get {
- return xmlDefaultValue;
- }
- set {
- xmlDefaultValue = value;
- }
- }
- public XmlElementAttributes XmlElements {
- get {
- return xmlElements;
- }
- }
- public XmlEnumAttribute XmlEnum {
- get {
- return xmlEnum;
- }
- set {
- xmlEnum = value;
- }
- }
- public bool XmlIgnore {
- get {
- return xmlIgnore;
- }
- set {
- xmlIgnore = value;
- }
- }
- public bool Xmlns {
- get {
- return xmlns;
- }
- set {
- xmlns = value;
- }
- }
- public XmlRootAttribute XmlRoot {
- get {
- return xmlRoot;}
- set {
- xmlRoot = value;
- }
- }
- public XmlTextAttribute XmlText {
- get {
- return xmlText;
- }
- set {
- xmlText = value;
- }
- }
- public XmlTypeAttribute XmlType {
- get {
- return xmlType;
- }
- set {
- xmlType = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlChoiceIdentifierAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlChoiceIdentifierAttribute.cs
deleted file mode 100644
index 08d2aba86ef..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlChoiceIdentifierAttribute.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// XmlChoiceIdentifierAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlChoiceIdentifierAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlChoiceIdentifierAttribute : Attribute
- {
- private string memberName;
-
- public XmlChoiceIdentifierAttribute ()
- {
- }
- public XmlChoiceIdentifierAttribute (string name)
- {
- MemberName = name;
- }
-
- public string MemberName {
- get {
- return memberName;
- }
- set {
- memberName = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlElementAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlElementAttribute.cs
deleted file mode 100644
index 3a00225004c..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlElementAttribute.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// XmlElementAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml.Schema;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlElementAttribute.
- /// </summary
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple=true)]
- public class XmlElementAttribute : Attribute
- {
- private string dataType;
- private string elementName;
- private XmlSchemaForm form;
- private string ns;
- private bool isNullable;
- private Type type;
-
- public XmlElementAttribute ()
- {
- }
- public XmlElementAttribute (string elementName)
- {
- ElementName = elementName;
- }
- public XmlElementAttribute (Type type)
- {
- Type = type;
- }
- public XmlElementAttribute (string elementName, Type type)
- {
- ElementName = elementName;
- Type = type;
- }
-
- public string DataType {
- get {
- return dataType;
- }
- set {
- dataType = value;
- }
- }
- public string ElementName {
- get {
- return elementName;
- }
- set {
- elementName = value;
- }
- }
- public XmlSchemaForm Form {
- get {
- return form;
- }
- set {
- form = value;
- }
- }
- public string Namespace {
- get {
- return ns;
- }
- set {
- ns = value;
- }
- }
- public bool IsNullable {
- get {
- return isNullable;
- }
- set {
- isNullable = value;
- }
- }
- public Type Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlElementAttributes.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlElementAttributes.cs
deleted file mode 100644
index 44797db9831..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlElementAttributes.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// XmlElementAttributes.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Collections;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlElementAttributes.
- /// </summary>
- public class XmlElementAttributes : CollectionBase
- {
- public XmlElementAttribute this [int index] {
- get {
- return (XmlElementAttribute)List [index];
- }
- set {
- List [index] = value;
- }
- }
-
- public int Add (XmlElementAttribute attribute)
- {
- return List.Add (attribute);
- }
-
- public bool Contains(XmlElementAttribute attribute)
- {
- return List.Contains(attribute);
- }
-
- public int IndexOf(XmlElementAttribute attribute)
- {
- return List.IndexOf(attribute);
- }
-
- public void Insert(int index, XmlElementAttribute attribute)
- {
- List.Insert(index, attribute);
- }
-
- public void Remove(XmlElementAttribute attribute)
- {
- List.Remove(attribute);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs
deleted file mode 100644
index 94655c0bb0c..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventArgs.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// XmlElementEventArgs.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlElementEventArgs.
- /// </summary>
- public class XmlElementEventArgs : EventArgs
- {
- private XmlElement attr;
- private int lineNumber;
- private int linePosition;
- private object obj;
-
- internal XmlElementEventArgs(XmlElement attr, int lineNum, int linePos, object source)
- {
- this.attr = attr;
- this.lineNumber = lineNum;
- this.linePosition = linePos;
- this.obj = source;
- }
-
- public XmlElement Element
- {
- get { return attr; }
- }
-
- public int LineNumber
- {
- get { return lineNumber; }
- }
-
- public int LinePosition
- {
- get { return linePosition; }
- }
-
- public object ObjectBeingDeserialized
- {
- get{ return obj; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventHandler.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventHandler.cs
deleted file mode 100755
index be4dda7428a..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlElementEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// XmlElementEventHandler.cs:
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-using System;
-
-namespace System.Xml.Serialization {
-
- [Serializable]
- public delegate void XmlElementEventHandler (object sender, XmlElementEventArgs e);
-}
-
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlEnumAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlEnumAttribute.cs
deleted file mode 100644
index e95087c09fb..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlEnumAttribute.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// XmlEnumAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlEnumAttribute.
- /// </summary>\
- [AttributeUsage(AttributeTargets.Field)]
- public class XmlEnumAttribute : Attribute
- {
- private string name;
-
- public XmlEnumAttribute ()
- {
- }
-
- public XmlEnumAttribute (string name)
- {
- Name = name;
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlIgnoreAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlIgnoreAttribute.cs
deleted file mode 100644
index cb0fe82ba33..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlIgnoreAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// XmlIgnoreAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlIgnoreAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlIgnoreAttribute : Attribute
- {
- public XmlIgnoreAttribute ()
- {
-
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlIncludeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlIncludeAttribute.cs
deleted file mode 100644
index e7eafcdf4cc..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlIncludeAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// XmlIncludeAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlIncludeAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Method)]
- public class XmlIncludeAttribute : Attribute
- {
- private Type type;
-
- public XmlIncludeAttribute (Type type)
- {
- Type = type;
- }
-
- public Type Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs
deleted file mode 100644
index 7c6fd5f880a..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlMapping.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// XmlMapping.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlMapping.
- /// </summary>
- public abstract class XmlMapping
- {
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlNamespaceDeclarationsAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlNamespaceDeclarationsAttribute.cs
deleted file mode 100644
index 4cc59b3cf00..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlNamespaceDeclarationsAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// XmlNamespaceDeclarationsAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlNamespaceDeclarationsAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlNamespaceDeclarationsAttribute : Attribute
- {
- public XmlNamespaceDeclarationsAttribute ()
- {
-
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlNodeEventArgs.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlNodeEventArgs.cs
deleted file mode 100644
index 8064d6855f2..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlNodeEventArgs.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// XmlNodeEventArgs.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlNodeEventArgs.
- /// </summary>
- public class XmlNodeEventArgs : EventArgs
- {
- private int linenumber;
- private int lineposition ;
- private string localname;
- private string name;
- private string nsuri;
- private XmlNodeType nodetype;
- private object source;
- private string text;
-
- internal XmlNodeEventArgs(int linenumber, int lineposition, string localname, string name, string nsuri,
- XmlNodeType nodetype, object source, string text)
- {
- this.linenumber = linenumber;
- this.lineposition = lineposition;
- this.localname = localname;
- this.name = name;
- this.nsuri = nsuri;
- this.nodetype = nodetype;
- this.source = source;
- this.text = text;
- }
-
- public int LineNumber
- {
- get { return linenumber; }
- }
-
- public int LinePosition
- {
- get { return lineposition; }
- }
-
- public string LocalName
- {
- get { return localname; }
- }
-
- public string Name
- {
- get { return name; }
- }
-
- public string NamespaceURI
- {
- get { return nsuri; }
- }
-
- public XmlNodeType NodeType
- {
- get { return nodetype; }
- }
-
- public object ObjectBeingDeserialized
- {
- get { return source; }
- }
-
- public string Text
- {
- get { return text; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlNodeEventHandler.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlNodeEventHandler.cs
deleted file mode 100755
index 4c1fdb5c92b..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlNodeEventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// XmlNodeEventHandler.cs:
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-using System;
-
-namespace System.Xml.Serialization {
-
- [Serializable]
- public delegate void XmlNodeEventHandler (object sender, XmlNodeEventArgs e);
-}
-
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs
deleted file mode 100644
index cc3a83c1b9f..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlRootAttribute.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// XmlRootAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlRootAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Enum | AttributeTargets.Interface |
- AttributeTargets.ReturnValue)]
- public class XmlRootAttribute : Attribute
- {
- private string dataType;
- private string elementName;
- private bool isNullable;
- private string ns;
-
- public XmlRootAttribute ()
- {
-
- }
- public XmlRootAttribute (string elementName)
- {
- ElementName = elementName;
- }
-
- public string DataType
- {
- get {
- return dataType;
- }
- set {
- dataType = value;
- }
- }
- public string ElementName
- {
- get {
- return elementName;
- }
- set {
- elementName = value;
- }
- }
- public bool IsNullable
- {
- get {
- return isNullable;
- }
- set {
- isNullable = value;
- }
- }
- public string Namespace
- {
- get {
- return ns;
- }
- set {
- ns = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs
deleted file mode 100644
index f20b7a78437..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// XmlSerializer.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml.Serialization;
-using System.Xml;
-using System.IO;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlSerializer.
- /// </summary>
- public class XmlSerializer
- {
- [MonoTODO]
- protected XmlSerializer ()
- {
- }
-
- [MonoTODO]
- public XmlSerializer (Type type)
- {
- }
-
- [MonoTODO]
- public XmlSerializer (XmlTypeMapping xmltypemapping)
- {
- }
-
- [MonoTODO]
- public XmlSerializer (Type type, string defaultNamespace)
- {
- }
-
- [MonoTODO]
- public XmlSerializer (Type type, Type[] extraTypes)
- {
- }
-
- [MonoTODO]
- public XmlSerializer (Type type, XmlAttributeOverrides overrides)
- {
- }
-
- [MonoTODO]
- public XmlSerializer (Type type, XmlRootAttribute root)
- {
- }
-
- [MonoTODO]
- public XmlSerializer (Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace)
- {
- }
-
-
-
- [MonoTODO]
- public event XmlAttributeEventHandler UnknownAttribute;
- [MonoTODO]
- public event XmlElementEventHandler UnknownElement;
- [MonoTODO]
- public event XmlNodeEventHandler UnknownNode;
- [MonoTODO]
- public event UnreferencedObjectEventHandler UnreferencedObject;
-
-
- [MonoTODO]
- public virtual bool CanDeserialize (XmlReader xmlReader)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object Deserialize (Stream stream)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public object Deserialize (TextReader textReader)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public object Deserialize (XmlReader xmlReader)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Serialize (Stream stream, object o)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void Serialize (TextWriter textWriter, object o)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void Serialize (XmlWriter xmlWriter, object o)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void Serialize (Stream stream, object o, XmlSerializerNamespaces namespaces)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void Serialize (TextWriter textWriter, object o, XmlSerializerNamespaces namespaces)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void Serialize (XmlWriter xmlWriter, object o, XmlSerializerNamespaces namespaces)
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerNamespaces.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerNamespaces.cs
deleted file mode 100644
index daf80894495..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerNamespaces.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// XmlSerializerNamespaces.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-using System.Xml;
-using System.Collections;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlSerializerNamespaces.
- /// </summary>
- public class XmlSerializerNamespaces
- {
- private ArrayList xmlQualifiedNames;
-
- public XmlSerializerNamespaces ()
- {
- xmlQualifiedNames = new ArrayList ();
- }
-
- public XmlSerializerNamespaces(XmlQualifiedName[] namespaces)
- : this()
- {
- xmlQualifiedNames.AddRange(namespaces);
- }
-
- public XmlSerializerNamespaces(XmlSerializerNamespaces namespaces)
- : this(namespaces.ToArray())
- {
- }
-
- public void Add (string prefix, string ns)
- {
- xmlQualifiedNames.Add (new XmlQualifiedName (prefix, ns) );
- }
-
- public XmlQualifiedName[] ToArray ()
- {
- return (XmlQualifiedName[]) xmlQualifiedNames.ToArray (typeof(XmlSerializerNamespaces) );
- }
-
- public int Count
- {
- get{ return xmlQualifiedNames.Count; }
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlTextAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlTextAttribute.cs
deleted file mode 100644
index 1ab9587eef8..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlTextAttribute.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// XmlTextAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlTextAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
- | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public class XmlTextAttribute : Attribute
- {
- private string dataType;
- private Type type;
-
- public XmlTextAttribute ()
- {
- }
-
- public XmlTextAttribute (Type type)
- {
- Type = type;
- }
-
- public string DataType {
- get {
- return dataType;
- }
- set {
- dataType = value;
- }
- }
- public Type Type
- {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlTypeAttribute.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlTypeAttribute.cs
deleted file mode 100644
index dd8ebacb162..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlTypeAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// XmlTypeAttribute.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlTypeAttribute.
- /// </summary>
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Enum | AttributeTargets.Interface)]
- public class XmlTypeAttribute : Attribute
- {
- private bool includeInSchema;
- private string ns;
- private string typeName;
-
- public XmlTypeAttribute ()
- {
- }
-
- public XmlTypeAttribute (string typeName)
- {
- TypeName = typeName;
- }
-
- public bool IncludeInSchema {
- get {
- return includeInSchema;
- }
- set {
- includeInSchema = value;
- }
- }
-
- public string Namespace {
- get {
- return ns;
- }
- set {
- ns = value;
- }
- }
- public string TypeName {
- get {
- return typeName;
- }
- set {
- typeName = value;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs
deleted file mode 100644
index 66e56f811bd..00000000000
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapping.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// XmlTypeMapping.cs:
-//
-// Author:
-// John Donagher (john@webmeta.com)
-//
-// (C) 2002 John Donagher
-//
-
-using System.Xml;
-using System;
-
-namespace System.Xml.Serialization
-{
- /// <summary>
- /// Summary description for XmlTypeMapping.
- /// </summary>
- public class XmlTypeMapping : XmlMapping
- {
- private string elementName;
- private string ns;
- private string typeFullName;
- private string typeName;
-
- public string ElementName
- {
- get { return elementName; }
- }
- public string Namespace
- {
- get { return ns; }
- }
- public string TypeFullName
- {
- get { return typeFullName; }
- }
- public string TypeName
- {
- get { return typeName; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/ChangeLog b/mcs/class/System.XML/System.Xml.XPath/ChangeLog
deleted file mode 100644
index 89677c28e48..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/ChangeLog
+++ /dev/null
@@ -1,72 +0,0 @@
-2002-06-24 Jason Diamond <jason@injektilo.org>
-
- * XPathScanner.cs: Removed.
-
-2002-06-24 Dick Porter <dick@ximian.com>
-
- * XmlCaseOrder.cs: Fix namespace
-
-2002-06-23 Piers Haken <piersh@friskit.com>
-
- * DefaultContext.cs: implemented XPathFUnctionId
- * Iterator.cs: new ArrayListIterator for id() support
-
-2002-06-23 Piers Haken <piersh@friskit.com>
-
- * XPathNavigator.cs: implement:
- - Compile
- - Evaluate
- - Clone
- - Select
- - ToString
- - some forwarding methods
-
- * XPathNodeIterator: implement caching Count
-
- * Tokenizer.cs: new XPath tokenizer
- * Parser.jay: new XPath grammar
- * Parser.cs: new precompiled XPath grammar
- * Expression.cs: new XPath expression objects
- * Iterator.cs: new XPath result/context objects
- * DefaultContext.cs: new XPath function binding context
-
-2002-05-08 Tim Coleman <tim@timcoleman.com>
- * XPathDocument.cs:
- * XPathException.cs: New stub files added.
-
-2002-04-12 Duncan Mak <duncan@ximian.com>
-
- * XmlCaseOrder.cs: Moved to here from System.Xml.
-
-2002-03-26 Jason Diamond <jason@injektilo.org>
-
- * XPathScanner.cs: Now handles name tests with wildacards. Abbreviated
- steps. Both absolution and relative abbreviated location paths.
-
-2002-03-25 Jason Diamond <jason@injektilo.org>
-
- * XPathScanner.cs: Added new file. This class is supposed to be internal
- but that would make it impossible to test.
-
-2002-03-08 Duncan Mak <duncan@ximian.com>
-
- * XPathNamespaceScope.cs:
- * XPathNodeType.cs:
- * XPathResultType.cs:
- * XmlDataType.cs:
- * XmlSortOrder.cs: Used EnumCheck and realigned elements to be compatible with MS
- implementation. XPathResultType is interesting as EnumCheck does
- not show the Navigator element, but shows the String element twice.
-
-2002-03-08 Jason Diamond <jason@injektilo.org>
-
- * XmlDataType.cs, XmlSortOrder.cs, XPathNodeType.cs: Added files.
-
-2002-03-06 Jason Diamond <jason@injektilo.org>
-
- * ChangeLog: Added to this directory.
-
- * XPathExpression.cs, XPathNamespaceScope.cs, XPathNodeIterator.cs,
- XPathResultType.cs: New files.
-
- * XPathNavigator.cs: Stubbed out all properties and methods.
diff --git a/mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs b/mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs
deleted file mode 100644
index ceb5ab7612a..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs
+++ /dev/null
@@ -1,586 +0,0 @@
-//
-// System.Xml.XPath.DefaultContext & support classes
-//
-// Author:
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2002 Piers Haken
-//
-using System;
-using System.Collections;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-namespace System.Xml.XPath
-{
- /// <summary>
- /// Summary description for DefaultContext.
- /// </summary>
- internal class DefaultContext : XsltContext
- {
- protected static Hashtable _htFunctions = new Hashtable ();
-
- static DefaultContext()
- {
- Add (new XPathFunctionLast ());
- Add (new XPathFunctionPosition ());
- Add (new XPathFunctionCount ());
- Add (new XPathFunctionId ());
- Add (new XPathFunctionLocalName ());
- Add (new XPathFunctionNamespaceUri ());
- Add (new XPathFunctionName ());
- Add (new XPathFunctionString ());
- Add (new XPathFunctionConcat ());
- Add (new XPathFunctionStartsWith ());
- Add (new XPathFunctionContains ());
- Add (new XPathFunctionSubstringBefore ());
- Add (new XPathFunctionSubstringAfter ());
- Add (new XPathFunctionSubstring ());
- Add (new XPathFunctionStringLength ());
- Add (new XPathFunctionNormalizeSpace ());
- Add (new XPathFunctionTranslate ());
- Add (new XPathFunctionBoolean ());
- Add (new XPathFunctionNot ());
- Add (new XPathFunctionTrue ());
- Add (new XPathFunctionFalse ());
- Add (new XPathFunctionLang ());
- Add (new XPathFunctionNumber ());
- Add (new XPathFunctionSum ());
- Add (new XPathFunctionFloor ());
- Add (new XPathFunctionCeil ());
- Add (new XPathFunctionRound ());
- }
-
- [MonoTODO]
- public override IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType[] ArgTypes)
- {
- // match the prefix
- if (prefix != null && prefix != "") // TODO: should we allow some namespaces here?
- return null;
-
- // match the function name
- XPathFunction fn = (XPathFunction) _htFunctions [name];
- if (fn == null)
- return null;
-
- // check the number of arguments
- int cArgs = ArgTypes.Length;
- if (cArgs < fn.Minargs || cArgs > fn.Maxargs)
- return null;
-
- // check the types of the arguments
- XPathResultType [] rgTypes = fn.ArgTypes;
- if (rgTypes == null)
- {
- if (cArgs != 0)
- return null;
- }
- else
- {
- int cTypes = rgTypes.Length;
- for (int iArg = 0; iArg < cArgs; iArg ++)
- {
- XPathResultType typeRequested = ArgTypes [iArg];
- XPathResultType typeDefined = (iArg >= cTypes) ? rgTypes [cTypes - 1] : rgTypes [iArg];
- if (typeDefined != XPathResultType.Any && typeDefined != typeRequested)
- return null;
- }
- }
- return fn;
- }
- public override IXsltContextVariable ResolveVariable (string prefix, string name)
- {
- return null;
- }
- [MonoTODO]
- public override int CompareDocument (string baseUri, string nextBaseUri) { throw new NotImplementedException (); }
- [MonoTODO]
- public override bool PreserveWhitespace (XPathNavigator nav) { throw new NotImplementedException (); }
- [MonoTODO]
- public override bool Whitespace { get { throw new NotImplementedException (); }}
- protected static void Add (XPathFunction fn)
- {
- _htFunctions.Add (fn.Name, fn);
- }
- }
-
- internal class XPathFunctions
- {
- public static bool ToBoolean (object arg)
- {
- if (arg == null)
- throw new ArgumentNullException ();
- if (arg is bool)
- return (bool) arg;
- if (arg is double)
- {
- double dArg = (double) arg;
- return (dArg != 0.0 && !double.IsNaN (dArg));
- }
- if (arg is string)
- return ((string) arg).Length != 0;
- if (arg is BaseIterator)
- {
- BaseIterator iter = (BaseIterator) arg;
- return iter.MoveNext ();
- }
- throw new ArgumentException ();
- }
- [MonoTODO]
- public static string ToString (object arg)
- {
- if (arg == null)
- throw new ArgumentNullException ();
- if (arg is string)
- return (string) arg;
- if (arg is bool)
- return ((bool) arg) ? "true" : "false";
- if (arg is double)
- return (string) XmlConvert.ToString ((double) arg); // TODO: spec? convert number to string
- if (arg is BaseIterator)
- {
- BaseIterator iter = (BaseIterator) arg;
- if (!iter.MoveNext ())
- return "";
- return iter.Current.Value;
- }
- throw new ArgumentException ();
- }
- [MonoTODO]
- public static double ToNumber (object arg)
- {
- if (arg == null)
- throw new ArgumentNullException ();
- if (arg is BaseIterator)
- arg = ToString (arg); // follow on
- if (arg is string)
- return XmlConvert.ToDouble ((string) arg); // TODO: spec? convert string to number
- if (arg is double)
- return (double) arg;
- if (arg is bool)
- return Convert.ToDouble ((bool) arg);
- throw new ArgumentException ();
- }
- }
-
- internal abstract class XPathFunction : IXsltContextFunction
- {
- public abstract XPathResultType ReturnType { get; }
- public abstract int Minargs { get; }
- public abstract int Maxargs { get; }
- public abstract XPathResultType [] ArgTypes { get; }
- public object Invoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return TypesafeInvoke (xsltContext, args, docContext);
- }
-
- public abstract string Name { get; }
- public abstract object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext);
- }
-
- internal class XPathFunctionLast : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 0; }}
- public override XPathResultType [] ArgTypes { get { return null; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- throw new NotImplementedException (); // special-cased
- }
- public override string Name { get { return "last"; }}
- }
- internal class XPathFunctionPosition : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 0; }}
- public override XPathResultType [] ArgTypes { get { return null; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- throw new NotImplementedException (); // special-cased
- }
- public override string Name { get { return "position"; }}
- }
- internal class XPathFunctionCount : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.NodeSet }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return ((BaseIterator) args [0]).Count;
- }
- public override string Name { get { return "count"; }}
- }
- internal class XPathFunctionId : XPathFunction
- {
- private static char [] rgchWhitespace = {' ', '\t', '\r', '\n'};
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Any }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- String strArgs;
- BaseIterator iter = args [0] as BaseIterator;
- if (iter != null)
- {
- strArgs = "";
- while (!iter.MoveNext ())
- strArgs += iter.Current.Value + " ";
- }
- else
- strArgs = XPathFunctions.ToString (args [0]);
- string [] rgstrArgs = strArgs.Split (rgchWhitespace);
- ArrayList rgNodes = new ArrayList ();
- foreach (string strArg in rgstrArgs)
- {
- if (docContext.MoveToId (strArg))
- rgNodes.Add (docContext.Clone ());
- }
- return new ArrayListIterator (iter, rgNodes);
- }
- public override string Name { get { return "id"; }}
- }
- internal class XPathFunctionLocalName : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.NodeSet; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.NodeSet }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- BaseIterator iter = (args.Length == 1) ? ((BaseIterator) args [0]) : new SelfIterator (docContext, xsltContext);
- if (iter == null || !iter.MoveNext ())
- return "";
- return iter.Current.LocalName;
- }
- public override string Name { get { return "local-name"; }}
- }
- internal class XPathFunctionNamespaceUri : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.NodeSet }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- BaseIterator iter = (args.Length == 1) ? ((BaseIterator) args [0]) : new SelfIterator (docContext, xsltContext);
- if (iter == null || !iter.MoveNext ())
- return "";
- return iter.Current.NamespaceURI; // TODO: should the namespace be expanded wrt. the given context?
- }
- public override string Name { get { return "namespace-uri"; }}
- }
- internal class XPathFunctionName : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.NodeSet }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- throw new NotImplementedException ();
- }
- public override string Name { get { return "name"; }}
- }
- internal class XPathFunctionString : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Any }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return XPathFunctions.ToString (args [0]);
- }
- public override string Name { get { return "string"; }}
- }
- internal class XPathFunctionConcat : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 2; }}
- public override int Maxargs { get { return int.MaxValue; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String, XPathResultType.String, XPathResultType.String }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- String str = "";
- foreach (string strArg in args)
- str += strArg;
- return str;
- }
- public override string Name { get { return "concat"; }}
- }
- internal class XPathFunctionStartsWith : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- public override int Minargs { get { return 2; }}
- public override int Maxargs { get { return 2; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String, XPathResultType.String }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- string str1 = (string) args [0];
- string str2 = (string) args [1];
- return str1.StartsWith (str2);
- }
- public override string Name { get { return "starts-with"; }}
- }
- internal class XPathFunctionContains : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- public override int Minargs { get { return 2; }}
- public override int Maxargs { get { return 2; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String, XPathResultType.String }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- string str1 = (string) args [0];
- string str2 = (string) args [1];
- return str1.IndexOf (str2) != -1;
- }
- public override string Name { get { return "contains"; }}
- }
- internal class XPathFunctionSubstringBefore : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 2; }}
- public override int Maxargs { get { return 2; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String, XPathResultType.String }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- string str1 = (string) args [0];
- string str2 = (string) args [1];
- int ich = str1.IndexOf (str2);
- if (ich <= 0)
- return "";
- return str1.Substring (0, ich);
- }
- public override string Name { get { return "substring-before"; }}
- }
- internal class XPathFunctionSubstringAfter : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 2; }}
- public override int Maxargs { get { return 2; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String, XPathResultType.String }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- string str1 = (string) args [0];
- string str2 = (string) args [1];
- int ich = str1.IndexOf (str2);
- if (ich <= 0)
- return "";
- return str1.Substring (ich + str2.Length);
- }
- public override string Name { get { return "substring-after"; }}
- }
- internal class XPathFunctionSubstring : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 2; }}
- public override int Maxargs { get { return int.MaxValue; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String, XPathResultType.String, XPathResultType.String }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- // TODO: check this, what the hell were they smoking?
- string str = (string) args [0];
- double ich = Math.Round ((double) args [1]) - 1;
- if (Double.IsNaN (ich) || ich >= (double) str.Length)
- return "";
-
- if (args.Length == 2)
- {
- if (ich < 0)
- ich = 0.0;
- return str.Substring ((int) ich);
- }
- else
- {
- double cch = Math.Round ((double) args [2]);
- if (Double.IsNaN (cch))
- return "";
- if (ich < 0.0 || cch < 0.0)
- {
- cch = ich + cch;
- if (cch <= 0.0)
- return "";
- ich = 0.0;
- }
- double cchMax = (double) str.Length - ich;
- if (cch > cchMax)
- cch = cchMax;
- return str.Substring ((int) ich, (int) cch);
- }
- }
- public override string Name { get { return "substring"; }}
- }
- internal class XPathFunctionStringLength : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return (double) ((string) args [0]).Length;
- }
- public override string Name { get { return "string-length"; }}
- }
- internal class XPathFunctionNormalizeSpace : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- throw new NotImplementedException ();
- }
- public override string Name { get { return "normalize-sace"; }}
- }
- internal class XPathFunctionTranslate : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override int Minargs { get { return 3; }}
- public override int Maxargs { get { return 3; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String, XPathResultType.String, XPathResultType.String }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- throw new NotImplementedException ();
- }
- public override string Name { get { return "translate"; }}
- }
- internal class XPathFunctionBoolean : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Any }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return XPathFunctions.ToBoolean (args [0]);
- }
- public override string Name { get { return "boolean"; }}
- }
- internal class XPathFunctionNot : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Boolean }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return !((bool) args [0]);
- }
- public override string Name { get { return "not"; }}
- }
- internal class XPathFunctionTrue : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 0; }}
- public override XPathResultType [] ArgTypes { get { return null; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return true;
- }
- public override string Name { get { return "true"; }}
- }
- internal class XPathFunctionFalse : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 0; }}
- public override XPathResultType [] ArgTypes { get { return null; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return false;
- }
- public override string Name { get { return "false"; }}
- }
- internal class XPathFunctionLang : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.String }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- throw new NotImplementedException ();
- }
- public override string Name { get { return "lang"; }}
- }
- internal class XPathFunctionNumber : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 0; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Any }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return XPathFunctions.ToNumber (args [0]);
- }
- public override string Name { get { return "number"; }}
- }
- internal class XPathFunctionSum : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.NodeSet }; }}
- [MonoTODO]
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- throw new NotImplementedException ();
- }
- public override string Name { get { return "sum"; }}
- }
- internal class XPathFunctionFloor : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Number }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return Math.Floor ((double) args [0]);
- }
- public override string Name { get { return "floor"; }}
- }
- internal class XPathFunctionCeil : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Number }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- return Math.Ceiling ((double) args [0]);
- }
- public override string Name { get { return "ceil"; }}
- }
- internal class XPathFunctionRound : XPathFunction
- {
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override int Minargs { get { return 1; }}
- public override int Maxargs { get { return 1; }}
- public override XPathResultType [] ArgTypes { get { return new XPathResultType [] { XPathResultType.Number }; }}
- public override object TypesafeInvoke (XsltContext xsltContext, object[] args, XPathNavigator docContext)
- {
- double arg = (double) args [0];
- if (arg < -0.5 || arg > 0)
- return Math.Floor (arg + 0.5);
- return Math.Round (arg);
- }
- public override string Name { get { return "round"; }}
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/Expression.cs b/mcs/class/System.XML/System.Xml.XPath/Expression.cs
deleted file mode 100644
index e4e960243a6..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/Expression.cs
+++ /dev/null
@@ -1,1031 +0,0 @@
-//
-// System.Xml.XPath.XPathExpression support classes
-//
-// Author:
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2002 Piers Haken
-//
-using System;
-using System.IO;
-using System.Collections;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-namespace System.Xml.XPath
-{
-/*
- public class MonoTODOAttribute : Attribute
- {
- }
- public abstract class XPathExpression
- {
- internal XPathExpression () {}
-
- public abstract void AddSort (Object obj, IComparer cmp);
- public abstract void AddSort(object obj, XmlSortOrder sortOrder, XmlCaseOrder caseOrder, string str, XmlDataType type);
- public abstract XPathExpression Clone ();
- public abstract void SetContext (XmlNamespaceManager nsManager);
- public abstract String Expression { get; }
- public abstract XPathResultType ReturnType { get; }
- }
-*/
-
- internal class CompiledExpression : XPathExpression
- {
- protected XmlNamespaceManager _nsm;
- protected Expression _expr;
-
-/*
- public static void Main (String [] rgstrArgs)
- {
- Tokenizer tokenizer = new Tokenizer ("/root/*[position() = last()]/@goo");
- XPathParser parser = new XPathParser ();
-// Expression e = (Expression) parser.yyparse (tokenizer, new yydebug.yyDebugSimple ());
- Expression e = (Expression) parser.yyparse (tokenizer);
- Console.WriteLine (e.ToString ());
- CompiledExpression expr = new CompiledExpression (e);
- XmlDocument doc = new XmlDocument ();
- doc.Load ("..\\doc.xml");
- XPathNavigator nav = doc.CreateNavigator ();
- BaseIterator iter = new SelfIterator (nav, new DefaultContext ());
-
- BaseIterator iterResult = expr._expr.EvaluateNodeSet (iter);
- while (iterResult.MoveNext ())
- {
- System.Diagnostics.Debug.WriteLine ("------");
- System.Diagnostics.Debug.WriteLine (iterResult.Current.Name);
- System.Diagnostics.Debug.WriteLine (iterResult.Current.Value);
- }
- }
-*/
- public CompiledExpression (Expression expr)
- {
- _expr = expr;
- }
- private CompiledExpression (CompiledExpression other)
- {
- _nsm = other._nsm;
- _expr = other._expr;
- }
- public override XPathExpression Clone () { return new CompiledExpression (this); }
-
- public override void SetContext (XmlNamespaceManager nsManager)
- {
- _nsm = nsManager;
- }
- public override String Expression { get { return _expr.ToString (); }}
- public override XPathResultType ReturnType { get { return _expr.ReturnType; }}
- [MonoTODO]
- public override void AddSort (Object obj, IComparer cmp)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override void AddSort(object obj, XmlSortOrder sortOrder, XmlCaseOrder caseOrder, string str, XmlDataType type)
- {
- throw new NotImplementedException ();
- }
-
- public object Evaluate (BaseIterator iter)
- {
- return _expr.Evaluate (iter);
- }
- public XPathNodeIterator EvaluateNodeSet (BaseIterator iter)
- {
- return _expr.EvaluateNodeSet (iter);
- }
- }
-
-
- /// <summary>
- /// Summary description for Expression.
- /// </summary>
- internal abstract class Expression
- {
- public Expression ()
- {
- }
- public abstract XPathResultType ReturnType { get; }
- public virtual XPathResultType GetReturnType (BaseIterator iter) { return ReturnType; }
- public virtual object Evaluate (BaseIterator iter) { return null; }
-
- public BaseIterator EvaluateNodeSet (BaseIterator iter)
- {
- if (GetReturnType (iter) == XPathResultType.NodeSet)
- return (BaseIterator) Evaluate (iter);
- throw new Exception ("expected nodeset: "+ToString ());
- }
- [MonoTODO]
- public double EvaluateNumber (BaseIterator iter)
- {
- object result;
- XPathResultType type = GetReturnType (iter);
- if (type == XPathResultType.NodeSet)
- {
- result = EvaluateString (iter);
- type = XPathResultType.String;
- }
- else
- result = Evaluate (iter);
-
- switch (type)
- {
- case XPathResultType.Number:
- return (double) result;
- case XPathResultType.Boolean:
- return Convert.ToDouble ((bool) result);
- case XPathResultType.String:
- return XmlConvert.ToDouble ((string) result); // TODO: spec? convert string to number
- default:
- throw new Exception (); // TODO: handle other types
- }
- }
- [MonoTODO]
- public string EvaluateString (BaseIterator iter)
- {
- object result = Evaluate (iter);
- switch (GetReturnType (iter))
- {
- case XPathResultType.Number:
- return (string) XmlConvert.ToString ((double) result); // TODO: spec? convert number to string
- case XPathResultType.Boolean:
- return ((bool) result) ? "true" : "false";
- case XPathResultType.String:
- return (string) result;
- case XPathResultType.NodeSet:
- {
- BaseIterator iterResult = (BaseIterator) result;
- if (iterResult == null || !iterResult.MoveNext ())
- return "";
- return iterResult.Current.Value;
- }
- default:
- throw new Exception (); // TODO: handle other types
- }
- }
- [MonoTODO]
- public bool EvaluateBoolean (BaseIterator iter)
- {
- object result = Evaluate (iter);
- switch (GetReturnType (iter))
- {
- case XPathResultType.Number:
- {
- double num = (double) result;
- return (num != 0.0 && num != -0.0 && num != Double.NaN);
- }
- case XPathResultType.Boolean:
- return (bool) result;
- case XPathResultType.String:
- return ((string) result).Length != 0;
- case XPathResultType.NodeSet:
- {
- BaseIterator iterResult = (BaseIterator) result;
- return (iterResult != null && iterResult.MoveNext ());
- }
- default:
- throw new Exception (); // TODO: handle other types
- }
- }
- }
-
- internal abstract class ExprBinary : Expression
- {
- protected Expression _left, _right;
-
- public ExprBinary (Expression left, Expression right)
- {
- _left = left;
- _right = right;
- }
- public override String ToString ()
- {
- return _left.ToString () + ' ' + Operator + ' ' + _right.ToString ();
- }
- protected abstract String Operator { get; }
- }
-
- internal abstract class ExprBoolean : ExprBinary
- {
- public ExprBoolean (Expression left, Expression right) : base (left, right) {}
- public override XPathResultType ReturnType { get { return XPathResultType.Boolean; }}
- }
-
- internal class ExprOR : ExprBoolean
- {
- public ExprOR (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "or"; }}
- public override object Evaluate (BaseIterator iter)
- {
- if (_left.EvaluateBoolean (iter))
- return true;
- return _right.EvaluateBoolean (iter);
- }
- }
- internal class ExprAND : ExprBoolean
- {
- public ExprAND (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "and"; }}
- public override object Evaluate (BaseIterator iter)
- {
- if (!_left.EvaluateBoolean (iter))
- return false;
- return _right.EvaluateBoolean (iter);
- }
- }
-
- internal abstract class EqualityExpr : ExprBoolean
- {
- public EqualityExpr (Expression left, Expression right) : base (left, right) {}
- [MonoTODO]
- public override object Evaluate (BaseIterator iter)
- {
- XPathResultType typeL = _left.GetReturnType (iter);
- XPathResultType typeR = _right.GetReturnType (iter);
- if (typeL == XPathResultType.NodeSet || typeR == XPathResultType.NodeSet)
- {
- Expression left, right;
- if (typeL != XPathResultType.NodeSet)
- {
- left = _right;
- right = _left;
- XPathResultType typeTmp = typeL;
- typeL = typeR;
- typeR = typeTmp;
- }
- else
- {
- left = _left;
- right = _right;
- }
- if (typeR == XPathResultType.Boolean)
- {
- bool fL = left.EvaluateBoolean (iter);
- bool fR = right.EvaluateBoolean (iter);
- return Compare (Convert.ToDouble (fL), Convert.ToDouble (fR));
- }
- else
- {
- BaseIterator iterL = left.EvaluateNodeSet (iter);
- if (typeR == XPathResultType.Number)
- {
- double dR = right.EvaluateNumber (iter);
- while (iterL.MoveNext ())
- if (Compare (XPathFunctions.ToNumber (iterL.Current.Value), dR))
- return true;
- }
- else if (typeR == XPathResultType.String)
- {
- string strR = right.EvaluateString (iter);
- while (iterL.MoveNext ())
- if (Compare (iterL.Current.Value, strR))
- return true;
- }
- else if (typeR == XPathResultType.NodeSet)
- {
- throw new NotImplementedException (); // TODO:
- }
- return false;
- }
- }
- else if (typeL == XPathResultType.Boolean || typeR == XPathResultType.Boolean)
- {
- return Compare (_left.EvaluateBoolean (iter), _right.EvaluateBoolean (iter));
- }
- else if (typeL == XPathResultType.Number || typeR == XPathResultType.Number)
- {
- return Compare (_left.EvaluateNumber (iter), _right.EvaluateNumber (iter));
- }
- else
- {
- return Compare (_left.EvaluateString (iter), _right.EvaluateString (iter));
- }
- }
- [MonoTODO]
- public abstract bool Compare (object arg1, object arg2); // TODO: should probably have type-safe methods here
- }
-
- internal class ExprEQ : EqualityExpr
- {
- public ExprEQ (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "="; }}
- public override bool Compare (object arg1, object arg2)
- {
- return arg1.Equals (arg2);
- }
- }
- internal class ExprNE : EqualityExpr
- {
- public ExprNE (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "!="; }}
- public override bool Compare (object arg1, object arg2)
- {
- return !arg1.Equals (arg2);
- }
- }
-
- internal abstract class RelationalExpr : ExprBoolean
- {
- public RelationalExpr (Expression left, Expression right) : base (left, right) {}
- [MonoTODO]
- public override object Evaluate (BaseIterator iter)
- {
- XPathResultType typeL = _left.GetReturnType (iter);
- XPathResultType typeR = _right.GetReturnType (iter);
- if (typeL == XPathResultType.NodeSet || typeR == XPathResultType.NodeSet)
- {
- bool fReverse = false;
- Expression left, right;
- if (typeL != XPathResultType.NodeSet)
- {
- fReverse = true;
- left = _right;
- right = _left;
- XPathResultType typeTmp = typeL;
- typeL = typeR;
- typeR = typeTmp;
- }
- else
- {
- left = _left;
- right = _right;
- }
- if (typeR == XPathResultType.Boolean)
- {
- bool fL = left.EvaluateBoolean (iter);
- bool fR = right.EvaluateBoolean (iter);
- return Compare (Convert.ToDouble (fL), Convert.ToDouble (fR), fReverse);
- }
- else
- {
- BaseIterator iterL = left.EvaluateNodeSet (iter);
- if (typeR == XPathResultType.Number || typeR == XPathResultType.String)
- {
- double dR = right.EvaluateNumber (iter);
- while (iterL.MoveNext ())
- if (Compare (XPathFunctions.ToNumber (iterL.Current.Value), dR, fReverse))
- return true;
- }
- else if (typeR == XPathResultType.NodeSet)
- {
- throw new NotImplementedException (); // TODO:
- }
- return false;
- }
- }
- else
- return Compare (_left.EvaluateNumber (iter), _right.EvaluateNumber (iter));
- }
- public abstract bool Compare (double arg1, double arg2);
- public bool Compare (double arg1, double arg2, bool fReverse)
- {
- if (fReverse)
- return Compare (arg2, arg1);
- else
- return Compare (arg1, arg2);
- }
- }
- internal class ExprGT : RelationalExpr
- {
- public ExprGT (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return ">"; }}
- public override bool Compare (double arg1, double arg2)
- {
- return arg1 > arg2;
- }
- }
- internal class ExprGE : RelationalExpr
- {
- public ExprGE (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return ">="; }}
- public override bool Compare (double arg1, double arg2)
- {
- return arg1 >= arg2;
- }
- }
- internal class ExprLT : RelationalExpr
- {
- public ExprLT (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "<"; }}
- public override bool Compare (double arg1, double arg2)
- {
- return arg1 < arg2;
- }
- }
- internal class ExprLE : RelationalExpr
- {
- public ExprLE (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "<="; }}
- public override bool Compare (double arg1, double arg2)
- {
- return arg1 <= arg2;
- }
- }
-
-
- internal abstract class ExprNumeric : ExprBinary
- {
- public ExprNumeric (Expression left, Expression right) : base (left, right) {}
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- }
-
- internal class ExprPLUS : ExprNumeric
- {
- public ExprPLUS (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "+"; }}
- public override object Evaluate (BaseIterator iter)
- {
- return _left.EvaluateNumber (iter) + _right.EvaluateNumber (iter);
- }
- }
- internal class ExprMINUS : ExprNumeric
- {
- public ExprMINUS (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "-"; }}
- public override object Evaluate (BaseIterator iter)
- {
- return _left.EvaluateNumber (iter) - _right.EvaluateNumber (iter);
- }
- }
- internal class ExprMULT : ExprNumeric
- {
- public ExprMULT (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "*"; }}
- public override object Evaluate (BaseIterator iter)
- {
- return _left.EvaluateNumber (iter) * _right.EvaluateNumber (iter);
- }
- }
- internal class ExprDIV : ExprNumeric
- {
- public ExprDIV (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "/"; }}
- public override object Evaluate (BaseIterator iter)
- {
- return _left.EvaluateNumber (iter) / _right.EvaluateNumber (iter);
- }
- }
- internal class ExprMOD : ExprNumeric
- {
- public ExprMOD (Expression left, Expression right) : base (left, right) {}
- protected override String Operator { get { return "%"; }}
- [MonoTODO]
- public override object Evaluate (BaseIterator iter)
- {
- return _left.EvaluateNumber (iter) % _right.EvaluateNumber (iter); // TODO: spec?
- }
- }
- internal class ExprNEG : Expression
- {
- Expression _expr;
- public ExprNEG (Expression expr)
- {
- _expr = expr;
- }
- public override String ToString () { return "- " + _expr.ToString (); }
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override object Evaluate (BaseIterator iter)
- {
- return - _expr.EvaluateNumber (iter);
- }
- }
-
-
- internal abstract class NodeSet : Expression
- {
- public override XPathResultType ReturnType { get { return XPathResultType.NodeSet; }}
- }
- internal class ExprUNION : NodeSet
- {
- protected Expression _left, _right;
- public ExprUNION (NodeSet left, NodeSet right)
- {
- _left = left;
- _right = right;
- }
- public override String ToString () { return _left.ToString ()+ " | " + _right.ToString (); }
- public override object Evaluate (BaseIterator iter)
- {
- UnionIterator iterUnion = new UnionIterator (iter);
- iterUnion.Add (_left.EvaluateNodeSet (iter));
- iterUnion.Add (_right.EvaluateNodeSet (iter));
- return iterUnion;
- }
- }
- internal class ExprSLASH : NodeSet
- {
- protected Expression _left, _right;
- public ExprSLASH (NodeSet left, NodeSet right)
- {
- _left = left;
- _right = right;
- }
- public override String ToString () { return _left.ToString ()+ "/" + _right.ToString (); }
- public override object Evaluate (BaseIterator iter)
- {
- BaseIterator iterLeft = _left.EvaluateNodeSet (iter);
- return new SlashIterator (iterLeft, _right);
- }
- }
- internal class ExprRoot : NodeSet
- {
- public override String ToString () { return ""; }
- public override object Evaluate (BaseIterator iter)
- {
- XPathNavigator navRoot = iter.Current.Clone ();
- navRoot.MoveToRoot ();
- return new SelfIterator (navRoot, iter.Context);
- }
- }
-
- internal enum Axes
- {
- Ancestor,
- AncestorOrSelf,
- Attribute,
- Child,
- Descendant,
- DescendantOrSelf,
- Following,
- FollowingSibling,
- Namespace,
- Parent,
- Preceding,
- PrecedingSibling,
- Self,
- }
-
- internal class AxisSpecifier
- {
- protected Axes _axis;
- public AxisSpecifier (Axes axis)
- {
- _axis = axis;
- }
- public XPathNodeType NodeType
- {
- get
- {
- switch (_axis)
- {
- case Axes.Namespace:
- return XPathNodeType.Namespace;
- case Axes.Attribute:
- return XPathNodeType.Attribute;
- default:
- return XPathNodeType.Element;
- }
- }
- }
- public override string ToString ()
- {
- switch (_axis)
- {
- case Axes.Ancestor:
- return "ancestor";
- case Axes.AncestorOrSelf:
- return "ancestor-or-self";
- case Axes.Attribute:
- return "attribute";
- case Axes.Child:
- return "child";
- case Axes.Descendant:
- return "descendant";
- case Axes.DescendantOrSelf:
- return "descendant-or-self";
- case Axes.Following:
- return "following";
- case Axes.FollowingSibling:
- return "following-sibling";
- case Axes.Namespace:
- return "namespace";
- case Axes.Parent:
- return "parent";
- case Axes.Preceding:
- return "preceeding";
- case Axes.PrecedingSibling:
- return "preceeding-sibling";
- case Axes.Self:
- return "self";
- default:
- throw new IndexOutOfRangeException ();
- }
- }
- public Axes Axis { get { return _axis; }}
- public virtual BaseIterator Evaluate (BaseIterator iter)
- {
- switch (_axis)
- {
- case Axes.Ancestor:
- return new AncestorIterator (iter);
- case Axes.AncestorOrSelf:
- return new AncestorOrSelfIterator (iter);
- case Axes.Attribute:
- return new AttributeIterator (iter);
- case Axes.Child:
- return new ChildIterator (iter);
- case Axes.Descendant:
- return new DescendantIterator (iter);
- case Axes.DescendantOrSelf:
- return new DescendantOrSelfIterator (iter);
- case Axes.Following:
- return new FollowingIterator (iter);
- case Axes.FollowingSibling:
- return new FollowingSiblingIterator (iter);
- case Axes.Namespace:
- return new NamespaceIterator (iter);
- case Axes.Parent:
- return new ParentIterator (iter);
- case Axes.Preceding:
- return new PrecedingIterator (iter);
- case Axes.PrecedingSibling:
- return new PrecedingSiblingIterator (iter);
- case Axes.Self:
- return new SelfIterator (iter);
- default:
- throw new IndexOutOfRangeException ();
- }
- }
- }
-
- internal abstract class NodeTest
- {
- protected AxisSpecifier _axis;
- public NodeTest (AxisSpecifier axis)
- {
- _axis = axis;
- }
- public NodeTest (Axes axis)
- {
- _axis = new AxisSpecifier (axis);
- }
- public abstract bool Match (XsltContext context, XPathNavigator nav);
- public AxisSpecifier Axis { get { return _axis; }}
- public virtual BaseIterator Evaluate (BaseIterator iter)
- {
- BaseIterator iterAxis = _axis.Evaluate (iter);
- return new AxisIterator (iterAxis, this);
- }
- }
-
- internal enum NodeTestTypes
- {
- Comment,
- Text,
- ProcessingInstruction,
- Node,
- Principal,
- }
-
- internal class NodeTypeTest : NodeTest
- {
- protected NodeTestTypes _type;
- protected String _param;
- public NodeTypeTest (Axes axis, NodeTestTypes type) : base (axis)
- {
- _type = type;
- }
- [MonoTODO]
- public NodeTypeTest (Axes axis, NodeTestTypes type, String param) : base (axis)
- {
- _type = type;
- _param = param;
- if (param != null && type != NodeTestTypes.ProcessingInstruction)
- throw new Exception ("No argument allowed for "+ToString (_type)+"() test"); // TODO: better description
- }
- public override String ToString ()
- {
- String strType = ToString (_type);
- if (_type == NodeTestTypes.ProcessingInstruction && _param != null)
- strType += "('" + _param + "')";
- else if (_type != NodeTestTypes.Principal)
- strType += "()";
-
- return _axis.ToString () + "::" + strType;
- }
- private static String ToString (NodeTestTypes type)
- {
- switch (type)
- {
- case NodeTestTypes.Comment:
- return "comment";
- case NodeTestTypes.Text:
- return "text";
- case NodeTestTypes.ProcessingInstruction:
- return "processing-instruction";
- case NodeTestTypes.Node:
- return "node";
- case NodeTestTypes.Principal:
- return "*";
- default:
- throw new NotImplementedException ();
- }
- }
- public override bool Match (XsltContext context, XPathNavigator nav)
- {
- XPathNodeType nodeType = nav.NodeType;
- switch (_type)
- {
- case NodeTestTypes.Comment:
- return nodeType == XPathNodeType.Comment;
- case NodeTestTypes.Text:
- return nodeType == XPathNodeType.Text;
- case NodeTestTypes.ProcessingInstruction:
- if (nodeType != XPathNodeType.ProcessingInstruction)
- return false;
- if (_param != null && nav.Name != _param)
- return false;
- return true;
- case NodeTestTypes.Node:
- return true;
- case NodeTestTypes.Principal:
- return nodeType == _axis.NodeType;
- default:
- throw new NotImplementedException ();
- }
- }
- }
- internal class NodeNameTest : NodeTest
- {
- protected QName _name;
- public NodeNameTest (Axes axis, QName name) : base (axis)
- {
- _name = name;
- }
- public override String ToString () { return _axis.ToString () + "::" + _name.ToString (); }
- [MonoTODO]
- public override bool Match (XsltContext context, XPathNavigator nav)
- {
- // must be the correct node type
- if (nav.NodeType != _axis.NodeType)
- return false;
-
- // test the local part of the name first
- if (_name.Local != nav.LocalName)
- return false;
-
- // get the prefix for the given name
- String strURI1 = "";
- if (_name.Prefix != null)
- {
- strURI1 = context.LookupNamespace (_name.Prefix); // TODO: check to see if this returns null or ""
- if (strURI1 == null)
- throw new Exception ("Invalid namespace prefix: "+_name.Prefix);
- }
-
- string strURI = nav.NamespaceURI;
- if (strURI == null && strURI1 == "") // TODO: remove when bug #26855 fixed
- return true;
-
- // test the prefixes
- return strURI1 == nav.NamespaceURI;
- }
- }
-
- internal class NodeNameTestAny : NodeNameTest
- {
- public NodeNameTestAny (Axes axis, NCName name) : base (axis, name) {}
- [MonoTODO] // TODO: this is a hack, the local part of the NCName is actually used as a prefix.
- public override bool Match (XsltContext context, XPathNavigator nav)
- {
- // must be the correct node type
- if (nav.NodeType != _axis.NodeType)
- return false;
-
- // get the prefix for the given name
- String strURI1 = context.LookupNamespace (_name.Local); // TODO: check to see if this returns null or ""
- if (strURI1 == null)
- throw new Exception ("Invalid namespace prefix: "+_name.Local);
-
- // just test the prefixes
- return strURI1 == nav.NamespaceURI;
- }
- }
-
-
- internal class ExprStep : NodeSet
- {
- protected NodeTest _test;
- protected Expression [] _preds;
- public ExprStep (NodeTest test, ExprPredicates preds)
- {
- _test = test;
- if (preds != null)
- _preds = preds.GetPredicates ();
- }
- public ExprStep (NodeTest test)
- {
- _test = test;
- }
- public override String ToString ()
- {
- String strExpr = _test.ToString ();
- if (_preds != null)
- {
- foreach (Expression pred in _preds)
- {
- strExpr += '[' + pred.ToString () + ']';
- }
- }
- return strExpr;
- }
- public override object Evaluate (BaseIterator iter)
- {
- BaseIterator iterStep = _test.Evaluate (iter);
- if (_preds == null)
- return iterStep;
-
- return new PredicateIterator (iterStep, _preds);
- }
- }
-
-
- internal class ExprPredicates
- {
- protected Expression _pred;
- protected ExprPredicates _tail;
- public ExprPredicates (Expression pred, ExprPredicates tail)
- {
- _pred = pred;
- _tail = tail;
- }
- public ExprPredicates (Expression pred)
- {
- _pred = pred;
- }
- public Expression [] GetPredicates ()
- {
- ArrayList lstPreds = new ArrayList ();
- ExprPredicates curr = this;
- while (curr != null)
- {
- lstPreds.Add (curr._pred);
- curr = curr._tail;
- }
- return (Expression []) lstPreds.ToArray (typeof (Expression));
- }
- }
-
- internal class ExprFilter : Expression
- {
- protected Expression _expr;
- protected Expression _pred;
- public ExprFilter (Expression expr, Expression pred)
- {
- _expr = expr;
- _pred = pred;
- }
- public override String ToString () { return "(" + _expr.ToString () + ")[" + _pred.ToString () + "]"; }
- public override XPathResultType ReturnType { get { return XPathResultType.NodeSet; }}
- }
-
- internal class QName
- {
- protected String _prefix;
- protected String _local;
- public QName (String prefix, String local)
- {
- _prefix = prefix;
- _local = local;
- }
- public override String ToString ()
- {
- if (_prefix != null)
- return _prefix + ':' + _local;
- return _local;
- }
- public String Prefix { get { return _prefix; } }
- public String Local { get { return _local; } }
- }
- internal class NCName : QName
- {
- public NCName (String local) : base (null, local) {}
- }
-
- internal class ExprNumber : Expression
- {
- protected double _value;
- public ExprNumber (double value)
- {
- _value = value;
- }
- public override String ToString () { return _value.ToString (); }
- public override XPathResultType ReturnType { get { return XPathResultType.Number; }}
- public override object Evaluate (BaseIterator iter)
- {
- return _value;
- }
- }
- internal class ExprLiteral : Expression
- {
- protected String _value;
- public ExprLiteral (String value)
- {
- _value = value;
- }
- public override String ToString () { return "'" + _value + "'"; }
- public override XPathResultType ReturnType { get { return XPathResultType.String; }}
- public override object Evaluate (BaseIterator iter)
- {
- return _value;
- }
- }
-
- internal class ExprVariable : Expression
- {
- protected QName _name;
- public ExprVariable (QName name)
- {
- _name = name;
- }
- public override String ToString () { return "$" + _name.ToString (); }
- public override XPathResultType ReturnType { get { return XPathResultType.Any; }}
- public override XPathResultType GetReturnType (BaseIterator iter)
- {
- IXsltContextVariable var = iter.Context.ResolveVariable (_name.Prefix, _name.Local);
- return var.VariableType;
- }
- }
-
- internal class FunctionArguments
- {
- protected Expression _arg;
- protected FunctionArguments _tail;
- public FunctionArguments (Expression arg, FunctionArguments tail)
- {
- _arg = arg;
- _tail = tail;
- }
- public Expression Arg
- {
- get { return _arg; }
- }
- public FunctionArguments Tail
- {
- get { return _tail; }
- }
- }
- internal class ExprFunctionCall : Expression
- {
- protected QName _name;
- protected ArrayList _args = new ArrayList ();
- public ExprFunctionCall (String name, FunctionArguments args)
- {
- _name = new NCName (name);
- while (args != null)
- {
- _args.Add (args.Arg);
- args = args.Tail;
- }
- }
- public override String ToString ()
- {
- String strArgs = "";
- foreach (Expression arg in _args)
- {
- if (strArgs != "")
- strArgs += ", ";
- strArgs += arg.ToString ();
- }
- return _name.ToString () + '(' + strArgs + ')';
- }
- public override XPathResultType ReturnType { get { return XPathResultType.Any; }}
- public override XPathResultType GetReturnType (BaseIterator iter)
- {
- IXsltContextFunction func = iter.Context.ResolveFunction (_name.Prefix, _name.Local, GetArgTypes (iter));
- return func.ReturnType;
- }
- private XPathResultType [] GetArgTypes (BaseIterator iter)
- {
- // TODO: can we cache these? what if the types depend on the context?
- XPathResultType [] rgArgs = new XPathResultType [_args.Count];
- for (int iArg = 0; iArg < _args.Count; iArg++)
- rgArgs [iArg] = ((Expression) _args [iArg]).GetReturnType (iter);
- return rgArgs;
- }
- public override object Evaluate (BaseIterator iter)
- {
- //special-case the 'last' and 'position' functions
- if (_args.Count == 0 && _name.Prefix == null)
- {
- if (_name.Local == "last")
- {
- return (double) iter.Count;
- }
- else if (_name.Local == "position")
- {
- return (double) iter.CurrentPosition;
- }
- }
-
- XPathResultType [] rgTypes = GetArgTypes (iter);
- IXsltContextFunction func = iter.Context.ResolveFunction (_name.Prefix, _name.Local, rgTypes);
- object [] rgArgs = new object [_args.Count];
- for (int iArg = 0; iArg < _args.Count; iArg ++)
- rgArgs [iArg] = ((Expression) _args [iArg]).Evaluate (iter);
- return func.Invoke (iter.Context, rgArgs, iter.Current);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs b/mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs
deleted file mode 100644
index 13c9018e761..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/IXPathNavigable.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Xml.XPath.IXPathNavigable
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml.XPath
-{
- public interface IXPathNavigable
- {
- XPathNavigator CreateNavigator ();
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/Iterator.cs b/mcs/class/System.XML/System.Xml.XPath/Iterator.cs
deleted file mode 100644
index d0cf8daecdb..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/Iterator.cs
+++ /dev/null
@@ -1,568 +0,0 @@
-//
-// System.Xml.XPath.BaseIterator
-//
-// Author:
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2002 Piers Haken
-//
-
-using System;
-using System.Collections;
-using System.Xml;
-using System.Xml.XPath;
-using System.Xml.Xsl;
-
-namespace System.Xml.XPath
-{
-/*
- internal abstract class XPathNodeIterator : ICloneable
- {
- private int _count;
-
- #region Constructor
-
- protected XPathNodeIterator () {}
-
- #endregion
-
- #region Properties
-
- public virtual int Count
- {
- get
- {
- if (_count == 0)
- {
- // compute and cache the count
- XPathNodeIterator tmp = Clone ();
- while (tmp.MoveNext ())
- ;
- _count = tmp.CurrentPosition;
- }
- return _count;
- }
- }
-
- public abstract XPathNavigator Current { get; }
-
- public abstract int CurrentPosition { get; }
-
- #endregion
-
- #region Methods
-
- public abstract XPathNodeIterator Clone ();
-
- object ICloneable.Clone ()
- {
- return Clone ();
- }
-
- public abstract bool MoveNext ();
-
- #endregion
- }
-*/
-
- internal abstract class BaseIterator : XPathNodeIterator
- {
- private XsltContext _context;
-
- internal BaseIterator (BaseIterator other)
- {
- _context = other._context;
- }
- internal BaseIterator (XsltContext context)
- {
- _context = context;
- }
-
- public XsltContext Context { get { return _context; } }
-
- public override string ToString ()
- {
- return Current.NodeType.ToString () + "[" + CurrentPosition + "] : " + Current.Name + " = " + Current.Value;
- }
- }
-
- internal class UnionIterator : BaseIterator
- {
- protected ArrayList _iters = new ArrayList ();
- protected int _pos;
- protected int _index;
-
- public UnionIterator (BaseIterator iter ) : base (iter) {}
- protected UnionIterator (UnionIterator other) : base (other)
- {
- foreach (object obj in other._iters)
- _iters.Add (obj);
- _pos = other._pos;
- _index = other._index;
- }
- public override XPathNodeIterator Clone () { return new UnionIterator (this); }
-
- public void Add (BaseIterator iter)
- {
- _iters.Add (iter);
- }
-
- public override bool MoveNext ()
- {
- while (_index < _iters.Count)
- {
- BaseIterator iter = (BaseIterator) _iters [_index];
- if (iter.MoveNext ())
- {
- _pos ++;
- return true;
- }
- _index ++;
- }
- return false;
- }
- public override XPathNavigator Current
- {
- get
- {
- if (_index >= _iters.Count)
- return null;
- BaseIterator iter = (BaseIterator) _iters [_index];
- return iter.Current;
- }
- }
- public override int CurrentPosition { get { return _pos; }}
- }
-
- internal abstract class SimpleIterator : BaseIterator
- {
- protected XPathNavigator _nav;
- protected int _pos;
-
- public SimpleIterator (BaseIterator iter) : base (iter)
- {
- _nav = iter.Current.Clone ();
- }
- protected SimpleIterator (SimpleIterator other) : base (other)
- {
- _nav = other._nav.Clone ();
- _pos = other._pos;
- }
- public SimpleIterator (XPathNavigator nav, XsltContext context) : base (context)
- {
- _nav = nav.Clone ();
- }
-
- public override XPathNavigator Current { get { return _nav; }}
- public override int CurrentPosition { get { return _pos; }}
- }
-
- internal class SelfIterator : SimpleIterator
- {
- public SelfIterator (BaseIterator iter) : base (iter) {}
- public SelfIterator (XPathNavigator nav, XsltContext context) : base (nav, context) {}
- protected SelfIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new SelfIterator (this); }
- public override bool MoveNext ()
- {
- if (_pos == 0)
- {
- _pos = 1;
- return true;
- }
- return false;
- }
- }
-
- internal class ParentIterator : SimpleIterator
- {
- public ParentIterator (BaseIterator iter) : base (iter) {}
- protected ParentIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new ParentIterator (this); }
- public override bool MoveNext ()
- {
- if (_pos == 0 && _nav.MoveToParent ())
- {
- _pos = 1;
- return true;
- }
- return false;
- }
- }
-
- internal class ChildIterator : SimpleIterator
- {
- public ChildIterator (BaseIterator iter) : base (iter) {}
- protected ChildIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new ChildIterator (this); }
- public override bool MoveNext ()
- {
- bool fSuccess = (_pos == 0) ? _nav.MoveToFirstChild () : _nav.MoveToNext ();
- if (fSuccess)
- _pos ++;
- return fSuccess;
- }
- }
-
- internal class FollowingSiblingIterator : SimpleIterator
- {
- public FollowingSiblingIterator (BaseIterator iter) : base (iter) {}
- protected FollowingSiblingIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new FollowingSiblingIterator (this); }
- public override bool MoveNext ()
- {
- if (_nav.MoveToNext ())
- {
- _pos ++;
- return true;
- }
- return false;
- }
- }
-
- internal class PrecedingSiblingIterator : SimpleIterator
- {
- public PrecedingSiblingIterator (BaseIterator iter) : base (iter) {}
- protected PrecedingSiblingIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new PrecedingSiblingIterator (this); }
- public override bool MoveNext ()
- {
- if (_nav.MoveToPrevious ())
- {
- _pos ++;
- return true;
- }
- return false;
- }
- }
-
- internal class AncestorIterator : SimpleIterator
- {
- public AncestorIterator (BaseIterator iter) : base (iter) {}
- protected AncestorIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new AncestorIterator (this); }
- public override bool MoveNext ()
- {
- if (_nav.MoveToParent ())
- {
- _pos ++;
- return true;
- }
- return false;
- }
- }
-
- internal class AncestorOrSelfIterator : UnionIterator
- {
- public AncestorOrSelfIterator (BaseIterator iter) : base (iter)
- {
- Add (new SelfIterator (iter));
- Add (new AncestorIterator (iter));
- }
- protected AncestorOrSelfIterator (UnionIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new AncestorOrSelfIterator (this); }
- }
-
- internal class DescendantIterator : SimpleIterator
- {
- protected int _depth;
- public DescendantIterator (BaseIterator iter) : base (iter) {}
- protected DescendantIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new DescendantIterator (this); }
- [MonoTODO]
- public override bool MoveNext ()
- {
- if (_nav.MoveToFirstChild ())
- {
- _depth ++;
- _pos ++;
- return true;
- }
- while (_depth != 0)
- {
- if (_nav.MoveToNext ())
- {
- _pos ++;
- return true;
- }
- if (!_nav.MoveToParent ()) // should NEVER fail!
- throw new Exception ("unexpected depth"); // TODO: better message
- _depth --;
- }
- return false;
- }
- }
-
- internal class DescendantOrSelfIterator : UnionIterator
- {
- public DescendantOrSelfIterator (BaseIterator iter) : base (iter)
- {
- Add (new SelfIterator (iter));
- Add (new DescendantIterator (iter));
- }
- protected DescendantOrSelfIterator (UnionIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new DescendantOrSelfIterator (this); }
- }
-
- internal class FollowingIterator : SimpleIterator
- {
- public FollowingIterator (BaseIterator iter) : base (iter) {}
- protected FollowingIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new FollowingIterator (this); }
- public override bool MoveNext ()
- {
- if (_pos == 0)
- {
- if (_nav.MoveToNext ())
- {
- _pos ++;
- return true;
- }
- }
- else
- {
- if (_nav.MoveToFirstChild ())
- {
- _pos ++;
- return true;
- }
- do
- {
- if (_nav.MoveToNext ())
- {
- _pos ++;
- return true;
- }
- }
- while (_nav.MoveToParent ());
- }
- return false;
- }
- }
-
- internal class PrecedingIterator : SimpleIterator
- {
- public PrecedingIterator (BaseIterator iter) : base (iter) {}
- protected PrecedingIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new PrecedingIterator (this); }
- public override bool MoveNext ()
- {
- if (_pos == 0)
- {
- if (_nav.MoveToPrevious ())
- {
- _pos ++;
- return true;
- }
- }
- else
- {
- if (_nav.MoveToFirstChild ())
- {
- while (_nav.MoveToNext ())
- ;
- _pos ++;
- return true;
- }
- do
- {
- if (_nav.MoveToPrevious ())
- {
- _pos ++;
- return true;
- }
- }
- while (_nav.MoveToParent ());
- }
- return false;
- }
- }
-
- internal class NamespaceIterator : SimpleIterator
- {
- public NamespaceIterator (BaseIterator iter) : base (iter) {}
- protected NamespaceIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new NamespaceIterator (this); }
- public override bool MoveNext ()
- {
- if (_pos == 0)
- {
- if (_nav.MoveToFirstNamespace ())
- {
- _pos ++;
- return true;
- }
- }
- else if (_nav.MoveToNextNamespace ())
- {
- _pos ++;
- return true;
- }
- return false;
- }
- }
-
- internal class AttributeIterator : SimpleIterator
- {
- public AttributeIterator (BaseIterator iter) : base (iter) {}
- protected AttributeIterator (SimpleIterator other) : base (other) {}
- public override XPathNodeIterator Clone () { return new AttributeIterator (this); }
- public override bool MoveNext ()
- {
- if (_pos == 0)
- {
- if (_nav.MoveToFirstAttribute ())
- {
- _pos += 1;
- return true;
- }
- }
- else if (_nav.MoveToNextAttribute ())
- {
- _pos ++;
- return true;
- }
- return false;
- }
- }
-
- internal class AxisIterator : BaseIterator
- {
- protected BaseIterator _iter;
- protected NodeTest _test;
- protected int _pos;
-
- public AxisIterator (BaseIterator iter, NodeTest test) : base (iter)
- {
- _iter = iter;
- _test = test;
- }
-
- protected AxisIterator (AxisIterator other) : base (other)
- {
- _iter = (BaseIterator) other._iter.Clone ();
- _test = other._test;
- _pos = other._pos;
- }
- public override XPathNodeIterator Clone () { return new AxisIterator (this); }
-
- public override bool MoveNext ()
- {
- while (_iter.MoveNext ())
- {
- if (_test.Match (Context, Current))
- {
- _pos ++;
- return true;
- }
- }
- return false;
- }
- public override XPathNavigator Current { get { return _iter.Current; }}
- public override int CurrentPosition { get { return _pos; }}
- }
-
- internal class SlashIterator : BaseIterator
- {
- protected BaseIterator _iterLeft;
- protected BaseIterator _iterRight;
- protected Expression _expr;
- protected int _pos;
-
- public SlashIterator (BaseIterator iter, Expression expr) : base (iter)
- {
- _iterLeft = iter;
- _expr = expr;
- }
-
- protected SlashIterator (SlashIterator other) : base (other)
- {
- _iterLeft = (BaseIterator) other._iterLeft.Clone ();
- _iterRight = (BaseIterator) other._iterRight.Clone ();
- _expr = other._expr;
- _pos = other._pos;
- }
- public override XPathNodeIterator Clone () { return new SlashIterator (this); }
-
- public override bool MoveNext ()
- {
- while (_iterRight == null || !_iterRight.MoveNext ())
- {
- if (!_iterLeft.MoveNext ())
- return false;
- _iterRight = _expr.EvaluateNodeSet (_iterLeft);
- }
- _pos ++;
- return true;
- }
- public override XPathNavigator Current { get { return _iterRight.Current; }}
- public override int CurrentPosition { get { return _pos; }}
- }
- internal class PredicateIterator : BaseIterator
- {
- protected BaseIterator _iter;
- protected Expression [] _preds;
- protected int _pos;
-
- public PredicateIterator (BaseIterator iter, Expression [] preds) : base (iter)
- {
- _iter = iter;
- _preds = preds;
- }
-
- protected PredicateIterator (PredicateIterator other) : base (other)
- {
- _iter = (BaseIterator) other._iter.Clone ();
- _preds = other._preds;
- _pos = other._pos;
- }
- public override XPathNodeIterator Clone () { return new PredicateIterator (this); }
-
- public override bool MoveNext ()
- {
- while (_iter.MoveNext ())
- {
- bool fTrue = true;
- foreach (Expression pred in _preds)
- {
- if (!pred.EvaluateBoolean ((BaseIterator) _iter.Clone ()))
- {
- fTrue = false;
- break;
- }
- }
- if (fTrue)
- return true;
- }
- return false;
- }
- public override XPathNavigator Current { get { return _iter.Current; }}
- public override int CurrentPosition { get { return _pos; }}
- }
- internal class ArrayListIterator : BaseIterator
- {
- protected ArrayList _rgNodes;
- protected int _pos;
-
- public ArrayListIterator (BaseIterator iter, ArrayList rgNodes) : base (iter)
- {
- _rgNodes = rgNodes;
- }
-
- protected ArrayListIterator (ArrayListIterator other) : base (other)
- {
- _rgNodes = other._rgNodes;
- }
- public override XPathNodeIterator Clone () { return new ArrayListIterator (this); }
-
- public override bool MoveNext ()
- {
- if (_pos >= _rgNodes.Count)
- return false;
- _pos++;
- return true;
- }
- public override XPathNavigator Current { get { return (XPathNavigator) _rgNodes [_pos - 1]; }}
- public override int CurrentPosition { get { return _pos; }}
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/Parser.cs b/mcs/class/System.XML/System.Xml.XPath/Parser.cs
deleted file mode 100644
index d747e4c00a1..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/Parser.cs
+++ /dev/null
@@ -1,1086 +0,0 @@
-// created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de
-
- // line 2 "Parser.jay"
-// XPath parser
-//
-// Author - Piers Haken <piersh@friskit.com>
-//
-
-// TODO: FUNCTION_CALL should be a QName, not just a NCName
-// TODO: PROCESSING_INSTRUCTION's optional parameter
-// TODO: flatten argument/predicate lists in place
-
-using System;
-
-namespace System.Xml.XPath
-{
- public class XPathParser
- {
-
- // line 21 "-"
-
- /** simplified error message.
- @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
- */
- public void yyerror (string message) {
- yyerror(message, null);
- }
-
- /** (syntax) error message.
- Can be overwritten to control message format.
- @param message text to be displayed.
- @param expected vector of acceptable tokens, if available.
- */
- public void yyerror (string message, string[] expected) {
- if ((expected != null) && (expected.Length > 0)) {
- System.Console.Write (message+", expecting");
- for (int n = 0; n < expected.Length; ++ n)
- System.Console.Write (" "+expected[n]);
- System.Console.WriteLine ();
- } else
- System.Console.WriteLine (message);
- }
-
- /** debugging support, requires the package jay.yydebug.
- Set to null to suppress debugging messages.
- */
- protected yydebug.yyDebug debug;
-
- protected static int yyFinal = 25;
- public static string [] yyRule = {
- "$accept : Expr",
- "Expr : OrExpr",
- "OrExpr : AndExpr",
- "OrExpr : OrExpr OR AndExpr",
- "AndExpr : EqualityExpr",
- "AndExpr : AndExpr AND EqualityExpr",
- "EqualityExpr : RelationalExpr",
- "EqualityExpr : EqualityExpr EQ RelationalExpr",
- "EqualityExpr : EqualityExpr NE RelationalExpr",
- "RelationalExpr : AdditiveExpr",
- "RelationalExpr : RelationalExpr LT AdditiveExpr",
- "RelationalExpr : RelationalExpr GT AdditiveExpr",
- "RelationalExpr : RelationalExpr LE AdditiveExpr",
- "RelationalExpr : RelationalExpr GE AdditiveExpr",
- "AdditiveExpr : MultiplicativeExpr",
- "AdditiveExpr : AdditiveExpr PLUS MultiplicativeExpr",
- "AdditiveExpr : AdditiveExpr MINUS MultiplicativeExpr",
- "MultiplicativeExpr : UnaryExpr",
- "MultiplicativeExpr : MultiplicativeExpr ASTERISK UnaryExpr",
- "MultiplicativeExpr : MultiplicativeExpr DIV UnaryExpr",
- "MultiplicativeExpr : MultiplicativeExpr MOD UnaryExpr",
- "UnaryExpr : UnionExpr",
- "UnaryExpr : MINUS UnaryExpr",
- "UnionExpr : PathExpr",
- "UnionExpr : UnionExpr BAR PathExpr",
- "PathExpr : RelativeLocationPath",
- "PathExpr : SLASH",
- "PathExpr : SLASH RelativeLocationPath",
- "PathExpr : SLASH2 RelativeLocationPath",
- "PathExpr : FilterExpr",
- "PathExpr : FilterExpr SLASH RelativeLocationPath",
- "PathExpr : FilterExpr SLASH2 RelativeLocationPath",
- "RelativeLocationPath : Step",
- "RelativeLocationPath : RelativeLocationPath SLASH Step",
- "RelativeLocationPath : RelativeLocationPath SLASH2 Step",
- "Step : AxisSpecifier QName ZeroOrMorePredicates",
- "Step : AxisSpecifier ASTERISK ZeroOrMorePredicates",
- "Step : AxisSpecifier NCName COLON ASTERISK ZeroOrMorePredicates",
- "Step : AxisSpecifier NodeType PAREN_OPEN OptionalLiteral PAREN_CLOSE ZeroOrMorePredicates",
- "Step : DOT",
- "Step : DOT2",
- "AxisSpecifier :",
- "AxisSpecifier : AT",
- "AxisSpecifier : AxisName COLON2",
- "NodeType : COMMENT",
- "NodeType : TEXT",
- "NodeType : PROCESSING_INSTRUCTION",
- "NodeType : NODE",
- "FilterExpr : PrimaryExpr",
- "FilterExpr : FilterExpr Predicate",
- "PrimaryExpr : DOLLAR QName",
- "PrimaryExpr : PAREN_OPEN Expr PAREN_CLOSE",
- "PrimaryExpr : LITERAL",
- "PrimaryExpr : NUMBER",
- "PrimaryExpr : FunctionCall",
- "FunctionCall : FUNCTION_NAME PAREN_OPEN OptionalArgumentList PAREN_CLOSE",
- "OptionalArgumentList :",
- "OptionalArgumentList : Expr OptionalArgumentListTail",
- "OptionalArgumentListTail :",
- "OptionalArgumentListTail : COMMA Expr OptionalArgumentListTail",
- "ZeroOrMorePredicates :",
- "ZeroOrMorePredicates : Predicate ZeroOrMorePredicates",
- "Predicate : BRACKET_OPEN Expr BRACKET_CLOSE",
- "AxisName : ANCESTOR",
- "AxisName : ANCESTOR_OR_SELF",
- "AxisName : ATTRIBUTE",
- "AxisName : CHILD",
- "AxisName : DESCENDANT",
- "AxisName : DESCENDANT_OR_SELF",
- "AxisName : FOLLOWING",
- "AxisName : FOLLOWING_SIBLING",
- "AxisName : NAMESPACE",
- "AxisName : PARENT",
- "AxisName : PRECEDING",
- "AxisName : PRECEDING_SIBLING",
- "AxisName : SELF",
- "OptionalLiteral :",
- "OptionalLiteral : LITERAL",
- "QName : NCName",
- "QName : NCName COLON NCName",
- };
- protected static string [] yyName = {
- "end-of-file",null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,null,null,null,null,null,null,null,
- null,null,null,null,null,null,null,"ERROR","EOF","SLASH","SLASH2",
- "DOT","DOT2","COLON","COLON2","COMMA","AT","FUNCTION_NAME",
- "BRACKET_OPEN","BRACKET_CLOSE","PAREN_OPEN","PAREN_CLOSE","AND","OR",
- "DIV","MOD","PLUS","MINUS","ASTERISK","DOLLAR","BAR","EQ","NE","LE",
- "GE","LT","GT","ANCESTOR","ANCESTOR_OR_SELF","ATTRIBUTE","CHILD",
- "DESCENDANT","DESCENDANT_OR_SELF","FOLLOWING","FOLLOWING_SIBLING",
- "NAMESPACE","PARENT","PRECEDING","PRECEDING_SIBLING","SELF","COMMENT",
- "TEXT","PROCESSING_INSTRUCTION","NODE","NUMBER","LITERAL","NCName",
- };
-
- /** index-checked interface to yyName[].
- @param token single character or %token value.
- @return token name or [illegal] or [unknown].
- */
- public static string yyname (int token) {
- if ((token < 0) || (token > yyName.Length)) return "[illegal]";
- string name;
- if ((name = yyName[token]) != null) return name;
- return "[unknown]";
- }
-
- /** computes list of expected tokens on error by tracing the tables.
- @param state for which to compute the list.
- @return list of token names.
- */
- protected string[] yyExpecting (int state) {
- int token, n, len = 0;
- bool[] ok = new bool[yyName.Length];
-
- if ((n = yySindex[state]) != 0)
- for (token = n < 0 ? -n : 0;
- (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
- if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
- ++ len;
- ok[token] = true;
- }
- if ((n = yyRindex[state]) != 0)
- for (token = n < 0 ? -n : 0;
- (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
- if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
- ++ len;
- ok[token] = true;
- }
-
- string [] result = new string[len];
- for (n = token = 0; n < len; ++ token)
- if (ok[token]) result[n++] = yyName[token];
- return result;
- }
-
- /** the generated parser, with debugging messages.
- Maintains a state and a value stack, currently with fixed maximum size.
- @param yyLex scanner.
- @param yydebug debug message writer implementing yyDebug, or null.
- @return result of the last reduction, if any.
- @throws yyException on irrecoverable parse error.
- */
- public Object yyparse (yyParser.yyInput yyLex, Object yyd)
- {
- this.debug = (yydebug.yyDebug)yyd;
- return yyparse(yyLex);
- }
-
- /** initial size and increment of the state/value stack [default 256].
- This is not final so that it can be overwritten outside of invocations
- of yyparse().
- */
- protected int yyMax;
-
- /** executed at the beginning of a reduce action.
- Used as $$ = yyDefault($1), prior to the user-specified action, if any.
- Can be overwritten to provide deep copy, etc.
- @param first value for $1, or null.
- @return first.
- */
- protected Object yyDefault (Object first) {
- return first;
- }
-
- /** the generated parser.
- Maintains a state and a value stack, currently with fixed maximum size.
- @param yyLex scanner.
- @return result of the last reduction, if any.
- @throws yyException on irrecoverable parse error.
- */
- public Object yyparse (yyParser.yyInput yyLex)
- {
- if (yyMax <= 0) yyMax = 256; // initial size
- int yyState = 0; // state stack ptr
- int [] yyStates = new int[yyMax]; // state stack
- Object yyVal = null; // value stack ptr
- Object [] yyVals = new Object[yyMax]; // value stack
- int yyToken = -1; // current input
- int yyErrorFlag = 0; // #tks to shift
-
- int yyTop = 0;
- goto skip;
- yyLoop:
- yyTop++;
- skip:
- for (;; ++ yyTop) {
- if (yyTop >= yyStates.Length) { // dynamically increase
- int[] i = new int[yyStates.Length+yyMax];
- System.Array.Copy(yyStates, i, 0);
- yyStates = i;
- Object[] o = new Object[yyVals.Length+yyMax];
- System.Array.Copy(yyVals, o, 0);
- yyVals = o;
- }
- yyStates[yyTop] = yyState;
- yyVals[yyTop] = yyVal;
- if (debug != null) debug.push(yyState, yyVal);
-
- yyDiscarded: for (;;) { // discarding a token does not change stack
- int yyN;
- if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
- if (yyToken < 0) {
- yyToken = yyLex.advance() ? yyLex.token() : 0;
- if (debug != null)
- debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
- }
- if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
- && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
- if (debug != null)
- debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
- yyState = yyTable[yyN]; // shift to yyN
- yyVal = yyLex.value();
- yyToken = -1;
- if (yyErrorFlag > 0) -- yyErrorFlag;
- goto yyLoop;
- }
- if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
- && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
- yyN = yyTable[yyN]; // reduce (yyN)
- else
- switch (yyErrorFlag) {
-
- case 0:
- yyerror("syntax error", yyExpecting(yyState));
- if (debug != null) debug.error("syntax error");
- goto case 1;
- case 1: case 2:
- yyErrorFlag = 3;
- do {
- if ((yyN = yySindex[yyStates[yyTop]]) != 0
- && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
- && yyCheck[yyN] == Token.yyErrorCode) {
- if (debug != null)
- debug.shift(yyStates[yyTop], yyTable[yyN], 3);
- yyState = yyTable[yyN];
- yyVal = yyLex.value();
- goto yyLoop;
- }
- if (debug != null) debug.pop(yyStates[yyTop]);
- } while (-- yyTop >= 0);
- if (debug != null) debug.reject();
- throw new yyParser.yyException("irrecoverable syntax error");
-
- case 3:
- if (yyToken == 0) {
- if (debug != null) debug.reject();
- throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
- }
- if (debug != null)
- debug.discard(yyState, yyToken, yyname(yyToken),
- yyLex.value());
- yyToken = -1;
- goto yyDiscarded; // leave stack alone
- }
- }
- int yyV = yyTop + 1-yyLen[yyN];
- if (debug != null)
- debug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]);
- yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
- switch (yyN) {
-case 3:
- // line 106 "Parser.jay"
- {
- yyVal = new ExprOR ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 5:
- // line 114 "Parser.jay"
- {
- yyVal = new ExprAND ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 7:
- // line 122 "Parser.jay"
- {
- yyVal = new ExprEQ ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 8:
- // line 126 "Parser.jay"
- {
- yyVal = new ExprNE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 10:
- // line 134 "Parser.jay"
- {
- yyVal = new ExprLT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 11:
- // line 138 "Parser.jay"
- {
- yyVal = new ExprGT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 12:
- // line 142 "Parser.jay"
- {
- yyVal = new ExprLE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 13:
- // line 146 "Parser.jay"
- {
- yyVal = new ExprGE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 15:
- // line 154 "Parser.jay"
- {
- yyVal = new ExprPLUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 16:
- // line 158 "Parser.jay"
- {
- yyVal = new ExprMINUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 18:
- // line 166 "Parser.jay"
- {
- yyVal = new ExprMULT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 19:
- // line 170 "Parser.jay"
- {
- yyVal = new ExprDIV ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 20:
- // line 174 "Parser.jay"
- {
- yyVal = new ExprMOD ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 22:
- // line 182 "Parser.jay"
- {
- yyVal = new ExprNEG ((Expression) yyVals[0+yyTop]);
- }
- break;
-case 24:
- // line 190 "Parser.jay"
- {
- yyVal = new ExprUNION ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
- }
- break;
-case 26:
- // line 198 "Parser.jay"
- {
- yyVal = new ExprRoot ();
- }
- break;
-case 27:
- // line 202 "Parser.jay"
- {
- yyVal = new ExprSLASH (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
- }
- break;
-case 28:
- // line 206 "Parser.jay"
- {
- ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, NodeTestTypes.Node));
- yyVal = new ExprSLASH (new ExprSLASH (new ExprRoot (), exprStep), (NodeSet) yyVals[0+yyTop]);
- }
- break;
-case 30:
- // line 212 "Parser.jay"
- {
- yyVal = new ExprSLASH ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
- }
- break;
-case 31:
- // line 216 "Parser.jay"
- {
- ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, NodeTestTypes.Node));
- yyVal = new ExprSLASH (new ExprSLASH ((NodeSet) yyVals[-2+yyTop], exprStep), (NodeSet) yyVals[0+yyTop]);
- }
- break;
-case 33:
- // line 225 "Parser.jay"
- {
- yyVal = new ExprSLASH ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
- }
- break;
-case 34:
- // line 229 "Parser.jay"
- {
- ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, NodeTestTypes.Node));
- yyVal = new ExprSLASH (new ExprSLASH ((NodeSet) yyVals[-2+yyTop], exprStep), (NodeSet) yyVals[0+yyTop]);
- }
- break;
-case 35:
- // line 237 "Parser.jay"
- {
- yyVal = new ExprStep (new NodeNameTest ((Axes) yyVals[-2+yyTop], (QName) yyVals[-1+yyTop]), (ExprPredicates) yyVals[0+yyTop]);
- }
- break;
-case 36:
- // line 241 "Parser.jay"
- {
- yyVal = new ExprStep (new NodeTypeTest ((Axes) yyVals[-2+yyTop], NodeTestTypes.Principal), (ExprPredicates) yyVals[0+yyTop]);
- }
- break;
-case 37:
- // line 245 "Parser.jay"
- {
- yyVal = new ExprStep (new NodeNameTestAny ((Axes) yyVals[-4+yyTop], (NCName) yyVals[-3+yyTop]), (ExprPredicates) yyVals[0+yyTop]);
- }
- break;
-case 38:
- // line 249 "Parser.jay"
- {
- yyVal = new ExprStep (new NodeTypeTest ((Axes) yyVals[-5+yyTop], (NodeTestTypes) yyVals[-4+yyTop], (String) yyVals[-2+yyTop]), (ExprPredicates) yyVals[0+yyTop]);
- }
- break;
-case 39:
- // line 253 "Parser.jay"
- {
- yyVal = new ExprStep (new NodeTypeTest (Axes.Self, NodeTestTypes.Node));
- }
- break;
-case 40:
- // line 257 "Parser.jay"
- {
- yyVal = new ExprStep (new NodeTypeTest (Axes.Parent, NodeTestTypes.Node));
- }
- break;
-case 41:
- // line 264 "Parser.jay"
- {
- yyVal = Axes.Child;
- }
- break;
-case 42:
- // line 268 "Parser.jay"
- {
- yyVal = Axes.Attribute;
- }
- break;
-case 43:
- // line 272 "Parser.jay"
- {
- yyVal = yyVals[-1+yyTop];
- }
- break;
-case 44:
- // line 278 "Parser.jay"
- { yyVal = NodeTestTypes.Comment; }
- break;
-case 45:
- // line 279 "Parser.jay"
- { yyVal = NodeTestTypes.Text; }
- break;
-case 46:
- // line 280 "Parser.jay"
- { yyVal = NodeTestTypes.ProcessingInstruction; }
- break;
-case 47:
- // line 281 "Parser.jay"
- { yyVal = NodeTestTypes.Node; }
- break;
-case 49:
- // line 288 "Parser.jay"
- {
- yyVal = new ExprFilter ((Expression) yyVals[-1+yyTop], (Expression) yyVals[0+yyTop]);
- }
- break;
-case 50:
- // line 295 "Parser.jay"
- {
- yyVal = new ExprVariable ((QName) yyVals[0+yyTop]);
- }
- break;
-case 51:
- // line 299 "Parser.jay"
- {
- yyVal = yyVals[-1+yyTop];
- }
- break;
-case 52:
- // line 303 "Parser.jay"
- {
- yyVal = new ExprLiteral ((String) yyVals[0+yyTop]);
- }
- break;
-case 53:
- // line 307 "Parser.jay"
- {
- yyVal = new ExprNumber ((double) yyVals[0+yyTop]);
- }
- break;
-case 55:
- // line 315 "Parser.jay"
- {
- yyVal = new ExprFunctionCall ((String) yyVals[-3+yyTop], (FunctionArguments) yyVals[-1+yyTop]);
- }
- break;
-case 57:
- // line 323 "Parser.jay"
- {
- yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
- }
- break;
-case 59:
- // line 331 "Parser.jay"
- {
- yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
- }
- break;
-case 61:
- // line 340 "Parser.jay"
- {
- yyVal = new ExprPredicates ((Expression) yyVals[-1+yyTop], (ExprPredicates) yyVals[0+yyTop]);
- }
- break;
-case 62:
- // line 347 "Parser.jay"
- {
- yyVal = yyVals[-1+yyTop];
- }
- break;
-case 63:
- // line 353 "Parser.jay"
- { yyVal = Axes.Ancestor; }
- break;
-case 64:
- // line 354 "Parser.jay"
- { yyVal = Axes.AncestorOrSelf; }
- break;
-case 65:
- // line 355 "Parser.jay"
- { yyVal = Axes.Attribute; }
- break;
-case 66:
- // line 356 "Parser.jay"
- { yyVal = Axes.Child; }
- break;
-case 67:
- // line 357 "Parser.jay"
- { yyVal = Axes.Descendant; }
- break;
-case 68:
- // line 358 "Parser.jay"
- { yyVal = Axes.DescendantOrSelf; }
- break;
-case 69:
- // line 359 "Parser.jay"
- { yyVal = Axes.Following; }
- break;
-case 70:
- // line 360 "Parser.jay"
- { yyVal = Axes.FollowingSibling; }
- break;
-case 71:
- // line 361 "Parser.jay"
- { yyVal = Axes.Namespace; }
- break;
-case 72:
- // line 362 "Parser.jay"
- { yyVal = Axes.Parent; }
- break;
-case 73:
- // line 363 "Parser.jay"
- { yyVal = Axes.Preceding; }
- break;
-case 74:
- // line 364 "Parser.jay"
- { yyVal = Axes.PrecedingSibling; }
- break;
-case 75:
- // line 365 "Parser.jay"
- { yyVal = Axes.Self; }
- break;
-case 77:
- // line 371 "Parser.jay"
- {
- yyVal = yyVals[0+yyTop];
- }
- break;
-case 78:
- // line 378 "Parser.jay"
- {
- yyVal = new NCName ((String) yyVals[0+yyTop]);
- }
- break;
-case 79:
- // line 382 "Parser.jay"
- {
- yyVal = new QName ((String) yyVals[-2+yyTop], (String) yyVals[0+yyTop]);
- }
- break;
- // line 662 "-"
- }
- yyTop -= yyLen[yyN];
- yyState = yyStates[yyTop];
- int yyM = yyLhs[yyN];
- if (yyState == 0 && yyM == 0) {
- if (debug != null) debug.shift(0, yyFinal);
- yyState = yyFinal;
- if (yyToken < 0) {
- yyToken = yyLex.advance() ? yyLex.token() : 0;
- if (debug != null)
- debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
- }
- if (yyToken == 0) {
- if (debug != null) debug.accept(yyVal);
- return yyVal;
- }
- goto yyLoop;
- }
- if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)
- && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))
- yyState = yyTable[yyN];
- else
- yyState = yyDgoto[yyM];
- if (debug != null) debug.shift(yyStates[yyTop], yyState);
- goto yyLoop;
- }
- }
- }
-
- static short [] yyLhs = { -1,
- 0, 1, 1, 2, 2, 3, 3, 3, 4, 4,
- 4, 4, 4, 5, 5, 5, 6, 6, 6, 6,
- 7, 7, 8, 8, 9, 9, 9, 9, 9, 9,
- 9, 10, 10, 10, 12, 12, 12, 12, 12, 12,
- 13, 13, 13, 16, 16, 16, 16, 11, 11, 19,
- 19, 19, 19, 19, 21, 22, 22, 23, 23, 15,
- 15, 20, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 17, 17, 14, 14,
- };
- static short [] yyLen = { 2,
- 1, 1, 3, 1, 3, 1, 3, 3, 1, 3,
- 3, 3, 3, 1, 3, 3, 1, 3, 3, 3,
- 1, 2, 1, 3, 1, 1, 2, 2, 1, 3,
- 3, 1, 3, 3, 3, 3, 5, 6, 1, 1,
- 0, 1, 2, 1, 1, 1, 1, 1, 2, 2,
- 3, 1, 1, 1, 4, 0, 2, 0, 3, 0,
- 2, 3, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 0, 1, 1, 3,
- };
- static short [] yyDefRed = { 0,
- 0, 0, 39, 40, 42, 0, 0, 0, 0, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 53, 52, 0, 0, 0, 0, 0, 0,
- 0, 17, 0, 23, 0, 0, 32, 0, 0, 48,
- 54, 0, 0, 0, 0, 22, 0, 50, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 49, 0, 44,
- 45, 46, 47, 0, 0, 0, 43, 0, 0, 51,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 19, 20, 18, 24, 33, 34, 0, 0, 0,
- 36, 0, 0, 35, 0, 0, 57, 55, 79, 62,
- 61, 0, 77, 0, 0, 37, 0, 59, 38,
- };
- protected static short [] yyDgoto = { 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 48, 101, 76, 114, 39, 40, 102,
- 41, 79, 107,
- };
- protected static short [] yySindex = { -174,
- -104, -104, 0, 0, 0, -263, -174, -174, -297, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, -262, -253, -265, -259, -248,
- -260, 0, -250, 0, -203, -247, 0, -258, -242, 0,
- 0, -203, -203, -174, -224, 0, -197, 0, -174, -174,
- -174, -174, -174, -174, -174, -174, -174, -174, -174, -174,
- -174, -124, -104, -104, -104, -104, -174, 0, -193, 0,
- 0, 0, 0, -187, -193, -192, 0, -188, -191, 0,
- -227, -253, -265, -259, -259, -248, -248, -248, -248, -260,
- -260, 0, 0, 0, 0, 0, 0, -203, -203, -186,
- 0, -193, -270, 0, -223, -174, 0, 0, 0, 0,
- 0, -193, 0, -190, -188, 0, -193, 0, 0,
- };
- protected static short [] yyRindex = { -239,
- 1, -239, 0, 0, 0, 0, -239, -239, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 253, 65, 23, 435, 319,
- 244, 0, 222, 0, 90, 112, 0, 0, 0, 0,
- 0, 134, 156, -268, 0, 0, 40, 0, -239, -239,
- -239, -239, -239, -239, -239, -239, -239, -239, -239, -239,
- -239, -239, -239, -239, -239, -239, -239, 0, 68, 0,
- 0, 0, 0, 40, 68, 0, 0, -182, 0, 0,
- 0, 510, 501, 457, 479, 347, 369, 391, 413, 267,
- 289, 0, 0, 0, 0, 0, 0, 178, 200, 0,
- 0, 68, 0, 0, -180, -239, 0, 0, 0, 0,
- 0, 68, 0, 0, -182, 0, 68, 0, 0,
- };
- protected static short [] yyGindex = { -7,
- 0, 35, 44, 7, -4, 14, -6, 0, 33, 4,
- 0, 10, 0, 59, -71, 0, 0, 0, 0, 62,
- 0, 0, -15,
- };
- protected static short [] yyTable = { 45,
- 26, 46, 56, 104, 42, 43, 44, 112, 47, 41,
- 49, 65, 66, 59, 60, 51, 52, 61, 50, 69,
- 67, 77, 4, 53, 54, 55, 56, 57, 58, 62,
- 111, 41, 41, 41, 41, 109, 78, 41, 41, 78,
- 116, 70, 71, 72, 73, 119, 80, 74, 86, 87,
- 88, 89, 92, 93, 94, 63, 64, 84, 85, 100,
- 41, 41, 41, 41, 2, 81, 41, 60, 98, 99,
- 90, 91, 96, 97, 67, 103, 106, 105, 109, 108,
- 117, 113, 110, 82, 1, 2, 3, 4, 58, 25,
- 76, 5, 6, 83, 95, 7, 75, 68, 115, 118,
- 0, 0, 8, 0, 9, 0, 0, 0, 0, 0,
- 0, 29, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 0, 0, 0, 0, 23,
- 24, 0, 0, 27, 1, 2, 3, 4, 0, 0,
- 0, 5, 6, 0, 0, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 9, 28, 3, 4, 0, 0,
- 0, 5, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 0, 0, 30, 0, 23,
- 24, 0, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 0, 0, 0, 0, 31,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 21, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 14, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 26, 15, 0, 0, 26,
- 0, 26, 26, 26, 26, 26, 26, 26, 26, 0,
- 26, 26, 26, 26, 26, 26, 26, 4, 16, 0,
- 0, 4, 0, 4, 4, 4, 0, 0, 78, 78,
- 41, 41, 41, 41, 78, 0, 41, 78, 78, 0,
- 78, 78, 78, 78, 78, 78, 78, 78, 9, 78,
- 78, 78, 78, 78, 78, 78, 60, 60, 0, 2,
- 0, 0, 60, 2, 0, 2, 60, 2, 60, 60,
- 60, 60, 60, 60, 60, 60, 12, 60, 60, 60,
- 60, 60, 60, 60, 25, 0, 0, 0, 25, 0,
- 25, 25, 25, 25, 25, 25, 25, 25, 13, 25,
- 25, 25, 25, 25, 25, 25, 29, 0, 0, 0,
- 29, 0, 29, 29, 29, 29, 29, 29, 29, 29,
- 10, 29, 29, 29, 29, 29, 29, 29, 27, 0,
- 0, 0, 27, 0, 27, 27, 27, 27, 27, 27,
- 27, 27, 11, 27, 27, 27, 27, 27, 27, 27,
- 28, 0, 0, 0, 28, 0, 28, 28, 28, 28,
- 28, 28, 28, 28, 6, 28, 28, 28, 28, 28,
- 28, 28, 30, 0, 0, 0, 30, 0, 30, 30,
- 30, 30, 30, 30, 30, 30, 7, 30, 30, 30,
- 30, 30, 30, 30, 31, 0, 0, 0, 31, 0,
- 31, 31, 31, 31, 31, 31, 31, 31, 8, 31,
- 31, 31, 31, 31, 31, 31, 21, 0, 0, 0,
- 21, 0, 21, 21, 21, 21, 21, 21, 21, 21,
- 5, 0, 21, 21, 21, 21, 21, 21, 14, 3,
- 0, 0, 14, 0, 14, 14, 14, 1, 0, 14,
- 14, 1, 0, 1, 14, 14, 14, 14, 14, 14,
- 0, 15, 0, 0, 0, 15, 0, 15, 15, 15,
- 0, 0, 15, 15, 0, 0, 0, 15, 15, 15,
- 15, 15, 15, 16, 0, 0, 0, 16, 0, 16,
- 16, 16, 0, 0, 16, 16, 0, 0, 0, 16,
- 16, 16, 16, 16, 16, 0, 0, 0, 0, 0,
- 0, 0, 0, 9, 0, 0, 0, 9, 0, 9,
- 9, 9, 0, 0, 0, 0, 0, 0, 0, 9,
- 9, 9, 9, 9, 9, 0, 0, 0, 0, 0,
- 0, 12, 0, 0, 0, 12, 0, 12, 12, 12,
- 0, 0, 0, 0, 0, 0, 0, 12, 12, 12,
- 12, 12, 12, 13, 0, 0, 0, 13, 0, 13,
- 13, 13, 0, 0, 0, 0, 0, 0, 0, 13,
- 13, 13, 13, 13, 13, 10, 0, 0, 0, 10,
- 0, 10, 10, 10, 0, 0, 0, 0, 0, 0,
- 0, 10, 10, 10, 10, 10, 10, 11, 0, 0,
- 0, 11, 0, 11, 11, 11, 0, 0, 0, 0,
- 0, 0, 0, 11, 11, 11, 11, 11, 11, 6,
- 0, 0, 0, 6, 0, 6, 6, 6, 0, 0,
- 0, 0, 0, 0, 0, 6, 6, 0, 0, 0,
- 0, 7, 0, 0, 0, 7, 0, 7, 7, 7,
- 0, 0, 0, 0, 0, 0, 0, 7, 7, 0,
- 0, 0, 0, 8, 0, 0, 0, 8, 0, 8,
- 8, 8, 0, 0, 0, 0, 0, 0, 0, 8,
- 8, 0, 0, 0, 0, 5, 0, 0, 0, 5,
- 0, 5, 5, 5, 3, 0, 0, 0, 3, 0,
- 3, 0, 3,
- };
- protected static short [] yyCheck = { 7,
- 0, 8, 271, 75, 1, 2, 270, 278, 306, 278,
- 273, 259, 260, 274, 275, 281, 282, 278, 272, 278,
- 268, 264, 0, 283, 284, 285, 286, 276, 277, 280,
- 102, 300, 301, 302, 303, 306, 44, 306, 278, 0,
- 112, 300, 301, 302, 303, 117, 271, 306, 53, 54,
- 55, 56, 59, 60, 61, 259, 260, 51, 52, 67,
- 300, 301, 302, 303, 0, 263, 306, 0, 65, 66,
- 57, 58, 63, 64, 268, 263, 265, 270, 306, 271,
- 271, 305, 269, 49, 259, 260, 261, 262, 271, 0,
- 271, 266, 267, 50, 62, 270, 38, 36, 106, 115,
- -1, -1, 277, -1, 279, -1, -1, -1, -1, -1,
- -1, 0, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, -1, -1, -1, -1, 304,
- 305, -1, -1, 0, 259, 260, 261, 262, -1, -1,
- -1, 266, 267, -1, -1, 270, -1, -1, -1, -1,
- -1, -1, -1, -1, 279, 0, 261, 262, -1, -1,
- -1, 266, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, -1, -1, 0, -1, 304,
- 305, -1, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, -1, -1, -1, -1, 0,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 0, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 0, -1, -1, -1, -1, -1, -1,
- -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 265, 0, -1, -1, 269,
- -1, 271, 272, 273, 274, 275, 276, 277, 278, -1,
- 280, 281, 282, 283, 284, 285, 286, 265, 0, -1,
- -1, 269, -1, 271, 272, 273, -1, -1, 259, 260,
- 300, 301, 302, 303, 265, -1, 306, 268, 269, -1,
- 271, 272, 273, 274, 275, 276, 277, 278, 0, 280,
- 281, 282, 283, 284, 285, 286, 259, 260, -1, 265,
- -1, -1, 265, 269, -1, 271, 269, 273, 271, 272,
- 273, 274, 275, 276, 277, 278, 0, 280, 281, 282,
- 283, 284, 285, 286, 265, -1, -1, -1, 269, -1,
- 271, 272, 273, 274, 275, 276, 277, 278, 0, 280,
- 281, 282, 283, 284, 285, 286, 265, -1, -1, -1,
- 269, -1, 271, 272, 273, 274, 275, 276, 277, 278,
- 0, 280, 281, 282, 283, 284, 285, 286, 265, -1,
- -1, -1, 269, -1, 271, 272, 273, 274, 275, 276,
- 277, 278, 0, 280, 281, 282, 283, 284, 285, 286,
- 265, -1, -1, -1, 269, -1, 271, 272, 273, 274,
- 275, 276, 277, 278, 0, 280, 281, 282, 283, 284,
- 285, 286, 265, -1, -1, -1, 269, -1, 271, 272,
- 273, 274, 275, 276, 277, 278, 0, 280, 281, 282,
- 283, 284, 285, 286, 265, -1, -1, -1, 269, -1,
- 271, 272, 273, 274, 275, 276, 277, 278, 0, 280,
- 281, 282, 283, 284, 285, 286, 265, -1, -1, -1,
- 269, -1, 271, 272, 273, 274, 275, 276, 277, 278,
- 0, -1, 281, 282, 283, 284, 285, 286, 265, 0,
- -1, -1, 269, -1, 271, 272, 273, 265, -1, 276,
- 277, 269, -1, 271, 281, 282, 283, 284, 285, 286,
- -1, 265, -1, -1, -1, 269, -1, 271, 272, 273,
- -1, -1, 276, 277, -1, -1, -1, 281, 282, 283,
- 284, 285, 286, 265, -1, -1, -1, 269, -1, 271,
- 272, 273, -1, -1, 276, 277, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, -1, -1, -1, -1, -1,
- -1, -1, -1, 265, -1, -1, -1, 269, -1, 271,
- 272, 273, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, -1, -1, -1, -1, -1,
- -1, 265, -1, -1, -1, 269, -1, 271, 272, 273,
- -1, -1, -1, -1, -1, -1, -1, 281, 282, 283,
- 284, 285, 286, 265, -1, -1, -1, 269, -1, 271,
- 272, 273, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 265, -1, -1, -1, 269,
- -1, 271, 272, 273, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 265, -1, -1,
- -1, 269, -1, 271, 272, 273, -1, -1, -1, -1,
- -1, -1, -1, 281, 282, 283, 284, 285, 286, 265,
- -1, -1, -1, 269, -1, 271, 272, 273, -1, -1,
- -1, -1, -1, -1, -1, 281, 282, -1, -1, -1,
- -1, 265, -1, -1, -1, 269, -1, 271, 272, 273,
- -1, -1, -1, -1, -1, -1, -1, 281, 282, -1,
- -1, -1, -1, 265, -1, -1, -1, 269, -1, 271,
- 272, 273, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, -1, -1, -1, -1, 265, -1, -1, -1, 269,
- -1, 271, 272, 273, 265, -1, -1, -1, 269, -1,
- 271, -1, 273,
- };
-
- // line 388 "Parser.jay"
- }
- // line 929 "-"
-namespace yydebug {
- using System;
- public interface yyDebug {
- void push (int state, Object value);
- void lex (int state, int token, string name, Object value);
- void shift (int from, int to, int errorFlag);
- void pop (int state);
- void discard (int state, int token, string name, Object value);
- void reduce (int from, int to, int rule, string text, int len);
- void shift (int from, int to);
- void accept (Object value);
- void error (string message);
- void reject ();
- }
-
- class yyDebugSimple : yyDebug {
- void println (string s){
- Console.WriteLine (s);
- }
-
- public void push (int state, Object value) {
- println ("push\tstate "+state+"\tvalue "+value);
- }
-
- public void lex (int state, int token, string name, Object value) {
- println("lex\tstate "+state+"\treading "+name+"\tvalue "+value);
- }
-
- public void shift (int from, int to, int errorFlag) {
- switch (errorFlag) {
- default: // normally
- println("shift\tfrom state "+from+" to "+to);
- break;
- case 0: case 1: case 2: // in error recovery
- println("shift\tfrom state "+from+" to "+to
- +"\t"+errorFlag+" left to recover");
- break;
- case 3: // normally
- println("shift\tfrom state "+from+" to "+to+"\ton error");
- break;
- }
- }
-
- public void pop (int state) {
- println("pop\tstate "+state+"\ton error");
- }
-
- public void discard (int state, int token, string name, Object value) {
- println("discard\tstate "+state+"\ttoken "+name+"\tvalue "+value);
- }
-
- public void reduce (int from, int to, int rule, string text, int len) {
- println("reduce\tstate "+from+"\tuncover "+to
- +"\trule ("+rule+") "+text);
- }
-
- public void shift (int from, int to) {
- println("goto\tfrom state "+from+" to "+to);
- }
-
- public void accept (Object value) {
- println("accept\tvalue "+value);
- }
-
- public void error (string message) {
- println("error\t"+message);
- }
-
- public void reject () {
- println("reject");
- }
-
- }
-}
-// %token constants
- class Token {
- public const int ERROR = 257;
- public const int EOF = 258;
- public const int SLASH = 259;
- public const int SLASH2 = 260;
- public const int DOT = 261;
- public const int DOT2 = 262;
- public const int COLON = 263;
- public const int COLON2 = 264;
- public const int COMMA = 265;
- public const int AT = 266;
- public const int FUNCTION_NAME = 267;
- public const int BRACKET_OPEN = 268;
- public const int BRACKET_CLOSE = 269;
- public const int PAREN_OPEN = 270;
- public const int PAREN_CLOSE = 271;
- public const int AND = 272;
- public const int OR = 273;
- public const int DIV = 274;
- public const int MOD = 275;
- public const int PLUS = 276;
- public const int MINUS = 277;
- public const int ASTERISK = 278;
- public const int DOLLAR = 279;
- public const int BAR = 280;
- public const int EQ = 281;
- public const int NE = 282;
- public const int LE = 283;
- public const int GE = 284;
- public const int LT = 285;
- public const int GT = 286;
- public const int ANCESTOR = 287;
- public const int ANCESTOR_OR_SELF = 288;
- public const int ATTRIBUTE = 289;
- public const int CHILD = 290;
- public const int DESCENDANT = 291;
- public const int DESCENDANT_OR_SELF = 292;
- public const int FOLLOWING = 293;
- public const int FOLLOWING_SIBLING = 294;
- public const int NAMESPACE = 295;
- public const int PARENT = 296;
- public const int PRECEDING = 297;
- public const int PRECEDING_SIBLING = 298;
- public const int SELF = 299;
- public const int COMMENT = 300;
- public const int TEXT = 301;
- public const int PROCESSING_INSTRUCTION = 302;
- public const int NODE = 303;
- public const int NUMBER = 304;
- public const int LITERAL = 305;
- public const int NCName = 306;
- public const int yyErrorCode = 256;
- }
- namespace yyParser {
- using System;
- /** thrown for irrecoverable syntax errors and stack overflow.
- */
- public class yyException : System.Exception {
- public yyException (string message) : base (message) {
- }
- }
-
- /** must be implemented by a scanner object to supply input to the parser.
- */
- public interface yyInput {
- /** move on to next token.
- @return false if positioned beyond tokens.
- @throws IOException on input error.
- */
- bool advance (); // throws java.io.IOException;
- /** classifies current token.
- Should not be called if advance() returned false.
- @return current %token or single character.
- */
- int token ();
- /** associated with current token.
- Should not be called if advance() returned false.
- @return value for token().
- */
- Object value ();
- }
- }
-} // close outermost namespace, that MUST HAVE BEEN opened in the prolog
diff --git a/mcs/class/System.XML/System.Xml.XPath/Parser.jay b/mcs/class/System.XML/System.Xml.XPath/Parser.jay
deleted file mode 100644
index c404d9d8e5a..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/Parser.jay
+++ /dev/null
@@ -1,388 +0,0 @@
-%{
-// XPath parser
-//
-// Author - Piers Haken <piersh@friskit.com>
-//
-
-// TODO: FUNCTION_CALL should be a QName, not just a NCName
-// TODO: PROCESSING_INSTRUCTION's optional parameter
-// TODO: flatten argument/predicate lists in place
-
-using System;
-
-namespace System.Xml.XPath
-{
- public class XPathParser
- {
-
-%}
-
-%token ERROR
-%token EOF
-
-%token SLASH
-%token SLASH2
-%token DOT
-%token DOT2
-%token COLON
-%token COLON2
-%token COMMA
-%token AT
-
-%token FUNCTION_NAME
-
-%token BRACKET_OPEN
-%token BRACKET_CLOSE
-%token PAREN_OPEN
-%token PAREN_CLOSE
-
-%token AND
-%token OR
-%token DIV
-%token MOD
-%token PLUS
-%token MINUS
-%token ASTERISK
-%token DOLLAR
-%token BAR
-%token EQ
-%token NE
-%token LE
-%token GE
-%token LT
-%token GT
-
-%token ANCESTOR
-%token ANCESTOR_OR_SELF
-%token ATTRIBUTE
-%token CHILD
-%token DESCENDANT
-%token DESCENDANT_OR_SELF
-%token FOLLOWING
-%token FOLLOWING_SIBLING
-%token NAMESPACE
-%token PARENT
-%token PRECEDING
-%token PRECEDING_SIBLING
-%token SELF
-
-%token COMMENT
-%token TEXT
-%token PROCESSING_INSTRUCTION
-%token NODE
-
-%token NUMBER
-%token LITERAL
-%token NCName
-
-
-%start Expr
-
-
-%left AND
-%left OR
-%left EQ
-%left NE
-%left LE
-%left GE
-%left LT
-%left GT
-
-%left DIV
-%left MOD
-%left PLUS
-%left MINUS
-
-%%
-
-
-Expr
- : OrExpr
- ;
-
-OrExpr
- : AndExpr
- | OrExpr OR AndExpr
- {
- $$ = new ExprOR ((Expression) $1, (Expression) $3);
- }
- ;
-
-AndExpr
- : EqualityExpr
- | AndExpr AND EqualityExpr
- {
- $$ = new ExprAND ((Expression) $1, (Expression) $3);
- }
- ;
-
-EqualityExpr
- : RelationalExpr
- | EqualityExpr EQ RelationalExpr
- {
- $$ = new ExprEQ ((Expression) $1, (Expression) $3);
- }
- | EqualityExpr NE RelationalExpr
- {
- $$ = new ExprNE ((Expression) $1, (Expression) $3);
- }
- ;
-
-RelationalExpr
- : AdditiveExpr
- | RelationalExpr LT AdditiveExpr
- {
- $$ = new ExprLT ((Expression) $1, (Expression) $3);
- }
- | RelationalExpr GT AdditiveExpr
- {
- $$ = new ExprGT ((Expression) $1, (Expression) $3);
- }
- | RelationalExpr LE AdditiveExpr
- {
- $$ = new ExprLE ((Expression) $1, (Expression) $3);
- }
- | RelationalExpr GE AdditiveExpr
- {
- $$ = new ExprGE ((Expression) $1, (Expression) $3);
- }
- ;
-
-AdditiveExpr
- : MultiplicativeExpr
- | AdditiveExpr PLUS MultiplicativeExpr
- {
- $$ = new ExprPLUS ((Expression) $1, (Expression) $3);
- }
- | AdditiveExpr MINUS MultiplicativeExpr
- {
- $$ = new ExprMINUS ((Expression) $1, (Expression) $3);
- }
- ;
-
-MultiplicativeExpr
- : UnaryExpr
- | MultiplicativeExpr ASTERISK UnaryExpr
- {
- $$ = new ExprMULT ((Expression) $1, (Expression) $3);
- }
- | MultiplicativeExpr DIV UnaryExpr
- {
- $$ = new ExprDIV ((Expression) $1, (Expression) $3);
- }
- | MultiplicativeExpr MOD UnaryExpr
- {
- $$ = new ExprMOD ((Expression) $1, (Expression) $3);
- }
- ;
-
-UnaryExpr
- : UnionExpr
- | MINUS UnaryExpr
- {
- $$ = new ExprNEG ((Expression) $2);
- }
- ;
-
-UnionExpr
- : PathExpr
- | UnionExpr BAR PathExpr
- {
- $$ = new ExprUNION ((NodeSet) $1, (NodeSet) $3);
- }
- ;
-
-PathExpr
- : RelativeLocationPath
- | SLASH
- {
- $$ = new ExprRoot ();
- }
- | SLASH RelativeLocationPath
- {
- $$ = new ExprSLASH (new ExprRoot (), (NodeSet) $2);
- }
- | SLASH2 RelativeLocationPath
- {
- ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, NodeTestTypes.Node));
- $$ = new ExprSLASH (new ExprSLASH (new ExprRoot (), exprStep), (NodeSet) $2);
- }
- | FilterExpr
- | FilterExpr SLASH RelativeLocationPath
- {
- $$ = new ExprSLASH ((NodeSet) $1, (NodeSet) $3);
- }
- | FilterExpr SLASH2 RelativeLocationPath
- {
- ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, NodeTestTypes.Node));
- $$ = new ExprSLASH (new ExprSLASH ((NodeSet) $1, exprStep), (NodeSet) $3);
- }
- ;
-
-RelativeLocationPath
- : Step
- | RelativeLocationPath SLASH Step
- {
- $$ = new ExprSLASH ((NodeSet) $1, (NodeSet) $3);
- }
- | RelativeLocationPath SLASH2 Step
- {
- ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, NodeTestTypes.Node));
- $$ = new ExprSLASH (new ExprSLASH ((NodeSet) $1, exprStep), (NodeSet) $3);
- }
- ;
-
-Step
- : AxisSpecifier QName ZeroOrMorePredicates
- {
- $$ = new ExprStep (new NodeNameTest ((Axes) $1, (QName) $2), (ExprPredicates) $3);
- }
- | AxisSpecifier ASTERISK ZeroOrMorePredicates
- {
- $$ = new ExprStep (new NodeTypeTest ((Axes) $1, NodeTestTypes.Principal), (ExprPredicates) $3);
- }
- | AxisSpecifier NCName COLON ASTERISK ZeroOrMorePredicates
- {
- $$ = new ExprStep (new NodeNameTestAny ((Axes) $1, (NCName) $2), (ExprPredicates) $5);
- }
- | AxisSpecifier NodeType PAREN_OPEN OptionalLiteral PAREN_CLOSE ZeroOrMorePredicates
- {
- $$ = new ExprStep (new NodeTypeTest ((Axes) $1, (NodeTestTypes) $2, (String) $4), (ExprPredicates) $6);
- }
- | DOT
- {
- $$ = new ExprStep (new NodeTypeTest (Axes.Self, NodeTestTypes.Node));
- }
- | DOT2
- {
- $$ = new ExprStep (new NodeTypeTest (Axes.Parent, NodeTestTypes.Node));
- }
- ;
-
-AxisSpecifier
- : /* empty */
- {
- $$ = Axes.Child;
- }
- | AT
- {
- $$ = Axes.Attribute;
- }
- | AxisName COLON2
- {
- $$ = $1;
- }
- ;
-
-NodeType
- : COMMENT { $$ = NodeTestTypes.Comment; }
- | TEXT { $$ = NodeTestTypes.Text; }
- | PROCESSING_INSTRUCTION { $$ = NodeTestTypes.ProcessingInstruction; }
- | NODE { $$ = NodeTestTypes.Node; }
- ;
-
-
-FilterExpr
- : PrimaryExpr
- | FilterExpr Predicate
- {
- $$ = new ExprFilter ((Expression) $1, (Expression) $2);
- }
- ;
-
-PrimaryExpr
- : DOLLAR QName
- {
- $$ = new ExprVariable ((QName) $2);
- }
- | PAREN_OPEN Expr PAREN_CLOSE
- {
- $$ = $2;
- }
- | LITERAL
- {
- $$ = new ExprLiteral ((String) $1);
- }
- | NUMBER
- {
- $$ = new ExprNumber ((double) $1);
- }
- | FunctionCall
- ;
-
-FunctionCall
- : FUNCTION_NAME PAREN_OPEN OptionalArgumentList PAREN_CLOSE
- {
- $$ = new ExprFunctionCall ((String) $1, (FunctionArguments) $3);
- }
- ;
-
-OptionalArgumentList
- : /* empty */
- | Expr OptionalArgumentListTail
- {
- $$ = new FunctionArguments ((Expression) $1, (FunctionArguments) $2);
- }
- ;
-
-OptionalArgumentListTail
- : /* empty */
- | COMMA Expr OptionalArgumentListTail
- {
- $$ = new FunctionArguments ((Expression) $2, (FunctionArguments) $3);
- }
- ;
-
-
-ZeroOrMorePredicates
- : /* empty */
- | Predicate ZeroOrMorePredicates
- {
- $$ = new ExprPredicates ((Expression) $1, (ExprPredicates) $2);
- }
- ;
-
-Predicate
- : BRACKET_OPEN Expr BRACKET_CLOSE
- {
- $$ = $2;
- }
- ;
-
-AxisName
- : ANCESTOR { $$ = Axes.Ancestor; }
- | ANCESTOR_OR_SELF { $$ = Axes.AncestorOrSelf; }
- | ATTRIBUTE { $$ = Axes.Attribute; }
- | CHILD { $$ = Axes.Child; }
- | DESCENDANT { $$ = Axes.Descendant; }
- | DESCENDANT_OR_SELF { $$ = Axes.DescendantOrSelf; }
- | FOLLOWING { $$ = Axes.Following; }
- | FOLLOWING_SIBLING { $$ = Axes.FollowingSibling; }
- | NAMESPACE { $$ = Axes.Namespace; }
- | PARENT { $$ = Axes.Parent; }
- | PRECEDING { $$ = Axes.Preceding; }
- | PRECEDING_SIBLING { $$ = Axes.PrecedingSibling; }
- | SELF { $$ = Axes.Self; }
- ;
-
-OptionalLiteral
- : /* empty */
- | LITERAL
- {
- $$ = $1;
- }
- ;
-
-QName
- : NCName
- {
- $$ = new NCName ((String) $1);
- }
- | NCName COLON NCName
- {
- $$ = new QName ((String) $1, (String) $3);
- }
- ;
-
-%%
- }
diff --git a/mcs/class/System.XML/System.Xml.XPath/Tokenizer.cs b/mcs/class/System.XML/System.Xml.XPath/Tokenizer.cs
deleted file mode 100644
index 6e2dea9f66b..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/Tokenizer.cs
+++ /dev/null
@@ -1,341 +0,0 @@
-//
-// System.Xml.XPath.Tokenizer
-//
-// Author:
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2002 Piers Haken
-//
-using System;
-using System.IO;
-using System.Text;
-using System.Collections;
-
-namespace System.Xml.XPath
-{
- internal class Tokenizer : yyParser.yyInput
- {
- private char [] m_rgchInput;
- private int m_ich;
- private int m_cch;
-// private System.IO.StreamReader m_input;
- private int m_iToken;
- private Object m_objToken;
- private static Hashtable m_mapTokens = new Hashtable ();
- private static readonly Object [] rgTokenMap =
- {
- Token.AND, "and",
- Token.OR, "or",
- Token.DIV, "div",
- Token.MOD, "mod",
- Token.ANCESTOR, "ancestor",
- Token.ANCESTOR_OR_SELF, "ancestor-or-self",
- Token.ATTRIBUTE, "attribute",
- Token.CHILD, "child",
- Token.DESCENDANT, "descendant",
- Token.DESCENDANT_OR_SELF, "descendant-or-self",
- Token.FOLLOWING, "following",
- Token.FOLLOWING_SIBLING, "following-sibling",
- Token.NAMESPACE, "namespace",
- Token.PARENT, "parent",
- Token.PRECEDING, "preceding",
- Token.PRECEDING_SIBLING, "preceding-sibling",
- Token.SELF, "self",
- Token.COMMENT, "comment",
- Token.TEXT, "text",
- Token.PROCESSING_INSTRUCTION, "processing-instruction",
- Token.NODE, "node",
- };
-
- static Tokenizer ()
- {
- for (int i = 0; i < rgTokenMap.Length; i += 2)
- m_mapTokens.Add (rgTokenMap [i + 1], rgTokenMap [i]);
- }
-
-/* public Tokenizer (StreamReader input)
- {
- m_input = input;
- SkipWhitespace ();
- }*/
- public Tokenizer (string strInput)
- {
- m_rgchInput = strInput.ToCharArray ();
- m_ich = 0;
- m_cch = strInput.Length;
- SkipWhitespace ();
- }
-
- private int Peek ()
- {
- if (m_ich >= m_cch)
- return -1;
- return m_rgchInput [m_ich];
- //return m_input.Peek ();
- }
-
- private int GetChar ()
- {
- if (m_ich >= m_cch)
- return -1;
- return m_rgchInput [m_ich++];
- //return m_input.Read ();
- }
-
- private void SkipWhitespace ()
- {
- while (IsWhitespace (Peek ()))
- GetChar ();
- }
-
- [MonoTODO]
- private int ParseNumber ()
- {
- StringBuilder sb = new StringBuilder ();
-
- while (IsDigit (Peek ()))
- sb.Append ((char) GetChar ());
-
- // TODO: doesn't handle '3.' error case
- if (Peek () == '.')
- {
- sb.Append ((char) GetChar ());
- while (IsDigit (Peek ()))
- sb.Append ((char) GetChar ());
- }
- m_objToken = Double.Parse (sb.ToString ());
- return Token.NUMBER;
- }
-
- private int ParseLiteral ()
- {
- StringBuilder sb = new StringBuilder ();
-
- int chInit = GetChar ();
- int ch;
- while ((ch = Peek ()) != chInit)
- {
- if (ch == -1)
- return Token.ERROR;
- sb.Append ((char) GetChar ());
- }
- GetChar ();
- m_objToken = sb.ToString ();
- return Token.LITERAL;
- }
-
- private int ParseIdentifier ()
- {
- StringBuilder sb = new StringBuilder ();
-
- while (true)
- {
- int ch = Peek ();
- if (ch == '_' ||
- (ch >= 'a' && ch <= 'z') ||
- (ch >= 'A' && ch <= 'Z'))
- {
- sb.Append ((char) GetChar ());
- }
- else
- break;
- }
- String strToken = sb.ToString ();
- Object objToken = m_mapTokens [strToken];
- if (objToken != null)
- {
- return (int) objToken;
- }
- else
- {
- m_objToken = strToken;
-
- SkipWhitespace ();
- if (Peek () == '(')
- return Token.FUNCTION_NAME;
- return Token.NCName;
- }
- }
-
- private static bool IsWhitespace (int ch)
- {
- return (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
- }
-
- private static bool IsDigit (int ch)
- {
- return ch >= '0' && ch <= '9';
- }
-
-
- int ParseToken ()
- {
-// while (IsWhitespace (Peek ()))
-// GetChar ();
- switch (Peek ())
- {
- case -1:
- return Token.EOF;
-
- case '/':
- GetChar ();
- if (Peek () == '/')
- {
- GetChar ();
- return Token.SLASH2;
- }
- return Token.SLASH;
-
- case '.':
- GetChar ();
- if (Peek () == '.')
- {
- GetChar ();
- return Token.DOT2;
- }
- else if (Peek () >= '0' && Peek () <= '9')
- {
- return ParseNumber ();
- }
- return Token.DOT;
-
- case ':':
- GetChar ();
- if (Peek () == ':')
- {
- GetChar ();
- return Token.COLON2;
- }
- return Token.COLON;
-
- case ',':
- GetChar ();
- return Token.COMMA;
-
- case '@':
- GetChar ();
- return Token.AT;
-
- case '[':
- GetChar ();
- return Token.BRACKET_OPEN;
-
- case ']':
- GetChar ();
- return Token.BRACKET_CLOSE;
-
- case '(':
- GetChar ();
- return Token.PAREN_OPEN;
-
- case ')':
- GetChar ();
- return Token.PAREN_CLOSE;
-
- case '+':
- GetChar ();
- return Token.PLUS;
-
- case '-':
- GetChar ();
- return Token.MINUS;
-
- case '*':
- GetChar ();
- return Token.ASTERISK;
-
- case '$':
- GetChar ();
- return Token.DOLLAR;
-
- case '|':
- GetChar ();
- return Token.BAR;
-
- case '=':
- GetChar ();
- return Token.EQ;
-
- case '!':
- GetChar ();
- if (Peek () == '=')
- {
- GetChar ();
- return Token.NE;
- }
- break;
-
- case '>':
- GetChar ();
- if (Peek () == '=')
- {
- GetChar ();
- return Token.GE;
- }
- return Token.GT;
-
- case '<':
- GetChar ();
- if (Peek () == '=')
- {
- GetChar ();
- return Token.LE;
- }
- return Token.LT;
-
- case '\'':
- return ParseLiteral ();
-
- case '\"':
- return ParseLiteral ();
-
- default:
- {
- if (IsDigit (Peek ()))
- {
- return ParseNumber ();
- }
- else
- {
- return ParseIdentifier ();
- }
- }
- }
- return Token.ERROR;
- }
-
- ///////////////////////////
- // yyParser.yyInput methods
- ///////////////////////////
-
- /** move on to next token.
- @return false if positioned beyond tokens.
- @throws IOException on input error.
- */
- public bool advance ()
- {
- m_objToken = null;
- m_iToken = ParseToken ();
- SkipWhitespace ();
- return (m_iToken != Token.EOF);
- }
-
- /** classifies current token.
- Should not be called if advance() returned false.
- @return current %token or single character.
- */
- public int token ()
- {
- return m_iToken;
- }
-
- /** associated with current token.
- Should not be called if advance() returned false.
- @return value for token().
- */
- public Object value ()
- {
- return m_objToken;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathDocument.cs b/mcs/class/System.XML/System.Xml.XPath/XPathDocument.cs
deleted file mode 100644
index c3b8c18401f..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathDocument.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Xml.XPath.XPathDocument
-//
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System.IO;
-
-namespace System.Xml.XPath
-{
- public class XPathDocument : IXPathNavigable
- {
- #region Constructors
-
- [MonoTODO]
- public XPathDocument (Stream stream)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XPathDocument (string uri)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XPathDocument (TextReader reader)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XPathDocument (XmlReader reader)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XPathDocument (string uri, XmlSpace space)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XPathDocument (XmlReader reader, XmlSpace space)
- {
- throw new NotImplementedException ();
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public XPathNavigator CreateNavigator ()
- {
- throw new NotImplementedException ();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathException.cs b/mcs/class/System.XML/System.Xml.XPath/XPathException.cs
deleted file mode 100644
index 4817111fd9b..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathException.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Xml.XPath.XPathException
-//
-// Author:
-// Tim Coleman (tim@timcoleman.com)
-//
-// (C) Copyright 2002 Tim Coleman
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Xml.XPath
-{
- [Serializable]
- public class XPathException : SystemException
- {
- #region Fields
-
- string message;
-
- #endregion
-
- #region Constructors
-
- [MonoTODO]
- protected XPathException (SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XPathException (string message, Exception innerException)
- {
- throw new NotImplementedException ();
- }
-
- #endregion
-
- #region Properties
-
- public override string Message {
- get { return message; }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathExpression.cs b/mcs/class/System.XML/System.Xml.XPath/XPathExpression.cs
deleted file mode 100644
index 4d525b36e02..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathExpression.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Xml.XPath.XPathExpression
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System.Collections;
-
-namespace System.Xml.XPath
-{
- public abstract class XPathExpression
- {
- #region Constructor
-
- internal XPathExpression ()
- {
- }
-
- #endregion
-
- #region Properties
-
- public abstract string Expression { get; }
-
- public abstract XPathResultType ReturnType { get; }
-
- #endregion
-
- #region Methods
-
- public abstract void AddSort (object expr, IComparer comparer);
-
- public abstract void AddSort (
- object expr,
- XmlSortOrder order,
- XmlCaseOrder caseOrder,
- string lang,
- XmlDataType dataType
- );
-
- public abstract XPathExpression Clone ();
-
- public abstract void SetContext (XmlNamespaceManager nsManager);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathNamespaceScope.cs b/mcs/class/System.XML/System.Xml.XPath/XPathNamespaceScope.cs
deleted file mode 100644
index 34a55e92662..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathNamespaceScope.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Xml.XPath.XPathNamespaceScope
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml.XPath
-{
- public enum XPathNamespaceScope
- {
- All = 0,
- ExcludeXml = 1,
- Local =2,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs b/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
deleted file mode 100644
index ee21e6da8e8..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// System.Xml.XPath.XPathNavigator
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-
-namespace System.Xml.XPath
-{
- public abstract class XPathNavigator : ICloneable
- {
- #region Constructor
-
- protected XPathNavigator ()
- {
- }
-
- #endregion
-
- #region Properties
-
- public abstract string BaseURI { get; }
-
- public abstract bool HasAttributes { get; }
-
- public abstract bool HasChildren { get; }
-
- public abstract bool IsEmptyElement { get; }
-
- public abstract string LocalName { get; }
-
- public abstract string Name { get; }
-
- public abstract string NamespaceURI { get; }
-
- public abstract XmlNameTable NameTable { get; }
-
- public abstract XPathNodeType NodeType { get; }
-
- public abstract string Prefix { get; }
-
- public abstract string Value { get; }
-
- public abstract string XmlLang { get; }
-
- #endregion
-
- #region Methods
-
- public abstract XPathNavigator Clone ();
-
- [MonoTODO]
- public virtual XmlNodeOrder ComparePosition (XPathNavigator nav)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XPathExpression Compile (string xpath)
- {
- Tokenizer tokenizer = new Tokenizer (xpath);
- XPathParser parser = new XPathParser ();
- Expression expr = (Expression) parser.yyparse (tokenizer);
- return new CompiledExpression (expr);
- }
-
- public virtual object Evaluate (string xpath)
- {
- return Evaluate (Compile (xpath));
- }
-
- public virtual object Evaluate (XPathExpression expr)
- {
- return Evaluate (expr, null);
- }
-
- [MonoTODO]
- public virtual object Evaluate (XPathExpression expr, XPathNodeIterator context)
- {
- // TODO: check casts
- if (context == null)
- context = new SelfIterator (this, new DefaultContext ());
- return ((CompiledExpression) expr).Evaluate ((BaseIterator) context);
- }
-
- public abstract string GetAttribute (string localName, string namespaceURI);
-
- public abstract string GetNamespace (string name);
-
- object ICloneable.Clone ()
- {
- return Clone ();
- }
-
- [MonoTODO]
- public virtual bool IsDescendant (XPathNavigator nav)
- {
- throw new NotImplementedException ();
- }
-
- public abstract bool IsSamePosition (XPathNavigator other);
-
- [MonoTODO]
- public virtual bool Matches (string xpath)
- {
- return Matches (Compile (xpath));
- }
-
- [MonoTODO]
- public virtual bool Matches (XPathExpression expr)
- {
- throw new NotImplementedException ();
- }
-
- public abstract bool MoveTo (XPathNavigator other);
-
- public abstract bool MoveToAttribute (string localName, string namespaceURI);
-
- public abstract bool MoveToFirst ();
-
- public abstract bool MoveToFirstAttribute ();
-
- public abstract bool MoveToFirstChild ();
-
- public bool MoveToFirstNamespace ()
- {
- return MoveToFirstNamespace (XPathNamespaceScope.All);
- }
-
- public abstract bool MoveToFirstNamespace (XPathNamespaceScope namespaceScope);
-
- public abstract bool MoveToId (string id);
-
- public abstract bool MoveToNamespace (string name);
-
- public abstract bool MoveToNext ();
-
- public abstract bool MoveToNextAttribute ();
-
- public bool MoveToNextNamespace ()
- {
- return MoveToNextNamespace (XPathNamespaceScope.All);
- }
-
- public abstract bool MoveToNextNamespace (XPathNamespaceScope namespaceScope);
-
- public abstract bool MoveToParent ();
-
- public abstract bool MoveToPrevious ();
-
- public abstract void MoveToRoot ();
-
- public virtual XPathNodeIterator Select (string xpath)
- {
- return Select (Compile (xpath));
- }
-
- [MonoTODO]
- public virtual XPathNodeIterator Select (XPathExpression expr)
- {
- BaseIterator iter = new SelfIterator (this, new DefaultContext ());
- return ((CompiledExpression) expr).EvaluateNodeSet (iter);
- }
-
- [MonoTODO]
- public virtual XPathNodeIterator SelectAncestors (XPathNodeType type, bool matchSelf)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XPathNodeIterator SelectAncestors (string name, string namespaceURI, bool matchSelf)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XPathNodeIterator SelectChildren (XPathNodeType type)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XPathNodeIterator SelectChildren (string name, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XPathNodeIterator SelectDescendants (XPathNodeType type, bool matchSelf)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XPathNodeIterator SelectDescendants (string name, string namespaceURI, bool matchSelf)
- {
- throw new NotImplementedException ();
- }
-
- public override string ToString ()
- {
- return Value;
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathNodeIterator.cs b/mcs/class/System.XML/System.Xml.XPath/XPathNodeIterator.cs
deleted file mode 100644
index 661b6564467..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathNodeIterator.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.Xml.XPath.XPathNodeIterator
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-
-namespace System.Xml.XPath
-{
- public abstract class XPathNodeIterator : ICloneable
- {
- private int _count;
-
- #region Constructor
-
- protected XPathNodeIterator ()
- {
- }
-
- #endregion
-
- #region Properties
-
- public virtual int Count
- {
- get
- {
- if (_count == 0)
- {
- // compute and cache the count
- XPathNodeIterator tmp = Clone ();
- while (tmp.MoveNext ())
- ;
- _count = tmp.CurrentPosition;
- }
- return _count;
- }
- }
-
- public abstract XPathNavigator Current { get; }
-
- public abstract int CurrentPosition { get; }
-
- #endregion
-
- #region Methods
-
- public abstract XPathNodeIterator Clone ();
-
- object ICloneable.Clone ()
- {
- return Clone ();
- }
-
- public abstract bool MoveNext ();
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathNodeType.cs b/mcs/class/System.XML/System.Xml.XPath/XPathNodeType.cs
deleted file mode 100644
index 22720f838be..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathNodeType.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Xml.XPath.XPathNodeType
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml.XPath
-{
- public enum XPathNodeType
- {
- Root = 0,
- Element = 1,
- Attribute = 2,
- Namespace = 3,
- Text = 4,
- SignificantWhitespace = 5,
- Whitespace = 6,
- ProcessingInstruction = 7,
- Comment = 8,
- All = 9,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XPathResultType.cs b/mcs/class/System.XML/System.Xml.XPath/XPathResultType.cs
deleted file mode 100644
index 9b1b481f840..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XPathResultType.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Xml.XPath.XPathResultType
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml.XPath
-{
- public enum XPathResultType
- {
- Number = 0,
- String = 1,
- Boolean = 2,
- NodeSet = 3,
- Navigator = 4, // [MonoTODO]
- Any = 5,
- Error = 6,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XmlCaseOrder.cs b/mcs/class/System.XML/System.Xml.XPath/XmlCaseOrder.cs
deleted file mode 100755
index 6e841b7467c..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XmlCaseOrder.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// XmlCaseOrder.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:47:03 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml.XPath {
-
-
- /// <summary>
- /// </summary>
- public enum XmlCaseOrder {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- UpperFirst = 1,
-
- /// <summary>
- /// </summary>
- LowerFirst = 2,
- } // XmlCaseOrder
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml.XPath/XmlDataType.cs b/mcs/class/System.XML/System.Xml.XPath/XmlDataType.cs
deleted file mode 100644
index 4b8c8ea44ae..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XmlDataType.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Xml.XPath.XmlDataType
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml.XPath
-{
- public enum XmlDataType
- {
- Text = 1,
- Number = 2,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.XPath/XmlSortOrder.cs b/mcs/class/System.XML/System.Xml.XPath/XmlSortOrder.cs
deleted file mode 100644
index 925aa15cd6c..00000000000
--- a/mcs/class/System.XML/System.Xml.XPath/XmlSortOrder.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Xml.XPath.XmlSortOrder
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml.XPath
-{
- public enum XmlSortOrder
- {
- Ascending = 1,
- Descending = 2,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/ChangeLog b/mcs/class/System.XML/System.Xml.Xsl/ChangeLog
deleted file mode 100644
index 4043d3a0744..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2002-06-23 Piers Haken <piersh@friskit.com>
-
- * XsltContext.cs: added 'PreserveWhitespace' abstract method
-
diff --git a/mcs/class/System.XML/System.Xml.Xsl/IXsltContextFunction.cs b/mcs/class/System.XML/System.Xml.Xsl/IXsltContextFunction.cs
deleted file mode 100644
index 4f2dc25efd0..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/IXsltContextFunction.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// System.Xml.Xsl.IXsltContextFunction
-//
-// Author: Tim Coleman <tim@timcoleman.com>
-// (C) Copyright 2002 Tim Coleman
-
-using System;
-using System.Xml.XPath;
-
-namespace System.Xml.Xsl
-{
- public interface IXsltContextFunction
- {
- #region Properties
-
- XPathResultType [] ArgTypes { get; }
- int Maxargs { get; }
- int Minargs { get; }
- XPathResultType ReturnType { get; }
-
- #endregion
-
- #region Methods
-
- object Invoke (XsltContext xsltContext, object [] args, XPathNavigator docContext);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/IXsltContextVariable.cs b/mcs/class/System.XML/System.Xml.Xsl/IXsltContextVariable.cs
deleted file mode 100644
index f1b4aa0f3b9..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/IXsltContextVariable.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// System.Xml.Xsl.IXsltContextVariable
-//
-// Author: Tim Coleman <tim@timcoleman.com>
-// (C) Copyright 2002 Tim Coleman
-
-using System;
-using System.Xml.XPath;
-
-namespace System.Xml.Xsl
-{
- public interface IXsltContextVariable
- {
- #region Properties
-
- bool IsLocal { get; }
- bool IsParam { get; }
- XPathResultType VariableType { get; }
-
- #endregion
-
- #region Methods
-
- object Evaluate (XsltContext xsltContext);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs b/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs
deleted file mode 100644
index b726178fdea..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/XslTransform.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-// System.Xml.Xsl.XslTransform
-//
-// Author: Tim Coleman <tim@timcoleman.com>
-// (C) Copyright 2002 Tim Coleman
-
-using System;
-using System.Xml.XPath;
-using System.IO;
-
-namespace System.Xml.Xsl
-{
- public class XslTransform
- {
- #region Fields
-
- XmlResolver xmlResolver;
-
- #endregion
-
- #region Constructors
-
- [MonoTODO]
- public XslTransform ()
- {
- }
-
- #endregion
-
- #region Properties
-
- XmlResolver XmlResolver {
- set { xmlResolver = value; }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- // Loads the XSLT stylesheet contained in the IXPathNavigable.
- public void Load (IXPathNavigable stylesheet)
- {
- }
-
- [MonoTODO]
- // Loads the XSLT stylesheet specified by a URL.
- public void Load (string url)
- {
- }
-
- [MonoTODO]
- // Loads the XSLT stylesheet contained in the XmlReader
- public void Load (XmlReader stylesheet)
- {
- }
-
- [MonoTODO]
- // Loads the XSLT stylesheet contained in the XPathNavigator
- public void Load (XPathNavigator stylesheet)
- {
- }
-
- [MonoTODO]
- // Loads the XSLT stylesheet contained in the IXPathNavigable.
- public void Load (IXPathNavigable stylesheet, XmlResolver resolver)
- {
- }
-
- [MonoTODO]
- // Loads the XSLT stylesheet specified by a URL.
- public void Load (string url, XmlResolver resolver)
- {
- }
-
- [MonoTODO]
- // Loads the XSLT stylesheet contained in the XmlReader
- public void Load (XmlReader stylesheet, XmlResolver resolver)
- {
- }
-
- [MonoTODO]
- // Loads the XSLT stylesheet contained in the XPathNavigator
- public void Load (XPathNavigator stylesheet, XmlResolver resolver)
- {
- }
-
- [MonoTODO]
- // Transforms the XML data in the IXPathNavigable using
- // the specified args and outputs the result to an XmlReader.
- public XmlReader Transform (IXPathNavigable input, XsltArgumentList args)
- {
- return null;
- }
-
- [MonoTODO]
- // Transforms the XML data in the input file and outputs
- // the result to an output file.
- public void Transform (string inputfile, string outputfile)
- {
- }
-
- [MonoTODO]
- // Transforms the XML data in the XPathNavigator using
- // the specified args and outputs the result to an XmlReader.
- public XmlReader Transform (XPathNavigator input, XsltArgumentList args)
- {
- return null;
- }
-
- [MonoTODO]
- // Transforms the XML data in the IXPathNavigable using
- // the specified args and outputs the result to a Stream.
- public void Transform (IXPathNavigable input, XsltArgumentList args, Stream output)
- {
- }
-
- [MonoTODO]
- // Transforms the XML data in the IXPathNavigable using
- // the specified args and outputs the result to a TextWriter.
- public void Transform (IXPathNavigable input, XsltArgumentList args, TextWriter output)
- {
- }
-
- [MonoTODO]
- // Transforms the XML data in the IXPathNavigable using
- // the specified args and outputs the result to an XmlWriter.
- public void Transform (IXPathNavigable input, XsltArgumentList args, XmlWriter output)
- {
- }
-
- [MonoTODO]
- // Transforms the XML data in the XPathNavigator using
- // the specified args and outputs the result to a Stream.
- public void Transform (XPathNavigator input, XsltArgumentList args, Stream output)
- {
- }
-
- [MonoTODO]
- // Transforms the XML data in the XPathNavigator using
- // the specified args and outputs the result to a TextWriter.
- public void Transform (XPathNavigator input, XsltArgumentList args, TextWriter output)
- {
- }
-
- [MonoTODO]
- // Transforms the XML data in the XPathNavigator using
- // the specified args and outputs the result to an XmlWriter.
- public void Transform (XPathNavigator input, XsltArgumentList args, XmlWriter output)
- {
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs
deleted file mode 100644
index e4ac3b138f0..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/XsltArgumentList.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-// System.Xml.Xsl.XsltArgumentList
-//
-// Author: Tim Coleman <tim@timcoleman.com>
-// (C) Copyright 2002 Tim Coleman
-
-using System;
-using System.Collections;
-using System.Xml;
-using System.Xml.XPath;
-
-namespace System.Xml.Xsl
-{
- public sealed class XsltArgumentList
- {
- #region Fields
-
- private Hashtable extensionObjects;
- private Hashtable parameters;
-
- #endregion
-
- #region Constructors
-
- public XsltArgumentList ()
- {
- extensionObjects = new Hashtable ();
- parameters = new Hashtable ();
- }
-
- #endregion
-
- #region Methods
-
- public void AddExtensionObject (string namespaceUri, object extension)
- {
- if (namespaceUri == null)
- throw new ArgumentException ("The namespaceUri is a null reference.");
- if (namespaceUri == "http://www.w3.org/1999/XSL/Transform")
- throw new ArgumentException ("The namespaceUri is http://www.w3.org/1999/XSL/Transform.");
- if (extensionObjects.Contains (namespaceUri))
- throw new ArgumentException ("The namespaceUri already has an extension object associated with it.");
-
- extensionObjects [namespaceUri] = extension;
- }
-
- public void AddParam (string name, string namespaceUri, object parameter)
- {
-
- if (namespaceUri == null)
- throw new ArgumentException ("The namespaceUri is a null reference.");
-
- if (namespaceUri == "http://www.w3.org/1999/XSL/Transform")
- throw new ArgumentException ("The namespaceUri is http://www.w3.org/1999/XSL/Transform.");
-
- if (name == null)
- throw new ArgumentException ("The parameter name is a null reference.");
-
-
- // TODO:
- // verify that the name is a valid name according to
- // the W3C XML specification
-
- XmlQualifiedName qName = new XmlQualifiedName (name, namespaceUri);
-
- if (parameters.Contains (qName))
- throw new ArgumentException ("The namespaceUri already has a parameter associated with it.");
-
- parameter = ValidateParam (parameter);
-
- parameters [qName] = parameter;
- }
-
- public void Clear ()
- {
- extensionObjects.Clear ();
- parameters.Clear ();
- }
-
- public object GetExtensionObject (string namespaceUri)
- {
- return extensionObjects [namespaceUri];
- }
-
- public object GetParam (string name, string namespaceUri)
- {
- if (name == null)
- throw (new ArgumentException ("The parameter name is a null reference."));
- if (namespaceUri == null)
- throw (new ArgumentException ("The namespaceUri is a null reference."));
-
- XmlQualifiedName qName = new XmlQualifiedName (name, namespaceUri);
- return parameters [qName];
- }
-
- public object RemoveExtensionObject (string namespaceUri)
- {
- object extensionObject = this.GetExtensionObject (namespaceUri);
- extensionObjects.Remove (namespaceUri);
- return extensionObject;
- }
-
- public object RemoveParam (string name, string namespaceUri)
- {
- XmlQualifiedName qName = new XmlQualifiedName (name, namespaceUri);
- object parameter = this.GetParam (name, namespaceUri);
- parameters.Remove (qName);
- return parameter;
- }
-
- private object ValidateParam (object parameter)
- {
- if (parameter is string) return parameter;
- if (parameter is bool) return parameter;
- if (parameter is double) return parameter;
- if (parameter is XPathNavigator) return parameter;
- if (parameter is XPathNodeIterator) return parameter;
-
- if (parameter is Int16) return (double) parameter;
- if (parameter is UInt16) return (double) parameter;
- if (parameter is Int32) return (double) parameter;
- if (parameter is Int64) return (double) parameter;
- if (parameter is UInt64) return (double) parameter;
- if (parameter is Single) return (double) parameter;
- if (parameter is decimal) return (double) parameter;
-
- return parameter.ToString ();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs
deleted file mode 100644
index 7cd4011b763..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/XsltCompileException.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// System.Xml.Xsl.XsltCompileException
-//
-// Author: Tim Coleman <tim@timcoleman.com>
-// (C) Copyright 2002 Tim Coleman
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Xml.Xsl
-{
- [Serializable]
- public class XsltCompileException : XsltException
- {
- #region Fields
-
- string message;
-
- #endregion
-
- #region Constructors
-
- [MonoTODO]
- protected XsltCompileException (SerializationInfo info, StreamingContext context )
- : base (info, context)
- {
- }
-
- [MonoTODO]
- // I don't think this base() call is right, but what
- // should the message be for XsltException?
- public XsltCompileException (Exception inner, String sourceUri, int lineNumber, int linePosition)
- : base (sourceUri, inner)
- {
- }
-
-
- #endregion
-
- #region Properties
-
- public override string Message {
- get { return message; }
- }
-
- #endregion
-
- #region Methods
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs
deleted file mode 100644
index b47822ae7a3..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/XsltContext.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// System.Xml.Xsl.XsltContext
-//
-// Author: Tim Coleman <tim@timcoleman.com>
-// (C) Copyright 2002 Tim Coleman
-
-using System;
-using System.Xml;
-using System.Xml.XPath;
-
-namespace System.Xml.Xsl
-{
- public abstract class XsltContext : XmlNamespaceManager
- {
- #region Constructors
-
- // should this really be calling new NameTable() in the
- // base() call?
- public XsltContext ()
- : base (new NameTable ())
- {
- }
-
- public XsltContext (NameTable table)
- : base (table)
- {
- }
-
- #endregion
-
- #region Properties
-
- public abstract bool Whitespace { get; }
- public abstract bool PreserveWhitespace (XPathNavigator nav);
-
- #endregion
-
- #region Methods
-
- public abstract int CompareDocument (string baseUri, string nextbaseUri);
- public abstract IXsltContextFunction ResolveFunction (string prefix, string name, XPathResultType [] ArgTypes);
- public abstract IXsltContextVariable ResolveVariable (string prefix, string name);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml.Xsl/XsltException.cs b/mcs/class/System.XML/System.Xml.Xsl/XsltException.cs
deleted file mode 100644
index 29e6adad0b6..00000000000
--- a/mcs/class/System.XML/System.Xml.Xsl/XsltException.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// System.Xml.Xsl.XsltException
-//
-// Author: Tim Coleman <tim@timcoleman.com>
-// (C) Copyright 2002 Tim Coleman
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Xml.Xsl
-{
- [Serializable]
- public class XsltException : SystemException
- {
- #region Fields
-
- string message;
- int lineNumber;
- int linePosition;
- string sourceUri;
-
- #endregion
-
- #region Constructors
-
- public XsltException (string message, Exception innerException)
- : base (message, innerException)
- {
- this.message = message;
- }
-
- protected XsltException (SerializationInfo info, StreamingContext context)
- {
- lineNumber = info.GetInt32 ("lineNumber");
- linePosition = info.GetInt32 ("linePosition");
- sourceUri = info.GetString ("sourceUri");
- }
-
- #endregion
-
- #region Properties
-
- public int LineNumber {
- get { return lineNumber; }
- }
-
- public int LinePosition {
- get { return linePosition; }
- }
-
- public override string Message {
- get { return message; }
- }
-
- public string SourceUri {
- get { return sourceUri; }
- }
-
- #endregion
-
- #region Methods
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("lineNumber", lineNumber);
- info.AddValue ("linePosition", linePosition);
- info.AddValue ("sourceUri", sourceUri);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
deleted file mode 100644
index 8e0760b7a9c..00000000000
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ /dev/null
@@ -1,637 +0,0 @@
-2002-06-23 Piers Haken <piersh@friskit.com>
-
- * XmlDocumentNavigator.cs: implement Clone()
- * XmlElement.cs: remove bogus unimplemented override of InnerText
- * XmlNode.cs: implment SelectNodes/SelectSingleNode
- * XmlNodeArrayList.cs: new support class for SelectNodes
-
-2002-06-21 Ajay kumar Dwivedi <adwiv@yahoo.com>
-
- * XmlQualifiedName: Name and Namespaces are never null. If null is passed
- to the constructor, set them to empty strings.
- Fixed the Operators.
-
-2002-06-18 Ajay kumar Dwivedi <adwiv@yahoo.com>
-
- * XmlTextReader.cs: HasLineInfo returns false instead of throwing an
- Exception.
-
-2002-06-14 Duncan Mak <duncan@ximian.com>
-
- * XmlConvert.cs: Added CLSCompliant attributes to methods.
-
-2002-06-12 Duncan Mak <duncan@ximian.com>
-
- * XmlCharacterData.cs (Value): Throw an ArgumentException in the
- set block if the node is read-only.
-
-2002-06-10 Ajay kumar Dwivedi <adwiv@yahoo.com>
- * XmlConstruct.cs : New Internal class with Helper methods for
- Checking XmlConstructs
- * XmlConvert.cs: Implemented most of the methods
-
-2002-06-08 Duncan Mak <duncan@ximian.com>
-
- * XmlDocument.cs (Load):
- Added bits to Load (string) for BaseURI support.
-
- * XmlAttribute.cs (BaseURI):
- * XmlDocument.cs (BaseURI):
- * XmlEntity.cs (BaseURI): Implemented.
-
-2002-05-27 Jason Diamond <jason@injektilo.org>
-
- * XmlDocumentNavigator.cs: Added file to directory.
-
- * XmlNode.cs (CreateNavigator): Implemented.
- (InnerText): Implemented.
-
- * XmlDocument.cs (NamespaceURI, Prefix): Return String.Empty instead of
- throwing exception.
- (Load(XmlReader)): Allow for namespace qualified attributes.
-
- * XmlElement.cs: Implemented GetAttribute(string, string) and both
- GetAttributeNode overloads.
- (SetAttributeNode(XmlAttribute)): Implemented.
-
- * XmlNamedNodeMap.cs: Fixed copy/paste bugs in GetNamedItem(string, string)
- and RemoveNamedItem(string, string).
-
- * XmlLinkedNode.cs (PreviousSibling): Implemented.
-
- * XmlTextReader.cs: Added code to maintain the order of attributes as
- they're parsed. XML doesn't require this but Microsoft's parser does it and
- matching them makes testing easier so now we have it, too.
-
-2002-05-26 Miguel de Icaza <miguel@ximian.com>
-
- * XmlDocument.cs: Implement the Save methods.
-
-2002-05-08 Mike Kestner <mkestner@speakeasy.net>
-
- * XmlNamedNodeMap.cs (SetNamedItem): Fixed a copy/paste bug.
-
-2002-04-28 Duncan Mak <duncan@ximian.com>
-
- * XmlSignificantWhitespace.cs (Value):
- * XmlWhitespace.cs (Value): Added MonoTODO to the 'set'
- block. Added new private method, IsValidWhitespaceChar, for
- checking.
-
-2002-04-16 Duncan Mak <duncan@ximian.com>
-
- * XmlParserContext.cs (NameTable): Fixed a typo in the set block.
-
-2002-04-12 Duncan Mak <duncan@ximian.com>
-
- * XmlAttribute.cs (Prefix): Added preliminary code for set block,
- added comment on work that needs to be done here. A new MonoTODO item.
-
- * XmlDocument.cs (ctor): Corrected constructor signature, changed
- parameter from 'NameTable' to 'XmlNameTable'.
-
- * XmlDocumentFragment.cs (InnerXml): Added missing set block.
-
- * XmlCaseOrder.cs: Moved to System.Xml.XPath.
-
-2002-04-10 Duncan Mak <duncan@ximian.com>
-
- * XmlNodeReader.cs: Initial stubs for the class.
-
-2002-04-08 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlAttributes.cs: InnerXml getter, WriteContentTo, and WriteTo
- implementations.
-
- * XmlDeclaration.cs: WriteTo implementation.
-
- * XmlDocument.cs: InnerXml getter implementation.
-
- * XmlElement.cs: InnerXml getter implementation.
-
- * XmlNode.cs: Removed MonoTODO attrib on OuterXml.
-
- * XmlSignificantWhitespace.cs: WriteTo implementation.
-
- * XmlText.cs: WriteContentTo and WriteTo implementation.
-
- * XmlTextWriter.cs: WriteRaw implementation.
-
- * XmlWhitespace.cs: WriteContentTo and WriteTo implementations.
-
-2002-04-05 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlAttributes.cs: Added reminder MonoTODO to set NamespaceURI
- if prefix in constructor is one of the default ones.
-
- * XmlCharacterData.cs: Returns String.Empty for Value and Data
- even when constructed with null.
-
- * XmlDeclaration.cs: Value doesn't put encoding or standalone
- in if they are empty.
-
- * XmlDocument.cs: Implemented CreateNode methods and this caused
- the changes in the other files in this checkin.
-
- * XmlProcessingInstruction.cs: Returns String.Empty for Value and Data
- even when constructed with null.
-
- * XmlWhitespace.cs: Changed Value 'get' to return Data.
-
-2002-04-01 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: Impls for WriteEndDocument and WriteFullEndElement.
-
-2002-03-31 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: Impls for LookupPrefix, WriteBase64,
- and WriteCharEntity.
-
- * XmlWrite.cs: Fixed bug where attribute namespace decl
- was pushing a scope onto the namespace manager when it shouldn't
- have been.
-
-2002-03-31 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: Some tweaks for WriteAttibuteString
- in different states (no open start element, in WriteState.Content mode).
-
-2002-03-29 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: XmlLang and XmlSpace properties
- and WriteWhitespace.
-
- * XmlTextWriterOpenElement.cs: scope support for XmlLang
- and XmlSpace.
-
-2002-03-29 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: Working on Attribute methods.
-
- * XmlWriter.cs: Working on Attribute methods.
-
-2002-03-28 Duncan Mak <duncan@ximian.com>
-
- * XmlDocument.cs (CreateWhitespace):
- (CreateSignificantWhitespace): Removed extraneous call to the ToCharArray
- method.
-
- * XmlSignificantWhitespace.cs (Value): Removed MonoTODO attribute.
-
-2002-03-26 Duncan Mak <duncan@ximian.com>
-
- * XmlDocument.cs (CreateDocumentType): Implemented.
-
- * XmlNode.cs (Value): Implemented.
-
- * XmlProcessingInstruction.cs (InnerText): Implemented. It works just
- like XmlCharacterData.
-
- * XmlDeclaration.cs (CloneNode):
- * XmlDocument.cs (CreateXmlDeclaration): Added missing constructor
- arguments.
-
- * XmlCharacterData.cs (InnerText): Implemented. Funny that the
- docs say it is the "The concatenated values of the node and all
- the children of the node.". I wrote some test programs and
- couldn't get any of the derived nodes to AppendChild. For now,
- InnerText == Data == Value.
- (Substring): Fixed typo.
-
- * XmlDeclaration.cs (XmlDeclaration): Fixed the constructor parameter signature.
-
- * XmlImplementation.cs (CreateDocument): Implemented.
-
-2002-03-25 Duncan Mak <duncan@ximian.com>
-
- * XmlDeclaration.cs: Rewrote the class, fixed formatting, added
- missing properties (InnerText, Value).
-
- * XmlDocument.cs (CreateXmlDeclaration): Implemented.
-
-2002-03-23 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: Impls for BaseStream and
- Namespaces and WriteState.
-
- * XmlWriter.cs: WriteState and WriteStartElementInternal.
-
-2002-03-23 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlNodeListChildren.cs: made class internal
- instead of public. Shouldn't be visible outside
- of System.Xml.
-
- * XmlTextWriter.cs: Implementations for Formatting,
- IndentChar, Indenting, QuoteChar, WriteStartDocument(standalone).
- Suppresses encoding on xml declaration if null stream passed in.
- Formats output including suppressing indentation for elements in
- mixed content mode.
-
- * XmlTextWriterOpenElement.cs: Initial checkin.
- XmlTextWriter uses stack of these objects to track
- state.
-
-2002-03-22 Mike Kestner <mkestner@speakeasy.net>
-
- * XmlElement.cs: impl HasAttribute(string name).
-
-2002-03-22 Duncan Mak <duncan@ximian.com>
-
- * XmlElement.cs: Reformatted.
- (CloneNode) Corrected.
-
- * XmlDocument.cs (CreateWhitespace):
- (CreateSignificantWhitespace): Implemented.
-
- * XmlAttribute.cs (CloneNode): Changed the child's CloneNode to
- true, because Attributes have ChildNodes.
-
-2002-03-21 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: WriteStartDocument tracks state, writes out
- xml declaration along with encoding. WriteEndElement throws
- exception if no WriteStartElement exists.
-
-2002-03-20 Duncan Mak <duncan@ximian.com>
-
- * XmlEntityReference.cs (CloneNode): Implemented.
-
- * XmlException.cs (Message): Implemented. We need to cache the
- message string because SystemException doesn't expose 'message'
- from Exception.
-
- * XmlText.cs (Value): Added in the missing Value property.
-
-2002-03-20 Duncan Mak <duncan@ximian.com>
-
- * XmlAttribute.cs (CloneNode): Implemented.
-
- * XmlDocumentFragment.cs (CloneNode): Implemented.
-
- * XmlElement.cs (CloneNode): Implemented.
-
-2002-03-19 Duncan Mak <duncan@ximian.com>
-
- * XmlNotation.cs: Added to CVS.
-
- * XmlAttribute.cs (CloneNode): First crack at the CloneNode method.
-
- * XmlCDataSection.cs (CloneNode): Implemented.
-
- * XmlDocumentFragment.cs: Reformatted and added the missing properties
- (InnerXml, OwnerDocument, ParentNode).
- (CloneNode): Implemented.
-
- * XmlSignificantWhitespace.cs (CloneNode): Implemented.
- (Value) Implemented the 'get' property.
-
- * XmlWhitespace.cs (Module): implemented.
-
-2002-03-19 Jason Diamond <jason@injektilo.org>
-
- * XmlDocument.cs: Fixed typo in Load that was duplicating the LocalName
- in the prefix.
-
-2002-03-18 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReader.cs: Don't restore properties after reading last
- attribute on an element.
-
- * XmlDocument.cs: Move back to element after reading attributes
- so that IsEmptyElement test succeeds.
-
-2002-03-18 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlNamespaceManager.cs: Implemented LookupPrefix.
-
- * XmlTextWriter.cs: Implemented namespace and prefix support.
-
-2002-03-18 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextReader.cs: Restores properties after
- reading last attribute on an element.
-
- * XmlNode.cs: AppendChild sets the parent
- on the child.
-
-2002-03-17 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlCDataSection.cs: Formatting, Implementation for WriteTo.
-
- * XmlComment.cs: Implementations for WriteTo and WriteContentTo.
-
- * XmlElement.cs: Fixed bug in WriteTo.
-
- * XmlProcessingInstruction.cs: Formatting.
-
- * XmlTextWriter.cs: Implementations for Close, WriteCData, WriteComment,
- fixes for WriteEndElement, WriteProcessingInstruction.
-
-2002-03-17 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlDocument.cs: Implementations for WriteTo() and WriteContentTo(),
- had Load() add PIs to the document, moved onXXX methods to alphabetical
- order in the file.
-
- * XmlElement.cs: Implementations for WriteTo() and WriteContentTo().
-
- * XmlNode.cs: Implementations for InnerXml Get and OuterXml.
-
- * XmlProcessingInstruction.cs: Implementations for WriteTo() and
- WriteContentTo().
-
- * XmlTextWriter.cs: Implementations for WriteEndElement,
- WriteProcessingInstruction, WriteStartElement, and WriteString.
-
- * XmlWriter.cs: Implemented WriteStartElement() methods.
-
-2002-03-15 Duncan Mak <duncan@ximian.com>
-
- * XmlEntity.cs: Added to CVS. Need to implement BaseURI and
- InnerText once I know what they do.
-
- * XmlDocumentType.cs (XmlDocumentType): Fix the constructor now
- that we can properly chain constructors.
- (CloneNode): implemented.
- (WriteContentTo): Removed MonoTODO attribute as this method has no
- effect in this class.
-
- * XmlProcessingInstruction.cs (Value): Added the missing Set
- block.
- (InnerText): Added in, but not implemented.
-
-2002-03-14 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriter.cs: implemented constructors and
- WriteCData and WriteComment.
-
-2002-03-14 Duncan Mak <duncan@ximian.com>
-
- * XmlDocument.cs: Moved the NodeChanged EventHandler to its own
- file, and updated the callbacks to reflect the change.
- (XmlDocument): Added the NameTable constructor.
- (NameTable): Also the NameTable property.
-
- * XmlNodeChangedEventHandler.cs: Added, replacing the version that
- was in XmlDocument.cs. It has two arguments now (object,
- EventArgs) , instead of one (object).
-
-2002-03-14 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlWriter.cs: Formatting.
-
- * XmlTextWriter.cs: Initial checkin.
-
-2002-03-14 Duncan Mak <duncan@ximian.com>
-
- * Validation.cs: Removed, replaced by ValidationType.cs.
-
- * ValidationType.cs: Added.
-
-2002-03-13 Duncan Mak <duncan@ximian.com>
-
- * XmlException.cs: Made it [Serializable], implemented good ol'
- GetObjectData, and the serialization constructor.
-
- * XmlNamedNodeMap.cs (SetNamedItem): Check for the Name property.
- (SetNamedItem): Reverted (added back in) the patch with the
- ReadOnly checks. "Don't doubt yourself, my son... you were right!"
-
- * XmlNamedNodeMap.cs (GetEnumerator): piggyback on the ArrayList implementation.
- (GetNamedItem (string, string)): implemented.
- (RemoveNamedItem): implemented.
- (SetNamedItem): implemented.
-
-2002-03-12 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlAttribute.cs: Moved a method from amongst properties down to
- it's alphabetical position in the methods section.
-
- * XmlNode.cs: Passes in 'this' to XmlNodeList constructor instead of
- last linked child. Set XmlNode base class to return false for IsReadOnly().
- Implemented GetEnumerator() and RemoveChild().
-
- * XmlNodeListChildren.cs: Now stores the parent instead of the last child.
- This is to support the behavior that the Enumerator doesn't become invalid
- when changes to the children occur. Flushed out rest of implementation for
- MoveNext, Current, and Reset.
-
-2002-03-12 Duncan Mak <duncan@ximian.com>
-
- * XmlCharacterData.cs: Reformatted the properties for better readability.
-
- * XmlLinkedNode.cs: Removed the awful boxy comments.
-
- * XmlNamedNodeMap.cs (Count):
- (Item): Implemented. Tests will be coming.
-
- * XmlEntityReference.cs:
- * XmlSignificantWhitespace.cs: Implemented these classes except for
- the Clone, WriteContentTo and WriteTo methods. Will have to
- investigate into these later.
-
-2002-03-11 Duncan Mak <duncan@ximian.com>
-
- * IHasXmlNode.cs: Added to CVS.
-
-2002-03-08 Jason Diamond <jason@injektilo.org>
-
- * XmlParserContext.cs: Added missing constructors and missing Encoding
- property.
-
- * XmlTextReader.cs: Start using the XmlParserContext class.
-
-2002-03-08 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReader.cs: Implemented MoveToElement and MoveToFirstAttribute.
-
-2002-03-08 Mike Kestner <mkestner@speakeasy.net>
-
- * XmlNode.cs (Item): Implemented both indexers.
-
-2002-03-08 Jason Diamond <jason@injektilo.org>
-
- * DomEncodingType.cs, TreePosition.cs, XPathNodeType.cs, XmlDataType.cs,
- XmlExceptionCode.cs, XmlSortOrder.cs, XmlUtil.cs: Removed files.
-
-2002-03-08 Jason Diamond <jason@injektilo.org>
-
- * XmlAttribute.cs: Attribute nodes are supposed to store their values
- as child nodes so updated to reflect that.
-
- * XmlDocument.cs, XmlElement.cs, XmlNode.cs: Moved code that was
- duplicated in XmlDocument and XmlElement into XmlNode so that it
- wouldn't have to be duplicated in XmlAttribute, too.
-
-2002-03-08 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlNodeList.cs, XmlDocument.cs, XmlLinkedNode.cs,
- XmlNode.cs: Formatting.
-
- * XmlNodeListChildren.cs: Implementation of XmlNodeList
- for XmlNode.ChildNodes property.
-
- * XmlNodeListAsArrayList.cs: Removed file. Using different
- data structure (circular list) in XmlNode so this file
- is no longer valid.
-
- * XmlDocument.cs, XmlElement.cs: New ChildNodes tests found
- bug in setter property of LastLinkedChild so fixed it.
-
-2002-03-06 Jason Diamond <jason@injektilo.org>
-
- * XmlInputSource.cs, XmlNames_1_0.cs, XmlParse.cs: Removed files.
- We already have a parser in XmlTextReader.
-
- * XmlException.cs: Removed constructor accepting XmlInputSource.
-
-2002-03-06 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlNode.cs: Rewrote this class from scratch with
- MonoToDo attribs and NotImplementedExceptions. Now defines an
- internal LastLinkedNode property to aid the new implementation.
- XmlNodes only have ref to owner doc and parent nodes now.
-
- * XmlLinkedNode.cs: Added NextLinkedSibling internal property
- and ref to next sibling to support walking our circular child
- node list.
-
- * XmlDocument.cs: Added ref to last child node and overrides
- XmlNode's internal LastLinkedChild property to support walking
- our circular child node list.
-
-2002-03-02 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlProcessingInstructions.cs: Class was empty. Implemented
- constructor, properties, and CloneNode() method. Put in
- MonoToDo attrib for remaining methods.
-
- * XmlComment.cs: Reformatted and put in MonoToDo attribs.
- Got rid of helper methods and fields since they were no
- longer needed.
-
- * XmlLinkedNode.cs: Reformatted and put in MonoToDo attribs.
-
- * XmlDocument.cs: Added code to Load(XmlReader) to create XmlComment,
- XmlCDataSection, and XmlProcessingInstruction nodes. Implemented
- Createxxx() methods for those three node types.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * XmlDocument.cs: Implemented the remaining CreateElement and
- CreateAttribute methods.
-
- * XmlAttribute.cs: Re-implemented.
-
- * XmlElement.cs: Set owner element on attributes. Reformatted.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReader.cs: Implemented MoveToNextAttribute().
-
- * XmlDocument.cs: Reformatted. Adding missing methods and MonoTODO
- attributes. Create attribute nodes while loading. Implemented
- Load(string) and CreateTextNode().
-
- * XmlCharacterData.cs, XmlText.cs: Re-implemented.
-
- * XmlCDataSection.cs, XmlComment.cs: Call correct constructor in
- XmlCharacterData.
-
- * XmlNamedNodeMap.cs, XmlAttributeCollection.cs: Stubbed out.
-
-2002-03-02 Mike Kestner <mkestner@speakeasy.net>
-
- * XmlAttribute.cs : Using fix.
- * XmlDocument.cs (CreateAttribute(String)): Implement.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * XmlNamespaceManager.cs: Atomize prefixes and namespaces strings in
- the name table.
-
-2002-02-28 Jason Diamond <jason@injektilo.org>
-
- * XmlDocument.cs, XmlNode.cs: Initial implementation of LoadXml
- courtesy of Kral Ferch <kral.ferch@hotmail.com>.
-
-2002-02-28 Jason Diamond <jason@injektilo.org>
-
- * XmlException.cs, XmlReader.cs, XmlTextReader.cs: Reformatted,
- added missing members and MonoTODO attributes.
-
- * XmlTextReader.cs: Throw XmlException instead of System.Exception.
-
-2002-02-27 Jason Diamond <jason@injektilo.org>
-
- * XmlElement.cs: Reformatted, added missing members and MonoTODO
- attributes.
-
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * XmlCDataSection.cs: Initial implementation.
-
- * NameTable.cs: Fixed the whole thing. Wrote a NUnit test to test
- it out. This should (hopefully) be correct.
-
-2002-02-26 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReader.cs: Apparently Microsoft's implementation treats
- namespace declarations as attributes so we do now, too.
-
- * XmlNamespaceManager.cs: HasNamespace fixed so that it only
- checks the current scope.
-
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * XmlDocumentType.cs: Added a few hacks here and there to
- temporarily fix the "I broke the build issue".
-
-2002-02-25 Jason Diamond <jason@injektilo.org>
-
- * XmlDocument.cs, XmlElement.cs, XmlNode.xs, XmlNodeList.cs,
- XmlNodeListAsArrayList.cs: Multiple fixes necessary to get
- simple test to pass. The existing code is really shitty so I'll
- probably start writing tests and refactoring before much else
- can get done.
-
-2002-02-25 Duncan Mak <duncan@ximian.com>
-
- * NameTable.cs: Implemented.
-
- * XmlDeclaration.cs: It should inherit from XmlLinkedNode, not XmlNode.
-
-2002-02-24 Duncan Mak <duncan@ximian.com>
-
- * XmlNodeOrder.cs: Added to CVS.
-
- * XmlQualifiedName.cs: Fixed a warning from Equals ().
-
- * XmlTokenizedType.cs: Added to CVS.
-
- * XmlUrlResolver.cs: Added to CVS with one TODO task.
-
-2002-02-23 Duncan Mak <duncan@ximian.com>
-
- * XmlQualifiedName.cs: Fixed ToString () and added the operators
- (== and !=).
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReader.cs: Added support for qualified attributes.
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * XmlNamespaceManager.cs: Initial implementation.
-
- * XmlTextReader.cs: Added support for NamespaceURI property on
- elements.
-
-2002-02-23 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * XmlQualifiedName.cs: Fixed compile errors so it would build. Still has
- MonoTODO's
-
diff --git a/mcs/class/System.XML/System.Xml/Driver.cs b/mcs/class/System.XML/System.Xml/Driver.cs
deleted file mode 100644
index 80f9cf32934..00000000000
--- a/mcs/class/System.XML/System.Xml/Driver.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// Driver.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Xml;
-
-public class Driver
-{
- public static void Main(string[] args)
- {
- XmlReader xmlReader = null;
-
- if (args.Length < 1)
- {
- xmlReader = new XmlTextReader(Console.In);
- }
- else
- {
- xmlReader = new XmlTextReader(args[0]);
- }
-
- while (xmlReader.Read())
- {
- Console.WriteLine("NodeType = {0}", xmlReader.NodeType);
- Console.WriteLine(" Name = {0}", xmlReader.Name);
- Console.WriteLine(" IsEmptyElement = {0}", xmlReader.IsEmptyElement);
- Console.WriteLine(" HasAttributes = {0}", xmlReader.HasAttributes);
- Console.WriteLine(" AttributeCount = {0}", xmlReader.AttributeCount);
- Console.WriteLine(" HasValue = {0}", xmlReader.HasValue);
- Console.WriteLine(" Value = {0}", xmlReader.Value);
- Console.WriteLine(" Depth = {0}", xmlReader.Depth);
-
- if (xmlReader.HasAttributes)
- {
- while (xmlReader.MoveToNextAttribute())
- {
- Console.WriteLine(" AttributeName = {0}", xmlReader.Name);
- Console.WriteLine(" AttributeValue = {0}", xmlReader.Value);
-
- while (xmlReader.ReadAttributeValue())
- {
- Console.WriteLine(" AttributeValueNodeType = {0}", xmlReader.NodeType);
- Console.WriteLine(" AttributeValueName = {0}", xmlReader.Name);
- Console.WriteLine(" AttributeValueValue = {0}", xmlReader.Value);
- }
- }
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/EntityHandling.cs b/mcs/class/System.XML/System.Xml/EntityHandling.cs
deleted file mode 100755
index c54b016b1e6..00000000000
--- a/mcs/class/System.XML/System.Xml/EntityHandling.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// EntityHandling.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:46:17 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum EntityHandling {
-
- /// <summary>
- /// </summary>
- ExpandEntities = 1,
-
- /// <summary>
- /// </summary>
- ExpandCharEntities = 2,
- } // EntityHandling
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/Formatting.cs b/mcs/class/System.XML/System.Xml/Formatting.cs
deleted file mode 100755
index 2586f58a04d..00000000000
--- a/mcs/class/System.XML/System.Xml/Formatting.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Formatting.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:31:21 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum Formatting {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Indented = 1,
- } // Formatting
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/IHasXmlNode.cs b/mcs/class/System.XML/System.Xml/IHasXmlNode.cs
deleted file mode 100755
index 6eaef10dcfa..00000000000
--- a/mcs/class/System.XML/System.Xml/IHasXmlNode.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Xml.IHasXmlNode.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public interface IHasXmlNode
- {
- XmlNode GetNode ();
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/IXmlLineInfo.cs b/mcs/class/System.XML/System.Xml/IXmlLineInfo.cs
deleted file mode 100644
index d49e1e93208..00000000000
--- a/mcs/class/System.XML/System.Xml/IXmlLineInfo.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Xml.IXmlLineInfo.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- public interface IXmlLineInfo
- {
- int LineNumber { get; }
- int LinePosition { get; }
-
- bool HasLineInfo();
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/NameTable.cs b/mcs/class/System.XML/System.Xml/NameTable.cs
deleted file mode 100755
index c8533218040..00000000000
--- a/mcs/class/System.XML/System.Xml/NameTable.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Xml.NameTable.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- public class NameTable : XmlNameTable
- {
- // Fields
- Hashtable table;
-
- // Constructor
- public NameTable ()
- : base ()
- {
- table = new Hashtable ();
- }
-
- // Method
- public override string Add (string key)
- {
- if (table.Contains (key))
- return (string) table [key];
- else {
- table.Add (key, key);
- return key;
- }
- }
-
- public override string Add (char[] key, int start, int len)
- {
- if (((0 > start) && (start >= key.Length))
- || ((0 > len) && (len >= key.Length - len)))
- throw new IndexOutOfRangeException ("The Index is out of range.");
-
- if (len == 0)
- return String.Empty;
-
- string item = new string (key, start, len);
-
- return Add (item);
- }
-
- public override string Get (string key)
- {
- if (! (table.Contains (key)))
- return null;
- else
- return (string) table [key];
-
- }
-
- public override string Get (char[] array, int offset, int length)
- {
- if (((0 > offset) && (offset >= array.Length))
- || ((0 > length) && (length >= array.Length - offset)))
- throw new IndexOutOfRangeException ("The Index is out of range.");
-
- if (length == 0)
- return String.Empty;
-
- string key = new string (array, offset, length);
-
- return Get (key);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/Profile.cs b/mcs/class/System.XML/System.Xml/Profile.cs
deleted file mode 100644
index d16049576d1..00000000000
--- a/mcs/class/System.XML/System.Xml/Profile.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// Profile.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Xml;
-
-using System.IO;
-using System.Text;
-
-public class Profile
-{
- public static void Main(string[] args)
- {
- XmlReader xmlReader = null;
-
- if (args.Length < 1)
- {
- xmlReader = new XmlTextReader(Console.In);
- }
- else
- {
- xmlReader = new XmlTextReader(args[0]);
- }
-
- int nodes = 0;
-
- DateTime start = DateTime.Now;
-
- while (xmlReader.Read())
- {
- ++nodes;
- }
-
- DateTime end = DateTime.Now;
-
- Console.WriteLine("time = {0}", end - start);
-
- Console.WriteLine("nodes = {0}", nodes);
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/ReadState.cs b/mcs/class/System.XML/System.Xml/ReadState.cs
deleted file mode 100644
index 6675af3990f..00000000000
--- a/mcs/class/System.XML/System.Xml/ReadState.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// ReadState.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:31:27 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum ReadState {
-
- /// <summary>
- /// </summary>
- Initial = 0,
-
- /// <summary>
- /// </summary>
- Interactive = 1,
-
- /// <summary>
- /// </summary>
- Error = 2,
-
- /// <summary>
- /// </summary>
- EndOfFile = 3,
-
- /// <summary>
- /// </summary>
- Closed = 4,
- } // ReadState
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/TODOAttribute.cs b/mcs/class/System.XML/System.Xml/TODOAttribute.cs
deleted file mode 100644
index 741cd760c1f..00000000000
--- a/mcs/class/System.XML/System.Xml/TODOAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Xml {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/ValidationType.cs b/mcs/class/System.XML/System.Xml/ValidationType.cs
deleted file mode 100755
index d746324e256..00000000000
--- a/mcs/class/System.XML/System.Xml/ValidationType.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// System.Xml.ValidationType.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Xml
-{
- public enum ValidationType
- {
- None = 0,
- Auto = 1,
- DTD = 2,
- XDR = 3,
- Schema = 4,
- }
-}
-
diff --git a/mcs/class/System.XML/System.Xml/WhitespaceHandling.cs b/mcs/class/System.XML/System.Xml/WhitespaceHandling.cs
deleted file mode 100644
index 8e9962b367e..00000000000
--- a/mcs/class/System.XML/System.Xml/WhitespaceHandling.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// WhitespaceHandling.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:31:33 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum WhitespaceHandling {
-
- /// <summary>
- /// </summary>
- All = 0,
-
- /// <summary>
- /// </summary>
- Significant = 1,
-
- /// <summary>
- /// </summary>
- None = 2,
- } // WhitespaceHandling
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/WriteState.cs b/mcs/class/System.XML/System.Xml/WriteState.cs
deleted file mode 100755
index 7d387708782..00000000000
--- a/mcs/class/System.XML/System.Xml/WriteState.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.WriteState
-//
-// Author:
-// Daniel Weber (daniel-weber@austin.rr.com)
-//
-// (C) 2001 Daniel Weber
-
-namespace System.Xml
-{
-
-
- /// <summary>
- /// </summary>
- public enum WriteState {
-
- /// <summary>
- /// A write method has not been called.
- /// </summary>
- Start = 0,
-
- /// <summary>
- /// The prolog is being written.
- /// </summary>
- Prolog = 1,
-
- /// <summary>
- /// An element start tag is being written.
- /// </summary>
- Element = 2,
-
- /// <summary>
- /// An attribute is being written.
- /// </summary>
- Attribute = 3,
-
- /// <summary>
- /// Element content is being written.
- /// </summary>
- Content = 4,
-
- /// <summary>
- /// The close method has been called.
- /// </summary>
- Closed = 5,
-
-
-
-
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlAttribute.cs b/mcs/class/System.XML/System.Xml/XmlAttribute.cs
deleted file mode 100644
index bc33caff479..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlAttribute.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-//
-// System.Xml.XmlAttribute
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlAttribute : XmlNode
- {
- #region Fields
-
- private XmlElement ownerElement;
- private XmlLinkedNode lastChild;
- private string localName;
- private string namespaceURI;
- private string prefix;
-
- #endregion
-
- #region Constructor
-
- [MonoTODO("need to set namespaceURI if prefix is recognized built-in ones like xmlns")]
- protected internal XmlAttribute (
- string prefix,
- string localName,
- string namespaceURI,
- XmlDocument doc) : base (doc)
- {
- this.prefix = prefix;
- this.localName = localName;
- this.namespaceURI = namespaceURI;
- }
-
- #endregion
-
- #region Properties
-
- public override string BaseURI {
- get {
- return ownerElement.BaseURI;
- }
- }
-
- [MonoTODO]
- public override string InnerText {
- get {
- throw new NotImplementedException ();
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO ("Setter.")]
- public override string InnerXml {
- get {
- // Not sure why this is an override. Passing through for now.
- return base.InnerXml;
- }
-
- set {
- throw new NotImplementedException ();
- }
- }
-
- public override string LocalName {
- get {
- return localName;
- }
- }
-
- public override string Name {
- get {
- return prefix != String.Empty ? prefix + ":" + localName : localName;
- }
- }
-
- public override string NamespaceURI {
- get {
- return namespaceURI;
- }
- }
-
- public override XmlNodeType NodeType {
- get {
- return XmlNodeType.Attribute;
- }
- }
-
- public override XmlDocument OwnerDocument {
- get {
- return base.OwnerDocument;
- }
- }
-
- public virtual XmlElement OwnerElement {
- get {
- return ownerElement;
- }
- }
-
- [MonoTODO]
- public override XmlNode ParentNode {
- get {
- return null;
- }
- }
-
- [MonoTODO]
- // We gotta do more in the set block here
- // We need to do the proper tests and throw
- // the correct Exceptions
- public override string Prefix {
- set {
- prefix = value;
- }
-
- get {
- return prefix;
- }
- }
-
- [MonoTODO]
- public virtual bool Specified {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public override string Value {
- get {
- XmlNode firstChild = FirstChild;
- if (firstChild == null)
- return String.Empty;
- return firstChild.Value;
- }
-
- set {
- XmlNode firstChild = FirstChild;
- if (firstChild == null)
- AppendChild (OwnerDocument.CreateTextNode (value));
- else
- firstChild.Value = value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public override XmlNode CloneNode (bool deep)
- {
- XmlNode node = new XmlAttribute (prefix, localName, namespaceURI,
- OwnerDocument);
- if (deep) {
- while ((node != null) && (node.HasChildNodes)) {
- AppendChild (node.NextSibling.CloneNode (true));
- node = node.NextSibling;
- }
- }
-
- return node;
- }
-
- internal void SetOwnerElement (XmlElement ownerElement)
- {
- this.ownerElement = ownerElement;
- }
-
- public override void WriteContentTo (XmlWriter w)
- {
- w.WriteString (Value);
- }
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteAttributeString (prefix, localName, namespaceURI, Value);
- }
-
- #endregion
-
- internal override XmlLinkedNode LastLinkedChild {
- get { return lastChild; }
-
- set { lastChild = value; }
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs b/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs
deleted file mode 100644
index 11bef65eaaa..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// System.Xml.XmlAttributeCollection
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- public class XmlAttributeCollection : XmlNamedNodeMap, ICollection
- {
- internal XmlAttributeCollection (XmlNode parent) : base (parent)
- {
- }
-
- bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- [System.Runtime.CompilerServices.IndexerName ("ItemOf")]
- public virtual XmlAttribute this [string name] {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- [System.Runtime.CompilerServices.IndexerName ("ItemOf")]
- public virtual XmlAttribute this [int i] {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- [System.Runtime.CompilerServices.IndexerName ("ItemOf")]
- public virtual XmlAttribute this [string localName, string namespaceURI] {
- get {
- throw new NotImplementedException ();
- }
- }
-
- object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public virtual XmlAttribute Append (XmlAttribute node)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void CopyTo (XmlAttribute [] array, int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void ICollection.CopyTo (Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute InsertAfter (XmlAttribute newNode, XmlAttribute refNode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute InsertBefore (XmlAttribute newNode, XmlAttribute refNode)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute Prepend (XmlAttribute node)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute Remove (XmlAttribute node)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void RemoveAll ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute RemoveAt (int i)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override XmlNode SetNamedItem (XmlNode node)
- {
- return base.SetNamedItem (node);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlCDataSection.cs b/mcs/class/System.XML/System.Xml/XmlCDataSection.cs
deleted file mode 100644
index fae85718883..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlCDataSection.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// System.Xml.XmlCDataSection.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlCDataSection : XmlCharacterData
- {
- #region Constructors
-
- protected internal XmlCDataSection (string data, XmlDocument doc)
- : base (data, doc)
- {
- }
-
- #endregion
-
- #region Properties
-
- public override string LocalName {
- get { return "#cdata-section"; }
- }
-
- public override string Name {
- get { return "#cdata-section"; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.CDATA; }
- }
-
- #endregion
-
- #region Methods
-
- public override XmlNode CloneNode (bool deep)
- {
- return new XmlCDataSection (Data, OwnerDocument); // CDATA nodes have no children.
- }
-
- public override void WriteContentTo (XmlWriter w) { }
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteCData (Data);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlChar.cs b/mcs/class/System.XML/System.Xml/XmlChar.cs
deleted file mode 100644
index 2ea00dd8572..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlChar.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlChar.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- internal class XmlChar
- {
- internal static bool IsWhitespace(int ch)
- {
- return ch == 0x20 || ch == 0x9 || ch == 0xD || ch == 0xA;
- }
-
- internal static bool IsFirstNameChar(int ch)
- {
- bool result = false;
-
- if (ch >= 0 && ch <= 0xFFFF)
- {
- result = (nameBitmap[(firstNamePages[ch >> 8] << 3) + ((ch & 0xFF) >> 5)] & (1 << (ch & 0x1F))) != 0;
- }
-
- return result;
- }
-
- internal static bool IsNameChar(int ch)
- {
- bool result = false;
-
- if (ch >= 0 && ch <= 0xFFFF)
- {
- result = (nameBitmap[(namePages[ch >> 8] << 3) + ((ch & 0xFF) >> 5)] & (1 << (ch & 0x1F))) != 0;
- }
-
- return result;
- }
-
- private static byte[] firstNamePages =
- {
- 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
- 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
- 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- private static byte[] namePages =
- {
- 0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
- 0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
- 0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
- 0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
-
- private static uint[] nameBitmap =
- {
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
- 0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
- 0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
- 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
- 0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
- 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
- 0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
- 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
- 0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
- 0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
- 0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
- 0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
- 0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
- 0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
- 0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
- 0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
- 0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
- 0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
- 0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
- 0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
- 0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
- 0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
- 0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
- 0x40000000, 0xF580C900, 0x00000007, 0x02010800,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
- 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
- 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
- 0x00000000, 0x00004C40, 0x00000000, 0x00000000,
- 0x00000007, 0x00000000, 0x00000000, 0x00000000,
- 0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
- 0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
- 0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
- 0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
- 0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
- 0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
- 0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
- 0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
- 0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
- 0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
- 0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
- 0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
- 0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
- 0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
- 0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
- 0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
- 0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
- 0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
- 0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
- 0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
- 0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
- 0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
- 0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
- 0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
- 0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
- 0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
- 0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
- 0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
- 0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
- 0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF
- };
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlCharacterData.cs b/mcs/class/System.XML/System.Xml/XmlCharacterData.cs
deleted file mode 100644
index bdd3612bb6c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlCharacterData.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// System.Xml.XmlCharacterData.cs
-//
-// Author:
-// Jason Diamond <jason@injektilo.org>
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-
-namespace System.Xml
-{
- public abstract class XmlCharacterData : XmlLinkedNode
- {
- private string data;
-
- #region Constructor
-
- protected internal XmlCharacterData (string data, XmlDocument doc)
- : base (doc)
- {
- if (data == null)
- data = String.Empty;
-
- this.data = data;
- }
-
- #endregion
-
- #region Properties
-
- public virtual string Data {
- get { return data; }
-
- set { data = value; }
- }
-
- public override string InnerText {
- get { return data; }
-
- set { data = value; }
- }
-
- public virtual int Length {
- get { return data != null ? data.Length : 0; }
- }
-
- public override string Value {
- get { return data; }
-
- set {
- if (IsReadOnly)
- throw new ArgumentException ("Node is read-only.");
-
- data = value;
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public virtual void AppendData (string strData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void DeleteData (int offset, int count)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void InsertData (int offset, string strData)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ReplaceData (int offset, int count, string strData)
- {
- throw new NotImplementedException();
- }
-
- public virtual string Substring (int offset, int count)
- {
- return data.Substring (offset, count);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlComment.cs b/mcs/class/System.XML/System.Xml/XmlComment.cs
deleted file mode 100644
index 4c83ebab0e6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlComment.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Xml.XmlComment
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlComment : XmlCharacterData
- {
- #region Constructors
-
- protected internal XmlComment (string comment, XmlDocument doc)
- : base (comment, doc)
- {
- }
-
- #endregion
-
- #region Properties
-
- public override string LocalName {
- get { return "#comment"; }
- }
-
- public override string Name {
- get { return "#comment"; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.Comment; }
- }
-
- #endregion
-
- #region Methods
-
- public override XmlNode CloneNode (bool deep)
- {
- // discard deep because Comments have no children.
- return new XmlComment(Value, OwnerDocument);
- }
-
- public override void WriteContentTo (XmlWriter w) { }
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteComment (Data);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlConstructs.cs b/mcs/class/System.XML/System.Xml/XmlConstructs.cs
deleted file mode 100755
index 7f23eba5e44..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlConstructs.cs
+++ /dev/null
@@ -1,545 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// http://www.w3.org/TR/REC-xml
- /// </summary>
- /// <remarks>
- /// Includes code and Ideas from org.apache.xerces.util.XMLChar class of Xerces 2.0.1
- /// However, No surrogate support is included in this class.
- /// This class is currently public. Make it internal after testing completes
- /// </remarks>
- public class XmlConstructs
- {
- /** Character flags. */
- internal static byte[] CHARS = new byte[1 << 16];
-
- /** Valid character mask. */
- internal static int VALID = 0x01;
-
- /** Space character mask. */
- internal static int SPACE = 0x02;
-
- /** Name start character mask. */
- internal static int NAME_START = 0x04;
-
- /** Name character mask. */
- internal static int NAME = 0x08;
-
- /** Pubid character mask. */
- internal static int PUBID = 0x10;
- /**
- * Content character mask. Special characters are those that can
- * be considered the start of markup, such as '&lt;' and '&amp;'.
- * The various newline characters are considered special as well.
- * All other valid XML characters can be considered content.
- * <p>
- * This is an optimization for the inner loop of character scanning.
- */
- internal static int CONTENT = 0x20;
-
- /** NCName start character mask. */
- internal static int NCNAME_START = 0x40;
-
- /** NCName character mask. */
- internal static int NCNAME = 0x80;
-
- static XmlConstructs()
- {
- //
- // [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] |
- // [#xE000-#xFFFD] | [#x10000-#x10FFFF]
- //
- int[] charRange = {
- 0x0009, 0x000A, 0x000D, 0x000D, 0x0020, 0xD7FF, 0xE000, 0xFFFD,
- };
-
- //
- // [3] S ::= (#x20 | #x9 | #xD | #xA)+
- //
- int[] spaceChar = {
- 0x0020, 0x0009, 0x000D, 0x000A,
- };
-
- //
- // [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
- // CombiningChar | Extender
- //
- int[] nameChar = {
- 0x002D, 0x002E, // '-' and '.'
- };
-
- //
- // [5] Name ::= (Letter | '_' | ':') (NameChar)*
- //
-
- int[] nameStartChar = {
- 0x003A, 0x005F, // ':' and '_'
- };
-
- //
- // [13] PubidChar ::= #x20 | 0xD | 0xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
- //
-
- int[] pubidChar = {
- 0x000A, 0x000D, 0x0020, 0x0021, 0x0023, 0x0024, 0x0025, 0x003D,
- 0x005F
- };
-
- int[] pubidRange = {
- 0x0027, 0x003B, 0x003F, 0x005A, 0x0061, 0x007A
- };
-
- //
- // [84] Letter ::= BaseChar | Ideographic
- //
-
- int[] letterRange = {
- // BaseChar
- 0x0041, 0x005A, 0x0061, 0x007A, 0x00C0, 0x00D6, 0x00D8, 0x00F6,
- 0x00F8, 0x0131, 0x0134, 0x013E, 0x0141, 0x0148, 0x014A, 0x017E,
- 0x0180, 0x01C3, 0x01CD, 0x01F0, 0x01F4, 0x01F5, 0x01FA, 0x0217,
- 0x0250, 0x02A8, 0x02BB, 0x02C1, 0x0388, 0x038A, 0x038E, 0x03A1,
- 0x03A3, 0x03CE, 0x03D0, 0x03D6, 0x03E2, 0x03F3, 0x0401, 0x040C,
- 0x040E, 0x044F, 0x0451, 0x045C, 0x045E, 0x0481, 0x0490, 0x04C4,
- 0x04C7, 0x04C8, 0x04CB, 0x04CC, 0x04D0, 0x04EB, 0x04EE, 0x04F5,
- 0x04F8, 0x04F9, 0x0531, 0x0556, 0x0561, 0x0586, 0x05D0, 0x05EA,
- 0x05F0, 0x05F2, 0x0621, 0x063A, 0x0641, 0x064A, 0x0671, 0x06B7,
- 0x06BA, 0x06BE, 0x06C0, 0x06CE, 0x06D0, 0x06D3, 0x06E5, 0x06E6,
- 0x0905, 0x0939, 0x0958, 0x0961, 0x0985, 0x098C, 0x098F, 0x0990,
- 0x0993, 0x09A8, 0x09AA, 0x09B0, 0x09B6, 0x09B9, 0x09DC, 0x09DD,
- 0x09DF, 0x09E1, 0x09F0, 0x09F1, 0x0A05, 0x0A0A, 0x0A0F, 0x0A10,
- 0x0A13, 0x0A28, 0x0A2A, 0x0A30, 0x0A32, 0x0A33, 0x0A35, 0x0A36,
- 0x0A38, 0x0A39, 0x0A59, 0x0A5C, 0x0A72, 0x0A74, 0x0A85, 0x0A8B,
- 0x0A8F, 0x0A91, 0x0A93, 0x0AA8, 0x0AAA, 0x0AB0, 0x0AB2, 0x0AB3,
- 0x0AB5, 0x0AB9, 0x0B05, 0x0B0C, 0x0B0F, 0x0B10, 0x0B13, 0x0B28,
- 0x0B2A, 0x0B30, 0x0B32, 0x0B33, 0x0B36, 0x0B39, 0x0B5C, 0x0B5D,
- 0x0B5F, 0x0B61, 0x0B85, 0x0B8A, 0x0B8E, 0x0B90, 0x0B92, 0x0B95,
- 0x0B99, 0x0B9A, 0x0B9E, 0x0B9F, 0x0BA3, 0x0BA4, 0x0BA8, 0x0BAA,
- 0x0BAE, 0x0BB5, 0x0BB7, 0x0BB9, 0x0C05, 0x0C0C, 0x0C0E, 0x0C10,
- 0x0C12, 0x0C28, 0x0C2A, 0x0C33, 0x0C35, 0x0C39, 0x0C60, 0x0C61,
- 0x0C85, 0x0C8C, 0x0C8E, 0x0C90, 0x0C92, 0x0CA8, 0x0CAA, 0x0CB3,
- 0x0CB5, 0x0CB9, 0x0CE0, 0x0CE1, 0x0D05, 0x0D0C, 0x0D0E, 0x0D10,
- 0x0D12, 0x0D28, 0x0D2A, 0x0D39, 0x0D60, 0x0D61, 0x0E01, 0x0E2E,
- 0x0E32, 0x0E33, 0x0E40, 0x0E45, 0x0E81, 0x0E82, 0x0E87, 0x0E88,
- 0x0E94, 0x0E97, 0x0E99, 0x0E9F, 0x0EA1, 0x0EA3, 0x0EAA, 0x0EAB,
- 0x0EAD, 0x0EAE, 0x0EB2, 0x0EB3, 0x0EC0, 0x0EC4, 0x0F40, 0x0F47,
- 0x0F49, 0x0F69, 0x10A0, 0x10C5, 0x10D0, 0x10F6, 0x1102, 0x1103,
- 0x1105, 0x1107, 0x110B, 0x110C, 0x110E, 0x1112, 0x1154, 0x1155,
- 0x115F, 0x1161, 0x116D, 0x116E, 0x1172, 0x1173, 0x11AE, 0x11AF,
- 0x11B7, 0x11B8, 0x11BC, 0x11C2, 0x1E00, 0x1E9B, 0x1EA0, 0x1EF9,
- 0x1F00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, 0x1F48, 0x1F4D,
- 0x1F50, 0x1F57, 0x1F5F, 0x1F7D, 0x1F80, 0x1FB4, 0x1FB6, 0x1FBC,
- 0x1FC2, 0x1FC4, 0x1FC6, 0x1FCC, 0x1FD0, 0x1FD3, 0x1FD6, 0x1FDB,
- 0x1FE0, 0x1FEC, 0x1FF2, 0x1FF4, 0x1FF6, 0x1FFC, 0x212A, 0x212B,
- 0x2180, 0x2182, 0x3041, 0x3094, 0x30A1, 0x30FA, 0x3105, 0x312C,
- 0xAC00, 0xD7A3,
- // Ideographic
- 0x3021, 0x3029, 0x4E00, 0x9FA5,
- };
- int[] letterChar = {
- // BaseChar
- 0x0386, 0x038C, 0x03DA, 0x03DC, 0x03DE, 0x03E0, 0x0559, 0x06D5,
- 0x093D, 0x09B2, 0x0A5E, 0x0A8D, 0x0ABD, 0x0AE0, 0x0B3D, 0x0B9C,
- 0x0CDE, 0x0E30, 0x0E84, 0x0E8A, 0x0E8D, 0x0EA5, 0x0EA7, 0x0EB0,
- 0x0EBD, 0x1100, 0x1109, 0x113C, 0x113E, 0x1140, 0x114C, 0x114E,
- 0x1150, 0x1159, 0x1163, 0x1165, 0x1167, 0x1169, 0x1175, 0x119E,
- 0x11A8, 0x11AB, 0x11BA, 0x11EB, 0x11F0, 0x11F9, 0x1F59, 0x1F5B,
- 0x1F5D, 0x1FBE, 0x2126, 0x212E,
- // Ideographic
- 0x3007,
- };
-
- //
- // [87] CombiningChar ::= ...
- //
-
- int[] combiningCharRange = {
- 0x0300, 0x0345, 0x0360, 0x0361, 0x0483, 0x0486, 0x0591, 0x05A1,
- 0x05A3, 0x05B9, 0x05BB, 0x05BD, 0x05C1, 0x05C2, 0x064B, 0x0652,
- 0x06D6, 0x06DC, 0x06DD, 0x06DF, 0x06E0, 0x06E4, 0x06E7, 0x06E8,
- 0x06EA, 0x06ED, 0x0901, 0x0903, 0x093E, 0x094C, 0x0951, 0x0954,
- 0x0962, 0x0963, 0x0981, 0x0983, 0x09C0, 0x09C4, 0x09C7, 0x09C8,
- 0x09CB, 0x09CD, 0x09E2, 0x09E3, 0x0A40, 0x0A42, 0x0A47, 0x0A48,
- 0x0A4B, 0x0A4D, 0x0A70, 0x0A71, 0x0A81, 0x0A83, 0x0ABE, 0x0AC5,
- 0x0AC7, 0x0AC9, 0x0ACB, 0x0ACD, 0x0B01, 0x0B03, 0x0B3E, 0x0B43,
- 0x0B47, 0x0B48, 0x0B4B, 0x0B4D, 0x0B56, 0x0B57, 0x0B82, 0x0B83,
- 0x0BBE, 0x0BC2, 0x0BC6, 0x0BC8, 0x0BCA, 0x0BCD, 0x0C01, 0x0C03,
- 0x0C3E, 0x0C44, 0x0C46, 0x0C48, 0x0C4A, 0x0C4D, 0x0C55, 0x0C56,
- 0x0C82, 0x0C83, 0x0CBE, 0x0CC4, 0x0CC6, 0x0CC8, 0x0CCA, 0x0CCD,
- 0x0CD5, 0x0CD6, 0x0D02, 0x0D03, 0x0D3E, 0x0D43, 0x0D46, 0x0D48,
- 0x0D4A, 0x0D4D, 0x0E34, 0x0E3A, 0x0E47, 0x0E4E, 0x0EB4, 0x0EB9,
- 0x0EBB, 0x0EBC, 0x0EC8, 0x0ECD, 0x0F18, 0x0F19, 0x0F71, 0x0F84,
- 0x0F86, 0x0F8B, 0x0F90, 0x0F95, 0x0F99, 0x0FAD, 0x0FB1, 0x0FB7,
- 0x20D0, 0x20DC, 0x302A, 0x302F,
- };
-
- int[] combiningCharChar = {
- 0x05BF, 0x05C4, 0x0670, 0x093C, 0x094D, 0x09BC, 0x09BE, 0x09BF,
- 0x09D7, 0x0A02, 0x0A3C, 0x0A3E, 0x0A3F, 0x0ABC, 0x0B3C, 0x0BD7,
- 0x0D57, 0x0E31, 0x0EB1, 0x0F35, 0x0F37, 0x0F39, 0x0F3E, 0x0F3F,
- 0x0F97, 0x0FB9, 0x20E1, 0x3099, 0x309A,
- };
-
- //
- // [88] Digit ::= ...
- //
-
- int[] digitRange = {
- 0x0030, 0x0039, 0x0660, 0x0669, 0x06F0, 0x06F9, 0x0966, 0x096F,
- 0x09E6, 0x09EF, 0x0A66, 0x0A6F, 0x0AE6, 0x0AEF, 0x0B66, 0x0B6F,
- 0x0BE7, 0x0BEF, 0x0C66, 0x0C6F, 0x0CE6, 0x0CEF, 0x0D66, 0x0D6F,
- 0x0E50, 0x0E59, 0x0ED0, 0x0ED9, 0x0F20, 0x0F29,
- };
-
- //
- // [89] Extender ::= ...
- //
-
- int[] extenderRange = {
- 0x3031, 0x3035, 0x309D, 0x309E, 0x30FC, 0x30FE,
- };
-
- int[] extenderChar = {
- 0x00B7, 0x02D0, 0x02D1, 0x0387, 0x0640, 0x0E46, 0x0EC6, 0x3005,
- };
-
- //
- // SpecialChar ::= '<', '&', '\n', '\r', ']'
- //
-
- int[] specialChar = {
- '<', '&', '\n', '\r', ']',
- };
-
- //
- // Initialize
- //
-
- // set valid characters
- for (int i = 0; i < charRange.Length; i += 2)
- {
- for (int j = charRange[i]; j <= charRange[i + 1]; j++)
- {
- CHARS[j] = (byte)(CHARS[j] | VALID | CONTENT);
- }
- }
-
- // remove special characters
- for (int i = 0; i < specialChar.Length; i++)
- {
- CHARS[specialChar[i]] = (byte)(CHARS[specialChar[i]] & ~CONTENT);
- }
-
- // set space characters
- for (int i = 0; i < spaceChar.Length; i++)
- {
- CHARS[spaceChar[i]] = (byte)(CHARS[spaceChar[i]] | SPACE);
- }
-
- // set name start characters
- for (int i = 0; i < nameStartChar.Length; i++)
- {
- CHARS[nameStartChar[i]] = (byte)(CHARS[nameStartChar[i]] | NAME_START | NAME |
- NCNAME_START | NCNAME);
- }
- for (int i = 0; i < letterRange.Length; i += 2)
- {
- for (int j = letterRange[i]; j <= letterRange[i + 1]; j++)
- {
- CHARS[j] = (byte)(CHARS[j] | NAME_START | NAME | NCNAME_START | NCNAME);
- }
- }
- for (int i = 0; i < letterChar.Length; i++)
- {
- CHARS[letterChar[i]] = (byte)(CHARS[letterChar[i]] | NAME_START | NAME |
- NCNAME_START | NCNAME);
- }
-
- // set name characters
- for (int i = 0; i < nameChar.Length; i++)
- {
- CHARS[nameChar[i]] = (byte)(CHARS[nameChar[i]] | NAME | NCNAME);
- }
- for (int i = 0; i < digitRange.Length; i += 2)
- {
- for (int j = digitRange[i]; j <= digitRange[i + 1]; j++)
- {
- CHARS[j] = (byte)(CHARS[j] | NAME | NCNAME);
- }
- }
- for (int i = 0; i < combiningCharRange.Length; i += 2)
- {
- for (int j = combiningCharRange[i]; j <= combiningCharRange[i + 1]; j++)
- {
- CHARS[j] = (byte)(CHARS[j] | NAME | NCNAME);
- }
- }
- for (int i = 0; i < combiningCharChar.Length; i++)
- {
- CHARS[combiningCharChar[i]] = (byte)(CHARS[combiningCharChar[i]] | NAME | NCNAME);
- }
- for (int i = 0; i < extenderRange.Length; i += 2)
- {
- for (int j = extenderRange[i]; j <= extenderRange[i + 1]; j++)
- {
- CHARS[j] = (byte)(CHARS[j] | NAME | NCNAME);
- }
- }
- for (int i = 0; i < extenderChar.Length; i++)
- {
- CHARS[extenderChar[i]] = (byte)(CHARS[extenderChar[i]] | NAME | NCNAME);
- }
-
- // remove ':' from allowable NCNAME_START and NCNAME chars
- CHARS[':'] = (byte)(CHARS[':'] & ~(NCNAME_START | NCNAME));
-
- // set Pubid characters
- for (int i = 0; i < pubidChar.Length; i++)
- {
- CHARS[pubidChar[i]] = (byte)(CHARS[pubidChar[i]] | PUBID);
- }
- for (int i = 0; i < pubidRange.Length; i += 2)
- {
- for (int j = pubidRange[i]; j <= pubidRange[i + 1]; j++)
- {
- CHARS[j] = (byte)(CHARS[j] | PUBID);
- }
- }
- }
-
- private XmlConstructs()
- {
- }
-
-
- //Static Methods
-
- /// <summary>
- /// Returns true if the specified character is valid.
- /// </summary>
- /// <param name="c">The character to check.</param>
- public static bool IsValid(char c)
- {
- return (CHARS[c] & VALID) != 0;
- }
-
- /// <summary>
- /// Returns true if the specified character is invalid.
- /// </summary>
- /// <param name="c">The character to check.</param>
- public static bool IsInvalid(char c)
- {
- return !IsValid(c);
- }
-
- /// <summary>
- /// Returns true if the specified character can be considered content.
- /// </summary>
- /// <param name="c">The character to check.</param>
- public static bool IsContent(char c)
- {
- return (CHARS[c] & CONTENT) != 0;
- }
-
- /// <summary>
- /// Returns true if the specified character can be considered markup.
- /// Markup characters include '&lt;', '&amp;', and '%'.
- /// </summary>
- /// <param name="c">The character to check.</param>
- public static bool IsMarkup(char c)
- {
- return c == '<' || c == '&' || c == '%';
- }
-
- /// <summary>
- /// Returns true if the specified character is a space character
- /// as defined by production [3] in the XML 1.0 specification.
- /// </summary>
- /// <param name="c">The character to check.</param>
- /// <returns></returns>
- public static bool IsSpace(char c)
- {
- return (CHARS[c] & SPACE) != 0;
- }
-
- /// <summary>
- /// Returns true if the specified character is a valid name start
- /// character as defined by production [5] in the XML 1.0 specification.
- /// </summary>
- /// <param name="c">The character to check.</param>
- public static bool IsNameStart(char c)
- {
- return (CHARS[c] & NAME_START) != 0;
- }
-
- /// <summary>
- /// Returns true if the specified character is a valid name
- /// character as defined by production [4] in the XML 1.0 specification.
- /// </summary>
- /// <param name="c">The character to check.</param>
- public static bool IsName(char c)
- {
- return (CHARS[c] & NAME) != 0;
- }
-
- /// <summary>
- /// Returns true if the specified character is a valid NCName start
- /// character as defined by production [4] in Namespaces in XML
- /// recommendation.
- /// </summary>
- /// <param name="c">The character to check.</param>
- /// <returns></returns>
- public static bool IsNCNameStart(char c)
- {
- return (CHARS[c] & NCNAME_START) != 0;
- }
-
- /// <summary>
- /// Returns true if the specified character is a valid NCName
- /// character as defined by production [5] in Namespaces in XML
- /// recommendation.
- /// </summary>
- /// <param name="c"></param>
- /// <returns></returns>
- public static bool IsNCName(char c)
- {
- return (CHARS[c] & NCNAME) != 0;
- }
-
- /// <summary>
- /// Returns true if the specified character is a valid Pubid
- /// character as defined by production [13] in the XML 1.0 specification.
- /// </summary>
- /// <param name="c">The character to check</param>
- public static bool IsPubid(char c)
- {
- return (CHARS[c] & PUBID) != 0;
- }
-
- /// <summary>
- /// Check to see if a string is a valid Name according to [5]
- /// in the XML 1.0 Recommendation
- /// </summary>
- /// <param name="name">The string to check</param>
- public static bool IsValidName(String name, out Exception err)
- {
- err = null;
- if (name.Length == 0)
- {
- err = new XmlException("Name can not be an empty string",null);
- return false;
- }
- char ch = name[0];
- if( IsNameStart(ch) == false)
- {
- err = new XmlException("The character '"+ch+"' cannot start a Name",null);
- return false;
- }
- for (int i = 1; i < name.Length; i++ )
- {
- ch = name[i];
- if( IsName( ch ) == false )
- {
- err = new XmlException("The character '"+ch+"' is not allowed in a Name",null);
- return false;
- }
- }
- return true;
- }
-
- /// <summary>
- /// Check to see if a string is a valid NCName according to [4]
- /// from the XML Namespaces 1.0 Recommendation
- /// </summary>
- /// <param name="ncName">The string to check</param>
- public static bool IsValidNCName(String ncName, out Exception err)
- {
- err = null;
- if (ncName.Length == 0)
- {
- err = new XmlException("NCName can not be an empty string",null);
- return false;
- }
- char ch = ncName[0];
- if( IsNCNameStart(ch) == false)
- {
- err = new XmlException("The character '"+ch+"' cannot start a NCName",null);
- return false;
- }
- for (int i = 1; i < ncName.Length; i++ )
- {
- ch = ncName[i];
- if( IsNCName( ch ) == false )
- {
- err = new XmlException("The character '"+ch+"' is not allowed in a NCName",null);
- return false;
- }
- }
- return true;
- }
-
- /// <summary>
- /// Check to see if a string is a valid Nmtoken according to [7]
- /// in the XML 1.0 Recommendation
- /// </summary>
- /// <param name="nmtoken">The string to check.</param>
- public static bool IsValidNmtoken(String nmtoken, out Exception err)
- {
- err = null;
- if (nmtoken.Length == 0)
- {
- err = new XmlException("NMTOKEN can not be an empty string", null);
- return false;
- }
- for (int i = 0; i < nmtoken.Length; i++ )
- {
- char ch = nmtoken[i];
- if( ! IsName( ch ) )
- {
- err = new XmlException("The character '"+ch+"' is not allowed in a NMTOKEN",null);
- return false;
- }
- }
- return true;
- }
-
- // encodings
-
- /// <summary>
- /// Returns true if the encoding name is a valid IANA encoding.
- /// This method does not verify that there is a decoder available
- /// for this encoding, only that the characters are valid for an
- /// IANA encoding name.
- /// </summary>
- /// <param name="ianaEncoding">The encoding to check.</param>
- /// <returns></returns>
- public static bool IsValidIANAEncoding(String ianaEncoding)
- {
- if (ianaEncoding != null)
- {
- int length = ianaEncoding.Length;
- if (length > 0)
- {
- char c = ianaEncoding[0];
- if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
- {
- for (int i = 1; i < length; i++)
- {
- c = ianaEncoding[i];
- if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z') &&
- (c < '0' || c > '9') && c != '.' && c != '_' &&
- c != '-')
- {
- return false;
- }
- }
- return true;
- }
- }
- }
- return false;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlConvert.cs b/mcs/class/System.XML/System.Xml/XmlConvert.cs
deleted file mode 100755
index 5db6afcfe87..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlConvert.cs
+++ /dev/null
@@ -1,254 +0,0 @@
-// Author: Dwivedi, Ajay kumar
-// Adwiv@Yahoo.com
-// XmlConvert.cs: Xml data type conversion
-//
-using System;
-using System.Globalization;
-
-namespace System.Xml {
-
- public class XmlConvert {
-
- public XmlConvert()
- {}
-
- // Methods
- [MonoTODO]
- public static string DecodeName(string name)
- {
- return null;
- }
- [MonoTODO]
- public static string EncodeLocalName(string name)
- {
- return null;
- }
- [MonoTODO]
- public static string EncodeName(string name)
- {
- return null;
- }
- [MonoTODO]
- public static string EncodeNmToken(string name)
- {
- return null;
- }
-
- // {true, false, 1, 0}
- public static bool ToBoolean(string s)
- {
- s = s.Trim();
- switch(s)
- {
- case "1":
- return true;
- case "true":
- return true;
- case "0":
- return false;
- case "false":
- return false;
- default:
- throw new FormatException(s + " is not a valid boolean value");
- }
- }
-
- public static byte ToByte(string s)
- {
- return Byte.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static char ToChar(string s)
- {
- return char.Parse(s);
- }
-
- [MonoTODO]
- public static DateTime ToDateTime(string s)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static DateTime ToDateTime(string s, string format)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static DateTime ToDateTime(string s, string[] formats)
- {
- throw new NotImplementedException();
- }
-
- public static Decimal ToDecimal(string s)
- {
- return Decimal.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static double ToDouble(string s)
- {
- return Double.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static Guid ToGuid(string s)
- {
- return new Guid(s);
- }
-
- public static short ToInt16(string s)
- {
- return Int16.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static int ToInt32(string s)
- {
- return Int32.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static long ToInt64(string s)
- {
- return Int64.Parse(s, CultureInfo.InvariantCulture);
- }
-
- [CLSCompliant (false)]
- public static SByte ToSByte(string s)
- {
- return SByte.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static float ToSingle(string s)
- {
- return Single.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static string ToString(Guid value)
- {
- return value.ToString("D",CultureInfo.InvariantCulture);
- }
-
- public static string ToString(int value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- public static string ToString(short value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- public static string ToString(byte value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- public static string ToString(long value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- public static string ToString(char value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- public static string ToString(bool value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- [CLSCompliant (false)]
- public static string ToString(SByte value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
- public static string ToString(Decimal value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- [CLSCompliant (false)]
- public static string ToString(UInt64 value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
- public static string ToString(TimeSpan value)
- {
- return value.ToString();
- }
- public static string ToString(double value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
- public static string ToString(float value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- [CLSCompliant (false)]
- public static string ToString(UInt32 value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
-
- [CLSCompliant (false)]
- public static string ToString(UInt16 value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
- public static string ToString(DateTime value)
- {
- return value.ToString(CultureInfo.InvariantCulture);
- }
- public static string ToString(DateTime value, string format)
- {
- return value.ToString(format, CultureInfo.InvariantCulture);
- }
- public static TimeSpan ToTimeSpan(string s)
- {
- return TimeSpan.Parse(s);
- }
-
- [CLSCompliant (false)]
- public static UInt16 ToUInt16(string s)
- {
- return UInt16.Parse(s, CultureInfo.InvariantCulture);
- }
-
- [CLSCompliant (false)]
- public static UInt32 ToUInt32(string s)
- {
- return UInt32.Parse(s, CultureInfo.InvariantCulture);
- }
-
- [CLSCompliant (false)]
- public static UInt64 ToUInt64(string s)
- {
- return UInt64.Parse(s, CultureInfo.InvariantCulture);
- }
-
- public static string VerifyName(string name)
- {
- Exception innerEx;
- if(name == null)
- throw new ArgumentNullException("name");
-
- if(XmlConstructs.IsValidName(name, out innerEx))
- return name;
-
- throw new XmlException("'"+name+"' is not a valid XML Name",null);
- }
-
- public static string VerifyNCName(string ncname)
- {
- Exception innerEx;
- if(ncname == null)
- throw new ArgumentNullException("ncname");
-
- if(XmlConstructs.IsValidName(ncname, out innerEx))
- return ncname;
-
- throw new XmlException("'"+ncname+"' is not a valid XML NCName",innerEx);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDeclaration.cs b/mcs/class/System.XML/System.Xml/XmlDeclaration.cs
deleted file mode 100644
index 8f1974e4d9a..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDeclaration.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Xml.XmlDeclaration
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-using System;
-using System.Xml;
-
-namespace System.Xml
-{
- public class XmlDeclaration : XmlLinkedNode
- {
- string encoding = "UTF-8"; // defaults to UTF-8
- string standalone;
- string version;
-
- protected internal XmlDeclaration (string version, string encoding,
- string standalone, XmlDocument doc)
- : base (doc)
- {
- if (encoding == null)
- encoding = "";
-
- if (standalone == null)
- standalone = "";
-
- this.version = version;
- this.encoding = encoding;
- this.standalone = standalone;
- }
-
- public string Encoding {
- get { return encoding; }
- set { encoding = (value == null) ? String.Empty : value; }
- }
-
- public override string InnerText {
- get { return Value; }
- set { ParseInput (value); }
- }
-
- public override string LocalName {
- get { return "xml"; }
- }
-
- public override string Name {
- get { return "xml"; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.XmlDeclaration; }
- }
-
- public string Standalone {
- get { return standalone; }
- set {
- if (value.ToUpper() == "YES")
- standalone = "yes";
- if (value.ToUpper() == "NO")
- standalone = "no";
- }
- }
-
- public override string Value {
- get {
- string formatEncoding = "";
- string formatStandalone = "";
-
- if (encoding != String.Empty)
- formatEncoding = String.Format (" encoding=\"{0}\"", encoding);
-
- if (standalone != String.Empty)
- formatStandalone = String.Format (" standalone=\"{0}\"", standalone);
-
- return String.Format ("version=\"{0}\"{1}{2}", Version, formatEncoding, formatStandalone);
- }
- set { ParseInput (value); }
- }
-
- public string Version {
- get { return version; }
- }
-
- public override XmlNode CloneNode (bool deep)
- {
- return new XmlDeclaration (Version, Encoding, standalone, OwnerDocument);
- }
-
- public override void WriteContentTo (XmlWriter w) {}
-
- public override void WriteTo (XmlWriter w)
- {
- // This doesn't seem to match up very well with w.WriteStartDocument()
- // so writing out custom here.
- w.WriteRaw (String.Format ("<?xml {0}?>", Value));
- }
-
- void ParseInput (string input)
- {
- Encoding = input.Split (new char [] { ' ' }) [1].Split (new char [] { '=' }) [1];
- Standalone = input.Split (new char [] { ' ' }) [2].Split (new char [] { '=' }) [1];
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocument.cs b/mcs/class/System.XML/System.Xml/XmlDocument.cs
deleted file mode 100644
index 6220f11c177..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDocument.cs
+++ /dev/null
@@ -1,580 +0,0 @@
-//
-// System.Xml.XmlDocument
-//
-// Authors:
-// Daniel Weber (daniel-weber@austin.rr.com)
-// Kral Ferch <kral_ferch@hotmail.com>
-// Jason Diamond <jason@injektilo.org>
-// Miguel de Icaza (miguel@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Daniel Weber
-// (C) 2002 Kral Ferch, Jason Diamond, Miguel de Icaza, Duncan Mak
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Xml.XPath;
-using System.Diagnostics;
-
-namespace System.Xml
-{
- public class XmlDocument : XmlNode
- {
- #region Fields
-
- XmlLinkedNode lastLinkedChild;
- XmlNameTable nameTable;
- string baseURI = String.Empty;
-
- #endregion
-
- #region Constructors
-
- public XmlDocument () : base (null) { }
-
- [MonoTODO]
- protected internal XmlDocument (XmlImplementation imp) : base (null)
- {
- throw new NotImplementedException ();
- }
-
- public XmlDocument (XmlNameTable nt) : base (null)
- {
- nameTable = nt;
- }
-
- #endregion
-
- #region Events
-
- public event XmlNodeChangedEventHandler NodeChanged;
-
- public event XmlNodeChangedEventHandler NodeChanging;
-
- public event XmlNodeChangedEventHandler NodeInserted;
-
- public event XmlNodeChangedEventHandler NodeInserting;
-
- public event XmlNodeChangedEventHandler NodeRemoved;
-
- public event XmlNodeChangedEventHandler NodeRemoving;
-
- #endregion
-
- #region Properties
-
- public override string BaseURI {
- get {
- return baseURI;
- }
- }
-
- public XmlElement DocumentElement {
- get {
- XmlNode node = FirstChild;
-
- while (node != null) {
- if (node is XmlElement)
- break;
- node = node.NextSibling;
- }
-
- return node != null ? node as XmlElement : null;
- }
- }
-
- [MonoTODO]
- public virtual XmlDocumentType DocumentType {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public XmlImplementation Implementation {
- get { throw new NotImplementedException(); }
- }
-
- [MonoTODO ("Setter.")]
- public override string InnerXml {
- get {
- // Not sure why this is an override. Passing through for now.
- return base.InnerXml;
- }
- set { throw new NotImplementedException(); }
- }
-
- public override bool IsReadOnly {
- get { return false; }
- }
-
- internal override XmlLinkedNode LastLinkedChild {
- get {
- return lastLinkedChild;
- }
-
- set {
- lastLinkedChild = value;
- }
- }
-
- public override string LocalName {
- get { return "#document"; }
- }
-
- public override string Name {
- get { return "#document"; }
- }
-
- public XmlNameTable NameTable {
- get { return nameTable; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.Document; }
- }
-
- public override XmlDocument OwnerDocument {
- get { return null; }
- }
-
- [MonoTODO]
- public bool PreserveWhitespace {
- get { throw new NotImplementedException(); }
- set { throw new NotImplementedException(); }
- }
-
- [MonoTODO]
- public virtual XmlResolver XmlResolver {
- set { throw new NotImplementedException(); }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override XmlNode CloneNode (bool deep)
- {
- throw new NotImplementedException ();
- }
-
- public XmlAttribute CreateAttribute (string name)
- {
- return CreateAttribute (name, String.Empty);
- }
-
- public XmlAttribute CreateAttribute (string qualifiedName, string namespaceURI)
- {
- string prefix;
- string localName;
-
- ParseName (qualifiedName, out prefix, out localName);
-
- return CreateAttribute (prefix, localName, namespaceURI);
- }
-
- public virtual XmlAttribute CreateAttribute (string prefix, string localName, string namespaceURI)
- {
- if ((localName == null) || (localName == String.Empty))
- throw new ArgumentException ("The attribute local name cannot be empty.");
-
- return new XmlAttribute (prefix, localName, namespaceURI, this);
- }
-
- public virtual XmlCDataSection CreateCDataSection (string data)
- {
- return new XmlCDataSection (data, this);
- }
-
- public virtual XmlComment CreateComment (string data)
- {
- return new XmlComment(data, this);
- }
-
- [MonoTODO]
- protected internal virtual XmlAttribute CreateDefaultAttribute (string prefix, string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlDocumentFragment CreateDocumentFragment ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual XmlDocumentType CreateDocumentType (string name, string publicId,
- string systemId, string internalSubset)
- {
- return new XmlDocumentType (name, publicId, systemId, internalSubset, this);
- }
-
- public XmlElement CreateElement (string name)
- {
- return CreateElement (name, String.Empty);
- }
-
- public XmlElement CreateElement (
- string qualifiedName,
- string namespaceURI)
- {
- string prefix;
- string localName;
-
- ParseName (qualifiedName, out prefix, out localName);
-
- return CreateElement (prefix, localName, namespaceURI);
- }
-
- public virtual XmlElement CreateElement (
- string prefix,
- string localName,
- string namespaceURI)
- {
- if ((localName == null) || (localName == String.Empty))
- throw new ArgumentException ("The local name for elements or attributes cannot be null or an empty string.");
-
- return new XmlElement (prefix, localName, namespaceURI, this);
- }
-
- [MonoTODO]
- public virtual XmlEntityReference CreateEntityReference (string name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual XmlNode CreateNode (
- string nodeTypeString,
- string name,
- string namespaceURI)
- {
- return CreateNode (GetNodeTypeFromString (nodeTypeString), name, namespaceURI);
- }
-
- public virtual XmlNode CreateNode (
- XmlNodeType type,
- string name,
- string namespaceURI)
- {
- string prefix = null;
- string localName = name;
-
- if ((type == XmlNodeType.Attribute) || (type == XmlNodeType.Element) || (type == XmlNodeType.EntityReference))
- ParseName (name, out prefix, out localName);
-
- return CreateNode (type, prefix, localName, namespaceURI);
- }
-
- public virtual XmlNode CreateNode (
- XmlNodeType type,
- string prefix,
- string name,
- string namespaceURI)
- {
- switch (type) {
- case XmlNodeType.Attribute: return CreateAttribute (prefix, name, namespaceURI);
- case XmlNodeType.CDATA: return CreateCDataSection (null);
- case XmlNodeType.Comment: return CreateComment (null);
- case XmlNodeType.Document: return new XmlDocument (); // TODO - test to see which constructor to use, i.e. use existing NameTable or not.
- case XmlNodeType.DocumentFragment: return CreateDocumentFragment ();
- case XmlNodeType.DocumentType: return CreateDocumentType (null, null, null, null);
- case XmlNodeType.Element: return CreateElement (prefix, name, namespaceURI);
- case XmlNodeType.EntityReference: return CreateEntityReference (null);
- case XmlNodeType.ProcessingInstruction: return CreateProcessingInstruction (null, null);
- case XmlNodeType.SignificantWhitespace: return CreateSignificantWhitespace (String.Empty);
- case XmlNodeType.Text: return CreateTextNode (null);
- case XmlNodeType.Whitespace: return CreateWhitespace (String.Empty);
- case XmlNodeType.XmlDeclaration: return CreateXmlDeclaration ("1.0", null, null);
- default: throw new ArgumentOutOfRangeException(String.Format("{0}\nParameter name: {1}",
- "Specified argument was out of the range of valid values", type.ToString ()));
- }
- }
-
- public virtual XmlProcessingInstruction CreateProcessingInstruction (
- string target,
- string data)
- {
- return new XmlProcessingInstruction (target, data, this);
- }
-
- public virtual XmlSignificantWhitespace CreateSignificantWhitespace (string text)
- {
- foreach (char c in text)
- if ((c != ' ') && (c != '\r') && (c != '\n') && (c != '\t'))
- throw new ArgumentException ("Invalid whitespace characters.");
-
- return new XmlSignificantWhitespace (text, this);
- }
-
- public virtual XmlText CreateTextNode (string text)
- {
- return new XmlText (text, this);
- }
-
- public virtual XmlWhitespace CreateWhitespace (string text)
- {
- foreach (char c in text)
- if ((c != ' ') && (c != '\r') && (c != '\n') && (c != '\t'))
- throw new ArgumentException ("Invalid whitespace characters.");
-
- return new XmlWhitespace (text, this);
- }
-
- public virtual XmlDeclaration CreateXmlDeclaration (string version, string encoding,
- string standalone)
- {
- if (version != "1.0")
- throw new ArgumentException ("version string is not correct.");
-
- if ((standalone != null) && !((standalone == "yes") || (standalone == "no")))
- throw new ArgumentException ("standalone string is not correct.");
-
- return new XmlDeclaration (version, encoding, standalone, this);
- }
-
- [MonoTODO]
- public virtual XmlElement GetElementById (string elementId)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlNodeList GetElementsByTagName (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlNodeList GetElementsByTagName (string localName, string namespaceURI)
- {
- throw new NotImplementedException();
- }
-
- private XmlNodeType GetNodeTypeFromString (string nodeTypeString)
- {
- switch (nodeTypeString) {
- case "attribute": return XmlNodeType.Attribute;
- case "cdatasection": return XmlNodeType.CDATA;
- case "comment": return XmlNodeType.Comment;
- case "document": return XmlNodeType.Document;
- case "documentfragment": return XmlNodeType.DocumentFragment;
- case "documenttype": return XmlNodeType.DocumentType;
- case "element": return XmlNodeType.Element;
- case "entityreference": return XmlNodeType.EntityReference;
- case "processinginstruction": return XmlNodeType.ProcessingInstruction;
- case "significantwhitespace": return XmlNodeType.SignificantWhitespace;
- case "text": return XmlNodeType.Text;
- case "whitespace": return XmlNodeType.Whitespace;
- default:
- throw new ArgumentException(String.Format("The string doesn't represent any node type : {0}.", nodeTypeString));
- }
- }
-
- [MonoTODO]
- public virtual XmlNode ImportNode (XmlNode node, bool deep)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void Load (Stream inStream)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void Load (string filename)
- {
- baseURI = filename;
- XmlReader xmlReader = new XmlTextReader (new StreamReader (filename));
- Load (xmlReader);
- }
-
- [MonoTODO]
- public virtual void Load (TextReader txtReader)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void Load (XmlReader xmlReader)
- {
- // Reset our document
- // For now this just means removing all our children but later this
- // may turn out o need to call a private method that resets other things
- // like properties we have, etc.
- RemoveAll ();
-
- XmlNode currentNode = this;
- XmlNode newNode;
-
- while (xmlReader.Read ())
- {
- switch (xmlReader.NodeType) {
-
- case XmlNodeType.CDATA:
- newNode = CreateCDataSection(xmlReader.Value);
- currentNode.AppendChild (newNode);
- break;
-
- case XmlNodeType.Comment:
- newNode = CreateComment (xmlReader.Value);
- currentNode.AppendChild (newNode);
- break;
-
- case XmlNodeType.Element:
- XmlElement element = CreateElement (xmlReader.Prefix, xmlReader.LocalName, xmlReader.NamespaceURI);
- currentNode.AppendChild (element);
-
- // set the element's attributes.
- while (xmlReader.MoveToNextAttribute ()) {
- XmlAttribute attribute = CreateAttribute (xmlReader.Prefix, xmlReader.LocalName, xmlReader.NamespaceURI);
- attribute.Value = xmlReader.Value;
- element.SetAttributeNode (attribute);
- }
-
- xmlReader.MoveToElement ();
-
- // if this element isn't empty, push it onto our "stack".
- if (!xmlReader.IsEmptyElement)
- currentNode = element;
-
- break;
-
- case XmlNodeType.EndElement:
- currentNode = currentNode.ParentNode;
- break;
-
- case XmlNodeType.ProcessingInstruction:
- newNode = CreateProcessingInstruction (xmlReader.Name, xmlReader.Value);
- currentNode.AppendChild (newNode);
- break;
-
- case XmlNodeType.Text:
- newNode = CreateTextNode (xmlReader.Value);
- currentNode.AppendChild (newNode);
- break;
- }
- }
- }
-
- public virtual void LoadXml (string xml)
- {
- XmlReader xmlReader = new XmlTextReader (new StringReader (xml));
- Load (xmlReader);
- }
-
- internal void onNodeChanged (XmlNode node, XmlNode Parent)
- {
- if (NodeChanged != null)
- NodeInserted (node, new XmlNodeChangedEventArgs
- (XmlNodeChangedAction.Change,
- node, Parent, Parent));
- }
-
- internal void onNodeChanging(XmlNode node, XmlNode Parent)
- {
- if (NodeInserting != null)
- NodeChanging (node, new XmlNodeChangedEventArgs
- (XmlNodeChangedAction.Change,
- node, Parent, Parent));
- }
-
- internal void onNodeInserted (XmlNode node, XmlNode newParent)
- {
- if (NodeInserted != null)
- NodeInserted (node, new XmlNodeChangedEventArgs
- (XmlNodeChangedAction.Insert,
- node, null, newParent));
- }
-
- internal void onNodeInserting (XmlNode node, XmlNode newParent)
- {
- if (NodeInserting != null)
- NodeInserting (node, new XmlNodeChangedEventArgs
- (XmlNodeChangedAction.Insert,
- node, null, newParent));
- }
-
- internal void onNodeRemoved (XmlNode node, XmlNode oldParent)
- {
- if (NodeRemoved != null)
- NodeRemoved (node, new XmlNodeChangedEventArgs
- (XmlNodeChangedAction.Remove,
- node, oldParent, null));
- }
-
- internal void onNodeRemoving (XmlNode node, XmlNode oldParent)
- {
- if (NodeRemoving != null)
- NodeRemoving (node, new XmlNodeChangedEventArgs
- (XmlNodeChangedAction.Remove,
- node, oldParent, null));
- }
-
- private void ParseName (string name, out string prefix, out string localName)
- {
- int indexOfColon = name.IndexOf (':');
-
- if (indexOfColon != -1) {
- prefix = name.Substring (0, indexOfColon);
- localName = name.Substring (indexOfColon + 1);
- } else {
- prefix = "";
- localName = name;
- }
- }
-
- [MonoTODO]
- public virtual XmlNode ReadNode(XmlReader reader)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("Verify what encoding is used by default; Should use PreserveWhiteSpace")]
- public virtual void Save(Stream outStream)
- {
- XmlTextWriter xmlWriter = new XmlTextWriter (outStream, Encoding.UTF8);
- WriteContentTo (xmlWriter);
- xmlWriter.Close ();
- }
-
- [MonoTODO ("Verify what encoding is used by default; Should use PreseveWhiteSpace")]
- public virtual void Save (string filename)
- {
- XmlTextWriter xmlWriter = new XmlTextWriter (filename, Encoding.UTF8);
- WriteContentTo (xmlWriter);
- xmlWriter.Close ();
- }
-
- [MonoTODO]
- public virtual void Save (TextWriter writer)
- {
- XmlTextWriter xmlWriter = new XmlTextWriter (writer);
- WriteContentTo (xmlWriter);
- xmlWriter.Flush ();
- }
-
- [MonoTODO ("Should preserve white space if PreserveWhisspace is set")]
- public virtual void Save (XmlWriter xmlWriter)
- {
- //
- // This should preserve white space if PreserveWhiteSpace is true
- //
- WriteContentTo (xmlWriter);
- xmlWriter.Flush ();
- }
-
- public override void WriteContentTo (XmlWriter w)
- {
- foreach(XmlNode childNode in ChildNodes)
- childNode.WriteTo(w);
- }
-
- public override void WriteTo (XmlWriter w)
- {
- WriteContentTo(w);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs b/mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs
deleted file mode 100644
index 8bc9aa4aac3..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDocumentFragment.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.Xml.XmlDocumentFragment
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C), Ximian, Inc
-//
-using System;
-
-namespace System.Xml
-{
- public class XmlDocumentFragment : XmlNode
- {
- #region Constructor
-
- protected internal XmlDocumentFragment (XmlDocument doc)
- : base (doc)
- {
- }
-
- #endregion
- #region Properties
-
- [MonoTODO]
- public override string InnerXml {
- set { throw new NotImplementedException (); }
- get { throw new NotImplementedException (); }
- }
-
- public override string LocalName {
- get { return "#document-fragment"; }
- }
-
-
- public override string Name {
- get { return "#document-fragment"; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.DocumentFragment; }
- }
-
- public override XmlDocument OwnerDocument {
- get { return base.OwnerDocument; }
- }
-
- public override XmlNode ParentNode {
- get { return null; } // it's always null here.
- }
-
- #endregion
-
- #region Methods
- public override XmlNode CloneNode (bool deep)
- {
- if (deep) { // clone document + child nodes
- XmlNode node = FirstChild;
-
- while ((node != null) && (node.HasChildNodes)) {
- AppendChild (node.NextSibling.CloneNode (false));
- node = node.NextSibling;
- }
-
- return node;
- } else
- return new XmlDocumentFragment (OwnerDocument);
- }
-
- [MonoTODO]
- public override void WriteContentTo (XmlWriter w)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void WriteTo (XmlWriter w)
- {
- throw new NotImplementedException ();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs b/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
deleted file mode 100644
index bdd44a165f6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
+++ /dev/null
@@ -1,311 +0,0 @@
-//
-// System.Xml.XmlDocumentNavigator
-//
-// Author:
-// Jason Diamond <jason@injektilo.org>
-//
-// (C) 2002 Jason Diamond
-//
-
-using System;
-using System.Collections;
-using System.Xml;
-using System.Xml.XPath;
-
-namespace System.Xml
-{
- internal class XmlDocumentNavigator : XPathNavigator
- {
- #region Constructors
-
- [MonoTODO]
- internal XmlDocumentNavigator(XmlNode node)
- {
- this.node = node;
- }
-
- #endregion
-
- #region Fields
-
- private XmlNode node;
- private IEnumerator attributesEnumerator;
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- public override string BaseURI {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public override bool HasAttributes {
- get {
- if (node.Attributes != null)
- foreach (XmlAttribute attribute in node.Attributes)
- if (attribute.NamespaceURI != "http://www.w3.org/2000/xmlns/")
- return true;
- return false;
- }
- }
-
- public override bool HasChildren {
- get {
- XPathNodeType nodeType = NodeType;
- bool canHaveChildren = nodeType == XPathNodeType.Root || nodeType == XPathNodeType.Element;
- return canHaveChildren && node.FirstChild != null;
- }
- }
-
- public override bool IsEmptyElement {
- get {
- return node.NodeType == XmlNodeType.Element && !HasChildren;
- }
- }
-
- public override string LocalName {
- get {
- XPathNodeType nodeType = NodeType;
- bool canHaveName =
- nodeType == XPathNodeType.Element ||
- nodeType == XPathNodeType.Attribute ||
- nodeType == XPathNodeType.ProcessingInstruction ||
- nodeType == XPathNodeType.Namespace;
- return canHaveName ? node.LocalName : String.Empty;
- }
- }
-
- public override string Name {
- get {
- XPathNodeType nodeType = NodeType;
- bool canHaveName =
- nodeType == XPathNodeType.Element ||
- nodeType == XPathNodeType.Attribute ||
- nodeType == XPathNodeType.ProcessingInstruction ||
- nodeType == XPathNodeType.Namespace;
- return canHaveName ? node.Name : String.Empty;
- }
- }
-
- public override string NamespaceURI {
- get {
- return node.NamespaceURI;
- }
- }
-
- [MonoTODO]
- public override XmlNameTable NameTable {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public override XPathNodeType NodeType {
- get {
- switch (node.NodeType) {
- case XmlNodeType.Document:
- return XPathNodeType.Root;
- case XmlNodeType.Element:
- return XPathNodeType.Element;
- case XmlNodeType.Attribute:
- return XPathNodeType.Attribute;
- case XmlNodeType.Text:
- return XPathNodeType.Text;
- case XmlNodeType.Whitespace:
- return XPathNodeType.Whitespace;
- case XmlNodeType.SignificantWhitespace:
- return XPathNodeType.SignificantWhitespace;
- case XmlNodeType.Comment:
- return XPathNodeType.Comment;
- case XmlNodeType.ProcessingInstruction:
- return XPathNodeType.ProcessingInstruction;
- }
- throw new InvalidOperationException ();
- }
- }
-
- public override string Prefix {
- get {
- return node.Prefix;
- }
- }
-
- public override string Value {
- get {
- switch (NodeType) {
- case XPathNodeType.Attribute:
- return node.Value;
- case XPathNodeType.Element:
- return node.InnerText;
- case XPathNodeType.Comment:
- return node.Value;
- case XPathNodeType.ProcessingInstruction:
- return node.Value;
- case XPathNodeType.Text:
- return node.Value;
- case XPathNodeType.Whitespace:
- return node.Value;
- case XPathNodeType.SignificantWhitespace:
- return node.Value;
- case XPathNodeType.Root:
- return node.InnerText;
- }
- return String.Empty;
- }
- }
-
- [MonoTODO]
- public override string XmlLang {
- get {
- throw new NotImplementedException ();
- }
- }
-
- #endregion
-
- #region Methods
-
- public override XPathNavigator Clone ()
- {
- return new XmlDocumentNavigator (node);
- }
-
- [MonoTODO]
- public override string GetAttribute (string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string GetNamespace (string name)
- {
- throw new NotImplementedException ();
- }
-
- public override bool IsSamePosition (XPathNavigator other)
- {
- XmlDocumentNavigator otherDocumentNavigator = other as XmlDocumentNavigator;
- if (otherDocumentNavigator != null)
- return node == otherDocumentNavigator.node;
- return false;
- }
-
- public override bool MoveTo (XPathNavigator other)
- {
- XmlDocumentNavigator otherDocumentNavigator = other as XmlDocumentNavigator;
- if (otherDocumentNavigator != null) {
- if (node.OwnerDocument == otherDocumentNavigator.node.OwnerDocument) {
- node = otherDocumentNavigator.node;
- return true;
- }
- }
- return false;
- }
-
- [MonoTODO]
- public override bool MoveToAttribute (string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- public override bool MoveToFirst ()
- {
- if (node.NodeType != XmlNodeType.Attribute && node.ParentNode != null) {
- node = node.ParentNode.FirstChild;
- return true;
- }
- return false;
- }
-
- public override bool MoveToFirstAttribute ()
- {
- if (NodeType == XPathNodeType.Element) {
- attributesEnumerator = node.Attributes.GetEnumerator ();
- return MoveToNextAttribute ();
- }
- return false;
- }
-
- public override bool MoveToFirstChild ()
- {
- if (HasChildren) {
- node = node.FirstChild;
- return true;
- }
- return false;
- }
-
- [MonoTODO]
- public override bool MoveToFirstNamespace (XPathNamespaceScope namespaceScope)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool MoveToId (string id)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool MoveToNamespace (string name)
- {
- throw new NotImplementedException ();
- }
-
- public override bool MoveToNext ()
- {
- if (node.NextSibling != null) {
- node = node.NextSibling;
- return true;
- }
- return false;
- }
-
- public override bool MoveToNextAttribute ()
- {
- if (attributesEnumerator != null && attributesEnumerator.MoveNext ()) {
- node = attributesEnumerator.Current as XmlAttribute;
- return true;
- }
- return false;
- }
-
- [MonoTODO]
- public override bool MoveToNextNamespace (XPathNamespaceScope namespaceScope)
- {
- throw new NotImplementedException ();
- }
-
- public override bool MoveToParent ()
- {
- if (node.ParentNode != null) {
- node = node.ParentNode;
- return true;
- }
- return false;
- }
-
- public override bool MoveToPrevious ()
- {
- if (node.PreviousSibling != null) {
- node = node.PreviousSibling;
- return true;
- }
- return false;
- }
-
- public override void MoveToRoot ()
- {
- if (node.NodeType != XmlNodeType.Document)
- node = node.OwnerDocument;
- }
-
- internal XmlNode Node { get { return node; } }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlDocumentType.cs b/mcs/class/System.XML/System.Xml/XmlDocumentType.cs
deleted file mode 100644
index 83dbf11c7ea..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlDocumentType.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.Xml.XmlDocumentType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlDocumentType : XmlLinkedNode
- {
- // Fields
- string name; // name of the document type
- string publicId; // public identifier on the DOCTYPE
- string systemId; // system identifier on the DOCTYPE
- string internalSubset; // value of the DTD internal subset
-
- // Constructor
- protected internal XmlDocumentType (string name, string publicId,
- string systemId, string internalSubset,
- XmlDocument doc)
- : base (doc)
- {
- this.name = name;
- this.publicId = publicId;
- this.systemId = systemId;
- this.internalSubset = internalSubset;
- }
-
-
- // Properties
- [MonoTODO]
- public XmlNamedNodeMap Entities
- {
- get { return null; }
- }
-
- public string InternalSubset
- {
- get { return internalSubset; }
- }
-
- public override bool IsReadOnly
- {
- get { return true; } // always return true
- }
-
- public override string LocalName
- {
- get { return name; }
- }
-
- public override string Name
- {
- get { return name; }
- }
-
- public override XmlNodeType NodeType
- {
- get { return XmlNodeType.DocumentType; }
- }
-
- [MonoTODO]
- public XmlNamedNodeMap Notations
- {
- get { return null; }
- }
-
- public string PublicId
- {
- get { return publicId; }
- }
-
- public string SystemId
- {
- get { return systemId; }
- }
-
- // Methods
- public override XmlNode CloneNode (bool deep)
- {
- // deep is ignored
- return new XmlDocumentType (name, publicId, systemId,
- internalSubset, OwnerDocument);
- }
-
- public override void WriteContentTo (XmlWriter w)
- {
- // No effect
- }
-
- [MonoTODO]
- public override void WriteTo (XmlWriter w)
- {
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs
deleted file mode 100644
index 58726978473..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlElement.cs
+++ /dev/null
@@ -1,288 +0,0 @@
-//
-// System.Xml.XmlAttribute
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlElement : XmlLinkedNode
- {
- #region Fields
-
- private XmlAttributeCollection attributes;
- private XmlLinkedNode lastLinkedChild;
- private string localName;
- private string namespaceURI;
- private string prefix;
-
- #endregion
-
- #region Constructor
-
- protected internal XmlElement (
- string prefix,
- string localName,
- string namespaceURI,
- XmlDocument doc) : base (doc)
- {
- this.prefix = prefix;
- this.localName = localName;
- this.namespaceURI = namespaceURI;
-
- attributes = new XmlAttributeCollection (this);
- }
-
- #endregion
-
- #region Properties
-
- public override XmlAttributeCollection Attributes {
- get { return attributes; }
- }
-
- public virtual bool HasAttributes {
- get { return attributes.Count > 0; }
- }
-
- [MonoTODO ("Setter.")]
- public override string InnerXml {
- get {
- // Not sure why this is an override. Passing through for now.
- return base.InnerXml;
- }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public bool IsEmpty {
- get { throw new NotImplementedException (); }
-
- set { throw new NotImplementedException (); }
- }
-
- internal override XmlLinkedNode LastLinkedChild {
- get { return lastLinkedChild; }
-
- set { lastLinkedChild = value; }
- }
-
- public override string LocalName {
- get { return localName; }
- }
-
- public override string Name {
- get {
- return prefix != String.Empty ? prefix + ":" + localName : localName;
- }
- }
-
- public override string NamespaceURI {
- get { return namespaceURI; }
- }
-
- [MonoTODO]
- public override XmlNode NextSibling {
- get {
- return base.NextSibling;
- }
- }
-
- public override XmlNodeType NodeType {
- get {
- return XmlNodeType.Element;
- }
- }
-
- [MonoTODO]
- public override XmlDocument OwnerDocument {
- get {
- return base.OwnerDocument;
- }
- }
-
- public override string Prefix {
- get {
- return prefix;
- }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override XmlNode CloneNode (bool deep)
- {
- XmlNode node = new XmlElement (prefix, localName, namespaceURI,
- OwnerDocument);
-
- for (int i = 0; i < node.Attributes.Count; i++)
- node.AppendChild (node.Attributes [i].CloneNode (false));
-
- if (deep) {
- while ((node != null) && (node.HasChildNodes)) {
- AppendChild (node.NextSibling.CloneNode (true));
- node = node.NextSibling;
- }
- } // shallow cloning
-
- //
- // Reminder: Also look into Default attributes.
- //
- return node;
- }
-
- [MonoTODO]
- public virtual string GetAttribute (string name)
- {
- XmlNode attributeNode = Attributes.GetNamedItem (name);
- return attributeNode != null ? attributeNode.Value : String.Empty;
- }
-
- [MonoTODO]
- public virtual string GetAttribute (string localName, string namespaceURI)
- {
- XmlNode attributeNode = Attributes.GetNamedItem (localName, namespaceURI);
- return attributeNode != null ? attributeNode.Value : String.Empty;
- }
-
- [MonoTODO]
- public virtual XmlAttribute GetAttributeNode (string name)
- {
- XmlNode attributeNode = Attributes.GetNamedItem (name);
- return attributeNode != null ? attributeNode as XmlAttribute : null;
- }
-
- [MonoTODO]
- public virtual XmlAttribute GetAttributeNode (string localName, string namespaceURI)
- {
- XmlNode attributeNode = Attributes.GetNamedItem (localName, namespaceURI);
- return attributeNode != null ? attributeNode as XmlAttribute : null;
- }
-
- [MonoTODO]
- public virtual XmlNodeList GetElementsByTagName (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlNodeList GetElementsByTagName (string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool HasAttribute (string name)
- {
- XmlNode attributeNode = Attributes.GetNamedItem (name);
- return attributeNode != null;
- }
-
- [MonoTODO]
- public virtual bool HasAttribute (string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO ("Don't remove default attributes.")]
- public override void RemoveAll ()
- {
- // Remove the child nodes.
- base.RemoveAll ();
-
- // Remove all attributes.
- attributes.RemoveAll ();
- }
-
- [MonoTODO]
- public virtual void RemoveAllAttributes ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void RemoveAttribute (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void RemoveAttribute (string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlNode RemoveAttributeAt (int i)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute RemoveAttributeNode (XmlAttribute oldAttr)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute RemoveAttributeNode (string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void SetAttribute (string name, string value)
- {
- XmlAttribute attribute = OwnerDocument.CreateAttribute (name);
- attribute.SetOwnerElement (this);
- attribute.Value = value;
- Attributes.SetNamedItem (attribute);
- }
-
- [MonoTODO]
- public virtual string SetAttribute (string localName, string namespaceURI, string value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlAttribute SetAttributeNode (XmlAttribute newAttr)
- {
- XmlNode oldAttr = Attributes.SetNamedItem(newAttr);
- return oldAttr != null ? oldAttr as XmlAttribute : null;
- }
-
- [MonoTODO]
- public virtual XmlAttribute SetAttributeNode (string localName, string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteContentTo (XmlWriter w)
- {
- foreach(XmlNode childNode in ChildNodes)
- childNode.WriteTo(w);
- }
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteStartElement(LocalName);
-
- foreach(XmlNode attributeNode in Attributes)
- attributeNode.WriteTo(w);
-
- WriteContentTo(w);
-
- w.WriteEndElement();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlEntity.cs b/mcs/class/System.XML/System.Xml/XmlEntity.cs
deleted file mode 100755
index f0778d8f3e7..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlEntity.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// System.Xml.XmlEntity.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlEntity : XmlNode
- {
- #region Constructors
-
- internal XmlEntity (string name, string NDATA, string publicId, string systemId,
- XmlDocument doc)
- : base (doc)
- {
- this.name = name;
- this.NDATA = NDATA;
- this.publicId = publicId;
- this.systemId = systemId;
- this.baseUri = doc.BaseURI;
- }
-
- #endregion
-
- #region Fields
-
- string name;
- string NDATA;
- string publicId;
- string systemId;
- string baseUri;
-
- #endregion
-
- #region Properties
-
- public override string BaseURI {
- get { return baseUri; }
- }
-
- [MonoTODO]
- public override string InnerText {
- get { throw new NotImplementedException (); }
- set { throw new InvalidOperationException ("This operation is not supported."); }
- }
-
- public override string InnerXml {
- get { return String.Empty; }
- set { throw new InvalidOperationException ("This operation is not supported."); }
- }
-
- public override bool IsReadOnly {
- get { return true; } // always read-only.
- }
-
- public override string LocalName {
- get { return name; }
- }
-
- public override string Name {
- get { return name; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.Entity; }
- }
-
- public string NotationName {
- get {
- if (NDATA == null)
- return null;
- else
- return NDATA;
- }
- }
-
- public override string OuterXml {
- get { return String.Empty; }
- }
-
- public string PublicId {
- get {
- if (publicId == null)
- return null;
- else
- return publicId;
- }
- }
-
- public string SystemId {
- get {
- if (publicId == null)
- return null;
- else
- return systemId;
- }
- }
- #endregion
-
- #region Methods
-
- public override XmlNode CloneNode (bool deep)
- {
- throw new InvalidOperationException ("This operation is not supported.");
- }
-
- public override void WriteContentTo (XmlWriter w)
- {
- // No effect.
- }
-
- public override void WriteTo (XmlWriter w)
- {
- // No effect.
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlEntityReference.cs b/mcs/class/System.XML/System.Xml/XmlEntityReference.cs
deleted file mode 100644
index b0b4aae79c9..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlEntityReference.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System.Xml.XmlEntityReference.cs
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlEntityReference : XmlLinkedNode
- {
- string entityName;
-
- // Constructor
- protected internal XmlEntityReference (string name, XmlDocument doc)
- : base (doc)
- {
- entityName = name;
- }
-
- // Properties
- [MonoTODO]
- public override string BaseURI {
- get { return null; }
- }
-
- public override bool IsReadOnly {
- get { return true; }
- }
-
- public override string LocalName {
- get { return entityName; } // name of the entity referenced.
- }
-
- public override string Name {
- get { return entityName; } // name of the entity referenced.
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.EntityReference; }
- }
-
- public override string Value {
- get { return null; } // always return null here.
- }
-
- // Methods
- public override XmlNode CloneNode (bool deep)
- {
-
- // API docs: "The replacement text is not included." XmlNode.CloneNode
- // "The replacement text is set when node is inserted." XmlEntityReference.CloneNode
- //
- return new XmlEntityReference ("", OwnerDocument);
- }
-
- [MonoTODO]
- public override void WriteContentTo (XmlWriter w)
- {
- }
-
- [MonoTODO]
- public override void WriteTo (XmlWriter w)
- {
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlException.cs b/mcs/class/System.XML/System.Xml/XmlException.cs
deleted file mode 100755
index a9e291fbe93..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlException.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// XmlException.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Xml
-{
- [Serializable]
- public class XmlException : SystemException
- {
- #region Fields
-
- string msg; // Cache message here because SystemException doesn't expose it
- int lineNumber;
- int linePosition;
-
- #endregion
-
- #region Constructors
-
- public XmlException (string message, Exception innerException)
- : base (message, innerException)
- {
- msg = message;
- }
-
- protected XmlException (SerializationInfo info, StreamingContext context)
- {
- this.lineNumber = info.GetInt32 ("lineNumber");
- this.linePosition = info.GetInt32 ("linePosition");
- }
-
- internal XmlException (string message)
- : base (message)
- {
- msg = message;
- }
-
- internal XmlException (string message, int lineNumber, int linePosition) : base (message)
- {
- this.lineNumber = lineNumber;
- this.linePosition = linePosition;
- }
-
- #endregion
-
- #region Properties
-
- public int LineNumber {
- get { return lineNumber; }
- }
-
- public int LinePosition {
- get { return linePosition; }
- }
-
- public override string Message {
- get { return msg; }
- }
-
- #endregion
-
- #region Methods
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("lineNumber", lineNumber);
- info.AddValue ("linePosition", linePosition);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlImplementation.cs b/mcs/class/System.XML/System.Xml/XmlImplementation.cs
deleted file mode 100644
index c76875d30bc..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlImplementation.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Xml.XmlImplementation.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlImplementation
- {
- public XmlImplementation ()
- : base ()
- {
- }
-
- public virtual XmlDocument CreateDocument ()
- {
- return new XmlDocument (this);
- }
-
- public bool HasFeature (string strFeature, string strVersion)
- {
- if ((strVersion == "XML") || (strVersion == "xml") // not case-sensitive
- && (strVersion == "1.0") || (strVersion == "2.0"))
- return true;
- else
- return false;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs b/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs
deleted file mode 100644
index 090bedcf6b9..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Xml.XmlLinkedNode
-//
-// Authors:
-// Jason Diamond <jason@injektilo.org>
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Jason Diamond, Kral Ferch
-//
-
-using System;
-
-namespace System.Xml
-{
- public abstract class XmlLinkedNode : XmlNode
- {
- #region Fields
-
- XmlLinkedNode nextSibling;
-
- #endregion
-
- #region Constructors
- internal XmlLinkedNode(XmlDocument doc) : base(doc) { }
-
- #endregion
-
- #region Properties
-
- public override XmlNode NextSibling
- {
- get {
- if (Object.ReferenceEquals(nextSibling, ParentNode.LastLinkedChild.NextLinkedSibling) == false) {
- return nextSibling;
- }
- else {
- return null;
- }
- }
- }
-
- internal XmlLinkedNode NextLinkedSibling
- {
- get { return nextSibling; }
- set { nextSibling = value; }
- }
-
- public override XmlNode PreviousSibling
- {
- get {
- if (ParentNode != null) {
- XmlNode node = ParentNode.FirstChild;
- if (node != this) {
- do {
- if (node.NextSibling == this)
- return node;
- } while ((node = node.NextSibling) != null);
- }
- }
- return null;
- }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNameTable.cs b/mcs/class/System.XML/System.Xml/XmlNameTable.cs
deleted file mode 100644
index 7de896f0fc4..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNameTable.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlNameTable.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- public abstract class XmlNameTable
- {
- public abstract string Add (string name);
- public abstract string Add (char [] buffer, int offset, int length);
- public abstract string Get (string name);
- public abstract string Get (char [] buffer, int offset, int length);
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs b/mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs
deleted file mode 100644
index c605a82cb34..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNamedNodeMap.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// System.Xml.XmlNamedNodeMap
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- public class XmlNamedNodeMap : IEnumerable
- {
- XmlNode parent;
- ArrayList nodeList;
- bool readOnly = false;
-
- internal XmlNamedNodeMap (XmlNode parent)
- {
- this.parent = parent;
- nodeList = new ArrayList ();
- }
-
- public virtual int Count {
- get { return nodeList.Count; }
- }
-
- public virtual IEnumerator GetEnumerator ()
- {
- return nodeList.GetEnumerator ();
- }
-
- public virtual XmlNode GetNamedItem (string name)
- {
- foreach (XmlNode node in nodeList) {
- if (node.Name == name)
- return node;
- }
- return null;
- }
-
- public virtual XmlNode GetNamedItem (string localName, string namespaceURI)
- {
- foreach (XmlNode node in nodeList) {
- if ((node.LocalName == localName)
- && (node.NamespaceURI == namespaceURI))
- return node;
- }
-
- return null;
- }
-
- public virtual XmlNode Item (int index)
- {
- if (index < 0 || index > nodeList.Count)
- return null;
- else
- return (XmlNode) nodeList [index];
- }
-
- public virtual XmlNode RemoveNamedItem (string name)
- {
- foreach (XmlNode node in nodeList)
- if (node.Name == name) {
- nodeList.Remove (node);
- return node;
- }
-
- return null;
- }
-
- public virtual XmlNode RemoveNamedItem (string localName, string namespaceURI)
- {
- foreach (XmlNode node in nodeList)
- if ((node.LocalName == localName)
- && (node.NamespaceURI == namespaceURI)) {
- nodeList.Remove (node);
- return node;
- }
-
- return null;
- }
-
- public virtual XmlNode SetNamedItem (XmlNode node)
- {
- if (readOnly || (node.OwnerDocument != parent.OwnerDocument))
- throw new ArgumentException ("Cannot add to NodeMap.");
-
- foreach (XmlNode x in nodeList)
- if (x.Name == node.Name) {
- nodeList.Remove (x);
- nodeList.Add (node);
- return x;
- }
-
- nodeList.Add (node);
- return null;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs b/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
deleted file mode 100644
index 56dcaf5d88c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// XmlNamespaceManager.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System.Collections;
-
-namespace System.Xml
-{
- public class XmlNamespaceManager : IEnumerable
- {
- #region Fields
-
- private XmlNameTable nameTable;
- private NamespaceScope currentScope;
-
- #endregion
-
- #region Constructor
-
- public XmlNamespaceManager (XmlNameTable nameTable)
- {
- this.nameTable = nameTable;
-
- nameTable.Add ("xmlns");
- nameTable.Add ("xml");
- nameTable.Add (String.Empty);
- nameTable.Add ("http://www.w3.org/2000/xmlns/");
- nameTable.Add ("http://www.w3.org/XML/1998/namespace");
-
- PushScope ();
- }
-
- #endregion
-
- #region Properties
-
- public virtual string DefaultNamespace {
- get { return LookupNamespace (String.Empty); }
- }
-
- public XmlNameTable NameTable {
- get { return nameTable; }
- }
-
- #endregion
-
- #region Methods
-
- public virtual void AddNamespace (string prefix, string uri)
- {
- if (prefix == null)
- throw new ArgumentNullException ("prefix", "Value cannot be null.");
-
- if (uri == null)
- throw new ArgumentNullException ("uri", "Value cannot be null.");
-
- if (prefix.Length > 2 && prefix.Substring (0, 3).ToLower () == "xml")
- throw new ArgumentException ("Prefixes beginning with \"xml\" (regardless of whether the characters are uppercase, lowercase, or some combination thereof) are reserved for use by XML.", "prefix");
-
- if (currentScope.Namespaces == null)
- currentScope.Namespaces = new Hashtable ();
-
- currentScope.Namespaces.Add (nameTable.Add (prefix), nameTable.Add (uri));
- }
-
- [MonoTODO]
- public virtual IEnumerator GetEnumerator ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual bool HasNamespace (string prefix)
- {
- return currentScope != null && currentScope.Namespaces != null && currentScope.Namespaces.Contains (prefix);
- }
-
- public virtual string LookupNamespace (string prefix)
- {
- NamespaceScope scope = currentScope;
-
- while (scope != null) {
- if (scope.Namespaces != null && scope.Namespaces.Contains (prefix))
- return scope.Namespaces[prefix] as string;
- scope = scope.Next;
- }
-
- switch (prefix) {
- case "xmlns":
- return nameTable.Get ("http://www.w3.org/2000/xmlns/");
- case "xml":
- return nameTable.Get ("http://www.w3.org/XML/1998/namespace");
- case "":
- return nameTable.Get (String.Empty);
- }
-
- return null;
- }
-
- public virtual string LookupPrefix (string uri)
- {
- if (uri == null)
- return null;
-
- NamespaceScope scope = currentScope;
-
- while (scope != null)
- {
- if (scope.Namespaces != null && scope.Namespaces.ContainsValue (uri)) {
- foreach (DictionaryEntry entry in scope.Namespaces) {
- if (entry.Value.ToString() == uri)
- return nameTable.Get (entry.Key as string) as string;
- }
- }
-
- scope = scope.Next;
- }
-
- return String.Empty;
- }
-
- public virtual bool PopScope ()
- {
- if (currentScope != null)
- currentScope = currentScope.Next;
-
- return currentScope != null;
- }
-
- public virtual void PushScope ()
- {
- NamespaceScope newScope = new NamespaceScope ();
- newScope.Next = currentScope;
- currentScope = newScope;
- }
-
- [MonoTODO]
- public virtual void RemoveNamespace (string prefix, string uri)
- {
- throw new NotImplementedException ();
- }
-
- #endregion
- }
-
- internal class NamespaceScope
- {
- internal NamespaceScope Next;
- internal Hashtable Namespaces;
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNode.cs b/mcs/class/System.XML/System.Xml/XmlNode.cs
deleted file mode 100644
index ca9df1ee022..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNode.cs
+++ /dev/null
@@ -1,385 +0,0 @@
-//
-// System.Xml.XmlNode
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Xml.XPath;
-
-namespace System.Xml
-{
- public abstract class XmlNode : ICloneable, IEnumerable, IXPathNavigable
- {
- #region Fields
-
- XmlDocument ownerDocument;
- XmlNode parentNode;
-
- #endregion
-
- #region Constructors
-
- internal XmlNode (XmlDocument ownerDocument)
- {
- this.ownerDocument = ownerDocument;
- }
-
- #endregion
-
- #region Properties
-
- public virtual XmlAttributeCollection Attributes
- {
- get { return null; }
- }
-
- public virtual string BaseURI
- {
- get { return ParentNode.BaseURI; }
- }
-
- public virtual XmlNodeList ChildNodes {
- get {
- return new XmlNodeListChildren(this);
- }
- }
-
- public virtual XmlNode FirstChild {
- get {
- if (LastChild != null) {
- return LastLinkedChild.NextLinkedSibling;
- }
- else {
- return null;
- }
- }
- }
-
- public virtual bool HasChildNodes {
- get { return LastChild != null; }
- }
-
- [MonoTODO]
- public virtual string InnerText {
- get {
- StringBuilder builder = new StringBuilder ();
- AppendChildValues (this, builder);
- return builder.ToString ();
- }
-
- set { throw new NotImplementedException (); }
- }
-
- private void AppendChildValues(XmlNode parent, StringBuilder builder)
- {
- XmlNode node = parent.FirstChild;
-
- while (node != null) {
- builder.Append (node.Value);
- AppendChildValues (node, builder);
- node = node.NextSibling;
- }
- }
-
- [MonoTODO("Setter.")]
- public virtual string InnerXml {
- get {
- StringWriter sw = new StringWriter ();
- XmlTextWriter xtw = new XmlTextWriter (sw);
-
- WriteContentTo(xtw);
-
- return sw.GetStringBuilder().ToString();
- }
-
- set { throw new NotImplementedException (); }
- }
-
- public virtual bool IsReadOnly {
- get { return false; }
- }
-
- [System.Runtime.CompilerServices.IndexerName("Item")]
- public virtual XmlElement this [string name] {
- get {
- foreach (XmlNode node in ChildNodes) {
- if ((node.NodeType == XmlNodeType.Element) &&
- (node.Name == name)) {
- return (XmlElement) node;
- }
- }
-
- return null;
- }
- }
-
- [System.Runtime.CompilerServices.IndexerName("Item")]
- public virtual XmlElement this [string localname, string ns] {
- get {
- foreach (XmlNode node in ChildNodes) {
- if ((node.NodeType == XmlNodeType.Element) &&
- (node.LocalName == localname) &&
- (node.NamespaceURI == ns)) {
- return (XmlElement) node;
- }
- }
-
- return null;
- }
- }
-
- public virtual XmlNode LastChild {
- get { return LastLinkedChild; }
- }
-
- internal virtual XmlLinkedNode LastLinkedChild {
- get { return null; }
- set { }
- }
-
- public abstract string LocalName { get; }
-
- public abstract string Name { get; }
-
- public virtual string NamespaceURI {
- get { return String.Empty; }
- }
-
- public virtual XmlNode NextSibling {
- get { return null; }
- }
-
- public abstract XmlNodeType NodeType { get; }
-
- public virtual string OuterXml {
- get {
- StringWriter sw = new StringWriter ();
- XmlTextWriter xtw = new XmlTextWriter (sw);
-
- WriteTo(xtw);
-
- return sw.GetStringBuilder().ToString();
- }
- }
-
- public virtual XmlDocument OwnerDocument {
- get { return ownerDocument; }
- }
-
- public virtual XmlNode ParentNode {
- get { return parentNode; }
- }
-
- public virtual string Prefix {
- get { return String.Empty; }
- set {}
- }
-
- public virtual XmlNode PreviousSibling {
- get { return null; }
- }
-
- public virtual string Value {
- get { return null; }
- set { throw new InvalidOperationException ("This node does not have a value"); }
- }
-
- #endregion
-
- #region Methods
-
- public virtual XmlNode AppendChild (XmlNode newChild)
- {
- if (NodeType == XmlNodeType.Document
- || NodeType == XmlNodeType.Element
- || NodeType == XmlNodeType.Attribute) {
- XmlLinkedNode newLinkedChild = (XmlLinkedNode) newChild;
- XmlLinkedNode lastLinkedChild = LastLinkedChild;
-
- newLinkedChild.parentNode = this;
-
- if (lastLinkedChild != null) {
- newLinkedChild.NextLinkedSibling = lastLinkedChild.NextLinkedSibling;
- lastLinkedChild.NextLinkedSibling = newLinkedChild;
- } else
- newLinkedChild.NextLinkedSibling = newLinkedChild;
-
- LastLinkedChild = newLinkedChild;
-
- return newChild;
- } else
- throw new InvalidOperationException();
- }
-
- [MonoTODO]
- public virtual XmlNode Clone ()
- {
- throw new NotImplementedException ();
- }
-
- public abstract XmlNode CloneNode (bool deep);
-
- [MonoTODO]
- public virtual XPathNavigator CreateNavigator ()
- {
- return new XmlDocumentNavigator(this);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new XmlNodeListChildren(this).GetEnumerator();
- }
-
- [MonoTODO]
- public virtual string GetNamespaceOfPrefix (string prefix)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual string GetPrefixOfNamespace (string namespaceURI)
- {
- throw new NotImplementedException ();
- }
-
- object ICloneable.Clone ()
- {
- return Clone ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- [MonoTODO]
- public virtual XmlNode InsertAfter (XmlNode newChild, XmlNode refChild)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlNode InsertBefore (XmlNode newChild, XmlNode refChild)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void Normalize ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlNode PrependChild (XmlNode newChild)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void RemoveAll ()
- {
- LastLinkedChild = null;
- }
-
- public virtual XmlNode RemoveChild (XmlNode oldChild)
- {
- if (NodeType == XmlNodeType.Document || NodeType == XmlNodeType.Element || NodeType == XmlNodeType.Attribute)
- {
- if (IsReadOnly)
- throw new ArgumentException();
-
- if (Object.ReferenceEquals(LastLinkedChild, LastLinkedChild.NextLinkedSibling) && Object.ReferenceEquals(LastLinkedChild, oldChild))
- LastLinkedChild = null;
- else {
- XmlLinkedNode oldLinkedChild = (XmlLinkedNode)oldChild;
- XmlLinkedNode beforeLinkedChild = LastLinkedChild;
-
- while (!Object.ReferenceEquals(beforeLinkedChild.NextLinkedSibling, LastLinkedChild) && !Object.ReferenceEquals(beforeLinkedChild.NextLinkedSibling, oldLinkedChild))
- beforeLinkedChild = beforeLinkedChild.NextLinkedSibling;
-
- if (!Object.ReferenceEquals(beforeLinkedChild.NextLinkedSibling, oldLinkedChild))
- throw new ArgumentException();
-
- beforeLinkedChild.NextLinkedSibling = oldLinkedChild.NextLinkedSibling;
- oldLinkedChild.NextLinkedSibling = null;
- }
-
- return oldChild;
- }
- else
- throw new ArgumentException();
- }
-
- [MonoTODO]
- public virtual XmlNode ReplaceChild (XmlNode newChild, XmlNode oldChild)
- {
- throw new NotImplementedException ();
- }
-
- public XmlNodeList SelectNodes (string xpath)
- {
- return SelectNodes (xpath, null);
- }
-
- [MonoTODO]
- public XmlNodeList SelectNodes (string xpath, XmlNamespaceManager nsmgr)
- {
- XPathNavigator nav = CreateNavigator ();
- XPathExpression expr = nav.Compile (xpath);
- if (nsmgr != null)
- expr.SetContext (nsmgr);
- XPathNodeIterator iter = nav.Select (expr);
- if (!iter.MoveNext ())
- return null;
- ArrayList rgNodes = new ArrayList ();
- do
- {
- rgNodes.Add (((XmlDocumentNavigator) iter.Current).Node);
- }
- while (iter.MoveNext ());
- return new XmlNodeArrayList (rgNodes);
- }
-
- public XmlNode SelectSingleNode (string xpath)
- {
- return SelectSingleNode (xpath, null);
- }
-
- [MonoTODO]
- public XmlNode SelectSingleNode (string xpath, XmlNamespaceManager nsmgr)
- {
- XPathNavigator nav = CreateNavigator ();
- XPathExpression expr = nav.Compile (xpath);
- if (nsmgr != null)
- expr.SetContext (nsmgr);
- XPathNodeIterator iter = nav.Select (expr);
- if (!iter.MoveNext ())
- return null;
- return ((XmlDocumentNavigator) iter.Current).Node;
- }
-
- internal void SetParentNode (XmlNode parent)
- {
- parentNode = parent;
- }
-
- [MonoTODO]
- public virtual bool Supports (string feature, string version)
- {
- throw new NotImplementedException ();
- }
-
- public abstract void WriteContentTo (XmlWriter w);
-
- public abstract void WriteTo (XmlWriter w);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeArrayList.cs b/mcs/class/System.XML/System.Xml/XmlNodeArrayList.cs
deleted file mode 100644
index a62fd77f401..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeArrayList.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Xml.XmlNodeArrayList
-//
-// Author:
-// Piers Haken <piersh@friskit.com>
-//
-// (C) 2002 Piers Haken
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- internal class XmlNodeArrayList : XmlNodeList
- {
- ArrayList _rgNodes;
-
- public XmlNodeArrayList (ArrayList rgNodes)
- {
- _rgNodes = rgNodes;
- }
-
- public override int Count { get { return _rgNodes.Count; } }
-
- public override IEnumerator GetEnumerator ()
- {
- return _rgNodes.GetEnumerator ();
- }
-
- public override XmlNode Item (int index)
- {
- return (XmlNode) _rgNodes [index];
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs b/mcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs
deleted file mode 100755
index 811edfd92f0..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeChangedAction.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Enumeration of node changed actions.
- /// </summary>
- public enum XmlNodeChangedAction
- {
-
- /// <summary>
- /// A node is being inserted in the tree
- /// </summary>
- Insert = 0,
-
- /// <summary>
- /// A node is being removed from the tree.
- /// </summary>
- Remove = 1,
-
- /// <summary>
- /// A node is being changed.
- /// </summary>
- Change = 2,
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs b/mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs
deleted file mode 100644
index 29a842ad55d..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeChangedEventArgs.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- /// <summary>
- /// Passed to delegates on document tree changes
- /// </summary>
- public class XmlNodeChangedEventArgs
- {
- // Private data members
- XmlNode _oldParent;
- XmlNode _newParent;
- XmlNodeChangedAction _action;
- XmlNode _node;
-
- // public properties
- public XmlNodeChangedAction Action
- {
- get
- {
- return _action;
- }
- }
-
- public XmlNode Node
- {
- get
- {
- return _node;
- }
- }
-
-
- public XmlNode OldParent
- {
- get
- {
- return _oldParent;
- }
- }
-
-
- public XmlNode NewParent
- {
- get
- {
- return _newParent;
- }
- }
-
-
- // Public Methods
- // Internal Methods
- internal XmlNodeChangedEventArgs(
- XmlNodeChangedAction action,
- XmlNode node,
- XmlNode oldParent,
- XmlNode newParent)
- {
- _node = node;
- _oldParent = oldParent;
- _newParent = newParent;
- _action = action;
- }
-
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeChangedEventHandler.cs b/mcs/class/System.XML/System.Xml/XmlNodeChangedEventHandler.cs
deleted file mode 100755
index 161482276d2..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeChangedEventHandler.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Xml.XmlNodeChangedEventHandler.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public delegate void XmlNodeChangedEventHandler (Object sender,
- XmlNodeChangedEventArgs e);
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeList.cs b/mcs/class/System.XML/System.Xml/XmlNodeList.cs
deleted file mode 100644
index eff56279b55..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeList.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Xml.XmlNodeList
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- public abstract class XmlNodeList : IEnumerable
- {
- #region Constructors
-
- protected XmlNodeList() { }
-
- #endregion
-
- #region Properties
-
- public abstract int Count { get; }
-
- [System.Runtime.CompilerServices.IndexerName("ItemOf")]
- public virtual XmlNode this [int i] {
- get { return Item(i); }
- }
-
- #endregion
-
- #region Methods
-
- public abstract IEnumerator GetEnumerator ();
-
- public abstract XmlNode Item (int index);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeListChildren.cs b/mcs/class/System.XML/System.Xml/XmlNodeListChildren.cs
deleted file mode 100644
index c5d62823503..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeListChildren.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-// System.Xml.XmlNodeList
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-using System.Collections;
-
-namespace System.Xml
-{
- internal class XmlNodeListChildren : XmlNodeList
- {
- #region Enumerator
-
- private class Enumerator : IEnumerator
- {
- XmlNode parent;
- XmlLinkedNode currentChild;
- bool passedLastNode;
-
- internal Enumerator (XmlNode parent)
- {
- currentChild = null;
- this.parent = parent;
- passedLastNode = false;
- }
-
- public virtual object Current {
- get {
- if ((currentChild == null) ||
- (parent.LastLinkedChild == null) ||
- (passedLastNode == true))
- throw new InvalidOperationException();
-
- return currentChild;
- }
- }
-
- public virtual bool MoveNext()
- {
- bool movedNext = true;
-
- if (parent.LastLinkedChild == null) {
- movedNext = false;
- }
- else if (currentChild == null) {
- currentChild = parent.LastLinkedChild.NextLinkedSibling;
- }
- else {
- if (Object.ReferenceEquals(currentChild, parent.LastLinkedChild)) {
- movedNext = false;
- passedLastNode = true;
- }
- else {
- currentChild = currentChild.NextLinkedSibling;
- }
- }
-
- return movedNext;
- }
-
- public virtual void Reset()
- {
- currentChild = null;
- }
- }
-
- #endregion
-
- #region Fields
-
- XmlNode parent;
-
- #endregion
-
- #region Constructors
- public XmlNodeListChildren(XmlNode parent)
- {
- this.parent = parent;
- }
-
- #endregion
-
- #region Properties
-
- public override int Count {
- get {
- int count = 0;
-
- if (parent.LastLinkedChild != null) {
- XmlLinkedNode currentChild = parent.LastLinkedChild.NextLinkedSibling;
-
- count = 1;
- while (!Object.ReferenceEquals(currentChild, parent.LastLinkedChild)) {
- currentChild = currentChild.NextLinkedSibling;
- count++;
- }
- }
-
- return count;
- }
- }
-
- #endregion
-
- #region Methods
-
- public override IEnumerator GetEnumerator ()
- {
- return new Enumerator(parent);
- }
-
- public override XmlNode Item (int index)
- {
- XmlNode requestedNode = null;
-
- // Instead of checking for && index < Count which has to walk
- // the whole list to get a count, we'll just keep a count since
- // we have to walk the list anyways to get to index.
- if ((index >= 0) && (parent.LastLinkedChild != null)) {
- XmlLinkedNode currentChild = parent.LastLinkedChild.NextLinkedSibling;
- int count = 0;
-
- while ((count < index) && !Object.ReferenceEquals(currentChild, parent.LastLinkedChild))
- {
- currentChild = currentChild.NextLinkedSibling;
- count++;
- }
-
- if (count == index) {
- requestedNode = currentChild;
- }
- }
-
- return requestedNode;
- }
-
- #endregion
- }
-
-
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs b/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs
deleted file mode 100755
index 9550967bbe6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeOrder.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Xml.XmlNodeOrder.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- [Serializable]
- public enum XmlNodeOrder
- {
- Before = 0,
- After = 1,
- Same = 2,
- Unknown = 3,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeReader.cs b/mcs/class/System.XML/System.Xml/XmlNodeReader.cs
deleted file mode 100755
index 064ac473d14..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeReader.cs
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// System.Xml.XmlNodeReader.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- public class XmlNodeReader : XmlReader
- {
- #region Constructor
-
- [MonoTODO]
- public XmlNodeReader (XmlNode node)
- {
- }
-
- #endregion
-
- #region Properties
-
- [MonoTODO]
- public override int AttributeCount {
- get { return 0; }
- }
-
- [MonoTODO]
- public override string BaseURI {
- get { return null; }
- }
-
- [MonoTODO]
- public override bool CanResolveEntity {
- get { return false; }
- }
-
- [MonoTODO]
- public override int Depth {
- get { return 0; }
- }
-
- [MonoTODO]
- public override bool EOF {
- get { return false; }
- }
-
- [MonoTODO]
- public override bool HasAttributes {
- get { return false; }
- }
-
- [MonoTODO]
- public override bool HasValue {
- get { return false; }
- }
-
- [MonoTODO]
- public override bool IsDefault {
- get { return false; }
- }
-
- [MonoTODO]
- public override bool IsEmptyElement {
- get { return false; }
- }
-
- [MonoTODO]
- public override string this [int i] {
- get { return null; }
- }
-
- [MonoTODO]
- public override string this [string name] {
- get { return null; }
- }
-
- [MonoTODO]
- public override string this [string name, string namespaceURI] {
- get { return null; }
- }
-
- [MonoTODO]
- public override string LocalName {
- get { return null; }
- }
-
- [MonoTODO]
- public override string Name {
- get { return null; }
- }
-
- [MonoTODO]
- public override string NamespaceURI {
- get { return null; }
- }
-
- [MonoTODO]
- public override XmlNameTable NameTable {
- get { return null; }
- }
-
- [MonoTODO]
- public override XmlNodeType NodeType {
- get { return 0; }
- }
-
- [MonoTODO]
- public override string Prefix {
- get { return null; }
- }
-
- public override char QuoteChar {
- get { return '"'; }
- }
-
- [MonoTODO]
- public override ReadState ReadState {
- get { return 0; }
- }
-
- [MonoTODO]
- public override string Value {
- get { return null; }
- }
-
- [MonoTODO]
- public override string XmlLang {
- get { return null; }
- }
-
- [MonoTODO]
- public override XmlSpace XmlSpace {
- get { return 0; }
- }
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override void Close ()
- {
- }
-
- [MonoTODO]
- public override string GetAttribute (int attributeIndex)
- {
- return null;
- }
-
- [MonoTODO]
- public override string GetAttribute (string name)
- {
- return null;
- }
-
- [MonoTODO]
- public override string GetAttribute (string name, string namespaceURI)
- {
- return null;
- }
-
- [MonoTODO]
- public override string LookupNamespace (string prefix)
- {
- return null;
- }
-
- [MonoTODO]
- public override void MoveToAttribute (int attributeIndex)
- {
- }
-
- [MonoTODO]
- public override bool MoveToAttribute (string name)
- {
- return false;
- }
-
- [MonoTODO]
- public override bool MoveToAttribute (string name, string namespaceURI)
- {
- return false;
- }
-
- [MonoTODO]
- public override bool MoveToElement ()
- {
- return false;
- }
-
- [MonoTODO]
- public override bool MoveToFirstAttribute ()
- {
- return false;
- }
-
- [MonoTODO]
- public override bool MoveToNextAttribute ()
- {
- return false;
- }
-
- [MonoTODO]
- public override bool Read ()
- {
- return false;
- }
-
- [MonoTODO]
- public override bool ReadAttributeValue ()
- {
- return false;
- }
-
- [MonoTODO]
- public override string ReadInnerXml ()
- {
- return null;
- }
-
- [MonoTODO]
- public override string ReadOuterXml ()
- {
- return null;
- }
-
- [MonoTODO]
- public override string ReadString ()
- {
- return null;
- }
-
- [MonoTODO]
- public override void ResolveEntity ()
- {
- }
-
- [MonoTODO]
- public override void Skip ()
- {
- }
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlNodeType.cs b/mcs/class/System.XML/System.Xml/XmlNodeType.cs
deleted file mode 100644
index 8ed73dd8db6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNodeType.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// XmlNodeType.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:31:46 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// </summary>
- public enum XmlNodeType {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Element = 1,
-
- /// <summary>
- /// </summary>
- Attribute = 2,
-
- /// <summary>
- /// </summary>
- Text = 3,
-
- /// <summary>
- /// </summary>
- CDATA = 4,
-
- /// <summary>
- /// </summary>
- EntityReference = 5,
-
- /// <summary>
- /// </summary>
- Entity = 6,
-
- /// <summary>
- /// </summary>
- ProcessingInstruction = 7,
-
- /// <summary>
- /// </summary>
- Comment = 8,
-
- /// <summary>
- /// </summary>
- Document = 9,
-
- /// <summary>
- /// </summary>
- DocumentType = 10,
-
- /// <summary>
- /// </summary>
- DocumentFragment = 11,
-
- /// <summary>
- /// </summary>
- Notation = 12,
-
- /// <summary>
- /// </summary>
- Whitespace = 13,
-
- /// <summary>
- /// </summary>
- SignificantWhitespace = 14,
-
- /// <summary>
- /// </summary>
- EndElement = 15,
-
- /// <summary>
- /// </summary>
- EndEntity = 16,
-
- /// <summary>
- /// </summary>
- XmlDeclaration = 17,
- } // XmlNodeType
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlNotation.cs b/mcs/class/System.XML/System.Xml/XmlNotation.cs
deleted file mode 100755
index 7a8ddbd91c8..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlNotation.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.Xml.XmlNotation.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-namespace System.Xml
-{
- public class XmlNotation : XmlNode
- {
- #region Fields
-
- string localName;
- string publicId;
- string systemId;
- string prefix;
-
- #endregion
-
- #region Constructor
-
- internal XmlNotation (string localName, string prefix, string publicId,
- string systemId, XmlDocument doc)
- : base (doc)
- {
- this.localName = localName;
- this.prefix = prefix;
- this.publicId = publicId;
- this.systemId = systemId;
- }
-
- #endregion
-
- #region Properties
-
- public override string InnerXml {
- get { return String.Empty; }
- set { throw new InvalidOperationException ("This operation is not allowed."); }
- }
-
- public override bool IsReadOnly {
- get { return true; } // Notation nodes are always read-only
- }
-
- public override string LocalName {
- get { return localName; }
- }
-
- public override string Name {
- get { return prefix + ":" + localName; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.Notation; }
- }
-
- public override string OuterXml {
- get { return String.Empty; }
- }
-
- public string PublicId {
- get {
- if (publicId != null)
- return publicId;
- else
- return null;
- }
- }
-
- public string SystemId {
- get {
- if (systemId != null)
- return systemId;
- else
- return null;
- }
- }
-
- #endregion
-
- #region Methods
-
- public override XmlNode CloneNode (bool deep)
- {
- throw new InvalidOperationException ("This operation is not allowed.");
- }
-
- public override void WriteContentTo (XmlWriter w) { } // has no effect.
-
- public override void WriteTo (XmlWriter w) { } // has no effect.
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlParserContext.cs b/mcs/class/System.XML/System.Xml/XmlParserContext.cs
deleted file mode 100644
index 58c5536a6d1..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlParserContext.cs
+++ /dev/null
@@ -1,186 +0,0 @@
-//
-// System.Xml.XmlParserContext
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001, 2002 Jason Diamond http://injektilo.org/
-//
-
-using System.Text;
-
-namespace System.Xml
-{
- public class XmlParserContext
- {
- #region Constructors
-
- public XmlParserContext (
- XmlNameTable nt,
- XmlNamespaceManager nsMgr,
- string xmlLang,
- XmlSpace xmlSpace) :
-
- this (
- nt,
- nsMgr,
- null,
- null,
- null,
- null,
- null,
- xmlLang,
- xmlSpace,
- null
- )
- {
- }
-
- public XmlParserContext (
- XmlNameTable nt,
- XmlNamespaceManager nsMgr,
- string xmlLang,
- XmlSpace xmlSpace,
- Encoding enc) :
-
- this (
- nt,
- nsMgr,
- null,
- null,
- null,
- null,
- null,
- xmlLang,
- xmlSpace,
- enc
- )
- {
- }
-
- public XmlParserContext (
- XmlNameTable nt,
- XmlNamespaceManager nsMgr,
- string docTypeName,
- string pubId,
- string sysId,
- string internalSubset,
- string baseURI,
- string xmlLang,
- XmlSpace xmlSpace) :
-
- this (
- nt,
- nsMgr,
- null,
- null,
- null,
- null,
- null,
- xmlLang,
- xmlSpace,
- null
- )
- {
- }
-
- public XmlParserContext (
- XmlNameTable nt,
- XmlNamespaceManager nsMgr,
- string docTypeName,
- string pubId,
- string sysId,
- string internalSubset,
- string baseURI,
- string xmlLang,
- XmlSpace xmlSpace,
- Encoding enc)
- {
- if (nt == null)
- this.nameTable = nsMgr.NameTable;
- else
- this.NameTable = nt;
-
- this.namespaceManager = nsMgr;
- this.docTypeName = docTypeName;
- this.publicID = pubId;
- this.systemID = sysId;
- this.internalSubset = internalSubset;
- this.baseURI = baseURI;
- this.xmlLang = xmlLang;
- this.xmlSpace = xmlSpace;
- this.encoding = enc;
- }
-
- #endregion
-
- #region Fields
-
- private string baseURI;
- private string docTypeName;
- private Encoding encoding;
- private string internalSubset;
- private XmlNamespaceManager namespaceManager;
- private XmlNameTable nameTable;
- private string publicID;
- private string systemID;
- private string xmlLang;
- private XmlSpace xmlSpace;
-
- #endregion
-
- #region Properties
-
- public string BaseURI {
- get { return baseURI; }
- set { baseURI = value; }
- }
-
- public string DocTypeName {
- get { return docTypeName; }
- set { docTypeName = value; }
- }
-
- public Encoding Encoding {
- get { return encoding; }
- set { encoding = value; }
- }
-
- public string InternalSubset {
- get { return internalSubset; }
- set { internalSubset = value; }
- }
-
- public XmlNamespaceManager NamespaceManager {
- get { return namespaceManager; }
- set { namespaceManager = value; }
- }
-
- public XmlNameTable NameTable {
- get { return nameTable; }
- set { nameTable = value; }
- }
-
- public string PublicId {
- get { return publicID; }
- set { publicID = value; }
- }
-
- public string SystemId {
- get { return systemID; }
- set { systemID = value; }
- }
-
- public string XmlLang {
- get { return xmlLang; }
- set { xmlLang = value; }
- }
-
- public XmlSpace XmlSpace {
- get { return xmlSpace; }
- set { xmlSpace = value; }
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs b/mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs
deleted file mode 100644
index c328935a7fe..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlProcessingInstruction.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// System.Xml.XmlProcessingInstruction
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlProcessingInstruction : XmlLinkedNode
- {
- string target;
- string data;
-
- #region Constructors
-
- protected internal XmlProcessingInstruction (string target, string data, XmlDocument doc) : base(doc)
- {
- if (data == null)
- data = String.Empty;
-
- this.target = target;
- this.data = data;
- }
-
- #endregion
-
- #region Properties
-
- public string Data
- {
- get { return data; }
-
- set { data = value; }
- }
-
- public override string InnerText
- {
- get { return Data; }
- set { data = value; }
- }
-
- public override string LocalName
- {
- get { return target; }
- }
-
- public override string Name
- {
- get { return target; }
- }
-
- public override XmlNodeType NodeType
- {
- get { return XmlNodeType.ProcessingInstruction; }
- }
-
- public string Target
- {
- get { return target; }
- }
-
- public override string Value
- {
- get { return data; }
- set {
- if (this.IsReadOnly)
- throw new ArgumentException ("This node is read-only.");
- else
- data = value;
- }
- }
-
- #endregion
-
- #region Methods
-
- public override XmlNode CloneNode (bool deep)
- {
- return new XmlProcessingInstruction (target, data, OwnerDocument);
- }
-
- public override void WriteContentTo (XmlWriter w) { }
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteProcessingInstruction (target, data);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs b/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs
deleted file mode 100644
index c7c8197ff7f..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlQualifiedName.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// System.Xml.XmlQualifiedName.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-// Modified:
-// 21st June 2002 : Ajay kumar Dwivedi (adwiv@yahoo.com)
-
-using System;
-
-namespace System.Xml
-{
- public class XmlQualifiedName
- {
- // Constructors
- public XmlQualifiedName ()
- : this (string.Empty, string.Empty)
- {
- }
-
- public XmlQualifiedName (string name)
- : this (name, string.Empty)
- {
- }
-
- public XmlQualifiedName (string name, string ns)
- : base ()
- {
- this.name = name;
- this.ns = ns;
- }
-
- // Fields
- public static readonly XmlQualifiedName Empty = new XmlQualifiedName ();
- private string name;
- private string ns;
-
- // Properties
- public bool IsEmpty
- {
- get {
- if ((name == String.Empty) && (ns == String.Empty))
- return true;
- else
- return false;
- }
- }
-
- public string Name
- {
- get { return name; }
- }
-
- public string Namespace
- {
- get { return ns; }
- }
-
- // Methods
- public override bool Equals (object other)
- {
- if(!(other is XmlQualifiedName))
- return false;
-
- if ((XmlQualifiedName) this == (XmlQualifiedName) other)
- return true;
- else
- return false;
- }
-
- public override int GetHashCode ()
- {
- return unchecked (name.GetHashCode() + ns.GetHashCode());
- }
-
- public override string ToString ()
- {
- if (ns == null)
- return name;
- else
- return ns + ":" + name;
- }
-
- public static string ToString (string name, string ns)
- {
- if (ns == string.Empty)
- return name;
- else
- return ns + ":" + name;
- }
-
- // Operators
- public static bool operator == (XmlQualifiedName a, XmlQualifiedName b)
- {
- if((Object)a == null || (Object)b == null)
- return false;
-
- if ((a.Name == b.Name) && (a.Namespace == b.Namespace))
- return true;
- else
- return false;
- }
-
- public static bool operator != (XmlQualifiedName a, XmlQualifiedName b)
- {
- if (a == b)
- return false;
- else
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System.XML/System.Xml/XmlReader.cs b/mcs/class/System.XML/System.Xml/XmlReader.cs
deleted file mode 100644
index c2cd2f6541a..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlReader.cs
+++ /dev/null
@@ -1,241 +0,0 @@
-//
-// XmlReader.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001, 2002 Jason Diamond http://injektilo.org/
-//
-
-namespace System.Xml
-{
- public abstract class XmlReader
- {
- #region Constructor
-
- protected XmlReader ()
- {
- }
-
- #endregion
-
- #region Properties
-
- public abstract int AttributeCount { get; }
-
- public abstract string BaseURI { get; }
-
- public virtual bool CanResolveEntity
- {
- get { return false; }
- }
-
- public abstract int Depth { get; }
-
- public abstract bool EOF { get; }
-
- public virtual bool HasAttributes
- {
- get { return AttributeCount > 0; }
- }
-
- public abstract bool HasValue { get; }
-
- public abstract bool IsDefault { get; }
-
- public abstract bool IsEmptyElement { get; }
-
- public abstract string this[int i] { get; }
-
- public abstract string this[string name] { get; }
-
- public abstract string this[
- string localName,
- string namespaceName]
- { get; }
-
- public abstract string LocalName { get; }
-
- public abstract string Name { get; }
-
- public abstract string NamespaceURI { get; }
-
- public abstract XmlNameTable NameTable { get; }
-
- public abstract XmlNodeType NodeType { get; }
-
- public abstract string Prefix { get; }
-
- public abstract char QuoteChar { get; }
-
- public abstract ReadState ReadState { get; }
-
- public abstract string Value { get; }
-
- public abstract string XmlLang { get; }
-
- public abstract XmlSpace XmlSpace { get; }
-
- #endregion
-
- #region Methods
-
- public abstract void Close ();
-
- public abstract string GetAttribute (int i);
-
- public abstract string GetAttribute (string name);
-
- public abstract string GetAttribute (
- string localName,
- string namespaceName);
-
- public static bool IsName (string s)
- {
- bool result = false;
-
- if (s != null && s.Length > 0) {
- char[] chars = s.ToCharArray ();
-
- if (XmlChar.IsFirstNameChar (chars[0])) {
- int i = 1;
- int n = chars.Length;
-
- while (i < n && XmlChar.IsNameChar (chars[i]))
- ++i;
-
- result = i == n;
- }
- }
-
- return result;
- }
-
- public static bool IsNameToken (string s)
- {
- bool result = false;
-
- if (s != null && s.Length > 0) {
- char[] chars = s.ToCharArray ();
-
- int i = 0;
- int n = chars.Length;
-
- while (i < n && XmlChar.IsNameChar (chars[i]))
- ++i;
-
- result = i == n;
- }
-
- return result;
- }
-
- [MonoTODO]
- public virtual bool IsStartElement ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool IsStartElement (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool IsStartElement (
- string localName,
- string namespaceName)
- {
- throw new NotImplementedException ();
- }
-
- public abstract string LookupNamespace (string prefix);
-
- public abstract void MoveToAttribute (int i);
-
- public abstract bool MoveToAttribute (string name);
-
- public abstract bool MoveToAttribute (
- string localName,
- string namespaceName);
-
- [MonoTODO]
- public virtual XmlNodeType MoveToContent ()
- {
- throw new NotImplementedException ();
- }
-
- public abstract bool MoveToElement ();
-
- public abstract bool MoveToFirstAttribute ();
-
- public abstract bool MoveToNextAttribute ();
-
- public abstract bool Read ();
-
- public abstract bool ReadAttributeValue ();
-
- [MonoTODO]
- public virtual string ReadElementString ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual string ReadElementString (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual string ReadElementString (
- string localName,
- string namespaceName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ReadEndElement ()
- {
- throw new NotImplementedException ();
- }
-
- public abstract string ReadInnerXml ();
-
- public abstract string ReadOuterXml ();
-
- [MonoTODO]
- public virtual void ReadStartElement ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ReadStartElement (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual void ReadStartElement (
- string localName,
- string namespaceName)
- {
- throw new NotImplementedException ();
- }
-
- public abstract string ReadString ();
-
- public abstract void ResolveEntity ();
-
- [MonoTODO]
- public virtual void Skip ()
- {
- throw new NotImplementedException ();
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlResolver.cs b/mcs/class/System.XML/System.Xml/XmlResolver.cs
deleted file mode 100644
index 665dff630e6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlResolver.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Xml.XmlResolver.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Net;
-
-namespace System.Xml
-{
- public abstract class XmlResolver
- {
- public abstract ICredentials Credentials
- {
- set;
- }
-
- public abstract object GetEntity(
- Uri absoluteUri,
- string role,
- Type type);
-
- public abstract Uri ResolveUri(
- Uri baseUri,
- string relativeUri);
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs b/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs
deleted file mode 100644
index d751df66836..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlSignificantWhitespace.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Xml.XmlSignificantWhitespace.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlSignificantWhitespace : XmlCharacterData
- {
- // Constructor
- protected internal XmlSignificantWhitespace (string strData, XmlDocument doc)
- : base (strData, doc)
- {
- }
-
- // Properties
- public override string LocalName {
- get { return "#significant-whitespace"; }
- }
-
- public override string Name {
- get { return "#significant-whitespace"; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.SignificantWhitespace; }
- }
-
- public override string Value {
- get { return Data; }
- [MonoTODO]
- set {
- if (IsValidWhitespaceChar (value) == false)
- throw new ArgumentException ("Invalid whitespace characters.");
- }
- }
-
- // Methods
- public override XmlNode CloneNode (bool deep)
- {
- return new XmlSignificantWhitespace (Data, OwnerDocument);
- }
-
- public override void WriteContentTo (XmlWriter w) {}
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteWhitespace (Data);
- }
-
- private bool IsValidWhitespaceChar (string text)
- {
- foreach (char c in text)
- if ((c != ' ') && (c != '\r') && (c != '\n') && (c != '\t'))
- return false;
- return true;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlSpace.cs b/mcs/class/System.XML/System.Xml/XmlSpace.cs
deleted file mode 100644
index f1e1128ff3c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlSpace.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// XmlSpace.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:31:52 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Xml {
-
-
- /// <summary>
- /// Specifies the current xml:space scope
- /// </summary>
- public enum XmlSpace {
-
- /// <summary>
- /// No xml:space scope.
- /// </summary>
- None = 0,
-
- /// <summary>
- /// the xml:space scope = "default"
- /// </summary>
- Default = 1,
-
- /// <summary>
- /// the xml:space scope = "preserve"
- /// </summary>
- Preserve = 2,
- } // XmlSpace
-
-} // System.Xml
diff --git a/mcs/class/System.XML/System.Xml/XmlText.cs b/mcs/class/System.XML/System.Xml/XmlText.cs
deleted file mode 100644
index 59f2ba1477f..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlText.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Xml.XmlText
-//
-// Author:
-// Jason Diamond <jason@injektilo.org>
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlText : XmlCharacterData
- {
- #region Constructor
-
- protected internal XmlText (string strData, XmlDocument doc) : base(strData, doc)
- {
- }
-
- #endregion
-
- #region Properties
-
- public override string LocalName
- {
- get { return "#text"; }
- }
-
- public override string Name {
- get { return "#text"; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.Text; }
- }
-
- public override string Value {
- get { return Data; }
- set { Data = value; }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override XmlNode CloneNode (bool deep)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual XmlText SplitText (int offset)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteContentTo (XmlWriter w) {}
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteString (Data);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs
deleted file mode 100644
index 0a6ebbdbe19..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs
+++ /dev/null
@@ -1,1280 +0,0 @@
-//
-// System.Xml.XmlTextReader
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-// Adam Treat (manyoso@yahoo.com)
-//
-// (C) 2001, 2002 Jason Diamond http://injektilo.org/
-//
-
-// FIXME:
-// This can only parse basic XML: elements, attributes, processing
-// instructions, and comments are OK.
-//
-// It barfs on DOCTYPE declarations.
-//
-// There's also no checking being done for either well-formedness
-// or validity.
-//
-// NameTables aren't being used everywhere yet.
-//
-// Some thought needs to be given to performance. There's too many
-// strings being allocated.
-//
-// Some of the MoveTo methods haven't been implemented yet.
-//
-// LineNumber and LinePosition aren't being tracked.
-//
-// xml:space, xml:lang, and xml:base aren't being tracked.
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
- public class XmlTextReader : XmlReader, IXmlLineInfo
- {
- #region Constructors
-
- [MonoTODO]
- protected XmlTextReader ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (Stream input)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (string url)
- {
- XmlNameTable nt = new NameTable ();
- XmlNamespaceManager nsMgr = new XmlNamespaceManager (nt);
- parserContext = new XmlParserContext (null, nsMgr, null, XmlSpace.None);
- Init ();
- reader = new StreamReader(url);
- }
-
- [MonoTODO]
- public XmlTextReader (TextReader input)
- {
- XmlNameTable nt = new NameTable ();
- XmlNamespaceManager nsMgr = new XmlNamespaceManager (nt);
- parserContext = new XmlParserContext (null, nsMgr, null, XmlSpace.None);
- Init ();
- reader = input;
- }
-
- [MonoTODO]
- protected XmlTextReader (XmlNameTable nt)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (Stream input, XmlNameTable nt)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (string url, Stream input)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (string url, TextReader input)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (string url, XmlNameTable nt)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (TextReader input, XmlNameTable nt)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (Stream xmlFragment, XmlNodeType fragType, XmlParserContext context)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (string url, Stream input, XmlNameTable nt)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (string url, TextReader input, XmlNameTable nt)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public XmlTextReader (string xmlFragment, XmlNodeType fragType, XmlParserContext context)
- {
- //Waiting for Validating reader for fragType rules.
- parserContext = context;
- Init ();
- reader = new StringReader(xmlFragment);
- }
-
- #endregion
-
- #region Properties
-
- public override int AttributeCount
- {
- get { return attributes.Count; }
- }
-
- [MonoTODO]
- public override string BaseURI
- {
- get { throw new NotImplementedException (); }
- }
-
- public override int Depth
- {
- get { return depth > 0 ? depth : 0; }
- }
-
- [MonoTODO]
- public Encoding Encoding
- {
- get { throw new NotImplementedException (); }
- }
-
- public override bool EOF
- {
- get
- {
- return
- readState == ReadState.EndOfFile ||
- readState == ReadState.Closed;
- }
- }
-
- public override bool HasValue
- {
- get { return value != String.Empty; }
- }
-
- public override bool IsDefault
- {
- get
- {
- // XmlTextReader does not expand default attributes.
- return false;
- }
- }
-
- public override bool IsEmptyElement
- {
- get { return isEmptyElement; }
- }
-
- public override string this [int i]
- {
- get { return GetAttribute (i); }
- }
-
- public override string this [string name]
- {
- get { return GetAttribute (name); }
- }
-
- public override string this [string localName, string namespaceName]
- {
- get { return GetAttribute (localName, namespaceName); }
- }
-
- [MonoTODO]
- public int LineNumber
- {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public int LinePosition
- {
- get { throw new NotImplementedException (); }
- }
-
- public override string LocalName
- {
- get { return localName; }
- }
-
- public override string Name
- {
- get { return name; }
- }
-
- [MonoTODO]
- public bool Namespaces
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- public override string NamespaceURI
- {
- get { return namespaceURI; }
- }
-
- public override XmlNameTable NameTable
- {
- get { return parserContext.NameTable; }
- }
-
- public override XmlNodeType NodeType
- {
- get { return nodeType; }
- }
-
- [MonoTODO]
- public bool Normalization
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- public override string Prefix
- {
- get { return prefix; }
- }
-
- [MonoTODO]
- public override char QuoteChar
- {
- get { throw new NotImplementedException (); }
- }
-
- public override ReadState ReadState
- {
- get { return readState; }
- }
-
- public override string Value
- {
- get { return value; }
- }
-
- [MonoTODO]
- public WhitespaceHandling WhitespaceHandling
- {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override string XmlLang
- {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public XmlResolver XmlResolver
- {
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public override XmlSpace XmlSpace
- {
- get { throw new NotImplementedException (); }
- }
-
- #endregion
-
- #region Methods
-
- [MonoTODO]
- public override void Close ()
- {
- readState = ReadState.Closed;
- }
-
- [MonoTODO]
- public override string GetAttribute (int i)
- {
- throw new NotImplementedException ();
- }
-
- public override string GetAttribute (string name)
- {
- return attributes [name] as string;
- }
-
- public override string GetAttribute (string localName, string namespaceURI)
- {
- foreach (DictionaryEntry entry in attributes)
- {
- string thisName = entry.Key as string;
-
- int indexOfColon = thisName.IndexOf (':');
-
- if (indexOfColon != -1) {
- string thisLocalName = thisName.Substring (indexOfColon + 1);
-
- if (localName == thisLocalName) {
- string thisPrefix = thisName.Substring (0, indexOfColon);
- string thisNamespaceURI = LookupNamespace (thisPrefix);
-
- if (namespaceURI == thisNamespaceURI)
- return attributes [thisName] as string;
- }
- } else if (localName == "xmlns" && namespaceURI == "http://www.w3.org/2000/xmlns/" && thisName == "xmlns")
- return attributes [thisName] as string;
- }
-
- return String.Empty;
- }
-
- [MonoTODO]
- public TextReader GetRemainder ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- bool IXmlLineInfo.HasLineInfo ()
- {
- return false;
- }
-
- public override string LookupNamespace (string prefix)
- {
- return parserContext.NamespaceManager.LookupNamespace (prefix);
- }
-
- [MonoTODO]
- public override void MoveToAttribute (int i)
- {
- throw new NotImplementedException ();
- }
-
- public override bool MoveToAttribute (string name)
- {
- MoveToElement ();
- bool match = false;
-
- if (attributes == null)
- return false;
-
- if (orderedAttributesEnumerator == null) {
- SaveProperties ();
- orderedAttributesEnumerator = orderedAttributes.GetEnumerator ();
- }
-
- while (orderedAttributesEnumerator.MoveNext ()) {
- if(name == orderedAttributesEnumerator.Current as string) {
- match = true;
- break;
- }
- }
-
- if (match) {
-
- string value = attributes [name] as string;
- SetProperties (
- XmlNodeType.Attribute, // nodeType
- name, // name
- false, // isEmptyElement
- value, // value
- false // clearAttributes
- );
- }
-
- return match;
- }
-
- [MonoTODO]
- public override bool MoveToAttribute (string localName, string namespaceName)
- {
- throw new NotImplementedException ();
- }
-
- public override bool MoveToElement ()
- {
- if (orderedAttributesEnumerator != null) {
- orderedAttributesEnumerator = null;
- RestoreProperties ();
- return true;
- }
-
- return false;
- }
-
- public override bool MoveToFirstAttribute ()
- {
- MoveToElement ();
- return MoveToNextAttribute ();
- }
-
- public override bool MoveToNextAttribute ()
- {
- if (attributes == null)
- return false;
-
- if (orderedAttributesEnumerator == null) {
- SaveProperties ();
- orderedAttributesEnumerator = orderedAttributes.GetEnumerator ();
- }
-
- if (orderedAttributesEnumerator.MoveNext ()) {
- string name = orderedAttributesEnumerator.Current as string;
- string value = attributes [name] as string;
- SetProperties (
- XmlNodeType.Attribute, // nodeType
- name, // name
- false, // isEmptyElement
- value, // value
- false // clearAttributes
- );
- return true;
- }
-
- return false;
- }
-
- public override bool Read ()
- {
- bool more = false;
-
- readState = ReadState.Interactive;
-
- more = ReadContent ();
-
- return more;
- }
-
- [MonoTODO]
- public override bool ReadAttributeValue ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int ReadBase64 (byte [] buffer, int offset, int length)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int ReadBinHex (byte [] buffer, int offset, int length)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int ReadChars (char [] buffer, int offset, int length)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ReadInnerXml ()
- {
- // Still need a Well Formedness check.
- // Will wait for Validating reader ;-)
- if (NodeType == XmlNodeType.Attribute) {
- return Value;
- } else {
- saveToXmlBuffer = true;
- string startname = this.Name;
- string endname = string.Empty;
- readState = ReadState.Interactive;
-
- while (startname != endname) {
- ReadContent ();
- endname = this.Name;
- }
-
- xmlBuffer.Replace(currentTag.ToString (), "");
- saveToXmlBuffer = false;
- string InnerXml = xmlBuffer.ToString ();
- xmlBuffer.Length = 0;
- return InnerXml;
- }
- }
-
- [MonoTODO]
- public override string ReadOuterXml ()
- {
- // Still need a Well Formedness check.
- // Will wait for Validating reader ;-)
- if (NodeType == XmlNodeType.Attribute) {
- return Name+"=\""+Value+"\"";
- } else {
- saveToXmlBuffer = true;
- xmlBuffer.Append(currentTag.ToString ());
- string startname = this.Name;
- string endname = string.Empty;
- readState = ReadState.Interactive;
-
- while (startname != endname) {
- ReadContent ();
- endname = this.Name;
- }
- saveToXmlBuffer = false;
- string OuterXml = xmlBuffer.ToString ();
- xmlBuffer.Length = 0;
- return OuterXml;
- }
- }
-
- [MonoTODO]
- public override string ReadString ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void ResetState ()
- {
- throw new NotImplementedException ();
- }
-
- public override void ResolveEntity ()
- {
- // XmlTextReaders don't resolve entities.
- throw new InvalidOperationException ("XmlTextReaders don't resolve entities.");
- }
-
- #endregion
-
- // privates
-
- private XmlParserContext parserContext;
-
- private TextReader reader;
- private ReadState readState;
-
- private int depth;
- private bool depthDown;
-
- private bool popScope;
-
- private XmlNodeType nodeType;
- private string name;
- private string prefix;
- private string localName;
- private string namespaceURI;
- private bool isEmptyElement;
- private string value;
-
- private XmlNodeType saveNodeType;
- private string saveName;
- private string savePrefix;
- private string saveLocalName;
- private string saveNamespaceURI;
- private bool saveIsEmptyElement;
-
- private Hashtable attributes;
- private ArrayList orderedAttributes;
- private IEnumerator orderedAttributesEnumerator;
-
- private bool returnEntityReference;
- private string entityReferenceName;
-
- private char [] nameBuffer;
- private int nameLength;
- private int nameCapacity;
- private const int initialNameCapacity = 256;
-
- private char [] valueBuffer;
- private int valueLength;
- private int valueCapacity;
- private const int initialValueCapacity = 8192;
-
- private StringBuilder xmlBuffer; // This is for Read(Inner|Outer)Xml
- private StringBuilder currentTag; // A buffer for ReadContent for ReadOuterXml
- private bool saveToXmlBuffer;
-
- private void Init ()
- {
- readState = ReadState.Initial;
-
- depth = -1;
- depthDown = false;
-
- popScope = false;
-
- nodeType = XmlNodeType.None;
- name = String.Empty;
- prefix = String.Empty;
- localName = string.Empty;
- isEmptyElement = false;
- value = String.Empty;
-
- attributes = new Hashtable ();
- orderedAttributes = new ArrayList ();
- orderedAttributesEnumerator = null;
-
- returnEntityReference = false;
- entityReferenceName = String.Empty;
-
- nameBuffer = new char [initialNameCapacity];
- nameLength = 0;
- nameCapacity = initialNameCapacity;
-
- valueBuffer = new char [initialValueCapacity];
- valueLength = 0;
- valueCapacity = initialValueCapacity;
-
- xmlBuffer = new StringBuilder ();
- currentTag = new StringBuilder ();
- }
-
- // Use this method rather than setting the properties
- // directly so that all the necessary properties can
- // be changed in harmony with each other. Maybe the
- // fields should be in a seperate class to help enforce
- // this.
- private void SetProperties (
- XmlNodeType nodeType,
- string name,
- bool isEmptyElement,
- string value,
- bool clearAttributes)
- {
- this.nodeType = nodeType;
- this.name = name;
- this.isEmptyElement = isEmptyElement;
- this.value = value;
-
- if (clearAttributes)
- ClearAttributes ();
-
- int indexOfColon = name.IndexOf (':');
-
- if (indexOfColon == -1) {
- prefix = String.Empty;
- localName = name;
- } else {
- prefix = name.Substring (0, indexOfColon);
- localName = name.Substring (indexOfColon + 1);
- }
-
- namespaceURI = LookupNamespace (prefix);
- }
-
- private void SaveProperties ()
- {
- saveNodeType = nodeType;
- saveName = name;
- savePrefix = prefix;
- saveLocalName = localName;
- saveNamespaceURI = namespaceURI;
- saveIsEmptyElement = isEmptyElement;
- // An element's value is always String.Empty.
- }
-
- private void RestoreProperties ()
- {
- nodeType = saveNodeType;
- name = saveName;
- prefix = savePrefix;
- localName = saveLocalName;
- namespaceURI = saveNamespaceURI;
- isEmptyElement = saveIsEmptyElement;
- value = String.Empty;
- }
-
- private void AddAttribute (string name, string value)
- {
- attributes.Add (name, value);
- orderedAttributes.Add (name);
- }
-
- private void ClearAttributes ()
- {
- if (attributes.Count > 0) {
- attributes.Clear ();
- orderedAttributes.Clear ();
- }
-
- orderedAttributesEnumerator = null;
- }
-
- private int PeekChar ()
- {
- return reader.Peek ();
- }
-
- private int ReadChar ()
- {
- int ch = reader.Read ();
- if (saveToXmlBuffer) {
- xmlBuffer.Append ((char) ch);
- }
- currentTag.Append ((char) ch);
- return ch;
- }
-
- // This should really keep track of some state so
- // that it's not possible to have more than one document
- // element or text outside of the document element.
- private bool ReadContent ()
- {
- bool more = false;
- currentTag.Length = 0;
- if (popScope) {
- parserContext.NamespaceManager.PopScope ();
- popScope = false;
- }
-
- if (depthDown)
- --depth;
-
- if (returnEntityReference) {
- ++depth;
- SetEntityReferenceProperties ();
- more = true;
- } else {
- switch (PeekChar ())
- {
- case '<':
- ReadChar ();
- ReadTag ();
- more = true;
- break;
- case -1:
- readState = ReadState.EndOfFile;
- SetProperties (
- XmlNodeType.None, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- String.Empty, // value
- true // clearAttributes
- );
- more = false;
- break;
- default:
- ReadText ();
- more = true;
- break;
- }
- }
-
- return more;
- }
-
- private void SetEntityReferenceProperties ()
- {
- SetProperties (
- XmlNodeType.EntityReference, // nodeType
- entityReferenceName, // name
- false, // isEmptyElement
- String.Empty, // value
- true // clearAttributes
- );
-
- returnEntityReference = false;
- entityReferenceName = String.Empty;
- }
-
- // The leading '<' has already been consumed.
- private void ReadTag ()
- {
- switch (PeekChar ())
- {
- case '/':
- ReadChar ();
- ReadEndTag ();
- break;
- case '?':
- ReadChar ();
- ReadProcessingInstruction ();
- break;
- case '!':
- ReadChar ();
- ReadDeclaration ();
- break;
- default:
- ReadStartTag ();
- break;
- }
- }
-
- // The leading '<' has already been consumed.
- private void ReadStartTag ()
- {
- parserContext.NamespaceManager.PushScope ();
-
- string name = ReadName ();
- SkipWhitespace ();
-
- bool isEmptyElement = false;
-
- ClearAttributes ();
-
- if (XmlChar.IsFirstNameChar (PeekChar ()))
- ReadAttributes ();
-
- if (PeekChar () == '/') {
- ReadChar ();
- isEmptyElement = true;
- depthDown = true;
- popScope = true;
- }
-
- Expect ('>');
-
- ++depth;
-
- SetProperties (
- XmlNodeType.Element, // nodeType
- name, // name
- isEmptyElement, // isEmptyElement
- String.Empty, // value
- false // clearAttributes
- );
- }
-
- // The reader is positioned on the first character
- // of the element's name.
- private void ReadEndTag ()
- {
- string name = ReadName ();
- SkipWhitespace ();
- Expect ('>');
-
- --depth;
-
- SetProperties (
- XmlNodeType.EndElement, // nodeType
- name, // name
- false, // isEmptyElement
- String.Empty, // value
- true // clearAttributes
- );
-
- popScope = true;
- }
-
- private void AppendNameChar (int ch)
- {
- CheckNameCapacity ();
- nameBuffer [nameLength++] = (char)ch;
- }
-
- private void CheckNameCapacity ()
- {
- if (nameLength == nameCapacity) {
- nameCapacity = nameCapacity * 2;
- char [] oldNameBuffer = nameBuffer;
- nameBuffer = new char [nameCapacity];
- Array.Copy (oldNameBuffer, nameBuffer, nameLength);
- }
- }
-
- private string CreateNameString ()
- {
- return new String (nameBuffer, 0, nameLength);
- }
-
- private void AppendValueChar (int ch)
- {
- CheckValueCapacity ();
- valueBuffer [valueLength++] = (char)ch;
- }
-
- private void CheckValueCapacity ()
- {
- if (valueLength == valueCapacity) {
- valueCapacity = valueCapacity * 2;
- char [] oldValueBuffer = valueBuffer;
- valueBuffer = new char [valueCapacity];
- Array.Copy (oldValueBuffer, valueBuffer, valueLength);
- }
- }
-
- private string CreateValueString ()
- {
- return new String (valueBuffer, 0, valueLength);
- }
-
- // The reader is positioned on the first character
- // of the text.
- private void ReadText ()
- {
- valueLength = 0;
-
- int ch = PeekChar ();
-
- while (ch != '<' && ch != -1) {
- if (ch == '&') {
- ReadChar ();
- if (ReadReference (false))
- break;
- } else
- AppendValueChar (ReadChar ());
-
- ch = PeekChar ();
- }
-
- if (returnEntityReference && valueLength == 0) {
- ++depth;
- SetEntityReferenceProperties ();
- } else {
- if (depth >= 0) {
- ++depth;
- depthDown = true;
- }
-
- SetProperties (
- XmlNodeType.Text, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- CreateValueString (), // value
- true // clearAttributes
- );
- }
- }
-
- // The leading '&' has already been consumed.
- // Returns true if the entity reference isn't a simple
- // character reference or one of the predefined entities.
- // This allows the ReadText method to break so that the
- // next call to Read will return the EntityReference node.
- private bool ReadReference (bool ignoreEntityReferences)
- {
- if (PeekChar () == '#') {
- ReadChar ();
- ReadCharacterReference ();
- } else
- ReadEntityReference (ignoreEntityReferences);
-
- return returnEntityReference;
- }
-
- private void ReadCharacterReference ()
- {
- int value = 0;
-
- if (PeekChar () == 'x') {
- ReadChar ();
-
- while (PeekChar () != ';' && PeekChar () != -1) {
- int ch = ReadChar ();
-
- if (ch >= '0' && ch <= '9')
- value = (value << 4) + ch - '0';
- else if (ch >= 'A' && ch <= 'F')
- value = (value << 4) + ch - 'A' + 10;
- else if (ch >= 'a' && ch <= 'f')
- value = (value << 4) + ch - 'a' + 10;
- else
- throw new XmlException (
- String.Format (
- "invalid hexadecimal digit: {0} (#x{1:X})",
- (char)ch,
- ch));
- }
- } else {
- while (PeekChar () != ';' && PeekChar () != -1) {
- int ch = ReadChar ();
-
- if (ch >= '0' && ch <= '9')
- value = value * 10 + ch - '0';
- else
- throw new XmlException (
- String.Format (
- "invalid decimal digit: {0} (#x{1:X})",
- (char)ch,
- ch));
- }
- }
-
- ReadChar (); // ';'
-
- AppendValueChar (value);
- }
-
- private void ReadEntityReference (bool ignoreEntityReferences)
- {
- nameLength = 0;
-
- int ch = PeekChar ();
-
- while (ch != ';' && ch != -1) {
- AppendNameChar (ReadChar ());
- ch = PeekChar ();
- }
-
- Expect (';');
-
- string name = CreateNameString ();
-
- switch (name)
- {
- case "lt":
- AppendValueChar ('<');
- break;
- case "gt":
- AppendValueChar ('>');
- break;
- case "amp":
- AppendValueChar ('&');
- break;
- case "apos":
- AppendValueChar ('\'');
- break;
- case "quot":
- AppendValueChar ('"');
- break;
- default:
- if (ignoreEntityReferences) {
- AppendValueChar ('&');
-
- foreach (char ch2 in name) {
- AppendValueChar (ch2);
- }
-
- AppendValueChar (';');
- } else {
- returnEntityReference = true;
- entityReferenceName = name;
- }
- break;
- }
- }
-
- // The reader is positioned on the first character of
- // the attribute name.
- private void ReadAttributes ()
- {
- do {
- string name = ReadName ();
- SkipWhitespace ();
- Expect ('=');
- SkipWhitespace ();
- string value = ReadAttribute ();
- SkipWhitespace ();
-
- if (name == "xmlns")
- parserContext.NamespaceManager.AddNamespace (String.Empty, value);
- else if (name.StartsWith ("xmlns:"))
- parserContext.NamespaceManager.AddNamespace (name.Substring (6), value);
-
- AddAttribute (name, value);
- } while (PeekChar () != '/' && PeekChar () != '>' && PeekChar () != -1);
- }
-
- // The reader is positioned on the quote character.
- private string ReadAttribute ()
- {
- int quoteChar = ReadChar ();
-
- if (quoteChar != '\'' && quoteChar != '\"')
- throw new XmlException ("an attribute value was not quoted");
-
- valueLength = 0;
-
- while (PeekChar () != quoteChar) {
- int ch = ReadChar ();
-
- switch (ch)
- {
- case '<':
- throw new XmlException ("attribute values cannot contain '<'");
- case '&':
- ReadReference (true);
- break;
- case -1:
- throw new XmlException ("unexpected end of file in an attribute value");
- default:
- AppendValueChar (ch);
- break;
- }
- }
-
- ReadChar (); // quoteChar
-
- return CreateValueString ();
- }
-
- // The reader is positioned on the first character
- // of the target.
- private void ReadProcessingInstruction ()
- {
- string target = ReadName ();
- SkipWhitespace ();
-
- valueLength = 0;
-
- while (PeekChar () != -1) {
- int ch = ReadChar ();
-
- if (ch == '?' && PeekChar () == '>') {
- ReadChar ();
- break;
- }
-
- AppendValueChar ((char)ch);
- }
-
- SetProperties (
- XmlNodeType.ProcessingInstruction, // nodeType
- target, // name
- false, // isEmptyElement
- CreateValueString (), // value
- true // clearAttributes
- );
- }
-
- // The reader is positioned on the first character after
- // the leading '<!'.
- private void ReadDeclaration ()
- {
- int ch = PeekChar ();
-
- switch (ch)
- {
- case '-':
- Expect ('-');
- Expect ('-');
- ReadComment ();
- break;
- case '[':
- ReadChar ();
- Expect ('C');
- Expect ('D');
- Expect ('A');
- Expect ('T');
- Expect ('A');
- Expect ('[');
- ReadCDATA ();
- break;
- }
- }
-
- // The reader is positioned on the first character after
- // the leading '<!--'.
- private void ReadComment ()
- {
- valueLength = 0;
-
- while (PeekChar () != -1) {
- int ch = ReadChar ();
-
- if (ch == '-' && PeekChar () == '-') {
- ReadChar ();
-
- if (PeekChar () != '>')
- throw new XmlException ("comments cannot contain '--'");
-
- ReadChar ();
- break;
- }
-
- AppendValueChar ((char)ch);
- }
-
- SetProperties (
- XmlNodeType.Comment, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- CreateValueString (), // value
- true // clearAttributes
- );
- }
-
- // The reader is positioned on the first character after
- // the leading '<![CDATA['.
- private void ReadCDATA ()
- {
- valueLength = 0;
-
- while (PeekChar () != -1) {
- int ch = ReadChar ();
-
- if (ch == ']' && PeekChar () == ']') {
- ch = ReadChar (); // ']'
-
- if (PeekChar () == '>') {
- ReadChar (); // '>'
- break;
- } else {
- AppendValueChar (']');
- AppendValueChar (']');
- ch = ReadChar ();
- }
- }
-
- AppendValueChar ((char)ch);
- }
-
- ++depth;
-
- SetProperties (
- XmlNodeType.CDATA, // nodeType
- String.Empty, // name
- false, // isEmptyElement
- CreateValueString (), // value
- true // clearAttributes
- );
- }
-
- // The reader is positioned on the first character
- // of the name.
- private string ReadName ()
- {
- if (!XmlChar.IsFirstNameChar (PeekChar ()))
- throw new XmlException ("a name did not start with a legal character");
-
- nameLength = 0;
-
- AppendNameChar (ReadChar ());
-
- while (XmlChar.IsNameChar (PeekChar ())) {
- AppendNameChar (ReadChar ());
- }
-
- return CreateNameString ();
- }
-
- // Read the next character and compare it against the
- // specified character.
- private void Expect (int expected)
- {
- int ch = ReadChar ();
-
- if (ch != expected) {
- throw new XmlException (
- String.Format (
- "expected '{0}' ({1:X}) but found '{2}' ({3:X})",
- (char)expected,
- expected,
- (char)ch,
- ch));
- }
- }
-
- // Does not consume the first non-whitespace character.
- private void SkipWhitespace ()
- {
- while (XmlChar.IsWhitespace (PeekChar ()))
- ReadChar ();
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
deleted file mode 100644
index a598695b306..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
+++ /dev/null
@@ -1,644 +0,0 @@
-//
-// System.Xml.XmlTextWriter
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-
-namespace System.Xml
-{
- public class XmlTextWriter : XmlWriter
- {
- #region Fields
-
- protected TextWriter w;
- protected bool nullEncoding = false;
- protected bool openWriter = true;
- protected bool openStartElement = false;
- protected bool openStartAttribute = false;
- protected bool documentStarted = false;
- private bool namespaces = true;
- protected bool openAttribute = false;
- protected bool attributeWrittenForElement = false;
- protected Stack openElements = new Stack ();
- private Formatting formatting = Formatting.None;
- private int indentation = 2;
- private char indentChar = ' ';
- protected string indentChars = " ";
- private char quoteChar = '\"';
- protected int indentLevel = 0;
- protected string indentFormatting;
- protected Stream baseStream = null;
- protected string xmlLang = null;
- protected XmlSpace xmlSpace = XmlSpace.None;
- protected bool openXmlLang = false;
- protected bool openXmlSpace = false;
-
- #endregion
-
- #region Constructors
-
- public XmlTextWriter (TextWriter w) : base ()
- {
- this.w = w;
-
- try {
- baseStream = ((StreamWriter)w).BaseStream;
- }
- catch (Exception) { }
- }
-
- public XmlTextWriter (Stream w, Encoding encoding) : base ()
- {
- if (encoding == null) {
- nullEncoding = true;
- encoding = new UTF8Encoding ();
- }
-
- this.w = new StreamWriter(w, encoding);
- baseStream = w;
- }
-
- public XmlTextWriter (string filename, Encoding encoding) : base ()
- {
- this.w = new StreamWriter(filename, false, encoding);
- baseStream = ((StreamWriter)w).BaseStream;
- }
-
- #endregion
-
- #region Properties
-
- public Stream BaseStream {
- get { return baseStream; }
- }
-
-
- public Formatting Formatting {
- get { return formatting; }
- set { formatting = value; }
- }
-
- public bool IndentingOverriden
- {
- get {
- if (openElements.Count == 0)
- return false;
- else
- return (((XmlTextWriterOpenElement)openElements.Peek()).IndentingOverriden);
- }
- set {
- if (openElements.Count > 0)
- ((XmlTextWriterOpenElement)openElements.Peek()).IndentingOverriden = value;
- }
- }
-
- public int Indentation {
- get { return indentation; }
- set {
- indentation = value;
- UpdateIndentChars ();
- }
- }
-
- public char IndentChar {
- get { return indentChar; }
- set {
- indentChar = value;
- UpdateIndentChars ();
- }
- }
-
- public bool Namespaces {
- get { return namespaces; }
- set {
- if (ws != WriteState.Start)
- throw new InvalidOperationException ("NotInWriteState.");
-
- namespaces = value;
- }
- }
-
- public char QuoteChar {
- get { return quoteChar; }
- set {
- if ((value != '\'') && (value != '\"'))
- throw new ArgumentException ("This is an invalid XML attribute quote character. Valid attribute quote characters are ' and \".");
-
- quoteChar = value;
- }
- }
-
- public override WriteState WriteState {
- get { return ws; }
- }
-
- public override string XmlLang {
- get {
- string xmlLang = null;
- int i;
-
- for (i = 0; i < openElements.Count; i++)
- {
- xmlLang = ((XmlTextWriterOpenElement)openElements.ToArray().GetValue(i)).XmlLang;
- if (xmlLang != null)
- break;
- }
-
- return xmlLang;
- }
- }
-
- public override XmlSpace XmlSpace {
- get {
- XmlSpace xmlSpace = XmlSpace.None;
- int i;
-
- for (i = 0; i < openElements.Count; i++)
- {
- xmlSpace = ((XmlTextWriterOpenElement)openElements.ToArray().GetValue(i)).XmlSpace;
- if (xmlSpace != XmlSpace.None)
- break;
- }
-
- return xmlSpace;
- }
- }
-
- #endregion
-
- #region Methods
-
- private void CheckState ()
- {
- if (!openWriter) {
- throw new InvalidOperationException ("The Writer is closed.");
- }
-
- if ((documentStarted == true) && (formatting == Formatting.Indented) && (!IndentingOverriden)) {
- indentFormatting = "\r\n";
- if (indentLevel > 0) {
- for (int i = 0; i < indentLevel; i++)
- indentFormatting += indentChars;
- }
- }
- else
- indentFormatting = "";
-
- documentStarted = true;
- }
-
- public override void Close ()
- {
- CloseOpenAttributeAndElements ();
-
- w.Close();
- ws = WriteState.Closed;
- openWriter = false;
- }
-
- private void CloseOpenAttributeAndElements ()
- {
- if (openAttribute)
- WriteEndAttribute ();
-
- while (openElements.Count > 0) {
- WriteEndElement();
- }
- }
-
- private void CloseStartElement ()
- {
- if (openStartElement) {
- w.Write(">");
- ws = WriteState.Content;
- openStartElement = false;
- attributeWrittenForElement = false;
- }
- }
-
- public override void Flush ()
- {
- w.Flush ();
- }
-
- public override string LookupPrefix (string ns)
- {
- string prefix = namespaceManager.LookupPrefix (ns);
-
- if (prefix == String.Empty)
- prefix = null;
-
- return prefix;
- }
-
- private void UpdateIndentChars ()
- {
- indentChars = "";
- for (int i = 0; i < indentation; i++)
- indentChars += indentChar;
- }
-
- public override void WriteBase64 (byte[] buffer, int index, int count)
- {
- w.Write (Convert.ToBase64String (buffer, index, count));
- }
-
- [MonoTODO]
- public override void WriteBinHex (byte[] buffer, int index, int count)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteCData (string text)
- {
- if (text.IndexOf("]]>") > 0)
- throw new ArgumentException ();
-
- CheckState ();
- CloseStartElement ();
-
- w.Write("<![CDATA[{0}]]>", text);
- }
-
- public override void WriteCharEntity (char ch)
- {
- Int16 intCh = (Int16)ch;
-
- // Make sure the character is not in the surrogate pair
- // character range, 0xd800- 0xdfff
- if ((intCh >= -10240) && (intCh <= -8193))
- throw new ArgumentException ("Surrogate Pair is invalid.");
-
- w.Write("&#x{0:X};", intCh);
- }
-
- [MonoTODO]
- public override void WriteChars (char[] buffer, int index, int count)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteComment (string text)
- {
- if ((text.EndsWith("-")) || (text.IndexOf("-->") > 0)) {
- throw new ArgumentException ();
- }
-
- CheckState ();
- CloseStartElement ();
-
- w.Write ("<!--{0}-->", text);
- }
-
- [MonoTODO]
- public override void WriteDocType (string name, string pubid, string sysid, string subset)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteEndAttribute ()
- {
- if (!openAttribute)
- throw new InvalidOperationException("Token EndAttribute in state Start would result in an invalid XML document.");
-
- CheckState ();
-
- if (openXmlLang) {
- w.Write (xmlLang);
- openXmlLang = false;
- ((XmlTextWriterOpenElement)openElements.Peek()).XmlLang = xmlLang;
- }
-
- if (openXmlSpace)
- {
- w.Write (xmlSpace.ToString ().ToLower ());
- openXmlSpace = false;
- ((XmlTextWriterOpenElement)openElements.Peek()).XmlSpace = xmlSpace;
- }
-
- w.Write ("{0}", quoteChar);
-
- openAttribute = false;
- }
-
- public override void WriteEndDocument ()
- {
- if ((ws == WriteState.Start) || (ws == WriteState.Prolog))
- throw new ArgumentException ("This document does not have a root element.");
-
- CloseOpenAttributeAndElements ();
-
- ws = WriteState.Start;
- }
-
- public override void WriteEndElement ()
- {
- WriteEndElementInternal (false);
- }
-
- private void WriteEndElementInternal (bool fullEndElement)
- {
- if (openElements.Count == 0)
- throw new InvalidOperationException("There was no XML start tag open.");
-
- indentLevel--;
-
- CheckState ();
-
- if (openStartElement) {
- if (openAttribute)
- WriteEndAttribute ();
-
- if (fullEndElement)
- w.Write ("></{0}>", ((XmlTextWriterOpenElement)openElements.Peek ()).Name);
- else
- w.Write (" />");
-
- openElements.Pop ();
- openStartElement = false;
- } else {
- w.Write ("{0}</{1}>", indentFormatting, openElements.Pop ());
- }
-
- namespaceManager.PopScope();
- }
-
- [MonoTODO]
- public override void WriteEntityRef (string name)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteFullEndElement ()
- {
- WriteEndElementInternal (true);
- }
-
- [MonoTODO]
- public override void WriteName (string name)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void WriteNmToken (string name)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteProcessingInstruction (string name, string text)
- {
- if ((name == null) || (name == string.Empty) || (name.IndexOf("?>") > 0) || (text.IndexOf("?>") > 0)) {
- throw new ArgumentException ();
- }
-
- CheckState ();
- CloseStartElement ();
-
- w.Write ("{0}<?{1} {2}?>", indentFormatting, name, text);
- }
-
- [MonoTODO]
- public override void WriteQualifiedName (string localName, string ns)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteRaw (string data)
- {
- WriteStringInternal (data, false);
- }
-
- [MonoTODO]
- public override void WriteRaw (char[] buffer, int index, int count)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteStartAttribute (string prefix, string localName, string ns)
- {
- if ((prefix == "xml") && (localName == "lang"))
- openXmlLang = true;
-
- if ((prefix == "xml") && (localName == "space"))
- openXmlSpace = true;
-
- if ((prefix == "xmlns") && (localName == "xmlns"))
- throw new ArgumentException ("Prefixes beginning with \"xml\" (regardless of whether the characters are uppercase, lowercase, or some combination thereof) are reserved for use by XML.");
-
- CheckState ();
-
- if (ws == WriteState.Content)
- throw new InvalidOperationException ("Token StartAttribute in state " + WriteState + " would result in an invalid XML document.");
-
- if (prefix == null)
- prefix = String.Empty;
-
- if (ns == null)
- ns = String.Empty;
-
- string formatPrefix = "";
- string formatSpace = "";
-
- if (ns != String.Empty)
- {
- string existingPrefix = namespaceManager.LookupPrefix (ns);
-
- if (prefix == String.Empty)
- prefix = existingPrefix;
- }
-
- if (prefix != String.Empty)
- {
- formatPrefix = prefix + ":";
- }
-
- if (openStartElement || attributeWrittenForElement)
- formatSpace = " ";
-
- w.Write ("{0}{1}{2}={3}", formatSpace, formatPrefix, localName, quoteChar);
-
- openAttribute = true;
- attributeWrittenForElement = true;
- ws = WriteState.Attribute;
- }
-
- public override void WriteStartDocument ()
- {
- WriteStartDocument ("");
- }
-
- public override void WriteStartDocument (bool standalone)
- {
- string standaloneFormatting;
-
- if (standalone == true)
- standaloneFormatting = String.Format (" standalone={0}yes{0}", quoteChar);
- else
- standaloneFormatting = String.Format (" standalone={0}no{0}", quoteChar);
-
- WriteStartDocument (standaloneFormatting);
- }
-
- private void WriteStartDocument (string standaloneFormatting)
- {
- if (documentStarted == true)
- throw new InvalidOperationException("WriteStartDocument should be the first call.");
-
- CheckState ();
-
- string encodingFormatting = "";
-
- if (!nullEncoding)
- encodingFormatting = String.Format (" encoding={0}{1}{0}", quoteChar, w.Encoding.HeaderName);
-
- w.Write("<?xml version={0}1.0{0}{1}{2}?>", quoteChar, encodingFormatting, standaloneFormatting);
- ws = WriteState.Prolog;
- }
-
- public override void WriteStartElement (string prefix, string localName, string ns)
- {
- if (!Namespaces && (((prefix != null) && (prefix != String.Empty))
- || ((ns != null) && (ns != String.Empty))))
- throw new ArgumentException ("Cannot set the namespace if Namespaces is 'false'.");
-
- WriteStartElementInternal (prefix, localName, ns);
- }
-
- protected override void WriteStartElementInternal (string prefix, string localName, string ns)
- {
- if (prefix == null)
- prefix = String.Empty;
-
- if (ns == null)
- ns = String.Empty;
-
- if ((prefix != String.Empty) && ((ns == null) || (ns == String.Empty)))
- throw new ArgumentException ("Cannot use a prefix with an empty namespace.");
-
- CheckState ();
- CloseStartElement ();
-
- string formatXmlns = "";
- string formatPrefix = "";
-
- if (ns != String.Empty)
- {
- string existingPrefix = namespaceManager.LookupPrefix (ns);
-
- if (prefix == String.Empty)
- prefix = existingPrefix;
-
- if (prefix != existingPrefix)
- formatXmlns = String.Format (" xmlns:{0}={1}{2}{1}", prefix, quoteChar, ns);
- else if (existingPrefix == String.Empty)
- formatXmlns = String.Format (" xmlns={0}{1}{0}", quoteChar, ns);
- }
- else if ((prefix == String.Empty) && (namespaceManager.LookupNamespace(prefix) != String.Empty)) {
- formatXmlns = String.Format (" xmlns={0}{0}", quoteChar);
- }
-
- if (prefix != String.Empty) {
- formatPrefix = prefix + ":";
- }
-
- w.Write ("{0}<{1}{2}{3}", indentFormatting, formatPrefix, localName, formatXmlns);
-
- openElements.Push (new XmlTextWriterOpenElement (formatPrefix + localName));
- ws = WriteState.Element;
- openStartElement = true;
-
- namespaceManager.PushScope ();
- namespaceManager.AddNamespace (prefix, ns);
-
- indentLevel++;
- }
-
- public override void WriteString (string text)
- {
- if (ws == WriteState.Prolog)
- throw new InvalidOperationException ("Token content in state Prolog would result in an invalid XML document.");
-
- WriteStringInternal (text, true);
- }
-
- public void WriteStringInternal (string text, bool entitize)
- {
- if (text == null)
- text = String.Empty;
-
- if (text != String.Empty)
- {
- CheckState ();
-
- if (entitize)
- {
- text = text.Replace ("&", "&amp;");
- text = text.Replace ("<", "&lt;");
- text = text.Replace (">", "&gt;");
-
- if (openAttribute)
- {
- if (quoteChar == '"')
- text = text.Replace ("\"", "&quot;");
- else
- text = text.Replace ("'", "&apos;");
- }
- }
-
- if (!openAttribute)
- CloseStartElement ();
-
- if (!openXmlLang && !openXmlSpace)
- w.Write (text);
- else
- {
- if (openXmlLang)
- xmlLang = text;
- else
- {
- switch (text)
- {
- case "default":
- xmlSpace = XmlSpace.Default;
- break;
- case "preserve":
- xmlSpace = XmlSpace.Preserve;
- break;
- default:
- throw new ArgumentException ("'{0}' is an invalid xml:space value.");
- }
- }
- }
- }
-
- IndentingOverriden = true;
- }
-
- [MonoTODO]
- public override void WriteSurrogateCharEntity (char lowChar, char highChar)
- {
- throw new NotImplementedException ();
- }
-
- public override void WriteWhitespace (string ws)
- {
- foreach (char c in ws) {
- if ((c != ' ') && (c != '\t') && (c != '\r') && (c != '\n'))
- throw new ArgumentException ();
- }
-
- w.Write (ws);
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriterOpenElement.cs b/mcs/class/System.XML/System.Xml/XmlTextWriterOpenElement.cs
deleted file mode 100644
index 8c67c109e8a..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlTextWriterOpenElement.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-
-namespace System.Xml
-{
- internal class XmlTextWriterOpenElement
- {
- #region Fields
-
- string name;
- string xmlLang;
- XmlSpace xmlSpace;
- bool indentingOverriden = false;
-
- #endregion
-
- #region Constructors
-
- public XmlTextWriterOpenElement (string name)
- {
- this.name = name;
- }
-
- #endregion
-
- #region Properties
-
- public string Name
- {
- get { return name; }
- }
-
- public bool IndentingOverriden
- {
- get { return indentingOverriden; }
- set { indentingOverriden = value; }
- }
-
- public string XmlLang
- {
- get { return xmlLang; }
- set { xmlLang = value; }
- }
-
- public XmlSpace XmlSpace
- {
- get { return xmlSpace; }
- set { xmlSpace = value; }
- }
-
- #endregion
-
- #region Methods
-
- public override string ToString ()
- {
- return name;
- }
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs b/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs
deleted file mode 100755
index 13762770ce6..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlTokenizedType.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Xml.XmlTokenizedType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Xml
-{
- [Serializable] public enum XmlTokenizedType
- {
- CDATA = 0,
- ID = 1,
- IDREF = 2,
- IDREFS = 3,
- ENTITY = 4,
- ENTITIES = 5,
- NMTOKEN = 6,
- NMTOKENS = 7,
- NOTATION = 8,
- ENUMERATION = 9,
- QName = 10,
- NCName = 11,
- None = 12,
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs b/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
deleted file mode 100755
index 54750bb6f60..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// System.Xml.XmlUrlResolver.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System.Net;
-
-namespace System.Xml
-{
- public class XmlUrlResolver : XmlResolver
- {
- // Field
- ICredentials credential;
-
- // Constructor
- public XmlUrlResolver ()
- : base ()
- {
- }
-
- // Properties
- public override ICredentials Credentials
- {
- set { credential = value; }
- }
-
- // Methods
- [MonoTODO]
- public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn)
- {
- return null;
- }
-
- public override Uri ResolveUri (Uri baseUri, string relativeUri)
- {
- return new Uri (baseUri, relativeUri);
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlWhitespace.cs b/mcs/class/System.XML/System.Xml/XmlWhitespace.cs
deleted file mode 100644
index 62abbb82413..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlWhitespace.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Xml.XmlWhitespace.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Xml
-{
- public class XmlWhitespace : XmlCharacterData
- {
- // Constructor
- protected internal XmlWhitespace (string strData, XmlDocument doc)
- : base (strData, doc)
- {
- }
-
- // Properties
- public override string LocalName {
- get { return "#whitespace"; }
- }
-
- public override string Name {
- get { return "#whitespace"; }
- }
-
- public override XmlNodeType NodeType {
- get { return XmlNodeType.Whitespace; }
- }
-
- public override string Value {
- get { return Data; }
- [MonoTODO]
- set {
- if (IsValidWhitespaceChar (value) == false)
- throw new ArgumentException ("Invalid whitespace characters.");
- }
- }
-
- // Methods
- public override XmlNode CloneNode (bool deep)
- {
- // always return the data value
- return new XmlWhitespace (Data, OwnerDocument);
- }
-
- public override void WriteContentTo (XmlWriter w) {}
-
- public override void WriteTo (XmlWriter w)
- {
- w.WriteWhitespace (Data);
- }
-
- private bool IsValidWhitespaceChar (string text)
- {
- foreach (char c in text)
- if ((c != ' ') && (c != '\r') && (c != '\n') && (c != '\t'))
- return false;
- return true;
- }
- }
-}
diff --git a/mcs/class/System.XML/System.Xml/XmlWriter.cs b/mcs/class/System.XML/System.Xml/XmlWriter.cs
deleted file mode 100644
index f1c0b96737c..00000000000
--- a/mcs/class/System.XML/System.Xml/XmlWriter.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// System.Xml.XmlTextWriter
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-
-namespace System.Xml
-{
- public abstract class XmlWriter
- {
- #region Fields
-
- protected WriteState ws = WriteState.Start;
- protected XmlNamespaceManager namespaceManager = new XmlNamespaceManager (new NameTable ());
-
- #endregion
-
- #region Constructors
-
- protected XmlWriter () { }
-
- #endregion
-
- #region Properties
-
- public abstract WriteState WriteState { get; }
-
- public abstract string XmlLang { get; }
-
- public abstract XmlSpace XmlSpace { get; }
-
- #endregion
-
- #region Methods
-
- public abstract void Close ();
-
- public abstract void Flush ();
-
- public abstract string LookupPrefix (string ns);
-
- [MonoTODO]
- public virtual void WriteAttributes (XmlReader reader, bool defattr)
- {
- throw new NotImplementedException ();
- }
-
- public void WriteAttributeString (string localName, string value)
- {
- WriteAttributeString ("", localName, "", value);
- }
-
- public void WriteAttributeString (string localName, string ns, string value)
- {
- WriteAttributeString ("", localName, ns, value);
- }
-
- public void WriteAttributeString (string prefix, string localName, string ns, string value)
- {
- if ((prefix == "xmlns") || (localName == "xmlns"))
- ns = value;
-
- WriteStartAttribute (prefix, localName, ns);
- WriteString (value);
- WriteEndAttribute ();
-
- if ((prefix == "xmlns") || (localName == "xmlns"))
- {
- if (prefix == "xmlns")
- namespaceManager.AddNamespace (localName, ns);
- else
- namespaceManager.AddNamespace ("", ns);
- }
- }
-
- public abstract void WriteBase64 (byte[] buffer, int index, int count);
-
- public abstract void WriteBinHex (byte[] buffer, int index, int count);
-
- public abstract void WriteCData (string text);
-
- public abstract void WriteCharEntity (char ch);
-
- public abstract void WriteChars (char[] buffer, int index, int count);
-
- public abstract void WriteComment (string text);
-
- public abstract void WriteDocType (string name, string pubid, string sysid, string subset);
-
- public void WriteElementString (string localName, string value)
- {
- WriteStartElement(localName);
- WriteString(value);
- WriteEndElement();
- }
-
- public void WriteElementString (string localName, string ns, string value)
- {
- WriteStartElement(localName, ns);
- WriteString(value);
- WriteEndElement();
- }
-
- public abstract void WriteEndAttribute ();
-
- public abstract void WriteEndDocument ();
-
- public abstract void WriteEndElement ();
-
- public abstract void WriteEntityRef (string name);
-
- public abstract void WriteFullEndElement ();
-
- public abstract void WriteName (string name);
-
- public abstract void WriteNmToken (string name);
-
- [MonoTODO]
- public virtual void WriteNode (XmlReader reader, bool defattr)
- {
- throw new NotImplementedException ();
- }
-
- public abstract void WriteProcessingInstruction (string name, string text);
-
- public abstract void WriteQualifiedName (string localName, string ns);
-
- public abstract void WriteRaw (string data);
-
- public abstract void WriteRaw (char[] buffer, int index, int count);
-
- public void WriteStartAttribute (string localName, string ns)
- {
- WriteStartAttribute ("", localName, ns);
- }
-
- public abstract void WriteStartAttribute (string prefix, string localName, string ns);
-
- public abstract void WriteStartDocument ();
-
- public abstract void WriteStartDocument (bool standalone);
-
- public void WriteStartElement (string localName)
- {
- WriteStartElementInternal ("", localName, "");
- }
-
- public void WriteStartElement (string localName, string ns)
- {
- WriteStartElement ("", localName, ns);
- }
-
- public abstract void WriteStartElement (string prefix, string localName, string ns);
-
- protected abstract void WriteStartElementInternal (string prefix, string localName, string ns);
-
- public abstract void WriteString (string text);
-
- public abstract void WriteSurrogateCharEntity (char lowChar, char highChar);
-
- public abstract void WriteWhitespace (string ws);
-
- #endregion
- }
-}
diff --git a/mcs/class/System.XML/Test/.cvsignore b/mcs/class/System.XML/Test/.cvsignore
deleted file mode 100644
index 136fcca0890..00000000000
--- a/mcs/class/System.XML/Test/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.dll
-*.csproj.user
-bin
-obj
diff --git a/mcs/class/System.XML/Test/AllTests.cs b/mcs/class/System.XML/Test/AllTests.cs
deleted file mode 100644
index c33d261de57..00000000000
--- a/mcs/class/System.XML/Test/AllTests.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Author:
-// Mario Martinez (mariom925@home.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- /// <summary>
- /// Combines all unit tests for the System.XML.dll assembly
- /// into one test suite.
- /// </summary>
- public class AllTests : TestCase
- {
- public AllTests (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (new TestSuite (typeof (XmlProcessingInstructionTests)));
- suite.AddTest (new TestSuite (typeof (XmlTextTests)));
- suite.AddTest (new TestSuite (typeof (XmlTextReaderTests)));
- suite.AddTest (new TestSuite (typeof (XmlTextWriterTests)));
- suite.AddTest (new TestSuite (typeof (XmlNamespaceManagerTests)));
- suite.AddTest (new TestSuite (typeof (XmlAttributeTests)));
- suite.AddTest (new TestSuite (typeof (XmlDocumentTests)));
- suite.AddTest (new TestSuite (typeof (NameTableTests)));
- suite.AddTest (new TestSuite (typeof (XmlElementTests)));
- suite.AddTest (new TestSuite (typeof (XmlNodeListTests)));
- suite.AddTest (new TestSuite (typeof (XmlCommentTests)));
- suite.AddTest (new TestSuite (typeof (XmlCDataSectionTests)));
- suite.AddTest (new TestSuite (typeof (XmlWhitespaceTests)));
- suite.AddTest (new TestSuite (typeof (XmlSignificantWhitespaceTests)));
- suite.AddTest (new TestSuite (typeof (XmlDeclarationTests)));
- suite.AddTest (new TestSuite (typeof (XmlDocumentTypeTests)));
- suite.AddTest (new TestSuite (typeof (XPathNavigatorTests)));
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/ChangeLog b/mcs/class/System.XML/Test/ChangeLog
deleted file mode 100644
index 6f5618393ce..00000000000
--- a/mcs/class/System.XML/Test/ChangeLog
+++ /dev/null
@@ -1,336 +0,0 @@
-2002-06-24 Jason Diamond <jason@injektilo.org>
-
- * XPathScannerTests.cs: Removed.
-
- * System.XML_test.build: Removed tests for XPathScanner.
-
-2002-05-27 Jason Diamond <jason@injektilo.org>
-
- * XPathNavigatorTests.cs: Added file to directory.
-
- * AllTests.cs: Added XPathNavigatorTests to suite.
-
- * XmlTextReaderTests.cs: Added test to make sure attributes are ordered
- like Microsoft's parser does it.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Update build file to run correct class in the test dll.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs
- * NameTableTests.cs
- * TheTests.cs
- * XPathScannerTests.cs
- * XmlAttributeTests.cs
- * XmlCDataSectionTests.cs
- * XmlCommentTests.cs
- * XmlDeclarationTests.cs
- * XmlDocumentTests.cs
- * XmlDocumentTypeTests.cs
- * XmlElementTests.cs
- * XmlNamespaceManagerTests.cs
- * XmlNodeListTests.cs
- * XmlProcessingInstructionTests.cs
- * XmlSignificantWhitespaceTests.cs
- * XmlTextReaderTests.cs
- * XmlTextTests.cs
- * XmlTextWriterTests.cs
- * XmlWhiteSpaceTests.cs: Use same namespace style as corlib tests.
- Changed Ximian.Mono.Tests to MonoTests.System.Xml
-
-2002-04-08 Kral Ferch <kral_ferch@hotmail.com>
-
- * AllTests.cs: added XmlProcessingInstructionTests and XmlTextTests.
-
- * MonoMicro.Test.csproj: Added XmlProcessingInstructionTests.cs and
- XmlTextTests.cs.
-
- * XmlAttributeTests.cs: Added TestAttributeInnerAndOuterXml.
-
- * XmlCDataSectionTests.cs: Added TestXmlCDataSectionInnerAndOuterXml.
-
- * XmlCommentTests.cs: Added TestXmlCommentInnerAndOuterXml.
-
- * XmlDeclarationTests.cs: Added TestInnerAndOuterXml.
-
- * XmlDocumentTests.cs: Added TestInnerAndOuterXml.
-
- * XmlElementTests.cs: Added TestInnerAndOuterXml.
-
- * XmlProcessingInstructionTests.cs: Initial check-in.
-
- * XmlSignificantWhitespaceTests.cs: Added TestInnerAndOuterXml.
-
- * XmlTextTests.cs: Initial check-in.
-
- * XmlTextWriterTests.cs: Added TestWriteRaw, TestWriteRawInvalidInAttribute,
- and TestXmlSpaceRaw.
-
- * XmlWhiteSpacesTests.cs: Added TestInnerAndOuterXml.
-
-2002-04-05 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlDocumentTests.cs: CreateNode tests.
-
-2002-04-01 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: Tests for WriteEndDocument and WriteFullEndElement.
-
-2002-03-31 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: Tests for LookupPrefix, WriteBase64,
- and WriteCharEntity.
-
-2002-03-31 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: Finished XmlLang, XmlSpace, and
- Attribute namespace declaration tests.
-
-2002-03-29 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: XmlLang and XmlSpace tests.
-
-2002-03-29 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: Working on Attributes.
-
-2002-03-28 Duncan Mak <duncan@ximian.com>
-
- * XmlDeclarationTests.cs (TestConstructor):
- * XmlDocumentTypeTests.cs (TestAppendChild):
- * XmlSignificantWhitespaceTests.cs (TestXmlWhitespaceConstructor):
- * XmlWhiteSpaceTests.cs (TestXmlWhitespaceConstructor): Fixed the
- test for catching Exceptions.
-
-2002-03-26 Jason Diamond <jason@injektilo.org>
-
- * AllTests.cs:
- * Mono.Test.csproj: Removed XPathScanner tests.
-
- * System.XML_test.build: Test XPathScanner separately.
-
-2002-03-26 Duncan Mak <duncan@ximian.com>
-
- * AllTests.cs:
- * Microsoft.Test.csproj:
- * Mono.Test.csproj: Updated to include new test,
- XmlDocumentTypeTests.
-
- * XmlDocumentTypeTests.cs: New testsuite for XmlDocumentType class.
-
- * XmlCommentTests.cs (TestXmlNodeBaseProperties): Move the
- XmlNode.Value test in here.
-
-2002-03-26 Jason Diamond <jason@injektilo.org>
-
- * XPathScannerTests.cs: More location path tests.
-
-2002-03-25 Jason Diamond <jason@injektilo.org>
-
- * AllTests.cs:
- * Microsoft.Test.csproj:
- * Mono.Test.csproj: Updated to include new test, XmlScannerTests.
-
- * XPathScannerTests.cs: Added new tests for XPathScanner class.
-
-2002-03-25 Duncan Mak <duncan@ximian.com>
-
- * AllTests.cs:
- * Microsoft.Test.csproj:
- * Mono.Test.csproj: Updated to include new test,
- XmlDeclarationTests.
-
- * XmlDeclarationTests.cs: Added new test for XmlDeclaration class.
-
-2002-03-23 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: Tests for BaseStream,
- Namespaces = false, and WriteState.
-
-2002-03-23 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: constructor tests with
- different encodings to test that encoding gets suppressed
- on xml declaration when null stream passed to constructor.
- WriteStartDocument(standalone) tests. Tests for formatting
- and indentation. Test for invalid value set on QuoteChar.
-
-2002-03-22 Duncan Mak <duncan@ximian.com>
-
- * AllTests.cs:
- * Microsoft.Test.csproj:
- * Mono.Test.csproj: Updated to include new files.
-
- * XmlCDataSectionTests.cs: Added to CVS.
-
- * XmlCommentTests.cs: Added to CVS. hanks to Kral for helping me
- setup a testing environment on VS.NET.
-
- * XmlElementTests.cs: Reformatted.
- (TestCloneNode): Added.
-
- * XmlSignificantWhitespaceTests.cs: Added to CVS.
-
- * XmlWhiteSpaceTests.cs: Added to CVS.
-
-2002-03-21 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlDocumentTests.cs: Tessts parent traversal up through
- document itself until null. Tests a removed elements next
- sibling is null.
-
- * XmlNodeListTests.cs: Tests case where enumerator is on
- a node that gets removed from list.
-
- * XmlTextWriterTests.cs: Keeping tests for WriteXXX after
- writer is closed up to date as new WriteXXX methods are written.
- TestDocumentStart and TestWriteEndElement.
-
-2002-03-19 Jason Diamond <jason@injektilo.org>
-
- * XmlDocumentTests.cs: Added a test to check an element's names after
- loading.
-
-2002-03-17 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlDocumentTests.cs: Tests navigation to parents since
- that was part of a document.Load() bug reported by Mike Kestner.
-
- * XmlTextWriterTests.cs: Tests for namespaces and prefixes.
-
-2002-03-17 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlDocumentTests.cs: TestOuterXml.
-
- * XmlTextWriterTests.cs: Tests for CData, Close, Comment, Element,
- and ProcessingInstruction.
-
-2002-03-17 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlDocumentTests.cs: More LoadXml tests.
-
- * XmlTextWriterTests.cs: Test for invalid Processing Instructions.
-
-2002-03-14 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: Added tests TestCData and TestComment.
-
-2002-03-14 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlTextWriterTests.cs: Initial checkin.
-
-2002-03-12 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlNodeListTests.cs: New tests: TestNodeTypesThatCantHaveChildren,
- TestZeroChildren, TestOneChild, TestMultipleChildren,
- TestAppendChildAffectOnEnumeration, TestRemoveChildAffectOnEnumeration,
- TestRemoveOnlyChildAffectOnEnumeration, TestCurrentBeforeFirstNode,
- TestCurrentAfterLastNode, TestCurrentDoesntMove, and TestReset. Made
- two other tests but not in use yet until RemoveAll is implemented for
- attributes and XmlNode.ReplaceChild is implemented. The tests are called
- saveTestReplaceChildAffectOnEnumeration and saveTestRemoveAllAffectOnEnumeration.
-
-2002-03-08 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReaderTests.cs: Test MoveToElement and MoveToFirstAttribute.
-
-2002-03-08 Jason Diamond <jason@injektilo.org>
-
- * XmlAttributeTests.cs: Test XmlAttribute child nodes.
-
-2002-03-08 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlNodeListTests.cs: New file.
-
- * AllTests.cs: Added XmlNodeListTests.
-
-2002/03/08 Nick Drochak <ndrochak@gol.com>
-
- * System_test.build: Don't build test dll by default. Only build
- it when 'make test' is specified.
-
-2002-03-06 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlAttributeTests.cs: Fixed bug in TestHasChildNodes test.
-
- * XmlDocumentTests.cs: Started work on some tests for invalid data in
- various nodes created by the document.
-
-2002-03-02 Kral Ferch <kral_ferch@hotmail.com>
-
- * XmlDocumentTests.cs: New tests TestLoadProcessingInstruction(),
- TestLoadCDATA(), and TestLoadComment().
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * XmlElementTests.cs: New file.
-
- * AllTests.cs: Added XmlElementTests.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReaderTests.cs: Test MoveToNextAttribute().
-
- * XmlDocumentTests.cs: Test loading document containing attributes
- and text nodes.
-
-2002-03-02 Mike Kestner <mkestner@speakeasy.net>
-
- * XmlAttributeTests.cs : New test suite for attrs.
- * AllTests.cs : Add the attr suite.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * XmlNamespaceManagerTests.cs: Make sure the XmlNamespaceManager
- is using its name table.
-
- * NameTableTests.cs: Make sure NameTable is really returning the
- same references.
-
-2002-02-28 Jason Diamond <jason@injektilo.org>
-
- * XmlDocumentTests.cs: Tests for XmlDocument.LoadXml courtesy of
- Kral Ferch <kral.ferch@hotmail.com>.
-
-2002-02-28 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReaderTests.cs: Test for XmlException when parse fail.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- * System.XML_test.build: Build new executable RunTests.System.XML.exe
- which you can use to run the tests on Linux.
-
- * *.cs: Added zero-args constructors.
-
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * NameTableTests.cs: Test for System.Xml.NameTable.
-
-2002-02-26 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReaderTests.cs: Test for namespace declarations as
- attributes.
-
- * XmlNamespaceManagerTests.cs: Use the newly implemented NameTable
- when creating the XmlNamespaceManager. Properly test HasNamespace.
-
-2002-02-25 Jason Diamond <jason@injektilo.org>
-
- * XmlDocumentTests.cs: Added file.
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * XmlTextReaderTests.cs: Added tests for qualified attributes.
-
-2002-02-23 Jason Diamond <jason@injektilo.org>
-
- * ChangeLog: Added change log to this directory.
-
- * Test.cs: Renamed to XmlTextReaderTests.cs.
-
- * XmlTextReaderTests.cs: Added tests for NamespaceURI property.
-
- * XmlNamespaceManagerTests.cs: Initial tests.
diff --git a/mcs/class/System.XML/Test/Microsoft.Test.csproj b/mcs/class/System.XML/Test/Microsoft.Test.csproj
deleted file mode 100644
index 99f1015f00e..00000000000
--- a/mcs/class/System.XML/Test/Microsoft.Test.csproj
+++ /dev/null
@@ -1,162 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{D6C51F53-33E2-41DF-981A-33FCFA81CDA7}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "Microsoft.Test"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- RootNamespace = "Test"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
- />
- <Reference
- Name = "NUnitCore"
- AssemblyName = "NUnitCore"
- HintPath = "..\..\..\nunit\NUnitCore.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AllTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ChangeLog"
- BuildAction = "None"
- />
- <File
- RelPath = "NameTableTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlAttributeTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlCDataSectionTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlCommentTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDeclarationTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDocumentTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDocumentTypeTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlElementTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlNamespaceManagerTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlNodeListTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlSignificantWhitespaceTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlTextReaderTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlTextWriterTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlWhiteSpaceTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/class/System.XML/Test/Mono.Test.csproj b/mcs/class/System.XML/Test/Mono.Test.csproj
deleted file mode 100644
index 677a5b82388..00000000000
--- a/mcs/class/System.XML/Test/Mono.Test.csproj
+++ /dev/null
@@ -1,167 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{D6C51F53-33E2-41DF-981A-33FCFA81CDA7}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "Mono.Test"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- RootNamespace = "Test"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "Mono.System.XML"
- Project = "{0CB7FB41-3C0F-40E8-ACD3-8C5B8BC35B2C}"
- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
- />
- <Reference
- Name = "NUnitCore"
- AssemblyName = "NUnitCore"
- HintPath = "..\..\..\nunit\NUnitCore.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AllTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ChangeLog"
- BuildAction = "None"
- />
- <File
- RelPath = "NameTableTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlAttributeTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlCDataSectionTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlCommentTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDeclarationTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDocumentTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDocumentTypeTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlElementTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlNamespaceManagerTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlNodeListTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlSignificantWhitespaceTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlTextReaderTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlTextWriterTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlWhiteSpaceTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/class/System.XML/Test/MonoMicro.Test.csproj b/mcs/class/System.XML/Test/MonoMicro.Test.csproj
deleted file mode 100644
index 0c0d4715f18..00000000000
--- a/mcs/class/System.XML/Test/MonoMicro.Test.csproj
+++ /dev/null
@@ -1,182 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{F7734143-3845-4288-B1CA-FE614FFA70F0}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "MonoMicro.Test"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- RootNamespace = "MonoMicro.Test"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "NUnitCore"
- AssemblyName = "NUnitCore"
- HintPath = "..\..\..\nunit\NUnitCore.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.XML"
- HintPath = "..\obj\Debug\System.XML.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AllTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ChangeLog"
- BuildAction = "None"
- />
- <File
- RelPath = "NameTableTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlAttributeTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlCDataSectionTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlCommentTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDeclarationTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDocumentTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlDocumentTypeTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlElementTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlNamespaceManagerTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlNodeListTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlProcessingInstructionTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlSignificantWhitespaceTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlTextReaderTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlTextTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlTextWriterTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XmlWhiteSpaceTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "XPathNavigatorTests.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/class/System.XML/Test/NameTableTests.cs b/mcs/class/System.XML/Test/NameTableTests.cs
deleted file mode 100755
index ee115132f44..00000000000
--- a/mcs/class/System.XML/Test/NameTableTests.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// System.Xml.NameTableTests.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class NameTableTests : TestCase
- {
- NameTable table;
-
- public NameTableTests (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- table = new NameTable ();
- }
-
- //
- // Tests System.Xml.NameTable.Add (string)
- //
- public void TestAdd1 ()
- {
- string add = "add1";
- string testAdd = table.Add (add);
- AssertEquals (add, testAdd);
- AssertSame (add, testAdd);
- }
-
- //
- // Tests System.Xml.NameTable.Add (char[], int, int)
- //
- public void TestAdd2 ()
- {
- char[] test = new char [4] { 'a', 'd', 'd', '2' };
- int index = 0;
- int length = 3; // "add"
-
- AssertEquals ("add", table.Add (test, index, length));
- }
-
- //
- // Tests System.Xml.NameTable.Get (string)
- //
- public void TestGet1 ()
- {
- string get1 = "get1";
- string testGet = table.Add (get1);
-
- AssertEquals (table.Get (get1), testGet);
- AssertSame (get1, testGet );
- }
-
- //
- // Tests System.Xml.NameTable.Get (char[], int, int)
- //
- public void TestGet2 ()
- {
- char[] test = new char [4] { 'g', 'e', 't', '2' };
- int index = 0;
- int length = 3; // "get"
-
- string testGet = table.Add (test, index, length);
-
- AssertEquals (table.Get (test, index, length), testGet);
- }
-
- //
- // Tests System.Xml.NameTable.Get (char[], int, 0)
- //
- public void TestGet3 ()
- {
- char[] test = new char [4] { 't', 'e', 's', 't' };
- int index = 0;
- int length = 0;
-
- AssertEquals (table.Get (test, index, length), String.Empty);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/System.XML_test.build b/mcs/class/System.XML/Test/System.XML_test.build
deleted file mode 100644
index b7b3c68dd16..00000000000
--- a/mcs/class/System.XML/Test/System.XML_test.build
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.XML_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="System.XML_test" default="build">
- <property name="debug" value="false"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- </target>
-
- <target name="assemblies">
- <csc target="library" output="System.XML_test.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="TheTests.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/r:.\System.XML.dll"/>
- </csc>
-
- <csc target="exe" output="RunTests.System.XML.exe" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="**/AllTests.cs"/>
- <excludes name="**/MartinTests.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitBase.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- <arg value="/noconfig"/>
- <arg value="/r:.\System.XML.dll"/>
- </csc>
-
- </target>
-
- <target name="test" depends="assemblies">
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.System.Xml.AllTests,System.XML_test.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="System.XML.dll" failonerror="false"/>
- <delete file="System.XML_test.dll" failonerror="false"/>
- <delete file="System.XML_test.pdb" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System.XML/Test/TheTests.cs b/mcs/class/System.XML/Test/TheTests.cs
deleted file mode 100644
index 6537bed3754..00000000000
--- a/mcs/class/System.XML/Test/TheTests.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System.Xml
-{
- public class RunXmlTextReaderTests : XmlTextReaderTests
- {
- protected override void RunTest ()
- {
- TestEmptyElement ();
- TestEmptyElementWithWhitespace ();
- TestEmptyElementWithStartAndEndTag ();
- TestEmptyElementWithStartAndEndTagWithWhitespace ();
- TestNestedEmptyTag ();
- TestNestedText ();
- TestEmptyElementWithAttribute ();
- TestStartAndEndTagWithAttribute ();
- TestEmptyElementWithTwoAttributes ();
- TestProcessingInstructionBeforeDocumentElement ();
- TestCommentBeforeDocumentElement ();
- TestPredefinedEntities ();
- TestEntityReference ();
- TestEntityReferenceInsideText ();
- TestCharacterReferences ();
- TestEntityReferenceInAttribute ();
- TestPredefinedEntitiesInAttribute ();
- TestCharacterReferencesInAttribute ();
- TestCDATA ();
- TestEmptyElementInNamespace ();
- TestEmptyElementInDefaultNamespace ();
- TestChildElementInNamespace ();
- TestChildElementInDefaultNamespace ();
- TestAttributeInNamespace ();
- TestIsName ();
- TestIsNameToken ();
- }
- }
-}
-
-namespace MonoTests.System.Xml
-{
- public class RunXmlNamespaceManagerTests : XmlNamespaceManagerTests
- {
- protected override void RunTest ()
- {
- TestNewNamespaceManager ();
- TestAddNamespace ();
- TestPushScope ();
- TestPopScope ();
- }
- }
-}
-
-namespace MonoTests.System.Xml
-{
- public class RunXmlDocumentTests : XmlDocumentTests
- {
- protected override void RunTest ()
- {
- TestDocumentElement ();
- }
- }
-}
-
-namespace MonoTests
-{
- public class RunAllTests
- {
- public static void AddAllTests (TestSuite suite)
- {
- suite.AddTest (new MonoTests.System.Xml.RunXmlTextReaderTests ());
- suite.AddTest (new MonoTests.System.Xml.RunXmlNamespaceManagerTests ());
- suite.AddTest (new MonoTests.System.Xml.RunXmlDocumentTests ());
- }
- }
-}
-
-class MainApp
-{
- public static void Main()
- {
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
-
- TestResult result = new TestResult ();
- TestSuite suite = new TestSuite ();
- MonoTests.RunAllTests.AddAllTests (suite);
- suite.Run (result);
- MonoTests.MyTestRunner.Print (result);
- }
-}
-
diff --git a/mcs/class/System.XML/Test/XPathNavigatorTests.cs b/mcs/class/System.XML/Test/XPathNavigatorTests.cs
deleted file mode 100644
index 3e1c5eac1f1..00000000000
--- a/mcs/class/System.XML/Test/XPathNavigatorTests.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-//
-// MonoTests.System.Xml.XPathNavigatorTests
-//
-// Author:
-// Jason Diamond <jason@injektilo.org>
-//
-// (C) 2002 Jason Diamond
-//
-
-using System;
-using System.Xml;
-using System.Xml.XPath;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XPathNavigatorTests : TestCase
- {
- public XPathNavigatorTests () : base ("MonoTests.System.Xml.XPathNavigatorTests testsuite") {}
- public XPathNavigatorTests (string name) : base (name) {}
-
- public void TestCreateNavigator ()
- {
- XmlDocument document = new XmlDocument ();
- document.LoadXml ("<foo />");
- XPathNavigator navigator = document.CreateNavigator ();
- AssertNotNull (navigator);
- }
-
- public void TestPropertiesOnDocument ()
- {
- XmlDocument document = new XmlDocument ();
- document.LoadXml ("<foo:bar xmlns:foo='#foo' />");
- XPathNavigator navigator = document.CreateNavigator ();
-
- AssertEquals (XPathNodeType.Root, navigator.NodeType);
- AssertEquals (String.Empty, navigator.Name);
- AssertEquals (String.Empty, navigator.LocalName);
- AssertEquals (String.Empty, navigator.NamespaceURI);
- AssertEquals (String.Empty, navigator.Prefix);
- Assert (!navigator.HasAttributes);
- Assert (navigator.HasChildren);
- Assert (!navigator.IsEmptyElement);
- }
-
- public void TestPropertiesOnElement ()
- {
- XmlDocument document = new XmlDocument ();
- document.LoadXml ("<foo:bar xmlns:foo='#foo' />");
- XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
-
- AssertEquals (XPathNodeType.Element, navigator.NodeType);
- AssertEquals ("foo:bar", navigator.Name);
- AssertEquals ("bar", navigator.LocalName);
- AssertEquals ("#foo", navigator.NamespaceURI);
- AssertEquals ("foo", navigator.Prefix);
- Assert (!navigator.HasAttributes);
- Assert (!navigator.HasChildren);
- Assert (navigator.IsEmptyElement);
- }
-
- public void TestPropertiesOnAttribute ()
- {
- XmlDocument document = new XmlDocument ();
- document.LoadXml ("<foo bar:baz='quux' xmlns:bar='#bar' />");
- XPathNavigator navigator = document.DocumentElement.GetAttributeNode("baz", "#bar").CreateNavigator ();
-
- AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
- AssertEquals ("bar:baz", navigator.Name);
- AssertEquals ("baz", navigator.LocalName);
- AssertEquals ("#bar", navigator.NamespaceURI);
- AssertEquals ("bar", navigator.Prefix);
- Assert (!navigator.HasAttributes);
- Assert (!navigator.HasChildren);
- Assert (!navigator.IsEmptyElement);
- }
-
- public void TestNavigation ()
- {
- XmlDocument document = new XmlDocument ();
- document.LoadXml ("<foo><bar /><baz /></foo>");
- XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
-
- AssertEquals ("foo", navigator.Name);
- Assert (navigator.MoveToFirstChild ());
- AssertEquals ("bar", navigator.Name);
- Assert (navigator.MoveToNext ());
- AssertEquals ("baz", navigator.Name);
- Assert (!navigator.MoveToNext ());
- AssertEquals ("baz", navigator.Name);
- Assert (navigator.MoveToPrevious ());
- AssertEquals ("bar", navigator.Name);
- Assert (!navigator.MoveToPrevious ());
- Assert (navigator.MoveToParent ());
- AssertEquals ("foo", navigator.Name);
- navigator.MoveToRoot ();
- AssertEquals (XPathNodeType.Root, navigator.NodeType);
- Assert (!navigator.MoveToParent ());
- AssertEquals (XPathNodeType.Root, navigator.NodeType);
- Assert (navigator.MoveToFirstChild ());
- AssertEquals ("foo", navigator.Name);
- Assert (navigator.MoveToFirst ());
- AssertEquals ("foo", navigator.Name);
- Assert (navigator.MoveToFirstChild ());
- AssertEquals ("bar", navigator.Name);
- Assert (navigator.MoveToNext ());
- AssertEquals ("baz", navigator.Name);
- Assert (navigator.MoveToFirst ());
- AssertEquals ("bar", navigator.Name);
- }
-
- public void TestMoveToAndIsSamePosition ()
- {
- XmlDocument document1 = new XmlDocument ();
- document1.LoadXml ("<foo><bar /></foo>");
- XPathNavigator navigator1a = document1.DocumentElement.CreateNavigator ();
- XPathNavigator navigator1b = document1.DocumentElement.CreateNavigator ();
-
- XmlDocument document2 = new XmlDocument ();
- document2.LoadXml ("<foo><bar /></foo>");
- XPathNavigator navigator2 = document2.DocumentElement.CreateNavigator ();
-
- AssertEquals ("foo", navigator1a.Name);
- Assert (navigator1a.MoveToFirstChild ());
- AssertEquals ("bar", navigator1a.Name);
-
- Assert (!navigator1b.IsSamePosition (navigator1a));
- AssertEquals ("foo", navigator1b.Name);
- Assert (navigator1b.MoveTo (navigator1a));
- Assert (navigator1b.IsSamePosition (navigator1a));
- AssertEquals ("bar", navigator1b.Name);
-
- Assert (!navigator2.IsSamePosition (navigator1a));
- AssertEquals ("foo", navigator2.Name);
- Assert (!navigator2.MoveTo (navigator1a));
- AssertEquals ("foo", navigator2.Name);
- }
-
- public void TestAttributeNavigation ()
- {
- XmlDocument document = new XmlDocument ();
- document.LoadXml ("<foo bar='baz' quux='quuux' />");
- XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
-
- AssertEquals (XPathNodeType.Element, navigator.NodeType);
- AssertEquals ("foo", navigator.Name);
- Assert (navigator.MoveToFirstAttribute ());
- AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
- AssertEquals ("bar", navigator.Name);
- AssertEquals ("baz", navigator.Value);
- Assert (navigator.MoveToNextAttribute ());
- AssertEquals (XPathNodeType.Attribute, navigator.NodeType);
- AssertEquals ("quux", navigator.Name);
- AssertEquals ("quuux", navigator.Value);
- }
-
- public void TestElementAndRootValues()
- {
- XmlDocument document = new XmlDocument ();
- document.LoadXml ("<foo><bar>baz</bar><quux>quuux</quux></foo>");
- XPathNavigator navigator = document.DocumentElement.CreateNavigator ();
-
- AssertEquals (XPathNodeType.Element, navigator.NodeType);
- AssertEquals ("foo", navigator.Name);
- //AssertEquals ("bazquuux", navigator.Value);
-
- navigator.MoveToRoot ();
- //AssertEquals ("bazquuux", navigator.Value);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlAttributeTests.cs b/mcs/class/System.XML/Test/XmlAttributeTests.cs
deleted file mode 100644
index dc9961bcd3d..00000000000
--- a/mcs/class/System.XML/Test/XmlAttributeTests.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-// XmlAttributeTests.cs : Tests for the XmlAttribute class
-//
-// Author: Mike Kestner <mkestner@speakeasy.net>
-//
-// <c> 2002 Mike Kestner
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlAttributeTests : TestCase
- {
- public XmlAttributeTests() : base("MonoTests.System.Xml.XmlAttributeTests testsuite") { }
- public XmlAttributeTests(string name) : base(name) { }
-
- XmlDocument doc;
- XmlAttribute attr;
-
- protected override void SetUp()
- {
- doc = new XmlDocument();
- attr = doc.CreateAttribute("attr1");
- attr.Value = "val1";
- }
-
- public void TestAttributes()
- {
- AssertNull(attr.Attributes);
- }
-
- public void TestAttributeInnerAndOuterXml ()
- {
- attr = doc.CreateAttribute ("foo", "bar", "http://abc.def");
- attr.Value = "baz";
- AssertEquals ("baz", attr.InnerXml);
- AssertEquals ("foo:bar=\"baz\"", attr.OuterXml);
- }
-
- public void TestAttributeWithNoValue ()
- {
- XmlAttribute attribute = doc.CreateAttribute ("name");
- AssertEquals (String.Empty, attribute.Value);
- Assert (!attribute.HasChildNodes);
- AssertNull (attribute.FirstChild);
- AssertNull (attribute.LastChild);
- AssertEquals (0, attribute.ChildNodes.Count);
- }
-
- public void TestAttributeWithValue ()
- {
- XmlAttribute attribute = doc.CreateAttribute ("name");
- attribute.Value = "value";
- AssertEquals ("value", attribute.Value);
- Assert (attribute.HasChildNodes);
- AssertNotNull (attribute.FirstChild);
- AssertNotNull (attribute.LastChild);
- AssertEquals (1, attribute.ChildNodes.Count);
- AssertEquals (XmlNodeType.Text, attribute.ChildNodes [0].NodeType);
- AssertEquals ("value", attribute.ChildNodes [0].Value);
- }
-
- public void TestHasChildNodes()
- {
- Assert(attr.HasChildNodes);
- }
-
- public void TestName()
- {
- AssertEquals("attr1", attr.Name);
- }
-
- public void TestNodeType()
- {
- AssertEquals(XmlNodeType.Attribute, attr.NodeType);
- }
-
- public void TestOwnerDocument()
- {
- AssertSame(doc, attr.OwnerDocument);
- }
-
- public void TestParentNode()
- {
- AssertNull("Attr parents not allowed", attr.ParentNode);
- }
-
- public void TestValue()
- {
- AssertEquals("val1", attr.Value);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlCDataSectionTests.cs b/mcs/class/System.XML/Test/XmlCDataSectionTests.cs
deleted file mode 100755
index dad1050fcf6..00000000000
--- a/mcs/class/System.XML/Test/XmlCDataSectionTests.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.Xml.XmlCDataSectionTests.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlCDataSectionTests : TestCase
- {
- XmlDocument document;
- XmlCDataSection section;
- XmlNode original;
- XmlNode deep;
- XmlNode shallow;
-
- public XmlCDataSectionTests ()
- : base ("MonoTests.System.Xml.XmlCDataSectionTests testsuite")
- {
- }
-
- public XmlCDataSectionTests (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- document.LoadXml ("<root><foo></foo></root>");
- section = document.CreateCDataSection ("CDataSection");
- }
-
- internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
- {
- // AssertEquals (original.nodetype + " was incorrectly cloned.",
- // original.baseuri, cloned.baseuri);
- AssertNull (cloned.ParentNode);
- Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
- }
-
- public void TestXmlCDataSectionInnerAndOuterXml ()
- {
- section = document.CreateCDataSection ("foo");
- AssertEquals (String.Empty, section.InnerXml);
- AssertEquals ("<![CDATA[foo]]>", section.OuterXml);
- }
-
- public void TestXmlCDataSectionName ()
- {
- AssertEquals (section.NodeType + " Name property broken",
- section.Name, "#cdata-section");
- }
-
- public void TestXmlCDataSectionLocalName ()
- {
- AssertEquals (section.NodeType + " LocalName property broken",
- section.LocalName, "#cdata-section");
- }
-
- public void TestXmlCDataSectionNodeType ()
- {
- AssertEquals ("XmlCDataSection NodeType property broken",
- section.NodeType.ToString (), "CDATA");
- }
-
- public void TestXmlCDataSectionIsReadOnly ()
- {
- AssertEquals ("XmlCDataSection IsReadOnly property broken",
- section.IsReadOnly, false);
- }
-
- public void TestXmlCDataSectionCloneNode ()
- {
- original = section;
-
- shallow = section.CloneNode (false); // shallow
- TestXmlNodeBaseProperties (original, shallow);
- AssertEquals ("Value incorrectly cloned",
- original.Value, shallow.Value);
-
- deep = section.CloneNode (true); // deep
- TestXmlNodeBaseProperties (original, deep);
- AssertEquals ("Value incorrectly cloned",
- original.Value, deep.Value);
-
- AssertEquals ("deep cloning differs from shallow cloning",
- deep.OuterXml, shallow.OuterXml);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlCommentTests.cs b/mcs/class/System.XML/Test/XmlCommentTests.cs
deleted file mode 100755
index 77ff9abe1b7..00000000000
--- a/mcs/class/System.XML/Test/XmlCommentTests.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Xml.XmlCommentTests.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlCommentTests : TestCase
- {
- XmlDocument document;
- XmlComment comment;
- XmlNode original;
- XmlNode deep;
- XmlNode shallow;
-
- public XmlCommentTests () : base ("MonoTests.System.Xml.XmlCommentTests testsuite") {}
-
- public XmlCommentTests (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- }
-
- public void TestXmlCommentCloneNode ()
- {
- document.LoadXml ("<root><foo></foo></root>");
- comment = document.CreateComment ("Comment");
- original = comment;
-
- shallow = comment.CloneNode (false); // shallow
- TestXmlNodeBaseProperties (original, shallow);
-
- deep = comment.CloneNode (true); // deep
- TestXmlNodeBaseProperties (original, deep);
- AssertEquals ("Value incorrectly cloned",
- original.Value, deep.Value);
-
- AssertEquals ("deep cloning differs from shallow cloning",
- deep.OuterXml, shallow.OuterXml);
- }
-
- public void TestXmlCommentInnerAndOuterXml ()
- {
- comment = document.CreateComment ("foo");
- AssertEquals (String.Empty, comment.InnerXml);
- AssertEquals ("<!--foo-->", comment.OuterXml);
- }
-
- public void TestXmlCommentIsReadOnly ()
- {
- document.LoadXml ("<root><foo></foo></root>");
- comment = document.CreateComment ("Comment");
- AssertEquals ("XmlComment IsReadOnly property broken",
- comment.IsReadOnly, false);
- }
-
- public void TestXmlCommentLocalName ()
- {
- document.LoadXml ("<root><foo></foo></root>");
- comment = document.CreateComment ("Comment");
- AssertEquals (comment.NodeType + " LocalName property broken",
- comment.LocalName, "#comment");
- }
-
- public void TestXmlCommentName ()
- {
- document.LoadXml ("<root><foo></foo></root>");
- comment = document.CreateComment ("Comment");
- AssertEquals (comment.NodeType + " Name property broken",
- comment.Name, "#comment");
- }
-
- public void TestXmlCommentNodeType ()
- {
- document.LoadXml ("<root><foo></foo></root>");
- comment = document.CreateComment ("Comment");
- AssertEquals ("XmlComment NodeType property broken",
- comment.NodeType.ToString (), "Comment");
- }
-
- internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
- {
- document.LoadXml ("<root><foo></foo></root>");
- comment = document.CreateComment ("Comment");
-
- // assertequals (original.nodetype + " was incorrectly cloned.",
- // original.baseuri, cloned.baseuri);
-
- AssertNull (cloned.ParentNode);
- AssertEquals ("Value incorrectly cloned",
- original.Value, cloned.Value);
-
- Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
- }
-
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlDeclarationTests.cs b/mcs/class/System.XML/Test/XmlDeclarationTests.cs
deleted file mode 100755
index 2d148cca556..00000000000
--- a/mcs/class/System.XML/Test/XmlDeclarationTests.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// System.Xml.XmlDeclarationTests.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlDeclarationTests : TestCase
- {
-
- XmlDocument document;
- XmlDeclaration declaration;
-
- public XmlDeclarationTests () : base ("MonoTests.System.Xml.XmlDeclarationTests testsuite") {}
-
- public XmlDeclarationTests (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- document.LoadXml ("<foo><bar></bar></foo>");
- declaration = document.CreateXmlDeclaration ("1.0", null, null);
- }
-
- public void TestInnerAndOuterXml ()
- {
- declaration = document.CreateXmlDeclaration ("1.0", null, null);
- AssertEquals (String.Empty, declaration.InnerXml);
- AssertEquals ("<?xml version=\"1.0\"?>", declaration.OuterXml);
-
- declaration = document.CreateXmlDeclaration ("1.0", "doesn't check", null);
- AssertEquals (String.Empty, declaration.InnerXml);
- AssertEquals ("<?xml version=\"1.0\" encoding=\"doesn't check\"?>", declaration.OuterXml);
-
- declaration = document.CreateXmlDeclaration ("1.0", null, "yes");
- AssertEquals (String.Empty, declaration.InnerXml);
- AssertEquals ("<?xml version=\"1.0\" standalone=\"yes\"?>", declaration.OuterXml);
-
- declaration = document.CreateXmlDeclaration ("1.0", "foo", "no");
- AssertEquals (String.Empty, declaration.InnerXml);
- AssertEquals ("<?xml version=\"1.0\" encoding=\"foo\" standalone=\"no\"?>", declaration.OuterXml);
- }
-
- internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
- {
-// assertequals (original.nodetype + " was incorrectly cloned.",
-// original.baseuri, cloned.baseuri);
- AssertNull (cloned.ParentNode);
-
- AssertEquals ("Value incorrectly cloned",
- original.Value, cloned.Value);
-
- Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
- }
-
- public void TestConstructor ()
- {
- try {
- XmlDeclaration broken = document.CreateXmlDeclaration ("2.0", null, null);
- } catch (ArgumentException) {
- return;
-
- } catch (Exception e) {
- Fail("first arg null, wrong exception: " + e.ToString());
- }
- }
-
- public void TestNodeType ()
- {
- AssertEquals ("incorrect NodeType returned", XmlNodeType.XmlDeclaration, declaration.NodeType);
- }
-
- public void TestNames ()
- {
- AssertEquals ("Name is incorrect", "xml", declaration.Name);
- AssertEquals ("LocalName is incorrect", "xml", declaration.LocalName);
- }
-
- public void TestEncodingProperty ()
- {
- XmlDeclaration d1 = document.CreateXmlDeclaration ("1.0", "foo", null);
- AssertEquals ("Encoding property", "foo", d1.Encoding);
-
- XmlDeclaration d2 = document.CreateXmlDeclaration ("1.0", null, null);
- AssertEquals ("null Encoding property", String.Empty, d2.Encoding);
- }
-
- public void TestStandaloneProperty ()
- {
- XmlDeclaration d1 = document.CreateXmlDeclaration ("1.0", null, "yes");
- AssertEquals ("Yes standalone property", "yes", d1.Standalone);
-
- XmlDeclaration d2 = document.CreateXmlDeclaration ("1.0", null, "no");
- AssertEquals ("No standalone property", "no", d2.Standalone);
-
- XmlDeclaration d3 = document.CreateXmlDeclaration ("1.0", null, null);
- AssertEquals ("null Standalone property", String.Empty, d3.Standalone);
- }
-
- public void TestValueProperty ()
- {
- XmlDeclaration d = document.CreateXmlDeclaration ("1.0", "UTF-8", "yes");
- AssertEquals ("Value property", "version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"",
- d.Value);
- }
-
- public void TestXmlCommentCloneNode ()
- {
- XmlNode original = declaration;
-
- XmlNode shallow = declaration.CloneNode (false); // shallow
- TestXmlNodeBaseProperties (original, shallow);
-
- XmlNode deep = declaration.CloneNode (true); // deep
- TestXmlNodeBaseProperties (original, deep);
-
- AssertEquals ("deep cloning differs from shallow cloning",
- deep.OuterXml, shallow.OuterXml);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlDocumentTests.cs b/mcs/class/System.XML/Test/XmlDocumentTests.cs
deleted file mode 100644
index c9fcb3cd875..00000000000
--- a/mcs/class/System.XML/Test/XmlDocumentTests.cs
+++ /dev/null
@@ -1,354 +0,0 @@
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlDocumentTests : TestCase
- {
- public XmlDocumentTests () : base ("MonoTests.System.Xml.XmlDocumentTests testsuite") {}
- public XmlDocumentTests (string name) : base (name) {}
-
- private XmlDocument document;
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- }
-
- public void TestCreateNodeNodeTypeNameEmptyParams ()
- {
- XmlNode node;
-
- try {
- node = document.CreateNode (null, null, null);
- Fail ("Expected an ArgumentException to be thrown.");
- } catch (ArgumentException) {}
-
- try {
- node = document.CreateNode ("attribute", null, null);
- Fail ("Expected a NullReferenceException to be thrown.");
- } catch (NullReferenceException) {}
-
- try {
- node = document.CreateNode ("attribute", "", null);
- Fail ("Expected an ArgumentException to be thrown.");
- } catch (ArgumentException) {}
-
- try {
- node = document.CreateNode ("element", null, null);
- Fail ("Expected a NullReferenceException to be thrown.");
- } catch (NullReferenceException) {}
-
- try {
- node = document.CreateNode ("element", "", null);
- Fail ("Expected an ArgumentException to be thrown.");
- } catch (ArgumentException) {}
-
- try {
- node = document.CreateNode ("entityreference", null, null);
- Fail ("Expected a NullReferenceException to be thrown.");
- } catch (NullReferenceException) {}
- }
-
- public void TestCreateNodeInvalidXmlNodeType ()
- {
- XmlNode node;
-
- try {
- node = document.CreateNode (XmlNodeType.EndElement, null, null);
- Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
- } catch (ArgumentOutOfRangeException) {}
-
- try {
- node = document.CreateNode (XmlNodeType.EndEntity, null, null);
- Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
- } catch (ArgumentOutOfRangeException) {}
-
- try {
- node = document.CreateNode (XmlNodeType.Entity, null, null);
- Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
- } catch (ArgumentOutOfRangeException) {}
-
- try {
- node = document.CreateNode (XmlNodeType.None, null, null);
- Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
- } catch (ArgumentOutOfRangeException) {}
-
- try {
- node = document.CreateNode (XmlNodeType.Notation, null, null);
- Fail ("Expected an ArgumentOutOfRangeException to be thrown.");
- } catch (ArgumentOutOfRangeException) {}
-
- // TODO: undocumented allowable type.
- node = document.CreateNode (XmlNodeType.XmlDeclaration, null, null);
- AssertEquals (XmlNodeType.XmlDeclaration, node.NodeType);
- }
-
- public void TestCreateNodeWhichParamIsUsed ()
- {
- XmlNode node;
-
- // No constructor params for Document, DocumentFragment.
-
- node = document.CreateNode (XmlNodeType.CDATA, "a", "b", "c");
- AssertEquals (String.Empty, ((XmlCDataSection)node).Value);
-
- node = document.CreateNode (XmlNodeType.Comment, "a", "b", "c");
- AssertEquals (String.Empty, ((XmlComment)node).Value);
-
- node = document.CreateNode (XmlNodeType.DocumentType, "a", "b", "c");
- AssertNull (((XmlDocumentType)node).Value);
-
-// TODO: add this back in to test when it's implemented.
-// node = document.CreateNode (XmlNodeType.EntityReference, "a", "b", "c");
-// AssertNull (((XmlEntityReference)node).Value);
-
- node = document.CreateNode (XmlNodeType.ProcessingInstruction, "a", "b", "c");
- AssertEquals (String.Empty, ((XmlProcessingInstruction)node).Value);
-
- node = document.CreateNode (XmlNodeType.SignificantWhitespace, "a", "b", "c");
- AssertEquals (String.Empty, ((XmlSignificantWhitespace)node).Value);
-
- node = document.CreateNode (XmlNodeType.Text, "a", "b", "c");
- AssertEquals (String.Empty, ((XmlText)node).Value);
-
- node = document.CreateNode (XmlNodeType.Whitespace, "a", "b", "c");
- AssertEquals (String.Empty, ((XmlWhitespace)node).Value);
-
- node = document.CreateNode (XmlNodeType.XmlDeclaration, "a", "b", "c");
- AssertEquals ("version=\"1.0\"", ((XmlDeclaration)node).Value);
- }
-
- public void TestCreateNodeNodeTypeName ()
- {
- XmlNode node;
-
- try {
- node = document.CreateNode ("foo", null, null);
- Fail ("Expected an ArgumentException to be thrown.");
- } catch (ArgumentException) {}
-
- node = document.CreateNode("attribute", "foo", null);
- AssertEquals (XmlNodeType.Attribute, node.NodeType);
-
- node = document.CreateNode("cdatasection", null, null);
- AssertEquals (XmlNodeType.CDATA, node.NodeType);
-
- node = document.CreateNode("comment", null, null);
- AssertEquals (XmlNodeType.Comment, node.NodeType);
-
- node = document.CreateNode("document", null, null);
- AssertEquals (XmlNodeType.Document, node.NodeType);
- // TODO: test which constructor this ended up calling,
- // i.e. reuse underlying NameTable or not?
-
-// TODO: add this back in to test when it's implemented.
-// node = document.CreateNode("documentfragment", null, null);
-// AssertEquals (XmlNodeType.DocumentFragment, node.NodeType);
-
- node = document.CreateNode("documenttype", null, null);
- AssertEquals (XmlNodeType.DocumentType, node.NodeType);
-
- node = document.CreateNode("element", "foo", null);
- AssertEquals (XmlNodeType.Element, node.NodeType);
-
-// TODO: add this back in to test when it's implemented.
-// node = document.CreateNode("entityreference", "foo", null);
-// AssertEquals (XmlNodeType.EntityReference, node.NodeType);
-
- node = document.CreateNode("processinginstruction", null, null);
- AssertEquals (XmlNodeType.ProcessingInstruction, node.NodeType);
-
- node = document.CreateNode("significantwhitespace", null, null);
- AssertEquals (XmlNodeType.SignificantWhitespace, node.NodeType);
-
- node = document.CreateNode("text", null, null);
- AssertEquals (XmlNodeType.Text, node.NodeType);
-
- node = document.CreateNode("whitespace", null, null);
- AssertEquals (XmlNodeType.Whitespace, node.NodeType);
- }
-
- public void TestDocumentElement ()
- {
- AssertNull (document.DocumentElement);
- XmlElement element = document.CreateElement ("foo", "bar", "http://foo/");
- AssertNotNull (element);
-
- AssertEquals ("foo", element.Prefix);
- AssertEquals ("bar", element.LocalName);
- AssertEquals ("http://foo/", element.NamespaceURI);
-
- AssertEquals ("foo:bar", element.Name);
-
- AssertSame (element, document.AppendChild (element));
-
- AssertSame (element, document.DocumentElement);
- }
-
- public void TestDocumentEmpty()
- {
- AssertEquals ("Incorrect output for empty document.", "", document.OuterXml);
- }
-
- public void TestInnerAndOuterXml ()
- {
- AssertEquals (String.Empty, document.InnerXml);
- AssertEquals (document.InnerXml, document.OuterXml);
-
- XmlDeclaration declaration = document.CreateXmlDeclaration ("1.0", null, null);
- document.AppendChild (declaration);
- AssertEquals ("<?xml version=\"1.0\"?>", document.InnerXml);
- AssertEquals (document.InnerXml, document.OuterXml);
-
- XmlElement element = document.CreateElement ("foo");
- document.AppendChild (element);
- AssertEquals ("<?xml version=\"1.0\"?><foo />", document.InnerXml);
- AssertEquals (document.InnerXml, document.OuterXml);
-
- XmlComment comment = document.CreateComment ("bar");
- document.DocumentElement.AppendChild (comment);
- AssertEquals ("<?xml version=\"1.0\"?><foo><!--bar--></foo>", document.InnerXml);
- AssertEquals (document.InnerXml, document.OuterXml);
-
- XmlText text = document.CreateTextNode ("baz");
- document.DocumentElement.AppendChild (text);
- AssertEquals ("<?xml version=\"1.0\"?><foo><!--bar-->baz</foo>", document.InnerXml);
- AssertEquals (document.InnerXml, document.OuterXml);
-
- element = document.CreateElement ("quux");
- element.SetAttribute ("quuux", "squonk");
- document.DocumentElement.AppendChild (element);
- AssertEquals ("<?xml version=\"1.0\"?><foo><!--bar-->baz<quux quuux=\"squonk\" /></foo>", document.InnerXml);
- AssertEquals (document.InnerXml, document.OuterXml);
- }
-
- public void TestLoadXmlCDATA ()
- {
- document.LoadXml ("<foo><![CDATA[bar]]></foo>");
- Assert (document.DocumentElement.FirstChild.NodeType == XmlNodeType.CDATA);
- AssertEquals ("bar", document.DocumentElement.FirstChild.Value);
- }
-
- public void TestLoadXMLComment()
- {
-// XmlTextReader needs to throw this exception
-// try {
-// document.LoadXml("<!--foo-->");
-// Fail("XmlException should have been thrown.");
-// }
-// catch (XmlException e) {
-// AssertEquals("Exception message doesn't match.", "The root element is missing.", e.Message);
-// }
-
- document.LoadXml ("<foo><!--Comment--></foo>");
- Assert (document.DocumentElement.FirstChild.NodeType == XmlNodeType.Comment);
- AssertEquals ("Comment", document.DocumentElement.FirstChild.Value);
-
- document.LoadXml (@"<foo><!--bar--></foo>");
- AssertEquals ("Incorrect target.", "bar", ((XmlComment)document.FirstChild.FirstChild).Data);
- }
-
- public void TestLoadXmlElementSingle ()
- {
- AssertNull (document.DocumentElement);
- document.LoadXml ("<foo/>");
-
- AssertNotNull (document.DocumentElement);
- AssertSame (document.FirstChild, document.DocumentElement);
-
- AssertEquals (String.Empty, document.DocumentElement.Prefix);
- AssertEquals ("foo", document.DocumentElement.LocalName);
- AssertEquals (String.Empty, document.DocumentElement.NamespaceURI);
- AssertEquals ("foo", document.DocumentElement.Name);
- }
-
- public void TestLoadXmlElementWithAttributes ()
- {
- AssertNull (document.DocumentElement);
- document.LoadXml ("<foo bar='baz' quux='quuux'/>");
-
- XmlElement documentElement = document.DocumentElement;
-
- AssertEquals ("baz", documentElement.GetAttribute ("bar"));
- AssertEquals ("quuux", documentElement.GetAttribute ("quux"));
- }
- public void TestLoadXmlElementWithChildElement ()
- {
- document.LoadXml ("<foo><bar/></foo>");
- Assert (document.ChildNodes.Count == 1);
- Assert (document.FirstChild.ChildNodes.Count == 1);
- AssertEquals ("foo", document.DocumentElement.LocalName);
- AssertEquals ("bar", document.DocumentElement.FirstChild.LocalName);
- }
-
- public void TestLoadXmlElementWithTextNode ()
- {
- document.LoadXml ("<foo>bar</foo>");
- Assert (document.DocumentElement.FirstChild.NodeType == XmlNodeType.Text);
- AssertEquals ("bar", document.DocumentElement.FirstChild.Value);
- }
-
- public void TestLoadXmlExceptionClearsDocument ()
- {
- document.LoadXml ("<foo/>");
- Assert (document.FirstChild != null);
-
- try {
- document.LoadXml ("<123/>");
- Fail ("An XmlException should have been thrown.");
- } catch (XmlException) {}
-
- Assert (document.FirstChild == null);
- }
-
- public void TestLoadXmlProcessingInstruction ()
- {
- document.LoadXml (@"<?foo bar='baaz' quux='quuux'?><quuuux></quuuux>");
- AssertEquals ("Incorrect target.", "foo", ((XmlProcessingInstruction)document.FirstChild).Target);
- AssertEquals ("Incorrect data.", "bar='baaz' quux='quuux'", ((XmlProcessingInstruction)document.FirstChild).Data);
- }
-
- public void TestOuterXml ()
- {
- string xml;
-
- xml = "<root><![CDATA[foo]]></root>";
- document.LoadXml (xml);
- AssertEquals("XmlDocument with cdata OuterXml is incorrect.", xml, document.OuterXml);
-
- xml = "<root><!--foo--></root>";
- document.LoadXml (xml);
- AssertEquals("XmlDocument with comment OuterXml is incorrect.", xml, document.OuterXml);
-
- xml = "<root><?foo bar?></root>";
- document.LoadXml (xml);
- AssertEquals("XmlDocument with processing instruction OuterXml is incorrect.", xml, document.OuterXml);
- }
-
- public void TestParentNodes ()
- {
- document.LoadXml ("<foo><bar><baz/></bar></foo>");
- XmlNode node = document.FirstChild.FirstChild.FirstChild;
- AssertEquals ("Wrong child found.", "baz", node.LocalName);
- AssertEquals ("Wrong parent.", "bar", node.ParentNode.LocalName);
- AssertEquals ("Wrong parent.", "foo", node.ParentNode.ParentNode.LocalName);
- AssertEquals ("Wrong parent.", "#document", node.ParentNode.ParentNode.ParentNode.LocalName);
- AssertNull ("Expected parent to be null.", node.ParentNode.ParentNode.ParentNode.ParentNode);
- }
-
- public void TestRemovedElementNextSibling ()
- {
- XmlNode node;
- XmlNode nextSibling;
-
- document.LoadXml ("<foo><child1/><child2/></foo>");
- node = document.DocumentElement.FirstChild;
- document.DocumentElement.RemoveChild (node);
- nextSibling = node.NextSibling;
- AssertNull ("Expected removed node's next sibling to be null.", nextSibling);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlDocumentTypeTests.cs b/mcs/class/System.XML/Test/XmlDocumentTypeTests.cs
deleted file mode 100755
index 857478bc51c..00000000000
--- a/mcs/class/System.XML/Test/XmlDocumentTypeTests.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// System.Xml.XmlDocumentTypeTests.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlDocumentTypeTests : TestCase
- {
- XmlDocument document;
- XmlDocumentType docType;
- public XmlDocumentTypeTests ()
- : base ("MonoTests.System.Xml.XmlDocumentTypeTests testsuite")
- {
- }
-
- public XmlDocumentTypeTests (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- docType = document.CreateDocumentType ("book", null, null, "<!ELEMENT book ANY>");
- document.AppendChild (docType);
- }
-
- internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
- {
-// assertequals (original.nodetype + " was incorrectly cloned.",
-// original.baseuri, cloned.baseuri);
-
- AssertNull (cloned.ParentNode);
- AssertEquals ("Value incorrectly cloned",
- original.Value, cloned.Value);
-
- Assert ("Copies, not pointers", !Object.ReferenceEquals (original, cloned));
- }
-
- public void TestName ()
- {
- AssertEquals ("Getting Name property", "book", docType.Name);
- }
-
- public void TestLocalName ()
- {
- AssertEquals ("Getting LocalName property", "book", docType.LocalName);
- }
-
- public void TestInternalSubset ()
- {
- AssertEquals ("Getting Internal Subset property",
- "<!ELEMENT book ANY>", docType.InternalSubset);
- }
-
- public void TestAppendChild ()
- {
- try {
- XmlDocumentType type1 = document.CreateDocumentType ("book", null, null, null);
- document.AppendChild (type1);
-
- } catch (InvalidOperationException) {
- return;
-
- } catch (Exception) {
- Fail ("Incorrect Exception thrown.");
- }
- }
-
- public void TestNodeType ()
- {
- AssertEquals ("NodeType property broken",
- docType.NodeType.ToString (), "DocumentType");
- }
-
- public void TestIsReadOnly ()
- {
- AssertEquals ("IsReadOnly property", "True", docType.IsReadOnly.ToString ());
- }
-
- public void TestCloneNode ()
- {
- XmlNode original = docType;
-
- XmlNode cloned1 = docType.CloneNode (true);
- TestXmlNodeBaseProperties (original, cloned1);
-
- XmlNode cloned2 = docType.CloneNode (false);
- TestXmlNodeBaseProperties (original, cloned2);
-
- AssertEquals ("Deep and shallow cloning", cloned1.Value, cloned2.Value);
- }
-
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlElementTests.cs b/mcs/class/System.XML/Test/XmlElementTests.cs
deleted file mode 100644
index 56828179bfa..00000000000
--- a/mcs/class/System.XML/Test/XmlElementTests.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// XmlElementTests
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlElementTests : TestCase
- {
- public XmlElementTests () : base ("MonoTests.System.Xml.XmlElementTests testsuite") { }
- public XmlElementTests (string name) : base (name) { }
-
- private XmlDocument document;
-
- protected override void SetUp()
- {
- document = new XmlDocument ();
- }
-
- private void AssertElement (XmlElement element, string prefix,
- string localName, string namespaceURI,
- int attributesCount)
- {
- AssertEquals (prefix != String.Empty ? prefix + ":" + localName : localName, element.Name);
- AssertEquals (prefix, element.Prefix);
- AssertEquals (localName, element.LocalName);
- AssertEquals (namespaceURI, element.NamespaceURI);
- //AssertEquals (attributesCount, element.Attributes.Count);
- }
-
- public void TestCloneNode ()
- {
- XmlElement element = document.CreateElement ("foo");
- XmlElement child = document.CreateElement ("bar");
- XmlElement grandson = document.CreateElement ("baz");
-
- element.SetAttribute ("attr1", "val1");
- element.SetAttribute ("attr2", "val2");
- element.AppendChild (child);
- child.SetAttribute ("attr3", "val3");
- child.AppendChild (grandson);
-
- document.AppendChild (element);
- XmlNode deep = element.CloneNode (true);
- // AssertEquals ("These should be the same", deep.OuterXml, element.OuterXml);
- AssertNull ("This is not null", deep.ParentNode);
- Assert ("Copies, not pointers", !Object.ReferenceEquals (element,deep));
-
- XmlNode shallow = element.CloneNode (false);
- AssertNull ("This is not null", shallow.ParentNode);
- Assert ("Copies, not pointers", !Object.ReferenceEquals (element,shallow));
- AssertEquals ("Shallow clones shalt have no children!", false, shallow.HasChildNodes);
- }
-
- public void TestCreateElement1 ()
- {
- XmlElement element = document.CreateElement ("name");
- AssertElement (element, String.Empty, "name", String.Empty, 0);
- }
-
- public void TestCreateElement1WithPrefix ()
- {
- XmlElement element = document.CreateElement ("prefix:localName");
- AssertElement (element, "prefix", "localName", String.Empty, 0);
- }
-
- public void TestCreateElement2 ()
- {
- XmlElement element = document.CreateElement ("qualifiedName", "namespaceURI");
- AssertElement (element, String.Empty, "qualifiedName",
- "namespaceURI", 0);
- }
-
- public void TestCreateElement2WithPrefix ()
- {
- XmlElement element = document.CreateElement ("prefix:localName", "namespaceURI");
- AssertElement (element, "prefix", "localName", "namespaceURI", 0);
- }
-
- public void TestCreateElement3 ()
- {
- XmlElement element = document.CreateElement ("prefix", "localName", "namespaceURI");
- AssertElement (element, "prefix", "localName", "namespaceURI", 0);
- }
-
- public void TestInnerAndOuterXml ()
- {
- XmlElement element;
- XmlText text;
- XmlComment comment;
-
- element = document.CreateElement ("foo");
- AssertEquals (String.Empty, element.InnerXml);
- AssertEquals ("<foo />", element.OuterXml);
-
- text = document.CreateTextNode ("bar");
- element.AppendChild (text);
- AssertEquals ("bar", element.InnerXml);
- AssertEquals ("<foo>bar</foo>", element.OuterXml);
-
- element.SetAttribute ("baz", "quux");
- AssertEquals ("bar", element.InnerXml);
- AssertEquals ("<foo baz=\"quux\">bar</foo>", element.OuterXml);
-
- comment = document.CreateComment ("squonk");
- element.AppendChild (comment);
- AssertEquals ("bar<!--squonk-->", element.InnerXml);
- AssertEquals ("<foo baz=\"quux\">bar<!--squonk--></foo>", element.OuterXml);
-
-
- }
-
- public void TestSetGetAttribute ()
- {
- XmlElement element = document.CreateElement ("foo");
- element.SetAttribute ("attr1", "val1");
- element.SetAttribute ("attr2", "val2");
- AssertEquals ("val1", element.GetAttribute ("attr1"));
- AssertEquals ("val2", element.GetAttribute ("attr2"));
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs b/mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs
deleted file mode 100644
index 176c76765cb..00000000000
--- a/mcs/class/System.XML/Test/XmlNamespaceManagerTests.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// XmlNamespaceManagerTests.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlNamespaceManagerTests : TestCase
- {
- public XmlNamespaceManagerTests () : base ("MonoTests.System.Xml.XmlNameSpaceManagerTests testsuite") { }
- public XmlNamespaceManagerTests (string name) : base (name) { }
-
- private XmlNameTable nameTable;
- private XmlNamespaceManager namespaceManager;
-
- protected override void SetUp ()
- {
- nameTable = new NameTable ();
- namespaceManager = new XmlNamespaceManager (nameTable);
- }
-
- public void TestNewNamespaceManager ()
- {
- // make sure that you can call PopScope when there aren't any to pop.
- Assert (!namespaceManager.PopScope ());
-
- // the following strings should have been added to the name table by the
- // namespace manager.
- string xmlnsPrefix = nameTable.Get ("xmlns");
- string xmlPrefix = nameTable.Get ("xml");
- string stringEmpty = nameTable.Get (String.Empty);
- string xmlnsNamespace = "http://www.w3.org/2000/xmlns/";
- string xmlNamespace = "http://www.w3.org/XML/1998/namespace";
-
- // none of them should be null.
- AssertNotNull (xmlnsPrefix);
- AssertNotNull (xmlPrefix);
- AssertNotNull (stringEmpty);
- AssertNotNull (xmlnsNamespace);
- AssertNotNull (xmlNamespace);
-
- // Microsoft's XmlNamespaceManager reports that these three
- // namespaces aren't declared for some reason.
- Assert (!namespaceManager.HasNamespace ("xmlns"));
- Assert (!namespaceManager.HasNamespace ("xml"));
- Assert (!namespaceManager.HasNamespace (String.Empty));
-
- // these three namespaces are declared by default.
- AssertEquals ("http://www.w3.org/2000/xmlns/", namespaceManager.LookupNamespace ("xmlns"));
- AssertEquals ("http://www.w3.org/XML/1998/namespace", namespaceManager.LookupNamespace ("xml"));
- AssertEquals (String.Empty, namespaceManager.LookupNamespace (String.Empty));
-
- // the namespaces should be the same references found in the name table.
- AssertSame (xmlnsNamespace, namespaceManager.LookupNamespace ("xmlns"));
- AssertSame (xmlNamespace, namespaceManager.LookupNamespace ("xml"));
- AssertSame (stringEmpty, namespaceManager.LookupNamespace (String.Empty));
-
- // looking up undeclared namespaces should return null.
- AssertNull (namespaceManager.LookupNamespace ("foo"));
- }
-
- public void TestAddNamespace ()
- {
- // add a new namespace.
- namespaceManager.AddNamespace ("foo", "http://foo/");
- // make sure the new namespace is there.
- Assert (namespaceManager.HasNamespace ("foo"));
- AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
- }
-
- public void TestAddNamespaceWithNameTable ()
- {
- // add a known reference to the name table.
- string fooNamespace = "http://foo/";
- nameTable.Add(fooNamespace);
-
- // create a new string with the same value but different address.
- string fooNamespace2 = "http://";
- fooNamespace2 += "foo/";
-
- // the references must be different in order for this test to prove anything.
- Assert (!Object.ReferenceEquals (fooNamespace, fooNamespace2));
-
- // add the namespace with the reference that's not in the name table.
- namespaceManager.AddNamespace ("foo", fooNamespace2);
-
- // the returned reference should be the same one that's in the name table.
- AssertSame (fooNamespace, namespaceManager.LookupNamespace ("foo"));
- }
-
- public void TestPushScope ()
- {
- // add a new namespace.
- namespaceManager.AddNamespace ("foo", "http://foo/");
- // make sure the new namespace is there.
- Assert (namespaceManager.HasNamespace ("foo"));
- AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
- // push a new scope.
- namespaceManager.PushScope ();
- // add a new namespace.
- namespaceManager.AddNamespace ("bar", "http://bar/");
- // make sure the old namespace is not in this new scope.
- Assert (!namespaceManager.HasNamespace ("foo"));
- // but we're still supposed to be able to lookup the old namespace.
- AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
- // make sure the new namespace is there.
- Assert (namespaceManager.HasNamespace ("bar"));
- AssertEquals ("http://bar/", namespaceManager.LookupNamespace ("bar"));
- }
-
- public void TestPopScope ()
- {
- // add some namespaces and a scope.
- TestPushScope ();
- // pop the scope.
- Assert (namespaceManager.PopScope ());
- // make sure the first namespace is still there.
- Assert (namespaceManager.HasNamespace ("foo"));
- AssertEquals ("http://foo/", namespaceManager.LookupNamespace ("foo"));
- // make sure the second namespace is no longer there.
- Assert (!namespaceManager.HasNamespace ("bar"));
- AssertNull (namespaceManager.LookupNamespace ("bar"));
- // make sure there are no more scopes to pop.
- Assert (!namespaceManager.PopScope ());
- // make sure that popping again doesn't cause an exception.
- Assert (!namespaceManager.PopScope ());
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlNodeListTests.cs b/mcs/class/System.XML/Test/XmlNodeListTests.cs
deleted file mode 100644
index 89fb488f457..00000000000
--- a/mcs/class/System.XML/Test/XmlNodeListTests.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-using System;
-using System.Xml;
-using System.Collections;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlNodeListTests : TestCase
- {
- public XmlNodeListTests () : base ("MonoTests.System.Xml.XmlNodeListTests testsuite") {}
- public XmlNodeListTests (string name) : base (name) {}
-
- XmlDocument document;
- XmlElement documentElement;
- XmlElement element;
- XmlNode node;
- Object obj;
- IEnumerator enumerator;
- int index;
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- }
-
- public void TestNodeTypesThatCantHaveChildren ()
- {
- document.LoadXml ("<foo>bar</foo>");
- documentElement = document.DocumentElement;
- node = documentElement.FirstChild;
- AssertEquals ("Expected a text node.", node.NodeType, XmlNodeType.Text);
- AssertEquals ("Shouldn't have children.", node.HasChildNodes, false);
- AssertEquals ("Should be empty node list.", node.ChildNodes.Count, 0);
- AssertEquals ("Should be empty node list.", node.GetEnumerator().MoveNext(), false);
- }
-
- public void TestZeroChildren ()
- {
- document.LoadXml ("<foo/>");
- documentElement = document.DocumentElement;
- AssertEquals ("Should be empty node list.", documentElement.GetEnumerator().MoveNext(), false);
- }
-
- public void TestOneChild ()
- {
- document.LoadXml ("<foo><child1/></foo>");
- documentElement = document.DocumentElement;
- AssertEquals ("Incorrect number of children returned from Count property.", documentElement.ChildNodes.Count, 1);
- index = 1;
- foreach (XmlNode childNode in documentElement.ChildNodes)
- {
- AssertEquals ("Enumerator didn't return correct node.", "child" + index.ToString(), childNode.LocalName);
- index++;
- }
- AssertEquals ("foreach didn't loop over all children correctly.", index, 2);
- }
-
- public void TestMultipleChildren ()
- {
- document.LoadXml ("<foo><child1/><child2/><child3/></foo>");
- element = document.DocumentElement;
- AssertEquals ("Incorrect number of children returned from Count property.", element.ChildNodes.Count, 3);
- AssertNull ("Index less than zero should have returned null.", element.ChildNodes [-1]);
- AssertNull ("Index greater than or equal to Count should have returned null.", element.ChildNodes [3]);
- AssertEquals ("Didn't return the correct child.", element.FirstChild, element.ChildNodes[0]);
- AssertEquals ("Didn't return the correct child.", "child1", element.ChildNodes[0].LocalName);
- AssertEquals ("Didn't return the correct child.", "child2", element.ChildNodes[1].LocalName);
- AssertEquals ("Didn't return the correct child.", "child3", element.ChildNodes[2].LocalName);
-
- index = 1;
- foreach (XmlNode childNode in element.ChildNodes)
- {
- AssertEquals ("Enumerator didn't return correct node.", "child" + index.ToString(), childNode.LocalName);
- index++;
- }
- AssertEquals ("foreach didn't loop over all children correctly.", index, 4);
- }
-
- public void TestAppendChildAffectOnEnumeration ()
- {
- document.LoadXml ("<foo><child1/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
- AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
- enumerator.Reset();
- AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
- element.AppendChild(document.CreateElement("child2"));
- AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
- AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
- }
-
- public void TestRemoveChildAffectOnEnumeration ()
- {
- document.LoadXml ("<foo><child1/><child2/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- element.RemoveChild(element.FirstChild);
- enumerator.MoveNext();
- AssertEquals ("Expected child2 element.", ((XmlElement)enumerator.Current).LocalName, "child2");
- }
-
- public void TestRemoveChildAffectOnEnumerationWhenEnumeratorIsOnRemovedChild ()
- {
- document.LoadXml ("<foo><child1/><child2/><child3/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator ();
- enumerator.MoveNext ();
- enumerator.MoveNext ();
- AssertEquals ("Expected child2 element.", "child2", ((XmlElement)enumerator.Current).LocalName);
- AssertEquals ("Expected child2 element.", "child2", element.FirstChild.NextSibling.LocalName);
- element.RemoveChild (element.FirstChild.NextSibling);
- enumerator.MoveNext ();
-
- try {
- element = (XmlElement) enumerator.Current;
- Fail ("Expected an InvalidOperationException.");
- } catch (InvalidOperationException) { }
- }
-
- // TODO: Take the word save off front of this method when XmlNode.ReplaceChild() is implemented.
- public void saveTestReplaceChildAffectOnEnumeration ()
- {
- document.LoadXml ("<foo><child1/><child2/></foo>");
- element = document.DocumentElement;
- node = document.CreateElement("child3");
- enumerator = element.GetEnumerator();
- AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
- element.ReplaceChild(node, element.LastChild);
- enumerator.MoveNext();
- AssertEquals ("Expected child3 element.", ((XmlElement)enumerator.Current).LocalName, "child3");
- AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
- }
-
- public void TestRemoveOnlyChildAffectOnEnumeration ()
- {
- document.LoadXml ("<foo><child1/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- element.RemoveChild(element.FirstChild);
- AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
- }
-
- // TODO: Take the word save off front of this method when XmlNode.RemoveAll() is fully implemented.
- public void saveTestRemoveAllAffectOnEnumeration ()
- {
- document.LoadXml ("<foo><child1/><child2/><child3/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- AssertEquals ("Expected 3 children.", element.ChildNodes.Count, 3);
- AssertEquals ("MoveNext should have succeeded.", enumerator.MoveNext(), true);
- element.RemoveAll();
- AssertEquals ("MoveNext should have failed.", enumerator.MoveNext(), false);
- }
-
- public void TestCurrentBeforeFirstNode ()
- {
- document.LoadXml ("<foo><child1/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- try
- {
- obj = enumerator.Current;
- Fail ("Calling Current property before first node in list should have thrown InvalidOperationException.");
- } catch (InvalidOperationException) { }
- }
-
- public void TestCurrentAfterLastNode ()
- {
- document.LoadXml ("<foo><child1/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- enumerator.MoveNext();
- enumerator.MoveNext();
- try
- {
- obj = enumerator.Current;
- Fail ("Calling Current property after last node in list should have thrown InvalidOperationException.");
- }
- catch (InvalidOperationException) { }
- }
-
- public void TestCurrentDoesntMove ()
- {
- document.LoadXml ("<foo><child1/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- enumerator.MoveNext();
- AssertEquals("Consecutive calls to Current property should yield same reference.", Object.ReferenceEquals(enumerator.Current, enumerator.Current), true);
- }
-
- public void TestReset ()
- {
- document.LoadXml ("<foo><child1/><child2/></foo>");
- element = document.DocumentElement;
- enumerator = element.GetEnumerator();
- enumerator.MoveNext();
- enumerator.MoveNext();
- AssertEquals("Expected child2.", ((XmlElement)enumerator.Current).LocalName, "child2");
- enumerator.Reset();
- enumerator.MoveNext();
- AssertEquals("Expected child1.", ((XmlElement)enumerator.Current).LocalName, "child1");
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlProcessingInstructionTests.cs b/mcs/class/System.XML/Test/XmlProcessingInstructionTests.cs
deleted file mode 100644
index 0926af316aa..00000000000
--- a/mcs/class/System.XML/Test/XmlProcessingInstructionTests.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Xml.XmlTextWriterTests
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-using System.Xml;
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlProcessingInstructionTests : TestCase
- {
- public XmlProcessingInstructionTests () : base ("MonoTests.System.Xml.XmlProcessingInstructionTests testsuite") {}
- public XmlProcessingInstructionTests (string name) : base (name) {}
-
- XmlDocument document;
- XmlProcessingInstruction pi;
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- }
-
- public void TestInnerAndOuterXml ()
- {
- pi = document.CreateProcessingInstruction ("foo", "bar");
- AssertEquals (String.Empty, pi.InnerXml);
- AssertEquals ("<?foo bar?>", pi.OuterXml);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlSignificantWhitespaceTests.cs b/mcs/class/System.XML/Test/XmlSignificantWhitespaceTests.cs
deleted file mode 100755
index adaef533a17..00000000000
--- a/mcs/class/System.XML/Test/XmlSignificantWhitespaceTests.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// System.Xml.XmlWhitespaceTests.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlSignificantWhitespaceTests : TestCase
- {
- XmlDocument document;
- XmlDocument doc2;
- XmlSignificantWhitespace whitespace;
- XmlSignificantWhitespace broken;
- XmlNode original;
- XmlNode deep;
- XmlNode shallow;
-
- public XmlSignificantWhitespaceTests () : base ("MonoTests.System.Xml.XmlWhitespaceTests testsuite") {}
- public XmlSignificantWhitespaceTests (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- document.LoadXml ("<root><foo></foo></root>");
- XmlElement element = document.CreateElement ("foo");
- whitespace = document.CreateSignificantWhitespace ("\r\n");
- element.AppendChild (whitespace);
-
- doc2 = new XmlDocument ();
- }
-
- public void TestInnerAndOuterXml ()
- {
- whitespace = doc2.CreateSignificantWhitespace ("\r\n\t ");
- AssertEquals (String.Empty, whitespace.InnerXml);
- AssertEquals ("\r\n\t ", whitespace.OuterXml);
- }
-
- internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
- {
-// assertequals (original.nodetype + " was incorrectly cloned.",
-// original.baseuri, cloned.baseuri);
- AssertNull (cloned.ParentNode);
- AssertEquals ("Value incorrectly cloned",
- cloned.Value, original.Value);
-
- Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
- }
-
- public void TestXmlSignificantWhitespaceBadConstructor ()
- {
- try {
- broken = document.CreateSignificantWhitespace ("black");
-
- } catch (ArgumentException) {
- return;
-
- } catch (Exception) {
- Fail ("Incorrect Exception thrown.");
- }
- }
-
- public void TestXmlSignificantWhitespaceConstructor ()
- {
- AssertEquals ("whitespace char didn't get copied right",
- "\r\n", whitespace.Data);
- }
-
-
- public void TestXmlSignificantWhitespaceName ()
- {
- AssertEquals (whitespace.NodeType + " Name property broken",
- whitespace.Name, "#significant-whitespace");
- }
-
- public void TestXmlSignificantWhitespaceLocalName ()
- {
- AssertEquals (whitespace.NodeType + " LocalName property broken",
- whitespace.LocalName, "#significant-whitespace");
- }
-
- public void TestXmlSignificantWhitespaceNodeType ()
- {
- AssertEquals ("XmlSignificantWhitespace NodeType property broken",
- whitespace.NodeType.ToString (), "SignificantWhitespace");
- }
-
- public void TestXmlSignificantWhitespaceIsReadOnly ()
- {
- AssertEquals ("XmlSignificantWhitespace IsReadOnly property broken",
- whitespace.IsReadOnly, false);
- }
-
- public void TestXmlSignificantWhitespaceCloneNode ()
- {
- original = whitespace;
-
- shallow = whitespace.CloneNode (false); // shallow
- TestXmlNodeBaseProperties (original, shallow);
-
- deep = whitespace.CloneNode (true); // deep
- TestXmlNodeBaseProperties (original, deep);
-
- AssertEquals ("deep cloning differs from shallow cloning",
- deep.OuterXml, shallow.OuterXml);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlTextReaderTests.cs b/mcs/class/System.XML/Test/XmlTextReaderTests.cs
deleted file mode 100644
index fbc69aa7b91..00000000000
--- a/mcs/class/System.XML/Test/XmlTextReaderTests.cs
+++ /dev/null
@@ -1,1785 +0,0 @@
-//
-// XmlTextReaderTests.cs
-//
-// Author:
-// Jason Diamond (jason@injektilo.org)
-//
-// (C) 2001, 2002 Jason Diamond http://injektilo.org/
-//
-
-using System;
-using System.IO;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlTextReaderTests : TestCase
- {
- public XmlTextReaderTests () : base ("MonoTests.System.Xml.XmlTextReaderTests testsuite") { }
- public XmlTextReaderTests (string name) : base (name) { }
-
- private void AssertStartDocument (XmlReader xmlReader)
- {
- Assert (xmlReader.ReadState == ReadState.Initial);
- Assert (xmlReader.NodeType == XmlNodeType.None);
- Assert (xmlReader.Depth == 0);
- Assert (!xmlReader.EOF);
- }
-
- private void AssertNode (
- XmlReader xmlReader,
- XmlNodeType nodeType,
- int depth,
- bool isEmptyElement,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value,
- int attributeCount)
- {
- Assert (xmlReader.Read ());
- Assert (xmlReader.ReadState == ReadState.Interactive);
- Assert (!xmlReader.EOF);
- }
-
- private void AssertNodeValues (
- XmlReader xmlReader,
- XmlNodeType nodeType,
- int depth,
- bool isEmptyElement,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value,
- int attributeCount)
- {
- Assert (xmlReader.NodeType == nodeType);
- Assert (xmlReader.Depth == depth);
- Assert (xmlReader.IsEmptyElement == isEmptyElement);
-
- Assert (
- String.Format (
- "name was {0}, expected {1}",
- xmlReader.Name,
- name),
- xmlReader.Name == name);
-
- Assert (
- String.Format (
- "prefix was {0}, expected {1}",
- xmlReader.Prefix,
- prefix),
- xmlReader.Prefix == prefix);
-
- Assert (
- String.Format (
- "localName was {0}, expected {1}",
- xmlReader.LocalName,
- localName),
- xmlReader.LocalName == localName);
-
- Assert (
- String.Format (
- "namespaceURI was {0}, expected {1}",
- xmlReader.NamespaceURI,
- namespaceURI),
- xmlReader.NamespaceURI == namespaceURI);
-
- Assert (
- String.Format (
- "hasValue was {0}, expected {1}",
- xmlReader.HasValue,
- (value != String.Empty)),
- xmlReader.HasValue == (value != String.Empty));
-
- Assert (
- String.Format (
- "value was {0}, expected {1}",
- xmlReader.Value,
- value),
- xmlReader.Value == value);
-
- Assert (
- String.Format (
- "hasAttributes was {0}, expected {1}",
- xmlReader.HasAttributes,
- (attributeCount > 0)),
- xmlReader.HasAttributes == (attributeCount > 0));
-
- Assert (
- String.Format (
- "attributeCount was {0}, expected {1}",
- xmlReader.AttributeCount,
- attributeCount),
- xmlReader.AttributeCount == attributeCount);
- }
-
- private void AssertAttribute (
- XmlReader xmlReader,
- string name,
- string prefix,
- string localName,
- string namespaceURI,
- string value)
- {
- Assert (
- String.Format (
- "value was {0}, expected {1}",
- xmlReader[name],
- value),
- xmlReader[name] == value);
-
- Assert (xmlReader.GetAttribute (name) == value);
-
- if (namespaceURI != String.Empty) {
- Assert (xmlReader[localName, namespaceURI] == value);
- Assert (xmlReader.GetAttribute (localName, namespaceURI) == value);
- }
- }
-
- private void AssertEndDocument (XmlReader xmlReader)
- {
- Assert (!xmlReader.Read ());
- Assert (xmlReader.NodeType == XmlNodeType.None);
- Assert (xmlReader.Depth == 0);
- Assert (xmlReader.ReadState == ReadState.EndOfFile);
- Assert (xmlReader.EOF);
-
- xmlReader.Close ();
- Assert (xmlReader.ReadState == ReadState.Closed);
- }
-
- public void TestEmptyElement ()
- {
- string xml = "<foo/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEmptyElementWithBadName ()
- {
- string xml = "<1foo/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- bool caughtXmlException = false;
-
- try {
- xmlReader.Read();
- } catch (XmlException) {
- caughtXmlException = true;
- }
-
- Assert(caughtXmlException);
- }
-
- public void TestEmptyElementWithWhitespace ()
- {
- string xml = "<foo />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEmptyElementWithStartAndEndTag ()
- {
- string xml = "<foo></foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEmptyElementWithStartAndEndTagWithWhitespace ()
- {
- string xml = "<foo ></foo >";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestNestedEmptyTag ()
- {
- string xml = "<foo><bar/></foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, //depth
- true, // isEmptyElement
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestNestedText ()
- {
- string xml = "<foo>bar</foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "bar", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEmptyElementWithAttribute ()
- {
- string xml = @"<foo bar=""baz""/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestStartAndEndTagWithAttribute ()
- {
- string xml = @"<foo bar='baz'></foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEmptyElementWithTwoAttributes ()
- {
- string xml = @"<foo bar=""baz"" quux='quuux'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "quux", // name
- String.Empty, // prefix
- "quux", // localName
- String.Empty, // namespaceURI
- "quuux" // value
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestProcessingInstructionBeforeDocumentElement ()
- {
- string xml = "<?foo bar?><baz/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.ProcessingInstruction, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- "bar", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestCommentBeforeDocumentElement ()
- {
- string xml = "<!--foo--><bar/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Comment, // nodeType
- 0, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "foo", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestPredefinedEntities ()
- {
- string xml = "<foo>&lt;&gt;&amp;&apos;&quot;</foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "<>&'\"", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEntityReference ()
- {
- string xml = "<foo>&bar;</foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EntityReference, // nodeType
- 1, //depth
- false, // isEmptyElement
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEntityReferenceInsideText ()
- {
- string xml = "<foo>bar&baz;quux</foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "bar", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EntityReference, // nodeType
- 1, //depth
- false, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "quux", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestCharacterReferences ()
- {
- string xml = "<foo>&#70;&#x4F;&#x4f;</foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Text, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "FOO", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEntityReferenceInAttribute ()
- {
- string xml = "<foo bar='&baz;'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "&baz;" // value
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestPredefinedEntitiesInAttribute ()
- {
- string xml = "<foo bar='&lt;&gt;&amp;&apos;&quot;'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "<>&'\"" // value
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestCharacterReferencesInAttribute ()
- {
- string xml = "<foo bar='&#70;&#x4F;&#x4f;'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "FOO" // value
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestCDATA ()
- {
- string xml = "<foo><![CDATA[<>&]]></foo>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.CDATA, // nodeType
- 1, //depth
- false, // isEmptyElement
- String.Empty, // name
- String.Empty, // prefix
- String.Empty, // localName
- String.Empty, // namespaceURI
- "<>&", // value
- 0 // attributeCount
- );
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, //depth
- false, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEmptyElementInNamespace ()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestEmptyElementInDefaultNamespace ()
- {
- string xml = @"<foo xmlns='http://foo/' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns", // name
- String.Empty, // prefix
- "xmlns", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace (String.Empty));
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestChildElementInNamespace ()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/'><baz:quux xmlns:baz='http://baz/' /></foo:bar>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, // depth
- true, // isEmptyElement
- "baz:quux", // name
- "baz", // prefix
- "quux", // localName
- "http://baz/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:baz", // name
- "xmlns", // prefix
- "baz", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://baz/" // value
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- AssertEquals ("http://baz/", xmlReader.LookupNamespace ("baz"));
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- AssertNull (xmlReader.LookupNamespace ("baz"));
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestChildElementInDefaultNamespace ()
- {
- string xml = @"<foo:bar xmlns:foo='http://foo/'><baz xmlns='http://baz/' /></foo:bar>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:foo", // name
- "xmlns", // prefix
- "foo", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://foo/" // value
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 1, // depth
- true, // isEmptyElement
- "baz", // name
- String.Empty, // prefix
- "baz", // localName
- "http://baz/", // namespaceURI
- String.Empty, // value
- 1 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns", // name
- String.Empty, // prefix
- "xmlns", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://baz/" // value
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
- AssertEquals ("http://baz/", xmlReader.LookupNamespace (String.Empty));
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.EndElement, // nodeType
- 0, // depth
- false, // isEmptyElement
- "foo:bar", // name
- "foo", // prefix
- "bar", // localName
- "http://foo/", // namespaceURI
- String.Empty, // value
- 0 // attributeCount
- );
-
- AssertEquals ("http://foo/", xmlReader.LookupNamespace ("foo"));
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestAttributeInNamespace ()
- {
- string xml = @"<foo bar:baz='quux' xmlns:bar='http://bar/' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, // depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar:baz", // name
- "bar", // prefix
- "baz", // localName
- "http://bar/", // namespaceURI
- "quux" // value
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "xmlns:bar", // name
- "xmlns", // prefix
- "bar", // localName
- "http://www.w3.org/2000/xmlns/", // namespaceURI
- "http://bar/" // value
- );
-
- AssertEquals ("http://bar/", xmlReader.LookupNamespace ("bar"));
-
- AssertEndDocument (xmlReader);
- }
-
-// The following is #if'ed out because it's specific to the Mono
-// implementation and won't compile when testing Microsoft's code.
-// Feel free to turn it on if you want to test Mono's name tables.
-
-#if false
-
- public void TestIsFirstNameChar ()
- {
- for (int ch = 0; ch <= 0xFFFF; ++ch) {
- Assert (
- XmlChar.IsFirstNameChar (ch) ==
- IsFirstNameChar (ch));
- }
- }
-
- public void TestIsNameChar ()
- {
- for (int ch = 0; ch <= 0xFFFF; ++ch) {
- Assert (
- XmlChar.IsNameChar (ch) ==
- IsNameChar (ch));
- }
- }
-
- private static bool IsFirstNameChar (int ch)
- {
- return
- IsLetter (ch) ||
- (ch == '_') ||
- (ch == ':');
- }
-
- private static bool IsNameChar (int ch)
- {
- return
- IsLetter (ch) ||
- IsDigit (ch) ||
- (ch == '.') ||
- (ch == '-') ||
- (ch == '_') ||
- (ch == ':') ||
- IsCombiningChar (ch) ||
- IsExtender (ch);
- }
-
- private static bool IsLetter (int ch)
- {
- return
- IsBaseChar (ch) ||
- IsIdeographic (ch);
- }
-
- private static bool IsBaseChar (int ch)
- {
- return
- (ch >= 0x0041 && ch <= 0x005A) ||
- (ch >= 0x0061 && ch <= 0x007A) ||
- (ch >= 0x00C0 && ch <= 0x00D6) ||
- (ch >= 0x00D8 && ch <= 0x00F6) ||
- (ch >= 0x00F8 && ch <= 0x00FF) ||
- (ch >= 0x0100 && ch <= 0x0131) ||
- (ch >= 0x0134 && ch <= 0x013E) ||
- (ch >= 0x0141 && ch <= 0x0148) ||
- (ch >= 0x014A && ch <= 0x017E) ||
- (ch >= 0x0180 && ch <= 0x01C3) ||
- (ch >= 0x01CD && ch <= 0x01F0) ||
- (ch >= 0x01F4 && ch <= 0x01F5) ||
- (ch >= 0x01FA && ch <= 0x0217) ||
- (ch >= 0x0250 && ch <= 0x02A8) ||
- (ch >= 0x02BB && ch <= 0x02C1) ||
- (ch == 0x0386) ||
- (ch >= 0x0388 && ch <= 0x038A) ||
- (ch == 0x038C) ||
- (ch >= 0x038E && ch <= 0x03A1) ||
- (ch >= 0x03A3 && ch <= 0x03CE) ||
- (ch >= 0x03D0 && ch <= 0x03D6) ||
- (ch == 0x03DA) ||
- (ch == 0x03DC) ||
- (ch == 0x03DE) ||
- (ch == 0x03E0) ||
- (ch >= 0x03E2 && ch <= 0x03F3) ||
- (ch >= 0x0401 && ch <= 0x040C) ||
- (ch >= 0x040E && ch <= 0x044F) ||
- (ch >= 0x0451 && ch <= 0x045C) ||
- (ch >= 0x045E && ch <= 0x0481) ||
- (ch >= 0x0490 && ch <= 0x04C4) ||
- (ch >= 0x04C7 && ch <= 0x04C8) ||
- (ch >= 0x04CB && ch <= 0x04CC) ||
- (ch >= 0x04D0 && ch <= 0x04EB) ||
- (ch >= 0x04EE && ch <= 0x04F5) ||
- (ch >= 0x04F8 && ch <= 0x04F9) ||
- (ch >= 0x0531 && ch <= 0x0556) ||
- (ch == 0x0559) ||
- (ch >= 0x0561 && ch <= 0x0586) ||
- (ch >= 0x05D0 && ch <= 0x05EA) ||
- (ch >= 0x05F0 && ch <= 0x05F2) ||
- (ch >= 0x0621 && ch <= 0x063A) ||
- (ch >= 0x0641 && ch <= 0x064A) ||
- (ch >= 0x0671 && ch <= 0x06B7) ||
- (ch >= 0x06BA && ch <= 0x06BE) ||
- (ch >= 0x06C0 && ch <= 0x06CE) ||
- (ch >= 0x06D0 && ch <= 0x06D3) ||
- (ch == 0x06D5) ||
- (ch >= 0x06E5 && ch <= 0x06E6) ||
- (ch >= 0x0905 && ch <= 0x0939) ||
- (ch == 0x093D) ||
- (ch >= 0x0958 && ch <= 0x0961) ||
- (ch >= 0x0985 && ch <= 0x098C) ||
- (ch >= 0x098F && ch <= 0x0990) ||
- (ch >= 0x0993 && ch <= 0x09A8) ||
- (ch >= 0x09AA && ch <= 0x09B0) ||
- (ch == 0x09B2) ||
- (ch >= 0x09B6 && ch <= 0x09B9) ||
- (ch >= 0x09DC && ch <= 0x09DD) ||
- (ch >= 0x09DF && ch <= 0x09E1) ||
- (ch >= 0x09F0 && ch <= 0x09F1) ||
- (ch >= 0x0A05 && ch <= 0x0A0A) ||
- (ch >= 0x0A0F && ch <= 0x0A10) ||
- (ch >= 0x0A13 && ch <= 0x0A28) ||
- (ch >= 0x0A2A && ch <= 0x0A30) ||
- (ch >= 0x0A32 && ch <= 0x0A33) ||
- (ch >= 0x0A35 && ch <= 0x0A36) ||
- (ch >= 0x0A38 && ch <= 0x0A39) ||
- (ch >= 0x0A59 && ch <= 0x0A5C) ||
- (ch == 0x0A5E) ||
- (ch >= 0x0A72 && ch <= 0x0A74) ||
- (ch >= 0x0A85 && ch <= 0x0A8B) ||
- (ch == 0x0A8D) ||
- (ch >= 0x0A8F && ch <= 0x0A91) ||
- (ch >= 0x0A93 && ch <= 0x0AA8) ||
- (ch >= 0x0AAA && ch <= 0x0AB0) ||
- (ch >= 0x0AB2 && ch <= 0x0AB3) ||
- (ch >= 0x0AB5 && ch <= 0x0AB9) ||
- (ch == 0x0ABD) ||
- (ch == 0x0AE0) ||
- (ch >= 0x0B05 && ch <= 0x0B0C) ||
- (ch >= 0x0B0F && ch <= 0x0B10) ||
- (ch >= 0x0B13 && ch <= 0x0B28) ||
- (ch >= 0x0B2A && ch <= 0x0B30) ||
- (ch >= 0x0B32 && ch <= 0x0B33) ||
- (ch >= 0x0B36 && ch <= 0x0B39) ||
- (ch == 0x0B3D) ||
- (ch >= 0x0B5C && ch <= 0x0B5D) ||
- (ch >= 0x0B5F && ch <= 0x0B61) ||
- (ch >= 0x0B85 && ch <= 0x0B8A) ||
- (ch >= 0x0B8E && ch <= 0x0B90) ||
- (ch >= 0x0B92 && ch <= 0x0B95) ||
- (ch >= 0x0B99 && ch <= 0x0B9A) ||
- (ch == 0x0B9C) ||
- (ch >= 0x0B9E && ch <= 0x0B9F) ||
- (ch >= 0x0BA3 && ch <= 0x0BA4) ||
- (ch >= 0x0BA8 && ch <= 0x0BAA) ||
- (ch >= 0x0BAE && ch <= 0x0BB5) ||
- (ch >= 0x0BB7 && ch <= 0x0BB9) ||
- (ch >= 0x0C05 && ch <= 0x0C0C) ||
- (ch >= 0x0C0E && ch <= 0x0C10) ||
- (ch >= 0x0C12 && ch <= 0x0C28) ||
- (ch >= 0x0C2A && ch <= 0x0C33) ||
- (ch >= 0x0C35 && ch <= 0x0C39) ||
- (ch >= 0x0C60 && ch <= 0x0C61) ||
- (ch >= 0x0C85 && ch <= 0x0C8C) ||
- (ch >= 0x0C8E && ch <= 0x0C90) ||
- (ch >= 0x0C92 && ch <= 0x0CA8) ||
- (ch >= 0x0CAA && ch <= 0x0CB3) ||
- (ch >= 0x0CB5 && ch <= 0x0CB9) ||
- (ch == 0x0CDE) ||
- (ch >= 0x0CE0 && ch <= 0x0CE1) ||
- (ch >= 0x0D05 && ch <= 0x0D0C) ||
- (ch >= 0x0D0E && ch <= 0x0D10) ||
- (ch >= 0x0D12 && ch <= 0x0D28) ||
- (ch >= 0x0D2A && ch <= 0x0D39) ||
- (ch >= 0x0D60 && ch <= 0x0D61) ||
- (ch >= 0x0E01 && ch <= 0x0E2E) ||
- (ch == 0x0E30) ||
- (ch >= 0x0E32 && ch <= 0x0E33) ||
- (ch >= 0x0E40 && ch <= 0x0E45) ||
- (ch >= 0x0E81 && ch <= 0x0E82) ||
- (ch == 0x0E84) ||
- (ch >= 0x0E87 && ch <= 0x0E88) ||
- (ch == 0x0E8A) ||
- (ch == 0x0E8D) ||
- (ch >= 0x0E94 && ch <= 0x0E97) ||
- (ch >= 0x0E99 && ch <= 0x0E9F) ||
- (ch >= 0x0EA1 && ch <= 0x0EA3) ||
- (ch == 0x0EA5) ||
- (ch == 0x0EA7) ||
- (ch >= 0x0EAA && ch <= 0x0EAB) ||
- (ch >= 0x0EAD && ch <= 0x0EAE) ||
- (ch == 0x0EB0) ||
- (ch >= 0x0EB2 && ch <= 0x0EB3) ||
- (ch == 0x0EBD) ||
- (ch >= 0x0EC0 && ch <= 0x0EC4) ||
- (ch >= 0x0F40 && ch <= 0x0F47) ||
- (ch >= 0x0F49 && ch <= 0x0F69) ||
- (ch >= 0x10A0 && ch <= 0x10C5) ||
- (ch >= 0x10D0 && ch <= 0x10F6) ||
- (ch == 0x1100) ||
- (ch >= 0x1102 && ch <= 0x1103) ||
- (ch >= 0x1105 && ch <= 0x1107) ||
- (ch == 0x1109) ||
- (ch >= 0x110B && ch <= 0x110C) ||
- (ch >= 0x110E && ch <= 0x1112) ||
- (ch == 0x113C) ||
- (ch == 0x113E) ||
- (ch == 0x1140) ||
- (ch == 0x114C) ||
- (ch == 0x114E) ||
- (ch == 0x1150) ||
- (ch >= 0x1154 && ch <= 0x1155) ||
- (ch == 0x1159) ||
- (ch >= 0x115F && ch <= 0x1161) ||
- (ch == 0x1163) ||
- (ch == 0x1165) ||
- (ch == 0x1167) ||
- (ch == 0x1169) ||
- (ch >= 0x116D && ch <= 0x116E) ||
- (ch >= 0x1172 && ch <= 0x1173) ||
- (ch == 0x1175) ||
- (ch == 0x119E) ||
- (ch == 0x11A8) ||
- (ch == 0x11AB) ||
- (ch >= 0x11AE && ch <= 0x11AF) ||
- (ch >= 0x11B7 && ch <= 0x11B8) ||
- (ch == 0x11BA) ||
- (ch >= 0x11BC && ch <= 0x11C2) ||
- (ch == 0x11EB) ||
- (ch == 0x11F0) ||
- (ch == 0x11F9) ||
- (ch >= 0x1E00 && ch <= 0x1E9B) ||
- (ch >= 0x1EA0 && ch <= 0x1EF9) ||
- (ch >= 0x1F00 && ch <= 0x1F15) ||
- (ch >= 0x1F18 && ch <= 0x1F1D) ||
- (ch >= 0x1F20 && ch <= 0x1F45) ||
- (ch >= 0x1F48 && ch <= 0x1F4D) ||
- (ch >= 0x1F50 && ch <= 0x1F57) ||
- (ch == 0x1F59) ||
- (ch == 0x1F5B) ||
- (ch == 0x1F5D) ||
- (ch >= 0x1F5F && ch <= 0x1F7D) ||
- (ch >= 0x1F80 && ch <= 0x1FB4) ||
- (ch >= 0x1FB6 && ch <= 0x1FBC) ||
- (ch == 0x1FBE) ||
- (ch >= 0x1FC2 && ch <= 0x1FC4) ||
- (ch >= 0x1FC6 && ch <= 0x1FCC) ||
- (ch >= 0x1FD0 && ch <= 0x1FD3) ||
- (ch >= 0x1FD6 && ch <= 0x1FDB) ||
- (ch >= 0x1FE0 && ch <= 0x1FEC) ||
- (ch >= 0x1FF2 && ch <= 0x1FF4) ||
- (ch >= 0x1FF6 && ch <= 0x1FFC) ||
- (ch == 0x2126) ||
- (ch >= 0x212A && ch <= 0x212B) ||
- (ch == 0x212E) ||
- (ch >= 0x2180 && ch <= 0x2182) ||
- (ch >= 0x3041 && ch <= 0x3094) ||
- (ch >= 0x30A1 && ch <= 0x30FA) ||
- (ch >= 0x3105 && ch <= 0x312C) ||
- (ch >= 0xAC00 && ch <= 0xD7A3);
- }
-
- private static bool IsIdeographic (int ch)
- {
- return
- (ch >= 0x4E00 && ch <= 0x9FA5) ||
- (ch == 0x3007) ||
- (ch >= 0x3021 && ch <= 0x3029);
- }
-
- private static bool IsDigit (int ch)
- {
- return
- (ch >= 0x0030 && ch <= 0x0039) ||
- (ch >= 0x0660 && ch <= 0x0669) ||
- (ch >= 0x06F0 && ch <= 0x06F9) ||
- (ch >= 0x0966 && ch <= 0x096F) ||
- (ch >= 0x09E6 && ch <= 0x09EF) ||
- (ch >= 0x0A66 && ch <= 0x0A6F) ||
- (ch >= 0x0AE6 && ch <= 0x0AEF) ||
- (ch >= 0x0B66 && ch <= 0x0B6F) ||
- (ch >= 0x0BE7 && ch <= 0x0BEF) ||
- (ch >= 0x0C66 && ch <= 0x0C6F) ||
- (ch >= 0x0CE6 && ch <= 0x0CEF) ||
- (ch >= 0x0D66 && ch <= 0x0D6F) ||
- (ch >= 0x0E50 && ch <= 0x0E59) ||
- (ch >= 0x0ED0 && ch <= 0x0ED9) ||
- (ch >= 0x0F20 && ch <= 0x0F29);
- }
-
- private static bool IsCombiningChar (int ch)
- {
- return
- (ch >= 0x0300 && ch <= 0x0345) ||
- (ch >= 0x0360 && ch <= 0x0361) ||
- (ch >= 0x0483 && ch <= 0x0486) ||
- (ch >= 0x0591 && ch <= 0x05A1) ||
- (ch >= 0x05A3 && ch <= 0x05B9) ||
- (ch >= 0x05BB && ch <= 0x05BD) ||
- (ch == 0x05BF) ||
- (ch >= 0x05C1 && ch <= 0x05C2) ||
- (ch == 0x05C4) ||
- (ch >= 0x064B && ch <= 0x0652) ||
- (ch == 0x0670) ||
- (ch >= 0x06D6 && ch <= 0x06DC) ||
- (ch >= 0x06DD && ch <= 0x06DF) ||
- (ch >= 0x06E0 && ch <= 0x06E4) ||
- (ch >= 0x06E7 && ch <= 0x06E8) ||
- (ch >= 0x06EA && ch <= 0x06ED) ||
- (ch >= 0x0901 && ch <= 0x0903) ||
- (ch == 0x093C) ||
- (ch >= 0x093E && ch <= 0x094C) ||
- (ch == 0x094D) ||
- (ch >= 0x0951 && ch <= 0x0954) ||
- (ch >= 0x0962 && ch <= 0x0963) ||
- (ch >= 0x0981 && ch <= 0x0983) ||
- (ch == 0x09BC) ||
- (ch == 0x09BE) ||
- (ch == 0x09BF) ||
- (ch >= 0x09C0 && ch <= 0x09C4) ||
- (ch >= 0x09C7 && ch <= 0x09C8) ||
- (ch >= 0x09CB && ch <= 0x09CD) ||
- (ch == 0x09D7) ||
- (ch >= 0x09E2 && ch <= 0x09E3) ||
- (ch == 0x0A02) ||
- (ch == 0x0A3C) ||
- (ch == 0x0A3E) ||
- (ch == 0x0A3F) ||
- (ch >= 0x0A40 && ch <= 0x0A42) ||
- (ch >= 0x0A47 && ch <= 0x0A48) ||
- (ch >= 0x0A4B && ch <= 0x0A4D) ||
- (ch >= 0x0A70 && ch <= 0x0A71) ||
- (ch >= 0x0A81 && ch <= 0x0A83) ||
- (ch == 0x0ABC) ||
- (ch >= 0x0ABE && ch <= 0x0AC5) ||
- (ch >= 0x0AC7 && ch <= 0x0AC9) ||
- (ch >= 0x0ACB && ch <= 0x0ACD) ||
- (ch >= 0x0B01 && ch <= 0x0B03) ||
- (ch == 0x0B3C) ||
- (ch >= 0x0B3E && ch <= 0x0B43) ||
- (ch >= 0x0B47 && ch <= 0x0B48) ||
- (ch >= 0x0B4B && ch <= 0x0B4D) ||
- (ch >= 0x0B56 && ch <= 0x0B57) ||
- (ch >= 0x0B82 && ch <= 0x0B83) ||
- (ch >= 0x0BBE && ch <= 0x0BC2) ||
- (ch >= 0x0BC6 && ch <= 0x0BC8) ||
- (ch >= 0x0BCA && ch <= 0x0BCD) ||
- (ch == 0x0BD7) ||
- (ch >= 0x0C01 && ch <= 0x0C03) ||
- (ch >= 0x0C3E && ch <= 0x0C44) ||
- (ch >= 0x0C46 && ch <= 0x0C48) ||
- (ch >= 0x0C4A && ch <= 0x0C4D) ||
- (ch >= 0x0C55 && ch <= 0x0C56) ||
- (ch >= 0x0C82 && ch <= 0x0C83) ||
- (ch >= 0x0CBE && ch <= 0x0CC4) ||
- (ch >= 0x0CC6 && ch <= 0x0CC8) ||
- (ch >= 0x0CCA && ch <= 0x0CCD) ||
- (ch >= 0x0CD5 && ch <= 0x0CD6) ||
- (ch >= 0x0D02 && ch <= 0x0D03) ||
- (ch >= 0x0D3E && ch <= 0x0D43) ||
- (ch >= 0x0D46 && ch <= 0x0D48) ||
- (ch >= 0x0D4A && ch <= 0x0D4D) ||
- (ch == 0x0D57) ||
- (ch == 0x0E31) ||
- (ch >= 0x0E34 && ch <= 0x0E3A) ||
- (ch >= 0x0E47 && ch <= 0x0E4E) ||
- (ch == 0x0EB1) ||
- (ch >= 0x0EB4 && ch <= 0x0EB9) ||
- (ch >= 0x0EBB && ch <= 0x0EBC) ||
- (ch >= 0x0EC8 && ch <= 0x0ECD) ||
- (ch >= 0x0F18 && ch <= 0x0F19) ||
- (ch == 0x0F35) ||
- (ch == 0x0F37) ||
- (ch == 0x0F39) ||
- (ch == 0x0F3E) ||
- (ch == 0x0F3F) ||
- (ch >= 0x0F71 && ch <= 0x0F84) ||
- (ch >= 0x0F86 && ch <= 0x0F8B) ||
- (ch >= 0x0F90 && ch <= 0x0F95) ||
- (ch == 0x0F97) ||
- (ch >= 0x0F99 && ch <= 0x0FAD) ||
- (ch >= 0x0FB1 && ch <= 0x0FB7) ||
- (ch == 0x0FB9) ||
- (ch >= 0x20D0 && ch <= 0x20DC) ||
- (ch == 0x20E1) ||
- (ch >= 0x302A && ch <= 0x302F) ||
- (ch == 0x3099) ||
- (ch == 0x309A);
- }
-
- private static bool IsExtender (int ch)
- {
- return
- (ch == 0x00B7) ||
- (ch == 0x02D0) ||
- (ch == 0x02D1) ||
- (ch == 0x0387) ||
- (ch == 0x0640) ||
- (ch == 0x0E46) ||
- (ch == 0x0EC6) ||
- (ch == 0x3005) ||
- (ch >= 0x3031 && ch <= 0x3035) ||
- (ch >= 0x309D && ch <= 0x309E) ||
- (ch >= 0x30FC && ch <= 0x30FE);
- }
-
-#endif
-
- public void TestIsName ()
- {
- Assert (XmlReader.IsName ("foo"));
- Assert (!XmlReader.IsName ("1foo"));
- Assert (!XmlReader.IsName (" foo"));
- }
-
- public void TestIsNameToken ()
- {
- Assert (XmlReader.IsNameToken ("foo"));
- Assert (XmlReader.IsNameToken ("1foo"));
- Assert (!XmlReader.IsNameToken (" foo"));
- }
-
- public void TestMoveToElementFromAttribute ()
- {
- string xml = @"<foo bar=""baz"" />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- Assert (xmlReader.Read ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assert (xmlReader.MoveToFirstAttribute ());
- AssertEquals (XmlNodeType.Attribute, xmlReader.NodeType);
- Assert (xmlReader.MoveToElement ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
-
- public void TestMoveToElementFromElement ()
- {
- string xml = @"<foo bar=""baz"" />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- Assert (xmlReader.Read ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assert (!xmlReader.MoveToElement ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
-
- public void TestMoveToFirstAttributeWithNoAttributes ()
- {
- string xml = @"<foo />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- Assert (xmlReader.Read ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assert (!xmlReader.MoveToFirstAttribute ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
-
- public void TestMoveToNextAttributeWithNoAttributes ()
- {
- string xml = @"<foo />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- Assert (xmlReader.Read ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- Assert (!xmlReader.MoveToNextAttribute ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
- }
-
- public void TestMoveToNextAttribute()
- {
- string xml = @"<foo bar=""baz"" quux='quuux'/>";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- AssertStartDocument (xmlReader);
-
- AssertNode (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "bar", // name
- String.Empty, // prefix
- "bar", // localName
- String.Empty, // namespaceURI
- "baz" // value
- );
-
- AssertAttribute (
- xmlReader, // xmlReader
- "quux", // name
- String.Empty, // prefix
- "quux", // localName
- String.Empty, // namespaceURI
- "quuux" // value
- );
-
- Assert (xmlReader.MoveToNextAttribute ());
- Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
- Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
-
- Assert (xmlReader.MoveToNextAttribute ());
- Assert ("bar" == xmlReader.Name || "quux" == xmlReader.Name);
- Assert ("baz" == xmlReader.Value || "quuux" == xmlReader.Value);
-
- Assert (!xmlReader.MoveToNextAttribute ());
-
- Assert (xmlReader.MoveToElement ());
-
- AssertNodeValues (
- xmlReader, // xmlReader
- XmlNodeType.Element, // nodeType
- 0, //depth
- true, // isEmptyElement
- "foo", // name
- String.Empty, // prefix
- "foo", // localName
- String.Empty, // namespaceURI
- String.Empty, // value
- 2 // attributeCount
- );
-
- AssertEndDocument (xmlReader);
- }
-
- public void TestAttributeOrder ()
- {
- string xml = @"<foo _1='1' _2='2' _3='3' />";
- XmlReader xmlReader =
- new XmlTextReader (new StringReader (xml));
-
- Assert (xmlReader.Read ());
- AssertEquals (XmlNodeType.Element, xmlReader.NodeType);
-
- Assert (xmlReader.MoveToFirstAttribute ());
- AssertEquals ("_1", xmlReader.Name);
- Assert (xmlReader.MoveToNextAttribute ());
- AssertEquals ("_2", xmlReader.Name);
- Assert (xmlReader.MoveToNextAttribute ());
- AssertEquals ("_3", xmlReader.Name);
-
- Assert (!xmlReader.MoveToNextAttribute ());
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlTextTests.cs b/mcs/class/System.XML/Test/XmlTextTests.cs
deleted file mode 100644
index a885402e354..00000000000
--- a/mcs/class/System.XML/Test/XmlTextTests.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Xml.XmlTextWriterTests
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-using System.Xml;
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlTextTests : TestCase
- {
- public XmlTextTests () : base ("MonoTests.System.Xml.XmlTextTests testsuite") {}
- public XmlTextTests (string name) : base (name) {}
-
- XmlDocument document;
- XmlText text;
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- }
-
- public void TestInnerAndOuterXml ()
- {
- text = document.CreateTextNode ("&<>\"'");
- AssertEquals (String.Empty, text.InnerXml);
- AssertEquals ("&amp;&lt;&gt;\"'", text.OuterXml);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlTextWriterTests.cs b/mcs/class/System.XML/Test/XmlTextWriterTests.cs
deleted file mode 100644
index 3f50aa23a2a..00000000000
--- a/mcs/class/System.XML/Test/XmlTextWriterTests.cs
+++ /dev/null
@@ -1,903 +0,0 @@
-//
-// System.Xml.XmlTextWriterTests
-//
-// Author:
-// Kral Ferch <kral_ferch@hotmail.com>
-//
-// (C) 2002 Kral Ferch
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlTextWriterTests : TestCase
- {
- public XmlTextWriterTests () : base ("MonoTests.System.Xml.XmlTextWriterTests testsuite") {}
- public XmlTextWriterTests (string name) : base (name) {}
-
- StringWriter sw;
- XmlTextWriter xtw;
-
- protected override void SetUp ()
- {
- sw = new StringWriter ();
- xtw = new XmlTextWriter (sw);
- xtw.QuoteChar = '\'';
- }
-
- private string StringWriterText
- {
- get { return sw.GetStringBuilder ().ToString (); }
- }
-
- public void TestAttributeNamespacesNonNamespaceAttributeBefore ()
- {
- xtw.WriteStartElement ("foo");
- xtw.WriteAttributeString("bar", "baz");
- xtw.WriteAttributeString ("xmlns", "abc", null, "http://abc.def");
- AssertEquals ("<foo bar='baz' xmlns:abc='http://abc.def'", StringWriterText);
- }
-
- public void TestAttributeNamespacesNonNamespaceAttributeAfter ()
- {
- xtw.WriteStartElement ("foo");
-
- xtw.WriteAttributeString ("xmlns", "abc", null, "http://abc.def");
- xtw.WriteAttributeString("bar", "baz");
- AssertEquals ("<foo xmlns:abc='http://abc.def' bar='baz'", StringWriterText);
- }
-
- public void TestAttributeNamespacesThreeParamWithNullInNamespaceParam ()
- {
- xtw.WriteAttributeString ("xmlns", null, "http://abc.def");
- AssertEquals ("xmlns='http://abc.def'", StringWriterText);
- }
-
- public void TestAttributeNamespacesThreeParamWithTextInNamespaceParam ()
- {
- try
- {
- xtw.WriteAttributeString ("xmlns", "http://somenamespace.com", "http://abc.def");
- }
- catch (ArgumentException) {}
- }
-
- public void TestAttributeNamespacesWithNullInNamespaceParam ()
- {
- xtw.WriteAttributeString ("xmlns", "abc", null, "http://abc.def");
- AssertEquals ("xmlns:abc='http://abc.def'", StringWriterText);
- }
-
- public void TestAttributeNamespacesWithTextInNamespaceParam ()
- {
- try {
- xtw.WriteAttributeString ("xmlns", "abc", "http://somenamespace.com", "http://abc.def");
- } catch (ArgumentException) {}
- }
-
- public void TestAttributeNamespacesXmlnsXmlns ()
- {
- xtw.WriteStartElement ("foo");
- try
- {
- xtw.WriteAttributeString ("xmlns", "xmlns", null, "http://abc.def");
- Fail ("Expected an ArgumentException to be thrown.");
- }
- catch (ArgumentException) {}
- }
-
- public void TestAttributeWriteAttributeString ()
- {
- xtw.WriteStartElement ("foo");
-
- xtw.WriteAttributeString ("foo", "bar");
- AssertEquals ("<foo foo='bar'", StringWriterText);
-
- xtw.WriteAttributeString ("bar", "");
- AssertEquals ("<foo foo='bar' bar=''", StringWriterText);
-
- xtw.WriteAttributeString ("baz", null);
- AssertEquals ("<foo foo='bar' bar='' baz=''", StringWriterText);
-
- // TODO: Why does this pass Microsoft?
- xtw.WriteAttributeString ("", "quux");
- AssertEquals ("<foo foo='bar' bar='' baz='' ='quux'", StringWriterText);
-
- // TODO: Why does this pass Microsoft?
- xtw.WriteAttributeString (null, "quuux");
- AssertEquals ("<foo foo='bar' bar='' baz='' ='quux' ='quuux'", StringWriterText);
- }
-
- public void TestAttributeWriteAttributeStringNotInsideOpenStartElement ()
- {
- xtw.WriteStartElement ("foo");
- xtw.WriteString ("bar");
-
- try
- {
- xtw.WriteAttributeString ("baz", "quux");
- Fail ("Expected an InvalidOperationException to be thrown.");
- }
- catch (InvalidOperationException) {}
- }
-
- public void TestAttributeWriteAttributeStringWithoutParentElement ()
- {
- xtw.WriteAttributeString ("foo", "bar");
- AssertEquals ("foo='bar'", StringWriterText);
-
- xtw.WriteAttributeString ("baz", "quux");
- AssertEquals ("foo='bar' baz='quux'", StringWriterText);
- }
-
- public void TestCDataValid ()
- {
- xtw.WriteCData ("foo");
- AssertEquals ("WriteCData had incorrect output.", "<![CDATA[foo]]>", StringWriterText);
- }
-
- public void TestCDataInvalid ()
- {
- try {
- xtw.WriteCData("foo]]>bar");
- Fail("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) { }
- }
-
- public void TestCloseOpenElements ()
- {
- xtw.WriteStartElement("foo");
- xtw.WriteStartElement("bar");
- xtw.WriteStartElement("baz");
- xtw.Close();
- AssertEquals ("Close didn't write out end elements properly.", "<foo><bar><baz /></bar></foo>", StringWriterText);
- }
-
- public void TestCloseWriteAfter ()
- {
- xtw.WriteElementString ("foo", "bar");
- xtw.Close ();
-
- // WriteEndElement and WriteStartDocument aren't tested here because
- // they will always throw different exceptions besides 'The Writer is closed.'
- // and there are already tests for those exceptions.
-
- try {
- xtw.WriteCData ("foo");
- Fail ("WriteCData after Close Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException e) {
- AssertEquals ("Exception message is incorrect.", "The Writer is closed.", e.Message);
- }
-
- try {
- xtw.WriteComment ("foo");
- Fail ("WriteComment after Close Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException e) {
- AssertEquals ("Exception message is incorrect.", "The Writer is closed.", e.Message);
- }
-
- try {
- xtw.WriteProcessingInstruction ("foo", "bar");
- Fail ("WriteProcessingInstruction after Close Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException e) {
- AssertEquals ("Exception message is incorrect.", "The Writer is closed.", e.Message);
- }
-
- try {
- xtw.WriteStartElement ("foo", "bar", "baz");
- Fail ("WriteStartElement after Close Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException e) {
- AssertEquals ("Exception message is incorrect.", "The Writer is closed.", e.Message);
- }
-
- try
- {
- xtw.WriteAttributeString ("foo", "bar");
- Fail ("WriteAttributeString after Close Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException e)
- {
- AssertEquals ("Exception message is incorrect.", "The Writer is closed.", e.Message);
- }
-
- try {
- xtw.WriteString ("foo");
- Fail ("WriteString after Close Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException e) {
- AssertEquals ("Exception message is incorrect.", "The Writer is closed.", e.Message);
- }
- }
-
- public void TestCommentValid ()
- {
- xtw.WriteComment ("foo");
- AssertEquals ("WriteComment had incorrect output.", "<!--foo-->", StringWriterText);
- }
-
- public void TestCommentInvalid ()
- {
- try {
- xtw.WriteComment("foo-");
- Fail("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) { }
-
- try {
- xtw.WriteComment("foo-->bar");
- Fail("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) { }
- }
-
- public void TestConstructorsAndBaseStream ()
- {
- Assert ("BaseStream property returned wrong value.", Object.ReferenceEquals (null, this.xtw.BaseStream));
-
- MemoryStream ms;
- StreamReader sr;
- XmlTextWriter xtw;
-
- ms = new MemoryStream ();
- xtw = new XmlTextWriter (ms, new UnicodeEncoding ());
- xtw.WriteStartDocument ();
- xtw.Flush ();
- ms.Seek (0, SeekOrigin.Begin);
- sr = new StreamReader (ms);
- AssertEquals ("<?xml version=\"1.0\" encoding=\"utf-16\"?>", sr.ReadToEnd ());
- Assert ("BaseStream property returned wrong value.", Object.ReferenceEquals (ms, xtw.BaseStream));
-
- ms = new MemoryStream ();
- xtw = new XmlTextWriter (ms, new UnicodeEncoding ());
- xtw.WriteStartDocument (true);
- xtw.Flush ();
- ms.Seek (0, SeekOrigin.Begin);
- sr = new StreamReader (ms);
- AssertEquals ("<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>", sr.ReadToEnd ());
-
- ms = new MemoryStream ();
- xtw = new XmlTextWriter (ms, new UTF8Encoding ());
- xtw.WriteStartDocument ();
- xtw.Flush ();
- ms.Seek (0, SeekOrigin.Begin);
- sr = new StreamReader (ms);
- AssertEquals ("<?xml version=\"1.0\" encoding=\"utf-8\"?>", sr.ReadToEnd ());
-
- ms = new MemoryStream ();
- xtw = new XmlTextWriter (ms, null);
- xtw.WriteStartDocument ();
- xtw.Flush ();
- ms.Seek (0, SeekOrigin.Begin);
- sr = new StreamReader (ms);
- AssertEquals ("<?xml version=\"1.0\"?>", sr.ReadToEnd ());
-
- ms = new MemoryStream ();
- xtw = new XmlTextWriter (ms, null);
- xtw.WriteStartDocument (true);
- xtw.Flush ();
- ms.Seek (0, SeekOrigin.Begin);
- sr = new StreamReader (ms);
- AssertEquals ("<?xml version=\"1.0\" standalone=\"yes\"?>", sr.ReadToEnd ());
- Assert ("BaseStream property returned wrong value.", Object.ReferenceEquals (ms, xtw.BaseStream));
- }
-
- public void TestDocumentStart ()
- {
- xtw.WriteStartDocument ();
- AssertEquals ("XmlDeclaration is incorrect.", "<?xml version='1.0' encoding='utf-16'?>", StringWriterText);
-
- try
- {
- xtw.WriteStartDocument ();
- Fail("Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException e) {
- AssertEquals ("Exception message is incorrect.",
- "WriteStartDocument should be the first call.", e.Message);
- }
-
- xtw = new XmlTextWriter (sw = new StringWriter ());
- xtw.QuoteChar = '\'';
- xtw.WriteStartDocument (true);
- AssertEquals ("<?xml version='1.0' encoding='utf-16' standalone='yes'?>", StringWriterText);
-
- xtw = new XmlTextWriter (sw = new StringWriter ());
- xtw.QuoteChar = '\'';
- xtw.WriteStartDocument (false);
- AssertEquals ("<?xml version='1.0' encoding='utf-16' standalone='no'?>", StringWriterText);
- }
-
- public void TestElementEmpty ()
- {
- xtw.WriteStartElement ("foo");
- xtw.WriteEndElement ();
- AssertEquals ("Incorrect output.", "<foo />", StringWriterText);
- }
-
- public void TestElementWriteElementString ()
- {
- xtw.WriteElementString ("foo", "bar");
- AssertEquals ("WriteElementString has incorrect output.", "<foo>bar</foo>", StringWriterText);
-
- xtw.WriteElementString ("baz", "");
- AssertEquals ("<foo>bar</foo><baz />", StringWriterText);
-
- xtw.WriteElementString ("quux", null);
- AssertEquals ("<foo>bar</foo><baz /><quux />", StringWriterText);
-
- xtw.WriteElementString ("", "quuux");
- AssertEquals ("<foo>bar</foo><baz /><quux /><>quuux</>", StringWriterText);
-
- xtw.WriteElementString (null, "quuuux");
- AssertEquals ("<foo>bar</foo><baz /><quux /><>quuux</><>quuuux</>", StringWriterText);
- }
-
- public void TestFormatting ()
- {
- xtw.Formatting = Formatting.Indented;
- xtw.WriteStartDocument ();
- xtw.WriteStartElement ("foo");
- xtw.WriteElementString ("bar", "");
- xtw.Close ();
- AssertEquals ("<?xml version='1.0' encoding='utf-16'?>\r\n<foo>\r\n <bar />\r\n</foo>", StringWriterText);
- }
-
- public void TestFormattingInvalidXmlForFun ()
- {
- xtw.Formatting = Formatting.Indented;
- xtw.IndentChar = 'x';
- xtw.WriteStartDocument ();
- xtw.WriteStartElement ("foo");
- xtw.WriteStartElement ("bar");
- xtw.WriteElementString ("baz", "");
- xtw.Close ();
- AssertEquals ("<?xml version='1.0' encoding='utf-16'?>\r\n<foo>\r\nxx<bar>\r\nxxxx<baz />\r\nxx</bar>\r\n</foo>", StringWriterText);
- }
-
- public void TestFormattingFromRemarks ()
- {
- // Remarks section of on-line help for XmlTextWriter.Formatting suggests this test.
- xtw.Formatting = Formatting.Indented;
- xtw.WriteStartElement ("ol");
- xtw.WriteStartElement ("li");
- xtw.WriteString ("The big "); // This means "li" now has a mixed content model.
- xtw.WriteElementString ("b", "E");
- xtw.WriteElementString ("i", "lephant");
- xtw.WriteString (" walks slowly.");
- xtw.WriteEndElement ();
- xtw.WriteEndElement ();
- AssertEquals ("<ol>\r\n <li>The big <b>E</b><i>lephant</i> walks slowly.</li>\r\n</ol>", StringWriterText);
- }
-
- public void TestLookupPrefix ()
- {
- xtw.WriteStartElement ("root");
-
- xtw.WriteStartElement ("one");
- xtw.WriteAttributeString ("xmlns", "foo", null, "http://abc.def");
- xtw.WriteAttributeString ("xmlns", "bar", null, "http://ghi.jkl");
- AssertEquals ("foo", xtw.LookupPrefix ("http://abc.def"));
- AssertEquals ("bar", xtw.LookupPrefix ("http://ghi.jkl"));
- xtw.WriteEndElement ();
-
- xtw.WriteStartElement ("two");
- xtw.WriteAttributeString ("xmlns", "baz", null, "http://mno.pqr");
- xtw.WriteString("quux");
- AssertEquals ("baz", xtw.LookupPrefix ("http://mno.pqr"));
- AssertNull (xtw.LookupPrefix ("http://abc.def"));
- AssertNull (xtw.LookupPrefix ("http://ghi.jkl"));
-
- AssertNull (xtw.LookupPrefix ("http://bogus"));
- }
-
- public void TestNamespacesAttributesPassingInNamespaces ()
- {
- xtw.Namespaces = false;
- xtw.WriteStartElement ("foo");
-
- // These shouldn't throw any exceptions since they don't pass in
- // a namespace.
- xtw.WriteAttributeString ("bar", "baz");
- xtw.WriteAttributeString ("", "a", "", "b");
- xtw.WriteAttributeString (null, "c", "", "d");
- xtw.WriteAttributeString ("", "e", null, "f");
- xtw.WriteAttributeString (null, "g", null, "h");
-
- AssertEquals ("<foo bar='baz' a='b' c='d' e='f' g='h'", StringWriterText);
-
- // These should throw ArgumentException because they pass in a
- // namespace when Namespaces = false.
- }
-
- public void TestNamespacesElementsPassingInNamespaces ()
- {
- xtw.Namespaces = false;
-
- // These shouldn't throw any exceptions since they don't pass in
- // a namespace.
- xtw.WriteElementString ("foo", "bar");
- xtw.WriteStartElement ("baz");
- xtw.WriteStartElement ("quux", "");
- xtw.WriteStartElement ("quuux", null);
- xtw.WriteStartElement (null, "a", null);
- xtw.WriteStartElement (null, "b", "");
- xtw.WriteStartElement ("", "c", null);
- xtw.WriteStartElement ("", "d", "");
-
- AssertEquals ("<foo>bar</foo><baz><quux><quuux><a><b><c><d", StringWriterText);
-
- // These should throw ArgumentException because they pass in a
- // namespace when Namespaces = false.
- try {
- xtw.WriteElementString ("qux", "http://netsack.com/", String.Empty);
- Fail ("Expected an ArgumentException.");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteStartElement ("foo", "http://netsack.com/");
- Fail ("Expected an ArgumentException.");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteStartElement ("foo", "bar", "http://netsack.com/");
- Fail ("Expected an ArgumentException.");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteStartElement ("foo", "bar", null);
- Fail ("Expected an ArgumentException.");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteStartElement ("foo", "bar", "");
- Fail ("Expected an ArgumentException.");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteStartElement ("foo", "", "");
- Fail ("Expected an ArgumentException.");
- } catch (ArgumentException) {}
- }
-
- public void TestNamespacesNoNamespaceClearsDefaultNamespace ()
- {
- xtw.WriteStartElement(String.Empty, "foo", "http://netsack.com/");
- xtw.WriteStartElement(String.Empty, "bar", String.Empty);
- xtw.WriteElementString("baz", String.Empty, String.Empty);
- xtw.WriteEndElement();
- xtw.WriteEndElement();
- AssertEquals ("XmlTextWriter is incorrectly outputting namespaces.",
- "<foo xmlns='http://netsack.com/'><bar xmlns=''><baz /></bar></foo>", StringWriterText);
- }
-
- public void TestNamespacesPrefix ()
- {
- xtw.WriteStartElement ("foo", "bar", "http://netsack.com/");
- xtw.WriteStartElement ("foo", "baz", "http://netsack.com/");
- xtw.WriteElementString ("qux", "http://netsack.com/", String.Empty);
- xtw.WriteEndElement ();
- xtw.WriteEndElement ();
- AssertEquals ("XmlTextWriter is incorrectly outputting prefixes.",
- "<foo:bar xmlns:foo='http://netsack.com/'><foo:baz><foo:qux /></foo:baz></foo:bar>", StringWriterText);
- }
-
- public void TestNamespacesPrefixWithEmptyAndNullNamespace ()
- {
- try {
- xtw.WriteStartElement ("foo", "bar", "");
- Fail ("Should have thrown an ArgumentException.");
- } catch (ArgumentException) {}
-
- try
- {
- xtw.WriteStartElement ("foo", "bar", null);
- Fail ("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) {}
- }
-
- public void TestNamespacesSettingWhenWriteStateNotStart ()
- {
- xtw.WriteStartElement ("foo");
- try
- {
- xtw.Namespaces = false;
- Fail ("Expected an InvalidOperationException.");
- }
- catch (InvalidOperationException) {}
- AssertEquals (true, xtw.Namespaces);
- }
-
- public void TestProcessingInstructionValid ()
- {
- xtw.WriteProcessingInstruction("foo", "bar");
- AssertEquals ("WriteProcessingInstruction had incorrect output.", "<?foo bar?>", StringWriterText);
- }
-
- public void TestProcessingInstructionInvalid ()
- {
- try
- {
- xtw.WriteProcessingInstruction("fo?>o", "bar");
- Fail("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) { }
-
- try
- {
- xtw.WriteProcessingInstruction("foo", "ba?>r");
- Fail("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) { }
-
- try
- {
- xtw.WriteProcessingInstruction("", "bar");
- Fail("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) { }
-
- try
- {
- xtw.WriteProcessingInstruction(null, "bar");
- Fail("Should have thrown an ArgumentException.");
- }
- catch (ArgumentException) { }
- }
-
- public void TestQuoteCharDoubleQuote ()
- {
- xtw.QuoteChar = '"';
-
- // version, encoding, standalone
- xtw.WriteStartDocument (true);
-
- // namespace declaration
- xtw.WriteElementString ("foo", "http://netsack.com", "bar");
-
- AssertEquals ("<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?><foo xmlns=\"http://netsack.com\">bar</foo>", StringWriterText);
-
-
- }
-
- public void TestQuoteCharInvalid ()
- {
- try {
- xtw.QuoteChar = 'x';
- Fail ("Should have thrown an ArgumentException.");
- } catch (ArgumentException) {}
- }
-
- public void TestWriteBase64 ()
- {
- UTF8Encoding encoding = new UTF8Encoding();
- byte[] fooBar = encoding.GetBytes("foobar");
- xtw.WriteBase64 (fooBar, 0, 6);
- AssertEquals("Zm9vYmFy", StringWriterText);
-
- try {
- xtw.WriteBase64 (fooBar, 3, 6);
- Fail ("Expected an Argument Exception to be thrown.");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteBase64 (fooBar, -1, 6);
- Fail ("Expected an Argument Exception to be thrown.");
- } catch (ArgumentOutOfRangeException) {}
-
- try {
- xtw.WriteBase64 (fooBar, 3, -1);
- Fail ("Expected an Argument Exception to be thrown.");
- } catch (ArgumentOutOfRangeException) {}
-
- try {
- xtw.WriteBase64 (null, 0, 6);
- Fail ("Expected an Argument Exception to be thrown.");
- } catch (ArgumentNullException) {}
- }
-
- public void TestWriteCharEntity ()
- {
- xtw.WriteCharEntity ('a');
- AssertEquals ("&#x61;", StringWriterText);
-
- xtw.WriteCharEntity ('A');
- AssertEquals ("&#x61;&#x41;", StringWriterText);
-
- xtw.WriteCharEntity ('1');
- AssertEquals ("&#x61;&#x41;&#x31;", StringWriterText);
-
- xtw.WriteCharEntity ('K');
- AssertEquals ("&#x61;&#x41;&#x31;&#x4B;", StringWriterText);
-
- try {
- xtw.WriteCharEntity ((char)0xd800);
- } catch (ArgumentException) {}
- }
-
- public void TestWriteEndAttribute ()
- {
- try
- {
- xtw.WriteEndAttribute ();
- Fail ("Should have thrown an InvalidOperationException.");
- }
- catch (InvalidOperationException) {}
- }
-
- public void TestWriteEndDocument ()
- {
- try {
- xtw.WriteEndDocument ();
- Fail ("Expected an ArgumentException.");
- } catch (ArgumentException) {}
-
- xtw.WriteStartDocument ();
-
- try
- {
- xtw.WriteEndDocument ();
- Fail ("Expected an ArgumentException.");
- }
- catch (ArgumentException) {}
-
- xtw.WriteStartElement ("foo");
- xtw.WriteStartAttribute ("bar", null);
- AssertEquals ("<?xml version='1.0' encoding='utf-16'?><foo bar='", StringWriterText);
-
- xtw.WriteEndDocument ();
- AssertEquals ("<?xml version='1.0' encoding='utf-16'?><foo bar='' />", StringWriterText);
- AssertEquals (WriteState.Start, xtw.WriteState);
- }
-
- public void TestWriteEndElement ()
- {
- try {
- xtw.WriteEndElement ();
- Fail ("Should have thrown an InvalidOperationException.");
- } catch (InvalidOperationException e) {
- AssertEquals ("Exception message is incorrect.", "There was no XML start tag open.", e.Message);
- }
-
- xtw.WriteStartElement ("foo");
- xtw.WriteEndElement ();
- AssertEquals ("<foo />", StringWriterText);
-
- xtw.WriteStartElement ("bar");
- xtw.WriteStartAttribute ("baz", null);
- xtw.WriteEndElement ();
- AssertEquals ("<foo /><bar baz='' />", StringWriterText);
- }
-
- public void TestFullEndElement ()
- {
- xtw.WriteStartElement ("foo");
- xtw.WriteFullEndElement ();
- AssertEquals ("<foo></foo>", StringWriterText);
-
- xtw.WriteStartElement ("bar");
- xtw.WriteAttributeString ("foo", "bar");
- xtw.WriteFullEndElement ();
- AssertEquals ("<foo></foo><bar foo='bar'></bar>", StringWriterText);
-
- xtw.WriteStartElement ("baz");
- xtw.WriteStartAttribute ("bar", null);
- xtw.WriteFullEndElement ();
- AssertEquals ("<foo></foo><bar foo='bar'></bar><baz bar=''></baz>", StringWriterText);
- }
-
- public void TestWriteRaw ()
- {
- xtw.WriteRaw("&<>\"'");
- AssertEquals ("&<>\"'", StringWriterText);
-
- xtw.WriteRaw(null);
- AssertEquals ("&<>\"'", StringWriterText);
-
- xtw.WriteRaw("");
- AssertEquals ("&<>\"'", StringWriterText);
- }
-
- public void TestWriteRawInvalidInAttribute ()
- {
- xtw.WriteStartElement ("foo");
- xtw.WriteStartAttribute ("bar", null);
- xtw.WriteRaw ("&<>\"'");
- xtw.WriteEndAttribute ();
- xtw.WriteEndElement ();
- AssertEquals ("<foo bar='&<>\"'' />", StringWriterText);
- }
-
- public void TestWriteState ()
- {
- AssertEquals (WriteState.Start, xtw.WriteState);
- xtw.WriteStartDocument ();
- AssertEquals (WriteState.Prolog, xtw.WriteState);
- xtw.WriteStartElement ("root");
- AssertEquals (WriteState.Element, xtw.WriteState);
- xtw.WriteElementString ("foo", "bar");
- AssertEquals (WriteState.Content, xtw.WriteState);
- xtw.Close ();
- AssertEquals (WriteState.Closed, xtw.WriteState);
- }
-
- public void TestWriteString ()
- {
- xtw.WriteStartDocument ();
- try {
- xtw.WriteString("foo");
- } catch (InvalidOperationException) {}
-
- // Testing attribute values
-
- xtw.WriteStartElement ("foo");
- xtw.WriteAttributeString ("bar", "&<>");
- AssertEquals ("<?xml version='1.0' encoding='utf-16'?><foo bar='&amp;&lt;&gt;'", StringWriterText);
-
- // When QuoteChar is single quote then replaces single quotes within attributes
- // but not double quotes.
- sw.GetStringBuilder ().Remove (0, sw.GetStringBuilder ().Length);
- xtw.WriteStartElement ("foo");
- xtw.WriteAttributeString ("bar", "\"baz\"");
- xtw.WriteAttributeString ("quux", "'baz'");
- AssertEquals ("><foo bar='\"baz\"' quux='&apos;baz&apos;'", StringWriterText);
-
- // When QuoteChar is double quote then replaces double quotes within attributes
- // but not single quotes.
- xtw.QuoteChar = '"';
- sw.GetStringBuilder ().Remove (0, sw.GetStringBuilder ().Length);
- xtw.WriteStartElement ("foo");
- xtw.WriteAttributeString ("bar", "\"baz\"");
- xtw.WriteAttributeString ("quux", "'baz'");
- AssertEquals ("><foo bar=\"&quot;baz&quot;\" quux=\"'baz'\"", StringWriterText);
-
- // Testing element values
- xtw.QuoteChar = '\'';
- sw.GetStringBuilder ().Remove (0, sw.GetStringBuilder ().Length);
- xtw.WriteElementString ("foo", "&<>\"'");
- AssertEquals ("><foo>&amp;&lt;&gt;\"'</foo>", StringWriterText);
- }
-
- public void TestXmlLang ()
- {
- AssertNull (xtw.XmlLang);
-
- xtw.WriteStartElement ("foo");
- xtw.WriteAttributeString ("xml", "lang", null, "langfoo");
- AssertEquals ("langfoo", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo'", StringWriterText);
-
- xtw.WriteAttributeString ("boo", "yah");
- AssertEquals ("langfoo", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'", StringWriterText);
-
- xtw.WriteElementString("bar", "baz");
- AssertEquals ("langfoo", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>", StringWriterText);
-
- xtw.WriteString("baz");
- AssertEquals ("langfoo", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz", StringWriterText);
-
- xtw.WriteStartElement ("quux");
- xtw.WriteStartAttribute ("xml", "lang", null);
- AssertEquals ("langfoo", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz<quux xml:lang='", StringWriterText);
-
- xtw.WriteString("langbar");
- AssertEquals ("langfoo", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz<quux xml:lang='", StringWriterText);
-
- xtw.WriteEndAttribute ();
- AssertEquals ("langbar", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz<quux xml:lang='langbar'", StringWriterText);
-
- // check if xml:lang repeats output even if same as current scope.
- xtw.WriteStartElement ("joe");
- xtw.WriteAttributeString ("xml", "lang", null, "langbar");
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz<quux xml:lang='langbar'><joe xml:lang='langbar'", StringWriterText);
-
-
- xtw.WriteElementString ("quuux", "squonk");
- AssertEquals ("langbar", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz<quux xml:lang='langbar'><joe xml:lang='langbar'><quuux>squonk</quuux>", StringWriterText);
-
- xtw.WriteEndElement ();
- xtw.WriteEndElement ();
- AssertEquals ("langfoo", xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz<quux xml:lang='langbar'><joe xml:lang='langbar'><quuux>squonk</quuux></joe></quux>", StringWriterText);
-
- xtw.WriteEndElement ();
- AssertNull (xtw.XmlLang);
- AssertEquals ("<foo xml:lang='langfoo' boo='yah'><bar>baz</bar>baz<quux xml:lang='langbar'><joe xml:lang='langbar'><quuux>squonk</quuux></joe></quux></foo>", StringWriterText);
-
- xtw.Close ();
- AssertNull (xtw.XmlLang);
- }
-
- // TODO: test operational aspects
- public void TestXmlSpace ()
- {
- xtw.WriteStartElement ("foo");
- AssertEquals (XmlSpace.None, xtw.XmlSpace);
-
- xtw.WriteStartElement ("bar");
- xtw.WriteAttributeString ("xml", "space", null, "preserve");
- AssertEquals (XmlSpace.Preserve, xtw.XmlSpace);
- AssertEquals ("<foo><bar xml:space='preserve'", StringWriterText);
-
- xtw.WriteStartElement ("baz");
- xtw.WriteAttributeString ("xml", "space", null, "preserve");
- AssertEquals (XmlSpace.Preserve, xtw.XmlSpace);
- AssertEquals ("<foo><bar xml:space='preserve'><baz xml:space='preserve'", StringWriterText);
-
- xtw.WriteStartElement ("quux");
- xtw.WriteStartAttribute ("xml", "space", null);
- AssertEquals (XmlSpace.Preserve, xtw.XmlSpace);
- AssertEquals ("<foo><bar xml:space='preserve'><baz xml:space='preserve'><quux xml:space='", StringWriterText);
-
- xtw.WriteString ("default");
- AssertEquals (XmlSpace.Preserve, xtw.XmlSpace);
- AssertEquals ("<foo><bar xml:space='preserve'><baz xml:space='preserve'><quux xml:space='", StringWriterText);
-
- xtw.WriteEndAttribute ();
- AssertEquals (XmlSpace.Default, xtw.XmlSpace);
- AssertEquals ("<foo><bar xml:space='preserve'><baz xml:space='preserve'><quux xml:space='default'", StringWriterText);
-
- xtw.WriteEndElement ();
- AssertEquals (XmlSpace.Preserve, xtw.XmlSpace);
- xtw.WriteEndElement ();
- AssertEquals (XmlSpace.Preserve, xtw.XmlSpace);
- xtw.WriteEndElement ();
- AssertEquals (XmlSpace.None, xtw.XmlSpace);
-
- xtw.WriteStartElement ("quux");
- try {
- xtw.WriteAttributeString ("xml", "space", null, "bubba");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteAttributeString ("xml", "space", null, "PRESERVE");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteAttributeString ("xml", "space", null, "Preserve");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteAttributeString ("xml", "space", null, "Default");
- } catch (ArgumentException) {}
-
- try {
- xtw.WriteWhitespace ("x");
- } catch (ArgumentException) { }
- }
-
- public void TestXmlSpaceRaw ()
- {
- xtw.WriteStartElement ("foo");
- xtw.WriteStartAttribute ("xml", "space", null);
- AssertEquals (XmlSpace.None, xtw.XmlSpace);
- AssertEquals ("<foo xml:space='", StringWriterText);
-
- xtw.WriteString ("default");
- AssertEquals (XmlSpace.None, xtw.XmlSpace);
- AssertEquals ("<foo xml:space='", StringWriterText);
-
- xtw.WriteEndAttribute ();
- AssertEquals (XmlSpace.Default, xtw.XmlSpace);
- AssertEquals ("<foo xml:space='default'", StringWriterText);
- }
- }
-}
diff --git a/mcs/class/System.XML/Test/XmlWhiteSpaceTests.cs b/mcs/class/System.XML/Test/XmlWhiteSpaceTests.cs
deleted file mode 100755
index d50c749b141..00000000000
--- a/mcs/class/System.XML/Test/XmlWhiteSpaceTests.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// System.Xml.XmlWhitespaceTests.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Xml;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Xml
-{
- public class XmlWhitespaceTests : TestCase
- {
- XmlDocument document;
- XmlDocument doc2;
- XmlWhitespace whitespace;
- XmlWhitespace broken;
- XmlNode original;
- XmlNode deep;
- XmlNode shallow;
-
- public XmlWhitespaceTests () : base ("MonoTests.System.Xml.XmlWhitespaceTests testsuite") {}
- public XmlWhitespaceTests (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- document = new XmlDocument ();
- document.LoadXml ("<root><foo></foo></root>");
- XmlElement element = document.CreateElement ("foo");
- whitespace = document.CreateWhitespace ("\r\n");
- element.AppendChild (whitespace);
-
- doc2 = new XmlDocument ();
- }
-
- public void TestInnerAndOuterXml ()
- {
- whitespace = doc2.CreateWhitespace ("\r\n\t ");
- AssertEquals (String.Empty, whitespace.InnerXml);
- AssertEquals ("\r\n\t ", whitespace.OuterXml);
- }
-
- internal void TestXmlNodeBaseProperties (XmlNode original, XmlNode cloned)
- {
-// assertequals (original.nodetype + " was incorrectly cloned.",
-// original.baseuri, cloned.baseuri);
- AssertNull (cloned.ParentNode);
- AssertEquals ("Value incorrectly cloned",
- cloned.Value, original.Value);
-
- Assert ("Copies, not pointers", !Object.ReferenceEquals (original,cloned));
- }
-
- public void TestXmlWhitespaceBadConstructor ()
- {
- try {
- broken = document.CreateWhitespace ("black");
-
- } catch (ArgumentException) {
- return;
-
- } catch (Exception) {
- Fail ("Incorrect Exception thrown.");
- }
- }
-
- public void TestXmlWhitespaceConstructor ()
- {
- AssertEquals ("whitespace char didn't get copied right",
- "\r\n", whitespace.Data);
- }
-
-
- public void TestXmlWhitespaceName ()
- {
- AssertEquals (whitespace.NodeType + " Name property broken",
- whitespace.Name, "#whitespace");
- }
-
- public void TestXmlWhitespaceLocalName ()
- {
- AssertEquals (whitespace.NodeType + " LocalName property broken",
- whitespace.LocalName, "#whitespace");
- }
-
- public void TestXmlWhitespaceNodeType ()
- {
- AssertEquals ("XmlWhitespace NodeType property broken",
- whitespace.NodeType.ToString (), "Whitespace");
- }
-
- public void TestXmlWhitespaceIsReadOnly ()
- {
- AssertEquals ("XmlWhitespace IsReadOnly property broken",
- whitespace.IsReadOnly, false);
- }
-
- public void TestXmlWhitespaceCloneNode ()
- {
- original = whitespace;
-
- shallow = whitespace.CloneNode (false); // shallow
- TestXmlNodeBaseProperties (original, shallow);
-
- deep = whitespace.CloneNode (true); // deep
- TestXmlNodeBaseProperties (original, deep);
-
- AssertEquals ("deep cloning differs from shallow cloning",
- deep.OuterXml, shallow.OuterXml);
- }
- }
-}
diff --git a/mcs/class/System.XML/list b/mcs/class/System.XML/list
deleted file mode 100755
index 11bdb474cb0..00000000000
--- a/mcs/class/System.XML/list
+++ /dev/null
@@ -1,190 +0,0 @@
-System.Xml\\EntityHandling.cs
-System.Xml\\XmlConvert.cs
-System.Xml\\Formatting.cs
-System.Xml\\IHasXmlNode.cs
-System.Xml\\IXmlLineInfo.cs
-System.Xml\\NameTable.cs
-System.Xml\\ReadState.cs
-System.Xml\\TODOAttribute.cs
-System.Xml\\ValidationType.cs
-System.Xml\\WhitespaceHandling.cs
-System.Xml\\WriteState.cs
-System.Xml\\XmlAttribute.cs
-System.Xml\\XmlAttributeCollection.cs
-System.Xml\\XmlCDataSection.cs
-System.Xml\\XmlChar.cs
-System.Xml\\XmlCharacterData.cs
-System.Xml\\XmlComment.cs
-System.Xml\\XmlDeclaration.cs
-System.Xml\\XmlDocument.cs
-System.Xml\\XmlDocumentFragment.cs
-System.Xml\\XmlDocumentType.cs
-System.Xml\\XmlElement.cs
-System.Xml\\XmlEntity.cs
-System.Xml\\XmlEntityReference.cs
-System.Xml\\XmlException.cs
-System.Xml\\XmlImplementation.cs
-System.Xml\\XmlLinkedNode.cs
-System.Xml\\XmlNamedNodeMap.cs
-System.Xml\\XmlNamespaceManager.cs
-System.Xml\\XmlNameTable.cs
-System.Xml\\XmlNode.cs
-System.Xml\\XmlNodeChangedAction.cs
-System.Xml\\XmlNodeChangedEventArgs.cs
-System.Xml\\XmlNodeChangedEventHandler.cs
-System.Xml\\XmlNodeList.cs
-System.Xml\\XmlNodeListChildren.cs
-System.Xml\\XmlNodeOrder.cs
-System.Xml\\XmlNodeReader.cs
-System.Xml\\XmlNodeType.cs
-System.Xml\\XmlNotation.cs
-System.Xml\\XmlParserContext.cs
-System.Xml\\XmlProcessingInstruction.cs
-System.Xml\\XmlQualifiedName.cs
-System.Xml\\XmlReader.cs
-System.Xml\\XmlResolver.cs
-System.Xml\\XmlSignificantWhitespace.cs
-System.Xml\\XmlSpace.cs
-System.Xml\\XmlText.cs
-System.Xml\\XmlTextReader.cs
-System.Xml\\XmlTextWriter.cs
-System.Xml\\XmlTextWriterOpenElement.cs
-System.Xml\\XmlTokenizedType.cs
-System.Xml\\XmlUrlResolver.cs
-System.Xml\\XmlWhitespace.cs
-System.Xml\\XmlWriter.cs
-System.Xml.Schema\\Parser.cs
-System.Xml.Schema\\ValidationEventArgs.cs
-System.Xml.Schema\\ValidationHandler.cs
-System.Xml.Schema\\XmlSchema.cs
-System.Xml.Schema\\XmlSchemaAll.cs
-System.Xml.Schema\\XmlSchemaAnnotated.cs
-System.Xml.Schema\\XmlSchemaAnnotation.cs
-System.Xml.Schema\\XmlSchemaAny.cs
-System.Xml.Schema\\XmlSchemaAnyAttribute.cs
-System.Xml.Schema\\XmlSchemaAppInfo.cs
-System.Xml.Schema\\XmlSchemaAttribute.cs
-System.Xml.Schema\\XmlSchemaAttributeGroup.cs
-System.Xml.Schema\\XmlSchemaAttributeGroupRef.cs
-System.Xml.Schema\\XmlSchemaChoice.cs
-System.Xml.Schema\\XmlSchemaCollection.cs
-System.Xml.Schema\\XmlSchemaCollectionEnumerator.cs
-System.Xml.Schema\\XmlSchemaComplexContent.cs
-System.Xml.Schema\\XmlSchemaComplexContentExtension.cs
-System.Xml.Schema\\XmlSchemaComplexContentRestriction.cs
-System.Xml.Schema\\XmlSchemaComplexType.cs
-System.Xml.Schema\\XmlSchemaContent.cs
-System.Xml.Schema\\XmlSchemaContentModel.cs
-System.Xml.Schema\\XmlSchemaContentProcessing.cs
-System.Xml.Schema\\XmlSchemaContentType.cs
-System.Xml.Schema\\XmlSchemaDatatype.cs
-System.Xml.Schema\\XmlSchemaDerivationMethod.cs
-System.Xml.Schema\\XmlSchemaDocumentation.cs
-System.Xml.Schema\\XmlSchemaElement.cs
-System.Xml.Schema\\XmlSchemaEnumerationFacet.cs
-System.Xml.Schema\\XmlSchemaException.cs
-System.Xml.Schema\\XmlSchemaExternal.cs
-System.Xml.Schema\\XmlSchemaFacet.cs
-System.Xml.Schema\\XmlSchemaForm.cs
-System.Xml.Schema\\XmlSchemaFractionDigitsFacet.cs
-System.Xml.Schema\\XmlSchemaGroup.cs
-System.Xml.Schema\\XmlSchemaGroupBase.cs
-System.Xml.Schema\\XmlSchemaGroupRef.cs
-System.Xml.Schema\\XmlSchemaIdentityConstraint.cs
-System.Xml.Schema\\XmlSchemaImport.cs
-System.Xml.Schema\\XmlSchemaInclude.cs
-System.Xml.Schema\\XmlSchemaInfo.cs
-System.Xml.Schema\\XmlSchemaKey.cs
-System.Xml.Schema\\XmlSchemaKeyref.cs
-System.Xml.Schema\\XmlSchemaLengthFacet.cs
-System.Xml.Schema\\XmlSchemaMaxExclusiveFacet.cs
-System.Xml.Schema\\XmlSchemaMaxInclusiveFacet.cs
-System.Xml.Schema\\XmlSchemaMaxLengthFacet.cs
-System.Xml.Schema\\XmlSchemaMinExclusiveFacet.cs
-System.Xml.Schema\\XmlSchemaMinInclusiveFacet.cs
-System.Xml.Schema\\XmlSchemaMinLengthFacet.cs
-System.Xml.Schema\\XmlSchemaNotation.cs
-System.Xml.Schema\\XmlSchemaNumericFacet.cs
-System.Xml.Schema\\XmlSchemaObject.cs
-System.Xml.Schema\\XmlSchemaObjectCollection.cs
-System.Xml.Schema\\XmlSchemaObjectEnumerator.cs
-System.Xml.Schema\\XmlSchemaObjectTable.cs
-System.Xml.Schema\\XmlSchemaParticle.cs
-System.Xml.Schema\\XmlSchemaPatternFacet.cs
-System.Xml.Schema\\XmlSchemaRedefine.cs
-System.Xml.Schema\\XmlSchemaSequence.cs
-System.Xml.Schema\\XmlSchemaSimpleContent.cs
-System.Xml.Schema\\XmlSchemaSimpleContentExtension.cs
-System.Xml.Schema\\XmlSchemaSimpleContentRestriction.cs
-System.Xml.Schema\\XmlSchemaSimpleType.cs
-System.Xml.Schema\\XmlSchemaSimpleTypeContent.cs
-System.Xml.Schema\\XmlSchemaSimpleTypeList.cs
-System.Xml.Schema\\XmlSchemaSimpleTypeRestriction.cs
-System.Xml.Schema\\XmlSchemaSimpleTypeUnion.cs
-System.Xml.Schema\\XmlSchemaTotalDigitsFacet.cs
-System.Xml.Schema\\XmlSchemaType.cs
-System.Xml.Schema\\XmlSchemaUnique.cs
-System.Xml.Schema\\XmlSchemaUse.cs
-System.Xml.Schema\\XmlSchemaUtil.cs
-System.Xml.Schema\\XmlSchemaWhiteSpaceFacet.cs
-System.Xml.Schema\\XmlSchemaXPath.cs
-System.Xml.Schema\\XmlSeverityType.cs
-System.Xml.XPath\\IXPathNavigable.cs
-System.Xml.XPath\\XmlCaseOrder.cs
-System.Xml.XPath\\XmlDataType.cs
-System.Xml.XPath\\XmlSortOrder.cs
-System.Xml.XPath\\XPathDocument.cs
-System.Xml.XPath\\XPathException.cs
-System.Xml.XPath\\XPathExpression.cs
-System.Xml.XPath\\XPathNamespaceScope.cs
-System.Xml.XPath\\XPathNavigator.cs
-System.Xml.XPath\\XPathNodeIterator.cs
-System.Xml.XPath\\XPathNodeType.cs
-System.Xml.XPath\\XPathResultType.cs
-System.Xml.XPath\\XPathScanner.cs
-System.Xml.Xsl\\IXsltContextFunction.cs
-System.Xml.Xsl\\IXsltContextVariable.cs
-System.Xml.Xsl\\XsltArgumentList.cs
-System.Xml.Xsl\\XsltCompileException.cs
-System.Xml.Xsl\\XsltContext.cs
-System.Xml.Xsl\\XsltException.cs
-System.Xml.Xsl\\XslTransform.cs
-System.Xml.Serialization\\SoapAttributeAttribute.cs
-System.Xml.Serialization\\SoapAttributeOverrides.cs
-System.Xml.Serialization\\SoapAttributes.cs
-System.Xml.Serialization\\SoapElementAttribute.cs
-System.Xml.Serialization\\SoapEnumAttribute.cs
-System.Xml.Serialization\\SoapIgnoreAttribute.cs
-System.Xml.Serialization\\SoapIncludeAttribute.cs
-System.Xml.Serialization\\SoapTypeAttribute.cs
-System.Xml.Serialization\\UnreferencedObjectEventArgs.cs
-System.Xml.Serialization\\XmlAnyAttributeAttribute.cs
-System.Xml.Serialization\\XmlAnyElementAttribute.cs
-System.Xml.Serialization\\XmlAnyElementAttributes.cs
-System.Xml.Serialization\\XmlArrayAttribute.cs
-System.Xml.Serialization\\XmlArrayItemAttribute.cs
-System.Xml.Serialization\\XmlArrayItemAttributes.cs
-System.Xml.Serialization\\XmlAttributeAttribute.cs
-System.Xml.Serialization\\XmlAttributeEventArgs.cs
-System.Xml.Serialization\\XmlAttributeOverrides.cs
-System.Xml.Serialization\\XmlAttributes.cs
-System.Xml.Serialization\\XmlChoiceIdentifierAttribute.cs
-System.Xml.Serialization\\XmlElementAttribute.cs
-System.Xml.Serialization\\XmlElementAttributes.cs
-System.Xml.Serialization\\XmlElementEventArgs.cs
-System.Xml.Serialization\\XmlEnumAttribute.cs
-System.Xml.Serialization\\XmlIgnoreAttribute.cs
-System.Xml.Serialization\\XmlIncludeAttribute.cs
-System.Xml.Serialization\\XmlMapping.cs
-System.Xml.Serialization\\XmlNamespaceDeclarationsAttribute.cs
-System.Xml.Serialization\\XmlNodeEventArgs.cs
-System.Xml.Serialization\\XmlRootAttribute.cs
-System.Xml.Serialization\\XmlSerializer.cs
-System.Xml.Serialization\\XmlSerializerNamespaces.cs
-System.Xml.Serialization\\XmlTextAttribute.cs
-System.Xml.Serialization\\XmlTypeAttribute.cs
-System.Xml.Serialization\\XmlTypeMapping.cs
-System.Xml.Serialization\\XmlAttributeEventHandler.cs
-System.Xml.Serialization\\XmlElementEventHandler.cs
-System.Xml.Serialization\\XmlNodeEventHandler.cs
-System.Xml.Serialization\\UnreferencedObjectEventHandler.cs
diff --git a/mcs/class/System.XML/list.unix b/mcs/class/System.XML/list.unix
deleted file mode 100755
index 90586e70c79..00000000000
--- a/mcs/class/System.XML/list.unix
+++ /dev/null
@@ -1,195 +0,0 @@
--r System -r mscorlib --target library -o System.Xml.dll --noconfig
-System.Xml/XmlWhitespace.cs
-System.Xml/ReadState.cs
-System.Xml/WhitespaceHandling.cs
-System.Xml/XmlChar.cs
-System.Xml/XmlDocumentNavigator.cs
-System.Xml/XmlCharacterData.cs
-System.Xml/XmlNodeType.cs
-System.Xml/XmlTextReader.cs
-System.Xml/XmlReader.cs
-System.Xml/XmlNode.cs
-System.Xml/XmlSpace.cs
-System.Xml/XmlEntityReference.cs
-System.Xml/EntityHandling.cs
-System.Xml/Formatting.cs
-System.Xml/XmlTextWriter.cs
-System.Xml/WriteState.cs
-System.Xml/XmlElement.cs
-System.Xml/XmlCDataSection.cs
-System.Xml/ValidationType.cs
-System.Xml/XmlNodeChangedAction.cs
-System.Xml/XmlNodeReader.cs
-System.Xml/IHasXmlNode.cs
-System.Xml/XmlAttributeCollection.cs
-System.Xml/XmlNamespaceManager.cs
-System.Xml/XmlEntity.cs
-System.Xml/XmlNameTable.cs
-System.Xml/XmlException.cs
-System.Xml/XmlComment.cs
-System.Xml/IXmlLineInfo.cs
-System.Xml/XmlNotation.cs
-System.Xml/NameTable.cs
-System.Xml/XmlDocumentFragment.cs
-System.Xml/XmlNodeList.cs
-System.Xml/XmlDeclaration.cs
-System.Xml/XmlSignificantWhitespace.cs
-System.Xml/XmlWriter.cs
-System.Xml/XmlProcessingInstruction.cs
-System.Xml/XmlText.cs
-System.Xml/XmlParserContext.cs
-System.Xml/XmlConvert.cs
-System.Xml/XmlNodeChangedEventArgs.cs
-System.Xml/XmlNodeListChildren.cs
-System.Xml/XmlNodeChangedEventHandler.cs
-System.Xml/XmlImplementation.cs
-System.Xml/XmlNamedNodeMap.cs
-System.Xml/XmlAttribute.cs
-System.Xml/XmlTextWriterOpenElement.cs
-System.Xml/XmlDocumentType.cs
-System.Xml/XmlLinkedNode.cs
-System.Xml/XmlConstructs.cs
-System.Xml/XmlDocument.cs
-System.Xml/TODOAttribute.cs
-System.Xml/XmlNodeOrder.cs
-System.Xml/XmlQualifiedName.cs
-System.Xml/XmlResolver.cs
-System.Xml/XmlTokenizedType.cs
-System.Xml/XmlUrlResolver.cs
-System.Xml.XPath/IXPathNavigable.cs
-System.Xml.XPath/XPathExpression.cs
-System.Xml.XPath/XPathNamespaceScope.cs
-System.Xml.XPath/XPathNodeIterator.cs
-System.Xml.XPath/XPathNodeType.cs
-System.Xml.XPath/XPathResultType.cs
-System.Xml.XPath/XmlDataType.cs
-System.Xml.XPath/XmlSortOrder.cs
-System.Xml.XPath/XPathScanner.cs
-System.Xml.XPath/XmlCaseOrder.cs
-System.Xml.XPath/XPathDocument.cs
-System.Xml.XPath/XPathException.cs
-System.Xml.XPath/XPathNavigator.cs
-System.Xml.Schema/XmlSchemaAny.cs
-System.Xml.Schema/XmlSchemaDerivationMethod.cs
-System.Xml.Schema/XmlSchemaGroupBase.cs
-System.Xml.Schema/XmlSchemaException.cs
-System.Xml.Schema/XmlSchemaFacet.cs
-System.Xml.Schema/XmlSchemaInclude.cs
-System.Xml.Schema/XmlSchemaForm.cs
-System.Xml.Schema/XmlSchemaSequence.cs
-System.Xml.Schema/XmlSchemaKeyref.cs
-System.Xml.Schema/XmlSchemaInfo.cs
-System.Xml.Schema/XmlSchemaIdentityConstraint.cs
-System.Xml.Schema/XmlSchemaLengthFacet.cs
-System.Xml.Schema/XmlSchemaPatternFacet.cs
-System.Xml.Schema/XmlSchemaXPath.cs
-System.Xml.Schema/XmlSchemaObjectTable.cs
-System.Xml.Schema/XmlSchemaCollectionEnumerator.cs
-System.Xml.Schema/XmlSchemaRedefine.cs
-System.Xml.Schema/XmlSchemaObjectCollection.cs
-System.Xml.Schema/XmlSchemaSimpleTypeList.cs
-System.Xml.Schema/XmlSchemaType.cs
-System.Xml.Schema/XmlSchemaUtil.cs
-System.Xml.Schema/ValidationHandler.cs
-System.Xml.Schema/XmlSchemaContent.cs
-System.Xml.Schema/XmlSchemaContentModel.cs
-System.Xml.Schema/XmlSchemaSimpleContentExtension.cs
-System.Xml.Schema/XmlSchemaContentType.cs
-System.Xml.Schema/XmlSchemaDatatype.cs
-System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs
-System.Xml.Schema/XmlSchemaComplexType.cs
-System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs
-System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs
-System.Xml.Schema/XmlSchemaEnumerationFacet.cs
-System.Xml.Schema/XmlSchemaMaxLengthFacet.cs
-System.Xml.Schema/XmlSchemaUse.cs
-System.Xml.Schema/XmlSchemaAnnotated.cs
-System.Xml.Schema/XmlSchemaUnique.cs
-System.Xml.Schema/XmlSchemaFractionDigitsFacet.cs
-System.Xml.Schema/ValidationEventArgs.cs
-System.Xml.Schema/XmlSchemaGroupRef.cs
-System.Xml.Schema/XmlSchemaAttributeGroup.cs
-System.Xml.Schema/XmlSchema.cs
-System.Xml.Schema/XmlSchemaDocumentation.cs
-System.Xml.Schema/XmlSchemaKey.cs
-System.Xml.Schema/XmlSchemaImport.cs
-System.Xml.Schema/XmlSchemaMinLengthFacet.cs
-System.Xml.Schema/XmlSchemaGroup.cs
-System.Xml.Schema/XmlSchemaNotation.cs
-System.Xml.Schema/XmlSchemaSimpleType.cs
-System.Xml.Schema/XmlSchemaMaxExclusiveFacet.cs
-System.Xml.Schema/XmlSchemaAnnotation.cs
-System.Xml.Schema/XmlSchemaMaxInclusiveFacet.cs
-System.Xml.Schema/XmlSchemaObject.cs
-System.Xml.Schema/XmlSchemaAnyAttribute.cs
-System.Xml.Schema/XmlSchemaMinExclusiveFacet.cs
-System.Xml.Schema/XmlSchemaAppInfo.cs
-System.Xml.Schema/XmlSchemaMinInclusiveFacet.cs
-System.Xml.Schema/XmlSchemaParticle.cs
-System.Xml.Schema/XmlSchemaAttribute.cs
-System.Xml.Schema/XmlSchemaNumericFacet.cs
-System.Xml.Schema/XmlSchemaObjectEnumerator.cs
-System.Xml.Schema/XmlSchemaChoice.cs
-System.Xml.Schema/XmlSchemaCollection.cs
-System.Xml.Schema/XmlSchemaAttributeGroupRef.cs
-System.Xml.Schema/XmlSchemaElement.cs
-System.Xml.Schema/XmlSchemaExternal.cs
-System.Xml.Schema/XmlSchemaAll.cs
-System.Xml.Schema/XmlSchemaReader.cs
-System.Xml.Schema/XmlSchemaComplexContentExtension.cs
-System.Xml.Schema/XmlSchemaComplexContentRestriction.cs
-System.Xml.Schema/XmlSchemaSimpleContent.cs
-System.Xml.Schema/XmlSchemaTotalDigitsFacet.cs
-System.Xml.Schema/XmlSchemaWhiteSpaceFacet.cs
-System.Xml.Schema/XmlSchemaComplexContent.cs
-System.Xml.Schema/XmlSchemaSimpleTypeContent.cs
-System.Xml.Schema/XmlSeverityType.cs
-System.Xml.Schema/XmlSchemaContentProcessing.cs
-System.Xml.Xsl/IXsltContextFunction.cs
-System.Xml.Xsl/IXsltContextVariable.cs
-System.Xml.Xsl/XslTransform.cs
-System.Xml.Xsl/XsltArgumentList.cs
-System.Xml.Xsl/XsltCompileException.cs
-System.Xml.Xsl/XsltContext.cs
-System.Xml.Xsl/XsltException.cs
-System.Xml.Serialization/AssemblyInfo.cs
-System.Xml.Serialization/SoapAttributeAttribute.cs
-System.Xml.Serialization/SoapElementAttribute.cs
-System.Xml.Serialization/SoapEnumAttribute.cs
-System.Xml.Serialization/SoapIgnoreAttribute.cs
-System.Xml.Serialization/SoapIncludeAttribute.cs
-System.Xml.Serialization/XmlTypeAttribute.cs
-System.Xml.Serialization/UnreferencedObjectEventArgs.cs
-System.Xml.Serialization/XmlAnyElementAttribute.cs
-System.Xml.Serialization/XmlAnyElementAttributes.cs
-System.Xml.Serialization/XmlArrayAttribute.cs
-System.Xml.Serialization/XmlArrayItemAttribute.cs
-System.Xml.Serialization/XmlChoiceIdentifierAttribute.cs
-System.Xml.Serialization/XmlEnumAttribute.cs
-System.Xml.Serialization/XmlIgnoreAttribute.cs
-System.Xml.Serialization/XmlIncludeAttribute.cs
-System.Xml.Serialization/XmlNamespaceDeclarationsAttribute.cs
-System.Xml.Serialization/XmlRootAttribute.cs
-System.Xml.Serialization/XmlTextAttribute.cs
-System.Xml.Serialization/XmlElementAttribute.cs
-System.Xml.Serialization/XmlSerializer.cs
-System.Xml.Serialization/SoapAttributeOverrides.cs
-System.Xml.Serialization/SoapAttributes.cs
-System.Xml.Serialization/SoapTypeAttribute.cs
-System.Xml.Serialization/TypeMember.cs
-System.Xml.Serialization/UnreferencedObjectEventHandler.cs
-System.Xml.Serialization/XmlAnyAttributeAttribute.cs
-System.Xml.Serialization/XmlArrayItemAttributes.cs
-System.Xml.Serialization/XmlAttributeAttribute.cs
-System.Xml.Serialization/XmlAttributeEventArgs.cs
-System.Xml.Serialization/XmlAttributeEventHandler.cs
-System.Xml.Serialization/XmlAttributeOverrides.cs
-System.Xml.Serialization/XmlAttributes.cs
-System.Xml.Serialization/XmlElementAttributes.cs
-System.Xml.Serialization/XmlElementEventArgs.cs
-System.Xml.Serialization/XmlElementEventHandler.cs
-System.Xml.Serialization/XmlMapping.cs
-System.Xml.Serialization/XmlNodeEventArgs.cs
-System.Xml.Serialization/XmlNodeEventHandler.cs
-System.Xml.Serialization/XmlSerializerNamespaces.cs
-System.Xml.Serialization/XmlTypeMapping.cs
diff --git a/mcs/class/System/.cvsignore b/mcs/class/System/.cvsignore
deleted file mode 100644
index c5f30212276..00000000000
--- a/mcs/class/System/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-System.dll
-list
diff --git a/mcs/class/System/ChangeLog b/mcs/class/System/ChangeLog
deleted file mode 100644
index 80ba88a1f57..00000000000
--- a/mcs/class/System/ChangeLog
+++ /dev/null
@@ -1,41 +0,0 @@
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.build: removed System.Drawing.dll dependency.
-
-2002-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.build: referenced System.Drawing.dll.
-
-2002-05-12 Lawrence Pit <loz@cable.a2000.nl>
-
- * System.Security.Cryptography.X509Certificates: directory added
-
-2002-05-09 Rodrigo Moya <rodrigo@ximian.com>
-
- * System.build: don't exclude anymore excluded files in
- System.ComponentModel. They compile on Linux, so they might also
- on Windows.
-
-2002-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.build: excluded EventDescriptor.cs,
- EventDescriptorCollection.cs and ICustomTypeDescriptor.cs.
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * System.build: Build System.dll with mono's corlib.dll and
- System.Xml.dll.
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * System.build: Start build System.Net.Sockets.Socket.cs,
- TcpClient.cs and TcpListener.cs
-
-2001-12-07 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * System.build: Add dependancy on linux target to test target. Need to
- have the dll before we can test it, right? Plus it encourages others
- to try 'make test'.
-
diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
deleted file mode 100644
index 0a7802bc91c..00000000000
--- a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
+++ /dev/null
@@ -1,760 +0,0 @@
-//
-// Mono.CSharp CSharpCodeProvider Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace Mono.CSharp
-{
- using System;
- using System.CodeDom;
- using System.CodeDom.Compiler;
- using System.IO;
- using System.Reflection;
- using System.Collections;
-
- internal class CSharpCodeGenerator
- : CodeGenerator
- {
- //
- // Constructors
- //
- public CSharpCodeGenerator()
- {
- }
-
- //
- // Properties
- //
- protected override string NullToken {
- get {
- return "null";
- }
- }
-
- //
- // Methods
- //
-
- protected override void GenerateArrayCreateExpression( CodeArrayCreateExpression expression )
- {
- //
- // This tries to replicate MS behavior as good as
- // possible.
- //
- // The Code-Array stuff in ms.net seems to be broken
- // anyways, or I'm too stupid to understand it.
- //
- // I'm sick of it. If you try to develop array
- // creations, test them on windows. If it works there
- // but not in mono, drop me a note. I'd be especially
- // interested in jagged-multidimensional combinations
- // with proper initialization :}
- //
-
- TextWriter output = Output;
-
- output.Write( "new " );
-
- CodeExpressionCollection initializers = expression.Initializers;
- CodeTypeReference createType = expression.CreateType;
-
- if ( initializers.Count > 0 ) {
-
- OutputType( createType );
-
- output.WriteLine( " {" );
- ++Indent;
- OutputExpressionList( initializers, true );
- --Indent;
- output.Write( "}" );
-
- } else {
- CodeTypeReference arrayType = createType.ArrayElementType;
- while ( arrayType != null ) {
- createType = arrayType;
- arrayType = arrayType.ArrayElementType;
- }
-
- OutputType( createType );
-
- output.Write( '[' );
-
- CodeExpression size = expression.SizeExpression;
- if ( size != null )
- GenerateExpression( size );
- else
- output.Write( expression.Size );
-
- output.Write( ']' );
- }
- }
-
- protected override void GenerateBaseReferenceExpression( CodeBaseReferenceExpression expression )
- {
- Output.Write( "base" );
- }
-
- protected override void GenerateCastExpression( CodeCastExpression expression )
- {
- TextWriter output = Output;
- output.Write( "((" );
- OutputType( expression.TargetType );
- output.Write( ")(" );
- GenerateExpression( expression.Expression );
- output.Write( "))" );
- }
-
-
- protected override void GenerateCompileUnitStart( CodeCompileUnit compileUnit )
- {
- GenerateComment( new CodeComment( "------------------------------------------------------------------------------" ) );
- GenerateComment( new CodeComment( " <autogenerated>" ) );
- GenerateComment( new CodeComment( " This code was generated by a tool." ) );
- GenerateComment( new CodeComment( " Mono Runtime Version: " + System.Environment.Version ) );
- GenerateComment( new CodeComment( "" ) );
- GenerateComment( new CodeComment( " Changes to this file may cause incorrect behavior and will be lost if " ) );
- GenerateComment( new CodeComment( " the code is regenerated." ) );
- GenerateComment( new CodeComment( " </autogenerated>" ) );
- GenerateComment( new CodeComment( "------------------------------------------------------------------------------" ) );
- Output.WriteLine();
- }
-
-
- protected override void GenerateDelegateCreateExpression( CodeDelegateCreateExpression expression )
- {
- TextWriter output = Output;
-
- output.Write( "new " );
-
- OutputType( expression.DelegateType );
-
- output.Write( '(' );
-
- CodeExpression targetObject = expression.TargetObject;
- if ( targetObject != null ) {
- GenerateExpression( targetObject );
- Output.Write( '.' );
- }
- output.Write( expression.MethodName );
-
- output.Write( ')' );
- }
-
- protected override void GenerateFieldReferenceExpression( CodeFieldReferenceExpression expression )
- {
- CodeExpression targetObject = expression.TargetObject;
- if ( targetObject != null ) {
- GenerateExpression( targetObject );
- Output.Write( '.' );
- }
- Output.Write( expression.FieldName );
- }
-
- protected override void GenerateArgumentReferenceExpression( CodeArgumentReferenceExpression expression )
- {
- Output.Write( expression.ParameterName );
- }
-
- protected override void GenerateVariableReferenceExpression( CodeVariableReferenceExpression expression )
- {
- Output.Write( expression.VariableName );
- }
-
- protected override void GenerateIndexerExpression( CodeIndexerExpression expression )
- {
- TextWriter output = Output;
-
- GenerateExpression( expression.TargetObject );
- output.Write( '[' );
- OutputExpressionList( expression.Indices );
- output.Write( ']' );
- }
-
- protected override void GenerateArrayIndexerExpression( CodeArrayIndexerExpression expression )
- {
- TextWriter output = Output;
-
- GenerateExpression( expression.TargetObject );
- output.Write( '[' );
- OutputExpressionList( expression.Indices );
- output.Write( ']' );
- }
-
- protected override void GenerateSnippetExpression( CodeSnippetExpression expression )
- {
- Output.Write( expression.Value );
- }
-
- protected override void GenerateMethodInvokeExpression( CodeMethodInvokeExpression expression )
- {
- TextWriter output = Output;
-
- GenerateMethodReferenceExpression( expression.Method );
-
- output.Write( '(' );
- OutputExpressionList( expression.Parameters );
- output.Write( ')' );
- }
-
- protected override void GenerateMethodReferenceExpression( CodeMethodReferenceExpression expression )
- {
- GenerateExpression( expression.TargetObject );
- Output.Write( '.' );
- Output.Write( expression.MethodName );
- }
-
- protected override void GenerateEventReferenceExpression( CodeEventReferenceExpression expression )
- {
- GenerateExpression( expression.TargetObject );
- Output.Write( '.' );
- Output.Write( expression.EventName );
- }
-
- protected override void GenerateDelegateInvokeExpression( CodeDelegateInvokeExpression expression )
- {
- GenerateExpression( expression.TargetObject );
- Output.Write( '(' );
- OutputExpressionList( expression.Parameters );
- Output.Write( ')' );
- }
-
- protected override void GenerateObjectCreateExpression( CodeObjectCreateExpression expression )
- {
- Output.Write( "new " );
- OutputType( expression.CreateType );
- Output.Write( '(' );
- OutputExpressionList( expression.Parameters );
- Output.Write( ')' );
- }
-
- protected override void GeneratePropertyReferenceExpression( CodePropertyReferenceExpression expression )
- {
- GenerateMemberReferenceExpression( expression.TargetObject,
- expression.PropertyName );
- }
-
- // TODO
- protected override void GeneratePropertySetValueReferenceExpression( CodePropertySetValueReferenceExpression expression )
- {
-
- }
-
- protected override void GenerateThisReferenceExpression( CodeThisReferenceExpression expression )
- {
- Output.Write( "this" );
- }
-
- protected override void GenerateExpressionStatement( CodeExpressionStatement statement )
- {
- GenerateExpression( statement.Expression );
- Output.WriteLine( ';' );
- }
-
- protected override void GenerateIterationStatement( CodeIterationStatement statement )
- {
- TextWriter output = Output;
-
- output.Write( "for (" );
- GenerateStatement( statement.InitStatement );
- output.Write( "; " );
- GenerateExpression( statement.TestExpression );
- output.Write( "; " );
- GenerateStatement( statement.IncrementStatement );
- output.Write( ") " );
- GenerateStatements( statement.Statements );
- }
-
- protected override void GenerateThrowExceptionStatement( CodeThrowExceptionStatement statement )
- {
- Output.Write( "throw " );
- GenerateExpression( statement.ToThrow );
- }
-
- protected override void GenerateComment( CodeComment comment )
- {
- TextWriter output = Output;
-
- if ( comment.DocComment )
- output.Write( "/// " );
- else
- output.Write( "// " );
-
- output.WriteLine( comment.Text );
- }
-
- protected override void GenerateMethodReturnStatement( CodeMethodReturnStatement statement )
- {
- TextWriter output = Output;
-
- output.Write( "return " );
-
- GenerateExpression( statement.Expression );
-
- output.Write( ";" );
- }
-
- protected override void GenerateConditionStatement( CodeConditionStatement statement )
- {
- TextWriter output = Output;
- output.Write( "if (" );
-
- GenerateExpression( statement.Condition );
-
- output.WriteLine( ") {" );
- ++Indent;
- GenerateStatements( statement.TrueStatements );
- --Indent;
- output.Write( '}' );
-
- CodeStatementCollection falses = statement.FalseStatements;
- if ( falses.Count > 0 ) {
- if ( Options.ElseOnClosing )
- output.Write( ' ' );
- else
- output.WriteLine();
- output.WriteLine( "else {" );
- ++Indent;
- GenerateStatements( falses );
- --Indent;
- output.WriteLine( '}' );
- }
- }
-
- protected override void GenerateTryCatchFinallyStatement( CodeTryCatchFinallyStatement statement )
- {
- TextWriter output = Output;
- CodeGeneratorOptions options = Options;
-
- output.WriteLine( "try {" );
- ++Indent;
- GenerateStatements( statement.TryStatements );
- --Indent;
- output.Write( '}' );
-
- foreach ( CodeCatchClause clause in statement.CatchClauses ) {
- if ( options.ElseOnClosing )
- output.Write( ' ' );
- else
- output.WriteLine();
- output.Write( "catch (" );
- OutputTypeNamePair( clause.CatchExceptionType, clause.LocalName );
- output.WriteLine( ") {" );
- ++Indent;
- GenerateStatements( clause.Statements );
- --Indent;
- output.Write( '}' );
- }
-
- CodeStatementCollection finallies = statement.FinallyStatements;
- if ( finallies.Count > 0 ) {
- if ( options.ElseOnClosing )
- output.Write( ' ' );
- else
- output.WriteLine();
- output.WriteLine( "finally {" );
- ++Indent;
- GenerateStatements( finallies );
- --Indent;
- output.WriteLine( '}' );
- }
-
- output.WriteLine();
- }
-
- protected override void GenerateAssignStatement( CodeAssignStatement statement )
- {
- TextWriter output = Output;
- GenerateExpression( statement.Left );
- output.Write( " = " );
- GenerateExpression( statement.Right );
- output.WriteLine( ';' );
- }
-
- protected override void GenerateAttachEventStatement( CodeAttachEventStatement statement )
- {
- TextWriter output = Output;
-
- GenerateEventReferenceExpression( statement.Event );
- output.Write( " += " );
- GenerateExpression( statement.Listener );
- output.WriteLine( ';' );
- }
-
- protected override void GenerateRemoveEventStatement( CodeRemoveEventStatement statement )
- {
- TextWriter output = Output;
- GenerateEventReferenceExpression( statement.Event );
- Output.Write( " -= " );
- GenerateExpression( statement.Listener );
- output.WriteLine( ';' );
- }
-
- protected override void GenerateGotoStatement( CodeGotoStatement statement )
- {
- TextWriter output = Output;
-
- output.Write( "goto " );
- output.Write( statement.Label );
- output.Write( ";" );
- }
-
- protected override void GenerateLabeledStatement( CodeLabeledStatement statement )
- {
- TextWriter output = Output;
-
- output.Write( statement.Label );
- GenerateStatement( statement.Statement );
- }
-
- protected override void GenerateVariableDeclarationStatement( CodeVariableDeclarationStatement statement )
- {
- TextWriter output = Output;
-
- OutputTypeNamePair( statement.Type, statement.Name );
-
- CodeExpression initExpression = statement.InitExpression;
- if ( initExpression != null ) {
- output.Write( " = " );
- GenerateExpression( initExpression );
- }
-
- output.WriteLine( ';' );
- }
-
- protected override void GenerateLinePragmaStart( CodeLinePragma linePragma )
- {
- Output.Write( "<GenerateLinePragmaStart>" );
- }
-
- protected override void GenerateLinePragmaEnd( CodeLinePragma linePragma )
- {
- Output.Write( "<GenerateLinePragmaEnd>" );
- }
-
- protected override void GenerateEvent( CodeMemberEvent eventRef, CodeTypeDeclaration declaration )
- {
- Output.Write( "<GenerateEvent>" );
- }
-
- protected override void GenerateField( CodeMemberField field )
- {
- TextWriter output = Output;
-
- OutputAttributeDeclarations( field.CustomAttributes );
-
- MemberAttributes attributes = field.Attributes;
- OutputMemberAccessModifier( attributes );
- OutputFieldScopeModifier( attributes );
-
- OutputTypeNamePair( field.Type, field.Name );
-
- CodeExpression initExpression = field.InitExpression;
- if ( initExpression != null ) {
- output.Write( " = " );
- GenerateExpression( initExpression );
- }
-
- output.WriteLine( ';' );
- }
-
- protected override void GenerateSnippetMember( CodeSnippetTypeMember member )
- {
- Output.Write( "<GenerateSnippetMember>" );
- }
-
- protected override void GenerateEntryPointMethod( CodeEntryPointMethod method,
- CodeTypeDeclaration declaration )
- {
- method.Name = "Main";
- GenerateMethod( method, declaration );
- }
-
- protected override void GenerateMethod( CodeMemberMethod method,
- CodeTypeDeclaration declaration )
- {
- TextWriter output = Output;
-
- OutputAttributeDeclarations( method.CustomAttributes );
-
- MemberAttributes attributes = method.Attributes;
-
- OutputMemberAccessModifier( attributes );
- OutputMemberScopeModifier( attributes );
-
- OutputType( method.ReturnType );
-
- output.Write( ' ' );
-
- CodeTypeReference privateType = method.PrivateImplementationType;
- if ( privateType != null ) {
- OutputType( privateType );
- output.Write( '.' );
- }
- output.Write( method.Name );
-
- output.Write( '(' );
- OutputParameters( method.Parameters );
- output.Write( ')' );
-
- if ( (attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract )
- output.WriteLine( ';' );
- else {
- output.WriteLine( " {" );
- ++Indent;
- GenerateStatements( method.Statements );
- --Indent;
- output.WriteLine( '}' );
- }
- }
-
- protected override void GenerateProperty( CodeMemberProperty property,
- CodeTypeDeclaration declaration )
- {
- TextWriter output = Output;
- output.Write( "<GenerateProperty>" );
- }
-
- protected override void GenerateConstructor( CodeConstructor constructor,
- CodeTypeDeclaration declaration )
- {
- Output.Write( "<GenerateConstructor>" );
- }
-
- protected override void GenerateTypeConstructor( CodeTypeConstructor constructor )
- {
- Output.Write( "<GenerateTypeConstructor>" );
- }
-
- protected override void GenerateTypeStart( CodeTypeDeclaration declaration )
- {
- TextWriter output = Output;
-
- TypeAttributes attributes = declaration.TypeAttributes;
- OutputTypeAttributes( attributes,
- declaration.IsStruct,
- declaration.IsEnum );
-
- output.Write( declaration.Name );
- output.Write( ' ' );
-
- IEnumerator enumerator = declaration.BaseTypes.GetEnumerator();
- if ( enumerator.MoveNext() ) {
- CodeTypeReference type = (CodeTypeReference)enumerator.Current;
-
- output.Write( ": " );
- OutputType( type );
-
- while ( enumerator.MoveNext() ) {
- type = (CodeTypeReference)enumerator.Current;
-
- output.Write( ", " );
- OutputType( type );
- }
-
- output.Write( ' ' );
- }
- output.WriteLine( "{" );
- ++Indent;
- }
-
- protected override void GenerateTypeEnd( CodeTypeDeclaration declaration )
- {
- --Indent;
- Output.WriteLine( "}" );
- }
-
- protected override void GenerateNamespaceStart( CodeNamespace ns )
- {
- TextWriter output = Output;
-
- string name = ns.Name;
- if ( name != null && name != "" ) {
- output.Write( "namespace " );
- output.Write( name );
- output.WriteLine( " {" );
- ++Indent;
- }
- }
-
- protected override void GenerateNamespaceEnd( CodeNamespace ns )
- {
- string name = ns.Name;
- if ( name != null && name != "" ) {
- --Indent;
- Output.WriteLine( "}" );
- }
- }
-
- protected override void GenerateNamespaceImport( CodeNamespaceImport import )
- {
- TextWriter output = Output;
-
- output.Write( "using " );
- output.Write( import.Namespace );
- output.WriteLine( ';' );
- }
-
- protected override void GenerateAttributeDeclarationsStart( CodeAttributeDeclarationCollection attributes )
- {
- Output.Write( '[' );
- }
-
- protected override void GenerateAttributeDeclarationsEnd( CodeAttributeDeclarationCollection attributes )
- {
- Output.WriteLine( ']' );
- }
-
- protected override void OutputType( CodeTypeReference type )
- {
- Output.Write( GetTypeOutput( type ) );
- }
-
- protected override string QuoteSnippetString( string value )
- {
- return "\"" + value + "\"";
- // FIXME: escape quotes
- }
-
- private void GenerateDeclaration( CodeTypeReference type, string name, CodeExpression initExpression )
- {
- TextWriter output = Output;
-
- OutputTypeNamePair( type, name );
-
- if ( initExpression != null ) {
- output.Write( " = " );
- GenerateExpression( initExpression );
- }
-
- output.WriteLine( ';' );
- }
-
- private void GenerateMemberReferenceExpression( CodeExpression targetObject, string memberName )
- {
- GenerateExpression( targetObject );
- Output.Write( '.' );
- Output.Write( memberName );
- }
-
- /*
- * ICodeGenerator
- */
-
- //[MonoTODO]
- protected override string CreateEscapedIdentifier( string value )
- {
- return value;
- }
-
- //[MonoTODO]
- protected override string CreateValidIdentifier( string value )
- {
- return value;
- }
-
- protected override string GetTypeOutput( CodeTypeReference type )
- {
- string output;
- CodeTypeReference arrayType;
-
- arrayType = type.ArrayElementType;
- if ( arrayType != null )
- output = GetTypeOutput( arrayType );
- else {
- switch ( type.BaseType ) {
-
- case "System.Decimal":
- output = "decimal";
- break;
- case "System.Double":
- output = "double";
- break;
- case "System.Single":
- output = "float";
- break;
-
- case "System.Byte":
- output = "byte";
- break;
- case "System.SByte":
- output = "sbyte";
- break;
- case "System.Int32":
- output = "int";
- break;
- case "System.UInt32":
- output = "uint";
- break;
- case "System.Int64":
- output = "long";
- break;
- case "System.UInt64":
- output = "ulong";
- break;
- case "System.Int16":
- output = "short";
- break;
- case "System.UInt16":
- output = "ushort";
- break;
-
- case "System.Boolean":
- output = "bool";
- break;
-
- case "System.Char":
- output = "char";
- break;
-
- case "System.String":
- output = "string";
- break;
- case "System.Object":
- output = "object";
- break;
-
- case "System.Void":
- output = "void";
- break;
-
- default:
- output = type.BaseType;
- break;
- }
- }
-
- int rank = type.ArrayRank;
- if ( rank > 0 ) {
- output += "[";
- for ( --rank; rank > 0; --rank )
- output += ",";
- output += "]";
- }
-
- return output;
- }
-
- protected override bool IsValidIdentifier( string identifier )
- {
- return true;
- }
-
- protected override bool Supports( GeneratorSupport supports )
- {
- if ( (supports & GeneratorSupport.Win32Resources) != 0 )
- return false;
- return true;
- }
-
-#if false
- //[MonoTODO]
- public override void ValidateIdentifier( string identifier )
- {
- }
-#endif
- }
-}
diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeProvider.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeProvider.cs
deleted file mode 100644
index c01d965ed6d..00000000000
--- a/mcs/class/System/Microsoft.CSharp/CSharpCodeProvider.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// Microsoft.CSharp CSharpCodeProvider Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace Microsoft.CSharp
-{
- using System;
- using System.CodeDom.Compiler;
- using System.ComponentModel;
-
- public class CSharpCodeProvider
- : CodeDomProvider
- {
- //
- // Constructors
- //
- CSharpCodeProvider()
- {
- }
-
- //
- // Properties
- //
- public override string FileExtension {
- get {
- return "cs";
- }
- }
-
- //
- // Methods
- //
- [MonoTODO]
- public override ICodeCompiler CreateCompiler()
- {
- throw new NotImplementedException();
- }
-
- public override ICodeGenerator CreateGenerator()
- {
- return new Mono.CSharp.CSharpCodeGenerator();
- }
-
- [MonoTODO]
- public override TypeConverter GetConverter( Type Type )
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/System/Microsoft.CSharp/ChangeLog b/mcs/class/System/Microsoft.CSharp/ChangeLog
deleted file mode 100644
index 78d2a1090ad..00000000000
--- a/mcs/class/System/Microsoft.CSharp/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2002-05-28 Daniel Stodden <stodden@in.tum.de>
-
- * ChangeLog: added
-
- * CSharpCodeProvider.cs: added
-
- * CSharpCodeGenerator.cs: C# Code Generator. Not fully complete
- but doing fairly well.
-
-
diff --git a/mcs/class/System/README b/mcs/class/System/README
deleted file mode 100755
index e7a0028b8af..00000000000
--- a/mcs/class/System/README
+++ /dev/null
@@ -1,8 +0,0 @@
-Build instructions for use with the mono runtime.
-
-Run:
- mcs @list.unix
-
-If no errors occourred, copy the generated System.dll file to the runtime dir
-(probably /usr/local/lib).
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/ChangeLog b/mcs/class/System/System.CodeDom.Compiler/ChangeLog
deleted file mode 100755
index 49367f92adf..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/ChangeLog
+++ /dev/null
@@ -1,35 +0,0 @@
-2002-05-28 Daniel Stodden <stodden@in.tum.de>
-
- * CodeDomProvider.cs: added, incomplete
-
- * CodeGeneratorOptions.cs: added, complete
-
- * CompilerErrorCollection.cs: added, stub
-
- * CompilerOptions.cs: added, stub
-
- * CompilerResults.cs: added, complete
-
- * GeneratorSupport.cs: added, complete
-
- * ICodeCompiler.cs: added, complete
-
- * ICodeParser.cs: added, complete
-
- * IndentedTextWriter.cs: added, complete
-
- * LanguageOptions.cs: added, complete
-
- * TempFileCollection.cs: added, stub
-
- * ICodeGenerator.cs: added, complete
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * CodeGenerator.cs : Mark bits with MonoTODO.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * CodeGenerator.cs: moved using statement out of namespace
- declaration.
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs b/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs
deleted file mode 100644
index 8490d637997..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.CodeDom.Compiler CodeDomProvider Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.ComponentModel;
-using System.IO;
-
-namespace System.CodeDom.Compiler
-{
- public abstract class CodeDomProvider
- : Component
- {
- //
- // Constructors
- //
- protected CodeDomProvider()
- {
- }
-
- //
- // Properties
- //
- public virtual string FileExtension {
- get {
- return String.Empty;
- }
- }
-
- public virtual LanguageOptions LanguageOptions {
- get {
- return LanguageOptions.None;
- }
- }
-
- //
- // Methods
- //
- public abstract ICodeCompiler CreateCompiler();
-
- public abstract ICodeGenerator CreateGenerator();
-
- public virtual ICodeGenerator CreateGenerator( string fileName )
- {
- return CreateGenerator();
- }
-
- public virtual ICodeGenerator CreateGenerator( TextWriter output )
- {
- return CreateGenerator();
- }
-
- public virtual ICodeParser CreateParser()
- {
- return null;
- }
-
- [MonoTODO]
- public virtual TypeConverter GetConverter( Type type )
- {
- throw new NotImplementedException();
- }
-
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs
deleted file mode 100755
index 36ea5d13ef3..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs
+++ /dev/null
@@ -1,936 +0,0 @@
-//
-// System.CodeDom.Compiler CodeGenerator class
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.CodeDom;
-using System.Reflection;
-using System.IO;
-using System.Collections;
-
-namespace System.CodeDom.Compiler {
-
- public abstract class CodeGenerator
- : ICodeGenerator
- {
- private IndentedTextWriter output;
- private CodeGeneratorOptions options;
- private CodeTypeMember currentMember;
- private CodeTypeDeclaration currentType;
-
- //
- // Constructors
- //
- protected CodeGenerator()
- {
- }
-
- //
- // Properties
- //
- protected CodeTypeMember CurrentMember {
- get {
- return currentMember;
- }
- }
-
- protected string CurrentMemberName {
- get {
- if ( currentType == null )
- return null;
- return currentMember.Name;
- }
- }
-
- protected string CurrentTypeName {
- get {
- if ( currentType == null )
- return null;
- return currentType.Name;
- }
- }
-
- protected int Indent {
- get {
- return output.Indent;
- }
- set {
- output.Indent = value;
- }
- }
-
- protected bool IsCurrentClass {
- get {
- if ( currentType == null )
- return false;
- return currentType.IsClass;
- }
- }
-
- protected bool IsCurrentDelegate {
- get {
- return currentType is CodeTypeDelegate;
- }
- }
-
- protected bool IsCurrentEnum {
- get {
- if ( currentType == null )
- return false;
- return currentType.IsEnum;
- }
- }
-
- protected bool IsCurrentInterface {
- get {
- if ( currentType == null )
- return false;
- return currentType.IsInterface;
- }
- }
-
- protected bool IsCurrentStruct {
- get {
- if ( currentType == null )
- return false;
- return currentType.IsStruct;
- }
- }
-
- protected abstract string NullToken {
- get;
- }
-
-
- protected CodeGeneratorOptions Options {
- get {
- return options;
- }
- }
-
- protected TextWriter Output {
- get {
- return output;
- }
- }
-
- //
- // Methods
- //
- protected virtual void ContinueOnNewLine( string st )
- {
- }
-
- /*
- * Code Generation methods
- */
- protected abstract void GenerateArgumentReferenceExpression (CodeArgumentReferenceExpression e);
- protected abstract void GenerateArrayCreateExpression (CodeArrayCreateExpression e);
- protected abstract void GenerateArrayIndexerExpression( CodeArrayIndexerExpression e );
- protected abstract void GenerateAssignStatement (CodeAssignStatement s);
- protected abstract void GenerateAttachEventStatement (CodeAttachEventStatement s);
- protected abstract void GenerateAttributeDeclarationsStart( CodeAttributeDeclarationCollection attributes );
- protected abstract void GenerateAttributeDeclarationsEnd( CodeAttributeDeclarationCollection attributes );
- protected abstract void GenerateBaseReferenceExpression (CodeBaseReferenceExpression e);
-
- protected virtual void GenerateBinaryOperatorExpression (CodeBinaryOperatorExpression e)
- {
- GenerateExpression( e.Left );
-
- switch ( e.Operator ) {
- case CodeBinaryOperatorType.Add:
- output.Write( " + " );
- break;
- case CodeBinaryOperatorType.Assign:
- output.Write( " = " );
- break;
- case CodeBinaryOperatorType.BitwiseAnd:
- output.Write( " & " );
- break;
- case CodeBinaryOperatorType.BitwiseOr:
- output.Write( " | " );
- break;
- case CodeBinaryOperatorType.BooleanAnd:
- output.Write( " && " );
- break;
- case CodeBinaryOperatorType.BooleanOr:
- output.Write( " || " );
- break;
- case CodeBinaryOperatorType.Divide:
- output.Write( " / " );
- break;
- case CodeBinaryOperatorType.GreaterThan:
- output.Write( " > " );
- break;
- case CodeBinaryOperatorType.GreaterThanOrEqual:
- output.Write( " >= " );
- break;
- case CodeBinaryOperatorType.IdentityEquality:
- output.Write( " == " );
- break;
- case CodeBinaryOperatorType.IdentityInequality:
- output.Write( " != " );
- break;
- case CodeBinaryOperatorType.LessThan:
- output.Write( " < " );
- break;
- case CodeBinaryOperatorType.LessThanOrEqual:
- output.Write( " <= " );
- break;
- case CodeBinaryOperatorType.Modulus:
- output.Write( " % " );
- break;
- case CodeBinaryOperatorType.Multiply:
- output.Write( " * " );
- break;
- case CodeBinaryOperatorType.Subtract:
- output.Write( " - " );
- break;
- case CodeBinaryOperatorType.ValueEquality:
- output.Write( " == " );
- break;
- }
-
- GenerateExpression( e.Right );
- }
-
- protected abstract void GenerateCastExpression (CodeCastExpression e);
- protected abstract void GenerateComment( CodeComment comment );
-
- protected virtual void GenerateCommentStatement( CodeCommentStatement statement )
- {
- GenerateComment( statement.Comment );
- }
-
- protected virtual void GenerateCommentStatements (CodeCommentStatementCollection statements)
- {
- foreach ( CodeCommentStatement comment in statements )
- GenerateCommentStatement( comment );
- }
-
- protected virtual void GenerateCompileUnit( CodeCompileUnit compileUnit )
- {
- GenerateCompileUnitStart( compileUnit );
-
- CodeAttributeDeclarationCollection attributes = compileUnit.AssemblyCustomAttributes;
- if ( attributes.Count != 0 ) {
- GenerateAttributeDeclarationsStart( attributes );
- output.Write( "assembly: " );
- OutputAttributeDeclarations( compileUnit.AssemblyCustomAttributes );
- GenerateAttributeDeclarationsEnd( attributes );
- }
-
- foreach ( CodeNamespace ns in compileUnit.Namespaces )
- GenerateNamespace( ns );
-
- GenerateCompileUnitEnd( compileUnit );
- }
-
- protected virtual void GenerateCompileUnitEnd( CodeCompileUnit compileUnit )
- {
- output.WriteLine( "<compileUnitEnd>" );
- }
-
- protected virtual void GenerateCompileUnitStart( CodeCompileUnit compileUnit )
- {
- output.WriteLine( "<compileUnitStart>" );
- }
-
- protected abstract void GenerateConditionStatement( CodeConditionStatement s );
- protected abstract void GenerateConstructor (CodeConstructor x, CodeTypeDeclaration d);
- protected abstract void GenerateDelegateCreateExpression( CodeDelegateCreateExpression e );
- protected abstract void GenerateDelegateInvokeExpression( CodeDelegateInvokeExpression e );
-
- protected virtual void GenerateDirectionExpression( CodeDirectionExpression e )
- {
- OutputDirection( e.Direction );
- output.Write( ' ' );
- GenerateExpression( e.Expression );
- }
-
- protected abstract void GenerateEntryPointMethod( CodeEntryPointMethod m, CodeTypeDeclaration d );
- protected abstract void GenerateEvent( CodeMemberEvent ev, CodeTypeDeclaration d );
- protected abstract void GenerateEventReferenceExpression( CodeEventReferenceExpression e );
-
- protected void GenerateExpression( CodeExpression e )
- {
- CodeArgumentReferenceExpression argref = e as CodeArgumentReferenceExpression;
- if ( argref != null ) {
- GenerateArgumentReferenceExpression( argref );
- return;
- }
- CodeArrayCreateExpression mkarray = e as CodeArrayCreateExpression;
- if ( mkarray != null ) {
- GenerateArrayCreateExpression( mkarray );
- return;
- }
- CodeArrayIndexerExpression arrayidx = e as CodeArrayIndexerExpression;
- if ( arrayidx != null ) {
- GenerateArrayIndexerExpression( arrayidx );
- return;
- }
- CodeBaseReferenceExpression baseref = e as CodeBaseReferenceExpression;
- if ( baseref != null ) {
- GenerateBaseReferenceExpression( baseref );
- return;
- }
- CodeBinaryOperatorExpression binary = e as CodeBinaryOperatorExpression;
- if ( binary != null ) {
- GenerateBinaryOperatorExpression( binary );
- return;
- }
- CodeCastExpression cast = e as CodeCastExpression;
- if ( cast != null ) {
- GenerateCastExpression( cast );
- return;
- }
- CodeDelegateCreateExpression mkdel = e as CodeDelegateCreateExpression;
- if ( mkdel != null ) {
- GenerateDelegateCreateExpression( mkdel );
- return;
- }
- CodeDelegateInvokeExpression delinvoke = e as CodeDelegateInvokeExpression;
- if ( delinvoke != null ) {
- GenerateDelegateInvokeExpression( delinvoke );
- return;
- }
- CodeDirectionExpression direction = e as CodeDirectionExpression;
- if ( direction != null ) {
- GenerateDirectionExpression( direction );
- return;
- }
- CodeEventReferenceExpression eventref = e as CodeEventReferenceExpression;
- if ( eventref != null ) {
- GenerateEventReferenceExpression( eventref );
- return;
- }
- CodeFieldReferenceExpression fieldref = e as CodeFieldReferenceExpression;
- if ( fieldref != null ) {
- GenerateFieldReferenceExpression( fieldref );
- return;
- }
- CodeIndexerExpression idx = e as CodeIndexerExpression;
- if ( idx != null ) {
- GenerateIndexerExpression( idx );
- return;
- }
- CodeMethodInvokeExpression methodinv = e as CodeMethodInvokeExpression;
- if ( methodinv != null ) {
- GenerateMethodInvokeExpression( methodinv );
- return;
- }
- CodeMethodReferenceExpression methodref = e as CodeMethodReferenceExpression;
- if ( methodref != null ) {
- GenerateMethodReferenceExpression( methodref );
- return;
- }
- CodeObjectCreateExpression objref = e as CodeObjectCreateExpression;
- if ( objref != null ) {
- GenerateObjectCreateExpression( objref );
- return;
- }
- CodeParameterDeclarationExpression param = e as CodeParameterDeclarationExpression;
- if ( param != null ) {
- GenerateParameterDeclarationExpression( param );
- return;
- }
- CodePrimitiveExpression primitive = e as CodePrimitiveExpression;
- if ( primitive != null ) {
- GeneratePrimitiveExpression( primitive );
- return;
- }
- CodePropertyReferenceExpression propref = e as CodePropertyReferenceExpression;
- if ( propref != null ) {
- GeneratePropertyReferenceExpression( propref );
- return;
- }
- CodePropertySetValueReferenceExpression propset = e as CodePropertySetValueReferenceExpression;
- if ( propset != null ) {
- GeneratePropertySetValueReferenceExpression( propset );
- return;
- }
- CodeSnippetExpression snippet = e as CodeSnippetExpression;
- if ( snippet != null ) {
- GenerateSnippetExpression( snippet );
- return;
- }
- CodeThisReferenceExpression thisref = e as CodeThisReferenceExpression;
- if ( thisref != null ) {
- GenerateThisReferenceExpression( thisref );
- return;
- }
- CodeTypeOfExpression typeOf = e as CodeTypeOfExpression;
- if ( typeOf != null ) {
- GenerateTypeOfExpression( typeOf );
- return;
- }
- CodeTypeReferenceExpression typeref = e as CodeTypeReferenceExpression;
- if ( typeref != null ) {
- GenerateTypeReferenceExpression( typeref );
- return;
- }
- CodeVariableReferenceExpression varref = e as CodeVariableReferenceExpression;
- if ( varref != null ) {
- GenerateVariableReferenceExpression( varref );
- return;
- }
- }
-
- protected abstract void GenerateExpressionStatement( CodeExpressionStatement statement );
- protected abstract void GenerateField (CodeMemberField f);
- protected abstract void GenerateFieldReferenceExpression (CodeFieldReferenceExpression e);
- protected abstract void GenerateGotoStatement( CodeGotoStatement statement );
- protected abstract void GenerateIndexerExpression (CodeIndexerExpression e);
- protected abstract void GenerateIterationStatement( CodeIterationStatement s );
- protected abstract void GenerateLabeledStatement( CodeLabeledStatement statement );
- protected abstract void GenerateLinePragmaStart (CodeLinePragma p);
- protected abstract void GenerateLinePragmaEnd (CodeLinePragma p);
- protected abstract void GenerateMethod (CodeMemberMethod m, CodeTypeDeclaration d);
- protected abstract void GenerateMethodInvokeExpression (CodeMethodInvokeExpression e);
- protected abstract void GenerateMethodReferenceExpression( CodeMethodReferenceExpression e );
- protected abstract void GenerateMethodReturnStatement (CodeMethodReturnStatement e);
-
- protected virtual void GenerateNamespace (CodeNamespace ns)
- {
- foreach ( CodeCommentStatement statement in ns.Comments )
- GenerateCommentStatement( statement );
-
- GenerateNamespaceStart( ns );
-
- foreach ( CodeNamespaceImport import in ns.Imports )
- GenerateNamespaceImport( import );
-
- output.WriteLine();
-
- foreach ( CodeTypeDeclaration type in ns.Types )
- GenerateCodeFromType( type, output, options );
-
- GenerateNamespaceEnd( ns );
- }
-
- protected abstract void GenerateNamespaceStart (CodeNamespace ns);
- protected abstract void GenerateNamespaceEnd (CodeNamespace ns);
- protected abstract void GenerateNamespaceImport (CodeNamespaceImport i);
- protected abstract void GenerateObjectCreateExpression (CodeObjectCreateExpression e);
-
- protected virtual void GenerateParameterDeclarationExpression (CodeParameterDeclarationExpression e)
- {
- OutputAttributeDeclarations( e.CustomAttributes );
- OutputDirection( e.Direction );
- OutputType( e.Type );
- output.Write( ' ' );
- output.Write( e.Name );
- }
-
- protected virtual void GeneratePrimitiveExpression (CodePrimitiveExpression e)
- {
- output.Write( e.Value );
- }
-
- protected abstract void GenerateProperty (CodeMemberProperty p, CodeTypeDeclaration d);
- protected abstract void GeneratePropertyReferenceExpression (CodePropertyReferenceExpression e);
- protected abstract void GeneratePropertySetValueReferenceExpression( CodePropertySetValueReferenceExpression e );
- protected abstract void GenerateRemoveEventStatement( CodeRemoveEventStatement statement );
- protected abstract void GenerateSnippetExpression( CodeSnippetExpression e );
- protected abstract void GenerateSnippetMember( CodeSnippetTypeMember m );
- protected virtual void GenerateSnippetStatement( CodeSnippetStatement s )
- {
- output.Write( s.Value );
- }
-
- protected void GenerateStatement( CodeStatement s )
- {
- CodeAssignStatement assign = s as CodeAssignStatement;
- if ( assign != null ) {
- GenerateAssignStatement( assign );
- return;
- }
- CodeAttachEventStatement attach = s as CodeAttachEventStatement;
- if ( attach != null ) {
- GenerateAttachEventStatement( attach );
- return;
- }
- CodeCommentStatement comment = s as CodeCommentStatement;
- if ( comment != null ) {
- GenerateCommentStatement( comment );
- return;
- }
- CodeConditionStatement condition = s as CodeConditionStatement;
- if ( condition != null ) {
- GenerateConditionStatement( condition );
- return;
- }
- CodeExpressionStatement expression = s as CodeExpressionStatement;
- if ( expression != null ) {
- GenerateExpressionStatement( expression );
- return;
- }
- CodeGotoStatement gotostmt = s as CodeGotoStatement;
- if ( gotostmt != null ) {
- GenerateGotoStatement( gotostmt );
- return;
- }
- CodeIterationStatement iteration = s as CodeIterationStatement;
- if ( iteration != null ) {
- GenerateIterationStatement( iteration );
- return;
- }
- CodeLabeledStatement label = s as CodeLabeledStatement;
- if ( label != null ) {
- GenerateLabeledStatement( label );
- return;
- }
- CodeMethodReturnStatement returnstmt = s as CodeMethodReturnStatement;
- if ( returnstmt != null ) {
- GenerateMethodReturnStatement( returnstmt );
- return;
- }
- CodeRemoveEventStatement remove = s as CodeRemoveEventStatement;
- if ( remove != null ) {
- GenerateRemoveEventStatement( remove );
- return;
- }
- CodeSnippetStatement snippet = s as CodeSnippetStatement;
- if ( snippet != null ) {
- GenerateSnippetStatement( snippet );
- return;
- }
- CodeThrowExceptionStatement exception = s as CodeThrowExceptionStatement;
- if ( exception != null ) {
- GenerateThrowExceptionStatement( exception );
- return;
- }
- CodeTryCatchFinallyStatement trycatch = s as CodeTryCatchFinallyStatement;
- if ( trycatch != null ) {
- GenerateTryCatchFinallyStatement( trycatch );
- return;
- }
- CodeVariableDeclarationStatement declaration = s as CodeVariableDeclarationStatement;
- if ( declaration != null ) {
- GenerateVariableDeclarationStatement( declaration );
- return;
- }
- }
-
- protected void GenerateStatements( CodeStatementCollection c )
- {
- foreach ( CodeStatement statement in c )
- GenerateStatement( statement );
- }
-
- protected abstract void GenerateThisReferenceExpression (CodeThisReferenceExpression e);
- protected abstract void GenerateThrowExceptionStatement (CodeThrowExceptionStatement s);
- protected abstract void GenerateTryCatchFinallyStatement (CodeTryCatchFinallyStatement s);
- protected abstract void GenerateTypeEnd( CodeTypeDeclaration declaration );
- protected abstract void GenerateTypeConstructor( CodeTypeConstructor constructor );
-
- protected virtual void GenerateTypeOfExpression (CodeTypeOfExpression e)
- {
- output.Write( "typeof(" );
- OutputType( e.Type );
- output.Write( ")" );
- }
-
- protected virtual void GenerateTypeReferenceExpression (CodeTypeReferenceExpression e)
- {
- OutputType( e.Type );
- }
-
- protected abstract void GenerateTypeStart( CodeTypeDeclaration declaration );
- protected abstract void GenerateVariableDeclarationStatement (CodeVariableDeclarationStatement e);
- protected abstract void GenerateVariableReferenceExpression( CodeVariableReferenceExpression e );
-
- //
- // Other members
- //
-
- /*
- * Output Methods
- */
- protected virtual void OutputAttributeArgument( CodeAttributeArgument argument )
- {
- string name = argument.Name;
- if ( name != null ) {
- output.Write( name );
- output.Write( '=' );
- }
- GenerateExpression( argument.Value );
- }
-
- private void OutputAttributeDeclaration( CodeAttributeDeclaration attribute )
- {
- output.Write( attribute.Name );
- output.Write( '(' );
- IEnumerator enumerator = attribute.Arguments.GetEnumerator();
- if ( enumerator.MoveNext() ) {
- CodeAttributeArgument argument = (CodeAttributeArgument)enumerator.Current;
- OutputAttributeArgument( argument );
-
- while ( enumerator.MoveNext() ) {
- output.Write( ',' );
- argument = (CodeAttributeArgument)enumerator.Current;
- OutputAttributeArgument( argument );
- }
- }
- output.Write( ')' );
- }
-
- protected virtual void OutputAttributeDeclarations( CodeAttributeDeclarationCollection attributes )
- {
- GenerateAttributeDeclarationsStart( attributes );
-
- IEnumerator enumerator = attributes.GetEnumerator();
- if ( enumerator.MoveNext() ) {
- CodeAttributeDeclaration attribute = (CodeAttributeDeclaration)enumerator.Current;
-
- OutputAttributeDeclaration( attribute );
-
- while ( enumerator.MoveNext() ) {
- attribute = (CodeAttributeDeclaration)enumerator.Current;
-
- output.WriteLine( ',' );
- OutputAttributeDeclaration( attribute );
- }
- }
-
- GenerateAttributeDeclarationsEnd( attributes );
- }
-
- protected virtual void OutputDirection( FieldDirection direction )
- {
- switch ( direction ) {
- case FieldDirection.In:
- output.Write( "in " );
- break;
- case FieldDirection.Out:
- output.Write( "out " );
- break;
- case FieldDirection.Ref:
- output.Write( "ref " );
- break;
- }
- }
-
- protected virtual void OutputExpressionList( CodeExpressionCollection expressions )
- {
- OutputExpressionList( expressions, false );
- }
-
- protected virtual void OutputExpressionList( CodeExpressionCollection expressions,
- bool newLineBetweenItems )
- {
- IEnumerator enumerator = expressions.GetEnumerator();
- if ( enumerator.MoveNext() ) {
- CodeExpression expression = (CodeExpression)enumerator.Current;
-
- GenerateExpression( expression );
-
- while ( enumerator.MoveNext() ) {
- expression = (CodeExpression)enumerator.Current;
-
- output.Write( ',' );
- if ( newLineBetweenItems )
- output.WriteLine();
- else
- output.Write( ' ' );
-
- GenerateExpression( expression );
- }
- }
- }
-
- protected virtual void OutputFieldScopeModifier( MemberAttributes attributes )
- {
- if ( (attributes & MemberAttributes.VTableMask) == MemberAttributes.New )
- output.Write( "new " );
-
- switch ( attributes & MemberAttributes.ScopeMask ) {
- case MemberAttributes.Static:
- output.Write( "static " );
- break;
- case MemberAttributes.Const:
- output.Write( "const " );
- break;
- }
- }
-
- protected virtual void OutputIdentifier( string ident )
- {
- }
-
- protected virtual void OutputMemberAccessModifier( MemberAttributes attributes )
- {
- switch ( attributes & MemberAttributes.AccessMask ) {
- case MemberAttributes.Assembly:
- output.Write( "internal " );
- break;
- case MemberAttributes.FamilyAndAssembly:
- output.Write( "/* FamAndAssem */ internal " );
- break;
- case MemberAttributes.Family:
- output.Write( "protected " );
- break;
- case MemberAttributes.FamilyOrAssembly:
- output.Write( "protected internal " );
- break;
- case MemberAttributes.Private:
- output.Write( "private " );
- break;
- case MemberAttributes.Public:
- output.Write( "public " );
- break;
- }
- }
-
- protected virtual void OutputMemberScopeModifier( MemberAttributes attributes )
- {
- if ( (attributes & MemberAttributes.VTableMask) == MemberAttributes.New )
- output.Write( "new " );
-
- switch ( attributes & MemberAttributes.ScopeMask ) {
- case MemberAttributes.Abstract:
- output.Write( "abstract " );
- break;
- case MemberAttributes.Final:
- output.Write( "sealed " );
- break;
- case MemberAttributes.Static:
- output.Write( "static " );
- break;
- case MemberAttributes.Override:
- output.Write( "override " );
- break;
- default:
- //
- // FUNNY! if the scope value is
- // rubbish (0 or >Const), and access
- // is public or protected, make it
- // "virtual".
- //
- // i'm not sure whether this is 100%
- // correct, but it seems to be MS
- // behavior.
- //
- MemberAttributes access = attributes & MemberAttributes.AccessMask;
- if ( access == MemberAttributes.Public ||
- access == MemberAttributes.Family )
- output.Write( "virtual " );
- break;
- }
- }
-
- protected virtual void OutputOperator( CodeBinaryOperatorType op )
- {
- }
-
- protected virtual void OutputParameters( CodeParameterDeclarationExpressionCollection parameters )
- {
- }
-
- protected abstract void OutputType( CodeTypeReference t );
-
- protected virtual void OutputTypeAttributes( TypeAttributes attributes,
- bool isStruct,
- bool isEnum )
- {
- switch ( attributes & TypeAttributes.VisibilityMask ) {
- case TypeAttributes.NotPublic:
- // private by default
- break;
-
- case TypeAttributes.Public:
- case TypeAttributes.NestedPublic:
- output.Write( "public " );
- break;
-
- case TypeAttributes.NestedPrivate:
- output.Write( "private " );
- break;
- }
-
- if ( isStruct )
-
- output.Write( "struct " );
-
- else if ( isEnum )
-
- output.Write( "enum " );
-
- else {
- if ( (attributes & TypeAttributes.Interface) != 0 )
-
- output.Write( "interface " );
-
- else {
-
- if ( (attributes & TypeAttributes.Sealed) != 0 )
- output.Write( "sealed " );
-
- if ( (attributes & TypeAttributes.Abstract) != 0 )
- output.Write( "abstract " );
-
- output.Write( "class " );
- }
- }
- }
-
- protected virtual void OutputTypeNamePair( CodeTypeReference type,
- string name )
- {
- OutputType( type );
- output.Write( ' ' );
- output.Write( name );
- }
-
- protected abstract string QuoteSnippetString( string value );
-
- /*
- * ICodeGenerator
- */
- protected abstract string CreateEscapedIdentifier( string value );
- string ICodeGenerator.CreateEscapedIdentifier( string value )
- {
- return CreateEscapedIdentifier( value );
- }
-
- protected abstract string CreateValidIdentifier( string value );
- string ICodeGenerator.CreateValidIdentifier( string value )
- {
- return CreateValidIdentifier( value );
- }
-
- private void InitOutput( TextWriter output, CodeGeneratorOptions options )
- {
- if ( options == null )
- options = new CodeGeneratorOptions();
-
- this.output = new IndentedTextWriter( output, options.IndentString );
- this.options = options;
- }
-
- public virtual void GenerateCodeFromCompileUnit( CodeCompileUnit compileUnit,
- TextWriter output,
- CodeGeneratorOptions options )
- {
- InitOutput( output, options );
- GenerateCompileUnit( compileUnit );
- }
-
- [MonoTODO]
- public virtual void GenerateCodeFromExpression( CodeExpression expression,
- TextWriter output,
- CodeGeneratorOptions options )
- {
- InitOutput( output, options );
- }
-
- public virtual void GenerateCodeFromNamespace( CodeNamespace ns,
- TextWriter output,
- CodeGeneratorOptions options )
- {
- InitOutput( output, options );
- GenerateNamespace( ns );
- }
-
- public virtual void GenerateCodeFromStatement( CodeStatement statement,
- TextWriter output,
- CodeGeneratorOptions options )
- {
- InitOutput( output, options );
- }
-
- public virtual void GenerateCodeFromType( CodeTypeDeclaration type,
- TextWriter output,
- CodeGeneratorOptions options )
- {
- CodeTypeDeclaration prevType = this.currentType;
- this.currentType = type;
-
- InitOutput( output, options );
-
- GenerateTypeStart( type );
-
- foreach ( CodeTypeMember member in type.Members ) {
-
- CodeTypeMember prevMember = this.currentMember;
- this.currentMember = member;
-
- if ( options.BlankLinesBetweenMembers )
- output.WriteLine();
-
- CodeMemberEvent eventm = member as CodeMemberEvent;
- if ( eventm != null ) {
- GenerateEvent( eventm, type );
- continue;
- }
- CodeMemberField field = member as CodeMemberField;
- if ( field != null ) {
- GenerateField( field );
- continue;
- }
- CodeMemberMethod method = member as CodeMemberMethod;
- if ( method != null ) {
- GenerateMethod( method, type );
- continue;
- }
- CodeMemberProperty property = member as CodeMemberProperty;
- if ( property != null ) {
- GenerateProperty( property, type );
- continue;
- }
- CodeSnippetTypeMember snippet = member as CodeSnippetTypeMember;
- if ( snippet != null ) {
- GenerateSnippetMember( snippet );
- continue;
- }
- CodeTypeDeclaration subtype = member as CodeTypeDeclaration;
- if ( subtype != null ) {
- GenerateCodeFromType( subtype, output, options );
- continue;
- }
-
- this.currentMember = prevMember;
- }
-
- GenerateTypeEnd( type );
- this.currentType = prevType;
- }
-
- protected abstract string GetTypeOutput( CodeTypeReference type );
-
- string ICodeGenerator.GetTypeOutput( CodeTypeReference type )
- {
- return GetTypeOutput( type );
- }
-
- protected abstract bool IsValidIdentifier( string value );
-
- bool ICodeGenerator.IsValidIdentifier( string value )
- {
- return IsValidIdentifier( value );
- }
-
- protected abstract bool Supports( GeneratorSupport supports );
-
- bool ICodeGenerator.Supports( GeneratorSupport value )
- {
- return Supports( value );
- }
-
- [MonoTODO]
- protected virtual void ValidateIdentifier( string value )
- {
- throw new NotImplementedException();
- }
-
- void ICodeGenerator.ValidateIdentifier( string value )
- {
- ValidateIdentifier( value );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs b/mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs
deleted file mode 100644
index b95b620f66e..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.CodeDom.Compiler CodeGeneratorOptions class
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.CodeDom.Compiler
-{
- public class CodeGeneratorOptions
- {
- private IDictionary properties;
-
- //
- // Constructors
- //
- public CodeGeneratorOptions()
- {
- properties = new ListDictionary();
- properties.Add( "BlankLinesBetweenMembers", true );
- properties.Add( "BracingStyle", "Block" );
- properties.Add( "ElseOnClosing", false );
- properties.Add( "IndentString", " " );
- }
-
- //
- // Properties
- //
-
- /// <summary>
- /// Whether to insert blank lines between individual members.
- /// Default is true.
- /// </summary>
- public bool BlankLinesBetweenMembers {
- get {
- return (bool)properties["BlankLinesBetweenMembers"];
- }
- set {
- properties["BlankLinesBetweenMembers"] = value;
- }
- }
-
- /// <summary>
- /// "Block" puts braces on the same line as the associated statement or declaration.
- /// "C" puts braces on the following line.
- /// Default is "C"
- /// </summary>
- public string BracingStyle {
- get {
- return (string)properties["BracingStyle"];
- }
- set {
- properties["BracingStyle"] = value;
- }
- }
-
- /// <summary>
- /// Whether to start <code>else</code>,
- /// <code>catch</code>, or <code>finally</code>
- /// blocks on the same line as the previous block.
- /// Default is false.
- /// </summary>
- public bool ElseOnClosing {
- get {
- return (bool)properties["ElseOnClosing"];
- }
- set {
- properties["ElseOnClosing"] = value;
- }
- }
-
- /// <summary>
- /// The string used for individual indentation levels. Default is four spaces.
- /// </summary>
- public string IndentString {
- get {
- return (string)properties["IndentString"];
- }
- set {
- properties["IndentString"] = value;
- }
- }
-
- public Object this[string index] {
- get {
- return properties[index];
- }
- set {
- properties[index] = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerErrorCollection.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerErrorCollection.cs
deleted file mode 100644
index d12f0ed49b8..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CompilerErrorCollection.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.CodeDom.Compiler CompilerErrorCollection Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- public class CompilerErrorCollection
- {
- // FIXME
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerOptions.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerOptions.cs
deleted file mode 100644
index cd25110d763..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CompilerOptions.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.CodeDom.Compiler CompilerOptions Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- public class CompilerOptions
- {
- // FIXME
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerParameters.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerParameters.cs
deleted file mode 100644
index 5b41a9cc58d..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CompilerParameters.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// System.CodeDom.Compiler CompilerParameters Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Collections.Specialized;
-
-namespace System.CodeDom.Compiler
-{
- public class CompilerParameters
- {
- private CompilerOptions compilerOptions;
- private bool generateExecutables;
- private bool generateInMemory;
- private bool includeDebugInformation;
- private string mainClass;
- private string outputAssembly;
- private StringCollection referencedAssemblies;
- private TempFileCollection tempFiles;
- private bool treatWarningsAsErrors;
- private IntPtr userToken;
- private int warningLevel;
- private string win32Resources;
-
- //
- // Constructors
- //
- public CompilerParameters()
- {
- }
-
- public CompilerParameters( string[] assemblyNames )
- {
- }
-
- public CompilerParameters( string[] assemblyNames, string output )
- {
- }
-
- public CompilerParameters( string[] assemblyNames, string output, bool includeDebugInfo )
- {
- }
-
-
- //
- // Properties
- //
- public CompilerOptions CompilerOptions {
- get {
- return compilerOptions;
- }
- set {
- compilerOptions = value;
- }
- }
-
- public bool GenerateExecutables {
- get {
- return generateExecutables;
- }
- set {
- generateExecutables = value;
- }
- }
-
- public bool GenerateInMemory {
- get {
- return generateInMemory;
- }
- set {
- generateInMemory = value;
- }
- }
-
- public bool IncludeDebugInformation {
- get {
- return includeDebugInformation;
- }
- set {
- includeDebugInformation = value;
- }
- }
-
- public string MainClass {
- get {
- return mainClass;
- }
- set {
- mainClass = value;
- }
- }
-
- public string OutputAssembly {
- get {
- return outputAssembly;
- }
- set {
- outputAssembly = value;
- }
- }
-
- public StringCollection ReferencedAssemblies {
- get {
- return referencedAssemblies;
- }
- set {
- referencedAssemblies = value;
- }
- }
-
- public TempFileCollection TempFiles {
- get {
- return tempFiles;
- }
- set {
- tempFiles = value;
- }
- }
-
- public bool TreatWarningsAsErrors {
- get {
- return treatWarningsAsErrors;
- }
- set {
- treatWarningsAsErrors = value;
- }
- }
-
- public IntPtr UserToken {
- get {
- return userToken;
- }
- set {
- userToken = value;
- }
- }
-
- public int WarningLevel {
- get {
- return warningLevel;
- }
- set {
- warningLevel = value;
- }
- }
-
- public string Win32Resources {
- get {
- return win32Resources;
- }
- set {
- win32Resources = value;
- }
- }
- }
-};
diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerResults.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerResults.cs
deleted file mode 100644
index ee1719cd053..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/CompilerResults.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.CodeDom.Compiler CompilerResults Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- using System.Reflection;
- using System.Collections.Specialized;
-
- public class CompilerResults
- {
- private Assembly compiledAssembly;
- private CompilerErrorCollection errors;
- private int nativeCompilerReturnValue;
- private StringCollection output;
- private string pathToAssembly;
- private TempFileCollection tempFiles;
-
- //
- // Constructors
- //
- public CompilerResults( TempFileCollection tempFiles )
- {
- this.tempFiles = tempFiles;
- }
-
- //
- // Properties
- //
- public Assembly CompiledAssembly {
- get {
- return compiledAssembly;
- }
- set {
- compiledAssembly = value;
- }
- }
-
- public CompilerErrorCollection Errors {
- get {
- if ( errors == null )
- errors = new CompilerErrorCollection();
- return errors;
- }
- }
-
- public int NativeCompilerReturnValue {
- get {
- return nativeCompilerReturnValue;
- }
- set {
- nativeCompilerReturnValue = value;
- }
- }
-
- public StringCollection Output {
- get {
- if ( output == null )
- output = new StringCollection();
- return output;
- }
- }
-
- public string PathToAssembly {
- get {
- return pathToAssembly;
- }
- set {
- pathToAssembly = value;
- }
- }
-
- public TempFileCollection TempFiles {
- get {
- return tempFiles;
- }
- set {
- tempFiles = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs b/mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs
deleted file mode 100644
index 7e83ba1bf62..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.CodeDom.Compiler GeneratorSupport Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- [Flags]
- [Serializable]
- public enum GeneratorSupport {
- ArraysOfArrays,
- EntryPointMethod,
- GotoStatements,
- MultidimensionalArrays,
- StaticConstructors,
- TryCatchStatements,
- ReturnTypeAttributes,
- DeclareValueTypes,
- DeclareEnums,
- DeclareDelegates,
- DeclareInterfaces,
- DeclareEvents,
- AssemblyAttributes,
- ParameterAttributes,
- ReferenceParameters,
- ChainedConstructorArguments,
- NestedTypes,
- MultipleInterfaceMembers,
- PublicStaticMembers,
- ComplexExpressions,
- Win32Resources
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom.Compiler/ICodeCompiler.cs b/mcs/class/System/System.CodeDom.Compiler/ICodeCompiler.cs
deleted file mode 100644
index 2a6484b0928..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/ICodeCompiler.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.CodeDom.Compiler ICodeCompiler Interface
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- public interface ICodeCompiler
- {
- CompilerResults CompileAssemblyFromDom( CompilerParameters options,
- CodeCompileUnit compilationUnit );
-
- CompilerResults CompileAssemblyFromDomBatch( CompilerParameters options,
- CodeCompileUnit[] batch );
-
- CompilerResults CompileAssemblyFromFile( CompilerParameters options,
- string fileName );
-
- CompilerResults CompileAssemblyFromFileBatch( CompilerParameters options,
- string[] batch );
-
- CompilerResults CompileAssemblyFromSource( CompilerParameters options,
- string source );
-
- CompilerResults CompileAssemblyFromSourceBatch( CompilerParameters options,
- string[] batch );
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs b/mcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs
deleted file mode 100755
index a853048d20d..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/ICodeGenerator.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.CodeDom.Compiler ICodeGenerator Interface
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- using System.CodeDom;
- using System.IO;
-
- public interface ICodeGenerator
- {
- //
- // Methods
- //
- string CreateEscapedIdentifier( string value );
-
- string CreateValidIdentifier( string value );
-
- void GenerateCodeFromCompileUnit( CodeCompileUnit compileUnit,
- TextWriter output,
- CodeGeneratorOptions options );
-
- void GenerateCodeFromExpression( CodeExpression expression,
- TextWriter output,
- CodeGeneratorOptions options );
-
- void GenerateCodeFromNamespace( CodeNamespace ns,
- TextWriter output,
- CodeGeneratorOptions options );
-
- void GenerateCodeFromStatement( CodeStatement statement,
- TextWriter output,
- CodeGeneratorOptions options );
-
- void GenerateCodeFromType( CodeTypeDeclaration typeDeclaration,
- TextWriter output,
- CodeGeneratorOptions options );
-
- string GetTypeOutput( CodeTypeReference type );
-
- bool IsValidIdentifier( string value );
-
- bool Supports( GeneratorSupport supports );
-
- void ValidateIdentifier( string value );
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/ICodeParser.cs b/mcs/class/System/System.CodeDom.Compiler/ICodeParser.cs
deleted file mode 100644
index 2a2522f5ab2..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/ICodeParser.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.CodeDom.Compiler ICodeParser Interface
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- using System.CodeDom;
- using System.IO;
-
- public interface ICodeParser
- {
- CodeCompileUnit Parse( TextReader codeStream );
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/IndentedTextWriter.cs b/mcs/class/System/System.CodeDom.Compiler/IndentedTextWriter.cs
deleted file mode 100644
index 6538fc6e24d..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/IndentedTextWriter.cs
+++ /dev/null
@@ -1,286 +0,0 @@
-//
-// System.CodeDom.Compiler IndentedTextWriter class
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.IO;
-using System.Text;
-
-namespace System.CodeDom.Compiler {
-
- public class IndentedTextWriter
- : TextWriter
- {
- private TextWriter writer;
- private string tabString;
- private int indent;
- private bool newline;
-
- //
- // Constructors
- //
- public IndentedTextWriter( TextWriter writer )
- {
- this.writer = writer;
- this.tabString = DefaultTabString;
- newline = true;
- }
-
- public IndentedTextWriter( TextWriter writer, string tabString )
- {
- this.writer = writer;
- this.tabString = tabString;
- newline = true;
- }
-
-
- //
- // Fields
- //
- public const string DefaultTabString = " ";
-
- //
- // Properties
- //
- public override Encoding Encoding {
- get {
- return writer.Encoding;
- }
- }
-
- public int Indent {
- get {
- return indent;
- }
- set {
- indent = value;
- }
- }
-
- public TextWriter InnerWriter {
- get {
- return writer;
- }
- }
-
- public override string NewLine {
- get {
- return writer.NewLine;
- }
- set {
- writer.NewLine = value;
- }
- }
-
- //
- // Methods
- //
- public override void Close()
- {
- writer.Close();
- }
-
- public override void Flush()
- {
- writer.Flush();
- }
-
- public override void Write( bool value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( char value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( char[] value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( double value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( int value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( long value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( object value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( float value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( string value )
- {
- OutputTabs();
- writer.Write( value );
- }
-
- public override void Write( string format, object arg )
- {
- OutputTabs();
- writer.Write( format, arg );
- }
-
- public override void Write( string format, params object[] args )
- {
- OutputTabs();
- writer.Write( format, args );
- }
-
- public override void Write( char[] buffer, int index, int count )
- {
- OutputTabs();
- writer.Write( buffer, index, count );
- }
-
- public override void Write( string format, object arg0, object arg1 )
- {
- OutputTabs();
- writer.Write( format, arg0, arg1 );
- }
-
-
- public override void WriteLine()
- {
- OutputTabs();
- writer.WriteLine();
- newline = true;
- }
-
- public override void WriteLine( char value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( char[] value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( double value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( int value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( long value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( object value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( float value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( string value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( uint value )
- {
- OutputTabs();
- writer.WriteLine( value );
- newline = true;
- }
-
- public override void WriteLine( string format, object arg )
- {
- OutputTabs();
- writer.WriteLine( format, arg );
- newline = true;
- }
-
- public override void WriteLine( string format, params object[] args )
- {
- OutputTabs();
- writer.WriteLine( format, args );
- newline = true;
- }
-
- public override void WriteLine( char[] buffer, int index, int count )
- {
- OutputTabs();
- writer.WriteLine( buffer, index, count );
- newline = true;
- }
-
- public override void WriteLine( string format, object arg0, object arg1 )
- {
- OutputTabs();
- writer.WriteLine( format, arg0, arg1 );
- newline = true;
- }
-
-
- public void WriteLineNoTabs( string value )
- {
- writer.WriteLine( value );
- newline = true;
- }
-
-
- protected virtual void OutputTabs()
- {
- if ( newline ) {
- for ( int i = 0; i < indent; ++i )
- writer.Write( tabString );
- newline = false;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/LanguageOptions.cs b/mcs/class/System/System.CodeDom.Compiler/LanguageOptions.cs
deleted file mode 100644
index 7862a656554..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/LanguageOptions.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.CodeDom.Compiler LanguageOptions Enum implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- [Flags]
- [Serializable]
- public enum LanguageOptions {
- None = 0,
- CaseInsensitive = 1
- }
-}
diff --git a/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs b/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs
deleted file mode 100644
index 6f82830bf90..00000000000
--- a/mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.CodeDom.Compiler TempFileCollection Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-namespace System.CodeDom.Compiler
-{
- public class TempFileCollection
- {
- // FIXME
- }
-}
diff --git a/mcs/class/System/System.CodeDom/ChangeLog b/mcs/class/System/System.CodeDom/ChangeLog
deleted file mode 100644
index 2352f22b91f..00000000000
--- a/mcs/class/System/System.CodeDom/ChangeLog
+++ /dev/null
@@ -1,229 +0,0 @@
-2002-05-28 Daniel Stodden <stodden@in.tum.de>
-
- * CodeArrayCreateExpression.cs: typo + comments
-
- * CodeAttributeArgumentCollection.cs: Add() signature fixed
-
- * CodeAttributeDeclarationCollection.cs: Add() signature fixed
-
- * CodeCatchClause.cs: ctor signature fixed
-
- * CodeCatchClauseCollection.cs: Add() signature fixed
-
- * CodeCommentStatementCollection.cs: Add() signature fixed
-
- * CodeConstructor.cs: ctor added
-
- * CodeExpressionCollection.cs: Populate* events: nullref checks
- added
-
- * CodeNamespace.cs: Populate* events: nullref checks added
-
- * CodeNamespaceCollection.cs: Add() signature fixed
-
- * CodeParameterDeclarationExpressionCollection.cs: Add() signature
- fixed
-
- * CodeStatementCollection.cs: Add() signature fixed, missing
- overload added
-
- * CodeTypeConstructor.cs: class name typo :P
-
- * CodeTypeDeclaration.cs: finally figured out how TypeAttributes
- work.
-
- * CodeTypeDeclarationCollection.cs: Add() signature fixed
-
- * CodeTypeReference.cs: added MonoTODOs. some corrections on array
- type behavior.
-
- * CodeTypeReferenceCollection.cs: Add() signature fixed
-
- * MemberAttributes.cs: just comments
-
-2002-05-11 Daniel Stodden <stodden@in.tum.de>
-
- * CodeAttributeArgumentCollection.cs: inherits CollectionBase
-
- * CodeAttributeDeclarationCollection.cs: inherits CollectionBase
-
- * CodeCatchClauseCollection.cs: inherits CollectionBase
-
- * CodeExpressionCollection.cs: inherits CollectionBase
-
- * CodeNamespaceImportCollection.cs: not CollectionBase, but
- matching MS docs
-
- * CodeParameterDeclarationCollection.cs: inherits CollectionBase
-
- * CodeStatementCollection.cs: inherits CollectionBase
-
- * CodeArrayCreateExpression.cs: corrections, completions, whatever
-
- * CodeAssignStatement.cs: corrections, completions, whatever
-
- * CodeAttachEventStatement.cs: corrections, completions, whatever
-
- * CodeAttributeArgument.cs: corrections, completions, whatever
-
- * CodeAttributeDeclaration.cs: corrections, completions, whatever
-
- * CodeBaseReferenceExpression.cs: corrections, completions,
- whatever
-
- * CodeBinaryOperatorExpression.cs: corrections, completions,
- whatever
-
- * CodeCastExpression.cs: corrections, completions, whatever
-
- * CodeCatchClause.cs: corrections, completions, whatever
-
- * CodeCommentStatement.cs: corrections, completions, whatever
-
- * CodeConstructor.cs: corrections, completions, whatever
-
- * CodeDelegateCreateExpression.cs: corrections, completions,
- whatever
-
- * CodeDelegateInvokeExpression.cs: corrections, completions,
- whatever
-
- * CodeExpression.cs: corrections, completions, whatever
-
- * CodeFieldReferenceExpression.cs: corrections, completions,
- whatever
-
- * CodeIndexerExpression.cs: corrections, completions, whatever
-
- * CodeLinePragma.cs: corrections, completions, whatever
-
- * CodeMemberEvent.cs: corrections, completions, whatever
-
- * CodeMemberField.cs: corrections, completions, whatever
-
- * CodeMemberMethod.cs: corrections, completions, whatever
-
- * CodeMemberProperty.cs: corrections, completions, whatever
-
- * CodeMethodInvokeExpression.cs: corrections, completions,
- whatever
-
- * CodeMethodReturnStatement.cs: corrections, completions, whatever
-
- * CodeNamespace.cs: corrections, completions, whatever
-
- * CodeNamespaceImport.cs: corrections, completions, whatever
-
- * CodeObject.cs: corrections, completions, whatever
-
- * CodeObjectCreateExpression.cs: corrections, completions,
- whatever
-
- * CodeParameterDeclarationExpression.cs: corrections, completions,
- whatever
-
- * CodePrimitiveExpression.cs: corrections, completions, whatever
-
- * CodePropertyReferenceExpression.cs: corrections, completions,
- whatever
-
- * CodeStatement.cs: corrections, completions, whatever
-
- * CodeThisReferenceExpression.cs: corrections, completions,
- whatever
-
- * CodeThrowExceptionStatement.cs: corrections, completions,
- whatever
-
- * CodeTryCatchFinallyStatement.cs: corrections, completions,
- whatever
-
- * CodeTypeDeclaration.cs: corrections, completions, whatever
-
- * CodeTypeMember.cs: corrections, completions, whatever
-
- * CodeTypeOfExpression.cs: corrections, completions, whatever
-
- * CodeTypeReferenceExpression.cs: corrections, completions,
- whatever
-
- * CodeVariableDeclarationStatement.cs: corrections, completions,
- whatever
-
- * FieldDirection.cs: corrections, completions, whatever
-
- * CodeArgumentReferenceExpression.cs: added
-
- * CodeArrayIndexerExpression.cs: added
-
- * CodeComment.cs: added
-
- * CodeCommentStatementCollection.cs: added
-
- * CodeCompileUnit.cs: added
-
- * CodeConditionStatement.cs: added
-
- * CodeDirectionExpression.cs: added
-
- * CodeEntryPointMethod.cs: added
-
- * CodeEventReferenceExpression.cs: added
-
- * CodeExpressionStatement.cs: added
-
- * CodeGotoStatement.cs: added
-
- * CodeIterationStatement.cs: added
-
- * CodeLabeledStatement.cs: added
-
- * CodeMethodReferenceExpression.cs: added
-
- * CodeNamespaceCollection.cs: added
-
- * CodePropertySetValueReferenceExpression.cs: added
-
- * CodeRemoveEventStatement.cs: added
-
- * CodeSnippetCompileUnit.cs: added
-
- * CodeSnippetExpression.cs: added
-
- * CodeSnippetStatement.cs: added
-
- * CodeSnippetTypeMember.cs: added
-
- * CodeTypeConstructor.cs: added
-
- * CodeTypeDeclarationCollection.cs: added
-
- * CodeTypeDelegate.cs: added
-
- * CodeTypeMemberCollection.cs: added
-
- * CodeTypeReference.cs: added
-
- * CodeTypeReferenceCollection.cs: added
-
- * CodeVariableReferenceExpression.cs: added
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * MemberAttributes.cs: Added so rest of classes would compile.
-
- * FieldDirection.cs: Added so rest of classes would compile.
-
- * CodeTypeMember.cs: Added so rest of classes would compile.
-
- * CodeTypeDeclaration.cs: Added so rest of classes would compile.
-
- * CodeObject.cs: Added so rest of classes would compile.
-
- * CodeBinaryOperatorType.cs: Added so rest of classes would compile.
-
-2001-07-12 Sean MacIsaac <macisaac@ximian.com>
-
- * All files implementing IList: Added IsFixedSize property.
-
- * All files: Changed CodeDOM to CodeDom.
diff --git a/mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs
deleted file mode 100644
index 5f842f3f302..00000000000
--- a/mcs/class/System/System.CodeDom/CodeArgumentReferenceExpression.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeArgumentReferenceExpression Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeArgumentReferenceExpression
- : CodeExpression
- {
- private string parameterName;
-
- //
- // Constructors
- //
- public CodeArgumentReferenceExpression()
- {
- }
-
- public CodeArgumentReferenceExpression( string name )
- {
- this.parameterName = name;
- }
-
- //
- // Properties
- //
- public string ParameterName {
- get {
- return parameterName;
- }
- set {
- parameterName = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs
deleted file mode 100755
index e7bded6024d..00000000000
--- a/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-//
-// System.CodeDom CodeArrayCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeArrayCreateExpression
- : CodeExpression
- {
- private CodeTypeReference createType;
- private CodeExpressionCollection initializers;
- private CodeExpression sizeExpression;
- private int size;
-
- //
- // Constructors
- //
- public CodeArrayCreateExpression ()
- {
- }
-
-
- public CodeArrayCreateExpression (CodeTypeReference createType,
- CodeExpression size )
- {
- this.createType = createType;
- this.sizeExpression = size;
- }
-
- public CodeArrayCreateExpression (CodeTypeReference createType,
- params CodeExpression[] initializers )
- {
- this.createType = createType;
- this.Initializers.AddRange( initializers );
- }
-
- public CodeArrayCreateExpression (CodeTypeReference createType,
- int size)
- {
- this.createType = createType;
- this.size = size;
- }
-
-
- public CodeArrayCreateExpression (string createType,
- CodeExpression size)
- {
- this.createType = new CodeTypeReference( createType );
- this.sizeExpression = size;
- }
-
- public CodeArrayCreateExpression (string createType,
- params CodeExpression[] initializers)
- {
- this.createType = new CodeTypeReference( createType );
- this.Initializers.AddRange( initializers );
- }
-
- public CodeArrayCreateExpression (string createType,
- int size)
- {
- this.createType = new CodeTypeReference( createType );
- this.size = size;
- }
-
-
- public CodeArrayCreateExpression (Type createType,
- CodeExpression size)
- {
- this.createType = new CodeTypeReference( createType );
- this.sizeExpression = size;
- }
-
- public CodeArrayCreateExpression (Type createType,
- params CodeExpression[] initializers)
- {
- this.createType = new CodeTypeReference( createType );
- this.Initializers.AddRange( initializers );
- }
-
- public CodeArrayCreateExpression (Type createType,
- int size)
- {
- this.createType = new CodeTypeReference( createType );
- this.size = size;
- }
-
- //
- // Properties
- //
- public CodeTypeReference CreateType {
- get {
- return createType;
- }
- set {
- createType = value;
- }
- }
-
- public CodeExpressionCollection Initializers {
- get {
- if ( initializers == null )
- initializers = new CodeExpressionCollection();
-
- return initializers;
- }
- }
-
- public CodeExpression SizeExpression {
- get {
- return sizeExpression;
- }
- set {
- sizeExpression = value;
- }
- }
-
- public int Size {
- get {
- return size;
- }
- set {
- size = value;
- // NOTE: Setting Size in ms.Net does
- // not supersede SizeExpression
- // values. Instead, the CodeGenerator
- // seems to always prefer
- // SizeExpression if set to a value !=
- // null.
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs b/mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs
deleted file mode 100644
index 8851f3cf016..00000000000
--- a/mcs/class/System/System.CodeDom/CodeArrayIndexerExpression.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.CodeDom CodeArrayIndexerExpression Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeArrayIndexerExpression
- : CodeExpression
- {
- private CodeExpressionCollection indices;
- private CodeExpression targetObject;
-
- //
- // Constructors
- //
- public CodeArrayIndexerExpression()
- {
- }
-
- public CodeArrayIndexerExpression( CodeExpression targetObject, params CodeExpression[] indices )
- {
- this.targetObject = targetObject;
- this.Indices.AddRange( indices );
- }
-
- //
- // Properties
- //
- public CodeExpressionCollection Indices {
- get {
- if ( indices == null )
- indices = new CodeExpressionCollection();
- return indices;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAssignStatement.cs b/mcs/class/System/System.CodeDom/CodeAssignStatement.cs
deleted file mode 100755
index 54f55af8d7e..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAssignStatement.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.CodeDom CodeArrayCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeAssignStatement
- : CodeStatement
- {
- CodeExpression left, right;
-
- //
- // Constructors
- //
- public CodeAssignStatement ()
- {
- }
-
- public CodeAssignStatement (CodeExpression left, CodeExpression right)
- {
- this.left = left;
- this.right = right;
- }
-
- //
- // Properties
- //
- public CodeExpression Left {
- get {
- return left;
- }
- set {
- left = value;
- }
- }
-
- public CodeExpression Right {
- get {
- return right;
- }
- set {
- right = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs b/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs
deleted file mode 100755
index 093445711ab..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.CodeDom CodeAttachEventStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeAttachEventStatement
- : CodeStatement
- {
- private CodeEventReferenceExpression eventRef;
- private CodeExpression listener;
-
- //
- // Constructors
- //
- public CodeAttachEventStatement ()
- {
- }
-
- public CodeAttachEventStatement (CodeEventReferenceExpression eventRef,
- CodeExpression listener)
- {
- this.eventRef = eventRef;
- this.listener = listener;
- }
-
- public CodeAttachEventStatement (CodeExpression targetObject,
- string eventName,
- CodeExpression listener)
- {
- this.eventRef = new CodeEventReferenceExpression( targetObject,
- eventName );
- this.listener = listener;
- }
-
- //
- // Properties
- //
- public CodeEventReferenceExpression Event {
- get {
- return eventRef;
- }
- set {
- eventRef = value;
- }
- }
-
- public CodeExpression Listener {
- get {
- return listener;
- }
- set {
- listener = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs
deleted file mode 100755
index c7b6d577776..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.CodeDom CodeAttributeArgument Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeAttributeArgument
- {
- private string name;
- private CodeExpression value;
-
- //
- // Constructors
- //
- public CodeAttributeArgument ()
- {
- }
-
- public CodeAttributeArgument (CodeExpression value)
- {
- this.value = value;
- }
-
- public CodeAttributeArgument (string name, CodeExpression value)
- {
- this.name = name;
- this.value = value;
- }
-
- //
- // Properties
- //
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
-
- public CodeExpression Value {
- get {
- return this.value;
- }
- set {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs
deleted file mode 100755
index cca43373ae7..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.CodeDom CodeAttributeArgumentCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeAttributeArgumentCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeAttributeArgumentCollection()
- {
- }
-
- public CodeAttributeArgumentCollection( CodeAttributeArgument[] value )
- {
- AddRange( value );
- }
-
- public CodeAttributeArgumentCollection( CodeAttributeArgumentCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeAttributeArgument this[int index]
- {
- get {
- return (CodeAttributeArgument)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeAttributeArgument value)
- {
- return List.Add( value );
- }
-
- public void AddRange (CodeAttributeArgument [] value )
- {
- foreach ( CodeAttributeArgument elem in value )
- Add( elem );
- }
-
- public void AddRange (CodeAttributeArgumentCollection value)
- {
- foreach ( CodeAttributeArgument elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeAttributeArgument value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeAttributeArgument[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeAttributeArgument value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeAttributeArgument value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeAttributeArgument value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs
deleted file mode 100755
index 49d0c8d7ca3..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.CodeDom CodeAttributeDeclaration Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeAttributeDeclaration
- {
- private string name;
- private CodeAttributeArgumentCollection arguments;
-
- //
- // Constructors
- //
- public CodeAttributeDeclaration ()
- {
- }
-
- public CodeAttributeDeclaration (string name)
- {
- this.name = name;
- }
-
- public CodeAttributeDeclaration (string name, CodeAttributeArgument [] arguments)
- {
- this.name = name;
- Arguments.AddRange (arguments);
- }
-
- //
- // Properties
- //
- public CodeAttributeArgumentCollection Arguments {
- get {
- if ( arguments == null )
- arguments = new CodeAttributeArgumentCollection();
-
- return arguments;
- }
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs
deleted file mode 100755
index 913641e6ebc..00000000000
--- a/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.CodeDom CodeAttributeDeclarationCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeAttributeDeclarationCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeAttributeDeclarationCollection()
- {
- }
-
- public CodeAttributeDeclarationCollection( CodeAttributeDeclaration[] value )
- {
- AddRange( value );
- }
-
- public CodeAttributeDeclarationCollection( CodeAttributeDeclarationCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeAttributeDeclaration this[int index]
- {
- get {
- return (CodeAttributeDeclaration)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeAttributeDeclaration value)
- {
- return List.Add (value);
- }
-
- public void AddRange (CodeAttributeDeclaration [] value)
- {
- foreach (CodeAttributeDeclaration elem in value)
- Add( elem );
- }
-
- public void AddRange (CodeAttributeDeclarationCollection value)
- {
- foreach (CodeAttributeDeclaration elem in value)
- Add( elem );
- }
-
- public bool Contains( CodeAttributeDeclaration value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeAttributeDeclaration[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeAttributeDeclaration value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeAttributeDeclaration value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeAttributeDeclaration value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs
deleted file mode 100755
index 3e4cbee16c8..00000000000
--- a/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.CodeDom CodeBaseReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeBaseReferenceExpression
- : CodeExpression
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs b/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs
deleted file mode 100755
index b272e0e5c80..00000000000
--- a/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.CodeDom CodeBinaryOperatorExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeBinaryOperatorExpression
- : CodeExpression
- {
- private CodeExpression left, right;
- private CodeBinaryOperatorType op;
-
- //
- // Constructors
- //
- public CodeBinaryOperatorExpression ()
- {
- }
-
- public CodeBinaryOperatorExpression (CodeExpression left,
- CodeBinaryOperatorType op,
- CodeExpression right)
- {
- this.left = left;
- this.op = op;
- this.right = right;
- }
-
- //
- // Properties
- //
- public CodeExpression Left {
- get {
- return left;
- }
- set {
- left = value;
- }
- }
-
- public CodeBinaryOperatorType Operator {
- get {
- return op;
- }
- set {
- op = value;
- }
- }
-
- public CodeExpression Right {
- get {
- return right;
- }
- set {
- right = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs b/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs
deleted file mode 100755
index e879b206400..00000000000
--- a/mcs/class/System/System.CodeDom/CodeBinaryOperatorType.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.CodeDom CodeBinaryOperatorType Enum implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ComVisible(true)]
- public enum CodeBinaryOperatorType {
- Add,
- Assign,
- BitwiseAnd,
- BitwiseOr,
- BooleanAnd,
- BooleanOr,
- Divide,
- GreaterThan,
- GreaterThanOrEqual,
- IdentityEquality,
- IdentityInequality,
- LessThan,
- LessThanOrEqual,
- Modulus,
- Multiply,
- Subtract,
- ValueEquality
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCastExpression.cs b/mcs/class/System/System.CodeDom/CodeCastExpression.cs
deleted file mode 100755
index 90ee10aa2f0..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCastExpression.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// System.CodeDom CodeCastExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeCastExpression
- : CodeExpression
- {
- private CodeTypeReference targetType;
- private CodeExpression expression;
-
- //
- // Constructors
- //
- public CodeCastExpression ()
- {
- }
-
- public CodeCastExpression (CodeTypeReference targetType, CodeExpression expression)
- {
- this.targetType = targetType;
- this.expression = expression;
- }
-
- public CodeCastExpression (string targetType, CodeExpression expression)
- {
- this.targetType = new CodeTypeReference( targetType );
- this.expression = expression;
- }
-
- public CodeCastExpression (Type targetType, CodeExpression expression)
- {
- this.targetType = new CodeTypeReference( targetType );
- this.expression = expression;
- }
-
- //
- // Properties
- //
- public CodeExpression Expression {
- get {
- return expression;
- }
-
- set {
- expression = value;
- }
- }
-
- public CodeTypeReference TargetType {
- get {
- return targetType;
- }
- set {
- targetType = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCatchClause.cs b/mcs/class/System/System.CodeDom/CodeCatchClause.cs
deleted file mode 100755
index 2d5addf592e..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCatchClause.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// System.CodeDom CodeCatchClaus Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeCatchClause
- {
- private CodeTypeReference catchExceptionType;
- private string localName;
- private CodeStatementCollection statements;
-
- //
- // Constructors
- //
- public CodeCatchClause ()
- {
- }
-
- public CodeCatchClause ( string localName )
- {
- this.localName = localName;
- }
-
- public CodeCatchClause ( string localName,
- CodeTypeReference catchExceptionType )
- {
- this.localName = localName;
- this.catchExceptionType = catchExceptionType;
- }
-
- public CodeCatchClause ( string localName,
- CodeTypeReference catchExceptionType,
- params CodeStatement[] statements )
- {
- this.localName = localName;
- this.catchExceptionType = catchExceptionType;
- this.Statements.AddRange( statements );
- }
-
- //
- // Properties
- //
- public CodeTypeReference CatchExceptionType {
- get {
- return catchExceptionType;
- }
- set {
- catchExceptionType = value;
- }
- }
-
- public string LocalName {
- get {
- return localName;
- }
- set {
- localName = value;
- }
- }
-
- public CodeStatementCollection Statements {
- get {
- if ( statements == null )
- statements = new CodeStatementCollection();
- return statements;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs b/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs
deleted file mode 100755
index 5cffe97c99f..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.CodeDom CodeCatchClauseCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeCatchClauseCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeCatchClauseCollection()
- {
- }
-
- public CodeCatchClauseCollection( CodeCatchClause[] value )
- {
- AddRange( value );
- }
-
- public CodeCatchClauseCollection( CodeCatchClauseCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeCatchClause this[int index] {
- get {
- return (CodeCatchClause)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeCatchClause value)
- {
- return List.Add (value);
- }
-
- public void AddRange (CodeCatchClause [] value)
- {
- foreach (CodeCatchClause ca in value)
- Add (ca);
- }
-
- public void AddRange (CodeCatchClauseCollection value )
- {
- foreach (CodeCatchClause ca in value)
- Add (ca);
- }
-
- public bool Contains( CodeCatchClause value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeCatchClause[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeCatchClause value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeCatchClause value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeCatchClause value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeComment.cs b/mcs/class/System/System.CodeDom/CodeComment.cs
deleted file mode 100644
index 8f761110ee8..00000000000
--- a/mcs/class/System/System.CodeDom/CodeComment.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.CodeDom CodeComment Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeComment
- : CodeObject
- {
- private bool docComment;
- private string text;
-
- //
- // Constructors
- //
- public CodeComment()
- {
- }
-
- public CodeComment( string text )
- {
- this.text = text;
- }
-
- public CodeComment( string text, bool docComment )
- {
- this.text = text;
- this.docComment = docComment;
- }
-
- //
- // Properties
- //
- public bool DocComment {
- get {
- return docComment;
- }
- set {
- docComment = value;
- }
- }
-
- public string Text {
- get {
- return text;
- }
- set {
- text = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCommentStatement.cs b/mcs/class/System/System.CodeDom/CodeCommentStatement.cs
deleted file mode 100755
index 0b52d080afd..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCommentStatement.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.CodeDom CodeCommentStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001, 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeCommentStatement
- : CodeStatement
- {
- private CodeComment comment;
-
- //
- // Constructors
- //
- public CodeCommentStatement ()
- {
- }
-
- public CodeCommentStatement (CodeComment comment)
- {
- this.comment = comment;
- }
-
- public CodeCommentStatement (string text)
- {
- this.comment = new CodeComment( text );
- }
-
- public CodeCommentStatement (string text, bool docComment)
- {
- this.comment = new CodeComment( text, docComment );
- }
-
- //
- // Properties
- //
- public CodeComment Comment {
- get {
- return comment;
- }
- set {
- comment = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs b/mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs
deleted file mode 100644
index 10372cc686b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCommentStatementCollection.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.CodeDom CodeCommentStatementCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeCommentStatementCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeCommentStatementCollection()
- {
- }
-
- public CodeCommentStatementCollection( CodeCommentStatement[] value )
- {
- AddRange( value );
- }
-
- public CodeCommentStatementCollection( CodeCommentStatementCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeCommentStatement this[int index]
- {
- get {
- return (CodeCommentStatement)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeCommentStatement value)
- {
- return List.Add( value );
- }
-
- public void AddRange (CodeCommentStatement [] value )
- {
- foreach ( CodeCommentStatement elem in value )
- Add( elem );
- }
-
- public void AddRange (CodeCommentStatementCollection value)
- {
- foreach ( CodeCommentStatement elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeCommentStatement value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeCommentStatement[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeCommentStatement value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeCommentStatement value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeCommentStatement value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeCompileUnit.cs
deleted file mode 100644
index e357f9bec1c..00000000000
--- a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.CodeDom CodeCompileUnit Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections.Specialized;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeCompileUnit
- : CodeObject
- {
- private CodeAttributeDeclarationCollection assemblyCustomAttributes;
- private CodeNamespaceCollection namespaces;
- private StringCollection referencedAssemblies;
-
- //
- // Constructors
- //
- public CodeCompileUnit()
- {
- }
-
- //
- // Properties
- //
- public CodeAttributeDeclarationCollection AssemblyCustomAttributes {
- get {
- if ( assemblyCustomAttributes == null )
- assemblyCustomAttributes =
- new CodeAttributeDeclarationCollection();
- return assemblyCustomAttributes;
- }
- }
-
- public CodeNamespaceCollection Namespaces {
- get {
- if ( namespaces == null )
- namespaces = new CodeNamespaceCollection();
- return namespaces;
- }
- }
-
- public StringCollection ReferencedAssemblies {
- get {
- if ( referencedAssemblies == null )
- referencedAssemblies = new StringCollection();
- return referencedAssemblies;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeConditionStatement.cs b/mcs/class/System/System.CodeDom/CodeConditionStatement.cs
deleted file mode 100644
index fb04c884371..00000000000
--- a/mcs/class/System/System.CodeDom/CodeConditionStatement.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.CodeDom CodeConditionStatement Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeConditionStatement
- : CodeStatement
- {
- private CodeExpression condition;
- private CodeStatementCollection trueStatements;
- private CodeStatementCollection falseStatements;
-
- //
- // Constructors
- //
- public CodeConditionStatement()
- {
- }
-
- public CodeConditionStatement( CodeExpression condition,
- params CodeStatement[] trueStatements )
- {
- this.condition = condition;
- this.TrueStatements.AddRange( trueStatements );
- }
-
- public CodeConditionStatement( CodeExpression condition,
- CodeStatement[] trueStatements,
- CodeStatement[] falseStatements )
- {
- this.condition = condition;
- this.TrueStatements.AddRange( trueStatements );
- this.FalseStatements.AddRange( falseStatements );
- }
-
- //
- // Properties
- //
- public CodeExpression Condition {
- get {
- return condition;
- }
- set {
- condition = value;
- }
- }
-
- public CodeStatementCollection FalseStatements {
- get {
- if ( falseStatements == null )
- falseStatements =
- new CodeStatementCollection();
- return falseStatements;
- }
- }
-
- public CodeStatementCollection TrueStatements {
- get {
- if ( trueStatements == null )
- trueStatements =
- new CodeStatementCollection();
- return trueStatements;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeConstructor.cs b/mcs/class/System/System.CodeDom/CodeConstructor.cs
deleted file mode 100755
index bbf99879bb4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeConstructor.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.CodeDom CodeConstructor Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeConstructor
- : CodeMemberMethod
- {
- private CodeExpressionCollection baseConstructorArgs;
- private CodeExpressionCollection chainedConstructorArgs;
-
- //
- // Constructors
- //
- public CodeConstructor()
- {
- }
-
- //
- // Properties
- //
- public CodeExpressionCollection BaseConstructorArgs {
- get {
- if ( baseConstructorArgs == null )
- baseConstructorArgs = new CodeExpressionCollection();
-
- return baseConstructorArgs;
- }
- }
-
- public CodeExpressionCollection ChainedConstructorArgs {
- get {
- if ( chainedConstructorArgs == null )
- chainedConstructorArgs = new CodeExpressionCollection();
-
- return chainedConstructorArgs;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs
deleted file mode 100755
index 04d1065b8e3..00000000000
--- a/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.CodeDom CodeDelegateCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeDelegateCreateExpression
- : CodeExpression
- {
- private CodeTypeReference delegateType;
- private string methodName;
- private CodeExpression targetObject;
-
- //
- // Constructors
- //
- public CodeDelegateCreateExpression ()
- {
- }
-
- public CodeDelegateCreateExpression (CodeTypeReference delegateType,
- CodeExpression targetObject,
- string methodName)
- {
- this.delegateType = delegateType;
- this.targetObject = targetObject;
- this.methodName = methodName;
- }
-
-
- //
- // Properties
- //
- public CodeTypeReference DelegateType {
- get {
- return delegateType;
- }
- set {
- delegateType = value;
- }
- }
-
- public string MethodName {
- get {
- return methodName;
- }
- set {
- methodName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs
deleted file mode 100755
index 84fa6a69669..00000000000
--- a/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.CodeDom CodeDelegateInvokeExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeDelegateInvokeExpression
- : CodeExpression
- {
- private CodeExpressionCollection parameters;
- private CodeExpression targetObject;
-
- //
- // Constructors
- //
- public CodeDelegateInvokeExpression ()
- {
- }
-
- public CodeDelegateInvokeExpression (CodeExpression targetObject)
- {
- this.targetObject = targetObject;
- }
-
- public CodeDelegateInvokeExpression (CodeExpression targetObject,
- CodeExpression [] parameters)
- {
- this.targetObject = targetObject;
- this.Parameters.AddRange( parameters );
- }
-
-
- //
- // Properties
- //
- public CodeExpressionCollection Parameters {
- get {
- if ( parameters == null )
- parameters = new CodeExpressionCollection();
- return parameters;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeDirectionExpression.cs b/mcs/class/System/System.CodeDom/CodeDirectionExpression.cs
deleted file mode 100644
index da6b96147af..00000000000
--- a/mcs/class/System/System.CodeDom/CodeDirectionExpression.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.CodeDom FieldDirection Enum implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeDirectionExpression
- : CodeExpression
- {
- private FieldDirection direction;
- private CodeExpression expression;
-
- //
- // Constructors
- //
- public CodeDirectionExpression()
- {
- }
-
- public CodeDirectionExpression( FieldDirection direction,
- CodeExpression expression )
- {
- this.direction = direction;
- this.expression = expression;
- }
-
- //
- // Properties
- //
- public FieldDirection Direction {
- get {
- return direction;
- }
- set {
- direction = value;
- }
- }
-
- public CodeExpression Expression {
- get {
- return expression;
- }
- set {
- expression = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs b/mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs
deleted file mode 100644
index ffc6a198dff..00000000000
--- a/mcs/class/System/System.CodeDom/CodeEntryPointMethod.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.CodeDom CodeEntryPointMethod Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeEntryPointMethod
- : CodeMemberMethod
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs
deleted file mode 100644
index cba9754a74b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeEventReferenceExpression.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.CodeDom CodeEventReferenceExpression class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeEventReferenceExpression
- : CodeExpression
- {
- private string eventName;
- private CodeExpression targetObject;
-
- //
- // Constructors
- //
- public CodeEventReferenceExpression()
- {
- }
-
- public CodeEventReferenceExpression( CodeExpression targetObject, string EventName )
- {
- this.targetObject = targetObject;
- this.eventName = eventName;
- }
-
- //
- // Properties
- //
- public string EventName {
- get {
- return eventName;
- }
- set {
- eventName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpression.cs b/mcs/class/System/System.CodeDom/CodeExpression.cs
deleted file mode 100755
index 91d2f2f2839..00000000000
--- a/mcs/class/System/System.CodeDom/CodeExpression.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.CodeDom CodeExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeExpression
- : CodeObject
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs
deleted file mode 100755
index 2ee42a1c9d8..00000000000
--- a/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.CodeDom CodeExpressionCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeExpressionCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeExpressionCollection()
- {
- }
-
- public CodeExpressionCollection( CodeExpression[] value )
- {
- AddRange( value );
- }
-
- public CodeExpressionCollection( CodeExpressionCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeExpression this[int index]
- {
- get {
- return (CodeExpression)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeExpression value)
- {
- return List.Add( value );
- }
-
- public void AddRange (CodeExpression [] value )
- {
- foreach ( CodeExpression elem in value )
- Add( elem );
- }
-
- public void AddRange (CodeExpressionCollection value)
- {
- foreach ( CodeExpression elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeExpression value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeExpression[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeExpression value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeExpression value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeExpression value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeExpressionStatement.cs b/mcs/class/System/System.CodeDom/CodeExpressionStatement.cs
deleted file mode 100644
index d397290cf99..00000000000
--- a/mcs/class/System/System.CodeDom/CodeExpressionStatement.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeExpressionStatement Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeExpressionStatement
- : CodeStatement
- {
- private CodeExpression expression;
-
- //
- // Constructors
- //
- public CodeExpressionStatement()
- {
- }
-
- public CodeExpressionStatement(CodeExpression expression)
- {
- Expression = expression;
- }
-
- //
- // Properties
- //
- public CodeExpression Expression {
- get {
- return expression;
- }
- set {
- expression = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs
deleted file mode 100755
index 04f0aca81ef..00000000000
--- a/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.CodeDom CodeFieldReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeFieldReferenceExpression
- : CodeExpression
- {
- private CodeExpression targetObject;
- private string fieldName;
-
- //
- // Constructors
- //
- public CodeFieldReferenceExpression ()
- {
- }
-
- public CodeFieldReferenceExpression (CodeExpression targetObject,
- string fieldName)
- {
- this.targetObject = targetObject;
- this.fieldName = fieldName;
- }
-
- //
- // Properties
- //
- public string FieldName {
- get {
- return fieldName;
- }
- set {
- fieldName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeGotoStatement.cs b/mcs/class/System/System.CodeDom/CodeGotoStatement.cs
deleted file mode 100644
index 283b8862443..00000000000
--- a/mcs/class/System/System.CodeDom/CodeGotoStatement.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.CodeDom CodeGotoStatement Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeGotoStatement
- : CodeStatement
- {
- private string label;
-
- //
- // Constructors
- //
- public CodeGotoStatement( string label )
- {
- Label = label;
- }
-
- //
- // Properties
- //
- public string Label {
- get {
- return label;
- }
- set {
- label = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs b/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs
deleted file mode 100755
index 958c2287c11..00000000000
--- a/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.CodeDom CodeFieldReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeIndexerExpression
- : CodeExpression
- {
- private CodeExpression targetObject;
- private CodeExpressionCollection indices;
-
- //
- // Constructors
- //
- public CodeIndexerExpression ()
- {
- }
-
- public CodeIndexerExpression (CodeExpression targetObject, params CodeExpression[] indices)
- {
- this.targetObject = targetObject;
- this.Indices.AddRange( indices );
- }
-
- //
- // Properties
- //
- public CodeExpressionCollection Indices {
- get {
- if ( indices == null )
- indices = new CodeExpressionCollection();
-
- return indices;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeIterationStatement.cs b/mcs/class/System/System.CodeDom/CodeIterationStatement.cs
deleted file mode 100644
index 67b41da3b98..00000000000
--- a/mcs/class/System/System.CodeDom/CodeIterationStatement.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// System.CodeDom CodeIterationStatement Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeIterationStatement
- : CodeStatement
- {
- private CodeStatement incrementStatement;
- private CodeStatement initStatement;
- private CodeStatementCollection statements;
- private CodeExpression testExpression;
-
- //
- // Constructors
- //
- public CodeIterationStatement()
- {
- }
-
- public CodeIterationStatement( CodeStatement initStatement,
- CodeExpression testExpression,
- CodeStatement incrementStatement,
- params CodeStatement[] statements )
- {
- this.initStatement = initStatement;
- this.testExpression = testExpression;
- this.incrementStatement = incrementStatement;
- this.Statements.AddRange( statements );
- }
-
- //
- // Properties
- //
- public CodeStatement IncrementStatement {
- get {
- return incrementStatement;
- }
- set {
- incrementStatement = value;
- }
- }
-
- public CodeStatement InitStatement {
- get {
- return initStatement;
- }
- set {
- initStatement = value;
- }
- }
-
- public CodeStatementCollection Statements {
- get {
- if ( statements == null )
- statements = new CodeStatementCollection();
- return statements;
- }
- }
-
- public CodeExpression TestExpression {
- get {
- return testExpression;
- }
- set {
- testExpression = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLabeledStatement.cs b/mcs/class/System/System.CodeDom/CodeLabeledStatement.cs
deleted file mode 100644
index 0e79e2a042b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeLabeledStatement.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.CodeDom CodeLabeledStatement Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeLabeledStatement
- : CodeStatement
- {
- private string label;
- private CodeStatement statement;
-
- //
- // Constructors
- //
- public CodeLabeledStatement()
- {
- }
-
- public CodeLabeledStatement( string label )
- {
- this.label = label;
- }
-
- public CodeLabeledStatement( string label, CodeStatement statement )
- {
- this.label = label;
- this.statement = statement;
- }
-
- //
- // Properties
- //
- public string Label {
- get {
- return label;
- }
- set {
- label = value;
- }
- }
-
- public CodeStatement Statement {
- get {
- return statement;
- }
- set {
- statement = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeLinePragma.cs b/mcs/class/System/System.CodeDom/CodeLinePragma.cs
deleted file mode 100755
index 613961188b0..00000000000
--- a/mcs/class/System/System.CodeDom/CodeLinePragma.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.CodeDom CodeLinePragma Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- // <summary>
- // Use objects of this class to keep track of locations where
- // statements are defined
- // </summary>
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeLinePragma
- {
- private string fileName;
- private int lineNumber;
-
- //
- // Constructors
- //
- public CodeLinePragma (string fileName, int lineNumber)
- {
- this.fileName = fileName;
- this.lineNumber = lineNumber;
- }
-
- //
- // Properties
- //
- public string FileName {
- get {
- return fileName;
- }
- set {
- fileName = value;
- }
- }
-
- public int LineNumber {
- get {
- return lineNumber;
- }
- set {
- lineNumber = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberEvent.cs b/mcs/class/System/System.CodeDom/CodeMemberEvent.cs
deleted file mode 100755
index 4537ddc0728..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberEvent.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.CodeDom CodeMemberEvent Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeMemberEvent
- : CodeTypeMember
- {
- private CodeTypeReference implementationType;
- private CodeTypeReference privateImplementationType;
- private CodeTypeReference type;
-
- //
- // Constructors
- //
- public CodeMemberEvent ()
- {
- }
-
- //
- // Properties
- //
- public CodeTypeReference ImplementationTypes {
- get {
- return implementationType;
- }
- set {
- implementationType = value;
- }
- }
-
- public CodeTypeReference PrivateImplementationType {
- get {
- return privateImplementationType;
- }
- set {
- privateImplementationType = value;
- }
- }
-
- public CodeTypeReference Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberField.cs b/mcs/class/System/System.CodeDom/CodeMemberField.cs
deleted file mode 100755
index 0665da3c2b3..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberField.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// System.CodeDom CodeMemberField Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeMemberField
- : CodeTypeMember
- {
- private CodeExpression initExpression;
- private CodeTypeReference type;
-
- public CodeMemberField ()
- {
- }
-
- public CodeMemberField (CodeTypeReference type, string name)
- {
- this.type = type;
- this.Name = name;
- }
-
- public CodeMemberField (string type, string name)
- {
- this.type = new CodeTypeReference( type );
- this.Name = name;
- }
-
- public CodeMemberField (Type type, string name)
- {
- this.type = new CodeTypeReference( type );
- this.Name = name;
- }
-
- //
- // Properties
- //
- public CodeExpression InitExpression {
- get {
- return initExpression;
- }
- set {
- initExpression = value;
- }
- }
-
- public CodeTypeReference Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
deleted file mode 100755
index da7669adb34..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// System.CodeDom CodeMemberMethod Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeMemberMethod
- : CodeTypeMember
- {
- private CodeTypeReferenceCollection implementationTypes;
- private CodeParameterDeclarationExpressionCollection parameters;
- private CodeTypeReference privateImplementationType;
- private CodeTypeReference returnType;
- private CodeStatementCollection statements;
- private CodeAttributeDeclarationCollection returnTypeCustomAttributes;
-
- //
- // Constructors
- //
- public CodeMemberMethod()
- {
- }
-
- //
- // Properties
- //
- public CodeTypeReferenceCollection ImplementationTypes {
- get {
- if ( implementationTypes == null ) {
- implementationTypes = new CodeTypeReferenceCollection();
- if ( PopulateImplementationTypes != null )
- PopulateImplementationTypes( this, EventArgs.Empty );
- }
- return implementationTypes;
- }
- }
-
- public CodeParameterDeclarationExpressionCollection Parameters {
- get {
- if ( parameters == null ) {
- parameters = new CodeParameterDeclarationExpressionCollection();
- if ( PopulateParameters != null )
- PopulateParameters( this, EventArgs.Empty );
- }
- return parameters;
- }
- }
-
- public CodeTypeReference PrivateImplementationType {
- get {
- return privateImplementationType;
- }
- set {
- privateImplementationType = value;
- }
- }
-
- public CodeTypeReference ReturnType {
- get {
- if ( returnType == null )
- return new CodeTypeReference( typeof(void) );
- return returnType;
- }
- set {
- returnType = value;
- }
- }
-
- public CodeStatementCollection Statements {
- get {
- if ( statements == null ) {
- statements = new CodeStatementCollection();
- if ( PopulateStatements != null )
- PopulateStatements( this, EventArgs.Empty );
- }
- return statements;
- }
- }
-
- public CodeAttributeDeclarationCollection ReturnTypeCustomAttributes {
- get {
- if ( returnTypeCustomAttributes == null )
- returnTypeCustomAttributes = new CodeAttributeDeclarationCollection();
-
- return returnTypeCustomAttributes;
- }
- }
-
- //
- // Events
- //
- public event EventHandler PopulateImplementationTypes;
-
- public event EventHandler PopulateParameters;
-
- public event EventHandler PopulateStatements;
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMemberProperty.cs b/mcs/class/System/System.CodeDom/CodeMemberProperty.cs
deleted file mode 100755
index 8ad15530acc..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMemberProperty.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// System.CodeDom CodeMemberProperty Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeMemberProperty
- : CodeTypeMember
- {
- private CodeStatementCollection getStatements;
- private bool hasGet;
- private bool hasSet;
- private CodeTypeReferenceCollection implementationTypes;
- private CodeParameterDeclarationExpressionCollection parameters;
- private CodeTypeReference privateImplementationType;
- private CodeStatementCollection setStatements;
- private CodeTypeReference type;
-
- //
- // Constructors
- //
- public CodeMemberProperty ()
- {
- }
-
- //
- // Properties
- //
- public CodeStatementCollection GetStatements {
- get {
- if ( getStatements == null )
- getStatements = new CodeStatementCollection();
- return getStatements;
- }
- }
-
- public bool HasGet {
- get {
- return hasGet;
- }
- set {
- hasGet = value;
- }
- }
-
- public bool HasSet {
- get {
- return hasSet;
- }
- set {
- hasSet = value;
- }
- }
-
- public CodeTypeReferenceCollection ImplementationTypes {
- get {
- if ( implementationTypes == null )
- implementationTypes = new CodeTypeReferenceCollection();
- return implementationTypes;
- }
- }
-
- public CodeParameterDeclarationExpressionCollection Parameters {
- get {
- if ( parameters == null )
- parameters = new CodeParameterDeclarationExpressionCollection();
- return parameters;
- }
- }
-
- public CodeTypeReference PrivateImplementationType {
- get {
- return privateImplementationType;
- }
- set {
- privateImplementationType = value;
- }
- }
-
- public CodeStatementCollection SetStatements {
- get {
- if ( setStatements == null )
- setStatements = new CodeStatementCollection();
- return setStatements;
- }
- }
-
- public CodeTypeReference Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs
deleted file mode 100755
index e01fdf5fdcd..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.CodeDom CodeMethodInvokeExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeMethodInvokeExpression
- : CodeExpression
- {
- private CodeMethodReferenceExpression method;
- private CodeExpressionCollection parameters;
-
- //
- // Constructors
- //
- public CodeMethodInvokeExpression ()
- {
- }
-
- public CodeMethodInvokeExpression (CodeMethodReferenceExpression method, params CodeExpression[] parameters)
- {
- this.method = method;
- this.Parameters.AddRange( parameters );
- }
-
- public CodeMethodInvokeExpression ( CodeExpression targetObject,
- string methodName,
- CodeExpression [] parameters)
- {
- this.method = new CodeMethodReferenceExpression( targetObject, methodName );
- this.Parameters.AddRange (parameters);
- }
-
- //
- // Properties
- //
- public CodeMethodReferenceExpression Method {
- get {
- return method;
- }
- set {
- method = value;
- }
- }
-
- public CodeExpressionCollection Parameters {
- get {
- if ( parameters == null )
- parameters = new CodeExpressionCollection();
- return parameters;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs
deleted file mode 100644
index 1157a3fea7a..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.CodeDom CodeMethodInvokeExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeMethodReferenceExpression
- : CodeExpression
- {
- private string methodName;
- private CodeExpression targetObject;
-
- //
- // Constructors
- //
- public CodeMethodReferenceExpression ()
- {
- }
-
- public CodeMethodReferenceExpression (CodeExpression targetObject,
- string methodName)
- {
- this.targetObject = targetObject;
- this.methodName = methodName;
- }
-
- //
- // Properties
- //
- public string MethodName {
- get {
- return methodName;
- }
- set {
- methodName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs b/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs
deleted file mode 100755
index 8ab4bd58c2a..00000000000
--- a/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.CodeDom CodeMethodReturnStatement class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeMethodReturnStatement
- : CodeStatement
- {
- private CodeExpression expression;
-
- //
- // Constructors
- //
- public CodeMethodReturnStatement()
- {
- }
-
- public CodeMethodReturnStatement( CodeExpression expression )
- {
- this.expression = expression;
- }
-
- //
- // Properties
- //
- public CodeExpression Expression {
- get {
- return expression;
- }
- set {
- expression = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespace.cs b/mcs/class/System/System.CodeDom/CodeNamespace.cs
deleted file mode 100755
index 1de1f7dc76b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeNamespace.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.CodeDom CodeNamespace Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeNamespace
- : CodeObject
- {
- private CodeCommentStatementCollection comments;
- private CodeNamespaceImportCollection imports;
- private CodeTypeDeclarationCollection types;
- private string name;
-
- //
- // Constructors
- //
- public CodeNamespace()
- {
- }
-
- public CodeNamespace(string name)
- {
- this.name = name;
- }
-
- //
- // Properties
- //
- public CodeCommentStatementCollection Comments {
- get {
- if ( comments == null ) {
- comments = new CodeCommentStatementCollection();
- if ( PopulateComments != null )
- PopulateComments( this, EventArgs.Empty );
- }
- return comments;
- }
- }
-
- public CodeNamespaceImportCollection Imports {
- get {
- if ( imports == null ) {
- imports = new CodeNamespaceImportCollection();
- if ( PopulateImports != null )
- PopulateImports( this, EventArgs.Empty );
- }
- return imports;
- }
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
-
- public CodeTypeDeclarationCollection Types {
- get {
- if ( types == null ) {
- types = new CodeTypeDeclarationCollection();
- if ( PopulateTypes != null )
- PopulateTypes( this, EventArgs.Empty );
- }
- return types;
- }
- }
-
- //
- // Events
- //
- public event EventHandler PopulateComments;
-
- public event EventHandler PopulateImports;
-
- public event EventHandler PopulateTypes;
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs
deleted file mode 100644
index 414fc6826ba..00000000000
--- a/mcs/class/System/System.CodeDom/CodeNamespaceCollection.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.CodeDom CodeNamespaceCollection Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeNamespaceCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeNamespaceCollection()
- {
- }
-
- public CodeNamespaceCollection( CodeNamespace[] value )
- {
- AddRange( value );
- }
-
- public CodeNamespaceCollection( CodeNamespaceCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeNamespace this[int index]
- {
- get {
- return (CodeNamespace)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeNamespace value)
- {
- return List.Add( value );
- }
-
- public void AddRange (CodeNamespace [] value )
- {
- foreach ( CodeNamespace elem in value )
- Add( elem );
- }
-
- public void AddRange (CodeNamespaceCollection value)
- {
- foreach ( CodeNamespace elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeNamespace value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeNamespace[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeNamespace value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeNamespace value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeNamespace value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs
deleted file mode 100755
index a3cc14a6d4f..00000000000
--- a/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.CodeDom CodeNamespaceImport Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeNamespaceImport
- : CodeObject
- {
- private CodeLinePragma linePragma;
- private string nameSpace;
-
- //
- // Constructors
- //
- public CodeNamespaceImport ()
- {
- }
-
- public CodeNamespaceImport (string nameSpace)
- {
- this.nameSpace = nameSpace;
- }
-
- //
- // Properties
- //
- public CodeLinePragma LinePragma {
- get {
- return linePragma;
- }
- set {
- linePragma = value;
- }
- }
-
- public string Namespace {
- get {
- return nameSpace;
- }
- set {
- nameSpace = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
deleted file mode 100755
index dedc7321efc..00000000000
--- a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-//
-// System.CodeDom CodeNamespaceImportCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- /*
- * Should probably be derived from CollectionBase like any
- * other System.CodeDom.*Collection. MS docs say it currently
- * is not, for whichever reason.
- */
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeNamespaceImportCollection
- : IList, ICollection, IEnumerable
- {
- private ArrayList namespaceImports;
-
- //
- // Constructors
- //
- public CodeNamespaceImportCollection ()
- {
- namespaceImports = new ArrayList();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return namespaceImports.Count;
- }
- }
-
- public CodeNamespaceImport this [int index] {
- get {
- return (CodeNamespaceImport)namespaceImports[index];
- }
- set {
- namespaceImports[index] = value;
- }
- }
-
- //
- // Methods
- //
- public void Add (CodeNamespaceImport value)
- {
- namespaceImports.Add (value);
- }
-
- public void AddRange (CodeNamespaceImport [] value)
- {
- foreach (CodeNamespaceImport elem in value)
- namespaceImports.Add (elem);
- }
-
- public void Clear ()
- {
- namespaceImports.Clear ();
- }
-
- // IList implementation
- bool IList.IsFixedSize {
- get {
- return false;
- }
- }
-
- bool IList.IsReadOnly {
- get {
- return false;
- }
- }
-
- object IList.this[int index] {
- get {
- return namespaceImports[index];
- }
- set {
- namespaceImports[index] = value;
- }
- }
-
- int IList.Add( object value )
- {
- return namespaceImports.Add( value );
- }
-
- bool IList.Contains( object value )
- {
- return namespaceImports.Contains( value );
- }
-
- int IList.IndexOf( object value )
- {
- return namespaceImports.IndexOf( value );
- }
-
- void IList.Insert( int index, object value )
- {
- namespaceImports.Insert( index, value );
- }
-
- void IList.Remove( object value )
- {
- namespaceImports.Remove( value );
- }
-
- void IList.RemoveAt( int index )
- {
- namespaceImports.RemoveAt( index );
- }
-
- // ICollection implementation
- object ICollection.SyncRoot {
- get {
- return namespaceImports.SyncRoot;
- }
- }
-
- bool ICollection.IsSynchronized {
- get {
- return namespaceImports.IsSynchronized;
- }
- }
-
- void ICollection.CopyTo( Array array, int index )
- {
- namespaceImports.CopyTo( array, index );
- }
-
- // IEnumerable implementation
- public IEnumerator GetEnumerator ()
- {
- return namespaceImports.GetEnumerator();
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeObject.cs b/mcs/class/System/System.CodeDom/CodeObject.cs
deleted file mode 100755
index 35b6053e73c..00000000000
--- a/mcs/class/System/System.CodeDom/CodeObject.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.CodeDom CodeObject class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeObject
- {
- private IDictionary userData;
-
- //
- // Properties
- //
- public IDictionary UserData {
- get {
- if ( userData == null )
- userData = new ListDictionary();
- return userData;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs
deleted file mode 100755
index a495d0b74aa..00000000000
--- a/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.CodeDom CodeObjectCreateExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeObjectCreateExpression
- : CodeExpression
- {
- private CodeTypeReference createType;
- private CodeExpressionCollection parameters;
-
- //
- // Constructors
- //
- public CodeObjectCreateExpression ()
- {
- }
-
- public CodeObjectCreateExpression (CodeTypeReference createType,
- params CodeExpression [] parameters)
- {
- this.createType = createType;
- this.Parameters.AddRange( parameters );
- }
-
- public CodeObjectCreateExpression (string createType,
- params CodeExpression [] parameters)
- {
- this.createType = new CodeTypeReference( createType );
- this.Parameters.AddRange( parameters );
- }
-
- public CodeObjectCreateExpression (Type createType,
- params CodeExpression [] parameters)
- {
- this.createType = new CodeTypeReference( createType );
- this.Parameters.AddRange( parameters );
- }
-
- //
- // Properties
- //
- public CodeTypeReference CreateType {
- get {
- return createType;
- }
- set {
- createType = value;
- }
- }
-
- public CodeExpressionCollection Parameters {
- get {
- if ( parameters == null )
- parameters = new CodeExpressionCollection();
- return parameters;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs
deleted file mode 100755
index 9f1cf463fa4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeParameterDeclarationExpression
- : CodeExpression
- {
- private CodeAttributeDeclarationCollection customAttributes;
- private FieldDirection direction;
- private string name;
- private CodeTypeReference type;
-
- //
- // Constructors
- //
- public CodeParameterDeclarationExpression ()
- {
- }
-
- public CodeParameterDeclarationExpression( CodeTypeReference type, string name )
- {
- this.type = type;
- this.name = name;
- }
-
- public CodeParameterDeclarationExpression (string type, string name)
- {
- this.type = new CodeTypeReference( type );
- this.name = name;
- }
-
- public CodeParameterDeclarationExpression (Type type, string name)
- {
- this.type = new CodeTypeReference( type );
- this.name = name;
- }
-
- //
- // Properties
- //
- public CodeAttributeDeclarationCollection CustomAttributes {
- get {
- if ( customAttributes == null )
- customAttributes = new CodeAttributeDeclarationCollection();
- return customAttributes;
- }
- }
-
- public FieldDirection Direction {
- get {
- return direction;
- }
- set {
- direction = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
-
- public CodeTypeReference Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
deleted file mode 100755
index 92d73ed42d9..00000000000
--- a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpressionCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeParameterDeclarationExpressionCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeParameterDeclarationExpressionCollection()
- {
- }
-
- public CodeParameterDeclarationExpressionCollection( CodeParameterDeclarationExpression[] value )
- {
- AddRange( value );
- }
-
- public CodeParameterDeclarationExpressionCollection( CodeParameterDeclarationExpressionCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeParameterDeclarationExpression this[int index]
- {
- get {
- return (CodeParameterDeclarationExpression)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeParameterDeclarationExpression value)
- {
- return List.Add( value );
- }
-
- public void AddRange (CodeParameterDeclarationExpression [] value )
- {
- foreach ( CodeParameterDeclarationExpression elem in value )
- Add( elem );
- }
-
- public void AddRange (CodeParameterDeclarationExpressionCollection value)
- {
- foreach ( CodeParameterDeclarationExpression elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeParameterDeclarationExpression value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeParameterDeclarationExpression[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeParameterDeclarationExpression value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeParameterDeclarationExpression value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeParameterDeclarationExpression value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs b/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs
deleted file mode 100755
index c6404cdf08f..00000000000
--- a/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodePrimitiveExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodePrimitiveExpression
- : CodeExpression
- {
- private object value;
-
- //
- // Constructors
- //
- public CodePrimitiveExpression ()
- {
- }
-
- public CodePrimitiveExpression (Object value)
- {
- this.value = value;
- }
-
- //
- // Properties
- //
- public object Value {
- get {
- return this.value;
- }
- set {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs
deleted file mode 100755
index 0680897c60c..00000000000
--- a/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.CodeDom CodePropertyReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodePropertyReferenceExpression
- : CodeExpression
- {
- private CodeExpression targetObject;
- private string propertyName;
-
- //
- // Constructors
- //
- public CodePropertyReferenceExpression ()
- {
- }
-
- public CodePropertyReferenceExpression (CodeExpression targetObject,
- string propertyName)
- {
- this.targetObject = targetObject;
- this.propertyName = propertyName;
- }
-
- //
- // Properties
- //
- public string PropertyName {
- get {
- return propertyName;
- }
- set {
- propertyName = value;
- }
- }
-
- public CodeExpression TargetObject {
- get {
- return targetObject;
- }
- set {
- targetObject = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs
deleted file mode 100644
index db99a3ad351..00000000000
--- a/mcs/class/System/System.CodeDom/CodePropertySetValueReferenceExpression.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.CodeDom CodePropertySetValueReferenceExpression Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodePropertySetValueReferenceExpression
- : CodeExpression
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs b/mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs
deleted file mode 100644
index c19ace0e84b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeRemoveEventStatement.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.CodeDom CodeRemoveEventStatement Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeRemoveEventStatement
- : CodeStatement
- {
- private CodeEventReferenceExpression eventRef;
- private CodeExpression listener;
-
- //
- // Constructors
- //
- public CodeRemoveEventStatement ()
- {
- }
-
- public CodeRemoveEventStatement (CodeEventReferenceExpression eventRef,
- CodeExpression listener)
- {
- this.eventRef = eventRef;
- this.listener = listener;
- }
-
- public CodeRemoveEventStatement (CodeExpression targetObject,
- string eventName,
- CodeExpression listener)
- {
- this.eventRef = new CodeEventReferenceExpression( targetObject,
- eventName );
- this.listener = listener;
- }
-
- //
- // Properties
- //
- public CodeEventReferenceExpression Event {
- get {
- return eventRef;
- }
- set {
- eventRef = value;
- }
- }
-
- public CodeExpression Listener {
- get {
- return listener;
- }
- set {
- listener = value;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs
deleted file mode 100644
index 49d13d5d461..00000000000
--- a/mcs/class/System/System.CodeDom/CodeSnippetCompileUnit.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.CodeDom CodeSnippetCompileUnit Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeSnippetCompileUnit
- : CodeCompileUnit
- {
- private CodeLinePragma linePragma;
- private string value;
-
- //
- // Constructors
- //
- public CodeSnippetCompileUnit( string value )
- {
- this.value = value;
- }
-
- //
- // Properties
- //
- public CodeLinePragma LinePragma {
- get {
- return linePragma;
- }
- set {
- linePragma = value;
- }
- }
-
- public string Value {
- get {
- return this.value;
- }
- set {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetExpression.cs b/mcs/class/System/System.CodeDom/CodeSnippetExpression.cs
deleted file mode 100644
index e9023d3c75b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeSnippetExpression.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeSnippetExpression Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeSnippetExpression
- : CodeExpression
- {
- private string value;
-
- //
- // Constructors
- //
- public CodeSnippetExpression()
- {
- }
-
- public CodeSnippetExpression( string value )
- {
- Value = value;
- }
-
- //
- // Properties
- //
- public string Value {
- get {
- return this.value;
- }
- set {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetStatement.cs b/mcs/class/System/System.CodeDom/CodeSnippetStatement.cs
deleted file mode 100644
index 1bd06116ba4..00000000000
--- a/mcs/class/System/System.CodeDom/CodeSnippetStatement.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeSnippetStatement Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeSnippetStatement
- : CodeStatement
- {
- private string value;
-
- //
- // Constructors
- //
- public CodeSnippetStatement()
- {
- }
-
- public CodeSnippetStatement( string value )
- {
- this.value = value;
- }
-
- //
- // Properties
- //
- public string Value {
- get {
- return this.value;
- }
- set {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs b/mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs
deleted file mode 100644
index 656afc287af..00000000000
--- a/mcs/class/System/System.CodeDom/CodeSnippetTypeMember.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeSnippetTypeMember Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeSnippetTypeMember
- : CodeTypeMember
- {
- private string text;
-
- //
- // Constructors
- //
- public CodeSnippetTypeMember()
- {
- }
-
- public CodeSnippetTypeMember( string text )
- {
- this.text = text;
- }
-
- //
- // Properties
- //
- public string Text {
- get {
- return text;
- }
- set {
- text = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeStatement.cs b/mcs/class/System/System.CodeDom/CodeStatement.cs
deleted file mode 100755
index f79710a1bbd..00000000000
--- a/mcs/class/System/System.CodeDom/CodeStatement.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.CodeDom CodeStatement class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeStatement
- : CodeObject
- {
- private CodeLinePragma linePragma;
-
- //
- // Constructors
- //
- public CodeStatement()
- {
- }
-
- //
- // Properties
- //
- public CodeLinePragma LinePragma {
- get {
- return linePragma;
- }
- set {
- linePragma = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeStatementCollection.cs b/mcs/class/System/System.CodeDom/CodeStatementCollection.cs
deleted file mode 100755
index 85462d76346..00000000000
--- a/mcs/class/System/System.CodeDom/CodeStatementCollection.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// System.CodeDom CodeStatementCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeStatementCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeStatementCollection()
- {
- }
-
- public CodeStatementCollection( CodeStatement[] value )
- {
- AddRange( value );
- }
-
- public CodeStatementCollection( CodeStatementCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeStatement this[int index]
- {
- get {
- return (CodeStatement)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeStatement value)
- {
- return List.Add( value );
- }
-
- public int Add (CodeExpression value)
- {
- return Add( new CodeExpressionStatement( value ) );
- }
-
- public void AddRange (CodeStatement [] statements )
- {
- foreach ( CodeStatement elem in statements )
- Add( elem );
- }
-
- public void AddRange( CodeStatementCollection value )
- {
- foreach ( CodeStatement elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeStatement value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeStatement[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeStatement value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeStatement value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeStatement value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs
deleted file mode 100755
index 737410bbf04..00000000000
--- a/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.CodeDom CodeParameterDeclarationExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeThisReferenceExpression
- : CodeExpression
- {
-
- //
- // Constructors
- //
- public CodeThisReferenceExpression()
- {
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs b/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs
deleted file mode 100755
index b031fa039dd..00000000000
--- a/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeThrowExceptionStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeThrowExceptionStatement
- : CodeStatement
- {
- private CodeExpression toThrow;
-
- //
- // Constructors
- //
- public CodeThrowExceptionStatement ()
- {
- }
-
- public CodeThrowExceptionStatement (CodeExpression toThrow)
- {
- this.toThrow = toThrow;
- }
-
- //
- // Properties
- //
- public CodeExpression ToThrow {
- get {
- return toThrow;
- }
- set {
- toThrow = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs b/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs
deleted file mode 100755
index 4ca30008464..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.CodeDom CodeTryCatchFinallyStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTryCatchFinallyStatement
- : CodeStatement
- {
- private CodeStatementCollection tryStatements, finallyStatements;
- private CodeCatchClauseCollection catchClauses;
-
- //
- // Constructors
- //
- public CodeTryCatchFinallyStatement ()
- {
- }
-
- public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
- CodeCatchClause [] catchClauses)
- {
- TryStatements.AddRange( tryStatements );
- CatchClauses.AddRange( catchClauses );
- }
-
- public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements,
- CodeCatchClause [] catchClauses,
- CodeStatement [] finallyStatements)
- {
- TryStatements.AddRange( tryStatements );
- CatchClauses.AddRange( catchClauses );
- FinallyStatements.AddRange( finallyStatements );
- }
-
- //
- // Properties
- //
- public CodeStatementCollection FinallyStatements{
- get {
- if ( finallyStatements == null )
- finallyStatements = new CodeStatementCollection();
- return finallyStatements;
- }
- }
-
- public CodeStatementCollection TryStatements {
- get {
- if ( tryStatements == null )
- tryStatements = new CodeStatementCollection();
- return tryStatements;
- }
- }
- public CodeCatchClauseCollection CatchClauses {
- get {
- if ( catchClauses == null )
- catchClauses = new CodeCatchClauseCollection();
- return catchClauses;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeConstructor.cs b/mcs/class/System/System.CodeDom/CodeTypeConstructor.cs
deleted file mode 100644
index 8213bf56c2a..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeConstructor.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.CodeDom CodeTypeConstructor Class Implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeConstructor
- : CodeMemberMethod
- {
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
deleted file mode 100755
index be0fdc70cff..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// System.CodeDom CodeTypeDeclaration Class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Reflection;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeDeclaration
- : CodeTypeMember
- {
- private CodeTypeReferenceCollection baseTypes;
- private CodeTypeMemberCollection members;
- private TypeAttributes typeAttributes;
- private bool isEnum;
- private bool isStruct;
-
- //
- // Constructors
- //
-
- public CodeTypeDeclaration()
- {
- }
-
- public CodeTypeDeclaration( string name )
- {
- this.Name = name;
- }
-
- /* by default, it's a class */
-
- //
- // Properties
- //
- public CodeTypeReferenceCollection BaseTypes {
- get {
- if ( baseTypes == null ) {
- baseTypes = new CodeTypeReferenceCollection();
- if ( PopulateBaseTypes != null )
- PopulateBaseTypes( this, EventArgs.Empty );
- }
- return baseTypes;
- }
- }
-
- public bool IsClass {
- get {
- if ( (typeAttributes & TypeAttributes.Interface) != 0 )
- return false;
- if ( isEnum )
- return false;
- if ( isStruct )
- return false;
- return true;
- }
- set {
- if ( value ) {
- typeAttributes &= ~TypeAttributes.Interface;
- isEnum = false;
- isStruct = false;
- }
- }
- }
-
- public bool IsEnum {
- get {
- return isEnum;
- }
- set {
- if ( value ) {
- typeAttributes &= ~TypeAttributes.Interface;
- isEnum = true;
- isStruct = false;
- }
- }
- }
-
- public bool IsInterface {
- get {
- return (typeAttributes & TypeAttributes.Interface) != 0;
- }
- set {
- if ( value ) {
- typeAttributes |= TypeAttributes.Interface;
- isEnum = false;
- isStruct = false;
- }
- }
- }
-
- public bool IsStruct {
- get {
- return isStruct;
- }
- set {
- if ( value ) {
- typeAttributes &= ~TypeAttributes.Interface;
- isEnum = false;
- isStruct = true;
- }
- }
- }
-
- public CodeTypeMemberCollection Members {
- get {
- if ( members == null ) {
- members = new CodeTypeMemberCollection();
- if ( PopulateMembers != null )
- PopulateMembers( this, EventArgs.Empty );
- }
- return members;
- }
- }
-
- public TypeAttributes TypeAttributes {
- get {
- return typeAttributes;
- }
- set {
- typeAttributes = value;
-#if FALSE
- /* MS does not seem to do this, so don't I */
- if ( (typeAttributes & TypeAttributes.Interface) != 0 ) {
- isEnum = false;
- isStruct = false;
- }
-#endif
- }
- }
-
- //
- // Events
- //
- public event EventHandler PopulateBaseTypes;
-
- public event EventHandler PopulateMembers;
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs
deleted file mode 100644
index 9c1c2a1a3b3..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeDeclarationCollection.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.CodeDom CodeTypeDeclarationCollection Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeDeclarationCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeTypeDeclarationCollection()
- {
- }
-
- public CodeTypeDeclarationCollection( CodeTypeDeclaration[] value )
- {
- AddRange( value );
- }
-
- public CodeTypeDeclarationCollection( CodeTypeDeclarationCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeTypeDeclaration this[int index]
- {
- get {
- return (CodeTypeDeclaration)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeTypeDeclaration value)
- {
- return List.Add (value);
- }
-
- public void AddRange (CodeTypeDeclaration [] value)
- {
- foreach (CodeTypeDeclaration ca in value)
- Add( ca );
- }
-
- public void AddRange (CodeTypeDeclarationCollection value)
- {
- foreach (CodeTypeDeclaration ca in value)
- Add( ca );
- }
-
- public bool Contains( CodeTypeDeclaration value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeTypeDeclaration[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeTypeDeclaration value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeTypeDeclaration value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeTypeDeclaration value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDelegate.cs b/mcs/class/System/System.CodeDom/CodeTypeDelegate.cs
deleted file mode 100644
index 27ef5a95b76..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeDelegate.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.CodeDom CodeTypeDelegate Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeDelegate
- : CodeTypeDeclaration
- {
- private CodeParameterDeclarationExpressionCollection parameters;
- private CodeTypeReference returnType;
-
- //
- // Constructors
- //
- public CodeTypeDelegate()
- {
- }
-
- public CodeTypeDelegate( string name )
- {
- this.Name = name;
- }
-
- //
- // Properties
- //
- public CodeParameterDeclarationExpressionCollection Parameters {
- get {
- if ( parameters == null )
- parameters = new CodeParameterDeclarationExpressionCollection();
- return parameters;
- }
- }
-
- public CodeTypeReference ReturnType {
- get {
- return returnType;
- }
- set {
- returnType = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeMember.cs b/mcs/class/System/System.CodeDom/CodeTypeMember.cs
deleted file mode 100755
index cc7ce536080..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeMember.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// System.CodeDom CodeTypeMember Class implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeMember
- : CodeObject
- {
- private string name;
- private MemberAttributes attributes;
- private CodeCommentStatementCollection comments;
- private CodeAttributeDeclarationCollection customAttributes;
- private CodeLinePragma linePragma;
-
- //
- // Constructors
- //
- public CodeTypeMember()
- {
- }
-
- //
- // Properties
- //
- public MemberAttributes Attributes {
- get {
- return attributes;
- }
- set {
- attributes = value;
- }
- }
-
- public CodeCommentStatementCollection Comments {
- get {
- if ( comments == null )
- comments = new CodeCommentStatementCollection();
- return comments;
- }
- }
-
-
- public CodeAttributeDeclarationCollection CustomAttributes {
- get {
- if ( customAttributes == null )
- customAttributes = new CodeAttributeDeclarationCollection();
- return customAttributes;
- }
- }
-
- public CodeLinePragma LinePragma {
- get {
- return linePragma;
- }
- set {
- linePragma = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs
deleted file mode 100644
index 54b49418590..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeMemberCollection.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.CodeDom CodeTypeMemberCollection Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeMemberCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeTypeMemberCollection()
- {
- }
-
- public CodeTypeMemberCollection( CodeTypeMember[] value )
- {
- AddRange( value );
- }
-
- public CodeTypeMemberCollection( CodeTypeMemberCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeTypeMember this[int index]
- {
- get {
- return (CodeTypeMember)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeTypeMember value)
- {
- return List.Add( value );
- }
-
- public void AddRange (CodeTypeMember [] value )
- {
- foreach ( CodeTypeMember elem in value )
- Add( elem );
- }
-
- public void AddRange (CodeTypeMemberCollection value)
- {
- foreach ( CodeTypeMember elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeTypeMember value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeTypeMember[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeTypeMember value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeTypeMember value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeTypeMember value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs
deleted file mode 100755
index 1462103aa18..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.CodeDom CodeTypeOfExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeOfExpression
- : CodeExpression
- {
- private CodeTypeReference type;
-
- //
- // Constructors
- //
- public CodeTypeOfExpression ()
- {
- }
-
- public CodeTypeOfExpression (CodeTypeReference type)
- {
- this.type = type;
- }
-
- public CodeTypeOfExpression (string type)
- {
- this.type = new CodeTypeReference( type );
- }
-
- public CodeTypeOfExpression (Type type)
- {
- this.type = new CodeTypeReference( type );
- }
-
- //
- // Properties
- //
- public CodeTypeReference Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReference.cs b/mcs/class/System/System.CodeDom/CodeTypeReference.cs
deleted file mode 100644
index 2f66b093333..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeReference.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceExpression Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeReference
- : CodeObject
- {
- private string baseType;
- private CodeTypeReference arrayType;
- private int rank;
-
- //
- // Constructors
- //
- public CodeTypeReference( string baseType )
- {
- this.baseType = baseType;
- }
-
- public CodeTypeReference( Type baseType )
- {
- this.baseType = baseType.FullName;
- }
-
- // FIXME: probably broken
- [MonoTODO]
- public CodeTypeReference( CodeTypeReference arrayType, int rank )
- {
- this.arrayType = arrayType;
- this.baseType = arrayType.BaseType;
- this.rank = rank;
- }
-
- // FIXME: probably broken
- [MonoTODO]
- public CodeTypeReference( string baseType, int rank )
- {
- this.baseType = baseType;
- this.rank = rank;
- }
-
-
- //
- // Properties
- //
-
- // FIXME: probably broken
- [MonoTODO]
- public CodeTypeReference ArrayElementType
- {
- get {
- return arrayType;
- }
- set {
- arrayType = value;
- }
- }
-
- // FIXME: probably broken
- [MonoTODO]
- public int ArrayRank {
- get {
- return rank;
- }
- set {
- rank = value;
- }
- }
-
- public string BaseType {
- get {
- return baseType;
- }
- set {
- baseType = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs
deleted file mode 100644
index e4e5302ba3a..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeReferenceCollection.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceCollection Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-using System.Collections;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeReferenceCollection
- : CollectionBase
- {
- //
- // Constructors
- //
- public CodeTypeReferenceCollection()
- {
- }
-
- public CodeTypeReferenceCollection( CodeTypeReference[] value )
- {
- AddRange( value );
- }
-
- public CodeTypeReferenceCollection( CodeTypeReferenceCollection value )
- {
- AddRange( value );
- }
-
- //
- // Properties
- //
- public CodeTypeReference this[int index]
- {
- get {
- return (CodeTypeReference)List[index];
- }
- set {
- List[index] = value;
- }
- }
-
- //
- // Methods
- //
- public int Add (CodeTypeReference value)
- {
- return List.Add( value );
- }
-
- public void AddRange (CodeTypeReference [] value )
- {
- foreach ( CodeTypeReference elem in value )
- Add( elem );
- }
-
- public void AddRange (CodeTypeReferenceCollection value)
- {
- foreach ( CodeTypeReference elem in value )
- Add( elem );
- }
-
- public bool Contains( CodeTypeReference value )
- {
- return List.Contains( value );
- }
-
- public void CopyTo( CodeTypeReference[] array, int index )
- {
- List.CopyTo( array, index );
- }
-
- public int IndexOf( CodeTypeReference value )
- {
- return List.IndexOf( value );
- }
-
- public void Insert( int index, CodeTypeReference value )
- {
- List.Insert( index, value );
- }
-
- public void Remove( CodeTypeReference value )
- {
- int index = IndexOf( value );
- if ( index < 0 )
- throw( new ArgumentException( "The specified object is not found in the collection" ) );
- RemoveAt( index );
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs
deleted file mode 100755
index 726732587ab..00000000000
--- a/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.CodeDom CodeTypeReferenceExpression Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeTypeReferenceExpression
- : CodeExpression
- {
- private CodeTypeReference type;
-
- //
- // Constructors
- //
- public CodeTypeReferenceExpression ()
- {
- }
-
- public CodeTypeReferenceExpression (CodeTypeReference type)
- {
- this.type = type;
- }
-
- public CodeTypeReferenceExpression (string type)
- {
- this.type = new CodeTypeReference( type );
- }
-
- public CodeTypeReferenceExpression (Type type)
- {
- this.type = new CodeTypeReference( type );
- }
-
- //
- // Properties
- //
- public CodeTypeReference Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs b/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs
deleted file mode 100755
index 6bd0671802b..00000000000
--- a/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// System.CodeDom CodeVariableDeclarationStatement Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeVariableDeclarationStatement
- : CodeStatement
- {
- private CodeExpression initExpression;
- private CodeTypeReference type;
- private string name;
-
- //
- // Constructors
- //
- public CodeVariableDeclarationStatement ()
- {
- }
-
- public CodeVariableDeclarationStatement( CodeTypeReference type, string name )
- {
- this.type = type;
- this.name = name;
- }
-
- public CodeVariableDeclarationStatement( string type, string name )
- {
- this.type = new CodeTypeReference( type );
- this.name = name;
- }
-
- public CodeVariableDeclarationStatement( Type type, string name )
- {
- this.type = new CodeTypeReference( type );
- this.name = name;
- }
-
- public CodeVariableDeclarationStatement( CodeTypeReference type,
- string name,
- CodeExpression initExpression )
- {
- this.type = type;
- this.name = name;
- this.initExpression = initExpression;
- }
-
- public CodeVariableDeclarationStatement( string type,
- string name,
- CodeExpression initExpression )
- {
- this.type = new CodeTypeReference( type );
- this.name = name;
- this.initExpression = initExpression;
- }
-
- public CodeVariableDeclarationStatement( Type type,
- string name,
- CodeExpression initExpression )
- {
- this.type = new CodeTypeReference( type );
- this.name = name;
- this.initExpression = initExpression;
- }
-
-
- //
- // Properties
- //
- public CodeExpression InitExpression {
- get {
- return initExpression;
- }
- set {
- initExpression = value;
- }
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
-
- public CodeTypeReference Type {
- get {
- return type;
- }
- set {
- type = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs
deleted file mode 100644
index 89b5d013b40..00000000000
--- a/mcs/class/System/System.CodeDom/CodeVariableReferenceExpression.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.CodeDom CodeVariableReferenceExpression Class implementation
-//
-// Author:
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom
-{
- [Serializable]
- [ClassInterface(ClassInterfaceType.AutoDispatch)]
- [ComVisible(true)]
- public class CodeVariableReferenceExpression
- : CodeExpression
- {
- private string variableName;
-
- //
- // Constructors
- //
- public CodeVariableReferenceExpression()
- {
- }
-
- public CodeVariableReferenceExpression( string variableName )
- {
- this.variableName = variableName;
- }
-
- //
- // Properties
- //
- public string VariableName {
- get {
- return variableName;
- }
- set {
- variableName = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.CodeDom/FieldDirection.cs b/mcs/class/System/System.CodeDom/FieldDirection.cs
deleted file mode 100755
index ccd6b4c876d..00000000000
--- a/mcs/class/System/System.CodeDom/FieldDirection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.CodeDom FieldDirection Enum implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
- [Serializable]
- [ComVisible(true)]
- public enum FieldDirection {
- In,
- Out,
- Ref
- }
-}
diff --git a/mcs/class/System/System.CodeDom/MemberAttributes.cs b/mcs/class/System/System.CodeDom/MemberAttributes.cs
deleted file mode 100755
index 5097375c798..00000000000
--- a/mcs/class/System/System.CodeDom/MemberAttributes.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.CodeDom MemberAttributes Enum implementation
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.CodeDom {
-
- [Serializable]
- [ComVisible(true)]
- public enum MemberAttributes {
- Abstract = 0x00000001,
- Final = 0x00000002,
- Static = 0x00000003,
- Override = 0x00000004,
- Const = 0x00000005,
- ScopeMask = 0x0000000F,
-
- New = 0x00000010,
- VTableMask = 0x000000F0,
-
- Overloaded = 0x00000100,
-
- Assembly = 0x00001000, // internal
- FamilyAndAssembly = 0x00002000, // protected AND internal
- Family = 0x00003000, // protected
- FamilyOrAssembly = 0x00004000, // protected internal
- Private = 0x00005000, // private
- Public = 0x00006000, // public
- AccessMask = 0x0000F000
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/BitVector32.cs b/mcs/class/System/System.Collections.Specialized/BitVector32.cs
deleted file mode 100644
index 85cf502f6a5..00000000000
--- a/mcs/class/System/System.Collections.Specialized/BitVector32.cs
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// System.Collections.Specialized.BitVector32.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Text;
-
-namespace System.Collections.Specialized {
-
- public struct BitVector32 {
- int bits;
-
- public struct Section {
- private short mask;
- private short offset;
-
- internal Section (short mask, short offset) {
- this.mask = mask;
- this.offset = offset;
- }
-
- public short Mask {
- get { return mask; }
- }
-
- public short Offset {
- get { return offset; }
- }
-
- public override bool Equals (object o)
- {
- if (! (o is Section))
- return false;
-
- Section section = (Section) o;
- return this.mask == section.mask &&
- this.offset == section.offset;
- }
-
- public override int GetHashCode ()
- {
- return (((Int16) mask).GetHashCode () << 16) +
- ((Int16) offset).GetHashCode ();
- }
-
- public override string ToString ()
- {
- return "Section{0x" + Convert.ToString(mask, 16) +
- ", 0x" + Convert.ToString(offset, 16) + "}";
- }
- }
-
- // Constructors
-
- public BitVector32 (BitVector32 source)
- {
- bits = source.bits;
- }
-
- public BitVector32 (int init)
- {
- bits = init;
- }
-
- // Properties
-
- public int Data {
- get { return bits; }
- }
-
- public int this [BitVector32.Section section] {
- get {
- return ((bits >> section.Offset) & section.Mask);
- }
-
- set {
- if (value < 0)
- throw new ArgumentException ("Section can't hold negative values");
- if (value > section.Mask)
- throw new ArgumentException ("Value too large to fit in section");
- bits &= (~section.Mask << section.Offset);
- bits |= (value << section.Offset);
- }
- }
-
- public bool this [int mask] {
- get {
- return (bits & mask) == mask;
- }
-
- set {
- if (value)
- bits |= mask;
- else
- bits &= ~mask;
- }
- }
-
- // Methods
-
- public static int CreateMask ()
- {
- return 1;
- }
-
- public static int CreateMask (int prev)
- {
- if (prev == 0)
- return 1;
- if (prev == Int32.MinValue)
- throw new InvalidOperationException ("all bits set");
- return prev << 1;
- }
-
- public static Section CreateSection (short maxValue)
- {
- return CreateSection (maxValue, new Section (0, 0));
- }
-
- public static Section CreateSection (short maxValue, BitVector32.Section previous)
- {
- if (maxValue < 1)
- throw new ArgumentException ("maxValue");
-
- int newmask = (int) maxValue;
- int mask = 0x8000;
- while ((newmask & mask) == 0)
- mask >>= 1;
- while (mask > 0) {
- newmask |= mask;
- mask >>= 1;
- }
-
- short count = 0;
- int prev = previous.Mask;
- mask = 0x8000;
- while (mask > 0) {
- if ((prev & mask) != 0)
- count++;
- mask >>= 1;
- }
-
- return new Section ((short) newmask, (short) (previous.Offset + count));
- }
-
- public override bool Equals (object o)
- {
- if (!(o is BitVector32))
- return false;
-
- return bits == ((BitVector32) o).bits;
- }
-
- public override int GetHashCode ()
- {
- return bits.GetHashCode ();
- }
-
- public override string ToString ()
- {
- return ToString (this);
- }
-
- public static string ToString (BitVector32 value)
- {
- StringBuilder b = new StringBuilder ();
- b.Append ("BitVector32{");
- long mask = (long) 0x80000000;
- while (mask > 0) {
- b.Append (((value.bits & mask) == 0) ? '0' : '1');
- mask >>= 1;
- }
- b.Append ('}');
- return b.ToString ();
- }
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/ChangeLog b/mcs/class/System/System.Collections.Specialized/ChangeLog
deleted file mode 100755
index 82aaab0ac0e..00000000000
--- a/mcs/class/System/System.Collections.Specialized/ChangeLog
+++ /dev/null
@@ -1,51 +0,0 @@
-2002-05-11 Lawrence Pit <loz@cable.a2000.nl>
-
- * NameValueCollection.AsStringArray: fixed ArgumentNullException bug.
-
-2002-05-10 Lawrence Pit <loz@cable.a2000.nl>
-
- * HybridDictionary.cs: implemented
- * CollectionsUtil.cs: implemented
- * BitVector32.cs: implemeneted
- * Modified signature of method ListDictionary.GetEnumerator
-
-Fri Feb 8 18:02:50 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * NameObjectCollectionBase.cs, NameValueCollection.cs: tweaks to make
- it compile and provide the constructor needed by nunitcore.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * BitVector32.cs, ListDictionary.cs : MonoTODO everywhere!
-
- * NameObjectCollectionBase.cs, NameValueCollection.cs : Ditto.
-
-2001-08-24 Nick Drochak <ndrochak@gol.com>
- * NameObjectCollectionBase.cs: Add stub implementation
- * common.src: Add NameObjectCollectionBase to the build
- * NameValueCollection.cs: add 'override' to CopyTo(). Maybe
- this code actually belongs in the superclass.
-
-2001-08-24 Miguel de Icaza <miguel@ximian.com>
-
- * common.src: Add NameValueCollection.cs to the build
-
-2001-08-22 John Barnette <jbarn@httcb.net>
- * StringDictionary.cs:
- Initial working implementation.
- * ListDictionary.cs:
- Initial working implementation.
-
-2001-07-17 John Barnette <jbarn@httcb.net>
- * StringCollection.cs:
- Implemented and working according to spec.
- * StringIterator.cs:
- (ADDED) Implemented and working according to spec.
- * StringCollectionTest.cs:
- (ADDED) Initial revision contains 17 tests; all of 'em
- run correctly. More complicated tests to follow.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * StringCollection.cs: Added so that CodeDom.* would compile.
-
diff --git a/mcs/class/System/System.Collections.Specialized/CollectionsUtil.cs b/mcs/class/System/System.Collections.Specialized/CollectionsUtil.cs
deleted file mode 100644
index 82d103134f1..00000000000
--- a/mcs/class/System/System.Collections.Specialized/CollectionsUtil.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Collections.Specialized.CollectionsUtil.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System.Collections;
-
-namespace System.Collections.Specialized {
-
- public class CollectionsUtil {
-
- public CollectionsUtil () {}
-
- public static Hashtable CreateCaseInsensitiveHashtable ()
- {
- return new Hashtable (CaseInsensitiveHashCodeProvider.Default,
- CaseInsensitiveComparer.Default);
- }
-
-
- public static Hashtable CreateCaseInsensitiveHashtable (IDictionary d) {
- return new Hashtable (d, CaseInsensitiveHashCodeProvider.Default,
- CaseInsensitiveComparer.Default);
- }
-
- public static Hashtable CreateCaseInsensitiveHashtable (int capacity) {
- return new Hashtable (capacity, CaseInsensitiveHashCodeProvider.Default,
- CaseInsensitiveComparer.Default);
- }
-
-
- public static SortedList CreateCaseInsensitiveSortedList () {
- return new SortedList (CaseInsensitiveComparer.Default);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Collections.Specialized/HybridDictionary.cs b/mcs/class/System/System.Collections.Specialized/HybridDictionary.cs
deleted file mode 100644
index a8b313cbd91..00000000000
--- a/mcs/class/System/System.Collections.Specialized/HybridDictionary.cs
+++ /dev/null
@@ -1,183 +0,0 @@
-//
-// System.Collections.Specialized.HybridDictionary.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-
-namespace System.Collections.Specialized {
-
- [Serializable]
- public class HybridDictionary : IDictionary, ICollection, IEnumerable {
-
- private const int switchAfter = 10;
-
- private ListDictionary list;
- private Hashtable hashtable;
- private bool caseInsensitive = false;
-
- // Constructors
-
- public HybridDictionary() : this (0, false) { }
-
- public HybridDictionary (bool caseInsensitive) : this (0, caseInsensitive) { }
-
- public HybridDictionary (int initialSize) : this (initialSize, false) { }
-
- public HybridDictionary(int initialSize, bool caseInsensitive)
- {
- this.caseInsensitive = caseInsensitive;
-
- if (initialSize <= switchAfter)
- if (caseInsensitive)
- list = new ListDictionary (CaseInsensitiveComparer.Default);
- else
- list = new ListDictionary ();
- else
- if (caseInsensitive)
- hashtable = new Hashtable (initialSize,
- CaseInsensitiveHashCodeProvider.Default,
- CaseInsensitiveComparer.Default);
- else
- hashtable = new Hashtable (initialSize);
- }
-
-
- // Properties
-
- public int Count {
- get {
- if (list != null)
- return list.Count;
- return hashtable.Count;
- }
- }
-
- public bool IsFixedSize {
- get { return false; }
- }
-
- public bool IsReadOnly {
- get { return false; }
- }
-
- public bool IsSynchronized {
- get { return false; }
- }
-
- public object this [object key] {
- get {
- if (key == null)
- throw new ArgumentNullException("key");
- if (list != null)
- return list [key];
- return hashtable [key];
- }
- set {
- if (list != null)
- if (list.Count >= switchAfter)
- Switch ();
- else {
- list [key] = value;
- return;
- }
- hashtable [key] = value;
- }
- }
-
- public ICollection Keys {
- get {
- if (list != null)
- return list.Keys;
- return hashtable.Keys;
- }
- }
-
- public object SyncRoot {
- get { return this; }
- }
-
- public ICollection Values {
- get {
- if (list != null)
- return list.Values;
- return hashtable.Values;
- }
- }
-
-
- // Methods
-
- public void Add (object key, object value)
- {
- if (list != null)
- if (list.Count >= switchAfter)
- Switch ();
- else {
- list.Add (key, value);
- return;
- }
- hashtable.Add (key, value);
- }
-
- public void Clear ()
- {
- if (caseInsensitive)
- list = new ListDictionary (CaseInsensitiveComparer.Default);
- else
- list = new ListDictionary ();
- hashtable = null;
- }
-
- public bool Contains (object key)
- {
- if (list != null)
- return list.Contains (key);
- return hashtable.Contains (key);
- }
-
- public void CopyTo (Array array, int index)
- {
- if (list != null)
- list.CopyTo (array, index);
- else
- hashtable.CopyTo (array, index);
- }
-
- public IDictionaryEnumerator GetEnumerator ()
- {
- if (list != null)
- return list.GetEnumerator ();
- return hashtable.GetEnumerator ();
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- public void Remove (object key)
- {
- if (list != null)
- list.Remove (key);
- hashtable.Remove (key);
- }
-
- private void Switch ()
- {
- if (caseInsensitive)
- hashtable = new Hashtable (switchAfter + 1,
- CaseInsensitiveHashCodeProvider.Default,
- CaseInsensitiveComparer.Default);
- else
- hashtable = new Hashtable (switchAfter + 1);
- IDictionaryEnumerator e = list.GetEnumerator ();
- while (e.MoveNext ())
- hashtable.Add (e.Key, e.Value);
- list = null;
- }
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/ListDictionary.cs b/mcs/class/System/System.Collections.Specialized/ListDictionary.cs
deleted file mode 100644
index 0ad664e3a1c..00000000000
--- a/mcs/class/System/System.Collections.Specialized/ListDictionary.cs
+++ /dev/null
@@ -1,435 +0,0 @@
-namespace System.Collections.Specialized
-{
- [Serializable]
- public class ListDictionary : IDictionary, ICollection, IEnumerable
- {
- private int count;
- private int modCount;
- private ListEntry root;
- private IComparer comparer;
-
-
- public ListDictionary()
- {
- count = 0;
- modCount = 0;
- comparer = null;
- root = null;
- }
-
- public ListDictionary(IComparer comparer) : this()
- {
- this.comparer = comparer;
- }
-
- private bool AreEqual(object obj1, object obj2)
- {
- if (comparer != null) {
- if (comparer.Compare(obj1, obj2) == 0) {
- return true;
- }
- } else {
- if (obj1.Equals(obj2)) {
- return true;
- }
- }
-
- return false;
- }
-
- private ListEntry FindEntry(object key)
- {
- if (key == null) {
- throw new ArgumentNullException("Attempted lookup for a null key.");
- }
-
- if (root == null) {
- return null;
- } else {
- ListEntry entry = root;
-
- while (entry != null) {
- if (AreEqual(key, entry.key)) {
- return entry;
- }
-
- entry = entry.next;
- }
- }
-
- return null;
- }
-
- private void AddImpl(object key, object value)
- {
- if (key == null) {
- throw new ArgumentNullException("Attempted add with a null key.");
- }
-
- if (root == null) {
- root = new ListEntry();
- root.key = key;
- root.value = value;
- } else {
- ListEntry entry = root;
-
- while (entry != null) {
- if (AreEqual(key, entry.key)) {
- throw new ArgumentException("Duplicate key in add.");
- }
-
- if (entry.next == null) {
- break;
- }
-
- entry = entry.next;
- }
-
- entry.next = new ListEntry();
- entry.next.key = key;
- entry.next.value = value;
- }
-
- count++;
- modCount++;
- }
-
- // IEnumerable Interface
- IEnumerator IEnumerable.GetEnumerator()
- {
- return new ListEntryEnumerator(this);
- }
-
- // ICollection Interface
- public int Count
- {
- get {
- return count;
- }
- }
-
- public bool IsSynchronized
- {
- get {
- return false;
- }
- }
-
- public object SyncRoot
- {
- get {
- return this;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- // FIXME
- }
-
- // IDictionary Interface
- public bool IsFixedSize
- {
- get {
- return false;
- }
- }
-
- public bool IsReadOnly
- {
- get {
- return false;
- }
- }
-
- // Indexer
- public object this[object key]
- {
- get {
- ListEntry entry = FindEntry(key);
- return entry == null ? entry : entry.value;
- }
-
- set {
- ListEntry entry = FindEntry(key);
-
- if (entry != null) {
- entry.value = value;
- count++;
- modCount++;
- } else {
- AddImpl(key, value);
- }
- }
- }
-
- public ICollection Keys
- {
- get {
- return new ListEntryCollection(this, true);
- }
- }
-
- public ICollection Values
- {
- get {
- return new ListEntryCollection(this, false);
- }
- }
-
- public void Add(object key, object value)
- {
- AddImpl(key, value);
- }
-
- public void Clear()
- {
- root = null;
- count = 0;
- modCount++;
- }
-
- public bool Contains(object key)
- {
- return FindEntry(key) != null ? true : false;
- }
-
- public IDictionaryEnumerator GetEnumerator()
- {
- return new ListEntryEnumerator(this);
- }
-
- public void Remove(object key)
- {
- ListEntry entry = root;
-
- for (ListEntry prev = null; entry != null; prev = entry, entry = entry.next) {
- if (AreEqual(key, entry.key)) {
- if (prev != null) {
- prev.next = entry.next;
- } else {
- root = entry.next;
- }
-
- entry.value = null;
- count--;
- modCount++;
- }
- }
- }
-
-
- private class ListEntry
- {
- public object key = null;
- public object value = null;
- public ListEntry next = null;
- }
-
-
- private class ListEntryEnumerator : IEnumerator, IDictionaryEnumerator
- {
- private ListDictionary dict;
- private bool isAtStart;
- private ListEntry current;
- private int version;
-
- public ListEntryEnumerator(ListDictionary dict)
- {
- this.dict = dict;
- version = dict.modCount;
- Reset();
- }
-
- private void FailFast()
- {
- if (version != dict.modCount) {
- throw new InvalidOperationException(
- "The ListDictionary's contents changed after this enumerator was instantiated.");
- }
- }
-
- public bool MoveNext()
- {
- FailFast();
-
- if (isAtStart) {
- current = dict.root;
- isAtStart = false;
- } else {
- current = current.next;
- }
-
- return current != null ? true : false;
- }
-
- public void Reset()
- {
- FailFast();
-
- isAtStart = true;
- current = null;
- }
-
- public object Current
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's first element or after the last element.");
- }
-
- return new DictionaryEntry(current.key, current.value);
- }
- }
-
- // IDictionaryEnumerator
- public DictionaryEntry Entry
- {
- get {
- FailFast();
- return (DictionaryEntry) Current;
- }
- }
-
- public object Key
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's first element or after the last element.");
- }
-
- return current.key;
- }
- }
-
- public object Value
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's first element or after the last element.");
- }
-
- return current.value;
- }
- }
- }
-
- private class ListEntryCollection : ICollection
- {
- private ListDictionary dict;
- private bool isKeyList;
-
- public ListEntryCollection(ListDictionary dict, bool isKeyList)
- {
- this.dict = dict;
- this.isKeyList = isKeyList;
- }
-
- // ICollection Interface
- public int Count
- {
- get {
- return dict.Count;
- }
- }
-
- public bool IsSynchronized
- {
- get {
- return false;
- }
- }
-
- public object SyncRoot
- {
- get {
- return dict.SyncRoot;
- }
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- // FIXME
- }
-
- // IEnumerable Interface
- public IEnumerator GetEnumerator()
- {
- return new ListEntryCollectionEnumerator(dict, isKeyList);
- }
-
- private class ListEntryCollectionEnumerator : IEnumerator
- {
- private ListDictionary dict;
- private bool isKeyList;
- private bool isAtStart;
- private int version;
- private ListEntry current;
-
- public ListEntryCollectionEnumerator(ListDictionary dict, bool isKeyList)
- {
- this.dict = dict;
- this.isKeyList = isKeyList;
- isAtStart = true;
- version = dict.modCount;
- }
-
- private void FailFast()
- {
- if (version != dict.modCount) {
- throw new InvalidOperationException(
- "The Collection's contents changed after this " +
- "enumerator was instantiated.");
- }
- }
-
- public object Current
- {
- get {
- FailFast();
-
- if (isAtStart || current == null) {
- throw new InvalidOperationException(
- "Enumerator is positioned before the collection's " +
- "first element or after the last element.");
- }
-
- return isKeyList ? current.key : current.value;
- }
- }
-
- public bool MoveNext()
- {
- FailFast();
-
- if (isAtStart) {
- current = dict.root;
- isAtStart = false;
- } else {
- current = current.next;
- }
-
- return current != null ? true : false;
- }
-
- public void Reset()
- {
- FailFast();
- isAtStart = true;
- current = null;
- }
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs b/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
deleted file mode 100644
index b1dfeb76106..00000000000
--- a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
+++ /dev/null
@@ -1,512 +0,0 @@
-/**
- * System.Collections.Specialized.NamaValueCollection class implementation
- *
- * Author: Gleb Novodran
- */
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Collections.Specialized
-{
- [Serializable]
- public abstract class NameObjectCollectionBase : ICollection, IEnumerable, ISerializable, IDeserializationCallback
- {
- private Hashtable m_ItemsContainer;
- /// <summary>
- /// Extends Hashtable based Items container to support storing null-key pairs
- /// </summary>
- private _Item m_NullKeyItem;
- private ArrayList m_ItemsArray;
- private IHashCodeProvider m_hashprovider;
- private IComparer m_comparer;
- private int m_defCapacity;
- private bool m_readonly;
-
- internal IComparer Comparer {
- get {return m_comparer;}
- }
-
- internal IHashCodeProvider HashCodeProvider {
- get {return m_hashprovider;}
- }
-
- internal protected /*?*/ class _Item
- {
- public string key;
- public object value;
- public _Item(string key, object value)
- {
- this.key = key;
- this.value = value;
- }
- }
- /// <summary>
- /// Implements IEnumerable interface for KeysCollection
- /// </summary>
- [Serializable]
- internal protected /*?*/ class _KeysEnumerator : IEnumerator
- {
- private NameObjectCollectionBase m_collection;
- private int m_position;
- /*private*/internal _KeysEnumerator(NameObjectCollectionBase collection)
- {
- m_collection = collection;
- Reset();
- }
- public object Current
- {
-
- get{
- if ((m_position<m_collection.Count)||(m_position<0))
- return m_collection.BaseGetKey(m_position);
- else
- throw new InvalidOperationException();
- }
-
- }
- public bool MoveNext()
- {
- return ((++m_position)<m_collection.Count)?true:false;
- }
- public void Reset()
- {
- m_position = -1;
- }
- }
-
- /// <summary>
- /// SDK: Represents a collection of the String keys of a collection.
- /// </summary>
- public class KeysCollection : ICollection, IEnumerable
- {
- private NameObjectCollectionBase m_collection;
-
- internal/*protected?*/ KeysCollection(NameObjectCollectionBase collection)
- {
- this.m_collection = collection;
- }
- public virtual string Get( int index )
- {
- return m_collection.BaseGetKey(index);
- //throw new Exception("Not implemented yet");
- }
-
- // ICollection methods -----------------------------------
- /// <summary>
- ///
- /// </summary>
- /// <param name="arr"></param>
- /// <param name="index"></param>
- public virtual void /*ICollection*/ CopyTo(Array arr, int index)
- {
- if (arr==null)
- throw new ArgumentNullException("array can't be null");
- IEnumerator en = this.GetEnumerator();
- int i = index;
- while (en.MoveNext())
- {
- arr.SetValue(en.Current,i);
- i++;
- }
- }
-
- public virtual bool IsSynchronized
- {
- get{
- throw new Exception("Not implemented yet");
- }
- }
- public virtual object SyncRoot
- {
- get{
- throw new Exception("Not implemented yet");
- }
- }
- /// <summary>
- /// Gets the number of keys in the NameObjectCollectionBase.KeysCollection
- /// </summary>
- public int Count
- {
- get{
- return m_collection.Count;
- //throw new Exception("Not implemented yet");
- }
- }
- // IEnumerable methods --------------------------------
- /// <summary>
- /// SDK: Returns an enumerator that can iterate through the NameObjectCollectionBase.KeysCollection.
- /// </summary>
- /// <returns></returns>
- public IEnumerator GetEnumerator()
- {
- return new _KeysEnumerator(m_collection);
-// throw new Exception("Not implemented yet");
- }
- }
-
-
-
- //--------------- Protected Instance Constructors --------------
-
- /// <summary>
- /// SDK: Initializes a new instance of the NameObjectCollectionBase class that is empty.
- /// </summary>
- [MonoTODO]
- protected NameObjectCollectionBase():base()
- {
- m_readonly = false;
-
- m_hashprovider = CaseInsensitiveHashCodeProvider.Default;
- m_comparer = CaseInsensitiveComparer.Default;
- m_defCapacity = 0;
- Init();
- /*m_ItemsContainer = new Hashtable(m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null;*/
- //TODO: consider common Reset() method
- }
-
- protected NameObjectCollectionBase( int capacity )
- {
- m_readonly = false;
-
- m_hashprovider = CaseInsensitiveHashCodeProvider.Default;
- m_comparer = CaseInsensitiveComparer.Default;
- m_defCapacity = capacity;
- Init();
- /*m_ItemsContainer = new Hashtable(m_defCapacity, m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null; */
- //throw new Exception("Not implemented yet");
- }
- protected NameObjectCollectionBase( IHashCodeProvider hashProvider, IComparer comparer )
- {
- m_readonly = false;
-
- m_hashprovider = hashProvider;
- m_comparer = comparer;
- m_defCapacity = 0;
- Init();
- /*m_ItemsContainer = new Hashtable(m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null; */
- //throw new Exception("Not implemented yet");
- }
- protected NameObjectCollectionBase( SerializationInfo info, StreamingContext context )
- {
- throw new Exception("Not implemented yet");
- }
- protected NameObjectCollectionBase( int capacity, IHashCodeProvider hashProvider, IComparer comparer )
- {
- m_readonly = false;
-
- m_hashprovider = hashProvider;
- m_comparer = comparer;
- m_defCapacity = capacity;
- Init();
- /*m_ItemsContainer = new Hashtable(m_defCapacity,m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null; */
-
- //throw new Exception("Not implemented yet");
- }
-
- private void Init(){
- m_ItemsContainer = new Hashtable(m_defCapacity,m_hashprovider,m_comparer);
- m_ItemsArray = new ArrayList();
- m_NullKeyItem = null;
- }
- //--------------- Public Instance Properties -------------------
- public virtual NameObjectCollectionBase.KeysCollection Keys
- {
- get
- {
- return new KeysCollection(this);
- //throw new Exception("Not implemented yet");
- }
- }
-
- //--------------- Public Instance Methods ----------------------
- //
- /// <summary>
- /// SDK: Returns an enumerator that can iterate through the NameObjectCollectionBase.
- ///
- /// <remark>This enumerator returns the keys of the collection as strings.</remark>
- /// </summary>
- /// <returns></returns>
- public IEnumerator GetEnumerator()
- {
- return new _KeysEnumerator(this);
- }
- // GetHashCode
-
- // ISerializable
- public virtual void /*ISerializable*/ GetObjectData( SerializationInfo info, StreamingContext context )
- {
- throw new Exception("Not implemented yet");
- }
-
- // ICollection
- public virtual int Count
- {
- get{
- return m_ItemsArray.Count;
- //throw new Exception("Not implemented yet");
- }
- }
- bool ICollection.IsSynchronized
- {
- get { return false; }
- }
- object ICollection.SyncRoot
- {
- get { return this; }
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- throw new NotImplementedException ();
- }
-
-
- // IDeserializationCallback
- public virtual void OnDeserialization( object sender)
- {
- throw new Exception("Not implemented yet");
- }
-
- //--------------- Protected Instance Properties ----------------
- /// <summary>
- /// SDK: Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.
- /// </summary>
- protected bool IsReadOnly
- {
- get{
- return m_readonly;
- }
- set{
- m_readonly=value;
- }
- }
-
- //--------------- Protected Instance Methods -------------------
- /// <summary>
- /// Adds an Item with the specified key and value into the <see cref="NameObjectCollectionBase"/>NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="name"></param>
- /// <param name="value"></param>
- protected void BaseAdd( string name, object value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
-
- _Item newitem=new _Item(name, value);
-
- if (name==null){
- //todo: consider nullkey entry
- if (m_NullKeyItem==null)
- m_NullKeyItem = newitem;
- }
- else
- if (m_ItemsContainer[name]==null){
- m_ItemsContainer.Add(name,newitem);
- }
- m_ItemsArray.Add(newitem);
-
-// throw new Exception("Not implemented yet");
- }
- protected void BaseClear()
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- Init();
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// SDK: Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="index"></param>
- /// <returns></returns>
- protected object BaseGet( int index )
- {
- return ((_Item)m_ItemsArray[index]).value;
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// SDK: Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.
- /// </summary>
- /// <remark>CAUTION: The BaseGet method does not distinguish between a null reference which is returned because the specified key is not found and a null reference which is returned because the value associated with the key is a null reference.</remark>
- /// <param name="name"></param>
- /// <returns></returns>
- protected object BaseGet( string name )
- {
- _Item item = FindFirstMatchedItem(name);
- /// CAUTION: The BaseGet method does not distinguish between a null reference which is returned because the specified key is not found and a null reference which is returned because the value associated with the key is a null reference.
- if (item==null)
- return null;
- else
- return item.value;
- }
-
- /// <summary>
- /// SDK:Returns a String array that contains all the keys in the NameObjectCollectionBase instance.
- /// </summary>
- /// <returns>A String array that contains all the keys in the NameObjectCollectionBase instance.</returns>
- protected string[] BaseGetAllKeys()
- {
- int cnt = m_ItemsArray.Count;
- string[] allKeys = new string[cnt];
- for(int i=0; i<cnt; i++)
- allKeys[i] = BaseGetKey(i);//((_Item)m_ItemsArray[i]).key;
-
- return allKeys;
- }
-
- /// <summary>
- /// SDK: Returns an Object array that contains all the values in the NameObjectCollectionBase instance.
- /// </summary>
- /// <returns>An Object array that contains all the values in the NameObjectCollectionBase instance.</returns>
- protected object[] BaseGetAllValues()
- {
- int cnt = m_ItemsArray.Count;
- object[] allValues = new object[cnt];
- for(int i=0; i<cnt; i++)
- allValues[i] = BaseGet(i);
-
- return allValues;
-// throw new Exception("Not implemented yet");
- }
- [MonoTODO]
- protected object[] BaseGetAllValues( Type type )
- {
- if (type == null)
- throw new ArgumentNullException("'type' argument can't be null");
- // TODO: implements this
-
- throw new Exception("Not implemented yet");
- }
-
- protected string BaseGetKey( int index )
- {
- return ((_Item)m_ItemsArray[index]).key;
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not a null reference
- /// </summary>
- /// <returns>true if the NameObjectCollectionBase instance contains entries whose keys are not a null reference otherwise, false.</returns>
- protected bool BaseHasKeys()
- {
- return (m_ItemsContainer.Count>0);
-// throw new Exception("Not implemented yet");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="name"></param>
- [MonoTODO]
- protected void BaseRemove( string name )
- {
- int cnt = 0;
- String key;
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- if (name!=null)
- {
- m_ItemsContainer.Remove(name);
- }
- else {
- m_NullKeyItem = null;
- }
-
- cnt = m_ItemsArray.Count;
- for (int i=0 ; i< cnt; ){
- key=BaseGetKey(i);
- // TODO: consider case-sensivity
- if (String.Compare(key,name)==0){
- m_ItemsArray.RemoveAt(i);
- cnt--;
- }
- else
- i++;
-
- }
-// throw new Exception("Not implemented yet");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="index"></param>
- /// <LAME>This function implemented the way Microsoft implemented it -
- /// item is removed from hashtable and array without considering the case when there are two items with the same key but different values in array.
- /// E.g. if
- /// hashtable is [("Key1","value1")] and array contains [("Key1","value1")("Key1","value2")] then
- /// after RemoveAt(1) the collection will be in following state:
- /// hashtable:[]
- /// array: [("Key1","value1")]
- /// It's ok only then the key is uniquely assosiated with the value
- /// To fix it a comparsion of objects stored under the same key in the hashtable and in the arraylist should be added
- /// </LAME>>
- [MonoTODO]
- protected void BaseRemoveAt( int index )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- string key = BaseGetKey(index);
- if (key!=null){
- // TODO: see LAME description above
- m_ItemsContainer.Remove(key);
- }
- else
- m_NullKeyItem = null;
- m_ItemsArray.RemoveAt(index);
-// throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// SDK: Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="index"></param>
- /// <param name="value"></param>
- protected void BaseSet( int index, object value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- _Item item = (_Item)m_ItemsArray[index];
- item.value = value;
- //throw new Exception("Not implemented yet");
- }
- /// <summary>
- /// Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.
- /// </summary>
- /// <param name="name">The String key of the entry to set. The key can be a null reference </param>
- /// <param name="value">The Object that represents the new value of the entry to set. The value can be a null reference</param>
- protected void BaseSet( string name, object value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- _Item item = FindFirstMatchedItem(name);
- if (item!=null)
- item.value=value;
- else
- BaseAdd(name, value);
-
- //throw new Exception("Not implemented yet");
- }
- [MonoTODO]
- private _Item FindFirstMatchedItem(string name)
- {
- if (name!=null)
- return (_Item)m_ItemsContainer[name];
- else {
- //TODO: consider null key case
- return m_NullKeyItem;
- //throw new Exception("Not implemented yet");
- }
-
- }
- //~Object();
-
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs b/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
deleted file mode 100644
index 6cdf0197b11..00000000000
--- a/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
+++ /dev/null
@@ -1,367 +0,0 @@
-/**
- * System.Collections.Specialized.NamaValueCollection class implementation
- *
- * Author: Gleb Novodran
- */
-// created on 7/21/2001 at 5:15 PM
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace System.Collections.Specialized{
- [Serializable]
- public class NameValueCollection : NameObjectCollectionBase
- {
- string[] cachedAllKeys = null;
- string[] cachedAll = null;
-
- //--------------------- Constructors -----------------------------
-
- /// <summary> SDK: Initializes a new instance of the NameValueCollection class that is empty,
- /// has the default initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.
- /// </summary>
- public NameValueCollection() : base()
- {
-
- }
-
- /// <summary> SDK: Initializes a new instance of the NameValueCollection class that is empty,
- /// has the specified initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer.
- ///</summary>
- public NameValueCollection( int capacity ) : base(capacity)
- {
-
- }
-
- /// <summary> SDK: Copies the entries from the specified NameValueCollection to a new
- /// NameValueCollection with the same initial capacity as the number of entries copied
- /// and using the same case-insensitive hash code provider and the same case-insensitive
- /// comparer as the source collection.
- /// </summary>
- /// TODO: uncomment constructor below after it will be possible to compile NameValueCollection and
- /// NameObjectCollectionBase to the same assembly
-
- public NameValueCollection( NameValueCollection col ) : base(col.HashCodeProvider,col.Comparer)
- {
- if (col==null)
- throw new ArgumentNullException("Null argument is not allowed");
- Add(col);
- }
-
- ///<summary>SDK: Initializes a new instance of the NameValueCollection class that is empty,
- ///has the default initial capacity and uses the specified hash code provider and
- ///the specified comparer.</summary>
- public NameValueCollection( IHashCodeProvider hashProvider, IComparer comparer )
- : base(hashProvider, comparer)
- {
-
- }
-
- /// <summary>
- /// SDK: Copies the entries from the specified NameValueCollection to a new NameValueCollection
- /// with the specified initial capacity or the same initial capacity as the number of entries
- /// copied, whichever is greater, and using the default case-insensitive hash code provider and
- /// the default case-insensitive comparer.
- /// </summary>
- /// TODO: uncomment constructor below after it will be possible to compile NameValueCollection and
- /// NameObjectCollectionBase to the same assembly
-
-/* public NameValueCollection( int capacity, NameValueCollection col )
- : base(capacity, col.get_HashCodeProvider(),col.Comparer)
- {
- if (col==null)
- throw new ArgumentNullException("Null argument is not allowed");
- Add(col);
- }
-*/
- /// <summary>
- /// SDK: Initializes a new instance of the NameValueCollection class that is serializable
- /// and uses the specified System.Runtime.Serialization.SerializationInfo and
- /// System.Runtime.Serialization.StreamingContext.
- /// </summary>
- protected NameValueCollection( SerializationInfo info, StreamingContext context )
- :base(info, context)
- {
-
- }
-
- /// <summary>
- /// SDK: Initializes a new instance of the NameValueCollection class that is empty,
- /// has the specified initial capacity and uses the specified hash code provider and
- /// the specified comparer.
- /// </summary>
- public NameValueCollection( int capacity, IHashCodeProvider hashProvider, IComparer comparer )
- :base(capacity, hashProvider, comparer)
- {
-
- }
-
- //----------------------- Public Instance Properties -------------------------------
-
-
- ///<summary> SDK:
- /// Gets all the keys in the NameValueCollection.
- /// The arrays returned by AllKeys are cached for better performance and are
- /// automatically refreshed when the collection changes. A derived class can
- /// invalidate the cached version by calling InvalidateCachedArrays, thereby
- /// forcing the arrays to be recreated.
- /// </summary>
- public virtual string[] AllKeys
- {
- get {
- if (cachedAllKeys==null)
- cachedAllKeys = BaseGetAllKeys();
- return this.cachedAllKeys;
- }
- }
-
- public string this[ int index ]
- {
- get{
- return this.Get(index);
- }
- }
-
- public string this[ string name ] {
- get{
- return this.Get(name);
- }
- set{
- this.Set(name,value);
- }
- }
-
-/////////////////////////////// Public Instance Methods //////////////////////////////
-
- /// <summary> SDK: Copies the entries in the specified NameValueCollection
- /// to the current NameValueCollection.</summary>
- /// LAMESPEC: see description that comes this Add(string, string)
-
- public void Add( NameValueCollection c ){
-
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- if (c==null)
- throw new ArgumentNullException();
-
- InvalidateCachedArrays();
- ArrayList values = null;
-
- int max = c.Count;
- for(int i=0; i<max; i++){
- values=(ArrayList)BaseGet(c.GetKey(i));
- if (values==null)
- values = new ArrayList();
- values.AddRange((ArrayList)c.BaseGet(i));
- }
-
- }
-
-
- /// <summary> SDK: Adds an entry with the specified name and value to the
- /// NameValueCollection. </summary>
- ///
- /// LAMESPEC:
- /// in SDK doc: If the same value already exists under the same key in the collection,
- /// the new value overwrites the old value.
- /// however the Microsoft implemenatation in this case just adds one more value
- /// in other words after
- /// <code>
- /// NameValueCollection nvc;
- /// nvc.Add("LAZY","BASTARD")
- /// nvc.Add("LAZY","BASTARD")
- /// </code>
- /// nvc.Get("LAZY") will be "BASTARD,BASTARD" instead of "BASTARD"
-
- public virtual void Add( string name, string val )
- {
-
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
-
- InvalidateCachedArrays();
- ArrayList values = (ArrayList)BaseGet(name);
- if (values==null){
- values = new ArrayList();
- if (val!=null)
- values.Add(val);
- BaseAdd(name,values);
- }
- else {
- if (val!=null)
- values.Add(val);
- }
-
- }
-
- /// <summary> SDK: Invalidates the cached arrays and removes all entries from
- /// the NameValueCollection.</summary>
-
- public void Clear(){
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- InvalidateCachedArrays();
- BaseClear();
- }
-
- /// <summary> SDK: Copies the entire NameValueCollection to a compatible one-dimensional Array,
- /// starting at the specified index of the target array.</summary>
-
- [MonoTODO]
- public void CopyTo( Array dest, int index )
- {
- if (dest==null)
- throw new ArgumentNullException("Null argument - dest");
- if (index<0)
- throw new ArgumentOutOfRangeException("index is less than 0");
-// throw new Exception("Not implemented yet");
-
- //TODO: add implementation here
- if (cachedAll==null)
- RefreshCachedAll();
- cachedAll.CopyTo(dest, index);
- }
- protected void RefreshCachedAll()
- {
- this.cachedAll=null;
- int max = this.Count;
- cachedAll = new string[max];
- for(int i=0;i<max;i++){
- cachedAll[i] = this.Get(i);
- }
-
- }
-
- /// <summary> SDK: Gets the values at the specified index of the NameValueCollection combined
- /// into one comma-separated list.</summary>
-
- public virtual string Get( int index )
- {
- ArrayList values = (ArrayList)BaseGet(index);
- // if index is out of range BaseGet throws an ArgumentOutOfRangeException
-
- return AsSingleString(values);
-
- }
-
- /**
- * SDK: Gets the values associated with the specified key from the NameValueCollection
- * combined into one comma-separated list.
- */
- public virtual string Get( string name )
- {
- ArrayList values = (ArrayList)BaseGet(name);
-/* if (values==null)
- Console.WriteLine("BaseGet returned null");*/
- return AsSingleString(values);
-// -------------------------------------------------------------
-
- }
- /// <summary></summary>
- [MonoTODO]
- private static string AsSingleString(ArrayList values)
- {
- const char separator = ',';
-
- if (values==null)
- return null;
- int max = values.Count;
-
- if (max==0)
- return null;
- //TODO: reimplement this
- StringBuilder sb = new StringBuilder((string)values[0]);
- for (int i=1; i<max; i++){
- sb.Append(separator);
- sb.Append(values[i]);
- }
-
- return sb.ToString();
- }
-
-
- /// <summary>SDK: Gets the key at the specified index of the NameValueCollection.</summary>
- public virtual string GetKey( int index )
- {
- return BaseGetKey(index);
- }
-
-
- /// <summary>SDK: Gets the values at the specified index of the NameValueCollection.</summary>
-
- public virtual string[] GetValues( int index )
- {
- ArrayList values = (ArrayList)BaseGet(index);
-
- return AsStringArray(values);
- }
-
-
- public virtual string[] GetValues( string name )
- {
- ArrayList values = (ArrayList)BaseGet(name);
-
- return AsStringArray(values);
- }
-
- private static string[] AsStringArray(ArrayList values)
- {
- if (values == null)
- return null;
- int max = values.Count;//get_Count();
- if (max==0)
- return null;
-
- string[] valArray =new string[max];
- values.CopyTo(valArray);
- return valArray;
- }
-
-
- /// <summary>
- /// SDK: Gets a value indicating whether the NameValueCollection contains keys that
- /// are not a null reference
- /// </summary>
-
- public bool HasKeys()
- {
- return BaseHasKeys();
- }
-
- public virtual void Remove( string name )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- InvalidateCachedArrays();
- BaseRemove(name);
-
- }
-
- /// <summary>
- /// Sets the value of an entry in the NameValueCollection.
- /// </summary>
- public virtual void Set( string name, string value )
- {
- if (this.IsReadOnly)
- throw new NotSupportedException("Collection is read-only");
- InvalidateCachedArrays();
-
- ArrayList values = new ArrayList();
- values.Add(value);
- BaseSet(name,values);
-
- }
-
-
-//---------------------- Protected Instance Methods ----------------------
-
- protected void InvalidateCachedArrays()
- {
- cachedAllKeys = null;
- cachedAll = null;
- }
-
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/StringCollection.cs b/mcs/class/System/System.Collections.Specialized/StringCollection.cs
deleted file mode 100755
index 120468812f2..00000000000
--- a/mcs/class/System/System.Collections.Specialized/StringCollection.cs
+++ /dev/null
@@ -1,293 +0,0 @@
-/* System.Collections.Specialized.StringCollection.cs
- * Authors:
- * John Barnette (jbarn@httcb.net)
- * Sean MacIsaac (macisaac@ximian.com)
- *
- * Copyright (C) 2001 John Barnette
- * (C) Ximian, Inc. http://www.ximian.com
- *
- * NOTES:
- * I bet Microsoft uses ArrayList as a backing store for this; I wonder what
- * the performance difference will be.
-*/
-
-using System;
-
-namespace System.Collections.Specialized {
- [Serializable]
- public class StringCollection : IList, ICollection, IEnumerable {
- private static int InitialCapacity = 11;
- private static float CapacityMultiplier = 2.0f;
-
- private int count;
- private int modCount;
-
- private string[] entries;
-
- // Public Constructor
- public StringCollection() {
- entries = new string[InitialCapacity];
- count = 0;
- modCount = 0;
- }
-
- // Public Instance Properties
- public int Count {
- get { return count; }
- }
-
- public bool IsFixedSize {
- get { return false; }
- }
-
- public bool IsReadOnly {
- get { return false; }
- }
-
- public bool IsSynchronized {
- get { return false; }
- }
-
- object IList.this[int index] {
- get { return this[index]; }
- set { this[index] = value.ToString(); }
- }
-
- public string this[int index] {
- get {
- if (index < 0 || index >= count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- return entries[index];
- }
-
- set {
- if (index < 0 || index >= count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- modCount++;
- entries[index] = value;
- }
- }
-
- public object SyncRoot {
- get { return this; }
- }
-
-
- // Public Instance Methods
-
- int IList.Add(object value) {
- return Add(value.ToString());
- }
-
- public int Add(string value) {
- modCount++;
- Resize(count + 1);
- int index = count++;
- entries[index] = value;
-
- return index;
- }
-
- public void AddRange(string[] value) {
- int numEntries = value.Length;
-
- modCount++;
- Resize(count + numEntries);
- Array.Copy(value, 0, entries, count, numEntries);
- count += numEntries;
- }
-
- public void Clear() {
- modCount++;
- count = 0;
- }
-
- bool IList.Contains(object value) {
- return Contains(value.ToString());
- }
-
- public bool Contains(string value) {
- foreach (string entry in entries) {
- if (value.Equals(entry)) {
- return true;
- }
- }
-
- return false;
- }
-
- void ICollection.CopyTo(Array array, int index) {
- if (array == null) {
- throw new ArgumentNullException("array");
- } else if (index < 0) {
- throw new ArgumentOutOfRangeException("index");
- } else if (array.Rank > 1) {
- throw new ArgumentException("array");
- } else if (index >= array.Length) {
- throw new ArgumentException("index");
- } else if (array.Length - index < count) {
- throw new ArgumentException("array");
- }
-
- Array.Copy(entries, 0, array, index, count);
- }
-
- public void CopyTo(string[] array, int index) {
- if (array == null) {
- throw new ArgumentNullException("array");
- } else if (index < 0) {
- throw new ArgumentOutOfRangeException("index");
- } else if (array.Rank > 1) {
- throw new ArgumentException("array");
- } else if (index >= array.Length) {
- throw new ArgumentException("index");
- } else if (array.Length - index < count) {
- throw new ArgumentException("array");
- }
-
- Array.Copy(entries, 0, array, index, count);
- }
-
- IEnumerator IEnumerable.GetEnumerator() {
- return new InternalEnumerator(this);
- }
-
- public StringEnumerator GetEnumerator() {
- return new StringEnumerator(this);
- }
-
- int IList.IndexOf(object value) {
- return IndexOf(value.ToString());
- }
-
- public int IndexOf(string value) {
- for (int i = 0; i < count; i++) {
- if (value.Equals(entries[i])) {
- return i;
- }
- }
-
- return -1;
- }
-
- void IList.Insert(int index, object value) {
- Insert(index, value.ToString());
- }
-
- public void Insert(int index, string value) {
- if (index < 0 || index > count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- modCount++;
- Resize(count + 1);
- Array.Copy(entries, index, entries, index + 1, count - index);
- entries[index] = value;
- count++;
- }
-
-
- void IList.Remove(object value) {
- Remove(value.ToString());
- }
-
- public void Remove(string value) {
- for (int i = 0; i < count; i++) {
- if (value.Equals(entries[i])) {
- RemoveAt(i);
- return;
- }
- }
- }
-
- public void RemoveAt(int index) {
- if (index < 0 || index >= count) {
- throw new ArgumentOutOfRangeException("index");
- }
-
- int remaining = count - index - 1;
-
- modCount++;
-
- if (remaining > 0) {
- Array.Copy(entries, index + 1, entries, index, remaining);
- }
-
- count--;
- entries[count] = null;
- }
-
-
- // Private Instance Methods
-
- private void Resize(int minSize) {
- int oldSize = entries.Length;
-
- if (minSize > oldSize) {
- string[] oldEntries = entries;
- int newSize = (int) (oldEntries.Length * CapacityMultiplier);
-
- if (newSize < minSize) newSize = minSize;
- entries = new string[newSize];
- Array.Copy(oldEntries, 0, entries, 0, count);
- }
- }
-
-
- // Private classes
-
- private class InternalEnumerator : IEnumerator {
- private StringCollection data;
- private int index;
- private int myModCount;
-
- public InternalEnumerator(StringCollection data) {
- this.data = data;
- myModCount = data.modCount;
- index = -1;
- }
-
-
- // Public Instance Properties
-
- public object Current {
- get {
- if (myModCount != data.modCount) {
- throw new InvalidOperationException();
- } else if (index < 0 || index > data.count - 1) {
- throw new InvalidOperationException();
- }
-
- return data[index];
- }
- }
-
-
- // Public Instance Methods
-
- public bool MoveNext() {
- if (myModCount != data.modCount) {
- throw new InvalidOperationException();
- }
-
- if (++index >= data.count - 1) {
- return false;
- }
-
- return true;
- }
-
- public void Reset() {
- if (myModCount != data.modCount) {
- throw new InvalidOperationException();
- }
-
- index = -1;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Collections.Specialized/StringDictionary.cs b/mcs/class/System/System.Collections.Specialized/StringDictionary.cs
deleted file mode 100644
index 2e5bc2bfe10..00000000000
--- a/mcs/class/System/System.Collections.Specialized/StringDictionary.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-namespace System.Collections.Specialized
-{
- public class StringDictionary : IEnumerable
- {
- protected Hashtable table;
-
- public StringDictionary()
- {
- table = new Hashtable();
- }
-
- // Public Instance Properties
-
- public virtual int Count
- {
- get {
- return table.Count;
- }
- }
-
- public virtual bool IsSynchronized
- {
- get {
- return false;
- }
- }
-
- public virtual string this[string key]
- {
- get {
- return (string) table[key.ToLower()];
- }
-
- set {
- table[key.ToLower()] = value;
- }
- }
-
- public virtual ICollection Keys
- {
- get {
- return table.Keys;
- }
- }
-
- public virtual ICollection Values
- {
- get {
- return table.Values;
- }
- }
-
- public virtual object SyncRoot
- {
- get {
- return table.SyncRoot;
- }
- }
-
- // Public Instance Methods
-
- public virtual void Add(string key, string value)
- {
- table.Add(key.ToLower(), value);
- }
-
- public virtual void Clear()
- {
- table.Clear();
- }
-
- public virtual bool ContainsKey(string key)
- {
- return table.ContainsKey(key.ToLower());
- }
-
- public virtual bool ContainsValue(string value)
- {
- return table.ContainsValue(value);
- }
-
- public virtual void CopyTo(Array array, int index)
- {
- table.CopyTo(array, index);
- }
-
- public virtual IEnumerator GetEnumerator()
- {
- return table.GetEnumerator();
- }
-
- public virtual void Remove(string key)
- {
- table.Remove(key.ToLower());
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Collections.Specialized/StringEnumerator.cs b/mcs/class/System/System.Collections.Specialized/StringEnumerator.cs
deleted file mode 100644
index 8be9d7c5a6e..00000000000
--- a/mcs/class/System/System.Collections.Specialized/StringEnumerator.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* System.Collections.Specialized.StringEnumerator.cs
- * Authors:
- * John Barnette (jbarn@httcb.net)
- *
- * Copyright (C) 2001 John Barnette
-*/
-
-namespace System.Collections.Specialized {
- public class StringEnumerator {
- private StringCollection coll;
- private IEnumerator enumerable;
-
- // assembly-scoped constructor
- internal StringEnumerator(StringCollection coll) {
- this.coll = coll;
- this.enumerable = ((IEnumerable)coll).GetEnumerator();
- }
-
- // Public Instance Properties
-
- public string Current {
- get { return (string) enumerable.Current; }
- }
-
-
- // Public Instance Methods
-
- public bool MoveNext() {
- return enumerable.MoveNext();
- }
-
- public void Reset() {
- enumerable.Reset();
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/AttributeCollection.cs b/mcs/class/System/System.ComponentModel/AttributeCollection.cs
deleted file mode 100644
index 4a8c5c7664e..00000000000
--- a/mcs/class/System/System.ComponentModel/AttributeCollection.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.ComponentModel.AttributeCollection.cs
-//
-// Author: Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.ComponentModel
-{
- public class AttributeCollection : ICollection, IEnumerable
- {
- private ArrayList attrList;
- public static readonly AttributeCollection Empty;
-
- public AttributeCollection (Attribute[] attributes) {
- for (int i = 0; i < attributes.Length; i++)
- attrList.Add (attributes[i]);
- }
-
- public bool Contains (Attribute attr) {
- for (int i = 0; i < attrList.Count; i++) {
- if (attrList[i] == attr)
- return true;
- }
-
- return false;
- }
-
- [MonoTODO]
- public bool Contains (Attribute[] attributes) {
- throw new NotImplementedException ();
- }
-
- public void CopyTo (Array array, int index) {
- attrList.CopyTo (array, index);
- }
-
- public IEnumerator GetEnumerator () {
- return attrList.GetEnumerator ();
- }
-
- [MonoTODO]
- public bool Matches (Attribute attr) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool Matches (Attribute[] attributes) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected Attribute GetDefaultAttribute (Type attributeType) {
- throw new NotImplementedException ();
- }
-
- public bool IsSynchronized {
- get {
- return attrList.IsSynchronized;
- }
- }
-
- public object SyncRoot {
- get {
- return attrList.SyncRoot;
- }
- }
-
- public int Count {
- get {
- return attrList.Count;
- }
- }
-
- public virtual Attribute this[Type type] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual Attribute this[int index] {
- get {
- return (Attribute) attrList[index];
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/BrowsableAttribute.cs b/mcs/class/System/System.ComponentModel/BrowsableAttribute.cs
deleted file mode 100755
index e56beb2f809..00000000000
--- a/mcs/class/System/System.ComponentModel/BrowsableAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ComponentModel.BrowsableAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
- public sealed class BrowsableAttribute : Attribute {
- bool browsable;
-
- public static readonly BrowsableAttribute No;
- public static readonly BrowsableAttribute Yes;
-
- static BrowsableAttribute ()
- {
- No = new BrowsableAttribute (false);
- Yes = new BrowsableAttribute (false);
- }
-
- public BrowsableAttribute (bool browsable)
- {
- this.browsable = browsable;
- }
-
- public bool Browsable {
- get {
- return browsable;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/CategoryAttribute.cs b/mcs/class/System/System.ComponentModel/CategoryAttribute.cs
deleted file mode 100755
index c68b49cda50..00000000000
--- a/mcs/class/System/System.ComponentModel/CategoryAttribute.cs
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// System.ComponentModel.CategoryAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
- public class CategoryAttribute : Attribute {
- string category;
-
- static CategoryAttribute action, appearance, behaviour, data, def;
- static CategoryAttribute design, drag_drop, focus, format, key;
- static CategoryAttribute layout, mouse, window_style;
-
- public CategoryAttribute (string category)
- {
- this.category = category;
- }
-
- public CategoryAttribute ()
- {
- this.category = "Misc";
- }
-
- [MonoTODO]
- protected virtual string GetLocalizedString (string value)
- {
- // FIXME: IMPLEMENT
-
- return category;
- }
-
- public string Category {
- get {
- return category;
- }
- }
-
- public static CategoryAttribute Action {
- get {
- if (action != null)
- return action;
-
- lock (typeof (CategoryAttribute)){
- if (action == null)
- action = new CategoryAttribute ("Action");
- }
-
- return action;
- }
- }
-
- public static CategoryAttribute Appearance {
- get {
- if (appearance != null)
- return appearance;
-
- lock (typeof (CategoryAttribute)){
- if (appearance == null)
- appearance = new CategoryAttribute ("Appearance");
- }
-
- return appearance;
- }
- }
-
- public static CategoryAttribute Behaviour {
- get {
- if (behaviour != null)
- return behaviour;
-
- lock (typeof (CategoryAttribute)){
- if (behaviour == null)
- behaviour = new CategoryAttribute ("Action");
- }
-
- return behaviour;
- }
- }
-
- public static CategoryAttribute Data {
- get {
- if (data != null)
- return data;
-
- lock (typeof (CategoryAttribute)){
- if (data == null)
- data = new CategoryAttribute ("Data");
- }
-
- return data;
- }
- }
-
- public static CategoryAttribute Default {
- get {
- if (def != null)
- return def;
-
- lock (typeof (CategoryAttribute)){
- if (def == null)
- def = new CategoryAttribute ("Default");
- }
-
- return def;
- }
- }
-
- public static CategoryAttribute Design {
- get {
- if (design != null)
- return design;
-
- lock (typeof (CategoryAttribute)){
- if (design == null)
- design = new CategoryAttribute ("Design");
- }
-
- return design;
- }
- }
-
- public static CategoryAttribute DragDrop {
- get {
- if (drag_drop != null)
- return drag_drop;
-
- lock (typeof (CategoryAttribute)){
- if (drag_drop == null)
- drag_drop = new CategoryAttribute ("Drag Drop");
- }
-
- return drag_drop;
- }
- }
-
- public static CategoryAttribute Focus {
- get {
- if (focus != null)
- return focus;
-
- lock (typeof (CategoryAttribute)){
- if (focus == null)
- focus = new CategoryAttribute ("Focus");
- }
-
- return focus;
- }
- }
-
- public static CategoryAttribute Format {
- get {
- if (format != null)
- return format;
-
- lock (typeof (CategoryAttribute)){
- if (format == null)
- format = new CategoryAttribute ("Format");
- }
-
- return format;
- }
- }
-
- public static CategoryAttribute Key {
- get {
- if (key != null)
- return key;
-
- lock (typeof (CategoryAttribute)){
- if (key == null)
- key = new CategoryAttribute ("Key");
- }
-
- return key;
- }
- }
-
- public static CategoryAttribute Layout {
- get {
- if (layout != null)
- return layout;
-
- lock (typeof (CategoryAttribute)){
- if (layout == null)
- layout = new CategoryAttribute ("Layout");
- }
-
- return layout;
- }
- }
-
- public static CategoryAttribute Mouse {
- get {
- if (mouse != null)
- return mouse;
-
- lock (typeof (CategoryAttribute)){
- if (mouse == null)
- mouse = new CategoryAttribute ("Mouse");
- }
-
- return mouse;
- }
- }
-
- public static CategoryAttribute WindowStyle {
- get {
- if (window_style != null)
- return window_style;
-
- lock (typeof (CategoryAttribute)){
- if (window_style == null)
- window_style = new CategoryAttribute ("Window Style");
- }
-
- return window_style;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ChangeLog b/mcs/class/System/System.ComponentModel/ChangeLog
deleted file mode 100644
index d37e3b5f2dc..00000000000
--- a/mcs/class/System/System.ComponentModel/ChangeLog
+++ /dev/null
@@ -1,165 +0,0 @@
-2002-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * TypeConverter.cs: flushed local changes.
-
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * StringConverter.cs: stubbed out.
- * TypeConverter.cs: stubbed the rest out and added some implementation.
-
- Five errors left when compiling System.Web in linux.
-
-2002-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * TypeConverterAttribute.cs: attribute used by
- TypeDescriptor.Getconverter ().
-
- * TypeDescriptor.cs: implemented GetConverter in the right way.
-
-2002-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * TypeConverter.cs:
- * ITypeDescriptorContext.cs:
- * TypeDescriptor.cs: implemented minimal set of features needed by xsp,
- which uses ColorConverter.
-
-2002-05-12 Daniel Morgan <danmorg@sc.rr.com>
-
- * IComponent.cs
- * ISite.cs: added using System
-
- * MarshalByValueComponent.cs: changed all throwing of Not ImplementedException
- to // TODOs and added using System. The throwing of the exceptions prevented
- System.Data from running.
-
-2002-05-10 Rodrigo Moya <rodrigo@ximian.com>
-
- * EventDescriptorCollection.cs (this[index]): call eventList[index],
- not this[index], which issues an 'ambigous call' error on Linux.
-
-2002-05-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * EventDescriptor.cs: added missing constructors.
-
- * EventDescriptorCollection.cs: fixed interface methods implementation
-
- * IDataErrorInfo.cs:
- * IEditableObject.cs: new interfaces.
-
-2002-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.ComponentModel/AttributeCollection.cs: added a cast to make
- it compile.
-
-2002-05-03 Rodrigo Moya <rodrigo@ximian.com>
-
- * AttributeCollection.cs:
- * EventDescriptor.cs:
- * EventDescriptorCollection.cs:
- * ICustomTypeDescriptor.cs: new files.
-
-2002-05-01 Duncan Mak <duncan@ximian.com>
-
- * ListChangedType.cs:
- * ListChangedEventHandler.cs:
- * ListChangedEventArgs.cs: Added to fix build.
-
-2002-05-01 Miguel de Icaza <miguel@ximian.com>
-
- * PropertyDescriptorCollection.cs: Added the IList explicit
- implementation methods.
-
- lots of bug fixes to get the build to compile again.
-
-2002-05-01 Duncan Mak <duncan@ximian.com>
-
- * ListSortDirection.cs: EnumChecked.
-
-2002-05-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * ListSortDirection.cs: new enumeration. Please, somebody run
- EnumCheck on it, as I don't have a windows machine.
-
- * PropertyDescriptorCollection.cs: new class.
-
- * ITypedList.cs:
- * IBindingList.cs: new interfaces.
-
-2002-04-28 Duncan Mak <duncan@ximian.com>
-
- * CollectionChangeAction.cs: Changed enum layout to fit the MS
- implementation. Please use EnumCheck!
-
-2002-04-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * CollectionChangeAction.cs: new enumeration.
-
- * CategoryAttribute.cs: moved the 'return' keyword to the
- end of the method, to avoid compilation errors on Linux for
- all CategoryAttribute properties.
-
-2002-04-28 Rodrigo Moya <rodrigo@ximian.com>
-
- * IListSource.cs:
- * ISupportInitialize.cs:
- * MarshalByValueComponent.cs: new stubs, needed for System.Data
- compilation.
-
- * PropertyChangedEventArgs.cs:
- * CollectionChangeEventHandler.cs:
- * CollectionChangeEventArgs.cs: implemented.
-
-2002-04-28 Lawrence Pit <loz@cable.a2000.nl>
-
- * Added error code 11001 to Win32Exception, used by Dns.c
-
-2002-04-04 Dick Porter <dick@ximian.com>
-
- * ISynchronizeInvoke.cs: Needed by Process
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * Win32Exception.cs: implement, with support for looking up
- runtime errors.
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * Win32Exception.cs: Add.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * CategoryAttribute.cs, Component.cs, ComponentCollection.cs: MonoTODO.
-
- * Container.cs, MemberDescriptor.cs, PropertyDescriptor.cs : Ditto.
-
-2001-10-27 Miguel de Icaza <miguel@ximian.com>
-
- * DesignerSerializationVisibilityAttribute.cs: Implemented.
-
- * DesignerSerializationVisibility.cs: New enumeration.
-
- * LocalizableAttribute.cs: Implemented.
-
- * BrowsableAttribute.cs: Implemented.
-
- * DesignOnlyAttribute.cs: Implemented.
-
- * DescriptionAttribute.cs: Implement.
-
- * MemberDescriptor.cs: Implemented.
-
- * CategoryAttribute.cs: implemented.
-
-2001-08-21 Nick Drochak <ndrochak@gol.com>
-
- * Component.cs: Eliminated compile errors by removing redundant fields and
- using the ISite member instead. Also raised the Disposed event, but not
- sure if it's correct now. Look for FIXME in the comments.
-
-2001-08-02 Miguel de Icaza <miguel@ximian.com>
-
- * EventHandlerList.cs: New file.
-
- * Container.cs, Component.cs, IContainer.cs, IComponent.cs,
- ComponentCollection.cs, ISite.cs: New classes
-
diff --git a/mcs/class/System/System.ComponentModel/CollectionChangeAction.cs b/mcs/class/System/System.ComponentModel/CollectionChangeAction.cs
deleted file mode 100644
index 640e36e11ae..00000000000
--- a/mcs/class/System/System.ComponentModel/CollectionChangeAction.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.ComponentModel.CollectionChangeAction.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Specifies how the collection is changed.
- /// </summary>
- public enum CollectionChangeAction {
- Add = 1,
- Remove = 2,
- Refresh = 3
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/CollectionChangeEventArgs.cs b/mcs/class/System/System.ComponentModel/CollectionChangeEventArgs.cs
deleted file mode 100644
index 6ace57b02b7..00000000000
--- a/mcs/class/System/System.ComponentModel/CollectionChangeEventArgs.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ComponentModel.CollectionChangeEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Provides data for the CollectionChanged event.
- /// </summary>
- public class CollectionChangeEventArgs : EventArgs
- {
- private CollectionChangeAction changeAction;
- private object theElement;
-
- public CollectionChangeEventArgs (CollectionChangeAction action,
- object element) {
- changeAction = action;
- theElement = element;
- }
-
- public virtual CollectionChangeAction Action {
- get {
- return changeAction;
- }
- }
-
- public virtual object Element {
- get {
- return theElement;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/CollectionChangeEventHandler.cs b/mcs/class/System/System.ComponentModel/CollectionChangeEventHandler.cs
deleted file mode 100644
index 6194af6f11e..00000000000
--- a/mcs/class/System/System.ComponentModel/CollectionChangeEventHandler.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.ComponentModel.CollectionChangeEventHandler.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-namespace System.ComponentModel
-{
- public delegate void CollectionChangeEventHandler (object sender,
- CollectionChangeEventArgs e);
-}
diff --git a/mcs/class/System/System.ComponentModel/Component.cs b/mcs/class/System/System.ComponentModel/Component.cs
deleted file mode 100644
index 37649d05e8f..00000000000
--- a/mcs/class/System/System.ComponentModel/Component.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// System.ComponentModel.Component.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.ComponentModel {
-
- // <summary>
- // Component class.
- // </summary>
- //
- // <remarks>
- // Longer description
- // </remarks>
- public class Component : MarshalByRefObject, IComponent, IDisposable {
-
- EventHandlerList event_handlers;
- ISite mySite;
-
- // <summary>
- // Component Constructor
- // </summary>
- public Component ()
- {
- event_handlers = null;
- }
-
- // <summary>
- // Get IContainer of this Component
- // </summary>
- public IContainer Container {
- get {
- return mySite.Container;
- }
- }
-
- protected bool DesignMode {
- get {
- return mySite.DesignMode;
- }
- }
-
- protected EventHandlerList Events {
- get {
- // Note: space vs. time tradeoff
- // We create the object here if it's never be accessed before. This potentially
- // saves space. However, we must check each time the propery is accessed to
- // determine whether we need to create the object, which increases overhead.
- // We could put the creation in the contructor, but that would waste space
- // if it were never used. However, accessing this property would be faster.
- if (null == event_handlers)
- {
- event_handlers = new EventHandlerList();
- }
- return event_handlers;
- }
- }
-
- public virtual ISite Site {
- get {
- return mySite;
- }
-
- set {
- mySite = value;
- }
- }
-
- [MonoTODO]
- ~Component()
- {
- // FIXME: Not sure this is correct.
- Dispose(true);
- Disposed(this, EventArgs.Empty);
- }
-
- // <summary>
- // Dispose resources used by this component
- // </summary>
- [MonoTODO]
- public virtual void Dispose ()
- {
- // FIXME: Not sure this is correct.
- Dispose(false);
- Disposed(this, EventArgs.Empty);
- }
-
- // <summary>
- // Controls disposal of resources used by this.
- // </summary>
- //
- // <param name="release_all"> Controls which resources are released</param>
- //
- // <remarks>
- // if release_all is set to true, both managed and unmanaged
- // resources should be released. If release_all is set to false,
- // only unmanaged resources should be disposed
- // </remarks>
- protected virtual void Dispose (bool release_all)
- {
- }
-
- // <summary>
- // Implements the IServiceProvider interface
- // </summary>
- [MonoTODO]
- protected virtual object GetService (Type service)
- {
- // FIXME: Not sure what this should do.
- return null;
- }
-
- // <summary>
- // FIXME: Figure out this one.
- // </summary>
- [MonoTODO ("Figure this out")]
- public event EventHandler Disposed;
- }
-
-}
diff --git a/mcs/class/System/System.ComponentModel/ComponentCollection.cs b/mcs/class/System/System.ComponentModel/ComponentCollection.cs
deleted file mode 100644
index 90fb081887d..00000000000
--- a/mcs/class/System/System.ComponentModel/ComponentCollection.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.ComponentModel.ComponentCollection.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- [MonoTODO]
- public class ComponentCollection { // FIXME: ReadOnlyCollectionBase
-
- public void Dispose ()
- {
- }
-
- }
-}
-
diff --git a/mcs/class/System/System.ComponentModel/Container.cs b/mcs/class/System/System.ComponentModel/Container.cs
deleted file mode 100644
index f1b6b58abb6..00000000000
--- a/mcs/class/System/System.ComponentModel/Container.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-//
-// System.ComponentModel.Container.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- // <summary>
- // Container class: encapsulates components.
- // </summary>
- //
- // <remarks>
- //
- // </remarks>
- public class Container : IContainer, IDisposable {
- ComponentCollection cc;
-
- // <summary>
- // Auxiliary class to support the default behaviour of CreateSite
- // </summary>
- //
- // <remarks>
- // This is an internal class that is used to provide a
- // default implementation of an ISite class. Container
- // is just a default implementation of IContainer, and
- // provides this as a way of getting started
- // </remarks>
-
- class DefaultSite : ISite {
- IComponent component;
- IContainer container;
- string name;
-
- public DefaultSite (string name, IComponent component, IContainer container)
- {
- this.component = component;
- this.container = container;
- this.name = name;
- }
-
- public IComponent Component {
- get {
- return component;
- }
- }
-
- public IContainer Container {
- get {
- return container;
- }
- }
-
- [MonoTODO]
- public bool DesignMode {
- get {
- // FIXME: should we provide a way to set
- // this value?
- return false;
- }
- }
-
- public string Name {
- get {
- return name;
- }
-
- set {
- name = value;
- }
- }
-
- [MonoTODO]
- public virtual object GetService (Type t)
- {
- // FIXME: do not know what this is supposed to do.
- return null;
- }
- }
-
- // <summary>
- // Container constructor
- // </summary>
- public Container ()
- {
- }
-
- public virtual ComponentCollection Components {
- get {
- return cc;
- }
- }
-
- // <summary>
- // Adds an IComponent to the Container
- // </summary>
- [MonoTODO]
- public virtual void Add (IComponent component)
- {
- // FIXME: Add this component to the ComponentCollection.cc
- }
-
- // <summary>
- // Adds an IComponent to the Container. With a name binding.
- // </summary>
- [MonoTODO]
- public virtual void Add (IComponent component, string name)
- {
- // FIXME: Add this component to the ComponentCollection.cc
- }
-
- // <summary>
- // Returns an ISite for a component.
- // <summary>
- protected virtual ISite CreateSite (IComponent component, string name)
- {
- return new DefaultSite (name, component, this);
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- bool disposed = false;
-
- protected virtual void Dispose (bool release_all)
- {
- if (disposed)
- return;
-
- if (release_all){
- cc.Dispose ();
- cc = null;
- }
-
- disposed = true;
- }
-
- [MonoTODO]
- protected virtual object GetService (Type service)
- {
- // FIXME: Not clear what GetService does.
-
- return null;
- }
-
- [MonoTODO]
- public virtual void Remove (IComponent component)
- {
- // FIXME: Add this component to the ComponentCollection.cc
- }
- }
-
-}
diff --git a/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs b/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs
deleted file mode 100755
index 43dfae241ec..00000000000
--- a/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-using System;
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Specifies the default value for a property.
- /// </summary>
-
- [MonoTODO("Needs testing. DefaultValueAttribute(System.Type type, string value) is not implemented. Value has no description.")]
- [AttributeUsage(AttributeTargets.Parameter)]
- public sealed class DefaultValueAttribute : Attribute
- {
-
- private object defaultValue;
-
- /// <summary>
- /// FIXME: Summary description for Value.
- /// </summary>
- public object Value
- {
- get
- {
- return defaultValue;
- }
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class.
- /// </summary>
- /// <param name="value">An System.Object that represents the default value.</param>
- public DefaultValueAttribute(object value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a System.Boolean value.
- /// </summary>
- /// <param name="value">An System.Boolean that represents the default value.</param>
- public DefaultValueAttribute(bool value)
- {
- defaultValue = value;
- }
-
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using an 8-bit unsigned integer.
- /// </summary>
- /// <param name="value">An 8-bit unsigned integer that is the default value.</param>
- public DefaultValueAttribute(byte value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a Unicode character.
- /// </summary>
- /// <param name="value">A Unicode character that is the default value.</param>
- public DefaultValueAttribute(char value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a double-precision floating point number.
- /// </summary>
- /// <param name="value">A double-precision floating point number that is the default value.</param>
- public DefaultValueAttribute(double value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 32-bit signed integer.
- /// </summary>
- /// <param name="value">A 32-bit signed integer that is the default value.</param>
- public DefaultValueAttribute(int value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 64-bit signed integer.
- /// </summary>
- /// <param name="value">A 64-bit signed integer that is the default value.</param>
- public DefaultValueAttribute(long value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 16-bit signed integer.
- /// </summary>
- /// <param name="value">A 16-bit signed integer that is the default value.</param>
- public DefaultValueAttribute(short value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a single-precision floating point number.
- /// </summary>
- /// <param name="value">A single-precision floating point number that is the default value.</param>
- public DefaultValueAttribute(System.Single value)
- {
- defaultValue = value;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a System.String.
- /// </summary>
- /// <param name="value">A System.String that is the default value.</param>
- public DefaultValueAttribute(string value)
- {
- defaultValue = value;
- }
-
- /*
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class, converting the specified value to the specified type, and using an invariant culture as the translation context.
- /// </summary>
- /// <param name="type">A System.Type that represents the type to convert the value to.</param>
- /// <param name="value">A System.String that can be converted to the type using the System.ComponentModel.TypeConverter for the type and the U.S. English culture.</param>
- public DefaultValueAttribute(System.Type type, string value)
- {
- //FIXME
- throw new NotImplementedException();
- }
- */
- }
-
-}
-
diff --git a/mcs/class/System/System.ComponentModel/DescriptionAttribute.cs b/mcs/class/System/System.ComponentModel/DescriptionAttribute.cs
deleted file mode 100755
index 03e6f411d78..00000000000
--- a/mcs/class/System/System.ComponentModel/DescriptionAttribute.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.ComponentModel.DescriptionAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Event)]
- public class DescriptionAttribute : Attribute {
- string desc;
-
- public DescriptionAttribute (string name)
- {
- desc = name;
- }
-
- public DescriptionAttribute ()
- {
- desc = "";
- }
-
- public virtual string Description {
- get {
- return DescriptionValue;
- }
- }
-
- //
- // Notice that the default Description implementation uses this by default
- //
- protected string DescriptionValue {
- get {
- return desc;
- }
-
- set {
- desc = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs b/mcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs
deleted file mode 100755
index 81b39db62f1..00000000000
--- a/mcs/class/System/System.ComponentModel/DesignOnlyAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.ComponentModel.DesignOnlyAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property)]
- public sealed class DesignOnlyAttribute : Attribute {
- bool design_only;
-
- public static readonly DesignOnlyAttribute No;
- public static readonly DesignOnlyAttribute Yes;
-
- static DesignOnlyAttribute ()
- {
- No = new DesignOnlyAttribute (false);
- Yes = new DesignOnlyAttribute (false);
- }
-
- public DesignOnlyAttribute (bool design_only)
- {
- this.design_only = design_only;
- }
-
- public bool IsDesignOnly {
- get {
- return design_only;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs b/mcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs
deleted file mode 100755
index d4291a842c8..00000000000
--- a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibility.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.ComponentModel.DesignerSerializationVisibility.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- public enum DesignerSerializationVisibility {
- Hidden, Visible, Content
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs b/mcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs
deleted file mode 100755
index fd2fffec348..00000000000
--- a/mcs/class/System/System.ComponentModel/DesignerSerializationVisibilityAttribute.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.ComponentModel.DesignerSerializationVisibilityAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property)]
- public sealed class DesignerSerializationVisibilityAttribute : Attribute {
- DesignerSerializationVisibility visibility;
-
- static DesignerSerializationVisibilityAttribute ()
- {
- Content = new DesignerSerializationVisibilityAttribute (
- DesignerSerializationVisibility.Content);
- Hidden = new DesignerSerializationVisibilityAttribute (
- DesignerSerializationVisibility.Hidden);
- Visible = new DesignerSerializationVisibilityAttribute (
- DesignerSerializationVisibility.Visible);
- }
-
- public DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility vis)
- {
- visibility = vis;
- }
-
- public static readonly DesignerSerializationVisibilityAttribute Content;
- public static readonly DesignerSerializationVisibilityAttribute Hidden;
- public static readonly DesignerSerializationVisibilityAttribute Visible;
-
- public DesignerSerializationVisibility Visibility {
- get {
- return visibility;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/EditorBrowsableAttribute.cs b/mcs/class/System/System.ComponentModel/EditorBrowsableAttribute.cs
deleted file mode 100755
index 912cdb13eed..00000000000
--- a/mcs/class/System/System.ComponentModel/EditorBrowsableAttribute.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-
-namespace System.ComponentModel
-{
-
- /// <summary>
- /// Specifies that a property or method is viewable in an editor. This class cannot be inherited.
- /// </summary>
- [MonoTODO("Missing description for State. Only minimal testing.")]
- [AttributeUsage(
- AttributeTargets.Class|
- AttributeTargets.Constructor|
- AttributeTargets.Delegate|
- AttributeTargets.Enum|
- AttributeTargets.Event|
- AttributeTargets.Field|
- AttributeTargets.Interface|
- AttributeTargets.Method|
- AttributeTargets.Property|
- AttributeTargets.Struct)]
- public sealed class EditorBrowsableAttribute : Attribute
- {
- private System.ComponentModel.EditorBrowsableState state;
-
- /// <summary>
- /// FIXME: Summary description for State.
- /// </summary>
- public System.ComponentModel.EditorBrowsableState State
- {
- get
- {
- return state;
- }
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.EditorBrowsableAttribute class with an System.ComponentModel.EditorBrowsableState.
- /// </summary>
- /// <param name="state">The System.ComponentModel.EditorBrowsableState to set System.ComponentModel.EditorBrowsableAttribute.State to.</param>
- public EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState state)
- {
- this.state = state;
- }
-
- /// <summary>
- /// Initializes a new instance of the System.ComponentModel.EditorBrowsableAttribute class with an System.ComponentModel.EditorBrowsableState == System.ComponentModel.EditorBrowsableState.Always.
- /// </summary>
- public EditorBrowsableAttribute()
- {
- this.state = System.ComponentModel.EditorBrowsableState.Always;
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/EditorBrowsableState.cs b/mcs/class/System/System.ComponentModel/EditorBrowsableState.cs
deleted file mode 100755
index eab0d651bb8..00000000000
--- a/mcs/class/System/System.ComponentModel/EditorBrowsableState.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// ProjectData.cs
-//
-// Author:
-// Martin Adoue (martin@cwanet.com)
-//
-// (C) 2002 Martin Adoue
-//
-
-using System;
-
-namespace System.ComponentModel
-{
-
- /// <summary>
- /// Specifies the browsable state of a property or method from within an editor.
- /// </summary>
- public enum EditorBrowsableState
- {
- /// <summary>
- /// The property or method is always browsable from within an editor.
- /// </summary>
- Always = 0,
- /// <summary>
- /// The property or method is never browsable from within an editor.
- /// </summary>
- Never = 1,
- /// <summary>
- /// The property or method is a feature that only advanced users should see. An editor can either show or hide such properties.
- /// </summary>
- Advanced = 2
- }
-
-}
diff --git a/mcs/class/System/System.ComponentModel/EventDescriptor.cs b/mcs/class/System/System.ComponentModel/EventDescriptor.cs
deleted file mode 100644
index 211c07dac9d..00000000000
--- a/mcs/class/System/System.ComponentModel/EventDescriptor.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.ComponentModel.EventDescriptor.cs
-//
-// Authors:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-namespace System.ComponentModel
-{
- public abstract class EventDescriptor : MemberDescriptor
- {
- protected EventDescriptor (MemberDescriptor desc) : base (desc)
- {
- }
-
- protected EventDescriptor (MemberDescriptor desc, Attribute[] attrs) : base (desc, attrs)
- {
- }
-
- protected EventDescriptor(string str, Attribute[] attrs) : base (str, attrs)
- {
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs b/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs
deleted file mode 100644
index e122c0b2449..00000000000
--- a/mcs/class/System/System.ComponentModel/EventDescriptorCollection.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// System.ComponentModel.EventDescriptorCollection.cs
-//
-// Author: Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System.Collections;
-
-namespace System.ComponentModel
-{
- public class EventDescriptorCollection : IList, ICollection, IEnumerable
- {
- private ArrayList eventList;
-
- public static readonly EventDescriptorCollection Empty;
-
- public EventDescriptorCollection (EventDescriptor[] events) {
- for (int i = 0; i < events.Length; i++)
- this.Add (events[i]);
- }
-
- public int Add (EventDescriptor value) {
- return eventList.Add (value);
- }
-
- public void Clear () {
- eventList.Clear ();
- }
-
- public bool Contains (EventDescriptor value) {
- return eventList.Contains (value);
- }
-
- [MonoTODO]
- public virtual EventDescriptor Find (string name, bool ignoreCase) {
- throw new NotImplementedException ();
- }
-
- public IEnumerator GetEnumerator () {
- return eventList.GetEnumerator ();
- }
-
- public int IndexOf (EventDescriptor value) {
- return eventList.IndexOf (value);
- }
-
- public void Insert (int index, EventDescriptor value) {
- eventList.Insert (index, value);
- }
-
- public void Remove (EventDescriptor value) {
- eventList.Remove (value);
- }
-
- public void RemoveAt (int index) {
- eventList.RemoveAt (index);
- }
-
-
- [MonoTODO]
- public virtual EventDescriptorCollection Sort () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual EventDescriptorCollection Sort (IComparer comparer) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual EventDescriptorCollection Sort (string[] order) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual EventDescriptorCollection Sort (string[] order,
- IComparer comparer) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual EventDescriptorCollection InternalSort (IComparer comparer) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual EventDescriptorCollection InternalSort (string[] order) {
- throw new NotImplementedException ();
- }
-
- public int Count {
- get {
- return eventList.Count;
- }
- }
-
- public virtual EventDescriptor this[string name] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public virtual EventDescriptor this[int index] {
- get {
- return (EventDescriptor) eventList[index];
- }
- }
-
- // IList methods
-
- int IList.Add (object value) {
- return Add ((EventDescriptor) value);
- }
-
- bool IList.Contains (object value) {
- return Contains ((EventDescriptor) value);
- }
-
- int IList.IndexOf (object value) {
- return IndexOf ((EventDescriptor) value);
- }
-
- void IList.Insert (int index, object value) {
- Insert (index, (EventDescriptor) value);
- }
-
- void IList.Remove (object value) {
- Remove ((EventDescriptor) value);
- }
-
- bool IList.IsFixedSize {
- get { return false; }
- }
-
- bool IList.IsReadOnly {
- get { return false; }
- }
-
- object IList.this[int index] {
- get {
- return eventList[index];
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- // ICollection methods
-
- [MonoTODO]
- void ICollection.CopyTo (Array array, int index) {
- throw new NotImplementedException ();
- }
-
- bool ICollection.IsSynchronized {
- get { return false; }
- }
-
- object ICollection.SyncRoot {
- get { return null; }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/EventHandlerList.cs b/mcs/class/System/System.ComponentModel/EventHandlerList.cs
deleted file mode 100644
index dba45525db5..00000000000
--- a/mcs/class/System/System.ComponentModel/EventHandlerList.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.ComponentModel.EventHandlerList.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-namespace System.ComponentModel {
-
- // <summary>
- // List of Event delegates.
- // </summary>
- //
- // <remarks>
- // Longer description
- // </remarks>
- public sealed class EventHandlerList : IDisposable {
- Hashtable table;
-
- public EventHandlerList ()
- {
- }
-
- public Delegate this [object key] {
- get {
- if (table == null)
- return null;
-
- return (Delegate) table [key];
- }
-
- set {
- if (table == null)
- table = new Hashtable ();
-
- table.Add (key, value);
- }
- }
-
- public void AddHandler (object key, Delegate value)
- {
- if (table == null)
- table = new Hashtable ();
-
- table.Add (key, value);
- }
-
- public void RemoveHandler (object key, Delegate value)
- {
- table.Remove (key);
- }
-
- public void Dispose ()
- {
- table = null;
- }
- }
-
-}
diff --git a/mcs/class/System/System.ComponentModel/IBindingList.cs b/mcs/class/System/System.ComponentModel/IBindingList.cs
deleted file mode 100644
index 8de1b197f17..00000000000
--- a/mcs/class/System/System.ComponentModel/IBindingList.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.ComponentModel.IBindingList.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Collections;
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Provides the features required to support both complex and simple scenarios when binding to a data source.
- /// </summary>
- public interface IBindingList : IList, ICollection, IEnumerable
- {
- void AddIndex (PropertyDescriptor property);
-
- object AddNew ();
-
- void ApplySort (PropertyDescriptor property, ListSortDirection direction);
-
- int Find (PropertyDescriptor property, object key);
-
- void RemoveIndex (PropertyDescriptor property);
-
- void RemoveSort ();
-
- bool AllowEdit {
- get;
- }
-
- bool AllowNew {
- get;
- }
-
- bool AllowRemove {
- get;
- }
-
- bool IsSorted {
- get;
- }
-
- ListSortDirection SortDirection {
- get;
- }
-
- PropertyDescriptor SortProperty {
- get;
- }
-
- bool SupportsChangeNotification {
- get;
- }
-
- bool SupportsSearching {
- get;
- }
-
- bool SupportsSorting {
- get;
- }
-
- event ListChangedEventHandler ListChanged;
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/IComponent.cs b/mcs/class/System/System.ComponentModel/IComponent.cs
deleted file mode 100644
index 347bd2beed7..00000000000
--- a/mcs/class/System/System.ComponentModel/IComponent.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.ComponentModel.IComponent.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.ComponentModel {
-
- public interface IComponent : IDisposable {
-
- ISite Site {
- get; set;
- }
-
- event EventHandler Disposed;
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/IContainer.cs b/mcs/class/System/System.ComponentModel/IContainer.cs
deleted file mode 100644
index fb5d34f1ab6..00000000000
--- a/mcs/class/System/System.ComponentModel/IContainer.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.ComponentModel.IContainer.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- public interface IContainer {
-
- ComponentCollection Components {
- get;
- }
-
- void Add (IComponent component);
-
- void Add (IComponent component, string name);
-
- void Remove (IComponent component);
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ICustomTypeDescriptor.cs b/mcs/class/System/System.ComponentModel/ICustomTypeDescriptor.cs
deleted file mode 100644
index c716355a601..00000000000
--- a/mcs/class/System/System.ComponentModel/ICustomTypeDescriptor.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ComponentModel.ICustomTypeDescriptor.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-// Authors:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-
-namespace System.ComponentModel
-{
- public interface ICustomTypeDescriptor
- {
- AttributeCollection GetAttributes();
-
- string GetClassName();
-
- string GetComponentName();
-
- TypeConverter GetConverter();
-
- EventDescriptor GetDefaultEvent();
-
- PropertyDescriptor GetDefaultProperty();
-
- object GetEditor(Type editorBaseType);
-
- EventDescriptorCollection GetEvents();
-
- EventDescriptorCollection GetEvents(Attribute[] arr);
-
- PropertyDescriptorCollection GetProperties();
-
- PropertyDescriptorCollection GetProperties(Attribute[] arr);
-
- object GetPropertyOwner(PropertyDescriptor pd);
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/IDataErrorInfo.cs b/mcs/class/System/System.ComponentModel/IDataErrorInfo.cs
deleted file mode 100644
index a37627d07ca..00000000000
--- a/mcs/class/System/System.ComponentModel/IDataErrorInfo.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.ComponentModel.IDataErrorInfo.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-// Authors:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-
-namespace System.ComponentModel
-{
- public interface IDataErrorInfo
- {
- string Error { get; }
-
- string this[string columnName] { get; }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/IEditableObject.cs b/mcs/class/System/System.ComponentModel/IEditableObject.cs
deleted file mode 100644
index 40e4d105c17..00000000000
--- a/mcs/class/System/System.ComponentModel/IEditableObject.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.ComponentModel.IEditableObject.cs
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-// Authors:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-
-namespace System.ComponentModel
-{
- public interface IEditableObject
- {
- void BeginEdit();
-
- void CancelEdit();
-
- void EndEdit();
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/IListSource.cs b/mcs/class/System/System.ComponentModel/IListSource.cs
deleted file mode 100644
index f0d27cfec9b..00000000000
--- a/mcs/class/System/System.ComponentModel/IListSource.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.ComponentModel.IListSource.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Collections;
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Provides functionality to an object to return a list that can be bound to a data source.
- /// </summary>
- public interface IListSource
- {
- IList GetList ();
-
- bool ContainsListCollection { get; }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ISite.cs b/mcs/class/System/System.ComponentModel/ISite.cs
deleted file mode 100644
index dca26662b6f..00000000000
--- a/mcs/class/System/System.ComponentModel/ISite.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.ComponentModel.Component.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.ComponentModel {
-
- public interface ISite : IServiceProvider {
- IComponent Component { get; }
-
- IContainer Container { get; }
-
- bool DesignMode { get; }
-
- string Name { get; set; }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ISupportInitialize.cs b/mcs/class/System/System.ComponentModel/ISupportInitialize.cs
deleted file mode 100644
index d5b15f6ee6d..00000000000
--- a/mcs/class/System/System.ComponentModel/ISupportInitialize.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.ComponentModel.ISupportInitialize.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Specifies that this object supports a simple, transacted notification for batch initialization.
- /// </summary>
- public interface ISupportInitialize
- {
- void BeginInit ();
-
- void EndInit ();
- }
-
-}
-
diff --git a/mcs/class/System/System.ComponentModel/ISynchronizeInvoke.cs b/mcs/class/System/System.ComponentModel/ISynchronizeInvoke.cs
deleted file mode 100755
index e5cad4e0739..00000000000
--- a/mcs/class/System/System.ComponentModel/ISynchronizeInvoke.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.ComponentModel.ISynchronizeInvoke.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.ComponentModel
-{
- public interface ISynchronizeInvoke
- {
- bool InvokeRequired {
- get;
- }
-
- IAsyncResult BeginInvoke(Delegate method, object[] args);
-
- object EndInvoke(IAsyncResult result);
-
- object Invoke(Delegate method, object[] args);
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ITypeDescriptorContext.cs b/mcs/class/System/System.ComponentModel/ITypeDescriptorContext.cs
deleted file mode 100644
index a42cca94ec1..00000000000
--- a/mcs/class/System/System.ComponentModel/ITypeDescriptorContext.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.ComponentModel.ITypeDescriptorContext
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-
-namespace System.ComponentModel
-{
-
-public interface ITypeDescriptorContext : IServiceProvider
-{
- IContainer Container { get; }
-
- object Instance { get; }
-
- PropertyDescriptor PropertyDescriptor { get; }
-
- void OnComponentChanged ();
-
- void OnComponentChanging ();
-}
-
-}
-
diff --git a/mcs/class/System/System.ComponentModel/ITypedList.cs b/mcs/class/System/System.ComponentModel/ITypedList.cs
deleted file mode 100644
index 8ecdeeef7eb..00000000000
--- a/mcs/class/System/System.ComponentModel/ITypedList.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.ComponentModel.ITypedList.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System.Collections;
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Provides functionality to discover the schema for a bindable list, where the properties available for binding differ from the public properties of the object to bind to. For instance, using a DataView object that represents a customer table, you want to bind to the properties on the customer object that the DataView represents, not the properties of the DataView.
- /// </summary>
- public interface ITypedList
- {
- PropertyDescriptorCollection GetItemProperties (
- PropertyDescriptor[] listAccessors);
-
- string GetListName (PropertyDescriptor[] listAccessors);
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs b/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs
deleted file mode 100755
index 6004144b880..00000000000
--- a/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.ComponentModel.ListChangedEventArgs.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System.ComponentModel;
-
-namespace System.ComponentModel {
- public class ListChangedEventArgs : EventArgs
- {
-
- ListChangedType changedType;
- int oldIndex;
- int newIndex;
-
- public ListChangedEventArgs (ListChangedType listChangedType,
- int newIndex)
- {
- this.changedType = listChangedType;
- this.newIndex = newIndex;
- }
-
- [MonoTODO]
- public ListChangedEventArgs (ListChangedType listChangedType,
- PropertyDescriptor propDesc)
- {
- this.changedType = listChangedType;
- }
-
- public ListChangedEventArgs (ListChangedType listChangedType,
- int newIndex, int oldIndex)
- {
- this.changedType = listChangedType;
- this.newIndex = newIndex;
- this.oldIndex = oldIndex;
- }
-
- public ListChangedType ListChangedType {
- get { return changedType; }
- }
-
- public int OldIndex {
- get { return oldIndex; }
- }
-
- public int NewIndex {
- get { return newIndex; }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ListChangedEventHandler.cs b/mcs/class/System/System.ComponentModel/ListChangedEventHandler.cs
deleted file mode 100755
index 02f5065b886..00000000000
--- a/mcs/class/System/System.ComponentModel/ListChangedEventHandler.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.ComponentModel.ListChangedEventHandler.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.ComponentModel {
- [Serializable]
- public delegate void ListChangedEventHandler(object sender,
- ListChangedEventArgs e);
-}
diff --git a/mcs/class/System/System.ComponentModel/ListChangedType.cs b/mcs/class/System/System.ComponentModel/ListChangedType.cs
deleted file mode 100755
index b7eff8aa1fe..00000000000
--- a/mcs/class/System/System.ComponentModel/ListChangedType.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.ComponentModel.ListChangedType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.ComponentModel {
- public enum ListChangedType {
- Reset = 0,
- ItemAdded = 1,
- ItemDeleted = 2,
- ItemMoved = 3,
- ItemChanged = 4,
- PropertyDescriptorAdded = 5,
- PropertyDescriptorDeleted = 6,
- PropertyDescriptorChanged = 7
- }
-}
-
-
-
diff --git a/mcs/class/System/System.ComponentModel/ListSortDirection.cs b/mcs/class/System/System.ComponentModel/ListSortDirection.cs
deleted file mode 100644
index b58a39a4170..00000000000
--- a/mcs/class/System/System.ComponentModel/ListSortDirection.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.ComponentModel.ListSortDirection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Rodrigo Moya, 2002
-//
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Specifies the direction of a sort operation.
- /// </summary>
- [Serializable]
- public enum ListSortDirection {
- Ascending = 0,
- Descending = 1
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/LocalizableAttribute.cs b/mcs/class/System/System.ComponentModel/LocalizableAttribute.cs
deleted file mode 100755
index b5425ef8e53..00000000000
--- a/mcs/class/System/System.ComponentModel/LocalizableAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.ComponentModel.LocalizableAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-using System;
-
-namespace System.ComponentModel {
-
- [AttributeUsage (AttributeTargets.Property)]
- public sealed class LocalizableAttribute : Attribute {
- bool localizable;
-
- public static readonly LocalizableAttribute No;
- public static readonly LocalizableAttribute Yes;
-
- static LocalizableAttribute ()
- {
- No = new LocalizableAttribute (false);
- Yes = new LocalizableAttribute (false);
- }
-
- public LocalizableAttribute (bool localizable)
- {
- this.localizable = localizable;
- }
-
- public bool IsLocalizable {
- get {
- return localizable;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs b/mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs
deleted file mode 100644
index 22141db2343..00000000000
--- a/mcs/class/System/System.ComponentModel/MarshalByValueComponent.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.ComponentModel.MarshalByValueComponent.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-using System;
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Implements IComponent and provides the base implementation for remotable components that are marshaled by value (a copy of the serialized object is passed).
- /// </summary>
- public class MarshalByValueComponent : IComponent, IDisposable, IServiceProvider
- {
- [MonoTODO]
- public MarshalByValueComponent () {
- // TODO: need to implement for some component model
- // but do not throw a NotImplementedException
- }
-
- [MonoTODO]
- public void Dispose () {
- // TODO: need to do, but do not
- // throw a NotImplementedException
- }
-
- [MonoTODO]
- protected virtual void Dispose (bool disposing) {
- }
-
- [MonoTODO]
- public virtual object GetService (Type service) {
- return null;
- }
-
- public virtual IContainer Container {
- [MonoTODO]
- get {
- return null;
- }
- }
-
- public virtual bool DesignMode {
- [MonoTODO]
- get {
- return false;
- }
- }
-
- public virtual ISite Site {
- [MonoTODO]
- get {
- // TODO: need to get Site
- return null;
- }
-
- [MonoTODO]
- set {
- // TODO: need to set Site
- }
- }
-
- protected EventHandlerList Events {
- [MonoTODO]
- get {
- // TODO: need to do, but do not
- // throw a NotImplementedException
- return null;
- }
- }
-
- public event EventHandler Disposed;
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/MemberDescriptor.cs b/mcs/class/System/System.ComponentModel/MemberDescriptor.cs
deleted file mode 100755
index 2481bdffa7c..00000000000
--- a/mcs/class/System/System.ComponentModel/MemberDescriptor.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.ComponentModel.MemberDescriptor.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.ComponentModel {
-
- public abstract class MemberDescriptor {
- string name;
- Attribute [] attrs;
-
- protected MemberDescriptor (string name, Attribute [] attrs)
- {
- this.name = name;
- this.attrs = attrs;
- }
-
- protected MemberDescriptor (MemberDescriptor reference, Attribute [] attrs)
- {
- name = reference.name;
- this.attrs = attrs;
- }
-
- protected MemberDescriptor (string name)
- {
- this.name = name;
- }
-
- protected MemberDescriptor (MemberDescriptor reference)
- {
- name = reference.name;
- attrs = reference.attrs;
- }
-
- protected virtual Attribute [] AttributeArray {
- get {
- return attrs;
- }
-
- set {
- attrs = value;
- }
- }
-
- // FIXME: Implement Attributes property
- [MonoTODO ("Implement Attributes property too")]
- public virtual string Category {
- get {
- foreach (Attribute attr in attrs){
-
-
-
- if (attr is CategoryAttribute){
- return ((CategoryAttribute) attr).Category;
- }
- }
- return "Misc";
- }
- }
-
- public virtual string Description {
- get {
- foreach (Attribute attr in attrs){
- if (attr is DescriptionAttribute)
- return ((DescriptionAttribute) attr).Description;
- }
-
- return "";
- }
- }
-
- public virtual bool DesignTimeOnly {
- get {
- foreach (Attribute attr in attrs){
- if (attr is DesignOnlyAttribute)
- return ((DesignOnlyAttribute) attr).IsDesignOnly;
- }
-
- return false;
- }
- }
-
- //
- // FIXME: Is there any difference between DisplayName and Name?
- //
- [MonoTODO ("Does this diff from Name ?")]
- public virtual string DisplayName {
- get {
- return name;
- }
- }
-
- public virtual string Name {
- get {
- return name;
- }
- }
-
- public virtual bool IsBrowsable {
- get {
- foreach (Attribute attr in attrs){
- if (attr is BrowsableAttribute)
- return ((BrowsableAttribute) attr).Browsable;
- }
-
- return false;
- }
- }
-
- protected virtual int NameHashCode {
- get {
- return name.GetHashCode ();
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/PropertyChangedEventArgs.cs b/mcs/class/System/System.ComponentModel/PropertyChangedEventArgs.cs
deleted file mode 100644
index d456a807a7b..00000000000
--- a/mcs/class/System/System.ComponentModel/PropertyChangedEventArgs.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.ComponentModel.PropertyChangedEventArgs.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc
-//
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Provides data for the PropertyChanged event.
- /// </summary>
- public class PropertyChangedEventArgs : EventArgs
- {
- private string propertyName;
-
- public PropertyChangedEventArgs (string name) {
- propertyName = name;
- }
-
- public virtual string PropertyName {
- get {
- return propertyName;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs b/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs
deleted file mode 100755
index 4882c3b081e..00000000000
--- a/mcs/class/System/System.ComponentModel/PropertyDescriptor.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// System.ComponentModel.PropertyDescriptor.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-namespace System.ComponentModel {
-
- public abstract class PropertyDescriptor : MemberDescriptor {
-
- protected PropertyDescriptor (MemberDescriptor reference)
- : base (reference)
- {
- }
-
- protected PropertyDescriptor (MemberDescriptor reference, Attribute [] attrs)
- : base (reference, attrs)
- {
- }
-
- protected PropertyDescriptor (string name, Attribute [] attrs)
- : base (name, attrs)
- {
- }
-
- public abstract Type ComponentType { get; }
-
- [MonoTODO]
- public virtual TypeConverter Converter {
- get {
- // FIXME: Implement me.
-
- return null;
- }
- }
-
- public virtual bool IsLocalizable {
- get {
- foreach (Attribute attr in AttributeArray){
- if (attr is LocalizableAttribute){
- return ((LocalizableAttribute) attr).IsLocalizable;
- }
- }
-
- return false;
- }
- }
-
- public abstract bool IsReadOnly { get; }
-
- public abstract Type PropertyType { get; }
-
- public DesignerSerializationVisibility SerializationVisibility {
- get {
- foreach (Attribute attr in AttributeArray){
- if (attr is DesignerSerializationVisibilityAttribute){
- DesignerSerializationVisibilityAttribute a;
-
- a = (DesignerSerializationVisibilityAttribute) attr;
-
- return a.Visibility;
- }
- }
-
- //
- // Is this a good default if we cant find the property?
- //
- return DesignerSerializationVisibility.Hidden;
- }
- }
-
- Hashtable notifiers;
-
- public virtual void AddValueChanged (object component, EventHandler handler)
- {
- EventHandler component_notifiers;
-
- if (component == null)
- throw new ArgumentNullException ("component");
-
- if (handler == null)
- throw new ArgumentNullException ("handler");
-
- if (notifiers == null)
- notifiers = new Hashtable ();
-
- component_notifiers = (EventHandler) notifiers [component];
-
- if (component_notifiers != null)
- component_notifiers += handler;
- else
- notifiers [component] = handler;
- }
-
- protected virtual void OnValueChanged (object component, EventArgs e)
- {
- if (notifiers == null)
- return;
-
- EventHandler component_notifiers = (EventHandler) notifiers [component];
-
- if (component_notifiers == null)
- return;
-
- component_notifiers (component, e);
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs b/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs
deleted file mode 100644
index 534bda756c4..00000000000
--- a/mcs/class/System/System.ComponentModel/PropertyDescriptorCollection.cs
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// System.ComponentModel.PropertyDescriptorCollection.cs
-//
-// Author:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Rodrigo Moya, 2002
-//
-
-using System.Collections;
-
-namespace System.ComponentModel
-{
- /// <summary>
- /// Represents a collection of PropertyDescriptor objects.
- /// </summary>
- public class PropertyDescriptorCollection : IList, ICollection,
- IEnumerable, IDictionary
- {
- [MonoTODO]
- public PropertyDescriptorCollection (PropertyDescriptor[] properties) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Add (PropertyDescriptor value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- int IList.Add (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IDictionary.Add (object key, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Clear () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IList.Clear () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IDictionary.Clear () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool Contains (PropertyDescriptor value) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- bool IList.Contains (object value) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- bool IDictionary.Contains (object value) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void CopyTo (Array array, int index) {
- throw new NotImplementedException ();
- }
-
- public virtual PropertyDescriptor Find (string name, bool ignoreCase) {
- throw new NotImplementedException ();
- }
-
- public virtual IEnumerator GetEnumerator () {
- throw new NotImplementedException ();
- }
-
- IDictionaryEnumerator IDictionary.GetEnumerator () {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int IndexOf (PropertyDescriptor value) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- int IList.IndexOf (object value) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Insert (int index, PropertyDescriptor value) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IList.Insert (int index, object value) {
- throw new NotImplementedException ();
- }
-
- public void Remove (PropertyDescriptor value) {
- throw new NotImplementedException ();
- }
-
- void IDictionary.Remove (object value) {
- throw new NotImplementedException ();
- }
-
- void IList.Remove (object value) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void RemoveAt (int index) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void IList.RemoveAt (int index) {
- throw new NotImplementedException ();
- }
-
- public virtual PropertyDescriptorCollection Sort () {
- throw new NotImplementedException ();
- }
-
- public virtual PropertyDescriptorCollection Sort (IComparer ic) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void InternalSort (IComparer ic) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected void InternalSort (string[] order) {
- throw new NotImplementedException ();
- }
-
- public static readonly PropertyDescriptorCollection Empty;
-
- public bool IsFixedSize {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public bool IsReadOnly {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public bool IsSynchronized {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public ICollection Keys {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public ICollection Values {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public int Count {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- object ICollection.SyncRoot {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- }
-
- public object this[object key] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public object this [int key] {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- set {
- throw new NotImplementedException ();
- }
- }
-
- public virtual PropertyDescriptor this[string s] {
- get {
- throw new NotImplementedException ();
- }
- }
- }
-}
diff --git a/mcs/class/System/System.ComponentModel/ReadOnlyAttribute.cs b/mcs/class/System/System.ComponentModel/ReadOnlyAttribute.cs
deleted file mode 100755
index 4b332e16e7d..00000000000
--- a/mcs/class/System/System.ComponentModel/ReadOnlyAttribute.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// ReadOnlyAttribute.cs
-//
-// Author:
-// Chris J Breisch (cjbreisch@altavista.net)
-//
-// (C) 2002 Chris J Breisch
-//
-namespace System.ComponentModel {
- [AttributeUsage (AttributeTargets.All)]
- sealed public class ReadOnlyAttribute : Attribute {
- bool read_only;
-
- public static readonly ReadOnlyAttribute No;
- public static readonly ReadOnlyAttribute Yes;
- public static readonly ReadOnlyAttribute Default;
-
- static ReadOnlyAttribute ()
- {
- No = new ReadOnlyAttribute (false);
- Yes = new ReadOnlyAttribute (false);
- Default = new ReadOnlyAttribute (false);
- }
-
- public ReadOnlyAttribute (bool read_only)
- {
- this.read_only = read_only;
- }
-
- public bool IsReadOnly {
- get {
- return read_only;
- }
- }
- };
-}
diff --git a/mcs/class/System/System.ComponentModel/StringConverter.cs b/mcs/class/System/System.ComponentModel/StringConverter.cs
deleted file mode 100644
index 4e4bdb9bf4b..00000000000
--- a/mcs/class/System/System.ComponentModel/StringConverter.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.ComponentModel.StringConverter
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-using System.Globalization;
-
-namespace System.ComponentModel {
-
-public class StringConverter : TypeConverter
-{
- public StringConverter ()
- {
- }
-
- [MonoTODO]
- public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- throw new NotImplementedException ();
- }
-}
-}
-
diff --git a/mcs/class/System/System.ComponentModel/TypeConverter.cs b/mcs/class/System/System.ComponentModel/TypeConverter.cs
deleted file mode 100755
index 345e24aa1cb..00000000000
--- a/mcs/class/System/System.ComponentModel/TypeConverter.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-//
-// System.ComponentModel.TypeConverter
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace System.ComponentModel {
-
-[MonoTODO("Only has the minimal implementation needed to use ColorConverter")]
-public class TypeConverter
-{
- public TypeConverter ()
- {
- }
-
- public bool CanConvertFrom (Type sourceType)
- {
- return CanConvertFrom (null, sourceType);
- }
-
- [MonoTODO]
- public virtual bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
- {
- throw new NotImplementedException ();
- }
-
- public bool CanConvertTo (Type destinationType)
- {
- return CanConvertTo (null, destinationType);
- }
-
- [MonoTODO]
- public virtual bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
- {
- throw new NotImplementedException ();
- }
-
- public object ConvertFrom (object o)
- {
- return ConvertFrom (null, CultureInfo.CurrentCulture, o);
- }
-
- [MonoTODO]
- public virtual object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- throw new NotImplementedException ();
- }
-
- public virtual object ConvertFromInvariantString (string text)
- {
- return ConvertFromInvariantString (null, text);
- }
-
- [MonoTODO]
- public virtual object ConvertFromInvariantString (ITypeDescriptorContext context, string text)
- {
- throw new NotImplementedException ();
- }
-
- public object ConvertFromString (string s)
- {
- return ConvertFrom (s);
- }
-
- public object ConvertFromString (ITypeDescriptorContext context, string text)
- {
- return ConvertFromString (context, CultureInfo.CurrentCulture, text);
- }
-
- [MonoTODO]
- public object ConvertFromString (ITypeDescriptorContext context, CultureInfo culture, string text)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object ConvertTo (object value, Type destinationType)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public virtual object ConvertTo (ITypeDescriptorContext context,
- CultureInfo culture,
- object value,
- Type destinationType)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string ConvertToInvariantString (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string ConvertToInvariantString (ITypeDescriptorContext context, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string ConvertToString (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string ConvertToString (ITypeDescriptorContext context, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string ConvertToString (ITypeDescriptorContext context, CultureInfo culture, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object CreateInstance (IDictionary propertyValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual object CreateInstance (ITypeDescriptorContext context, IDictionary propertyValues)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool GetCreateInstanceSupported ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool GetCreateInstanceSupported (ITypeDescriptorContext context)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public PropertyDescriptorCollection GetProperties (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context, object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual PropertyDescriptorCollection GetProperties (ITypeDescriptorContext context,
- object value,
- Attribute[] attributes)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool GetPropertiesSupported ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool GetPropertiesSupported (ITypeDescriptorContext context)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public ICollection GetStandardValues ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual StandardValuesCollection GetStandardValues (ITypeDescriptorContext context)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool GetStandardValuesExclusive ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool GetStandardValuesExclusive (ITypeDescriptorContext context)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool GetStandardValuesSupported ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool GetStandardValuesSupported (ITypeDescriptorContext context)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public bool IsValid (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual bool IsValid (ITypeDescriptorContext context, object value)
- {
- throw new NotImplementedException ();
- }
-
- public class StandardValuesCollection : ICollection, IEnumerable
- {
- private ICollection values;
-
- public StandardValuesCollection (ICollection values)
- {
- this.values = values;
- }
-
- public void CopyTo (Array array, int index)
- {
- values.CopyTo (array, index);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return values.GetEnumerator ();
- }
-
- bool ICollection.IsSynchronized
- {
- get { return false; }
- }
-
- object ICollection.SyncRoot
- {
- get { return null; }
- }
-
- int ICollection.Count
- {
- get { return this.Count; }
- }
-
- public int Count
- {
- get { return values.Count; }
- }
-
- public object this [int index]
- {
- get { return ((IList) values) [index]; }
- }
- }
-}
-}
-
diff --git a/mcs/class/System/System.ComponentModel/TypeConverterAttribute.cs b/mcs/class/System/System.ComponentModel/TypeConverterAttribute.cs
deleted file mode 100644
index 21c283db5fd..00000000000
--- a/mcs/class/System/System.ComponentModel/TypeConverterAttribute.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.ComponentModel.TypeConverterAttribute
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-
-namespace System.ComponentModel {
-
-[AttributeUsage(AttributeTargets.All)]
-public sealed class TypeConverterAttribute : Attribute
-{
- private string converter_type;
-
- public TypeConverterAttribute ()
- {
- converter_type = "";
- }
-
- public TypeConverterAttribute (string typeName)
- {
- converter_type = typeName;
- }
-
- public TypeConverterAttribute (Type type)
- {
- converter_type = type.AssemblyQualifiedName;
- }
-
- public override bool Equals (object obj)
- {
- if (!(obj is TypeConverterAttribute))
- return false;
-
- return ((TypeConverterAttribute) obj).ConverterTypeName == converter_type;
- }
-
- public override int GetHashCode ()
- {
- return converter_type.GetHashCode ();
- }
-
- public string ConverterTypeName
- {
- get { return converter_type; }
- }
-}
-}
-
diff --git a/mcs/class/System/System.ComponentModel/TypeDescriptor.cs b/mcs/class/System/System.ComponentModel/TypeDescriptor.cs
deleted file mode 100644
index f3d9af4b361..00000000000
--- a/mcs/class/System/System.ComponentModel/TypeDescriptor.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.ComponentModel.TypeDescriptor
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-
-namespace System.ComponentModel
-{
-
-[MonoTODO("Only implemented the minimal features needed to use ColorConverter")]
-public sealed class TypeDescriptor
-{
- public static TypeConverter GetConverter (Type type)
- {
- object [] attrs = type.GetCustomAttributes (false);
- string converter_name = null;
- foreach (object o in attrs){
- if (o is TypeConverterAttribute){
- TypeConverterAttribute tc = (TypeConverterAttribute) o;
- converter_name = tc.ConverterTypeName;
- break;
- }
- }
-
- if (converter_name == null)
- return null;
-
- object converter = null;
- try {
- converter = Activator.CreateInstance (Type.GetType (converter_name));
- } catch (Exception){
- }
-
- return converter as TypeConverter;
- }
-}
-}
-
diff --git a/mcs/class/System/System.ComponentModel/Win32Exception.cs b/mcs/class/System/System.ComponentModel/Win32Exception.cs
deleted file mode 100755
index c8949e445e0..00000000000
--- a/mcs/class/System/System.ComponentModel/Win32Exception.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// System.ComponentModel.Win32Exceptioncs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Collections;
-using System.Globalization;
-
-namespace System.ComponentModel
-{
- [Serializable]
- public class Win32Exception : ExternalException
- {
- private int native_error_code;
-
- public Win32Exception ()
- : base (W32ErrorMessage(Marshal.GetLastWin32Error()),
- Marshal.GetLastWin32Error()) {
- native_error_code=Marshal.GetLastWin32Error();
- }
-
- public Win32Exception(int error)
- : base (W32ErrorMessage(error), error) {
- native_error_code=error;
- }
-
- public Win32Exception(int error, string message)
- : base (message, error) {
- native_error_code=error;
- }
-
- protected Win32Exception(SerializationInfo info,
- StreamingContext context)
- : base (info, context) {
- }
-
- public int NativeErrorCode {
- get {
- return(native_error_code);
- }
- }
-
- [MonoTODO]
- public override void GetObjectData(SerializationInfo info,
- StreamingContext context) {
- if(info==null) {
- throw new ArgumentNullException();
- }
-
- throw new NotImplementedException();
- }
-
- private static Hashtable w32_errors = new Hashtable();
-
- /* Initialise the list of error strings */
- static Win32Exception() {
- /* No need to list everything, just the ones
- * the runtime can throw. A list of the errors
- * can be found in class System.IO.MonoIOError.
- */
- w32_errors.Add(11001,
- Locale.GetText("No such host is known"));
- w32_errors.Add(10047,
- Locale.GetText("AF not supported"));
- w32_errors.Add(10043,
- Locale.GetText("proto no supported"));
- w32_errors.Add(10044,
- Locale.GetText("socket not supproted"));
- w32_errors.Add(10004,
- Locale.GetText("interrupted"));
-
- w32_errors.Add(10013,
- Locale.GetText("Access denied"));
- w32_errors.Add(11002,
- Locale.GetText("A temporary error occurred on an authoritative name server. Try again later."));
- w32_errors.Add(10022,
- Locale.GetText("Invalid arguments"));
- w32_errors.Add(10050,
- Locale.GetText("Network subsystem is down"));
- w32_errors.Add(10051,
- Locale.GetText("Network is unreachable"));
- w32_errors.Add(10061,
- Locale.GetText("Connection refused"));
- w32_errors.Add(10045,
- Locale.GetText("Operation not supported"));
- w32_errors.Add(10038,
- Locale.GetText("The descriptor is not a socket"));
- w32_errors.Add(10055,
- Locale.GetText("Not enough buffer space is available"));
- w32_errors.Add(10056,
- Locale.GetText("Socket is already connected"));
- w32_errors.Add(10048,
- Locale.GetText("Address already in use"));
- w32_errors.Add(10057,
- Locale.GetText("The socket is not connected"));
- w32_errors.Add(10058,
- Locale.GetText("The socket has been shut down"));
- w32_errors.Add(10093,
- Locale.GetText("Winsock not initialized"));
- }
-
- private static string W32ErrorMessage(int error_code) {
- string message=(string)w32_errors[error_code];
-
- if(message==null) {
- return(Locale.GetText("Some sort of w32 error occurred"));
- } else {
- return(message);
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/ChangeLog b/mcs/class/System/System.Configuration/ChangeLog
deleted file mode 100644
index acc2a035a7e..00000000000
--- a/mcs/class/System/System.Configuration/ChangeLog
+++ /dev/null
@@ -1,25 +0,0 @@
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * ConfigurationException.cs: Rewrote most of the file and added
- serialization bits.
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * ConfigurationSettings.cs, IgnoreSectionHandler.cs : MonoTODO decoration
-
- * SingleTagSectionHandler.cs, DictionarySectionHandler.cs,
- NameValueSectionHandler.cs : Ditto.
-
-2001-08-28 Christopher Podurgiel <cpodurgiel@msn.com>
- * IConfigurationSectionHandler.cs: Added reference to System.Xml.
-
- * SingleTagSectionHandler.cs: Added Implementation of Create() method.
-
- * NameValueSectionHandler.cs: Added Implementation of Create() method.
-
- * ConfigurationException.cs: Now returns proper message rather than "System Exception".
-
-2001-08-26 Christopher Podurgiel <cpodurgiel@msn.com>
-
- * ConfigurationSettings.cs: No longer references the NameValueSectionHandler directly. Instead it uses System.Reflection to call the Create() method for the appropriate SectionHandler as defined in the .config file.
-
diff --git a/mcs/class/System/System.Configuration/ConfigurationException.cs b/mcs/class/System/System.Configuration/ConfigurationException.cs
deleted file mode 100644
index 9b23ee88352..00000000000
--- a/mcs/class/System/System.Configuration/ConfigurationException.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// System.Configuration.ConfigurationException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Xml;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Configuration
-{
- [Serializable]
- public class ConfigurationException : SystemException
- {
- // Fields
- string bareMessage;
- string filename;
- int line;
-
- //
- // Constructors
- //
- public ConfigurationException ()
- : base (Locale.GetText ("There is an error in a configuration setting."))
- {
- filename = null;
- bareMessage = Locale.GetText ("There is an error in a configuration setting.");
- line = 0;
- }
-
- public ConfigurationException (string message)
- : base (message)
- {
- bareMessage = message;
- }
-
- protected ConfigurationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- filename = info.GetString ("filename");
- line = info.GetInt32 ("line");
- }
-
- public ConfigurationException (string message, Exception inner)
- : base (message, inner)
- {
- bareMessage = message;
- }
-
- public ConfigurationException (string message, XmlNode node)
- : base (message)
- {
- filename = GetXmlNodeFilename(node);
- line = GetXmlNodeLineNumber(node);
- bareMessage = message;
- }
-
- public ConfigurationException (string message, Exception inner, XmlNode node)
- : base (message, inner)
- {
- filename = GetXmlNodeFilename (node);
- line = GetXmlNodeLineNumber (node);
- bareMessage = message;
- }
-
- public ConfigurationException (string message, string filename, int line)
- : base (message)
- {
- bareMessage = message;
- this.filename = filename;
- this.line= line;
- }
-
- public ConfigurationException (string message, Exception inner, string filename, int line)
- : base (message)
- {
- bareMessage = message;
- this.filename = filename;
- this.line = line;
- }
- //
- // Properties
- //
- public string BareMessage
- {
- get { return bareMessage; }
- }
-
- public string Filename
- {
- get { return filename; }
- }
-
- public int Line
- {
- get { return line; }
- }
-
- public override string Message
- {
- get { return filename + " " + line; }
- }
-
- //
- // Methods
- //
- [MonoTODO]
- // Not sure if that's the correct return value.
- public static string GetXmlNodeFilename (XmlNode node)
- {
- return node.OwnerDocument.Name;
- }
-
- [MonoTODO]
- public static int GetXmlNodeLineNumber (XmlNode node)
- {
- return 0;
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("filename", filename);
- info.AddValue ("line", line);
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/ConfigurationSettings.cs b/mcs/class/System/System.Configuration/ConfigurationSettings.cs
deleted file mode 100644
index ba5ccf02ad0..00000000000
--- a/mcs/class/System/System.Configuration/ConfigurationSettings.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// System.Configuration.ConfigurationSettings.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// C) Christopher Podurgiel
-//
-
-using System;
-using System.Collections.Specialized;
-using System.Reflection;
-using System.Xml;
-using System.Xml.XPath;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Component class.
- /// </summary>
- /// <remarks>
- /// Longer description
- /// </remarks>
-
- public sealed class ConfigurationSettings
- {
-
- private static string applicationConfigFileName;
-
- /// <summary>
- /// ConfigurationSettings Constructor.
- /// </summary>
- private ConfigurationSettings ()
- {
-
- }
-
- /// <summary>
- /// Returns configuration settings for a user-defined configuration section.
- /// </summary>
- /// <param name="sectionName">The name of the configuration section that configuration settings are read from.</param>
- /// <returns></returns>
- public static object GetConfig(string sectionName)
- {
- //Create an instance of an XML Document.
- XmlDocument ConfigurationDocument = new XmlDocument();
-
- /*
- * LAMESPEC: The .config file that needs to be parsed is the name of the application, plus ".config"
- * ie. "Myapplication.exe.config"
- * The only way I could find to get the name of the application is through System.Forms.Application.ExecutablePath, this
- * may be an incorrect way to get this information. It works properly on a windows machine when building an executable,
- * however, I'm not sure how this would work under other platforms.
- */
- //Get the full path to the Applicaton Configuration File.
- applicationConfigFileName = "FIXME:ConfigurationSettings" + ".config";
-
- //Try to load the XML Document.
- try
- {
- ConfigurationDocument.Load(applicationConfigFileName);
- }
- catch(XmlException e)
- {
- //Error loading the XML Document. Throw a ConfigurationException.
- throw(new ConfigurationException(e.Message, applicationConfigFileName, e.LineNumber));
- }
-
- string sectionHandlerName = GetSectionHanderType(ConfigurationDocument, sectionName);
-
- XmlNode sectionNode = ConfigurationDocument.SelectSingleNode("/configuration/" + sectionName);
-
-
-
- //If the specified sectionName is not found, then sectionNode will be null. When calling objNVSHandler.Create(),
- //sectionNode cannot be null.
- if(sectionNode == null)
- {
- return null;
- }
-
-
- //Create a new SectionHandler
-
- //According to the Docs provided by Microsoft, the user can create their own configuration sections, and create a custom
- //handler class for it. The user would specify the class and its assebly in the <configSections> section. These would be
- //seperated by a comma.
-
- string sectionHandlerClassName = sectionHandlerName;
- string sectionHandlerAssemblyName = "System";
-
- //Split the SectionHandler Class Name from the Assembly Name (if provided).
- string[] sectionHandlerArray = sectionHandlerName.Split(new char[]{','}, 2);
- if(sectionHandlerArray.Length == 2)
- {
- sectionHandlerClassName = sectionHandlerArray[0];
- sectionHandlerAssemblyName = sectionHandlerArray[1];
- }
-
- // Load the assembly to use.
- Assembly assem = Assembly.Load(sectionHandlerAssemblyName);
- //Get the class type.
- Type handlerObjectType = assem.GetType(sectionHandlerClassName);
- //Get a reference to the method "Create"
- MethodInfo createMethod = handlerObjectType.GetMethod("Create");
- //Create an Instance of this SectionHandler.
- Object objSectionHandler = Activator.CreateInstance(handlerObjectType);
-
- //define the arguments to be passed to the "Create" Method.
- Object[] args = new Object[3];
- args[0] = null;
- args[1] = null;
- args[2] = sectionNode;
-
- object sectionHandlerCollection = createMethod.Invoke(objSectionHandler, args);
-
- //Return the collection
- return sectionHandlerCollection;
-
- }
-
-
- /// <summary>
- /// Gets the name of the SectionHander Class that will handle this section.
- /// </summary>
- /// <param name="xmlDoc">An xml Configuration Document.</param>
- /// <param name="sectionName">The name of the configuration section that configuration settings are read from.</param>
- /// <returns>The name of the Handler Object for this configuration section, including the name if its Assembly.</returns>
- [MonoTODO]
- private static string GetSectionHanderType(XmlDocument xmlDoc, string sectionName)
- {
- //TODO: This method does not account for sectionGroups yet.
- string handlerName = null;
-
- //<appSettings> is a predefined configuration section. It does not have a definition
- // in the <configSections> section, and will always be handled by the NameValueSectionHandler.
- if(sectionName == "appSettings")
- {
- handlerName = "System.Configuration.NameValueSectionHandler";
- }
- else
- {
-
- string[] sectionPathArray = sectionName.Split(new char[]{'/'});
-
- //Build an XPath statement.
- string xpathStatement = "/configuration/configSections";
- for (int i=0; i < sectionPathArray.Length; i++)
- {
- if(i < sectionPathArray.Length - 1)
- {
- xpathStatement = xpathStatement + "/sectionGroup[@name='" + sectionPathArray[i] + "']";
- }
- else
- {
- xpathStatement = xpathStatement + "/section[@name='" + sectionPathArray[i] + "']";
- }
- }
-
- //Get all of the <section> node using the xpath statement.
- XmlNode sectionNode = xmlDoc.SelectSingleNode(xpathStatement);
-
- // if this section isn't found, then there was something wrong with the config document,
- // or the sectionName didn't have a proper definition.
- if(sectionNode == null)
- {
-
- throw (new ConfigurationException("Unrecognized element."));
- }
-
- handlerName = sectionNode.Attributes["type"].Value;
-
- }
-
- //Return the name of the handler.
- return handlerName;
- }
-
-
-
- /// <summary>
- /// Get the Application Configuration Settings.
- /// </summary>
- public static NameValueCollection AppSettings
- {
- get
- {
- //Get the Configuration Settings for the "appSettings" section.
- NameValueCollection appSettings = (NameValueCollection)GetConfig("appSettings");;
-
- return appSettings;
- }
- }
-
- }
-}
-
-
diff --git a/mcs/class/System/System.Configuration/DictionarySectionHandler.cs b/mcs/class/System/System.Configuration/DictionarySectionHandler.cs
deleted file mode 100644
index f48eea8f38a..00000000000
--- a/mcs/class/System/System.Configuration/DictionarySectionHandler.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-
-//
-// System.Configuration.DictionarySectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-using System;
-using System.Collections.Specialized;
-using System.Xml;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for DictionarySectionHandler.
- /// </summary>
- public class DictionarySectionHandler : IConfigurationSectionHandler
- {
- private static string _stringKeyName;
- private static string _stringValueName;
-
- /// <summary>
- /// DictionarySectionHandler Constructor
- /// </summary>
- public DictionarySectionHandler()
- {
- //Set Default Values.
- _stringKeyName = "key";
- _stringValueName = "value";
- }
-
- /// <summary>
- /// Creates a new DictionarySectionHandler object and adds the object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public virtual object Create(object parent, object context, XmlNode section)
- {
- //FIXME: Enter a meaningful error message
- if(section == null)
- { throw new ConfigurationException("XML Node can not be null."); }
-
- //FIXME: Enter a meaningful error message
- if(parent == null)
- { throw new ConfigurationException("", section); }
-
-
- DictionarySectionHandler objHandler = new DictionarySectionHandler();
- NameValueCollection objCollection;
-
- //Unbox parent as a NameValueCollection type.
- objCollection=(NameValueCollection)parent;
-
- objCollection.Add(section.Attributes[_stringKeyName].Value, section.Attributes[_stringValueName].Value);
-
- return null;
-
- //FIXME: this code is far form complete, probably not even correct.
-
- }
-
- /// <summary>
- /// Gets the name of the key attribute tag. This property is overidden by derived classes to change
- /// the name of the key attribute tag. The default is "key".
- /// </summary>
- protected virtual string KeyAttributeName
- {
- get
- {
- return _stringKeyName;
- }
- }
-
- /// <summary>
- /// Gets the name of the value tag. This property may be overidden by derived classes to change
- /// the name of the value tag. The default is "value".
- /// </summary>
- protected virtual string ValueAttributeName
- {
- get
- {
- return _stringValueName;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs b/mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs
deleted file mode 100644
index d3eae0ad018..00000000000
--- a/mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Configuration.IConfigurationSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-using System;
-using System.Xml;
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for IConfigurationSectionHandler.
- /// </summary>
- public interface IConfigurationSectionHandler
- {
- /// <summary>
- /// Creates a new configuration handler and adds the specified configuration object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- object Create(object parent, object configContext, XmlNode section);
- }
-}
diff --git a/mcs/class/System/System.Configuration/IgnoreSectionHandler.cs b/mcs/class/System/System.Configuration/IgnoreSectionHandler.cs
deleted file mode 100644
index 4a0f558b395..00000000000
--- a/mcs/class/System/System.Configuration/IgnoreSectionHandler.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Configuration.IgnoreSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Xml;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for IgnoreSectionHandler.
- /// </summary>
- public class IgnoreSectionHandler : IConfigurationSectionHandler
- {
- /// <summary>
- /// IgnoreSectionHandler Constructor
- /// </summary>
- [MonoTODO]
- public IgnoreSectionHandler()
- {
- //
- // TODO: Add constructor logic here
- //
- }
-
- /// <summary>
- /// Creates a new configuration handler and adds the specified configuration object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public virtual object Create(object parent, object configContext, XmlNode section)
- {
- //FIXME: Add Implemetation code here.
- return null;
- }
- }
-}
diff --git a/mcs/class/System/System.Configuration/NameValueSectionHandler.cs b/mcs/class/System/System.Configuration/NameValueSectionHandler.cs
deleted file mode 100644
index 0e88bf44950..00000000000
--- a/mcs/class/System/System.Configuration/NameValueSectionHandler.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Configuration.NameValueSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-using System;
-using System.Xml;
-using System.Collections.Specialized;
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for NameValueSectionHandler.
- /// </summary>
- public class NameValueSectionHandler
- {
- private static string keyName;
- private static string valueName;
- private static NameValueCollection settingsCollection;
-
-
- /// <summary>
- /// NameValueSectionHandler Constructor
- /// </summary>
- public NameValueSectionHandler()
- {
- //Set Default Values.
- keyName = "key";
- valueName = "value";
-
- settingsCollection = new NameValueCollection();
-
- }
-
- /// <summary>
- /// Creates a new configuration handler and adds the specified configuration object to the collection.
- /// </summary>
- /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
- /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
- /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public object Create(object parent, object context, XmlNode section)
- {
- //FIXME: I'm not quite sure how to implement 'parent' or 'context'.
-
-
- //Get all of the ChildNodes in the XML section.
- XmlNodeList childNodeList = section.ChildNodes;
-
- //loop throught the ChildNodes
- for (int i=0; i < childNodeList.Count; i++)
- {
- XmlNode childNode = childNodeList[i];
-
- //if the name of this childNode is not 'add' then throw a ConfigurationException.
- if(childNode.Name != "add")
- {
- throw (new ConfigurationException("Unrecognized element"));
- }
-
- //Get the attributes for the childNode
- XmlAttributeCollection xmlAttributes = childNode.Attributes;
-
- //Get the key and value Attributes by their Name
- XmlAttribute keyAttribute = xmlAttributes[keyName];
- XmlAttribute valueAttribute = xmlAttributes[valueName];
-
- //Add this Key/Value Pair to the collection
- settingsCollection.Add(keyAttribute.Value, valueAttribute.Value);
-
- }
-
-
- //FIXME: Something is missing here. MS's version of this method returns a System.Configuration.ReadOnlyNameValueCollection type,
- //this class id not documented ANYWHERE. This method is curretly returning a NameValueCollection, but it should be ReadOnly.
-
- return settingsCollection;
- }
-
- /// <summary>
- /// Gets the name of the key in the key-value pair.
- /// </summary>
- protected virtual string KeyAttributeName
- {
- get
- {
- return keyName;
- }
- }
-
- /// <summary>
- /// Gets the value for the key in the key-value pair.
- /// </summary>
- protected virtual string ValueAttributeName
- {
- get
- {
- return valueName;
- }
- }
-
- }
-}
diff --git a/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs b/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs
deleted file mode 100644
index 601ed10d82a..00000000000
--- a/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Configuration.SingleTagSectionHandler.cs
-//
-// Author:
-// Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Chris Podurgiel
-//
-
-using System;
-using System.Xml;
-using System.Collections;
-
-
-namespace System.Configuration
-{
- /// <summary>
- /// Summary description for SingleTagSectionHandler.
- /// </summary>
- public class SingleTagSectionHandler : IConfigurationSectionHandler
- {
-
- [MonoTODO]
- public SingleTagSectionHandler()
- {
- //
- // TODO: Add constructor logic here
- //
- }
-
- /// <summary>
- /// Returns a collection of configuration section values.
- /// </summary>
- /// <param name="parent"></param>
- /// <param name="context"></param>
- /// <param name="section">The name of the configuration section.</param>
- /// <returns></returns>
- [MonoTODO]
- public virtual object Create(object parent, object context, XmlNode section)
- {
- //FIXME: I'm not quite sure how to implement 'parent' or 'context'.
- //TODO: Add in proper Error Handling.
-
- //Get all of the ChildNodes in the XML section.
- if(section.HasChildNodes)
- {
- throw (new ConfigurationException("Child Nodes not allowed."));
- }
-
-
- //Get the attributes for the childNode
- XmlAttributeCollection xmlAttributes = section.Attributes;
-
- Hashtable settingsCollection = new Hashtable();
-
- for(int i=0; i < xmlAttributes.Count; i++)
- {
- settingsCollection.Add(xmlAttributes[i].Name, xmlAttributes[i].Value);
- }
-
- return settingsCollection;
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/BooleanSwitch.cs b/mcs/class/System/System.Diagnostics/BooleanSwitch.cs
deleted file mode 100755
index e4f83292d55..00000000000
--- a/mcs/class/System/System.Diagnostics/BooleanSwitch.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Diagnostics.BooleanSwitch.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// Provides a simple on/off switch that controls debuggina
- /// and tracing output
- /// </summary>
- public class BooleanSwitch : Switch
- {
- /// <summary>
- /// Initializes a new instance
- /// </summary>
- public BooleanSwitch(string displayName, string description)
- : base(displayName, description)
- {
- SwitchSetting = (int)BooleanSwitchSetting.False;
- }
-
- // =================== Properties ===================
-
- /// <summary>
- /// Specifies whether the switch is enabled or disabled
- /// </summary>
- public bool Enabled
- {
- get
- {
- if((int)BooleanSwitchSetting.False == SwitchSetting) {
- return false;
- }
- else {
- return true;
- }
- }
- set
- {
- if(value) {
- SwitchSetting = (int)BooleanSwitchSetting.True;
- }
- else {
- SwitchSetting = (int)BooleanSwitchSetting.False;
- }
- }
- }
-
- private enum BooleanSwitchSetting : int {
- True = 1, False = 0
- }
- }
-
-}
diff --git a/mcs/class/System/System.Diagnostics/ChangeLog b/mcs/class/System/System.Diagnostics/ChangeLog
deleted file mode 100644
index 45de0eb3b55..00000000000
--- a/mcs/class/System/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,127 +0,0 @@
-2002-06-25 Dick Porter <dick@ximian.com>
-
- * Process.cs: Process forking and waiting, and some support functions
-
- * ProcessStartInfo.cs: Implemented the bits needed for basic
- Process forking
-
- * ProcessModule.cs: Implemented
-
- * ProcessModuleCollection.cs: Mostly implemented
-
- * FileVersionInfo.cs: Implemented
-
-2002-06-16 Jonathan Pryor <jonpryor@vt.edu>
- * ICollectData.cs: Implemented
- * TraceImpl.cs: Setting IndentLevel, IndentSize should change the
- corresponding properties on all current TraceListeners.
- Also, to answer the FIXME message: Yes, the properties in TraceListener
- need to be [ThreadStatic] as well.
- * TraceListenerCollection.cs: When adding a TraceListener, the TraceListener
- should have its properties set to the current TraceImpl property values.
- * TraceListener.cs: Make indentSize, lndentLevel [ThreadStatic].
-
-2002-06-09 Jonathan Pryor <jonpryor@vt.edu>
- * EntryWrittenEventArgs.cs: Implemented
- * EntryWrittenEventHandler.cs: Implemented
- * EventLog.cs: Stubbed out
- * EventLogEntry.cs: Stubbed out
- * EventLogEntryCOllection.cs: Implemented.
- * EventLogEntryType.cs: Implemented
- * EventLogInstaller.cs: Stubbed out
- * EventLogPermission.cs: Stubbed out
- * EventLogPermissionAccess.cs: Implemented
- * EventLogPermissionAttribute.cs: Stubbed out
- * EventLogPermissionEntry.cs: Stubbed out
- * EventLogPermissionEntryCollection.cs: Stubbed out
- * EventLogTraceListener.cs: Stubbed out
-
-2002-05-29 Jonathan Pryor <jonpryor@vt.edu>
- * DefaultTraceListener.cs: Implemented MONO_TRACE support
-
-2002-05-27 Jonathan Pryor <jonpryor@vt.edu>
- * Moved public API documentation for the following files to the
- /mcs/docs/apidocs/xml/en/System.Diagnostics directory:
- - Debug.cs
- - DefaultTraceListener.cs
- - DiagnosticsConfigurationHandler.cs
- - Switch.cs
- - TextWriterTraceListener.cs
- - Trace.cs
- - TraceLevel.cs
- - TraceListener.cs
- - TraceListenerCollection.cs
- - TraceSwitch.cs
-
-2002-04-10 Jonathan Pryor <jonpryor@vt.edu>
-
- * TraceListenerCollection.cs: Corrected indexer property to provide the
- correct return value and implement the IList indexer property correctly.
-
-2002-04-07 Jonathan Pryor <jonpryor@vt.edu>
-
- * TraceListener.cs: Fix stack overflow bug
- * DefaultTraceListener.cs: Implement log file support
-
-2002-04-04 Dick Porter <dick@ximian.com>
-
- * ThreadWaitReason.cs:
- * ThreadState.cs:
- * ThreadPriorityLevel.cs:
- * ProcessWindowStyle.cs:
- * ProcessThreadCollection.cs
- * ProcessThread.cs:
- * ProcessStartInfo.cs:
- * ProcessModuleCollection.cs: Stub out more classes needed for Process
-
-2002-03-31 Dick Porter <dick@ximian.com>
-
- * Process.cs:
- * ProcessPriorityClass.cs:
- * ProcessModule.cs:
- * FileVersionInfo.cs: Stub out classes needed for Process
-
-2002-03-08 Jonathan Pryor <jonpryor@vt.edu>
-
- * Debug.cs: Clean up (lots of code can be shared with Trace.cs, which
- is why TraceImpl.cs is introduced), "DEBUG" conditional support
- * TraceListener.cs: Proper implementation of Dispose pattern;
- implementatino of non-abstract methods in terms of abstract methods
- * TraceListenerCollection.cs: check 'object' types before adding
- * TextWriterTraceListener.cs: properly implement Dispose pattern;
- handle NeedIndent and WriteIndent
- * Trace.cs: new file; provides Trace functionality, "TRACE" conditional
- support
- * DefaultTraceListener.cs: new file; the default trace listener
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * TraceListenerCollection.cs: Remove Warnings.
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * Switch.cs, TraceListenerCollection.cs : Decorate incomplete bits
- with the MonoTODO attribute.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added Debug.cs to the build.
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added preliminary TraceListenerCollection.cs to the build.
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added TraceListener.cs, TextWriterTraceListener.cs, and
- DefaultTraceListener.cs to the build and moved them into the
- proper assembly.
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added DiagnosticsConfigurationHandler.cs to the build.
-
-2001-09-09 Nick Drochak <ndrochak@gol.com>
-
- * BooleanSwitch.cs: Make this class use it's parent class's features. Namely, use SwitchSetting
- so that we can get OnSwitchSettingChanged() to fire for free.
-
-2001-09-09 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: added this file
-
- * Switch.cs: call OnSwitchSettingChanged() when the switch setting is, yes you gessed it, changed.
-
diff --git a/mcs/class/System/System.Diagnostics/Debug.cs b/mcs/class/System/System.Diagnostics/Debug.cs
deleted file mode 100644
index 73ead2ee832..00000000000
--- a/mcs/class/System/System.Diagnostics/Debug.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-//
-// System.Diagnostics.Debug.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- public sealed class Debug {
-
- private Debug () {}
-
- public static bool AutoFlush {
- get {return TraceImpl.AutoFlush;}
- set {TraceImpl.AutoFlush = value;}
- }
-
- public static int IndentLevel {
- get {return TraceImpl.IndentLevel;}
- set {TraceImpl.IndentLevel = value;}
- }
-
- public static int IndentSize {
- get {return TraceImpl.IndentSize;}
- set {TraceImpl.IndentSize = value;}
- }
-
- public static TraceListenerCollection Listeners {
- get {return TraceImpl.Listeners;}
- }
-
- [Conditional("DEBUG")]
- public static void Assert (bool condition)
- {
- TraceImpl.Assert (condition);
- }
-
- [Conditional("DEBUG")]
- public static void Assert (bool condition, string message)
- {
- TraceImpl.Assert (condition, message);
- }
-
- [Conditional("DEBUG")]
- public static void Assert (bool condition, string message,
- string detailMessage)
- {
- TraceImpl.Assert (condition, message, detailMessage);
- }
-
- [Conditional("DEBUG")]
- public static void Close ()
- {
- TraceImpl.Close ();
- }
-
- [Conditional("DEBUG")]
- public static void Fail (string message)
- {
- TraceImpl.Fail (message);
- }
-
- [Conditional("DEBUG")]
- public static void Fail (string message, string detailMessage)
- {
- TraceImpl.Fail (message, detailMessage);
- }
-
- [Conditional("DEBUG")]
- public static void Flush ()
- {
- TraceImpl.Flush ();
- }
-
- [Conditional("DEBUG")]
- public static void Indent ()
- {
- TraceImpl.Indent ();
- }
-
- [Conditional("DEBUG")]
- public static void Unindent ()
- {
- TraceImpl.Unindent ();
- }
-
- [Conditional("DEBUG")]
- public static void Write (object value)
- {
- TraceImpl.Write (value);
- }
-
- [Conditional("DEBUG")]
- public static void Write (string message)
- {
- TraceImpl.Write (message);
- }
-
- [Conditional("DEBUG")]
- public static void Write (object value, string category)
- {
- TraceImpl.Write (value, category);
- }
-
- [Conditional("DEBUG")]
- public static void Write (string message, string category)
- {
- TraceImpl.Write (message, category);
- }
-
- [Conditional("DEBUG")]
- public static void WriteIf (bool condition, object value)
- {
- TraceImpl.WriteIf (condition, value);
- }
-
- [Conditional("DEBUG")]
- public static void WriteIf (bool condition, string message)
- {
- TraceImpl.WriteIf (condition, message);
- }
-
- [Conditional("DEBUG")]
- public static void WriteIf (bool condition, object value,
- string category)
- {
- TraceImpl.WriteIf (condition, value, category);
- }
-
- [Conditional("DEBUG")]
- public static void WriteIf (bool condition, string message,
- string category)
- {
- TraceImpl.WriteIf (condition, message, category);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLine (object value)
- {
- TraceImpl.WriteLine (value);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLine (string message)
- {
- TraceImpl.WriteLine (message);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLine (object value, string category)
- {
- TraceImpl.WriteLine (value, category);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLine (string message, string category)
- {
- TraceImpl.WriteLine (message, category);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLineIf (bool condition, object value)
- {
- TraceImpl.WriteLineIf (condition, value);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLineIf (bool condition, string message)
- {
- TraceImpl.WriteLineIf (condition, message);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLineIf (bool condition, object value,
- string category)
- {
- TraceImpl.WriteLineIf (condition, value, category);
- }
-
- [Conditional("DEBUG")]
- public static void WriteLineIf (bool condition, string message,
- string category)
- {
- TraceImpl.WriteLineIf (condition, message, category);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs b/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs
deleted file mode 100644
index d13d0aae8ef..00000000000
--- a/mcs/class/System/System.Diagnostics/DefaultTraceListener.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-//
-// System.Diagnostics.DefaultTraceListener.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// (C) 2002 Jonathan Pryor
-//
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace System.Diagnostics {
-
- [ComVisible(false)]
- public class DefaultTraceListener : TraceListener {
-
- private static readonly bool OnWin32;
-
- private static readonly string ConsoleOutTrace = "Console.Out";
- private static readonly string ConsoleErrorTrace = "Console.Error";
-
- private static readonly string MonoTracePrefix;
- private static readonly string MonoTraceFile;
-
- static DefaultTraceListener ()
- {
- // Determine what platform we're on. This impacts how where we send
- // messages. On Win32 platforms (OnWin32 = true), we use the
- // `OutputDebugString' api.
- //
- // On Linux platforms, we use MONO_TRACE to figure things out. See the
- // API documentation for more information on MONO_TRACE.
- OnWin32 = (Path.DirectorySeparatorChar == '\\');
-
- if (!OnWin32) {
- // If we're running on Unix, we don't have OutputDebugString.
- // Instead, send output to...wherever the MONO_TRACE environment
- // variables says to.
- String where = Environment.GetEnvironmentVariable("MONO_TRACE");
-
- if (where != null) {
- string file = null;
- string prefix = null;
-
- if (where.StartsWith (ConsoleOutTrace)) {
- file = ConsoleOutTrace;
- prefix = GetPrefix (where, ConsoleOutTrace);
- }
- else if (where.StartsWith (ConsoleErrorTrace)) {
- file = ConsoleErrorTrace;
- prefix = GetPrefix (where, ConsoleErrorTrace);
- }
- else {
- file = where;
-
- // We can't firgure out what the prefix would be, as ':' is a
- // valid filename character. Thus, arbitrary files don't support
- // prefixes.
- //
- // I don't consider this to be a major issue. Prefixes are useful
- // with Console.Out and Console.Error to help separate trace
- // output from the actual program output. Writing to an arbitrary
- // file doesn't introduce issues with disambiguation.
- prefix = "";
- }
-
- MonoTraceFile = file;
- MonoTracePrefix = prefix;
- }
- }
- }
-
- /**
- * Get the prefix for the specified variable.
- *
- * "Prefixes" are used in the MONO_TRACE variable, and specify text that
- * should precede each message printed to the console. The prefix is
- * appended to the console location with a colon (':') separating them.
- * For example, if MONO_TRACE is "Console.Out:** my prefix", the prefix is
- * "** my prefix".
- *
- * Everything after the colon, if the colon is present, is used as the
- * prefix.
- *
- * @param var The current MONO_TRACE variable
- * @param where The name of the output location, e.g. "Console.Out"
- */
- private static string GetPrefix (string var, string where)
- {
- // actually, we permit any character to separate `where' and the prefix;
- // we just skip over where the ':' would be. This means that a space or
- // anything else would suffice, as long as it was only a single
- // character.
- if (var.Length > where.Length)
- return var.Substring (where.Length + 1);
- return "";
- }
-
- private string logFileName = null;
-
- public DefaultTraceListener () : base ("Default")
- {
- }
-
- // It's hard to do anything with a UI when we don't have Windows.Forms...
- [MonoTODO]
- public bool AssertUiEnabled {
- get {return false;}
- set {/* ignore */}
- }
-
- [MonoTODO]
- public string LogFileName {
- get {return logFileName;}
- set {logFileName = value;}
- }
-
- public override void Fail (string message)
- {
- base.Fail (message);
- WriteLine (new StackTrace().ToString());
- }
-
- public override void Fail (string message, string detailMessage)
- {
- base.Fail (message, detailMessage);
- WriteLine (new StackTrace().ToString());
- }
-
- [DllImport ("kernel32.dll", CharSet=CharSet.Auto)]
- private extern static void OutputDebugString (string message);
-
- private void WriteDebugString (string message)
- {
- if (OnWin32)
- OutputDebugString (message);
- else
- WriteMonoTrace (message);
- }
-
- private void WriteMonoTrace (string message)
- {
- switch (MonoTraceFile) {
- case "Console.Out":
- Console.Out.Write (message);
- break;
- case "Console.Error":
- Console.Error.Write (message);
- break;
- default:
- WriteLogFile (message, MonoTraceFile);
- break;
- }
- }
-
- private void WritePrefix ()
- {
- if (!OnWin32) {
- WriteMonoTrace (MonoTracePrefix);
- }
- }
-
- private void WriteImpl (string message)
- {
- if (NeedIndent) {
- WriteIndent ();
- WritePrefix ();
- }
-
- WriteDebugString (message);
-
- if (Debugger.IsLogging())
- Debugger.Log (0, null, message);
-
- WriteLogFile (message, LogFileName);
- }
-
- private void WriteLogFile (string message, string logFile)
- {
- string fname = logFile;
- if (fname != null && fname.Length != 0) {
- FileInfo info = new FileInfo (fname);
- StreamWriter sw = null;
-
- // Open the file
- try {
- if (info.Exists)
- sw = info.AppendText ();
- else
- sw = info.CreateText ();
- }
- catch {
- // We weren't able to open the file for some reason.
- // We can't write to the log file; so give up.
- return;
- }
-
- using (sw) {
- sw.Write (message);
- sw.Flush ();
- }
- }
- }
-
- public override void Write (string message)
- {
- WriteImpl (message);
- }
-
- public override void WriteLine (string message)
- {
- string msg = message + Environment.NewLine;
- WriteImpl (msg);
-
- NeedIndent = true;
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs b/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
deleted file mode 100644
index f99cd1094c4..00000000000
--- a/mcs/class/System/System.Diagnostics/DiagnosticsConfigurationHandler.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Diagnostics.DiagnosticsConfigurationHandler.cs
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// Author:
-// John R. Hicks <angryjohn69@nc.rr.com>
-//
-// (C) 2002
-//
-using System;
-using System.Configuration;
-using System.Xml;
-
-namespace System.Diagnostics
-{
- public class DiagnosticsConfigurationHandler :
- IConfigurationSectionHandler
- {
- public DiagnosticsConfigurationHandler()
- {
-
- }
-
- public virtual object Create(
- object parent,
- object configContext,
- XmlNode section)
- {
- throw new NotImplementedException();
- }
-
-
- ~DiagnosticsConfigurationHandler()
- {
-
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EntryWrittenEventArgs.cs b/mcs/class/System/System.Diagnostics/EntryWrittenEventArgs.cs
deleted file mode 100644
index 21e007dbe84..00000000000
--- a/mcs/class/System/System.Diagnostics/EntryWrittenEventArgs.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Diagnostics.EntryWrittenEventArgs.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace System.Diagnostics {
-
- public class EntryWrittenEventArgs : EventArgs {
-
- private EventLogEntry entry;
-
- public EntryWrittenEventArgs () : this (null)
- {
- }
-
- public EntryWrittenEventArgs (EventLogEntry entry)
- {
- this.entry = entry;
- }
-
- public EventLogEntry Entry {
- get {return entry;}
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EntryWrittenEventHandler.cs b/mcs/class/System/System.Diagnostics/EntryWrittenEventHandler.cs
deleted file mode 100644
index beecc3ab8ab..00000000000
--- a/mcs/class/System/System.Diagnostics/EntryWrittenEventHandler.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Diagnostics.EntryWrittenEventHandler.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace System.Diagnostics {
-
- public delegate void EntryWrittenEventHandler(
- object sender,
- EntryWrittenEventArgs e);
-
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLog.cs b/mcs/class/System/System.Diagnostics/EventLog.cs
deleted file mode 100644
index 477191cd8af..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLog.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-// System.Diagnostics.EventLog.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-using System.ComponentModel;
-
-namespace System.Diagnostics {
-
- [MonoTODO("This class is just stubbed out")]
- public class EventLog : Component, ISupportInitialize {
-
- private string source;
- private string logName;
- private string machineName;
-
- public EventLog() : this ("")
- {
- }
-
- public EventLog(string logName) : this (logName, "")
- {
- }
-
- public EventLog(string logName, string machineName)
- : this (logName, machineName, "")
- {
- }
-
- public EventLog(string logName, string machineName,
- string source)
- {
- this.source = source;
- this.machineName = machineName;
- this.logName = logName;
- }
-
-// [MonoTODO]
-// public bool EnableRaisingEvents {
-// get {return false;}
-// set {/* ignore */}
-// }
-//
-// [MonoTODO]
-// public EventLogEntryCollection Entries {
-// get {return null;}
-// }
-//
-// [MonoTODO]
-// public string Log {
-// get {return log;}
-// set {log = value;}
-// }
-//
-// [MonoTODO]
-// public string LogDisplayName {
-// get {return "";}
-// }
-//
-// [MonoTODO]
-// public string MachineName {
-// get {return machineName;}
-// set {/* ignore */}
-// }
-//
-// [MonoTODO]
-// public string Source {
-// get {return source;}
-// set {/* ignore */}
-// }
-//
-// [MonoTODO]
-// public ISynchronizeInvoke SynchronizingObject {
-// get {return null;}
-// set {/* ignore */}
-// }
-//
- [MonoTODO]
- public void BeginInit()
- {
- throw new NotImplementedException ();
- }
-
-// [MonoTODO]
-// public void Clear()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void Close()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void CreateEventSource(string source,
-// string logName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void CreateEventSource(string source,
-// string logName,
-// string machineName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void Delete(string logName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void Delete(string logName, string machineName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DeleteEventSource(string source)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void DeleteEventSource(string source,
-// string machineName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// protected override void Dispose(bool disposing)
-// {
-// throw new NotImplementedException ();
-// }
-//
- [MonoTODO]
- public void EndInit()
- {
- throw new NotImplementedException ();
- }
-
-// [MonoTODO]
-// public static bool Exists(string logName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static bool Exists(string logName, string machineName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static EventLog[] GetEventLogs()
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static EventLog[] GetEventLogs(string machineName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static string LogNameFromSourceName(string source,
-// string machineName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static bool SourceExists(string source)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static bool SourceExists(string source,
-// string machineName)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void WriteEntry(string message)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void WriteEntry(string message, EventLogEntryType type)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void WriteEntry(string source, string message)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void WriteEntry(string message, EventLogEntryType type,
-// int eventID)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void WriteEntry(string source, string message,
-// EventLogEntryType type)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void WriteEntry(string message, EventLogEntryType type,
-// int eventID,
-// short category)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void WriteEntry(string source, string message,
-// EventLogEntryType type, int eventID)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public void WriteEntry(string message, EventLogEntryType type,
-// int eventID,
-// short category, byte[] rawData)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void WriteEntry(string source, string message,
-// EventLogEntryType type, int eventID, short category)
-// {
-// throw new NotImplementedException ();
-// }
-//
-// [MonoTODO]
-// public static void WriteEntry(string source, string message,
-// EventLogEntryType type, int eventID, short category,
-// byte[] rawData)
-// {
-// throw new NotImplementedException ();
-// }
-
- public event EntryWrittenEventHandler EntryWritten;
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogEntry.cs b/mcs/class/System/System.Diagnostics/EventLogEntry.cs
deleted file mode 100644
index 32fb4533254..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogEntry.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// System.Diagnostics.EventLogEntry.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Runtime.Serialization;
-
-namespace System.Diagnostics {
-
- [Serializable]
- [MonoTODO("Just stubbed out")]
- public sealed class EventLogEntry : Component, ISerializable {
-
- [MonoTODO]
- internal EventLogEntry ()
- {
- }
-
-// [MonoTODO]
-// public string Categery {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public short CategoryNumber {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public byte[] Data {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public EventLogEntryType EntryType {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public int EventID {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public int Index {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public string Machineame {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public string Message {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public string[] ReplacementStrings {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public string Source {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public DateTime TimeGenerated {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public DateTime TimeWritten {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public string UserName {
-// get {throw new NotImplementedException ();}
-// }
-//
-// [MonoTODO]
-// public bool Equals(EventLogEntry otherEntry)
-// {
-// throw new NotImplementedException ();
-// }
-//
- [MonoTODO]
- void ISerializable.GetObjectData(SerializationInfo info,
- StreamingContext context)
- {
- throw new NotImplementedException ();
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs b/mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs
deleted file mode 100644
index 746eec2a6c2..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogEntryCollection.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Diagnostics.EventLogEntryCollection.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- public class EventLogEntryCollection : ICollection, IEnumerable {
-
- private ArrayList eventLogs = new ArrayList ();
-
- internal EventLogEntryCollection()
- {
- }
-
- public int Count {
- get {return eventLogs.Count;}
- }
-
- public virtual EventLogEntry this [int index] {
- get {return (EventLogEntry) eventLogs[index];}
- }
-
- bool ICollection.IsSynchronized {
- get {return eventLogs.IsSynchronized;}
- }
-
- object ICollection.SyncRoot {
- get {return eventLogs.SyncRoot;}
- }
-
- public void CopyTo (EventLogEntry[] eventLogs, int index)
- {
- eventLogs.CopyTo (eventLogs, index);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return eventLogs.GetEnumerator ();
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- eventLogs.CopyTo (array, index);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogEntryType.cs b/mcs/class/System/System.Diagnostics/EventLogEntryType.cs
deleted file mode 100644
index 0d52a79f31c..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogEntryType.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Diagnostics.EventLogEntryType.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- [Serializable]
- public enum EventLogEntryType {
- Error = 0x01,
- Warning = 0x02,
- Information = 0x04,
- SuccessAudit = 0x08,
- FailureAudit = 0x10
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogInstaller.cs b/mcs/class/System/System.Diagnostics/EventLogInstaller.cs
deleted file mode 100644
index c49935cb714..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogInstaller.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.Diagnostics.EventLogInstaller.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-
-// using System.Configuration.Install;
-
-namespace System.Diagnostics {
-
- [MonoTODO]
- public class EventLogInstaller
-// : ComponentInstaller
- {
-// [MonoTODO]
-// public EventLogInstaller()
-// {
-// }
-//
-// [MonoTODO]
-// public string Log {
-// get {throw new NotImplementedException();}
-// set {throw new NotImplementedException();}
-// }
-//
-// [MonoTODO]
-// public string Source {
-// get {throw new NotImplementedException();}
-// set {throw new NotImplementedException();}
-// }
-//
-// [MonoTODO]
-// public UninstallAction UninstallAction {
-// get {throw new NotImplementedException();}
-// set {throw new NotImplementedException();}
-// }
-//
-// // may throw ArgumentException if
-// // - component isn't an EventlOg
-// // - The Log or Source properties are null or ""
-// [MonoTODO]
-// public override void CopyFromComponenet(IComponent component)
-// {
-// }
-//
-// // may throw PlatformNotSupportedException if not >= NT4
-// [MonoTODO]
-// public override void Install(IDictionary stateSaver)
-// {
-// }
-//
-// [MonoTODO]
-// public override bool IsEquivalentInstaller(
-// ComponentInstaller otherInstaller)
-// {
-// }
-//
-// [MonoTODO]
-// public override void Rollback(IDictionary savedState)
-// {
-// }
-//
-// [MonoTODO]
-// public override void Uninstall(IDictionary savedState)
-// {
-// }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogPermission.cs b/mcs/class/System/System.Diagnostics/EventLogPermission.cs
deleted file mode 100644
index 1858ab6794a..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogPermission.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Diagnostics.EventLogPermission.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-using System;
-using System.Diagnostics;
-using System.Security.Permissions;
-
-namespace System.Diagnostics {
-
- [Serializable]
- [MonoTODO("Just Stubbed Out")]
- public class EventLogPermission
-// : ResourcePermissionBase
- {
-// [MonoTODO]
-// public EventLogPermission()
-// {
-// }
-//
-// [MonoTODO]
-// public EventLogPermission(
-// EventLogPermissionEntry[] permissionAccessEntries)
-// {
-// }
-//
-// [MonoTODO]
-// public EventLogPermission(PermissionState state)
-// {
-// }
-//
-// [MonoTODO]
-// public EventLogPermission(
-// EventLogPermissionAccess permissionAccess,
-// string machineName)
-// {
-// }
-//
-// [MonoTODO]
-// public EventLogPermissionEntryCollection PermissionEntries {
-// get {throw new NotImplementedException();}
-// }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs b/mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs
deleted file mode 100644
index 8ae00f87ae1..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogPermissionAccess.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Diagnostics.EventLogPermissionAccess.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-using System;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- [Flags, Serializable]
- public enum EventLogPermissionAccess {
- None=0,
- Browse=0x2,
- Instrument=0x6,
- Audit=0xA,
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs b/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs
deleted file mode 100644
index 17eb6ca9935..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogPermissionAttribute.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Diagnostics.EventLogPermissionAttribute.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Diagnostics {
-
- [AttributeUsage(
- AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Event)]
- [Serializable]
- [MonoTODO("Just Stubbed Out")]
- public class EventLogPermissionAttribute : CodeAccessSecurityAttribute {
-
- public EventLogPermissionAttribute(SecurityAction action)
- : base(action)
- {
- }
-
-// // May throw ArgumentException if computer name is invalid
-// public string MachineName {
-// get {throw new NotImplementedException();}
-// set {throw new NotImplementedException();}
-// }
-//
-// public EventLogPermissionAccess PermissionAccess {
-// get {throw new NotImplementedException();}
-// set {throw new NotImplementedException();}
-// }
-//
- [MonoTODO]
- public override IPermission CreatePermission()
- {
- throw new NotImplementedException();
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogPermissionEntry.cs b/mcs/class/System/System.Diagnostics/EventLogPermissionEntry.cs
deleted file mode 100644
index efcbbc2016f..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogPermissionEntry.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Diagnostics.EventLogPermissionEntry.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- [Serializable]
- [MonoTODO("Just Stubbed Out")]
- public class EventLogPermissionEntry {
-
-// [MonoTODO]
-// public EventLogPermissionEntry(
-// EventLogPermissionAccess permissionAccess,
-// string machineName)
-// {
-// }
-//
-// [MonoTODO]
-// public string MachineName {
-// get {throw new NotImplementedException();}
-// }
-//
-// [MonoTODO]
-// public EventLogPermissionAccess PermissionAccess {
-// get {throw new NotImplementedException();}
-// }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogPermissionEntryCollection.cs b/mcs/class/System/System.Diagnostics/EventLogPermissionEntryCollection.cs
deleted file mode 100644
index e078af0a509..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogPermissionEntryCollection.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// System.Diagnostics.EventLogEntryCollection.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- [MonoTODO]
- public class EventLogPermissionEntryCollection : CollectionBase {
-
- [MonoTODO]
- internal EventLogPermissionEntryCollection()
- {
- }
-
-// [MonoTODO]
-// public virtual EventLogEntry this [int index] {
-// get {throw new NotImplementedException();}
-// }
-//
-// [MonoTODO]
-// public int Add(EventLogPermissionEntry value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public void AddRange(EventLogPermissionEntry[] value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public void AddRange(EventLogPermissionEntryCollection value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public bool Contains(EventLogPermissionEntry value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public void CopyTo(EventLogPermissionEntry[] array, int index)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public int IndexOf(EventLogPermissionEntry value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public void Insert(int index, EventLogPermissionEntry value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected override void OnClear()
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected override void OnInsert(int index, object value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected override void OnRemove(int index, object value)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected override void OnSet(int index, object oldValue,
-// object newValue)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public void Remove(EventLogPermissionEntry value)
-// {
-// throw new NotImplementedException();
-// }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/EventLogTraceListener.cs b/mcs/class/System/System.Diagnostics/EventLogTraceListener.cs
deleted file mode 100644
index 56115b44522..00000000000
--- a/mcs/class/System/System.Diagnostics/EventLogTraceListener.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.Diagnostics.EventLogTraceListener.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- [MonoTODO]
- public class EventLogTraceListener : TraceListener {
-
-// [MonoTODO]
-// public EventLogTraceListener()
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public EventLogTraceListener(EventLog eventLog)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public EventLogTraceListener(string source)
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// public EventLog EventLog {
-// get {throw new NotImplementedException();}
-// set {throw new NotImplementedException();}
-// }
-//
-// [MonoTODO]
-// public override string Name {
-// get {throw new NotImplementedException();}
-// set {throw new NotImplementedException();}
-// }
-//
-// [MonoTODO]
-// public override void Close()
-// {
-// throw new NotImplementedException();
-// }
-//
-// [MonoTODO]
-// protected override void Dispose(bool disposing)
-// {
-// throw new NotImplementedException();
-// }
-//
- [MonoTODO]
- public override void Write(string message)
- {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public override void WriteLine(string message)
- {
- throw new NotImplementedException();
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs b/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
deleted file mode 100755
index 1291d4020a6..00000000000
--- a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
+++ /dev/null
@@ -1,274 +0,0 @@
-//
-// System.Diagnostics.FileVersionInfo.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Diagnostics {
- public sealed class FileVersionInfo {
- /* There is no public constructor for this class, it
- * is initialised by the runtime. All the private
- * variables here are looked up by name, so dont
- * change them without also changing the runtime
- */
- private string comments;
- private string companyname;
- private string filedescription;
- private string filename;
- private string fileversion;
- private string internalname;
- private string language;
- private string legalcopyright;
- private string legaltrademarks;
- private string originalfilename;
- private string privatebuild;
- private string productname;
- private string productversion;
- private string specialbuild;
- private bool isdebug;
- private bool ispatched;
- private bool isprerelease;
- private bool isprivatebuild;
- private bool isspecialbuild;
- private int filemajorpart;
- private int fileminorpart;
- private int filebuildpart;
- private int fileprivatepart;
- private int productmajorpart;
- private int productminorpart;
- private int productbuildpart;
- private int productprivatepart;
-
- private FileVersionInfo() {
- /* This is here just to shut the compiler up */
- comments=null;
- companyname=null;
- filedescription=null;
- filename=null;
- fileversion=null;
- internalname=null;
- language=null;
- legalcopyright=null;
- legaltrademarks=null;
- originalfilename=null;
- privatebuild=null;
- productname=null;
- productversion=null;
- specialbuild=null;
- isdebug=false;
- ispatched=false;
- isprerelease=false;
- isprivatebuild=false;
- isspecialbuild=false;
- filemajorpart=0;
- fileminorpart=0;
- filebuildpart=0;
- fileprivatepart=0;
- productmajorpart=0;
- productminorpart=0;
- productbuildpart=0;
- productprivatepart=0;
- }
-
-
- public string Comments {
- get {
- return(comments);
- }
- }
-
- public string CompanyName {
- get {
- return(companyname);
- }
- }
-
- public int FileBuildPart {
- get {
- return(filebuildpart);
- }
- }
-
- public string FileDescription {
- get {
- return(filedescription);
- }
- }
-
- public int FileMajorPart {
- get {
- return(filemajorpart);
- }
- }
-
- public int FileMinorPart {
- get {
- return(fileminorpart);
- }
- }
-
- public string FileName {
- get {
- return(filename);
- }
- }
-
- public int FilePrivatePart {
- get {
- return(fileprivatepart);
- }
- }
-
- public string FileVersion {
- get {
- return(fileversion);
- }
- }
-
- public string InternalName {
- get {
- return(internalname);
- }
- }
-
- public bool IsDebug {
- get {
- return(isdebug);
- }
- }
-
- public bool IsPatched {
- get {
- return(ispatched);
- }
- }
-
- public bool IsPreRelease {
- get {
- return(isprerelease);
- }
- }
-
- public bool IsPrivateBuild {
- get {
- return(isprivatebuild);
- }
- }
-
- public bool IsSpecialBuild {
- get {
- return(isspecialbuild);
- }
- }
-
- public string Language {
- get {
- return(language);
- }
- }
-
- public string LegalCopyright {
- get {
- return(legalcopyright);
- }
- }
-
- public string LegalTrademarks {
- get {
- return(legaltrademarks);
- }
- }
-
- public string OriginalFilename {
- get {
- return(originalfilename);
- }
- }
-
- public string PrivateBuild {
- get {
- return(privatebuild);
- }
- }
-
- public int ProductBuildPart {
- get {
- return(productbuildpart);
- }
- }
-
- public int ProductMajorPart {
- get {
- return(productmajorpart);
- }
- }
-
- public int ProductMinorPart {
- get {
- return(productminorpart);
- }
- }
-
- public string ProductName {
- get {
- return(productname);
- }
- }
-
- public int ProductPrivatePart {
- get {
- return(productprivatepart);
- }
- }
-
- public string ProductVersion {
- get {
- return(productversion);
- }
- }
-
- public string SpecialBuild {
- get {
- return(specialbuild);
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void GetVersionInfo_internal(string fileName);
-
- public static FileVersionInfo GetVersionInfo(string fileName) {
- FileVersionInfo fvi=new FileVersionInfo();
-
- fvi.GetVersionInfo_internal(fileName);
-
- return(fvi);
- }
-
- public override string ToString() {
- string str;
-
- str="File: " + filename + "\n";
- str+="InternalName: " + internalname + "\n";
- str+="OriginalFilename: " + originalfilename + "\n";
- str+="FileVersion: " + fileversion + "\n";
- str+="FileDescription: " + filedescription + "\n";
- str+="Product: " + productname + "\n";
- str+="ProductVersion: " + productversion + "\n";
- str+="Debug: " + isdebug + "\n";
- str+="Patched: " + ispatched + "\n";
- str+="PreRelease: " + isprerelease + "\n";
- str+="PrivateBuild: " + isprivatebuild + "\n";
- str+="SpecialBuild: " + isspecialbuild + "\n";
- str+="Language " + language + "\n";
-
- return(str);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/ICollectData.cs b/mcs/class/System/System.Diagnostics/ICollectData.cs
deleted file mode 100644
index 8ed58307627..00000000000
--- a/mcs/class/System/System.Diagnostics/ICollectData.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Diagnostics.ICollectData.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace System.Diagnostics {
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ICollectData {
- void CloseData ();
- void CollectData (
- int id,
- IntPtr valueName,
- IntPtr data,
- int totalBytes,
- out IntPtr res);
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs
deleted file mode 100755
index b2f1572e913..00000000000
--- a/mcs/class/System/System.Diagnostics/Process.cs
+++ /dev/null
@@ -1,545 +0,0 @@
-//
-// System.Diagnostics.Process.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System;
-using System.IO;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Diagnostics {
- public class Process : Component {
- [StructLayout(LayoutKind.Sequential)]
- private struct ProcInfo {
- public IntPtr process_handle;
- public IntPtr thread_handle;
- public int pid;
- public int tid;
- };
-
- IntPtr process_handle;
- int pid;
-
- /* Private constructor called from other methods */
- private Process(IntPtr handle, int id) {
- process_handle=handle;
- pid=id;
- }
-
- [MonoTODO]
- public Process() {
- }
-
- [MonoTODO]
- public int BasePriority {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public bool EnableRaisingEvents {
- get {
- return(false);
- }
- set {
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int ExitCode_internal(IntPtr handle);
-
- public int ExitCode {
- get {
- return(ExitCode_internal(process_handle));
- }
- }
-
- /* Returns the process start time in Windows file
- * times (ticks from DateTime(1/1/1601 00:00 GMT))
- */
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static long ExitTime_internal(IntPtr handle);
-
- public DateTime ExitTime {
- get {
- return(DateTime.FromFileTime(ExitTime_internal(process_handle)));
- }
- }
-
- public IntPtr Handle {
- get {
- return(process_handle);
- }
- }
-
- [MonoTODO]
- public int HandleCount {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public bool HasExited {
- get {
- return(false);
- }
- }
-
- public int Id {
- get {
- return(pid);
- }
- }
-
- [MonoTODO]
- public string MachineName {
- get {
- return("localhost");
- }
- }
-
- public ProcessModule MainModule {
- get {
- return(this.Modules[0]);
- }
- }
-
- [MonoTODO]
- public IntPtr MainWindowHandle {
- get {
- return((IntPtr)0);
- }
- }
-
- [MonoTODO]
- public string MainWindowTitle {
- get {
- return("null");
- }
- }
-
- [MonoTODO]
- public IntPtr MaxWorkingSet {
- get {
- return((IntPtr)0);
- }
- set {
- }
- }
-
- [MonoTODO]
- public IntPtr MinWorkingSet {
- get {
- return((IntPtr)0);
- }
- set {
- }
- }
-
- /* Returns the list of process modules. The main module is
- * element 0.
- */
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern ProcessModule[] GetModules_internal();
-
- private ProcessModuleCollection module_collection;
-
- public ProcessModuleCollection Modules {
- get {
- if(module_collection==null) {
- module_collection=new ProcessModuleCollection(GetModules_internal());
- }
-
- return(module_collection);
- }
- }
-
- [MonoTODO]
- public int NonpagedSystemMemorySize {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int PagedMemorySize {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int PagedSystemMemorySize {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int PeakPagedMemorySize {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int PeakVirtualMemorySize {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int PeakWorkingSet {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public bool PriorityBoostEnabled {
- get {
- return(false);
- }
- set {
- }
- }
-
- [MonoTODO]
- public ProcessPriorityClass PriorityClass {
- get {
- return(ProcessPriorityClass.Normal);
- }
- set {
- }
- }
-
- [MonoTODO]
- public int PrivateMemorySize {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public TimeSpan PrivilegedProcessorTime {
- get {
- return(new TimeSpan(0));
- }
- }
-
- [MonoTODO]
- public string ProcessName {
- get {
- return("this-process");
- }
- }
-
- [MonoTODO]
- public IntPtr ProcessorAffinity {
- get {
- return((IntPtr)0);
- }
- set {
- }
- }
-
- [MonoTODO]
- public bool Responding {
- get {
- return(false);
- }
- }
-
- [MonoTODO]
- public StreamReader StandardError {
- get {
- return(null);
- }
- }
-
- [MonoTODO]
- public StreamWriter StandardInput {
- get {
- return(null);
- }
- }
-
- [MonoTODO]
- public StreamReader StandardOutput {
- get {
- return(null);
- }
- }
-
- private ProcessStartInfo start_info=null;
-
- public ProcessStartInfo StartInfo {
- get {
- if(start_info==null) {
- start_info=new ProcessStartInfo();
- }
-
- return(start_info);
- }
- set {
- if(value==null) {
- throw new ArgumentException("value is null");
- }
-
- start_info=value;
- }
- }
-
- /* Returns the process start time in Windows file
- * times (ticks from DateTime(1/1/1601 00:00 GMT))
- */
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static long StartTime_internal(IntPtr handle);
-
- public DateTime StartTime {
- get {
- return(DateTime.FromFileTime(StartTime_internal(process_handle)));
- }
- }
-
- [MonoTODO]
- public ISynchronizeInvoke SynchronizingObject {
- get {
- return(null);
- }
- set {
- }
- }
-
- [MonoTODO]
- public ProcessThreadCollection Threads {
- get {
- return(null);
- }
- }
-
- [MonoTODO]
- public TimeSpan TotalProcessorTime {
- get {
- return(new TimeSpan(0));
- }
- }
-
- [MonoTODO]
- public TimeSpan UserProcessorTime {
- get {
- return(new TimeSpan(0));
- }
- }
-
- [MonoTODO]
- public int VirtualMemorySize {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int WorkingSet {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public void Close() {
- }
-
- [MonoTODO]
- public bool CloseMainWindow() {
- return(false);
- }
-
- [MonoTODO]
- public static void EnterDebugMode() {
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static IntPtr GetCurrentProcess_internal();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int GetPid_internal();
-
- public static Process GetCurrentProcess() {
- return(new Process(GetCurrentProcess_internal(),
- GetPid_internal()));
- }
-
- [MonoTODO]
- public static Process GetProcessById(int processId) {
- return(null);
- }
-
- [MonoTODO]
- public static Process GetProcessById(int processId, string machineName) {
- return(null);
- }
-
- [MonoTODO]
- public static Process[] GetProcesses() {
- return(null);
- }
-
- [MonoTODO]
- public static Process[] GetProcesses(string machineName) {
- return(null);
- }
-
- [MonoTODO]
- public static Process[] GetProcessesByName(string processName) {
- return(null);
- }
-
- [MonoTODO]
- public static Process[] GetProcessesByName(string processName, string machineName) {
- return(null);
- }
-
- [MonoTODO]
- public void Kill() {
- }
-
- [MonoTODO]
- public static void LeaveDebugMode() {
- }
-
- [MonoTODO]
- public void Refresh() {
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Start_internal(string file,
- string args,
- ref ProcInfo proc_info);
-
- [MonoTODO("file descriptors and the rest of ProcessStartInfo")]
- public bool Start() {
- bool ret;
- ProcInfo proc_info=new ProcInfo();
-
- ret=Start_internal(start_info.FileName,
- start_info.Arguments,
- ref proc_info);
-
- if(ret==true) {
- process_handle=proc_info.process_handle;
- pid=proc_info.pid;
- }
-
- return(ret);
- }
-
- [MonoTODO("file descriptors and the rest of ProcessStartInfo")]
- public static Process Start(ProcessStartInfo startInfo) {
- bool ret;
- ProcInfo proc_info=new ProcInfo();
-
- ret=Start_internal(startInfo.FileName,
- startInfo.Arguments, ref proc_info);
-
- if(ret==true) {
- return(new Process(proc_info.process_handle,
- proc_info.pid));
- } else {
- return(null);
- }
- }
-
- [MonoTODO]
- public static Process Start(string fileName) {
- return(null);
- }
-
- [MonoTODO]
- public static Process Start(string fileName, string arguments) {
- return(null);
- }
-
- [MonoTODO]
- public override string ToString() {
- return("process name");
- }
-
- /* Waits up to ms milliseconds for process 'handle' to
- * exit. ms can be <0 to mean wait forever.
- */
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern bool WaitForExit_internal(IntPtr handle,
- int ms);
-
- public void WaitForExit() {
- WaitForExit_internal(process_handle, -1);
- }
-
- public bool WaitForExit(int milliseconds) {
- return(WaitForExit_internal(process_handle,
- milliseconds));
- }
-
- [MonoTODO]
- public bool WaitForInputIdle() {
- return(false);
- }
-
- [MonoTODO]
- public bool WaitForInputIdle(int milliseconds) {
- return(false);
- }
-
- [MonoTODO]
- public event EventHandler Exited;
-
- // Closes the system process handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void Process_free_internal(IntPtr handle);
-
- private bool disposed = false;
-
- protected override void Dispose(bool disposing) {
- // Check to see if Dispose has already been called.
- if(this.disposed) {
- // If this is a call to Dispose,
- // dispose all managed resources.
- if(disposing) {
- // Do stuff here
- }
-
- // Release unmanaged resources
- this.disposed=true;
-
- lock(this) {
- if(process_handle!=IntPtr.Zero) {
-
- Process_free_internal(process_handle);
- process_handle=IntPtr.Zero;
- }
- }
- }
- }
-
- public override void Dispose() {
- Dispose(true);
- // Take yourself off the Finalization queue
- GC.SuppressFinalize(this);
- }
-
- [MonoTODO]
- protected void OnExited() {
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/ProcessModule.cs b/mcs/class/System/System.Diagnostics/ProcessModule.cs
deleted file mode 100755
index a2b17a43f16..00000000000
--- a/mcs/class/System/System.Diagnostics/ProcessModule.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Diagnostics.ProcessModule.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Diagnostics {
- public class ProcessModule : Component {
- private IntPtr baseaddr;
- private IntPtr entryaddr;
- private string filename;
- private FileVersionInfo version_info;
- private int memory_size;
- private string modulename;
-
- internal ProcessModule(IntPtr baseaddr, IntPtr entryaddr,
- string filename,
- FileVersionInfo version_info,
- int memory_size, string modulename) {
- this.baseaddr=baseaddr;
- this.entryaddr=entryaddr;
- this.filename=filename;
- this.version_info=version_info;
- this.memory_size=memory_size;
- this.modulename=modulename;
- }
-
- public IntPtr BaseAddress {
- get {
- return(baseaddr);
- }
- }
-
- public IntPtr EntryPointAddress {
- get {
- return(entryaddr);
- }
- }
-
- public string FileName {
- get {
- return(filename);
- }
- }
-
- public FileVersionInfo FileVersionInfo {
- get {
- return(version_info);
- }
- }
-
- public int ModuleMemorySize {
- get {
- return(memory_size);
- }
- }
-
- public string ModuleName {
- get {
- return(modulename);
- }
- }
-
- public override string ToString() {
- return(this.ModuleName);
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs b/mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs
deleted file mode 100755
index c9ebdcefd5a..00000000000
--- a/mcs/class/System/System.Diagnostics/ProcessModuleCollection.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Diagnostics.ProcessModuleCollection.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Diagnostics {
- public class ProcessModuleCollection : ReadOnlyCollectionBase {
- private ProcessModule[] modules;
-
- [MonoTODO]
- protected ProcessModuleCollection() {
- }
-
- public ProcessModuleCollection(ProcessModule[] processModules) {
- modules=processModules;
- }
-
- public ProcessModule this[int index] {
- get {
- return(modules[index]);
- }
- }
-
- public bool Contains(ProcessModule module) {
- foreach(ProcessModule test in modules) {
- if(module==test) {
- return(true);
- }
- }
-
- return(false);
- }
-
- [MonoTODO]
- public void CopyTo(ProcessModule[] array, int index) {
- }
-
- public int IndexOf(ProcessModule module) {
- int i;
-
- for(i=0; i<modules.Length; i++) {
- if(modules[i]==module) {
- return(i);
- }
- }
-
- // FIXME!
- return(0);
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ProcessPriorityClass.cs b/mcs/class/System/System.Diagnostics/ProcessPriorityClass.cs
deleted file mode 100755
index 4218bb4390e..00000000000
--- a/mcs/class/System/System.Diagnostics/ProcessPriorityClass.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Diagnostics.ProcessPriorityClass.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics {
- [Serializable]
- public enum ProcessPriorityClass {
- AboveNormal=0x08000,
- BelowNormal=0x04000,
- High=0x00080,
- Idle=0x00040,
- Normal=0x00020,
- RealTime=0x00100,
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs
deleted file mode 100755
index 323c0a92791..00000000000
--- a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// System.Diagnostics.ProcessStartInfo.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections.Specialized;
-
-namespace System.Diagnostics {
- public sealed class ProcessStartInfo {
- [MonoTODO]
- public ProcessStartInfo() {
- }
-
- [MonoTODO]
- public ProcessStartInfo(string filename) {
- }
-
- [MonoTODO]
- public ProcessStartInfo(string filename, string arguments) {
- }
-
- private string arguments="";
-
- public string Arguments {
- get {
- return(arguments);
- }
- set {
- arguments=value;
- }
- }
-
- private bool create_no_window=false;
-
- public bool CreateNoWindow {
- get {
- return(create_no_window);
- }
- set {
- create_no_window=value;
- }
- }
-
- [MonoTODO("Need to read the env block somehow")]
- public StringDictionary EnvironmentVariables {
- get {
- return(null);
- }
- }
- private bool error_dialog=false;
-
- public bool ErrorDialog {
- get {
- return(error_dialog);
- }
- set {
- error_dialog=value;
- }
- }
-
- private IntPtr error_dialog_parent_handle=(IntPtr)0;
-
- public IntPtr ErrorDialogParentHandle {
- get {
- return(error_dialog_parent_handle);
- }
- set {
- error_dialog_parent_handle=value;
- }
- }
-
- private string filename="";
-
- public string FileName {
- get {
- return(filename);
- }
- set {
- filename=value;
- }
- }
-
- private bool redirect_standard_error=false;
-
- public bool RedirectStandardError {
- get {
- return(redirect_standard_error);
- }
- set {
- redirect_standard_error=value;
- }
- }
-
- private bool redirect_standard_input=false;
-
- public bool RedirectStandardInput {
- get {
- return(redirect_standard_input);
- }
- set {
- redirect_standard_input=value;
- }
- }
-
- private bool redirect_standard_output=false;
-
- public bool RedirectStandardOutput {
- get {
- return(redirect_standard_output);
- }
- set {
- redirect_standard_output=value;
- }
- }
-
- private bool use_shell_execute=true;
-
- public bool UseShellExecute {
- get {
- return(use_shell_execute);
- }
- set {
- use_shell_execute=value;
- }
- }
-
- private string verb="";
-
- public string Verb {
- get {
- return(verb);
- }
- set {
- verb=value;
- }
- }
-
- [MonoTODO]
- public string[] Verbs {
- get {
- return(null);
- }
- }
-
- private ProcessWindowStyle window_style=ProcessWindowStyle.Normal;
-
- public ProcessWindowStyle WindowStyle {
- get {
- return(window_style);
- }
- set {
- window_style=value;
- }
- }
-
- private string working_directory="";
-
- public string WorkingDirectory {
- get {
- return(working_directory);
- }
- set {
- working_directory=value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ProcessThread.cs b/mcs/class/System/System.Diagnostics/ProcessThread.cs
deleted file mode 100755
index bbc6d56eb97..00000000000
--- a/mcs/class/System/System.Diagnostics/ProcessThread.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// System.Diagnostics.ProcessThread.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.ComponentModel;
-
-namespace System.Diagnostics {
- public class ProcessThread : Component {
- [MonoTODO]
- public int BasePriority {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int CurrentPriority {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- public int Id {
- get {
- return(0);
- }
- }
-
- [MonoTODO]
- int IdealProcessor {
- set {
- }
- }
-
- [MonoTODO]
- public bool PriorityBoostEnabled {
- get {
- return(false);
- }
- set {
- }
- }
-
- [MonoTODO]
- public ThreadPriorityLevel PriorityLevel {
- get {
- return(ThreadPriorityLevel.Idle);
- }
- set {
- }
- }
-
- [MonoTODO]
- public TimeSpan PrivilegedProcessorTime {
- get {
- return(new TimeSpan(0));
- }
- }
-
- [MonoTODO]
- IntPtr ProcessorAffinity {
- set {
- }
- }
-
- [MonoTODO]
- public IntPtr StartAddress {
- get {
- return((IntPtr)0);
- }
- }
-
- [MonoTODO]
- public DateTime StartTime {
- get {
- return(new DateTime(0));
- }
- }
-
- [MonoTODO]
- public ThreadState ThreadState {
- get {
- return(ThreadState.Initialized);
- }
- }
-
- [MonoTODO]
- public TimeSpan TotalProcessorTime {
- get {
- return(new TimeSpan(0));
- }
- }
-
- [MonoTODO]
- public TimeSpan UserProcessorTime {
- get {
- return(new TimeSpan(0));
- }
- }
-
- [MonoTODO]
- public ThreadWaitReason WaitReason {
- get {
- return(ThreadWaitReason.Executive);
- }
- }
-
- [MonoTODO]
- public void ResetIdealProcessor() {
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs b/mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs
deleted file mode 100755
index 4efbcd21bb0..00000000000
--- a/mcs/class/System/System.Diagnostics/ProcessThreadCollection.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Diagnostics.ProcessThreadCollection.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Diagnostics {
- public class ProcessThreadCollection : ReadOnlyCollectionBase {
- [MonoTODO]
- protected ProcessThreadCollection() {
- }
-
- [MonoTODO]
- public ProcessThreadCollection(ProcessThread[] processThreads) {
- }
-
- [MonoTODO]
- public ProcessThread this[int index] {
- get {
- return(null);
- }
- }
-
- [MonoTODO]
- public int Add(ProcessThread thread) {
- return(0);
- }
-
- [MonoTODO]
- public bool Contains(ProcessThread thread) {
- return(false);
- }
-
- [MonoTODO]
- public void CopyTo(ProcessThread[] array, int index) {
- }
-
- [MonoTODO]
- public int IndexOf(ProcessThread thread) {
- return(0);
- }
-
- [MonoTODO]
- public void Insert(int index, ProcessThread thread) {
- }
-
- [MonoTODO]
- public void Remove(ProcessThread thread) {
- }
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ProcessWindowStyle.cs b/mcs/class/System/System.Diagnostics/ProcessWindowStyle.cs
deleted file mode 100755
index 00afa1ac997..00000000000
--- a/mcs/class/System/System.Diagnostics/ProcessWindowStyle.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Diagnostics.ProcessWindowStyle.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics {
- [Serializable]
- public enum ProcessWindowStyle {
- Hidden=1,
- Maximized=3,
- Minimized=2,
- Normal=0,
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/Switch.cs b/mcs/class/System/System.Diagnostics/Switch.cs
deleted file mode 100755
index 155860f09b9..00000000000
--- a/mcs/class/System/System.Diagnostics/Switch.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// System.Diagnostics.Switch.cs
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-
-namespace System.Diagnostics
-{
- public abstract class Switch
- {
- private string desc = "";
- private string display_name = "";
- private int iSwitch;
-
- // ================= Constructors ===================
- protected Switch(string displayName, string description)
- {
- display_name = displayName;
- desc = description;
- }
-
- ~Switch()
- {
- }
-
- // ================ Instance Methods ================
-
- // ==================== Properties ==================
-
- public string Description
- {
- get
- {
- return desc;
- }
- }
-
- public string DisplayName
- {
- get
- {
- return display_name;
- }
- }
-
- protected int SwitchSetting
- {
- get
- {
- return iSwitch;
- }
- set
- {
- if(iSwitch != value)
- {
- iSwitch = value;
- OnSwitchSettingChanged();
- }
- }
- }
-
- [MonoTODO]
- protected virtual void OnSwitchSettingChanged()
- {
- // TODO: implement me
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs b/mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs
deleted file mode 100644
index e2c6129640d..00000000000
--- a/mcs/class/System/System.Diagnostics/TextWriterTraceListener.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Diagnostics.TextWriterTraceListener.cs
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-using System;
-using System.IO;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- public class TextWriterTraceListener : TraceListener {
-
- private TextWriter writer;
-
- public TextWriterTraceListener () : base ("TextWriter")
- {
- }
-
- public TextWriterTraceListener (Stream stream)
- : this (stream, "")
- {
- }
-
- public TextWriterTraceListener (string fileName)
- : this (fileName, "")
- {
- }
-
- public TextWriterTraceListener (TextWriter writer)
- : this (writer, "")
- {
- }
-
- public TextWriterTraceListener (Stream stream, string name)
- : base (name != null ? name : "")
- {
- if (stream == null)
- throw new ArgumentNullException ("stream");
- writer = new StreamWriter (stream);
- }
-
- public TextWriterTraceListener (string fileName, string name)
- : base (name != null ? name : "")
- {
- if (fileName == null)
- throw new ArgumentNullException ("fileName");
- writer = new StreamWriter (File.OpenWrite (fileName));
- }
-
- public TextWriterTraceListener (TextWriter writer, string name)
- : base (name != null ? name : "")
- {
- if (writer == null)
- throw new ArgumentNullException ("writer");
- this.writer = writer;
- }
-
- public TextWriter Writer {
- get {return writer;}
- set {writer = value;}
- }
-
- public override void Close ()
- {
- if (writer != null) {
- writer.Flush ();
- writer.Close ();
- writer = null;
- }
- }
-
- protected override void Dispose (bool disposing)
- {
- if (disposing)
- Close ();
- }
-
- public override void Flush ()
- {
- writer.Flush ();
- }
-
- public override void Write (string message)
- {
- if (NeedIndent)
- WriteIndent ();
- writer.Write (message);
- }
-
- public override void WriteLine (string message)
- {
- if (NeedIndent)
- WriteIndent ();
- writer.WriteLine (message);
- NeedIndent = true;
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs b/mcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs
deleted file mode 100755
index 17297c10738..00000000000
--- a/mcs/class/System/System.Diagnostics/ThreadPriorityLevel.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Diagnostics.ThreadPriorityLevel.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics {
- [Serializable]
- public enum ThreadPriorityLevel {
- AboveNormal=1,
- BelowNormal=-1,
- Highest=2,
- Idle=-15,
- Lowest=-2,
- Normal=0,
- TimeCritical=15,
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ThreadState.cs b/mcs/class/System/System.Diagnostics/ThreadState.cs
deleted file mode 100755
index 12e4501c104..00000000000
--- a/mcs/class/System/System.Diagnostics/ThreadState.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Diagnostics.ThreadState.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics {
- [Serializable]
- public enum ThreadState {
- Initialized=0,
- Ready=1,
- Running=2,
- Standby=3,
- Terminated=4,
- Transition=6,
- Unknown=7,
- Wait=5,
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/ThreadWaitReason.cs b/mcs/class/System/System.Diagnostics/ThreadWaitReason.cs
deleted file mode 100755
index 97946549f39..00000000000
--- a/mcs/class/System/System.Diagnostics/ThreadWaitReason.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Diagnostics.ThreadWaitReason.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics {
- [Serializable]
- public enum ThreadWaitReason {
- EventPairHigh=7,
- EventPairLow=8,
- ExecutionDelay=4,
- Executive=0,
- FreePage=1,
- LpcReceive=9,
- LpcReply=10,
- PageIn=2,
- PageOut=12,
- Suspended=5,
- SystemAllocation=3,
- Unknown=13,
- UserRequest=6,
- VirtualMemory=11,
- }
-}
diff --git a/mcs/class/System/System.Diagnostics/Trace.cs b/mcs/class/System/System.Diagnostics/Trace.cs
deleted file mode 100644
index 223672f156c..00000000000
--- a/mcs/class/System/System.Diagnostics/Trace.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-//
-// System.Diagnostics.Trace.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// (C) 2002
-//
-
-using System;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- public sealed class Trace {
-
- private Trace () {}
-
- public static bool AutoFlush {
- get {return TraceImpl.AutoFlush;}
- set {TraceImpl.AutoFlush = value;}
- }
-
- public static int IndentLevel {
- get {return TraceImpl.IndentLevel;}
- set {TraceImpl.IndentLevel = value;}
- }
-
- public static int IndentSize {
- get {return TraceImpl.IndentSize;}
- set {TraceImpl.IndentSize = value;}
- }
-
- public static TraceListenerCollection Listeners {
- get {return TraceImpl.Listeners;}
- }
-
- [Conditional("TRACE")]
- public static void Assert (bool condition)
- {
- TraceImpl.Assert (condition);
- }
-
- [Conditional("TRACE")]
- public static void Assert (bool condition, string message)
- {
- TraceImpl.Assert (condition, message);
- }
-
- [Conditional("TRACE")]
- public static void Assert (bool condition, string message,
- string detailMessage)
- {
- TraceImpl.Assert (condition, message, detailMessage);
- }
-
- [Conditional("TRACE")]
- public static void Close ()
- {
- TraceImpl.Close ();
- }
-
- [Conditional("TRACE")]
- public static void Fail (string message)
- {
- TraceImpl.Fail (message);
- }
-
- [Conditional("TRACE")]
- public static void Fail (string message, string detailMessage)
- {
- TraceImpl.Fail (message, detailMessage);
- }
-
- [Conditional("TRACE")]
- public static void Flush ()
- {
- TraceImpl.Flush ();
- }
-
- [Conditional("TRACE")]
- public static void Indent ()
- {
- TraceImpl.Indent ();
- }
-
- [Conditional("TRACE")]
- public static void Unindent ()
- {
- TraceImpl.Unindent ();
- }
-
- [Conditional("TRACE")]
- public static void Write (object value)
- {
- TraceImpl.Write (value);
- }
-
- [Conditional("TRACE")]
- public static void Write (string message)
- {
- TraceImpl.Write (message);
- }
-
- [Conditional("TRACE")]
- public static void Write (object value, string category)
- {
- TraceImpl.Write (value, category);
- }
-
- [Conditional("TRACE")]
- public static void Write (string message, string category)
- {
- TraceImpl.Write (message, category);
- }
-
- [Conditional("TRACE")]
- public static void WriteIf (bool condition, object value)
- {
- TraceImpl.WriteIf (condition, value);
- }
-
- [Conditional("TRACE")]
- public static void WriteIf (bool condition, string message)
- {
- TraceImpl.WriteIf (condition, message);
- }
-
- [Conditional("TRACE")]
- public static void WriteIf (bool condition, object value,
- string category)
- {
- TraceImpl.WriteIf (condition, value, category);
- }
-
- [Conditional("TRACE")]
- public static void WriteIf (bool condition, string message,
- string category)
- {
- TraceImpl.WriteIf (condition, message, category);
- }
-
- [Conditional("TRACE")]
- public static void WriteLine (object value)
- {
- TraceImpl.WriteLine (value);
- }
-
- [Conditional("TRACE")]
- public static void WriteLine (string message)
- {
- TraceImpl.WriteLine (message);
- }
-
- [Conditional("TRACE")]
- public static void WriteLine (object value, string category)
- {
- TraceImpl.WriteLine (value, category);
- }
-
- [Conditional("TRACE")]
- public static void WriteLine (string message, string category)
- {
- TraceImpl.WriteLine (message, category);
- }
-
- [Conditional("TRACE")]
- public static void WriteLineIf (bool condition, object value)
- {
- TraceImpl.WriteLineIf (condition, value);
- }
-
- [Conditional("TRACE")]
- public static void WriteLineIf (bool condition, string message)
- {
- TraceImpl.WriteLineIf (condition, message);
- }
-
- [Conditional("TRACE")]
- public static void WriteLineIf (bool condition, object value,
- string category)
- {
- TraceImpl.WriteLineIf (condition, value, category);
- }
-
- [Conditional("TRACE")]
- public static void WriteLineIf (bool condition, string message,
- string category)
- {
- TraceImpl.WriteLineIf (condition, message, category);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/TraceImpl.cs b/mcs/class/System/System.Diagnostics/TraceImpl.cs
deleted file mode 100644
index f159f2518c4..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceImpl.cs
+++ /dev/null
@@ -1,298 +0,0 @@
-//
-// System.Diagnostics.TraceImpl.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-
-using System;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- internal class TraceImpl {
-
- private static object lock_ = new object ();
-
- private static bool autoFlush = false;
-
- public static bool AutoFlush {
- get {return autoFlush;}
- set {autoFlush = value;}
- }
-
- [ThreadStatic]
- private static int indentLevel = 0;
-
- public static int IndentLevel {
- get {return indentLevel;}
- set {
- indentLevel = value;
-
- // Don't need to lock for threadsafety as
- // TraceListener.IndentLevel is [ThreadStatic]
- foreach (TraceListener t in Listeners) {
- t.IndentLevel = indentLevel;
- }
- }
- }
-
- [ThreadStatic]
- private static int indentSize = 4;
-
- public static int IndentSize {
- get {return indentSize;}
- set {
- indentSize = value;
-
- // Don't need to lock for threadsafety as
- // TraceListener.IndentSize is [ThreadStatic]
- foreach (TraceListener t in Listeners) {
- t.IndentSize = indentSize;
- }
- }
- }
-
- private static TraceListenerCollection listeners =
- new TraceListenerCollection ();
-
- public static TraceListenerCollection Listeners {
- get {return listeners;}
- }
-
- // FIXME: According to MSDN, this method should display a dialog box
- [MonoTODO]
- public static void Assert (bool condition)
- {
- if (!condition)
- Fail (new StackTrace().ToString());
- }
-
- // FIXME: According to MSDN, this method should display a dialog box
- [MonoTODO]
- public static void Assert (bool condition, string message)
- {
- if (!condition)
- Fail (message);
- }
-
- // FIXME: According to MSDN, this method should display a dialog box
- [MonoTODO]
- public static void Assert (bool condition, string message,
- string detailMessage)
- {
- if (!condition)
- Fail (message, detailMessage);
- }
-
- public static void Close ()
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.Close ();
- }
- }
- }
-
- // FIXME: From testing .NET, this method should display a dialog
- [MonoTODO]
- public static void Fail (string message)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.Fail (message);
- }
- }
- }
-
- // FIXME: From testing .NET, this method should display a dialog
- [MonoTODO]
- public static void Fail (string message, string detailMessage)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.Fail (message, detailMessage);
- }
- }
- }
-
- public static void Flush ()
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners){
- listener.Flush ();
- }
- }
- }
-
- public static void Indent ()
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.IndentLevel++;
- }
- }
- }
-
- public static void Unindent ()
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.IndentLevel--;
- }
- }
- }
-
- public static void Write (object value)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.Write (value);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void Write (string message)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.Write (message);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void Write (object value, string category)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.Write (value, category);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void Write (string message, string category)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.Write (message, category);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void WriteIf (bool condition, object value)
- {
- if (condition)
- Write (value);
- }
-
- public static void WriteIf (bool condition, string message)
- {
- if (condition)
- Write (message);
- }
-
- public static void WriteIf (bool condition, object value,
- string category)
- {
- if (condition)
- Write (value, category);
- }
-
- public static void WriteIf (bool condition, string message,
- string category)
- {
- if (condition)
- Write (message, category);
- }
-
- public static void WriteLine (object value)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.WriteLine (value);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void WriteLine (string message)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.WriteLine (message);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void WriteLine (object value, string category)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.WriteLine (value, category);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void WriteLine (string message, string category)
- {
- lock (lock_) {
- foreach (TraceListener listener in Listeners) {
- listener.WriteLine (message, category);
-
- if (AutoFlush)
- listener.Flush ();
- }
- }
- }
-
- public static void WriteLineIf (bool condition, object value)
- {
- if (condition)
- WriteLine (value);
- }
-
- public static void WriteLineIf (bool condition, string message)
- {
- if (condition)
- WriteLine (message);
- }
-
- public static void WriteLineIf (bool condition, object value,
- string category)
- {
- if (condition)
- WriteLine (value, category);
- }
-
- public static void WriteLineIf (bool condition, string message,
- string category)
- {
- if (condition)
- WriteLine (message, category);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/TraceLevel.cs b/mcs/class/System/System.Diagnostics/TraceLevel.cs
deleted file mode 100755
index f4f0ba6b4f1..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceLevel.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// TraceLevel.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:29 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Diagnostics {
-
- public enum TraceLevel {
- Off = 0,
- Error = 1,
- Warning = 2,
- Info = 3,
- Verbose = 4,
- }
-
-}
-
diff --git a/mcs/class/System/System.Diagnostics/TraceListener.cs b/mcs/class/System/System.Diagnostics/TraceListener.cs
deleted file mode 100644
index b32ced8eb1b..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceListener.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// System.Diagnostics.TraceListener.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// (C) 2002 Jonathan Pryor
-//
-
-using System;
-using System.Diagnostics;
-
-namespace System.Diagnostics {
-
- public abstract class TraceListener : MarshalByRefObject, IDisposable {
-
- [ThreadStatic]
- private int indentLevel = 0;
-
- [ThreadStatic]
- private int indentSize = 4;
-
- private string name = null;
- private bool needIndent = false;
-
- protected TraceListener () : this ("")
- {
- }
-
- protected TraceListener (string name)
- {
- Name = name;
- }
-
- public int IndentLevel {
- get {return indentLevel;}
- set {indentLevel = value;}
- }
-
- public int IndentSize {
- get {return indentSize;}
- set {indentSize = value;}
- }
-
- public virtual string Name {
- get {return name;}
- set {name = value;}
- }
-
- protected bool NeedIndent {
- get {return needIndent;}
- set {needIndent = value;}
- }
-
- public virtual void Close ()
- {
- Dispose ();
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- }
-
- public virtual void Fail (string message)
- {
- Fail (message, "");
- }
-
- public virtual void Fail (string message, string detailMessage)
- {
- WriteLine ("---- DEBUG ASSERTION FAILED ----");
- WriteLine ("---- Assert Short Message ----");
- WriteLine (message);
- WriteLine ("---- Assert Long Message ----");
- WriteLine (detailMessage);
- WriteLine ("");
- }
-
- public virtual void Flush ()
- {
- }
-
- public virtual void Write (object o)
- {
- Write (o.ToString());
- }
-
- public abstract void Write (string message);
-
- public virtual void Write (object o, string category)
- {
- Write (o.ToString(), category);
- }
-
- public virtual void Write (string message, string category)
- {
- Write (category + ": " + message);
- }
-
- protected virtual void WriteIndent ()
- {
- // Must set NeedIndent to false before Write; otherwise, we get endless
- // recursion with Write->WriteIndent->Write->WriteIndent...*boom*
- NeedIndent = false;
- String indent = new String (' ', IndentLevel*IndentSize);
- Write (indent);
- }
-
- public virtual void WriteLine (object o)
- {
- WriteLine (o.ToString());
- }
-
- public abstract void WriteLine (string message);
-
- public virtual void WriteLine (object o, string category)
- {
- WriteLine (o.ToString(), category);
- }
-
- public virtual void WriteLine (string message, string category)
- {
- WriteLine (category + ": " + message);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs b/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs
deleted file mode 100644
index 8d32414efbc..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceListenerCollection.cs
+++ /dev/null
@@ -1,210 +0,0 @@
-//
-// System.Diagnostics.TraceListenerCollection.cs
-//
-// Authors:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// (C) 2002 Jonathan Pryor
-//
-
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace System.Diagnostics {
-
- public class TraceListenerCollection : IList, ICollection, IEnumerable {
-
- private ArrayList listeners = new ArrayList ();
-
- internal TraceListenerCollection ()
- {
- Add (new DefaultTraceListener ());
- }
-
- public int Count{
- get {return listeners.Count;}
- }
-
- public TraceListener this [string name] {
- get {
- foreach (TraceListener listener in listeners) {
- if (listener.Name == name)
- return listener;
- }
- return null;
- }
- }
-
- public TraceListener this [int index] {
- get {return (TraceListener) listeners[index];}
- set {
- InitializeListener (value);
- listeners[index] = value;
- }
- }
-
- object IList.this [int index] {
- get {return listeners[index];}
- set {
- this[index] = (TraceListener) value;
- }
- }
-
- bool ICollection.IsSynchronized {
- get {return listeners.IsSynchronized;}
- }
-
- object ICollection.SyncRoot {
- get {return listeners.SyncRoot;}
- }
-
- bool IList.IsFixedSize {
- get {return listeners.IsFixedSize;}
- }
-
- bool IList.IsReadOnly {
- get {return listeners.IsReadOnly;}
- }
-
- public int Add (TraceListener listener)
- {
- InitializeListener (listener);
- return listeners.Add (listener);
- }
-
- private void InitializeListener (TraceListener listener)
- {
- listener.IndentLevel = TraceImpl.IndentLevel;
- listener.IndentSize = TraceImpl.IndentSize;
- }
-
- private void InitializeRange (IList listeners)
- {
- int e = listeners.Count;
- for (int i = 0; i != e; ++i)
- InitializeListener (
- (TraceListener) listeners[i]);
- }
-
- public void AddRange (TraceListener[] value)
- {
- InitializeRange (value);
- listeners.AddRange (value);
- }
-
- public void AddRange (TraceListenerCollection value)
- {
- InitializeRange (value);
- listeners.AddRange (value.listeners);
- }
-
- public void Clear ()
- {
- listeners.Clear ();
- }
-
- public bool Contains (TraceListener listener)
- {
- return listeners.Contains (listener);
- }
-
- public void CopyTo (TraceListener[] listeners, int index)
- {
- listeners.CopyTo (listeners, index);
- }
-
- public IEnumerator GetEnumerator ()
- {
- return listeners.GetEnumerator ();
- }
-
- void ICollection.CopyTo (Array array, int index)
- {
- listeners.CopyTo (array, index);
- }
-
- int IList.Add (object value)
- {
- if (value is TraceListener)
- return Add ((TraceListener) value);
- throw new NotSupportedException (Locale.GetText (
- "You can only add TraceListener objects to the collection"));
- }
-
- bool IList.Contains (object value)
- {
- if (value is TraceListener)
- return listeners.Contains (value);
- return false;
- }
-
- int IList.IndexOf (object value)
- {
- if (value is TraceListener)
- return listeners.IndexOf (value);
- return -1;
- }
-
- void IList.Insert (int index, object value)
- {
- if (value is TraceListener) {
- Insert (index, (TraceListener) value);
- return;
- }
- throw new NotSupportedException (Locale.GetText (
- "You can only insert TraceListener objects into the collection"));
- }
-
- void IList.Remove (object value)
- {
- if (value is TraceListener)
- listeners.Remove (value);
- }
-
- public int IndexOf (TraceListener listener)
- {
- return listeners.IndexOf (listener);
- }
-
- public void Insert (int index, TraceListener listener)
- {
- InitializeListener (listener);
- listeners.Insert (index, listener);
- }
-
- public void Remove (string name)
- {
- TraceListener found = null;
-
- foreach (TraceListener listener in listeners) {
- if (listener.Name == name) {
- found = listener;
- break;
- }
- }
-
- if (found != null)
- listeners.Remove (found);
- else
- throw new ArgumentException (Locale.GetText (
- "TraceListener " + name + " was not in the collection"));
- }
-
- public void Remove (TraceListener listener)
- {
- listeners.Remove (listener);
- }
-
- public void RemoveAt (int index)
- {
- listeners.RemoveAt (index);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Diagnostics/TraceSwitch.cs b/mcs/class/System/System.Diagnostics/TraceSwitch.cs
deleted file mode 100755
index e2404fe77cf..00000000000
--- a/mcs/class/System/System.Diagnostics/TraceSwitch.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Diagnostics.TraceSwtich.cs
-//
-// Comments from John R. Hicks <angryjohn69@nc.rr.com> original implementation
-// can be found at: /mcs/docs/apidocs/xml/en/System.Diagnostics
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-
-namespace System.Diagnostics
-{
- public class TraceSwitch : Switch
- {
- private TraceLevel level;
- private bool traceError = false;
- private bool traceInfo = false;
- private bool traceVerbose = false;
- private bool traceWarning = false;
-
- public TraceSwitch(string displayName, string description)
- : base(displayName, description)
- {
- }
-
- public TraceLevel Level
- {
- get
- {
- return level;
- }
- set
- {
- level = value;
- }
-
- }
-
- public bool TraceError
- {
- get
- {
- return traceError;
- }
- }
-
- public bool TraceInfo
- {
- get
- {
- return traceInfo;
- }
- }
-
- public bool TraceVerbose
- {
- get
- {
- return traceVerbose;
- }
- }
-
- public bool TraceWarning
- {
- get
- {
- return traceWarning;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.Globalization/Locale.cs b/mcs/class/System/System.Globalization/Locale.cs
deleted file mode 100755
index 539184dbde4..00000000000
--- a/mcs/class/System/System.Globalization/Locale.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Globalization.Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Globalization {
-
- internal class Locale {
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/AddressFamily.cs b/mcs/class/System/System.Net.Sockets/AddressFamily.cs
deleted file mode 100644
index c53fd8835b1..00000000000
--- a/mcs/class/System/System.Net.Sockets/AddressFamily.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// AddressFamily.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:31:59 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- [Serializable]
- public enum AddressFamily {
- Unknown = -1,
- Unspecified = 0,
- Unix = 1,
- InterNetwork = 2,
- ImpLink = 3,
- Pup = 4,
- Chaos = 5,
- NS = 6,
- Ipx = 6,
- Iso = 7,
- Osi = 7,
- Ecma = 8,
- DataKit = 9,
- Ccitt = 10,
- Sna = 11,
- DecNet = 12,
- DataLink = 13,
- Lat = 14,
- HyperChannel = 15,
- AppleTalk = 16,
- NetBios = 17,
- VoiceView = 18,
- FireFox = 19,
- Banyan = 21,
- Atm = 22,
- InterNetworkV6 = 23,
- Cluster = 24,
- Ieee12844 = 25,
- Irda = 26,
- NetworkDesigners = 28,
- Max = 29,
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog
deleted file mode 100644
index 71576113b37..00000000000
--- a/mcs/class/System/System.Net.Sockets/ChangeLog
+++ /dev/null
@@ -1,64 +0,0 @@
-2002-06-24 Dick Porter <dick@ximian.com>
-
- * Socket.cs: Make SetSocketOption cope with boolean values (they
- are passed as objects, not the ints the runtime was expecting)
-
-2002-05-17 Lawrence Pit <loz@cable.a2000.nl>
- * TcpListener.cs: Renamed LocalEndPoint to LocalEndpoint
- * NetworkStream.cs, UdpClient.cs and TcpClient.cs: modified disposable
- routines, added checks for disposed state.
- * UdpClient.cs: commented out GetHashCode and Equals as it's not
- overriden in ms.net implementation.
-
-2002-05-17 Jaroslaw Kowalski <jarek@atm.com.pl>
- * TcpClient.cs: fixed SetTcpClient so that
- TcpListener.AcceptTcpClient works and allows
- you to call GetStream() on its result
-
-2002-04-24 Dick Porter <dick@ximian.com>
-
- * Socket.cs (Poll): Give correct argument to Select(), as spotted
- by Jaroslaw Kowalski <jarek@atm.com.pl>
-
-2002-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UdpClient.cs: implemented.
-
-2002-04-02 Dick Porter <dick@ximian.com>
-
- * TcpListener.cs: in Start(), set the socket listen backlog value
- to a sane value (noticed by Jonathan Stowe <gellyfish@gellyfish.com>)
-
-2002-02-13 Dick Porter <dick@ximian.com>
-
- * Socket.cs: Implemenent Select, Blocking, Connected,
- GetSocketOption, Poll, SetSocketOption and Shutdown
-
- * MulticastOption.cs:
- * LingerOption.cs: Delete override methods that don't need to be
- implemented
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * NetworkStream.cs: Implement class.
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * SocketException.cs: Implemented
-
- * Socket.cs: Implemented most methods
-
- * LingerOption.cs: Made compile
-
- * AddressFamily.cs: Removed empty auto-generated comments
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * SocketException.cs: Reimplemented.
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * ChangeLog : Add to this directory.
-
- * SocketException.cs, TcpClient.cs, TcpListener.cs : MonoTODO
- attribute decoration.
diff --git a/mcs/class/System/System.Net.Sockets/LingerOption.cs b/mcs/class/System/System.Net.Sockets/LingerOption.cs
deleted file mode 100644
index 4c6117f5035..00000000000
--- a/mcs/class/System/System.Net.Sockets/LingerOption.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Net.Sockets.LingerOption.cs
-//
-// Author:
-// Andrew Sutton
-//
-// (C) Andrew Sutton
-//
-
-using System;
-
-namespace System.Net.Sockets
-{
- // <remarks>
- // Encapsulates a linger option.
- // </remarks>
- public class LingerOption
- {
- // Don't change the names of these fields without also
- // changing socket-io.c in the runtime
- private bool enabled;
- protected int seconds;
-
- public LingerOption (bool enable, int secs)
- {
- enabled = enable;
- seconds = secs;
- }
-
- public bool Enabled
- {
- get { return enabled; }
- set { enabled = value; }
- }
-
- public int LingerTime
- {
- get { return seconds; }
- set { seconds = value; }
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/MulticastOption.cs b/mcs/class/System/System.Net.Sockets/MulticastOption.cs
deleted file mode 100644
index 759cd48f314..00000000000
--- a/mcs/class/System/System.Net.Sockets/MulticastOption.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Net.Sockets.MulticastOption.cs
-//
-// Author:
-// Andrew Sutton
-//
-// (C) Andrew Sutton
-//
-
-using System;
-using System.Net;
-
-namespace System.Net.Sockets
-{
- // <remarks>
- // Encapsulates a multicast option
- // </remarks>
- public class MulticastOption
- {
- // Don't change the names of these fields without also
- // changing socket-io.c in the runtime
- private IPAddress group;
- protected IPAddress local;
-
- public MulticastOption (IPAddress grp)
- {
- group = grp;
- }
-
- public MulticastOption (IPAddress grp, IPAddress addr)
- {
- group = grp;
- local = addr;
- }
-
- public IPAddress Group
- {
- get { return group; }
- set { group = value; }
- }
-
- public IPAddress LocalAddress
- {
- get { return local; }
- set { local = value; }
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/NetworkStream.cs b/mcs/class/System/System.Net.Sockets/NetworkStream.cs
deleted file mode 100644
index d304795eef3..00000000000
--- a/mcs/class/System/System.Net.Sockets/NetworkStream.cs
+++ /dev/null
@@ -1,307 +0,0 @@
-//
-// System.Net.Sockets.NetworkStream.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.IO;
-
-namespace System.Net.Sockets
-{
- public class NetworkStream : Stream, IDisposable {
- FileAccess access;
- Socket socket;
- bool owns_socket;
- bool readable, writeable;
- bool disposed = false;
-
- public NetworkStream (Socket socket)
- : this (socket, FileAccess.ReadWrite, false)
- {
- }
-
- public NetworkStream (Socket socket, bool owns_socket)
- : this (socket, FileAccess.ReadWrite, owns_socket)
- {
- }
-
- public NetworkStream (Socket socket, FileAccess access)
- : this (socket, access, false)
- {
- }
-
- public NetworkStream (Socket socket, FileAccess access, bool owns_socket)
- {
- if (socket == null)
- throw new ArgumentNullException ();
- if (!socket.Connected)
- throw new ArgumentException ("Not connected", "socket");
- if (socket.SocketType != SocketType.Stream)
- throw new ArgumentException ("Socket is not of type Stream", "socket");
- if (!socket.Blocking)
- throw new IOException ();
-
- this.socket = socket;
- this.owns_socket = owns_socket;
- this.access = access;
-
- readable = CanRead;
- writeable = CanWrite;
- }
-
- public override bool CanRead {
- get {
- return access == FileAccess.ReadWrite || access == FileAccess.Read;
- }
- }
-
- public override bool CanSeek {
- get {
- // network sockets cant seek.
- return false;
- }
- }
-
- public override bool CanWrite {
- get {
- return access == FileAccess.ReadWrite || access == FileAccess.Write;
- }
- }
-
- public virtual bool DataAvailable {
- get {
- try {
- return socket.Available > 0;
- } finally {
- CheckDisposed ();
- }
- }
- }
-
- public override long Length {
- get {
- // Network sockets always throw an exception
- throw new NotSupportedException ();
- }
- }
-
- public override long Position {
- get {
- // Network sockets always throw an exception
- throw new NotSupportedException ();
- }
-
- set {
- // Network sockets always throw an exception
- throw new NotSupportedException ();
- }
- }
-
- protected bool Readable {
- get {
- return readable;
- }
-
- set {
- readable = value;
- }
- }
-
- protected Socket Socket {
- get {
- return socket;
- }
- }
-
- protected bool Writeable {
- get {
- return writeable;
- }
-
- set {
- writeable = value;
- }
- }
-
- public override IAsyncResult BeginRead (byte [] buffer, int offset, int size,
- AsyncCallback callback, object state)
- {
- try {
- IAsyncResult retval;
-
- if (buffer == null)
- throw new ArgumentNullException ();
- int len = buffer.Length;
- if (offset >= len || size != len)
- throw new ArgumentOutOfRangeException ();
-
- try {
- retval = socket.BeginReceive (buffer, offset, size, 0, callback, state);
- } catch {
- throw new IOException ("BeginReceive failure");
- }
-
- return retval;
- } finally {
- CheckDisposed ();
- }
- }
-
- public override IAsyncResult BeginWrite (byte [] buffer, int offset, int size,
- AsyncCallback callback, object state)
- {
- try {
- IAsyncResult retval;
-
- if (buffer == null)
- throw new ArgumentNullException ();
-
- int len = buffer.Length;
- if (len < size)
- throw new ArgumentException ();
-
- try {
- retval = socket.BeginSend (buffer, offset, size, 0, callback, state);
- } catch {
- throw new IOException ("BeginWrite failure");
- }
-
- return retval;
- } finally {
- CheckDisposed ();
- }
- }
-
- ~NetworkStream ()
- {
- Dispose (false);
- }
-
- public override void Close ()
- {
- ((IDisposable) this).Dispose ();
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (disposed)
- return;
- disposed = true;
-
- if (owns_socket) {
- Socket s = socket;
- if (s != null)
- s.Close ();
- }
- socket = null;
- }
-
- public override int EndRead (IAsyncResult ar)
- {
- try {
- int res;
-
- if (ar == null)
- throw new ArgumentNullException ();
-
- try {
- res = socket.EndReceive (ar);
- } catch {
- throw new IOException ("EndRead failure");
- }
- return res;
- } finally {
- CheckDisposed ();
- }
- }
-
- public override void EndWrite (IAsyncResult ar)
- {
- try {
- if (ar == null)
- throw new ArgumentNullException ();
-
- try {
- socket.EndSend (ar);
- } catch {
- throw new IOException ("EndWrite failure");
- }
- } finally {
- CheckDisposed ();
- }
- }
-
- public override void Flush ()
- {
- // network streams are non-buffered, this is a no-op
- }
-
- void IDisposable.Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- public override int Read (byte [] buffer, int offset, int size)
- {
- try {
- int res;
-
- if (buffer == null)
- throw new ArgumentNullException ();
- if (buffer.Length < size)
- throw new ArgumentException ();
-
- try {
- res = socket.Receive (buffer, offset, size, 0);
- } catch {
- throw new IOException ("Read failure");
- }
- return res;
- } finally {
- CheckDisposed ();
- }
- }
-
- public override long Seek (long offset, SeekOrigin origin)
- {
- // NetworkStream objects do not support seeking.
-
- throw new NotSupportedException ();
- }
-
- public override void SetLength (long value)
- {
- // NetworkStream objects do not support SetLength
-
- throw new NotSupportedException ();
- }
-
- public override void Write (byte [] buffer, int offset, int size)
- {
- try {
- if (buffer == null)
- throw new ArgumentNullException ();
- if (buffer.Length < size)
- throw new ArgumentException ();
- try {
- socket.Send (buffer, offset, size, 0);
- } catch {
- throw new IOException ("Write failure");
- }
- } finally {
- CheckDisposed ();
- }
- }
-
- private void CheckDisposed ()
- {
- if (disposed)
- throw new ObjectDisposedException (GetType().FullName);
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/ProtocolFamily.cs b/mcs/class/System/System.Net.Sockets/ProtocolFamily.cs
deleted file mode 100644
index cf6d59acfc2..00000000000
--- a/mcs/class/System/System.Net.Sockets/ProtocolFamily.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Net.Sockets.ProtocolFamily.cs
-//
-// Author:
-// Andrew Sutton
-//
-// (C) Andrew Sutton
-//
-
-namespace System.Net.Sockets
-{
- public enum ProtocolFamily
- {
- Unknown = -1,
- Unspecified = 0,
- Unix,
- InterNetwork,
- ImpLink,
- Pup,
- Chaos,
- Ipx,
- Iso,
- Ecma,
- DataKit,
- Ccitt,
- Sna,
- DecNet,
- DataLink,
- Lat,
- HyperChannel,
- AppleTalk,
- NetBios,
- VoiceView,
- FireFox,
- Banyan = 0x15,
- Atm,
- InterNetworkV6,
- Cluster,
- Ieee12844,
- Irda,
- NetworkDesigners = 0x1c,
- Max,
-
- NS = Ipx,
- Osi = Iso,
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/ProtocolType.cs b/mcs/class/System/System.Net.Sockets/ProtocolType.cs
deleted file mode 100644
index 0b106e5f946..00000000000
--- a/mcs/class/System/System.Net.Sockets/ProtocolType.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-// ProtocolType.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:32:24 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum ProtocolType {
-
- /// <summary>
- /// </summary>
- IP = 0,
-
- /// <summary>
- /// </summary>
- Icmp = 1,
-
- /// <summary>
- /// </summary>
- Igmp = 2,
-
- /// <summary>
- /// </summary>
- Ggp = 3,
-
- /// <summary>
- /// </summary>
- Tcp = 6,
-
- /// <summary>
- /// </summary>
- Pup = 12,
-
- /// <summary>
- /// </summary>
- Udp = 17,
-
- /// <summary>
- /// </summary>
- Idp = 22,
-
- /// <summary>
- /// </summary>
- ND = 77,
-
- /// <summary>
- /// </summary>
- Raw = 255,
-
- /// <summary>
- /// </summary>
- Unspecified = 0,
-
- /// <summary>
- /// </summary>
- Ipx = 1000,
-
- /// <summary>
- /// </summary>
- Spx = 1256,
-
- /// <summary>
- /// </summary>
- SpxII = 1257,
-
- /// <summary>
- /// </summary>
- Unknown = -1,
- } // ProtocolType
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SelectMode.cs b/mcs/class/System/System.Net.Sockets/SelectMode.cs
deleted file mode 100644
index 587f2a1d1b6..00000000000
--- a/mcs/class/System/System.Net.Sockets/SelectMode.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// SelectMode.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:32:30 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SelectMode {
-
- /// <summary>
- /// </summary>
- SelectRead = 0,
-
- /// <summary>
- /// </summary>
- SelectWrite = 1,
-
- /// <summary>
- /// </summary>
- SelectError = 2,
- } // SelectMode
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs
deleted file mode 100644
index 3f1785381fd..00000000000
--- a/mcs/class/System/System.Net.Sockets/Socket.cs
+++ /dev/null
@@ -1,957 +0,0 @@
-// System.Net.Sockets.Socket.cs
-//
-// Authors:
-// Phillip Pearson (pp@myelin.co.nz)
-// Dick Porter <dick@ximian.com>
-//
-// Copyright (C) 2001, 2002 Phillip Pearson and Ximian, Inc.
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Threading;
-
-namespace System.Net.Sockets
-{
- public class Socket : IDisposable
- {
- private sealed class SocketAsyncResult: IAsyncResult
- {
- private object state;
- private WaitHandle waithandle;
- private bool completed_sync, completed;
- private Worker worker;
-
- public SocketAsyncResult(object state) {
- this.state=state;
- waithandle=new ManualResetEvent(false);
- completed_sync=completed=false;
- }
-
- public object AsyncState {
- get {
- return(state);
- }
- }
-
- public WaitHandle AsyncWaitHandle {
- get {
- return(waithandle);
- }
- set {
- waithandle=value;
- }
- }
-
- public bool CompletedSynchronously {
- get {
- return(completed_sync);
- }
- }
-
- public bool IsCompleted {
- get {
- return(completed);
- }
- set {
- completed=value;
- }
- }
-
- public Worker Worker {
- get {
- return(worker);
- }
- set {
- worker=value;
- }
- }
- }
-
- private sealed class Worker
- {
- private AsyncCallback callback;
- private SocketAsyncResult result;
- private Socket socket;
-
- // Parameters
- private EndPoint endpoint; // Connect,ReceiveFrom,SendTo
- private byte[] buffer; // Receive,ReceiveFrom,Send,SendTo
- private int offset; // Receive,ReceiveFrom,Send,SendTo
- private int size; // Receive,ReceiveFrom,Send,SendTo
- private SocketFlags sockflags; // Receive,ReceiveFrom,Send,SendTo
-
- // Return values
- private Socket acc_socket;
- private int total;
-
-
- // For Accept
- public Worker(Socket req_sock,
- AsyncCallback req_callback,
- SocketAsyncResult req_result)
- : this(req_sock, null, 0, 0, SocketFlags.None,
- null, req_callback, req_result) {}
-
- // For Connect
- public Worker(Socket req_sock, EndPoint req_endpoint,
- AsyncCallback req_callback,
- SocketAsyncResult req_result)
- : this(req_sock, null, 0, 0, SocketFlags.None,
- req_endpoint, req_callback,
- req_result) {}
-
- // For Receive and Send
- public Worker(Socket req_sock, byte[] req_buffer,
- int req_offset, int req_size,
- SocketFlags req_sockflags,
- AsyncCallback req_callback,
- SocketAsyncResult req_result)
- : this(req_sock, req_buffer, req_offset,
- req_size, req_sockflags, null,
- req_callback, req_result) {}
-
- // For ReceiveFrom and SendTo
- public Worker(Socket req_sock, byte[] req_buffer,
- int req_offset, int req_size,
- SocketFlags req_sockflags,
- EndPoint req_endpoint,
- AsyncCallback req_callback,
- SocketAsyncResult req_result) {
- socket=req_sock;
- buffer=req_buffer;
- offset=req_offset;
- size=req_size;
- sockflags=req_sockflags;
- endpoint=req_endpoint;
- callback=req_callback;
- result=req_result;
- }
-
- private void End() {
- callback(result);
- ((ManualResetEvent)result.AsyncWaitHandle).Set();
- result.IsCompleted=true;
- }
-
- public void Accept() {
- lock(result) {
- acc_socket=socket.Accept();
- End();
- }
- }
-
- public void Connect() {
- lock(result) {
- socket.Connect(endpoint);
- End();
- }
- }
-
- public void Receive() {
- lock(result) {
- total=socket.Receive(buffer, offset,
- size, sockflags);
- End();
- }
- }
-
- public void ReceiveFrom() {
- lock(result) {
- total=socket.ReceiveFrom(buffer,
- offset, size,
- sockflags,
- ref endpoint);
- End();
- }
- }
-
- public void Send() {
- lock(result) {
- total=socket.Send(buffer, offset, size,
- sockflags);
- End();
- }
- }
-
- public void SendTo() {
- lock(result) {
- total=socket.SendTo(buffer, offset,
- size, sockflags,
- endpoint);
- End();
- }
- }
-
- public EndPoint EndPoint {
- get {
- return(endpoint);
- }
- }
-
- public Socket Socket {
- get {
- return(acc_socket);
- }
- }
-
- public int Total {
- get {
- return(total);
- }
- }
- }
-
- /* the field "socket" is looked up by name by the runtime */
- private IntPtr socket;
- private AddressFamily address_family;
- private SocketType socket_type;
- private ProtocolType protocol_type;
- private bool blocking=true;
-
- /* When true, the socket was connected at the time of
- * the last IO operation
- */
- private bool connected=false;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Select_internal(ref Socket[] read,
- ref Socket[] write,
- ref Socket[] err,
- int timeout);
-
- public static void Select(IList read_list, IList write_list,
- IList err_list, int time_us) {
- if(read_list==null &&
- write_list==null &&
- err_list==null) {
- throw new ArgumentNullException();
- }
-
- int read_count, write_count, err_count;
-
- if(read_list!=null) {
- read_count=read_list.Count;
- } else {
- read_count=0;
- }
-
- if(write_list!=null) {
- write_count=write_list.Count;
- } else {
- write_count=0;
- }
-
- if(err_list!=null) {
- err_count=err_list.Count;
- } else {
- err_count=0;
- }
-
- Socket[] read_arr=new Socket[read_count];
- Socket[] write_arr=new Socket[write_count];
- Socket[] err_arr=new Socket[err_count];
-
- int i;
-
- if(read_list!=null) {
- i=0;
-
- foreach (Socket s in read_list) {
- read_arr[i]=s;
- i++;
- }
- }
-
- if(write_list!=null) {
- i=0;
- foreach (Socket s in write_list) {
- write_arr[i]=s;
- i++;
- }
- }
-
- if(err_list!=null) {
- i=0;
- foreach (Socket s in err_list) {
- err_arr[i]=s;
- i++;
- }
- }
-
- Select_internal(ref read_arr, ref write_arr,
- ref err_arr, time_us);
-
- if(read_list!=null) {
- read_list.Clear();
- for(i=0; i<read_arr.Length; i++) {
- read_list.Add(read_arr[i]);
- }
- }
-
- if(write_list!=null) {
- write_list.Clear();
- for(i=0; i<write_arr.Length; i++) {
- write_list.Add(write_arr[i]);
- }
- }
-
- if(err_list!=null) {
- err_list.Clear();
- for(i=0; i<err_arr.Length; i++) {
- err_list.Add(err_arr[i]);
- }
- }
- }
-
- // private constructor used by Accept, which already
- // has a socket handle to use
- private Socket(AddressFamily family, SocketType type,
- ProtocolType proto, IntPtr sock) {
- address_family=family;
- socket_type=type;
- protocol_type=proto;
-
- socket=sock;
- connected=true;
- }
-
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern IntPtr Socket_internal(AddressFamily family,
- SocketType type,
- ProtocolType proto);
-
- public Socket(AddressFamily family, SocketType type,
- ProtocolType proto) {
- address_family=family;
- socket_type=type;
- protocol_type=proto;
-
- socket=Socket_internal(family, type, proto);
- }
-
- public AddressFamily AddressFamily {
- get {
- return(address_family);
- }
- }
-
- // Returns the amount of data waiting to be read on socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Available_internal(IntPtr socket);
-
- public int Available {
- get {
- return(Available_internal(socket));
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Blocking_internal(IntPtr socket,
- bool block);
-
- public bool Blocking {
- get {
- return(blocking);
- }
- set {
- Blocking_internal(socket, value);
- blocking=value;
- }
- }
-
- public bool Connected {
- get {
- return(connected);
- }
- }
-
- public IntPtr Handle {
- get {
- return(socket);
- }
- }
-
- // Returns the local endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress LocalEndPoint_internal(IntPtr socket);
-
- [MonoTODO("Support non-IP endpoints")]
- public EndPoint LocalEndPoint {
- get {
- SocketAddress sa;
-
- sa=LocalEndPoint_internal(socket);
-
- if(sa.Family==AddressFamily.InterNetwork) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- return new IPEndPoint(0, 0).Create(sa);
- } else {
- throw new NotImplementedException();
- }
- }
- }
-
- public ProtocolType ProtocolType {
- get {
- return(protocol_type);
- }
- }
-
- // Returns the remote endpoint details in addr and port
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static SocketAddress RemoteEndPoint_internal(IntPtr socket);
-
- [MonoTODO("Support non-IP endpoints")]
- public EndPoint RemoteEndPoint {
- get {
- SocketAddress sa;
-
- sa=RemoteEndPoint_internal(socket);
-
- if(sa.Family==AddressFamily.InterNetwork) {
- // Stupidly, EndPoint.Create() is an
- // instance method
- return new IPEndPoint(0, 0).Create(sa);
- } else {
- throw new NotImplementedException();
- }
- }
- }
-
- public SocketType SocketType {
- get {
- return(socket_type);
- }
- }
-
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static IntPtr Accept_internal(IntPtr sock);
-
- public Socket Accept() {
- IntPtr sock=Accept_internal(socket);
-
- return(new Socket(this.AddressFamily, this.SocketType,
- this.ProtocolType, sock));
- }
-
- public IAsyncResult BeginAccept(AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, callback, req);
- Thread child=new Thread(new ThreadStart(worker.Accept));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginConnect(EndPoint end_point,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, end_point, callback,
- req);
- Thread child=new Thread(new ThreadStart(worker.Connect));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginReceive(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, callback, req);
- Thread child=new Thread(new ThreadStart(worker.Receive));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginReceiveFrom(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- ref EndPoint remote_end,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, remote_end,
- callback, req);
- Thread child=new Thread(new ThreadStart(worker.ReceiveFrom));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginSend(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, callback, req);
- Thread child=new Thread(new ThreadStart(worker.Send));
- child.Start();
- return(req);
- }
-
- public IAsyncResult BeginSendTo(byte[] buffer, int offset,
- int size,
- SocketFlags socket_flags,
- EndPoint remote_end,
- AsyncCallback callback,
- object state) {
- SocketAsyncResult req=new SocketAsyncResult(state);
- Worker worker=new Worker(this, buffer, offset, size,
- socket_flags, remote_end,
- callback, req);
- Thread child=new Thread(new ThreadStart(worker.SendTo));
- child.Start();
- return(req);
- }
-
- // Creates a new system socket, returning the handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Bind_internal(IntPtr sock,
- SocketAddress sa);
-
- public void Bind(EndPoint local_end) {
- if(local_end==null) {
- throw new ArgumentNullException();
- }
-
- Bind_internal(socket, local_end.Serialize());
- }
-
- // Closes the socket
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Close_internal(IntPtr socket);
-
- public void Close() {
- connected=false;
- Close_internal(socket);
- }
-
- // Connects to the remote address
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Connect_internal(IntPtr sock,
- SocketAddress sa);
-
- public void Connect(EndPoint remote_end) {
- if(remote_end==null) {
- throw new ArgumentNullException();
- }
-
- Connect_internal(socket, remote_end.Serialize());
- connected=true;
- }
-
- public Socket EndAccept(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Socket);
- }
-
- public void EndConnect(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- }
-
- public int EndReceive(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Total);
- }
-
- public int EndReceiveFrom(IAsyncResult result,
- ref EndPoint end_point) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- end_point=req.Worker.EndPoint;
- return(req.Worker.Total);
- }
-
- public int EndSend(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Total);
- }
-
- public int EndSendTo(IAsyncResult result) {
- SocketAsyncResult req=(SocketAsyncResult)result;
-
- result.AsyncWaitHandle.WaitOne();
- return(req.Worker.Total);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_obj_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, out object obj_val);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void GetSocketOption_arr_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, ref byte[] byte_val);
-
- public object GetSocketOption(SocketOptionLevel level,
- SocketOptionName name) {
- object obj_val;
-
- GetSocketOption_obj_internal(socket, level, name,
- out obj_val);
-
- if(name==SocketOptionName.Linger) {
- return((LingerOption)obj_val);
- } else if (name==SocketOptionName.AddMembership ||
- name==SocketOptionName.DropMembership) {
- return((MulticastOption)obj_val);
- } else {
- return((int)obj_val);
- }
- }
-
- public void GetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- byte[] opt_value) {
- int opt_value_len=opt_value.Length;
-
- GetSocketOption_arr_internal(socket, level, name,
- ref opt_value);
- }
-
- public byte[] GetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- int length) {
- byte[] byte_val=new byte[length];
-
- GetSocketOption_arr_internal(socket, level, name,
- ref byte_val);
-
- return(byte_val);
- }
-
- [MonoTODO("Totally undocumented")]
- public int IOControl(int ioctl_code, byte[] in_value,
- byte[] out_value) {
- throw new NotImplementedException();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Listen_internal(IntPtr sock,
- int backlog);
-
- public void Listen(int backlog) {
- Listen_internal(socket, backlog);
- }
-
- /* The docs for Poll() are a bit lightweight too, but
- * it seems to be just a simple wrapper around Select.
- */
- public bool Poll(int time_us, SelectMode mode) {
- ArrayList socketlist=new ArrayList(1);
-
- socketlist.Add(this);
-
- switch(mode) {
- case SelectMode.SelectError:
- Select(null, null, socketlist, time_us);
- break;
- case SelectMode.SelectRead:
- Select(socketlist, null, null, time_us);
- break;
- case SelectMode.SelectWrite:
- Select(null, socketlist, null, time_us);
- break;
- default:
- throw new NotSupportedException();
- }
-
- if(socketlist.Contains(this)) {
- return(true);
- } else {
- return(false);
- }
- }
-
- public int Receive(byte[] buf) {
- return(Receive(buf, 0, buf.Length, SocketFlags.None));
- }
-
- public int Receive(byte[] buf, SocketFlags flags) {
- return(Receive(buf, 0, buf.Length, flags));
- }
-
- public int Receive(byte[] buf, int size, SocketFlags flags) {
- return(Receive(buf, 0, size, flags));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Receive_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags);
-
- public int Receive(byte[] buf, int offset, int size,
- SocketFlags flags) {
- if(buf==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buf.Length) {
- throw new ArgumentException();
- }
-
- int ret;
-
- try {
- ret=Receive_internal(socket, buf, offset,
- size, flags);
- } catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- return(ret);
- }
-
- public int ReceiveFrom(byte[] buf, ref EndPoint remote_end) {
- return(ReceiveFrom(buf, 0, buf.Length,
- SocketFlags.None, ref remote_end));
- }
-
- public int ReceiveFrom(byte[] buf, SocketFlags flags,
- ref EndPoint remote_end) {
- return(ReceiveFrom(buf, 0, buf.Length, flags,
- ref remote_end));
- }
-
- public int ReceiveFrom(byte[] buf, int size, SocketFlags flags,
- ref EndPoint remote_end) {
- return(ReceiveFrom(buf, 0, size, flags,
- ref remote_end));
- }
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int RecvFrom_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- ref SocketAddress sockaddr);
-
- public int ReceiveFrom(byte[] buf, int offset, int size,
- SocketFlags flags,
- ref EndPoint remote_end) {
- if(buf==null || remote_end==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buf.Length) {
- throw new ArgumentException();
- }
-
- SocketAddress sockaddr=remote_end.Serialize();
- int count;
-
- try {
- count=RecvFrom_internal(socket, buf, offset,
- size, flags,
- ref sockaddr);
- } catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- // Stupidly, EndPoint.Create() is an
- // instance method
- remote_end=remote_end.Create(sockaddr);
-
- return(count);
- }
-
- public int Send(byte[] buf) {
- return(Send(buf, 0, buf.Length, SocketFlags.None));
- }
-
- public int Send(byte[] buf, SocketFlags flags) {
- return(Send(buf, 0, buf.Length, flags));
- }
-
- public int Send(byte[] buf, int size, SocketFlags flags) {
- return(Send(buf, 0, size, flags));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int Send_internal(IntPtr sock,
- byte[] buf, int offset,
- int count,
- SocketFlags flags);
-
- public int Send(byte[] buf, int offset, int size,
- SocketFlags flags) {
- if(buf==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buf.Length) {
- throw new ArgumentException();
- }
-
- int ret;
-
- try {
- ret=Send_internal(socket, buf, offset, size,
- flags);
- } catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- return(ret);
- }
-
- public int SendTo(byte[] buffer, EndPoint remote_end) {
- return(SendTo(buffer, 0, buffer.Length,
- SocketFlags.None, remote_end));
- }
-
- public int SendTo(byte[] buffer, SocketFlags flags,
- EndPoint remote_end) {
- return(SendTo(buffer, 0, buffer.Length, flags,
- remote_end));
- }
-
- public int SendTo(byte[] buffer, int size, SocketFlags flags,
- EndPoint remote_end) {
- return(SendTo(buffer, size, buffer.Length, flags,
- remote_end));
- }
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int SendTo_internal(IntPtr sock,
- byte[] buffer,
- int offset,
- int count,
- SocketFlags flags,
- SocketAddress sa);
-
- public int SendTo(byte[] buffer, int offset, int size,
- SocketFlags flags, EndPoint remote_end) {
- if(buffer==null || remote_end==null) {
- throw new ArgumentNullException();
- }
- if(offset+size>buffer.Length) {
- throw new ArgumentException();
- }
-
- SocketAddress sockaddr=remote_end.Serialize();
-
- int ret;
-
- try {
- ret=SendTo_internal(socket, buffer, offset,
- size, flags, sockaddr);
- }
- catch(SocketException) {
- connected=false;
- throw;
- }
- connected=true;
-
- return(ret);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void SetSocketOption_internal(IntPtr socket, SocketOptionLevel level, SocketOptionName name, object obj_val, byte[] byte_val, int int_val);
-
- public void SetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- byte[] opt_value) {
- SetSocketOption_internal(socket, level, name, null,
- opt_value, 0);
- }
-
- public void SetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- int opt_value) {
- SetSocketOption_internal(socket, level, name, null,
- null, opt_value);
- }
-
- public void SetSocketOption(SocketOptionLevel level,
- SocketOptionName name,
- object opt_value) {
- if(opt_value==null) {
- throw new ArgumentNullException();
- }
-
- /* Passing a bool as the third parameter to
- * SetSocketOption causes this overload to be
- * used when in fact we want to pass the value
- * to the runtime as an int.
- */
- if(opt_value is System.Boolean) {
- bool bool_val=(bool)opt_value;
-
- /* Stupid casting rules :-( */
- if(bool_val==true) {
- SetSocketOption_internal(socket, level,
- name, null,
- null, 1);
- } else {
- SetSocketOption_internal(socket, level,
- name, null,
- null, 0);
- }
- } else {
- SetSocketOption_internal(socket, level, name,
- opt_value, null, 0);
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Shutdown_internal(IntPtr socket, SocketShutdown how);
-
- public void Shutdown(SocketShutdown how) {
- Shutdown_internal(socket, how);
- }
-
- private bool disposed = false;
-
- protected virtual void Dispose(bool explicitDisposing) {
- // Check to see if Dispose has already been called
- if(!this.disposed) {
- // If this is a call to Dispose,
- // dispose all managed resources.
- if(explicitDisposing) {
- // Free up stuff here
- }
-
- // Release unmanaged resources
- this.disposed=true;
- this.Close();
- }
- }
-
- public void Dispose() {
- Dispose(true);
- // Take yourself off the Finalization queue
- GC.SuppressFinalize(this);
- }
-
- ~Socket () {
- Dispose(false);
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/SocketException.cs b/mcs/class/System/System.Net.Sockets/SocketException.cs
deleted file mode 100644
index 161a7cf27ae..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.Net.Sockets.NetworkStream.cs
-//
-// Author:
-// Dick Porter <dick@ximian.com>
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Runtime.Serialization;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
-
-namespace System.Net.Sockets
-{
- [Serializable]
- public class SocketException : Win32Exception
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int WSAGetLastError_internal();
-
- public SocketException ()
- : base (WSAGetLastError_internal()) {
- }
-
- public SocketException (int error)
- : base (error) {
- }
-
- protected SocketException (SerializationInfo info,
- StreamingContext context)
- : base (info, context) {
- }
-
- public override int ErrorCode {
- get {
- return NativeErrorCode;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/SocketFlags.cs b/mcs/class/System/System.Net.Sockets/SocketFlags.cs
deleted file mode 100644
index 8e958d47c05..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketFlags.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// SocketFlags.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:32:49 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum SocketFlags {
-
- /// <summary>
- /// </summary>
- None = 0x00000000,
-
- /// <summary>
- /// </summary>
- OutOfBand = 0x00000001,
-
- /// <summary>
- /// </summary>
- Peek = 0x00000002,
-
- /// <summary>
- /// </summary>
- DontRoute = 0x00000004,
-
- /// <summary>
- /// </summary>
- Partial = 0x00008000,
- } // SocketFlags
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs b/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs
deleted file mode 100644
index 657a4532154..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketOptionLevel.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// SocketOptionLevel.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:32:55 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketOptionLevel {
-
- /// <summary>
- /// </summary>
- Socket = 65535,
-
- /// <summary>
- /// </summary>
- IP = 0,
-
- /// <summary>
- /// </summary>
- Tcp = 6,
-
- /// <summary>
- /// </summary>
- Udp = 17,
- } // SocketOptionLevel
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketOptionName.cs b/mcs/class/System/System.Net.Sockets/SocketOptionName.cs
deleted file mode 100644
index 117c7fc0225..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketOptionName.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-// SocketOptionName.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:33:02 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketOptionName {
-
- /// <summary>
- /// </summary>
- Debug = 1,
-
- /// <summary>
- /// </summary>
- AcceptConnection = 2,
-
- /// <summary>
- /// </summary>
- ReuseAddress = 4,
-
- /// <summary>
- /// </summary>
- KeepAlive = 8,
-
- /// <summary>
- /// </summary>
- DontRoute = 16,
-
- /// <summary>
- /// </summary>
- Broadcast = 32,
-
- /// <summary>
- /// </summary>
- UseLoopback = 64,
-
- /// <summary>
- /// </summary>
- Linger = 128,
-
- /// <summary>
- /// </summary>
- OutOfBandInline = 256,
-
- /// <summary>
- /// </summary>
- DontLinger = -129,
-
- /// <summary>
- /// </summary>
- ExclusiveAddressUse = -5,
-
- /// <summary>
- /// </summary>
- SendBuffer = 4097,
-
- /// <summary>
- /// </summary>
- ReceiveBuffer = 4098,
-
- /// <summary>
- /// </summary>
- SendLowWater = 4099,
-
- /// <summary>
- /// </summary>
- ReceiveLowWater = 4100,
-
- /// <summary>
- /// </summary>
- SendTimeout = 4101,
-
- /// <summary>
- /// </summary>
- ReceiveTimeout = 4102,
-
- /// <summary>
- /// </summary>
- Error = 4103,
-
- /// <summary>
- /// </summary>
- Type = 4104,
-
- /// <summary>
- /// </summary>
- MaxConnections = 2147483647,
-
- /// <summary>
- /// </summary>
- IPOptions = 1,
-
- /// <summary>
- /// </summary>
- HeaderIncluded = 2,
-
- /// <summary>
- /// </summary>
- TypeOfService = 3,
-
- /// <summary>
- /// </summary>
- IpTimeToLive = 4,
-
- /// <summary>
- /// </summary>
- MulticastInterface = 9,
-
- /// <summary>
- /// </summary>
- MulticastTimeToLive = 10,
-
- /// <summary>
- /// </summary>
- MulticastLoopback = 11,
-
- /// <summary>
- /// </summary>
- AddMembership = 12,
-
- /// <summary>
- /// </summary>
- DropMembership = 13,
-
- /// <summary>
- /// </summary>
- DontFragment = 14,
-
- /// <summary>
- /// </summary>
- AddSourceMembership = 15,
-
- /// <summary>
- /// </summary>
- DropSourceMembership = 16,
-
- /// <summary>
- /// </summary>
- BlockSource = 17,
-
- /// <summary>
- /// </summary>
- UnblockSource = 18,
-
- /// <summary>
- /// </summary>
- PacketInformation = 19,
-
- /// <summary>
- /// </summary>
- NoDelay = 1,
-
- /// <summary>
- /// </summary>
- BsdUrgent = 2,
-
- /// <summary>
- /// </summary>
- Expedited = 2,
-
- /// <summary>
- /// </summary>
- NoChecksum = 1,
-
- /// <summary>
- /// </summary>
- ChecksumCoverage = 20,
- } // SocketOptionName
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketShutdown.cs b/mcs/class/System/System.Net.Sockets/SocketShutdown.cs
deleted file mode 100644
index 0f9e5f269dc..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketShutdown.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// SocketShutdown.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:32:43 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketShutdown {
-
- /// <summary>
- /// </summary>
- Receive = 0,
-
- /// <summary>
- /// </summary>
- Send = 1,
-
- /// <summary>
- /// </summary>
- Both = 2,
- } // SocketShutdown
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/SocketType.cs b/mcs/class/System/System.Net.Sockets/SocketType.cs
deleted file mode 100644
index bdb6c54d3c2..00000000000
--- a/mcs/class/System/System.Net.Sockets/SocketType.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// SocketType.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:32:37 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net.Sockets {
-
-
- /// <summary>
- /// </summary>
- public enum SocketType {
-
- /// <summary>
- /// </summary>
- Stream = 1,
-
- /// <summary>
- /// </summary>
- Dgram = 2,
-
- /// <summary>
- /// </summary>
- Raw = 3,
-
- /// <summary>
- /// </summary>
- Rdm = 4,
-
- /// <summary>
- /// </summary>
- Seqpacket = 5,
-
- /// <summary>
- /// </summary>
- Unknown = -1,
- } // SocketType
-
-} // System.Net.Sockets
diff --git a/mcs/class/System/System.Net.Sockets/TcpClient.cs b/mcs/class/System/System.Net.Sockets/TcpClient.cs
deleted file mode 100755
index a6700373cfa..00000000000
--- a/mcs/class/System/System.Net.Sockets/TcpClient.cs
+++ /dev/null
@@ -1,338 +0,0 @@
-// System.Net.Sockets.TcpClient.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-// NB: This is untested (probably buggy) code - take care if using it
-
-using System;
-using System.Net;
-
-namespace System.Net.Sockets
-{
- /// <remarks>
- /// A slightly more abstracted way to create an
- /// outgoing network connections than a Socket.
- /// </remarks>
- public class TcpClient : IDisposable
- {
- // private data
-
- private NetworkStream stream;
- private bool active;
- private Socket client;
- private bool disposed = false;
-
- // constructor
-
- /// <summary>
- /// Some code that is shared between the constructors.
- /// </summary>
- private void Init ()
- {
- active = false;
- client = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream, ProtocolType.Tcp);
- }
-
- /// <summary>
- /// Constructs a new TcpClient with no connection set up
- /// </summary>
- public TcpClient ()
- {
- Init();
- client.Bind(new IPEndPoint(IPAddress.Any, 0));
- }
-
- /// <summary>
- /// Constructs a new TcpClient with a specified local endpoint.
- /// Use this if you want to have your connections originating
- /// from a certain port, or a certain IP (on a multi homed
- /// system).
- /// </summary>
- /// <param name="local_end_point">The aforementioned local endpoint</param>
- public TcpClient (IPEndPoint local_end_point)
- {
- Init();
- client.Bind(local_end_point);
- }
-
- /// <summary>
- /// Constructs a new TcpClient and connects to a specified
- /// host on a specified port. A quick way to set up a network
- /// connection.
- /// </summary>
- /// <param name="hostname">The host to connect to, e.g.
- /// 192.168.0.201 or www.myelin.co.nz</param>
- /// <param name="port">The port to connect to, e.g. 80 for HTTP</param>
- public TcpClient (string hostname, int port)
- {
- Init();
- client.Bind(new IPEndPoint(IPAddress.Any, 0));
- Connect(hostname, port);
- }
-
- /// <summary>
- /// A flag that is 'true' if the TcpClient has an active connection
- /// </summary>
- protected bool Active
- {
- get { return active; }
- set { active = value; }
- }
-
- /// <summary>
- /// The socket that all network comms passes through
- /// </summary>
- protected Socket Client
- {
- get { return client; }
- set { client = value; }
- }
-
- /// <summary>
- /// Internal function to allow TcpListener.AcceptTcpClient
- /// to work (it needs to be able to set protected property
- /// 'Client')
- /// </summary>
- /// <param name="s"></param>
- internal void SetTcpClient (Socket s)
- {
- client = s;
- stream = new NetworkStream (client, true);
- }
-
- /// <summary>
- /// If set, the socket will remain open after it has been
- /// instructed to close, in order to send data that remains
- /// in the buffer.
- /// </summary>
- public LingerOption LingerState
- {
- get {
- return (LingerOption)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.Linger);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.Linger, value);
- }
- }
-
- /// <summary>
- /// <p>If set, outbound data will be sent at once rather than collected
- /// until enough is available to fill a packet.</p>
- ///
- /// <p>This is the TCP_NODELAY sockopt from BSD sockets and WinSock.
- /// For more information, look up the Nagle algorithm.</p>
- /// </summary>
- public bool NoDelay
- {
- get {
- return (bool)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.NoDelay);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.NoDelay, value);
- }
- }
-
- /// <summary>
- /// How big the receive buffer is (from the connection socket)
- /// </summary>
- public int ReceiveBufferSize
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveBuffer);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveBuffer, value);
- }
- }
-
- /// <summary>
- /// How long before the socket will time out on a
- /// Receive() call
- /// </summary>
- public int ReceiveTimeout
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveTimeout);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.ReceiveTimeout, value);
- }
- }
-
- /// <summary>
- /// How big the send buffer is (from the connection socket)
- /// </summary>
- public int SendBufferSize
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendBuffer);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendBuffer, value);
- }
- }
-
- /// <summary>
- /// How long before the socket will time out on a
- /// Send() call
- /// </summary>
- public int SendTimeout
- {
- get {
- return (int)client.GetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendTimeout);
- }
- set {
- client.SetSocketOption(
- SocketOptionLevel.Socket,
- SocketOptionName.SendTimeout, value);
- }
- }
-
-
- // methods
-
- /// <summary>
- /// Closes the socket and disposes of all managed resources.
- ///
- /// Throws SocketException if something goes wrong while
- /// closing the socket.
- /// </summary>
- public void Close ()
- {
- ((IDisposable) this).Dispose ();
- }
-
- /// <summary>
- /// Connects to a specified remote endpoint
- ///
- /// Throws SocketException if something goes wrong while
- /// connecting.
- /// </summary>
- /// <param name="remote_end_point">The aforementioned endpoint</param>
- public void Connect (IPEndPoint remote_end_point)
- {
- try {
- client.Connect(remote_end_point);
- stream = new NetworkStream(client, true);
- active = true;
- } finally {
- CheckDisposed ();
- }
- }
-
- /// <summary>
- /// Connects to an IP address on a port
- ///
- /// Throws SocketException if something goes wrong while
- /// connecting.
- /// </summary>
- /// <param name="address">The IP address (get it from Dns.GetHostByName)</param>
- /// <param name="port">The port to connect to, e.g. 80 for HTTP</param>
- public void Connect (IPAddress address, int port)
- {
- Connect(new IPEndPoint(address, port));
- }
-
- /// <summary>
- /// Resolves a fully qualified domain name to an IP address
- /// and connects to it on a specified port
- ///
- /// Throws SocketException if something goes wrong while
- /// connecting.
- /// </summary>
- /// <param name="hostname">The hostname, e.g. www.myelin.co.nz</param>
- /// <param name="port">The port, e.g. 80 for HTTP</param>
- [MonoTODO]
- public void Connect (string hostname, int port)
- {
- CheckDisposed ();
- IPHostEntry host = Dns.GetHostByName(hostname);
- /* TODO: This will connect to the first IP address returned
- from GetHostByName. Is that right? */
- Connect(new IPEndPoint(host.AddressList[0], port));
- }
-
- /// <summary>
- /// Gets rid of all managed resources
- /// </summary>
- void IDisposable.Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- /// <summary>
- /// Gets rid of all unmanaged resources
- /// </summary>
- /// <param name="disposing">If this is true, it gets rid of all
- /// managed resources as well</param>
- protected virtual void Dispose (bool disposing)
- {
- if (disposed)
- return;
- disposed = true;
-
- // release unmanaged resources
- NetworkStream s = stream;
- stream = null;
- if (s != null) {
- // This closes the socket as well, as the NetworkStream
- // owns the socket.
- s.Close();
- active = false;
- s = null;
- }
- client = null;
- }
-
- /// <summary>
- /// Destructor - just calls Dispose()
- /// </summary>
- ~TcpClient ()
- {
- Dispose (false);
- }
-
- /// <returns>A NetworkStream object connected to the
- /// connection socket</returns>
- public NetworkStream GetStream()
- {
- try { return stream; }
- finally { CheckDisposed (); }
- }
-
- private void CheckDisposed ()
- {
- if (disposed)
- throw new ObjectDisposedException (GetType().FullName);
- }
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/TcpListener.cs b/mcs/class/System/System.Net.Sockets/TcpListener.cs
deleted file mode 100755
index feedae68b90..00000000000
--- a/mcs/class/System/System.Net.Sockets/TcpListener.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-// System.Net.Sockets.TcpListener.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-// NB: This is untested (probably buggy) code - take care using it
-
-using System;
-using System.Net;
-
-namespace System.Net.Sockets
-{
- /// <remarks>
- /// A slightly more abstracted way to listen for incoming
- /// network connections than a Socket.
- /// </remarks>
- public class TcpListener
- {
- // private data
-
- private bool active;
- private Socket server;
-
- // constructor
-
- /// <summary>
- /// Some code that is shared between the constructors.
- /// </summary>
- private void Init ()
- {
- active = false;
- server = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream, ProtocolType.Tcp);
- }
-
- /// <summary>
- /// Constructs a new TcpListener to listen on a specified port
- /// </summary>
- /// <param name="port">The port to listen on, e.g. 80 if you
- /// are a web server</param>
- public TcpListener (int port)
- {
- Init();
- server.Bind(new IPEndPoint(IPAddress.Any, port));
- }
-
- /// <summary>
- /// Constructs a new TcpListener with a specified local endpoint
- /// </summary>
- /// <param name="local_end_point">The endpoint</param>
- public TcpListener (IPEndPoint local_end_point)
- {
- Init();
- server.Bind(local_end_point);
- }
-
- /// <summary>
- /// Constructs a new TcpListener, listening on a specified port
- /// and IP (for use on a multi-homed machine)
- /// </summary>
- /// <param name="listen_ip">The IP to listen on</param>
- /// <param name="port">The port to listen on</param>
- public TcpListener (IPAddress listen_ip, int port)
- {
- Init();
- server.Bind(new IPEndPoint(listen_ip, port));
- }
-
-
- // properties
-
- /// <summary>
- /// A flag that is 'true' if the TcpListener is listening,
- /// or 'false' if it is not listening
- /// </summary>
- protected bool Active
- {
- get { return active; }
- }
-
- /// <summary>
- /// The local end point
- /// </summary>
- public EndPoint LocalEndpoint
- {
- get { return server.LocalEndPoint; }
- }
-
- /// <summary>
- /// The listening socket
- /// </summary>
- protected Socket Server
- {
- get { return server; }
- }
-
-
- // methods
-
- /// <summary>
- /// Accepts a pending connection
- /// <returns>A Socket object for the new connection</returns>
- public Socket AcceptSocket ()
- {
- return server.Accept();
- }
-
- /// <summary>
- /// Accepts a pending connection
- /// </summary>
- /// <returns>A TcpClient
- /// object made from the new socket.</returns>
- public TcpClient AcceptTcpClient ()
- {
- TcpClient client = new TcpClient();
- // use internal method SetTcpClient to make a
- // client with the specified socket
- client.SetTcpClient(AcceptSocket());
- return client;
- }
-
- /// <summary>
- /// Destructor - stops the listener listening
- /// </summary>
- ~TcpListener ()
- {
- if (active == true) {
- Stop();
- }
- }
-
- /// <returns>
- /// Returns 'true' if there is a connection waiting to be accepted
- /// with AcceptSocket() or AcceptTcpClient().
- /// </returns>
- public bool Pending ()
- {
- return server.Poll(1000, SelectMode.SelectRead);
- }
-
- /// <summary>
- /// Tells the TcpListener to start listening.
- /// </summary>
- [MonoTODO]
- public void Start ()
- {
- server.Listen(5); // According to the
- // man page some BSD
- // and BSD-derived
- // systems limit the
- // backlog to 5. This
- // should really be
- // configurable though
- active = true;
- }
-
- /// <summary>
- /// Tells the TcpListener to stop listening and dispose
- /// of all managed resources.
- /// </summary>
- public void Stop ()
- {
- server.Close();
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net.Sockets/UdpClient.cs b/mcs/class/System/System.Net.Sockets/UdpClient.cs
deleted file mode 100644
index 15e921abfc9..00000000000
--- a/mcs/class/System/System.Net.Sockets/UdpClient.cs
+++ /dev/null
@@ -1,269 +0,0 @@
-//
-// System.Net.Sockets.UdpClient.cs
-//
-// Author:
-// Gonzalo Paniagua Javier <gonzalo@ximian.com>
-//
-// Copyright (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Net;
-
-namespace System.Net.Sockets
-{
- public class UdpClient : IDisposable
- {
- private bool disposed = false;
- private bool active = false;
- private Socket socket;
- private IPEndPoint localEP;
-
-#region Constructors
- public UdpClient ()
- {
- localEP = new IPEndPoint (IPAddress.Any, 0);
- InitSocket ();
- }
-
- public UdpClient (int port)
- {
- // IPEndPoint throws ArgumentException when port is invalid
- localEP = new IPEndPoint (IPAddress.Any, port);
- InitSocket ();
- }
-
- public UdpClient (IPEndPoint localEP)
- {
- if (localEP == null)
- throw new ArgumentNullException ("IPEndPoint cannot be null");
-
- this.localEP = localEP;
- InitSocket ();
- }
-
- public UdpClient (string hostname, int port)
- {
- if (hostname == null)
- throw new ArgumentNullException ("hostname cannot be null");
-
- if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort)
- throw new ArgumentException ("Invalid port");
-
- localEP = new IPEndPoint (IPAddress.Any, 0);
- InitSocket ();
- Connect (hostname, port);
- }
-
- private void InitSocket ()
- {
- active = false;
- socket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
- socket.Bind (localEP);
- }
-
-#endregion // Constructors
-#region Public methods
-#region Close
- public void Close ()
- {
- ((IDisposable) this).Dispose ();
- }
-#endregion
-#region Connect
- public void Connect (IPEndPoint endPoint)
- {
- try {
- socket.Connect (endPoint);
- active = true;
- } finally {
- CheckDisposed ();
- }
- }
-
- public void Connect (IPAddress addr, int port)
- {
- Connect (new IPEndPoint (addr, port));
- }
-
- public void Connect (string hostname, int port)
- {
- Connect (new IPEndPoint (Dns.Resolve (hostname).AddressList [0], port));
- }
-#endregion
-#region Multicast methods
- public void DropMulticastGroup (IPAddress multicastAddr)
- {
- try {
- socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DropMembership,
- new MulticastOption (multicastAddr));
- } finally {
- CheckDisposed ();
- }
- }
-
- public void JoinMulticastGroup (IPAddress multicastAddr)
- {
- try {
- socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.AddMembership,
- new MulticastOption (multicastAddr));
- } finally {
- CheckDisposed ();
- }
- }
-
- public void JoinMulticastGroup (IPAddress multicastAddr, int timeToLive)
- {
- JoinMulticastGroup (multicastAddr);
- try {
- socket.SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive,
- timeToLive);
- } finally {
- CheckDisposed ();
- }
- }
-#endregion
-#region Data I/O
- public byte [] Receive (ref IPEndPoint remoteEP)
- {
- try {
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP cannot be null");
-
- // Length of the array for receiving data??
- byte [] recBuffer;
- int available = socket.Available;
-
- recBuffer = new byte [1024]; // FIXME: any suggestions?
- EndPoint endPoint = (EndPoint) remoteEP;
- int dataRead = socket.ReceiveFrom (recBuffer, ref endPoint);
- if (dataRead < recBuffer.Length)
- return CutArray (recBuffer, dataRead);
-
- return recBuffer;
- } finally {
- CheckDisposed ();
- }
- }
-
- public int Send (byte [] dgram, int bytes)
- {
- try {
- if (dgram == null)
- throw new ArgumentNullException ("dgram is null");
-
- byte [] realDgram;
- if (dgram.Length <= bytes)
- realDgram = dgram;
- else
- realDgram = CutArray (dgram, (bytes >= dgram.Length) ? bytes : dgram.Length);
-
- // the socket should be connected already, so I use Send instead of SendTo
- return socket.Send (realDgram);
- } finally {
- CheckDisposed ();
- }
- }
-
- public int Send (byte [] dgram, int bytes, IPEndPoint endPoint)
- {
- try {
- if (dgram == null)
- throw new ArgumentNullException ("dgram is null");
-
- byte [] realDgram;
- if (dgram.Length <= bytes)
- realDgram = dgram;
- else
- realDgram = CutArray (dgram, (bytes >= dgram.Length) ? bytes : dgram.Length);
-
- // the socket should not be connected
- return socket.SendTo (realDgram, endPoint);
- } finally {
- CheckDisposed ();
- }
- }
-
- public int Send (byte [] dgram, int bytes, string hostname, int port)
- {
- return Send (dgram, bytes,
- new IPEndPoint (Dns.Resolve (hostname).AddressList [0], port));
- }
-
- private byte [] CutArray (byte [] orig, int length)
- {
- byte [] newArray = new byte [length];
- Array.Copy (orig, 0, newArray, 0, length);
-
- return newArray;
- }
-#endregion
-#region Properties
- protected bool Active {
- get { return active; }
- set { active = value; }
- }
-
- protected Socket Client {
- get { return socket; }
- set { socket = value; }
- }
-#endregion
-
-/*
-// commented because in the ms.net implementation these are not overriden. -- LP
-#region Overrides
- public override bool Equals (object obj)
- {
- if (obj is UdpClient)
- return (((UdpClient) obj).socket == socket &&
- ((UdpClient) obj).localEP == localEP);
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (socket.GetHashCode () + localEP.GetHashCode () + (active ? 1 : 0));
- }
-#endregion
-*/
-
-#region Disposing
- void IDisposable.Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (disposed)
- return;
- disposed = true;
- if (disposing) {
- // release managed resources
- localEP = null;
- }
- // release unmanaged resources
- Socket s = socket;
- socket = null;
- if (s != null)
- s.Close ();
- }
-
- ~UdpClient ()
- {
- Dispose (false);
- }
-
- private void CheckDisposed ()
- {
- if (disposed)
- throw new ObjectDisposedException (GetType().FullName);
- }
-#endregion
-#endregion
- }
-}
-
diff --git a/mcs/class/System/System.Net/AuthenticationManager.cs b/mcs/class/System/System.Net/AuthenticationManager.cs
deleted file mode 100755
index b67ff556817..00000000000
--- a/mcs/class/System/System.Net/AuthenticationManager.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.Net.AuthenticationManager.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Net {
-
- public class AuthenticationManager {
-
- static ArrayList modules;
-
- public static IEnumerator RegisteredModules {
- get {
- if (modules == null)
- modules = new ArrayList ();
-
- return modules as IEnumerator;
- }
- }
-
- [MonoTODO]
- public static Authorization PreAuthenticate (WebRequest request,
- ICredentials credentials)
- {
- // FIXME: implement
- return null;
- }
-
- public static void Register (IAuthenticationModule authenticationModule)
- {
- if (modules == null)
- modules = new ArrayList ();
-
- modules.Add (authenticationModule);
- }
-
- [MonoTODO]
- public static void Unregister (IAuthenticationModule authenticationModule)
- {
- // FIXME: implement
- }
-
- [MonoTODO]
- public static void Unregister (string authenticationScheme)
- {
- // FIXME: implement
- }
- }
-}
diff --git a/mcs/class/System/System.Net/Authorization.cs b/mcs/class/System/System.Net/Authorization.cs
deleted file mode 100755
index 1c21c85f0bc..00000000000
--- a/mcs/class/System/System.Net/Authorization.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Net.Authorization.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Net {
-
- public class Authorization {
- string token;
- bool complete;
- string connectionGroupId;
- string [] protectionRealm;
-
- public Authorization (string token) : this (token, true)
- {
- }
-
- public Authorization (string token, bool complete)
- : this (token, complete, null)
- {
- }
-
- public Authorization (string token, bool complete, string connectionGroupId)
- {
- this.token = token;
- this.complete = complete;
- this.connectionGroupId = connectionGroupId;
- }
-
- public string Message {
- get { return token; }
- }
-
- public bool Complete {
- get { return complete; }
- }
-
- public string ConnectionGroupId {
- get { return connectionGroupId; }
- }
-
- public string[] ProtectionRealm {
- get { return protectionRealm; }
- set { protectionRealm = value; }
- }
- }
-}
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog
deleted file mode 100644
index 02a29d610a4..00000000000
--- a/mcs/class/System/System.Net/ChangeLog
+++ /dev/null
@@ -1,232 +0,0 @@
-2002-05-29 Lawrence Pit <loz@cable.a2000.nl>
-
- * MonoHttpDate.cs: added
- * HttpWebRequest.cs: using MonoHttpDate
- * HttpWebResponse.cs: using MonoHttpDate
- * DnsPermission.cs: correct XML output
- * SocketPermission.cs: correct XML output
-
-2002-05-21 Lawrence Pit <loz@cable.a2000.nl>
-
- * WebClient.cs: stubbed
- * WebProxy.cs: fixed bug; had to change internal representation
- of bypasslist to ArrayList, different implementation of checking
- regex's.
-
-2002-05-20 Lawrence Pit <loz@cable.a2000.nl>
-
- * WebProxy.cs: added, implemented
- * ServicePoint.cs: implemented most
- * ServicePointManager.cs: implemented
- * HttpWebRequest.cs: started implementation
- * HttpWebResponse.cs: improved disposable routines
- * FileWebRequest.cs: slight improvement of Close method
-
-2002-05-19 Lawrence Pit <loz@cable.a2000.nl>
-
- * FileWebRequest.cs: finished implementation of async methods.
- * FileWebResponse.cs: improved disposable routines.
- * IPEndPoint.cs: fixed bug #24666 in Serialize and Create methods,
- byte ordering of address was backwards.
-
-2002-05-13 Lawrence Pit <loz@cable.a2000.nl>
-
- * Dns.cs: Reimplemented (simplified and fixed) asynchronous methods by
- relying on standard asynchronous delegate features. Added checks for
- null strings.
- * HttpWebResponse.cs: implemented properties
- * FileWebResponse.cs: improved the way resources are disposed.
- * FileWebRequest.cs: started implementation of asynchronous methods
- * ServicePointManager.cs: implemented properties
-
-2002-05-12 Lawrence Pit <loz@cable.a2000.nl>
-
- * HttpWebRequest.cs: properties implemented
- * HttpWebResponse.cs: added
- * GlobalProxySelection.cs: implemented
- * FileWebResponse.cs: added
- * FileWebRequest.cs: some methods implemented
-
-2002-05-11 Lawrence Pit <loz@cable.a2000.nl>
-
- * WebHeaderCollection.cs: implemented
- * WebRequest.cs: implemented
- * FileWebRequest.cs and HttpWebRequest.cs stubs added
-
-2002-05-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * Rewrote IPAddress.Parse method, passing all unit tests
-
-2002-05-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * fixed bug in IPEndPoint.Equals method
- * fixed bug in IPAddress.Parse method
- * fixed bug in IPAddress.SwapLong method
- * fixed several bugs in Cookie.cs
-
-2002-05-06 Lawrence Pit <loz@cable.a2000.nl>
-
- * WebRequest.cs: added
- * WebResponse.cs: implemented
- * WebException.cs: implemented
- * WebHeaderCollection.cs: added
- * HttpVersion.cs: implemented
- * HttpContinueDelegate.cs: added
- * IWebProxy.cs: added
- * IWebRequestCreate.cs: added
- * ICertificatePolicy.cs: added
- * ServicePoint.cs: stubbed
- * ServicePointManager.cs: stubbed
- * CookieContainer.cs: added
- * Authorization.cs: implemented
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * CredentialCache.cs: implemented
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * IPAddress.cs: fixed IsLoopback, address was already in host order
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * IPv6Address.cs: added (note: not part of .net spec)
-
-2002-05-01 Lawrence Pit <loz@cable.a2000.nl>
-
- * DnsPermission.cs: implemented
- * DnsPermissionAttribute.cs: implemented
-
-2002-04-28 Lawrence Pit <loz@cable.a2000.nl>
-
- * EndpointPermission.cs: implemented
- * SocketPermission.cs: implemented
- * SocketPermissionAttribute.cs: implemented
- * ProtocolViolationException.cs: implemented
- * Dns.c: passing w32 error code when no host found
-
-2002-04-27 Lawrence Pit <loz@cable.a2000.nl>
-
- * Cookie.cs: implemented
- * CookieCollection.cs: implemented
- * CookieException.cs: implemented
-
-2002-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPAddress.cs: initialize the read only fields with Parse().
-
-2002-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPAddress.cs: little changes to behave as MS.
-
-2002-04-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Dns.cs (Resolve): behave as MS. Agreed with Mads.
-
-2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPAddress.cs: the icalls for sockets are endianness-aware. So I
- changed a few things. Also included a workaround for bug #23547.
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPAddress.cs: use System.BitConverter.IsLittleEndian (suggested
- by Paolo) instead of guessing the endianness.
-
- * SocketAddress.cs: implemented Equals() and GetHashcode().
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPEndPoint.cs: modifications to constructors according to the
- specifications (suggested by Lawrence Pit).
-
-2002-04-15 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * IPEndPoint.cs: Fixed build breaker.
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPEndPoint.cs: implemented Equals() and GetHashCode(). Now 100%
- complete.
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPAddress.cs: finished all MonoTODO's. Use network order to store
- the address. Check for max and min values in Address:set. IsLoopback()
- returns now true for all 127.x.y.z. Some more checks in Parse ().
- Some changes to behave as MS does.
-
-2002-02-24 Duncan Mak <duncan@ximian.com>
-
- * ICredentialLookup.cs: Added the GetCredential method to the
- interface. The interface is named "ICredentials", should this file
- be renamed?
-
- * NetworkCredential.cs: Added to CVS. Need to investigate on how
- GetCredential() works
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * SocketAddress.cs: Implemented.
-
- * IPEndPoint.cs: Turned 'Address' field into a real property.
- Implemented Create() and Serialize() methods.
-
- * IPAddress.cs: Fixed class constructor, turned 'Address' field
- into a real property. Removed undocumented "public
- IPAddress(string)" constructor.
-
- * EndPoint.cs: Implemented. All methods return
- NotSupportedException to enforce subclass overriding.
-
- * Dns.cs: Replaced fixed-layout Hostent struct and cygwin
- P/Invokes with portable internal calls.
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * Dns.cs: Updated to API changes.
-
- * IPAddress.cs: Updated API. Much left to implement.
-
- * Dns.cs: Remove IPToString method
-
-2002-01-06 Ravi Pratap <ravi@ximian.com>
-
- * Dns.cs, AuthenticationManager.cs, SocketAddress.cs : MonoTODO
- attribute insertion.
-
-2001-11-22 Nick Drochak <ndrochak@gol.com>
-
- * IPAddress.cs: Fix constructor bug, properly name Address property,
- and use triple-slash for comments.
-
-2001-11-20 Miguel de Icaza <miguel@ximian.com>
-
- * IPAddress.cs: Updated to contain Any, Broadcast, Loopback and
- None as suggested by Phillip.
-
-2001-09-26 Mads Pultz <mpultz@get2net.dk>
- * Dns.cs: Initial work on BeginGetHostByName and EndGetHostByName implemented.
-
-2001-09-24 Mads Pultz <mpultz@get2net.dk>
-
- * Dns.cs: Minor changes (some print statements removed)
-
-2001-09-23 Mads Pultz <mpultz@get2net.dk>
-
- * Dns.cs: Initial work submitted to repository.
- * IPHostEntry.cs: Initial work submitted to repository.
-
-2001-07-12 Sean MacIsaac <macisaac@ximian.com>
-
- * Authorization.cs: Fixed compiler error.
-
- * IAuthenticationModule.cs: Changes for Beta2.
-
- * IPAddress.cs: Internal storage changed to be uint not int.
-
- * IPEndPoint.cs: Fixed compiler error.
-
- * EndPoint.cs: Fixed compiler error.
-
- * AuthenticationManager.cs: Fixed typo.
diff --git a/mcs/class/System/System.Net/ConnectionModes.cs b/mcs/class/System/System.Net/ConnectionModes.cs
deleted file mode 100755
index 3a1cc437702..00000000000
--- a/mcs/class/System/System.Net/ConnectionModes.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// ConnectionModes.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:39 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum ConnectionModes {
-
- /// <summary>
- /// </summary>
- Single = 0,
-
- /// <summary>
- /// </summary>
- Persistent = 1,
-
- /// <summary>
- /// </summary>
- Pipeline = 2,
-
- /// <summary>
- /// </summary>
- Mux = 3,
- } // ConnectionModes
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/Cookie.cs b/mcs/class/System/System.Net/Cookie.cs
deleted file mode 100644
index b3acb2b5d6f..00000000000
--- a/mcs/class/System/System.Net/Cookie.cs
+++ /dev/null
@@ -1,276 +0,0 @@
-//
-// System.Net.Cookie.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Text;
-
-namespace System.Net {
-
- // Supported cookie formats are:
- // Netscape: http://home.netscape.com/newsref/std/cookie_spec.html
- // RFC 2109: http://www.ietf.org/rfc/rfc2109.txt
- // RFC 2965: http://www.ietf.org/rfc/rfc2965.txt
- [Serializable]
- public sealed class Cookie
- {
- private string comment;
- private Uri commentUri;
- private bool discard;
- private string domain;
- private bool expired;
- private DateTime expires;
- private string name;
- private string path;
- private string port;
- private int [] ports;
- private bool secure;
- private DateTime timestamp;
- private string val;
- private int version;
-
- private static char [] reservedCharsName = new char [] {' ', '=', ';', ',', '\n', '\r', '\t'};
- private static char [] reservedCharsValue = new char [] {';', ','};
- private static char [] portSeparators = new char [] {'"', ','};
- private static string tspecials = "()<>@,;:\\\"/[]?={} \t"; // from RFC 2965, 2068
-
- public Cookie ()
- : this (String.Empty, String.Empty) {}
-
- public Cookie (string name, string value)
- {
- Name = name;
- Value = value;
-
- discard = false;
- expired = false;
- secure = false;
- expires = DateTime.MinValue;
- timestamp = DateTime.Now;
- version = 0;
- }
-
- public Cookie (string name, string value, string path)
- : this (name, value)
- {
- Path = path;
- }
-
- public Cookie (string name, string value, string path, string domain)
- : this (name, value, path)
- {
- Domain = domain;
- }
-
- public string Comment {
- get { return comment; }
- set { comment = value == null ? String.Empty : value; }
- }
-
- public Uri CommentUri {
- get { return commentUri; }
- set { commentUri = value; }
- }
-
- public bool Discard {
- get { return discard; }
- set { discard = value; }
- }
-
- public string Domain {
- get { return domain; }
- set { domain = value == null ? String.Empty : value; }
- }
-
- public bool Expired {
- get {
- return expires <= DateTime.Now &&
- expires != DateTime.MinValue;
- }
- set {
- expired = value;
- if (expired) {
- expires = DateTime.Now;
- }
- }
- }
-
- public DateTime Expires {
- get { return expires; }
- set { expires = value; }
- }
-
- public string Name {
- get { return name; }
- set {
- if (value == null || value.Length == 0) {
- throw new CookieException ("Name cannot be empty");
- }
-
- if (value [0] == '$' || value.IndexOfAny (reservedCharsName) != -1) {
- // see CookieTest, according to MS implementation
- // the name value changes even though it's incorrect
- name = String.Empty;
- throw new CookieException ("Name contains invalid characters");
- }
-
- name = value;
- }
- }
-
- public string Path {
- get { return (path == null) ? "/" : path; }
- set { path = (value == null) ? String.Empty : value; }
- }
-
- public string Port {
- get { return port; }
- set {
- if (value == null || value.Length == 0) {
- port = String.Empty;
- return;
- }
- if (value [0] != '"' || value [value.Length - 1] != '"') {
- throw new CookieException("The 'Port'='" + value + "' part of the cookie is invalid. Port must be enclosed by double quotes.");
- }
- port = value;
- string [] values = port.Split (portSeparators);
- ports = new int[values.Length];
- for (int i = 0; i < ports.Length; i++) {
- ports [i] = Int32.MinValue;
- if (values [i].Length == 0)
- continue;
- try {
- ports [i] = Int32.Parse (values [i]);
- } catch (Exception e) {
- throw new CookieException("The 'Port'='" + value + "' part of the cookie is invalid. Invalid value: " + values [i], e);
- }
- }
- }
- }
-
- int[] Ports {
- get { return ports; }
- }
-
- public bool Secure {
- get { return secure; }
- set { secure = value; }
- }
-
- public DateTime TimeStamp {
- get { return timestamp; }
- }
-
- public string Value {
- get { return val; }
- set {
- if (value == null) {
- val = String.Empty;
- return;
- }
-
- // LAMESPEC: According to .Net specs the Value property should not accept
- // the semicolon and comma characters, yet it does. For now we'll follow
- // the behaviour of MS.Net instead of the specs.
- /*
- if (value.IndexOfAny(reservedCharsValue) != -1)
- throw new CookieException("Invalid value. Value cannot contain semicolon or comma characters.");
- */
-
- val = value;
- }
- }
-
- public int Version {
- get { return version; }
- set {
- if ((value < 0) || (value > 10))
- version = 0;
- else
- version = value;
- }
- }
-
- public override bool Equals (Object obj)
- {
- System.Net.Cookie c = obj as System.Net.Cookie;
-
- return c != null &&
- String.Compare (this.name, c.name, true) == 0 &&
- String.Compare (this.val, c.val, false) == 0 &&
- String.Compare (this.path, c.path, false) == 0 &&
- String.Compare (this.domain, c.domain, true) == 0 &&
- this.version == c.version;
- }
-
- public override int GetHashCode ()
- {
- return hash(name.ToLower ().GetHashCode (),
- val.GetHashCode (),
- path.GetHashCode (),
- domain.ToLower ().GetHashCode (),
- version);
- }
-
- private static int hash (int i, int j, int k, int l, int m)
- {
- return i ^ (j << 13 | j >> 19) ^ (k << 26 | k >> 6) ^ (l << 7 | l >> 25) ^ (m << 20 | m >> 12);
- }
-
- // returns a string that can be used to send a cookie to an Origin Server
- // i.e., only used for clients
- // see also para 3.3.4 of RFC 1965
- public override string ToString ()
- {
- if (name.Length == 0)
- return String.Empty;
-
- StringBuilder result = new StringBuilder (64);
-
- if (version > 0) {
- result.Append ("$Version=").Append (version).Append (";");
- }
-
- result.Append (name).Append ("=").Append (val);
-
- // in the MS.Net implementation path and domain don't show up in
- // the result, I guess that's a bug in their implementation...
- if (path != null && path.Length != 0)
- result.Append (";$Path=").Append (QuotedString (path));
-
- if (domain != null && domain.Length != 0)
- result.Append (";$Domain=").Append (QuotedString (domain));
-
- if (port != null && port.Length != 0)
- result.Append (";$Port=").Append (port);
-
- return result.ToString ();
- }
-
- // See par 3.6 of RFC 2616
- private string QuotedString (string value)
- {
- if (version == 0 || IsToken (value))
- return value;
- else
- return "\"" + value.Replace("\"", "\\\"") + "\"";
- }
-
- private bool IsToken (string value)
- {
- int len = value.Length;
- for (int i = 0; i < len; i++) {
- char c = value [i];
- if (c < 0x20 || c >= 0x7f || tspecials.IndexOf (c) != -1)
- return false;
- }
- return true;
- }
-
- }
-}
-
diff --git a/mcs/class/System/System.Net/CookieCollection.cs b/mcs/class/System/System.Net/CookieCollection.cs
deleted file mode 100644
index b26645f78e2..00000000000
--- a/mcs/class/System/System.Net/CookieCollection.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// System.Net.CookieCollection
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class CookieCollection : ICollection, IEnumerable
- {
- private ArrayList list = new ArrayList ();
-
- // ctor
- public CookieCollection ()
- {
- }
-
- // ICollection
-
- public int Count {
- get { return list.Count; }
- }
-
- public bool IsSynchronized {
- get { return false; }
- }
-
- public Object SyncRoot {
- get { return this; }
- }
-
- public void CopyTo (Array array, int arrayIndex)
- {
- list.CopyTo (array, arrayIndex);
- }
-
-
- // IEnumerable
-
- public IEnumerator GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
-
- // This
-
- // LAMESPEC: So how is one supposed to create a writable CookieCollection
- // instance?? We simply ignore this property, as this collection is always
- // writable.
- public bool IsReadOnly {
- get { return true; }
- }
-
- // LAMESPEC: Which exception should we throw when the read only
- // property is set to true??
- public void Add (Cookie cookie)
- {
- if (cookie == null)
- throw new ArgumentNullException ("cookie");
- int pos = list.IndexOf (cookie);
- if (pos == -1)
- list.Add (cookie);
- else
- list [pos] = cookie;
- }
-
- // LAMESPEC: Which exception should we throw when the read only
- // property is set to true??
- public void Add (CookieCollection cookies)
- {
- if (cookies == null)
- throw new ArgumentNullException ("cookies");
-
- IEnumerator enumerator = cookies.list.GetEnumerator ();
- while (enumerator.MoveNext ())
- Add ((Cookie) enumerator.Current);
- }
-
- public Cookie this [int index] {
- get {
- if (index < 0 || index >= list.Count)
- throw new ArgumentOutOfRangeException ("index");
- return (Cookie) list [index];
- }
- }
-
- public Cookie this [string name] {
- get {
- lock (this) {
- IEnumerator enumerator = list.GetEnumerator ();
- while (enumerator.MoveNext ())
- if (String.Compare (((Cookie) enumerator.Current).Name, name, true) == 0)
- return (Cookie) enumerator.Current;
- }
- return null;
- }
- }
-
-
- } // CookieCollection
-
-} // System.Net
-
diff --git a/mcs/class/System/System.Net/CookieContainer.cs b/mcs/class/System/System.Net/CookieContainer.cs
deleted file mode 100644
index 4058b9fd67e..00000000000
--- a/mcs/class/System/System.Net/CookieContainer.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-//
-// System.Net.CookieContainer
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class CookieContainer
- {
- private int count;
- private int capacity;
- private int perDomainCapacity;
- private int maxCookieSize;
-
- // ctors
- public CookieContainer () : this (DefaultCookieLimit)
- {
- }
-
- public CookieContainer (int capacity) :
- this (capacity, DefaultPerDomainCookieLimit, DefaultCookieLengthLimit)
- {
- }
-
- public CookieContainer (int capacity, int perDomainCapacity, int maxCookieSize)
- {
- this.capacity = capacity;
- this.perDomainCapacity = perDomainCapacity;
- this.maxCookieSize = maxCookieSize;
- this.count = 0;
- }
-
- // fields
-
- public const int DefaultCookieLengthLimit = 4096;
- public const int DefaultCookieLimit = 300;
- public const int DefaultPerDomainCookieLimit = 20;
-
- // properties
-
- public int Count {
- get { return count; }
- }
-
- public int Capacity {
- get { return capacity; }
- set {
- if ((value <= 0) ||
- (value < perDomainCapacity && perDomainCapacity != Int32.MaxValue))
- throw new ArgumentOutOfRangeException ("value");
- if (value < maxCookieSize)
- maxCookieSize = value;
- capacity = value;
- }
- }
-
- public int MaxCookieSize {
- get { return maxCookieSize; }
- set {
- if (value <= 0)
- throw new ArgumentOutOfRangeException ("value");
- maxCookieSize = value;
- }
- }
-
- public int PerDomainCapacity {
- get { return perDomainCapacity; }
- set {
- if ((value <= 0) ||
- (value > DefaultCookieLimit && value != Int32.MaxValue))
- throw new ArgumentOutOfRangeException ("value");
- if (value < perDomainCapacity)
- perDomainCapacity = value;
- perDomainCapacity = value;
- }
- }
-
- [MonoTODO]
- public void Add (Cookie cookie)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Add (CookieCollection cookies)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Add (Uri uri, Cookie cookie)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void Add (Uri uri, CookieCollection cookies)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public string GetCookieHeader (Uri uri)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public CookieCollection GetCookies (Uri uri)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SetCookies (Uri uri, string cookieHeader)
- {
- throw new NotImplementedException ();
- }
-
- } // CookieContainer
-
-} // System.Net
-
diff --git a/mcs/class/System/System.Net/CookieException.cs b/mcs/class/System/System.Net/CookieException.cs
deleted file mode 100644
index 09fd80601ce..00000000000
--- a/mcs/class/System/System.Net/CookieException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Net.CookieException.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class CookieException : FormatException, ISerializable
- {
-
- // Constructors
- public CookieException () : base ()
- {
- }
-
- internal CookieException (string msg) : base (msg)
- {
- }
-
- internal CookieException (string msg, Exception e) : base (msg, e)
- {
- }
-
- protected CookieException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- // Methods
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/CredentialCache.cs b/mcs/class/System/System.Net/CredentialCache.cs
deleted file mode 100644
index 02557cb46ae..00000000000
--- a/mcs/class/System/System.Net/CredentialCache.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// System.Net.CredentialCache
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class CredentialCache : ICredentials, IEnumerable
- {
- // Fields
- private Hashtable cache;
-
- // Constructors
- public CredentialCache ()
- {
- cache = new Hashtable ();
- }
-
- // Properties
-
- [MonoTODO ("Need EnvironmentPermission implementation first")]
- public static ICredentials DefaultCredentials {
- get {
- throw new NotImplementedException ();
- }
- }
-
-
- // ICredentials
-
- public NetworkCredential GetCredential (Uri uriPrefix, string authType)
- {
- int longestPrefix = -1;
- NetworkCredential result = null;
-
- if (uriPrefix == null || authType == null)
- return null;
-
- string absPath = uriPrefix.AbsolutePath;
- absPath = absPath.Substring (0, absPath.LastIndexOf ('/'));
-
- IDictionaryEnumerator e = cache.GetEnumerator ();
- while (e.MoveNext ()) {
- CredentialCacheKey key = e.Key as CredentialCacheKey;
-
- if (key.Length <= longestPrefix)
- continue;
-
- if (String.Compare (key.AuthType, authType, true) != 0)
- continue;
-
- Uri cachedUri = key.UriPrefix;
-
- if (cachedUri.Scheme != uriPrefix.Scheme)
- continue;
-
- if (cachedUri.Port != uriPrefix.Port)
- continue;
-
- if (cachedUri.Host != uriPrefix.Host)
- continue;
-
- if (!absPath.StartsWith (key.AbsPath))
- continue;
-
- longestPrefix = key.Length;
- result = (NetworkCredential) e.Value;
- }
-
- return result;
- }
-
- // IEnumerable
-
- public IEnumerator GetEnumerator ()
- {
- return cache.Values.GetEnumerator ();
- }
-
- // Methods
-
- public void Add (Uri uriPrefix, string authType, NetworkCredential cred)
- {
- if (uriPrefix == null)
- throw new ArgumentNullException ("uriPrefix");
-
- if (authType == null)
- throw new ArgumentNullException ("authType");
-
- // throws ArgumentException when same key already exists.
- cache.Add (new CredentialCacheKey (uriPrefix, authType), cred);
- }
-
- public void Remove (Uri uriPrefix, string authType)
- {
- if (uriPrefix == null)
- throw new ArgumentNullException ("uriPrefix");
-
- if (authType == null)
- throw new ArgumentNullException ("authType");
-
- cache.Remove (new CredentialCacheKey (uriPrefix, authType));
- }
-
- // Inner Classes
-
- internal class CredentialCacheKey
- {
- private Uri uriPrefix;
- private string authType;
-
- private string absPath;
- private int len;
- private int hash;
-
- internal CredentialCacheKey (Uri uriPrefix, string authType)
- {
- this.uriPrefix = uriPrefix;
- this.authType = authType;
-
- this.absPath = uriPrefix.AbsolutePath;
- this.absPath = absPath.Substring (0, absPath.LastIndexOf ('/'));
-
- this.len = uriPrefix.AbsoluteUri.Length;
- this.hash = uriPrefix.GetHashCode ()
- + authType.ToString ().GetHashCode ();
- }
-
- public int Length {
- get { return len; }
- }
-
- public string AbsPath {
- get { return absPath; }
- }
-
- public Uri UriPrefix {
- get { return uriPrefix; }
- }
-
- public string AuthType {
- get { return authType; }
- }
-
- public override int GetHashCode ()
- {
- return hash;
- }
-
- public override bool Equals (object obj)
- {
- CredentialCacheKey key = obj as CredentialCacheKey;
- return ((key != null) && (this.hash == key.hash));
- }
-
- public override string ToString ()
- {
- return absPath + " : " + authType + " : len=" + len;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/Dns.cs b/mcs/class/System/System.Net/Dns.cs
deleted file mode 100644
index 6ab29a95b03..00000000000
--- a/mcs/class/System/System.Net/Dns.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-// System.Net.Dns.cs
-//
-// Author: Mads Pultz (mpultz@diku.dk)
-// Author: Lawrence Pit (loz@cable.a2000.nl)
-//
-// (C) Mads Pultz, 2001
-
-using System;
-using System.Net.Sockets;
-using System.Text;
-using System.Collections;
-using System.Threading;
-using System.Runtime.CompilerServices;
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Net {
- public sealed class Dns {
-
- private Dns () {}
-
- private delegate IPHostEntry GetHostByNameCallback (string hostName);
- private delegate IPHostEntry ResolveCallback (string hostName);
-
- public static IAsyncResult BeginGetHostByName (string hostName,
- AsyncCallback requestCallback, object stateObject)
- {
- if (hostName == null)
- throw new ArgumentNullException();
- GetHostByNameCallback c = new GetHostByNameCallback (GetHostByName);
- return c.BeginInvoke (hostName, requestCallback, stateObject);
- }
-
- public static IAsyncResult BeginResolve (string hostName,
- AsyncCallback requestCallback, object stateObject)
- {
- if (hostName == null)
- throw new ArgumentNullException();
- ResolveCallback c = new ResolveCallback (Resolve);
- return c.BeginInvoke (hostName, requestCallback, stateObject);
- }
-
- public static IPHostEntry EndGetHostByName (IAsyncResult asyncResult) {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
- AsyncResult async = (AsyncResult) asyncResult;
- GetHostByNameCallback cb = (GetHostByNameCallback) async.AsyncDelegate;
- asyncResult.AsyncWaitHandle.WaitOne ();
- return cb.EndInvoke(asyncResult);
- }
-
- public static IPHostEntry EndResolve (IAsyncResult asyncResult) {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
- AsyncResult async = (AsyncResult) asyncResult;
- ResolveCallback cb = (ResolveCallback) async.AsyncDelegate;
- asyncResult.AsyncWaitHandle.WaitOne ();
- return cb.EndInvoke(asyncResult);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool GetHostByName_internal(string host, out string h_name, out string[] h_aliases, out string[] h_addr_list);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool GetHostByAddr_internal(string addr, out string h_name, out string[] h_aliases, out string[] h_addr_list);
-
- private static IPHostEntry hostent_to_IPHostEntry(string h_name, string[] h_aliases, string[] h_addrlist) {
- IPHostEntry he = new IPHostEntry();
- IPAddress[] addrlist = new IPAddress[h_addrlist.Length];
-
- he.HostName=h_name;
- he.Aliases=h_aliases;
- for(int i=0; i<h_addrlist.Length; i++) {
- addrlist[i]=IPAddress.Parse(h_addrlist[i]);
- }
- he.AddressList=addrlist;
-
- return(he);
- }
-
- public static IPHostEntry GetHostByAddress(IPAddress address) {
- if (address == null)
- throw new ArgumentNullException();
- return GetHostByAddress(address.ToString());
- }
-
- public static IPHostEntry GetHostByAddress(string address) {
- if (address == null) {
- throw new ArgumentNullException();
- }
-
- string h_name;
- string[] h_aliases, h_addrlist;
-
- bool ret = GetHostByAddr_internal(address, out h_name,
- out h_aliases,
- out h_addrlist);
- if (ret == false) {
- throw new SocketException(11001);
- }
-
- return(hostent_to_IPHostEntry(h_name, h_aliases,
- h_addrlist));
- }
-
- public static IPHostEntry GetHostByName(string hostName) {
- if (hostName == null)
- throw new ArgumentNullException();
-
- string h_name;
- string[] h_aliases, h_addrlist;
-
- bool ret = GetHostByName_internal(hostName, out h_name,
- out h_aliases,
- out h_addrlist);
- if (ret == false)
- throw new SocketException(11001);
-
- return(hostent_to_IPHostEntry(h_name, h_aliases,
- h_addrlist));
- }
-
- /// <summary>
- /// This method returns the host name associated with the local host.
- /// </summary>
- public static string GetHostName() {
- IPHostEntry h = GetHostByAddress("127.0.0.1");
- return h.HostName;
- }
-
- /// <summary>
- /// This method resolves a DNS-style host name or IP
- /// address.
- /// </summary>
- /// <param name=hostName>
- /// A string containing either a DNS-style host name (e.g.
- /// www.go-mono.com) or IP address (e.g. 129.250.184.233).
- /// </param>
- public static IPHostEntry Resolve(string hostName) {
- if (hostName == null)
- throw new ArgumentNullException();
-
- return GetHostByName (hostName);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/DnsPermission.cs b/mcs/class/System/System.Net/DnsPermission.cs
deleted file mode 100644
index e60a0fca65d..00000000000
--- a/mcs/class/System/System.Net/DnsPermission.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// System.Net.DnsPermission.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Net
-{
- [Serializable]
- public sealed class DnsPermission : CodeAccessPermission, IUnrestrictedPermission
- {
- // Fields
- bool m_noRestriction;
-
- // Constructors
- public DnsPermission (PermissionState state) : base ()
- {
- m_noRestriction = (state == PermissionState.Unrestricted);
- }
-
- // Methods
-
- public override IPermission Copy ()
- {
- // this is immutable.
- return this;
- }
-
- public override IPermission Intersect (IPermission target)
- {
- // LAMESPEC: says to throw an exception when null
- // but at same time it says to return null. We'll
- // follow MS behaviour.
- if (target == null)
- return null;
-
- DnsPermission perm = target as DnsPermission;
-
- if (perm == null)
- throw new ArgumentException ("Argument not of type DnsPermission");
-
- if (this.m_noRestriction && perm.m_noRestriction)
- return this;
-
- return this.m_noRestriction ? perm : this;
- }
-
- public override bool IsSubsetOf (IPermission target)
- {
- if (target == null)
- return !m_noRestriction;
-
- DnsPermission perm = target as DnsPermission;
-
- if (perm == null)
- throw new ArgumentException ("Argument not of type DnsPermission");
-
- return !this.m_noRestriction || perm.m_noRestriction;
- }
-
- public bool IsUnrestricted ()
- {
- return this.m_noRestriction;
- }
-
- /*
-
- DnsPermission dns1 = new DnsPermission (PermissionState.None);
- Console.WriteLine (dns1.ToXml ().ToString ());
-
- DnsPermission dns2 = new DnsPermission (PermissionState.Unrestricted);
- Console.WriteLine (dns2.ToXml ().ToString ());
-
- This is the sample xml output:
-
- <IPermission class="System.Net.DnsPermission, System, Version=1.0.3300.0, Cultur
- e=neutral, PublicKeyToken=b77a5c561934e089"
- version="1"/>
-
- <IPermission class="System.Net.DnsPermission, System, Version=1.0.3300.0, Cultur
- e=neutral, PublicKeyToken=b77a5c561934e089"
- version="1"
- Unrestricted="true"/>
- */
- public override SecurityElement ToXml ()
- {
-
- SecurityElement root = new SecurityElement ("IPermission");
- root.AddAttribute ("class", this.GetType ().AssemblyQualifiedName);
- root.AddAttribute ("version", "1");
- if (m_noRestriction)
- root.AddAttribute ("Unrestricted", "true");
-
- return root;
- }
-
- public override void FromXml (SecurityElement securityElement)
- {
- if (securityElement == null)
- throw new ArgumentNullException ("securityElement");
-
- // LAMESPEC: it says to throw an ArgumentNullException in this case
- if (securityElement.Tag != "IPermission")
- throw new ArgumentException ("securityElement");
-
- string classStr = securityElement.Attribute ("class");
- if (classStr == null || !classStr.StartsWith (this.GetType ().FullName + ","))
- throw new ArgumentException ("securityElement");
-
- string unrestricted = securityElement.Attribute ("Unrestricted");
- if (unrestricted != null)
- this.m_noRestriction = (String.Compare (unrestricted, "true", true) == 0);
- }
-
- public override IPermission Union (IPermission target)
- {
- // LAMESPEC: according to spec we should throw an
- // exception when target is null. We'll follow the
- // behaviour of MS.Net instead of the spec.
- if (target == null)
- return this;
- // throw new ArgumentNullException ("target");
-
- DnsPermission perm = target as DnsPermission;
-
- if (perm == null)
- throw new ArgumentException ("Argument not of type DnsPermission");
-
- return this.m_noRestriction ? this : perm;
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net/DnsPermissionAttribute.cs b/mcs/class/System/System.Net/DnsPermissionAttribute.cs
deleted file mode 100644
index 5b8a3a18f45..00000000000
--- a/mcs/class/System/System.Net/DnsPermissionAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Net.DnsPermissionAttribute.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Net
-{
- [AttributeUsage (AttributeTargets.Assembly
- | AttributeTargets.Class
- | AttributeTargets.Struct
- | AttributeTargets.Constructor
- | AttributeTargets.Method)
- ]
- [Serializable]
- public sealed class DnsPermissionAttribute : CodeAccessSecurityAttribute
- {
-
- // Constructors
- public DnsPermissionAttribute (SecurityAction action) : base (action)
- {
- }
-
- // Methods
-
- public override IPermission CreatePermission () {
- return new DnsPermission (
- this.Unrestricted ?
- PermissionState.Unrestricted :
- PermissionState.None);
- }
- }
-}
diff --git a/mcs/class/System/System.Net/EndPoint.cs b/mcs/class/System/System.Net/EndPoint.cs
deleted file mode 100755
index 5e1d81f98dc..00000000000
--- a/mcs/class/System/System.Net/EndPoint.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Net.EndPoint.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Net.Sockets;
-
-namespace System.Net {
- [Serializable]
- public abstract class EndPoint {
-
- // NB: These methods really do nothing but throw
- // NotSupportedException
-
- public virtual AddressFamily AddressFamily {
- get {
- throw new NotSupportedException();
- }
- }
-
- public virtual EndPoint Create (SocketAddress address)
- {
- throw new NotSupportedException();
- }
-
- public virtual SocketAddress Serialize ()
- {
- throw new NotSupportedException();
- }
-
- protected EndPoint ()
- {
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/EndpointPermission.cs b/mcs/class/System/System.Net/EndpointPermission.cs
deleted file mode 100644
index ca895c75694..00000000000
--- a/mcs/class/System/System.Net/EndpointPermission.cs
+++ /dev/null
@@ -1,326 +0,0 @@
-//
-// System.Net.EndpointPermission.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Net
-{
- [Serializable]
- public class EndpointPermission // too bad about the lowercase p, not consistent with IPEndPoint ;)
- {
- private static char [] dot_char = new char [] { '.' };
-
- // Fields
- private string hostname;
- private int port;
- private TransportType transport;
-
- private bool resolved;
- private bool hasWildcard;
- private IPAddress [] addresses;
-
- // Constructors
- internal EndpointPermission (string hostname,
- int port,
- TransportType transport) : base ()
- {
- if (hostname == null)
- throw new ArgumentNullException ("hostname");
- this.hostname = hostname;
- this.port = port;
- this.transport = transport;
- this.resolved = false;
- this.hasWildcard = false;
- this.addresses = null;
- }
-
- // Properties
-
- public string Hostname {
- get { return hostname; }
- }
-
- public int Port {
- get { return port; }
- }
-
- public TransportType Transport {
- get { return transport; }
- }
-
- // Methods
-
- public override bool Equals (object obj)
- {
- EndpointPermission epp = obj as EndpointPermission;
- return ((epp != null) &&
- (this.port == epp.port) &&
- (this.transport == epp.transport) &&
- (String.Compare (this.hostname, epp.hostname, true) == 0));
- }
-
- public override int GetHashCode ()
- {
- return ToString ().GetHashCode ();
- }
-
- public override string ToString ()
- {
- return hostname + "#" + port + "#" + (int) transport;
- }
-
- // Internal & Private Methods
-
- internal bool IsSubsetOf (EndpointPermission perm)
- {
- if (perm == null)
- return false;
-
- if (perm.port != SocketPermission.AllPorts &&
- this.port != perm.port)
- return false;
-
- if (perm.transport != TransportType.All &&
- this.transport != perm.transport)
- return false;
-
- this.Resolve ();
- perm.Resolve ();
-
- if (this.hasWildcard) {
- if (perm.hasWildcard)
- return IsSubsetOf (this.hostname, perm.hostname);
- else
- return false;
- }
-
- if (this.addresses == null)
- return false;
-
- if (perm.hasWildcard)
- // a bit dubious... should they all be a subset or is one
- // enough in this case?
- foreach (IPAddress addr in this.addresses)
- if (IsSubsetOf (addr.ToString (), perm.hostname))
- return true;
-
- if (perm.addresses == null)
- return false;
-
- // a bit dubious... should they all be a subset or is one
- // enough in this case?
- foreach (IPAddress addr in perm.addresses)
- if (IsSubsetOf (this.hostname, addr.ToString ()))
- return true;
-
- return false;
- }
-
- private bool IsSubsetOf (string addr1, string addr2)
- {
- string [] h1 = addr1.Split (dot_char);
- string [] h2 = addr2.Split (dot_char);
-
- for (int i = 0; i < 4; i++) {
- int part1 = ToNumber (h1 [i]);
- if (part1 == -1)
- return false;
-
- int part2 = ToNumber (h2 [i]);
- if (part2 == -1)
- return false;
- if (part1 != part2 && part2 != 256)
- return false;
- }
- return true;
- }
-
- internal EndpointPermission Intersect (EndpointPermission perm)
- {
- if (perm == null)
- return null;
-
- int _port;
- if (this.port == perm.port)
- _port = this.port;
- else if (this.port == SocketPermission.AllPorts)
- _port = perm.port;
- else if (perm.port == SocketPermission.AllPorts)
- _port = this.port;
- else
- return null;
-
- TransportType _transport;
- if (this.transport == perm.transport)
- _transport = this.transport;
- else if (this.transport == TransportType.All)
- _transport = perm.transport;
- else if (perm.transport == TransportType.All)
- _transport = this.transport;
- else
- return null;
-
- string _hostname = IntersectHostname (perm);
-
- if (_hostname == null)
- return null;
-
- if (!this.hasWildcard)
- return this;
-
- if (!perm.hasWildcard)
- return perm;
-
- EndpointPermission newperm = new EndpointPermission (_hostname, _port, _transport);
- newperm.hasWildcard = true;
- newperm.resolved = true;
- return newperm;
- }
-
- private string IntersectHostname (EndpointPermission perm)
- {
- if (this.hostname == perm.hostname)
- return this.hostname;
-
- this.Resolve ();
- perm.Resolve ();
-
- string _hostname = null;
-
- if (this.hasWildcard) {
- if (perm.hasWildcard) {
- _hostname = Intersect (this.hostname, perm.hostname);
- } else if (perm.addresses != null) {
- for (int j = 0; j < perm.addresses.Length; j++) {
- _hostname = Intersect (this.hostname, perm.addresses [j].ToString ());
- if (_hostname != null)
- break;
- }
- }
- } else if (this.addresses != null) {
- for (int i = 0; i < this.addresses.Length; i++) {
- string thisaddr = this.addresses [i].ToString ();
- if (perm.hasWildcard) {
- _hostname = Intersect (thisaddr, perm.hostname);
- } else if (perm.addresses != null) {
- for (int j = 0; j < perm.addresses.Length; j++) {
- _hostname = Intersect (thisaddr, perm.addresses [j].ToString ());
- if (_hostname != null)
- break;
- }
- }
- }
- }
-
- return _hostname;
- }
-
- // alas, currently we'll only support IPv4 as that's MS.Net behaviour
- // returns null when both host strings do not intersect
- private string Intersect (string addr1, string addr2)
- {
- string [] h1 = addr1.Split (dot_char);
- string [] h2 = addr2.Split (dot_char);
-
- string [] s = new string [7];
- for (int i = 0; i < 4; i++) {
- int part1 = ToNumber (h1 [i]);
- if (part1 == -1)
- return null;
-
- int part2 = ToNumber (h2 [i]);
- if (part2 == -1)
- return null;
-
- if (part1 == 256)
- s [i << 1] = (part2 == 256) ? "*" : String.Empty + part2;
- else if (part2 == 256)
- s [i << 1] = (part1 == 256) ? "*" : String.Empty + part1;
- else if (part1 == part2)
- s [i << 1] = String.Empty + part1;
- else
- return null;
- }
-
- s [1] = s [3] = s [5] = ".";
- return String.Concat (s);
- }
-
- // returns 256 if value is a '*' character
- // returns -1 if value isn't a number between 0 and 255
- private int ToNumber (string value)
- {
- if (value == "*")
- return 256;
-
- int len = value.Length;
- if (len < 1 || len > 3)
- return -1;
-
- int val = 0;
- for (int i = 0; i < len; i++) {
- char c = value [i];
- if ('0' <= c && c <= '9')
- val = checked (val * 10 + (c - '0'));
- else
- return -1;
- }
-
- return val <= 255 ? val : -1;
- }
-
- internal void Resolve ()
- {
- if (resolved)
- return;
-
- bool isHostname = false;
- bool hasWildcard = false;
- this.addresses = null;
-
- string [] s = hostname.Split (dot_char);
-
- if (s.Length != 4) {
- isHostname = true;
- } else {
- for (int i = 0; i < 4; i++) {
- int quad = ToNumber (s [i]);
- if (quad == -1) {
- isHostname = true;
- break;
- }
- if (quad == 256)
- hasWildcard = true;
- }
- }
-
- if (isHostname) {
- this.hasWildcard = false;
- try {
- this.addresses = Dns.GetHostByName (hostname).AddressList;
- } catch (System.Net.Sockets.SocketException) {
- }
- } else {
- this.hasWildcard = hasWildcard;
- if (!hasWildcard) {
- addresses = new IPAddress [1];
- addresses [0] = IPAddress.Parse (hostname);
- }
- }
-
- this.resolved = true;
- }
-
- internal void UndoResolve ()
- {
- resolved = false;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/FileWebRequest.cs b/mcs/class/System/System.Net/FileWebRequest.cs
deleted file mode 100644
index 899c10f7676..00000000000
--- a/mcs/class/System/System.Net/FileWebRequest.cs
+++ /dev/null
@@ -1,295 +0,0 @@
-//
-// System.Net.FileWebRequest
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.Remoting.Messaging;
-using System.Threading;
-
-namespace System.Net
-{
- [Serializable]
- public class FileWebRequest : WebRequest, ISerializable
- {
- private Uri uri;
- private WebHeaderCollection webHeaders;
-
- private ICredentials credentials;
- private string connectionGroup;
- private string method;
- private int timeout;
-
- private Stream requestStream = null;
- private FileWebResponse webResponse = null;
- private AutoResetEvent requestEndEvent = null;
- private bool requesting = false;
- private bool asyncResponding = false;
-
- // Constructors
-
- internal FileWebRequest (Uri uri)
- {
- this.uri = uri;
- this.webHeaders = new WebHeaderCollection ();
- this.method = "GET";
- this.timeout = System.Threading.Timeout.Infinite;
- }
-
- [MonoTODO]
- protected FileWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
- {
- throw new NotImplementedException ();
- }
-
- // Properties
-
- // currently not used according to spec
- public override string ConnectionGroupName {
- get { return connectionGroup; }
- set { connectionGroup = value; }
- }
-
- public override long ContentLength {
- get {
- try {
- return Int64.Parse (webHeaders ["Content-Length"]);
- } catch (Exception) {
- return 0;
- }
- }
- set {
- if (value < 0)
- throw new ArgumentException ("value");
- webHeaders ["Content-Length"] = Convert.ToString (value);
- }
- }
-
- public override string ContentType {
- get { return webHeaders ["Content-Type"]; }
- set { webHeaders ["Content-Type"] = value; }
- }
-
- public override ICredentials Credentials {
- get { return credentials; }
- set { credentials = value; }
- }
-
- public override WebHeaderCollection Headers {
- get { return webHeaders; }
- }
-
- // currently not used according to spec
- public override string Method {
- get { return this.method; }
- set { this.method = value; }
- }
-
- // currently not used according to spec
- public override bool PreAuthenticate {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- // currently not used according to spec
- public override IWebProxy Proxy {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public override Uri RequestUri {
- get { return this.uri; }
- }
-
- public override int Timeout {
- get { return timeout; }
- set {
- if (value < 0)
- throw new ArgumentException ("value");
- timeout = value;
- }
- }
-
- // Methods
-
- private delegate Stream GetRequestStreamCallback ();
- private delegate WebResponse GetResponseCallback ();
-
- public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
- {
- if (method == null || (!method.Equals ("PUT") && !method.Equals ("POST")))
- throw new ProtocolViolationException ("Cannot send file when method is: " + this.method + ". Method must be PUT.");
- // workaround for bug 24943
- Exception e = null;
- lock (this) {
- if (asyncResponding || webResponse != null)
- e = new InvalidOperationException ("This operation cannot be performed after the request has been submitted.");
- else if (requesting)
- e = new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- else
- requesting = true;
- }
- if (e != null)
- throw e;
- /*
- lock (this) {
- if (asyncResponding || webResponse != null)
- throw new InvalidOperationException ("This operation cannot be performed after the request has been submitted.");
- if (requesting)
- throw new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- requesting = true;
- }
- */
- GetRequestStreamCallback c = new GetRequestStreamCallback (this.GetRequestStreamInternal);
- return c.BeginInvoke (callback, state);
- }
-
- public override Stream EndGetRequestStream (IAsyncResult asyncResult)
- {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
- AsyncResult async = (AsyncResult) asyncResult;
- GetRequestStreamCallback cb = (GetRequestStreamCallback) async.AsyncDelegate;
- return cb.EndInvoke (asyncResult);
- }
-
- public override Stream GetRequestStream()
- {
- IAsyncResult asyncResult = BeginGetRequestStream (null, null);
- if (!(asyncResult.AsyncWaitHandle.WaitOne (timeout, false))) {
- throw new WebException("The request timed out", WebExceptionStatus.Timeout);
- }
- return EndGetRequestStream (asyncResult);
- }
-
- internal Stream GetRequestStreamInternal ()
- {
- this.requestStream = new FileWebStream (
- this,
- FileMode.CreateNew,
- FileAccess.Write,
- FileShare.Read);
- return this.requestStream;
- }
-
- public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
- {
- // workaround for bug 24943
- Exception e = null;
- lock (this) {
- if (asyncResponding)
- e = new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- else
- asyncResponding = true;
- }
- if (e != null)
- throw e;
- /*
- lock (this) {
- if (asyncResponding)
- throw new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- asyncResponding = true;
- }
- */
- GetResponseCallback c = new GetResponseCallback (this.GetResponseInternal);
- return c.BeginInvoke (callback, state);
- }
-
- public override WebResponse EndGetResponse (IAsyncResult asyncResult)
- {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
- AsyncResult async = (AsyncResult) asyncResult;
- GetResponseCallback cb = (GetResponseCallback) async.AsyncDelegate;
- WebResponse webResponse = cb.EndInvoke(asyncResult);
- asyncResponding = false;
- return webResponse;
- }
-
- public override WebResponse GetResponse ()
- {
- IAsyncResult asyncResult = BeginGetResponse (null, null);
- if (!(asyncResult.AsyncWaitHandle.WaitOne (timeout, false))) {
- throw new WebException("The request timed out", WebExceptionStatus.Timeout);
- }
- return EndGetResponse (asyncResult);
- }
-
- public WebResponse GetResponseInternal ()
- {
- if (webResponse != null)
- return webResponse;
- lock (this) {
- if (requesting) {
- requestEndEvent = new AutoResetEvent (false);
- }
- }
- if (requestEndEvent != null) {
- requestEndEvent.WaitOne ();
- }
- FileStream fileStream = new FileWebStream (
- this,
- FileMode.Open,
- FileAccess.Read,
- FileShare.Read);
- this.webResponse = new FileWebResponse (this.uri, fileStream);
- return (WebResponse) this.webResponse;
- }
-
- [MonoTODO]
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- throw new NotImplementedException ();
- }
-
- internal void Close ()
- {
- // already done in class below
- // if (requestStream != null) {
- // requestStream.Close ();
- // }
-
- lock (this) {
- requesting = false;
- if (requestEndEvent != null)
- requestEndEvent.Set ();
- // requestEndEvent = null;
- }
- }
-
- // to catch the Close called on the FileStream
- internal class FileWebStream : FileStream
- {
- FileWebRequest webRequest;
-
- internal FileWebStream (FileWebRequest webRequest,
- FileMode mode,
- FileAccess access,
- FileShare share)
- : base (webRequest.RequestUri.LocalPath,
- mode, access, share)
- {
- this.webRequest = webRequest;
- }
-
- public override void Close()
- {
- base.Close ();
- FileWebRequest req = webRequest;
- webRequest = null;
- if (req != null)
- req.Close ();
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/FileWebResponse.cs b/mcs/class/System/System.Net/FileWebResponse.cs
deleted file mode 100644
index d4acb6e79e9..00000000000
--- a/mcs/class/System/System.Net/FileWebResponse.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// System.Net.FileWebResponse
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class FileWebResponse : WebResponse, ISerializable, IDisposable
- {
- private Uri responseUri;
- private FileStream fileStream;
- private long contentLength;
- private WebHeaderCollection webHeaders;
- private bool disposed = false;
-
- // Constructors
-
- protected FileWebResponse () { }
-
- internal FileWebResponse (Uri responseUri, FileStream fileStream)
- {
- try {
- this.responseUri = responseUri;
- this.fileStream = fileStream;
- this.contentLength = fileStream.Length;
- this.webHeaders = new WebHeaderCollection ();
- this.webHeaders.Add ("Content-Length", Convert.ToString (contentLength));
- this.webHeaders.Add ("Content-Type", "binary/octet-stream");
- } catch (Exception e) {
- throw new WebException (e.Message, e);
- }
- }
-
- [MonoTODO]
- protected FileWebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)
- {
- throw new NotImplementedException ();
- }
-
- // Properties
-
- public override long ContentLength {
- get {
- try { return this.contentLength; }
- finally { CheckDisposed (); }
- }
- }
-
- public override string ContentType {
- get {
- try { return "binary/octet-stream"; }
- finally { CheckDisposed (); }
- }
- }
-
- public override WebHeaderCollection Headers {
- get {
- try { return this.webHeaders; }
- finally { CheckDisposed (); }
- }
- }
-
- public override Uri ResponseUri {
- get {
- try { return this.responseUri; }
- finally { CheckDisposed (); }
- }
- }
-
- // Methods
-
- [MonoTODO]
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- try {
- throw new NotImplementedException ();
- } finally { CheckDisposed (); }
- }
-
- public override Stream GetResponseStream()
- {
- try { return this.fileStream; }
- finally { CheckDisposed (); }
- }
-
- // Cleaning up stuff
-
- ~FileWebResponse ()
- {
- Dispose (false);
- }
-
- public override void Close()
- {
- ((IDisposable) this).Dispose ();
- }
-
- void IDisposable.Dispose()
- {
- Dispose (true);
-
- // see spec, suppress finalization of this object.
- GC.SuppressFinalize (this);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (this.disposed)
- return;
- this.disposed = true;
-
- if (disposing) {
- // release managed resources
- this.responseUri = null;
- this.webHeaders = null;
- }
-
- // release unmanaged resources
- FileStream stream = fileStream;
- fileStream = null;
- if (stream != null)
- stream.Close (); // also closes webRequest
- }
-
- private void CheckDisposed ()
- {
- if (disposed)
- throw new ObjectDisposedException (GetType ().FullName);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/GlobalProxySelection.cs b/mcs/class/System/System.Net/GlobalProxySelection.cs
deleted file mode 100644
index d17683ced5b..00000000000
--- a/mcs/class/System/System.Net/GlobalProxySelection.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Net.GlobalProxySelection
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- public class GlobalProxySelection
- {
- private static IWebProxy proxy;
-
- // Static Initializer
-
- static GlobalProxySelection ()
- {
- proxy = GetEmptyWebProxy ();
-
- // TODO: create proxy object based on information from
- // the global or application configuration file.
- }
-
- // Constructors
-
- public GlobalProxySelection() { }
-
- // Properties
-
- public static IWebProxy Select {
- get { return proxy; }
- set {
- proxy = (value == null) ? GetEmptyWebProxy () : value;
- }
- }
-
- // Methods
-
- public static IWebProxy GetEmptyWebProxy()
- {
- // must return a new one each time, as the credentials
- // can be set
- return new EmptyWebProxy ();
- }
-
- // Internal Classes
-
- internal class EmptyWebProxy : IWebProxy {
- private ICredentials credentials = null;
-
- internal EmptyWebProxy () { }
-
- public ICredentials Credentials {
- get { return credentials; }
- set { credentials = value; }
- }
-
- public Uri GetProxy (Uri destination)
- {
- return destination;
- }
-
- public bool IsBypassed (Uri host)
- {
- return true; // pass directly to host
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/HttpContinueDelegate.cs b/mcs/class/System/System.Net/HttpContinueDelegate.cs
deleted file mode 100644
index a8f4d1f4aaa..00000000000
--- a/mcs/class/System/System.Net/HttpContinueDelegate.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// System.Net.HttpContinueDelegate.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-namespace System.Net
-{
- public delegate void HttpContinueDelegate (
- int StatusCode,
- WebHeaderCollection httpHeaders);
-}
diff --git a/mcs/class/System/System.Net/HttpStatusCode.cs b/mcs/class/System/System.Net/HttpStatusCode.cs
deleted file mode 100755
index 6688853fafc..00000000000
--- a/mcs/class/System/System.Net/HttpStatusCode.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-// HttpStatusCode.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:32:05 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum HttpStatusCode {
-
- /// <summary>
- /// </summary>
- Continue = 100,
-
- /// <summary>
- /// </summary>
- SwitchingProtocols = 101,
-
- /// <summary>
- /// </summary>
- OK = 200,
-
- /// <summary>
- /// </summary>
- Created = 201,
-
- /// <summary>
- /// </summary>
- Accepted = 202,
-
- /// <summary>
- /// </summary>
- NonAuthoritativeInformation = 203,
-
- /// <summary>
- /// </summary>
- NoContent = 204,
-
- /// <summary>
- /// </summary>
- ResetContent = 205,
-
- /// <summary>
- /// </summary>
- PartialContent = 206,
-
- /// <summary>
- /// </summary>
- MultipleChoices = 300,
-
- /// <summary>
- /// </summary>
- Ambiguous = 300,
-
- /// <summary>
- /// </summary>
- MovedPermanently = 301,
-
- /// <summary>
- /// </summary>
- Moved = 301,
-
- /// <summary>
- /// </summary>
- Found = 302,
-
- /// <summary>
- /// </summary>
- Redirect = 302,
-
- /// <summary>
- /// </summary>
- SeeOther = 303,
-
- /// <summary>
- /// </summary>
- RedirectMethod = 303,
-
- /// <summary>
- /// </summary>
- NotModified = 304,
-
- /// <summary>
- /// </summary>
- UseProxy = 305,
-
- /// <summary>
- /// </summary>
- Unused = 306,
-
- /// <summary>
- /// </summary>
- TemporaryRedirect = 307,
-
- /// <summary>
- /// </summary>
- RedirectKeepVerb = 307,
-
- /// <summary>
- /// </summary>
- BadRequest = 400,
-
- /// <summary>
- /// </summary>
- Unauthorized = 401,
-
- /// <summary>
- /// </summary>
- PaymentRequired = 402,
-
- /// <summary>
- /// </summary>
- Forbidden = 403,
-
- /// <summary>
- /// </summary>
- NotFound = 404,
-
- /// <summary>
- /// </summary>
- MethodNotAllowed = 405,
-
- /// <summary>
- /// </summary>
- NotAcceptable = 406,
-
- /// <summary>
- /// </summary>
- ProxyAuthenticationRequired = 407,
-
- /// <summary>
- /// </summary>
- RequestTimeout = 408,
-
- /// <summary>
- /// </summary>
- Conflict = 409,
-
- /// <summary>
- /// </summary>
- Gone = 410,
-
- /// <summary>
- /// </summary>
- LengthRequired = 411,
-
- /// <summary>
- /// </summary>
- PreconditionFailed = 412,
-
- /// <summary>
- /// </summary>
- RequestEntityTooLarge = 413,
-
- /// <summary>
- /// </summary>
- RequestUriTooLong = 414,
-
- /// <summary>
- /// </summary>
- UnsupportedMediaType = 415,
-
- /// <summary>
- /// </summary>
- RequestedRangeNotSatisfiable = 416,
-
- /// <summary>
- /// </summary>
- ExpectationFailed = 417,
-
- /// <summary>
- /// </summary>
- InternalServerError = 500,
-
- /// <summary>
- /// </summary>
- NotImplemented = 501,
-
- /// <summary>
- /// </summary>
- BadGateway = 502,
-
- /// <summary>
- /// </summary>
- ServiceUnavailable = 503,
-
- /// <summary>
- /// </summary>
- GatewayTimeout = 504,
-
- /// <summary>
- /// </summary>
- HttpVersionNotSupported = 505,
- } // HttpStatusCode
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/HttpVersion.cs b/mcs/class/System/System.Net/HttpVersion.cs
deleted file mode 100644
index 7172fbce27e..00000000000
--- a/mcs/class/System/System.Net/HttpVersion.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Net.HttpVersion.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-
-namespace System.Net {
-
- // <remarks>
- // </remarks>
- public class HttpVersion {
-
- public static readonly Version Version10 = new Version (1, 0);
- public static readonly Version Version11 = new Version (1, 1);
-
- // pretty useless..
- public HttpVersion () {}
- }
-}
diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs
deleted file mode 100644
index 126bae37076..00000000000
--- a/mcs/class/System/System.Net/HttpWebRequest.cs
+++ /dev/null
@@ -1,579 +0,0 @@
-//
-// System.Net.HttpWebRequest
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Net.Sockets;
-using System.Runtime.Remoting.Messaging;
-using System.Runtime.Serialization;
-using System.Security.Cryptography.X509Certificates;
-using System.Threading;
-
-namespace System.Net
-{
- [Serializable]
- public class HttpWebRequest : WebRequest, ISerializable
- {
- private Uri requestUri;
- private Uri actualUri = null;
- private bool allowAutoRedirect = true;
- private bool allowBuffering = true;
- private X509CertificateCollection certificate = null;
- private string connectionGroup = null;
- private long contentLength = -1;
- private HttpContinueDelegate continueDelegate = null;
- private CookieContainer cookieContainer = null;
- private ICredentials credentials = null;
- private bool haveResponse = false;
- private WebHeaderCollection webHeaders;
- private bool keepAlive = true;
- private int maxAutoRedirect = 50;
- private string mediaType = String.Empty;
- private string method;
- private bool pipelined = true;
- private bool preAuthenticate = false;
- private Version version;
- private IWebProxy proxy;
- private bool sendChunked = false;
- private ServicePoint servicePoint = null;
- private int timeout = System.Threading.Timeout.Infinite;
-
- private Stream requestStream = null;
- private HttpWebResponse webResponse = null;
- private AutoResetEvent requestEndEvent = null;
- private bool requesting = false;
- private bool asyncResponding = false;
-
- // Constructors
-
- internal HttpWebRequest (Uri uri)
- {
- this.requestUri = uri;
- this.actualUri = uri;
- this.webHeaders = new WebHeaderCollection (true);
- // this.webHeaders.SetInternal ("Host", uri.Authority);
- // this.webHeaders.SetInternal ("Date", DateTime.Now.ToUniversalTime ().ToString ("r", null));
- // this.webHeaders.SetInternal ("Expect", "100-continue");
- this.method = "GET";
- this.version = HttpVersion.Version11;
- this.proxy = GlobalProxySelection.Select;
- }
-
- [MonoTODO]
- protected HttpWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
- {
- throw new NotImplementedException ();
- }
-
- // Properties
-
- public string Accept {
- get { return webHeaders ["Accept"]; }
- set {
- CheckRequestStarted ();
- webHeaders.SetInternal ("Accept", value);
- }
- }
-
- public Uri Address {
- get { return actualUri; }
- }
-
- public bool AllowAutoRedirect {
- get { return allowAutoRedirect; }
- set { this.allowAutoRedirect = value; }
- }
-
- public bool AllowWriteStreamBuffering {
- get { return allowBuffering; }
- set { this.allowBuffering = value; }
- }
-
- public X509CertificateCollection ClientCertificates {
- get { return certificate; }
- }
-
- public string Connection {
- get { return webHeaders ["Connection"]; }
- set {
- CheckRequestStarted ();
- string val = value;
- if (val != null)
- val = val.Trim ().ToLower ();
- if (val == null || val.Length == 0) {
- webHeaders.RemoveInternal ("Connection");
- return;
- }
- if (val == "keep-alive" || val == "close")
- throw new ArgumentException ("value");
- if (KeepAlive && val.IndexOf ("keep-alive") == -1)
- value = value + ", Keep-Alive";
-
- webHeaders.SetInternal ("Connection", value);
- }
- }
-
- public override string ConnectionGroupName {
- get { return connectionGroup; }
- set { connectionGroup = value; }
- }
-
- public override long ContentLength {
- get { return contentLength; }
- set {
- CheckRequestStarted ();
- if (value < 0)
- throw new ArgumentException ("value");
- contentLength = value;
- webHeaders.SetInternal ("Content-Length", Convert.ToString (value));
- }
- }
-
- public override string ContentType {
- get { return webHeaders ["Content-Type"]; }
- set {
- CheckRequestStarted ();
- if (value == null || value.Trim().Length == 0) {
- webHeaders.RemoveInternal ("Content-Type");
- return;
- }
- webHeaders.SetInternal ("Content-Type", value);
- }
- }
-
- public HttpContinueDelegate ContinueDelegate {
- get { return continueDelegate; }
- set { continueDelegate = value; }
- }
-
- public CookieContainer CookieContainer {
- get { return cookieContainer; }
- set { cookieContainer = value; }
- }
-
- public override ICredentials Credentials {
- get { return credentials; }
- set { credentials = value; }
- }
-
- public string Expect {
- get { return webHeaders ["Expect"]; }
- set {
- CheckRequestStarted ();
- string val = value;
- if (val != null)
- val = val.Trim ().ToLower ();
- if (val == null || val.Length == 0) {
- webHeaders.RemoveInternal ("Expect");
- return;
- }
- if (val == "100-continue")
- throw new ArgumentException ("value");
- webHeaders.SetInternal ("Expect", value);
- }
- }
-
- public bool HaveResponse {
- get { return haveResponse; }
- }
-
- public override WebHeaderCollection Headers {
- get { return webHeaders; }
- set {
- CheckRequestStarted ();
- WebHeaderCollection newHeaders = new WebHeaderCollection (true);
- int count = value.Count;
- for (int i = 0; i < count; i++)
- newHeaders.Add (value.GetKey (i), value.Get (i));
- webHeaders = newHeaders;
- }
- }
-
- public DateTime IfModifiedSince {
- get {
- string str = webHeaders ["If-Modified-Since"];
- if (str == null)
- return DateTime.Now;
- try {
- return MonoHttpDate.Parse (str);
- } catch (Exception) {
- return DateTime.Now;
- }
- }
- set {
- CheckRequestStarted ();
- // rfc-1123 pattern
- webHeaders.SetInternal ("If-Modified-Since",
- value.ToUniversalTime ().ToString ("r", null));
- // TODO: check last param when using different locale
- }
- }
-
- public bool KeepAlive {
- get {
- CheckRequestStarted ();
- return keepAlive;
- }
- set {
- CheckRequestStarted ();
- keepAlive = value;
- }
- }
-
- public int MaximumAutomaticRedirections {
- get { return maxAutoRedirect; }
- set {
- if (value < 0)
- throw new ArgumentException ("value");
- maxAutoRedirect = value;
- }
- }
-
- public string MediaType {
- get { return mediaType; }
- set {
- CheckRequestStarted ();
- mediaType = value;
- }
- }
-
- public override string Method {
- get { return this.method; }
- set {
- CheckRequestStarted ();
-
- if (value == null ||
- (value != "GET" &&
- value != "HEAD" &&
- value != "POST" &&
- value != "PUT" &&
- value != "DELETE" &&
- value != "TRACE" &&
- value != "OPTIONS"))
- throw new ArgumentException ("not a valid method");
- if (contentLength != -1 &&
- value != "POST" &&
- value != "PUT")
- throw new ArgumentException ("method must be PUT or POST");
-
- method = value;
- }
- }
-
- public bool Pipelined {
- get { return pipelined; }
- set { this.pipelined = value; }
- }
-
- public override bool PreAuthenticate {
- get { return preAuthenticate; }
- set { preAuthenticate = value; }
- }
-
- public Version ProtocolVersion {
- get { return version; }
- set {
- if (value != HttpVersion.Version10 && value != HttpVersion.Version11)
- throw new ArgumentException ("value");
- version = (Version) value;
- }
- }
-
- public override IWebProxy Proxy {
- get { return proxy; }
- set {
- if (value == null)
- throw new ArgumentNullException ("value");
- proxy = value;
- }
- }
-
- public string Referer {
- get { return webHeaders ["Referer" ]; }
- set {
- CheckRequestStarted ();
- if (value == null || value.Trim().Length == 0) {
- webHeaders.RemoveInternal ("Referer");
- return;
- }
- webHeaders.SetInternal ("Referer", value);
- }
- }
-
- public override Uri RequestUri {
- get { return requestUri; }
- }
-
- public bool SendChunked {
- get { return sendChunked; }
- set {
- CheckRequestStarted ();
- sendChunked = value;
- }
- }
-
- public ServicePoint ServicePoint {
- get { return servicePoint; }
- }
-
- public override int Timeout {
- get { return timeout; }
- set { timeout = value; }
- }
-
- public string TransferEncoding {
- get { return webHeaders ["Transfer-Encoding"]; }
- set {
- CheckRequestStarted ();
- if (!sendChunked)
- throw new InvalidOperationException ("SendChunked must be True");
- string val = value;
- if (val != null)
- val = val.Trim ().ToLower ();
- if (val == null || val.Length == 0) {
- webHeaders.RemoveInternal ("Transfer-Encoding");
- return;
- }
- if (val == "chunked")
- throw new ArgumentException ("Cannot set value to Chunked");
- webHeaders.SetInternal ("Transfer-Encoding", value);
- }
- }
-
- public string UserAgent {
- get { return webHeaders ["User-Agent"]; }
- set { webHeaders.SetInternal ("User-Agent", value); }
- }
-
- // Methods
-
- public void AddRange (int range)
- {
- AddRange ("bytes", range);
- }
-
- public void AddRange (int from, int to)
- {
- AddRange ("bytes", from, to);
- }
-
- public void AddRange (string rangeSpecifier, int range)
- {
- if (rangeSpecifier == null)
- throw new ArgumentNullException ("rangeSpecifier");
- string value = webHeaders ["Range"];
- if (value == null || value.Length == 0)
- value = rangeSpecifier + "=";
- else if (value.ToLower ().StartsWith (rangeSpecifier.ToLower () + "="))
- value += ",";
- else
- throw new InvalidOperationException ("rangeSpecifier");
- webHeaders.SetInternal ("Range", value + range + "-");
- }
-
- public void AddRange (string rangeSpecifier, int from, int to)
- {
- if (rangeSpecifier == null)
- throw new ArgumentNullException ("rangeSpecifier");
- if (from < 0 || to < 0 || from > to)
- throw new ArgumentOutOfRangeException ();
- string value = webHeaders ["Range"];
- if (value == null || value.Length == 0)
- value = rangeSpecifier + "=";
- else if (value.ToLower ().StartsWith (rangeSpecifier.ToLower () + "="))
- value += ",";
- else
- throw new InvalidOperationException ("rangeSpecifier");
- webHeaders.SetInternal ("Range", value + from + "-" + to);
- }
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- private delegate Stream GetRequestStreamCallback ();
- private delegate WebResponse GetResponseCallback ();
-
- public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
- {
- if (method == null || (!method.Equals ("PUT") && !method.Equals ("POST")))
- throw new ProtocolViolationException ("Cannot send file when method is: " + this.method + ". Method must be PUT.");
- // workaround for bug 24943
- Exception e = null;
- lock (this) {
- if (asyncResponding || webResponse != null)
- e = new InvalidOperationException ("This operation cannot be performed after the request has been submitted.");
- else if (requesting)
- e = new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- else
- requesting = true;
- }
- if (e != null)
- throw e;
- /*
- lock (this) {
- if (asyncResponding || webResponse != null)
- throw new InvalidOperationException ("This operation cannot be performed after the request has been submitted.");
- if (requesting)
- throw new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- requesting = true;
- }
- */
- GetRequestStreamCallback c = new GetRequestStreamCallback (this.GetRequestStreamInternal);
- return c.BeginInvoke (callback, state);
- }
-
- public override Stream EndGetRequestStream (IAsyncResult asyncResult)
- {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
- AsyncResult async = (AsyncResult) asyncResult;
- GetRequestStreamCallback cb = (GetRequestStreamCallback) async.AsyncDelegate;
- return cb.EndInvoke (asyncResult);
- }
-
- public override Stream GetRequestStream()
- {
- IAsyncResult asyncResult = BeginGetRequestStream (null, null);
- if (!(asyncResult.AsyncWaitHandle.WaitOne (timeout, false))) {
- throw new WebException("The request timed out", WebExceptionStatus.Timeout);
- }
- return EndGetRequestStream (asyncResult);
- }
-
- internal Stream GetRequestStreamInternal ()
- {
- this.requestStream = null; // TODO: new HttpWebStream (this);
- return this.requestStream;
- }
-
- public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
- {
- // workaround for bug 24943
- Exception e = null;
- lock (this) {
- if (asyncResponding)
- e = new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- else
- asyncResponding = true;
- }
- if (e != null)
- throw e;
- /*
- lock (this) {
- if (asyncResponding)
- throw new InvalidOperationException ("Cannot re-call start of asynchronous method while a previous call is still in progress.");
- asyncResponding = true;
- }
- */
- GetResponseCallback c = new GetResponseCallback (this.GetResponseInternal);
- return c.BeginInvoke (callback, state);
- }
-
- public override WebResponse EndGetResponse (IAsyncResult asyncResult)
- {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
- if (!asyncResult.IsCompleted)
- asyncResult.AsyncWaitHandle.WaitOne ();
- AsyncResult async = (AsyncResult) asyncResult;
- GetResponseCallback cb = (GetResponseCallback) async.AsyncDelegate;
- WebResponse webResponse = cb.EndInvoke(asyncResult);
- asyncResponding = false;
- return webResponse;
- }
-
- public override WebResponse GetResponse()
- {
- IAsyncResult asyncResult = BeginGetResponse (null, null);
- if (!(asyncResult.AsyncWaitHandle.WaitOne (timeout, false))) {
- throw new WebException("The request timed out", WebExceptionStatus.Timeout);
- }
- return EndGetResponse (asyncResult);
- }
-
- public WebResponse GetResponseInternal ()
- {
- if (webResponse != null)
- return webResponse;
- lock (this) {
- if (requesting) {
- requestEndEvent = new AutoResetEvent (false);
- }
- }
- if (requestEndEvent != null) {
- requestEndEvent.WaitOne ();
- }
- Stream responseStream = null; // TODO: new HttpWebStream (this);
- this.webResponse = new HttpWebResponse (this.actualUri, method, responseStream);
- return (WebResponse) this.webResponse;
- }
-
- [MonoTODO]
- public override void Abort()
- {
- this.haveResponse = true;
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- throw new NotImplementedException ();
- }
-
- // Private Methods
-
- private void CheckRequestStarted ()
- {
- if (requesting)
- throw new InvalidOperationException ("request started");
- }
-
- internal void Close ()
- {
- // already done in class below
- // if (requestStream != null) {
- // requestStream.Close ();
- // }
-
- lock (this) {
- requesting = false;
- if (requestEndEvent != null)
- requestEndEvent.Set ();
- // requestEndEvent = null;
- }
- }
-
- // Private Classes
-
- // to catch the Close called on the NetworkStream
- /*
- internal class HttpWebStream : Stream
- {
- HttpWebRequest webRequest;
-
- internal HttpWebStream (HttpWebRequest webRequest)
- : base (webRequest.RequestUri)
- {
- this.webRequest = webRequest;
- }
-
- public override void Close()
- {
- base.Close ();
- webRequest.Close ();
- }
- }
- */
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/HttpWebResponse.cs b/mcs/class/System/System.Net/HttpWebResponse.cs
deleted file mode 100644
index 50d0eedb55f..00000000000
--- a/mcs/class/System/System.Net/HttpWebResponse.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-// System.Net.HttpWebResponse
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class HttpWebResponse : WebResponse, ISerializable, IDisposable
- {
- private Uri uri;
- private WebHeaderCollection webHeaders;
- private CookieCollection cookieCollection = null;
- private string method = null;
- private Version version = null;
- private HttpStatusCode statusCode;
- private string statusDescription = null;
-
- private Stream responseStream;
- private bool disposed = false;
-
- // Constructors
-
- internal HttpWebResponse (Uri uri, string method, Stream responseStream)
- {
- this.uri = uri;
- this.method = method;
- this.responseStream = responseStream;
-
- // TODO: parse headers from responseStream
-
- this.statusCode = HttpStatusCode.OK;
- }
-
- protected HttpWebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)
- {
- throw new NotSupportedException ();
- }
-
- // Properties
-
- public string CharacterSet {
- // Content-Type = "Content-Type" ":" media-type
- // media-type = type "/" subtype *( ";" parameter )
- // parameter = attribute "=" value
- // 3.7.1. default is ISO-8859-1
- get {
- try {
- string contentType = ContentType;
- if (contentType == null)
- return "ISO-8859-1";
- string val = contentType.ToLower ();
- int pos = val.IndexOf ("charset=");
- if (pos == -1)
- return "ISO-8859-1";
- pos += 8;
- int pos2 = val.IndexOf (';', pos);
- return (pos2 == -1)
- ? contentType.Substring (pos)
- : contentType.Substring (pos, pos2 - pos);
- } finally {
- CheckDisposed ();
- }
- }
- }
-
- public string ContentEncoding {
- get {
- try { return webHeaders ["Content-Encoding"]; }
- finally { CheckDisposed (); }
- }
- }
-
- public override long ContentLength {
- get {
- try {
- return Int64.Parse (webHeaders ["Content-Length"]);
- } catch (Exception) {
- return -1;
- } finally {
- CheckDisposed ();
- }
- }
- }
-
- public override string ContentType {
- get {
- try { return webHeaders ["Content-Type"]; }
- finally { CheckDisposed (); }
- }
- }
-
- public CookieCollection Cookies {
- get {
- CheckDisposed ();
-
- // LAMESPEC: a simple test reveal this always
- // returns an empty collection. It is not filled
- // with the values from the Set-Cookie or
- // Set-Cookie2 response headers, which is a bit
- // of a shame..
- if (cookieCollection == null)
- cookieCollection = new CookieCollection ();
- return cookieCollection;
- }
- set {
- CheckDisposed ();
- // ?? don't understand how you can set cookies on a response.
- throw new NotSupportedException ();
- }
- }
-
- public override WebHeaderCollection Headers {
- get {
- CheckDisposed ();
- return webHeaders;
- }
- }
-
- public DateTime LastModified {
- get {
- CheckDisposed ();
- try {
- string dtStr = webHeaders ["Last-Modified"];
- return MonoHttpDate.Parse (dtStr);
- } catch (Exception) {
- return DateTime.Now;
- }
- }
- }
-
- public string Method {
- get {
- CheckDisposed ();
- return method;
- }
- }
-
- public Version ProtocolVersion {
- get {
- CheckDisposed ();
- return version;
- }
- }
-
- public override Uri ResponseUri {
- get {
- CheckDisposed ();
- return uri;
- }
- }
-
- public string Server {
- get {
- try {
- return webHeaders ["Server"];
- } finally {
- CheckDisposed ();
- }
- }
- }
-
- public HttpStatusCode StatusCode {
- get {
- CheckDisposed ();
- return statusCode;
- }
- }
-
- public string StatusDescription {
- get {
- CheckDisposed ();
- return statusDescription;
- }
- }
-
- // Methods
-
- public override int GetHashCode ()
- {
- try {
- return base.GetHashCode ();
- } finally {
- CheckDisposed ();
- }
- }
-
- public string GetResponseHeader (string headerName)
- {
- try {
- return webHeaders [headerName];
- } finally {
- CheckDisposed ();
- }
- }
-
- public override Stream GetResponseStream ()
- {
- try {
- if (method.Equals ("HEAD")) // see par 4.3 & 9.4
- return Stream.Null;
- return responseStream;
- } finally {
- CheckDisposed ();
- }
- }
-
- [MonoTODO]
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- CheckDisposed ();
- throw new NotImplementedException ();
- }
-
-
- // Cleaning up stuff
-
- ~HttpWebResponse ()
- {
- Dispose (false);
- }
-
- public override void Close ()
- {
- ((IDisposable) this).Dispose ();
- }
-
- void IDisposable.Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (this.disposed)
- return;
- this.disposed = true;
-
- if (disposing) {
- // release managed resources
- uri = null;
- webHeaders = null;
- cookieCollection = null;
- method = null;
- version = null;
- // statusCode = null;
- statusDescription = null;
- }
-
- // release unmanaged resources
- Stream stream = responseStream;
- responseStream = null;
- if (stream != null)
- stream.Close (); // also closes webRequest
- }
-
- private void CheckDisposed ()
- {
- if (disposed)
- throw new ObjectDisposedException (GetType ().FullName);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/IAuthenticationModule.cs b/mcs/class/System/System.Net/IAuthenticationModule.cs
deleted file mode 100755
index 15119f74da3..00000000000
--- a/mcs/class/System/System.Net/IAuthenticationModule.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Net.IAuthenticationModule.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Net {
-
- // <remarks>
- // Authentication interface for Web client authentication modules.
- // </remarks>
- public interface IAuthenticationModule {
- string AuthenticationType {
- get;
- }
-
- bool CanPreAuthenticate {
- get;
- }
-
- bool CanRespond (string challenge);
-
- Authorization PreAuthenticate (WebRequest request, ICredentials credentials);
-
- Authorization Respond (string challenge, WebRequest request, ICredentials credentials);
- }
-}
diff --git a/mcs/class/System/System.Net/ICertificatePolicy.cs b/mcs/class/System/System.Net/ICertificatePolicy.cs
deleted file mode 100644
index 37d2405a3ec..00000000000
--- a/mcs/class/System/System.Net/ICertificatePolicy.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Net.ICertificatePolicy.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System.Security.Cryptography.X509Certificates;
-
-namespace System.Net {
-
- // <remarks>
- // </remarks>
- public interface ICertificatePolicy {
- bool CheckValidationResult (
- ServicePoint srvPoint,
- X509Certificate certificate,
- WebRequest request,
- int certificateProblem
- );
- }
-}
diff --git a/mcs/class/System/System.Net/ICredentialLookup.cs b/mcs/class/System/System.Net/ICredentialLookup.cs
deleted file mode 100755
index 26b48ba9860..00000000000
--- a/mcs/class/System/System.Net/ICredentialLookup.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Net.ICredential.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-
-namespace System.Net {
-
- // <remarks>
- // Base authentication interface for Web clients.
- // </remarks>
- public interface ICredentials
- {
- NetworkCredential GetCredential (Uri uri, string authType);
- }
-}
diff --git a/mcs/class/System/System.Net/IPAddress.cs b/mcs/class/System/System.Net/IPAddress.cs
deleted file mode 100755
index 86041acb862..00000000000
--- a/mcs/class/System/System.Net/IPAddress.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// System.Net.IPAddress.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-// Note: the address is stored in host order
-
-using System;
-using System.Globalization;
-using System.Net.Sockets;
-using System.Runtime.InteropServices;
-
-namespace System.Net {
-
- /// <remarks>
- /// Encapsulates an IP Address.
- /// </remarks>
- [Serializable]
- public class IPAddress {
- // Don't change the name of this field without also
- // changing socket-io.c in the runtime
- private long address;
-
- public static readonly IPAddress Any = new IPAddress(0);
- public static readonly IPAddress Broadcast = IPAddress.Parse ("255.255.255.255");
- public static readonly IPAddress Loopback = IPAddress.Parse ("127.0.0.1");
- public static readonly IPAddress None = IPAddress.Parse ("255.255.255.255");
-
- private static short SwapShort (short number)
- {
- return (short) ( ((number >> 8) & 0xFF) + ((number << 8) & 0xFF00) );
- }
-
- private static int SwapInt (int number)
- {
- byte b0 = (byte) ((number >> 24) & 0xFF);
- byte b1 = (byte) ((number >> 16) & 0xFF);
- byte b2 = (byte) ((number >> 8) & 0xFF);
- byte b3 = (byte) (number & 0xFF);
- return b0 + (b1 << 8) + (b2 << 16) + (b3 << 24);
- }
-
- private static long SwapLong (long number)
- {
- byte b0 = (byte) ((number >> 56) & 0xFF);
- byte b1 = (byte) ((number >> 48) & 0xFF);
- byte b2 = (byte) ((number >> 40) & 0xFF);
- byte b3 = (byte) ((number >> 32) & 0xFF);
- byte b4 = (byte) ((number >> 24) & 0xFF);
- byte b5 = (byte) ((number >> 16) & 0xFF);
- byte b6 = (byte) ((number >> 8) & 0xFF);
- byte b7 = (byte) (number & 0xFF);
- return (long) b0 + ((long) b1 << 8) + ((long) b2 << 16) + ((long) b3 << 24) + ((long) b4 << 32) + ((long) b5 << 40) + ((long) b6 << 48) + ((long) b7 << 56);
- }
-
- public static short HostToNetworkOrder(short host) {
- if (!BitConverter.IsLittleEndian)
- return(host);
-
- return SwapShort (host);
- }
-
- public static int HostToNetworkOrder(int host) {
- if (!BitConverter.IsLittleEndian)
- return(host);
-
- return SwapInt (host);
- }
-
- public static long HostToNetworkOrder(long host) {
- if (!BitConverter.IsLittleEndian)
- return(host);
-
- return SwapLong (host);
- }
-
- public static short NetworkToHostOrder(short network) {
- if (!BitConverter.IsLittleEndian)
- return(network);
-
- return SwapShort (network);
- }
-
- public static int NetworkToHostOrder(int network) {
- if (!BitConverter.IsLittleEndian)
- return(network);
-
- return SwapInt (network);
- }
-
- public static long NetworkToHostOrder(long network) {
- if (!BitConverter.IsLittleEndian)
- return(network);
-
- return SwapLong (network);
- }
-
- /// <summary>
- /// Constructor from a 32-bit constant with its bytes
- /// in network order.
- /// </summary>
- public IPAddress (long addr)
- {
- Address = addr;
- }
-
- public static IPAddress Parse (string ip)
- {
- if (ip == null)
- throw new ArgumentNullException ("null ip string");
-
- if (ip.Length == 0 || ip [0] == ' ')
- return new IPAddress (0);
-
- int pos = ip.IndexOf (' ');
- if (pos != -1)
- ip = ip.Substring (0, pos);
- else if (ip [ip.Length - 1] == '.')
- throw new FormatException ("An invalid IP address was specified");
-
- string [] ips = ip.Split (new char [] {'.'});
- if (ips.Length > 4)
- throw new FormatException ("An invalid IP address was specified");
-
- // Make the number in network order
- try {
- long a = 0;
- byte val = 0;
- for (int i = 0; i < ips.Length; i++) {
- string subnet = ips [i];
- if ((3 <= subnet.Length && subnet.Length <= 4) &&
- (subnet [0] == '0') &&
- (subnet [1] == 'x' || subnet [2] == 'X')) {
- if (subnet.Length == 3)
- val = (byte) Uri.FromHex (subnet [2]);
- else
- val = (byte) ((Uri.FromHex (subnet [2]) << 4) | Uri.FromHex (subnet [3]));
- } else if (subnet.Length == 0)
- val = 0;
- else
- val = Byte.Parse (subnet, NumberStyles.None);
-
- if (ips.Length < 4 && i == (ips.Length - 1))
- i = 3;
-
- a |= (long) val << (i << 3);
- }
-
- return (new IPAddress (a));
- } catch (Exception) {
- throw new FormatException ("An invalid IP address was specified");
- }
- }
-
- public long Address {
- get {
- return address;
- }
- set {
- /* no need to do this test, ms.net accepts any value.
- if (value < 0 || value > 0x00000000FFFFFFFF)
- throw new ArgumentOutOfRangeException (
- "the address must be between 0 and 0xFFFFFFFF");
- */
-
- address = value;
- }
- }
-
- public AddressFamily AddressFamily {
- get {
- return(AddressFamily.InterNetwork);
- }
- }
-
-
- /// <summary>
- /// Used to tell whether an address is a loopback.
- /// All IP addresses of the form 127.X.Y.Z, where X, Y, and Z are in
- /// the range 0-255, are loopback addresses.
- /// </summary>
- /// <param name="addr">Address to compare</param>
- /// <returns></returns>
- public static bool IsLoopback (IPAddress addr)
- {
- return (addr.address & 0xFF) == 127;
- }
-
- /// <summary>
- /// Overrides System.Object.ToString to return
- /// this object rendered in a quad-dotted notation
- /// </summary>
- public override string ToString ()
- {
- return ToString (address);
- }
-
- /// <summary>
- /// Returns this object rendered in a quad-dotted notation
- /// </summary>
- static string ToString (long addr)
- {
- // addr is in network order
- return (addr & 0xff).ToString () + "." +
- ((addr >> 8) & 0xff).ToString () + "." +
- ((addr >> 16) & 0xff).ToString () + "." +
- ((addr >> 24) & 0xff).ToString ();
- }
-
- /// <returns>
- /// Whether both objects are equal.
- /// </returns>
- public override bool Equals (object other)
- {
- if (other is System.Net.IPAddress){
- return Address == ((System.Net.IPAddress) other).Address;
- }
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (int)Address;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/IPEndPoint.cs b/mcs/class/System/System.Net/IPEndPoint.cs
deleted file mode 100755
index a52539faf79..00000000000
--- a/mcs/class/System/System.Net/IPEndPoint.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// System.Net.IPEndPoint.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Net.Sockets;
-
-namespace System.Net {
- [Serializable]
- public class IPEndPoint : EndPoint {
-
- private IPAddress address;
- private int port;
-
- public const int MaxPort = 65535;
- public const int MinPort = 0;
-
- public IPEndPoint (IPAddress address, int port)
- {
- if (address == null)
- throw new ArgumentNullException ("Value cannot be null");
-
- Address = address;
- Port = port;
- }
-
- public IPEndPoint (long iaddr, int port) : this (new IPAddress (iaddr), port)
- {
- }
-
- public IPAddress Address {
- get {
- return (address);
- }
- set {
- address=value;
- }
- }
-
- public override AddressFamily AddressFamily {
- get {
- return AddressFamily.InterNetwork;
- }
- }
-
- public int Port {
- get {
- return port;
- }
- set {
- // LAMESPEC: no mention of sanity checking
- // PS: MS controls the range when setting the value
- if (value < MinPort || value > MaxPort)
- throw new ArgumentOutOfRangeException ("Invalid port");
-
- port = value;
- }
- }
-
- // bytes 2 and 3 store the port, the rest
- // stores the address
- public override EndPoint Create(SocketAddress sockaddr) {
- int size=sockaddr.Size;
-
- // LAMESPEC: no mention of what to do if
- // sockaddr is bogus
- if(size<8) {
- // absolute minimum amount needed for
- // an address family, buffer size,
- // port and address
- return(null);
- }
- AddressFamily family=(AddressFamily)sockaddr[0];
- if(family!=AddressFamily.InterNetwork) {
- return(null);
- }
-
- int port=(((int)sockaddr[2])<<8) + (int)sockaddr[3];
- long address=(((long)sockaddr[7])<<24) +
- (((long)sockaddr[6])<<16) +
- (((long)sockaddr[5])<<8) +
- (long)sockaddr[4];
-
- IPEndPoint ipe = new IPEndPoint(address, port);
-
- return(ipe);
- }
-
- public override SocketAddress Serialize() {
- // .net produces a 16 byte buffer, even though
- // only 8 bytes are used. I guess its just a
- // holdover from struct sockaddr padding.
- SocketAddress sockaddr = new SocketAddress(AddressFamily.InterNetwork, 16);
-
- // bytes 2 and 3 store the port, the rest
- // stores the address
- sockaddr [2] = (byte) ((port>>8) & 0xff);
- sockaddr [3] = (byte) (port & 0xff);
-
- sockaddr [4] = (byte) (address.Address & 0xff);
- sockaddr [5] = (byte) ((address.Address >> 8) & 0xff);
- sockaddr [6] = (byte) ((address.Address >> 16) & 0xff);
- sockaddr [7] = (byte) ((address.Address >> 24) & 0xff);
-
- return(sockaddr);
- }
-
- public override string ToString() {
- return(address.ToString() + ":" + port);
- }
-
- public override bool Equals (Object obj)
- {
- IPEndPoint p = obj as IPEndPoint;
- return p != null &&
- p.port == port &&
- p.address.Equals (address);
- }
-
- public override int GetHashCode ()
- {
- return address.GetHashCode () + port;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/IPHostEntry.cs b/mcs/class/System/System.Net/IPHostEntry.cs
deleted file mode 100644
index dd24e48b19b..00000000000
--- a/mcs/class/System/System.Net/IPHostEntry.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-// System.Net.IPHostEntry.cs
-//
-// Author: Mads Pultz (mpultz@diku.dk)
-//
-// (C) Mads Pultz, 2001
-
-using System;
-
-namespace System.Net {
-
- public class IPHostEntry {
- private IPAddress[] addressList;
- private String[] aliases;
- private String hostName;
-
- public IPHostEntry() {
- hostName = "localhost";
- addressList = new IPAddress[1];
- addressList[0] = IPAddress.Loopback;
- aliases = new String[0];
- }
-
- public IPAddress[] AddressList {
- get { return addressList; }
- set { addressList = value; }
- }
-
- public string[] Aliases {
- get { return aliases; }
- set { aliases = value; }
- }
-
- public string HostName {
- get { return hostName; }
- set { hostName = value; }
- }
-
-/* According to the .NET Framework SDK Documentation (beta 2) the following
- methods from Object are not overrided. I implemented them before realizing
- this but I leave the implementation here if needed in the future.
-
- public override string ToString() {
- string res = hostName;
- if (addressList != null && addressList.Length > 0)
- res += " [" + addressList[0] + "]";
- return res;
- }
-
- public override bool Equals(object obj) {
- if (obj is IPHostEntry) {
- IPHostEntry h = (IPHostEntry)obj;
- return hostName.Equals(h.HostName) && aliases.Equals(h.Aliases) &&
- addressList.Equals(h.AddressList);
- }
- else
- return false;
- }
-
- public override int GetHashCode() {
- return hostName.GetHashCode();
- }
-
- protected new object MemberwiseClone() {
- IPHostEntry res = new IPHostEntry();
- res.AddressList = new IPAddress[addressList.Length];
- Array.Copy(addressList, res.AddressList, addressList.Length);
- res.Aliases = new String[aliases.Length];
- Array.Copy(aliases, res.Aliases, aliases.Length);
- res.HostName = hostName;
- return res;
- }
-*/
- }
-}
-
diff --git a/mcs/class/System/System.Net/IPv6Address.cs b/mcs/class/System/System.Net/IPv6Address.cs
deleted file mode 100644
index 96ed983f7dd..00000000000
--- a/mcs/class/System/System.Net/IPv6Address.cs
+++ /dev/null
@@ -1,278 +0,0 @@
-//
-// System.Net.IPv6Address.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-// Note I: This class is not defined in the specs of .Net
-//
-// Note II : The name of this class is perhaps unfortunate as it turns
-// out that in ms.net there's an internal class called
-// IPv6Address in namespace System.
-//
-
-
-using System;
-using System.Net.Sockets;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace System.Net {
-
- /// <remarks>
- /// Encapsulates an IPv6 Address.
- /// See RFC 2373 for more info on IPv6 addresses.
- /// </remarks>
- [Serializable]
- public class IPv6Address {
- private ushort [] address;
- private int prefixLength;
-
- public static readonly IPv6Address Loopback = IPv6Address.Parse ("::1");
- public static readonly IPv6Address Unspecified = IPv6Address.Parse ("::");
-
- /// <summary>
- /// Constructor from a 32-bit constant with its bytes
- /// in network order.
- /// </summary>
- public IPv6Address (ushort [] addr)
- {
- if (addr == null)
- throw new ArgumentNullException ("addr");
- if (addr.Length != 8)
- throw new ArgumentException ("addr");
- address = addr;
- }
-
- public IPv6Address (ushort [] addr, int prefixLength) : this (addr)
- {
- if (prefixLength < 0 || prefixLength > 128)
- throw new ArgumentException ("prefixLength");
- this.prefixLength = prefixLength;
- }
-
- public static IPv6Address Parse (string ipString)
- {
- if (ipString == null)
- throw new ArgumentNullException ("ipString");
-
- if (ipString.Length > 2 &&
- ipString [0] == '[' &&
- ipString [ipString.Length - 1] == ']')
- ipString = ipString.Substring (1, ipString.Length - 2);
-
- if (ipString.Length < 2)
- throw new FormatException ("Not a valid IPv6 address");
-
- int prefixLen = 0;
- int pos = ipString.LastIndexOf ('/');
- if (pos != -1) {
- string prefix = ipString.Substring (pos + 1);
- try {
- prefixLen = Int32.Parse (prefix);
- } catch (Exception) {
- prefixLen = -1;
- }
- if (prefixLen < 0 || prefixLen > 128)
- throw new FormatException ("Not a valid prefix length");;
- ipString = ipString.Substring (0, pos);
- }
-
- ushort [] addr = new ushort [8];
-
- bool ipv4 = false;
- int pos2 = ipString.LastIndexOf (":");
- if (pos2 == -1)
- throw new FormatException ("Not a valid IPv6 address");
- if (pos2 < (ipString.Length - 1)) {
- string ipv4Str = ipString.Substring (pos2 + 1);
- if (ipv4Str.IndexOf ('.') != -1) {
- try {
- long a = IPAddress.Parse (ipv4Str).Address;
- addr [6] = (ushort) (((int) (a & 0xff) << 8) + ((int) ((a >> 8) & 0xff)));
- addr [7] = (ushort) (((int) ((a >> 16) & 0xff) << 8) + ((int) ((a >> 24) & 0xff)));
- if (ipString [pos2 - 1] == ':')
- ipString = ipString.Substring (0, pos2 + 1);
- else
- ipString = ipString.Substring (0, pos2);
- ipv4 = true;
- } catch (Exception) {
- throw new FormatException ("Not a valid IPv6 address");
- }
- }
- }
-
- int origLen = ipString.Length;
- if (origLen < 2)
- throw new FormatException ("Not a valid IPv6 address");
- ipString = ipString.Replace ("::", ":!:");
- int len = ipString.Length;
- if ((len - origLen) > 1)
- throw new FormatException ("Not a valid IPv6 address");
-
- if (ipString [1] == '!')
- ipString = ipString.Remove (0, 1);
- if (ipString [len - 2] == '!')
- ipString = ipString.Remove (len - 1, 1);
- if ((ipString.Length > 2) &&
- ((ipString [0] == ':') || (ipString [ipString.Length - 1] == ':')))
- throw new FormatException ("Not a valid IPv6 address");
-
- string [] pieces = ipString.Split (new char [] {':'});
- len = pieces.Length;
- if (len > (ipv4 ? 6 : 8))
- throw new FormatException ("Not a valid IPv6 address");
- int piecedouble = -1;
- for (int i = 0; i < len; i++) {
- string piece = pieces [i];
- if (piece == "!")
- piecedouble = i;
- else {
- int plen = piece.Length;
- if (plen > 4)
- throw new FormatException ("Not a valid IPv6 address");
- int p = 0;
- for (int j = 0; j < plen; j++)
- try {
- p = (p << 4) + Uri.FromHex (piece [j]);
- } catch (ArgumentException) {
- throw new FormatException ("Not a valid IPv6 address");
- }
- addr [i] = (ushort) p;
- }
- }
-
- //expand the :: token
- if (piecedouble != -1) {
- int totallen = (ipv4 ? 5 : 7);
- int i = totallen;
- for (i = totallen; i >= (totallen - (len - piecedouble - 1)); i--) {
- addr [i] = addr [(len - 1) + i - totallen];
- }
- for (; i >= piecedouble; i--) {
- addr [i] = 0;
- }
- } else if (len != (ipv4 ? 6 : 8))
- throw new FormatException ("Not a valid IPv6 address");
-
- // check IPv4 validity
- if (ipv4) {
- for (int i = 0; i < 5; i++)
- if (addr [i] != 0)
- throw new FormatException ("Not a valid IPv6 address");
- if (addr [5] != 0 && addr [5] != 0xffff)
- throw new FormatException ("Not a valid IPv6 address");
- }
-
- return new IPv6Address (addr, prefixLen);
- }
-
- public ushort [] Address {
- get { return address; }
- }
-
- public int PrefixLength {
- get { return this.prefixLength; }
- }
-
- public ushort this [int index] {
- get { return address [index]; }
- }
-
- public AddressFamily AddressFamily {
- get { return AddressFamily.InterNetworkV6; }
- }
-
- /// <summary>
- /// Used to tell whether the given address is the loopback address.
- /// </summary>
- public static bool IsLoopback (IPv6Address addr)
- {
- for (int i = 0; i < 4; i++)
- if (addr.address [i] != 0)
- return false;
- if ((addr.address [5] != 0) && (addr.address [5] != 0xffff))
- return false;
- if ((addr.address [6] >> 8) == 0x7f)
- return true;
- return ((addr.address [5] == 0) &&
- (addr.address [6] == 0) &&
- (addr.address [7] == 1));
- }
-
- public bool IsIPv4Compatible ()
- {
- for (int i = 0; i < 6; i++)
- if (address [i] != 0)
- return false;
- return true;
- }
-
- public bool IsIPv4Mapped ()
- {
- for (int i = 0; i < 5; i++)
- if (address [i] != 0)
- return false;
- return address [5] == 0xffff;
- }
-
- /// <summary>
- /// Overrides System.Object.ToString to return
- /// this object rendered in a canonicalized notation
- /// </summary>
- public override string ToString ()
- {
- StringBuilder s = new StringBuilder ();
- for (int i = 0; i < 7; i++)
- s.Append (String.Format ("{0:X4}", address [i])).Append (':');
- s.Append (String.Format ("{0:X4}", address [7]));
- return s.ToString ();
- }
-
- /// <returns>
- /// Whether both objects are equal.
- /// </returns>
- public override bool Equals (object other)
- {
- System.Net.IPv6Address ipv6 = other as System.Net.IPv6Address;
- if (ipv6 != null) {
- for (int i = 0; i < 8; i++)
- if (this.address [i] != ipv6.address [i])
- return false;
- return true;
- }
-
- System.Net.IPAddress ipv4 = other as System.Net.IPAddress;
- if (ipv4 != null) {
- for (int i = 0; i < 5; i++)
- if (address [i] != 0)
- return false;
-
- if (address [5] != 0 && address [5] != 0xffff)
- return false;
-
- long a = ipv4.Address;
- if (address [6] != (ushort) (((int) (a & 0xff) << 8) + ((int) ((a >> 8) & 0xff))) ||
- address [7] != (ushort) (((int) ((a >> 16) & 0xff) << 8) + ((int) ((a >> 24) & 0xff))))
- return false;
-
- return true;
- }
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- return Hash (((((int) address [0]) << 16) + address [1]),
- ((((int) address [2]) << 16) + address [3]),
- ((((int) address [4]) << 16) + address [5]),
- ((((int) address [6]) << 16) + address [7]));
- }
-
- private static int Hash (int i, int j, int k, int l)
- {
- return i ^ (j << 13 | j >> 19) ^ (k << 26 | k >> 6) ^ (l << 7 | l >> 25);
- }
- }
-}
diff --git a/mcs/class/System/System.Net/IWebProxy.cs b/mcs/class/System/System.Net/IWebProxy.cs
deleted file mode 100644
index 00f10e32da1..00000000000
--- a/mcs/class/System/System.Net/IWebProxy.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Net.IWebProxy.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-
-namespace System.Net {
-
- // <remarks>
- // </remarks>
- public interface IWebProxy {
- ICredentials Credentials {
- get;
- set;
- }
-
- Uri GetProxy (Uri destination);
-
- bool IsBypassed (Uri host);
- }
-}
diff --git a/mcs/class/System/System.Net/IWebRequestCreate.cs b/mcs/class/System/System.Net/IWebRequestCreate.cs
deleted file mode 100644
index 85eb452abf4..00000000000
--- a/mcs/class/System/System.Net/IWebRequestCreate.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Net.IWebRequestCreate.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-namespace System.Net {
-
- // <remarks>
- // </remarks>
- public interface IWebRequestCreate {
- WebRequest Create (Uri uri);
- }
-}
diff --git a/mcs/class/System/System.Net/MonoHttpDate.cs b/mcs/class/System/System.Net/MonoHttpDate.cs
deleted file mode 100644
index e7ebfe419f5..00000000000
--- a/mcs/class/System/System.Net/MonoHttpDate.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Net.MonoHttpDate
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Net
-{
- /// <summary>
- /// See RFC 2068 3.3.1
- /// </summary>
- internal class MonoHttpDate
- {
- private static readonly string rfc1123_date = "r";
- private static readonly string rfc850_date = "dddd, dd-MMM-yy HH:mm:ss G\\MT";
- private static readonly string asctime_date = "ddd MMM d HH:mm:ss yyyy";
- private static readonly string [] formats =
- new string [] {rfc1123_date, rfc850_date, asctime_date};
- private static readonly CultureInfo enUS = new CultureInfo("en-US", false);
-
- internal static DateTime Parse (string dateStr)
- {
- return DateTime.ParseExact (dateStr,
- formats,
- enUS,
- DateTimeStyles.AllowWhiteSpaces);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/NetworkAccess.cs b/mcs/class/System/System.Net/NetworkAccess.cs
deleted file mode 100755
index 7d20e93aa2c..00000000000
--- a/mcs/class/System/System.Net/NetworkAccess.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// NetworkAccess.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:58 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum NetworkAccess {
-
- /// <summary>
- /// </summary>
- Accept = 128,
-
- /// <summary>
- /// </summary>
- Connect = 64,
- } // NetworkAccess
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/NetworkCredential.cs b/mcs/class/System/System.Net/NetworkCredential.cs
deleted file mode 100755
index 8f62cdbe292..00000000000
--- a/mcs/class/System/System.Net/NetworkCredential.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// System.Net.NetworkCredential.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Net
-{
- public class NetworkCredential : ICredentials
- {
- // Fields
- string userName;
- string password;
- string domain;
-
- // Constructors
- public NetworkCredential ()
- : base ()
- {
- }
-
- public NetworkCredential (string userName, string password)
- {
- this.userName = userName;
- this.password = password;
- }
-
- public NetworkCredential (string userName, string password, string domain)
- {
- this.userName = userName;
- this.password = password;
- this.domain = domain;
- }
-
- // Properties
-
- public string Domain
- {
- get { return domain; }
- set { domain = value; }
- }
-
- public string UserName
- {
- get { return userName; }
- set { userName = value; }
- }
-
- public string Password
- {
- get { return password; }
- set { password = value; }
- }
-
- [MonoTODO]
- public NetworkCredential GetCredential (Uri uri, string authType)
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/ProtocolViolationException.cs b/mcs/class/System/System.Net/ProtocolViolationException.cs
deleted file mode 100644
index cb201ce0d63..00000000000
--- a/mcs/class/System/System.Net/ProtocolViolationException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Net.ProtocolViolationException.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class ProtocolViolationException : InvalidOperationException, ISerializable
- {
-
- // Constructors
- public ProtocolViolationException () : base ()
- {
- }
-
- public ProtocolViolationException (string message) : base (message)
- {
- }
-
- protected ProtocolViolationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- // Methods
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/ProxyUseType.cs b/mcs/class/System/System.Net/ProxyUseType.cs
deleted file mode 100755
index fc878e6c09a..00000000000
--- a/mcs/class/System/System.Net/ProxyUseType.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// ProxyUseType.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:36:08 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum ProxyUseType {
-
- /// <summary>
- /// </summary>
- Standard = 0,
-
- /// <summary>
- /// </summary>
- Tunnel = 1,
-
- /// <summary>
- /// </summary>
- FtpGateway = 2,
-
- /// <summary>
- /// </summary>
- Socks = 3,
- } // ProxyUseType
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs
deleted file mode 100644
index 5800434edfc..00000000000
--- a/mcs/class/System/System.Net/ServicePoint.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// System.Net.ServicePoint
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Security.Cryptography.X509Certificates;
-using System.Threading;
-
-namespace System.Net
-{
- public class ServicePoint
- {
- private Uri uri;
- private int connectionLimit;
- private int maxIdleTime;
- private int currentConnections;
- private DateTime idleSince;
- private Version protocolVersion;
-
- // Constructors
-
- internal ServicePoint (Uri uri, int connectionLimit, int maxIdleTime)
- {
- this.uri = uri;
- this.connectionLimit = connectionLimit;
- this.maxIdleTime = maxIdleTime;
- this.currentConnections = 0;
- this.idleSince = DateTime.Now;
- }
-
- // Properties
-
- public Uri Address {
- get { return this.uri; }
- }
-
- [MonoTODO]
- public X509Certificate Certificate {
- get { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public X509Certificate ClientCertificate {
- get { throw new NotImplementedException (); }
- }
-
- public int ConnectionLimit {
- get { return connectionLimit; }
- set {
- if (value <= 0)
- throw new ArgumentOutOfRangeException ();
- connectionLimit = value;
- }
- }
-
- public string ConnectionName {
- get { return uri.Scheme; }
- }
-
- public int CurrentConnections {
- get { return currentConnections; }
- }
-
- public DateTime IdleSince {
- get { return idleSince; }
- }
-
- public int MaxIdleTime {
- get { return maxIdleTime; }
- set {
- if (value < Timeout.Infinite || value > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ();
- this.maxIdleTime = value;
- }
- }
-
- public virtual Version ProtocolVersion {
- get { return protocolVersion; }
- }
-
- public bool SupportsPipelining {
- get { return HttpVersion.Version11.Equals (protocolVersion); }
- }
-
- // Methods
-
- public override int GetHashCode()
- {
- return base.GetHashCode ();
- }
-
- // Internal Methods
-
- internal bool AvailableForRecycling {
- get {
- return CurrentConnections == 0
- && maxIdleTime != Timeout.Infinite
- && DateTime.Now >= IdleSince.AddMilliseconds (maxIdleTime);
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs
deleted file mode 100644
index 2dc6831761d..00000000000
--- a/mcs/class/System/System.Net/ServicePointManager.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-//
-// System.Net.ServicePointManager
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Security.Cryptography.X509Certificates;
-
-//
-// notes:
-// A service point manager manages service points (duh!).
-// A service point maintains a list of connections (per scheme + authority).
-// According to HttpWebRequest.ConnectionGroupName each connection group
-// creates additional connections. therefor, a service point has a hashtable
-// of connection groups where each value is a list of connections.
-//
-// when we need to make an HttpWebRequest, we need to do the following:
-// 1. find service point, given Uri and Proxy
-// 2. find connection group, given service point and group name
-// 3. find free connection in connection group, or create one (if ok due to limits)
-// 4. lease connection
-// 5. execute request
-// 6. when finished, return connection
-//
-
-
-namespace System.Net
-{
- public class ServicePointManager
- {
- private static HybridDictionary servicePoints = new HybridDictionary ();
-
- // Static properties
-
- private static ICertificatePolicy policy = null;
- private static int defaultConnectionLimit = DefaultPersistentConnectionLimit;
- private static int maxServicePointIdleTime = 900000; // 15 minutes
- private static int maxServicePoints = 0;
-
- // Fields
-
- public const int DefaultNonPersistentConnectionLimit = 4;
- public const int DefaultPersistentConnectionLimit = 2;
-
- // Constructors
- private ServicePointManager ()
- {
- }
-
- // Properties
-
- public static ICertificatePolicy CertificatePolicy {
- get { return policy; }
- set { policy = value; }
- }
-
- public static int DefaultConnectionLimit {
- get { return defaultConnectionLimit; }
- set {
- if (value < 0)
- throw new ArgumentOutOfRangeException ("value");
- defaultConnectionLimit = value;
- }
- }
-
- public static int MaxServicePointIdleTime {
- get {
- return maxServicePointIdleTime;
- }
- set {
- if (value < -2 || value > Int32.MaxValue)
- throw new ArgumentOutOfRangeException ("value");
- maxServicePointIdleTime = value;
- }
- }
-
- public static int MaxServicePoints {
- get {
- return maxServicePoints;
- }
- set {
- if (value < 0)
- throw new ArgumentException ("value");
- maxServicePoints = value;
- RecycleServicePoints ();
- }
- }
-
- // Methods
-
- public static ServicePoint FindServicePoint (Uri address)
- {
- return FindServicePoint (address, GlobalProxySelection.Select);
- }
-
- public static ServicePoint FindServicePoint (string uriString, IWebProxy proxy)
- {
- return FindServicePoint (new Uri(uriString), proxy);
- }
-
- public static ServicePoint FindServicePoint (Uri address, IWebProxy proxy)
- {
- RecycleServicePoints ();
-
- if (address == null)
- throw new ArgumentNullException ("address");
-
- if (proxy != null && !proxy.IsBypassed(address)) {
- address = proxy.GetProxy (address);
- }
-
- address = new Uri (address.Scheme + "://" + address.Authority);
-
- ServicePoint sp = null;
- lock (servicePoints) {
- sp = (ServicePoint) servicePoints [address];
- if (sp != null)
- return sp;
- if (maxServicePoints > 0 && servicePoints.Count >= maxServicePoints)
- throw new InvalidOperationException ("maximum number of service points reached");
- sp = new ServicePoint (address, defaultConnectionLimit, maxServicePointIdleTime);
- servicePoints.Add (address, sp);
- }
-
- return sp;
- }
-
- // Internal Methods
-
- internal static void RecycleServicePoints ()
- {
- ArrayList toRemove = new ArrayList ();
- lock (servicePoints) {
- IDictionaryEnumerator e = servicePoints.GetEnumerator ();
- while (e.MoveNext ()) {
- ServicePoint sp = (ServicePoint) e.Value;
- if (sp.AvailableForRecycling) {
- toRemove.Add (e.Key);
- }
- }
-
- for (int i = 0; i < toRemove.Count; i++)
- servicePoints.Remove (toRemove [i]);
-
- if (maxServicePoints == 0 || servicePoints.Count <= maxServicePoints)
- return;
-
- // get rid of the ones with the longest idle time
- SortedList list = new SortedList (servicePoints.Count);
- e = servicePoints.GetEnumerator ();
- while (e.MoveNext ()) {
- ServicePoint sp = (ServicePoint) e.Value;
- if (sp.CurrentConnections == 0) {
- while (list.ContainsKey (sp.IdleSince))
- sp.IdleSince.AddMilliseconds (1);
- list.Add (sp.IdleSince, sp.Address);
- }
- }
-
- for (int i = 0; i < list.Count && servicePoints.Count > maxServicePoints; i++)
- servicePoints.Remove (list.GetByIndex (i));
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/SocketAddress.cs b/mcs/class/System/System.Net/SocketAddress.cs
deleted file mode 100755
index 757a71fd7f4..00000000000
--- a/mcs/class/System/System.Net/SocketAddress.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// System.Net.SocketAddress.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Net.Sockets;
-
-namespace System.Net {
-
- public class SocketAddress {
- private byte[] data;
-
- public SocketAddress (AddressFamily family, int size)
- {
- if(size<2) {
- throw new ArgumentOutOfRangeException("size is too small");
- }
-
- data=new byte[size];
- data[0]=(byte)family;
- data[1]=(byte)size;
- }
-
- public SocketAddress (AddressFamily family)
- {
- data=new byte[32];
- data[0]=(byte)family;
- data[1]=(byte)32;
- }
-
- public AddressFamily Family {
- get {
- return((AddressFamily)data[0]);
- }
- }
-
- public int Size {
- get {
- return((int)data[1]);
- }
- }
-
- public byte this [ int offset ] {
- get {
- return(data[offset]);
- }
-
- set {
- data[offset]=value;
- }
- }
-
- public override string ToString() {
- string af=((AddressFamily)data[0]).ToString();
- int size=(int)data[1];
- string ret=af+":"+size+":{";
-
- for(int i=2; i<size; i++) {
- int val=(int)data[i];
- ret=ret+val;
- if(i<size-1) {
- ret=ret+",";
- }
- }
-
- ret=ret+"}";
-
- return(ret);
- }
-
- public override bool Equals (object obj)
- {
- if (obj is System.Net.SocketAddress &&
- ((System.Net.SocketAddress) obj).data.Length == data.Length){
- byte [] otherData = ((System.Net.SocketAddress) obj).data;
- for (int i = 0; i < data.Length; i++)
- if (otherData [i] != data [i])
- return false;
-
- return true;
- }
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- int code = 0;
-
- for (int i = 0; i < data.Length; i++)
- code += data [i] + i;
-
- return code;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/SocketPermission.cs b/mcs/class/System/System.Net/SocketPermission.cs
deleted file mode 100644
index 56faa80056f..00000000000
--- a/mcs/class/System/System.Net/SocketPermission.cs
+++ /dev/null
@@ -1,339 +0,0 @@
-//
-// System.Net.SocketPermission.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Net
-{
- [Serializable]
- public sealed class SocketPermission : CodeAccessPermission, IUnrestrictedPermission
- {
- // Fields
- ArrayList m_acceptList = new ArrayList ();
- ArrayList m_connectList = new ArrayList ();
- bool m_noRestriction;
-
- // Constructors
- public SocketPermission (PermissionState state) : base ()
- {
- m_noRestriction = (state == PermissionState.Unrestricted);
- }
-
- public SocketPermission (NetworkAccess access, TransportType transport,
- string hostName, int portNumber) : base ()
- {
- m_noRestriction = false;
- AddPermission (access, transport, hostName, portNumber);
- }
-
- // Fields
- public const int AllPorts = -1;
-
- // Properties
-
- public IEnumerator AcceptList {
- get { return m_acceptList.GetEnumerator (); }
- }
-
- public IEnumerator ConnectList {
- get { return m_connectList.GetEnumerator (); }
- }
-
- // Methods
-
- public void AddPermission (NetworkAccess access, TransportType transport,
- string hostName, int portNumber)
- {
- if (m_noRestriction)
- return;
-
- EndpointPermission permission = new EndpointPermission (hostName, portNumber, transport);
-
- if (access == NetworkAccess.Accept)
- m_acceptList.Add (permission);
- else
- m_connectList.Add (permission);
- }
-
- public override IPermission Copy ()
- {
- SocketPermission permission;
-
- permission = new SocketPermission (m_noRestriction ?
- PermissionState.Unrestricted :
- PermissionState.None);
-
- // as EndpointPermission's are immutable it's safe to do a shallow copy.
- permission.m_connectList = (ArrayList) this.m_connectList.Clone ();
- permission.m_acceptList = (ArrayList) this.m_acceptList.Clone ();
-
- return permission;
- }
-
- public override IPermission Intersect (IPermission target)
- {
- if (target == null)
- return null;
-
- SocketPermission perm = target as SocketPermission;
- if (perm == null)
- throw new ArgumentException ("Argument not of type SocketPermission");
-
- if (m_noRestriction)
- return IntersectEmpty (perm) ? null : perm.Copy ();
-
- if (perm.m_noRestriction)
- return IntersectEmpty (this) ? null : this.Copy ();
-
- SocketPermission newperm = new SocketPermission (PermissionState.None);
- Intersect (this.m_connectList, perm.m_connectList, newperm.m_connectList);
- Intersect (this.m_acceptList, perm.m_acceptList, newperm.m_acceptList);
- return IntersectEmpty (newperm) ? null : newperm;
- }
-
- private bool IntersectEmpty (SocketPermission permission)
- {
- return !permission.m_noRestriction &&
- (permission.m_connectList.Count == 0) &&
- (permission.m_acceptList.Count == 0);
- }
-
- private void Intersect (ArrayList list1, ArrayList list2, ArrayList result)
- {
- foreach (EndpointPermission perm1 in list1) {
- foreach (EndpointPermission perm2 in list2) {
- EndpointPermission perm = perm1.Intersect (perm2);
- if (perm != null) {
- // instead of the below it's also okay to simply do:
- // result.Add (perm);
- // below is only done to avoid double entries
- bool replaced = false;
- for (int i = 0; i < result.Count; i++) {
- EndpointPermission res = (EndpointPermission) result [i];
- EndpointPermission resperm = perm.Intersect (res);
- if (resperm != null) {
- result [i] = resperm;
- replaced = true;
- break;
- }
- }
- if (!replaced)
- result.Add (perm);
- }
- }
- }
- }
-
- public override bool IsSubsetOf (IPermission target)
- {
- if (target == null)
- return (!m_noRestriction && m_connectList.Count == 0 && m_acceptList.Count == 0);
-
- SocketPermission perm = target as SocketPermission;
-
- if (perm == null)
- throw new ArgumentException ("Parameter target must be of type SocketPermission");
-
- if (perm.m_noRestriction)
- return true;
-
- if (this.m_noRestriction)
- return false;
-
- if (this.m_acceptList.Count == 0 && this.m_connectList.Count == 0)
- return true;
-
- if (perm.m_acceptList.Count == 0 && perm.m_connectList.Count == 0)
- return false;
-
- return IsSubsetOf (this.m_connectList, perm.m_connectList)
- && IsSubsetOf (this.m_acceptList, perm.m_acceptList);
- }
-
- private bool IsSubsetOf (ArrayList list1, ArrayList list2)
- {
- foreach (EndpointPermission perm1 in list1) {
- bool issubset = false;
- foreach (EndpointPermission perm2 in list2)
- if (perm1.IsSubsetOf (perm2)) {
- issubset = true;
- break;
- }
- if (!issubset)
- return false;
- }
- return true;
- }
-
- public bool IsUnrestricted ()
- {
- return m_noRestriction;
- }
-
- /*
-
- SocketPermission s = new SocketPermission (NetworkAccess.Connect, TransportType.Tcp, "www.google.com", 80);
- s.AddPermission (NetworkAccess.Accept, TransportType.All, "localhost", 8080);
- s.AddPermission (NetworkAccess.Accept, TransportType.All, "localhost", SocketPermission.AllPorts);
- // s = new SocketPermission (PermissionState.None);
- SecurityElement sec = s.ToXml ();
- Console.WriteLine (sec.ToString ());
-
- This is sample xml output:
-
- <IPermission class="System.Net.SocketPermission, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- version="1">
- <ConnectAccess>
- <ENDPOINT host="www.google.com"
- transport="Tcp"
- port="80"/>
- </ConnectAccess>
- <AcceptAccess>
- <ENDPOINT host="localhost"
- transport="All"
- port="8080"/>
- <ENDPOINT host="localhost"
- transport="All"
- port="All"/>
- </AcceptAccess>
- </IPermission>
-
-
-
- This is a sample unrestricted socketpermission, no matter how many permissions you add:
-
- <IPermission class="System.Net.SocketPermission, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- version="1"
- Unrestricted="true"/>
-
-
- This is a sample constructed restricted socketpermission with no permissions added:
-
- <IPermission class="System.Net.SocketPermission, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- version="1"/>
- */
- public override SecurityElement ToXml ()
- {
-
- SecurityElement root = new SecurityElement ("IPermission");
-
- root.AddAttribute ("class", this.GetType ().AssemblyQualifiedName);
- root.AddAttribute ("version", "1");
- if (m_noRestriction) {
- root.AddAttribute ("Unrestricted", "true");
- return root;
- }
-
- if (this.m_connectList.Count > 0)
- ToXml (root, "ConnectAccess", m_connectList.GetEnumerator ());
-
- if (this.m_acceptList.Count > 0)
- ToXml (root, "AcceptAccess", m_acceptList.GetEnumerator ());
-
- return root;
- }
-
- private void ToXml (SecurityElement root, string childName, IEnumerator enumerator)
- {
- SecurityElement child = new SecurityElement (childName);
- while (enumerator.MoveNext ()) {
- EndpointPermission perm = enumerator.Current as EndpointPermission;
- SecurityElement grandchild = new SecurityElement ("ENDPOINT");
- grandchild.AddAttribute ("host", perm.Hostname);
- grandchild.AddAttribute ("transport", perm.Transport.ToString ());
- grandchild.AddAttribute ("port",
- perm.Port == AllPorts
- ? "All"
- : ((Int32) perm.Port).ToString ());
- child.AddChild (grandchild);
- }
- root.AddChild (child);
- }
-
- public override void FromXml (SecurityElement securityElement)
- {
- if (securityElement == null)
- throw new ArgumentNullException ("securityElement");
-
- // LAMESPEC: it says to throw an ArgumentNullException in this case
- if (securityElement.Tag != "IPermission")
- throw new ArgumentException ("securityElement");
-
- string classStr = securityElement.Attribute ("class");
- if (classStr == null || !classStr.StartsWith (this.GetType ().FullName + ","))
- throw new ArgumentException ("securityElement");
-
- string unrestricted = securityElement.Attribute ("Unrestricted");
- if (unrestricted != null) {
- this.m_noRestriction = (String.Compare (unrestricted, "true", true) == 0);
- if (this.m_noRestriction)
- return;
- }
-
- this.m_noRestriction = false;
- this.m_connectList = new ArrayList ();
- this.m_acceptList = new ArrayList ();
-
- ArrayList children = securityElement.Children;
- foreach (SecurityElement child in children) {
- if (child.Tag == "ConnectAccess")
- FromXml (child.Children, NetworkAccess.Connect);
- else if (child.Tag == "AcceptAccess")
- FromXml (child.Children, NetworkAccess.Accept);
- }
- }
-
- private void FromXml (ArrayList endpoints, NetworkAccess access)
- {
- foreach (SecurityElement endpoint in endpoints) {
- if (endpoint.Tag != "ENDPOINT")
- continue;
- string hostname = endpoint.Attribute ("host");
- TransportType transport =
- (TransportType) Enum.Parse (typeof (TransportType),
- endpoint.Attribute ("transport"),
- true);
- string p = endpoint.Attribute ("port");
- int port = 0;
- if (p == "All")
- port = SocketPermission.AllPorts;
- else
- port = Int32.Parse (p);
-
- AddPermission (access, transport, hostname, port);
- }
- }
-
- public override IPermission Union (IPermission target)
- {
- // LAMESPEC: according to spec we should throw an
- // exception when target is null. We'll follow the
- // behaviour of MS.Net instead of the spec, also
- // because it matches the Intersect behaviour.
- if (target == null)
- return null;
- // throw new ArgumentNullException ("target");
-
- SocketPermission perm = target as SocketPermission;
- if (perm == null)
- throw new ArgumentException ("Argument not of type SocketPermission");
-
- if (this.m_noRestriction || perm.m_noRestriction)
- return new SocketPermission (PermissionState.Unrestricted);
-
- SocketPermission copy = (SocketPermission) perm.Copy ();
- copy.m_acceptList.InsertRange (copy.m_acceptList.Count, this.m_acceptList);
- copy.m_connectList.InsertRange (copy.m_connectList.Count, this.m_connectList);
-
- return copy;
- }
-
- }
-}
diff --git a/mcs/class/System/System.Net/SocketPermissionAttribute.cs b/mcs/class/System/System.Net/SocketPermissionAttribute.cs
deleted file mode 100644
index 80a4a2c625b..00000000000
--- a/mcs/class/System/System.Net/SocketPermissionAttribute.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.Net.SocketPermissionAttribute.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Net
-{
- [AttributeUsage (AttributeTargets.Assembly
- | AttributeTargets.Class
- | AttributeTargets.Struct
- | AttributeTargets.Constructor
- | AttributeTargets.Method)
- ]
- [Serializable]
- public sealed class SocketPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- string m_access;
- string m_host;
- string m_port;
- string m_transport;
-
- // Constructors
- public SocketPermissionAttribute (SecurityAction action) : base (action)
- {
- }
-
- // Properties
-
- public string Access {
- get { return m_access; }
- set {
- if (m_access != null)
- throw new ArgumentException ("The parameter 'Access' can be set only once.");
- if (value == null)
- throw new ArgumentException ("The parameter 'Access' cannot be null.");
- m_access = value;
- }
- }
-
- public string Host {
- get { return m_host; }
- set {
- if (m_host != null)
- throw new ArgumentException ("The parameter 'Host' can be set only once.");
- if (value == null)
- throw new ArgumentException ("The parameter 'Host' cannot be null.");
- m_host = value;
- }
- }
-
- public string Port {
- get { return m_port; }
- set {
- if (m_port != null)
- throw new ArgumentException ("The parameter 'Port' can be set only once.");
- if (value == null)
- throw new ArgumentException ("The parameter 'Port' cannot be null.");
- m_port = value;
- }
- }
-
- public string Transport {
- get { return m_transport; }
- set {
- if (m_transport != null)
- throw new ArgumentException ("The parameter 'Transport' can be set only once.");
- if (value == null)
- throw new ArgumentException ("The parameter 'Transport' cannot be null.");
- m_transport = value;
- }
- }
-
- // Methods
-
- public override IPermission CreatePermission () {
- if (this.Unrestricted)
- return new SocketPermission (PermissionState.Unrestricted);
-
- if (m_access == null)
- throw new ArgumentException ("The value for 'Access' must be specified.");
- if (m_host == null)
- throw new ArgumentException ("The value for 'Host' must be specified.");
- if (m_port == null)
- throw new ArgumentException ("The value for 'Port' must be specified.");
- if (m_transport == null)
- throw new ArgumentException ("The value for 'Transport' must be specified.");
-
- NetworkAccess access;
- TransportType transport;
- int port = SocketPermission.AllPorts;
-
- if (String.Compare (m_access, "Connect", true) == 0)
- access = NetworkAccess.Connect;
- else if (String.Compare (m_access, "Accept", true) == 0)
- access = NetworkAccess.Accept;
- else
- throw new ArgumentException ("The parameter value 'Access=" + m_access + "' is invalid.");
-
- if (String.Compare (m_port, "All", true) != 0) {
- try {
- port = Int32.Parse (m_port);
- } catch (Exception) {
- throw new ArgumentException ("The parameter value 'Port=" + port + "' is invalid.");
- }
- // test whether port number is valid..
- new IPEndPoint (1, port);
- }
-
- try {
- transport = (TransportType) Enum.Parse (typeof (TransportType), m_transport, true);
- } catch (Exception) {
- throw new ArgumentException ("The parameter value 'Transport=" + m_transport + "' is invalid.");
- }
-
- SocketPermission perm = new SocketPermission (PermissionState.None);
- perm.AddPermission (access, transport, m_host, port);
- return perm;
- }
- }
-}
diff --git a/mcs/class/System/System.Net/TransportType.cs b/mcs/class/System/System.Net/TransportType.cs
deleted file mode 100755
index b9e5822fcff..00000000000
--- a/mcs/class/System/System.Net/TransportType.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// TransportType.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:32:18 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum TransportType {
-
- /// <summary>
- /// </summary>
- Udp = 1,
-
- /// <summary>
- /// </summary>
- Connectionless = 1,
-
- /// <summary>
- /// </summary>
- Tcp = 2,
-
- /// <summary>
- /// </summary>
- ConnectionOriented = 2,
-
- /// <summary>
- /// </summary>
- All = 3,
- } // TransportType
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/WebClient.cs b/mcs/class/System/System.Net/WebClient.cs
deleted file mode 100644
index 17c5895ee3e..00000000000
--- a/mcs/class/System/System.Net/WebClient.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// System.Net.WebClient
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.ComponentModel;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [ComVisible(true)]
- public sealed class WebClient : Component
- {
-
- // Constructors
-
- public WebClient ()
- {
- }
-
- // Properties
-
- [MonoTODO]
- public string BaseAddress {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public ICredentials Credentials {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public WebHeaderCollection Headers {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public NameValueCollection QueryString {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
-
- [MonoTODO]
- public WebHeaderCollection ResponseHeaders {
- get { throw new NotImplementedException (); }
- }
-
- // Methods
-
- [MonoTODO]
- public byte [] DownloadData (string address)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void DownloadFile (string address, string fileName)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public Stream OpenRead (string address)
- {
- throw new NotImplementedException ();
- }
-
- public Stream OpenWrite (string address)
- {
- return OpenWrite (address, "POST");
- }
-
- [MonoTODO]
- public Stream OpenWrite (string address, string method)
- {
- throw new NotImplementedException ();
- }
-
- public byte [] UploadData (string address, byte [] data)
- {
- return UploadData (address, "POST", data);
- }
-
- [MonoTODO]
- public byte [] UploadData (string address, string method, byte [] data)
- {
- throw new NotImplementedException ();
- }
-
- public byte [] UploadFile (string address, string fileName)
- {
- return UploadFile (address, "POST", fileName);
- }
-
- [MonoTODO]
- public byte[] UploadFile (string address, string method, string fileName)
- {
- throw new NotImplementedException ();
- }
-
- public byte[] UploadValues (string address, NameValueCollection data)
- {
- return UploadValues (address, "POST", data);
- }
-
- [MonoTODO]
- public byte[] UploadValues (string address, string method, NameValueCollection data)
- {
- throw new NotImplementedException ();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/WebException.cs b/mcs/class/System/System.Net/WebException.cs
deleted file mode 100644
index e3607a15a43..00000000000
--- a/mcs/class/System/System.Net/WebException.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Net.WebException.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public class WebException : InvalidOperationException, ISerializable
- {
- private WebResponse response;
- private WebExceptionStatus status;
-
-
- // Constructors
-
- public WebException () : base ()
- {
- }
-
- public WebException (string message) : base (message)
- {
- }
-
- protected WebException (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- : base (serializationInfo, streamingContext)
- {
- }
-
- public WebException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- public WebException (string message, WebExceptionStatus status)
- : base (message)
- {
- this.status = status;
- }
-
- public WebException(string message,
- Exception innerException,
- WebExceptionStatus status,
- WebResponse response)
- : base (message, innerException)
- {
- this.status = status;
- this.response = response;
- }
-
- // Properties
-
- public WebResponse Response {
- get { return this.response; }
- }
-
- public WebExceptionStatus Status {
- get { return this.status; }
- }
-
- // Methods
-
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
- }
-}
-
diff --git a/mcs/class/System/System.Net/WebExceptionStatus.cs b/mcs/class/System/System.Net/WebExceptionStatus.cs
deleted file mode 100755
index 05dd876bac0..00000000000
--- a/mcs/class/System/System.Net/WebExceptionStatus.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// WebExceptionStatus.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:33:08 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum WebExceptionStatus {
-
- /// <summary>
- /// </summary>
- Success = 0,
-
- /// <summary>
- /// </summary>
- NameResolutionFailure = 1,
-
- /// <summary>
- /// </summary>
- ConnectFailure = 2,
-
- /// <summary>
- /// </summary>
- ReceiveFailure = 3,
-
- /// <summary>
- /// </summary>
- SendFailure = 4,
-
- /// <summary>
- /// </summary>
- PipelineFailure = 5,
-
- /// <summary>
- /// </summary>
- RequestCanceled = 6,
-
- /// <summary>
- /// </summary>
- ProtocolError = 7,
-
- /// <summary>
- /// </summary>
- ConnectionClosed = 8,
-
- /// <summary>
- /// </summary>
- TrustFailure = 9,
-
- /// <summary>
- /// </summary>
- SecureChannelFailure = 10,
-
- /// <summary>
- /// </summary>
- ServerProtocolViolation = 11,
-
- /// <summary>
- /// </summary>
- KeepAliveFailure = 12,
-
- /// <summary>
- /// </summary>
- Pending = 13,
-
- /// <summary>
- /// </summary>
- Timeout = 14,
-
- /// <summary>
- /// </summary>
- ProxyNameResolutionFailure = 15,
- } // WebExceptionStatus
-
-} // System.Net
diff --git a/mcs/class/System/System.Net/WebHeaderCollection.cs b/mcs/class/System/System.Net/WebHeaderCollection.cs
deleted file mode 100644
index 5b4b2217943..00000000000
--- a/mcs/class/System/System.Net/WebHeaderCollection.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-// System.Net.WebHeaderCollection
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Text;
-
-// See RFC 2068 par 4.2 Message Headers
-
-namespace System.Net
-{
- [Serializable]
- [ComVisible(true)]
- public class WebHeaderCollection : NameValueCollection, ISerializable
- {
- private static readonly int [] restricted;
- private static readonly int [] multiValue;
- private bool internallyCreated = false;
-
- // Static Initializer
-
- static WebHeaderCollection ()
- {
- // For performance reasons we initialize the following
- // tables by taking the hashcode of header names.
- // When you add a header make sure all characters are in
- // lowercase.
-
- // the list of restricted header names as defined
- // by the ms.net spec
- ArrayList a = new ArrayList ();
- a.Add ("accept".GetHashCode ());
- a.Add ("connection".GetHashCode ());
- a.Add ("content-length".GetHashCode ());
- a.Add ("content-type".GetHashCode ());
- a.Add ("date".GetHashCode ());
- a.Add ("expect".GetHashCode ()); // ??? What is this anyway?
- a.Add ("host".GetHashCode ());
- a.Add ("range".GetHashCode ());
- a.Add ("referer".GetHashCode ());
- a.Add ("transfer-encoding".GetHashCode ());
- a.Add ("user-agent".GetHashCode ());
- restricted = (int []) a.ToArray (typeof (int));
-
- // see par 14 of RFC 2068 to see which header names
- // accept multiple values each separated by a comma
- a = new ArrayList ();
- a.Add ("accept".GetHashCode ());
- a.Add ("accept-charset".GetHashCode ());
- a.Add ("accept-encoding".GetHashCode ());
- a.Add ("accept-language".GetHashCode ());
- a.Add ("accept-ranges".GetHashCode ());
- a.Add ("allow".GetHashCode ());
- a.Add ("authorization".GetHashCode ());
- a.Add ("cache-control".GetHashCode ());
- a.Add ("connection".GetHashCode ());
- a.Add ("content-encoding".GetHashCode ());
- a.Add ("content-language".GetHashCode ());
- a.Add ("expect".GetHashCode ());
- a.Add ("if-match".GetHashCode ());
- a.Add ("if-none-match".GetHashCode ());
- a.Add ("proxy-authenticate".GetHashCode ());
- a.Add ("public".GetHashCode ());
- a.Add ("range".GetHashCode ());
- a.Add ("transfer-encoding".GetHashCode ());
- a.Add ("upgrade".GetHashCode ());
- a.Add ("vary".GetHashCode ());
- a.Add ("via".GetHashCode ());
- a.Add ("warning".GetHashCode ());
- multiValue = (int []) a.ToArray (typeof (int));
- }
-
- // Constructors
-
- public WebHeaderCollection () { }
-
- protected WebHeaderCollection (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- // TODO: test for compatibility with ms.net
- int count = serializationInfo.GetInt32("count");
- for (int i = 0; i < count; i++)
- this.Add (serializationInfo.GetString ("k" + i),
- serializationInfo.GetString ("v" + i));
- }
-
- internal WebHeaderCollection (bool dummy) : base ()
- {
- this.internallyCreated = true;
- }
-
- // Methods
-
- public void Add (string header)
- {
- if (header == null)
- throw new ArgumentNullException ("header");
- int pos = header.IndexOf (':');
- if (pos == -1)
- throw new ArgumentException ("no colon found");
- this.Add (header.Substring (0, pos),
- header.Substring (pos + 1));
- }
-
- public override void Add (string name, string value)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- if (internallyCreated && IsRestricted (name))
- throw new ArgumentException ("restricted header");
- this.AddWithoutValidate (name, value);
- }
-
- protected void AddWithoutValidate (string headerName, string headerValue)
- {
- if (!IsHeaderName (headerName))
- throw new ArgumentException ("invalid header name");
- if (headerValue == null)
- headerValue = String.Empty;
- else
- headerValue = headerValue.Trim ();
- if (!IsHeaderValue (headerValue))
- throw new ArgumentException ("invalid header value");
- base.Add (headerName, headerValue);
- }
-
- public override string [] GetValues (string header)
- {
- if (header == null)
- throw new ArgumentNullException ("header");
- string [] values = base.GetValues (header);
- if (values == null || values.Length == 0)
- return null;
- if (!IsMultiValue (header))
- return values;
- StringCollection col = new StringCollection ();
- for (int i = 0; i < values.Length; i++) {
- string [] s = values [i].Split (new char [] {','});
- for (int j = 0; j < s.Length; j++)
- s [j] = s [j].Trim ();
- col.AddRange (s);
- }
- values = new string [col.Count];
- col.CopyTo (values, 0);
- return values;
- }
-
- public static bool IsRestricted (string headerName)
- {
- int hashCode = headerName.ToLower ().GetHashCode ();
- for (int i = 0; i < restricted.Length; i++)
- if (restricted [i] == hashCode)
- return true;
- return false;
- }
-
- [MonoTODO]
- public override void OnDeserialization (object sender)
- {
- // no idea what to do here... spec doesn't say much
- throw new NotImplementedException ();
- }
-
- public override void Remove (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- if (internallyCreated && IsRestricted (name))
- throw new ArgumentException ("restricted header");
- base.Remove (name);
- }
-
- public override void Set (string name, string value)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- if (internallyCreated && IsRestricted (name))
- throw new ArgumentException ("restricted header");
- if (!IsHeaderName (name))
- throw new ArgumentException ("invalid header name");
- if (value == null)
- value = String.Empty;
- else
- value = value.Trim ();
- if (!IsHeaderValue (value))
- throw new ArgumentException ("invalid header value");
- base.Set (name, value);
- }
-
- public byte[] ToByteArray ()
- {
- return Encoding.UTF8.GetBytes(ToString ());
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder();
-
- int count = base.Count;
- for (int i = 0; i < count ; i++)
- sb.Append (GetKey (i))
- .Append (": ")
- .Append (Get (i))
- .Append ("\r\n");
-
- return sb.Append("\r\n").ToString();
- }
-
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- int count = base.Count;
- serializationInfo.AddValue ("count", count);
- for (int i = 0; i < count ; i++) {
- serializationInfo.AddValue ("k" + i, GetKey (i));
- serializationInfo.AddValue ("v" + i, Get (i));
- }
- }
-
- // Internal Methods
-
- internal void SetInternal (string name, string value)
- {
- if (value == null)
- value = String.Empty;
- else
- value = value.Trim ();
- if (!IsHeaderValue (value))
- throw new ArgumentException ("invalid header value");
- base.Set (name, value);
- }
-
- internal void RemoveInternal (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- base.Remove (name);
- }
-
- // Private Methods
-
- private static bool IsMultiValue (string headerName)
- {
- int hashCode = headerName.ToLower ().GetHashCode ();
- for (int i = 0; i < multiValue.Length; i++)
- if (multiValue [i] == hashCode)
- return true;
- return false;
- }
-
- private bool IsHeaderValue (string value)
- {
- // TEXT any 8 bit value except CTL's (0-31 and 127)
- // but including \r\n space and \t
- // after a newline at least one space or \t must follow
- // certain header fields allow comments ()
-
- int len = value.Length;
- for (int i = 0; i < len; i++) {
- char c = value [i];
- if (c == 127)
- return false;
- if (c < 0x20 && (c != '\r' && c != '\n' && c != '\t'))
- return false;
- if (c == '\n' && ++i < len) {
- c = value [i];
- if (c != ' ' && c != '\t')
- return false;
- }
- }
-
- return true;
- }
-
- private bool IsHeaderName (string name)
- {
- // token = 1*<any CHAR except CTLs or tspecials>
- // tspecials = "(" | ")" | "<" | ">" | "@"
- // | "," | ";" | ":" | "\" | <">
- // | "/" | "[" | "]" | "?" | "="
- // | "{" | "}" | SP | HT
-
- if (name == null || name.Length == 0)
- return false;
-
- int len = name.Length;
- for (int i = 0; i < len; i++) {
- char c = name [i];
- if (c < 0x20 || c >= 0x7f)
- return false;
- }
-
- return name.IndexOfAny (tspecials) == -1;
- }
-
- private static char [] tspecials =
- new char [] {'(', ')', '<', '>', '@',
- ',', ';', ':', '\\', '"',
- '/', '[', ']', '?', '=',
- '{', '}', ' ', '\t'};
-
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/WebProxy.cs b/mcs/class/System/System.Net/WebProxy.cs
deleted file mode 100644
index 05fde3d4d6d..00000000000
--- a/mcs/class/System/System.Net/WebProxy.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// System.Net.WebProxy
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-using System.Text.RegularExpressions;
-
-namespace System.Net
-{
- [Serializable]
- public class WebProxy : IWebProxy, ISerializable
- {
- private Uri address;
- private bool bypassOnLocal;
- private ArrayList bypassList;
- private ICredentials credentials;
-
- // Constructors
-
- public WebProxy ()
- : this ((Uri) null, false, null, null) {}
-
- public WebProxy (string address)
- : this (ToUri (address), false, null, null) {}
-
- public WebProxy (Uri address)
- : this (address, false, null, null) {}
-
- public WebProxy (string address, bool bypassOnLocal)
- : this (ToUri (address), bypassOnLocal, null, null) {}
-
- public WebProxy (string host, int port)
- : this (new Uri ("http://" + host + ":" + port)) {}
-
- public WebProxy (Uri address, bool bypassOnLocal)
- : this (address, bypassOnLocal, null, null) {}
-
- public WebProxy (string address, bool bypassOnLocal, string [] bypassList)
- : this (ToUri (address), bypassOnLocal, bypassList, null) {}
-
- public WebProxy (Uri address, bool bypassOnLocal, string [] bypassList)
- : this (address, bypassOnLocal, bypassList, null) {}
-
- public WebProxy (string address, bool bypassOnLocal,
- string[] bypassList, ICredentials credentials)
- : this (ToUri (address), bypassOnLocal, bypassList, null) {}
-
- public WebProxy (Uri address, bool bypassOnLocal,
- string[] bypassList, ICredentials credentials)
- {
- this.address = address;
- this.bypassOnLocal = bypassOnLocal;
- if (bypassList == null)
- bypassList = new string [] {};
- this.bypassList = new ArrayList (bypassList);
- this.credentials = credentials;
- CheckBypassList ();
- }
-
- [MonoTODO]
- protected WebProxy (SerializationInfo serializationInfo, StreamingContext streamingContext)
- {
- throw new NotImplementedException ();
- }
-
- // Properties
-
- public Uri Address {
- get { return address; }
- set { address = value; }
- }
-
- public ArrayList BypassArrayList {
- get {
- return bypassList;
- }
- }
-
- public string [] BypassList {
- get { return (string []) bypassList.ToArray (typeof (string)); }
- set {
- if (value == null)
- throw new ArgumentNullException ();
- bypassList = new ArrayList (value);
- CheckBypassList ();
- }
- }
-
- public bool BypassProxyOnLocal {
- get { return bypassOnLocal; }
- set { bypassOnLocal = value; }
- }
-
- public ICredentials Credentials {
- get { return credentials; }
- set { credentials = value; }
- }
-
- // Methods
-
- [MonoTODO]
- public static WebProxy GetDefaultProxy ()
- {
- // for Mono we should probably read in these settings
- // from the global application configuration file
-
- // for now, return the empty WebProxy to indicate
- // no proxy is used
- // return GlobalProxySelection.GetEmptyWebProxy ();
- // ??
-
- throw new NotImplementedException ();
- }
-
- public Uri GetProxy (Uri destination)
- {
- if (IsBypassed (destination))
- return destination;
-
- return address;
- }
-
- public bool IsBypassed (Uri host)
- {
- if (address == null)
- return true;
-
- if (host.IsLoopback)
- return true;
-
- if (bypassOnLocal && host.Host.IndexOf ('.') == -1)
- return true;
-
- try {
- string hostStr = host.Scheme + "://" + host.Authority;
- int i = 0;
- for (; i < bypassList.Count; i++) {
- Regex regex = new Regex ((string) bypassList [i],
- // TODO: RegexOptions.Compiled | // not implemented yet by Regex
- RegexOptions.IgnoreCase |
- RegexOptions.Singleline);
-
- if (regex.IsMatch (hostStr))
- break;
- }
-
- if (i == bypassList.Count)
- return false;
-
- // continue checking correctness of regular expressions..
- // will throw expression when an invalid one is found
- for (; i < bypassList.Count; i++)
- new Regex ((string) bypassList [i]);
-
- return true;
- } catch (ArgumentException) {
- return false;
- }
- }
-
- [MonoTODO]
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- throw new NotImplementedException ();
- }
-
- // Private Methods
-
- // this compiles the regular expressions, and will throw
- // an exception when an invalid one is found.
- private void CheckBypassList ()
- {
- for (int i = 0; i < bypassList.Count; i++)
- new Regex ((string) bypassList [i]);
- }
-
- private static Uri ToUri (string address)
- {
- if (address == null)
- return null;
-
- if (address.IndexOf (':') == -1)
- address = "http://" + address;
-
- return new Uri (address);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/WebRequest.cs b/mcs/class/System/System.Net/WebRequest.cs
deleted file mode 100644
index 0be53a781ef..00000000000
--- a/mcs/class/System/System.Net/WebRequest.cs
+++ /dev/null
@@ -1,216 +0,0 @@
-//
-// System.Net.WebRequest
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public abstract class WebRequest : MarshalByRefObject, ISerializable
- {
- private static HybridDictionary prefixes;
-
- static WebRequest () {
- prefixes = new HybridDictionary (3, true);
- RegisterPrefix ("file", new FileWebRequestCreator ());
- RegisterPrefix ("http", new HttpWebRequestCreator ());
- RegisterPrefix ("https", new HttpWebRequestCreator ());
- }
-
- internal class HttpWebRequestCreator : IWebRequestCreate
- {
- internal HttpWebRequestCreator () { }
-
- public WebRequest Create (Uri uri)
- {
- return new HttpWebRequest (uri);
- }
- }
-
- internal class FileWebRequestCreator : IWebRequestCreate
- {
- internal FileWebRequestCreator () { }
-
- public WebRequest Create (Uri uri)
- {
- return new FileWebRequest (uri);
- }
- }
-
-
- // Constructors
-
- protected WebRequest () { }
-
- protected WebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
- {
- throw new NotSupportedException ();
- }
-
- // Properties
-
- public virtual string ConnectionGroupName {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual long ContentLength {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual string ContentType {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual ICredentials Credentials {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual WebHeaderCollection Headers {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual string Method {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual bool PreAuthenticate {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual IWebProxy Proxy {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual Uri RequestUri {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual int Timeout {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- // Methods
-
- public virtual void Abort()
- {
- throw new NotSupportedException ();
- }
-
- public virtual IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
- {
- throw new NotSupportedException ();
- }
-
- public virtual IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
- {
- throw new NotSupportedException ();
- }
-
- public static WebRequest Create (string requestUriString)
- {
- if (requestUriString == null)
- throw new ArgumentNullException ("requestUriString");
- return Create (new Uri (requestUriString));
- }
-
- public static WebRequest Create (Uri requestUri)
- {
- if (requestUri == null)
- throw new ArgumentNullException ("requestUri");
- return GetCreator (requestUri.AbsoluteUri).Create (requestUri);
- }
-
- public static WebRequest CreateDefault (Uri requestUri)
- {
- if (requestUri == null)
- throw new ArgumentNullException ("requestUri");
- return GetCreator (requestUri.Scheme).Create (requestUri);
- }
-
- public virtual Stream EndGetRequestStream (IAsyncResult asyncResult)
- {
- throw new NotSupportedException ();
- }
-
- public virtual WebResponse EndGetResponse (IAsyncResult asyncResult)
- {
- throw new NotSupportedException ();
- }
-
- public virtual Stream GetRequestStream()
- {
- throw new NotSupportedException ();
- }
-
- public virtual WebResponse GetResponse()
- {
- throw new NotSupportedException ();
- }
-
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- throw new NotSupportedException ();
- }
-
- public static bool RegisterPrefix (string prefix, IWebRequestCreate creator)
- {
- if (prefix == null)
- throw new ArgumentNullException("prefix");
- if (creator == null)
- throw new ArgumentNullException("creator");
-
- lock (prefixes.SyncRoot) {
- if (prefixes.Contains (prefix))
- return false;
- prefixes.Add (prefix.ToLower (), creator);
- }
- return true;
- }
-
- private static IWebRequestCreate GetCreator (string prefix)
- {
- int longestPrefix = -1;
- IWebRequestCreate creator = null;
-
- prefix = prefix.ToLower ();
-
- IDictionaryEnumerator e = prefixes.GetEnumerator ();
- while (e.MoveNext ()) {
- string key = e.Key as string;
-
- if (key.Length <= longestPrefix)
- continue;
-
- if (!prefix.StartsWith (key))
- continue;
-
- longestPrefix = key.Length;
- creator = (IWebRequestCreate) e.Value;
- }
-
- if (creator == null)
- throw new NotSupportedException (prefix);
-
- return creator;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/WebResponse.cs b/mcs/class/System/System.Net/WebResponse.cs
deleted file mode 100644
index e3b2285e88f..00000000000
--- a/mcs/class/System/System.Net/WebResponse.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Net.WebResponse
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.Net
-{
- [Serializable]
- public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable
- {
- // Constructors
-
- protected WebResponse () { }
-
- protected WebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)
- {
- throw new NotSupportedException ();
- }
-
- // Properties
-
- public virtual long ContentLength {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual string ContentType {
- get { throw new NotSupportedException (); }
- set { throw new NotSupportedException (); }
- }
-
- public virtual WebHeaderCollection Headers {
- get { throw new NotSupportedException (); }
- }
-
- public virtual Uri ResponseUri {
- get { throw new NotSupportedException (); }
- }
-
- // Methods
-
- public virtual void Close()
- {
- throw new NotSupportedException ();
- }
-
- public virtual Stream GetResponseStream()
- {
- throw new NotSupportedException ();
- }
-
- void IDisposable.Dispose()
- {
- Close ();
- }
-
- void ISerializable.GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
- {
- throw new NotSupportedException ();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/System.Net/WebStatus.cs b/mcs/class/System/System.Net/WebStatus.cs
deleted file mode 100755
index 5ad5450a738..00000000000
--- a/mcs/class/System/System.Net/WebStatus.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// WebStatus.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:37:37 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Net {
-
-
- /// <summary>
- /// </summary>
- public enum WebStatus {
-
- /// <summary>
- /// </summary>
- Success = 0,
-
- /// <summary>
- /// </summary>
- NameResolutionFailure = 1,
-
- /// <summary>
- /// </summary>
- ConnectFailure = 2,
-
- /// <summary>
- /// </summary>
- ReceiveFailure = 3,
-
- /// <summary>
- /// </summary>
- SendFailure = 4,
-
- /// <summary>
- /// </summary>
- PipelineFailure = 5,
-
- /// <summary>
- /// </summary>
- RequestCanceled = 6,
-
- /// <summary>
- /// </summary>
- ProtocolError = 7,
-
- /// <summary>
- /// </summary>
- ConnectionClosed = 8,
-
- /// <summary>
- /// </summary>
- TrustFailure = 9,
-
- /// <summary>
- /// </summary>
- SecureChannelFailure = 10,
-
- /// <summary>
- /// </summary>
- ServerProtocolViolation = 11,
-
- /// <summary>
- /// </summary>
- KeepAliveFailure = 12,
-
- /// <summary>
- /// </summary>
- Pending = 13,
- } // WebStatus
-
-} // System.Net
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog b/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog
deleted file mode 100644
index c8684168dca..00000000000
--- a/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2002-05-12 Lawrence Pit <loz@cable.a2000.nl>
-
- * X509CertificateCollection.cs: implemented
-
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs
deleted file mode 100644
index 82546c7a295..00000000000
--- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-// System.Security.Cryptography.X509Certificates.X509CertificateCollection
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Serializable]
- public class X509CertificateCollection : CollectionBase, IEnumerable {
-
- private ArrayList list = new ArrayList ();
-
- // Constructors
-
- public X509CertificateCollection () { }
-
- public X509CertificateCollection (X509Certificate [] value)
- {
- AddRange (value);
- }
-
- public X509CertificateCollection (X509CertificateCollection value)
- {
- AddRange (value);
- }
-
- // Properties
-
- public X509Certificate this [int index] {
- get { return (X509Certificate) list [index]; }
- set { list [index] = value; }
- }
-
- // Methods
-
- public void AddRange (X509Certificate [] value)
- {
- if (value == null)
- throw new ArgumentNullException ("value");
- for (int i = 0; i < value.Length; i++)
- list.Add (value);
- }
-
- public void AddRange (X509CertificateCollection value)
- {
- if (value == null)
- throw new ArgumentNullException ("value");
- int len = value.list.Count;
- for (int i = 0; i < len; i++)
- this.list.Add (value);
- }
-
- public bool Contains (X509Certificate value)
- {
- return list.Contains (value);
- }
-
-
- public void CopyTo (X509Certificate [] array, int index)
- {
- list.CopyTo (array, index);
- }
-
- public new X509CertificateEnumerator GetEnumerator()
- {
- return new X509CertificateEnumerator (this);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return list.GetEnumerator ();
- }
-
- public override int GetHashCode()
- {
- return list.GetHashCode ();
- }
-
- public int IndexOf (X509Certificate value)
- {
- return list.IndexOf (value);
- }
-
- public void Insert (int index, X509Certificate value)
- {
- list.Insert (index, value);
- }
-
- public void Remove (X509Certificate value)
- {
- list.Remove (value);
- }
-
- // Inner Class
-
- public class X509CertificateEnumerator : IEnumerator {
- private IEnumerator enumerator;
-
- // Constructors
-
- public X509CertificateEnumerator (X509CertificateCollection mappings)
- {
- enumerator = ((IEnumerable) mappings).GetEnumerator ();
- }
-
- // Properties
-
- public X509Certificate Current {
- get { return (X509Certificate) enumerator.Current; }
- }
-
- object IEnumerator.Current {
- get { return (X509Certificate) enumerator.Current; }
- }
-
- // Methods
-
- bool IEnumerator.MoveNext ()
- {
- return enumerator.MoveNext ();
- }
-
- void IEnumerator.Reset ()
- {
- enumerator.Reset ();
- }
-
- public bool MoveNext ()
- {
- return enumerator.MoveNext ();
- }
-
- public void Reset ()
- {
- enumerator.Reset ();
- }
- }
- }
-}
-
diff --git a/mcs/class/System/System.Text.RegularExpressions/ChangeLog b/mcs/class/System/System.Text.RegularExpressions/ChangeLog
deleted file mode 100644
index 00ddda201b3..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/ChangeLog
+++ /dev/null
@@ -1,34 +0,0 @@
-2002-05-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * regex.cs: Fixed bug in split.
-
-2002-05-08 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * interpreter.cs: Moved to an array-based stack representation
- for faster captures.
-
- * match.cs, collections.cs: Decoupled capture representation from
- interpreter internals.
-
- * cache.cs: Changed Key type from struct to class for speed.
-
-2002-04-06 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * cache.cs: Object methods should be overridden with "override".
-
-2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs
- added for completeness.
-
- * regex.cs, match.cs, collections.cs: Serializable attribute.
-
-2002-04-04 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * regex.cs: Added static Matches and IsMatch methods.
-
-2002-04-03 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * ChangeLog: Added changelog.
-
- * cache.cs: Fixed bug in MRUList.Evict.
diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs b/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs
deleted file mode 100644
index dfed1ad2479..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: RegexRunner.cs
-//
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- public abstract class RegexRunner {
- // constructor
-
- protected internal RegexRunner () {
- throw new NotImplementedException ("RegexRunner is not supported by Mono.");
- }
-
- // protected abstract
-
- protected abstract bool FindFirstChar ();
-
- protected abstract void Go ();
-
- protected abstract void InitTrackCount ();
-
- // protected methods
-
- protected void Capture (int capnum, int start, int end) {
- }
-
- protected static bool CharInSet (char ch, string set, string category) {
- return false;
- }
-
- protected void Crawl (int i) {
- }
-
- protected int CrawlPos () {
- return 0;
- }
-
- protected void DoubleCrawl () {
- }
-
- protected void DoubleStack () {
- }
-
- protected void DoubleTrack () {
- }
-
- protected void EnsureStorage () {
- }
-
- protected bool IsBoundary (int index, int startpos, int endpos) {
- return false;
- }
-
- protected bool IsECMABoundary (int index, int startpos, int endpos) {
- return false;
- }
-
- protected bool IsMatched (int cap) {
- return false;
- }
-
- protected int MatchIndex (int cap) {
- return 0;
- }
-
- protected int MatchLength (int cap) {
- return 0;
- }
-
- protected int PopCrawl () {
- return 0;
- }
-
- protected void TransferCapture (int capnum, int uncapnum, int start, int end) {
- }
-
- protected void Uncapture () {
- }
-
- // internal
-
- protected internal Match Scan (Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick) {
- return null;
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs b/mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs
deleted file mode 100644
index 895ff165607..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: RegexRunnerFactory.cs
-//
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- public abstract class RegexRunnerFactory {
- protected RegexRunnerFactory () {
- throw new NotImplementedException ("RegexRunnerFactory is not supported by Mono.");
- }
-
- protected internal abstract RegexRunner CreateInstance ();
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/arch.cs b/mcs/class/System/System.Text.RegularExpressions/arch.cs
deleted file mode 100644
index 274d9add1a9..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/arch.cs
+++ /dev/null
@@ -1,333 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: arch.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- enum OpCode : ushort {
- False = 0, // always fails
- True, // always succeeds
-
- // matching
-
- Position, // zero-width position assertion
- String, // match string literal
- Reference, // back reference
-
- // character matching
-
- Character, // match character exactly
- Category, // match character from category
- Range, // match character from range
- Set, // match character from set
- In, // match character from group of tests
-
- // capturing
-
- Open, // open group
- Close, // close group
- Balance, // balance groups
-
- // control flow
-
- IfDefined, // conditional on capture
- Sub, // non-backtracking subexpression
- Test, // non-backtracking lookahead/behind
- Branch, // alternative expression
- Jump, // unconditional goto
- Repeat, // new repeat context
- Until, // repeat subexpression within context
- FastRepeat, // repeat simple subexpression
- Anchor, // anchoring expression
-
- // miscellaneous
-
- Info // pattern information
- }
-
- [Flags]
- enum OpFlags : ushort {
- None = 0x000,
- Negate = 0x100, // succeed on mismatch
- IgnoreCase = 0x200, // case insensitive matching
- RightToLeft = 0x400, // right-to-left matching
- Lazy = 0x800 // minimizing repeat
- }
-
- enum Position : ushort {
- Any, // anywhere
- Start, // start of string \A
- StartOfString, // start of string \A
- StartOfLine, // start of line ^
- StartOfScan, // start of scan \G
- End, // end or before newline at end \Z
- EndOfString, // end of string \z
- EndOfLine, // end of line $
- Boundary, // word boundary \b
- NonBoundary // not word boundary \B
- };
-
- // see category.cs for Category enum
-
- interface IMachine {
- Match Scan (Regex regex, string text, int start, int end);
- }
-
- interface IMachineFactory {
- IMachine NewInstance ();
- }
-
- // Anchor SKIP OFFSET
- //
- // Flags: [RightToLeft] ??
- // SKIP: relative address of tail expression
- // OFFSET: offset of anchor from start of pattern
- //
- // Usage:
- //
- // Anchor :1 OFFSET
- // <expr>
- // True
- // 1: <tail>
- //
- // Notes:
- //
- // In practice, the anchoring expression is only going to be
- // Position (StartOfString, StartOfLine, StartOfScan) or String.
- // This is because the optimizer looks for position anchors at the
- // start of the expression, and if that fails it looks for the
- // longest substring. If an expression has neither a position
- // anchor or a longest substring anchor, then the anchoring expression
- // is left empty. Since an empty expression will anchor at any
- // position in any string, the entire input string will be scanned.
-
- // String LEN STR...
- //
- // Flags: [RightToLeft, IgnoreCase]
- // LEN: length of string
- // STR: string characters
-
- // Branch SKIP
- //
- // SKIP: relative address of next branch
- //
- // Branch :1
- // <alt expr 1>
- // Jump :4
- // 1: Branch :2
- // <alt expr 2>
- // Jump :4
- // 2: Branch :3
- // <alt expr 3>
- // Jump :4
- // 3: False
- // 4: <tail>
-
- // Repeat SKIP MIN MAX
- //
- // Flags: [Lazy]
- // SKIP: relative address of Until instruction
- // MIN: minimum iterations
- // MAX: maximum iterations (0xffff is infinity)
- //
- // Repeat :1 MIN MAX
- // <expr>
- // Until
- // 1: <tail>
-
- // FastRepeat SKIP MIN MAX
- //
- // Flags: [Lazy]
- // SKIP: relative address of tail expression
- // MIN: minimum iterations
- // MAX: maximum iterations (0xffff is infinity)
- //
- // FastRepeat :1 MIN MAX
- // <expr>
- // True
- // 1: <tail>
- //
- // Notes:
- //
- // The subexpression of a FastRepeat construct must not contain any
- // complex operators. These include: Open, Close, Balance, Repeat,
- // FastRepeat, Sub, Test. In addition, the subexpression must have
- // been determined to have a fixed width.
-
- // Sub SKIP
- //
- // SKIP: relative address of tail expression
- //
- // Sub :1
- // <expr>
- // 1: <tail>
- //
- // Notes:
- //
- // The Sub operator invokes an independent subexpression. This means
- // that the subexpression will match only once and so will not
- // participate in any backtracking.
-
- // Test TSKIP FSKIP
- //
- // TSKIP: relative address of true expression
- // FSKIP: relative address of false expression
- //
- // Usage: (?(?=test)true|false)
- //
- // Test :1 :2
- // <test expr>
- // 1: <true expr>
- // Jump
- // 2: <false epxr>
- // <tail>
- //
- // Usage: (?(?=test)true)
- //
- // Test :1 :2
- // <test expr>
- // 1: <true expr>
- // 2: <tail>
- //
- // Usage: (?=test)
- //
- // Test :1 :2
- // <test expr>
- // 1: <true expr>
- // Jump 3:
- // 2: False
- // 3: <tail>
- //
- // Notes:
- //
- // For negative lookaheads, just swap the values of TSKIP and
- // FSKIP. For lookbehinds, the test expression must be compiled
- // in reverse. The test expression is always executed as an
- // independent subexpression, so its behaviour is non-backtracking
- // (like a Sub clause.)
-
- // IfDefined SKIP GID
- //
- // SKIP: relative address of else expression
- // GID: number of group to check
- //
- // Usage: (?(gid)true)
- //
- // IfDefined :1
- // <true expr>
- // 1: <tail>
- //
- // Usage: (?(gid)true|false)
- //
- // IfDefined :1
- // <true expr>
- // Jump :2
- // 1: <false expr>
- // 2: <tail>
-
- // Jump SKIP
- //
- // SKIP: relative address of target expression
- //
- // Jump :1
- // ...
- // :1 <target expr>
-
- // Character CHAR
- //
- // Flags: [Negate, IgnoreCase, RightToLeft]
- // CHAR: exact character to match
-
- // Category CAT
- //
- // Flags: [Negate, RightToLeft]
- // CAT: category to match (see Category enum)
-
- // Range LO HI
- //
- // Flags: [Negate, IgnoreCase, RightToLeft]
- // LO: lowest character in range
- // HI: higest character in range
-
- // Set LO LEN SET...
- //
- // Flags: [Negate, IgnoreCase, RightToLeft]
- // LO: lowest character in set
- // LEN: number of words in set
- // SET: bit array representing characters in set
- //
- // Notes:
- //
- // Each word in the set represents 16 characters, so the first word
- // defines membership for characters LO to LO + 15, the second for
- // LO + 16 to LO + 31, and so on up to LO + (LEN * 16 - 1). It is
- // up to the compiler to provide a compact representation for sparse
- // unicode sets. The simple way is to use Set 0 4096. Other methods
- // involve paritioning the set and placing the components into an
- // In block.
-
- // In SKIP
- //
- // SKIP: relative address of tail expression
- //
- // Usage: [expr]
- //
- // In :1
- // <expr>
- // True
- // :1 <tail>
- //
- // Usage: [^expr]
- //
- // In :1
- // <expr>
- // False
- // :1 <tail>
- //
- // Notes:
- //
- // The In instruction consumes a single character, using the flags
- // of the first instruction in the subexpression to determine its
- // IgnoreCase and RightToLeft properties. The subexpression is then
- // applied to the single character as a disjunction. If any instruction
- // in the subexpression succeeds, the entire In construct succeeds
- // and matching continues with the tail.
-
- // Position POS
- //
- // POS: position to match (see Position enum)
-
- // Open GID
- //
- // GID: number of group to open
-
- // Close GID
- //
- // GID: number of group to close
-
- // Balance GID BAL
- //
- // GID: number of capturing group (0 if none)
- // BAL: number of group to undefine
-
- // Info GROUPS MIN MAX
- //
- // GROUPS: number of capturing groups
- // MIN: minimum width of pattern
- // MAX: maximum width of pattern (0xffff means undefined)
-
- // False
-
- // True
-
- // Reference GID
- //
- // Flags: [IgnoreCase, RightToLeft]
- // GID: number of group to reference
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/cache.cs b/mcs/class/System/System.Text.RegularExpressions/cache.cs
deleted file mode 100644
index b77278fee80..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/cache.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: cache.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
-
- class FactoryCache {
- public FactoryCache (int capacity) {
- this.capacity = capacity;
- this.factories = new Hashtable (capacity);
- this.mru_list = new MRUList ();
- }
-
- public void Add (string pattern, RegexOptions options, IMachineFactory factory) {
- lock (this) {
- Key k = new Key (pattern, options);
-
- while (factories.Count >= capacity) {
- object victim = mru_list.Evict ();
- if (victim != null)
- factories.Remove ((Key)victim);
- }
-
- factories[k] = factory;
- mru_list.Use (k);
- }
- }
-
- public IMachineFactory Lookup (string pattern, RegexOptions options) {
- lock (this) {
- Key k = new Key (pattern, options);
- if (factories.Contains (k)) {
- mru_list.Use (k);
- return (IMachineFactory)factories[k];
- }
- }
-
- return null;
- }
-
- private int capacity;
- private Hashtable factories;
- private MRUList mru_list;
-
- class Key {
- public string pattern;
- public RegexOptions options;
-
- public Key (string pattern, RegexOptions options) {
- this.pattern = pattern;
- this.options = options;
- }
-
- public override int GetHashCode () {
- return pattern.GetHashCode () ^ (int)options;
- }
-
- public override bool Equals (object o) {
- if (o == null || !(o is Key))
- return false;
-
- Key k = (Key)o;
- return options == k.options && pattern.Equals (k.pattern);
- }
-
- public override string ToString () {
- return "('" + pattern + "', [" + options + "])";
- }
- }
- }
-
- class MRUList {
- public MRUList () {
- head = tail = null;
- }
-
- public void Use (object o) {
- Node node;
-
- if (head == null) {
- node = new Node (o);
- head = tail = node;
- return;
- }
-
- node = head;
- while (node != null && !o.Equals (node.value))
- node = node.previous;
-
- if (node == null)
- node = new Node (o);
- else {
- if (node == head)
- return;
-
- if (node == tail)
- tail = node.next;
- else
- node.previous.next = node.next;
-
- node.next.previous = node.previous;
- }
-
- head.next = node;
- node.previous = head;
- node.next = null;
- head = node;
- }
-
- public object Evict () {
- if (tail == null)
- return null;
-
- object o = tail.value;
- tail = tail.next;
-
- if (tail == null)
- head = null;
- else
- tail.previous = null;
-
- return o;
- }
-
- private Node head, tail;
-
- private class Node {
- public object value;
- public Node previous, next;
-
- public Node (object value) {
- this.value = value;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/category.cs b/mcs/class/System/System.Text.RegularExpressions/category.cs
deleted file mode 100644
index 763712cb581..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/category.cs
+++ /dev/null
@@ -1,637 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: category.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Globalization;
-
-namespace System.Text.RegularExpressions {
-
- enum Category : ushort {
- None,
-
- // canonical classes
-
- Any, // any character except newline .
- AnySingleline, // any character . (s option)
- Word, // any word character \w
- Digit, // any digit character \d
- WhiteSpace, // any whitespace character \s
-
- // ECMAScript classes
-
-
- EcmaAny,
- EcmaAnySingleline,
- EcmaWord, // [a-zA-Z_0-9]
- EcmaDigit, // [0-9]
- EcmaWhiteSpace, // [ \f\n\r\t\v]
-
- // unicode categories
-
- UnicodeL, // Letter
- UnicodeM, // Mark
- UnicodeN, // Number
- UnicodeZ, // Separator
- UnicodeP, // Punctuation
- UnicodeS, // Symbol
- UnicodeC, // Other
-
- UnicodeLu, // UppercaseLetter
- UnicodeLl, // LowercaseLetter
- UnicodeLt, // TitlecaseLetter
- UnicodeLm, // ModifierLetter
- UnicodeLo, // OtherLetter
- UnicodeMn, // NonspacingMark
- UnicodeMe, // EnclosingMark
- UnicodeMc, // SpacingMark
- UnicodeNd, // DecimalNumber
- UnicodeNl, // LetterNumber
- UnicodeNo, // OtherNumber
- UnicodeZs, // SpaceSeparator
- UnicodeZl, // LineSeparator
- UnicodeZp, // ParagraphSeparator
- UnicodePd, // DashPunctuation
- UnicodePs, // OpenPunctuation
- UnicodePi, // InitialPunctuation
- UnicodePe, // ClosePunctuation
- UnicodePf, // FinalPunctuation
- UnicodePc, // ConnectorPunctuation
- UnicodePo, // OtherPunctuation
- UnicodeSm, // MathSymbol
- UnicodeSc, // CurrencySymbol
- UnicodeSk, // ModifierSymbol
- UnicodeSo, // OtherSymbol
- UnicodeCc, // Control
- UnicodeCf, // Format
- UnicodeCo, // PrivateUse
- UnicodeCs, // Surrogate
- UnicodeCn, // Unassigned
-
- // unicode block ranges
-
- // notes: the categories marked with a star are valid unicode block ranges,
- // but don't seem to be accepted by the MS parser using the /p{...} format.
- // any ideas?
-
- UnicodeBasicLatin,
- UnicodeLatin1Supplement, // *
- UnicodeLatinExtendedA, // *
- UnicodeLatinExtendedB, // *
- UnicodeIPAExtensions,
- UnicodeSpacingModifierLetters,
- UnicodeCombiningDiacriticalMarks,
- UnicodeGreek,
- UnicodeCyrillic,
- UnicodeArmenian,
- UnicodeHebrew,
- UnicodeArabic,
- UnicodeSyriac,
- UnicodeThaana,
- UnicodeDevanagari,
- UnicodeBengali,
- UnicodeGurmukhi,
- UnicodeGujarati,
- UnicodeOriya,
- UnicodeTamil,
- UnicodeTelugu,
- UnicodeKannada,
- UnicodeMalayalam,
- UnicodeSinhala,
- UnicodeThai,
- UnicodeLao,
- UnicodeTibetan,
- UnicodeMyanmar,
- UnicodeGeorgian,
- UnicodeHangulJamo,
- UnicodeEthiopic,
- UnicodeCherokee,
- UnicodeUnifiedCanadianAboriginalSyllabics,
- UnicodeOgham,
- UnicodeRunic,
- UnicodeKhmer,
- UnicodeMongolian,
- UnicodeLatinExtendedAdditional,
- UnicodeGreekExtended,
- UnicodeGeneralPunctuation,
- UnicodeSuperscriptsandSubscripts,
- UnicodeCurrencySymbols,
- UnicodeCombiningMarksforSymbols,
- UnicodeLetterlikeSymbols,
- UnicodeNumberForms,
- UnicodeArrows,
- UnicodeMathematicalOperators,
- UnicodeMiscellaneousTechnical,
- UnicodeControlPictures,
- UnicodeOpticalCharacterRecognition,
- UnicodeEnclosedAlphanumerics,
- UnicodeBoxDrawing,
- UnicodeBlockElements,
- UnicodeGeometricShapes,
- UnicodeMiscellaneousSymbols,
- UnicodeDingbats,
- UnicodeBraillePatterns,
- UnicodeCJKRadicalsSupplement,
- UnicodeKangxiRadicals,
- UnicodeIdeographicDescriptionCharacters,
- UnicodeCJKSymbolsandPunctuation,
- UnicodeHiragana,
- UnicodeKatakana,
- UnicodeBopomofo,
- UnicodeHangulCompatibilityJamo,
- UnicodeKanbun,
- UnicodeBopomofoExtended,
- UnicodeEnclosedCJKLettersandMonths,
- UnicodeCJKCompatibility,
- UnicodeCJKUnifiedIdeographsExtensionA,
- UnicodeCJKUnifiedIdeographs,
- UnicodeYiSyllables,
- UnicodeYiRadicals,
- UnicodeHangulSyllables,
- UnicodeHighSurrogates,
- UnicodeHighPrivateUseSurrogates,
- UnicodeLowSurrogates,
- UnicodePrivateUse,
- UnicodeCJKCompatibilityIdeographs,
- UnicodeAlphabeticPresentationForms,
- UnicodeArabicPresentationFormsA, // *
- UnicodeCombiningHalfMarks,
- UnicodeCJKCompatibilityForms,
- UnicodeSmallFormVariants,
- UnicodeArabicPresentationFormsB, // *
- UnicodeSpecials,
- UnicodeHalfwidthandFullwidthForms,
-
- UnicodeOldItalic,
- UnicodeGothic,
- UnicodeDeseret,
- UnicodeByzantineMusicalSymbols,
- UnicodeMusicalSymbols,
- UnicodeMathematicalAlphanumericSymbols,
- UnicodeCJKUnifiedIdeographsExtensionB,
- UnicodeCJKCompatibilityIdeographsSupplement,
- UnicodeTags
- }
-
- class CategoryUtils {
- public static Category CategoryFromName (string name) {
- try {
- if (name.Substring (0, 2).Equals ("Is")) // remove prefix from block range
- name = name.Substring (2);
-
- return (Category)Enum.Parse (typeof (Category), "Unicode" + name);
- }
- catch (ArgumentException) {
- return Category.None;
- }
- }
-
- public static bool IsCategory (Category cat, char c) {
- switch (cat) {
- case Category.None:
- return false;
-
- case Category.Any:
- return c != '\n';
-
- case Category.AnySingleline:
- return true;
-
- case Category.Word:
- return
- Char.IsLetterOrDigit (c) ||
- IsCategory (UnicodeCategory.ConnectorPunctuation, c);
-
- case Category.Digit:
- return Char.IsDigit (c);
-
- case Category.WhiteSpace:
- return Char.IsWhiteSpace (c);
-
- // ECMA categories
-
- case Category.EcmaAny:
- return c != '\n';
-
- case Category.EcmaAnySingleline:
- return true;
-
- case Category.EcmaWord:
- return
- 'a' <= c && c <= 'z' ||
- 'A' <= c && c <= 'Z' ||
- '0' <= c && c <= '9' ||
- '_' == c;
-
- case Category.EcmaDigit:
- return
- '0' <= c && c <= 9;
-
- case Category.EcmaWhiteSpace:
- return
- c == ' ' ||
- c == '\f' ||
- c == '\n' ||
- c == '\r' ||
- c == '\t' ||
- c == '\v';
-
- // Unicode categories...
-
- // letter
-
- case Category.UnicodeLu: return IsCategory (UnicodeCategory.UppercaseLetter, c);
- case Category.UnicodeLl: return IsCategory (UnicodeCategory.LowercaseLetter, c);
- case Category.UnicodeLt: return IsCategory (UnicodeCategory.TitlecaseLetter, c);
- case Category.UnicodeLm: return IsCategory (UnicodeCategory.ModifierLetter, c);
- case Category.UnicodeLo: return IsCategory (UnicodeCategory.OtherLetter, c);
-
- // mark
-
- case Category.UnicodeMn: return IsCategory (UnicodeCategory.NonSpacingMark, c);
- case Category.UnicodeMe: return IsCategory (UnicodeCategory.EnclosingMark, c);
- case Category.UnicodeMc: return IsCategory (UnicodeCategory.SpacingCombiningMark, c);
- case Category.UnicodeNd: return IsCategory (UnicodeCategory.DecimalDigitNumber, c);
-
- // number
-
- case Category.UnicodeNl: return IsCategory (UnicodeCategory.LetterNumber, c);
- case Category.UnicodeNo: return IsCategory (UnicodeCategory.OtherNumber, c);
-
- // separator
-
- case Category.UnicodeZs: return IsCategory (UnicodeCategory.SpaceSeparator, c);
- case Category.UnicodeZl: return IsCategory (UnicodeCategory.LineSeparator, c);
- case Category.UnicodeZp: return IsCategory (UnicodeCategory.ParagraphSeparator, c);
-
- // punctuation
-
- case Category.UnicodePd: return IsCategory (UnicodeCategory.DashPunctuation, c);
- case Category.UnicodePs: return IsCategory (UnicodeCategory.OpenPunctuation, c);
- case Category.UnicodePi: return IsCategory (UnicodeCategory.InitialQuotePunctuation, c);
- case Category.UnicodePe: return IsCategory (UnicodeCategory.ClosePunctuation, c);
- case Category.UnicodePf: return IsCategory (UnicodeCategory.FinalQuotePunctuation, c);
- case Category.UnicodePc: return IsCategory (UnicodeCategory.ConnectorPunctuation, c);
- case Category.UnicodePo: return IsCategory (UnicodeCategory.OtherPunctuation, c);
-
- // symbol
-
- case Category.UnicodeSm: return IsCategory (UnicodeCategory.MathSymbol, c);
- case Category.UnicodeSc: return IsCategory (UnicodeCategory.CurrencySymbol, c);
- case Category.UnicodeSk: return IsCategory (UnicodeCategory.ModifierSymbol, c);
- case Category.UnicodeSo: return IsCategory (UnicodeCategory.OtherSymbol, c);
-
- // other
-
- case Category.UnicodeCc: return IsCategory (UnicodeCategory.Control, c);
- case Category.UnicodeCf: return IsCategory (UnicodeCategory.Format, c);
- case Category.UnicodeCo: return IsCategory (UnicodeCategory.PrivateUse, c);
- case Category.UnicodeCs: return IsCategory (UnicodeCategory.Surrogate, c);
- case Category.UnicodeCn: return IsCategory (UnicodeCategory.OtherNotAssigned, c);
-
- case Category.UnicodeL: // letter
- return
- IsCategory (UnicodeCategory.UppercaseLetter, c) ||
- IsCategory (UnicodeCategory.LowercaseLetter, c) ||
- IsCategory (UnicodeCategory.TitlecaseLetter, c) ||
- IsCategory (UnicodeCategory.ModifierLetter, c) ||
- IsCategory (UnicodeCategory.OtherLetter, c);
-
- case Category.UnicodeM: // mark
- return
- IsCategory (UnicodeCategory.NonSpacingMark, c) ||
- IsCategory (UnicodeCategory.EnclosingMark, c) ||
- IsCategory (UnicodeCategory.SpacingCombiningMark, c);
-
- case Category.UnicodeN: // number
- return
- IsCategory (UnicodeCategory.DecimalDigitNumber, c) ||
- IsCategory (UnicodeCategory.LetterNumber, c) ||
- IsCategory (UnicodeCategory.OtherNumber, c);
-
- case Category.UnicodeZ: // separator
- return
- IsCategory (UnicodeCategory.SpaceSeparator, c) ||
- IsCategory (UnicodeCategory.LineSeparator, c) ||
- IsCategory (UnicodeCategory.ParagraphSeparator, c);
-
- case Category.UnicodeP: // punctuation
- return
- IsCategory (UnicodeCategory.DashPunctuation, c) ||
- IsCategory (UnicodeCategory.OpenPunctuation, c) ||
- IsCategory (UnicodeCategory.InitialQuotePunctuation, c) ||
- IsCategory (UnicodeCategory.ClosePunctuation, c) ||
- IsCategory (UnicodeCategory.FinalQuotePunctuation, c) ||
- IsCategory (UnicodeCategory.ConnectorPunctuation, c) ||
- IsCategory (UnicodeCategory.OtherPunctuation, c);
-
- case Category.UnicodeS: // symbol
- return
- IsCategory (UnicodeCategory.MathSymbol, c) ||
- IsCategory (UnicodeCategory.CurrencySymbol, c) ||
- IsCategory (UnicodeCategory.ModifierSymbol, c) ||
- IsCategory (UnicodeCategory.OtherSymbol, c);
-
- case Category.UnicodeC: // other
- return
- IsCategory (UnicodeCategory.Control, c) ||
- IsCategory (UnicodeCategory.Format, c) ||
- IsCategory (UnicodeCategory.PrivateUse, c) ||
- IsCategory (UnicodeCategory.Surrogate, c) ||
- IsCategory (UnicodeCategory.OtherNotAssigned, c);
-
- // Unicode block ranges...
-
- case Category.UnicodeBasicLatin:
- return '\u0000' <= c && c <= '\u007F';
-
- case Category.UnicodeLatin1Supplement:
- return '\u0080' <= c && c <= '\u00FF';
-
- case Category.UnicodeLatinExtendedA:
- return '\u0100' <= c && c <= '\u017F';
-
- case Category.UnicodeLatinExtendedB:
- return '\u0180' <= c && c <= '\u024F';
-
- case Category.UnicodeIPAExtensions:
- return '\u0250' <= c && c <= '\u02AF';
-
- case Category.UnicodeSpacingModifierLetters:
- return '\u02B0' <= c && c <= '\u02FF';
-
- case Category.UnicodeCombiningDiacriticalMarks:
- return '\u0300' <= c && c <= '\u036F';
-
- case Category.UnicodeGreek:
- return '\u0370' <= c && c <= '\u03FF';
-
- case Category.UnicodeCyrillic:
- return '\u0400' <= c && c <= '\u04FF';
-
- case Category.UnicodeArmenian:
- return '\u0530' <= c && c <= '\u058F';
-
- case Category.UnicodeHebrew:
- return '\u0590' <= c && c <= '\u05FF';
-
- case Category.UnicodeArabic:
- return '\u0600' <= c && c <= '\u06FF';
-
- case Category.UnicodeSyriac:
- return '\u0700' <= c && c <= '\u074F';
-
- case Category.UnicodeThaana:
- return '\u0780' <= c && c <= '\u07BF';
-
- case Category.UnicodeDevanagari:
- return '\u0900' <= c && c <= '\u097F';
-
- case Category.UnicodeBengali:
- return '\u0980' <= c && c <= '\u09FF';
-
- case Category.UnicodeGurmukhi:
- return '\u0A00' <= c && c <= '\u0A7F';
-
- case Category.UnicodeGujarati:
- return '\u0A80' <= c && c <= '\u0AFF';
-
- case Category.UnicodeOriya:
- return '\u0B00' <= c && c <= '\u0B7F';
-
- case Category.UnicodeTamil:
- return '\u0B80' <= c && c <= '\u0BFF';
-
- case Category.UnicodeTelugu:
- return '\u0C00' <= c && c <= '\u0C7F';
-
- case Category.UnicodeKannada:
- return '\u0C80' <= c && c <= '\u0CFF';
-
- case Category.UnicodeMalayalam:
- return '\u0D00' <= c && c <= '\u0D7F';
-
- case Category.UnicodeSinhala:
- return '\u0D80' <= c && c <= '\u0DFF';
-
- case Category.UnicodeThai:
- return '\u0E00' <= c && c <= '\u0E7F';
-
- case Category.UnicodeLao:
- return '\u0E80' <= c && c <= '\u0EFF';
-
- case Category.UnicodeTibetan:
- return '\u0F00' <= c && c <= '\u0FFF';
-
- case Category.UnicodeMyanmar:
- return '\u1000' <= c && c <= '\u109F';
-
- case Category.UnicodeGeorgian:
- return '\u10A0' <= c && c <= '\u10FF';
-
- case Category.UnicodeHangulJamo:
- return '\u1100' <= c && c <= '\u11FF';
-
- case Category.UnicodeEthiopic:
- return '\u1200' <= c && c <= '\u137F';
-
- case Category.UnicodeCherokee:
- return '\u13A0' <= c && c <= '\u13FF';
-
- case Category.UnicodeUnifiedCanadianAboriginalSyllabics:
- return '\u1400' <= c && c <= '\u167F';
-
- case Category.UnicodeOgham:
- return '\u1680' <= c && c <= '\u169F';
-
- case Category.UnicodeRunic:
- return '\u16A0' <= c && c <= '\u16FF';
-
- case Category.UnicodeKhmer:
- return '\u1780' <= c && c <= '\u17FF';
-
- case Category.UnicodeMongolian:
- return '\u1800' <= c && c <= '\u18AF';
-
- case Category.UnicodeLatinExtendedAdditional:
- return '\u1E00' <= c && c <= '\u1EFF';
-
- case Category.UnicodeGreekExtended:
- return '\u1F00' <= c && c <= '\u1FFF';
-
- case Category.UnicodeGeneralPunctuation:
- return '\u2000' <= c && c <= '\u206F';
-
- case Category.UnicodeSuperscriptsandSubscripts:
- return '\u2070' <= c && c <= '\u209F';
-
- case Category.UnicodeCurrencySymbols:
- return '\u20A0' <= c && c <= '\u20CF';
-
- case Category.UnicodeCombiningMarksforSymbols:
- return '\u20D0' <= c && c <= '\u20FF';
-
- case Category.UnicodeLetterlikeSymbols:
- return '\u2100' <= c && c <= '\u214F';
-
- case Category.UnicodeNumberForms:
- return '\u2150' <= c && c <= '\u218F';
-
- case Category.UnicodeArrows:
- return '\u2190' <= c && c <= '\u21FF';
-
- case Category.UnicodeMathematicalOperators:
- return '\u2200' <= c && c <= '\u22FF';
-
- case Category.UnicodeMiscellaneousTechnical:
- return '\u2300' <= c && c <= '\u23FF';
-
- case Category.UnicodeControlPictures:
- return '\u2400' <= c && c <= '\u243F';
-
- case Category.UnicodeOpticalCharacterRecognition:
- return '\u2440' <= c && c <= '\u245F';
-
- case Category.UnicodeEnclosedAlphanumerics:
- return '\u2460' <= c && c <= '\u24FF';
-
- case Category.UnicodeBoxDrawing:
- return '\u2500' <= c && c <= '\u257F';
-
- case Category.UnicodeBlockElements:
- return '\u2580' <= c && c <= '\u259F';
-
- case Category.UnicodeGeometricShapes:
- return '\u25A0' <= c && c <= '\u25FF';
-
- case Category.UnicodeMiscellaneousSymbols:
- return '\u2600' <= c && c <= '\u26FF';
-
- case Category.UnicodeDingbats:
- return '\u2700' <= c && c <= '\u27BF';
-
- case Category.UnicodeBraillePatterns:
- return '\u2800' <= c && c <= '\u28FF';
-
- case Category.UnicodeCJKRadicalsSupplement:
- return '\u2E80' <= c && c <= '\u2EFF';
-
- case Category.UnicodeKangxiRadicals:
- return '\u2F00' <= c && c <= '\u2FDF';
-
- case Category.UnicodeIdeographicDescriptionCharacters:
- return '\u2FF0' <= c && c <= '\u2FFF';
-
- case Category.UnicodeCJKSymbolsandPunctuation:
- return '\u3000' <= c && c <= '\u303F';
-
- case Category.UnicodeHiragana:
- return '\u3040' <= c && c <= '\u309F';
-
- case Category.UnicodeKatakana:
- return '\u30A0' <= c && c <= '\u30FF';
-
- case Category.UnicodeBopomofo:
- return '\u3100' <= c && c <= '\u312F';
-
- case Category.UnicodeHangulCompatibilityJamo:
- return '\u3130' <= c && c <= '\u318F';
-
- case Category.UnicodeKanbun:
- return '\u3190' <= c && c <= '\u319F';
-
- case Category.UnicodeBopomofoExtended:
- return '\u31A0' <= c && c <= '\u31BF';
-
- case Category.UnicodeEnclosedCJKLettersandMonths:
- return '\u3200' <= c && c <= '\u32FF';
-
- case Category.UnicodeCJKCompatibility:
- return '\u3300' <= c && c <= '\u33FF';
-
- case Category.UnicodeCJKUnifiedIdeographsExtensionA:
- return '\u3400' <= c && c <= '\u4DB5';
-
- case Category.UnicodeCJKUnifiedIdeographs:
- return '\u4E00' <= c && c <= '\u9FFF';
-
- case Category.UnicodeYiSyllables:
- return '\uA000' <= c && c <= '\uA48F';
-
- case Category.UnicodeYiRadicals:
- return '\uA490' <= c && c <= '\uA4CF';
-
- case Category.UnicodeHangulSyllables:
- return '\uAC00' <= c && c <= '\uD7A3';
-
- case Category.UnicodeHighSurrogates:
- return '\uD800' <= c && c <= '\uDB7F';
-
- case Category.UnicodeHighPrivateUseSurrogates:
- return '\uDB80' <= c && c <= '\uDBFF';
-
- case Category.UnicodeLowSurrogates:
- return '\uDC00' <= c && c <= '\uDFFF';
-
- case Category.UnicodePrivateUse:
- return '\uE000' <= c && c <= '\uF8FF';
-
- case Category.UnicodeCJKCompatibilityIdeographs:
- return '\uF900' <= c && c <= '\uFAFF';
-
- case Category.UnicodeAlphabeticPresentationForms:
- return '\uFB00' <= c && c <= '\uFB4F';
-
- case Category.UnicodeArabicPresentationFormsA:
- return '\uFB50' <= c && c <= '\uFDFF';
-
- case Category.UnicodeCombiningHalfMarks:
- return '\uFE20' <= c && c <= '\uFE2F';
-
- case Category.UnicodeCJKCompatibilityForms:
- return '\uFE30' <= c && c <= '\uFE4F';
-
- case Category.UnicodeSmallFormVariants:
- return '\uFE50' <= c && c <= '\uFE6F';
-
- case Category.UnicodeArabicPresentationFormsB:
- return '\uFE70' <= c && c <= '\uFEFE';
-
- case Category.UnicodeHalfwidthandFullwidthForms:
- return '\uFF00' <= c && c <= '\uFFEF';
-
- case Category.UnicodeSpecials:
- return
- '\uFEFF' <= c && c <= '\uFEFF' ||
- '\uFFF0' <= c && c <= '\uFFFD';
-
- // these block ranges begin above 0x10000
-
- case Category.UnicodeOldItalic:
- case Category.UnicodeGothic:
- case Category.UnicodeDeseret:
- case Category.UnicodeByzantineMusicalSymbols:
- case Category.UnicodeMusicalSymbols:
- case Category.UnicodeMathematicalAlphanumericSymbols:
- case Category.UnicodeCJKUnifiedIdeographsExtensionB:
- case Category.UnicodeCJKCompatibilityIdeographsSupplement:
- case Category.UnicodeTags:
- return false;
-
- default:
- return false;
- }
- }
-
- private static bool IsCategory (UnicodeCategory uc, char c) {
- if (Char.GetUnicodeCategory (c) == uc)
- return true;
-
- return false;
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/collections.cs b/mcs/class/System/System.Text.RegularExpressions/collections.cs
deleted file mode 100644
index a56d27effa2..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/collections.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: collections.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
- public abstract class RegexCollectionBase : ICollection, IEnumerable {
- public int Count {
- get { return list.Count; }
- }
-
- public bool IsReadOnly {
- get { return true; } // FIXME
- }
-
- public bool IsSynchronized {
- get { return false; } // FIXME
- }
-
- public object SyncRoot {
- get { return list; } // FIXME
- }
-
- public void CopyTo (Array array, int index) {
- foreach (Object o in list) {
- if (index > array.Length)
- break;
-
- array.SetValue (o, index ++);
- }
- }
-
- public IEnumerator GetEnumerator () {
- return new Enumerator (list);
- }
-
- // internal methods
-
- internal RegexCollectionBase () {
- list = new ArrayList ();
- }
-
- internal void Add (Object o) {
- list.Add (o);
- }
-
- internal void Reverse () {
- list.Reverse ();
- }
-
- // IEnumerator implementation
-
- private class Enumerator : IEnumerator {
- public Enumerator (IList list) {
- this.list = list;
- Reset ();
- }
-
- public object Current {
- get {
- if (ptr >= list.Count)
- throw new InvalidOperationException ();
-
- return list[ptr];
- }
- }
-
- public bool MoveNext () {
- if (ptr > list.Count)
- throw new InvalidOperationException ();
-
- return ++ ptr < list.Count;
- }
-
- public void Reset () {
- ptr = -1;
- }
-
- private IList list;
- private int ptr;
- }
-
- // protected fields
-
- protected ArrayList list;
- }
-
- [Serializable]
- public class CaptureCollection : RegexCollectionBase, ICollection, IEnumerable {
- public Capture this[int i] {
- get { return (Capture)list[i]; }
- }
-
- internal CaptureCollection () {
- }
- }
-
- [Serializable]
- public class GroupCollection : RegexCollectionBase, ICollection, IEnumerable {
- public Group this[int i] {
- get { return (Group)list[i]; }
- }
-
- internal GroupCollection () {
- }
- }
-
- [Serializable]
- public class MatchCollection : RegexCollectionBase, ICollection, IEnumerable {
- public virtual Match this[int i] {
- get { return (Match)list[i]; }
- }
-
- internal MatchCollection () {
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/compiler.cs b/mcs/class/System/System.Text.RegularExpressions/compiler.cs
deleted file mode 100644
index 82fb8cfbb73..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/compiler.cs
+++ /dev/null
@@ -1,368 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: compiler.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
- abstract class LinkRef {
- // empty
- }
-
- interface ICompiler {
- void Reset ();
- IMachineFactory GetMachineFactory ();
-
- // instruction emission
-
- void EmitFalse ();
- void EmitTrue ();
-
- // character matching
-
- void EmitCharacter (char c, bool negate, bool ignore, bool reverse);
- void EmitCategory (Category cat, bool negate, bool reverse);
- void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse);
- void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse);
-
- // other operators
-
- void EmitString (string str, bool ignore, bool reverse);
- void EmitPosition (Position pos);
- void EmitOpen (int gid);
- void EmitClose (int gid);
- void EmitBalance (int gid, int balance);
- void EmitReference (int gid, bool ignore, bool reverse);
-
- // constructs
-
- void EmitIfDefined (int gid, LinkRef tail);
- void EmitSub (LinkRef tail);
- void EmitTest (LinkRef yes, LinkRef tail);
- void EmitBranch (LinkRef next);
- void EmitJump (LinkRef target);
- void EmitRepeat (int min, int max, bool lazy, LinkRef until);
- void EmitUntil (LinkRef repeat);
- void EmitIn (LinkRef tail);
- void EmitInfo (int count, int min, int max);
- void EmitFastRepeat (int min, int max, bool lazy, LinkRef tail);
- void EmitAnchor (int offset, LinkRef tail);
-
- LinkRef NewLink ();
- void ResolveLink (LinkRef link);
- }
-
- class InterpreterFactory : IMachineFactory {
- public InterpreterFactory (ushort[] pattern) {
- this.pattern = pattern;
- }
-
- public IMachine NewInstance () {
- return new Interpreter (pattern);
- }
-
- private ushort[] pattern;
- }
-
- class PatternCompiler : ICompiler {
- public static ushort EncodeOp (OpCode op, OpFlags flags) {
- return (ushort)((int)op | ((int)flags & 0xff00));
- }
-
- public static void DecodeOp (ushort word, out OpCode op, out OpFlags flags) {
- op = (OpCode)(word & 0x00ff);
- flags = (OpFlags)(word & 0xff00);
- }
-
- public PatternCompiler () {
- pgm = new ArrayList ();
- }
-
- // ICompiler implementation
-
- public void Reset () {
- pgm.Clear ();
- }
-
- public IMachineFactory GetMachineFactory () {
- ushort[] image = new ushort[pgm.Count];
- pgm.CopyTo (image);
-
- return new InterpreterFactory (image);
- }
-
- public void EmitFalse () {
- Emit (OpCode.False);
- }
-
- public void EmitTrue () {
- Emit (OpCode.True);
- }
-
- public void EmitCharacter (char c, bool negate, bool ignore, bool reverse) {
- Emit (OpCode.Character, MakeFlags (negate, ignore, reverse, false));
-
- if (ignore)
- c = Char.ToLower (c);
-
- Emit ((ushort)c);
- }
-
- public void EmitCategory (Category cat, bool negate, bool reverse) {
- Emit (OpCode.Category, MakeFlags (negate, false, reverse, false));
- Emit ((ushort)cat);
- }
-
- public void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse) {
- Emit (OpCode.Range, MakeFlags (negate, ignore, reverse, false));
- Emit ((ushort)lo);
- Emit ((ushort)hi);
- }
-
- public void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse) {
- Emit (OpCode.Set, MakeFlags (negate, ignore, reverse, false));
- Emit ((ushort)lo);
-
- int len = (set.Length + 0xf) >> 4;
- Emit ((ushort)len);
-
- int b = 0;
- while (len -- != 0) {
- ushort word = 0;
- for (int i = 0; i < 16; ++ i) {
- if (b >= set.Length)
- break;
-
- if (set[b ++])
- word |= (ushort)(1 << i);
- }
-
- Emit (word);
- }
- }
-
- public void EmitString (string str, bool ignore, bool reverse) {
- Emit (OpCode.String, MakeFlags (false, ignore, reverse, false));
- int len = str.Length;
- Emit ((ushort)len);
-
- if (ignore)
- str = str.ToLower ();
-
- for (int i = 0; i < len; ++ i)
- Emit ((ushort)str[i]);
- }
-
- public void EmitPosition (Position pos) {
- Emit (OpCode.Position, 0);
- Emit ((ushort)pos);
- }
-
- public void EmitOpen (int gid) {
- Emit (OpCode.Open);
- Emit ((ushort)gid);
- }
-
- public void EmitClose (int gid) {
- Emit (OpCode.Close);
- Emit ((ushort)gid);
- }
-
- public void EmitBalance (int gid, int balance) {
- Emit (OpCode.Balance);
- Emit ((ushort)gid);
- Emit ((ushort)balance);
- }
-
- public void EmitReference (int gid, bool ignore, bool reverse) {
- Emit (OpCode.Reference, MakeFlags (false, ignore, reverse, false));
- Emit ((ushort)gid);
- }
-
- public void EmitIfDefined (int gid, LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.IfDefined);
- EmitLink (tail);
- Emit ((ushort)gid);
- }
-
- public void EmitSub (LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.Sub);
- EmitLink (tail);
- }
-
- public void EmitTest (LinkRef yes, LinkRef tail) {
- BeginLink (yes);
- BeginLink (tail);
- Emit (OpCode.Test);
- EmitLink (yes);
- EmitLink (tail);
- }
-
- public void EmitBranch (LinkRef next) {
- BeginLink (next);
- Emit (OpCode.Branch, 0);
- EmitLink (next);
- }
-
- public void EmitJump (LinkRef target) {
- BeginLink (target);
- Emit (OpCode.Jump, 0);
- EmitLink (target);
- }
-
- public void EmitRepeat (int min, int max, bool lazy, LinkRef until) {
- BeginLink (until);
- Emit (OpCode.Repeat, MakeFlags (false, false, false, lazy));
- EmitLink (until);
- Emit ((ushort)min);
- Emit ((ushort)max);
- }
-
- public void EmitUntil (LinkRef repeat) {
- ResolveLink (repeat);
- Emit (OpCode.Until);
- }
-
- public void EmitFastRepeat (int min, int max, bool lazy, LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.FastRepeat, MakeFlags (false, false, false, lazy));
- EmitLink (tail);
- Emit ((ushort)min);
- Emit ((ushort)max);
- }
-
- public void EmitIn (LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.In);
- EmitLink (tail);
- }
-
- public void EmitAnchor (int offset, LinkRef tail) {
- BeginLink (tail);
- Emit (OpCode.Anchor);
- EmitLink (tail);
- Emit ((ushort)offset);
- }
-
- public void EmitInfo (int count, int min, int max) {
- Emit (OpCode.Info);
- Emit ((ushort)count);
- Emit ((ushort)min);
- Emit ((ushort)max);
- }
-
- public LinkRef NewLink () {
- return new PatternLinkStack ();
- }
-
- public void ResolveLink (LinkRef lref) {
- PatternLinkStack stack = (PatternLinkStack)lref;
-
- while (stack.Pop ())
- pgm[stack.OffsetAddress] = (ushort)stack.GetOffset (CurrentAddress);
- }
-
- // private members
-
- private static OpFlags MakeFlags (bool negate, bool ignore, bool reverse, bool lazy) {
- OpFlags flags = 0;
- if (negate) flags |= OpFlags.Negate;
- if (ignore) flags |= OpFlags.IgnoreCase;
- if (reverse) flags |= OpFlags.RightToLeft;
- if (lazy) flags |= OpFlags.Lazy;
-
- return flags;
- }
-
- private void Emit (OpCode op) {
- Emit (op, (OpFlags)0);
- }
-
- private void Emit (OpCode op, OpFlags flags) {
- Emit (EncodeOp (op, flags));
- }
-
- private void Emit (ushort word) {
- pgm.Add (word);
- }
-
- private int CurrentAddress {
- get { return pgm.Count; }
- }
-
- private void BeginLink (LinkRef lref) {
- PatternLinkStack stack = (PatternLinkStack)lref;
- stack.BaseAddress = CurrentAddress;
- }
-
- private void EmitLink (LinkRef lref) {
- PatternLinkStack stack = (PatternLinkStack)lref;
- stack.OffsetAddress = CurrentAddress;
- Emit ((ushort)0); // placeholder
- stack.Push ();
- }
-
- private class PatternLinkStack : LinkStack {
- public PatternLinkStack () {
- }
-
- public int BaseAddress {
- set { link.base_addr = value; }
- }
-
- public int OffsetAddress {
- get { return link.offset_addr; }
- set { link.offset_addr = value; }
- }
-
- public int GetOffset (int target_addr) {
- return target_addr - link.base_addr;
- }
-
- // LinkStack implementation
-
- protected override object GetCurrent () { return link; }
- protected override void SetCurrent (object l) { link = (Link)l; }
-
- private struct Link {
- public int base_addr;
- public int offset_addr;
- }
-
- Link link;
- }
-
- private ArrayList pgm;
- }
-
- abstract class LinkStack : LinkRef {
- public LinkStack () {
- stack = new Stack ();
- }
-
- public void Push () {
- stack.Push (GetCurrent ());
- }
-
- public bool Pop () {
- if (stack.Count > 0) {
- SetCurrent (stack.Pop ());
- return true;
- }
-
- return false;
- }
-
- protected abstract object GetCurrent ();
- protected abstract void SetCurrent (object l);
-
- private Stack stack;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/debug.cs b/mcs/class/System/System.Text.RegularExpressions/debug.cs
deleted file mode 100644
index fdc3ab87bc3..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/debug.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: debug.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
-
- class Disassembler {
- public static void DisassemblePattern (ushort[] image) {
- DisassembleBlock (image, 0, 0);
- }
-
- public static void DisassembleBlock (ushort[] image, int pc, int depth) {
- OpCode op;
- OpFlags flags;
-
- for (;;) {
- if (pc >= image.Length)
- return;
-
- PatternCompiler.DecodeOp (image[pc], out op, out flags);
- Console.Write (FormatAddress (pc) + ": "); // address
- Console.Write (new string (' ', depth * 2)); // indent
- Console.Write (DisassembleOp (image, pc)); // instruction
- Console.WriteLine ();
-
- int skip;
- switch (op) {
- case OpCode.False: case OpCode.True: case OpCode.Until:
- skip = 1;
- break;
-
- case OpCode.Character: case OpCode.Category: case OpCode.Position:
- case OpCode.Open: case OpCode.Close: case OpCode.Reference:
- case OpCode.Sub: case OpCode.Branch: case OpCode.Jump: case OpCode.In:
- skip = 2;
- break;
-
- case OpCode.Balance: case OpCode.IfDefined: case OpCode.Range:
- case OpCode.Test: case OpCode.Anchor:
- skip = 3;
- break;
-
- case OpCode.Repeat: case OpCode.FastRepeat: case OpCode.Info:
- skip = 4;
- break;
-
- case OpCode.String: skip = image[pc + 1] + 2; break;
- case OpCode.Set: skip = image[pc + 2] + 3; break;
-
- default:
- skip = 1;
- break;
- }
-
- pc += skip;
- }
- }
-
- public static string DisassembleOp (ushort[] image, int pc) {
- OpCode op;
- OpFlags flags;
-
- PatternCompiler.DecodeOp (image[pc], out op, out flags);
- string str = op.ToString ();
- if (flags != 0)
- str += "[" + flags.ToString ("f") + "]";
-
- switch (op) {
- case OpCode.False: case OpCode.True: case OpCode.Until:
- default:
- break;
-
- case OpCode.Info:
- str += " " + image[pc + 1];
- str += " (" + image[pc + 2] + ", " + image[pc + 3] + ")";
- break;
-
- case OpCode.Character:
- str += " '" + FormatChar ((char)image[pc + 1]) + "'";
- break;
-
- case OpCode.Category:
- str += " /" + (Category)image[pc + 1];
- break;
-
- case OpCode.Range:
- str += " '" + FormatChar ((char)image[pc + 1]) + "', ";
- str += " '" + FormatChar ((char)image[pc + 2]) + "'";
- break;
-
- case OpCode.Set:
- str += " " + FormatSet (image, pc + 1);
- break;
-
- case OpCode.String:
- str += " '" + ReadString (image, pc + 1) + "'";
- break;
-
- case OpCode.Position:
- str += " /" + (Position)image[pc + 1];
- break;
-
- case OpCode.Open: case OpCode.Close: case OpCode.Reference:
- str += " " + image[pc + 1];
- break;
-
- case OpCode.Balance:
- str += " " + image[pc + 1] + " " + image[pc + 2];
- break;
-
- case OpCode.IfDefined: case OpCode.Anchor:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- str += " " + image[pc + 2];
- break;
-
- case OpCode.Sub: case OpCode.Branch: case OpCode.Jump:
- case OpCode.In:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- break;
-
- case OpCode.Test:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- str += ", :" + FormatAddress (pc + image[pc + 2]);
- break;
-
- case OpCode.Repeat: case OpCode.FastRepeat:
- str += " :" + FormatAddress (pc + image[pc + 1]);
- str += " (" + image[pc + 2] + ", ";
- if (image[pc + 3] == 0xffff)
- str += "Inf";
- else
- str += image[pc + 3];
- str += ")";
- break;
-
- }
-
- return str;
- }
-
- // private static members
-
- private static string ReadString (ushort[] image, int pc) {
- int len = image[pc];
- char[] chars = new char[len];
-
- for (int i = 0; i < len; ++ i)
- chars[i] = (char)image[pc + i + 1];
-
- return new string (chars);
- }
-
- private static string FormatAddress (int pc) {
- return pc.ToString ("x4");
- }
-
- private static string FormatSet (ushort[] image, int pc) {
- int lo = image[pc ++];
- int hi = (image[pc ++] << 4) - 1;
-
- string str = "[";
-
- bool hot = false;
- char a = (char)0, b;
- for (int i = 0; i <= hi; ++ i) {
- bool m = (image[pc + (i >> 4)] & (1 << (i & 0xf))) != 0;
-
- if (m & !hot) { // start of range
- a = (char)(lo + i);
- hot = true;
- }
- else if (hot & (!m || i == hi)) { // end of range
- b = (char)(lo + i - 1);
-
- str += FormatChar (a);
- if (b != a)
- str += "-" + FormatChar (b);
-
- hot = false;
- }
- }
-
- str += "]";
- return str;
- }
-
- private static string FormatChar (char c) {
- if (c == '-' || c == ']')
- return "\\" + c;
-
- if (Char.IsLetterOrDigit (c) || Char.IsSymbol (c))
- return c.ToString ();
-
- if (Char.IsControl (c)) {
- return "^" + (char)('@' + c);
- }
-
- return "\\u" + ((int)c).ToString ("x4");
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs b/mcs/class/System/System.Text.RegularExpressions/interpreter.cs
deleted file mode 100644
index 1be1a36b2ee..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs
+++ /dev/null
@@ -1,953 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: interpreter.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace System.Text.RegularExpressions {
-
- class Interpreter : IMachine {
- public Interpreter (ushort[] program) {
- this.program = program;
- this.qs = null;
-
- // process info block
-
- Debug.Assert ((OpCode)program[0] == OpCode.Info, "Regex", "Cant' find info block");
-
- this.group_count = program[1] + 1;
- this.match_min = program[2];
- this.match_max = program[3];
-
- // setup
-
- this.program_start = 4;
- this.groups = new int [group_count];
- }
-
- // IMachine implementation
-
- public Match Scan (Regex regex, string text, int start, int end) {
- this.text = text;
- this.text_end = end;
- this.scan_ptr = start;
-
- if (Eval (Mode.Match, ref scan_ptr, program_start))
- return GenerateMatch (regex);
-
- return Match.Empty;
- }
-
- // private methods
-
- private void Reset () {
- ResetGroups ();
- fast = repeat = null;
- }
-
- private bool Eval (Mode mode, ref int ref_ptr, int pc) {
- int ptr = ref_ptr;
- Begin:
- for (;;) {
- ushort word = program[pc];
- OpCode op = (OpCode)(word & 0x00ff);
- OpFlags flags = (OpFlags)(word & 0xff00);
-
- switch (op) {
- case OpCode.Anchor: {
- int skip = program[pc + 1];
-
- int anch_offset = program[pc + 2];
- int anch_ptr = ptr + anch_offset;
- int anch_end = text_end - match_min + anch_offset; // maximum anchor position
-
- // the general case for an anchoring expression is at the bottom, however we
- // do some checks for the common cases before to save processing time. the current
- // optimizer only outputs three types of anchoring expressions: fixed position,
- // fixed substring, and no anchor.
-
- OpCode anch_op = (OpCode)(program[pc + 3] & 0x00ff);
- if (anch_op == OpCode.Position && skip == 6) { // position anchor
- // Anchor
- // Position
- // True
-
- switch ((Position)program[pc + 4]) {
- case Position.StartOfString:
- if (anch_ptr == 0) {
- ptr = 0;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
- break;
-
- case Position.StartOfLine:
- if (anch_ptr == 0) {
- ptr = 0;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
-
- ++ anch_ptr;
- }
-
- while (anch_ptr <= anch_end) {
- if (text[anch_ptr - 1] == '\n') {
- ptr = anch_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
-
- ++ anch_ptr;
- }
- break;
-
- case Position.StartOfScan:
- if (anch_ptr == scan_ptr) {
- ptr = scan_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
- break;
-
- default:
- // FIXME
- break;
- }
- }
- else if (qs != null ||
- (anch_op == OpCode.String && skip == 6 + program[pc + 4])) { // substring anchor
- // Anchor
- // String
- // True
-
- if (qs == null) {
- bool ignore = ((OpFlags)program[pc + 3] & OpFlags.IgnoreCase) != 0;
- string substring = GetString (pc + 3);
-
- qs = new QuickSearch (substring, ignore);
- }
-
- while (anch_ptr <= anch_end) {
- anch_ptr = qs.Search (text, anch_ptr, anch_end);
- if (anch_ptr < 0)
- break;
-
- ptr = anch_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
-
- ++ anch_ptr;
- }
- }
- else if (anch_op == OpCode.True) { // no anchor
- // Anchor
- // True
-
- while (anch_ptr <= anch_end) {
- ptr = anch_ptr;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
-
- ++ anch_ptr;
- }
- }
- else { // general case
- // Anchor
- // <expr>
- // True
-
- while (anch_ptr <= anch_end) {
- ptr = anch_ptr;
- if (Eval (Mode.Match, ref ptr, pc + 3)) {
- // anchor expression passed: try real expression at the correct offset
-
- ptr = anch_ptr - anch_offset;
- if (TryMatch (ref ptr, pc + skip))
- goto Pass;
- }
-
- ++ anch_ptr;
- }
- }
-
- goto Fail;
- }
-
- case OpCode.False: {
- goto Fail;
- }
-
- case OpCode.True: {
- goto Pass;
- }
-
- case OpCode.Position: {
- if (!IsPosition ((Position)program[pc + 1], ptr))
- goto Fail;
- pc += 2;
- break;
- }
-
- case OpCode.String: {
- bool reverse = (flags & OpFlags.RightToLeft) != 0;
- bool ignore = (flags & OpFlags.IgnoreCase) != 0;
- int len = program[pc + 1];
-
- if (reverse) {
- ptr -= len;
- if (ptr < 0)
- goto Fail;
- }
- else if (ptr + len > text_end)
- goto Fail;
-
- pc += 2;
- for (int i = 0; i < len; ++ i) {
- char c = text[ptr + i];
- if (ignore)
- c = Char.ToLower (c);
-
- if (c != (char)program[pc ++])
- goto Fail;
- }
-
- if (!reverse)
- ptr += len;
- break;
- }
-
- case OpCode.Reference: {
- bool reverse = (flags & OpFlags.RightToLeft) != 0;
- bool ignore = (flags & OpFlags.IgnoreCase) != 0;
- int m = GetLastDefined (program [pc + 1]);
- if (m < 0)
- goto Fail;
-
- int str = marks [m].Index;
- int len = marks [m].Length;
-
- if (reverse) {
- ptr -= len;
- if (ptr < 0)
- goto Fail;
- }
- else if (ptr + len > text_end)
- goto Fail;
-
- pc += 2;
- for (int i = 0; i < len; ++ i) {
- if (ignore) {
- if (Char.ToLower (text[ptr + i]) != Char.ToLower (text[str + i]))
- goto Fail;
- }
- else {
- if (text[ptr + i] != text[str + i])
- goto Fail;
- }
- }
-
- if (!reverse)
- ptr += len;
- break;
- }
-
- case OpCode.Character: case OpCode.Category:
- case OpCode.Range: case OpCode.Set: {
- if (!EvalChar (mode, ref ptr, ref pc, false))
- goto Fail;
- break;
- }
-
- case OpCode.In: {
- int target = pc + program[pc + 1];
- pc += 2;
- if (!EvalChar (mode, ref ptr, ref pc, true))
- goto Fail;
-
- pc = target;
- break;
- }
-
- case OpCode.Open: {
- Open (program[pc + 1], ptr);
- pc += 2;
- break;
- }
-
- case OpCode.Close: {
- Close (program[pc + 1], ptr);
- pc += 2;
- break;
- }
-
- case OpCode.Balance: {
- Balance (program[pc + 1], program[pc + 2], ptr);
- break;
- }
-
- case OpCode.IfDefined: {
- int m = GetLastDefined (program [pc + 2]);
- if (m < 0)
- pc += program[pc + 1];
- else
- pc += 3;
- break;
- }
-
- case OpCode.Sub: {
- if (!Eval (Mode.Match, ref ptr, pc + 2))
- goto Fail;
-
- pc += program[pc + 1];
- break;
- }
-
- case OpCode.Test: {
- int cp = Checkpoint ();
- int test_ptr = ptr;
- if (Eval (Mode.Match, ref test_ptr, pc + 3))
- pc += program[pc + 1];
- else {
- Backtrack (cp);
- pc += program[pc + 2];
- }
- break;
- }
-
- case OpCode.Branch: {
- OpCode branch_op;
- do {
- int cp = Checkpoint ();
- if (Eval (Mode.Match, ref ptr, pc + 2))
- goto Pass;
-
- Backtrack (cp);
-
- pc += program[pc + 1];
- branch_op = (OpCode)(program[pc] & 0xff);
- } while (branch_op != OpCode.False);
-
- goto Fail;
- }
-
- case OpCode.Jump: {
- pc += program[pc + 1];
- break;
- }
-
- case OpCode.Repeat: {
- this.repeat = new RepeatContext (
- this.repeat, // previous context
- program[pc + 2], // minimum
- program[pc + 3], // maximum
- (flags & OpFlags.Lazy) != 0, // lazy
- pc + 4 // subexpression
- );
-
- if (Eval (Mode.Match, ref ptr, pc + program[pc + 1]))
- goto Pass;
- else {
- this.repeat = this.repeat.Previous;
- goto Fail;
- }
- }
-
- case OpCode.Until: {
- RepeatContext current = this.repeat;
- int start = current.Start;
-
- if (!current.IsMinimum) {
- ++ current.Count;
- current.Start = ptr;
- if (Eval (Mode.Match, ref ptr, repeat.Expression))
- goto Pass;
-
- current.Start = start;
- -- current.Count;
- goto Fail;
- }
-
- if (ptr == current.Start) {
- // degenerate match ... match tail or fail
-
- this.repeat = current.Previous;
- if (Eval (Mode.Match, ref ptr, pc + 1))
- goto Pass;
-
- goto Fail;
- }
-
- if (current.IsLazy) {
- // match tail first ...
-
- this.repeat = current.Previous;
- int cp = Checkpoint ();
- if (Eval (Mode.Match, ref ptr, pc + 1))
- goto Pass;
-
- Backtrack (cp);
-
- // ... then match more
-
- this.repeat = current;
- if (!current.IsMaximum) {
- ++ current.Count;
- current.Start = ptr;
- if (Eval (Mode.Match, ref ptr, current.Expression))
- goto Pass;
-
- current.Start = start;
- -- current.Count;
- goto Fail;
- }
-
- return false;
- }
- else {
- // match more first ...
-
- if (!current.IsMaximum) {
- int cp = Checkpoint ();
- ++ current.Count;
- current.Start = ptr;
- if (Eval (Mode.Match, ref ptr, current.Expression))
- goto Pass;
-
- current.Start = start;
- -- current.Count;
- Backtrack (cp);
- }
-
- // ... then match tail
-
- this.repeat = current.Previous;
- if (Eval (Mode.Match, ref ptr, pc + 1))
- goto Pass;
-
- this.repeat = current;
- goto Fail;
- }
- }
-
- case OpCode.FastRepeat: {
- this.fast = new RepeatContext (
- fast,
- program[pc + 2], // minimum
- program[pc + 3], // maximum
- (flags & OpFlags.Lazy) != 0, // lazy
- pc + 4 // subexpression
- );
- fast.Start = ptr;
-
- int cp = Checkpoint ();
-
- pc += program[pc + 1]; // tail expression
- ushort tail_word = program[pc];
-
- int c1, c2; // first character of tail operator
- int coff; // 0 or -1 depending on direction
-
- OpCode tail_op = (OpCode)(tail_word & 0xff);
- if (tail_op == OpCode.Character || tail_op == OpCode.String) {
- OpFlags tail_flags = (OpFlags)(tail_word & 0xff00);
-
- if (tail_op == OpCode.String)
- c1 = program[pc + 2]; // first char of string
- else
- c1 = program[pc + 1]; // character
-
- if ((tail_flags & OpFlags.IgnoreCase) != 0)
- c2 = Char.ToUpper ((char)c1); // ignore case
- else
- c2 = c1;
-
- if ((tail_flags & OpFlags.RightToLeft) != 0)
- coff = -1; // reverse
- else
- coff = 0;
- }
- else {
- c1 = c2 = -1;
- coff = 0;
- }
-
- if (fast.IsLazy) {
- if (!fast.IsMinimum && !Eval (Mode.Count, ref ptr, fast.Expression)) {
- //Console.WriteLine ("lazy fast: failed mininum.");
- fast = fast.Previous;
- goto Fail;
- }
-
- while (true) {
- int p = ptr + coff;
- if ((c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) &&
- Eval (Mode.Match, ref ptr, pc))
- break;
-
- if (fast.IsMaximum) {
- //Console.WriteLine ("lazy fast: failed with maximum.");
- fast = fast.Previous;
- goto Fail;
- }
-
- Backtrack (cp);
- if (!Eval (Mode.Count, ref ptr, fast.Expression)) {
- //Console.WriteLine ("lazy fast: no more.");
- fast = fast.Previous;
- goto Fail;
- }
- }
- fast = fast.Previous;
- goto Pass;
- }
- else {
- if (!Eval (Mode.Count, ref ptr, fast.Expression)) {
- fast = fast.Previous;
- goto Fail;
- }
-
- int width;
- if (fast.Count > 0)
- width = (ptr - fast.Start) / fast.Count;
- else
- width = 0;
-
- while (true) {
- int p = ptr + coff;
- if ((c1 < 0 || (p >= 0 && p < text_end && (c1 == text[p] || c2 == text[p]))) &&
- Eval (Mode.Match, ref ptr, pc))
- break;
-
- -- fast.Count;
- if (!fast.IsMinimum) {
- fast = fast.Previous;
- goto Fail;
- }
-
- ptr -= width;
- Backtrack (cp);
- }
- fast = fast.Previous;
- goto Pass;
- }
- }
-
- case OpCode.Info: {
- Debug.Assert (false, "Regex", "Info block found in pattern");
- goto Fail;
- }
- }
- }
- Pass:
- ref_ptr = ptr;
-
- switch (mode) {
- case Mode.Match:
- return true;
-
- case Mode.Count: {
- ++ fast.Count;
- if (fast.IsMaximum || (fast.IsLazy && fast.IsMinimum))
- return true;
-
- pc = fast.Expression;
- goto Begin;
- }
- }
-
- Fail:
- switch (mode) {
- case Mode.Match:
- return false;
-
- case Mode.Count: {
- if (!fast.IsLazy && fast.IsMinimum)
- return true;
-
- ref_ptr = fast.Start;
- return false;
- }
- }
-
- return false;
- }
-
- private bool EvalChar (Mode mode, ref int ptr, ref int pc, bool multi) {
- bool consumed = false;
- char c = '\0';
- bool negate;
- bool ignore;
- do {
- ushort word = program[pc];
- OpCode op = (OpCode)(word & 0x00ff);
- OpFlags flags = (OpFlags)(word & 0xff00);
-
- ++ pc;
-
- ignore = (flags & OpFlags.IgnoreCase) != 0;
-
- // consume character: the direction of an In construct is
- // determined by the direction of its first op
-
- if (!consumed) {
- if ((flags & OpFlags.RightToLeft) != 0) {
- if (ptr <= 0)
- return false;
-
- c = text[-- ptr];
- }
- else {
- if (ptr >= text_end)
- return false;
-
- c = text[ptr ++];
- }
-
- if (ignore)
- c = Char.ToLower (c);
-
- consumed = true;
- }
-
- // negate flag
-
- negate = (flags & OpFlags.Negate) != 0;
-
- // execute op
-
- switch (op) {
- case OpCode.True:
- return true;
-
- case OpCode.False:
- return false;
-
- case OpCode.Character: {
- if (c == (char)program[pc ++])
- return !negate;
- break;
- }
-
- case OpCode.Category: {
- if (CategoryUtils.IsCategory ((Category)program[pc ++], c))
- return !negate;
-
- break;
- }
-
- case OpCode.Range: {
- int lo = (char)program[pc ++];
- int hi = (char)program[pc ++];
- if (lo <= c && c <= hi)
- return !negate;
- break;
- }
-
- case OpCode.Set: {
- int lo = (char)program[pc ++];
- int len = (char)program[pc ++];
- int bits = pc;
- pc += len;
-
- int i = (int)c - lo;
- if (i < 0 || i >= len << 4)
- break;
-
- if ((program[bits + (i >> 4)] & (1 << (i & 0xf))) != 0)
- return !negate;
- break;
- }
- }
- } while (multi);
-
- return negate;
- }
-
- private bool TryMatch (ref int ref_ptr, int pc) {
- Reset ();
-
- int ptr = ref_ptr;
- marks [groups [0]].Start = ptr;
- if (Eval (Mode.Match, ref ptr, pc)) {
- marks [groups [0]].End = ptr;
- ref_ptr = ptr;
- return true;
- }
-
- return false;
- }
-
- private bool IsPosition (Position pos, int ptr) {
- switch (pos) {
- case Position.Start: case Position.StartOfString:
- return ptr == 0;
-
- case Position.StartOfLine:
- return ptr == 0 || text[ptr - 1] == '\n';
-
- case Position.StartOfScan:
- return ptr == scan_ptr;
-
- case Position.End:
- return ptr == text_end ||
- (ptr == text_end - 1 && text[ptr] == '\n');
-
- case Position.EndOfLine:
- return ptr == text_end || text[ptr] == '\n';
-
- case Position.EndOfString:
- return ptr == text_end;
-
- case Position.Boundary:
- if (text_end == 0)
- return false;
-
- if (ptr == 0)
- return IsWordChar (text[ptr]);
- else if (ptr == text_end)
- return IsWordChar (text[ptr - 1]);
- else
- return IsWordChar (text[ptr]) != IsWordChar (text[ptr - 1]);
-
- case Position.NonBoundary:
- if (text_end == 0)
- return false;
-
- if (ptr == 0)
- return !IsWordChar (text[ptr]);
- else if (ptr == text_end)
- return !IsWordChar (text[ptr - 1]);
- else
- return IsWordChar (text[ptr]) == IsWordChar (text[ptr - 1]);
-
- default:
- return false;
- }
- }
-
- private bool IsWordChar (char c) {
- return CategoryUtils.IsCategory (Category.Word, c);
- }
-
- private string GetString (int pc) {
- int len = program[pc + 1];
- int str = pc + 2;
-
- char[] cs = new char[len];
- for (int i = 0; i < len; ++ i)
- cs[i] = (char)program[str ++];
-
- return new string (cs);
- }
-
- // capture management
-
- private void Open (int gid, int ptr) {
- int m = groups [gid];
- if (m < mark_start || marks [m].IsDefined) {
- m = CreateMark (m);
- groups [gid] = m;
- }
-
- marks [m].Start = ptr;
- }
-
- private void Close (int gid, int ptr) {
- marks [groups [gid]].End = ptr;
- }
-
- private void Balance (int gid, int balance_gid, int ptr) {
- int b = groups [balance_gid];
- Debug.Assert (marks [b].IsDefined, "Regex", "Balancing group not closed");
-
- if (gid > 0) {
- Open (gid, marks [b].Index + marks [b].Length);
- Close (gid, ptr);
- }
-
- groups [balance_gid] = marks [b].Previous;
- }
-
- private int Checkpoint () {
- mark_start = mark_end;
- return mark_start;
- }
-
- private void Backtrack (int cp) {
- Debug.Assert (cp > mark_start, "Regex", "Attempt to backtrack forwards");
-
- for (int i = 0; i < groups.Length; ++ i) {
- int m = groups [i];
- while (cp <= m)
- m = marks [m].Previous;
-
- groups [i] = m;
- }
- }
-
- private void ResetGroups () {
- int n = groups.Length;
- if (marks == null)
- marks = new Mark [n * 10];
-
- for (int i = 0; i < n; ++ i) {
- groups [i] = i;
-
- marks [i].Start = -1;
- marks [i].End = -1;
- marks [i].Previous = -1;
- }
-
- mark_start = 0;
- mark_end = n;
- }
-
- private int GetLastDefined (int gid) {
- int m = groups [gid];
- while (m >= 0 && !marks [m].IsDefined)
- m = marks [m].Previous;
-
- return m;
- }
-
- private int CreateMark (int previous) {
- if (mark_end == marks.Length) {
- Mark [] dest = new Mark [marks.Length * 2];
- marks.CopyTo (dest, 0);
- marks = dest;
- }
-
- int m = mark_end ++;
- marks [m].Start = marks [m].End = -1;
- marks [m].Previous = previous;
-
- return m;
- }
-
- private Match GenerateMatch (Regex regex) {
- int[][] grps = new int[groups.Length][];
- ArrayList caps = new ArrayList ();
-
- for (int gid = 0; gid < groups.Length; ++ gid) {
- caps.Clear ();
- for (int m = groups[gid]; m >= 0; m = marks[m].Previous) {
- if (!marks[m].IsDefined)
- continue;
-
- caps.Add (marks[m].Index);
- caps.Add (marks[m].Length);
- }
-
- grps[gid] = (int[])caps.ToArray (typeof (int));
- }
-
- return new Match (regex, this, text, text_end, grps);
- }
-
- // interpreter attributes
-
- private ushort[] program; // regex program
- private int program_start; // first instruction after info block
- private string text; // input text
- private int text_end; // end of input text (last character + 1)
- private int group_count; // number of capturing groups
- private int match_min, match_max; // match width information
- private QuickSearch qs; // fast substring matcher
-
- // match state
-
- private int scan_ptr; // start of scan
-
- private RepeatContext repeat; // current repeat context
- private RepeatContext fast; // fast repeat context
-
- private Mark[] marks = null; // mark stack
- private int mark_start; // start of current checkpoint
- private int mark_end; // end of checkpoint/next free mark
-
- private int[] groups; // current group definitions
-
- // private classes
-
- private struct Mark {
- public int Start, End;
- public int Previous;
-
- public bool IsDefined {
- get { return Start >= 0 && End >= 0; }
- }
-
- public int Index {
- get { return Start < End ? Start : End; }
- }
-
- public int Length {
- get { return Start < End ? End - Start : Start - End; }
- }
- }
-
- private class RepeatContext {
- public RepeatContext (RepeatContext previous, int min, int max, bool lazy, int expr_pc) {
- this.previous = previous;
- this.min = min;
- this.max = max;
- this.lazy = lazy;
- this.expr_pc = expr_pc;
-
- this.start = -1;
- this.count = 0;
- }
-
- public int Count {
- get { return count; }
- set { count = value; }
- }
-
- public int Start {
- get { return start; }
- set { start = value; }
- }
-
- public bool IsMinimum {
- get { return min <= count; }
- }
-
- public bool IsMaximum {
- get { return max <= count; }
- }
-
- public bool IsLazy {
- get { return lazy; }
- }
-
- public int Expression {
- get { return expr_pc; }
- }
-
- public RepeatContext Previous {
- get { return previous; }
- }
-
- private int start;
- private int min, max;
- private bool lazy;
- private int expr_pc;
- private RepeatContext previous;
-
- private int count;
- }
-
- private enum Mode {
- Search,
- Match,
- Count
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/interval.cs b/mcs/class/System/System.Text.RegularExpressions/interval.cs
deleted file mode 100644
index 4c8d19f5b15..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/interval.cs
+++ /dev/null
@@ -1,305 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: interval.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions {
-
- struct Interval : IComparable {
- public int low;
- public int high;
- public bool contiguous;
-
- public static Interval Empty {
- get {
- Interval i;
- i.low = 0;
- i.high = i.low - 1;
- i.contiguous = true;
-
- return i;
- }
- }
-
- public static Interval Entire {
- get { return new Interval (Int32.MinValue, Int32.MaxValue); }
- }
-
- public Interval (int low, int high) {
- if (low > high) {
- int t = low;
- low = high;
- high = t;
- }
-
- this.low = low;
- this.high = high;
- this.contiguous = true;
- }
-
- public bool IsDiscontiguous {
- get { return !contiguous; }
- }
-
- public bool IsSingleton {
- get { return contiguous && low == high; }
- }
-
- public bool IsRange {
- get { return !IsSingleton && !IsEmpty; }
- }
-
- public bool IsEmpty {
- get { return low > high; }
- }
-
- public int Size {
- get {
- if (IsEmpty)
- return 0;
-
- return high - low + 1;
- }
- }
-
- public bool IsDisjoint (Interval i) {
- if (IsEmpty || i.IsEmpty)
- return true;
-
- return !(low <= i.high && i.low <= high);
- }
-
- public bool IsAdjacent (Interval i) {
- if (IsEmpty || i.IsEmpty)
- return false;
-
- return low == i.high + 1 || high == i.low - 1;
- }
-
- public bool Contains (Interval i) {
- if (!IsEmpty && i.IsEmpty)
- return true;
- if (IsEmpty)
- return false;
-
- return low <= i.low && i.high <= high;
- }
-
- public bool Contains (int i) {
- return low <= i && i <= high;
- }
-
- public void Merge (Interval i) {
- if (i.IsEmpty)
- return;
- if (IsEmpty) {
- this.low = i.low;
- this.high = i.high;
- }
-
- if (i.low < low)
- low = i.low;
- if (i.high > high)
- high = i.high;
- }
-
- public void Intersect (Interval i) {
- if (IsDisjoint (i)) {
- low = 0;
- high = low - 1;
- return;
- }
-
- if (i.low > low)
- low = i.low;
- if (i.high > high)
- high = i.high;
- }
-
- public int CompareTo (object o) {
- return low - ((Interval)o).low;
- }
-
- public new string ToString () {
- if (IsEmpty)
- return "(EMPTY)";
- else if (!contiguous)
- return "{" + low + ", " + high + "}";
- else if (IsSingleton)
- return "(" + low + ")";
- else
- return "(" + low + ", " + high + ")";
- }
- }
-
- class IntervalCollection : ICollection, IEnumerable {
- public IntervalCollection () {
- intervals = new ArrayList ();
- }
-
- public Interval this[int i] {
- get { return (Interval)intervals[i]; }
- set { intervals[i] = value; }
- }
-
- public void Add (Interval i) {
- intervals.Add (i);
- }
-
- public void Clear () {
- intervals.Clear ();
- }
-
- public void Sort () {
- intervals.Sort ();
- }
-
- public void Normalize () {
- intervals.Sort ();
-
- int j = 0;
- while (j < intervals.Count - 1) {
- Interval a = (Interval)intervals[j];
- Interval b = (Interval)intervals[j + 1];
-
- if (!a.IsDisjoint (b) || a.IsAdjacent (b)) {
- a.Merge (b);
- intervals[j] = a;
- intervals.RemoveAt (j + 1);
- }
- else
- ++ j;
- }
-
- }
-
- public delegate double CostDelegate (Interval i);
-
- public IntervalCollection GetMetaCollection (CostDelegate cost_del) {
- IntervalCollection meta = new IntervalCollection ();
-
- Normalize ();
- Optimize (0, Count - 1, meta, cost_del);
- meta.intervals.Sort ();
-
- return meta;
- }
-
- private void Optimize (int begin, int end, IntervalCollection meta, CostDelegate cost_del) {
- Interval set;
- set.contiguous = false;
-
- int best_set_begin = -1;
- int best_set_end = -1;
- double best_set_cost = 0;
-
- for (int i = begin; i <= end; ++ i) {
- set.low = this[i].low;
-
- double cost = 0.0;
- for (int j = i; j <= end; ++ j) {
- set.high = this[j].high;
- cost += cost_del (this[j]);
-
- double set_cost = cost_del (set);
- if (set_cost < cost && cost > best_set_cost) {
- best_set_begin = i;
- best_set_end = j;
- best_set_cost = cost;
- }
- }
- }
-
- if (best_set_begin < 0) {
- // didn't find an optimal set: add original members
-
- for (int i = begin; i <= end; ++ i)
- meta.Add (this[i]);
- }
- else {
- // found set: add it ...
-
- set.low = this[best_set_begin].low;
- set.high = this[best_set_end].high;
-
- meta.Add (set);
-
- // ... and optimize to the left and right
-
- if (best_set_begin > begin)
- Optimize (begin, best_set_begin - 1, meta, cost_del);
- if (best_set_end < end)
- Optimize (best_set_end + 1, end, meta, cost_del);
- }
- }
-
- // ICollection implementation
-
- public int Count {
- get { return intervals.Count; }
- }
-
- public bool IsSynchronized {
- get { return false; }
- }
-
- public object SyncRoot {
- get { return intervals; }
- }
-
- public void CopyTo (Array array, int index) {
- foreach (Interval i in intervals) {
- if (index > array.Length)
- break;
-
- array.SetValue (i, index ++);
- }
- }
-
- // IEnumerator implementation
-
- public IEnumerator GetEnumerator () {
- return new Enumerator (intervals);
- }
-
- private class Enumerator : IEnumerator {
- public Enumerator (IList list) {
- this.list = list;
- Reset ();
- }
-
- public object Current {
- get {
- if (ptr >= list.Count)
- throw new InvalidOperationException ();
-
- return list[ptr];
- }
- }
-
- public bool MoveNext () {
- if (ptr > list.Count)
- throw new InvalidOperationException ();
-
- return ++ ptr < list.Count;
- }
-
- public void Reset () {
- ptr = -1;
- }
-
- private IList list;
- private int ptr;
- }
-
- // private fields
-
- private ArrayList intervals;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/match.cs b/mcs/class/System/System.Text.RegularExpressions/match.cs
deleted file mode 100644
index aa2d3f0a4b3..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/match.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: match.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- [Serializable]
- public class Capture {
- public int Index {
- get { return index; }
- }
-
- public int Length {
- get { return length; }
- }
-
- public string Value {
- get { return text.Substring (index, length); }
- }
-
- public override string ToString () {
- return Value;
- }
-
- // internal members
-
- internal Capture (string text) : this (text, 0, 0) { }
-
- internal Capture (string text, int index, int length) {
- this.text = text;
- this.index = index;
- this.length = length;
- }
-
- internal string Text {
- get { return text; }
- }
-
- // private
-
- internal int index, length;
- internal string text;
- }
-
- [Serializable]
- public class Group : Capture {
- public static Group Synchronized (Group inner) {
- return inner; // is this enough?
- }
-
- public CaptureCollection Captures {
- get { return captures; }
- }
-
- public bool Success {
- get { return success; }
- }
-
- // internal
-
- internal Group (string text, int[] caps) : base (text) {
- this.captures = new CaptureCollection ();
-
- if (caps == null || caps.Length == 0) {
- this.success = false;
- return;
- }
-
- this.success = true;
- this.index = caps[0];
- this.length = caps[1];
- captures.Add (this);
- for (int i = 2; i < caps.Length; i += 2)
- captures.Add (new Capture (text, caps[i], caps[i + 1]));
- captures.Reverse ();
- }
-
- private bool success;
- private CaptureCollection captures;
- }
-
- [Serializable]
- public class Match : Group {
- public static Match Empty {
- get { return empty; }
- }
-
- public static Match Synchronized (Match inner) {
- return inner; // FIXME need to sync on machine access
- }
-
- public virtual GroupCollection Groups {
- get { return groups; }
- }
-
- public Match NextMatch () {
- if (this == Empty)
- return Empty;
-
- int scan_ptr = regex.RightToLeft ? Index : Index + Length;
-
- // next match after an empty match: make sure scan ptr makes progress
-
- if (Length == 0)
- scan_ptr += regex.RightToLeft ? -1 : +1;
-
- return machine.Scan (regex, Text, scan_ptr, text_length);
- }
-
- public virtual string Result (string replacement) {
- return ReplacementEvaluator.Evaluate (replacement, this);
- }
-
- // internal
-
- internal Match () : base (null, null) {
- this.regex = null;
- this.machine = null;
- this.text_length = 0;
- this.groups = new GroupCollection ();
-
- groups.Add (this);
- }
-
- internal Match (Regex regex, IMachine machine, string text, int text_length, int[][] grps) :
- base (text, grps[0])
- {
- this.regex = regex;
- this.machine = machine;
- this.text_length = text_length;
-
- this.groups = new GroupCollection ();
- groups.Add (this);
- for (int i = 1; i < grps.Length; ++ i)
- groups.Add (new Group (text, grps[i]));
- }
-
- internal Regex Regex {
- get { return regex; }
- }
-
- // private
-
- private Regex regex;
- private IMachine machine;
- private int text_length;
- private GroupCollection groups;
-
- private static Match empty = new Match ();
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/notes.txt b/mcs/class/System/System.Text.RegularExpressions/notes.txt
deleted file mode 100644
index 56b047ec76e..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/notes.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-TODO:
-
-* Need to go through everything and square it with RightToLeft matching.
- The support for this was built into an early version, and lots of things built
- afterwards are not savvy about bi-directional matching. Things that spring to
- mind: Regex match methods should start at 0 or text.Length depending on
- direction. Do split and replace need changes? Match should be aware of its
- direction (already applied some of this to NextMatch logic). The interpreter
- needs to check left and right bounds. Anchoring and substring discovery need
- to be reworked. RTL matches are going to have anchors on the right - ie $, \Z
- and \z. This should be added to the anchor logic. QuickSearch needs to work in
- reverse. There may be other stuff.... work through the code.
-
-* Add ECMAScript support to the parser. For example, [.\w\s\d] map to ECMA
- categories instead of canonical ones [DONE]. There's different behaviour on
- backreference/octal disambiguation. Find out what the runtime behavioural
- difference is for cyclic backreferences eg (?(1)abc\1) - this is only briefly
- mentioned in the spec. I couldn't find much on this in the ECMAScript
- specification either.
-
-* Octal/backreference parsing needs a big fix. The rules are ridiculously complex.
-
-* Add a check in QuickSearch for single character substrings. This is likely to
- be a common case. There's no need to go through a shift table. Also, have a
- look at just computing a relevant subset of the shift table and using an
- (offset, size) pair to help test inclusion. Characters not in the table get
- the default len + 1 shift.
-
-* Improve the perl test suite. Run under MS runtime to generate checksums for
- each trial. Checksums should incorporate: all captures (index, length) for all
- groups; names of explicit capturing groups, and the numbers they map to. Any
- other state? RegexTrial.Execute() will then compare result and checksum.
-
-* The pattern (?(1?)a|b). It should fail: Perl fails, the MS implementation
- fails, but I pass. The documentation says that the construct (?(X)...) can be
- processed in two ways. If X is a valid group number, or a valid group name,
- then the expression becomes a capture conditional - the (...) part is
- executed only if X has been captured. If X is not a group number or name, then
- it is treated as a positive lookahead., and (...) is only executed if the
- lookahead succeeds. My code does the latter, but on further investigation it
- appears that both Perl and MS fail to recognize an expression assertion if the
- first character of the assertion is a number - which instead suggests a
- capture conditional. The exception raised is something like "invalid group
- number". I get the feeling the my behaviour seems more correct, but it's not
- consistent with the other implementations, so it should probably be changed.
diff --git a/mcs/class/System/System.Text.RegularExpressions/parser.cs b/mcs/class/System/System.Text.RegularExpressions/parser.cs
deleted file mode 100644
index 3327cf3024a..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/parser.cs
+++ /dev/null
@@ -1,1109 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: parser.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace System.Text.RegularExpressions.Syntax {
-
- class Parser {
- public static int ParseDecimal (string str, ref int ptr) {
- return ParseNumber (str, ref ptr, 10, 1, Int32.MaxValue);
- }
-
- public static int ParseOctal (string str, ref int ptr) {
- return ParseNumber (str, ref ptr, 8, 1, 3);
- }
-
- public static int ParseHex (string str, ref int ptr, int digits) {
- return ParseNumber (str, ref ptr, 16, digits, digits);
- }
-
- public static int ParseNumber (string str, ref int ptr, int b, int min, int max) {
- int p = ptr, n = 0, digits = 0, d;
- if (max < min)
- max = Int32.MaxValue;
-
- while (digits < max && p < str.Length) {
- d = ParseDigit (str[p ++], b, digits);
- if (d < 0) {
- -- p;
- break;
- }
-
- n = n * b + d;
- ++ digits;
- }
-
- if (digits < min)
- return -1;
-
- ptr = p;
- return n;
- }
-
- public static string ParseName (string str, ref int ptr) {
- if (Char.IsDigit (str[ptr])) {
- int gid = ParseNumber (str, ref ptr, 10, 1, 0);
- if (gid > 0)
- return gid.ToString ();
-
- return null;
- }
-
- int start = ptr;
- for (;;) {
- if (!IsNameChar (str[ptr]))
- break;
- ++ ptr;
- }
-
- if (ptr - start > 0)
- return str.Substring (start, ptr - start);
-
- return null;
- }
-
- public static string Escape (string str) {
- string result = "";
- for (int i = 0; i < str.Length; ++ i) {
- char c = str[i];
- switch (c) {
- case '\\': case '*': case '+': case '?': case '|':
- case '{': case '[': case '(': case ')': case '^':
- case '$': case '.': case '#': case ' ':
- result += "\\" + c;
- break;
-
- case '\t': result += "\\t"; break;
- case '\n': result += "\\n"; break;
- case '\r': result += "\\r"; break;
- case '\f': result += "\\f"; break;
-
- default: result += c; break;
- }
- }
-
- return result;
- }
-
- public static string Unescape (string str) {
- return new Parser ().ParseString (str);
- }
-
- // public instance
-
- public Parser () {
- this.caps = new ArrayList ();
- this.refs = new Hashtable ();
- }
-
- public RegularExpression ParseRegularExpression (string pattern, RegexOptions options) {
- this.pattern = pattern;
- this.ptr = 0;
-
- caps.Clear ();
- refs.Clear ();
- this.num_groups = 0;
-
- try {
- RegularExpression re = new RegularExpression ();
- ParseGroup (re, options, null);
- ResolveReferences ();
-
- re.GroupCount = num_groups;
-
- return re;
- }
- catch (IndexOutOfRangeException) {
- throw NewParseException ("Unexpected end of pattern.");
- }
- }
-
- public IDictionary GetMapping () {
- Hashtable mapping = new Hashtable ();
- foreach (CapturingGroup group in caps) {
- if (group.Name != null)
- mapping.Add (group.Name, group.Number);
- }
-
- return mapping;
- }
-
- // private methods
-
- private void ParseGroup (Group group, RegexOptions options, Assertion assertion) {
- bool is_top_level = group is RegularExpression;
-
- Alternation alternation = null;
- string literal = null;
-
- Group current = new Group ();
- Expression expr = null;
- bool closed = false;
-
- while (true) {
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- if (ptr >= pattern.Length)
- break;
-
- // (1) Parse for Expressions
-
- char ch = pattern[ptr ++];
-
- switch (ch) {
- case '^': {
- Position pos =
- IsMultiline (options) ? Position.StartOfLine : Position.Start;
- expr = new PositionAssertion (pos);
- break;
- }
-
- case '$': {
- Position pos =
- IsMultiline (options) ? Position.EndOfLine : Position.End;
- expr = new PositionAssertion (pos);
- break;
- }
-
- case '.': {
- Category cat =
- IsSingleline (options) ? Category.AnySingleline : Category.Any;
- expr = new CharacterClass (cat, false);
- break;
- }
-
- case '\\': {
- int c = ParseEscape ();
- if (c >= 0)
- ch = (char)c;
- else {
- expr = ParseSpecial (options);
-
- if (expr == null)
- ch = pattern[ptr ++]; // default escape
- }
- break;
- }
-
- case '[': {
- expr = ParseCharacterClass (options);
- break;
- }
-
- case '(': {
- bool ignore = IsIgnoreCase (options);
- expr = ParseGroupingConstruct (ref options);
- if (expr == null) {
- if (literal != null && IsIgnoreCase (options) != ignore) {
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
- literal = null;
- }
-
- continue;
- }
- break;
- }
-
- case ')': {
- closed = true;
- goto EndOfGroup;
- }
-
- case '|': {
- if (literal != null) {
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
- literal = null;
- }
-
- if (assertion != null) {
- if (assertion.TrueExpression == null)
- assertion.TrueExpression = current;
- else if (assertion.FalseExpression == null)
- assertion.FalseExpression = current;
- else
- throw NewParseException ("Too many | in (?()|).");
- }
- else {
- if (alternation == null)
- alternation = new Alternation ();
-
- alternation.AddAlternative (current);
- }
-
- current = new Group ();
- continue;
- }
-
- case '*': case '+': case '?': case '{': {
- throw NewParseException ("Bad quantifier.");
- }
-
- default:
- break; // literal character
- }
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
-
- // (2) Check for Repetitions
-
- if (ptr < pattern.Length) {
- char k = pattern[ptr];
-
- if (k == '?' || k == '*' || k == '+' || k == '{') {
- ++ ptr;
-
- int min = 0, max = 0;
- bool lazy = false;
-
- switch (k) {
- case '?': min = 0; max = 1; break;
- case '*': min = 0; max = 0xffff; break;
- case '+': min = 1; max = 0xffff; break;
- case '{': ParseRepetitionBounds (out min, out max, options); break;
- }
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- if (ptr < pattern.Length && pattern[ptr] == '?') {
- ++ ptr;
- lazy = true;
- }
-
- Repetition repetition = new Repetition (min, max, lazy);
-
- if (expr == null)
- repetition.Expression = new Literal (ch.ToString (), IsIgnoreCase (options));
- else
- repetition.Expression = expr;
-
- expr = repetition;
- }
- }
-
- // (3) Append Expression and/or Literal
-
- if (expr == null) {
- if (literal == null)
- literal = "";
- literal += ch;
- }
- else {
- if (literal != null) {
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
- literal = null;
- }
-
- current.AppendExpression (expr);
- expr = null;
- }
-
- if (is_top_level && ptr >= pattern.Length)
- goto EndOfGroup;
- }
-
- EndOfGroup:
- if (is_top_level && closed)
- throw NewParseException ("Too many )'s.");
- if (!is_top_level && !closed)
- throw NewParseException ("Not enough )'s.");
-
-
- // clean up literals and alternations
-
- if (literal != null)
- current.AppendExpression (new Literal (literal, IsIgnoreCase (options)));
-
- if (assertion != null) {
- if (assertion.TrueExpression == null)
- assertion.TrueExpression = current;
- else
- assertion.FalseExpression = current;
-
- group.AppendExpression (assertion);
- }
- else if (alternation != null) {
- alternation.AddAlternative (current);
- group.AppendExpression (alternation);
- }
- else
- group.AppendExpression (current);
- }
-
- private Expression ParseGroupingConstruct (ref RegexOptions options) {
- if (pattern[ptr] != '?') {
- Group group;
-
- if (IsExplicitCapture (options))
- group = new Group ();
- else {
- group = new CapturingGroup ();
- caps.Add (group);
- }
-
- ParseGroup (group, options, null);
- return group;
- }
- else
- ++ ptr;
-
- switch (pattern[ptr]) {
- case ':': { // non-capturing group
- ++ ptr;
- Group group = new Group ();
- ParseGroup (group, options, null);
-
- return group;
- }
-
- case '>': { // non-backtracking group
- ++ ptr;
- Group group = new NonBacktrackingGroup ();
- ParseGroup (group, options, null);
-
- return group;
- }
-
- case 'i': case 'm': case 'n':
- case 's': case 'x': case '-': { // options
- RegexOptions o = options;
- ParseOptions (ref o, false);
- if (pattern[ptr] == '-') {
- ++ ptr;
- ParseOptions (ref o, true);
- }
-
- if (pattern[ptr] == ':') { // pass options to child group
- ++ ptr;
- Group group = new Group ();
- ParseGroup (group, o, null);
- return group;
- }
- else if (pattern[ptr] == ')') { // change options of enclosing group
- ++ ptr;
- options = o;
- return null;
- }
- else
- throw NewParseException ("Bad options");
- }
-
- case '<': case '=': case '!': { // lookahead/lookbehind
- ExpressionAssertion asn = new ExpressionAssertion ();
- if (!ParseAssertionType (asn))
- goto case '\''; // it's a (?<name> ) construct
-
- Group test = new Group ();
- ParseGroup (test, options, null);
-
- asn.TestExpression = test;
- return asn;
- }
-
- case '\'': { // named/balancing group
- char delim;
- if (pattern[ptr] == '<')
- delim = '>';
- else
- delim = '\'';
-
- ++ ptr;
- string name = ParseName ();
-
- if (pattern[ptr] == delim) {
- // capturing group
-
- if (name == null)
- throw NewParseException ("Bad group name.");
-
- ++ ptr;
- CapturingGroup cap = new CapturingGroup ();
- cap.Name = name;
- caps.Add (cap);
- ParseGroup (cap, options, null);
-
- return cap;
- }
- else if (pattern[ptr] == '-') {
- // balancing group
-
- ++ ptr;
- string balance_name = ParseName ();
- if (balance_name == null || pattern[ptr] != delim)
- throw NewParseException ("Bad balancing group name.");
-
- ++ ptr;
- BalancingGroup bal = new BalancingGroup ();
- bal.Name = name;
- caps.Add (bal);
- refs.Add (bal, balance_name);
-
- return bal;
- }
- else
- throw NewParseException ("Bad group name.");
- }
-
- case '(': { // expression/capture test
- Assertion asn;
-
- ++ ptr;
- int p = ptr;
- string name = ParseName ();
- if (name == null || pattern[ptr] != ')') { // expression test
- // FIXME MS implementation doesn't seem to
- // implement this version of (?(x) ...)
-
- ptr = p;
- ExpressionAssertion expr_asn = new ExpressionAssertion ();
-
- if (pattern[ptr] == '?') {
- ++ ptr;
- if (!ParseAssertionType (expr_asn))
- throw NewParseException ("Bad conditional.");
- }
- else {
- expr_asn.Negate = false;
- expr_asn.Reverse = false;
- }
-
- Group test = new Group ();
- ParseGroup (test, options, null);
- expr_asn.TestExpression = test;
- asn = expr_asn;
- }
- else { // capture test
- ++ ptr;
- asn = new CaptureAssertion ();
- refs.Add (asn, name);
- }
-
- Group group = new Group ();
- ParseGroup (group, options, asn);
- return group;
- }
-
- case '#': { // comment
- ++ ptr;
- while (pattern[ptr ++] != ')') {
- if (ptr >= pattern.Length)
- throw NewParseException ("Unterminated (?#...) comment.");
- }
- return null;
- }
-
- default: // error
- throw NewParseException ("Bad grouping construct.");
- }
- }
-
- private bool ParseAssertionType (ExpressionAssertion assertion) {
- if (pattern[ptr] == '<') {
- switch (pattern[ptr + 1]) {
- case '=':
- assertion.Negate = false;
- break;
- case '!':
- assertion.Negate = true;
- break;
- default:
- return false;
- }
-
- assertion.Reverse = true;
- ptr += 2;
- }
- else {
- switch (pattern[ptr]) {
- case '=':
- assertion.Negate = false;
- break;
- case '!':
- assertion.Negate = true;
- break;
- default:
- return false;
- }
-
- assertion.Reverse = false;
- ptr += 1;
- }
-
- return true;
- }
-
- private void ParseOptions (ref RegexOptions options, bool negate) {
- for (;;) {
- switch (pattern[ptr]) {
- case 'i':
- if (negate)
- options &= ~RegexOptions.IgnoreCase;
- else
- options |= RegexOptions.IgnoreCase;
- break;
-
- case 'm':
- if (negate)
- options &= ~RegexOptions.Multiline;
- else
- options |= RegexOptions.Multiline;
- break;
-
- case 'n':
- if (negate)
- options &= ~RegexOptions.ExplicitCapture;
- else
- options |= RegexOptions.ExplicitCapture;
- break;
-
- case 's':
- if (negate)
- options &= ~RegexOptions.Singleline;
- else
- options |= RegexOptions.Singleline;
- break;
-
- case 'x':
- if (negate)
- options &= ~RegexOptions.IgnorePatternWhitespace;
- else
- options |= RegexOptions.IgnorePatternWhitespace;
- break;
-
- default:
- return;
- }
-
- ++ ptr;
- }
- }
-
- private Expression ParseCharacterClass (RegexOptions options) {
- bool negate, ecma;
- if (pattern[ptr] == '^') {
- negate = true;
- ++ ptr;
- }
- else
- negate = false;
-
- ecma = IsECMAScript (options);
- CharacterClass cls = new CharacterClass (negate, IsIgnoreCase (options));
-
- if (pattern[ptr] == ']') {
- cls.AddCharacter (']');
- ++ ptr;
- }
-
- int c = -1;
- int last = -1;
- bool range = false;
- bool closed = false;
- while (ptr < pattern.Length) {
- c = pattern[ptr ++];
-
- if (c == ']') {
- closed = true;
- break;
- }
-
- if (c == '-') {
- range = true;
- continue;
- }
-
- if (c == '\\') {
- c = ParseEscape ();
- if (c < 0) {
- // didn't recognize escape
-
- c = pattern[ptr ++];
- switch (c) {
- case 'b': c = '\b'; break;
-
- case 'd':
- cls.AddCategory (ecma ? Category.EcmaDigit : Category.Digit, false);
- last = -1;
- continue;
-
- case 'w':
- cls.AddCategory (ecma ? Category.EcmaWord : Category.Word, false);
- last = -1;
- continue;
-
- case 's':
- cls.AddCategory (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, false);
- last = -1;
- continue;
-
- case 'p':
- cls.AddCategory (ParseUnicodeCategory (), false); // ignore ecma
- last = -1;
- continue;
-
- case 'D':
- cls.AddCategory (ecma ? Category.EcmaDigit : Category.Digit, true);
- last = -1;
- continue;
-
- case 'W':
- cls.AddCategory (ecma ? Category.EcmaWord : Category.Word, true);
- last = -1;
- continue;
-
- case 'S':
- cls.AddCategory (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, true);
- last = -1;
- continue;
-
- case 'P':
- cls.AddCategory (ParseUnicodeCategory (), true);
- last = -1;
- continue;
-
- default: break; // add escaped character
- }
- }
- }
-
- if (range) {
- if (c < last)
- throw NewParseException ("[x-y] range in reverse order.");
-
- if (last >=0 )
- cls.AddRange ((char)last, (char)c);
- else {
- cls.AddCharacter ((char)c);
- cls.AddCharacter ('-');
- }
-
- range = false;
- last = -1;
- }
- else {
- cls.AddCharacter ((char)c);
- last = c;
- }
- }
-
- if (!closed)
- throw NewParseException ("Unterminated [] set.");
-
- if (range)
- cls.AddCharacter ('-');
-
- return cls;
- }
-
- private void ParseRepetitionBounds (out int min, out int max, RegexOptions options) {
- int n, m;
-
- /* check syntax */
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- n = ParseNumber (10, 1, 0);
- if (n < 0)
- throw NewParseException ("Illegal {x,y} - bad value of x.");
-
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- switch (pattern[ptr ++]) {
- case '}':
- m = n;
- break;
- case ',':
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- m = ParseNumber (10, 1, 0);
- ConsumeWhitespace (IsIgnorePatternWhitespace (options));
- if (pattern[ptr ++] != '}')
- throw NewParseException ("Illegal {x,y} - bad value of y.");
- break;
- default:
- throw NewParseException ("Illegal {x,y}");
- }
-
- /* check bounds and ordering */
-
- if (n >= 0xffff || m >= 0xffff)
- throw NewParseException ("Illegal {x, y} - maximum of 65535.");
- if (m >= 0 && m < n)
- throw NewParseException ("Illegal {x, y} with x > y.");
-
- /* assign min and max */
-
- min = n;
- if (m > 0)
- max = m;
- else
- max = 0xffff;
- }
-
- private Category ParseUnicodeCategory () {
- if (pattern[ptr ++] != '{')
- throw NewParseException ("Incomplete \\p{X} character escape.");
-
- string name = ParseName (pattern, ref ptr);
- if (name == null)
- throw NewParseException ("Incomplete \\p{X} character escape.");
-
- Category cat = CategoryUtils.CategoryFromName (name);
- if (cat == Category.None)
- throw NewParseException ("Unknown property '" + name + "'.");
-
- if (pattern[ptr ++] != '}')
- throw NewParseException ("Incomplete \\p{X} character escape.");
-
- return cat;
- }
-
- private Expression ParseSpecial (RegexOptions options) {
- int p = ptr;
- bool ecma = IsECMAScript (options);
- Expression expr = null;
-
- switch (pattern[ptr ++]) {
-
- // categories
-
- case 'd':
- expr = new CharacterClass (ecma ? Category.EcmaDigit : Category.Digit, false);
- break;
-
- case 'w':
- expr = new CharacterClass (ecma ? Category.EcmaWord : Category.Word, false);
- break;
-
- case 's':
- expr = new CharacterClass (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, false);
- break;
-
- case 'p':
- // this is odd - ECMAScript isn't supposed to support Unicode,
- // yet \p{..} compiles and runs under the MS implementation
- // identically to canonical mode. That's why I'm ignoring the
- // value of ecma here.
-
- expr = new CharacterClass (ParseUnicodeCategory (), false);
- break;
-
- case 'D':
- expr = new CharacterClass (ecma ? Category.EcmaDigit : Category.Digit, true);
- break;
-
- case 'W':
- expr = new CharacterClass (ecma ? Category.EcmaWord : Category.Word, true);
- break;
-
- case 'S':
- expr = new CharacterClass (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, true);
- break;
-
- case 'P':
- expr = new CharacterClass (ParseUnicodeCategory (), true);
- break;
-
- // positions
-
- case 'A': expr = new PositionAssertion (Position.StartOfString); break;
- case 'Z': expr = new PositionAssertion (Position.End); break;
- case 'z': expr = new PositionAssertion (Position.EndOfString); break;
- case 'G': expr = new PositionAssertion (Position.StartOfScan); break;
- case 'b': expr = new PositionAssertion (Position.Boundary); break;
- case 'B': expr = new PositionAssertion (Position.NonBoundary); break;
-
- // references
-
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9': {
- ptr --;
- int n = ParseNumber (10, 1, 0);
- if (n < 0) {
- ptr = p;
- return null;
- }
-
- // FIXME test if number is within number of assigned groups
- // this may present a problem for right-to-left matching
-
- Reference reference = new Reference (IsIgnoreCase (options));
- refs.Add (reference, n.ToString ());
- expr = reference;
- break;
- }
-
- case 'k': {
- char delim = pattern[ptr ++];
- if (delim == '<')
- delim = '>';
- else if (delim != '\'')
- throw NewParseException ("Malformed \\k<...> named backreference.");
-
- string name = ParseName ();
- if (name == null || pattern[ptr] != delim)
- throw NewParseException ("Malformed \\k<...> named backreference.");
-
- ++ ptr;
- Reference reference = new Reference (IsIgnoreCase (options));
- refs.Add (reference, name);
- expr = reference;
- break;
- }
-
- default:
- expr = null;
- break;
- }
-
- if (expr == null)
- ptr = p;
-
- return expr;
- }
-
- private int ParseEscape () {
- int p = ptr;
- int c;
-
- switch (pattern[ptr ++]) {
-
- // standard escapes (except \b)
-
- case 'a': return '\u0007';
- case 't': return '\u0009';
- case 'r': return '\u000d';
- case 'v': return '\u000b';
- case 'f': return '\u000c';
- case 'n': return '\u000a';
- case 'e': return '\u001b';
- case '\\': return '\\';
-
- // character codes
-
- case '0': return ParseOctal (pattern, ref ptr);
-
- case 'x':
- c = ParseHex (pattern, ref ptr, 2);
- if (c < 0)
- throw NewParseException ("Insufficient hex digits");
-
- return c;
-
- case 'u':
- c = ParseHex (pattern, ref ptr, 4);
- if (c < 0)
- throw NewParseException ("Insufficient hex digits");
-
- return c;
-
- // control characters
-
- case 'c':
- c = pattern[p ++];
- if (c >= 'A' && c <= 'Z')
- return c - 'A';
- else if (c >= '@' && c <= '_')
- return c - '@';
- else
- throw NewParseException ("Unrecognized control character.");
-
- // unknown escape
-
- default:
- ptr = p;
- return -1;
- }
- }
-
- private string ParseName () {
- return Parser.ParseName (pattern, ref ptr);
- }
-
- private static bool IsNameChar (char c) {
- UnicodeCategory cat = Char.GetUnicodeCategory (c);
- if (cat == UnicodeCategory.ModifierLetter)
- return false;
- if (cat == UnicodeCategory.ConnectorPunctuation)
- return true;
- return Char.IsLetterOrDigit (c);
- }
-
- private int ParseNumber (int b, int min, int max) {
- return Parser.ParseNumber (pattern, ref ptr, b, min, max);
- }
-
- private int ParseDecimal () {
- return Parser.ParseDecimal (pattern, ref ptr);
- }
-
- private static int ParseDigit (char c, int b, int n) {
- switch (b) {
- case 8:
- if (c >= '0' && c <= '7')
- return c - '0';
- else
- return -1;
- case 10:
- if (c >= '0' && c <= '9')
- return c - '0';
- else
- return -1;
- case 16:
- if (c >= '0' && c <= '9')
- return c - '0';
- else if (c >= 'a' && c <= 'f')
- return 10 + c - 'a';
- else if (c >= 'A' && c <= 'F')
- return 10 + c - 'A';
- else
- return -1;
- default:
- return -1;
- }
- }
-
- private void ConsumeWhitespace (bool ignore) {
- while (true) {
- if (ptr >= pattern.Length)
- break;
-
- if (pattern[ptr] == '(') {
- if (ptr + 3 >= pattern.Length)
- return;
-
- if (pattern[ptr + 1] != '?' || pattern[ptr + 2] != '#')
- return;
-
- ptr += 3;
- while (pattern[ptr ++] != ')')
- /* ignore */ ;
- }
- else if (ignore && pattern[ptr] == '#') {
- while (ptr < pattern.Length && pattern[ptr ++] != '\n')
- /* ignore */ ;
- }
- else if (ignore && Char.IsWhiteSpace (pattern[ptr])) {
- while (ptr < pattern.Length && Char.IsWhiteSpace (pattern[ptr]))
- ++ ptr;
- }
- else
- return;
- }
- }
-
- private string ParseString (string pattern) {
- this.pattern = pattern;
- this.ptr = 0;
-
- string result = "";
- while (ptr < pattern.Length) {
- int c = pattern[ptr ++];
- if (c == '\\')
- c = ParseEscape ();
-
- result += (char)c;
- }
-
- return result;
- }
-
- private void ResolveReferences () {
- int gid = 1;
- Hashtable dict = new Hashtable ();
-
- // number unnamed groups
-
- foreach (CapturingGroup group in caps) {
- if (group.Name == null) {
- dict.Add (gid.ToString (), group);
- group.Number = gid ++;
-
- ++ num_groups;
- }
- }
-
- // number named groups
-
- foreach (CapturingGroup group in caps) {
- if (group.Name != null) {
- if (!dict.Contains (group.Name)) {
- dict.Add (group.Name, group);
- group.Number = gid ++;
-
- ++ num_groups;
- }
- else {
- CapturingGroup prev = (CapturingGroup)dict[group.Name];
- group.Number = prev.Number;
- }
- }
- }
-
- // resolve references
-
- foreach (Expression expr in refs.Keys) {
- string name = (string)refs[expr];
- if (!dict.Contains (name)) {
- throw NewParseException ("Reference to undefined group " +
- (Char.IsDigit (name[0]) ? "number " : "name ") +
- name);
- }
-
- CapturingGroup group = (CapturingGroup)dict[name];
- if (expr is Reference)
- ((Reference)expr).CapturingGroup = group;
- else if (expr is CaptureAssertion)
- ((CaptureAssertion)expr).CapturingGroup = group;
- else if (expr is BalancingGroup)
- ((BalancingGroup)expr).Balance = group;
- }
- }
-
- // flag helper functions
-
- private static bool IsIgnoreCase (RegexOptions options) {
- return (options & RegexOptions.IgnoreCase) != 0;
- }
-
- private static bool IsMultiline (RegexOptions options) {
- return (options & RegexOptions.Multiline) != 0;
- }
-
- private static bool IsExplicitCapture (RegexOptions options) {
- return (options & RegexOptions.ExplicitCapture) != 0;
- }
-
- private static bool IsSingleline (RegexOptions options) {
- return (options & RegexOptions.Singleline) != 0;
- }
-
- private static bool IsIgnorePatternWhitespace (RegexOptions options) {
- return (options & RegexOptions.IgnorePatternWhitespace) != 0;
- }
-
- private static bool IsRightToLeft (RegexOptions options) {
- return (options & RegexOptions.RightToLeft) != 0;
- }
-
- private static bool IsECMAScript (RegexOptions options) {
- return (options & RegexOptions.ECMAScript) != 0;
- }
-
- // exception creation
-
- private ArgumentException NewParseException (string msg) {
- msg = "parsing \"" + pattern + "\" - " + msg;
- return new ArgumentException (msg, pattern);
- }
-
- private string pattern;
- private int ptr;
-
- private ArrayList caps;
- private Hashtable refs;
- private int num_groups;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs b/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs
deleted file mode 100644
index 65665a2518b..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: quicksearch.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-
-namespace System.Text.RegularExpressions {
-
- // TODO use simple test for single character strings
-
- class QuickSearch {
- // simplified boyer-moore for fast substring matching
-
- public QuickSearch (string str, bool ignore) {
- this.str = str;
- this.len = str.Length;
- this.ignore = ignore;
-
- Setup ();
- }
-
- public string String {
- get { return str; }
- }
-
- public int Length {
- get { return len; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- }
-
- public int Search (string text, int start, int end) {
- if (end > text.Length - len)
- end = text.Length - len;
-
- int ptr = start;
- if (!ignore) {
- while (ptr <= end) {
- int i = len - 1;
- while (str[i] == text[ptr + i]) {
- if (-- i < 0)
- return ptr;
- }
-
- if (ptr < end)
- ptr += shift[text[ptr + len]];
- else
- break;
- }
- }
- else {
- // ignore case: same as above, but we convert text
- // to lower case before doing the string compare
-
- while (ptr <= end) {
- int i = len - 1;
- while (str[i] == Char.ToLower (text[ptr + i])) {
- if (-- i < 0)
- return ptr;
- }
-
- if (ptr < end)
- ptr += shift[text[ptr + len]];
- else
- break;
- }
- }
-
- return -1;
- }
-
- // private
-
- private void Setup () {
- if (ignore)
- str = str.ToLower ();
-
- // this is a 64k entry shift table. that's 128kb per pattern!
- // is it worth compressing this by only storing shifts within
- // a (lo, hi) character range? for most substrings this would
- // be around 50 bytes...
-
- shift = new int[0x1000];
- for (int i = 0; i < 0x1000; ++ i)
- shift[i] = len + 1;
-
- for (int i = 0; i < len; ++ i) {
- char c = str[i];
-
- shift[c] = len - i;
- if (ignore)
- shift[Char.ToUpper (c)] = len - i;
- }
- }
-
- private string str;
- private int len;
- private bool ignore;
-
- private int[] shift;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/regex.cs b/mcs/class/System/System.Text.RegularExpressions/regex.cs
deleted file mode 100644
index 58feea5235d..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/regex.cs
+++ /dev/null
@@ -1,404 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: regex.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.Serialization;
-
-using RegularExpression = System.Text.RegularExpressions.Syntax.RegularExpression;
-using Parser = System.Text.RegularExpressions.Syntax.Parser;
-
-namespace System.Text.RegularExpressions {
-
- public delegate string MatchEvaluator (Match match);
-
- [Flags]
- public enum RegexOptions {
- None = 0x000,
- IgnoreCase = 0x001,
- Multiline = 0x002,
- ExplicitCapture = 0x004,
- Compiled = 0x008,
- Singleline = 0x010,
- IgnorePatternWhitespace = 0x020,
- RightToLeft = 0x040,
- ECMAScript = 0x100
- }
-
- [Serializable]
- public class Regex : ISerializable {
- public static void CompileToAssembly
- (RegexCompilationInfo[] regexes, AssemblyName aname)
- {
- throw new Exception ("Not implemented.");
- }
-
- public static void CompileToAssembly
- (RegexCompilationInfo[] regexes, AssemblyName aname,
- CustomAttributeBuilder[] attribs)
- {
- throw new Exception ("Not implemented.");
- }
-
- public static void CompileToAssembly
- (RegexCompilationInfo[] regexes, AssemblyName aname,
- CustomAttributeBuilder[] attribs, string resourceFile)
- {
- throw new Exception ("Not implemented.");
- }
-
- public static string Escape (string str) {
- return Parser.Escape (str);
- }
-
- public static string Unescape (string str) {
- return Parser.Unescape (str);
- }
-
- public static bool IsMatch (string input, string pattern) {
- return IsMatch (input, pattern, RegexOptions.None);
- }
-
- public static bool IsMatch (string input, string pattern, RegexOptions options) {
- Regex re = new Regex (pattern, options);
- return re.IsMatch (input);
- }
-
- public static Match Match (string input, string pattern) {
- return Regex.Match (input, pattern, RegexOptions.None);
- }
-
- public static Match Match (string input, string pattern, RegexOptions options) {
- Regex re = new Regex (pattern, options);
- return re.Match (input);
- }
-
- public static MatchCollection Matches (string input, string pattern) {
- return Matches (input, pattern, RegexOptions.None);
- }
-
- public static MatchCollection Matches (string input, string pattern, RegexOptions options) {
- Regex re = new Regex (pattern, options);
- return re.Matches (input);
- }
-
- public static string Replace
- (string input, string pattern, MatchEvaluator evaluator)
- {
- return Regex.Replace (input, pattern, evaluator, RegexOptions.None);
- }
-
- public static string Replace
- (string input, string pattern, MatchEvaluator evaluator,
- RegexOptions options)
- {
- Regex re = new Regex (pattern, options);
- return re.Replace (input, evaluator);
- }
-
- public static string Replace
- (string input, string pattern, string replacement)
- {
- return Regex.Replace (input, pattern, replacement, RegexOptions.None);
- }
-
- public static string Replace
- (string input, string pattern, string replacement,
- RegexOptions options)
- {
- Regex re = new Regex (pattern, options);
- return re.Replace (input, replacement);
- }
-
- public static string[] Split (string input, string pattern) {
- return Regex.Split (input, pattern, RegexOptions.None);
- }
-
- public static string[] Split (string input, string pattern, RegexOptions options) {
- Regex re = new Regex (input, options);
- return re.Split (input);
- }
-
- // private
-
- private static FactoryCache cache = new FactoryCache (200); // TODO put some meaningful number here
-
- // constructors
-
- protected Regex () {
- // XXX what's this constructor for?
- }
-
- public Regex (string pattern) : this (pattern, RegexOptions.None) {
- }
-
- public Regex (string pattern, RegexOptions options) {
- this.pattern = pattern;
- this.options = options;
-
- this.factory = cache.Lookup (pattern, options);
-
- if (this.factory == null) {
- // parse and install group mapping
-
- Parser psr = new Parser ();
- RegularExpression re = psr.ParseRegularExpression (pattern, options);
- this.group_count = re.GroupCount;
- this.mapping = psr.GetMapping ();
-
- // compile
-
- ICompiler cmp;
- if ((options & RegexOptions.Compiled) != 0)
- throw new Exception ("Not implemented.");
- //cmp = new CILCompiler ();
- else
- cmp = new PatternCompiler ();
-
- re.Compile (cmp, RightToLeft);
-
- // install machine factory and add to pattern cache
-
- this.factory = cmp.GetMachineFactory ();
- cache.Add (pattern, options, this.factory);
- }
- }
-
- // public instance properties
-
- public RegexOptions Options {
- get { return options; }
- }
-
- public bool RightToLeft {
- get { return (options & RegexOptions.RightToLeft) != 0; }
- }
-
- // public instance methods
-
- public string[] GetGroupNames () {
- string[] names = new string[mapping.Count];
- mapping.Keys.CopyTo (names, 0);
-
- return names;
- }
-
- public int[] GetGroupNumbers () {
- int[] numbers = new int[mapping.Count];
- mapping.Values.CopyTo (numbers, 0);
-
- return numbers;
- }
-
- public string GroupNameFromNumber (int i) {
- if (i >= group_count)
- return "";
-
- foreach (string name in mapping.Keys) {
- if ((int)mapping[name] == i)
- return name;
- }
-
- return "";
- }
-
- public int GroupNumberFromName (string name) {
- if (mapping.Contains (name))
- return (int)mapping[name];
-
- return -1;
- }
-
- // match methods
-
- public bool IsMatch (string input) {
- return IsMatch (input, 0);
- }
-
- public bool IsMatch (string input, int startat) {
- return Match (input, startat).Success;
- }
-
- public Match Match (string input) {
- return Match (input, 0);
- }
-
- public Match Match (string input, int startat) {
- return CreateMachine ().Scan (this, input, startat, input.Length);
- }
-
- public Match Match (string input, int startat, int length) {
- return CreateMachine ().Scan (this, input, startat, startat + length);
- }
-
- public MatchCollection Matches (string input) {
- return Matches (input, 0);
- }
-
- public MatchCollection Matches (string input, int startat) {
- MatchCollection ms = new MatchCollection ();
- Match m = Match (input, startat);
- while (m.Success) {
- ms.Add (m);
- m = m.NextMatch ();
- }
-
- return ms;
- }
-
- // replace methods
-
- public string Replace (string input, MatchEvaluator evaluator) {
- return Replace (input, evaluator, Int32.MaxValue, 0);
- }
-
- public string Replace (string input, MatchEvaluator evaluator, int count) {
- return Replace (input, evaluator, count, 0);
- }
-
- public string Replace (string input, MatchEvaluator evaluator, int count, int startat)
- {
- StringBuilder result = new StringBuilder ();
- int ptr = startat;
-
- Match m = Match (input, startat);
- while (m.Success && count -- > 0) {
- result.Append (input.Substring (ptr, m.Index - ptr));
- result.Append (evaluator (m));
-
- ptr = m.Index + m.Length;
- m = m.NextMatch ();
- }
- result.Append (input.Substring (ptr));
-
- return result.ToString ();
- }
-
- public string Replace (string input, string replacement) {
- return Replace (input, replacement, Int32.MaxValue, 0);
- }
-
- public string Replace (string input, string replacement, int count) {
- return Replace (input, replacement, count, 0);
- }
-
- public string Replace (string input, string replacement, int count, int startat) {
- ReplacementEvaluator ev = new ReplacementEvaluator (this, replacement);
- return Replace (input, new MatchEvaluator (ev.Evaluate), count, startat);
- }
-
- // split methods
-
- public string[] Split (string input) {
- return Split (input, Int32.MaxValue, 0);
- }
-
- public string[] Split (string input, int count) {
- return Split (input, count, 0);
- }
-
- public string[] Split (string input, int count, int startat) {
- ArrayList splits = new ArrayList ();
- if (count == 0)
- count = Int32.MaxValue;
-
- int ptr = startat;
- while (count -- > 0) {
- Match m = Match (input, ptr);
- if (!m.Success)
- break;
-
- splits.Add (input.Substring (ptr, m.Index - ptr));
- ptr = m.Index + m.Length;
- }
-
- if (count > 0)
- splits.Add (input.Substring (ptr));
-
- string[] result = new string[splits.Count];
- splits.CopyTo (result);
- return result;
- }
-
- // object methods
-
- public override string ToString () {
- return pattern;
- }
-
- // ISerializable interface
-
- public void GetObjectData (SerializationInfo info, StreamingContext context) {
- throw new Exception ("Not implemented.");
- }
-
- // internal
-
- internal int GroupCount {
- get { return group_count; }
- }
-
- // private
-
- private IMachine CreateMachine () {
- return factory.NewInstance ();
- }
-
- protected internal string pattern;
- private RegexOptions options;
-
- private IMachineFactory factory;
- private IDictionary mapping;
- private int group_count;
- }
-
- [Serializable]
- public class RegexCompilationInfo {
- public RegexCompilationInfo (string pattern, RegexOptions options, string name, string full_namespace, bool is_public) {
- this.pattern = pattern;
- this.options = options;
- this.name = name;
- this.full_namespace = full_namespace;
- this.is_public = is_public;
- }
-
- public bool IsPublic {
- get { return is_public; }
- set { is_public = value; }
- }
-
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public string Namespace {
- get { return full_namespace; }
- set { full_namespace = value; }
- }
-
- public RegexOptions Options {
- get { return options; }
- set { options = value; }
- }
-
- public string Pattern {
- get { return pattern; }
- set { pattern = value; }
- }
-
- // private
-
- private string pattern, name, full_namespace;
- private RegexOptions options;
- private bool is_public;
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/replace.cs b/mcs/class/System/System.Text.RegularExpressions/replace.cs
deleted file mode 100644
index 88b99f394bc..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/replace.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: replace.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Text;
-using System.Collections;
-
-using Parser = System.Text.RegularExpressions.Syntax.Parser;
-
-namespace System.Text.RegularExpressions {
-
- class ReplacementEvaluator {
- public static string Evaluate (string replacement, Match match) {
- ReplacementEvaluator ev = new ReplacementEvaluator (match.Regex, replacement);
- return ev.Evaluate (match);
- }
-
- public ReplacementEvaluator (Regex regex, string replacement) {
- this.regex = regex;
- terms = new ArrayList ();
- Compile (replacement);
- }
-
- public string Evaluate (Match match) {
- StringBuilder result = new StringBuilder ();
- foreach (Term term in terms)
- result.Append (term.GetResult (match));
-
- return result.ToString ();
- }
-
- // private
-
- private void Compile (string replacement) {
- replacement = Parser.Unescape (replacement);
- string literal = "";
-
- int ptr = 0;
- char c;
- Term term = null;
- while (ptr < replacement.Length) {
- c = replacement[ptr ++];
-
- if (c == '$') {
- if (replacement[ptr] == '$') {
- ++ ptr;
- break;
- }
-
- term = CompileTerm (replacement, ref ptr);
- }
-
- if (term != null) {
- term.Literal = literal;
- terms.Add (term);
-
- term = null;
- literal = "";
- }
- else
- literal += c;
- }
-
- if (term == null && literal.Length > 0) {
- terms.Add (new Term (literal));
- }
- }
-
- private Term CompileTerm (string str, ref int ptr) {
- char c = str[ptr];
-
- if (Char.IsDigit (c)) { // numbered group
- int n = Parser.ParseDecimal (str, ref ptr);
- if (n < 0 || n > regex.GroupCount)
- throw new ArgumentException ("Bad group number.");
-
- return new Term (TermOp.Match, n);
- }
-
- ++ ptr;
-
- switch (c) {
- case '{': { // named group
- string name = Parser.ParseName (str, ref ptr);
- if (str[ptr ++] != '}' || name == null)
- throw new ArgumentException ("Bad group name.");
-
- int n = regex.GroupNumberFromName (name);
-
- if (n < 0)
- throw new ArgumentException ("Bad group name.");
-
- return new Term (TermOp.Match, n);
- }
-
- case '&': // entire match
- return new Term (TermOp.Match, 0);
-
- case '`': // text before match
- return new Term (TermOp.PreMatch, 0);
-
- case '\'': // text after match
- return new Term (TermOp.PostMatch, 0);
-
- case '+': // last group
- return new Term (TermOp.Match, regex.GroupCount - 1);
-
- case '_': // entire text
- return new Term (TermOp.All, 0);
-
- default:
- throw new ArgumentException ("Bad replacement pattern.");
- }
- }
-
- private Regex regex;
- private ArrayList terms;
-
- private enum TermOp {
- None, // no action
- Match, // input within group
- PreMatch, // input before group
- PostMatch, // input after group
- All // entire input
- }
-
- private class Term {
- public Term (TermOp op, int arg) {
- this.op = op;
- this.arg = arg;
- this.literal = "";
- }
-
- public Term (string literal) {
- this.op = TermOp.None;
- this.arg = 0;
- this.literal = literal;
- }
-
- public string Literal {
- set { literal = value; }
- }
-
- public string GetResult (Match match) {
- Group group = match.Groups[arg];
-
- switch (op) {
- case TermOp.None:
- return literal;
-
- case TermOp.Match:
- return literal + group.Value;
-
- case TermOp.PreMatch:
- return literal + group.Text.Substring (0, group.Index);
-
- case TermOp.PostMatch:
- return literal + group.Text.Substring (group.Index + group.Length);
-
- case TermOp.All:
- return literal + group.Text;
- }
-
- return "";
- }
-
- public TermOp op; // term type
- public int arg; // group argument
- public string literal; // literal to prepend
-
- public override string ToString () {
- return op.ToString () + "(" + arg + ") " + literal;
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Text.RegularExpressions/syntax.cs b/mcs/class/System/System.Text.RegularExpressions/syntax.cs
deleted file mode 100644
index f0d0bc4ef78..00000000000
--- a/mcs/class/System/System.Text.RegularExpressions/syntax.cs
+++ /dev/null
@@ -1,976 +0,0 @@
-//
-// assembly: System
-// namespace: System.Text.RegularExpressions
-// file: syntax.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Collections;
-
-namespace System.Text.RegularExpressions.Syntax {
- // collection classes
-
- class ExpressionCollection : CollectionBase {
- public void Add (Expression e) {
- List.Add (e);
- }
-
- public Expression this[int i] {
- get { return (Expression)List[i]; }
- set { List[i] = value; }
- }
-
- protected override void OnValidate (object o) {
- // allow null elements
- }
- }
-
- // abstract classes
-
- abstract class Expression {
- public abstract void Compile (ICompiler cmp, bool reverse);
- public abstract void GetWidth (out int min, out int max);
-
- public int GetFixedWidth () {
- int min, max;
- GetWidth (out min, out max);
-
- if (min == max)
- return min;
-
- return -1;
- }
-
- public virtual AnchorInfo GetAnchorInfo () {
- return new AnchorInfo (this, GetFixedWidth ());
- }
-
- public virtual bool IsComplex () {
- return true;
- }
- }
-
- // composite expressions
-
- abstract class CompositeExpression : Expression {
- public CompositeExpression () {
- expressions = new ExpressionCollection ();
- }
-
- protected ExpressionCollection Expressions {
- get { return expressions; }
- }
-
- protected void GetWidth (out int min, out int max, int count) {
- min = Int32.MaxValue;
- max = 0;
- bool empty = true;
-
- for (int i = 0; i < count; ++ i) {
- Expression e = Expressions[i];
- if (e == null)
- continue;
-
- empty = false;
- int a, b;
- e.GetWidth (out a, out b);
- if (a < min) min = a;
- if (b > max) max = b;
- }
-
- if (empty)
- min = max = 0;
- }
-
- private ExpressionCollection expressions;
- }
-
- // groups
-
- class Group : CompositeExpression {
- public Group () {
- }
-
- public Expression Expression {
- get { return Expressions[0]; }
- set { Expressions[0] = value; }
- }
-
- public void AppendExpression (Expression e) {
- Expressions.Add (e);
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- int count = Expressions.Count;
- for (int i = 0; i < count; ++ i) {
- Expression e;
- if (reverse)
- e = Expressions[count - i - 1];
- else
- e = Expressions[i];
-
- e.Compile (cmp, reverse);
- }
- }
-
- public override void GetWidth (out int min, out int max) {
- min = 0;
- max = 0;
-
- foreach (Expression e in Expressions) {
- int a, b;
- e.GetWidth (out a, out b);
- min += a;
- if (max == Int32.MaxValue || b == Int32.MaxValue)
- max = Int32.MaxValue;
- else
- max += b;
- }
- }
-
- public override AnchorInfo GetAnchorInfo () {
- int ptr;
- int width = GetFixedWidth ();
-
- ArrayList infos = new ArrayList ();
- IntervalCollection segments = new IntervalCollection ();
-
- // accumulate segments
-
- ptr = 0;
- foreach (Expression e in Expressions) {
- AnchorInfo info = e.GetAnchorInfo ();
- infos.Add (info);
-
- if (info.IsPosition)
- return new AnchorInfo (this, ptr + info.Offset, width, info.Position);
-
- if (info.IsSubstring)
- segments.Add (info.GetInterval (ptr));
-
- if (info.IsUnknownWidth)
- break;
-
- ptr += info.Width;
- }
-
- // normalize and find the longest segment
-
- segments.Normalize ();
-
- Interval longest = Interval.Empty;
- foreach (Interval segment in segments) {
- if (segment.Size > longest.Size)
- longest = segment;
- }
-
- // now chain the substrings that made this segment together
-
- if (!longest.IsEmpty) {
- string str = "";
- bool ignore = false;
-
- ptr = 0;
- foreach (AnchorInfo info in infos) {
- if (info.IsSubstring && longest.Contains (info.GetInterval (ptr))) {
- str += info.Substring; // TODO mark subexpressions
- ignore |= info.IgnoreCase;
- }
-
- if (info.IsUnknownWidth)
- break;
-
- ptr += info.Width;
- }
-
- return new AnchorInfo (this, longest.low, width, str, ignore);
- }
-
- return new AnchorInfo (this, width);
- }
-
- public override bool IsComplex () {
- bool comp = false;
- foreach (Expression e in Expressions) {
- comp |= e.IsComplex ();
- }
-
- return comp | GetFixedWidth () <= 0;
- }
- }
-
- class RegularExpression : Group {
- public RegularExpression () {
- group_count = 0;
- }
-
- public int GroupCount {
- get { return group_count; }
- set { group_count = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- // info block
-
- int min, max;
- GetWidth (out min, out max);
- cmp.EmitInfo (group_count, min, max);
-
- // anchoring expression
-
- AnchorInfo info = GetAnchorInfo ();
- if (reverse)
- info = new AnchorInfo (this, GetFixedWidth ()); // FIXME
-
- LinkRef pattern = cmp.NewLink ();
- cmp.EmitAnchor (info.Offset, pattern);
-
- if (info.IsPosition)
- cmp.EmitPosition (info.Position);
- else if (info.IsSubstring)
- cmp.EmitString (info.Substring, info.IgnoreCase, reverse);
-
- cmp.EmitTrue ();
-
- // pattern
-
- cmp.ResolveLink (pattern);
- base.Compile (cmp, reverse);
- cmp.EmitTrue ();
- }
-
- private int group_count;
- }
-
- class CapturingGroup : Group {
- public CapturingGroup () {
- this.gid = 0;
- this.name = null;
- }
-
- public int Number {
- get { return gid; }
- set { gid = value; }
- }
-
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public bool IsNamed {
- get { return name != null; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- cmp.EmitOpen (gid);
- base.Compile (cmp, reverse);
- cmp.EmitClose (gid);
- }
-
- public override bool IsComplex () {
- return true;
- }
-
- private int gid;
- private string name;
- }
-
- class BalancingGroup : CapturingGroup {
- public BalancingGroup () {
- this.balance = null;
- }
-
- public CapturingGroup Balance {
- get { return balance; }
- set { balance = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- // can't invoke Group.Compile from here :(
- // so I'll just repeat the code
-
- int count = Expressions.Count;
- for (int i = 0; i < count; ++ i) {
- Expression e;
- if (reverse)
- e = Expressions[count - i - 1];
- else
- e = Expressions[i];
-
- e.Compile (cmp, reverse);
- }
-
- cmp.EmitBalance (this.Number, balance.Number);
- }
-
- private CapturingGroup balance;
- }
-
- class NonBacktrackingGroup : Group {
- public NonBacktrackingGroup () {
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- LinkRef tail = cmp.NewLink ();
-
- cmp.EmitSub (tail);
- base.Compile (cmp, reverse);
- cmp.EmitTrue ();
- cmp.ResolveLink (tail);
- }
-
- public override bool IsComplex () {
- return true;
- }
- }
-
- // repetition
-
- class Repetition : CompositeExpression {
- public Repetition (int min, int max, bool lazy) {
- Expressions.Add (null);
-
- this.min = min;
- this.max = max;
- this.lazy = lazy;
- }
-
- public Expression Expression {
- get { return Expressions[0]; }
- set { Expressions[0] = value; }
- }
-
- public int Minimum {
- get { return min; }
- set { min = value; }
- }
-
- public int Maximum {
- get { return max; }
- set { max = value; }
- }
-
- public bool Lazy {
- get { return lazy; }
- set { lazy = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- if (Expression.IsComplex ()) {
- LinkRef until = cmp.NewLink ();
-
- cmp.EmitRepeat (min, max, lazy, until);
- Expression.Compile (cmp, reverse);
- cmp.EmitUntil (until);
- }
- else {
- LinkRef tail = cmp.NewLink ();
-
- cmp.EmitFastRepeat (min, max, lazy, tail);
- Expression.Compile (cmp, reverse);
- cmp.EmitTrue ();
- cmp.ResolveLink (tail);
- }
- }
-
- public override void GetWidth (out int min, out int max) {
- Expression.GetWidth (out min, out max);
- min = min * this.min;
- if (max == Int32.MaxValue || this.max == 0xffff)
- max = Int32.MaxValue;
- else
- max = max * this.max;
- }
-
- public override AnchorInfo GetAnchorInfo () {
- int width = GetFixedWidth ();
- if (Minimum == 0)
- return new AnchorInfo (this, width);
-
- AnchorInfo info = Expression.GetAnchorInfo ();
- if (info.IsPosition)
- return new AnchorInfo (this, info.Offset, width, info.Position);
-
- if (info.IsSubstring) {
- if (info.IsComplete) {
- string str = "";
- for (int i = 0; i < Minimum; ++ i)
- str += info.Substring;
-
- return new AnchorInfo (this, 0, width, str, info.IgnoreCase);
- }
-
- return new AnchorInfo (this, info.Offset, width, info.Substring, info.IgnoreCase);
- }
-
- return new AnchorInfo (this, width);
- }
-
- private int min, max;
- private bool lazy;
- }
-
- // assertions
-
- abstract class Assertion : CompositeExpression {
- public Assertion () {
- Expressions.Add (null); // true expression
- Expressions.Add (null); // false expression
- }
-
- public Expression TrueExpression {
- get { return Expressions[0]; }
- set { Expressions[0] = value; }
- }
-
- public Expression FalseExpression {
- get { return Expressions[1]; }
- set { Expressions[1] = value; }
- }
-
- public override void GetWidth (out int min, out int max) {
- GetWidth (out min, out max, 2);
-
- if (TrueExpression == null || FalseExpression == null)
- min = 0;
- }
- }
-
- class CaptureAssertion : Assertion {
- public CaptureAssertion () {
- }
-
- public CapturingGroup CapturingGroup {
- get { return group; }
- set { group = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- int gid = group.Number;
- LinkRef tail = cmp.NewLink ();
-
- if (FalseExpression == null) {
- // IfDefined :1
- // <yes_exp>
- // 1: <tail>
-
- cmp.EmitIfDefined (gid, tail);
- TrueExpression.Compile (cmp, reverse);
- }
- else {
- // IfDefined :1
- // <yes_expr>
- // Jump :2
- // 1: <no_expr>
- // 2: <tail>
-
- LinkRef false_expr = cmp.NewLink ();
- cmp.EmitIfDefined (gid, false_expr);
- TrueExpression.Compile (cmp, reverse);
- cmp.EmitJump (tail);
- cmp.ResolveLink (false_expr);
- FalseExpression.Compile (cmp, reverse);
- }
-
- cmp.ResolveLink (tail);
- }
-
- public override bool IsComplex () {
- bool comp = false;
- if (TrueExpression != null)
- comp |= TrueExpression.IsComplex ();
- if (FalseExpression != null)
- comp |= FalseExpression.IsComplex ();
-
- return comp | GetFixedWidth () <= 0;
- }
-
- private CapturingGroup group;
- }
-
- class ExpressionAssertion : Assertion {
- public ExpressionAssertion () {
- Expressions.Add (null); // test expression
- }
-
- public bool Reverse {
- get { return reverse; }
- set { reverse = value; }
- }
-
- public bool Negate {
- get { return negate; }
- set { negate = value; }
- }
-
- public Expression TestExpression {
- get { return Expressions[2]; }
- set { Expressions[2] = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- LinkRef true_expr = cmp.NewLink ();
- LinkRef false_expr = cmp.NewLink ();
-
- // test op: positive / negative
-
- if (!negate)
- cmp.EmitTest (true_expr, false_expr);
- else
- cmp.EmitTest (false_expr, true_expr);
-
- // test expression: lookahead / lookbehind
-
- TestExpression.Compile (cmp, reverse ^ this.reverse);
- cmp.EmitTrue ();
-
- // target expressions
-
- if (TrueExpression == null) { // (?= ...)
- // Test :1, :2
- // <test_expr>
- // :2 False
- // :1 <tail>
-
- cmp.ResolveLink (false_expr);
- cmp.EmitFalse ();
- cmp.ResolveLink (true_expr);
- }
- else {
- cmp.ResolveLink (true_expr);
- TrueExpression.Compile (cmp, reverse);
-
- if (FalseExpression == null) { // (?(...) ...)
- // Test :1, :2
- // <test_expr>
- // :1 <yes_expr>
- // :2 <tail>
-
- cmp.ResolveLink (false_expr);
- }
- else { // (?(...) ... | ...)
- // Test :1, :2
- // <test_expr>
- // :1 <yes_expr>
- // Jump :3
- // :2 <no_expr>
- // :3 <tail>
-
- LinkRef tail = cmp.NewLink ();
-
- cmp.EmitJump (tail);
- cmp.ResolveLink (false_expr);
- FalseExpression.Compile (cmp, reverse);
- cmp.ResolveLink (tail);
- }
- }
- }
-
- private bool reverse, negate;
- }
-
- // alternation
-
- class Alternation : CompositeExpression {
- public Alternation () {
- }
-
- public ExpressionCollection Alternatives {
- get { return Expressions; }
- }
-
- public void AddAlternative (Expression e) {
- Alternatives.Add (e);
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- LinkRef next = cmp.NewLink ();
- LinkRef tail = cmp.NewLink ();
-
- foreach (Expression e in Alternatives) {
- cmp.EmitBranch (next);
- e.Compile (cmp, reverse);
- cmp.EmitJump (tail);
- cmp.ResolveLink (next);
- }
-
- cmp.EmitFalse ();
- cmp.ResolveLink (tail);
- }
-
- public override void GetWidth (out int min, out int max) {
- GetWidth (out min, out max, Alternatives.Count);
- }
-
- public override bool IsComplex () {
- bool comp = false;
- foreach (Expression e in Alternatives) {
- comp |= e.IsComplex ();
- }
-
- return comp | GetFixedWidth () <= 0;
- }
- }
-
- // terminal expressions
-
- class Literal : Expression {
- public Literal (string str, bool ignore) {
- this.str = str;
- this.ignore = ignore;
- }
-
- public string String {
- get { return str; }
- set { str = value; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- set { ignore = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- if (str.Length == 0)
- return;
-
- if (str.Length == 1)
- cmp.EmitCharacter (str[0], false, ignore, reverse);
- else
- cmp.EmitString (str, ignore, reverse);
- }
-
- public override void GetWidth (out int min, out int max) {
- min = max = str.Length;
- }
-
- public override AnchorInfo GetAnchorInfo () {
- return new AnchorInfo (this, 0, str.Length, str, ignore);
- }
-
- public override bool IsComplex () {
- return false;
- }
-
- private string str;
- private bool ignore;
- }
-
- class PositionAssertion : Expression {
- public PositionAssertion (Position pos) {
- this.pos = pos;
- }
-
- public Position Position {
- get { return pos; }
- set { pos = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- cmp.EmitPosition (pos);
- }
-
- public override void GetWidth (out int min, out int max) {
- min = max = 0;
- }
-
- public override bool IsComplex () {
- return false;
- }
-
- public override AnchorInfo GetAnchorInfo () {
- switch (pos) {
- case Position.StartOfString: case Position.StartOfLine: case Position.StartOfScan:
- return new AnchorInfo (this, 0, 0, pos);
-
- default:
- return new AnchorInfo (this, 0);
- }
- }
-
- private Position pos;
- }
-
- class Reference : Expression {
- public Reference (bool ignore) {
- this.ignore = ignore;
- }
-
- public CapturingGroup CapturingGroup {
- get { return group; }
- set { group = value; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- set { ignore = value; }
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- cmp.EmitReference (group.Number, ignore, reverse);
- }
-
- public override void GetWidth (out int min, out int max) {
- //group.GetWidth (out min, out max);
- // TODO set width to referenced group for non-cyclical references
- min = 0;
- max = Int32.MaxValue;
- }
-
- public override bool IsComplex () {
- return true; // FIXME incorporate cyclic check
- }
-
- private CapturingGroup group;
- private bool ignore;
- }
-
- class CharacterClass : Expression {
- public CharacterClass (bool negate, bool ignore) {
- this.negate = negate;
- this.ignore = ignore;
-
- intervals = new IntervalCollection ();
-
- // initialize pos/neg category arrays
-
- Array cat_values = Enum.GetValues (typeof (Category));
- int cat_size = (int)(Category)cat_values.GetValue (cat_values.Length - 1) + 1;
- pos_cats = new bool[cat_size];
- neg_cats = new bool[cat_size];
- for (int i = 0; i < cat_size; ++ i) {
- pos_cats[i] = false;
- neg_cats[i] = false;
- }
- }
-
- public CharacterClass (Category cat, bool negate) : this (false, false) {
- this.AddCategory (cat, negate);
- }
-
- public bool Negate {
- get { return negate; }
- set { negate = value; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- set { ignore = value; }
- }
-
- public void AddCategory (Category cat, bool negate) {
- int n = (int)cat;
-
- if (negate) {
- if (pos_cats[n])
- pos_cats[n] = false;
-
- neg_cats[n] = true;
- }
- else {
- if (neg_cats[n])
- neg_cats[n] = false;
-
- pos_cats[n] = true;
- }
- }
-
- public void AddCharacter (char c) {
- intervals.Add (new Interval (c, c));
- }
-
- public void AddRange (char lo, char hi) {
- intervals.Add (new Interval (lo, hi));
- }
-
- public override void Compile (ICompiler cmp, bool reverse) {
- // create the meta-collection
-
- IntervalCollection meta =
- intervals.GetMetaCollection (new IntervalCollection.CostDelegate (GetIntervalCost));
-
- // count ops
-
- int count = meta.Count;
- for (int i = 0; i < pos_cats.Length; ++ i) {
- if (pos_cats[i]) ++ count;
- if (neg_cats[i]) ++ count;
- }
-
- if (count == 0)
- return;
-
- // emit in op for |meta| > 1
-
- LinkRef tail = cmp.NewLink ();
- if (count > 1)
- cmp.EmitIn (tail);
-
- // emit categories
-
- for (int i = 0; i < pos_cats.Length; ++ i) {
- if (pos_cats[i])
- cmp.EmitCategory ((Category)i, negate, reverse);
- else if (neg_cats[i])
- cmp.EmitCategory ((Category)i, !negate, reverse);
- }
-
- // emit character/range/sets from meta-collection
-
- foreach (Interval a in meta) {
- if (a.IsDiscontiguous) { // Set
- BitArray bits = new BitArray (a.Size);
- foreach (Interval b in intervals) {
- if (a.Contains (b)) {
- for (int i = b.low; i <= b.high; ++ i)
- bits[i - a.low] = true;
- }
- }
-
- cmp.EmitSet ((char)a.low, bits, negate, ignore, reverse);
- }
- else if (a.IsSingleton) // Character
- cmp.EmitCharacter ((char)a.low, negate, ignore, reverse);
- else // Range
- cmp.EmitRange ((char)a.low, (char)a.high, negate, ignore, reverse);
- }
-
- // finish up
-
- if (count > 1) {
- if (negate)
- cmp.EmitTrue ();
- else
- cmp.EmitFalse ();
-
- cmp.ResolveLink (tail);
- }
- }
-
- public override void GetWidth (out int min, out int max) {
- min = max = 1;
- }
-
- public override bool IsComplex () {
- return false;
- }
-
- // private
-
- private static double GetIntervalCost (Interval i) {
- // use op length as cost metric (=> optimize for space)
-
- if (i.IsDiscontiguous)
- return 3 + ((i.Size + 0xf) >> 4); // Set
- else if (i.IsSingleton)
- return 2; // Character
- else
- return 3; // Range
- }
-
- private bool negate, ignore;
- private bool[] pos_cats, neg_cats;
- private IntervalCollection intervals;
- }
-
- class AnchorInfo {
- private Expression expr;
-
- private Position pos;
- private int offset;
-
- private string str;
- private int width;
- private bool ignore;
-
- public AnchorInfo (Expression expr, int width) {
- this.expr = expr;
- this.offset = 0;
- this.width = width;
-
- this.str = null;
- this.ignore = false;
- this.pos = Position.Any;
- }
-
- public AnchorInfo (Expression expr, int offset, int width, string str, bool ignore) {
- this.expr = expr;
- this.offset = offset;
- this.width = width;
-
- this.str = ignore ? str.ToLower () : str;
-
- this.ignore = ignore;
- this.pos = Position.Any;
- }
-
- public AnchorInfo (Expression expr, int offset, int width, Position pos) {
- this.expr = expr;
- this.offset = offset;
- this.width = width;
-
- this.pos = pos;
-
- this.str = null;
- this.ignore = false;
- }
-
- public Expression Expression {
- get { return expr; }
- }
-
- public int Offset {
- get { return offset; }
- }
-
- public int Width {
- get { return width; }
- }
-
- public int Length {
- get { return (str != null) ? str.Length : 0; }
- }
-
- public bool IsUnknownWidth {
- get { return width < 0; }
- }
-
- public bool IsComplete {
- get { return Length == Width; }
- }
-
- public string Substring {
- get { return str; }
- }
-
- public bool IgnoreCase {
- get { return ignore; }
- }
-
- public Position Position {
- get { return pos; }
- }
-
- public bool IsSubstring {
- get { return str != null; }
- }
-
- public bool IsPosition {
- get { return pos != Position.Any; }
- }
-
- public Interval GetInterval () {
- return GetInterval (0);
- }
-
- public Interval GetInterval (int start) {
- if (!IsSubstring)
- return Interval.Empty;
-
- return new Interval (start + Offset, start + Offset + Length - 1);
- }
- }
-}
diff --git a/mcs/class/System/System.Threading/ChangeLog b/mcs/class/System/System.Threading/ChangeLog
deleted file mode 100755
index 2f7f43e9fc6..00000000000
--- a/mcs/class/System/System.Threading/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2001-09-21 Dick Porter <dick@ximian.com>
-
- * ThreadExceptionEventArgs.cs: Implemented
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * ThreadExceptionEventArgs.cs, ThreadExceptionEventHandler.cs:
- More System.Threading stubs, in the System assembly.
-
diff --git a/mcs/class/System/System.Threading/ThreadExceptionEventArgs.cs b/mcs/class/System/System.Threading/ThreadExceptionEventArgs.cs
deleted file mode 100755
index 002324fe2db..00000000000
--- a/mcs/class/System/System.Threading/ThreadExceptionEventArgs.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Threading.ThreadExceptionEventArgs.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public class ThreadExceptionEventArgs : EventArgs
- {
- private Exception exception;
-
- public ThreadExceptionEventArgs(Exception t) {
- exception=t;
- }
-
- public Exception Exception {
- get {
- return(exception);
- }
- }
- }
-}
diff --git a/mcs/class/System/System.Threading/ThreadExceptionEventHandler.cs b/mcs/class/System/System.Threading/ThreadExceptionEventHandler.cs
deleted file mode 100755
index 6f47d2bdd96..00000000000
--- a/mcs/class/System/System.Threading/ThreadExceptionEventHandler.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.ThreadExceptionEventHandler.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void ThreadExceptionEventHandler(object sender, ThreadExceptionEventArgs e);
-}
diff --git a/mcs/class/System/System.build b/mcs/class/System/System.build
deleted file mode 100644
index 2473c69866e..00000000000
--- a/mcs/class/System/System.build
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System.dll -->
-
-<project name="System" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/System.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/unsafe"/>
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
- <arg value="/lib:../lib/"/>
-
- <!-- cor compare dies with these currently -->
- <!--arg value="/nostdlib"/--> <!-- don't reference mscorlib -->
- <!--arg value="/r:corlib.dll"/-->
- <arg value="/r:System.Xml.dll"/>
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="Test/**"/>
- <excludes name="System.CodeDom/Code-X-Collection.cs"/>
- <excludes name="System.Net/IAuthenticationModule.cs"/>
- <excludes name="System.Net/AuthenticationManager.cs"/>
- </sources>
- </csc>
- <copy file="../lib/System.dll" tofile="Test/System.dll"/>
- <nant basedir="Test" target="build"/>
- </target>
-
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="clean">
- <nant basedir="Test" target="clean"/>
- <delete file="../lib/System.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System/System/ChangeLog b/mcs/class/System/System/ChangeLog
deleted file mode 100644
index d7bd8226c95..00000000000
--- a/mcs/class/System/System/ChangeLog
+++ /dev/null
@@ -1,45 +0,0 @@
-
-Mon Jun 17 15:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Uri.cs: workaround for mcs bug.
-
-2002-05-28 Lawrence Pit <loz@cable.a2000.nl>
-
- * Uri.cs: Implemented ctor UriTest (baseUri, relativeUri)
- * Uri.cs: Fixed bug in internal method GetSchemeDelimiter
-
-2002-05-22 Lawrence Pit <loz@cable.a2000.nl>
-
- * Uri.cs: implemented MakeRelative, improved GetLeftPart
- * UriBuilder.cs: removed Serializable attribute
- * UriHostNameType.cs: added Basic
-
-2002-05-12 Lawrence Pit <loz@cable.a2000.nl>
-
- * Uri.LocalPath and Uri.AbsoluteUri modified to support both w32
- and *nix filepaths
-
-2002-05-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * Uri.GetLeftPart fixed for mailto and news schemes.
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * UriBuilder.cs: Implemented.
-
- * Uri.cs: Complete new reimplementation.
-
-2002-02-08 Duncan Mak <duncan@ximian.com>
-
- * UriFormatException.cs: Removed TODO attribute, the docs are
- probably wrong here. In any case, this code compiles and should work.
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * UriFormatException.cs: Added bits for serialization.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ChangeLog : Add to this directory.
-
- * Uri.cs, UriFormatException.cs : Decorate bits with MonoTODO attribute.
diff --git a/mcs/class/System/System/TODOAttribute.cs b/mcs/class/System/System/TODOAttribute.cs
deleted file mode 100644
index e14b61a2649..00000000000
--- a/mcs/class/System/System/TODOAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute {
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
- }
-}
diff --git a/mcs/class/System/System/Uri.cs b/mcs/class/System/System/Uri.cs
deleted file mode 100755
index d477dfa70cd..00000000000
--- a/mcs/class/System/System/Uri.cs
+++ /dev/null
@@ -1,823 +0,0 @@
-//
-// System.Uri
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-// Author:
-// Garrett Rooney (rooneg@electricjellyfish.net)
-//
-// (C) 2001 Garrett Rooney
-//
-
-using System.Net;
-using System.Runtime.Serialization;
-using System.Text;
-
-// See RFC 2396 for more info on URI's.
-
-// TODO: optimize by parsing host string only once
-
-namespace System
-{
- [Serializable]
- public class Uri : MarshalByRefObject, ISerializable
- {
- // NOTES:
- // o scheme excludes the scheme delimiter
- // o port is -1 to indicate no port is defined
- // o path is empty or starts with / when scheme delimiter == "://"
- // o query is empty or starts with ? char
- // o fragment is empty or starts with # char
- // o all class variables are in escaped format when they are escapable,
- // except cachedToString.
-
- private string scheme = String.Empty;
- private string host = String.Empty;
- private int port = -1;
- private string path = String.Empty;
- private string query = String.Empty;
- private string fragment = String.Empty;
- private string userinfo = String.Empty;
-
- private bool userEscaped = false;
- private string cachedAbsoluteUri = null;
- private string cachedToString = null;
- private int cachedHashCode = 0;
-
- private static readonly string hexUpperChars = "0123456789ABCDEF";
-
- // Fields
-
- public static readonly string SchemeDelimiter = "://";
- public static readonly string UriSchemeFile = "file";
- public static readonly string UriSchemeFtp = "ftp";
- public static readonly string UriSchemeGopher = "gopher";
- public static readonly string UriSchemeHttp = "http";
- public static readonly string UriSchemeHttps = "https";
- public static readonly string UriSchemeMailto = "mailto";
- public static readonly string UriSchemeNews = "news";
- public static readonly string UriSchemeNntp = "nntp";
-
- // Constructors
-
- public Uri (string uriString) : this (uriString, false)
- {
- }
-
- [MonoTODO]
- protected Uri (SerializationInfo serializationInfo,
- StreamingContext streamingContext) :
- this (serializationInfo.GetString ("Uri"), true)
- {
- // TODO: check whether this is compatible with ms.net
- }
-
- public Uri (string uriString, bool dontEscape)
- {
- userEscaped = dontEscape;
- Parse (uriString);
-
- if (userEscaped)
- return;
-
- host = EscapeString (host, false, true, false);
- path = EscapeString (path);
- query = EscapeString (query);
- fragment = EscapeString (fragment, false, false, true);
- }
-
- public Uri (Uri baseUri, string relativeUri)
- : this (baseUri, relativeUri, false)
- {
- }
-
- public Uri (Uri baseUri, string relativeUri, bool dontEscape)
- {
- // See RFC 2396 Par 5.2 and Appendix C
-
- userEscaped = dontEscape;
-
- this.scheme = baseUri.scheme;
- this.host = baseUri.host;
- this.port = baseUri.port;
- this.userinfo = baseUri.userinfo;
-
- if (relativeUri == null)
- throw new NullReferenceException ("relativeUri");
-
- if (relativeUri == String.Empty) {
- this.path = baseUri.path;
- this.query = baseUri.query;
- this.fragment = baseUri.fragment;
- return;
- }
-
- int pos = relativeUri.IndexOf (':');
- if (pos != -1) {
- int pos2 = relativeUri.IndexOfAny (new char [] {'/', '\\'});
- if (pos2 > pos) {
- // equivalent to new Uri (relativeUri, dontEscape)
- Parse (relativeUri);
-
- if (userEscaped)
- return;
-
- host = EscapeString (host, false, true, false);
- path = EscapeString (path);
- query = EscapeString (query);
- fragment = EscapeString (fragment, false, false, true);
- return;
- }
- }
-
- // 8 fragment
- pos = relativeUri.IndexOf ('#');
- if (pos != -1) {
- fragment = relativeUri.Substring (pos);
- if (!userEscaped)
- fragment = EscapeString (fragment, false, false, true);
- relativeUri = relativeUri.Substring (0, pos);
- }
-
- // 6 query
- pos = relativeUri.IndexOf ('?');
- if (pos != -1) {
- query = relativeUri.Substring (pos);
- if (!userEscaped)
- query = EscapeString (query);
- relativeUri = relativeUri.Substring (0, pos);
- }
-
- if (relativeUri[0] == '/') {
- path = relativeUri;
- if (!userEscaped)
- path = EscapeString (path);
- return;
- }
-
- // par 5.2 step 6 a)
- path = baseUri.path;
- pos = path.LastIndexOf ('/');
- if (pos > 0)
- path = path.Substring (0, pos + 1);
-
- // 6 b)
- path += relativeUri;
-
- // 6 c)
- int startIndex = 0;
- while (true) {
- pos = path.IndexOf ("./", startIndex);
- if (pos == -1)
- break;
- if (pos == 0)
- path = path.Remove (0, 2);
- else if (path [pos - 1] != '.')
- path = path.Remove (pos, 2);
- else
- startIndex = pos + 1;
- }
-
- // 6 d)
- if (path.Length > 1 &&
- path [path.Length - 1] == '.' &&
- path [path.Length - 2] == '/')
- path = path.Remove (path.Length - 1, 1);
-
- // 6 e)
- startIndex = 0;
- while (true) {
- pos = path.IndexOf ("/../", startIndex);
- if (pos == -1)
- break;
- if (pos == 0) {
- startIndex = 3;
- continue;
- }
- int pos2 = path.LastIndexOf ('/', pos - 1);
- if (pos2 == -1) {
- startIndex = pos + 1;
- } else {
- if (path.Substring (pos2 + 1, pos - pos2 - 1) != "..")
- path = path.Remove (pos2 + 1, pos - pos2 + 3);
- else
- startIndex = pos + 1;
- }
- }
-
- // 6 f)
- if (path.Length > 3 && path.EndsWith ("/..")) {
- pos = path.LastIndexOf ('/', path.Length - 4);
- Console.WriteLine ("6f " + pos);
- if (pos != -1)
- if (path.Substring (pos + 1, path.Length - pos - 4) != "..")
- path = path.Remove (pos + 1, path.Length - pos - 1);
- }
-
- if (!userEscaped)
- path = EscapeString (path);
- }
-
- // Properties
-
- public string AbsolutePath {
- get { return path; }
- }
-
- public string AbsoluteUri {
- get {
- if (cachedAbsoluteUri == null)
- cachedAbsoluteUri = GetLeftPart (UriPartial.Path) + query + fragment;
- return cachedAbsoluteUri;
- }
- }
-
- public string Authority {
- get {
- return (GetDefaultPort (scheme) == port)
- ? host : host + ":" + port;
- }
- }
-
- public string Fragment {
- get { return fragment; }
- }
-
- public string Host {
- get { return host; }
- }
-
- public UriHostNameType HostNameType {
- get { return CheckHostName (host); }
- }
-
- public bool IsDefaultPort {
- get { return GetDefaultPort (scheme) == port; }
- }
-
- public bool IsFile {
- get { return (scheme == UriSchemeFile); }
- }
-
- public bool IsLoopback {
- get {
- if (host == String.Empty)
- return false;
-
- if (host == "loopback" || host == "localhost")
- return true;
-
- try {
- return IPAddress.IsLoopback (IPAddress.Parse (host));
- } catch (FormatException) {}
-
- try {
- return IPv6Address.IsLoopback (IPv6Address.Parse (host));
- } catch (FormatException) {}
-
- return false;
- }
- }
-
- public bool IsUnc {
- get { return (scheme == Uri.UriSchemeFile); }
- }
-
- public string LocalPath {
- get {
- if (!IsUnc)
- return path;
-
- // support *nix and W32 styles
- if (path.Length > 1 && path [1] == ':')
- return path.Replace ('/', '\\');
-
- if (System.IO.Path.DirectorySeparatorChar == '\\')
- return "\\\\" + host + path.Replace ('/', '\\');
- else
- return "/" + host + path;
- }
- }
-
- public string PathAndQuery {
- get { return path + query; }
- }
-
- public int Port {
- get { return port; }
- }
-
- public string Query {
- get { return query; }
- }
-
- public string Scheme {
- get { return scheme; }
- }
-
- public string [] Segments {
- get {
- string p = path.EndsWith ("/")
- ? path.Remove (path.Length - 1, 1)
- : path;
- string [] segments = p.Split ('/');
- int len = segments.Length - 1;
- for (int i = 0; i < len; i++)
- segments [i] += '/';
- if (path.EndsWith ("/"))
- segments [len] += '/';
- return segments;
- }
- }
-
- public bool UserEscaped {
- get { return userEscaped; }
- }
-
- public string UserInfo {
- get { return userinfo; }
- }
-
-
- // Methods
-
- public static UriHostNameType CheckHostName (string name)
- {
- if (name == null || name.Length == 0)
- return UriHostNameType.Unknown;
-
- if (IsIPv4Address (name))
- return UriHostNameType.IPv4;
-
- if (IsDomainAddress (name))
- return UriHostNameType.Dns;
-
- try {
- IPv6Address.Parse (name);
- return UriHostNameType.IPv6;
- } catch (FormatException) {}
-
- return UriHostNameType.Unknown;
- }
-
- internal static bool IsIPv4Address (string name)
- {
- string [] captures = name.Split (new char [] {'.'});
- if (captures.Length != 4)
- return false;
- for (int i = 0; i < 4; i++) {
- try {
- int d = Int32.Parse (captures [i]);
- if (d < 0 || d > 255)
- return false;
- } catch (Exception) {
- return false;
- }
- }
- return true;
- }
-
- internal static bool IsDomainAddress (string name)
- {
- int len = name.Length;
-
- if (name [len - 1] == '.')
- return false;
-
- int count = 0;
- for (int i = 0; i < len; i++) {
- char c = name [i];
- if (count == 0) {
- if (!Char.IsLetterOrDigit (c))
- return false;
- } else if (c == '.') {
- count = 0;
- } else if (!Char.IsLetterOrDigit (c) && c != '-' && c != '_') {
- return false;
- }
- if (++count == 64)
- return false;
- }
-
- return true;
- }
-
- public static bool CheckSchemeName (string schemeName)
- {
- if (schemeName == null || schemeName.Length == 0)
- return false;
-
- if (!Char.IsLetter (schemeName [0]))
- return false;
-
- int len = schemeName.Length;
- for (int i = 1; i < len; i++) {
- char c = schemeName [i];
- if (!Char.IsLetterOrDigit (c) || c != ',' || c != '+' || c != '-')
- return false;
- }
-
- return true;
- }
-
- public override bool Equals (object comparant)
- {
- if (comparant == null)
- return false;
-
- Uri uri = comparant as Uri;
- if (uri == null) {
- string s = comparant as String;
- if (s == null)
- return false;
- uri = new Uri (s);
- }
-
- return ((this.scheme == uri.scheme) &&
- (this.userinfo == uri.userinfo) &&
- (this.host == uri.host) &&
- (this.port == uri.port) &&
- (this.path == uri.path) &&
- (this.query == uri.query));
- }
-
- public override int GetHashCode ()
- {
- if (cachedHashCode == 0)
- cachedHashCode = scheme.GetHashCode ()
- + userinfo.GetHashCode ()
- + host.GetHashCode ()
- + port
- + path.GetHashCode ()
- + query.GetHashCode ();
- return cachedHashCode;
- }
-
- public string GetLeftPart (UriPartial part)
- {
- int defaultPort;
- switch (part) {
- case UriPartial.Scheme :
- return scheme + GetSchemeDelimiter (scheme);
- case UriPartial.Authority :
- if (host == String.Empty ||
- scheme == Uri.UriSchemeMailto ||
- scheme == Uri.UriSchemeNews)
- return String.Empty;
-
- StringBuilder s = new StringBuilder ();
- s.Append (scheme);
- s.Append (GetSchemeDelimiter (scheme));
- if (path.Length > 1 && path [1] == ':' && "file".Equals (scheme))
- s.Append ('/'); // win32 file
- if (userinfo.Length > 0)
- s.Append (userinfo).Append ('@');
- s.Append (host);
- defaultPort = GetDefaultPort (scheme);
- if ((port != -1) && (port != defaultPort))
- s.Append (':').Append (port);
- return s.ToString ();
- case UriPartial.Path :
- StringBuilder sb = new StringBuilder ();
- sb.Append (scheme);
- sb.Append (GetSchemeDelimiter (scheme));
- if (path.Length > 1 && path [1] == ':' && "file".Equals (scheme))
- sb.Append ('/'); // win32 file
- if (userinfo.Length > 0)
- sb.Append (userinfo).Append ('@');
- sb.Append (host);
- defaultPort = GetDefaultPort (scheme);
- if ((port != -1) && (port != defaultPort))
- sb.Append (':').Append (port);
- sb.Append (path);
- return sb.ToString ();
- }
- return null;
- }
-
- public static int FromHex (char digit)
- {
- if ('0' <= digit && digit <= '9') {
- return (int) (digit - '0');
- }
-
- if ('a' <= digit && digit <= 'f')
- return (int) (digit - 'a' + 10);
-
- if ('A' <= digit && digit <= 'F')
- return (int) (digit - 'A' + 10);
-
- throw new ArgumentException ("digit");
- }
-
- public static string HexEscape (char character)
- {
- if (character > 255) {
- throw new ArgumentOutOfRangeException ("character");
- }
-
- return "%" + hexUpperChars [((character & 0xf0) >> 4)]
- + hexUpperChars [((character & 0x0f))];
- }
-
- public static char HexUnescape (string pattern, ref int index)
- {
- if (pattern == null)
- throw new ArgumentException ("pattern");
-
- if (index < 0 || index >= pattern.Length)
- throw new ArgumentOutOfRangeException ("index");
-
- if (((index + 3) > pattern.Length) ||
- (pattern [index] != '%') ||
- !IsHexDigit (pattern [index + 1]) ||
- !IsHexDigit (pattern [index + 2]))
- {
- return pattern[index++];
- }
-
- index++;
- return (char) ((FromHex (pattern [index++]) << 4) + FromHex (pattern [index++]));
- }
-
- public static bool IsHexDigit (char digit)
- {
- return (('0' <= digit && digit <= '9') ||
- ('a' <= digit && digit <= 'f') ||
- ('A' <= digit && digit <= 'F'));
- }
-
- public static bool IsHexEncoding (string pattern, int index)
- {
- if ((index + 3) > pattern.Length)
- return false;
-
- return ((pattern [index++] == '%') &&
- IsHexDigit (pattern [index++]) &&
- IsHexDigit (pattern [index]));
- }
-
- public string MakeRelative (Uri toUri)
- {
- if ((this.Scheme != toUri.Scheme) ||
- (this.Authority != toUri.Authority))
- return toUri.ToString ();
-
- if (this.path == toUri.path)
- return String.Empty;
-
- string [] segments = this.Segments;
- string [] segments2 = toUri.Segments;
-
- int k = 0;
- int max = Math.Max (segments.Length, segments2.Length);
- for (; k < max; k++)
- if (segments [k] != segments2 [k])
- break;
-
- string result = String.Empty;
- for (int i = k + 1; i < segments.Length; i++)
- result += "../";
- for (int i = k; i < segments2.Length; i++)
- result += segments2 [i];
-
- return result;
- }
-
- public override string ToString ()
- {
- if (cachedToString != null)
- return cachedToString;
-
- cachedToString = Unescape (AbsoluteUri);
-
- return cachedToString;
- }
-
- [MonoTODO]
- public void GetObjectData (SerializationInfo info,
- StreamingContext context)
- {
- // TODO: check whether this is compatible with ms.net
- info.AddValue ("Uri", this.AbsoluteUri);
- }
-
-
- // Internal Methods
-
- protected static string EscapeString (string str)
- {
- return EscapeString (str, false, true, true);
- }
-
- internal static string EscapeString (string str, bool escapeReserved, bool escapeHex, bool escapeBrackets)
- {
- if (str == null)
- return String.Empty;
-
- StringBuilder s = new StringBuilder ();
- int len = str.Length;
- for (int i = 0; i < len; i++) {
- char c = str [i];
- // reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
- // mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
- // control = <US-ASCII coded characters 00-1F and 7F hexadecimal>
- // space = <US-ASCII coded character 20 hexadecimal>
- // delims = "<" | ">" | "#" | "%" | <">
- // unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"
-
- if ((c <= 0x20) || (c >= 0x7f) ||
- ("<>%\"{}|\\^`".IndexOf (c) != -1) ||
- (escapeHex && (c == '#')) ||
- (escapeBrackets && (c == '[' || c == ']')) ||
- (escapeReserved && (";/?:@&=+$,".IndexOf (c) != -1))) {
- s.Append (HexEscape (c));
- continue;
- }
-
- s.Append (c);
- }
-
- return s.ToString ();
- }
-
- protected virtual string Unescape (string str)
- {
- if (str == null)
- return String.Empty;
- StringBuilder s = new StringBuilder ();
- int len = str.Length;
- for (int i = 0; i < len; i++) {
- char c = str [i];
- if (c == '%') {
- s.Append (HexUnescape (str, ref i));
- i--;
- } else
- s.Append (c);
- }
- return s.ToString ();
- }
-
-
- // Private Methods
-
- // this parse method is as relaxed as possible about the format
- // it will hardly ever throw a UriFormatException
- private void Parse (string uriString)
- {
- //
- // From RFC 2396 :
- //
- // ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
- // 12 3 4 5 6 7 8 9
- //
-
- if (uriString == null)
- throw new ArgumentNullException ("uriString");
-
- int len = uriString.Length;
- if (len <= 1)
- throw new UriFormatException ();
-
- // 1
- char c = 'x';
- int pos = 0;
- for (; pos < len; pos++) {
- c = uriString [pos];
- if ((c == ':') || (c == '/') || (c == '\\') || (c == '?') || (c == '#'))
- break;
- }
-
- // 2 scheme
- if (c == ':') {
- if (pos == 1) {
- // a windows filepath
- scheme = "file";
- path = uriString.Replace ('\\', '/');
- return;
- }
-
- scheme = uriString.Substring (0, pos).ToLower ();
- uriString = uriString.Remove (0, pos + 1);
- } else
- scheme = "file";
-
- // 3
- if ((uriString.Length >= 2) &&
- ((uriString [0] == '/') || (uriString [0] == '\\')) &&
- ((uriString [1] == '/') || (uriString [1] == '\\')))
- if ("file".Equals (scheme))
- uriString = uriString.TrimStart (new char [] {'/', '\\'});
- else
- uriString = uriString.Remove (0, 2);
-
- // 8 fragment
- pos = uriString.IndexOf ('#');
- if (pos != -1) {
- fragment = uriString.Substring (pos);
- uriString = uriString.Substring (0, pos);
- }
-
- // 6 query
- pos = uriString.IndexOf ('?');
- if (pos != -1) {
- query = uriString.Substring (pos);
- uriString = uriString.Substring (0, pos);
- }
-
- // 5 path
- pos = uriString.IndexOfAny (new char[] {'/', '\\'});
- if (pos == -1) {
- if ((scheme != Uri.UriSchemeMailto) &&
- (scheme != Uri.UriSchemeNews))
- path = "/";
- } else {
- path = uriString.Substring (pos).Replace ('\\', '/');
- uriString = uriString.Substring (0, pos);
- }
-
- // 4.a user info
- pos = uriString.IndexOf ("@");
- if (pos != -1) {
- userinfo = uriString.Substring (0, pos);
- uriString = uriString.Remove (0, pos + 1);
- }
-
- // 4.b port
- port = -1;
- pos = uriString.LastIndexOf (":");
- if (pos != -1 && pos != (uriString.Length - 1)) {
- string portStr = uriString.Remove (0, pos + 1);
- if (portStr.Length > 1 && portStr [portStr.Length - 1] != ']') {
- try {
- port = Int32.Parse (portStr);
- new System.Net.IPEndPoint (0, port); // test validity port
- uriString = uriString.Substring (0, pos);
- } catch (Exception) {
- throw new UriFormatException ("Invalid URI: invalid port number");
- }
- }
- }
- if (port == -1) {
- port = GetDefaultPort (scheme);
- }
-
- // 4 authority
- host = uriString;
- if (host.Length > 1 && host [0] == '[' && host [host.Length - 1] == ']')
- try {
- host = "[" + IPv6Address.Parse (host).ToString () + "]";
- } catch (Exception) {
- throw new UriFormatException ("Invalid URI: The hostname could not be parsed");
- }
- if (host.Length == 2 && host [1] == ':') {
- // windows filepath
- path = host + path;
- host = String.Empty;
- }
- }
-
-
- private struct UriScheme
- {
- public string scheme;
- public string delimiter;
- public int defaultPort;
-
- public UriScheme (string s, string d, int p)
- {
- scheme = s;
- delimiter = d;
- defaultPort = p;
- }
- };
-
- static UriScheme [] schemes = new UriScheme [] {
- new UriScheme (UriSchemeHttp, SchemeDelimiter, 80),
- new UriScheme (UriSchemeHttps, SchemeDelimiter, 223),
- new UriScheme (UriSchemeFtp, SchemeDelimiter, 23),
- new UriScheme (UriSchemeFile, SchemeDelimiter, -1),
- new UriScheme (UriSchemeMailto, ":", 25),
- new UriScheme (UriSchemeNews, ":", -1),
- new UriScheme (UriSchemeNntp, SchemeDelimiter, 119),
- new UriScheme (UriSchemeGopher, SchemeDelimiter, 70),
- };
-
- internal static string GetSchemeDelimiter (string scheme)
- {
- for (int i = 0; i < schemes.Length; i++)
- if (schemes [i].scheme == scheme)
- return schemes [i].delimiter;
- return Uri.SchemeDelimiter;
- }
-
- internal static int GetDefaultPort (string scheme)
- {
- for (int i = 0; i < schemes.Length; i++)
- if (schemes [i].scheme == scheme)
- return schemes [i].defaultPort;
- return -1;
- }
- }
-}
diff --git a/mcs/class/System/System/UriBuilder.cs b/mcs/class/System/System/UriBuilder.cs
deleted file mode 100644
index 241909fef87..00000000000
--- a/mcs/class/System/System/UriBuilder.cs
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// System.UriBuilder
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-using System.Text;
-
-// See RFC 2396 for more info on URI's.
-
-namespace System
-{
- public class UriBuilder
- {
- private string scheme;
- private string host;
- private int port;
- private string path;
- private string query;
- private string fragment;
- private string username;
- private string password;
-
- private Uri uri;
- private bool modified;
-
-
- // Constructors
-
- public UriBuilder () : this (Uri.UriSchemeHttp, "loopback")
- {
- }
-
- public UriBuilder (string uri) : this (new Uri (uri))
- {
- }
-
- public UriBuilder (Uri uri)
- {
- scheme = uri.Scheme;
- host = uri.Host;
- port = uri.Port;
- path = uri.AbsolutePath;
- query = uri.Query;
- fragment = uri.Fragment;
- username = uri.UserInfo;
- int pos = username.IndexOf (':');
- if (pos != -1) {
- password = username.Substring (pos + 1);
- username = username.Substring (0, pos);
- }
- modified = true;
- }
-
- public UriBuilder (string schemeName, string hostName)
- {
- Scheme = schemeName;
- Host = hostName;
- port = -1;
- Path = String.Empty; // dependent on scheme it may set path to "/"
- query = String.Empty;
- fragment = String.Empty;
- username = String.Empty;
- password = String.Empty;
- modified = true;
- }
-
- public UriBuilder (string scheme, string host, int portNumber)
- : this (scheme, host)
- {
- Port = portNumber;
- }
-
- public UriBuilder (string scheme, string host, int port, string pathValue)
- : this (scheme, host, port)
- {
- Path = pathValue;
- }
-
- public UriBuilder (string scheme, string host, int port, string pathValue, string extraValue)
- : this (scheme, host, port, pathValue)
- {
- if (extraValue == null || extraValue.Length == 0)
- return;
-
- if (extraValue [0] == '#')
- Fragment = extraValue.Remove (0, 1);
- else if (extraValue [0] == '?')
- Query = extraValue.Remove (0, 1);
- else
- throw new ArgumentException ("extraValue");
- }
-
-
- // Properties
-
- public string Fragment {
- get { return fragment; }
- set {
- fragment = value;
- if (fragment == null)
- fragment = String.Empty;
- else if (fragment.Length > 0)
- fragment = "#" + Uri.EscapeString (fragment, false, true, true).Replace ("%23", "#");
- query = String.Empty;
- modified = true;
- }
- }
-
- public string Host {
- get { return host; }
- set {
- host = (value == null) ? String.Empty : value;;
- modified = true;
- }
- }
-
- public string Password {
- get { return password; }
- set {
- password = (value == null) ? String.Empty : value;;
- modified = true;
- }
- }
-
- public string Path {
- get { return path; }
- set {
- if (value == null || value.Length == 0) {
- if ((scheme != Uri.UriSchemeMailto) &&
- (scheme != Uri.UriSchemeNews))
- path = "/";
- } else {
- path = Uri.EscapeString (value.Replace ('\\', '/'), false, true, true);
- if ((scheme != Uri.UriSchemeMailto) &&
- (scheme != Uri.UriSchemeNews) &&
- path [0] != '/')
- path = "/" + path;
- }
- modified = true;
- }
- }
-
- public int Port {
- get { return port; }
- set {
- if (value == -1) {
- port = -1;
- return;
- }
-
- // checks whether port number is valid
- new System.Net.IPEndPoint (0, value);
-
- // apparently it is
- port = value;
- modified = true;
- }
- }
-
- public string Query {
- get { return query; }
- set {
- // LAMESPEC: it doesn't say to always prepend a
- // question mark to the value.. it does say this
- // for fragment.
- query = value;
- if (query == null)
- query = String.Empty;
- else if (query.Length > 0)
- query = "?" + Uri.EscapeString (query, false, true, true);
- fragment = String.Empty;
- modified = true;
- }
- }
-
- public string Scheme {
- get { return scheme; }
- set {
- if (value == null)
- value = String.Empty;
- int colonPos = value.IndexOf (':');
- if (colonPos != -1)
- value = value.Substring (0, colonPos);
- scheme = value.ToLower ();
- modified = true;
- }
- }
-
- public Uri Uri {
- get {
- if (!modified)
- return uri;
-
- StringBuilder s = new StringBuilder ();
- s.Append (scheme);
- s.Append (Uri.GetSchemeDelimiter (scheme));
- if (username.Length > 0) {
- string userinfo = username;
- if (password.Length > 0)
- userinfo += ":" + password;
- s.Append (userinfo).Append ('@');
- }
- s.Append (host);
- if (port != -1)
- s.Append (':').Append (port);
- s.Append (path);
- s.Append (query);
- s.Append (fragment);
-
- uri = new Uri (s.ToString (), true);
- modified = false;
- return uri;
- }
- }
-
- public string UserName {
- get { return username; }
- set {
- username = (value == null) ? String.Empty : value;;
- modified = true;
- }
- }
-
- // Methods
-
- public override bool Equals (object rparam)
- {
- return (rparam == null) ? false : this.Uri.Equals (rparam.ToString ());
- }
-
- public override int GetHashCode ()
- {
- return this.Uri.GetHashCode ();
- }
-
- public override string ToString ()
- {
- return this.Uri.ToString ();
- }
- }
-}
-
diff --git a/mcs/class/System/System/UriFormatException.cs b/mcs/class/System/System/UriFormatException.cs
deleted file mode 100755
index 8bd1813602f..00000000000
--- a/mcs/class/System/System/UriFormatException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.UriFormatException.cs
-//
-// Author:
-// Scott Sanders (scott@stonecobra.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Scott Sanders
-// (C) 2002 Ximian, Inc.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class UriFormatException : FormatException, ISerializable
- {
-
- // Constructors
- public UriFormatException ()
- : base (Locale.GetText ("Invalid URI format"))
- {
- }
-
- public UriFormatException (string message)
- : base (message)
- {
- }
-
- protected UriFormatException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- // Methods
- void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
- }
-}
-
diff --git a/mcs/class/System/System/UriHostNameType.cs b/mcs/class/System/System/UriHostNameType.cs
deleted file mode 100755
index e2e57d4f33b..00000000000
--- a/mcs/class/System/System/UriHostNameType.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// UriHostNameType.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:33:14 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum UriHostNameType {
-
- /// <summary>
- /// </summary>
- Unknown = 0,
-
- /// <summary>
- /// </summary>
- Basic = 1,
-
- /// <summary>
- /// </summary>
- Dns = 2,
-
- /// <summary>
- /// </summary>
- IPv4 = 3,
-
- /// <summary>
- /// </summary>
- IPv6 = 4,
- } // UriHostNameType
-
-} // System
diff --git a/mcs/class/System/System/UriPartial.cs b/mcs/class/System/System/UriPartial.cs
deleted file mode 100755
index 21cb52f8dbe..00000000000
--- a/mcs/class/System/System/UriPartial.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// UriPartial.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:33:21 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum UriPartial {
-
- /// <summary>
- /// </summary>
- Scheme = 0,
-
- /// <summary>
- /// </summary>
- Authority = 1,
-
- /// <summary>
- /// </summary>
- Path = 2,
- } // UriPartial
-
-} // System
diff --git a/mcs/class/System/Test/.cvsignore b/mcs/class/System/Test/.cvsignore
deleted file mode 100644
index 6a7461313bb..00000000000
--- a/mcs/class/System/Test/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.dll
diff --git a/mcs/class/System/Test/AllTests.cs b/mcs/class/System/Test/AllTests.cs
deleted file mode 100644
index 923916f47e6..00000000000
--- a/mcs/class/System/Test/AllTests.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// MonoTests.AllTests, System.dll
-//
-// Author:
-// Mario Martinez (mariom925@home.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-namespace MonoTests
-{
- /// <summary>
- /// Combines all unit tests for the System.dll assembly
- /// into one test suite.
- /// </summary>
- public class AllTests : TestCase
- {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
- suite.AddTest (System.AllTests.Suite);
- suite.AddTest (System.Collections.Specialized.AllTests.Suite);
- suite.AddTest (System.Diagnostics.AllTests.Suite);
- suite.AddTest (System.Net.AllTests.Suite);
- suite.AddTest (System.Net.Sockets.AllTests.Suite);
- suite.AddTest (System.Text.RegularExpressions.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System/Test/BasicOperationsTest.cs b/mcs/class/System/Test/BasicOperationsTest.cs
deleted file mode 100755
index 2b078956790..00000000000
--- a/mcs/class/System/Test/BasicOperationsTest.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-// created on 7/21/2001 at 2:36 PM
-
-
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections.Specialized {
-
-
- public class BasicOperationsTest : TestCase {
-
- protected NameValueCollection nvc;
- private static Random rnd;
-
- public BasicOperationsTest() : base("MonoTests.System.Collections.Specialized.BasicOperationsTest testsuite") {}
- public BasicOperationsTest(String name) : base(name) {}
-
- protected override void SetUp() {
- nvc = new NameValueCollection();
- rnd=new Random();
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(BasicOperationsTest));
- }
- }
-
-
-
- private void SetDefaultData() {
- nvc.Clear();
- nvc.Add("k1","this");
- nvc.Add("k2","test");
- nvc.Add("k3","is");
- nvc.Add("k4","silly");
- }
- private static string FormatForPrinting(NameValueCollection nv)
- {
- if (nv==null)
- return null;
- int max = nv.Count;
- StringBuilder sb = new StringBuilder("-\t-Key-\t-Value-\n");
- for (int i=0; i<max; i++){
-
- sb.Append("\t"+nv.GetKey(i)+"\t"+nv[i]+"\n");
- }
- return sb.ToString();
- }
-
-
- public void TestAddRemoveClearSetGet()
- {
- nvc.Clear();
- Assert(nvc.Count==0&& !nvc.HasKeys());
-
- SetDefaultData();
- Assert(nvc.Count==4);
- Assert("Get operation returns wrong result.\n"+FormatForPrinting(nvc),(nvc.Get(0).Equals("this"))&&(nvc.Get("k1").Equals("this")));
-
-
- nvc.Add("k2","programmer");
- Assert(nvc["k2"].Equals("test,programmer"));
-
- nvc["k2"]="project";
- nvc.Add("k2","project");
- Assert(nvc.Count==4);
- Assert("Wrong effect of add(samekey,samevalue)\n"+FormatForPrinting(nvc),nvc["k2"].Equals("project"));
- // TODO: add Remove test
- nvc.Remove("k4");
- Assert("wrong nvc.Count="+nvc.Count,nvc.Count==3);
- Assert(nvc["k4"]==null);
-
- NameValueCollection nvc1 = new NameValueCollection();
- nvc1["k1"]="these";
- nvc1["k5"]="!";
- nvc.Add(nvc1);
- Assert(FormatForPrinting(nvc)+"Count is wrong after Add(nvc1) Count="+nvc.Count,nvc.Count==4);
- Assert("Values are wrong after Add(nvc1)",(nvc["k1"].Equals("this,these"))&&(nvc["k5"].Equals("!")));
-
- nvc.Set("k3","accomplished");
- Assert("Wrong result of Set operation",nvc["k3"].Equals("accomplished"));
-
- }
-
- public void TestGetKeyGetValues()
- {
- SetDefaultData();
- Assert(nvc.GetKey(0).Equals("k1"));
- string[] values = nvc.GetValues(0);
- Assert(values[0].Equals("this"));
-
- }
-
- public void TestCopyTo() {
- SetDefaultData();
- string[] entries=new string[nvc.Count];
- nvc.CopyTo(entries,0);
- //Message(FormatForPrinting(nvc));
- //Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
- public void TestUnderHeavyLoad() {
-
- //TODO: add memory and time measurement
-
- nvc.Clear();
- int max=10000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (nvc[key]==null) {
- nvc[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(nvc.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=nvc[key] as String;
- String err="nvc[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- nvc.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(nvc[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=nvc[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- }
-
- }
-}
-
diff --git a/mcs/class/System/Test/ChangeLog b/mcs/class/System/Test/ChangeLog
deleted file mode 100644
index b0784f1ebaa..00000000000
--- a/mcs/class/System/Test/ChangeLog
+++ /dev/null
@@ -1,84 +0,0 @@
-2002/05/17 Lawrence Pit <loz@cable.a2000.nl>
-
- * AllTests.cs: added call to System.Net.Sockets.AllTests.cs
-
-2002/05/14 Lawrence Pit <loz@cable.a2000.nl>
-
- * Dnstest.cs: added test for asynchronous methods
-
-2002/05/09 Lawrence Pit <loz@cable.a2000.nl>
-
- * AllTests.cs: added System.AllTests
- * Moved 2 files to the System.Collections.Specialized dir
-
-2002/05/07 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Run the System.Net tests from here.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Update build file to run correct class in the test dll.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs:
- * BasicOperationsTest.cs:
- * DnsTest.cs:
- * NameValueCollectionTest.cs:
- * StringCollectionTest.cs:
- * TheTests.cs:
- * System.Text.RegularExpressions/AllTests.cs:
- * System.Text.RegularExpressions/PerlTest.cs:
- * System.Text.RegularExpressions/PerlTrials.cs:
- * System.Text.RegularExpressions/RegexTrial.cs: Fix Namespace
- inconsistancies. Use MonoTests instead of Ximian.Mono.Tests
-
-2002-04-07 Jonathan Pryor <jonpryor@vt.edu>
-
- * AllTests.cs: Added System.Diagnostics tests, as they work now.
-
-2002/03/08 Nick Drochak <ndrochak@gol.com>
-
- * System.XML_test.build: Don't build test dll by default. Only build
- it when 'make test' is specified.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- * System.Text.RegularExpressions/*.cs: Put everything into namespace
- Ximian.Mono.Tests.System.Text.RegularExpressions.
-
- * System_test.build: Build new executable RunTests.System.exe which you can
- use to run the tests on Linux.
-
- * NameValueCollectionTest.cs: Split out BasicOperationTest into
- BasicOperationTest.cs.
-
- * AllTests.cs: Use namespace Ximian.Mono.Tests.System instead of
- Ximian.Mono.Tests.
-
- * DnsTest.cs: Put this into namespace Ximian.Mono.Tests.Systeam.
- * NameValueCollectionTest.cs: Likewise.
- * StringCollectionTest.cs: Likewise.
-
-2002-02-11 Duncan Mak <duncan@ximian.com>
-
- * AllTests.cs: Removed entry for IPHostEntryTest.cs because Mads
- removed it and included it in the new DnsTest.cs. This fixes the build.
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * DnsTest.cs: Updated test.
-
-2001-09-26 Mads Pultz <mpultz@get2net.dk>
- * DnsTest.cs: initial tests of BeginGetHostByName and EndGetHostByName implemented.
-
-2001-09-24 Mads Pultz <mpultz@get2net.dk>
-
- * DnsTest.cs: now tests GetHostByAddress, GetHostByName,
- IpToString and Resolve.
-
-2001-09-23 Mads Pultz <mpultz@get2net.dk>
-
- * DnsTest.cs: Initial work submitted to repository.
- * IPHostEntryTest.cs: Initial work submitted to repository.
-
diff --git a/mcs/class/System/Test/System.Collections.Specialized/AllTests.cs b/mcs/class/System/Test/System.Collections.Specialized/AllTests.cs
deleted file mode 100644
index 5956415bda7..00000000000
--- a/mcs/class/System/Test/System.Collections.Specialized/AllTests.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// MonoTests.System.Collections.Specialized.AllTests, System.dll
-//
-// Author:
-// Lawrence Pit <loz@cable.a2000nl>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System.Collections.Specialized {
-
- public class AllTests : TestCase {
-
- public AllTests (string name) : base (name)
- {
- }
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (BitVector32Test.Suite);
- suite.AddTest (HybridDictionaryTest.Suite);
- suite.AddTest (NameValueCollectionTest.Suite);
- suite.AddTest (StringCollectionTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/Test/System.Collections.Specialized/BitVector32Test.cs b/mcs/class/System/Test/System.Collections.Specialized/BitVector32Test.cs
deleted file mode 100644
index 883deed976f..00000000000
--- a/mcs/class/System/Test/System.Collections.Specialized/BitVector32Test.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// BitVector32Test.cs - NUnit Test Cases for System.Net.BitVector32
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace MonoTests.System.Collections.Specialized
-{
- public class BitVector32Test : TestCase
- {
- public BitVector32Test () :
- base ("[MonoTests.System.Net.BitVector32Test]") {}
-
- public BitVector32Test (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (BitVector32Test));
- }
- }
-
- public void TestConstructors ()
- {
- BitVector32 b = new BitVector32 (31);
- }
-
- public void TestIndexers ()
- {
- BitVector32 b = new BitVector32 (7);
- Assert ("#1", b [0]);
- Assert ("#2", b [1]);
- Assert ("#3", b [2]);
- Assert ("#4", b [4]);
- Assert ("#5", !b [8]);
- Assert ("#6", !b [16]);
- b [8] = true;
- Assert ("#7", b [4]);
- Assert ("#8", b [8]);
- Assert ("#9", !b [16]);
- b [8] = false;
- Assert ("#10", b [4]);
- Assert ("#11", !b [8]);
- Assert ("#12", !b [16]);
-
- BitVector32.Section s = BitVector32.CreateSection (31);
- s = BitVector32.CreateSection (64, s);
- // Print (s);
-
- // b = new BitVector32 (0x777777);
- BitVector32 b1 = new BitVector32 (0xffff77);
- BitVector32 b2 = new BitVector32 (b1 [s]);
- //Console.WriteLine (b1.ToString ());
- //Console.WriteLine (b2.ToString ());
- AssertEquals ("#14", 123, b1 [s]);
-
- // b1 [s] = 15;
- //Console.WriteLine (b1.ToString ());
- }
-
- public void TestCreateMask ()
- {
- AssertEquals ("#1", 1, BitVector32.CreateMask ());
- AssertEquals ("#2", 1, BitVector32.CreateMask (0));
- AssertEquals ("#3", 2, BitVector32.CreateMask (1));
- AssertEquals ("#4", 32, BitVector32.CreateMask (16));
- AssertEquals ("#6", -2, BitVector32.CreateMask (Int32.MaxValue));
- AssertEquals ("#5", -4, BitVector32.CreateMask (-2));
- try {
- BitVector32.CreateMask (Int32.MinValue);
- Fail ("#7");
- } catch (InvalidOperationException) {}
- }
-
- public void TestCreateSection ()
- {
- BitVector32.Section s = BitVector32.CreateSection (1);
- AssertEquals ("#1", (short) 1, s.Mask);
-
- s = BitVector32.CreateSection (2);
- AssertEquals ("#2", (short) 3, s.Mask);
-
- s = BitVector32.CreateSection (3);
- AssertEquals ("#3", (short) 3, s.Mask);
-
- s = BitVector32.CreateSection (5);
- AssertEquals ("#4", (short) 7, s.Mask);
-
- s = BitVector32.CreateSection (20);
- AssertEquals ("#4", (short) 0x1f, s.Mask);
-
- s = BitVector32.CreateSection (Int16.MaxValue);
- AssertEquals ("#5", (short) 0x7fff, s.Mask);
-
- s = BitVector32.CreateSection (Int16.MaxValue - 100);
- AssertEquals ("#6", (short) 0x7fff, s.Mask);
-
- try {
- BitVector32.Section s2 = BitVector32.CreateSection (0);
- Fail ("#7");
- } catch (ArgumentException) {}
-
- try {
- BitVector32.Section s2 = BitVector32.CreateSection (-1);
- Fail ("#8");
- } catch (ArgumentException) {}
-
- try {
- BitVector32.Section s2 = BitVector32.CreateSection (Int16.MinValue);
- Fail ("#9");
- } catch (ArgumentException) {}
-
- s = BitVector32.CreateSection (20);
- AssertEquals ("#10a", (short) 0x1f, s.Mask);
- AssertEquals ("#10b", (short) 0x00, s.Offset);
- s = BitVector32.CreateSection (120, s);
- AssertEquals ("#10c", (short) 0x7f, s.Mask);
- AssertEquals ("#10d", (short) 0x05, s.Offset);
- s = BitVector32.CreateSection (1000, s);
- AssertEquals ("#10e", (short) 0x3ff, s.Mask);
- AssertEquals ("#10f", (short) 0x0c, s.Offset);
- }
-
-
- private void Print (BitVector32.Section s)
- {
- Console.WriteLine (s.ToString () + " : "+ s.Mask + " : " + s.Offset);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/Test/System.Collections.Specialized/ChangeLog b/mcs/class/System/Test/System.Collections.Specialized/ChangeLog
deleted file mode 100644
index 2904bc5391d..00000000000
--- a/mcs/class/System/Test/System.Collections.Specialized/ChangeLog
+++ /dev/null
@@ -1,7 +0,0 @@
-2002-05-11 Lawrence Pit <loz@cable.a2000.nl>
-
- * Added NameValueCollectionTest.TestGetValues
-
-2002-05-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * Moved StringCollectionTest.cs and NameValueCollectionTest to this dir
diff --git a/mcs/class/System/Test/System.Collections.Specialized/HybridDictionaryTest.cs b/mcs/class/System/Test/System.Collections.Specialized/HybridDictionaryTest.cs
deleted file mode 100644
index cdcc74c4e31..00000000000
--- a/mcs/class/System/Test/System.Collections.Specialized/HybridDictionaryTest.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// HybridDictionaryTest.cs - NUnit Test Cases for System.Net.HybridDictionary
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-
-namespace MonoTests.System.Collections.Specialized
-{
- public class HybridDictionaryTest : TestCase
- {
- public HybridDictionaryTest () :
- base ("[MonoTests.System.Net.HybridDictionaryTest]") {}
-
- public HybridDictionaryTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (HybridDictionaryTest));
- }
- }
-
- public void TestAll ()
- {
- HybridDictionary dict = new HybridDictionary (true);
- dict.Add ("CCC", "ccc");
- dict.Add ("BBB", "bbb");
- dict.Add ("fff", "fff");
- dict ["EEE"] = "eee";
- dict ["ddd"] = "ddd";
-
- AssertEquals ("#1", 5, dict.Count);
- AssertEquals ("#2", "eee", dict ["eee"]);
-
- dict.Add ("CCC2", "ccc");
- dict.Add ("BBB2", "bbb");
- dict.Add ("fff2", "fff");
- dict ["EEE2"] = "eee";
- dict ["ddd2"] = "ddd";
- dict ["xxx"] = "xxx";
- dict ["yyy"] = "yyy";
-
- AssertEquals ("#3", 12, dict.Count);
- AssertEquals ("#4", "eee", dict ["eee"]);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/System/Test/System.Collections.Specialized/NameValueCollectionTest.cs b/mcs/class/System/Test/System.Collections.Specialized/NameValueCollectionTest.cs
deleted file mode 100644
index dd066f4d225..00000000000
--- a/mcs/class/System/Test/System.Collections.Specialized/NameValueCollectionTest.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// created on 7/21/2001 at 2:36 PM
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections.Specialized {
-
-
- /// <summary>Microsoft NameValueCollection test.</summary>
- public class NameValueCollectionTest : TestCase {
-
- public NameValueCollectionTest() : base("MonoTests.System.Collections.Specialized.NameValueCollectionTest testsuite") {}
- public NameValueCollectionTest(String name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(NameValueCollectionTest));
- }
- }
-
- public void TestGetValues ()
- {
- NameValueCollection col = new NameValueCollection ();
- col.Add ("foo1", "bar1");
- AssertEquals ("#1", null, col.GetValues (null));
- AssertEquals ("#2", null, col.GetValues (""));
- AssertEquals ("#3", null, col.GetValues ("NotExistent"));
- }
- }
-}
-
diff --git a/mcs/class/System/Test/System.Collections.Specialized/StringCollectionTest.cs b/mcs/class/System/Test/System.Collections.Specialized/StringCollectionTest.cs
deleted file mode 100644
index 839970cd786..00000000000
--- a/mcs/class/System/Test/System.Collections.Specialized/StringCollectionTest.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-/* System.Collections.Specialized.StringCollection.cs
- * Authors:
- * John Barnette (jbarn@httcb.net)
- *
- * Copyright (C) 2001 John Barnette
-*/
-
-using NUnit.Framework;
-using System.Collections.Specialized;
-
-namespace MonoTests.System.Collections.Specialized {
- public class StringCollectionTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof (StringCollectionTest));
- }
- }
-
- private StringCollection sc;
- string[] strings = {
- "foo",
- "bar",
- "baz",
- "john",
- "paul",
- "george",
- "ringo"
- };
-
- public StringCollectionTest() : base("MonoTests.System.Collections.Specialized.StringCollectionTest testsuite") {}
- public StringCollectionTest(string name) : base(name) {}
-
- protected override void SetUp() {
- sc = new StringCollection();
- sc.AddRange(strings);
- }
-
- // Simple Tests
-
- public void TestSimpleCount() {
- Assert(sc.Count == 7);
- }
-
- public void TestSimpleIsReadOnly() {
- Assert(!sc.IsReadOnly);
- }
-
- public void TestSimpleIsSynchronized() {
- Assert(!sc.IsSynchronized);
- }
-
- public void TestSimpleItemGet() {
- for(int i = 0; i < strings.Length; i++) {
- Assert(strings[i].Equals(sc[i]));
- }
- }
-
- public void TestSimpleItemSet() {
- sc[0] = "bob";
- Assert(sc[0].Equals("bob"));
- }
-
- public void TestSimpleSyncRoot() {
- Assert(sc.Equals(sc.SyncRoot));
- }
-
- public void TestSimpleAdd() {
- int index = sc.Add("chuck");
- Assert(index == strings.Length);
- Assert(sc[strings.Length].Equals("chuck"));
-
- }
-
- public void TestSimpleAddRange() {
- string[] newStrings = {
- "peter",
- "paul",
- "mary"
- };
-
- int index = sc.Count;
- sc.AddRange(newStrings);
-
- Assert(sc.Count == index + newStrings.Length);
-
- for (int i = 0; i+index <= sc.Count-1; i++) {
- Assert(newStrings[i].Equals(sc[i+index]));
- }
- }
-
- public void TestSimpleClear() {
- sc.Clear();
- Assert(sc.Count == 0);
- }
-
- public void TestSimpleContains() {
- Assert(sc.Contains(strings[0]));
- Assert(!sc.Contains("NOT CONTAINED"));
- }
-
- public void TestSimpleCopyTo() {
- string[] copyArray = new string[sc.Count];
- sc.CopyTo(copyArray, 0);
- for (int i = 0; i < copyArray.Length; i++) {
- Assert(copyArray[i] == sc[i]);
- }
- }
-
- public void TestSimpleGetEnumerator() {
- int index = 0;
- foreach(string s in sc) {
- Assert(s.Equals(strings[index]));
- index++;
- }
- }
-
- public void TestSimpleIndexOf() {
- Assert(sc.IndexOf(strings[0]) == 0);
- }
-
- public void TestSimpleInsert() {
- int index = 3;
- int oldCount = sc.Count;
- string before = sc[index - 1];
- string current = sc[index];
- string after = sc[index + 1];
- string newStr = "paco";
-
- sc.Insert(index, newStr);
-
- Assert(sc.Count == oldCount + 1);
- Assert(sc[index].Equals(newStr));
- Assert(sc[index-1].Equals(before));
- Assert(sc[index+1].Equals(current));
- Assert(sc[index+2].Equals(after));
- }
-
- public void TestSimpleRemove() {
- int oldCount = sc.Count;
- sc.Remove(strings[0]);
- Assert(oldCount == sc.Count + 1);
- Assert(!sc.Contains(strings[0]));
- }
-
- public void TestSimpleRemoveAt() {
- int index = 3;
- int oldCount = sc.Count;
- string after = sc[index+1];
-
- sc.RemoveAt(index);
- Assert(oldCount == sc.Count + 1);
- Assert(sc[index].Equals(after));
- }
-
- }
-}
diff --git a/mcs/class/System/Test/System.Diagnostics/AllTests.cs b/mcs/class/System/Test/System.Diagnostics/AllTests.cs
deleted file mode 100644
index 2f5cdb7d305..00000000000
--- a/mcs/class/System/Test/System.Diagnostics/AllTests.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// MonoTests.System.Diagnostics.AllTests, System.dll
-//
-// Author:
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) 2002 Jonathan Pryor
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System.Diagnostics {
-
- public class AllTests : TestCase {
-
- public AllTests(string name) : base(name)
- {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
- suite.AddTest (MonoTests.System.Diagnostics.TraceTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/Test/System.Diagnostics/ChangeLog b/mcs/class/System/Test/System.Diagnostics/ChangeLog
deleted file mode 100644
index c4a7195d06d..00000000000
--- a/mcs/class/System/Test/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,14 +0,0 @@
-2002-06-16 Jonathan Pryor <jonpryor@vt.edu>
- * TraceTest.cs: Added additional test cases.
-
-2002-04-07 Jonathan Pryor <jonpryor@vt.edu>
-
- * TraceTest.cs: Removed extraneous output; renamed test case so that NUnit
- would find it.
-
-2002-03-10 Jonathan Pryor <jonpryor@vt.edu>
-
- * Initial creation of System.Diagnostics test directory
- * AllTests.cs: file added
- * TraceTest.cs: Test System.Diagnostics.Trace class
-
diff --git a/mcs/class/System/Test/System.Diagnostics/TraceTest.cs b/mcs/class/System/Test/System.Diagnostics/TraceTest.cs
deleted file mode 100644
index e284f27407a..00000000000
--- a/mcs/class/System/Test/System.Diagnostics/TraceTest.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-//
-// TraceTest.cs - NUnit Test Cases for System.Diagnostics.Trace
-//
-// Jonathan Pryor (jonpryor@vt.edu)
-//
-// (C) Jonathan Pryor
-//
-
-// We want tracing enabled, so...
-#define TRACE
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Diagnostics;
-
-namespace MonoTests.System.Diagnostics {
-
- public class TraceTest : TestCase {
-
- private StringWriter buffer;
- private TraceListener listener;
-
- public TraceTest ()
- : base ("System.Diagnostics.Trace testsuite")
- {
- }
-
- public TraceTest (string name)
- : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- // We don't want to deal with the default listener, which can send the
- // output to various places (Debug stream, Console.Out, ...)
- // Trace.Listeners.Remove ("Default");
-
- buffer = new StringWriter ();
-
- listener = new TextWriterTraceListener (buffer, "TestOutput");
-
- Trace.Listeners.Add (listener);
-
- Trace.AutoFlush = true;
-
- }
-
- protected override void TearDown ()
- {
- // Trace.Listeners.Add (new DefaultTraceListener ());
- Trace.Listeners.Remove (listener);
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (TraceTest));
- }
- }
-
- // Make sure that when we get the output we expect....
- public void TestTracing ()
- {
- string value =
- "Entering Main" + Environment.NewLine +
- "Exiting Main" + Environment.NewLine;
-
- Trace.WriteLine ("Entering Main");
- Trace.WriteLine ("Exiting Main");
-
- AssertEquals ("#Tr01", value, buffer.ToString ());
- }
-
- // Make sure we get the output we expect in the presence of indenting...
- public void TestIndent ()
- {
- Console.Error.WriteLine ("TraceTest.TestIndent");
- string value =
- "List of errors:" + Environment.NewLine +
- " Error 1: File not found" + Environment.NewLine +
- " Error 2: Directory not found" + Environment.NewLine +
- "End of list of errors" + Environment.NewLine;
-
- Trace.WriteLine ("List of errors:");
- Trace.Indent ();
- Trace.WriteLine ("Error 1: File not found");
- Trace.WriteLine ("Error 2: Directory not found");
- Trace.Unindent ();
- Trace.WriteLine ("End of list of errors");
-
- AssertEquals ("#In01", value, buffer.ToString());
- }
-
- // Make sure that TraceListener properties (IndentLevel, IndentSize) are
- // modified when the corresponding Trace properties are changed.
- public void TestAddedTraceListenerProperties ()
- {
- TraceListener t1 = new TextWriterTraceListener (Console.Out);
- TraceListener t2 = new TextWriterTraceListener (Console.Error);
- Trace.Listeners.Add(t1);
- Trace.Listeners.Add(t2);
-
- const int ExpectedSize = 5;
- const int ExpectedLevel = 2;
-
- Trace.IndentSize = ExpectedSize;
- Trace.IndentLevel = ExpectedLevel;
-
- foreach (TraceListener t in Trace.Listeners) {
- string ids = "#TATLP-S-" + t.Name;
- string idl = "#TATLP-L-" + t.Name;
- AssertEquals (ids, ExpectedSize, t.IndentSize);
- AssertEquals (idl, ExpectedLevel, t.IndentLevel);
- }
-
- Trace.Listeners.Remove(t1);
- Trace.Listeners.Remove(t2);
- }
-
- // Make sure that the TraceListener properties (IndentLevel, IndentSize)
- // are properly modified when the TraceListener is added to the
- // collection.
- public void TestListeners_Add_Values()
- {
- const int ExpectedLevel = 5;
- const int ExpectedSize = 3;
- Trace.IndentLevel = ExpectedLevel;
- Trace.IndentSize = ExpectedSize;
- TraceListener tl = new TextWriterTraceListener(Console.Out);
-
- tl.IndentLevel = 2*ExpectedLevel;
- tl.IndentSize = 2*ExpectedSize;
-
- Trace.Listeners.Add(tl);
-
- // Assert that the listener we added has been set to the correct indent
- // level.
- AssertEquals ("#LATL-L", ExpectedLevel, tl.IndentLevel);
- AssertEquals ("#LATL-S", ExpectedSize, tl.IndentSize);
-
- // Assert that all listeners in the collection have the same level.
- foreach (TraceListener t in Trace.Listeners)
- {
- string idl = "#LATL-L:" + t.Name;
- string ids = "#LATL-S:" + t.Name;
- AssertEquals(idl, ExpectedLevel, t.IndentLevel);
- AssertEquals(ids, ExpectedSize, t.IndentSize);
- }
- }
-
- // IndentSize, IndentLevel are thread-static
- }
-}
-
diff --git a/mcs/class/System/Test/System.Net.Sockets/AllTests.cs b/mcs/class/System/Test/System.Net.Sockets/AllTests.cs
deleted file mode 100644
index fdff9250947..00000000000
--- a/mcs/class/System/Test/System.Net.Sockets/AllTests.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// MonoTests.System.Net.Sockets.AllTests, System.dll
-//
-// Author:
-// Lawrence Pit <loz@cable.a2000nl>
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net.Sockets {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
-
- public AllTests (string name) : base (name) {}
-
- public static ITest Suite {
- get
- {
- TestSuite suite = new TestSuite ();
- #if NETWORKTEST
- suite.AddTest (TcpListenerTest.Suite);
- suite.AddTest (TcpClientTest.Suite);
- //suite.AddTest (UdpClientTest.Suite);
- #endif
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/Test/System.Net.Sockets/ChangeLog b/mcs/class/System/Test/System.Net.Sockets/ChangeLog
deleted file mode 100644
index 09eef5e988b..00000000000
--- a/mcs/class/System/Test/System.Net.Sockets/ChangeLog
+++ /dev/null
@@ -1,6 +0,0 @@
-2002-05-17 Lawrence Pit <loz@cable.a2000.nl>
-
- * AllTests.cs: added
-
-
-
diff --git a/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs b/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
deleted file mode 100755
index f7b39fd5050..00000000000
--- a/mcs/class/System/Test/System.Net.Sockets/TcpClientTest.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// System.Net.Sockets.TcpClientTest.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net.Sockets {
-
- /// <summary>
- /// Tests System.Net.Sockets.TcpClient
- /// </summary>
- public class TcpClientTest : TestCase {
-
- public TcpClientTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof (TcpClientTest));
- }
- }
-
- /// <summary>
- /// Tests the TcpClient object
- /// (from System.Net.Sockets)
- /// </summary>
- public void test_TcpClient()
- {
- // set up a listening Socket
- Socket lSock = new Socket(AddressFamily.InterNetwork,
- SocketType.Stream, ProtocolType.Tcp);
-
- lSock.Bind(new IPEndPoint(IPAddress.Any, 1234));
- lSock.Listen(-1);
-
-
- // connect to it with a TcpClient
- TcpClient outClient = new TcpClient("localhost", 1234);
- Socket inSock = lSock.Accept();
-
-
- // now try exchanging data
- NetworkStream stream = outClient.GetStream();
-
- const int len = 1024;
- byte[] outBuf = new Byte[len];
- for (int i=0; i<len; i++)
- {
- outBuf[i] = (byte)(i % 256);
- }
-
- // send it
- stream.Write(outBuf,0,len);
-
- // and see if it comes back
- byte[] inBuf = new Byte[len];
- int ret = inSock.Receive(inBuf, 0, len, 0);
- Assert(ret != 0);
-
- for (int i=0; i<len; i++)
- {
- Assert(inBuf[i] == outBuf[i]);
- }
-
-
- // tidy up
- inSock.Close();
- outClient.Close();
- lSock.Close();
-
- }
-
- }
-
-}
diff --git a/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs b/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
deleted file mode 100755
index a07d6bfcb9e..00000000000
--- a/mcs/class/System/Test/System.Net.Sockets/TcpListenerTest.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// System.Net.Sockets.TcpListenerTest.cs
-//
-// Author:
-// Phillip Pearson (pp@myelin.co.nz)
-//
-// Copyright (C) 2001, Phillip Pearson
-// http://www.myelin.co.nz
-//
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net.Sockets {
-
- /// <summary>
- /// Tests System.Net.Sockets.TcpListener
- /// </summary>
- public class TcpListenerTest : TestCase {
-
- public TcpListenerTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof (TcpListenerTest));
- }
- }
-
- /// <summary>
- /// Tests the TcpListener object
- /// (from System.Net.Sockets)
- /// </summary>
- public void test_TcpListener()
- {
- // listen with a new listener
- TcpListener inListener = new TcpListener(1234);
- inListener.Start();
-
-
- // connect to it from a new socket
- Socket outSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
- ProtocolType.IP);
- IPHostEntry hostent = Dns.GetHostByAddress("127.0.0.1");
- IPEndPoint remote = new IPEndPoint(hostent.AddressList[0], 1234);
- outSock.Connect(remote);
-
-
- // make sure the connection arrives
- Assert(inListener.Pending());
- Socket inSock = inListener.AcceptSocket();
-
-
- // now send some data and see if it comes out the other end
- const int len = 1024;
- byte[] outBuf = new Byte[len];
- for (int i=0; i<len; i++)
- {
- outBuf[i] = (byte)(i % 256);
- }
-
- outSock.Send(outBuf, 0, len, 0);
-
- byte[] inBuf = new Byte[len];
- int ret = inSock.Receive(inBuf, 0, len, 0);
-
-
- // let's see if it arrived OK
- Assert(ret != 0);
- for (int i=0; i<len; i++)
- {
- Assert(inBuf[i] == outBuf[i]);
- }
-
-
- // tidy up after ourselves
- inSock.Close();
-
- inListener.Stop();
- }
-
-
- }
-
-}
diff --git a/mcs/class/System/Test/System.Net/AllTests.cs b/mcs/class/System/Test/System.Net/AllTests.cs
deleted file mode 100644
index ed2c8f1e78b..00000000000
--- a/mcs/class/System/Test/System.Net/AllTests.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Net {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
-
- public AllTests (string name) : base (name) {}
-
- public static ITest Suite {
- get
- {
- TestSuite suite = new TestSuite ();
- suite.AddTest (CookieTest.Suite);
- suite.AddTest (CookieCollectionTest.Suite);
- //suite.AddTest (CookieContainerTest.Suite);
- suite.AddTest (CredentialCacheTest.Suite);
- suite.AddTest (FileWebRequestTest.Suite);
- suite.AddTest (IPAddressTest.Suite);
- suite.AddTest (IPEndPointTest.Suite);
- suite.AddTest (SocketPermissionTest.Suite);
- suite.AddTest (WebHeaderCollectionTest.Suite);
- suite.AddTest (WebProxyTest.Suite);
- suite.AddTest (WebRequestTest.Suite);
-
- #if NETWORKTEST
- suite.AddTest (DnsTest.Suite);
- suite.AddTest (HttpWebRequestTest.Suite);
- suite.AddTest (ServicePointTest.Suite);
- suite.AddTest (ServicePointManagerTest.Suite);
- #endif
-
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/Test/System.Net/ChangeLog b/mcs/class/System/Test/System.Net/ChangeLog
deleted file mode 100644
index bd6c4a00919..00000000000
--- a/mcs/class/System/Test/System.Net/ChangeLog
+++ /dev/null
@@ -1,78 +0,0 @@
-2002-05-21 Lawrence Pit <loz@cable.a2000.nl>
-
- * WebClientTest.cs: added
- * WebProxyTest.cs: more tests
-
-2002-05-20 Lawrence Pit <loz@cable.a2000.nl>
-
- * ServicePointTest.cs: added
- * ServicePointManagerTest.cs: added
- * WebProxyTest.cs: added
- * AllTests.cs: added the above tests
- * WebHeaderCollection.cs: added TestIndexers.
-
-2002-05-19 Lawrence Pit <loz@cable.a2000.nl>
-
- * FileWebRequestTest.cs: all the async methods tests to behave the same
- as in ms.net
-
-2002-05-12 Lawrence Pit <loz@cable.a2000.nl>
-
- * FileWebRequestTest.cs: added
-
-2002-05-11 Lawrence Pit <loz@cable.a2000.nl>
-
- * WebRequestTest.cs: added
- * WebHeaderCollectionTest.cs: added
-
-2002-05-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * Added tests to IPAddressTest.cs
- * Fixed tests in CookieTest.cs, SocketPermissionsTest.cs, IPEndPointTest.cs
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * CredentialCacheTest.cs: added
- * AllTests.cs: added CredentialCacheTest
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * IPAddressTest.cs: added test for loopback
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * IPAddressTest.cs: Remove unused code to eliminate compiler warnings.
-
-2002-04-27 Lawrence Pit <loz@cable.a2000.nl>
-
- * CookieTest.cs: added
- * CookieCollectionTest.cs: added
- * AllTests.cs: added
-
-2002-04-24 Nick Drochak <ndrochak@gol.com>
-
- * IPAddressTest.cs: Make test conform to MS behavior. Also, if wrong
- exception is thrown, let eveyone know which one.
-
-2002-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPAddressTest.cs: use BitConverter to set localhost, catch
- OverflowException in TestParseWrong() and changed some constants.
-
-2002-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * AllTests.cs: added IPEndPointTest.
- * IPEndPointTest.cs: added file (author: Lawrence Pit).
- * IPAdressTest.cs: use Fail is expected exception are not raised.
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IPAddressTest.cs: use System.BitConverter.IsLittleEndian (suggested
- by Paolo) instead of guessing the endianness.
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ChangeLog:
- * AllTests.cs:
- * IPAddressTest.cs: added files.
-
diff --git a/mcs/class/System/Test/System.Net/CookieCollectionTest.cs b/mcs/class/System/Test/System.Net/CookieCollectionTest.cs
deleted file mode 100644
index 9d5e53eb64b..00000000000
--- a/mcs/class/System/Test/System.Net/CookieCollectionTest.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// CookieCollectionTest.cs - NUnit Test Cases for System.Net.CookieCollection
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Collections;
-
-namespace MonoTests.System.Net
-{
-
-public class CookieCollectionTest : TestCase
-{
- CookieCollection col;
-
- public CookieCollectionTest () :
- base ("[MonoTests.System.Net.CookieCollectionTest]") {}
-
- public CookieCollectionTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- col = new CookieCollection ();
- col.Add (new Cookie ("name1", "value1"));
- col.Add (new Cookie ("name2", "value2", "path2"));
- col.Add (new Cookie ("name3", "value3", "path3", "domain3"));
- }
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (CookieCollectionTest));
- }
- }
-
- public void TestCount ()
- {
- AssertEquals ("#1", col.Count, 3);
- }
-
- public void TestIndexer ()
- {
- Cookie c = null;
- try {
- c = col [-1];
- Fail ("#1");
- } catch (ArgumentOutOfRangeException) {
- }
- try {
- c = col [col.Count];
- Fail ("#2");
- } catch (ArgumentOutOfRangeException) {
- }
- c = col ["name1"];
- AssertEquals ("#3", c.Name, "name1");
- c = col ["NAME2"];
- AssertEquals ("#4", c.Name, "name2");
- }
-
- public void TestAdd ()
- {
- try {
- Cookie c = null;
- col.Add (c);
- Fail ("#1");
- } catch (ArgumentNullException) {
- }
-
- // in the microsoft implementation this will fail,
- // so we'll have to fail to.
- try {
- col.Add (col);
- Fail ("#2");
- } catch (Exception) {
- }
- AssertEquals ("#3", col.Count, 3);
-
- col.Add (new Cookie("name1", "value1"));
- AssertEquals ("#4", col.Count, 3);
-
- CookieCollection col2 = new CookieCollection();
- Cookie c4 = new Cookie("name4", "value4");
- Cookie c5 = new Cookie("name5", "value5");
- col2.Add (c4);
- col2.Add (c5);
- col.Add (col2);
- AssertEquals ("#5", col.Count, 5);
- AssertEquals ("#6", col ["NAME4"], c4);
- AssertEquals ("#7", col [4], c5);
- }
-
- public void TestCopyTo ()
- {
- Array a = Array.CreateInstance (typeof (Cookie), 3);
- col.CopyTo (a, 0);
- AssertEquals ("#1", a.GetValue (0), col [0]);
- AssertEquals ("#2", a.GetValue (1), col [1]);
- AssertEquals ("#3", a.GetValue (2), col [2]);
- }
-
- public void TestEnumerator ()
- {
- IEnumerator enumerator = col.GetEnumerator ();
- enumerator.MoveNext ();
- Cookie c = (Cookie) enumerator.Current;
- AssertEquals ("#1", c, col [0]);
- col.Add (new Cookie ("name6", "value6"));
- try {
- enumerator.MoveNext ();
- Fail ("#2");
- } catch (InvalidOperationException) {
- }
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/CookieTest.cs b/mcs/class/System/Test/System.Net/CookieTest.cs
deleted file mode 100644
index d00d38421e4..00000000000
--- a/mcs/class/System/Test/System.Net/CookieTest.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// CookieTest.cs - NUnit Test Cases for System.Net.Cookie
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-
-namespace MonoTests.System.Net
-{
-
-public class CookieTest : TestCase
-{
- public CookieTest () :
- base ("[MonoTests.System.Net.CookieTest]") {}
-
- public CookieTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (CookieTest));
- }
- }
-
- public void TestPublicFields ()
- {
- }
-
- public void TestConstructors ()
- {
- Cookie c = new Cookie ("somename", null, null, null);
- try {
- c = new Cookie (null, null, null, null);
- Fail ("#1: Name cannot be null");
- } catch (CookieException) {
- }
- }
-
- public void TestName ()
- {
- Cookie c = new Cookie ("SomeName", "SomeValue");
- AssertEquals ("#1", c.Name, "SomeName");
- try {
- c.Name = null;
- Fail ("#2a");
- } catch (CookieException) {
- AssertEquals ("#2b", "SomeName", c.Name);
- }
- try {
- c.Name = "";
- Fail ("#2c");
- } catch (CookieException) {
- AssertEquals ("#2d", "SomeName", c.Name);
- }
- try {
- c.Name = " ";
- Fail ("#2e");
- } catch (CookieException) {
- // bah! this fails, yet the name is changed..
- // inconsistent with previous test
- AssertEquals ("#2f", String.Empty, c.Name);
- }
- try {
- c.Name = "xxx\r\n";
- Fail ("#2g");
- } catch (CookieException) {
- AssertEquals ("#2h", String.Empty, c.Name);
- }
- try {
- c.Name = "xxx" + (char) 0x80;
- } catch (CookieException) {
- Fail ("#2i");
- }
- try {
- c.Name = "$omeName";
- Fail ("#3a: Name cannot start with '$' character");
- } catch (CookieException) {
- AssertEquals ("#3b", String.Empty, c.Name);
- }
- c.Name = "SomeName$";
- AssertEquals ("#4", c.Name, "SomeName$");
- try {
- c.Name = "Some=Name";
- Fail ("#5a: Name cannot contain '=' character");
- } catch (CookieException) {
- AssertEquals ("#5b", String.Empty, c.Name);
- }
- c.Name = "domain";
- AssertEquals ("#6", c.Name, "domain");
- }
-
- public void TestValue ()
- {
- // LAMESPEC: According to .Net specs the Value property should not accept
- // the semicolon and comma characters, yet it does
- /*
- Cookie c = new Cookie("SomeName", "SomeValue");
- try {
- c.Value = "Some;Value";
- Fail ("#1: semicolon should not be accepted");
- } catch (CookieException) {
- }
- try {
- c.Value = "Some,Value";
- Fail ("#2: comma should not be accepted");
- } catch (CookieException) {
- }
- c.Value = "Some\tValue";
- AssertEquals ("#3", c.Value, "Some\tValue");
- */
- }
-
- public void TestPort ()
- {
- Cookie c = new Cookie ("SomeName", "SomeValue");
- try {
- c.Port = "123";
- Fail ("#1: port must start and end with double quotes");
- } catch (CookieException) {
- }
- try {
- c.Port = "\"123\"";
- } catch (CookieException) {
- Fail ("#2");
- }
- try {
- c.Port = "\"123;124\"";
- Fail ("#3");
- } catch (CookieException) {
- }
- try {
- c.Port = "\"123,123,124\"";
- } catch (CookieException) {
- Fail ("#4");
- }
- try {
- c.Port = "\"123,124\"";
- } catch (CookieException) {
- Fail ("#5");
- }
- }
-
- public void TestEquals ()
- {
- Cookie c1 = new Cookie ("NAME", "VALUE", "PATH", "DOMAIN");
- Cookie c2 = new Cookie ("name", "value", "path", "domain");
- Assert("#1", !c1.Equals (c2));
- c2.Value = "VALUE";
- c2.Path = "PATH";
- Assert("#2", c1.Equals (c2));
- c2.Version = 1;
- Assert("#3", !c1.Equals (c2));
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/CredentialCacheTest.cs b/mcs/class/System/Test/System.Net/CredentialCacheTest.cs
deleted file mode 100644
index 1509f280087..00000000000
--- a/mcs/class/System/Test/System.Net/CredentialCacheTest.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// CredentialCacheTest.cs - NUnit Test Cases for System.Net.CredentialCache
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace MonoTests.System.Net
-{
-
-public class CredentialCacheTest : TestCase
-{
- public CredentialCacheTest () :
- base ("[MonoTests.System.Net.CredentialCacheTest]") {}
-
- public CredentialCacheTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (CredentialCacheTest));
- }
- }
-
- public void TestAll ()
- {
- CredentialCache c = new CredentialCache ();
-
- NetworkCredential cred1 = new NetworkCredential ("user1", "pwd1");
- NetworkCredential cred2 = new NetworkCredential ("user2", "pwd2");
- NetworkCredential cred3 = new NetworkCredential ("user3", "pwd3");
- NetworkCredential cred4 = new NetworkCredential ("user4", "pwd4");
- NetworkCredential cred5 = new NetworkCredential ("user5", "pwd5");
-
- c.Add (new Uri ("http://www.ximian.com"), "Basic", cred1);
- c.Add (new Uri ("http://www.ximian.com"), "Kerberos", cred2);
-
- c.Add (new Uri ("http://www.contoso.com/portal/news/index.aspx"), "Basic", cred1);
- c.Add (new Uri ("http://www.contoso.com/portal/news/index.aspx?item=1"), "Basic", cred2);
- c.Add (new Uri ("http://www.contoso.com/portal/news/index.aspx?item=12"), "Basic", cred3);
- c.Add (new Uri ("http://www.contoso.com/portal/"), "Basic", cred4);
- c.Add (new Uri ("http://www.contoso.com"), "Basic", cred5);
-
- NetworkCredential result = null;
-
- try {
- c.Add (new Uri("http://www.ximian.com"), "Basic", cred1);
- Fail ("#1: should have failed");
- } catch (ArgumentException) { }
-
- c.Add (new Uri("http://www.contoso.com/"), "**Unknown**", cred1);
- result = c.GetCredential (new Uri("http://www.contoso.com/"), "**Unknown**");
- AssertEquals ("#3", result, cred1);
- c.Remove (new Uri("http://www.contoso.com/"), "**Unknown**");
- result = c.GetCredential (new Uri("http://www.contoso.com/"), "**Unknown**");
- Assert ("#4", result == null);
-
- c.Add (new Uri("http://www.contoso.com/"), "**Unknown**", cred1);
- result = c.GetCredential (new Uri("http://www.contoso.com"), "**Unknown**");
- AssertEquals ("#5", result, cred1);
- c.Remove (new Uri("http://www.contoso.com"), "**Unknown**");
- result = c.GetCredential (new Uri("http://www.contoso.com"), "**Unknown**");
- Assert ("#6", result == null);
-
- c.Add (new Uri("http://www.contoso.com/portal/"), "**Unknown**", cred1);
- result = c.GetCredential (new Uri("http://www.contoso.com/portal/foo/bar.html"), "**Unknown**");
- AssertEquals ("#7", result, cred1);
- c.Remove (new Uri("http://www.contoso.com"), "**Unknown**");
- result = c.GetCredential (new Uri("http://www.contoso.com"), "**Unknown**");
- Assert ("#8", result == null);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news/index.aspx"), "Basic");
- AssertEquals ("#9", result, cred3);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news/index"), "Basic");
- AssertEquals ("#10", result, cred3);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news/"), "Basic");
- AssertEquals ("#11", result, cred3);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/news"), "Basic");
- AssertEquals ("#12", result, cred4);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/ne"), "Basic");
- AssertEquals ("#13", result, cred4);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/portal/"), "Basic");
- AssertEquals ("#14", result, cred4);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/portal"), "Basic");
- AssertEquals ("#15", result, cred5);
-
- result = c.GetCredential (new Uri("http://www.contoso.com:80/"), "Basic");
- AssertEquals ("#16", result, cred5);
-
- result = c.GetCredential (new Uri("http://www.contoso.com"), "Basic");
- AssertEquals ("#17", result, cred5);
-
- /*
- IEnumerator e = c.GetEnumerator ();
- while (e.MoveNext ()) {
- Console.WriteLine (e.Current.GetType () + " : " + e.Current.ToString ());
- }
- */
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/DnsTest.cs b/mcs/class/System/Test/System.Net/DnsTest.cs
deleted file mode 100644
index 804351a8bb7..00000000000
--- a/mcs/class/System/Test/System.Net/DnsTest.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-// DnsTest.cs - NUnit Test Cases for the System.Net.Dns class
-//
-// Author: Mads Pultz (mpultz@diku.dk)
-//
-// (C) Mads Pultz, 2001
-//
-// This test assumes the following:
-// 1) The following Internet sites exist:
-// www.go-mono.com with IP address 129.250.184.233
-// info.diku.dk with IP address 130.225.96.4
-// 2) The following DNS name does not exist:
-// www.hopefullydoesnotexist.dk
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using System.Collections;
-
-namespace MonoTests.System.Net {
-
-public class DnsTest: TestCase {
-
- private String site1Name = "www.go-mono.com",
- site1Dot = "129.250.184.233",
- site2Name = "info.diku.dk",
- site2Dot = "130.225.96.4",
- noneExistingSite = "www.hopefullydoesnotexist.dk";
- private uint site1IP = 2180692201, site2IP = 2195808260; // Big-Endian
-
- public DnsTest(): base("MonoTests.System.Net.DnsTest testsuite") { }
- public DnsTest(String name): base(name) { }
-
- public static ITest Suite {
- get { return new TestSuite(typeof(DnsTest)); }
- }
-
- private void Callback(IAsyncResult ar) {
- IPHostEntry h;
- h = Dns.EndGetHostByName(ar);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestAsyncGetHostByName(){
- IAsyncResult r;
- r = Dns.BeginGetHostByName(site1Name, new AsyncCallback(Callback), null);
-
- IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);
- IPHostEntry entry = Dns.EndGetHostByName (async);
- SubTestValidIPHostEntry(entry);
- AssertEquals ("#1", "www.go-mono.com", entry.HostName);
- }
-
- public void TestAsyncResolve() {
- IAsyncResult r;
- r = Dns.BeginResolve(site1Name, new AsyncCallback(Callback), null);
-
- IAsyncResult async = Dns.BeginResolve (site1Dot, null, null);
- IPHostEntry entry = Dns.EndResolve (async);
- SubTestValidIPHostEntry(entry);
- AssertEquals ("#1", "129.250.184.233", entry.HostName);
- }
-
- public void TestGetHostName() {
- string hostName = Dns.GetHostName();
- Assert(hostName != null);
- }
-
- private void SubTestGetHostByName(string siteName, string siteDot) {
- IPHostEntry h = Dns.GetHostByName(siteName);
- SubTestValidIPHostEntry(h);
- Assert(h.HostName.Equals(siteName));
- Assert(h.AddressList[0].ToString() == siteDot);
- }
-
- public void TestGetHostByName() {
- SubTestGetHostByName(site1Name, site1Dot);
- SubTestGetHostByName(site2Name, site2Dot);
- try {
- Dns.GetHostByName(noneExistingSite);
- Fail("Should raise a SocketException (assuming that '" + noneExistingSite + "' does not exist)");
- } catch (SocketException) {
- }
- try {
- Dns.GetHostByName(null);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- }
-
- private void SubTestGetHostByAddressStringFormatException(string addr) {
- try {
- Dns.GetHostByAddress(addr);
- Fail("Should raise a FormatException");
- } catch (FormatException) {
- }
- }
-
- private void SubTestGetHostByAddressString(string addr) {
- IPHostEntry h = Dns.GetHostByAddress(addr);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestGetHostByAddressString() {
- try {
- String addr = null;
- Dns.GetHostByAddress(addr);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- SubTestGetHostByAddressStringFormatException("123.255.23");
- SubTestGetHostByAddressStringFormatException("123.256.34.10");
- SubTestGetHostByAddressStringFormatException("not an IP address");
- SubTestGetHostByAddressString(site1Dot);
- SubTestGetHostByAddressString(site2Dot);
- }
-
- private void SubTestGetHostByAddressIPAddress(IPAddress addr) {
- IPHostEntry h = Dns.GetHostByAddress(addr);
- SubTestValidIPHostEntry(h);
- Assert(h.AddressList[0].ToString() == addr.ToString());
- }
-
- public void TestGetHostByAddressIPAddress() {
- try {
- IPAddress addr = null;
- Dns.GetHostByAddress(addr);
- Fail("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- SubTestGetHostByAddressIPAddress(new IPAddress(IPAddress.NetworkToHostOrder((int)site1IP)));
- SubTestGetHostByAddressIPAddress(new IPAddress(IPAddress.NetworkToHostOrder((int)site2IP)));
- }
-
- private void SubTestResolve(string addr) {
- IPHostEntry h = Dns.Resolve(addr);
- SubTestValidIPHostEntry(h);
- }
-
- public void TestResolve() {
- SubTestResolve(site1Name);
- SubTestResolve(site2Name);
- SubTestResolve(site1Dot);
- SubTestResolve(site2Dot);
- }
-
- private void SubTestValidIPHostEntry(IPHostEntry h) {
- Assert(h.HostName != null);
- Assert(h.AddressList != null);
- Assert(h.AddressList.Length > 0);
- }
-
- private static void printIPHostEntry(IPHostEntry h)
- {
- Console.WriteLine("----------------------------------------------------");
- Console.WriteLine("Host name:");
- Console.WriteLine(h.HostName);
- Console.WriteLine("IP addresses:");
- IPAddress[] list = h.AddressList;
- for(int i = 0; i < list.Length; ++i)
- Console.WriteLine(list[i]);
- Console.WriteLine("Aliases:");
- string[] aliases = h.Aliases;
- for(int i = 0; i < aliases.Length; ++i)
- Console.WriteLine(aliases[i]);
- Console.WriteLine("----------------------------------------------------");
- }
-}
-
-}
diff --git a/mcs/class/System/Test/System.Net/FileWebRequestTest.cs b/mcs/class/System/Test/System.Net/FileWebRequestTest.cs
deleted file mode 100644
index ae99aa076a0..00000000000
--- a/mcs/class/System/Test/System.Net/FileWebRequestTest.cs
+++ /dev/null
@@ -1,306 +0,0 @@
-//
-// FileWebRequestTest.cs - NUnit Test Cases for System.Net.FileWebRequest
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Net;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace MonoTests.System.Net
-{
-
-public class FileWebRequestTest : TestCase
-{
- public FileWebRequestTest () :
- base ("[MonoTests.System.Net.FileWebRequestTest]") {}
-
- public FileWebRequestTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (FileWebRequestTest));
- }
- }
-
-
- public void TestAsync ()
- {
- string tmpFilename = GetFilename ();
- if (tmpFilename == null) {
- Console.WriteLine ("\n\nSet environment variable TMPDIR to a temporary directory to test FileWebRequest\n");
- return;
- }
-
- try {
- if (File.Exists (tmpFilename))
- File.Delete (tmpFilename);
-
- Uri uri = new Uri ("file:///" + tmpFilename);
-
- WebRequest req = WebRequest.Create (uri);
- req.Method = "PUT";
-
- req.Timeout = 2 * 1000;
- IAsyncResult async = req.BeginGetRequestStream (null, null);
- try {
- req.BeginGetRequestStream (null, null);
- Fail ("#1 should've failed");
- } catch (InvalidOperationException) {
- //Console.WriteLine ("GOT1: " + e.Message + "\n" + e.StackTrace);
- // Cannot re-call BeginGetRequestStream/BeginGetResponse while
- // a previous call is still in progress
- }
- /*
- try {
- req.BeginGetResponse (null, null);
- Fail ("#2 should've failed");
- } catch (InvalidOperationException) { }
- */
- try {
- req.GetRequestStream ();
- Fail ("#3 should've failed");
- } catch (InvalidOperationException) {
- // Console.WriteLine ("GOT3: " + e.Message + "\n" + e.StackTrace);
- // Cannot re-call BeginGetRequestStream/BeginGetResponse while
- // a previous call is still in progress
- }
-
- try {
- req.GetResponse ();
- Fail ("#4 should've failed");
- } catch (WebException) {
- // Console.WriteLine ("4: " + e.Message + "\n" + e.StackTrace);
- // The operation has timed out
- }
-
- try {
- IAsyncResult async0 = req.BeginGetResponse (null, null);
- req.EndGetResponse (async0);
- // Console.WriteLine ("X5c");
- Fail ("#5 should've failed");
- } catch (InvalidOperationException) {
- // Console.WriteLine ("5e: " + e.Message + "\n" + e.StackTrace);
- // Cannot re-call BeginGetRequestStream/BeginGetResponse while
- // a previous call is still in progress
- }
-
- // Console.WriteLine ("WEBHEADERS: " + req.Headers);
-
- Stream wstream = req.EndGetRequestStream (async);
- AssertEquals ("#1r", false, wstream.CanRead);
- AssertEquals ("#1w", true, wstream.CanWrite);
- AssertEquals ("#1s", true, wstream.CanSeek);
-
- wstream.WriteByte (72);
- wstream.WriteByte (101);
- wstream.WriteByte (108);
- wstream.WriteByte (108);
- wstream.WriteByte (111);
- wstream.Close ();
-
- // stream written
-
- req = WebRequest.Create (uri);
- WebResponse res = req.GetResponse ();
-
- try {
- req.BeginGetRequestStream (null, null);
- Fail ("#20: should've failed");
- } catch (InvalidOperationException) {
- // Console.WriteLine ("20: " + e.Message + "\n" + e.StackTrace);
- // Cannot send a content-body with this verb-type
- }
-
- try {
- req.Method = "PUT";
- req.BeginGetRequestStream (null, null);
- Fail ("#21: should've failed");
- } catch (InvalidOperationException) {
- // Console.WriteLine ("21: " + e.Message + "\n" + e.StackTrace);
- // This operation cannot be perfomed after the request has been submitted.
- }
-
- try {
- //IAsyncResult async2 = req.BeginGetResponse (null, null);
- //Console.WriteLine ("OK!");
- req.GetResponse ();
- //Fail ("#22: should've failed");
- } catch (InvalidOperationException) {
- //Console.WriteLine ("22: " + e.Message + "\n" + e.StackTrace);
- // Cannot re-call BeginGetRequestStream/BeginGetResponse while
- // a previous call is still in progress
- Fail ("#22: should not have failed");
- }
-
- try {
- IAsyncResult async2 = req.BeginGetResponse (null, null);
-
- // this succeeds !!
-
- try {
- WebResponse res2 = req.EndGetResponse (async2);
-
- // and this succeeds
-
- AssertEquals ("#23", res, res2) ;
-
- //Fail ("#23: should've failed");
- } catch (InvalidOperationException) {
- //Console.WriteLine ("22: " + e.Message + "\n" + e.StackTrace);
- // Cannot re-call BeginGetRequestStream/BeginGetResponse while
- // a previous call is still in progress
- }
-
- // Fail ("#22: should've failed");
- } catch (InvalidOperationException) {
- }
-
- AssertEquals ("#2 len", (long) 5, res.ContentLength);
- AssertEquals ("#2 type", "binary/octet-stream", res.ContentType);
- AssertEquals ("#2 scheme", "file", res.ResponseUri.Scheme);
-
- Stream rstream = res.GetResponseStream ();
- AssertEquals ("#3r", true, rstream.CanRead);
- AssertEquals ("#3w", false, rstream.CanWrite);
- AssertEquals ("#3s", true, rstream.CanSeek);
-
- AssertEquals ("#4a", 72, rstream.ReadByte ());
- AssertEquals ("#4b", 101, rstream.ReadByte ());
- AssertEquals ("#4c", 108, rstream.ReadByte ());
-
- rstream.Close ();
- // res.Close ();
-
- try {
- long len = res.ContentLength;
- AssertEquals ("#5", (long) 5, len);
- } catch (ObjectDisposedException) {
- Fail ("#disposed contentlength");
- }
- try {
- WebHeaderCollection w = res.Headers;
- } catch (ObjectDisposedException) {
- Fail ("#disposed headers");
- }
- try {
- res.Close ();
- } catch (ObjectDisposedException) {
- Fail ("#disposed close");
- }
- } catch (Exception) {
- // Console.WriteLine ("ERROR! : " + ee.Message + "\n" + ee.StackTrace);
- } finally {
- try {
- // known bug #24940
- File.Delete (tmpFilename);
- } catch (Exception) {
- // Console.WriteLine ("ERROR2! : " + ee2.Message + "\n" + ee2.StackTrace);
- }
- }
- }
-
- public void TestSync ()
- {
- string tmpFilename = GetFilename ();
- if (tmpFilename == null)
- return;
-
- try {
- if (File.Exists (tmpFilename))
- File.Delete (tmpFilename);
-
- Uri uri = new Uri ("file:///" + tmpFilename);
-
- WebRequest req = WebRequest.Create (uri);
-
- try {
- Stream stream = req.GetRequestStream ();
- Fail ("should throw exception");
- } catch (ProtocolViolationException) {}
-
- req.Method = "PUT";
-
- Stream wstream = req.GetRequestStream ();
- AssertEquals ("#1r", false, wstream.CanRead);
- AssertEquals ("#1w", true, wstream.CanWrite);
- AssertEquals ("#1s", true, wstream.CanSeek);
-
- wstream.WriteByte (72);
- wstream.WriteByte (101);
- wstream.WriteByte (108);
- wstream.WriteByte (108);
- wstream.WriteByte (111);
- wstream.Close ();
-
- // stream written
-
- req = WebRequest.Create (uri);
- WebResponse res = req.GetResponse ();
- AssertEquals ("#2 len", (long) 5, res.ContentLength);
- AssertEquals ("#2 type", "binary/octet-stream", res.ContentType);
- AssertEquals ("#2 scheme", "file", res.ResponseUri.Scheme);
-
- Stream rstream = res.GetResponseStream ();
- AssertEquals ("#3r", true, rstream.CanRead);
- AssertEquals ("#3w", false, rstream.CanWrite);
- AssertEquals ("#3s", true, rstream.CanSeek);
-
- AssertEquals ("#4a", 72, rstream.ReadByte ());
- AssertEquals ("#4b", 101, rstream.ReadByte ());
- AssertEquals ("#4c", 108, rstream.ReadByte ());
-
- rstream.Close ();
- // res.Close ();
-
- try {
- long len = res.ContentLength;
- AssertEquals ("#5", (long) 5, len);
- } catch (ObjectDisposedException) {
- Fail ("#disposed contentlength");
- }
- try {
- WebHeaderCollection w = res.Headers;
- } catch (ObjectDisposedException) {
- Fail ("#disposed headers");
- }
- try {
- res.Close ();
- } catch (ObjectDisposedException) {
- Fail ("#disposed close");
- }
-
- } finally {
- try {
- File.Delete (tmpFilename);
- } catch (Exception) { }
- }
- }
-
- private string GetFilename ()
- {
- string tmpdir = Environment.GetEnvironmentVariable ("TMPDIR");
- if (tmpdir == null || tmpdir.Length == 0) {
- return null;
- }
-
- tmpdir = tmpdir.Replace ('\\', '/');
- if (tmpdir [tmpdir.Length - 1] != '/')
- tmpdir += "/";
- return tmpdir + "FileWebRequestTest.tmp";
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
deleted file mode 100644
index bbbba624b7f..00000000000
--- a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// HttpWebRequestTest.cs - NUnit Test Cases for System.Net.HttpWebRequest
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Collections;
-
-namespace MonoTests.System.Net
-{
-
-public class HttpWebRequestTest : TestCase
-{
- public HttpWebRequestTest () :
- base ("[MonoTests.System.Net.HttpWebRequestTest]") {}
-
- public HttpWebRequestTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (HttpWebRequestTest));
- }
- }
-
- public void TestSync ()
- {
- try {
- HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
- req.UserAgent = "MonoClient v1.0";
- Console.WriteLine ("req:If Modified Since: " + req.IfModifiedSince);
- WriteHeaders ("req:", req.Headers);
-
- HttpWebResponse res = (HttpWebResponse) req.GetResponse ();
- Console.WriteLine ("res:HttpStatusCode: " + res.StatusCode);
- Console.WriteLine ("res:HttpStatusDescription: " + res.StatusDescription);
-
- WriteHeaders ("res:", res.Headers);
- Console.WriteLine("Last Modified: " + res.LastModified);
-
- WriteCookies ("res:", res.Cookies);
-
- WriteHeaders ("req:", req.Headers);
-
- res.Close ();
- } catch (WebException e) {
- Console.WriteLine("\nThe following Exception was raised : {0}", e.Message);
- }
- }
-
- public void TestAsync ()
- {
- }
-
- public void TestAddRange ()
- {
- HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
- req.AddRange (10);
- req.AddRange (50, 90);
- req.AddRange ("bytes", 100);
- req.AddRange ("bytes", 100, 120);
- AssertEquals ("#1", "bytes=10-,50-90,100-,100-120", req.Headers ["Range"]);
- try {
- req.AddRange ("bits", 2000);
- Fail ("#2");
- } catch (InvalidOperationException) {}
- }
-
- private void WriteHeaders (string label, WebHeaderCollection col)
- {
- label += "Headers";
- if (col.Count == 0)
- Console.WriteLine (label + "Nothing in web headers collection\n");
- else
- Console.WriteLine (label);
- for (int i = 0; i < col.Count; i++)
- Console.WriteLine ("\t" + col.GetKey (i) + ": " + col.Get (i));
- }
-
- private void WriteCookies (string label, CookieCollection col)
- {
- label += "Cookies";
- if (col.Count == 0)
- Console.WriteLine (label + "Nothing in cookies collection\n");
- else
- Console.WriteLine (label);
- for (int i = 0; i < col.Count; i++)
- Console.WriteLine ("\t" + col [i]);
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/IPAddressTest.cs b/mcs/class/System/Test/System.Net/IPAddressTest.cs
deleted file mode 100644
index 6e82828ad22..00000000000
--- a/mcs/class/System/Test/System.Net/IPAddressTest.cs
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// IPAddressTest.cs - NUnit Test Cases for System.Net.IPAddress
-//
-// Author:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Runtime.InteropServices;
-
-namespace MonoTests.System.Net
-{
-
-public class IPAddressTest : TestCase
-{
- public IPAddressTest () :
- base ("[MonoTests.System.Net.IPAddressTest]") {}
-
- public IPAddressTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(IPAddressTest));
- }
- }
-
- public void TestPublicFields ()
- {
- AssertEquals ("Any", IPAddress.Any.Address, (long) 0);
- AssertEquals ("Broadcast", IPAddress.Broadcast.Address, (long) 0xFFFFFFFF);
- long loopback = IPAddress.HostToNetworkOrder (BitConverter.IsLittleEndian ?
- 0x7f000001 :
- 0x0100007f);
- AssertEquals ("Loopback", IPAddress.Loopback.Address, loopback);
- AssertEquals ("None", IPAddress.None.Address, (long) 0xFFFFFFFF);
- }
-
- public void TestToString ()
- {
- IPAddress ip = IPAddress.Parse ("192.168.1.1");
- AssertEquals ("ToString #1", "192.168.1.1", ip.ToString ());
- AssertEquals ("ToString #2", "0.0.0.0", IPAddress.Any.ToString ());
- AssertEquals ("ToString #3", "255.255.255.255", IPAddress.Broadcast.ToString ());
- AssertEquals ("ToString #4", "127.0.0.1", IPAddress.Loopback.ToString ());
- AssertEquals ("ToString #5", "255.255.255.255", IPAddress.None.ToString ());
- }
-
- public void TestIsLoopback ()
- {
- IPAddress ip = IPAddress.Parse ("127.0.0.1");
- AssertEquals ("IsLoopback #1", true, IPAddress.IsLoopback (ip));
- }
-
- public void TestAddress ()
- {
- // hm, lame, anything is accepted by ms.net
- /*
- try {
- IPAddress ip1 = new IPAddress (0x0000000100000000);
- Fail ("#1");
- } catch (ArgumentOutOfRangeException) {}
- IPAddress ip = IPAddress.Parse ("127.0.0.1");
- ip.Address = 0;
- ip.Address = 0xffffffff;
- try {
- ip.Address = -1;
- Fail ("#2");
- } catch (ArgumentOutOfRangeException) {}
- try {
- ip.Address = 0x0000000100000000;
- Fail ("#3");
- } catch (ArgumentOutOfRangeException) {}
- */
- }
-
- public void TestParseOk ()
- {
- IPAddress ip = IPAddress.Parse ("192.168.1.1");
- Assert ("Parse #1", ip.ToString () == "192.168.1.1");
-
- ip = IPAddress.Parse ("0xff.0x7f.0x20.0x01");
- Assert ("Parse #1b", ip.ToString () == "255.127.32.1");
-
- ip = IPAddress.Parse ("0xff.0x7f.0x20.0xf");
- Assert ("Parse #1c", ip.ToString () == "255.127.32.15");
-
- ip = IPAddress.Parse ("0.0.0.0");
- AssertEquals ("Parse #2", ip, IPAddress.Any);
-
- ip = IPAddress.Parse ("255.255.255.255");
- AssertEquals ("Parse #3", ip, IPAddress.Broadcast);
- AssertEquals ("Parse #4", ip, IPAddress.None);
-
- ip = IPAddress.Parse ("127.0.0.1");
- AssertEquals ("Parse #5", IPAddress.IsLoopback (ip), true);
-
- ip = IPAddress.Parse ("12.1.1.3 ");
- AssertEquals ("Parse #6", IPAddress.Parse ("12.1.1.3"), ip);
-
- ip = IPAddress.Parse (" 12.1.1.1");
- AssertEquals ("Parse #7", IPAddress.Parse ("0.0.0.0"), ip);
-
- ip = IPAddress.Parse ("12.1 .1.2");
- AssertEquals ("Parse #8", IPAddress.Parse ("12.0.0.1"), ip);
-
- ip = IPAddress.Parse (".1.1.6");
- AssertEquals ("Parse #9", IPAddress.Parse ("0.1.1.6"), ip);
-
- ip = IPAddress.Parse ("12.1.7");
- AssertEquals ("Parse #10", IPAddress.Parse ("12.1.0.7"), ip);
-
- ip = IPAddress.Parse ("12.1.8. ");
- AssertEquals ("Parse #11", IPAddress.Parse ("12.1.8.0"), ip);
-
- ip = IPAddress.Parse ("12");
- AssertEquals ("Parse #12", IPAddress.Parse ("0.0.0.12"), ip);
-
- ip = IPAddress.Parse ("12.1 foo.1.2.3.4.5.bar");
- AssertEquals ("Parse #13", IPAddress.Parse ("12.0.0.1"), ip);
-
- ip = IPAddress.Parse ("12.1.2. ");
- AssertEquals ("Parse #14", IPAddress.Parse ("12.1.2.0"), ip);
-
- ip = IPAddress.Parse ("12.. .");
- AssertEquals ("Parse #15", IPAddress.Parse ("12.0.0.0"), ip);
-
- ip = IPAddress.Parse (" ");
- AssertEquals ("Parse #16", IPAddress.Parse ("0.0.0.0"), ip);
-
- ip = IPAddress.Parse (" foo");
- AssertEquals ("Parse #17", IPAddress.Parse ("0.0.0.0"), ip);
- }
-
- public void TestParseWrong ()
- {
- IPAddress ip = IPAddress.None;
- try {
- ip = IPAddress.Parse ("12.+1.1.4");
- Fail("Should raise a FormatException #1");
- } catch (FormatException) {
- } catch (Exception e) {
- Fail ("ParseWrong #1:" + e.ToString());
- }
-
- try {
- ip = IPAddress.Parse ("12.1.-1.5");
- Fail("Should raise a FormatException #2");
- } catch (FormatException) {
- } catch (Exception e) {
- Fail ("ParseWrong #2:" + e.ToString());
- }
-
- try {
- ip = IPAddress.Parse ("257.1.1.9");
- Fail("Should raise a FormatException #3");
- } catch (FormatException) {
- } catch (Exception e) {
- Fail ("ParseWrong #3:" + e.ToString());
- }
-
- try {
- ip = IPAddress.Parse (null);
- Fail("Should raise a ArgumentNullException #1");
- } catch (ArgumentNullException) {
- } catch (Exception e) {
- Fail ("ParseWrong #4:" + e.ToString());
- }
-
- try {
- ip = IPAddress.Parse ("12.");
- Fail ("ParseWrong #5: Should raise a FormatException");
- } catch (FormatException) {}
-
- try {
- ip = IPAddress.Parse ("12.1.2.");
- Fail ("ParseWrong #6: Should raise a FormatException");
- } catch (FormatException) {}
-
- try {
- ip = IPAddress.Parse ("12...");
- Fail ("ParseWrong #7: Should raise a FormatException");
- } catch (FormatException) {}
- }
-
- public void TestNetworkHost ()
- {
- long [] tested = new long [] { 0, 1, 1, 1};
- long [] expectedLE = new long [] {0, 256, 16777216, 72057594037927936 };
- long [] expected;
-
- expected = BitConverter.IsLittleEndian ? expectedLE : tested;
-
- short short0 = IPAddress.NetworkToHostOrder ((short) tested [0]);
- AssertEquals ("NetworkToHostOrder #1", short0, (short) expected [0]);
- short0 = IPAddress.HostToNetworkOrder (short0);
- AssertEquals ("HostToNetworkOrder #1", short0, (short) tested [0]);
-
- int int0 = IPAddress.NetworkToHostOrder ((int) tested [0]);
- AssertEquals ("NetworkToHostOrder #2", int0, (int) expected [0]);
- int0 = IPAddress.HostToNetworkOrder (int0);
- AssertEquals ("HostToNetworkOrder #2", int0, (int) tested [0]);
-
- long long0 = IPAddress.NetworkToHostOrder (tested [0]);
- AssertEquals ("NetworkToHostOrder #3", long0, expected [0]);
- long0 = IPAddress.HostToNetworkOrder (long0);
- AssertEquals ("HostToNetworkOrder #3", long0, tested [0]);
-
- short0 = IPAddress.NetworkToHostOrder ((short) tested [1]);
- AssertEquals ("NetworkToHostOrder #4", short0, (short) expected [1]);
- short0 = IPAddress.HostToNetworkOrder (short0);
- AssertEquals ("HostToNetworkOrder #4", short0, (short) tested [1]);
-
- int0 = IPAddress.NetworkToHostOrder ((int) tested [2]);
- AssertEquals ("NetworkToHostOrder #5", int0, (int) expected [2]);
- int0 = IPAddress.HostToNetworkOrder (int0);
- AssertEquals ("HostToNetworkOrder #5", int0, (int) tested [2]);
-
- long0 = IPAddress.NetworkToHostOrder (tested [3]);
- AssertEquals ("NetworkToHostOrder #6", long0, expected [3]);
- long0 = IPAddress.HostToNetworkOrder (long0);
- AssertEquals ("HostToNetworkOrder #6", long0, tested [3]);
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/IPEndPointTest.cs b/mcs/class/System/Test/System.Net/IPEndPointTest.cs
deleted file mode 100644
index fd29c5cac05..00000000000
--- a/mcs/class/System/Test/System.Net/IPEndPointTest.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// IPEndPointTest.cs - NUnit Test Cases for System.Net.IPEndPoint
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Runtime.InteropServices;
-
-namespace MonoTests.System.Net
-{
-
-public class IPEndPointTest : TestCase
-{
- private const int MyPort = 42;
- private const int MyMaxPort = 65535;
- private const int MyMinPort = 0;
- private const string MyIPAddressString = "192.168.1.1";
-
- private IPAddress ipAddress;
- private long ip;
- private IPEndPoint endPoint1;
- private IPEndPoint endPoint2;
-
- public IPEndPointTest () :
- base ("[MonoTests.System.Net.IPEndPointTest]") {}
-
- public IPEndPointTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- ipAddress = IPAddress.Parse (MyIPAddressString);
- ip = ipAddress.Address;
- endPoint1 = new IPEndPoint (ipAddress, MyPort);
- endPoint2 = new IPEndPoint (ip, MyPort);
- }
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (IPEndPointTest));
- }
- }
-
- public void TestPublicFields ()
- {
- AssertEquals ("MinPort", IPEndPoint.MinPort, MyMinPort);
- AssertEquals ("MaxPort", IPEndPoint.MaxPort, MyMaxPort);
- }
-
- public void TestConstructors ()
- {
- try {
- new IPEndPoint (null, 0);
- Fail ("Should raise an ArgumentNullException");
- } catch (ArgumentNullException) {
- }
- try {
- new IPEndPoint (ipAddress, MyMinPort - 1);
- Fail ("Should raise an ArgumentOutOfRangeException #1");
- } catch (ArgumentOutOfRangeException) {
- }
- try {
- new IPEndPoint (ipAddress, MyMaxPort + 1);
- Fail ("Should raise an ArgumentOutOfRangeException #2");
- } catch (ArgumentOutOfRangeException) {
- }
-
- try {
- new IPEndPoint (ip, MyMinPort -1);
- Fail ("Should raise an ArgumentOutOfRangeException #3");
- } catch (ArgumentOutOfRangeException) {
- }
- try {
- new IPEndPoint (ip, MyMaxPort + 1);
- Fail ("Should raise an ArgumentOutOfRangeException #4");
- } catch (ArgumentOutOfRangeException) {
- }
- }
-
- public void TestPortProperty ()
- {
- try {
- endPoint1.Port = MyMinPort - 1;
- Fail ("Should raise an ArgumentOutOfRangeException #1");
- } catch (ArgumentOutOfRangeException) {
- }
- try {
- endPoint1.Port = MyMaxPort + 1;
- Fail ("Should raise an ArgumentOutOfRangeException #2");
- } catch (ArgumentOutOfRangeException) {
- }
- }
-
- public void TestCreateAndSerialize()
- {
- SocketAddress addr = endPoint1.Serialize ();
- EndPoint endPoint3 = endPoint2.Create (addr);
- Assert ("#1", endPoint1.Equals (endPoint3));
-
- IPAddress ipAddress = IPAddress.Parse ("255.255.255.255");
- IPEndPoint endPoint4 = new IPEndPoint (ipAddress, MyMaxPort);
- addr = endPoint4.Serialize ();
- EndPoint endPoint5 = endPoint2.Create(addr);
- Assert ("#2", endPoint4.Equals (endPoint5));
- AssertEquals ("#3", endPoint5.ToString (), "255.255.255.255:" + MyMaxPort);
- }
-
- public void TestEquals ()
- {
- Assert("Equals", endPoint1.Equals (endPoint2));
- Assert("Not Equals", !endPoint1.Equals (new IPEndPoint (ip, MyPort + 1)));
- }
-
- public void TestGetHashCode ()
- {
- AssertEquals(endPoint1.GetHashCode(), endPoint2.GetHashCode());
- }
-
- public void TestToString ()
- {
- AssertEquals("ToString #1", endPoint1.ToString (), MyIPAddressString + ":" + MyPort);
- AssertEquals("ToString #2", endPoint2.ToString (), MyIPAddressString + ":" + MyPort);
- }
-
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/ServicePointManagerTest.cs b/mcs/class/System/Test/System.Net/ServicePointManagerTest.cs
deleted file mode 100644
index bfc595af118..00000000000
--- a/mcs/class/System/Test/System.Net/ServicePointManagerTest.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// ServicePointManagerTest.cs - NUnit Test Cases for System.Net.ServicePointManager
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.IO;
-using System.Net;
-using System.Threading;
-
-namespace MonoTests.System.Net
-{
-
-public class ServicePointManagerTest : TestCase
-{
- private Uri googleUri;
- private Uri yahooUri;
- private Uri apacheUri;
-
- public ServicePointManagerTest () :
- base ("[MonoTests.System.Net.ServicePointManagerTest]") {}
-
- public ServicePointManagerTest (string name) : base (name) {}
-
- protected override void SetUp () {
- googleUri = new Uri ("http://www.google.com");
- yahooUri = new Uri ("http://www.yahoo.com");
- apacheUri = new Uri ("http://www.apache.org");
- }
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (ServicePointManagerTest));
- }
- }
-
- public void TestMaxServicePointManagers ()
- {
- try {
- AssertEquals ("#1", 0, ServicePointManager.MaxServicePoints);
-
- DoWebRequest (googleUri);
- Thread.Sleep (100);
- DoWebRequest (yahooUri);
- Thread.Sleep (100);
- DoWebRequest (apacheUri);
- Thread.Sleep (100);
-
- ServicePoint sp = ServicePointManager.FindServicePoint (googleUri);
- WriteServicePoint (sp);
- sp = ServicePointManager.FindServicePoint (yahooUri);
- WriteServicePoint (sp);
- sp = ServicePointManager.FindServicePoint (apacheUri);
- WriteServicePoint (sp);
-
- ServicePointManager.MaxServicePoints = 1;
-
- sp = ServicePointManager.FindServicePoint (googleUri);
- WriteServicePoint (sp);
- sp = ServicePointManager.FindServicePoint (yahooUri);
- WriteServicePoint (sp);
- sp = ServicePointManager.FindServicePoint (apacheUri);
- WriteServicePoint (sp);
-
- GC.Collect ();
-
- // hmm... aparently ms.net still has the service points even
- // though I set it to a max of 1.
-
- // this should force an exception then...
- sp = ServicePointManager.FindServicePoint (new Uri ("http://www.microsoft.com"));
- WriteServicePoint (sp);
-
- } catch (Exception e) {
- Console.WriteLine("\nThe following Exception was raised : {0}", e.Message);
- }
- }
-
- public void TestFindServicePoint ()
- {
- ServicePoint sp = ServicePointManager.FindServicePoint (googleUri, new WebProxy (apacheUri));
- AssertEquals ("#1", apacheUri, sp.Address);
- AssertEquals ("#2", 2, sp.ConnectionLimit);
- AssertEquals ("#3", "http", sp.ConnectionName);
- }
-
- private void DoWebRequest (Uri uri)
- {
- WebRequest.Create (uri).GetResponse ().Close ();
- }
-
- private void WriteServicePoint (ServicePoint sp)
- {
- Console.WriteLine ("\nAddress: " + sp.Address);
- Console.WriteLine ("ConnectionLimit: " + sp.ConnectionLimit);
- Console.WriteLine ("ConnectionName: " + sp.ConnectionName);
- Console.WriteLine ("CurrentConnections: " + sp.CurrentConnections);
- Console.WriteLine ("IdleSince: " + sp.IdleSince);
- Console.WriteLine ("MaxIdletime: " + sp.MaxIdleTime);
- Console.WriteLine ("ProtocolVersion: " + sp.ProtocolVersion);
- Console.WriteLine ("SupportsPipelining: " + sp.SupportsPipelining);
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/ServicePointTest.cs b/mcs/class/System/Test/System.Net/ServicePointTest.cs
deleted file mode 100644
index 92290f1854d..00000000000
--- a/mcs/class/System/Test/System.Net/ServicePointTest.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-//
-// ServicePointTest.cs - NUnit Test Cases for System.Net.ServicePoint
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.IO;
-using System.Net;
-using System.Threading;
-
-namespace MonoTests.System.Net
-{
-
-public class ServicePointTest : TestCase
-{
- public ServicePointTest () :
- base ("[MonoTests.System.Net.ServicePointTest]") {}
-
- public ServicePointTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (ServicePointTest));
- }
- }
-
- public void TestAll ()
- {
- try {
- ServicePoint p = ServicePointManager.FindServicePoint (new Uri ("mailto:xx@yyy.com"));
- WriteServicePoint ("A servicepoint that isn't really", p);
-
- ServicePointManager.MaxServicePoints = 2;
- ServicePoint google = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com"));
- try {
- ServicePoint slashdot = ServicePointManager.FindServicePoint (new Uri ("http://www.slashdot.org"));
- Fail ("#1");
- } catch (InvalidOperationException) { }
- ServicePointManager.MaxServicePoints = 0;
-
- WriteServicePoint ("google before getting a webrequest", google);
-
- HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
- HttpWebResponse res = (HttpWebResponse) req.GetResponse ();
-
- WriteServicePoint ("google after getting a response", google);
- ServicePoint google2 = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com/dilbert.html"));
- AssertEquals ("#equals", google, google2);
- res.Close ();
-
- // in both instances property CurrentConnections is 0 according to ms.net.
- // let's see what it says when we do async operations...
-
- HttpWebRequest req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
- req2.Method = "PUT";
- IAsyncResult async = req2.BeginGetRequestStream (null, null);
- WriteServicePoint ("after async BeginGetRequestStream", google);
- // CurrentConnections: 1
- Stream stream2 = req2.EndGetRequestStream (async);
- WriteServicePoint ("after async EndGetRequestStream", google);
- // CurrentConnections: 1
- stream2.Close ();
-
- req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
- async = req2.BeginGetResponse (null, null);
- WriteServicePoint ("after async BeginGetResponse", google);
- // CurrentConnections: 2
- WebResponse res2 = req2.EndGetResponse (async);
- WriteServicePoint ("after async EndGetResponse", google);
- // CurrentConnections: 0
- // curious that after you get the webresponse object CurrentConnections is set to 0.
- // you'd think that you'd still be connected until you close the webresponse..
- Console.WriteLine ("ContentLength: " + res2.ContentLength);
- res2.Close ();
-
-
- // unless of course some buffering is taking place.. let's check
- Uri uri2 = new Uri ("http://www.apache.org/dist/httpd/httpd-2.0.36.tar.gz");
- ServicePoint sp2 = ServicePointManager.FindServicePoint (uri2);
- req2 = (HttpWebRequest) WebRequest.Create (uri2);
- async = req2.BeginGetResponse (null, null);
- WriteServicePoint ("Large file: after async BeginGetResponse", sp2);
- // CurrentConnections: 1
- res2 = req2.EndGetResponse (async);
- WriteServicePoint ("Large file: after async EndGetResponse", sp2);
- // CurrentConnections: 1
- // and so it shows
- Console.WriteLine ("ContentLength: " + res2.ContentLength);
- res2.Close ();
-
-
- // what's the limit of the cache?
- req2 = (HttpWebRequest) WebRequest.Create ("http://www.apache.org/");
- res2 = req2.GetResponse ();
- sp2 = ServicePointManager.FindServicePoint (new Uri("http://www.apache.org/"));
- WriteServicePoint ("apache", sp2);
- Console.WriteLine ("ContentLength: " + res2.ContentLength);
- // CurrentConnections: 1
- res2.Close ();
- // curious other effect: address is actually the full Uri of the previous request
- // anyways, buffer is probably 4096 bytes
-
-
- } catch (WebException e) {
- Console.WriteLine("\nThe following Exception was raised : {0}", e.Message);
- }
- }
-
- // try getting the stream to 5 web response objects
- // while ConnectionLimit equals 2
- /*
- public void TestConnectionLimit ()
- {
- try {
- // the default is already 2, just in case it isn't..
- ServicePointManager.DefaultConnectionLimit = 2;
-
- Uri uri = new Uri ("http://www.apache.org/dist/httpd/httpd-2.0.36.tar.gz");
- ServicePoint sp = ServicePointManager.FindServicePoint (uri);
- WebResponse [] res = new WebResponse [5];
- for (int i = 0; i < 5; i++) {
- Console.WriteLine ("GOT1 : " + i);
- HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);
- Console.WriteLine ("GOT2 : " + i);
- res [i] = req.GetResponse ();
- WriteServicePoint ("after getting " + (i + 1) + " web response objects", sp);
- }
-
- for (int i = 0; i < 5; i++) {
- Stream stream = res [i].GetResponseStream();
- Console.WriteLine ("Reading stream: " + i + " : " + stream);
- int len = 0;
- while (stream.ReadByte () != -1)
- len++;
- Console.WriteLine ("Finished reading: " + len + " bytes");
- }
-
- for (int i = 0; i < 5; i++) {
- res [i].Close ();
- }
- } catch (WebException e) {
- Console.WriteLine("\nThe following Exception was raised : {0}", e.Message);
- }
- }
- */
-
- private void WriteServicePoint (string label, ServicePoint sp)
- {
- Console.WriteLine ("\n" + label);
- Console.WriteLine ("Address: " + sp.Address);
- Console.WriteLine ("ConnectionLimit: " + sp.ConnectionLimit);
- Console.WriteLine ("ConnectionName: " + sp.ConnectionName);
- Console.WriteLine ("CurrentConnections: " + sp.CurrentConnections);
- Console.WriteLine ("IdleSince: " + sp.IdleSince);
- Console.WriteLine ("MaxIdletime: " + sp.MaxIdleTime);
- Console.WriteLine ("ProtocolVersion: " + sp.ProtocolVersion);
- Console.WriteLine ("SupportsPipelining: " + sp.SupportsPipelining);
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/SocketPermissionTest.cs b/mcs/class/System/Test/System.Net/SocketPermissionTest.cs
deleted file mode 100644
index 36137fdee8d..00000000000
--- a/mcs/class/System/Test/System.Net/SocketPermissionTest.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// SocketPermissionTest.cs - NUnit Test Cases for System.Net.SocketPermission
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace MonoTests.System.Net
-{
-
-public class SocketPermissionTest : TestCase
-{
- SocketPermission s1;
- SocketPermission s2;
-
- public SocketPermissionTest () :
- base ("[MonoTests.System.Net.SocketPermissionTest]") {}
-
- public SocketPermissionTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- s1 = new SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "12.13.14.15", 80);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.All, "localhost", 8080);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.All, "123", SocketPermission.AllPorts);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.All, "www.ximian.com", SocketPermission.AllPorts);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.All, "120.4.3.2", SocketPermission.AllPorts);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "www.google.com", 80);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.All, "1.*.10.*.99", SocketPermission.AllPorts);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.All, "128.0.0.1", SocketPermission.AllPorts);
- //s1.AddPermission(NetworkAccess.Accept, TransportType.All, "0.0.0.0", SocketPermission.AllPorts);
- s1.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.4.*", SocketPermission.AllPorts);
-
- s2 = new SocketPermission(NetworkAccess.Connect, TransportType.All, "12.13.14.15", 80);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.All, "localhost", 8080);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.All, "123", 8080);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "www.google.com", SocketPermission.AllPorts);
- s2.AddPermission(NetworkAccess.Accept, TransportType.All, "213.*.*.*", SocketPermission.AllPorts);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.All, "128.0.0.1", 9090);
- s2.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "216.239.*.*", SocketPermission.AllPorts);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.All, "128.0.0.1", SocketPermission.AllPorts);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "120.4.3.2", 80);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.All, "196.*.*.*", SocketPermission.AllPorts);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.All, "1.*.*.*.99", SocketPermission.AllPorts);
- s2.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.*.*", 9090);
- //s2.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.4.7", SocketPermission.AllPorts);
- }
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (SocketPermissionTest));
- }
- }
-
- public void TestIsSubsetOf ()
- {
- s1 = new SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "12.13.14.15", 80);
- s1.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.4.*", SocketPermission.AllPorts);
- s2 = new SocketPermission(NetworkAccess.Connect, TransportType.All, "12.13.14.15", 80);
- s2.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.*.*", 9090);
-
- Assert ("#1", !s1.IsSubsetOf (s2));
- Assert ("#2", !s2.IsSubsetOf (s1));
-
- s1 = new SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "12.13.14.15", 80);
- s1.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.4.*", 9090);
- s2 = new SocketPermission(NetworkAccess.Connect, TransportType.All, "12.13.14.15", 80);
- s2.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.*.*", 9090);
-
- Assert ("#3: bug in MS.Net", s1.IsSubsetOf (s2));
- Assert ("#4", !s2.IsSubsetOf (s1));
-
- s1 = new SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "12.13.*.*", 80);
- s2 = new SocketPermission(NetworkAccess.Connect, TransportType.All, "12.13.14.*", 80);
- Assert ("#5", !s1.IsSubsetOf (s2));
- Assert ("#6", !s2.IsSubsetOf (s1));
-
- s1 = new SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "12.13.14.15", 80);
- s1.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "10.11.*.*", 9090);
- s2 = new SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "12.13.14.15", 80);
- s2.AddPermission(NetworkAccess.Accept, TransportType.All, "10.11.4.*", SocketPermission.AllPorts);
- Assert ("#7", !s1.IsSubsetOf (s2));
- Assert ("#8", !s2.IsSubsetOf (s1));
- }
-
- public void TestIntersect ()
- {
- }
-
- public void TestUnion ()
- {
- }
-
- public void TestXml ()
- {
- SecurityElement elem = s2.ToXml ();
- s1.FromXml (elem);
- Assert ("#1", s2.IsSubsetOf (s1) && s1.IsSubsetOf (s2));
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs b/mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs
deleted file mode 100644
index 32d22cb30f3..00000000000
--- a/mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-//
-// WebHeaderCollectionTest.cs - NUnit Test Cases for System.Net.WebHeaderCollection
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Collections;
-
-namespace MonoTests.System.Net
-{
-
-public class WebHeaderCollectionTest : TestCase
-{
- WebHeaderCollection col;
-
- public WebHeaderCollectionTest () :
- base ("[MonoTests.System.Net.WebHeaderCollectionTest]") {}
-
- public WebHeaderCollectionTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- col = new WebHeaderCollection ();
- col.Add ("Name1: Value1");
- col.Add ("Name2: Value2");
- }
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (WebHeaderCollectionTest));
- }
- }
-
- public void TestAdd ()
- {
- try {
- col.Add (null);
- Fail ("#1");
- } catch (ArgumentNullException) {}
- try {
- col.Add ("");
- Fail ("#2");
- } catch (ArgumentException) {}
- try {
- col.Add (" ");
- Fail ("#3");
- } catch (ArgumentException) {}
- try {
- col.Add (":");
- Fail ("#4");
- } catch (ArgumentException) {}
- try {
- col.Add (" : ");
- Fail ("#5");
- } catch (ArgumentException) {}
-
- try {
- col.Add ("XHost: foo");
- } catch (ArgumentException) {
- Fail ("#7");
- }
-
- // invalid values
- try {
- col.Add ("XHost" + ((char) 0xa9) + ": foo");
- Fail ("#8");
- } catch (ArgumentException) {}
- try {
- col.Add ("XHost: foo" + (char) 0xa9);
- } catch (ArgumentException) {
- Fail ("#9");
- }
- try {
- col.Add ("XHost: foo" + (char) 0x7f);
- Fail ("#10");
- } catch (ArgumentException) {
-
- }
-
- try {
- col.Add ("XHost", null);
- } catch (ArgumentException) {
- Fail ("#11");
- }
- try {
- col.Add ("XHost:");
- } catch (ArgumentException) {
- Fail ("#12");
- }
-
- // restricted
- /*
- // this can only be tested in namespace System.Net
- try {
- WebHeaderCollection col2 = new WebHeaderCollection (true);
- col2.Add ("Host: foo");
- Fail ("#13: should fail according to spec");
- } catch (ArgumentException) {}
- */
- }
-
- public void TestGetValues ()
- {
- WebHeaderCollection w = new WebHeaderCollection ();
- w.Add ("Hello", "H1");
- w.Add ("Hello", "H2");
- w.Add ("Hello", "H3,H4");
-
- string [] sa = w.GetValues ("Hello");
- AssertEquals ("#1", 3, sa.Length);
- AssertEquals ("#2", "H1,H2,H3,H4", w.Get ("Hello"));
-
- w = new WebHeaderCollection ();
- w.Add ("Accept", "H1");
- w.Add ("Accept", "H2");
- w.Add ("Accept", "H3,H4");
- AssertEquals ("#3a", 3, w.GetValues (0).Length);
- AssertEquals ("#3b", 4, w.GetValues ("Accept").Length);
- AssertEquals ("#4", "H1,H2,H3,H4", w.Get ("Accept"));
-
- w = new WebHeaderCollection ();
- w.Add ("Allow", "H1");
- w.Add ("Allow", "H2");
- w.Add ("Allow", "H3,H4");
- sa = w.GetValues ("Allow");
- AssertEquals ("#5", 4, sa.Length);
- AssertEquals ("#6", "H1,H2,H3,H4", w.Get ("Allow"));
-
- w = new WebHeaderCollection ();
- w.Add ("AUTHorization", "H1, H2, H3");
- sa = w.GetValues ("authorization");
- AssertEquals ("#9", 3, sa.Length);
-
- w = new WebHeaderCollection ();
- w.Add ("proxy-authenticate", "H1, H2, H3");
- sa = w.GetValues ("Proxy-Authenticate");
- AssertEquals ("#9", 3, sa.Length);
-
- w = new WebHeaderCollection ();
- w.Add ("expect", "H1,\tH2, H3 ");
- sa = w.GetValues ("EXPECT");
- AssertEquals ("#10", 3, sa.Length);
- AssertEquals ("#11", "H2", sa [1]);
- AssertEquals ("#12", "H3", sa [2]);
-
- try {
- w.GetValues (null);
- Fail ("#13");
- } catch (ArgumentNullException) {}
- AssertEquals ("#14", null, w.GetValues (""));
- AssertEquals ("#15", null, w.GetValues ("NotExistent"));
- }
-
- public void TestIndexers ()
- {
- AssertEquals ("#1", "Value1", col [0]);
- AssertEquals ("#2", "Value1", col ["Name1"]);
- AssertEquals ("#3", "Value1", col ["NAME1"]);
- }
-
- public void TestRemove ()
- {
- col.Remove ("Name1");
- col.Remove ("NameNotExist");
- AssertEquals ("#1", 1, col.Count);
-
- /*
- // this can only be tested in namespace System.Net
- try {
- WebHeaderCollection col2 = new WebHeaderCollection (true);
- col2.Add ("Host", "foo");
- col2.Remove ("Host");
- Fail ("#2: should fail according to spec");
- } catch (ArgumentException) {}
- */
- }
-
- public void TestSet ()
- {
- col.Add ("Name1", "Value1b");
- col.Set ("Name1", "\t X \t");
- AssertEquals ("#1", "X", col.Get ("Name1"));
- }
-
- public void TestIsRestricted ()
- {
- Assert ("#1", !WebHeaderCollection.IsRestricted ("Xhost"));
- Assert ("#2", WebHeaderCollection.IsRestricted ("Host"));
- Assert ("#3", WebHeaderCollection.IsRestricted ("HOST"));
- Assert ("#4", WebHeaderCollection.IsRestricted ("Transfer-Encoding"));
- Assert ("#5", WebHeaderCollection.IsRestricted ("user-agent"));
- Assert ("#6", WebHeaderCollection.IsRestricted ("accept"));
- Assert ("#7", !WebHeaderCollection.IsRestricted ("accept-charset"));
- }
-
- public void TestToString ()
- {
- col.Add ("Name1", "Value1b");
- col.Add ("Name3", "Value3a\r\n Value3b");
- col.Add ("Name4", " Value4 ");
- AssertEquals ("#1", "Name1: Value1,Value1b\r\nName2: Value2\r\nName3: Value3a\r\n Value3b\r\nName4: Value4\r\n\r\n", col.ToString ());
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/WebProxyTest.cs b/mcs/class/System/Test/System.Net/WebProxyTest.cs
deleted file mode 100644
index 866a7a414a3..00000000000
--- a/mcs/class/System/Test/System.Net/WebProxyTest.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// WebProxyTest.cs - NUnit Test Cases for System.Net.WebProxy
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.IO;
-using System.Net;
-using System.Threading;
-
-namespace MonoTests.System.Net
-{
-
-public class WebProxyTest : TestCase
-{
- private Uri googleUri;
- private Uri yahooUri;
- private Uri apacheUri;
-
- public WebProxyTest () :
- base ("[MonoTests.System.Net.WebProxyTest]") {}
-
- public WebProxyTest (string name) : base (name) {}
-
- protected override void SetUp () {
- googleUri = new Uri ("http://www.google.com");
- yahooUri = new Uri ("http://www.yahoo.com");
- apacheUri = new Uri ("http://www.apache.org");
- }
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (WebProxyTest));
- }
- }
-
- public void TestConstructors ()
- {
- WebProxy p = new WebProxy ();
- Assert("#1", p.Address == null);
- AssertEquals ("#2", 0, p.BypassArrayList.Count);
- AssertEquals ("#3", 0, p.BypassList.Length);
- AssertEquals ("#4", false, p.BypassProxyOnLocal);
- try {
- p.BypassList = null;
- Fail ("#5 not spec'd, but should follow ms.net implementation");
- } catch (ArgumentNullException) {}
-
- p = new WebProxy ("webserver.com", 8080);
- AssertEquals ("#6", new Uri ("http://webserver.com:8080/"), p.Address);
-
- p = new WebProxy ("webserver");
- AssertEquals ("#7", new Uri ("http://webserver"), p.Address);
-
- p = new WebProxy ("webserver.com");
- AssertEquals ("#8", new Uri ("http://webserver.com"), p.Address);
-
- p = new WebProxy ("http://webserver.com");
- AssertEquals ("#9", new Uri ("http://webserver.com"), p.Address);
-
- p = new WebProxy ("file://webserver");
- AssertEquals ("#10", new Uri ("file://webserver"), p.Address);
-
- p = new WebProxy ("http://www.contoso.com", true, null, null);
- AssertEquals ("#11", 0, p.BypassList.Length);
- AssertEquals ("#12", 0, p.BypassArrayList.Count);
-
- try {
- p = new WebProxy ("http://contoso.com", true,
- new string [] {"?^!@#$%^&}{]["}, null);
- Fail ("#13: illegal regular expression");
- } catch (ArgumentException) {
- }
- }
-
- public void TestBypassArrayList ()
- {
- Uri proxy1 = new Uri("http://proxy.contoso.com");
- Uri proxy2 = new Uri ("http://proxy2.contoso.com");
-
- WebProxy p = new WebProxy (proxy1, true);
- p.BypassArrayList.Add ("http://proxy2.contoso.com");
- p.BypassArrayList.Add ("http://proxy2.contoso.com");
- AssertEquals ("#1", 2, p.BypassList.Length);
- Assert ("#2", !p.IsBypassed (new Uri ("http://www.google.com")));
- Assert ("#3", p.IsBypassed (proxy2));
- AssertEquals ("#4", proxy2, p.GetProxy (proxy2));
-
- p.BypassArrayList.Add ("?^!@#$%^&}{][");
- AssertEquals ("#10", 3, p.BypassList.Length);
- try {
- Assert ("#11", !p.IsBypassed (proxy2));
- Assert ("#12", !p.IsBypassed (new Uri ("http://www.x.com")));
- AssertEquals ("#13", proxy1, p.GetProxy (proxy2));
- // hmm... although #11 and #13 succeeded before (#3 resp. #4),
- // it now fails to bypass, and the IsByPassed and GetProxy
- // methods do not fail.. so when an illegal regular
- // expression is added through this property it's ignored.
- // probably an ms.net bug?? :(
- } catch (ArgumentException) {
- Fail ("#15: illegal regular expression");
- }
- }
-
- public void TestBypassList ()
- {
- Uri proxy1 = new Uri("http://proxy.contoso.com");
- Uri proxy2 = new Uri ("http://proxy2.contoso.com");
-
- WebProxy p = new WebProxy (proxy1, true);
- try {
- p.BypassList = new string [] {"http://proxy2.contoso.com", "?^!@#$%^&}{]["};
- Fail ("#1");
- } catch (ArgumentException) {
- // weird, this way invalid regex's fail again..
- }
-
- AssertEquals ("#2", 2, p.BypassList.Length);
- // but it did apparenly store the regex's !
-
- p.BypassList = new string [] {"http://www.x.com"};
- AssertEquals ("#3", 1, p.BypassList.Length);
-
- try {
- p.BypassList = null;
- Fail ("#4");
- } catch (ArgumentNullException) {}
-
- AssertEquals ("#4", 1, p.BypassList.Length);
- }
-
- public void TestGetProxy ()
- {
- }
-
- public void TestIsByPassed ()
- {
- WebProxy p = new WebProxy ("http://proxy.contoso.com", true);
- Assert ("#1", !p.IsBypassed (new Uri ("http://www.google.com")));
- Assert ("#2", p.IsBypassed (new Uri ("http://localhost/index.html")));
- Assert ("#3", p.IsBypassed (new Uri ("http://localhost:8080/index.html")));
- Assert ("#4", p.IsBypassed (new Uri ("http://loopback:8080/index.html")));
- Assert ("#5", p.IsBypassed (new Uri ("http://127.0.0.01:8080/index.html")));
- Assert ("#6", p.IsBypassed (new Uri ("http://webserver/index.html")));
- Assert ("#7", !p.IsBypassed (new Uri ("http://webserver.com/index.html")));
- try {
- p.IsBypassed (null);
- Fail ("#8 not spec'd, but should follow ms.net implementation");
- } catch (NullReferenceException) {}
-
- p = new WebProxy ("http://proxy.contoso.com", false);
- Assert ("#11", !p.IsBypassed (new Uri ("http://www.google.com")));
- Assert ("#12: lamespec of ms.net", p.IsBypassed (new Uri ("http://localhost/index.html")));
- Assert ("#13: lamespec of ms.net", p.IsBypassed (new Uri ("http://localhost:8080/index.html")));
- Assert ("#14: lamespec of ms.net", p.IsBypassed (new Uri ("http://loopback:8080/index.html")));
- Assert ("#15: lamespec of ms.net", p.IsBypassed (new Uri ("http://127.0.0.01:8080/index.html")));
- Assert ("#16", !p.IsBypassed (new Uri ("http://webserver/index.html")));
-
- p.BypassList = new string [] { "google.com", "contoso.com" };
- Assert ("#20", p.IsBypassed (new Uri ("http://www.google.com")));
- Assert ("#21", p.IsBypassed (new Uri ("http://www.GOOGLE.com")));
- Assert ("#22", p.IsBypassed (new Uri ("http://www.contoso.com:8080/foo/bar/index.html")));
- Assert ("#23", !p.IsBypassed (new Uri ("http://www.contoso2.com:8080/foo/bar/index.html")));
- Assert ("#24", !p.IsBypassed (new Uri ("http://www.foo.com:8080/contoso.com.html")));
-
- p.BypassList = new string [] { "https" };
- Assert ("#30", !p.IsBypassed (new Uri ("http://www.google.com")));
- Assert ("#31", p.IsBypassed (new Uri ("https://www.google.com")));
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Net/WebRequestTest.cs b/mcs/class/System/Test/System.Net/WebRequestTest.cs
deleted file mode 100644
index e3f640e936d..00000000000
--- a/mcs/class/System/Test/System.Net/WebRequestTest.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-// WebRequestTest.cs - NUnit Test Cases for System.Net.WebRequest
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Net;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace MonoTests.System.Net
-{
-
-public class WebRequestTest : TestCase
-{
- public WebRequestTest () :
- base ("[MonoTests.System.Net.WebRequestTest]") {}
-
- public WebRequestTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (WebRequestTest));
- }
- }
-
- public void TestAll ()
- {
- WebRequest req = WebRequest.Create ("http://www.contoso.com");
- Assert ("#1", req is HttpWebRequest);
- req = WebRequest.Create ("https://www.contoso.com");
- Assert ("#2", req is HttpWebRequest);
- req = WebRequest.Create ("file://www.contoso.com");
- Assert ("#3", req is FileWebRequest);
-
- WebRequest.RegisterPrefix ("http://www.contoso.com", new TestWebRequestCreator ());
- bool ret = WebRequest.RegisterPrefix ("http://WWW.contoso.com", new TestWebRequestCreator ());
- AssertEquals ("#4a", false, ret);
- ret = WebRequest.RegisterPrefix ("http://www.contoso.com/foo/bar", new TestWebRequestCreator2 ());
- AssertEquals ("#4b", true, ret);
- ret = WebRequest.RegisterPrefix ("http://www", new TestWebRequestCreator3 ());
- AssertEquals ("#4c", true, ret);
-
- req = WebRequest.Create ("http://WWW.contoso.com");
- Assert ("#5", req is TestWebRequest);
-
- req = WebRequest.Create ("http://WWW.contoso.com/foo/bar/index.html");
- Assert ("#6", req is TestWebRequest2);
-
- req = WebRequest.Create ("http://WWW.x.com");
- Assert ("#7", req is TestWebRequest3);
-
- req = WebRequest.Create ("http://WWW.c");
- Assert ("#8", req is TestWebRequest3);
-
- req = WebRequest.CreateDefault (new Uri("http://WWW.contoso.com"));
- Assert ("#9", req is HttpWebRequest);
-
- try {
- req = WebRequest.Create ("tcp://www.contoso.com");
- Fail ("#10 should have failed with NotSupportedException");
- } catch (NotSupportedException) {
- }
- }
-
- internal class TestWebRequestCreator : IWebRequestCreate
- {
- internal TestWebRequestCreator () { }
-
- public WebRequest Create (Uri uri)
- {
- return new TestWebRequest ();
- }
- }
-
- internal class TestWebRequest : WebRequest
- {
- internal TestWebRequest () { }
- }
-
- internal class TestWebRequestCreator2 : IWebRequestCreate
- {
- internal TestWebRequestCreator2 () { }
-
- public WebRequest Create (Uri uri)
- {
- return new TestWebRequest2 ();
- }
- }
-
- internal class TestWebRequest2 : WebRequest
- {
- internal TestWebRequest2 () { }
- }
-
- internal class TestWebRequestCreator3 : IWebRequestCreate
- {
- internal TestWebRequestCreator3 () { }
-
- public WebRequest Create (Uri uri)
- {
- return new TestWebRequest3 ();
- }
- }
-
- internal class TestWebRequest3 : WebRequest
- {
- internal TestWebRequest3 () { }
- }
-}
-
-}
-
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs b/mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs
deleted file mode 100644
index 6016eeef70a..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/AllTests.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// assembly: System_test
-// namespace: MonoTests.System.Text.RegularExpressions
-// file: AllTests.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- public class AllTests : TestCase {
- public AllTests (string name) : base (name) { }
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (PerlTest.Suite);
-
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs b/mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs
deleted file mode 100644
index f09681a91cc..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTest.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// assembly: System_test
-// namespace: MonoTests.System.Text.RegularExpressions
-// file: PerlTest.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System;
-using System.Text.RegularExpressions;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- public class PerlTest : TestCase {
- public static ITest Suite {
- get { return new TestSuite (typeof (PerlTest)); }
- }
-
- public PerlTest () : this ("System.Text.RegularExpressions Perl testsuite") { }
- public PerlTest (string name) : base (name) { }
-
- public void TestTrials () {
- foreach (RegexTrial trial in PerlTrials.trials) {
- string actual = trial.Execute ();
- if (actual != trial.Expected) {
- Assertion.Fail (
- trial.ToString () +
- "Expected " + trial.Expected +
- " but got " + actual
- );
- }
- }
- }
-
- protected override void SetUp () { }
- protected override void TearDown () { }
- }
-}
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs b/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs
deleted file mode 100644
index eecb7a454c5..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/PerlTrials.cs
+++ /dev/null
@@ -1,746 +0,0 @@
-//
-// assembly: System_test
-// namespace: MonoTests.System.Text.RegularExpressions
-// file: PerlTrials.cs
-//
-// author: Dan Lewis (dlewis@gmx.co.uk)
-// (c) 2002
-
-using System.Text.RegularExpressions;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- class PerlTrials {
- // ported from perl-5.6.1/t/op/re_tests
-
- public static RegexTrial[] trials = new RegexTrial[] {
- new RegexTrial (@"abc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.None, "xbc", "Fail."),
- new RegexTrial (@"abc", RegexOptions.None, "axc", "Fail."),
- new RegexTrial (@"abc", RegexOptions.None, "abx", "Fail."),
- new RegexTrial (@"abc", RegexOptions.None, "xabcy", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"abc", RegexOptions.None, "ababc", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"ab*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab*bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@".{1}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@".{3,4}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab{0,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abc", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abq", "Fail."),
- new RegexTrial (@"ab{1,}bc", RegexOptions.None, "abq", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,3}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{3,4}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{4,5}bc", RegexOptions.None, "abbbbc", "Fail."),
- new RegexTrial (@"ab?bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab?bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab?bc", RegexOptions.None, "abbbbc", "Fail."),
- new RegexTrial (@"ab?c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.None, "abcc", "Fail."),
- new RegexTrial (@"^abc", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.None, "aabc", "Fail."),
- new RegexTrial (@"abc$", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"abc$", RegexOptions.None, "aabcd", "Fail."),
- new RegexTrial (@"^", RegexOptions.None, "abc", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"$", RegexOptions.None, "abc", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"a.c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.c", RegexOptions.None, "axc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.*c", RegexOptions.None, "axyzc", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"a.*c", RegexOptions.None, "axyzd", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.None, "abc", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.None, "abd", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]e", RegexOptions.None, "abd", "Fail."),
- new RegexTrial (@"a[b-d]e", RegexOptions.None, "ace", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]", RegexOptions.None, "aac", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"a[-b]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-a]", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a[]b", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a[", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a]", RegexOptions.None, "a]", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[]]b", RegexOptions.None, "a]b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.None, "aed", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.None, "abd", "Fail."),
- new RegexTrial (@"a[^-b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^-b]c", RegexOptions.None, "a-c", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.None, "a]c", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"\ba\b", RegexOptions.None, "a-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\ba\b", RegexOptions.None, "-a", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\ba\b", RegexOptions.None, "-a-", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\by\b", RegexOptions.None, "xy", "Fail."),
- new RegexTrial (@"\by\b", RegexOptions.None, "yz", "Fail."),
- new RegexTrial (@"\by\b", RegexOptions.None, "xyz", "Fail."),
- new RegexTrial (@"\Ba\B", RegexOptions.None, "a-", "Fail."),
- new RegexTrial (@"\Ba\B", RegexOptions.None, "-a", "Fail."),
- new RegexTrial (@"\Ba\B", RegexOptions.None, "-a-", "Fail."),
- new RegexTrial (@"\By\b", RegexOptions.None, "xy", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\by\B", RegexOptions.None, "yz", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\By\B", RegexOptions.None, "xyz", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"\w", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\w", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"\W", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"\W", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"a\sb", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a\sb", RegexOptions.None, "a-b", "Fail."),
- new RegexTrial (@"a\Sb", RegexOptions.None, "a b", "Fail."),
- new RegexTrial (@"a\Sb", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"\d", RegexOptions.None, "1", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"\d", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"\D", RegexOptions.None, "1", "Fail."),
- new RegexTrial (@"\D", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"[\w]", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"[\w]", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"[\W]", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"[\W]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"a[\s]b", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[\s]b", RegexOptions.None, "a-b", "Fail."),
- new RegexTrial (@"a[\S]b", RegexOptions.None, "a b", "Fail."),
- new RegexTrial (@"a[\S]b", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"[\d]", RegexOptions.None, "1", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"[\d]", RegexOptions.None, "-", "Fail."),
- new RegexTrial (@"[\D]", RegexOptions.None, "1", "Fail."),
- new RegexTrial (@"[\D]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"ab|cd", RegexOptions.None, "abc", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"ab|cd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"()ef", RegexOptions.None, "def", "Pass. Group[0]=(1,2) Group[1]=(1,0)"),
- new RegexTrial (@"*a", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(*)b", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"$b", RegexOptions.None, "b", "Fail."),
- new RegexTrial (@"a\", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a\(b", RegexOptions.None, "a(b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a\(*b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a\(*b", RegexOptions.None, "a((b", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a\\b", RegexOptions.None, "a\\b", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc)", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(abc", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"((a))", RegexOptions.None, "abc", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"(a)b(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)"),
- new RegexTrial (@"a+b+c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a{1,}b{1,}c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a**", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a.+?c", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"(a+|b)*", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){0,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)+", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){1,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)?", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a+|b){0,1}", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@")(", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"[^ab]*", RegexOptions.None, "cde", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.None, "", "Fail."),
- new RegexTrial (@"a*", RegexOptions.None, "", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"([abc])*d", RegexOptions.None, "abbbcd", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)"),
- new RegexTrial (@"([abc])*bcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,1)"),
- new RegexTrial (@"a|b|c|d|e", RegexOptions.None, "e", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(a|b|c|d|e)f", RegexOptions.None, "ef", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"abcd*efg", RegexOptions.None, "abcdefg", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"ab*", RegexOptions.None, "xabyabbbz", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"ab*", RegexOptions.None, "xayabbbz", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(ab|cd)e", RegexOptions.None, "abcde", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"[abhgefdc]ij", RegexOptions.None, "hij", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^(ab|cd)e", RegexOptions.None, "abcde", "Fail."),
- new RegexTrial (@"(abc|)ef", RegexOptions.None, "abcdef", "Pass. Group[0]=(4,2) Group[1]=(4,0)"),
- new RegexTrial (@"(a|b)c*d", RegexOptions.None, "abcd", "Pass. Group[0]=(1,3) Group[1]=(1,1)"),
- new RegexTrial (@"(ab|ab*)bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)"),
- new RegexTrial (@"a([bc]*)c*", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,2)"),
- new RegexTrial (@"a([bc]*)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]+)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]*)(c+d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)"),
- new RegexTrial (@"a[bcd]*dcdcde", RegexOptions.None, "adcdcde", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"a[bcd]+dcdcde", RegexOptions.None, "adcdcde", "Fail."),
- new RegexTrial (@"(ab|a)b*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,2)"),
- new RegexTrial (@"((a)(b)c)(d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)"),
- new RegexTrial (@"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.None, "alpha", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^a(bc+|b[eh])g|.h$", RegexOptions.None, "abh", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effgz", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "ij", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)"),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effg", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "bcdd", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "reffgz", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]="),
- new RegexTrial (@"((((((((((a))))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))\10", RegexOptions.None, "aa", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.None, "aa", "Fail."),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.None, "a!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"(((((((((a)))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)"),
- new RegexTrial (@"multiple words of text", RegexOptions.None, "uh-uh", "Fail."),
- new RegexTrial (@"multiple words", RegexOptions.None, "multiple words, yeah", "Pass. Group[0]=(0,14)"),
- new RegexTrial (@"(.*)c(.*)", RegexOptions.None, "abcde", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)"),
- new RegexTrial (@"\((.*), (.*)\)", RegexOptions.None, "(a, b)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)"),
- new RegexTrial (@"[k]", RegexOptions.None, "ab", "Fail."),
- new RegexTrial (@"abcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a(bc)d", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2)"),
- new RegexTrial (@"a[-]?c", RegexOptions.None, "ac", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"(abc)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"([a-c]*)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"\1", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"\2", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(a)|\1", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a)|\1", RegexOptions.None, "x", "Fail."),
- new RegexTrial (@"(a)|\2", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(([a-c])b*?\2)*", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,2) Group[2]=(0,1)(3,1)"),
- new RegexTrial (@"(([a-c])b*?\2){3}", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,9) Group[1]=(0,3)(3,3)(6,3) Group[2]=(0,1)(3,1)(6,1)"),
- new RegexTrial (@"((\3|b)\2(a)x)+", RegexOptions.None, "aaxabxbaxbbx", "Fail."),
- new RegexTrial (@"((\3|b)\2(a)x)+", RegexOptions.None, "aaaxabaxbaaxbbax", "Pass. Group[0]=(12,4) Group[1]=(12,4) Group[2]=(12,1) Group[3]=(14,1)"),
- new RegexTrial (@"((\3|b)\2(a)){2,}", RegexOptions.None, "bbaababbabaaaaabbaaaabba", "Pass. Group[0]=(15,9) Group[1]=(15,3)(18,3)(21,3) Group[2]=(15,1)(18,1)(21,1) Group[3]=(17,1)(20,1)(23,1)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "XBC", "Fail."),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "AXC", "Fail."),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "ABX", "Fail."),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "XABCY", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "ABABC", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"ab*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab*bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab*?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{0,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab+?bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab+bc", RegexOptions.IgnoreCase, "ABC", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.IgnoreCase, "ABQ", "Fail."),
- new RegexTrial (@"ab{1,}bc", RegexOptions.IgnoreCase, "ABQ", "Fail."),
- new RegexTrial (@"ab+bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{1,3}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{3,4}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"ab{4,5}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail."),
- new RegexTrial (@"ab??bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"ab??bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}?bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab??bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail."),
- new RegexTrial (@"ab??c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab{0,1}?c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.IgnoreCase, "ABCC", "Fail."),
- new RegexTrial (@"^abc", RegexOptions.IgnoreCase, "ABCC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^abc$", RegexOptions.IgnoreCase, "AABC", "Fail."),
- new RegexTrial (@"abc$", RegexOptions.IgnoreCase, "AABC", "Pass. Group[0]=(1,3)"),
- new RegexTrial (@"^", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"a.c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.c", RegexOptions.IgnoreCase, "AXC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.*?c", RegexOptions.IgnoreCase, "AXYZC", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"a.*c", RegexOptions.IgnoreCase, "AXYZD", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.IgnoreCase, "ABC", "Fail."),
- new RegexTrial (@"a[bc]d", RegexOptions.IgnoreCase, "ABD", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]e", RegexOptions.IgnoreCase, "ABD", "Fail."),
- new RegexTrial (@"a[b-d]e", RegexOptions.IgnoreCase, "ACE", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[b-d]", RegexOptions.IgnoreCase, "AAC", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"a[-b]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[b-a]", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a[]b", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a[", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a]", RegexOptions.IgnoreCase, "A]", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a[]]b", RegexOptions.IgnoreCase, "A]B", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.IgnoreCase, "AED", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^bc]d", RegexOptions.IgnoreCase, "ABD", "Fail."),
- new RegexTrial (@"a[^-b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a[^-b]c", RegexOptions.IgnoreCase, "A-C", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.IgnoreCase, "A]C", "Fail."),
- new RegexTrial (@"a[^]b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"ab|cd", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"ab|cd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"()ef", RegexOptions.IgnoreCase, "DEF", "Pass. Group[0]=(1,2) Group[1]=(1,0)"),
- new RegexTrial (@"*a", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"(*)b", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"$b", RegexOptions.IgnoreCase, "B", "Fail."),
- new RegexTrial (@"a\", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a\(b", RegexOptions.IgnoreCase, "A(B", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a\(*b", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"a\(*b", RegexOptions.IgnoreCase, "A((B", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a\\b", RegexOptions.IgnoreCase, "A\\B", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc)", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"(abc", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"((a))", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"(a)b(c)", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)"),
- new RegexTrial (@"a+b+c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a{1,}b{1,}c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)"),
- new RegexTrial (@"a**", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"a.+?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.*?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"a.{0,5}?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"(a+|b)*", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){0,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)+", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b){1,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)"),
- new RegexTrial (@"(a+|b)?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a+|b){0,1}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(a+|b){0,1}?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,0) Group[1]="),
- new RegexTrial (@")(", RegexOptions.IgnoreCase, "-", "Error."),
- new RegexTrial (@"[^ab]*", RegexOptions.IgnoreCase, "CDE", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abc", RegexOptions.IgnoreCase, "", "Fail."),
- new RegexTrial (@"a*", RegexOptions.IgnoreCase, "", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"([abc])*d", RegexOptions.IgnoreCase, "ABBBCD", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)"),
- new RegexTrial (@"([abc])*bcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,1)"),
- new RegexTrial (@"a|b|c|d|e", RegexOptions.IgnoreCase, "E", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(a|b|c|d|e)f", RegexOptions.IgnoreCase, "EF", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"abcd*efg", RegexOptions.IgnoreCase, "ABCDEFG", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"ab*", RegexOptions.IgnoreCase, "XABYABBBZ", "Pass. Group[0]=(1,2)"),
- new RegexTrial (@"ab*", RegexOptions.IgnoreCase, "XAYABBBZ", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"[abhgefdc]ij", RegexOptions.IgnoreCase, "HIJ", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"^(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Fail."),
- new RegexTrial (@"(abc|)ef", RegexOptions.IgnoreCase, "ABCDEF", "Pass. Group[0]=(4,2) Group[1]=(4,0)"),
- new RegexTrial (@"(a|b)c*d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(1,3) Group[1]=(1,1)"),
- new RegexTrial (@"(ab|ab*)bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1)"),
- new RegexTrial (@"a([bc]*)c*", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(1,2)"),
- new RegexTrial (@"a([bc]*)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]+)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)"),
- new RegexTrial (@"a([bc]*)(c+d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)"),
- new RegexTrial (@"a[bcd]*dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Pass. Group[0]=(0,7)"),
- new RegexTrial (@"a[bcd]+dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Fail."),
- new RegexTrial (@"(ab|a)b*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,2)"),
- new RegexTrial (@"((a)(b)c)(d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)"),
- new RegexTrial (@"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.IgnoreCase, "ALPHA", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^a(bc+|b[eh])g|.h$", RegexOptions.IgnoreCase, "ABH", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFGZ", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]="),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "IJ", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)"),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFG", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "BCDD", "Fail."),
- new RegexTrial (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "REFFGZ", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]="),
- new RegexTrial (@"((((((((((a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))\10", RegexOptions.IgnoreCase, "AA", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "AA", "Fail."),
- new RegexTrial (@"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "A!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)"),
- new RegexTrial (@"(((((((((a)))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)"),
- new RegexTrial (@"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))", RegexOptions.IgnoreCase, "C", "Pass. Group[0]=(0,1) Group[1]=(0,1)"),
- new RegexTrial (@"multiple words of text", RegexOptions.IgnoreCase, "UH-UH", "Fail."),
- new RegexTrial (@"multiple words", RegexOptions.IgnoreCase, "MULTIPLE WORDS, YEAH", "Pass. Group[0]=(0,14)"),
- new RegexTrial (@"(.*)c(.*)", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)"),
- new RegexTrial (@"\((.*), (.*)\)", RegexOptions.IgnoreCase, "(A, B)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)"),
- new RegexTrial (@"[k]", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"abcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"a(bc)d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2)"),
- new RegexTrial (@"a[-]?c", RegexOptions.IgnoreCase, "AC", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"(abc)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"([a-c]*)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)"),
- new RegexTrial (@"a(?!b).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"a(?=d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"a(?=c|d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"a(?:b|c|d)(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)*(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)+?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,3) Group[1]=(2,1)"),
- new RegexTrial (@"a(?:b|c|d)+(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){2}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,4) Group[1]=(3,1)"),
- new RegexTrial (@"a(?:b|c|d){4,5}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)"),
- new RegexTrial (@"a(?:b|c|d){4,5}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,6) Group[1]=(5,1)"),
- new RegexTrial (@"((foo)|(bar))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,3)(3,3) Group[2]=(0,3) Group[3]=(3,3)"),
- new RegexTrial (@":(?:", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"a(?:b|c|d){6,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){6,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){5,6}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){5,6}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)"),
- new RegexTrial (@"a(?:b|c|d){5,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)"),
- new RegexTrial (@"a(?:b|c|d){5,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)"),
- new RegexTrial (@"a(?:b|(c|e){1,2}?|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(1,1) Group[2]=(2,1)"),
- new RegexTrial (@"^(.+)?B", RegexOptions.None, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"^([^a-z])|(\^)$", RegexOptions.None, ".", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]="),
- new RegexTrial (@"^[<>]&", RegexOptions.None, "<&OUT", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)"),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaa", "Fail."),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail."),
- new RegexTrial (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)"),
- new RegexTrial (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaa", "Fail."),
- new RegexTrial (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail."),
- new RegexTrial (@"((a{4})+)", RegexOptions.None, "aaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4)"),
- new RegexTrial (@"(((aa){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)"),
- new RegexTrial (@"(((a{2}){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)"),
- new RegexTrial (@"(?:(f)(o)(o)|(b)(a)(r))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1)"),
- new RegexTrial (@"(?<=a)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(?<=a)b", RegexOptions.None, "cb", "Fail."),
- new RegexTrial (@"(?<=a)b", RegexOptions.None, "b", "Fail."),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)"),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "cb", "Fail."),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "b", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?<!c)b", RegexOptions.None, "b", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?<%)b", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"(?:..)*a", RegexOptions.None, "aba", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"(?:..)*?a", RegexOptions.None, "aba", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"^(?:b|a(?=(.)))*\1", RegexOptions.None, "abc", "Pass. Group[0]=(0,2) Group[1]=(1,1)"),
- new RegexTrial (@"^(){3,5}", RegexOptions.None, "abc", "Pass. Group[0]=(0,0) Group[1]=(0,0)(0,0)(0,0)"),
- new RegexTrial (@"^(a+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1)"),
- new RegexTrial (@"^((a|b)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"^((a|bc)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)"),
- new RegexTrial (@"(a|x)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(a)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]="),
- new RegexTrial (@"(?:(?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?i)a)b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"((?i)a)b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"(?i:a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i:a))b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?i:a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?i:a))b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?i:a)b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"((?i:a))b", RegexOptions.None, "aB", "Fail."),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"((?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "Ab", "Fail."),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"(?-i:a)b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"((?-i:a))b", RegexOptions.IgnoreCase, "AB", "Fail."),
- new RegexTrial (@"((?-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Fail."),
- new RegexTrial (@"((?s-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Pass. Group[0]=(0,3) Group[1]=(0,2)"),
- new RegexTrial (@"((?s-i:a.))b", RegexOptions.IgnoreCase, "B\nB", "Fail."),
- new RegexTrial (@"(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))", RegexOptions.None, "cabbbb", "Pass. Group[0]=(0,6)"),
- new RegexTrial (@"(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))", RegexOptions.None, "caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "Pass. Group[0]=(0,41)"),
- new RegexTrial (@"(ab)\d\1", RegexOptions.IgnoreCase, "Ab4ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)"),
- new RegexTrial (@"(ab)\d\1", RegexOptions.IgnoreCase, "ab4Ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)"),
- new RegexTrial (@"foo\w*\d{4}baz", RegexOptions.None, "foobar1234baz", "Pass. Group[0]=(0,13)"),
- new RegexTrial (@"x(~~)*(?:(?:F)?)?", RegexOptions.None, "x~~", "Pass. Group[0]=(0,3) Group[1]=(1,2)"),
- new RegexTrial (@"^a(?#xxx){3}c", RegexOptions.None, "aaac", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"(?<![cd])b", RegexOptions.None, "dbcb", "Fail."),
- new RegexTrial (@"(?<![cd])[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"(?<!(c|d))b", RegexOptions.None, "dbcb", "Fail."),
- new RegexTrial (@"(?<!(c|d))[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1) Group[1]="),
- new RegexTrial (@"(?<!cd)[ab]", RegexOptions.None, "cdaccb", "Pass. Group[0]=(5,1)"),
- new RegexTrial (@"^(?:a?b?)*$", RegexOptions.None, "a--", "Fail."),
- new RegexTrial (@"((?s)^a(.))((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(0,3) Group[1]=(0,2) Group[2]=(1,1) Group[3]=(2,1)"),
- new RegexTrial (@"((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"(?m)^b", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"(?m)^(b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"\n((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(1,2) Group[1]=(2,1)"),
- new RegexTrial (@"((?s).)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(3,2) Group[1]=(3,1)"),
- new RegexTrial (@"((?s).)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(3,2) Group[1]=(3,1)"),
- new RegexTrial (@"((?s)b.)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"((?s)b.)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,3) Group[1]=(2,2)"),
- new RegexTrial (@"^b", RegexOptions.None, "a\nb\nc\n", "Fail."),
- new RegexTrial (@"()^b", RegexOptions.None, "a\nb\nc\n", "Fail."),
- new RegexTrial (@"((?m)^b)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)"),
- new RegexTrial (@"(x)?(?(1)a|b)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"(x)?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]="),
- new RegexTrial (@"()?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]="),
- new RegexTrial (@"()(?(1)b|a)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"()?(?(1)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,0)"),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)"),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]="),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail."),
- new RegexTrial (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail."),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)"),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]="),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail."),
- new RegexTrial (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail."),
- new RegexTrial (@"(?(1)a|b|c)", RegexOptions.None, "a", "Error."),
- new RegexTrial (@"(?(?!a)a|b)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"(?(?!a)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?(?=a)b|a)", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"(?(?=a)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"(?=(a+?))(\1ab)", RegexOptions.None, "aaab", "Pass. Group[0]=(1,3) Group[1]=(1,1) Group[2]=(1,3)"),
- new RegexTrial (@"^(?=(a+?))\1ab", RegexOptions.None, "aaab", "Fail."),
- new RegexTrial (@"(\w+:)+", RegexOptions.None, "one:", "Pass. Group[0]=(0,4) Group[1]=(0,4)"),
- new RegexTrial (@"$(?<=^(a))", RegexOptions.None, "a", "Pass. Group[0]=(1,0) Group[1]=(0,1)"),
- new RegexTrial (@"(?=(a+?))(\1ab)", RegexOptions.None, "aaab", "Pass. Group[0]=(1,3) Group[1]=(1,1) Group[2]=(1,3)"),
- new RegexTrial (@"^(?=(a+?))\1ab", RegexOptions.None, "aaab", "Fail."),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd:", "Fail."),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]= Group[2]=(0,4)"),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "xy:z:::abcd", "Pass. Group[0]=(0,11) Group[1]=(0,7) Group[2]=(7,4)"),
- new RegexTrial (@"^[^bcd]*(c+)", RegexOptions.None, "aexycd", "Pass. Group[0]=(0,5) Group[1]=(4,1)"),
- new RegexTrial (@"(a*)b+", RegexOptions.None, "caab", "Pass. Group[0]=(1,3) Group[1]=(1,2)"),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd:", "Fail."),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]= Group[2]=(0,4)"),
- new RegexTrial (@"([\w:]+::)?(\w+)$", RegexOptions.None, "xy:z:::abcd", "Pass. Group[0]=(0,11) Group[1]=(0,7) Group[2]=(7,4)"),
- new RegexTrial (@"^[^bcd]*(c+)", RegexOptions.None, "aexycd", "Pass. Group[0]=(0,5) Group[1]=(4,1)"),
- new RegexTrial (@"(>a+)ab", RegexOptions.None, "aaab", "Fail."),
- new RegexTrial (@"(?>a+)b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4)"),
- new RegexTrial (@"([[:]+)", RegexOptions.None, "a:[b]:", "Pass. Group[0]=(1,2) Group[1]=(1,2)"),
- new RegexTrial (@"([[=]+)", RegexOptions.None, "a=[b]=", "Pass. Group[0]=(1,2) Group[1]=(1,2)"),
- new RegexTrial (@"([[.]+)", RegexOptions.None, "a.[b].", "Pass. Group[0]=(1,2) Group[1]=(1,2)"),
- new RegexTrial (@"[a[:]b[:c]", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"[a[:]b[:c]", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"((?>a+)b)", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,4)"),
- new RegexTrial (@"(?>(a+))b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,3)"),
- new RegexTrial (@"((?>[^()]+)|\([^()]*\))+", RegexOptions.None, "((abc(ade)ufh()()x", "Pass. Group[0]=(2,16) Group[1]=(2,3)(5,5)(10,3)(13,2)(15,2)(17,1)"),
- new RegexTrial (@"(?<=x+)", RegexOptions.None, "xxxxy", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"a{37,17}", RegexOptions.None, "-", "Error."),
- new RegexTrial (@"\Z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"$", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\Z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(4,0)"),
- new RegexTrial (@"$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)"),
- new RegexTrial (@"$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(1,0)"),
- new RegexTrial (@"a\Z", RegexOptions.None, "a\nb\n", "Fail."),
- new RegexTrial (@"a\z", RegexOptions.None, "a\nb\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.None, "a\nb\n", "Fail."),
- new RegexTrial (@"a\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.None, "b\na\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a$", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.Multiline, "a\nb\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(0,1)"),
- new RegexTrial (@"a\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.Multiline, "b\na\n", "Fail."),
- new RegexTrial (@"a$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"a$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"aa\Z", RegexOptions.None, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\naa\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa$", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "aa\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "aa\nb\n", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\naa\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"aa\Z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"aa\Z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"aa\z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"aa$", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nab\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "ab\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "ab\nb\n", "Pass. Group[0]=(0,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nab\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)"),
- new RegexTrial (@"ab\Z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"ab\Z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"ab\z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"ab$", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nabb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "abb\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "abb\nb\n", "Pass. Group[0]=(0,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nabb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)"),
- new RegexTrial (@"abb\Z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nac", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "ac\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nac\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nac", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.None, "b\nca", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "ca\nb\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nca\n", "Fail."),
- new RegexTrial (@"abb\Z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"abb\z", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"abb$", RegexOptions.Multiline, "b\nca", "Fail."),
- new RegexTrial (@"(^|x)(c)", RegexOptions.None, "ca", "Pass. Group[0]=(0,1) Group[1]=(0,0) Group[2]=(0,1)"),
- new RegexTrial (@"a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz", RegexOptions.None, "x", "Fail."),
- new RegexTrial (@"round\(((?>[^()]+))\)", RegexOptions.None, "_I(round(xs * sz),1)", "Pass. Group[0]=(3,14) Group[1]=(9,7)"),
- new RegexTrial (@"foo.bart", RegexOptions.None, "foo.bart", "Pass. Group[0]=(0,8)"),
- new RegexTrial (@"^d[x][x][x]", RegexOptions.Multiline, "abcd\ndxxx", "Pass. Group[0]=(5,4)"),
- new RegexTrial (@".X(.+)+X", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)"),
- new RegexTrial (@".X(.+)+XX", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)"),
- new RegexTrial (@".XX(.+)+X", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)"),
- new RegexTrial (@".X(.+)+X", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".X(.+)+XX", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".XX(.+)+X", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".X(.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)"),
- new RegexTrial (@".X(.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)"),
- new RegexTrial (@".XX(.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)"),
- new RegexTrial (@".X(.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".X(.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".XX(.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".[X](.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)"),
- new RegexTrial (@".[X](.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)"),
- new RegexTrial (@".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)"),
- new RegexTrial (@".[X](.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".[X](.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail."),
- new RegexTrial (@"tt+$", RegexOptions.None, "xxxtt", "Pass. Group[0]=(3,2)"),
- new RegexTrial (@"([\d-z]+)", RegexOptions.None, "a0-za", "Pass. Group[0]=(1,3) Group[1]=(1,3)"),
- new RegexTrial (@"([\d-\s]+)", RegexOptions.None, "a0- z", "Pass. Group[0]=(1,3) Group[1]=(1,3)"),
- new RegexTrial (@"\GX.*X", RegexOptions.None, "aaaXbX", "Fail."),
- new RegexTrial (@"(\d+\.\d+)", RegexOptions.None, "3.1415926", "Pass. Group[0]=(0,9) Group[1]=(0,9)"),
- new RegexTrial (@"(\ba.{0,10}br)", RegexOptions.None, "have a web browser", "Pass. Group[0]=(5,8) Group[1]=(5,8)"),
- new RegexTrial (@"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "Changes", "Fail."),
- new RegexTrial (@"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]="),
- new RegexTrial (@"(\.c(pp|xx|c)?$)", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]=(2,2) Group[2]="),
- new RegexTrial (@"^([a-z]:)", RegexOptions.None, "C:/", "Fail."),
- new RegexTrial (@"^\S\s+aa$", RegexOptions.Multiline, "\nx aa", "Pass. Group[0]=(1,4)"),
- new RegexTrial (@"(^|a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)"),
- new RegexTrial (@"^([ab]*?)(b)?(c)$", RegexOptions.None, "abac", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]= Group[3]=(3,1)"),
- new RegexTrial (@"(\w)?(abc)\1b", RegexOptions.None, "abcab", "Fail."),
- new RegexTrial (@"^(?:.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^(.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)"),
- new RegexTrial (@"^(?:[^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)"),
- new RegexTrial (@"^([^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)"),
- new RegexTrial (@"^([^,]*,){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]*,){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]*,){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{1,},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{0,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{0,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"^([^,]{0,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)"),
- new RegexTrial (@"(?i)", RegexOptions.None, "", "Pass. Group[0]=(0,0)"),
- new RegexTrial (@"(?!\A)x", RegexOptions.Multiline, "a\nxb\n", "Pass. Group[0]=(2,1)"),
- new RegexTrial (@"^(a(b)?)+$", RegexOptions.None, "aba", "Pass. Group[0]=(0,3) Group[1]=(0,2)(2,1) Group[2]=(1,1)"),
- new RegexTrial (@"^(aa(bb)?)+$", RegexOptions.None, "aabbaa", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,2) Group[2]=(2,2)"),
- new RegexTrial (@"^.{9}abc.*\n", RegexOptions.Multiline, "123\nabcabcabcabc\n", "Pass. Group[0]=(4,13)"),
- new RegexTrial (@"^(a)?a$", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]="),
- new RegexTrial (@"^(a)?(?(1)a|b)+$", RegexOptions.None, "a", "Fail."),
- new RegexTrial (@"^(a\1?)(a\1?)(a\2?)(a\3?)$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,2) Group[3]=(3,1) Group[4]=(4,2)"),
- new RegexTrial (@"^(a\1?){4}$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,2)(3,1)(4,2)"),
- new RegexTrial (@"^(0+)?(?:x(1))?", RegexOptions.None, "x1", "Pass. Group[0]=(0,2) Group[1]= Group[2]=(1,1)"),
- new RegexTrial (@"^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?", RegexOptions.None, "012cxx0190", "Pass. Group[0]=(0,10) Group[1]=(0,4) Group[2]= Group[3]=(6,4)"),
- new RegexTrial (@"^(b+?|a){1,2}c", RegexOptions.None, "bbbac", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,1)"),
- new RegexTrial (@"^(b+?|a){1,2}c", RegexOptions.None, "bbbbac", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,1)"),
- new RegexTrial (@"\((\w\. \w+)\)", RegexOptions.None, "cd. (A. Tw)", "Pass. Group[0]=(4,7) Group[1]=(5,5)"),
- new RegexTrial (@"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "aaaacccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)"),
- new RegexTrial (@"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "bbbbcccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)")
- };
- }
-}
diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs b/mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs
deleted file mode 100644
index 73fc6876f09..00000000000
--- a/mcs/class/System/Test/System.Text.RegularExpressions/RegexTrial.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System;
-using System.Text.RegularExpressions;
-
-namespace MonoTests.System.Text.RegularExpressions {
-
- class RegexTrial {
- public string pattern;
- public RegexOptions options;
- public string input;
-
- public string expected;
-
- public RegexTrial (string pattern, RegexOptions options, string input, string expected) {
- this.pattern = pattern;
- this.options = options;
- this.input = input;
- this.expected = expected;
- }
-
- public string Expected {
- get { return expected; }
- }
-
- public string Execute () {
- string result;
- try {
- Regex re = new Regex (pattern, options);
- Match m = re.Match (input);
-
- if (m.Success) {
- result = "Pass.";
-
- for (int i = 0; i < m.Groups.Count; ++ i) {
- Group group = m.Groups[i];
-
- result += " Group[" + i + "]=";
- foreach (Capture cap in group.Captures) {
- result += "(" + cap.Index + "," + cap.Length + ")";
- }
- }
- }
- else
- result = "Fail.";
- }
- catch (Exception) {
- result = "Error.";
- }
-
- return result;
- }
-
- public override string ToString () {
- return
- "Matching input '" + input +
- "' against pattern '" + pattern +
- "' with options '" + options + "'.";
- }
- }
-
- class Checksum {
- public Checksum () {
- this.sum = 0;
- }
-
- public uint Value {
- get { return sum; }
- }
-
- public void Add (string str) {
- for (int i = 0; i < str.Length; ++ i)
- Add (str[i], 16);
- }
-
- public void Add (uint n) {
- Add (n, 32);
- }
-
- public void Add (ulong n, int bits) {
- ulong mask = 1ul << (bits - 1);
- for (int i = 0; i < bits; ++ i) {
- Add ((n & mask) != 0);
- mask >>= 1;
- }
- }
-
- public void Add (bool bit) {
- bool top = (sum & 0x80000000) != 0;
- sum <<= 1;
- sum ^= bit ? (uint)1 : (uint)0;
-
- if (top)
- sum ^= key;
- }
-
- private uint sum;
- private readonly uint key = 0x04c11db7;
- }
-}
diff --git a/mcs/class/System/Test/System/AllTests.cs b/mcs/class/System/Test/System/AllTests.cs
deleted file mode 100644
index 9a4718fbda6..00000000000
--- a/mcs/class/System/Test/System/AllTests.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// MonoTests.System.AllTests, System.dll
-//
-// Author:
-// Lawrence Pit <loz@cable.a2000nl>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System {
-
- public class AllTests : TestCase {
-
- public AllTests (string name) : base (name)
- {
- }
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (UriTest.Suite);
- suite.AddTest (UriBuilderTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/System/Test/System/ChangeLog b/mcs/class/System/Test/System/ChangeLog
deleted file mode 100644
index 1a02de68c3d..00000000000
--- a/mcs/class/System/Test/System/ChangeLog
+++ /dev/null
@@ -1,17 +0,0 @@
-2002-05-28 Lawrence Pit <loz@cable.a2000.nl>
-
- * UriTest.cs: added tests ctor UriTest (baseUri, relativeUri)
-
-2002-05-22 Lawrence Pit <loz@cable.a2000.nl>
-
- * Added UriTest.MakeRelative
-
-2002-05-12 Lawrence Pit <loz@cable.a2000.nl>
-
- * Added UriTest.TestLocalPath
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * UriTest.cs: added
- * UriBuilderTest.cs: added
- * AllTests.cs: added
diff --git a/mcs/class/System/Test/System/UriBuilderTest.cs b/mcs/class/System/Test/System/UriBuilderTest.cs
deleted file mode 100644
index 53c9a8970c7..00000000000
--- a/mcs/class/System/Test/System/UriBuilderTest.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-//
-// UriBuilderTest.cs - NUnit Test Cases for System.UriBuilder
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
- public class UriBuilderTest : TestCase
- {
- private UriBuilder b, b2, b3;
-
- public UriBuilderTest () :
- base ("[MonoTests.System.UriBuilderTest]") {}
-
- public UriBuilderTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- b = new UriBuilder ("http://", "www.ximian.com", 80, "foo/bar/index.html");
- }
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (UriBuilderTest));
- }
- }
-
- public void TestConstructors ()
- {
- b = new UriBuilder ();
- AssertEquals ("#1", "http", b.Scheme);
- AssertEquals ("#2", "loopback", b.Host);
- AssertEquals ("#3", -1, b.Port);
-
- try {
- b = new UriBuilder ("http://", "www.ximian.com", 80, "foo/bar/index.html", "extras");
- Fail ("#4 should have thrown an ArgumentException because extraValue must start with '?' or '#' character.");
- } catch (ArgumentException) {}
-
- b = new UriBuilder ("http://", "www.ximian.com", 80, "foo/bar/index.html", "#extras");
- }
-
- public void TestUserInfo ()
- {
- b = new UriBuilder ("mailto://myname:mypwd@contoso.com?subject=hello");
- AssertEquals ("#1", "myname", b.UserName);
- AssertEquals ("#2", "mypwd", b.Password);
-
- b = new UriBuilder ("mailto:", "contoso.com");
- b.UserName = "myname";
- b.Password = "mypwd";
- AssertEquals ("#3: known to fail with ms.net.", "myname:mypwd", b.Uri.UserInfo);
- }
-
- public void TestPath ()
- {
- b.Path = ((char) 0xa9) + " 2002";
- AssertEquals ("#1: known to fail with ms.net, should at least return a slash.", "/%A9%202002", b.Path);
- }
-
- public void TestPort ()
- {
- try {
- b.Port = -12345;
- Fail ("#1 should've failed, illegal port.");
- } catch (ArgumentOutOfRangeException) {}
- try {
- b.Port = 123456789;
- Fail ("#2 should've failed, illegal port.");
- } catch (ArgumentOutOfRangeException) {}
- try {
- b.Port = -1;
- AssertEquals ("#3", -1, b.Port);
- } catch (ArgumentOutOfRangeException) {
- Fail ("#4: spec should allow -1 as value.");
- }
- }
-
- public void TestQuery ()
- {
- b.Query = ((char) 0xa9) + " 2002";
- AssertEquals ("#1: known to fail with ms.net, should've been escaped.", "?%A9%202002", b.Query);
- AssertEquals ("#2", String.Empty, b.Fragment);
- b.Query = "?test";
- AssertEquals ("#3", "??test", b.Query);
- b.Query = null;
- AssertEquals ("#4", String.Empty, b.Query);
- }
-
- public void TestFragment ()
- {
- b.Fragment = ((char) 0xa9) + " 2002";
- AssertEquals ("#1: known to fail with ms.net, should've been escaped.", "#%A9%202002", b.Fragment);
- AssertEquals ("#2", String.Empty, b.Query);
- b.Fragment = "#test";
- AssertEquals ("#3", "##test", b.Fragment);
- b.Fragment = null;
- AssertEquals ("#4", String.Empty, b.Fragment);
- }
-
- public void TestScheme ()
- {
- b.Scheme = "http";
- AssertEquals ("#1", b.Scheme, "http");
- b.Scheme = "http:";
- AssertEquals ("#2", b.Scheme, "http");
- b.Scheme = "http://";
- AssertEquals ("#3", b.Scheme, "http");
- b.Scheme = "http://foo/bar";
- AssertEquals ("#4", b.Scheme, "http");
- b.Scheme = "mailto:";
- AssertEquals ("#5", b.Scheme, "mailto");
- b.Scheme = "unknown";
- AssertEquals ("#6", b.Scheme, "unknown");
- b.Scheme = "unknown://";
- AssertEquals ("#7", b.Scheme, "unknown");
- }
-
- public void TestEquals ()
- {
- b = new UriBuilder ("http://", "www.ximian.com", 80, "foo/bar/index.html?item=1");
- b2 = new UriBuilder ("http", "www.ximian.com", 80, "/foo/bar/index.html", "?item=1");
- b3 = new UriBuilder (new Uri ("http://www.ximian.com/foo/bar/index.html?item=1"));
-
- Assert ("#1", b.Equals (b2));
- Assert ("#2", b.Uri.Equals (b2.Uri));
- Assert ("#3", b.Equals (b3));
- Assert ("#4", b2.Equals (b3));
- Assert ("#5", b3.Equals (b));
- }
-
- public void TestToString ()
- {
- AssertEquals ("#1 known to fail with ms.net, should've been canonicalized.", b.Uri.ToString (), b.ToString ());
- }
- }
-}
-
diff --git a/mcs/class/System/Test/System/UriTest.cs b/mcs/class/System/Test/System/UriTest.cs
deleted file mode 100644
index a70407d5796..00000000000
--- a/mcs/class/System/Test/System/UriTest.cs
+++ /dev/null
@@ -1,537 +0,0 @@
-//
-// UriTest.cs - NUnit Test Cases for System.Uri
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-namespace MonoTests.System
-{
-
- public class UriTest : TestCase
- {
- public UriTest () :
- base ("[MonoTests.System.UriTest]") {}
-
- public UriTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown () {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (UriTest));
- }
- }
-
- public void TestConstructors ()
- {
- Uri uri = null;
-
- /*
- uri = new Uri ("http://www.ximian.com/foo" + ((char) 0xa9) + "/bar/index.cgi?a=1&b=" + ((char) 0xa9) + "left#fragm?ent2");
- Print (uri);
-
- uri = new Uri ("http://www.ximian.com/foo/xxx\"()-._;<=>@{|}~-,.`_^]\\[xx/" + ((char) 0xa9) + "/bar/index.cgi#fra+\">=@[gg]~gment2");
- Print (uri);
-
- uri = new Uri("http://11.22.33.588:9090");
- Print (uri);
-
- uri = new Uri("http://[11:22:33::88]:9090");
- Print (uri);
-
- uri = new Uri("http://[::127.11.22.33]:8080");
- Print (uri);
-
- uri = new Uri("http://[abcde::127.11.22.33]:8080");
- Print (uri);
- */
-
- /*
- uri = new Uri ("http://www.contoso.com:1234/foo/bar/");
- Print (uri);
-
- uri = new Uri ("http://www.contoso.com:1234/foo/bar");
- Print (uri);
-
- uri = new Uri ("http://www.contoso.com:1234/");
- Print (uri);
-
- uri = new Uri ("http://www.contoso.com:1234");
- Print (uri);
- */
-
- uri = new Uri ("http://contoso.com?subject=uri");
- AssertEquals ("#k1", "/", uri.AbsolutePath);
- AssertEquals ("#k2", "http://contoso.com/?subject=uri", uri.AbsoluteUri);
- AssertEquals ("#k3", "contoso.com", uri.Authority);
- AssertEquals ("#k4", "", uri.Fragment);
- AssertEquals ("#k5", "contoso.com", uri.Host);
- AssertEquals ("#k6", UriHostNameType.Dns, uri.HostNameType);
- AssertEquals ("#k7", true, uri.IsDefaultPort);
- AssertEquals ("#k8", false, uri.IsFile);
- AssertEquals ("#k9", false, uri.IsLoopback);
- AssertEquals ("#k10", false, uri.IsUnc);
- AssertEquals ("#k11", "/", uri.LocalPath);
- AssertEquals ("#k12", "/?subject=uri", uri.PathAndQuery);
- AssertEquals ("#k13", 80, uri.Port);
- AssertEquals ("#k14", "?subject=uri", uri.Query);
- AssertEquals ("#k15", "http", uri.Scheme);
- AssertEquals ("#k16", false, uri.UserEscaped);
- AssertEquals ("#k17", "", uri.UserInfo);
-
- uri = new Uri ("mailto:user:pwd@contoso.com?subject=uri");
- AssertEquals ("#m1", "", uri.AbsolutePath);
- AssertEquals ("#m2", "mailto:user:pwd@contoso.com?subject=uri", uri.AbsoluteUri);
- AssertEquals ("#m3", "contoso.com", uri.Authority);
- AssertEquals ("#m4", "", uri.Fragment);
- AssertEquals ("#m5", "contoso.com", uri.Host);
- AssertEquals ("#m6", UriHostNameType.Dns, uri.HostNameType);
- AssertEquals ("#m7", true, uri.IsDefaultPort);
- AssertEquals ("#m8", false, uri.IsFile);
- AssertEquals ("#m9", false, uri.IsLoopback);
- AssertEquals ("#m10", false, uri.IsUnc);
- AssertEquals ("#m11", "", uri.LocalPath);
- AssertEquals ("#m12", "?subject=uri", uri.PathAndQuery);
- AssertEquals ("#m13", 25, uri.Port);
- AssertEquals ("#m14", "?subject=uri", uri.Query);
- AssertEquals ("#m15", "mailto", uri.Scheme);
- AssertEquals ("#m16", false, uri.UserEscaped);
- AssertEquals ("#m17", "user:pwd", uri.UserInfo);
-
- uri = new Uri (@"\\myserver\mydir\mysubdir\myfile.ext");
- AssertEquals ("#n1", "/mydir/mysubdir/myfile.ext", uri.AbsolutePath);
- AssertEquals ("#n2", "file://myserver/mydir/mysubdir/myfile.ext", uri.AbsoluteUri);
- AssertEquals ("#n3", "myserver", uri.Authority);
- AssertEquals ("#n4", "", uri.Fragment);
- AssertEquals ("#n5", "myserver", uri.Host);
- AssertEquals ("#n6", UriHostNameType.Dns, uri.HostNameType);
- AssertEquals ("#n7", true, uri.IsDefaultPort);
- AssertEquals ("#n8", true, uri.IsFile);
- AssertEquals ("#n9", false, uri.IsLoopback);
- AssertEquals ("#n10", true, uri.IsUnc);
- AssertEquals ("#n11", @"\\myserver\mydir\mysubdir\myfile.ext", uri.LocalPath);
- AssertEquals ("#n12", "/mydir/mysubdir/myfile.ext", uri.PathAndQuery);
- AssertEquals ("#n13", -1, uri.Port);
- AssertEquals ("#n14", "", uri.Query);
- AssertEquals ("#n15", "file", uri.Scheme);
- AssertEquals ("#n16", false, uri.UserEscaped);
- AssertEquals ("#n17", "", uri.UserInfo);
-
- uri = new Uri (new Uri("http://www.contoso.com"), "Hello World.htm", true);
- AssertEquals ("#rel1a", "http://www.contoso.com/Hello World.htm", uri.AbsoluteUri);
- AssertEquals ("#rel1b", true, uri.UserEscaped);
- uri = new Uri (new Uri("http://www.contoso.com"), "Hello World.htm", false);
- AssertEquals ("#rel2a", "http://www.contoso.com/Hello%20World.htm", uri.AbsoluteUri);
- AssertEquals ("#rel2b", false, uri.UserEscaped);
- uri = new Uri (new Uri("http://www.contoso.com"), "http://www.xxx.com/Hello World.htm", false);
- AssertEquals ("#rel3", "http://www.xxx.com/Hello%20World.htm", uri.AbsoluteUri);
- //uri = new Uri (new Uri("http://www.contoso.com"), "foo:8080/bar/Hello World.htm", false);
- //AssertEquals ("#rel4", "foo:8080/bar/Hello%20World.htm", uri.AbsoluteUri);
- uri = new Uri (new Uri("http://www.contoso.com"), "foo/bar/Hello World.htm?x=0:8", false);
- AssertEquals ("#rel5", "http://www.contoso.com/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
- uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "foo/bar/Hello World.htm?x=0:8", false);
- AssertEquals ("#rel6", "http://www.contoso.com/xxx/yyy/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
- uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "/foo/bar/Hello World.htm?x=0:8", false);
- AssertEquals ("#rel7", "http://www.contoso.com/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
- uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "../foo/bar/Hello World.htm?x=0:8", false);
- AssertEquals ("#rel8", "http://www.contoso.com/xxx/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
- uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "../../../foo/bar/Hello World.htm?x=0:8", false);
- AssertEquals ("#rel9", "http://www.contoso.com/../foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
- uri = new Uri (new Uri("http://www.contoso.com/xxx/yyy/index.htm"), "./foo/bar/Hello World.htm?x=0:8", false);
- AssertEquals ("#rel10", "http://www.contoso.com/xxx/yyy/foo/bar/Hello%20World.htm?x=0:8", uri.AbsoluteUri);
-
- try {
- uri = new Uri (null, "http://www.contoso.com/index.htm", false);
- Fail ("#rel20");
- } catch (NullReferenceException) {
- }
- try {
- uri = new Uri (new Uri("http://www.contoso.com"), null, false);
- Fail ("#rel21");
- } catch (NullReferenceException) {
- }
- try {
- uri = new Uri (new Uri("http://www.contoso.com/foo/bar/index.html?x=0"), String.Empty, false);
- AssertEquals("#22", "http://www.contoso.com/foo/bar/index.html?x=0", uri.ToString ());
- } catch (NullReferenceException) {
- }
- try {
- uri = new Uri ("http://www.contoso.com:12345678/foo/bar/");
- Fail ("#30: known to fail with ms.net, should have failed because of invalid port");
- } catch (UriFormatException) { }
- }
-
- public void TestLocalPath ()
- {
- bool isWin32 = (Path.DirectorySeparatorChar == '\\');
-
- Uri uri = new Uri ("c:\\tmp\\hello.txt");
- AssertEquals ("#1a", "file:///c:/tmp/hello.txt", uri.ToString ());
- AssertEquals ("#1b", "c:\\tmp\\hello.txt", uri.LocalPath);
- AssertEquals ("#1c", "file", uri.Scheme);
- AssertEquals ("#1d", "", uri.Host);
- AssertEquals ("#1e", "c:/tmp/hello.txt", uri.AbsolutePath);
-
- uri = new Uri ("file:////////cygwin/tmp/hello.txt");
- AssertEquals ("#3a", "file://cygwin/tmp/hello.txt", uri.ToString ());
- if (isWin32)
- AssertEquals ("#3b win32", "\\\\cygwin\\tmp\\hello.txt", uri.LocalPath);
- else
- AssertEquals ("#3b *nix", "//cygwin/tmp/hello.txt", uri.LocalPath);
- AssertEquals ("#3c", "file", uri.Scheme);
- AssertEquals ("#3d", "cygwin", uri.Host);
- AssertEquals ("#3e", "/tmp/hello.txt", uri.AbsolutePath);
-
- uri = new Uri ("file://mymachine/cygwin/tmp/hello.txt");
- AssertEquals ("#4a", "file://mymachine/cygwin/tmp/hello.txt", uri.ToString ());
- if (isWin32)
- AssertEquals ("#4b win32", "\\\\mymachine\\cygwin\\tmp\\hello.txt", uri.LocalPath);
- else
- AssertEquals ("#4b *nix", "//mymachine/cygwin/tmp/hello.txt", uri.LocalPath);
- AssertEquals ("#4c", "file", uri.Scheme);
- AssertEquals ("#4d", "mymachine", uri.Host);
- AssertEquals ("#4e", "/cygwin/tmp/hello.txt", uri.AbsolutePath);
-
- uri = new Uri ("file://///c:/cygwin/tmp/hello.txt");
- AssertEquals ("#5a", "file:///c:/cygwin/tmp/hello.txt", uri.ToString ());
- AssertEquals ("#5b", "c:\\cygwin\\tmp\\hello.txt", uri.LocalPath);
- AssertEquals ("#5c", "file", uri.Scheme);
- AssertEquals ("#5d", "", uri.Host);
- AssertEquals ("#5e", "c:/cygwin/tmp/hello.txt", uri.AbsolutePath);
- }
-
- public void TestUnc ()
- {
- Uri uri = new Uri ("http://www.contoso.com");
- Assert ("#1", !uri.IsUnc);
-
- uri = new Uri ("news:123456@contoso.com");
- Assert ("#2", !uri.IsUnc);
-
- uri = new Uri ("file://server/filename.ext");
- Assert ("#3", uri.IsUnc);
-
- try {
- uri = new Uri ("file:/filename.ext");
- Assert ("#4", uri.IsUnc);
- } catch (UriFormatException) {
- Fail ("#5: known to fail with ms.net");
- }
-
- uri = new Uri (@"\\server\share\filename.ext");
- Assert ("#6", uri.IsUnc);
- }
-
- public void TestFromHex ()
- {
- AssertEquals ("#1", 0, Uri.FromHex ('0'));
- AssertEquals ("#2", 9, Uri.FromHex ('9'));
- AssertEquals ("#3", 10, Uri.FromHex ('a'));
- AssertEquals ("#4", 15, Uri.FromHex ('f'));
- AssertEquals ("#5", 10, Uri.FromHex ('A'));
- AssertEquals ("#6", 15, Uri.FromHex ('F'));
- try {
- Uri.FromHex ('G');
- Fail ("#7");
- } catch (ArgumentException) {}
- try {
- Uri.FromHex (' ');
- Fail ("#8");
- } catch (ArgumentException) {}
- try {
- Uri.FromHex ('%');
- Fail ("#8");
- } catch (ArgumentException) {}
- }
-
- public void TestHexEscape ()
- {
- AssertEquals ("#1","%20", Uri.HexEscape (' '));
- AssertEquals ("#2","%A9", Uri.HexEscape ((char) 0xa9));
- AssertEquals ("#3","%41", Uri.HexEscape ('A'));
- try {
- Uri.HexEscape ((char) 0x0369);
- Fail ("#4");
- } catch (ArgumentOutOfRangeException) {}
- }
-
- public void TestHexUnescape ()
- {
- int i = 0;
- AssertEquals ("#1", ' ', Uri.HexUnescape ("%20", ref i));
- AssertEquals ("#2", 3, i);
- i = 4;
- AssertEquals ("#3", (char) 0xa9, Uri.HexUnescape ("test%a9test", ref i));
- AssertEquals ("#4", 7, i);
- AssertEquals ("#5", 't', Uri.HexUnescape ("test%a9test", ref i));
- AssertEquals ("#6", 8, i);
- i = 4;
- AssertEquals ("#5", '%', Uri.HexUnescape ("test%a", ref i));
- AssertEquals ("#6", 5, i);
- AssertEquals ("#7", '%', Uri.HexUnescape ("testx%xx", ref i));
- AssertEquals ("#8", 6, i);
- }
-
- public void TestIsHexDigit ()
- {
- Assert ("#1", Uri.IsHexDigit ('a'));
- Assert ("#2", Uri.IsHexDigit ('f'));
- Assert ("#3", !Uri.IsHexDigit ('g'));
- Assert ("#4", Uri.IsHexDigit ('0'));
- Assert ("#5", Uri.IsHexDigit ('9'));
- Assert ("#6", Uri.IsHexDigit ('A'));
- Assert ("#7", Uri.IsHexDigit ('F'));
- Assert ("#8", !Uri.IsHexDigit ('G'));
- }
-
- public void TestIsHexEncoding ()
- {
- Assert ("#1", Uri.IsHexEncoding ("test%a9test", 4));
- Assert ("#2", !Uri.IsHexEncoding ("test%a9test", 3));
- Assert ("#3", Uri.IsHexEncoding ("test%a9", 4));
- Assert ("#4", !Uri.IsHexEncoding ("test%a", 4));
- }
-
- public void TestGetLeftPart ()
- {
- Uri uri = new Uri ("http://www.contoso.com/index.htm#main");
- AssertEquals ("#1", "http://", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#2", "http://www.contoso.com", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#3", "http://www.contoso.com/index.htm", uri.GetLeftPart (UriPartial.Path));
-
- uri = new Uri ("mailto:user@contoso.com?subject=uri");
- AssertEquals ("#4", "mailto:", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#5", "", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#6", "mailto:user@contoso.com", uri.GetLeftPart (UriPartial.Path));
-
- uri = new Uri ("nntp://news.contoso.com/123456@contoso.com");
- AssertEquals ("#7", "nntp://", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#8", "nntp://news.contoso.com", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#9", "nntp://news.contoso.com/123456@contoso.com", uri.GetLeftPart (UriPartial.Path));
-
- uri = new Uri ("news:123456@contoso.com");
- AssertEquals ("#10", "news:", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#11", "", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#12", "news:123456@contoso.com", uri.GetLeftPart (UriPartial.Path));
-
- uri = new Uri ("file://server/filename.ext");
- AssertEquals ("#13", "file://", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#14", "file://server", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#15", "file://server/filename.ext", uri.GetLeftPart (UriPartial.Path));
-
- try {
- uri = new Uri ("file:/filename.ext");
- AssertEquals ("#16", "file://", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#17", "", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#18", "file:///filename.ext", uri.GetLeftPart (UriPartial.Path));
- } catch (UriFormatException) {
- Fail ("#19: known to fail with ms.net (it's their own example!)");
- }
-
- uri = new Uri (@"\\server\share\filename.ext");
- AssertEquals ("#20", "file://", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#21", "file://server", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#22", "file://server/share/filename.ext", uri.GetLeftPart (UriPartial.Path));
-
- uri = new Uri ("http://www.contoso.com:8080/index.htm#main");
- AssertEquals ("#23", "http://", uri.GetLeftPart (UriPartial.Scheme));
- AssertEquals ("#24", "http://www.contoso.com:8080", uri.GetLeftPart (UriPartial.Authority));
- AssertEquals ("#25", "http://www.contoso.com:8080/index.htm", uri.GetLeftPart (UriPartial.Path));
- }
-
- public void TestCheckHostName ()
- {
- AssertEquals ("#1", UriHostNameType.Unknown, Uri.CheckHostName (null));
- AssertEquals ("#2", UriHostNameType.Unknown, Uri.CheckHostName (""));
- AssertEquals ("#3", UriHostNameType.Unknown, Uri.CheckHostName ("^&()~`!@"));
- AssertEquals ("#4", UriHostNameType.Dns, Uri.CheckHostName ("x"));
- AssertEquals ("#5", UriHostNameType.IPv4, Uri.CheckHostName ("1.2.3.4"));
- AssertEquals ("#6", UriHostNameType.IPv4, Uri.CheckHostName ("0001.002.03.4"));
- AssertEquals ("#7", UriHostNameType.Dns, Uri.CheckHostName ("0001.002.03.256"));
- AssertEquals ("#8", UriHostNameType.Dns, Uri.CheckHostName ("9001.002.03.4"));
- AssertEquals ("#9", UriHostNameType.Dns, Uri.CheckHostName ("www.contoso.com"));
- AssertEquals ("#10", UriHostNameType.Unknown, Uri.CheckHostName (".www.contoso.com"));
- AssertEquals ("#11: known to fail with ms.net: this is not a valid domain address", UriHostNameType.Unknown, Uri.CheckHostName ("www.contoso.com."));
- AssertEquals ("#12", UriHostNameType.Dns, Uri.CheckHostName ("www.con-toso.com"));
- AssertEquals ("#13", UriHostNameType.Dns, Uri.CheckHostName ("www.con_toso.com"));
- AssertEquals ("#14", UriHostNameType.Unknown, Uri.CheckHostName ("www.con,toso.com"));
-
- // test IPv6
- AssertEquals ("#15", UriHostNameType.IPv6, Uri.CheckHostName ("11:22:33:44:55:66:77:88"));
- AssertEquals ("#16", UriHostNameType.IPv6, Uri.CheckHostName ("11::33:44:55:66:77:88"));
- AssertEquals ("#17", UriHostNameType.IPv6, Uri.CheckHostName ("::22:33:44:55:66:77:88"));
- AssertEquals ("#18", UriHostNameType.IPv6, Uri.CheckHostName ("11:22:33:44:55:66:77::"));
- AssertEquals ("#19", UriHostNameType.IPv6, Uri.CheckHostName ("11::88"));
- AssertEquals ("#20", UriHostNameType.IPv6, Uri.CheckHostName ("11::77:88"));
- AssertEquals ("#21", UriHostNameType.IPv6, Uri.CheckHostName ("11:22::88"));
- AssertEquals ("#22", UriHostNameType.IPv6, Uri.CheckHostName ("11::"));
- AssertEquals ("#23", UriHostNameType.IPv6, Uri.CheckHostName ("::88"));
- AssertEquals ("#24", UriHostNameType.IPv6, Uri.CheckHostName ("::1"));
- AssertEquals ("#25", UriHostNameType.IPv6, Uri.CheckHostName ("::"));
- AssertEquals ("#26", UriHostNameType.IPv6, Uri.CheckHostName ("0:0:0:0:0:0:127.0.0.1"));
- AssertEquals ("#27", UriHostNameType.IPv6, Uri.CheckHostName ("::127.0.0.1"));
- AssertEquals ("#28", UriHostNameType.IPv6, Uri.CheckHostName ("::ffFF:169.32.14.5"));
- AssertEquals ("#29", UriHostNameType.IPv6, Uri.CheckHostName ("2001:03A0::/35"));
- AssertEquals ("#30", UriHostNameType.IPv6, Uri.CheckHostName ("[2001:03A0::/35]"));
-
- AssertEquals ("#31", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0::/35"));
- AssertEquals ("#32", UriHostNameType.Unknown, Uri.CheckHostName ("2001:03A0::/35a"));
- AssertEquals ("#33 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName ("2001::03A0:1.2.3.4"));
- AssertEquals ("#34", UriHostNameType.Unknown, Uri.CheckHostName ("::ffff:123.256.155.43"));
- AssertEquals ("#35", UriHostNameType.Unknown, Uri.CheckHostName (":127.0.0.1"));
- AssertEquals ("#36 known to fail with ms.net: this is not a valid IPv6 address.", UriHostNameType.Unknown, Uri.CheckHostName (":11:22:33:44:55:66:77:88"));
- AssertEquals ("#37", UriHostNameType.Unknown, Uri.CheckHostName ("::11:22:33:44:55:66:77:88"));
- AssertEquals ("#38", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88::"));
- AssertEquals ("#39", UriHostNameType.Unknown, Uri.CheckHostName ("11:22:33:44:55:66:77:88:"));
- AssertEquals ("#40", UriHostNameType.Unknown, Uri.CheckHostName ("::acbde"));
- AssertEquals ("#41", UriHostNameType.Unknown, Uri.CheckHostName ("::abce:"));
- AssertEquals ("#42", UriHostNameType.Unknown, Uri.CheckHostName ("::abcg"));
- AssertEquals ("#43", UriHostNameType.Unknown, Uri.CheckHostName (":::"));
- AssertEquals ("#44", UriHostNameType.Unknown, Uri.CheckHostName (":"));
- }
-
- public void TestIsLoopback ()
- {
- Uri uri = new Uri("http://loopback:8080");
- AssertEquals ("#1", true, uri.IsLoopback);
- uri = new Uri("http://localhost:8080");
- AssertEquals ("#2", true, uri.IsLoopback);
- uri = new Uri("http://127.0.0.1:8080");
- AssertEquals ("#3", true, uri.IsLoopback);
- uri = new Uri("http://127.0.0.001:8080");
- AssertEquals ("#4", true, uri.IsLoopback);
- uri = new Uri("http://[::1]");
- AssertEquals ("#5", true, uri.IsLoopback);
- uri = new Uri("http://[::1]:8080");
- AssertEquals ("#6", true, uri.IsLoopback);
- uri = new Uri("http://[::0001]:8080");
- AssertEquals ("#7", true, uri.IsLoopback);
- uri = new Uri("http://[0:0:0:0::1]:8080");
- AssertEquals ("#8", true, uri.IsLoopback);
- uri = new Uri("http://[0:0:0:0::127.0.0.1]:8080");
- AssertEquals ("#9", true, uri.IsLoopback);
- uri = new Uri("http://[0:0:0:0::127.11.22.33]:8080");
- AssertEquals ("#10: known to fail with ms.net", true, uri.IsLoopback);
- uri = new Uri("http://[::ffff:127.11.22.33]:8080");
- AssertEquals ("#11: known to fail with ms.net", true, uri.IsLoopback);
- uri = new Uri("http://[::ff00:7f11:2233]:8080");
- AssertEquals ("#12", false, uri.IsLoopback);
- uri = new Uri("http://[1:0:0:0::1]:8080");
- AssertEquals ("#13", false, uri.IsLoopback);
- }
-
- public void TestEquals ()
- {
- Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main");
- Uri uri2 = new Uri ("http://www.contoso.com/index.htm#fragment");
- Assert ("#1", uri1.Equals (uri2));
- uri2 = new Uri ("http://www.contoso.com/index.htm?x=1");
- Assert ("#2 known to fail with ms.net", !uri1.Equals (uri2));
- Assert ("#3", !uri2.Equals ("http://www.contoso.com/index.html?x=1"));
- Assert ("#4: known to fail with ms.net", !uri1.Equals ("http://www.contoso.com:8080/index.htm?x=1"));
- }
-
- public void TestGetHashCode ()
- {
- Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main");
- Uri uri2 = new Uri ("http://www.contoso.com/index.htm#fragment");
- AssertEquals ("#1", uri1.GetHashCode (), uri2.GetHashCode ());
- uri2 = new Uri ("http://www.contoso.com/index.htm?x=1");
- Assert ("#2", uri1.GetHashCode () != uri2.GetHashCode ());
- uri2 = new Uri ("http://www.contoso.com:80/index.htm");
- AssertEquals ("#3", uri1.GetHashCode (), uri2.GetHashCode ());
- uri2 = new Uri ("http://www.contoso.com:8080/index.htm");
- Assert ("#4", uri1.GetHashCode () != uri2.GetHashCode ());
- }
-
- public void TestMakeRelative ()
- {
- Uri uri1 = new Uri ("http://www.contoso.com/index.htm?x=2");
- Uri uri2 = new Uri ("http://www.contoso.com/foo/bar/index.htm#fragment");
- Uri uri3 = new Uri ("http://www.contoso.com/bar/foo/index.htm?y=1");
- Uri uri4 = new Uri ("http://www.contoso.com/bar/foo2/index.htm?x=0");
- Uri uri5 = new Uri ("https://www.contoso.com/bar/foo/index.htm?y=1");
- Uri uri6 = new Uri ("http://www.contoso2.com/bar/foo/index.htm?x=0");
- Uri uri7 = new Uri ("http://www.contoso2.com/bar/foo/foobar.htm?z=0&y=5");
- Uri uri8 = new Uri ("http://www.xxx.com/bar/foo/foobar.htm?z=0&y=5" + (char) 0xa9);
-
- AssertEquals ("#1", "foo/bar/index.htm", uri1.MakeRelative (uri2));
- AssertEquals ("#2", "../../index.htm", uri2.MakeRelative (uri1));
-
- AssertEquals ("#3", "../../bar/foo/index.htm", uri2.MakeRelative (uri3));
- AssertEquals ("#4", "../../foo/bar/index.htm", uri3.MakeRelative (uri2));
-
- AssertEquals ("#5", "../foo2/index.htm", uri3.MakeRelative (uri4));
- AssertEquals ("#6", "../foo/index.htm", uri4.MakeRelative (uri3));
-
- AssertEquals ("#7", "https://www.contoso.com/bar/foo/index.htm?y=1",
- uri4.MakeRelative (uri5));
-
- AssertEquals ("#8", "http://www.contoso2.com/bar/foo/index.htm?x=0",
- uri4.MakeRelative (uri6));
-
- AssertEquals ("#9", "", uri6.MakeRelative (uri6));
- AssertEquals ("#10", "foobar.htm", uri6.MakeRelative (uri7));
-
- Uri uri10 = new Uri ("mailto:xxx@xxx.com");
- Uri uri11 = new Uri ("mailto:xxx@xxx.com?subject=hola");
- AssertEquals ("#11", "", uri10.MakeRelative (uri11));
-
- Uri uri12 = new Uri ("mailto:xxx@mail.xxx.com?subject=hola");
- AssertEquals ("#12", "mailto:xxx@mail.xxx.com?subject=hola", uri10.MakeRelative (uri12));
-
- Uri uri13 = new Uri ("mailto:xxx@xxx.com/foo/bar");
- AssertEquals ("#13", "/foo/bar", uri10.MakeRelative (uri13));
-
- AssertEquals ("#14", "http://www.xxx.com/bar/foo/foobar.htm?z=0&y=5" + (char) 0xa9, uri1.MakeRelative (uri8));
- }
-
- public void TestToString ()
- {
- Uri uri = new Uri ("dummy://xxx");
- AssertEquals ("#1", "dummy://xxx/", uri.ToString ());
- }
-
- public static void Print (Uri uri)
- {
- Console.WriteLine ("ToString: " + uri.ToString ());
-
- Console.WriteLine ("AbsolutePath: " + uri.AbsolutePath);
- Console.WriteLine ("AbsoluteUri: " + uri.AbsoluteUri);
- Console.WriteLine ("Authority: " + uri.Authority);
- Console.WriteLine ("Fragment: " + uri.Fragment);
- Console.WriteLine ("Host: " + uri.Host);
- Console.WriteLine ("HostNameType: " + uri.HostNameType);
- Console.WriteLine ("IsDefaultPort: " + uri.IsDefaultPort);
- Console.WriteLine ("IsFile: " + uri.IsFile);
- Console.WriteLine ("IsLoopback: " + uri.IsLoopback);
- Console.WriteLine ("IsUnc: " + uri.IsUnc);
- Console.WriteLine ("LocalPath: " + uri.LocalPath);
- Console.WriteLine ("PathAndQuery: " + uri.PathAndQuery);
- Console.WriteLine ("Port: " + uri.Port);
- Console.WriteLine ("Query: " + uri.Query);
- Console.WriteLine ("Scheme: " + uri.Scheme);
- Console.WriteLine ("UserEscaped: " + uri.UserEscaped);
- Console.WriteLine ("UserInfo: " + uri.UserInfo);
-
- Console.WriteLine ("Segments:");
- string [] segments = uri.Segments;
- if (segments == null)
- Console.WriteLine ("\tNo Segments");
- else
- for (int i = 0; i < segments.Length; i++)
- Console.WriteLine ("\t" + segments[i]);
- Console.WriteLine ("");
- }
-
- }
-}
-
diff --git a/mcs/class/System/Test/System_test.build b/mcs/class/System/Test/System_test.build
deleted file mode 100644
index ba514d19d82..00000000000
--- a/mcs/class/System/Test/System_test.build
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for System_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="System_test" default="build">
- <property name="debug" value="false"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- </target>
-
- <target name="assemblies">
- <csc target="library" output="System_test.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="TheTests.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
-
- <arg value="/noconfig"/>
- <arg value="/r:.\System.dll"/>
- </csc>
-
- <csc target="exe" output="RunTests.System.exe" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="**/AllTests.cs"/>
- <excludes name="**/MartinTests.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitBase.dll"/>
- </references>
- <references basedir=".">
- <includes name="System.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- <arg value="/noconfig"/>
- <arg value="/r:.\System.dll"/>
- </csc>
-
- </target>
-
- <target name="test" depends="assemblies">
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,System_test.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="System_test.dll" failonerror="false"/>
- </target>
-</project>
diff --git a/mcs/class/System/Test/TheTests.cs b/mcs/class/System/Test/TheTests.cs
deleted file mode 100644
index 34f596b523d..00000000000
--- a/mcs/class/System/Test/TheTests.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
- public class RunDnsTest : Net.DnsTest
- {
- protected override void RunTest ()
- {
- TestAsyncGetHostByName ();
- TestAsyncResolve ();
- TestGetHostName ();
- TestGetHostByName ();
- TestGetHostByAddressString ();
- TestGetHostByAddressIPAddress ();
- TestResolve ();
- }
- }
-}
-
-namespace MonoTests.System.Collections.Specialized.Collections.Specialized
-{
- public class RunStringCollectionTest : StringCollectionTest
- {
- protected override void RunTest ()
- {
- TestSimpleCount ();
- TestSimpleIsReadOnly ();
- TestSimpleIsSynchronized ();
- TestSimpleItemGet ();
- TestSimpleItemSet ();
- TestSimpleSyncRoot ();
- TestSimpleAdd ();
- TestSimpleAddRange ();
- TestSimpleClear ();
- TestSimpleContains ();
- TestSimpleCopyTo ();
- TestSimpleGetEnumerator ();
- TestSimpleIndexOf ();
- TestSimpleInsert ();
- TestSimpleRemove ();
- TestSimpleRemoveAt ();
- }
- }
-}
-
-namespace MonoTests
-{
- public class RunAllTests
- {
- public static void AddAllTests (TestSuite suite)
- {
- suite.AddTest (new MonoTests.System.RunDnsTest ());
- suite.AddTest (new MonoTests.System.Collections.Specialized.Collections.Specialized.RunStringCollectionTest ());
- }
- }
-}
-
-class MainApp
-{
- public static void Main()
- {
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
-
- TestResult result = new TestResult ();
- TestSuite suite = new TestSuite ();
- MonoTests.RunAllTests.AddAllTests (suite);
- suite.Run (result);
- MonoTests.MyTestRunner.Print (result);
- }
-}
-
diff --git a/mcs/class/System/list b/mcs/class/System/list
deleted file mode 100755
index c1e31eded09..00000000000
--- a/mcs/class/System/list
+++ /dev/null
@@ -1,140 +0,0 @@
--r System.Xml --noconfig
-System\TODOAttribute.cs
-System\Uri.cs
-System\UriFormatException.cs
-System\UriHostNameType.cs
-System\UriPartial.cs
-System.Collections.Specialized\BitVector32.cs
-System.Collections.Specialized\ListDictionary.cs
-System.Collections.Specialized\NameObjectCollectionBase.cs
-System.Collections.Specialized\NameValueCollection.cs
-System.Collections.Specialized\StringCollection.cs
-System.Collections.Specialized\StringDictionary.cs
-System.Collections.Specialized\StringEnumerator.cs
-System.ComponentModel\BrowsableAttribute.cs
-System.ComponentModel\CategoryAttribute.cs
-System.ComponentModel\CollectionChangeAction.cs
-System.ComponentModel\CollectionChangeEventArgs.cs
-System.ComponentModel\CollectionChangeEventHandler.cs
-System.ComponentModel\Component.cs
-System.ComponentModel\ComponentCollection.cs
-System.ComponentModel\Container.cs
-System.ComponentModel\DescriptionAttribute.cs
-System.ComponentModel\DesignerSerializationVisibility.cs
-System.ComponentModel\DesignerSerializationVisibilityAttribute.cs
-System.ComponentModel\DesignOnlyAttribute.cs
-System.ComponentModel\EventHandlerList.cs
-System.ComponentModel\IBindingList.cs
-System.ComponentModel\IComponent.cs
-System.ComponentModel\IContainer.cs
-System.ComponentModel\IListSource.cs
-System.ComponentModel\ISite.cs
-System.ComponentModel\ISupportInitialize.cs
-System.ComponentModel\ISynchronizeInvoke.cs
-System.ComponentModel\ITypeDescriptorContext.cs
-System.ComponentModel\ITypedList.cs
-System.ComponentModel\ListChangedEventArgs.cs
-System.ComponentModel\ListChangedEventHandler.cs
-System.ComponentModel\ListChangedType.cs
-System.ComponentModel\ListSortDirection.cs
-System.ComponentModel\LocalizableAttribute.cs
-System.ComponentModel\MarshalByValueComponent.cs
-System.ComponentModel\MemberDescriptor.cs
-System.ComponentModel\PropertyChangedEventArgs.cs
-System.ComponentModel\PropertyDescriptor.cs
-System.ComponentModel\PropertyDescriptorCollection.cs
-System.ComponentModel\TypeConverter.cs
-System.ComponentModel\Win32Exception.cs
-System.Configuration\ConfigurationException.cs
-System.Configuration\ConfigurationSettings.cs
-System.Configuration\DictionarySectionHandler.cs
-System.Configuration\IConfigurationSectionHandler.cs
-System.Configuration\IgnoreSectionHandler.cs
-System.Configuration\NameValueSectionHandler.cs
-System.Configuration\SingleTagSectionHandler.cs
-System.Diagnostics\BooleanSwitch.cs
-System.Diagnostics\Debug.cs
-System.Diagnostics\DefaultTraceListener.cs
-System.Diagnostics\DiagnosticsConfigurationHandler.cs
-System.Diagnostics\FileVersionInfo.cs
-System.Diagnostics\Process.cs
-System.Diagnostics\ProcessModule.cs
-System.Diagnostics\ProcessModuleCollection.cs
-System.Diagnostics\ProcessPriorityClass.cs
-System.Diagnostics\ProcessStartInfo.cs
-System.Diagnostics\ProcessThread.cs
-System.Diagnostics\ProcessThreadCollection.cs
-System.Diagnostics\ProcessWindowStyle.cs
-System.Diagnostics\TextWriterTraceListener.cs
-System.Diagnostics\ThreadPriorityLevel.cs
-System.Diagnostics\ThreadState.cs
-System.Diagnostics\ThreadWaitReason.cs
-System.Diagnostics\Trace.cs
-System.Diagnostics\TraceImpl.cs
-System.Diagnostics\TraceLevel.cs
-System.Diagnostics\TraceListenerCollection.cs
-System.Diagnostics\TraceSwitch.cs
-System.Globalization\Locale.cs
-System.Net\Authorization.cs
-System.Net\ConnectionModes.cs
-System.Net\Cookie.cs
-System.Net\CookieCollection.cs
-System.Net\CookieException.cs
-System.Net\Dns.cs
-System.Net\DnsPermission.cs
-System.Net\DnsPermissionAttribute.cs
-System.Net\EndPoint.cs
-System.Net\EndpointPermission.cs
-System.Net\HttpStatusCode.cs
-System.Net\ICredentialLookup.cs
-System.Net\IPAddress.cs
-System.Net\IPEndPoint.cs
-System.Net\IPHostEntry.cs
-System.Net\NetworkAccess.cs
-System.Net\NetworkCredential.cs
-System.Net\ProtocolViolationException.cs
-System.Net\ProxyUseType.cs
-System.Net\SocketAddress.cs
-System.Net\SocketPermission.cs
-System.Net\SocketPermissionAttribute.cs
-System.Net\TransportType.cs
-System.Net\WebExceptionStatus.cs
-System.Net\WebStatus.cs
-System.Net.Sockets\AddressFamily.cs
-System.Net.Sockets\LingerOption.cs
-System.Net.Sockets\MulticastOption.cs
-System.Net.Sockets\NetworkStream.cs
-System.Net.Sockets\ProtocolFamily.cs
-System.Net.Sockets\ProtocolType.cs
-System.Net.Sockets\SelectMode.cs
-System.Net.Sockets\Socket.cs
-System.Net.Sockets\SocketException.cs
-System.Net.Sockets\SocketFlags.cs
-System.Net.Sockets\SocketOptionLevel.cs
-System.Net.Sockets\SocketOptionName.cs
-System.Net.Sockets\SocketShutdown.cs
-System.Net.Sockets\SocketType.cs
-System.Net.Sockets\TcpClient.cs
-System.Net.Sockets\TcpListener.cs
-System.Net.Sockets\UdpClient.cs
-System.Text.RegularExpressions\arch.cs
-System.Text.RegularExpressions\cache.cs
-System.Text.RegularExpressions\category.cs
-System.Text.RegularExpressions\collections.cs
-System.Text.RegularExpressions\compiler.cs
-System.Text.RegularExpressions\debug.cs
-System.Text.RegularExpressions\interpreter.cs
-System.Text.RegularExpressions\interval.cs
-System.Text.RegularExpressions\match.cs
-System.Text.RegularExpressions\parser.cs
-System.Text.RegularExpressions\quicksearch.cs
-System.Text.RegularExpressions\regex.cs
-System.Text.RegularExpressions\RegexRunner.cs
-System.Text.RegularExpressions\RegexRunnerFactory.cs
-System.Text.RegularExpressions\replace.cs
-System.Text.RegularExpressions\syntax.cs
-System.Threading\ThreadExceptionEventArgs.cs
-System.Threading\ThreadExceptionEventHandler.cs
-System.Diagnostics\Switch.cs
-System.Diagnostics\TraceListener.cs
-System.Net\IPv6Address.cs
diff --git a/mcs/class/System/list.unix b/mcs/class/System/list.unix
deleted file mode 100755
index 6a5cb7f9129..00000000000
--- a/mcs/class/System/list.unix
+++ /dev/null
@@ -1,283 +0,0 @@
--r mscorlib -r System.Xml -r System.Drawing --noconfig --target library -o System.dll
-System.Collections.Specialized/StringEnumerator.cs
-System.Collections.Specialized/StringDictionary.cs
-System.Collections.Specialized/StringCollection.cs
-System.Collections.Specialized/NameObjectCollectionBase.cs
-System.Collections.Specialized/BitVector32.cs
-System.Collections.Specialized/CollectionsUtil.cs
-System.Collections.Specialized/HybridDictionary.cs
-System.Collections.Specialized/ListDictionary.cs
-System.Collections.Specialized/NameValueCollection.cs
-System.CodeDom/CodeAssignStatement.cs
-System.CodeDom/CodeStatementCollection.cs
-System.CodeDom/CodeAttributeDeclaration.cs
-System.CodeDom/CodeParameterDeclarationExpressionCollection.cs
-System.CodeDom/CodeComment.cs
-System.CodeDom/CodeBinaryOperatorType.cs
-System.CodeDom/CodeBaseReferenceExpression.cs
-System.CodeDom/CodeBinaryOperatorExpression.cs
-System.CodeDom/CodeCompileUnit.cs
-System.CodeDom/CodeTypeConstructor.cs
-System.CodeDom/CodeTypeDeclaration.cs
-System.CodeDom/CodeDirectionExpression.cs
-System.CodeDom/CodeExpressionStatement.cs
-System.CodeDom/CodeDelegateCreateExpression.cs
-System.CodeDom/CodeCommentStatement.cs
-System.CodeDom/CodeTypeDelegate.cs
-System.CodeDom/CodeConditionStatement.cs
-System.CodeDom/CodeTypeReference.cs
-System.CodeDom/CodeDelegateInvokeExpression.cs
-System.CodeDom/CodeEntryPointMethod.cs
-System.CodeDom/CodeIterationStatement.cs
-System.CodeDom/CodeObject.cs
-System.CodeDom/CodeFieldReferenceExpression.cs
-System.CodeDom/CodeMemberEvent.cs
-System.CodeDom/CodeExpression.cs
-System.CodeDom/CodeEventReferenceExpression.cs
-System.CodeDom/CodeMemberField.cs
-System.CodeDom/CodeTypeDeclarationCollection.cs
-System.CodeDom/CodeMemberProperty.cs
-System.CodeDom/CodeGotoStatement.cs
-System.CodeDom/CodeIndexerExpression.cs
-System.CodeDom/CodeTypeMemberCollection.cs
-System.CodeDom/MemberAttributes.cs
-System.CodeDom/CodeMethodInvokeExpression.cs
-System.CodeDom/CodeMethodReferenceExpression.cs
-System.CodeDom/CodePrimitiveExpression.cs
-System.CodeDom/CodeMethodReturnStatement.cs
-System.CodeDom/CodeNamespaceImport.cs
-System.CodeDom/CodeSnippetCompileUnit.cs
-System.CodeDom/CodeNamespaceImportCollection.cs
-System.CodeDom/CodeObjectCreateExpression.cs
-System.CodeDom/CodeParameterDeclarationExpression.cs
-System.CodeDom/CodeTypeReferenceCollection.cs
-System.CodeDom/CodePropertyReferenceExpression.cs
-System.CodeDom/CodePropertySetValueReferenceExpression.cs
-System.CodeDom/CodeRemoveEventStatement.cs
-System.CodeDom/CodeThisReferenceExpression.cs
-System.CodeDom/CodeThrowExceptionStatement.cs
-System.CodeDom/CodeTryCatchFinallyStatement.cs
-System.CodeDom/CodeCastExpression.cs
-System.CodeDom/CodeArgumentReferenceExpression.cs
-System.CodeDom/CodeArrayIndexerExpression.cs
-System.CodeDom/CodeAttributeArgument.cs
-System.CodeDom/CodeAttachEventStatement.cs
-System.CodeDom/CodeLabeledStatement.cs
-System.CodeDom/CodeLinePragma.cs
-System.CodeDom/CodeSnippetExpression.cs
-System.CodeDom/CodeSnippetStatement.cs
-System.CodeDom/CodeSnippetTypeMember.cs
-System.CodeDom/CodeStatement.cs
-System.CodeDom/CodeTypeMember.cs
-System.CodeDom/CodeTypeOfExpression.cs
-System.CodeDom/CodeTypeReferenceExpression.cs
-System.CodeDom/CodeVariableDeclarationStatement.cs
-System.CodeDom/CodeVariableReferenceExpression.cs
-System.CodeDom/FieldDirection.cs
-System.CodeDom/CodeArrayCreateExpression.cs
-System.CodeDom/CodeAttributeArgumentCollection.cs
-System.CodeDom/CodeAttributeDeclarationCollection.cs
-System.CodeDom/CodeCatchClause.cs
-System.CodeDom/CodeCatchClauseCollection.cs
-System.CodeDom/CodeCommentStatementCollection.cs
-System.CodeDom/CodeConstructor.cs
-System.CodeDom/CodeExpressionCollection.cs
-System.CodeDom/CodeMemberMethod.cs
-System.CodeDom/CodeNamespace.cs
-System.CodeDom/CodeNamespaceCollection.cs
-System.CodeDom.Compiler/CodeDomProvider.cs
-System.CodeDom.Compiler/CodeGenerator.cs
-System.CodeDom.Compiler/CodeGeneratorOptions.cs
-System.CodeDom.Compiler/CompilerErrorCollection.cs
-System.CodeDom.Compiler/CompilerOptions.cs
-System.CodeDom.Compiler/CompilerParameters.cs
-System.CodeDom.Compiler/CompilerResults.cs
-System.CodeDom.Compiler/GeneratorSupport.cs
-System.CodeDom.Compiler/ICodeCompiler.cs
-System.CodeDom.Compiler/ICodeGenerator.cs
-System.CodeDom.Compiler/ICodeParser.cs
-System.CodeDom.Compiler/IndentedTextWriter.cs
-System.CodeDom.Compiler/LanguageOptions.cs
-System.CodeDom.Compiler/TempFileCollection.cs
-System.Net/CookieContainer.cs
-System.Net/EndPoint.cs
-System.Net/CookieCollection.cs
-System.Net/IPAddress.cs
-System.Net/Cookie.cs
-System.Net/CookieException.cs
-System.Net/HttpStatusCode.cs
-System.Net/NetworkAccess.cs
-System.Net/TransportType.cs
-System.Net/WebExceptionStatus.cs
-System.Net/ConnectionModes.cs
-System.Net/ProxyUseType.cs
-System.Net/WebStatus.cs
-System.Net/IPHostEntry.cs
-System.Net/EndpointPermission.cs
-System.Net/Dns.cs
-System.Net/ProtocolViolationException.cs
-System.Net/IWebProxy.cs
-System.Net/ICredentialLookup.cs
-System.Net/NetworkCredential.cs
-System.Net/SocketPermissionAttribute.cs
-System.Net/DnsPermissionAttribute.cs
-System.Net/Authorization.cs
-System.Net/CredentialCache.cs
-System.Net/HttpContinueDelegate.cs
-System.Net/HttpVersion.cs
-System.Net/ICertificatePolicy.cs
-System.Net/IPv6Address.cs
-System.Net/SocketAddress.cs
-System.Net/IWebRequestCreate.cs
-System.Net/WebException.cs
-System.Net/GlobalProxySelection.cs
-System.Net/WebHeaderCollection.cs
-System.Net/WebRequest.cs
-System.Net/WebResponse.cs
-System.Net/IPEndPoint.cs
-System.Net/FileWebRequest.cs
-System.Net/FileWebResponse.cs
-System.Net/ServicePoint.cs
-System.Net/ServicePointManager.cs
-System.Net/WebClient.cs
-System.Net/WebProxy.cs
-System.Net/DnsPermission.cs
-System.Net/HttpWebRequest.cs
-System.Net/HttpWebResponse.cs
-System.Net/MonoHttpDate.cs
-System.Net/SocketPermission.cs
-System.Net.Sockets/AddressFamily.cs
-System.Net.Sockets/TcpListener.cs
-System.Net.Sockets/TcpClient.cs
-System.Net.Sockets/UdpClient.cs
-System.Net.Sockets/ProtocolType.cs
-System.Net.Sockets/SelectMode.cs
-System.Net.Sockets/SocketException.cs
-System.Net.Sockets/SocketFlags.cs
-System.Net.Sockets/SocketOptionLevel.cs
-System.Net.Sockets/SocketOptionName.cs
-System.Net.Sockets/SocketShutdown.cs
-System.Net.Sockets/SocketType.cs
-System.Net.Sockets/LingerOption.cs
-System.Net.Sockets/MulticastOption.cs
-System.Net.Sockets/Socket.cs
-System.Net.Sockets/ProtocolFamily.cs
-System.Net.Sockets/NetworkStream.cs
-System.ComponentModel/ITypedList.cs
-System.ComponentModel/Component.cs
-System.ComponentModel/ComponentCollection.cs
-System.ComponentModel/IContainer.cs
-System.ComponentModel/BrowsableAttribute.cs
-System.ComponentModel/DescriptionAttribute.cs
-System.ComponentModel/IBindingList.cs
-System.ComponentModel/DesignerSerializationVisibility.cs
-System.ComponentModel/PropertyChangedEventArgs.cs
-System.ComponentModel/LocalizableAttribute.cs
-System.ComponentModel/ListChangedEventArgs.cs
-System.ComponentModel/ListChangedEventHandler.cs
-System.ComponentModel/ListChangedType.cs
-System.ComponentModel/ListSortDirection.cs
-System.ComponentModel/AttributeCollection.cs
-System.ComponentModel/DesignerSerializationVisibilityAttribute.cs
-System.ComponentModel/PropertyDescriptor.cs
-System.ComponentModel/Container.cs
-System.ComponentModel/DesignOnlyAttribute.cs
-System.ComponentModel/EventHandlerList.cs
-System.ComponentModel/MemberDescriptor.cs
-System.ComponentModel/PropertyDescriptorCollection.cs
-System.ComponentModel/ISynchronizeInvoke.cs
-System.ComponentModel/CategoryAttribute.cs
-System.ComponentModel/CollectionChangeAction.cs
-System.ComponentModel/CollectionChangeEventArgs.cs
-System.ComponentModel/CollectionChangeEventHandler.cs
-System.ComponentModel/IListSource.cs
-System.ComponentModel/ISupportInitialize.cs
-System.ComponentModel/ICustomTypeDescriptor.cs
-System.ComponentModel/IDataErrorInfo.cs
-System.ComponentModel/IEditableObject.cs
-System.ComponentModel/EventDescriptor.cs
-System.ComponentModel/DefaultValueAttribute.cs
-System.ComponentModel/EditorBrowsableAttribute.cs
-System.ComponentModel/EditorBrowsableState.cs
-System.ComponentModel/EventDescriptorCollection.cs
-System.ComponentModel/IComponent.cs
-System.ComponentModel/ISite.cs
-System.ComponentModel/MarshalByValueComponent.cs
-System.ComponentModel/ReadOnlyAttribute.cs
-System.ComponentModel/Win32Exception.cs
-System.ComponentModel/ITypeDescriptorContext.cs
-System.ComponentModel/TypeConverter.cs
-System.ComponentModel/TypeConverterAttribute.cs
-System/UriPartial.cs
-System/TODOAttribute.cs
-System/UriFormatException.cs
-System/UriBuilder.cs
-System/UriHostNameType.cs
-System/Uri.cs
-System.Configuration/IConfigurationSectionHandler.cs
-System.Configuration/IgnoreSectionHandler.cs
-System.Configuration/NameValueSectionHandler.cs
-System.Configuration/ConfigurationException.cs
-System.Configuration/ConfigurationSettings.cs
-System.Configuration/DictionarySectionHandler.cs
-System.Configuration/SingleTagSectionHandler.cs
-System.Diagnostics/BooleanSwitch.cs
-System.Diagnostics/Switch.cs
-System.Diagnostics/TraceLevel.cs
-System.Diagnostics/EntryWrittenEventArgs.cs
-System.Diagnostics/TraceSwitch.cs
-System.Diagnostics/Debug.cs
-System.Diagnostics/DiagnosticsConfigurationHandler.cs
-System.Diagnostics/ProcessStartInfo.cs
-System.Diagnostics/DefaultTraceListener.cs
-System.Diagnostics/TextWriterTraceListener.cs
-System.Diagnostics/Trace.cs
-System.Diagnostics/TraceListenerCollection.cs
-System.Diagnostics/EventLogEntry.cs
-System.Diagnostics/EventLog.cs
-System.Diagnostics/TraceImpl.cs
-System.Diagnostics/EntryWrittenEventHandler.cs
-System.Diagnostics/EventLogEntryCollection.cs
-System.Diagnostics/EventLogEntryType.cs
-System.Diagnostics/EventLogInstaller.cs
-System.Diagnostics/EventLogPermission.cs
-System.Diagnostics/EventLogPermissionEntry.cs
-System.Diagnostics/ProcessModule.cs
-System.Diagnostics/ProcessPriorityClass.cs
-System.Diagnostics/EventLogPermissionAccess.cs
-System.Diagnostics/FileVersionInfo.cs
-System.Diagnostics/EventLogPermissionAttribute.cs
-System.Diagnostics/EventLogTraceListener.cs
-System.Diagnostics/Process.cs
-System.Diagnostics/ProcessModuleCollection.cs
-System.Diagnostics/ICollectData.cs
-System.Diagnostics/ProcessThread.cs
-System.Diagnostics/ProcessThreadCollection.cs
-System.Diagnostics/ProcessWindowStyle.cs
-System.Diagnostics/ThreadPriorityLevel.cs
-System.Diagnostics/ThreadState.cs
-System.Diagnostics/ThreadWaitReason.cs
-System.Diagnostics/EventLogPermissionEntryCollection.cs
-System.Diagnostics/TraceListener.cs
-System.Threading/ThreadExceptionEventArgs.cs
-System.Threading/ThreadExceptionEventHandler.cs
-System.Globalization/Locale.cs
-System.Text.RegularExpressions/arch.cs
-System.Text.RegularExpressions/collections.cs
-System.Text.RegularExpressions/interpreter.cs
-System.Text.RegularExpressions/category.cs
-System.Text.RegularExpressions/match.cs
-System.Text.RegularExpressions/regex.cs
-System.Text.RegularExpressions/compiler.cs
-System.Text.RegularExpressions/debug.cs
-System.Text.RegularExpressions/interval.cs
-System.Text.RegularExpressions/quicksearch.cs
-System.Text.RegularExpressions/replace.cs
-System.Text.RegularExpressions/syntax.cs
-System.Text.RegularExpressions/parser.cs
-System.Text.RegularExpressions/RegexRunner.cs
-System.Text.RegularExpressions/RegexRunnerFactory.cs
-System.Text.RegularExpressions/cache.cs
-System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs
-Microsoft.CSharp/CSharpCodeGenerator.cs
-Microsoft.CSharp/CSharpCodeProvider.cs
diff --git a/mcs/class/corlib/.cvsignore b/mcs/class/corlib/.cvsignore
deleted file mode 100644
index d091f16f294..00000000000
--- a/mcs/class/corlib/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-corlib.dll
-corlib.pdb
diff --git a/mcs/class/corlib/ChangeLog b/mcs/class/corlib/ChangeLog
deleted file mode 100644
index 23388f13fef..00000000000
--- a/mcs/class/corlib/ChangeLog
+++ /dev/null
@@ -1,88 +0,0 @@
-2002-06-20 Martin Baulig <martin@gnome.org>
-
- * unix.args: New file. This is a mcs response file to compile
- corlib on GNU/Linux (which doesn't work yet).
-
-2002-04-30 Daniel Stodden <stodden@in.tum.de>
-
- * System/Delegate.cs: Implemented Remove()
- * System/MulticastDelegate.cs: Implementation of RemoveImpl()
- done. Plus a fix for Equals().
- * Test/System/MulticastDelegate.cs: Added. Should reflect above
- changes.
-
-2002-04-27 Martin Baulig <martin@gnome.org>
-
- * corlib.build: Added new "mcs-build" target to compile corlib
- with mcs. This doesn't work yet - it's just to test mcs to find
- and fix the remaining bugs.
-
-2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * corlib.build: removed seperate windows/linux builds. excluded
- wrapper and PAL classes from all builds.
-
-2002-03-03 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Exclude a bunch of interfaces from corlib_res.dll
- that were preventing the tests from running on Windows.
-
-2002-01-25 Mark Crichton <crichton@gimp.org>
-
- * System.Security.Cryptography/RijndaelManaged.cs: added
-
- * System.Security.Cryptography/Rijndael.cs: changed constructor
- to set default values. Hopefully I did it correctly.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * Unix/Errno.cs: Added
-
- * Unix/Wrapper.cs: Updated to new Wrapper
-
-2002-01-19 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: exclude Delegate from corlib_cmp.
-
-2002-01-09 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Exclude Security Attribute classes that need mcs
- magic to get them to compile.
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * corlib.build: Removed <excludes> for System.Resources
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Have the clean target remove any .pdb files that
- might be around if we compiled with debug on.
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Make new build of corlib_cmp.dll. This is the same
- as corlib.dll without Object and ValueType. It is used by
- /mcs/tools/corcompare.exe to compare with mscorlib.
-
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Put the linux target at the top. I keep changing the
- build for windows 'cause it's at the top. Then when I do make, nothing
- changes. It seems like it always takes me half a day to remember
- that the linux target comes second. Old age I guess.
-
- * .cvsignore: ignore corlib.pdb for times when it's built with debug on.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * corlib.build: Removed "exclude CodeAccessPermission.cs"
-
-2001-12-11 Duncan Mak <duncan@ximian.com>
-
- * ChangeLog: Added "System.Resources" to the exclude list.
-
-2001-12-05 Nick Drochak <ndrochak@gol.com>
-
- * ChangeLog: Add the change log to this directory
-
- * corlib.build: Add dependancy on linux target to test target. Need to have the dll before we can test it, right? Plus is encourages other to try 'make test'.
-
diff --git a/mcs/class/corlib/Linux/ChangeLog b/mcs/class/corlib/Linux/ChangeLog
deleted file mode 100644
index 96eb5e7cded..00000000000
--- a/mcs/class/corlib/Linux/ChangeLog
+++ /dev/null
@@ -1,27 +0,0 @@
-2002-03-18 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * Linux.cs: Removed math methods (now in System.Math).
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * Linux.cs: GetFileTime and SetFileTime need to be static
-
-Tue Jan 22 22:50:29 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Linux.cs: comment out call to Debug.Assert(): stuff from the System
- assembly cannot be used in corlib.
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * Linux.cs: IO implemented with file handles with internal calls,
- rather than casting file descriptors for C library p/invokes.
- Implemented Get/Set Creation/LastAccess/LastWrite TimeFile
- functions.
-
-Wed Nov 14 16:30:27 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Linux.cs: a '/' is a valid char in a file path.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * Linux.cs (GetCurrentDirectory): implemented
diff --git a/mcs/class/corlib/Linux/Linux.cs b/mcs/class/corlib/Linux/Linux.cs
deleted file mode 100644
index 86a1cfc475a..00000000000
--- a/mcs/class/corlib/Linux/Linux.cs
+++ /dev/null
@@ -1,484 +0,0 @@
-/*---------------------------------------------------------------------
-
- XX X XXX
- XX XX
- XXX XX XXX XXXXX XX
- XX XXX XX XX XX
- XX XX XX XX XXXXX XX
- XX XX XX XX XX XX X XX
- XXXX XX XX XXX XXXXXXX XXXX
- XX
- XXXXX
-
-Copyright (c) 2001 Intel Corporation. All Rights Reserved.
-
-CREATED: August 22, 2001
-OWNER: Scott D Smith, Joel Marcey
-VERSION: 1.0
----------------------------------------------------------------------*/
-
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.IO;
-using System.Collections;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace System.PAL
-{
- /// <summary>
- /// Class that implements IOperatingSystem, providing the requested functionality through calls into APIs available in Linux
- /// </summary>
- internal class OpSys
- {
- private Hashtable _environment = null;
-
- //----------------------------------
- // Class Constants
- //----------------------------------
- private const int EOF = -1; // TODO: Linux: Is this true?
-
-
- // For StdInputStream and StdOutputStream
- private IntPtr Stdin;
- private IntPtr Stdout;
- private IntPtr Stderr;
-
- //----------------------------------
- // Class Fields
- //----------------------------------
-
- //----------------------------------
- // Class Constructor
- //----------------------------------
- public OpSys()
- {
- Stdin=GetStdHandle(0);
- Stdout=GetStdHandle(1);
- Stderr=GetStdHandle(2);
- }
-
-
- //-------------------------------------------------
- // Environment Services
- //-------------------------------------------------
-
- public string NewLineSequence
- {
- get
- {
- return "\n";
- }
- }
-
- public char DirectorySeparator
- {
- get
- {
- return '/';
- }
- }
-
- public char AltDirectorySeparator
- {
- get
- {
- return '\\';
- }
- }
-
- public char VolumeSeparator
- {
- get
- {
- return '/';
- }
- }
-
- public char PathSeparator
- {
- get
- {
- return ':';
- }
- }
-
- public char[] InvalidPathChars
- {
- get
- {
- return new char[] { '\0' };
- }
- }
-
- public char[] DirVolSeparatorChars
- {
- get
- {
- return new char[] { this.DirectorySeparator, this.AltDirectorySeparator, this.VolumeSeparator};
- }
- }
- public char ExtensionCharacter
- {
- get
- {
- return '.';
- }
- }
-
- public string GetEnvironmentVariable(string eVar)
- {
- return EnvironmentVariables[eVar].ToString();
- }
-
- public IDictionary EnvironmentVariables
- {
- get
- {
- if (_environment == null) {
- IntPtr pp = _getEnviron(); // pointer to an array of char*
- _environment = new Hashtable();
-
- if (pp != IntPtr.Zero) {
- IntPtr p;
- bool done = false;
- char[] delimiter = { '=' };
-
- while (!done)
- {
- p = Marshal.ReadIntPtr(pp);
- if (p != IntPtr.Zero)
- {
- string str = Marshal.PtrToStringAuto(p);
- string[] ar = str.Split(delimiter, 2);
- switch(ar.Length)
- {
- case 1:
- _environment.Add(ar[0], "");
- break;
- case 2:
- _environment.Add(ar[0], ar[1]);
- break;
- default:
- //System.Diagnostics/.Debug.Assert(false); // this shouldn't happen
- break;
- }
- }
- else
- {
- done = true;
- }
- }
- }
- }
- return _environment;
- }
- }
-
- public string CommandLine
- {
- get
- {
- string path = Path.Combine(Path.Combine("/proc", _getPid().ToString()), "cmdline");
- StreamReader stream = File.OpenText(path);
- string res = stream.ReadToEnd();
- stream.Close();
- return res;
- }
- }
-
- public string MachineName
- {
- get
- {
- return GetEnvironmentVariable("HOSTNAME");
- }
- }
-
- public OperatingSystem OSVersion
- {
- get
- {
- return null;
- }
- }
-
- // System.Path services
-
- public string ChangeExtension(string path, string extension)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:ChangeExtension(System.String, System.String): Stub Method");
- return null;
- }
-
- public string GetExtension(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetExtension(System.String): Stub Method");
- return null;
- }
-
- public string GetFileName(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFileName(System.String): Stub Method");
- return null;
- }
-
- public string GetFileNameWithoutExtension(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFileNameWithoutExtension(System.String): Stub Method");
- return null;
- }
-
- public string GetFullPath(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFullPath(System.String): Stub Method");
- return null;
- }
-
- public string GetPathRoot(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetPathRoot(System.String): Stub Method");
- return null;
-
- }
-
- public string GetTempFileName()
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetTempFileName(): Stub Method");
- return null;
- }
-
- public string GetTempPath()
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetTempPath(): Stub Method");
- return null;
- }
-
- public bool HasExtension(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:HasExtension(System.String): Stub Method");
- return false;
- }
-
- public bool IsPathRooted(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:IsPathRooted(System.String): Stub Method");
- return false;
- }
-
-
-
- // System.Directory services
-
- public void DeleteDirectory(string path, bool recursive)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:DeleteDirectory(System.String, System.Boolean): Stub Method");
- }
-
- public bool ExistsDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:ExistsDirectory(System.String): Stub Method");
- return false;
- }
-
- public DateTime GetCreationTimeDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetCreationTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- [System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern string GetCurrentDirectory();
-
- public string[] GetDirectories(string path, string searchPattern)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetDirectories(System.String,System.String): Stub Method");
- return null;
- }
-
- public string[] GetFiles(string path, string searchPattern)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFiles(System.String, System.String): Stub Method");
- return null;
- }
-
- public string[] GetFileSystemEntries(string path, string searchPattern)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetFileSystemEntries(System.String, System.String): Stub Method");
- return null;
- }
-
- public DateTime GetLastAccessTimeDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetLastAccessTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastWriteTimeDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:GetLastWriteTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public void MoveDirectory(string sourceDirName, string destDirName)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:MoveDirectory(System.String, System.String): Stub Method");
- }
-
- public void SetCreationTimeDirectory(string path, DateTime creationTime)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetCreationTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetCurrentDirectory(string path)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetCurrentDirectory(System.String): Stub Method");
- }
-
- public void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetLastAccessTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime)
- {
- //System.Diagnostics/.Debug.WriteLine("Linux:SetLastWriteTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- //-----------------------------------
- // I/O Services
- //-----------------------------------
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- private extern IntPtr GetStdHandle(int fd);
-
- public IntPtr StdinHandle {
- get {
- return(Stdin);
- }
- }
-
- public IntPtr StdoutHandle {
- get {
- return(Stdout);
- }
- }
-
- public IntPtr StderrHandle {
- get {
- return(Stderr);
- }
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern void DeleteFile(string path);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public extern bool ExistsFile(string path);
-
- /* The long time parameters in GetFileTime and
- * SetFileTime correspond to Windows file times (ticks
- * from DateTime(1/1/1601 00:00 GMT))
- */
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- private extern static bool GetFileTime(IntPtr handle, out long creat, out long lastaccess, out long lastwrite);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- private extern static bool SetFileTime(IntPtr handle, long creat, long lastaccess, long lastwrite);
-
- public DateTime GetCreationTimeFile(string path)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.Read);
-
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
- s.Close();
-
- return DateTime.FromFileTime(creat);
- }
-
- public DateTime GetLastAccessTimeFile(string path)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.Read);
-
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
- s.Close();
-
- return DateTime.FromFileTime(lastaccess);
- }
-
- public DateTime GetLastWriteTimeFile(string path)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.Read);
-
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
- s.Close();
-
- return DateTime.FromFileTime(lastwrite);
- }
-
- public void SetCreationTimeFile(string path, DateTime creationTime)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
-
- // Get the existing times first
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
-
- creat=creationTime.ToFileTime();
-
- ret=SetFileTime(s.Handle, creat, lastaccess, lastwrite);
- s.Close();
- }
-
- public void SetLastAccessTimeFile(string path, DateTime lastAccessTime)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
-
- // Get the existing times first
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
-
- lastaccess=lastAccessTime.ToFileTime();
-
- ret=SetFileTime(s.Handle, creat, lastaccess, lastwrite);
- s.Close();
- }
-
- public void SetLastWriteTimeFile(string path, DateTime lastWriteTime)
- {
- long creat, lastaccess, lastwrite;
- bool ret;
- FileStream s = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
-
- // Get the existing times first
- ret=GetFileTime(s.Handle, out creat, out lastaccess, out lastwrite);
-
- lastwrite=lastWriteTime.ToFileTime();
-
- ret=SetFileTime(s.Handle, creat, lastaccess, lastwrite);
- s.Close();
- }
-
-
- public long FileLength(string path)
- {
- return 0;
- }
-
- // Private implementation details
- [DllImport("monowrapper", EntryPoint="mono_wrapper_environ", CharSet=CharSet.Ansi)]
- private unsafe static extern IntPtr _getEnviron();
-
- [DllImport("libc", EntryPoint="getpid")]
- private unsafe static extern int _getPid();
- }
-}
diff --git a/mcs/class/corlib/System.Collections/ArrayList.cs b/mcs/class/corlib/System.Collections/ArrayList.cs
deleted file mode 100644
index 71c9752383e..00000000000
--- a/mcs/class/corlib/System.Collections/ArrayList.cs
+++ /dev/null
@@ -1,1009 +0,0 @@
-//
-// System.Collections.ArrayList
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Vladimir Vukicevic
-// (C) 2002 Ximian, Inc.
-//
-
-using System;
-
-namespace System.Collections {
-
- [MonoTODO ("add versioning, changing the arraylist should invalidate all enumerators")]
- [Serializable]
- public class ArrayList : IList, ICollection, IEnumerable, ICloneable {
-
- // Keep these three fields in sync with mono-reflection.h.
- private int count = 0;
- private int capacity = defaultCapacity;
- private object[] dataArray;
-
- // constructors
- public ArrayList () {
- dataArray = new object[capacity];
- }
-
- public ArrayList (ICollection c) {
- if (null == c)
- throw new ArgumentNullException();
-
- //Emulate MS.NET behavior. Throw RankException when passed a
- // multi-dimensional Array.
- Array arr = c as Array;
- if (null != arr && arr.Rank > 1)
- throw new RankException ();
-
- this.capacity = (c.Count == 0) ? defaultCapacity : c.Count;
- dataArray = new object [capacity];
- foreach (object o in c)
- Add (o);
- }
-
- public ArrayList (int capacity) {
- if (capacity < 0)
- throw new ArgumentOutOfRangeException ("capacity", capacity, "Value must be greater than or equal to zero.");
-
- if (capacity > 0)
- this.capacity = capacity;
- // else if capacity == 0 then use defaultCapacity
-
- dataArray = new object[this.capacity];
- }
-
- private ArrayList (object[] dataArray, int count, int capacity,
- bool fixedSize, bool readOnly, bool synchronized)
- {
- this.dataArray = (object []) dataArray.Clone();
- this.count = count;
- this.capacity = capacity;
- this.fixedSize = fixedSize;
- this.readOnly = readOnly;
- this.synchronized = synchronized;
- }
-
- public static ArrayList ReadOnly (ArrayList list)
- {
- if (list == null)
- throw new ArgumentNullException ();
- return new ArrayList (list.ToArray (), list.Count, list.Capacity,
- list.IsFixedSize, true, list.IsSynchronized);
- }
-
- public static IList ReadOnly (IList list)
- {
- if (list == null)
- throw new ArgumentNullException ();
-
- ArrayList al = new ArrayList ();
-
- foreach (object o in list)
- al.Add (o);
-
- return (IList) ArrayList.ReadOnly (al);
- }
-
- public static ArrayList Synchronized (ArrayList list)
- {
- if (list == null)
- throw new ArgumentNullException ();
-
- return new ArrayList (list.ToArray (), list.Count, list.Capacity,
- list.IsFixedSize, list.IsReadOnly, true);
- }
-
- public static IList Synchronized (IList list)
- {
- if (list == null)
- throw new ArgumentNullException ();
-
- ArrayList al = new ArrayList ();
-
- foreach (object o in list)
- al.Add (o);
-
- return (IList) ArrayList.Synchronized (al);
- }
-
- public static ArrayList FixedSize (ArrayList list)
- {
- if (list == null)
- throw new ArgumentNullException ();
-
- return new ArrayList (list.ToArray (), list.Count, list.Capacity,
- true, list.IsReadOnly, list.IsSynchronized);
- }
-
- public static IList FixedSize (IList list)
- {
- if (list == null)
- throw new ArgumentNullException ();
-
- ArrayList al = new ArrayList ();
-
- foreach (object o in list)
- al.Add (o);
-
- return (IList) ArrayList.FixedSize (al);
- }
-
- public static ArrayList Repeat (object value, int count)
- {
- ArrayList al = new ArrayList (count);
- for (int i = 0; i < count; i++) {
- al.dataArray[i] = value;
- }
- al.count = count;
-
- return al;
- }
-
- [Serializable]
- private class ListWrapper : ArrayList
- {
- IList list;
-
- public ListWrapper (IList list)
- {
- if (null == list)
- throw new ArgumentNullException();
-
- this.list = list;
- count = ((ICollection) list).Count;
- }
-
- // ArrayList
- [MonoTODO]
- public override int Capacity {
- get { return list.Count; }
- set { throw new NotSupportedException (); }
- }
-
- [MonoTODO]
- public override void AddRange (ICollection collection)
- {
- if (collection == null)
- throw new ArgumentNullException ("colllection");
- if (IsFixedSize || IsReadOnly)
- throw new NotSupportedException ();
- }
-
- [MonoTODO]
- public override int BinarySearch (object value)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int BinarySearch (object value, IComparer comparer)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int BinarySearch (int index, int count, object value,
- IComparer comparer)
- {
- throw new NotImplementedException ();
- }
-
- public override void CopyTo (Array array)
- {
- if (null == array)
- throw new ArgumentNullException("array");
- if (array.Rank > 1)
- throw new ArgumentException("array cannot be multidimensional");
-
- CopyTo (array, 0);
- }
-
- [MonoTODO]
- public override void CopyTo (int index, Array array,
- int arrayIndex, int count)
- {
- if (array == null)
- throw new ArgumentNullException ();
- if (index < 0 || arrayIndex < 0 || count < 0)
- throw new ArgumentOutOfRangeException ();
- if (array.Rank > 1 || index >= Count || Count > (array.Length - arrayIndex))
- throw new ArgumentException ();
- // FIXME: handle casting error here
- }
-
- public override ArrayList GetRange (int index, int count)
- {
- if (index < 0 || count < 0)
- throw new ArgumentOutOfRangeException ();
- if (Count < (index + count))
- throw new ArgumentException ();
-
- ArrayList result = new ArrayList (count);
-
- for (int i = 0; i < count; i++)
- result.Add (list [i]);
-
- return result;
- }
-
- [MonoTODO]
- public override void InsertRange (int index, ICollection col)
- {
- if (col == null)
- throw new ArgumentNullException ();
- if (index < 0 || index > Count)
- throw new ArgumentOutOfRangeException ();
- if (IsReadOnly || IsFixedSize)
- throw new NotSupportedException ();
-
- if (index == Count) {
- foreach (object element in col)
- list.Add (element);
-
- } //else if ((index + count) < Count) {
-// for (int i = index; i < (index + count); i++)
-// list [i] = col [i];
-
-// } else {
-// int added = Count - (index + count);
-// for (int i = index; i < Count; i++)
-// list [i] = col [i];
-// for (int i = 0; i < added; i++)
-// list.Add (col [Count +i]);
-// }
- }
-
- public override int LastIndexOf (object value)
- {
- return LastIndexOf (value, Count, 0);
- }
-
- public override int LastIndexOf (object value, int startIndex)
- {
- return LastIndexOf (value, startIndex, 0);
- }
-
- public override int LastIndexOf (object value, int startIndex, int count)
- {
- if (null == value){
- return -1;
- }
-
- if (startIndex > Count || count < 0 || (startIndex + count > Count))
- throw new ArgumentOutOfRangeException ();
-
- int length = startIndex - count + 1;
-
- for (int i = startIndex; i >= length; i--)
- if (list [i] == value)
- return i;
- return -1;
- }
-
- public override void RemoveRange (int index, int count)
- {
- if ((index < 0) || (count < 0))
- throw new ArgumentOutOfRangeException ();
- if ((index > Count) || (index + count) > Count)
- throw new ArgumentException ();
- if (IsReadOnly || IsFixedSize)
- throw new NotSupportedException ();
-
- for (int i = 0; i < count; i++)
- list.RemoveAt (index);
- }
-
- public override void Reverse ()
- {
- Reverse (0, Count);
- }
-
- public override void Reverse (int index, int count)
- {
- if ((index < 0) || (count < 0))
- throw new ArgumentOutOfRangeException ();
- if ((index > Count) || (index + count) > Count)
- throw new ArgumentException ();
- if (IsReadOnly)
- throw new NotSupportedException ();
-
- object tmp = null;
-
- for (int i = index; i < count; i++) {
- tmp = list [i];
- list [i] = list [count - i];
- list [count - i] = tmp;
- }
- }
-
- public override void SetRange (int index, ICollection col)
- {
- if (index < 0 || (index + col.Count) > Count)
- throw new ArgumentOutOfRangeException ();
- if (col == null)
- throw new ArgumentNullException ();
- if (IsReadOnly)
- throw new NotSupportedException ();
-
- for (int i = index; i < col.Count; i++)
- foreach (object o in col)
- list [i] = o;
- }
-
- [MonoTODO]
- public override void Sort ()
- {
- }
-
- [MonoTODO]
- public override void Sort (IComparer comparer)
- {
- }
-
- [MonoTODO]
- public override void Sort (int index, int count, IComparer comparer)
- {
- }
-
- public override object [] ToArray ()
- {
- return (object []) ToArray (typeof (object));
- }
-
- public override Array ToArray (Type type)
- {
- int count = Count;
- Array result = Array.CreateInstance (type, count);
-
- for (int i = 0; i < count; i++)
- result.SetValue (list [i], i);
-
- return result;
- }
-
- [MonoTODO]
- public override void TrimToSize ()
- {
- }
-
- // IList
- public override bool IsFixedSize {
- get { return list.IsFixedSize; }
- }
-
- public override bool IsReadOnly {
- get { return list.IsReadOnly; }
- }
-
- public override object this [int index] {
- get { return list [index]; }
- set { list [index] = value; }
- }
-
- public override int Add (object value)
- {
- return list.Add (value);
- }
-
- public override void Clear ()
- {
- list.Clear ();
- }
-
- public override bool Contains (object value)
- {
- return list.Contains (value);
- }
-
- public override int IndexOf (object value)
- {
- return list.IndexOf (value);
- }
-
- public override void Insert (int index, object value)
- {
- list.Insert (index, value);
- }
-
- public override void Remove (object value)
- {
- list.Remove (value);
- }
-
- public override void RemoveAt (int index)
- {
- list.RemoveAt (index);
- }
-
- // ICollection
- public override int Count {
- get { return count; }
- }
-
- public override bool IsSynchronized {
- get { return ((ICollection) list).IsSynchronized; }
- }
-
- public override object SyncRoot {
- get { return ((ICollection) list).SyncRoot; }
- }
-
- public override void CopyTo (Array array, int index)
- {
- ((ICollection) list).CopyTo (array, index);
- }
-
- // ICloneable
- public override object Clone ()
- {
- return new ListWrapper (list);
- }
-
- // IEnumerable
- public override IEnumerator GetEnumerator ()
- {
- return ((IEnumerable) list).GetEnumerator ();
- }
- }
-
- [MonoTODO]
- public static ArrayList Adapter (IList list)
- {
- return new ListWrapper (list);
- }
-
- // properties
-
- private bool fixedSize = false;
- private bool readOnly = false;
- private bool synchronized = false;
-
- private long version = 0;
- private ArrayList source = null;
-
- private const int defaultCapacity = 16;
-
- private void copyDataArray (object[] outArray) {
- for (int i = 0; i < count; i++) {
- outArray[i] = dataArray[i];
- }
- }
-
- private void setSize (int newSize) {
- if (newSize == capacity)
- return;
-
- capacity = (newSize == 0) ? defaultCapacity : newSize;
-
- // note that this assumes that we've already sanity-checked
- // the new size
- object[] newDataArray = new object[newSize];
- copyDataArray (newDataArray);
- dataArray = newDataArray;
- }
-
- // note that this DOES NOT update count
- private void shiftElements (int startIndex, int numshift) {
- if (numshift == 0) {
- return;
- }
-
- if (count + numshift > capacity) {
- setSize (capacity * 2);
- shiftElements (startIndex, numshift);
- } else {
- if (numshift > 0) {
- int numelts = count - startIndex;
- for (int i = numelts-1; i >= 0; i--) {
- dataArray[startIndex + numshift + i] = dataArray[startIndex + i];
- }
-
- for (int i = startIndex; i < startIndex + numshift; i++) {
- dataArray[i] = null;
- }
- } else {
- int numelts = count - startIndex + numshift;
- for (int i = 0; i < numelts; i++) {
- dataArray [i + startIndex] = dataArray [i + startIndex - numshift];
- }
- for (int i = count + numshift; i < count; i++) {
- dataArray[i] = null;
- }
- }
- }
- }
-
- public virtual int Capacity {
- get {
- return capacity;
- }
-
- set {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (value < count) {
- throw new ArgumentOutOfRangeException
- ("ArrayList Capacity being set to less than Count");
- }
-
- if (fixedSize && value != capacity) {
- throw new NotSupportedException
- ("Collection is fixed size.");
- }
-
- setSize (value);
- }
- }
-
- private void CheckSourceVersion() {
- if (null != this.source && this.version != this.source.version) {
- throw new InvalidOperationException();
- }
- }
-
- public virtual int Count {
- get {
- CheckSourceVersion();
- return count;
- }
- }
-
- public virtual bool IsFixedSize {
- get {
- return fixedSize;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return readOnly;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return synchronized;
- }
- }
-
- public virtual object this[int index] {
- get {
- CheckSourceVersion();
-
- if (index < 0) {
- throw new ArgumentOutOfRangeException ("index < 0");
- }
-
- if (index >= count) {
- throw new ArgumentOutOfRangeException ("index out of range");
- }
-
- return dataArray[index];
- }
- set {
- if (index < 0) {
- throw new ArgumentOutOfRangeException ("index < 0");
- }
-
- if (index >= count) {
- throw new ArgumentOutOfRangeException ("index out of range");
- }
-
- if (readOnly) {
- throw new NotSupportedException ("Collection is read-only.");
- }
-
- dataArray[index] = value;
- version++;
- }
- }
-
- [MonoTODO]
- public virtual object SyncRoot {
- get {
- throw new NotImplementedException ("System.Collections.ArrayList.SyncRoot.get");
- }
- }
-
-
- // methods
-
- public virtual int Add (object value) {
- if (readOnly)
- throw new NotSupportedException ("ArrayList is read-only.");
- if (fixedSize)
- throw new NotSupportedException ("ArrayList is fixed size.");
-
- if (count + 1 >= capacity)
- setSize (capacity * 2);
-
- dataArray[count] = value;
- version++;
- return count++;
- }
-
- public virtual void AddRange (ICollection c) {
- if (null == c)
- throw new ArgumentNullException ("c");
- if (readOnly || fixedSize)
- throw new NotSupportedException ();
-
- int cc = c.Count;
- if (count + cc >= capacity)
- Capacity = cc < count? count * 2: count + cc + 1;
- c.CopyTo (dataArray, count);
- count += cc;
- version++;
- }
-
- public virtual int BinarySearch (object value) {
- return BinarySearch (0, count, value, null);
- }
-
- public virtual int BinarySearch (object value, IComparer comparer) {
- return BinarySearch (0, count, value, comparer);
- }
-
- public virtual int BinarySearch (int index, int count,
- object value, IComparer comparer) {
- return Array.BinarySearch (dataArray, index, count, value, comparer);
- }
-
- public virtual void Clear () {
- if (readOnly || fixedSize)
- throw new NotSupportedException();
-
- count = 0;
- version++;
- }
-
- public virtual object Clone () {
- return new ArrayList (dataArray, count, capacity,
- fixedSize, readOnly, synchronized);
- }
-
- public virtual bool Contains (object item) {
- for (int i = 0; i < count; i++) {
- if (Object.Equals (dataArray[i], item)) {
- return true;
- }
- }
-
- return false;
- }
-
- public virtual void CopyTo (Array array) {
- if (null == array)
- throw new ArgumentNullException("array");
- if (array.Rank > 1)
- throw new ArgumentException("array cannot be multidimensional");
-
- System.Array.Copy (dataArray, 0, array, 0, this.count);
- }
-
- public virtual void CopyTo (Array array, int arrayIndex) {
- if (null == array)
- throw new ArgumentNullException("array");
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException("arrayIndex");
- if (array.Rank > 1)
- throw new ArgumentException("array cannot be multidimensional");
- if (this.count > array.Length - arrayIndex)
- throw new ArgumentException("this ArrayList has more items than the space available in array from arrayIndex to the end of array");
-
- System.Array.Copy (dataArray, 0, array, arrayIndex, this.count);
- }
-
- public virtual void CopyTo (int index, Array array,
- int arrayIndex, int count) {
- if (null == array)
- throw new ArgumentNullException("array");
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException("arrayIndex");
- if (index < 0)
- throw new ArgumentOutOfRangeException("index");
- if (count < 0)
- throw new ArgumentOutOfRangeException("count");
- if (index >= this.count)
- throw new ArgumentException("index is greater than or equal to the source ArrayList.Count");
- if (array.Rank > 1)
- throw new ArgumentException("array cannot be multidimensional");
- if (arrayIndex >= array.Length)
- throw new ArgumentException("arrayIndex is greater than or equal to array's length");
- if (this.count > array.Length - arrayIndex)
- throw new ArgumentException("this ArrayList has more items than the space available in array from arrayIndex to the end of array");
-
- System.Array.Copy (dataArray, index, array, arrayIndex, count);
- }
-
- [Serializable]
- private class ArrayListEnumerator : IEnumerator {
- private object[] data;
- private int idx;
- private int start;
- private int num;
-
- internal ArrayListEnumerator(int index, int count, object[] items) {
- data = items;
- start = index;
- num = count;
- idx = start - 1;
- }
-
- public object Clone ()
- {
- return new ArrayListEnumerator (start, num, data);
- }
-
- public virtual object Current {
- get {
- return data [idx];
- }
- }
- public virtual bool MoveNext() {
- if (++idx < start + num)
- return true;
- return false;
- }
- public virtual void Reset() {
- idx = start - 1;
- }
- }
-
- public virtual IEnumerator GetEnumerator () {
- return new ArrayListEnumerator(0, this.Count, dataArray);
- }
-
- private void ValidateRange(int index, int count) {
- if (index < 0) {
- throw new ArgumentOutOfRangeException("index", index, "Must be equal to or greater than zero");
- }
- if (count < 0) {
- throw new ArgumentOutOfRangeException("count", count, "Must be equal to or greater than zero");
- }
- if (index > this.count - 1) {
- throw new ArgumentException();
- }
- if (index + count > this.count - 1) {
- throw new ArgumentException();
- }
- }
-
- public virtual IEnumerator GetEnumerator (int index, int count) {
- ValidateRange(index, count);
- return new ArrayListEnumerator(index, count, dataArray);
- }
-
- public virtual ArrayList GetRange (int index, int count) {
- ValidateRange(index, count);
- ArrayList retVal = new ArrayList(count);
-
- for (int i = index; i < count + index; i++) {
- retVal.Add(this[i]);
- }
- retVal.version = this.version;
- retVal.source = this;
- return retVal;
- }
-
- public virtual int IndexOf (object value) {
- return IndexOf (value, 0, count);
- }
-
- public virtual int IndexOf (object value, int startIndex) {
- return IndexOf (value, startIndex, count - startIndex);
- }
-
- public virtual int IndexOf (object value, int startIndex, int count) {
- if (startIndex < 0 || startIndex + count > this.count || count < 0) {
- throw new ArgumentOutOfRangeException ("IndexOf arguments out of range");
- }
- for (int i = startIndex; i < (startIndex + count); i++) {
- if (Object.Equals (dataArray[i], value)) {
- return i;
- }
- }
-
- return -1;
- }
-
- public virtual void Insert (int index, object value) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (fixedSize) {
- throw new NotSupportedException
- ("Collection is fixed size.");
- }
-
- if (index < 0 || index >= capacity) {
- throw new ArgumentOutOfRangeException ("index < 0 or index >= capacity");
- }
-
- shiftElements (index, 1);
- dataArray[index] = value;
- count++;
- version++;
- }
-
- public virtual void InsertRange (int index, ICollection c) {
-
- if (c == null)
- throw new ArgumentNullException ();
-
- if (index < 0 || index > count)
- throw new ArgumentOutOfRangeException ();
-
- if (IsReadOnly || IsFixedSize)
- throw new NotSupportedException ();
-
- shiftElements (index, c.Count);
- count += c.Count;
-
- IEnumerator en = c.GetEnumerator();
- while (en.MoveNext())
- dataArray[index++] = en.Current;
-
- version++;
- }
-
- public virtual int LastIndexOf (object value) {
- return LastIndexOf (value, count - 1, count);
- }
-
- public virtual int LastIndexOf (object value, int startIndex) {
- if (startIndex < 0 || startIndex > count - 1) {
- throw new ArgumentOutOfRangeException("startIndex", startIndex, "");
- }
- return LastIndexOf (value, startIndex, startIndex + 1);
- }
-
- public virtual int LastIndexOf (object value, int startIndex,
- int count)
- {
- if (null == value){
- return -1;
- }
- if (startIndex >= this.count)
- throw new ArgumentOutOfRangeException ("startIndex >= Count");
- if (count < 0)
- throw new ArgumentOutOfRangeException ("count < 0");
- if (startIndex + 1 < count)
- throw new ArgumentOutOfRangeException ("startIndex + 1 < count");
-
- int EndIndex = startIndex - count + 1;
- for (int i = startIndex; i >= EndIndex; i--) {
- if (Object.Equals (dataArray[i], value)) {
- return i;
- }
- }
-
- return -1;
- }
-
- public virtual void Remove (object obj) {
-
- if (IsFixedSize || IsReadOnly)
- throw new NotSupportedException ();
-
- int objIndex = IndexOf (obj);
-
- if (objIndex == -1) {
- // shouldn't an exception be thrown here??
- // the MS docs don't indicate one, and testing
- // with the MS .net framework doesn't indicate one
- return;
- }
-
- RemoveRange (objIndex, 1);
- }
-
- public virtual void RemoveAt (int index) {
- RemoveRange (index, 1);
- }
-
- public virtual void RemoveRange (int index, int count) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (fixedSize) {
- throw new NotSupportedException
- ("Collection is fixed size.");
- }
-
- if (index < 0 || index >= this.count || index + count > this.count) {
- throw new ArgumentOutOfRangeException
- ("index/count out of range");
- }
-
- shiftElements (index, - count);
- this.count -= count;
- version++;
- }
-
- public virtual void Reverse () {
- Reverse (0, count);
- }
-
- public virtual void Reverse (int index, int count) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (index < 0 || index + count > this.count) {
- throw new ArgumentOutOfRangeException
- ("index/count out of range");
- }
-
- Array.Reverse (dataArray, index, count);
- version++;
- }
-
- public virtual void SetRange (int index, ICollection c)
- {
- if (c == null)
- throw new ArgumentNullException ();
- if (readOnly)
- throw new NotSupportedException ();
- if (index < 0 || (index + c.Count) > count)
- throw new ArgumentOutOfRangeException ();
-
- c.CopyTo(dataArray, index);
- }
-
- public virtual void Sort () {
- Sort (0, count, null);
- }
-
- public virtual void Sort (IComparer comparer) {
- Sort (0, count, comparer);
- }
-
- public virtual void Sort (int index, int count, IComparer comparer) {
- if (readOnly) {
- throw new NotSupportedException
- ("Collection is read-only.");
- }
-
- if (index < 0 || index + count > this.count) {
- throw new ArgumentOutOfRangeException
- ("index/count out of range");
- }
-
- Array.Sort (dataArray, index, count, comparer);
- version++;
- }
-
- public virtual object[] ToArray() {
- object[] outArray = new object[count];
- Array.Copy (dataArray, outArray, count);
- return outArray;
- }
-
- public virtual Array ToArray (Type type) {
- Array outArray = Array.CreateInstance (type, count);
- Array.Copy (dataArray, outArray, count);
- return outArray;
- }
-
- public virtual void TrimToSize () {
-
- if (IsReadOnly || IsFixedSize)
- throw new NotSupportedException ();
-
- setSize(count);
-
- version++;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/BitArray.cs b/mcs/class/corlib/System.Collections/BitArray.cs
deleted file mode 100644
index 1fc6b156c0d..00000000000
--- a/mcs/class/corlib/System.Collections/BitArray.cs
+++ /dev/null
@@ -1,499 +0,0 @@
-using System;
-
-namespace System.Collections
-{
- // do we really need to specify IEnumerable since ICollection extends it?
- [Serializable]
- public sealed class BitArray : ICollection, IEnumerable, ICloneable
- {
- private Int32[] m_array;
- private int m_length;
- private int m_modCount = 0;
-
- private static void clearJunk(Int32[] arr, int numbits)
- {
- int numjunkbits = 32 - (numbits%32);
- UInt32 mask = (~0U >> numjunkbits);
- arr[arr.Length - 1] &= (int)mask;
- }
-
- private static int bitsToInts(int bits)
- {
- int retval = bits/32;
- if (bits % 32 != 0)
- retval++;
-
- return retval;
- }
-
- private static int bitsToBytes(int bits)
- {
- int retval = bits/8;
- if (bits % 8 != 0)
- retval++;
-
- return retval;
- }
-
-
- private void setBit(int bitIndex, bool value)
- {
- int index = bitIndex/32;
- int shift = bitIndex%32;
-
- Int32 theBit = 1 << shift;
-
- if(value)
- m_array[index] |= theBit;
- else
- m_array[index] &= ~theBit;
-
- m_modCount++;
- }
-
- private bool getBit(int bitIndex)
- {
- int index = bitIndex/32;
- int shift = bitIndex%32;
-
- Int32 theBit = m_array[index] & (1 << shift);
-
- return (theBit == 0) ? false : true;
- }
-
- private byte getByte(int byteIndex)
- {
- int index = byteIndex/4;
- int shift = (byteIndex%4)*8;
-
- Int32 theByte = m_array[index] & (0xff << shift);
-
- return (byte)((theByte >> shift)&0xff);
- }
-
- private void setByte(int byteIndex, byte value)
- {
- int index = byteIndex/4;
- int shift = (byteIndex%4)*8;
-
- Int32 orig = m_array[index];
-
- // clear the byte
- orig &= ~(0xff << shift);
- // or in the new byte
- orig |= value << shift;
-
- m_array[index] = orig;
-
- m_modCount++;
- }
-
- /* --- Constructors --- */
- public BitArray(BitArray orig)
- {
- m_length = orig.m_length;
-
- int numInts = bitsToInts(m_length);
- m_array = new Int32[numInts];
- Array.Copy(orig.m_array, m_array, numInts);
- }
-
- public BitArray(bool[] bits)
- {
- m_length = bits.Length;
-
- int numInts = bitsToInts(m_length);
- m_array = new Int32[numInts];
- for (int i=0; i < bits.Length; i++)
- setBit(i, bits[i]);
- }
-
- public BitArray(byte[] bytes)
- {
- m_length = bytes.Length * 8;
-
- m_array = new Int32[bitsToInts(m_length)];
- for (int i=0; i < bytes.Length; i++)
- setByte(i, bytes[i]);
- }
-
- public BitArray(int capacity)
- {
- m_length = capacity;
- m_array = new Int32[bitsToInts(m_length)];
- }
-
- public BitArray(int[] words)
- {
- int arrlen = words.Length;
- m_length = arrlen*32;
- m_array = new Int32[arrlen];
- Array.Copy(words, m_array, arrlen);
- }
-
- public BitArray(int capacity, bool value) : this(capacity)
- {
- if (value)
- {
- // FIXME: Maybe you can create an array pre filled?
- for (int i = 0; i < m_array.Length; i++)
- m_array[i] = ~0;
- }
- }
-
- private BitArray(Int32 [] array, int length)
- {
- m_array = array;
- m_length = length;
- }
-
-
- /* --- Public properties --- */
- public int Count
- {
- get
- {
- return m_length;
- }
- }
-
- public bool IsReadOnly
- {
- get
- {
- return false;
- }
- }
-
- public bool IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- public bool this[int index]
- {
- get
- {
- return Get(index);
- }
- set
- {
- Set(index, value);
- }
-
- }
-
- public int Length
- {
- get
- {
- return m_length;
- }
- set
- {
- if (value < 0)
- throw new ArgumentOutOfRangeException();
-
- int newLen = value;
- if (m_length != newLen)
- {
- int numints = bitsToInts(newLen);
- Int32 [] newArr = new Int32[numints];
- int copylen = (numints > m_array.Length ? m_array.Length : numints);
- Array.Copy(m_array, newArr, copylen);
-
- // clear out the junk bits at the end:
- clearJunk(newArr, newLen);
-
- // set the internal state
- m_array = newArr;
- m_length = newLen;
- m_modCount++;
- }
- }
- }
-
- public object SyncRoot
- {
- get
- {
- return this;
- }
- }
-
- /* --- Public methods --- */
- public BitArray And(BitArray operand)
- {
- if (operand == null)
- throw new ArgumentNullException();
- if (operand.m_length != m_length)
- throw new ArgumentException();
-
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = m_array[i] & operand.m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- public object Clone()
- {
- // FIXME: according to the doc, this should be a shallow copy.
- // But the MS implementation seems to do a deep copy.
- return new BitArray((Int32 [])m_array.Clone(), m_length);
- }
-
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- if (array == null)
- throw new ArgumentNullException();
- if (index < 0)
- throw new ArgumentOutOfRangeException();
-
- // FIXME: Throw ArgumentException if array is multidimensional
- if (index >= array.Length)
- throw new ArgumentException();
-
- // in each case, check to make sure enough space in array
-
- if (array is bool[])
- {
- if (index + m_length >= array.Length)
- throw new ArgumentException();
-
- bool [] barray = (bool []) array;
-
- // Copy the bits into the array
- for (int i = 0; i < m_length; i++)
- barray[index + i] = getBit(i);
- }
- else if (array is byte[])
- {
- int numbytes = bitsToBytes(m_length);
- if (index + numbytes >= array.Length)
- throw new ArgumentException();
-
- byte [] barray = (byte []) array;
- // Copy the bytes into the array
- for (int i = 0; i < numbytes; i++)
- barray[index + i] = getByte(i);
- }
- else if (array is int[])
- {
- int numints = bitsToInts(m_length);
- if (index + numints >= array.Length)
- throw new ArgumentException();
- Array.Copy(m_array, 0, array, index, numints);
- }
- else
- {
- throw new InvalidCastException();
- }
- }
-
-
- /*
- * All this code for nothing... Apparently, The MS BitArray doesn't
- * override Equals!
- *public override bool Equals(object obj)
- {
- // If it's not a BitArray, then it can't be equal to us.
- if (!(obj is BitArray))
- return false;
-
- // If the references are equal, then clearly the instances are equal
- if (this == obj)
- return true;
-
- // If its length is different, than it can't be equal.
- BitArray b = (BitArray) obj;
- if (m_length != b.m_length)
- return false;
-
-
- // Now compare the bits.
- // This is a little tricky, because if length doesn't divide 32,
- // then we shouldn't compare the unused bits in the last element
- // of m_array.
-
- // Compare all full ints. If any differ, then we are not equal.
- int numints = m_length/32;
- for (int i = 0; i < numints; i++)
- {
- if (b.m_array[i] != m_array[i])
- return false;
- }
-
- // Compare the left over bits (if any)
- int extrabits = m_length%32;
- if (extrabits != 0)
- {
- // our mask is the "extrabits" least significant bits set to 1.
- UInt32 comparemask = ~0U >> (32 - extrabits);
-
- // numints is rounded down, so it's safe to use as an index here,
- // as long as extrabits > 0.
- if ((b.m_array[numints] & comparemask)
- != (m_array[numints] & comparemask))
- return false;
- }
-
- // We passed through all the above, so we are equal.
- return true;
-
- }
- * End comment out of Equals()
- */
-
- public bool Get(int index)
- {
- if (index < 0 || index >= m_length)
- throw new ArgumentOutOfRangeException();
- return getBit(index);
- }
-
- public IEnumerator GetEnumerator()
- {
- return new BitArrayEnumerator(this);
- }
-
- /*
- * Since MS doesn't appear to override Equals/GetHashCode, we don't.
- *public override int GetHashCode()
- {
- // We could make this a constant time function
- // by just picking a constant number of bits, spread out
- // evenly across the entire array. For now, this will suffice.
-
- int retval = m_length;
-
- // Add in each array element, except for the leftover bits.
- int numints = m_length/32;
- for (int i = 0; i < numints; i++)
- retval += (int)m_array[i];
-
- // That's enough. Adding in the leftover bits is tiring.
-
- return retval;
- }
- * End comment out of GetHashCode()
- */
-
- public BitArray Not()
- {
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = ~m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- public BitArray Or(BitArray operand)
- {
- if (operand == null)
- throw new ArgumentNullException();
- if (operand.m_length != m_length)
- throw new ArgumentException();
-
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = m_array[i] | operand.m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- public void Set(int index, bool value)
- {
- if (index < 0 || index >= m_length)
- throw new ArgumentOutOfRangeException();
- setBit(index, value);
- }
-
- public void SetAll(bool value)
- {
- if (value)
- {
- for (int i = 0; i < m_array.Length; i++)
- m_array[i] = ~0;
-
- // clear out the junk bits that we might have set
- clearJunk(m_array, m_length);
- }
- else
- Array.Clear(m_array, 0, m_array.Length);
-
-
- m_modCount++;
- }
-
- public BitArray Xor(BitArray operand)
- {
- if (operand == null)
- throw new ArgumentNullException();
- if (operand.m_length != m_length)
- throw new ArgumentException();
-
- Int32 [] newarr = new Int32[m_array.Length];
- for (int i=0; i < m_array.Length; i++)
- newarr[i] = m_array[i] ^ operand.m_array[i];
-
- return new BitArray(newarr, m_length);
- }
-
- class BitArrayEnumerator : IEnumerator
- {
- BitArray m_bitArray;
- private bool m_current;
- private int m_index;
- private int m_max;
- private int m_modCount;
-
- public BitArrayEnumerator(BitArray ba)
- {
- m_index = -1;
- m_bitArray = ba;
- m_max = ba.m_length;
- m_modCount = ba.m_modCount;
- }
-
- public object Current
- {
- get
- {
- if (m_index < 0 || m_index >= m_max)
- throw new InvalidOperationException();
- return m_current;
- }
- }
-
- public bool MoveNext()
- {
- if (m_modCount != m_bitArray.m_modCount)
- throw new InvalidOperationException();
-
- if (m_index + 1 >= m_max)
- return false;
-
- m_index++;
- m_current = m_bitArray[m_index];
- return true;
- }
-
- public void Reset()
- {
- if (m_modCount != m_bitArray.m_modCount)
- throw new InvalidOperationException();
- m_index = -1;
- }
- }
- }
-}
-
-
-
-
-
diff --git a/mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs b/mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs
deleted file mode 100644
index b04c89aa11d..00000000000
--- a/mcs/class/corlib/System.Collections/CaseInsensitiveComparer.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Collections.CaseInsensitiveComparer
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Collections;
-
-
-
-namespace System.Collections {
-
- [Serializable]
- public class CaseInsensitiveComparer : IComparer {
-
- private static CaseInsensitiveComparer singleton;
-
-
- // Class constructor
-
- static CaseInsensitiveComparer ()
- {
- singleton=new CaseInsensitiveComparer ();
- }
-
-
- // Public instance constructor
-
- public CaseInsensitiveComparer ()
- {
- }
-
-
-
- //
- // Public static properties
- //
-
- public static CaseInsensitiveComparer Default {
- get {
- return singleton;
- }
- }
-
-
- //
- // Instance methods
- //
-
- //
- // IComparer
- //
-
- public int Compare (object a, object b)
- {
- string str1 = a as string;
- string str2 = b as string;
-
-
- int res = 0;
-
- if (str1 != null && str2 != null) {
- res = String.Compare (str1, str2, true);
- }
-
- return res;
- }
-
-
-
- } // CaseInsensitiveComparer
-}
-
diff --git a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs b/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs
deleted file mode 100644
index 109ae18a40b..00000000000
--- a/mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Collections.CaseInsensitiveHashCodeProvider
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Collections;
-
-
-
-namespace System.Collections {
-
- [Serializable]
- public class CaseInsensitiveHashCodeProvider : IHashCodeProvider {
-
- private static CaseInsensitiveHashCodeProvider singleton;
-
-
- // Class constructor
-
- static CaseInsensitiveHashCodeProvider ()
- {
- singleton=new CaseInsensitiveHashCodeProvider ();
- }
-
-
-
- // Public instance constructor
-
- public CaseInsensitiveHashCodeProvider ()
- {
- }
-
-
-
- //
- // Public static properties
- //
-
- public static CaseInsensitiveHashCodeProvider Default {
- get {
- return singleton;
- }
- }
-
-
- //
- // Instance methods
- //
-
- //
- // IHashCodeProvider
- //
-
- [MonoTODO]
- public int GetHashCode (object obj)
- {
- if (obj == null) {
- throw new ArgumentNullException ("obj is null");
- }
-
- string str = obj as string;
-
- if (str == null) {
- // FIXME:
- return 0;
- }
-
- int h = 0;
- char c;
-
- if (str.Length > 0) {
- for (int i = 0;i<str.Length;i++) {
- c = str [i];
-
- if (Char.IsLetter (c))
- c = Char.ToLower (c);
-
- h = h * 31 + c;
- }
- }
-
- return h;
- }
-
- } // CaseInsensitiveHashCodeProvider
-}
-
diff --git a/mcs/class/corlib/System.Collections/ChangeLog b/mcs/class/corlib/System.Collections/ChangeLog
deleted file mode 100644
index 2aaf6b8e7d3..00000000000
--- a/mcs/class/corlib/System.Collections/ChangeLog
+++ /dev/null
@@ -1,285 +0,0 @@
-2002-06-25 Nick Drochak <ndrochak@gol.com>
-
- * Queue.cs (CopyTo): Fix logic for copying the circular array.
- (Enqueue): Use actual length of array to determine when to grow
- (QueueEnumerator) Fixed Current to use array length, not capacity, and
- fixed off-by-one errror in MoveNext().
-
-Tue Jun 4 13:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: fixed RemoveAt() implementation.
-
-2002-05-27 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs (LastIndexOf): Return -1 if searching for null, also
- fix check of parameters sent to make sure we don't search beyond the
- beginning of the list.
- (ListWrapper): Throw exception if called with null.
- We now pass all unit tests.
-
-2002-05-23 Duncan Mak <duncan@ximian.com>
-
- * ArrayList.cs (Wrapper): Preliminary implementation of
- ArrayList.Wrapper (IList).
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * ArrayList.cs: Made count, capacity and dataArray the first three
- fields in the class. They're read by the reflection library.
-
-2002-05-21 Lawrence Pit <loz@cable.a2000.nl>
-
- * ArrayList.cs: Fixed bug where a capacity of 0 could be reached,
- thereby causing problems when trying to add elements.
-
-2002-05-06 Duncan Mak <duncan@ximian.com>
-
- * Queue.cs (TrimToSize): Implemented.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs: Throw RankException when constructing from a
- multi-dimensional array. Confirmed behavior from MS.NET
-
-Thu May 2 15:18:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: make mcs compile again: it's allowed to
- call arraylist.CopyTo(array, 0) when the length of the array
- is also 0.
-
-Wed May 1 17:05:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * SortedList.cs: fix RemoveAt () to use the correct length in
- Array.Copy.
-
-2002-05-01 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs (Add & AddRange) : Throw exceptions where needed.
-
-2002/05/01 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs (CopyTo) : Check parameters and throw exceptions
- where needed.
-
-2002/04/30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs (Clear) : Throw exception if ReadOnly or FixedSize.
- (InsertRange) : Implement.
- (SetRange) : Implement.
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs (TrimToSize) : Implement.
-
-2002-04-28 Duncan Mak <duncan@ximian.com>
-
- * ArrayList.cs (InsertRange):
- (SetRange):
- (Remove):
- (TrimToSize): Throw exceptions where needed.
-
-2002-04-29 Nick Drochak <ndrochak@gol.com>
-
- * Hashtable.cs (CopyTo): Throw exceptions where needed.
-
-2002-04-28 Duncan Mak <duncan@ximian.com>
-
- * ArrayList.cs (ReadOnly):
- (IList.ReadOnly): Implemented.
-
- (Synchronized):
- (IList.Synchronized): Implemented.
-
- (ixedSize):
- (IList.FixedSize): Implemented.
-
-2002-03-24 Duncan Mak <duncan@ximian.com>
-
- * SortedList.cs (Synchronized): Stubbed out a missing method
- pointed out by Jakk Simm's test suite.
-
-2002-03-14 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs (FixedSize(ArrayList)): should return an ArrayList. The
- other FixedSize() methods returns an IList.
-
-2002-03-13 Duncan Mak <duncan@ximian.com>
-
- * ArrayList.cs (FixedSize): Changed the return type to IList if
- the argument is an IList.
- (Synchronized): Ditto here.
-
-2002-03-08 Sergey Chaban <serge@wildwestsoftware.com>
-
- * Hashtable.cs: Fixed ToPrime () bug. Removed ALLOC_GRAIN.
- Removed unused code from static constructor.
- GetObjectData () - Version is the same as modificationCount.
-
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * ArrayList.cs: Add MonoTODO's where necessary. Fix bugs discovered
- by Bucky's tests. Implement a couple of things that were left undone.
-
-Mon Feb 11 19:49:25 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: Dick's fix to contructor.
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * Hashtable.cs: Implemented parts of the ISerializable
- interface. GetObjectData () is good, but serialization constructor
- needs some more love.
-
-Sat Jan 5 15:56:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Hashtable.cs: the IDictionaryEnumerator returns DictionaryEntries.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * Correct name to MonoTODO everywhere.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * ArrayList.cs : Setting an index does not implicitly
- extend the arraylist : remove FIXME.
-
- Decorate incomplete elements with the TODO attribute.
-
- * BitArray.cs : Insert TODO attributes where appropriate.
-
- * CaseInsensitiveHashcodeProvider.cs: Ditto.
-
- * Hashtable.cs, SortedList.cs : Ditto.
-
-Thu Dec 13 20:17:08 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: implemented AddRange(), CopyTo().
-
-2001-11-19 Miguel de Icaza <miguel@ximian.com>
-
- * DictionaryBase.cs: Implemented.
-
-Wed Nov 14 16:45:49 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: implement ArrayListEnumerator.
- * Hashtable.cs: hardcode the prime number table.
-
-2001-11-06 Nick Drochak <ndrochak@gol.com>
- * Queue.cs: Fixes from Ricardardo. QueueTest also updated.
-
-2001-11-04 Nick Drochak <ndrochak@gol.com>
- * Queue.cs: Fixed small syntax errors that were preventing the compile.
- I changed the build file to include Queue.cs as well.
-
-2001-11-04 Nick Drochak <ndrochak@gol.com>
- * ArrayList.cs: Fixed "off by one" error when shifting left the array when
- items are removed.
-
- * CollectionBase.cs: Added OnValidate(), OnRemove() and OnRemoveComplete()
- hook methods to the RemoveAt() method.
-
-2001-11-04 Nick Drochak <ndrochak@gol.com>
- * ArrayList.cs: Added private enumerator class and make GetEnumerator()
- methods return an instance of it.
-
-Tue Sep 25 18:52:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * ArrayList.cs: fix Insert () to check capacity, not count.
-
-Tue Sep 25 16:54:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * DictionaryEntry.cs: added.
-
-2001-08-10 Dietmar Maurer <dietmar@ximian.com>
-
- * common.src: removed duplicate entries
-
-2001-08-08 Nick Drochak <ndrochak@gol.com>
-
- * ReadOnlyCollectionBase.cs: Initialized private member.
- * CollectionBase.cs: Initialized private member.
- * common.src : Added ReadOnlyCollectionBase.cs and CollectionBase.cs
- * /mcs/class/makefile: Used $(SYSTEMROOT) instead of hard coded //c/winnt
- * /mcs/makefile: Used $(SYSTEMROOT) instead of hard coded //c/winnt
-
-2001-08-08 Nick Drochak <nick@jobdragon.com>
-
- * CollectionBase.cs: Add
- * ReadOnlyCollectionBase.cs: Add
- * CollectionBaseTest.cs: Add
- * ReadOnlyCollectionBaseTest.cs: Add
-
-2001-07-31 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * StackTest.cs: Add Test case for System.Collections.Stack.
- Contributed by Chris Hynes <chrish@assistedsolutions.com>
-
-2001-07-30 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * Stack.cs: Clone() doesn't need to check if it's synchronized, since
- we override it in SyncStack anyway...
-
- * Stack.cs: Pop() now shrinks the array if we drop below 1/4 full, to
- avoid using massive amounts of memory that are not necessary. We only
- drop to half the current size, which I hope will avoid the 'ping-pong'
- effect.
-
- * Stack.cs: SyncStack.IsReadOnly should return stack.IsReadOnly
- instead of just returning false, since we may have a ReadOnly wrapper
- in the future (although i can't imagine why). Thanks to David
- Menestrina <dmenest@yahoo.com> for pointing this out.
-
-2001-07-23 Sergey Chaban <serge@wildwestsoftware.com>
-
- * Hashtable.cs: Fixed bug in Clear(), the Count wasn't zeroed.
- From now, Clear() increases modification count.
- Fixed HCP bug in GetHash(object) - hcp.GetHashCode() was used
- instead of hcp.GetHashCode(key). This was resulted in the
- insanely long lookup times when HashCodeProvider was used to
- construct Hashtable. Added thread-safe wrapper.
-
-2001-07-16 David Menestrina <dmenest@yahoo.com>
-
- * BitArray.cs: Add
- * BitArrayTest.cs: Add
-
-2001-07-18 Miguel de Icaza <miguel@ximian.com>
-
- * IDictionary.cs (Collections): IDictionary implements ICollection
- as well. Thanks Sergey!
-
-2001-07-18 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * Stack.cs Removed unnecessary locking from many methods of
- SyncStack, removed SyncEnumerator because it was unnecessary,
- added a modCount member to Stack and Stack.Enumerator, to
- ensure that the Stack has not been modified out form under the
- Enumerator, and changed the Enumerator to use a reference to the
- stack rather than copying over the contents array.
-
-2001-07-17 David Menestrina <dmenest@yahoo.com>
-
- * Added implementation of BitArray.
-
-2001-07-17 Miguel de Icaza <miguel@ximian.com>
-
- * Hashtable.cs: Removed call to d.Count in the Hashtable
- constructor that takes an IDictionary as IDictionary does not
- provide a Count field.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * IDictionary.cs: Clear was clear.
-
-2001-07-13 Miguel de Icaza <miguel@ximian.com>
-
- * All files: Renamespace things to System.
-
-2001-07-05 Vladimir Vukicevic <vladimir@ximian.com>
-
- * ArrayList.cs: initial checkin and implementation
-
- * ICollection.cs, IComprarer.cs, IDictionary.cs,
- IDictionaryEnumerator.cs, IEnumerable.cs, IHashCodeProvider.cs,
- IList.cs: initial checkin
-
diff --git a/mcs/class/corlib/System.Collections/CollectionBase.cs b/mcs/class/corlib/System.Collections/CollectionBase.cs
deleted file mode 100644
index 743888a3849..00000000000
--- a/mcs/class/corlib/System.Collections/CollectionBase.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// System.Collections.CollectionBase.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-
-namespace System.Collections {
-
- [Serializable]
- public abstract class CollectionBase : IList, ICollection, IEnumerable {
-
- // private instance properties
- private ArrayList myList;
-
- // public instance properties
- public int Count { get { return InnerList.Count; } }
-
- // Public Instance Methods
- public IEnumerator GetEnumerator() { return InnerList.GetEnumerator(); }
- public void Clear() {
- OnClear();
- InnerList.Clear();
- OnClearComplete();
- }
- public void RemoveAt (int index) {
- object objectToRemove;
- objectToRemove = InnerList[index];
- OnValidate(objectToRemove);
- OnRemove(index, objectToRemove);
- InnerList.RemoveAt(index);
- OnRemoveComplete(index, objectToRemove);
- }
-
- // Protected Instance Constructors
- protected CollectionBase() {
- this.myList = new ArrayList();
- }
-
- // Protected Instance Properties
- protected ArrayList InnerList {get { return this.myList; } }
- protected IList List {get { return this; } }
-
- // Protected Instance Methods
- protected virtual void OnClear() { }
- protected virtual void OnClearComplete() { }
-
- protected virtual void OnInsert(int index, object value) { }
- protected virtual void OnInsertComplete(int index, object value) { }
-
- protected virtual void OnRemove(int index, object value) { }
- protected virtual void OnRemoveComplete(int index, object value) { }
-
- protected virtual void OnSet(int index, object oldValue, object newValue) { }
- protected virtual void OnSetComplete(int index, object oldValue, object newValue) { }
-
- protected virtual void OnValidate(object value) {
- if (null == value) {
- throw new System.ArgumentNullException("CollectionBase.OnValidate: Invalid parameter value passed to method: null");
- }
- }
-
- // ICollection methods
- void ICollection.CopyTo(Array array, int index) {
- InnerList.CopyTo(array, index);
- }
- object ICollection.SyncRoot {
- get { return InnerList.SyncRoot; }
- }
- bool ICollection.IsSynchronized {
- get { return InnerList.IsSynchronized; }
- }
-
- // IList methods
- int IList.Add (object value) {
- int newPosition;
- OnValidate(value);
- newPosition = InnerList.Count;
- OnInsert(newPosition, value);
- InnerList.Add(value);
- OnInsertComplete(newPosition, value);
- return newPosition;
- }
-
- bool IList.Contains (object value) {
- return InnerList.Contains(value);
- }
-
- int IList.IndexOf (object value) {
- return InnerList.IndexOf(value);
- }
-
- void IList.Insert (int index, object value) {
- OnValidate(value);
- OnInsert(index, value);
- InnerList.Insert(index, value);
- OnInsertComplete(index, value);
- }
-
- void IList.Remove (object value) {
- int removeIndex;
- OnValidate(value);
- removeIndex = InnerList.IndexOf(value);
- OnRemove(removeIndex, value);
- InnerList.Remove(value);
- OnRemoveComplete(removeIndex, value);
- }
-
- // IList properties
- bool IList.IsFixedSize {
- get { return InnerList.IsFixedSize; }
- }
-
- bool IList.IsReadOnly {
- get { return InnerList.IsReadOnly; }
- }
-
- object IList.this[int index] {
- get { return InnerList[index]; }
- set {
- object oldValue;
- // make sure we have been given a valid value
- OnValidate(value);
- // save a reference to the object that is in the list now
- oldValue = InnerList[index];
-
- OnSet(index, oldValue, value);
- InnerList[index] = value;
- OnSetComplete(index, oldValue, value);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/Comparer.cs b/mcs/class/corlib/System.Collections/Comparer.cs
deleted file mode 100644
index 6591c70334c..00000000000
--- a/mcs/class/corlib/System.Collections/Comparer.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Collections.Comparer
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-using System;
-using System.Collections;
-
-
-namespace System.Collections {
-
- [Serializable]
- public sealed class Comparer : IComparer {
-
- public static readonly Comparer Default;
-
-
- // Class constructor
-
- static Comparer ()
- {
- Default = new Comparer ();
- }
-
-
-
- // Public instance constructor
-
- private Comparer ()
- {
- }
-
-
-
- // IComparer
-
- public int Compare (object a, object b)
- {
- if (a == b)
- return 0;
- else if (a == null)
- return -1;
- else if (b == null)
- return 1;
- else if (a is IComparable)
- return (a as IComparable).CompareTo (b);
- else if (b is IComparable)
- return -(b as IComparable).CompareTo (a);
-
- throw new ArgumentException ("Neither a nor b IComparable");
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/DictionaryBase.cs b/mcs/class/corlib/System.Collections/DictionaryBase.cs
deleted file mode 100755
index ba01e9cdace..00000000000
--- a/mcs/class/corlib/System.Collections/DictionaryBase.cs
+++ /dev/null
@@ -1,372 +0,0 @@
-//
-// System.Collections.DictionaryBase.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Collections {
-
- /// <summary>
- /// An abstract class that provides a simple way to monitor changes to a
- /// Hashtable. Derived classes overwrite one or more of the `On' methods
- /// to track the changes to the Hashtable.
- /// </summary>
- ///
- /// <remarks>
- /// This class is a base class that can simplify the development of
- /// strongly typed collections. The idea being that the insertion of elements
- /// into the Hashtable can be forced to be of a given type.
- ///
- /// The `On' members are protected and designed to be used only by derived
- /// classes.
- /// </remarks>
- [Serializable]
- public abstract class DictionaryBase : IDictionary, ICollection, IEnumerable {
-
- Hashtable dictionary;
-
- protected DictionaryBase ()
- {
- dictionary = new Hashtable ();
- }
-
- /// <summary>
- /// Clears the contents of the dictionary
- /// </summary>
- public void Clear ()
- {
- OnClear ();
- dictionary.Clear ();
- OnClearComplete ();
- }
-
- /// <summary>
- /// Returns the number of items in the dictionary
- /// </summary>
- public int Count {
- get {
- return dictionary.Count;
- }
- }
-
- /// <summary>
- /// The collection contained as an IDictionary
- /// </summary>
- protected IDictionary Dictionary {
- get {
- return dictionary;
- }
- }
-
- /// <summary>
- /// The internal Hashtable representation for this dictionary
- /// </summary>
- protected Hashtable InnerHashtable {
- get {
- return dictionary;
- }
- }
-
- /// <summary>
- /// Copies the contents of the Dictionary into the target array
- /// </summary>
- /// <param name="array">
- /// The array to copy the contents of the dictionary to. The
- /// array must have a zero-based indexing
- /// </param>
- /// <param name="index">
- /// Starting index within the array where to copy the objects
- /// to.
- /// </param>
- public void CopyTo (Array array, int index)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (index < 0)
- throw new ArgumentOutOfRangeException ("index must be possitive");
- if (array.Rank > 1)
- throw new ArgumentException ("array is multidimensional");
- int size = array.Length;
- if (index > size)
- throw new ArgumentException ("index is larger than array size");
- if (index + Count > size)
- throw new ArgumentException ("Copy will overlflow array");
-
- DoCopy (array, index);
- }
-
- /// <summary>
- /// Internal routine called by CopyTo to perform the actual
- /// copying of the data
- /// </summary>
- private void DoCopy (Array array, int index)
- {
- foreach (DictionaryEntry de in dictionary)
- array.SetValue (de, index++);
- }
-
- /// <summary>
- /// Returns an enumerator for the dictionary
- /// </summary>
- public IDictionaryEnumerator GetEnumerator ()
- {
- return dictionary.GetEnumerator ();
- }
-
- /// <summary>
- /// Hook invoked before the clear operation
- /// is performed on the DictionaryBase
- /// </summary>
- protected virtual void OnClear ()
- {
- }
-
- /// <summary>
- /// Hook invoked after the clear operation
- /// is performed on the DictionaryBase
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- protected virtual void OnClearComplete ()
- {
- }
-
- /// <summary>
- /// Hook invoked while fetching data from the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// This method is provided as a simple way to override the values
- /// returned by the DictionaryBase.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to retrieve</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual object OnGet (object key, object current_value)
- {
- return current_value;
- }
-
- /// <summary>
- /// Hook invoked before inserting data into the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// Derived classes can override this method and perform some
- /// action before the <paramref name="current_value"/> is inserted
- /// into the dictionary.
- ///
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- ///
- /// <param name="key">Key of the object to insert</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnInsert (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after inserting the data into the DictionaryBase
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- ///
- /// <param name="key">Key of the object to insert</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnInsertComplete (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked before changing a value for a key in the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// Derived classes can override this method and perform some
- /// action before the <paramref name="current_value"/> is changed
- /// in the dictionary.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to change</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnSet (object key, object current_value, object new_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after changing a value for a key in the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes
- /// </remarks>
- ///
- /// <param name="key">Key of the object to change</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnSetComplete (object key, object current_value, object new_value)
- {
- }
-
- /// <summary>
- /// Hook invoked before removing a key/value from the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// Derived classes can override this method and perform some
- /// action before the <paramref name="current_value"/> is removed
- /// from the dictionary.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to remove</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnRemove (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after removing a key/value from the DictionaryBase.
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to be notified of changes.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to remove</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnRemoveComplete (object key, object current_value)
- {
- }
-
- /// <summary>
- /// Hook invoked after the value has been validated
- /// </summary>
- ///
- /// <remarks>
- /// The default implementation does nothing, derived classes
- /// can override this method to monitor the DictionaryBase.
- /// </remarks>
- ///
- /// <param name="key">Key of the object to retrieve</param>
- /// <param name="current_value">Current value of the object associated with
- /// <paramref name="key"/></param>
- protected virtual void OnValidate (object key, object current_value)
- {
- }
-
- bool IDictionary.IsFixedSize {
- get {
- return false;
- }
- }
-
- bool IDictionary.IsReadOnly {
- get {
- return false;
- }
- }
-
- object IDictionary.this [object key] {
- get {
- object value = dictionary [key];
-
- OnGet (key, value);
- return value;
- }
-
- set {
- if (dictionary.ContainsKey (key)){
- object current_value = dictionary [key];
- OnSet (key, current_value, value);
- dictionary [key] = value;
- OnSetComplete (key, current_value, value);
- } else {
- OnInsert (key, value);
- dictionary [key] = value;
- OnInsertComplete (key, value);
- }
- }
- }
-
- ICollection IDictionary.Keys {
- get {
- return dictionary.Keys;
- }
- }
-
- ICollection IDictionary.Values {
- get {
- return dictionary.Values;
- }
- }
-
- /// <summary>
- /// Adds a key/value pair to the dictionary.
- /// </summary>
- void IDictionary.Add (object key, object value)
- {
- OnInsert (key, value);
- dictionary.Add (key, value);
- OnInsertComplete (key, value);
- }
-
- /// <summary>
- /// Removes a Dictionary Entry based on its key
- /// </summary>
- void IDictionary.Remove (object key)
- {
- if (! dictionary.ContainsKey (key))
- return;
-
- object value = dictionary [key];
- OnRemove (key, value);
- dictionary.Remove (key);
- OnRemoveComplete (key, value);
- }
-
- /// <summary>
- /// Tests whether the dictionary contains an entry
- /// </summary>
- bool IDictionary.Contains (object key)
- {
- return dictionary.Contains (key);
- }
-
- bool ICollection.IsSynchronized {
- get {
- return dictionary.IsSynchronized;
- }
- }
-
- object ICollection.SyncRoot {
- get {
- return dictionary.SyncRoot;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return dictionary.GetEnumerator ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/DictionaryEntry.cs b/mcs/class/corlib/System.Collections/DictionaryEntry.cs
deleted file mode 100644
index e6cafab7cda..00000000000
--- a/mcs/class/corlib/System.Collections/DictionaryEntry.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-
-namespace System.Collections {
-
- [Serializable]
- public struct DictionaryEntry {
- private object key;
- private object val;
-
- public DictionaryEntry( object k, object value) {
- key = k;
- val = value;
- }
-
- public object Key {
- get {return key;}
- set {key = value;}
- }
- public object Value {
- get {return val;}
- set {val = value;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/Hashtable.cs b/mcs/class/corlib/System.Collections/Hashtable.cs
deleted file mode 100644
index 4557d15ab16..00000000000
--- a/mcs/class/corlib/System.Collections/Hashtable.cs
+++ /dev/null
@@ -1,1046 +0,0 @@
-//
-// System.Collections.Hashtable
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-
-// TODO: Interfaces to implement: ISerializable and IDeserializationCallback;
-
-
-namespace System.Collections {
-
- [MonoTODO]
- [Serializable]
- public class Hashtable : IDictionary, ICollection,
- IEnumerable, ICloneable, ISerializable, IDeserializationCallback
- {
-
- internal struct Slot {
- internal Object key;
-
- internal Object value;
-
- // Hashcode. Chains are also marked through this.
- internal int hashMix;
- }
-
- //
- // Private data
- //
-
- private readonly static int CHAIN_MARKER = ~Int32.MaxValue;
-
-
- // Used as indicator for the removed parts of a chain.
- private readonly static Object REMOVED_MARKER = new Object ();
-
-
- private int inUse;
- private int modificationCount;
- private float loadFactor;
- private Slot [] table;
- private int threshold;
-
- private IHashCodeProvider hcpRef;
- private IComparer comparerRef;
-
- private static int [] primeTbl = {
- 11,
- 19,
- 37,
- 73,
- 109,
- 163,
- 251,
- 367,
- 557,
- 823,
- 1237,
- 1861,
- 2777,
- 4177,
- 6247,
- 9371,
- 14057,
- 21089,
- 31627,
- 47431,
- 71143,
- 106721,
- 160073,
- 240101,
- 360163,
- 540217,
- 810343,
- 1215497,
- 1823231,
- 2734867,
- 4102283,
- 6153409,
- 9230113,
- 13845163
- };
-
- // Class constructor
-
- static Hashtable () {
- // NOTE: previously this static constructor was used
- // to calculate primeTbl, now primeTbl is
- // hardcoded and constructor does nothing
- // useful except for forcing compiler to
- // eliminate beforefieldinit from signature.
- }
-
-
- //
- // Constructors
- //
-
- public Hashtable () : this (0, 1.0f) {}
-
-
- public Hashtable (int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) {
- if (capacity<0)
- throw new ArgumentOutOfRangeException ("negative capacity");
-
- if (loadFactor<0.1 || loadFactor>1)
- throw new ArgumentOutOfRangeException ("load factor");
-
- if (capacity == 0) ++capacity;
- this.loadFactor = 0.75f*loadFactor;
- int size = (int) (capacity/this.loadFactor);
- size = ToPrime (size);
- this.SetTable (new Slot [size]);
-
- this.hcp = hcp;
- this.comparer = comparer;
-
- this.inUse = 0;
- this.modificationCount = 0;
-
- }
-
- public Hashtable (int capacity, float loadFactor) :
- this (capacity, loadFactor, null, null)
- {
- }
-
- public Hashtable (int capacity) : this (capacity, 1.0f)
- {
- }
-
- public Hashtable (int capacity,
- IHashCodeProvider hcp,
- IComparer comparer)
- : this (capacity, 1.0f, hcp, comparer)
- {
- }
-
-
- public Hashtable (IDictionary d, float loadFactor,
- IHashCodeProvider hcp, IComparer comparer)
- : this (d!=null ? d.Count : 0,
- loadFactor, hcp, comparer)
- {
-
- if (d == null)
- throw new ArgumentNullException ("dictionary");
-
- IDictionaryEnumerator it = d.GetEnumerator ();
- while (it.MoveNext ()) {
- Add (it.Key, it.Value);
- }
-
- }
-
- public Hashtable (IDictionary d, float loadFactor)
- : this (d, loadFactor, null, null)
- {
- }
-
-
- public Hashtable (IDictionary d) : this (d, 1.0f)
- {
- }
-
- public Hashtable (IDictionary d, IHashCodeProvider hcp, IComparer comparer)
- : this (d, 1.0f, hcp, comparer)
- {
- }
-
- public Hashtable (IHashCodeProvider hcp, IComparer comparer)
- : this (1, 1.0f, hcp, comparer)
- {
- }
-
- [MonoTODO]
- protected Hashtable (SerializationInfo info, StreamingContext context)
- {
-// loadFactor = info.GetValue ("LoadFactor", Type.GetType ("System.Float"));
-// comparerRef = info.GetValue ("Comparer", typeof (object));
-// hcpRef = info.GetValue ("HashCodeProvider", typeof (object));
-// this.Count = info.GetValue ("HashSize");
-// this.Keys = info.GetValue ("Keys");
-// this.Values = info.GetValue ("Values");
- }
-
- //
- // Properties
- //
-
- protected IComparer comparer {
- set {
- comparerRef = value;
- }
- get {
- return comparerRef;
- }
- }
-
- protected IHashCodeProvider hcp {
- set {
- hcpRef = value;
- }
- get {
- return hcpRef;
- }
- }
-
- // ICollection
-
- public virtual int Count {
- get {
- return inUse;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return false;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return this;
- }
- }
-
-
-
- // IDictionary
-
- public virtual bool IsFixedSize {
- get {
- return false;
- }
- }
-
-
- public virtual bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public virtual ICollection Keys {
- get {
- return new HashKeys (this);
- }
- }
-
- public virtual ICollection Values {
- get {
- return new HashValues (this);
- }
- }
-
-
-
- public virtual Object this [Object key] {
- get {
- return GetImpl (key);
- }
- set {
- PutImpl (key, value, true);
- }
- }
-
-
-
-
- //
- // Interface methods
- //
-
-
- // IEnumerable
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.KEY_MODE);
- }
-
-
- // ICollection
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- if (null == array)
- throw new ArgumentNullException ("array");
-
- if (arrayIndex < 0)
- throw new ArgumentOutOfRangeException ("arrayIndex");
-
- if (array.Rank > 1)
- throw new ArgumentException ("array is multidimensional");
-
- if (arrayIndex >= array.Length)
- throw new ArgumentException ("arrayIndex is equal to or greater than array.Length");
-
- if (arrayIndex + this.inUse > array.Length)
- throw new ArgumentException ("Not enough room from arrayIndex to end of array for this Hashtable");
-
- IDictionaryEnumerator it = GetEnumerator ();
- int i = arrayIndex;
-
- while (it.MoveNext ()) {
- array.SetValue (it.Entry, i++);
- }
- }
-
-
- // IDictionary
-
- public virtual void Add (Object key, Object value)
- {
- PutImpl (key, value, false);
- }
-
- public virtual void Clear ()
- {
- for (int i = 0;i<table.Length;i++) {
- table [i].key = null;
- table [i].value = null;
- table [i].hashMix = 0;
- }
-
- inUse = 0;
- modificationCount++;
- }
-
- public virtual bool Contains (Object key)
- {
- return (Find (key) >= 0);
- }
-
- public virtual IDictionaryEnumerator GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.ENTRY_MODE);
- }
-
- public virtual void Remove (Object key)
- {
- int i = Find (key);
- Slot [] table = this.table;
- if (i >= 0) {
- int h = table [i].hashMix;
- h &= CHAIN_MARKER;
- table [i].hashMix = h;
- table [i].key = (h != 0)
- ? REMOVED_MARKER
- : null;
- table [i].value = null;
- --inUse;
- ++modificationCount;
- }
- }
-
-
-
-
- public virtual bool ContainsKey (object key)
- {
- return Contains (key);
- }
-
- public virtual bool ContainsValue (object value)
- {
- int size = this.table.Length;
- Slot [] table = this.table;
-
- for (int i = 0; i < size; i++) {
- Slot entry = table [i];
- if (entry.key != null && entry.key!= REMOVED_MARKER
- && value.Equals (entry.value)) {
- return true;
- }
- }
- return false;
- }
-
-
- // ICloneable
-
- public virtual object Clone ()
- {
- Hashtable ht = new Hashtable (Count, hcp, comparer);
- ht.modificationCount = this.modificationCount;
- ht.inUse = this.inUse;
- ht.AdjustThreshold ();
-
- // FIXME: maybe it's faster to simply
- // copy the back-end array?
-
- IDictionaryEnumerator it = GetEnumerator ();
- while (it.MoveNext ()) {
- ht [it.Key] = it.Value;
- }
-
- return ht;
- }
-
- [MonoTODO]
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("LoadFactor", loadFactor);
- info.AddValue ("Version", modificationCount);
- info.AddValue ("Comparer", comparerRef);
- info.AddValue ("HashCodeProvider", hcpRef);
- info.AddValue ("HashSize", this.Count );
- info.AddValue ("Keys", this.Keys);
- info.AddValue ("Values", this.Values);
- }
-
- [MonoTODO]
- public virtual void OnDeserialization (object sender)
- {
- throw new NotImplementedException ();
- }
-
- /// <summary>
- /// Returns a synchronized (thread-safe)
- /// wrapper for the Hashtable.
- /// </summary>
- public static Hashtable Synchronized (Hashtable table)
- {
- return new SynchedHashtable (table);
- }
-
-
-
- //
- // Protected instance methods
- //
-
- /// <summary>Returns the hash code for the specified key.</summary>
- protected virtual int GetHash (Object key)
- {
- IHashCodeProvider hcp = this.hcp;
- return (hcp!= null)
- ? hcp.GetHashCode (key)
- : key.GetHashCode ();
- }
-
- /// <summary>
- /// Compares a specific Object with a specific key
- /// in the Hashtable.
- /// </summary>
- protected virtual bool KeyEquals (Object item, Object key)
- {
- IComparer c = this.comparer;
- if (c!= null)
- return (c.Compare (item, key) == 0);
- else
- return item.Equals (key);
- }
-
-
-
- //
- // Private instance methods
- //
-
- private void AdjustThreshold ()
- {
- int size = table.Length;
-
- threshold = (int) (size*loadFactor);
- if (this.threshold >= size)
- threshold = size-1;
- }
-
- private void SetTable (Slot [] table)
- {
- if (table == null)
- throw new ArgumentNullException ("table");
-
- this.table = table;
- AdjustThreshold ();
- }
-
- private Object GetImpl (Object key)
- {
- int i = Find (key);
-
- if (i >= 0)
- return table [i].value;
- else
- return null;
- }
-
-
- private int Find (Object key)
- {
- if (key == null)
- throw new ArgumentNullException ("null key");
-
- uint size = (uint) this.table.Length;
- int h = this.GetHash (key) & Int32.MaxValue;
- uint spot = (uint)h;
- uint step = (uint) ((h >> 5)+1) % (size-1)+1;
- Slot[] table = this.table;
-
- for (int i = 0; i < size;i++) {
- int indx = (int) (spot % size);
- Slot entry = table [indx];
- Object k = entry.key;
- if (k == null)
- return -1;
- if ((entry.hashMix & Int32.MaxValue) == h
- && this.KeyEquals (key, k)) {
- return indx;
- }
-
- if ((entry.hashMix & CHAIN_MARKER) == 0)
- return -1;
-
- spot+= step;
- }
- return -1;
- }
-
-
- private void Rehash ()
- {
- int oldSize = this.table.Length;
-
- // From the SDK docs:
- // Hashtable is automatically increased
- // to the smallest prime number that is larger
- // than twice the current number of Hashtable buckets
- uint newSize = (uint)ToPrime ((oldSize<<1)|1);
-
-
- Slot [] newTable = new Slot [newSize];
- Slot [] table = this.table;
-
- for (int i = 0;i<oldSize;i++) {
- Slot s = table [i];
- if (s.key!= null) {
- int h = s.hashMix & Int32.MaxValue;
- uint spot = (uint)h;
- uint step = ((uint) (h>>5)+1)% (newSize-1)+1;
- for (uint j = spot%newSize;;spot+= step, j = spot%newSize) {
- // No check for REMOVED_MARKER here,
- // because the table is just allocated.
- if (newTable [j].key == null) {
- newTable [j].key = s.key;
- newTable [j].value = s.value;
- newTable [j].hashMix |= h;
- break;
- } else {
- newTable [j].hashMix |= CHAIN_MARKER;
- }
- }
- }
- }
-
- ++this.modificationCount;
-
- this.SetTable (newTable);
- }
-
-
- private void PutImpl (Object key, Object value, bool overwrite)
- {
- if (key == null)
- throw new ArgumentNullException ("null key");
-
- uint size = (uint)this.table.Length;
- if (this.inUse >= this.threshold) {
- this.Rehash ();
- size = (uint)this.table.Length;
- }
-
- int h = this.GetHash (key) & Int32.MaxValue;
- uint spot = (uint)h;
- uint step = (uint) ((spot>>5)+1)% (size-1)+1;
- Slot [] table = this.table;
- Slot entry;
-
- int freeIndx = -1;
- for (int i = 0; i < size; i++) {
- int indx = (int) (spot % size);
- entry = table [indx];
-
- if (freeIndx == -1
- && entry.key == REMOVED_MARKER
- && (entry.hashMix & CHAIN_MARKER)!= 0)
- freeIndx = indx;
-
- if (entry.key == null ||
- (entry.key == REMOVED_MARKER
- && (entry.hashMix & CHAIN_MARKER)!= 0)) {
-
- if (freeIndx == -1)
- freeIndx = indx;
- break;
- }
-
- if ((entry.hashMix & Int32.MaxValue) == h && KeyEquals (key, entry.key)) {
- if (overwrite) {
- table [indx].value = value;
- ++this.modificationCount;
- } else {
- // Handle Add ():
- // An entry with the same key already exists in the Hashtable.
- throw new ArgumentException ("Key duplication");
- }
- return;
- }
-
- if (freeIndx == -1) {
- table [indx].hashMix |= CHAIN_MARKER;
- }
-
- spot+= step;
-
- }
-
- if (freeIndx!= -1) {
- table [freeIndx].key = key;
- table [freeIndx].value = value;
- table [freeIndx].hashMix |= h;
-
- ++this.inUse;
- ++this.modificationCount;
- }
-
- }
-
- private void CopyToArray (Array arr, int i,
- EnumeratorMode mode)
- {
- IEnumerator it = new Enumerator (this, mode);
-
- while (it.MoveNext ()) {
- arr.SetValue (it.Current, i++);
- }
- }
-
-
-
- //
- // Private static methods
- //
- private static bool TestPrime (int x)
- {
- if ((x & 1) != 0) {
- for (int n = 3; n< (int)Math.Sqrt (x); n += 2) {
- if ((x % n) == 0)
- return false;
- }
- return true;
- }
- // There is only one even prime - 2.
- return (x == 2);
- }
-
- private static int CalcPrime (int x)
- {
- for (int i = (x & (~1))-1; i< Int32.MaxValue; i += 2) {
- if (TestPrime (i)) return i;
- }
- return x;
- }
-
- private static int ToPrime (int x)
- {
- for (int i = 0; i < primeTbl.Length; i++) {
- if (x <= primeTbl [i])
- return primeTbl [i];
- }
- return CalcPrime (x);
- }
-
-
-
-
- //
- // Inner classes
- //
-
- public enum EnumeratorMode : int {KEY_MODE = 0, VALUE_MODE, ENTRY_MODE};
-
- protected sealed class Enumerator : IDictionaryEnumerator, IEnumerator {
-
- private Hashtable host;
- private int stamp;
- private int pos;
- private int size;
- private EnumeratorMode mode;
-
- private Object currentKey;
- private Object currentValue;
-
- private readonly static string xstr = "Hashtable.Enumerator: snapshot out of sync.";
-
- public Enumerator (Hashtable host, EnumeratorMode mode) {
- this.host = host;
- stamp = host.modificationCount;
- size = host.table.Length;
- this.mode = mode;
- Reset ();
- }
-
- public Enumerator (Hashtable host)
- : this (host, EnumeratorMode.KEY_MODE) {}
-
-
- private void FailFast ()
- {
- if (host.modificationCount != stamp) {
- throw new InvalidOperationException (xstr);
- }
- }
-
- public void Reset ()
- {
- FailFast ();
-
- pos = -1;
- currentKey = null;
- currentValue = null;
- }
-
- public bool MoveNext ()
- {
- FailFast ();
-
- if (pos < size) {
- while (++pos < size) {
- Slot entry = host.table [pos];
-
- if (entry.key != null && entry.key != REMOVED_MARKER) {
- currentKey = entry.key;
- currentValue = entry.value;
- return true;
- }
- }
- }
-
- currentKey = null;
- currentValue = null;
- return false;
- }
-
- public DictionaryEntry Entry
- {
- get {
- FailFast ();
- return new DictionaryEntry (currentKey, currentValue);
- }
- }
-
- public Object Key {
- get {
- FailFast ();
- return currentKey;
- }
- }
-
- public Object Value {
- get {
- FailFast ();
- return currentValue;
- }
- }
-
- public Object Current {
- get {
- FailFast ();
- switch (mode) {
- case EnumeratorMode.KEY_MODE:
- return currentKey;
- case EnumeratorMode.VALUE_MODE:
- return currentValue;
- case EnumeratorMode.ENTRY_MODE:
- return new DictionaryEntry (currentKey, currentValue);
- }
- throw new Exception ("should never happen");
- }
- }
- }
-
-
-
- protected class HashKeys : ICollection, IEnumerable {
-
- private Hashtable host;
- private int count;
-
- public HashKeys (Hashtable host) {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- this.count = host.Count;
- }
-
- // ICollection
-
- public virtual int Count {
- get {
- return count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {return host.SyncRoot;}
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.KEY_MODE);
- }
-
- // IEnumerable
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new Hashtable.Enumerator (host, EnumeratorMode.KEY_MODE);
- }
- }
-
-
- protected class HashValues : ICollection, IEnumerable {
-
- private Hashtable host;
- private int count;
-
- public HashValues (Hashtable host) {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- this.count = host.Count;
- }
-
- // ICollection
-
- public virtual int Count {
- get {
- return count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.VALUE_MODE);
- }
-
- // IEnumerable
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new Hashtable.Enumerator (host, EnumeratorMode.VALUE_MODE);
- }
- }
-
-
-
- protected class SynchedHashtable : Hashtable, IEnumerable {
-
- private Hashtable host;
-
- public SynchedHashtable (Hashtable host) {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- // ICollection
-
- public override int Count {
- get {
- return host.Count;
- }
- }
-
- public override bool IsSynchronized {
- get {
- return true;
- }
- }
-
- public override Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
-
-
- // IDictionary
-
- public override bool IsFixedSize {
- get {
- return host.IsFixedSize;
- }
- }
-
-
- public override bool IsReadOnly {
- get {
- return host.IsReadOnly;
- }
- }
-
- public override ICollection Keys {
- get {
- ICollection keys = null;
- lock (host.SyncRoot) {
- keys = host.Keys;
- }
- return keys;
- }
- }
-
- public override ICollection Values {
- get {
- ICollection vals = null;
- lock (host.SyncRoot) {
- vals = host.Values;
- }
- return vals;
- }
- }
-
-
-
- public override Object this [Object key] {
- get {
- return host.GetImpl (key);
- }
- set {
- lock (host.SyncRoot) {
- host.PutImpl (key, value, true);
- }
- }
- }
-
- // IEnumerable
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (host, EnumeratorMode.KEY_MODE);
- }
-
-
-
-
- // ICollection
-
- public override void CopyTo (Array array, int arrayIndex)
- {
- host.CopyTo (array, arrayIndex);
- }
-
-
- // IDictionary
-
- public override void Add (Object key, Object value)
- {
- lock (host.SyncRoot) {
- host.PutImpl (key, value, false);
- }
- }
-
- public override void Clear ()
- {
- lock (host.SyncRoot) {
- host.Clear ();
- }
- }
-
- public override bool Contains (Object key)
- {
- return (host.Find (key) >= 0);
- }
-
- public override IDictionaryEnumerator GetEnumerator ()
- {
- return new Enumerator (host, EnumeratorMode.ENTRY_MODE);
- }
-
- public override void Remove (Object key)
- {
- lock (host.SyncRoot) {
- host.Remove (key);
- }
- }
-
-
-
- public override bool ContainsKey (object key)
- {
- return host.Contains (key);
- }
-
- public override bool ContainsValue (object value)
- {
- return host.ContainsValue (value);
- }
-
-
- // ICloneable
-
- public override object Clone ()
- {
- return (host.Clone () as Hashtable);
- }
-
- } // SynchedHashtable
-
-
- } // Hashtable
-
-}
-
diff --git a/mcs/class/corlib/System.Collections/ICollection.cs b/mcs/class/corlib/System.Collections/ICollection.cs
deleted file mode 100644
index 2189931cae8..00000000000
--- a/mcs/class/corlib/System.Collections/ICollection.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.ICollection
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface ICollection : IEnumerable {
- int Count { get; }
-
- bool IsSynchronized { get; }
-
- object SyncRoot { get; }
-
- void CopyTo (Array array, int index);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IComparer.cs b/mcs/class/corlib/System.Collections/IComparer.cs
deleted file mode 100644
index 3d1ee2ef609..00000000000
--- a/mcs/class/corlib/System.Collections/IComparer.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IComparer
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IComparer {
- int Compare (object x, object y);
- }
-
-}
diff --git a/mcs/class/corlib/System.Collections/IDictionary.cs b/mcs/class/corlib/System.Collections/IDictionary.cs
deleted file mode 100644
index a03ab07d904..00000000000
--- a/mcs/class/corlib/System.Collections/IDictionary.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IDictionary
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IDictionary : ICollection {
- // properties
-
- bool IsFixedSize { get; }
-
- bool IsReadOnly { get; }
-
- object this[object key] { get; set; }
-
- ICollection Keys { get; }
-
- ICollection Values { get; }
-
- // methods
-
- void Add (object key, object value);
-
- void Clear ();
-
- bool Contains (object key);
-
- new IDictionaryEnumerator GetEnumerator ();
-
- void Remove (object key);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs b/mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs
deleted file mode 100644
index fb1998d55f0..00000000000
--- a/mcs/class/corlib/System.Collections/IDictionaryEnumerator.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IDictionaryEnumerator
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IDictionaryEnumerator : IEnumerator {
- DictionaryEntry Entry { get; }
- object Key { get; }
- object Value { get; }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IEnumerable.cs b/mcs/class/corlib/System.Collections/IEnumerable.cs
deleted file mode 100644
index de0a57475dc..00000000000
--- a/mcs/class/corlib/System.Collections/IEnumerable.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IEnumerable
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IEnumerable {
- IEnumerator GetEnumerator();
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IEnumerator.cs b/mcs/class/corlib/System.Collections/IEnumerator.cs
deleted file mode 100644
index 06d250c8b7e..00000000000
--- a/mcs/class/corlib/System.Collections/IEnumerator.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Collections.IEnumerator
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IEnumerator {
- object Current { get; }
-
- bool MoveNext ();
-
- void Reset ();
- }
-
-}
diff --git a/mcs/class/corlib/System.Collections/IHashCodeProvider.cs b/mcs/class/corlib/System.Collections/IHashCodeProvider.cs
deleted file mode 100644
index 15fc4df45bf..00000000000
--- a/mcs/class/corlib/System.Collections/IHashCodeProvider.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IHashCodeProvider
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IHashCodeProvider {
- int GetHashCode (object obj);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/IList.cs b/mcs/class/corlib/System.Collections/IList.cs
deleted file mode 100644
index e039a8358c3..00000000000
--- a/mcs/class/corlib/System.Collections/IList.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Collections.IList
-//
-// Author:
-// Vladimir Vukicevic (vladimir@pobox.com)
-//
-// (C) 2001 Vladimir Vukicevic
-//
-
-using System;
-
-namespace System.Collections {
-
- public interface IList : ICollection, IEnumerable {
- // properties
-
- bool IsFixedSize { get; }
-
- bool IsReadOnly { get; }
-
- object this[int index] { get; set; }
-
- // methods
-
- int Add (object value);
-
- void Clear ();
-
- bool Contains (object value);
-
- int IndexOf (object value);
-
- void Insert (int index, object value);
-
- void Remove (object value);
-
- void RemoveAt (int index);
- }
-}
diff --git a/mcs/class/corlib/System.Collections/Queue.cs b/mcs/class/corlib/System.Collections/Queue.cs
deleted file mode 100644
index e416eac87ed..00000000000
--- a/mcs/class/corlib/System.Collections/Queue.cs
+++ /dev/null
@@ -1,342 +0,0 @@
-//
-// System.Collections.Queue
-//
-// Author:
-// Ricardo Fernández Pascual
-//
-// (C) 2001 Ricardo Fernández Pascual
-//
-
-using System;
-using System.Collections;
-
-namespace System.Collections {
-
- [Serializable]
- public class Queue : ICollection, IEnumerable, ICloneable {
-
- private object[] contents;
- private int head = 0; // points to the first used slot
- private int count = 0;
- private int capacity = 16;
- private float growFactor = 2.0F;
- private int modCount = 0;
-
- public Queue () {
- contents = new object[capacity];
- }
-
- public Queue (ICollection collection) {
- capacity = collection.Count;
- contents = new object[capacity];
- count = capacity;
- collection.CopyTo (contents, 0);
- }
-
- public Queue (int initialCapacity) {
- capacity = initialCapacity;
- contents = new object[capacity];
- }
-
- public Queue (int initialCapacity, float growFactor) {
- capacity = initialCapacity;
- contents = new object[capacity];
- // LAMESPEC: The spec says nothing, but I think this
- // should throw an exception if growFactor <= 1.0
- this.growFactor = growFactor;
- }
-
- // from ICollection
-
- public virtual int Count {
- get { return count; }
- }
-
- public virtual bool IsSynchronized {
- get { return false; }
- }
-
- public virtual object SyncRoot {
- get { return this; }
- }
-
- public virtual void CopyTo (Array array, int index) {
- if (array == null) {
- throw new ArgumentNullException ();
- }
-
- if (index < 0) {
- throw new ArgumentOutOfRangeException ();
- }
-
- if (array.Rank > 1
- || index >= array.Length
- || count > array.Length - index) {
- throw new ArgumentException ();
- }
-
- int contents_length = contents.Length;
- int length_from_head = contents_length - head;
- // copy the contents of the circular array
- Array.Copy (contents, head, array, index,
- Math.Min (count, length_from_head));
- if (count > length_from_head)
- Array.Copy (contents, 0, array,
- index + length_from_head,
- count - length_from_head);
- }
-
- // from IEnumerable
-
- public virtual IEnumerator GetEnumerator () {
- return new QueueEnumerator (this);
- }
-
- // from ICloneable
-
- public virtual object Clone () {
- Queue newQueue;
-
- newQueue = new Queue (); // FIXME: improve this...
-
- newQueue.contents = new object[this.contents.Length];
- Array.Copy (this.contents, 0, newQueue.contents, 0,
- this.contents.Length);
- newQueue.head = this.head;
- newQueue.count = this.count;
- newQueue.capacity = this.capacity;
- newQueue.growFactor = this.growFactor;
-
- return newQueue;
- }
-
- // FIXME: should override Equals?
-
- // from Queue spec
-
-/*
- public virtual bool IsReadOnly {
- get { return false; }
- }
-*/
-
- public virtual void Clear () {
- modCount++;
- head = 0;
- count = 0;
- // FIXME: Should allocate a new contents array?
- // Should null the current array?
- }
-
- public virtual bool Contains (object obj) {
- int tail = head + count;
- if (obj == null) {
- for (int i = head; i < tail; i++) {
- if (contents[i % capacity] == null)
- return true;
- }
- } else {
- for (int i = head; i < tail; i++) {
- if (obj.Equals (contents[i % capacity]))
- return true;
- }
- }
- return false;
- }
-
- public virtual object Dequeue ()
- {
- modCount++;
- if (count < 1)
- throw new InvalidOperationException ();
- object result = contents[head];
- head = (head + 1) % capacity;
- count--;
- return result;
- }
-
- public virtual void Enqueue (object obj) {
- modCount++;
- if (count == contents.Length)
- grow ();
- contents[(head + count) % contents.Length] = obj;
- count++;
- }
-
- public virtual object Peek () {
- if (count < 1)
- throw new InvalidOperationException ();
- return contents[head];
- }
-
- public static Queue Synchronized (Queue queue) {
- if (queue == null) {
- throw new ArgumentNullException ();
- }
- return new SyncQueue (queue);
- }
-
- public virtual object[] ToArray () {
- object[] ret = new object[count];
- CopyTo (ret, 0);
- return ret;
- }
-
- public virtual void TrimToSize() {
- object[] trimmed = new object [count];
- CopyTo (trimmed, 0);
- contents = trimmed;
- }
-
- // private methods
-
- private void grow () {
- int newCapacity = (int) Math.Ceiling
- (contents.Length * growFactor);
- object[] newContents = new object[newCapacity];
- CopyTo (newContents, 0);
- contents = newContents;
- head = 0;
- }
-
- // private classes
-
- private class SyncQueue : Queue {
- Queue queue;
-
- internal SyncQueue (Queue queue) {
- this.queue = queue;
- }
-
- public override int Count {
- get {
- lock (queue) {
- return queue.count;
- }
- }
- }
-
- public override bool IsSynchronized {
- get {
- lock (queue) {
- return queue.IsSynchronized;
- }
- }
- }
-
- public override object SyncRoot {
- get {
- return queue.SyncRoot;
- }
- }
-
- public override void CopyTo (Array array, int index) {
- lock (queue) {
- queue.CopyTo (array, index);
- }
- }
-
- public override IEnumerator GetEnumerator () {
- lock (queue) {
- return queue.GetEnumerator ();
- }
- }
-
- public override object Clone () {
- lock (queue) {
- return queue.Clone ();
- }
- }
-
-/*
- public override bool IsReadOnly {
- get {
- lock (queue) {
- return queue.IsReadOnly;
- }
- }
- }
-*/
-
- public override void Clear () {
- lock (queue) {
- queue.Clear ();
- }
- }
-
- public override bool Contains (object obj) {
- lock (queue) {
- return queue.Contains (obj);
- }
- }
-
- public override object Dequeue () {
- lock (queue) {
- return queue.Dequeue ();
- }
- }
-
- public override void Enqueue (object obj) {
- lock (queue) {
- queue.Enqueue (obj);
- }
- }
-
- public override object Peek () {
- lock (queue) {
- return queue.Peek ();
- }
- }
-
- public override object[] ToArray () {
- lock (queue) {
- return queue.ToArray ();
- }
- }
- }
-
- [Serializable]
- private class QueueEnumerator : IEnumerator {
- Queue queue;
- private int modCount;
- private int current;
-
- internal QueueEnumerator (Queue q) {
- queue = q;
- modCount = q.modCount;
- current = -1; // one element before the head
- }
-
- public virtual object Current {
- get {
- if (modCount != queue.modCount
- || current < 0
- || current >= queue.count)
- throw new InvalidOperationException ();
- return queue.contents[(queue.head + current) % queue.contents.Length];
- }
- }
-
- public virtual bool MoveNext () {
- if (modCount != queue.modCount) {
- throw new InvalidOperationException ();
- }
-
- if (current >= queue.count - 1) {
- return false;
- } else {
- current++;
- return true;
- }
- }
-
- public virtual void Reset () {
- if (modCount != queue.modCount) {
- throw new InvalidOperationException();
- }
- current = -1;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs b/mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs
deleted file mode 100644
index 9aafb5ff282..00000000000
--- a/mcs/class/corlib/System.Collections/ReadOnlyCollectionBase.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Collections.ReadOnlyCollectionBase.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-
-namespace System.Collections {
-
- [Serializable]
- public abstract class ReadOnlyCollectionBase : ICollection, IEnumerable {
-
- // private instance properties
- private System.Collections.ArrayList myList;
-
- // public instance properties
- public int Count { get { return InnerList.Count; } }
-
- // Public Instance Methods
- public System.Collections.IEnumerator GetEnumerator() { return InnerList.GetEnumerator(); }
-
- // Protected Instance Constructors
- protected ReadOnlyCollectionBase() {
- this.myList = new System.Collections.ArrayList();
- }
-
- // Protected Instance Properties
- protected System.Collections.ArrayList InnerList {get { return this.myList; } }
-
- // ICollection methods
- void ICollection.CopyTo(Array array, int index) {
- lock (InnerList) { InnerList.CopyTo(array, index); }
- }
- object ICollection.SyncRoot {
- get { return InnerList.SyncRoot; }
- }
- bool ICollection.IsSynchronized {
- get { return InnerList.IsSynchronized; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Collections/SortedList.cs b/mcs/class/corlib/System.Collections/SortedList.cs
deleted file mode 100644
index 8f2247d5e7f..00000000000
--- a/mcs/class/corlib/System.Collections/SortedList.cs
+++ /dev/null
@@ -1,862 +0,0 @@
-//
-// System.Collections.SortedList
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-using System;
-using System.Collections;
-
-
-namespace System.Collections {
-
- /// <summary>
- /// Represents a collection of associated keys and values
- /// that are sorted by the keys and are accessible by key
- /// and by index.
- /// </summary>
- [Serializable]
- public class SortedList : IDictionary, ICollection,
- IEnumerable, ICloneable {
-
-
- internal struct Slot {
- internal Object key;
- internal Object value;
- }
-
- private readonly static int INITIAL_SIZE = 16;
-
- public enum EnumeratorMode : int {KEY_MODE = 0, VALUE_MODE}
-
- private int inUse;
- private int modificationCount;
- private Slot[] table;
- private IComparer comparer;
-
-
-
- //
- // Constructors
- //
- public SortedList () : this (INITIAL_SIZE)
- {
- }
-
- public SortedList (int initialCapacity)
- : this (null, initialCapacity)
- {
- }
-
- public SortedList (IComparer comparer, int initialCapacity)
- {
- this.comparer = comparer;
- InitTable (initialCapacity);
- }
-
- public SortedList (IComparer comparer)
- : this (comparer, 0)
- {
- }
-
-
- public SortedList (IDictionary d) : this (d, null)
- {
- }
-
- public SortedList (IDictionary d, IComparer comparer)
- {
- if (d == null)
- throw new ArgumentNullException ("dictionary");
-
- InitTable (d.Count);
- this.comparer = comparer;
-
- IDictionaryEnumerator it = d.GetEnumerator ();
- while (it.MoveNext ()) {
- if (it.Key is IComparable) {
- Add (it.Key, it.Value);
- } else {
- throw new InvalidCastException("!IComparable");
- }
- }
- }
-
-
-
-
- //
- // Properties
- //
-
-
- // ICollection
-
- public virtual int Count {
- get {
- return inUse;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return false;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return this;
- }
- }
-
-
- // IDictionary
-
- public virtual bool IsFixedSize {
- get {
- return false;
- }
- }
-
-
- public virtual bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public virtual ICollection Keys {
- get {
- return new ListKeys (this);
- }
- }
-
- public virtual ICollection Values {
- get {
- return new ListValues (this);
- }
- }
-
-
-
- public virtual Object this [Object key] {
- get {
- return GetImpl (key);
- }
- set {
- PutImpl (key, value, true);
- }
- }
-
-
-
-
- public virtual int Capacity {
- get {
- return table.Length;
- }
- set {
- Slot [] table = this.table;
- int current = table.Length;
-
- if (inUse > value)
- throw new ArgumentOutOfRangeException("capacity too small");
-
- if (value > current) {
- Slot [] newTable = new Slot [value];
- Array.Copy (table, newTable, current);
- this.table = newTable;
- }
- }
- }
-
-
-
- //
- // Public instance methods.
- //
-
-
- // IEnumerable
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.KEY_MODE);
- }
-
-
- // IDictionary
-
- public virtual void Add (object key, object value)
- {
- PutImpl (key, value, false);
- }
-
-
- public virtual void Clear ()
- {
- this.table = new Slot [Capacity];
- inUse = 0;
- modificationCount++;
- }
-
- public virtual bool Contains (object key)
- {
- return (Find (key) >= 0);
- }
-
-
- public virtual IDictionaryEnumerator GetEnumerator ()
- {
- return new Enumerator (this, EnumeratorMode.KEY_MODE);
- }
-
- public virtual void Remove (object key)
- {
- int i = IndexOfKey (key);
- if (i >= 0) RemoveAt (i);
- }
-
-
- // ICollection
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- IDictionaryEnumerator it = GetEnumerator ();
- int i = arrayIndex;
-
- while (it.MoveNext ()) {
- array.SetValue (it.Entry, i++);
- }
- }
-
-
-
- // ICloneable
-
- public virtual object Clone ()
- {
- SortedList sl = new SortedList (this, comparer);
- sl.modificationCount = this.modificationCount;
- return sl;
- }
-
-
-
-
- //
- // SortedList
- //
-
- public virtual IList GetKeyList ()
- {
- return new ListKeys (this);
- }
-
-
- public virtual IList GetValueList ()
- {
- return new ListValues (this);
- }
-
-
- public virtual void RemoveAt (int index)
- {
- Slot [] table = this.table;
- int cnt = Count;
- if (index >= 0 && index < cnt) {
- if (index != cnt - 1) {
- Array.Copy (table, index+1, table, index, cnt-1-index);
- } else {
- table [index].key = null;
- table [index].value = null;
- }
- --inUse;
- ++modificationCount;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
-
-
-
-
- public virtual int IndexOfKey (object key)
- {
- int indx = Find (key);
- return (indx | (indx >> 31));
- }
-
-
- public virtual int IndexOfValue (object value)
- {
- Slot [] table = this.table;
- int len = table.Length;
-
- for (int i=0; i < len; i++) {
- if (table[i].value.Equals (value)) {
- return i;
- }
- }
-
- return -1;
- }
-
-
- public virtual bool ContainsKey (object key)
- {
- return Contains (key);
- }
-
-
- public virtual bool ContainsValue (object value)
- {
- return IndexOfValue (value) >= 0;
- }
-
-
- public virtual object GetByIndex (int index)
- {
- if (index >= 0 && index < Count) {
- return table [index].value;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
-
- public virtual void SetByIndex (int index, object value)
- {
- if (index >= 0 && index < Count) {
- table [index].value = value;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
-
- public virtual object GetKey (int index)
- {
- if (index >= 0 && index < Count) {
- return table [index].key;
- } else {
- throw new ArgumentOutOfRangeException("index out of range");
- }
- }
-
- [MonoTODO]
- public static SortedList Synchronized (SortedList list)
- {
- return null;
- }
-
- public virtual void TrimToSize ()
- {
- // From Beta2:
- // Trimming an empty SortedList sets the capacity
- // of the SortedList to the default capacity,
- // not zero.
- if (Count == 0) Resize (INITIAL_SIZE, false);
- else Resize (Count, true);
- }
-
-
- //
- // Private methods
- //
-
-
- private void Resize (int n, bool copy)
- {
- Slot [] table = this.table;
- Slot [] newTable = new Slot [n];
- if (copy) Array.Copy (table, 0, newTable, 0, n);
- this.table = newTable;
- }
-
-
- private void EnsureCapacity (int n, int free)
- {
- Slot [] table = this.table;
- Slot [] newTable = null;
- int cap = Capacity;
- bool gap = (free >=0 && free < Count);
-
- if (n > cap) {
- newTable = new Slot [n << 1];
- }
-
- if (newTable != null) {
- if (gap) {
- int copyLen = free;
- if (copyLen > 0) {
- Array.Copy (table, 0, newTable, 0, copyLen);
- }
- copyLen = Count - free;
- if (copyLen > 0) {
- Array.Copy (table, free, newTable, free+1, copyLen);
- }
- } else {
- // Just a resizing, copy the entire table.
- Array.Copy (table, newTable, Count);
- }
- this.table = newTable;
- } else if (gap) {
- Array.Copy (table, free, table, free+1, Count - free);
- }
- }
-
-
- private void PutImpl (object key, object value, bool overwrite)
- {
- if (key == null)
- throw new ArgumentNullException ("null key");
-
- Slot [] table = this.table;
- int freeIndx = Find (key);
-
-
- if (freeIndx >= 0) {
- if (!overwrite)
- throw new ArgumentException("element already exists");
-
- table [freeIndx].value = value;
- return;
- }
-
- freeIndx = ~freeIndx;
-
- if (freeIndx > Capacity + 1)
- throw new Exception ("SortedList::internal error ("+key+", "+value+") at ["+freeIndx+"]");
-
-
- EnsureCapacity (Count+1, freeIndx);
-
- table = this.table;
- table [freeIndx].key = key;
- table [freeIndx].value = value;
-
- ++inUse;
- ++modificationCount;
-
- }
-
-
- private object GetImpl (object key)
- {
- int i = Find (key);
-
- if (i >= 0)
- return table [i].value;
- else
- return null;
- }
-
-
- private void InitTable (int capacity)
- {
- int size = (capacity + 1) & (~1);
- if (size < INITIAL_SIZE) size = INITIAL_SIZE;
- this.table = new Slot [size];
- this.inUse = 0;
- this.modificationCount = 0;
- }
-
-
- private void CopyToArray (Array arr, int i,
- EnumeratorMode mode)
- {
- IEnumerator it = new Enumerator (this, mode);
-
- while (it.MoveNext ()) {
- arr.SetValue (it.Current, i++);
- }
- }
-
-
- private int Find (object key)
- {
- Slot [] table = this.table;
- int len = Count;
-
- if (len == 0) return ~0;
-
- IComparer comparer = (this.comparer == null)
- ? Comparer.Default
- : this.comparer;
-
- int left = 0;
- int right = len-1;
-
- while (left <= right) {
- int guess = (left + right) >> 1;
-
- int cmp = comparer.Compare (key, table[guess].key);
-
- if (cmp == 0) return guess;
-
- cmp &= ~Int32.MaxValue;
-
- if (cmp == 0) left = guess+1;
- else right = guess-1;
- }
-
- return ~left;
- }
-
-
-
- //
- // Inner classes
- //
-
-
- protected sealed class Enumerator : IDictionaryEnumerator,
- IEnumerator {
-
- private SortedList host;
- private int stamp;
- private int pos;
- private int size;
- private EnumeratorMode mode;
-
- private object currentKey;
- private object currentValue;
-
- private readonly static string xstr = "SortedList.Enumerator: snapshot out of sync.";
-
- public Enumerator (SortedList host, EnumeratorMode mode)
- {
- this.host = host;
- stamp = host.modificationCount;
- size = host.Count;
- this.mode = mode;
- Reset ();
- }
-
- public Enumerator (SortedList host)
- : this (host, EnumeratorMode.KEY_MODE)
- {
- }
-
-
- private void FailFast ()
- {
- if (host.modificationCount != stamp) {
- throw new InvalidOperationException (xstr);
- }
- }
-
- public void Reset ()
- {
- FailFast ();
-
- pos = -1;
- currentKey = null;
- currentValue = null;
- }
-
- public bool MoveNext ()
- {
- FailFast ();
-
- Slot [] table = host.table;
-
- if (++pos < size) {
- Slot entry = table [pos];
-
- currentKey = entry.key;
- currentValue = entry.value;
- return true;
- }
-
- currentKey = null;
- currentValue = null;
- return false;
- }
-
- public DictionaryEntry Entry
- {
- get {
- FailFast ();
- return new DictionaryEntry (currentKey,
- currentValue);
- }
- }
-
- public Object Key {
- get {
- FailFast ();
- return currentKey;
- }
- }
-
- public Object Value {
- get {
- FailFast ();
- return currentValue;
- }
- }
-
- public Object Current {
- get {
- FailFast ();
- return (mode == EnumeratorMode.KEY_MODE)
- ? currentKey
- : currentValue;
- }
- }
- }
-
-
- protected class ListKeys : IList, IEnumerable {
-
- private SortedList host;
-
-
- public ListKeys (SortedList host)
- {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- //
- // ICollection
- //
-
- public virtual int Count {
- get {
- return host.Count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.KEY_MODE);
- }
-
-
- //
- // IList
- //
-
- public virtual bool IsFixedSize {
- get {
- return true;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return true;
- }
- }
-
-
- public virtual object this [int index] {
- get {
- return host.GetKey (index);
- }
- set {
- throw new NotSupportedException("attempt to modify a key");
- }
- }
-
- public virtual int Add (object value)
- {
- throw new NotSupportedException("IList::Add not supported");
- }
-
- public virtual void Clear ()
- {
- throw new NotSupportedException("IList::Clear not supported");
- }
-
- public virtual bool Contains (object key)
- {
- return host.Contains (key);
- }
-
-
- public virtual int IndexOf (object key)
- {
- return host.IndexOfKey (key);
- }
-
-
- public virtual void Insert (int index, object value)
- {
- throw new NotSupportedException("IList::Insert not supported");
- }
-
-
- public virtual void Remove (object value)
- {
- throw new NotSupportedException("IList::Remove not supported");
- }
-
-
- public virtual void RemoveAt (int index)
- {
- throw new NotSupportedException("IList::RemoveAt not supported");
- }
-
-
- //
- // IEnumerable
- //
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new SortedList.Enumerator (host, EnumeratorMode.KEY_MODE);
- }
-
-
- }
-
-
- protected class ListValues : IList, IEnumerable {
-
- private SortedList host;
-
-
- public ListValues (SortedList host)
- {
- if (host == null)
- throw new ArgumentNullException ();
-
- this.host = host;
- }
-
- //
- // ICollection
- //
-
- public virtual int Count {
- get {
- return host.Count;
- }
- }
-
- public virtual bool IsSynchronized {
- get {
- return host.IsSynchronized;
- }
- }
-
- public virtual Object SyncRoot {
- get {
- return host.SyncRoot;
- }
- }
-
- public virtual void CopyTo (Array array, int arrayIndex)
- {
- host.CopyToArray (array, arrayIndex, EnumeratorMode.VALUE_MODE);
- }
-
-
- //
- // IList
- //
-
- public virtual bool IsFixedSize {
- get {
- return true;
- }
- }
-
- public virtual bool IsReadOnly {
- get {
- return true;
- }
- }
-
-
- [MonoTODO]
- public virtual object this [int index] {
- get {
- return host.GetByIndex (index);
- }
- set {
- // FIXME: It seems (according to tests)
- // that modifications are allowed
- // in Beta2.
- // ? host.SetByIndex (index, value);
- throw new NotSupportedException("attempt to modify a value");
- }
- }
-
- public virtual int Add (object value)
- {
- throw new NotSupportedException("IList::Add not supported");
- }
-
- public virtual void Clear ()
- {
- throw new NotSupportedException("IList::Clear not supported");
- }
-
- public virtual bool Contains (object value)
- {
- return host.ContainsValue (value);
- }
-
-
- public virtual int IndexOf (object value)
- {
- return host.IndexOfValue (value);
- }
-
-
- public virtual void Insert (int index, object value)
- {
- throw new NotSupportedException("IList::Insert not supported");
- }
-
-
- public virtual void Remove (object value)
- {
- throw new NotSupportedException("IList::Remove not supported");
- }
-
-
- public virtual void RemoveAt (int index)
- {
- throw new NotSupportedException("IList::RemoveAt not supported");
- }
-
-
- //
- // IEnumerable
- //
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new SortedList.Enumerator (host, EnumeratorMode.VALUE_MODE);
- }
-
-
- }
-
- } // SortedList
-
-} // System.Collections
diff --git a/mcs/class/corlib/System.Collections/Stack.cs b/mcs/class/corlib/System.Collections/Stack.cs
deleted file mode 100644
index 392ab6fcd00..00000000000
--- a/mcs/class/corlib/System.Collections/Stack.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-//
-// System.Collections.Stack
-//
-// Author:
-// Garrett Rooney (rooneg@electricjellyfish.net)
-//
-// (C) 2001 Garrett Rooney
-//
-
-namespace System.Collections {
-
- [Serializable]
- public class Stack : ICollection, IEnumerable, ICloneable {
-
- // properties
- private object[] contents;
- private int current = -1;
- private int count = 0;
- private int capacity = 16;
- private int modCount = 0;
-
- private void Resize(int ncapacity) {
- object[] ncontents = new object[ncapacity];
-
- Array.Copy(contents, ncontents, count);
-
- capacity = ncapacity;
- contents = ncontents;
- }
-
- public Stack() {
- contents = new object[capacity];
- }
-
- public Stack(ICollection collection) {
- capacity = collection.Count;
- contents = new object[capacity];
- current = capacity - 1;
- count = capacity;
-
- collection.CopyTo(contents, 0);
- }
-
- public Stack(int c) {
- capacity = c;
- contents = new object[capacity];
- }
-
- [Serializable]
- private class SyncStack : Stack {
-
- Stack stack;
-
- internal SyncStack(Stack s) {
- stack = s;
- }
-
- public override int Count {
- get {
- lock (stack) {
- return stack.Count;
- }
- }
- }
-
-/*
- public override bool IsReadOnly {
- get {
- lock (stack) {
- return stack.IsReadOnly;
- }
- }
- }
-*/
-
- public override bool IsSynchronized {
- get { return true; }
- }
-
- public override object SyncRoot {
- get { return stack.SyncRoot; }
- }
-
- public override void Clear() {
- lock(stack) { stack.Clear(); }
- }
-
- public override object Clone() {
- lock (stack) {
- return Stack.Synchronized((Stack)stack.Clone());
- }
- }
-
- public override bool Contains(object obj) {
- lock (stack) { return stack.Contains(obj); }
- }
-
- public override void CopyTo(Array array, int index) {
- lock (stack) { stack.CopyTo(array, index); }
- }
-
- public override IEnumerator GetEnumerator() {
- lock (stack) {
- return new Enumerator(stack);
- }
- }
-
- public override object Peek() {
- lock (stack) { return stack.Peek(); }
- }
-
- public override object Pop() {
- lock (stack) { return stack.Pop(); }
- }
-
- public override void Push(object obj) {
- lock (stack) { stack.Push(obj); }
- }
-
- public override object[] ToArray() {
- lock (stack) { return stack.ToArray(); }
- }
- }
-
- public static Stack Synchronized(Stack s) {
- if (s == null) {
- throw new ArgumentNullException();
- }
-
- return new SyncStack(s);
- }
-
- public virtual int Count {
- get { return count; }
- }
-
-/*
- public virtual bool IsReadOnly {
- get { return false; }
- }
-*/
-
- public virtual bool IsSynchronized {
- get { return false; }
- }
-
- public virtual object SyncRoot {
- get { return this; }
- }
-
- public virtual void Clear() {
- modCount++;
-
- for (int i = 0; i < count; i++) {
- contents[i] = null;
- }
-
- count = 0;
- current = -1;
- }
-
- public virtual object Clone() {
- Stack stack;
-
- stack = new Stack();
-
- stack.current = current;
- stack.contents = contents;
- stack.count = count;
- stack.capacity = capacity;
-
- return stack;
- }
-
- public virtual bool Contains(object obj) {
- if (count == 0)
- return false;
-
- for (int i = 0; i < count; i++) {
- if (contents[i].Equals(obj))
- return true;
- }
-
- return false;
- }
-
- public virtual void CopyTo (Array array, int index) {
- if (array == null) {
- throw new ArgumentNullException();
- }
-
- if (index < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- if (array.Rank > 1 ||
- index >= array.Length ||
- count > array.Length - index) {
- throw new ArgumentException();
- }
-
- for (int i = current; i != -1; i--) {
- array.SetValue(contents[i],
- count - (i + 1) + index);
- }
- }
-
- private class Enumerator : IEnumerator {
-
- Stack stack;
- private int modCount;
- private int current;
-
- internal Enumerator(Stack s) {
- // this is odd. it seems that you need to
- // start one further ahead than current, since
- // MoveNext() gets called first when using an
- // Enumeration...
- stack = s;
- modCount = s.modCount;
- current = s.current + 1;
- }
-
- public virtual object Current {
- get {
- if (modCount != stack.modCount
- || current == -1
- || current > stack.count)
- throw new InvalidOperationException();
- return stack.contents[current];
- }
- }
-
- public virtual bool MoveNext() {
- if (modCount != stack.modCount
- || current == -1) {
- throw new InvalidOperationException();
- }
-
- current--;
-
- if (current == -1) {
- return false;
- } else {
- return true;
- }
- }
-
- public virtual void Reset() {
- if (modCount != stack.modCount) {
- throw new InvalidOperationException();
- }
-
- // start one ahead of stack.current, so the
- // first MoveNext() will put us at the top
- current = stack.current + 1;
- }
- }
-
- public virtual IEnumerator GetEnumerator() {
- return new Enumerator(this);
- }
-
- public virtual object Peek() {
- if (current == -1) {
- throw new InvalidOperationException();
- } else {
- return contents[current];
- }
- }
-
- public virtual object Pop() {
- if (current == -1) {
- throw new InvalidOperationException();
- } else {
- modCount++;
-
- object ret = contents[current];
-
- count--;
- current--;
-
- // if we're down to capacity/4, go back to a
- // lower array size. this should keep us from
- // sucking down huge amounts of memory when
- // putting large numbers of items in the Stack.
- // if we're lower than 16, don't bother, since
- // it will be more trouble than it's worth.
- if (count <= (capacity/4) && count > 16) {
- Resize(capacity/2);
- }
-
- return ret;
- }
- }
-
- public virtual void Push(Object o) {
- modCount++;
-
- if (capacity == count) {
- Resize(capacity * 2);
- }
-
- count++;
- current++;
-
- contents[current] = o;
- }
-
- public virtual object[] ToArray() {
- object[] ret = new object[count];
-
- Array.Copy(contents, ret, count);
-
- // ret needs to be in LIFO order
- Array.Reverse(ret);
-
- return ret;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs
deleted file mode 100644
index ffa152e6399..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHash.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-
-//
-// AssemblyHash.cs
-//
-// Implementation of the
-// System.Configuration.Assemblies.AssemblyHash
-// class for the Mono Class Library
-//
-// Author:
-// Tomas Restrepo (tomasr@mvps.org)
-//
-
-namespace System.Configuration.Assemblies {
-
- [Serializable]
- public struct AssemblyHash : System.ICloneable
- {
- private AssemblyHashAlgorithm _algorithm;
- private byte[] _value;
-
- public static readonly AssemblyHash Empty =
- new AssemblyHash(AssemblyHashAlgorithm.None,null);
-
-
- //
- // properties
- //
- public AssemblyHashAlgorithm Algorithm {
- get { return _algorithm; }
- set { _algorithm = value; }
- }
-
-
- //
- // construction
- //
- public AssemblyHash ( AssemblyHashAlgorithm algorithm, byte[] value )
- {
- _algorithm = algorithm;
- _value = null;
- if ( value != null )
- {
- int size = value.Length;
- _value = new byte[size];
- System.Array.Copy ( value, _value, size );
- }
- }
-
- public AssemblyHash ( byte[] value )
- : this(AssemblyHashAlgorithm.SHA1, value)
- {
- }
-
- public object Clone()
- {
- return new AssemblyHash(_algorithm,_value);
- }
-
- public byte[] GetValue()
- {
- return _value;
- }
- public void SetValue ( byte[] value )
- {
- _value = value;
- }
-
- } // class AssemblyHash
-
-} // namespace System.Configuration.Assemblies
-
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
deleted file mode 100644
index f144df7bf79..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// AssemblyHashAlgorithm.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:38:03 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Configuration.Assemblies {
-
-
- /// <summary>
- /// </summary>
- public enum AssemblyHashAlgorithm {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- MD5 = 32771,
-
- /// <summary>
- /// </summary>
- SHA1 = 32772,
- } // AssemblyHashAlgorithm
-
-} // System.Configuration.Assemblies
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs b/mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs
deleted file mode 100644
index 5e13d56fdf1..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/AssemblyVersionCompatibility.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// AssemblyVersionCompatibility.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:38:13 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Configuration.Assemblies {
-
-
- /// <summary>
- /// </summary>
- public enum AssemblyVersionCompatibility {
-
- /// <summary>
- /// </summary>
- SameMachine = 1,
-
- /// <summary>
- /// </summary>
- SameProcess = 2,
-
- /// <summary>
- /// </summary>
- SameDomain = 3,
- } // AssemblyVersionCompatibility
-
-} // System.Configuration.Assemblies
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/ChangeLog b/mcs/class/corlib/System.Configuration.Assemblies/ChangeLog
deleted file mode 100644
index d9e7f8ea889..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/ChangeLog
+++ /dev/null
@@ -1,6 +0,0 @@
-2001-07-13 Tomas Restrepo (tomasr@mvps.org)
-
- * AssemblyHash finished
- * AssemblyHashAlgorithm finished
- * AssemblyVersion finished
- \ No newline at end of file
diff --git a/mcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs b/mcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs
deleted file mode 100755
index 10cb2e9fe5d..00000000000
--- a/mcs/class/corlib/System.Configuration.Assemblies/ProcessorID.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// ProcessorID.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:38:23 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Configuration.Assemblies {
-
-
- /// <summary>
- /// </summary>
- public enum ProcessorID {
-
- /// <summary>
- /// </summary>
- INTEL_386 = 386,
-
- /// <summary>
- /// </summary>
- INTEL_486 = 486,
-
- /// <summary>
- /// </summary>
- INTEL_PENTIUM = 586,
-
- /// <summary>
- /// </summary>
- MIPS_R4000 = 4000,
-
- /// <summary>
- /// </summary>
- ALPHA_21064 = 21064,
-
- /// <summary>
- /// </summary>
- PPC_601 = 601,
-
- /// <summary>
- /// </summary>
- PPC_603 = 603,
-
- /// <summary>
- /// </summary>
- PPC_604 = 604,
-
- /// <summary>
- /// </summary>
- PPC_620 = 620,
-
- /// <summary>
- /// </summary>
- HITACHI_SH3 = 10003,
-
- /// <summary>
- /// </summary>
- HITACHI_SH3E = 10004,
-
- /// <summary>
- /// </summary>
- HITACHI_SH4 = 10005,
-
- /// <summary>
- /// </summary>
- MOTOROLA_821 = 821,
-
- /// <summary>
- /// </summary>
- SHx_SH3 = 103,
-
- /// <summary>
- /// </summary>
- SHx_SH4 = 104,
-
- /// <summary>
- /// </summary>
- STRONGARM = 2577,
-
- /// <summary>
- /// </summary>
- ARM720 = 1824,
-
- /// <summary>
- /// </summary>
- ARM820 = 2080,
-
- /// <summary>
- /// </summary>
- ARM920 = 2336,
-
- /// <summary>
- /// </summary>
- ARM_7TDMI = 70001,
- } // ProcessorID
-
-} // System.Configuration.Assemblies
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog b/mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog
deleted file mode 100644
index 4c57a305185..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ChangeLog
+++ /dev/null
@@ -1,29 +0,0 @@
-2002-03-20 Martin Baulig <martin@gnome.org>
-
- * SymbolToken.cs (GetToken): Implemented.
-
-2002-03-05 Duncan Mak <duncan@ximian.com>
-
- * ISymbolWriter.cs:
- (DefineParameter) corrected typo in argument type.
- (SetMethodSourceRange): Fixed typo in method name.
-
- * ISymbolDocument.cs:
- (CheckSumAlgorithmId) Fixed typo.
-
- * ISymbolNamespace.cs:
- (GetVariable) Added missing method.
-
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * SymDocumentType.cs:
- * SymLanguageType.cs:
- * SymLanguageVendor.cs: Added to CVS.
-
-2002-01-07 Duco Fijma <duco@lorentz.xs4all.nl>
- * Finilized SymAddressKind enum
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created SymAddressKind enum
- * Created all interfaces
- * Created dummy implementation for SymbolToken struct
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs
deleted file mode 100755
index ea1779ca15c..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolBinder.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolBinder
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolBinder {
-
- ISymbolReader GetReader (int importer, string filename, string searchPath);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs
deleted file mode 100755
index 4725e34db06..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocument.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolDocument
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolDocument {
-
- Guid CheckSumAlgorithmId {get; }
- Guid DocumentType {get; }
- bool HasEmbeddedSource {get; }
- Guid Language {get; }
- Guid LanguageVendor {get; }
- int SourceLength {get; }
- string URL {get; }
-
-
- int FindClosestLine (int line);
- byte[] GetCheckSum ();
- byte[] GetSourceRange (int startLine, int startColumn, int endLine, int endColumn);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs
deleted file mode 100755
index 855b1a5cefc..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolDocumentWriter {
-
- void SetCheckSum (Guid algorithmId, byte[] checkSum);
- void SetSource (byte[] source);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs
deleted file mode 100755
index 768ace15710..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolMethod.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolMethod
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolMethod {
-
- ISymbolScope RootScope {get; }
- int SequencePointCount {get; }
- SymbolToken Token {get; }
-
- ISymbolNamespace GetNamespace ();
- int GetOffset (ISymbolDocument document, int line, int column);
- ISymbolVariable[] GetParameters ();
- int[] GetRanges (ISymbolDocument document, int line, int column);
- ISymbolScope GetScope (int offset);
- void GetSequencePoints (
- int[] offsets,
- ISymbolDocument[] documents,
- int[] lines,
- int[] columns,
- int[] endLines,
- int[] endColumns);
- bool GetSourceStartEnd (
- ISymbolDocument[] docs,
- int[] lines,
- int[] columns);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs
deleted file mode 100755
index 394fecddc01..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolNamespace.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolNamespace
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolNamespace {
-
- string Name {get ;}
-
- ISymbolNamespace[] GetNamespaces ();
- ISymbolVariable[] GetVariables ();
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs
deleted file mode 100755
index ee04f2b64b1..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolReader.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolReader
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolReader {
-
- SymbolToken UserEntryPoint {get; }
-
- ISymbolDocument GetDocument (
- string url,
- Guid language,
- Guid languageVendor,
- Guid documentType);
- ISymbolDocument[] GetDocuments ();
- ISymbolVariable[] GetGlobalVariables ();
-
- ISymbolMethod GetMethod (SymbolToken method);
- ISymbolMethod GetMethod (SymbolToken method, int version);
-
- ISymbolMethod GetMethodFromDocumentPosition (
- ISymbolDocument document,
- int line,
- int column);
- ISymbolNamespace[] GetNamespaces ();
- byte[] GetSymAttribute (SymbolToken parent, string name);
- ISymbolVariable[] GetVariables (SymbolToken parent);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs
deleted file mode 100755
index 6c3179ba67a..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolScope.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolScope
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolScope {
-
- int EndOffset {get ;}
- ISymbolMethod Method {get; }
- ISymbolScope Parent {get ;}
- int StartOffset {get ;}
-
- ISymbolScope[] GetChildren ();
- ISymbolVariable[] GetLocals ();
- ISymbolNamespace[] GetNamespaces ();
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs
deleted file mode 100755
index 11d4ee5f25d..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolVariable.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolVariable
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolVariable {
-
- int AddressField1 {get; }
- int AddressField2 {get; }
- int AddressField3 {get; }
- SymAddressKind AddressKind {get ;}
- object Attributes {get ;}
- int EndOffset {get; }
- string Name {get; }
- int StartOffset {get; }
-
- byte[] GetSignature ();
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs
deleted file mode 100755
index ee347fbfbfa..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/ISymbolWriter.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.ISymbolWriter
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-using System.Reflection;
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public interface ISymbolWriter {
-
- void Close ();
- void CloseMethod ();
- void CloseNamespace ();
- void CloseScope (int endOffset);
- ISymbolDocumentWriter DefineDocument(
- string url,
- Guid language,
- Guid languageVendor,
- Guid documentType);
- void DefineField (
- SymbolToken parent,
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
- void DefineGlobalVariable (
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
- void DefineLocalVariable (
- string name,
- FieldAttributes attributes,
- byte[] signature,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3,
- int startOffset,
- int endOffset);
- void DefineParameter (
- string name,
- ParameterAttributes attributes,
- int sequence,
- SymAddressKind addrKind,
- int addr1,
- int addr2,
- int addr3);
- void DefineSequencePoints (
- ISymbolDocumentWriter document,
- int[] offsets,
- int[] lines,
- int[] columns,
- int[] endLines,
- int[] endColumns);
- void Initialize (IntPtr emitter, string filename, bool fFullBuild);
- void OpenMethod (SymbolToken method);
- void OpenNamespace (string name);
- int OpenScope (int startOffset);
- void SetMethodSourceRange (
- ISymbolDocumentWriter startDoc,
- int startLine,
- int startColumn,
- ISymbolDocumentWriter endDoc,
- int endLine,
- int endColumn);
- void SetScopeRange (int scopeID, int startOffset, int endOffset);
- void SetSymAttribute (SymbolToken parent, string name, byte[] data);
- void SetUnderlyingWriter (IntPtr underlyingWriter);
- void SetUserEntryPoint (SymbolToken entryMethod);
- void UsingNamespace (string fullName);
-
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs
deleted file mode 100755
index af3e5b32ef5..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymAddressKind.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymAddressKind
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public enum SymAddressKind {
- ILOffset = 1,
- NativeRVA = 2,
- NativeRegister = 3,
- NativeRegisterRelative = 4,
- NativeOffset = 5,
- NativeRegisterRegister = 6,
- NativeRegisterStack = 7,
- NativeStackRegister = 8,
- BitField = 9
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs
deleted file mode 100644
index 6bbabef32d6..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymDocumentType.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymDocumentType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics.SymbolStore
-{
- public class SymDocumentType
- {
- // Constructors
- public SymDocumentType ()
- {
- }
-
- // Fields
- public static readonly Guid Text;
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs
deleted file mode 100644
index 6dd232f081e..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageType.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymLanguageType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics.SymbolStore
-{
- public class SymLanguageType
- {
- // Constructors
- public SymLanguageType ()
- {
- }
-
- // Fields
- public static readonly Guid Basic;
- public static readonly Guid C;
- public static readonly Guid Cobol;
- public static readonly Guid CPlusPlus;
- public static readonly Guid CSharp;
- public static readonly Guid ILAssembly;
- public static readonly Guid Java;
- public static readonly Guid JScript;
- public static readonly Guid MCPlusPlus;
- public static readonly Guid Pascal;
- public static readonly Guid SMC;
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs
deleted file mode 100644
index a9b439eb3e5..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymLanguageVendor.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymLanguageVendor.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Diagnostics.SymbolStore
-{
- public class SymLanguageVendor
- {
- // Constructors
- public SymLanguageVendor ()
- {
- }
-
- // Fields
- public static readonly Guid Microsoft;
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs b/mcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs
deleted file mode 100755
index 7d355ac244e..00000000000
--- a/mcs/class/corlib/System.Diagnostics.SymbolStore/SymbolToken.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Diagnostics.SymbolStore.SymbolToken
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.Diagnostics.SymbolStore
-{
-
-public struct SymbolToken {
-
- private int _val;
-
- public SymbolToken (int val) { _val = val; }
-
- [MonoTODO]
- public override bool Equals (object obj) { return false; }
-
- [MonoTODO]
- public override int GetHashCode() { return 0; }
-
- public int GetToken() { return _val; }
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Diagnostics/ChangeLog b/mcs/class/corlib/System.Diagnostics/ChangeLog
deleted file mode 100644
index eb7ade24517..00000000000
--- a/mcs/class/corlib/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,67 +0,0 @@
-2002-06-19 Dietmar Maurer <dietmar@ximian.com>
-
- * StackTrace.cs: impl. remaining constructors.
-
-2002-06-18 Dietmar Maurer <dietmar@ximian.com>
-
- * StackTrace.cs: use new internal call for constructors, use MS like
- trace format.
-
- * StackFrame.cs: impl. constructors using a new internal call.
-
-2002-05-01 Duncan Mak <duncan@ximian.com>
-
- * DebuggableAttribute.cs: Added missing AttributeUsage attribute.
-
-2002-04-08 Jonathan Pryor <jonpryor@vt.edu>
-
- * Debugger.cs: Added [MonoTODO] attribute to methods; modified IsLogging()
- and Log() so that System.Diagnostics.DefaultTraceListener could use them
- without having NotImplementedException's thrown, as the functionality
- DefaultTraceListener is using is non-critical.
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * ConditionalAttribute.cs: Add AttributeUsage attribute for methods.
-
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * DebuggerStepThroughAttribute.cs:
- * DebuggerHiddenAttribte.cs: Add to CVS.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * StackFrame.cs : Use the MonoTODO attribute to mark
- incomplete code.
-
- StackTrace.cs : Ditto.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Moved TraceListener, TextWriterTraceListener, and
- DefaultTraceListener to System assembly....oops.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
-
- * Added TextWriterTraceListener.cs, TraceListener.cs, and
- DefaultTraceListener.cs to the build.
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
-
- * Added Debugger.cs to the build.
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * Moved BooleanSwitch, Switch, TraceLevel and TraceSwitch to the
- System assembly.
-
- * Added StackFrame.cs and StackTrace.cs to the build.
-
-2001-08-21 Nick Drochak <ndrochak@gol.com>
-
- * Implemented ConditionalAttribute.cs and DebuggableAttribute.cs
-
-2001-08-29 Alexander Klyubin <klyubin@aqris.com>
-
- * Skeletal implementation of StackFrame and StackTrace classes.
- The classes must be somehow connected to runtime environment in
- order to generate proper traces.
diff --git a/mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs b/mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs
deleted file mode 100644
index ea808ac500e..00000000000
--- a/mcs/class/corlib/System.Diagnostics/ConditionalAttribute.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Collections.DebuggableAttribute.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-namespace System.Diagnostics
-{
-
- [Serializable]
- [AttributeUsage(AttributeTargets.Method)]
- public sealed class ConditionalAttribute : System.Attribute
- {
-
- private string myCondition;
-
- // Public Instance Constructors
- public ConditionalAttribute(string conditionString)
- {
- myCondition = conditionString;
- }
-
- // Public Instance Properties
- public string ConditionString { get { return myCondition; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs
deleted file mode 100644
index 08ede85557c..00000000000
--- a/mcs/class/corlib/System.Diagnostics/DebuggableAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Collections.DebuggableAttribute.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-namespace System.Diagnostics {
-
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module)]
- public sealed class DebuggableAttribute : System.Attribute {
-
- private bool JITTrackingEnabledFlag;
- private bool JITOptimizerDisabledFlag;
-
- // Public Instance Constructors
- public DebuggableAttribute(bool isJITTrackingEnabled, bool isJITOptimizerDisabled) {
- JITTrackingEnabledFlag = isJITTrackingEnabled;
- JITOptimizerDisabledFlag = isJITOptimizerDisabled;
- }
-
- // Public Instance Properties
- public bool IsJITTrackingEnabled { get { return JITTrackingEnabledFlag; } }
-
- public bool IsJITOptimizerDisabled { get { return JITOptimizerDisabledFlag; } }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/Debugger.cs b/mcs/class/corlib/System.Diagnostics/Debugger.cs
deleted file mode 100644
index 8b5c6789799..00000000000
--- a/mcs/class/corlib/System.Diagnostics/Debugger.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// System.Diagnostics.Debugger.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-//
-using System;
-
-namespace System.Diagnostics
-{
- /// <summary>
- /// Enables communication with a debugger.
- /// </summary>
- [MonoTODO]
- public sealed class Debugger
- {
- private static bool isAttached;
-
- /// <summary>
- /// Represents the default category of a message with a constant.
- /// </summary>
- public static readonly string DefaultCategory = "";
-
- /// <summary>
- /// Returns a Boolean indicating whether a debugger is attached to a process.
- /// </summary>
- /// <value>
- /// true if debugger is attached; otherwise, false.
- /// </value>
- public static bool IsAttached
- {
- get
- {
- return isAttached;
- }
- }
-
- /// <summary>
- /// Causes a breakpoint to be signaled to an attached debugger.
- /// </summary>
- [MonoTODO]
- public static void Break()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Checks to see if logging is enabled by an attached debugger.
- /// </summary>
- [MonoTODO]
- public static bool IsLogging()
- {
- // Return false. DefaultTraceListener invokes this method, so throwing
- // a NotImplementedException wouldn't be appropriate.
- return false;
-
- }
-
- /// <summary>
- /// Launches and attaches a debugger to the process.
- /// </summary>
- [MonoTODO]
- public static bool Launch()
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Posts a message for the attached debugger.
- /// </summary>
- /// <param name="level">
- /// A description of the importance of this message
- /// </param>
- /// <param name="category">
- /// A string describing the category of this message.
- /// </param>
- /// <param name="message">
- /// A string representing the message to show.
- /// </param>
- [MonoTODO]
- public static void Log(int level, string category, string message)
- {
- // Do nothing. DefaultTraceListener invokes this method, so throwing
- // a NotImplementedException wouldn't be appropriate.
- }
-
- public Debugger()
- {
- isAttached = false;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs
deleted file mode 100644
index b57db27cb8b..00000000000
--- a/mcs/class/corlib/System.Diagnostics/DebuggerHiddenAttribute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Diagnostics.DebuggerHiddenAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Diagnostics
-{
- [AttributeUsage (AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Property)]
- [Serializable]
- public sealed class DebuggerHiddenAttribute : Attribute
- {
- public DebuggerHiddenAttribute ()
- : base ()
- {
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs b/mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs
deleted file mode 100644
index 27d81891a1d..00000000000
--- a/mcs/class/corlib/System.Diagnostics/DebuggerStepThroughAttribute.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Diagnostics.DebuggerStepThroughAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Diagnostics
-{
- [AttributeUsage (AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Property)]
- [Serializable]
- public sealed class DebuggerStepThroughAttribute : Attribute
- {
- public DebuggerStepThroughAttribute ()
- : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/StackFrame.cs b/mcs/class/corlib/System.Diagnostics/StackFrame.cs
deleted file mode 100644
index f27256fbde5..00000000000
--- a/mcs/class/corlib/System.Diagnostics/StackFrame.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-//
-// System.Diagnostics.StackFrame.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace System.Diagnostics {
- /// <summary>
- /// Stack frame.
- /// </summary>
-
- [Serializable]
- public class StackFrame {
- /// <value>
- /// Constant returned when the native or IL offset is unknown.
- /// </value>
- public const int OFFSET_UNKNOWN = -1;
-
- /// <value>
- /// Offset from the start of the IL code for the method
- /// being executed.
- /// </value>
- private int ilOffset = OFFSET_UNKNOWN;
-
- /// <value>
- /// Offset from the start of the native code for the method
- /// being executed.
- /// </value>
- private int nativeOffset = OFFSET_UNKNOWN;
-
- /// <value>
- /// Method associated with this stack frame.
- /// </value>
- private MethodBase methodBase;
-
- /// <value>
- /// File name.
- /// </value>
- private string fileName;
-
- /// <value>
- /// Line number.
- /// </value>
- private int lineNumber;
-
- /// <value>
- /// Column number.
- /// </value>
- private int columnNumber;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static bool get_frame_info (int skip, bool needFileInfo, out MethodBase method,
- out int iloffset, out int native_offset,
- out string file, out int line, out int column);
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- public StackFrame() {
- get_frame_info (2, false, out methodBase, out ilOffset,
- out nativeOffset, out fileName, out lineNumber,
- out columnNumber);
- }
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackFrame(bool needFileInfo) : this() {
- get_frame_info (2, needFileInfo, out methodBase, out ilOffset,
- out nativeOffset, out fileName, out lineNumber,
- out columnNumber);
- }
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to skip.
- /// </param>
- public StackFrame(int skipFrames) {
- get_frame_info (skipFrames + 2, false, out methodBase, out ilOffset,
- out nativeOffset, out fileName, out lineNumber,
- out columnNumber);
- }
-
- /// <summary>
- /// Initializes a new StackFrame object corresponding to the
- /// active stack frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to skip.
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackFrame(int skipFrames, bool needFileInfo) {
- get_frame_info (skipFrames + 2, needFileInfo, out methodBase, out ilOffset,
- out nativeOffset, out fileName, out lineNumber,
- out columnNumber);
- }
-
- /// <summary>
- /// Constructs a fake stack frame that just contains the
- /// given file name and line number. Use this constructor
- /// when you do not want to use the debugger's line mapping
- /// logic.
- /// </summary>
- /// <param name="fileName">
- /// The given file name.
- /// </param>
- /// <param name="lineNumber">
- /// The line number in the specified file.
- /// </param>
- public StackFrame(string fileName, int lineNumber)
- : this (fileName, lineNumber, 0) {}
-
- /// <summary>
- /// Constructs a fake stack frame that just contains the
- /// given file name and line number. Use this constructor
- /// when you do not want to use the debugger's line mapping
- /// logic.
- /// </summary>
- /// <param name="fileName">
- /// The given file name.
- /// </param>
- /// <param name="lineNumber">
- /// The line number in the specified file.
- /// </param>
- /// <param name="colNumber">
- /// The column number in the specified file.
- /// </param>
- public StackFrame(string fileName,
- int lineNumber,
- int colNumber) {
- this.methodBase = null;
- this.fileName = fileName;
- this.lineNumber = lineNumber;
- this.columnNumber = colNumber;
- }
-
-
- /// <summary>
- /// Gets the line number in the file containing the code
- /// being executed. This information is typically extracted
- /// from the debugging symbols for the executable.
- /// </summary>
- /// <returns>
- /// The file line number or zero if it cannot be determined.
- /// </returns>
- public virtual int GetFileLineNumber()
- {
- return lineNumber;
- }
-
- /// <summary>
- /// Gets the column number in the file containing the code
- /// being executed. This information is typically extracted
- /// from the debugging symbols for the executable.
- /// </summary>
- /// <returns>
- /// The file column number or zero if it cannot be determined.
- /// </returns>
- public virtual int GetFileColumnNumber()
- {
- return columnNumber;
- }
-
- /// <summary>
- /// Gets the file name containing the code being executed.
- /// This information is typically extracted from the
- /// debugging symbols for the executable.
- /// </summary>
- /// <returns>
- /// The file name or null if it cannot be determined.
- /// </returns>
- public virtual string GetFileName()
- {
- return fileName;
- }
-
- /// <summary>
- /// Gets the offset from the start of the IL code for the
- /// method being executed. This offset may be approximate
- /// depending on whether the JIT compiler is generating
- /// debugging code or not.
- /// </summary>
- /// <returns>
- /// The offset from the start of the IL code for the method
- /// being executed.
- /// </returns>
- public virtual int GetILOffset()
- {
- return ilOffset;
- }
-
- /// <summary>
- /// Gets the method in which the frame is executing.
- /// </summary>
- /// <returns>
- /// The method the frame is executing in.
- /// </returns>
- public virtual MethodBase GetMethod()
- {
- return methodBase;
- }
-
- /// <summary>
- /// Gets the offset from the start of the native
- /// (JIT-compiled) code for the method being executed.
- /// </summary>
- /// <returns>
- /// The offset from the start of the native (JIT-compiled)
- /// code or the method being executed.
- /// </returns>
- public virtual int GetNativeOffset()
- {
- return nativeOffset;
- }
-
- /// <summary>
- /// Builds a readable representation of the stack frame.
- /// </summary>
- /// <returns>
- /// A readable representation of the stack frame.
- /// </returns>
- public override string ToString() {
- string methodNameString =
- (GetMethod() == null)
- ? "<unknown method>"
- : GetMethod().Name;
- string offsetString =
- (GetILOffset() == OFFSET_UNKNOWN)
- ? "<unknown offset>"
- : "offset " + GetILOffset();
- string fileNameString =
- (GetFileName() == null)
- ? "<filename unknown>" : GetFileName();
- return methodNameString + " at " + offsetString
- + " in file:line:column " + fileNameString
- + ":" + GetFileLineNumber()
- + ":" + GetFileColumnNumber();
- }
-
- public override bool Equals(Object obj) {
- if ((obj == null) || (!(obj is StackFrame))) {
- return false;
- }
-
- StackFrame rhs = (StackFrame) obj;
-
- if (!ObjectsEqual(GetMethod(), rhs.GetMethod())) {
- return false;
- }
-
- if (!ObjectsEqual(GetFileName(), rhs.GetFileName())) {
- return false;
- }
-
- if (GetFileLineNumber() != rhs.GetFileLineNumber()) {
- return false;
- }
-
- if (GetFileColumnNumber() != rhs.GetFileColumnNumber()) {
- return false;
- }
-
- if (GetILOffset() != rhs.GetILOffset()) {
- return false;
- }
-
- if (GetNativeOffset() != rhs.GetNativeOffset()) {
- return false;
- }
-
- return true;
-
- }
-
- public override int GetHashCode() {
- return GetFileLineNumber();
- }
-
- /// <summary>
- /// Checks whether two objects are equal.
- /// The objects are assumed equal if and only if either
- /// both of the references are <code>null</code> or they
- /// equal via <code>Equals</code> method.
- /// </summary>
- /// <param name="obj1">
- /// First object.
- /// </param>
- /// <param name="obj2">
- /// Second object.
- /// </param>
- /// <returns>
- /// <code>true</code> if the two objects are equal,
- /// </code>false</code> otherwise.
- /// </returns>
- private static bool ObjectsEqual(Object obj1, Object obj2) {
- if (obj1 == null) {
- return (obj2 == null);
- } else {
- return obj1.Equals(obj2);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Diagnostics/StackTrace.cs b/mcs/class/corlib/System.Diagnostics/StackTrace.cs
deleted file mode 100644
index c8ac9ca51bd..00000000000
--- a/mcs/class/corlib/System.Diagnostics/StackTrace.cs
+++ /dev/null
@@ -1,281 +0,0 @@
-//
-// System.Diagnostics.StackTrace.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Reflection;
-using System.Threading;
-using System.Runtime.CompilerServices;
-using System.Collections;
-
-namespace System.Diagnostics {
- /// <summary>
- /// Stack trace.
- /// TODO: more information.
- /// </summary>
- [Serializable]
- public class StackTrace {
- /// <value>
- /// Uses a constant to define the number of methods that are
- /// to be omitted from the stack trace.
- /// </value>
- public const int METHODS_TO_SKIP = 0;
-
- /// <value>
- /// Frames. First frame is the last stack frame pushed.
- /// </value>
- private StackFrame[] frames;
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- [MonoTODO]
- public StackTrace() {
- init_frames (METHODS_TO_SKIP, false);
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(bool needFileInfo) {
- init_frames (METHODS_TO_SKIP, needFileInfo);
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class
- /// from the current location, in a caller's frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- public StackTrace(int skipFrames) {
- init_frames (skipFrames, false);
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class
- /// from the current location, in a caller's frame.
- /// </summary>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(int skipFrames, bool needFileInfo) {
- init_frames (skipFrames, needFileInfo);
- }
-
- void init_frames (int skipFrames, bool needFileInfo)
- {
- StackFrame sf;
- ArrayList al = new ArrayList ();
-
- skipFrames += 2;
-
- while ((sf = new StackFrame (skipFrames, needFileInfo)) != null &&
- sf.GetMethod () != null) {
-
- al.Add (sf);
- skipFrames++;
- };
-
- frames = (StackFrame [])al.ToArray (typeof (StackFrame));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static StackFrame [] get_trace (Exception e, int skipFrames, bool needFileInfo);
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- /// <param name="e">
- /// TODO:
- /// </param>
- public StackTrace(Exception e) {
- frames = get_trace (e, METHODS_TO_SKIP, false);
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class,
- /// using the provided exception object. The resulting stack
- /// trace describes the stack at the time of the exception.
- /// </summary>
- /// <param name="e">
- /// TODO:
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(Exception e, bool needFileInfo) {
- frames = get_trace (e, METHODS_TO_SKIP, needFileInfo);
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class,
- /// using the provided exception object. The resulting stack
- /// trace describes the stack at the time of the exception.
- /// </summary>
- /// <param name="e">
- /// Exception.
- /// </param>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- public StackTrace(Exception e, int skipFrames) {
- frames = get_trace (e, skipFrames, false);
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class,
- /// using the provided exception object. The resulting stack
- /// trace describes the stack at the time of the exception.
- /// </summary>
- /// <param name="e">
- /// Exception.
- /// </param>
- /// <param name="skipFrames">
- /// The number of frames up the stack to start the trace
- /// from.
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- public StackTrace(Exception e, int skipFrames, bool needFileInfo) {
- frames = get_trace (e, skipFrames, needFileInfo);
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class
- /// containing a single frame.
- /// </summary>
- /// <param name="frame">
- /// The frame that the StackTrace object should contain.
- /// </param>
- public StackTrace(StackFrame frame) {
- this.frames = new StackFrame[1];
- this.frames[0] = frame;
- }
-
- /// <summary>
- /// Initializes a new instance of the StackTrace class.
- /// </summary>
- /// <param name="targetThread">
- /// TODO:
- /// </param>
- /// <param name="needFileInfo">
- /// TODO:
- /// </param>
- [MonoTODO]
- public StackTrace(Thread targetThread, bool needFileInfo) {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Holds the number of frames in the stack trace.
- /// </summary>
- public virtual int FrameCount {
- get {
- return (frames == null) ? 0 : frames.Length;
- }
- }
-
- /// <summary>
- /// Gets the specified stack frame.
- /// </summary>
- /// <param name="index">
- /// The index of the stack frame requested.
- /// </param>
- /// <returns>
- /// The specified stack frame. Returns <code>null</code> if
- /// frame with specified index does not exist in this stack
- /// trace.
- /// </returns>
- /// <remarks>
- /// Stack frames are numbered starting at zero, which is the
- /// last stack frame pushed.
- /// </remarks>
- public virtual StackFrame GetFrame(int index) {
- if ((index < 0) || (index >= FrameCount)) {
- return null;
- }
-
- return frames[index];
- }
-
- /// <summary>
- /// Builds a readable representation of the stack trace.
- /// </summary>
- /// <returns>
- /// A readable representation of the stack trace.
- /// </returns>
- public override string ToString() {
- string result = "";
- for (int i = 0; i < FrameCount; i++) {
- StackFrame frame = GetFrame(i);
- result += "\n\tat " + FrameToString(frame);
- }
-
- return result;
- }
-
- public override bool Equals(Object obj) {
- if ((obj == null) || (!(obj is StackTrace))) {
- return false;
- }
-
- StackTrace rhs = (StackTrace) obj;
-
- if (FrameCount != rhs.FrameCount) {
- return false;
- }
-
- for (int i = 0; i < FrameCount; i++) {
- if (!GetFrame(i).Equals(rhs.GetFrame(i))) {
- return false;
- }
- }
-
- return true;
- }
-
- public override int GetHashCode() {
- return FrameCount;
- }
-
- /// <summary>
- /// Converts single stack frame to string to be used in
- /// ToString method.
- /// </summary>
- /// <param name="frame">
- /// Frame to convert.
- /// </param>
- /// <returns>
- /// A readable representation of stack frame for using
- /// ToString.
- /// </returns>
- private static String FrameToString(StackFrame frame) {
- MethodBase method = frame.GetMethod();
- if (method != null) {
- // Method information available
- return method.DeclaringType.FullName
- + "." + method.Name + "()";
- } else {
- // Method information not available
- return "<unknown method>";
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/Calendar.cs b/mcs/class/corlib/System.Globalization/Calendar.cs
deleted file mode 100644
index 8b36614dd27..00000000000
--- a/mcs/class/corlib/System.Globalization/Calendar.cs
+++ /dev/null
@@ -1,917 +0,0 @@
-// Calendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-using System.IO;
-
-/// <remarks>
-/// The class serves as a base class for calendar classes.
-/// </remarks>
-[Serializable]
-public abstract class Calendar {
- /// <value>An protected integer property that gives the number of
- /// days in a week. It might be overridden.</value>
- internal virtual int M_DaysInWeek
- {
- get { return 7; }
- }
-
- /// <summary>
- /// The protected method creates the string used in the
- /// <see cref="T:System.ArgumentOutOfRangeException"/>
- /// </summary>
- /// <param name="a">An object that represents the smallest
- /// allowable value.</param>
- /// <param name="b">An object that represents the greatest allowable
- /// value.</param>
- /// <returns>The string used in the
- /// <see cref="T:System.ArgumentOutOfRangeException"/>
- /// </returns>
- internal string M_ValidValues(object a, object b)
- {
- StringWriter sw = new StringWriter();
- sw.Write("Valid values are between {0} and {1}, inclusive.",
- a, b);
- return sw.ToString();
- }
-
- /// <summary>
- /// The protected method checks wether the parameter
- /// <paramref name="arg"/> is in the allowed range.
- /// </summary>
- /// <param name="param">A string that gives the name of the
- /// parameter to check.</param>
- /// <param name="arg">An integer that gives the value to check.
- /// </param>
- /// <param name="a">An integer that represents the smallest allowed
- /// value.</param>
- /// <param name="b">An integer that represents the greatest allowed
- /// value.</param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the <paramref name="arg"/> is outside
- /// the allowed range.
- /// </exception>
- internal void M_ArgumentInRange(string param, int arg, int a, int b)
- {
- if (a <= arg && arg <= b)
- return;
- throw new ArgumentOutOfRangeException(param, M_ValidValues(a, b));
- }
-
- /// <summary>
- /// The protected method, that checks whether
- /// <paramref name="hour"/>, <paramref name="minute"/>,
- /// <paramref name="second"/>, and <parameref name="millisecond"/>
- /// are in their valid ranges
- /// </summary>
- /// <param name="hour">An integer that represents a hour,
- /// should be between 0 and 23.</param>
- /// <param name="minute">An integer that represents a minute,
- /// should be between 0 and 59.</param>
- /// <param name="second">An integer that represents a second,
- /// should be between 0 and 59.</param>
- /// <param name="milliseconds">An integer that represents a number
- /// of milliseconds, should be between 0 and 999999.</param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The Exception is thrown, if one of the parameter is outside the
- /// allowed the range.
- /// </exception>
- internal void M_CheckHMSM(int hour, int minute, int second,
- int milliseconds)
- {
- M_ArgumentInRange("hour", hour, 0, 23);
- M_ArgumentInRange("minute", minute, 0, 59);
- M_ArgumentInRange("second", second, 0, 59);
- M_ArgumentInRange("milliseconds", milliseconds, 0, 999999);
- }
-
- /// <value>
- /// A represantation of the CurrentEra.
- /// </value>
- public const int CurrentEra = 0;
-
- /// <value>When overridden gives the eras supported by the
- /// calendar as an array of integers.
- /// </value>
- public abstract int[] Eras { get; }
-
- /// <summary>
- /// The protected member stores the value for the
- /// <see cref="P:TwoDigitYearMax"/>
- /// property.
- /// </summary>
- internal int M_TwoDigitYearMax;
-
-
- /// <summary>
- /// Private field containing the maximum year for the calendar.
- /// </summary>
- private int M_MaxYearValue = 0;
-
- /// <value>
- /// Get-only property returing the maximum allowed year for this
- /// class.
- /// </value>
- internal virtual int M_MaxYear {
- get {
- if (M_MaxYearValue == 0) {
- M_MaxYearValue = GetYear(DateTime.MaxValue);
- }
- return M_MaxYearValue;
- }
- }
-
- /// <summary>
- /// Checks whether the year is the era is valid, if era = CurrentEra
- /// the right value is set.
- /// </summary>
- /// <param name="year">The year to check.</param>
- /// <param name="era">The era to check.</Param>
- /// <exception cref="T:ArgumentOutOfRangeException">
- /// The exception will be thrown, if the year is not valid.
- /// </exception>
- internal abstract void M_CheckYE(int year, ref int era);
-
- /// <value>
- /// <para>The property gives the maximum value for years with two
- /// digits. If the property has the value 2029, than the two-digit
- /// integer 29 results in the year 2029 and 30 in the
- /// year 1930.</para>
- /// <para>It might be overridden.</para>
- /// </value>
- public virtual int TwoDigitYearMax {
- get { return M_TwoDigitYearMax; }
- set {
- M_ArgumentInRange("year", value, 100, M_MaxYear);
- int era = CurrentEra;
- M_CheckYE(value, ref era);
- M_TwoDigitYearMax = value;
- }
- }
-
- /// <summary>
- /// The virtual method adds days to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// days.
- /// </param>
- /// <param name="days">The number of days to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="days"/> to the specified
- /// DateTime.</returns>
- public virtual DateTime AddDays(DateTime time, int days) {
- return time.Add(TimeSpan.FromDays(days));
- }
-
- /// <summary>
- /// The virtual method adds hours to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// hours.
- /// </param>
- /// <param name="hours">The number of hours to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="hours"/> to the specified
- /// DateTime.</returns>
- public virtual DateTime AddHours(DateTime time, int hours) {
- return time.Add(TimeSpan.FromHours(hours));
- }
-
- /// <summary>
- /// The virtual method adds milliseconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// milliseconds.
- /// </param>
- /// <param name="milliseconds">The number of milliseconds given as
- /// double to add. Keep in mind the 100 nanosecond resolution of
- /// <see cref="T:System.DateTime"/>.
- /// </param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="milliseconds"/> to the specified
- /// DateTime.</returns>
- public virtual DateTime AddMilliseconds(DateTime time,
- double milliseconds)
- {
- return time.Add(TimeSpan.FromMilliseconds(milliseconds));
- }
-
- /// <summary>
- /// The virtual method adds minutes to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// minutes.
- /// </param>
- /// <param name="minutes">The number of minutes to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="minutes"/> to the specified
- /// DateTime.</returns>
- public virtual DateTime AddMinutes(DateTime time, int minutes) {
- return time.Add(TimeSpan.FromMinutes(minutes));
- }
-
- /// <summary>
- /// When overrideden adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- public abstract DateTime AddMonths(DateTime time, int months);
-
- /// <summary>
- /// The virtual method adds seconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// seconds.
- /// </param>
- /// <param name="seconds">The number of seconds to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="seconds"/> to the specified
- /// DateTime.</returns>
- public virtual DateTime AddSeconds(DateTime time, int seconds) {
- return time.Add(TimeSpan.FromSeconds(seconds));
- }
-
- /// <summary>
- /// A wirtual method that adds weeks to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// weeks.
- /// </param>
- /// <param name="weeks">The number of weeks to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="weeks"/> to the specified
- /// DateTime.</returns>
- public virtual DateTime AddWeeks(DateTime time, int weeks) {
- return time.AddDays(weeks * M_DaysInWeek);
- }
-
- /// <summary>
- /// When overrideden adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- public abstract DateTime AddYears(DateTime time, int years);
-
- /// <summary>
- /// When overriden gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public abstract int GetDayOfMonth(DateTime time);
-
- /// <summary>
- /// When overriden gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public abstract DayOfWeek GetDayOfWeek(DateTime time);
-
- /// <summary>
- /// When overridden gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- public abstract int GetDayOfYear(DateTime time);
-
- /// <summary>
- /// A virtual method that gives the number of days of the specified
- /// month of the <paramref name="year"/> and the
- /// <see cref="P:CurrentEra"/>.
- /// </summary>
- /// <param name="year">An integer that gives the year in the current
- /// era.</param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/> or
- /// <paramref name="year"/> is outside the allowed range.
- /// </exception>
- public virtual int GetDaysInMonth(int year, int month) {
- return GetDaysInMonth(year, month, CurrentEra);
- }
-
- /// <summary>
- /// When overridden gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An intger that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public abstract int GetDaysInMonth(int year, int month, int era);
-
- /// <summary>
- /// A virtual method that gives the number of days of the specified
- /// year of the <see cref="P:CurrentEra"/>.
- /// </summary>
- /// <param name="year">An integer that gives the year in the current
- /// era.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if
- /// <paramref name="year"/> is outside the allowed range.
- /// </exception>
- public virtual int GetDaysInYear(int year) {
- return GetDaysInYear(year, CurrentEra);
- }
-
- /// <summary>
- /// When overridden gives the number of days of the specified
- /// year of the given era..
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> is outside the allowed range.
- /// </exception>
- public abstract int GetDaysInYear(int year, int era);
-
- /// <summary>
- /// When overridden gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- public abstract int GetEra(DateTime time);
-
- /// <summary>
- /// Virtual method that gives the hour of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the hour of the specified time,
- /// starting with 0.</returns>
- public virtual int GetHour(DateTime time) {
- return time.TimeOfDay.Hours;
- }
-
- /// <summary>
- /// Virtual method that gives the milliseconds in the current second
- /// of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the milliseconds in the seconds
- /// of the specified time, starting with 0.</returns>
- public virtual double GetMilliseconds(DateTime time) {
- return time.TimeOfDay.Milliseconds;
- }
-
- /// <summary>
- /// Virtual method that gives the minute of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the minute of the specified time,
- /// starting with 0.</returns>
- public virtual int GetMinute(DateTime time) {
- return time.TimeOfDay.Minutes;
- }
-
- /// <summary>
- /// When overridden gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- public abstract int GetMonth(DateTime time);
-
- /// <summary>
- /// Virtual method that gives the number of months of the specified
- /// year of the <see cref="M:CurrentEra"/>.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// current era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year is not allowed in the
- /// current era.
- /// </exception>
- public virtual int GetMonthsInYear(int year) {
- return GetMonthsInYear(year, CurrentEra);
- }
-
- /// <summary>
- /// When overridden gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public abstract int GetMonthsInYear(int year, int era);
-
- /// <summary>
- /// Virtual method that gives the second of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the second of the specified time,
- /// starting with 0.</returns>
- public virtual int GetSecond(DateTime time) {
- return time.TimeOfDay.Seconds;
- }
-
- /// <summary>
- /// A protected method to calculate the number of days between two
- /// dates.
- /// </summary>
- /// <param name="timeA">A <see cref="T:System.DateTime"/>
- /// representing the first date.
- /// </param>
- /// <param name="timeB">A <see cref="T:System.DateTime"/>
- /// representing the second date.
- /// </param>
- /// <returns>An integer that represents the difference of days
- /// between <paramref name="timeA"/> and <paramref name="timeB"/>.
- /// </returns>
- internal int M_DiffDays(DateTime timeA, DateTime timeB) {
- long diff = timeA.Ticks - timeB.Ticks;
-
- if (diff >= 0) {
- return (int)(diff/TimeSpan.TicksPerDay);
- }
-
- diff += 1;
- return -1 + (int)(diff/TimeSpan.TicksPerDay);
- }
-
- /// <summary>
- /// A protected method that gives the first day of the second week of
- /// the year.
- /// </summary>
- /// <param name="year">An integer that represents the year.</param>
- /// <param name="rule">The
- /// <see cref="T:System.Globalization.CalendarWeekRule"/>
- /// to be used for the calculation.
- /// </param>
- /// <param name="firstDayOfWeek">
- /// The <see cref="T:System.Globalization.DayOfWeek"/>
- /// specifying the first day in a week.
- /// </param>
- /// <returns>The <see cref="T:System.DateTime"/> representing
- /// the first day of the second week of the year.
- /// </returns>
- internal DateTime M_GetFirstDayOfSecondWeekOfYear(
- int year, CalendarWeekRule rule, DayOfWeek firstDayOfWeek)
- {
- DateTime d1 = ToDateTime(year, 1, 1, 0, 0, 0, 0);
- int dow1 = (int)GetDayOfWeek(d1);
- int fdow = (int)firstDayOfWeek;
- int d = 0;
-
- switch (rule) {
- case CalendarWeekRule.FirstDay:
- if (fdow > dow1) {
- d += fdow - dow1;
- }
- else {
- d += fdow + M_DaysInWeek - dow1;
- }
- break;
- case CalendarWeekRule.FirstFullWeek:
- d = M_DaysInWeek;
- if (fdow >= dow1) {
- d += fdow - dow1;
- }
- else {
- d += fdow + M_DaysInWeek - dow1;
- }
- break;
- case CalendarWeekRule.FirstFourDayWeek:
- int dow4 = (dow1 + 3)%M_DaysInWeek;
-
- d = 3;
- if (fdow > dow4) {
- d += fdow - dow4;
- }
- else {
- d += fdow + M_DaysInWeek - dow4;
- }
- break;
- }
-
- return AddDays(d1, d);
- }
-
- /// <summary>
- /// A virtual method that gives the number of the week in the year.
- /// </summary>
- /// <param name="time">A
- /// <see cref="T:System.DateTime"/> representing the date.
- /// </param>
- /// <param name="rule">The
- /// <see cref="T:System.Globalization.CalendarWeekRule"/>
- /// to be used for the calculation.
- /// </param>
- /// <param name="firstDayOfWeek">
- /// The <see cref="T:System.Globalization.DayOfWeek"/>
- /// specifying the first day in a week.
- /// </param>
- /// <returns>An integer representing the number of the week in the
- /// year, starting with 1.
- /// </returns>
- public virtual int GetWeekOfYear(DateTime time,
- CalendarWeekRule rule,
- DayOfWeek firstDayOfWeek)
- {
- if (firstDayOfWeek < DayOfWeek.Sunday ||
- DayOfWeek.Saturday < firstDayOfWeek)
- {
- throw new ArgumentOutOfRangeException("firstDayOfWeek",
- "Value is not a valid day of week.");
- }
- int year = GetYear(time);
-
- int days;
-
- while (true) {
- DateTime secondWeek = M_GetFirstDayOfSecondWeekOfYear(
- year, rule, firstDayOfWeek);
- days = M_DiffDays(time, secondWeek) + M_DaysInWeek;
- if (days >= 0)
- break;
- year -= 1;
- }
-
- return 1 + days/M_DaysInWeek;
- }
-
- /// <summary>
- /// When overridden gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- public abstract int GetYear(DateTime time);
-
- /// <summary>
- /// A virtual method that tells whether the given day in the
- /// <see cref="M:CurrentEra"/> is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// current era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month or day is not valid
- /// the current era.
- /// </exception>
- public virtual bool IsLeapDay(int year, int month, int day) {
- return IsLeapDay(year, month, day, CurrentEra);
- }
-
- /// <summary>
- /// Tells when overridden whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public abstract bool IsLeapDay(int year, int month, int day, int era);
-
- /// <summary>
- /// A virtual method that tells whether the given month of the
- /// specified year in the
- /// <see cref="M:CurrentEra"/> is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// current era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or month is not valid
- /// the current era.
- /// </exception>
- public virtual bool IsLeapMonth(int year, int month) {
- return IsLeapMonth(year, month, CurrentEra);
- }
-
- /// <summary>
- /// Tells when overridden whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public abstract bool IsLeapMonth(int year, int month, int era);
-
- /// <summary>
- /// A virtual method that tells whether the given year
- /// in the
- /// <see cref="M:CurrentEra"/> is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// current era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year is not valid
- /// the current era.
- /// </exception>
- public virtual bool IsLeapYear(int year) {
- return IsLeapYear(year, CurrentEra);
- }
-
- /// <summary>
- /// Tells when overridden whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public abstract bool IsLeapYear(int year, int era);
-
- /// <summary>
- /// A virtual method that creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <see cref="M:CurrentEra"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public virtual DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds)
- {
- return ToDateTime(year, month, day, hour, minute, second,
- milliseconds, CurrentEra);
- }
-
-
- /// <summary>
- /// When overridden creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public abstract DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era);
-
- /// <summary>
- /// A virtual method that converts a two-digit year to a four-digit
- /// year. It uses the <see cref="M:TwoDigitYearMax"/> property.
- /// </summary>
- /// <param name="year">An integer that gives the two-digit year.
- /// </param>
- /// <returns>An integer giving the four digit year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the year is negative or the resulting
- /// year is invalid.
- /// </exception>
- public virtual int ToFourDigitYear(int year) {
- if (year < 0)
- throw new ArgumentOutOfRangeException(
- "year", "Non-negative number required.");
- /* seems not to be the right thing to do, but .NET is
- * doing it this way.
- */
- if (year <= 99) {
- int year2 = TwoDigitYearMax%100;
- int d = year - year2;
- year = TwoDigitYearMax + d + (d <= 0 ? 0 : -100);
- }
- int era = CurrentEra;
- M_CheckYE(year, ref era);
- return year;
- }
-
- // TwoDigitYearMax: Windows reads it from the Registry, we
- // should have an XML file with the defaults
- /// <summary>
- /// The default constructor, is sets the TwoDigitYearMax to 2029.
- /// </summary>
- /// <remarks>
- /// The .NET framework reads the value from the registry.
- /// We should implement it here. Currently I set the default values
- /// in the ctors of the derived classes, if it is 99.
- /// </remarks>
- protected Calendar() {
- M_TwoDigitYearMax = 99;
- }
-
- /// <summary>Protected field storing the abbreviated era names.
- /// </summary>
- internal string[] M_AbbrEraNames;
- /// <summary>Protected field storing the era names.
- /// </summary>
- internal string[] M_EraNames;
-
- /// <value>
- /// The property stores the era names. It might be overwritten by
- /// CultureInfo.
- /// </value>
- internal string[] AbbreviatedEraNames {
- get {
- if (M_AbbrEraNames == null ||
- M_AbbrEraNames.Length != Eras.Length)
- throw new Exception(
- "Internal: M_AbbrEraNames " +
- "wrong initialized!");
- return (string[])M_AbbrEraNames.Clone();
- }
- set {
- if (value.Length != Eras.Length) {
- StringWriter sw = new StringWriter();
- sw.Write("Array length must be equal Eras " +
- "length {0}.", Eras.Length);
- throw new ArgumentException(
- sw.ToString());
- }
- M_AbbrEraNames = (string[])value.Clone();
- }
- }
-
- /// <value>
- /// The property stores the era names. It might be overwritten by
- /// CultureInfo.
- /// </value>
- internal string[] EraNames {
- get {
- if (M_EraNames == null ||
- M_EraNames.Length != Eras.Length)
- throw new Exception(
- "Internal: M_EraNames " +
- "not initialized!");
- return (string[])M_EraNames.Clone();
- }
- set {
- if (value.Length != Eras.Length) {
- StringWriter sw = new StringWriter();
- sw.Write("Array length must be equal Eras " +
- "length {0}.", Eras.Length);
- throw new ArgumentException(
- sw.ToString());
- }
- M_EraNames = (string[])value.Clone();
- }
- }
-} // class Calendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs b/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs
deleted file mode 100644
index 936a56e8469..00000000000
--- a/mcs/class/corlib/System.Globalization/CalendarWeekRule.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// ::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
-
-using System;
-
-namespace System.Globalization
-{
- /// <summary>
- /// The System.Globalization.CalendarWeekRule enumeration
- /// </summary>
- public enum CalendarWeekRule
- {
- FirstDay = 0,
- FirstFullWeek = 1,
- FirstFourDayWeek = 2
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Globalization/CalendricalCalculations.cs b/mcs/class/corlib/System.Globalization/CalendricalCalculations.cs
deleted file mode 100644
index 3f493f2cc2e..00000000000
--- a/mcs/class/corlib/System.Globalization/CalendricalCalculations.cs
+++ /dev/null
@@ -1,2120 +0,0 @@
-// CalendricalCalculations.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System.Collections;
-
-/// <summary>A class that provides mathematical functions.</summary>
-/// <remarks>
-/// <para>
-/// We are breaking the .Net
-/// naming conventions to be compatible to the "Calendrical Calculations"
-/// bool.
-/// </para>
-/// </remarks>
-internal class CCMath {
- /// <summary>
- /// A static method which rounds a double value.
- /// </summary>
- /// <param name="x">The double value to round.</param>
- /// <returns>The rounded double.</returns>
- public static double round(double x) {
- return System.Math.Floor(x+0.5);
- }
-
- /// <summary>
- /// A static method that computes the remainder of the division
- /// of two doubles.
- /// </summary>
- /// <param name="x">The double value which is divided.</param>
- /// <param name="y">The divisor.</param>
- /// <returns>The remainder as double value.</returns>
- public static double mod(double x, double y) {
- return x - y * System.Math.Floor(x/y);
- }
-
- /// <summary>
- /// The static method divides two integers.
- /// </summary>
- /// <param name="x">The integer x value.</param>
- /// <param name="y">The integer y value.</param>
- /// <returns>The qotient of x and y defined by floor(x/y).
- /// </returns>
- /// <remarks>
- /// Please notify that the function is not compatible to the standard
- /// integer divide operation /.
- /// </remarks>
- public static int div(int x, int y) {
- return (int)System.Math.Floor((double)x/(double)y);
- }
-
- /// <summary>
- /// The static method computes the remainder of two integers.
- /// </summary>
- /// <param name="x">The integer value which will be divided.</param>
- /// <param name="y">The divisor integer value.</param>
- /// <returns> The remainder as integer value.</returns>
- /// <remarks>
- /// Please notify that the method is not compatible to the C#
- /// remainder operation %.
- /// </remarks>
- public static int mod(int x, int y) {
- return x - y * div(x, y);
- }
-
- /// <summary>
- /// A static method that combines integer division and remainder
- /// computation.
- /// </summary>
- /// <param name="remainder">Remainder integer output value.
- /// </param>
- /// <param name="x">Integer to be divided.</param>
- /// <param name="y">Divisor integer value.</param>
- /// <returns>The quotient as integer.</returns>
- /// <seealso cref="M:div"/>
- /// <seealso cref="M:mod"/>
- public static int div_mod(out int remainder, int x, int y) {
- int d = div(x, y);
- remainder = x - y * d;
- return d;
- }
-
- /// <summary>
- /// A static method returning the sign of the argument.
- /// </summary>
- /// <param name="x">The double argument.</param>
- /// <returns>An integer value: -1 for a negative argument;
- /// 0 for a zero argument, and 1 for a positive argument.
- /// </returns>
- public static int signum(double x) {
- if (x < 0.0)
- return -1;
- if (x == 0.0)
- return 0;
- return 1;
- }
-
- /// <summary>
- /// A static method returning the sign of the integer
- /// argument.
- /// </summary>
- /// <param name="x">The integer argument.</param>
- /// <returns>An integer value: -1 for a negative argument;
- /// 0 for a zero argument, and 1 for a positive argument.
- /// </returns>
- public static int signum(int x) {
- if (x < 0)
- return -1;
- if (x == 0)
- return 0;
- return 1;
- }
-
- /// <summary>
- /// An adjusted remainder function as defined in "Calendrical
- /// Calculations".
- /// </summary>
- /// <param name="x">The double x argument.</param>
- /// <param name="y">The double y argument, the divisor.</param>
- /// <returns>A double value representing remainder; but instead 0.0
- /// the divisor y is returned.
- /// </returns>
- public static double amod(double x, double y) {
- double d = mod(x, y);
- return (d == 0.0) ? y : d;
- }
-
- /// <summary>
- /// The adjusted remainder functions for integers as defined in
- /// "Calendrical Calculations".
- /// </summary>
- /// <param name="x">The integer argument to be divided.</param>
- /// <param name="y">The integer divisor argument.</param>
- /// <returns>The remainder as an integer; however instead 0
- /// is the divisor y returned.
- /// </returns>
- public static int amod(int x, int y) {
- int i = mod(x, y);
- return (i == 0) ? y : i;
- }
-}
-
-/// <summary>The class implements methods to handle the fixed date value from
-/// the "Calendrical Calculations" books.
-/// </summary>
-/// <remarks>
-/// <para>
-/// For implementing the Calendar classes I used the algorithms from the
-/// book "Calendrical Calculations" by Nachum Dershowitz and Edward M.
-/// Rheingold, second reprint 1998. Trying to prevent the introduction of new
-/// bugs, I implemented their algorithms in the
-/// <see cref="N:CalendricalCalculations"/>
-/// namespace and wrapped it in the calendar classes.
-/// </para>
-/// <para>
-/// The fixed day number is also known as R.D. - rata die.
-/// Midnight at the onset of Monday,
-/// January 1, year 1 (Gregorian) is R.D. 1.
-/// </para>
-/// <para>Here are all my references:</para>
-/// <list type="table">
-/// <item><description>
-/// [1] Nachum Dershowitz and Edward M. Rheingold: "Calendrical Calculations";
-/// Cambridge University Press; second reprint 1998.
-/// </description></item>
-/// <item><description>
-/// [2] P. Kenneth Seidelmann (ed.): "Explanatory Supplement to the Astronomical
-/// Almanac"; University Science Books, Sausalito; 1992
-/// </description></item>
-/// <item><description>
-/// [3] F. Richard Stephenson: "Historical Eclipses and Earth Rotation";
-/// Cambridge University Press; 1997
-/// </description></item>
-/// </list>
-/// </remarks>
-internal class CCFixed {
- /// <summary>The method computes the
- /// <see cref="T:System.DateTime"/>
- /// from a fixed day number.
- /// </summary>
- /// <param name="date">A integer representing the fixed day number.
- /// </param>
- /// <returns>The <see cref="T:System.DateTime"/> representing
- /// the date.
- /// </returns>
- public static System.DateTime ToDateTime(int date) {
- long ticks = (date - 1) * System.TimeSpan.TicksPerDay;
- return new System.DateTime(ticks);
- }
-
- /// <summary>The method computes the
- /// <see cref="T:System.DateTime"/>
- /// from a fixed day number and time arguments.
- /// </summary>
- /// <param name="date">An integer representing the fixed day number.
- /// </param>
- /// <param name="hour">An integer argument specifying the hour.
- /// </param>
- /// <param name="minute">An integer argument specifying the minute.
- /// </param>
- /// <param name="second">An integer argument giving the second.
- /// </param>
- /// <param name="milliseconds">An double argument specifying
- /// the milliseconds. Notice that
- /// <see cref="T:System.DateTime"/> has 100 nanosecond resolution.
- /// </param>
- /// <returns>The <see cref="T:System.DateTime"/> representing
- /// the date.
- /// </returns>
- public static System.DateTime ToDateTime(int date,
- int hour, int minute, int second, double milliseconds)
- {
- System.DateTime time = ToDateTime(date);
- time = time.AddHours(hour);
- time = time.AddMinutes(minute);
- time = time.AddSeconds(second);
- return time.AddMilliseconds(milliseconds);
- }
-
- /// <summary>
- /// A static method computing the fixed day number from a
- /// <see cref="T:System.DateTime"/> value.
- /// </summary>
- /// <param name="time">A
- /// <see cref="T:System.DateTime"/> value representing the date.
- /// </param>
- /// <returns>The fixed day number as integer representing the date.
- /// </returns>
- public static int FromDateTime(System.DateTime time) {
- return 1 + (int)(time.Ticks / System.TimeSpan.TicksPerDay);
- }
-
- /// <summary>
- /// The static method computes the <see cref="T:DayOfWeek"/>.
- /// </summary>
- /// <param name="date">An integer representing the fixed day number.
- /// </param>
- /// <returns>The day of week.</returns>
- public static DayOfWeek day_of_week(int date) {
- return (DayOfWeek)CCMath.mod(date, 7);
- }
-
- /// <summary>
- /// The static method computes the date of a day of week on or before
- /// a particular date.
- /// </summary>
- /// <param name="date">An integer representing the date as
- /// fixed day number.
- /// </param>
- /// <param name="k">An integer representing the day of the week,
- /// starting with 0 for sunday.
- /// </param>
- /// <returns>The fixed day number of the day of week specified by k
- /// on or before the given date.
- /// </returns>
- public static int kday_on_or_before(int date, int k) {
- return date - (int)day_of_week(date-k);
- }
-
- /// <summary>
- /// The static method computes the date of a day of week on or after
- /// a particular date.
- /// </summary>
- /// <param name="date">An integer representing the date as
- /// fixed day number.
- /// </param>
- /// <param name="k">An integer representing the day of the week,
- /// starting with 0 for sunday.
- /// </param>
- /// <returns>The fixed day number of the day of week specified by k
- /// on or after the given date.
- /// </returns>
- public static int kday_on_or_after(int date, int k) {
- return kday_on_or_before(date+6, k);
- }
-
- /// <summary>
- /// The static method computes the date of a day of week that is
- /// nearest to a particular date.
- /// </summary>
- /// <param name="date">An integer representing the date as
- /// fixed day number.
- /// </param>
- /// <param name="k">An integer representing the day of the week,
- /// starting with 0 for sunday.
- /// </param>
- /// <returns>The fixed day number of the day of week neares to the
- /// given date.
- /// </returns>
- public static int kd_nearest(int date, int k) {
- return kday_on_or_before(date+3, k);
- }
-
- /// <summary>
- /// The static method computes the date of a day of week after
- /// a particular date.
- /// </summary>
- /// <param name="date">An integer representing the date as
- /// fixed day number.
- /// </param>
- /// <param name="k">An integer representing the day of the week,
- /// starting with 0 for sunday.
- /// </param>
- /// <returns>The fixed day number of the day of week specified by k
- /// after the given date.
- /// </returns>
- public static int kday_after(int date, int k) {
- return kday_on_or_before(date+7, k);
- }
-
- /// <summary>
- /// The static method computes the date of a day of week before
- /// a particular date.
- /// </summary>
- /// <param name="date">An integer representing the date as
- /// fixed day number.
- /// </param>
- /// <param name="k">An integer representing the day of the week,
- /// starting with 0 for sunday.
- /// </param>
- /// <returns>The fixed day number of the day of week specified by k
- /// before the given date.
- /// </returns>
- public static int kday_before(int date, int k) {
- return kday_on_or_before(date-1, k);
- }
-} // class CCFixed
-
-/// <summary>
-/// A class encapsulating the functions of the Gregorian calendar as static
-/// methods.
-/// </summary>
-/// <remarks>
-/// <para>
-/// This class is not compatible to
-/// <see cref="T:System.Globalization.GregorianCalendar"/>.
-/// </para>
-/// <para>
-/// The fixed day number is also known as R.D. - rata die.
-/// Midnight at the onset of Monday,
-/// January 1, year 1 (Gregorian) is R.D. 1.
-/// </para>
-/// <seealso cref="T:CCFixed"/>
-/// </remarks>
-internal class CCGregorianCalendar {
- /// <summary>An integer defining the epoch of the Gregorian calendar
- /// as fixed day number.</summary>
- /// <remarks>The epoch is January 3, 1 C.E. (Julian).</remarks>
- const int epoch = 1;
-
- /// <summary>The enumeration defines the months of the Gregorian
- /// calendar.
- /// </summary>
- public enum Month {
- /// <summary>
- /// January.
- /// </summary>
- january = 1,
- /// <summary>
- /// February.
- /// </summary>
- february,
- /// <summary>
- /// March.
- /// </summary>
- march,
- /// <summary>
- /// April.
- /// </summary>
- april,
- /// <summary>
- /// May.
- /// </summary>
- may,
- /// <summary>
- /// June.
- /// </summary>
- june,
- /// <summary>
- /// July.
- /// </summary>
- july,
- /// <summary>
- /// August.
- /// </summary>
- august,
- /// <summary>
- /// September.
- /// </summary>
- september,
- /// <summary>
- /// October.
- /// </summary>
- october,
- /// <summary>
- /// November.
- /// </summary>
- november,
- /// <summary>
- /// December.
- /// </summary>
- december
- };
-
-
- /// <summary>
- /// The method tells whether the year is a leap year.
- /// </summary>
- /// <param name="year">An integer representing the Gregorian year.
- /// </param>
- /// <returns>A boolean which is true if <paramref name="year"/> is
- /// a leap year.
- /// </returns>
- public static bool is_leap_year(int year) {
- if (CCMath.mod(year, 4) != 0)
- return false;
- switch (CCMath.mod(year, 400)) {
- case 100:
- return false;
- case 200:
- return false;
- case 300:
- return false;
- }
- return true;
- }
-
- /// <summary>
- /// The method returns the fixed day number of the given Gregorian
- /// date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Gregorian year.
- /// </param>
- /// <param name="year">An integer representing the Gregorian year.
- /// Non-positive values are allowed also.
- /// </param>
- /// <returns>An integer value representing the fixed day number.
- /// </returns>
- public static int fixed_from_dmy(int day, int month, int year) {
- int k = epoch - 1;
- k += 365 * (year-1);
- k += CCMath.div(year-1, 4);
- k -= CCMath.div(year-1, 100);
- k += CCMath.div(year-1, 400);
- k += CCMath.div(367*month-362, 12);
- if (month > 2) {
- k += is_leap_year(year) ? -1 : -2;
- }
-
- k += day;
-
- return k;
- }
-
- /// <summary>
- /// The method computes the Gregorian year from a fixed day number.
- /// </summary>
- /// <param name="date">The fixed day number.
- /// </param>
- /// <returns>An integer value giving the Gregorian year of the date.
- /// </returns>
- public static int year_from_fixed(int date) {
- int d = date - epoch;
- int n_400 = CCMath.div_mod(out d, d, 146097);
- int n_100 = CCMath.div_mod(out d, d, 36524);
- int n_4 = CCMath.div_mod(out d, d, 1461);
- int n_1 = CCMath.div(d, 365);
-
- int year = 400*n_400 + 100*n_100 + 4*n_4 + n_1;
- return (n_100 == 4 || n_1 == 4) ? year : year + 1;
- }
-
- /// <summary>
- /// The method computes the Gregorian year and month from a fixed day
- /// number.
- /// </summary>
- /// <param name="month">The output value giving the Gregorian month.
- /// </param>
- /// <param name="year">The output value giving the Gregorian year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void my_from_fixed(out int month, out int year,
- int date)
- {
- year = year_from_fixed(date);
-
- int prior_days = date - fixed_from_dmy(1, (int)Month.january,
- year);
-
- int correction;
- if (date < fixed_from_dmy(1, (int)Month.march, year)) {
- correction = 0;
- } else if (is_leap_year(year)) {
- correction = 1;
- } else {
- correction = 2;
- }
-
- month = CCMath.div(12 * (prior_days + correction) + 373, 367);
-
- }
-
- /// <summary>
- /// The method computes the Gregorian year, month, and day from a
- /// fixed day number.
- /// </summary>
- /// <param name="day">The output value returning the day of the
- /// month.
- /// </param>
- /// <param name="month">The output value giving the Gregorian month.
- /// </param>
- /// <param name="year">The output value giving the Gregorian year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void dmy_from_fixed(out int day, out int month,
- out int year,
- int date)
- {
- my_from_fixed(out month, out year, date);
- day = date - fixed_from_dmy(1, month, year) + 1;
- }
-
- /// <summary>A method computing the Gregorian month from a fixed
- /// day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the Gregorian month.
- /// </returns>
- public static int month_from_fixed(int date) {
- int month, year;
-
- my_from_fixed(out month, out year, date);
- return month;
- }
-
- /// <summary>
- /// A method computing the day of the month from a fixed day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the day of the month.
- /// </returns>
- public static int day_from_fixed(int date) {
- int day, month, year;
-
- dmy_from_fixed(out day, out month, out year, date);
- return day;
- }
-
- /// <summary>
- /// The method computes the difference between two Gregorian dates.
- /// </summary>
- /// <param name="dayA">The integer parameter gives the day of month
- /// of the first date.
- /// </param>
- /// <param name="monthA">The integer parameter gives the Gregorian
- /// month of the first date.
- /// </param>
- /// <param name="yearA">The integer parameter gives the Gregorian
- /// year of the first date.
- /// </param>
- /// <param name="dayB">The integer parameter gives the day of month
- /// of the second date.
- /// </param>
- /// <param name="monthB">The integer parameter gives the Gregorian
- /// month of the second date.
- /// </param>
- /// <param name="yearB">The integer parameter gives the Gregorian
- /// year of the second date.
- /// </param>
- /// <returns>An integer giving the difference of days from the first
- /// the second date.
- /// </returns>
- public static int date_difference(int dayA, int monthA, int yearA,
- int dayB, int monthB, int yearB)
- {
- return fixed_from_dmy(dayB, monthB, yearB) -
- fixed_from_dmy(dayA, monthA, yearA);
- }
-
- /// <summary>
- /// The method computes the number of the day in the year from
- /// a Gregorian date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Gregorian year.
- /// </param>
- /// <param name="year">An integer representing the Gregorian year.
- /// Non-positive values are allowed also.
- /// </param>
- /// <returns>An integer value giving the number of the day in the
- /// Gregorian year, counting from 1.
- /// </returns>
- public static int day_number(int day, int month, int year) {
- return date_difference(31, (int)Month.december, year-1,
- day, month, year);
- }
-
- /// <summary>
- /// The method computes the days remaining in the given Gregorian
- /// year from a Gregorian date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Gregorian year.
- /// </param>
- /// <param name="year">An integer representing the Gregorian year.
- /// Non-positive values are allowed also.
- /// </param>
- /// <returns>An integer value giving the number of days remaining in
- /// the Gregorian year.
- /// </returns>
- public static int days_remaining(int day, int month, int year) {
- return date_difference(day, month, year,
- 31, (int)Month.december, year);
- }
-
- // Helper functions for the Gregorian calendars.
-
- /// <summary>
- /// Adds months to the given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- public static System.DateTime AddMonths(System.DateTime time,
- int months)
- {
- int rd = CCFixed.FromDateTime(time);
- int day, month, year;
- dmy_from_fixed(out day, out month, out year, rd);
- month += months;
- rd = fixed_from_dmy(day, month, year);
- System.DateTime t = CCFixed.ToDateTime(rd);
- return t.Add(time.TimeOfDay);
- }
-
- /// <summary>
- /// Adds years to the given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- public static System.DateTime AddYears(System.DateTime time,
- int years)
- {
- int rd = CCFixed.FromDateTime(time);
- int day, month, year;
- dmy_from_fixed(out day, out month, out year, rd);
- year += years;
- rd = fixed_from_dmy(day, month, year);
- System.DateTime t = CCFixed.ToDateTime(rd);
- return t.Add(time.TimeOfDay);
- }
-
- /// <summary>
- /// Gets the of the month from <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public static int GetDayOfMonth(System.DateTime time) {
- return day_from_fixed(CCFixed.FromDateTime(time));
- }
-
- /// <summary>
- /// The method gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- public static int GetDayOfYear(System.DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- int year = year_from_fixed(rd);
- int rd1_1 = fixed_from_dmy(1, 1, year);
- return rd - rd1_1 + 1;
- }
-
- /// <summary>
- /// A method that gives the number of days of the specified
- /// month of the <paramref name="year"/>.
- /// </summary>
- /// <param name="year">An integer that gives the year in the current
- /// era.</param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- public static int GetDaysInMonth(int year, int month) {
- int rd1 = fixed_from_dmy(1, month, year);
- int rd2 = fixed_from_dmy(1, month+1, year);
- return rd2 - rd1;
- }
-
- /// <summary>
- /// The method gives the number of days in the specified year.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- public static int GetDaysInYear(int year) {
- int rd1 = fixed_from_dmy(1, 1, year);
- int rd2 = fixed_from_dmy(1, 1, year+1);
- return rd2 - rd1;
- }
-
- /// <summary>
- /// The method gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- public static int GetMonth(System.DateTime time) {
- return month_from_fixed(CCFixed.FromDateTime(time));
- }
-
- /// <summary>
- /// The method gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year.
- /// </returns>
- public static int GetYear(System.DateTime time) {
- return year_from_fixed(CCFixed.FromDateTime(time));
- }
-
- /// <summary>
- /// A virtual method that tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- public static bool IsLeapDay(int year, int month, int day) {
- return is_leap_year(year) && month == 2 && day == 29;
- }
-
- /// <summary>
- /// A method that creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- public static System.DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds)
- {
- return CCFixed.ToDateTime(fixed_from_dmy(day, month, year),
- hour, minute, second, milliseconds);
- }
-} // class CCGregorianCalendar
-
-/// <summary>
-/// A class encapsulating the functions of the Julian calendar as static
-/// methods.
-/// </summary>
-/// <remarks>
-/// <para>The algorithms don't support a year 0. Years before Common Era
-/// (B.C.E. or B.C.) are negative and years of Common Era (C.E. or A.D.)
-/// are positive.
-/// </para>
-/// <para>
-/// This class is not compatible to
-/// <see cref="T:System.Globalization.JulianCalendar"/>.
-/// </para>
-/// <seealso cref="T:CCFixed"/>
-/// </remarks>
-internal class CCJulianCalendar {
- /// <summary>An integer defining the epoch of the Julian calendar
- /// as fixed day number.</summary>
- /// <remarks>The epoch is December 30, 0 (Gregorian).</remarks>
- const int epoch = -1; // 30. 12. 0 Gregorian
-
- /// <summary>The enumeration defines the months of the Julian
- /// calendar.
- /// </summary>
- public enum Month {
- /// <summary>
- /// January.
- /// </summary>
- january = 1,
- /// <summary>
- /// February.
- /// </summary>
- february,
- /// <summary>
- /// March.
- /// </summary>
- march,
- /// <summary>
- /// April.
- /// </summary>
- april,
- /// <summary>
- /// May.
- /// </summary>
- may,
- /// <summary>
- /// June.
- /// </summary>
- june,
- /// <summary>
- /// July.
- /// </summary>
- july,
- /// <summary>
- /// August.
- /// </summary>
- august,
- /// <summary>
- /// September.
- /// </summary>
- september,
- /// <summary>
- /// October.
- /// </summary>
- october,
- /// <summary>
- /// November.
- /// </summary>
- november,
- /// <summary>
- /// December.
- /// </summary>
- december
- };
-
- /// <summary>
- /// The method tells whether the year is a leap year.
- /// </summary>
- /// <param name="year">An integer representing the Julian year.
- /// </param>
- /// <returns>A boolean which is true if <paramref name="year"/> is
- /// a leap year.
- /// </returns>
- public static bool is_leap_year(int year) {
- return CCMath.mod(year, 4) == (year > 0 ? 0 : 3);
- }
-
- /// <summary>
- /// The method returns the fixed day number of the given Julian
- /// date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Julian year.
- /// </param>
- /// <param name="year">An integer representing the Julian year.
- /// Positive and Negative values are allowed.
- /// </param>
- /// <returns>An integer value representing the fixed day number.
- /// </returns>
- public static int fixed_from_dmy(int day, int month, int year) {
- int y = year < 0 ? year+1 : year;
- int k = epoch - 1;
- k += 365 * (y-1);
- k += CCMath.div(y-1, 4);
- k += CCMath.div(367*month-362, 12);
- if (month > 2) {
- k += is_leap_year(year) ? -1 : -2;
- }
- k += day;
-
- return k;
- }
-
- /// <summary>
- /// The method computes the Julian year from a fixed day number.
- /// </summary>
- /// <param name="date">The fixed day number.
- /// </param>
- /// <returns>An integer value giving the Julian year of the date.
- /// </returns>
- public static int year_from_fixed(int date) {
- int approx = CCMath.div(4*(date-epoch)+1464, 1461);
- return approx <= 0 ? approx - 1 : approx;
- }
-
- /// <summary>
- /// The method computes the Julian year and month from a fixed day
- /// number.
- /// </summary>
- /// <param name="month">The output value giving the Julian month.
- /// </param>
- /// <param name="year">The output value giving the Julian year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void my_from_fixed(out int month, out int year, int date)
- {
- year = year_from_fixed(date);
-
- int prior_days = date - fixed_from_dmy(1, (int)Month.january,
- year);
-
- int correction;
- if (date < fixed_from_dmy(1, (int)Month.march, year)) {
- correction = 0;
- } else if (is_leap_year(year)) {
- correction = 1;
- } else {
- correction = 2;
- }
-
- month = CCMath.div(12 * (prior_days + correction) + 373, 367);
- }
-
-
- /// <summary>
- /// The method computes the Julian year, month, and day from a
- /// fixed day number.
- /// </summary>
- /// <param name="day">The output value returning the day of the
- /// month.
- /// </param>
- /// <param name="month">The output value giving the Julian month.
- /// </param>
- /// <param name="year">The output value giving the Julian year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void dmy_from_fixed(out int day, out int month,
- out int year, int date)
- {
- my_from_fixed(out month, out year, date);
- day = date - fixed_from_dmy(1, month, year) + 1;
- }
-
- /// <summary>A method computing the Julian month from a fixed
- /// day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the Julian month.
- /// </returns>
- public static int month_from_fixed(int date) {
- int month, year;
-
- my_from_fixed(out month, out year, date);
- return month;
- }
-
- /// <summary>
- /// A method computing the day of the month from a fixed day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the day of the month.
- /// </returns>
- public static int day_from_fixed(int date) {
- int day;
- int month;
- int year;
-
- dmy_from_fixed(out day, out month, out year, date);
- return day;
- }
-
- /// <summary>
- /// The method computes the difference between two Julian dates.
- /// </summary>
- /// <param name="dayA">The integer parameter gives the day of month
- /// of the first date.
- /// </param>
- /// <param name="monthA">The integer parameter gives the Julian
- /// month of the first date.
- /// </param>
- /// <param name="yearA">The integer parameter gives the Julian
- /// year of the first date.
- /// </param>
- /// <param name="dayB">The integer parameter gives the day of month
- /// of the second date.
- /// </param>
- /// <param name="monthB">The integer parameter gives the Julian
- /// month of the second date.
- /// </param>
- /// <param name="yearB">The integer parameter gives the Julian
- /// year of the second date.
- /// </param>
- /// <returns>An integer giving the difference of days from the first
- /// the second date.
- /// </returns>
- public static int date_difference(int dayA, int monthA, int yearA,
- int dayB, int monthB, int yearB)
- {
- return fixed_from_dmy(dayB, monthB, yearB) -
- fixed_from_dmy(dayA, monthA, yearA);
- }
-
- /// <summary>
- /// The method computes the number of the day in the year from
- /// a Julian date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Julian year.
- /// </param>
- /// <param name="year">An integer representing the Julian year.
- /// Negative values are allowed also.
- /// </param>
- /// <returns>An integer value giving the number of the day in the
- /// Julian year, counting from 1.
- /// </returns>
- public static int day_number(int day, int month, int year) {
- return date_difference(31, (int)Month.december, year-1,
- day, month, year);
- }
-
- /// <summary>
- /// The method computes the days remaining in the given Julian
- /// year from a Julian date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Julian year.
- /// </param>
- /// <param name="year">An integer representing the Julian year.
- /// Negative values are allowed also.
- /// </param>
- /// <returns>An integer value giving the number of days remaining in
- /// the Julian year.
- /// </returns>
- public static int days_remaining(int day, int month, int year) {
- return date_difference(day, month, year,
- 31, (int)Month.december, year);
- }
-} // class CCJulianCalendar
-
-/// <summary>
-/// A class encapsulating the functions of the Hebrew calendar as static
-/// methods.
-/// </summary>
-/// <remarks>
-/// <para>
-/// This class is not compatible to
-/// <see cref="T:System.Globalization.HebrewCalendar"/>.
-/// </para>
-/// <seealso cref="T:CCFixed"/>
-/// </remarks>
-internal class CCHebrewCalendar {
- /// <summary>An integer defining the epoch of the Hebrew calendar
- /// as fixed day number.</summary>
- /// <remarks>The epoch is October 10, 3761 B.C.E. (Julian).</remarks>
- const int epoch = -1373427;
-
- /// <summary>The enumeration defines the months of the Gregorian
- /// calendar.
- /// </summary>
- /// <remarks>
- /// The enumaration differs from .NET which defines Tishri as month 1.
- /// </remarks>
- public enum Month {
- /// <summary>
- /// Nisan.
- /// </summary>
- nisan = 1,
- /// <summary>
- /// Iyyar.
- /// </summary>
- iyyar,
- /// <summary>
- /// Sivan.
- /// </summary>
- sivan,
- /// <summary>
- /// Tammuz.
- /// </summary>
- tammuz,
- /// <summary>
- /// Av.
- /// </summary>
- av,
- /// <summary>
- /// Elul.
- /// </summary>
- elul,
- /// <summary>
- /// Tishri.
- /// </summary>
- tishri,
- /// <summary>
- /// Heshvan.
- /// </summary>
- heshvan,
- /// <summary>
- /// Kislev.
- /// </summary>
- kislev,
- /// <summary>
- /// Teveth.
- /// </summary>
- teveth,
- /// <summary>
- /// Shevat.
- /// </summary>
- shevat,
- /// <summary>
- /// Adar.
- /// </summary>
- adar,
- /// <summary>
- /// Adar I. Only in years with Adar II.
- /// </summary>
- adar_I = 12,
- /// <summary>
- /// Adar II. Only in years wirh Adar I.
- /// </summary>
- adar_II = 13,
- };
-
- /// <summary>
- /// The method tells whether the year is a leap year.
- /// </summary>
- /// <param name="year">An integer representing the Hebrew year.
- /// </param>
- /// <returns>A boolean which is true if <paramref name="year"/> is
- /// a leap year.
- /// </returns>
- public static bool is_leap_year(int year) {
- return CCMath.mod(7*year+1, 19) < 7;
- }
-
- /// <summary>
- /// The Method gives the number of the last month in a year, which
- /// is equal with the number of month in a Hebrew year.
- /// </summary>
- /// <param name="year">An integer representing the Hebrew year.
- /// </param>
- /// <returns>An integer giving the number of the last month of the
- /// Hebrew year, which is the same as the numbers of month in the
- /// year.
- /// </returns>
- public static int last_month_of_year(int year) {
- return is_leap_year(year) ? 13 : 12;
- }
-
-
- /// <summary>The method is a helper function.</summary>
- /// <param name="year">An integer specifying the Hebrew year.
- /// </param>
- /// <returns>An integer representing the number of elapsed days
- /// until the Hebrew year.</returns>
- public static int elapsed_days(int year) {
- int months_elapsed = CCMath.div(235*year-234, 19);
- int r;
- int d = CCMath.div_mod(out r, months_elapsed, 1080);
- int parts_elapsed = 204 + 793 * r;
- int hours_elapsed = 11 + 12 * months_elapsed +
- 793 * d + CCMath.div(parts_elapsed, 1080);
-
- int day = 29*months_elapsed + CCMath.div(hours_elapsed, 24);
-
- if (CCMath.mod(3*(day+1), 7) < 3) {
- day += 1;
- }
-
- return day;
- }
-
- /// <summary>A method computing the delay of new year for the given
- /// Hebrew year.
- /// </summary>
- /// <param name="year">An integer that gives the Hebrew year.
- /// </param>
- /// <returns>The new year delay in days of the given Hebrew year.
- /// </returns>
- public static int new_year_delay(int year) {
- int ny1 = elapsed_days(year);
- int ny2 = elapsed_days(year+1);
-
- if (ny2 - ny1 == 356) {
- return 2;
- }
- int ny0 = elapsed_days(year-1);
- if (ny1 - ny0 == 382) {
- return 1;
- }
- return 0;
- }
-
- /// <summary>
- /// The method computes the last day of month (nummer of days in a
- /// month) of the given Hebrew year.
- /// </summary>
- /// <param name="month">The Hebrew month, allowed value between
- /// One and Thirteen.
- /// </param>
- /// <param name="year">An integer that gives the Hebrew year.
- /// </param>
- /// <returns>The number of the last day of the month of the given
- /// Hebrew year, which gives automatically the number of days in the
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRange.Exception">
- /// The exception is thrown if month not between One and Thirteen.
- /// </exception>
- public static int last_day_of_month(int month, int year) {
- if (month < 1 || month > 13)
- throw new System.ArgumentOutOfRangeException("month",
- "Month should be between One and Thirteen.");
- switch (month) {
- case 2: return 29;
- case 4: return 29;
- case 6: return 29;
- case 8:
- if (!long_heshvan(year))
- return 29;
- break;
- case 9:
- if (short_kislev(year))
- return 29;
- break;
- case 10: return 29;
- case 12:
- if (!is_leap_year(year))
- return 29;
- break;
- case 13: return 29;
- }
- return 30;
- }
-
- /// <summary>
- /// The functions checks whether the month Heshvan is a long one
- /// in the given Hebrew year.
- /// </summary>
- /// <param name="year">An integer that gives the Hebrew year.
- /// </param>
- /// <returns>A boolean value: true if there is a long Heshvan
- /// in the given Hebrew year; false otherwise.
- /// </returns>
- public static bool long_heshvan(int year) {
- return CCMath.mod(days_in_year(year), 10) == 5;
- }
-
- /// <summary>
- /// The functions checks whether the month Kislev is a short one
- /// in the given Hebrew year.
- /// </summary>
- /// <param name="year">An integer that gives the Hebrew year.
- /// </param>
- /// <returns>A boolean value: true if there is a short Kislev
- /// in the given Hebrew year; false otherwise.
- /// </returns>
- public static bool short_kislev(int year) {
- return CCMath.mod(days_in_year(year), 10) == 3;
- }
-
- /// <summary>
- /// The functions gives the number of days in the specified Hebrew
- /// year.
- /// </summary>
- /// <param name="year">An integer that gives the Hebrew year.
- /// </param>
- /// <returns>The days of the Hebrew year as integer.
- /// </returns>
- public static int days_in_year(int year) {
- return fixed_from_dmy(1, 7, year+1) -
- fixed_from_dmy(1, 7, year);
- }
-
- /// <summary>
- /// The method returns the fixed day number of the given Hebrew
- /// date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Hebrew year.
- /// </param>
- /// <param name="year">An integer representing the Hebrew year.
- /// Non-positive values are allowed also.
- /// </param>
- /// <returns>An integer value representing the fixed day number.
- /// </returns>
- public static int fixed_from_dmy(int day, int month, int year) {
- int m;
- int k = epoch-1;
- k += elapsed_days(year);
- k += new_year_delay(year);
-
- if (month < 7) {
- int l = last_month_of_year(year);
- for (m = 7; m <= l; m++) {
- k += last_day_of_month(m, year);
- }
- for (m = 1; m < month; m++) {
- k += last_day_of_month(m, year);
- }
- }
- else {
- for (m = 7; m < month; m++) {
- k += last_day_of_month(m, year);
- }
- }
-
- k += day;
-
- return k;
- }
-
- /// <summary>
- /// The method computes the Hebrew year from a fixed day number.
- /// </summary>
- /// <param name="date">The fixed day number.
- /// </param>
- /// <returns>An integer value giving the Hebrew year of the date.
- /// </returns>
- public static int year_from_fixed(int date) {
- int approx = (int)System.Math.Floor(
- ((double)(date - epoch))/(35975351.0/98496.0));
- int y;
- for (y = approx; date >= fixed_from_dmy(1, 7, y); y++) {}
- return y-1;
- }
-
- /// <summary>
- /// The method computes the Hebrew year and month from a fixed day
- /// number.
- /// </summary>
- /// <param name="month">The output value giving the Hebrew month.
- /// </param>
- /// <param name="year">The output value giving the Hebrew year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void my_from_fixed(out int month, out int year,
- int date)
- {
- year = year_from_fixed(date);
-
- int start = date < fixed_from_dmy(1, 1, year) ? 7 : 1;
-
- for (month = start;
- date > fixed_from_dmy(last_day_of_month(month, year),
- month, year);
- month++)
- {}
- }
-
- /// <summary>
- /// The method computes the Hebrew year, month, and day from a
- /// fixed day number.
- /// </summary>
- /// <param name="day">The output value returning the day of the
- /// month.
- /// </param>
- /// <param name="month">The output value giving the Hebrew month.
- /// </param>
- /// <param name="year">The output value giving the Hebrew year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void dmy_from_fixed(out int day, out int month,
- out int year, int date)
- {
- my_from_fixed(out month, out year, date);
- day = date - fixed_from_dmy(1, month, year) + 1;
- }
-
- /// <summary>A method computing the Hebrew month from a fixed
- /// day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the Hebrew month.
- /// </returns>
- public static int month_from_fixed(int date) {
- int month, year;
-
- my_from_fixed(out month, out year, date);
- return month;
- }
-
- /// <summary>
- /// A method computing the day of the month from a fixed day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the day of the month.
- /// </returns>
- public static int day_from_fixed(int date) {
- int day, month, year;
-
- dmy_from_fixed(out day, out month, out year, date);
- return day;
- }
-
- /// <summary>
- /// The method computes the difference between two Hebrew dates.
- /// </summary>
- /// <param name="dayA">The integer parameter gives the day of month
- /// of the first date.
- /// </param>
- /// <param name="monthA">The integer parameter gives the Hebrew
- /// month of the first date.
- /// </param>
- /// <param name="yearA">The integer parameter gives the Hebrew
- /// year of the first date.
- /// </param>
- /// <param name="dayB">The integer parameter gives the day of month
- /// of the second date.
- /// </param>
- /// <param name="monthB">The integer parameter gives the Hebrew
- /// month of the second date.
- /// </param>
- /// <param name="yearB">The integer parameter gives the Hebrew
- /// year of the second date.
- /// </param>
- /// <returns>An integer giving the difference of days from the first
- /// the second date.
- /// </returns>
- public static int date_difference(int dayA, int monthA, int yearA,
- int dayB, int monthB, int yearB)
- {
- return fixed_from_dmy(dayB, monthB, yearB) -
- fixed_from_dmy(dayA, monthA, yearA);
- }
-
- /// <summary>
- /// The method computes the number of the day in the year from
- /// a Hebrew date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Hebrew year.
- /// </param>
- /// <param name="year">An integer representing the Hebrew year.
- /// </param>
- /// <returns>An integer value giving the number of the day in the
- /// Hebrew year, counting from 1.
- /// </returns>
- public static int day_number(int day, int month, int year) {
- return date_difference(1, 7, year,
- day, month, year) + 1;
- }
-
- /// <summary>
- /// The method computes the days remaining in the given Hebrew
- /// year from a Hebrew date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Hebrew year.
- /// </param>
- /// <param name="year">An integer representing the Hebrew year.
- /// </param>
- /// <returns>An integer value giving the number of days remaining in
- /// the Hebrew year.
- /// </returns>
- public static int days_remaining(int day, int month, int year) {
- return date_difference(day, month, year,
- 1, 7, year+1)-1;
- }
-} // class HebrewCalendar
-
-
-/// <summary>
-/// A class encapsulating the functions of the Islamic calendar as static
-/// methods.
-/// </summary>
-/// <remarks>
-/// <para>There is no difference here in using Hijri or Islamic calendar.
-/// </para>
-/// <para>The epoch of the Islamic calendar isn't fixed, because we cannot
-/// surely say today, when the crescent of the new moon has been observed
-/// around the July 16, 622 C.E. Julian. Even today the start and end of
-/// the month Ramadan is defined by religous authorities. So the calendar
-/// can be offset by two days.
-/// </para>
-/// <para>
-/// We don't support the offset here, however we changed the epoch from
-/// "Calendrical Calculations" to value, that .Net seems to be using.
-/// </para>
-/// <para>
-/// This class is not compatible to
-/// <see cref="T:System.Globalization.HijriCalendar"/>.
-/// </para>
-/// <seealso cref="T:CCFixed"/>
-/// </remarks>
-public class CCHijriCalendar {
- /// <summary>An integer defining the epoch of the Gregorian calendar
- /// as fixed day number.</summary>
- /// <remarks>
- /// <para>
- /// The epoch is given as 16 July 622 C.E. Julian (R.D. 227015)
- /// in Calendrical Calculations, the approximate date of
- /// the emigration of
- /// Muhammed to Medina. However there is no way to determine today
- /// the observation of the crescent of the new moon in July 622 C.E.
- /// (Julian). So there is some variability in the epoch.
- /// Religous authorities determine the epoch by observing the
- /// crescent of the new moon for the month Ramadan, so there might
- /// be an offsets by two days of the epoch.
- /// </para>
- /// <para>Windows
- /// supports an AddHijriDate parameter in the registry to adapt
- /// for it. It seems that the .NET implementation of
- /// HijriCalendar uses an epoch of 227014, so we use it here. The
- /// ArgumentOutOfRangeException gives July, 18 622 as epoch,
- /// which is 227014 supporting our theory.
- /// </para>
- /// </remarks>
- const int epoch = 227014;
-
- /// <summary>The enumeration defines the months of the Islamic
- /// calendar.
- /// </summary>
- public enum Month {
- /// <summary>
- /// Muharram.
- /// </summary>
- muharram = 1,
- /// <summary>
- /// Safar.
- /// </summary>
- safar,
- /// <summary>
- /// Rabi I.
- /// </summary>
- rabi_I,
- /// <summary>
- /// Rabi II.
- /// </summary>
- rabi_II,
- /// <summary>
- /// Jumada I.
- /// </summary>
- jumada_I,
- /// <summary>
- /// Jumada II.
- /// </summary>
- jumada_II,
- /// <summary>
- /// Rajab.
- /// </summary>
- rajab,
- /// <summary>
- /// Shaban.
- /// </summary>
- shaban,
- /// <summary>
- /// Ramadan.
- /// </summary>
- ramadan,
- /// <summary>
- /// Shawwal.
- /// </summary>
- shawwal,
- /// <summary>
- /// Dhu Al-Quada.
- /// </summary>
- dhu_al_quada,
- /// <summary>
- /// Dhu Al-Hijja.
- /// </summary>
- dhu_al_hijja,
- };
-
- /// <summary>
- /// The method tells whether the year is a leap year.
- /// </summary>
- /// <param name="year">An integer representing the Islamic year.
- /// </param>
- /// <returns>A boolean which is true if <paramref name="year"/> is
- /// a leap year.
- /// </returns>
- public static bool is_leap_year(int year) {
- return CCMath.mod(14+11*year, 30) < 11;
- }
-
- /// <summary>
- /// The method returns the fixed day number of the given Islamic
- /// date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Islamic year.
- /// </param>
- /// <param name="year">An integer representing the Islamic year.
- /// Non-positive values are allowed also.
- /// </param>
- /// <returns>An integer value representing the fixed day number.
- /// </returns>
- public static int fixed_from_dmy(int day, int month, int year) {
- int k = epoch - 1;
- k += 354 * (year-1);
- k += CCMath.div(3+11*year, 30);
- k += (int)System.Math.Ceiling(29.5 * (double)(month-1));
- k += day;
-
- return k;
- }
-
- /// <summary>
- /// The method computes the Islamic year from a fixed day number.
- /// </summary>
- /// <param name="date">The fixed day number.
- /// </param>
- /// <returns>An integer value giving the Islamic year of the date.
- /// </returns>
- public static int year_from_fixed(int date) {
- return CCMath.div(30*(date-epoch)+10646, 10631);
- }
-
- /// <summary>
- /// The method computes the Islamic year and month from a fixed day
- /// number.
- /// </summary>
- /// <param name="month">The output value giving the Islamic month.
- /// </param>
- /// <param name="year">The output value giving the Islamic year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void my_from_fixed(out int month, out int year, int date)
- {
- year = year_from_fixed(date);
-
- int m = 1+(int)System.Math.Ceiling(
- ((double)(date-29-fixed_from_dmy(1,1,year)))/29.5);
-
- month = m < 12 ? m : 12;
- }
-
- /// <summary>
- /// The method computes the Islamic year, month, and day from a
- /// fixed day number.
- /// </summary>
- /// <param name="day">The output value returning the day of the
- /// month.
- /// </param>
- /// <param name="month">The output value giving the Islamic month.
- /// </param>
- /// <param name="year">The output value giving the Islamic year.
- /// </param>
- /// <param name="date">An integer value specifying the fixed day
- /// number.</param>
- public static void dmy_from_fixed(out int day, out int month,
- out int year, int date)
- {
- my_from_fixed(out month, out year, date);
- day = date - fixed_from_dmy(1, month, year) + 1;
- }
-
- /// <summary>A method computing the Islamic month from a fixed
- /// day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the Islamic month.
- /// </returns>
- public static int month_from_fixed(int date) {
- int month, year;
-
- my_from_fixed(out month, out year, date);
- return month;
- }
-
- /// <summary>
- /// A method computing the day of the month from a fixed day number.
- /// </summary>
- /// <param name="date">An integer specifying the fixed day number.
- /// </param>
- /// <returns>An integer value representing the day of the month.
- /// </returns>
- public static int day_from_fixed(int date) {
- int day;
- int month;
- int year;
-
- dmy_from_fixed(out day, out month, out year, date);
- return day;
- }
-
- /// <summary>
- /// The method computes the difference between two Islamic dates.
- /// </summary>
- /// <param name="dayA">The integer parameter gives the day of month
- /// of the first date.
- /// </param>
- /// <param name="monthA">The integer parameter gives the Islamic
- /// month of the first date.
- /// </param>
- /// <param name="yearA">The integer parameter gives the Islamic
- /// year of the first date.
- /// </param>
- /// <param name="dayB">The integer parameter gives the day of month
- /// of the second date.
- /// </param>
- /// <param name="monthB">The integer parameter gives the Islamic
- /// month of the second date.
- /// </param>
- /// <param name="yearB">The integer parameter gives the Islamic
- /// year of the second date.
- /// </param>
- /// <returns>An integer giving the difference of days from the first
- /// the second date.
- /// </returns>
- public static int date_difference(int dayA, int monthA, int yearA,
- int dayB, int monthB, int yearB)
- {
- return fixed_from_dmy(dayB, monthB, yearB) -
- fixed_from_dmy(dayA, monthA, yearA);
- }
-
- /// <summary>
- /// The method computes the number of the day in the year from
- /// a Islamic date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Islamic year.
- /// </param>
- /// <param name="year">An integer representing the Islamic year.
- /// </param>
- /// <returns>An integer value giving the number of the day in the
- /// Islamic year, counting from 1.
- /// </returns>
- public static int day_number(int day, int month, int year) {
- return date_difference(31, 12, year-1, day, month, year);
- }
-
- /// <summary>
- /// The method computes the days remaining in the given Islamic
- /// year from a Islamic date.
- /// </summary>
- /// <param name="day">An integer representing the day of the month,
- /// counting from 1.
- /// </param>
- /// <param name="month">An integer representing the month in the
- /// Islamic year.
- /// </param>
- /// <param name="year">An integer representing the Islamic year.
- /// Non-positive values are allowed also.
- /// </param>
- /// <returns>An integer value giving the number of days remaining in
- /// the Islamic year.
- /// </returns>
- public static int days_remaining(int day, int month, int year) {
- return date_difference(day, month, year,31, 12, year);
- }
-} // class CCHijriCalendar
-
-/// <summary>
-/// A class that supports the Gregorian based calendars with other eras
-/// (e.g. <see cref="T:System.Gloablization.JapaneseCalendar"/>).
-/// </summary>
-[System.Serializable]
-public class CCGregorianEraHandler {
- /// <summary>
- /// A struct that represents a single era.
- /// </summary>
- [System.Serializable]
- struct Era {
- /// <summary>
- /// The integer number identifying the era.
- /// </summary>
- private int _nr;
-
- /// <value>
- /// A get-only property that gives the era integer number.
- /// </value>
- public int Nr { get { return _nr; } }
-
- /// <summary>This integer gives the first day of the era as
- /// fixed day number.
- /// </summary>
- private int _start; // inclusive
- /// <summary>
- /// This integer gives the gregorian year of the
- /// <see cref="M:_start"/> value.
- /// </summary>
- private int _gregorianYearStart;
- /// <summary>
- /// This integer gives the last day of the era as fixed day
- /// number.
- /// </summary>
- private int _end; // inclusive
- /// <summary>
- /// This integer gives the largest year number of this era.
- /// </summary>
- private int _maxYear;
-
- /// <summary>
- /// This constructor creates the era structure.
- /// </summary>
- /// <param name="nr">The integer number of the era.
- /// </param>
- /// <param name="start">The fixed day number defining the
- /// first day of the era.
- /// </param>
- /// <param name="end">The fixed day number that defines the
- /// last day of the era.
- /// </param>
- public Era(int nr, int start, int end) {
- if (nr == 0)
- throw new System.ArgumentException(
- "Era number shouldn't be zero.");
- _nr = nr;
- if (start > end) {
- throw new System.ArgumentException(
- "Era should start before end.");
- }
- _start = start;
- _end = end;
-
- _gregorianYearStart =
- CCGregorianCalendar.year_from_fixed(_start);
- int gregorianYearEnd =
- CCGregorianCalendar.year_from_fixed(_end);
- _maxYear = gregorianYearEnd - _gregorianYearStart + 1;
- }
-
- /// <summary>
- /// This method computes the Gregorian year from the year
- /// of this era.
- /// </summary>
- /// <param name="year">An integer giving the year in the
- /// era.
- /// </param>
- /// <returns>
- /// The Gregorian year as integer.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the year isn't valid in this
- /// era.
- /// </exception>
- public int GregorianYear(int year) {
- if (year < 1 || year > _maxYear) {
- System.IO.StringWriter sw =
- new System.IO.StringWriter();
- sw.Write(
- "Valid Values are between " +
- "{0} and {1}, inclusive.",
- 1, _maxYear);
- throw new System.ArgumentOutOfRangeException(
- "year", sw.ToString());
- }
- return year + _gregorianYearStart - 1;
- }
-
- /// <summary>
- /// This function checks wether the given fixed day number is
- /// ion the time span of the era.
- /// </summary>
- /// <param name="date">An integer giving the fixed day
- /// number.
- /// </param>
- /// <returns>A boolean: true if the argument is in the time
- /// span of the era.
- /// </returns>
- public bool Covers(int date) {
- return _start <= date && date <= _end;
- }
-
- /// <summary>
- /// This function returns the year of the era and sets
- /// the era in an output parameter.
- /// </summary>
- /// <param name="era">An output parameter returning the
- /// era number.
- /// </param>
- /// <param name="date">An integer giving the fixed day
- /// number.
- /// </param>
- /// <returns>An integer giving the year of the era.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if date is outside of the time
- /// span of the era.
- /// </exception>
- public int EraYear(out int era, int date) {
- if (!Covers(date))
- throw new System.ArgumentOutOfRangeException(
- "date",
- "Time was out of Era range.");
- int gregorianYear =
- CCGregorianCalendar.year_from_fixed(date);
- era = _nr;
- return gregorianYear - _gregorianYearStart + 1;
- }
- } // struct Era
-
- /// <summary>
- /// A private member storing the eras in a
- /// <see cref="T:System.Collections.SortedList"/>.
- /// </summary>
- private SortedList _Eras;
-
- /// <value>
- /// The property returns the era numbers as an array of integers.
- /// </value>
- public int[] Eras {
- get {
- int[] a = new int[_Eras.Count];
-
- for (int i = 0; i < _Eras.Count; i++) {
- Era e = (Era)_Eras.GetByIndex(i);
- a[i] = e.Nr;
- }
-
- return a;
- }
- }
-
- /// <summary>
- /// Constructor.
- /// </summary>
- public CCGregorianEraHandler() {
- _Eras = new SortedList();
- }
-
- /// <summary>
- /// Method adds an era to the GregorianEraHandler instance.
- /// </summary>
- /// <param name="nr">The integer number of the era.
- /// </param>
- /// <param name="rd_start">The fixed day number defining the
- /// first day of the era.
- /// </param>
- /// <param name="rd_end">The fixed day number that defines the
- /// last day of the era.
- /// </param>
- public void appendEra(int nr, int rd_start, int rd_end) {
- Era era = new Era(nr, rd_start, rd_end);
- _Eras[(System.Object)nr] = era;
- }
- /// <summary>
- /// Method adds a yet not-ended era to the GregorianEraHandler
- /// instance.
- /// </summary>
- /// <param name="nr">The integer number of the era.
- /// </param>
- /// <param name="rd_start">The fixed day number defining the
- /// first day of the era.
- /// </param>
- public void appendEra(int nr, int rd_start) {
- appendEra(nr, rd_start,
- CCFixed.FromDateTime(DateTime.MaxValue));
- }
-
- /// <summary>
- /// This method computes the Gregorian year from the year
- /// of the given era.
- /// </summary>
- /// <param name="year">An integer giving the year in the
- /// era.
- /// </param>
- /// <param name="era">An integer giving the era number.
- /// </param>
- /// <returns>
- /// The Gregorian year as integer.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the year isn't valid in this
- /// era.
- /// </exception>
- public int GregorianYear(int year, int era) {
- Era e = (Era)_Eras[(System.Object)era];
- return e.GregorianYear(year);
- }
-
- /// <summary>
- /// This function returns the year of the era and sets
- /// the era in an output parameter.
- /// </summary>
- /// <param name="era">An output parameter returning the
- /// era number.
- /// </param>
- /// <param name="date">An integer giving the fixed day
- /// number.
- /// </param>
- /// <returns>An integer giving the year of the era.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the fixed day number is outside of the
- /// time spans of all eras.
- /// </exception>
- public int EraYear(out int era, int date)
- {
- IList list = _Eras.GetValueList();
-
- foreach (Era e in list) {
- if (e.Covers(date))
- return e.EraYear(out era, date);
- }
-
- throw new System.ArgumentOutOfRangeException("date",
- "Time value was out of era range.");
- }
-
- /// <summary>
- /// The method checks whether a given
- /// <see cref="T:System.DateTime"/> is covered by any era.
- /// </summary>
- /// <param name="time">A
- /// <see cref="T:System.DateTime"/> giving the date and time.
- /// </param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the argument isn't inside the time
- /// span of any era.
- /// </exception>
- public void CheckDateTime(System.DateTime time) {
- int date = CCFixed.FromDateTime(time);
-
- if (!ValidDate(date))
- throw new System.ArgumentOutOfRangeException("time",
- "Time value was out of era range.");
- }
-
- /// <summary>
- /// The method tests whether a given
- /// fixed day number is covered by any era.
- /// </summary>
- /// <param name="date">An integer representing the fixed day number.
- /// </param>
- /// <returns> A boolean is returned: true if the argument is inside
- /// the time span of one era; false otherwise.
- /// </returns>
- public bool ValidDate(int date) {
- IList list = _Eras.GetValueList();
-
- foreach (Era e in list) {
- if (e.Covers(date))
- return true;
- }
-
- return false;
- }
-
- /// <summary>
- /// The method tests, whether the era number does exist.
- /// </summary>
- /// <param name="era">An integer giving the era number.
- /// </param>
- /// <returns>A boole value: True if the era number does exist;
- /// false otherwise.
- /// </returns>
- public bool ValidEra(int era) {
- return _Eras.Contains((System.Object)era);
- }
-} // class CCGregorianEraHandler
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/ChangeLog b/mcs/class/corlib/System.Globalization/ChangeLog
deleted file mode 100644
index 3c46c318a52..00000000000
--- a/mcs/class/corlib/System.Globalization/ChangeLog
+++ /dev/null
@@ -1,109 +0,0 @@
-2002-06-12 Nick Drochak <ndrochak@gol.com>
-
- * DateTimeFormatInfo.cs: Reformat.
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * NumberFormatInfo.cs: Make NumberNegativePattern = 1 for the ctor
-
-2002-06-07 Nick Drochak <ndrochak@gol.com>
-
- * NumberFormatInfo.cs: Make InvariantInfo.NumberNegativePattern = 1
-
-2002-05-07 Rodrigo Moya <rodrigo@ximian.com>
-
- * CompareInfo.cs: new basic stub (compiles on Linux, so I assume
- it does not break the build on windows. Sorry if it does).
-
-2002-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * NumberFormatInfo.cs: always set the values for the invariant culture
- until there are more cultures supported.
-
-2002-04-22 Nick Drochak <ndrochak@gol.com>
-
- * NumberStyles.cs: Add [Serializable].
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * UnicodeCategory.cs: Fix typos in enum names.
-
-2002-03-04 Nick Drochak <ndrochak@gol.com>
-
- * JulianCalendar.cs: JulianEra should be field, not a property.
- Thanks CorCompare (and Piers).
-
-2002-02-12 Duncan Mak <duncan@ximian.com>
-
- * CultureInfo.cs: Added the Calendar property to make the TimeZone
- class build. It's marked as MonoTODO.
-
-2002-02-12 Nick Drochak <ndrochak@gol.com>
-
- * UnicodeCategory.cs: Fix typo.
-
-2002-02-01 Radek Doulik <rodo@ximian.com>
-
- * RegionInfo.cs: started work on RegionInfo
- implemented RegionInfo (string) constructor
-
- * CultureInfo.cs: added internal static function,
- which could be used from RegionInfo.cs
-
-2002-01-16 Miguel de Icaza <miguel@ximian.com>
-
- * CultureInfo.cs: Completed the tables. Now we need to actually
- fill it in.
-
-2002-01-15 Duncan Mak <duncan@ximian.com>
-
- * CultureInfo.cs: Convert it to unix text.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * GreogrianCalendar.cs : The same old MonoTODO attribute.
-
-2001-11-21 Miguel de Icaza <miguel@ximian.com>
-
- * Locale.cs: New file, a place holder for Locale.GetText.
-
-Wed Nov 14 16:47:07 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Calendar.cs: CLSCompliant updates.
-
-2001-11-04 Martin Weindel <martin.weindel@t-online.de>
- * NumberFormatInfo.cs: fixed minor bug in Clone with readonly flag
-
- * DateTimeFormatInfo.cs: added
-
- * CultureInfo.cs: some changed needed for compiling DateTimeFormatInfo.cs
-
-2001-10-26 Miguel de Icaza <miguel@ximian.com>
-
- * NumberFormatInfo.cs: Provide an internal constructor that takes
- as an argument a CultureInfo ID (LCID) so that we can construct
- different ones here.
-
- * CultureInfo.cs: Begun implementation.
-
-2001-10-09 Derek Holden <dholden@draper.com>
-
- * NumberFormatInfo.cs: Small typo in PercentPositivePattern
- and CurrencyPositivePattern
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * Calendar.cs: Implement a bunch of missing features.
-
-2001-07-24 Derek Holden <dholden@draper.com>
-
- * NumberStyles.cs: Added ECMA values for Allow types and default
- styles.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * DateTimeStyles.cs, NumberStyles.cs: Add.
-
-2001-07-06 Joe Shaw <joe@ximian.com>
-
- * UnicodeCategory.cs: Added.
diff --git a/mcs/class/corlib/System.Globalization/CompareInfo.cs b/mcs/class/corlib/System.Globalization/CompareInfo.cs
deleted file mode 100644
index 5e6fdee6e08..00000000000
--- a/mcs/class/corlib/System.Globalization/CompareInfo.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Globalization.CompareInfo
-//
-// Authors:
-// Rodrigo Moya (rodrigo@ximian.com)
-//
-// (C) Ximian, Inc. 2002
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Globalization
-{
- public class CompareInfo : IDeserializationCallback
- {
- [MonoTODO]
- void IDeserializationCallback.OnDeserialization(object sender)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/CompareOptions.cs b/mcs/class/corlib/System.Globalization/CompareOptions.cs
deleted file mode 100755
index 81be8d94504..00000000000
--- a/mcs/class/corlib/System.Globalization/CompareOptions.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-// 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
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum CompareOptions {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- IgnoreCase = 1,
-
- /// <summary>
- /// </summary>
- IgnoreNonSpace = 2,
-
- /// <summary>
- /// </summary>
- IgnoreSymbols = 4,
-
- /// <summary>
- /// </summary>
- IgnoreKanaType = 8,
-
- /// <summary>
- /// </summary>
- IgnoreWidth = 16,
-
- /// <summary>
- /// </summary>
- StringSort = 536870912,
-
- /// <summary>
- /// </summary>
- Ordinal = 1073741824,
- } // CompareOptions
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/CultureInfo.cs b/mcs/class/corlib/System.Globalization/CultureInfo.cs
deleted file mode 100644
index 36ed5d91c65..00000000000
--- a/mcs/class/corlib/System.Globalization/CultureInfo.cs
+++ /dev/null
@@ -1,850 +0,0 @@
-//
-// System.Globalization.CultureInfo
-//
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. 2001 (http://www.ximian.com)
-//
-
-using System.Threading;
-
-namespace System.Globalization
-{
- [Serializable]
- public class CultureInfo : IFormatProvider
- {
- static CultureInfo invariant_culture_info;
- bool is_read_only;
- int lcid;
- bool use_user_override;
- NumberFormatInfo number_format;
- DateTimeFormatInfo datetime_format;
-
- private static readonly string MSG_READONLY = "This instance is read only";
-
- // <summary>
- // Returns the Invariant Culture Information ("iv")
- // </summary>
- static public CultureInfo InvariantCulture {
- get {
- if (invariant_culture_info != null)
- return invariant_culture_info;
-
- invariant_culture_info = new CultureInfo (0x07f, false);
- invariant_culture_info.is_read_only = true;
-
- return invariant_culture_info;
- }
- }
-
- //
- // Initializes the CultureInfo object for the specific culture_id
- //
- void InitializeByID (int culture_id, bool use_user_override)
- {
- switch (culture_id){
- case 0x0001: // ar Arabic
- case 0x0401: // ar-SA Arabic (Saudi Arabia)
- case 0x0801: // ar-IQ Arabic (Iraq)
- case 0x0C01: // ar-EG Arabic (Egypt)
- case 0x1001: // ar-LY Arabic (Libya)
- case 0x1401: // ar-DZ Arabic (Algeria)
- case 0x1801: // ar-MA Arabic (Morocco)
- case 0x1C01: // ar-TN Arabic (Tunisia)
- case 0x2001: // ar-OM Arabic (Oman)
- case 0x2401: // ar-YE Arabic (Yemen)
- case 0x2801: // ar-SY Arabic (Syria)
- case 0x2C01: // ar-JO Arabic (Jordan)
- case 0x3001: // ar-LB Arabic (Lebanon)
- case 0x3401: // ar-KW Arabic (Kuwait)
- case 0x3801: // ar-AE Arabic (U.A.E.)
- case 0x3C01: // ar-BH Arabic (Bahrain)
- case 0x4001: // ar-QA Arabic (Qatar)
- case 0x0002: // bg Bulgarian
- case 0x0402: // bg-BG Bulgarian (Bulgaria)
- case 0x0003: // ca Catalan
- case 0x0403: // ca-ES Catalan (Spain)
- case 0x0004: // zh-CHS Chinese (Simplified)
- case 0x0404: // zh-TW Chinese (Taiwan)
- case 0x0804: // zh-CN Chinese (People's Republic of China)
- case 0x0C04: // zh-HK Chinese (Hong Kong S.A.R.)
- case 0x1004: // zh-SG Chinese (Singapore)
- case 0x1404: // zh-MO Chinese (Macau S.A.R.)
- case 0x7C04: // zh-CHT Chinese (Traditional)
- case 0x0005: // cs Czech
- case 0x0405: // cs-CZ Czech (Czech Republic)
- case 0x0006: // da Danish
- case 0x0406: // da-DK Danish (Denmark)
- case 0x0007: // de German
- case 0x0407: // de-DE German (Germany)
- case 0x0807: // de-CH German (Switzerland)
- case 0x0C07: // de-AT German (Austria)
- case 0x1007: // de-LU German (Luxembourg)
- case 0x1407: // de-LI German (Liechtenstein)
- case 0x0008: // el Greek
- case 0x0408: // el-GR Greek (Greece)
- case 0x0009: // en English
- case 0x0409: // en-US English (United States)
- case 0x0809: // en-GB English (United Kingdom)
- case 0x0C09: // en-AU English (Australia)
- case 0x1009: // en-CA English (Canada)
- case 0x1409: // en-NZ English (New Zealand)
- case 0x1809: // en-IE English (Ireland)
- case 0x1C09: // en-ZA English (South Africa)
- case 0x2009: // en-JM English (Jamaica)
- case 0x2409: // en-CB English (Caribbean)
- case 0x2809: // en-BZ English (Belize)
- case 0x2C09: // en-TT English (Trinidad and Tobago)
- case 0x3009: // en-ZW English (Zimbabwe)
- case 0x3409: // en-PH English (Republic of the Philippines)
- case 0x000A: // es Spanish
- case 0x080A: // es-MX Spanish (Mexico)
- case 0x0C0A: // es-ES Spanish (Spain)
- case 0x100A: // es-GT Spanish (Guatemala)
- case 0x140A: // es-CR Spanish (Costa Rica)
- case 0x180A: // es-PA Spanish (Panama)
- case 0x1C0A: // es-DO Spanish (Dominican Republic)
- case 0x200A: // es-VE Spanish (Venezuela)
- case 0x240A: // es-CO Spanish (Colombia)
- case 0x280A: // es-PE Spanish (Peru)
- case 0x2C0A: // es-AR Spanish (Argentina)
- case 0x300A: // es-EC Spanish (Ecuador)
- case 0x340A: // es-CL Spanish (Chile)
- case 0x380A: // es-UY Spanish (Uruguay)
- case 0x3C0A: // es-PY Spanish (Paraguay)
- case 0x400A: // es-BO Spanish (Bolivia)
- case 0x440A: // es-SV Spanish (El Salvador)
- case 0x480A: // es-HN Spanish (Honduras)
- case 0x4C0A: // es-NI Spanish (Nicaragua)
- case 0x500A: // es-PR Spanish (Puerto Rico)
- case 0x000B: // fi Finnish
- case 0x040B: // fi-FI Finnish (Finland)
- case 0x000C: // fr French
- case 0x040C: // fr-FR French (France)
- case 0x080C: // fr-BE French (Belgium)
- case 0x0C0C: // fr-CA French (Canada)
- case 0x100C: // fr-CH French (Switzerland)
- case 0x140C: // fr-LU French (Luxembourg)
- case 0x180C: // fr-MC French (Principality of Monaco)
- case 0x000D: // he Hebrew
- case 0x040D: // he-IL Hebrew (Israel)
- case 0x000E: // hu Hungarian
- case 0x040E: // hu-HU Hungarian (Hungary)
- case 0x000F: // is Icelandic
- case 0x040F: // is-IS Icelandic (Iceland)
- case 0x0010: // it Italian
- case 0x0410: // it-IT Italian (Italy)
- case 0x0810: // it-CH Italian (Switzerland)
- case 0x0011: // ja Japanese
- case 0x0411: // ja-JP Japanese (Japan)
- case 0x0012: // ko Korean
- case 0x0412: // ko-KR Korean (Korea)
- case 0x0013: // nl Dutch
- case 0x0413: // nl-NL Dutch (Netherlands)
- case 0x0813: // nl-BE Dutch (Belgium)
- case 0x0014: // no Norwegian
- case 0x0414: // nb-NO Norwegian (Bokmĺl) (Norway)
- case 0x0814: // nn-NO Norwegian (Nynorsk) (Norway)
- case 0x0015: // pl Polish
- case 0x0415: // pl-PL Polish (Poland)
- case 0x0016: // pt Portuguese
- case 0x0416: // pt-BR Portuguese (Brazil)
- case 0x0816: // pt-PT Portuguese (Portugal)
- case 0x0018: // ro Romanian
- case 0x0418: // ro-RO Romanian (Romania)
- case 0x0019: // ru Russian
- case 0x0419: // ru-RU Russian (Russia)
- case 0x001A: // hr Croatian
- case 0x041A: // hr-HR Croatian (Croatia)
- case 0x081A: // Lt-sr-SP Serbian (Latin) (Serbia)
- case 0x0C1A: // Cy-sr-SP Serbian (Cyrillic) (Serbia)
- case 0x001B: // sk Slovak
- case 0x041B: // sk-SK Slovak (Slovakia)
- case 0x001C: // sq Albanian
- case 0x041C: // sq-AL Albanian (Albania)
- case 0x001D: // sv Swedish
- case 0x041D: // sv-SE Swedish (Sweden)
- case 0x081D: // sv-FI Swedish (Finland)
- case 0x001E: // th Thai
- case 0x041E: // th-TH Thai (Thailand)
- case 0x001F: // tr Turkish
- case 0x041F: // tr-TR Turkish (Turkey)
- case 0x0020: // ur Urdu
- case 0x0420: // ur-PK Urdu (Islamic Republic of Pakistan)
- case 0x0021: // id Indonesian
- case 0x0421: // id-ID Indonesian (Indonesia)
- case 0x0022: // uk Ukrainian
- case 0x0422: // uk-UA Ukrainian (Ukraine)
- case 0x0023: // be Belarusian
- case 0x0423: // be-BY Belarusian (Belarus)
- case 0x0024: // sl Slovenian
- case 0x0424: // sl-SI Slovenian (Slovenia)
- case 0x0025: // et Estonian
- case 0x0425: // et-EE Estonian (Estonia)
- case 0x0026: // lv Latvian
- case 0x0426: // lv-LV Latvian (Latvia)
- case 0x0027: // lt Lithuanian
- case 0x0427: // lt-LT Lithuanian (Lithuania)
- case 0x0029: // fa Farsi
- case 0x0429: // fa-IR Farsi (Iran)
- case 0x002A: // vi Vietnamese
- case 0x042A: // vi-VN Vietnamese (Viet Nam)
- case 0x002B: // hy Armenian
- case 0x042B: // hy-AM Armenian (Armenia)
- case 0x002C: // az Azeri
- case 0x042C: // Lt-az-AZ Azeri (Latin) (Azerbaijan)
- case 0x082C: // Cy-az-AZ Azeri (Cyrillic) (Azerbaijan)
- case 0x002D: // eu Basque
- case 0x042D: // eu-ES Basque (Spain)
- case 0x002F: // mk FYRO Macedonian
- case 0x042F: // mk-MK FYRO Macedonian (Former Yugoslav Republic of Macedonia)
- case 0x0036: // af Afrikaans
- case 0x0436: // af-ZA Afrikaans (South Africa)
- case 0x0037: // ka Georgian
- case 0x0437: // ka-GE Georgian (Georgia)
- case 0x0038: // fo Faeroese
- case 0x0438: // fo-FO Faeroese (Faeroe Islands)
- case 0x0039: // hi Hindi
- case 0x0439: // hi-IN Hindi (India)
- case 0x003E: // ms Malay
- case 0x043E: // ms-MY Malay (Malaysia)
- case 0x083E: // ms-BN Malay (Brunei Darussalam)
- case 0x003F: // kk Kazakh
- case 0x043F: // kk-KZ Kazakh (Kazakhstan)
- case 0x0040: // ky Kyrgyz
- case 0x0440: // ky-KZ Kyrgyz (Kyrgyzstan)
- case 0x0041: // sw Swahili
- case 0x0441: // sw-KE Swahili (Kenya)
- case 0x0043: // uz Uzbek
- case 0x0443: // Lt-uz-UZ Uzbek (Latin) (Uzbekistan)
- case 0x0843: // Cy-uz-UZ Uzbek (Cyrillic) (Uzbekistan)
- case 0x0044: // tt Tatar
- case 0x0444: // tt-TA Tatar (Tatarstan)
- case 0x0046: // pa Punjabi
- case 0x0446: // pa-IN Punjabi (India)
- case 0x0047: // gu Gujarati
- case 0x0447: // gu-IN Gujarati (India)
- case 0x0049: // ta Tamil
- case 0x0449: // ta-IN Tamil (India)
- case 0x004A: // te Telugu
- case 0x044A: // te-IN Telugu (India)
- case 0x004B: // kn Kannada
- case 0x044B: // kn-IN Kannada (India)
- case 0x004E: // mr Marathi
- case 0x044E: // mr-IN Marathi (India)
- case 0x004F: // sa Sanskrit
- case 0x044F: // sa-IN Sanskrit (India)
- case 0x0050: // mn Mongolian
- case 0x0450: // mn-MN Mongolian (Mongolia)
- case 0x0056: // gl Galician
- case 0x0456: // gl-ES Galician (Spain)
- case 0x0057: // kok Konkani
- case 0x0457: // kok-IN Konkani (India)
- case 0x005A: // syr Syriac
- case 0x045A: // syr-SY Syriac (Syria)
- case 0x0065: // div Divehi
- case 0x0465: // div-MV Divehi (Maldives)
- case 0x007F: // Invariant Language (Invariant Country)
- break;
-
- default:
- throw new ArgumentException ("CultureInfoCode");
- }
- lcid = culture_id;
- this.use_user_override = use_user_override;
- }
-
- //
- // Maps a name to a culture id
- //
- static int NameToID (string name)
- {
- switch (name){
- case "ar":
- return 0x0001;
- case "ar-SA":
- return 0x0401;
- case "ar-IQ":
- return 0x0801;
- case "ar-EG":
- return 0x0C01;
- case "ar-LY":
- return 0x1001;
- case "ar-DZ":
- return 0x1401;
- case "ar-MA":
- return 0x1801;
- case "ar-TN":
- return 0x1C01;
- case "ar-OM":
- return 0x2001;
- case "ar-YE":
- return 0x2401;
- case "ar-SY":
- return 0x2801;
- case "ar-JO":
- return 0x2C01;
- case "ar-LB":
- return 0x3001;
- case "ar-KW":
- return 0x3401;
- case "ar-AE":
- return 0x3801;
- case "ar-BH":
- return 0x3C01;
- case "ar-QA":
- return 0x4001;
- case "bg":
- return 0x0002;
- case "bg-BG":
- return 0x0402;
- case "ca":
- return 0x0003;
- case "ca-ES":
- return 0x0403;
- case "zh-CHS":
- return 0x0004;
- case "zh-TW":
- return 0x0404;
- case "zh-CN":
- return 0x0804;
- case "zh-HK":
- return 0x0C04;
- case "zh-SG":
- return 0x1004;
- case "zh-MO":
- return 0x1404;
- case "zh-CHT":
- return 0x7C04;
- case "cs":
- return 0x0005;
- case "cs-CZ":
- return 0x0405;
- case "da":
- return 0x0006;
- case "da-DK":
- return 0x0406;
- case "de":
- return 0x0007;
- case "de-DE":
- return 0x0407;
- case "de-CH":
- return 0x0807;
- case "de-AT":
- return 0x0C07;
- case "de-LU":
- return 0x1007;
- case "de-LI":
- return 0x1407;
- case "el":
- return 0x0008;
- case "el-GR":
- return 0x0408;
- case "en":
- return 0x0009;
- case "en-US":
- return 0x0409;
- case "en-GB":
- return 0x0809;
- case "en-AU":
- return 0x0C09;
- case "en-CA":
- return 0x1009;
- case "en-NZ":
- return 0x1409;
- case "en-IE":
- return 0x1809;
- case "en-ZA":
- return 0x1C09;
- case "en-JM":
- return 0x2009;
- case "en-CB":
- return 0x2409;
- case "en-BZ":
- return 0x2809;
- case "en-TT":
- return 0x2C09;
- case "en-ZW":
- return 0x3009;
- case "en-PH":
- return 0x3409;
- case "es":
- return 0x000A;
- case "es-MX":
- return 0x080A;
- case "es-ES":
- return 0x0C0A;
- case "es-GT":
- return 0x100A;
- case "es-CR":
- return 0x140A;
- case "es-PA":
- return 0x180A;
- case "es-DO":
- return 0x1C0A;
- case "es-VE":
- return 0x200A;
- case "es-CO":
- return 0x240A;
- case "es-PE":
- return 0x280A;
- case "es-AR":
- return 0x2C0A;
- case "es-EC":
- return 0x300A;
- case "es-CL":
- return 0x340A;
- case "es-UY":
- return 0x380A;
- case "es-PY":
- return 0x3C0A;
- case "es-BO":
- return 0x400A;
- case "es-SV":
- return 0x440A;
- case "es-HN":
- return 0x480A;
- case "es-NI":
- return 0x4C0A;
- case "es-PR":
- return 0x500A;
- case "fi":
- return 0x000B;
- case "fi-FI":
- return 0x040B;
- case "fr":
- return 0x000C;
- case "fr-FR":
- return 0x040C;
- case "fr-BE":
- return 0x080C;
- case "fr-CA":
- return 0x0C0C;
- case "fr-CH":
- return 0x100C;
- case "fr-LU":
- return 0x140C;
- case "fr-MC":
- return 0x180C;
- case "he":
- return 0x000D;
- case "he-IL":
- return 0x040D;
- case "hu":
- return 0x000E;
- case "hu-HU":
- return 0x040E;
- case "is":
- return 0x000F;
- case "is-IS":
- return 0x040F;
- case "it":
- return 0x0010;
- case "it-IT":
- return 0x0410;
- case "it-CH":
- return 0x0810;
- case "ja":
- return 0x0011;
- case "ja-JP":
- return 0x0411;
- case "ko":
- return 0x0012;
- case "ko-KR":
- return 0x0412;
- case "nl":
- return 0x0013;
- case "nl-NL":
- return 0x0413;
- case "nl-BE":
- return 0x0813;
- case "no":
- return 0x0014;
- case "nb-NO":
- return 0x0414;
- case "nn-NO":
- return 0x0814;
- case "pl":
- return 0x0015;
- case "pl-PL":
- return 0x0415;
- case "pt":
- return 0x0016;
- case "pt-BR":
- return 0x0416;
- case "pt-PT":
- return 0x0816;
- case "ro":
- return 0x0018;
- case "ro-RO":
- return 0x0418;
- case "ru":
- return 0x0019;
- case "ru-RU":
- return 0x0419;
- case "hr":
- return 0x001A;
- case "hr-HR":
- return 0x041A;
- case "Lt-sr-SP":
- return 0x081A;
- case "Cy-sr-SP":
- return 0x0C1A;
- case "sk":
- return 0x001B;
- case "sk-SK":
- return 0x041B;
- case "sq":
- return 0x001C;
- case "sq-AL":
- return 0x041C;
- case "sv":
- return 0x001D;
- case "sv-SE":
- return 0x041D;
- case "sv-FI":
- return 0x081D;
- case "th":
- return 0x001E;
- case "th-TH":
- return 0x041E;
- case "tr":
- return 0x001F;
- case "tr-TR":
- return 0x041F;
- case "ur":
- return 0x0020;
- case "ur-PK":
- return 0x0420;
- case "id":
- return 0x0021;
- case "id-ID":
- return 0x0421;
- case "uk":
- return 0x0022;
- case "uk-UA":
- return 0x0422;
- case "be":
- return 0x0023;
- case "be-BY":
- return 0x0423;
- case "sl":
- return 0x0024;
- case "sl-SI":
- return 0x0424;
- case "et":
- return 0x0025;
- case "et-EE":
- return 0x0425;
- case "lv":
- return 0x0026;
- case "lv-LV":
- return 0x0426;
- case "lt":
- return 0x0027;
- case "lt-LT":
- return 0x0427;
- case "fa":
- return 0x0029;
- case "fa-IR":
- return 0x0429;
- case "vi":
- return 0x002A;
- case "vi-VN":
- return 0x042A;
- case "hy":
- return 0x002B;
- case "hy-AM":
- return 0x042B;
- case "az":
- return 0x002C;
- case "Lt-az-AZ":
- return 0x042C;
- case "Cy-az-AZ":
- return 0x082C;
- case "eu":
- return 0x002D;
- case "eu-ES":
- return 0x042D;
- case "mk":
- return 0x002F;
- case "mk-MK":
- return 0x042F;
- case "af":
- return 0x0036;
- case "af-ZA":
- return 0x0436;
- case "ka":
- return 0x0037;
- case "ka-GE":
- return 0x0437;
- case "fo":
- return 0x0038;
- case "fo-FO":
- return 0x0438;
- case "hi":
- return 0x0039;
- case "hi-IN":
- return 0x0439;
- case "ms":
- return 0x003E;
- case "ms-MY":
- return 0x043E;
- case "ms-BN":
- return 0x083E;
- case "kk":
- return 0x003F;
- case "kk-KZ":
- return 0x043F;
- case "ky":
- return 0x0040;
- case "ky-KZ":
- return 0x0440;
- case "sw":
- return 0x0041;
- case "sw-KE":
- return 0x0441;
- case "uz":
- return 0x0043;
- case "Lt-uz-UZ":
- return 0x0443;
- case "Cy-uz-UZ":
- return 0x0843;
- case "tt":
- return 0x0044;
- case "tt-TA":
- return 0x0444;
- case "pa":
- return 0x0046;
- case "pa-IN":
- return 0x0446;
- case "gu":
- return 0x0047;
- case "gu-IN":
- return 0x0447;
- case "ta":
- return 0x0049;
- case "ta-IN":
- return 0x0449;
- case "te":
- return 0x004A;
- case "te-IN":
- return 0x044A;
- case "kn":
- return 0x004B;
- case "kn-IN":
- return 0x044B;
- case "mr":
- return 0x004E;
- case "mr-IN":
- return 0x044E;
- case "sa":
- return 0x004F;
- case "sa-IN":
- return 0x044F;
- case "mn":
- return 0x0050;
- case "mn-MN":
- return 0x0450;
- case "gl":
- return 0x0056;
- case "gl-ES":
- return 0x0456;
- case "kok":
- return 0x0057;
- case "kok-IN":
- return 0x0457;
- case "syr":
- return 0x005A;
- case "syr-SY":
- return 0x045A;
- case "div":
- return 0x0065;
- case "div-MV":
- return 0x0465;
- case "":
- return 0x007F;
- }
- return -1;
- }
-
- // <summary>
- // Creates a CultureInfo for a specific ID
- // </summary>
- public static CultureInfo CreateSpecificCulture (string name)
- {
- if (name == null)
- throw new ArgumentNullException ();
-
- int id = NameToID (name);
-
- if (id == -1)
- throw new ArgumentException ("name");
-
- return new CultureInfo (id, false);
- }
-
- /// <summary>
- /// CultureInfo instance that represents the culture used by the current thread
- /// </summary>
- public static CultureInfo CurrentCulture
- {
- get
- {
- return Thread.CurrentThread.CurrentCulture;
- }
-
- set
- {
- Thread.CurrentThread.CurrentCulture = value;
- }
- }
-
- /// <summary>
- /// CultureInfo instance that represents the current culture used by the ResourceManager to look up culture-specific resources at run time
- /// </summary>
- public static CultureInfo CurrentUICulture
- {
- get
- {
- return Thread.CurrentThread.CurrentUICulture;
- }
-
- set
- {
- Thread.CurrentThread.CurrentUICulture = value;
- }
- }
-
-
- public virtual int LCID {
- get {
- return lcid;
- }
- }
-
- // <summary>
- // Gets the string-encoded name of the culture
- // </summary>
- public virtual string Name {
- get {
- switch (lcid){
- case 0x007f:
- return "iv";
- }
- throw new Exception ("Miss constructed object for LCID: " + lcid);
- }
- }
-
- [MonoTODO]
- public virtual Calendar Calendar
- {
- get { return null; }
- }
-
- internal static bool IsIDNeutralCulture (int lcid) {
- return (lcid & 0xff00) == 0;
- }
-
- // <summary>
- // Returns whether the current culture is neutral (neutral cultures
- // only specify a language, not a country.
- // </summary>
- public virtual bool IsNeutralCulture {
- get {
- return IsIDNeutralCulture (lcid);
- }
- }
- // <summary>
- // Returns the NumberFormat for the current lcid
- // </summary>
- public virtual NumberFormatInfo NumberFormat {
- get {
- if (number_format == null){
- lock (this){
- if (number_format == null)
- number_format = new NumberFormatInfo (lcid);
- }
- }
-
- return number_format;
- }
-
- set {
- if (is_read_only) throw new InvalidOperationException(MSG_READONLY);
-
- if (value == null)
- throw new ArgumentNullException ("NumberFormat");
-
- number_format = value;
- }
- }
-
- public virtual DateTimeFormatInfo DateTimeFormat
- {
- get
- {
- if (datetime_format == null)
- {
- lock (this)
- {
- if (datetime_format == null)
- datetime_format = new DateTimeFormatInfo();
- }
- }
-
- return datetime_format;
- }
-
- set
- {
- if (is_read_only) throw new InvalidOperationException(MSG_READONLY);
-
- if (value == null)
- throw new ArgumentNullException ("DateTimeFormat");
-
- datetime_format = value;
- }
- }
-
- //
- // IFormatProvider implementation
- //
- public virtual object GetFormat( Type formatType )
- {
- object format = null;
-
- if ( formatType == typeof(NumberFormatInfo) )
- format = NumberFormat;
- else if ( formatType == typeof(DateTimeFormatInfo) )
- format = DateTimeFormat;
-
- return format;
- }
-
- //
- // Constructors
- //
- public CultureInfo (int culture, bool use_user_override)
- {
- if (culture < 0)
- throw new ArgumentOutOfRangeException ();
-
- InitializeByID (culture, use_user_override);
- }
-
- public CultureInfo (int culture) : this (culture, false)
- {
- }
-
- public CultureInfo (string name, bool use_user_override)
- {
- if (name == null)
- throw new ArgumentNullException ();
-
- InitializeByID (NameToID (name), use_user_override);
- }
-
- public CultureInfo (string name) : this (name, false) {}
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/CultureTypes.cs b/mcs/class/corlib/System.Globalization/CultureTypes.cs
deleted file mode 100755
index 7218b10150e..00000000000
--- a/mcs/class/corlib/System.Globalization/CultureTypes.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum CultureTypes {
-
- /// <summary>
- /// </summary>
- NeutralCultures = 1,
-
- /// <summary>
- /// </summary>
- SpecificCultures = 2,
-
- /// <summary>
- /// </summary>
- InstalledWin32Cultures = 4,
-
- /// <summary>
- /// </summary>
- AllCultures = 7,
-
- } // CultureTypes
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs b/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs
deleted file mode 100644
index 82ecd5ec3fe..00000000000
--- a/mcs/class/corlib/System.Globalization/DateTimeFormatInfo.cs
+++ /dev/null
@@ -1,609 +0,0 @@
-// System.Globalization.DateTimeFormatInfo
-//
-// Some useful functions are missing in the ECMA specs.
-// They have been added following MS SDK Beta2
-//
-// Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel (martin.weindel@t-online.de)
-
-using System;
-
-using System.Threading;
-
-
-namespace System.Globalization
-{
-
- [Serializable]
-
- public sealed class DateTimeFormatInfo : ICloneable, IFormatProvider {
-
- private static readonly string MSG_READONLY = "This instance is read only";
- private static readonly string MSG_ARRAYSIZE_MONTH = "An array with exactly 13 elements is needed";
- private static readonly string MSG_ARRAYSIZE_DAY = "An array with exactly 7 elements is needed";
- private static readonly string[] INVARIANT_ABBREVIATED_DAY_NAMES
- = new string[7] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
- private static readonly string[] INVARIANT_DAY_NAMES
- = new string[7] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
- private static readonly string[] INVARIANT_ABBREVIATED_MONTH_NAMES
- = new string[13] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""};
- private static readonly string[] INVARIANT_MONTH_NAMES
- = new string[13] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""};
-
- public static DateTimeFormatInfo theInvariantDateTimeFormatInfo;
-
- private bool readOnly;
-
- private string _AMDesignator;
-
- private string _PMDesignator;
-
- private string _DateSeparator;
-
- private string _TimeSeparator;
-
- private string _ShortDatePattern;
-
- private string _LongDatePattern;
-
- private string _ShortTimePattern;
-
- private string _LongTimePattern;
-
- private string _MonthDayPattern;
-
- private string _YearMonthPattern;
-
- private string _FullDateTimePattern;
-
- private string _RFC1123Pattern;
-
- private string _SortableDateTimePattern;
-
- private string _UniversalSortableDateTimePattern;
-
- private DayOfWeek _FirstDayOfWeek;
-
- private Calendar _Calendar;
-
- private CalendarWeekRule _CalendarWeekRule;
-
- private string[] _AbbreviatedDayNames;
-
- private string[] _DayNames;
-
- private string[] _MonthNames;
-
- private string[] _AbbreviatedMonthNames;
-
-
- public DateTimeFormatInfo()
-
- {
-
- readOnly = false;
-
- _AMDesignator = "AM";
-
- _PMDesignator = "PM";
-
- _DateSeparator = "/";
-
- _TimeSeparator = ":";
-
- _ShortDatePattern = "MM/dd/yyyy";
-
- _LongDatePattern = "dddd, dd MMMM yyyy";
-
- _ShortTimePattern = "HH:mm";
-
- _LongTimePattern = "HH:mm:ss";
-
- _MonthDayPattern = "MMMM dd";
-
- _YearMonthPattern = "yyyy MMMM";
-
- _FullDateTimePattern = "dddd, dd MMMM yyyy HH:mm:ss";
-
- // FIXME for the following three pattern: "The default value of this property is
- //derived from the calendar that is set for CultureInfo.CurrentCulture or the default
- //calendar of CultureInfo.CurrentCulture."
-
- _RFC1123Pattern = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
-
- _SortableDateTimePattern = "yyyy'-'MM'-'dd'T'HH':'mm':'ss";
-
- _UniversalSortableDateTimePattern = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
-
-
-
- _FirstDayOfWeek = DayOfWeek.Sunday;
-
- _Calendar = new GregorianCalendar();
-
- _CalendarWeekRule = CalendarWeekRule.FirstDay;
-
-
- _AbbreviatedDayNames = INVARIANT_ABBREVIATED_DAY_NAMES;
-
- _DayNames = INVARIANT_DAY_NAMES;
-
- _AbbreviatedMonthNames = INVARIANT_ABBREVIATED_MONTH_NAMES;
-
- _MonthNames = INVARIANT_MONTH_NAMES;
-
- }
-
-
-
- // LAMESPEC: this is not in ECMA specs
-
- public static DateTimeFormatInfo GetInstance(IFormatProvider provider)
-
- {
-
- if (provider != null) {
-
- DateTimeFormatInfo dtfi;
-
- dtfi = (DateTimeFormatInfo)provider.GetFormat(typeof(DateTimeFormatInfo));
-
- if (dtfi != null)
-
- return dtfi;
-
- }
-
-
- return CurrentInfo;
-
- }
-
-
-
- public bool IsReadOnly {
-
- get {
-
- return readOnly;
-
- }
-
- }
-
-
-
- public static DateTimeFormatInfo ReadOnly(DateTimeFormatInfo dtfi)
-
- {
-
- DateTimeFormatInfo copy = (DateTimeFormatInfo)dtfi.Clone();
-
- copy.readOnly = true;
-
- return copy;
-
- }
-
-
-
- public object Clone ()
-
- {
-
- DateTimeFormatInfo clone = (DateTimeFormatInfo) MemberwiseClone();
-
- // clone is not read only
-
- clone.readOnly = false;
-
- return clone;
-
- }
-
-
-
- public object GetFormat(Type formatType)
- {
- return (formatType == GetType()) ? this : null;
- }
-
- public string GetAbbreviatedEraName(int era)
- {
- if (era < _Calendar.Eras.Length || era >= _Calendar.Eras.Length)
- throw new ArgumentOutOfRangeException();
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- public string GetAbbreviatedMonthName(int month)
- {
- if (month < 1 || month > 13) throw new ArgumentOutOfRangeException();
- return _AbbreviatedMonthNames[month-1];
- }
-
- public int GetEra(string eraName)
- {
- if (eraName == null) throw new ArgumentNullException();
- eraName = eraName.ToUpper();
- notImplemented();
- //FIXME: implement me
- return -1;
- }
-
- public string GetEraName(int era)
- {
- if (era < _Calendar.Eras.Length || era >= _Calendar.Eras.Length)
- throw new ArgumentOutOfRangeException();
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- public string GetMonthName(int month)
- {
- if (month < 1 || month > 13) throw new ArgumentOutOfRangeException();
- return _MonthNames[month-1];
- }
-
- public string[] AbbreviatedDayNames
- {
- get
- {
- return (string[]) _AbbreviatedDayNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 7) throw new ArgumentException(MSG_ARRAYSIZE_DAY);
- _AbbreviatedDayNames = (string[]) value.Clone();
- }
- }
-
- public string[] AbbreviatedMonthNames
- {
- get
- {
- return (string[]) _AbbreviatedMonthNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 13) throw new ArgumentException(MSG_ARRAYSIZE_MONTH);
- _AbbreviatedMonthNames = (string[]) value.Clone();
- }
- }
-
- public string[] DayNames
- {
- get
- {
- return (string[]) _DayNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 7) throw new ArgumentException(MSG_ARRAYSIZE_DAY);
- _DayNames = (string[]) value.Clone();
- }
- }
-
- public string[] MonthNames
- {
- get
- {
- return (string[]) _MonthNames.Clone();
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- if (value.GetLength(0) != 13) throw new ArgumentException(MSG_ARRAYSIZE_MONTH);
- _MonthNames = (string[]) value.Clone();
- }
- }
-
- public string AMDesignator
- {
- get
- {
- return _AMDesignator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _AMDesignator = value;
- }
- }
-
- public string PMDesignator
- {
- get
- {
- return _PMDesignator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _PMDesignator = value;
- }
- }
-
- public string DateSeparator
- {
- get
- {
- return _DateSeparator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _DateSeparator = value;
- }
- }
-
- public string TimeSeparator
- {
- get
- {
- return _TimeSeparator;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _TimeSeparator = value;
- }
- }
-
- public string LongDatePattern
- {
- get
- {
- return _LongDatePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _LongDatePattern = value;
- }
- }
-
- public string ShortDatePattern
- {
- get
- {
- return _ShortDatePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _ShortDatePattern = value;
- }
- }
-
- public string ShortTimePattern
- {
- get
- {
- return _ShortTimePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _ShortTimePattern = value;
- }
- }
-
- public string LongTimePattern
- {
- get
- {
- return _LongTimePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _LongTimePattern = value;
- }
- }
-
- public string MonthDayPattern
- {
- get
- {
- return _MonthDayPattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _MonthDayPattern = value;
- }
- }
-
- public string YearMonthPattern
- {
- get
- {
- return _YearMonthPattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _YearMonthPattern = value;
- }
- }
-
- public string FullDateTimePattern
- {
- get
- {
- return _FullDateTimePattern;
- }
-
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _FullDateTimePattern = value;
- }
- }
-
- public static DateTimeFormatInfo CurrentInfo
- {
- get
- {
- return Thread.CurrentThread.CurrentCulture.DateTimeFormat;
- }
- }
-
- public static DateTimeFormatInfo InvariantInfo
- {
- get
- {
- if (theInvariantDateTimeFormatInfo == null)
- {
- theInvariantDateTimeFormatInfo =
- DateTimeFormatInfo.ReadOnly(new DateTimeFormatInfo());
- }
- return theInvariantDateTimeFormatInfo;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public DayOfWeek FirstDayOfWeek
- {
- get
- {
- return _FirstDayOfWeek;
- }
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if ((int) value < 0 || (int) value > 6) throw new ArgumentOutOfRangeException();
- _FirstDayOfWeek = value;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public Calendar Calendar
- {
- get
- {
- return _Calendar;
- }
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- if (value == null) throw new ArgumentNullException();
- _Calendar = value;
- }
- }
-
- public CalendarWeekRule CalendarWeekRule
- {
- get
- {
- return _CalendarWeekRule;
- }
- set
- {
- if (IsReadOnly) throw new InvalidOperationException(MSG_READONLY);
- _CalendarWeekRule = value;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string RFC1123Pattern
- {
- get
- {
- return _RFC1123Pattern;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string SortableDateTimePattern
- {
- get
- {
- return _SortableDateTimePattern;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string UniversalSortableDateTimePattern
- {
- get
- {
- return _UniversalSortableDateTimePattern;
- }
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string[] GetAllDateTimePatterns()
- {
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string[] GetAllDateTimePatterns(char format)
- {
- notImplemented();
- //FIXME: implement me
- return null;
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string GetDayName(DayOfWeek dayofweek)
- {
- int index = (int) dayofweek;
- if (index < 0 || index > 6) throw new ArgumentOutOfRangeException();
- return _DayNames[index];
- }
-
- // LAMESPEC: this is not in ECMA specs
- public string GetAbbreviatedDayName(DayOfWeek dayofweek)
- {
- int index = (int) dayofweek;
- if (index < 0 || index > 6) throw new ArgumentOutOfRangeException();
- return _AbbreviatedDayNames[index];
- }
-
- private static void notImplemented()
- {
- throw new Exception("Not implemented");
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Globalization/DateTimeStyles.cs b/mcs/class/corlib/System.Globalization/DateTimeStyles.cs
deleted file mode 100644
index 0e65c4d966d..00000000000
--- a/mcs/class/corlib/System.Globalization/DateTimeStyles.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum DateTimeStyles {
-
- /// <summary>
- /// </summary>
- None = 0x00000000,
-
- /// <summary>
- /// </summary>
- AllowLeadingWhite = 0x00000001,
-
- /// <summary>
- /// </summary>
- AllowTrailingWhite = 0x00000002,
-
- /// <summary>
- /// </summary>
- AllowInnerWhite = 0x00000004,
-
- /// <summary>
- /// </summary>
- AllowWhiteSpaces = AllowLeadingWhite | AllowTrailingWhite | AllowInnerWhite,
-
- /// <summary>
- /// </summary>
- NoCurrentDateDefault = 0x00000008,
-
- /// <summary>
- /// </summary>
- AdjustToUniversal = 0x00000010,
- } // DateTimeStyles
-
-} // System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/DaylightTime.cs b/mcs/class/corlib/System.Globalization/DaylightTime.cs
deleted file mode 100755
index 64fc092f94f..00000000000
--- a/mcs/class/corlib/System.Globalization/DaylightTime.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Globalization.DaylightTime
-//
-// Author:
-// Chris Hynes (chrish@assistedsolutions.com)
-//
-// (C) 2001 Chris Hynes
-//
-
-using System.Globalization;
-
-namespace System.Globalization
-{
- [Serializable]
- public class DaylightTime
- {
- DateTime start, end;
- TimeSpan delta;
-
- public DaylightTime(DateTime start, DateTime end, TimeSpan delta)
- {
- this.start = start;
- this.end = end;
- this.delta = delta;
- }
-
- public DateTime Start
- {
- get
- {
- return start;
- }
- }
-
- public DateTime End
- {
- get
- {
- return end;
- }
- }
-
- public TimeSpan Delta
- {
- get
- {
- return delta;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/GregorianCalendar.cs b/mcs/class/corlib/System.Globalization/GregorianCalendar.cs
deleted file mode 100644
index 54c9f44de49..00000000000
--- a/mcs/class/corlib/System.Globalization/GregorianCalendar.cs
+++ /dev/null
@@ -1,448 +0,0 @@
-// GregorianCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-
-/// <summary>
-/// This is the Gregorian calendar.
-/// </summary>
-/// <remarks>
-/// <para>The Gregorian calendar supports only the Common Era from
-/// the Gregorian year 1 to the Gregorian year 9999.
-/// </para>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class GregorianCalendar : Calendar {
- /// <summary>
- /// The era number for the Common Era (C.E.) or Anno Domini (A.D.)
- /// respective.
- /// </summary>
- public const int ADEra = 1;
-
- /// <value>Overridden. Gives the eras supported by the Gregorian
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return new int[] { ADEra };
- }
- }
-
- /// <summary>
- /// A protected member storing the
- /// <see cref="T:System.Globalization.GregorianCalendarTypes"/>.
- /// </summary>
- internal GregorianCalendarTypes M_CalendarType;
-
- /// <value>
- /// The property stores the
- /// <see cref="T:System.Globalization.GregorianCalendarTypes"/>.
- /// </value>
- public virtual GregorianCalendarTypes CalendarType {
- get { return M_CalendarType; }
- set {
- // mscorlib 1:0:33000:0 doesn't check anything here
- M_CalendarType = value;
- }
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:ADEra"/>.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = ADEra;
- if (era != ADEra)
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:ADEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the allowed range.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckEra(ref era);
- M_ArgumentInRange("year", year, 1, 9999);
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:ADEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYME(int year, int month, ref int era) {
- M_CheckYE(year, ref era);
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException("month",
- "Month must be between one and twelve.");
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:ADEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYMDE(int year, int month, int day, ref int era)
- {
- M_CheckYME(year, month, ref era);
- M_ArgumentInRange("day", day, 1,
- GetDaysInMonth(year, month, era));
- }
-
- /// <summary>
- /// Overridden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddMonths(DateTime time, int months) {
- return CCGregorianCalendar.AddMonths(time, months);
- }
-
- /// <summary>
- /// Overridden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddYears(DateTime time, int years) {
- return CCGregorianCalendar.AddYears(time, years);
- }
-
- /// <summary>
- /// Overridden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override int GetDayOfMonth(DateTime time) {
- return CCGregorianCalendar.GetDayOfMonth(time);
- }
-
- /// <summary>
- /// Overridden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- public override int GetDayOfYear(DateTime time) {
- return CCGregorianCalendar.GetDayOfYear(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An intger that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- // mscorlib doesn't check year, probably a bug; we do
- M_CheckYME(year, month, ref era);
- return CCGregorianCalendar.GetDaysInMonth(year, month);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> is outside the allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- M_CheckYE(year, ref era);
- return CCGregorianCalendar.GetDaysInYear(year);
- }
-
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- public override int GetEra(DateTime time) {
- return ADEra;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- public override int GetMonth(DateTime time) {
- return CCGregorianCalendar.GetMonth(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYE(year, ref era);
- return 12;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- public override int GetYear(DateTime time) {
- return CCGregorianCalendar.GetYear(time);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- return CCGregorianCalendar.IsLeapDay(year, month, day);
- }
-
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYME(year, month, ref era);
- return false;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- M_CheckYE(year, ref era);
- return CCGregorianCalendar.is_leap_year(year);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- return CCGregorianCalendar.ToDateTime(
- year, month, day,
- hour, minute, second, milliseconds);
- }
-
- /// <summary>
- /// Constructor that sets the
- /// Gregorian calendar type (
- /// <see cref="T:System.Globalization.GregorianCalendarTypes"/>).
- /// </summary>
- /// <param name="type">The parameter specifies the Gregorian
- /// calendar type.
- /// </param>
- public GregorianCalendar(GregorianCalendarTypes type) {
- CalendarType = type;
- M_AbbrEraNames = new string[] {"C.E."};
- M_EraNames = new string[] {"Common Era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 2029;
- }
-
- /// <summary>
- /// Default constructor. Sets the Gregorian calendar type to
- /// <see
- /// cref="F:System.Globalization.GregorianCalendarTypes.Localized"/>.
- /// </summary>
- public GregorianCalendar() : this(GregorianCalendarTypes.Localized) {}
-} // class GregorianCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs b/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs
deleted file mode 100755
index 2d571fdd13b..00000000000
--- a/mcs/class/corlib/System.Globalization/GregorianCalendarTypes.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// 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
-
-
-namespace System.Globalization {
-
-
- /// <summary>
- /// </summary>
- 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
diff --git a/mcs/class/corlib/System.Globalization/HebrewCalendar.cs b/mcs/class/corlib/System.Globalization/HebrewCalendar.cs
deleted file mode 100644
index 0162fd580bf..00000000000
--- a/mcs/class/corlib/System.Globalization/HebrewCalendar.cs
+++ /dev/null
@@ -1,861 +0,0 @@
-// HebrewCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-using System.IO;
-
-/// <summary>
-/// This is the Hebrew calendar.
-/// </summary>
-/// <remarks>
-/// <para>The Hebrew calendar supports only years between 5343 A.M. and
-/// 6000 A.M. This has been done to be compatible with .NET.
-/// </para>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class HebrewCalendar : Calendar {
- /// <summary>
- /// Constructor.
- /// </summary>
- public HebrewCalendar() {
- M_AbbrEraNames = new string[] {"A.M."};
- M_EraNames = new string[] {"Anno Mundi"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 5790;
- }
-
- /// <summary>
- /// The era number for the Anno Mundi (A.M.) era, called
- /// plain HebrewEra.
- /// </summary>
- public static readonly int HebrewEra = 1;
-
- /// <summary>
- /// The
- /// <see cref="T:System.DateTime"/> ticks for first day of year
- /// 5343 A.M.
- /// </summary>
- internal const long M_MinTicks = 499147488000000000L;
- /// <summary>
- /// The number of
- /// <see cref="T:System.DateTime"/> ticks for the last day of year
- /// 6000 A.M.
- /// </summary>
- internal const long M_MaxTicks = 706783967999999999L;
- /// <summary>
- /// The minimum year in the A.M. era supported.
- /// </summary>
- internal const int M_MinYear = 5343;
- /// <summary>
- /// The maximum year supported in the A.M. era.
- /// </summary>
- internal override int M_MaxYear {
- get { return 6000; }
- }
-
- /// <value>Overridden. Gives the eras supported by the Gregorian
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return new int[] { HebrewEra };
- }
- }
-
- /// <summary>
- /// A protected member checking a
- /// <see cref="T:System.DateTime"/> value.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/>
- /// to check.
- /// </param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- internal void M_CheckDateTime(DateTime time) {
- if (time.Ticks < M_MinTicks || time.Ticks > M_MaxTicks)
- throw new ArgumentOutOfRangeException(
- "time",
- "Only hebrew years between 5343 and 6000," +
- " inclusive, are supported.");
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HebrewEra"/>.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = HebrewEra;
- if (era != HebrewEra)
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HebrewEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the allowed range.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckEra(ref era);
- if (year < M_MinYear || year > M_MaxYear)
- throw new ArgumentOutOfRangeException(
- "year",
- "Only hebrew years between 5343 and 6000," +
- " inclusive, are supported.");
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HebrewEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYME(int year, int month, ref int era) {
- M_CheckYE(year, ref era);
- int l = CCHebrewCalendar.last_month_of_year(year);
- if (month < 1 || month > l) {
- StringWriter sw = new StringWriter();
- sw.Write("Month must be between 1 and {0}.", l);
- throw new ArgumentOutOfRangeException("month",
- sw.ToString());
- }
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HebrewEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYMDE(int year, int month, int day,
- ref int era)
- {
- M_CheckYME(year, month, ref era);
- M_ArgumentInRange("day", day, 1, GetDaysInMonth(year, month,
- era));
- }
-
- /// <summary>
- /// Overridden. Adds days to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// days.
- /// </param>
- /// <param name="days">The number of days to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="days"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddDays(DateTime time, int days) {
- DateTime t = base.AddDays(time, days);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds hours to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// hours.
- /// </param>
- /// <param name="hours">The number of hours to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="hours"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddHours(DateTime time, int hours) {
- DateTime t = base.AddHours(time, hours);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds milliseconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// milliseconds.
- /// </param>
- /// <param name="milliseconds">The number of milliseconds given as
- /// double to add. Keep in mind the 100 nanosecond resolution of
- /// <see cref="T:System.DateTime"/>.
- /// </param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="milliseconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddMilliseconds(DateTime time,
- double milliseconds)
- {
- DateTime t = base.AddMilliseconds(time, milliseconds);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds minutes to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// minutes.
- /// </param>
- /// <param name="minutes">The number of minutes to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="minutes"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddMinutes(DateTime time, int minutes) {
- DateTime t = base.AddMinutes(time, minutes);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds seconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// seconds.
- /// </param>
- /// <param name="seconds">The number of seconds to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="seconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddSeconds(DateTime time, int seconds) {
- DateTime t = base.AddSeconds(time, seconds);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds weeks to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// weeks.
- /// </param>
- /// <param name="weeks">The number of weeks to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="weeks"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddWeeks(DateTime time, int weeks) {
- DateTime t = base.AddWeeks(time, weeks);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Gives the hour of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the hour of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetHour(DateTime time) {
- M_CheckDateTime(time);
- return base.GetHour(time);
- }
-
- /// <summary>
- /// Overridden. Gives the milliseconds in the current second
- /// of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the milliseconds in the seconds
- /// of the specified time, starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override double GetMilliseconds(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMilliseconds(time);
- }
-
- /// <summary>
- /// Overridden. Gives the minute of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the minute of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetMinute(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overridden. Gives the second of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the second of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetSecond(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overrideden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddMonths(DateTime time, int months) {
- int y, m, d;
- DateTime t;
-
- if (months == 0) {
- t = time;
- } else {
- int rd = CCFixed.FromDateTime(time);
- CCHebrewCalendar.dmy_from_fixed(
- out d, out m, out y, rd);
- m = M_Month(m, y);
- if (months < 0) {
- while (months < 0) {
- if (m+months > 0) {
- m += months;
- months = 0;
- } else {
- months += m;
- y -= 1;
- m = GetMonthsInYear(y);
- }
- }
- }
- else {
- while (months > 0) {
- int my = GetMonthsInYear(y);
- if (m+months <= my) {
- m += months;
- months = 0;
- } else {
- months -= my-m+1;
- m = 1;
- y += 1;
- }
- }
- }
- t = ToDateTime(y, m, d, 0, 0, 0, 0);
- t = t.Add(time.TimeOfDay);
- }
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DateTime AddYears(DateTime time, int years) {
- int rd = CCFixed.FromDateTime(time);
- int day, month, year;
- CCHebrewCalendar.dmy_from_fixed(
- out day, out month, out year, rd);
- year += years;
- rd = CCHebrewCalendar.fixed_from_dmy(day, month, year);
- DateTime t = CCFixed.ToDateTime(rd);
- t = t.Add(time.TimeOfDay);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overriden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetDayOfMonth(DateTime time) {
- M_CheckDateTime(time);
- int rd = CCFixed.FromDateTime(time);
- return CCHebrewCalendar.day_from_fixed(rd);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- M_CheckDateTime(time);
- int rd = CCFixed.FromDateTime(time);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetDayOfYear(DateTime time) {
- M_CheckDateTime(time);
- int rd = CCFixed.FromDateTime(time);
- int year = CCHebrewCalendar.year_from_fixed(rd);
- int rd1_7 = CCHebrewCalendar.fixed_from_dmy(1, 7, year);
- return rd - rd1_7 + 1;
- }
-
- /// <summary>
- /// The method maps a .NET Hebrew month to a Calencdrical
- /// Calculations Hebrew month.
- /// </summary>
- /// <param name="month">An integer representing a month in .NET
- /// counting (starting with Tishri).
- /// </param>
- /// <param name="year">An integer representing the Hebrew year.
- /// </param>
- /// <returns>The Hebrew month in Calendrical Calculations counting,
- /// staring with the Hebrew month Nisan.
- /// </returns>
- /// <remarks>
- /// <para>
- /// In .NET the month counting starts with the Hebrew month Tishri.
- /// Calendrical Calculations starts with the month Tisan. So we must
- /// map here.
- /// </para>
- /// </remarks>
- internal int M_CCMonth(int month, int year) {
- if (month <= 6) {
- return 6+month;
- }
- else {
- int l = CCHebrewCalendar.last_month_of_year(year);
- if (l == 12) {
- return month-6;
- }
- else {
- return month <= 7 ? 6+month : month-7;
- }
- }
- }
-
- /// <summary>
- /// The method maps a Calendrical Calculations Hebrew month
- /// to a .NET Hebrew month.
- /// </summary>
- /// <param name="ccmonth">An integer representing a month in
- /// Calendrical Calculations counting, starting with Nisan.
- /// </param>
- /// <param name="year">An integer representing the Hebrew year.
- /// </param>
- /// <returns>The Hebrew month in .NET counting,
- /// staring with the Hebrew month Tishri.
- /// </returns>
- /// <remarks>
- /// <para>
- /// In .NET the month counting starts with the Hebrew month Tishri.
- /// Calendrical Calculations starts with the month Tisan. So we must
- /// map here.
- /// </para>
- /// </remarks>
- internal int M_Month(int ccmonth, int year) {
- if (ccmonth >= 7) {
- return ccmonth - 6;
- } else {
- int l = CCHebrewCalendar.last_month_of_year(year);
- return ccmonth + (l == 12 ? 6 : 7);
- }
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An integer that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- M_CheckYME(year, month, ref era);
- int ccmonth = M_CCMonth(month, year);
- int rd1 = CCHebrewCalendar.fixed_from_dmy(1, ccmonth, year);
- int rd2 = CCHebrewCalendar.fixed_from_dmy(1, ccmonth+1, year);
- return rd2 - rd1;
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> or <paramref name="era"/> are outside the
- /// allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- M_CheckYE(year, ref era);
- int rd1 = CCHebrewCalendar.fixed_from_dmy(1, 7, year);
- int rd2 = CCHebrewCalendar.fixed_from_dmy(1, 7, year+1);
- return rd2 - rd1;
- }
-
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetEra(DateTime time) {
- M_CheckDateTime(time);
- return HebrewEra;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetMonth(DateTime time) {
- M_CheckDateTime(time);
- int rd = CCFixed.FromDateTime(time);
- int ccmonth, year;
- CCHebrewCalendar.my_from_fixed(out ccmonth, out year, rd);
- return M_Month(ccmonth, year);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYE(year, ref era);
- return CCHebrewCalendar.last_month_of_year(year);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the years
- /// between 5343 A.M. and 6000 A.M., inclusive.
- /// </exception>
- public override int GetYear(DateTime time) {
- M_CheckDateTime(time);
- int rd = CCFixed.FromDateTime(time);
- return CCHebrewCalendar.year_from_fixed(rd);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- /// <remarks>All days in Adar II are viewed as leap days and the
- /// last day of Adar I.
- /// </remarks>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- return IsLeapYear(year) &&
- (month == 7 || (month == 6 && day == 30));
- }
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- /// <remarks>
- /// Adar II is viewed as leap month.
- /// </remarks>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYME(year, month, ref era);
- return IsLeapYear(year) && month == 7;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- M_CheckYE(year, ref era);
- return CCHebrewCalendar.is_leap_year(year);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- int ccm = M_CCMonth(month, year);
- int rd = CCHebrewCalendar.fixed_from_dmy(day, ccm, year);
- return CCFixed.ToDateTime(rd,
- hour, minute, second, milliseconds);
- }
-} // class HebrewCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/HijriCalendar.cs b/mcs/class/corlib/System.Globalization/HijriCalendar.cs
deleted file mode 100644
index 9df3b005a3a..00000000000
--- a/mcs/class/corlib/System.Globalization/HijriCalendar.cs
+++ /dev/null
@@ -1,870 +0,0 @@
-// HijriCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-using System.IO;
-
-/// <summary>
-/// This is the Hijri calendar which might be called Islamic calendar.
-/// </summary>
-/// <remarks>
-/// <para>The calendar supports only dates in the HijriEra starting with the
-/// epoch.
-/// </para>
-/// <para>
-/// The epoch of the Hijri Calendar might be adjusted by the
-/// <see cref="F:System.Globalization.HijriCalendar.AddHijriDate"/>
-/// property. See the discussion of the
-/// <see cref="F:CalendricalCalculations.HijriCalendar.epoch">
-/// epoch
-/// </see>
-/// of the Hijri calendar.
-/// </para>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class HijriCalendar : Calendar {
- /// <summary>
- /// Constructor.
- /// </summary>
- public HijriCalendar() {
- M_AbbrEraNames = new string[] {"A.H."};
- M_EraNames = new string[] {"Anno Hegirae"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 1451;
- }
-
- /// <summary>
- /// The era number for the Anno Hegirae (A.H.) era.
- /// </summary>
- public static readonly int HijriEra = 1;
-
- /// <summary>
- /// The minimum fixed day number supported by the Hijri calendar.
- /// </summary>
- internal static readonly int M_MinFixed =
- CCHijriCalendar.fixed_from_dmy(1, 1, 1);
- /// <summary>
- /// The maximum fixed day number supported by the Hijri calendar.
- /// </summary>
- internal static readonly int M_MaxFixed =
- CCGregorianCalendar.fixed_from_dmy(31, 12, 9999);
-
- /// <value>Overridden. Gives the eras supported by the Gregorian
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return new int[] { HijriEra };
- }
- }
-
- /// <summary>
- /// Protected field storing the
- /// <see cref="F:AddHijriDate"/>.
- /// </summary>
- internal int M_AddHijriDate = 0;
-
- // TODO: I don't know currently, which sign to use with the parameter.
- /// <value>An integer property representing the adjustment to the epoch
- /// of the Hijri calendar. Not supported by .NET.
- /// </value>
- public virtual int AddHijriDate {
- get {
- return M_AddHijriDate;
- }
- set {
- if (value < -3 && value > 3)
- throw new ArgumentOutOfRangeException(
- "AddHijriDate",
- "Value should be between -3 and 3.");
- M_AddHijriDate = value;
- }
- }
-
- /// <summary>
- /// A protected method checking an
- /// <see cref="F:AddHijriDate"/> adjusted fixed day number.
- /// </summary>
- /// <param name="param">A string giving the name of the parameter
- /// to check.</param>
- /// <param name="rdHijri">An integer giving the AddHijriDate adjusted
- /// fixed day number.
- /// </param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// Exception is thrown, if the AddHijriDate adjusted fixed day
- /// number is outside the supported range.
- /// </exception>
- internal void M_CheckFixedHijri(string param, int rdHijri) {
- if (rdHijri < M_MinFixed || rdHijri > M_MaxFixed-AddHijriDate) {
- StringWriter sw = new StringWriter();
- int day, month, year;
- CCHijriCalendar.dmy_from_fixed(out day, out month,
- out year, M_MaxFixed-AddHijriDate);
- if (AddHijriDate != 0) {
- sw.Write("This HijriCalendar " +
- "(AddHijriDate {0})" +
- " allows dates from 1. 1. 1 to " +
- "{1}. {2}. {3}.",
- AddHijriDate,
- day, month, year);
- } else {
- sw.Write("HijriCalendar allows dates from " +
- "1.1.1 to {0}.{1}.{2}.",
- day, month, year);
- }
- throw new ArgumentOutOfRangeException(param,
- sw.ToString());
- }
- }
-
- /// <summary>
- /// A protected member checking a
- /// <see cref="T:System.DateTime"/> value.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/>
- /// to check.
- /// </param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the supported
- /// range of the Hijri calendar.
- /// </exception>
- internal void M_CheckDateTime(DateTime time) {
- int rd = CCFixed.FromDateTime(time) - AddHijriDate;
- M_CheckFixedHijri("time", rd);
- }
-
- /// <summary>
- /// Protected member which computes the
- /// <see cref="F:AddHijriDate"/>
- /// adjusted fixed day number from a
- /// <see cref="T:System.DateTime"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/>
- /// to convert.
- /// </param>
- /// <returns>The
- /// <see cref="F:AddHijriDate"/> adjusted fixed day number.
- /// </returns>
- internal int M_FromDateTime(DateTime time) {
- return CCFixed.FromDateTime(time) - AddHijriDate;
- }
-
- /// <summary>
- /// Protected member which converts the
- /// <see cref="F:AddHijriDate"/>
- /// adjusted fixed day number the a
- /// <see cref="T:System.DateTime"/> value.
- /// </summary>
- /// <param name="rd">The
- /// <see cref="F:AddHijriDate"/> adjusted fixed day number.
- /// </param>
- /// <returns>The converted
- /// <see cref="T:System.DateTime"/> value.
- /// </returns>
- internal DateTime M_ToDateTime(int rd) {
- return CCFixed.ToDateTime(rd+AddHijriDate);
- }
-
- /// <summary>
- /// Protected member which converts the
- /// <see cref="F:AddHijriDate"/>
- /// adjusted fixed day number the a
- /// <see cref="T:System.DateTime"/> value using a number
- /// of time parameters.
- /// </summary>
- /// <param name="date">The
- /// <see cref="F:AddHijriDate"/> adjusted fixed day number.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <returns>The converted
- /// <see cref="T:System.DateTime"/> value.
- /// </returns>
- internal DateTime M_ToDateTime(int date,
- int hour, int minute, int second, int milliseconds)
- {
- return CCFixed.ToDateTime(date+AddHijriDate,
- hour, minute, second, milliseconds);
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HijriEra"/>.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = HijriEra;
- if (era != HijriEra)
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HijriEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the allowed range.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckEra(ref era);
- M_ArgumentInRange("year", year, 1, 9666);
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HijriEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYME(int year, int month, ref int era) {
- M_CheckYE(year, ref era);
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException("month",
- "Month must be between one and twelve.");
- if (year == 9666) {
- int rd = CCHijriCalendar.fixed_from_dmy(1, month, year);
- M_CheckFixedHijri("month", rd);
- }
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="F:HijriEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYMDE(int year, int month, int day, ref int era)
- {
- M_CheckYME(year, month, ref era);
- M_ArgumentInRange("day", day, 1,
- GetDaysInMonth(year, month, HijriEra));
- if (year == 9666) {
- int rd = CCHijriCalendar.fixed_from_dmy(day, month,
- year);
- M_CheckFixedHijri("day", rd);
- }
- }
-
- /// <summary>
- /// Overridden. Adds days to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// days.
- /// </param>
- /// <param name="days">The number of days to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="days"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddDays(DateTime time, int days) {
- DateTime t = base.AddDays(time, days);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds hours to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// hours.
- /// </param>
- /// <param name="hours">The number of hours to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="hours"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddHours(DateTime time, int hours) {
- DateTime t = base.AddHours(time, hours);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds milliseconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// milliseconds.
- /// </param>
- /// <param name="milliseconds">The number of milliseconds given as
- /// double to add. Keep in mind the 100 nanosecond resolution of
- /// <see cref="T:System.DateTime"/>.
- /// </param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="milliseconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddMilliseconds(DateTime time,
- double milliseconds)
- {
- DateTime t = base.AddMilliseconds(time, milliseconds);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds minutes to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// minutes.
- /// </param>
- /// <param name="minutes">The number of minutes to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="minutes"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddMinutes(DateTime time, int minutes) {
- DateTime t = base.AddMinutes(time, minutes);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds seconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// seconds.
- /// </param>
- /// <param name="seconds">The number of seconds to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="seconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddSeconds(DateTime time, int seconds) {
- DateTime t = base.AddSeconds(time, seconds);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds weeks to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// weeks.
- /// </param>
- /// <param name="weeks">The number of weeks to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="weeks"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddWeeks(DateTime time, int weeks) {
- DateTime t = base.AddWeeks(time, weeks);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Gives the hour of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the hour of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetHour(DateTime time) {
- M_CheckDateTime(time);
- return base.GetHour(time);
- }
-
- /// <summary>
- /// Overridden. Gives the milliseconds in the current second
- /// of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the milliseconds in the seconds
- /// of the specified time, starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override double GetMilliseconds(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMilliseconds(time);
- }
-
- /// <summary>
- /// Overridden. Gives the minute of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the minute of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetMinute(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overridden. Gives the second of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the second of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetSecond(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overrideden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddMonths(DateTime time, int months) {
- int rd = M_FromDateTime(time);
- int day, month, year;
- CCHijriCalendar.dmy_from_fixed(
- out day, out month, out year, rd);
- month += months;
- year += CCMath.div_mod(out month, month, 12);
- rd = CCHijriCalendar.fixed_from_dmy(day, month, year);
- M_CheckFixedHijri("time", rd);
- DateTime t = M_ToDateTime(rd);
- return t.Add(time.TimeOfDay);
- }
-
- /// <summary>
- /// Overrideden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DateTime AddYears(DateTime time, int years) {
- int rd = M_FromDateTime(time);
- int day, month, year;
- CCHijriCalendar.dmy_from_fixed(
- out day, out month, out year, rd);
- year += years;
- rd = CCHijriCalendar.fixed_from_dmy(day, month, year);
- M_CheckFixedHijri("time", rd);
- DateTime t = M_ToDateTime(rd);
- return t.Add(time.TimeOfDay);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetDayOfMonth(DateTime time) {
- int rd = M_FromDateTime(time);
- M_CheckFixedHijri("time", rd);
- return CCHijriCalendar.day_from_fixed(rd);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- int rd = M_FromDateTime(time);
- M_CheckFixedHijri("time", rd);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetDayOfYear(DateTime time) {
- int rd = M_FromDateTime(time);
- M_CheckFixedHijri("time", rd);
- int year = CCHijriCalendar.year_from_fixed(rd);
- int rd1_1 = CCHijriCalendar.fixed_from_dmy(1, 1, year);
- return rd - rd1_1 + 1;
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An intger that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- M_CheckYME(year, month, ref era);
- int rd1 = CCHijriCalendar.fixed_from_dmy(1, month, year);
- int rd2 = CCHijriCalendar.fixed_from_dmy(1, month+1, year);
- return rd2 - rd1;
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> is outside the allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- M_CheckYE(year, ref era);
- int rd1 = CCHijriCalendar.fixed_from_dmy(1, 1, year);
- int rd2 = CCHijriCalendar.fixed_from_dmy(1, 1, year+1);
- return rd2 - rd1;
- }
-
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetEra(DateTime time) {
- M_CheckDateTime(time);
- return HijriEra;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetMonth(DateTime time) {
- int rd = M_FromDateTime(time);
- M_CheckFixedHijri("time", rd);
- return CCHijriCalendar.month_from_fixed(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYE(year, ref era);
- return 12;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is not in the
- /// supported range of the Hijri calendar.
- /// </exception>
- public override int GetYear(DateTime time) {
- int rd = M_FromDateTime(time);
- M_CheckFixedHijri("time", rd);
- return CCHijriCalendar.year_from_fixed(rd);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- return IsLeapYear(year) && month == 12 && day == 30;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYME(year, month, ref era);
- return false;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- M_CheckYE(year, ref era);
- return CCHijriCalendar.is_leap_year(year);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- int rd = CCHijriCalendar.fixed_from_dmy(day, month, year);
- return M_ToDateTime(rd,
- hour, minute, second, milliseconds);
- }
-} // class HijriCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/JapaneseCalendar.cs b/mcs/class/corlib/System.Globalization/JapaneseCalendar.cs
deleted file mode 100644
index 52b994158f1..00000000000
--- a/mcs/class/corlib/System.Globalization/JapaneseCalendar.cs
+++ /dev/null
@@ -1,783 +0,0 @@
-// JapaneseCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-
-/// <summary>
-/// This is the Japanese calendar. It differs from the Gregorian calendar
-/// only in the years.
-/// </summary>
-/// <remarks>
-/// <para>The Japanese calendar support four eras.</para>
-/// <list type="table">
-/// <listheader>
-/// <term>era number</term>
-/// <term>Gregorian start date</term>
-/// <term>Gregorian end date</term>
-/// </listheader>
-/// <item>
-/// <term>1</term>
-/// <term>September 8, 1868</term>
-/// <term>July 29, 1912</term>
-/// </item>
-/// <item>
-/// <term>2</term>
-/// <term>July 30, 1912</term>
-/// <term>December 24, 1926</term>
-/// </item>
-/// <item>
-/// <term>3</term>
-/// <term>December 25, 1926</term>
-/// <term>January 7, 1989</term>
-/// </item>
-/// <item>
-/// <term>4</term>
-/// <term>January 8, 1989</term>
-/// <term>present</term>
-/// </item>
-/// </list>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class JapaneseCalendar : Calendar {
- /// <summary>
- /// Static protected field storing the
- /// <see cref="T:CalendricalCalculations.GregorianEraHandler"/>.
- /// </summary>
- internal static readonly CCGregorianEraHandler M_EraHandler;
-
- /// <summary>
- /// Static constructor, who creates and initializes
- /// <see cref="F:M_EraHandler"/>.
- /// </summary>
- static JapaneseCalendar() {
- M_EraHandler = new CCGregorianEraHandler();
- M_EraHandler.appendEra(1,
- CCGregorianCalendar.fixed_from_dmy(8, 9, 1868),
- CCGregorianCalendar.fixed_from_dmy(29, 7, 1912));
- M_EraHandler.appendEra(2,
- CCGregorianCalendar.fixed_from_dmy(30, 7, 1912),
- CCGregorianCalendar.fixed_from_dmy(24, 12, 1926));
- M_EraHandler.appendEra(3,
- CCGregorianCalendar.fixed_from_dmy(25, 12, 1926),
- CCGregorianCalendar.fixed_from_dmy(7, 1, 1989));
- M_EraHandler.appendEra(4,
- CCGregorianCalendar.fixed_from_dmy(8, 1, 1989));
- }
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public JapaneseCalendar() {
- M_AbbrEraNames = new string[] { "M", "T", "S", "H" };
- M_EraNames = new string[] { "Meiji", "Taisho", "Showa",
- "Heisei" };
- }
-
-
- /// <value>Overridden. Gives the eras supported by the
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return (int[])M_EraHandler.Eras.Clone();
- }
- }
-
- /// <summary>
- /// A protected member checking a
- /// <see cref="T:System.DateTime"/> value.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/>
- /// to check.
- /// </param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- internal void M_CheckDateTime(DateTime time) {
- M_EraHandler.CheckDateTime(time);
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number as reference. It is set
- /// to <see cref="F:CurrentEra"/>, if the input value is 0.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = 4;
- if (!M_EraHandler.ValidEra(era))
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the supported range.
- /// </exception>
- internal int M_CheckYEG(int year, ref int era) {
- M_CheckEra(ref era);
- return M_EraHandler.GregorianYear(year, era);
- }
-
- /// <summary>
- /// Checks whether the year is the era is valid, if era = CurrentEra
- /// the right value is set.
- /// </summary>
- /// <param name="year">The year to check.</param>
- /// <param name="era">The era to check.</Param>
- /// <exception cref="T:ArgumentOutOfRangeException">
- /// The exception will be thrown, if the year is not valid.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckYEG(year, ref era);
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMEG(int year, int month, ref int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException("month",
- "Month must be between one and twelve.");
- return gregorianYear;
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMDEG(int year, int month, int day, ref int era)
- {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- M_ArgumentInRange("day", day, 1, GetDaysInMonth(year, month, era));
- return gregorianYear;
- }
-
-
- /// <summary>
- /// Overridden. Adds days to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// days.
- /// </param>
- /// <param name="days">The number of days to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="days"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddDays(DateTime time, int days) {
- DateTime t = base.AddDays(time, days);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds hours to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// hours.
- /// </param>
- /// <param name="hours">The number of hours to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="hours"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddHours(DateTime time, int hours) {
- DateTime t = base.AddHours(time, hours);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds milliseconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// milliseconds.
- /// </param>
- /// <param name="milliseconds">The number of milliseconds given as
- /// double to add. Keep in mind the 100 nanosecond resolution of
- /// <see cref="T:System.DateTime"/>.
- /// </param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="milliseconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddMilliseconds(DateTime time,
- double milliseconds)
- {
- DateTime t = base.AddMilliseconds(time, milliseconds);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds minutes to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// minutes.
- /// </param>
- /// <param name="minutes">The number of minutes to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="minutes"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddMinutes(DateTime time, int minutes) {
- DateTime t = base.AddMinutes(time, minutes);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds seconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// seconds.
- /// </param>
- /// <param name="seconds">The number of seconds to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="seconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddSeconds(DateTime time, int seconds) {
- DateTime t = base.AddSeconds(time, seconds);
- M_CheckDateTime(t);
- return t;
- }
-
-
- /// <summary>
- /// Overridden. Adds weeks to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// weeks.
- /// </param>
- /// <param name="weeks">The number of weeks to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="weeks"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddWeeks(DateTime time, int weeks) {
- DateTime t = base.AddWeeks(time, weeks);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Gives the hour of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the hour of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetHour(DateTime time) {
- M_CheckDateTime(time);
- return base.GetHour(time);
- }
-
- /// <summary>
- /// Overridden. Gives the milliseconds in the current second
- /// of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the milliseconds in the seconds
- /// of the specified time, starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override double GetMilliseconds(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMilliseconds(time);
- }
-
- /// <summary>
- /// Overridden. Gives the minute of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the minute of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetMinute(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overridden. Gives the second of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the second of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetSecond(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overrideden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddMonths(DateTime time, int months) {
- DateTime t = CCGregorianCalendar.AddMonths(time, months);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddYears(DateTime time, int years) {
- DateTime t = CCGregorianCalendar.AddYears(time, years);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overriden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetDayOfMonth(DateTime time) {
- M_CheckDateTime(time);
- return CCGregorianCalendar.GetDayOfMonth(time);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- M_CheckDateTime(time);
- int rd = CCFixed.FromDateTime(time);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetDayOfYear(DateTime time) {
- M_CheckDateTime(time);
- return CCGregorianCalendar.GetDayOfYear(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An integer that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- return CCGregorianCalendar.GetDaysInMonth(gregorianYear, month);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> or <paramref name="era"/> are outside the
- /// allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.GetDaysInYear(gregorianYear);
- }
-
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetEra(DateTime time) {
- // M_CheckDateTime not needed, because EraYear does the
- // right thing.
- int rd = CCFixed.FromDateTime(time);
- int era;
- M_EraHandler.EraYear(out era, rd);
- return era;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetMonth(DateTime time) {
- M_CheckDateTime(time);
- return CCGregorianCalendar.GetMonth(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYE(year, ref era);
- return 12;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetYear(DateTime time) {
- // M_CheckDateTime not needed, because EraYeat does the
- // right thing.
- int rd = CCFixed.FromDateTime(time);
- int era;
- return M_EraHandler.EraYear(out era, rd);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- return CCGregorianCalendar.IsLeapDay(gregorianYear, month, day);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYMEG(year, month, ref era);
- return false;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.is_leap_year(gregorianYear);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- return CCGregorianCalendar.ToDateTime(
- gregorianYear, month, day,
- hour, minute, second, milliseconds);
- }
-
-
- /// <summary>
- /// This functions returns simply the year for the Japanese calendar.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <returns>The same argument as the year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the year is negative or the resulting
- /// year is invalid.
- /// </exception>
- public override int ToFourDigitYear(int year) {
- if (year < 0)
- throw new ArgumentOutOfRangeException(
- "year", "Non-negative number required.");
- int era = CurrentEra;
- M_CheckYE(year, ref era);
- return year;
- }
-} // class JapaneseCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/JulianCalendar.cs b/mcs/class/corlib/System.Globalization/JulianCalendar.cs
deleted file mode 100644
index 8d1c98f21c7..00000000000
--- a/mcs/class/corlib/System.Globalization/JulianCalendar.cs
+++ /dev/null
@@ -1,443 +0,0 @@
-// JulianCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-
-/// <summary>
-/// This is the Julian calendar.
-/// </summary>
-/// <remarks>
-/// <para>The Julian calendar supports only the Common Era from
-/// January 1, 1 (Gregorian) to December 31, 9999 (Gregorian).
-/// </para>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class JulianCalendar : Calendar {
- /// <summary>
- /// Default constructor.
- /// </summary>
- public JulianCalendar() {
- M_AbbrEraNames = new string[] {"C.E."};
- M_EraNames = new string[] {"Common Era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 2029;
- }
-
- /// <summary>
- /// The era number for the Common Era (C.E.) or Anno Domini (A.D.)
- /// respective.
- /// </summary>
- public static readonly int JulianEra = 1;
-
- /// <value>Overridden. Gives the eras supported by the Julian
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return new int[] { JulianEra };
- }
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:JulianEra"/>.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = JulianEra;
- if (era != JulianEra)
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:JulianEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the allowed range.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckEra(ref era);
- M_ArgumentInRange("year", year, 1, 9999);
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:JulianEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYME(int year, int month, ref int era) {
- M_CheckYE(year, ref era);
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException("month",
- "Month must be between one and twelve.");
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number.</param>
- /// <exception cref="T:System.ArgumentException">
- /// The exception is thrown if the era is not equal
- /// <see cref="M:JulianEra"/>.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the allowed range.
- /// </exception>
- internal void M_CheckYMDE(int year, int month, int day, ref int era)
- {
- M_CheckYME(year, month, ref era);
- M_ArgumentInRange("day", day, 1,
- GetDaysInMonth(year, month, era));
- if (year == 9999 && ((month == 10 && day > 19) || month > 10))
- throw new ArgumentOutOfRangeException(
- "The maximum Julian date is 19. 10. 9999.");
- }
-
- /// <summary>
- /// Overridden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddMonths(DateTime time, int months) {
- int rd = CCFixed.FromDateTime(time);
- int day, month, year;
- CCJulianCalendar.dmy_from_fixed(
- out day, out month, out year, rd);
- month += months;
- rd = CCJulianCalendar.fixed_from_dmy(day, month, year);
- DateTime t = CCFixed.ToDateTime(rd);
- return t.Add(time.TimeOfDay);
- }
-
- /// <summary>
- /// Overridden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddYears(DateTime time, int years) {
- int rd = CCFixed.FromDateTime(time);
- int day, month, year;
- CCJulianCalendar.dmy_from_fixed(
- out day, out month, out year, rd);
- year += years;
- rd = CCJulianCalendar.fixed_from_dmy(day, month, year);
- DateTime t = CCFixed.ToDateTime(rd);
- return t.Add(time.TimeOfDay);
- }
-
- /// <summary>
- /// Overridden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override int GetDayOfMonth(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- return CCJulianCalendar.day_from_fixed(rd);
- }
-
- /// <summary>
- /// Overridden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- public override int GetDayOfYear(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- int year = CCJulianCalendar.year_from_fixed(rd);
- int rd1_1 = CCJulianCalendar.fixed_from_dmy(1, 1, year);
- return rd - rd1_1 + 1;
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An intger that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- M_CheckYME(year, month, ref era);
- int rd1 = CCJulianCalendar.fixed_from_dmy(1, month, year);
- int rd2 = CCJulianCalendar.fixed_from_dmy(1, month+1, year);
- return rd2 - rd1;
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> is outside the allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- M_CheckYE(year, ref era);
- int rd1 = CCJulianCalendar.fixed_from_dmy(1, 1, year);
- int rd2 = CCJulianCalendar.fixed_from_dmy(1, 1, year+1);
- return rd2 - rd1;
- }
-
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- public override int GetEra(DateTime time) {
- // should change, if more than one era is supported
- return JulianEra;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- public override int GetMonth(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- return CCJulianCalendar.month_from_fixed(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYE(year, ref era);
- return 12;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- public override int GetYear(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- return CCJulianCalendar.year_from_fixed(rd);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- return IsLeapYear(year) && month == 2 && day == 29;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYME(year, month, ref era);
- return false;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- M_CheckYE(year, ref era);
- return CCJulianCalendar.is_leap_year(year);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- M_CheckYMDE(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- int rd = CCJulianCalendar.fixed_from_dmy(day, month, year);
- return CCFixed.ToDateTime(rd,
- hour, minute, second, milliseconds);
- }
-} // class JulianCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/KoreanCalendar.cs b/mcs/class/corlib/System.Globalization/KoreanCalendar.cs
deleted file mode 100644
index dd14c2a309a..00000000000
--- a/mcs/class/corlib/System.Globalization/KoreanCalendar.cs
+++ /dev/null
@@ -1,444 +0,0 @@
-// KoreanCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-
-/// <summary>
-/// This is the Korean calendar. It differs from the Gegorian calendar only
-/// in the year counting.
-/// </summary>
-/// <remarks>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class KoreanCalendar : Calendar {
- /// <summary>
- /// Static protected field storing the
- /// <see cref="T:CalendricalCalculations.GregorianEraHandler"/>.
- /// </summary>
- internal static readonly CCGregorianEraHandler M_EraHandler;
-
- /// <variable>
- /// The standard era for the <see cref="T:KoreanCalendar"/>.
- /// </variable>
- public const int KoreanEra = 1;
-
- /// <summary>
- /// Static constructor, who creates and initializes
- /// <see cref="F:M_EraHandler"/>.
- /// </summary>
- static KoreanCalendar() {
- M_EraHandler = new CCGregorianEraHandler();
- M_EraHandler.appendEra(KoreanEra,
- CCGregorianCalendar.fixed_from_dmy(1, 1, -2332));
- }
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public KoreanCalendar() {
- M_AbbrEraNames = new string[] {"K.C.E."};
- M_EraNames = new string[] {"Korean Current Era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 4362;
- }
-
- /// <value>Overridden. Gives the eras supported by the
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return (int[])M_EraHandler.Eras.Clone();
- }
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number as reference. It is set
- /// to <see cref="F:CurrentEra"/>, if the input value is 0.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = KoreanEra;
- if (!M_EraHandler.ValidEra(era))
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the supported range.
- /// </exception>
- internal int M_CheckYEG(int year, ref int era) {
- M_CheckEra(ref era);
- return M_EraHandler.GregorianYear(year, era);
- }
-
- /// <summary>
- /// Checks whether the year is the era is valid, if era = CurrentEra
- /// the right value is set.
- /// </summary>
- /// <param name="year">The year to check.</param>
- /// <param name="era">The era to check.</Param>
- /// <exception cref="T:ArgumentOutOfRangeException">
- /// The exception will be thrown, if the year is not valid.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckYEG(year, ref era);
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMEG(int year, int month, ref int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException("month",
- "Month must be between one and twelve.");
- return gregorianYear;
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMDEG(int year, int month, int day, ref int era)
- {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- M_ArgumentInRange("day", day, 1,
- GetDaysInMonth(year, month, era));
- return gregorianYear;
- }
-
- /// <summary>
- /// Overrideden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddMonths(DateTime time, int months) {
- return CCGregorianCalendar.AddMonths(time, months);
- }
-
- /// <summary>
- /// Overridden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddYears(DateTime time, int years) {
- return CCGregorianCalendar.AddYears(time, years);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override int GetDayOfMonth(DateTime time) {
- return CCGregorianCalendar.GetDayOfMonth(time);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- public override int GetDayOfYear(DateTime time) {
- return CCGregorianCalendar.GetDayOfYear(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An integer that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- return CCGregorianCalendar.GetDaysInMonth(gregorianYear, month);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> or <paramref name="era"/> are outside the
- /// allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.GetDaysInYear(gregorianYear);
- }
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- public override int GetEra(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- int era;
- M_EraHandler.EraYear(out era, rd);
- return era;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- public override int GetMonth(DateTime time) {
- return CCGregorianCalendar.GetMonth(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYEG(year, ref era);
- return 12;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- public override int GetYear(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- int era;
- return M_EraHandler.EraYear(out era, rd);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- return CCGregorianCalendar.IsLeapDay(gregorianYear, month, day);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYMEG(year, month, ref era);
- return false;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.is_leap_year(gregorianYear);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- return CCGregorianCalendar.ToDateTime(gregorianYear,
- month, day, hour, minute, second, milliseconds);
- }
-} // class KoreanCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/Locale.cs b/mcs/class/corlib/System.Globalization/Locale.cs
deleted file mode 100755
index 539184dbde4..00000000000
--- a/mcs/class/corlib/System.Globalization/Locale.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Globalization.Locale.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-namespace System.Globalization {
-
- internal class Locale {
-
- /// <summary>
- /// Returns the translated message for the current locale
- /// </summary>
- public static string GetText (string msg)
- {
- return msg;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs b/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs
deleted file mode 100644
index 5e6b21c479d..00000000000
--- a/mcs/class/corlib/System.Globalization/NumberFormatInfo.cs
+++ /dev/null
@@ -1,676 +0,0 @@
-//
-// System.Globalization.NumberFormatInfo.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-// Bob Smith (bob@thestuff.net)
-//
-// (C) Derek Holden
-// (C) Bob Smith http://www.thestuff.net
-//
-
-//
-// 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.
-//
-
-namespace System.Globalization {
-
- [Serializable]
- public sealed class NumberFormatInfo : ICloneable, IFormatProvider {
- private bool readOnly;
-
- // 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;
-
- internal NumberFormatInfo (int lcid)
- {
- //FIXME: should add more LCID
- // CultureInfo uses this one also.
- if (lcid != 0x007F)
- lcid = 0x007F;
-
- switch (lcid){
-
- // The Invariant Culture Info ID.
- case 0x007f:
- readOnly = false;
-
- // Currency Related Format Info
- currencyDecimalDigits = 2;
- currencyDecimalSeparator = ".";
- currencyGroupSeparator = ",";
- currencyGroupSizes = new int[1] { 3 };
- currencyNegativePattern = 0;
- currencyPositivePattern = 0;
- currencySymbol = "$";
-
- 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 = "+";
- break;
- }
- }
-
- public NumberFormatInfo () : this (0x007f)
- {
- }
-
- // =========== 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- currencyGroupSeparator = value;
- }
- }
-
- public int[] CurrencyGroupSizes {
- get {
- return currencyGroupSizes;
- }
-
- set {
- if (value == null || value.Length == 0)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- // 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- 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 {
- // This should be culture specific
- NumberFormatInfo nfi = new NumberFormatInfo ();
- nfi.readOnly = true;
- return nfi;
- }
- }
-
- public static NumberFormatInfo InvariantInfo {
- get {
- // This uses invariant info, which is same as in the constructor
- NumberFormatInfo nfi = new NumberFormatInfo ();
- nfi.NumberNegativePattern = 1;
- nfi.readOnly = true;
- return nfi;
- }
- }
-
- public bool IsReadOnly {
- get {
- return readOnly;
- }
- }
-
-
-
- public string NaNSymbol {
- get {
- return naNSymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- naNSymbol = value;
- }
- }
-
- public string NegativeInfinitySymbol {
- get {
- return negativeInfinitySymbol;
- }
-
- set {
- if (value == null)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- numberGroupSeparator = value;
- }
- }
-
- public int[] NumberGroupSizes {
- get {
- return numberGroupSizes;
- }
-
- set {
- if (value == null || value.Length == 0)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- // 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- percentGroupSeparator = value;
- }
- }
-
- public int[] PercentGroupSizes {
- get {
- return percentGroupSizes;
- }
-
- set {
- if (value == null || value.Length == 0)
- throw new ArgumentNullException
- ("The value specified for the property is a null reference");
-
- if (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- // 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- 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 (readOnly)
- throw new InvalidOperationException
- ("The current instance is read-only and a set operation was attempted");
-
- positiveSign = value;
- }
- }
-
- public object GetFormat (Type formatType)
- {
- return (formatType == GetType()) ? this : null;
- }
-
- public object Clone ()
- {
- NumberFormatInfo clone = (NumberFormatInfo) MemberwiseClone();
- // clone is not read only
- clone.readOnly = false;
- return clone;
- }
-
- public static NumberFormatInfo ReadOnly (NumberFormatInfo nfi)
- {
- NumberFormatInfo copy = (NumberFormatInfo)nfi.Clone();
- copy.readOnly = true;
- return copy;
- }
-
- public static NumberFormatInfo GetInstance(IFormatProvider provider)
- {
- if (provider != null) {
- NumberFormatInfo nfi;
- nfi = (NumberFormatInfo)provider.GetFormat(typeof(NumberFormatInfo));
- if (nfi != null)
- return nfi;
- }
-
- return CurrentInfo;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Globalization/NumberStyles.cs b/mcs/class/corlib/System.Globalization/NumberStyles.cs
deleted file mode 100644
index fbbccc86427..00000000000
--- a/mcs/class/corlib/System.Globalization/NumberStyles.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
-namespace System.Globalization {
-
- [Flags]
- [Serializable]
- 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
diff --git a/mcs/class/corlib/System.Globalization/RegionInfo.cs b/mcs/class/corlib/System.Globalization/RegionInfo.cs
deleted file mode 100644
index c5b21ab4451..00000000000
--- a/mcs/class/corlib/System.Globalization/RegionInfo.cs
+++ /dev/null
@@ -1,1689 +0,0 @@
-using System.Globalization;
-
-namespace System.Globalization {
-
- [Serializable]
- public class RegionInfo {
- int NLS_id;
-
- public RegionInfo (int culture) {
-
- if (CultureInfo.IsIDNeutralCulture (culture))
- throw new ArgumentException ("Culture ID " + culture
- + " (0x" + culture.ToString ("X4")
- + ") is a neutral culture. A region can not be created from it.");
-
- switch (culture) {
- case 0x0401: // ar-SA Arabic (Saudi Arabia)
- NLS_id = 682;
- break;
- case 0x0801: // ar-IQ Arabic (Iraq)
- NLS_id = 368;
- break;
- case 0x0C01: // ar-EG Arabic (Egypt)
- NLS_id = 818;
- break;
- case 0x1001: // ar-LY Arabic (Libya)
- NLS_id = 434;
- break;
- case 0x1401: // ar-DZ Arabic (Algeria)
- NLS_id = 12;
- break;
- case 0x1801: // ar-MA Arabic (Morocco)
- NLS_id = 504;
- break;
- case 0x1C01: // ar-TN Arabic (Tunisia)
- NLS_id = 788;
- break;
- case 0x2001: // ar-OM Arabic (Oman)
- NLS_id = 512;
- break;
- case 0x2401: // ar-YE Arabic (Yemen)
- NLS_id = 887;
- break;
- case 0x2801: // ar-SY Arabic (Syria)
- NLS_id = 760;
- break;
- case 0x2C01: // ar-JO Arabic (Jordan)
- NLS_id = 400;
- break;
- case 0x3001: // ar-LB Arabic (Lebanon)
- NLS_id = 422;
- break;
- case 0x3401: // ar-KW Arabic (Kuwait)
- NLS_id = 414;
- break;
- case 0x3801: // ar-AE Arabic (U.A.E.)
- NLS_id = 784;
- break;
- case 0x3C01: // ar-BH Arabic (Bahrain)
- NLS_id = 48;
- break;
- case 0x4001: // ar-QA Arabic (Qatar)
- NLS_id = 634;
- break;
- case 0x0402: // bg-BG Bulgarian (Bulgaria)
- NLS_id = 100;
- break;
- case 0x0403: // ca-ES Catalan (Spain)
- NLS_id = 724;
- break;
- case 0x0404: // zh-TW Chinese (Taiwan)
- NLS_id = 158;
- break;
- case 0x0804: // zh-CN Chinese (People's Republic of China)
- NLS_id = 156;
- break;
- case 0x0C04: // zh-HK Chinese (Hong Kong S.A.R.)
- NLS_id = 344;
- break;
- case 0x1004: // zh-SG Chinese (Singapore)
- NLS_id = 702;
- break;
- case 0x1404: // zh-MO Chinese (Macau S.A.R.)
- NLS_id = 446;
- break;
- case 0x0405: // cs-CZ Czech (Czech Republic)
- NLS_id = 203;
- break;
- case 0x0406: // da-DK Danish (Denmark)
- NLS_id = 208;
- break;
- case 0x0407: // de-DE German (Germany)
- NLS_id = 276;
- break;
- case 0x0807: // de-CH German (Switzerland)
- NLS_id = 756;
- break;
- case 0x0C07: // de-AT German (Austria)
- NLS_id = 40;
- break;
- case 0x1007: // de-LU German (Luxembourg)
- NLS_id = 442;
- break;
- case 0x1407: // de-LI German (Liechtenstein)
- NLS_id = 438;
- break;
- case 0x0408: // el-GR Greek (Greece)
- NLS_id = 300;
- break;
- case 0x0409: // en-US English (United States)
- NLS_id = 840;
- break;
- case 0x0809: // en-GB English (United Kingdom)
- NLS_id = 826;
- break;
- case 0x0C09: // en-AU English (Australia)
- NLS_id = 36;
- break;
- case 0x1009: // en-CA English (Canada)
- NLS_id = 124;
- break;
- case 0x1409: // en-NZ English (New Zealand)
- NLS_id = 554;
- break;
- case 0x1809: // en-IE English (Ireland)
- NLS_id = 372;
- break;
- case 0x1C09: // en-ZA English (South Africa)
- NLS_id = 710;
- break;
- case 0x2009: // en-JM English (Jamaica)
- NLS_id = 388;
- break;
- case 0x2809: // en-BZ English (Belize)
- NLS_id = 84;
- break;
- case 0x2C09: // en-TT English (Trinidad and Tobago)
- NLS_id = 780;
- break;
- case 0x3009: // en-ZW English (Zimbabwe)
- NLS_id = 716;
- break;
- case 0x3409: // en-PH English (Republic of the Philippines)
- NLS_id = 608;
- break;
- case 0x080A: // es-MX Spanish (Mexico)
- NLS_id = 484;
- break;
- case 0x0C0A: // es-ES Spanish (Spain)
- NLS_id = 724;
- break;
- case 0x100A: // es-GT Spanish (Guatemala)
- NLS_id = 320;
- break;
- case 0x140A: // es-CR Spanish (Costa Rica)
- NLS_id = 188;
- break;
- case 0x180A: // es-PA Spanish (Panama)
- NLS_id = 591;
- break;
- case 0x1C0A: // es-DO Spanish (Dominican Republic)
- NLS_id = 214;
- break;
- case 0x200A: // es-VE Spanish (Venezuela)
- NLS_id = 862;
- break;
- case 0x240A: // es-CO Spanish (Colombia)
- NLS_id = 170;
- break;
- case 0x280A: // es-PE Spanish (Peru)
- NLS_id = 604;
- break;
- case 0x2C0A: // es-AR Spanish (Argentina)
- NLS_id = 32;
- break;
- case 0x300A: // es-EC Spanish (Ecuador)
- NLS_id = 218;
- break;
- case 0x340A: // es-CL Spanish (Chile)
- NLS_id = 152;
- break;
- case 0x380A: // es-UY Spanish (Uruguay)
- NLS_id = 858;
- break;
- case 0x3C0A: // es-PY Spanish (Paraguay)
- NLS_id = 600;
- break;
- case 0x400A: // es-BO Spanish (Bolivia)
- NLS_id = 68;
- break;
- case 0x440A: // es-SV Spanish (El Salvador)
- NLS_id = 222;
- break;
- case 0x480A: // es-HN Spanish (Honduras)
- NLS_id = 340;
- break;
- case 0x4C0A: // es-NI Spanish (Nicaragua)
- NLS_id = 558;
- break;
- case 0x500A: // es-PR Spanish (Puerto Rico)
- NLS_id = 630;
- break;
- case 0x040B: // fi-FI Finnish (Finland)
- NLS_id = 246;
- break;
- case 0x040C: // fr-FR French (France)
- NLS_id = 250;
- break;
- case 0x080C: // fr-BE French (Belgium)
- NLS_id = 56;
- break;
- case 0x0C0C: // fr-CA French (Canada)
- NLS_id = 124;
- break;
- case 0x100C: // fr-CH French (Switzerland)
- NLS_id = 756;
- break;
- case 0x140C: // fr-LU French (Luxembourg)
- NLS_id = 442;
- break;
- case 0x180C: // fr-MC French (Principality of Monaco)
- NLS_id = 492;
- break;
- case 0x040D: // he-IL Hebrew (Israel)
- NLS_id = 376;
- break;
- case 0x040E: // hu-HU Hungarian (Hungary)
- NLS_id = 348;
- break;
- case 0x040F: // is-IS Icelandic (Iceland)
- NLS_id = 352;
- break;
- case 0x0410: // it-IT Italian (Italy)
- NLS_id = 380;
- break;
- case 0x0810: // it-CH Italian (Switzerland)
- NLS_id = 756;
- break;
- case 0x0411: // ja-JP Japanese (Japan)
- NLS_id = 392;
- break;
- case 0x0412: // ko-KR Korean (Korea)
- NLS_id = 410;
- break;
- case 0x0413: // nl-NL Dutch (Netherlands)
- NLS_id = 528;
- break;
- case 0x0813: // nl-BE Dutch (Belgium)
- NLS_id = 56;
- break;
- case 0x0414: // nb-NO Norwegian (Bokm†l) (Norway)
- NLS_id = 578;
- break;
- case 0x0814: // nn-NO Norwegian (Nynorsk) (Norway)
- NLS_id = 578;
- break;
- case 0x0415: // pl-PL Polish (Poland)
- NLS_id = 616;
- break;
- case 0x0416: // pt-BR Portuguese (Brazil)
- NLS_id = 76;
- break;
- case 0x0816: // pt-PT Portuguese (Portugal)
- NLS_id = 620;
- break;
- case 0x0418: // ro-RO Romanian (Romania)
- NLS_id = 642;
- break;
- case 0x0419: // ru-RU Russian (Russia)
- NLS_id = 643;
- break;
- case 0x041A: // hr-HR Croatian (Croatia)
- NLS_id = 191;
- break;
- case 0x041B: // sk-SK Slovak (Slovakia)
- NLS_id = 703;
- break;
- case 0x041C: // sq-AL Albanian (Albania)
- NLS_id = 8;
- break;
- case 0x041D: // sv-SE Swedish (Sweden)
- NLS_id = 752;
- break;
- case 0x081D: // sv-FI Swedish (Finland)
- NLS_id = 246;
- break;
- case 0x041E: // th-TH Thai (Thailand)
- NLS_id = 764;
- break;
- case 0x041F: // tr-TR Turkish (Turkey)
- NLS_id = 792;
- break;
- case 0x0420: // ur-PK Urdu (Islamic Republic of Pakistan)
- NLS_id = 586;
- break;
- case 0x0421: // id-ID Indonesian (Indonesia)
- NLS_id = 360;
- break;
- case 0x0422: // uk-UA Ukrainian (Ukraine)
- NLS_id = 804;
- break;
- case 0x0423: // be-BY Belarusian (Belarus)
- NLS_id = 112;
- break;
- case 0x0424: // sl-SI Slovenian (Slovenia)
- NLS_id = 705;
- break;
- case 0x0425: // et-EE Estonian (Estonia)
- NLS_id = 233;
- break;
- case 0x0426: // lv-LV Latvian (Latvia)
- NLS_id = 428;
- break;
- case 0x0427: // lt-LT Lithuanian (Lithuania)
- NLS_id = 440;
- break;
- case 0x0429: // fa-IR Farsi (Iran)
- NLS_id = 364;
- break;
- case 0x042A: // vi-VN Vietnamese (Viet Nam)
- NLS_id = 704;
- break;
- case 0x042B: // hy-AM Armenian (Armenia)
- NLS_id = 51;
- break;
- case 0x042C: // Lt-az-AZ Azeri (Latin) (Azerbaijan)
- NLS_id = 31;
- break;
- case 0x082C: // Cy-az-AZ Azeri (Cyrillic) (Azerbaijan)
- NLS_id = 31;
- break;
- case 0x042D: // eu-ES Basque (Spain)
- NLS_id = 724;
- break;
- case 0x042F: // mk-MK FYRO Macedonian (Former Yugoslav Republic of Macedonia)
- NLS_id = 807;
- break;
- case 0x0436: // af-ZA Afrikaans (South Africa)
- NLS_id = 710;
- break;
- case 0x0437: // ka-GE Georgian (Georgia)
- NLS_id = 268;
- break;
- case 0x0438: // fo-FO Faeroese (Faeroe Islands)
- NLS_id = 234;
- break;
- case 0x0439: // hi-IN Hindi (India)
- NLS_id = 356;
- break;
- case 0x043E: // ms-MY Malay (Malaysia)
- NLS_id = 458;
- break;
- case 0x083E: // ms-BN Malay (Brunei Darussalam)
- NLS_id = 96;
- break;
- case 0x043F: // kk-KZ Kazakh (Kazakhstan)
- NLS_id = 398;
- break;
- case 0x0440: // ky-KZ Kyrgyz (Kyrgyzstan)
- NLS_id = 398;
- break;
- case 0x0441: // sw-KE Swahili (Kenya)
- NLS_id = 404;
- break;
- case 0x0443: // Lt-uz-UZ Uzbek (Latin) (Uzbekistan)
- NLS_id = 860;
- break;
- case 0x0843: // Cy-uz-UZ Uzbek (Cyrillic) (Uzbekistan)
- NLS_id = 860;
- break;
- case 0x0446: // pa-IN Punjabi (India)
- NLS_id = 356;
- break;
- case 0x0447: // gu-IN Gujarati (India)
- NLS_id = 356;
- break;
- case 0x0449: // ta-IN Tamil (India)
- NLS_id = 356;
- break;
- case 0x044A: // te-IN Telugu (India)
- NLS_id = 356;
- break;
- case 0x044B: // kn-IN Kannada (India)
- NLS_id = 356;
- break;
- case 0x044E: // mr-IN Marathi (India)
- NLS_id = 356;
- break;
- case 0x044F: // sa-IN Sanskrit (India)
- NLS_id = 356;
- break;
- case 0x0450: // mn-MN Mongolian (Mongolia)
- NLS_id = 496;
- break;
- case 0x0456: // gl-ES Galician (Spain)
- NLS_id = 724;
- break;
- case 0x0457: // kok-IN Konkani (India)
- NLS_id = 356;
- break;
- case 0x045A: // syr-SY Syriac (Syria)
- NLS_id = 760;
- break;
- case 0x0465: // div-MV Divehi (Maldives)
- NLS_id = 462;
- break;
- case 0x007F: // Invariant Language (Invariant Country)
- throw new ArgumentException ("There is no region associated with the Invariant Culture (Culture ID: 0x7F).");
- default:
- throw new ArgumentException ("Culture ID " + culture + " (0x" + culture.ToString ("X4")
- + ") is not a supported culture.");
- }
- }
-
- public RegionInfo (string name) {
- switch (name.ToUpper ()) {
- case "AF": // Afghanistan
- NLS_id = 004;
- break;
- case "AL": // Albania
- NLS_id = 008;
- break;
- case "DZ": // Algeria
- NLS_id = 012;
- break;
- case "AS": // American Samoa
- NLS_id = 016;
- break;
- case "AD": // Andorra
- NLS_id = 020;
- break;
- case "AO": // Angola
- NLS_id = 024;
- break;
- case "AI": // Anguilla
- NLS_id = 660;
- break;
- case "AQ": // Antarctica
- NLS_id = 010;
- break;
- case "AG": // Antigua and Barbuda
- NLS_id = 028;
- break;
- case "AR": // Argentina
- NLS_id = 032;
- break;
- case "AM": // Armenia
- NLS_id = 051;
- break;
- case "AW": // Aruba
- NLS_id = 533;
- break;
- case "AU": // Australia
- NLS_id = 036;
- break;
- case "AT": // Austria
- NLS_id = 040;
- break;
- case "AZ": // Azerbaijan
- NLS_id = 031;
- break;
- case "BS": // Bahamas
- NLS_id = 044;
- break;
- case "BH": // Bahrain
- NLS_id = 048;
- break;
- case "BD": // Bangladesh
- NLS_id = 050;
- break;
- case "BB": // Barbados
- NLS_id = 052;
- break;
- case "BY": // Belarus
- NLS_id = 112;
- break;
- case "BE": // Belgium
- NLS_id = 056;
- break;
- case "BZ": // Belize
- NLS_id = 084;
- break;
- case "BJ": // Benin
- NLS_id = 204;
- break;
- case "BM": // Bermuda
- NLS_id = 060;
- break;
- case "BT": // Bhutan
- NLS_id = 064;
- break;
- case "BO": // Bolivia
- NLS_id = 068;
- break;
- case "BA": // Bosnia and Herzegowina
- NLS_id = 070;
- break;
- case "BW": // Botswana
- NLS_id = 072;
- break;
- case "BV": // Bouvet Island
- NLS_id = 074;
- break;
- case "BR": // Brazil
- NLS_id = 076;
- break;
- case "IO": // British Indian Ocean Territory
- NLS_id = 086;
- break;
- case "BN": // Brunei Darussalam
- NLS_id = 096;
- break;
- case "BG": // Bulgaria
- NLS_id = 100;
- break;
- case "BF": // Burkina Faso
- NLS_id = 854;
- break;
- case "BI": // Burundi
- NLS_id = 108;
- break;
- case "KH": // Cambodia
- NLS_id = 116;
- break;
- case "CM": // Cameroon
- NLS_id = 120;
- break;
- case "CA": // Canada
- NLS_id = 124;
- break;
- case "CV": // Cape Verde
- NLS_id = 132;
- break;
- case "KY": // Cayman Islands
- NLS_id = 136;
- break;
- case "CF": // Central African Republic
- NLS_id = 140;
- break;
- case "TD": // Chad
- NLS_id = 148;
- break;
- case "CL": // Chile
- NLS_id = 152;
- break;
- case "CN": // China
- NLS_id = 156;
- break;
- case "CX": // Christmas Island
- NLS_id = 162;
- break;
- case "CC": // Cocos (Keeling) Islands
- NLS_id = 166;
- break;
- case "CO": // Colombia
- NLS_id = 170;
- break;
- case "KM": // Comoros
- NLS_id = 174;
- break;
- case "CG": // Congo
- NLS_id = 178;
- break;
- case "CK": // Cook Islands
- NLS_id = 184;
- break;
- case "CR": // Costa Rica
- NLS_id = 188;
- break;
- case "CI": // Cote D'Ivoire
- NLS_id = 384;
- break;
- case "HR": // Croatia (Local Name: Hrvatska)
- NLS_id = 191;
- break;
- case "CU": // Cuba
- NLS_id = 192;
- break;
- case "CY": // Cyprus
- NLS_id = 196;
- break;
- case "CZ": // Czech Republic
- NLS_id = 203;
- break;
- case "DK": // Denmark
- NLS_id = 208;
- break;
- case "DJ": // Djibouti
- NLS_id = 262;
- break;
- case "DM": // Dominica
- NLS_id = 212;
- break;
- case "DO": // Dominican Republic
- NLS_id = 214;
- break;
- case "TP": // East Timor
- NLS_id = 626;
- break;
- case "EC": // Ecuador
- NLS_id = 218;
- break;
- case "EG": // Egypt
- NLS_id = 818;
- break;
- case "SV": // El Salvador
- NLS_id = 222;
- break;
- case "GQ": // Equatorial Guinea
- NLS_id = 226;
- break;
- case "ER": // Eritrea
- NLS_id = 232;
- break;
- case "EE": // Estonia
- NLS_id = 233;
- break;
- case "ET": // Ethiopia
- NLS_id = 231;
- break;
- case "FK": // Falkland Islands (Malvinas)
- NLS_id = 238;
- break;
- case "FO": // Faroe Islands
- NLS_id = 234;
- break;
- case "FJ": // Fiji
- NLS_id = 242;
- break;
- case "FI": // Finland
- NLS_id = 246;
- break;
- case "FR": // France
- NLS_id = 250;
- break;
- case "FX": // France, Metropolitan
- NLS_id = 249;
- break;
- case "GF": // French Guiana
- NLS_id = 254;
- break;
- case "PF": // French Polynesia
- NLS_id = 258;
- break;
- case "TF": // French Southern Territories
- NLS_id = 260;
- break;
- case "GA": // Gabon
- NLS_id = 266;
- break;
- case "GM": // Gambia
- NLS_id = 270;
- break;
- case "GE": // Georgia
- NLS_id = 268;
- break;
- case "DE": // Germany
- NLS_id = 276;
- break;
- case "GH": // Ghana
- NLS_id = 288;
- break;
- case "GI": // Gibraltar
- NLS_id = 292;
- break;
- case "GR": // Greece
- NLS_id = 300;
- break;
- case "GL": // Greenland
- NLS_id = 304;
- break;
- case "GD": // Grenada
- NLS_id = 308;
- break;
- case "GP": // Guadeloupe
- NLS_id = 312;
- break;
- case "GU": // Guam
- NLS_id = 316;
- break;
- case "GT": // Guatemala
- NLS_id = 320;
- break;
- case "GN": // Guinea
- NLS_id = 324;
- break;
- case "GW": // Guinea-Bissau
- NLS_id = 624;
- break;
- case "GY": // Guyana
- NLS_id = 328;
- break;
- case "HT": // Haiti
- NLS_id = 332;
- break;
- case "HM": // Heard and Mc Donald Islands
- NLS_id = 334;
- break;
- case "VA": // Holy See (Vatican City State)
- NLS_id = 336;
- break;
- case "HN": // Honduras
- NLS_id = 340;
- break;
- case "HK": // Hong Kong
- NLS_id = 344;
- break;
- case "HU": // Hungary
- NLS_id = 348;
- break;
- case "IS": // Iceland
- NLS_id = 352;
- break;
- case "IN": // India
- NLS_id = 356;
- break;
- case "ID": // Indonesia
- NLS_id = 360;
- break;
- case "IR": // Iran (Islamic Republic of)
- NLS_id = 364;
- break;
- case "IQ": // Iraq
- NLS_id = 368;
- break;
- case "IE": // Ireland
- NLS_id = 372;
- break;
- case "IL": // Israel
- NLS_id = 376;
- break;
- case "IT": // Italy
- NLS_id = 380;
- break;
- case "JM": // Jamaica
- NLS_id = 388;
- break;
- case "JP": // Japan
- NLS_id = 392;
- break;
- case "JO": // Jordan
- NLS_id = 400;
- break;
- case "KZ": // Kazakhstan
- NLS_id = 398;
- break;
- case "KE": // Kenya
- NLS_id = 404;
- break;
- case "KI": // Kiribati
- NLS_id = 296;
- break;
- case "KP": // Korea, Democratic People's Republic of
- NLS_id = 408;
- break;
- case "KR": // Korea, Republic of
- NLS_id = 410;
- break;
- case "KW": // Kuwait
- NLS_id = 414;
- break;
- case "KG": // Kyrgyzstan
- NLS_id = 417;
- break;
- case "LA": // Lao People's Democratic Republic
- NLS_id = 418;
- break;
- case "LV": // Latvia
- NLS_id = 428;
- break;
- case "LB": // Lebanon
- NLS_id = 422;
- break;
- case "LS": // Lesotho
- NLS_id = 426;
- break;
- case "LR": // Liberia
- NLS_id = 430;
- break;
- case "LY": // Libyan Arab Jamahiriya
- NLS_id = 434;
- break;
- case "LI": // Liechtenstein
- NLS_id = 438;
- break;
- case "LT": // Lithuania
- NLS_id = 440;
- break;
- case "LU": // Luxembourg
- NLS_id = 442;
- break;
- case "MO": // Macau
- NLS_id = 446;
- break;
- case "MK": // Macedonia, The Former Yugoslav Republic of
- NLS_id = 807;
- break;
- case "MG": // Madagascar
- NLS_id = 450;
- break;
- case "MW": // Malawi
- NLS_id = 454;
- break;
- case "MY": // Malaysia
- NLS_id = 458;
- break;
- case "MV": // Maldives
- NLS_id = 462;
- break;
- case "ML": // Mali
- NLS_id = 466;
- break;
- case "MT": // Malta
- NLS_id = 470;
- break;
- case "MH": // Marshall Islands
- NLS_id = 584;
- break;
- case "MQ": // Martinique
- NLS_id = 474;
- break;
- case "MR": // Mauritania
- NLS_id = 478;
- break;
- case "MU": // Mauritius
- NLS_id = 480;
- break;
- case "YT": // Mayotte
- NLS_id = 175;
- break;
- case "MX": // Mexico
- NLS_id = 484;
- break;
- case "FM": // Micronesia, Federated States of
- NLS_id = 583;
- break;
- case "MD": // Moldova, Republic of
- NLS_id = 498;
- break;
- case "MC": // Monaco
- NLS_id = 492;
- break;
- case "MN": // Mongolia
- NLS_id = 496;
- break;
- case "MS": // Montserrat
- NLS_id = 500;
- break;
- case "MA": // Morocco
- NLS_id = 504;
- break;
- case "MZ": // Mozambique
- NLS_id = 508;
- break;
- case "MM": // Myanmar
- NLS_id = 104;
- break;
- case "NA": // Namibia
- NLS_id = 516;
- break;
- case "NR": // Nauru
- NLS_id = 520;
- break;
- case "NP": // Nepal
- NLS_id = 524;
- break;
- case "NL": // Netherlands
- NLS_id = 528;
- break;
- case "AN": // Netherlands Antilles
- NLS_id = 530;
- break;
- case "NC": // New Caledonia
- NLS_id = 540;
- break;
- case "NZ": // New Zealand
- NLS_id = 554;
- break;
- case "NI": // Nicaragua
- NLS_id = 558;
- break;
- case "NE": // Niger
- NLS_id = 562;
- break;
- case "NG": // Nigeria
- NLS_id = 566;
- break;
- case "NU": // Niue
- NLS_id = 570;
- break;
- case "NF": // Norfolk Island
- NLS_id = 574;
- break;
- case "MP": // Northern Mariana Islands
- NLS_id = 580;
- break;
- case "NO": // Norway
- NLS_id = 578;
- break;
- case "OM": // Oman
- NLS_id = 512;
- break;
- case "PK": // Pakistan
- NLS_id = 586;
- break;
- case "PW": // Palau
- NLS_id = 585;
- break;
- case "PA": // Panama
- NLS_id = 591;
- break;
- case "PG": // Papua New Guinea
- NLS_id = 598;
- break;
- case "PY": // Paraguay
- NLS_id = 600;
- break;
- case "PE": // Peru
- NLS_id = 604;
- break;
- case "PH": // Philippines
- NLS_id = 608;
- break;
- case "PN": // Pitcairn
- NLS_id = 612;
- break;
- case "PL": // Poland
- NLS_id = 616;
- break;
- case "PT": // Portugal
- NLS_id = 620;
- break;
- case "PR": // Puerto Rico
- NLS_id = 630;
- break;
- case "QA": // Qatar
- NLS_id = 634;
- break;
- case "RE": // Reunion
- NLS_id = 638;
- break;
- case "RO": // Romania
- NLS_id = 642;
- break;
- case "RU": // Russian Federation
- NLS_id = 643;
- break;
- case "RW": // Rwanda
- NLS_id = 646;
- break;
- case "KN": // Saint Kitts and Nevis
- NLS_id = 659;
- break;
- case "LC": // Saint Lucia
- NLS_id = 662;
- break;
- case "VC": // Saint Vincent and The Grenadines
- NLS_id = 670;
- break;
- case "WS": // Samoa
- NLS_id = 882;
- break;
- case "SM": // San Marino
- NLS_id = 674;
- break;
- case "ST": // Sao Tome and Principe
- NLS_id = 678;
- break;
- case "SA": // Saudi Arabia
- NLS_id = 682;
- break;
- case "SN": // Senegal
- NLS_id = 686;
- break;
- case "SC": // Seychelles
- NLS_id = 690;
- break;
- case "SL": // Sierra Leone
- NLS_id = 694;
- break;
- case "SG": // Singapore
- NLS_id = 702;
- break;
- case "SK": // Slovakia (Slovak Republic)
- NLS_id = 703;
- break;
- case "SI": // Slovenia
- NLS_id = 705;
- break;
- case "SB": // Solomon Islands
- NLS_id = 090;
- break;
- case "SO": // Somalia
- NLS_id = 706;
- break;
- case "ZA": // South Africa
- NLS_id = 710;
- break;
- case "GS": // South Georgia and The South Sandwich Islands
- NLS_id = 239;
- break;
- case "ES": // Spain
- NLS_id = 724;
- break;
- case "LK": // Sri Lanka
- NLS_id = 144;
- break;
- case "SH": // St. Helena
- NLS_id = 654;
- break;
- case "PM": // St. Pierre and Miquelon
- NLS_id = 666;
- break;
- case "SD": // Sudan
- NLS_id = 736;
- break;
- case "SR": // Suriname
- NLS_id = 740;
- break;
- case "SJ": // Svalbard and Jan Mayen Islands
- NLS_id = 744;
- break;
- case "SZ": // Swaziland
- NLS_id = 748;
- break;
- case "SE": // Sweden
- NLS_id = 752;
- break;
- case "CH": // Switzerland
- NLS_id = 756;
- break;
- case "SY": // Syrian Arab Republic
- NLS_id = 760;
- break;
- case "TW": // Taiwan, Province of China
- NLS_id = 158;
- break;
- case "TJ": // Tajikistan
- NLS_id = 762;
- break;
- case "TZ": // Tanzania, United Republic of
- NLS_id = 834;
- break;
- case "TH": // Thailand
- NLS_id = 764;
- break;
- case "TG": // Togo
- NLS_id = 768;
- break;
- case "TK": // Tokelau
- NLS_id = 772;
- break;
- case "TO": // Tonga
- NLS_id = 776;
- break;
- case "TT": // Trinidad and Tobago
- NLS_id = 780;
- break;
- case "TN": // Tunisia
- NLS_id = 788;
- break;
- case "TR": // Turkey
- NLS_id = 792;
- break;
- case "TM": // Turkmenistan
- NLS_id = 795;
- break;
- case "TC": // Turks and Caicos Islands
- NLS_id = 796;
- break;
- case "TV": // Tuvalu
- NLS_id = 798;
- break;
- case "UG": // Uganda
- NLS_id = 800;
- break;
- case "UA": // Ukraine
- NLS_id = 804;
- break;
- case "AE": // United Arab Emirates
- NLS_id = 784;
- break;
- case "GB": // United Kingdom
- NLS_id = 826;
- break;
- case "US": // United States
- NLS_id = 840;
- break;
- case "UM": // United States Minor Outlying Islands
- NLS_id = 581;
- break;
- case "UY": // Uruguay
- NLS_id = 858;
- break;
- case "UZ": // Uzbekistan
- NLS_id = 860;
- break;
- case "VU": // Vanuatu
- NLS_id = 548;
- break;
- case "VE": // Venezuela
- NLS_id = 862;
- break;
- case "VN": // Viet Nam
- NLS_id = 704;
- break;
- case "VG": // Virgin Islands (British)
- NLS_id = 092;
- break;
- case "VI": // Virgin Islands (U.S.)
- NLS_id = 850;
- break;
- case "WF": // Wallis and Futuna Islands
- NLS_id = 876;
- break;
- case "EH": // Western Sahara
- NLS_id = 732;
- break;
- case "YE": // Yemen
- NLS_id = 887;
- break;
- case "YU": // Yugoslavia
- NLS_id = 891;
- break;
- case "ZR": // Zaire
- NLS_id = 180;
- break;
- case "ZM": // Zambia
- NLS_id = 894;
- break;
- case "ZW": // Zimbabwe
- NLS_id = 716;
- break;
- default:
- throw new ArgumentException ("Region name " + name + " is not supported.");
- }
- }
-
- public virtual string CurrencySymbol {
- get {
- switch (NLS_id) {
- default:
- throw new Exception ("Dunno what is currency symbol for " + NLS_id + " Region. FIXME.");
- }
- }
- }
-
- [MonoTODO]
- public static RegionInfo CurrentRegion {
- get {
- return null;
- }
- }
-
- public virtual string DisplayName {
- get {
- switch (NLS_id) {
- case 203: // Czech republic
- return "Česká republika";
- case 840: // United States
- return "United States";
- default:
- throw new Exception ("FIXME. Please add your region name in language used in this region.");
- }
- }
- }
-
- public virtual string EnglishName {
- get {
- switch (NLS_id) {
- case 004:
- return "Afghanistan";
- case 008:
- return "Albania";
- case 012:
- return "Algeria";
- case 016:
- return "American Samoa";
- case 020:
- return "Andorra";
- case 024:
- return "Angola";
- case 660:
- return "Anguilla";
- case 010:
- return "Antarctica";
- case 028:
- return "Antigua and Barbuda";
- case 032:
- return "Argentina";
- case 051:
- return "Armenia";
- case 533:
- return "Aruba";
- case 036:
- return "Australia";
- case 040:
- return "Austria";
- case 031:
- return "Azerbaijan";
- case 044:
- return "Bahamas";
- case 048:
- return "Bahrain";
- case 050:
- return "Bangladesh";
- case 052:
- return "Barbados";
- case 112:
- return "Belarus";
- case 056:
- return "Belgium";
- case 084:
- return "Belize";
- case 204:
- return "Benin";
- case 060:
- return "Bermuda";
- case 064:
- return "Bhutan";
- case 068:
- return "Bolivia";
- case 070:
- return "Bosnia and Herzegowina";
- case 072:
- return "Botswana";
- case 074:
- return "Bouvet Island";
- case 076:
- return "Brazil";
- case 086:
- return "British Indian Ocean Territory";
- case 096:
- return "Brunei Darussalam";
- case 100:
- return "Bulgaria";
- case 854:
- return "Burkina Faso";
- case 108:
- return "Burundi";
- case 116:
- return "Cambodia";
- case 120:
- return "Cameroon";
- case 124:
- return "Canada";
- case 132:
- return "Cape Verde";
- case 136:
- return "Cayman Islands";
- case 140:
- return "Central African Republic";
- case 148:
- return "Chad";
- case 152:
- return "Chile";
- case 156:
- return "China";
- case 162:
- return "Christmas Island";
- case 166:
- return "Cocos (Keeling) Islands";
- case 170:
- return "Colombia";
- case 174:
- return "Comoros";
- case 178:
- return "Congo";
- case 184:
- return "Cook Islands";
- case 188:
- return "Costa Rica";
- case 384:
- return "Cote D'Ivoire";
- case 191:
- return "Croatia (Local Name: Hrvatska)";
- case 192:
- return "Cuba";
- case 196:
- return "Cyprus";
- case 203:
- return "Czech Republic";
- case 208:
- return "Denmark";
- case 262:
- return "Djibouti";
- case 212:
- return "Dominica";
- case 214:
- return "Dominican Republic";
- case 626:
- return "East Timor";
- case 218:
- return "Ecuador";
- case 818:
- return "Egypt";
- case 222:
- return "El Salvador";
- case 226:
- return "Equatorial Guinea";
- case 232:
- return "Eritrea";
- case 233:
- return "Estonia";
- case 231:
- return "Ethiopia";
- case 238:
- return "Falkland Islands (Malvinas)";
- case 234:
- return "Faroe Islands";
- case 242:
- return "Fiji";
- case 246:
- return "Finland";
- case 250:
- return "France";
- case 249:
- return "France, Metropolitan";
- case 254:
- return "French Guiana";
- case 258:
- return "French Polynesia";
- case 260:
- return "French Southern Territories";
- case 266:
- return "Gabon";
- case 270:
- return "Gambia";
- case 268:
- return "Georgia";
- case 276:
- return "Germany";
- case 288:
- return "Ghana";
- case 292:
- return "Gibraltar";
- case 300:
- return "Greece";
- case 304:
- return "Greenland";
- case 308:
- return "Grenada";
- case 312:
- return "Guadeloupe";
- case 316:
- return "Guam";
- case 320:
- return "Guatemala";
- case 324:
- return "Guinea";
- case 624:
- return "Guinea-Bissau";
- case 328:
- return "Guyana";
- case 332:
- return "Haiti";
- case 334:
- return "Heard and Mc Donald Islands";
- case 336:
- return "Holy See (Vatican City State)";
- case 340:
- return "Honduras";
- case 344:
- return "Hong Kong";
- case 348:
- return "Hungary";
- case 352:
- return "Iceland";
- case 356:
- return "India";
- case 360:
- return "Indonesia";
- case 364:
- return "Iran (Islamic Republic of)";
- case 368:
- return "Iraq";
- case 372:
- return "Ireland";
- case 376:
- return "Israel";
- case 380:
- return "Italy";
- case 388:
- return "Jamaica";
- case 392:
- return "Japan";
- case 400:
- return "Jordan";
- case 398:
- return "Kazakhstan";
- case 404:
- return "Kenya";
- case 296:
- return "Kiribati";
- case 408:
- return "Korea, Democratic People's Republic of";
- case 410:
- return "Korea, Republic of";
- case 414:
- return "Kuwait";
- case 417:
- return "Kyrgyzstan";
- case 418:
- return "Lao People's Democratic Republic";
- case 428:
- return "Latvia";
- case 422:
- return "Lebanon";
- case 426:
- return "Lesotho";
- case 430:
- return "Liberia";
- case 434:
- return "Libyan Arab Jamahiriya";
- case 438:
- return "Liechtenstein";
- case 440:
- return "Lithuania";
- case 442:
- return "Luxembourg";
- case 446:
- return "Macau";
- case 807:
- return "Macedonia, The Former Yugoslav Republic of";
- case 450:
- return "Madagascar";
- case 454:
- return "Malawi";
- case 458:
- return "Malaysia";
- case 462:
- return "Maldives";
- case 466:
- return "Mali";
- case 470:
- return "Malta";
- case 584:
- return "Marshall Islands";
- case 474:
- return "Martinique";
- case 478:
- return "Mauritania";
- case 480:
- return "Mauritius";
- case 175:
- return "Mayotte";
- case 484:
- return "Mexico";
- case 583:
- return "Micronesia, Federated States of";
- case 498:
- return "Moldova, Republic of";
- case 492:
- return "Monaco";
- case 496:
- return "Mongolia";
- case 500:
- return "Montserrat";
- case 504:
- return "Morocco";
- case 508:
- return "Mozambique";
- case 104:
- return "Myanmar";
- case 516:
- return "Namibia";
- case 520:
- return "Nauru";
- case 524:
- return "Nepal";
- case 528:
- return "Netherlands";
- case 530:
- return "Netherlands Antilles";
- case 540:
- return "New Caledonia";
- case 554:
- return "New Zealand";
- case 558:
- return "Nicaragua";
- case 562:
- return "Niger";
- case 566:
- return "Nigeria";
- case 570:
- return "Niue";
- case 574:
- return "Norfolk Island";
- case 580:
- return "Northern Mariana Islands";
- case 578:
- return "Norway";
- case 512:
- return "Oman";
- case 586:
- return "Pakistan";
- case 585:
- return "Palau";
- case 591:
- return "Panama";
- case 598:
- return "Papua New Guinea";
- case 600:
- return "Paraguay";
- case 604:
- return "Peru";
- case 608:
- return "Philippines";
- case 612:
- return "Pitcairn";
- case 616:
- return "Poland";
- case 620:
- return "Portugal";
- case 630:
- return "Puerto Rico";
- case 634:
- return "Qatar";
- case 638:
- return "Reunion";
- case 642:
- return "Romania";
- case 643:
- return "Russian Federation";
- case 646:
- return "Rwanda";
- case 659:
- return "Saint Kitts and Nevis";
- case 662:
- return "Saint Lucia";
- case 670:
- return "Saint Vincent and The Grenadines";
- case 882:
- return "Samoa";
- case 674:
- return "San Marino";
- case 678:
- return "Sao Tome and Principe";
- case 682:
- return "Saudi Arabia";
- case 686:
- return "Senegal";
- case 690:
- return "Seychelles";
- case 694:
- return "Sierra Leone";
- case 702:
- return "Singapore";
- case 703:
- return "Slovakia (Slovak Republic)";
- case 705:
- return "Slovenia";
- case 090:
- return "Solomon Islands";
- case 706:
- return "Somalia";
- case 710:
- return "South Africa";
- case 239:
- return "South Georgia and The South Sandwich Islands";
- case 724:
- return "Spain";
- case 144:
- return "Sri Lanka";
- case 654:
- return "St. Helena";
- case 666:
- return "St. Pierre and Miquelon";
- case 736:
- return "Sudan";
- case 740:
- return "Suriname";
- case 744:
- return "Svalbard and Jan Mayen Islands";
- case 748:
- return "Swaziland";
- case 752:
- return "Sweden";
- case 756:
- return "Switzerland";
- case 760:
- return "Syrian Arab Republic";
- case 158:
- return "Taiwan, Province of China";
- case 762:
- return "Tajikistan";
- case 834:
- return "Tanzania, United Republic of";
- case 764:
- return "Thailand";
- case 768:
- return "Togo";
- case 772:
- return "Tokelau";
- case 776:
- return "Tonga";
- case 780:
- return "Trinidad and Tobago";
- case 788:
- return "Tunisia";
- case 792:
- return "Turkey";
- case 795:
- return "Turkmenistan";
- case 796:
- return "Turks and Caicos Islands";
- case 798:
- return "Tuvalu";
- case 800:
- return "Uganda";
- case 804:
- return "Ukraine";
- case 784:
- return "United Arab Emirates";
- case 826:
- return "United Kingdom";
- case 840:
- return "United States";
- case 581:
- return "United States Minor Outlying Islands";
- case 858:
- return "Uruguay";
- case 860:
- return "Uzbekistan";
- case 548:
- return "Vanuatu";
- case 862:
- return "Venezuela";
- case 704:
- return "Viet Nam";
- case 092:
- return "Virgin Islands (British)";
- case 850:
- return "Virgin Islands (U.S.)";
- case 876:
- return "Wallis and Futuna Islands";
- case 732:
- return "Western Sahara";
- case 887:
- return "Yemen";
- case 891:
- return "Yugoslavia";
- case 180:
- return "Zaire";
- case 894:
- return "Zambia";
- case 716:
- return "Zimbabwe";
- default:
- throw new Exception ("This code should not be reached.");
- }
- }
- }
-
- public virtual bool IsMetric {
- get {
- switch (NLS_id) {
- case 203: // Czech Republic
- return true;
- case 840: // United States
- return false;
- default:
- throw new Exception ("FIXME. Please define.");
- }
- }
- }
-
- public virtual string ISOCurrencySymbol {
- get {
- switch (NLS_id) {
- default:
- throw new Exception ("This code should not be reached.");
- }
- }
- }
-
- //
- // methods
-
- public override bool Equals(object value) {
- return value == this;
- }
-
- public override int GetHashCode () {
- return NLS_id.GetHashCode ();
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Globalization/TaiwanCalendar.cs b/mcs/class/corlib/System.Globalization/TaiwanCalendar.cs
deleted file mode 100644
index f744e2bd0b0..00000000000
--- a/mcs/class/corlib/System.Globalization/TaiwanCalendar.cs
+++ /dev/null
@@ -1,745 +0,0 @@
-// TaiwanCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-
-/// <summary>
-/// This is the Japanese calendar. It differs from the Gregorian calendar
-/// only in the years.
-/// </summary>
-/// <remarks>
-/// <para>The Japanese calendar support a single era starting at January 1,
-/// 1912</para>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class TaiwanCalendar : Calendar {
- /// <summary>
- /// Static protected field storing the
- /// <see cref="T:CalendricalCalculations.GregorianEraHandler"/>.
- /// </summary>
- internal static readonly CCGregorianEraHandler M_EraHandler;
-
- /// <summary>
- /// Static constructor, who creates and initializes
- /// <see cref="F:M_EraHandler"/>.
- /// </summary>
- static TaiwanCalendar() {
- M_EraHandler = new CCGregorianEraHandler();
- M_EraHandler.appendEra(1,
- CCGregorianCalendar.fixed_from_dmy(1, 1, 1912));
- }
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public TaiwanCalendar() {
- M_AbbrEraNames = new string[] {"T.C.E."};
- M_EraNames = new string[] {"Taiwan current era"};
- }
-
- /// <value>Overridden. Gives the eras supported by the
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return (int[])M_EraHandler.Eras.Clone();
- }
- }
-
- /// <summary>
- /// A protected member checking a
- /// <see cref="T:System.DateTime"/> value.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/>
- /// to check.
- /// </param>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- internal void M_CheckDateTime(DateTime time) {
- M_EraHandler.CheckDateTime(time);
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number as reference. It is set
- /// to <see cref="F:CurrentEra"/>, if the input value is 0.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = 1;
- if (!M_EraHandler.ValidEra(era))
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the supported range.
- /// </exception>
- internal int M_CheckYEG(int year, ref int era) {
- M_CheckEra(ref era);
- return M_EraHandler.GregorianYear(year, era);
- }
-
- /// <summary>
- /// Checks whether the year is the era is valid, if era = CurrentEra
- /// the right value is set.
- /// </summary>
- /// <param name="year">The year to check.</param>
- /// <param name="era">The era to check.</Param>
- /// <exception cref="T:ArgumentOutOfRangeException">
- /// The exception will be thrown, if the year is not valid.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckYEG(year, ref era);
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMEG(int year, int month, ref int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException("month",
- "Month must be between one and twelve.");
- return gregorianYear;
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMDEG(int year, int month, int day, ref int era)
- {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- M_ArgumentInRange("day", day, 1,
- GetDaysInMonth(year, month, era));
- return gregorianYear;
- }
-
- /// <summary>
- /// Overridden. Adds days to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// days.
- /// </param>
- /// <param name="days">The number of days to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="days"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddDays(DateTime time, int days) {
- DateTime t = base.AddDays(time, days);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds hours to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// hours.
- /// </param>
- /// <param name="hours">The number of hours to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="hours"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddHours(DateTime time, int hours) {
- DateTime t = base.AddHours(time, hours);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds milliseconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// milliseconds.
- /// </param>
- /// <param name="milliseconds">The number of milliseconds given as
- /// double to add. Keep in mind the 100 nanosecond resolution of
- /// <see cref="T:System.DateTime"/>.
- /// </param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="milliseconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddMilliseconds(DateTime time,
- double milliseconds)
- {
- DateTime t = base.AddMilliseconds(time, milliseconds);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds minutes to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// minutes.
- /// </param>
- /// <param name="minutes">The number of minutes to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="minutes"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddMinutes(DateTime time, int minutes) {
- DateTime t = base.AddMinutes(time, minutes);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds seconds to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// seconds.
- /// </param>
- /// <param name="seconds">The number of seconds to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="seconds"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddSeconds(DateTime time, int seconds) {
- DateTime t = base.AddSeconds(time, seconds);
- M_CheckDateTime(t);
- return t;
- }
-
-
- /// <summary>
- /// Overridden. Adds weeks to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// weeks.
- /// </param>
- /// <param name="weeks">The number of weeks to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="weeks"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddWeeks(DateTime time, int weeks) {
- DateTime t = base.AddWeeks(time, weeks);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Gives the hour of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the hour of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetHour(DateTime time) {
- M_CheckDateTime(time);
- return base.GetHour(time);
- }
-
- /// <summary>
- /// Overridden. Gives the milliseconds in the current second
- /// of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the milliseconds in the seconds
- /// of the specified time, starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override double GetMilliseconds(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMilliseconds(time);
- }
-
- /// <summary>
- /// Overridden. Gives the minute of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the minute of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetMinute(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overridden. Gives the second of the specified time.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies the
- /// time.
- /// </param>
- /// <returns>An integer that gives the second of the specified time,
- /// starting with 0.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetSecond(DateTime time) {
- M_CheckDateTime(time);
- return base.GetMinute(time);
- }
-
- /// <summary>
- /// Overrideden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddMonths(DateTime time, int months) {
- DateTime t = CCGregorianCalendar.AddMonths(time, months);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overridden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if
- /// <see cref="T:System.DateTime"/> return value is outside all
- /// supported eras.
- /// </exception>
- public override DateTime AddYears(DateTime time, int years) {
- DateTime t = CCGregorianCalendar.AddYears(time, years);
- M_CheckDateTime(t);
- return t;
- }
-
- /// <summary>
- /// Overriden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetDayOfMonth(DateTime time) {
- M_CheckDateTime(time);
- return CCGregorianCalendar.GetDayOfMonth(time);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- M_CheckDateTime(time);
- int rd = CCFixed.FromDateTime(time);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetDayOfYear(DateTime time) {
- M_CheckDateTime(time);
- return CCGregorianCalendar.GetDayOfYear(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An integer that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- return CCGregorianCalendar.GetDaysInMonth(gregorianYear, month);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> or <paramref name="era"/> are outside the
- /// allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.GetDaysInYear(gregorianYear);
- }
-
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetEra(DateTime time) {
- // M_CheckDateTime not needed, because EraYear does the
- // right thing.
- int rd = CCFixed.FromDateTime(time);
- int era;
- M_EraHandler.EraYear(out era, rd);
- return era;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetMonth(DateTime time) {
- M_CheckDateTime(time);
- return CCGregorianCalendar.GetMonth(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYEG(year, ref era);
- return 12;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the
- /// <see cref="T:System.DateTime"/> parameter is outside all
- /// supported eras.
- /// </exception>
- public override int GetYear(DateTime time) {
- // M_CheckDateTime not needed, because EraYeat does the
- // right thing.
- int rd = CCFixed.FromDateTime(time);
- int era;
- return M_EraHandler.EraYear(out era, rd);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- return CCGregorianCalendar.IsLeapDay(gregorianYear, month, day);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYMEG(year, month, ref era);
- return false;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.is_leap_year(gregorianYear);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- return CCGregorianCalendar.ToDateTime(
- gregorianYear, month, day,
- hour, minute, second, milliseconds);
- }
-
- /// <summary>
- /// This functions returns simply the year for the Taiwan calendar.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <returns>The same argument as the year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the year is negative or the resulting
- /// year is invalid.
- /// </exception>
- public override int ToFourDigitYear(int year) {
- if (year < 0)
- throw new ArgumentOutOfRangeException(
- "year", "Non-negative number required.");
- int era = CurrentEra;
- M_CheckYE(year, ref era);
- return year;
- }
-} // class TaiwanCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/ThaiBuddhistCalendar.cs b/mcs/class/corlib/System.Globalization/ThaiBuddhistCalendar.cs
deleted file mode 100644
index e6a5cc5dff7..00000000000
--- a/mcs/class/corlib/System.Globalization/ThaiBuddhistCalendar.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-// ThaiBuddhistCalendar.cs
-//
-// (C) Ulrich Kunitz 2002
-//
-
-namespace System.Globalization {
-
-using System;
-
-/// <summary>
-/// This is the ThaiBudhist calendar. It differs from the Gegorian calendar
-/// only in the year counting.
-/// </summary>
-/// <remarks>
-/// <para>The implementation uses the
-/// <see cref="N:CalendricalCalculations"/> namespace.
-/// </para>
-/// </remarks>
-[Serializable]
-public class ThaiBuddhistCalendar : Calendar {
- /// <summary>
- /// Static protected field storing the
- /// <see cref="T:CalendricalCalculations.GregorianEraHandler"/>.
- /// </summary>
- internal static readonly CCGregorianEraHandler M_EraHandler;
-
- /// <value>
- /// The standard era for this calendar.
- /// </value>
- public const int ThaiBuddhistEra = 1;
-
- /// <summary>
- /// Static constructor, who creates and initializes
- /// <see cref="F:M_EraHandler"/>.
- /// </summary>
- static ThaiBuddhistCalendar() {
- M_EraHandler = new CCGregorianEraHandler();
- M_EraHandler.appendEra(ThaiBuddhistEra,
- CCGregorianCalendar.fixed_from_dmy(1, 1, -542));
- }
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public ThaiBuddhistCalendar() {
- M_AbbrEraNames = new string[] {"T.B.C.E."};
- M_EraNames = new string[] {"ThaiBuddhist current era"};
- if (M_TwoDigitYearMax == 99)
- M_TwoDigitYearMax = 2572;
- }
-
- /// <value>Overridden. Gives the eras supported by the
- /// calendar as an array of integers.
- /// </value>
- public override int[] Eras {
- get {
- return (int[])M_EraHandler.Eras.Clone();
- }
- }
-
- /// <summary>
- /// A protected method checking the era number.
- /// </summary>
- /// <param name="era">The era number as reference. It is set
- /// to <see cref="F:CurrentEra"/>, if the input value is 0.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- internal void M_CheckEra(ref int era) {
- if (era == CurrentEra)
- era = ThaiBuddhistEra;
- if (!M_EraHandler.ValidEra(era))
- throw new ArgumentException("Era value was not valid.");
- }
-
- /// <summary>
- /// A protected method checking calendar year and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year is outside of
- /// the supported range.
- /// </exception>
- internal int M_CheckYEG(int year, ref int era) {
- M_CheckEra(ref era);
- return M_EraHandler.GregorianYear(year, era);
- }
-
- /// <summary>
- /// Checks whether the year is the era is valid, if era = CurrentEra
- /// the right value is set.
- /// </summary>
- /// <param name="year">The year to check.</param>
- /// <param name="era">The era to check.</Param>
- /// <exception cref="T:ArgumentOutOfRangeException">
- /// The exception will be thrown, if the year is not valid.
- /// </exception>
- internal override void M_CheckYE(int year, ref int era) {
- M_CheckYEG(year, ref era);
- }
-
- /// <summary>
- /// A protected method checking the calendar year, month, and
- /// era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year or month is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMEG(int year, int month, ref int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- if (month < 1 || month > 12)
- throw new ArgumentOutOfRangeException("month",
- "Month must be between one and twelve.");
- return gregorianYear;
- }
-
- /// <summary>
- /// A protected method checking the calendar day, month, and year
- /// and the era number.
- /// </summary>
- /// <param name="year">An integer representing the calendar year.
- /// </param>
- /// <param name="month">An integer giving the calendar month.
- /// </param>
- /// <param name="day">An integer giving the calendar day.
- /// </param>
- /// <param name="era">The era number as reference.</param>
- /// <exception name="T:System.ArgumentException">
- /// The exception is thrown if the era is not supported by the class.
- /// </exception>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown if the calendar year, month, or day is
- /// outside of the supported range.
- /// </exception>
- internal int M_CheckYMDEG(int year, int month, int day, ref int era)
- {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- M_ArgumentInRange("day", day, 1,
- GetDaysInMonth(year, month, era));
- return gregorianYear;
- }
-
- /// <summary>
- /// Overrideden. Adds months to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// months.
- /// </param>
- /// <param name="months">The number of months to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="months"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddMonths(DateTime time, int months) {
- return CCGregorianCalendar.AddMonths(time, months);
- }
-
- /// <summary>
- /// Overridden. Adds years to a given date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> to which to add
- /// years.
- /// </param>
- /// <param name="years">The number of years to add.</param>
- /// <returns>A new <see cref="T:System.DateTime"/> value, that
- /// results from adding <paramref name="years"/> to the specified
- /// DateTime.</returns>
- public override DateTime AddYears(DateTime time, int years) {
- return CCGregorianCalendar.AddYears(time, years);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the month from
- /// <paramref name="time"/>.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override int GetDayOfMonth(DateTime time) {
- return CCGregorianCalendar.GetDayOfMonth(time);
- }
-
- /// <summary>
- /// Overriden. Gets the day of the week from the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer giving the day of months, starting with 1.
- /// </returns>
- public override DayOfWeek GetDayOfWeek(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- return (DayOfWeek)CCFixed.day_of_week(rd);
- }
-
- /// <summary>
- /// Overridden. Gives the number of the day in the year.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the day of the year,
- /// starting with 1.</returns>
- public override int GetDayOfYear(DateTime time) {
- return CCGregorianCalendar.GetDayOfYear(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days in the specified month
- /// of the given year and era.
- /// </summary>
- /// <param name="year">An integer that gives the year.
- /// </param>
- /// <param name="month">An integer that gives the month, starting
- /// with 1.</param>
- /// <param name="era">An integer that gives the era of the specified
- /// year.</param>
- /// <returns>An integer that gives the number of days of the
- /// specified month.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if <paramref name="month"/>,
- /// <paramref name="year"/> ,or <paramref name="era"/> is outside
- /// the allowed range.
- /// </exception>
- public override int GetDaysInMonth(int year, int month, int era) {
- int gregorianYear = M_CheckYMEG(year, month, ref era);
- return CCGregorianCalendar.GetDaysInMonth(gregorianYear, month);
- }
-
- /// <summary>
- /// Overridden. Gives the number of days of the specified
- /// year of the given era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An ineger that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of days of the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeExceiption">
- /// The exception is thrown, if
- /// <paramref name="year"/> or <paramref name="era"/> are outside the
- /// allowed range.
- /// </exception>
- public override int GetDaysInYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.GetDaysInYear(gregorianYear);
- }
-
- /// <summary>
- /// Overridden. Gives the era of the specified date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the era of the calendar.
- /// </returns>
- public override int GetEra(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- int era;
- M_EraHandler.EraYear(out era, rd);
- return era;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the month of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the month,
- /// starting with 1.</returns>
- public override int GetMonth(DateTime time) {
- return CCGregorianCalendar.GetMonth(time);
- }
-
- /// <summary>
- /// Overridden. Gives the number of months in the specified year
- /// and era.
- /// </summary>
- /// <param name="year">An integer that specifies the year.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>An integer that gives the number of the months in the
- /// specified year.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or the era are not valid.
- /// </exception>
- public override int GetMonthsInYear(int year, int era) {
- M_CheckYE(year, ref era);
- return 12;
- }
-
- /// <summary>
- /// Overridden. Gives the number of the year of the specified
- /// date.
- /// </summary>
- /// <param name="time">The
- /// <see cref="T:System.DateTime"/> that specifies a
- /// date.
- /// </param>
- /// <returns>An integer representing the year,
- /// starting with 1.</returns>
- public override int GetYear(DateTime time) {
- int rd = CCFixed.FromDateTime(time);
- int era;
- return M_EraHandler.EraYear(out era, rd);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given day
- /// is a leap day.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given day is a leap
- /// day.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, day, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapDay(int year, int month, int day, int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- return CCGregorianCalendar.IsLeapDay(gregorianYear, month, day);
- }
-
- /// <summary>
- /// Overridden. Tells whether the given month
- /// is a leap month.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given month is a leap
- /// month.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year, month, or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapMonth(int year, int month, int era) {
- M_CheckYMEG(year, month, ref era);
- return false;
- }
-
- /// <summary>
- /// Overridden. Tells whether the given year
- /// is a leap year.
- /// </summary>
- /// <param name="year">An integer that specifies the year in the
- /// given era.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A boolean that tells whether the given year is a leap
- /// year.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if the year or era is not
- /// valid.
- /// </exception>
- public override bool IsLeapYear(int year, int era) {
- int gregorianYear = M_CheckYEG(year, ref era);
- return CCGregorianCalendar.is_leap_year(gregorianYear);
- }
-
- /// <summary>
- /// Overridden. Creates the
- /// <see cref="T:System.DateTime"/> from the parameters.
- /// </summary>
- /// <param name="year">An integer that gives the year in the
- /// <paramref name="era"/>.
- /// </param>
- /// <param name="month">An integer that specifies the month.
- /// </param>
- /// <param name="day">An integer that specifies the day.
- /// </param>
- /// <param name="hour">An integer that specifies the hour.
- /// </param>
- /// <param name="minute">An integer that specifies the minute.
- /// </param>
- /// <param name="second">An integer that gives the second.
- /// </param>
- /// <param name="milliseconds">An integer that gives the
- /// milliseconds.
- /// </param>
- /// <param name="era">An integer that specifies the era.
- /// </param>
- /// <returns>A
- /// <see cref="T:system.DateTime"/> representig the date and time.
- /// </returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">
- /// The exception is thrown, if at least one of the parameters
- /// is out of range.
- /// </exception>
- public override DateTime ToDateTime(int year, int month, int day,
- int hour, int minute, int second, int milliseconds,
- int era)
- {
- int gregorianYear = M_CheckYMDEG(year, month, day, ref era);
- M_CheckHMSM(hour, minute, second, milliseconds);
- return CCGregorianCalendar.ToDateTime(
- gregorianYear, month, day,
- hour, minute, second, milliseconds);
- }
-} // class ThaiBuddhistCalendar
-
-} // namespace System.Globalization
diff --git a/mcs/class/corlib/System.Globalization/UnicodeCategory.cs b/mcs/class/corlib/System.Globalization/UnicodeCategory.cs
deleted file mode 100644
index 2db258b3743..00000000000
--- a/mcs/class/corlib/System.Globalization/UnicodeCategory.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Globalization.UnicodeCategory.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Globalization {
-
- 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,
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog b/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog
deleted file mode 100644
index da93dff9265..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-2002-02-19 Duncan Mak <duncan@ximian.com>
-
- * IsolatedStorageFileStream.cs: Added MonoTODO here. This class
- is completely stubbed out (over the summer) and didn't get
- properly MonoTODO'd.
-
-2002-02-08 Duncan Mak <duncan@ximian.com>
-
- * IsolatedStorage.cs: Looked at MemberInfo.cs, another fellow
- abstract class. Oh, that's what it means! Removed unnesscessary
- MonoTODO attributes.
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * IsolatedStorage.cs: Added to CVS, stubbed out the API.
- * IsolatedStorageException.cs: Implemented.
-
-2002-01-07 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created INormalizeForIsolatedStorage
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs b/mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
deleted file mode 100644
index 56d9069d48e..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.IO.IsolatedStorage.INormalizeForIsolatedStorage
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (c) 2002 Duco Fijma
-//
-
-namespace System.IO.IsolatedStorage {
-
-public interface INormalizeForIsolatedStorage {
-
- object Normalize ();
-
-}
-
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs
deleted file mode 100644
index 8a73db56cd8..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.IO.IsolatedStorage.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.IO.IsolatedStorage
-{
- public abstract class IsolatedStorage : MarshalByRefObject
- {
- // Constructor
- protected IsolatedStorage ()
- : base ()
- {
- }
-
- // Properties
- [MonoTODO]
- public object AssemblyIdentity
- {
- get { return null; }
- }
-
- [CLSCompliant (false)]
- [MonoTODO]
- public virtual ulong CurrentSize
- {
- get { return 0; }
- }
-
- [MonoTODO]
- public object DomainIdentity
- {
- get { return null; }
- }
-
- [CLSCompliant (false)]
- [MonoTODO]
- public virtual ulong MaximumSize
- {
- get { return 0; }
- }
-
- [MonoTODO]
- public IsolatedStorageScope Scope
- {
- get { return 0; }
- }
-
- [MonoTODO]
- protected virtual char SeparatorExternal
- {
- get { return Char.MinValue; }
- }
-
- [MonoTODO]
- protected virtual char SeparatorInternal
- {
- get { return Char.MinValue; }
- }
-
- // Methods
- protected abstract IsolatedStoragePermission GetPermission (PermissionSet ps);
-
- [MonoTODO]
- protected void InitStore (IsolatedStorageScope scope, Type domainEvidenceType,
- Type assemblyEvidenceType)
- {
- }
-
- public abstract void Remove ();
- }
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs
deleted file mode 100644
index 51268d65550..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.IO.IsolatedStorage.IsolatedstorageException
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002, Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.IO.IsolatedStorage
-{
- [Serializable]
- public class IsolatedStorageException : Exception
- {
- public IsolatedStorageException ()
- : base (Locale.GetText ("An Isolated storage operation failed."))
- {
- }
-
- public IsolatedStorageException (string message)
- : base (message)
- {
- }
-
- public IsolatedStorageException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected IsolatedStorageException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
deleted file mode 100644
index a8ca0e96fe7..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// System.IO.IsolatedStorage.IsolatedStorageFileStream
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.IO;
-
-namespace System.IO.IsolatedStorage
-{
- [MonoTODO]
- public class IsolatedStorageFileStream : FileStream
- {
- public IsolatedStorageFileStream (string name, FileMode mode)
- : base(name, mode)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs b/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs
deleted file mode 100755
index 84bb413c45c..00000000000
--- a/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageScope.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// IsolatedStorageScope.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:41:21 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO.IsolatedStorage {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum IsolatedStorageScope {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- User = 1,
-
- /// <summary>
- /// </summary>
- Domain = 2,
-
- /// <summary>
- /// </summary>
- Assembly = 4,
- } // IsolatedStorageScope
-
-} // System.IO.IsolatedStorage
diff --git a/mcs/class/corlib/System.IO/BinaryReader.cs b/mcs/class/corlib/System.IO/BinaryReader.cs
deleted file mode 100644
index 573ab00c416..00000000000
--- a/mcs/class/corlib/System.IO/BinaryReader.cs
+++ /dev/null
@@ -1,393 +0,0 @@
-//
-// System.IO.BinaryReader
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-using System;
-using System.Text;
-using System.Globalization;
-
-namespace System.IO {
- public class BinaryReader : IDisposable {
- Stream m_stream;
- Encoding m_encoding;
- int m_encoding_max_byte;
-
- byte[] m_buffer;
- int m_buffer_used;
- int m_buffer_pos;
-
-
- public BinaryReader(Stream input) : this(input, Encoding.UTF8) {
- }
-
- public BinaryReader(Stream input, Encoding encoding) {
- if (input == null || encoding == null)
- throw new ArgumentNullException(Locale.GetText ("Input or Encoding is a null reference."));
- if (!input.CanRead)
- throw new ArgumentException(Locale.GetText ("The stream doesn't support reading."));
-
- m_stream = input;
- m_encoding = encoding;
- m_encoding_max_byte = m_encoding.GetMaxByteCount(1);
- m_buffer = new byte [32];
- }
-
- public virtual Stream BaseStream {
- get {
- return m_stream;
- }
- }
-
- public virtual void Close() {
- Dispose();
- m_stream.Close();
- }
-
- public virtual void Dispose() {
- m_buffer = null;
- m_buffer_used = 0;
- }
-
- protected virtual void FillBuffer(int bytes) {
- if (!EnsureBuffered(m_buffer_used - m_buffer_pos + bytes)) {
- throw new EndOfStreamException();
- }
- }
-
- public virtual int PeekChar() {
- EnsureBuffered(m_encoding_max_byte);
-
- int i;
- for (i = 1; m_encoding.GetCharCount(m_buffer, m_buffer_pos, i) == 0; i++) {
- if (m_buffer_pos + i >= m_buffer_used) {
- return -1;
- }
- }
-
- char[] decode = m_encoding.GetChars(m_buffer, m_buffer_pos, i);
- return decode[0];
- }
-
- public virtual int Read() {
- char[] decode = new char[1];
-
- Read(decode, 0, 1);
- return decode[0];
- }
-
- public virtual int Read(byte[] buffer, int index, int count) {
- if (buffer == null) {
- throw new ArgumentNullException();
- }
- if (buffer.Length - index < count) {
- throw new ArgumentException();
- }
- if (index < 0 || count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- EnsureBuffered(count);
-
- if (m_buffer_used - m_buffer_pos < count) {
- count = m_buffer_used - m_buffer_pos;
- }
-
- Array.Copy(m_buffer, m_buffer_pos, buffer, index, count);
-
- ConsumeBuffered(count);
- return count;
- }
-
- public virtual int Read(char[] buffer, int index, int count) {
- if (buffer == null) {
- throw new ArgumentNullException();
- }
- if (buffer.Length - index < count) {
- throw new ArgumentException();
- }
- if (index < 0 || count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- EnsureBuffered(m_encoding_max_byte * count);
-
- int i;
- for (i = 1; m_encoding.GetCharCount(m_buffer, m_buffer_pos, i) < count; i++) {
- if (m_buffer_pos + i >= m_buffer_used) {
- break;
- }
- }
-
- count = m_encoding.GetCharCount(m_buffer, m_buffer_pos, i);
-
- char[] dec = m_encoding.GetChars(m_buffer, m_buffer_pos, i);
- Array.Copy(dec, 0, buffer, index, count);
-
- ConsumeBuffered(i);
- return count;
- }
-
- protected int Read7BitEncodedInt() {
- int ret = 0;
- int shift = 0;
- int count = 0;
- byte b;
-
- do {
- if (!EnsureBuffered(++count)) {
- throw new EndOfStreamException();
- }
- b = m_buffer[m_buffer_pos + count - 1];
-
- ret = ret | ((b & 0x7f) << shift);
- shift += 7;
- } while ((b & 0x80) == 0x80);
-
- ConsumeBuffered(count);
- return ret;
- }
-
- public virtual bool ReadBoolean() {
- if (!EnsureBuffered(1)) {
- throw new EndOfStreamException();
- }
-
- // Return value:
- // true if the byte is non-zero; otherwise false.
- bool ret = (m_buffer[m_buffer_pos] != 0);
- ConsumeBuffered(1);
- return ret;
- }
-
- public virtual byte ReadByte() {
- if (!EnsureBuffered(1)) {
- throw new EndOfStreamException();
- }
-
- byte ret = m_buffer[m_buffer_pos];
- ConsumeBuffered(1);
- return ret;
- }
-
- public virtual byte[] ReadBytes(int count) {
- if (count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- EnsureBuffered(count);
-
- if (count > m_buffer_used - m_buffer_pos) {
- count = m_buffer_used - m_buffer_pos;
- }
-
- if (count == 0) {
- throw new EndOfStreamException();
- }
-
- byte[] buf = new byte[count];
- Read(buf, 0, count);
- return buf;
- }
-
- public virtual char ReadChar() {
- char[] buf = ReadChars(1);
- return buf[0];
- }
-
- public virtual char[] ReadChars(int count) {
- if (count < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- char[] full = new char[count];
- count = Read(full, 0, count);
-
- if (count != full.Length) {
- char[] ret = new char[count];
- Array.Copy(full, 0, ret, 0, count);
- return ret;
- } else {
- return full;
- }
- }
-
- unsafe public virtual decimal ReadDecimal() {
- if (!EnsureBuffered(16)) {
- throw new EndOfStreamException();
- }
-
- decimal ret;
- byte* ret_ptr = (byte *)&ret;
- for (int i = 0; i < 16; i++) {
- ret_ptr[i] = m_buffer[m_buffer_pos + i];
- }
-
- ConsumeBuffered(16);
- return ret;
- }
-
- public virtual double ReadDouble() {
- if (!EnsureBuffered(8)) {
- throw new EndOfStreamException();
- }
-
- double ret = BitConverter.ToDouble(m_buffer, m_buffer_pos);
- ConsumeBuffered(8);
- return ret;
- }
-
- public virtual short ReadInt16() {
- if (!EnsureBuffered(2)) {
- throw new EndOfStreamException();
- }
-
- short ret = (short) (m_buffer[m_buffer_pos] | (m_buffer[m_buffer_pos + 1] << 8));
- ConsumeBuffered(2);
- return ret;
- }
-
- public virtual int ReadInt32() {
- if (!EnsureBuffered(4)) {
- throw new EndOfStreamException();
- }
-
- int ret = (m_buffer[m_buffer_pos] |
- (m_buffer[m_buffer_pos + 1] << 8) |
- (m_buffer[m_buffer_pos + 2] << 16) |
- (m_buffer[m_buffer_pos + 3] << 24)
- );
- ConsumeBuffered(4);
- return ret;
- }
-
- public virtual long ReadInt64() {
- if (!EnsureBuffered(8)) {
- throw new EndOfStreamException();
- }
-
- uint ret_low = (uint) (m_buffer[m_buffer_pos] |
- (m_buffer[m_buffer_pos + 1] << 8) |
- (m_buffer[m_buffer_pos + 2] << 16) |
- (m_buffer[m_buffer_pos + 3] << 24)
- );
- uint ret_high = (uint) (m_buffer[m_buffer_pos + 4] |
- (m_buffer[m_buffer_pos + 5] << 8) |
- (m_buffer[m_buffer_pos + 6] << 16) |
- (m_buffer[m_buffer_pos + 7] << 24)
- );
- ConsumeBuffered(8);
- return (long) ((((ulong) ret_high) << 32) | ret_low);
- }
-
- [CLSCompliant(false)]
- unsafe public virtual sbyte ReadSByte() {
- if (!EnsureBuffered(1)) {
- throw new EndOfStreamException();
- }
-
- sbyte ret;
- byte* ret_ptr = (byte *)&ret;
- ret_ptr[0] = m_buffer[m_buffer_pos];
-
- ConsumeBuffered(1);
- return ret;
- }
-
- public virtual string ReadString() {
- int len = Read7BitEncodedInt();
-
- char[] str = ReadChars(len);
- string ret = "";
- for (int i = 0; i < str.Length; i++) {
- ret = ret + str[i];
- }
-
- return ret;
- }
-
- public virtual float ReadSingle() {
- if (!EnsureBuffered(4)) {
- throw new EndOfStreamException();
- }
-
- float ret = BitConverter.ToSingle(m_buffer, m_buffer_pos);
- ConsumeBuffered(4);
- return ret;
- }
-
- [CLSCompliant(false)]
- public virtual ushort ReadUInt16() {
- if (!EnsureBuffered(2)) {
- throw new EndOfStreamException();
- }
-
- ushort ret = (ushort) (m_buffer[m_buffer_pos] | (m_buffer[m_buffer_pos + 1] << 8));
- ConsumeBuffered(2);
- return ret;
- }
-
- [CLSCompliant(false)]
- public virtual uint ReadUInt32() {
- if (!EnsureBuffered(4)) {
- throw new EndOfStreamException();
- }
-
- uint ret = (uint) (m_buffer[m_buffer_pos] |
- (m_buffer[m_buffer_pos + 1] << 8) |
- (m_buffer[m_buffer_pos + 2] << 16) |
- (m_buffer[m_buffer_pos + 3] << 24)
- );
- ConsumeBuffered(4);
- return ret;
- }
-
- [CLSCompliant(false)]
- public virtual ulong ReadUInt64() {
- if (!EnsureBuffered(8)) {
- throw new EndOfStreamException();
- }
-
- uint ret_low = (uint) (m_buffer[m_buffer_pos] |
- (m_buffer[m_buffer_pos + 1] << 8) |
- (m_buffer[m_buffer_pos + 2] << 16) |
- (m_buffer[m_buffer_pos + 3] << 24)
- );
- uint ret_high = (uint) (m_buffer[m_buffer_pos + 4] |
- (m_buffer[m_buffer_pos + 5] << 8) |
- (m_buffer[m_buffer_pos + 6] << 16) |
- (m_buffer[m_buffer_pos + 7] << 24)
- );
- ConsumeBuffered(8);
- return (((ulong) ret_high) << 32) | ret_low;
- }
-
-
- bool EnsureBuffered(int bytes) {
- int needed = bytes - (m_buffer_used - m_buffer_pos);
- if (needed < 0)
- return true;
-
- if (m_buffer_used + needed > m_buffer.Length) {
- byte[] old_buffer = m_buffer;
- m_buffer = new byte[m_buffer_used + needed];
- Array.Copy(old_buffer, 0, m_buffer, 0, m_buffer_used);
- m_buffer_pos = m_buffer_used;
- }
-
- int n = m_stream.Read(m_buffer, m_buffer_used, needed);
- if (n == 0) return false;
-
- m_buffer_used += n;
-
- return (m_buffer_used >= m_buffer_pos + bytes);
- }
-
-
- void ConsumeBuffered(int bytes) {
- m_buffer_pos += bytes;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/BinaryWriter.cs b/mcs/class/corlib/System.IO/BinaryWriter.cs
deleted file mode 100755
index f0a5b362f2c..00000000000
--- a/mcs/class/corlib/System.IO/BinaryWriter.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-//
-// System.IO.BinaryWriter
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-using System;
-using System.Text;
-using System.Globalization;
-
-namespace System.IO {
- [Serializable]
- public class BinaryWriter : IDisposable {
-
- // Null is a BinaryWriter with no backing store.
- public static readonly BinaryWriter Null;
-
- protected Stream OutStream;
- private Encoding m_encoding;
- private byte [] buffer;
-
- static BinaryWriter() {
- Null = new BinaryWriter();
- }
-
- protected BinaryWriter() : this (Stream.Null, Encoding.UTF8) {
- }
-
- public BinaryWriter(Stream output) : this(output, Encoding.UTF8) {
- }
-
- public BinaryWriter(Stream output, Encoding encoding) {
- if (output == null || encoding == null)
- throw new ArgumentNullException(Locale.GetText ("Output or Encoding is a null reference."));
- if (!output.CanWrite)
- throw new ArgumentException(Locale.GetText ("Stream does not support writing or already closed."));
-
- OutStream = output;
- m_encoding = encoding;
- buffer = new byte [16];
- }
-
- public virtual Stream BaseStream {
- get {
- return OutStream;
- }
- }
-
- public virtual void Close() {
- Dispose (true);
- }
-
- void IDisposable.Dispose() {
- Dispose (true);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (disposing)
- {
- OutStream.Close();
- //OutStream.Dispose();
- }
- }
-
- public virtual void Flush() {
- OutStream.Flush();
- }
-
- public virtual long Seek(int offset, SeekOrigin origin) {
- return OutStream.Seek(offset, origin);
- }
-
- public virtual void Write(bool value) {
- buffer [0] = (byte) (value ? 1 : 0);
- OutStream.Write(buffer, 0, 1);
- }
-
- public virtual void Write(byte value) {
- OutStream.WriteByte(value);
- }
-
- public virtual void Write(byte[] value) {
- if (value == null)
- throw new ArgumentNullException(Locale.GetText ("Byte buffer is a null reference."));
- OutStream.Write(value, 0, value.Length);
- }
-
- public virtual void Write(byte[] value, int offset, int length) {
- if (value == null)
- throw new ArgumentNullException(Locale.GetText ("Byte buffer is a null reference."));
- OutStream.Write(value, offset, length);
- }
-
- public virtual void Write(char value) {
- char[] dec = new char[1];
- dec[0] = value;
- byte[] enc = m_encoding.GetBytes(dec, 0, 1);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- public virtual void Write(char[] value) {
- if (value == null)
- throw new ArgumentNullException(Locale.GetText ("Chars is a null reference."));
- byte[] enc = m_encoding.GetBytes(value, 0, value.Length);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- public virtual void Write(char[] value, int offset, int length) {
- if (value == null)
- throw new ArgumentNullException(Locale.GetText ("Chars is a null reference."));
- byte[] enc = m_encoding.GetBytes(value, offset, length);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- unsafe public virtual void Write(decimal value) {
- byte* value_ptr = (byte *)&value;
- for (int i = 0; i < 16; i++) {
- buffer [i] = value_ptr [i];
- }
-
- OutStream.Write(buffer, 0, 16);
- }
-
- public virtual void Write(double value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 8);
- }
-
- public virtual void Write(short value) {
- buffer [0] = (byte) value;
- buffer [1] = (byte) (value >> 8);
- OutStream.Write(buffer, 0, 2);
- }
-
- public virtual void Write(int value) {
- buffer [0] = (byte) value;
- buffer [1] = (byte) (value >> 8);
- buffer [2] = (byte) (value >> 16);
- buffer [3] = (byte) (value >> 24);
- OutStream.Write(buffer, 0, 4);
- }
-
- public virtual void Write(long value) {
- for (int i = 0, sh = 0; i < 8; i++, sh += 8)
- buffer [i] = (byte) (value >> sh);
- OutStream.Write(buffer, 0, 8);
- }
-
- [CLSCompliant(false)]
- public virtual void Write(sbyte value) {
- buffer [0] = (byte) value;
- OutStream.Write(buffer, 0, 1);
- }
-
- public virtual void Write(float value) {
- OutStream.Write(BitConverter.GetBytes(value), 0, 4);
- }
-
- public virtual void Write(string value) {
- Write7BitEncodedInt(value.Length);
- byte[] enc = m_encoding.GetBytes(value);
- OutStream.Write(enc, 0, enc.Length);
- }
-
- [CLSCompliant(false)]
- public virtual void Write(ushort value) {
- buffer [0] = (byte) value;
- buffer [1] = (byte) (value >> 8);
- OutStream.Write(buffer, 0, 2);
- }
-
- [CLSCompliant(false)]
- public virtual void Write(uint value) {
- buffer [0] = (byte) value;
- buffer [1] = (byte) (value >> 8);
- buffer [2] = (byte) (value >> 16);
- buffer [3] = (byte) (value >> 24);
- OutStream.Write(buffer, 0, 4);
- }
-
- [CLSCompliant(false)]
- public virtual void Write(ulong value) {
- for (int i = 0, sh = 0; i < 8; i++, sh += 8)
- buffer [i] = (byte) (value >> sh);
- OutStream.Write(buffer, 0, 8);
- }
-
- protected void Write7BitEncodedInt(int value) {
- do {
- int high = (value >> 7) & 0x01ffffff;
- byte b = (byte)(value & 0x7f);
-
- if (high != 0) {
- b = (byte)(b | 0x80);
- }
-
- Write(b);
- value = high;
- } while(value != 0);
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/BufferedStream.cs b/mcs/class/corlib/System.IO/BufferedStream.cs
deleted file mode 100644
index 12039be8b75..00000000000
--- a/mcs/class/corlib/System.IO/BufferedStream.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-//
-// System.IO.BufferedStream
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-namespace System.IO {
- public sealed class BufferedStream : Stream {
- Stream m_stream;
- byte[] m_buffer;
- int m_buffer_pos;
- int m_buffer_read_ahead;
- bool m_buffer_reading;
-
- public BufferedStream(Stream stream) : this(stream, 4096) {
- }
-
- public BufferedStream(Stream stream, int buffer_size) {
- m_stream = stream;
- m_buffer = new byte[buffer_size];
- }
-
- public override bool CanRead {
- get {
- return m_stream.CanRead;
- }
- }
-
- public override bool CanWrite {
- get {
- return m_stream.CanWrite;
- }
- }
-
- public override bool CanSeek {
- get {
- return m_stream.CanSeek;
- }
- }
-
- public override long Length {
- get {
- return m_stream.Length;
- }
- }
-
- public override long Position {
- get {
- return m_stream.Position - m_buffer_read_ahead + m_buffer_pos;
- }
-
- set {
- Flush();
- m_stream.Position = value;
- }
- }
-
- public override void Close() {
- Flush();
- m_stream.Close();
- m_stream = null;
- m_buffer = null;
- }
-
- public override void Flush() {
- if (m_buffer_reading) {
- m_stream.Position = Position;
- } else {
- m_stream.Write(m_buffer, 0, m_buffer_pos);
- }
-
- m_buffer_read_ahead = 0;
- m_buffer_pos = 0;
- }
-
- public override long Seek(long offset, SeekOrigin origin) {
- Flush();
- return m_stream.Seek(offset, origin);
- }
-
- public override void SetLength(long value) {
- m_stream.SetLength(value);
- }
-
- public override int ReadByte() {
- byte[] b = new byte[1];
-
- if (Read(b, 0, 1) == 1) {
- return b[0];
- } else {
- return -1;
- }
- }
-
- public override void WriteByte(byte value) {
- byte[] b = new byte[1];
-
- b[0] = value;
- Write(b, 0, 1);
- }
-
- public override int Read(byte[] array, int offset, int count) {
- if (!m_buffer_reading) {
- Flush();
- m_buffer_reading = true;
- }
-
- if (count <= m_buffer_read_ahead - m_buffer_pos) {
- Array.Copy(m_buffer, m_buffer_pos, array, offset, count);
-
- m_buffer_pos += count;
- if (m_buffer_pos == m_buffer_read_ahead) {
- m_buffer_pos = 0;
- m_buffer_read_ahead = 0;
- }
-
- return count;
- }
-
- int ret = m_buffer_read_ahead - m_buffer_pos;
- Array.Copy(m_buffer, m_buffer_pos, array, offset, ret);
- m_buffer_pos = 0;
- m_buffer_read_ahead = 0;
- offset += ret;
- count -= ret;
-
- if (count >= m_buffer.Length) {
- ret += m_stream.Read(array, offset, count);
- } else {
- m_buffer_read_ahead = m_stream.Read(m_buffer, 0, m_buffer.Length);
-
- if (count < m_buffer_read_ahead) {
- Array.Copy(m_buffer, 0, array, offset, count);
- m_buffer_pos = count;
- ret += count;
- } else {
- Array.Copy(m_buffer, 0, array, offset, m_buffer_read_ahead);
- ret += m_buffer_read_ahead;
- m_buffer_read_ahead = 0;
- }
- }
-
- return ret;
- }
-
- public override void Write(byte[] array, int offset, int count) {
- if (m_buffer_reading) {
- Flush();
- m_buffer_reading = false;
- }
-
- if (m_buffer_pos + count >= m_buffer.Length) {
- Flush();
- m_stream.Write(array, offset, count);
- } else {
- Array.Copy(array, offset, m_buffer, m_buffer_pos, count);
- m_buffer_pos += count;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog
deleted file mode 100644
index 16837b51261..00000000000
--- a/mcs/class/corlib/System.IO/ChangeLog
+++ /dev/null
@@ -1,392 +0,0 @@
-2002-06-17 Dietmar Maurer <dietmar@ximian.com>
-
- * Path.cs (ChangeExtension): handle some special cases (fixes bug #25319)
-
- * File.cs (Delete): only call Directory.Exists() if DirName != ""
-
-2002-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Directory.cs: fixed bug #26133 and also test if the directory exist
- before performing the search.
-
-2002-06-12 Nick Drochak <ndrochak@gol.com>
-
- * StringReader.cs (ReadLine): Return null when we get to end of the
- string.
-
-2002-05-22 Lawrence Pit <loz@cable.a2000.nl>
-
- * StreamWriter.cs: added ability to write null value
-
-2002-05-19 Lawrence Pit <loz@cable.a2000.nl>
-
- * Stream.cs: NullStream.ReadByte now returns -1 instead of 0 to
- prevent endless loops.
-
-2002-05-17 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * FileStream.cs: Enforce lower bound on buffer size.
-
-2002-05-16 Piers Haken <piersh@friskit.com>
-
- * Stream.cs: Implement synchronous {Begin|End}{Read|Write}() methods.
-
-2002-05-17 Nick Drochak <ndrochak@gol.com>
-
- * StreamWriter.cs: Implement buffering. Also implemented dispose
- pattern as recommended by the MS docs. Must call Close() now
- to ensure the buffer is flushed.
-
-2002-05-15 Nick Drochak <ndrochak@gol.com>
-
- * Path.cs (GetDirectoryName): Return String.Empty if there is no
- directory
-
- * StreamReader.cs: Add some parameter checking on file names.
-
- * StreamWriter.cs: Add some parameter checking on file names.
-
-2002-05-14 Nick Drochak <ndrochak@gol.com>
-
- * File.cs: Add parameter checks to most methods. Not completely done,
- but all current unit tests pass.
-
- * Path.cs: Implement GetTempFileName().
-
-2002-05-10 Nick Drochak <ndrochak@gol.com>
-
- * StreamWriter.cs (Flush): Throw proper exception if internal stream
- has already been closed when we try to flush.
-
-2002/05/10 Nick Drochak <ndrochak@gol.com>
-
- * FileNotFoundException.cs (ToString): Don't try to use the inner
- exception, because it might be null. Use the message instead.
-
-2002-05-09 Nick Drochak <ndrochak@gol.com>
-
- * File.cs (Delete): Do not throw an exception if the file does not
- exist.
-
-2002-05-08 Mike Gray <mikeg@mikegray.org>
-
- * File.cs: According to ECMA spec and MS docs Copy(src, dest)
- should not overwrite dest by default.
-
-2002-05-08 Nick Drochak <ndrochak@gol.com>
-
- * StreamWriter.cs: Add paramter check to constructors and throw
- exceptions where appropriate.
-
-Tue May 7 11:47:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * StreamReader.cs: return the number of chars read even if we diddn't
- fill the whole buffer (makes Sergey's ilasm work with mono).
-
-2002-05-07 Mike Gray <mikeg_us@hotmail.com>
-
- * FileInfo.cs (Create): Implement missing method.
-
-2002-05-07 Mike Gray <mikeg_us@hotmail.com>
-
- * File.cs: Implemented CreateText method, and fixed dst compares
- to compare against "" instead of null twice.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * StreamReader.cs: Throw exceptions where needed. Changed Null field to
- use new internal class since null cannot be passed to constructor
- anymore. Also, fix a coule of small bugs.
-
-2002-05-03 Nick Drochak <ndrochak@gol.com>
-
- * MemoryStream.cs: Refrain from allocating array until the space is
- really needed. This fixes a bug in the Length property when the
- constructor without the byte array is used.
-
-2002-05-01 Duncan Mak <duncan@ximian.com>
-
- * DirectoryNotFoundException.cs (constructor): Added missing
- serialization constructor.
-
-2002-04-30 Duncan Mak <duncan@ximian.com>
-
- * FileLoadException.cs (constructors): Added missing (string,
- string) ctor, as well as (string, string, Exception) ctor.
-
- (Message): Added more info to the error message
-
- (ToString): Added. We'll need to add the StackTrace stuff when
- that works.
-
- * FileShare.cs: Add a missing field, Inheritable.
-
- * TextReader.cs: Renamed Synchronised method to Synchronized.
-
- * TextWriter.cs: Renamed Synchronised method to Synchronized.
- Renamed protected member coreNewLine to CoreNewLine.
-
-2002-04-30 Sergey Chaban <serge@wildwestsoftware.com>
-
- * BinaryReader.cs: Allocate buffer before its first use.
- Handle end of stream properly. Methods to read native types
- (ReadInt* etc.) are little-endian (see Compact Framework docs).
-
- * BinaryWriter.cs: Store data in little-endian format.
- Use internal buffer for conversions.
-
-2002-03-31 Dick Porter <dick@ximian.com>
-
- * Directory.cs: Strip out "." and ".." from returned list
-
- * FileAttributes.cs: Get the right enum values
-
-2002-03-28 Dietmar Maurer <dietmar@ximian.com>
-
- * TextWriter.cs (write): added check for null
-
-2002-03-28 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * Directory.cs: Throws DirectoryNotFoundException.
- * MonoIO.cs: Fixed to work around enum problem.
-
-2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * StreamReader.cs: Implemented ReadLine() and ReadEnd().
-
-2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * Directory.cs, File.cs, FileSystemInfo.cs, FileInfo.cs,
- DirectoryInfo.cs, Path.cs: Modified to use MonoIO class instead of
- wrapper and PAL classes.
-
- * MonoIO.cs, MonoIOStat.cs, MonoIOError.cs: Added.
-
-2002-03-25 Mike Kestner <mkestner@speakeasy.net>
-
- * MemoryStream.cs (Read): Fixed bug in exception throw.
-
-2002-03-24 Mike Kestner <mkestner@speakeasy.net>
-
- * StreamReader.cs (ReadBuffer): Fix buffer merging bugs.
-
-2002-03-23 Martin Baulig <martin@gnome.org>
-
- * StreamReader.cs: Always do buffered reading, use 4k blocks.
- (Read (char[], int, int)): Implemented.
- (DiscardBufferedData): Implemented.
-
-2002-03-21 Mike Kestner <mkestner@speakeasy.net>
-
- * StreamReader.cs : Fill out, add buffering, and use encoding.
-
-2002-03-19 Martin Baulig <martin@gnome.org>
-
- * StreamWriter.cs (StreamWriter (string)): The default is to override
- the file, not to append to it.
- (StreamWriter (string path, bool append)): When appending, seek to the
- end of the file, otherwise truncate the file to zero length.
- (Dispose (bool)): Close the internalStream.
- (Flush): Flush the interalStream.
- (Write (char[], int, int)): Flush the internalStream in auto-flush-mode.
-
-2002-03-19 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * FileStream.cs: Flush buffer before FileSetLength.
-
-2002-02-28 Miguel de Icaza <miguel@ximian.com>
-
- * Stream.cs (NullStream): Do not track position, this beast does
- nothing in practice.
-
-2002-03-15 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * SearchPattern.cs: New class. Glob matching code for Directory.
- * Directory.cs: Changed to use SearchPattern instead of mono_glob_*()
-
-2002/03/15 Nick Drochak <ndrochak@gol.com>
-
- * DirectoryInfo.cs: Fixed the overloaded GetDirectories and GetFiles.
- This code seemed to be copied from somewhere, and it was close,
- but didn't match the docs. This was the last bit needed to get
- NAnt to compile with our class libs.
-
-2002-03-12 Duncan Mak <duncan@ximian.com>
-
- * EndOfStreamException.cs:
- * FileLoadException.cs:
- * FileNotFoundException.cs:
- * PathTooLongException.cs: Changed the base classes to IOException
- instead of SystemException.
-
- * IOException.cs: Added missing constructors.
-
-2002-03-07 Nick Drochak <ndrochak@gol.com>
-
- * FileMode.cs: Docs don't say this should be explicitly derived from
- int, so just make it a normal Enum.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * StringReader.cs: Fixed off-by-one error in Peek() and Read().
-
-2002-02-12 Nick Drochak <ndrochak@gol.com>
-
- * PathTooLongException.cs: put it in the correct namespace
- * EndOfStreamException.cs: put it in the correct namespace
-
-Thu Jan 31 17:32:32 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Directory.cs: handle opendir() return NULL and absolute filenames.
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * FileLoadException.cs:
- * FileNotFoundException: Added missing bits for serialization.
-
-Thu Jan 24 17:42:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Directory.cs: allow directories in GetFiles() mask.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * FileInfo.c (CopyTo, MoveTo): Implement.
-
- * FileStream.cs: Add argument checking to the constructor.
-
- * File.cs: Rewrote most of the file. Implement Copy, Open, Create,
- OpenText, OpenWrite, Move. Made pending methods flagged as MonoTODO.
-
- * Directory.cs (Delete): reimplement without using DirectoryInfo.
- (Delete): Implement the recursive version.
- (GetCreationTime, GetLastWriteTime, GetLastAccessTime): Implement.
- (Move): Reimplement.
- (getNames): dead code removal.
-
- * Path.cs: define an internal DirectorySeparatorStr that we use in
- a few spots.
-
- * Wrapper.cs: Updated to new version.
-
- * DirectoryInfo (Delete): Implement using the Directory API.
-
- * DirectoryInfo.cs (GetFiles, GetDirectories, GetFileSystemInfos,
- Delete, Create, Parent, Exists, MoveTo): Implement.
-
- * Directory.cs (GetListing): implement new utility function.
- (GetDirectories): Implement.
- (GetFileSystemEntries): Implement.
- (GetFiles): Implement.
-
- * CheckArgument.cs (Path): Do not allow null by default.
-
-Tue Jan 22 22:53:23 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * DirectoryInfo.cs, FileInfo.cs: do not use Debug from the system
- assembly in corlib.
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * SeekOrigin.cs: Added Serializable attribute.
-
-2002-01-19 Duncan Mak <duncan@ximian.com>
-
- * PathTooLongException.cs:
- * EndOfStreamException.cs: Added to CVS.
-
-Thu Jan 10 12:06:46 MST 2002 Matt Kimball <matt@kimball.net>
-
- * BufferedStream.cs: Initial implemenation. The synchronous
- methods for both reading and writing are implemented. I'll do the
- asynchronous methods in a bit.
-
-Wed Jan 9 16:04:39 MST 2002 Matt Kimball <matt@kimball.net>
-
- * BinaryWriter.cs: Initial implementation. And it's all there.
-
- * BinaryReader.cs: The constructor now uses the passed in encoding,
- not UTF8 always.
-
-Wed Jan 9 13:54:28 MST 2002 Matt Kimball <matt@kimbal.net>
-
- * BinaryReader.cs: Initial implementation. I think it's complete.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * CheckArgument.cs, CheckPermission.cs, Directory.cs: MonoTODO
- attribute decorations.
-
- * DirectoryInfo.cs, File.cs, FileInfo.cs, FileSystemInfo.cs,
- Path.cs, TextReader.cs, TextWriter.cs : Ditto.
-
- * FileLoadException.cs, FileNotFoundException.cs, StreamReader.cs:
- Ditto.
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * FileStream.cs: Use handles rather than casting file descriptors.
- Added Handle property.
-
-Wed Nov 14 16:47:47 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * CheckPermission.cs: disable ModeAccess() code: it's wrong.
- * FileStream.cs: only trow an exception if the read failed in ReadByte().
- * StreamReader.cs: implement Peek and Read.
- * TextWriter.cs: CLSCompliant updates.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * FileNotFoundException.cs: Added some constructors
-
- * Path.cs (GetFullPath): Fixed implementation
-
-Fri Nov 2 18:27:58 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * DirectoryNotFoundException.cs: implemented.
-
-Tue Sep 25 18:54:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * File.cs: fix signatures of the Open() and OpenRead() functions
- (they are static).
-
-Thu Sep 13 18:04:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * FileLoadException.cs, FileNotFoundException.cs: added.
-
-2001-08-28 Dietmar Maurer <dietmar@ximian.com>
-
- * TextReader.cs: implemented the Read method
-
- * StreamReader.cs: impl. stubs
-
- * StreamWriter.cs: impl.
-
- * TextWriter.cs: implemented Write and WriteLine methods
-
-Sun Aug 26 23:01:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * FileAccess.cs, FileMode.cs: change values to be compatible with
- the ms ones.
-
-Sun Aug 26 11:47:56 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * IOException.cs: Implemented System.IO.Exception.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- *SeekOrigin.cs.cs, FileShare.cs, FileMode.cs, FileAccess.cs: Add.
-
-2001-07-19 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * System.IO.MemoryStream.cs: Added. Had quite a few cases of
- "LAMESPEC", but the tests work against the MS implementation so
- the major functions are right (ie. Read/Write/Seek). Some more
- tests required for the various constructors and exceptions.
-
-2001-07-16 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * StringReader.cs, StringWriter.cs, TextReader.cs, TextWriter.cs:
- New class implemenations.
-
- * StringReaderTest.cs, StringWriterTest.cs: Test suite for the above.
-
diff --git a/mcs/class/corlib/System.IO/CheckArgument.cs b/mcs/class/corlib/System.IO/CheckArgument.cs
deleted file mode 100644
index eaf20c0002e..00000000000
--- a/mcs/class/corlib/System.IO/CheckArgument.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.CheckArgument.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 25, 2001
-//
-// NOTE: All contributors can freely add to this class or make modifications
-// that do not break existing usage of methods
-//------------------------------------------------------------------------------
-
-
-using System;
-using System.IO;
-
-namespace System.IO
-{
- /// <summary>
- /// A utility class to assist with various argument validations in System.IO
- /// </summary>
- internal sealed class CheckArgument
- {
- /// <summary>
- /// Generates and exception if arg contains whitepace only
- /// </summary>
- public static void WhitespaceOnly (string arg, string desc)
- {
- if (arg != null && arg.Length > 0)
- {
- string temp = arg;
- temp.Trim ();
- if (temp.Length == 0)
- {
- throw new ArgumentException (desc);
- }
- }
- }
-
- /// <summary>
- /// Generates and exception if arg contains whitepace only
- /// </summary>
- public static void WhitespaceOnly (string arg)
- {
- WhitespaceOnly (arg, "Argument string consists of whitespace characters only.");
- }
-
- /// <summary>
- /// Generates and exception if arg is empty
- /// </summary>
- public static void Empty (string arg, string desc)
- {
- if (arg != null && arg.Length == 0)
- {
- throw new ArgumentException (desc);
- }
- }
-
- /// <summary>
- /// Generates and exception if arg is empty
- /// </summary>
- public static void Empty (string arg)
- {
- Empty (arg, "Argument string is empty.");
- }
-
- /// <summary>
- /// Generates and exception if arg is null
- /// </summary>
- public static void Null (Object arg, string desc)
- {
- if (arg == null)
- {
- throw new ArgumentNullException (desc);
- }
- }
-
- /// <summary>
- /// Generates and exception if arg is null
- /// </summary>
- public static void Null (Object arg)
- {
- if (arg == null)
- {
- throw new ArgumentNullException ();
- }
- }
-
- /// <summary>
- /// Generates and exception if path contains invalid path characters
- /// </summary>
- public static void PathChars (string path, string desc)
- {
- if (path != null)
- {
- if (path.IndexOfAny (System.IO.Path.InvalidPathChars) > -1)
- {
- throw new ArgumentException (desc);
- }
- }
- }
-
- /// <summary>
- /// Generates and exception if path contains invalid path characters
- /// </summary>
- public static void PathChars (string path)
- {
- PathChars (path, "Path contains invalid characters");
- }
-
- /// <summary>
- /// Generates and exception if path too long
- /// </summary>
- [MonoTODO]
- public static void PathLength (string path, string desc)
- {
- //TODO: find out how long is too long
- }
-
- /// <summary>
- /// Generates and exception if path too long
- /// </summary>
- public static void PathLength (string path)
- {
- PathLength (path);
- }
-
- /// <summary>
- /// Generates and exception if path is illegal
- /// </summary>
- public static void Path (string path, bool bAllowNull, bool bLength)
- {
- if (path != null) //allow null
- {
- Empty (path, "Path cannot be the empty string"); // path can't be empty
- WhitespaceOnly (path, "Path cannot be all whitespace"); // path can't be all whitespace
- PathChars (path); // path can't contain invalid characters
- if (bLength)
- {
- PathLength ("Path too long");
- }
- }
- else if (!bAllowNull)
- {
- throw new ArgumentNullException ("Parameter name: path");
- }
- }
-
- /// <summary>
- /// Generates and exception if path is illegal
- /// </summary>
- public static void Path (string path, bool bAllowNull)
- {
- Path (path, bAllowNull, false);
- }
-
- /// <summary>
- /// Generates and exception if path is illegal
- /// </summary>
- public static void Path (string path)
- {
- Path (path, false, false);
- }
-
- }
-} // namespace System.IO.Private
diff --git a/mcs/class/corlib/System.IO/CheckPermission.cs b/mcs/class/corlib/System.IO/CheckPermission.cs
deleted file mode 100644
index 3418850c065..00000000000
--- a/mcs/class/corlib/System.IO/CheckPermission.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.CheckPermission.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 25, 2001
-//
-// NOTE: All contributors can freely add to this class or make modifications
-// that do not break existing usage of methods
-//------------------------------------------------------------------------------
-
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.IO
-{
- /// <summary>
- /// A utility class to assist with various permission validation in System.IO
- /// </summary>
- internal sealed class CheckPermission
- {
- /// <summary>
- /// Generates and exception if caller doesn't have flags access to filesystem item specified by path
- /// </summary>
- [MonoTODO]
- public static void Demand(FileIOPermissionAccess flags, string path)
- {
- FileIOPermission ioPerm = new FileIOPermission(flags, path);
- // FIXME: FileIOPermission is not yet implemented
- //ioPerm.Demand();
- }
-
- public static void Access(FileAccess access, string path)
- {
- switch(access)
- {
- case FileAccess.Read:
- Demand(FileIOPermissionAccess.Read, path);
- break;
- case FileAccess.Write:
- Demand(FileIOPermissionAccess.Write, path);
- break;
- case FileAccess.ReadWrite:
- Demand(FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, path);
- break;
- default:
- // TODO: determine what best to do here
- throw new ArgumentException("Invalid FileAccess parameter");
- }
- }
-
- [MonoTODO]
- public static void ModeAccess(FileMode mode, FileAccess access, string path, bool exists)
- {
-#if false
- // TODO: this logic isn't entirely complete and accurate, yet
- if((mode & (FileMode.CreateNew | FileMode.Create)) != 0)
- {
- CheckPermission.Demand(FileIOPermissionAccess.Write, Path.GetDirectoryName(path));
- }
- else if((mode & FileMode.OpenOrCreate) != 0)
- {
- if(!exists)
- {
- CheckPermission.Demand(FileIOPermissionAccess.Write, Path.GetDirectoryName(path));
- }
- else
- {
- CheckPermission.Access(access, path);
- }
- }
- else if(exists)
- {
- CheckPermission.Access(access, path);
- }
- else
- {
- throw new FileNotFoundException();
- }
-#endif
- }
- }
-} // namespace System.IO.Private
diff --git a/mcs/class/corlib/System.IO/Directory.cs b/mcs/class/corlib/System.IO/Directory.cs
deleted file mode 100644
index a31b74adbd8..00000000000
--- a/mcs/class/corlib/System.IO/Directory.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-//
-// System.IO.Directory.cs
-//
-// Authors:
-// Jim Richardson (develop@wtfo-guru.com)
-// Miguel de Icaza (miguel@ximian.com)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-// Copyright (C) 2002 Ximian, Inc.
-//
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security.Permissions;
-using System.Collections;
-
-namespace System.IO
-{
- public sealed class Directory : Object
- {
- private Directory () {}
-
- public static DirectoryInfo CreateDirectory (string path)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path == "" || path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- if (!MonoIO.CreateDirectory (path))
- throw MonoIO.GetException ();
-
- return new DirectoryInfo (path);
- }
-
- public static void Delete (string path)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path == "" || path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- if (!MonoIO.RemoveDirectory (path))
- throw MonoIO.GetException ();
- }
-
- static void RecursiveDelete (string path)
- {
- foreach (string dir in GetDirectories (path))
- RecursiveDelete (dir);
-
- foreach (string file in GetFiles (path))
- File.Delete (file);
-
- Directory.Delete (path);
- }
-
- public static void Delete (string path, bool recurse)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Path contains invalid characters");
-
- if (recurse == false){
- Delete (path);
- return;
- }
-
- RecursiveDelete (path);
- }
-
- public static bool Exists (string path)
- {
- return MonoIO.ExistsDirectory (path);
- }
-
- public static DateTime GetLastAccessTime (string path)
- {
- return File.GetLastAccessTime (path);
- }
-
- public static DateTime GetLastWriteTime (string path)
- {
- return File.GetLastWriteTime (path);
- }
-
- public static DateTime GetCreationTime (string path)
- {
- return File.GetLastWriteTime (path);
- }
-
- public static string GetCurrentDirectory ()
- {
- /*
- // Implementation complete 08/25/2001 14:24 except for
- // LAMESPEC: documentation specifies invalid exceptions (i think)
- // also shouldn't need Write to getcurrrent should we?
- string str = Environment.CurrentDirectory;
- CheckPermission.Demand (FileIOPermissionAccess.Read & FileIOPermissionAccess.Write, str);
- */
- return Environment.CurrentDirectory;
- }
-
- public static string [] GetDirectories (string path)
- {
- return GetDirectories (path, "*");
- }
-
- public static string [] GetDirectories (string path, string pattern)
- {
- return GetFileSystemEntries (path, pattern, FileAttributes.Directory, FileAttributes.Directory);
- }
-
- public static string GetDirectoryRoot (string path)
- {
- return "" + Path.DirectorySeparatorChar;
- }
-
- public static string [] GetFiles (string path)
- {
- return GetFiles (path, "*");
- }
-
- public static string [] GetFiles (string path, string pattern)
- {
- return GetFileSystemEntries (path, pattern, FileAttributes.Directory, 0);
- }
-
- public static string [] GetFileSystemEntries (string path)
- {
- return GetFileSystemEntries (path, "*");
- }
-
- public static string [] GetFileSystemEntries (string path, string pattern)
- {
- return GetFileSystemEntries (path, pattern, 0, 0);
- }
-
- public static string[] GetLogicalDrives ()
- {
- return new string [] { "A:\\", "C:\\" };
- }
-
- public static DirectoryInfo GetParent (string path)
- {
- return new DirectoryInfo (Path.GetDirectoryName (path));
- }
-
- public static void Move (string src, string dest)
- {
- File.Move (src, dest);
- }
-
- public static void SetCreationTime (string path, DateTime creation_time)
- {
- File.SetCreationTime (path, creation_time);
- }
-
- public static void SetCurrentDirectory (string path)
- {
- /*
- // Implementation complete 08/25/2001 14:24 except for
- // LAMESPEC: documentation specifies invalid exceptions IOException (i think)
- CheckArgument.Path (path, true);
- CheckPermission.Demand (FileIOPermissionAccess.Read & FileIOPermissionAccess.Write, path);
- */
- if (!Exists (path))
- {
- throw new DirectoryNotFoundException ("Directory \"" + path + "\" not found.");
- }
- Environment.CurrentDirectory = path;
- }
-
- public static void SetLastAccessTime (string path, DateTime last_access_time)
- {
- File.SetLastAccessTime (path, last_access_time);
- }
-
- public static void SetLastWriteTime (string path, DateTime last_write_time)
- {
- File.SetLastWriteTime (path, last_write_time);
- }
-
- // private
-
- private static string [] GetFileSystemEntries (string path, string pattern, FileAttributes mask, FileAttributes attrs)
- {
- SearchPattern search;
- MonoIOStat stat;
- IntPtr find;
-
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Path contains invalid characters.");
-
- if (!Directory.Exists (path))
- throw new DirectoryNotFoundException ("Directory '" + path + "' not found.");
-
- search = new SearchPattern (pattern);
-
- find = MonoIO.FindFirstFile (Path.Combine (path , "*"), out stat);
- if (find == MonoIO.InvalidHandle) {
- switch (MonoIO.GetLastError ()) {
- case MonoIOError.ERROR_FILE_NOT_FOUND:
- case MonoIOError.ERROR_PATH_NOT_FOUND:
- string message = String.Format ("Could not find a part of the path \"{0}\"", path);
- throw new DirectoryNotFoundException (message);
- case MonoIOError.ERROR_NO_MORE_FILES:
- return new string [0];
-
- default:
- throw MonoIO.GetException (path);
- }
- }
-
- ArrayList entries = new ArrayList ();
-
- while (true) {
- // Ignore entries of "." and ".." -
- // the documentation doesn't mention
- // it (surprise!) but empirical
- // testing indicates .net never
- // returns "." or ".." in a
- // GetDirectories() list.
- if ((stat.Attributes & mask) == attrs &&
- search.IsMatch (stat.Name) &&
- stat.Name != "." &&
- stat.Name != "..")
- entries.Add (Path.Combine (path, stat.Name));
-
- if (!MonoIO.FindNextFile (find, out stat))
- break;
- }
- MonoIO.FindClose (find);
-
- return (string []) entries.ToArray (typeof (string));
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/DirectoryInfo.cs b/mcs/class/corlib/System.IO/DirectoryInfo.cs
deleted file mode 100644
index 21d0329b5a9..00000000000
--- a/mcs/class/corlib/System.IO/DirectoryInfo.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// System.IO.DirectoryInfo.cs
-//
-// Author:
-// Miguel de Icaza, miguel@ximian.com
-// Jim Richardson, develop@wtfo-guru.com
-// Dan Lewis, dihlewis@yahoo.co.uk
-//
-// Copyright (C) 2002 Ximian, Inc.
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-
-using System;
-using System.Collections;
-
-namespace System.IO {
-
- [Serializable]
- public sealed class DirectoryInfo : FileSystemInfo {
-
- public DirectoryInfo (string path) {
- CheckPath (path);
-
- OriginalPath = path;
- FullPath = Path.GetFullPath (path);
- }
-
- // properties
-
- public override bool Exists {
- get {
- Refresh (false);
-
- if (stat.Attributes == MonoIO.InvalidFileAttributes)
- return false;
-
- if ((stat.Attributes & FileAttributes.Directory) == 0)
- return false;
-
- return true;
- }
- }
-
- public override string Name {
- get {
- return Path.GetFileName (FullPath);
- }
- }
-
- public DirectoryInfo Parent {
- get {
- return new DirectoryInfo (Path.GetDirectoryName (FullPath));
- }
- }
-
- public DirectoryInfo Root {
- get {
- return new DirectoryInfo (Path.GetPathRoot (FullPath));
- }
- }
-
- // creational methods
-
- public void Create () {
- Directory.CreateDirectory (FullPath);
- }
-
- public DirectoryInfo CreateSubdirectory (string name) {
- string path = Path.Combine (FullPath, Path.GetFileName (name));
- Directory.CreateDirectory (path);
-
- return new DirectoryInfo (path);
- }
-
- // directory listing methods
-
- public FileInfo [] GetFiles () {
- return GetFiles ("*");
- }
-
- public FileInfo [] GetFiles (string pattern) {
- string [] names = Directory.GetFiles (FullPath, pattern);
-
- ArrayList infos = new ArrayList ();
- foreach (string name in names)
- infos.Add (new FileInfo (name));
-
- return (FileInfo []) infos.ToArray (typeof (FileInfo));
- }
-
- public DirectoryInfo [] GetDirectories () {
- return GetDirectories ("*");
- }
-
- public DirectoryInfo [] GetDirectories (string pattern) {
- string [] names = Directory.GetDirectories (FullPath, pattern);
-
- ArrayList infos = new ArrayList ();
- foreach (string name in names)
- infos.Add (new DirectoryInfo (name));
-
- return (DirectoryInfo []) infos.ToArray (typeof (DirectoryInfo));
- }
-
- public FileSystemInfo [] GetFileSystemInfos () {
- return GetFileSystemInfos ("*");
- }
-
- public FileSystemInfo [] GetFileSystemInfos (string pattern) {
- ArrayList infos = new ArrayList ();
- infos.AddRange (GetDirectories (pattern));
- infos.AddRange (GetFiles (pattern));
-
- return (FileSystemInfo []) infos.ToArray (typeof (FileSystemInfo));
- }
-
- // directory management methods
-
- public override void Delete () {
- Delete (false);
- }
-
- public void Delete (bool recurse) {
- Directory.Delete (FullPath, recurse);
- }
-
- public void MoveTo (string dest) {
- Directory.Move (FullPath, dest);
- }
-
- public override string ToString () {
- return OriginalPath;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs b/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
deleted file mode 100755
index 1332758d48f..00000000000
--- a/mcs/class/corlib/System.IO/DirectoryNotFoundException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.IO.DirectoryNotFoundException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.IO {
-
- [Serializable]
- public class DirectoryNotFoundException : IOException {
-
- // Constructors
- public DirectoryNotFoundException ()
- : base ("Directory not found")
- {
- }
-
- public DirectoryNotFoundException (string message)
- : base (message)
- {
- }
-
- public DirectoryNotFoundException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected DirectoryNotFoundException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/EndOfStreamException.cs b/mcs/class/corlib/System.IO/EndOfStreamException.cs
deleted file mode 100644
index 88f8460d87a..00000000000
--- a/mcs/class/corlib/System.IO/EndOfStreamException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.IO.EndOfStreamException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.IO
-{
- [Serializable]
- 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)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/File.cs b/mcs/class/corlib/System.IO/File.cs
deleted file mode 100644
index 2c803f72f09..00000000000
--- a/mcs/class/corlib/System.IO/File.cs
+++ /dev/null
@@ -1,273 +0,0 @@
-//
-// System.IO.FIle.cs
-//
-//
-// Authors:
-// Miguel de Icaza (miguel@ximian.com)
-// Jim Richardson (develop@wtfo-guru.com)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// Copyright 2002 Ximian, Inc. http://www.ximian.com
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-
-using System;
-
-namespace System.IO
-{
- /// <summary>
- ///
- /// </summary>
- public sealed class File
- {
- private File () {}
-
-
-
- public static StreamWriter AppendText (string path)
- {
- return new StreamWriter (path, true);
- }
-
- [MonoTODO("Security Permision Checks")]
- public static void Copy (string sourceFilename, string destFilename)
- {
- Copy (sourceFilename, destFilename, false);
- }
-
- public static void Copy (string src, string dest, bool overwrite)
- {
- if (src == null)
- throw new ArgumentNullException ("src");
- if (dest == null)
- throw new ArgumentNullException ("dest");
- if (src.Trim () == "" || src.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("src");
- if (dest.Trim () == "" || dest.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("dest");
- if (src.IndexOf(':') > 1)
- throw new NotSupportedException("src");
- if (dest.IndexOf(':') > 1)
- throw new NotSupportedException("dest");
- if (!Exists (src)) {
- throw new FileNotFoundException (src + " does not exist");
- }
- else {
- if ((GetAttributes(src) & FileAttributes.Directory) == FileAttributes.Directory){
- throw new ArgumentException(src + " is a directory");
- }
- }
- if (Exists (dest)) {
- if ((GetAttributes(dest) & FileAttributes.Directory) == FileAttributes.Directory){
- throw new ArgumentException(dest + " is a directory");
- }
- if (!overwrite)
- throw new IOException (dest + " already exists");
- }
-
- string DirName = Path.GetDirectoryName(dest);
- if (!Directory.Exists (DirName))
- throw new DirectoryNotFoundException("Destination directory not found: " + DirName);
-
- if (!MonoIO.CopyFile (src, dest, overwrite))
- throw MonoIO.GetException ();
- }
-
- public static FileStream Create (string path)
- {
- return Create (path, 8192);
- }
-
- public static FileStream Create (string path, int buffersize)
- {
- if (null == path)
- throw new ArgumentNullException("path");
- if (String.Empty == path.Trim() || path.IndexOfAny(Path.InvalidPathChars) >= 0)
- throw new ArgumentException("path");
- if (path.IndexOf(':') > 1)
- throw new NotSupportedException();
-
- string DirName = Path.GetDirectoryName(path);
- if (!Directory.Exists (DirName))
- throw new DirectoryNotFoundException("Destination directory not found: " + DirName);
- if (Exists(path)){
- if ((GetAttributes(path) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly){
- throw new UnauthorizedAccessException(path + " is a read-only");
- }
- }
-
- return new FileStream (path, FileMode.Create, FileAccess.ReadWrite,
- FileShare.None, buffersize);
- }
-
- public static StreamWriter CreateText(string path)
-
- {
- return new StreamWriter (path, false);
-
- }
-
-
-
- public static void Delete (string path)
- {
- if (null == path)
- throw new ArgumentNullException("path");
- if (String.Empty == path.Trim() || path.IndexOfAny(Path.InvalidPathChars) >= 0)
- throw new ArgumentException("path");
- if (path.IndexOf(':') > 1)
- throw new NotSupportedException();
- if (Directory.Exists (path))
- throw new UnauthorizedAccessException("path is a directory");
-
- string DirName = Path.GetDirectoryName(path);
- if (DirName.Length > 0 && !Directory.Exists (DirName))
- throw new DirectoryNotFoundException("Destination directory not found: " + DirName);
-
- if (!MonoIO.DeleteFile (path)){
- Exception e = MonoIO.GetException ();
- if (! (e is FileNotFoundException))
- throw e;
- }
- }
-
- public static bool Exists (string path)
- {
- // For security reasons no exceptions are thrown, only false is returned if there
- // is any problem with the path or permissions. Minimizes what information can be
- // discovered by using this method.
- if (null == path || String.Empty == path.Trim()
- || path.IndexOfAny(Path.InvalidPathChars) >= 0
- || path.IndexOf(':') > 1)
- return false;
-
- return MonoIO.ExistsFile (path);
- }
-
- public static FileAttributes GetAttributes (string path)
- {
- if (null == path)
- throw new ArgumentNullException("path");
- if (String.Empty == path.Trim() || path.IndexOfAny(Path.InvalidPathChars) >= 0)
- throw new ArgumentException("path");
- if (path.IndexOf(':') > 1)
- throw new NotSupportedException();
-
- string DirName = Path.GetDirectoryName(path);
- if (!Directory.Exists(DirName))
- throw new DirectoryNotFoundException("Directory '" + DirName + "' not found in '" + Environment.CurrentDirectory + "'.");
-
- return MonoIO.GetFileAttributes (path);
- }
-
- public static DateTime GetCreationTime (string path)
- {
- MonoIOStat stat;
-
- MonoIO.GetFileStat (path, out stat);
- return DateTime.FromFileTime (stat.CreationTime);
- }
-
- public static DateTime GetLastAccessTime (string path)
- {
- MonoIOStat stat;
-
- MonoIO.GetFileStat (path, out stat);
- return DateTime.FromFileTime (stat.LastAccessTime);
- }
-
- public static DateTime GetLastWriteTime (string path)
- {
- MonoIOStat stat;
-
- MonoIO.GetFileStat (path, out stat);
- return DateTime.FromFileTime (stat.LastWriteTime);
- }
-
- public static void Move (string src, string dest)
- {
- if (src == null)
- throw new ArgumentNullException ("src");
- if (dest == null)
- throw new ArgumentNullException ("dest");
- if (src.Trim () == "" || src.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("src");
- if (dest.Trim () == "" || dest.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("dest");
- if (src.IndexOf(':') > 1)
- throw new NotSupportedException("src");
- if (dest.IndexOf(':') > 1)
- throw new NotSupportedException("dest");
- if (!Exists (src))
- throw new FileNotFoundException (src + " does not exist");
- if (Exists (dest) && ((GetAttributes(dest) & FileAttributes.Directory) == FileAttributes.Directory))
- throw new ArgumentException(dest + " is a directory");
-
- string DirName;
- DirName = Path.GetDirectoryName(src);
- if (!Directory.Exists (DirName))
- throw new DirectoryNotFoundException("Source directory not found: " + DirName);
- DirName = Path.GetDirectoryName(dest);
- if (!Directory.Exists (DirName))
- throw new DirectoryNotFoundException("Destination directory not found: " + DirName);
-
- if (!MonoIO.MoveFile (src, dest))
- throw MonoIO.GetException ();
- }
-
- public static FileStream Open (string path, FileMode mode)
- {
- return new FileStream (path, mode, FileAccess.ReadWrite, FileShare.None);
- }
-
- public static FileStream Open (string path, FileMode mode, FileAccess access)
- {
- return new FileStream (path, mode, access, FileShare.None);
- }
-
- public static FileStream Open (string path, FileMode mode, FileAccess access,
- FileShare share)
- {
- return new FileStream (path, mode, access, share);
- }
-
- public static FileStream OpenRead (string path)
- {
- return new FileStream (path, FileMode.Open, FileAccess.Read, FileShare.Read);
- }
-
- public static StreamReader OpenText (string path)
- {
- return new StreamReader (path);
- }
-
- public static FileStream OpenWrite (string path)
- {
- return new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);
- }
-
- public static void SetAttributes (string path, FileAttributes attributes)
- {
- if (!MonoIO.SetFileAttributes (path, attributes))
- throw MonoIO.GetException (path);
- }
-
- public static void SetCreationTime (string path, DateTime creation_time)
- {
- if (!MonoIO.SetFileTime (path, creation_time.Ticks, -1, -1))
- throw MonoIO.GetException (path);
- }
-
- public static void SetLastAccessTime (string path, DateTime last_access_time)
- {
- if (!MonoIO.SetFileTime (path, -1, last_access_time.Ticks, -1))
- throw MonoIO.GetException (path);
- }
-
- public static void SetLastWriteTime (string path, DateTime last_write_time)
- {
- if (!MonoIO.SetFileTime (path, -1, -1, last_write_time.Ticks))
- throw MonoIO.GetException (path);
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileAccess.cs b/mcs/class/corlib/System.IO/FileAccess.cs
deleted file mode 100644
index c6eefb3aa6f..00000000000
--- a/mcs/class/corlib/System.IO/FileAccess.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// FileAccess.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:20 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum FileAccess : int {
-
- /// <summary>
- /// </summary>
- Read = 0x00000001,
-
- /// <summary>
- /// </summary>
- Write = 0x00000002,
-
- /// <summary>
- /// </summary>
- ReadWrite = Read | Write,
- } // FileAccess
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/FileAttributes.cs b/mcs/class/corlib/System.IO/FileAttributes.cs
deleted file mode 100644
index 3f187be6910..00000000000
--- a/mcs/class/corlib/System.IO/FileAttributes.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.FileAttributes.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-
-namespace System.IO
-{
- [Flags]
- [Serializable]
- public enum FileAttributes : int
- {
- Archive = 0x00020,
- Compressed = 0x00800,
- Device = 0x00040, // Reserved for future use (NOT the w32 value).
- Directory = 0x00010,
- Encrypted = 0x04000, // NOT the w32 value
- Hidden = 0x00002,
- Normal = 0x00080,
- NotContentIndexed = 0x02000,
- Offline = 0x01000,
- ReadOnly = 0x00001,
- ReparsePoint = 0x00400,
- SparseFile = 0x00200,
- System = 0x00004,
- Temporary = 0x00100
- }
-
-}
diff --git a/mcs/class/corlib/System.IO/FileInfo.cs b/mcs/class/corlib/System.IO/FileInfo.cs
deleted file mode 100644
index 87a1f94747a..00000000000
--- a/mcs/class/corlib/System.IO/FileInfo.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.FileInfo.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Dan Lewis (dihlewis@yahoo.co.uk)
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System.IO {
-
- [Serializable]
- public sealed class FileInfo : FileSystemInfo {
-
- public FileInfo (string path) {
- CheckPath (path);
-
- OriginalPath = path;
- FullPath = Path.GetFullPath (path);
- }
-
- // public properties
-
- public override bool Exists {
- get {
- Refresh (false);
-
- if (stat.Attributes == MonoIO.InvalidFileAttributes)
- return false;
-
- if ((stat.Attributes & FileAttributes.Directory) != 0)
- return false;
-
- return true;
- }
- }
-
- public override string Name {
- get {
- return Path.GetFileName (FullPath);
- }
- }
-
- public long Length {
- get {
- if (!Exists)
- throw new FileNotFoundException ("Could not find file \"" + OriginalPath + "\".");
-
- return stat.Length;
- }
- }
-
- public string DirectoryName {
- get {
- return Path.GetDirectoryName (FullPath);
- }
- }
-
- public DirectoryInfo Directory {
- get {
- return new DirectoryInfo (DirectoryName);
- }
- }
-
- // streamreader methods
-
- public StreamReader OpenText () {
- return new StreamReader (Open (FileMode.Open, FileAccess.Read));
- }
-
- public StreamWriter CreateText () {
- return new StreamWriter (Open (FileMode.Create, FileAccess.Write));
- }
-
- public StreamWriter AppendText () {
- return new StreamWriter (Open (FileMode.Append, FileAccess.Write));
- }
-
- // filestream methods
-
- public FileStream Create ()
- {
- return File.Create (FullPath);
- }
-
-
- public FileStream OpenRead () {
- return Open (FileMode.Open, FileAccess.Read);
- }
-
- public FileStream OpenWrite () {
- return Open (FileMode.OpenOrCreate, FileAccess.Write);
- }
-
- public FileStream Open (FileMode mode) {
- return Open (mode, FileAccess.ReadWrite);
- }
-
- public FileStream Open (FileMode mode, FileAccess access) {
- return Open (mode, access, FileShare.None);
- }
-
- public FileStream Open (FileMode mode, FileAccess access, FileShare share) {
- return new FileStream (FullPath, mode, access, share);
- }
-
- // file methods
-
- public override void Delete () {
- if (!MonoIO.Exists (FullPath)) // a weird MS.NET behaviour
- return;
-
- if (!MonoIO.DeleteFile (FullPath))
- throw MonoIO.GetException (OriginalPath);
- }
-
- public void MoveTo (string dest) {
- File.Move (FullPath, dest);
- }
-
- public FileInfo CopyTo (string path) {
- return CopyTo (path, false);
- }
-
- public FileInfo CopyTo (string path, bool overwrite) {
- string dest = Path.GetFullPath (path);
- File.Copy (FullPath, dest);
-
- return new FileInfo (dest);
- }
-
- public override string ToString () {
- return OriginalPath;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileLoadException.cs b/mcs/class/corlib/System.IO/FileLoadException.cs
deleted file mode 100755
index 8db1cd291a4..00000000000
--- a/mcs/class/corlib/System.IO/FileLoadException.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// System.IO.FileLoadException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.IO {
- [Serializable]
- public class FileLoadException : IOException {
-
- // Fields
- string msg;
- Exception inner;
- string fileName;
- string fusionLog;
-
- // Constructors
- public FileLoadException ()
- : base (Locale.GetText ("I/O Error"))
- {
- msg = Locale.GetText ("I/O Error");
- }
-
- public FileLoadException (string message)
- : base (message)
- {
- msg = message;
- }
-
- public FileLoadException (string message, string fileName)
- : base (message)
- {
- this.msg = message;
- this.fileName = fileName;
- }
-
- public FileLoadException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- this.inner = inner;
- }
-
- public FileLoadException (string message, string fileName, Exception inner)
- : base (message, inner)
- {
- this.msg = message;
- this.fileName = fileName;
- this.inner = inner;
- }
-
- protected FileLoadException (SerializationInfo info, StreamingContext context)
- {
- fileName = info.GetString ("FileLoad_FileName");
- fusionLog = info.GetString ("FileLoad_FusionLog");
- }
-
- // Properties
- public override string Message
- {
- get {
- if (fileName != null)
- return Locale.GetText (msg + ": " + fileName);
- else
- return msg;
- }
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- public string FusionLog
- {
- 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);
- }
-
- [MonoTODO]
- public override string ToString ()
- {
- return "System.IO.FileLoadException: " + Message;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileMode.cs b/mcs/class/corlib/System.IO/FileMode.cs
deleted file mode 100644
index c32a53408bf..00000000000
--- a/mcs/class/corlib/System.IO/FileMode.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// FileMode.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:13 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- public enum FileMode {
-
- /// <summary>
- /// </summary>
- CreateNew = 1,
-
- /// <summary>
- /// </summary>
- Create = 2,
-
- /// <summary>
- /// </summary>
- Open = 3,
-
- /// <summary>
- /// </summary>
- OpenOrCreate = 4,
-
- /// <summary>
- /// </summary>
- Truncate = 5,
-
- /// <summary>
- /// </summary>
- Append = 6,
- } // FileMode
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/FileNotFoundException.cs b/mcs/class/corlib/System.IO/FileNotFoundException.cs
deleted file mode 100755
index 6ef477f4d85..00000000000
--- a/mcs/class/corlib/System.IO/FileNotFoundException.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.IO.FileNotFoundException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.IO {
-
- [Serializable]
- public class FileNotFoundException : IOException {
- private string fileName;
- private string fusionLog;
- private string msg;
- private Exception inner;
-
- // Constructors
- public FileNotFoundException ()
- : base (Locale.GetText ("File not found"))
- {
- msg = "File not found";
- }
-
- public FileNotFoundException (string message)
- : base (message)
- {
- msg = message;
- }
-
- public FileNotFoundException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- this.inner = inner;
- }
-
- public FileNotFoundException (string message, string fileName)
- : base (message)
- {
- msg = message;
- this.fileName = fileName;
- }
-
- public FileNotFoundException (string message, string fileName, Exception innerException)
- : base (message, innerException)
- {
- msg = message;
- this.fileName = fileName;
- inner = innerException;
- }
-
- 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
- {
- get { return fusionLog; }
- }
-
- public override string Message
- {
- get { return Locale.GetText (msg); }
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("FileNotFound_FileName", fileName);
- info.AddValue ("FileNotFound_FusionLog", fusionLog);
- }
-
- public override string ToString ()
- {
- return "System.IO.FileNotFoundException: " + msg;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileShare.cs b/mcs/class/corlib/System.IO/FileShare.cs
deleted file mode 100644
index 8e4fac4eef7..00000000000
--- a/mcs/class/corlib/System.IO/FileShare.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// FileShare.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:26 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum FileShare : int {
-
- None = 0,
- Read = 1,
- Write = 2,
- ReadWrite = 3,
- Inheritable = 16,
- } // FileShare
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/FileStream.cs b/mcs/class/corlib/System.IO/FileStream.cs
deleted file mode 100644
index 7180992ca84..00000000000
--- a/mcs/class/corlib/System.IO/FileStream.cs
+++ /dev/null
@@ -1,339 +0,0 @@
-//
-// System.IO/FileStream.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-// FIXME: emit the correct exceptions everywhere. add error handling.
-
-namespace System.IO
-{
-
- public class FileStream : Stream
- {
- // construct from handle
-
- public FileStream (IntPtr handle, FileAccess access)
- : this (handle, access, true, DefaultBufferSize, false) {}
-
- public FileStream (IntPtr handle, FileAccess access, bool ownsHandle)
- : this (handle, access, ownsHandle, DefaultBufferSize, false) {}
-
- public FileStream (IntPtr handle, FileAccess access, bool ownsHandle, int bufferSize)
- : this (handle, access, ownsHandle, bufferSize, false) {}
-
- public FileStream (IntPtr handle, FileAccess access, bool ownsHandle, int bufferSize, bool isAsync)
- {
- this.handle = handle;
- this.access = access;
- this.owner = ownsHandle;
- this.async = isAsync;
-
- InitBuffer (bufferSize);
- }
-
- // construct from filename
-
- public FileStream (string name, FileMode mode)
- : this (name, mode, FileAccess.ReadWrite, FileShare.ReadWrite, DefaultBufferSize, false) { }
-
- public FileStream (string name, FileMode mode, FileAccess access)
- : this (name, mode, access, FileShare.ReadWrite, DefaultBufferSize, false) { }
-
- public FileStream (string name, FileMode mode, FileAccess access, FileShare share)
- : this (name, mode, access, share, DefaultBufferSize, false) { }
-
- public FileStream (string name, FileMode mode, FileAccess access, FileShare share, int bufferSize)
- : this (name, mode, access, share, bufferSize, false) { }
-
- public FileStream (string name, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool isAsync)
- {
- if (name == null)
- throw new ArgumentNullException ();
- if (name == "" || name.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ();
-
- // TODO: demand permissions
-
- this.handle = MonoIO.Open (name, mode, access, share);
- if (handle == MonoIO.InvalidHandle)
- throw MonoIO.GetException ();
-
- this.access = access;
- this.owner = true;
- this.async = isAsync;
-
- InitBuffer (bufferSize);
- }
-
- // properties
-
- public override bool CanRead {
- get {
- return access == FileAccess.Read ||
- access == FileAccess.ReadWrite;
- }
- }
-
- public override bool CanWrite {
- get {
- return access == FileAccess.Write ||
- access == FileAccess.ReadWrite;
- }
- }
-
- public override bool CanSeek {
- get {
- return true; // FIXME: false for pipes & streams
- }
- }
-
- public override long Length {
- get { return MonoIO.GetLength (handle); }
- }
-
- public override long Position {
- get { return buf_start + buf_offset; }
- set { Seek (value, SeekOrigin.Begin); }
- }
-
- public virtual IntPtr Handle {
- get { return handle; }
- }
-
- // methods
-
- public override int ReadByte ()
- {
- if (buf_offset >= buf_length) {
- RefillBuffer ();
-
- if (buf_length == 0)
- return -1;
- }
-
- return buf [buf_offset ++];
- }
-
- public override void WriteByte (byte value)
- {
- if (buf_offset == buf_size)
- FlushBuffer ();
-
- buf [buf_offset ++] = value;
- if (buf_offset > buf_length)
- buf_length = buf_offset;
-
- buf_dirty = true;
- }
-
- public override int Read (byte[] dest, int dest_offset, int count)
- {
- int copied = 0;
- while (count > 0) {
- int n = ReadSegment (dest, dest_offset + copied, count);
- copied += n;
- count -= n;
-
- if (count == 0)
- break;
-
- if (count > buf_size) { // shortcut for long reads
- FlushBuffer ();
-
- MonoIO.Seek (handle, buf_start, SeekOrigin.Begin);
- n = MonoIO.Read (handle, dest, dest_offset + copied, count);
-
- copied += n;
- buf_start += n;
- break;
- }
-
- RefillBuffer ();
- if (buf_length == 0)
- break;
- }
-
- return copied;
- }
-
- public override void Write (byte[] src, int src_offset, int count)
- {
- int copied = 0;
- while (count > 0) {
- int n = WriteSegment (src, src_offset + copied, count);
- copied += n;
- count -= n;
-
- if (count == 0)
- break;
-
- FlushBuffer ();
-
- if (count > buf_size) { // shortcut for long writes
- MonoIO.Write (handle, src, src_offset + copied, count);
- buf_start += count;
- break;
- }
- }
- }
-
- public override long Seek (long offset, SeekOrigin origin)
- {
- long pos;
-
- // make absolute
-
- switch (origin) {
- case SeekOrigin.End:
- pos = Length - offset;
- break;
-
- case SeekOrigin.Current:
- pos = Position + offset;
- break;
-
- case SeekOrigin.Begin: default:
- pos = offset;
- break;
- }
-
- if (pos >= buf_start && pos <= buf_start + buf_length) {
- buf_offset = (int) (pos - buf_start);
- return pos;
- }
-
- FlushBuffer ();
- buf_start = MonoIO.Seek (handle, pos, SeekOrigin.Begin);
-
- return buf_start;
- }
-
- public override void SetLength (long length)
- {
- Flush ();
- MonoIO.SetLength (handle, length);
- }
-
- public override void Flush ()
- {
- FlushBuffer ();
- MonoIO.Flush (handle);
- }
-
- public override void Close ()
- {
- Dispose (true);
- GC.SuppressFinalize (this); // remove from finalize queue
- }
-
- // protected
-
- ~FileStream ()
- {
- Dispose (false);
- }
-
- protected virtual void Dispose (bool disposing) {
- if (handle != MonoIO.InvalidHandle) {
- Flush ();
- MonoIO.Close (handle);
-
- handle = MonoIO.InvalidHandle;
- }
-
- if (disposing)
- buf = null;
- }
-
- // private
-
- private int ReadSegment (byte [] dest, int dest_offset, int count)
- {
- if (count > buf_length - buf_offset)
- count = buf_length - buf_offset;
-
- if (count > 0) {
- Buffer.BlockCopy (buf, buf_offset, dest, dest_offset, count);
- buf_offset += count;
- }
-
- return count;
- }
-
- private int WriteSegment (byte [] src, int src_offset, int count)
- {
- if (count > buf_size - buf_offset)
- count = buf_size - buf_offset;
-
- if (count > 0) {
- Buffer.BlockCopy (src, src_offset, buf, buf_offset, count);
- buf_offset += count;
- if (buf_offset > buf_length)
- buf_length = buf_offset;
-
- buf_dirty = true;
- }
-
- return count;
- }
-
- private void FlushBuffer ()
- {
- if (buf_dirty) {
- MonoIO.Seek (handle, buf_start, SeekOrigin.Begin);
- MonoIO.Write (handle, buf, 0, buf_length);
- }
-
- buf_start += buf_length;
- buf_offset = buf_length = 0;
- buf_dirty = false;
- }
-
- private void RefillBuffer ()
- {
- FlushBuffer ();
-
- MonoIO.Seek (handle, buf_start, SeekOrigin.Begin);
- buf_length = MonoIO.Read (handle, buf, 0, buf_size);
- }
-
- private void InitBuffer (int size)
- {
- if (size < 0)
- throw new ArgumentOutOfRangeException ("Buffer size cannot be negative.");
- if (size < 8)
- size = 8;
-
- buf = new byte [size];
- buf_size = size;
- buf_start = 0;
- buf_offset = buf_length = 0;
- buf_dirty = false;
- }
-
- // fields
-
- private static int DefaultBufferSize = 8192;
-
- private FileAccess access;
- private bool owner;
- private bool async;
-
- private byte [] buf; // the buffer
- private int buf_size; // capacity in bytes
- private int buf_length; // number of valid bytes in buffer
- private int buf_offset; // position of next byte
- private bool buf_dirty; // true if buffer has been written to
- private long buf_start; // location of buffer in file
-
- IntPtr handle; // handle to underlying file
- }
-}
diff --git a/mcs/class/corlib/System.IO/FileSystemInfo.cs b/mcs/class/corlib/System.IO/FileSystemInfo.cs
deleted file mode 100644
index b03e43395cd..00000000000
--- a/mcs/class/corlib/System.IO/FileSystemInfo.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.FileSystemInfo.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Dan Lewis (dihlewis@yahoo.co.uk)
-// Created: Monday, August 13, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System.IO {
-
- [Serializable]
- public abstract class FileSystemInfo : MarshalByRefObject {
- // public properties
-
- public abstract bool Exists { get; }
-
- public abstract string Name { get; }
-
- public virtual string FullName {
- get {
- return FullPath;
- }
- }
-
- public string Extension {
- get {
- return Path.GetExtension (Name);
- }
- }
-
- public FileAttributes Attributes {
- get {
- Refresh (false);
- return stat.Attributes;
- }
-
- set {
- if (!MonoIO.SetFileAttributes (FullName, value))
- throw MonoIO.GetException ();
- }
- }
-
- public DateTime CreationTime {
- get {
- Refresh (false);
- return DateTime.FromFileTime (stat.CreationTime);
- }
-
- set {
- long filetime = value.ToFileTime ();
-
- if (!MonoIO.SetFileTime (FullName, filetime, -1, -1))
- throw MonoIO.GetException ();
- }
- }
-
- public DateTime LastAccessTime {
- get {
- Refresh (false);
- return DateTime.FromFileTime (stat.LastAccessTime);
- }
-
- set {
- long filetime = value.ToFileTime ();
-
- if (!MonoIO.SetFileTime (FullName, -1, filetime, -1))
- throw MonoIO.GetException ();
- }
- }
-
- public DateTime LastWriteTime {
- get {
- Refresh (false);
- return DateTime.FromFileTime (stat.LastWriteTime);
- }
-
- set {
- long filetime = value.ToFileTime ();
-
- if (!MonoIO.SetFileTime (FullName, -1, -1, filetime))
- throw MonoIO.GetException ();
- }
- }
-
- // public methods
-
- public abstract void Delete ();
-
- public void Refresh ()
- {
- Refresh (true);
- }
-
- // protected
-
- protected FileSystemInfo ()
- {
- this.valid = false;
- this.FullPath = null;
- }
-
- protected string FullPath;
- protected string OriginalPath;
-
- // internal
-
- internal void Refresh (bool force)
- {
- if (valid && !force)
- return;
-
- MonoIO.GetFileStat (FullName, out stat);
- valid = true;
- }
-
- internal void CheckPath (string path)
- {
- if (path == null)
- throw new ArgumentNullException ();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException ("Invalid characters in path.");
- }
-
- internal MonoIOStat stat;
- internal bool valid;
- }
-}
diff --git a/mcs/class/corlib/System.IO/IOException.cs b/mcs/class/corlib/System.IO/IOException.cs
deleted file mode 100644
index 74593cd03cf..00000000000
--- a/mcs/class/corlib/System.IO/IOException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.IO.IOException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.IO {
- [Serializable]
- public class IOException : SystemException {
-
- // Constructors
- public IOException ()
- : base ("I/O Error")
- {
- }
-
- public IOException (string message)
- : base (message)
- {
- }
-
- public IOException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected IOException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- public IOException (string message, int hresult)
- : base (message)
- {
- this.HResult = hresult;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/MemoryStream.cs b/mcs/class/corlib/System.IO/MemoryStream.cs
deleted file mode 100644
index 2d0ba613512..00000000000
--- a/mcs/class/corlib/System.IO/MemoryStream.cs
+++ /dev/null
@@ -1,409 +0,0 @@
-//
-// System.IO.MemoryStream
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Clarify some of the lamespec issues
-//
-
-namespace System.IO {
- [Serializable]
- public class MemoryStream : Stream {
- private bool canRead;
- private bool canSeek;
- private bool canWrite;
-
- private bool allowGetBuffer;
-
- private int capacity;
-
- private byte[] internalBuffer;
-
- private int initialLength;
- private bool expandable;
-
- private bool streamClosed = false;
-
- private long position = 0;
-
- public MemoryStream() {
- canRead = true;
- canSeek = true;
- canWrite = true;
-
- capacity = 0;
-
- internalBuffer = new byte[0];
-
- allowGetBuffer = true;
- expandable = true;
- }
-
- public MemoryStream( byte[] buffer ) {
- InternalConstructor( buffer, 0, buffer.Length, true, false );
- }
-
- public MemoryStream( int capacity ) {
-
- canRead = true;
- canSeek = true;
- canWrite = true;
-
- this.capacity = capacity;
- initialLength = 0;
- internalBuffer = new byte[ 0 ];
-
- expandable = true;
- allowGetBuffer = true;
- }
-
- public MemoryStream( byte[] buffer, bool writeable ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- }
-
- InternalConstructor( buffer, 0, buffer.Length, writeable, true );
-
- }
-
- public MemoryStream( byte[] buffer, int index, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- }
-
- InternalConstructor( buffer, index, count, true, false );
- }
-
- public MemoryStream( byte[] buffer, int index, int count, bool writeable ) {
-
- if( buffer == null ) {
- throw new ArgumentNullException();
- }
-
- InternalConstructor( buffer, index, count, writeable, true );
- }
-
- public MemoryStream( byte[] buffer, int index, int count, bool writeable, bool publicallyVisible ) {
- InternalConstructor( buffer, index, count, writeable, publicallyVisible );
- }
-
- private void InternalConstructor( byte[] buffer, int index, int count, bool writeable, bool publicallyVisible ) {
-
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if ( index < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if ( buffer.Length - index < count ) {
- throw new ArgumentException();
- }
-
- // LAMESPEC: The spec says to throw an UnauthorisedAccessException if
- // publicallyVisibile is fale?! Doesn't that defy the point of having
- // it there in the first place. I'll leave it out for now.
-
- canRead = true;
- canSeek = true;
- canWrite = writeable;
-
- initialLength = count;
-
- internalBuffer = new byte[ count ];
- capacity = count;
-
- Array.Copy( buffer, index, internalBuffer, 0, count );
-
- allowGetBuffer = publicallyVisible;
- expandable = false;
- }
-
- public override bool CanRead {
- get {
- return this.canRead;
- }
- }
-
- public override bool CanSeek {
- get {
- return this.canSeek;
- }
- }
-
- public override bool CanWrite {
- get {
- return this.canWrite;
- }
- }
-
- public virtual int Capacity {
- get {
- return this.capacity;
- }
-
- set {
- if( value < 0 || value < capacity ) {
- throw new ArgumentOutOfRangeException( "New capacity cannot be negative or less than the current capacity" );
- } else if( !expandable ) {
- throw new NotSupportedException( "Cannot expand this MemoryStream" );
- }
-
- byte[] newBuffer = new byte[ value ];
- Array.Copy( internalBuffer, 0, newBuffer, 0, capacity );
- capacity = value;
- }
- }
-
- public override long Length {
- get {
- // LAMESPEC: The spec says to throw an IOException if the
- // stream is closed and an ObjectDisposedException if
- // "methods were called after the stream was closed". What
- // is the difference?
-
- if( streamClosed ) {
- throw new IOException( "MemoryStream is closed" );
- }
-
- return internalBuffer.Length;
- }
- }
-
- public override long Position {
- get {
- if( streamClosed ) {
- throw new IOException( "MemoryStream is closed" );
- }
-
- return position;
- }
-
- set {
-
- if( position < 0 ) {
- throw new ArgumentOutOfRangeException( "Position cannot be negative" );
- } else if( streamClosed ) {
- throw new IOException( "MemoryStream is closed" );
- }
-
- position = value;
-
- if( position > internalBuffer.Length + 1 ) {
- position = internalBuffer.Length + 1;
- }
- }
- }
-
- public override void Close() {
- if( streamClosed ) {
- throw new IOException( "MemoryStream already closed" );
- }
-
- streamClosed = true;
- }
-
- public override void Flush() { }
-
- public virtual byte[] GetBuffer() {
- if( !allowGetBuffer ) {
- throw new UnauthorizedAccessException();
- }
-
- return internalBuffer;
- }
-
- public override int Read( byte[] buffer, int offset, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( offset < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if( buffer.Length - offset < count ) {
- throw new ArgumentException();
- } else if ( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
- long ReadTo;
-
- if( position + count > internalBuffer.Length ) {
- ReadTo = internalBuffer.Length;
- } else {
- ReadTo = position + (long)count;
- }
-
- Array.Copy( internalBuffer, (int)position, buffer, offset, (int)(ReadTo - position) );
-
- int bytesRead = (int)(ReadTo - position);
-
- position = ReadTo;
-
- return bytesRead;
- }
-
- public override int ReadByte( ) {
- if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
-
- // LAMESPEC: What happens if we're at the end of the stream? It's unspecified in the
- // docs but tests against the MS impl. show it returns -1
- //
-
- if( position >= internalBuffer.Length ) {
- return -1;
- } else {
- return internalBuffer[ position++ ];
- }
- }
-
- public override long Seek( long offset, SeekOrigin loc ) {
- long refPoint;
-
- if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
- switch( loc ) {
- case SeekOrigin.Begin:
- refPoint = 0;
- break;
- case SeekOrigin.Current:
- refPoint = position;
- break;
- case SeekOrigin.End:
- refPoint = internalBuffer.Length;
- break;
- default:
- throw new ArgumentException( "Invalid SeekOrigin" );
- }
-
- // LAMESPEC: My goodness, how may LAMESPECs are there in this
- // class! :) In the spec for the Position property it's stated
- // "The position must not be more than one byte beyond the end of the stream."
- // In the spec for seek it says "Seeking to any location beyond the length of the
- // stream is supported." That's a contradiction i'd say.
- // I guess seek can go anywhere but if you use position it may get moved back.
-
- if( refPoint + offset < 0 ) {
- throw new IOException( "Attempted to seek before start of MemoryStream" );
- } else if( offset > internalBuffer.Length ) {
- throw new ArgumentOutOfRangeException( "Offset cannot be greater than length of MemoryStream" );
- }
-
- position = refPoint + offset;
-
- return position;
- }
-
-
- public override void SetLength( long value ) {
- if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- } else if( !expandable && value > capacity ) {
- throw new NotSupportedException( "Expanding this MemoryStream is not supported" );
- } else if( !canWrite ) {
- throw new IOException( "Cannot write to this MemoryStream" );
- } else if( value < 0 ) {
-
- // LAMESPEC: AGAIN! It says to throw this exception if value is
- // greater than "the maximum length of the MemoryStream". I haven't
- // seen anywhere mention what the maximum length of a MemoryStream is and
- // since we're this far this memory stream is expandable.
-
- throw new ArgumentOutOfRangeException();
- }
-
- byte[] newBuffer;
- newBuffer = new byte[ value ];
-
- if (value < internalBuffer.Length) {
- // truncate
- Array.Copy( internalBuffer, 0, newBuffer, 0, (int)value );
- } else {
- // expand
- Array.Copy( internalBuffer, 0, newBuffer, 0, internalBuffer.Length );
- }
- internalBuffer = newBuffer;
- capacity = (int)value;
-
- }
-
-
- public virtual byte[] ToArray() {
-
- if( streamClosed ) {
- throw new ArgumentException( "The MemoryStream has been closed" );
- }
-
- byte[] outBuffer = new byte[capacity];
- Array.Copy( internalBuffer, 0, outBuffer, 0, capacity);
- return outBuffer;
- }
-
- // LAMESPEC: !! It says that "offset" is "offset in buffer at which
- // to begin writing", I presume this should be "offset in buffer at which
- // to begin reading"
-
- public override void Write( byte[] buffer, int offset, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( !canWrite ) {
- throw new NotSupportedException();
- } else if( buffer.Length - offset < count ) {
- throw new ArgumentException();
- } else if( offset < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if( streamClosed ) {
- throw new ObjectDisposedException( "MemoryStream" );
- }
-
- if( position + count > capacity ) {
- if( expandable ) {
- // expand the buffer
- SetLength( position + count );
- } else {
- // only write as many bytes as will fit
- count = (int)((long)capacity - position);
- }
- }
-
- // internal buffer may not be allocated all the way up to capacity
- // count will already be limited to capacity above if non-expandable
- if( position + count >= internalBuffer.Length )
- SetLength( position + count );
-
- Array.Copy( buffer, offset, internalBuffer, (int)position, count );
- position += count;
-
- }
-
-
- public override void WriteByte( byte value ) {
- if ( streamClosed )
- throw new ObjectDisposedException( "MemoryStream" );
- else if( !canWrite || (position >= capacity && !expandable))
- throw new NotSupportedException();
-
- if ( position >= capacity )
- SetLength( capacity + 1 );
-
- if( position >= internalBuffer.Length )
- SetLength ( position + 1 );
-
- internalBuffer[ position++ ] = value;
- }
-
-
- public virtual void WriteTo( Stream stream ) {
- if( stream == null ) {
- throw new ArgumentNullException();
- }
-
- stream.Write( internalBuffer, 0, internalBuffer.Length );
-
- }
-
-
- }
-
-
-}
diff --git a/mcs/class/corlib/System.IO/MonoIO.cs b/mcs/class/corlib/System.IO/MonoIO.cs
deleted file mode 100644
index e9cddbdb2db..00000000000
--- a/mcs/class/corlib/System.IO/MonoIO.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-//
-// System.IO.MonoIO.cs: static interface to native filesystem.
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.IO
-{
- internal sealed class MonoIO {
- public static readonly FileAttributes
- InvalidFileAttributes = (FileAttributes)(-1);
-
- public static readonly IntPtr
- InvalidHandle = (IntPtr)(-1);
-
- // error methods
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static MonoIOError GetLastError ();
-
- public static Exception GetException ()
- {
- return GetException (String.Empty);
- }
-
- public static Exception GetException (string path)
- {
- MonoIOError error = GetLastError ();
- string message;
-
- switch (error) {
- // FIXME: add more exception mappings here
- case MonoIOError.ERROR_FILE_NOT_FOUND:
- message = String.Format ("Could not find file \"{0}\"", path);
- return new FileNotFoundException (message);
-
- case MonoIOError.ERROR_PATH_NOT_FOUND:
- message = String.Format ("Could not find a part of the path \"{0}\"", path);
- return new DirectoryNotFoundException (message);
-
- case MonoIOError.ERROR_ACCESS_DENIED:
- message = String.Format ("Access to the path \"{0}\" is denied.", path);
- return new UnauthorizedAccessException (message);
-
- default:
- message = String.Format ("Win32 IO returned {0}", error);
- return new IOException (message);
- }
- }
-
- // directory methods
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool CreateDirectory (string path);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool RemoveDirectory (string path);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static IntPtr FindFirstFile (string path, out MonoIOStat stat);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool FindNextFile (IntPtr find, out MonoIOStat stat);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool FindClose (IntPtr find);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static string GetCurrentDirectory ();
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool SetCurrentDirectory (string path);
-
- // file methods
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool MoveFile (string path, string dest);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool CopyFile (string path, string dest, bool overwrite);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool DeleteFile (string path);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static FileAttributes GetFileAttributes (string path);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool SetFileAttributes (string path, FileAttributes attrs);
-
- public static bool Exists (string path)
- {
- FileAttributes attrs = GetFileAttributes (path);
- if (attrs == InvalidFileAttributes)
- return false;
-
- return true;
- }
-
- public static bool ExistsFile (string path)
- {
- FileAttributes attrs = GetFileAttributes (path);
- if (attrs == InvalidFileAttributes)
- return false;
-
- if ((attrs & FileAttributes.Directory) != 0)
- return false;
-
- return true;
- }
-
- public static bool ExistsDirectory (string path)
- {
- FileAttributes attrs = GetFileAttributes (path);
- if (attrs == InvalidFileAttributes)
- return false;
-
- if ((attrs & FileAttributes.Directory) == 0)
- return false;
-
- return true;
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool GetFileStat (string path, out MonoIOStat stat);
-
- // handle methods
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static IntPtr Open (string filename, FileMode mode, FileAccess access, FileShare share);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool Close (IntPtr handle);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static int Read (IntPtr handle, byte [] dest, int dest_offset, int count);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static int Write (IntPtr handle, byte [] src, int src_offset, int count);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static long Seek (IntPtr handle, long offset, SeekOrigin origin);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool Flush (IntPtr handle);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static long GetLength (IntPtr handle);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool SetLength (IntPtr handle, long length);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static bool SetFileTime (IntPtr handle, long creation_time, long last_access_time, long last_write_time);
-
- public static bool SetFileTime (string path, long creation_time, long last_access_time, long last_write_time)
- {
- IntPtr handle;
- bool result;
-
- handle = Open (path, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
- if (handle == IntPtr.Zero)
- return false;
-
- result = SetFileTime (handle, creation_time, last_access_time, last_write_time);
- Close (handle);
-
- return result;
- }
-
- // console handles
-
- public extern static IntPtr ConsoleOutput {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- public extern static IntPtr ConsoleInput {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- public extern static IntPtr ConsoleError {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- // path characters
-
- public extern static char VolumeSeparatorChar {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- public extern static char DirectorySeparatorChar {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- public extern static char AltDirectorySeparatorChar {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- public extern static char PathSeparator {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- public extern static char [] InvalidPathChars {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/MonoIOError.cs b/mcs/class/corlib/System.IO/MonoIOError.cs
deleted file mode 100644
index 6996b6b1253..00000000000
--- a/mcs/class/corlib/System.IO/MonoIOError.cs
+++ /dev/null
@@ -1,1798 +0,0 @@
-//
-// System.IO.MonoIOError.cs: Win32 error codes. Yuck.
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System;
-
-namespace System.IO
-{
- internal enum MonoIOError {
- ERROR_SUCCESS = 0,
- ERROR_INVALID_FUNCTION = 1,
- ERROR_FILE_NOT_FOUND = 2,
- ERROR_PATH_NOT_FOUND = 3,
- ERROR_TOO_MANY_OPEN_FILES = 4,
- ERROR_ACCESS_DENIED = 5,
- ERROR_INVALID_HANDLE = 6,
- ERROR_ARENA_TRASHED = 7,
- ERROR_NOT_ENOUGH_MEMORY = 8,
- ERROR_INVALID_BLOCK = 9,
- ERROR_BAD_ENVIRONMENT = 10,
- ERROR_BAD_FORMAT = 11,
- ERROR_INVALID_ACCESS = 12,
- ERROR_INVALID_DATA = 13,
- ERROR_OUTOFMEMORY = 14,
- ERROR_INVALID_DRIVE = 15,
- ERROR_CURRENT_DIRECTORY = 16,
- ERROR_NOT_SAME_DEVICE = 17,
- ERROR_NO_MORE_FILES = 18,
- ERROR_WRITE_PROTECT = 19,
- ERROR_BAD_UNIT = 20,
- ERROR_NOT_READY = 21,
- ERROR_BAD_COMMAND = 22,
- ERROR_CRC = 23,
- ERROR_BAD_LENGTH = 24,
- ERROR_SEEK = 25,
- ERROR_NOT_DOS_DISK = 26,
- ERROR_SECTOR_NOT_FOUND = 27,
- ERROR_OUT_OF_PAPER = 28,
- ERROR_WRITE_FAULT = 29,
- ERROR_READ_FAULT = 30,
- ERROR_GEN_FAILURE = 31,
- ERROR_SHARING_VIOLATION = 32,
- ERROR_LOCK_VIOLATION = 33,
- ERROR_WRONG_DISK = 34,
- ERROR_SHARING_BUFFER_EXCEEDED = 36,
- ERROR_HANDLE_EOF = 38,
- ERROR_HANDLE_DISK_FULL = 39,
- ERROR_NOT_SUPPORTED = 50,
- ERROR_REM_NOT_LIST = 51,
- ERROR_DUP_NAME = 52,
- ERROR_BAD_NETPATH = 53,
- ERROR_NETWORK_BUSY = 54,
- ERROR_DEV_NOT_EXIST = 55,
- ERROR_TOO_MANY_CMDS = 56,
- ERROR_ADAP_HDW_ERR = 57,
- ERROR_BAD_NET_RESP = 58,
- ERROR_UNEXP_NET_ERR = 59,
- ERROR_BAD_REM_ADAP = 60,
- ERROR_PRINTQ_FULL = 61,
- ERROR_NO_SPOOL_SPACE = 62,
- ERROR_PRINT_CANCELLED = 63,
- ERROR_NETNAME_DELETED = 64,
- ERROR_NETWORK_ACCESS_DENIED = 65,
- ERROR_BAD_DEV_TYPE = 66,
- ERROR_BAD_NET_NAME = 67,
- ERROR_TOO_MANY_NAMES = 68,
- ERROR_TOO_MANY_SESS = 69,
- ERROR_SHARING_PAUSED = 70,
- ERROR_REQ_NOT_ACCEP = 71,
- ERROR_REDIR_PAUSED = 72,
- ERROR_FILE_EXISTS = 80,
- ERROR_CANNOT_MAKE = 82,
- ERROR_FAIL_I24 = 83,
- ERROR_OUT_OF_STRUCTURES = 84,
- ERROR_ALREADY_ASSIGNED = 85,
- ERROR_INVALID_PASSWORD = 86,
- ERROR_INVALID_PARAMETER = 87,
- ERROR_NET_WRITE_FAULT = 88,
- ERROR_NO_PROC_SLOTS = 89,
- ERROR_TOO_MANY_SEMAPHORES = 100,
- ERROR_EXCL_SEM_ALREADY_OWNED = 101,
- ERROR_SEM_IS_SET = 102,
- ERROR_TOO_MANY_SEM_REQUESTS = 103,
- ERROR_INVALID_AT_INTERRUPT_TIME = 104,
- ERROR_SEM_OWNER_DIED = 105,
- ERROR_SEM_USER_LIMIT = 106,
- ERROR_DISK_CHANGE = 107,
- ERROR_DRIVE_LOCKED = 108,
- ERROR_BROKEN_PIPE = 109,
- ERROR_OPEN_FAILED = 110,
- ERROR_BUFFER_OVERFLOW = 111,
- ERROR_DISK_FULL = 112,
- ERROR_NO_MORE_SEARCH_HANDLES = 113,
- ERROR_INVALID_TARGET_HANDLE = 114,
- ERROR_INVALID_CATEGORY = 117,
- ERROR_INVALID_VERIFY_SWITCH = 118,
- ERROR_BAD_DRIVER_LEVEL = 119,
- ERROR_CALL_NOT_IMPLEMENTED = 120,
- ERROR_SEM_TIMEOUT = 121,
- ERROR_INSUFFICIENT_BUFFER = 122,
- ERROR_INVALID_NAME = 123,
- ERROR_INVALID_LEVEL = 124,
- ERROR_NO_VOLUME_LABEL = 125,
- ERROR_MOD_NOT_FOUND = 126,
- ERROR_PROC_NOT_FOUND = 127,
- ERROR_WAIT_NO_CHILDREN = 128,
- ERROR_CHILD_NOT_COMPLETE = 129,
- ERROR_DIRECT_ACCESS_HANDLE = 130,
- ERROR_NEGATIVE_SEEK = 131,
- ERROR_SEEK_ON_DEVICE = 132,
- ERROR_IS_JOIN_TARGET = 133,
- ERROR_IS_JOINED = 134,
- ERROR_IS_SUBSTED = 135,
- ERROR_NOT_JOINED = 136,
- ERROR_NOT_SUBSTED = 137,
- ERROR_JOIN_TO_JOIN = 138,
- ERROR_SUBST_TO_SUBST = 139,
- ERROR_JOIN_TO_SUBST = 140,
- ERROR_SUBST_TO_JOIN = 141,
- ERROR_BUSY_DRIVE = 142,
- ERROR_SAME_DRIVE = 143,
- ERROR_DIR_NOT_ROOT = 144,
- ERROR_DIR_NOT_EMPTY = 145,
- ERROR_IS_SUBST_PATH = 146,
- ERROR_IS_JOIN_PATH = 147,
- ERROR_PATH_BUSY = 148,
- ERROR_IS_SUBST_TARGET = 149,
- ERROR_SYSTEM_TRACE = 150,
- ERROR_INVALID_EVENT_COUNT = 151,
- ERROR_TOO_MANY_MUXWAITERS = 152,
- ERROR_INVALID_LIST_FORMAT = 153,
- ERROR_LABEL_TOO_LONG = 154,
- ERROR_TOO_MANY_TCBS = 155,
- ERROR_SIGNAL_REFUSED = 156,
- ERROR_DISCARDED = 157,
- ERROR_NOT_LOCKED = 158,
- ERROR_BAD_THREADID_ADDR = 159,
- ERROR_BAD_ARGUMENTS = 160,
- ERROR_BAD_PATHNAME = 161,
- ERROR_SIGNAL_PENDING = 162,
- ERROR_MAX_THRDS_REACHED = 164,
- ERROR_LOCK_FAILED = 167,
- ERROR_BUSY = 170,
- ERROR_CANCEL_VIOLATION = 173,
- ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 174,
- ERROR_INVALID_SEGMENT_NUMBER = 180,
- ERROR_INVALID_ORDINAL = 182,
- ERROR_ALREADY_EXISTS = 183,
- ERROR_INVALID_FLAG_NUMBER = 186,
- ERROR_SEM_NOT_FOUND = 187,
- ERROR_INVALID_STARTING_CODESEG = 188,
- ERROR_INVALID_STACKSEG = 189,
- ERROR_INVALID_MODULETYPE = 190,
- ERROR_INVALID_EXE_SIGNATURE = 191,
- ERROR_EXE_MARKED_INVALID = 192,
- ERROR_BAD_EXE_FORMAT = 193,
- ERROR_ITERATED_DATA_EXCEEDS_64k = 194,
- ERROR_INVALID_MINALLOCSIZE = 195,
- ERROR_DYNLINK_FROM_INVALID_RING = 196,
- ERROR_IOPL_NOT_ENABLED = 197,
- ERROR_INVALID_SEGDPL = 198,
- ERROR_AUTODATASEG_EXCEEDS_64k = 199,
- ERROR_RING2SEG_MUST_BE_MOVABLE = 200,
- ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 201,
- ERROR_INFLOOP_IN_RELOC_CHAIN = 202,
- ERROR_ENVVAR_NOT_FOUND = 203,
- ERROR_NO_SIGNAL_SENT = 205,
- ERROR_FILENAME_EXCED_RANGE = 206,
- ERROR_RING2_STACK_IN_USE = 207,
- ERROR_META_EXPANSION_TOO_LONG = 208,
- ERROR_INVALID_SIGNAL_NUMBER = 209,
- ERROR_THREAD_1_INACTIVE = 210,
- ERROR_LOCKED = 212,
- ERROR_TOO_MANY_MODULES = 214,
- ERROR_NESTING_NOT_ALLOWED = 215,
- ERROR_EXE_MACHINE_TYPE_MISMATCH = 216,
- ERROR_BAD_PIPE = 230,
- ERROR_PIPE_BUSY = 231,
- ERROR_NO_DATA = 232,
- ERROR_PIPE_NOT_CONNECTED = 233,
- ERROR_MORE_DATA = 234,
- ERROR_VC_DISCONNECTED = 240,
- ERROR_INVALID_EA_NAME = 254,
- ERROR_EA_LIST_INCONSISTENT = 255,
- WAIT_TIMEOUT = 258,
- ERROR_NO_MORE_ITEMS = 259,
- ERROR_CANNOT_COPY = 266,
- ERROR_DIRECTORY = 267,
- ERROR_EAS_DIDNT_FIT = 275,
- ERROR_EA_FILE_CORRUPT = 276,
- ERROR_EA_TABLE_FULL = 277,
- ERROR_INVALID_EA_HANDLE = 278,
- ERROR_EAS_NOT_SUPPORTED = 282,
- ERROR_NOT_OWNER = 288,
- ERROR_TOO_MANY_POSTS = 298,
- ERROR_PARTIAL_COPY = 299,
- ERROR_OPLOCK_NOT_GRANTED = 300,
- ERROR_INVALID_OPLOCK_PROTOCOL = 301,
- ERROR_DISK_TOO_FRAGMENTED = 302,
- ERROR_DELETE_PENDING = 303,
- ERROR_MR_MID_NOT_FOUND = 317,
- ERROR_INVALID_ADDRESS = 487,
- ERROR_ARITHMETIC_OVERFLOW = 534,
- ERROR_PIPE_CONNECTED = 535,
- ERROR_PIPE_LISTENING = 536,
- ERROR_EA_ACCESS_DENIED = 994,
- ERROR_OPERATION_ABORTED = 995,
- ERROR_IO_INCOMPLETE = 996,
- ERROR_IO_PENDING = 997,
- ERROR_NOACCESS = 998,
- ERROR_SWAPERROR = 999,
- ERROR_STACK_OVERFLOW = 1001,
- ERROR_INVALID_MESSAGE = 1002,
- ERROR_CAN_NOT_COMPLETE = 1003,
- ERROR_INVALID_FLAGS = 1004,
- ERROR_UNRECOGNIZED_VOLUME = 1005,
- ERROR_FILE_INVALID = 1006,
- ERROR_FULLSCREEN_MODE = 1007,
- ERROR_NO_TOKEN = 1008,
- ERROR_BADDB = 1009,
- ERROR_BADKEY = 1010,
- ERROR_CANTOPEN = 1011,
- ERROR_CANTREAD = 1012,
- ERROR_CANTWRITE = 1013,
- ERROR_REGISTRY_RECOVERED = 1014,
- ERROR_REGISTRY_CORRUPT = 1015,
- ERROR_REGISTRY_IO_FAILED = 1016,
- ERROR_NOT_REGISTRY_FILE = 1017,
- ERROR_KEY_DELETED = 1018,
- ERROR_NO_LOG_SPACE = 1019,
- ERROR_KEY_HAS_CHILDREN = 1020,
- ERROR_CHILD_MUST_BE_VOLATILE = 1021,
- ERROR_NOTIFY_ENUM_DIR = 1022,
- ERROR_DEPENDENT_SERVICES_RUNNING = 1051,
- ERROR_INVALID_SERVICE_CONTROL = 1052,
- ERROR_SERVICE_REQUEST_TIMEOUT = 1053,
- ERROR_SERVICE_NO_THREAD = 1054,
- ERROR_SERVICE_DATABASE_LOCKED = 1055,
- ERROR_SERVICE_ALREADY_RUNNING = 1056,
- ERROR_INVALID_SERVICE_ACCOUNT = 1057,
- ERROR_SERVICE_DISABLED = 1058,
- ERROR_CIRCULAR_DEPENDENCY = 1059,
- ERROR_SERVICE_DOES_NOT_EXIST = 1060,
- ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061,
- ERROR_SERVICE_NOT_ACTIVE = 1062,
- ERROR_FAILED_SERVICE_CONTROLLER_CONNECT = 1063,
- ERROR_EXCEPTION_IN_SERVICE = 1064,
- ERROR_DATABASE_DOES_NOT_EXIST = 1065,
- ERROR_SERVICE_SPECIFIC_ERROR = 1066,
- ERROR_PROCESS_ABORTED = 1067,
- ERROR_SERVICE_DEPENDENCY_FAIL = 1068,
- ERROR_SERVICE_LOGON_FAILED = 1069,
- ERROR_SERVICE_START_HANG = 1070,
- ERROR_INVALID_SERVICE_LOCK = 1071,
- ERROR_SERVICE_MARKED_FOR_DELETE = 1072,
- ERROR_SERVICE_EXISTS = 1073,
- ERROR_ALREADY_RUNNING_LKG = 1074,
- ERROR_SERVICE_DEPENDENCY_DELETED = 1075,
- ERROR_BOOT_ALREADY_ACCEPTED = 1076,
- ERROR_SERVICE_NEVER_STARTED = 1077,
- ERROR_DUPLICATE_SERVICE_NAME = 1078,
- ERROR_DIFFERENT_SERVICE_ACCOUNT = 1079,
- ERROR_CANNOT_DETECT_DRIVER_FAILURE = 1080,
- ERROR_CANNOT_DETECT_PROCESS_ABORT = 1081,
- ERROR_NO_RECOVERY_PROGRAM = 1082,
- ERROR_SERVICE_NOT_IN_EXE = 1083,
- ERROR_NOT_SAFEBOOT_SERVICE = 1084,
- ERROR_END_OF_MEDIA = 1100,
- ERROR_FILEMARK_DETECTED = 1101,
- ERROR_BEGINNING_OF_MEDIA = 1102,
- ERROR_SETMARK_DETECTED = 1103,
- ERROR_NO_DATA_DETECTED = 1104,
- ERROR_PARTITION_FAILURE = 1105,
- ERROR_INVALID_BLOCK_LENGTH = 1106,
- ERROR_DEVICE_NOT_PARTITIONED = 1107,
- ERROR_UNABLE_TO_LOCK_MEDIA = 1108,
- ERROR_UNABLE_TO_UNLOAD_MEDIA = 1109,
- ERROR_MEDIA_CHANGED = 1110,
- ERROR_BUS_RESET = 1111,
- ERROR_NO_MEDIA_IN_DRIVE = 1112,
- ERROR_NO_UNICODE_TRANSLATION = 1113,
- ERROR_DLL_INIT_FAILED = 1114,
- ERROR_SHUTDOWN_IN_PROGRESS = 1115,
- ERROR_NO_SHUTDOWN_IN_PROGRESS = 1116,
- ERROR_IO_DEVICE = 1117,
- ERROR_SERIAL_NO_DEVICE = 1118,
- ERROR_IRQ_BUSY = 1119,
- ERROR_MORE_WRITES = 1120,
- ERROR_COUNTER_TIMEOUT = 1121,
- ERROR_FLOPPY_ID_MARK_NOT_FOUND = 1122,
- ERROR_FLOPPY_WRONG_CYLINDER = 1123,
- ERROR_FLOPPY_UNKNOWN_ERROR = 1124,
- ERROR_FLOPPY_BAD_REGISTERS = 1125,
- ERROR_DISK_RECALIBRATE_FAILED = 1126,
- ERROR_DISK_OPERATION_FAILED = 1127,
- ERROR_DISK_RESET_FAILED = 1128,
- ERROR_EOM_OVERFLOW = 1129,
- ERROR_NOT_ENOUGH_SERVER_MEMORY = 1130,
- ERROR_POSSIBLE_DEADLOCK = 1131,
- ERROR_MAPPED_ALIGNMENT = 1132,
- ERROR_SET_POWER_STATE_VETOED = 1140,
- ERROR_SET_POWER_STATE_FAILED = 1141,
- ERROR_TOO_MANY_LINKS = 1142,
- ERROR_OLD_WIN_VERSION = 1150,
- ERROR_APP_WRONG_OS = 1151,
- ERROR_SINGLE_INSTANCE_APP = 1152,
- ERROR_RMODE_APP = 1153,
- ERROR_INVALID_DLL = 1154,
- ERROR_NO_ASSOCIATION = 1155,
- ERROR_DDE_FAIL = 1156,
- ERROR_DLL_NOT_FOUND = 1157,
- ERROR_NO_MORE_USER_HANDLES = 1158,
- ERROR_MESSAGE_SYNC_ONLY = 1159,
- ERROR_SOURCE_ELEMENT_EMPTY = 1160,
- ERROR_DESTINATION_ELEMENT_FULL = 1161,
- ERROR_ILLEGAL_ELEMENT_ADDRESS = 1162,
- ERROR_MAGAZINE_NOT_PRESENT = 1163,
- ERROR_DEVICE_REINITIALIZATION_NEEDED = 1164,
- ERROR_DEVICE_REQUIRES_CLEANING = 1165,
- ERROR_DEVICE_DOOR_OPEN = 1166,
- ERROR_DEVICE_NOT_CONNECTED = 1167,
- ERROR_NOT_FOUND = 1168,
- ERROR_NO_MATCH = 1169,
- ERROR_SET_NOT_FOUND = 1170,
- ERROR_POINT_NOT_FOUND = 1171,
- ERROR_NO_TRACKING_SERVICE = 1172,
- ERROR_NO_VOLUME_ID = 1173,
- ERROR_UNABLE_TO_REMOVE_REPLACED = 1175,
- ERROR_UNABLE_TO_MOVE_REPLACEMENT = 1176,
- ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 = 1177,
- ERROR_JOURNAL_DELETE_IN_PROGRESS = 1178,
- ERROR_JOURNAL_NOT_ACTIVE = 1179,
- ERROR_POTENTIAL_FILE_FOUND = 1180,
- ERROR_JOURNAL_ENTRY_DELETED = 1181,
- ERROR_BAD_DEVICE = 1200,
- ERROR_CONNECTION_UNAVAIL = 1201,
- ERROR_DEVICE_ALREADY_REMEMBERED = 1202,
- ERROR_NO_NET_OR_BAD_PATH = 1203,
- ERROR_BAD_PROVIDER = 1204,
- ERROR_CANNOT_OPEN_PROFILE = 1205,
- ERROR_BAD_PROFILE = 1206,
- ERROR_NOT_CONTAINER = 1207,
- ERROR_EXTENDED_ERROR = 1208,
- ERROR_INVALID_GROUPNAME = 1209,
- ERROR_INVALID_COMPUTERNAME = 1210,
- ERROR_INVALID_EVENTNAME = 1211,
- ERROR_INVALID_DOMAINNAME = 1212,
- ERROR_INVALID_SERVICENAME = 1213,
- ERROR_INVALID_NETNAME = 1214,
- ERROR_INVALID_SHARENAME = 1215,
- ERROR_INVALID_PASSWORDNAME = 1216,
- ERROR_INVALID_MESSAGENAME = 1217,
- ERROR_INVALID_MESSAGEDEST = 1218,
- ERROR_SESSION_CREDENTIAL_CONFLICT = 1219,
- ERROR_REMOTE_SESSION_LIMIT_EXCEEDED = 1220,
- ERROR_DUP_DOMAINNAME = 1221,
- ERROR_NO_NETWORK = 1222,
- ERROR_CANCELLED = 1223,
- ERROR_USER_MAPPED_FILE = 1224,
- ERROR_CONNECTION_REFUSED = 1225,
- ERROR_GRACEFUL_DISCONNECT = 1226,
- ERROR_ADDRESS_ALREADY_ASSOCIATED = 1227,
- ERROR_ADDRESS_NOT_ASSOCIATED = 1228,
- ERROR_CONNECTION_INVALID = 1229,
- ERROR_CONNECTION_ACTIVE = 1230,
- ERROR_NETWORK_UNREACHABLE = 1231,
- ERROR_HOST_UNREACHABLE = 1232,
- ERROR_PROTOCOL_UNREACHABLE = 1233,
- ERROR_PORT_UNREACHABLE = 1234,
- ERROR_REQUEST_ABORTED = 1235,
- ERROR_CONNECTION_ABORTED = 1236,
- ERROR_RETRY = 1237,
- ERROR_CONNECTION_COUNT_LIMIT = 1238,
- ERROR_LOGIN_TIME_RESTRICTION = 1239,
- ERROR_LOGIN_WKSTA_RESTRICTION = 1240,
- ERROR_INCORRECT_ADDRESS = 1241,
- ERROR_ALREADY_REGISTERED = 1242,
- ERROR_SERVICE_NOT_FOUND = 1243,
- ERROR_NOT_AUTHENTICATED = 1244,
- ERROR_NOT_LOGGED_ON = 1245,
- ERROR_CONTINUE = 1246,
- ERROR_ALREADY_INITIALIZED = 1247,
- ERROR_NO_MORE_DEVICES = 1248,
- ERROR_NO_SUCH_SITE = 1249,
- ERROR_DOMAIN_CONTROLLER_EXISTS = 1250,
- ERROR_ONLY_IF_CONNECTED = 1251,
- ERROR_OVERRIDE_NOCHANGES = 1252,
- ERROR_BAD_USER_PROFILE = 1253,
- ERROR_NOT_SUPPORTED_ON_SBS = 1254,
- ERROR_SERVER_SHUTDOWN_IN_PROGRESS = 1255,
- ERROR_HOST_DOWN = 1256,
- ERROR_NON_ACCOUNT_SID = 1257,
- ERROR_NON_DOMAIN_SID = 1258,
- ERROR_APPHELP_BLOCK = 1259,
- ERROR_ACCESS_DISABLED_BY_POLICY = 1260,
- ERROR_REG_NAT_CONSUMPTION = 1261,
- ERROR_CSCSHARE_OFFLINE = 1262,
- ERROR_PKINIT_FAILURE = 1263,
- ERROR_SMARTCARD_SUBSYSTEM_FAILURE = 1264,
- ERROR_DOWNGRADE_DETECTED = 1265,
- SEC_E_SMARTCARD_CERT_REVOKED = 1266,
- SEC_E_ISSUING_CA_UNTRUSTED = 1267,
- SEC_E_REVOCATION_OFFLINE_C = 1268,
- SEC_E_PKINIT_CLIENT_FAILUR = 1269,
- SEC_E_SMARTCARD_CERT_EXPIRED = 1270,
- ERROR_MACHINE_LOCKED = 1271,
- ERROR_CALLBACK_SUPPLIED_INVALID_DATA = 1273,
- ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED = 1274,
- ERROR_DRIVER_BLOCKED = 1275,
- ERROR_INVALID_IMPORT_OF_NON_DLL = 1276,
- ERROR_NOT_ALL_ASSIGNED = 1300,
- ERROR_SOME_NOT_MAPPED = 1301,
- ERROR_NO_QUOTAS_FOR_ACCOUNT = 1302,
- ERROR_LOCAL_USER_SESSION_KEY = 1303,
- ERROR_NULL_LM_PASSWORD = 1304,
- ERROR_UNKNOWN_REVISION = 1305,
- ERROR_REVISION_MISMATCH = 1306,
- ERROR_INVALID_OWNER = 1307,
- ERROR_INVALID_PRIMARY_GROUP = 1308,
- ERROR_NO_IMPERSONATION_TOKEN = 1309,
- ERROR_CANT_DISABLE_MANDATORY = 1310,
- ERROR_NO_LOGON_SERVERS = 1311,
- ERROR_NO_SUCH_LOGON_SESSION = 1312,
- ERROR_NO_SUCH_PRIVILEGE = 1313,
- ERROR_PRIVILEGE_NOT_HELD = 1314,
- ERROR_INVALID_ACCOUNT_NAME = 1315,
- ERROR_USER_EXISTS = 1316,
- ERROR_NO_SUCH_USER = 1317,
- ERROR_GROUP_EXISTS = 1318,
- ERROR_NO_SUCH_GROUP = 1319,
- ERROR_MEMBER_IN_GROUP = 1320,
- ERROR_MEMBER_NOT_IN_GROUP = 1321,
- ERROR_LAST_ADMIN = 1322,
- ERROR_WRONG_PASSWORD = 1323,
- ERROR_ILL_FORMED_PASSWORD = 1324,
- ERROR_PASSWORD_RESTRICTION = 1325,
- ERROR_LOGON_FAILURE = 1326,
- ERROR_ACCOUNT_RESTRICTION = 1327,
- ERROR_INVALID_LOGON_HOURS = 1328,
- ERROR_INVALID_WORKSTATION = 1329,
- ERROR_PASSWORD_EXPIRED = 1330,
- ERROR_ACCOUNT_DISABLED = 1331,
- ERROR_NONE_MAPPED = 1332,
- ERROR_TOO_MANY_LUIDS_REQUESTED = 1333,
- ERROR_LUIDS_EXHAUSTED = 1334,
- ERROR_INVALID_SUB_AUTHORITY = 1335,
- ERROR_INVALID_ACL = 1336,
- ERROR_INVALID_SID = 1337,
- ERROR_INVALID_SECURITY_DESCR = 1338,
- ERROR_BAD_INHERITANCE_ACL = 1340,
- ERROR_SERVER_DISABLED = 1341,
- ERROR_SERVER_NOT_DISABLED = 1342,
- ERROR_INVALID_ID_AUTHORITY = 1343,
- ERROR_ALLOTTED_SPACE_EXCEEDED = 1344,
- ERROR_INVALID_GROUP_ATTRIBUTES = 1345,
- ERROR_BAD_IMPERSONATION_LEVEL = 1346,
- ERROR_CANT_OPEN_ANONYMOUS = 1347,
- ERROR_BAD_VALIDATION_CLASS = 1348,
- ERROR_BAD_TOKEN_TYPE = 1349,
- ERROR_NO_SECURITY_ON_OBJECT = 1350,
- ERROR_CANT_ACCESS_DOMAIN_INFO = 1351,
- ERROR_INVALID_SERVER_STATE = 1352,
- ERROR_INVALID_DOMAIN_STATE = 1353,
- ERROR_INVALID_DOMAIN_ROLE = 1354,
- ERROR_NO_SUCH_DOMAIN = 1355,
- ERROR_DOMAIN_EXISTS = 1356,
- ERROR_DOMAIN_LIMIT_EXCEEDED = 1357,
- ERROR_INTERNAL_DB_CORRUPTION = 1358,
- ERROR_INTERNAL_ERROR = 1359,
- ERROR_GENERIC_NOT_MAPPED = 1360,
- ERROR_BAD_DESCRIPTOR_FORMAT = 1361,
- ERROR_NOT_LOGON_PROCESS = 1362,
- ERROR_LOGON_SESSION_EXISTS = 1363,
- ERROR_NO_SUCH_PACKAGE = 1364,
- ERROR_BAD_LOGON_SESSION_STATE = 1365,
- ERROR_LOGON_SESSION_COLLISION = 1366,
- ERROR_INVALID_LOGON_TYPE = 1367,
- ERROR_CANNOT_IMPERSONATE = 1368,
- ERROR_RXACT_INVALID_STATE = 1369,
- ERROR_RXACT_COMMIT_FAILURE = 1370,
- ERROR_SPECIAL_ACCOUNT = 1371,
- ERROR_SPECIAL_GROUP = 1372,
- ERROR_SPECIAL_USER = 1373,
- ERROR_MEMBERS_PRIMARY_GROUP = 1374,
- ERROR_TOKEN_ALREADY_IN_USE = 1375,
- ERROR_NO_SUCH_ALIAS = 1376,
- ERROR_MEMBER_NOT_IN_ALIAS = 1377,
- ERROR_MEMBER_IN_ALIAS = 1378,
- ERROR_ALIAS_EXISTS = 1379,
- ERROR_LOGON_NOT_GRANTED = 1380,
- ERROR_TOO_MANY_SECRETS = 1381,
- ERROR_SECRET_TOO_LONG = 1382,
- ERROR_INTERNAL_DB_ERROR = 1383,
- ERROR_TOO_MANY_CONTEXT_IDS = 1384,
- ERROR_LOGON_TYPE_NOT_GRANTED = 1385,
- ERROR_NT_CROSS_ENCRYPTION_REQUIRED = 1386,
- ERROR_NO_SUCH_MEMBER = 1387,
- ERROR_INVALID_MEMBER = 1388,
- ERROR_TOO_MANY_SIDS = 1389,
- ERROR_LM_CROSS_ENCRYPTION_REQUIRED = 1390,
- ERROR_NO_INHERITANCE = 1391,
- ERROR_FILE_CORRUPT = 1392,
- ERROR_DISK_CORRUPT = 1393,
- ERROR_NO_USER_SESSION_KEY = 1394,
- ERROR_LICENSE_QUOTA_EXCEEDED = 1395,
- ERROR_WRONG_TARGET_NAME = 1396,
- ERROR_MUTUAL_AUTH_FAILED = 1397,
- ERROR_TIME_SKEW = 1398,
- ERROR_CURRENT_DOMAIN_NOT_ALLOWED = 1399,
- ERROR_INVALID_WINDOW_HANDLE = 1400,
- ERROR_INVALID_MENU_HANDLE = 1401,
- ERROR_INVALID_CURSOR_HANDLE = 1402,
- ERROR_INVALID_ACCEL_HANDLE = 1403,
- ERROR_INVALID_HOOK_HANDLE = 1404,
- ERROR_INVALID_DWP_HANDLE = 1405,
- ERROR_TLW_WITH_WSCHILD = 1406,
- ERROR_CANNOT_FIND_WND_CLASS = 1407,
- ERROR_WINDOW_OF_OTHER_THREAD = 1408,
- ERROR_HOTKEY_ALREADY_REGISTERED = 1409,
- ERROR_CLASS_ALREADY_EXISTS = 1410,
- ERROR_CLASS_DOES_NOT_EXIST = 1411,
- ERROR_CLASS_HAS_WINDOWS = 1412,
- ERROR_INVALID_INDEX = 1413,
- ERROR_INVALID_ICON_HANDLE = 1414,
- ERROR_PRIVATE_DIALOG_INDEX = 1415,
- ERROR_LISTBOX_ID_NOT_FOUND = 1416,
- ERROR_NO_WILDCARD_CHARACTERS = 1417,
- ERROR_CLIPBOARD_NOT_OPEN = 1418,
- ERROR_HOTKEY_NOT_REGISTERED = 1419,
- ERROR_WINDOW_NOT_DIALOG = 1420,
- ERROR_CONTROL_ID_NOT_FOUND = 1421,
- ERROR_INVALID_COMBOBOX_MESSAGE = 1422,
- ERROR_WINDOW_NOT_COMBOBOX = 1423,
- ERROR_INVALID_EDIT_HEIGHT = 1424,
- ERROR_DC_NOT_FOUND = 1425,
- ERROR_INVALID_HOOK_FILTER = 1426,
- ERROR_INVALID_FILTER_PROC = 1427,
- ERROR_HOOK_NEEDS_HMOD = 1428,
- ERROR_GLOBAL_ONLY_HOOK = 1429,
- ERROR_JOURNAL_HOOK_SET = 1430,
- ERROR_HOOK_NOT_INSTALLED = 1431,
- ERROR_INVALID_LB_MESSAGE = 1432,
- ERROR_SETCOUNT_ON_BAD_LB = 1433,
- ERROR_LB_WITHOUT_TABSTOPS = 1434,
- ERROR_DESTROY_OBJECT_OF_OTHER_THREAD = 1435,
- ERROR_CHILD_WINDOW_MENU = 1436,
- ERROR_NO_SYSTEM_MENU = 1437,
- ERROR_INVALID_MSGBOX_STYLE = 1438,
- ERROR_INVALID_SPI_VALUE = 1439,
- ERROR_SCREEN_ALREADY_LOCKED = 1440,
- ERROR_HWNDS_HAVE_DIFF_PARENT = 1441,
- ERROR_NOT_CHILD_WINDOW = 1442,
- ERROR_INVALID_GW_COMMAND = 1443,
- ERROR_INVALID_THREAD_ID = 1444,
- ERROR_NON_MDICHILD_WINDOW = 1445,
- ERROR_POPUP_ALREADY_ACTIVE = 1446,
- ERROR_NO_SCROLLBARS = 1447,
- ERROR_INVALID_SCROLLBAR_RANGE = 1448,
- ERROR_INVALID_SHOWWIN_COMMAND = 1449,
- ERROR_NO_SYSTEM_RESOURCES = 1450,
- ERROR_NONPAGED_SYSTEM_RESOURCES = 1451,
- ERROR_PAGED_SYSTEM_RESOURCES = 1452,
- ERROR_WORKING_SET_QUOTA = 1453,
- ERROR_PAGEFILE_QUOTA = 1454,
- ERROR_COMMITMENT_LIMIT = 1455,
- ERROR_MENU_ITEM_NOT_FOUND = 1456,
- ERROR_INVALID_KEYBOARD_HANDLE = 1457,
- ERROR_HOOK_TYPE_NOT_ALLOWED = 1458,
- ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION = 1459,
- ERROR_TIMEOUT = 1460,
- ERROR_INVALID_MONITOR_HANDLE = 1461,
- ERROR_EVENTLOG_FILE_CORRUPT = 1500,
- ERROR_EVENTLOG_CANT_START = 1501,
- ERROR_LOG_FILE_FULL = 1502,
- ERROR_EVENTLOG_FILE_CHANGED = 1503,
- ERROR_INSTALL_SERVICE_FAILURE = 1601,
- ERROR_INSTALL_USEREXIT = 1602,
- ERROR_INSTALL_FAILURE = 1603,
- ERROR_INSTALL_SUSPEND = 1604,
- ERROR_UNKNOWN_PRODUCT = 1605,
- ERROR_UNKNOWN_FEATURE = 1606,
- ERROR_UNKNOWN_COMPONENT = 1607,
- ERROR_UNKNOWN_PROPERTY = 1608,
- ERROR_INVALID_HANDLE_STATE = 1609,
- ERROR_BAD_CONFIGURATION = 1610,
- ERROR_INDEX_ABSENT = 1611,
- ERROR_INSTALL_SOURCE_ABSENT = 1612,
- ERROR_INSTALL_PACKAGE_VERSION = 1613,
- ERROR_PRODUCT_UNINSTALLED = 1614,
- ERROR_BAD_QUERY_SYNTAX = 1615,
- ERROR_INVALID_FIELD = 1616,
- ERROR_DEVICE_REMOVED = 1617,
- ERROR_INSTALL_ALREADY_RUNNING = 1618,
- ERROR_INSTALL_PACKAGE_OPEN_FAILED = 1619,
- ERROR_INSTALL_PACKAGE_INVALID = 1620,
- ERROR_INSTALL_UI_FAILURE = 1621,
- ERROR_INSTALL_LOG_FAILURE = 1622,
- ERROR_INSTALL_LANGUAGE_UNSUPPORTED = 1623,
- ERROR_INSTALL_TRANSFORM_FAILURE = 1624,
- ERROR_INSTALL_PACKAGE_REJECTED = 1625,
- ERROR_FUNCTION_NOT_CALLED = 1626,
- ERROR_FUNCTION_FAILED = 1627,
- ERROR_INVALID_TABLE = 1628,
- ERROR_DATATYPE_MISMATCH = 1629,
- ERROR_UNSUPPORTED_TYPE = 1630,
- ERROR_CREATE_FAILED = 1631,
- ERROR_INSTALL_TEMP_UNWRITABLE = 1632,
- ERROR_INSTALL_PLATFORM_UNSUPPORTED = 1633,
- ERROR_INSTALL_NOTUSED = 1634,
- ERROR_PATCH_PACKAGE_OPEN_FAILED = 1635,
- ERROR_PATCH_PACKAGE_INVALID = 1636,
- ERROR_PATCH_PACKAGE_UNSUPPORTED = 1637,
- ERROR_PRODUCT_VERSION = 1638,
- ERROR_INVALID_COMMAND_LINE = 1639,
- ERROR_INSTALL_REMOTE_DISALLOWED = 1640,
- ERROR_SUCCESS_REBOOT_INITIATED = 1641,
- ERROR_PATCH_TARGET_NOT_FOUND = 1642,
- ERROR_PATCH_PACKAGE_REJECTED = 1643,
- ERROR_INSTALL_TRANSFORM_REJECTED = 1644,
- RPC_S_INVALID_STRING_BINDING = 1700,
- RPC_S_WRONG_KIND_OF_BINDING = 1701,
- RPC_S_INVALID_BINDING = 1702,
- RPC_S_PROTSEQ_NOT_SUPPORTED = 1703,
- RPC_S_INVALID_RPC_PROTSEQ = 1704,
- RPC_S_INVALID_STRING_UUID = 1705,
- RPC_S_INVALID_ENDPOINT_FORMAT = 1706,
- RPC_S_INVALID_NET_ADDR = 1707,
- RPC_S_NO_ENDPOINT_FOUND = 1708,
- RPC_S_INVALID_TIMEOUT = 1709,
- RPC_S_OBJECT_NOT_FOUND = 1710,
- RPC_S_ALREADY_REGISTERED = 1711,
- RPC_S_TYPE_ALREADY_REGISTERED = 1712,
- RPC_S_ALREADY_LISTENING = 1713,
- RPC_S_NO_PROTSEQS_REGISTERED = 1714,
- RPC_S_NOT_LISTENING = 1715,
- RPC_S_UNKNOWN_MGR_TYPE = 1716,
- RPC_S_UNKNOWN_IF = 1717,
- RPC_S_NO_BINDINGS = 1718,
- RPC_S_NO_PROTSEQS = 1719,
- RPC_S_CANT_CREATE_ENDPOINT = 1720,
- RPC_S_OUT_OF_RESOURCES = 1721,
- RPC_S_SERVER_UNAVAILABLE = 1722,
- RPC_S_SERVER_TOO_BUSY = 1723,
- RPC_S_INVALID_NETWORK_OPTIONS = 1724,
- RPC_S_NO_CALL_ACTIVE = 1725,
- RPC_S_CALL_FAILED = 1726,
- RPC_S_CALL_FAILED_DNE = 1727,
- RPC_S_PROTOCOL_ERROR = 1728,
- RPC_S_UNSUPPORTED_TRANS_SYN = 1730,
- RPC_S_UNSUPPORTED_TYPE = 1732,
- RPC_S_INVALID_TAG = 1733,
- RPC_S_INVALID_BOUND = 1734,
- RPC_S_NO_ENTRY_NAME = 1735,
- RPC_S_INVALID_NAME_SYNTAX = 1736,
- RPC_S_UNSUPPORTED_NAME_SYNTAX = 1737,
- RPC_S_UUID_NO_ADDRESS = 1739,
- RPC_S_DUPLICATE_ENDPOINT = 1740,
- RPC_S_UNKNOWN_AUTHN_TYPE = 1741,
- RPC_S_MAX_CALLS_TOO_SMALL = 1742,
- RPC_S_STRING_TOO_LONG = 1743,
- RPC_S_PROTSEQ_NOT_FOUND = 1744,
- RPC_S_PROCNUM_OUT_OF_RANGE = 1745,
- RPC_S_BINDING_HAS_NO_AUTH = 1746,
- RPC_S_UNKNOWN_AUTHN_SERVICE = 1747,
- RPC_S_UNKNOWN_AUTHN_LEVEL = 1748,
- RPC_S_INVALID_AUTH_IDENTITY = 1749,
- RPC_S_UNKNOWN_AUTHZ_SERVICE = 1750,
- EPT_S_INVALID_ENTRY = 1751,
- EPT_S_CANT_PERFORM_OP = 1752,
- EPT_S_NOT_REGISTERED = 1753,
- RPC_S_NOTHING_TO_EXPORT = 1754,
- RPC_S_INCOMPLETE_NAME = 1755,
- RPC_S_INVALID_VERS_OPTION = 1756,
- RPC_S_NO_MORE_MEMBERS = 1757,
- RPC_S_NOT_ALL_OBJS_UNEXPORTED = 1758,
- RPC_S_INTERFACE_NOT_FOUND = 1759,
- RPC_S_ENTRY_ALREADY_EXISTS = 1760,
- RPC_S_ENTRY_NOT_FOUND = 1761,
- RPC_S_NAME_SERVICE_UNAVAILABLE = 1762,
- RPC_S_INVALID_NAF_ID = 1763,
- RPC_S_CANNOT_SUPPORT = 1764,
- RPC_S_NO_CONTEXT_AVAILABLE = 1765,
- RPC_S_INTERNAL_ERROR = 1766,
- RPC_S_ZERO_DIVIDE = 1767,
- RPC_S_ADDRESS_ERROR = 1768,
- RPC_S_FP_DIV_ZERO = 1769,
- RPC_S_FP_UNDERFLOW = 1770,
- RPC_S_FP_OVERFLOW = 1771,
- RPC_X_NO_MORE_ENTRIES = 1772,
- RPC_X_SS_CHAR_TRANS_OPEN_FAIL = 1773,
- RPC_X_SS_CHAR_TRANS_SHORT_FILE = 1774,
- RPC_X_SS_IN_NULL_CONTEXT = 1775,
- RPC_X_SS_CONTEXT_DAMAGED = 1777,
- RPC_X_SS_HANDLES_MISMATCH = 1778,
- RPC_X_SS_CANNOT_GET_CALL_HANDLE = 1779,
- RPC_X_NULL_REF_POINTER = 1780,
- RPC_X_ENUM_VALUE_OUT_OF_RANGE = 1781,
- RPC_X_BYTE_COUNT_TOO_SMALL = 1782,
- RPC_X_BAD_STUB_DATA = 1783,
- ERROR_INVALID_USER_BUFFER = 1784,
- ERROR_UNRECOGNIZED_MEDIA = 1785,
- ERROR_NO_TRUST_LSA_SECRET = 1786,
- ERROR_NO_TRUST_SAM_ACCOUNT = 1787,
- ERROR_TRUSTED_DOMAIN_FAILURE = 1788,
- ERROR_TRUSTED_RELATIONSHIP_FAILURE = 1789,
- ERROR_TRUST_FAILURE = 1790,
- RPC_S_CALL_IN_PROGRESS = 1791,
- ERROR_NETLOGON_NOT_STARTED = 1792,
- ERROR_ACCOUNT_EXPIRED = 1793,
- ERROR_REDIRECTOR_HAS_OPEN_HANDLES = 1794,
- ERROR_PRINTER_DRIVER_ALREADY_INSTALLED = 1795,
- ERROR_UNKNOWN_PORT = 1796,
- ERROR_UNKNOWN_PRINTER_DRIVER = 1797,
- ERROR_UNKNOWN_PRINTPROCESSOR = 1798,
- ERROR_INVALID_SEPARATOR_FILE = 1799,
- ERROR_INVALID_PRIORITY = 1800,
- ERROR_INVALID_PRINTER_NAME = 1801,
- ERROR_PRINTER_ALREADY_EXISTS = 1802,
- ERROR_INVALID_PRINTER_COMMAND = 1803,
- ERROR_INVALID_DATATYPE = 1804,
- ERROR_INVALID_ENVIRONMENT = 1805,
- RPC_S_NO_MORE_BINDINGS = 1806,
- ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 1807,
- ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 1808,
- ERROR_NOLOGON_SERVER_TRUST_ACCOUNT = 1809,
- ERROR_DOMAIN_TRUST_INCONSISTENT = 1810,
- ERROR_SERVER_HAS_OPEN_HANDLES = 1811,
- ERROR_RESOURCE_DATA_NOT_FOUND = 1812,
- ERROR_RESOURCE_TYPE_NOT_FOUND = 1813,
- ERROR_RESOURCE_NAME_NOT_FOUND = 1814,
- ERROR_RESOURCE_LANG_NOT_FOUND = 1815,
- ERROR_NOT_ENOUGH_QUOTA = 1816,
- RPC_S_NO_INTERFACES = 1817,
- RPC_S_CALL_CANCELLED = 1818,
- RPC_S_BINDING_INCOMPLETE = 1819,
- RPC_S_COMM_FAILURE = 1820,
- RPC_S_UNSUPPORTED_AUTHN_LEVEL = 1821,
- RPC_S_NO_PRINC_NAME = 1822,
- RPC_S_NOT_RPC_ERROR = 1823,
- RPC_S_UUID_LOCAL_ONLY = 1824,
- RPC_S_SEC_PKG_ERROR = 1825,
- RPC_S_NOT_CANCELLED = 1826,
- RPC_X_INVALID_ES_ACTION = 1827,
- RPC_X_WRONG_ES_VERSION = 1828,
- RPC_X_WRONG_STUB_VERSION = 1829,
- RPC_X_INVALID_PIPE_OBJECT = 1830,
- RPC_X_WRONG_PIPE_ORDER = 1831,
- RPC_X_WRONG_PIPE_VERSION = 1832,
- RPC_S_GROUP_MEMBER_NOT_FOUND = 1898,
- EPT_S_CANT_CREATE = 1899,
- RPC_S_INVALID_OBJECT = 1900,
- ERROR_INVALID_TIME = 1901,
- ERROR_INVALID_FORM_NAME = 1902,
- ERROR_INVALID_FORM_SIZE = 1903,
- ERROR_ALREADY_WAITING = 1904,
- ERROR_PRINTER_DELETED = 1905,
- ERROR_INVALID_PRINTER_STATE = 1906,
- ERROR_PASSWORD_MUST_CHANGE = 1907,
- ERROR_DOMAIN_CONTROLLER_NOT_FOUND = 1908,
- ERROR_ACCOUNT_LOCKED_OUT = 1909,
- OR_INVALID_OXID = 1910,
- OR_INVALID_OID = 1911,
- OR_INVALID_SET = 1912,
- RPC_S_SEND_INCOMPLETE = 1913,
- RPC_S_INVALID_ASYNC_HANDLE = 1914,
- RPC_S_INVALID_ASYNC_CALL = 1915,
- RPC_X_PIPE_CLOSED = 1916,
- RPC_X_PIPE_DISCIPLINE_ERROR = 1917,
- RPC_X_PIPE_EMPTY = 1918,
- ERROR_NO_SITENAME = 1919,
- ERROR_CANT_ACCESS_FILE = 1920,
- ERROR_CANT_RESOLVE_FILENAME = 1921,
- RPC_S_ENTRY_TYPE_MISMATCH = 1922,
- RPC_S_NOT_ALL_OBJS_EXPORTED = 1923,
- RPC_S_INTERFACE_NOT_EXPORTED = 1924,
- RPC_S_PROFILE_NOT_ADDED = 1925,
- RPC_S_PRF_ELT_NOT_ADDED = 1926,
- RPC_S_PRF_ELT_NOT_REMOVED = 1927,
- RPC_S_GRP_ELT_NOT_ADDED = 1928,
- RPC_S_GRP_ELT_NOT_REMOVED = 1929,
- ERROR_KM_DRIVER_BLOCKED = 1930,
- ERROR_CONTEXT_EXPIRED = 1931,
- ERROR_INVALID_PIXEL_FORMAT = 2000,
- ERROR_BAD_DRIVER = 2001,
- ERROR_INVALID_WINDOW_STYLE = 2002,
- ERROR_METAFILE_NOT_SUPPORTED = 2003,
- ERROR_TRANSFORM_NOT_SUPPORTED = 2004,
- ERROR_CLIPPING_NOT_SUPPORTED = 2005,
- ERROR_INVALID_CMM = 2010,
- ERROR_INVALID_PROFILE = 2011,
- ERROR_TAG_NOT_FOUND = 2012,
- ERROR_TAG_NOT_PRESENT = 2013,
- ERROR_DUPLICATE_TAG = 2014,
- ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE = 2015,
- ERROR_PROFILE_NOT_FOUND = 2016,
- ERROR_INVALID_COLORSPACE = 2017,
- ERROR_ICM_NOT_ENABLED = 2018,
- ERROR_DELETING_ICM_XFORM = 2019,
- ERROR_INVALID_TRANSFORM = 2020,
- ERROR_COLORSPACE_MISMATCH = 2021,
- ERROR_INVALID_COLORINDEX = 2022,
- ERROR_CONNECTED_OTHER_PASSWORD = 2108,
- ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT = 2109,
- ERROR_BAD_USERNAME = 2202,
- ERROR_NOT_CONNECTED = 2250,
- ERROR_OPEN_FILES = 2401,
- ERROR_ACTIVE_CONNECTIONS = 2402,
- ERROR_DEVICE_IN_USE = 2404,
- ERROR_UNKNOWN_PRINT_MONITOR = 3000,
- ERROR_PRINTER_DRIVER_IN_USE = 3001,
- ERROR_SPOOL_FILE_NOT_FOUND = 3002,
- ERROR_SPL_NO_STARTDOC = 3003,
- ERROR_SPL_NO_ADDJOB = 3004,
- ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED = 3005,
- ERROR_PRINT_MONITOR_ALREADY_INSTALLED = 3006,
- ERROR_INVALID_PRINT_MONITOR = 3007,
- ERROR_PRINT_MONITOR_IN_USE = 3008,
- ERROR_PRINTER_HAS_JOBS_QUEUED = 3009,
- ERROR_SUCCESS_REBOOT_REQUIRED = 3010,
- ERROR_SUCCESS_RESTART_REQUIRED = 3011,
- ERROR_PRINTER_NOT_FOUND = 3012,
- ERROR_PRINTER_DRIVER_WARNED = 3013,
- ERROR_PRINTER_DRIVER_BLOCKED = 3014,
- ERROR_WINS_INTERNAL = 4000,
- ERROR_CAN_NOT_DEL_LOCAL_WINS = 4001,
- ERROR_STATIC_INIT = 4002,
- ERROR_INC_BACKUP = 4003,
- ERROR_FULL_BACKUP = 4004,
- ERROR_REC_NON_EXISTENT = 4005,
- ERROR_RPL_NOT_ALLOWED = 4006,
- ERROR_DHCP_ADDRESS_CONFLICT = 4100,
- ERROR_WMI_GUID_NOT_FOUND = 4200,
- ERROR_WMI_INSTANCE_NOT_FOUND = 4201,
- ERROR_WMI_ITEMID_NOT_FOUND = 4202,
- ERROR_WMI_TRY_AGAIN = 4203,
- ERROR_WMI_DP_NOT_FOUND = 4204,
- ERROR_WMI_UNRESOLVED_INSTANCE_REF = 4205,
- ERROR_WMI_ALREADY_ENABLED = 4206,
- ERROR_WMI_GUID_DISCONNECTED = 4207,
- ERROR_WMI_SERVER_UNAVAILABLE = 4208,
- ERROR_WMI_DP_FAILED = 4209,
- ERROR_WMI_INVALID_MOF = 4210,
- ERROR_WMI_INVALID_REGINFO = 4211,
- ERROR_WMI_ALREADY_DISABLED = 4212,
- ERROR_WMI_READ_ONLY = 4213,
- ERROR_WMI_SET_FAILURE = 4214,
- ERROR_INVALID_MEDIA = 4300,
- ERROR_INVALID_LIBRARY = 4301,
- ERROR_INVALID_MEDIA_POOL = 4302,
- ERROR_DRIVE_MEDIA_MISMATCH = 4303,
- ERROR_MEDIA_OFFLINE = 4304,
- ERROR_LIBRARY_OFFLINE = 4305,
- ERROR_EMPTY = 4306,
- ERROR_NOT_EMPTY = 4307,
- ERROR_MEDIA_UNAVAILABLE = 4308,
- ERROR_RESOURCE_DISABLED = 4309,
- ERROR_INVALID_CLEANER = 4310,
- ERROR_UNABLE_TO_CLEAN = 4311,
- ERROR_OBJECT_NOT_FOUND = 4312,
- ERROR_DATABASE_FAILURE = 4313,
- ERROR_DATABASE_FULL = 4314,
- ERROR_MEDIA_INCOMPATIBLE = 4315,
- ERROR_RESOURCE_NOT_PRESENT = 4316,
- ERROR_INVALID_OPERATION = 4317,
- ERROR_MEDIA_NOT_AVAILABLE = 4318,
- ERROR_DEVICE_NOT_AVAILABLE = 4319,
- ERROR_REQUEST_REFUSED = 4320,
- ERROR_INVALID_DRIVE_OBJECT = 4321,
- ERROR_LIBRARY_FULL = 4322,
- ERROR_MEDIUM_NOT_ACCESSIBLE = 4323,
- ERROR_UNABLE_TO_LOAD_MEDIUM = 4324,
- ERROR_UNABLE_TO_INVENTORY_DRIVE = 4325,
- ERROR_UNABLE_TO_INVENTORY_SLOT = 4326,
- ERROR_UNABLE_TO_INVENTORY_TRANSPORT = 4327,
- ERROR_TRANSPORT_FULL = 4328,
- ERROR_CONTROLLING_IEPORT = 4329,
- ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA = 4330,
- ERROR_CLEANER_SLOT_SET = 4331,
- ERROR_CLEANER_SLOT_NOT_SET = 4332,
- ERROR_CLEANER_CARTRIDGE_SPENT = 4333,
- ERROR_UNEXPECTED_OMID = 4334,
- ERROR_CANT_DELETE_LAST_ITEM = 4335,
- ERROR_MESSAGE_EXCEEDS_MAX_SIZE = 4336,
- ERROR_VOLUME_CONTAINS_SYS_FILES = 4337,
- ERROR_INDIGENOUS_TYPE = 4338,
- ERROR_NO_SUPPORTING_DRIVES = 4339,
- ERROR_CLEANER_CARTRIDGE_INSTALLED = 4340,
- ERROR_FILE_OFFLINE = 4350,
- ERROR_REMOTE_STORAGE_NOT_ACTIVE = 4351,
- ERROR_REMOTE_STORAGE_MEDIA_ERROR = 4352,
- ERROR_NOT_A_REPARSE_POINT = 4390,
- ERROR_REPARSE_ATTRIBUTE_CONFLICT = 4391,
- ERROR_INVALID_REPARSE_DATA = 4392,
- ERROR_REPARSE_TAG_INVALID = 4393,
- ERROR_REPARSE_TAG_MISMATCH = 4394,
- ERROR_VOLUME_NOT_SIS_ENABLED = 4500,
- ERROR_DEPENDENT_RESOURCE_EXISTS = 5001,
- ERROR_DEPENDENCY_NOT_FOUND = 5002,
- ERROR_DEPENDENCY_ALREADY_EXISTS = 5003,
- ERROR_RESOURCE_NOT_ONLINE = 5004,
- ERROR_HOST_NODE_NOT_AVAILABLE = 5005,
- ERROR_RESOURCE_NOT_AVAILABLE = 5006,
- ERROR_RESOURCE_NOT_FOUND = 5007,
- ERROR_SHUTDOWN_CLUSTER = 5008,
- ERROR_CANT_EVICT_ACTIVE_NODE = 5009,
- ERROR_OBJECT_ALREADY_EXISTS = 5010,
- ERROR_OBJECT_IN_LIST = 5011,
- ERROR_GROUP_NOT_AVAILABLE = 5012,
- ERROR_GROUP_NOT_FOUND = 5013,
- ERROR_GROUP_NOT_ONLINE = 5014,
- ERROR_HOST_NODE_NOT_RESOURCE_OWNER = 5015,
- ERROR_HOST_NODE_NOT_GROUP_OWNER = 5016,
- ERROR_RESMON_CREATE_FAILED = 5017,
- ERROR_RESMON_ONLINE_FAILED = 5018,
- ERROR_RESOURCE_ONLINE = 5019,
- ERROR_QUORUM_RESOURCE = 5020,
- ERROR_NOT_QUORUM_CAPABLE = 5021,
- ERROR_CLUSTER_SHUTTING_DOWN = 5022,
- ERROR_INVALID_STATE = 5023,
- ERROR_RESOURCE_PROPERTIES_STORED = 5024,
- ERROR_NOT_QUORUM_CLASS = 5025,
- ERROR_CORE_RESOURCE = 5026,
- ERROR_QUORUM_RESOURCE_ONLINE_FAILED = 5027,
- ERROR_QUORUMLOG_OPEN_FAILED = 5028,
- ERROR_CLUSTERLOG_CORRUPT = 5029,
- ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE = 5030,
- ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE = 5031,
- ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND = 5032,
- ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE = 5033,
- ERROR_QUORUM_OWNER_ALIVE = 5034,
- ERROR_NETWORK_NOT_AVAILABLE = 5035,
- ERROR_NODE_NOT_AVAILABLE = 5036,
- ERROR_ALL_NODES_NOT_AVAILABLE = 5037,
- ERROR_RESOURCE_FAILED = 5038,
- ERROR_CLUSTER_INVALID_NODE = 5039,
- ERROR_CLUSTER_NODE_EXISTS = 5040,
- ERROR_CLUSTER_JOIN_IN_PROGRESS = 5041,
- ERROR_CLUSTER_NODE_NOT_FOUND = 5042,
- ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND = 5043,
- ERROR_CLUSTER_NETWORK_EXISTS = 5044,
- ERROR_CLUSTER_NETWORK_NOT_FOUND = 5045,
- ERROR_CLUSTER_NETINTERFACE_EXISTS = 5046,
- ERROR_CLUSTER_NETINTERFACE_NOT_FOUND = 5047,
- ERROR_CLUSTER_INVALID_REQUEST = 5048,
- ERROR_CLUSTER_INVALID_NETWORK_PROVIDER = 5049,
- ERROR_CLUSTER_NODE_DOWN = 5050,
- ERROR_CLUSTER_NODE_UNREACHABLE = 5051,
- ERROR_CLUSTER_NODE_NOT_MEMBER = 5052,
- ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS = 5053,
- ERROR_CLUSTER_INVALID_NETWORK = 5054,
- ERROR_CLUSTER_NODE_UP = 5056,
- ERROR_CLUSTER_IPADDR_IN_USE = 5057,
- ERROR_CLUSTER_NODE_NOT_PAUSED = 5058,
- ERROR_CLUSTER_NO_SECURITY_CONTEXT = 5059,
- ERROR_CLUSTER_NETWORK_NOT_INTERNAL = 5060,
- ERROR_CLUSTER_NODE_ALREADY_UP = 5061,
- ERROR_CLUSTER_NODE_ALREADY_DOWN = 5062,
- ERROR_CLUSTER_NETWORK_ALREADY_ONLINE = 5063,
- ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE = 5064,
- ERROR_CLUSTER_NODE_ALREADY_MEMBER = 5065,
- ERROR_CLUSTER_LAST_INTERNAL_NETWORK = 5066,
- ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS = 5067,
- ERROR_INVALID_OPERATION_ON_QUORUM = 5068,
- ERROR_DEPENDENCY_NOT_ALLOWED = 5069,
- ERROR_CLUSTER_NODE_PAUSED = 5070,
- ERROR_NODE_CANT_HOST_RESOURCE = 5071,
- ERROR_CLUSTER_NODE_NOT_READY = 5072,
- ERROR_CLUSTER_NODE_SHUTTING_DOWN = 5073,
- ERROR_CLUSTER_JOIN_ABORTED = 5074,
- ERROR_CLUSTER_INCOMPATIBLE_VERSIONS = 5075,
- ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED = 5076,
- ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED = 5077,
- ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND = 5078,
- ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED = 5079,
- ERROR_CLUSTER_RESNAME_NOT_FOUND = 5080,
- ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED = 5081,
- ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST = 5082,
- ERROR_CLUSTER_DATABASE_SEQMISMATCH = 5083,
- ERROR_RESMON_INVALID_STATE = 5084,
- ERROR_CLUSTER_GUM_NOT_LOCKER = 5085,
- ERROR_QUORUM_DISK_NOT_FOUND = 5086,
- ERROR_DATABASE_BACKUP_CORRUPT = 5087,
- ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT = 5088,
- ERROR_RESOURCE_PROPERTY_UNCHANGEABLE = 5089,
- ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE = 5890,
- ERROR_CLUSTER_QUORUMLOG_NOT_FOUND = 5891,
- ERROR_CLUSTER_MEMBERSHIP_HALT = 5892,
- ERROR_CLUSTER_INSTANCE_ID_MISMATCH = 5893,
- ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP = 5894,
- ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH = 5895,
- ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP = 5896,
- ERROR_CLUSTER_PARAMETER_MISMATCH = 5897,
- ERROR_NODE_CANNOT_BE_CLUSTERED = 5898,
- ERROR_CLUSTER_WRONG_OS_VERSION = 5899,
- ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME = 5900,
- ERROR_ENCRYPTION_FAILED = 6000,
- ERROR_DECRYPTION_FAILED = 6001,
- ERROR_FILE_ENCRYPTED = 6002,
- ERROR_NO_RECOVERY_POLICY = 6003,
- ERROR_NO_EFS = 6004,
- ERROR_WRONG_EFS = 6005,
- ERROR_NO_USER_KEYS = 6006,
- ERROR_FILE_NOT_ENCRYPTED = 6007,
- ERROR_NOT_EXPORT_FORMAT = 6008,
- ERROR_FILE_READ_ONLY = 6009,
- ERROR_DIR_EFS_DISALLOWED = 6010,
- ERROR_EFS_SERVER_NOT_TRUSTED = 6011,
- ERROR_BAD_RECOVERY_POLICY = 6012,
- ERROR_EFS_ALG_BLOB_TOO_BIG = 6013,
- ERROR_VOLUME_NOT_SUPPORT_EFS = 6014,
- ERROR_EFS_DISABLED = 6015,
- ERROR_EFS_VERSION_NOT_SUPPORT = 6016,
- ERROR_NO_BROWSER_SERVERS_FOUND = 6118,
- SCHED_E_SERVICE_NOT_LOCALSYSTEM = 6200,
- ERROR_CTX_WINSTATION_NAME_INVALID = 7001,
- ERROR_CTX_INVALID_PD = 7002,
- ERROR_CTX_PD_NOT_FOUND = 7003,
- ERROR_CTX_WD_NOT_FOUND = 7004,
- ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY = 7005,
- ERROR_CTX_SERVICE_NAME_COLLISION = 7006,
- ERROR_CTX_CLOSE_PENDING = 7007,
- ERROR_CTX_NO_OUTBUF = 7008,
- ERROR_CTX_MODEM_INF_NOT_FOUND = 7009,
- ERROR_CTX_INVALID_MODEMNAME = 7010,
- ERROR_CTX_MODEM_RESPONSE_ERROR = 7011,
- ERROR_CTX_MODEM_RESPONSE_TIMEOUT = 7012,
- ERROR_CTX_MODEM_RESPONSE_NO_CARRIER = 7013,
- ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE = 7014,
- ERROR_CTX_MODEM_RESPONSE_BUSY = 7015,
- ERROR_CTX_MODEM_RESPONSE_VOICE = 7016,
- ERROR_CTX_TD_ERROR = 7017,
- ERROR_CTX_WINSTATION_NOT_FOUND = 7022,
- ERROR_CTX_WINSTATION_ALREADY_EXISTS = 7023,
- ERROR_CTX_WINSTATION_BUSY = 7024,
- ERROR_CTX_BAD_VIDEO_MODE = 7025,
- ERROR_CTX_GRAPHICS_INVALID = 7035,
- ERROR_CTX_LOGON_DISABLED = 7037,
- ERROR_CTX_NOT_CONSOLE = 7038,
- ERROR_CTX_CLIENT_QUERY_TIMEOUT = 7040,
- ERROR_CTX_CONSOLE_DISCONNECT = 7041,
- ERROR_CTX_CONSOLE_CONNECT = 7042,
- ERROR_CTX_SHADOW_DENIED = 7044,
- ERROR_CTX_WINSTATION_ACCESS_DENIED = 7045,
- ERROR_CTX_INVALID_WD = 7049,
- ERROR_CTX_SHADOW_INVALID = 7050,
- ERROR_CTX_SHADOW_DISABLED = 7051,
- ERROR_CTX_CLIENT_LICENSE_IN_USE = 7052,
- ERROR_CTX_CLIENT_LICENSE_NOT_SET = 7053,
- ERROR_CTX_LICENSE_NOT_AVAILABLE = 7054,
- ERROR_CTX_LICENSE_CLIENT_INVALID = 7055,
- ERROR_CTX_LICENSE_EXPIRED = 7056,
- ERROR_CTX_SHADOW_NOT_RUNNING = 7057,
- ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE = 7058,
- FRS_ERR_INVALID_API_SEQUENCE = 8001,
- FRS_ERR_STARTING_SERVICE = 8002,
- FRS_ERR_STOPPING_SERVICE = 8003,
- FRS_ERR_INTERNAL_API = 8004,
- FRS_ERR_INTERNAL = 8005,
- FRS_ERR_SERVICE_COMM = 8006,
- FRS_ERR_INSUFFICIENT_PRIV = 8007,
- FRS_ERR_AUTHENTICATION = 8008,
- FRS_ERR_PARENT_INSUFFICIENT_PRIV = 8009,
- FRS_ERR_PARENT_AUTHENTICATION = 8010,
- FRS_ERR_CHILD_TO_PARENT_COMM = 8011,
- FRS_ERR_PARENT_TO_CHILD_COMM = 8012,
- FRS_ERR_SYSVOL_POPULATE = 8013,
- FRS_ERR_SYSVOL_POPULATE_TIMEOUT = 8014,
- FRS_ERR_SYSVOL_IS_BUSY = 8015,
- FRS_ERR_SYSVOL_DEMOTE = 8016,
- FRS_ERR_INVALID_SERVICE_PARAMETER = 8017,
- ERROR_DS_NOT_INSTALLED = 8200,
- ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY = 8201,
- ERROR_DS_NO_ATTRIBUTE_OR_VALUE = 8202,
- ERROR_DS_INVALID_ATTRIBUTE_SYNTAX = 8203,
- ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED = 8204,
- ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS = 8205,
- ERROR_DS_BUSY = 8206,
- ERROR_DS_UNAVAILABLE = 8207,
- ERROR_DS_NO_RIDS_ALLOCATED = 8208,
- ERROR_DS_NO_MORE_RIDS = 8209,
- ERROR_DS_INCORRECT_ROLE_OWNER = 8210,
- ERROR_DS_RIDMGR_INIT_ERROR = 8211,
- ERROR_DS_OBJ_CLASS_VIOLATION = 8212,
- ERROR_DS_CANT_ON_NON_LEAF = 8213,
- ERROR_DS_CANT_ON_RDN = 8214,
- ERROR_DS_CANT_MOD_OBJ_CLASS = 8215,
- ERROR_DS_CROSS_DOM_MOVE_ERROR = 8216,
- ERROR_DS_GC_NOT_AVAILABLE = 8217,
- ERROR_SHARED_POLICY = 8218,
- ERROR_POLICY_OBJECT_NOT_FOUND = 8219,
- ERROR_POLICY_ONLY_IN_DS = 8220,
- ERROR_PROMOTION_ACTIVE = 8221,
- ERROR_NO_PROMOTION_ACTIVE = 8222,
- ERROR_DS_OPERATIONS_ERROR = 8224,
- ERROR_DS_PROTOCOL_ERROR = 8225,
- ERROR_DS_TIMELIMIT_EXCEEDED = 8226,
- ERROR_DS_SIZELIMIT_EXCEEDED = 8227,
- ERROR_DS_ADMIN_LIMIT_EXCEEDED = 8228,
- ERROR_DS_COMPARE_FALSE = 8229,
- ERROR_DS_COMPARE_TRUE = 8230,
- ERROR_DS_AUTH_METHOD_NOT_SUPPORTED = 8231,
- ERROR_DS_STRONG_AUTH_REQUIRED = 8232,
- ERROR_DS_INAPPROPRIATE_AUTH = 8233,
- ERROR_DS_AUTH_UNKNOWN = 8234,
- ERROR_DS_REFERRAL = 8235,
- ERROR_DS_UNAVAILABLE_CRIT_EXTENSION = 8236,
- ERROR_DS_CONFIDENTIALITY_REQUIRED = 8237,
- ERROR_DS_INAPPROPRIATE_MATCHING = 8238,
- ERROR_DS_CONSTRAINT_VIOLATION = 8239,
- ERROR_DS_NO_SUCH_OBJECT = 8240,
- ERROR_DS_ALIAS_PROBLEM = 8241,
- ERROR_DS_INVALID_DN_SYNTAX = 8242,
- ERROR_DS_IS_LEAF = 8243,
- ERROR_DS_ALIAS_DEREF_PROBLEM = 8244,
- ERROR_DS_UNWILLING_TO_PERFORM = 8245,
- ERROR_DS_LOOP_DETECT = 8246,
- ERROR_DS_NAMING_VIOLATION = 8247,
- ERROR_DS_OBJECT_RESULTS_TOO_LARGE = 8248,
- ERROR_DS_AFFECTS_MULTIPLE_DSAS = 8249,
- ERROR_DS_SERVER_DOWN = 8250,
- ERROR_DS_LOCAL_ERROR = 8251,
- ERROR_DS_ENCODING_ERROR = 8252,
- ERROR_DS_DECODING_ERROR = 8253,
- ERROR_DS_FILTER_UNKNOWN = 8254,
- ERROR_DS_PARAM_ERROR = 8255,
- ERROR_DS_NOT_SUPPORTED = 8256,
- ERROR_DS_NO_RESULTS_RETURNED = 8257,
- ERROR_DS_CONTROL_NOT_FOUND = 8258,
- ERROR_DS_CLIENT_LOOP = 8259,
- ERROR_DS_REFERRAL_LIMIT_EXCEEDED = 8260,
- ERROR_DS_SORT_CONTROL_MISSING = 8261,
- ERROR_DS_OFFSET_RANGE_ERROR = 8262,
- ERROR_DS_ROOT_MUST_BE_NC = 8301,
- ERROR_DS_ADD_REPLICA_INHIBITED = 8302,
- ERROR_DS_ATT_NOT_DEF_IN_SCHEMA = 8303,
- ERROR_DS_MAX_OBJ_SIZE_EXCEEDED = 8304,
- ERROR_DS_OBJ_STRING_NAME_EXISTS = 8305,
- ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA = 8306,
- ERROR_DS_RDN_DOESNT_MATCH_SCHEMA = 8307,
- ERROR_DS_NO_REQUESTED_ATTS_FOUND = 8308,
- ERROR_DS_USER_BUFFER_TO_SMALL = 8309,
- ERROR_DS_ATT_IS_NOT_ON_OBJ = 8310,
- ERROR_DS_ILLEGAL_MOD_OPERATION = 8311,
- ERROR_DS_OBJ_TOO_LARGE = 8312,
- ERROR_DS_BAD_INSTANCE_TYPE = 8313,
- ERROR_DS_MASTERDSA_REQUIRED = 8314,
- ERROR_DS_OBJECT_CLASS_REQUIRED = 8315,
- ERROR_DS_MISSING_REQUIRED_ATT = 8316,
- ERROR_DS_ATT_NOT_DEF_FOR_CLASS = 8317,
- ERROR_DS_ATT_ALREADY_EXISTS = 8318,
- ERROR_DS_CANT_ADD_ATT_VALUES = 8320,
- ERROR_DS_SINGLE_VALUE_CONSTRAINT = 8321,
- ERROR_DS_RANGE_CONSTRAINT = 8322,
- ERROR_DS_ATT_VAL_ALREADY_EXISTS = 8323,
- ERROR_DS_CANT_REM_MISSING_ATT = 8324,
- ERROR_DS_CANT_REM_MISSING_ATT_VAL = 8325,
- ERROR_DS_ROOT_CANT_BE_SUBREF = 8326,
- ERROR_DS_NO_CHAINING = 8327,
- ERROR_DS_NO_CHAINED_EVAL = 8328,
- ERROR_DS_NO_PARENT_OBJECT = 8329,
- ERROR_DS_PARENT_IS_AN_ALIAS = 8330,
- ERROR_DS_CANT_MIX_MASTER_AND_REPS = 8331,
- ERROR_DS_CHILDREN_EXIST = 8332,
- ERROR_DS_OBJ_NOT_FOUND = 8333,
- ERROR_DS_ALIASED_OBJ_MISSING = 8334,
- ERROR_DS_BAD_NAME_SYNTAX = 8335,
- ERROR_DS_ALIAS_POINTS_TO_ALIAS = 8336,
- ERROR_DS_CANT_DEREF_ALIAS = 8337,
- ERROR_DS_OUT_OF_SCOPE = 8338,
- ERROR_DS_OBJECT_BEING_REMOVED = 8339,
- ERROR_DS_CANT_DELETE_DSA_OBJ = 8340,
- ERROR_DS_GENERIC_ERROR = 8341,
- ERROR_DS_DSA_MUST_BE_INT_MASTER = 8342,
- ERROR_DS_CLASS_NOT_DSA = 8343,
- ERROR_DS_INSUFF_ACCESS_RIGHTS = 8344,
- ERROR_DS_ILLEGAL_SUPERIOR = 8345,
- ERROR_DS_ATTRIBUTE_OWNED_BY_SAM = 8346,
- ERROR_DS_NAME_TOO_MANY_PARTS = 8347,
- ERROR_DS_NAME_TOO_LONG = 8348,
- ERROR_DS_NAME_VALUE_TOO_LONG = 8349,
- ERROR_DS_NAME_UNPARSEABLE = 8350,
- ERROR_DS_NAME_TYPE_UNKNOWN = 8351,
- ERROR_DS_NOT_AN_OBJECT = 8352,
- ERROR_DS_SEC_DESC_TOO_SHORT = 8353,
- ERROR_DS_SEC_DESC_INVALID = 8354,
- ERROR_DS_NO_DELETED_NAME = 8355,
- ERROR_DS_SUBREF_MUST_HAVE_PARENT = 8356,
- ERROR_DS_NCNAME_MUST_BE_NC = 8357,
- ERROR_DS_CANT_ADD_SYSTEM_ONLY = 8358,
- ERROR_DS_CLASS_MUST_BE_CONCRETE = 8359,
- ERROR_DS_INVALID_DMD = 8360,
- ERROR_DS_OBJ_GUID_EXISTS = 8361,
- ERROR_DS_NOT_ON_BACKLINK = 8362,
- ERROR_DS_NO_CROSSREF_FOR_NC = 8363,
- ERROR_DS_SHUTTING_DOWN = 8364,
- ERROR_DS_UNKNOWN_OPERATION = 8365,
- ERROR_DS_INVALID_ROLE_OWNER = 8366,
- ERROR_DS_COULDNT_CONTACT_FSMO = 8367,
- ERROR_DS_CROSS_NC_DN_RENAME = 8368,
- ERROR_DS_CANT_MOD_SYSTEM_ONLY = 8369,
- ERROR_DS_REPLICATOR_ONLY = 8370,
- ERROR_DS_OBJ_CLASS_NOT_DEFINED = 8371,
- ERROR_DS_OBJ_CLASS_NOT_SUBCLASS = 8372,
- ERROR_DS_NAME_REFERENCE_INVALID = 8373,
- ERROR_DS_CROSS_REF_EXISTS = 8374,
- ERROR_DS_CANT_DEL_MASTER_CROSSREF = 8375,
- ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD = 8376,
- ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX = 8377,
- ERROR_DS_DUP_RDN = 8378,
- ERROR_DS_DUP_OID = 8379,
- ERROR_DS_DUP_MAPI_ID = 8380,
- ERROR_DS_DUP_SCHEMA_ID_GUID = 8381,
- ERROR_DS_DUP_LDAP_DISPLAY_NAME = 8382,
- ERROR_DS_SEMANTIC_ATT_TEST = 8383,
- ERROR_DS_SYNTAX_MISMATCH = 8384,
- ERROR_DS_EXISTS_IN_MUST_HAVE = 8385,
- ERROR_DS_EXISTS_IN_MAY_HAVE = 8386,
- ERROR_DS_NONEXISTENT_MAY_HAVE = 8387,
- ERROR_DS_NONEXISTENT_MUST_HAVE = 8388,
- ERROR_DS_AUX_CLS_TEST_FAIL = 8389,
- ERROR_DS_NONEXISTENT_POSS_SUP = 8390,
- ERROR_DS_SUB_CLS_TEST_FAIL = 8391,
- ERROR_DS_BAD_RDN_ATT_ID_SYNTAX = 8392,
- ERROR_DS_EXISTS_IN_AUX_CLS = 8393,
- ERROR_DS_EXISTS_IN_SUB_CLS = 8394,
- ERROR_DS_EXISTS_IN_POSS_SUP = 8395,
- ERROR_DS_RECALCSCHEMA_FAILED = 8396,
- ERROR_DS_TREE_DELETE_NOT_FINISHED = 8397,
- ERROR_DS_CANT_DELETE = 8398,
- ERROR_DS_ATT_SCHEMA_REQ_ID = 8399,
- ERROR_DS_BAD_ATT_SCHEMA_SYNTAX = 8400,
- ERROR_DS_CANT_CACHE_ATT = 8401,
- ERROR_DS_CANT_CACHE_CLASS = 8402,
- ERROR_DS_CANT_REMOVE_ATT_CACHE = 8403,
- ERROR_DS_CANT_REMOVE_CLASS_CACHE = 8404,
- ERROR_DS_CANT_RETRIEVE_DN = 8405,
- ERROR_DS_MISSING_SUPREF = 8406,
- ERROR_DS_CANT_RETRIEVE_INSTANCE = 8407,
- ERROR_DS_CODE_INCONSISTENCY = 8408,
- ERROR_DS_DATABASE_ERROR = 8409,
- ERROR_DS_GOVERNSID_MISSING = 8410,
- ERROR_DS_MISSING_EXPECTED_ATT = 8411,
- ERROR_DS_NCNAME_MISSING_CR_REF = 8412,
- ERROR_DS_SECURITY_CHECKING_ERROR = 8413,
- ERROR_DS_SCHEMA_NOT_LOADED = 8414,
- ERROR_DS_SCHEMA_ALLOC_FAILED = 8415,
- ERROR_DS_ATT_SCHEMA_REQ_SYNTAX = 8416,
- ERROR_DS_GCVERIFY_ERROR = 8417,
- ERROR_DS_DRA_SCHEMA_MISMATCH = 8418,
- ERROR_DS_CANT_FIND_DSA_OBJ = 8419,
- ERROR_DS_CANT_FIND_EXPECTED_NC = 8420,
- ERROR_DS_CANT_FIND_NC_IN_CACHE = 8421,
- ERROR_DS_CANT_RETRIEVE_CHILD = 8422,
- ERROR_DS_SECURITY_ILLEGAL_MODIFY = 8423,
- ERROR_DS_CANT_REPLACE_HIDDEN_REC = 8424,
- ERROR_DS_BAD_HIERARCHY_FILE = 8425,
- ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED = 8426,
- ERROR_DS_CONFIG_PARAM_MISSING = 8427,
- ERROR_DS_COUNTING_AB_INDICES_FAILED = 8428,
- ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED = 8429,
- ERROR_DS_INTERNAL_FAILURE = 8430,
- ERROR_DS_UNKNOWN_ERROR = 8431,
- ERROR_DS_ROOT_REQUIRES_CLASS_TOP = 8432,
- ERROR_DS_REFUSING_FSMO_ROLES = 8433,
- ERROR_DS_MISSING_FSMO_SETTINGS = 8434,
- ERROR_DS_UNABLE_TO_SURRENDER_ROLES = 8435,
- ERROR_DS_DRA_GENERIC = 8436,
- ERROR_DS_DRA_INVALID_PARAMETER = 8437,
- ERROR_DS_DRA_BUSY = 8438,
- ERROR_DS_DRA_BAD_DN = 8439,
- ERROR_DS_DRA_BAD_NC = 8440,
- ERROR_DS_DRA_DN_EXISTS = 8441,
- ERROR_DS_DRA_INTERNAL_ERROR = 8442,
- ERROR_DS_DRA_INCONSISTENT_DIT = 8443,
- ERROR_DS_DRA_CONNECTION_FAILED = 8444,
- ERROR_DS_DRA_BAD_INSTANCE_TYPE = 8445,
- ERROR_DS_DRA_OUT_OF_MEM = 8446,
- ERROR_DS_DRA_MAIL_PROBLEM = 8447,
- ERROR_DS_DRA_REF_ALREADY_EXISTS = 8448,
- ERROR_DS_DRA_REF_NOT_FOUND = 8449,
- ERROR_DS_DRA_OBJ_IS_REP_SOURCE = 8450,
- ERROR_DS_DRA_DB_ERROR = 8451,
- ERROR_DS_DRA_NO_REPLICA = 8452,
- ERROR_DS_DRA_ACCESS_DENIED = 8453,
- ERROR_DS_DRA_NOT_SUPPORTED = 8454,
- ERROR_DS_DRA_RPC_CANCELLED = 8455,
- ERROR_DS_DRA_SOURCE_DISABLED = 8456,
- ERROR_DS_DRA_SINK_DISABLED = 8457,
- ERROR_DS_DRA_NAME_COLLISION = 8458,
- ERROR_DS_DRA_SOURCE_REINSTALLED = 8459,
- ERROR_DS_DRA_MISSING_PARENT = 8460,
- ERROR_DS_DRA_PREEMPTED = 8461,
- ERROR_DS_DRA_ABANDON_SYNC = 8462,
- ERROR_DS_DRA_SHUTDOWN = 8463,
- ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET = 8464,
- ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA = 8465,
- ERROR_DS_DRA_EXTN_CONNECTION_FAILED = 8466,
- ERROR_DS_INSTALL_SCHEMA_MISMATCH = 8467,
- ERROR_DS_DUP_LINK_ID = 8468,
- ERROR_DS_NAME_ERROR_RESOLVING = 8469,
- ERROR_DS_NAME_ERROR_NOT_FOUND = 8470,
- ERROR_DS_NAME_ERROR_NOT_UNIQUE = 8471,
- ERROR_DS_NAME_ERROR_NO_MAPPING = 8472,
- ERROR_DS_NAME_ERROR_DOMAIN_ONLY = 8473,
- ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING = 8474,
- ERROR_DS_CONSTRUCTED_ATT_MOD = 8475,
- ERROR_DS_WRONG_OM_OBJ_CLASS = 8476,
- ERROR_DS_DRA_REPL_PENDING = 8477,
- ERROR_DS_DS_REQUIRED = 8478,
- ERROR_DS_INVALID_LDAP_DISPLAY_NAME = 8479,
- ERROR_DS_NON_BASE_SEARCH = 8480,
- ERROR_DS_CANT_RETRIEVE_ATTS = 8481,
- ERROR_DS_BACKLINK_WITHOUT_LINK = 8482,
- ERROR_DS_EPOCH_MISMATCH = 8483,
- ERROR_DS_SRC_NAME_MISMATCH = 8484,
- ERROR_DS_SRC_AND_DST_NC_IDENTICAL = 8485,
- ERROR_DS_DST_NC_MISMATCH = 8486,
- ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC = 8487,
- ERROR_DS_SRC_GUID_MISMATCH = 8488,
- ERROR_DS_CANT_MOVE_DELETED_OBJECT = 8489,
- ERROR_DS_PDC_OPERATION_IN_PROGRESS = 8490,
- ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD = 8491,
- ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION = 8492,
- ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS = 8493,
- ERROR_DS_NC_MUST_HAVE_NC_PARENT = 8494,
- ERROR_DS_DST_DOMAIN_NOT_NATIVE = 8496,
- ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER = 8497,
- ERROR_DS_CANT_MOVE_ACCOUNT_GROUP = 8498,
- ERROR_DS_CANT_MOVE_RESOURCE_GROUP = 8499,
- ERROR_DS_INVALID_SEARCH_FLAG = 8500,
- ERROR_DS_NO_TREE_DELETE_ABOVE_NC = 8501,
- ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE = 8502,
- ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE = 8503,
- ERROR_DS_SAM_INIT_FAILURE = 8504,
- ERROR_DS_SENSITIVE_GROUP_VIOLATION = 8505,
- ERROR_DS_CANT_MOD_PRIMARYGROUPID = 8506,
- ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD = 8507,
- ERROR_DS_NONSAFE_SCHEMA_CHANGE = 8508,
- ERROR_DS_SCHEMA_UPDATE_DISALLOWED = 8509,
- ERROR_DS_CANT_CREATE_UNDER_SCHEMA = 8510,
- ERROR_DS_INSTALL_NO_SRC_SCH_VERSION = 8511,
- ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE = 8512,
- ERROR_DS_INVALID_GROUP_TYPE = 8513,
- ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN = 8514,
- ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN = 8515,
- ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER = 8516,
- ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER = 8517,
- ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER = 8518,
- ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER = 8519,
- ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER = 8520,
- ERROR_DS_HAVE_PRIMARY_MEMBERS = 8521,
- ERROR_DS_STRING_SD_CONVERSION_FAILED = 8522,
- ERROR_DS_NAMING_MASTER_GC = 8523,
- ERROR_DS_LOOKUP_FAILURE = 8524,
- ERROR_DS_COULDNT_UPDATE_SPNS = 8525,
- ERROR_DS_CANT_RETRIEVE_SD = 8526,
- ERROR_DS_KEY_NOT_UNIQUE = 8527,
- ERROR_DS_WRONG_LINKED_ATT_SYNTAX = 8528,
- ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD = 8529,
- ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY = 8530,
- ERROR_DS_CANT_START = 8531,
- ERROR_DS_INIT_FAILURE = 8532,
- ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION = 8533,
- ERROR_DS_SOURCE_DOMAIN_IN_FOREST = 8534,
- ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST = 8535,
- ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED = 8536,
- ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN = 8537,
- ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER = 8538,
- ERROR_DS_SRC_SID_EXISTS_IN_FOREST = 8539,
- ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH = 8540,
- ERROR_SAM_INIT_FAILURE = 8541,
- ERROR_DS_DRA_SCHEMA_INFO_SHIP = 8542,
- ERROR_DS_DRA_SCHEMA_CONFLICT = 8543,
- ERROR_DS_DRA_EARLIER_SCHEMA_CONLICT = 8544,
- ERROR_DS_DRA_OBJ_NC_MISMATCH = 8545,
- ERROR_DS_NC_STILL_HAS_DSAS = 8546,
- ERROR_DS_GC_REQUIRED = 8547,
- ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY = 8548,
- ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS = 8549,
- ERROR_DS_CANT_ADD_TO_GC = 8550,
- ERROR_DS_NO_CHECKPOINT_WITH_PDC = 8551,
- ERROR_DS_SOURCE_AUDITING_NOT_ENABLED = 8552,
- ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC = 8553,
- ERROR_DS_INVALID_NAME_FOR_SPN = 8554,
- ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS = 8555,
- ERROR_DS_UNICODEPWD_NOT_IN_QUOTES = 8556,
- ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED = 8557,
- ERROR_DS_MUST_BE_RUN_ON_DST_DC = 8558,
- ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER = 8559,
- ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ = 8560,
- ERROR_DS_INIT_FAILURE_CONSOLE = 8561,
- ERROR_DS_SAM_INIT_FAILURE_CONSOLE = 8562,
- ERROR_DS_FOREST_VERSION_TOO_HIGH = 8563,
- ERROR_DS_DOMAIN_VERSION_TOO_HIGH = 8564,
- ERROR_DS_FOREST_VERSION_TOO_LOW = 8565,
- ERROR_DS_DOMAIN_VERSION_TOO_LOW = 8566,
- ERROR_DS_INCOMPATIBLE_VERSION = 8567,
- ERROR_DS_LOW_DSA_VERSION = 8568,
- ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN = 8569,
- ERROR_DS_NOT_SUPPORTED_SORT_ORDER = 8570,
- ERROR_DS_NAME_NOT_UNIQUE = 8571,
- ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 = 8572,
- ERROR_DS_OUT_OF_VERSION_STORE = 8573,
- ERROR_DS_INCOMPATIBLE_CONTROLS_USED = 8574,
- ERROR_DS_NO_REF_DOMAIN = 8575,
- ERROR_DS_RESERVED_LINK_ID = 8576,
- ERROR_DS_LINK_ID_NOT_AVAILABLE = 8577,
- ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER = 8578,
- ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE = 8579,
- ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC = 8580,
- ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG = 8581,
- ERROR_DS_MODIFYDN_WRONG_GRANDPARENT = 8582,
- ERROR_DS_NAME_ERROR_TRUST_REFERRAL = 8583,
- ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER = 8584,
- ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD = 8585,
- ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE = 8586,
- ERROR_DS_THREAD_LIMIT_EXCEEDED = 8587,
- ERROR_DS_NOT_CLOSEST = 8588,
- ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF = 8589,
- ERROR_DS_SINGLE_USER_MODE_FAILED = 8590,
- ERROR_DS_NTDSCRIPT_SYNTAX_ERROR = 8591,
- ERROR_DS_NTDSCRIPT_PROCESS_ERROR = 8592,
- ERROR_DS_DIFFERENT_REPL_EPOCHS = 8593,
- ERROR_DS_DRS_EXTENSIONS_CHANGED = 8594,
- ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR = 8595,
- ERROR_DS_NO_MSDS_INTID = 8596,
- ERROR_DS_DUP_MSDS_INTID = 8597,
- ERROR_DS_EXISTS_IN_RDNATTID = 8598,
- ERROR_DS_AUTHORIZATION_FAILED = 8599,
- ERROR_DS_INVALID_SCRIPT = 8600,
- ERROR_DS_REMOTE_CROSSREF_OP_FAILED = 8601,
- DNS_ERROR_RCODE_FORMAT_ERROR = 9001,
- DNS_ERROR_RCODE_SERVER_FAILURE = 9002,
- DNS_ERROR_RCODE_NAME_ERROR = 9003,
- DNS_ERROR_RCODE_NOT_IMPLEMENTED = 9004,
- DNS_ERROR_RCODE_REFUSED = 9005,
- DNS_ERROR_RCODE_YXDOMAIN = 9006,
- DNS_ERROR_RCODE_YXRRSET = 9007,
- DNS_ERROR_RCODE_NXRRSET = 9008,
- DNS_ERROR_RCODE_NOTAUTH = 9009,
- DNS_ERROR_RCODE_NOTZONE = 9010,
- DNS_ERROR_RCODE_BADSIG = 9016,
- DNS_ERROR_RCODE_BADKEY = 9017,
- DNS_ERROR_RCODE_BADTIME = 9018,
- DNS_INFO_NO_RECORDS = 9501,
- DNS_ERROR_BAD_PACKET = 9502,
- DNS_ERROR_NO_PACKET = 9503,
- DNS_ERROR_RCODE = 9504,
- DNS_ERROR_UNSECURE_PACKET = 9505,
- DNS_ERROR_INVALID_TYPE = 9551,
- DNS_ERROR_INVALID_IP_ADDRESS = 9552,
- DNS_ERROR_INVALID_PROPERTY = 9553,
- DNS_ERROR_TRY_AGAIN_LATER = 9554,
- DNS_ERROR_NOT_UNIQUE = 9555,
- DNS_ERROR_NON_RFC_NAME = 9556,
- DNS_STATUS_FQDN = 9557,
- DNS_STATUS_DOTTED_NAME = 9558,
- DNS_STATUS_SINGLE_PART_NAME = 9559,
- DNS_ERROR_INVALID_NAME_CHAR = 9560,
- DNS_ERROR_NUMERIC_NAME = 9561,
- DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER = 9562,
- DNS_ERROR_ZONE_DOES_NOT_EXIST = 9601,
- DNS_ERROR_NO_ZONE_INFO = 9602,
- DNS_ERROR_INVALID_ZONE_OPERATION = 9603,
- DNS_ERROR_ZONE_CONFIGURATION_ERROR = 9604,
- DNS_ERROR_ZONE_HAS_NO_SOA_RECORD = 9605,
- DNS_ERROR_ZONE_HAS_NO_NS_RECORDS = 9606,
- DNS_ERROR_ZONE_LOCKED = 9607,
- DNS_ERROR_ZONE_CREATION_FAILED = 9608,
- DNS_ERROR_ZONE_ALREADY_EXISTS = 9609,
- DNS_ERROR_AUTOZONE_ALREADY_EXISTS = 9610,
- DNS_ERROR_INVALID_ZONE_TYPE = 9611,
- DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP = 9612,
- DNS_ERROR_ZONE_NOT_SECONDARY = 9613,
- DNS_ERROR_NEED_SECONDARY_ADDRESSES = 9614,
- DNS_ERROR_WINS_INIT_FAILED = 9615,
- DNS_ERROR_NEED_WINS_SERVERS = 9616,
- DNS_ERROR_NBSTAT_INIT_FAILED = 9617,
- DNS_ERROR_SOA_DELETE_INVALID = 9618,
- DNS_ERROR_FORWARDER_ALREADY_EXISTS = 9619,
- DNS_ERROR_ZONE_REQUIRES_MASTER_IP = 9620,
- DNS_ERROR_ZONE_IS_SHUTDOWN = 9621,
- DNS_ERROR_PRIMARY_REQUIRES_DATAFILE = 9651,
- DNS_ERROR_INVALID_DATAFILE_NAME = 9652,
- DNS_ERROR_DATAFILE_OPEN_FAILURE = 9653,
- DNS_ERROR_FILE_WRITEBACK_FAILED = 9654,
- DNS_ERROR_DATAFILE_PARSING = 9655,
- DNS_ERROR_RECORD_DOES_NOT_EXIST = 9701,
- DNS_ERROR_RECORD_FORMAT = 9702,
- DNS_ERROR_NODE_CREATION_FAILED = 9703,
- DNS_ERROR_UNKNOWN_RECORD_TYPE = 9704,
- DNS_ERROR_RECORD_TIMED_OUT = 9705,
- DNS_ERROR_NAME_NOT_IN_ZONE = 9706,
- DNS_ERROR_CNAME_LOOP = 9707,
- DNS_ERROR_NODE_IS_CNAME = 9708,
- DNS_ERROR_CNAME_COLLISION = 9709,
- DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT = 9710,
- DNS_ERROR_RECORD_ALREADY_EXISTS = 9711,
- DNS_ERROR_SECONDARY_DATA = 9712,
- DNS_ERROR_NO_CREATE_CACHE_DATA = 9713,
- DNS_ERROR_NAME_DOES_NOT_EXIST = 9714,
- DNS_WARNING_PTR_CREATE_FAILED = 9715,
- DNS_WARNING_DOMAIN_UNDELETED = 9716,
- DNS_ERROR_DS_UNAVAILABLE = 9717,
- DNS_ERROR_DS_ZONE_ALREADY_EXISTS = 9718,
- DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE = 9719,
- DNS_INFO_AXFR_COMPLETE = 9751,
- DNS_ERROR_AXFR = 9752,
- DNS_INFO_ADDED_LOCAL_WINS = 9753,
- DNS_STATUS_CONTINUE_NEEDED = 9801,
- DNS_ERROR_NO_TCPIP = 9851,
- DNS_ERROR_NO_DNS_SERVERS = 9852,
- DNS_ERROR_DP_DOES_NOT_EXIST = 9901,
- DNS_ERROR_DP_ALREADY_EXISTS = 9902,
- DNS_ERROR_DP_NOT_ENLISTED = 9903,
- DNS_ERROR_DP_ALREADY_ENLISTED = 9904,
- WSAEINTR = 10004,
- WSAEBADF = 10009,
- WSAEACCES = 10013,
- WSAEFAULT = 10014,
- WSAEINVAL = 10022,
- WSAEMFILE = 10024,
- WSAEWOULDBLOCK = 10035,
- WSAEINPROGRESS = 10036,
- WSAEALREADY = 10037,
- WSAENOTSOCK = 10038,
- WSAEDESTADDRREQ = 10039,
- WSAEMSGSIZE = 10040,
- WSAEPROTOTYPE = 10041,
- WSAENOPROTOOPT = 10042,
- WSAEPROTONOSUPPORT = 10043,
- WSAESOCKTNOSUPPORT = 10044,
- WSAEOPNOTSUPP = 10045,
- WSAEPFNOSUPPORT = 10046,
- WSAEAFNOSUPPORT = 10047,
- WSAEADDRINUSE = 10048,
- WSAEADDRNOTAVAIL = 10049,
- WSAENETDOWN = 10050,
- WSAENETUNREACH = 10051,
- WSAENETRESET = 10052,
- WSAECONNABORTED = 10053,
- WSAECONNRESET = 10054,
- WSAENOBUFS = 10055,
- WSAEISCONN = 10056,
- WSAENOTCONN = 10057,
- WSAESHUTDOWN = 10058,
- WSAETOOMANYREFS = 10059,
- WSAETIMEDOUT = 10060,
- WSAECONNREFUSED = 10061,
- WSAELOOP = 10062,
- WSAENAMETOOLONG = 10063,
- WSAEHOSTDOWN = 10064,
- WSAEHOSTUNREACH = 10065,
- WSAENOTEMPTY = 10066,
- WSAEPROCLIM = 10067,
- WSAEUSERS = 10068,
- WSAEDQUOT = 10069,
- WSAESTALE = 10070,
- WSAEREMOTE = 10071,
- WSASYSNOTREADY = 10091,
- WSAVERNOTSUPPORTED = 10092,
- WSANOTINITIALISED = 10093,
- WSAEDISCON = 10101,
- WSAENOMORE = 10102,
- WSAECANCELLED = 10103,
- WSAEINVALIDPROCTABLE = 10104,
- WSAEINVALIDPROVIDER = 10105,
- WSAEPROVIDERFAILEDINIT = 10106,
- WSASYSCALLFAILURE = 10107,
- WSASERVICE_NOT_FOUND = 10108,
- WSATYPE_NOT_FOUND = 10109,
- WSA_E_NO_MORE = 10110,
- WSA_E_CANCELLED = 10111,
- WSAEREFUSED = 10112,
- WSAHOST_NOT_FOUND = 11001,
- WSATRY_AGAIN = 11002,
- WSANO_RECOVERY = 11003,
- WSANO_DATA = 11004,
- WSA_QOS_RECEIVERS = 11005,
- WSA_QOS_SENDERS = 11006,
- WSA_QOS_NO_SENDERS = 11007,
- WSA_QOS_NO_RECEIVERS = 11008,
- WSA_QOS_REQUEST_CONFIRMED = 11009,
- WSA_QOS_ADMISSION_FAILURE = 11010,
- WSA_QOS_POLICY_FAILURE = 11011,
- WSA_QOS_BAD_STYLE = 11012,
- WSA_QOS_BAD_OBJECT = 11013,
- WSA_QOS_TRAFFIC_CTRL_ERROR = 11014,
- WSA_QOS_GENERIC_ERROR = 11015,
- WSA_QOS_ESERVICETYPE = 11016,
- WSA_QOS_EFLOWSPEC = 11017,
- WSA_QOS_EPROVSPECBUF = 11018,
- WSA_QOS_EFILTERSTYLE = 11019,
- WSA_QOS_EFILTERTYPE = 11020,
- WSA_QOS_EFILTERCOUNT = 11021,
- WSA_QOS_EOBJLENGTH = 11022,
- WSA_QOS_EFLOWCOUNT = 11023,
- WSA_QOS_EUNKNOWNPSOBJ = 11024,
- WSA_QOS_EPOLICYOBJ = 11025,
- WSA_QOS_EFLOWDESC = 11026,
- WSA_QOS_EPSFLOWSPEC = 11027,
- WSA_QOS_EPSFILTERSPEC = 11028,
- WSA_QOS_ESDMODEOBJ = 11029,
- WSA_QOS_ESHAPERATEOBJ = 11030,
- WSA_QOS_RESERVED_PETYPE = 11031,
- ERROR_IPSEC_QM_POLICY_EXISTS = 13000,
- ERROR_IPSEC_QM_POLICY_NOT_FOUND = 13001,
- ERROR_IPSEC_QM_POLICY_IN_USE = 13002,
- ERROR_IPSEC_MM_POLICY_EXISTS = 13003,
- ERROR_IPSEC_MM_POLICY_NOT_FOUND = 13004,
- ERROR_IPSEC_MM_POLICY_IN_USE = 13005,
- ERROR_IPSEC_MM_FILTER_EXISTS = 13006,
- ERROR_IPSEC_MM_FILTER_NOT_FOUND = 13007,
- ERROR_IPSEC_TRANSPORT_FILTER_EXISTS = 13008,
- ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND = 13009,
- ERROR_IPSEC_MM_AUTH_EXISTS = 13010,
- ERROR_IPSEC_MM_AUTH_NOT_FOUND = 13011,
- ERROR_IPSEC_MM_AUTH_IN_USE = 13012,
- ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND = 13013,
- ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND = 13014,
- ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND = 13015,
- ERROR_IPSEC_TUNNEL_FILTER_EXISTS = 13016,
- ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND = 13017,
- ERROR_IPSEC_MM_FILTER_PENDING_DELETION = 13018,
- ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION = 13019,
- ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION = 13020,
- ERROR_IPSEC_MM_POLICY_PENDING_DELETION = 13021,
- ERROR_IPSEC_MM_AUTH_PENDING_DELETION = 13022,
- ERROR_IPSEC_QM_POLICY_PENDING_DELETION = 13023,
- ERROR_IPSEC_IKE_AUTH_FAIL = 13801,
- ERROR_IPSEC_IKE_ATTRIB_FAIL = 13802,
- ERROR_IPSEC_IKE_NEGOTIATION_PENDING = 13803,
- ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR = 13804,
- ERROR_IPSEC_IKE_TIMED_OUT = 13805,
- ERROR_IPSEC_IKE_NO_CERT = 13806,
- ERROR_IPSEC_IKE_SA_DELETED = 13807,
- ERROR_IPSEC_IKE_SA_REAPED = 13808,
- ERROR_IPSEC_IKE_MM_ACQUIRE_DROP = 13809,
- ERROR_IPSEC_IKE_QM_ACQUIRE_DROP = 13810,
- ERROR_IPSEC_IKE_QUEUE_DROP_MM = 13811,
- ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM = 13812,
- ERROR_IPSEC_IKE_DROP_NO_RESPONSE = 13813,
- ERROR_IPSEC_IKE_MM_DELAY_DROP = 13814,
- ERROR_IPSEC_IKE_QM_DELAY_DROP = 13815,
- ERROR_IPSEC_IKE_ERROR = 13816,
- ERROR_IPSEC_IKE_CRL_FAILED = 13817,
- ERROR_IPSEC_IKE_INVALID_KEY_USAGE = 13818,
- ERROR_IPSEC_IKE_INVALID_CERT_TYPE = 13819,
- ERROR_IPSEC_IKE_NO_PRIVATE_KEY = 13820,
- ERROR_IPSEC_IKE_DH_FAIL = 13822,
- ERROR_IPSEC_IKE_INVALID_HEADER = 13824,
- ERROR_IPSEC_IKE_NO_POLICY = 13825,
- ERROR_IPSEC_IKE_INVALID_SIGNATURE = 13826,
- ERROR_IPSEC_IKE_KERBEROS_ERROR = 13827,
- ERROR_IPSEC_IKE_NO_PUBLIC_KEY = 13828,
- ERROR_IPSEC_IKE_PROCESS_ERR = 13829,
- ERROR_IPSEC_IKE_PROCESS_ERR_SA = 13830,
- ERROR_IPSEC_IKE_PROCESS_ERR_PROP = 13831,
- ERROR_IPSEC_IKE_PROCESS_ERR_TRANS = 13832,
- ERROR_IPSEC_IKE_PROCESS_ERR_KE = 13833,
- ERROR_IPSEC_IKE_PROCESS_ERR_ID = 13834,
- ERROR_IPSEC_IKE_PROCESS_ERR_CERT = 13835,
- ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ = 13836,
- ERROR_IPSEC_IKE_PROCESS_ERR_HASH = 13837,
- ERROR_IPSEC_IKE_PROCESS_ERR_SIG = 13838,
- ERROR_IPSEC_IKE_PROCESS_ERR_NONCE = 13839,
- ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY = 13840,
- ERROR_IPSEC_IKE_PROCESS_ERR_DELETE = 13841,
- ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR = 13842,
- ERROR_IPSEC_IKE_INVALID_PAYLOAD = 13843,
- ERROR_IPSEC_IKE_LOAD_SOFT_SA = 13844,
- ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN = 13845,
- ERROR_IPSEC_IKE_INVALID_COOKIE = 13846,
- ERROR_IPSEC_IKE_NO_PEER_CERT = 13847,
- ERROR_IPSEC_IKE_PEER_CRL_FAILED = 13848,
- ERROR_IPSEC_IKE_POLICY_CHANGE = 13849,
- ERROR_IPSEC_IKE_NO_MM_POLICY = 13850,
- ERROR_IPSEC_IKE_NOTCBPRIV = 13851,
- ERROR_IPSEC_IKE_SECLOADFAIL = 13852,
- ERROR_IPSEC_IKE_FAILSSPINIT = 13853,
- ERROR_IPSEC_IKE_FAILQUERYSSP = 13854,
- ERROR_IPSEC_IKE_SRVACQFAIL = 13855,
- ERROR_IPSEC_IKE_SRVQUERYCRED = 13856,
- ERROR_IPSEC_IKE_GETSPIFAIL = 13857,
- ERROR_IPSEC_IKE_INVALID_FILTER = 13858,
- ERROR_IPSEC_IKE_OUT_OF_MEMORY = 13859,
- ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED = 13860,
- ERROR_IPSEC_IKE_INVALID_POLICY = 13861,
- ERROR_IPSEC_IKE_UNKNOWN_DOI = 13862,
- ERROR_IPSEC_IKE_INVALID_SITUATION = 13863,
- ERROR_IPSEC_IKE_DH_FAILURE = 13864,
- ERROR_IPSEC_IKE_INVALID_GROUP = 13865,
- ERROR_IPSEC_IKE_ENCRYPT = 13866,
- ERROR_IPSEC_IKE_DECRYPT = 13867,
- ERROR_IPSEC_IKE_POLICY_MATCH = 13868,
- ERROR_IPSEC_IKE_UNSUPPORTED_ID = 13869,
- ERROR_IPSEC_IKE_INVALID_HASH = 13870,
- ERROR_IPSEC_IKE_INVALID_HASH_ALG = 13871,
- ERROR_IPSEC_IKE_INVALID_HASH_SIZE = 13872,
- ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG = 13873,
- ERROR_IPSEC_IKE_INVALID_AUTH_ALG = 13874,
- ERROR_IPSEC_IKE_INVALID_SIG = 13875,
- ERROR_IPSEC_IKE_LOAD_FAILED = 13876,
- ERROR_IPSEC_IKE_RPC_DELETE = 13877,
- ERROR_IPSEC_IKE_BENIGN_REINIT = 13878,
- ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY = 13879,
- ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN = 13881,
- ERROR_IPSEC_IKE_MM_LIMIT = 13882,
- ERROR_IPSEC_IKE_NEGOTIATION_DISABLED = 13883,
- ERROR_IPSEC_IKE_NEG_STATUS_END = 13884,
- ERROR_SXS_SECTION_NOT_FOUND = 14000,
- ERROR_SXS_CANT_GEN_ACTCTX = 14001,
- ERROR_SXS_INVALID_ACTCTXDATA_FORMAT = 14002,
- ERROR_SXS_ASSEMBLY_NOT_FOUND = 14003,
- ERROR_SXS_MANIFEST_FORMAT_ERROR = 14004,
- ERROR_SXS_MANIFEST_PARSE_ERROR = 14005,
- ERROR_SXS_ACTIVATION_CONTEXT_DISABLED = 14006,
- ERROR_SXS_KEY_NOT_FOUND = 14007,
- ERROR_SXS_VERSION_CONFLICT = 14008,
- ERROR_SXS_WRONG_SECTION_TYPE = 14009,
- ERROR_SXS_THREAD_QUERIES_DISABLED = 14010,
- ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET = 14011,
- ERROR_SXS_UNKNOWN_ENCODING_GROUP = 14012,
- ERROR_SXS_UNKNOWN_ENCODING = 14013,
- ERROR_SXS_INVALID_XML_NAMESPACE_URI = 14014,
- ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED = 14015,
- ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED = 14016,
- ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE = 14017,
- ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE = 14018,
- ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE = 14019,
- ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT = 14020,
- ERROR_SXS_DUPLICATE_DLL_NAME = 14021,
- ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME = 14022,
- ERROR_SXS_DUPLICATE_CLSID = 14023,
- ERROR_SXS_DUPLICATE_IID = 14024,
- ERROR_SXS_DUPLICATE_TLBID = 14025,
- ERROR_SXS_DUPLICATE_PROGID = 14026,
- ERROR_SXS_DUPLICATE_ASSEMBLY_NAME = 14027,
- ERROR_SXS_FILE_HASH_MISMATCH = 14028,
- ERROR_SXS_POLICY_PARSE_ERROR = 14029,
- ERROR_SXS_XML_E_MISSINGQUOTE = 14030,
- ERROR_SXS_XML_E_COMMENTSYNTAX = 14031,
- ERROR_SXS_XML_E_BADSTARTNAMECHAR = 14032,
- ERROR_SXS_XML_E_BADNAMECHAR = 14033,
- ERROR_SXS_XML_E_BADCHARINSTRING = 14034,
- ERROR_SXS_XML_E_XMLDECLSYNTAX = 14035,
- ERROR_SXS_XML_E_BADCHARDATA = 14036,
- ERROR_SXS_XML_E_MISSINGWHITESPACE = 14037,
- ERROR_SXS_XML_E_EXPECTINGTAGEND = 14038,
- ERROR_SXS_XML_E_MISSINGSEMICOLON = 14039,
- ERROR_SXS_XML_E_UNBALANCEDPAREN = 14040,
- ERROR_SXS_XML_E_INTERNALERROR = 14041,
- ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE = 14042,
- ERROR_SXS_XML_E_INCOMPLETE_ENCODING = 14043,
- ERROR_SXS_XML_E_MISSING_PAREN = 14044,
- ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE = 14045,
- ERROR_SXS_XML_E_MULTIPLE_COLONS = 14046,
- ERROR_SXS_XML_E_INVALID_DECIMAL = 14047,
- ERROR_SXS_XML_E_INVALID_HEXIDECIMAL = 14048,
- ERROR_SXS_XML_E_INVALID_UNICODE = 14049,
- ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK = 14050,
- ERROR_SXS_XML_E_UNEXPECTEDENDTAG = 14051,
- ERROR_SXS_XML_E_UNCLOSEDTAG = 14052,
- ERROR_SXS_XML_E_DUPLICATEATTRIBUTE = 14053,
- ERROR_SXS_XML_E_MULTIPLEROOTS = 14054,
- ERROR_SXS_XML_E_INVALIDATROOTLEVEL = 14055,
- ERROR_SXS_XML_E_BADXMLDECL = 14056,
- ERROR_SXS_XML_E_MISSINGROOT = 14057,
- ERROR_SXS_XML_E_UNEXPECTEDEOF = 14058,
- ERROR_SXS_XML_E_BADPEREFINSUBSET = 14059,
- ERROR_SXS_XML_E_UNCLOSEDSTARTTAG = 14060,
- ERROR_SXS_XML_E_UNCLOSEDENDTAG = 14061,
- ERROR_SXS_XML_E_UNCLOSEDSTRING = 14062,
- ERROR_SXS_XML_E_UNCLOSEDCOMMENT = 14063,
- ERROR_SXS_XML_E_UNCLOSEDDECL = 14064,
- ERROR_SXS_XML_E_UNCLOSEDCDATA = 14065,
- ERROR_SXS_XML_E_RESERVEDNAMESPACE = 14066,
- ERROR_SXS_XML_E_INVALIDENCODING = 14067,
- ERROR_SXS_XML_E_INVALIDSWITCH = 14068,
- ERROR_SXS_XML_E_BADXMLCASE = 14069,
- ERROR_SXS_XML_E_INVALID_STANDALONE = 14070,
- ERROR_SXS_XML_E_UNEXPECTED_STANDALONE = 14071,
- ERROR_SXS_XML_E_INVALID_VERSION = 14072,
- ERROR_SXS_XML_E_MISSINGEQUALS = 14073,
- ERROR_SXS_PROTECTION_RECOVERY_FAILED = 14074,
- ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT = 14075,
- ERROR_SXS_PROTECTION_CATALOG_NOT_VALID = 14076,
- ERROR_SXS_UNTRANSLATABLE_HRESULT = 14077,
- ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING = 14078,
- ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE = 14079,
- ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME = 14080
- }
-}
diff --git a/mcs/class/corlib/System.IO/MonoIOStat.cs b/mcs/class/corlib/System.IO/MonoIOStat.cs
deleted file mode 100644
index caf4ccc6e5c..00000000000
--- a/mcs/class/corlib/System.IO/MonoIOStat.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.IO.MonoIOStat.cs: Idealized structure for file information.
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System;
-
-namespace System.IO
-{
- internal struct MonoIOStat {
- public string Name;
- public FileAttributes Attributes;
- public long Length;
- public long CreationTime;
- public long LastAccessTime;
- public long LastWriteTime;
- }
-}
diff --git a/mcs/class/corlib/System.IO/Path.cs b/mcs/class/corlib/System.IO/Path.cs
deleted file mode 100644
index fa5110f10c8..00000000000
--- a/mcs/class/corlib/System.IO/Path.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IO.Path.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Dan Lewis (dihlewis@yahoo.co.uk)
-// Created: Saturday, August 11, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System.IO
-{
- public sealed class Path
- {
- public static readonly char AltDirectorySeparatorChar;
- public static readonly char DirectorySeparatorChar;
- public static readonly char[] InvalidPathChars;
- public static readonly char PathSeparator;
- internal static readonly string DirectorySeparatorStr;
- public static readonly char VolumeSeparatorChar;
-
- private static readonly char[] PathSeparatorChars;
-
- private Path () {}
-
- // class methods
- public static string ChangeExtension (string path, string extension)
- {
- if (path == null)
- {
- return null;
- }
-
- int iExt = findExtension (path);
-
- if (extension != null) {
- if (extension [0] != '.')
- extension = "." + extension;
- } else
- extension = "";
-
- if (iExt < 0) {
- return path + extension;
- } else if (iExt > 0) {
- string temp = path.Substring (0, iExt);
- return temp + extension;
- }
-
- return extension;
- }
-
- [MonoTODO]
- public static string Combine (string path1, string path2)
- {
- if (path1 == null || path2 == null)
- {
- return null;
- }
-
- CheckArgument.Empty (path2);
-
- // TODO: Check for invalid DirectoryInfo characters
- // although I don't think it is necesary for linux
-
- // TODO: Verify functionality further after NUnit tests written
- // since the documentation was rather sketchy
-
- if (IsPathRooted (path2))
- {
- if (path1.Equals (string.Empty))
- {
- return path2;
- }
- throw new ArgumentException ("Rooted path");
- }
-
- string dirSep = new string (DirectorySeparatorChar, 1);
- string altSep = new string (AltDirectorySeparatorChar, 1);
-
- bool b1 = path1.EndsWith (dirSep) || path1.EndsWith (dirSep);
- bool b2 = path2.StartsWith (dirSep) || path2.StartsWith (altSep);
- if (b1 && b2)
- {
- throw new ArgumentException ("Invalid combination");
- }
-
- if (!b1 && !b2)
- {
- return path1 + dirSep + path2;
- }
-
- return path1 + path2;
- }
-
- public static string GetDirectoryName (string path)
- {
- if (path != null)
- {
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
- CheckArgument.PathChars (path);
-
- if (path.Length > 2)
- {
- int nLast = path.LastIndexOfAny (PathSeparatorChars);
-
- if (nLast > 0)
- return path.Substring (0, nLast);
- else
- return String.Empty;
- }
- }
- return path;
- }
-
- public static string GetExtension (string path)
- {
- if (path == null)
- {
- return string.Empty;
- }
-
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
-
- int iExt = findExtension (path);
- int iLastSep = path.LastIndexOfAny ( PathSeparatorChars );
-
- if (iExt > -1)
- { // okay it has an extension
- return path.Substring (iExt);
- }
- return string.Empty;
- }
-
- public static string GetFileName (string path)
- {
- if (path == null)
- {
- return string.Empty;
- }
-
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
-
- int nLast = path.LastIndexOfAny (PathSeparatorChars);
-
- if (nLast > 0)
- {
- return path.Substring (nLast + 1);
- }
-
- return nLast == 0 ? null : path;
- }
-
- public static string GetFileNameWithoutExtension (string path)
- {
- return ChangeExtension (GetFileName (path), null);
- }
-
- public static string GetFullPath (string path)
- {
- if (path == null)
- throw (new ArgumentNullException (
- "path",
- "You must specify a path when calling System.IO.Path.GetFullPath"));
-
- if (path.StartsWith (new string (DirectorySeparatorChar, 1)) ||
- path.StartsWith (new string (AltDirectorySeparatorChar, 1)))
- return path;
-
- return Directory.GetCurrentDirectory () + new string (DirectorySeparatorChar, 1) + path;
- }
-
- public static string GetPathRoot (string path)
- {
- if (path != null ||
- (path.StartsWith (new string (DirectorySeparatorChar, 1)) ||
- path.StartsWith (new string (AltDirectorySeparatorChar, 1))))
- {
- return path.Substring (0, 1);
- }
- return null;
- }
-
- public static string GetTempFileName ()
- {
- string path;
- Random rnd;
- int num;
- rnd = new Random ();
- num = rnd.Next ();
- path = GetTempPath() + DirectorySeparatorChar + "tmp" + num.ToString("x");
- while (File.Exists(path) || Directory.Exists(path)) {
- num = rnd.Next ();
- path = GetTempPath() + DirectorySeparatorChar + "tmp" + num.ToString("x");
- }
- FileStream f = File.Create(path);
- f.Close();
- return path;
- }
-
- /// <summary>
- /// Returns the path of the current systems temp directory
- /// </summary>
- [MonoTODO]
- public static string GetTempPath ()
- { // TODO: This might vary with distribution and there
- // might be an api to provide it. Research is needed
- return "/tmp";
- }
-
- public static bool HasExtension (string path)
- {
- CheckArgument.Null (path);
- CheckArgument.Empty (path);
- CheckArgument.WhitespaceOnly (path);
-
- return findExtension (path) > -1;
- }
-
- public static bool IsPathRooted (string path)
- {
- return path.StartsWith (new string (VolumeSeparatorChar,1));
- }
-
- // private class methods
-
- private static int findExtension (string path)
- {
- // method should return the index of the path extension
- // start or -1 if no valid extension
- if (path != null){
- int iLastDot = path.LastIndexOf (".");
- int iLastSep = path.LastIndexOfAny ( PathSeparatorChars );
-
- if (iLastDot > iLastSep)
- return iLastDot;
- }
- return -1;
- }
-
- static Path () {
- VolumeSeparatorChar = MonoIO.VolumeSeparatorChar;
- DirectorySeparatorChar = MonoIO.DirectorySeparatorChar;
- AltDirectorySeparatorChar = MonoIO.AltDirectorySeparatorChar;
-
- PathSeparator = MonoIO.PathSeparator;
- InvalidPathChars = MonoIO.InvalidPathChars;
-
- // internal fields
-
- DirectorySeparatorStr = DirectorySeparatorChar.ToString ();
- PathSeparatorChars = new char [] {
- DirectorySeparatorChar,
- AltDirectorySeparatorChar,
- VolumeSeparatorChar
- };
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/PathTooLongException.cs b/mcs/class/corlib/System.IO/PathTooLongException.cs
deleted file mode 100644
index 5f5f5229a18..00000000000
--- a/mcs/class/corlib/System.IO/PathTooLongException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.IO.PathTooLongException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.IO;
-using System.Runtime.Serialization;
-
-namespace System.IO
-{
- [Serializable]
- 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)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/SearchPattern.cs b/mcs/class/corlib/System.IO/SearchPattern.cs
deleted file mode 100644
index 4db60d2fadc..00000000000
--- a/mcs/class/corlib/System.IO/SearchPattern.cs
+++ /dev/null
@@ -1,169 +0,0 @@
-//
-// System.IO.SearchPattern.cs: Filename glob support.
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System;
-
-namespace System.IO {
-
- // FIXME: there's a complication with this algorithm under windows.
- // the pattern '*.*' matches all files (i think . matches the extension),
- // whereas under UNIX it should only match files containing the '.' character.
-
- class SearchPattern {
- public SearchPattern (string pattern) : this (pattern, false) { }
-
- public SearchPattern (string pattern, bool ignore)
- {
- this.ignore = ignore;
- Compile (pattern);
- }
-
- public bool IsMatch (string text)
- {
- return Match (ops, text, 0);
- }
-
- // private
-
- private Op ops; // the compiled pattern
- private bool ignore; // ignore case
-
- private void Compile (string pattern)
- {
- if (pattern == null || pattern.IndexOfAny (InvalidChars) >= 0)
- throw new ArgumentException ("Invalid search pattern.");
-
- if (pattern == "*") { // common case
- ops = new Op (OpCode.True);
- return;
- }
-
- ops = null;
-
- int ptr = 0;
- Op last_op = null;
- while (ptr < pattern.Length) {
- Op op;
-
- switch (pattern [ptr]) {
- case '?':
- op = new Op (OpCode.AnyChar);
- ++ ptr;
- break;
-
- case '*':
- op = new Op (OpCode.AnyString);
- ++ ptr;
- break;
-
- default:
- op = new Op (OpCode.ExactString);
- int end = pattern.IndexOfAny (WildcardChars, ptr);
- if (end < 0)
- end = pattern.Length;
-
- op.Argument = pattern.Substring (ptr, end - ptr);
- if (ignore)
- op.Argument = op.Argument.ToLower ();
-
- ptr = end;
- break;
- }
-
- if (last_op == null)
- ops = op;
- else
- last_op.Next = op;
-
- last_op = op;
- }
-
- if (last_op == null)
- ops = new Op (OpCode.End);
- else
- last_op.Next = new Op (OpCode.End);
- }
-
- private bool Match (Op op, string text, int ptr)
- {
- while (op != null) {
- switch (op.Code) {
- case OpCode.True:
- return true;
-
- case OpCode.End:
- if (ptr == text.Length)
- return true;
-
- return false;
-
- case OpCode.ExactString:
- int length = op.Argument.Length;
- if (ptr + length > text.Length)
- return false;
-
- string str = text.Substring (ptr, length);
- if (ignore)
- str = str.ToLower ();
-
- if (str != op.Argument)
- return false;
-
- ptr += length;
- break;
-
- case OpCode.AnyChar:
- if (++ ptr > text.Length)
- return false;
- break;
-
- case OpCode.AnyString:
- while (ptr <= text.Length) {
- if (Match (op.Next, text, ptr))
- return true;
-
- ++ ptr;
- }
-
- return false;
- }
-
- op = op.Next;
- }
-
- return true;
- }
-
- // private static
-
- private static readonly char [] WildcardChars = { '*', '?' };
- private static readonly char [] InvalidChars = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
-
- private class Op {
- public Op (OpCode code)
- {
- this.Code = code;
- this.Argument = null;
- this.Next = null;
- }
-
- public OpCode Code;
- public string Argument;
- public Op Next;
- }
-
- private enum OpCode {
- ExactString, // literal
- AnyChar, // ?
- AnyString, // *
- End, // end of pattern
- True // always succeeds
- };
- }
-}
diff --git a/mcs/class/corlib/System.IO/SeekOrigin.cs b/mcs/class/corlib/System.IO/SeekOrigin.cs
deleted file mode 100644
index 1cd2cf84165..00000000000
--- a/mcs/class/corlib/System.IO/SeekOrigin.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// SeekOrigin.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:32 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.IO {
-
-
- /// <summary>
- /// </summary>
- [Serializable]
- public enum SeekOrigin : int {
-
- /// <summary>
- /// </summary>
- Begin = 0,
-
- /// <summary>
- /// </summary>
- Current = 1,
-
- /// <summary>
- /// </summary>
- End = 2,
- } // SeekOrigin
-
-} // System.IO
diff --git a/mcs/class/corlib/System.IO/Stream.cs b/mcs/class/corlib/System.IO/Stream.cs
deleted file mode 100755
index 244585e8e96..00000000000
--- a/mcs/class/corlib/System.IO/Stream.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-//
-// System.IO/Stream.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001, 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Threading;
-
-namespace System.IO
-{
- [Serializable]
- public abstract class Stream : MarshalByRefObject, IDisposable
- {
- public static readonly Stream Null;
-
- static Stream ()
- {
- Null = new NullStream ();
- }
-
- protected Stream ()
- {
- }
-
- public abstract bool CanRead
- {
- get;
- }
-
- public abstract bool CanSeek
- {
- get;
- }
-
- public abstract bool CanWrite
- {
- get;
- }
-
- public abstract long Length
- {
- get;
- }
-
- public abstract long Position
- {
- get;
- set;
- }
-
-
- public virtual void Close ()
- {
- Flush ();
- }
-
- void IDisposable.Dispose ()
- {
- Close ();
- }
-
- protected virtual WaitHandle CreateWaitHandle()
- {
- return new ManualResetEvent (false);
- }
-
- public abstract void Flush ();
-
- public abstract int Read (byte[] buffer,
- int offset,
- int count);
-
- public virtual int ReadByte ()
- {
- byte[] buffer = new byte [1];
-
- if (Read (buffer, 0, 1) == 1)
- return buffer [0];
-
- return -1;
- }
-
- public abstract long Seek (long offset,
- SeekOrigin origin);
-
- public abstract void SetLength (long value);
-
- public abstract void Write (byte[] buffer,
- int offset,
- int count);
-
- public virtual void WriteByte (byte value)
- {
- byte[] buffer = new byte [1];
-
- buffer [0] = value;
-
- Write (buffer, 0, 1);
- }
-
- delegate int ReadDelegate (byte [] buffer, int offset, int count);
-
- public virtual IAsyncResult
- BeginRead (byte [] buffer, int offset, int count, AsyncCallback cback, object state)
- {
- if (!CanRead)
- throw new NotSupportedException ("This stream does not support reading");
-
- SyncReadResult srr = new SyncReadResult (state);
- try
- {
- srr.Complete (Read (buffer, offset, count));
- }
- catch (IOException e)
- {
- srr._exception = e;
- }
-
- if (cback != null)
- cback (srr);
-
- return srr;
- }
-
- public virtual IAsyncResult
- BeginWrite (byte [] buffer, int offset, int count, AsyncCallback cback, object state)
- {
- if (!CanWrite)
- throw new NotSupportedException ("This stream does not support reading");
-
- SyncWriteResult swr = new SyncWriteResult (state);
- try
- {
- Write (buffer, offset, count);
- swr.Complete ();
- }
- catch (IOException e)
- {
- swr._exception = e;
- }
-
- if (cback != null)
- cback (swr);
-
- return swr;
- }
-
- public virtual int EndRead (IAsyncResult async_result)
- {
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
- SyncReadResult srr = async_result as SyncReadResult;
- if (srr == null)
- throw new ArgumentException ("async_result is invalid");
- if (srr._fEndCalled)
- throw new InvalidOperationException ("EndRead called twice");
- srr._fEndCalled = true;
- if (srr._exception != null)
- throw srr._exception;
- return srr._cbRead;
- }
-
- public virtual void EndWrite (IAsyncResult async_result)
- {
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
- SyncWriteResult swr = async_result as SyncWriteResult;
- if (swr == null)
- throw new ArgumentException ("async_result is invalid");
- if (swr._fEndCalled)
- throw new InvalidOperationException ("EndRead called twice");
- swr._fEndCalled = true;
- if (swr._exception != null)
- throw swr._exception;
- }
-
- // this class implements the synchronous IASyncResult for the obove methods
- private class SyncResult : IAsyncResult
- {
- object _objState; // client-supplied state
- bool _fComplete; // if the IO operation completed successfully
- ManualResetEvent _hWait; // the wait event
- public bool _fEndCalled; // true iff the End method was called already
- public Exception _exception; // holds any exception throw during IO operation
-
- public SyncResult (object objState)
- {
- _objState = objState;
- _hWait = new ManualResetEvent (false);
- }
-
- public void Complete ()
- {
- _fComplete = true;
- _hWait.Set ();
- }
-
- // IAsyncResult members
- object IAsyncResult.AsyncState
- {
- get { return _objState; }
- }
-
- WaitHandle IAsyncResult.AsyncWaitHandle
- {
- get { return _hWait; }
- }
-
- bool IAsyncResult.CompletedSynchronously
- {
- get { return true; }
- }
-
- bool IAsyncResult.IsCompleted
- {
- get { return _fComplete; }
- }
- }
- private class SyncReadResult : SyncResult
- {
- public int _cbRead; // the number of bytes read
-
- public SyncReadResult (object objState) : base (objState) {}
-
- public void Complete (int cbRead)
- {
- _cbRead = cbRead;
- Complete ();
- }
- }
- private class SyncWriteResult : SyncResult
- {
- public SyncWriteResult (object objState) : base (objState) {}
- }
- }
-
- class NullStream : Stream
- {
- public override bool CanRead
- {
- get {
- return true;
- }
- }
-
- public override bool CanSeek
- {
- get {
- return true;
- }
- }
-
- public override bool CanWrite
- {
- get {
- return true;
- }
- }
-
- public override long Length
- {
- get {
- return 0;
- }
- }
-
- public override long Position
- {
- get {
- return 0;
- }
- set {
- }
- }
-
- public override void Flush ()
- {
- }
-
- public override int Read (byte[] buffer,
- int offset,
- int count)
- {
- return 0;
- }
-
- public override int ReadByte ()
- {
- return -1;
- }
-
- public override long Seek (long offset,
- SeekOrigin origin)
- {
- return 0;
- }
-
- public override void SetLength (long value)
- {
- }
-
- public override void Write (byte[] buffer,
- int offset,
- int count)
- {
- }
-
- public override void WriteByte (byte value)
- {
- }
- }
-}
-
-
-
-
-
-
-
diff --git a/mcs/class/corlib/System.IO/StreamReader.cs b/mcs/class/corlib/System.IO/StreamReader.cs
deleted file mode 100644
index 80c6fc9b83d..00000000000
--- a/mcs/class/corlib/System.IO/StreamReader.cs
+++ /dev/null
@@ -1,267 +0,0 @@
-//
-// System.IO.StreamReader.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Text;
-
-namespace System.IO {
- [Serializable]
- public class StreamReader : TextReader {
-
- private const int DefaultBufferSize = 1024;
- private const int DefaultFileBufferSize = 4096;
- private const int MinimumBufferSize = 128;
-
- // buffering members
- private byte [] rgbEncoded;
-// private int cbEncoded;
- private char [] rgchDecoded;
- private int cchDecoded;
-
- private int pos;
-
-
- private Encoding internalEncoding;
- private Decoder decoder;
-
- private Stream internalStream;
-
- [MonoTODO("Make Read methods return 0, etc.")]
- private class NullStreamReader : StreamReader {
- }
-
- public new static readonly StreamReader Null = (StreamReader)(new NullStreamReader());
-
- internal StreamReader() {}
-
- public StreamReader(Stream stream)
- : this (stream, null, false, DefaultBufferSize) { }
-
- public StreamReader(Stream stream, bool detectEncodingFromByteOrderMarks)
- : this (stream, null, detectEncodingFromByteOrderMarks, DefaultBufferSize) { }
-
- public StreamReader(Stream stream, Encoding encoding)
- : this (stream, encoding, false, DefaultBufferSize) { }
-
- public StreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks)
- : this (stream, encoding, detectEncodingFromByteOrderMarks, DefaultBufferSize) { }
-
- public StreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
- {
- Initialize (stream, encoding, detectEncodingFromByteOrderMarks, bufferSize);
- }
-
- public StreamReader(string path)
- : this (path, null, false, DefaultFileBufferSize) { }
-
- public StreamReader(string path, bool detectEncodingFromByteOrderMarks)
- : this (path, null, detectEncodingFromByteOrderMarks, DefaultFileBufferSize) { }
-
- public StreamReader(string path, Encoding encoding)
- : this (path, encoding, false, DefaultFileBufferSize) { }
-
- public StreamReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks)
- : this (path, encoding, detectEncodingFromByteOrderMarks, DefaultFileBufferSize) { }
-
- [MonoTODO]
- public StreamReader(string path, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
- {
- if (null == path)
- throw new ArgumentNullException();
- if (String.Empty == path)
- throw new ArgumentException();
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException("path contains invalid characters");
-
- string DirName = Path.GetDirectoryName(path);
- if (DirName != String.Empty && !Directory.Exists(DirName))
- throw new DirectoryNotFoundException();
- if (!File.Exists(path))
- throw new FileNotFoundException(path);
-
- Stream stream = (Stream) File.OpenRead (path);
- Initialize (stream, encoding, detectEncodingFromByteOrderMarks, bufferSize);
- }
-
- [MonoTODO]
- protected void Initialize (Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
- {
- if (null == stream)
- throw new ArgumentNullException();
- if (!stream.CanRead)
- throw new ArgumentException("Cannot read stream");
-
- internalStream = stream;
-
- // use detect encoding flag
- if (encoding == null) {
- internalEncoding = Encoding.UTF8;
- decoder = Encoding.UTF8.GetDecoder ();
- } else {
- internalEncoding = encoding;
- decoder = encoding.GetDecoder ();
- }
-
- if (bufferSize < MinimumBufferSize)
- bufferSize = MinimumBufferSize;
-
- rgbEncoded = new byte [bufferSize];
- rgchDecoded = new char [internalEncoding.GetMaxCharCount (bufferSize)];
- pos = 0;
- cchDecoded = 0;
- }
-
- public virtual Stream BaseStream
- {
- get {
- return internalStream;
- }
- }
-
- public virtual Encoding CurrentEncoding
- {
- get {
- return internalEncoding;
- }
- }
-
- public override void Close ()
- {
- Dispose (true);
- }
-
- public void DiscardBufferedData ()
- {
- pos = 0;
- cchDecoded = 0;
-
-/* I'm sure there's no need to do all this
- if ((cchDecoded == null) || (pos == cchDecoded.Length))
- return;
-
- if (!internalStream.CanSeek)
- return;
-
- int seek_back = pos - cchDecoded.Length;
- internalStream.Seek (seek_back, SeekOrigin.Current);
-*/
- }
-
-
- // the buffer is empty, fill it again
- [MonoTODO ("handle byte order marks here")]
- private int ReadBuffer ()
- {
- pos = 0;
- int cbEncoded = 0;
- cchDecoded = 0;
- do // keep looping until the decoder gives us some chars
- {
- cbEncoded = internalStream.Read (rgbEncoded, 0, rgbEncoded.Length);
- // TODO: remove this line when iconv is fixed
- int bufcnt = decoder.GetCharCount (rgbEncoded, 0, cbEncoded);
-
- if (cbEncoded == 0)
- return 0;
- // TODO: remove byte order marks here
- cchDecoded += decoder.GetChars (rgbEncoded, 0, cbEncoded, rgchDecoded, 0);
- } while (cchDecoded == 0);
-
- return cchDecoded;
- }
-
- public override int Peek ()
- {
- if (!internalStream.CanSeek)
- return -1;
-
- if (pos >= cchDecoded && ReadBuffer () == 0)
- return -1;
-
- return rgchDecoded [pos];
- }
-
- public override int Read ()
- {
- if (pos >= cchDecoded && ReadBuffer () == 0)
- return -1;
-
- return rgchDecoded [pos++];
- }
-
- public override int Read (char[] dest_buffer, int index, int count)
- {
- if (dest_buffer == null)
- throw new ArgumentException ();
-
- if ((index < 0) || (count < 0))
- throw new ArgumentOutOfRangeException ();
-
- if (index + count > dest_buffer.Length)
- throw new ArgumentException ();
-
- int cchRead = 0;
- while (count > 0)
- {
- if (pos >= cchDecoded && ReadBuffer () == 0)
- return cchRead > 0? cchRead: -1;
-
- int cch = Math.Min (cchDecoded - pos, count);
- Array.Copy (rgchDecoded, pos, dest_buffer, index, cch);
- pos += cch;
- index += cch;
- count -= cch;
- cchRead += cch;
- }
- return cchRead;
- }
-
- public override string ReadLine()
- {
- StringBuilder text = new StringBuilder ();
-
- while (true) {
- int c = Read ();
-
- if (c == -1) { // end of stream
- if (text.Length == 0)
- return null;
-
- break;
- }
-
- if (c == '\n') // newline
- break;
-
- if (c == '\r' && Peek () == '\n') { // cr, newline
- Read ();
- break;
- }
-
- text.Append ((char) c);
- }
-
- return text.ToString ();
- }
-
- public override string ReadToEnd()
- {
- StringBuilder text = new StringBuilder ();
-
- int c;
- while ((c = Read ()) != -1) {
- text.Append ((char) c);
- }
-
- if (text.Length == 0)
- return String.Empty;
- return text.ToString ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/StreamWriter.cs b/mcs/class/corlib/System.IO/StreamWriter.cs
deleted file mode 100644
index b4103e3b53f..00000000000
--- a/mcs/class/corlib/System.IO/StreamWriter.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// System.IO.StreamWriter.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Text;
-using System;
-
-namespace System.IO {
-
- [Serializable]
- public class StreamWriter : TextWriter {
-
- private Encoding internalEncoding;
-
- private Stream internalStream;
- private bool closed = false;
-
- private bool iflush;
-
- private const int DefaultBufferSize = 1024;
- private const int DefaultFileBufferSize = 4096;
- private const int MinimumBufferSize = 2;
-
- private int pos;
- private int BufferSize;
- private byte[] TheBuffer;
-
- private bool DisposedAlready = false;
-
- // new public static readonly StreamWriter Null;
-
- public StreamWriter (Stream stream)
- : this (stream, Encoding.UTF8, DefaultBufferSize) {}
-
- public StreamWriter (Stream stream, Encoding encoding)
- : this (stream, encoding, DefaultBufferSize) {}
-
- protected void Initialize(Encoding encoding, int bufferSize) {
- internalEncoding = encoding;
- pos = 0;
- BufferSize = Math.Max(bufferSize, MinimumBufferSize);
- TheBuffer = new byte[BufferSize];
- }
-
- //[MonoTODO("Nothing is done with bufferSize")]
- public StreamWriter (Stream stream, Encoding encoding, int bufferSize) {
- if (null == stream)
- throw new ArgumentNullException("stream");
- if (null == encoding)
- throw new ArgumentNullException("encoding");
- if (bufferSize < 0)
- throw new ArgumentOutOfRangeException("bufferSize");
- if (!stream.CanWrite)
- throw new ArgumentException("bufferSize");
-
- internalStream = stream;
-
- Initialize(encoding, bufferSize);
- }
-
- public StreamWriter (string path)
- : this (path, false, Encoding.UTF8, DefaultFileBufferSize) {}
-
- public StreamWriter (string path, bool append)
- : this (path, append, Encoding.UTF8, DefaultFileBufferSize) {}
-
- public StreamWriter (string path, bool append, Encoding encoding)
- : this (path, append, encoding, DefaultFileBufferSize) {}
-
- public StreamWriter (string path, bool append, Encoding encoding, int bufferSize) {
- if (null == path)
- throw new ArgumentNullException("path");
- if (String.Empty == path)
- throw new ArgumentException("path cannot be empty string");
- if (path.IndexOfAny (Path.InvalidPathChars) != -1)
- throw new ArgumentException("path contains invalid characters");
-
- if (null == encoding)
- throw new ArgumentNullException("encoding");
- if (bufferSize < 0)
- throw new ArgumentOutOfRangeException("bufferSize");
-
- string DirName = Path.GetDirectoryName(path);
- if (DirName != String.Empty && !Directory.Exists(DirName))
- throw new DirectoryNotFoundException();
-
- FileMode mode;
-
- if (append)
- mode = FileMode.Append;
- else
- mode = FileMode.Create;
-
- internalStream = new FileStream (path, mode, FileAccess.Write);
-
- if (append)
- internalStream.Position = internalStream.Length;
- else
- internalStream.SetLength (0);
-
- Initialize(encoding, bufferSize);
- }
-
- public virtual bool AutoFlush {
- get {
- return iflush;
- }
- set {
- iflush = value;
- }
- }
-
- public virtual Stream BaseStream {
- get {
- return internalStream;
- }
- }
-
- public override Encoding Encoding {
- get {
- return internalEncoding;
- }
- }
-
- public void Dispose() {
- Dispose(true);
- // Take yourself off of the Finalization queue
- // to prevent finalization code for this object
- // from executing a second time.
- GC.SuppressFinalize(this);
- }
-
- protected override void Dispose (bool disposing) {
- if (!DisposedAlready && disposing && internalStream != null) {
- Flush();
- internalStream.Close ();
- internalStream = null;
- TheBuffer = null;
- }
- DisposedAlready = true;
- }
-
- public override void Flush () {
- if (DisposedAlready)
- throw new ObjectDisposedException("StreamWriter");
-
- if (pos > 0) {
- internalStream.Write (TheBuffer, 0, pos);
- internalStream.Flush ();
- pos = 0;
- }
- }
-
- public override void Write (char[] buffer, int index, int count) {
- if (DisposedAlready)
- throw new ObjectDisposedException("StreamWriter");
-
- byte[] res = new byte [internalEncoding.GetMaxByteCount (buffer.Length)];
- int len;
- int BytesToBuffer;
- int resPos = 0;
-
- len = internalEncoding.GetBytes (buffer, index, count, res, 0);
-
- // if they want AutoFlush, don't bother buffering
- if (iflush) {
- Flush();
- internalStream.Write (res, 0, len);
- internalStream.Flush ();
- } else {
- // otherwise use the buffer.
- // NOTE: this logic is not optimized for performance.
- while (resPos < len) {
- // fill the buffer if we've got more bytes than will fit
- BytesToBuffer = Math.Min(BufferSize - pos, len - resPos);
- Array.Copy(res, resPos, TheBuffer, pos, BytesToBuffer);
- resPos += BytesToBuffer;
- pos += BytesToBuffer;
- // if the buffer is full, flush it out.
- if (pos == BufferSize) Flush();
- }
- }
- }
-
- public override void Write(string value) {
- if (DisposedAlready)
- throw new ObjectDisposedException("StreamWriter");
-
- if (value != null)
- Write (value.ToCharArray (), 0, value.Length);
- }
-
- public override void Close() {
- Dispose();
- }
-
- ~StreamWriter() {
- Dispose(false);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.IO/StringReader.cs b/mcs/class/corlib/System.IO/StringReader.cs
deleted file mode 100644
index faa665ec009..00000000000
--- a/mcs/class/corlib/System.IO/StringReader.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// System.IO.StringReader
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-
-
-using System;
-
-namespace System.IO {
- [Serializable]
- public class StringReader : TextReader {
-
- private string source;
- private char[] sourceChars;
-
- private int nextChar;
- private int sourceLength;
-
- public StringReader( string s ) {
- this.source = s;
- nextChar = 0;
- sourceLength = s.Length;
- sourceChars = s.ToCharArray();
- }
-
- public override void Close() {
- Dispose( true );
- }
-
- protected override void Dispose( bool disposing ) {
- return;
- }
-
- public override int Peek() {
- if( nextChar >= sourceLength ) {
- return -1;
- } else {
- return (int)source[ nextChar ];
- }
- }
-
- public override int Read() {
- if( nextChar >= sourceLength ) {
- return -1;
- } else {
- return (int)source[ nextChar++ ];
- }
- }
-
-
- // The method will read up to count characters from the StringReader
- // into the buffer character array starting at position index. Returns
- // the actual number of characters read, or zero if the end of the string
- // has been reached and no characters are read.
-
- public override int Read( char[] buffer, int index, int count ) {
-
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( buffer.Length - index < count ) {
- throw new ArgumentException();
- } else if( index < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- int charsToRead;
-
- if( nextChar + count > sourceLength ) {
- charsToRead = sourceLength - nextChar;
- } else {
- charsToRead = count;
- }
-
- Array.Copy(sourceChars, nextChar, buffer, index, charsToRead );
-
- nextChar += count;
-
- return charsToRead;
- }
-
- public override string ReadLine() {
- // Reads until next \r or \n or \r\n, otherwise return null
-
- // LAMESPEC:
- // The Beta 2 SDK help says that the ReadLine method returns
- // "The next line from the input stream [...] A line is defined as a sequence of
- // characters followed by a carriage return (\r), a line feed (\n), or a carriage
- // return immediately followed by a line feed (\r\n). [...]
- // The returned value is a null reference if the end of the input stream has been reached."
- //
- // HOWEVER, the MS implementation returns the rest of the string if no \r and/or \n is found
- // in the string
-
- if (nextChar == source.Length)
- return null;
-
- int nextCR = source.IndexOf( '\r', nextChar );
- int nextLF = source.IndexOf( '\n', nextChar );
-
- if( nextCR == -1 && nextLF == -1 ) {
- return ReadToEnd();
- }
-
- int readTo;
-
- if( nextCR == -1 ) {
- readTo = nextLF;
- } else {
- readTo = nextCR;
- }
-
- string nextLine = source.Substring( nextChar, readTo - nextChar );
-
- if( nextLF == nextCR + 1 ) {
- nextChar = readTo + 2;
- } else {
- nextChar = readTo + 1;
- }
-
- return nextLine;
- }
-
- public override string ReadToEnd() {
- string toEnd = source.Substring( nextChar, sourceLength - nextChar );
- nextChar = sourceLength;
- return toEnd;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.IO/StringWriter.cs b/mcs/class/corlib/System.IO/StringWriter.cs
deleted file mode 100644
index bb1d7cbceed..00000000000
--- a/mcs/class/corlib/System.IO/StringWriter.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-
-using System.Text;
-
-namespace System.IO {
- [Serializable]
- public class StringWriter : TextWriter {
-
- private StringBuilder internalString;
-
- public StringWriter() {
- internalString = new StringBuilder();
- }
-
- public StringWriter( IFormatProvider formatProvider ) {
- internalFormatProvider = formatProvider;
- }
-
- public StringWriter( StringBuilder sb ) {
- internalString = sb;
- }
-
- public StringWriter( StringBuilder sb, IFormatProvider formatProvider ) {
- internalString = sb;
- internalFormatProvider = formatProvider;
- }
-
- public override System.Text.Encoding Encoding {
- get {
- // TODO: Implement
- return null;
- }
- }
-
- public override void Close() {
- Dispose( true );
- }
-
- protected override void Dispose( bool disposing ) { }
-
- public virtual StringBuilder GetStringBuilder() {
- return internalString;
- }
-
- public override string ToString() {
- return internalString.ToString();
- }
-
- public override void Write( char value ) {
- internalString.Append( value );
- }
-
- public override void Write( string value ) {
- internalString.Append( value );
- }
-
- public override void Write( char[] buffer, int index, int count ) {
- if( buffer == null ) {
- throw new ArgumentNullException();
- } else if( index < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- } else if( index > buffer.Length || index + count > buffer.Length ) {
- throw new ArgumentException();
- }
-
- char[] writeBuffer = new char[ count ];
-
- Array.Copy( buffer, index, writeBuffer, 0, count );
-
- internalString.Append( writeBuffer );
- }
-
- }
-}
-
-
diff --git a/mcs/class/corlib/System.IO/TextReader.cs b/mcs/class/corlib/System.IO/TextReader.cs
deleted file mode 100644
index 25251b8229c..00000000000
--- a/mcs/class/corlib/System.IO/TextReader.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.IO.TextReader
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Implement the Thread Safe stuff
-//
-
-using System;
-
-namespace System.IO {
-
- [MonoTODO] [Serializable]
- public abstract class TextReader : MarshalByRefObject, IDisposable {
-
- protected TextReader() { }
-
- public static readonly TextReader Null;
-
- public virtual void Close()
- {
- Dispose(true);
- }
-
- void System.IDisposable.Dispose()
- {
- Dispose(true);
- }
-
- protected virtual void Dispose( bool disposing )
- {
- return;
- }
-
- public virtual int Peek()
- {
- return -1;
- }
-
- public virtual int Read()
- {
- return -1;
- }
-
- // LAMESPEC: The Beta2 docs say this should be Read( out char[] ...
- // whereas the MS implementation is just Read( char[] ... )
- // Not sure which one is right, we'll see in Beta3 :)
-
- public virtual int Read (char[] buffer, int index, int count)
- {
- int c, i;
-
- for (i = 0; i < count; i++) {
- if ((c = Read ()) == -1)
- return i;
- buffer [index + i] = (char)c;
- }
-
- return i;
- }
-
- public virtual int ReadBlock( char[] buffer, int index, int count )
- {
- return 0;
- }
-
- public virtual string ReadLine()
- {
- return String.Empty;
- }
-
- public virtual string ReadToEnd()
- {
- return String.Empty;
- }
-
- [MonoTODO]
- public static TextReader Synchronized( TextReader reader )
- {
- // TODO: Implement
- return Null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.IO/TextWriter.cs b/mcs/class/corlib/System.IO/TextWriter.cs
deleted file mode 100644
index 1be3b382822..00000000000
--- a/mcs/class/corlib/System.IO/TextWriter.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-// System.IO.TextWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Implement the Thread Safe stuff
-
-namespace System.IO {
-
- [MonoTODO] [Serializable]
- public abstract class TextWriter : MarshalByRefObject, IDisposable {
-
- protected TextWriter() {
- CoreNewLine = "\n".ToCharArray ();
- }
-
- protected TextWriter( IFormatProvider formatProvider ) {
- internalFormatProvider = formatProvider;
- }
-
- protected char[] CoreNewLine;
-
- internal IFormatProvider internalFormatProvider;
-
- public static readonly TextWriter Null;
-
- public abstract System.Text.Encoding Encoding { get; }
-
- public virtual IFormatProvider FormatProvider {
- get {
- return internalFormatProvider;
- }
- }
-
- public virtual string NewLine {
- get {
- return new String(CoreNewLine);
- }
-
- set {
- CoreNewLine = value.ToCharArray();
- }
- }
-
- public virtual void Close () {
- Dispose (true);
- }
-
- protected virtual void Dispose (bool disposing) { }
-
- void System.IDisposable.Dispose () {
- Dispose (true);
- }
-
-
- public virtual void Flush()
- {
- // do nothing
- }
-
- [MonoTODO]
- public static TextWriter Synchronized (TextWriter writer)
- {
- // TODO: Implement.
-
- return Null;
- }
-
- public virtual void Write (bool value)
- {
- Write (value.ToString ());
- }
-
- public virtual void Write (char value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (char[] value)
- {
- Write (new String (value));
- }
-
- public virtual void Write (decimal value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (double value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (int value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (long value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (object value)
- {
- Write (value != null ? value.ToString () : String.Empty);
- }
-
- public virtual void Write (float value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (string value)
- {
- // do nothing
- }
-
- [CLSCompliant(false)]
- public virtual void Write (uint value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- [CLSCompliant(false)]
- public virtual void Write (ulong value)
- {
- Write (value.ToString (internalFormatProvider));
- }
-
- public virtual void Write (string format, object arg0)
- {
- Write (String.Format (format, arg0));
- }
-
- public virtual void Write (string format, params object[] arg)
- {
- Write (String.Format (format, arg));
- }
-
- public virtual void Write (char[] buffer, int index, int count)
- {
- Write (new String (buffer, index, count));
- }
-
- public virtual void Write (string format, object arg0, object arg1)
- {
- Write (String.Format (format, arg0, arg1));
- }
-
- public virtual void Write (string format, object arg0, object arg1, object arg2 )
- {
- Write (String.Format (format, arg0, arg1, arg2));
- }
-
- public virtual void WriteLine ()
- {
- Write (NewLine);
- }
-
- public virtual void WriteLine (bool value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (char value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (char[] value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (decimal value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (double value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (int value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (long value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (object value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (float value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (string value)
- {
- Write (value);
- WriteLine();
- }
-
- [CLSCompliant(false)]
- public virtual void WriteLine (uint value)
- {
- Write (value);
- WriteLine();
- }
-
- [CLSCompliant(false)]
- public virtual void WriteLine (ulong value)
- {
- Write (value);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, object arg0)
- {
- Write (format, arg0);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, params object[] arg)
- {
- Write (format, arg);
- WriteLine();
- }
-
- public virtual void WriteLine (char[] buffer, int index, int count)
- {
- Write (buffer, index, count);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, object arg0, object arg1)
- {
- Write (format, arg0, arg1);
- WriteLine();
- }
-
- public virtual void WriteLine (string format, object arg0, object arg1, object arg2)
- {
- Write (format, arg0, arg1, arg2);
- WriteLine();
- }
-
- }
-}
-
-
-
-
-
diff --git a/mcs/class/corlib/System.PAL/IOperatingSystem.cs b/mcs/class/corlib/System.PAL/IOperatingSystem.cs
deleted file mode 100644
index 15c57faae36..00000000000
--- a/mcs/class/corlib/System.PAL/IOperatingSystem.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-/*---------------------------------------------------------------------
-
- XX X XXX
- XX XX
- XXX XX XXX XXXXX XX
- XX XXX XX XX XX
- XX XX XX XX XXXXX XX
- XX XX XX XX XX XX X XX
- XXXX XX XX XXX XXXXXXX XXXX
- XX
- XXXXX
-
-Copyright (c) 2001 Intel Corporation. All Rights Reserved.
-
-CREATED: August 08, 2001
-OWNER: Scott D Smith, Joel Marcey
-VERSION: 1.0
----------------------------------------------------------------------*/
-
-
-using System;
-using System.IO;
-using System.Collections;
-
-namespace System.PlatformAbstractionLayer
-{
- /// <summary>
- /// Definition of functionality needed by the library that can only be provided by the underlying OS.
- /// </summary>
- internal interface IOperatingSystem
- {
-
- // System.IO services
-
- int ReadStdInput(byte[] buffer, int offset, int count);
-
- void FlushStdOutput(byte[] byteBuf);
-
-
-
- // System.File services
-
- int ReadFile(IntPtr handle, byte[] buffer, int offset, int count);
-
- int WriteFile(IntPtr handle, byte[] buffer, int offset, int count);
-
- void FlushFile(IntPtr handle, byte[] byteBuf);
-
- int SetLengthFile(IntPtr handle, long length);
-
- IntPtr OpenFile(string path, FileMode mode, FileAccess access, FileShare share);
-
- void CloseFile(IntPtr handle);
-
- long SeekFile(IntPtr handle, long offset, SeekOrigin origin);
-
- IntPtr CreateFile(string path, FileMode mode, FileAccess access, FileShare share);
-
- void DeleteFile(string path);
-
- bool ExistsFile(string path);
-
- DateTime GetCreationTimeFile(string path);
-
- DateTime GetLastAccessTimeFile(string path);
-
- DateTime GetLastWriteTimeFile(string path);
-
- void SetCreationTimeFile(string path, DateTime creationTime);
-
- void SetLastAccessTimeFile(string path, DateTime lastAccessTime);
-
- void SetLastWriteTimeFile(string path, DateTime lastWriteTime);
-
- long FileLength(string path);
-
- long FileLength(IntPtr handle);
-
-
- // System.Environment services
-
- string NewLineSequence {get;}
-
- char DirectorySeparator {get;}
-
- char AltDirectorySeparator {get;}
-
- char PathSeparator {get;}
-
- char VolumeSeparator {get;}
-
- char[] DirVolSeparatorChars {get;}
-
- char[] InvalidPathChars {get;}
-
- string GetEnvironmentVariable(string eVar);
-
- char ExtensionCharacter {get;}
-
- string CommandLine {get;}
-
- IDictionary EnvironmentVariables {get;}
-
- string MachineName {get;}
-
- OperatingSystem OSVersion {get;}
-
- // System.Path services
- // Note: Although some of these do not require direct acccess to the OS,
- // some platforms don't support some of these methods
-
- string ChangeExtension(string path, string extension);
-
- string GetExtension(string path);
-
- string GetFileName(string path);
-
- string GetFileNameWithoutExtension(string path);
-
- string GetPathRoot(string path);
-
- string GetTempFileName();
-
- string GetTempPath();
-
- bool HasExtension(string path);
-
- bool IsPathRooted(string path);
-
- string GetFullPath(string path);
-
-
- // System.Directory services
-
- void DeleteDirectory(string path, bool recursive);
-
- bool ExistsDirectory(string path);
-
- DateTime GetCreationTimeDirectory(string path);
-
- string GetCurrentDirectory();
-
- string[] GetDirectories(string path, string searchPattern);
-
- string[] GetFiles(string path, string searchPattern);
-
- string[] GetFileSystemEntries(string path, string searchPattern);
-
- DateTime GetLastAccessTimeDirectory(string path);
-
- DateTime GetLastWriteTimeDirectory(string path);
-
- void MoveDirectory(string sourceDirName, string destDirName);
-
- void SetCreationTimeDirectory(string path, DateTime creationTime);
-
- void SetCurrentDirectory(string path);
-
- void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime);
-
- void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime);
-
- double Acos(double d);
-
- double Asin(double d);
-
- double Atan(double d);
-
- double Atan2(double y, double x);
-
- double Cos(double d);
-
- double Cosh(double value);
-
- double Exp(dobule d);
-
- double Log(double d);
-
- double Log10(double d);
-
- double Pow(double x, double y);
-
- double Sin(double d);
-
- double Sinh(double d);
-
- double Sqrt(double d);
-
- double Tan(double d);
-
- double Tanh(double d);
-
- }
-}
diff --git a/mcs/class/corlib/System.PAL/Platform.cs b/mcs/class/corlib/System.PAL/Platform.cs
deleted file mode 100644
index bfaa276dbc5..00000000000
--- a/mcs/class/corlib/System.PAL/Platform.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Sean MacIsaac
-// Only want to have 1 OperatingSystemObject around.
-// We get the correct one from compile time.
-
-namespace System.PAL
-{
- internal class Platform
- {
- private static OpSys _os;
-
- public static OpSys OS
- {
-
- get
- {
- if (_os == null) {
- _os = new OpSys ();
- }
- return _os;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
deleted file mode 100755
index b6c5cb539ac..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-// System.Reflection.Emit/AssemblyBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Resources;
-using System.IO;
-using System.Security.Policy;
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Collections;
-
-namespace System.Reflection.Emit {
-
- public sealed class AssemblyBuilder : Assembly {
- private IntPtr dynamic_assembly;
- private MethodInfo entry_point;
- private ModuleBuilder[] modules;
- private string name;
- private string dir;
- private CustomAttributeBuilder[] cattrs;
- private int[] table_indexes;
- internal ArrayList methods;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void basic_init (AssemblyBuilder ab);
-
- internal AssemblyBuilder (AssemblyName n, string directory, AssemblyBuilderAccess access) {
- name = n.Name;
- dir = directory;
- basic_init (this);
- }
-
- internal int get_next_table_index (object obj, int table, bool inc) {
- if (table_indexes == null) {
- table_indexes = new int [64];
- for (int i=0; i < 64; ++i)
- table_indexes [i] = 1;
- /* allow room for .<Module> in TypeDef table */
- table_indexes [0x02] = 2;
- }
- // Console.WriteLine ("getindex for table "+table.ToString()+" got "+table_indexes [table].ToString());
- if (inc) {
- if ((table == 0x06) && (methods != null))
- methods.Add (obj);
- return table_indexes [table]++;
- }
- return table_indexes [table];
- }
-
- public override string CodeBase {
- get {
- return null;
- }
- }
-
- public override MethodInfo EntryPoint {
- get {
- return entry_point;
- }
- }
-
- public override string Location {
- get {
- return null;
- }
- }
-
- public void AddResourceFile (string name, string fileName)
- {
- }
-
- public void AddResourceFile (string name, string fileName, ResourceAttributes attribute)
- {
- }
-
- public ModuleBuilder DefineDynamicModule (string name)
- {
- return DefineDynamicModule (name, name, false);
- }
-
- public ModuleBuilder DefineDynamicModule (string name, bool emitSymbolInfo)
- {
- return DefineDynamicModule (name, name, emitSymbolInfo);
- }
-
- public ModuleBuilder DefineDynamicModule(string name, string fileName)
- {
- return DefineDynamicModule (name, fileName, false);
- }
-
- public ModuleBuilder DefineDynamicModule (string name, string fileName,
- bool emitSymbolInfo)
- {
- ModuleBuilder r = new ModuleBuilder (this, name, fileName, emitSymbolInfo);
-
- if (modules != null) {
- ModuleBuilder[] new_modules = new ModuleBuilder [modules.Length + 1];
- System.Array.Copy(modules, new_modules, modules.Length);
- new_modules [modules.Length] = r;
- modules = new_modules;
- } else {
- modules = new ModuleBuilder [1];
- modules [0] = r;
- }
- return r;
- }
-
- public IResourceWriter DefineResource (string name, string description, string fileName)
- {
- return null;
- }
-
- public IResourceWriter DefineResource (string name, string description,
- string fileName, ResourceAttributes attribute)
- {
- return null;
- }
-
- public void DefineUnmanagedResource (byte[] resource)
- {
- }
-
- public void DefineUnmanagedResource (string resourceFileName)
- {
- }
-
- public void DefineVersionInfoResource ()
- {
- }
-
- public void DefineVersionInfoResource (string product, string productVersion,
- string company, string copyright, string trademark)
- {
- }
-
- public ModuleBuilder GetDynamicModule (string name)
- {
- return null;
- }
-
- public override Type[] GetExportedTypes ()
- {
- return null;
- }
-
- public override FileStream GetFile (string name)
- {
- return null;
- }
-
- /*public virtual FileStream[] GetFiles() {
- return null;
- }
- public override FileStream[] GetFiles(bool getResourceModules) {
- return null;
- }*/
-
- /*public virtual ManifestResourceInfo GetManifestResourceInfo(string resourceName)
- {
- return null;
- }
- public virtual string[] GetManifestResourceNames() {
- return null;
- }
- public virtual Stream GetManifestResourceStream(string name) {
- return null;
- }
- public virtual Stream GetManifestResourceStream(Type type, string name) {
- return null;
- }*/
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int getUSIndex (AssemblyBuilder ab, string str);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int getToken (AssemblyBuilder ab, MemberInfo member);
-
- internal int GetToken (string str) {
- return getUSIndex (this, str);
- }
-
- internal int GetToken (MemberInfo member) {
- return getToken (this, member);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int getDataChunk (AssemblyBuilder ab, byte[] buf, int offset);
-
- public void Save (string assemblyFileName)
- {
- byte[] buf = new byte [65536];
- FileStream file;
- int count, offset;
-
- if (dir != null) {
- assemblyFileName = String.Format ("{0}{1}{2}", dir, System.IO.Path.DirectorySeparatorChar, assemblyFileName);
- }
-
- file = new FileStream (assemblyFileName, FileMode.Create, FileAccess.Write);
-
- offset = 0;
- while ((count = getDataChunk (this, buf, offset)) != 0) {
- file.Write (buf, 0, count);
- offset += count;
- }
- file.Close ();
- }
-
- public void SetEntryPoint (MethodInfo entryMethod)
- {
- entry_point = entryMethod;
- }
-
- public void SetEntryPoint (MethodInfo entryMethod, PEFileKinds fileKind)
- {
- entry_point = entryMethod;
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs b/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
deleted file mode 100644
index 2c6a97d9aca..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//--------------------------
-// System.Reflection.Emit
-// Author: Mandar Nanivadekar
-//
-// Created: 29/08/2001
-//------------------------------
-
-namespace System.Reflection.Emit
-{
- public enum AssemblyBuilderAccess
- {
- Run = 1,
- Save = 2,
- RunAndSave = 3
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/ChangeLog b/mcs/class/corlib/System.Reflection.Emit/ChangeLog
deleted file mode 100644
index ce9b38450a5..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ChangeLog
+++ /dev/null
@@ -1,375 +0,0 @@
-
-Mon Jun 17 14:55:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * ModuleBuilder.cs, TypeBuilder.cs: fixes for nested types handling.
-
-Fri Jun 14 16:21:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * CustomAttributeBuilder.cs: added custom attribute related internal
- helper methods.
- * FieldBuilder.cs, ParameterBuilder.cs: handle MarshalAs attribute.
- * UnmanagedMarshal.cs: implemented.
-
-Mon Jun 10 18:58:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * PropertyBuilder.cs: implemented ReflectedType and DeclaringType
- properties.
-
-2002-06-07 Martin Baulig <martin@gnome.org>
-
- * TypeBuilder.cs (TypeBuilder): Added `PackingSize packing_size' and
- `int type_size' fields to the constructor.
- (DefineNestedType): Pass packing_size and type_size to the constructor.
-
- * ModuleBuilder.cs (DefineType): Pass the packing_size and type_size
- fields to the TypeBuilder's constructor.
-
-2002-06-07 Martin Baulig <martin@gnome.org>
-
- * TypeBuilder.cs (DefineNestedType): There is no overload for this
- method which takes 5 args in the specs, removed it.
-
-Fri Jun 7 17:04:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: updates for PE/COFF rewrite.
-
-2002-05-30 Martin Baulig <martin@gnome.org>
-
- * AssemblyBuilder.cs (methods): Made this internal and don't
- initialize it. It will be initialized by the ModuleBuilder's
- GetSymbolWriter() method.
- (get_next_table_index): Only store the method in the `methods'
- array if it's not null.
-
- * ModuleBuilder.cs (GetSymbolWriter): Initialize the AssemblyBuilder's
- `methods' field if necessary and pass it as third argument to the
- symbol writer's constructor.
-
-2002-05-25 Martin Baulig <martin@gnome.org>
-
- * TypeBuilder.cs (TypeToken): Implemented.
-
-2002-05-24 Martin Baulig <martin@gnome.org>
-
- * ModuleBuilder.cs (symwriter_define_local): New private variable.
- (GetSymbolWriter): Look for a custom version of "DefineLocalVariable"
- and store it in `symwriter_define_local'.
- (SymWriter_DefineLocalVariable): New internal method to call the
- symbol writer's custom DefineLocalVariable() method. It is safe to
- call this method if there's no symbol writer.
-
- * LocalBuilder.cs (SetLocalSymInfo): Use the MethodBuilder'snew
- SymWriter_DefineLocalVariable().
-
- * MethodBuilder.cs (GetParameters): Implemented.
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * ModuleBuilder.cs (GetSymbolWriter): Pass the this pointer to the
- symbol writer's constructor.
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * AssemblyBuilder.cs (methods): New field.
- (get_next_table_index): Record all methods and constructors
- (table 0x06) in the `methods' array. This is read by the
- Mono.CSharp.Debugger.MonoSymbolWriter::get_method interncall to
- get the MethodBuilder / ConstructorBuilder back from the token.
-
- * *Builder.cs (get_next_table_index): Added `object obj' argument.
- (<constructors>): pass the this pointer to get_next_table_index ().
-
-2002-05-20 Martin Baulig <martin@gnome.org>
-
- * TypeBuilder.cs (DefineField): Call the new `create_internal_class'
- interncall after adding the first field. This is used when creating
- enum types to set `klass->enum_basetype'.
-
-Thu May 16 16:09:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * TypeBuilder.cs: complete special acse support for CharSet, Size and
- Pack named args in StructLayout attribute.
-
-Tue May 14 17:13:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MethodBuilder.cs: revert change in accessibility of
- GetILGenerator(int).
-
-Tue May 14 13:31:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * FieldBuilder.cs, ParameterBuilder.cs: more special-casing of
- attributes.
-
-Fri May 10 20:57:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * CustomAttributeBuilder.cs: expose internal data for use in
- reflection.
- * FieldBuilder.cs, TypeBuilder.cs: special case FieldOffset and
- StructLayout attributes.
-
-Fri May 10 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MethodBuilder.cs, ConstructorBuilder.cs: implemented InitLocals
- property.
-
-2002-04-26 Martin Baulig <martin@gnome.org>
-
- * ModuleBuilder.cs (DefineDocument): Implemented.
-
-Tue Apr 16 13:02:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: pad output file to file alignment.
- * FieldBuilder.cs: ReflectedType.
- * ModuleBuilder.cs: added guid generation and array method creation.
- * MonoArrayMethod.cs: array method support code.
-
-Wed Apr 10 12:57:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: use a stack to keep track of exception blocks.
-
-Mon Apr 8 06:19:01 2002 Piers Haken <piersh@friskit.com>
-
- * ILGenerator.cs: added LabelField.label_base to allow for
- arbitrary offsets (for switch statement)
-
-Fri Apr 5 15:41:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: simpler protocol wih the runtime to
- get the assembly data.
-
-Tue Mar 26 20:10:24 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: use FileMode.Create.
- * ILGenerator.cs: optimize localbuilder related opcodes.
- Track parameters to adjust maxstack.
- * LocalBuilder.cS: use unsigned for position.
-
-2002-03-23 Miguel de Icaza <miguel@ximian.com>
-
- * LocalBuilder.cs: Drop the symbol_writer as LocalBuilder fields.
- Do this lazily in SetLocalSymInfo.
-
-2002-03-24 Martin Baulig <martin@gnome.org>
-
- * ModuleBuilder.cs (GetSymbolWriter): The MonoSymbolWriter's constructor
- now takes a `string assembly_filename' argument, pass it our fully
- qualified assembly name.
-
-2002-03-24 Nick Drochak <ndrochak@gol.com>
-
- * ILGenerator.cs: Use #if-#endif instead of if(false){} to disable
- code. This way there is no compiler warning.
-
- * TypeBuilder.cs: Removed the returns that came after the throws.
- This removes a few more compiler warnings. Also marked with MonoTODO
- all places where we throw NotImplemented exceptions.
-
-2002-03-23 Martin Baulig <martin@gnome.org>
-
- * SignatureHelper.cs (GetFieldSignatureHelper, GetLocalSignatureHelper):
- Implemented.
-
- * LocalBuilder.cs (LocalBuilder): This internal constructor now takes
- a ModuleBuilder argument instead of a ISymbolWriter one.
- (SetLocalSymInfo): Create and pass type signature to DefineLocalVariable.
-
-2002-03-23 Martin Baulig <martin@gnome.org>
-
- * ILGenerator.cs (BeginScope, EndScope): Implemented.
-
-2002-03-20 Martin Baulig <martin@gnome.org>
-
- * ModuleBuilder.cs (GetSymbolWriter): New internal function. Dynamically
- loads the default symbol writer, catch all possible exceptions and return
- null on failure.
- (ModuleBuilder): Added `bool emitSymbolInfo' argument to this internal
- constructor; if set, call GetSymbolWriter ().
- (GetSymWriter): Implemented.
-
- * LocalBuilder.cs (LocalBuilder): Added ISymbolWriter argument to this
- internal method.
- (SetLocalSymInfo): Implemented, call ISymbolWriter.DefineLocalVariable ()
- if the symbol writer is not null.
-
- * ILGenerator.cs (ILGenerator): Call ModuleBuilder.GetSymWriter () to get
- and store the symbol writer.
- (DeclareLocal): Pass the symbol writer to LocalBuilder's constructor.
- (MarkSequencePoint): Implemented, call ISymbolWriter.DefineSequencePoints ()
- if the symbol writer is not null.
-
- * AssemblyBuilder.cs (DefineDynamicModule): Pass the `bool emitSymbolInfo'
- to ModuleBuilder's constructor.
-
-Sat Mar 16 19:11:47 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ModuleBuilder.cs: handle modified types correctly.
-
-Thu Mar 7 17:10:42 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: allow saving bigger assemblies.
- * ILGenerator.cs: add fixup table for fields and methods, since
- at the end of the compile they may end up with a different table
- index.
- * ModuleBuilder.cs: add cache for type names to speed up the type
- lookups from the compiler.
- * TypeBuilder.cs: GetInterfaces () returns only interfaces in the
- current type, not in parents (the docs are wrong).
-
-Tue Mar 5 18:09:34 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * EventBuilder.cs: implemented.
- * TypeBuilder.cs: implemented DefineEvent() method and UnderlyingSystemType
- property.
-
-Mon Mar 4 20:34:52 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: make enough room in the byte array for string
- tokens.
- * TypeBuilder.cs: fixed GetInterfaces().
-
-Mon Mar 4 11:30:40 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * TypeBuilder.cs: implemented GetConstructors(), GetFields(),
- GetMethods(), GetProperties().
-
-Thu Feb 28 19:15:10 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: call into the runtime to init some basic
- assembly stuff. Reserve slot 1 of typedef table for .<Module>.
- * ModuleBuilder.cs: call into the runtime if we need to create a
- modief type, such as arrays, byref etc.
- * TypeBuilder.cs: call into the runtime to create the MonoClass
- representation for the type. Throw exceptions with not implemented
- stuff.
-
-Wed Feb 27 18:48:47 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: fix nested exception blocks.
-
-Wed Feb 20 22:30:49 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: upped compiled assembly size limit.
- Implemented SetCustomAttribute () methods.
- * CustomAttributeBuilder.cs: implemented the needed constructor
- stuff.
- * Cosntructorbuilder.cs, EnumBuilder.cs, FieldBuilder.cs,
- MethodBuilder.cs, ModuleBuilder.cs, ParameterBuilder.cs,
- PropertyBuilder.cs, TypeBuilder.cs: Implemented SetCustomAttribute () methods.
-
-Wed Feb 20 14:54:01 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: add SetCustomAttribute () to keep the compiler
- going.
-
-Fri Feb 15 18:15:04 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: finally block support and fixes.
-
-Thu Feb 14 18:55:52 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * FieldBuilder.cs: Add SetRVAData().
- * ILGenerator.cs: speed up code array growth.
- * TypeBuilder.cs: fix IsValueTypeImpl(). Add class_size member.
- Implement DefineInitializedData().
-
-Tue Jan 22 23:01:11 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * EnumBuilder.cs, TypeBuilder.cs: updates for changes in Type.cs.
- * ModuleBuilder.cs: fix lookup of nested types.
-
-Tue Jan 15 22:46:21 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: implement some of the exception support methods.
-
-Mon Jan 14 17:07:32 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ModulerBuilder.cs: search also for subtypes in GetTypes().
- * TypeBuilder.cs: bugfix in FullName. Implemented DefineNestedType().
-
-Fri Jan 11 19:00:29 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MethodBuilder.cs, ConstructorBuilder.cs: save parameter info.
-
-Thu Jan 10 21:07:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: handle type tokens (used for box opcode).
-
-Wed Jan 9 19:37:55 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: emit float and doubles.
- * ModuleBuilder.cs: off-by-one error fix and GetType()
- implementations.
- * TypeBuilder.cs: AttributesImpl added.
- * UnmanagedMarshal.cs: stubbed out class.
-
-Sat Jan 5 15:59:05 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: fix emission of two-bytes opcodes.
- Missing slot for locals array. Throw exceptions on unimplemented
- methods.
- * OpCode.cs: add a comment: the Value property is useless.
- * OpCodes.cs: fix name of tail opcode (Tail -> Tailcall).
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ConstructorBuilder.cs : Use the MonoTODO attribute.
-
- * ILGenerator.cs, Label.cs, MethodBuilder.cs, ModuleBuilder.cs,
- ParameterBuilder.cs, TypeBuilder.cs : Ditto.
-
-Thu Jan 3 23:26:15 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * ILGenerator.cs: typo fix.
-
-Mon Dec 24 17:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * TypeBuilder.cs: added DefineMethodOverride().
- * MethodBuilder.cs: add override_method member and setter.
-
-Mon Nov 19 13:58:01 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: add method to register a string in the "#US"
- stream.
- * EnumBuilder.cs, SignatureHelper.cs: added stubs.
- * ILGenerator.cs: more stuff implemented.
- * LocalBuilder.cs: keep track of local var index.
-
-Thu Nov 15 18:11:23 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ConstructorBuilder.cs: implement the interesting methods.
- * ILGenerator.cs: adapt for use with both a MethodBuilder and a
- ConstructorBuilder.
- * MethodBuilder.cs: add ImplAttributes.
- * ParameterBuilder.cs: adapt for ConstructorBuilder.
- * TypeBuilder.cs: add constructors handling.
-
-Wed Nov 14 17:01:45 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * ConstructorBuilder.cs: added missing stubs and some implementation.
- * CustomAttributeBuilder.cs: added.
- * EventBuilder.cs: added.
- * FieldBuilder.cs: updates.
- * MethodBuilder.cs: stuff to implement P/Invoke methods.
- * ModuleBuilder.cs: added GetArrayMethod() stub.
- * ParameterBuilder.cs, PropertyBuilder.cs: updates.
- * TypeBuilder.cs: updates and stubs.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * TypeBuilder.cs: Added implementation for TypeHandle.
-
-Tue Nov 6 09:13:45 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AssemblyBuilder.cs: define an internal constructor.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * AssemblyBuilder.cs: Reformatted.
-
- Added override keywords to those that needed them.
-
- Removed methods that we do not override, but just inherit
-
-Tue Sep 25 16:53:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * TypeBuilder.cs, ConstructorBuilder.cs, ModuleBuilder.cs: added.
diff --git a/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
deleted file mode 100644
index 41ef0dd9ca9..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ConstructorBuilder.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// System.Reflection.Emit/ConstructorBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Reflection.Emit {
- public sealed class ConstructorBuilder : ConstructorInfo {
- private ILGenerator ilgen;
- private Type[] parameters;
- private MethodAttributes attrs;
- private MethodImplAttributes iattrs;
- private int table_idx;
- private CallingConventions call_conv;
- private TypeBuilder type;
- private ParameterBuilder[] pinfo;
- private CustomAttributeBuilder[] cattrs;
- private bool init_locals = true;
-
- internal ConstructorBuilder (TypeBuilder tb, MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes) {
- attrs = attributes;
- call_conv = callingConvention;
- if (parameterTypes != null) {
- this.parameters = new Type [parameterTypes.Length];
- System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
- }
- type = tb;
- table_idx = get_next_table_index (this, 0x06, true);
- }
-
- public bool InitLocals {
- get {return init_locals;}
- set {init_locals = value;}
- }
-
- internal TypeBuilder TypeBuilder {
- get {return type;}
- }
-
- public override MethodImplAttributes GetMethodImplementationFlags() {
- return iattrs;
- }
- public override ParameterInfo[] GetParameters() {
- return null;
- }
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- return null;
- }
- public override object Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture) {
- return null;
- }
-
- public override RuntimeMethodHandle MethodHandle { get {return new RuntimeMethodHandle ();} }
- public override MethodAttributes Attributes {
- get {return attrs;}
- }
- public override Type ReflectedType { get {return type;}}
- public override Type DeclaringType { get {return type;}}
- public Type ReturnType { get {return null;}}
- public override string Name {
- get {return (attrs & MethodAttributes.Static) != 0 ? ".cctor" : ".ctor";}
- }
- public string Signature {
- get {return "constructor signature";}
- }
-
- public void AddDeclarativeSecurity( SecurityAction action, PermissionSet pset) {
- }
-
- [MonoTODO]
- public ParameterBuilder DefineParameter(int iSequence, ParameterAttributes attributes, string strParamName)
- {
- ParameterBuilder pb = new ParameterBuilder (this, iSequence, attributes, strParamName);
- // check iSequence
- if (pinfo == null)
- pinfo = new ParameterBuilder [parameters.Length + 1];
- pinfo [iSequence] = pb;
- return pb;
- }
-
- public override bool IsDefined (Type attribute_type, bool inherit) {return false;}
-
- public override object [] GetCustomAttributes (bool inherit) {return null;}
-
- public override object [] GetCustomAttributes (Type attribute_type, bool inherit) {return null;}
-
- public ILGenerator GetILGenerator () {
- return GetILGenerator (256);
- }
- internal ILGenerator GetILGenerator (int size) {
- ilgen = new ILGenerator (this, size);
- return ilgen;
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public void SetImplementationFlags( MethodImplAttributes attributes) {
- iattrs = attributes;
- }
- public Module GetModule() {
- return null;
- }
- public MethodToken GetToken() {
- return new MethodToken (0x06000000 | table_idx);
- }
- public void SetSymCustomAttribute( string name, byte[] data) {
- }
- public override string ToString() {
- return "constructor";
- }
-
- internal void fixup () {
- if (ilgen != null)
- ilgen.label_fixup ();
- }
- internal override int get_next_table_index (object obj, int table, bool inc) {
- return type.get_next_table_index (obj, table, inc);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
deleted file mode 100755
index aa41c0a1d47..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-
-//
-// System.Reflection.Emit/CustomAttributeBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public class CustomAttributeBuilder {
- ConstructorInfo ctor;
- byte[] data;
-
- internal ConstructorInfo Ctor {
- get {return ctor;}
- }
-
- internal byte[] Data {
- get {return data;}
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static extern byte[] GetBlob(ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues);
-
- internal CustomAttributeBuilder( ConstructorInfo con, byte[] cdata) {
- ctor = con;
- data = (byte[])cdata.Clone ();
- /* should we check that the user supplied data is correct? */
- }
-
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs)
- : this (con, constructorArgs, null, null, null, null) {
- }
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs, FieldInfo[] namedFields, object[] fieldValues)
- : this (con, constructorArgs, null, null, namedFields, fieldValues) {
- }
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues)
- : this (con, constructorArgs, namedProperties, propertyValues, null, null) {
- }
- public CustomAttributeBuilder( ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues) {
- ctor = con;
- data = GetBlob (con, constructorArgs, namedProperties, propertyValues, namedFields, fieldValues);
- }
-
- /* helper methods */
- internal static int decode_len (byte[] data, int pos, out int rpos) {
- int len = 0;
- if ((data [pos] & 0x80) == 0) {
- len = (int)(data [pos++] & 0x7f);
- } else if ((data [pos] & 0x40) == 0) {
- len = ((data [pos] & 0x3f) << 8) + data [pos + 1];
- pos += 2;
- } else {
- len = ((data [pos] & 0x1f) << 24) + (data [pos + 1] << 16) + (data [pos + 2] << 8) + data [pos + 3];
- pos += 4;
- }
- rpos = pos;
- return len;
- }
-
- internal static string string_from_bytes (byte[] data, int pos, int len) {
- char[] chars = new char [len];
- // FIXME: use a utf8 decoder here
- for (int i = 0; i < len; ++i)
- chars [i] = (char)data [pos + i];
- return new String (chars);
- }
-
- internal static UnmanagedMarshal get_umarshal (CustomAttributeBuilder customBuilder, bool is_field) {
- byte[] data = customBuilder.Data;
- UnmanagedType subtype = UnmanagedType.I4;
- int value;
- int utype; /* the (stupid) ctor takes a short or an enum ... */
- utype = (int)data [2];
- utype |= ((int)data [3]) << 8;
-
- string first_type_name = customBuilder.Ctor.GetParameters()[0].ParameterType.FullName;
- int pos = 6;
- if (first_type_name == "System.Int16")
- pos = 4;
- int nnamed = (int)data [pos++];
- nnamed |= ((int)data [pos++]) << 8;
-
- for (int i = 0; i < nnamed; ++i) {
- byte type = data [pos++];
- int len = decode_len (data, pos, out pos);
- string named_name = string_from_bytes (data, pos, len);
- pos += len;
- switch (named_name) {
- case "ArraySubType":
- value = (int)data [pos++];
- value |= ((int)data [pos++]) << 8;
- value |= ((int)data [pos++]) << 16;
- value |= ((int)data [pos++]) << 24;
- subtype = (UnmanagedType)value;
- break;
- default:
- break;
- }
- }
-
- switch ((UnmanagedType)utype) {
- case UnmanagedType.LPArray:
- return UnmanagedMarshal.DefineLPArray (subtype);
- case UnmanagedType.SafeArray:
- return UnmanagedMarshal.DefineSafeArray (subtype);
- case UnmanagedType.ByValArray:
- case UnmanagedType.ByValTStr:
- default:
- return UnmanagedMarshal.DefineUnmanagedMarshal ((UnmanagedType)utype);
- }
- return null;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs
deleted file mode 100755
index d82d116ad84..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/EnumBuilder.cs
+++ /dev/null
@@ -1,188 +0,0 @@
-
-//
-// System.Reflection.Emit/EnumBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public sealed class EnumBuilder : Type {
- CustomAttributeBuilder[] cattrs;
-
- public override Assembly Assembly {
- get {return null;}
- }
- public override string AssemblyQualifiedName {
- get {return null;}
- }
- public override Type BaseType {
- get {return null;}
- }
- public override Type DeclaringType {
- get {return null;}
- }
- public override string FullName {
- get {return null;}
- }
- public override Guid GUID {
- get {return Guid.Empty;}
- }
- public override Module Module {
- get {return null;}
- }
- public override string Name {
- get {return null;}
- }
- public override string Namespace {
- get {return null;}
- }
- public override Type ReflectedType {
- get {return null;}
- }
- public override RuntimeTypeHandle TypeHandle {
- get {return new RuntimeTypeHandle ();}
- }
- public TypeToken TypeToken {
- get {return new TypeToken ();}
- }
- public FieldBuilder UnderlyingField {
- get {return null;}
- }
- public override Type UnderlyingSystemType {
- get {return null;}
- }
-/* no need to override
- public override MemberTypes MemberType {
- get {return MemberTypes.TypeInfo;}
- }
-*/
-
- internal EnumBuilder (ModuleBuilder mb, string name, TypeAttributes visibility, Type underlyingType) {
- }
- public Type CreateType() {
- return null;
- }
- public FieldBuilder DefineLiteral( string literalName, object literalValue) {
- return null;
- }
- protected override TypeAttributes GetAttributeFlagsImpl() {
- return (TypeAttributes)0;
- }
- protected override ConstructorInfo GetConstructorImpl( BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr) {
- return null;
- }
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
- public override Type GetElementType() {
- throw new NotSupportedException ();
- }
- public override EventInfo GetEvent( string name, BindingFlags bindingAttr) {
- return null;
- }
- public override EventInfo[] GetEvents() {
- return null;
- }
- public override EventInfo[] GetEvents( BindingFlags bindingAttr) {
- return null;
- }
- public override FieldInfo GetField( string name, BindingFlags bindingAttr) {
- return null;
- }
- public override FieldInfo[] GetFields( BindingFlags bindingAttr) {
- return null;
- }
- public override Type GetInterface( string name, bool ignoreCase) {
- return null;
- }
- public override InterfaceMapping GetInterfaceMap( Type interfaceType) {
- throw new NotImplementedException ();
- }
- public override Type[] GetInterfaces() {
- return null;
- }
- public override MemberInfo[] GetMember( string name, MemberTypes type, BindingFlags bindingAttr) {
- return null;
- }
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr) {
- return null;
- }
- protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- return null;
- }
-
- public override MethodInfo[] GetMethods( BindingFlags bindingAttr) {
- return null;
- }
- public override Type GetNestedType( string name, BindingFlags bindingAttr) {
- return null;
- }
- public override Type[] GetNestedTypes( BindingFlags bindingAttr) {
- return null;
- }
- public override PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
- return null;
- }
- protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- protected override bool HasElementTypeImpl() {
- throw new NotSupportedException ();
- }
- public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
- return null;
- }
- protected override bool IsArrayImpl() {
- return false;
- }
- protected override bool IsByRefImpl() {
- return false;
- }
- protected override bool IsCOMObjectImpl() {
- return false;
- }
- protected override bool IsPointerImpl() {
- return false;
- }
- protected override bool IsPrimitiveImpl() {
- return false;
- }
- protected override bool IsValueTypeImpl() {
- return true;
- }
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/EventBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/EventBuilder.cs
deleted file mode 100755
index 507620a4764..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/EventBuilder.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-
-//
-// System.Reflection.Emit/EventBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public sealed class EventBuilder {
- string name;
- Type type;
- TypeBuilder typeb;
- CustomAttributeBuilder[] cattrs;
- MethodBuilder add_method;
- MethodBuilder remove_method;
- MethodBuilder raise_method;
- MethodBuilder[] other_methods;
- EventAttributes attrs;
- int table_idx;
-
- internal EventBuilder (TypeBuilder tb, string eventName, EventAttributes eventAttrs, Type eventType) {
- name = eventName;
- attrs = eventAttrs;
- type = eventType;
- typeb = tb;
- table_idx = get_next_table_index (this, 0x14, true);
- }
-
- internal int get_next_table_index (object obj, int table, bool inc) {
- return typeb.get_next_table_index (obj, table, inc);
- }
-
- public void AddOtherMethod( MethodBuilder mdBuilder) {
- if (other_methods != null) {
- MethodBuilder[] newv = new MethodBuilder [other_methods.Length + 1];
- other_methods.CopyTo (newv, 0);
- other_methods = newv;
- } else {
- other_methods = new MethodBuilder [1];
- }
- other_methods [other_methods.Length - 1] = mdBuilder;
- }
-
- public EventToken GetEventToken () {
- return new EventToken (0x14000000 | table_idx);
- }
- public void SetAddOnMethod( MethodBuilder mdBuilder) {
- add_method = mdBuilder;
- }
- public void SetRaiseMethod( MethodBuilder mdBuilder) {
- raise_method = mdBuilder;
- }
- public void SetRemoveOnMethod( MethodBuilder mdBuilder) {
- remove_method = mdBuilder;
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/EventToken.cs b/mcs/class/corlib/System.Reflection.Emit/EventToken.cs
deleted file mode 100644
index 4cc97be7ea1..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/EventToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// EventToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Event.
- /// </summary>
- [Serializable]
- public struct EventToken {
-
- internal int tokValue;
-
- public static readonly EventToken Empty;
-
-
- static EventToken ()
- {
- Empty = new EventToken ();
- }
-
-
- internal EventToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is EventToken;
-
- if (res) {
- EventToken that = (EventToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// EventToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Event.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs
deleted file mode 100755
index 2ebe66f7ee5..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/FieldBuilder.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-
-//
-// System.Reflection.Emit/FieldBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001-2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public sealed class FieldBuilder : FieldInfo {
- private FieldAttributes attrs;
- private Type type;
- private String name;
- private object def_value;
- private int offset;
- private int table_idx;
- internal TypeBuilder typeb;
- private byte[] rva_data;
- private CustomAttributeBuilder[] cattrs;
- private UnmanagedMarshal marshal_info;
-
- internal FieldBuilder (TypeBuilder tb, string fieldName, Type type, FieldAttributes attributes) {
- attrs = attributes;
- name = fieldName;
- this.type = type;
- offset = -1;
- typeb = tb;
- table_idx = tb.get_next_table_index (this, 0x04, true);
- }
-
- public override FieldAttributes Attributes {
- get {return attrs;}
- }
- public override Type DeclaringType {
- get {return typeb;}
- }
- public override RuntimeFieldHandle FieldHandle {
- get {return new RuntimeFieldHandle();}
- }
- public override Type FieldType {
- get {return type;}
- }
- public override string Name {
- get {return name;}
- }
- public override Type ReflectedType {
- get {return typeb;}
- }
-
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
- public FieldToken GetToken() {
- return new FieldToken (0x04000000 | table_idx);
- }
- public override object GetValue(object obj) {
- return null;
- }
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
- internal void SetRVAData (byte[] data) {
- rva_data = (byte[])data.Clone ();
- }
- public void SetConstant( object defaultValue) {
- /*if (defaultValue.GetType() != type)
- throw new ArgumentException ("Constant doesn't match field type");*/
- def_value = defaultValue;
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- string attrname = customBuilder.Ctor.ReflectedType.FullName;
- if (attrname == "System.Runtime.InteropServices.FieldOffsetAttribute") {
- byte[] data = customBuilder.Data;
- offset = (int)data [2];
- offset |= ((int)data [3]) << 8;
- offset |= ((int)data [4]) << 16;
- offset |= ((int)data [5]) << 24;
- return;
- } else if (attrname == "System.NonSerializedAttribute") {
- attrs |= FieldAttributes.NotSerialized;
- return;
- } else if (attrname == "System.Runtime.InteropServices.MarshalAsAttribute") {
- marshal_info = CustomAttributeBuilder.get_umarshal (customBuilder, true);
- /* FIXME: check for errors */
- return;
- }
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
-
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
- public void SetMarshal( UnmanagedMarshal unmanagedMarshal) {
- marshal_info = unmanagedMarshal;
- attrs |= FieldAttributes.HasFieldMarshal;
- }
-
- public void SetOffset( int iOffset) {
- offset = iOffset;
- }
- public override void SetValue( object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
- }
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/FieldToken.cs b/mcs/class/corlib/System.Reflection.Emit/FieldToken.cs
deleted file mode 100644
index b3f5a5dade1..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/FieldToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// FieldToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Field.
- /// </summary>
- [Serializable]
- public struct FieldToken {
-
- internal int tokValue;
-
- public static readonly FieldToken Empty;
-
-
- static FieldToken ()
- {
- Empty = new FieldToken ();
- }
-
-
- internal FieldToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is FieldToken;
-
- if (res) {
- FieldToken that = (FieldToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// FieldToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Field.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/FlowControl.cs b/mcs/class/corlib/System.Reflection.Emit/FlowControl.cs
deleted file mode 100644
index b714362cb11..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/FlowControl.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// FlowControl.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes how an instruction alters the flow of control.
- /// </summary>
- public enum FlowControl {
-
- /// <summary>
- /// Branch instruction (ex: br, leave).
- /// </summary>
- Branch = 0,
-
- /// <summary>
- /// Break instruction (ex: break).
- /// </summary>
- Break = 1,
-
- /// <summary>
- /// Call instruction (ex: jmp, call, callvirt).
- /// </summary>
- Call = 2,
-
- /// <summary>
- /// Conditional branch instruction (ex: brtrue, brfalse).
- /// </summary>
- Cond_Branch = 3,
-
- /// <summary>
- /// Changes the behaviour of or provides additional
- /// about a subsequent instruction.
- /// (ex: prefixes such as volatile, unaligned).
- /// </summary>
- Meta = 4,
-
- /// <summary>
- /// Transition to the next instruction.
- /// </summary>
- Next = 5,
-
- /// <summary>
- /// Annotation for ann.phi instruction.
- /// </summary>
- Phi = 6,
-
- /// <summary>
- /// Return instruction.
- /// </summary>
- Return = 7,
-
- /// <summary>
- /// Throw instruction.
- /// </summary>
- Throw = 8
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs b/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
deleted file mode 100644
index 4c4dcdf94c3..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs
+++ /dev/null
@@ -1,611 +0,0 @@
-
-//
-// System.Reflection.Emit/ILGenerator.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-using System.Diagnostics.SymbolStore;
-
-namespace System.Reflection.Emit {
-
- internal struct ILExceptionBlock {
- public const int CATCH = 0;
- public const int FILTER = 1;
- public const int FINALLY = 2;
- public const int FAULT = 4;
-
- internal Type extype;
- internal int type;
- internal int start;
- internal int len;
- internal int filter_offset;
-
- internal void Debug () {
-#if NO
- System.Console.Write ("\ttype="+type.ToString()+" start="+start.ToString()+" len="+len.ToString());
- if (extype != null)
- System.Console.WriteLine (" extype="+extype.ToString());
- else
- System.Console.WriteLine ("");
-#endif
- }
- }
- internal struct ILExceptionInfo {
- ILExceptionBlock[] handlers;
- internal int start;
- int len;
- internal Label end;
-
- internal int NumHandlers () {
- return handlers.Length;
- }
-
- internal void AddCatch (Type extype, int offset) {
- int i;
- End (offset);
- add_block (offset);
- i = handlers.Length - 1;
- handlers [i].type = ILExceptionBlock.CATCH;
- handlers [i].start = offset;
- handlers [i].extype = extype;
- }
-
- internal void AddFinally (int offset) {
- int i;
- End (offset);
- add_block (offset);
- i = handlers.Length - 1;
- handlers [i].type = ILExceptionBlock.FINALLY;
- handlers [i].start = offset;
- handlers [i].extype = null;
- }
-
- internal void End (int offset) {
- if (handlers == null)
- return;
- int i = handlers.Length - 1;
- if (i >= 0)
- handlers [i].len = offset - handlers [i].start;
- }
-
- internal int LastClauseType () {
- if (handlers != null)
- return handlers [handlers.Length-1].type;
- else
- return ILExceptionBlock.CATCH;
- }
-
- internal void Debug (int b) {
-#if NO
- System.Console.WriteLine ("Handler {0} at {1}, len: {2}", b, start, len);
- for (int i = 0; i < handlers.Length; ++i)
- handlers [i].Debug ();
-#endif
- }
-
- void add_block (int offset) {
- if (handlers != null) {
- int i = handlers.Length;
- ILExceptionBlock[] new_b = new ILExceptionBlock [i + 1];
- System.Array.Copy (handlers, new_b, i);
- handlers = new_b;
- handlers [i].len = offset - handlers [i].start;
- } else {
- handlers = new ILExceptionBlock [1];
- len = offset - start;
- }
- }
- }
-
- internal struct ILTokenInfo {
- public MemberInfo member;
- public int code_pos;
- }
-
- public class ILGenerator: Object {
- private struct LabelFixup {
- public int size;
- public int pos; // the location of the fixup
- public int label_base; // the base address for this fixup
- public int label_idx;
- };
- static Type void_type = typeof (void);
- private byte[] code;
- private MethodBase mbuilder; /* a MethodBuilder or ConstructorBuilder */
- private int code_len;
- private int max_stack;
- private int cur_stack;
- private LocalBuilder[] locals;
- private ILExceptionInfo[] ex_handlers;
- private int num_token_fixups;
- private ILTokenInfo[] token_fixups;
- private int[] label_to_addr;
- private int num_labels;
- private LabelFixup[] fixups;
- private int num_fixups;
- private ModuleBuilder module;
- private AssemblyBuilder abuilder;
- private ISymbolWriter sym_writer;
- private Stack scopes;
- private int cur_block;
- private Stack open_blocks;
-
- internal ILGenerator (MethodBase mb, int size) {
- if (size < 0)
- size = 256;
- code_len = 0;
- code = new byte [size];
- mbuilder = mb;
- cur_stack = max_stack = 0;
- num_fixups = num_labels = 0;
- label_to_addr = new int [16];
- fixups = new LabelFixup [16];
- token_fixups = new ILTokenInfo [16];
- scopes = new Stack ();
- num_token_fixups = 0;
- if (mb is MethodBuilder) {
- module = (ModuleBuilder)((MethodBuilder)mb).TypeBuilder.Module;
- } else if (mb is ConstructorBuilder) {
- module = (ModuleBuilder)((ConstructorBuilder)mb).TypeBuilder.Module;
- }
- abuilder = (AssemblyBuilder)module.Assembly;
- sym_writer = module.GetSymWriter ();
- open_blocks = new Stack ();
- }
-
- private void add_token_fixup (MemberInfo mi) {
- if (num_token_fixups == token_fixups.Length) {
- ILTokenInfo[] ntf = new ILTokenInfo [num_token_fixups * 2];
- token_fixups.CopyTo (ntf, 0);
- token_fixups = ntf;
- }
- token_fixups [num_token_fixups].member = mi;
- token_fixups [num_token_fixups++].code_pos = code_len;
- }
-
- private void make_room (int nbytes) {
- if (code_len + nbytes < code.Length)
- return;
- byte[] new_code = new byte [(code_len + nbytes) * 2 + 128];
- System.Array.Copy (code, 0, new_code, 0, code.Length);
- code = new_code;
- }
- private void emit_int (int val) {
- code [code_len++] = (byte) (val & 0xFF);
- code [code_len++] = (byte) ((val >> 8) & 0xFF);
- code [code_len++] = (byte) ((val >> 16) & 0xFF);
- code [code_len++] = (byte) ((val >> 24) & 0xFF);
- }
- /* change to pass by ref to avoid copy */
- private void ll_emit (OpCode opcode) {
- /*
- * there is already enough room allocated in code.
- */
- // access op1 and op2 directly since the Value property is useless
- if (opcode.Size == 2)
- code [code_len++] = opcode.op1;
- code [code_len++] = opcode.op2;
- /*
- * We should probably keep track of stack needs here.
- * Or we may want to run the verifier on the code before saving it
- * (this may be needed anyway when the ILGenerator is not used...).
- */
- switch (opcode.StackBehaviourPush) {
- case StackBehaviour.Push1:
- case StackBehaviour.Pushi:
- case StackBehaviour.Pushi8:
- case StackBehaviour.Pushr4:
- case StackBehaviour.Pushr8:
- case StackBehaviour.Pushref:
- case StackBehaviour.Varpush: /* again we are conservative and assume it pushes 1 */
- cur_stack ++;
- break;
- case StackBehaviour.Push1_push1:
- cur_stack += 2;
- break;
- }
- if (max_stack < cur_stack)
- max_stack = cur_stack;
- /*
- * Note that we adjust for the pop behaviour _after_ setting max_stack.
- */
- switch (opcode.StackBehaviourPop) {
- case StackBehaviour.Varpop:
- break; /* we are conservative and assume it doesn't decrease the stack needs */
- case StackBehaviour.Pop1:
- case StackBehaviour.Popi:
- case StackBehaviour.Popref:
- cur_stack --;
- break;
- case StackBehaviour.Pop1_pop1:
- case StackBehaviour.Popi_pop1:
- case StackBehaviour.Popi_popi:
- case StackBehaviour.Popi_popi8:
- case StackBehaviour.Popi_popr4:
- case StackBehaviour.Popi_popr8:
- case StackBehaviour.Popref_pop1:
- case StackBehaviour.Popref_popi:
- cur_stack -= 2;
- break;
- case StackBehaviour.Popi_popi_popi:
- case StackBehaviour.Popref_popi_popi:
- case StackBehaviour.Popref_popi_popi8:
- case StackBehaviour.Popref_popi_popr4:
- case StackBehaviour.Popref_popi_popr8:
- case StackBehaviour.Popref_popi_popref:
- cur_stack -= 3;
- break;
- }
- }
-
- private static int target_len (OpCode opcode) {
- if (opcode.operandType == OperandType.InlineBrTarget)
- return 4;
- return 1;
- }
-
- private void InternalEndClause () {
- switch (ex_handlers [cur_block].LastClauseType ()) {
- case ILExceptionBlock.CATCH:
- // how could we optimize code size here?
- Emit (OpCodes.Leave, ex_handlers [cur_block].end);
- break;
- case ILExceptionBlock.FAULT:
- case ILExceptionBlock.FINALLY:
- Emit (OpCodes.Endfinally);
- break;
- case ILExceptionBlock.FILTER:
- Emit (OpCodes.Endfilter);
- break;
- }
- }
-
- public virtual void BeginCatchBlock (Type exceptionType) {
- if (open_blocks.Count <= 0)
- throw new NotSupportedException ("Not in an exception block");
- InternalEndClause ();
- ex_handlers [cur_block].AddCatch (exceptionType, code_len);
- //System.Console.WriteLine ("Begin catch Block: "+exceptionType.ToString());
- //throw new NotImplementedException ();
- }
- public virtual void BeginExceptFilterBlock () {
- throw new NotImplementedException ();
- }
- public virtual Label BeginExceptionBlock () {
- //System.Console.WriteLine ("Begin Block");
-
- if (ex_handlers != null) {
- cur_block = ex_handlers.Length;
- ILExceptionInfo[] new_ex = new ILExceptionInfo [cur_block + 1];
- System.Array.Copy (ex_handlers, new_ex, cur_block);
- ex_handlers = new_ex;
- } else {
- ex_handlers = new ILExceptionInfo [1];
- cur_block = 0;
- }
- open_blocks.Push (cur_block);
- ex_handlers [cur_block].start = code_len;
- return ex_handlers [cur_block].end = DefineLabel ();
- }
- public virtual void BeginFaultBlock() {
- if (open_blocks.Count <= 0)
- throw new NotSupportedException ("Not in an exception block");
- //System.Console.WriteLine ("Begin fault Block");
- //throw new NotImplementedException ();
- }
- public virtual void BeginFinallyBlock() {
- if (open_blocks.Count <= 0)
- throw new NotSupportedException ("Not in an exception block");
- InternalEndClause ();
- //System.Console.WriteLine ("Begin finally Block");
- ex_handlers [cur_block].AddFinally (code_len);
- }
- public virtual void BeginScope () {
- if (sym_writer != null)
- scopes.Push (sym_writer.OpenScope (code_len));
- }
- public LocalBuilder DeclareLocal (Type localType) {
- LocalBuilder res = new LocalBuilder (module, localType);
- if (locals != null) {
- LocalBuilder[] new_l = new LocalBuilder [locals.Length + 1];
- System.Array.Copy (locals, new_l, locals.Length);
- new_l [locals.Length] = res;
- locals = new_l;
- } else {
- locals = new LocalBuilder [1];
- locals [0] = res;
- }
- res.position = (uint)(locals.Length - 1);
- return res;
- }
- public virtual Label DefineLabel () {
- if (num_labels >= label_to_addr.Length) {
- int[] new_l = new int [label_to_addr.Length * 2];
- System.Array.Copy (label_to_addr, new_l, label_to_addr.Length);
- label_to_addr = new_l;
- }
- label_to_addr [num_labels] = -1;
- return new Label (num_labels++);
- }
- public virtual void Emit (OpCode opcode) {
- make_room (2);
- ll_emit (opcode);
- }
- public virtual void Emit (OpCode opcode, Byte val) {
- make_room (3);
- ll_emit (opcode);
- code [code_len++] = val;
- }
- public virtual void Emit (OpCode opcode, ConstructorInfo constructor) {
- int token = abuilder.GetToken (constructor);
- make_room (6);
- ll_emit (opcode);
- if (constructor is ConstructorBuilder)
- add_token_fixup (constructor);
- emit_int (token);
- ParameterInfo[] mparams = constructor.GetParameters();
- if (mparams != null)
- cur_stack -= mparams.Length;
- }
- public virtual void Emit (OpCode opcode, Double val) {
- byte[] s = System.BitConverter.GetBytes (val);
- make_room (10);
- ll_emit (opcode);
- System.Array.Copy (s, 0, code, code_len, 8);
- code_len += 8;
- }
- public virtual void Emit (OpCode opcode, FieldInfo field) {
- int token = abuilder.GetToken (field);
- make_room (6);
- ll_emit (opcode);
- if (field is FieldBuilder)
- add_token_fixup (field);
- emit_int (token);
- }
- public virtual void Emit (OpCode opcode, Int16 val) {
- make_room (4);
- ll_emit (opcode);
- code [code_len++] = (byte) (val & 0xFF);
- code [code_len++] = (byte) ((val >> 8) & 0xFF);
- }
- public virtual void Emit (OpCode opcode, Int32 val) {
- make_room (6);
- ll_emit (opcode);
- emit_int (val);
- }
- public virtual void Emit (OpCode opcode, Int64 val) {
- make_room (10);
- ll_emit (opcode);
- code [code_len++] = (byte) (val & 0xFF);
- code [code_len++] = (byte) ((val >> 8) & 0xFF);
- code [code_len++] = (byte) ((val >> 16) & 0xFF);
- code [code_len++] = (byte) ((val >> 24) & 0xFF);
- code [code_len++] = (byte) ((val >> 32) & 0xFF);
- code [code_len++] = (byte) ((val >> 40) & 0xFF);
- code [code_len++] = (byte) ((val >> 48) & 0xFF);
- code [code_len++] = (byte) ((val >> 56) & 0xFF);
- }
- public virtual void Emit (OpCode opcode, Label label) {
- int tlen = target_len (opcode);
- make_room (6);
- ll_emit (opcode);
- if (num_fixups >= fixups.Length) {
- LabelFixup[] newf = new LabelFixup [fixups.Length + 16];
- System.Array.Copy (fixups, newf, fixups.Length);
- fixups = newf;
- }
- fixups [num_fixups].size = tlen;
- fixups [num_fixups].pos = code_len;
- fixups [num_fixups].label_base = code_len;
- fixups [num_fixups].label_idx = label.label;
- num_fixups++;
- code_len += tlen;
-
- }
- public virtual void Emit (OpCode opcode, Label[] labels) {
- /* opcode needs to be switch. */
- int count = labels.Length;
- make_room (6 + count * 4);
- ll_emit (opcode);
- int switch_base = code_len + count*4;
- emit_int (count);
- if (num_fixups + count >= fixups.Length) {
- LabelFixup[] newf = new LabelFixup [fixups.Length + count + 16];
- System.Array.Copy (fixups, newf, fixups.Length);
- fixups = newf;
- }
- for (int i = 0; i < count; ++i) {
- fixups [num_fixups].size = 4;
- fixups [num_fixups].pos = code_len;
- fixups [num_fixups].label_base = switch_base;
- fixups [num_fixups].label_idx = labels [i].label;
- num_fixups++;
- code_len += 4;
- }
- }
- public virtual void Emit (OpCode opcode, LocalBuilder lbuilder) {
- uint pos = lbuilder.position;
- bool load_addr = false;
- bool is_store = false;
- make_room (6);
- /* inline the code from ll_emit () to optimize il code size */
- if (opcode.StackBehaviourPop == StackBehaviour.Pop1) {
- cur_stack --;
- is_store = true;
- } else {
- cur_stack++;
- if (cur_stack > max_stack)
- max_stack = cur_stack;
- load_addr = opcode.StackBehaviourPush == StackBehaviour.Pushi;
- }
- if (load_addr) {
- if (pos < 256) {
- code [code_len++] = (byte)0x12;
- code [code_len++] = (byte)pos;
- } else {
- code [code_len++] = (byte)0xfe;
- code [code_len++] = (byte)0x0d;
- code [code_len++] = (byte)(pos & 0xff);
- code [code_len++] = (byte)((pos >> 8) & 0xff);
- }
- } else {
- if (is_store) {
- if (pos < 4) {
- code [code_len++] = (byte)(0x0a + pos);
- } else if (pos < 256) {
- code [code_len++] = (byte)0x13;
- code [code_len++] = (byte)pos;
- } else {
- code [code_len++] = (byte)0xfe;
- code [code_len++] = (byte)0x0e;
- code [code_len++] = (byte)(pos & 0xff);
- code [code_len++] = (byte)((pos >> 8) & 0xff);
- }
- } else {
- if (pos < 4) {
- code [code_len++] = (byte)(0x06 + pos);
- } else if (pos < 256) {
- code [code_len++] = (byte)0x11;
- code [code_len++] = (byte)pos;
- } else {
- code [code_len++] = (byte)0xfe;
- code [code_len++] = (byte)0x0c;
- code [code_len++] = (byte)(pos & 0xff);
- code [code_len++] = (byte)((pos >> 8) & 0xff);
- }
- }
- }
- }
- public virtual void Emit (OpCode opcode, MethodInfo method) {
- int token = abuilder.GetToken (method);
- make_room (6);
- ll_emit (opcode);
- if (method is MethodBuilder)
- add_token_fixup (method);
- emit_int (token);
- if (method.ReturnType == void_type)
- cur_stack --;
- ParameterInfo[] mparams = method.GetParameters();
- if (mparams != null)
- cur_stack -= mparams.Length;
- }
- [CLSCompliant(false)]
- public void Emit (OpCode opcode, sbyte val) {
- make_room (3);
- ll_emit (opcode);
- code [code_len++] = (byte)val;
- }
-
- [MonoTODO]
- public virtual void Emit (OpCode opcode, SignatureHelper shelper) {
- int token = 0; // FIXME: request a token from the modulebuilder
- make_room (6);
- ll_emit (opcode);
- emit_int (token);
- }
- public virtual void Emit (OpCode opcode, float val) {
- byte[] s = System.BitConverter.GetBytes (val);
- make_room (6);
- ll_emit (opcode);
- System.Array.Copy (s, 0, code, code_len, 4);
- code_len += 4;
- }
- public virtual void Emit (OpCode opcode, string val) {
- int token = abuilder.GetToken (val);
- make_room (6);
- ll_emit (opcode);
- emit_int (token);
- }
- public virtual void Emit (OpCode opcode, Type type) {
- make_room (6);
- ll_emit (opcode);
- emit_int (abuilder.GetToken (type));
- }
-
- public void EmitCall (OpCode opcode, MethodInfo methodinfo, Type[] optionalParamTypes) {
- throw new NotImplementedException ();
- }
- public void EmitCalli (OpCode opcode, CallingConventions call_conv, Type returnType, Type[] paramTypes, Type[] optionalParamTypes) {
- throw new NotImplementedException ();
- }
-
- public virtual void EmitWriteLine (FieldInfo field) {
- throw new NotImplementedException ();
- }
- public virtual void EmitWriteLine (LocalBuilder lbuilder) {
- throw new NotImplementedException ();
- }
- public virtual void EmitWriteLine (string val) {
- throw new NotImplementedException ();
- }
-
- public virtual void EndExceptionBlock () {
- if (open_blocks.Count <= 0)
- throw new NotSupportedException ("Not in an exception block");
- InternalEndClause ();
- MarkLabel (ex_handlers [cur_block].end);
- ex_handlers [cur_block].End (code_len);
- ex_handlers [cur_block].Debug (cur_block);
- //System.Console.WriteLine ("End Block {0} (handlers: {1})", cur_block, ex_handlers [cur_block].NumHandlers ());
- open_blocks.Pop ();
- if (open_blocks.Count > 0)
- cur_block = (int)open_blocks.Peek ();
- //Console.WriteLine ("curblock restored to {0}", cur_block);
- //throw new NotImplementedException ();
- }
- public virtual void EndScope () {
- if (sym_writer != null) {
- sym_writer.CloseScope (code_len);
- scopes.Pop ();
- }
- }
- public virtual void MarkLabel (Label loc) {
- if (loc.label < 0 || loc.label >= num_labels)
- throw new System.ArgumentException ("The label is not valid");
- if (label_to_addr [loc.label] >= 0)
- throw new System.ArgumentException ("The label was already defined");
- label_to_addr [loc.label] = code_len;
- }
- public virtual void MarkSequencePoint (ISymbolDocumentWriter document, int startLine,
- int startColumn, int endLine, int endColumn) {
- if (sym_writer == null)
- return;
-
- int[] offsets = { code_len };
- int[] startLines = { startLine };
- int[] startColumns = { startColumn };
- int[] endLines = { endLine };
- int[] endColumns = { endColumn };
-
- sym_writer.DefineSequencePoints (document, offsets, startLines, startColumns,
- endLines, endColumns);
- }
- public virtual void ThrowException (Type exceptionType) {
- throw new NotImplementedException ();
- }
- public void UsingNamespace (String usingNamespace) {
- throw new NotImplementedException ();
- }
-
- internal void label_fixup () {
- int i;
- for (i = 0; i < num_fixups; ++i) {
- int diff = label_to_addr [fixups [i].label_idx] - fixups [i].label_base;
- if (fixups [i].size == 1) {
- code [fixups [i].pos] = (byte)((sbyte) diff - 1);
- } else {
- int old_cl = code_len;
- code_len = fixups [i].pos;
- emit_int (diff - 4);
- code_len = old_cl;
- }
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/Label.cs b/mcs/class/corlib/System.Reflection.Emit/Label.cs
deleted file mode 100644
index 19be26c6dea..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/Label.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.Emit/Label.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection.Emit {
- [Serializable]
- public struct Label {
- internal int label;
-
- internal Label (int val) {
- label = val;
- }
-
- [MonoTODO]
- public override bool Equals (object obj) {
- /* FIXME */
- return false;
- }
-
- public override int GetHashCode () {
- return label.GetHashCode ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs
deleted file mode 100755
index db7f05c30ec..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/LocalBuilder.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-
-//
-// System.Reflection.Emit/LocalBuilder.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Martin Baulig (martin@gnome.org)
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001, 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Diagnostics.SymbolStore;
-
-namespace System.Reflection.Emit {
- public sealed class LocalBuilder {
- //
- // These are kept in sync with reflection.h
- //
- #region Sync with reflection.h
- private Type type;
- private string name;
- #endregion
-
- //
- // Order does not matter after here
- //
- private ModuleBuilder module;
- internal uint position;
-
- internal LocalBuilder (ModuleBuilder m, Type t)
- {
- this.module = m;
- this.type = t;
- }
- public void SetLocalSymInfo (string lname, int startOffset, int endOffset)
- {
- this.name = lname;
-
- module.SymWriter_DefineLocalVariable (lname, this, FieldAttributes.Private,
- (int) position, startOffset, endOffset);
- }
-
- public void SetLocalSymInfo (string lname)
- {
- SetLocalSymInfo (lname, 0, 0);
- }
-
-
- public Type LocalType
- {
- get {
- return type;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
deleted file mode 100755
index 175e91e0521..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-
-//
-// System.Reflection.Emit/MethodBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public sealed class MethodBuilder : MethodInfo {
- private RuntimeMethodHandle mhandle;
- private Type rtype;
- private Type[] parameters;
- private MethodAttributes attrs;
- private MethodImplAttributes iattrs;
- private string name;
- private int table_idx;
- private byte[] code;
- private ILGenerator ilgen;
- private TypeBuilder type;
- private ParameterBuilder[] pinfo;
- private CustomAttributeBuilder[] cattrs;
- private MethodInfo override_method;
- private string pi_dll;
- private string pi_entry;
- private CharSet ncharset;
- private CallingConvention native_cc;
- private CallingConventions call_conv;
- private bool init_locals = true;
-
- internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
- this.name = name;
- this.attrs = attributes;
- this.call_conv = callingConvention;
- this.rtype = returnType;
- if (parameterTypes != null) {
- this.parameters = new Type [parameterTypes.Length];
- System.Array.Copy (parameterTypes, this.parameters, parameterTypes.Length);
- }
- type = tb;
- table_idx = get_next_table_index (this, 0x06, true);
- //Console.WriteLine ("index for "+name+" set to "+table_idx.ToString());
- }
-
- internal MethodBuilder (TypeBuilder tb, string name, MethodAttributes attributes,
- CallingConventions callingConvention, Type returnType, Type[] parameterTypes,
- String dllName, String entryName, CallingConvention nativeCConv, CharSet nativeCharset)
- : this (tb, name, attributes, callingConvention, returnType, parameterTypes) {
- pi_dll = dllName;
- pi_entry = entryName;
- native_cc = nativeCConv;
- ncharset = nativeCharset;
- }
-
- public bool InitLocals {
- get {return init_locals;}
- set {init_locals = value;}
- }
-
- internal TypeBuilder TypeBuilder {
- get {return type;}
- }
-
- public override Type ReturnType {get {return rtype;}}
- public override Type ReflectedType {get {return type;}}
- public override Type DeclaringType {get {return type;}}
- public override string Name {get {return name;}}
- public override RuntimeMethodHandle MethodHandle {get {return mhandle;}}
- public override MethodAttributes Attributes {get {return attrs;}}
- public override ICustomAttributeProvider ReturnTypeCustomAttributes {
- get {return null;}
- }
- public MethodToken GetToken() {
- return new MethodToken(0x06000000 | table_idx);
- }
-
- public override MethodInfo GetBaseDefinition() {
- return null;
- }
- public override MethodImplAttributes GetMethodImplementationFlags() {
- return iattrs;
- }
- public override ParameterInfo[] GetParameters() {
- if ((parameters == null) || (pinfo == null))
- return null;
-
- ParameterInfo[] retval = new ParameterInfo [parameters.Length - 1];
- for (int i = 1; i < parameters.Length; i++) {
- if (pinfo [i] == null)
- return null;
-
- retval [i - 1] = new ParameterInfo (pinfo [i], parameters [i - 1], this);
- }
-
- return retval;
- }
-
- public void CreateMethodBody( byte[] il, int count) {
- code = new byte [count];
- System.Array.Copy(il, code, count);
- }
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- return null;
- }
- public override bool IsDefined (Type attribute_type, bool inherit) {
- return false;
- }
- public override object[] GetCustomAttributes( bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return null;
- }
- public ILGenerator GetILGenerator () {
- return GetILGenerator (256);
- }
- public ILGenerator GetILGenerator (int size) {
- ilgen = new ILGenerator (this, size);
- return ilgen;
- }
-
- [MonoTODO]
- public ParameterBuilder DefineParameter (int position, ParameterAttributes attributes, string strParamName)
- {
- ParameterBuilder pb = new ParameterBuilder (this, position, attributes, strParamName);
- // check position
- if (pinfo == null)
- pinfo = new ParameterBuilder [parameters.Length + 1];
- pinfo [position] = pb;
- return pb;
- }
-
- internal void fixup () {
- if (ilgen != null)
- ilgen.label_fixup ();
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public void SetImplementationFlags( MethodImplAttributes attributes) {
- iattrs = attributes;
- }
- internal override int get_next_table_index (object obj, int table, bool inc) {
- return type.get_next_table_index (obj, table, inc);
- }
-
- internal void set_override (MethodInfo mdecl) {
- override_method = mdecl;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/MethodToken.cs b/mcs/class/corlib/System.Reflection.Emit/MethodToken.cs
deleted file mode 100644
index a08d4247571..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/MethodToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// MethodToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Method.
- /// </summary>
- [Serializable]
- public struct MethodToken {
-
- internal int tokValue;
-
- public static readonly MethodToken Empty;
-
-
- static MethodToken ()
- {
- Empty = new MethodToken ();
- }
-
-
- internal MethodToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is MethodToken;
-
- if (res) {
- MethodToken that = (MethodToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// MethodToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Method.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
deleted file mode 100644
index 52399fdd09f..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ModuleBuilder.cs
+++ /dev/null
@@ -1,294 +0,0 @@
-
-//
-// System.Reflection.Emit/ModuleBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Diagnostics.SymbolStore;
-using System.IO;
-
-namespace System.Reflection.Emit {
- public class ModuleBuilder : Module {
- private TypeBuilder[] types;
- private CustomAttributeBuilder[] cattrs;
- private byte[] guid;
- private int table_idx;
- private AssemblyBuilder assemblyb;
- private ISymbolWriter symbol_writer;
- private MethodInfo symwriter_define_local;
- Hashtable name_cache;
-
- internal ModuleBuilder (AssemblyBuilder assb, string name, string fullyqname, bool emitSymbolInfo) {
- this.name = this.scopename = name;
- this.fqname = fullyqname;
- this.assembly = this.assemblyb = assb;
- guid = Guid.NewGuid().ToByteArray ();
- table_idx = get_next_table_index (this, 0x00, true);
- name_cache = new Hashtable ();
-
- if (emitSymbolInfo)
- GetSymbolWriter (fullyqname);
- }
-
- internal void GetSymbolWriter (string filename)
- {
- Assembly assembly;
- try {
- assembly = Assembly.Load ("Mono.CSharp.Debugger");
- } catch (FileNotFoundException) {
- return;
- }
-
- Type type = assembly.GetType ("Mono.CSharp.Debugger.MonoSymbolWriter");
- if (type == null)
- return;
-
- if (assemblyb.methods == null)
- assemblyb.methods = new ArrayList ();
-
- // First get the constructor.
- {
- Type[] arg_types = new Type [3];
- arg_types [0] = typeof (ModuleBuilder);
- arg_types [1] = typeof (string);
- arg_types [2] = typeof (ArrayList);
- ConstructorInfo constructor = type.GetConstructor (arg_types);
-
- object[] args = new object [3];
- args [0] = this;
- args [1] = filename;
- args [2] = assemblyb.methods;
-
- if (constructor == null)
- return;
-
- Object instance = constructor.Invoke (args);
- if (instance == null)
- return;
-
- if (!(instance is ISymbolWriter))
- return;
-
- symbol_writer = (ISymbolWriter) instance;
- }
-
- // Get the DefineLocalVariable method.
- {
- Type[] arg_types = new Type [6];
- arg_types [0] = typeof (string);
- arg_types [1] = typeof (LocalBuilder);
- arg_types [2] = typeof (FieldAttributes);
- arg_types [3] = typeof (int);
- arg_types [4] = typeof (int);
- arg_types [5] = typeof (int);
-
- symwriter_define_local = type.GetMethod ("DefineLocalVariable", arg_types);
-
- if (symwriter_define_local == null)
- throw new NotSupportedException ();
- }
- }
-
- internal void SymWriter_DefineLocalVariable (string name, LocalBuilder local,
- FieldAttributes attributes,
- int position, int startOffset, int endOffset)
- {
- if ((symbol_writer == null) || (symwriter_define_local == null))
- return;
-
- object[] args = new object [6];
- args [0] = name;
- args [1] = local;
- args [2] = attributes;
- args [3] = position;
- args [4] = startOffset;
- args [5] = endOffset;
-
- symwriter_define_local.Invoke (symbol_writer, args);
- }
-
- public override string FullyQualifiedName {get { return fqname;}}
-
- [MonoTODO]
- public TypeBuilder DefineType (string name) {
- // FIXME: LAMESPEC: what other attributes should we use here as default?
- return DefineType (name, TypeAttributes.Public, typeof(object), null);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr) {
- return DefineType (name, attr, typeof(object), null);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent) {
- return DefineType (name, attr, parent, null);
- }
-
- private TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packsize, int typesize) {
- TypeBuilder res = new TypeBuilder (this, name, attr, parent, interfaces, packsize, typesize);
- if (types != null) {
- TypeBuilder[] new_types = new TypeBuilder [types.Length + 1];
- System.Array.Copy (types, new_types, types.Length);
- new_types [types.Length] = res;
- types = new_types;
- } else {
- types = new TypeBuilder [1];
- types [0] = res;
- }
- name_cache.Add (name, res);
- return res;
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
- return DefineType (name, attr, parent, interfaces, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, int typesize) {
- return DefineType (name, attr, parent, null, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, PackingSize packsize) {
- return DefineType (name, attr, parent, null, packsize, TypeBuilder.UnspecifiedTypeSize);
- }
-
- public TypeBuilder DefineType (string name, TypeAttributes attr, Type parent, PackingSize packsize, int typesize) {
- return DefineType (name, attr, parent, null, packsize, typesize);
- }
-
- public MethodInfo GetArrayMethod( Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
- return new MonoArrayMethod (arrayClass, methodName, callingConvention, returnType, parameterTypes);
- }
-
- public EnumBuilder DefineEnum( string name, TypeAttributes visibility, Type underlyingType) {
- EnumBuilder eb = new EnumBuilder (this, name, visibility, underlyingType);
- return eb;
- }
-
- public override Type GetType( string className) {
- return GetType (className, false, false);
- }
-
- public override Type GetType( string className, bool ignoreCase) {
- return GetType (className, false, ignoreCase);
- }
-
- private TypeBuilder search_in_array (TypeBuilder[] arr, string className, bool ignoreCase) {
- int i;
- if (arr == types && !ignoreCase)
- return (TypeBuilder)name_cache [className];
- for (i = 0; i < arr.Length; ++i) {
- if (String.Compare (className, arr [i].FullName, ignoreCase) == 0) {
- return arr [i];
- }
- }
- return null;
- }
-
- private TypeBuilder search_nested_in_array (TypeBuilder[] arr, string className, bool ignoreCase) {
- int i;
- for (i = 0; i < arr.Length; ++i) {
- if (String.Compare (className, arr [i].Name, ignoreCase) == 0)
- return arr [i];
- }
- return null;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Type create_modified_type (TypeBuilder tb, string modifiers);
-
- static char[] type_modifiers = {'&', '[', '*'};
-
- private TypeBuilder GetMaybeNested (TypeBuilder t, string className, bool ignoreCase) {
- int subt;
- string pname, rname;
-
- subt = className.IndexOf ('+');
- if (subt < 0) {
- if (t.subtypes != null)
- return search_nested_in_array (t.subtypes, className, ignoreCase);
- return null;
- }
- if (t.subtypes != null) {
- pname = className.Substring (0, subt);
- rname = className.Substring (subt + 1);
- TypeBuilder result = search_nested_in_array (t.subtypes, pname, ignoreCase);
- if (result != null)
- return GetMaybeNested (result, rname, ignoreCase);
- }
- return null;
- }
-
- public override Type GetType( string className, bool throwOnError, bool ignoreCase) {
- int subt;
- string orig = className;
- string modifiers;
- TypeBuilder result = null;
-
- if (types == null && throwOnError)
- throw new TypeLoadException (className);
-
- subt = className.IndexOfAny (type_modifiers);
- if (subt >= 0) {
- modifiers = className.Substring (subt);
- className = className.Substring (0, subt);
- } else
- modifiers = null;
-
- subt = className.IndexOf ('+');
- if (subt < 0) {
- if (types != null)
- result = search_in_array (types, className, ignoreCase);
- } else {
- string pname, rname;
- pname = className.Substring (0, subt);
- rname = className.Substring (subt + 1);
- result = search_in_array (types, pname, ignoreCase);
- if (result != null)
- result = GetMaybeNested (result, rname, ignoreCase);
- }
- if ((result == null) && throwOnError)
- throw new TypeLoadException (orig);
- if (result != null && (modifiers != null))
- return create_modified_type (result, modifiers);
- return result;
- }
-
- internal int get_next_table_index (object obj, int table, bool inc) {
- return assemblyb.get_next_table_index (obj, table, inc);
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
- public ISymbolWriter GetSymWriter () {
- return symbol_writer;
- }
-
- public ISymbolDocumentWriter DefineDocument (string url, Guid language, Guid languageVendor, Guid documentType) {
- if (symbol_writer == null)
- throw new InvalidOperationException ();
-
- return symbol_writer.DefineDocument (url, language, languageVendor, documentType);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs b/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs
deleted file mode 100755
index 130cd3e5623..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/MonoArrayMethod.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// System.Reflection/MonoMethod.cs
-// The class used to represent methods from the mono runtime.
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
- internal class MonoArrayMethod: MethodInfo {
- internal RuntimeMethodHandle mhandle;
- internal Type parent;
- internal Type ret;
- internal Type[] parameters;
- internal string name;
- internal int table_idx;
- internal CallingConventions call_conv;
-
- internal MonoArrayMethod (Type arrayClass, string methodName, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
- name = methodName;
- parent = arrayClass;
- ret = returnType;
- parameters = (Type[])parameterTypes.Clone();
- call_conv = callingConvention;
- }
-
- [MonoTODO]
- public override MethodInfo GetBaseDefinition() {
- return this; /* FIXME */
- }
- public override Type ReturnType {
- get {
- return ret;
- }
- }
- [MonoTODO]
- public override ICustomAttributeProvider ReturnTypeCustomAttributes {
- get {return null;}
- }
-
- [MonoTODO]
- public override MethodImplAttributes GetMethodImplementationFlags() {
- return (MethodImplAttributes)0;
- }
-
- [MonoTODO]
- public override ParameterInfo[] GetParameters() {
- return new ParameterInfo [0];
- }
-
- [MonoTODO]
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- throw new NotImplementedException ();
- }
-
- public override RuntimeMethodHandle MethodHandle {
- get {return mhandle;}
- }
- [MonoTODO]
- public override MethodAttributes Attributes {
- get {
- return (MethodAttributes)0;
- }
- }
-
- public override Type ReflectedType {
- get {
- return parent;
- }
- }
- public override Type DeclaringType {
- get {
- return parent;
- }
- }
- public override string Name {
- get {
- return name;
- }
- }
-
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public override string ToString () {
- string parms = "";
- ParameterInfo[] p = GetParameters ();
- for (int i = 0; i < p.Length; ++i) {
- if (i > 0)
- parms = parms + ", ";
- parms = parms + p [i].ParameterType.Name;
- }
- return ReturnType.Name+" "+Name+"("+parms+")";
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/OpCode.cs b/mcs/class/corlib/System.Reflection.Emit/OpCode.cs
deleted file mode 100644
index 1bdd19fcc9b..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OpCode.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// System.Reflection.Emit.OpCode
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-
-namespace System.Reflection.Emit {
-
- public struct OpCode {
-
- internal string name;
- internal int size;
- internal OpCodeType type;
- internal OperandType operandType;
- internal StackBehaviour pop;
- internal StackBehaviour push;
- internal FlowControl flowCtrl;
- internal byte op1;
- internal byte op2;
-
- internal OpCode (string name, int size,
- OpCodeType opcodeType,
- OperandType operandType,
- StackBehaviour pop,
- StackBehaviour push,
- FlowControl flowCtrl,
- byte op1, byte op2)
- {
- this.name = name;
- this.size = size;
- this.type = opcodeType;
- this.operandType = operandType;
- this.pop = pop;
- this.push = push;
- this.flowCtrl = flowCtrl;
- this.op1 = op1;
- this.op2 = op2;
- }
-
-
-
- /// <summary>
- /// </summary>
- public string Name {
- get {
- return name;
- }
- }
-
- /// <summary>
- /// </summary>
- public int Size {
- get {
- return size;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public OpCodeType OpCodeType {
- get {
- return type;
- }
- }
-
- /// <summary>
- /// </summary>
- public OperandType OperandType {
- get {
- return operandType;
- }
- }
-
- /// <summary>
- /// </summary>
- public FlowControl FlowControl {
- get {
- return flowCtrl;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public StackBehaviour StackBehaviourPop {
- get {
- return pop;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public StackBehaviour StackBehaviourPush {
- get {
- return push;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public short Value {
- get {
- if (size == 1) {
- return op2;
- } else {
- // two byte instruction - combine
- // give the same values as the mscorlib impl
- // this makes the Value property useless
- return (short) ((op1 << 2) | op2);
- }
- }
- }
-
- } // OpCode
-
-} // System.Reflection.Emit
diff --git a/mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs b/mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs
deleted file mode 100644
index 2733369ecbe..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OpCodeType.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// OpCodeType.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes the types of MSIL instructions.
- /// </summary>
- public enum OpCodeType {
-
- /// <summary>
- /// "Ignorable" instruction.
- /// Such instruction are used to supply
- /// additional information to particular
- /// MSIL processor.
- /// </summary>
- Annotation = 0,
-
- /// <summary>
- /// Denotes "shorthand" instruction.
- /// Such instructions take less space
- /// than their full-size equivalents
- /// (ex. ldarg.0 vs. ldarg 0).
- /// </summary>
- Macro = 1,
-
- /// <summary>
- /// Denotes instruction reserved for internal use.
- /// </summary>
- Nternal = 2,
-
- /// <summary>
- /// Denotes instruction to deal with objects.
- /// (ex. ldobj).
- /// </summary>
- Objmodel = 3,
-
- /// <summary>
- /// </summary>
- Prefix = 4,
-
- /// <summary>
- /// </summary>
- Primitive = 5
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/OpCodes.cs b/mcs/class/corlib/System.Reflection.Emit/OpCodes.cs
deleted file mode 100644
index 1626d3f4ddb..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OpCodes.cs
+++ /dev/null
@@ -1,486 +0,0 @@
-// OpCodes.cs
-// Mechanically generated - DO NOT EDIT!
-//
-// (C) Sergey Chaban (serge@wildwestsoftware.com)
-
-using System;
-using System.Reflection.Emit;
-
-namespace System.Reflection.Emit {
-
-
- public class OpCodes {
- public static readonly OpCode Add;
- public static readonly OpCode Add_Ovf;
- public static readonly OpCode Add_Ovf_Un;
- public static readonly OpCode And;
- public static readonly OpCode Arglist;
- public static readonly OpCode Beq;
- public static readonly OpCode Beq_S;
- public static readonly OpCode Bge;
- public static readonly OpCode Bge_S;
- public static readonly OpCode Bge_Un;
- public static readonly OpCode Bge_Un_S;
- public static readonly OpCode Bgt;
- public static readonly OpCode Bgt_S;
- public static readonly OpCode Bgt_Un;
- public static readonly OpCode Bgt_Un_S;
- public static readonly OpCode Ble;
- public static readonly OpCode Ble_S;
- public static readonly OpCode Ble_Un;
- public static readonly OpCode Ble_Un_S;
- public static readonly OpCode Blt;
- public static readonly OpCode Blt_S;
- public static readonly OpCode Blt_Un;
- public static readonly OpCode Blt_Un_S;
- public static readonly OpCode Bne_Un;
- public static readonly OpCode Bne_Un_S;
- public static readonly OpCode Box;
- public static readonly OpCode Boxval;
- public static readonly OpCode Br;
- public static readonly OpCode Br_S;
- public static readonly OpCode Break;
- public static readonly OpCode Brfalse;
- public static readonly OpCode Brfalse_S;
- public static readonly OpCode Brtrue;
- public static readonly OpCode Brtrue_S;
- public static readonly OpCode Call;
- public static readonly OpCode Calli;
- public static readonly OpCode Callvirt;
- public static readonly OpCode Castclass;
- public static readonly OpCode Ceq;
- public static readonly OpCode Cgt;
- public static readonly OpCode Cgt_Un;
- public static readonly OpCode Ckfinite;
- public static readonly OpCode Clt;
- public static readonly OpCode Clt_Un;
- public static readonly OpCode Conv_I;
- public static readonly OpCode Conv_I1;
- public static readonly OpCode Conv_I2;
- public static readonly OpCode Conv_I4;
- public static readonly OpCode Conv_I8;
- public static readonly OpCode Conv_Ovf_I;
- public static readonly OpCode Conv_Ovf_I_Un;
- public static readonly OpCode Conv_Ovf_I1;
- public static readonly OpCode Conv_Ovf_I1_Un;
- public static readonly OpCode Conv_Ovf_I2;
- public static readonly OpCode Conv_Ovf_I2_Un;
- public static readonly OpCode Conv_Ovf_I4;
- public static readonly OpCode Conv_Ovf_I4_Un;
- public static readonly OpCode Conv_Ovf_I8;
- public static readonly OpCode Conv_Ovf_I8_Un;
- public static readonly OpCode Conv_Ovf_U;
- public static readonly OpCode Conv_Ovf_U_Un;
- public static readonly OpCode Conv_Ovf_U1;
- public static readonly OpCode Conv_Ovf_U1_Un;
- public static readonly OpCode Conv_Ovf_U2;
- public static readonly OpCode Conv_Ovf_U2_Un;
- public static readonly OpCode Conv_Ovf_U4;
- public static readonly OpCode Conv_Ovf_U4_Un;
- public static readonly OpCode Conv_Ovf_U8;
- public static readonly OpCode Conv_Ovf_U8_Un;
- public static readonly OpCode Conv_R_Un;
- public static readonly OpCode Conv_R4;
- public static readonly OpCode Conv_R8;
- public static readonly OpCode Conv_U;
- public static readonly OpCode Conv_U1;
- public static readonly OpCode Conv_U2;
- public static readonly OpCode Conv_U4;
- public static readonly OpCode Conv_U8;
- public static readonly OpCode Cpblk;
- public static readonly OpCode Cpobj;
- public static readonly OpCode Div;
- public static readonly OpCode Div_Un;
- public static readonly OpCode Dup;
- public static readonly OpCode Endfilter;
- public static readonly OpCode Endfinally;
- public static readonly OpCode Initblk;
- public static readonly OpCode Initobj;
- public static readonly OpCode Isinst;
- public static readonly OpCode Jmp;
- public static readonly OpCode Ldarg;
- public static readonly OpCode Ldarg_0;
- public static readonly OpCode Ldarg_1;
- public static readonly OpCode Ldarg_2;
- public static readonly OpCode Ldarg_3;
- public static readonly OpCode Ldarg_S;
- public static readonly OpCode Ldarga;
- public static readonly OpCode Ldarga_S;
- public static readonly OpCode Ldc_I4;
- public static readonly OpCode Ldc_I4_0;
- public static readonly OpCode Ldc_I4_1;
- public static readonly OpCode Ldc_I4_2;
- public static readonly OpCode Ldc_I4_3;
- public static readonly OpCode Ldc_I4_4;
- public static readonly OpCode Ldc_I4_5;
- public static readonly OpCode Ldc_I4_6;
- public static readonly OpCode Ldc_I4_7;
- public static readonly OpCode Ldc_I4_8;
- public static readonly OpCode Ldc_I4_M1;
- public static readonly OpCode Ldc_I4_S;
- public static readonly OpCode Ldc_I8;
- public static readonly OpCode Ldc_R4;
- public static readonly OpCode Ldc_R8;
- public static readonly OpCode Ldelem_I;
- public static readonly OpCode Ldelem_I1;
- public static readonly OpCode Ldelem_I2;
- public static readonly OpCode Ldelem_I4;
- public static readonly OpCode Ldelem_I8;
- public static readonly OpCode Ldelem_R4;
- public static readonly OpCode Ldelem_R8;
- public static readonly OpCode Ldelem_Ref;
- public static readonly OpCode Ldelem_U1;
- public static readonly OpCode Ldelem_U2;
- public static readonly OpCode Ldelem_U4;
- public static readonly OpCode Ldelema;
- public static readonly OpCode Ldfld;
- public static readonly OpCode Ldflda;
- public static readonly OpCode Ldftn;
- public static readonly OpCode Ldind_I;
- public static readonly OpCode Ldind_I1;
- public static readonly OpCode Ldind_I2;
- public static readonly OpCode Ldind_I4;
- public static readonly OpCode Ldind_I8;
- public static readonly OpCode Ldind_R4;
- public static readonly OpCode Ldind_R8;
- public static readonly OpCode Ldind_Ref;
- public static readonly OpCode Ldind_U1;
- public static readonly OpCode Ldind_U2;
- public static readonly OpCode Ldind_U4;
- public static readonly OpCode Ldlen;
- public static readonly OpCode Ldloc;
- public static readonly OpCode Ldloc_0;
- public static readonly OpCode Ldloc_1;
- public static readonly OpCode Ldloc_2;
- public static readonly OpCode Ldloc_3;
- public static readonly OpCode Ldloc_S;
- public static readonly OpCode Ldloca;
- public static readonly OpCode Ldloca_S;
- public static readonly OpCode Ldnull;
- public static readonly OpCode Ldobj;
- public static readonly OpCode Ldsfld;
- public static readonly OpCode Ldsflda;
- public static readonly OpCode Ldstr;
- public static readonly OpCode Ldtoken;
- public static readonly OpCode Ldvirtftn;
- public static readonly OpCode Leave;
- public static readonly OpCode Leave_S;
- public static readonly OpCode Localloc;
- public static readonly OpCode Mkrefany;
- public static readonly OpCode Mul;
- public static readonly OpCode Mul_Ovf;
- public static readonly OpCode Mul_Ovf_Un;
- public static readonly OpCode Neg;
- public static readonly OpCode Newarr;
- public static readonly OpCode Newobj;
- public static readonly OpCode Nop;
- public static readonly OpCode Not;
- public static readonly OpCode Or;
- public static readonly OpCode Pop;
- public static readonly OpCode Prefix1;
- public static readonly OpCode Prefix2;
- public static readonly OpCode Prefix3;
- public static readonly OpCode Prefix4;
- public static readonly OpCode Prefix5;
- public static readonly OpCode Prefix6;
- public static readonly OpCode Prefix7;
- public static readonly OpCode Prefixref;
- public static readonly OpCode Refanytype;
- public static readonly OpCode Refanyval;
- public static readonly OpCode Rem;
- public static readonly OpCode Rem_Un;
- public static readonly OpCode Ret;
- public static readonly OpCode Rethrow;
- public static readonly OpCode Shl;
- public static readonly OpCode Shr;
- public static readonly OpCode Shr_Un;
- public static readonly OpCode Sizeof;
- public static readonly OpCode Starg;
- public static readonly OpCode Starg_S;
- public static readonly OpCode Stelem_I;
- public static readonly OpCode Stelem_I1;
- public static readonly OpCode Stelem_I2;
- public static readonly OpCode Stelem_I4;
- public static readonly OpCode Stelem_I8;
- public static readonly OpCode Stelem_R4;
- public static readonly OpCode Stelem_R8;
- public static readonly OpCode Stelem_Ref;
- public static readonly OpCode Stfld;
- public static readonly OpCode Stind_I;
- public static readonly OpCode Stind_I1;
- public static readonly OpCode Stind_I2;
- public static readonly OpCode Stind_I4;
- public static readonly OpCode Stind_I8;
- public static readonly OpCode Stind_R4;
- public static readonly OpCode Stind_R8;
- public static readonly OpCode Stind_Ref;
- public static readonly OpCode Stloc;
- public static readonly OpCode Stloc_0;
- public static readonly OpCode Stloc_1;
- public static readonly OpCode Stloc_2;
- public static readonly OpCode Stloc_3;
- public static readonly OpCode Stloc_S;
- public static readonly OpCode Stobj;
- public static readonly OpCode Stsfld;
- public static readonly OpCode Sub;
- public static readonly OpCode Sub_Ovf;
- public static readonly OpCode Sub_Ovf_Un;
- public static readonly OpCode Switch;
- public static readonly OpCode Tailcall;
- public static readonly OpCode Throw;
- public static readonly OpCode Unaligned;
- public static readonly OpCode Unbox;
- public static readonly OpCode Volatile;
- public static readonly OpCode Xor;
-
-
- private OpCodes () {}
-
- static OpCodes ()
- {
-
- Nop = new OpCode("nop", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x0);
- Arglist = new OpCode("arglist", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x0);
- Break = new OpCode("break", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Break, 0xFF, 0x1);
- Ceq = new OpCode("ceq", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x1);
- Starg_S = new OpCode("starg.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x10);
- Ldloc_S = new OpCode("ldloc.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x11);
- Endfilter = new OpCode("endfilter", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Return, 0xFE, 0x11);
- Ldloca_S = new OpCode("ldloca.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x12);
- Unaligned = new OpCode("unaligned.", 2, OpCodeType.Prefix, OperandType.ShortInlineI, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFE, 0x12);
- Stloc_S = new OpCode("stloc.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x13);
- Volatile = new OpCode("volatile.", 2, OpCodeType.Prefix, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFE, 0x13);
- Ldnull = new OpCode("ldnull", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x14);
- Tailcall = new OpCode("tail.", 2, OpCodeType.Prefix, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFE, 0x14);
- Ldc_I4_M1 = new OpCode("ldc.i4.m1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x15);
- Initobj = new OpCode("initobj", 2, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0x15);
- Ldc_I4_0 = new OpCode("ldc.i4.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x16);
- Ldc_I4_1 = new OpCode("ldc.i4.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x17);
- Cpblk = new OpCode("cpblk", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0x17);
- Ldc_I4_2 = new OpCode("ldc.i4.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x18);
- Initblk = new OpCode("initblk", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0x18);
- Ldc_I4_3 = new OpCode("ldc.i4.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x19);
- Ldc_I4_4 = new OpCode("ldc.i4.4", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1A);
- Rethrow = new OpCode("rethrow", 2, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Throw, 0xFE, 0x1A);
- Ldc_I4_5 = new OpCode("ldc.i4.5", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1B);
- Ldc_I4_6 = new OpCode("ldc.i4.6", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1C);
- Sizeof = new OpCode("sizeof", 2, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x1C);
- Ldc_I4_7 = new OpCode("ldc.i4.7", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1D);
- Refanytype = new OpCode("refanytype", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x1D);
- Ldc_I4_8 = new OpCode("ldc.i4.8", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1E);
- Ldc_I4_S = new OpCode("ldc.i4.s", 1, OpCodeType.Macro, OperandType.ShortInlineI, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x1F);
- Ldarg_0 = new OpCode("ldarg.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x2);
- Cgt = new OpCode("cgt", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x2);
- Ldc_I4 = new OpCode("ldc.i4", 1, OpCodeType.Primitive, OperandType.InlineI, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x20);
- Ldc_I8 = new OpCode("ldc.i8", 1, OpCodeType.Primitive, OperandType.InlineI8, StackBehaviour.Pop0, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x21);
- Ldc_R4 = new OpCode("ldc.r4", 1, OpCodeType.Primitive, OperandType.ShortInlineR, StackBehaviour.Pop0, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x22);
- Ldc_R8 = new OpCode("ldc.r8", 1, OpCodeType.Primitive, OperandType.InlineR, StackBehaviour.Pop0, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x23);
- Dup = new OpCode("dup", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push1_push1, FlowControl.Next, 0xFF, 0x25);
- Pop = new OpCode("pop", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x26);
- Jmp = new OpCode("jmp", 1, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Call, 0xFF, 0x27);
- Call = new OpCode("call", 1, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Varpop, StackBehaviour.Varpush, FlowControl.Call, 0xFF, 0x28);
- Calli = new OpCode("calli", 1, OpCodeType.Primitive, OperandType.InlineSig, StackBehaviour.Varpop, StackBehaviour.Varpush, FlowControl.Call, 0xFF, 0x29);
- Ret = new OpCode("ret", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Varpop, StackBehaviour.Push0, FlowControl.Return, 0xFF, 0x2A);
- Br_S = new OpCode("br.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0x2B);
- Brfalse_S = new OpCode("brfalse.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2C);
- Brtrue_S = new OpCode("brtrue.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2D);
- Beq_S = new OpCode("beq.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2E);
- Bge_S = new OpCode("bge.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x2F);
- Ldarg_1 = new OpCode("ldarg.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x3);
- Cgt_Un = new OpCode("cgt.un", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x3);
- Bgt_S = new OpCode("bgt.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x30);
- Ble_S = new OpCode("ble.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x31);
- Blt_S = new OpCode("blt.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x32);
- Bne_Un_S = new OpCode("bne.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x33);
- Bge_Un_S = new OpCode("bge.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x34);
- Bgt_Un_S = new OpCode("bgt.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x35);
- Ble_Un_S = new OpCode("ble.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x36);
- Blt_Un_S = new OpCode("blt.un.s", 1, OpCodeType.Macro, OperandType.ShortInlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x37);
- Br = new OpCode("br", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0x38);
- Brfalse = new OpCode("brfalse", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x39);
- Brtrue = new OpCode("brtrue", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3A);
- Beq = new OpCode("beq", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3B);
- Bge = new OpCode("bge", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3C);
- Bgt = new OpCode("bgt", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3D);
- Ble = new OpCode("ble", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3E);
- Blt = new OpCode("blt", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x3F);
- Ldarg_2 = new OpCode("ldarg.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x4);
- Clt = new OpCode("clt", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x4);
- Bne_Un = new OpCode("bne.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x40);
- Bge_Un = new OpCode("bge.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x41);
- Bgt_Un = new OpCode("bgt.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x42);
- Ble_Un = new OpCode("ble.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x43);
- Blt_Un = new OpCode("blt.un", 1, OpCodeType.Macro, OperandType.InlineBrTarget, StackBehaviour.Pop1_pop1, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x44);
- Switch = new OpCode("switch", 1, OpCodeType.Primitive, OperandType.InlineSwitch, StackBehaviour.Popi, StackBehaviour.Push0, FlowControl.Cond_Branch, 0xFF, 0x45);
- Ldind_I1 = new OpCode("ldind.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x46);
- Ldind_U1 = new OpCode("ldind.u1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x47);
- Ldind_I2 = new OpCode("ldind.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x48);
- Ldind_U2 = new OpCode("ldind.u2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x49);
- Ldind_I4 = new OpCode("ldind.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x4A);
- Ldind_U4 = new OpCode("ldind.u4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x4B);
- Ldind_I8 = new OpCode("ldind.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x4C);
- Ldind_I = new OpCode("ldind.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x4D);
- Ldind_R4 = new OpCode("ldind.r4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x4E);
- Ldind_R8 = new OpCode("ldind.r8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x4F);
- Ldarg_3 = new OpCode("ldarg.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5);
- Clt_Un = new OpCode("clt.un", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x5);
- Ldind_Ref = new OpCode("ldind.ref", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x50);
- Stind_Ref = new OpCode("stind.ref", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x51);
- Stind_I1 = new OpCode("stind.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x52);
- Stind_I2 = new OpCode("stind.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x53);
- Stind_I4 = new OpCode("stind.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x54);
- Stind_I8 = new OpCode("stind.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x55);
- Stind_R4 = new OpCode("stind.r4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popr4, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x56);
- Stind_R8 = new OpCode("stind.r8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popr8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x57);
- Add = new OpCode("add", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x58);
- Sub = new OpCode("sub", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x59);
- Mul = new OpCode("mul", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5A);
- Div = new OpCode("div", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5B);
- Div_Un = new OpCode("div.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5C);
- Rem = new OpCode("rem", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5D);
- Rem_Un = new OpCode("rem.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5E);
- And = new OpCode("and", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x5F);
- Ldloc_0 = new OpCode("ldloc.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x6);
- Ldftn = new OpCode("ldftn", 2, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x6);
- Or = new OpCode("or", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x60);
- Xor = new OpCode("xor", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x61);
- Shl = new OpCode("shl", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x62);
- Shr = new OpCode("shr", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x63);
- Shr_Un = new OpCode("shr.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x64);
- Neg = new OpCode("neg", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x65);
- Not = new OpCode("not", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x66);
- Conv_I1 = new OpCode("conv.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x67);
- Conv_I2 = new OpCode("conv.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x68);
- Conv_I4 = new OpCode("conv.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x69);
- Conv_I8 = new OpCode("conv.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x6A);
- Conv_R4 = new OpCode("conv.r4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x6B);
- Conv_R8 = new OpCode("conv.r8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x6C);
- Conv_U4 = new OpCode("conv.u4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x6D);
- Conv_U8 = new OpCode("conv.u8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x6E);
- Callvirt = new OpCode("callvirt", 1, OpCodeType.Objmodel, OperandType.InlineMethod, StackBehaviour.Varpop, StackBehaviour.Varpush, FlowControl.Call, 0xFF, 0x6F);
- Ldloc_1 = new OpCode("ldloc.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x7);
- Ldvirtftn = new OpCode("ldvirtftn", 2, OpCodeType.Primitive, OperandType.InlineMethod, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0x7);
- Cpobj = new OpCode("cpobj", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x70);
- Ldobj = new OpCode("ldobj", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x71);
- Ldstr = new OpCode("ldstr", 1, OpCodeType.Objmodel, OperandType.InlineString, StackBehaviour.Pop0, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x72);
- Newobj = new OpCode("newobj", 1, OpCodeType.Objmodel, OperandType.InlineMethod, StackBehaviour.Varpop, StackBehaviour.Pushref, FlowControl.Call, 0xFF, 0x73);
- Castclass = new OpCode("castclass", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x74);
- Isinst = new OpCode("isinst", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x75);
- Conv_R_Un = new OpCode("conv.r.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x76);
- Unbox = new OpCode("unbox", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x79);
- Throw = new OpCode("throw", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref, StackBehaviour.Push0, FlowControl.Throw, 0xFF, 0x7A);
- Ldfld = new OpCode("ldfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Popref, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x7B);
- Ldflda = new OpCode("ldflda", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x7C);
- Stfld = new OpCode("stfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Popref_pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x7D);
- Ldsfld = new OpCode("ldsfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x7E);
- Ldsflda = new OpCode("ldsflda", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x7F);
- Ldloc_2 = new OpCode("ldloc.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x8);
- Stsfld = new OpCode("stsfld", 1, OpCodeType.Objmodel, OperandType.InlineField, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x80);
- Stobj = new OpCode("stobj", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Popi_pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x81);
- Conv_Ovf_I1_Un = new OpCode("conv.ovf.i1.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x82);
- Conv_Ovf_I2_Un = new OpCode("conv.ovf.i2.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x83);
- Conv_Ovf_I4_Un = new OpCode("conv.ovf.i4.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x84);
- Conv_Ovf_I8_Un = new OpCode("conv.ovf.i8.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x85);
- Conv_Ovf_U1_Un = new OpCode("conv.ovf.u1.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x86);
- Conv_Ovf_U2_Un = new OpCode("conv.ovf.u2.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x87);
- Conv_Ovf_U4_Un = new OpCode("conv.ovf.u4.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x88);
- Conv_Ovf_U8_Un = new OpCode("conv.ovf.u8.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x89);
- Conv_Ovf_I_Un = new OpCode("conv.ovf.i.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8A);
- Conv_Ovf_U_Un = new OpCode("conv.ovf.u.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8B);
- Boxval = new OpCode("boxval", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop1, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x8C);
- Box = new OpCode("box", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop1, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x8C);
- Newarr = new OpCode("newarr", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x8D);
- Ldlen = new OpCode("ldlen", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8E);
- Ldelema = new OpCode("ldelema", 1, OpCodeType.Objmodel, OperandType.InlineType, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x8F);
- Ldloc_3 = new OpCode("ldloc.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0x9);
- Ldarg = new OpCode("ldarg", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFE, 0x9);
- Ldelem_I1 = new OpCode("ldelem.i1", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x90);
- Ldelem_U1 = new OpCode("ldelem.u1", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x91);
- Ldelem_I2 = new OpCode("ldelem.i2", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x92);
- Ldelem_U2 = new OpCode("ldelem.u2", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x93);
- Ldelem_I4 = new OpCode("ldelem.i4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x94);
- Ldelem_U4 = new OpCode("ldelem.u4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x95);
- Ldelem_I8 = new OpCode("ldelem.i8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0x96);
- Ldelem_I = new OpCode("ldelem.i", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0x97);
- Ldelem_R4 = new OpCode("ldelem.r4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushr4, FlowControl.Next, 0xFF, 0x98);
- Ldelem_R8 = new OpCode("ldelem.r8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0x99);
- Ldelem_Ref = new OpCode("ldelem.ref", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi, StackBehaviour.Pushref, FlowControl.Next, 0xFF, 0x9A);
- Stelem_I = new OpCode("stelem.i", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9B);
- Stelem_I1 = new OpCode("stelem.i1", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9C);
- Stelem_I2 = new OpCode("stelem.i2", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9D);
- Stelem_I4 = new OpCode("stelem.i4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9E);
- Stelem_I8 = new OpCode("stelem.i8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popi8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0x9F);
- Stloc_0 = new OpCode("stloc.0", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA);
- Ldarga = new OpCode("ldarga", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0xA);
- Stelem_R4 = new OpCode("stelem.r4", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popr4, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA0);
- Stelem_R8 = new OpCode("stelem.r8", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popr8, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA1);
- Stelem_Ref = new OpCode("stelem.ref", 1, OpCodeType.Objmodel, OperandType.InlineNone, StackBehaviour.Popref_popi_popref, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xA2);
- Stloc_1 = new OpCode("stloc.1", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xB);
- Starg = new OpCode("starg", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0xB);
- Conv_Ovf_I1 = new OpCode("conv.ovf.i1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB3);
- Conv_Ovf_U1 = new OpCode("conv.ovf.u1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB4);
- Conv_Ovf_I2 = new OpCode("conv.ovf.i2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB5);
- Conv_Ovf_U2 = new OpCode("conv.ovf.u2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB6);
- Conv_Ovf_I4 = new OpCode("conv.ovf.i4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB7);
- Conv_Ovf_U4 = new OpCode("conv.ovf.u4", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xB8);
- Conv_Ovf_I8 = new OpCode("conv.ovf.i8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0xB9);
- Conv_Ovf_U8 = new OpCode("conv.ovf.u8", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi8, FlowControl.Next, 0xFF, 0xBA);
- Stloc_2 = new OpCode("stloc.2", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xC);
- Ldloc = new OpCode("ldloc", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFE, 0xC);
- Refanyval = new OpCode("refanyval", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xC2);
- Ckfinite = new OpCode("ckfinite", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushr8, FlowControl.Next, 0xFF, 0xC3);
- Mkrefany = new OpCode("mkrefany", 1, OpCodeType.Primitive, OperandType.InlineType, StackBehaviour.Popi, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xC6);
- Stloc_3 = new OpCode("stloc.3", 1, OpCodeType.Macro, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xD);
- Ldloca = new OpCode("ldloca", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0xD);
- Ldtoken = new OpCode("ldtoken", 1, OpCodeType.Primitive, OperandType.InlineTok, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD0);
- Conv_U2 = new OpCode("conv.u2", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD1);
- Conv_U1 = new OpCode("conv.u1", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD2);
- Conv_I = new OpCode("conv.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD3);
- Conv_Ovf_I = new OpCode("conv.ovf.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD4);
- Conv_Ovf_U = new OpCode("conv.ovf.u", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xD5);
- Add_Ovf = new OpCode("add.ovf", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD6);
- Add_Ovf_Un = new OpCode("add.ovf.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD7);
- Mul_Ovf = new OpCode("mul.ovf", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD8);
- Mul_Ovf_Un = new OpCode("mul.ovf.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xD9);
- Sub_Ovf = new OpCode("sub.ovf", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xDA);
- Sub_Ovf_Un = new OpCode("sub.ovf.un", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1_pop1, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xDB);
- Endfinally = new OpCode("endfinally", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Return, 0xFF, 0xDC);
- Leave = new OpCode("leave", 1, OpCodeType.Primitive, OperandType.InlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0xDD);
- Leave_S = new OpCode("leave.s", 1, OpCodeType.Primitive, OperandType.ShortInlineBrTarget, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Branch, 0xFF, 0xDE);
- Stind_I = new OpCode("stind.i", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi_popi, StackBehaviour.Push0, FlowControl.Next, 0xFF, 0xDF);
- Ldarg_S = new OpCode("ldarg.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Push1, FlowControl.Next, 0xFF, 0xE);
- Stloc = new OpCode("stloc", 2, OpCodeType.Primitive, OperandType.InlineVar, StackBehaviour.Pop1, StackBehaviour.Push0, FlowControl.Next, 0xFE, 0xE);
- Conv_U = new OpCode("conv.u", 1, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Pop1, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xE0);
- Ldarga_S = new OpCode("ldarga.s", 1, OpCodeType.Macro, OperandType.ShortInlineVar, StackBehaviour.Pop0, StackBehaviour.Pushi, FlowControl.Next, 0xFF, 0xF);
- Localloc = new OpCode("localloc", 2, OpCodeType.Primitive, OperandType.InlineNone, StackBehaviour.Popi, StackBehaviour.Pushi, FlowControl.Next, 0xFE, 0xF);
- Prefix7 = new OpCode("prefix7", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xF8);
- Prefix6 = new OpCode("prefix6", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xF9);
- Prefix5 = new OpCode("prefix5", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFA);
- Prefix4 = new OpCode("prefix4", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFB);
- Prefix3 = new OpCode("prefix3", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFC);
- Prefix2 = new OpCode("prefix2", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFD);
- Prefix1 = new OpCode("prefix1", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFE);
- Prefixref = new OpCode("prefixref", 1, OpCodeType.Nternal, OperandType.InlineNone, StackBehaviour.Pop0, StackBehaviour.Push0, FlowControl.Meta, 0xFF, 0xFF);
-
-
- }
-
- public static bool TakesSingleByteArgument (OpCode inst)
- {
- OperandType t = inst.OperandType;
-
- // check for short-inline instructions
- return ( t == OperandType.ShortInlineBrTarget
- || t == OperandType.ShortInlineI
- || t == OperandType.ShortInlineR
- || t == OperandType.ShortInlineVar
- );
- }
- }
-
-
-
-
-
-
-} // namespace System.Reflection.Emit
diff --git a/mcs/class/corlib/System.Reflection.Emit/OperandType.cs b/mcs/class/corlib/System.Reflection.Emit/OperandType.cs
deleted file mode 100644
index 669ca53277e..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/OperandType.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-// OperandType.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes the operand types of MSIL instructions.
- /// </summary>
- public enum OperandType {
-
- /// <summary>
- /// </summary>
- InlineBrTarget = 0,
-
- /// <summary>
- /// </summary>
- InlineField = 1,
-
- /// <summary>
- /// </summary>
- InlineI = 2,
-
- /// <summary>
- /// </summary>
- InlineI8 = 3,
-
- /// <summary>
- /// </summary>
- InlineMethod = 4,
-
- /// <summary>
- /// </summary>
- InlineNone = 5,
-
- /// <summary>
- /// </summary>
- InlinePhi = 6,
-
- /// <summary>
- /// </summary>
- InlineR = 7,
-
- /// <summary>
- /// </summary>
- InlineSig = 9,
-
- /// <summary>
- /// </summary>
- InlineString = 0x0A,
-
- /// <summary>
- /// </summary>
- InlineSwitch = 0x0B,
-
- /// <summary>
- /// </summary>
- InlineTok = 0x0C,
-
- /// <summary>
- /// </summary>
- InlineType = 0x0D,
-
- /// <summary>
- /// </summary>
- InlineVar = 0x0E,
-
- /// <summary>
- /// </summary>
- ShortInlineBrTarget = 0x0F,
-
- /// <summary>
- /// </summary>
- ShortInlineI = 0x10,
-
- /// <summary>
- /// </summary>
- ShortInlineR = 0x11,
-
- /// <summary>
- /// </summary>
- ShortInlineVar = 0x12
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs b/mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs
deleted file mode 100644
index 0677897bc82..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PEFileKinds.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace System.Reflection.Emit {
- public enum PEFileKinds {
- Dll = 1,
- ConsoleApplication = 2,
- WindowApplication = 3
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PackingSize.cs b/mcs/class/corlib/System.Reflection.Emit/PackingSize.cs
deleted file mode 100644
index 82c74276386..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PackingSize.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// PackingSize.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Specifies the packing size (data alignment) of a type.
- /// </summary>
- public enum PackingSize {
-
- /// <summary>
- /// The packing size is unspecified.
- /// </summary>
- Unspecified = 0,
-
- /// <summary>
- /// </summary>
- Size1 = 1,
-
- /// <summary>
- /// </summary>
- Size2 = 2,
-
- /// <summary>
- /// </summary>
- Size4 = 4,
-
- /// <summary>
- /// </summary>
- Size8 = 8,
-
- /// <summary>
- /// </summary>
- Size16 = 16
- }
-
-}
-
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs
deleted file mode 100755
index 3b3395896ba..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-//
-// System.Reflection.Emit/ParameterBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- public class ParameterBuilder {
- private MethodBase methodb; /* MethodBuilder or ConstructorBuilder */
- private string name;
- private CustomAttributeBuilder[] cattrs;
- private UnmanagedMarshal marshal_info;
- private ParameterAttributes attrs;
- private int position;
- private int table_idx;
-
- internal ParameterBuilder (MethodBase mb, int pos, ParameterAttributes attributes, string strParamName) {
- name = strParamName;
- position = pos;
- attrs = attributes;
- methodb = mb;
- table_idx = mb.get_next_table_index (this, 0x08, true);
- }
-
- public virtual int Attributes {
- get {return (int)attrs;}
- }
- public bool IsIn {
- get {return ((int)attrs & (int)ParameterAttributes.In) != 0;}
- }
- public bool IsOut {
- get {return ((int)attrs & (int)ParameterAttributes.Out) != 0;}
- }
- public bool IsOptional {
- get {return ((int)attrs & (int)ParameterAttributes.Optional) != 0;}
- }
- public virtual string Name {
- get {return name;}
- }
- public virtual int Position {
- get {return position;}
- }
-
- public virtual ParameterToken GetToken() {
- return new ParameterToken (0x08 | table_idx);
- }
-
- [MonoTODO]
- public virtual void SetConstant( object defaultValue) {
- /* FIXME */
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- string attrname = customBuilder.Ctor.ReflectedType.FullName;
- if (attrname == "System.Runtime.InteropServices.InAttribute") {
- attrs |= ParameterAttributes.In;
- return;
- } else if (attrname == "System.Runtime.InteropServices.OutAttribute") {
- attrs |= ParameterAttributes.Out;
- return;
- } else if (attrname == "System.Runtime.InteropServices.OptionalAttribute") {
- attrs |= ParameterAttributes.Optional;
- return;
- } else if (attrname == "System.Runtime.InteropServices.MarshalAsAttribute") {
- marshal_info = CustomAttributeBuilder.get_umarshal (customBuilder, true);
- /* FIXME: check for errors */
- return;
- }
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
- public virtual void SetMarshal( UnmanagedMarshal unmanagedMarshal) {
- marshal_info = unmanagedMarshal;
- attrs |= ParameterAttributes.HasFieldMarshal;
- }
-
-
-
-
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs b/mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs
deleted file mode 100644
index 21d1895747d..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// ParameterToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Parameter.
- /// </summary>
- [Serializable]
- public struct ParameterToken {
-
- internal int tokValue;
-
- public static readonly ParameterToken Empty;
-
-
- static ParameterToken ()
- {
- Empty = new ParameterToken ();
- }
-
-
- internal ParameterToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is ParameterToken;
-
- if (res) {
- ParameterToken that = (ParameterToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// ParameterToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Parameter.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs
deleted file mode 100755
index d006a4ac142..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PropertyBuilder.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-
-//
-// System.Reflection.Emit/PropertyBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection.Emit {
- public sealed class PropertyBuilder : PropertyInfo {
- private PropertyAttributes attrs;
- private string name;
- private Type type;
- private Type[] parameters;
- private CustomAttributeBuilder[] cattrs;
- private object def_value;
- private MethodBuilder set_method;
- private MethodBuilder get_method;
- private int table_idx = 0;
- internal TypeBuilder typeb;
-
- internal PropertyBuilder (TypeBuilder tb, string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes) {
- this.name = name;
- this.attrs = attributes;
- this.type = returnType;
- if (parameterTypes != null) {
- this.parameters = new Type [parameterTypes.Length];
- System.Array.Copy (parameterTypes, this.parameters, this.parameters.Length);
- }
- typeb = tb;
- table_idx = tb.get_next_table_index (this, 0x17, true);
- }
-
- public override PropertyAttributes Attributes {
- get {return attrs;}
- }
- public override bool CanRead {
- get {return get_method != null;}
- }
- public override bool CanWrite {
- get {return set_method != null;}
- }
- public override Type DeclaringType {
- get {return typeb;}
- }
- public override string Name {
- get {return name;}
- }
- public PropertyToken PropertyToken {
- get {return new PropertyToken ();}
- }
- public override Type PropertyType {
- get {return type;}
- }
- public override Type ReflectedType {
- get {return typeb;}
- }
- public void AddOtherMethod( MethodBuilder mdBuilder) {
- }
- public override MethodInfo[] GetAccessors( bool nonPublic) {
- return null;
- }
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
- public override MethodInfo GetGetMethod( bool nonPublic) {
- return get_method;
- }
- public override ParameterInfo[] GetIndexParameters() {
- return null;
- }
- public override MethodInfo GetSetMethod( bool nonPublic) {
- return set_method;
- }
- public override object GetValue(object obj, object[] index) {
- return null;
- }
- public override object GetValue( object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- return null;
- }
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
- public void SetConstant( object defaultValue) {
- def_value = defaultValue;
- }
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
- public void SetGetMethod( MethodBuilder mdBuilder) {
- get_method = mdBuilder;
- }
- public void SetSetMethod( MethodBuilder mdBuilder) {
- set_method = mdBuilder;
- }
- public override void SetValue( object obj, object value, object[] index) {
- }
- public override void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs b/mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs
deleted file mode 100644
index 38216a23996..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// PropertyToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Property.
- /// </summary>
- [Serializable]
- public struct PropertyToken {
-
- internal int tokValue;
-
- public static readonly PropertyToken Empty;
-
-
- static PropertyToken ()
- {
- Empty = new PropertyToken ();
- }
-
-
- internal PropertyToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is PropertyToken;
-
- if (res) {
- PropertyToken that = (PropertyToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// PropertyToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Property.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs b/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
deleted file mode 100755
index 40e3b566a22..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-
-//
-// System.Reflection.Emit/SignatureHelper.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection.Emit {
- [Serializable]
- public sealed class SignatureHelper {
- internal enum SignatureHelperType {
- HELPER_FIELD,
- HELPER_LOCAL,
- HELPER_METHOD,
- HELPER_PROPERTY
- }
-
- private ModuleBuilder module;
- private Type[] arguments;
- private SignatureHelperType type;
-
- internal SignatureHelper (ModuleBuilder module, SignatureHelperType type)
- {
- this.type = type;
- this.module = module;
- }
-
- public static SignatureHelper GetFieldSigHelper (Module mod)
- {
- if (!(mod is ModuleBuilder))
- throw new NotImplementedException ();
-
- return new SignatureHelper ((ModuleBuilder) mod, SignatureHelperType.HELPER_FIELD);
- }
- public static SignatureHelper GetLocalVarSigHelper (Module mod)
- {
- if (!(mod is ModuleBuilder))
- throw new NotImplementedException ();
-
- return new SignatureHelper ((ModuleBuilder) mod, SignatureHelperType.HELPER_LOCAL);
- }
- [MonoTODO]
- public static SignatureHelper GetMethodSigHelper( Module mod, CallingConventions callingConvention, Type returnType)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static SignatureHelper GetMethodSigHelper( Module mod, Type returnType, Type[] parameterTypes)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static SignatureHelper GetPropertySigHelper( Module mod, Type returnType, Type[] parameterTypes)
- {
- throw new NotImplementedException ();
- }
- public void AddArgument (Type clsArgument)
- {
- if (arguments != null) {
- Type[] new_a = new Type [arguments.Length + 1];
- System.Array.Copy (arguments, new_a, arguments.Length);
- new_a [arguments.Length] = clsArgument;
- arguments = new_a;
- } else {
- arguments = new Type [1];
- arguments [0] = clsArgument;
- }
- }
- [MonoTODO]
- public void AddSentinel ()
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override bool Equals (object obj)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override int GetHashCode ()
- {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern byte[] get_signature_local ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern byte[] get_signature_field ();
-
- public byte[] GetSignature ()
- {
- switch (type) {
- case SignatureHelperType.HELPER_LOCAL:
- return get_signature_local ();
- case SignatureHelperType.HELPER_FIELD:
- return get_signature_field ();
- default:
- throw new NotImplementedException ();
- }
- }
-
- public override string ToString() {
- return "SignatureHelper";
- }
-
-
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs b/mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs
deleted file mode 100644
index b8e7aa67bb5..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// SignatureToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Signature.
- /// </summary>
- [Serializable]
- public struct SignatureToken {
-
- internal int tokValue;
-
- public static readonly SignatureToken Empty;
-
-
- static SignatureToken ()
- {
- Empty = new SignatureToken ();
- }
-
-
- internal SignatureToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is SignatureToken;
-
- if (res) {
- SignatureToken that = (SignatureToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// SignatureToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Signature.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs b/mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs
deleted file mode 100644
index 78cb915e7a6..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/StackBehaviour.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-// StackBehaviour.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
- /// <summary>
- /// Describes how values are pushed onto or popped off a stack.
- /// </summary>
- public enum StackBehaviour {
-
- /// <summary>
- /// </summary>
- Pop0 = 0,
-
- /// <summary>
- /// </summary>
- Pop1 = 1,
-
- /// <summary>
- /// </summary>
- Pop1_pop1 = 2,
-
- /// <summary>
- /// </summary>
- Popi = 3,
-
- /// <summary>
- /// </summary>
- Popi_pop1 = 4,
-
- /// <summary>
- /// </summary>
- Popi_popi = 5,
-
- /// <summary>
- /// </summary>
- Popi_popi8 = 6,
-
- /// <summary>
- /// </summary>
- Popi_popi_popi = 7,
-
- /// <summary>
- /// </summary>
- Popi_popr4 = 8,
-
- /// <summary>
- /// </summary>
- Popi_popr8 = 9,
-
- /// <summary>
- /// </summary>
- Popref = 0x0A,
-
- /// <summary>
- /// </summary>
- Popref_pop1 = 0x0B,
-
- /// <summary>
- /// </summary>
- Popref_popi = 0x0C,
-
- /// <summary>
- /// </summary>
- Popref_popi_popi = 0x0D,
-
- /// <summary>
- /// </summary>
- Popref_popi_popi8 = 0x0E,
-
- /// <summary>
- /// </summary>
- Popref_popi_popr4 = 0x0F,
-
- /// <summary>
- /// </summary>
- Popref_popi_popr8 = 0x10,
-
- /// <summary>
- /// </summary>
- Popref_popi_popref = 0x11,
-
- /// <summary>
- /// </summary>
- Push0 = 0x12,
-
- /// <summary>
- /// </summary>
- Push1 = 0x13,
-
- /// <summary>
- /// </summary>
- Push1_push1 = 0x14,
-
- /// <summary>
- /// </summary>
- Pushi = 0x15,
-
- /// <summary>
- /// </summary>
- Pushi8 = 0x16,
-
- /// <summary>
- /// </summary>
- Pushr4 = 0x17,
-
- /// <summary>
- /// </summary>
- Pushr8 = 0x18,
-
- /// <summary>
- /// </summary>
- Pushref = 0x19,
-
- /// <summary>
- /// </summary>
- Varpop = 0x1A,
-
- /// <summary>
- /// </summary>
- Varpush = 0x1B
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/StringToken.cs b/mcs/class/corlib/System.Reflection.Emit/StringToken.cs
deleted file mode 100644
index a872b8967bd..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/StringToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// StringToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a String.
- /// </summary>
- [Serializable]
- public struct StringToken {
-
- internal int tokValue;
-
- public static readonly StringToken Empty;
-
-
- static StringToken ()
- {
- Empty = new StringToken ();
- }
-
-
- internal StringToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is StringToken;
-
- if (res) {
- StringToken that = (StringToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// StringToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this String.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
deleted file mode 100644
index ce4224e23ac..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
+++ /dev/null
@@ -1,720 +0,0 @@
-//
-// System.Reflection.Emit/TypeBuilder.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Globalization;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Reflection.Emit {
- public sealed class TypeBuilder : Type {
- private string tname;
- private string nspace;
- private Type parent;
- private Type nesting_type;
- private Type[] interfaces;
- private MethodBuilder[] methods;
- private ConstructorBuilder[] ctors;
- private PropertyBuilder[] properties;
- private FieldBuilder[] fields;
- private EventBuilder[] events;
- private CustomAttributeBuilder[] cattrs;
- internal TypeBuilder[] subtypes;
- private TypeAttributes attrs;
- private int table_idx;
- private ModuleBuilder pmodule;
- private int class_size;
- private PackingSize packing_size;
-
- public const int UnspecifiedTypeSize = -1;
-
- protected override TypeAttributes GetAttributeFlagsImpl () {
- return attrs;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void setup_internal_class (TypeBuilder tb);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void create_internal_class (TypeBuilder tb);
-
- internal TypeBuilder (ModuleBuilder mb, string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packing_size, int type_size) {
- int sep_index;
- this.parent = parent;
- this.attrs = attr;
- this.class_size = type_size;
- this.packing_size = packing_size;
- sep_index = name.LastIndexOf('.');
- if (sep_index != -1) {
- this.tname = name.Substring (sep_index + 1);
- this.nspace = name.Substring (0, sep_index);
- } else {
- this.tname = name;
- this.nspace = "";
- }
- if (interfaces != null) {
- this.interfaces = new Type[interfaces.Length];
- System.Array.Copy (interfaces, this.interfaces, interfaces.Length);
- }
- pmodule = mb;
- // skip .<Module> ?
- table_idx = mb.get_next_table_index (this, 0x02, true);
- setup_internal_class (this);
- }
-
- public override Assembly Assembly {
- get {return pmodule.Assembly;}
- }
- public override string AssemblyQualifiedName {get {return null;}}
- public override Type BaseType {
- get {
- return parent;
- }
- }
- public override Type DeclaringType {get {return null;}}
- public override Type UnderlyingSystemType {
- get {
- if (fields != null) {
- foreach (FieldBuilder f in fields) {
- if ((f.Attributes & FieldAttributes.Static) == 0)
- return f.FieldType;
- }
- }
- throw new InvalidOperationException ();
- }
- }
-
- public override string FullName {
- get {
- if (nesting_type != null)
- return String.Concat (nesting_type.FullName, "+", tname);
- if ((nspace != null) && (nspace.Length > 0))
- return String.Concat (nspace, ".", tname);
- return tname;
- }
- }
-
- public override Guid GUID {
- get {return Guid.Empty;}
- }
-
- public override Module Module {
- get {return pmodule;}
- }
- public override string Name {
- get {return tname;}
- }
- public override string Namespace {
- get {return nspace;}
- }
- public PackingSize PackingSize {
- get {return packing_size;}
- }
- public override Type ReflectedType {get {return parent;}}
- public override MemberTypes MemberType {
- get {return MemberTypes.TypeInfo;}
- }
-
- [MonoTODO]
- public void AddDeclarativeSecurity( SecurityAction action, PermissionSet pset) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void AddInterfaceImplementation( Type interfaceType) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- }
-
- public override bool IsDefined( Type attributeType, bool inherit) {
- return false;
- }
- public override object[] GetCustomAttributes(bool inherit) {
- return null;
- }
- public override object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return null;
- }
-
- [MonoTODO]
- public TypeBuilder DefineNestedType (string name) {
- // FIXME: LAMESPEC: what other attributes should we use here as default?
- return DefineNestedType (name, TypeAttributes.Public, typeof(object), null);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr) {
- return DefineNestedType (name, attr, typeof(object), null);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent) {
- return DefineNestedType (name, attr, parent, null);
- }
-
- private TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packsize, int typesize) {
- TypeBuilder res = new TypeBuilder (pmodule, name, attr, parent, interfaces, packsize, typesize);
- res.nesting_type = this;
- if (subtypes != null) {
- TypeBuilder[] new_types = new TypeBuilder [subtypes.Length + 1];
- System.Array.Copy (subtypes, new_types, subtypes.Length);
- new_types [subtypes.Length] = res;
- subtypes = new_types;
- } else {
- subtypes = new TypeBuilder [1];
- subtypes [0] = res;
- }
- return res;
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, Type[] interfaces) {
- return DefineNestedType (name, attr, parent, interfaces, PackingSize.Unspecified, UnspecifiedTypeSize);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, int typesize) {
- return DefineNestedType (name, attr, parent, null, PackingSize.Unspecified, typesize);
- }
-
- public TypeBuilder DefineNestedType (string name, TypeAttributes attr, Type parent, PackingSize packsize) {
- return DefineNestedType (name, attr, parent, null, packsize, UnspecifiedTypeSize);
- }
-
- public ConstructorBuilder DefineConstructor( MethodAttributes attributes, CallingConventions callingConvention, Type[] parameterTypes) {
- ConstructorBuilder cb = new ConstructorBuilder (this, attributes, callingConvention, parameterTypes);
- if (ctors != null) {
- ConstructorBuilder[] new_ctors = new ConstructorBuilder [ctors.Length+1];
- System.Array.Copy (ctors, new_ctors, ctors.Length);
- new_ctors [ctors.Length] = cb;
- ctors = new_ctors;
- } else {
- ctors = new ConstructorBuilder [1];
- ctors [0] = cb;
- }
- return cb;
- }
-
- public ConstructorBuilder DefineDefaultConstructor( MethodAttributes attributes) {
- return DefineConstructor (attributes, CallingConventions.Standard, null);
- }
-
- public MethodBuilder DefineMethod( string name, MethodAttributes attributes, Type returnType, Type[] parameterTypes) {
- return DefineMethod (name, attributes, CallingConventions.Standard, returnType, parameterTypes);
- }
-
- private void append_method (MethodBuilder mb) {
- if (methods != null) {
- MethodBuilder[] new_methods = new MethodBuilder [methods.Length+1];
- System.Array.Copy (methods, new_methods, methods.Length);
- new_methods [methods.Length] = mb;
- methods = new_methods;
- } else {
- methods = new MethodBuilder [1];
- methods [0] = mb;
- }
- }
-
- public MethodBuilder DefineMethod( string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes) {
- MethodBuilder res = new MethodBuilder (this, name, attributes, callingConvention, returnType, parameterTypes);
- append_method (res);
- return res;
- }
-
- public MethodBuilder DefinePInvokeMethod (string name, string dllName, string entryName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) {
- MethodBuilder res = new MethodBuilder (this, name, attributes, callingConvention, returnType, parameterTypes,
- dllName, entryName, nativeCallConv, nativeCharSet);
- append_method (res);
- return res;
- }
-
- public MethodBuilder DefinePInvokeMethod (string name, string dllName, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, CallingConvention nativeCallConv, CharSet nativeCharSet) {
- return DefinePInvokeMethod (name, dllName, name, attributes, callingConvention, returnType, parameterTypes,
- nativeCallConv, nativeCharSet);
- }
-
- public void DefineMethodOverride( MethodInfo methodInfoBody, MethodInfo methodInfoDeclaration) {
- if (methodInfoBody is MethodBuilder) {
- MethodBuilder mb = (MethodBuilder)methodInfoBody;
- mb.set_override (methodInfoDeclaration);
- }
- }
-
- public FieldBuilder DefineField( string fieldName, Type type, FieldAttributes attributes) {
- FieldBuilder res = new FieldBuilder (this, fieldName, type, attributes);
- if (fields != null) {
- FieldBuilder[] new_fields = new FieldBuilder [fields.Length+1];
- System.Array.Copy (fields, new_fields, fields.Length);
- new_fields [fields.Length] = res;
- fields = new_fields;
- } else {
- fields = new FieldBuilder [1];
- fields [0] = res;
- create_internal_class (this);
- }
- return res;
- }
-
- public PropertyBuilder DefineProperty( string name, PropertyAttributes attributes, Type returnType, Type[] parameterTypes) {
- PropertyBuilder res = new PropertyBuilder (this, name, attributes, returnType, parameterTypes);
-
- if (properties != null) {
- PropertyBuilder[] new_properties = new PropertyBuilder [properties.Length+1];
- System.Array.Copy (properties, new_properties, properties.Length);
- new_properties [properties.Length] = res;
- properties = new_properties;
- } else {
- properties = new PropertyBuilder [1];
- properties [0] = res;
- }
- return res;
- }
-
- [MonoTODO]
- public ConstructorBuilder DefineTypeInitializer() {
- throw new NotImplementedException ();
- }
-
- public Type CreateType() {
- if (methods != null) {
- foreach (MethodBuilder method in methods) {
- method.fixup ();
- }
- }
- if (ctors != null) {
- foreach (ConstructorBuilder ctor in ctors) {
- ctor.fixup ();
- }
- }
-
- return this;
- }
-
- public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr) {
- if (ctors == null)
- return new ConstructorInfo [0];
- ArrayList l = new ArrayList ();
- bool match;
- MethodAttributes mattrs;
-
- foreach (ConstructorBuilder c in ctors) {
- match = false;
- mattrs = c.Attributes;
- if ((mattrs & MethodAttributes.MemberAccessMask) == MethodAttributes.Public) {
- if ((bindingAttr & BindingFlags.Public) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.NonPublic) != 0)
- match = true;
- }
- if (!match)
- continue;
- match = false;
- if ((mattrs & MethodAttributes.Static) != 0) {
- if ((bindingAttr & BindingFlags.Static) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.Instance) != 0)
- match = true;
- }
- if (!match)
- continue;
- l.Add (c);
- }
- ConstructorInfo[] result = new ConstructorInfo [l.Count];
- l.CopyTo (result);
- return result;
- }
-
- public override Type GetElementType () { return null; }
-
- [MonoTODO]
- public override EventInfo GetEvent (string name, BindingFlags bindingAttr) {
- throw new NotImplementedException ();
- }
-
- public override EventInfo[] GetEvents (BindingFlags bindingAttr) {
- return new EventInfo [0];
- }
-
- [MonoTODO]
- public override FieldInfo GetField( string name, BindingFlags bindingAttr) {
- //FIXME
- throw new NotImplementedException ();
- }
-
- public override FieldInfo[] GetFields (BindingFlags bindingAttr) {
- if (fields == null)
- return new FieldInfo [0];
- ArrayList l = new ArrayList ();
- bool match;
- FieldAttributes mattrs;
-
- foreach (FieldInfo c in fields) {
- match = false;
- mattrs = c.Attributes;
- if ((mattrs & FieldAttributes.FieldAccessMask) == FieldAttributes.Public) {
- if ((bindingAttr & BindingFlags.Public) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.NonPublic) != 0)
- match = true;
- }
- if (!match)
- continue;
- match = false;
- if ((mattrs & FieldAttributes.Static) != 0) {
- if ((bindingAttr & BindingFlags.Static) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.Instance) != 0)
- match = true;
- }
- if (!match)
- continue;
- l.Add (c);
- }
- FieldInfo[] result = new FieldInfo [l.Count];
- l.CopyTo (result);
- return result;
- }
-
- [MonoTODO]
- public override Type GetInterface (string name, bool ignoreCase) {
- throw new NotImplementedException ();
- }
-
- public override Type[] GetInterfaces () {
- if (interfaces != null) {
- Type[] ret = new Type [interfaces.Length];
- interfaces.CopyTo (ret, 0);
- return ret;
- } else {
- return Type.EmptyTypes;
- }
- }
-
- [MonoTODO]
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public override MethodInfo[] GetMethods (BindingFlags bindingAttr) {
- if (methods == null)
- return new MethodInfo [0];
- ArrayList l = new ArrayList ();
- bool match;
- MethodAttributes mattrs;
-
- foreach (MethodInfo c in methods) {
- match = false;
- mattrs = c.Attributes;
- if ((mattrs & MethodAttributes.MemberAccessMask) == MethodAttributes.Public) {
- if ((bindingAttr & BindingFlags.Public) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.NonPublic) != 0)
- match = true;
- }
- if (!match)
- continue;
- match = false;
- if ((mattrs & MethodAttributes.Static) != 0) {
- if ((bindingAttr & BindingFlags.Static) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.Instance) != 0)
- match = true;
- }
- if (!match)
- continue;
- l.Add (c);
- }
- MethodInfo[] result = new MethodInfo [l.Count];
- l.CopyTo (result);
- return result;
- }
-
- [MonoTODO]
- protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override Type GetNestedType( string name, BindingFlags bindingAttr) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public override Type[] GetNestedTypes (BindingFlags bindingAttr) {
- bool match;
- ArrayList result = new ArrayList ();
-
- if (subtypes == null)
- return Type.EmptyTypes;
- foreach (TypeBuilder t in subtypes) {
- match = false;
- if ((t.attrs & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic) {
- if ((bindingAttr & BindingFlags.Public) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.NonPublic) != 0)
- match = true;
- }
- if (!match)
- continue;
- result.Add (t);
- }
- Type[] r = new Type [result.Count];
- result.CopyTo (r);
- return r;
- }
-
- public override PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
- if (properties == null)
- return new PropertyInfo [0];
- ArrayList l = new ArrayList ();
- bool match;
- MethodAttributes mattrs;
- MethodInfo accessor;
-
- foreach (PropertyInfo c in properties) {
- match = false;
- accessor = c.GetGetMethod (true);
- if (accessor == null)
- accessor = c.GetSetMethod (true);
- if (accessor == null)
- continue;
- mattrs = accessor.Attributes;
- if ((mattrs & MethodAttributes.MemberAccessMask) == MethodAttributes.Public) {
- if ((bindingAttr & BindingFlags.Public) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.NonPublic) != 0)
- match = true;
- }
- if (!match)
- continue;
- match = false;
- if ((mattrs & MethodAttributes.Static) != 0) {
- if ((bindingAttr & BindingFlags.Static) != 0)
- match = true;
- } else {
- if ((bindingAttr & BindingFlags.Instance) != 0)
- match = true;
- }
- if (!match)
- continue;
- l.Add (c);
- }
- PropertyInfo[] result = new PropertyInfo [l.Count];
- l.CopyTo (result);
- return result;
- }
-
- [MonoTODO]
- protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- protected override bool HasElementTypeImpl () {
- return IsArrayImpl() || IsByRefImpl() || IsPointerImpl ();
- }
-
- [MonoTODO]
- public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
- // FIXME
- throw new NotImplementedException ();
- }
-
- protected override bool IsArrayImpl () {
- // FIXME
- return false;
- }
- protected override bool IsByRefImpl () {
- // FIXME
- return false;
- }
- protected override bool IsCOMObjectImpl () {
- return false;
- }
- protected override bool IsPointerImpl () {
- // FIXME
- return false;
- }
- protected override bool IsPrimitiveImpl () {
- // FIXME
- return false;
- }
- protected override bool IsValueTypeImpl () {
- // test this one
- return type_is_subtype_of (this, typeof (System.ValueType), false);
- }
-
- public override RuntimeTypeHandle TypeHandle { get { return _impl; } }
-
- private static int decode_len (byte[] data, int pos, out int rpos) {
- int len = 0;
- if ((data [pos] & 0x80) == 0) {
- len = (int)(data [pos++] & 0x7f);
- } else if ((data [pos] & 0x40) == 0) {
- len = ((data [pos] & 0x3f) << 8) + data [pos + 1];
- pos += 2;
- } else {
- len = ((data [pos] & 0x1f) << 24) + (data [pos + 1] << 16) + (data [pos + 2] << 8) + data [pos + 3];
- pos += 4;
- }
- rpos = pos;
- return len;
- }
-
- private static string string_from_bytes (byte[] data, int pos, int len) {
- char[] chars = new char [len];
- // FIXME: use a utf8 decoder here
- for (int i = 0; i < len; ++i)
- chars [i] = (char)data [pos + i];
- return new String (chars);
- }
-
- public void SetCustomAttribute( CustomAttributeBuilder customBuilder) {
- string attrname = customBuilder.Ctor.ReflectedType.FullName;
- if (attrname == "System.Runtime.InteropServices.StructLayoutAttribute") {
- byte[] data = customBuilder.Data;
- int layout_kind; /* the (stupid) ctor takes a short or an int ... */
- layout_kind = (int)data [2];
- layout_kind |= ((int)data [3]) << 8;
- attrs &= ~TypeAttributes.LayoutMask;
- switch ((LayoutKind)layout_kind) {
- case LayoutKind.Auto:
- attrs |= TypeAttributes.AutoLayout;
- break;
- case LayoutKind.Explicit:
- attrs |= TypeAttributes.ExplicitLayout;
- break;
- case LayoutKind.Sequential:
- attrs |= TypeAttributes.SequentialLayout;
- break;
- default:
- // we should ignore it since it can be any value anyway...
- throw new Exception ("Error in customattr");
- }
- string first_type_name = customBuilder.Ctor.GetParameters()[0].ParameterType.FullName;
- int pos = 6;
- if (first_type_name == "System.Int16")
- pos = 4;
- int nnamed = (int)data [pos++];
- nnamed |= ((int)data [pos++]) << 8;
- for (int i = 0; i < nnamed; ++i) {
- byte type = data [pos++];
- int len = decode_len (data, pos, out pos);
- string named_name = string_from_bytes (data, pos, len);
- pos += len;
- /* all the fields are integers in StructLayout */
- int value = (int)data [pos++];
- value |= ((int)data [pos++]) << 8;
- value |= ((int)data [pos++]) << 16;
- value |= ((int)data [pos++]) << 24;
- switch (named_name) {
- case "CharSet":
- switch ((CharSet)value) {
- case CharSet.None:
- case CharSet.Ansi:
- break;
- case CharSet.Unicode:
- attrs |= TypeAttributes.UnicodeClass;
- break;
- case CharSet.Auto:
- attrs |= TypeAttributes.AutoClass;
- break;
- default:
- break; // error out...
- }
- break;
- case "Pack":
- packing_size = (PackingSize)value;
- break;
- case "Size":
- class_size = value;
- break;
- default:
- break; // error out...
- }
- }
- return;
- }
- if (cattrs != null) {
- CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
- cattrs.CopyTo (new_array, 0);
- new_array [cattrs.Length] = customBuilder;
- cattrs = new_array;
- } else {
- cattrs = new CustomAttributeBuilder [1];
- cattrs [0] = customBuilder;
- }
- }
- public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute) {
- SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
- }
-
- public EventBuilder DefineEvent( string name, EventAttributes attributes, Type eventtype) {
- EventBuilder res = new EventBuilder (this, name, attributes, eventtype);
- if (events != null) {
- EventBuilder[] new_events = new EventBuilder [events.Length+1];
- System.Array.Copy (events, new_events, events.Length);
- new_events [events.Length] = res;
- events = new_events;
- } else {
- events = new EventBuilder [1];
- events [0] = res;
- }
- return res;
- }
-
- static int InitializedDataCount = 0;
-
- public FieldBuilder DefineInitializedData( string name, byte[] data, FieldAttributes attributes) {
- TypeBuilder datablobtype = pmodule.DefineType ("$ArrayType$"+InitializedDataCount.ToString(),
- TypeAttributes.Public|TypeAttributes.ExplicitLayout|TypeAttributes.Sealed,
- typeof (System.ValueType), PackingSize.Size1, data.Length);
- datablobtype.packing_size = PackingSize.Size1;
- datablobtype.class_size = data.Length;
- datablobtype.CreateType ();
- FieldBuilder res = DefineField (name, datablobtype, attributes|FieldAttributes.Assembly|FieldAttributes.Static|FieldAttributes.HasFieldRVA);
- res.SetRVAData (data);
- InitializedDataCount++;
- return res;
- }
-
- [MonoTODO]
- public FieldBuilder DefineUninitializedData( string name, int size, FieldAttributes attributes) {
- throw new NotImplementedException ();
- }
-
- public TypeToken TypeToken {
- get {
- return new TypeToken (0x02000000 | table_idx);
- }
- }
- public void SetParent (Type parentType) {
- parent = parentType;
- }
- internal int get_next_table_index (object obj, int table, bool inc) {
- return pmodule.get_next_table_index (obj, table, inc);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeToken.cs b/mcs/class/corlib/System.Reflection.Emit/TypeToken.cs
deleted file mode 100644
index 8fd6ae493b3..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/TypeToken.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// TypeToken.cs
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection.Emit {
-
-
- /// <summary>
- /// Represents the Token returned by the metadata to represent a Type.
- /// </summary>
- [Serializable]
- public struct TypeToken {
-
- internal int tokValue;
-
- public static readonly TypeToken Empty;
-
-
- static TypeToken ()
- {
- Empty = new TypeToken ();
- }
-
-
- internal TypeToken (int val)
- {
- tokValue = val;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override bool Equals (object obj)
- {
- bool res = obj is TypeToken;
-
- if (res) {
- TypeToken that = (TypeToken) obj;
- res = (this.tokValue == that.tokValue);
- }
-
- return res;
- }
-
-
- /// <summary>
- /// Tests whether the given object is an instance of
- /// TypeToken and has the same token value.
- /// </summary>
- public override int GetHashCode ()
- {
- return tokValue;
- }
-
-
- /// <summary>
- /// Returns the metadata token for this Type.
- /// </summary>
- public int Token {
- get {
- return tokValue;
- }
- }
-
- }
-
-}
-
diff --git a/mcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs b/mcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs
deleted file mode 100755
index 1c0d8bf5280..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/UnmanagedMarshal.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-
-//
-// System.Reflection.Emit/UnmanagedMarshal.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001-2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection.Emit;
-using System.Runtime.InteropServices;
-using System;
-
-namespace System.Reflection.Emit {
-
- [Serializable]
- public sealed class UnmanagedMarshal {
- private int count;
- private UnmanagedType t;
- private UnmanagedType tbase;
-
- private UnmanagedMarshal (UnmanagedType maint, int cnt) {
- count = cnt;
- t = maint;
- tbase = maint;
- }
- private UnmanagedMarshal (UnmanagedType maint, UnmanagedType elemt) {
- count = 0;
- t = maint;
- tbase = elemt;
- }
-
- public UnmanagedType BaseType {
- get {
- if (t == UnmanagedType.LPArray || t == UnmanagedType.SafeArray)
- throw new ArgumentException ();
- return tbase;
- }
- }
-
- public int ElementCount {
- get {return count;}
- }
-
- public UnmanagedType GetUnmanagedType {
- get {return t;}
- }
-
- public Guid IIDGuid {
- get {return Guid.Empty;}
- }
-
- public static UnmanagedMarshal DefineByValArray( int elemCount) {
- return new UnmanagedMarshal (UnmanagedType.ByValArray, elemCount);
- }
-
- public static UnmanagedMarshal DefineByValTStr( int elemCount) {
- return new UnmanagedMarshal (UnmanagedType.ByValTStr, elemCount);
- }
-
- public static UnmanagedMarshal DefineLPArray( UnmanagedType elemType) {
- return new UnmanagedMarshal (UnmanagedType.LPArray, elemType);
- }
-
- public static UnmanagedMarshal DefineSafeArray( UnmanagedType elemType) {
- return new UnmanagedMarshal (UnmanagedType.SafeArray, elemType);
- }
-
- public static UnmanagedMarshal DefineUnmanagedMarshal( UnmanagedType unmanagedType) {
- return new UnmanagedMarshal (unmanagedType, unmanagedType);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection.Emit/common.src b/mcs/class/corlib/System.Reflection.Emit/common.src
deleted file mode 100755
index 569a9d60748..00000000000
--- a/mcs/class/corlib/System.Reflection.Emit/common.src
+++ /dev/null
@@ -1,23 +0,0 @@
-AssemblyBuilder.cs
-AssemblyBuilderAccess.cs
-ConstructorBuilder.cs
-EventToken.cs
-FieldToken.cs
-FlowControl.cs
-ILGenerator.cs
-Label.cs
-MethodToken.cs
-ModuleBuilder.cs
-OpCode.cs
-OpCodes.cs
-OpCodeType.cs
-OperandType.cs
-PackingSize.cs
-ParameterToken.cs
-PEFileKinds.cs
-PropertyToken.cs
-SignatureToken.cs
-StackBehaviour.cs
-StringToken.cs
-TypeBuilder.cs
-TypeToken.cs
diff --git a/mcs/class/corlib/System.Reflection/AmbiguousMatchException.cs b/mcs/class/corlib/System.Reflection/AmbiguousMatchException.cs
deleted file mode 100755
index 3bfc25fccd2..00000000000
--- a/mcs/class/corlib/System.Reflection/AmbiguousMatchException.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Reflection.AmbiguousMatchException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection {
-
- [Serializable]
- public sealed class AmbiguousMatchException : SystemException {
- // Constructors
- public AmbiguousMatchException ()
- : base ("Ambiguous matching in method resolution")
- {
- }
-
- public AmbiguousMatchException (string message)
- : base (message)
- {
- }
-
- public AmbiguousMatchException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/Assembly.cs b/mcs/class/corlib/System.Reflection/Assembly.cs
deleted file mode 100644
index 62c1011e0c8..00000000000
--- a/mcs/class/corlib/System.Reflection/Assembly.cs
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// System.Reflection/Assembly.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Policy;
-using System.Runtime.Serialization;
-using System.Reflection.Emit;
-using System.IO;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection {
-
- [Serializable]
- public class Assembly : System.Reflection.ICustomAttributeProvider,
- System.Security.IEvidenceFactory, System.Runtime.Serialization.ISerializable {
- private IntPtr _mono_assembly;
-
- internal Assembly () {}
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern string get_code_base ();
-
- public virtual string CodeBase {
- get {
- return get_code_base ();
- }
- }
-
- internal virtual string CopiedCodeBase {
- get {
- return null;
- }
- }
-
- public virtual string FullName {
- get {
- //
- // FIXME: This is wrong, but it gets us going
- // in the compiler for now
- //
- return CodeBase;
- }
- }
-
- public virtual MethodInfo EntryPoint {
- get {
- return null;
- }
- }
-
- public virtual Evidence Evidence {
- get {
- return null;
- }
- }
-
- public virtual String Location {
- get {
- return null;
- }
- }
-
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- }
-
- public virtual bool IsDefined (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public virtual object [] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
-
- public virtual object [] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public virtual FileStream[] GetFiles ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual FileStream GetFile (String name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual Stream GetManifestResourceStream (String name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual Stream GetManifestResourceStream (Type type, String name)
- {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern Type[] GetTypes (bool exportedOnly);
-
- public virtual Type[] GetTypes ()
- {
- return GetTypes (false);
- }
-
- public virtual Type[] GetExportedTypes ()
- {
- return GetTypes (true);
- }
-
- public virtual Type GetType (String name, Boolean throwOnError)
- {
- return GetType (name, throwOnError, false);
- }
-
- public virtual Type GetType (String name) {
- return GetType (name, false, false);
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern Type GetType (String name, Boolean throwOnError, Boolean ignoreCase);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- static extern void FillName (Assembly ass, AssemblyName aname);
-
- public virtual AssemblyName GetName (Boolean copiedName)
- {
- AssemblyName aname = new AssemblyName ();
- FillName (this, aname);
- return aname;
- }
-
- public virtual AssemblyName GetName ()
- {
- return GetName (false);
- }
-
- public override String ToString ()
- {
- return GetName ().Name;
- }
-
- [MonoTODO]
- public static String CreateQualifiedName (String assemblyName, String typeName)
- {
- return typeName + "," + assemblyName;
- }
-
- public static Assembly GetAssembly (Type type)
- {
- if (type != null)
- return type.Assembly;
- throw new ArgumentNullException ("type");
- }
-
- [MonoTODO]
- public Assembly GetSatelliteAssembly (CultureInfo culture)
- {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static Assembly LoadFrom (String assemblyFile);
-
- public static Assembly Load (String assemblyString)
- {
- return AppDomain.CurrentDomain.Load (assemblyString);
- }
-
- public static Assembly Load (String assemblyString, Evidence assemblySecurity)
- {
- return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
- }
-
- public static Assembly Load (AssemblyName assemblyRef)
- {
- return AppDomain.CurrentDomain.Load (assemblyRef);
- }
-
- public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
- {
- return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
- }
-
- public static Assembly Load (Byte[] rawAssembly)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly);
- }
-
- public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
- }
-
- public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
- Evidence securityEvidence)
- {
- return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
- }
-
- public static Assembly LoadWithPartialName (string partialName)
- {
- return LoadWithPartialName (partialName, null);
- }
-
- [MonoTODO]
- public static Assembly LoadWithPartialName (string partialName, Evidence securityEvidence)
- {
- return AppDomain.CurrentDomain.Load (partialName, securityEvidence);
- }
-
-
- public Object CreateInstance (String typeName)
- {
- return CreateInstance (typeName, false);
- }
-
- public Object CreateInstance (String typeName, Boolean ignoreCase)
- {
- Type t = GetType (typeName, true, ignoreCase);
- return Activator.CreateInstance (t);
- }
-
- public Object CreateInstance (String typeName, Boolean ignoreCase,
- BindingFlags bindingAttr, Binder binder,
- Object[] args, CultureInfo culture,
- Object[] activationAttributes)
- {
- Type t = GetType (typeName, true, ignoreCase);
- return Activator.CreateInstance (t, bindingAttr, binder, args, culture, activationAttributes);
- }
-
- public Module[] GetLoadedModules ()
- {
- throw new NotImplementedException ();
- }
-
- public Module[] GetModules ()
- {
- throw new NotImplementedException ();
- }
-
- public Module GetModule (String name)
- {
- throw new NotImplementedException ();
- }
-
- public virtual String[] GetManifestResourceNames ()
- {
- throw new NotImplementedException ();
- }
-
- public static Assembly GetExecutingAssembly ()
- {
- throw new NotImplementedException ();
- }
-
- public AssemblyName[] GetReferencedAssemblies ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual ManifestResourceInfo GetManifestResourceInfo (String resourceName)
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs
deleted file mode 100644
index 39bd0c369a4..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyAlgorithmIdAttribute.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Reflection.AssemblyAlgorithmIdAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Configuration.Assemblies;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyAlgorithmIdAttribute : Attribute
- {
- // Field
- private uint id;
-
- // Constructor
- public AssemblyAlgorithmIdAttribute (AssemblyHashAlgorithm algorithmId)
- {
- id = (uint) algorithmId;
- }
-
- [CLSCompliant (false)]
- public AssemblyAlgorithmIdAttribute (uint algorithmId)
- {
- id = algorithmId;
- }
-
- // Property
- [CLSCompliant (false)]
- public uint AlgorithmId
- {
- get { return id; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs
deleted file mode 100644
index b6dc24687a9..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyCompanyAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyCompanyAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyCompanyAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyCompanyAttribute (string company)
- {
- name = company;
- }
-
- // Properties
- public string Company
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs
deleted file mode 100644
index 8e48b485d2d..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyConfigurationAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyConfigurationAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyConfigurationAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyConfigurationAttribute (string configuration)
- {
- name = configuration;
- }
-
- // Properties
- public string Configuration
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs
deleted file mode 100644
index 264a905f0ef..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyCopyrightAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyCopyrightAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyCopyrightAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyCopyrightAttribute (string copyright)
- {
- name = copyright;
- }
-
- // Properties
- public string Copyright
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs
deleted file mode 100644
index 16ce1f96cc4..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyCultureAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyCultureAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyCultureAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyCultureAttribute (string culture)
- {
- name = culture;
- }
-
- // Properties
- public string Culture
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs
deleted file mode 100644
index f91c9314917..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyDefaultAliasAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyDefaultAliasAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyDefaultAliasAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyDefaultAliasAttribute (string defaultAlias)
- {
- name = defaultAlias;
- }
-
- // Properties
- public string DefaultAlias
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs
deleted file mode 100644
index cec22e69659..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyDelaySignAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Reflection.AssemblyDelaySignAttribute.cs
-//
-// Author: Duncan Mak <duncan@ximian.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyDelaySignAttribute : Attribute
- {
- // Field
- private bool delay;
-
- // Constructor
- public AssemblyDelaySignAttribute (bool delaySign)
- {
- delay = delaySign;
- }
-
- // Property
- public bool DelaySign
- {
- get { return delay; }
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs
deleted file mode 100644
index 00beee47ec4..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyDescriptionAttribute.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Reflection.AssemblyDescriptionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyDescriptionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyDescriptionAttribute (string description)
- {
- name = description;
- }
-
- // Property
- public string Description
- {
- get { return name; }
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs
deleted file mode 100644
index c94407ff708..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyFileVersionAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyFileVersionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyFileVersionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyFileVersionAttribute (string version)
- {
- name = version;
- }
-
- // Property
- public string Version
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs
deleted file mode 100644
index 7a9589dde9f..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyFlagsAttribute.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.Reflection.AssemblyFlagsAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyFlagsAttribute : Attribute
- {
- // Field
- private uint flags;
-
- // Constructor
- [CLSCompliant (false)]
- public AssemblyFlagsAttribute (uint flags)
- {
- this.flags = flags;
- }
-
- // Property
- [CLSCompliant (false)]
- public uint Flags
- {
- get { return flags; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs
deleted file mode 100644
index e3a5742f539..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyInformationalVersionAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyInformationalVersionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyInformationalVersionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyInformationalVersionAttribute (string informationalVersion)
- {
- name = informationalVersion;
- }
-
- // Property
- public string InformationalVersion
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs
deleted file mode 100644
index 0e92688493e..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyKeyFileAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyKeyFileAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyKeyFileAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyKeyFileAttribute (string keyFile)
- {
- name = keyFile;
- }
-
- // Property
- public string KeyFile
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs
deleted file mode 100644
index 3323b14ed79..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyKeyNameAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyKeyNameAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyKeyNameAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyKeyNameAttribute (string keyName)
- {
- name = keyName;
- }
-
- // Property
- public string KeyName
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyName.cs b/mcs/class/corlib/System.Reflection/AssemblyName.cs
deleted file mode 100755
index a457ebb1614..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyName.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-
-//
-// System.Reflection/AssemblyName.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Globalization;
-using System.Configuration.Assemblies;
-using System.Runtime.Serialization;
-
-namespace System.Reflection {
-
- [Serializable]
- public sealed class AssemblyName : ISerializable // ICloneable, , IDeserializationCallback
- {
- string name = "";
- string codebase;
- int major, minor, build, revision;
- CultureInfo cultureinfo;
- AssemblyNameFlags flags;
- AssemblyHashAlgorithm hashalg;
- StrongNameKeyPair keypair;
- AssemblyVersionCompatibility versioncompat;
-
- public AssemblyName ()
- {
- }
-
- internal AssemblyName (SerializationInfo si, StreamingContext sc)
- {
- name = si.GetString ("_Name");
- codebase = si.GetString ("_CodeBase");
- Version = (Version)si.GetValue ("_Version", typeof (Version));
- }
-
- public string Name {
- get {
- return name;
- }
- set {
- name = value;
- }
- }
-
- public string CodeBase {
- get {
- return codebase;
- }
-
- set {
- codebase = value;
- }
- }
-
- [MonoTODO]
- public string EscapedCodeBase {
- get {
- return codebase;
- }
- }
-
- public CultureInfo CultureInfo {
- get {
- return cultureinfo;
- }
-
- set {
- cultureinfo = value;
- }
- }
-
- public AssemblyNameFlags Flags {
- get {
- return flags;
- }
-
- set {
- flags = value;
- }
- }
-
- [MonoTODO]
- public string FullName {
- get {
- return name;
- }
- }
-
- public AssemblyHashAlgorithm HashAlgorithm {
- get {
- return hashalg;
- }
-
- set {
- hashalg = value;
- }
- }
-
- public StrongNameKeyPair KeyPair {
- get {
- return keypair;
- }
-
- set {
- keypair = value;
- }
- }
-
- public Version Version {
- get {
- return new Version (major, minor, build, revision);
- }
-
- set {
- major = value.Major;
- minor = value.Minor;
- build = value.Build;
- revision = value.Revision;
- }
- }
-
- public AssemblyVersionCompatibility VersionCompatibility {
- get {
- return versioncompat;
- }
-
- set {
- versioncompat = value;
- }
- }
-
- public override int GetHashCode ()
- {
- return name.GetHashCode ();
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Reflection.AssemblyName))
- return false;
-
- AssemblyName an = (AssemblyName)o;
-
- if (an.name == this.name)
- return true;
-
- return false;
- }
-
- [MonoTODO]
- public byte[] GetPublicKeyToken() {
- return new byte[0];
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("_Name", name);
- info.AddValue ("_CodeBase", codebase);
- info.AddValue ("_Version", Version);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyNameFlags.cs b/mcs/class/corlib/System.Reflection/AssemblyNameFlags.cs
deleted file mode 100755
index daa3cd97148..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyNameFlags.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// AssemblyNameFlags.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:38:33 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- [Serializable]
- public enum AssemblyNameFlags {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// Not sure about the ECMA spec, but this is what is in mscorlib...
- /// Perhaps this has changed since the beta.
- /// </summary>
- PublicKey = 1,
- } // AssemblyNameFlags
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs b/mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs
deleted file mode 100644
index cc02533a741..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyNameProxy.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Reflection.AssemblyNameProxy.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection
-{
- public class AssemblyNameProxy : MarshalByRefObject
- {
- // Constructor
- public AssemblyNameProxy ()
- {
- }
-
- // Method
- [MonoTODO]
- public AssemblyName GetAssemblyName (string assemblyFile)
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs
deleted file mode 100644
index 67c85f9421b..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyProductAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyProductAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyProductAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyProductAttribute (string product)
- {
- name = product;
- }
-
- // Property
- public string Product
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs
deleted file mode 100644
index f3ac196a789..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyTitleAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyTitleAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyTitleAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyTitleAttribute (string title)
- {
- name = title;
- }
-
- // Property
- public string Title
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs
deleted file mode 100644
index 7c2bcc8e712..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyTradeMarkAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyTrademarkAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyTrademarkAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyTrademarkAttribute (string trademark)
- {
- name = trademark;
- }
-
- // Property
- public string Trademark
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs b/mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs
deleted file mode 100644
index d5f46894698..00000000000
--- a/mcs/class/corlib/System.Reflection/AssemblyVersionAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.AssemblyVersionAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class AssemblyVersionAttribute : Attribute
- {
- // Field
- private string name;
-
- // Constructor
- public AssemblyVersionAttribute (string version)
- {
- name = version;
- }
-
- // Property
- public string Version
- {
- get { return name; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/Binder.cs b/mcs/class/corlib/System.Reflection/Binder.cs
deleted file mode 100644
index 876556102e5..00000000000
--- a/mcs/class/corlib/System.Reflection/Binder.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// System.Reflection.Binder
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-namespace System.Reflection
-{
- [Serializable]
- public abstract class Binder
- {
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/BindingFlags.cs b/mcs/class/corlib/System.Reflection/BindingFlags.cs
deleted file mode 100644
index 6d02cfeb196..00000000000
--- a/mcs/class/corlib/System.Reflection/BindingFlags.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-// BindingFlags.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:33:54 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum BindingFlags {
-
- Default = 0,
-
- /// <summary>
- /// </summary>
- IgnoreCase = 0x00000001,
-
- /// <summary>
- /// </summary>
- DeclaredOnly = 0x00000002,
-
- /// <summary>
- /// </summary>
- Instance = 0x00000004,
-
- /// <summary>
- /// </summary>
- Static = 0x00000008,
-
- /// <summary>
- /// </summary>
- Public = 0x00000010,
-
- /// <summary>
- /// </summary>
- NonPublic = 0x00000020,
-
- FlattenHierarchy = 0x00000040,
-
- /// <summary>
- /// </summary>
- InvokeMethod = 0x00000100,
-
- /// <summary>
- /// </summary>
- CreateInstance = 0x00000200,
-
- /// <summary>
- /// </summary>
- GetField = 0x00000400,
-
- /// <summary>
- /// </summary>
- SetField = 0x00000800,
-
- /// <summary>
- /// </summary>
- GetProperty = 0x00001000,
-
- /// <summary>
- /// </summary>
- SetProperty = 0x00002000,
-
- PutDispProperty = 0x00004000,
-
- PutRefDispProperty = 0x00008000,
-
- /// <summary>
- /// </summary>
- ExactBinding = 0x00010000,
-
- /// <summary>
- /// </summary>
- SuppressChangeType = 0x00020000,
-
- /// <summary>
- /// </summary>
- OptionalParamBinding = 0x00040000,
-
- IgnoreReturn = 0x01000000
- } // BindingFlags
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/CallingConventions.cs b/mcs/class/corlib/System.Reflection/CallingConventions.cs
deleted file mode 100755
index c42c2471c9d..00000000000
--- a/mcs/class/corlib/System.Reflection/CallingConventions.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// CallingConventions.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:38:43 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum CallingConventions {
-
- /// <summary>
- /// </summary>
- Standard = 1,
-
- /// <summary>
- /// </summary>
- VarArgs = 2,
-
- /// <summary>
- /// </summary>
- Any = 3,
-
- /// <summary>
- /// </summary>
- HasThis = 32,
-
- /// <summary>
- /// </summary>
- ExplicitThis = 64,
- } // CallingConventions
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/ChangeLog b/mcs/class/corlib/System.Reflection/ChangeLog
deleted file mode 100644
index 4ef24a52c4d..00000000000
--- a/mcs/class/corlib/System.Reflection/ChangeLog
+++ /dev/null
@@ -1,264 +0,0 @@
-2002-05-24 Martin Baulig <martin@gnome.org>
-
- * ParameterInfo.cs: Added internal constructor.
-
-Thu May 23 17:18:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: implemented CreateInstance ().
-
-2002-05-22 Martin Baulig <martin@gnome.org>
-
- * MethodBase.cs (get_next_table_index): Added `object obj' argument.
-
-Tue May 21 12:07:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * EventInfo.cs: more implementation.
-
-Mon May 20 17:37:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoEvent.cs: fill-in the implementation.
-
-Sat May 4 15:00:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs, AssemblyName.cs: updates and fixes.
-
-2002-04-24 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * MonoProperty.cs (GetValue) : basic implementation to support nunit
- * PropertyInfo.cs (GetValue) : call MonoProperty::GetValue instead of returning null
-
-Thu Apr 18 16:40:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoMethod.c: cache the method name.
-
-2002-04-12 Duncan Mak <duncan@ximian.com>
-
- * AssemblyAlgorithmIdAttribute.cs: Fixed typo in AlgorithmId
- property.
-
- * AssemblyDelaySignAttribute.cs: Fixed type in DelaySign
- attribute.
-
- * AssemblyFileVersionAttribute.cs: Renamed FileVersion property to
- Version.
-
- * BindingFlags.cs: Added missing value "PutRefDispProperty".
-
- * FieldAttributes.cs: Removed value "HasSecurity".
-
- * ManifestResourceInfo.cs: Added missing properties FileName,
- ReferencedAssembly and ResourceLocation.
-
- * TargetInvocationException.cs: Added the missing constructors.
-
-Fri Apr 12 18:32:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoMethod.cs: make Name property an icall.
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * DefaultMemberAttribute.cs: Add AttributeUsage attribute for class,
- struct and interface.
-
-Fri Apr 5 15:40:24 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoEvent.cs: remove unused code.
- * MonoProperty: implement ToString().
-
-Wed Apr 3 17:59:26 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: implement GetTypes() and GetExportedTypes().
-
-Mon Mar 25 18:54:58 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoEvent.cs: added the needed fields.
-
-2002-03-20 Martin Baulig <martin@gnome.org>
-
- * ConstructorInfo.cs (Invoke): Implemented, call the abstract Invoke.
-
- * MonoMethod.cs (MonoCMethod.Invoke): Implemented, call InternalInvoke.
-
-2002-03-14 Dietmar Maurer <dietmar@ximian.com>
-
- * MonoMethod.cs (Invoke): call InternalInvoke
-
- * MethodBase.cs (Invoke): call virtual invoke function
-
-Thu Mar 7 17:14:20 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * EventInfo.cs: add compiler needed methods.
- * MonoMethod.cs: make ToString() return the return type name, too.
-
-2002-03-07 Nick Drochak <ndrochak@gol.com>
-
- * BindingFlags.cs: Add missing enum values. Thanks CorCompare.
-
-Tue Mar 5 20:33:14 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * TypeAttributes.cs, MethodImplAttributes.cs: updates to latest spec.
-
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * StrongNameKeyPair.cs: Committed for Kevin Winchester (kwin@ns.sympatico.ca>.
-
-2002-02-24 Nick Drochak <ndrochak@gol.com>
-
- * AssemblyNameFlags.cs: Use proper member name. Thanks corcompare!
-
-Fri Feb 22 18:54:13 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoField.cs: implement GetValue as an internalcall.
- Implemented ToString().
-
-Tue Feb 19 20:36:04 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs, Module.cs, MonoField.cs, MonoMethod.cs,
- MonoProperty.cs, ParameterInfo.cs: Implemented custom attributes
- related methods.
-
-Thu Feb 14 18:55:23 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * TypeAttributes.cs: update to latest spec.
-
-Mon Feb 11 19:50:27 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: handle throwOnError in GetType() call.
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * AssemblyName.cs: Implemented ISerializable interface for the
- fields that we have.
-
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * Missing.cs:
- * TargetException.cs: Added in CVS.
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * ReflectionTypeLoadException.cs: Added missing bits.
-
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * AssemblyAlgorithmIdAttribute.cs:
- * AssemblyCompanyAttribute.cs:
- * AssemblyConfigurationAttribute.cs:
- * AssemblyCopyrightAttribute.cs:
- * AssemblyCultureAttribute.cs:
- * AssemblyDefaultAliasAttribute.cs:
- * AssemblyDelaySignAttribute.cs:
- * AssemblyDescriptionAttribute.cs:
- * AssemblyFileVersionAttribute.cs:
- * AssemblyFlagsAttribute.cs:
- * AssemblyInformationalVersionAttribute.cs:
- * AssemblyKeyFileAttribute.cs:
- * AssemblyKeyNameAttribute.cs:
- * AssemblyNameProxy.cs:
- * AssemblyProductAttribute.cs:
- * AssemblyTitleAttribute.cs:
- * AssemblyTradeMarkAttribute.cs:
- * AssemblyVersionAttribute.cs:
- * CustomAttributeFormatException.cs:
- * InvalidFilterCriteriaException.cs:
- * TargetParameterCountException.cs: Added.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * Assembly.cs (Assembly.CodeBase): Implement.
- (Assembly.FullName): simplistic and broken implementation. Gets
- us where we were yesterday.
-
- Code style fix.
-
-Tue Jan 22 22:54:18 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * IReflect.cs: corrected GetMember() return type.
- * InterfaceMapping.cs, TypeDelegator.cs: implemented.
-
-Wed Jan 9 19:37:14 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoMethod.cs: ToString () implementation.
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * Assembly.cs : Decorate missing bits with the MonoTODO
- attribute.
-
- * ConstructorInfo.cs, MonoMethod.cs, MonoProperty.cs, ParameterInfo.cs,
- ReflectionTypeLoadException.cs : Ditto.
-
- * FieldInfo.cs : Ditto.
-
-Thu Jan 3 23:25:34 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: trow unimplemented exceptions.
-
-Tue Dec 18 18:46:22 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * MonoMethod.cs: implemented GetParameters().
- * MonoProperty.cs: PropertyInfo implementation.
- * ParameterInfo.cs: implemented.
- * PropertyInfo.cs: fixes.
-
-Thu Dec 13 20:18:05 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * FieldInfo.cs: implemented some Is* propeties.
- * MethodBase.cs: fixed attribute accessors.
- * MonoField.cs: runtime object to represent a field.
- * MonoMethod.cs: runtime object to represent a method.
- * AssemblyBuilder.cs: GetToken() methods to get tokens for
- strings, fields, methods...
- * ILGenerator.cs: handle tokens for methods.
-
-Mon Nov 19 13:56:55 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * MethodBase.cs: add internal get_next_table_index() for use in
- Reflection.Emit.
-
-Wed Nov 14 16:53:28 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: implement some of the Load() methods.
- * ConstructorInfo.cs: some missing stubs and fields.
- * FieldInfo.cs: IsInitOnly property.
- * ParameterInfo.cs: stubs for missing properties.
- * ParameterModifier.cs: implemented class.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * Assembly.cs: Filled in some stub implementations
-
- * ConstructorInfo.cs: Added some stub functions for NUnit
-
-Fri Nov 2 18:29:36 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AmbiguousMatchException.cs,
- * Assembly.cs, Module.cs: updates.
- * FieldInfo.cs: better compliance to the spec.
- * MethodBase.cs: move call_conv out of the way.
- * AssemblyBuilder.cs: don't use internalcalls, more stuff supported.
- * FieldBuilder.cs: implemented.
- * ILGenerator.cs: implemented some opcode handling.
- * Label.cs: add constructor.
- * LocalBuilder.cs: implemented.
- * MethodBuilder.cs: don't use internalcalls, more implemented stuff.
- * ModuleBuilder.cs: don't use internalcalls, more meat here, too.
- * ParameterBuilder.cs: implemented.
- * PropertyBuilder.cs: implemented.
- * TypeBuilder.cs: don't use internalcalls, more stuff working.
-
-Tue Sep 25 16:48:50 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * ConstructorInfo.cs, MemberFilter.cs, Module.cs: added.
-
-Fri Sep 14 16:12:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * MethodBase.cs, MethodInfo.cs: added.
-
-Thu Sep 13 18:05:16 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Assembly.cs: added stub code.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * BindingFlags.cs: Add.
diff --git a/mcs/class/corlib/System.Reflection/ConstructorInfo.cs b/mcs/class/corlib/System.Reflection/ConstructorInfo.cs
deleted file mode 100644
index 936f50ef8df..00000000000
--- a/mcs/class/corlib/System.Reflection/ConstructorInfo.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Reflection/ConstructorInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Reflection {
- [Serializable]
- public abstract class ConstructorInfo : MethodBase {
- public static readonly string ConstructorName = ".ctor";
- public static readonly string TypeConstructorName = ".cctor";
-
- protected ConstructorInfo() {
- }
-
- public override MemberTypes MemberType {
- get {return MemberTypes.Constructor;}
- }
-
- public object Invoke (object[] parameters)
- {
- if (parameters == null)
- parameters = new object [0];
-
- return Invoke (BindingFlags.CreateInstance, null, parameters, null);
- }
-
- public abstract object Invoke (BindingFlags invokeAttr, Binder binder, object[] parameters,
- CultureInfo culture);
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs b/mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs
deleted file mode 100644
index 0e1c5c3692e..00000000000
--- a/mcs/class/corlib/System.Reflection/CustomAttributeFormatException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Reflection.CustomAttributeFormatException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public class CustomAttributeFormatException : FormatException
- {
- // Constructors
- public CustomAttributeFormatException ()
- : base (Locale.GetText ("The Binary format of the custom attribute is invalid."))
- {
- }
- public CustomAttributeFormatException (string message)
- : base (message)
- {
- }
-
- public CustomAttributeFormatException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected CustomAttributeFormatException (SerializationInfo info,
- StreamingContext context)
- {
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs b/mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs
deleted file mode 100644
index 855cff8ed7d..00000000000
--- a/mcs/class/corlib/System.Reflection/DefaultMemberAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Reflection.DefaultMemberAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection {
-
- [Serializable]
- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Interface)]
- public sealed class DefaultMemberAttribute : Attribute {
- string member_name;
-
- public DefaultMemberAttribute (string member_name)
- {
- this.member_name = member_name;
- }
-
- public string MemberName {
- get {
- return member_name;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/EventAttributes.cs b/mcs/class/corlib/System.Reflection/EventAttributes.cs
deleted file mode 100755
index efb1154e21c..00000000000
--- a/mcs/class/corlib/System.Reflection/EventAttributes.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// EventAttributes.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:39:03 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum EventAttributes {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- SpecialName = 512,
-
- /// <summary>
- /// </summary>
- ReservedMask = 1024,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 1024,
- } // EventAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/EventInfo.cs b/mcs/class/corlib/System.Reflection/EventInfo.cs
deleted file mode 100755
index 0cbd6620592..00000000000
--- a/mcs/class/corlib/System.Reflection/EventInfo.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.Reflection/EventInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-
-namespace System.Reflection {
- public abstract class EventInfo : MemberInfo {
-
- public abstract EventAttributes Attributes {get;}
-
- public Type EventHandlerType {
- get {
- ParameterInfo[] p;
- MethodInfo add = GetAddMethod (true);
- p = add.GetParameters ();
- if (p.Length > 0) {
- Type t = p [0].ParameterType;
- /* is it alwasys the first arg?
- if (!t.IsSubclassOf (typeof (System.Delegate)))
- throw new Exception ("no delegate in event");*/
- return t;
- } else
- return null;
- }
- }
- public bool IsMulticast {get {return true;}}
- public bool IsSpecialName {get {return false;}}
- public override MemberTypes MemberType {
- get {return MemberTypes.Event;}
- }
-
- protected EventInfo() {
- }
-
- public void AddEventHandler( object target, Delegate handler) {
- }
- public MethodInfo GetAddMethod() {
- return GetAddMethod (false);
- }
- public abstract MethodInfo GetAddMethod(bool nonPublic);
- public MethodInfo GetRaiseMethod() {
- return GetRaiseMethod (false);
- }
- public abstract MethodInfo GetRaiseMethod( bool nonPublic);
- public MethodInfo GetRemoveMethod() {
- return GetRemoveMethod (false);
- }
- public abstract MethodInfo GetRemoveMethod( bool nonPublic);
- public void RemoveEventHandler( object target, Delegate handler) {
- }
-
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
- public override Type ReflectedType {
- get {
- return null;
- }
- }
- public override Type DeclaringType {
- get {
- return null;
- }
- }
-
- public override String Name {
- get {
- return "Eventname";
- }
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/FieldAttributes.cs b/mcs/class/corlib/System.Reflection/FieldAttributes.cs
deleted file mode 100755
index 5462fc2b102..00000000000
--- a/mcs/class/corlib/System.Reflection/FieldAttributes.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-// FieldAttributes.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:39:12 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum FieldAttributes {
-
- /// <summary>
- /// </summary>
- FieldAccessMask = 7,
-
- /// <summary>
- /// </summary>
- PrivateScope = 0x0,
-
- /// <summary>
- /// </summary>
- Private = 0x1,
-
- /// <summary>
- /// </summary>
- FamANDAssem = 0x2,
-
- /// <summary>
- /// </summary>
- Assembly = 0x3,
-
- /// <summary>
- /// </summary>
- Family = 0x4,
-
- /// <summary>
- /// </summary>
- FamORAssem = 0x5,
-
- /// <summary>
- /// </summary>
- Public = 0x6,
-
- /// <summary>
- /// </summary>
- Static = 0x10,
-
- /// <summary>
- /// </summary>
- InitOnly = 0x20,
-
- /// <summary>
- /// </summary>
- Literal = 0x40,
-
- /// <summary>
- /// </summary>
- NotSerialized = 0x80,
-
- /// <summary>
- /// </summary>
- HasFieldRVA = 0x100,
-
- /// <summary>
- /// </summary>
- SpecialName = 0x200,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 0x400,
-
- /// <summary>
- /// </summary>
- HasFieldMarshal = 0x1000,
-
- /// <summary>
- /// </summary>
- PinvokeImpl = 0x2000,
-
- /// <summary>
- /// </summary>
- // HasSecurity = 0x4000,
-
- /// <summary>
- /// </summary>
- HasDefault = 0x8000,
-
- /// <summary>
- /// </summary>
- ReservedMask = HasDefault | HasFieldMarshal | RTSpecialName | HasFieldRVA,
-
- } // FieldAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/FieldInfo.cs b/mcs/class/corlib/System.Reflection/FieldInfo.cs
deleted file mode 100755
index 16dfd9c3941..00000000000
--- a/mcs/class/corlib/System.Reflection/FieldInfo.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// System.Reflection.FieldInfo.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System.Reflection {
-
- [Serializable]
- public abstract class FieldInfo : MemberInfo {
-
- public abstract FieldAttributes Attributes {get;}
- public abstract RuntimeFieldHandle FieldHandle {get;}
-
- public abstract Type FieldType { get; }
-
- public abstract object GetValue(object obj);
-
- public override MemberTypes MemberType {
- get { return MemberTypes.Field;}
- }
-
- public bool IsLiteral
- {
- get {return (Attributes & FieldAttributes.Literal) != 0;}
- }
-
- public bool IsStatic
- {
- get {return (Attributes & FieldAttributes.Static) != 0;}
- }
-
- public bool IsInitOnly
- {
- get {return (Attributes & FieldAttributes.InitOnly) != 0;}
- }
- public Boolean IsPublic
- {
- get
- {
- return (Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Public;
- }
- }
- public Boolean IsPrivate
- {
- get
- {
- return (Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Private;
- }
- }
- public Boolean IsFamily
- {
- get
- {
- return (Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Family;
- }
- }
- public Boolean IsAssembly
- {
- get
- {
- return (Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Assembly;
- }
- }
- public Boolean IsFamilyAndAssembly
- {
- get {
- return (Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.FamANDAssem;
- }
- }
- public Boolean IsFamilyOrAssembly
- {
- get
- {
- return (Attributes & FieldAttributes.FieldAccessMask) == FieldAttributes.FamORAssem;
- }
- }
- public Boolean IsPinvokeImpl
- {
- get
- {
- return (Attributes & FieldAttributes.PinvokeImpl) == FieldAttributes.PinvokeImpl;
- }
- }
- public Boolean IsSpecialName
- {
- get
- {
- return (Attributes & FieldAttributes.SpecialName) == FieldAttributes.SpecialName;
- }
- }
- public Boolean IsNotSerialized
- {
- get
- {
- return (Attributes & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized;
- }
- }
-
- public abstract void SetValue (object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture);
-
- [MonoTODO]
- public void SetValue( object obj, object value) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs b/mcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs
deleted file mode 100755
index c0c06c274ac..00000000000
--- a/mcs/class/corlib/System.Reflection/ICustomAttributeProvider.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Reflection.ICustomAttributeProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-namespace System.Reflection {
-
- public interface ICustomAttributeProvider {
-
- object [] GetCustomAttributes (bool inherit);
- object [] GetCustomAttributes (Type attribute_type, bool inherit);
-
- /// <summary>
- /// Probes whether one or more `attribute_type' types are
- /// defined by this member
- /// </summary>
- bool IsDefined (Type attribute_type, bool inherit);
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/IReflect.cs b/mcs/class/corlib/System.Reflection/IReflect.cs
deleted file mode 100755
index e89c3298a69..00000000000
--- a/mcs/class/corlib/System.Reflection/IReflect.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Reflection.IReflect.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System.Globalization;
-
-namespace System.Reflection {
-
- public interface IReflect {
-
- Type UnderlyingSystemType {
- get;
- }
-
- FieldInfo GetField (string name, BindingFlags binding_attr);
- FieldInfo [] GetFields (BindingFlags binding_attr);
- MemberInfo[] GetMember (string name, BindingFlags binding_attr);
- MemberInfo[] GetMembers (BindingFlags binding_attr);
- MethodInfo GetMethod (string name, BindingFlags binding_attr);
- MethodInfo GetMethod (string name, BindingFlags binding_attr,
- Binder binder, Type [] types, ParameterModifier [] modifiers);
- MethodInfo[] GetMethods (BindingFlags binding_attr);
-
- PropertyInfo [] GetProperties (BindingFlags binding_attr);
- PropertyInfo GetProperty (string name, BindingFlags binding_attr);
- PropertyInfo GetProperty (string name, BindingFlags binding_attr,
- Binder binder, Type return_type, Type [] types,
- ParameterModifier [] modifiers);
-
- object InvokeMember (string name, BindingFlags invoke_attr,
- Binder binder, object target, object [] args,
- ParameterModifier [] modifiers,
- CultureInfo culture,
- string [] named_parameters);
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/InterfaceMapping.cs b/mcs/class/corlib/System.Reflection/InterfaceMapping.cs
deleted file mode 100755
index 8da05148398..00000000000
--- a/mcs/class/corlib/System.Reflection/InterfaceMapping.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-
-namespace System.Reflection {
-
- public struct InterfaceMapping {
- public MethodInfo[] InterfaceMethods;
- public Type InterfaceType;
- public MethodInfo[] TargetMethods;
- public Type TargetType;
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs b/mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs
deleted file mode 100644
index f1a73377a28..00000000000
--- a/mcs/class/corlib/System.Reflection/InvalidFilterCriteriaException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Reflection.InvalidFilterCriteriaException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public class InvalidFilterCriteriaException : ApplicationException
- {
- public InvalidFilterCriteriaException ()
- : base (Locale.GetText ("Filter Criteria is not valid."))
- {
- }
- public InvalidFilterCriteriaException (string message)
- : base (message)
- {
- }
-
- public InvalidFilterCriteriaException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected InvalidFilterCriteriaException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs b/mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs
deleted file mode 100644
index 76a359fa5a1..00000000000
--- a/mcs/class/corlib/System.Reflection/ManifestResourceInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// System.Reflection.ManifestResourceInfo
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-namespace System.Reflection
-{
- public class ManifestResourceInfo
- {
- private Assembly _assembly;
- private string _filename;
- private ResourceLocation _location;
-
- internal ManifestResourceInfo (Assembly assembly, string filename, ResourceLocation location)
- {
- _assembly = assembly;
- _filename = filename;
- _location = location;
- }
- [MonoTODO]
- public virtual string FileName {
- get { return _filename; }
- }
-
- [MonoTODO]
- public virtual Assembly ReferencedAssembly {
- get { return _assembly; }
- }
-
- [MonoTODO]
- public virtual ResourceLocation ResourceLocation {
- get { return _location; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MemberFilter.cs b/mcs/class/corlib/System.Reflection/MemberFilter.cs
deleted file mode 100644
index 74e73a69ce3..00000000000
--- a/mcs/class/corlib/System.Reflection/MemberFilter.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace System.Reflection {
- public delegate bool MemberFilter( MemberInfo m, object filterCriteria);
-
-}
diff --git a/mcs/class/corlib/System.Reflection/MemberInfo.cs b/mcs/class/corlib/System.Reflection/MemberInfo.cs
deleted file mode 100755
index 9e3c52b8038..00000000000
--- a/mcs/class/corlib/System.Reflection/MemberInfo.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Reflection.MemberInfo.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-namespace System.Reflection {
-
- [Serializable]
- public abstract class MemberInfo : ICustomAttributeProvider {
-
- public abstract Type DeclaringType {
- get;
- }
-
- public abstract MemberTypes MemberType {
- get;
- }
-
- public abstract string Name {
- get;
- }
-
- public abstract Type ReflectedType {
- get;
- }
-
- public abstract bool IsDefined (Type attribute_type, bool inherit);
-
- public abstract object [] GetCustomAttributes (bool inherit);
-
- public abstract object [] GetCustomAttributes (Type attribute_type, bool inherit);
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MemberTypes.cs b/mcs/class/corlib/System.Reflection/MemberTypes.cs
deleted file mode 100755
index 00a1234ef36..00000000000
--- a/mcs/class/corlib/System.Reflection/MemberTypes.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// MemberTypes.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:38:53 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum MemberTypes {
-
- /// <summary>
- /// </summary>
- Constructor = 1,
-
- /// <summary>
- /// </summary>
- Event = 2,
-
- /// <summary>
- /// </summary>
- Field = 4,
-
- /// <summary>
- /// </summary>
- Method = 8,
-
- /// <summary>
- /// </summary>
- Property = 16,
-
- /// <summary>
- /// </summary>
- TypeInfo = 32,
-
- /// <summary>
- /// </summary>
- Custom = 64,
-
- /// <summary>
- /// </summary>
- NestedType = 128,
-
- /// <summary>
- /// </summary>
- All = 191,
- } // MemberTypes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/MethodAttributes.cs b/mcs/class/corlib/System.Reflection/MethodAttributes.cs
deleted file mode 100755
index 51ac6f18a6a..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodAttributes.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-// MethodAttributes.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:39:32 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum MethodAttributes {
-
- /// <summary>
- /// </summary>
- MemberAccessMask = 7,
-
- /// <summary>
- /// </summary>
- PrivateScope = 0,
-
- /// <summary>
- /// </summary>
- Private = 1,
-
- /// <summary>
- /// </summary>
- FamANDAssem = 2,
-
- /// <summary>
- /// </summary>
- Assembly = 3,
-
- /// <summary>
- /// </summary>
- Family = 4,
-
- /// <summary>
- /// </summary>
- FamORAssem = 5,
-
- /// <summary>
- /// </summary>
- Public = 6,
-
- /// <summary>
- /// </summary>
- Static = 16,
-
- /// <summary>
- /// </summary>
- Final = 32,
-
- /// <summary>
- /// </summary>
- Virtual = 64,
-
- /// <summary>
- /// </summary>
- HideBySig = 128,
-
- /// <summary>
- /// </summary>
- VtableLayoutMask = 256,
-
- /// <summary>
- /// </summary>
- ReuseSlot = 0,
-
- /// <summary>
- /// </summary>
- NewSlot = 256,
-
- /// <summary>
- /// </summary>
- Abstract = 1024,
-
- /// <summary>
- /// </summary>
- SpecialName = 2048,
-
- /// <summary>
- /// </summary>
- PinvokeImpl = 8192,
-
- /// <summary>
- /// </summary>
- UnmanagedExport = 8,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 4096,
-
- /// <summary>
- /// </summary>
- ReservedMask = 53248,
-
- /// <summary>
- /// </summary>
- HasSecurity = 16384,
-
- /// <summary>
- /// </summary>
- RequireSecObject = 32768,
- } // MethodAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/MethodBase.cs b/mcs/class/corlib/System.Reflection/MethodBase.cs
deleted file mode 100644
index 7e24b38b449..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodBase.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.Reflection/MethodBase.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Reflection.Emit;
-
-namespace System.Reflection {
-
- [Serializable]
- public abstract class MethodBase: MemberInfo {
-
- public static MethodBase GetCurrentMethod()
- {
- return null;
- }
-
- public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle)
- {
- return null;
- }
-
- public abstract MethodImplAttributes GetMethodImplementationFlags();
-
- public abstract ParameterInfo[] GetParameters();
-
- public Object Invoke(Object obj, Object[] parameters) {
- return Invoke (obj, 0, null, parameters, null);
- }
-
- public abstract Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture);
-
- protected MethodBase()
- {
- }
-
- public abstract RuntimeMethodHandle MethodHandle { get; }
- public abstract MethodAttributes Attributes { get; }
- public virtual CallingConventions CallingConvention { get {return CallingConventions.Standard;} }
- public Boolean IsPublic {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Public;
- }
- }
- public Boolean IsPrivate {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Private;
- }
- }
- public Boolean IsFamily {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Family;
- }
- }
- public Boolean IsAssembly {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Assembly;
- }
- }
- public Boolean IsFamilyAndAssembly {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.FamANDAssem;
- }
- }
- public Boolean IsFamilyOrAssembly {
- get {
- return (Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.FamORAssem;
- }
- }
- public Boolean IsStatic {
- get {
- return (Attributes & MethodAttributes.Static) != 0;
- }
- }
- public Boolean IsFinal {
- get {
- return (Attributes & MethodAttributes.Final) != 0;
- }
- }
- public Boolean IsVirtual {
- get {
- return (Attributes & MethodAttributes.Virtual) != 0;
- }
- }
- public Boolean IsHideBySig {
- get {
- return (Attributes & MethodAttributes.HideBySig) != 0;
- }
- }
- public Boolean IsAbstract {
- get {
- return (Attributes & MethodAttributes.Abstract) != 0;
- }
- }
- public Boolean IsSpecialName {
- get {
- int attr = (int)Attributes;
- return (attr & (int)MethodAttributes.SpecialName) != 0;
- }
- }
- public Boolean IsConstructor {
- get {
- int attr = (int)Attributes;
- return ((attr & (int)MethodAttributes.RTSpecialName) != 0
- && (Name == ".ctor"));
- }
- }
-
- internal virtual int get_next_table_index (object obj, int table, bool inc) {
- if (this is MethodBuilder) {
- MethodBuilder mb = (MethodBuilder)this;
- return mb.get_next_table_index (obj, table, inc);
- }
- if (this is ConstructorBuilder) {
- ConstructorBuilder mb = (ConstructorBuilder)this;
- return mb.get_next_table_index (obj, table, inc);
- }
- throw new Exception ("Method is not a builder method");
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MethodImplAttributes.cs b/mcs/class/corlib/System.Reflection/MethodImplAttributes.cs
deleted file mode 100755
index aaa243ab6d3..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodImplAttributes.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// MethodImplAttributes.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:39:42 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- public enum MethodImplAttributes {
-
- /// <summary>
- /// </summary>
- CodeTypeMask = 3,
-
- /// <summary>
- /// </summary>
- IL = 0,
-
- /// <summary>
- /// </summary>
- Native = 1,
-
- /// <summary>
- /// </summary>
- OPTIL = 2,
-
- /// <summary>
- /// </summary>
- Runtime = 3,
-
- /// <summary>
- /// </summary>
- ManagedMask = 4,
-
- /// <summary>
- /// </summary>
- Unmanaged = 4,
-
- /// <summary>
- /// </summary>
- Managed = 0,
-
- /// <summary>
- /// </summary>
- ForwardRef = 16,
-
- /// <summary>
- /// </summary>
- PreserveSig = 128,
-
- /// <summary>
- /// </summary>
- InternalCall = 4096,
-
- /// <summary>
- /// </summary>
- Synchronized = 32,
-
- /// <summary>
- /// </summary>
- NoInlining = 8,
-
- /// <summary>
- /// </summary>
- MaxMethodImplVal = 65535,
- } // MethodImplAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/MethodInfo.cs b/mcs/class/corlib/System.Reflection/MethodInfo.cs
deleted file mode 100644
index 505a9b626bd..00000000000
--- a/mcs/class/corlib/System.Reflection/MethodInfo.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Reflection/MethodInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Reflection {
-
- [Serializable]
- public abstract class MethodInfo: MethodBase {
-
- public abstract MethodInfo GetBaseDefinition();
-
- protected MethodInfo() {
- }
- public override MemberTypes MemberType { get {return MemberTypes.Method;} }
- public abstract Type ReturnType { get; }
- public abstract ICustomAttributeProvider ReturnTypeCustomAttributes { get; }
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/Missing.cs b/mcs/class/corlib/System.Reflection/Missing.cs
deleted file mode 100644
index dfce32dae3e..00000000000
--- a/mcs/class/corlib/System.Reflection/Missing.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Reflection.Missing.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Reflection
-{
- public sealed class Missing
- {
- public static readonly Missing Value;
-
- internal Missing () {}
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/Module.cs b/mcs/class/corlib/System.Reflection/Module.cs
deleted file mode 100644
index 2d1c8005446..00000000000
--- a/mcs/class/corlib/System.Reflection/Module.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// System.Reflection/Module.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Security.Cryptography.X509Certificates;
-
-namespace System.Reflection {
- [Serializable]
- public class Module : ISerializable, ICustomAttributeProvider {
-
- public static readonly TypeFilter FilterTypeName;
- public static readonly TypeFilter FilterTypeNameIgnoreCase;
-
- private IntPtr _impl; /* a pointer to a MonoImage */
- internal Assembly assembly;
- internal string fqname;
- internal string name;
- internal string scopename;
-
- internal Module () {}
-
- public Assembly Assembly {get {return assembly;}}
- public virtual string FullyQualifiedName {get {return fqname;}}
- public string Name {get {return name;}}
- public string ScopeName {get {return scopename;}}
-
-
- public virtual Type[] FindTypes(TypeFilter filter, object filterCriteria) {
- return null;
- }
- public virtual object[] GetCustomAttributes(bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
- public FieldInfo GetField(string name) {
- return null;
- }
- public FieldInfo GetField(string name, BindingFlags flags) {
- return null;
- }
- public FieldInfo[] GetFields() {
- return null;
- }
-
- public MethodInfo GetMethod(string name) {
- return null;
- }
- public MethodInfo GetMethod(string name, Type[] types) {
- return null;
- }
- public MethodInfo GetMethod( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- protected virtual MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- return null;
- }
- public MethodInfo[] GetMethods() {
- return null;
- }
- public virtual void GetObjectData( SerializationInfo info, StreamingContext context) {}
- public X509Certificate GetSignerCertificate() {
- return null;
- }
- public virtual Type GetType(string className) {
- return null;
- }
- public virtual Type GetType(string className, bool ignoreCase) {
- return null;
- }
- public virtual Type GetType(string className, bool throwOnError, bool ignoreCase) {
- return null;
- }
- public virtual Type[] GetTypes() {
- return null;
- }
- public virtual bool IsDefined( Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
- public bool IsResource() {
- return false;
- }
- public override string ToString() {
- return "Reflection.Module: " + name;
- }
-
-
-
-
-
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/MonoEvent.cs b/mcs/class/corlib/System.Reflection/MonoEvent.cs
deleted file mode 100755
index 925af97b50f..00000000000
--- a/mcs/class/corlib/System.Reflection/MonoEvent.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Reflection/MonoEvent.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
- internal struct MonoEventInfo {
- public Type parent;
- public String name;
- public MethodInfo add_method;
- public MethodInfo remove_method;
- public MethodInfo raise_method;
- public EventAttributes attrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_event_info (MonoEvent ev, out MonoEventInfo info);
- }
-
- internal sealed class MonoEvent: EventInfo {
- IntPtr klass;
- IntPtr handle;
-
- public override EventAttributes Attributes {
- get {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.attrs;
- }
- }
-
- public override MethodInfo GetAddMethod(bool nonPublic) {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.add_method;
- }
- public override MethodInfo GetRaiseMethod( bool nonPublic) {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.raise_method;
- }
- public override MethodInfo GetRemoveMethod( bool nonPublic) {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.remove_method;
- }
-
- public override Type DeclaringType {
- get {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoEventInfo info;
- MonoEventInfo.get_event_info (this, out info);
-
- return info.name;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MonoField.cs b/mcs/class/corlib/System.Reflection/MonoField.cs
deleted file mode 100755
index 1c427e14164..00000000000
--- a/mcs/class/corlib/System.Reflection/MonoField.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-
-//
-// System.Reflection/MonoField.cs
-// The class used to represent Fields from the mono runtime.
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
-
- internal struct MonoFieldInfo {
- public Type parent;
- public Type type;
- public String name;
- public FieldAttributes attrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_field_info (MonoField field, out MonoFieldInfo info);
- }
-
- internal class MonoField : FieldInfo {
- internal IntPtr klass;
- internal RuntimeFieldHandle fhandle;
-
- public override FieldAttributes Attributes {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.attrs;
- }
- }
- public override RuntimeFieldHandle FieldHandle {
- get {return fhandle;}
- }
-
- public override Type FieldType {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.type;
- }
- }
-
- public override Type ReflectedType {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return info.name;
- }
- }
-
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override object GetValue(object obj);
-
- public override string ToString () {
- MonoFieldInfo info;
- MonoFieldInfo.get_field_info (this, out info);
- return String.Format ("{0} {1}", info.type, info.name);
- }
-
- [MonoTODO]
- public override void SetValue (object obj, object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MonoMethod.cs b/mcs/class/corlib/System.Reflection/MonoMethod.cs
deleted file mode 100755
index 0c9e0975868..00000000000
--- a/mcs/class/corlib/System.Reflection/MonoMethod.cs
+++ /dev/null
@@ -1,205 +0,0 @@
-//
-// System.Reflection/MonoMethod.cs
-// The class used to represent methods from the mono runtime.
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
- internal struct MonoMethodInfo {
- internal Type parent;
- internal Type ret;
- internal MethodAttributes attrs;
- internal MethodImplAttributes iattrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_method_info (RuntimeMethodHandle handle, out MonoMethodInfo info);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern ParameterInfo[] get_parameter_info (RuntimeMethodHandle handle);
- };
-
- /*
- * Note: most of this class needs to be duplicated for the contructor, since
- * the .NET reflection class hierarchy is so broken.
- */
- internal class MonoMethod : MethodInfo {
- internal RuntimeMethodHandle mhandle;
- string name;
-
- [MonoTODO]
- public override MethodInfo GetBaseDefinition() {
- return this; /* FIXME */
- }
- public override Type ReturnType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.ret;
- }
- }
- public override ICustomAttributeProvider ReturnTypeCustomAttributes {
- get {return null;}
- }
-
- public override MethodImplAttributes GetMethodImplementationFlags() {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.iattrs;
- }
-
- public override ParameterInfo[] GetParameters() {
- return MonoMethodInfo.get_parameter_info (mhandle);
- }
-
- /*
- * InternalInvoke() receives the parameters corretcly converted by the binder
- * to match the types of the method signature.
- */
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern Object InternalInvoke (Object obj, Object[] parameters);
-
- [MonoTODO]
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- // fixme: consider all other parameters
- return InternalInvoke (obj, parameters);
- }
-
- public override RuntimeMethodHandle MethodHandle {
- get {return mhandle;}
- }
- public override MethodAttributes Attributes {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.attrs;
- }
- }
-
- public override Type ReflectedType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- return name;
- }
- }
-
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public override string ToString () {
- string parms = "";
- ParameterInfo[] p = GetParameters ();
- for (int i = 0; i < p.Length; ++i) {
- if (i > 0)
- parms = parms + ", ";
- parms = parms + p [i].ParameterType.Name;
- }
- return ReturnType.Name+" "+Name+"("+parms+")";
- }
- }
-
- internal class MonoCMethod : ConstructorInfo {
- internal RuntimeMethodHandle mhandle;
- string name;
-
- public override MethodImplAttributes GetMethodImplementationFlags() {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.iattrs;
- }
-
- public override ParameterInfo[] GetParameters() {
- return MonoMethodInfo.get_parameter_info (mhandle);
- }
-
- /*
- * InternalInvoke() receives the parameters corretcly converted by the binder
- * to match the types of the method signature.
- */
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern Object InternalInvoke (Object obj, Object[] parameters);
-
- public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- throw new NotImplementedException ();
- }
-
- public override Object Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
- return InternalInvoke (null, parameters);
- }
-
- public override RuntimeMethodHandle MethodHandle {
- get {return mhandle;}
- }
- public override MethodAttributes Attributes {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.attrs;
- }
- }
-
- public override Type ReflectedType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoMethodInfo info;
- MonoMethodInfo.get_method_info (mhandle, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- return name;
- }
- }
-
- [MonoTODO]
- public override bool IsDefined (Type attribute_type, bool inherit) {
- return false;
- }
-
- [MonoTODO]
- public override object[] GetCustomAttributes (bool inherit) {
- return null;
- }
-
- [MonoTODO]
- public override object[] GetCustomAttributes (Type attributeType, bool inherit) {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/MonoProperty.cs b/mcs/class/corlib/System.Reflection/MonoProperty.cs
deleted file mode 100755
index 20d0124fe25..00000000000
--- a/mcs/class/corlib/System.Reflection/MonoProperty.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// System.Reflection/MonoProperty.cs
-// The class used to represent Properties from the mono runtime.
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Patrik Torstensson (patrik.torstensson@labs2.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection {
-
- internal struct MonoPropertyInfo {
- public Type parent;
- public String name;
- public MethodInfo get_method;
- public MethodInfo set_method;
- public PropertyAttributes attrs;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern void get_property_info (MonoProperty prop, out MonoPropertyInfo info);
- }
-
- internal class MonoProperty : PropertyInfo {
- internal IntPtr klass;
- internal IntPtr prop;
-
- public override PropertyAttributes Attributes {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.attrs;
- }
- }
- public override bool CanRead {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return (info.get_method != null);
- }
- }
- public override bool CanWrite {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return (info.set_method != null);
- }
- }
-
- [MonoTODO]
- public override Type PropertyType {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
-
- if (info.get_method != null) {
- return info.get_method.ReturnType;
- } else {
- // FIXME: take the last param to set_method
- return null;
- }
- }
- }
- public override Type ReflectedType {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.parent;
- }
- }
- public override Type DeclaringType {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.parent;
- }
- }
- public override string Name {
- get {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.name;
- }
- }
-
- [MonoTODO]
- public override MethodInfo[] GetAccessors( bool nonPublic) {
- // FIXME: check nonPublic
- MonoPropertyInfo info;
- int n = 0;
- MonoPropertyInfo.get_property_info (this, out info);
- if (info.set_method != null)
- n++;
- if (info.get_method != null)
- n++;
- MethodInfo[] res = new MethodInfo [n];
- n = 0;
- if (info.set_method != null)
- res [n++] = info.set_method;
- if (info.get_method != null)
- res [n++] = info.get_method;
- return res;
- }
-
- [MonoTODO]
- public override MethodInfo GetGetMethod( bool nonPublic) {
- // FIXME: check nonPublic
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.get_method;
- }
- public override ParameterInfo[] GetIndexParameters() {
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- if (info.get_method != null)
- return info.get_method.GetParameters ();
- return new ParameterInfo [0];
- }
- public override MethodInfo GetSetMethod( bool nonPublic) {
- // FIXME: check nonPublic
- MonoPropertyInfo info;
- MonoPropertyInfo.get_property_info (this, out info);
- return info.set_method;
- }
- public override bool IsDefined (Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes( bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
- public override object[] GetCustomAttributes( Type attributeType, bool inherit) {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public override object GetValue( object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- object ret = null;
-
- if (index == null || index.Length == 0) {
- MethodInfo method = GetGetMethod(false);
-
- ret = method.Invoke(obj, invokeAttr, binder, null, culture);
- }
-
- // fixme: support indexed parameters..
-
- return ret;
- }
-
- public override void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture) {
- }
-
- public override string ToString () {
- return PropertyType.ToString () + " " + Name;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Reflection/ParameterAttributes.cs b/mcs/class/corlib/System.Reflection/ParameterAttributes.cs
deleted file mode 100755
index eaf409d8b1c..00000000000
--- a/mcs/class/corlib/System.Reflection/ParameterAttributes.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// ParameterAttributes.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:39: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
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ParameterAttributes {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- In = 1,
-
- /// <summary>
- /// </summary>
- Out = 2,
-
- /// <summary>
- /// </summary>
- Lcid = 4,
-
- /// <summary>
- /// </summary>
- Retval = 8,
-
- /// <summary>
- /// </summary>
- Optional = 16,
-
- /// <summary>
- /// </summary>
- ReservedMask = 61440,
-
- /// <summary>
- /// </summary>
- HasDefault = 4096,
-
- /// <summary>
- /// </summary>
- HasFieldMarshal = 8192,
-
- /// <summary>
- /// </summary>
- Reserved3 = 16384,
-
- /// <summary>
- /// </summary>
- Reserved4 = 32768,
- } // ParameterAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/ParameterInfo.cs b/mcs/class/corlib/System.Reflection/ParameterInfo.cs
deleted file mode 100644
index 52702c9a9fc..00000000000
--- a/mcs/class/corlib/System.Reflection/ParameterInfo.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-// System.Reflection.ParameterInfo
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.Reflection.Emit;
-
-namespace System.Reflection
-{
- [Serializable]
- public class ParameterInfo : ICustomAttributeProvider
- {
- protected Type ClassImpl;
- protected object DefaultValueImpl;
- protected MemberInfo MemberImpl;
- protected string NameImpl;
- protected int PositionImpl;
- protected ParameterAttributes AttrsImpl;
-
- protected ParameterInfo () {
- }
-
- internal ParameterInfo (ParameterBuilder pb, Type type, MemberInfo member) {
- this.ClassImpl = type;
- this.MemberImpl = member;
- this.NameImpl = pb.Name;
- this.PositionImpl = pb.Position;
- this.AttrsImpl = (ParameterAttributes) pb.Attributes;
- }
-
- public virtual Type ParameterType {
- get {return ClassImpl;}
- }
- public virtual ParameterAttributes Attributes {
- get {return AttrsImpl;}
- }
- public virtual object DefaultValue {
- get {return DefaultValueImpl;}
- }
-
- public bool IsIn {
- get {return (AttrsImpl & ParameterAttributes.In) != 0;}
- }
-
- public bool IsLcid {
- get {return (AttrsImpl & ParameterAttributes.Lcid) != 0;}
- }
-
- public bool IsOptional {
- get {return (AttrsImpl & ParameterAttributes.Optional) != 0;}
- }
-
- public bool IsOut {
- get {return (AttrsImpl & ParameterAttributes.Out) != 0;}
- }
-
- public bool IsRetval {
- get {return (AttrsImpl & ParameterAttributes.Retval) != 0;}
- }
-
- public virtual MemberInfo Member {
- get {return MemberImpl;}
- }
-
- public virtual string Name {
- get {return NameImpl;}
- }
-
- public virtual int Position {
- get {return PositionImpl;}
- }
-
- public virtual object[] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
-
- public virtual object[] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public virtual bool IsDefined( Type attributeType, bool inherit) {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ParameterModifier.cs b/mcs/class/corlib/System.Reflection/ParameterModifier.cs
deleted file mode 100755
index 4615e1931dd..00000000000
--- a/mcs/class/corlib/System.Reflection/ParameterModifier.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Reflection/ParameterModifier.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// Copyright (c) 2001 Ximian, Inc
-
-using System;
-
-namespace System.Reflection {
- public struct ParameterModifier {
- private bool[] data;
-
- public ParameterModifier (int paramaterCount) {
- data = new bool [paramaterCount];
- }
-
- public bool this [int index] {
- get {return data [index];}
- set {data [index] = value;}
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Reflection/PropertyAttributes.cs b/mcs/class/corlib/System.Reflection/PropertyAttributes.cs
deleted file mode 100755
index 7cb7359dba0..00000000000
--- a/mcs/class/corlib/System.Reflection/PropertyAttributes.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-// PropertyAttributes.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:40: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
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum PropertyAttributes {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- SpecialName = 512,
-
- /// <summary>
- /// </summary>
- ReservedMask = 62464,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 1024,
-
- /// <summary>
- /// </summary>
- HasDefault = 4096,
-
- /// <summary>
- /// </summary>
- Reserved2 = 8192,
-
- /// <summary>
- /// </summary>
- Reserved3 = 16384,
-
- /// <summary>
- /// </summary>
- Reserved4 = 32768,
- } // PropertyAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/PropertyInfo.cs b/mcs/class/corlib/System.Reflection/PropertyInfo.cs
deleted file mode 100755
index 383bef59fc8..00000000000
--- a/mcs/class/corlib/System.Reflection/PropertyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.Reflection/PropertyInfo.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Reflection {
- [Serializable]
- public abstract class PropertyInfo : MemberInfo {
-
- public abstract PropertyAttributes Attributes {get;}
- public abstract bool CanRead {get;}
- public abstract bool CanWrite {get;}
-
- public bool IsSpecialName {
- get {return (Attributes & PropertyAttributes.SpecialName) != 0;}
- }
-
- public override MemberTypes MemberType {
- get {return MemberTypes.Property;}
- }
- public abstract Type PropertyType {get;}
-
- protected PropertyInfo() {
- }
-
- public MethodInfo[] GetAccessors() {
- return GetAccessors (false);
- }
- public abstract MethodInfo[] GetAccessors( bool nonPublic);
- public MethodInfo GetGetMethod() {
- return GetGetMethod (false);
- }
- public abstract MethodInfo GetGetMethod( bool nonPublic);
- public abstract ParameterInfo[] GetIndexParameters();
- public MethodInfo GetSetMethod() {
- return GetSetMethod (false);
- }
- public abstract MethodInfo GetSetMethod( bool nonPublic);
- public virtual object GetValue( object obj, object[] index) {
- return GetValue(obj, BindingFlags.Default, null, index, null);
- }
- public abstract object GetValue( object obj, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
- public virtual void SetValue( object obj, object value, object[] index) {
- }
- public abstract void SetValue( object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, CultureInfo culture);
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs b/mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs
deleted file mode 100644
index 7680b4c37b5..00000000000
--- a/mcs/class/corlib/System.Reflection/ReflectionTypeLoadException.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Reflection.ReflectionTypeLoadException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Dunan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public sealed class ReflectionTypeLoadException : SystemException
- {
- // Fields
- private Exception[] loaderExceptions;
- private Type[] types;
-
- // Constructors
- public ReflectionTypeLoadException (Type[] classes, Exception[] exceptions)
- : base (Locale.GetText ("The classes in the module cannot be loaded."))
- {
- loaderExceptions = exceptions;
- types = classes;
- }
-
- public ReflectionTypeLoadException (Type[] classes, Exception[] exceptions, string message)
- : base (message)
- {
- loaderExceptions = exceptions;
- types = classes;
- }
-
- // Properties
- public Type[] Types
- {
- get { return types; }
- }
-
- public Exception[] LoaderExceptions
- {
- get { return loaderExceptions; }
- }
-
- // Method
- [MonoTODO]
- //
- // This one is a bit tough because need to serialize two arrays.
- // The serialization output comes out as
- // <Types href="#ref-4" />
- // <Exceptions href="#ref-5" />
- // and then goes on and appends new SOAP-ENCs, etc...
- //
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/ResourceAttributes.cs b/mcs/class/corlib/System.Reflection/ResourceAttributes.cs
deleted file mode 100755
index ab02d11805d..00000000000
--- a/mcs/class/corlib/System.Reflection/ResourceAttributes.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// ResourceAttributes.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:40:12 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ResourceAttributes {
-
- /// <summary>
- /// </summary>
- Public = 1,
-
- /// <summary>
- /// </summary>
- Private = 2,
- } // ResourceAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/ResourceLocation.cs b/mcs/class/corlib/System.Reflection/ResourceLocation.cs
deleted file mode 100755
index 611c61828b5..00000000000
--- a/mcs/class/corlib/System.Reflection/ResourceLocation.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// ResourceLocation.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:39:22 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ResourceLocation {
-
- /// <summary>
- /// </summary>
- Embedded = 1,
-
- /// <summary>
- /// </summary>
- ContainedInAnotherAssembly = 2,
-
- /// <summary>
- /// </summary>
- ContainedInManifestFile = 4,
- } // ResourceLocation
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs b/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs
deleted file mode 100755
index cd16be2df68..00000000000
--- a/mcs/class/corlib/System.Reflection/StrongNameKeyPair.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Reflection.StrongNameKeyPair.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.IO;
-
-namespace System.Reflection {
-
- [Serializable]
- public class StrongNameKeyPair
- {
- private byte[] keyPair;
-
- public StrongNameKeyPair (byte[] keyPairArray)
- {
- keyPair = keyPairArray;
- }
-
- public StrongNameKeyPair (FileStream keyPairFile)
- {
-
- }
-
- public StrongNameKeyPair (string keyPairContainer)
- {
-
- }
-
- public byte[] PublicKey
- {
- get { return keyPair; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetException.cs b/mcs/class/corlib/System.Reflection/TargetException.cs
deleted file mode 100644
index 071bd091771..00000000000
--- a/mcs/class/corlib/System.Reflection/TargetException.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// System.Reflection.TargetException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Reflection
-{
- [Serializable]
- public class TargetException : ApplicationException
- {
- public TargetException ()
- : base (Locale.GetText ("Unable to invoke and invalid target."))
- {
- }
-
- public TargetException (string message)
- : base (message)
- {
- }
-
- public TargetException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- protected TargetException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetInvocationException.cs b/mcs/class/corlib/System.Reflection/TargetInvocationException.cs
deleted file mode 100644
index b5ec55d2cb8..00000000000
--- a/mcs/class/corlib/System.Reflection/TargetInvocationException.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// System.Reflection.TargetInvocationException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-namespace System.Reflection
-{
- [Serializable]
- public sealed class TargetInvocationException : ApplicationException
- {
- public TargetInvocationException (Exception inner)
- : base (inner.Message, inner)
- {
- }
-
- public TargetInvocationException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs b/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs
deleted file mode 100644
index 38a4528743f..00000000000
--- a/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Reflection.TargetParameterCountException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Reflection
-{
- [Serializable]
- public sealed class TargetParameterCountException : ApplicationException
- {
- public TargetParameterCountException ()
- : base (Locale.GetText ("Number of parameter does not match expected count."))
- {
- }
-
- public TargetParameterCountException (string message)
- : base (message)
- {
- }
-
- public TargetParameterCountException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- internal TargetParameterCountException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TypeAttributes.cs b/mcs/class/corlib/System.Reflection/TypeAttributes.cs
deleted file mode 100755
index 5647b709857..00000000000
--- a/mcs/class/corlib/System.Reflection/TypeAttributes.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-// TypeAttributes.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:40:22 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum TypeAttributes {
-
- /// <summary>
- /// </summary>
- VisibilityMask = 7,
-
- /// <summary>
- /// </summary>
- NotPublic = 0,
-
- /// <summary>
- /// </summary>
- Public = 1,
-
- /// <summary>
- /// </summary>
- NestedPublic = 2,
-
- /// <summary>
- /// </summary>
- NestedPrivate = 3,
-
- /// <summary>
- /// </summary>
- NestedFamily = 4,
-
- /// <summary>
- /// </summary>
- NestedAssembly = 5,
-
- /// <summary>
- /// </summary>
- NestedFamANDAssem = 6,
-
- /// <summary>
- /// </summary>
- NestedFamORAssem = 7,
-
- /// <summary>
- /// </summary>
- LayoutMask = 24,
-
- /// <summary>
- /// </summary>
- AutoLayout = 0,
-
- /// <summary>
- /// </summary>
- SequentialLayout = 8,
-
- /// <summary>
- /// </summary>
- ExplicitLayout = 16,
-
- /// <summary>
- /// </summary>
- ClassSemanticsMask = 32,
-
- /// <summary>
- /// </summary>
- Class = 0,
-
- /// <summary>
- /// </summary>
- Interface = 32,
-
- /// <summary>
- /// </summary>
- Abstract = 128,
-
- /// <summary>
- /// </summary>
- Sealed = 256,
-
- /// <summary>
- /// </summary>
- SpecialName = 1024,
-
- /// <summary>
- /// </summary>
- Import = 4096,
-
- /// <summary>
- /// </summary>
- Serializable = 8192,
-
- /// <summary>
- /// </summary>
- StringFormatMask = 196608,
-
- /// <summary>
- /// </summary>
- AnsiClass = 0,
-
- /// <summary>
- /// </summary>
- UnicodeClass = 65536,
-
- /// <summary>
- /// </summary>
- AutoClass = 131072,
-
- /// <summary>
- /// </summary>
- BeforeFieldInit = 1048576,
-
- /// <summary>
- /// </summary>
- ReservedMask = 264192,
-
- /// <summary>
- /// </summary>
- RTSpecialName = 2048,
-
- /// <summary>
- /// </summary>
- HasSecurity = 262144,
- } // TypeAttributes
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/TypeDelegator.cs b/mcs/class/corlib/System.Reflection/TypeDelegator.cs
deleted file mode 100755
index b25962a4660..00000000000
--- a/mcs/class/corlib/System.Reflection/TypeDelegator.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-// System.Reflection/TypeDelegator.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Reflection {
-
- [Serializable]
- public class TypeDelegator : Type {
- protected Type typeImpl;
-
- protected TypeDelegator () {
- }
-
- public TypeDelegator( Type delegatingType) {
- if (delegatingType == null)
- throw new ArgumentNullException ("delegatingType must be non-null");
- typeImpl = delegatingType;
- }
-
- public override Assembly Assembly {
- get {return typeImpl.Assembly;}
- }
-
- public override string AssemblyQualifiedName {
- get {return typeImpl.AssemblyQualifiedName;}
- }
-
- public override Type BaseType {
- get {return typeImpl.BaseType;}
- }
-
- public override string FullName {
- get {return typeImpl.FullName;}
- }
-
- public override Guid GUID {
- get {return typeImpl.GUID;}
- }
-
- public override Module Module {
- get {return typeImpl.Module;}
- }
-
- public override string Name {
- get {return typeImpl.Name;}
- }
-
- public override string Namespace {
- get {return typeImpl.Namespace;}
- }
-
- public override RuntimeTypeHandle TypeHandle {
- get {return typeImpl.TypeHandle;}
- }
-
- public override Type UnderlyingSystemType {
- get {return typeImpl.UnderlyingSystemType;}
- }
-
- protected override TypeAttributes GetAttributeFlagsImpl () {
- throw new NotImplementedException ();
- //return typeImpl.GetAttributeFlagsImpl ();
- }
-
- protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- //return typeImpl.GetConstructorImpl (bindingAttr, binder, callConvention, types, modifiers);
- }
-
- public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr) {
- return typeImpl.GetConstructors (bindingAttr);
- }
-
- public override object[] GetCustomAttributes (bool inherit)
- {
- return typeImpl.GetCustomAttributes (inherit);
- }
-
- public override object[] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return typeImpl.GetCustomAttributes (attributeType, inherit);
- }
-
- public override Type GetElementType() {
- return typeImpl.GetElementType ();
- }
-
- public override EventInfo GetEvent( string name, BindingFlags bindingAttr) {
- return typeImpl.GetEvent (name, bindingAttr);
- }
-
- public override EventInfo[] GetEvents() {
- return GetEvents (BindingFlags.Public);
- }
-
- public override EventInfo[] GetEvents( BindingFlags bindingAttr) {
- return typeImpl.GetEvents (bindingAttr);
- }
-
- public override FieldInfo GetField( string name, BindingFlags bindingAttr) {
- return typeImpl.GetField (name, bindingAttr);
- }
-
- public override FieldInfo[] GetFields( BindingFlags bindingAttr) {
- return typeImpl.GetFields (bindingAttr);
- }
-
- public override Type GetInterface( string name, bool ignoreCase) {
- return typeImpl.GetInterface (name, ignoreCase);
- }
-
- public override InterfaceMapping GetInterfaceMap( Type interfaceType) {
- return typeImpl.GetInterfaceMap (interfaceType);
- }
-
- public override Type[] GetInterfaces() {
- return typeImpl.GetInterfaces ();
- }
-
- public override MemberInfo[] GetMember( string name, MemberTypes type, BindingFlags bindingAttr) {
- return typeImpl.GetMember (name, type, bindingAttr);
- }
-
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr) {
- return typeImpl.GetMembers (bindingAttr);
- }
-
- protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- //return typeImpl.GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
- }
-
- public override MethodInfo[] GetMethods( BindingFlags bindingAttr) {
- return typeImpl.GetMethods (bindingAttr);
- }
-
- public override Type GetNestedType( string name, BindingFlags bindingAttr) {
- return typeImpl.GetNestedType (name, bindingAttr);
- }
-
- public override Type[] GetNestedTypes( BindingFlags bindingAttr) {
- return typeImpl.GetNestedTypes (bindingAttr);
- }
-
- public override PropertyInfo[] GetProperties( BindingFlags bindingAttr) {
- return typeImpl.GetProperties (bindingAttr);
- }
-
- protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
- throw new NotImplementedException ();
- //return typeImpl.GetPropertyImpl (name, bindingAttr, bindingAttr, returnType, types, modifiers);
- }
-
- protected override bool HasElementTypeImpl() {
- throw new NotImplementedException ();
- //return typeImpl.HasElementTypeImpl ();
- }
-
- public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
- return typeImpl.InvokeMember (name, invokeAttr, binder, target, args, modifiers, culture, namedParameters);
- }
-
- protected override bool IsArrayImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsArrayImpl ();
- }
-
- protected override bool IsByRefImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsByRefImpl ();
- }
-
- protected override bool IsCOMObjectImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsCOMObjectImpl ();
- }
-
- public override bool IsDefined( Type attributeType, bool inherit) {
- return typeImpl.IsDefined (attributeType, inherit);
- }
-
- protected override bool IsPointerImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsPointerImpl ();
- }
-
- protected override bool IsPrimitiveImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsPrimitiveImpl ();
- }
-
- protected override bool IsValueTypeImpl() {
- throw new NotImplementedException ();
- //return typeImpl.IsValueTypeImpl ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Reflection/TypeFilter.cs b/mcs/class/corlib/System.Reflection/TypeFilter.cs
deleted file mode 100644
index a7fb8baf957..00000000000
--- a/mcs/class/corlib/System.Reflection/TypeFilter.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// TypeAttributes.cs
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Reflection {
-
-
- public delegate bool TypeFilter (Type m, object filterCriteria);
-
-} // System.Reflection
diff --git a/mcs/class/corlib/System.Reflection/common.src b/mcs/class/corlib/System.Reflection/common.src
deleted file mode 100644
index 022b6768fcc..00000000000
--- a/mcs/class/corlib/System.Reflection/common.src
+++ /dev/null
@@ -1,25 +0,0 @@
-Assembly.cs
-AssemblyNameFlags.cs
-BindingFlags.cs
-CallingConventions.cs
-ConstructorInfo.cs
-DefaultMemberAttribute.cs
-EventAttributes.cs
-EventInfo.cs
-FieldAttributes.cs
-FieldInfo.cs
-ICustomAttributeProvider.cs
-MemberFilter.cs
-MemberInfo.cs
-MemberTypes.cs
-MethodAttributes.cs
-MethodBase.cs
-MethodImplAttributes.cs
-MethodInfo.cs
-Module.cs
-ParameterAttributes.cs
-PropertyAttributes.cs
-PropertyInfo.cs
-ResourceAttributes.cs
-ResourceLocation.cs
-TypeAttributes.cs
diff --git a/mcs/class/corlib/System.Resources/ChangeLog b/mcs/class/corlib/System.Resources/ChangeLog
deleted file mode 100644
index aad07bd2bef..00000000000
--- a/mcs/class/corlib/System.Resources/ChangeLog
+++ /dev/null
@@ -1,128 +0,0 @@
-2002-03-12 Duncan Mak <duncan@ximian.com>
-
- * MissingManifestResourceException.cs: This should inherit from
- SystemException, not Exception.
-
-2002-01-26 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReader.cs: Finsished reading resource files with just strings
- in them. Need to figure out other types, and also resources with
- multiple types in the same file.
-
-2002-01-24 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReader.cs: Implemented constructors. Started on the
- GetEnumerator() method. Not done yet, but comitting for
- 'disaster recovery' purposes.
-
-2002-01-19 Duncan Mak <duncan@ximian.com>
-
- * *.cs: Fixed indentation. There was a stupid bug in my .emacs file.
-
-2002-1-17 Duncan Mak <duncan@duncan@ximian.com>
-
- * ResourceSet.cs: Implemented GetObject (string, bool) and GetString
- (string, bool). ResourceSet has no more MonoTODOs! Also added in the
- Serializable attribute.
-
- * *.cs: convert to Miguel's brace style.
-
-2002-01-17 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: Fixed GetNeutralResourcesLanguage () and added
- new attributes documented in 1.0 SDK.
-
-2002-01-17 Duncan Mak <duncan@ximian.com>
-
- * ResourceWriter.cs: Added MonoTODO decorations.
-
- * SatelliteContractVersionAttribute.cs: added new attributes in 1.0 SDK.
-
- * NeutralResoucesLanguageAttribute.cs: added new attributes in 1.0 SDK
-
-2002-01-16 Duncan Mak <duncan@ximian.com>
-
- * ResourceReader.cs: Fixed some typos.
-
- * ResourceManager.cs: After reading the tutorial from the SDK,
- finished all the ResourceManager constructors and removed those
- MonoTODO tags.
-
- Removed MonoTODO from GetNeutralResourcesLanguage (Assembly)
- because Miguel just implemented the whole class, including the
- constructor that I needed (CultureInfo (string)).
-
- Updated fields after reading the new docs from the final SDK.
-
- * ResXFileRef.cs, ResXResourceReader.cs: Removed. They are part of
- Windows.Forms and require System.Xml, which we don't have access to.
-
-2002-01-13 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: Added more MonoTODOs and cleaned up some
- indenting.
-
-2002-01-09 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: Fixed the GetSatelliteContractVersion()
- method. It was missing a cast before. Removed MonoTODO
- attribute. ;-) It was tested by John Barnette, so this shouldn't break
- the build.
-
- * ResourceManager.cs: Removed MonoTODO attribute on GetString
- (string), as I believe it's correct. However, GetString
- (string, CultureInfo) is definitely broken, so I'm marking it with
- MonoTODO there. I also added MonoTODO to IntenalGetResourceSet().
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * Finalizing IResourceReader and IResourceWriter interfaces:
- Added "new"-modifier to IResourceReader.GetEnumerator
- * Fixed compilation issues in other *.cs, so that the
- System.Resources namespaces can be included in the corlib build.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ResourceManager.cs : MonoTODO attribute decoration.
-
-Tue Dec 18 13:18:32 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * *.cs: fixed some of the compilation issues: missing
- using directives, typos.
-
-2001-12-11 Duncan Mak <duncan@ximian.com>
-
- * Checked in to CVS.
-
-2001-12-10 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs (GetNeutralResourcesLanguage):
- (GetSatelliteContractVersion): Implemented.
-
-2001-12-09 Duncan Mak <duncan@ximian.com>
-
- * ResXResourceReader.cs: Initial attempt.
-
- * ResXFileRef.cs: Initial attempt.
-
- * ResourceWriter.cs: Initial attempt.
-
- * ResourceSet.cs (ReadResources): Implemented, with help from Radek Doulik.
-
-2001-11-28 Duncan Mak <duncan@ximian.com>
-
- * ResourceManager.cs: First attempt.
-
-2001-11-27 Duncan Mak <duncan@ximian.com>
-
- * ResourceSet.cs:
- First attempt, can't continue until ResourceReader and ResourceWriter are implemented.
-
- * SatelliteContractVersionAttribute.cs: First attempt. The spec is quite amibiguous here.
-
- * NeutralResoucesLanguageAttribute.cs: Complete.
-
- * MissingManifestResourceException.cs: Complete.
-
- * IResourceReader.cs: Complete.
-
- * IResourceWriter.cs: Complete.
diff --git a/mcs/class/corlib/System.Resources/IResourceReader.cs b/mcs/class/corlib/System.Resources/IResourceReader.cs
deleted file mode 100644
index 871f202cfff..00000000000
--- a/mcs/class/corlib/System.Resources/IResourceReader.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Resources.IResourceReader.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-namespace System.Resources
-{
- public interface IResourceReader : IEnumerable, IDisposable
- {
- void Close();
- new IDictionaryEnumerator GetEnumerator();
- }
-}
diff --git a/mcs/class/corlib/System.Resources/IResourceWriter.cs b/mcs/class/corlib/System.Resources/IResourceWriter.cs
deleted file mode 100644
index ec847784749..00000000000
--- a/mcs/class/corlib/System.Resources/IResourceWriter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Resources.IResourceWriter.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Resources
-{
-
- public interface IResourceWriter : IDisposable
- {
- void AddResource (string name, byte[] value);
- void AddResource (string name, object value);
- void AddResource (string name, string value);
-
- void Close();
-
- void Generate();
- }
-}
diff --git a/mcs/class/corlib/System.Resources/MissingManifestResourceException.cs b/mcs/class/corlib/System.Resources/MissingManifestResourceException.cs
deleted file mode 100644
index b6b22b80c99..00000000000
--- a/mcs/class/corlib/System.Resources/MissingManifestResourceException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Resources.MissingManifestResourceException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Resources
-{
-
- [Serializable]
- public class MissingManifestResourceException: SystemException
- {
- private string param;
-
- // Constructors
- public MissingManifestResourceException ()
- : base (Locale.GetText ("The assembly does not contain the resources for the required culture."))
- {
- }
-
- public MissingManifestResourceException (string message)
- :base (message)
- {
- }
-
- protected MissingManifestResourceException (SerializationInfo info, StreamingContext context)
- :base (info, context)
- {
- }
-
- public MissingManifestResourceException (String message, Exception e)
- :base (message, e)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs b/mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs
deleted file mode 100644
index abff4ca7116..00000000000
--- a/mcs/class/corlib/System.Resources/NeutralResoucesLanguageAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Resources.NeutralResourcesLanguageAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Resources
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class NeutralResourcesLanguageAttribute : Attribute
- {
-
- string culture;
-
- // Constructors
- public NeutralResourcesLanguageAttribute (string cultureName)
- {
- culture = cultureName;
- }
- public string CultureName
- {
- get { return culture; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/ResourceManager.cs b/mcs/class/corlib/System.Resources/ResourceManager.cs
deleted file mode 100644
index c592c2d5d2c..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceManager.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// System.Resources.ResourceManager.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2001 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-using System.Reflection;
-using System.Globalization;
-
-namespace System.Resources
-{
- [Serializable]
- public class ResourceManager
- {
- public static readonly int HeaderVersionNumber;
- // public static readonly int MagicNumber = 0xBEEFCACE;
-
- protected string BaseNameField;
- protected Assembly MainAssembly;
- protected Hashtable ResourceSets;
-
- private bool ignoreCase;
- private Type resourceSetType;
-
- // constructors
- protected ResourceManager () {}
-
- public ResourceManager (Type resourceSource)
- {
- if (resourceSource == null)
- throw new ArgumentNullException ("resourceSource is null.");
-
- BaseNameField = resourceSource.FullName;
- MainAssembly = resourceSource.Assembly;
-
- ignoreCase = false;
- resourceSetType = resourceSource;
- }
-
- public ResourceManager (string baseName, Assembly assembly)
- {
- if (baseName == null || assembly == null)
- throw new ArgumentNullException ("The arguments are null.");
-
- BaseNameField = baseName;
- MainAssembly = assembly;
- ignoreCase = false;
- resourceSetType = typeof (ResourceSet);
- }
-
- public ResourceManager (string baseName, Assembly assembly, Type usingResourceSet)
- {
- if (baseName == null || assembly == null)
- throw new ArgumentNullException ("The arguments are null.");
-
- BaseNameField = baseName;
- MainAssembly = assembly;
-
- if (usingResourceSet == null) // defaults resourceSet type.
- resourceSetType = typeof (ResourceSet);
- else {
- if (!usingResourceSet.IsSubclassOf (typeof (ResourceSet)))
- throw new ArgumentException ("Type must be from ResourceSet.");
-
- }
- }
-
- [MonoTODO]
- public static ResourceManager CreateFileBasedResourceManager (string baseName,
- string resourceDir, Type usingResourceSet)
- {
- return null;
- }
-
- public virtual string BaseName
- {
- get { return BaseNameField; }
- }
-
- public virtual bool IgnoreCase
- {
- get { return ignoreCase; }
- set { ignoreCase = value; }
- }
-
- public virtual Type ResourceSetType
- {
- get { return resourceSetType; }
- }
-
- [MonoTODO]
- public virtual ResourceSet GetResourceSet (CultureInfo culture,
- bool createIfNotExists, bool tryParents)
-
- {
- if (culture == null)
- throw new ArgumentNullException ("CultureInfo is a null reference.");
- return null;
- }
-
- [MonoTODO]
- public virtual string GetString (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("Name is null.");
- if (ResourceSets.Contains (name)) {
- if (!(ResourceSets[name] is string))
- throw new InvalidOperationException ("The resource is " +
- "not a string.");
- return ResourceSets[name].ToString();
- }
- return null;
- }
-
- [MonoTODO]
- public virtual string GetString (string name, CultureInfo culture)
- {
- if (name == null)
- throw new ArgumentNullException ("Name is null.");
- return null;
- }
-
- protected virtual string GetResourceFileName (CultureInfo culture)
- {
- return culture.Name + ".resources";
- }
-
- [MonoTODO]
- protected virtual ResourceSet InternalGetResourceSet (CultureInfo culture,
- bool Createifnotexists, bool tryParents)
- {
- return null;
- }
-
- public virtual void ReleaseAllResources ()
- {
- foreach (ResourceSet r in ResourceSets)
- r.Close();
- }
-
- protected static CultureInfo GetNeutralResourcesLanguage (Assembly a)
- {
- foreach (Attribute attribute in a.GetCustomAttributes (false)) {
- if (attribute is NeutralResourcesLanguageAttribute)
- return new CultureInfo ((attribute as NeutralResourcesLanguageAttribute).CultureName);
- }
- return null;
- }
-
- protected static Version GetSatelliteContractVersion (Assembly a)
- {
- foreach (Attribute attribute in a.GetCustomAttributes (false)) {
- if (attribute is SatelliteContractVersionAttribute)
- return new Version ((attribute as SatelliteContractVersionAttribute).Version);
- }
- return null; // return null if no version was found.
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/ResourceReader.cs b/mcs/class/corlib/System.Resources/ResourceReader.cs
deleted file mode 100644
index 6c2efa3fcf2..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceReader.cs
+++ /dev/null
@@ -1,265 +0,0 @@
-//
-// System.Resources.ResourceReader.cs
-//
-// Authors:
-// Duncan Mak <duncan@ximian.com>
-// Nick Drochak <ndrochak@gol.com>
-//
-// 2001 (C) Ximian Inc, http://www.ximian.com
-//
-// TODO: Finish this
-
-using System.Collections;
-using System.Resources;
-using System.IO;
-
-namespace System.Resources
-{
- class MonoTODO : Attribute {}
- public sealed class ResourceReader : IResourceReader, IDisposable
- {
- Stream stream;
- internal ArrayList resourceNames = null;
- internal ArrayList resourceValues = null;
- BinaryReader binaryReader;
- internal int resourceCount = 0;
- int typeCount = 0;
- ArrayList typeArray = new ArrayList();
- ArrayList hashes = new ArrayList();
- ArrayList positions = new ArrayList();
- int dataSectionOffset;
-
- // Constructors
- public ResourceReader (Stream stream)
- {
- if (stream == null)
- throw new ArgumentNullException ("Value cannot be null.");
-
- if (!stream.CanRead)
- throw new ArgumentException ("Stream was not readable.");
-
- this.stream = stream;
-
- if (!IsStreamValid()){
- throw new ArgumentException("Stream is not a valid .resources file! It was possibly truncated.");
- }
- }
-
- public ResourceReader (string fileName)
- {
- if (fileName == null)
- throw new ArgumentException ("Path cannot be null.");
-
- if (String.Empty == fileName)
- throw new ArgumentException("Empty path name is not legal.");
-
- if (!System.IO.File.Exists (fileName))
- throw new FileNotFoundException ("Could not find file " + Path.GetFullPath(fileName));
-
- stream = new FileStream (fileName, FileMode.Open);
-
- if (!IsStreamValid()){
- throw new ArgumentException("Stream is not a valid .resources file! It was possibly truncated.");
- }
- }
-
- [MonoTODO]
- private bool IsStreamValid() {
- // not sure how much to check to determine if it's valid,
- // but look at magic number, version numbers and class names
- string readerClass;
- string resourceSetClass;
- try {
- binaryReader = new BinaryReader(stream);
- int magicNumber = binaryReader.ReadInt32();
- if (-1091581234 != magicNumber) {
- return false;
- }
- int versionNumber = binaryReader.ReadInt32();
- if (1 != versionNumber){
- return false;
- }
- // Ignore next 32bits. they contain the length of the class name strings
- binaryReader.ReadInt32();
-
- readerClass = binaryReader.ReadString();
- if (!readerClass.StartsWith("System.Resources.ResourceReader")){
- return false;
- }
- resourceSetClass = binaryReader.ReadString();
- if (!resourceSetClass.StartsWith("System.Resources.RuntimeResourceSet")){
- return false;
- }
- int versionNumber2 = binaryReader.ReadInt32();
- if (1 != versionNumber2){
- return false;
- }
-
- resourceCount = binaryReader.ReadInt32();
- typeCount = binaryReader.ReadInt32();
-
- for (int i = 0; i < typeCount; i++) {
- typeArray.Add(binaryReader.ReadString());
- }
- for (int i = 0; i < resourceCount; i++) {
- hashes.Add(binaryReader.ReadInt32());
- }
- for (int i = 0; i < resourceCount; i++) {
- positions.Add(binaryReader.ReadInt32());
- }
-
- dataSectionOffset = binaryReader.ReadInt32();
-
- // LAMESPEC: what is the next Int32 here?
- binaryReader.ReadInt32();
- }
- catch{
- return false;
- }
- return true;
- }
-
- private string ReadString(BinaryReader br) {
- return br.ReadString();
- }
-
- public void Close ()
- {
- stream.Close ();
- stream = null;
- }
-
- public IDictionaryEnumerator GetEnumerator () {
- if (null == stream){
- throw new InvalidOperationException("ResourceReader is closed.");
- }
- else {
- // STRATEGY: if this is the first enumerator requested, fill the hash.
- // delaying in this way seems ok since there's not much you can do with just
- // a reader except close it. And if you close it, you cannot get the enumerator.
- // So, create the hash for the first enumerator, and re-use it for all others.
- if (null == resourceNames) {
- FillResources();
- }
- return new ResourceEnumerator (this);
- }
- }
-
- internal struct NameOffsetPair {
- public string name;
- public int offset;
- }
-
- [MonoTODO]
- private void FillResources(){
- NameOffsetPair pair;
- resourceNames = new ArrayList();
- resourceValues = new ArrayList();
- BinaryReader unicodeReader =
- new BinaryReader(binaryReader.BaseStream, System.Text.Encoding.Unicode);
- // TODO: need to put these in an array and work out when to get the values.
- // also need to figure out the hash and how/if to use it.
- for (int index=0; index < resourceCount; index++){
- pair = new NameOffsetPair();
- pair.name = unicodeReader.ReadString();
- pair.offset = binaryReader.ReadInt32();
- resourceNames.Add(pair);
- }
- for (int index=0; index < resourceCount; index++){
- // LAMESPEC: what the heck is this byte here? always 0? just a separator?
- binaryReader.ReadByte();
- resourceValues.Add(binaryReader.ReadString());
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator ()
- {
- return ((IResourceReader) this).GetEnumerator();
- }
-
- [MonoTODO]
- void IDisposable.Dispose ()
- {
- // FIXME: is this all we need to do?
- Close();
- }
-
- internal class ResourceEnumerator : IDictionaryEnumerator
- {
- protected ResourceReader reader;
- protected int index = -1;
-
-
- internal ResourceEnumerator(ResourceReader readerToEnumerate){
- reader = readerToEnumerate;
- }
-
- public virtual DictionaryEntry Entry
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
-
- DictionaryEntry entry = new DictionaryEntry();
- entry.Key = Key;
- entry.Value = Value;
- return entry;
- }
- }
-
- public virtual object Key
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
- return ((NameOffsetPair)(reader.resourceNames[index])).name;
- }
- }
-
- public virtual object Value
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
- return reader.resourceValues[index];
- }
- }
-
- public virtual object Current
- {
- get {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (index < 0)
- throw new InvalidOperationException("Enumeration has not started. Call MoveNext.");
- return Entry;
- }
- }
-
- public virtual bool MoveNext ()
- {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- if (++index < reader.resourceCount){
- return true;
- }
- else {
- --index;
- return false;
- }
- }
-
- public void Reset () {
- if (null == reader.stream)
- throw new InvalidOperationException("ResourceReader is closed.");
- index = -1;
- }
- } // internal class ResourceEnumerator
- } // public sealed class ResourceReader
-} // namespace System.Resources
diff --git a/mcs/class/corlib/System.Resources/ResourceSet.cs b/mcs/class/corlib/System.Resources/ResourceSet.cs
deleted file mode 100644
index d96df5e5fa2..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceSet.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// System.Resources.ResourceSet.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-using System.IO;
-
-namespace System.Resources
-{
- [Serializable]
- public class ResourceSet : IDisposable
- {
-
- protected IResourceReader Reader;
- protected Hashtable Table;
-
- // Constructors
- protected ResourceSet () {}
- public ResourceSet (IResourceReader reader)
- {
- if (reader == null)
- throw new ArgumentNullException ("The reader is null.");
- Reader = reader;
- }
-
- public ResourceSet (Stream stream)
- {
- Reader = new ResourceReader (stream);
- }
-
- public ResourceSet (String fileName)
- {
- Reader = new ResourceReader (fileName);
- }
-
- public virtual void Close ()
- {
- Dispose (true);
- }
-
- public void Dispose()
- {
- Dispose (true);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (disposing) {
- Reader = null;
- Table = null;
- }
- }
-
- public virtual Type GetDefaultReader ()
- {
- return (typeof (ResourceReader));
- }
- public virtual Type GetDefaultWriter ()
- {
- return (typeof (ResourceWriter));
- }
-
- public virtual object GetObject (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("The name parameter is null.");
- if (Reader == null)
- throw new InvalidOperationException ("The ResourceSet has been closed.");
- if (Table == null) {
- ReadResources ();
- return Table[name];
- } else
- return Table[name];
- }
- public virtual object GetObject (string name, bool ignoreCase)
- {
- if (name == null)
- throw new ArgumentNullException ("The name parameter is null.");
- if (Reader == null)
- throw new InvalidOperationException ("ResourceSet has been closed.");
- if (Table == null)
- ReadResources ();
- if (ignoreCase) {
- foreach (DictionaryEntry de in Table) {
- string key = (string) de.Key;
- if (String.Compare (key, name, true) == 0)
- return de.Value;
- }
- return null;
- } else
- return Table[name];
- }
-
- public virtual string GetString (string name)
- {
- Object o = GetObject (name);
- if (o is string)
- return (string) o;
- return null;
- }
-
- public virtual string GetString (string name, bool ignoreCase)
- {
- Object o = GetObject (name, ignoreCase);
- if (o is string)
- return (string) o;
- return null;
- }
-
- protected virtual void ReadResources ()
- {
- IDictionaryEnumerator i = Reader.GetEnumerator();
-
- if (Table == null)
- Table = new Hashtable ();
- i.Reset ();
-
- while (i.MoveNext ())
- Table.Add (i.Key, i.Value);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Resources/ResourceWriter.cs b/mcs/class/corlib/System.Resources/ResourceWriter.cs
deleted file mode 100644
index d815ac76b3d..00000000000
--- a/mcs/class/corlib/System.Resources/ResourceWriter.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// System.Resources.ResourceWriter.cs
-//
-// Author:
-// Duncan Mak <duncan@ximian.com>
-//
-// 2001 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.IO;
-
-namespace System.Resources
-{
- public sealed class ResourceWriter : IResourceWriter
- {
- [MonoTODO]
- public ResourceWriter (Stream stream)
- {
- if (stream == null)
- throw new ArgumentNullException ("stream is null");
- if (stream.CanWrite == false)
- throw new ArgumentException ("stream is not writable.");
- }
-
- [MonoTODO]
- public ResourceWriter (String fileName)
- {
- if (fileName == null)
- throw new ArgumentNullException ("fileName is null.");
- }
-
- [MonoTODO]
- public void AddResource (string name, byte[] value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ("Parameter is a null reference.");
- }
-
- [MonoTODO]
- public void AddResource (string name, object value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ("Parameter is a null reference.");
- }
-
- [MonoTODO]
- public void AddResource (string name, string value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ("Parameter is a null reference.");
- }
-
- [MonoTODO]
- public void Close () {}
-
- public void Dispose ()
- {
- Close();
- }
-
- [MonoTODO]
- public void Generate () {}
- }
-}
diff --git a/mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs b/mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs
deleted file mode 100644
index a0bf1bd0614..00000000000
--- a/mcs/class/corlib/System.Resources/SatelliteContractVersionAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Resources.SatelliteContractVersionAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Resources
-{
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class SatelliteContractVersionAttribute : Attribute
- {
- private Version ver;
-
- // Constructor
- public SatelliteContractVersionAttribute (string version)
- {
- ver = new Version(version);
- }
- public string Version
- {
- get { return ver.ToString(); }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog b/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog
deleted file mode 100644
index f59f55bfc2e..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog
+++ /dev/null
@@ -1,15 +0,0 @@
-2002-04-15 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * MethodImplAttribute.cs: added constructor usage.
-
-Fri Feb 22 15:36:19 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * RuntimeHelpers.cs: added OffsetToStringData() property.
-
-Mon Nov 5 19:50:11 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * RuntimeHelpers.cs: make InitializeArray an internalcall.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * MethodCodeType.cs, MethodImplOptions.cs: Add.
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs
deleted file mode 100755
index cf61a66b979..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.CompilerServices.IndexerNameAttributecs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.CompilerServices {
-
- [AttributeUsage(AttributeTargets.Property, Inherited=false)] [Serializable]
- public sealed class IndexerNameAttribute : Attribute {
- public IndexerNameAttribute (string indexer_name)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs b/mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs
deleted file mode 100644
index 3608120e516..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/MethodCodeType.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Runtime.CompilerServices.MethodCodeType.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Thu 07/18/2001
-//
-//------------------------------------------------------------------------------
-
-namespace System.Runtime.CompilerServices
-{
-
-public enum MethodCodeType
-{
- IL,
- Native,
- OPTIL,
- Runtime,
-}
-
-} // Namespace
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs b/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs
deleted file mode 100644
index 41aed97dcab..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.CompilerServices.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Runtime.CompilerServices {
-
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited=false)] [Serializable]
- public sealed class MethodImplAttribute : Attribute {
- MethodImplOptions impl_options;
-
- public MethodImplAttribute ()
- {
- }
-
- public MethodImplAttribute (short options)
- {
- impl_options = (MethodImplOptions) options;
- }
-
- public MethodImplAttribute (MethodImplOptions options)
- {
- impl_options = options;
- }
-
- public MethodCodeType MethodCodeType;
-
- public MethodImplOptions Value {
- get {
- return impl_options;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs b/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs
deleted file mode 100644
index 347c38569a4..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/MethodImplOptions.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// MethodImplOptions.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:33:23 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.CompilerServices {
-
-
- /// <summary>
- /// </summary>
- public enum MethodImplOptions {
-
- /// <summary>
- /// </summary>
- Unmanaged = 4,
-
- /// <summary>
- /// </summary>
- ForwardRef = 16,
-
- /// <summary>
- /// </summary>
- InternalCall = 4096,
-
- /// <summary>
- /// </summary>
- Synchronized = 32,
-
- /// <summary>
- /// </summary>
- NoInlining = 8,
- } // MethodImplOptions
-
-} // System.Runtime.CompilerServices
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
deleted file mode 100644
index c87eb39d915..00000000000
--- a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// System.Runtime.CompilerServices.RuntimeHelpers
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-namespace System.Runtime.CompilerServices
-{
- [Serializable]
- public sealed class RuntimeHelpers
- {
- private RuntimeHelpers () {}
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern void InitializeArray (Array array, RuntimeFieldHandle fldHandle);
-
- public static int OffsetToStringData {
- get {
- // FIXME: this requires the reimplementation of String
- // as of my mail a few months ago, dum de dum
- throw new NotImplementedException ();
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
deleted file mode 100755
index 479122692c7..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.AssemblyRegistrationFlags.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices
-{
- [Flags]
- [Serializable]
- public enum AssemblyRegistrationFlags {
- None = 0,
- SetCodeBase,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/AutomationProxyAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/AutomationProxyAttribute.cs
deleted file mode 100755
index 3dfdc572adb..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/AutomationProxyAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Runtime.InteropServices.AutomationProxyAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Interface)]
- public sealed class AutomationProxyAttribute : Attribute
- {
- bool val;
-
- public AutomationProxyAttribute (bool val)
- {
- this.val = val;
- }
-
- public bool Value {
- get { return val; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/BINDPTR.cs b/mcs/class/corlib/System.Runtime.InteropServices/BINDPTR.cs
deleted file mode 100755
index 7bb93ac6769..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/BINDPTR.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-
-// System.Runtime.InteropServices/BINDPTR.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- [ComVisible(false)]
- public struct BINDPTR {
- public IntPtr lpfuncdesc;
- public IntPtr lptcomp;
- public IntPtr lpvardesc;
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs b/mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs
deleted file mode 100644
index 7f2c24d2b0c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/CallingConvention.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// CallingConvention.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:33:29 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum CallingConvention {
-
- /// <summary>
- /// </summary>
- Winapi = 1,
-
- /// <summary>
- /// </summary>
- Cdecl = 2,
-
- /// <summary>
- /// </summary>
- StdCall = 3,
-
- /// <summary>
- /// </summary>
- ThisCall = 4,
-
- /// <summary>
- /// </summary>
- FastCall = 5,
- } // CallingConvention
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog b/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
deleted file mode 100644
index d9ff64e4073..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
+++ /dev/null
@@ -1,161 +0,0 @@
-2002-06-24 root <dietmar@ximian.com>
-
- * Marshal.cs: impl. Copy()
-
-Fri Jun 14 16:18:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * UnmanagedType.cs, Marshal.cs: minor fixes.
-
-Wed Jun 12 16:32:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Marshal.c: stubbed out all the methods and filled in some
- implementation.
- * BINDPTR.cs, ComMemberType.cs, DESCKIND.cs, DISPPARAMS.cs,
- EXCEPINFO.cs, INVOKEKIND.cs, TYPEKIND.cs, UCOMTypeInfo.cs,
- UCOMTypeLib.cs: enums, interfaces and structs needed in Marshal class.
-
-Tue Jun 4 18:05:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * GCHandle.cs: changed to fit spec and implementation needs.
-
-Tue May 14 16:35:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * CharSet.cs: added missing None enum item.
-
-2002-04-26 Joe Shaw <joe@ximian.com>
-
- * Marshal.cs (StructureToPtr): stub this out.
-
-2002-04-23 Joe Shaw <joe@ximian.com>
-
- * Marshal.cs: Stub out a few functions to get gtk# to build.
-
-2002-04-22 Duncan Mak <duncan@ximian.com>
-
- * ImporterEventKind.cs:
- * TypeLibFuncFlags.cs:
- * TypeLibTypeFlags.cs:
- * TypeLibVarFlags.cs: Fixed various typos and added missing elements.
-
- * ComConventionLossAttribute.cs: Removed, there's a typo.
- * ComConversionLossAttribute.cs: Same attribute, slight change of name.
-
- * PreserveSigAttribute.cs:
- * ImportedFromTypeLibAttribute.cs: Added missing AttributeUsage
- attribute.
-
- * TypeLibFuncAttribute.cs:
- * TypeLibTypeAttribute.cs:
- * TypeLibVarAttribute.cs: Added missing constructors.
-
-
-2002-04-22 Duncan Mak <duncan@ximian.com>
-
- * AutomationProxyAttribute.cs:
- * CoClassAttribute.cs:
- * ComAliasNameAttribute.cs:
- * ComConventionLossAttribute.cs:
- * ComEventInterfaceAttribute.cs:
- * ComImportAttribute.cs:
- * ComRegisterFunctionAttribute.cs:
- * ComUnregisterFunctionAttribute.cs:
- * DispIdAttribute.cs:
- * ImportedFromTypeLibAttribute.cs:
- * LCIDConversionAttribute.cs:
- * PreserveSigAttribute.cs:
- * PrimaryInteropAssemblyAttribute.cs:
- * ProgIdAttribute.cs:
- * TypeLibFuncAttribute.cs:
- * TypeLibFuncFlags.cs:
- * TypeLibTypeAttribute.cs:
- * TypeLibTypeFlags.cs:
- * TypeLibVarAttribute.cs:
- * TypeLibVarFlags.cs: Added to CVS.
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * Marshal.cs: Make class public.
- * ComVisible.cs: New File.
-
-2002-03-24 Nick Drochak <ndrochak@gol.com>
-
- * ClassInterfaceAttribute.cs:
- * ClassInterfaceType.cs: New Files.
-
-2002-02-27 Duncan Mak <duncan@ximian.com>
-
- * ExporterEventKind.cs:
- * ITypeLibConverter.cs:
- * ITypeLibImporterNotifySink.cs: Added to CVS for Kevin Winchester <kwin@ns.sympatico.ca>.
-
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * ComInterfaceType.cs: Added to CVS.
-
- * AssemblyRegistrationFlags.cs:
- * GuidAttribute.cs:
- * ICustomAdapter.cs:
- * ICustomFactory.cs:
- * ICustomMarshaler.cs:
- * IRegistrationServices.cs:
- * ITypeLibExporterNameProvider.cs:
- * ITypeLibImporterNotifySink.cs:
- * InterfaceTypeAttribute.cs:
- * TypeLibExporterFlags.cs: Committed for Kevin Winchester <kwin@ns.sympatico.ca>.
-
- * GCHandle.cs: Added to CVS. Patch from Ajay kumar Dwivedi.
-
- * GCHandleType.cs: Committed patch from Ajay.
-
- * ImporterEventKind.cs: Added to CVS.
-
-2002-01-24 Miguel de Icaza <miguel@ximian.com>
-
- * StructLayoutAttribute.cs: Flag attribute as targetting structs
- or classes.
-
- * InAttribute.cs: Flag attribute as targettting a paramter
-
- * OutAttribute.cs: ditto.
-
- * DllImportAttribute.cs: Flag attribute as targetting methods.
-
- * MarshalAsAttribute.cs: Flag attribute as targetting fields,
- parameters and returnvalues.
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * Marshal.cs: Added GetLastWin32Error()
-
- * ExternalException.cs: Implemented
-
-2002-01-17 Miguel de Icaza <miguel@ximian.com>
-
- * ExternalException.cs: Add ExternalException.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * OutAttribute.cs : Decorate with MonoTODO.
-
-Thu Dec 20 15:46:31 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * FieldOffsetAttribute.cs, InAttribute.cs, MarshalAsAttribute.cs,
- OptionalAttribute.cs, StructLayoutAttribute.cs, VarEnum.cs:
- more stuff needed by the compiler.
-
-Thu Dec 13 20:22:18 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * DllImportAttribute.cs: added.
- * MethodImplOptions.cs: removed: this is already in CompilerServices.
-
-Wed Nov 14 17:02:57 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * CallingConvention.cs: add missing Winapi.
-
-2001-07-20 Miguel de Icaza <miguel@ximian.com>
-
- * OutAttribute.cs: New file.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * CallingConvention.cs.cs, CharSet.cs, GCHandleType.cs, LayoutKind.cs: Add.
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs b/mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs
deleted file mode 100644
index 27ae60765e6..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/CharSet.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// CharSet.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:33:35 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum CharSet {
-
- None = 1,
-
- /// <summary>
- /// </summary>
- Ansi = 2,
-
- /// <summary>
- /// </summary>
- Unicode = 3,
-
- /// <summary>
- /// </summary>
- Auto = 4,
- } // CharSet
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceAttribute.cs
deleted file mode 100644
index 47aa4ebed92..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceAttribute.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Runtime.InteropServices.ClassInterfaceAttribute.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2002 Nick Drochak
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class)]
- public sealed class ClassInterfaceAttribute : Attribute {
- private ClassInterfaceType ciType;
-
- public ClassInterfaceAttribute ( short classInterfaceType ) {
- ciType = (ClassInterfaceType)classInterfaceType;
- }
-
- public ClassInterfaceAttribute ( ClassInterfaceType classInterfaceType ) {
- ciType = classInterfaceType;
- }
-
- public ClassInterfaceType Value {
- get {return ciType;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceType.cs b/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceType.cs
deleted file mode 100644
index 963c2880a1a..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ClassInterfaceType.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Runtime.InteropServices.ClassInterfaceType.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2002 Nick Drochak
-//
-
-
-namespace System.Runtime.InteropServices {
-
- [Serializable]
- public enum ClassInterfaceType
- {
- None = 0,
-
- AutoDispatch = 1,
-
- AutoDual = 2
-
- } // ClassInterfaceType
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/CoClassAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/CoClassAttribute.cs
deleted file mode 100755
index c947887612d..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/CoClassAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Runtime.InteropServices.CoClassAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Interface)]
- public sealed class CoClassAttribute : Attribute
- {
-
- Type klass;
-
- public CoClassAttribute (Type coClass)
- {
- klass = coClass;
- }
-
- public Type CoClass {
- get { return klass; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComAliasNameAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComAliasNameAttribute.cs
deleted file mode 100755
index 60119849175..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComAliasNameAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Runtime.InteropServices.ComAliasNameAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field |
- AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public sealed class ComAliasNameAttribute : Attribute
- {
- string val;
-
- public ComAliasNameAttribute (string alias)
- {
- val = alias;
- }
-
- public string Value {
- get { return val; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComConversionLossAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComConversionLossAttribute.cs
deleted file mode 100755
index 2260d5ae488..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComConversionLossAttribute.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Runtime.InteropServices.ComConversionLossAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.All)]
- public sealed class ComConversionLossAttribute : Attribute
- {
- public ComConversionLossAttribute ()
- {
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComEventInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComEventInterfaceAttribute.cs
deleted file mode 100755
index f03e371c898..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComEventInterfaceAttribute.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Runtime.InteropServices.ComEventInterfaceAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Interface)]
- public sealed class ComEventInterfaceAttribute : Attribute
- {
- Type si, ep;
-
- public ComEventInterfaceAttribute (Type SourceInterface,
- Type EventProvider)
- {
- si = SourceInterface;
- ep = EventProvider;
- }
-
- public Type EventProvider {
- get { return ep; }
- }
-
- public Type SourceInterface {
- get { return si; }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComImportAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComImportAttribute.cs
deleted file mode 100755
index 325c5091f7b..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComImportAttribute.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Runtime.InteropServices.ComImportAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Class |
- AttributeTargets.Interface)]
- public sealed class ComImportAttribute : Attribute
- {
- public ComImportAttribute ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs
deleted file mode 100755
index 8d7c7a6b669..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComInterfaceType.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Runtime.InteropServices.ComInterfaceType.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices
-{
- [Serializable] public enum ComInterfaceType
- {
- InterfaceIsDual = 0,
- InterfaceIsIUnknown = 1,
- InterfaceIsIDispatch = 2,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComMemberType.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComMemberType.cs
deleted file mode 100755
index 8e66ff211d1..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComMemberType.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-
-// System.Runtime.InteropServices/ComMemberType.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
- [Serializable]
- public enum ComMemberType {
- Method = 0,
- PropGet = 1,
- PropSet = 2
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs
deleted file mode 100755
index 27a27076213..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.ComRegisterFunctionAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class ComRegisterFunctionAttribute : Attribute
- {
- public ComRegisterFunctionAttribute ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs
deleted file mode 100755
index 6d2fc1ed2e1..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.InteropServices.ComUnregisterFunctionAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class ComUnregisterFunctionAttribute : Attribute
- {
- public ComUnregisterFunctionAttribute ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ComVisible.cs b/mcs/class/corlib/System.Runtime.InteropServices/ComVisible.cs
deleted file mode 100644
index ad22b254c23..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ComVisible.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Runtime.InteropServices.ComVisible.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2002 Nick Drochak
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class
- | AttributeTargets.Struct | AttributeTargets.Enum |
- AttributeTargets.Method | AttributeTargets.Property |
- AttributeTargets.Field | AttributeTargets.Interface |
- AttributeTargets.Delegate)]
- public sealed class ComVisibleAttribute : Attribute
- {
- private bool Visible = false;
- public ComVisibleAttribute(bool value) {Visible = value;}
- public bool Value { get {return Visible;} }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DESCKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices/DESCKIND.cs
deleted file mode 100755
index b312119c6f1..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/DESCKIND.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-
-// System.Runtime.InteropServices/DESCKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- [Serializable]
- [ComVisible(false)]
- public enum DESCKIND {
- DESCKIND_NONE = 0,
- DESCKIND_FUNCDESC = 1,
- DESCKIND_VARDESC = 2,
- DESCKIND_TYPECOMP = 3,
- DESCKIND_IMPLICITAPPOBJ = 4,
- DESCKIND_MAX = 5
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DISPPARAMS.cs b/mcs/class/corlib/System.Runtime.InteropServices/DISPPARAMS.cs
deleted file mode 100755
index c84dde79aa8..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/DISPPARAMS.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-
-// System.Runtime.InteropServices/DISPPARAMS.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- [ComVisible(false)]
- public struct DISPPARAMS {
- public int cArgs;
- public int cNamedArgs;
- public IntPtr rgdispidNamedArgs;
- public IntPtr rgvarg;
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DispIdAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DispIdAttribute.cs
deleted file mode 100755
index 139c331bb53..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/DispIdAttribute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Runtime.InteropServices.DispIdAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method | AttributeTargets.Property |
- AttributeTargets.Field | AttributeTargets.Event)]
- public sealed class DispIdAttribute : Attribute
- {
- int id;
-
- public DispIdAttribute (int dispId)
- {
- id = dispId;
- }
-
- public int Value {
- get { return id; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs
deleted file mode 100755
index 9d6466527ea..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/DllImportAttribute.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Runtime.InteropServices/DllImportAttribute.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class DllImportAttribute: Attribute {
- public CallingConvention CallingConvention;
- public CharSet CharSet;
- public string EntryPoint;
- public bool ExactSpelling;
- public bool PreserveSig;
- public bool SetLastError;
- private string Dll;
-
- public string Value {
- get {return Dll;}
- }
-
- public DllImportAttribute (string dllName) {
- Dll = dllName;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/EXCEPINFO.cs b/mcs/class/corlib/System.Runtime.InteropServices/EXCEPINFO.cs
deleted file mode 100755
index 1c29b3223a6..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/EXCEPINFO.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-
-// System.Runtime.InteropServices/EXCEPINFO.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- [ComVisible(false)]
- public struct EXCEPINFO {
- public string bstrDescription;
- public string bstrHelpFile;
- public string bstrSource;
- public int dwHelpContext;
- public IntPtr pfnDeferredFillIn;
- public IntPtr pvReserved;
- public short wCode;
- public short wReserved;
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ExporterEventKind.cs b/mcs/class/corlib/System.Runtime.InteropServices/ExporterEventKind.cs
deleted file mode 100644
index d80e2ed847d..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ExporterEventKind.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.ExporterEventKind.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices
-{
- [Serializable] public enum ExporterEventKind
- {
- NOTIF_TYPECONVERTED = 0,
- NOTIF_CONVERTWARNING = 1,
- ERROR_REFTOINVALIDASSEMBLY = 2,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs b/mcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs
deleted file mode 100755
index 014074cef21..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ExternalException.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.InteropServices.ExternalException.cs
-//
-// Author:
-// Miguel De Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Runtime.InteropServices {
- [Serializable]
- public class ExternalException : SystemException {
- private int error_code;
-
- // Constructors
- public ExternalException ()
- : base (Locale.GetText ("External exception"))
- {
- }
-
- public ExternalException (string message)
- : base (message)
- {
- }
-
- protected ExternalException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public ExternalException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public ExternalException (string message, int errorCode)
- : base (message)
- {
- error_code = errorCode;
- }
-
- public virtual int ErrorCode {
- get {
- return error_code;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs
deleted file mode 100755
index a5deebb0675..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/FieldOffsetAttribute.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Field)]
- public sealed class FieldOffsetAttribute : Attribute {
- private int val;
-
- public FieldOffsetAttribute( int offset) {
- val = offset;
- }
- public int Value {
- get {return val;}
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs b/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs
deleted file mode 100755
index cd277c63a53..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// System.Runtime.InteropServices/GCHandle.cs
-//
-// Authors:
-// Ajay kumar Dwivedi (adwiv@yahoo.com) ??
-// Paolo Molaro (lupus@ximian.com)
-//
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-namespace System.Runtime.InteropServices
-{
- /// <summary>
- /// Summary description for GCHandle.
- /// </summary>
- public struct GCHandle
- {
- // fields
- private int handle;
-
- private GCHandle(IntPtr h)
- {
- handle = (int)h;
- }
-
- // Constructors
- private GCHandle(object obj)
- : this(obj, GCHandleType.Normal)
- {}
-
- private GCHandle(object value, GCHandleType type)
- {
- handle = GetTargetHandle (value, 0, type);
- }
-
- // Properties
-
- public bool IsAllocated
- {
- get
- {
- return (handle != 0);
- }
- }
-
- public object Target
- {
- get
- {
- return GetTarget (handle);
- }
- set
- {
- handle = GetTargetHandle (value, handle, (GCHandleType)(-1));
- }
- }
-
- // Methods
- public IntPtr AddrOfPinnedObject()
- {
- IntPtr res = GetAddrOfPinnedObject(handle);
- if (res == IntPtr.Zero)
- throw new InvalidOperationException("The handle is not of Pinned type");
- return res;
- }
-
- public static System.Runtime.InteropServices.GCHandle Alloc(object value)
- {
- return new GCHandle (value);
- }
-
- public static System.Runtime.InteropServices.GCHandle Alloc(object value, GCHandleType type)
- {
- return new GCHandle (value,type);
- }
-
- public void Free()
- {
- FreeHandle(handle);
- handle = 0;
- }
-
- public static explicit operator IntPtr (GCHandle value)
- {
- return (IntPtr) value.handle;
- }
-
- public static explicit operator GCHandle(IntPtr value)
- {
- return new GCHandle (value);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static object GetTarget(int handle);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int GetTargetHandle(object obj, int handle, GCHandleType type);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void FreeHandle(int handle);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static IntPtr GetAddrOfPinnedObject(int handle);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs b/mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs
deleted file mode 100644
index bee7c8b8436..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/GCHandleType.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// GCHandleType.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:33:42 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum GCHandleType {
-
-
- /// <summary>
- /// </summary>
- Weak = 0,
-
- /// <summary>
- /// </summary>
- WeakTrackResurrection = 1,
-
- /// <summary>
- /// </summary>
- Normal = 2,
-
- /// <summary>
- /// </summary>
- Pinned = 3,
- } // GCHandleType
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs
deleted file mode 100755
index 1fd1a44f85e..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/GuidAttribute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Runtime.InteropServices.InAttribute.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate)]
- public sealed class GuidAttribute : Attribute {
-
- private string guidValue;
-
- public GuidAttribute (string guid) {
- guidValue = guid;
- }
-
- public string Value {
- get {return guidValue;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs b/mcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs
deleted file mode 100755
index edde7b22cc0..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ICustomAdapter.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Runtime.InteropServices.ICustomAdapter.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- public interface ICustomAdapter {
- object GetUnderlyingObject ();
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs b/mcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs
deleted file mode 100755
index c5f1cb23eea..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ICustomFactory.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Runtime.InteropServices.ICustomFactory.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- public interface ICustomFactory {
- MarshalByRefObject CreateInstance (Type serverType);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs b/mcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs
deleted file mode 100755
index 90a2b29b619..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ICustomMarshaler.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Runtime.InteropServices.ICustomMarshaler.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- public interface ICustomMarshaler {
- void CleanUpManagedData (object ManagedObj);
- void CleanUpNativeData (IntPtr pNativeData);
- int GetNativeDataSize ();
- IntPtr MarshalManagedToNative (object ManagedObj);
- object MarshalNativeToManaged (IntPtr pNativeData);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/INVOKEKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices/INVOKEKIND.cs
deleted file mode 100755
index 4c318507e5f..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/INVOKEKIND.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-
-// System.Runtime.InteropServices/INVOKEKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- [Serializable]
- [ComVisible(false)]
- public enum INVOKEKIND {
- INVOKE_FUNC = 1,
- INVOKE_PROPERTYGET = 2,
- INVOKE_PROPERTYPUT = 4,
- INVOKE_PROPERTYPUTREF = 8
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs b/mcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs
deleted file mode 100755
index a42e935895c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/IRegistrationServices.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Runtime.InteropServices.IRegistrationServices.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.Reflection;
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- public interface IRegistrationServices {
- Guid GetManagedCategoryGuid ();
- string GetProgIdForType (Type type);
- Type[] GetRegistrableTypesInAssembly (Assembly assembly);
- bool RegisterAssembly (Assembly assembly, AssemblyRegistrationFlags flags);
- void RegisterTypeForComClients (Type type, ref Guid g);
- bool TypeRepresentsComType (Type type);
- bool TypeRequiresRegistration (Type type);
- bool UnregisterAssembly (Assembly assembly);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibConverter.cs b/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibConverter.cs
deleted file mode 100644
index 78be2912f6b..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibConverter.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Runtime.InteropServices.ITypeLibConverter.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLibConverter {
- object ConvertAssemblyToTypeLib (Assembly assembly, string typeLibName, TypeLibExporterFlags flags, ITypeLibExporterNotifySink notifySink);
- AssemblyBuilder ConvertTypeLibToAssembly (object typeLib, string asmFileName, int flags, ITypeLibImporterNotifySink notifySink, byte[] publicKey, StrongNameKeyPair keyPair, bool unsafeInterfaces);
- bool GetPrimaryInteropAssembly (Guid g, int major, int minor, int lcid, out string asmName, out string asmCodeBase);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs b/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs
deleted file mode 100755
index 3e937ae4b22..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.ITypeLibExporterNameProvider.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLibExporterNameProvider {
- string[] GetNames ();
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs b/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs
deleted file mode 100644
index 547b87d73d3..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.InteropServices.ITypeLibExporterNotifySink.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.Reflection;
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLibExporterNotifySink {
- void ReportEvent (ExporterEventKind eventKind, int eventCode, string eventMsg);
- object ResolveRef (Assembly assembly);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs b/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs
deleted file mode 100755
index 3c9199e4063..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.InteropServices.ITypeLibImporterNotifySink.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-using System.Reflection;
-
-namespace System.Runtime.InteropServices {
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface ITypeLibImporterNotifySink {
- void ReportEvent(ImporterEventKind eventKind, int eventCode, string eventMsg);
- Assembly ResolveRef(object typeLib);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs
deleted file mode 100755
index f4403eb8c27..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Runtime.InteropServices.ImportedFromTypeLibAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class ImportedFromTypeLibAttribute : Attribute
- {
- string TlbFile;
- public ImportedFromTypeLibAttribute (string tlbFile)
- {
- TlbFile = tlbFile;
- }
-
- public string Value {
- get { return TlbFile; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs b/mcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs
deleted file mode 100755
index c896b7e053f..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ImporterEventKind.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Runtime.InteropServices.ImporterEventKind.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices
-{
- [Serializable] public enum ImporterEventKind
- {
- NOTIF_TYPECONVERTED = 0,
- NOTIF_CONVERTWARNING = 1,
- ERROR_REFTOINVALIDTYPELIB = 2,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs
deleted file mode 100755
index b141d9dbc49..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/InAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Runtime.InteropServices.InAttribute.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Parameter)]
- public sealed class InAttribute : Attribute {
- public InAttribute () {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs
deleted file mode 100755
index e8cbd5ae9b7..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/InterfaceTypeAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.Runtime.InteropServices.InterfaceTypeAttribute.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage(AttributeTargets.Interface)]
- public sealed class InterfaceTypeAttribute : Attribute {
-
- private ComInterfaceType intType;
-
- public InterfaceTypeAttribute (ComInterfaceType interfaceType){
- intType = interfaceType;
- }
-
- public InterfaceTypeAttribute (short interfaceType) {
- intType = (ComInterfaceType)interfaceType;
- }
-
- public ComInterfaceType Value {
- get {return intType;}
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/LCIDConversionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/LCIDConversionAttribute.cs
deleted file mode 100755
index af04cccc1e4..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/LCIDConversionAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Runtime.InteropServices.LCIDConversionAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class LCIDConversionAttribute : Attribute
- {
- int id;
-
- public LCIDConversionAttribute (int lcid)
- {
- id = lcid;
- }
-
- public int Value {
- get { return id; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs b/mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs
deleted file mode 100644
index 960cc3d551e..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/LayoutKind.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// LayoutKind.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:33:48 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum LayoutKind {
-
- /// <summary>
- /// </summary>
- Sequential = 0,
-
- /// <summary>
- /// </summary>
- Explicit = 2,
-
- /// <summary>
- /// </summary>
- Auto = 3,
- } // LayoutKind
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs b/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
deleted file mode 100644
index 8391cce39c3..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
+++ /dev/null
@@ -1,586 +0,0 @@
-// System.Runtime.InteropServices.Marshal
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Paolo Molaro (lupus@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001-2002 Ximian, Inc.
-
-using System.Runtime.CompilerServices;
-using System;
-using System.Reflection;
-using System.Threading;
-
-namespace System.Runtime.InteropServices
-{
- public sealed class Marshal
- {
- /* fields */
- public static readonly int SystemMaxDBCSCharSize = 2; // don't know what this is
- public static readonly int SystemDefaultCharSize = 2;
-
- private Marshal () {}
-
- [MonoTODO]
- public static int AddRef (IntPtr pUnk) {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public static IntPtr AllocCoTaskMem (int cb) {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static IntPtr AllocHGlobal (IntPtr cb);
-
- public static IntPtr AllocHGlobal (int cb) {
- return AllocHGlobal ((IntPtr)cb);
- }
-
- [MonoTODO]
- public static object BindToMoniker (string monikerName) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void ChangeWrapperHandleStrength (object otp, bool fIsWeak) {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static void copy_to_unmanaged (Array source, int startIndex,
- IntPtr destination, int length);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- extern static void copy_from_unmanaged (IntPtr source, int startIndex,
- Array destination, int length);
-
- public static void Copy (byte[] source, int startIndex, IntPtr destination, int length) {
- copy_to_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (char[] source, int startIndex, IntPtr destination, int length) {
- copy_to_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (short[] source, int startIndex, IntPtr destination, int length) {
- copy_to_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (int[] source, int startIndex, IntPtr destination, int length) {
- copy_to_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (long[] source, int startIndex, IntPtr destination, int length) {
- copy_to_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (float[] source, int startIndex, IntPtr destination, int length) {
- copy_to_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (double[] source, int startIndex, IntPtr destination, int length) {
- copy_to_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (IntPtr source, byte[] destination, int startIndex, int length) {
- copy_from_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (IntPtr source, char[] destination, int startIndex, int length) {
- copy_from_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (IntPtr source, short[] destination, int startIndex, int length) {
- copy_from_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (IntPtr source, int[] destination, int startIndex, int length) {
- copy_from_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (IntPtr source, long[] destination, int startIndex, int length) {
- copy_from_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (IntPtr source, float[] destination, int startIndex, int length) {
- copy_from_unmanaged (source, startIndex, destination, length);
- }
-
- public static void Copy (IntPtr source, double[] destination, int startIndex, int length) {
- copy_from_unmanaged (source, startIndex, destination, length);
- }
-
- [MonoTODO]
- public static object CreateWrapperOfType (object o, Type t) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void DestroyStructure (IntPtr ptr, Type structuretype) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void FreeBSTR (IntPtr ptr) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void FreeCoTaskMem (IntPtr ptr) {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static void FreeHGlobal (IntPtr hglobal);
-
- [MonoTODO]
- public static Guid GenerateGuidForType (Type type) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string GenerateProgIdForType (Type type) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static object GetActiveObject (string progID) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr GetComInterfaceForObject (object o, Type T) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static object GetComObjectData (object obj, object key) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int GetComSlotForMethodInfo (MemberInfo m) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int GetEndComSlot (Type t) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int GetExceptionCode() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr GetExceptionPointers() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr GetHINSTANCE (Module m) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int GetHRForException (Exception e) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int GetHRForLastWin32Error() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr GetIDispatchForObject (object o) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr GetITypeInfoForType (Type t) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr GetIUnknownForObject (object o) {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern int GetLastWin32Error();
-
- [MonoTODO]
- public static IntPtr GetManagedThunkForUnmanagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static MemberInfo GetMethodInfoForComSlot (Type t, int slot, ref ComMemberType memberType) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void GetNativeVariantForObject (object obj, IntPtr pDstNativeVariant) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static object GetObjectForIUnknown (IntPtr pUnk) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static object GetObjectForNativeVariant (IntPtr pSrcNativeVariant) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static object[] GetObjectsForNativeVariants (IntPtr aSrcNativeVariant, int cVars) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int GetStartComSlot (Type t) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Thread GetThreadFromFiberCookie (int cookie) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static object GetTypedObjectForIUnknown (IntPtr pUnk, Type t) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Type GetTypeForITypeInfo (IntPtr piTypeInfo) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string GetTypeInfoName (UCOMITypeInfo pTI) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Guid GetTypeLibGuid (UCOMITypeLib pTLB) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Guid GetTypeLibGuidForAssembly (Assembly asm) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int GetTypeLibLcid (UCOMITypeLib pTLB) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string GetTypeLibName (UCOMITypeLib pTLB) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr GetUnmanagedThunkForManagedMethodPtr (IntPtr pfnMethodToWrap, IntPtr pbSignature, int cbSignature) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static bool IsComObject (object o) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static bool IsTypeVisibleFromCom (Type t) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int NumParamBytes (MethodInfo m) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr OffsetOf (Type t, string fieldName) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void Prelink (MethodInfo m) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void PrelinkAll (Type c) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string PtrToStringAnsi (IntPtr ptr) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string PtrToStringAnsi (IntPtr ptr, int len) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string PtrToStringAuto (IntPtr ptr, int len) {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern string PtrToStringAuto (IntPtr ptr);
-
- [MonoTODO]
- public static string PtrToStringBSTR (IntPtr ptr) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string PtrToStringUni (IntPtr ptr) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static string PtrToStringUni (IntPtr ptr, int len) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void PtrToStructure (IntPtr ptr, object structure) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static object PtrToStructure (IntPtr ptr, Type structureType) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int QueryInterface (IntPtr pUnk, ref Guid iid, out IntPtr ppv) {
- throw new NotImplementedException ();
- }
-
- public static byte ReadByte (IntPtr ptr) {
- return ReadByte (ptr, 0);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static byte ReadByte (IntPtr ptr, int ofs);
-
- [MonoTODO]
- public static byte ReadByte (object ptr, int ofs) {
- throw new NotImplementedException ();
- }
-
- public static short ReadInt16 (IntPtr ptr) {
- return ReadInt16 (ptr, 0);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static short ReadInt16 (IntPtr ptr, int ofs);
-
- [MonoTODO]
- public static short ReadInt16 (object ptr, int ofs) {
- throw new NotImplementedException ();
- }
-
- public static int ReadInt32 (IntPtr ptr) {
- return ReadInt32 (ptr, 0);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static int ReadInt32 (IntPtr ptr, int ofs);
-
- [MonoTODO]
- public static int ReadInt32 (object ptr, int ofs) {
- throw new NotImplementedException ();
- }
-
- public static long ReadInt64 (IntPtr ptr) {
- return ReadInt64 (ptr, 0);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static long ReadInt64 (IntPtr ptr, int ofs);
-
- [MonoTODO]
- public static long ReadInt64(object ptr, int ofs) {
- throw new NotImplementedException ();
- }
-
- public static IntPtr ReadIntPtr (IntPtr ptr) {
- return ReadIntPtr (ptr, 0);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static IntPtr ReadIntPtr (IntPtr ptr, int ofs);
-
- [MonoTODO]
- public static IntPtr ReadIntPtr(object ptr, int ofs) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr ReAllocCoTaskMem (IntPtr pv, int cb) {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static IntPtr ReAllocHGlobal (IntPtr pv, IntPtr cb);
-
- [MonoTODO]
- public static int Release (IntPtr pUnk) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static int ReleaseComObject (object o) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void ReleaseThreadCache() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static bool SetComObjectData (object obj, object key, object data) {
- throw new NotImplementedException ();
- }
-
- public static int SizeOf (object structure) {
- return SizeOf (structure.GetType ());
- }
-
- [MonoTODO]
- public static int SizeOf (Type t) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr StringToBSTR (string s) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr StringToCoTaskMemAnsi (string s) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr StringToCoTaskMemAuto (string s) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr StringToCoTaskMemUni (string s) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr StringToHGlobalAnsi (string s) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr StringToHGlobalAuto (string s) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr StringToHGlobalUni (string s) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void ThrowExceptionForHR (int errorCode) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static void ThrowExceptionForHR (int errorCode, IntPtr errorInfo) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static IntPtr UnsafeAddrOfPinnedArrayElement (Array arr, int index) {
- throw new NotImplementedException ();
- }
-
- public static void WriteByte (IntPtr ptr, byte val) {
- WriteByte (ptr, 0, val);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static void WriteByte (IntPtr ptr, int ofs, byte val);
-
- [MonoTODO]
- public static void WriteByte(object ptr, int ofs, byte val) {
- throw new NotImplementedException ();
- }
-
- public static void WriteInt16 (IntPtr ptr, short val) {
- WriteInt16 (ptr, 0, val);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static void WriteInt16 (IntPtr ptr, int ofs, short val);
-
- [MonoTODO]
- public static void WriteInt16(object ptr, int ofs, short val) {
- throw new NotImplementedException ();
- }
-
- public static void WriteInt32 (IntPtr ptr, int val) {
- WriteInt32 (ptr, 0, val);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static void WriteInt32 (IntPtr ptr, int ofs, int val);
-
- [MonoTODO]
- public static void WriteInt32(object ptr, int ofs, int val) {
- throw new NotImplementedException ();
- }
-
- public static void WriteInt64 (IntPtr ptr, long val) {
- WriteInt64 (ptr, 0, val);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static void WriteInt64 (IntPtr ptr, int ofs, long val);
-
- [MonoTODO]
- public static void WriteInt64(object ptr, int ofs, long val) {
- throw new NotImplementedException ();
- }
-
- public static void WriteIntPtr (IntPtr ptr, IntPtr val) {
- WriteIntPtr (ptr, 0, val);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static void WriteIntPtr (IntPtr ptr, int ofs, IntPtr val);
-
- [MonoTODO]
- public static void WriteIntPtr(object ptr, int ofs, IntPtr val) {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs
deleted file mode 100755
index 48e9f523d07..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/MarshalAsAttribute.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
- public sealed class MarshalAsAttribute : Attribute {
- private UnmanagedType utype;
- public UnmanagedType ArraySubType;
- public string MarshalCookie;
- public string MarshalType;
- public Type MarshalTypeRef;
- public VarEnum SafeArraySubType;
- public int SizeConst;
- public short SizeParamIndex;
-
- public MarshalAsAttribute (short unmanagedType) {
- utype = (UnmanagedType)unmanagedType;
- }
- public MarshalAsAttribute( UnmanagedType unmanagedType) {
- utype = unmanagedType;
- }
- public UnmanagedType Value {
- get {return utype;}
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs
deleted file mode 100755
index d53f5291fa0..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/OptionalAttribute.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Parameter)]
- public sealed class OptionalAttribute : Attribute {
- public OptionalAttribute () {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs
deleted file mode 100644
index 868bc61468b..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/OutAttribute.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Runtime.InteropServices.OutAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Parameter)]
- public sealed class OutAttribute : Attribute {
-
- public OutAttribute ()
- {
- }
-
- public override object TypeId {
- get {
- // TODO: Implement me
- return null;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs b/mcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs
deleted file mode 100755
index c35bac6bdf1..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/PInvokeMap.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-// PInvokeMap.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- /// <remarks>
- /// </remarks>
- public enum PInvokeMap {
-
- /// <summary>
- /// </summary>
- NoMangle = 1,
-
- /// <summary>
- /// </summary>
- CharSetMask = 6,
-
- /// <summary>
- /// </summary>
- CharSetNotSpec = 0,
-
- /// <summary>
- /// </summary>
- CharSetAnsi = 2,
-
- /// <summary>
- /// </summary>
- CharSetUnicode = 4,
-
- /// <summary>
- /// </summary>
- CharSetAuto = 6,
-
- /// <summary>
- /// </summary>
- PinvokeOLE = 32,
-
- /// <summary>
- /// </summary>
- SupportsLastError = 64,
-
- /// <summary>
- /// </summary>
- CallConvMask = 1792,
-
- /// <summary>
- /// </summary>
- CallConvWinapi = 256,
-
- /// <summary>
- /// </summary>
- CallConvCdecl = 512,
-
- /// <summary>
- /// </summary>
- CallConvStdcall = 768,
-
- /// <summary>
- /// </summary>
- CallConvThiscall = 1024,
-
- /// <summary>
- /// </summary>
- CallConvFastcall = 1280,
- } // PInvokeMap
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/PreserveSigAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/PreserveSigAttribute.cs
deleted file mode 100755
index 691cef7c7df..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/PreserveSigAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// System.Runtime.InteropServices.PreserveSigAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class PreserveSigAttribute : Attribute
- {
- public PreserveSigAttribute ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs
deleted file mode 100755
index b39858e6cde..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class PrimaryInteropAssemblyAttribute : Attribute
- {
- int major, minor;
-
- public PrimaryInteropAssemblyAttribute (int major, int minor)
- {
- this.major = major;
- this.minor = minor;
- }
-
- public int MajorVersion {
- get { return major; }
- }
-
- public int MinorVersion {
- get { return minor; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ProgIdAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/ProgIdAttribute.cs
deleted file mode 100755
index 7db764fef0c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/ProgIdAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Runtime.InteropServices.ProgIdAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class ProgIdAttribute : Attribute
- {
- string pid;
-
- public ProgIdAttribute (string progId)
- {
- pid = progId;
- }
-
- public string Value {
- get { return pid; }
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs
deleted file mode 100755
index 420e70efa0c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/StructLayoutAttribute.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct)]
- public sealed class StructLayoutAttribute : Attribute {
- public CharSet CharSet = CharSet.Auto;
- public int Pack = 8;
- public int Size = 0;
- private LayoutKind lkind;
-
- public StructLayoutAttribute( short layoutKind) {
- lkind = (LayoutKind)layoutKind;
- }
- public StructLayoutAttribute( LayoutKind layoutKind) {
- lkind = layoutKind;
- }
- public LayoutKind Value {
- get {return lkind;}
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TYPEKIND.cs b/mcs/class/corlib/System.Runtime.InteropServices/TYPEKIND.cs
deleted file mode 100755
index 58c91af6788..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TYPEKIND.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-
-// System.Runtime.InteropServices/TYPEKIND.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- [Serializable]
- [ComVisible(false)]
- 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
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs
deleted file mode 100755
index 7f7c7695412..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibExporterFlags.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibExporterFlags.cs
-//
-// Author:
-// Kevin Winchester (kwin@ns.sympatico.ca)
-//
-// (C) 2002 Kevin Winchester
-//
-
-namespace System.Runtime.InteropServices
-{
- [Flags] [Serializable]
- public enum TypeLibExporterFlags {
- OnlyReferenceRegistered = 1,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncAttribute.cs
deleted file mode 100755
index c58eaccbec2..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibFuncAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class TypeLibFuncAttribute : Attribute
- {
- TypeLibFuncFlags flags;
-
- public TypeLibFuncAttribute (short flags)
- {
- this.flags = (TypeLibFuncFlags) flags;
- }
-
- public TypeLibFuncAttribute (TypeLibFuncFlags flags)
- {
- this.flags = flags;
- }
-
- public TypeLibFuncFlags Value {
- get { return flags; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncFlags.cs
deleted file mode 100755
index b0768bca301..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibFuncFlags.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// System.Runtime.InteropServices.TypeLibFuncFlags.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices {
- [Flags] [Serializable]
- public enum TypeLibFuncFlags {
- FRestricted = 1,
- FSource = 2,
- FBindable = 4,
- FRequestEdit = 8,
- FDisplayBind = 16,
- FDefaultBind = 32,
- FHidden = 64,
- FUsesGetLastError = 128,
- FDefaultCollelem = 256,
- FUiDefault = 512,
- FNonBrowsable = 1024,
- FReplaceable = 2048,
- FImmediateBind = 4096,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeAttribute.cs
deleted file mode 100755
index d76bfcd814b..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibTypeAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class TypeLibTypeAttribute : Attribute
- {
- TypeLibTypeFlags flags;
-
- public TypeLibTypeAttribute (short flags)
- {
- this.flags = (TypeLibTypeFlags) flags;
- }
-
- public TypeLibTypeAttribute (TypeLibTypeFlags flags)
- {
- this.flags = flags;
- }
-
- public TypeLibTypeFlags Value {
- get { return flags; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeFlags.cs
deleted file mode 100755
index adf5297698a..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibTypeFlags.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// System.Runtime.InteropServices.TypeLibTypeFlags.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices {
- [Flags] [Serializable]
- public enum TypeLibTypeFlags {
- FAppObject = 1,
- FCanCreate = 2,
- FLicensed = 4,
- FPreDeclId = 8,
- FHidden= 16,
- FControl = 32,
- FDual = 64,
- FNonExtensible = 128,
- FOleAutomation = 256,
- FRestricted = 512,
- FAggregatable = 1024,
- FReplaceable = 2048,
- FDispatchable = 4096,
- FReverseBind = 8192,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarAttribute.cs
deleted file mode 100755
index 1e5f2a4792c..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarAttribute.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// System.Runtime.InteropServices.TypeLibTypeAttribute.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-
-namespace System.Runtime.InteropServices {
-
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class TypeLibVarAttribute : Attribute
- {
- TypeLibVarFlags flags;
-
- public TypeLibVarAttribute (short flags)
- {
- this.flags = (TypeLibVarFlags) flags;
- }
-
- public TypeLibVarAttribute (TypeLibVarFlags flags)
- {
- this.flags = flags;
- }
-
- public TypeLibVarFlags Value {
- get { return flags; }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarFlags.cs b/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarFlags.cs
deleted file mode 100755
index 5bf60e5a03a..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/TypeLibVarFlags.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// System.Runtime.InteropServices.TypeLibVarFlags.cs
-//
-// Name: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.InteropServices {
-
- [Flags] [Serializable]
- public enum TypeLibVarFlags {
- FReadOnly = 1,
- FSource = 2,
- FBindable = 4,
- FRequestEdit = 8,
- FDisplayBind = 16,
- FDefaultBind = 32,
- FHidden = 64,
- FRestricted = 128,
- FDefaultCollelem = 256,
- FUiDefault = 512,
- FNonBrowsable = 1024,
- FReplaceable = 2048,
- FImmediateBind = 4096,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeComp.cs b/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeComp.cs
deleted file mode 100755
index 8bb02c82f49..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeComp.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-
-// System.Runtime.InteropServices/UCOMITypeComp.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface UCOMITypeComp {
- void Bind( string szName, int lHashVal, short wFlags, out UCOMITypeInfo ppTInfo, out DESCKIND pDescKind, out BINDPTR pBindPtr);
- void BindType( string szName, int lHashVal, out UCOMITypeInfo ppTInfo, out UCOMITypeComp ppTComp);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeInfo.cs b/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeInfo.cs
deleted file mode 100755
index 1e36703c46d..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-
-// System.Runtime.InteropServices/UCOMITypeInfo.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface UCOMITypeInfo {
- void AddressOfMember (int memid, INVOKEKIND invKind, out IntPtr ppv);
- void CreateInstance (object pUnkOuter, ref Guid riid, out object ppvObj);
- void GetContainingTypeLib (out UCOMITypeLib ppTLB, out int pIndex);
- void GetDllEntry (int memid, INVOKEKIND invKind, out string pBstrDllName, out string pBstrName, out short pwOrdinal);
- void GetDocumentation (int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
- void GetFuncDesc (int index, out IntPtr ppFuncDesc);
- void GetIDsOfNames (string[] rgszNames, int cNames, int[] pMemId);
- void GetImplTypeFlags (int index, out int pImplTypeFlags);
- void GetMops (int memid, out string pBstrMops);
- void GetNames (int memid, string[] rgBstrNames, int cMaxNames, out int pcNames);
- void GetRefTypeInfo (int hRef, out UCOMITypeInfo ppTI);
- void GetRefTypeOfImplType (int index, out int href);
- void GetTypeAttr (out IntPtr ppTypeAttr);
- void GetTypeComp (out UCOMITypeComp ppTComp);
- void GetVarDesc (int index, out IntPtr ppVarDesc);
- void Invoke (object pvInstance, int memid, short wFlags, ref DISPPARAMS pDispParams, out object pVarResult, out EXCEPINFO pExcepInfo, out int puArgErr);
- void ReleaseFuncDesc (IntPtr pFuncDesc);
- void ReleaseTypeAttr (IntPtr pTypeAttr);
- void ReleaseVarDesc (IntPtr pVarDesc);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeLib.cs b/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeLib.cs
deleted file mode 100755
index 73a2d29570f..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/UCOMTypeLib.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-
-// System.Runtime.InteropServices/UCOMITypeLib.cs
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-
-using System;
-
-namespace System.Runtime.InteropServices
-{
-
- //[Guid("")]
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
- public interface UCOMITypeLib {
- void FindName( string szNameBuf, int lHashVal, UCOMITypeInfo[] ppTInfo, int[] rgMemId, ref short pcFound);
- void GetDocumentation( int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile);
- void GetLibAttr( out IntPtr ppTLibAttr);
- void GetTypeComp( out UCOMITypeComp ppTComp);
- void GetTypeInfo( int index, out UCOMITypeInfo ppTI);
- void GetTypeInfoOfGuid( ref Guid guid, out UCOMITypeInfo ppTInfo);
- void GetTypeInfoType( int index, out TYPEKIND pTKind);
- bool IsName( string szNameBuf, int lHashVal);
- void ReleaseTLibAttr( IntPtr pTLibAttr);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs b/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
deleted file mode 100755
index b6f0fe5a7c8..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/UnmanagedType.cs
+++ /dev/null
@@ -1,170 +0,0 @@
-// UnmanagedType.cs
-//
-// This code was automatically generated from
-// ECMA CLI XML Library Specification.
-// Generator: libgen.xsl [1.0; (C) Sergey Chaban (serge@wildwestsoftware.com)]
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.InteropServices {
-
-
- /// <summary>
- /// </summary>
- public enum UnmanagedType {
-
- /// <summary>
- /// </summary>
- Bool = 2,
-
- /// <summary>
- /// </summary>
- I1 = 3,
-
- /// <summary>
- /// </summary>
- U1 = 4,
-
- /// <summary>
- /// </summary>
- I2 = 5,
-
- /// <summary>
- /// </summary>
- U2 = 6,
-
- /// <summary>
- /// </summary>
- I4 = 7,
-
- /// <summary>
- /// </summary>
- U4 = 8,
-
- /// <summary>
- /// </summary>
- I8 = 9,
-
- /// <summary>
- /// </summary>
- U8 = 10,
-
- /// <summary>
- /// </summary>
- R4 = 11,
-
- /// <summary>
- /// </summary>
- R8 = 12,
-
- Currency = 15,
-
- /// <summary>
- /// </summary>
- BStr = 19,
-
- /// <summary>
- /// </summary>
- LPStr = 20,
-
- /// <summary>
- /// </summary>
- LPWStr = 21,
-
- /// <summary>
- /// </summary>
- LPTStr = 22,
-
- /// <summary>
- /// </summary>
- ByValTStr = 23,
-
- /// <summary>
- /// </summary>
- IUnknown = 25,
-
- /// <summary>
- /// </summary>
- IDispatch = 26,
-
- /// <summary>
- /// </summary>
- Struct = 27,
-
- /// <summary>
- /// </summary>
- Interface = 28,
-
- /// <summary>
- /// </summary>
- SafeArray = 29,
-
- /// <summary>
- /// </summary>
- ByValArray = 30,
-
- /// <summary>
- /// </summary>
- SysInt = 31,
-
- /// <summary>
- /// </summary>
- SysUInt = 32,
-
- /// <summary>
- /// </summary>
- VBByRefStr = 34,
-
- /// <summary>
- /// </summary>
- AnsiBStr = 35,
-
- /// <summary>
- /// </summary>
- TBStr = 36,
-
- /// <summary>
- /// </summary>
- VariantBool = 37,
-
- /// <summary>
- /// </summary>
- FunctionPtr = 38,
-
- /// <summary>
- /// </summary>
- // LPVoid = 39,
-
- /// <summary>
- /// </summary>
- AsAny = 40,
-
- /// <summary>
- /// </summary>
- //RPrecise = 41,
-
- /// <summary>
- /// </summary>
- LPArray = 42,
-
- /// <summary>
- /// </summary>
- LPStruct = 43,
-
- /// <summary>
- /// </summary>
- CustomMarshaler = 44,
-
- /// <summary>
- /// </summary>
- Error = 45,
-
- /// <summary>
- /// </summary>
- //NativeTypeMax = 80,
- } // UnmanagedType
-
-} // System.Runtime.InteropServices
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs b/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs
deleted file mode 100755
index 4a8dc4168c1..00000000000
--- a/mcs/class/corlib/System.Runtime.InteropServices/VarEnum.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-
-namespace System.Runtime.InteropServices {
- public enum VarEnum {
- VT_EMPTY = 0,
- VT_NULL = 1,
- VT_I2 = 2,
- VT_I4 = 3,
- VT_R4 = 4,
- VT_R8 = 5,
- VT_CY = 6,
- VT_DATE = 7,
- VT_BSTR = 8,
- VT_DISPATCH = 9,
- VT_ERROR = 10,
- VT_BOOL = 11,
- VT_VARIANT = 12,
- VT_UNKNOWN = 13,
- VT_DECIMAL = 14,
- VT_I1 = 16,
- VT_UI1 = 17,
- VT_UI2 = 18,
- VT_UI4 = 19,
- VT_I8 = 20,
- VT_UI8 = 21,
- VT_INT = 22,
- VT_UINT = 23,
- VT_VOID = 24,
- VT_HRESULT = 25,
- VT_PTR = 26,
- VT_SAFEARRAY = 27,
- VT_CARRAY = 28,
- VT_USERDEFINED = 29,
- VT_LPSTR = 30,
- VT_LPWSTR = 31,
- VT_RECORD = 36,
- VT_FILETIME = 64,
- VT_BLOB = 65,
- VT_STREAM = 66,
- VT_STORAGE = 67,
- VT_STREAMED_OBJECT = 68,
- VT_STORED_OBJECT = 69,
- VT_BLOB_OBJECT = 70,
- VT_CF = 71,
- VT_CLSID = 72,
- VT_VECTOR = 4096,
- VT_ARRAY = 8192,
- VT_BYREF = 16384
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs
deleted file mode 100644
index 574f2de52bf..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivatorLevel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.ActivatorLevel..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Remoting.Activation {
-
- public enum ActivatorLevel {
- Construction = 4,
- Context = 8,
- AppDomain = 12,
- Process = 16,
- Machine = 20,
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs
deleted file mode 100644
index 60bf6be961c..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/IActivator.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IActivator..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Remoting.Activation {
-
- public interface IActivator {
- ActivatorLevel Level {
- get;
- }
-
- IActivator NextActivator {
- get; set;
- }
-
- IConstructionReturnMessage Activate (IConstructionCallMessage msg);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs
deleted file mode 100644
index 6bbb601e467..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionCallMessage.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Runtime.Remoting.Activation.IConstructionCallMessage.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Activation {
-
- public interface IConstructionCallMessage {
- Type ActivationType {
- get;
- }
-
- string ActivationTypeName {
- get;
- }
-
- IActivator Activator {
- get;
- set;
- }
-
- object [] CallSiteActivationAttributes {
- get;
- }
-
- IList ContextProperties {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs
deleted file mode 100644
index 495736f8c44..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IConstructionReturnMessage..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Remoting.Activation {
-
- public interface IConstructionReturnMessage :IMethodReturnMessage, IMethodMessage, IMessage {
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
deleted file mode 100644
index 6a923ac52b2..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/Context.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.Context..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public class Context {
- static Context default_context;
- ArrayList context_properties;
- int context_id;
- bool frozen;
- static int global_count;
-
- static Context ()
- {
- default_context = new Context ();
- default_context.frozen = true;
- }
-
- public Context ()
- {
- context_id = global_count++;
- }
-
- public static Context DefaultContext {
- get {
- return default_context;
- }
- }
-
- public virtual int ContextID {
- get {
- return context_id;
- }
- }
-
- public virtual IContextProperty GetProperty (string name)
- {
- if (context_properties == null)
- return null;
-
- foreach (IContextProperty p in context_properties)
- if (p.Name == name)
- return p;
-
- return null;
- }
-
- public virtual void SetProperty (IContextProperty prop)
- {
- if (prop == null)
- throw new ArgumentNullException ("IContextProperty");
- if (this == default_context)
- throw new InvalidOperationException ("Can not add properties to " +
- "default context");
- if (frozen)
- throw new InvalidOperationException ("Context is Frozen");
-
- if (context_properties == null)
- context_properties = new ArrayList ();
-
- context_properties.Add (prop);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs
deleted file mode 100644
index 46705c6683d..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/ContextAttribute.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.ContextAttribute..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Activation;
-using System.Collections;
-
-namespace System.Runtime.Remoting.Contexts {
-
- [AttributeUsage (AttributeTargets.Class)]
- [Serializable]
- public class ContextAttribute : Attribute, IContextAttribute, IContextProperty {
- protected string AttributeName;
-
- public virtual string Name {
- get {
- return AttributeName;
- }
- }
-
- public override bool Equals (object o)
- {
- if (o == null)
- return false;
-
- if (!(o is ContextAttribute))
- return false;
-
- ContextAttribute ca = (ContextAttribute) o;
-
- if (ca.AttributeName != AttributeName)
- return false;
-
- return true;
- }
-
- public virtual void Freeze (Context ctx)
- {
- }
-
- public override int GetHashCode ()
- {
- if (AttributeName == null)
- return 0;
-
- return AttributeName.GetHashCode ();
- }
-
- /// <summary>
- /// Adds the current context property to the IConstructionCallMessage
- /// </summary>
- public virtual void GetPropertiesForNewContext (IConstructionCallMessage msg)
- {
- if (msg == null)
- throw new ArgumentNullException ("IConstructionCallMessage");
-
- IList list = msg.ContextProperties;
-
- list.Add (this);
- }
-
- // <summary>
- // True whether the context arguments satisfies the requirements
- // of the current context.
- // </summary>
- public virtual bool IsContextOK (Context ctx, IConstructionCallMessage msg)
- {
- if (msg == null)
- throw new ArgumentNullException ("IConstructionCallMessage");
- if (ctx == null)
- throw new ArgumentNullException ("Context");
-
- if (!msg.ActivationType.IsContextful)
- return true;
-
- IContextProperty p = ctx.GetProperty (AttributeName);
- if (p == null)
- return false;
-
- if (this != p)
- return false;
-
- return true;
- }
-
- public virtual bool IsNewContextOK (Context ctx)
- {
- return true;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs
deleted file mode 100644
index b998062642c..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IContextAttribute..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Activation;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IContextAttribute {
-
- void GetPropertiesForNewContext (IConstructionCallMessage msg);
-
- bool IsContextOK (Context ctx, IConstructionCallMessage msg);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs
deleted file mode 100644
index 7230c19b029..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IContextProperty.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IContextProperty..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IContextProperty {
-
- string Name {
- get;
- }
-
- void Freeze (Context ctx);
-
- bool IsNewContextOK (Context ctx);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs
deleted file mode 100644
index daf169559d8..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IDynamicMessageSink..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IDynamicMessageSink {
-
- void ProcessMessageFinish (IMessage reply_msg, bool client_site, bool async);
-
- void ProcessMessageStart (IMessage req_msg, bool client_site, bool async);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs
deleted file mode 100644
index e469e24b6f1..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/IDynamicProperty.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.IDynamicProperty..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Runtime.Remoting.Contexts {
-
- public interface IDynamicProperty {
-
- string Name {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs b/mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs
deleted file mode 100644
index b6fda36d9bb..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// System.Runtime.Remoting.Contexts.SynchronizationAttribute..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-using System.Runtime.Remoting.Messaging;
-using System.Runtime.Remoting.Activation;
-
-namespace System.Runtime.Remoting.Contexts {
-
- public class SynchronizationAttribute : ContextAttribute
- {
- public const int NOT_SUPPORTED = 1;
- public const int SUPPORTED = 2;
- public const int REQUIRED = 4;
- public const int REQUIRES_NEW = 8;
-
- private bool _fReentrant = false;
- private int _nBehavior = REQUIRED;
- private bool _fLocked = false;
-
- public SynchronizationAttribute ()
- {
- }
-
- public SynchronizationAttribute (bool fReentrant)
- {
- _fReentrant = fReentrant;
- }
-
- public SynchronizationAttribute (int nBehavior)
- {
- if (nBehavior != NOT_SUPPORTED &&
- nBehavior != SUPPORTED &&
- nBehavior != REQUIRED &&
- nBehavior != REQUIRES_NEW)
- {
- throw new ArgumentException ("Invalid Flag");
- }
- _nBehavior = nBehavior;
- }
-
- public SynchronizationAttribute (int nBehavior, bool fReentrant)
- {
- if (nBehavior != NOT_SUPPORTED &&
- nBehavior != SUPPORTED &&
- nBehavior != REQUIRED &&
- nBehavior != REQUIRES_NEW)
- {
- throw new ArgumentException ("Invalid Flag");
- }
- _nBehavior = nBehavior;
- _fReentrant = fReentrant;
- }
-
- public virtual bool IsReEntrant
- {
- get { return _fReentrant; }
- }
-
- public virtual bool Locked
- {
- get { return _fLocked; }
- set { _fLocked = value; }
- }
-
- [MonoTODO]
- public virtual IMessageSink GetClientContextSink (IMessageSink nextSink)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override void GetPropertiesForNewContext (IConstructionCallMessage ctorMsg)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public virtual IMessageSink GetServerContextSink (IMessageSink nextSink)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override bool IsContextOK (Context ctx, IConstructionCallMessage msg)
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
deleted file mode 100644
index 10eb384e846..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging/AsyncResult.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Martin Baulig (martin@gnome.org)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Threading;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.Remoting.Messaging {
-
-public class AsyncResult : IAsyncResult {
-
- object async_state;
- WaitHandle handle;
- object async_delegate;
- IntPtr data;
- bool sync_completed;
- bool completed;
- bool endinvoke_called;
-
- public virtual object AsyncState
- {
- get {
- return async_state;
- }
- }
-
- public virtual WaitHandle AsyncWaitHandle
- {
- get {
- return handle;
- }
- }
-
- public virtual bool CompletedSynchronously
- {
- get {
- return sync_completed;
- }
- }
-
- public virtual bool IsCompleted
- {
- get {
- return completed;
- }
- }
-
- public bool EndInvokeCalled
- {
- get {
- return endinvoke_called;
- }
- set {
- endinvoke_called = value;
- }
- }
-
- public virtual object AsyncDelegate
- {
- get {
- return async_delegate;
- }
- }
-
-}
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
deleted file mode 100644
index f01e3ca8e90..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-
-Thu Apr 4 13:13:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * IMethodReturnMessage.cs: added IMethodMessage, IMessage interfaces.
- * ReturnMessage.cs: stubbed out Properties property.
-
-2002-03-21 Dietmar Maurer <dietmar@ximian.com>
-
- * AsyncResult.cs: impl.
-
-2002/03/04 Nick Drochak <ndrochak@gol.com>
-
- * Header.cs: Change properties into fields where they should be.
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs
deleted file mode 100644
index 0b08bfd3eb8..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/Header.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.Header.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Messaging {
-
- [Serializable]
- public class Header {
- public Header (string name, object value) :
- this (name, value, true)
- {
- }
-
- public Header (string name, object value, bool must_understand) :
- this (name, value, must_understand, null)
- {
- }
-
- public Header (string name, object value, bool must_understand, string header_namespace) {
- this.name = name;
- this.value = value;
- this.must_understand = must_understand;
- this.header_namespace = header_namespace;
- }
-
- // fields
-
- public string HeaderNamespace;
-
- public bool MustUnderstand;
-
- public string Name;
-
- public object Value;
-
- // private
-
- private string name;
- private object value;
- private bool must_understand;
- private string header_namespace;
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs
deleted file mode 100644
index d1a5c0c1207..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessage.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMessage.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-
-namespace System.Runtime.Remoting.Messaging {
-
- public interface IMessage {
-
- IDictionary Properties {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageCtrl.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageCtrl.cs
deleted file mode 100644
index 5fe21c32232..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageCtrl.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMessageSink.cs
-//
-// Author:
-// Piers Haken (piersh@friskit.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting;
-
-namespace System.Runtime.Remoting.Messaging
-{
- public interface IMessageCtrl
- {
- void Cancel (int msToCancel);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageSink.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageSink.cs
deleted file mode 100644
index 8c25aac6b24..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMessageSink.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMessageSink.cs
-//
-// Author:
-// Piers Haken (piersh@friskit.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting;
-
-namespace System.Runtime.Remoting.Messaging
-{
- public interface IMessageSink
- {
- IMessage SyncProcessMessage (IMessage msg);
- IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink);
- IMessageSink NextSink { get; }
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodCallMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodCallMessage.cs
deleted file mode 100644
index 0f0846ca663..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodCallMessage.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMethodCallMessage.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection;
-
-namespace System.Runtime.Remoting.Messaging {
-
- public interface IMethodCallMessage : IMethodMessage, IMessage {
-
- int InArgCount {
- get;
- }
-
- object [] InArgs {
- get;
- }
-
- object GetInArg (int arg_num);
- string GetInArgName (int arg_num);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs
deleted file mode 100644
index 49cadf428ec..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodMessage.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMethodMessage..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection;
-
-namespace System.Runtime.Remoting.Messaging {
-
- public interface IMethodMessage {
- int ArgCount {
- get;
- }
-
- object [] Args {
- get;
- }
-
- bool HasVarArgs {
- get;
- }
-
- LogicalCallContext LogicalCallContext {
- get;
- }
-
- MethodBase MethodBase {
- get;
- }
-
- string MethodName {
- get;
- }
-
- object MethodSignature {
- get;
- }
-
- string TypeName {
- get;
- }
-
- string Uri {
- get;
- }
-
- object GetArg (int arg_num);
- string GetArgName (int arg_num);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs
deleted file mode 100644
index d059ce9b5fc..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.IMethodReturnMessage..cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Remoting.Messaging {
-
- public interface IMethodReturnMessage : IMethodMessage, IMessage {
-
- Exception Exception { get; }
- int OutArgCount { get; }
- object [] OutArgs { get; }
- object ReturnValue { get; }
-
- object GetOutArg (int arg_num);
- string GetOutArgName (int arg_num);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs
deleted file mode 100644
index a9e44a0ca4b..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/LogicalCallContext.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.LogicalCallContext.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Remoting.Messaging {
-
- [MonoTODO]
- [Serializable]
- public sealed class LogicalCallContext : ISerializable, ICloneable {
-
- internal LogicalCallContext () {}
-
- public bool HasInfo {
- get { return false; }
- }
-
- public void FreeNamedDataSlot (string name) {
- }
-
- public object GetData (string name) {
- return null;
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context) {
- }
-
- public void SetData (string name, object data) {
- }
-
- public object Clone () {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs
deleted file mode 100644
index 0ddd8487815..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/MonoMethodMessage.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.MonoMethodMessage.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.Remoting.Messaging {
-
- internal class MonoMethodMessage : IMethodCallMessage, IMethodReturnMessage {
-
- MonoMethod method;
-
- object [] args;
-
- string [] names;
-
- byte [] arg_types; /* 1 == IN; 2 == OUT ; 3 = INOUT */
-
- public LogicalCallContext ctx;
-
- public object rval;
-
- public Exception exc;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern void InitMessage (MonoMethod method, object [] out_args);
-
- public MonoMethodMessage (MonoMethod method, object [] out_args)
- {
- InitMessage (method, out_args);
- }
-
- public IDictionary Properties {
- get {
- return null;
- }
- }
-
- public int ArgCount {
- get {
- return args.Length;
- }
- }
-
- public object [] Args {
- get {
- return args;
- }
- }
-
- public bool HasVarArgs {
- get {
- return false;
- }
- }
-
- public LogicalCallContext LogicalCallContext {
- get {
- return ctx;
- }
- }
-
- public MethodBase MethodBase {
- get {
- return method;
- }
- }
-
- public string MethodName {
- get {
- return method.Name;
- }
- }
-
- public object MethodSignature {
- get {
- return null;
- }
- }
-
- public string TypeName {
- get {
- return null;
- }
- }
-
- public string Uri {
- get {
- return null;
- }
- }
-
- public object GetArg (int arg_num)
- {
- return args [arg_num];
- }
-
- public string GetArgName (int arg_num)
- {
- return names [arg_num];
- }
-
- public int InArgCount {
- get {
- int count = 0;
-
- foreach (byte t in arg_types) {
- if ((t & 1) != 0) count++;
-
- }
- return count;
- }
- }
-
- public object [] InArgs {
- get {
- int i, j, count = InArgCount;
- object [] inargs = new object [count];
-
- i = j = 0;
- foreach (byte t in arg_types) {
- if ((t & 1) != 0)
- inargs [j++] = args [i];
- i++;
- }
-
- return inargs;
- }
- }
-
- public object GetInArg (int arg_num)
- {
- int i = 0, j = 0;
- foreach (byte t in arg_types) {
- if ((t & 1) != 0) {
- if (j++ == arg_num)
- return args [i];
- }
- i++;
- }
- return null;
- }
-
- public string GetInArgName (int arg_num)
- {
- int i = 0, j = 0;
- foreach (byte t in arg_types) {
- if ((t & 1) != 0) {
- if (j++ == arg_num)
- return names [i];
- }
- i++;
- }
- return null;
- }
-
- public Exception Exception {
- get {
- return exc;
- }
- }
-
- public int OutArgCount {
- get {
- int count = 0;
-
- foreach (byte t in arg_types) {
- if ((t & 2) != 0) count++;
-
- }
- return count;
- }
- }
-
- public object [] OutArgs {
- get {
- int i, j, count = OutArgCount;
- object [] outargs = new object [count];
-
- i = j = 0;
- foreach (byte t in arg_types) {
- if ((t & 2) != 0)
- outargs [j++] = args [i];
- i++;
- }
-
- return outargs;
- }
- }
-
- public object ReturnValue {
- get {
- return rval;
- }
- }
-
- public object GetOutArg (int arg_num)
- {
- int i = 0, j = 0;
- foreach (byte t in arg_types) {
- if ((t & 2) != 0) {
- if (j++ == arg_num)
- return args [i];
- }
- i++;
- }
- return null;
- }
-
- public string GetOutArgName (int arg_num)
- {
- int i = 0, j = 0;
- foreach (byte t in arg_types) {
- if ((t & 2) != 0) {
- if (j++ == arg_num)
- return names [i];
- }
- i++;
- }
- return null;
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs
deleted file mode 100644
index 21fef1d6818..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ReturnMessage.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-//
-// System.Runtime.Remoting.Messaging.ReturnMessage.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-
-namespace System.Runtime.Remoting.Messaging {
-
- public class ReturnMessage : IMethodReturnMessage, IMethodMessage {
-
- MonoMethodMessage msg;
- IMethodCallMessage request;
-
- public ReturnMessage (object returnValue, object [] outArgs,
- int outArgCount, LogicalCallContext callCtx,
- IMethodCallMessage request)
- {
- // fixme: why do we need outArgCount?
- msg = new MonoMethodMessage ((MonoMethod)request.MethodBase, outArgs);
- this.request = request;
- msg.rval = returnValue;
- msg.ctx = callCtx;
- }
-
- public ReturnMessage (Exception exc, IMethodCallMessage request)
- {
- msg = new MonoMethodMessage ((MonoMethod)request.MethodBase, null);
- this.request = request;
- msg.exc = exc;
- msg.ctx = request.LogicalCallContext;
- }
-
- public int ArgCount {
- get {
- return msg.ArgCount;
- }
- }
-
- public object [] Args {
- get {
- return msg.Args;
- }
- }
-
- public bool HasVarArgs {
- get {
- return msg.HasVarArgs;
- }
- }
-
- public LogicalCallContext LogicalCallContext {
- get {
- return msg.ctx;
- }
- }
-
- public MethodBase MethodBase {
- get {
- return msg.MethodBase;
- }
- }
-
- public string MethodName {
- get {
- return msg.MethodName;
- }
- }
-
- public object MethodSignature {
- get {
- return msg.MethodSignature;
- }
- }
-
- [MonoTODO]
- public virtual IDictionary Properties {
- get {
- return null;
- }
- }
-
- public string TypeName {
- get {
- return msg.TypeName;
- }
- }
-
- public string Uri {
- get {
- return msg.Uri;
- }
- }
-
- public object GetArg (int arg_num)
- {
- return msg.GetArg (arg_num);
- }
-
- public string GetArgName (int arg_num)
- {
- return msg.GetArgName (arg_num);
- }
-
- public Exception Exception {
- get {
- return msg.exc;
- }
- }
-
- public int OutArgCount {
- get {
- return msg.OutArgCount;
- }
- }
-
- public object [] OutArgs {
- get {
- return msg.OutArgs;
- }
- }
-
- public virtual object ReturnValue {
- get {
- return msg.rval;
- }
- }
-
- public object GetOutArg (int arg_num)
- {
- return msg.GetOutArg (arg_num);
- }
-
- public string GetOutArgName (int arg_num)
- {
- return msg.GetOutArgName (arg_num);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
deleted file mode 100644
index 16131866bc4..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Runtime.Remoting.Proxies.RealProxy.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.Remoting.Messaging;
-using System.Runtime.CompilerServices;
-
-
-namespace System.Runtime.Remoting.Proxies
-{
- internal class TransparentProxy {
- public RealProxy _rp;
- IntPtr _class;
- }
-
- public abstract class RealProxy {
-
- Type class_to_proxy;
-
- protected RealProxy () {
- throw new NotImplementedException ();
- }
-
- protected RealProxy (Type classToProxy) {
- this.class_to_proxy = classToProxy;
- }
-
- protected RealProxy (Type classToProxy, IntPtr stub, object stubData) {
- throw new NotImplementedException ();
- }
-
- public abstract IMessage Invoke (IMessage msg);
-
- /* this is called from unmanaged code */
- internal static object PrivateInvoke (RealProxy rp, IMessage msg, out Exception exc,
- out object [] out_args)
- {
- IMethodReturnMessage res_msg = (IMethodReturnMessage)rp.Invoke (msg);
-
- exc = res_msg.Exception;
- out_args = res_msg.OutArgs;
- return res_msg.ReturnValue;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern virtual object GetTransparentProxy ();
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
deleted file mode 100755
index 1d7c354a86b..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ObjRef.cs : Strew the MonoTODO attribute.
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * ObjRef.cs: Include System.Runtime.Serialization
-
diff --git a/mcs/class/corlib/System.Runtime.Remoting/LeaseState.cs b/mcs/class/corlib/System.Runtime.Remoting/LeaseState.cs
deleted file mode 100755
index 825e6130e0d..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/LeaseState.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// LeaseState.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:40:41 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- public enum LeaseState {
-
- /// <summary>
- /// </summary>
- Null = 0,
-
- /// <summary>
- /// </summary>
- Initial = 1,
-
- /// <summary>
- /// </summary>
- Active = 2,
-
- /// <summary>
- /// </summary>
- Renewing = 3,
-
- /// <summary>
- /// </summary>
- Expired = 4,
- } // LeaseState
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs b/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs
deleted file mode 100644
index 6f564878969..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.Runtime.Remoting.ObjRef.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-// FIXME: This is just a skeleton for practical purposes.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Remoting {
-
- [Serializable]
- public class ObjRef : IObjectReference, ISerializable {
- MarshalByRefObject mbr;
- SerializationInfo si;
- Type type;
-
- public ObjRef ()
- {
- }
-
- public ObjRef (MarshalByRefObject mbr, Type type)
- {
- this.mbr = mbr;
- this.type = type;
- }
-
- [MonoTODO]
- protected ObjRef (SerializationInfo si, StreamingContext sc)
- {
- // FIXME: Implement.
- //
- // This encarnates the object from serialized data.
- }
-
- [MonoTODO]
- public virtual void GetObjectData (SerializationInfo si, StreamingContext sc)
- {
- // FIXME:
- }
-
- [MonoTODO]
- public virtual object GetRealObject (StreamingContext sc)
- {
- // FIXME:
-
- return null;
- }
-
- [MonoTODO]
- public bool IsFromThisAppDomain ()
- {
- // FIXME:
-
- return true;
- }
-
- [MonoTODO]
- public bool IsFromThisProcess ()
- {
- // FIXME:
-
- return true;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs b/mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs
deleted file mode 100644
index 56adef753d3..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/ObjectHandle.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Runtime.Remoting.ObjectHandle.cs
-//
-// Author:
-// Dietmar Maurer (dietmr@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Remoting {
-
- public class ObjectHandle : MarshalByRefObject, IObjectReference {
-
- [MonoTODO]
- public ObjectHandle (object o)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override object InitializeLifetimeService ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object Unwrap ()
- {
- throw new NotImplementedException ();
- }
-
- public object GetRealObject (StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs b/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
deleted file mode 100644
index 25b1cc874a0..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Runtime.Remoting.RemotingServices.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Reflection;
-using System.Runtime.Remoting.Messaging;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.Remoting
-{
- public sealed class RemotingServices {
-
- private RemotingServices () {}
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static object InternalExecute (MonoMethod method, Object obj,
- Object[] parameters, out object [] out_args);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static bool IsTransparentProxy (object proxy);
-
- public static IMethodReturnMessage ExecuteMessage (
- MarshalByRefObject target, IMethodCallMessage reqMsg)
- {
- ReturnMessage result;
-
- MonoMethod method = (MonoMethod)reqMsg.MethodBase;
-
- try {
- object [] out_args;
- object rval = InternalExecute (method, target, reqMsg.Args, out out_args);
- result = new ReturnMessage (rval, out_args, out_args.Length,
- reqMsg.LogicalCallContext, reqMsg);
-
- } catch (Exception e) {
- result = new ReturnMessage (e, reqMsg);
- }
-
- return result;
- }
-
-
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs b/mcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs
deleted file mode 100755
index 1a1919e2a9d..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/SoapMethodOption.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// SoapMethodOption.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:41:01 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- public enum SoapMethodOption {
-
- /// <summary>
- /// </summary>
- SoapAction = 0,
-
- /// <summary>
- /// </summary>
- MethodURI = 1,
-
- /// <summary>
- /// </summary>
- ResponseName = 2,
-
- /// <summary>
- /// </summary>
- ReturnElement = 3,
- } // SoapMethodOption
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Remoting/SoapOption.cs b/mcs/class/corlib/System.Runtime.Remoting/SoapOption.cs
deleted file mode 100755
index e334e53c239..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/SoapOption.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// SoapOption.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:41:11 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum SoapOption {
-
- /// <summary>
- /// </summary>
- AlwaysIncludeTypes = 1,
-
- /// <summary>
- /// </summary>
- XsdString = 2,
- } // SoapOption
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs b/mcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs
deleted file mode 100755
index 24898ead85e..00000000000
--- a/mcs/class/corlib/System.Runtime.Remoting/WellKnownObjectMode.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// WellKnownObjectMode.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:40:51 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Remoting {
-
-
- /// <summary>
- /// </summary>
- public enum WellKnownObjectMode {
-
- /// <summary>
- /// </summary>
- Singleton = 1,
-
- /// <summary>
- /// </summary>
- SingleCall = 2,
- } // WellKnownObjectMode
-
-} // System.Runtime.Remoting
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs
deleted file mode 100755
index c73656e838a..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// BinaryArrayTypeEnum.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:42:50 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters.Binary {
-
-
- /// <summary>
- /// </summary>
- public enum BinaryArrayTypeEnum {
-
- /// <summary>
- /// </summary>
- Single = 0,
-
- /// <summary>
- /// </summary>
- Jagged = 1,
-
- /// <summary>
- /// </summary>
- Rectangular = 2,
-
- /// <summary>
- /// </summary>
- SingleOffset = 3,
-
- /// <summary>
- /// </summary>
- JaggedOffset = 4,
-
- /// <summary>
- /// </summary>
- RectangularOffset = 5,
- } // BinaryArrayTypeEnum
-
-} // System.Runtime.Serialization.Formatters.Binary
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog b/mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog
deleted file mode 100644
index 97f1def7827..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-2002-01-21 David Dawkins <david@dawkins.st>
-
- * IFieldInfo.cs : New file
- * ISoapMessage.cs : New file
-
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs
deleted file mode 100755
index 944f8a68d2f..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// FormatterAssemblyStyle.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:43: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
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum FormatterAssemblyStyle {
-
- /// <summary>
- /// </summary>
- Simple = 0,
-
- /// <summary>
- /// </summary>
- Full = 1,
- } // FormatterAssemblyStyle
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs
deleted file mode 100755
index 2bba90aaafa..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// FormatterTopObjectStyle.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:42:59 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum FormatterTopObjectStyle {
-
- /// <summary>
- /// </summary>
- Object = 0,
-
- /// <summary>
- /// </summary>
- SoapMessage = 1,
- } // FormatterTopObjectStyle
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs
deleted file mode 100755
index c719b3eea56..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// FormatterTypeStyle.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:43:09 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum FormatterTypeStyle {
-
- /// <summary>
- /// </summary>
- TypesWhenNeeded = 0,
-
- /// <summary>
- /// </summary>
- TypesAlways = 1,
-
- /// <summary>
- /// </summary>
- XsdString = 2,
- } // FormatterTypeStyle
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs
deleted file mode 100644
index 1aba9e2cd14..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/IFieldInfo.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.Runtime.Serialization.Formatters.IFieldInfo
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-namespace System.Runtime.Serialization.Formatters {
-
- /// <summary>
- /// Interface for querying field information on serialized objects.</summary>
- public interface IFieldInfo {
-
- /// <summary>
- /// Get or set the field names for serialized objects.</summary>
- string[] FieldNames {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the field types for serialized objects.</summary>
- Type[] FieldTypes {
- get;
- set;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs
deleted file mode 100644
index f43d55a6a73..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/ISoapMessage.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Runtime.Serialization.Formatters.ISoapMessage
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-using System.Runtime.Remoting.Messaging;
-
-namespace System.Runtime.Serialization.Formatters {
-
- /// <summary>
- /// Interface for making SOAP method calls</summary>
- public interface ISoapMessage {
-
- /// <summary>
- /// Get or set the headers ("out-of-band" data) for the method call</summary>
- Header[] Headers {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method name</summary>
- string MethodName {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method parameter names</summary
- string[] ParamNames {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method parameter types</summary
- Type[] ParamTypes {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the method parameter values</summary
- object[] ParamValues {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the XML namespace for the location of the called object</summary
- string XmlNameSpace {
- get;
- set;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs
deleted file mode 100755
index 5c8f704520e..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// InternalArrayTypeE.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:43:29 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalArrayTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Single = 1,
-
- /// <summary>
- /// </summary>
- Jagged = 2,
-
- /// <summary>
- /// </summary>
- Rectangular = 3,
-
- /// <summary>
- /// </summary>
- Base64 = 4,
- } // InternalArrayTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs
deleted file mode 100755
index 2112390e67d..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalElementTypeE.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// InternalElementTypeE.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:43:49 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalElementTypeE {
-
- /// <summary>
- /// </summary>
- ObjectBegin = 0,
-
- /// <summary>
- /// </summary>
- ObjectEnd = 1,
-
- /// <summary>
- /// </summary>
- Member = 2,
- } // InternalElementTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs
deleted file mode 100755
index 4854703471e..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// InternalMemberTypeE.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:44:09 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalMemberTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Header = 1,
-
- /// <summary>
- /// </summary>
- Field = 2,
-
- /// <summary>
- /// </summary>
- Item = 3,
- } // InternalMemberTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs
deleted file mode 100755
index 3459d9e43b5..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalMemberValueE.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// InternalMemberValueE.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:44:18 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalMemberValueE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- InlineValue = 1,
-
- /// <summary>
- /// </summary>
- Nested = 2,
-
- /// <summary>
- /// </summary>
- Reference = 3,
-
- /// <summary>
- /// </summary>
- Null = 4,
- } // InternalMemberValueE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs
deleted file mode 100755
index 6074981b751..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// InternalNameSpaceE.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:44:28 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalNameSpaceE {
-
- /// <summary>
- /// </summary>
- None = 0,
-
- /// <summary>
- /// </summary>
- Soap = 1,
-
- /// <summary>
- /// </summary>
- XdrPrimitive = 2,
-
- /// <summary>
- /// </summary>
- XdrString = 3,
-
- /// <summary>
- /// </summary>
- UrtSystem = 4,
-
- /// <summary>
- /// </summary>
- UrtUser = 5,
-
- /// <summary>
- /// </summary>
- UserNameSpace = 6,
-
- /// <summary>
- /// </summary>
- MemberName = 7,
-
- /// <summary>
- /// </summary>
- Interop = 8,
-
- /// <summary>
- /// </summary>
- CallElement = 9,
- } // InternalNameSpaceE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs
deleted file mode 100755
index 9229202af82..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// InternalObjectPositionE.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:44:38 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalObjectPositionE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Top = 1,
-
- /// <summary>
- /// </summary>
- Child = 2,
-
- /// <summary>
- /// </summary>
- Headers = 3,
- } // InternalObjectPositionE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs
deleted file mode 100755
index 986b6bd4bc1..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// InternalObjectTypeE.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:44:48 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalObjectTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Object = 1,
-
- /// <summary>
- /// </summary>
- Array = 2,
- } // InternalObjectTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs
deleted file mode 100755
index 87627fcc2bb..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseStateE.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// InternalParseStateE.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:44:58 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalParseStateE {
-
- /// <summary>
- /// </summary>
- Initial = 0,
-
- /// <summary>
- /// </summary>
- Object = 1,
-
- /// <summary>
- /// </summary>
- Member = 2,
-
- /// <summary>
- /// </summary>
- MemberChild = 3,
- } // InternalParseStateE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs
deleted file mode 100755
index 9747bffcbe8..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalParseTypeE.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-// InternalParseTypeE.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:45:08 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalParseTypeE {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- SerializedStreamHeader = 1,
-
- /// <summary>
- /// </summary>
- Object = 2,
-
- /// <summary>
- /// </summary>
- Member = 3,
-
- /// <summary>
- /// </summary>
- ObjectEnd = 4,
-
- /// <summary>
- /// </summary>
- MemberEnd = 5,
-
- /// <summary>
- /// </summary>
- Headers = 6,
-
- /// <summary>
- /// </summary>
- HeadersEnd = 7,
-
- /// <summary>
- /// </summary>
- SerializedStreamHeaderEnd = 8,
-
- /// <summary>
- /// </summary>
- Envelope = 9,
-
- /// <summary>
- /// </summary>
- EnvelopeEnd = 10,
-
- /// <summary>
- /// </summary>
- Body = 11,
-
- /// <summary>
- /// </summary>
- BodyEnd = 12,
- } // InternalParseTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs
deleted file mode 100755
index 09adef22214..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-// InternalPrimitiveTypeE.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:43:39 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalPrimitiveTypeE {
-
- /// <summary>
- /// </summary>
- Invalid = 0,
-
- /// <summary>
- /// </summary>
- Boolean = 1,
-
- /// <summary>
- /// </summary>
- Byte = 2,
-
- /// <summary>
- /// </summary>
- Char = 3,
-
- /// <summary>
- /// </summary>
- Currency = 4,
-
- /// <summary>
- /// </summary>
- Decimal = 5,
-
- /// <summary>
- /// </summary>
- Double = 6,
-
- /// <summary>
- /// </summary>
- Int16 = 7,
-
- /// <summary>
- /// </summary>
- Int32 = 8,
-
- /// <summary>
- /// </summary>
- Int64 = 9,
-
- /// <summary>
- /// </summary>
- SByte = 10,
-
- /// <summary>
- /// </summary>
- Single = 11,
-
- /// <summary>
- /// </summary>
- TimeSpan = 12,
-
- /// <summary>
- /// </summary>
- DateTime = 13,
-
- /// <summary>
- /// </summary>
- UInt16 = 14,
-
- /// <summary>
- /// </summary>
- UInt32 = 15,
-
- /// <summary>
- /// </summary>
- UInt64 = 16,
- } // InternalPrimitiveTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs
deleted file mode 100755
index 51f70341f93..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// InternalSerializerTypeE.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:43:59 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization.Formatters {
-
-
- /// <summary>
- /// </summary>
- public enum InternalSerializerTypeE {
-
- /// <summary>
- /// </summary>
- Soap = 1,
-
- /// <summary>
- /// </summary>
- Binary = 2,
- } // InternalSerializerTypeE
-
-} // System.Runtime.Serialization.Formatters
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ChangeLog b/mcs/class/corlib/System.Runtime.Serialization/ChangeLog
deleted file mode 100644
index a95b753362a..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ChangeLog
+++ /dev/null
@@ -1,98 +0,0 @@
-2002-06-10 Duncan Mak <duncan@ximian.com>
-
- * Formatter.cs: Addd to CVS.
-
- * FormatterConverter.cs: Added to CVS.
-
- * SerializationInfo.cs (AddValue): Removed extra CLSCompliant attribute.
-
-2002-04-12 Duncan Mak <duncan@ximian.com>
-
- * SerializationException.cs: Added missing constructor for serialization.
-
-2002-03-12 Duncan Mak <duncan@ximian.com>
-
- * IFormatter.cs: Fix the return type of the Serialize method.
-
-2002/03/07 Nick Drochak <ndrochak@gol.com>
-
- * StreamingContextStates.cs: Add missing value (CrossAppDomain) and
- adjust All value accordingly.
-
-2002-03-01 Duncan Mak <duncan@ximian.com>
-
- * ObjectIDGenerator.cs: Implemented.
-
-2002-02-19 Duncan Mak <duncan@ximian.com>
-
- * SurrogateSelector.cs: Implemented.
-
- * SerializationInfoEnumerator.cs: oh, and simplified the Current
- property too.
-
- * SerializationInfo.cs: Forgot to finish up GetEnumerator ().
-
-2002-02-18 Duncan Mak <duncan@ximian.com>
-
- * SerializationInfo.cs: Converted Type.GetType calls to the faster
- typeof operator.
-
-2002-02-16 Duncan Mak <duncan@ximian.com>
-
- * SurrogateSelector.cs: Stubbed out. Gonna be working on this
- tomorrow.
-
-2002-02-15 Duncan Mak <duncan@ximian.com>
-
- * SerializationEntry.cs: Added internal constructor for writing
- bits in SerializationInfoEnumerator.
- * SerializationInfo.cs: Completed.
- * SerializationInfoEnumerator.cs: Implemented. Piggybacking on
- Hashtable's GetEnumerator method.
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * SerializationInfoEnumerator.cs: New file (stub)
-
-2002-02-12 Duncan Mak <duncan@ximian.com>
-
- * SerializationBinder.cs: Implemented.
- * SerializationEntry.cs: Implemented.
- * SerializationInfo.cs: Fixed the get portion of the AssemblyName
- property. Implemented the FullTypename property.
-
-2002-01-06 David Dawkins <david@dawkins.st>
-
- * IFormatter.cs : New file
- * ISerializationSurrogate.cs : New file
- * ISurrogateSelector.cs : New file
-
-2002-05-01 Ravi Pratap <ravi@ximian.com>
-
- * SerializationInfo.cs : Insert MonoTODO attribute.
-
-2001-08-24 Nick Drochak <ndrochak@gol.com>
-
- * IDeserializationCallback.cs: New File
-
-Wed Nov 14 17:03:30 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * IFormatterConverter.cs, SerializationInfo.cs: CLSCompliant updates.
-
-Fri Nov 2 18:40:12 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * SerializationException.cs: implemented.
-
-2001-08-24 Nick Drochak <ndrochak@gol.com>
-
- * SerializationInfo.cs: Added all the public methods so that the compile would not break
-
-2001-07-20 Miguel de Icaza <miguel@ximian.com>
-
- * SerializationInfo.cs: New file.
-
- * IFormatterConverter.cs: New file.
-
- * ISerializable.cs: New file.
-
-
diff --git a/mcs/class/corlib/System.Runtime.Serialization/Formatter.cs b/mcs/class/corlib/System.Runtime.Serialization/Formatter.cs
deleted file mode 100755
index 7da54b1c2ec..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/Formatter.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// System.Runtime.Serialization.Formatter.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Runtime.Serialization;
-
-[CLSCompliant (false)]
-[Serializable]
-public abstract class Formatter : IFormatter
-{
- protected Formatter ()
- {
- }
-
- protected ObjectIDGenerator m_idGenerator;
- protected Queue m_objectQueue;
-
- public abstract SerializationBinder Binder {
- get;
- set;
- }
-
- public abstract StreamingContext Context {
- get;
- set;
- }
-
- public abstract ISurrogateSelector SurrogateSelector {
- get;
- set;
- }
-
- public abstract object Deserialize (Stream serializationStream);
-
- [MonoTODO]
- protected virtual object GetNext (out long objID)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected virtual long Schedule (object obj)
- {
- throw new NotImplementedException ();
- }
-
- public abstract void Serialize (Stream serializationStream, object graph);
-
- protected abstract void WriteArray (object obj, string name, Type memberType);
-
- protected abstract void WriteBoolean (bool val, string name);
-
- protected abstract void WriteByte (byte val, string name);
-
- protected abstract void WriteChar (char val, string name);
-
- protected abstract void WriteDateTime (DateTime val, string name);
-
- protected abstract void WriteDecimal (Decimal val, string name);
-
- protected abstract void WriteDouble (double val, string name);
-
- protected abstract void WriteInt16 (short val, string name);
-
- protected abstract void WriteInt32 (int val, string name);
-
- protected abstract void WriteInt64 (long val, string name);
-
- [MonoTODO]
- protected virtual void WriteMember (string memberName, object data)
- {
- }
-
- protected abstract void WriteObjectRef (object obj, string name, Type memberType);
-
-
- protected abstract void WriteSByte (sbyte val, string name);
-
-
- protected abstract void WriteSingle (float val, string name);
-
- protected abstract void WriteTimeSpan (TimeSpan val, string name);
-
- protected abstract void WriteUInt16 (ushort val, string name);
-
- protected abstract void WriteUInt32 (uint val, string name);
-
- protected abstract void WriteInt64 (ulong val, string name);
-
- protected abstract void WriteValueType (object obj, string name, Type memberType);
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/FormatterConverter.cs b/mcs/class/corlib/System.Runtime.Serialization/FormatterConverter.cs
deleted file mode 100755
index d478ac77d15..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/FormatterConverter.cs
+++ /dev/null
@@ -1,153 +0,0 @@
-//
-// System.Runtime.Serialization.Formatter.cs
-//
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Serialization {
- public class FormatterConverter : IFormatterConverter {
-
- public FormatterConverter ()
- {
- }
-
- public object Convert (object value, Type type)
- {
- return System.Convert.ChangeType (value, type);
- }
-
- public object Convert (object value, TypeCode typeCode)
- {
- return System.Convert.ChangeType (value, typeCode);
- }
-
- public bool ToBoolean (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToBoolean (value);
- }
-
- public byte ToByte (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToByte (value);
- }
-
- public char ToChar (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToChar (value);
- }
-
- public DateTime ToDateTime (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToDateTime (value);
- }
-
- public decimal ToDecimal (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToDecimal (value);
- }
-
- public double ToDouble (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToDouble (value);
- }
-
- public short ToInt16 (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToInt16 (value);
- }
-
- public int ToInt32 (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToInt32 (value);
- }
-
- public long ToInt64 (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToInt64 (value);
- }
-
- public float ToSingle (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToSingle (value);
- }
-
- public string ToString (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToString (value);
- }
-
- [CLSCompliant (false)]
- public sbyte ToSByte (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToSByte (value);
- }
-
- [CLSCompliant (false)]
- public ushort ToUInt16 (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToUInt16 (value);
- }
-
- [CLSCompliant (false)]
- public uint ToUInt32 (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToUInt32 (value);
- }
-
- [CLSCompliant (false)]
- public ulong ToUInt64 (object value)
- {
- if (value == null)
- throw new ArgumentNullException ("value is null.");
-
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs b/mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs
deleted file mode 100644
index a889303f51b..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IDeserializationCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Runtime.Serialization.IDeserializationCallback.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Runtime.Serialization {
- public interface IDeserializationCallback {
- void OnDeserialization(object sender);
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs b/mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs
deleted file mode 100644
index 214f720093e..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IFormatter.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Runtime.Serialization.IFormatter
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-using System.IO;
-
-namespace System.Runtime.Serialization {
-
- /// <summary>
- /// Formatting for serialized objects</summary>
- public interface IFormatter {
-
- //
- // Properties
- //
-
- /// <summary>
- /// Get or set the SerializationBinder used
- /// for looking up types during deserialization</summary>
- SerializationBinder Binder
- {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the StreamingContext used for serialization
- /// and deserialization</summary>
- StreamingContext Context
- {
- get;
- set;
- }
-
- /// <summary>
- /// Get or set the SurrogateSelector used by the current
- /// formatter</summary>
- ISurrogateSelector SurrogateSelector
- {
- get;
- set;
- }
-
- /// <summary>
- /// Deserialize data from the specified stream, rebuilding
- /// the object hierarchy</summary>
- object Deserialize(
- Stream serializationStream
- );
-
- /// <summary>
- /// Serialize the specified object to the specified stream.
- /// Object may be the root of a graph of objects to be
- /// serialized</summary>
- void Serialize(
- Stream serializationStream,
- object graph
- );
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs b/mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs
deleted file mode 100644
index b902ec339a5..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IFormatterConverter.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Runtime.Serialization.IFormatterConverter.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.Runtime.Serialization {
- [CLSCompliant(false)]
- public interface IFormatterConverter {
- object Convert (object o, Type t);
- object Convert (object o, TypeCode tc);
-
- bool ToBoolean (object o);
- byte ToByte (object o);
- char ToChar (object o);
- DateTime ToDateTime (object o);
- Decimal ToDecimal (object o);
- double ToDouble (object o);
- Int16 ToInt16 (object o);
- Int32 ToInt32 (object o);
- Int64 ToInt64 (object o);
- sbyte ToSByte (object o);
- float ToSingle (object o);
- string ToString (object o);
- UInt16 ToUInt16 (object o);
- UInt32 ToUInt32 (object o);
- UInt64 ToUInt64 (object o);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs b/mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs
deleted file mode 100644
index 59f5a0200b4..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/IObjectReference.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.Runtime.Serialization.IObjectReference.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Serialization {
-
- public interface IObjectReference {
- object GetRealObject (StreamingContext context);
- }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs b/mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs
deleted file mode 100644
index 64773514eba..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ISerializable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Runtime.Serialization.ISerializable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-namespace System.Runtime.Serialization {
- public interface ISerializable {
- void GetObjectData (SerializationInfo info, StreamingContext context);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs b/mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs
deleted file mode 100644
index 21b4ecbb7dd..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ISerializationSurrogate.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Runtime.Serialization.ISerializationSurrogate
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-namespace System.Runtime.Serialization {
-
- /// <summary>
- /// Interface for serialization surrogates</summary>
- public interface ISerializationSurrogate {
-
- /// <summary>
- /// Get the SerializationInfo necessary to serialize
- /// the specified object </summary>
- /// <param name="obj">Object to be serialized</param>
- /// <param name="info">SerializationInfo to be populated</param>
- /// <param name="context">Destination for serialization</param>
- void GetObjectData(
- object obj,
- SerializationInfo info,
- StreamingContext context
- );
-
- /// <summary>
- /// Populate an object using the specified SerializationInfo </summary>
- /// <param name="obj">Object to be populated</param>
- /// <param name="info">Data used for populating object</param>
- /// <param name="context">Source for deserialization of object</param>
- /// <param name="selector>Starting point for searching for compatible surrogates</param>
- /// <returns>The deserialized object</returns>
- object SetObjectData(
- object obj,
- SerializationInfo info,
- StreamingContext context,
- ISurrogateSelector selector
- );
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs b/mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs
deleted file mode 100644
index 442b01789ed..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ISurrogateSelector.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.Serialization.ISurrogateSelector
-//
-// Author:
-// David Dawkins (david@dawkins.st)
-//
-// (C) David Dawkins
-//
-
-namespace System.Runtime.Serialization {
-
- /// <summary>
- /// Creation of serialization surrogate selectors</summary>
- public interface ISurrogateSelector {
-
- /// <summary>
- /// Insert specified selector into available surrogates</summary>
- void ChainSelector( ISurrogateSelector selector );
-
- /// <summary>
- /// Return next surrogate in the surrogate chain</summary>
- ISurrogateSelector GetNextSelector();
-
- /// <summary>
- /// Fetch the surrogate according the specified type, starting
- /// the search from the surrogate selector for the specified
- /// StreamingContext</summary>
- /// <param name="type">Type of the object to be serialized</param>
- /// <param name="context">Context for the serialization/deserialization</para,>
- /// <param name="selector">Upon return, contains a reference to the selector where the returned surrogate was found</param>
- /// <returns>The surrogate for the specified type and context</returns>
- ISerializationSurrogate GetSurrogate(
- Type type,
- StreamingContext context,
- out ISurrogateSelector selector
- );
-
- }
-
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs b/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs
deleted file mode 100755
index c2821892a26..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/ObjectIDGenerator.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Runtime.Serialization.ObjectIDGenerator.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Serialization
-{
- [Serializable]
- public class ObjectIDGenerator
- {
- // Private field
- Hashtable table;
- long current; // this is the current ID, starts at 1
-
- // constructor
- public ObjectIDGenerator ()
- : base ()
- {
- table = new Hashtable ();
- current = 1;
- }
-
- // Methods
- public virtual long GetId (object obj, out bool firstTime)
- {
- if (obj == null)
- throw new ArgumentNullException ("The obj parameter is null.");
-
- if (table.ContainsKey (obj)) {
- firstTime = false;
- return (long) table [obj];
-
- } else {
- firstTime = true;
- table.Add (obj, current);
- return current ++;
- }
- }
-
- public virtual long HasId (object obj, out bool firstTime)
- {
- if (obj == null)
- throw new ArgumentNullException ("The obj parameter is null.");
-
- if (table.ContainsKey (obj)) {
- firstTime = false;
- return (long) table [obj];
-
- } else {
- firstTime = true;
- return 0L; // 0 is the null ID
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs
deleted file mode 100644
index 30eef514b4d..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationBinder.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationBinder.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-namespace System.Runtime.Serialization
-{
- [Serializable]
- public abstract class SerializationBinder
- {
- // Constructor
- protected SerializationBinder ()
- : base ()
- {
- }
-
- public abstract Type BindToType (string assemblyName, string typeName);
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs
deleted file mode 100644
index 8221509892f..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationEntry.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationEntry.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Serialization
-{
- public struct SerializationEntry
- {
- string name;
- Type objectType;
- object value;
-
- // Properties
- public string Name
- {
- get { return name; }
- }
-
- public Type ObjectType
- {
- get { return objectType; }
- }
-
- public object Value
- {
- get { return value; }
- }
-
- internal SerializationEntry (string name, Type type, object value)
- {
- this.name = name;
- this.objectType = type;
- this.value = value;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationException.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationException.cs
deleted file mode 100755
index e5d9196745b..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.Runtime.Serialization/SerializationException.cd
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Serialization {
-
- [Serializable]
- public class SerializationException : SystemException {
- // Constructors
- public SerializationException ()
- : base ("An error occurred during (de)serialization")
- {
- }
-
- public SerializationException (string message)
- : base (message)
- {
- }
-
- public SerializationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected SerializationException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs
deleted file mode 100644
index 2e9bac75cf5..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfo.cs
+++ /dev/null
@@ -1,261 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationInfo.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-using System;
-using System.Collections;
-
-namespace System.Runtime.Serialization
-{
- public sealed class SerializationInfo
- {
- Hashtable serialized = new Hashtable ();
- string assemblyName; // the assembly being serialized
- string fullTypeName; // the type being serialized.
-
- [CLSCompliant (false)] IFormatterConverter converter;
-
- // Constructor
- [CLSCompliant (false)]
- public SerializationInfo (Type type, IFormatterConverter converter)
- {
- if (type == null && converter == null)
- throw new ArgumentNullException ("Null arguments.");
-
- this.converter = converter;
- assemblyName = type.Assembly.FullName;
- fullTypeName = type.FullName;
- }
-
- // Properties
- public string AssemblyName
- {
- get { return assemblyName; }
-
- set {
- if (value == null)
- throw new ArgumentNullException ("Argument is null.");
- assemblyName = value;
- }
- }
-
- public string FullTypeName
- {
- get { return fullTypeName; }
-
- set {
- if ( value == null)
- throw new ArgumentNullException ("Argument is null.");
- fullTypeName = value;
- }
- }
-
- public int MemberCount
- {
- get { return serialized.Count; }
- }
-
- // Methods
- public void AddValue (string name, object value, Type type)
- {
- if (serialized.ContainsKey (name))
- throw new SerializationException ("Value has been serialized already.");
-
- SerializationEntry values = new SerializationEntry (name, type, value);
- serialized.Add (name, values);
- }
-
- public object GetValue (string name, Type type)
- {
- if (name == null)
- throw new ArgumentNullException ("name is null.");
- if (!serialized.ContainsKey (name))
- throw new SerializationException ("No element named " + name + " could be found.");
-
- SerializationEntry values = (SerializationEntry) serialized [name];
-
- if (values.ObjectType != type)
- throw new InvalidCastException ("Invalid Type casting.");
-
- return values.Value;
- }
-
- public void SetType (Type type)
- {
- if (type == null)
- throw new ArgumentNullException ("type is null.");
-
- fullTypeName = type.FullName;
- assemblyName = type.Assembly.FullName;
- }
-
- public SerializationInfoEnumerator GetEnumerator ()
- {
- return new SerializationInfoEnumerator (serialized);
- }
-
- public void AddValue (string name, short value)
- {
- AddValue (name, value, typeof (System.Int16));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, UInt16 value)
- {
- AddValue (name, value, typeof (System.UInt16));
- }
-
- public void AddValue (string name, int value)
- {
- AddValue (name, value, typeof (System.Int32));
- }
-
- public void AddValue (string name, byte value)
- {
- AddValue (name, value, typeof (System.Byte));
- }
-
- public void AddValue (string name, bool value)
- {
- AddValue (name, value, typeof (System.Boolean));
- }
-
- public void AddValue (string name, char value)
- {
- AddValue (name, value, typeof (System.Char));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, SByte value)
- {
- AddValue (name, value, typeof (System.SByte));
- }
-
- public void AddValue (string name, double value)
- {
- AddValue (name, value, typeof (System.Double));
- }
-
- public void AddValue (string name, Decimal value)
- {
- AddValue (name, value, typeof (System.Decimal));
- }
-
- public void AddValue (string name, DateTime value)
- {
- AddValue (name, value, typeof (System.DateTime));
- }
-
- public void AddValue (string name, float value)
- {
- AddValue (name, value, typeof (System.Single));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, UInt32 value)
- {
- AddValue (name, value, typeof (System.UInt32));
- }
-
- public void AddValue (string name, long value)
- {
- AddValue (name, value, typeof (System.Int64));
- }
-
- [CLSCompliant(false)]
- public void AddValue (string name, UInt64 value)
- {
- AddValue (name, value, typeof (System.UInt64));
- }
-
- public void AddValue (string name, object value)
- {
- AddValue (name, value, value.GetType ());
- }
-
- public bool GetBoolean (string name)
- {
- return (bool) GetValue (name, typeof (System.Boolean));
- }
-
- public byte GetByte (string name)
- {
- return (byte) GetValue (name, typeof (System.Byte));
- }
-
- public char GetChar (string name)
- {
- return (char) GetValue (name, typeof (System.Char));
- }
-
- public DateTime GetDateTime (string name)
- {
- return (DateTime) GetValue (name, typeof (System.DateTime));
- }
-
- public Decimal GetDecimal (string name)
- {
- return (Decimal) GetValue (name, typeof (System.Decimal));
- }
-
- public double GetDouble (string name)
- {
- return (double) GetValue (name, typeof (System.Double));
- }
-
- public short GetInt16 (string name)
- {
- return (short) GetValue (name, typeof (System.Int16));
- }
-
- public int GetInt32 (string name)
- {
- return (int) GetValue (name, typeof (System.Int32));
- }
-
- public long GetInt64 (string name)
- {
- return (long) GetValue (name, typeof (System.Int64));
- }
-
- [CLSCompliant(false)]
- public SByte GetSByte (string name)
- {
- return (sbyte) GetValue (name, typeof (System.SByte));
- }
-
- public float GetSingle (string name)
- {
- return (float) GetValue (name, typeof (System.Single));
- }
-
- public string GetString (string name)
- {
- return (string) GetValue (name, typeof (System.String));
- }
-
- [CLSCompliant(false)]
- public UInt16 GetUInt16 (string name)
- {
- return (UInt16) GetValue (name, typeof (System.UInt16));
- }
-
- [CLSCompliant(false)]
- public UInt32 GetUInt32 (string name)
- {
- return (UInt32) GetValue (name, typeof (System.UInt32));
- }
- [CLSCompliant(false)]
- public UInt64 GetUInt64 (string name)
- {
- return (UInt64) GetValue (name, typeof (System.UInt64));
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs b/mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs
deleted file mode 100644
index a4d50af1d70..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SerializationInfoEnumerator.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// System.Runtime.Serialization.SerializationInfoEnumerator.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace System.Runtime.Serialization
-{
- public sealed class SerializationInfoEnumerator : IEnumerator
- {
- IDictionaryEnumerator ide;
-
- // Constructor
- internal SerializationInfoEnumerator (Hashtable collection)
- {
- ide = collection.GetEnumerator ();
- }
-
- // Properties
- public SerializationEntry Current
- {
- get { return (SerializationEntry) ide.Value; }
- }
-
- object IEnumerator.Current
- {
- get { return ide.Value; }
- }
-
- public string Name
- {
- get { return this.Current.Name; }
- }
-
- public Type ObjectType
- {
- get { return this.Current.ObjectType; }
- }
-
- public object Value
- {
- get { return this.Current.Value; }
- }
-
- // Methods
- public bool MoveNext ()
- {
- return ide.MoveNext ();
- }
-
- public void Reset ()
- {
- ide.Reset ();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs b/mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs
deleted file mode 100644
index c1b5a530fde..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/StreamingContext.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// System.Runtime.Serialization.StreamingContext.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Runtime.Serialization {
-
- [Serializable]
- public struct StreamingContext {
- StreamingContextStates state;
- object additional;
-
- public StreamingContext (StreamingContextStates state)
- {
- this.state = state;
- additional = null;
- }
-
- public StreamingContext (StreamingContextStates state, object additional)
- {
- this.state = state;
- this.additional = additional;
- }
-
- public object Context {
- get {
- return additional;
- }
- }
-
- public StreamingContextStates State {
- get {
- return state;
- }
- }
-
- override public bool Equals (Object o)
- {
- StreamingContext other;
-
- if (!(o is StreamingContext))
- return false;
-
- other = (StreamingContext) o;
-
- return (other.state == this.state) && (other.additional == this.additional);
- }
-
- override public int GetHashCode ()
- {
- return (int) state;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs b/mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs
deleted file mode 100644
index d5a3858d310..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/StreamingContextStates.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-// StreamingContextStates.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:45:18 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Runtime.Serialization {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum StreamingContextStates {
-
- /// <summary>
- /// </summary>
- CrossProcess = 1,
-
- /// <summary>
- /// </summary>
- CrossMachine = 2,
-
- /// <summary>
- /// </summary>
- File = 4,
-
- /// <summary>
- /// </summary>
- Persistence = 8,
-
- /// <summary>
- /// </summary>
- Remoting = 16,
-
- /// <summary>
- /// </summary>
- Other = 32,
-
- /// <summary>
- /// </summary>
- Clone = 64,
-
- CrossAppDomain = 128,
-
- /// <summary>
- /// </summary>
- All = 255,
- } // StreamingContextStates
-
-} // System.Runtime.Serialization
diff --git a/mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs b/mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs
deleted file mode 100644
index ec01dfe4d20..00000000000
--- a/mcs/class/corlib/System.Runtime.Serialization/SurrogateSelector.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Runtime.Serialization.SurrogateSelector.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-
-namespace System.Runtime.Serialization
-{
- public class SurrogateSelector : ISurrogateSelector
- {
- // Fields
- Hashtable Surrogates = new Hashtable ();
- string currentKey = null; // current key of Surrogates
-
- internal struct Bundle
- {
- public ISerializationSurrogate surrogate;
- public ArrayList selectors;
-
- public Bundle (ISerializationSurrogate surrogate)
- {
- this.surrogate = surrogate;
- selectors = new ArrayList ();
- }
- }
-
- // Constructor
- public SurrogateSelector()
- : base ()
- {
- }
-
- // Methods
- public virtual void AddSurrogate (Type type,
- StreamingContext context, ISerializationSurrogate surrogate)
- {
- if (type == null || surrogate == null)
- throw new ArgumentNullException ("Null reference.");
-
- currentKey = type.FullName + "#" + context.ToString ();
-
- if (Surrogates.ContainsKey (currentKey))
- throw new ArgumentException ("A surrogate for " + type.FullName + " already exists.");
-
- Bundle values = new Bundle (surrogate);
-
- Surrogates.Add (currentKey, values);
- }
-
- public virtual void ChainSelector (ISurrogateSelector selector)
- {
- if (selector == null)
- throw new ArgumentNullException ("Selector is null.");
-
- Bundle current = (Bundle) Surrogates [currentKey];
- current.selectors.Add (selector);
- }
-
- public virtual ISurrogateSelector GetNextSelector ()
- {
- Bundle current = (Bundle) Surrogates [currentKey];
- return (ISurrogateSelector) current.selectors [current.selectors.Count];
- }
-
- public virtual ISerializationSurrogate GetSurrogate (Type type,
- StreamingContext context, out ISurrogateSelector selector)
- {
- if (type == null)
- throw new ArgumentNullException ("type is null.");
-
- string key = type.FullName + "#" + context.ToString ();
- Bundle current = (Bundle) Surrogates [key];
- selector = (ISurrogateSelector) current.selectors [current.selectors.Count - 1];
-
- return (ISerializationSurrogate) current.surrogate;
- }
-
- public virtual void RemoveSurrogate (Type type, StreamingContext context)
- {
- if (type == null)
- throw new ArgumentNullException ("type is null.");
-
- string key = type.FullName + "#" + context.ToString ();
- Surrogates.Remove (key);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs
deleted file mode 100755
index e0f57333bab..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricAlgorithm.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricAlgorithm Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all cryptographic asymmetric algorithms.
- /// Available algorithms include:
- /// RSA, DSA
- /// </summary>
- public abstract class AsymmetricAlgorithm {
- protected int KeySizeValue; // The size of the secret key used by the symmetric algorithm in bits.
- protected KeySizes[] LegalKeySizesValue; // Specifies the key sizes that are supported by the symmetric algorithm.
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected AsymmetricAlgorithm () {
- throw new CryptographicException();
- }
-
- /// <summary>
- /// Gets the key exchange algorithm
- /// </summary>
- public abstract string KeyExchangeAlgorithm {get;}
-
- /// <summary>
- /// Gets or sets the actual key size
- /// </summary>
- public virtual int KeySize {
- get {
- return this.KeySizeValue;
- }
- set {
- if (!IsLegalKeySize(this.LegalKeySizesValue, value))
- throw new CryptographicException("key size not supported by algorithm");
-
- this.KeySizeValue = value;
- }
- }
-
- /// <summary>
- /// Gets all legal key sizes
- /// </summary>
- public virtual KeySizes[] LegalKeySizes {
- get {
- return this.LegalKeySizesValue;
- }
- }
-
- /// <summary>
- /// Gets the signature algorithm
- /// </summary>
- public abstract string SignatureAlgorithm {get;}
-
- /// <summary>
- /// Reconstructs the AsymmetricAlgorithm Object from an XML-string
- /// </summary>
- public abstract void FromXmlString(string xmlString);
-
- /// <summary>
- /// Returns an XML string representation the current AsymmetricAlgorithm object
- /// </summary>
- public abstract string ToXmlString(bool includePrivateParameters);
-
- private bool IsLegalKeySize(KeySizes[] LegalKeys, int Size) {
- foreach (KeySizes LegalKeySize in LegalKeys) {
- for (int i=LegalKeySize.MinSize; i<=LegalKeySize.MaxSize; i+=LegalKeySize.SkipSize) {
- if (i == Size)
- return true;
- }
- }
- return false;
- }
-
- /// <summary>
- /// Checks wether the given keyLength is valid for the current algorithm
- /// </summary>
- /// <param name="bitLength">the given keyLength</param>
- public bool ValidKeySize(int bitLength) {
- return IsLegalKeySize(LegalKeySizesValue, bitLength);
- }
-
- /// <summary>
- /// Creates the default implementation of the default asymmetric algorithm (RSA).
- /// </summary>
- public static AsymmetricAlgorithm Create () {
- return RSA.Create();;
- }
-
- /// <summary>
- /// Creates a specific implementation of the given asymmetric algorithm.
- /// </summary>
- /// <param name="algName">the given algorithm</param>
- [MonoTODO]
- public static AsymmetricAlgorithm Create (string algName) {
- // TODO: use reflection to create a new instance of the given algorithm
- return null;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs
deleted file mode 100755
index 78ee4ce669c..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricKeyExchangeDeformatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric key exchange deformatter.
- /// Available derived classes:
- /// RSAOAEPKeyExchangeDeformatter, RSAPKCS1KeyExchangeDeformatter
- /// </summary>
- public abstract class AsymmetricKeyExchangeDeformatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricKeyExchangeDeformatter() {
- }
-
- /// <summary>
- /// XML string containing the parameters of an asymmetric key exchange operation
- /// </summary>
- public abstract string Parameters {get; set;}
-
- /// <summary>
- /// get secret data
- /// </summary>
- public abstract byte[] DecryptKeyExchange(byte[] rgb);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- } // AsymmetricKeyExchangeDeformatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs
deleted file mode 100755
index e1b5c0f16de..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricKeyExchangeFormatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric key exchange formatter.
- /// Available derived classes:
- /// RSAOAEPKeyExchangeFormatter, RSAPKCS1KeyExchangeFormatter
- /// </summary>
- public abstract class AsymmetricKeyExchangeFormatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricKeyExchangeFormatter() {
- }
-
- /// <summary>
- /// XML string containing the parameters of an asymmetric key exchange operation
- /// </summary>
- public abstract string Parameters {get;}
-
- /// <summary>
- /// create encrypted key exchange data
- /// </summary>
- public abstract byte[] CreateKeyExchange(byte[] data);
-
- /// <summary>
- /// create encrypted key exchange data
- /// </summary>
- public abstract byte[] CreateKeyExchange(byte[] data, Type symAlgType);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- } // AsymmetricKeyExchangeFormatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs
deleted file mode 100755
index 55abce71c5c..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureDeformatter.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricSignatureDeformatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric signature deformatter.
- /// Available derived classes:
- /// DSASignatureDeformatter, RSAPKCS1SignatureDeformatter
- /// </summary>
- public abstract class AsymmetricSignatureDeformatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricSignatureDeformatter() {
- }
-
- /// <summary>
- /// Sets the hash algorithm used for verifying a signature
- /// </summary>
- public abstract void SetHashAlgorithm(string strName);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- /// <summary>
- /// Verifies the given Signature
- /// </summary>
- public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);
-
- /// <summary>
- /// Verifies the given Signature with the given hash algorithm
- /// </summary>
- public virtual bool VerifySignature(HashAlgorithm hash, byte[] rgbSignature) {
- return VerifySignature(hash.Hash, rgbSignature);
- }
-
- } // AsymmetricSignatureDeformatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs b/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs
deleted file mode 100755
index 541b8a4faa3..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/AsymmetricSignatureFormatter.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography AsymmetricSignatureFormatter Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all asymmetric signature formatter.
- /// Available derived classes:
- /// DSASignatureFormatter, RSAPKCS1SignatureFormatter
- /// </summary>
- public abstract class AsymmetricSignatureFormatter {
-
- /// <summary>
- /// constructor, no idea why it is here (abstract class) :-)
- /// just for compatibility with MS
- /// </summary>
- public AsymmetricSignatureFormatter() {
- }
-
- /// <summary>
- /// Sets the hash algorithm used for verifying a signature
- /// </summary>
- public abstract void SetHashAlgorithm(string strName);
-
- /// <summary>
- /// set the private key
- /// </summary>
- public abstract void SetKey(AsymmetricAlgorithm key);
-
- /// <summary>
- /// Create a signature from the given data
- /// </summary>
- public abstract byte[] CreateSignature(byte[] rgbHash);
-
- /// <summary>
- /// Create a signature from data with the specified hash algorithm
- /// </summary>
- public virtual byte[] CreateSignature(HashAlgorithm hash) {
- return CreateSignature(hash.Hash);
- }
-
- } // AsymmetricSignatureFormatter
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/ChangeLog b/mcs/class/corlib/System.Security.Cryptography/ChangeLog
deleted file mode 100644
index 30bc3daf59c..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/ChangeLog
+++ /dev/null
@@ -1,96 +0,0 @@
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * FromBase64Transform.cs (TransformFinalBlock): The return value of
- `DoTransform' tells us the number of bytes actually written - if it's
- smaller than `res', copy it to a smaller array.
-
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * RNGCryptoServiceProvider.cs: New file.
- * RandomNumberGenerator.cs: Constructor is now marked public.
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * DSACryptoServiceProvider.cs, SHA384Managed.cs, SHA512Managed.cs,
- Rijndael.cs, RSA.cs, RSAParameters.cs : New files (stubs)
-
-Mon Feb 11 13:26:17 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * X509Certificates: dummy class.
-
-2002-01-10 Duco Fijma <duco@lorentz.xs4all.nl>
- * Create (trivial) implementation of RandomNumberGenerator
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * CryptoAPITransform.cs, DESCryptoProvider.cs : MonoTODO attribute
- decoration.
-
- * HashAlgorithm.cs, MD5.cs, SHA1.cs, SHA256.cs, SHA384.cs : Ditto.
-
- * SHA512.cs, SymmetricAlgorithm.cs, ToBase64Transform.cs,
- AsymmetricAlgorithm.cs, CryptoStream.cs, DSA.cs, DSASignatureDeformatter.cs,
- DSASignatureFormatter.cs, SignatureDescription.cs : Ditto.
-
-Wed Nov 14 17:04:30 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * MD5CryptoServiceProvider.cs, SHA1CryptoServiceProvider.cs,
- SHA256Managed.cs: CLSCompliant updates.
-
-2001-10-11 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * CryptoAPITransform.cs: Initial version
- * CryptoStream.cs: Initial version
- * CspParameter.cs: Initial version
- * CspProviderFlags.cs: Initial version
- * DSA.cs: Initial version
- * DSAParameters.cs: Initial version
- * DSASignatureDeformatter.cs: Initial version
- * DSASignatureFormatter.cs: Initial version
- * DeriveBytes.cs: Initial version
-
-2001-10-06 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * AsymmetricAlgorithm.cs: Inital version
- * AsymmetricKeyExchangeDeformatter.cs: Initial version
- * AsymmetricKeyExchangeFormatter.cs: Initial version
- * AsymmetricSignatureDeformatter.cs: Initial version
- * AsymmetricSignatureFormatter.cs: Initial version
- * PaddingMode.cs: Added PaddingMode.None
- * SignatureDescription.cs: Initial version
- * CryptographicException.cs: Initial version
- * CryptographicUnknownOperationException.cs: Initial version
- * SymmetricAlgorithm.cs: Implemented CreateDecryptor, CreateEncryptor
- and Create() methods.
-
-2001-08-20 Sergey Chaban <serge@wildwestsoftware.com>
-
- * DES.cs encryption core is about 30% faster than previous version.
- * DESCryptoServiceProvider.cs added PKCS-5 padding.
-
-2001-08-09 Sergey Chaban <serge@wildwestsoftware.com>
-
- * ToBase64Transform.cs: Base64Table now supports both encoding
- and decoding tables. As a result Table was renamed to EncodeTable
- and DecodeTable was added.
- * FromBase64Transform.cs: Initial check-in.
- * DES.cs: Initial check-in.
- * DESCryptoServiceProvider.cs: Initial check-in.
-
-2001-08-01 Matthew S. Ford <Matthew.S.Ford@Rose-Hulman.Edu>
-
- * CipherMode.cs: Initial version.
- * CryptoStreamMode.cs: Initial version.
- * HashAlgorithm.cs: Initial version.
- * ICryptoTransform.cs: Initial version.
- * KeySizes.cs: Initial version.
- * MD5.cs: Initial version.
- * MD5CryptoServiceProvider.cs: Initial version.
- * PaddingMode.cs: Initial version.
- * SHA1.cs: Initial version.
- * SHA1CryptoServiceProvider.cs: Initial version.
- * SHA256.cs: Initial version.
- * SHA256Managed.cs: Initial version.
- * SHA384.cs: Initial version.
- * SHA512.cs: Initial version.
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/CipherMode.cs b/mcs/class/corlib/System.Security.Cryptography/CipherMode.cs
deleted file mode 100644
index b64fe175111..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CipherMode.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Security.Cryptography CipherMode enumeration
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Block cipher modes of operation.
- /// </summary>
- public enum CipherMode {
- CBC = 0x1, // Cipher Block Chaining
- ECB, // Electronic Codebook
- OFB, // Output Feedback
- CFB, // Cipher Feedback
- CTS, // Cipher Text Stealing
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs
deleted file mode 100755
index ea16089740e..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoAPITransform.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// System.Security.Cryptography CryptoAPITransform.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.IO;
-
-namespace System.Security.Cryptography
-{
-
- public sealed class CryptoAPITransform : ICryptoTransform
- {
- public CryptoAPITransform()
- {
- }
-
- /// <summary>
- /// Indicates if the Transform object can transform multiple blocks
- /// </summary>
- [MonoTODO]
- public bool CanTransformMultipleBlocks
- {
- get
- {
- // FIXME: should not be always true
- return true;
- }
- }
-
- [MonoTODO]
- public int InputBlockSize
- {
- get {
- // TODO: implement
- return 0;
- }
- }
-
- [MonoTODO]
- public IntPtr KeyHandle
- {
- get {
- // TODO: implement
- return IntPtr.Zero;
- }
- }
-
- [MonoTODO]
- public int OutputBlockSize
- {
- get {
- // TODO: implement
- return 0;
- }
- }
-
- [MonoTODO]
- public int TransformBlock(byte[] inputBuffer, int inputOffset,
- int inputCount, byte[] outputBuffer, int outputOffset)
- {
- // TODO: implement
- return 0;
- }
-
- [MonoTODO]
- public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
- {
- // TODO: implement
- return null;
- }
-
- } // CryptoAPITransform
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
deleted file mode 100755
index 6dad1ca628d..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// System.Security.Cryptography CryptoStream.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.IO;
-
-namespace System.Security.Cryptography
-{
-
- public class CryptoStream : Stream
- {
- private CryptoStreamMode _mode;
-
- public CryptoStream(Stream stream, ICryptoTransform transform, CryptoStreamMode mode)
- {
- _mode = mode;
- }
-
- public override bool CanRead
- {
- get {
- switch (_mode) {
- case CryptoStreamMode.Read:
- return true;
-
- case CryptoStreamMode.Write:
- return false;
-
- default:
- return false;
- }
- }
- }
-
- public override bool CanSeek
- {
- get {
- return false;
- }
- }
-
- public override bool CanWrite
- {
- get {
- switch (_mode) {
- case CryptoStreamMode.Read:
- return false;
-
- case CryptoStreamMode.Write:
- return true;
-
- default:
- return false;
- }
- }
- }
-
- public override long Length
- {
- get {
- throw new NotSupportedException("Length property not supported by CryptoStream");
- }
- }
-
- public override long Position
- {
- get {
- throw new NotSupportedException("Position property not supported by CryptoStream");
- }
- set {
- throw new NotSupportedException("Position property not supported by CryptoStream");
- }
- }
-
- [MonoTODO]
- public override int Read(byte[] buffer, int offset, int count)
- {
- // TODO: implement
- return 0;
- }
-
- [MonoTODO]
- public override void Write(byte[] buffer, int offset, int count)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override void Flush()
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public void FlushFinalBlock()
- {
- if (_mode != CryptoStreamMode.Write)
- throw new NotSupportedException("cannot flush a non-writeable CryptoStream");
-
- // TODO: implement
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotSupportedException("cannot seek a CryptoStream");
- }
-
- public override void SetLength(long value)
- {
- // LAMESPEC: should throw NotSupportedException like Seek??
- return;
- }
-
- } // CryptoStream
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs
deleted file mode 100644
index 6e08107b7d2..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoStreamMode.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.Cryptography CryptoStreamMode enumeration
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by authors.
-//
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// FIXME (the comment): Whether the crypto-stream is in read mode or write mode?
- /// </summary>
- public enum CryptoStreamMode {
- Read,
- Write
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptographicException.cs b/mcs/class/corlib/System.Security.Cryptography/CryptographicException.cs
deleted file mode 100755
index 676a1b8ff02..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptographicException.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Cryptography.CryptographicException.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [Serializable]
- public class CryptographicException : SystemException {
- // Constructors
- public CryptographicException ()
- : base ("Error occured during a cryptographic operation.")
- {
- }
-
- public CryptographicException (int hr)
- {
- HResult = hr;
- }
-
- public CryptographicException (string message)
- : base (message)
- {
- }
-
- public CryptographicException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public CryptographicException (string format, string insert)
- : base (String.Format(format, insert))
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs b/mcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs
deleted file mode 100755
index 7beeea48132..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Security.Cryptography.CryptographicUnexpectedOperationException.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [Serializable]
- public class CryptographicUnexpectedOperationException : CryptographicException {
- // Constructors
- public CryptographicUnexpectedOperationException ()
- : base ("Error occured during a cryptographic operation.")
- {
- }
-
- public CryptographicUnexpectedOperationException (string message)
- : base (message)
- {
- }
-
- public CryptographicUnexpectedOperationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public CryptographicUnexpectedOperationException (string format, string insert)
- : base (String.Format(format, insert))
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs b/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
deleted file mode 100755
index 7c84eaff8af..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CspParameters.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// System.Security.Cryptography CspParameters.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// Contains information passed to Crypto Service Providers (CSP)
- /// </summary>
- public sealed class CspParameters
- {
- private CspProviderFlags _Flags;
-
- public CspParameters() : this(1) {}
-
- public CspParameters(int dwTypeIn) : this(dwTypeIn, null) {}
-
- public CspParameters(int dwTypeIn, string strProviderNameIn) : this(dwTypeIn, null, null) {}
-
- public CspParameters(int dwTypeIn, string strProviderNameIn, string strContainerNameIn)
- {
- ProviderType = dwTypeIn;
- ProviderName = strProviderNameIn;
- KeyContainerName = strContainerNameIn;
-
- // not defined in specs, only tested from M$ impl
- KeyNumber = -1;
- }
-
- public string KeyContainerName;
-
- public int KeyNumber;
-
- public string ProviderName;
-
- public int ProviderType;
-
- public CspProviderFlags Flags
- {
- get {
- return _Flags;
- }
-
- set {
- _Flags = value;
- }
- }
-
- } // CspParameters
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs b/mcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs
deleted file mode 100755
index ca882069417..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/CspProviderFlags.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.Cryptography CspProviderFlags enumeration
-//
-// Authors:
-// Thomas Neidhart <tome@sbox.tugraz.at>
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// CSP Provider Flags
- /// </summary>
- [Flags]
- public enum CspProviderFlags {
- UseMachineKeyStore = 1,
- UseDefaultKeyContainer,
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/DES.cs b/mcs/class/corlib/System.Security.Cryptography/DES.cs
deleted file mode 100644
index f2d344f21c2..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DES.cs
+++ /dev/null
@@ -1,587 +0,0 @@
-//
-// System.Security.Cryptography.DES
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Security.Cryptography;
-
-// References: FIPS PUB 46-3
-
-namespace System.Security.Cryptography {
-
- internal sealed class DESCore {
-
- internal static readonly int KEY_BIT_SIZE = 64;
- internal static readonly int KEY_BYTE_SIZE = KEY_BIT_SIZE / 8;
- internal static readonly int BLOCK_BIT_SIZE = 64;
- internal static readonly int BLOCK_BYTE_SIZE = BLOCK_BIT_SIZE / 8;
-
- private byte [] keySchedule;
- private byte [] byteBuff;
- private uint [] dwordBuff;
-
- internal delegate void DESCall (byte [] block, byte [] output);
-
-
- // Ek(Ek(m)) = m
- internal static ulong [] weakKeys = {
- 0x0101010101010101, /* 0000000 0000000 */
- 0xFEFEFEFEFEFEFEFE, /* FFFFFFF FFFFFFF */
- 0x1F1F1F1FE0E0E0E0, /* 0000000 FFFFFFF */
- 0xE0E0E0E01F1F1F1F /* FFFFFFF 0000000 */
- };
-
- // Ek1(Ek2(m)) = m
- internal static ulong [] semiweakKeys = {
- 0x01FE01FE01FE01FE, 0xFE01FE01FE01FE01,
- 0x1FE01FE00EF10EF1, 0xE01FE01FF10EF10E,
- 0x01E001E001F101F1, 0xE001E001F101F101,
- 0x1FFE1FFE0EFE0EFE, 0xFE1FFE1FFE0EFE0E,
- 0x011F011F010E010E, 0x1F011F010E010E01,
- 0xE0FEE0FEF1FEF1FE, 0xFEE0FEE0FEF1FEF1
- };
-
-
-
- // S-boxes from FIPS 46-3, Appendix 1, page 17
- private static byte [] sBoxes = {
- /* S1 */
- 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
- 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
- 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
- 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13,
-
- /* S2 */
- 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
- 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
- 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
- 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9,
-
- /* S3 */
- 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
- 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
- 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
- 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12,
-
- /* S4 */
- 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
- 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
- 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
- 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14,
-
- /* S5 */
- 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
- 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
- 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
- 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3,
-
- /* S6 */
- 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
- 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
- 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
- 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13,
-
- /* S7 */
- 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1,
- 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6,
- 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2,
- 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12,
-
- /* S8 */
- 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7,
- 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2,
- 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8,
- 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11
- };
-
-
- // P table from page 15, also in Appendix 1, page 18
- private static byte [] pTab = {
- 16-1, 7-1, 20-1, 21-1,
- 29-1, 12-1, 28-1, 17-1,
- 1-1, 15-1, 23-1, 26-1,
- 5-1, 18-1, 31-1, 10-1,
- 2-1, 8-1, 24-1, 14-1,
- 32-1, 27-1, 3-1, 9-1,
- 19-1, 13-1, 30-1, 6-1,
- 22-1, 11-1, 4-1, 25-1
- };
-
-
- // Permuted choice 1 table, PC-1, page 19
- // Translated to zero-based format.
- private static byte [] PC1 = {
- 57-1, 49-1, 41-1, 33-1, 25-1, 17-1, 9-1,
- 1-1, 58-1, 50-1, 42-1, 34-1, 26-1, 18-1,
- 10-1, 2-1, 59-1, 51-1, 43-1, 35-1, 27-1,
- 19-1, 11-1, 3-1, 60-1, 52-1, 44-1, 36-1,
-
- 63-1, 55-1, 47-1, 39-1, 31-1, 23-1, 15-1,
- 7-1, 62-1, 54-1, 46-1, 38-1, 30-1, 22-1,
- 14-1, 6-1, 61-1, 53-1, 45-1, 37-1, 29-1,
- 21-1, 13-1, 5-1, 28-1, 20-1, 12-1, 4-1
- };
-
-
- private static byte [] leftRot = {
- 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
- };
-
- private static byte [] leftRotTotal;
-
-
-
- // Permuted choice 2 table, PC-2, page 21
- // Translated to zero-based format.
- private static byte [] PC2 = {
- 14-1, 17-1, 11-1, 24-1, 1-1, 5-1,
- 3-1, 28-1, 15-1, 6-1, 21-1, 10-1,
- 23-1, 19-1, 12-1, 4-1, 26-1, 8-1,
- 16-1, 7-1, 27-1, 20-1, 13-1, 2-1,
- 41-1, 52-1, 31-1, 37-1, 47-1, 55-1,
- 30-1, 40-1, 51-1, 45-1, 33-1, 48-1,
- 44-1, 49-1, 39-1, 56-1, 34-1, 53-1,
- 46-1, 42-1, 50-1, 36-1, 29-1, 32-1
- };
-
-
- // Initial permutation IP, page 10.
- // Transposed to 0-based format.
- private static byte [] ipBits = {
- 58-1, 50-1, 42-1, 34-1, 26-1, 18-1, 10-1, 2-1,
- 60-1, 52-1, 44-1, 36-1, 28-1, 20-1, 12-1, 4-1,
- 62-1, 54-1, 46-1, 38-1, 30-1, 22-1, 14-1, 6-1,
- 64-1, 56-1, 48-1, 40-1, 32-1, 24-1, 16-1, 8-1,
- 57-1, 49-1, 41-1, 33-1, 25-1, 17-1, 9-1, 1-1,
- 59-1, 51-1, 43-1, 35-1, 27-1, 19-1, 11-1, 3-1,
- 61-1, 53-1, 45-1, 37-1, 29-1, 21-1, 13-1, 5-1,
- 63-1, 55-1, 47-1, 39-1, 31-1, 23-1, 15-1, 7-1
- };
-
-
- // Final permutation FP = IP^(-1), page 10.
- // Transposed to 0-based format.
- private static byte [] fpBits = {
- 40-1, 8-1, 48-1, 16-1, 56-1, 24-1, 64-1, 32-1,
- 39-1, 7-1, 47-1, 15-1, 55-1, 23-1, 63-1, 31-1,
- 38-1, 6-1, 46-1, 14-1, 54-1, 22-1, 62-1, 30-1,
- 37-1, 5-1, 45-1, 13-1, 53-1, 21-1, 61-1, 29-1,
- 36-1, 4-1, 44-1, 12-1, 52-1, 20-1, 60-1, 28-1,
- 35-1, 3-1, 43-1, 11-1, 51-1, 19-1, 59-1, 27-1,
- 34-1, 2-1, 42-1, 10-1, 50-1, 18-1, 58-1, 26-1,
- 33-1, 1-1, 41-1, 9-1, 49-1, 17-1, 57-1, 25-1
- };
-
-
-
- private static uint [] spBoxes;
- private static int [] ipTab;
- private static int [] fpTab;
-
-
- static DESCore ()
- {
- spBoxes = new uint [64 * 8];
-
- int [] pBox = new int [32];
-
- for (int p = 0; p < 32; p++) {
- for (int i = 0; i < 32; i++) {
- if (p == pTab [i]) {
- pBox [p] = i;
- break;
- }
- }
- }
-
-
- for (int s = 0; s < 8; s++) { // for each S-box
- int sOff = s << 6;
-
- for (int i = 0; i < 64; i++) { // inputs
- uint sp=0;
-
- int indx = (i & 0x20) | ((i & 1) << 4) | ((i >> 1) & 0xF);
-
- for (int j = 0; j < 4; j++) { // for each bit in the output
- if ((sBoxes [sOff + indx] & (8 >> j)) != 0) {
- sp |= (uint) (1 << (31 - pBox [(s << 2) + j]));
- }
- }
-
- spBoxes [sOff + i] = sp;
- }
- }
-
-
- leftRotTotal = new byte [leftRot.Length];
-
-
- for (int i = 0; i < leftRot.Length; i++) {
- int r = 0;
- for (int j = 0; j <= i; r += leftRot [j++]);
- leftRotTotal [i] = (byte) r;
- }
-
-
- InitPermutationTable (ipBits, out ipTab);
- InitPermutationTable (fpBits, out fpTab);
-
- } // class constructor
-
-
-
- // Default constructor.
- internal DESCore ()
- {
- keySchedule = new byte [KEY_BYTE_SIZE * 16];
- byteBuff = new byte [BLOCK_BYTE_SIZE];
- dwordBuff = new uint [BLOCK_BYTE_SIZE / 4];
- }
-
-
-
-
- private static void InitPermutationTable (byte [] pBits, out int [] permTab)
- {
- permTab = new int [8*2 * 8*2 * (64/32)];
-
- for (int i = 0; i < 16; i++) {
- for (int j = 0; j < 16; j++) {
- int offs = (i << 5) + (j << 1);
- for (int n = 0; n < 64; n++) {
- int bitNum = (int) pBits [n];
- if ((bitNum >> 2 == i) &&
- 0 != (j & (8 >> (bitNum & 3)))) {
- permTab [offs + (n >> (3+2))] |= (int) ((0x80808080 & (0xFF << (n & (3 << 3)))) >> (n & 7));
- }
- }
- }
- }
- }
-
-
-
- internal static ulong PackKey (byte [] key)
- {
- ulong res = 0;
- for (int i = 0, sh = 8*KEY_BYTE_SIZE; (sh = sh - 8) >= 0; i++) {
- res |= (ulong) key [i] << sh;
- }
- return res;
- }
-
-
-
- internal static byte [] UnpackKey (ulong key)
- {
- byte [] res = new byte [KEY_BYTE_SIZE];
- for (int i = 0, sh = 8*KEY_BYTE_SIZE; (sh = sh - 8) >= 0; i++) {
- res [i] = (byte) (key >> sh);
- }
- return res;
- }
-
-
-
- internal static bool IsValidKeySize (byte [] key)
- {
- return (key.Length == KEY_BYTE_SIZE);
- }
-
-
-
- private uint CipherFunct(uint r, int n)
- {
- uint res = 0;
- byte [] subkey = keySchedule;
- int i = n << 3;
-
- uint rt = (r >> 1) | (r << 31); // ROR32(r)
- res |= spBoxes [0*64 + (((rt >> 26) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [1*64 + (((rt >> 22) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [2*64 + (((rt >> 18) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [3*64 + (((rt >> 14) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [4*64 + (((rt >> 10) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [5*64 + (((rt >> 6) ^ subkey [i++]) & 0x3F)];
- res |= spBoxes [6*64 + (((rt >> 2) ^ subkey [i++]) & 0x3F)];
- rt = (r << 1) | (r >> 31); // ROL32(r)
- res |= spBoxes [7*64 + ((rt ^ subkey [i]) & 0x3F)];
-
- return res;
- }
-
-
- private static void Permutation (byte [] input, byte [] _output, int [] permTab, bool preSwap)
- {
-
- if (preSwap) BSwap (input);
-
- byte [] output = _output;
-
- int offs1 = (((int)(input [0]) >> 4)) << 1;
- int offs2 = (1 << 5) + ((((int)input [0]) & 0xF) << 1);
-
- int d1 = permTab [offs1++] | permTab [offs2++];
- int d2 = permTab [offs1] | permTab [offs2];
-
-
- int max = BLOCK_BYTE_SIZE << 1;
- for (int i = 2, indx = 1; i < max; i += 2, indx++) {
- int ii = (int) input [indx];
- offs1 = (i << 5) + ((ii >> 4) << 1);
- offs2 = ((i + 1) << 5) + ((ii & 0xF) << 1);
-
- d1 |= permTab [offs1++] | permTab [offs2++];
- d2 |= permTab [offs1] | permTab [offs2];
- }
-
- if (preSwap) {
- output [0] = (byte) (d1);
- output [1] = (byte) (d1 >> 8);
- output [2] = (byte) (d1 >> 16);
- output [3] = (byte) (d1 >> 24);
- output [4] = (byte) (d2);
- output [5] = (byte) (d2 >> 8);
- output [6] = (byte) (d2 >> 16);
- output [7] = (byte) (d2 >> 24);
- } else {
- output [0] = (byte) (d1 >> 24);
- output [1] = (byte) (d1 >> 16);
- output [2] = (byte) (d1 >> 8);
- output [3] = (byte) (d1);
- output [4] = (byte) (d2 >> 24);
- output [5] = (byte) (d2 >> 16);
- output [6] = (byte) (d2 >> 8);
- output [7] = (byte) (d2);
- }
- }
-
-
-
-
- private static void BSwap (byte [] byteBuff)
- {
- byte t;
-
- t = byteBuff [0];
- byteBuff [0] = byteBuff [3];
- byteBuff [3] = t;
-
- t = byteBuff [1];
- byteBuff [1] = byteBuff [2];
- byteBuff [2] = t;
-
- t = byteBuff [4];
- byteBuff [4] = byteBuff [7];
- byteBuff [7] = t;
-
- t = byteBuff [5];
- byteBuff [5] = byteBuff [6];
- byteBuff [6] = t;
- }
-
-
-
- internal void SetKey (byte [] key)
- {
- // NOTE: see Fig. 3, Key schedule calculation, at page 20.
-
- Array.Clear (keySchedule, 0, keySchedule.Length);
-
- int keyBitSize = PC1.Length;
-
- byte [] keyPC1 = new byte [keyBitSize]; // PC1-permuted key
- byte [] keyRot = new byte [keyBitSize]; // PC1 & rotated
-
- int indx = 0;
-
- foreach (byte bitPos in PC1) {
- keyPC1 [indx++] = (byte)((key [(int)bitPos >> 3] >> (7 ^ (bitPos & 7))) & 1);
- }
-
-
-
-
- int j;
- for (int i = 0; i < KEY_BYTE_SIZE*2; i++) {
- int b = keyBitSize >> 1;
-
- for (j = 0; j < b; j++) {
- int s = j + (int) leftRotTotal [i];
- keyRot [j] = keyPC1 [s < b ? s : s - b];
- }
-
- for (j = b; j < keyBitSize; j++) {
- int s = j + (int) leftRotTotal [i];
- keyRot [j] = keyPC1 [s < keyBitSize ? s : s - b];
- }
-
- int keyOffs = i * KEY_BYTE_SIZE;
-
- j = 0;
- foreach (byte bitPos in PC2) {
- if (keyRot [(int)bitPos] != 0) {
- keySchedule [keyOffs + (j/6)] |= (byte) (0x80 >> ((j % 6) + 2));
- }
- j++;
- }
- }
-
- }
-
-
-
- internal void Encrypt (byte [] block, byte [] output)
- {
- byte [] dest = (output == null ? block : output);
-
- byte [] byteBuff = this.byteBuff;
- uint [] dwordBuff = this.dwordBuff;
-
- Permutation (block, byteBuff, ipTab, false);
-
- Buffer.BlockCopy (byteBuff, 0, dwordBuff, 0, BLOCK_BYTE_SIZE);
-
- uint d0 = dwordBuff[0];
- uint d1 = dwordBuff[1];
-
- // 16 rounds
- d0 ^= CipherFunct (d1, 0);
- d1 ^= CipherFunct (d0, 1);
- d0 ^= CipherFunct (d1, 2);
- d1 ^= CipherFunct (d0, 3);
- d0 ^= CipherFunct (d1, 4);
- d1 ^= CipherFunct (d0, 5);
- d0 ^= CipherFunct (d1, 6);
- d1 ^= CipherFunct (d0, 7);
- d0 ^= CipherFunct (d1, 8);
- d1 ^= CipherFunct (d0, 9);
- d0 ^= CipherFunct (d1, 10);
- d1 ^= CipherFunct (d0, 11);
- d0 ^= CipherFunct (d1, 12);
- d1 ^= CipherFunct (d0, 13);
- d0 ^= CipherFunct (d1, 14);
- d1 ^= CipherFunct (d0, 15);
-
-
- dwordBuff [0] = d1;
- dwordBuff [1] = d0;
- Buffer.BlockCopy (dwordBuff, 0, byteBuff, 0, BLOCK_BYTE_SIZE);
-
- Permutation (byteBuff, dest, fpTab, true);
- }
-
-
- internal void Decrypt (byte [] block, byte [] output)
- {
- byte [] dest = (output == null ? block : output);
-
- byte [] byteBuff = this.byteBuff;
- uint [] dwordBuff = this.dwordBuff;
-
- Permutation (block, byteBuff, ipTab, false);
-
- Buffer.BlockCopy (byteBuff, 0, dwordBuff, 0, BLOCK_BYTE_SIZE);
-
- uint d1 = dwordBuff [0];
- uint d0 = dwordBuff [1];
-
- // 16 rounds in reverse order
- d1 ^= CipherFunct (d0, 15);
- d0 ^= CipherFunct (d1, 14);
- d1 ^= CipherFunct (d0, 13);
- d0 ^= CipherFunct (d1, 12);
- d1 ^= CipherFunct (d0, 11);
- d0 ^= CipherFunct (d1, 10);
- d1 ^= CipherFunct (d0, 9);
- d0 ^= CipherFunct (d1, 8);
- d1 ^= CipherFunct (d0, 7);
- d0 ^= CipherFunct (d1, 6);
- d1 ^= CipherFunct (d0, 5);
- d0 ^= CipherFunct (d1, 4);
- d1 ^= CipherFunct (d0, 3);
- d0 ^= CipherFunct (d1, 2);
- d1 ^= CipherFunct (d0, 1);
- d0 ^= CipherFunct (d1, 0);
-
- dwordBuff [0] = d0;
- dwordBuff [1] = d1;
-
-
- Buffer.BlockCopy (dwordBuff, 0, byteBuff, 0, BLOCK_BYTE_SIZE);
-
- Permutation (byteBuff, dest, fpTab, true);
- }
-
-
- } // DESCore
-
-
-
-
- public abstract class DES : SymmetricAlgorithm {
- private byte [] key;
-
- public DES ()
- {
- }
-
- [MonoTODO]
- public static new DES Create()
- {
- // TODO: implement
- return null;
- }
-
- [MonoTODO]
- public static new DES Create(string name)
- {
- // TODO: implement
- return null;
- }
-
-
- public static bool IsWeakKey (byte [] rgbKey)
- {
- if (!DESCore.IsValidKeySize (rgbKey)) {
- throw new CryptographicException ();
- }
-
- ulong lk = DESCore.PackKey (rgbKey);
- foreach (ulong wk in DESCore.weakKeys) {
- if (lk == wk) return true;
- }
- return false;
- }
-
-
- public static bool IsSemiWeakKey (byte [] rgbKey)
- {
- if (!DESCore.IsValidKeySize (rgbKey)) {
- throw new CryptographicException ();
- }
-
- ulong lk = DESCore.PackKey (rgbKey);
- foreach (ulong swk in DESCore.semiweakKeys) {
- if (lk == swk) return true;
- }
- return false;
- }
-
- public override byte[] Key {
- get {
- return this.key;
- }
- set {
- this.key = new byte [DESCore.KEY_BYTE_SIZE];
- Array.Copy (value, 0, this.key, 0, DESCore.KEY_BYTE_SIZE);
- }
- }
-
- } // DES
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs
deleted file mode 100644
index e04c3d36227..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DESCryptoServiceProvider.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// System.Security.Cryptography.DESCryptoServiceProvider
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-
-
-using System;
-using System.Security.Cryptography;
-
-
-namespace System.Security.Cryptography {
-
-
- internal class DESTransformBase : ICryptoTransform {
-
- internal enum Mode : int {
- ENCRYPTOR = 0,
- DECRYPTOR = 1
- }
-
- protected delegate void Filter (byte [] workBuff);
-
- private DESCore core;
-
- private DESCore.DESCall cryptFn;
- private Filter preprocess;
- private Filter postprocess;
-
- private byte [] iv;
- private byte [] tmpBlock;
-
- protected DESTransformBase (Mode mode, byte [] key, byte [] iv)
- {
- core = new DESCore ();
-
- if (mode == Mode.ENCRYPTOR) {
- cryptFn = new DESCore.DESCall (core.Encrypt);
- preprocess = new Filter (this.EncPreprocess);
- postprocess = new Filter (this.EncPostprocess);
- } else {
- cryptFn = new DESCore.DESCall (core.Decrypt);
- preprocess = new Filter (this.DecPreprocess);
- postprocess = new Filter (this.DecPostprocess);
- }
-
- core.SetKey (key);
- this.iv = new byte [DESCore.BLOCK_BYTE_SIZE];
- Array.Copy (iv, 0, this.iv, 0, DESCore.BLOCK_BYTE_SIZE);
-
- tmpBlock = new byte [DESCore.BLOCK_BYTE_SIZE];
- }
-
-
- public virtual bool CanTransformMultipleBlocks {
- get {
- return true;
- }
- }
-
-
- public virtual int InputBlockSize {
- get {
- return DESCore.BLOCK_BYTE_SIZE;
- }
- }
-
- public virtual int OutputBlockSize {
- get {
- return DESCore.BLOCK_BYTE_SIZE;
- }
- }
-
- private void EncPreprocess (byte [] workBuff)
- {
- byte [] iv = this.iv;
- for (int i = 0; i < DESCore.BLOCK_BYTE_SIZE; i++) {
- workBuff [i] ^= iv [i];
- }
- }
-
- private void EncPostprocess (byte [] workBuff)
- {
- Array.Copy (workBuff, 0, iv, 0, DESCore.BLOCK_BYTE_SIZE);
- }
-
-
- private void DecPreprocess (byte [] workBuff)
- {
- Array.Copy (workBuff, 0, tmpBlock, 0, DESCore.BLOCK_BYTE_SIZE);
- }
-
- private void DecPostprocess (byte [] workBuff)
- {
- EncPreprocess (workBuff);
- Array.Copy (tmpBlock, 0, iv, 0, DESCore.BLOCK_BYTE_SIZE);
- }
-
-
-
- private void Transform (byte [] workBuff)
- {
- preprocess (workBuff);
- cryptFn (workBuff, null);
- postprocess (workBuff);
- }
-
-
- public virtual int TransformBlock (byte [] inputBuffer, int inputOffset, int inputCount, byte [] outputBuffer, int outputOffset)
- {
- if ((inputCount & (DESCore.BLOCK_BYTE_SIZE-1)) != 0)
- throw new CryptographicException ("Invalid input block size.");
-
- if (outputOffset + inputCount > outputBuffer.Length)
- throw new CryptographicException ("Insufficient output buffer size.");
-
- int step = InputBlockSize;
- int offs = inputOffset;
- int full = inputCount / step;
-
- byte [] workBuff = new byte [step];
-
- for (int i = 0; i < full; i++) {
- Array.Copy (inputBuffer, offs, workBuff, 0, step);
- Transform (workBuff);
- Array.Copy (workBuff, 0, outputBuffer, outputOffset, step);
- offs += step;
- outputOffset += step;
- }
-
- return (full * step);
- }
-
-
- [MonoTODO]
- public virtual byte [] TransformFinalBlock (byte [] inputBuffer, int inputOffset, int inputCount)
- {
- // TODO: add decryption support
-
- int num = (inputCount + DESCore.BLOCK_BYTE_SIZE) & (~(DESCore.BLOCK_BYTE_SIZE-1));
- byte [] res = new byte [num];
- int full = num - DESCore.BLOCK_BYTE_SIZE;
-
- TransformBlock (inputBuffer, inputOffset, full, res, 0);
-
- int rem = inputCount & (DESCore.BLOCK_BYTE_SIZE-1);
-
- // PKCS-5 padding
- for (int i = num; --i >= (num - rem);) {
- res [i] = (byte) rem;
- }
-
- Array.Copy (inputBuffer, inputOffset + full, res, full, rem);
-
- // the last padded block will be transformed in-place
- TransformBlock (res, full, DESCore.BLOCK_BYTE_SIZE, res, full);
-
- /*
- byte [] workBuff = new byte [DESCore.BLOCK_BYTE_SIZE];
- Array.Copy (res, full, workBuff, 0, DESCore.BLOCK_BYTE_SIZE);
- preprocess (workBuff);
- cryptFn (workBuff, null);
- Array.Copy (workBuff, 0, res, full, DESCore.BLOCK_BYTE_SIZE);
- */
-
- return res;
- }
-
-
- } // DESTransformBase
-
-
- internal sealed class DESEncryptor : DESTransformBase {
- internal DESEncryptor (byte [] key, byte [] iv)
- : base (DESTransformBase.Mode.ENCRYPTOR, key, iv)
- {
- }
- } // DESEncryptor
-
-
- internal sealed class DESDecryptor : DESTransformBase {
- internal DESDecryptor (byte [] key, byte [] iv)
- : base (DESTransformBase.Mode.DECRYPTOR, key, iv)
- {
- }
- } // DESDecryptor
-
-
- public sealed class DESCryptoServiceProvider {
- private byte [] iv;
- private byte [] key;
-
- public DESCryptoServiceProvider ()
- {
- }
-
-
- //
- // Factories
- //
-
- public ICryptoTransform CreateEncryptor()
- {
- return new DESEncryptor (key, iv);
- }
-
- public ICryptoTransform CreateDecryptor()
- {
- return new DESDecryptor (key, iv);
- }
-
-
-
- // FIXME: Ought to be in DES.cs
-
- [MonoTODO ("Ought to be in DES.cs")]
- public /*override*/ byte[] Key {
- get {
- return this.key;
- }
- set {
- this.key = new byte [DESCore.KEY_BYTE_SIZE];
- Array.Copy (value, 0, this.key, 0, DESCore.KEY_BYTE_SIZE);
- }
- }
-
- public byte[] IV {
- get {
- return this.iv;
- }
- set {
- this.iv = new byte [DESCore.KEY_BYTE_SIZE];
- Array.Copy (value, 0, this.iv, 0, DESCore.KEY_BYTE_SIZE);
- }
- }
-
-
-
-
-
- public override string ToString ()
- {
- return "mono::System.Security.Cryptography.DESCryptoServiceProvider";
- }
-
- } // DESCryptoServiceProvider
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSA.cs b/mcs/class/corlib/System.Security.Cryptography/DSA.cs
deleted file mode 100755
index 26f366888a0..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSA.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-//
-// System.Security.Cryptography DSA.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using System.Text;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// Abstract base class for all implementations of the DSA algorithm
- /// </summary>
- public abstract class DSA : AsymmetricAlgorithm
- {
- internal DSA () {}
-
- public static new DSA Create()
- {
- return new DSACryptoServiceProvider();
- }
-
- [MonoTODO]
- public static new DSA Create(string algName)
- {
- // TODO: implement
- return null;
- }
-
- public abstract byte[] CreateSignature(byte[] rgbHash);
-
- public abstract DSAParameters ExportParameters(bool includePrivateParameters);
-
- [MonoTODO]
- public override void FromXmlString(string xmlString)
- {
- if (xmlString == null)
- throw new ArgumentNullException();
-
- // TODO: implement
- }
-
- public abstract void ImportParameters(DSAParameters parameters);
-
- public override string ToXmlString(bool includePrivateParameters)
- {
- DSAParameters dsaParams = ExportParameters(includePrivateParameters);
-
- StringBuilder sb = new StringBuilder();
-
- sb.Append("<DSAKeyValue>");
-
- sb.Append("<P>");
- sb.Append(Convert.ToBase64String(dsaParams.P));
- sb.Append("</P>");
-
- sb.Append("<Q>");
- sb.Append(Convert.ToBase64String(dsaParams.Q));
- sb.Append("</Q>");
-
- sb.Append("<G>");
- sb.Append(Convert.ToBase64String(dsaParams.G));
- sb.Append("</G>");
-
- sb.Append("<Y>");
- sb.Append(Convert.ToBase64String(dsaParams.Y));
- sb.Append("</Y>");
-
- sb.Append("<J>");
- sb.Append(Convert.ToBase64String(dsaParams.J));
- sb.Append("</J>");
-
- sb.Append("<Seed>");
- sb.Append(Convert.ToBase64String(dsaParams.Seed));
- sb.Append("</Seed>");
-
- sb.Append("<PgenCounter>");
- string cnt = Convert.ToString(dsaParams.Counter);
- byte[] inArr = new ASCIIEncoding().GetBytes(cnt);
- sb.Append(Convert.ToBase64String(inArr));
- sb.Append("</PgenCounter>");
-
- if (dsaParams.X != null) {
- sb.Append("<X>");
- sb.Append(Convert.ToBase64String(dsaParams.X));
- sb.Append("</X>");
- }
-
- sb.Append("</DSAKeyValue>");
-
- return sb.ToString();
- }
-
- public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);
-
- } // DSA
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
deleted file mode 100644
index c7c7158fb67..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSACryptoServiceProvider.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// System.Security.Cryptography.DSACryptoServiceProvider.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-using System.IO;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public class DSACryptoServiceProvider : DSA {
- public DSACryptoServiceProvider () { }
- public DSACryptoServiceProvider (CspParameters parameters) { }
- public DSACryptoServiceProvider (int key_size) { }
- public DSACryptoServiceProvider (int key_size, CspParameters parameters) { }
-
- public override string KeyExchangeAlgorithm {
- get { return null; }
- }
-
- public override int KeySize {
- get { return 0; }
- }
-
- public override KeySizes[] LegalKeySizes {
- get { return null; }
- }
-
- public override string SignatureAlgorithm {
- get { return null; }
- }
-
- public bool PersistKeyInCsp {
- get { return false; }
- set { }
- }
-
- public override byte[] CreateSignature (byte[] rgb) {
- return null;
- }
-
- public override bool VerifySignature(byte[] hash, byte[] sig) {
- return false;
- }
-
- public byte[] SignData (byte[] data) {
- return SignData (data, 0, data.Length);
- }
-
- public byte[] SignData (byte[] data, int offset, int count) {
- return null;
- }
-
- public byte[] SignData (Stream data) {
- return null;
- }
-
- public byte[] SignHash (byte[] hash, string str) {
- return null;
- }
-
- public bool VerifyData (byte[] data, byte[] sig) {
- return false;
- }
-
- public override DSAParameters ExportParameters (bool include) {
- return new DSAParameters ();
- }
-
- public override void ImportParameters (DSAParameters parameters) {
- }
-
- public override void FromXmlString(string xmlString) {
- }
-
- public override string ToXmlString(bool includePrivateParameters) {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSAParameters.cs b/mcs/class/corlib/System.Security.Cryptography/DSAParameters.cs
deleted file mode 100755
index cc8560ddcf2..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSAParameters.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Security.Cryptography DSAParameters.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// DSA Parameters
- /// </summary>
- [Serializable]
- public struct DSAParameters
- {
- public int Counter;
-
- public byte[] G;
-
- public byte[] J;
-
- public byte[] P;
-
- public byte[] Q;
-
- public byte[] Seed;
-
- [NonSerialized]
- public byte[] X;
-
- public byte[] Y;
-
- } // DSAParameters
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs b/mcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs
deleted file mode 100755
index 999381a9afe..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSASignatureDeformatter.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Security.Cryptography DSASignatureDeformatter.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// DSA Signature Deformatter
- /// </summary>
- public class DSASignatureDeformatter : AsymmetricSignatureDeformatter
- {
- [MonoTODO]
- public DSASignatureDeformatter()
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public DSASignatureDeformatter(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
-
- public override void SetHashAlgorithm(string strName)
- {
- throw new CryptographicException("This method is not used");
- }
-
- [MonoTODO]
- public override void SetKey(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature)
- {
- // TODO: implement
- return false;
- }
-
- } // DSASignatureDeformatter
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs b/mcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs
deleted file mode 100755
index 2d1a241a8f7..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DSASignatureFormatter.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography DSASignatureFormatter.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// DSA Signature Formatter
- /// </summary>
- public class DSASignatureFormatter : AsymmetricSignatureFormatter
- {
-
- [MonoTODO]
- public DSASignatureFormatter()
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public DSASignatureFormatter(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override byte[] CreateSignature(byte[] rgbHash)
- {
- // TODO: implement
- return null;
- }
-
- [MonoTODO]
- public override void SetHashAlgorithm(string strName)
- {
- // TODO: implement
- }
-
- [MonoTODO]
- public override void SetKey(AsymmetricAlgorithm key)
- {
- // TODO: implement
- }
-
- } // DSASignatureFormatter
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs b/mcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs
deleted file mode 100755
index 048c4182cd7..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/DeriveBytes.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Security.Cryptography DeriveBytes.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography
-{
-
- /// <summary>
- /// Abstract base class for all classes that derive byte information from an integer
- /// </summary>
- public abstract class DeriveBytes
- {
-
- protected DeriveBytes() {}
-
- public abstract byte[] GetBytes(int cb);
-
- public abstract void Reset();
-
- } // DeriveBytes
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs b/mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs
deleted file mode 100644
index 5fbf6acaa2c..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/FromBase64Transform.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-// System.Security.Cryptography.FromBase64Transform
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Security.Cryptography;
-
-
-namespace System.Security.Cryptography {
-
- public enum FromBase64TransformMode : int {
- IgnoreWhiteSpaces,
- DoNotIgnoreWhiteSpaces
- }
-
- public class FromBase64Transform : ICryptoTransform {
-
- private FromBase64TransformMode mode;
- private byte [] accumulator;
- private byte [] filterBuffer;
- private int accPtr;
-
-
- /// <summary>
- /// Creates a new instance of the decoder
- /// with the default transformation mode (IgnoreWhiteSpaces).
- /// </summary>
- public FromBase64Transform ()
- : this (FromBase64TransformMode.IgnoreWhiteSpaces)
- {
- }
-
-
- /// <summary>
- /// Creates a new instance of the decoder
- /// with the specified transformation mode.
- /// </summary>
- public FromBase64Transform (FromBase64TransformMode mode)
- {
- this.mode = mode;
- accumulator = new byte [4];
- filterBuffer = new byte [4];
- accPtr = 0;
- }
-
-
- /// <summary>
- /// </summary>
- public bool CanTransformMultipleBlocks {
- get {
- return false;
- }
- }
-
-
- /// <summary>
- /// Returns the input block size for the Base64 decoder.
- /// </summary>
- /// <remarks>
- /// The input block size for Base64 decoder is always 1 byte.
- /// </remarks>
- public int InputBlockSize {
- get {
- return 1;
- }
- }
-
-
- /// <summary>
- /// Returns the output block size for the Base64 decoder.
- /// </summary>
- /// <remarks>
- /// The value returned by this property is always 3.
- /// </remarks>
- public int OutputBlockSize {
- get {
- return 3;
- }
- }
-
-
-
- private int Filter (byte [] buffer, int offset, int count)
- {
- int end = offset + count;
- int len = filterBuffer.Length;
- int ptr = 0;
- byte [] filter = this.filterBuffer;
-
- for (int i = offset; i < end; i++) {
- byte b = buffer [i];
- if (!Char.IsWhiteSpace ((char) b)) {
- if (ptr >= len) {
- len <<= 1;
- this.filterBuffer = new byte [len];
- Array.Copy(filter, 0, this.filterBuffer, 0, len >> 1);
- filter = this.filterBuffer;
- }
- filter [ptr++] = b;
- }
- }
-
- return ptr;
- }
-
-
-
-
- private int DoTransform (byte [] inputBuffer,
- int inputOffset,
- int inputCount,
- byte [] outputBuffer,
- int outputOffset)
- {
- int full = inputCount >> 2;
- if (full == 0) return 0;
-
- int rem = 0;
-
- if (inputBuffer[inputCount - 1] == (byte)'=') {
- ++rem;
- --full;
- }
-
- if (inputBuffer[inputCount - 2] == (byte)'=') ++rem;
-
- byte [] lookup = Base64Table.DecodeTable;
- int b0,b1,b2,b3;
-
- for (int i = 0; i < full; i++) {
- b0 = lookup [inputBuffer [inputOffset++]];
- b1 = lookup [inputBuffer [inputOffset++]];
- b2 = lookup [inputBuffer [inputOffset++]];
- b3 = lookup [inputBuffer [inputOffset++]];
-
- outputBuffer [outputOffset++] = (byte) ((b0 << 2) | (b1 >> 4));
- outputBuffer [outputOffset++] = (byte) ((b1 << 4) | (b2 >> 2));
- outputBuffer [outputOffset++] = (byte) ((b2 << 6) | b3);
- }
-
- int res = full * 3;
-
- switch (rem) {
- case 0:
- break;
- case 1:
- b0 = lookup [inputBuffer [inputOffset++]];
- b1 = lookup [inputBuffer [inputOffset++]];
- b2 = lookup [inputBuffer [inputOffset++]];
- outputBuffer [outputOffset++] = (byte) ((b0 << 2) | (b1 >> 4));
- outputBuffer [outputOffset++] = (byte) ((b1 << 4) | (b2 >> 2));
- res += 2;
- break;
- case 2:
- b0 = lookup [inputBuffer [inputOffset++]];
- b1 = lookup [inputBuffer [inputOffset++]];
- outputBuffer [outputOffset++] = (byte) ((b0 << 2) | (b1 >> 4));
- ++res;
- break;
- default:
- break;
- }
-
- return res;
- }
-
-
- /// <summary>
- /// </summary>
- public int TransformBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount,
- byte [] outputBuffer,
- int outputOffset)
- {
- int n;
- byte [] src;
- int srcOff;
- int res = 0;
-
- if (mode == FromBase64TransformMode.IgnoreWhiteSpaces) {
- n = Filter (inputBuffer, inputOffset, inputCount);
- src = filterBuffer;
- srcOff = 0;
- } else {
- n = inputCount;
- src = inputBuffer;
- srcOff = inputOffset;
- }
-
-
- int count = accPtr + n;
-
- if (count < 4) {
- Array.Copy (src, srcOff, accumulator, accPtr, n);
- accPtr = count;
- } else {
- byte [] tmpBuff = new byte [count];
- Array.Copy (accumulator, 0, tmpBuff, 0, accPtr);
- Array.Copy (src, srcOff, tmpBuff, accPtr, n);
- accPtr = count & 3;
- Array.Copy (src, srcOff + (n - accPtr), accumulator, 0, accPtr);
- res = DoTransform (tmpBuff, 0, count & (~3), outputBuffer, outputOffset);
- }
-
-
- return res;
- }
-
-
-
-
-
- /// <summary>
- /// </summary>
- public byte [] TransformFinalBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount)
- {
- byte [] src;
- int srcOff;
- int n;
-
- if (mode == FromBase64TransformMode.IgnoreWhiteSpaces) {
- n = Filter (inputBuffer, inputOffset, inputCount);
- src = filterBuffer;
- srcOff = 0;
- } else {
- n = inputCount;
- src = inputBuffer;
- srcOff = inputOffset;
- }
-
-
- int dataLen = accPtr + n;
- byte [] tmpBuf = new byte [dataLen];
-
- int resLen = ((dataLen) >> 2) * 3;
- byte [] res = new byte [resLen];
-
- Array.Copy (accumulator, 0, tmpBuf, 0, accPtr);
- Array.Copy (src, srcOff, tmpBuf, accPtr, n);
-
- int actLen = DoTransform (tmpBuf, 0, dataLen, res, 0);
-
- accPtr = 0;
-
- if (actLen < resLen) {
- byte [] newres = new byte [actLen];
-
- Array.Copy (res, newres, actLen);
- return newres;
- } else
- return res;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override string ToString ()
- {
- return "mono::System.Security.Cryptography.FromBase64Transform";
- }
-
- } // FromBase64Transform
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs
deleted file mode 100644
index c2564eb236e..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/HashAlgorithm.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// System.Security.Cryptography HashAlgorithm Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
- public abstract class HashAlgorithm : ICryptoTransform {
- protected byte[] HashValue; // Caches the hash after it is calculated. Accessed through the Hash property.
- protected int HashSizeValue; // The size of the hash in bits.
- protected int State; // nonzero when in use; zero when not in use
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected HashAlgorithm () {
-
- }
-
-
- /// <summary>
- /// FIXME: Always true for hashes?
- /// Get whether or not the hash can transform multiple blocks at a time.
- /// </summary>
- [MonoTODO]
- public virtual bool CanTransformMultipleBlocks {
- get {
- return true;
- }
- }
-
- /// <summary>
- /// Computes the entire hash of all the bytes in the byte array.
- /// </summary>
- public byte[] ComputeHash (byte[] input) {
- // inputData = input.Clone();
- HashCore (input, 0, input.Length);
- HashValue = HashFinal ();
- Initialize ();
-
- return HashValue;
- }
-
- /// <summary>
- /// Creates the default implementation of the default hash algorithm (SHA1).
- /// </summary>
- public static HashAlgorithm Create () {
- return SHA1.Create ();
- }
-
- /// <summary>
- /// Creates a specific implementation of the general hash idea.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create.</param>
- [MonoTODO]
- public static HashAlgorithm Create (string st) {
- return Create ();
- }
-
- /// <summary>
- /// Gets the previously computed hash.
- /// </summary>
- public virtual byte[] Hash {
- get {
- return HashValue;
- }
- }
-
- /// <summary>
- /// When overridden in a derived class, drives the hashing function.
- /// </summary>
- /// <param name="rgb"></param>
- /// <param name="start"></param>
- /// <param name="size"></param>
- protected abstract void HashCore (byte[] rgb, int start, int size);
-
- /// <summary>
- /// When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created.
- /// </summary>
- protected abstract byte[] HashFinal ();
-
- /// <summary>
- /// Returns the size in bits of the hash.
- /// </summary>
- public virtual int HashSize {
- get {
- return HashSizeValue;
- }
- }
-
- /// <summary>
- /// When overridden in a derived class, initializes the object to prepare for hashing.
- /// </summary>
- public abstract void Initialize ();
-
- /// <summary>
- /// FIXME: Not quire valid for the hashes? Returns 1?
- /// </summary>
- [MonoTODO]
- public virtual int InputBlockSize {
- get {
- return 1;
- }
- }
-
- /// <summary>
- /// FIXME: Not quire valid for the hashes? Returns 1?
- /// </summary>
- [MonoTODO]
- public virtual int OutputBlockSize {
- get {
- return 1;
- }
- }
-
- /// <summary>
- /// Used for stream chaining. Computes hash as data passes through it.
- /// </summary>
- /// <param name="inputBuffer">The buffer from which to grab the data to be copied.</param>
- /// <param name="inputOffset">The offset into the input buffer to start reading at.</param>
- /// <param name="inputCount">The number of bytes to be copied.</param>
- /// <param name="outputBuffer">The buffer to write the copied data to.</param>
- /// <param name="outputOffset">At what point in the outputBuffer to write the data at.</param>
- public int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) {
-
- Buffer.BlockCopy (inputBuffer, inputOffset, outputBuffer, outputOffset, inputCount);
- HashCore (inputBuffer, inputOffset, inputCount);
-
- return inputCount;
- }
-
- /// <summary>
- /// Used for stream chaining. Computes hash as data passes through it. Finishes off the hash.
- /// </summary>
- /// <param name="inputBuffer">The buffer from which to grab the data to be copied.</param>
- /// <param name="inputOffset">The offset into the input buffer to start reading at.</param>
- /// <param name="inputCount">The number of bytes to be copied.</param>
- public byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] outputBuffer = new byte[inputCount];
-
- Buffer.BlockCopy (inputBuffer, inputOffset, outputBuffer, 0, inputCount);
-
- HashCore (inputBuffer, inputOffset, inputCount);
- HashValue = HashFinal ();
- Initialize ();
-
- return outputBuffer;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs b/mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs
deleted file mode 100644
index f3d1f0e0df8..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/ICryptoTransform.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Security.Cryptography ICryptoTransform interface
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Crytographic functions that can process a stream of bytes implement this interface.
- /// This works by stringing together one or more ICryptoTransform classes with a stream.
- /// Data is passed from one to the next without the need of outside buffering/intervention.
- /// </summary>
- public interface ICryptoTransform {
-
- /// <summary>
- /// Whether the function can transform multiple blocks at a time.
- /// </summary>
- bool CanTransformMultipleBlocks {get;}
-
- /// <summary>
- /// Size of input blocks for the function.
- /// </summary>
- int InputBlockSize {get;}
-
- /// <summary>
- /// Size of the output blocks of the function.
- /// </summary>
- int OutputBlockSize {get;}
-
- /// <summary>
- /// FIXME: Process some data. A block at a time? Less than a block at a time?
- /// </summary>
- int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
-
- /// <summary>
- /// Processes the final part of the data. Also finalizes the function if needed.
- /// </summary>
- byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount);
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/KeySizes.cs b/mcs/class/corlib/System.Security.Cryptography/KeySizes.cs
deleted file mode 100644
index 5fef7ec0908..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/KeySizes.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Security.Cryptography KeySizes Class implementation
-//
-// Author:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// This class represents valid ranges of key sizes for ciphers. It is also used to represent block sizes in the same fashion for block ciphers.
- /// </summary>
- public class KeySizes {
- private int _maxSize;
- private int _minSize;
- private int _skipSize;
-
- /// <summary>
- /// Creates a new KeySizes object.
- /// </summary>
- /// <param name="minSize">The minimum size key allowed for this cipher.</param>
- /// <param name="maxSize">The maximum size key allowed for this cipher.</param>
- /// <param name="skipSize">The jump/skip between the valid key sizes.</param>
- public KeySizes (int minSize, int maxSize, int skipSize) {
- _maxSize = maxSize;
- _minSize = minSize;
- _skipSize = skipSize;
- }
-
- /// <summary>
- /// Returns the maximum valid key size;
- /// </summary>
- public int MaxSize {
- get {
- return _maxSize;
- }
- }
-
- /// <summary>
- /// Returns the minimum valid key size;
- /// </summary>
- public int MinSize {
- get {
- return _minSize;
- }
- }
-
- /// <summary>
- /// Returns the skip between valid key sizes;
- /// </summary>
- public int SkipSize {
- get {
- return _skipSize;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/MD5.cs b/mcs/class/corlib/System.Security.Cryptography/MD5.cs
deleted file mode 100644
index 039a3f4bb1d..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/MD5.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Security.Cryptography MD5 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived MD5 iplementations.
- /// </summary>
- public abstract class MD5 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected MD5 () {
-
- }
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new MD5 Create () {
- return new MD5CryptoServiceProvider();
- }
-
- /// <summary>
- /// Creates a new derived implementation.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new MD5 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs
deleted file mode 100644
index 6a9dca05e25..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/MD5CryptoServiceProvider.cs
+++ /dev/null
@@ -1,482 +0,0 @@
-//
-// System.Security.Cryptography MD5CryptoServiceProvider Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// C# implementation of the MD5 cryptographic hash function.
- /// </summary>
- public class MD5CryptoServiceProvider : MD5 {
- private const int BLOCK_SIZE_BYTES = 64;
- private const int HASH_SIZE_BYTES = 16;
- private const int HASH_SIZE_BITS = 128;
- [CLSCompliant(false)] protected uint[] _H;
- [CLSCompliant(false)] protected uint count;
- private byte[] _ProcessingBuffer; // Used to start data when passed less than a block worth.
- private int _ProcessingBufferCount; // Counts how much data we have stored that still needs processed.
-
- /// <summary>
- /// Creates a new MD5CryptoServiceProvider.
- /// </summary>
- public MD5CryptoServiceProvider () {
- _H = new uint[4];
- HashSizeValue = HASH_SIZE_BITS;
- _ProcessingBuffer = new byte[BLOCK_SIZE_BYTES];
-
- Initialize();
- }
-
- /// <summary>
- /// Drives the hashing function.
- /// </summary>
- /// <param name="rgb">Byte array containing the data to hash.</param>
- /// <param name="start">Where in the input buffer to start.</param>
- /// <param name="size">Size in bytes of the data in the buffer to hash.</param>
- protected override void HashCore (byte[] rgb, int start, int size) {
- int i;
- State = 1;
-
- if (_ProcessingBufferCount != 0) {
- if (size < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, size);
- _ProcessingBufferCount += size;
- return;
- }
- else {
- i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, i);
- ProcessBlock (_ProcessingBuffer, 0);
- _ProcessingBufferCount = 0;
- start += i;
- size -= i;
- }
- }
-
- for (i=0; i<size-size%BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
- ProcessBlock (rgb, start+i);
- }
-
- if (size%BLOCK_SIZE_BYTES != 0) {
- System.Buffer.BlockCopy (rgb, size-size%BLOCK_SIZE_BYTES+start, _ProcessingBuffer, 0, size%BLOCK_SIZE_BYTES);
- _ProcessingBufferCount = size%BLOCK_SIZE_BYTES;
- }
- }
-
- /// <summary>
- /// This finalizes the hash. Takes the data from the chaining variables and returns it.
- /// </summary>
- protected override byte[] HashFinal () {
- byte[] hash = new byte[16];
- int i, j;
-
- ProcessFinalBlock(_ProcessingBuffer, 0, _ProcessingBufferCount);
-
- for (i=0; i<4; i++) {
- for (j=0; j<4; j++) {
- hash[i*4+j] = (byte)(_H[i] >> j*8);
- }
- }
-
- return hash;
- }
-
- /// <summary>
- /// Resets the class after use. Called automatically after hashing is done.
- /// </summary>
- public override void Initialize () {
- count = 0;
- _ProcessingBufferCount = 0;
-
- _H[0] = 0x67452301;
- _H[1] = 0xefcdab89;
- _H[2] = 0x98badcfe;
- _H[3] = 0x10325476;
- }
-
- /// <summary>
- /// This is the meat of the hash function. It is what processes each block one at a time.
- /// </summary>
- /// <param name="inputBuffer">Byte array to process data from.</param>
- /// <param name="inputOffset">Where in the byte array to start processing.</param>
- private void ProcessBlock(byte[] inputBuffer, int inputOffset) {
- uint[] buff = new uint[16];
- uint a, b, c, d;
- int i;
-
- count += BLOCK_SIZE_BYTES;
-
- for (i=0; i<16; i++) {
- buff[i] = (uint)(inputBuffer[inputOffset+4*i])
- | (((uint)(inputBuffer[inputOffset+4*i+1])) << 8)
- | (((uint)(inputBuffer[inputOffset+4*i+2])) << 16)
- | (((uint)(inputBuffer[inputOffset+4*i+3])) << 24);
- }
-
- a = _H[0];
- b = _H[1];
- c = _H[2];
- d = _H[3];
-
- // This function was unrolled because it seems to be doubling our performance with current compiler/VM.
- // Possibly roll up if this changes.
-
-
- // ---- Round 1 --------
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C0 + buff [0];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C1 + buff [1];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C2 + buff [2];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C3 + buff [3];
- b = (b << 22) | (b >> 10);
- b += c;
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C4 + buff [4];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C5 + buff [5];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C6 + buff [6];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C7 + buff [7];
- b = (b << 22) | (b >> 10);
- b += c;
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C8 + buff [8];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C9 + buff [9];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C10 + buff [10];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C11 + buff [11];
- b = (b << 22) | (b >> 10);
- b += c;
-
- a += (((c ^ d) & b) ^ d) + (uint) Constants.C12 + buff [12];
- a = (a << 7) | (a >> 25);
- a += b;
-
- d += (((b ^ c) & a) ^ c) + (uint) Constants.C13 + buff [13];
- d = (d << 12) | (d >> 20);
- d += a;
-
- c += (((a ^ b) & d) ^ b) + (uint) Constants.C14 + buff [14];
- c = (c << 17) | (c >> 15);
- c += d;
-
- b += (((d ^ a) & c) ^ a) + (uint) Constants.C15 + buff [15];
- b = (b << 22) | (b >> 10);
- b += c;
-
-
- // ---- Round 2 --------
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C16 + buff [1];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C17 + buff [6];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C18 + buff [11];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C19 + buff [0];
- b = (b << 20) | (b >> 12);
- b += c;
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C20 + buff [5];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C21 + buff [10];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C22 + buff [15];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C23 + buff [4];
- b = (b << 20) | (b >> 12);
- b += c;
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C24 + buff [9];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C25 + buff [14];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C26 + buff [3];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C27 + buff [8];
- b = (b << 20) | (b >> 12);
- b += c;
-
- a += (((b ^ c) & d) ^ c) + (uint) Constants.C28 + buff [13];
- a = (a << 5) | (a >> 27);
- a += b;
-
- d += (((a ^ b) & c) ^ b) + (uint) Constants.C29 + buff [2];
- d = (d << 9) | (d >> 23);
- d += a;
-
- c += (((d ^ a) & b) ^ a) + (uint) Constants.C30 + buff [7];
- c = (c << 14) | (c >> 18);
- c += d;
-
- b += (((c ^ d) & a) ^ d) + (uint) Constants.C31 + buff [12];
- b = (b << 20) | (b >> 12);
- b += c;
-
-
- // ---- Round 3 --------
-
- a += (b ^ c ^ d) + (uint) Constants.C32 + buff [5];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C33 + buff [8];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C34 + buff [11];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C35 + buff [14];
- b = (b << 23) | (b >> 9);
- b += c;
-
- a += (b ^ c ^ d) + (uint) Constants.C36 + buff [1];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C37 + buff [4];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C38 + buff [7];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C39 + buff [10];
- b = (b << 23) | (b >> 9);
- b += c;
-
- a += (b ^ c ^ d) + (uint) Constants.C40 + buff [13];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C41 + buff [0];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C42 + buff [3];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C43 + buff [6];
- b = (b << 23) | (b >> 9);
- b += c;
-
- a += (b ^ c ^ d) + (uint) Constants.C44 + buff [9];
- a = (a << 4) | (a >> 28);
- a += b;
-
- d += (a ^ b ^ c) + (uint) Constants.C45 + buff [12];
- d = (d << 11) | (d >> 21);
- d += a;
-
- c += (d ^ a ^ b) + (uint) Constants.C46 + buff [15];
- c = (c << 16) | (c >> 16);
- c += d;
-
- b += (c ^ d ^ a) + (uint) Constants.C47 + buff [2];
- b = (b << 23) | (b >> 9);
- b += c;
-
-
- // ---- Round 4 --------
-
- a += (((~d) | b) ^ c) + (uint) Constants.C48 + buff [0];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C49 + buff [7];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C50 + buff [14];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C51 + buff [5];
- b = (b << 21) | (b >> 11);
- b += c;
-
- a += (((~d) | b) ^ c) + (uint) Constants.C52 + buff [12];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C53 + buff [3];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C54 + buff [10];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C55 + buff [1];
- b = (b << 21) | (b >> 11);
- b += c;
-
- a += (((~d) | b) ^ c) + (uint) Constants.C56 + buff [8];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C57 + buff [15];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C58 + buff [6];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C59 + buff [13];
- b = (b << 21) | (b >> 11);
- b += c;
-
- a += (((~d) | b) ^ c) + (uint) Constants.C60 + buff [4];
- a = (a << 6) | (a >> 26);
- a += b;
-
- d += (((~c) | a) ^ b) + (uint) Constants.C61 + buff [11];
- d = (d << 10) | (d >> 22);
- d += a;
-
- c += (((~b) | d) ^ a) + (uint) Constants.C62 + buff [2];
- c = (c << 15) | (c >> 17);
- c += d;
-
- b += (((~a) | c) ^ d) + (uint) Constants.C63 + buff [9];
- b = (b << 21) | (b >> 11);
- b += c;
-
-
- _H[0] += a;
- _H[1] += b;
- _H[2] += c;
- _H[3] += d;
- }
-
- /// <summary>
- /// Pads and then processes the final block.
- /// </summary>
- /// <param name="inputBuffer">Buffer to grab data from.</param>
- /// <param name="inputOffset">Position in buffer in bytes to get data from.</param>
- /// <param name="inputCount">How much data in bytes in the buffer to use.</param>
- private void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] fooBuffer;
- int paddingSize;
- int i;
- uint size;
-
- paddingSize = (int)(56 - (inputCount + count) % BLOCK_SIZE_BYTES);
-
- if (paddingSize < 1)
- paddingSize += BLOCK_SIZE_BYTES;
-
-
- fooBuffer = new byte[inputCount+paddingSize+8];
-
- for (i=0; i<inputCount; i++) {
- fooBuffer[i] = inputBuffer[i+inputOffset];
- }
-
- fooBuffer[inputCount] = 0x80;
- for (i=inputCount+1; i<inputCount+paddingSize; i++) {
- fooBuffer[i] = 0x00;
- }
-
- size = (uint)(count+inputCount);
- size *= 8;
- fooBuffer[inputCount+paddingSize] = (byte)((size) >> 0);
- fooBuffer[inputCount+paddingSize+1] = (byte)((size) >> 8);
- fooBuffer[inputCount+paddingSize+2] = (byte)((size) >> 16);
- fooBuffer[inputCount+paddingSize+3] = (byte)((size) >> 24);
-
- fooBuffer[inputCount+paddingSize+4] = 0x00;
- fooBuffer[inputCount+paddingSize+5] = 0x00;
- fooBuffer[inputCount+paddingSize+6] = 0x00;
- fooBuffer[inputCount+paddingSize+7] = 0x00;
-
- ProcessBlock(fooBuffer, 0);
-
- if (inputCount+paddingSize+8 == 128) {
- ProcessBlock(fooBuffer, 64);
- }
- }
-
- private enum Constants : uint {
- C0 = 0xd76aa478, C1 = 0xe8c7b756, C2 = 0x242070db,
- C3 = 0xc1bdceee, C4 = 0xf57c0faf, C5 = 0x4787c62a,
- C6 = 0xa8304613, C7 = 0xfd469501, C8 = 0x698098d8,
- C9 = 0x8b44f7af,C10 = 0xffff5bb1,C11 = 0x895cd7be,
- C12 = 0x6b901122,C13 = 0xfd987193,C14 = 0xa679438e,
- C15 = 0x49b40821,C16 = 0xf61e2562,C17 = 0xc040b340,
- C18 = 0x265e5a51,C19 = 0xe9b6c7aa,C20 = 0xd62f105d,
- C21 = 0x02441453,C22 = 0xd8a1e681,C23 = 0xe7d3fbc8,
- C24 = 0x21e1cde6,C25 = 0xc33707d6,C26 = 0xf4d50d87,
- C27 = 0x455a14ed,C28 = 0xa9e3e905,C29 = 0xfcefa3f8,
- C30 = 0x676f02d9,C31 = 0x8d2a4c8a,C32 = 0xfffa3942,
- C33 = 0x8771f681,C34 = 0x6d9d6122,C35 = 0xfde5380c,
- C36 = 0xa4beea44,C37 = 0x4bdecfa9,C38 = 0xf6bb4b60,
- C39 = 0xbebfbc70,C40 = 0x289b7ec6,C41 = 0xeaa127fa,
- C42 = 0xd4ef3085,C43 = 0x04881d05,C44 = 0xd9d4d039,
- C45 = 0xe6db99e5,C46 = 0x1fa27cf8,C47 = 0xc4ac5665,
- C48 = 0xf4292244,C49 = 0x432aff97,C50 = 0xab9423a7,
- C51 = 0xfc93a039,C52 = 0x655b59c3,C53 = 0x8f0ccc92,
- C54 = 0xffeff47d,C55 = 0x85845dd1,C56 = 0x6fa87e4f,
- C57 = 0xfe2ce6e0,C58 = 0xa3014314,C59 = 0x4e0811a1,
- C60 = 0xf7537e82,C61 = 0xbd3af235,C62 = 0x2ad7d2bb,
- C63 = 0xeb86d391
- }
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs b/mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs
deleted file mode 100644
index 7f3fa793a43..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/PaddingMode.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Security.Cryptography PaddingMode enumeration
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// How to pad the message processed by block ciphers when they don't come out to the being the size of the block.
- /// </summary>
- public enum PaddingMode {
- None = 0x1,
- PKCS7, // Each byte contains the value of the number of padding bytes.
- Zeros // Append zeros to the message.
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
deleted file mode 100644
index bf71a10bb17..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RNGCryptoServiceProvider.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// System.Security.Cryptography.RNGCryptoServiceProvider
-//
-// Author: Mark Crichton (crichton@gimp.org)
-//
-// (C) 2002
-//
-
-// "In the beginning there was Chaos,
-// and within this Chaos was Power,
-// Great Power without form."
-// -- The Verrah Rubicon of Verena, Book One
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Security.Cryptography {
-
- public class RNGCryptoServiceProvider : RandomNumberGenerator {
-
- [MonoTODO]
- public RNGCryptoServiceProvider () {
- // This will get some meaning when I figure out what the other
- // three constructors do.
- }
-
- [MonoTODO]
- public RNGCryptoServiceProvider (byte[] rgb) {
- // Ok, not called by app code... someone must call it, though.
- }
-
- [MonoTODO]
- public RNGCryptoServiceProvider (CspParameters cspParams) {
- // Why do I have this feeling this is the MS CryptAPI...
- }
-
- [MonoTODO]
- public RNGCryptoServiceProvider (string str) {
- // More !application code. Interesting...
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override void GetBytes (byte[] data);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override void GetNonZeroBytes (byte[] data);
-
- ~RNGCryptoServiceProvider () {
- // FIN?
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RSA.cs b/mcs/class/corlib/System.Security.Cryptography/RSA.cs
deleted file mode 100644
index a02dd19cc2b..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RSA.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Security.Cryptography.RSA.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public abstract class RSA : AsymmetricAlgorithm {
- public static new RSA Create () { return null; }
- public static new RSA Create (string alg) { return Create (); }
-
- public RSA () { }
-
- public abstract byte[] EncryptValue (byte[] rgb);
- public abstract byte[] DecryptValue (byte[] rgb);
-
- public abstract RSAParameters ExportParameters (bool include);
- public abstract void ImportParameters (RSAParameters parameters);
-
- public override void FromXmlString (string xml) {
- }
-
- public override string ToXmlString (bool include) {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs b/mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs
deleted file mode 100644
index 6bc4aafca59..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RSAParameters.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Security.Cryptography.RSAParameters.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- [Serializable]
- public struct RSAParameters {
- [NonSerialized]
- public byte[] P;
- [NonSerialized]
- public byte[] Q;
- [NonSerialized]
- public byte[] D;
- [NonSerialized]
- public byte[] DP;
- [NonSerialized]
- public byte[] DQ;
- [NonSerialized]
- public byte[] InverseQ;
- [NonSerialized]
-
- public byte[] Modulus;
- public byte[] Exponent;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs b/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs
deleted file mode 100755
index f6bc1c51608..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.Security.Cryptography.RandomNumberGenerator
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using System.Globalization;
-
-namespace System.Security.Cryptography {
-
-public abstract class RandomNumberGenerator {
-
- public RandomNumberGenerator () {
- }
-
- public static RandomNumberGenerator Create () {
- // create the default random number generator
- return Create ("System.Security.Cryptography.RandomNumberGenerator");
- }
-
- [MonoTODO]
- public static RandomNumberGenerator Create (string rngName) {
- return null;
- // return (RandomNumberGenerator) (CryptoConfig.CreateFromName (rngName));
- }
-
- public abstract void GetBytes (byte[] data);
-
- public abstract void GetNonZeroBytes (byte[] data);
-
-}
-
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs b/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
deleted file mode 100644
index e4412164e82..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/Rijndael.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.Security.Cryptography.Rijndael.cs
-//
-// Authors: Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public abstract class Rijndael : SymmetricAlgorithm {
- public static new Rijndael Create () { return null; }
- public static new Rijndael Create (string alg) { return Create (); }
-
- public Rijndael () {
- KeySizeValue = 256;
- BlockSizeValue = 128;
- FeedbackSizeValue = 128;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs b/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
deleted file mode 100644
index 9b2428f13d9..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/RijndaelManaged.cs
+++ /dev/null
@@ -1,744 +0,0 @@
-//
-// System.Security.Cryptography.RijndaelManaged.cs
-//
-// Authors: Mark Crichton (crichton@gimp.org)
-//
-// (C) 2002
-//
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-
-/// <summary>
-/// TODO - Add class summary
-/// </summary>
-/// <remarks>
-/// created by - crichton
-/// created on - 2/23/2002 6:21:44 PM
-/// </remarks>
-namespace System.Security.Cryptography {
- public sealed class RijndaelManaged : Rijndael {
-
- /// <summary>
- /// RijndaelManaged constructor.
- /// </summary>
- public RijndaelManaged() {
- }
-
- /// <summary>
- /// Generates a random IV for block feedback modes
- /// </summary>
- /// <remarks>
- /// Method is inherited from SymmetricAlgorithm
- ///
- /// </remarks>
- [MonoTODO]
- public override void GenerateIV() {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Generates a random key for Rijndael. Uses the current KeySize.
- /// </summary>
- /// <remarks>
- /// Inherited method from base class SymmetricAlgorithm
- ///
- /// </remarks>
- [MonoTODO]
- public override void GenerateKey() {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Creates a symmetric Rijndael decryptor object
- /// </summary>
- /// <remarks>
- /// Inherited method from base class SymmetricAlgorithm
- ///
- /// </remarks>
- /// <param name='rgbKey'>Key for Rijndael</param>
- /// <param name='rgbIV'>IV for chaining mode</param>
- [MonoTODO]
- public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) {
- throw new System.NotImplementedException();
- }
-
- /// <summary>
- /// Creates a symmetric Rijndael encryptor object
- /// </summary>
- /// <remarks>
- /// Inherited method from base class SymmetricAlgorithm
- ///
- /// </remarks>
- /// <param name='rgbKey'>Key for Rijndael</param>
- /// <param name='rgbIV'>IV for chaining mode</param>
- [MonoTODO]
- public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) {
- throw new System.NotImplementedException();
- }
-
-
- // Note, the following tables are autogenerated.
- // DO NOT EDIT.
- // These are the 5 T boxes needed for Rijndael
-
-
-
- internal static uint [,] ft_tab = {{
- 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d,
- 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554,
- 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d,
- 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a,
- 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87,
- 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b,
- 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea,
- 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b,
- 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a,
- 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f,
- 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108,
- 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f,
- 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e,
- 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5,
- 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d,
- 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f,
- 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e,
- 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb,
- 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce,
- 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497,
- 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c,
- 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed,
- 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b,
- 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a,
- 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16,
- 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594,
- 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81,
- 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3,
- 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a,
- 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504,
- 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163,
- 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d,
- 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f,
- 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739,
- 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47,
- 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395,
- 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f,
- 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883,
- 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c,
- 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76,
- 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e,
- 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4,
- 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6,
- 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b,
- 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7,
- 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0,
- 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25,
- 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818,
- 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72,
- 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651,
- 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21,
- 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85,
- 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa,
- 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12,
- 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0,
- 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9,
- 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133,
- 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7,
- 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920,
- 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a,
- 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17,
- 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8,
- 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11,
- 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a,
- },{
- 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b,
- 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5,
- 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b,
- 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676,
- 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d,
- 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0,
- 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf,
- 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0,
- 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626,
- 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc,
- 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1,
- 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515,
- 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3,
- 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a,
- 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2,
- 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575,
- 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a,
- 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0,
- 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3,
- 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484,
- 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded,
- 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b,
- 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939,
- 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf,
- 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb,
- 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585,
- 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f,
- 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8,
- 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f,
- 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5,
- 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121,
- 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2,
- 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec,
- 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717,
- 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d,
- 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373,
- 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc,
- 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888,
- 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414,
- 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb,
- 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a,
- 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c,
- 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262,
- 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979,
- 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d,
- 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9,
- 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea,
- 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808,
- 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e,
- 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6,
- 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f,
- 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a,
- 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666,
- 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e,
- 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9,
- 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e,
- 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111,
- 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494,
- 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9,
- 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf,
- 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d,
- 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868,
- 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f,
- 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616,
- },{
- 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b,
- 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5,
- 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b,
- 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76,
- 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d,
- 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0,
- 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af,
- 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0,
- 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26,
- 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc,
- 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1,
- 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15,
- 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3,
- 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a,
- 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2,
- 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75,
- 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a,
- 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0,
- 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3,
- 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384,
- 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed,
- 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b,
- 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239,
- 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf,
- 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb,
- 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185,
- 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f,
- 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8,
- 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f,
- 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5,
- 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221,
- 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2,
- 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec,
- 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17,
- 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d,
- 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673,
- 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc,
- 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88,
- 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814,
- 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb,
- 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a,
- 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c,
- 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462,
- 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279,
- 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d,
- 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9,
- 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea,
- 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008,
- 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e,
- 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6,
- 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f,
- 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a,
- 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66,
- 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e,
- 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9,
- 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e,
- 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211,
- 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394,
- 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9,
- 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df,
- 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d,
- 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068,
- 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f,
- 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16,
- },{
- 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6,
- 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491,
- 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56,
- 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec,
- 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa,
- 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb,
- 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45,
- 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b,
- 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c,
- 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83,
- 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9,
- 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a,
- 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d,
- 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f,
- 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf,
- 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea,
- 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34,
- 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b,
- 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d,
- 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713,
- 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1,
- 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6,
- 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72,
- 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85,
- 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed,
- 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411,
- 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe,
- 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b,
- 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05,
- 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1,
- 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342,
- 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf,
- 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3,
- 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e,
- 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a,
- 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6,
- 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3,
- 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b,
- 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28,
- 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad,
- 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14,
- 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8,
- 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4,
- 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2,
- 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da,
- 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049,
- 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf,
- 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810,
- 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c,
- 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197,
- 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e,
- 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f,
- 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc,
- 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c,
- 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069,
- 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927,
- 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322,
- 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733,
- 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9,
- 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5,
- 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a,
- 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0,
- 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e,
- 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c,
- },{
- 0x63636363, 0x7c7c7c7c, 0x77777777, 0x7b7b7b7b,
- 0xf2f2f2f2, 0x6b6b6b6b, 0x6f6f6f6f, 0xc5c5c5c5,
- 0x30303030, 0x01010101, 0x67676767, 0x2b2b2b2b,
- 0xfefefefe, 0xd7d7d7d7, 0xabababab, 0x76767676,
- 0xcacacaca, 0x82828282, 0xc9c9c9c9, 0x7d7d7d7d,
- 0xfafafafa, 0x59595959, 0x47474747, 0xf0f0f0f0,
- 0xadadadad, 0xd4d4d4d4, 0xa2a2a2a2, 0xafafafaf,
- 0x9c9c9c9c, 0xa4a4a4a4, 0x72727272, 0xc0c0c0c0,
- 0xb7b7b7b7, 0xfdfdfdfd, 0x93939393, 0x26262626,
- 0x36363636, 0x3f3f3f3f, 0xf7f7f7f7, 0xcccccccc,
- 0x34343434, 0xa5a5a5a5, 0xe5e5e5e5, 0xf1f1f1f1,
- 0x71717171, 0xd8d8d8d8, 0x31313131, 0x15151515,
- 0x04040404, 0xc7c7c7c7, 0x23232323, 0xc3c3c3c3,
- 0x18181818, 0x96969696, 0x05050505, 0x9a9a9a9a,
- 0x07070707, 0x12121212, 0x80808080, 0xe2e2e2e2,
- 0xebebebeb, 0x27272727, 0xb2b2b2b2, 0x75757575,
- 0x09090909, 0x83838383, 0x2c2c2c2c, 0x1a1a1a1a,
- 0x1b1b1b1b, 0x6e6e6e6e, 0x5a5a5a5a, 0xa0a0a0a0,
- 0x52525252, 0x3b3b3b3b, 0xd6d6d6d6, 0xb3b3b3b3,
- 0x29292929, 0xe3e3e3e3, 0x2f2f2f2f, 0x84848484,
- 0x53535353, 0xd1d1d1d1, 0x00000000, 0xedededed,
- 0x20202020, 0xfcfcfcfc, 0xb1b1b1b1, 0x5b5b5b5b,
- 0x6a6a6a6a, 0xcbcbcbcb, 0xbebebebe, 0x39393939,
- 0x4a4a4a4a, 0x4c4c4c4c, 0x58585858, 0xcfcfcfcf,
- 0xd0d0d0d0, 0xefefefef, 0xaaaaaaaa, 0xfbfbfbfb,
- 0x43434343, 0x4d4d4d4d, 0x33333333, 0x85858585,
- 0x45454545, 0xf9f9f9f9, 0x02020202, 0x7f7f7f7f,
- 0x50505050, 0x3c3c3c3c, 0x9f9f9f9f, 0xa8a8a8a8,
- 0x51515151, 0xa3a3a3a3, 0x40404040, 0x8f8f8f8f,
- 0x92929292, 0x9d9d9d9d, 0x38383838, 0xf5f5f5f5,
- 0xbcbcbcbc, 0xb6b6b6b6, 0xdadadada, 0x21212121,
- 0x10101010, 0xffffffff, 0xf3f3f3f3, 0xd2d2d2d2,
- 0xcdcdcdcd, 0x0c0c0c0c, 0x13131313, 0xecececec,
- 0x5f5f5f5f, 0x97979797, 0x44444444, 0x17171717,
- 0xc4c4c4c4, 0xa7a7a7a7, 0x7e7e7e7e, 0x3d3d3d3d,
- 0x64646464, 0x5d5d5d5d, 0x19191919, 0x73737373,
- 0x60606060, 0x81818181, 0x4f4f4f4f, 0xdcdcdcdc,
- 0x22222222, 0x2a2a2a2a, 0x90909090, 0x88888888,
- 0x46464646, 0xeeeeeeee, 0xb8b8b8b8, 0x14141414,
- 0xdededede, 0x5e5e5e5e, 0x0b0b0b0b, 0xdbdbdbdb,
- 0xe0e0e0e0, 0x32323232, 0x3a3a3a3a, 0x0a0a0a0a,
- 0x49494949, 0x06060606, 0x24242424, 0x5c5c5c5c,
- 0xc2c2c2c2, 0xd3d3d3d3, 0xacacacac, 0x62626262,
- 0x91919191, 0x95959595, 0xe4e4e4e4, 0x79797979,
- 0xe7e7e7e7, 0xc8c8c8c8, 0x37373737, 0x6d6d6d6d,
- 0x8d8d8d8d, 0xd5d5d5d5, 0x4e4e4e4e, 0xa9a9a9a9,
- 0x6c6c6c6c, 0x56565656, 0xf4f4f4f4, 0xeaeaeaea,
- 0x65656565, 0x7a7a7a7a, 0xaeaeaeae, 0x08080808,
- 0xbabababa, 0x78787878, 0x25252525, 0x2e2e2e2e,
- 0x1c1c1c1c, 0xa6a6a6a6, 0xb4b4b4b4, 0xc6c6c6c6,
- 0xe8e8e8e8, 0xdddddddd, 0x74747474, 0x1f1f1f1f,
- 0x4b4b4b4b, 0xbdbdbdbd, 0x8b8b8b8b, 0x8a8a8a8a,
- 0x70707070, 0x3e3e3e3e, 0xb5b5b5b5, 0x66666666,
- 0x48484848, 0x03030303, 0xf6f6f6f6, 0x0e0e0e0e,
- 0x61616161, 0x35353535, 0x57575757, 0xb9b9b9b9,
- 0x86868686, 0xc1c1c1c1, 0x1d1d1d1d, 0x9e9e9e9e,
- 0xe1e1e1e1, 0xf8f8f8f8, 0x98989898, 0x11111111,
- 0x69696969, 0xd9d9d9d9, 0x8e8e8e8e, 0x94949494,
- 0x9b9b9b9b, 0x1e1e1e1e, 0x87878787, 0xe9e9e9e9,
- 0xcececece, 0x55555555, 0x28282828, 0xdfdfdfdf,
- 0x8c8c8c8c, 0xa1a1a1a1, 0x89898989, 0x0d0d0d0d,
- 0xbfbfbfbf, 0xe6e6e6e6, 0x42424242, 0x68686868,
- 0x41414141, 0x99999999, 0x2d2d2d2d, 0x0f0f0f0f,
- 0xb0b0b0b0, 0x54545454, 0xbbbbbbbb, 0x16161616,
- }};
-
- internal static uint [,] it_tab = {{
- 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96,
- 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393,
- 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25,
- 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f,
- 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1,
- 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6,
- 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da,
- 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844,
- 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd,
- 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4,
- 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45,
- 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94,
- 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7,
- 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a,
- 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5,
- 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c,
- 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1,
- 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a,
- 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75,
- 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051,
- 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46,
- 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff,
- 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77,
- 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb,
- 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000,
- 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e,
- 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927,
- 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a,
- 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e,
- 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16,
- 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d,
- 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8,
- 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd,
- 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34,
- 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163,
- 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120,
- 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d,
- 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0,
- 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422,
- 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef,
- 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36,
- 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4,
- 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662,
- 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5,
- 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3,
- 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b,
- 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8,
- 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6,
- 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6,
- 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0,
- 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815,
- 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f,
- 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df,
- 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f,
- 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e,
- 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713,
- 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89,
- 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c,
- 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf,
- 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86,
- 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f,
- 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541,
- 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190,
- 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742,
- },{
- 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e,
- 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303,
- 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c,
- 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3,
- 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0,
- 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9,
- 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259,
- 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8,
- 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971,
- 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a,
- 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f,
- 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b,
- 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8,
- 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab,
- 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708,
- 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682,
- 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2,
- 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe,
- 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb,
- 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10,
- 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd,
- 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015,
- 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e,
- 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee,
- 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000,
- 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72,
- 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39,
- 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e,
- 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91,
- 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a,
- 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17,
- 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9,
- 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60,
- 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e,
- 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1,
- 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611,
- 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1,
- 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3,
- 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964,
- 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390,
- 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b,
- 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf,
- 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46,
- 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af,
- 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512,
- 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb,
- 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a,
- 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8,
- 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c,
- 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266,
- 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8,
- 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6,
- 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604,
- 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551,
- 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41,
- 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647,
- 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c,
- 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1,
- 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737,
- 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db,
- 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340,
- 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95,
- 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1,
- 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857,
- },{
- 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27,
- 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3,
- 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502,
- 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562,
- 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe,
- 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3,
- 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552,
- 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9,
- 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9,
- 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce,
- 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253,
- 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908,
- 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b,
- 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655,
- 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337,
- 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16,
- 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69,
- 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6,
- 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6,
- 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e,
- 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6,
- 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050,
- 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9,
- 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8,
- 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000,
- 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a,
- 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d,
- 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436,
- 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b,
- 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12,
- 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b,
- 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e,
- 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f,
- 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb,
- 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4,
- 0xdccad731, 0x85104263, 0x22401397, 0x112084c6,
- 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729,
- 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1,
- 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9,
- 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233,
- 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4,
- 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad,
- 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e,
- 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3,
- 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25,
- 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b,
- 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f,
- 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15,
- 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0,
- 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2,
- 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7,
- 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791,
- 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496,
- 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665,
- 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b,
- 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6,
- 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13,
- 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47,
- 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7,
- 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844,
- 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3,
- 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d,
- 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456,
- 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8,
- },{
- 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a,
- 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b,
- 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5,
- 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5,
- 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d,
- 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b,
- 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95,
- 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e,
- 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27,
- 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d,
- 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562,
- 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9,
- 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752,
- 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66,
- 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3,
- 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced,
- 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e,
- 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4,
- 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4,
- 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd,
- 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d,
- 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60,
- 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767,
- 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79,
- 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000,
- 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c,
- 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736,
- 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24,
- 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b,
- 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c,
- 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12,
- 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814,
- 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3,
- 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b,
- 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8,
- 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084,
- 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7,
- 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077,
- 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247,
- 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22,
- 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698,
- 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f,
- 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254,
- 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582,
- 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf,
- 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb,
- 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883,
- 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef,
- 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629,
- 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035,
- 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533,
- 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17,
- 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4,
- 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46,
- 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb,
- 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d,
- 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb,
- 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a,
- 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73,
- 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678,
- 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2,
- 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff,
- 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064,
- 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0,
- },{
- 0x52525252, 0x09090909, 0x6a6a6a6a, 0xd5d5d5d5,
- 0x30303030, 0x36363636, 0xa5a5a5a5, 0x38383838,
- 0xbfbfbfbf, 0x40404040, 0xa3a3a3a3, 0x9e9e9e9e,
- 0x81818181, 0xf3f3f3f3, 0xd7d7d7d7, 0xfbfbfbfb,
- 0x7c7c7c7c, 0xe3e3e3e3, 0x39393939, 0x82828282,
- 0x9b9b9b9b, 0x2f2f2f2f, 0xffffffff, 0x87878787,
- 0x34343434, 0x8e8e8e8e, 0x43434343, 0x44444444,
- 0xc4c4c4c4, 0xdededede, 0xe9e9e9e9, 0xcbcbcbcb,
- 0x54545454, 0x7b7b7b7b, 0x94949494, 0x32323232,
- 0xa6a6a6a6, 0xc2c2c2c2, 0x23232323, 0x3d3d3d3d,
- 0xeeeeeeee, 0x4c4c4c4c, 0x95959595, 0x0b0b0b0b,
- 0x42424242, 0xfafafafa, 0xc3c3c3c3, 0x4e4e4e4e,
- 0x08080808, 0x2e2e2e2e, 0xa1a1a1a1, 0x66666666,
- 0x28282828, 0xd9d9d9d9, 0x24242424, 0xb2b2b2b2,
- 0x76767676, 0x5b5b5b5b, 0xa2a2a2a2, 0x49494949,
- 0x6d6d6d6d, 0x8b8b8b8b, 0xd1d1d1d1, 0x25252525,
- 0x72727272, 0xf8f8f8f8, 0xf6f6f6f6, 0x64646464,
- 0x86868686, 0x68686868, 0x98989898, 0x16161616,
- 0xd4d4d4d4, 0xa4a4a4a4, 0x5c5c5c5c, 0xcccccccc,
- 0x5d5d5d5d, 0x65656565, 0xb6b6b6b6, 0x92929292,
- 0x6c6c6c6c, 0x70707070, 0x48484848, 0x50505050,
- 0xfdfdfdfd, 0xedededed, 0xb9b9b9b9, 0xdadadada,
- 0x5e5e5e5e, 0x15151515, 0x46464646, 0x57575757,
- 0xa7a7a7a7, 0x8d8d8d8d, 0x9d9d9d9d, 0x84848484,
- 0x90909090, 0xd8d8d8d8, 0xabababab, 0x00000000,
- 0x8c8c8c8c, 0xbcbcbcbc, 0xd3d3d3d3, 0x0a0a0a0a,
- 0xf7f7f7f7, 0xe4e4e4e4, 0x58585858, 0x05050505,
- 0xb8b8b8b8, 0xb3b3b3b3, 0x45454545, 0x06060606,
- 0xd0d0d0d0, 0x2c2c2c2c, 0x1e1e1e1e, 0x8f8f8f8f,
- 0xcacacaca, 0x3f3f3f3f, 0x0f0f0f0f, 0x02020202,
- 0xc1c1c1c1, 0xafafafaf, 0xbdbdbdbd, 0x03030303,
- 0x01010101, 0x13131313, 0x8a8a8a8a, 0x6b6b6b6b,
- 0x3a3a3a3a, 0x91919191, 0x11111111, 0x41414141,
- 0x4f4f4f4f, 0x67676767, 0xdcdcdcdc, 0xeaeaeaea,
- 0x97979797, 0xf2f2f2f2, 0xcfcfcfcf, 0xcececece,
- 0xf0f0f0f0, 0xb4b4b4b4, 0xe6e6e6e6, 0x73737373,
- 0x96969696, 0xacacacac, 0x74747474, 0x22222222,
- 0xe7e7e7e7, 0xadadadad, 0x35353535, 0x85858585,
- 0xe2e2e2e2, 0xf9f9f9f9, 0x37373737, 0xe8e8e8e8,
- 0x1c1c1c1c, 0x75757575, 0xdfdfdfdf, 0x6e6e6e6e,
- 0x47474747, 0xf1f1f1f1, 0x1a1a1a1a, 0x71717171,
- 0x1d1d1d1d, 0x29292929, 0xc5c5c5c5, 0x89898989,
- 0x6f6f6f6f, 0xb7b7b7b7, 0x62626262, 0x0e0e0e0e,
- 0xaaaaaaaa, 0x18181818, 0xbebebebe, 0x1b1b1b1b,
- 0xfcfcfcfc, 0x56565656, 0x3e3e3e3e, 0x4b4b4b4b,
- 0xc6c6c6c6, 0xd2d2d2d2, 0x79797979, 0x20202020,
- 0x9a9a9a9a, 0xdbdbdbdb, 0xc0c0c0c0, 0xfefefefe,
- 0x78787878, 0xcdcdcdcd, 0x5a5a5a5a, 0xf4f4f4f4,
- 0x1f1f1f1f, 0xdddddddd, 0xa8a8a8a8, 0x33333333,
- 0x88888888, 0x07070707, 0xc7c7c7c7, 0x31313131,
- 0xb1b1b1b1, 0x12121212, 0x10101010, 0x59595959,
- 0x27272727, 0x80808080, 0xecececec, 0x5f5f5f5f,
- 0x60606060, 0x51515151, 0x7f7f7f7f, 0xa9a9a9a9,
- 0x19191919, 0xb5b5b5b5, 0x4a4a4a4a, 0x0d0d0d0d,
- 0x2d2d2d2d, 0xe5e5e5e5, 0x7a7a7a7a, 0x9f9f9f9f,
- 0x93939393, 0xc9c9c9c9, 0x9c9c9c9c, 0xefefefef,
- 0xa0a0a0a0, 0xe0e0e0e0, 0x3b3b3b3b, 0x4d4d4d4d,
- 0xaeaeaeae, 0x2a2a2a2a, 0xf5f5f5f5, 0xb0b0b0b0,
- 0xc8c8c8c8, 0xebebebeb, 0xbbbbbbbb, 0x3c3c3c3c,
- 0x83838383, 0x53535353, 0x99999999, 0x61616161,
- 0x17171717, 0x2b2b2b2b, 0x04040404, 0x7e7e7e7e,
- 0xbabababa, 0x77777777, 0xd6d6d6d6, 0x26262626,
- 0xe1e1e1e1, 0x69696969, 0x14141414, 0x63636363,
- 0x55555555, 0x21212121, 0x0c0c0c0c, 0x7d7d7d7d,
- }};
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA1.cs b/mcs/class/corlib/System.Security.Cryptography/SHA1.cs
deleted file mode 100644
index 605c4d9baa9..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA1.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Security.Cryptography SHA1 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA1 iplementations.
- /// </summary>
- public abstract class SHA1 : HashAlgorithm {
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- protected SHA1 () {
-
- }
-
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA1 Create () {
- return new SHA1CryptoServiceProvider();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA1 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs b/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
deleted file mode 100644
index d7061e496ae..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA1CryptoServiceProvider.cs
+++ /dev/null
@@ -1,455 +0,0 @@
-//
-// System.Security.Cryptography SHA1CryptoServiceProvider Class implementation
-//
-// Author:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// C# implementation of the SHA1 cryptographic hash function.
- /// LAMESPEC?: Basically the same thing as SHA1Managed except for how its implemented.
- /// </summary>
- public sealed class SHA1CryptoServiceProvider : SHA1 {
- private const int BLOCK_SIZE_BYTES = 64;
- private const int HASH_SIZE_BYTES = 20;
- private const int HASH_SIZE_BITS = 160;
- [CLSCompliant(false)] private uint[] _H; // these are my chaining variables
- [CLSCompliant(false)] private uint count;
- private byte[] _ProcessingBuffer; // Used to start data when passed less than a block worth.
- private int _ProcessingBufferCount; // Counts how much data we have stored that still needs processed.
-
- /// <summary>
- /// Creates a new SHA1CryptoServiceProvider.
- /// </summary>
- public SHA1CryptoServiceProvider () {
- _H = new uint[5];
- HashSizeValue = HASH_SIZE_BITS;
- _ProcessingBuffer = new byte[BLOCK_SIZE_BYTES];
-
- Initialize();
- }
-
- /// <summary>
- /// Drives the hashing function.
- /// </summary>
- /// <param name="rgb">Byte array containing the data to hash.</param>
- /// <param name="start">Where in the input buffer to start.</param>
- /// <param name="size">Size in bytes of the data in the buffer to hash.</param>
- protected override void HashCore (byte[] rgb, int start, int size) {
- int i;
- State = 1;
-
- if (_ProcessingBufferCount != 0) {
- if (size < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, size);
- _ProcessingBufferCount += size;
- return;
- }
- else {
- i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, i);
- ProcessBlock (_ProcessingBuffer, 0);
- _ProcessingBufferCount = 0;
- start += i;
- size -= i;
- }
- }
-
- for (i=0; i<size-size%BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
- ProcessBlock (rgb, start+i);
- }
-
- if (size%BLOCK_SIZE_BYTES != 0) {
- System.Buffer.BlockCopy (rgb, size-size%BLOCK_SIZE_BYTES+start, _ProcessingBuffer, 0, size%BLOCK_SIZE_BYTES);
- _ProcessingBufferCount = size%BLOCK_SIZE_BYTES;
- }
- }
-
- /// <summary>
- /// This finalizes the hash. Takes the data from the chaining variables and returns it.
- /// </summary>
- protected override byte[] HashFinal () {
- byte[] hash = new byte[20];
- int i, j;
-
- ProcessFinalBlock(_ProcessingBuffer, 0, _ProcessingBufferCount);
-
- for (i=0; i<5; i++) {
- for (j=0; j<4; j++) {
- hash[i*4+j] = (byte)(_H[i] >> (8*(3-j)));
- }
- }
-
- State = 0;
- return hash;
- }
-
-
- /// <summary>
- /// Resets the class after use. Called automatically after hashing is done.
- /// </summary>
- public override void Initialize () {
- count = 0;
- _ProcessingBufferCount = 0;
-
- _H[0] = 0x67452301;
- _H[1] = 0xefcdab89;
- _H[2] = 0x98badcfe;
- _H[3] = 0x10325476;
- _H[4] = 0xC3D2E1F0;
- }
-
- /// <summary>
- /// This is the meat of the hash function. It is what processes each block one at a time.
- /// </summary>
- /// <param name="inputBuffer">Byte array to process data from.</param>
- /// <param name="inputOffset">Where in the byte array to start processing.</param>
- private void ProcessBlock(byte[] inputBuffer, int inputOffset) {
- uint[] buff = new uint[80];
- uint a, b, c, d, e;
- int i;
-
- count += BLOCK_SIZE_BYTES;
-
- for (i=0; i<16; i++) {
- buff[i] = ((uint)(inputBuffer[inputOffset+4*i]) << 24)
- | ((uint)(inputBuffer[inputOffset+4*i+1]) << 16)
- | ((uint)(inputBuffer[inputOffset+4*i+2]) << 8)
- | ((uint)(inputBuffer[inputOffset+4*i+3]));
- }
-
- for (i=16; i<80; i++) {
- buff[i] = ((buff[i-3] ^ buff[i-8] ^ buff[i-14] ^ buff[i-16]) << 1)
- | ((buff[i-3] ^ buff[i-8] ^ buff[i-14] ^ buff[i-16]) >> 31);
- }
-
- a = _H[0];
- b = _H[1];
- c = _H[2];
- d = _H[3];
- e = _H[4];
-
-
- // This function was unrolled because it seems to be doubling our performance with current compiler/VM.
- // Possibly roll up if this changes.
-
- // ---- Round 1 --------
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[0];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[1];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[2];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[3];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[4];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[5];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[6];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[7];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[8];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[9];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[10];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[11];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[12];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[13];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[14];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (((c ^ d) & b) ^ d) + 0x5A827999 + buff[15];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (((b ^ c) & a) ^ c) + 0x5A827999 + buff[16];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (((a ^ b) & e) ^ b) + 0x5A827999 + buff[17];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (((e ^ a) & d) ^ a) + 0x5A827999 + buff[18];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (((d ^ e) & c) ^ e) + 0x5A827999 + buff[19];
- c = (c << 30) | (c >> 2);
-
-
-
- // ---- Round 2 --------
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[20];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[21];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[22];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[23];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[24];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[25];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[26];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[27];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[28];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[29];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[30];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[31];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[32];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[33];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[34];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0x6ED9EBA1 + buff[35];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0x6ED9EBA1 + buff[36];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0x6ED9EBA1 + buff[37];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0x6ED9EBA1 + buff[38];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0x6ED9EBA1 + buff[39];
- c = (c << 30) | (c >> 2);
-
-
-
- // ---- Round 3 --------
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[40];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[41];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[42];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[43];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[44];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[45];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[46];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[47];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[48];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[49];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[50];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[51];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[52];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[53];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[54];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + ((b&c) | (b&d) | (c&d)) + 0x8F1BBCDC + buff[55];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + ((a&b) | (a&c) | (b&c)) + 0x8F1BBCDC + buff[56];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + ((e&a) | (e&b) | (a&b)) + 0x8F1BBCDC + buff[57];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + ((d&e) | (d&a) | (e&a)) + 0x8F1BBCDC + buff[58];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + ((c&d) | (c&e) | (d&e)) + 0x8F1BBCDC + buff[59];
- c = (c << 30) | (c >> 2);
-
-
-
- // ---- Round 4 --------
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[60];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[61];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[62];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[63];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[64];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[65];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[66];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[67];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[68];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[69];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[70];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[71];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[72];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[73];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[74];
- c = (c << 30) | (c >> 2);
-
- e += ((a << 5) | (a >> 27)) + (b ^ c ^ d) + 0xCA62C1D6 + buff[75];
- b = (b << 30) | (b >> 2);
-
- d += ((e << 5) | (e >> 27)) + (a ^ b ^ c) + 0xCA62C1D6 + buff[76];
- a = (a << 30) | (a >> 2);
-
- c += ((d << 5) | (d >> 27)) + (e ^ a ^ b) + 0xCA62C1D6 + buff[77];
- e = (e << 30) | (e >> 2);
-
- b += ((c << 5) | (c >> 27)) + (d ^ e ^ a) + 0xCA62C1D6 + buff[78];
- d = (d << 30) | (d >> 2);
-
- a += ((b << 5) | (b >> 27)) + (c ^ d ^ e) + 0xCA62C1D6 + buff[79];
- c = (c << 30) | (c >> 2);
-
-
- _H[0] += a;
- _H[1] += b;
- _H[2] += c;
- _H[3] += d;
- _H[4] += e;
- }
-
- /// <summary>
- /// Pads and then processes the final block.
- /// Non-standard.
- /// </summary>
- /// <param name="inputBuffer">Buffer to grab data from.</param>
- /// <param name="inputOffset">Position in buffer in bytes to get data from.</param>
- /// <param name="inputCount">How much data in bytes in the buffer to use.</param>
- private void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] fooBuffer;
- int paddingSize;
- int i;
- uint size;
-
- paddingSize = (int)(56 - (inputCount + count) % BLOCK_SIZE_BYTES);
-
- if (paddingSize < 1)
- paddingSize += BLOCK_SIZE_BYTES;
-
- fooBuffer = new byte[inputCount+paddingSize+8];
-
- for (i=0; i<inputCount; i++) {
- fooBuffer[i] = inputBuffer[i+inputOffset];
- }
-
- fooBuffer[inputCount] = 0x80;
- for (i=inputCount+1; i<inputCount+paddingSize; i++) {
- fooBuffer[i] = 0x00;
- }
-
- size = (uint)(count+inputCount);
- size *= 8; // I deal in bytes. They algorythm deals in bits.
-
- fooBuffer[inputCount+paddingSize] = 0x00;
- fooBuffer[inputCount+paddingSize+1] = 0x00;
- fooBuffer[inputCount+paddingSize+2] = 0x00;
- fooBuffer[inputCount+paddingSize+3] = 0x00;
-
- fooBuffer[inputCount+paddingSize+4] = (byte)((size) >> 24);
- fooBuffer[inputCount+paddingSize+5] = (byte)((size) >> 16);
- fooBuffer[inputCount+paddingSize+6] = (byte)((size) >> 8);
- fooBuffer[inputCount+paddingSize+7] = (byte)((size) >> 0);
-
- ProcessBlock(fooBuffer, 0);
-
- if (inputCount+paddingSize+8 == 128) {
- ProcessBlock(fooBuffer, 64);
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA256.cs b/mcs/class/corlib/System.Security.Cryptography/SHA256.cs
deleted file mode 100644
index c3fbb573e07..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA256.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography SHA256 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA256 iplementations.
- /// Abstract.
- /// </summary>
- public abstract class SHA256 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- public SHA256 () {
-
- }
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA256 Create () {
- return new SHA256Managed ();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA256 Create (string st) {
- return Create ();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs
deleted file mode 100644
index bcfd16b3479..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA256Managed.cs
+++ /dev/null
@@ -1,290 +0,0 @@
-//
-// System.Security.Cryptography SHA256Managed Class implementation
-//
-// Author:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// (C) 2001
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// C# implementation of the SHA1 cryptographic hash function.
- /// LAMESPEC?: Basically the same thing as SHA1Managed except for how its implemented.
- /// </summary>
- public class SHA256Managed : SHA256 {
- private const int BLOCK_SIZE_BYTES = 64;
- private const int HASH_SIZE_BYTES = 32;
- private const int HASH_SIZE_BITS = 256;
- [CLSCompliant(false)] protected uint[] _H;
- [CLSCompliant(false)] private uint[] K;
- [CLSCompliant(false)] protected uint count;
- private byte[] _ProcessingBuffer; // Used to start data when passed less than a block worth.
- private int _ProcessingBufferCount; // Counts how much data we have stored that still needs processed.
-
- /// <summary>
- /// Creates a new SHA256Managed class.
- /// </summary>
- public SHA256Managed () {
- _H = new uint[8];
- HashSizeValue = HASH_SIZE_BITS;
- _ProcessingBuffer = new byte[BLOCK_SIZE_BYTES];
-
- K = new uint[64];
- K[0] = 0x428A2F98; K[1] = 0x71374491; K[2] = 0xB5C0FBCF; K[3] = 0xE9B5DBA5;
- K[4] = 0x3956C25B; K[5] = 0x59F111F1; K[6] = 0x923F82A4; K[7] = 0xAB1C5ED5;
- K[8] = 0xD807AA98; K[9] = 0x12835B01; K[10] = 0x243185BE; K[11] = 0x550C7DC3;
- K[12] = 0x72BE5D74; K[13] = 0x80DEB1FE; K[14] = 0x9BDC06A7; K[15] = 0xC19BF174;
- K[16] = 0xE49B69C1; K[17] = 0xEFBE4786; K[18] = 0x0FC19DC6; K[19] = 0x240CA1CC;
- K[20] = 0x2DE92C6F; K[21] = 0x4A7484AA; K[22] = 0x5CB0A9DC; K[23] = 0x76F988DA;
- K[24] = 0x983E5152; K[25] = 0xA831C66D; K[26] = 0xB00327C8; K[27] = 0xBF597FC7;
- K[28] = 0xC6E00BF3; K[29] = 0xD5A79147; K[30] = 0x06CA6351; K[31] = 0x14292967;
- K[32] = 0x27B70A85; K[33] = 0x2E1B2138; K[34] = 0x4D2C6DFC; K[35] = 0x53380D13;
- K[36] = 0x650A7354; K[37] = 0x766A0ABB; K[38] = 0x81C2C92E; K[39] = 0x92722C85;
- K[40] = 0xA2BFE8A1; K[41] = 0xA81A664B; K[42] = 0xC24B8B70; K[43] = 0xC76C51A3;
- K[44] = 0xD192E819; K[45] = 0xD6990624; K[46] = 0xF40E3585; K[47] = 0x106AA070;
- K[48] = 0x19A4C116; K[49] = 0x1E376C08; K[50] = 0x2748774C; K[51] = 0x34B0BCB5;
- K[52] = 0x391C0CB3; K[53] = 0x4ED8AA4A; K[54] = 0x5B9CCA4F; K[55] = 0x682E6FF3;
- K[56] = 0x748F82EE; K[57] = 0x78A5636F; K[58] = 0x84C87814; K[59] = 0x8CC70208;
- K[60] = 0x90BEFFFA; K[61] = 0xA4506CEB; K[62] = 0xBEF9A3F7; K[63] = 0xC67178F2;
-
- Initialize();
- }
-
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Ch (uint u, uint v, uint w) {
- return (u&v) ^ (~u&w);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Maj (uint u, uint v, uint w) {
- return (u&v) ^ (u&w) ^ (v&w);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Ro0 (uint x) {
- return ((x >> 7) | (x << 25))
- ^ ((x >> 18) | (x << 14))
- ^ (x >> 3);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Ro1 (uint x) {
- return ((x >> 17) | (x << 15))
- ^ ((x >> 19) | (x << 13))
- ^ (x >> 10);
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Sig0 (uint x) {
- return ((x >> 2) | (x << 30))
- ^ ((x >> 13) | (x << 19))
- ^ ((x >> 22) | (x << 10));
- }
-
- /// <summary>
- /// Internal function handling a subset of the algorithm.
- /// </summary>
- private uint Sig1 (uint x) {
- return ((x >> 6) | (x << 26))
- ^ ((x >> 11) | (x << 21))
- ^ ((x >> 25) | (x << 7));
- }
-
- /// <summary>
- /// Drives the hashing function.
- /// </summary>
- /// <param name="rgb">Byte array containing the data to hash.</param>
- /// <param name="start">Where in the input buffer to start.</param>
- /// <param name="size">Size in bytes of the data in the buffer to hash.</param>
- protected override void HashCore (byte[] rgb, int start, int size) {
- int i;
- State = 1;
-
- if (_ProcessingBufferCount != 0) {
- if (size < (BLOCK_SIZE_BYTES - _ProcessingBufferCount)) {
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, size);
- _ProcessingBufferCount += size;
- return;
- }
- else {
- i = (BLOCK_SIZE_BYTES - _ProcessingBufferCount);
- System.Buffer.BlockCopy (rgb, start, _ProcessingBuffer, _ProcessingBufferCount, i);
- ProcessBlock (_ProcessingBuffer, 0);
- _ProcessingBufferCount = 0;
- start += i;
- size -= i;
- }
- }
-
- for (i=0; i<size-size%BLOCK_SIZE_BYTES; i += BLOCK_SIZE_BYTES) {
- ProcessBlock (rgb, start+i);
- }
-
- if (size%BLOCK_SIZE_BYTES != 0) {
- System.Buffer.BlockCopy (rgb, size-size%BLOCK_SIZE_BYTES+start, _ProcessingBuffer, 0, size%BLOCK_SIZE_BYTES);
- _ProcessingBufferCount = size%BLOCK_SIZE_BYTES;
- }
- }
-
- /// <summary>
- /// This finalizes the hash. Takes the data from the chaining variables and returns it.
- /// </summary>
- protected override byte[] HashFinal () {
- byte[] hash = new byte[32];
- int i, j;
-
- ProcessFinalBlock(_ProcessingBuffer, 0, _ProcessingBufferCount);
-
- for (i=0; i<8; i++) {
- for (j=0; j<4; j++) {
- hash[i*4+j] = (byte)(_H[i] >> (24-j*8));
- }
- }
-
- State = 0;
- return hash;
- }
-
- /// <summary>
- /// Resets the class after use. Called automatically after hashing is done.
- /// </summary>
- public override void Initialize () {
- count = 0;
- _ProcessingBufferCount = 0;
-
- _H[0] = 0x6A09E667;
- _H[1] = 0xBB67AE85;
- _H[2] = 0x3C6EF372;
- _H[3] = 0xA54FF53A;
- _H[4] = 0x510E527F;
- _H[5] = 0x9B05688C;
- _H[6] = 0x1F83D9AB;
- _H[7] = 0x5BE0CD19;
- }
-
- /// <summary>
- /// This is the meat of the hash function. It is what processes each block one at a time.
- /// </summary>
- /// <param name="inputBuffer">Byte array to process data from.</param>
- /// <param name="inputOffset">Where in the byte array to start processing.</param>
- public void ProcessBlock(byte[] inputBuffer, int inputOffset) {
- uint a, b, c, d, e, f, g, h;
- uint t1, t2;
- int i;
- uint[] buff;
-
- count += BLOCK_SIZE_BYTES;
-
- buff = new uint[64];
-
- for (i=0; i<16; i++) {
- buff[i] = ((uint)(inputBuffer[inputOffset+4*i]) << 24)
- | ((uint)(inputBuffer[inputOffset+4*i+1]) << 16)
- | ((uint)(inputBuffer[inputOffset+4*i+2]) << 8)
- | ((uint)(inputBuffer[inputOffset+4*i+3]));
- }
-
-
- for (i=16; i<64; i++) {
- buff[i] = Ro1(buff[i-2]) + buff[i-7] + Ro0(buff[i-15]) + buff[i-16];
- }
-
- a = _H[0];
- b = _H[1];
- c = _H[2];
- d = _H[3];
- e = _H[4];
- f = _H[5];
- g = _H[6];
- h = _H[7];
-
- for (i=0; i<64; i++) {
- t1 = h + Sig1(e) + Ch(e,f,g) + K[i] + buff[i];
- t2 = Sig0(a) + Maj(a,b,c);
- h = g;
- g = f;
- f = e;
- e = d + t1;
- d = c;
- c = b;
- b = a;
- a = t1 + t2;
- }
-
- _H[0] += a;
- _H[1] += b;
- _H[2] += c;
- _H[3] += d;
- _H[4] += e;
- _H[5] += f;
- _H[6] += g;
- _H[7] += h;
- }
-
- /// <summary>
- /// Pads and then processes the final block.
- /// Non-standard.
- /// </summary>
- /// <param name="inputBuffer">Buffer to grab data from.</param>
- /// <param name="inputOffset">Position in buffer in bytes to get data from.</param>
- /// <param name="inputCount">How much data in bytes in the buffer to use.</param>
- public void ProcessFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) {
- byte[] fooBuffer;
- int paddingSize;
- int i;
- uint size;
-
- paddingSize = (int)(56 - (inputCount + count) % BLOCK_SIZE_BYTES);
-
- if (paddingSize < 1)
- paddingSize += BLOCK_SIZE_BYTES;
-
- fooBuffer = new byte[inputCount+paddingSize+8];
-
- for (i=0; i<inputCount; i++) {
- fooBuffer[i] = inputBuffer[i+inputOffset];
- }
-
- fooBuffer[inputCount] = 0x80;
- for (i=inputCount+1; i<inputCount+paddingSize; i++) {
- fooBuffer[i] = 0x00;
- }
-
- size = (uint)(count+inputCount);
- size *= 8;
-
- fooBuffer[inputCount+paddingSize] = 0x00;
- fooBuffer[inputCount+paddingSize+1] = 0x00;
- fooBuffer[inputCount+paddingSize+2] = 0x00;
- fooBuffer[inputCount+paddingSize+3] = 0x00;
-
- fooBuffer[inputCount+paddingSize+4] = (byte)((size) >> 24);
- fooBuffer[inputCount+paddingSize+5] = (byte)((size) >> 16);
- fooBuffer[inputCount+paddingSize+6] = (byte)((size) >> 8);
- fooBuffer[inputCount+paddingSize+7] = (byte)((size) >> 0);
-
- ProcessBlock(fooBuffer, 0);
-
- if (inputCount+paddingSize+8 == 128) {
- ProcessBlock(fooBuffer, 64);
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384.cs
deleted file mode 100644
index 368d5d76ada..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA384.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography SHA384 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA384 iplementations.
- /// </summary>
- public abstract class SHA384 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- public SHA384 () {
-
- }
-
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA384 Create () {
- return new SHA384Managed();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA384 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
deleted file mode 100644
index d5679038c80..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA384Managed.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Security.Cryptography.SHA384Managed.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public class SHA384Managed : SHA384 {
- public SHA384Managed () {
- }
-
- public override void Initialize () {
- }
-
- // protected
-
- protected override void HashCore (byte[] rgb, int start, int count) {
- }
-
- protected override byte[] HashFinal () {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512.cs
deleted file mode 100644
index 49f266701e7..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA512.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.Security.Cryptography SHA512 Class implementation
-//
-// Authors:
-// Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
-//
-// Copyright 2001 by Matthew S. Ford.
-//
-
-
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Common base class for all derived SHA512 iplementations.
- /// </summary>
- public abstract class SHA512 : HashAlgorithm {
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- public SHA512 () {
-
- }
-
-
- /// <summary>
- /// Creates the default derived class.
- /// </summary>
- public static new SHA512 Create () {
- return new SHA512Managed();
- }
-
- /// <summary>
- /// Creates a new derived class.
- /// </summary>
- /// <param name="st">FIXME: No clue. Specifies which derived class to create?</param>
- [MonoTODO]
- public static new SHA512 Create (string st) {
- return Create();
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs b/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
deleted file mode 100644
index 3b3a010a2fe..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SHA512Managed.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Security.Cryptography.SHA512Managed.cs
-//
-// Authors:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- [MonoTODO]
- public class SHA512Managed : SHA512 {
- public SHA512Managed () {
- }
-
- public override void Initialize () {
- }
-
- // protected
-
- protected override void HashCore (byte[] rgb, int start, int count) {
- }
-
- protected override byte[] HashFinal () {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs b/mcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs
deleted file mode 100755
index f867f763316..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SignatureDescription.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// System.Security.Cryptography SignatureDescription Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-// LAMESPEC: documentation of this class is completely missing in the sdk doc
-// TODO: Implement AsymmetricSignatureFormatter & AsymmetricSignatureDeformatter methods
-
-using System;
-using System.Security;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// LAMESPEC: no sdk doc available for this class by the time of beta 2
- /// </summary>
- [MonoTODO]
- public class SignatureDescription {
- private string _DeformatterAlgorithm;
- private string _DigestAlgorithm;
- private string _FormatterAlgorithm;
- private string _KeyAlgorithm;
-
- /// <summary>
- /// LAMESPEC: no idea what param el should do??
- /// </summary>
- public SignatureDescription (SecurityElement el) {
- if (el == null)
- throw new CryptographicException();
- }
-
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string DeformatterAlgorithm {
- get {
- return _DeformatterAlgorithm;
- }
- set {
- _DeformatterAlgorithm = value;
- }
- }
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string DigestAlgorithm {
- get {
- return _DigestAlgorithm;
- }
- set {
- _DigestAlgorithm = value;
- }
- }
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string FormatterAlgorithm {
- get {
- return _FormatterAlgorithm;
- }
- set {
- _FormatterAlgorithm = value;
- }
- }
-
- /// <summary>
- /// LAMESPEC: what to do if setting null values?
- /// </summary>
- public string KeyAlgorithm {
- get {
- return _KeyAlgorithm;
- }
- set {
- _KeyAlgorithm = value;
- }
- }
-
- [MonoTODO]
- public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
- {
- // TODO: Implement
- return null;
- }
-
- /// <summary>
- /// Create the hash algorithm assigned with this object
- /// </summary>
- public virtual HashAlgorithm CreateDigest()
- {
- return HashAlgorithm.Create(_DigestAlgorithm);
- }
-
- [MonoTODO]
- public virtual AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key)
- {
- // TODO: Implement
- return null;
- }
-
- } // SignatureDescription
-
-} // System.Security.Cryptography
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs b/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
deleted file mode 100755
index 508c25d5810..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/SymmetricAlgorithm.cs
+++ /dev/null
@@ -1,256 +0,0 @@
-//
-// System.Security.Cryptography SymmetricAlgorithm Class implementation
-//
-// Authors:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-
-namespace System.Security.Cryptography {
-
- /// <summary>
- /// Abstract base class for all cryptographic symmetric algorithms.
- /// Available algorithms include:
- /// DES, RC2, Rijndael, TripleDES
- /// </summary>
- public abstract class SymmetricAlgorithm {
- protected int BlockSizeValue; // The block size of the cryptographic operation in bits.
- protected int FeedbackSizeValue; // The feedback size of the cryptographic operation in bits.
- protected byte[] IVValue; // The initialization vector ( IV) for the symmetric algorithm.
- protected int KeySizeValue; // The size of the secret key used by the symmetric algorithm in bits.
- protected byte[] KeyValue; // The secret key for the symmetric algorithm.
- protected KeySizes[] LegalBlockSizesValue; // Specifies the block sizes that are supported by the symmetric algorithm.
- protected KeySizes[] LegalKeySizesValue; // Specifies the key sizes that are supported by the symmetric algorithm.
- protected CipherMode ModeValue; // Represents the cipher mode used in the symmetric algorithm.
- protected PaddingMode PaddingValue; // Represents the padding mode used in the symmetric algorithm.
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- public SymmetricAlgorithm () {
- throw new CryptographicException();
- }
-
- /// <summary>
- /// Called from constructor of derived class.
- /// </summary>
- ~SymmetricAlgorithm () {
- if (KeyValue != null) {
- Array.Clear(KeyValue, 0, KeyValue.Length);
- KeyValue = null;
- }
- }
-
- /// <summary>
- /// Gets or sets the actual BlockSize
- /// </summary>
- public virtual int BlockSize {
- get {
- return this.BlockSizeValue;
- }
- set {
- if (IsLegalKeySize(this.LegalBlockSizesValue, value))
- this.BlockSizeValue = value;
- else
- throw new CryptographicException("block size not supported by algorithm");
- }
- }
-
- /// <summary>
- /// Gets or sets the actual FeedbackSize
- /// </summary>
- public virtual int FeedbackSize {
- get {
- return this.FeedbackSizeValue;
- }
- set {
- if (value > this.BlockSizeValue)
- throw new CryptographicException("feedback size larger than block size");
- else
- this.FeedbackSizeValue = value;
- }
- }
-
- /// <summary>
- /// Gets or sets the actual Initial Vector
- /// </summary>
- [MonoTODO]
- public virtual byte[] IV {
- get {
- if (this.IVValue == null)
- GenerateIV();
-
- return this.IVValue;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("tried setting initial vector to null");
-
- // FIXME: dont know if to compare with block or key size
- if (value.Length != this.KeySizeValue)
- throw new CryptographicException("tried setting initial vector with illegal size");
-
- this.IVValue = new byte [value.Length];
- System.Array.Copy (value, 0, this.IVValue, 0, value.Length);
- }
- }
-
- /// <summary>
- /// Gets or sets the actual key
- /// </summary>
- public virtual byte[] Key {
- get {
- if (this.KeyValue == null)
- GenerateKey();
-
- return this.KeyValue;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("tried setting key to null");
-
- if (!IsLegalKeySize(this.LegalKeySizesValue, value.Length))
- throw new CryptographicException("key size not supported by algorithm");
-
- this.KeySizeValue = value.Length;
- this.KeyValue = new byte [this.KeySizeValue];
- System.Array.Copy (value, 0, this.KeyValue, 0, this.KeySizeValue);
- }
- }
-
- /// <summary>
- /// Gets or sets the actual key size
- /// </summary>
- public virtual int KeySize {
- get {
- return this.KeySizeValue;
- }
- set {
- if (!IsLegalKeySize(this.LegalKeySizesValue, value))
- throw new CryptographicException("key size not supported by algorithm");
-
- this.KeyValue = null;
- this.KeySizeValue = value;
- }
- }
-
- /// <summary>
- /// Gets all legal block sizes
- /// </summary>
- public virtual KeySizes[] LegalBlockSizes {
- get {
- return this.LegalBlockSizesValue;
- }
- }
-
- /// <summary>
- /// Gets all legal key sizes
- /// </summary>
- public virtual KeySizes[] LegalKeySizes {
- get {
- return this.LegalKeySizesValue;
- }
- }
-
- /// <summary>
- /// Gets or sets the actual cipher mode
- /// </summary>
- public virtual CipherMode Mode {
- get {
- return this.ModeValue;
- }
- set {
- if (Enum.IsDefined(ModeValue.GetType(), value))
- this.ModeValue = value;
- else
- throw new CryptographicException("padding mode not available");
- }
- }
-
- /// <summary>
- /// Gets or sets the actual padding
- /// </summary>
- public virtual PaddingMode Padding {
- get {
- return this.PaddingValue;
- }
- set {
- if (Enum.IsDefined(PaddingValue.GetType(), value))
- this.PaddingValue = value;
- else
- throw new CryptographicException("padding mode not available");
- }
- }
-
- /// <summary>
- /// Gets an Decryptor transform object to work with a CryptoStream
- /// </summary>
- public virtual ICryptoTransform CreateDecryptor() {
- return CreateDecryptor(Key, IV);
- }
-
- /// <summary>
- /// Gets an Decryptor transform object to work with a CryptoStream
- /// </summary>
- public abstract ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV);
-
- /// <summary>
- /// Gets an Encryptor transform object to work with a CryptoStream
- /// </summary>
- public virtual ICryptoTransform CreateEncryptor() {
- return CreateEncryptor(Key, IV);
- }
-
- /// <summary>
- /// Gets an Encryptor transform object to work with a CryptoStream
- /// </summary>
- public abstract ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV);
-
- /// <summary>
- /// used to generate an inital vector if none is specified
- /// </summary>
- public abstract void GenerateIV();
-
- /// </summary>
- /// used to generate a random key if none is specified
- /// </summary>
- public abstract void GenerateKey();
-
- internal bool IsLegalKeySize(KeySizes[] LegalKeys, int Size) {
- foreach (KeySizes LegalKeySize in LegalKeys) {
- for (int i=LegalKeySize.MinSize; i<=LegalKeySize.MaxSize; i+=LegalKeySize.SkipSize) {
- if (i == Size)
- return true;
- }
- }
- return false;
- }
-
- /// <summary>
- /// Checks wether the given keyLength is valid for the current algorithm
- /// </summary>
- /// <param name="bitLength">the given keyLength</param>
- public bool ValidKeySize(int bitLength) {
- return IsLegalKeySize(LegalKeySizesValue, bitLength);
- }
-
- /// <summary>
- /// Creates the default implementation of the default symmetric algorithm (RC2).
- /// </summary>
- public static SymmetricAlgorithm Create () {
- return Rijndael.Create();
- }
-
- /// <summary>
- /// Creates a specific implementation of the given symmetric algorithm.
- /// </summary>
- /// <param name="algName">the given algorithm</param>
- [MonoTODO]
- public static SymmetricAlgorithm Create (string algName) {
- // TODO: Use Reflection to create a new algorithm instance
- return null;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs b/mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs
deleted file mode 100644
index 8f72bbee4ee..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/ToBase64Transform.cs
+++ /dev/null
@@ -1,234 +0,0 @@
-//
-// System.Security.Cryptography.ToBase64Transform
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.Security.Cryptography;
-
-
-namespace System.Security.Cryptography {
-
- public class ToBase64Transform : ICryptoTransform {
-
-
- /// <summary>
- /// Default constructor.
- /// </summary>
- public ToBase64Transform ()
- {
- }
-
-
- /// <summary>
- /// </summary>
- public bool CanTransformMultipleBlocks {
- get {
- return false;
- }
- }
-
-
- /// <summary>
- /// Returns the input block size for the Base64 encoder.
- /// </summary>
- /// <remarks>
- /// The returned value is always 3.
- /// </remarks>
- public int InputBlockSize {
- get {
- return 3;
- }
- }
-
-
- /// <summary>
- /// Returns the output block size for the Base64 encoder.
- /// </summary>
- /// <remarks>
- /// The value returned by this property is always 4.
- /// </remarks>
- public int OutputBlockSize {
- get {
- return 4;
- }
- }
-
-
- /// <summary>
- /// </summary>
- public int TransformBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount,
- byte [] outputBuffer,
- int outputOffset)
- {
- if (inputCount != this.InputBlockSize)
- throw new CryptographicException();
-
- byte [] lookup = Base64Table.EncodeTable;
-
- int b1 = inputBuffer [inputOffset];
- int b2 = inputBuffer [inputOffset + 1];
- int b3 = inputBuffer [inputOffset + 2];
-
- outputBuffer [outputOffset] = lookup [b1 >> 2];
- outputBuffer [outputOffset+1] = lookup [((b1 << 4) & 0x30) | (b2 >> 4)];
- outputBuffer [outputOffset+2] = lookup [((b2 << 2) & 0x3c) | (b3 >> 6)];
- outputBuffer [outputOffset+3] = lookup [b3 & 0x3f];
-
- return this.OutputBlockSize;
- }
-
-
-
-
- // LAMESPEC: It's not clear from Beta2 docs what should be
- // happening here if inputCount > InputBlockSize.
- // It just "Converts the specified region of the specified
- // byte array" and that's all.
- // Beta2 implementation throws some strange (and undocumented)
- // exception in such case. The exception is thrown by
- // System.Convert and not the method itself.
- // Anyhow, this implementation just encodes blocks of any size,
- // like any usual Base64 encoder.
-
- /// <summary>
- /// </summary>
- public byte [] TransformFinalBlock (byte [] inputBuffer,
- int inputOffset,
- int inputCount)
- {
- int blockLen = this.InputBlockSize;
- int outLen = this.OutputBlockSize;
- int fullBlocks = inputCount / blockLen;
- int tail = inputCount % blockLen;
-
- byte [] res = new byte [(inputCount != 0)
- ? ((inputCount + 2) / blockLen) * outLen
- : 0];
-
- int outputOffset = 0;
-
- for (int i = 0; i < fullBlocks; i++) {
-
- TransformBlock (inputBuffer, inputOffset,
- blockLen, res, outputOffset);
-
- inputOffset += blockLen;
- outputOffset += outLen;
- }
-
-
- byte [] lookup = Base64Table.EncodeTable;
- int b1,b2;
-
-
- // When fewer than 24 input bits are available
- // in an input group, zero bits are added
- // (on the right) to form an integral number of
- // 6-bit groups.
- switch (tail) {
- case 0:
- break;
- case 1:
- b1 = inputBuffer [inputOffset];
- res [outputOffset] = lookup [b1 >> 2];
- res [outputOffset+1] = lookup [(b1 << 4) & 0x30];
-
- // padding
- res [outputOffset+2] = (byte)'=';
- res [outputOffset+3] = (byte)'=';
- break;
-
- case 2:
- b1 = inputBuffer [inputOffset];
- b2 = inputBuffer [inputOffset + 1];
- res [outputOffset] = lookup [b1 >> 2];
- res [outputOffset+1] = lookup [((b1 << 4) & 0x30) | (b2 >> 4)];
- res [outputOffset+2] = lookup [(b2 << 2) & 0x3c];
-
- // one-byte padding
- res [outputOffset+3] = (byte)'=';
- break;
-
- default:
- break;
- }
-
- return res;
- }
-
-
-
- /// <summary>
- /// </summary>
- public override string ToString ()
- {
- return "mono::System.Security.Cryptography.ToBase64Transform";
- }
-
- } // ToBase64Transform
-
-
-
-
- [MonoTODO ("Put me in a separate file")]
- internal sealed class Base64Table {
-
- // This is the Base64 alphabet as described in RFC 2045
- // (Table 1, page 25).
- private static string ALPHABET =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
- private static byte[] encodeTable;
- private static byte[] decodeTable;
-
-
- static Base64Table ()
- {
- int len = ALPHABET.Length;
-
- encodeTable = new byte [len];
-
- for (int i=0; i < len; i++) {
- encodeTable [i] = (byte) ALPHABET [i];
- }
-
-
- decodeTable = new byte [1 + (int)'z'];
-
- for (int i=0; i < decodeTable.Length; i++) {
- decodeTable [i] = Byte.MaxValue;
- }
-
- for (int i=0; i < len; i++) {
- char ch = ALPHABET [i];
- decodeTable [(int)ch] = (byte) i;
- }
- }
-
-
- private Base64Table ()
- {
- // Never instantiated.
- }
-
-
- internal static byte [] EncodeTable {
- get {
- return encodeTable;
- }
- }
-
- internal static byte [] DecodeTable {
- get {
- return decodeTable;
- }
- }
-
- } // Base64Table
-
-} // System.Security.Cryptography
diff --git a/mcs/class/corlib/System.Security.Cryptography/X509Certificates.cs b/mcs/class/corlib/System.Security.Cryptography/X509Certificates.cs
deleted file mode 100755
index 342b0cacf31..00000000000
--- a/mcs/class/corlib/System.Security.Cryptography/X509Certificates.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Serializable]
- public class X509Certificate {
- internal X509Certificate () {}
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Permissions/ChangeLog b/mcs/class/corlib/System.Security.Permissions/ChangeLog
deleted file mode 100644
index bb38b4adff4..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ChangeLog
+++ /dev/null
@@ -1,68 +0,0 @@
-2002-03-12 Duncan Mak <duncan@ximian.com>
-
- * SiteIdentityPermissionAttribute.cs:
- * UIPermissionAttribute.cs: These should inherit from
- CodeAccessSecurityAttribute, not IsolatedStoragePermissionAttribute.
-
-2002-02-17 Duncan Mak <duncan@ximian.com>
-
- * FileDialogPermissionAccess.cs: Add in namespace declaration, so
- that this one little unique enum wouldn't show up in the System
- namespace when we ildasm corlib.dll ;-) Oops, my bad.
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * SecurityPermission.cs,
- IsolatedStoragePermissionAttribute.cs: New files
-
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * FileDialogPermissionAccess.cs: Add to CVS.
-
-2002-01-20 Duncan Mak <duncan@ximian.com>
-
- * *Attribute.cs: Implemented all the properties in the attributes
- and removed the relevent MonoTODO attributes.
-
- * *Attribute.cs: Fixed indentation.
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * EnvironmentPermissionAttribute.cs:
- * FileDialogPermissionAttribute.cs:
- * FileIOPermissionAttribute.cs:
- * IsolatedStorageAttribute.cs:
- * IsolatedStorageFilePermissionAttribute.cs:
- * PermissionSetAttribute.cs:
- * PrinciplePermissionAttribute.cs:
- * ReflectionPermissionAttribute.cs:
- * RegistryPermissionAttribute.cs:
- * SiteIdentityPermissionAttribute.cs:
- * StrongNamePermissionAttribute.cs:
- * UIPermissionAttribute.cs:
- * UrlIdentityPermissionAttribute.cs:
- * ZoneIdentityPermissionAttribute.cs: New files. Stubbed out with MonoTODOs
-
- * Note: These are all the Attributes in the
- System.Security.Permissions namespace. The only missing one is
- PublishIdentityPermissionAttribute.cs because we don't have
- anything for the X509Certificate class.
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermission.cs: New file. Implemented.
-
-2002-01-08 Nick Drochak <ndrochak@gol.com>
-
- * CodeAccessSecurityAttribute.cs, SecurityAttribute.cs,
- SecurityPermissionAttribute.cs: New Files
-
- * SecurityPermissionFlag.cs: Add missing enum values
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * IUnrestrictedPermission.cs: Added missing interface class
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * EnvironmentPermissionAccess.cs, FileIOPermissionAccess.cs, ReflectionPermissionFlag.cs: Add.
diff --git a/mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs b/mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs
deleted file mode 100644
index ced28962930..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/CodeAccessSecurityAttribute.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.SecurityPermissionAttribute.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [System.AttributeUsage(
- System.AttributeTargets.Assembly
- | System.AttributeTargets.Class
- | System.AttributeTargets.Struct
- | System.AttributeTargets.Constructor
- | System.AttributeTargets.Method,
- AllowMultiple=true,
- Inherited=false)
- ]
- [Serializable]
- public abstract class CodeAccessSecurityAttribute : SecurityAttribute {
-
- public CodeAccessSecurityAttribute(SecurityAction action) : base(action) {}
-
- } // public abstract class CodeAccessSecurityAttribute
-} // namespace System.Security.Permissions
-
diff --git a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs
deleted file mode 100644
index 06517ebc7c6..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAccess.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// EnvironmentPermissionAccess.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:29:59 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum EnvironmentPermissionAccess {
-
- /// <summary>
- /// </summary>
- NoAccess = 0x00000000,
-
- /// <summary>
- /// </summary>
- Read = 0x00000001,
-
- /// <summary>
- /// </summary>
- Write = 0x00000002,
-
- /// <summary>
- /// </summary>
- AllAccess = Read | Write,
- } // EnvironmentPermissionAccess
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs
deleted file mode 100644
index 3b16e90eb16..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/EnvironmentPermissionAttribute.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// System.Security.Permissions.EnvironmentPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class EnvironmentPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string all;
- private string read;
- private string write;
-
- // Constructor
- public EnvironmentPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string All
- {
- set { all = value; }
- }
-
- public string Read
- {
- get { return read; }
- set { read = value; }
- }
-
- public string Write
- {
- get { return write; }
- set { write = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs
deleted file mode 100644
index d2196cba0b3..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAccess.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// System.Security.Permissions.FileDialogPermissionAccess
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System.Security.Permissions
-{
- [Flags] [Serializable]
- public enum FileDialogPermissionAccess
- {
- None = 0,
- Open = 1,
- Save = 2,
- OpenSave = 3,
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs
deleted file mode 100644
index 58ee4a5fe0a..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileDialogPermissionAttribute.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// System.Security.Permissions.FileDialogPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class FileDialogPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private bool canOpen;
- private bool canSave;
-
- // Constructor
- public FileDialogPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public bool Open
- {
- get { return canOpen; }
- set { canOpen = value; }
- }
-
- public bool Save
- {
- get { return canSave; }
- set { canSave = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs b/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs
deleted file mode 100644
index 57a7ede89bc..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileIOPermission.cs
+++ /dev/null
@@ -1,411 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.FileIOPermission.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-09
-//
-//------------------------------------------------------------------------------
-
-using System.Collections;
-using System.Text;
-using System.Security.Permissions;
-using System.IO;
-
-namespace System.Security.Permissions {
-
- [SerializableAttribute()]
- public sealed class FileIOPermission : CodeAccessPermission, IUnrestrictedPermission {
-
- private static char[] m_badCharacters = {'\"','<', '>', '|', '*', '?'};
- private bool m_Unrestricted = false;
- private Hashtable m_PathList = new Hashtable();
- private FileIOPermissionAccess m_AllFilesAccess = FileIOPermissionAccess.NoAccess;
- private FileIOPermissionAccess m_AllLocalFilesAccess = FileIOPermissionAccess.NoAccess;
-
- public FileIOPermission(PermissionState state) {
- if (!Enum.IsDefined(typeof(PermissionState), state)){
- throw new ArgumentException("Invalid permission state.", "state");
- }
- m_Unrestricted = (PermissionState.Unrestricted == state);
- if (m_Unrestricted) {
- m_AllFilesAccess = FileIOPermissionAccess.AllAccess;
- m_AllLocalFilesAccess = FileIOPermissionAccess.AllAccess;
- }
- }
-
- public FileIOPermission(FileIOPermissionAccess access, string path){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
-
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Illegal characters found in input. Security checks can not contain wild card characters.", "path");
- }
-
- AddPathList(access, path);
- }
-
- public FileIOPermission(FileIOPermissionAccess access, string[] pathList){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
-
- AddPathList(access, pathList);
- }
-
- public FileIOPermissionAccess AllFiles {
- get {
- return m_AllFilesAccess;
- }
- set {
- // if we are already set to unrestricted, don't change this property
- if (!m_Unrestricted){
- m_AllFilesAccess = value;
- }
- }
- }
-
- public FileIOPermissionAccess AllLocalFiles {
- get {
- return m_AllLocalFilesAccess;
- }
- set {
- // if we are already set to unrestricted, don't change this property
- if (!m_Unrestricted){
- m_AllLocalFilesAccess = value;
- }
- }
- }
-
- public void AddPathList(FileIOPermissionAccess access, string path){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: {0}.",access.ToString());
- }
-
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Invalid characters in path: '{0}'", path);
- }
-
- // LAMESPEC: docs don't say it must be a rooted path, but the MS implementation enforces it, so we will too.
- if(!Path.IsPathRooted(path)) {
- throw new ArgumentException("Absolute path information is required.");
- }
-
- // don't add the same path twice, instead overwrite access entry for that path
- if (m_PathList.ContainsKey(path)) {
- FileIOPermissionAccess currentPermission = (FileIOPermissionAccess)m_PathList[path];
- currentPermission |= access;
- m_PathList[path] = currentPermission;
- }
- else {
- m_PathList.Add(path, access);
- }
- }
-
- public void AddPathList(FileIOPermissionAccess access, string[] pathList ){
- foreach(string path in pathList){
- AddPathList(access, path);
- }
-
- }
-
- // private constructor used by Copy() method
- private FileIOPermission(Hashtable pathList, FileIOPermissionAccess allFiles,
- FileIOPermissionAccess allLocalFiles, bool unrestricted){
- m_PathList = pathList;
- m_AllFilesAccess = allFiles;
- m_AllLocalFilesAccess = allLocalFiles;
- m_Unrestricted = unrestricted;
- }
-
- public override IPermission Copy(){
- if (m_Unrestricted) {
- return new FileIOPermission(PermissionState.Unrestricted);
- }
- else{
- FileIOPermission retVal = new FileIOPermission(m_PathList, m_AllFilesAccess, m_AllLocalFilesAccess, m_Unrestricted);
- return retVal;
- }
- }
-
- /* XML Schema for FileIOPermission
- <IPermission class=”FileIOPermission”
- version=”1”
- (
- Read=”[list of files or folders]” |
- Write=”[list of files or folders]” |
- Append=”[list of files or folders]”
- ) v Unrestricted=”true”
- />
- */
- public override void FromXml(SecurityElement esd){
- if (null == esd) {
- throw new ArgumentNullException();
- }
- if (esd.Tag != "IPermission" || (string)esd.Attributes["class"] != "FileIOPermission"
- || (string)esd.Attributes["version"] != "1"){
- throw new ArgumentException("Not a valid permission element");
- }
- m_PathList.Clear();
- if ("true" == (string)esd.Attributes["Unrestricted"]){
- m_Unrestricted = true;
- }
- else{
- m_Unrestricted = false;
- string fileList;
- fileList = (string)esd.Attributes["Read"];
- string[] files;
- if (fileList != null){
- files = fileList.Split(';');
- AddPathList(FileIOPermissionAccess.Read, files);
- }
- fileList = (string)esd.Attributes["Write"];
- if (fileList != null){
- files = fileList.Split(';');
- AddPathList(FileIOPermissionAccess.Write, files);
- }
- fileList = (string)esd.Attributes["Append"];
- if (fileList != null){
- files = fileList.Split(';');
- AddPathList(FileIOPermissionAccess.Append, files);
- }
- }
- }
-
- public string[] GetPathList(FileIOPermissionAccess access){
- //LAMESPEC: docs says it returns (semicolon separated) list, but return
- //type is array. I think docs are wrong and it just returns an array
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
-
- ArrayList matchingPaths = new ArrayList();
- System.Collections.IDictionaryEnumerator pathListIterator = m_PathList.GetEnumerator();
- while (pathListIterator.MoveNext()) {
- if (((FileIOPermissionAccess)pathListIterator.Value & access) != 0) {
- matchingPaths.Add((string)pathListIterator.Key);
- }
- }
- if (matchingPaths.Count == 0) {
- return null;
- }
- else {
- return (string[])matchingPaths.ToArray(typeof(string));
- }
- }
-
- public override IPermission Intersect(IPermission target){
- if (null == target){
- return null;
- }
- else {
- if (target.GetType() != typeof(FileIOPermission)){
- throw new ArgumentException();
- }
- }
- FileIOPermission FIOPTarget = (FileIOPermission)target;
- if (FIOPTarget.IsUnrestricted() && m_Unrestricted){
- return new FileIOPermission(PermissionState.Unrestricted);
- }
- else if (FIOPTarget.IsUnrestricted()){
- return Copy();
- }
- else if (m_Unrestricted){
- return FIOPTarget.Copy();
- }
- else{
- FileIOPermission retVal = new FileIOPermission(PermissionState.None);
- retVal.AllFiles = m_AllFilesAccess & FIOPTarget.AllFiles;
- retVal.AllLocalFiles = m_AllLocalFilesAccess & FIOPTarget.AllLocalFiles;
-
- string[] paths;
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Append);
- if (null != paths) {
- foreach (string path in paths){
- if (m_PathList.ContainsKey(path)
- && ((FileIOPermissionAccess)m_PathList[path] & FileIOPermissionAccess.Append) != 0){
- retVal.AddPathList(FileIOPermissionAccess.Append, path);
- }
- }
- }
-
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Read);
- if (null != paths) {
- foreach (string path in paths){
- if (m_PathList.ContainsKey(path)
- && ((FileIOPermissionAccess)m_PathList[path] & FileIOPermissionAccess.Read) != 0){
- retVal.AddPathList(FileIOPermissionAccess.Read, path);
- }
- }
- }
-
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Write);
- if (null != paths) {
- foreach (string path in paths){
- if (m_PathList.ContainsKey(path)
- && ((FileIOPermissionAccess)m_PathList[path] & FileIOPermissionAccess.Write) != 0){
- retVal.AddPathList(FileIOPermissionAccess.Write, path);
- }
- }
- }
-
- return retVal;
- }
- }
-
-
- public override bool IsSubsetOf(IPermission target){
- // X.IsSubsetOf(Y) is true if permission Y includes everything allowed by X.
- if (target != null && target.GetType() != typeof(FileIOPermission)){
- throw new ArgumentException();
- }
- FileIOPermission FIOPTarget = (FileIOPermission)target;
- if (FIOPTarget.IsUnrestricted()){
- return true;
- }
- else if (m_Unrestricted){
- return false;
- }
- else if ((m_AllFilesAccess & FIOPTarget.AllFiles) != m_AllFilesAccess) {
- return false;
- }
- else if ((m_AllLocalFilesAccess & FIOPTarget.AllLocalFiles) != m_AllLocalFilesAccess) {
- return false;
- }
- else{
- string[] pathsNeeded;
- string[] pathsInTarget;
-
- pathsNeeded = GetPathList(FileIOPermissionAccess.Append);
- if (null != pathsNeeded) {
- pathsInTarget = FIOPTarget.GetPathList(FileIOPermissionAccess.Append);
- foreach (string path in pathsNeeded){
- if (Array.IndexOf(pathsInTarget, path) <0) {
- return false;
- }
- }
- }
-
- pathsNeeded = GetPathList(FileIOPermissionAccess.Read);
- if (null != pathsNeeded) {
- pathsInTarget = FIOPTarget.GetPathList(FileIOPermissionAccess.Read);
- foreach (string path in pathsNeeded){
- if (Array.IndexOf(pathsInTarget, path) <0) {
- return false;
- }
- }
- }
-
- pathsNeeded = GetPathList(FileIOPermissionAccess.Write);
- if (null != pathsNeeded) {
- pathsInTarget = FIOPTarget.GetPathList(FileIOPermissionAccess.Write);
- foreach (string path in pathsNeeded){
- if (Array.IndexOf(pathsInTarget, path) <0) {
- return false;
- }
- }
- }
-
- return true;
- }
- }
-
- public bool IsUnrestricted(){
- return m_Unrestricted;
- }
-
- public void SetPathList(FileIOPermissionAccess access, string path){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Invalid characters in path: '{0}'", path);
- }
-
- m_PathList.Clear();
- AddPathList(access, path);
- }
-
- public void SetPathList(FileIOPermissionAccess access, string[] pathList){
- if ((FileIOPermissionAccess.AllAccess & access) != access){
- throw new ArgumentException("Illegal enum value: "+access.ToString()+".");
- }
- foreach(string path in pathList){
- if (path.LastIndexOfAny(m_badCharacters) >= 0){
- throw new ArgumentException("Invalid characters in path entry: '{0}'", path);
- }
- }
-
- m_PathList.Clear();
- AddPathList(access, pathList);
- }
-
- public override SecurityElement ToXml(){
- //Encode the the current permission to XML using the
- //security element class.
- SecurityElement element = new SecurityElement("IPermission");
- Type type = this.GetType();
- StringBuilder AsmName = new StringBuilder(type.Assembly.ToString());
- AsmName.Replace('\"', '\'');
- element.AddAttribute("class", type.FullName + ", " + AsmName);
- element.AddAttribute("version", "1");
- if(m_Unrestricted){
- element.AddAttribute("Unrestricted", "true");
- }
- else {
- string[] paths;
- paths = GetPathList(FileIOPermissionAccess.Append);
- if (null != paths && paths.Length >0){
- element.AddAttribute("Append", String.Join(";",paths));
- }
- paths = GetPathList(FileIOPermissionAccess.Read);
- if (null != paths && paths.Length >0){
- element.AddAttribute("Read", String.Join(";",paths));
- }
- paths = GetPathList(FileIOPermissionAccess.Write);
- if (null != paths && paths.Length >0){
- element.AddAttribute("Write", String.Join(";",paths));
- }
- }
- return element;
- }
-
- public override IPermission Union(IPermission other){
- if (null == other){
- return null;
- }
- else {
- if (other.GetType() != typeof(FileIOPermission)){
- throw new ArgumentException();
- }
- }
- FileIOPermission FIOPTarget = (FileIOPermission)other;
- if (FIOPTarget.IsUnrestricted() || m_Unrestricted){
- return new FileIOPermission(PermissionState.Unrestricted);
- }
- else{
- FileIOPermission retVal = (FileIOPermission)Copy();
- retVal.AllFiles |= FIOPTarget.AllFiles;
- retVal.AllLocalFiles |= FIOPTarget.AllLocalFiles;
- string[] paths;
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Append);
- if (null != paths){
- retVal.AddPathList(FileIOPermissionAccess.Append, paths);
- }
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Read);
- if (null != paths){
- retVal.AddPathList(FileIOPermissionAccess.Read, paths);
- }
- paths = FIOPTarget.GetPathList(FileIOPermissionAccess.Write);
- if (null != paths){
- retVal.AddPathList(FileIOPermissionAccess.Write, paths);
- }
- return retVal;
- }
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs
deleted file mode 100644
index dd255cd3b1c..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAccess.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// FileIOPermissionAccess.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:30:11 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum FileIOPermissionAccess {
-
- /// <summary>
- /// </summary>
- NoAccess = 0x00000000,
-
- /// <summary>
- /// </summary>
- Read = 0x00000001,
-
- /// <summary>
- /// </summary>
- Write = 0x00000002,
-
- /// <summary>
- /// </summary>
- Append = 0x00000004,
-
- /// <summary>
- /// </summary>
- PathDiscovery = 0x00000008,
-
- /// <summary>
- /// </summary>
- AllAccess = Read | Write | Append | PathDiscovery,
- } // FileIOPermissionAccess
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs
deleted file mode 100644
index 64540caf30a..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/FileIOPermissionAttribute.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// System.Security.Permissions.FileIOPermissionAttribute.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class FileIOPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string all;
- private string append;
- private string path;
- private string read;
- private string write;
-
- // Constructor
- public FileIOPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string All
- {
- set { all = value; }
- }
-
- public string Append
- {
- get { return append; }
- set { append = value; }
- }
-
- public string PathDiscovery
- {
- get { return path; }
- set { path = value; }
- }
-
- public string Read
- {
- get { return read; }
- set { read = value; }
- }
-
- public string Write
- {
- get { return write; }
- set { write = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs b/mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs
deleted file mode 100644
index f9b6b9eae0e..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IUnrestrictedPermission.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Security.Permissions.IUnrestrictedPermission.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security.Permissions {
-
- public interface IUnrestrictedPermission {
- bool IsUnrestricted();
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs
deleted file mode 100755
index 391e3e7dc7b..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageContainment.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// IsolatedStorageContainment.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:41:57 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
- [Serializable]
- public enum IsolatedStorageContainment
- {
- None = 0x00,
- DomainIsolationByUser = 0x10,
- AssemblyIsolationByUser = 0x20,
- DomainIsolationByRoamingUser = 0x50,
- AssemblyIsolationByRoamingUser = 0x60,
- AdministerIsolatedStorageByUser = 0x70,
- UnrestrictedIsolatedStorage = 0xF0,
- };
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs
deleted file mode 100644
index a9a879f06fc..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.Security.Permissions.IsolatedStorageFilePermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
-
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class IsolatedStorageFilePermissionAttribute : IsolatedStoragePermissionAttribute
- {
- // Constructor
- public IsolatedStorageFilePermissionAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs
deleted file mode 100644
index 907d7de3615..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermission.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// System.Security.Permissions.IsolatedStoragePermission.cs
-//
-// Piers Haken <piersh@friskit.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [Serializable]
- public abstract class IsolatedStoragePermission : CodeAccessPermission, IUnrestrictedPermission
- {
- internal long m_userQuota;
- internal long m_machineQuota;
- internal long m_expirationDays;
- internal bool m_permanentData;
- internal IsolatedStorageContainment m_allowed;
-
- public IsolatedStoragePermission (PermissionState state)
- {
- if (state == PermissionState.None)
- {
- m_userQuota = 0;
- m_machineQuota = 0;
- m_expirationDays = 0;
- m_permanentData = false;
- m_allowed = IsolatedStorageContainment.None;
- }
- else if (state == PermissionState.Unrestricted)
- {
- m_userQuota = Int64.MaxValue;
- m_machineQuota = Int64.MaxValue;
- m_expirationDays = Int64.MaxValue ;
- m_permanentData = true;
- m_allowed = IsolatedStorageContainment.UnrestrictedIsolatedStorage;
- }
- else
- {
- throw new ArgumentException("Invalid Permission state");
- }
- }
-
- public long UserQuota
- {
- set { m_userQuota = value; }
- get { return m_userQuota; }
- }
-
-
- public IsolatedStorageContainment UsageAllowed
- {
- set { m_allowed = value; }
- get { return m_allowed; }
- }
-
-
- public bool IsUnrestricted ()
- {
- return IsolatedStorageContainment.UnrestrictedIsolatedStorage == m_allowed;
- }
-
- [MonoTODO]
- public override SecurityElement ToXml ()
- {
- throw new NotImplementedException ();
- }
-
-
- [MonoTODO]
- public override void FromXml (SecurityElement esd)
- {
- throw new NotImplementedException ();
- }
- }
-}
-
-
-
-
-
diff --git a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs
deleted file mode 100644
index 21563b6b516..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/IsolatedStoragePermissionAttribute.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// System.Security.Permissions.IsolatedStoragePermissionAttributes.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
-
- [AttributeUsage ( AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public abstract class IsolatedStoragePermissionAttribute : CodeAccessSecurityAttribute {
-
- public IsolatedStoragePermissionAttribute (SecurityAction action) : base (action) {
- }
-
- public IsolatedStorageContainment UsageAllowed {
- get { return usage_allowed; }
- set { usage_allowed = value; }
- }
-
- public long UserQuota {
- get { return user_quota; }
- set { user_quota = value; }
- }
-
- [MonoTODO]
- public override IPermission CreatePermission () {
- return null;
- }
-
- // private
-
- private IsolatedStorageContainment usage_allowed;
- private long user_quota;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs b/mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs
deleted file mode 100644
index ee654f7e00b..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/PermissionSetAttribute.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// System.Security.Permissions.PermissionSetAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class PermissionSetAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string file;
- private string name;
- private bool isUnicodeEncoded;
- private string xml;
-
- // Constructor
- public PermissionSetAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Properties
- public string File
- {
- get { return file; }
- set { file = value; }
- }
-
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
-
- public bool UnicodeEncoded
- {
- get { return isUnicodeEncoded; }
- set { isUnicodeEncoded = value; }
- }
-
- public string XML
- {
- get { return xml; }
- set { xml = value; }
- }
-
- // Methods
- public override IPermission CreatePermission ()
- {
- return null; // Not used, used for inheritance from SecurityAttribute
- }
-
- [MonoTODO]
- public PermissionSet CreatePermissionSet ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/PermissionState.cs b/mcs/class/corlib/System.Security.Permissions/PermissionState.cs
deleted file mode 100755
index 66c3d03eb6f..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/PermissionState.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// PermissionState.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:30:05 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum PermissionState {
-
- /// <summary>
- /// </summary>
- Unrestricted = 1,
-
- /// <summary>
- /// </summary>
- None = 0,
- } // PermissionState
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs
deleted file mode 100644
index fee707d002d..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/PrincipalPermissionAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Security.Permissions.PrincipalPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class PrincipalPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private bool authenticated;
- private string name;
- private string role;
-
- // Constructor
- public PrincipalPermissionAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Properties
- [MonoTODO]
- public bool Authenticated
- {
- get { return authenticated; }
- set { authenticated = value; }
- }
-
- [MonoTODO]
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
-
- [MonoTODO]
- public string Role
- {
- get { return role; }
- set { role = value; }
- }
-
- // Method
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs
deleted file mode 100644
index b7a94b4c29d..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Security.Permissions.ReflectionPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class ReflectionPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private ReflectionPermissionFlag flags;
- private bool memberAccess;
- private bool reflectionEmit;
- private bool typeInfo;
-
- //Constructor
- public ReflectionPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public ReflectionPermissionFlag Flags
- {
- get { return flags; }
- set { flags = value; }
- }
-
- public bool MemberAccess
- {
- get { return memberAccess; }
- set { memberAccess = value; }
- }
-
- public bool ReflectionEmit
- {
- get { return reflectionEmit; }
- set { reflectionEmit = value; }
- }
-
- public bool TypeInformation
- {
- get { return typeInfo; }
- set { typeInfo = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs b/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs
deleted file mode 100644
index 21d29d46254..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionFlag.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// ReflectionPermissionFlag.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:31:14 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ReflectionPermissionFlag {
-
- /// <summary>
- /// </summary>
- NoFlags = 0x00000000,
-
- /// <summary>
- /// </summary>
- TypeInformation = 0x00000001,
-
- /// <summary>
- /// </summary>
- MemberAccess = 0x00000002,
-
- /// <summary>
- /// </summary>
- ReflectionEmit = 0x4,
-
- /// <summary>
- /// </summary>
- AllFlags = TypeInformation | MemberAccess | ReflectionEmit,
- } // ReflectionPermissionFlag
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs b/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs
deleted file mode 100755
index f45f481390a..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAccess.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// RegistryPermissionAccess.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:42:13 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum RegistryPermissionAccess {
-
- /// <summary>
- /// </summary>
- NoAccess = 0,
-
- /// <summary>
- /// </summary>
- Read = 1,
-
- /// <summary>
- /// </summary>
- Write = 2,
-
- /// <summary>
- /// </summary>
- Create = 4,
-
- /// <summary>
- /// </summary>
- AllAccess = 7,
- } // RegistryPermissionAccess
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs
deleted file mode 100644
index 3ab3eeb160d..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/RegistryPermissionAttribute.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.Security.Permissions.RegistryPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class RegistryPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string all;
- private string create;
- private string read;
- private string write;
-
- // Constructor
- public RegistryPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string All
- {
- set { all = value; }
- }
-
- public string Create
- {
- get { return create; }
- set { create = value; }
- }
-
- public string Read
- {
- get { return read; }
- set { read = value; }
- }
-
- public string Write
- {
- get { return write; }
- set { write = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs b/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
deleted file mode 100755
index 7cd81e1c500..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityAction.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// SecurityAction.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:29:52 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum SecurityAction {
-
- /// <summary>
- /// </summary>
- Demand = 2,
-
- /// <summary>
- /// </summary>
- Assert = 3,
-
- /// <summary>
- /// </summary>
- Deny = 4,
-
- /// <summary>
- /// </summary>
- PermitOnly = 5,
-
- /// <summary>
- /// </summary>
- LinkDemand = 6,
-
- /// <summary>
- /// </summary>
- InheritanceDemand = 7,
-
- /// <summary>
- /// </summary>
- RequestMinimum = 8,
-
- /// <summary>
- /// </summary>
- RequestOptional = 9,
-
- /// <summary>
- /// </summary>
- RequestRefuse = 10,
- } // SecurityAction
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs b/mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs
deleted file mode 100644
index d914835f140..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityAttribute.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.SecurityPermissionAttribute.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
- [System.AttributeUsage(
- System.AttributeTargets.Assembly
- | System.AttributeTargets.Class
- | System.AttributeTargets.Struct
- | System.AttributeTargets.Constructor
- | System.AttributeTargets.Method,
- AllowMultiple=true,
- Inherited=false)
- ]
-
- [Serializable]
- public abstract class SecurityAttribute : Attribute {
-
- private SecurityAction m_Action;
- private bool m_Unrestricted;
-
- public SecurityAttribute(SecurityAction action) {
- if (!SecurityAction.IsDefined(typeof(SecurityAction), action)) {
- throw new System.ArgumentException();
- }
- }
-
- public abstract IPermission CreatePermission();
-
- public bool Unrestricted {
- get {
- return m_Unrestricted;
- }
- set {
- m_Unrestricted = value;
- }
- }
-
- public SecurityAction Action {
- get {
- return m_Action;
- }
- set {
- m_Action = value;
- }
- }
- } // public abstract class SecurityAttribute
-} // namespace System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs b/mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs
deleted file mode 100644
index 9a6a32ab25f..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityPermission.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Security.Permissions.SecurityPermission.cs
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
-
- [MonoTODO]
- [Serializable]
- public sealed class SecurityPermission :
- CodeAccessPermission, IUnrestrictedPermission
- {
- public SecurityPermission (PermissionState state) {
- this.flags = SecurityPermissionFlag.NoFlags;
- }
-
- public SecurityPermission (SecurityPermissionFlag flags) {
- this.flags = flags;
- }
-
- public SecurityPermissionFlag Flags {
- get { return flags; }
- set { flags = value; }
- }
-
- public bool IsUnrestricted () {
- return false;
- }
-
- public override IPermission Copy () {
- return null;
- }
-
- public override IPermission Intersect (IPermission target) {
- return null;
- }
-
- public override IPermission Union (IPermission target) {
- return null;
- }
-
- public override bool IsSubsetOf (IPermission target) {
- return false;
- }
-
- public override void FromXml (SecurityElement e) {
- }
-
- public override SecurityElement ToXml () {
- return null;
- }
-
- // private
-
- private SecurityPermissionFlag flags;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs
deleted file mode 100644
index 868b199f267..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionAttribute.cs
+++ /dev/null
@@ -1,216 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Security.Permissions.SecurityPermissionAttribute.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions {
- [System.AttributeUsage(
- System.AttributeTargets.Assembly
- | System.AttributeTargets.Class
- | System.AttributeTargets.Struct
- | System.AttributeTargets.Constructor
- | System.AttributeTargets.Method,
- AllowMultiple=true,
- Inherited=false)
- ]
- public sealed class SecurityPermissionAttribute : CodeAccessSecurityAttribute {
- private SecurityPermissionFlag m_Flags = SecurityPermissionFlag.NoFlags;
-
- public SecurityPermissionAttribute(SecurityAction action) : base(action) {
- if (!SecurityAction.IsDefined(typeof(SecurityAction), action)) {
- throw new System.ArgumentException();
- }
- }
-
- public bool Assertion {
- get{
- return ((m_Flags & SecurityPermissionFlag.Assertion) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.Assertion;
- }
- else{
- m_Flags -= SecurityPermissionFlag.Assertion;
- }
- }
- }
-
- public bool ControlAppDomain {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlAppDomain) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlAppDomain;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlAppDomain;
- }
- }
- }
-
- public bool ControlDomainPolicy {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlDomainPolicy) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlDomainPolicy;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlDomainPolicy;
- }
- }
- }
-
- public bool ControlEvidence {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlEvidence) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlEvidence;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlEvidence;
- }
- }
- }
-
- public bool ControlPolicy {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlPolicy) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlPolicy;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlPolicy;
- }
- }
- }
-
- public bool ControlPrincipal {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlPrincipal) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlPrincipal;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlPrincipal;
- }
- }
- }
-
- public bool ControlThread {
- get{
- return ((m_Flags & SecurityPermissionFlag.ControlThread) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.ControlThread;
- }
- else{
- m_Flags -= SecurityPermissionFlag.ControlThread;
- }
- }
- }
-
- public bool Execution {
- get{
- return ((m_Flags & SecurityPermissionFlag.Execution) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.Execution;
- }
- else{
- m_Flags -= SecurityPermissionFlag.Execution;
- }
- }
- }
-
- public bool Infrastructure {
- get{
- return ((m_Flags & SecurityPermissionFlag.Infrastructure) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.Infrastructure;
- }
- else{
- m_Flags -= SecurityPermissionFlag.Infrastructure;
- }
- }
- }
-
- public bool RemotingConfiguration {
- get{
- return ((m_Flags & SecurityPermissionFlag.RemotingConfiguration) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.RemotingConfiguration;
- }
- else{
- m_Flags -= SecurityPermissionFlag.RemotingConfiguration;
- }
- }
- }
-
- public bool SerializationFormatter {
- get{
- return ((m_Flags & SecurityPermissionFlag.SerializationFormatter) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.SerializationFormatter;
- }
- else{
- m_Flags -= SecurityPermissionFlag.SerializationFormatter;
- }
- }
- }
-
- public bool SkipVerification {
- get{
- return ((m_Flags & SecurityPermissionFlag.SkipVerification) != 0);
- }
- set{
- if (value){
- m_Flags |= SecurityPermissionFlag.SkipVerification;
- }
- else{
- m_Flags -= SecurityPermissionFlag.SkipVerification;
- }
- }
- }
-
- public override IPermission CreatePermission() {
- return new SecurityPermission(m_Flags);
- }
-
- public SecurityPermissionFlag Flags {
- get {
- return m_Flags;
- }
- set {
- m_Flags = value;
- }
- }
- } // public sealed class SecurityPermissionAttribute
-} // namespace System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs b/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs
deleted file mode 100755
index dbd51caecfe..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SecurityPermissionFlag.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-// SecurityPermissionFlag.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:30:18 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum SecurityPermissionFlag {
-
- /// <summary>
- /// </summary>
- NoFlags = 0x00000000,
-
- /// <summary>
- /// </summary>
- Assertion = 0x00000001,
-
- /// <summary>
- /// </summary>
- UnmanagedCode = 0x00000002,
-
- /// <summary>
- /// </summary>
- SkipVerification = 0x00000004,
-
- /// <summary>
- /// </summary>
- Execution = 0x00000008,
-
- /// <summary>
- /// </summary>
- ControlThread = 0x00000010,
-
- ControlEvidence = 0x00000020,
-
- ControlPolicy = 0x00000040,
-
- SerializationFormatter = 0x00000080,
-
- ControlDomainPolicy = 0x00000100,
-
- ControlPrincipal = 0x00000200,
-
- ControlAppDomain = 0x00000400,
-
- RemotingConfiguration = 0x00000800,
-
- Infrastructure = 0x00001000,
-
- /// <summary>
- /// </summary>
- AllFlags = Assertion | UnmanagedCode | SkipVerification | Execution | ControlThread
- | ControlAppDomain | ControlDomainPolicy | ControlEvidence | ControlPolicy
- | ControlPrincipal | Infrastructure | RemotingConfiguration | SerializationFormatter,
- } // SecurityPermissionFlag
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs
deleted file mode 100644
index d5bbbe06e42..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/SiteIdentityPermissionAttribute.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.Security.Permissions.SiteIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class SiteIdentityPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string site;
-
- // Constructor
- public SiteIdentityPermissionAttribute (SecurityAction action)
- : base (action)
- {
- }
-
- // Properties
- public string Site
- {
- get { return site; }
- set { site = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs
deleted file mode 100644
index 6fa4d197bf9..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/StrongNamePermissionAttribute.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.Security.Permissions.StrongNameIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
-
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class StrongNameIdentityPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string name;
- private string key;
- private string version;
-
- // Constructor
- public StrongNameIdentityPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
-
- public string PublicKey
- {
- get { return key; }
- set { key = value; }
- }
-
- public string Version
- {
- get { return version; }
- set { version = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs
deleted file mode 100644
index 6b998eea3b5..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UIPermissionAttribute.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.Security.Permissions.UIPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class UIPermissionAttribute : CodeAccessSecurityAttribute
- {
-
- // Fields
- private UIPermissionClipboard clipboard;
- private UIPermissionWindow window;
-
- // Constructor
- public UIPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public UIPermissionClipboard Clipboard
- {
- get { return clipboard; }
- set { clipboard = value; }
- }
-
- public UIPermissionWindow Window
- {
- get { return window; }
- set { window = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs b/mcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs
deleted file mode 100755
index 6ae9a795dc0..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UIPermissionClipboard.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// UIPermissionClipboard.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:42:40 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum UIPermissionClipboard {
-
- /// <summary>
- /// </summary>
- NoClipboard = 0,
-
- /// <summary>
- /// </summary>
- OwnClipboard = 1,
-
- /// <summary>
- /// </summary>
- AllClipboard = 2,
- } // UIPermissionClipboard
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs b/mcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs
deleted file mode 100755
index 4d65080e744..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UIPermissionWindow.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// UIPermissionWindow.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:42:30 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Security.Permissions {
-
-
- /// <summary>
- /// </summary>
- public enum UIPermissionWindow {
-
- /// <summary>
- /// </summary>
- NoWindows = 0,
-
- /// <summary>
- /// </summary>
- SafeSubWindows = 1,
-
- /// <summary>
- /// </summary>
- SafeTopLevelWindows = 2,
-
- /// <summary>
- /// </summary>
- AllWindows = 3,
- } // UIPermissionWindow
-
-} // System.Security.Permissions
diff --git a/mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs
deleted file mode 100644
index 29f4006cdc3..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/UrlIdentityPermissionAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Permissions.UrlIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class UrlIdentityPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private string url;
-
- // Constructor
- public UrlIdentityPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public string Url
- {
- get { return url; }
- set { url = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs
deleted file mode 100644
index 48b97970ac2..00000000000
--- a/mcs/class/corlib/System.Security.Permissions/ZoneIdentityPermissionAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.Security.Permissions.ZoneIdentityPermissionAttribute.cs
-//
-// Duncan Mak <duncan@ximian.com>
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security.Permissions
-{
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class |
- AttributeTargets.Struct | AttributeTargets.Constructor |
- AttributeTargets.Method)]
- [Serializable]
- public sealed class ZoneIdentityPermissionAttribute : CodeAccessSecurityAttribute
- {
- // Fields
- private SecurityZone zone;
-
- // Constructor
- public ZoneIdentityPermissionAttribute (SecurityAction action) : base (action) {}
-
- // Properties
- public SecurityZone Zone
- {
- get { return zone; }
- set { zone = value; }
- }
-
- // Methods
- [MonoTODO]
- public override IPermission CreatePermission ()
- {
- return null;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs b/mcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs
deleted file mode 100755
index 858ef857c00..00000000000
--- a/mcs/class/corlib/System.Security.Policy/AllMembershipCondition.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.Security.Policy.AllMembershipCondition.cs
-//
-// Author:
-// Ajay kumar Dwivedi (adwiv@yahoo.com)
-//
-
-using System;
-using System.Security;
-
-
-namespace System.Security.Policy
-{
- /// <summary>
- /// Summary description for AllMembershipCondition.
- /// </summary>
- [Serializable]
- public sealed class AllMembershipCondition : IMembershipCondition,
- ISecurityEncodable, ISecurityPolicyEncodable
- {
- // Tag for Xml Data
- private static readonly string XmlTag = "IMembershipCondition";
-
- public AllMembershipCondition()
- {}
-
- //Always returns true
- public bool Check(Evidence evidence)
- {
- return true;
- }
-
- public IMembershipCondition Copy()
- {
- return new AllMembershipCondition();
- }
-
- public override bool Equals(object o)
- {
- if(o is System.Security.Policy.AllMembershipCondition)
- return true;
- return false;
- }
-
- public void FromXml(SecurityElement e)
- {
- FromXml(e, null);
- }
-
- //Fixme: is there a need for all this????
- public void FromXml(SecurityElement e, PolicyLevel level)
- {
- if(e == null)
- throw new ArgumentNullException("e");
- if(e.Tag != XmlTag)
- throw new ArgumentException("e","The Tag of SecurityElement must be "
- + AllMembershipCondition.XmlTag);
- }
-
- //What's the use of a hashcode here. Equals is always true.
- public override int GetHashCode()
- {
- return 0;
- }
-
- public override string ToString()
- {
- return "All Code";
- }
-
- public SecurityElement ToXml()
- {
- return ToXml(null);
- }
-
- public SecurityElement ToXml(PolicyLevel level)
- {
- SecurityElement se = new SecurityElement(XmlTag);
- Type type = this.GetType();
- string classString = type.FullName + ", " + type.Assembly;
- se.AddAttribute("class",classString);
- se.AddAttribute("version","1");
- return se;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/ApplicationDirectoryMembershipCondition.cs b/mcs/class/corlib/System.Security.Policy/ApplicationDirectoryMembershipCondition.cs
deleted file mode 100644
index 0bae803ce0e..00000000000
--- a/mcs/class/corlib/System.Security.Policy/ApplicationDirectoryMembershipCondition.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-// System.Security.Policy.ApplicationDirectoryMembershipCondition
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2002 Nick Drochak, All rights reserved.
-
-using System.Security;
-
-namespace System.Security.Policy
-{
-
- // FIXME: This class is mostly just method stubs.
-
- [Serializable]
- public sealed class ApplicationDirectoryMembershipCondition :
- IMembershipCondition,
- ISecurityEncodable,
- ISecurityPolicyEncodable
- {
- // Methods
- [MonoTODO]
- public bool Check(Evidence evidence) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public IMembershipCondition Copy() {
- throw new NotImplementedException ();
- }
-
- public override bool Equals(object o) {
- return o is ApplicationDirectoryMembershipCondition;
- }
-
- [MonoTODO]
- public void FromXml(SecurityElement e) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void FromXml(SecurityElement e, PolicyLevel level) {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override int GetHashCode() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public override string ToString() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SecurityElement ToXml() {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public SecurityElement ToXml(PolicyLevel level) {
- throw new NotImplementedException ();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Policy/ChangeLog b/mcs/class/corlib/System.Security.Policy/ChangeLog
deleted file mode 100644
index 85480026477..00000000000
--- a/mcs/class/corlib/System.Security.Policy/ChangeLog
+++ /dev/null
@@ -1,64 +0,0 @@
-2002-06-10 Duncan Mak <duncan@ximian.com>
-
- * IMembershipCondition.cs (Equals): Add missing methods.
-
-2002-03-17 Nick Drochak <ndrochak@gol.com>
-
- * ApplicationDirectoryMembershipCondition.cs: New file (stub)
-
-2002-02-14 Nick Drochak <ndrochak@gol.com>
-
- * FileCodeGroup.cs: Finish Equals()
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * PolicyStatement: New file (stub)
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * FileCodeGroup.cs: New file. All done except for GetHashCode and
- Resolve.
- * CodeGroup.cs: Fix small bug in ToXml()
- * Evidence.cs: Added method stub needed by FileCodeGroup.cs. Added
- MonoTODO's too.
-
-2002-02-07 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroup.cs: Went as far as I can for now. Need to look at
- the (To|From)XML methods when I understand PolicyLevels better.
-
-2002-02-02 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroup.cs: Not done, but checking in now just in case
-
-2002-01-30 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroup.cs: New file. Not nearly done with this, but saving it
- in cvs just in case.
- * PolicyLevel.cs: Sarted just a bit on this then relized i need CodeGroup
- first (among others). Checking in for disaster recovery.
-
-2002-01-29 Nick Drochak <ndrochak@gol.com>
-
- * PolicyStatementAttribute.cs: New file.
- * PolicyException.cs: Use correct namespace
- * PolicyLevel.cs: Add [Serializable] to class
-
-2002-01-19 Duncan Mak <duncan@ximian.com>
-
- * PolicyException.cs: New File.
-
-2002-01-03 Nick Drochak <ndrochak@gol.com>
-
- * IIdentityPermissionFactory.cs: New File
- * IMembershipCondition: New File
-
-2001-12-29 Nick Drochak <ndrochak@gol.com>
-
- * PolicyLevel.cs: New file
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * SecurityElement.cs, CodeAccessPermission.cs IPermission.cs
- IStackWalk.cs SecurityElement.cs ISecurityEncodable.cs: New files.
-
diff --git a/mcs/class/corlib/System.Security.Policy/CodeGroup.cs b/mcs/class/corlib/System.Security.Policy/CodeGroup.cs
deleted file mode 100644
index f2103476096..00000000000
--- a/mcs/class/corlib/System.Security.Policy/CodeGroup.cs
+++ /dev/null
@@ -1,252 +0,0 @@
-// System.Security.Policy.CodeGroup
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak, All rights reserved.
-
-using System.Security.Policy;
-using System.Security.Permissions;
-using System.Collections;
-using System; // for MonoTODO attribute
-
-namespace System.Security.Policy
-{
- [Serializable]
- public abstract class CodeGroup
- {
- PolicyStatement m_policy = null;
- IMembershipCondition m_membershipCondition = null;
- string m_description = null;
- string m_name = null;
- ArrayList m_children = new ArrayList();
- PolicyLevel m_level;
-
- public CodeGroup(IMembershipCondition membershipCondition,
- PolicyStatement policy)
- {
- if (null == membershipCondition)
- throw new ArgumentNullException("Value cannot be null.");
- m_policy = policy;
- m_membershipCondition = membershipCondition;
- }
-
- public abstract CodeGroup Copy();
- public abstract string MergeLogic {get;}
- public abstract PolicyStatement Resolve( Evidence evidence);
- public abstract CodeGroup ResolveMatchingCodeGroups(Evidence evidence);
-
- public PolicyStatement PolicyStatement
- {
- get
- {
- return m_policy;
- }
- set
- {
- m_policy = value;
- }
- }
-
- public string Description
- {
- get
- {
- return m_description;
- }
- set
- {
- m_description = value;
- }
- }
-
- public IMembershipCondition MembershipCondition
- {
- get
- {
- return m_membershipCondition;
- }
- set
- {
- if (null == value)
- throw new ArgumentException("Value cannot be null");
- m_membershipCondition = value;
- }
- }
-
- public string Name
- {
- get
- {
- return m_name;
- }
- set
- {
- m_name = value;
- }
- }
-
- public IList Children
- {
- get
- {
- return m_children;
- }
- set
- {
- if (null == value)
- throw new ArgumentException("Value cannot be null");
- m_children = new ArrayList(value);
- }
- }
-
- public virtual string AttributeString
- {
- get
- {
- if (null != m_policy)
- return m_policy.AttributeString;
-
- return null;
- }
- }
-
- public virtual string PermissionSetName
- {
- get
- {
- if (m_policy.PermissionSet is Security.NamedPermissionSet)
- return ((NamedPermissionSet)(m_policy.PermissionSet)).Name;
-
- return null;
- }
- }
-
- public void AddChild(CodeGroup group)
- {
- if (null == group)
- throw new ArgumentNullException("The group parameter cannot be null");
- m_children.Add(group);
- }
-
- public override bool Equals(object o)
- {
- if (!(o is CodeGroup))
- return false;
-
- return Equals((CodeGroup)o, false);
- }
-
- public bool Equals(CodeGroup cg, bool compareChildren)
- {
- if (cg.Name != this.Name)
- return false;
-
- if (cg.Description != this.Description)
- return false;
-
- if (cg.MembershipCondition != this.MembershipCondition)
- return false;
-
- if (compareChildren)
- {
- int childCount = cg.Children.Count;
- if (this.Children.Count != childCount)
- return false;
-
- for (int index = 0; index < childCount; index++)
- {
- // LAMESPEC: are we supposed to check child equality recursively?
- // The docs imply 'no' but it seems natural to do a 'deep' compare.
- // Will check the children's children, and so-on unless we find out that
- // we shouldn't
- if (!((CodeGroup)(this.Children[index])).Equals((CodeGroup)(cg.Children[index]), true))
- return false;
- }
- }
-
- return true;
-
- }
-
- public void RemoveChild(CodeGroup group)
- {
- if (!m_children.Contains(group))
- throw new ArgumentException();
-
- m_children.Remove(group);
- }
-
- [MonoTODO]
- public override int GetHashCode()
- {
- return 42;
- }
-
- public void FromXml(SecurityElement e)
- {
- FromXml(e, (PolicyLevel)null);
- }
-
- [MonoTODO]
- public void FromXml(SecurityElement e, PolicyLevel level )
- {
- if (null == e)
- throw new ArgumentNullException("e");
-
- // Not sure what might be serialized in this XML, so just do the strings for now
- // and null's for everything else
- m_children = null;
- m_policy = null;
- m_membershipCondition = null;
-
- m_name = e.Attribute("Name");
- m_description = e.Attribute("Description");
-
- // seems like we might need this to Resolve() in subclasses
- m_level = level;
-
- ParseXml(e, level);
- }
-
- protected virtual void ParseXml(SecurityElement e, PolicyLevel level)
- {
- }
-
- public SecurityElement ToXml()
- {
- return ToXml(null);
- }
-
- [MonoTODO("Not sure what to do with PolicyLevel parameter")]
- public SecurityElement ToXml(PolicyLevel level)
- {
- SecurityElement e = new SecurityElement("CodeGroup");
- e.AddAttribute("class", this.GetType().AssemblyQualifiedName);
- e.AddAttribute("version", "1");
-
- if (null != Name)
- e.AddAttribute("Name", Name);
-
- if (null != Description)
- e.AddAttribute("Description", Description);
-
- if (null != MembershipCondition)
- e.AddChild(MembershipCondition.ToXml());
-
- if (null != PolicyStatement)
- e.AddChild(PolicyStatement.PermissionSet.ToXml());
-
- foreach (CodeGroup child in Children)
- e.AddChild(child.ToXml());
-
- CreateXml(e, level);
- return e;
- }
-
- protected virtual void CreateXml(SecurityElement element, PolicyLevel level)
- {
- }
- } // public abstract class CodeGroup
-
-} // namespace System.Security.Policy \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Policy/Evidence.cs b/mcs/class/corlib/System.Security.Policy/Evidence.cs
deleted file mode 100644
index 701d1d4344d..00000000000
--- a/mcs/class/corlib/System.Security.Policy/Evidence.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// System.Security.Policy.Evidence
-//
-// Authors:
-// Sean MacIsaac (macisaac@ximian.com)
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.Collections;
-
-namespace System.Security.Policy
-{
- [MonoTODO]
- [Serializable]
- public sealed class Evidence
- {
-
- [MonoTODO]
- public Evidence () {
- }
-
- [MonoTODO]
- public IEnumerator GetHostEnumerator() {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs b/mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs
deleted file mode 100644
index debd7d3543a..00000000000
--- a/mcs/class/corlib/System.Security.Policy/FileCodeGroup.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-// System.Security.Policy.FileCodeGroup
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak, All rights reserved.
-
-using System.Security.Policy;
-using System.Security.Permissions;
-using System.Collections;
-using System; // for MonoTODO attribute
-
-namespace System.Security.Policy
-{
- [Serializable]
- public sealed class FileCodeGroup : CodeGroup
- {
- FileIOPermissionAccess m_access;
-
- [MonoTODO("Check if membershipCondition is valid")]
- public FileCodeGroup(IMembershipCondition membershipCondition,
- FileIOPermissionAccess access)
- : base(membershipCondition, null)
- {
- if (!Enum.IsDefined(typeof(FileIOPermissionAccess), access))
- throw new ArgumentException("Value not defined for FileIOPermissionAccess","access");
-
- m_access = access;
- }
-
- public override CodeGroup Copy()
- {
- FileCodeGroup copy = new FileCodeGroup(MembershipCondition, m_access);
- foreach (CodeGroup child in Children)
- {
- AddChild(child.Copy());
- }
-
- return copy;
- }
-
- public override string MergeLogic
- {
- get
- {
- return "Union";
- }
- }
-
- [MonoTODO]
- public override PolicyStatement Resolve( Evidence evidence)
- {
- if (null == evidence)
- throw new ArgumentNullException("evidence");
-
- if (null == PolicyStatement)
- throw new PolicyException();
-
- if (!MembershipCondition.Check(evidence))
- return null;
-
- IEnumerator hostEnumerator = evidence.GetHostEnumerator();
- while (hostEnumerator.MoveNext())
- {
- // FIXME: not sure what to do here
- // How do we check the URL and make a PolicyStatement?
- }
- throw new NotImplementedException();
- }
-
- public override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
- {
- if (null == evidence)
- throw new ArgumentNullException("evidence");
-
- if (!MembershipCondition.Check(evidence))
- return null;
-
- FileCodeGroup matchRoot = new FileCodeGroup(MembershipCondition, m_access);
-
- foreach (CodeGroup child in Children)
- {
- CodeGroup childMatchingCodeGroup = child.ResolveMatchingCodeGroups(evidence);
- if (childMatchingCodeGroup != null)
- AddChild(childMatchingCodeGroup);
- }
-
- return matchRoot;
- }
-
- public override string AttributeString
- {
- get
- {
- return null;
- }
- }
-
- public override string PermissionSetName
- {
- get
- {
- return "Same directory FileIO - " + m_access.ToString();
- }
- }
-
- public override bool Equals(object o)
- {
- if (!(o is FileCodeGroup))
- return false;
-
- if (this.m_access != ((FileCodeGroup)o).m_access)
- return false;
-
- return Equals((CodeGroup)o, false);
- }
-
- [MonoTODO]
- public override int GetHashCode()
- {
- throw new NotImplementedException();
- }
-
- protected override void ParseXml(SecurityElement e, PolicyLevel level)
- {
- m_access = (FileIOPermissionAccess)Enum.Parse(typeof(FileIOPermissionAccess), e.Attribute("Access"), true);
- }
-
- protected override void CreateXml(SecurityElement element, PolicyLevel level)
- {
- element.AddAttribute("Access", m_access.ToString());
- }
- } // public abstract class CodeGroup
-
-} // namespace System.Security.Policy \ No newline at end of file
diff --git a/mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs b/mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs
deleted file mode 100644
index 5b82d9d934a..00000000000
--- a/mcs/class/corlib/System.Security.Policy/IIdentityPermissionFactory.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// System.Security.Policy.IIdentityPermissionFactory
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-namespace System.Security.Policy
-{
- public interface IIdentityPermissionFactory
- {
- IPermission CreateIdentityPermission(Evidence evidence);
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs b/mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs
deleted file mode 100644
index 64eb3eba352..00000000000
--- a/mcs/class/corlib/System.Security.Policy/IMembershipCondition.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// System.Security.Policy.IMembershipCondition.cs
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-namespace System.Security.Policy
-{
- public interface IMembershipCondition : ISecurityEncodable, ISecurityPolicyEncodable
- {
- bool Check (Evidence evidence);
- IMembershipCondition Copy ();
- bool Equals (object obj);
- string ToString ();
- }
-}
-
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyException.cs b/mcs/class/corlib/System.Security.Policy/PolicyException.cs
deleted file mode 100644
index 3fc12347231..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.PolicyException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System.Security.Policy
-{
- [Serializable]
- public class PolicyException : SystemException
- {
- // Constructors
- public PolicyException ()
- : base (Locale.GetText ("Cannot run because of policy."))
- {
- }
-
- public PolicyException (string message)
- : base (message)
- {
- }
-
- protected PolicyException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public PolicyException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs b/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
deleted file mode 100644
index 215b42c23b4..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyLevel.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-// System.Security.Policy.PolicyLevel
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-using System.Collections; // for IList
-
-namespace System.Security.Policy
-{
- [MonoTODO]
- [Serializable]
- public sealed class PolicyLevel
- {
- internal PolicyLevel () {}
-
- public IList FullTrustAssemblies
- {
- get
- {
- return (IList)null;
- }
- }
-
- public string Label
- {
- get
- {
- return "";
- }
- }
-
- public IList NamedPermissionSets
- {
- get
- {
- return (IList)null;
- }
- }
-
- public CodeGroup RootCodeGroup
- {
- get
- {
- return (CodeGroup)null;
- }
-
- set
- {
-
- }
- }
-
- public string StoreLocation
- {
- get
- {
- return "";
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyStatement.cs b/mcs/class/corlib/System.Security.Policy/PolicyStatement.cs
deleted file mode 100644
index 95a37d39b56..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyStatement.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// System.Security.Policy.PolicyStatement
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-
-namespace System.Security.Policy {
-
- [Serializable]
- public sealed class PolicyStatement : ISecurityEncodable, ISecurityPolicyEncodable {
- public PolicyStatement (PermissionSet perms) :
- this (perms, PolicyStatementAttribute.Nothing)
- {
- }
-
- public PolicyStatement (PermissionSet perms, PolicyStatementAttribute attrs) {
- this.perms = perms;
- this.attrs = attrs;
- }
-
- public PermissionSet PermissionSet {
- get { return perms; }
- set { perms = value; }
- }
-
- public PolicyStatementAttribute Attributes {
- get { return attrs; }
- set { attrs = value; }
- }
-
- public string AttributeString {
- get { return attrs.ToString ("F"); }
- }
-
- // ISecurityEncodable
-
- [MonoTODO]
- public void FromXml (SecurityElement e) {
- }
-
- [MonoTODO]
- public void FromXml (SecurityElement e, PolicyLevel level) {
- }
-
- [MonoTODO]
- public SecurityElement ToXml () {
- return null;
- }
-
- [MonoTODO]
- public SecurityElement ToXml (PolicyLevel level) {
- return null;
- }
-
- private PermissionSet perms;
- private PolicyStatementAttribute attrs;
- }
-}
diff --git a/mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs b/mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs
deleted file mode 100644
index be194224be9..00000000000
--- a/mcs/class/corlib/System.Security.Policy/PolicyStatementAttribute.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// System.Security.Policy.PolicyStatementAttribute
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-namespace System.Security.Policy
-{
- [Flags]
- [Serializable]
- public enum PolicyStatementAttribute {
- Nothing = 0,
- Exclusive = 1,
- LevelFinal = 2,
- All = 3
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/ChangeLog b/mcs/class/corlib/System.Security.Principal/ChangeLog
deleted file mode 100644
index ca072f91da8..00000000000
--- a/mcs/class/corlib/System.Security.Principal/ChangeLog
+++ /dev/null
@@ -1,3 +0,0 @@
-2002-01-07 Nick Drochak <ndrochak@gol.com>
-
- * PrincipalPolicy.cs: made enum public like it should be to get _AppDomain to compile.
diff --git a/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs b/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
deleted file mode 100644
index 0b5aea58c8a..00000000000
--- a/mcs/class/corlib/System.Security.Principal/GenericIdentity.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.Security.Principal.GenericIdentity.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- [Serializable]
- public class GenericIdentity : IIdentity {
- string user_name;
- string authentication_type;
-
- public GenericIdentity (string user_name, string authentication_type)
- {
- this.user_name = user_name;
- this.authentication_type = authentication_type;
- }
-
- public GenericIdentity (string name)
- {
- this.user_name = user_name;
- }
-
- public virtual string AuthenticationType {
- get {
- return authentication_type;
- }
- }
-
- public virtual string Name {
- get {
- return user_name;
- }
- }
-
- public virtual bool IsAuthenticated {
- get {
- return true;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs b/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
deleted file mode 100644
index 5fa85b9e72b..00000000000
--- a/mcs/class/corlib/System.Security.Principal/GenericPrincipal.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Security.Principal.GenericPrincipal.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- [Serializable]
- public class GenericPrincipal : IPrincipal {
- IIdentity identity;
- string [] roles;
-
- public GenericPrincipal (IIdentity identity, string [] roles)
- {
- this.identity = identity;
- this.roles = roles;
- }
-
- public virtual IIdentity Identity {
- get {
- return identity;
- }
- }
-
- public virtual bool IsInRole (string role)
- {
- foreach (string r in roles)
- if (role == r)
- return true;
-
- return false;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/IIdentity.cs b/mcs/class/corlib/System.Security.Principal/IIdentity.cs
deleted file mode 100644
index e31f8eddd34..00000000000
--- a/mcs/class/corlib/System.Security.Principal/IIdentity.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Security.Principal.IIdentity.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public interface IIdentity {
-
- string AuthenticationType {
- get;
- }
-
- bool IsAuthenticated {
- get;
- }
-
- string Name {
- get;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/IPrincipal.cs b/mcs/class/corlib/System.Security.Principal/IPrincipal.cs
deleted file mode 100644
index 55aece3a4dc..00000000000
--- a/mcs/class/corlib/System.Security.Principal/IPrincipal.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.Principal.IPrincipal.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public interface IPrincipal {
-
- IIdentity Identity {
- get;
- }
-
- bool IsInRole (string role);
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs b/mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs
deleted file mode 100644
index 0fc36b14087..00000000000
--- a/mcs/class/corlib/System.Security.Principal/PrincipalPolicy.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Security.Principal.PrincipalPolicy.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- public enum PrincipalPolicy {
- UnauthenticatedPrincipal,
- NoPrincipal,
- WindowsPrincipal
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs b/mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs
deleted file mode 100644
index 43b4c063797..00000000000
--- a/mcs/class/corlib/System.Security.Principal/WindowsAccountType.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Security.Principal.WindowsAccountType.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- internal enum WindowsAccountType {
- Normal,
- Guest,
- System,
- Anonymous
- }
-}
diff --git a/mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs b/mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs
deleted file mode 100644
index d1541cb951b..00000000000
--- a/mcs/class/corlib/System.Security.Principal/WindowsBuiltInRole.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.Security.Principal.WindowsBuiltInRole.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security.Principal {
-
- internal enum WindowsBuiltInRole {
- Administrator = 544,
- User = 545,
- Guest = 546,
- PowerUser = 547,
- AccountOperator = 548,
- SystemOperator = 549,
- PrintOperator = 550,
- BackupOperator = 551,
- Replicator = 552,
- }
-}
diff --git a/mcs/class/corlib/System.Security/ChangeLog b/mcs/class/corlib/System.Security/ChangeLog
deleted file mode 100755
index 87c3fade5f0..00000000000
--- a/mcs/class/corlib/System.Security/ChangeLog
+++ /dev/null
@@ -1,67 +0,0 @@
-2002-06-10 Duncan Mak <duncan@ximian.com>
-
- * IEvidenceFactory.cs (Evidence): Added missing method.
-
- * SuppressUnmanagedCodeSecurityAttribute.cs:
- * UnverifiableCodeAttribute.cs: Added missing
- AttributeUsage attribute.
-
-2002-06-05 Nick Drochak <ndrochak@gol.com>
-
- * SecurityElement.cs: Fixed couple of hard to spot typos which were
- causing valid names and keys to be rejected.
-
-2002-04-28 Lawrence Pit <loz@cable.a2000.nl>
-
- * CodeAccessPermission.cs : implemented ToString method
-
-2002-04-27 Lawrence Pit <loz@cable.a2000.nl>
-
- * SecurityElement.cs: fixed bugs, implemented several methods
-
-2002-03-12 Duncan Mak <duncan@ximian.com>
-
- * SecurityException.cs: Inherit from SystemException, not Exception.
-
-2002-02-23 Nick Drochak <ndrochak@gol.com>
-
- * SecurityElement.cs: fixed typo
-
-2002-02-13 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * NamedPermissionSet.cs: New file (stub)
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * SecurityException.cs: Reformatted to fit the form of other
- Exceptions. Added serialization bits.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * SecurityElement.cs : Insert MonoTODO attribute.
-
-2002-01-02 Nick Drochak <ndrochak@gol.com>
-
- * CodeAccessPermission.cs: Fix syntax error hidden by exclusion in .build file
-
-2001-12-30 Nick Drochak <ndrochak@gol.com>
-
- * PermissionSet.cs SecurityManager.cs: New Files
- * CodeAccessPermission.cs: Add Skeleton code
- * IPermission.cs: Make public and inherit from ISecurityEncodable
- * ISecurityEncodable.cs: Make interface public
- * ISecurityPolicyEncodable.cs: Ditto
- * IStackWalk.cs: Ditto
-
-2001-12-29 Nick Drochak <ndrochak@gol.com>
-
- * ISecurityPolicyEncodable.cs, PolicyLevelType.cs,
- SecurityZone.cs, SecurityException.cs, UnverifiableCodeAttribute.cs,
- SuppressUnmanagedCodeSecurityAttribute.cs,
- VerificationException.cs, XmlSyntaxException.cs: New files
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * SecurityElement.cs, CodeAccessPermission.cs IPermission.cs
- IStackWalk.cs SecurityElement.cs ISecurityEncodable.cs: New files.
-
diff --git a/mcs/class/corlib/System.Security/CodeAccessPermission.cs b/mcs/class/corlib/System.Security/CodeAccessPermission.cs
deleted file mode 100755
index 3994f785dcf..00000000000
--- a/mcs/class/corlib/System.Security/CodeAccessPermission.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// System.Security.CodeAccessPermission.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- [Serializable]
- public abstract class CodeAccessPermission : IPermission, ISecurityEncodable, IStackWalk
- {
- ///<summary>Constructs a new instance of the System.Security.CodeAccessPermission class.</summary>
- protected CodeAccessPermission(){}
-
- ///<summary> Asserts that calling code can access the resource identified by the current instance through the code that calls this method, even if callers have not been granted permission to access the resource. </summary>
- ///<exception cref="System.Security.SecurityException">The calling code does not have System.Security.Permissions.SecurityPermissionFlag.Assertion. </exception>
- public void Assert()
- {
- }
-
- ///<summary> Returns a System.Security.CodeAccessPermission containing the same values as the current instance.</summary>
- ///<returns> A new System.Security.CodeAccessPermission instance that is value equal to the current instance.</returns>
- public abstract IPermission Copy();
-
- ///<summary>Forces a System.Security.SecurityException if all callers do not have the permission specified by the current instance.</summary>
- ///<exception cref="System.Security.SecurityException"> A caller does not have the permission specified by the current instance. A caller has called System.Security.CodeAccessPermission.Deny for the resource protected by the current instance. </exception>
- public void Demand()
- {
- }
-
- ///<summary> Denies access to the resources specified by the current instance through the code that calls this method.</summary>
- public void Deny(){}
-
- ///<summary> Reconstructs the state of a System.Security.CodeAccessPermission object using the specified XML encoding.</summary>
- ///<param name="elem">A System.Security.SecurityElement instance containing the XML encoding to use to reconstruct the state of a System.Security.CodeAccessPermission object.</param>
- ///<exception cref="System.ArgumentException">elem does not contain the XML encoding for a instance of the same type as the current instance.The version number of elem is not valid.</exception>
- public abstract void FromXml(SecurityElement elem);
-
- ///<summary> Returns a System.Security.CodeAccessPermission object that is the intersection of the current instance and the specified object.</summary>
- ///<param name="target">A System.Security.CodeAccessPermission instance to intersect with the current instance.</param>
- ///<returns> A new System.Security.CodeAccessPermission instance that represents the intersection of the current instance andtarget. If the intersection is empty or target is null, returns null. If the current instance is unrestricted, returns a copy of target. Iftarget is unrestricted, returns a copy of the current instance.</returns>
- ///<exception cref="System.ArgumentException">target is not null and is not a System.Security.CodeAccessPermission object.</exception>
- public abstract IPermission Intersect(IPermission target);
-
- ///<summary>Determines whether the current instance is a subset of the specified object.</summary>
- ///<param name="target">A System.Security.CodeAccessPermission instance that is to be tested for the subset relationship.</param>
- ///<returns>true if the current instance is a subset of target; otherwise, false. If the current instance is unrestricted, and target is not, returnsfalse. If target is unrestricted, returns true.</returns>
- ///<exception cref="System.ArgumentException">target is not null and is not of type System.Security.CodeAccessPermission.</exception>
- public abstract bool IsSubsetOf(IPermission target);
-
- ///<summary> Returns the XML representation of the state of the current instance.</summary>
- ///<returns> A System.String containing the XML representation of the state of the current instance.</returns>
- public override string ToString()
- {
- SecurityElement elem = ToXml ();
- return elem == null ? null : elem.ToString ();
- }
-
- ///<summary> Returns the XML encoding of the current instance.</summary>
- ///<returns>A System.Security.SecurityElement containing an XML encoding of the state of the current instance.</returns>
- public abstract SecurityElement ToXml();
-
- ///<summary> Returns a System.Security.CodeAccessPermission object that is the union of the current instance and the specified object.</summary>
- ///<param name="other">A System.Security.IPermission object of the same type as the current instance to be combined with the current instance.</param>
- ///<returns>If other is null, returns a copy of the current instance using the System.Security.IPermission.Copy method.</returns>
- ///<exception cref="System.ArgumentException">other is not of type System.Security.CodeAccessPermission.</exception>
- ///<exception cref="System.NotSupportedException">other is not null.</exception>
- public virtual IPermission Union(IPermission other)
- {
- if (!(other is System.Security.CodeAccessPermission))
- {
- throw new System.ArgumentException(); // other is not of type System.Security.CodeAccessPermission.
- }
- if (null != other)
- {
- throw new System.NotSupportedException(); // other is not null.
- }
- return null;
- }
-
- public void PermitOnly(){}
- }
-}
diff --git a/mcs/class/corlib/System.Security/IEvidenceFactory.cs b/mcs/class/corlib/System.Security/IEvidenceFactory.cs
deleted file mode 100644
index ed9fc23e2e8..00000000000
--- a/mcs/class/corlib/System.Security/IEvidenceFactory.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// System.Security.IEvidenceFactory
-//
-// Sean MacIsaac (macisaac@ximian.com)
-//
-// (C) Ximian, Inc. 2001
-
-using System.Security.Policy;
-
-namespace System.Security
-{
- public interface IEvidenceFactory
- {
- Evidence Evidence { get; }
- }
-}
diff --git a/mcs/class/corlib/System.Security/IPermission.cs b/mcs/class/corlib/System.Security/IPermission.cs
deleted file mode 100755
index 63aabfd4c4a..00000000000
--- a/mcs/class/corlib/System.Security/IPermission.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// System.Security.IPermission.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- public interface IPermission : ISecurityEncodable {
-
- IPermission Copy ();
-
- void Demand ();
-
- IPermission Intersect (IPermission target);
-
- bool IsSubsetOf (IPermission target);
-
- IPermission Union (IPermission target);
- }
-}
diff --git a/mcs/class/corlib/System.Security/ISecurityEncodable.cs b/mcs/class/corlib/System.Security/ISecurityEncodable.cs
deleted file mode 100755
index 55b9ebe2f55..00000000000
--- a/mcs/class/corlib/System.Security/ISecurityEncodable.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Security.ISecurityEncodable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- public interface ISecurityEncodable {
-
- void FromXml (SecurityElement e);
-
- SecurityElement ToXml ();
- }
-}
diff --git a/mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs b/mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs
deleted file mode 100644
index 66418ab91d0..00000000000
--- a/mcs/class/corlib/System.Security/ISecurityPolicyEncodable.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.ISecurityPolicyEncodable.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Security.Policy;
-
-namespace System.Security {
-
- public interface ISecurityPolicyEncodable {
-
- void FromXml (SecurityElement e, PolicyLevel level);
-
- SecurityElement ToXml (PolicyLevel level);
- }
-}
diff --git a/mcs/class/corlib/System.Security/IStackWalk.cs b/mcs/class/corlib/System.Security/IStackWalk.cs
deleted file mode 100755
index f5b717ac57a..00000000000
--- a/mcs/class/corlib/System.Security/IStackWalk.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// System.Security.IStackWalk.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Security {
-
- public interface IStackWalk {
-
- void Assert ();
-
- void Demand ();
-
- void Deny ();
-
- void PermitOnly ();
- }
-}
diff --git a/mcs/class/corlib/System.Security/NamedPermissionSet.cs b/mcs/class/corlib/System.Security/NamedPermissionSet.cs
deleted file mode 100644
index 0f500e6de98..00000000000
--- a/mcs/class/corlib/System.Security/NamedPermissionSet.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Security.NamedPermissionSet
-//
-// Author:
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2002
-//
-// Stubbed.
-//
-
-using System;
-using System.Security.Permissions;
-
-namespace System.Security {
-
- [MonoTODO]
- [Serializable]
- public sealed class NamedPermissionSet : PermissionSet {
- public NamedPermissionSet (string name, PermissionSet set) : base (set) {
- this.name = name;
- this.description = "";
- }
-
- public NamedPermissionSet (string name, PermissionState state) : base (state) {
- this.name = name;
- this.description = "";
- }
-
- public NamedPermissionSet (NamedPermissionSet set) : this (set.name, set) {
- }
-
- public NamedPermissionSet (string name) : this (name, PermissionState.None) {
- }
-
- public string Description {
- get { return description; }
- set { description = value; }
- }
-
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public override PermissionSet Copy () {
- return null;
- }
-
- public NamedPermissionSet Copy (string name) {
- return null;
- }
-
- public override void FromXml (SecurityElement e) {
- }
-
- public override SecurityElement ToXml () {
- return null;
- }
-
- // private
-
- private string name;
- private string description;
- }
-}
diff --git a/mcs/class/corlib/System.Security/PermissionSet.cs b/mcs/class/corlib/System.Security/PermissionSet.cs
deleted file mode 100644
index 96c9667b9be..00000000000
--- a/mcs/class/corlib/System.Security/PermissionSet.cs
+++ /dev/null
@@ -1,202 +0,0 @@
-//
-// System.Security.PermissionSet.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System;
-using System.Collections;
-using System.Security.Permissions;
-using System.Security;
-using System.Runtime.Serialization;
-
-namespace System.Security
-{
- ///<summary> Represents a collection that can contain different kinds of permissions and perform security operations.</summary>
- [Serializable]
- public class PermissionSet: ISecurityEncodable, ICollection, IEnumerable, IStackWalk, IDeserializationCallback
- {
- ///<summary> Constructs a new instance of the System.Security.PermissionSet class with the specified value.</summary>
- ///<param name="state">A System.Security.Permissions.PermissionState value. This value is either System.Security.Permissions.PermissionState.None or System.Security.Permissions.PermissionState.Unrestricted, to specify fully restricted or fully unrestricted access. </param>
- ///<exception cref="System.ArgumentException">state is not a valid System.Security.Permissions.PermissionState value.</exception>
- public PermissionSet(PermissionState state)
- {
- if (!Enum.IsDefined(typeof(System.Security.Permissions.PermissionState), state))
- {
- throw new System.ArgumentException(); // state is not a valid System.Security.Permissions.PermissionState value.
- }
- }
-
- ///<summary> Constructs a new instance of the System.Security.PermissionSet class with the values of the specified System.Security.PermissionSet instance. </summary>
- ///<param name="permSet">The System.Security.PermissionSet instance with which to initialize the values of the new instance, or null to initialize an empty permission set.</param>
- ///<exception cref="System.ArgumentException">permSet is not an instance of System.Security.PermissionSet.</exception>
- public PermissionSet(PermissionSet permSet)
- {
- // LAMESPEC: This would be handled by the compiler. No way permSet is not a PermissionSet.
- //if (false)
- //{
- // throw new System.ArgumentException(); // permSet is not an instance of System.Security.PermissionSet.
- //}
- }
-
- ///<summary> Adds the specified System.Security.IPermission object to the current instance if that permission does not already exist in the current instance.</summary>
- ///<param name="perm">The System.Security.IPermission object to add.</param>
- ///<returns>The System.Security.IPermission is added if perm is notnull and a permission of the same type as perm does not already exist in the current instance. If perm is null, returns null. If a permission of the same type asperm already exists in the current instance, the union of the existing permission and perm is added to the current instance and is returned.</returns>
- ///<exception cref="System.ArgumentException">perm is not a System.Security.IPermission object.</exception>
- public virtual IPermission AddPermission(IPermission perm)
- {
- // LAMESPEC: This would be handled by the compiler. No way perm is not an IPermission.
- //if (false)
- //{
- // throw new System.ArgumentException(); // perm is not a System.Security.IPermission object.
- //}
- return null;
- }
-
- ///<summary>Asserts that calling code can access the resources identified by the permissions contained in the current instance through the code that calls this method, even if callers have not been granted permission to access the resource. </summary>
- ///<exception cref="System.Security.SecurityException">The asserting code does not have sufficient permission to call this method.-or-This method was called with permissions already asserted for the current stack frame.</exception>
- public virtual void Assert()
- {
- throw new System.Security.SecurityException(); // The asserting code does not have sufficient permission to call this method.-or-This method was called with permissions already asserted for the current stack frame.
- }
-
- ///<summary>Returns a new System.Security.PermissionSet containing copies of the objects in the current instance.</summary>
- ///<returns>A new System.Security.PermissionSet that is value equal to the current instance.</returns>
- public virtual PermissionSet Copy()
- {
- return null;
- }
-
- ///<summary>Copies the permission objects in the current instance to the specified location in the specified System.Array.</summary>
- ///<param name="array">The destination System.Array.</param>
- ///<param name="index">A System.Int32 that specifies the zero-based starting position in the array at which to begin copying.</param>
- ///<exception cref="System.ArgumentException">array has more than one dimension.</exception>
- ///<exception cref="System.IndexOutOfRangeException">index is outside the range of allowable values for array.</exception>
- ///<exception cref="System.ArgumentNullException">array is null.</exception>
- public virtual void CopyTo(Array array, int index)
- {
- if (array.Rank > 1)
- {
- throw new System.ArgumentException("Array has more than one dimension"); // array has more than one dimension.
- }
- if (index < 0 || index >= array.Length)
- {
- throw new System.IndexOutOfRangeException(); // index is outside the range of allowable values for array.
- }
- if (null == array)
- {
- throw new System.ArgumentNullException(); // array is null.
- }
- }
-
- ///<summary>Forces a System.Security.SecurityException if all callers do not have the permissions specified by the objects contained in the current instance.</summary>
- ///<exception cref="System.Security.SecurityException">A caller does not have the permission specified by the current instance.</exception>
- public virtual void Demand()
- {
- throw new System.Security.SecurityException(); // A caller does not have the permission specified by the current instance.
- }
-
- ///<summary>Denies access to the resources secured by the objects contained in the current instance through the code that calls this method.</summary>
- ///<exception cref="System.Security.SecurityException">A previous call to Deny has already restricted the permissions for the current stack frame.</exception>
- public virtual void Deny()
- {
- throw new System.Security.SecurityException(); // A previous call to Deny has already restricted the permissions for the current stack frame.
- }
-
- ///<summary>Reconstructs the state of a System.Security.PermissionSet object using the specified XML encoding.</summary>
- ///<param name="et">A System.Security.SecurityElement instance containing the XML encoding to use to reconstruct the state of a System.Security.PermissionSet object.</param>
- ///<exception cref="System.ArgumentNullException">et is null.</exception>
- ///<exception cref="System.ArgumentException">et does not contain an XML encoding for a System.Security.PermissionSet instance.An error occurred while reconstructing et.</exception>
- public virtual void FromXml(SecurityElement et)
- {
- if (null == et)
- {
- throw new System.ArgumentNullException("et"); // et is null.
- }
- if (true)
- {
- throw new System.ArgumentException("et does not contain an XML encoding for a System.Security.PermissionSet instance."); // et does not contain an XML encoding for a System.Security.PermissionSet instance.An error occurred while reconstructing et.
- }
- }
-
- ///<summary> Returns an enumerator used to iterate over the permissions in the current instance.</summary>
- ///<returns>A System.Collections.IEnumerator object for the permissions of the set.</returns>
- public virtual IEnumerator GetEnumerator()
- {
- return null;
- }
-
- ///<summary> Determines whether the current instance is a subset of the specified object.</summary>
- ///<param name="target">A System.Security.PermissionSet instance that is to be tested for the subset relationship. </param>
- ///<returns>true if the current instance is a subset of target; otherwise, false. If the current instance is unrestricted, andtarget is not, returns false. If target is unrestricted, returns true.</returns>
- public virtual bool IsSubsetOf(PermissionSet target)
- {
- return false;
- }
-
- ///<summary> Specifies that only the resources described by the current instance can be accessed by calling code, even if the code has been granted permission to access other resources.</summary>
- ///<exception cref="System.Security.SecurityException">A previous call to PermitOnly has already set the permissions for the current stack frame.</exception>
- public virtual void PermitOnly()
- {
- if (true)
- {
- throw new System.Security.SecurityException(); // A previous call to PermitOnly has already set the permissions for the current stack frame.
- }
- }
-
- ///<summary> Returns a System.String representation of the state of the current instance.</summary>
- ///<returns>A System.Stringcontaining the XML representation of the state of the current instance.</returns>
- public override string ToString()
- {
- return null;
- }
-
- ///<summary>Returns the XML encoding of the current instance.</summary>
- ///<returns>A System.Security.SecurityElement containing an XML encoding of the state of the current instance.</returns>
- public virtual SecurityElement ToXml()
- {
- return null;
- }
-
- ///<summary> Returns a System.Security.PermissionSet object that is the union of the current instance and the specified object.</summary>
- ///<param name="other">A System.Security.PermissionSet instance to be combined with the current instance.</param>
- ///<returns> A new System.Security.PermissionSet instance that represents the union of the current instance and other. If the current instance or other is unrestricted, returns a System.Security.PermissionSet instance that is unrestricted.</returns>
- public virtual PermissionSet Union(PermissionSet other)
- {
- return null;
- }
-
- ///<summary>Implemented to support the System.Collections.ICollection interface. [Note: For more information, see System.Collections.ICollection.Count.]</summary>
- int ICollection.Count
- {
- get
- {
- return 0;
- }
- }
-
- ///<summary>Implemented to support the System.Collections.ICollection interface. [Note: For more information, see System.Collections.ICollection.IsSynchronized.]</summary>
- bool ICollection.IsSynchronized
- {
- get
- {
- return false;
- }
- }
-
- ///<summary>Implemented to support the System.Collections.ICollection interface. [Note: For more information, see System.Collections.ICollection.SyncRoot.]</summary>
- object ICollection.SyncRoot
- {
- get
- {
- return null;
- }
- }
-
- void IDeserializationCallback.OnDeserialization(object sender){}
-
- }
-}
diff --git a/mcs/class/corlib/System.Security/PolicyLevelType.cs b/mcs/class/corlib/System.Security/PolicyLevelType.cs
deleted file mode 100644
index a7414010104..00000000000
--- a/mcs/class/corlib/System.Security/PolicyLevelType.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Security.PolicyLevelType.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- public enum PolicyLevelType {
- User = 0x0,
- Machine,
- Enterprise,
- AppDomain,
- }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityElement.cs b/mcs/class/corlib/System.Security/SecurityElement.cs
deleted file mode 100755
index 4aeb033328b..00000000000
--- a/mcs/class/corlib/System.Security/SecurityElement.cs
+++ /dev/null
@@ -1,340 +0,0 @@
-//
-// System.Security.SecurityElement.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-
-using System.Globalization;
-using System.Collections;
-using System.Text;
-
-namespace System.Security
-{
- [Serializable]
- public sealed class SecurityElement
- {
- string text;
- string tag;
- Hashtable attributes;
- ArrayList children;
-
- // these values are determined by a simple test program against the MS.Net implementation:
- // for (int i = 0; i < 256; i++) {
- // if (!SecurityElement.IsValidTag ("" + ((char) i))) {
- // System.Console.WriteLine ("TAG: " + i);
- // }
- // }
- // note: this is actually an incorrect implementation of MS, as for example the &
- // character is not a valid character in tag names.
- private static char [] invalid_tag_chars = new char [] { ' ', '<', '>' };
- private static char [] invalid_text_chars = new char [] { '<', '>' };
- private static char [] invalid_attr_name_chars = new char [] { ' ', '<', '>' };
- private static char [] invalid_attr_value_chars = new char [] { '"', '<', '>' };
- private static char [] invalid_chars = new char [] { '<', '>', '"', '\'', '&' };
-
- public SecurityElement (string tag) : this (tag, null)
- {
- }
-
- public SecurityElement (string tag, string text)
- {
- this.Tag = tag;
- this.Text = (text == null) ? String.Empty : text;
- }
-
- public Hashtable Attributes {
- get {
- if (attributes == null)
- return null;
-
- Hashtable result = new Hashtable ();
- IDictionaryEnumerator e = attributes.GetEnumerator ();
- while (e.MoveNext ())
- result.Add (e.Key, e.Value);
- return result;
- }
-
- set {
- if (value == null || value.Count == 0) {
- attributes = null;
- return;
- }
-
- Hashtable result = new Hashtable ();
- IDictionaryEnumerator e = value.GetEnumerator ();
- while (e.MoveNext ()) {
- string key = (string) e.Key;
- string val = (string) e.Value;
- if (!IsValidAttributeName (key))
- throw new ArgumentException (Locale.GetText ("Invalid XML string") + ": " + key);
-
- if (!IsValidAttributeValue (val))
- throw new ArgumentException (Locale.GetText ("Invalid XML string") + ": " + key);
-
- result.Add (key, val);
- }
- attributes = result;
- }
- }
-
- public ArrayList Children {
- get {
- return children;
- }
-
- set {
- if (value != null) {
- foreach (object o in value) {
- if (o == null)
- throw new ArgumentNullException ();
- // shouldn't we also throw an exception
- // when o isn't an instance of SecurityElement?
- }
- }
- children = value;
- }
- }
-
- public string Tag {
- get {
- return tag;
- }
- set {
- if (value == null)
- throw new ArgumentNullException ();
- if (!IsValidTag (value))
- throw new ArgumentException (Locale.GetText ("Invalid XML string") + ": " + value);
- tag = value;
- }
- }
-
- public string Text {
- get {
- return text;
- }
-
- set {
- if (!IsValidText (value))
- throw new ArgumentException (Locale.GetText ("Invalid XML string") + ": " + text);
- text = value;
- }
- }
-
- public void AddAttribute (string name, string value)
- {
- if (name == null || value == null)
- throw new ArgumentNullException ();
-
- if (attributes == null)
- attributes = new Hashtable ();
-
- //
- // The hashtable will throw ArgumentException if name is already there
- //
-
- if (!IsValidAttributeName (name))
- throw new ArgumentException (Locale.GetText ("Invalid XML string") + ": " + name);
-
- if (!IsValidAttributeValue (value))
- throw new ArgumentException (Locale.GetText ("Invalid XML string") + ": " + value);
-
- attributes.Add (name, value);
- }
-
- public void AddChild (SecurityElement child)
- {
- if (child == null)
- throw new ArgumentNullException ();
-
- if (children == null)
- children = new ArrayList ();
-
- children.Add (child);
- }
-
- public string Attribute (string name)
- {
- if (name == null)
- throw new ArgumentNullException ();
-
- if (attributes != null)
- return (string) attributes [name];
- else
- return null;
- }
-
- public bool Equal (SecurityElement other)
- {
- if (other == null)
- return false;
-
- if (this == other)
- return true;
-
- if (this.text != other.text)
- return false;
-
- if (this.tag != other.tag)
- return false;
-
- if (this.attributes == null && other.attributes != null && other.attributes.Count != 0)
- return false;
-
- if (other.attributes == null && this.attributes != null && this.attributes.Count != 0)
- return false;
-
- if (this.attributes != null && other.attributes != null) {
- if (this.attributes.Count != other.attributes.Count)
- return false;
- IDictionaryEnumerator e = attributes.GetEnumerator ();
- while (e.MoveNext ())
- if (other.attributes [e.Key] != e.Value)
- return false;
- }
-
- if (this.children == null && other.children != null && other.children.Count != 0)
- return false;
-
- if (other.children == null && this.children != null && this.children.Count != 0)
- return false;
-
- if (this.children != null && other.children != null) {
- if (this.children.Count != other.children.Count)
- return false;
- for (int i = 0; i < this.children.Count; i++)
- if (!((SecurityElement) this.children [i]).Equal ((SecurityElement) other.children [i]))
- return false;
- }
-
- return true;
- }
-
- public static string Escape (string str)
- {
- StringBuilder sb;
-
- if (str.IndexOfAny (invalid_chars) == -1)
- return str;
-
- sb = new StringBuilder ();
- int len = str.Length;
-
- for (int i = 0; i < len; i++) {
- char c = str [i];
-
- switch (c) {
- case '<': sb.Append ("&lt;"); break;
- case '>': sb.Append ("&gt;"); break;
- case '"': sb.Append ("&quot;"); break;
- case '\'': sb.Append ("&apos;"); break;
- case '&': sb.Append ("&amp;"); break;
- default: sb.Append (c); break;
- }
- }
-
- return sb.ToString ();
- }
-
- public static bool IsValidAttributeName (string name)
- {
- return name != null && name.IndexOfAny (invalid_attr_name_chars) == -1;
- }
-
- public static bool IsValidAttributeValue (string value)
- {
- return value != null && value.IndexOfAny (invalid_attr_value_chars) == -1;
- }
-
- public static bool IsValidTag (string value)
- {
- return value != null && value.IndexOfAny (invalid_tag_chars) == -1;
- }
-
- public static bool IsValidText (string value)
- {
- return value != null && value.IndexOfAny (invalid_text_chars) == -1;
- }
-
- public SecurityElement SearchForChildByTag (string tag)
- {
- if (tag == null)
- throw new ArgumentNullException ("tag");
-
- if (this.children == null)
- return null;
-
- for (int i = 0; i < children.Count; i++) {
- SecurityElement elem = (SecurityElement) children [i];
- if (elem.tag == tag)
- return elem;
- }
- return null;
- }
-
- public string SearchForTextOfTag (string tag)
- {
- if (tag == null)
- throw new ArgumentNullException ("tag");
-
- if (this.tag == tag)
- return this.text;
-
- if (this.children == null)
- return null;
-
- for (int i = 0; i < children.Count; i++) {
- string result = ((SecurityElement) children [i]).SearchForTextOfTag (tag);
- if (result != null)
- return result;
- }
-
- return null;
- }
-
- public override string ToString ()
- {
- StringBuilder s = new StringBuilder ();
- ToXml (ref s, 0);
- return s.ToString ();
- }
-
- private void ToXml(ref StringBuilder s, int level)
- {
- s.Append (' ', level << 2);
- s.Append ("<");
- s.Append (tag);
-
- if (attributes != null) {
- IDictionaryEnumerator e = attributes.GetEnumerator ();
- while (e.MoveNext ()) {
- s.Append (" ")
- .Append (e.Key)
- .Append ("=\"")
- .Append (e.Value)
- .Append ("\"");
- }
- }
-
- if ((text == null || text == String.Empty) &&
- (children == null || children.Count == 0))
- s.Append ("/>");
- else {
- s.Append (">").Append (text);
- if (children != null) {
- foreach (SecurityElement child in children) {
- s.Append (Environment.NewLine);
- child.ToXml (ref s, level + 1);
- }
- }
- s.Append (Environment.NewLine)
- .Append (' ', level << 2)
- .Append ("</")
- .Append (tag)
- .Append (">");
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityException.cs b/mcs/class/corlib/System.Security/SecurityException.cs
deleted file mode 100644
index aaa0086bbe2..00000000000
--- a/mcs/class/corlib/System.Security/SecurityException.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// System.Security.SecurityException.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Security {
- [Serializable]
- public class SecurityException : SystemException {
-
- // Fields
- string permissionState;
- Type permissionType;
-
- // Properties
- public string PermissionState
- {
- get { return permissionState; }
- }
-
- public Type PermissionType
- {
- get { return permissionType; }
- }
-
- // Constructors
- public SecurityException ()
- : base (Locale.GetText ("A security error has been detected."))
- {
- }
-
- public SecurityException (string message)
- : base (message)
- {
- }
-
- protected SecurityException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- permissionState = info.GetString ("permissionState");
- }
-
- public SecurityException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public SecurityException (string message, Type type)
- : base (message)
- {
- permissionType = type;
- }
-
- public SecurityException (string message, Type type, string state)
- : base (message)
- {
- permissionType = type;
- permissionState = state;
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("PermissionState", permissionState);
- }
-
- public override string ToString ()
- {
- return permissionType.FullName + ": " + permissionState;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityManager.cs b/mcs/class/corlib/System.Security/SecurityManager.cs
deleted file mode 100644
index d29a2845c63..00000000000
--- a/mcs/class/corlib/System.Security/SecurityManager.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// System.Security.SecurityManager.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Security.Policy;
-using System.Collections;
-
-namespace System.Security {
-
- public sealed class SecurityManager {
- private static bool checkExecutionRights;
- private static bool securityEnabled;
-
- private SecurityManager () {}
-
- public static bool CheckExecutionRights {
- get{
- return checkExecutionRights;
- }
- set{
- checkExecutionRights = value;
- }
- }
-
- public static bool SecurityEnabled {
- get{
- return securityEnabled;
- }
- set{
- securityEnabled = value;
- }
- }
-
- public static bool IsGranted(IPermission perm){
- return false;
- }
-
- public static PolicyLevel LoadPolicyLevelFromFile(
- string path,
- PolicyLevelType type)
- {
- return null;
- }
-
- public static PolicyLevel LoadPolicyLevelFromString(
- string str,
- PolicyLevelType type)
- {
- if (null == str){
- throw new ArgumentNullException("str");
- }
- return null;
- }
-
- public static IEnumerator PolicyHierarchy(){
- return null;
- }
-
- public static PermissionSet ResolvePolicy(Evidence evidence){
- return null;
- }
-
- public static PermissionSet ResolvePolicy(
- Evidence evidence,
- PermissionSet reqdPset,
- PermissionSet optPset,
- PermissionSet denyPset,
- out PermissionSet denied)
- {
- denied = null;
- return null;
- }
-
- public static IEnumerator ResolvePolicyGroups(Evidence evidence){
- return null;
- }
-
- public static void SavePolicy(){}
-
- public static void SavePolicyLevel(PolicyLevel level){}
-
- }
-}
diff --git a/mcs/class/corlib/System.Security/SecurityZone.cs b/mcs/class/corlib/System.Security/SecurityZone.cs
deleted file mode 100644
index 68a7014d5d4..00000000000
--- a/mcs/class/corlib/System.Security/SecurityZone.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.Security.SecurityZone.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- public enum SecurityZone {
- MyComputer = 0x0,
- Intranet,
- Trusted,
- Internet,
- Untrusted,
- NoZone = -1,
- }
-}
diff --git a/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs b/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
deleted file mode 100644
index 58ac28dcec5..00000000000
--- a/mcs/class/corlib/System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Security.SuppressUnmanagedCodeSecurityAttribute.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- [AttributeUsage (AttributeTargets.Class | AttributeTargets.Method |
- AttributeTargets.Interface)]
- public sealed class SuppressUnmanagedCodeSecurityAttribute : Attribute {}
-}
diff --git a/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs b/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs
deleted file mode 100644
index 6cfb5bda372..00000000000
--- a/mcs/class/corlib/System.Security/UnverifiableCodeAttribute.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Security.UnverifiableCodeAttribute.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-namespace System.Security {
-
- [AttributeUsage (AttributeTargets.Module)]
- public sealed class UnverifiableCodeAttribute : Attribute {}
-}
diff --git a/mcs/class/corlib/System.Security/VerificationException.cs b/mcs/class/corlib/System.Security/VerificationException.cs
deleted file mode 100644
index 277ea55cd37..00000000000
--- a/mcs/class/corlib/System.Security/VerificationException.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Security.VerificationException.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System.Security {
- [Serializable]
- public class VerificationException : SystemException {
-
- // Constructors
- public VerificationException(){}
- public VerificationException(string message)
- : base (message){}
- protected VerificationException(SerializationInfo info, StreamingContext context)
- : base (info, context) {}
- public VerificationException(string message, Exception inner)
- : base (message, inner) {}
- }
-}
diff --git a/mcs/class/corlib/System.Security/XmlSyntaxException.cs b/mcs/class/corlib/System.Security/XmlSyntaxException.cs
deleted file mode 100644
index 91e2c5bc9fa..00000000000
--- a/mcs/class/corlib/System.Security/XmlSyntaxException.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Security.XmlSyntaxException.cs
-//
-// Author:
-// Nick Drochak(ndrochak@gol.com)
-//
-// (C) Nick Drochak
-//
-
-using System.Globalization;
-
-namespace System.Security {
- [Serializable]
- public sealed class XmlSyntaxException : SystemException {
-
- // Constructors
- public XmlSyntaxException(){}
- public XmlSyntaxException(int lineNumber)
- : base (Locale.GetText("Invalid syntax on line ") + lineNumber.ToString() + "."){}
- public XmlSyntaxException(int lineNumber, string message)
- : base (Locale.GetText("Invalid syntax on line ") + lineNumber.ToString() + " - " + message ){}
- public XmlSyntaxException(string message)
- : base (message){}
- public XmlSyntaxException(string message, Exception inner)
- : base (message, inner) {}
- }
-}
diff --git a/mcs/class/corlib/System.Text/ASCIIEncoding.cs b/mcs/class/corlib/System.Text/ASCIIEncoding.cs
deleted file mode 100755
index 82dc49002ee..00000000000
--- a/mcs/class/corlib/System.Text/ASCIIEncoding.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// System.Text.ASCIIEncoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Text {
-
- [Serializable]
- public class ASCIIEncoding : Encoding
- {
- public ASCIIEncoding () : base ()
- {
- encoding_name = "US-ASCII";
- body_name = "us-ascii";
- header_name = "us-ascii";
- web_name = "us-ascii";
- is_browser_display = false;
- is_browser_save = false;
- is_mail_news_display = true;
- is_mail_news_save = true;
- }
-
- public override int GetByteCount (string chars)
- {
- if (chars == null)
- throw new ArgumentNullException ();
-
- return chars.Length;
- }
-
- public override int GetByteCount (char[] chars)
- {
- if (chars == null)
- throw new ArgumentNullException ();
-
- return chars.Length;
- }
-
- public override int GetByteCount (char[] chars, int index, int count)
- {
- if (chars == null)
- throw new ArgumentNullException ();
-
- if ((index < 0) || (count <= 0) || ((index + count) > chars.Length))
- throw new ArgumentOutOfRangeException ();
-
- return count;
- }
-
- public override int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex)
- {
- if ((bytes == null) || (chars == null))
- throw new ArgumentNullException ();
-
- if ((byteIndex < 0) || (charIndex < 0) || (charCount < 0) ||
- ((charIndex + charCount) > chars.Length) ||
- (byteIndex >= bytes.Length))
- throw new ArgumentOutOfRangeException ();
-
- if ((bytes.Length - byteIndex) < charCount)
- throw new ArgumentException ();
-
- for (int i = 0; i < charCount; i++)
- if (chars[charIndex+i] > 0x7f)
- bytes[byteIndex+i] = (byte) '?';
- else
- bytes[byteIndex+i] = (byte) chars[charIndex+i];
-
- return charCount;
- }
-
- public override int GetBytes (string chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex)
- {
- return GetBytes (chars.ToCharArray (), charIndex, charCount,
- bytes, byteIndex);
- }
-
- public override int GetCharCount (byte[] bytes)
- {
- if (bytes == null)
- throw new ArgumentNullException ();
-
- return bytes.Length;
- }
-
- public override int GetCharCount (byte[] bytes, int index, int count)
- {
- if (bytes == null)
- throw new ArgumentNullException ();
-
- if ((index < 0) || (count <= 0) || ((index + count) > bytes.Length))
- throw new ArgumentOutOfRangeException ();
-
- return count;
- }
-
- public override int GetChars (byte[] bytes, int byteIndex, int byteCount,
- char[] chars, int charIndex)
- {
- if ((bytes == null) || (chars == null))
- throw new ArgumentNullException ();
-
- if ((byteIndex < 0) || (charIndex < 0) || (byteCount < 0) ||
- ((byteIndex + byteCount) > bytes.Length) ||
- (charIndex + byteCount > chars.Length))
- throw new ArgumentOutOfRangeException ();
-
- if ((chars.Length - charIndex) < byteCount)
- throw new ArgumentException ();
-
- for (int i = 0; i < byteCount; i++)
- if (bytes[byteIndex+i] > 0x7f)
- chars[charIndex+i] = '?';
- else
- chars[charIndex+i] = (char) bytes[byteIndex+i];
-
- return byteCount;
- }
-
- public override int GetMaxByteCount (int charCount)
- {
- if (charCount < 0)
- throw new ArgumentOutOfRangeException ();
-
- return charCount;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- if (byteCount < 0)
- throw new ArgumentOutOfRangeException ();
-
- return byteCount;
- }
-
- public override string GetString (byte[] bytes)
- {
- if (bytes == null)
- throw new ArgumentNullException ();
-
- return new String (GetChars (bytes, 0, bytes.Length));
- }
-
- public override string GetString (byte[] bytes, int byteIndex, int byteCount)
- {
- if (bytes == null)
- throw new ArgumentNullException ();
-
- if ((byteIndex < 0) || (byteCount < 0) ||
- ((byteIndex + byteCount) > bytes.Length))
- throw new ArgumentOutOfRangeException ();
-
- return new String (GetChars (bytes, byteIndex, byteCount));
- }
-
- }
-}
-
diff --git a/mcs/class/corlib/System.Text/ChangeLog b/mcs/class/corlib/System.Text/ChangeLog
deleted file mode 100755
index 36f0af2ee62..00000000000
--- a/mcs/class/corlib/System.Text/ChangeLog
+++ /dev/null
@@ -1,126 +0,0 @@
-2002-06-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * StringBuilder.cs: implemented AppendFormat methods using
- String.Format. Thanks Paolo!
-
- This makes xsp generate correct C# output in linux :-). I still need
- to do more testing, though.
-
-Mon Jun 3 12:58:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * ASCIIEncoding.cs: fixed handling of 0 bytecount.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * Encoder.cs (IConvEncoder.GetByteCount, IConvEncoder.GetBytes):
- Added exception handling.
-
- * Decoder.cs (IConvDecoder.GetCharCount, IConvDecoder.GetChars):
- Added exception handling.
-
-2002/04/02 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilder.cs (Append): Removed obsolete overload.
-
-2002-03-21 Mike Kestner <mkestner@speakeasy.net>
-
- * ASCIIEncoding.cs : Fix off by one error in Get(Char|Byte)Count.
-
-Thu Mar 21 17:38:19 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * StringBuilder.cs: no need to intern the string returned by ToString().
-
-2002-03-17 Mike Kestner <mkestner@speakeasy.net>
-
- * ASCIIEncoding.cs: Implement all the overridden methods. No longer
- dependent on iconv icalls.
- * Encoding.cs: Fix count bugs in GetBytes and GetChars. Add virtual
- to GetBytes.
-
-Wed Mar 13 00:26:29 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * StringBuilder.cs: make ToString() return a interned string, this
- seems to be required to make switch on string work.
-
-Fri Mar 8 17:29:58 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * StringBuilder.cs: make Append(char) do the smart thing.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * ASCIIEncoding.cs, Encoding.cs, UTF7Encoding.cs,
- UnicodeEncoding.cs: MonoTODO attribute marking.
-
- * StringBuilder.cs : Ditto.
-
-Wed Nov 14 17:05:22 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Encoding.cs: renamed some fields.
- * StringBuilder.cs: CLSCompliant updates.
-
-2001-10-29 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilder.cs: Throw exceptions when constructor paramter(s) are
- invalid. Just like MS does (as best as I can tell).
-
- Tests for these exceptions are now added to the unit tests as well.
-
-2001-10-25 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilder.cs: Throw exception if they try to make a StringBuilder
- whose capacity is greater than the MaxCapacity.
-
- I added some tests for the constructors and the above exception. More
- coming soon.
-
-2001-10-23 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilder.cs: Refactored constructor code into just one
- constructor. All the other construtors call it. Also supplied missing
- constructors so the class has all those in the spec.
-
- Added the MaxCapacity property as well, however this needs to be
- completed to return a value is related to the available system memory.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * Encoding.cs, UTF8Encoding.cs, UTF7Encoding.cs, ASCIIEncoding.cs,
- UnicodeEncoding.cs: Corrected API.
-
- * UTF8Encoding.cs: Checked in changes from Rafael.
-
-2001-08-28 Dietmar Maurer <dietmar@ximian.com>
-
- * UTF8Encoding.cs: impl. clumsy GetBytes
-
-2001-07-16 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * StringBuilder.cs (Text): Fixed.
-
- * StringBuilderTest.cs: Implement Test suite.
-
-2001-07-12 Marcin Szczepanski <marcins@zipworld.com.au>
-
- * StringBuilder.cs: Implemented.
-
- The only methods left unimplemented are the AppendFormat( ... )
- ones just because it's probably better to wait until some of the
- Format related classes are implemented. I've put that as a TODO
- comment at the top and created the methods with a "nop" body.
-
-2001-06-26 Sean MacIsaac <macisaac@ximian.com>
-
- * UnicodeEncoding.cs: Members added so that a clean compile is
- possible.
-
- * ASCIIEncoding.cs: Members added so that a clean compile is
- possible.
-
- * UTF7Encoding.cs: Members added so that a clean compile is
- possible.
-
- * UTF8Encoding.cs: Members added so that a clean compile is
- possible.
-
- * Encoding.cs: All public members included. Most members
- unimplemented.
diff --git a/mcs/class/corlib/System.Text/Decoder.cs b/mcs/class/corlib/System.Text/Decoder.cs
deleted file mode 100644
index b133c124046..00000000000
--- a/mcs/class/corlib/System.Text/Decoder.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// System.Text.Decoder.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Text
-{
-
- [Serializable]
- public abstract class Decoder
- {
-
- protected Decoder ()
- {
- // fixme: dont know what do do here
- }
-
- public abstract int GetCharCount (byte[] bytes, int index, int count);
-
- public abstract int GetChars (byte[] bytes, int byteIndex, int byteCount,
- char[] chars, int charIndex);
- }
-
- internal class DefaultDecoder : Decoder {
-
- public Encoding encoding;
-
- public DefaultDecoder (Encoding enc)
- {
- encoding = enc;
- }
-
- public override int GetCharCount (byte[] bytes, int index, int count)
- {
- return encoding.GetCharCount (bytes, index, count);
- }
-
- public override int GetChars (byte[] bytes, int byteIndex, int byteCount,
- char[] chars, int charIndex)
- {
- return encoding.GetChars (bytes, byteIndex, byteCount, chars, charIndex);
- }
-
- }
-
- internal class IConvDecoder : Decoder {
-
- private IntPtr converter;
-
- public IConvDecoder (string name, bool big_endian)
- {
- converter = Encoding.IConvNewDecoder (name, big_endian);
- }
-
- public override int GetCharCount (byte[] bytes, int index, int count)
- {
- if (bytes == null)
- throw new ArgumentNullException ();
-
- if (index + count > bytes.Length)
- throw new ArgumentOutOfRangeException ();
-
- return Encoding.IConvGetCharCount (converter, bytes, index, count);
- }
-
- public override int GetChars (byte[] bytes, int byteIndex, int byteCount,
- char[] chars, int charIndex)
- {
- if ((bytes == null) || (chars == null))
- throw new ArgumentNullException ();
-
- if ((byteIndex < 0) || (byteCount < 0) || (charIndex < 0))
- throw new ArgumentOutOfRangeException ();
-
- if (byteIndex + byteCount > bytes.Length)
- throw new ArgumentOutOfRangeException ();
-
- if (charIndex > chars.Length)
- throw new ArgumentOutOfRangeException ();
-
- return Encoding.IConvGetChars (converter, bytes, byteIndex, byteCount,
- chars, charIndex);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/Encoder.cs b/mcs/class/corlib/System.Text/Encoder.cs
deleted file mode 100644
index cd6930e4339..00000000000
--- a/mcs/class/corlib/System.Text/Encoder.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// System.Text.Encoder.cs
-//
-// Authors:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Text
-{
-
- [Serializable]
- public abstract class Encoder
- {
-
- protected Encoder()
- {
- // fixme: dont know what do do here
- }
-
- public abstract int GetByteCount (char[] chars, int index, int count, bool flush);
-
- public abstract int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex, bool flush);
- }
-
- internal class DefaultEncoder : Encoder {
-
- public Encoding encoding;
-
- public DefaultEncoder (Encoding enc)
- {
- encoding = enc;
- }
-
- public override int GetByteCount (char[] chars, int index, int count, bool flush)
- {
- return encoding.GetByteCount (chars, index, count);
- }
-
- public override int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex, bool flush)
- {
- return encoding.GetBytes (chars, charIndex, charCount, bytes, byteIndex);
- }
-
- }
-
- internal class IConvEncoder : Encoder {
-
- private IntPtr converter;
-
- public IConvEncoder (string name, bool big_endian)
- {
- converter = Encoding.IConvNewEncoder (name, big_endian);
- }
-
- public override int GetByteCount (char[] chars, int index, int count, bool flush)
- {
- if (chars == null)
- throw new ArgumentNullException ();
-
- if (index + count > chars.Length)
- throw new ArgumentOutOfRangeException ();
-
- int res = Encoding.IConvGetByteCount (converter, chars, index, count);
-
- if (flush)
- Encoding.IConvReset (converter);
-
- return res;
- }
-
- public override int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex, bool flush)
- {
- if ((chars == null) || (bytes == null))
- throw new ArgumentNullException ();
-
- if ((charIndex < 0) || (charCount < 0) || (byteIndex < 0))
- throw new ArgumentOutOfRangeException ();
-
- if (charIndex + charCount > chars.Length)
- throw new ArgumentOutOfRangeException ();
-
- if (byteIndex + charCount > bytes.Length)
- throw new ArgumentOutOfRangeException ();
-
- int res = Encoding.IConvGetBytes (converter, chars, charIndex, charCount,
- bytes, byteIndex);
-
- if (flush)
- Encoding.IConvReset (converter);
-
- return res;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/Encoding.cs b/mcs/class/corlib/System.Text/Encoding.cs
deleted file mode 100755
index a4eaf87bbae..00000000000
--- a/mcs/class/corlib/System.Text/Encoding.cs
+++ /dev/null
@@ -1,384 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Text.Encoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Text {
-
- [Serializable]
- public abstract class Encoding {
- private static ASCIIEncoding ascii_encoding;
- private static UnicodeEncoding big_endian_unicode;
- private static UnicodeEncoding unicode_encoding;
- private static UTF7Encoding utf7_encoding;
- private static UTF8Encoding utf8_encoding;
-
- private int codepage;
-
- protected string body_name;
- protected string encoding_name;
- protected string header_name;
- protected string web_name;
-
- protected bool is_browser_display = false;
- protected bool is_browser_save = false;
- protected bool is_mail_news_display = false;
- protected bool is_mail_news_save = false;
-
- private Encoder default_encoder = null;
- private Decoder default_decoder = null;
-
- // used for iconv
- private string iconv_name;
- private bool big_endian;
- private Encoder iconv_encoder = null;
- private Decoder iconv_decoder = null;
-
- protected Encoding()
- {
- }
-
- protected Encoding (int codepage)
- {
- this.codepage = codepage;
- }
-
- internal protected Encoding (string name, bool big_endian)
- {
- this.iconv_name = name;
- this.big_endian = big_endian;
-
- iconv_decoder = new IConvDecoder (iconv_name, big_endian);
- iconv_encoder = new IConvEncoder (iconv_name, big_endian);
- }
-
- public static Encoding Unicode {
- get {
- if (unicode_encoding == null) {
- unicode_encoding = new UnicodeEncoding();
- }
- return unicode_encoding;
- }
- }
-
- public static Encoding UTF7 {
- get {
- if (utf7_encoding == null) {
- utf7_encoding = new UTF7Encoding();
- }
- return utf7_encoding;
- }
- }
-
- public static Encoding UTF8 {
- get {
- if (utf8_encoding == null) {
- utf8_encoding = new UTF8Encoding();
- }
- return utf8_encoding;
- }
- }
-
- public static Encoding ASCII {
- get {
- if (ascii_encoding == null)
- ascii_encoding = new ASCIIEncoding ();
- return ascii_encoding;
- }
- }
-
- public static Encoding BigEndianUnicode {
- get {
- if (big_endian_unicode == null)
- big_endian_unicode = new UnicodeEncoding (true, true);
- return big_endian_unicode;
- }
- }
-
- public virtual string BodyName {
- get {
- return body_name;
- }
- }
-
- public virtual int CodePage {
- get {
- return codepage;
- }
- }
-
- public static Encoding Default {
- get {
- return ASCII;
- }
- }
-
- public virtual string EncodingName {
- get {
- return encoding_name;
- }
- }
-
- public virtual string HeaderName {
- get {
- return header_name;
- }
- }
-
- public virtual bool IsBrowserDisplay {
- get {
- return is_browser_display;
- }
- }
-
- public virtual bool IsBrowserSave {
- get {
- return is_browser_save;
- }
- }
-
- public virtual bool IsMailNewsDisplay {
- get {
- return is_mail_news_display;
- }
- }
-
- public virtual bool IsMailNewsSave {
- get {
- return is_mail_news_save;
- }
- }
-
- public virtual string WebName {
- get {
- return web_name;
- }
- }
-
- [MonoTODO]
- public virtual int WindowsCodePage {
- get {
- // FIXME
- return 0;
- }
- }
-
- public static byte[] Convert(Encoding srcEncoding, Encoding dstEncoding, byte[] bytes)
- {
- return dstEncoding.GetBytes (srcEncoding.GetChars (bytes));
- }
-
- public static byte[] Convert(Encoding srcEncoding, Encoding dstEncoding,
- byte[] bytes, int index, int count)
- {
- return dstEncoding.GetBytes (srcEncoding.GetChars (bytes, index, count));
- }
-
- public override bool Equals (object value)
- {
- if (!(value is Encoding))
- return false;
-
- Encoding e = (Encoding) value;
-
- if (e.codepage != codepage)
- return false;
-
- if (e.body_name != body_name)
- return false;
-
- if (e.encoding_name != encoding_name)
- return false;
-
- if (e.header_name != header_name)
- return false;
-
- return true;
- }
-
- public virtual int GetByteCount (char[] chars)
- {
- return GetByteCount (chars, 0, chars.Length);
- }
-
- public virtual int GetByteCount (string s)
- {
- char [] chars = s.ToCharArray ();
-
- return GetByteCount (chars, 0, chars.Length);
- }
-
- public virtual int GetByteCount (char[] chars, int index, int count)
- {
- return iconv_encoder.GetByteCount (chars, index, count, false);
- }
-
- public virtual byte[] GetBytes(char[] chars)
- {
- return GetBytes (chars, 0, chars.Length);
- }
-
- public virtual byte[] GetBytes(string s)
- {
- char [] chars = s.ToCharArray ();
- return GetBytes (chars, 0, chars.Length);
- }
-
- public virtual byte[] GetBytes(char[] chars, int index, int count)
- {
- int bc = GetMaxByteCount (count);
- byte [] bytes = new byte [bc];
-
- int len = GetBytes (chars, index, count, bytes, 0);
- byte [] res = new byte [len];
-
- Array.Copy (bytes, res, len);
-
- return res;
- }
-
- public virtual int GetBytes (char[] chars, int charIndex, int charCount,
- byte[] bytes, int byteIndex)
- {
- return iconv_encoder.GetBytes (chars, charIndex, charCount, bytes, byteIndex, true);
- }
-
- public virtual int GetBytes(string s, int charIndex, int charCount,
- byte[] bytes, int byteIndex)
- {
- return GetBytes (s.ToCharArray (), charIndex, charCount, bytes, byteIndex);
- }
-
- public virtual int GetCharCount (byte[] bytes)
- {
- return GetCharCount (bytes, 0, bytes.Length);
- }
-
- public virtual int GetCharCount (byte[] bytes, int index, int count)
- {
- return iconv_decoder.GetCharCount (bytes, index, count);
- }
-
- public virtual char[] GetChars (byte[] bytes)
- {
- return GetChars (bytes, 0, bytes.Length);
- }
-
- public virtual char[] GetChars (byte[] bytes, int index, int count)
- {
- int cc = GetMaxCharCount (count);
- char [] chars = new char [cc];
-
- int len = GetChars (bytes, index, count, chars, 0);
- char [] res = new char [len];
-
- Array.Copy (chars, res, len);
-
- return res;
- }
-
- public virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
- {
- return iconv_decoder.GetChars (bytes, byteIndex, byteCount, chars, charIndex);
- }
-
- public virtual Decoder GetDecoder()
- {
- if (iconv_name != null)
- return new IConvDecoder (iconv_name, big_endian);
-
- if (default_decoder == null)
- default_decoder = new DefaultDecoder (this);
-
- return default_decoder;
- }
-
- public virtual Encoder GetEncoder()
- {
- if (iconv_name != null)
- return new IConvEncoder (iconv_name, big_endian);
-
- if (default_encoder == null)
- default_encoder = new DefaultEncoder (this);
-
- return default_encoder;
- }
-
- [MonoTODO]
- public static Encoding GetEncoding (int codepage)
- {
- // FIXME
- return null;
- }
-
- [MonoTODO]
- public static Encoding GetEncoding (string name)
- {
- // FIXME
- return null;
- }
-
- [MonoTODO]
- public override int GetHashCode()
- {
- // FIXME
- return 0;
- }
-
- public abstract int GetMaxByteCount (int charCount);
-
- public abstract int GetMaxCharCount (int byteCount);
-
- [MonoTODO]
- public virtual byte[] GetPreamble()
- {
- // FIXME
- return null;
- }
-
- public virtual string GetString(byte[] bytes)
- {
- return GetString (bytes, 0, bytes.Length);
- }
-
- public virtual string GetString(byte[] bytes, int index, int count)
- {
- char [] chars = GetChars (bytes, index, count);
-
- return chars.ToString ();
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static IntPtr IConvNewEncoder (string name, bool big_endian);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static IntPtr IConvNewDecoder (string name, bool big_endian);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static void IConvReset (IntPtr converter);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetByteCount (IntPtr converter, char[] chars,
- int index, int count);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetBytes (IntPtr converter, char[] chars, int charIndex,
- int charCount, byte[] bytes, int byteIndex);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetCharCount (IntPtr converter, byte[] bytes,
- int index, int count);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- internal extern static int IConvGetChars (IntPtr converter, byte[] bytes, int byteIndex,
- int byteCount, char[] chars, int charIndex);
- }
-}
diff --git a/mcs/class/corlib/System.Text/StringBuilder.cs b/mcs/class/corlib/System.Text/StringBuilder.cs
deleted file mode 100644
index 0ad52e635f7..00000000000
--- a/mcs/class/corlib/System.Text/StringBuilder.cs
+++ /dev/null
@@ -1,620 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Text.StringBuilder
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Implement the AppendFormat methods. Wasn't sure how
-// best to do this at this early stage, might want to see
-// how the String class and the IFormatProvider / IFormattable interfaces
-// pan out first.
-//
-// TODO: Make sure the coding complies to the ECMA draft, there's some
-// variable names that probably don't (like sString)
-//
-namespace System.Text {
-
- [MonoTODO ("Implement AppendFormat methods and IFormatProvider, IFormattable")]
- [Serializable]
- public sealed class StringBuilder {
-
- private const int defaultCapacity = 16;
-
- private int sCapacity;
- private int sLength;
- private char[] sString;
- private int sMaxCapacity = Int32.MaxValue;
-
- public StringBuilder(string value, int startIndex, int length, int capacity) {
- // first, check the parameters and throw appropriate exceptions if needed
- if(null==value) {
- throw new System.ArgumentNullException("value");
- }
-
- // make sure startIndex is zero or positive
- if(startIndex < 0) {
- throw new System.ArgumentOutOfRangeException("startIndex", startIndex, "StartIndex cannot be less than zero.");
- }
-
- // make sure length is zero or positive
- if(length < 0) {
- throw new System.ArgumentOutOfRangeException("length", length, "Length cannot be less than zero.");
- }
-
- // make sure startIndex and length give a valid substring of value
- if(startIndex + (length -1) > (value.Length - 1) ) {
- throw new System.ArgumentOutOfRangeException("startIndex", startIndex, "StartIndex and length must refer to a location within the string.");
- }
-
- // the capacity must be at least as big as the default capacity
- sCapacity = Math.Max(capacity, defaultCapacity);
-
- // LAMESPEC: what to do if capacity is too small to hold the substring?
- // Like the MS implementation, double the capacity until it is large enough
- while (sCapacity < length) {
- // However, take care not to double if that would make the number
- // larger than what an int can hold
- if (sCapacity <= Int32.MaxValue / 2) {
- sCapacity *= 2;
- }
- else{
- sCapacity = Int32.MaxValue;
- }
- }
-
- sString = new char[sCapacity];
- sLength = length;
-
- // if the length is not zero, then we have to copy some characters
- if (sLength > 0) {
- // Copy the correct number of characters into the internal array
- char[] tString = value.ToCharArray(startIndex, sLength);
- Array.Copy( tString, sString, sLength);
- }
- }
-
- public StringBuilder() : this(String.Empty, 0, 0, 0) {}
-
- public StringBuilder( int capacity ) : this("", 0, 0, capacity) {}
-
- public StringBuilder( int capacity, int maxCapacity ) : this("", 0, 0, capacity) {
- if(capacity > maxCapacity) {
- throw new System.ArgumentOutOfRangeException("capacity", "Capacity exceeds maximum capacity.");
- }
- sMaxCapacity = maxCapacity;
- }
-
- public StringBuilder( string value ) : this(value, 0, value == null ? 0 : value.Length, value == null? 0 : value.Length) {
- }
-
- public StringBuilder( string value, int capacity) : this(value, 0, value.Length, capacity) {}
-
- [MonoTODO]
- public int MaxCapacity {
- get {
- // TODO: Need to look at the memory of the system to return a useful value here
- return sMaxCapacity;
- }
- }
-
- public int Capacity {
- get {
- return sCapacity;
- }
-
- set {
- if( value < sLength ) {
- throw new ArgumentException( "Capacity must be > length" );
- } else {
- char[] tString = new char[value];
- Array.Copy( sString, tString, sLength );
- sString = tString;
- sCapacity = sString.Length;
- }
- }
- }
-
-
- public int Length {
- get {
- return sLength;
- }
-
- set {
- if( value < 0 || value > MaxCapacity) {
- throw new ArgumentOutOfRangeException();
- } else {
- if( value < sLength ) {
- // Truncate current string at value
-
- // LAMESPEC: The spec is unclear as to what to do
- // with the capacity when truncating the string.
- //
- // Don't change the capacity, as this is what
- // the MS implementation does.
-
- sLength = value;
- } else {
- // Expand the capacity to the new length and
- // pad the string with spaces.
-
- // LAMESPEC: The spec says to put the spaces on the
- // left of the string however the MS implementation
- // puts them on the right. We'll do that for
- // compatibility (!)
-
- char[] tString = new char[ value ];
- int padLength = value - sLength;
-
- string padding = new String( ' ', padLength );
- Array.Copy( sString, tString, sLength );
- Array.Copy( padding.ToCharArray(), 0, tString, sLength, padLength );
- sString = tString;
- sLength = sString.Length;
- sCapacity = value;
- }
- }
- }
- }
-
- public char this[ int index ] {
- get {
-
- if( index >= sLength || index < 0 ) {
- throw new IndexOutOfRangeException();
- }
- return sString[ index ];
- }
-
- set {
- if( index >= sLength || index < 0 ) {
- throw new IndexOutOfRangeException();
- }
- sString[ index ] = value;
- }
- }
-
- public override string ToString() {
- return ToString(0, sLength);
- }
-
- public string ToString( int startIndex, int length ) {
- if( startIndex < 0 || length < 0 || startIndex + length > sLength ) {
- throw new ArgumentOutOfRangeException();
- }
-
- return new String( sString, startIndex, length );
- }
-
- public int EnsureCapacity( int capacity ) {
- if( capacity < 0 ) {
- throw new ArgumentOutOfRangeException(
- "Capacity must be greater than 0." );
- }
-
- if( capacity <= sCapacity ) {
- return sCapacity;
- } else {
- Capacity = capacity;
- return sCapacity;
- }
- }
-
- public bool Equals( StringBuilder sb ) {
- if( this.ToString() == sb.ToString() ) {
- return true;
- } else {
- return false;
- }
- }
-
- public StringBuilder Remove( int startIndex, int length ) {
- if( startIndex < 0 || length < 0 || startIndex + length > sLength ) {
- throw new ArgumentOutOfRangeException();
- }
-
- // Copy everything after the 'removed' part to the start
- // of the removed part and truncate the sLength
-
- Array.Copy( sString, startIndex + length, sString,
- startIndex, length );
-
- sLength -= length;
- return this;
- }
-
- public StringBuilder Replace( char oldChar, char newChar ) {
-
- return Replace( oldChar, newChar, 0, sLength);
- }
-
- public StringBuilder Replace( char oldChar, char newChar, int startIndex, int count ) {
- if( startIndex + count > sLength || startIndex < 0 || count < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- for( int replaceIterate = startIndex; replaceIterate < startIndex + count; replaceIterate++ ) {
- if( this[replaceIterate] == oldChar ) {
- this[replaceIterate] = newChar;
- }
- }
-
- return this;
- }
-
- public StringBuilder Replace( string oldValue, string newValue ) {
- return Replace( oldValue, newValue, 0, sLength );
- }
-
- public StringBuilder Replace( string oldValue, string newValue, int startIndex, int count ) {
- string startString = this.ToString();
- StringBuilder newStringB = new StringBuilder();
- string newString;
-
- if( oldValue == null ) {
- throw new ArgumentNullException(
- "The old value cannot be null.");
- }
-
- if( startIndex < 0 || count < 0 || startIndex + count > sLength ) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( oldValue.Length == 0 ) {
- throw new ArgumentException(
- "The old value cannot be zero length.");
- }
-
- int nextIndex = startIndex; // Where to start the next search
- int lastIndex = nextIndex; // Where the last search finished
-
- while( nextIndex != -1 ) {
- nextIndex = startString.IndexOf( oldValue, lastIndex);
- if( nextIndex != -1 ) {
- // The MS implementation won't replace a substring
- // if that substring goes over the "count"
- // boundary, so we'll make sure the behaviour
- // here is the same.
-
- if( nextIndex + oldValue.Length <= startIndex + count ) {
-
- // Add everything to the left of the old
- // string
- newStringB.Append( startString.Substring( lastIndex, nextIndex - lastIndex ) );
-
- // Add the replacement string
- newStringB.Append( newValue );
-
- // Set the next start point to the
- // end of the last match
- lastIndex = nextIndex + oldValue.Length;
- } else {
- // We're past the "count" we're supposed to replace within
- nextIndex = -1;
- newStringB.Append(
- startString.Substring( lastIndex ) );
- }
-
- } else {
- // Append everything left over
- newStringB.Append( startString.Substring( lastIndex ) );
- }
- }
-
- newString = newStringB.ToString();
-
- EnsureCapacity( newString.Length );
- sString = newString.ToCharArray();
- sLength = newString.Length;
- return this;
- }
-
-
- /* The Append Methods */
-
- // TODO: Currently most of these methods convert the
- // parameter to a CharArray (via a String) and then pass
- // it to Append( char[] ). There might be a faster way
- // of doing this, but it's probably adequate and anything else
- // would make it too messy.
- //
- // As an example, a sample test run of appending a 100 character
- // string to the StringBuilder, and loooping this 50,000 times
- // results in an elapsed time of 2.4s using the MS StringBuilder
- // and 2.7s using this StringBuilder. Note that this results
- // in a 5 million character string. I believe MS uses a lot
- // of "native" DLLs for the "meat" of the base classes.
-
- [MonoTODO ("Look at all Append methods and complete them if necessary")]
- public StringBuilder Append( char[] value ) {
- if( sLength + value.Length > sCapacity ) {
- // Need more capacity, double the capacity StringBuilder
- // and make sure we have at least enough for the value
- // if that's going to go over double.
-
- Capacity = value.Length + ( sCapacity + sCapacity);
- }
-
- Array.Copy( value, 0, sString, sLength, value.Length );
- sLength += value.Length;
-
- return this;
- }
-
- public StringBuilder Append( string value ) {
- if( value != null ) {
- return Append( value.ToCharArray() );
- } else {
- return null;
- }
- }
-
- public StringBuilder Append( bool value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( byte value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( decimal value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( double value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( short value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( int value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( long value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( object value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( sbyte value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( float value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( ushort value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( uint value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Append( ulong value ) {
- return Append( value.ToString().ToCharArray() );
- }
-
- public StringBuilder Append( char value ) {
- if( sLength + 1 > sCapacity ) {
- // Need more capacity, double the capacity StringBuilder
- // and make sure we have at least enough for the value
- // if that's going to go over double.
-
- Capacity = 1 + ( sCapacity + sCapacity);
- }
- sString [sLength] = value;
- sLength++;
-
- return this;
- }
-
- public StringBuilder Append( char value, int repeatCount ) {
- if( repeatCount < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- return Append( new String( value, repeatCount) );
- }
-
- public StringBuilder Append( char[] value, int startIndex, int charCount ) {
-
- if( (charCount < 0 || startIndex < 0) ||
- ( charCount + startIndex > value.Length ) ) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( value == null ) {
- if( !(startIndex == 0 && charCount == 0) ) {
- throw new ArgumentNullException();
- } else {
- return this;
- }
- } else {
- char[] appendChars = new char[ charCount ];
-
- Array.Copy( value, startIndex, appendChars, 0, charCount );
- return Append( appendChars );
- }
- }
-
- public StringBuilder Append( string value, int startIndex, int count ) {
- if( (count < 0 || startIndex < 0) ||
- ( startIndex + count > value.Length ) ) {
- throw new ArgumentOutOfRangeException();
- }
-
- return Append( value.Substring( startIndex, count ).ToCharArray() );
- }
-
- public StringBuilder AppendFormat (string format, object arg0 )
- {
- string result = String.Format (format, arg0);
- return Append (result);
- }
-
- public StringBuilder AppendFormat (string format, params object[] args )
- {
- string result = String.Format (format, args);
- return Append (result);
- }
-
- public StringBuilder AppendFormat (IFormatProvider provider,
- string format,
- params object[] args)
- {
- string result = String.Format (provider, format, args);
- return Append (result);
- }
-
- public StringBuilder AppendFormat (string format, object arg0, object arg1 )
- {
- string result = String.Format (format, arg0, arg1);
- return Append (result);
- }
-
- public StringBuilder AppendFormat (string format, object arg0, object arg1, object arg2 )
- {
- string result = String.Format (format, arg0, arg1, arg2);
- return Append (result);
- }
-
- /* The Insert Functions */
-
- // Similarly to the Append functions, get everything down to a CharArray
- // and insert that.
-
- public StringBuilder Insert( int index, char[] value ) {
- if( index > sLength || index < 0) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( value == null || value.Length == 0 ) {
- return this;
- } else {
- // Check we have the capacity to insert this array
- if( sCapacity < sLength + value.Length ) {
- Capacity = value.Length + ( sCapacity + sCapacity );
- }
-
- // Move everything to the right of the insert point across
- Array.Copy( sString, index, sString, index + value.Length, sLength - index);
-
- // Copy in stuff from the insert buffer
- Array.Copy( value, 0, sString, index, value.Length );
-
- sLength += value.Length;
- return this;
- }
- }
-
- public StringBuilder Insert( int index, string value ) {
- return Insert( index, value.ToCharArray() );
- }
-
- public StringBuilder Insert( int index, bool value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, byte value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, char value) {
- char[] insertChar = new char[1];
-
- insertChar[0] = value;
- return Insert( index, insertChar );
- }
-
- public StringBuilder Insert( int index, decimal value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, double value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, short value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, int value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, long value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, object value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, sbyte value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, float value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, ushort value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, uint value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- [CLSCompliant(false)]
- public StringBuilder Insert( int index, ulong value ) {
- return Insert( index, value.ToString().ToCharArray() );
- }
-
- public StringBuilder Insert( int index, string value, int count ) {
- if ( count < 0 ) {
- throw new ArgumentOutOfRangeException();
- }
-
- if( value != null ) {
- if( value != "" ) {
- for( int insertCount = 0; insertCount < count;
- insertCount++ ) {
- Insert( index, value.ToCharArray() );
- }
- }
- }
- return this;
- }
-
- public StringBuilder Insert( int index, char[] value, int startIndex,
- int charCount ) {
-
- if( value != null ) {
- if( charCount < 0 || startIndex < 0 || startIndex + charCount > value.Length ) {
- throw new ArgumentOutOfRangeException();
- }
-
- char[] insertChars = new char[ charCount ];
- Array.Copy( value, startIndex, insertChars, 0, charCount );
- return Insert( index, insertChars );
- } else {
- return this;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/UTF7Encoding.cs b/mcs/class/corlib/System.Text/UTF7Encoding.cs
deleted file mode 100755
index 91fd3604236..00000000000
--- a/mcs/class/corlib/System.Text/UTF7Encoding.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.Text.UTF7Encoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Text {
-
- public class UTF7Encoding : Encoding
- {
- public UTF7Encoding () : base ("UTF-7", false)
- {
- encoding_name = "Unicode (UTF-7)";
- body_name = "utf-7";
- header_name = "utf-7";
- web_name = "utf-7";
- is_browser_display = false;
- is_browser_save = false;
- is_mail_news_display = true;
- is_mail_news_save = true;
-
- }
-
- [MonoTODO]
- public override int GetMaxByteCount (int charCount)
- {
- // FIXME: dont know if this is right
- return charCount*6;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- return byteCount;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System.Text/UTF8Encoding.cs b/mcs/class/corlib/System.Text/UTF8Encoding.cs
deleted file mode 100755
index 4f1e58a3f5f..00000000000
--- a/mcs/class/corlib/System.Text/UTF8Encoding.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Text.UTF8Encoding.cs
-//
-// Authors:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System.Text
-{
- [Serializable]
- public class UTF8Encoding : Encoding
- {
- public UTF8Encoding () : base ("UTF-8", false)
- {
- encoding_name = "Unicode (UTF-8)";
- body_name = "utf-8";
- header_name = "utf-8";
- web_name = "utf-8";
- is_browser_display = true;
- is_browser_save = true;
- is_mail_news_display = true;
- is_mail_news_save = true;
- }
-
- public override int GetMaxByteCount (int charCount)
- {
- return charCount*6;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- return byteCount;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Text/UnicodeEncoding.cs b/mcs/class/corlib/System.Text/UnicodeEncoding.cs
deleted file mode 100755
index 8758c6b2623..00000000000
--- a/mcs/class/corlib/System.Text/UnicodeEncoding.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
-//
-// System.Text.UnicodeEncoding.cs
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-// FIXME: implement byteOrderMark
-
-namespace System.Text {
-
- [MonoTODO]
- [Serializable]
- public class UnicodeEncoding : Encoding
- {
- private bool byteOrderMark;
-
- private void init (bool byteOrderMark)
- {
- this.byteOrderMark = byteOrderMark;
- encoding_name = "Unicode";
- body_name = "utf-16";
- header_name = "utf-16";
- web_name = "utf-16";
- is_browser_display = false;
- is_browser_save = true;
- is_mail_news_display = false;
- is_mail_news_save = false;
- }
-
- public UnicodeEncoding () : base ("UNICODE", false)
- {
- init (false);
- }
-
- public UnicodeEncoding (bool bigEndian, bool byteOrderMark) : base ("UNICODE", bigEndian)
- {
- init (byteOrderMark);
- }
-
- public override int GetMaxByteCount (int charCount)
- {
- return charCount;
- }
-
- public override int GetMaxCharCount (int byteCount)
- {
- return byteCount / 2;
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ApartmentState.cs b/mcs/class/corlib/System.Threading/ApartmentState.cs
deleted file mode 100755
index 0dfc50785b4..00000000000
--- a/mcs/class/corlib/System.Threading/ApartmentState.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Threading.ApartmentState.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public enum ApartmentState {
- STA = 0,
- MTA = 1,
- Unknown = 2
- }
-}
diff --git a/mcs/class/corlib/System.Threading/AutoResetEvent.cs b/mcs/class/corlib/System.Threading/AutoResetEvent.cs
deleted file mode 100755
index 3b5d71e63be..00000000000
--- a/mcs/class/corlib/System.Threading/AutoResetEvent.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.Threading.AutoResetEvent.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
-
- public sealed class AutoResetEvent : WaitHandle
- {
- // Constructor
- public AutoResetEvent(bool initialState) {
- os_handle = NativeEventCalls.CreateEvent_internal(false,initialState,null);
- }
-
- // Methods
-
- public bool Set() {
- return(NativeEventCalls.SetEvent_internal(os_handle));
- }
-
- public bool Reset() {
- return(NativeEventCalls.ResetEvent_internal(os_handle));
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog
deleted file mode 100644
index bdd989eb3aa..00000000000
--- a/mcs/class/corlib/System.Threading/ChangeLog
+++ /dev/null
@@ -1,149 +0,0 @@
-2002-04-30 Dick Porter <dick@ximian.com>
-
- * Thread.cs: If LocalDataStoreSlot already has data set, remove it
- before adding a new one.
-
- Use the Thread object destructor to tell the runtime to close the
- thread handle.
-
-2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * Interlocked.cs: made all methods icalls.
-
-2002-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IOCompletionCallback.cs: added attributes to the delegate
- (CLSCompliant(false) and Serializable).
-
-2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
- * Thread.cs: Fixed IsThreadPoolThread to use a internal property instead of extending
- the threadstate enum.
- * ThreadPool.cs: Now using the internal Isthreadpoolthread property
- * ThreadState.cs: removed non-standard enum (ThreadPoolThread)
-
-2002-04-14 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * ThreadState.cs: Added enum for threadpool thread
- * Thread.cs: changed the set/clr_state to be internal (used from threadpool)
- * Thread.cs: Added IsThreadPoolThread
- * ThreadPool.cs: Implementation of QueueUserWorkItem
-
-Wed Feb 13 21:51:30 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Thread.cs: implement CurrentCulture property needed by
- Convert.ChangeType() (used when compiling enums).
-
-2002-01-23 Dick Porter <dick@ximian.com>
-
- * ManualResetEvent.cs:
- * AutoResetEvent.cs: Fixed DOS line endings
-
-2002-01-22 Veronica De Santis <veron78@interfree.it>
-
- * NativeEventCalls : Class that contains internal calls shared by Auto
- and Manual Reset Events
- * AutoResetEvents.cs : Added class AutoResetEvents and its implementation
- * ManualResetEvents.cs : Added class ManualResetEvents and its implementation
-
-2002-01-16 Veronica De Santis <veron78@interfree.it>
-
- * WaitHandle.cs : Renamed handle to os_handle and make it protected
- instead of private.
- * Mutex.cs : Write the System.Threading.Mutex methods ( constructors
- and the ReleaseMutex)
-
-2002-01-15 Dick Porter <dick@ximian.com>
-
- * WaitHandle.cs:
- * Thread.cs: Make the runtime's idea of infinite timeouts coincide
- with the class library's
-
-2002-01-10 Dick Porter <dick@ximian.com>
-
- * WaitHandle.cs: Added checks for too many handles and null
- handles in WaitAll() and WaitAny
-
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * AutoResetEvent.cs, ManualResetEvent.cs, Monitor.cs : MonoTODO
- decoration.
-
- * Mutex.cs, Overlapped.cs, ReaderWriterLock.cs, RegisteredWaitHandle.cs,
- Thread.cs, ThreadAbortException.cs, ThreadPool.cs, Timer.cs, WaitHandler.cs : Ditto.
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * WaitHandle.cs: Implemented WaitAll(), WaitAny() and WaitOne() as
- internal calls.
-
-2001-11-26 Dick Porter <dick@ximian.com>
-
- * Thread.cs: DataSlot uses a single system TLS slot, and a
- hashtable per thread. Some minor changes to reflect the new
- internal calls using the new IO library, and the newly-supported
- bool returns from internal calls.
-
- * Monitor.cs: Use bool returns from internal calls now they are
- supported by the runtime. Coalesce enter with the try_enter
- internal call.
-
-Wed Nov 14 17:06:18 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Overlapped.cs, ThreadPool.cs, Timer.cs: CLSCompliant updates.
-
-2001-10-03 Dick Porter <dick@ximian.com>
-
- * Monitor.cs: Implemented all methods except the two Wait()
- methods that take boolean parameters
-
-2001-09-28 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implemented AllocateDataSlot(),
- AllocateNamedDataSlot(), FreeNamedDataSlot(), GetData(),
- GetNamedDataSlot(), SetData(), IsBackground. Reworked Thread()
- and Start() to avoid a race condition. Added thread-safe state
- changing private operations.
-
- * Monitor.cs: Comment out the GetType() calls because it isn't implemented yet
-
-2001-09-25 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implement Join and timed Join, set correct state
- around Start, Join and Sleep calls, implement IsAlive and
- ThreadState properties.
-
- * ThreadState.cs (Threading): Added StopRequested,
- SuspendRequested, Suspended values
-
-2001-09-23 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implemented CurrentThread and Sleep (both versions)
- with internal calls, and Name.
-
-2001-09-21 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Implement Thread(ThreadStart) constructor and Start()
- with an internal call
-
- * WaitHandle.cs: Close calls Dispose(false)
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * ApartmentState.cs (Threading): Set the correct enum values
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * ApartmentState.cs, AutoResetEvent.cs, IOCompletionCallback.cs,
- Interlocked.cs, LockCookie.cs, ManualResetEvent.cs, Monitor.cs,
- Mutex.cs, NativeOverlapped.cs, Overlapped.cs, ReaderWriterLock.cs,
- RegisteredWaitHandle.cs, SynchronizationLockException.cs,
- Thread.cs, ThreadAbortException.cs, ThreadInterruptedException.cs,
- ThreadPool.cs, ThreadStart.cs, ThreadStateException.cs,
- Timeout.cs, Timer.cs, TimerCallback.cs, WaitCallback.cs,
- WaitHandle.cs, WaitOrTimerCallback.cs: System.Threading class
- stubs.
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * ThreadPriority.cs, ThreadState.cs: Add.
diff --git a/mcs/class/corlib/System.Threading/IOCompletionCallback.cs b/mcs/class/corlib/System.Threading/IOCompletionCallback.cs
deleted file mode 100755
index d384f8a29b7..00000000000
--- a/mcs/class/corlib/System.Threading/IOCompletionCallback.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Threading.IOCompletionCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- // 'unsafe' wasn't in the spec, but the compiler insists because of
- // the pointer.
- [Serializable]
- [CLSCompliant(false)]
- public unsafe delegate void IOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped *pOVERLAP);
-}
diff --git a/mcs/class/corlib/System.Threading/Interlocked.cs b/mcs/class/corlib/System.Threading/Interlocked.cs
deleted file mode 100755
index d5d6a28df3a..00000000000
--- a/mcs/class/corlib/System.Threading/Interlocked.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// System.Threading.Interlocked.cs
-//
-// Author:
-// Patrik Torstensson (patrik.torstensson@labs2.com)
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- public sealed class Interlocked
- {
- private Interlocked () {}
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static int CompareExchange(ref int location1, int value, int comparand);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static object CompareExchange(ref object location1, object value, object comparand);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static float CompareExchange(ref float location1, float value, float comparand);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static int Decrement(ref int location);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static long Decrement(ref long location);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static int Increment(ref int location);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static long Increment(ref long location);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static int Exchange(ref int location1, int value);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static object Exchange(ref object location1, object value);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern static float Exchange(ref float location1, float value);
- }
-}
-
diff --git a/mcs/class/corlib/System.Threading/LockCookie.cs b/mcs/class/corlib/System.Threading/LockCookie.cs
deleted file mode 100755
index e3d226c8b0e..00000000000
--- a/mcs/class/corlib/System.Threading/LockCookie.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.Threading.LockCookie.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- [Serializable]
- public struct LockCookie
- {
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ManualResetEvent.cs b/mcs/class/corlib/System.Threading/ManualResetEvent.cs
deleted file mode 100755
index a3a3be44112..00000000000
--- a/mcs/class/corlib/System.Threading/ManualResetEvent.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.Threading.ManualResetEvent.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
-
- public sealed class ManualResetEvent : WaitHandle
- {
- // Constructor
- public ManualResetEvent (bool initialState)
- {
- os_handle = NativeEventCalls.CreateEvent_internal (true, initialState, null);
- }
-
- // Methods
-
- public bool Set()
- {
- return (NativeEventCalls.SetEvent_internal (os_handle));
- }
-
- public bool Reset()
- {
- return(NativeEventCalls.ResetEvent_internal (os_handle));
- }
-
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Monitor.cs b/mcs/class/corlib/System.Threading/Monitor.cs
deleted file mode 100755
index 14fe105e6f1..00000000000
--- a/mcs/class/corlib/System.Threading/Monitor.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-//
-// System.Threading.Monitor.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- public sealed class Monitor
- {
- private Monitor () {}
-
- // Grabs the mutex on object 'obj', with a maximum
- // wait time 'ms' but doesn't block - if it can't get
- // the lock it returns false, true if it can
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_try_enter(object obj, int ms);
- public static void Enter(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- Monitor_try_enter(obj, Timeout.Infinite);
- }
-
- // Releases the mutex on object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Monitor_exit(object obj);
-
- // Checks whether the current thread currently owns
- // the lock on object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_test_owner(object obj);
-
- public static void Exit(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- if(Monitor_test_owner(obj)==false) {
- throw new SynchronizationLockException("The current thread does not own the lock");
- }
-
- Monitor_exit(obj);
- }
-
- // Signals one of potentially many objects waiting on
- // object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Monitor_pulse(object obj);
-
- // Checks whether object 'obj' is currently synchronised
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_test_synchronised(object obj);
-
- public static void Pulse(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- Monitor_pulse(obj);
- }
-
- // Signals all of potentially many objects waiting on
- // object 'obj'
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Monitor_pulse_all(object obj);
-
- public static void PulseAll(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- Monitor_pulse_all(obj);
- }
-
- public static bool TryEnter(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- return(Monitor_try_enter(obj, 0));
- }
-
- public static bool TryEnter(object obj, int millisecondsTimeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- // LAMESPEC: should throw an exception when ms<0, but
- // Timeout.Infinite is -1
- if(millisecondsTimeout == Timeout.Infinite) {
- Enter(obj);
- return(true);
- }
-
- if(millisecondsTimeout<0) {
- throw new ArgumentException("millisecondsTimeout negative");
- }
-
- return(Monitor_try_enter(obj, millisecondsTimeout));
- }
-
- public static bool TryEnter(object obj, TimeSpan timeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- //if(obj.GetType().IsValueType==true) {
- // throw new ArgumentException("Value type");
- //}
-
- // LAMESPEC: should throw an exception when ms<0, but
- // Timeout.Infinite is -1
- if(timeout.Milliseconds == Timeout.Infinite) {
- Enter(obj);
- return(true);
- }
-
- if(timeout.Milliseconds < 0 ||
- timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
-
- return(Monitor_try_enter(obj, timeout.Milliseconds));
- }
-
- // Waits for a signal on object 'obj' with maximum
- // wait time 'ms'. Returns true if the object was
- // signalled, false if it timed out
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool Monitor_wait(object obj, int ms);
-
- public static bool Wait(object obj) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- return(Monitor_wait(obj, 0));
- }
-
- public static bool Wait(object obj, int millisecondsTimeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
- // LAMESPEC: no mention of timeout sanity checking
-
- return(Monitor_wait(obj, millisecondsTimeout));
- }
-
- public static bool Wait(object obj, TimeSpan timeout) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
- if(Monitor_test_synchronised(obj)==false) {
- throw new SynchronizationLockException("Object is not synchronised");
- }
-
- return(Monitor_wait(obj, timeout.Milliseconds));
- }
-
- [MonoTODO]
- public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- // FIXME when I understand what a
- // "synchronisation domain" is and does
- return(false);
- }
-
- [MonoTODO]
- public static bool Wait(object obj, TimeSpan timeout, bool exitContext) {
- if(obj==null) {
- throw new ArgumentNullException("Object is null");
- }
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
-
- // FIXME when I understand what a
- // "synchronisation domain" is and does
- return(false);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Mutex.cs b/mcs/class/corlib/System.Threading/Mutex.cs
deleted file mode 100755
index f0926bf023a..00000000000
--- a/mcs/class/corlib/System.Threading/Mutex.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Threading.Mutex.cs
-//
-// Author:
-//
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- public sealed class Mutex : WaitHandle
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern IntPtr CreateMutex_internal(
- bool initiallyOwned,
- string name);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void ReleaseMutex_internal(IntPtr handle);
-
- public Mutex() {
- os_handle=CreateMutex_internal(false,null);
- }
-
- public Mutex(bool initiallyOwned) {
- os_handle=CreateMutex_internal(initiallyOwned,null);
- }
-
- public Mutex(bool initiallyOwned, string name) {
- os_handle=CreateMutex_internal(initiallyOwned,name);
- }
-
-
- public Mutex(bool initiallyOwned, string name, out bool gotOwnership) {
- os_handle=CreateMutex_internal(initiallyOwned,name);
- gotOwnership=false;
- }
-
- public void ReleaseMutex() {
- ReleaseMutex_internal(os_handle);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/NativeEventCalls.cs b/mcs/class/corlib/System.Threading/NativeEventCalls.cs
deleted file mode 100755
index 08dd8363f23..00000000000
--- a/mcs/class/corlib/System.Threading/NativeEventCalls.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Threading.AutoResetEvent.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-// Veronica De Santis (veron78@interfree.it)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- internal sealed class NativeEventCalls
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern IntPtr CreateEvent_internal(bool manual,bool initial,string name);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern bool SetEvent_internal(IntPtr handle);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern bool ResetEvent_internal(IntPtr handle);
-
- }
-}
diff --git a/mcs/class/corlib/System.Threading/NativeOverlapped.cs b/mcs/class/corlib/System.Threading/NativeOverlapped.cs
deleted file mode 100755
index 2f681fba4ba..00000000000
--- a/mcs/class/corlib/System.Threading/NativeOverlapped.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// System.Threading.NativeOverlapped.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.InteropServices;
-
-namespace System.Threading
-{
- public struct NativeOverlapped {
- public int EventHandle;
- public int InternalHigh;
- public int InternalLow;
- public int OffsetHigh;
- public int OffsetLow;
-
- // (fields disappeared beta2 -> 1.0)
-
- // public GCHandle ReservedClassLib;
- // public int ReservedCOR1;
- // public GCHandle ReservedCOR2;
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Overlapped.cs b/mcs/class/corlib/System.Threading/Overlapped.cs
deleted file mode 100755
index 25f33bf8d5d..00000000000
--- a/mcs/class/corlib/System.Threading/Overlapped.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// System.Threading.Overlapped.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public class Overlapped
- {
- [CLSCompliant(false)][MonoTODO]
- unsafe public static void Free(NativeOverlapped *nativeOverlappedPtr) {
- // FIXME
- }
-
- [CLSCompliant(false)][MonoTODO]
- unsafe public static Overlapped Unpack(NativeOverlapped *nativeOverlappedPtr) {
- // FIXME
- return(new Overlapped());
- }
-
- [MonoTODO]
- public Overlapped() {
- // FIXME
- }
-
- [MonoTODO]
- public Overlapped(int offsetLo, int offsetHi, int hEvent, IAsyncResult ar) {
- // FIXME
- }
-
- [MonoTODO]
- public IAsyncResult AsyncResult {
- get {
- // FIXME
- return(null);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public int EventHandle {
- get {
- // FIXME
- return(0);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public int OffsetHigh {
- get {
- // FIXME
- return(0);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public int OffsetLow {
- get {
- // FIXME
- return(0);
- }
-
- set {
- }
- }
-
- [CLSCompliant(false)][MonoTODO]
- unsafe public NativeOverlapped *Pack(IOCompletionCallback iocb) {
- // FIXME
- return(null);
- }
-
- [CLSCompliant(false)][MonoTODO]
- unsafe public NativeOverlapped *UnsafePack(IOCompletionCallback iocb) {
- // FIXME
- return(null);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ReaderWriterLock.cs b/mcs/class/corlib/System.Threading/ReaderWriterLock.cs
deleted file mode 100755
index 95784811682..00000000000
--- a/mcs/class/corlib/System.Threading/ReaderWriterLock.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// System.Threading.ReaderWriterLock.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class ReaderWriterLock
- {
- [MonoTODO]
- public ReaderWriterLock() {
- // FIXME
- }
-
- [MonoTODO]
- public bool IsReaderLockHeld {
- get {
- // FIXME
- return(false);
- }
- }
-
- [MonoTODO]
- public bool IsWriterLockHeld {
- get {
- // FIXME
- return(false);
- }
- }
-
- [MonoTODO]
- public int WriterSeqNum {
- get {
- // FIXME
- return(0);
- }
- }
-
-
- [MonoTODO]
- public void AcquireReaderLock(int millisecondsTimeout) {
- // FIXME
- }
-
- [MonoTODO]
- public void AcquireReaderLock(TimeSpan timeout) {
- // FIXME
- }
-
- [MonoTODO]
- public void AcquireWriterLock(int millisecondsTimeout) {
- // FIXME
- }
-
- [MonoTODO]
- public void AcquireWriterLock(TimeSpan timeout) {
- // FIXME
- }
-
- [MonoTODO]
- public bool AnyWritersSince(int seqNum) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public void DowngradeFromWriterLock(ref LockCookie lockCookie) {
- // FIXME
- }
-
- [MonoTODO]
- public LockCookie ReleaseLock() {
- // FIXME
- return(new LockCookie());
- }
-
- [MonoTODO]
- public void ReleaseReaderLock() {
- // FIXME
- }
-
- [MonoTODO]
- public void ReleaseWriterLock() {
- // FIXME
- }
-
- [MonoTODO]
- public void RestoreLock(ref LockCookie lockCookie) {
- // FIXME
- }
-
- [MonoTODO]
- public LockCookie UpgradeToWriterLock(int millisecondsTimeout) {
- // FIXME
- return(new LockCookie());
- }
-
- [MonoTODO]
- public LockCookie UpgradeToWriterLock(TimeSpan timeout) {
- // FIXME
- return(new LockCookie());
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs b/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
deleted file mode 100755
index 8cf4d449da8..00000000000
--- a/mcs/class/corlib/System.Threading/RegisteredWaitHandle.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.Threading.RegisteredWaitHandle.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class RegisteredWaitHandle : MarshalByRefObject
- {
- internal RegisteredWaitHandle () {}
-
- [MonoTODO]
- public bool Unregister(WaitHandle waitObject) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- ~RegisteredWaitHandle() {
- // FIXME
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/SynchronizationLockException.cs b/mcs/class/corlib/System.Threading/SynchronizationLockException.cs
deleted file mode 100755
index 7d5c8090e17..00000000000
--- a/mcs/class/corlib/System.Threading/SynchronizationLockException.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Threading.SynchronizationLockException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Threading
-{
- [Serializable]
- public class SynchronizationLockException : SystemException
- {
- public SynchronizationLockException()
- : base ("Synchronization Error") {
- }
-
- public SynchronizationLockException(string message)
- : base (message) {
- }
-
- protected SynchronizationLockException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public SynchronizationLockException(string message, Exception innerException)
- : base (message, innerException) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs
deleted file mode 100755
index 9288a8b4562..00000000000
--- a/mcs/class/corlib/System.Threading/Thread.cs
+++ /dev/null
@@ -1,438 +0,0 @@
-//
-// System.Threading.Thread.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting.Contexts;
-using System.Security.Principal;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Collections;
-
-namespace System.Threading
-{
- public sealed class Thread
- {
- private bool threadpool_thread = false;
- private CultureInfo current_culture;
-
- [MonoTODO]
- public static Context CurrentContext {
- get {
- // FIXME -
- // System.Runtime.Remoting.Context not
- // yet implemented
- return(null);
- }
- }
-
- [MonoTODO]
- public static IPrincipal CurrentPrincipal {
- get {
- // FIXME -
- // System.Security.Principal.IPrincipal
- // not yet implemented
- return(null);
- }
-
- set {
- }
- }
-
- // Looks up the object associated with the current thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static Thread CurrentThread_internal();
-
- public static Thread CurrentThread {
- get {
- return(CurrentThread_internal());
- }
- }
-
- // Looks up the slot hash for the current thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static Hashtable SlotHash_lookup();
-
- // Stores the slot hash for the current thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void SlotHash_store(Hashtable slothash);
-
- private static Hashtable GetTLSSlotHash() {
- Hashtable slothash=SlotHash_lookup();
- if(slothash==null) {
- // Not synchronised, because this is
- // thread specific anyway.
- slothash=new Hashtable();
- SlotHash_store(slothash);
- }
-
- return(slothash);
- }
-
- public static LocalDataStoreSlot AllocateDataSlot() {
- LocalDataStoreSlot slot = new LocalDataStoreSlot();
-
- return(slot);
- }
-
- // Stores a hash keyed by strings of LocalDataStoreSlot objects
- static Hashtable datastorehash = Hashtable.Synchronized(new Hashtable());
-
- public static LocalDataStoreSlot AllocateNamedDataSlot(string name) {
- LocalDataStoreSlot slot = (LocalDataStoreSlot)datastorehash[name];
- if(slot!=null) {
- // This exception isnt documented (of
- // course) but .net throws it
- throw new ArgumentException("Named data slot already added");
- }
-
- slot = new LocalDataStoreSlot();
-
- datastorehash.Add(name, slot);
-
- return(slot);
- }
-
- public static void FreeNamedDataSlot(string name) {
- LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
-
- if(slot!=null) {
- datastorehash.Remove(slot);
- }
- }
-
- public static object GetData(LocalDataStoreSlot slot) {
- Hashtable slothash=GetTLSSlotHash();
- return(slothash[slot]);
- }
-
- [MonoTODO]
- public static AppDomain GetDomain() {
- // FIXME
- return(null);
- }
-
- [MonoTODO]
- public static int GetDomainID() {
- // FIXME
- return(0);
- }
-
- public static LocalDataStoreSlot GetNamedDataSlot(string name) {
- LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
-
- if(slot==null) {
- slot=AllocateNamedDataSlot(name);
- }
-
- return(slot);
- }
-
- [MonoTODO]
- public static void ResetAbort() {
- // FIXME
- }
-
- public static void SetData(LocalDataStoreSlot slot,
- object data) {
- Hashtable slothash=GetTLSSlotHash();
-
- if(slothash[slot]!=null) {
- slothash.Remove(slot);
- }
-
- slothash.Add(slot, data);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void Sleep_internal(int ms);
-
- public static void Sleep(int millisecondsTimeout) {
- if(millisecondsTimeout<0) {
- throw new ArgumentException("Negative timeout");
- }
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
-
- Sleep_internal(millisecondsTimeout);
- thread.clr_state(ThreadState.WaitSleepJoin);
- }
-
- public static void Sleep(TimeSpan timeout) {
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Timeout out of range");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- Sleep_internal(timeout.Milliseconds);
- thread.clr_state(ThreadState.WaitSleepJoin);
- }
-
- // stores a thread handle
- private IntPtr system_thread_handle;
-
- // Returns the system thread handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern IntPtr Thread_internal(ThreadStart start);
-
- public Thread(ThreadStart start) {
- if(start==null) {
- throw new ArgumentNullException("Null ThreadStart");
- }
-
- // This is a two-stage thread launch. Thread_internal
- // creates the new thread, but blocks it until
- // Start() is called later.
- system_thread_handle=Thread_internal(start);
-
- // Should throw an exception here if
- // Thread_internal returns NULL
- }
-
- [MonoTODO]
- public ApartmentState ApartmentState {
- get {
- // FIXME
- return(ApartmentState.Unknown);
- }
-
- set {
- }
- }
-
- [MonoTODO]
- public CultureInfo CurrentCulture {
- get {
- if (current_culture == null)
- current_culture = new CultureInfo ("");
- return current_culture;
- }
-
- set {
- current_culture = value;
- }
- }
-
- [MonoTODO]
- public CultureInfo CurrentUICulture {
- get {
- // FIXME
- return(null);
- }
-
- set {
- }
- }
-
- public bool IsThreadPoolThread {
- get {
- return IsThreadPoolThreadInternal;
- }
- }
-
- internal bool IsThreadPoolThreadInternal {
- get {
- return threadpool_thread;
- }
- set {
- threadpool_thread = value;
- }
- }
-
- public bool IsAlive {
- get {
- // LAMESPEC: is a Stopped or Suspended
- // thread dead?
- ThreadState curstate=state;
-
- if((curstate & ThreadState.Aborted) != 0 ||
- (curstate & ThreadState.AbortRequested) != 0 ||
- (curstate & ThreadState.Unstarted) != 0) {
- return(false);
- } else {
- return(true);
- }
- }
- }
-
- public bool IsBackground {
- get {
- if((state & ThreadState.Background) != 0) {
- return(true);
- } else {
- return(false);
- }
- }
-
- set {
- if(value==true) {
- set_state(ThreadState.Background);
- } else {
- clr_state(ThreadState.Background);
- }
- }
- }
-
- private string thread_name=null;
-
- public string Name {
- get {
- return(thread_name);
- }
-
- set {
- thread_name=value;
- }
- }
-
- [MonoTODO]
- public ThreadPriority Priority {
- get {
- // FIXME
- return(ThreadPriority.Lowest);
- }
-
- set {
- }
- }
-
- private ThreadState state=ThreadState.Unstarted;
-
- public ThreadState ThreadState {
- get {
- return(state);
- }
- }
-
- [MonoTODO]
- public void Abort() {
- // FIXME
- }
-
- [MonoTODO]
- public void Abort(object stateInfo) {
- // FIXME
- }
-
- [MonoTODO]
- public void Interrupt() {
- // FIXME
- }
-
- // The current thread joins with 'this'. Set ms to 0 to block
- // until this actually exits.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern bool Join_internal(int ms, IntPtr handle);
-
- public void Join() {
- if((state & ThreadState.Unstarted) != 0) {
- throw new ThreadStateException("Thread has not been started");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- Join_internal(Timeout.Infinite, system_thread_handle);
- thread.clr_state(ThreadState.WaitSleepJoin);
- }
-
- public bool Join(int millisecondsTimeout) {
- if(millisecondsTimeout<0) {
- throw new ArgumentException("Timeout less than zero");
- }
- if((state & ThreadState.Unstarted) != 0) {
- throw new ThreadStateException("Thread has not been started");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- bool ret=Join_internal(millisecondsTimeout,
- system_thread_handle);
- thread.clr_state(ThreadState.WaitSleepJoin);
-
- return(ret);
- }
-
- public bool Join(TimeSpan timeout) {
- // LAMESPEC: says to throw ArgumentException too
- if(timeout.Milliseconds < 0 || timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("timeout out of range");
- }
- if((state & ThreadState.Unstarted) != 0) {
- throw new ThreadStateException("Thread has not been started");
- }
-
- Thread thread=CurrentThread;
-
- thread.set_state(ThreadState.WaitSleepJoin);
- bool ret=Join_internal(timeout.Milliseconds,
- system_thread_handle);
- thread.clr_state(ThreadState.WaitSleepJoin);
-
- return(ret);
- }
-
- [MonoTODO]
- public void Resume() {
- // FIXME
- }
-
- // Launches the thread
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void Start_internal(IntPtr handle);
-
- public void Start() {
- if((state & ThreadState.Unstarted) == 0) {
- throw new ThreadStateException("Thread has already been started");
- }
-
- // Mark the thread state as Running (which is
- // all bits cleared). Therefore just remove
- // the Unstarted bit
- clr_state(ThreadState.Unstarted);
-
- // Launch this thread
- Start_internal(system_thread_handle);
- }
-
- [MonoTODO]
- public void Suspend() {
- if((state & ThreadState.Unstarted) != 0 || !IsAlive) {
- throw new ThreadStateException("Thread has not been started, or is dead");
- }
-
- set_state(ThreadState.SuspendRequested);
- // FIXME - somehow let the interpreter know that
- // this thread should now suspend
- }
-
- // Closes the system thread handle
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void Thread_free_internal(IntPtr handle);
-
- ~Thread() {
- // Free up the handle
- Thread_free_internal(system_thread_handle);
- }
-
- private void set_state(ThreadState set) {
- lock(this) {
- state |= set;
- }
- }
- private void clr_state(ThreadState clr) {
- lock(this) {
- state &= ~clr;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadAbortException.cs b/mcs/class/corlib/System.Threading/ThreadAbortException.cs
deleted file mode 100755
index d91ef0a79df..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadAbortException.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// System.Threading.ThreadAbortException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- [Serializable]
- public sealed class ThreadAbortException : SystemException
- {
- private ThreadAbortException () {}
-
- [MonoTODO]
- public object ExceptionState {
- get {
- // FIXME
- return(null);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs b/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs
deleted file mode 100755
index f6a82ec6aad..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadInterruptedException.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Threading.ThreadInterruptedException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Threading
-{
- [Serializable]
- public class ThreadInterruptedException : SystemException
- {
- public ThreadInterruptedException()
- : base ("Thread interrupted") {
- }
-
- public ThreadInterruptedException(string message)
- : base (message) {
- }
-
- protected ThreadInterruptedException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public ThreadInterruptedException(string message, Exception innerException)
- : base (message, innerException) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadPool.cs b/mcs/class/corlib/System.Threading/ThreadPool.cs
deleted file mode 100755
index af79eac307b..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadPool.cs
+++ /dev/null
@@ -1,245 +0,0 @@
-//
-// System.Threading.ThreadPool
-//
-// Author:
-// Patrik Torstensson (patrik.torstensson@labs2.com)
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-// (C) Patrik Torstensson
-//
-using System;
-using System.Collections;
-
-namespace System.Threading
-{
- /// <summary> (Patrik T notes)
- /// This threadpool is focused on saving resources not giving max performance.
- ///
- /// Note, this class is not perfect but it works. ;-) Should also replace
- /// the queue with an internal one (performance)
- ///
- /// This class should also use a specialized queue to increase performance..
- /// </summary
- ///
- public sealed class ThreadPool {
- internal struct ThreadPoolWorkItem {
- public WaitCallback _CallBack;
- public object _Context;
- }
-
- private int _ThreadTimeout;
-
- private long _MaxThreads;
- private long _CurrentThreads;
- private long _ThreadsInUse;
- private long _RequestInQueue;
- private long _ThreadCreateTriggerRequests;
-
- private Thread _MonitorThread;
- private Queue _RequestQueue;
-
- private ArrayList _Threads;
- private ManualResetEvent _DataInQueue;
-
- static ThreadPool _Threadpool;
-
- static ThreadPool() {
- _Threadpool = new ThreadPool();
- }
-
- private ThreadPool() {
- // 30 sec timeout default
- _ThreadTimeout = 30 * 1000;
-
- // Used to signal that there is data in the queue
- _DataInQueue = new ManualResetEvent(false);
-
- _Threads = ArrayList.Synchronized(new ArrayList());
-
- // Holds requests..
- _RequestQueue = Queue.Synchronized(new Queue(128));
-
- _MaxThreads = 64;
- _CurrentThreads = 0;
- _RequestInQueue = 0;
- _ThreadsInUse = 0;
- _ThreadCreateTriggerRequests = 5;
-
- // Keeps track of requests in the queue and inreases the number of threads if neededs
- _MonitorThread = new Thread(new ThreadStart(MonitorThread));
- _MonitorThread.Start();
- }
-
- internal void RemoveThread() {
- Interlocked.Decrement(ref _CurrentThreads);
- _Threads.Remove(Thread.CurrentThread);
- }
-
- internal void CheckIfStartThread() {
- bool bCreateThread = false;
-
- if (_CurrentThreads == 0) {
- bCreateThread = true;
- }
-
- if ((_MaxThreads == -1 || _CurrentThreads < _MaxThreads) && _ThreadsInUse > 0 && _RequestInQueue > _ThreadCreateTriggerRequests) {
- bCreateThread = true;
- }
-
- if (bCreateThread) {
- Interlocked.Increment(ref _CurrentThreads);
-
- Thread Start = new Thread(new ThreadStart(WorkerThread));
- Start.Start();
- Start.IsThreadPoolThreadInternal = true;
-
- _Threads.Add(Start);
- }
- }
-
- internal void AddItem(ref ThreadPoolWorkItem Item) {
- CheckIfStartThread();
-
- if (Interlocked.Increment(ref _RequestInQueue) == 1) {
- _DataInQueue.Set();
- }
-
- _RequestQueue.Enqueue(Item);
- }
-
- // Work Thread main function
- internal void WorkerThread() {
- bool bWaitForData = true;
-
- while (true) {
- if (bWaitForData) {
- if (!_DataInQueue.WaitOne(_ThreadTimeout, false)) {
- // timeout
- RemoveThread();
- return;
- }
- }
-
- Interlocked.Increment(ref _ThreadsInUse);
-
- try {
- ThreadPoolWorkItem oItem = (ThreadPoolWorkItem) _RequestQueue.Dequeue();
-
- if (Interlocked.Decrement(ref _RequestInQueue) == 0) {
- _DataInQueue.Reset();
- }
-
- oItem._CallBack(oItem._Context);
- }
- catch (InvalidOperationException) {
- // Queue empty
- bWaitForData = true;
- }
- catch (ThreadAbortException) {
- // We will leave here.. (thread abort can't be handled)
- RemoveThread();
- }
- finally {
- Interlocked.Decrement(ref _ThreadsInUse);
- }
- }
- }
-
- internal void MonitorThread() {
- while (true) {
- Thread.Sleep(500);
-
- CheckIfStartThread();
- }
- }
-
- internal bool QueueUserWorkItemInternal(WaitCallback callback) {
- return QueueUserWorkItem(callback, null);
- }
-
- internal bool QueueUserWorkItemInternal(WaitCallback callback, object context) {
- ThreadPoolWorkItem Item = new ThreadPoolWorkItem();
-
- Item._CallBack = callback;
- Item._Context = context;
-
- AddItem(ref Item);
-
- // LAMESPEC: Return value? should use exception here if anything goes wrong
- return true;
- }
-
- public static bool BindHandle(IntPtr osHandle) {
- throw new NotSupportedException("This is a win32 specific method, not supported Mono");
- }
-
- public static bool QueueUserWorkItem(WaitCallback callback) {
- return _Threadpool.QueueUserWorkItemInternal(callback);
- }
-
- public static bool QueueUserWorkItem(WaitCallback callback, object state) {
- return _Threadpool.QueueUserWorkItemInternal(callback, state);
- }
-
- public static bool UnsafeQueueUserWorkItem(WaitCallback callback, object state) {
- return _Threadpool.QueueUserWorkItemInternal(callback, state);
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, int millisecondsTimeOutInterval, bool executeOnlyOnce) {
- if (millisecondsTimeOutInterval < -1) {
- throw new ArgumentOutOfRangeException("timeout < -1");
- }
-
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, long millisecondsTimeOutInterval, bool executeOnlyOnce) {
- if (millisecondsTimeOutInterval < -1) {
- throw new ArgumentOutOfRangeException("timeout < -1");
- }
-
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, TimeSpan timeout, bool executeOnlyOnce) {
- // LAMESPEC: I assume it means "timeout" when it says "millisecondsTimeOutInterval"
- if (timeout.Milliseconds < -1) {
- throw new ArgumentOutOfRangeException("timeout < -1");
- }
- if (timeout.Milliseconds > Int32.MaxValue) {
- throw new NotSupportedException("timeout too large");
- }
-
- throw new NotImplementedException();
- }
-
- [CLSCompliant(false)][MonoTODO]
- public static RegisteredWaitHandle RegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, uint millisecondsTimeOutInterval, bool executeOnlyOnce) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, int millisecondsTimeOutInterval, bool executeOnlyOnce) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, long millisecondsTimeOutInterval, bool executeOnlyOnce) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, TimeSpan timeout, bool executeOnlyOnce) {
- throw new NotImplementedException();
- }
-
- [CLSCompliant(false)][MonoTODO]
- public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject(WaitHandle waitObject, WaitOrTimerCallback callback, object state, uint millisecondsTimeOutInterval, bool executeOnlyOnce) {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadPriority.cs b/mcs/class/corlib/System.Threading/ThreadPriority.cs
deleted file mode 100644
index ec7a32cae26..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadPriority.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// ThreadPriority.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:30:24 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Threading {
-
-
- /// <summary>
- /// </summary>
- public enum ThreadPriority {
-
- /// <summary>
- /// </summary>
- Lowest = 0,
-
- /// <summary>
- /// </summary>
- BelowNormal = 1,
-
- /// <summary>
- /// </summary>
- Normal = 2,
-
- /// <summary>
- /// </summary>
- AboveNormal = 3,
-
- /// <summary>
- /// </summary>
- Highest = 4,
- } // ThreadPriority
-
-} // System.Threading
diff --git a/mcs/class/corlib/System.Threading/ThreadStart.cs b/mcs/class/corlib/System.Threading/ThreadStart.cs
deleted file mode 100755
index ebd6bc9f764..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadStart.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.ThreadStart.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void ThreadStart();
-}
diff --git a/mcs/class/corlib/System.Threading/ThreadState.cs b/mcs/class/corlib/System.Threading/ThreadState.cs
deleted file mode 100644
index 7693dae3c81..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadState.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// ThreadState.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:30:30 UTC
-// Source file: AllTypes.xml
-// URL: http://msdn.microsoft.com/net/ecma/AllTypes.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System.Threading {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum ThreadState {
-
- /// <summary>
- /// </summary>
- Running = 0x00000000,
-
- StopRequested = 0x00000001,
- SuspendRequested = 0x00000002,
-
- /// <summary>
- /// </summary>
- Background = 0x00000004,
-
- /// <summary>
- /// </summary>
- Unstarted = 0x00000008,
-
- /// <summary>
- /// </summary>
- Stopped = 0x00000010,
-
- /// <summary>
- /// </summary>
- WaitSleepJoin = 0x00000020,
-
- Suspended = 0x00000040,
-
- /// <summary>
- /// </summary>
- AbortRequested = 0x00000080,
-
- /// <summary>
- /// </summary>
- Aborted = 0x00000100,
- } // ThreadState
-
-} // System.Threading
diff --git a/mcs/class/corlib/System.Threading/ThreadStateException.cs b/mcs/class/corlib/System.Threading/ThreadStateException.cs
deleted file mode 100755
index c359fe011b1..00000000000
--- a/mcs/class/corlib/System.Threading/ThreadStateException.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// System.Threading.ThreadStateException.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System.Threading
-{
- [Serializable]
- public class ThreadStateException : SystemException
- {
- public ThreadStateException()
- : base ("Thread State Error") {
- }
-
- public ThreadStateException(string message)
- : base (message) {
- }
-
- protected ThreadStateException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public ThreadStateException(string message, Exception innerException)
- : base (message, innerException) {
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Timeout.cs b/mcs/class/corlib/System.Threading/Timeout.cs
deleted file mode 100755
index 397e213ddf7..00000000000
--- a/mcs/class/corlib/System.Threading/Timeout.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.Threading.Timeout.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class Timeout
- {
- private Timeout () {}
- public const int Infinite=-1;
- }
-}
diff --git a/mcs/class/corlib/System.Threading/Timer.cs b/mcs/class/corlib/System.Threading/Timer.cs
deleted file mode 100755
index f134d66612a..00000000000
--- a/mcs/class/corlib/System.Threading/Timer.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// System.Threading.Timer.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public sealed class Timer : MarshalByRefObject, IDisposable
- {
- [MonoTODO]
- public Timer(TimerCallback callback, object state, int dueTime, int period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
-
- // FIXME
- }
-
- [MonoTODO]
- public Timer(TimerCallback callback, object state, long dueTime, long period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
- // FIXME
- }
-
- [MonoTODO]
- public Timer(TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period) {
- if(dueTime.Milliseconds < 0 || dueTime.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Due time out of range");
- }
- if(period.Milliseconds < 0 || period.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Period out of range");
- }
- // FIXME
- }
-
- [CLSCompliant(false)][MonoTODO]
- public Timer(TimerCallback callback, object state, uint dueTime, uint period) {
- // FIXME
- }
-
- [MonoTODO]
- public bool Change(int dueTime, int period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public bool Change(long dueTime, long period) {
- if(dueTime < -1) {
- throw new ArgumentOutOfRangeException("Due time < -1");
- }
- if(period < -1) {
- throw new ArgumentOutOfRangeException("Period < -1");
- }
- if(dueTime > 4294967294) {
- throw new NotSupportedException("Due time too large");
- }
- if(period > 4294967294) {
- throw new NotSupportedException("Period too large");
- }
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public bool Change(TimeSpan dueTime, TimeSpan period) {
- // FIXME
- return(false);
- }
-
- [CLSCompliant(false)][MonoTODO]
- public bool Change(uint dueTime, uint period) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- public void Dispose() {
- // FIXME
- }
-
- [MonoTODO]
- public bool Dispose(WaitHandle notifyObject) {
- // FIXME
- return(false);
- }
-
- [MonoTODO]
- ~Timer() {
- // FIXME
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/TimerCallback.cs b/mcs/class/corlib/System.Threading/TimerCallback.cs
deleted file mode 100755
index 3afe1fc71f2..00000000000
--- a/mcs/class/corlib/System.Threading/TimerCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.TimerCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void TimerCallback(object state);
-}
diff --git a/mcs/class/corlib/System.Threading/WaitCallback.cs b/mcs/class/corlib/System.Threading/WaitCallback.cs
deleted file mode 100755
index ed1e39c0e28..00000000000
--- a/mcs/class/corlib/System.Threading/WaitCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.WaitCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void WaitCallback(object state);
-}
diff --git a/mcs/class/corlib/System.Threading/WaitHandle.cs b/mcs/class/corlib/System.Threading/WaitHandle.cs
deleted file mode 100755
index 1d6ec67ee80..00000000000
--- a/mcs/class/corlib/System.Threading/WaitHandle.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// System.Threading.WaitHandle.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System.Threading
-{
- public abstract class WaitHandle : MarshalByRefObject, IDisposable
- {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern bool WaitAll_internal(WaitHandle[] handles, int ms, bool exitContext);
-
- public static bool WaitAll(WaitHandle[] waitHandles) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAll_internal(waitHandles, Timeout.Infinite,
- false));
- }
-
- public static bool WaitAll(WaitHandle[] waitHandles,
- int millisecondsTimeout,
- bool exitContext) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAll_internal(waitHandles, millisecondsTimeout, false));
- }
-
- public static bool WaitAll(WaitHandle[] waitHandles,
- TimeSpan timeout,
- bool exitContext) {
- if(timeout.Milliseconds < 0 ||
- timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Timeout out of range");
- }
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAll_internal(waitHandles,
- timeout.Milliseconds,
- exitContext));
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int WaitAny_internal(WaitHandle[] handles, int ms, bool exitContext);
-
- // LAMESPEC: Doesn't specify how to signal failures
- public static int WaitAny(WaitHandle[] waitHandles) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAny_internal(waitHandles, Timeout.Infinite,
- false));
- }
-
- public static int WaitAny(WaitHandle[] waitHandles,
- int millisecondsTimeout,
- bool exitContext) {
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAny_internal(waitHandles,
- millisecondsTimeout,
- exitContext));
- }
-
- public static int WaitAny(WaitHandle[] waitHandles,
- TimeSpan timeout, bool exitContext) {
- if(timeout.Milliseconds < 0 ||
- timeout.Milliseconds > Int32.MaxValue) {
- throw new ArgumentOutOfRangeException("Timeout out of range");
- }
- if(waitHandles.Length>64) {
- throw new NotSupportedException("Too many handles");
- }
- for(int i=0; i<waitHandles.Length; i++) {
- if(waitHandles[i]==null) {
- throw new ArgumentNullException("null handle");
- }
- }
-
- return(WaitAny_internal(waitHandles,
- timeout.Milliseconds,
- exitContext));
- }
-
- [MonoTODO]
- public WaitHandle() {
- // FIXME
- }
-
- public const int WaitTimeout = 258;
-
- protected IntPtr os_handle = IntPtr.Zero;
-
- public virtual IntPtr Handle {
- get {
- return(os_handle);
- }
-
- set {
- os_handle=value;
- }
- }
-
- public virtual void Close() {
- Dispose(false);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- protected virtual extern bool WaitOne_internal(IntPtr handle, int ms, bool exitContext);
-
- public virtual bool WaitOne() {
- return(WaitOne_internal(os_handle, Timeout.Infinite,
- false));
- }
-
- public virtual bool WaitOne(int millisecondsTimeout, bool exitContext) {
- return(WaitOne_internal(os_handle,
- millisecondsTimeout,
- exitContext));
- }
-
- public virtual bool WaitOne(TimeSpan timeout, bool exitContext) {
- return(WaitOne_internal(os_handle,
- timeout.Milliseconds,
- exitContext));
- }
-
- protected static readonly IntPtr InvalidHandle;
-
- private bool disposed = false;
-
- public void Dispose() {
- Dispose(true);
- // Take yourself off the Finalization queue
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool explicitDisposing) {
- // Check to see if Dispose has already been called.
- if(!this.disposed) {
- // If this is a call to Dispose,
- // dispose all managed resources.
- if(explicitDisposing) {
- // Free up stuff here
- //Components.Dispose();
- }
-
- // Release unmanaged resources
- // Note that this is not thread safe.
- // Another thread could start
- // disposing the object after the
- // managed resources are disposed, but
- // before the disposed flag is set to
- // true.
- this.disposed=true;
- //Release(handle);
- //handle=IntPtr.Zero;
- }
- }
-
- ~WaitHandle() {
- Dispose(false);
- }
- }
-}
diff --git a/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs b/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs
deleted file mode 100755
index 03a03d7a318..00000000000
--- a/mcs/class/corlib/System.Threading/WaitOrTimerCallback.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// System.Threading.WaitOrTimerCallback.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-namespace System.Threading
-{
- public delegate void WaitOrTimerCallback(object state, bool timedOut);
-}
diff --git a/mcs/class/corlib/System/Activator.cs b/mcs/class/corlib/System/Activator.cs
deleted file mode 100644
index 6cd28080268..00000000000
--- a/mcs/class/corlib/System/Activator.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// System.Activator.cs
-//
-// Author:
-// Nick Drochak II (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System.Runtime.Remoting;
-using System.Reflection;
-using System.Globalization;
-using System.Security.Policy;
-
-namespace System
-{
- // FIXME: This class is just stubs to get System.dll to compile
- public sealed class Activator
- {
- private Activator () {}
-
- [MonoTODO]
- public static ObjectHandle CreateComInstanceFrom(string assemblyName,
- string typeName) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static ObjectHandle CreateInstanceFrom(string assemblyFile,
- string typeName) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static ObjectHandle CreateInstanceFrom(string assemblyFile,
- string typeName, object[] activationAttributes) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static ObjectHandle CreateInstanceFrom(string assemblyFile,
- string typeName, bool ignoreCase, BindingFlags bindingAttr,
- Binder binder, object[] args, CultureInfo culture, object[] activationAttributes,
- Evidence securityInfo) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static ObjectHandle CreateInstance(string assemblyName,
- string typeName) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static ObjectHandle CreateInstance(string assemblyName,
- string typeName, object[] activationAttributes) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static ObjectHandle CreateInstance(string assemblyName,
- string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder,
- object[] args, CultureInfo culture, object[] activationAttributes,
- Evidence securityInfo) {
- throw new NotImplementedException();
- }
-
- public static object CreateInstance(Type type) {
- return CreateInstance (type, false);
- }
-
- public static object CreateInstance(Type type, object[] args) {
- return CreateInstance (type, args, new object [0]);
- }
-
- [MonoTODO]
- public static object CreateInstance(Type type, object[] args, object[] activationAttributes) {
- Type[] atypes = new Type [args.Length];
- for (int i = 0; i < args.Length; ++i) {
- atypes [i] = args [i].GetType ();
- }
- ConstructorInfo ctor = type.GetConstructor (atypes);
- return ctor.Invoke (args);
-
- }
-
- [MonoTODO]
- public static object CreateInstance(Type type,
- BindingFlags bindingAttr, Binder binder, object[] args,
- CultureInfo culture) {
- return CreateInstance (type, bindingAttr, binder, args, culture, new object [0]);
- }
-
- [MonoTODO]
- public static object CreateInstance(Type type,
- BindingFlags bindingAttr, Binder binder, object[] args,
- CultureInfo culture, object[] activationAttributes) {
- Type[] atypes = new Type [args.Length];
- for (int i = 0; i < args.Length; ++i) {
- atypes [i] = args [i].GetType ();
- }
- ConstructorInfo ctor = type.GetConstructor (bindingAttr, binder, atypes, null);
- return ctor.Invoke (args, bindingAttr, binder, args, culture);
- }
-
- [MonoTODO]
- public static object CreateInstance(Type type, bool nonPublic) {
- ConstructorInfo ctor = type.GetConstructor (Type.EmptyTypes);
- return ctor.Invoke (null);
- }
-
- [MonoTODO]
- public static object GetObject(Type type,
- string url) {
- throw new NotImplementedException();
- }
-
- [MonoTODO]
- public static object GetObject(Type type,
- string url, object state) {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs
deleted file mode 100755
index 31cc6bcca04..00000000000
--- a/mcs/class/corlib/System/AppDomain.cs
+++ /dev/null
@@ -1,462 +0,0 @@
-//
-// System/AppDomain.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Dietmar Maurer (dietmar@ximian.com)
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001, 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Runtime.Remoting;
-using System.Security.Principal;
-using System.Security.Policy;
-using System.Security;
-
-namespace System {
-
- public sealed class AppDomain : MarshalByRefObject , _AppDomain , IEvidenceFactory {
-
- IntPtr _mono_app_domain;
-
- // Evidence evidence;
-
- private AppDomain () {}
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern AppDomainSetup getSetup ();
-
- public AppDomainSetup SetupInformation {
-
- get {
- return getSetup ();
- }
- }
-
- public string BaseDirectory {
-
- get {
- return SetupInformation.ApplicationBase;
- }
- }
-
- public string RelativeSearchPath {
-
- get {
- return SetupInformation.PrivateBinPath;
- }
- }
-
- public string DynamicDirectory {
-
- get {
- // fixme: dont know if this is right?
- return SetupInformation.DynamicBase;
- }
- }
-
- public bool ShadowCopyFiles {
-
- get {
- if (SetupInformation.ShadowCopyFiles == "true")
- return true;
- return false;
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern string getFriendlyName ();
-
- public string FriendlyName {
-
- get {
- return getFriendlyName ();
- }
- }
-
- public Evidence Evidence {
-
- get {
- return null;
- //return evidence;
- }
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private static extern AppDomain getCurDomain ();
-
- public static AppDomain CurrentDomain
- {
- get {
- return getCurDomain ();
- }
- }
-
- [MonoTODO]
- public void AppendPrivatePath (string path)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void ClearPrivatePath ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void ClearShadowCopyPath ()
- {
- throw new NotImplementedException ();
- }
-
- public ObjectHandle CreateInstance (string assemblyName, string typeName)
- {
- return CreateInstance (assemblyName, typeName, false, 0,
- null, null, null, null, null);
- }
-
- public ObjectHandle CreateInstance (string assemblyName, string typeName,
- object[] activationAttributes)
- {
- return CreateInstance (assemblyName, typeName, false, 0,
- null, null, null, activationAttributes, null);
- }
-
- [MonoTODO]
- public ObjectHandle CreateInstance (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes)
- {
- throw new NotImplementedException ();
- }
-
- public ObjectHandle CreateInstanceFrom (string assemblyName, string typeName)
- {
- return CreateInstanceFrom (assemblyName, typeName, false, 0,
- null, null, null, null, null);
- }
-
- public ObjectHandle CreateInstanceFrom (string assemblyName, string typeName,
- object[] activationAttributes)
- {
- return CreateInstanceFrom (assemblyName, typeName, false, 0,
- null, null, null, activationAttributes, null);
- }
-
- [MonoTODO]
- public ObjectHandle CreateInstanceFrom (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes)
- {
- throw new NotImplementedException ();
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access)
- {
- return DefineDynamicAssembly (name, access, null, null,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence)
- {
- return DefineDynamicAssembly (name, access, null, evidence,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir)
- {
- return DefineDynamicAssembly (name, access, dir, null,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence)
- {
- return DefineDynamicAssembly (name, access, dir, evidence,
- null, null, null, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, null, null,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, null, evidence,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, dir, null,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions)
- {
- return DefineDynamicAssembly (name, access, dir, evidence,
- requiredPermissions, optionalPermissions,
- refusedPersmissions, false);
-
- }
-
- public AssemblyBuilder DefineDynamicAssembly (AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions,
- bool isSynchronized)
- {
- // FIXME: examine all other parameters
-
- AssemblyBuilder ab = new AssemblyBuilder (name, dir, access);
- return ab;
- }
-
-
- [MonoTODO]
- public void DoCallBack (CrossAppDomainDelegate theDelegate)
- {
- throw new NotImplementedException ();
- }
-
- public override bool Equals (object other)
- {
- if (!(other is AppDomain))
- return false;
-
- return this._mono_app_domain == ((AppDomain)other)._mono_app_domain;
- }
-
- public int ExecuteAssembly (string assemblyFile)
- {
- return ExecuteAssembly (assemblyFile, new Evidence (), null);
- }
-
- public int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity)
- {
- return ExecuteAssembly (assemblyFile, new Evidence (), null);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern Assembly [] GetAssemblies ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern object GetData (string name);
-
- public override int GetHashCode ()
- {
- return (int)_mono_app_domain;
- }
-
- [MonoTODO]
- public override object InitializeLifetimeService ()
- {
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern Assembly LoadAssembly (AssemblyName assemblyRef, Evidence securityEvidence);
-
- public Assembly Load (AssemblyName assemblyRef)
- {
- return Load (assemblyRef, new Evidence ());
- }
-
- public Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
- {
- return LoadAssembly (assemblyRef, assemblySecurity);
- }
-
- public Assembly Load (string assemblyString)
- {
- AssemblyName an = new AssemblyName ();
- an.Name = assemblyString;
-
- return Load (an, new Evidence ());
- }
-
- public Assembly Load (string assemblyString, Evidence assemblySecurity)
- {
- AssemblyName an = new AssemblyName ();
- an.Name = assemblyString;
-
- return Load (an, assemblySecurity);
- }
-
- public Assembly Load (byte[] rawAssembly)
- {
- return Load (rawAssembly, null, new Evidence ());
- }
-
- public Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore)
- {
- return Load (rawAssembly, rawSymbolStore, new Evidence ());
- }
-
- [MonoTODO]
- public Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SetAppDomainPolicy (PolicyLevel domainPolicy)
- {
- throw new NotImplementedException ();
- }
-
- public void SetCachePath (string s)
- {
- SetupInformation.CachePath = s;
- }
-
- [MonoTODO]
- public void SetPrincipalPolicy (PrincipalPolicy policy)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SetShadowCopyPath (string s)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void SetThreadPrincipal (IPrincipal principal)
- {
- throw new NotImplementedException ();
- }
-
- public static AppDomain CreateDomain (string friendlyName)
- {
- return CreateDomain (friendlyName, new Evidence (), new AppDomainSetup ());
- }
-
- public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo)
- {
- return CreateDomain (friendlyName, securityInfo, new AppDomainSetup ());
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private static extern AppDomain createDomain (string friendlyName, AppDomainSetup info);
-
- public static AppDomain CreateDomain (string friendlyName,
- Evidence securityInfo,
- AppDomainSetup info)
- {
- if (friendlyName == null || securityInfo == null || info == null)
- throw new System.ArgumentNullException();
-
- AppDomain ad = createDomain (friendlyName, info);
-
- // ad.evidence = securityInfo;
-
- return ad;
- }
-
- public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo,
- string appBasePath, string appRelativeSearchPath,
- bool shadowCopyFiles)
- {
- AppDomainSetup info = new AppDomainSetup ();
-
- info.ApplicationBase = appBasePath;
- info.PrivateBinPath = appRelativeSearchPath;
-
- if (shadowCopyFiles)
- info.ShadowCopyFiles = "true";
- else
- info.ShadowCopyFiles = "false";
-
- return CreateDomain (friendlyName, securityInfo, info);
- }
-
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern void Unload (AppDomain domain);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern void SetData (string name, object data);
-
- [MonoTODO]
- public static int GetCurrentThreadId ()
- {
- throw new NotImplementedException ();
- }
-
-
- public event AssemblyLoadEventHandler AssemblyLoad;
-
- public event ResolveEventHandler AssemblyResolve;
-
- public event EventHandler DomainUnload;
-
- public event EventHandler ProcessExit;
-
- public event ResolveEventHandler ResourceResolve;
-
- public event ResolveEventHandler TypeResolve;
-
- public event UnhandledExceptionEventHandler UnhandledException;
-
- }
-}
diff --git a/mcs/class/corlib/System/AppDomainSetup.cs b/mcs/class/corlib/System/AppDomainSetup.cs
deleted file mode 100755
index 38620b7a5a3..00000000000
--- a/mcs/class/corlib/System/AppDomainSetup.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// System/AppDomainSetup.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
-
- [Serializable]
- public sealed class AppDomainSetup : IAppDomainSetup {
- string application_base;
- string application_name;
- string cache_path;
- string configuration_file;
- string dynamic_base;
- string license_file;
- string private_bin_path;
- string private_bin_path_probe;
- string shadow_copy_directories;
- string shadow_copy_files;
- bool publisher_policy;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern AppDomainSetup InitAppDomainSetup (AppDomainSetup setup);
-
- public AppDomainSetup ()
- {
- InitAppDomainSetup (this);
- }
-
- public string ApplicationBase {
-
- get {
- return application_base;
- }
-
- set {
- application_base = value;
- }
- }
-
- public string ApplicationName {
-
- get {
- return application_name;
- }
-
- set {
- application_name = value;
- }
- }
-
- public string CachePath {
-
- get {
- return cache_path;
- }
-
- set {
- cache_path = value;
- }
- }
-
- public string ConfigurationFile {
-
- get {
- return configuration_file;
- }
-
- set {
- configuration_file = value;
- }
- }
-
- public bool DisallowPublisherPolicy {
- get {
- return publisher_policy;
- }
-
- set {
- publisher_policy = value;
- }
- }
-
- public string DynamicBase {
-
- get {
- return dynamic_base;
- }
-
- set {
- dynamic_base = value;
- }
- }
-
- public string LicenseFile {
-
- get {
- return license_file;
- }
-
- set {
- license_file = value;
- }
- }
-
-
-
- public string PrivateBinPath {
-
- get {
- return private_bin_path;
- }
-
- set {
- private_bin_path = value;
- }
- }
-
- public string PrivateBinPathProbe {
-
- get {
- return private_bin_path_probe;
- }
-
- set {
- private_bin_path_probe = value;
- }
- }
-
- public string ShadowCopyDirectories {
-
- get {
- return shadow_copy_directories;
- }
-
- set {
- shadow_copy_directories = value;
- }
- }
-
- public string ShadowCopyFiles {
-
- get {
- return shadow_copy_files;
- }
-
- set {
- shadow_copy_files = value;
- }
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/AppDomainUnloadedException.cs b/mcs/class/corlib/System/AppDomainUnloadedException.cs
deleted file mode 100644
index 9ca65e65c9c..00000000000
--- a/mcs/class/corlib/System/AppDomainUnloadedException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.AppDomainUnloadedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class AppDomainUnloadedException : SystemException
- {
- // Constructors
- public AppDomainUnloadedException ()
- : base (Locale.GetText ("Can't access an unloaded application domain."))
- {
- }
-
- public AppDomainUnloadedException (string message)
- : base (message)
- {
- }
-
- protected AppDomainUnloadedException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public AppDomainUnloadedException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ApplicationException.cs b/mcs/class/corlib/System/ApplicationException.cs
deleted file mode 100644
index 9420c119430..00000000000
--- a/mcs/class/corlib/System/ApplicationException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.ApplicationException.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
-
- [Serializable]
- public class ApplicationException : Exception
- {
- // Constructors
- public ApplicationException ()
- : base (Locale.GetText ("An application exception has occurred."))
- {
- }
-
- public ApplicationException (string message)
- : base (message)
- {
- }
-
- public ApplicationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected ApplicationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArgumentException.cs b/mcs/class/corlib/System/ArgumentException.cs
deleted file mode 100644
index 15bd7607e4f..00000000000
--- a/mcs/class/corlib/System/ArgumentException.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// System.ArgumentException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public class ArgumentException : SystemException {
- private string param_name;
-
- // Constructors
- public ArgumentException ()
- : base (Locale.GetText ("An invalid argument was specified."))
- {
- }
-
- public ArgumentException (string message)
- : base (message)
- {
- }
-
- public ArgumentException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public ArgumentException (string message, string param_name)
- : base (message)
- {
- this.param_name = param_name;
- }
-
- public ArgumentException (string message, string param_name, Exception inner)
- : base (message, inner)
- {
- this.param_name = param_name;
- }
-
- protected ArgumentException (SerializationInfo info, StreamingContext sc)
- : base (info, sc)
- {
- param_name = info.GetString ("ParamName");
- }
-
- // Properties
- public virtual string ParamName {
- get {
- return param_name;
- }
- }
-
- public override string Message {
- get {
- string base_message = base.Message;
- if (base_message == null)
- base_message = Locale.GetText ("An invalid argument was specified.");
-
- if (param_name == null)
- return base_message;
- else
- return base_message + " (" + ParamName + ")";
- }
- }
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ParamName", param_name);
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArgumentNullException.cs b/mcs/class/corlib/System/ArgumentNullException.cs
deleted file mode 100644
index 4963f560830..00000000000
--- a/mcs/class/corlib/System/ArgumentNullException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ArgumentNullException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public class ArgumentNullException : ArgumentException {
- // Constructors
- public ArgumentNullException ()
- : base (Locale.GetText ("Argument cannot be null"))
- {
- }
-
- public ArgumentNullException (string param_name)
- : base (Locale.GetText ("Argument {0} cannot be null"), param_name)
- {
- }
-
- public ArgumentNullException (string param_name, string message)
- : base (message, param_name)
- {
- }
-
- protected ArgumentNullException (SerializationInfo info, StreamingContext sc)
- : base (info, sc)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArgumentOutOfRangeException.cs b/mcs/class/corlib/System/ArgumentOutOfRangeException.cs
deleted file mode 100644
index 34e994a50c8..00000000000
--- a/mcs/class/corlib/System/ArgumentOutOfRangeException.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// System.ArgumentOutOfRangeException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class ArgumentOutOfRangeException : ArgumentException {
- private object actual_value;
-
- // Constructors
- public ArgumentOutOfRangeException ()
- : base (Locale.GetText ("Argument is out of range"))
- {
- }
-
- public ArgumentOutOfRangeException (string param_name)
- : base (Locale.GetText ("Argument is out of range"), param_name)
- {
- }
-
- public ArgumentOutOfRangeException (string param_name, string message)
- : base (message, param_name)
- {
- }
-
- public ArgumentOutOfRangeException (string param_name, object actual_value, string message)
- : base (message, param_name)
- {
- this.actual_value = actual_value;
- }
-
- protected ArgumentOutOfRangeException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- actual_value = info.GetString ("ActualValue");
- }
-
- // Properties
- public virtual object ActualValue {
- get {
- return actual_value;
- }
- }
-
- public override string Message {
- get {
- if (actual_value == null)
- return Locale.GetText ("Argument is out of range.");
- else
- return Locale.GetText ("Argument is out of range.") + actual_value;
- }
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("ActualValue", actual_value);
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ArithmeticException.cs b/mcs/class/corlib/System/ArithmeticException.cs
deleted file mode 100644
index ff6c98cbb35..00000000000
--- a/mcs/class/corlib/System/ArithmeticException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ArithmeticException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class ArithmeticException : SystemException {
- // Constructors
- public ArithmeticException ()
- : base (Locale.GetText ("The arithmetic operation is not allowed"))
- {
- }
-
- public ArithmeticException (string message)
- : base (message)
- {
- }
-
- public ArithmeticException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected ArithmeticException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs
deleted file mode 100644
index 43e8344bcdc..00000000000
--- a/mcs/class/corlib/System/Array.cs
+++ /dev/null
@@ -1,838 +0,0 @@
-
-// System.Array.cs
-//
-// Authors:
-// Joe Shaw (joe@ximian.com)
-// Martin Baulig (martin@gnome.org)
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Collections;
-using System.Runtime.CompilerServices;
-
-namespace System
-{
-
- [Serializable]
- public abstract class Array : ICloneable, ICollection, IList, IEnumerable
- {
- // Constructor
- private Array ()
- {
- /* empty */
- }
-
- // Properties
- public int Length
- {
- get
- {
- int length = this.GetLength (0);
-
- for (int i = 1; i < this.Rank; i++) {
- length *= this.GetLength (i);
- }
-
- return length;
- }
- }
-
- public int Rank
- {
- get
- {
- return this.GetRank ();
- }
- }
-
- // IList interface
- object IList.this [int index] {
- get {
- return GetValueImpl (index);
- }
- set {
- SetValueImpl (value, index);
- }
- }
-
- int IList.Add (object value) {
- throw new NotSupportedException ();
- }
-
- void IList.Clear () {
- Array.Clear (this, this.GetLowerBound(0), this.Length);
- }
-
- bool IList.Contains (object value) {
- if (this.Rank > 1)
- throw new RankException ("Only single dimension arrays are supported.");
-
- int length = this.Length;
- for (int i = 0; i < length; i++) {
- if (value.Equals (this.GetValueImpl (i)))
- return true;
- }
- return false;
- }
-
- int IList.IndexOf (object value) {
- if (this.Rank > 1)
- throw new RankException ();
-
- int length = this.Length;
- for (int i = 0; i < length; i++) {
- if (value.Equals (this.GetValueImpl (i)))
- // array index may not be zero-based.
- // use lower bound
- return i + this.GetLowerBound (0);
- }
-
- int retVal;
- unchecked {
- // lower bound may be MinValue
- retVal = this.GetLowerBound (0) - 1;
- }
-
- return retVal;
- }
-
- void IList.Insert (int index, object value) {
- throw new NotSupportedException ();
- }
-
- void IList.Remove (object value) {
- throw new NotSupportedException ();
- }
-
- void IList.RemoveAt (int index) {
- throw new NotSupportedException ();
- }
-
- // InternalCall Methods
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern int GetRank ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern int GetLength (int dimension);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern int GetLowerBound (int dimension);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern object GetValue (int[] idxs);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern void SetValue (object value, int[] idxs);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern object GetValueImpl (int pos);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern void SetValueImpl (object value, int pos);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static void FastCopy (Array source, int source_idx, Array dest, int dest_idx, int length);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern static Array CreateInstanceImpl(Type elementType, int[] lengths, int [] bounds);
-
- // Properties
- int ICollection.Count {
- get {
- return Length;
- }
- }
-
- [MonoTODO]
- public virtual bool IsSynchronized {
- get {
- // FIXME?
- return false;
- }
- }
-
- [MonoTODO]
- public virtual object SyncRoot {
- get {
- // FIXME
- return null;
- }
- }
-
- public virtual bool IsFixedSize
- {
- get {
- return true;
- }
- }
-
- public virtual bool IsReadOnly
- {
- get{
- return false;
- }
- }
-
- public virtual IEnumerator GetEnumerator ()
- {
- return new SimpleEnumerator(this);
- }
-
- public int GetUpperBound (int dimension)
- {
- return GetLowerBound (dimension) +
- GetLength (dimension) - 1;
- }
-
- public object GetValue (int idx)
- {
- int[] ind = new int [1];
-
- ind [0] = idx;
-
- return GetValue (ind);
- }
-
- public object GetValue (int idx1, int idx2)
- {
- int[] ind = new int [2];
-
- ind [0] = idx1;
- ind [1] = idx2;
-
- return GetValue (ind);
- }
-
- public object GetValue (int idx1, int idx2, int idx3)
- {
- int[] ind = new int [3];
-
- ind [0] = idx1;
- ind [1] = idx2;
- ind [2] = idx3;
-
- return GetValue (ind);
- }
-
- // This function is currently unused, but just in case we need it later on ... */
- internal int IndexToPos (int[] idxs)
- {
- if (idxs == null)
- throw new ArgumentNullException ();
-
- if ((idxs.Rank != 1) || (idxs.Length != Rank))
- throw new ArgumentException ();
-
- if ((idxs [0] < GetLowerBound (0)) || (idxs [0] > GetUpperBound (0)))
- throw new IndexOutOfRangeException();
-
- int pos = idxs [0] - GetLowerBound (0);
- for (int i = 1; i < Rank; i++) {
- if ((idxs [i] < GetLowerBound (i)) || (idxs [i] > GetUpperBound (i)))
- throw new IndexOutOfRangeException();
-
- pos *= GetLength (i);
- pos += idxs [i] - GetLowerBound (i);
- }
-
- return pos;
- }
-
- public void SetValue (object value, int idx)
- {
- int[] ind = new int [1];
-
- ind [0] = idx;
-
- SetValue (value, ind);
- }
-
- public void SetValue (object value, int idx1, int idx2)
- {
- int[] ind = new int [2];
-
- ind [0] = idx1;
- ind [1] = idx2;
-
- SetValue (value, ind);
- }
-
- public void SetValue (object value, int idx1, int idx2, int idx3)
- {
- int[] ind = new int [3];
-
- ind [0] = idx1;
- ind [1] = idx2;
- ind [2] = idx3;
-
- SetValue (value, ind);
- }
-
- public static Array CreateInstance(Type elementType, int length)
- {
- int[] lengths = new int [1];
- int[] bounds = null;
-
- lengths [0] = length;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int l1, int l2)
- {
- int[] lengths = new int [2];
- int[] bounds = null;
-
- lengths [0] = l1;
- lengths [1] = l2;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int l1, int l2, int l3)
- {
- int[] lengths = new int [3];
- int[] bounds = null;
-
- lengths [0] = l1;
- lengths [1] = l2;
- lengths [2] = l3;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int[] lengths)
- {
- int[] bounds = null;
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
- public static Array CreateInstance(Type elementType, int[] lengths, int [] bounds)
- {
- if (bounds == null)
- throw new ArgumentNullException("bounds");
-
- return CreateInstanceImpl (elementType, lengths, bounds);
- }
-
-
- public static int BinarySearch (Array array, object value)
- {
- if (array == null)
- throw new ArgumentNullException("array");
-
- if (array.Rank > 1)
- throw new RankException();
-
- if (!(value is IComparable))
- throw new ArgumentException("value does not support IComparable");
-
- return BinarySearch (array, array.GetLowerBound (0), array.GetLength (0),
- value, null);
- }
-
- public static int BinarySearch (Array array, object value, IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException("array");
-
- if (array.Rank > 1)
- throw new RankException();
-
- if ((comparer == null) && !(value is IComparable))
- throw new ArgumentException("comparer is null and value does not support IComparable");
-
- return BinarySearch (array, array.GetLowerBound (0), array.GetLength (0),
- value, comparer);
- }
-
- public static int BinarySearch (Array array, int index, int length, object value)
- {
- if (array == null)
- throw new ArgumentNullException("array");
-
- if (array.Rank > 1)
- throw new RankException();
-
- if (index < array.GetLowerBound (0))
- throw new ArgumentOutOfRangeException("index is less than the lower bound of array.");
- if (length < 0)
- throw new ArgumentOutOfRangeException("length is less than zero.");
-
- if (index + length > array.GetLowerBound (0) + array.GetLength (0))
- throw new ArgumentException("index and length do not specify a valid range in array.");
- if (!(value is IComparable))
- throw new ArgumentException("value does not support IComparable");
-
- return BinarySearch (array, index, length, value, null);
- }
-
- public static int BinarySearch (Array array, int index,
- int length, object value,
- IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (index < array.GetLowerBound (0))
- throw new ArgumentOutOfRangeException("index is less than the lower bound of array.");
- if (length < 0)
- throw new ArgumentOutOfRangeException("length is less than zero.");
-
- if (index + length > array.GetLowerBound (0) + array.GetLength (0))
- throw new ArgumentException("index and length do not specify a valid range in array.");
-
- if ((comparer == null) && !(value is IComparable))
- throw new ArgumentException("comparer is null and value does not support IComparable");
-
- // cache this in case we need it
- IComparable valueCompare = value as IComparable;
-
- int iMin = index;
- int iMax = index + length;
- int iCmp = 0;
- try
- {
- // there's a subtle balance here between
- // 1) the while condition
- // 2) the rounding down of the '/ 2'
- // 3) the asymetrical recursion
- // 4) the fact that iMax starts beyond the end of the array
- while (iMin < iMax)
- {
- int iMid = (iMin + iMax) / 2;
- object elt = array.GetValueImpl (iMid);
-
- // this order is from MSDN
- if (comparer != null)
- iCmp = comparer.Compare (value, elt);
- else
- {
- IComparable eltCompare = elt as IComparable;
- if (eltCompare != null)
- iCmp = -eltCompare.CompareTo (value);
- else
- iCmp = valueCompare.CompareTo (elt);
- }
-
- if (iCmp == 0)
- return iMid;
- else if (iCmp < 0)
- iMax = iMid;
- else
- iMin = iMid + 1; // compensate for the rounding down
- }
- }
- catch (InvalidCastException e)
- {
- throw new ArgumentException ("array", e);
- }
-
- if (iCmp > 0)
- return ~iMax;
- else
- return ~iMin;
- }
-
- public static void Clear (Array array, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (index < array.GetLowerBound (0) || length < 0 ||
- index + length > array.GetUpperBound (0) + 1)
- throw new ArgumentOutOfRangeException ();
-
- for (int i = 0; i < length; i++)
- {
- array.SetValueImpl(null, index + i);
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public virtual extern object Clone ();
-
- public static void Copy (Array source, Array dest, int length)
- {
- // need these checks here because we are going to use
- // GetLowerBound() on source and dest.
- if (source == null)
- throw new ArgumentNullException ("null");
-
- if (dest == null)
- throw new ArgumentNullException ("dest");
-
- Copy (source, source.GetLowerBound (0), dest, dest.GetLowerBound (0), length);
- }
-
- public static void Copy (Array source, int source_idx, Array dest, int dest_idx, int length)
- {
- if (source == null)
- throw new ArgumentNullException ("null");
-
- if (dest == null)
- throw new ArgumentNullException ("dest");
-
- if (length < 0)
- throw new ArgumentOutOfRangeException ("length");
-
- if (source_idx < 0)
- throw new ArgumentException ("source_idx");
-
- if (dest_idx < 0)
- throw new ArgumentException ("dest_idx");
-
- int source_pos = source_idx - source.GetLowerBound (0);
- int dest_pos = dest_idx - dest.GetLowerBound (0);
-
-
- if (source_pos + length > source.Length || dest_pos + length > dest.Length)
- throw new ArgumentException ("length");
-
- if (source.Rank != dest.Rank)
- throw new RankException ();
-
- Type src_type = source.GetType ().GetElementType ();
- Type dst_type = dest.GetType ().GetElementType ();
-
- if (src_type == dst_type) {
- FastCopy (source, source_pos, dest, dest_pos, length);
- return;
- }
-
- if (!Object.ReferenceEquals (source, dest) || source_pos > dest_pos)
- {
- for (int i = 0; i < length; i++)
- {
- Object srcval = source.GetValueImpl (source_pos + i);
-
- try {
- dest.SetValueImpl (srcval, dest_pos + i);
- } catch {
- if ((dst_type.IsValueType || dst_type.Equals (typeof (String))) &&
- (src_type.Equals (typeof (Object))))
- throw new InvalidCastException ();
- else
- throw new ArrayTypeMismatchException (
- String.Format ("(Types: source={0}; target={1})", src_type.FullName, dst_type.FullName));
- }
- }
- }
- else
- {
- for (int i = length - 1; i >= 0; i--)
- {
- Object srcval = source.GetValueImpl (source_pos + i);
-
- try {
- dest.SetValueImpl (srcval, dest_pos + i);
- } catch {
- if ((dst_type.IsValueType || dst_type.Equals (typeof (String))) &&
- (src_type.Equals (typeof (Object))))
- throw new InvalidCastException ();
- else
- throw new ArrayTypeMismatchException (
- String.Format ("(Types: source={0}; target={1})", src_type.FullName, dst_type.FullName));
- }
- }
- }
- }
-
- public static int IndexOf (Array array, object value)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- return IndexOf (array, value, 0, array.Length);
- }
-
- public static int IndexOf (Array array, object value, int index)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- return IndexOf (array, value, index, array.Length - index);
- }
-
- public static int IndexOf (Array array, object value, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (length < 0 || index < array.GetLowerBound (0) ||
- index+length-1 > array.GetUpperBound (0))
- throw new ArgumentOutOfRangeException ();
-
- for (int i = 0; i < length; i++)
- {
- if (array.GetValueImpl(index + i).Equals(value))
- return index + i;
- }
-
- return array.GetLowerBound (0) - 1;
- }
-
- public static int LastIndexOf (Array array, object value)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- return LastIndexOf (array, value, array.Length-1);
- }
-
- public static int LastIndexOf (Array array, object value, int index)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- return LastIndexOf (array, value, index, index-array.GetLowerBound(0)+1);
- }
-
- public static int LastIndexOf (Array array, object value, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (length < 0 || index-length+1 < array.GetLowerBound (0) ||
- index > array.GetUpperBound (0))
- throw new ArgumentOutOfRangeException ();
-
- for (int i = index; i >= index-length+1; i--)
- {
- if (array.GetValueImpl(i).Equals(value))
- return i;
- }
-
- return array.GetLowerBound (0) - 1;
- }
-
- public static void Reverse (Array array)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- Reverse (array, array.GetLowerBound (0), array.GetLength (0));
- }
-
- public static void Reverse (Array array, int index, int length)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- if (array.Rank > 1)
- throw new RankException ();
-
- if (index < array.GetLowerBound (0) || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (index + length > array.GetUpperBound (0) + 1)
- throw new ArgumentException ();
-
- for (int i = 0; i < length/2; i++)
- {
- object tmp;
-
- tmp = array.GetValueImpl (index + i);
- array.SetValueImpl(array.GetValueImpl (index + length - i - 1), index + i);
- array.SetValueImpl(tmp, index + length - i - 1);
- }
- }
-
- public static void Sort (Array array)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- Sort (array, null, array.GetLowerBound (0), array.GetLength (0), null);
- }
-
- public static void Sort (Array keys, Array items)
- {
- if (keys == null)
- throw new ArgumentNullException ();
-
- Sort (keys, items, keys.GetLowerBound (0), keys.GetLength (0), null);
- }
-
- public static void Sort (Array array, IComparer comparer)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- Sort (array, null, array.GetLowerBound (0), array.GetLength (0), comparer);
- }
-
- public static void Sort (Array array, int index, int length)
- {
- Sort (array, null, index, length, null);
- }
-
- public static void Sort (Array keys, Array items, IComparer comparer)
- {
- if (keys == null)
- throw new ArgumentNullException ();
-
- Sort (keys, items, keys.GetLowerBound (0), keys.GetLength (0), comparer);
- }
-
- public static void Sort (Array keys, Array items, int index, int length)
- {
- Sort (keys, items, index, length, null);
- }
-
- public static void Sort (Array array, int index, int length, IComparer comparer)
- {
- Sort (array, null, index, length, comparer);
- }
-
- public static void Sort (Array keys, Array items, int index, int length, IComparer comparer)
- {
- int low0 = index;
- int high0 = index + length - 1;
-
- qsort (keys, items, index, index + length - 1, comparer);
- }
-
- private static void qsort (Array keys, Array items, int low0, int high0, IComparer comparer)
- {
- if (keys == null)
- throw new ArgumentNullException ();
-
- if (keys.Rank > 1 || (items != null && items.Rank > 1))
- throw new RankException ();
-
- if (low0 >= high0)
- return;
-
- int low = low0;
- int high = high0;
-
- object objPivot = keys.GetValueImpl ((low + high) / 2);
-
- while (low <= high)
- {
- // Move the walls in
- while (low < high0 && compare (keys.GetValueImpl (low), objPivot, comparer) < 0)
- ++low;
- while (high > low0 && compare (objPivot, keys.GetValueImpl (high), comparer) < 0)
- --high;
-
- if (low <= high)
- {
- swap (keys, items, low, high);
- ++low;
- --high;
- }
- }
-
- if (low0 < high)
- qsort (keys, items, low0, high, comparer);
- if (low < high0)
- qsort (keys, items, low, high0, comparer);
- }
-
- private static void swap (Array keys, Array items, int i, int j)
- {
- object tmp;
-
- tmp = keys.GetValueImpl (i);
- keys.SetValueImpl (keys.GetValue (j), i);
- keys.SetValueImpl (tmp, j);
-
- if (items != null)
- {
- tmp = items.GetValueImpl (i);
- items.SetValueImpl (items.GetValueImpl (j), i);
- items.SetValueImpl (tmp, j);
- }
- }
-
- private static int compare (object value1, object value2, IComparer comparer)
- {
- if (comparer == null)
- return ((IComparable) value1).CompareTo(value2);
- else
- return comparer.Compare(value1, value2);
- }
-
- public virtual void CopyTo (Array array, int index)
- {
- if (array == null)
- throw new ArgumentNullException ();
-
- // The order of these exception checks may look strange,
- // but that's how the microsoft runtime does it.
- if (this.Rank > 1)
- throw new RankException ();
- if (index + this.GetLength (0) > array.GetLowerBound (0) + array.GetLength (0))
- throw new ArgumentException ();
- if (array.Rank > 1)
- throw new RankException ();
- if (index < 0)
- throw new ArgumentOutOfRangeException ();
-
- Copy (this, this.GetLowerBound(0), array, index, this.GetLength (0));
- }
-
- internal class SimpleEnumerator : IEnumerator {
- Array enumeratee;
- int currentpos;
- int length;
-
- public SimpleEnumerator (Array arrayToEnumerate) {
- this.enumeratee = arrayToEnumerate;
- this.currentpos = -1;
- this.length = arrayToEnumerate.Length;
- }
-
- public object Current {
- get {
- // Exception messages based on MS implementation
- if (currentpos < 0 ) {
- throw new InvalidOperationException
- ("Enumeration has not started");
- }
- if (currentpos >= length) {
- throw new InvalidOperationException
- ("Enumeration has already ended");
- }
- // Current should not increase the position. So no ++ over here.
- return enumeratee.GetValueImpl(currentpos);
- }
- }
-
- public bool MoveNext() {
- //The docs say Current should throw an exception if last
- //call to MoveNext returned false. This means currentpos
- //should be set to length when returning false.
- if (currentpos < length) {
- currentpos++;
- }
- if(currentpos < length)
- return true;
- else
- return false;
- }
-
- public void Reset() {
- currentpos= -1;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System/ArrayTypeMismatchException.cs b/mcs/class/corlib/System/ArrayTypeMismatchException.cs
deleted file mode 100644
index 2938300de61..00000000000
--- a/mcs/class/corlib/System/ArrayTypeMismatchException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.ArrayTypeMismatchException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class ArrayTypeMismatchException : SystemException {
- // Constructors
- public ArrayTypeMismatchException ()
- : base (Locale.GetText ("Source array type cannot be assigned to destination array type"))
- {
- }
-
- public ArrayTypeMismatchException (string message)
- : base (message)
- {
- }
-
- public ArrayTypeMismatchException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected ArrayTypeMismatchException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
-
- }
-}
diff --git a/mcs/class/corlib/System/AssemblyLoadEventArgs.cs b/mcs/class/corlib/System/AssemblyLoadEventArgs.cs
deleted file mode 100755
index dec3463c6aa..00000000000
--- a/mcs/class/corlib/System/AssemblyLoadEventArgs.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.AssemblyLoadEventArgs.cs
-//
-// Author:
-// Chris Hynes (chrish@assistedsolutions.com)
-//
-// (C) 2001 Chris Hynes
-//
-
-using System;
-using System.Reflection;
-
-namespace System
-{
- public class AssemblyLoadEventArgs: EventArgs
- {
- private Assembly m_loadedAssembly;
-
- public AssemblyLoadEventArgs(Assembly loadedAssembly)
- {
- this.m_loadedAssembly = loadedAssembly;
- }
-
- public Assembly LoadedAssembly
- {
- get
- {
- return m_loadedAssembly;
- }
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System/AssemblyLoadEventHandler.cs b/mcs/class/corlib/System/AssemblyLoadEventHandler.cs
deleted file mode 100755
index 46074f9523d..00000000000
--- a/mcs/class/corlib/System/AssemblyLoadEventHandler.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.AssemblyLoadEventHandler.cs
-//
-// Paolo Molaro
-//
-// (C) 2002 Ximian, Inc.
-
-namespace System
-{
- public delegate void AssemblyLoadEventHandler (object sender, AssemblyLoadEventArgs args);
-}
diff --git a/mcs/class/corlib/System/AsyncCallback.cs b/mcs/class/corlib/System/AsyncCallback.cs
deleted file mode 100644
index ba9ead8e6f2..00000000000
--- a/mcs/class/corlib/System/AsyncCallback.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// System/AsyncCallback.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
- public delegate void AsyncCallback (IAsyncResult ar);
-}
-
diff --git a/mcs/class/corlib/System/Attribute.cs b/mcs/class/corlib/System/Attribute.cs
deleted file mode 100644
index cdad17adbda..00000000000
--- a/mcs/class/corlib/System/Attribute.cs
+++ /dev/null
@@ -1,386 +0,0 @@
-//
-// System.Attribute.cs
-//
-// Authors:
-// Miguel de Icaza (miguel@ximian.com) - Original
-// Nick D. Drochak II (ndrochak@gol.com) - Implemented most of the guts
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-
-namespace System {
-
- [AttributeUsage(AttributeTargets.All)]
- [Serializable]
- public abstract class Attribute {
-
- protected Attribute ()
- {
- }
-
- public virtual object TypeId {
- get {
- // Derived classes should override this default behaviour as appropriate
- return this.GetType ();
- }
- }
-
- private static void CheckParameters (object element, Type attribute_type)
- {
- // neither parameter is allowed to be null
- if (null == element)
- {
- throw new ArgumentNullException ("element");
- }
-
- if (null == attribute_type)
- {
- throw new ArgumentNullException ("attribute_type");
- }
- }
-
- private static System.Attribute FindAttribute (object[] attributes)
- {
- // if there exists more than one attribute of the given type, throw an exception
- if (attributes.Length > 1) {
- throw new System.Reflection.AmbiguousMatchException (
- Locale.GetText ("<element> has more than one attribute of type <attribute_type>"));
- }
-
- if (attributes.Length < 1)
- return null;
-
- // tested above for '> 1' and and '< 1', so only '== 1' is left,
- // i.e. we found the attribute
-
- return (System.Attribute) attributes[0];
- }
-
- private static void CheckAncestry (Type attribute_type)
- {
- // attribute_type must be derived from type System.Attribute
- Type t = typeof (System.Attribute);
-
- /* fixme: thgi does not work for target monolib2
- if (!attribute_type.IsSubclassOf (t))
- {
- throw new ArgumentException ("Parameter is not a type derived from System.Attribute", "attribute_type");
- }
- */
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.ParameterInfo element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.MemberInfo element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Assembly element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Module element,
- Type attribute_type)
- {
- return GetCustomAttribute (element, attribute_type, true);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Module element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // Module inheritance hierarchies CAN NOT be searched for attributes, so the second
- // parameter of GetCustomAttributes () is INGNORED.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.Assembly element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // Assembly inheritance hierarchies CAN NOT be searched for attributes, so the second
- // parameter of GetCustomAttributes () is INGNORED.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.ParameterInfo element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // ParameterInfo inheritance hierarchies CAN NOT be searched for attributes, so the second
- // parameter of GetCustomAttributes () is INGNORED.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute GetCustomAttribute (System.Reflection.MemberInfo element,
- Type attribute_type, bool inherit)
- {
- // neither parameter is allowed to be null
- CheckParameters (element, attribute_type);
-
- // attribute_type must be derived from type System.Attribute
- CheckAncestry (attribute_type);
-
- // MemberInfo inheritance hierarchies can be searched for attributes, so the second
- // parameter of GetCustomAttributes () is respected.
- object[] attributes = element.GetCustomAttributes (attribute_type, inherit);
-
- return FindAttribute (attributes);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element)
- {
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element)
- {
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element){
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element){
- return System.Attribute.GetCustomAttributes (element, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element,
- Type attribute_type)
- {
- return System.Attribute.GetCustomAttributes (element, attribute_type, true);
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes;
-
- attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element,
- Type attribute_type, bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, attribute_type);
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- attribute_type, inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Module element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.Assembly element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.MemberInfo element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public static Attribute[] GetCustomAttributes (System.Reflection.ParameterInfo element,
- bool inherit)
- {
- // element parameter is not allowed to be null
- CheckParameters (element, typeof (System.Attribute));
-
- // make a properly typed array to return containing the custom attributes
- System.Attribute[] attributes = (System.Attribute[]) element.GetCustomAttributes (
- inherit);
-
- return attributes;
- }
-
- public override int GetHashCode ()
- {
- return ((Object) this).GetHashCode ();
- }
-
- public virtual bool IsDefaultAttribute ()
- {
- // Derived classes should override this default behaviour as appropriate
- return false;
- }
-
- public static bool IsDefined (System.Reflection.Module element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.ParameterInfo element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.MemberInfo element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.Assembly element, Type attribute_type)
- {
- return (System.Attribute.GetCustomAttributes (element, attribute_type).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.MemberInfo element, Type attribute_type,
- bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.Assembly element, Type attribute_type,
- bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.Module element, Type attribute_type,
- bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public static bool IsDefined (System.Reflection.ParameterInfo element,
- Type attribute_type, bool inherit)
- {
- return (System.Attribute.GetCustomAttributes (
- element, attribute_type, inherit).Length > 0);
- }
-
- public virtual bool Match (object obj)
- {
- // default action is the same as Equals.
- // Derived classes should override as appropriate
-
- return this.Equals (obj);
- }
-
- public override bool Equals (object obj)
- {
- if (obj == null || !(obj is Attribute))
- return false;
-
- return ((Attribute) obj) == this;
- }
- }
-}
diff --git a/mcs/class/corlib/System/AttributeTargets.cs b/mcs/class/corlib/System/AttributeTargets.cs
deleted file mode 100644
index 72505159938..00000000000
--- a/mcs/class/corlib/System/AttributeTargets.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// 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
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- [Flags]
- public enum AttributeTargets {
-
- /// <summary>
- /// </summary>
- Assembly = 0x00000001,
-
- /// <summary>
- /// </summary>
- Module = 0x00000002,
-
- /// <summary>
- /// </summary>
- Class = 0x00000004,
-
- /// <summary>
- /// </summary>
- Struct = 0x00000008,
-
- /// <summary>
- /// </summary>
- Enum = 0x00000010,
-
- /// <summary>
- /// </summary>
- Constructor = 0x00000020,
-
- /// <summary>
- /// </summary>
- Method = 0x00000040,
-
- /// <summary>
- /// </summary>
- Property = 0x00000080,
-
- /// <summary>
- /// </summary>
- Field = 0x00000100,
-
- /// <summary>
- /// </summary>
- Event = 0x00000200,
-
- /// <summary>
- /// </summary>
- Interface = 0x00000400,
-
- /// <summary>
- /// </summary>
- Parameter = 0x00000800,
-
- /// <summary>
- /// </summary>
- Delegate = 0x00001000,
-
- /// <summary>
- /// </summary>
- ReturnValue = 0x00002000,
-
- /// <summary>
- /// </summary>
- All = Assembly | Module | Class | Struct | Enum | Constructor | Method | Property | Field | Event | Interface | Parameter | Delegate | ReturnValue,
- } // AttributeTargets
-
-} // System
diff --git a/mcs/class/corlib/System/AttributeUsage.cs b/mcs/class/corlib/System/AttributeUsage.cs
deleted file mode 100644
index c0bcb0616a2..00000000000
--- a/mcs/class/corlib/System/AttributeUsage.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// System.AttributeUsage.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- [AttributeUsage(AttributeTargets.All)]
- [Serializable]
- public sealed class AttributeUsageAttribute : Attribute {
- AttributeTargets valid_on;
- bool allow_multiple, inherited;
-
- public AttributeUsageAttribute (AttributeTargets validOn)
- {
- valid_on = validOn;
- }
-
- public bool AllowMultiple {
- get {
- return allow_multiple;
- }
-
- set {
- allow_multiple = value;
- }
- }
-
- public bool Inherited {
- get {
- return inherited;
- }
-
- set {
- inherited = value;
- }
- }
-
- public AttributeTargets ValidOn {
- get {
- return valid_on;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/System/BadImageFormatException.cs b/mcs/class/corlib/System/BadImageFormatException.cs
deleted file mode 100644
index 8ea5857f5fa..00000000000
--- a/mcs/class/corlib/System/BadImageFormatException.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// System.BadImageFormatException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class BadImageFormatException : SystemException
- {
- // Fields
- private string msg; // we need this because System.Exception's message is private.
- private Exception inner;
- private string fileName;
- private string fusionLog;
-
- // Constructors
- public BadImageFormatException ()
- : base (Locale.GetText ("Invalid file image."))
- {
- msg = "Invalid file image.";
- }
-
- public BadImageFormatException (string message)
- : base (message)
- {
- msg = message;
- }
-
- 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)
- {
- msg = message;
- this.inner = inner;
- }
-
- public BadImageFormatException (string message, string fileName)
- : base (message)
- {
- msg = message;
- this.fileName = fileName;
- }
-
- public BadImageFormatException (string message, string fileName, Exception inner)
- : base (message, inner)
- {
- msg = message;
- this.inner = inner;
- this.fileName = fileName;
- }
-
- // Properties
- public override string Message
- {
- get { return Locale.GetText (msg); }
- }
-
- public string FileName
- {
- get { return fileName; }
- }
-
- public string FusionLog
- {
- 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 ()
- {
- return inner.ToString();
- }
- }
-}
diff --git a/mcs/class/corlib/System/BitConverter.cs b/mcs/class/corlib/System/BitConverter.cs
deleted file mode 100755
index 6b6961d4bda..00000000000
--- a/mcs/class/corlib/System/BitConverter.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// System.BitConverter
-//
-// Author:
-// Matt Kimball (matt@kimball.net)
-//
-
-using System;
-
-namespace System {
- public sealed class BitConverter {
-
- private BitConverter () {}
-
- static bool AmILittleEndian()
- {
- byte[] one = GetBytes((int)1);
- return (one[0] == 1);
- }
-
- public static readonly bool IsLittleEndian = AmILittleEndian ();
-
- public static long DoubleToInt64Bits(double value)
- {
- return ToInt64(GetBytes(value), 0);
- }
-
- public static double Int64BitsToDouble(long value)
- {
- return ToDouble(GetBytes(value), 0);
- }
-
- unsafe static byte[] GetBytes(byte *ptr, int count)
- {
- byte[] ret = new byte[count];
-
- for (int i = 0; i < count; i++) {
- ret[i] = ptr[i];
- }
-
- return ret;
- }
-
- unsafe public static byte[] GetBytes(bool value)
- {
- return GetBytes((byte *)&value, 1);
- }
-
- unsafe public static byte[] GetBytes(char value)
- {
- return GetBytes((byte *)&value, 2);
- }
-
- unsafe public static byte[] GetBytes(short value)
- {
- return GetBytes((byte *)&value, 2);
- }
-
- unsafe public static byte[] GetBytes(int value)
- {
- return GetBytes((byte *)&value, 4);
- }
-
- unsafe public static byte[] GetBytes(long value)
- {
- return GetBytes((byte *)&value, 8);
- }
-
- [CLSCompliant(false)]
- unsafe public static byte[] GetBytes(ushort value)
- {
- return GetBytes((byte *)&value, 2);
- }
-
- [CLSCompliant(false)]
- unsafe public static byte[] GetBytes(uint value)
- {
- return GetBytes((byte *)&value, 4);
- }
-
- [CLSCompliant(false)]
- unsafe public static byte[] GetBytes(ulong value)
- {
- return GetBytes((byte *)&value, 8);
- }
-
- unsafe public static byte[] GetBytes(float value)
- {
- return GetBytes((byte *)&value, 4);
- }
-
- unsafe public static byte[] GetBytes(double value)
- {
- return GetBytes((byte *)&value, 8);
- }
-
- unsafe static void PutBytes(byte *dst, byte[] src, int start_index, int count)
- {
- if (src == null) {
- throw new ArgumentNullException();
- }
-
- if (src.Length < start_index + count) {
- // LAMESPEC:
- // the docs say it should be ArgumentOutOfRangeException, but
- // the mscorlib throws an ArgumentException.
- throw new ArgumentException();
- }
-
- for (int i = 0; i < count; i++) {
- dst[i] = src[i + start_index];
- }
- }
-
- unsafe public static bool ToBoolean(byte[] value, int start_index)
- {
- bool ret;
-
- PutBytes((byte *)&ret, value, start_index, 1);
-
- return ret;
- }
-
- unsafe public static char ToChar(byte[] value, int start_index)
- {
- char ret;
-
- PutBytes((byte *)&ret, value, start_index, 2);
-
- return ret;
- }
-
- unsafe public static short ToInt16(byte[] value, int start_index)
- {
- short ret;
-
- PutBytes((byte *)&ret, value, start_index, 2);
-
- return ret;
- }
-
- unsafe public static int ToInt32(byte[] value, int start_index)
- {
- int ret;
-
- PutBytes((byte *)&ret, value, start_index, 4);
-
- return ret;
- }
-
- unsafe public static long ToInt64(byte[] value, int start_index)
- {
- long ret;
-
- PutBytes((byte *)&ret, value, start_index, 8);
-
- return ret;
- }
-
- [CLSCompliant(false)]
- unsafe public static ushort ToUInt16(byte[] value, int start_index)
- {
- ushort ret;
-
- PutBytes((byte *)&ret, value, start_index, 2);
-
- return ret;
- }
-
- [CLSCompliant(false)]
- unsafe public static uint ToUInt32(byte[] value, int start_index)
- {
- uint ret;
-
- PutBytes((byte *)&ret, value, start_index, 4);
-
- return ret;
- }
-
- [CLSCompliant(false)]
- unsafe public static ulong ToUInt64(byte[] value, int start_index)
- {
- ulong ret;
-
- PutBytes((byte *)&ret, value, start_index, 8);
-
- return ret;
- }
-
- unsafe public static float ToSingle(byte[] value, int start_index)
- {
- float ret;
-
- PutBytes((byte *)&ret, value, start_index, 4);
-
- return ret;
- }
-
- unsafe public static double ToDouble(byte[] value, int start_index)
- {
- double ret;
-
- PutBytes((byte *)&ret, value, start_index, 8);
-
- return ret;
- }
-
- public static string ToString(byte[] value)
- {
- if (value == null) {
- throw new ArgumentNullException();
- }
-
- return ToString(value, 0, value.Length);
- }
-
- public static string ToString(byte[] value, int start_index)
- {
- if (value == null)
- throw new ArgumentNullException("value");
- if (start_index < 0 || start_index > value.Length - 1)
- throw new ArgumentOutOfRangeException("start_index");
-
- return ToString(value, start_index, value.Length - start_index);
- }
-
- public static string ToString(byte[] value, int start_index, int length)
- {
- if (value == null) {
- throw new ArgumentNullException();
- }
-
- // The 4th and last clause (start_index >= value.Length)
- // was added as a small fix to a very obscure bug.
- // It makes a small difference when start_index is
- // outside the range and length==0.
- if (start_index < 0 || length < 0 || start_index + length > value.Length || start_index >= value.Length) {
- throw new ArgumentOutOfRangeException();
- }
- string ret = "";
- int end = start_index + length;
-
- for (int i = start_index; i < end; i++) {
- if (i > start_index)
- ret = ret + '-';
-
- char high = (char)((value[i] >> 4) & 0x0f);
- char low = (char)(value[i] & 0x0f);
-
- if (high < 10)
- high += '0';
- else {
- high -= (char) 10;
- high += 'A';
- }
-
- if (low < 10)
- low += '0';
- else {
- low -= (char) 10;
- low += 'A';
- }
-
- ret = ret + high + low;
- }
-
- return ret;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Boolean.cs b/mcs/class/corlib/System/Boolean.cs
deleted file mode 100644
index 741471bcdb1..00000000000
--- a/mcs/class/corlib/System/Boolean.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-//
-// System.Boolean.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// I guess this is the Boolean class. This was written word for word
-// off the Library specification for System.Boolean in the ECMA
-// TC39 TG2 and TG3 working documents.
-//
-// The XML style documentation isn't that elegant, but it seems to
-// be the standard way according to the poorly documented C#
-// Programmer's Reference section on XML Documentation.
-//
-// This header and the one above it can be formatted however, just trying
-// to keep it consistent w/ the existing mcs headers.
-//
-// Even though it's not in the ECMA docs, the .NET Framework Class Library
-// says this implements IConvertible, but if it does it has some other
-// member functions to implement.
-//
-
-using System.Globalization;
-namespace System {
-
- /// <summary>
- /// Represents the boolean values of logical true and false.
- /// </summary>
- [Serializable]
- public struct Boolean : IComparable, IConvertible {
-
- /// <value>
- /// The String representation of Boolean False
- /// </value>
- public static readonly string FalseString;
-
- /// <value>
- /// The String representation of Boolean True
- /// </value>
- public static readonly string TrueString;
-
- /// <value>
- /// Internal bool value for for this instance
- /// </value>
- //
- // HACK: we tag it as public, so the source will compile.
- public bool value;
-
- static Boolean ()
- {
- FalseString = "False";
- TrueString = "True";
- }
-
- /// <summary>
- /// Compares the current Boolean instance against another object.
- /// </summary>
- /// <remarks>
- /// Throws an ArgumentException if <c>obj</c> isn't null or
- /// a Boolean.
- /// </remarks>
- /// <param name="obj">
- /// The object to compare against
- /// </param>
- /// <returns>
- /// An int reflecting the sort order of this instance as
- /// compared to <c>obj</c>
- /// -1 if this instance is false and <c>obj</c> is true
- /// 0 if this instance is equal to <c>obj</c>
- /// 1 if this instance is true and <c>obj</c> is false,
- /// or <c>obj</c> is null
- /// </returns>
- public int CompareTo (object obj)
- {
- if (obj == null)
- return 1;
-
- if (!(obj is System.Boolean))
- throw new ArgumentException
- (Locale.GetText ("Object is not a Boolean and is not a null reference"));
-
- // for case #3
- if (obj == null || (value == true && (bool)obj == false))
- return 1;
-
- // for case #2, else it's #1
- return (value == (bool)obj) ? 0 : -1;
- }
-
- /// <summary>
- /// Determines whether this instance and another object represent the
- /// same type and value.
- /// </summary>
- /// <param name="obj">
- /// The object to check against
- /// </param>
- /// <returns>
- /// true if this instnace and <c>obj</c> are same value,
- /// otherwise false if it is not or null
- /// </returns>
- public override bool Equals (Object obj)
- {
- if (obj == null || !(obj is System.Boolean))
- return false;
-
- return ((bool)obj) == value;
- }
-
- /// <summary>
- /// Generates a hashcode for this object.
- /// </summary>
- /// <returns>
- /// An Int32 value holding the hash code
- /// </returns>
- public override int GetHashCode ()
- {
- // Guess there's not too many ways to hash a Boolean
- return value ? 1 : 0;
- }
-
- /// <summary>
- /// Returns a given string as a boolean value. The string must be
- /// equivalent to either TrueString or FalseString, with leading and/or
- /// trailing spaces, and is parsed case-insensitively.
- /// </summary>
- /// <remarks>
- /// Throws an ArgumentNullException if <c>val</c> is null, or a
- /// FormatException if <c>val</c> doesn't match <c>TrueString</c>
- /// or <c>FalseString</c>
- /// </remarks>
- /// <param name="val">
- /// The string value to parse
- /// </param>
- /// <returns>
- /// true if <c>val</c> is equivalent to TrueString,
- /// otherwise false
- /// </returns>
- public static bool Parse (string val)
- {
- if (val == null)
- throw new ArgumentNullException (
- Locale.GetText ("Value is a null reference"));
-
- val = val.Trim ();
-
- if (String.Compare (val, TrueString, true) == 0)
- return true;
-
- if (String.Compare (val, FalseString, true) == 0)
- return false;
-
- throw new FormatException (Locale.GetText (
- "Value is not equivalent to either TrueString or FalseString"));
- }
-
- /// <summary>
- /// Returns a string representation of this Boolean object.
- /// </summary>
- /// <returns>
- /// <c>FalseString</c> if the instance value is false, otherwise
- /// <c>TrueString</c>
- /// </returns>
- public override string ToString ()
- {
- return value ? TrueString : FalseString;
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Boolean;
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return value;
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte(value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal(value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble(value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle(value);
- }
-
- public string ToString (IFormatProvider provider)
- {
- return ToString();
- }
-
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
-
- } // System.Boolean
-
-} // Namespace System
diff --git a/mcs/class/corlib/System/Buffer.cs b/mcs/class/corlib/System/Buffer.cs
deleted file mode 100755
index 16a48b66592..00000000000
--- a/mcs/class/corlib/System/Buffer.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// System/Buffer.cs
-//
-// Authors:
-// Paolo Molaro (lupus@ximian.com)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System {
- public sealed class Buffer {
-
- private 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 (); // default message
-
- int length = ByteLengthInternal (array);
- if (length < 0)
- throw new ArgumentException ("Object must be array of primitives.");
-
- return length;
- }
-
- public static byte GetByte (Array array, int index) {
- if (index < 0 || index >= ByteLength (array))
- throw new ArgumentException ("Index was out of range. 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 ArgumentException ("Index was out of range. Must be non-negative and less than the size of the collection.");
-
- SetByteInternal (array, index, value);
- }
-
- public static void BlockCopy (Array src, int src_offset, Array dest, int dest_offset, int count) {
- if (src_offset < 0 || dest_offset < 0 || count < 0)
- throw new ArgumentOutOfRangeException ("Non-negative number required.");
-
- if (src_offset + count > ByteLength (src) || dest_offset + count > ByteLength (dest))
- throw new ArgumentException ("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.");
-
- BlockCopyInternal (src, src_offset, dest, dest_offset, count);
- }
-
- // 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)]
- private extern static void BlockCopyInternal (Array src, int src_offset, Array dest, int dest_offset, int count);
- }
-}
diff --git a/mcs/class/corlib/System/Byte.cs b/mcs/class/corlib/System/Byte.cs
deleted file mode 100644
index 50f77ae0ac7..00000000000
--- a/mcs/class/corlib/System/Byte.cs
+++ /dev/null
@@ -1,251 +0,0 @@
-//
-// System.Byte.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public struct Byte : IComparable, IFormattable, IConvertible {
-
- public const byte MinValue = 0;
- public const byte MaxValue = 255;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public byte value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Byte))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Byte"));
-
- byte xv = (byte) v;
-
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Byte))
- return false;
-
- return ((byte) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static byte Parse (string s)
- {
- byte val = 0;
- int len;
- int i;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- // look for the first non-whitespace character
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- // if it's all whitespace, then throw exception
- if (i == len)
- throw new FormatException ();
-
- // look for the optional '+' sign
- if (s [i] == '+')
- i++;
-
- // we should just have numerals followed by whitespace now
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- // shift left and accumulate every time we find a numeral
- byte d = (byte) (c - '0');
-
- val = checked ((byte) (val * 10 + d));
- digits_seen = true;
- } else {
- // after the last numeral, only whitespace is allowed
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
-
- // if all we had was a '+' sign, then throw exception
- if (!digits_seen)
- throw new FormatException ();
-
- return val;
- }
-
- public static byte Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static byte Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- public static byte Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- uint tmpResult = UInt32.Parse (s, style, fp);
- if (tmpResult > Byte.MaxValue || tmpResult < Byte.MinValue)
- throw new OverflowException ("Value too large or too small.");
-
- return (byte) tmpResult;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (IFormatProvider provider)
- {
- return ToString (null, provider);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Byte;
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean(value);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return value;
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar(value);
- }
-
- [CLSCompliant(false)]
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal(value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble(value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle(value);
- }
-
-/*
- string IConvertible.ToString (IFormatProvider provider)
- {
- return ToString("G", provider);
- }
-*/
-
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/CLSCompliantAttribute.cs b/mcs/class/corlib/System/CLSCompliantAttribute.cs
deleted file mode 100755
index aae9120a250..00000000000
--- a/mcs/class/corlib/System/CLSCompliantAttribute.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// System.CLSCompliantAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// Used to indicate if an element of a program is CLS compliant.
- /// </summary>
- ///
- /// <remarks>
- /// </remarks>
- [AttributeUsage(AttributeTargets.All)]
- [Serializable]
- public sealed class CLSCompliantAttribute : Attribute {
-
- bool is_compliant;
-
- public CLSCompliantAttribute (bool is_compliant)
- {
- this.is_compliant = is_compliant;
- }
-
- public bool IsCompliant {
- get {
- return is_compliant;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System/CannotUnloadAppDomainException.cs b/mcs/class/corlib/System/CannotUnloadAppDomainException.cs
deleted file mode 100644
index 1cd03735a35..00000000000
--- a/mcs/class/corlib/System/CannotUnloadAppDomainException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.CannotUnloadAppDomainException
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class CannotUnloadAppDomainException : SystemException
- {
- // Constructors
- public CannotUnloadAppDomainException ()
- : base (Locale.GetText ("Attempt to unload application domain failed."))
- {
- }
-
- public CannotUnloadAppDomainException (string message)
- : base (message)
- {
- }
-
- protected CannotUnloadAppDomainException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public CannotUnloadAppDomainException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog
deleted file mode 100644
index 7e45498bb7d..00000000000
--- a/mcs/class/corlib/System/ChangeLog
+++ /dev/null
@@ -1,2233 +0,0 @@
-2002-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IntegerFormatter.cs:
- (FormatParse.FormatNumber): fixed custom format for negative numbers.
-
-2002-06-21 Martin Baulig <martin@gnome.org>
-
- * Double.cs: Replace the private `enum State' with constants since this
- will avoid some bigger headaches in mcs.
-
-Thu Jun 20 17:51:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * TimeSpan.cs: do not pollute the namespace with the
- System.Parser name.
-
-2002-06-18 Nick Drochak <ndrochak@gol.com>
-
- * ArgumentException.cs: Use the message given in the constructor when
- accessing the Message property. Thanks to Dietmar for the help with
- "base".
-
-2002-06-17 Dietmar Maurer <dietmar@ximian.com>
-
- * MonoType.cs: GetField is now a InternalCall
-
-2002-06-13 Nick Drochak <ndrochak@gol.com>
-
- * DateTime.cs: (Parse): Accept dates that have no hour,min,sec. in the
- sortable format(s), e.g. "2002-02-25"
-
-2002/06/12 Nick Drochak <ndrochak@gol.com>
-
- * Random.cs (Next): Fix math error. Return a number within the range.
-
-2002-06-12 Nick Drochak <ndrochak@gol.com>
-
- * String.cs (IndexOf): Return -1 if start index is equal to string
- length.
-
-2002-06-10 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (ToDouble): Remove rounding in ToDouble (float).
- (ToType): Added null field in conversionTable to avoid
- IndexOutOfRangeException. Changed what exceptions we throw to match
- the spec.
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * Int64.cs (Parse): Added unique strings to the messages where we throw
- a FormatException. Needed these to debug, so just left them in since
- they might be useful later. Fixed Currency parsing where we weren't
- looking at CurrencyDecimalSeparator, etc.
-
-2002-06-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * DateTime.cs: fixes to pass tests M0 to M6:
- if yy pattern then year values >= 30 are in 20th century
- rfc1123 pattern is always in GMT, therefor useutc must be false
- made GetNow() internal static so it can be called from TimeZone.
- * TimeZone.cs: removed dependency on year 2002 from initialization of
- current timezone.
-
-2002-06-09 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (ToType): Rearranged what Exceptions we throw to
- match MS behavior.
-
-2002-06-08 Duncan Mak <duncan@ximian.com>
-
- * Decimal.cs: Added support for the IConvertible interface.
-
-2002-06-08 Martin Baulig <martin@gnome.org>
-
- * Enum.cs (IsDefined): `value' may be of the enum's type itself, it
- doesn't necessarily need to be of the enum's underlying type.
-
-2002/06/07 Nick Drochak <ndrochak@gol.com>
-
- * String.cs: Add [Serializable] to class
- * SByte.cs (Parse): Add [CLSCompliant(false)] to all the overloads
-
-2002-06-04 Nick Drochak <ndrochak@gol.com>
-
- * Double.cs (Parse): Recognize the group separator string, but still we
- don't check the format for the proper number of digits between
- separators. Also throw OverflowException when we get Pos or Neg
- Infinity from runtime.
-
-2002-06-03 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (ToDouble): Fixed ToDouble (byte value).
-
-Mon Jun 3 12:18:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: fixed GetTypeCode.
-
-2002-06-02 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (ToInt16): use Convert.ToInt16 (int) instead of a direct
- cast from an int so that we throw OverFlowException correctly.
-
- (ToInt64): Use a new 64bit version of ConvertToBase.
-
- (ConvertToBase): Add checks for overflow (checks Int32.MinValue
- and Int32.MaxValue).
-
- (ConvertFromBase64): New 64-bit version of ConvertFromBase.
-
-2002-06-02 Nick Drochak <ndrochak@gol.com>
-
- * Convert.cs (ToSByte): Check for special value.
- * Single.cs (Parse):
- * UInt16.cs (Parse):
- * UInt32.cs (Parse): Throw OverflowException if negative
-
-2002-06-02 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (DBNull): Point it to DBNull.Value.
- (IsDBNull): Instead of checking typecodes, just check to see if
- it's the same as the DBNull field.
-
-2002-06-02 Nick Drochak <ndrochak@gol.com>
-
- * Convert.cs (ConvertFromBase): Detect bad digits correctly.
-
-2002-06-02 Duncan Mak <duncan@ximian.com>
-
- * Char.cs (Parse): Simplify the Exception handling.
-
- * Convert.cs (ToDecimal): Remove call to Math.Round () when
- converting from a float.
-
-2002-05-30 Martin Baulig <martin@gnome.org>
-
- * MonoType.cs (GetInterface): Implemented.
-
-Thu May 23 17:17:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Activator.cs: implemented CreateInstance ().
-
-2002-05-22 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (ConvertToBase): Added new 64bit version.
- (BuildConvertedString64): New 64bit version of
- BuildConvertedString.
-
- This fixes bug 25068.
-
- (ConvertFromBase): Added additional test for checking if the
- digits are valid. Thanks to Miguel for coming up with this test.
-
- This fixes bug 25071.
-
-2002-05-21 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (ToType): Rearranged to fit the new layout of
- conversionTable.
-
- (conversionTable): Rearranged to fit the layout of the
- System.TypeCode enum.
-
- This should fix bug 25075.
-
-2002-05-21 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs (ToString): Fixed the ToString methods. Previously I had
- mixed up the two code paths, one for converting to a specific base
- (this case), another from converting from a foreign base to base10
- (used by ToInt16|32|64 (string, int)). This fixes bug 25068.
-
- * Convert.cs (ToByte)
- (ToSByte): Fixed bug 25074. Added more bits to ConvertFromBase so
- that we won't confuse FormatException with OverflowException.
-
-2002-05-22 Lawrence Pit <loz@cable.a2000.nl>
-
- * Environment.cs: CommandLine missed spaces between arguments.
- Implemented StackTrace. Returning MachineName in UserDomainName
- instead of null.
-
-Tue May 21 17:25:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoCustomAttrs.cs: handle inherit argument.
-
-2002-05-21 Nick Drochak <ndrochak@gol.com>
-
- * Math.cs (Pow): Change icall method name and insert parameter
- checks in for infinities and NaN.
-
-2002-05-13 Miguel de Icaza <miguel@ximian.com>
-
- * Double.cs (Parse): Reimplement by cleaning up the string first,
- and then passing to strtof in the mono runtime.
-
- * Single.cs (Parse): Use the Double implementation and cast to
- float.
-
-2002-05-21 Nick Drochak <ndrochak@gol.com>
-
- * Math.cs
- (Ceiling): Check for "special" values
- (Floor): Check for "special" values
- (Round): Fix off-by-one error on decimal shifting
-
-2002-05-20 Lawrence Pit <loz@cable.a2000.nl>
-
- * DateTime.cs: ToString () using "G" format specifier
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * Convert.cs (FromBase64CharArray): Do correct exception handling.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * Convert.cs (FromBase64CharArray): Convert the char array using
- System.Text.UTF8Encoding, not UnicodeEncoding (which is UTF-16) to
- a byte array.
-
-2002-05-17 Miguel de Icaza <miguel@ximian.com>
-
- * MonoType.cs: Style changes.
-
- * Type.cs: Style changes.
-
-2002-05-16 Piers Haken <piersh@friksit.com
-
- * UInt64.cs: fix declaration of IConvertible.To* overrides.
-
-2002-05-16 Nick Drochak <ndrochak@gol.com>
-
- * BitConverter.cs (ToString): Add parameter check for invalid start
- index.
-
- * Console.cs: Use AutoFlush on the StreamWriter for stdin and stdout
- now that StreamWriter uses buffering
-
-2002-05-14 Miguel de Icaza <miguel@ximian.com>
-
- * Double.cs: Oops. Also handle exponents without finding a dot.
-
-2002-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * ChangeLog: removed empty entry at the top of the file.
-
- * Int32.cs: made static functions used by Parse internal.
-
- * Int64.cs:
- * UInt32.cs:
- * UInt64.cs: removed static fucntions used by Parse and use the ones
- in Int32.cs
-
-2002-05-12 Daniel Morgan <danmorg@sc.rr.com>
-
- * IServiceProvider.cs: added using System
-
-2002-05-09 Daniel Morgan <danmorg@sc.rr.com>
-
- * Single.cs: copied ToString() and Parse() methods from
- Double to Single and modified a tiny bit for Single.
- There is still a FIXME for Double and Single about
- passing the format and provider info to the icall too.
-
-2002-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Int32.cs:
- * Int64.cs:
- * UInt32.cs:
- * UInt64.cs (Parse): don't use Char.IsNumber to test for hex digits.
- Don't use a delegate to test for valid digits.
-
-2002-05-01 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs:
- * Math.cs: Added missing CLSCompliant attributes where necessary.
-
-2002-04-30 Duncan Mak <duncan@ximian.com>
-
- * ArgumentException.cs (Message):
- * ArgumentOutOfRangeException.cs (Message): Added.
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * MonoType.cs: Remove unused variable and eliminate a compiler warning.
-
-Mon Apr 29 15:32:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Environment.cs: support for Exit(), CommandLine, CommandLineArgs ().
-
-2002-04-28 Duncan Mak <duncan@ximian.com>
-
- * DivideByZeroException.cs: Added missing serialization constructor.
-
- * UnauthorizedAccessException.cs: Added the missing Serializable attribute.
-
-2002-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Math.cs: fix Floor () and Round (). Closes #23960.
-
-2002-04-27 Nick Drochak <ndrochak@gol.com>
-
- * Array.cs (IList.Contains): Should throw a RankException if this is
- called on a Rank > 1 array. Not in the docs, but this is what the
- MS.NET does.
-
-2002-04-26 Duncan Mak <duncan@ximian.com>
-
- * MissingMemberException.cs: Made the message variable 'protected'
- instead of 'private', so that we can see it in
- MissingMethodException and MissingFieldException.
-
- * MissingFieldException.cs:
- * MissingMethodException.cs: Added missing (string, string)
- constructor, and also the Message property.
-
-2002-04-26 Martin Baulig <martin@gnome.org>
-
- * Enum.cs: Implemented the IConvertible methods.
-
-2002-04-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * SByte.cs: little change in Parse (string) to avoid incorrect
- OverflowException thrown (reported by nickd).
-
-2002-04-22 Miguel de Icaza <miguel@ximian.com>
-
- * ValueType.cs: Add Serializable attribute.
-
- * String.cs: ifdef-out out the __arglist Concat function until I
- add support for that to mcs.
-
-2002-04-24 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * AppDomain.cs (GetValue): usage of the correct icall (bug)
-
-Wed Apr 24 21:15:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * GC.cs: implement most of the methods as icalls.
-
-2002-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * DecimalFormatter.cs (ToString): return correct value when the
- decimal number is 0.
-
-2002-04-24 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * Type.cs (GetProperty): fixed call syntax (needs an empty array not null)
- * MonoType.cs (GetPropertyImpl) : basic implementation (ignores types, bindingAttr, modifiers)
-
-2002-04-24 Nick Drochak <ndrochak@gol.com>
-
- * Double.cs (Parse): Handle case where there are no digits before the
- decimal point, such as ".1".
-
-2002-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Int32.cs:
- * UInt32.cs:
- * Int64.cs:
- * UInt64.cs: fixed bug #23738 (hex numbers parsed wrong).
-
-2002-04-23 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * String.cs (Split): fixed invalid split of count 0 and 1.
-
-2002-04-23 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * String.cs (LastIndexOf): fixed argument checking.
- * String.cs (Equals): made internal for performace.
-
-2002-04-23 Nick Drochak <ndrochak@gol.com>
-
- * String.cs (Join): check argument and throw exception if needed
-
-2002-04-23 Nick Drochak <ndrochak@gol.com>
-
- * String.cs (StartsWith): check argument and throw exception if needed
-
-2002-04-22 Nick Drochak <ndrochak@gol.com>
-
- * String.cs (IndexOfAny): check arguments and throw exceptions as
- neccessary. ALso remove some debug WriteLines.
-
-2002-04-20 Dietmar Maurer <dietmar@ximian.com>
-
- * String.cs: use internal constructors
- buf fix in Concat.
-
-Thu Apr 18 17:16:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: make GetElementType its own icall.
-
-2002-04-18 Nick Drochak <ndrochak@gol.com>
-
- * String.cs: Modified file. Re-add methods needed by the unit tests.
-
-Thu Apr 18 12:38:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: some code speedups and restored GetTypeCode().
-
-2002-04-17 Patrik Torstensson <patrik.torstensson@labs2.com>
-
- * String.cs: New implementation using internal calls.
-
-2002-04-16 Nick Drochak <ndrochak@gol.com>
-
- * DecimalFormatter.cs: Trim off excess null characters from the string
- that decimal2string gives back.
-
-2002-04-16 Nick Drochak <ndrochak@gol.com>
-
- * String.cs (SubString): revert my change. I can't reproduce the
- problem anymore.
-
-2002-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Attribute.cs: added GetHashCode and Equals.
-
-2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Enum.cs: little improvements to Format ().
-
-Thu Apr 11 12:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: internalcall GetHashCode().
- * Array.cS: optimize access to elements.
-
-Wed Apr 10 21:20:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: make IndexOfAny() use an internalcall.
-
-2002-04-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Int32.cs:
- * UInt32.cs:
- * Int64.cs:
- * UInt64.cs: fixed error when testing for validity of flags.
-
-2002-04-11 Nick Drochak <ndrochak@gol.com>
-
- * Double.cs: Use an internal call for ToString(). This is just a simple
- implementation to get away from throwing a NotImplementedException.
-
-2002-04-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Int32.cs:
- * UInt32.cs:
- * Int64.cs:
- * UInt64.cs: changed Type.GetType () by typeof (), as suggested by
- lupus.
-
- * Int32.cs:
- * Int64.cs: throw an OverFlowException when parsing a string
- containing a dot followed by any non '0' number.
-
-2002-04-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Byte.cs:
- * UInt16.cs:
- * UInt32.cs:
- * UInt64.cs: added complex Parse ().
-
-2002-04-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * SByte.cs:
- * Int16.cs:
- * Int32.cs:
- * Int64.cs: added complex Parse ().
-
-2002-04-09 Nick Drochak <ndrochak@gol.com>
-
- * Array.cs (BinarySearch): Add checks on paramters before using them
- and throw exceptions as needed.
-
- * Enum.cs (Format): Check if [Flags] is applied to enum and convert
- "G" format to "F" if so.
-
-Tue Apr 9 13:12:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoCustomAttrs.cs: return arrays of type Attribute[]
- instead of object[].
-
-2002/04/09 Nick Drochak <ndrochak@gol.com>
-
- * String.cs (Substring): Copy only non-null characters to the new
- string.
-
-2002-04-09 Nick Drochak <ndrochak@gol.com>
-
- * IntegerFormatter.cs: Don't use a format character to indicate a
- custom format was passed in. It was using 'z' to indicate a custom
- format, but really it should throw a format exception if the user
- tries to use "z" as the format string. Now it does.
-
- * Activator.cs: New File.
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * Enum.cs (ToString): Big ugly fix for the case where [Flags] is
- applied to an enum. Need to handle the different possible integer
- types of an enum somehow. Can anyone say generics?
-
-Mon Apr 8 06:22:42 2002 Piers Haken <piersh@friskit.com>
-
- * Convert.cs: switched the To*(object) methods to use
- IConvertible directly instead of calling ChangeType
-
-Sat Apr 6 20:08:41 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * ValueType.cs: make Equals() an internalcall.
-
-Fri Apr 5 15:38:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: also look for nested types in FindMembers.
- * MonoType.cs: make GetNestedTypes() an internalcall.
-
-2002-04-05 Nick Drochak <ndrochak@gol.com>
-
- * Enum.cs (Parse): Handle different underlying types.
-
-2002/04/04 Nick Drochak <ndrochak@gol.com>
-
- * Enum.cs (IsDefined): Throw exception when type of value to look for
- is not the correct one. Attempt to have it work with string values
- too, but not sure if the unit tests are getting that far yet.
-
-2002-04-04 Nick Drochak <ndrochak@gol.com>
-
- * Decimal.cs: Fix a couple of typos.
-
-Wed Apr 3 19:46:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * Enum.cs: the values array is of the enum and not of the underlying
- type. Updates and some bug fixes.
- * MonoType.cs: make the internalcall return FullName instead of the
- assembly qualified name.
- * Type.cs: make ToString () simply return FullName.
-
-2002-04-03 Nick Drochak <ndrochak@gol.com>
-
- * Type.cs (GetTypeCode): provide some of the implementation for this
- method. It's still too simplistic to be considered complete.
-
-2002-04-02 Dietmar Maurer <dietmar@ximian.com>
-
- * Object.cs: fixed FieldGetter/FieldSetter signature
-
-2002-04-02 Nick Drochak <ndrochak@gol.com>
-
- * Environment.cs: add MonoTODO's on parts that should have it.
-
-2002-04-01 Nick Drochak <ndrochak@gol.com>
-
- * Enum.cs: added reality checks (check parameters to most methods that
- need them).
-
-2002-03-30 Dietmar Maurer <dietmar@ximian.com>
-
- * Object.cs: added FieldGetter/FieldSetter
-
-2002-03-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IntegerFormatter.cs: fixed initialization error in static
- constructor.
-
-2002-03-28 Dietmar Maurer <dietmar@ximian.com>
-
- * Delegate.cs: added new field to store a trampoline function
-
-2002-03-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * IntegerFormatter.cs: added workaround for bug #22668. First patch to
- make custom format strings work (not fully functional yet).
-
-2002/03/28 Nick Drochak <ndrochak@gol.com>
-
- * IntegerFormatter.cs: Change class from internal to public. Add
- necessary [CLSCompliant(false)] attributes.
-
-2002-03-27 Duco Fijma <duco@lorentz.xs4all.nl>
- * _AppDomain.cs, AppDomain.cs: renamed method GetDate to GetData
- (was a typo)
-
-2002-03-28 Nick Drochak <ndrochak@gol.com>
-
- * Type.cs: Added MonoTODO tags on members that have FIXME, etc.
-
-2002-03-27 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * Console.cs: Modified to get std handles from MonoIO.
- * Environment.cs: removed PAL dependencies.
-
-2002-03-25 Miguel de Icaza <miguel@ximian.com>
-
- * String.cs (System): Removed internal enumeration, because
- bootstrapping the corlib at this point does not support
- enumerations.
-
- * IntPtr.cs: Temporary work-around until I fix the assembly
- attributes bug.
-
-2002-03-24 Martin Baulig <martin@gnome.org>
-
- * Enum.cs (GetValues): According to the docu this is sorted after
- values, not names.
-
- * String.cs (System): Removed enumeration, because it is pretty
- hard to support enumerations in /nostdlib mode for the core types.
-
-Tue Mar 19 18:18:49 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: move error handling in the catch block.
- * MulticastDelegate.cs: remove == and != operators that were
- removed with the delegate changes (when you add stuff, please do not
- remove existing functionality!).
- * Type.cs: if a property is not found in a type, search for it
- in the parent types, too.
-
-2002-03-18 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * Math.cs: changed to use icall instead of PAL.
-
-2002-03-18 Dietmar Maurer <dietmar@ximian.com>
-
- * Double.cs: added check for NaN (Bug [22082])
-
-2002-03-19 Nick Drochak <ndrochak@gol.com>
-
- * Enum.cs (Equals): check for null and throw if it is.
- * Enum.cs (Format): check for null parameters and throw if necessary.
- This method still needs more argument checking.
-
-2002-03-18 Dietmar Maurer <dietmar@ximian.com>
-
- * Enum.cs (Equals): check if Enums are of the same type
-
-2002-03-18 Nick Drochak <ndrochak@gol.com>
-
- * Double.cs: Explicitly handle comparisons in CompareTo() for
- Positive/Negative Infinity and NaN. Unit Test now passes on Linux.
-
- * Enum.cs(CompareTo): Check types of values before trying to compare.
- Throw exceptions if types are invalid or don't match.
-
-2002-03-14 Miguel de Icaza <miguel@ximian.com>
-
- * Array.cs: Add some extra debugging information.
-
-2002-03-15 Nick Drochak <ndrochak@gol.com>
-
- * Array.cs: Added IList and IEnumerable.
-
-2002-03-14 Miguel de Icaza <miguel@ximian.com>
-
- * UInt64.cs, UInt32.cs, UInt16.cs: Mark public parse methods as
- NonCLSCompliant.
-
-2002-03-14 Dietmar Maurer <dietmar@ximian.com>
-
- * Delegate.cs (Equals): also compare method_ptr
- (GetHashCode): returm method_ptr as hash
-
-2002-03-13 Duco Fijma <duco@lorentz.xs4all.n>
- * TimeSpan.cs: removed the use of Custom Numeric Format Strings,
- such as 42.ToString("0000000"), as these are (currently) not implemented
- in System.IntegerFormatter. TimeSpan luckely can do with Standard
- Numeric Format Strings, such as 42.ToString("D7").
-
-2002-03-12 Duncan Mak <duncan@ximian.com>
-
- * FieldAccessException.cs:
- * MethodAccessException.cs:
- * PlatformNotSupportedException.cs: Inherit from
- MemberAccessException, not SystemException.
-
- * ObsoleteAttribute.cs: Made Message and IsError properties
- instead of fields.
-
-Tue Mar 12 19:21:18 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * GC.cs: make SuppressFinalize() a nop.
- * Delegate.cs: fix == operator.
-
-2002-03-13 Nick Drochak <ndrochak@gol.com>
-
- * Enum.cs: Add IConvertible methods. Cyclic dependancy fixed in the
- runtime that goes with this patch.
-
-2002-03-10 Martin Baulig <martin@gnome.org>
-
- * Int32.cs (Parse): Correctly parse negative numbers.
-
-2002-03-08 Martin Baulig <martin@gnome.org>
-
- * String.cs (Split): Really fix it this time. Also adding several new
- testcase to the testsuite.
-
-2002-03-08 Martin Baulig <martin@gnome.org>
-
- * Array.cs (Copy): Optimized: removed duplicate null check, removed
- two duplicate GetLowerBound() calls and one duplicate IsValueType.
-
-Fri Mar 8 18:49:19 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Object.cs: commit my hacked GetHashCode(): it's good enough for now.
- * String.cs: use the dumb code for IndexOf(string): this is worth
- 15-20 % speedup in mcs compile with mint.
-
-Fri Mar 8 12:45:44 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: revert change to Split() that broke the compiler (hi martin!:-).
-
-2002-03-07 Martin Baulig <martin@gnome.org>
-
- * String.cs (Join): Throw an ArgumentNullException.
- (LastIndexOf (string,int,int)): This method does a backwards search,
- so startIndex points to the end of value, not to its beginning. Don't
- throw an exception if startIndex equals this.Length. Always return -1
- if startIndex is smaller than the length of value.
- (Replace (string,string)): Replace all occurences of oldValue.
- If newValue is null, all occurences of oldValue are to be removed.
- (Split (char[],int)): Return an empty array if maxCount is zero, throw
- an ArgumentOutOfRangeException if it's less than zero. Return maxValue
- elements, not maxValue+1.
-
-Thu Mar 7 17:16:06 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: make GetEvents() an internal call.
- * MulticastDelegate.cs: copy the passed in array.
-
-2002-03-06 Martin Baulig <martin@gnome.org>
-
- * Array.cs (Copy): Use FastCopy when appropriate and do correct
- exception handling.
-
-2002-03-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * CharEnumerator.cs: fixes to CharEnumertor.MoveNext, fixing
- some of the failures found be new tests (see ChangeLog in
- Test/System). Comments added to this method, based on
- the representation invariant of this class, that (try to) explain
- why it now should be correct.
-
-2002-03-06 Dietmar Maurer <dietmar@ximian.com>
-
- * Int64.cs (Parse): bug fix for max. negative value.
-
-2002-03-07 Nick Drochak <ndrochak@gol.com>
-
- * RuntimeTypeHandle.cs: Add Serializable attribute as the docs say.
- I need to understand what the difference between the attribute and
- the interface is.
-
-2002-03-06 Martin Baulig <martin@gnome.org>
-
- * Array.cs (Copy): Always throw an ArrayTypeMismatchException, not
- an InvalidCastException if the widening conversion failed. See
- testcases #M94-#M96.
-
- * Array.cs (CopyTo): Bug fix from Ajay Dwivedi, correctly handle
- arrays with non-zero lower bounds. Also adding testcases #F10-#F13
- for this.
-
- * Array.cs (CopyTo): Reverted my last change, it was incorrect.
- (Copy): Actually allow copying multi-dimensional arrays.
-
-2002-03-05 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs:
- (DBNull) Added the missing field.
- (IsDBNull) Fixed typo.
- (ToByte (string, int)) Implemented.
- (ToString (byte, int)) Implemented.
- (ConvertToBase)
- (BuildConvertedString) internal functions used for converting values to
- a specific base.
-
- * Int16.cs:
- * Int32.cs:
- * Int64.cs:
- * Single.cs:
- * UInt16.cs:
- * UInt32.cs: Implemented the IConvertible interface.
-
- * CharEnumerator.cs: Renamed to variables to be clearer and
- changed some of the tests to conform to the 1.0 spec.
-
-2002-03-06 Martin Baulig <martin@gnome.org>
-
- * Array.cs (Copy): Calculate absolute array position here and use
- GetValueImpl() and SetValueImpl() with that position. We can now
- copy multi-dimensional arrays.
- (CopyTo): Small bug fix.
-
-2002-03-05 Duco Fijma <duco@lorentz.xs4all.nl>
-
- * Version.cs: CompareTo changed according the LAMESPEC discovered by
- Nick (See VersionTest.cs).
- * CharEnumerator.cs: fixed two bugs in MoveNext. It had an off-by-one
- error comparing the current position (idx) against the length of the
- string iterated and it set idx to an unrecognized special value (-2)
-
-Tue Mar 5 17:34:14 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * SByte.cs, UInt64.cs: implement IConvertible interface. Nobody wants
- to do this dirty work, but someone has to do it (and I need it to pass
- the "200 sample tests compiled on linux" mark).
-
-2002-03-06 Nick Drochak <ndrochak@gol.com>
-
- * Attribute.cs
- * DecimalFormatter.cs
- * Delegate.cs
- * Double.cs
- * GC.cs
- * Int16.cs
- * Int32.cs
- * MonoType.cs
- * RuntimeMethodHandle.cs
- * RuntimeTypeHandle.cs
- * String.cs
- * Type.cs:
- Add [MonoTODO]'s to places where we currently throw a
- NotImplementedException.
-
-2002-03-05 Dietmar Maurer <dietmar@ximian.com>
-
- * Int16.cs (Parse): do not overflow on max negative value
-
- * Int32.cs (Parse): do not overflow on max negative value
-
-Mon Mar 4 20:36:05 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: fixed IsClass.
- * MonoType.cs: fixed MemberType, IsPrimitiveImpl, IsPointerImpl,
- IsByRefImpl. Added GetInterfaces().
- * IServiceProvider.cs: compilation fix.
-
-Mon Mar 4 18:37:03 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: allow copying an empty array to an empty array.
-
-Mon Mar 4 17:59:16 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fixed LastIndexOf (string) to do a bit of argument
- checking.
-
-2002-03-04 Duco Fijma <duco@lorentz.xs4all.nl>
- * Version.cs: many fixes to failures found by the newly created
- test cases for this class. Specifically, the CompareTo member
- returned wrong values due to the use of Int32.MaxValue as a special
- value indicating an "undefined" version component. Also implemented the
- missing operators (==, <, >, etc.), one missing constructor and
- and some exception throwing.
-
-2002-03-04 Nick Drochak <ndrochak@gol.com>
-
- * IServiceProvider.cs: Add missing attribute: ComVisible(false)
- * Attribute.cs: Add missing attributes: Serializable and
- AttributeUsage(AttributeTargets.All)
-
-Mon Mar 4 11:26:49 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: implemented GetConstructors(), GetFields(),
- GetMethods(), GetProperties().
- * Object.cs: added debugging icall obj_address().
- * Type.cs: fixed the binding flags for some Get* methods.
- Implemented FindMembers() as calls to the specific GetMember
- methods.
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
- * BitConverter.cs: fixed one little bug: ToString(s, n, 0)
- should give an exception for n>=s.Length.
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * Array.cs: More argument checking and bug fixing.
-
-2002-03-01 Miguel de Icaza <miguel@ximian.com>
-
- * BitConverter.cs: Indentation match
-
- * AppDomain.cs: Added MonoTODOs to this too.
-
- * Buffer.cs: Added MonoTODOs to this.
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * Array.cs: Added argument checking to all methods where it was missing.
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
-
- * BitConverter.cs: Fixed bugs in ToString methods
-
-Fri Mar 1 15:20:00 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MulticastDelegate.cs: implement operators so mcs3 can be used on linux.
-
-2002-03-01 Nick Drochak <ndrochak@gol.com>
-
- * BitConverter.cs: Throw ArgumentException like mscorlib, instead of
- ArgumentOutOfRangeException like the docs say.
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * Enum.cs (CompareTo): Correctly override this method from IComparable.
-
- * Console.cs (setIn, setOut, setError): It's called SetIn, SetOut, SetError.
-
-2002-02-28 Martin Baulig <martin@gnome.org>
-
- * String.cs: This file now passes the testsuite on Linux :-)
-
- * String.cs (Intern, IsInterned): The interncalls are now called _Intern and _IsInterned;
- make them private and provide C# wrappers which do proper argument checking.
-
- * String.cs (Format): Correctly handle escaped brackets.
-
- * String.cs (_CompareChar): New internal function which compares two chars.
- (_Compare): Provide an internal compare method which can do all sorts of
- comparision and call it from all the Compare() methods. Also fixed a lot of
- bugs here, this code now actually passes the testsuite.
-
-2002-02-28 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Added the missing methods. The new class status page
- kicks ass, it even found my typos! Woohoo!
- (ConvertFromBase): Moved the Exception throwing in here and
- removed the other occurances so it's all centralized now.
- (ISDBNull): Implemented.
- (GetTypeCode): Implemented.
-
-2002-02-27 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: Guid.ToString("") and Guid.ToString(null) is now understood as Guid.ToString("D")
- just as in mscorlib. There is (probably) a documentation bug in the MS FrameWork SDK, which
- states that a lacking format should be interpreted as "N".
- Also added [Serializable] attribute
- * TimeSpan.cs: some formatting and added the [Serializable] attribute
-
-2002-02-26 Duncan Mak <duncan@ximian.com>
-
- * WeakReference.cs: Committed for Ajay Kumar Dwivedi.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * TimeZone.cs: Use an internal enum rather than magic numbers to access the
- fields of the interncall GetTimeZoneData.
-
- * DateTime.cs: Implemented Parse and fixed a few bugs.
-
- * String.cs (TrimStart): Small fix.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTime.cs: ParseExact is now fully functional.
-
- * String.cs (TrimEnd): Small fix.
-
-2002-02-26 Duco Fijma <duco@lorentz.xs4all.nl>
- * TimeSpan.cs: Added method TimeSpan.FromMilliseconds, mysteriously
- missing for about six months.
-
-Tue Feb 26 14:21:19 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * UInt64.cs: fixed Parse method () to handle some of the NumberStyle flags.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTime.cs: Miguel already committed this, but there was still a
- ChangeLog entry for this missing ....
- We're now reusing functionality from TimeSpan, printing dates is
- fully implemented, currently working on parsing.
-
- * TimeZone.cs: Fully implemented this. There's a new InternCall in the
- runtime for this.
-
-Fri Feb 22 18:47:08 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: disable constructor.
- * Object.cs: make GetType() an internalcall.
- * Type.cs: added correct bindingflags to GetMethods ().
- All such calls should be reviewed to use the correct flags.
-
-Thu Feb 21 19:23:46 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs, MonoType.cs: type_is_subtype_of () changed to include extra
- argument.
-
-Thu Feb 21 16:56:51 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: implemented IsAssignableFrom.
-
-2002-02-21 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: fixed Guid.Guid(string) ctor. Changed format:
- "{0xdddddddd,0xdddd,0xdddd,{0xdd},{0xdd},{0xdd},{0xdd},{0xdd},{0xdd}}"
- to "{0xdddddddd,0xdddd,0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}}"
- The former is documented by Microsoft. The latter is how they
- actually implemented it in mscorlib:-)
-
-Tue Feb 19 20:34:35 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoCustomAttrs.cs: hooks to get the custom attributes from the
- runtime.
- * MonoType.cs: Implemented custom attributes methods.
-
-
-2002-02-21 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs:
-
-Tue Feb 19 20:34:35 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoCustomAttrs.cs: hooks to get the custom attributes from the
- runtime.
- * MonoType.cs: Implemented custom attributes methods.
-
-2002-02-19 Dietmar Maurer <dietmar@ximian.com>
-
- * Array.cs (CopyTo): use GetLength() instead of GetUpperBound()
-
-2002-02-19 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Finished up the missing methods in Convert. Added a
- new private method ConvertFromBase.
-
-2002-02-19 Dietmar Maurer <dietmar@ximian.com>
-
- * String.cs: impl. IConvertible interface
-
-2002-02-18 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: actual implementation for Guid.Guid(string) Ctor
-
-2002-02-18 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Changed from using Type.GetType (string) to just
- typeof (). Probably will speed things up a bit?
-
-2002-02-18 Ajay Kumar Dwivedi <AjayKumar.Dwivedi@dresdner-bank.com>
-
- * Array.cs:
- 1. Fix for GetUpperBound to return correct values
- 2. made some Properties virtual
- 3. Adds IsFixedSize and IsReadOnly properties.
- 4. changes CreateInstance(Type,int[],int[]) to throw Exception
- when third arg is null. InternalCall CreateInstance changed to
- CreateInstanceImpl
- 5. Fixed array.GetUpperBound at a couple of places
- 6. IndexOf and LastIndexOf now use Object.Equals instead of "=="
- 7. Added two FIXME's in BinarySearch functions.
-
-2002-02-17 Duncan Mak <duncan@ximian.com>
-
- * TimeZone.cs: Applied the rest of Ajay's patch for
- IsDaylightSavingTime. Thanks a lot for the nice explanation of how
- it works!
-
-2002-02-17 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: added stub for Guid(string) ctor
-
-2002-02-17 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Near-complete implementation of Convert.cs
-
- Added all the To* methods taking (object) and
- (object, IFormatProvider) as parameters.
-
- Added [CLSCompliant (false)] attributes to methods dealing with
- unsigned types.
-
- Added the missing section on converting to and from DateTime. Only
- 6 missing methods, all marked with MonoTODOs. Will tackle them later.
-
-2002-02-16 Duncan Mak <duncan@ximian.com>
-
- * TimeZone.cs: patch from Ajay Kumar Dwivedi (adwiv@yahoo.com) to
- make IsDaylightSavingTime (DateTime) call
- IsDaylightSavingTime (DateTime, DaylightTime).
-
- Added internal class CurrentTimeZone from Ajay. It needs more work
- to fill in the appropriate internal calls.
-
-Sat Feb 16 12:41:41 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: fix IsClass.
-
-Sat Feb 16 12:02:02 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix Trim().
-
-Fri Feb 15 21:02:46 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix more off by one errors.
-
-Thu Feb 14 18:54:09 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: fix IsValueTypeImpl.
- * Type.cs: fix IsEnum. Implement Equals methods.
-
-Wed Feb 13 21:50:13 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Int32.cs: implement IConvertible interface.
-
-2002-02-12 Duncan Mak <duncan@ximian.com>
-
- * TimeZone.cs: Implemented and added to CVS.
-
-2002-02-11 Duncan Mak <duncan@ximian.com>
-
- * Convert.cs: Implemented the ChangeType () methods.
-
-Mon Feb 11 19:48:58 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: make Clone() an internal call.
-
-2002-02-09 Duco Fijma <duco@lorentz.xs4all.nl>
- * Changed Guid.NewGuid so that it can use both System.Random and
- System.Security.Cryptography.RandomNumberGenerator
-
-2002-02-09 Duco Fijma <duco@lorentz.xs4all.nl>
- * First version of Guid.NewGuid
-
-2002-02-08 Duncan Mak <duncan@ximian.com>
-
- * RuntimeArgumentHandle.cs: Added to CVS.
-
-Fri Feb 8 19:14:54 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * CrossAppDomainDelegate.cs, AssemblyLoadEventHandler.cs,
- UnhandledExceptionEventHandler.cs: added delegates.
-
-Fri Feb 8 18:06:20 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MarshalByRefObject.cs: add ToString () method
- (apparently needed by nunit).
- * _AppDomain.cs: uncomment ToString(): dietmar fixed the bug triggered
- by it in the runtime.
-
-2002-02-08 Dan Lewis <dihlewis@yahoo.co.uk>
-
- * String.cs (Format): implemented
-
-2002-02-07 Duncan Mak <duncan@ximian.com>
-
- * DuplicateWaitObjectException:
- * InvalidCastException:
- * NotImplementedException:
- * NotSupportedException:
- * NullReferenceException:
- * OutOfMemoryException:
- * OverflowException:
- * RankException:
- * StackOverflowException.cs:
- * UnauthorizedAccessException: Added missing constructor used for serialization.
-
-2002-02-07 Dietmar Maurer <dietmar@ximian.com>
-
- * String.cs (System.Compare): bug fix
-
-2002-02-06 Dietmar Maurer <dietmar@ximian.com>
-
- * Enum.cs (Parse, GetHashCode): impl.
-
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * DBNull.cs: This is my first crack at the DBNull class. I think I
- actually got most of the IConvertible methods right, but I haven't
- done the research to test whether or not this is the correct
- behavior. IConvertible.ToType () is the most iffy of all, IMHO.
-
- * DllNotFoundException.cs: Inherits from TypeLoadException, not SystemException.
-
-2002-02-05 Dietmar Maurer <dietmar@ximian.com>
-
- * Enum.cs: added more functionality (GetName, ToObject, Equals)
-
-2002-01-31 Duncan Mak <duncan@ximian.com>
-
- * InvalidOperationException.cs:
- * NotFiniteNumberException.cs:
- * ObjectDisposedException.cs:
- * TypeInitializationException.cs: Added missing bits for serialization/
-
- * AppDomainUnloadedException.cs:
- * ApplicationException.cs:
- * ArgumentOutOfRangeException.cs:
- * ArithmeticException.cs:
- * ArrayTypeMismatchException:
- * BadImageFormatException.cs:
- * Exception.cs:
- * MissingMemberException.cs:
- * TypeLoadException.cs: Added missing bits for serialization.
-
-2002-01-30 Duco Fijma <duco@lorentz.xs4all.nl>
- * Guid.cs: implemented everything but Guid.NewGuid
-
-Tue Jan 29 22:32:36 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * _AppDomain.cs: remove ToString() method: it doesn't seem right
- to have it in this interface and it screws up the method vtable setup.
-
-2002-01-28 Andrei Zmievski <andrei@php.net>
-
- * Double.cs: implemented IConvertible interface.
-
-2002-01-28 Miguel de Icaza <miguel@ximian.com>
-
- * ArgumentException.cs: Implement serialization constructor.
- (GetObjectData): Implement serializer.
-
- * ArgumentNullException.cs: Implement serialization constructor.
-
- * Exception.cs: Implement serialization constructor.
- (GetObjectData): Implement serializer.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * DateTime.cs (UnixEpoch): The Begining of the Unix epoch.
-
-2002-01-23 Duncan Mak <duncan@ximian.com>
-
- * EntryPointNotFoundException.cs:
- * FormatException: Added missing constructor and related bits.
-
- * TypeLoadException: Added missing constructor, methods and properties.
-
-2002-01-23 Miguel de Icaza <miguel@ximian.com>
-
- * AppDomain.cs (GetAssemblies): Use foreach construct instead of
- manually getting the enumerator.
-
- (AppDomain.AppDomain): Prime the loaded assemblies with the
- assemblies loaded by the runtime in our behalf.
-
- * AppDomainSetup.cs: Remove private keyword, that is the default.
- Add a new property DisallowPublisherPolicy.
-
- * AppDomain.cs (AppDomain.GetAssemblies): Implement.
-
-Tue Jan 22 22:51:48 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs, Type.cs: many updates, corrected implementation,
- completed stubs.
-
-2002-01-20 Andrei Zmievski <andrei@php.net>
-
- * Byte.cs:
- * Char.cs: implemented IConvertible interface.
-
- * Boolean.cs: use our own ToString() method directly.
-
-2002-01-20 Duncan Mak <duncan@ximian.com>
-
- * Files I commited recently: Fixed indentation style.
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * SerializableAttribute.cs: this attrib can be used on enums, structs,
- and delegates too. Added the appropriate usage flags.
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * CharEnumerator.cs: Implemented.
- * String.cs (System): Fixed the GetEnumerator () method(s).
-
- * ObsoleteAttribute.cs:
- * STAThreadAttribute.cs:
- * MTAThreadAttribute.cs:
- * ThreadStaticAttribute.cs:
- * LoaderOptimizationAttribute.cs:
- * PlatformNotSupportedException.cs:
- * LoaderOptimization.cs: Added to CVS.
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * AppDomainUnloadedException.cs:
- * MethodAccessException.cs:
- * ContextMarshalException.cs:
- * CannotUnloadAppDomainException.cs:
- * DllNotFoundException.cs:
- * EntryPointNotFoundException.cs:
- * FieldAccessException.cs:
- * TypeUnloadedException.cs:
- * MissingFieldException.cs: Added to CVS.
-
- * ApplicationException.cs:
- * MemberAccessException.cs:
- * MissingMemberException.cs
- * MissingMethodException.cs:
- * SystemException.cs: Added [Serializable] attribute.
-
- * Exception.cs: Added [Serializable] attribute, made properties
- 'Message', 'Source' and 'StackTrace' virtual methods, per 1.0
- spec.
-
- * ContextStaticAttribute.cs: Added [Serializable] attribute and
- put in the missing constructor.
-
- * Environment.cs: Commented out references to
- EnvironmentPermissionAttribute, because they're just stubbed out
- right now and has no implementation.
-
-2002-01-16 Andrei Zmievski <andrei@php.net>
-
- * Boolean.cs: implemented IConvertible interface
-
-2002-01-15 Nick Drochak <ndrochak@gol.com>
-
- * ResolveEventArgs.cs: class should derive from EventArgs.
-
-2002-01-14 Miguel de Icaza <miguel@ximian.com>
-
- * String.cs (System): Use DefaultMemberName for the String class.
-
-Mon Jan 14 17:06:40 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: use IndexerName in index char accessor.
-
-Thu Jan 10 21:05:23 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MonoType.cs: add rank to MonoTypeInfo and implement GetArrayRank.
- * String.c: eliminate 64k+ method calls in search.
- * Type.cs: handle byref and array types in ToString ().
-
-2002-01-09 Duco Fijma <duco@lorentz.xs4all.nl>
-
- * Guid.cs: created first version
-
-2002-01-10 Dietmar Maurer <dietmar@ximian.com>
-
- * MonoType.cs: added missing TypeAttributes to MonoTypeInfo
-
-Wed Jan 9 19:35:07 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * MulticastDelegate.cs: add == and != operator stubs.
- * String.cs: check for null in == operator.
- * Type.cs: use a virtual method to get TypeAttributes.
-
-Tue Jan 8 23:30:19 EST 2002 Matt Kimball <matt@kimball.net>
- * String.cs: Fixed several off-by-one errors in LastIndexOf* methods
-
-2002-01-09 Nick Drochak <ndrochak@gol.com>
-
- * Environment.cs: Comment out Security attribute and put a MonoTODO
- there as a reminder. We need mcs magic to handle security attributes in
- corlib.
-
-2002-01-07 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created IAppDomainSetup.cs
-
-2002-01-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * Created System._AppDomain interface in _AppDomain.cs
-
-2002-01-06 Nick Drochak <ndrochak@gol.com>
-
- * ResolveEventArgs.cs: New File, completely implemented! ;)
-
-Sat Jan 5 15:53:50 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Enum.cs: dummy ToString impl.
- * String.cs: dummy format implementations to get compiler errors
- somewhat working.
- * Type.cs: implemented filter delegates. FindMembers runs the filter, now.
-
-2002-01-05 Ravi Pratap <ravi@ximian.com>
-
- * TODOAttribute.cs : Augment some more; provide two constructors
- with support for a comment too.
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * Uncommented those MonoTODO's now that Ravi's got
- the class in there
-
-2001-01-04 Ravi Pratap <ravi@ximian.com>
-
- * TODOAttribute.cs : Actually add this time ;-)
-
- Change name to MonoTODO.
-
-2002-01-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (Trim): Fixed a few logic bugs in the code that
- calculated how much to trim off the end of the string.
-
-2001-01-04 Nick Drochak <ndrochak@gol.com>
-
- * Commented out the [TODO] attributes for now. We don't have the
- class written. Also changed it to [MonoTODO]
-
-2002-01-04 Ravi Pratap <ravi@ximian.com>
-
- * TODOAttribute.cs : Add. We use this attribute to tag all bits in
- our class libraries that are incomplete.
-
- * Array.cs : Apply attribute wherever we find a FIXME which says
- we need something to be implemented there.
-
- * Int32.cs : Ditto.
-
- * MulticastDelegate.cs : Ditto.
-
- * RuntimeFieldHandler.cs, RuntimeMethodHandle.cs,
- RuntimeTypeHandle.cs : Ditto.
-
- * String.cs : Ditto.
-
- * Type.cs : Ditto.
-
- * Byte.cs, Char.cs, ContextBoundObject.cs, DateTime.cs, Delegate.cs : Ditto.
-
- * Enum.cs, Environment.cs, Exception.cs, Int64.cs, SByte.cs, Single.cs,
- UInt16.cs, UInt32.cs, ValueType.cs: Ditto.
-
- * Byte.cs, Char.cs, ContextBoundObject.cs, DateTime.cs,
- Delegate.cs : Ditto.
-
- * Enum.cs, Environment.cs, Exception.cs, Int64.cs, SByte.cs,
- Single.cs, UInt16.cs, UInt32.cs, ValueType.cs: Ditto.
-
-Thu Jan 3 23:24:04 CET 2002 Paolo Molaro <lupus@ximian.com>
-
- * Delegate.cs: add Remove() stub.
- * Enum.cs: add ToObject().
- * Type.cs: add IsEnum property.
-
-2002-01-03 Kristian Rietveld <kris@gtk.org>
-
- * Convert.cs: add non-CLS-compliant ToBoolean methods for char,
- DateTime and object.
-
-2001-12-30 Nick Drochak <ndrochak@gol.com>
-
- * Byte.cs (Parse): Add comments to aid in testing.
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * Char.cs (Parse): Implement.
-
- * Byte.cs (Parse): Implement a fast parser.
-
- * SByte.cs (Parse): Implement a fast parser.
-
- * UInt16.cs (Parse): Implement a fast parser.
-
- * Int16.cs (Parse): Implement a fast parser.
-
- * UInt32.cs (Parse): Implement a fast parser.
-
- * Int32.cs (Parse): Implement a fast parser.
-
-Fri Dec 21 15:14:52 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: fix null ref in sort code.
- * UInt64.cs: add bare-bones parse.
-
-Thu Dec 20 15:29:52 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Byte.cs: removed use of Regexes.
-
-Tue Dec 18 18:39:54 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Enum.cs: implemented GetValues(), GetNames(), GetName(),
- IsDefined(), GetUnderlyingType().
- * String.cs: fix one instance of Compare().
- * Type.cs: implemented GetProperties(), GetProperty().
-
-Thu Dec 13 20:10:57 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * Array.cs: implement CopyTo ().
- * Char.cs: implement ToString ().
- * Exception.cs: bugfix.
- * Int32.cs: bare-bones Parse ().
- * MonoType.cs: query the needed info with an internalcall.
- * String.cs: speedups, bugfixes, reduced copies.
- * Type.cs: added missing fields. Implemented many of the Is*
- properties. Implemented GetMethod(), GetConstructor(), GetMethods(),
- GetFields(), FindMembers(), ToString().
-
-2001-12-11 Dick Porter <dick@ximian.com>
-
- * DateTime.cs: Implemented FromFileTime() and ToFileTime()
-
- * Console.cs: Use handles rather than casting file descriptors
-
-2001-12-08 Nick Drochak <ndrochak@gol.com>
-
- * Byte.cs (Parse): Start implementation. Parse(string) works, but
- now we need to handle other formats
-
-2001-12-06 Dietmar Maurer <dietmar@ximian.com>
-
- * DateTime.cs: added an icall to GetNow()
-
-2001-12-04 Dietmar Maurer <dietmar@ximian.com>
-
- * Double.cs: added the parse method from Bob Smith
-
-2001-11-28 Miguel de Icaza <miguel@ximian.com>
-
- * UInt64.cs: ditto.
-
- * UInt32.cs: ditto.
-
- * Int32.cs (Int32.CompareTo): Fix because we can not just
- substract the values.
-
- Return possitive value if the object is null.
-
- * Boolean.cs: (Boolean.CompareTo): ditto.
-
- * Int16.cs (Int16.CompareTo): ditto.
-
- * Byte.cs (Byte.CompareTo): ditto.
-
- * SByte.cs (SByte.CompareTo): ditto.
-
- * Char.cs (Char.CompareTo): ditto.
-
- * Decimal.cs (Decimal.CompareTo): ditto.
-
- * Int64.cs (Int64.CompareTo): ditto.
-
- * Single.cs: Ditto.
-
- * UInt16.cs: Ditto.
-
-2001-11-28 Nick Drochak <ndrochak@gol.com>
-
- * Byte.cs: Throw NotImplementedException for Parse.
-
-2001-11-27 Derek Holden <dholden@draper.com>
-
- * IntegerFormatter.cs: Formatting of type "Number" was not
- using NumberFormatInfo.NumberNegativePattern.
-
-2001-11-26 Dick Porter <dick@ximian.com>
-
- * LocalDataStoreSlot.cs: No need to delete a system TLS slot in
- the finalise routine any more
-
-2001-11-21 Miguel de Icaza <miguel@ximian.com>
-
- * ApplicationException.cs: internationalize by adding calls to
- Locale.GetText (). And throw NotImplementedExceptions on calls
- that we have to implement.
-
- * Version.cs: Ditto.
-
- * ValueType.cs: ditto.
-
- * UnauthorizedAccessException.cs: ditto.
-
- * UInt32.cs: ditto.
-
- * UInt64.cs: ditto.
-
- * UInt16.cs: ditto.
-
- * TypeLoadException.cs: ditto
-
- * TypeInitializationException.cs: ditto.
-
- * Type.cs: ditto.
-
- * TimeSpan.cs: ditto.
-
- * SystemException.cs: ditto.
-
- * String.cs: ditto.
-
- * StackOverflowException.cs: ditto.x
-
- * Single.cs: ditto.
-
- * SByte.cs: ditto.
-
- * RuntimeTypeHandle.cs: ditto.
-
- * RuntimeMethodHandle.cs: ditto.
-
- * RuntimeFieldHandle.cs: ditto.
-
- * Random.cs: ditto.
-
- * OutOfMemoryException.cs: ditto.
-
- * OperatingSystem.cs: ditto.
-
- * ObjectDisposedException.cs: ditto.
-
- * NullReferenceException.cs: ditto.
-
- * NotImplementedException.cs: ditto.
-
- * NotFiniteNumberException.cs: ditto.o
-
- * MulticastNotSupportedException.cs: ditto.
-
- * MissingMethodException.cs: ditto.
-
- * MemberAccessException.cs: ditto.
-
- * Math.cs: ditto.
-
- * InvalidCastException.cs: ditto.
-
- * IntegerFormatter.cs: ditto.
-
- * Int32.cs: ditto.
-
- * Int16.cs: ditto.
-
- * IndexOutOfRangeException.cs: ditto.
-
- * Environment.cs: ditto
-
- * Enum.cs: ditto.
-
- * DuplicateWaitObjectException.cs: ditto.
-
- * DivideByZeroException.cs: ditto.
-
- * Delegate.cs: ditto
-
- * DecimalFormatter.cs: ditto.
-
- * Decimal.cs: ditto.
-
- * DateTime.cs: ditto.
-
- * Convert.cs: ditto.
-
- * Char.cs: ditto.
-
- * Byte.cs: ditto.
-
- * Boolean.cs: ditto.
-
- * ArrayTypeMismatchException.cs: ditto.
-
- * ArithmeticException.cs: ditto.
-
- * ArgumentOutOfRangeException.cs: ditto.
-
- * ArgumentNullException.cs: ditto.
-
- * Enum.cs: Make it derive from ValueType, add CompareTo method.
-
- * Attribute.cs: Reformat.
-
-2001-11-14 Miguel de Icaza <miguel@ximian.com>
-
- * Decimal.cs, Double.cs, Byte.cs, Char.cs, Int16, UInt16, Int32,
- UInt32, Int64, UInt64, SByte, Single (CompareTo): Throw the
- exception if the value is null too.
-
- * Char.cs (CompareTo): ditto.
-
- * ApplicationException.cs: Added constructor that does serialization.
-
- * ParamArrayAttribute.cs: Define attribute correctly.
-
-Wed Nov 14 16:31:19 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AppDomain.cs: rename dummy interface _AppDomain to AppDomain_Intf.
- * Array.cs: fix Array.Copy.
- * AssemblyLoadEventArgs.cs: rename field.
- * CLSCompliantAttribute.cs: use correct name for the class.
- * Char.cs: fix IsLetter.
- * Console.cs, DateTime.cs, Decimal.cs, IConvertible.cs, Math.cs,
- SByte.cs, UInt16.cs, UInt32.cs, UInt64.cs, UIntPtr.cs: CLSCompliant updates.
- * Convert.cs: CLSCompliant updates, add ChangeType() methods.
- * Delegate.cs: renamed target field to m_target.
- * Enum.cs: added missing methods.
- * MonoType.cs: add a constructor and some needed properties.
- * Object.cs: implement GetType().
- * String.cs: CLSCompliant updates. Fixes everywhere to remove the
- ending 0 char.
- * Type.cs: add missing methods/properties.
-
-2001-11-10 Sean MacIsaac <macisaac@ximian.com>
-
- * AttributeUseage.cs: Should define AttributeUsageAttribute.
-
- * CLSCompliant.cs: Marked with AttributeUsage attribute.
-
- * Decimal.cs: Fixed CLSCompliant attributes.
-
- * Type.cs: changed _impl to internal (needs to be accessable by
- subclasses).
-
- (TypeHandle): Marked as abstract, implementation removed.
-
- (IsNotPublic, IsPublic, GetMethods, GetPropery, GetConstructor,
- GetMethod): Added stub implementations so NUnit would link against
- corlib
-
-Tue Nov 6 09:11:43 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * AppDomain.cs: use an internal constructor for AssemblyBuilder.
-
-2001-11-05 Miguel de Icaza <miguel@ximian.com>
-
- * NonSerializedAttribute.cs: Add AttributeUsage rules for this
- attribute.
-
-Fri Nov 2 18:23:15 CET 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix a couple of bugs.
- * AppDomain.cs: use new AppBuilder constructor.
- * Buffer.cs, GC.cs, NonSerializedAttribute.cs,
- NotImplementedException.cs, ObjectDisposedException.cs,
- UnauthorizedAccessException.cs: add implementation.
- * OverflowException.cs: fix class name.
-
-2001-10-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: Don't use a terminating nil char for our internal
- array.
-
-2001-10-27 Miguel de Icaza <miguel@ximian.com>
-
- * Delegate.cs (Delegate.CombineImpl): Implement.
- (Delegate.Combine): Implement.
-
- * MulticastDelegate.cs (MulticastDelegate.Equals): Implement.
-
- (MulticastDelegate.CombineImpl): This was not as trivial as I
- thought.
-
- * ContextStaticAttribute.cs: Added AttributeUsage to
- ContextStaticAttribute.
-
- * FlagsAttribute.cs: Add AttributeUsage to FlagsAttribute
-
-2001-10-15 Martin Weindel <martin.weindel@t-online.de>
-
- * added Decimal.cs * added DecimalFormatter.cs (internal class
- used from System.Decimal)
-
-2001-10-11 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * Convert.cs: Added methods for Base64 transforming just used the
- existing System.Security.Cryptography.ToBase64Transform, should
- be changed to use a stand-alone class, e.g. Base64Encoder
-
-2001-10-10 Derek Holden <dholden@draper.com>
-
- * IntegerFormatter.cs: Added. Implements ToString for all the
- integer data types for all the format types.
-
- * Byte.cs: Using IntegerFormatter for ToString's.
-
- * SByte.cs: Using IntegerFormatter for ToString's.
-
- * Int16.cs: Using IntegerFormatter for ToString's.
-
- * Int32.cs: Using IntegerFormatter for ToString's.
-
- * Int64.cs: Using IntegerFormatter for ToString's.
-
- * UInt16.cs: Using IntegerFormatter for ToString's.
-
- * UInt32.cs: Using IntegerFormatter for ToString's.
-
- * UInt64.cs: Using IntegerFormatter for ToString's.
-
-2001-10-07 Miguel de Icaza <miguel@ximian.com>
-
- * Exception.cs: Implement bits of serialization.
-
- * RuntimeFieldHandle.cs: Implement Serialization features.
-
- * Type.cs: Implement TypeHandle property.
-
-2001-09-28 Dick Porter <dick@ximian.com>
-
- * LocalDataStoreSlot.cs: Implemented
-
-Tue Sep 25 19:58:14 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: fix off-by-one error in Trim().
-
-Tue Sep 25 18:52:14 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Type.cs: added GetType () method.
-
-Tue Sep 25 17:29:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * MissingMethodException.cs, MissingMemberException.cs,
- MemberAccessException.cs: added.
-
-Tue Sep 25 16:46:43 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: don't access the string array out of bounds in
- LastIndexOf. * Type.cs: fix return type of the Assembly property.
-
-Mon Sep 24 20:35:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * String.cs: make Intern and IsIntern internalcalls.
-
-2001-09-13 Dick Porter <dick@ximian.com>
-
- * Type.cs: Added a stub for the IsValueType property.
-
- * SystemException.cs (System): Added the other constructor, so
- that System.Threading exceptions can inherit it.
-
-2001-09-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (TrimStart): Don't keep looping through the trimchars
- once we've found a match.
- (TrimEnd): Same here.
- (Trim): And finally here.
-
-2001-09-07 Ravi Pratap <ravi@ximian.com>
-
- * Char.cs (IsLetterOrDigit): Implement.
- (IsLower): Implement, but we need to be Unicode aware.
- (IsNumber): Implement.
- (IsPunctuation): Implement.
- (IsWhiteSpace): Implement.
- (ToUpper): Fix to subtract 32 from the ASCII value, not 33 :)
- (ToLower): Same here.
-
-2001-09-04 Miguel de Icaza <miguel@ximian.com>
-
- * Object.cs: Shortcut, if (a == b) then return true.
-
-Fri Sep 7 18:34:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * Delegate.cs: we need a pointer to the method thunk in
- the delegate object.
-
-Fri Sep 7 12:28:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
-
- * AsyncCallback.cs, common.src: add AsyncCallback delegate.
-
-2001-09-06 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (System): Don't mix uint and int.
-
-2001-09-04 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (BoyerMoore): Modified to not use pointers and to instead
- use indexes.
- (IndexOf): Use BoyerMoore.
-
-2001-09-02 Miguel de Icaza <miguel@ximian.com>
-
- * All over: Use the autogenerated enumerations from the ECMA
- documentation that Sergey wrote.
-
- * PlatformID.cs: Add Unix definition.
-
- * OperatingSystem.cs: Use Unix instead of Linux here.
-
- * MarshalByRefObject.cs: Mark class as [Serializable].
-
-2001-08-28 Dietmar Maurer <dietmar@ximian.com>
-
- * Console.cs: impl. (write only)
- implemented the stdin stuff
-
- * Int32.cs: impl. real op_Equal
-
-2001-08-24 Miguel de Icaza <miguel@ximian.com>
-
- * (common.src): Removed IAsyncResult as it is not on CVS yet.
-
- * UIntPtr.cs: Removed CLSCompliant attribute before the namespace,
- as it breaks the build.
-
-2001-08-23 Michael Lambert <michaellambert@email.com>
-
- * IntPtr.cs: Optimized unsafe declaration, implemented GetObjectData,
- added CLSCompliant attribute
-
- * IAsyncResult.cs: Added
-
- * common.src: Added IAsyncResult.cs
-
-2001-08-23 Michael Lambert <michaellambert@email.com>
-
- * UIntPtr.cs: Added
-
- * common.src: Added UIntPtr.cs
-
-2001-08-20 Dietmar Maurer <dietmar@ximian.com>
-
- * Attribute.cs: uncomment some code to make it compile again
-
- * mono.src: removed duplicated Attribute.cs
-
-2001-08-16 Nick Drochak <ndrochak@gol.com>
-
- * Attribute.cs: implemented all methods except GetHashCode()
-
- * common.src: added Attribute.cs so it would compile in
-
-2001-08-10 Dietmar Maurer <dietmar@ximian.com>
-
- * Object.cs: changed MemberWiseClone to MemberwiseClone, and
- marked it as InternalCall
-
- * common.src: removed UriFormatException.cs because the file is
- not there.
-
- * RuntimeTypeHandle.cs: replaced IntrPtr with IntPtr
- * Char.cs: replaced byte with char
-
- * Array.cs: make it work with the mono interpreter
-
-2001-08-06 Miguel de Icaza <miguel@ximian.com>
-
- * Version.cs: Make the class sealed
-
-2001-08-08 Bob Smith <bob@thestuff.net>
-
- * Random.cs: Many compile fixes.
- * Random.cs: I read a bad spec. Class updated to match real spec.
-
-2001-08-06 Miguel de Icaza <miguel@ximian.com>
-
- * IntPtr.cs: Added and Completed implementation.
-
- * Uri.cs: Add a note.
-
-2001-08-06 Bob Smith <bob@thestuff.net>
-
- * Random.cs: Compile fix. Needs more testing.
-
-2001-08-06 Garrett Rooney <rooneg@electricjellyfish.net>
-
- * Uri.cs: Initial Implementation. Parsing needs to be fixed to take
- into account IPv6 addresses, url encoding needs to be implemented, and
- various minor methods need to be written, but this is a decent start.
-
-2001-08-06 Dietmar Maurer <dietmar@ximian.com>
-
- * common.src: added Object.cs
-
- * mono.src: added ValueType.cs
-
-2001-08-02 Dietmar Maurer <dietmar@ximian.com>
-
- * Math.cs: replaced libc with libm
-
-2001-08-02 Bob Smith <bob@thestuff.net>
-
- * Random.cs: Implemented. Needs testing.
-
-2001-08-02 Miguel de Icaza <miguel@ximian.com>
-
- * IServiceProvider.cs, EventHandler.cs: New files.
-
-2001-08-02 Marcel Narings <marcel@narings.nl>
-
- * DateTime.cs: Cleaned up a bit. Added the Add* family members.
- Added exceptions. Added IConvertible. Still needs some platform
- dependend stuff, the Parse and ToString members
-
-2001-08-01 Dietmar Maurer <dietmar@ximian.com>
-
- * Type.cs (GetTypeFromHandle): added placeholder
-
-2001-07-24 Derek Holden <dholden@draper.com>
-
- * Boolean.cs: Formatted to code style standard. Added GetTypeCode
- which is really an IConvertible defined method.
-
- * Byte.cs: Added a missing Parse method. Put in Parse and ToString
- behavior, still need to do the main Parse and ToString.
-
- * Char.cs: Added a bunch of missing ECMA methods. Commented a
- specification discrepency. Still didn't any unicode stuff, though
- every IsFoo(char c) method has an IsFoo(string, index)
- counterpart, added wrappers for those.
-
- * Convert.cs: Fixed NaN/Inf checking and double/float
- rounding. Added ToType for IConvertible classes
-
- * Double.cs: Fixed ECMA min and max values. Added IsInfinity /
- IsNaN methods. Changed Inf/NaN internals.
-
- * IConvertible.cs: Added comments for using
- Convert.ToType. Changed return values to draft base values.
-
- * Int16.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * Int32.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * Int64.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * Single.cs: Put in ECMA epsilon value. Added IsInfinity / IsNaN
- methods. Changed Inf/NaN internals.
-
- * SByte.cs: Added a missing Parse method. Put in Parse and
- ToString behavior, still need to do the main Parse and ToString.
-
- * UInt16.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * UInt32.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
- * UInt64.cs: Added a missing Parse statement. Put in behavior for
- overloaded ToString and Parse methods.
-
-2001-07-20 Miguel de Icaza <miguel@ximian.com>
-
- * MulticastDelegate.cs: New File.
-
- * Delegate.cs: New file.
-
- * Enum.cs: New file.
-
- * Attribute.cs: New file.
-
- * Type.cs: New file.
-
- * ParamArrayAttribute.cs: New file.
-
- * RuntimeTypeHandle.cs: New file.
-
- * MulticastDelegate.cs: Added.
-
- * DateTime.cs: Added
-
- * Delegate.cs: Added
-
-2001-07-18 Michael Lambert <michaellambert@email.com>
-
- * AttributeTargets.cs: Add.
-
-2001-07-19 Jeffrey Stedfast <fejj@ximian.com>
-
- * Char.cs: Made ToUpper and ToLower public methods.
-
- * String.cs: Lots and lots of compile fixes - just need to write
- DateTime.cs and this should build completely now.
-
-2001-07-19 Bob Smith (bob@thestuff.net)
-
- * Math.cs: Implemented.
-
-2001-07-19 Miguel de Icaza <miguel@ximian.com>
-
- * String.cs: Removed tolower and toupper.
-
- * Char.cs: Moved ToLower and ToUpper from string to here.
-
- * Convert.cs ToByte (float value), ToByte (double value) Use IsNan
- instead of comparing the value to Nan.
-
-2001-07-19 Duco Fijma (duco@lorentz.xs4all.nl)
-
- * TimeSpan.cs: New implementation.
-
-2001-07-18 Scott Sanders <scott@stonecobra.com>
-
- * UriFormatExcpetion.cs: Add - 85% complete
-
-2001-07-17 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs (IndexOf): Slight optimization that allows skipping
- over a few chars here and there. This isn't as good as using my
- Boyer-Moore implementation, however, Boyer-Moore is only really
- good for long strings (I plan on making the code decide which
- string search algorithm it should use on-the-fly at some point).
- (LastIndexOf): Fix to work correctly.
- (BoyerMoore): Took out some unneeded code and fixed an edge-case.
-
-2001-07-16 Michael Lambert <michaellambert@email.com>
-
- * EventArgs.cs: Add.
-
-2001-07-16 Miguel de Icaza <miguel@ximian.com>
-
- * Version.cs: Remove my buggy comment.
-
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * String.cs: Spelling error of IComparable, object's
- MemberwiseClone cannot be overridden. Made indexer valid for now,
- but not sure what to do about this in the long run. Seems to be a
- couple bugs in csc.exe having to do with multiple pointer defs in
- the same statement, and returning subclasses of a class in the
- return type of an interface function implementation. Also moved
- operators inside of class definition.
-
-2001-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: A tom of compile fixes, although we still don't compile.
-
- * IConvertible.cs: The To*Int64() methods return *Int64's, not
- *Int32's. Also, it's ToDateTime() not ToDateType().
-
-2001-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: Apparently I needed to at least write stubs for the
- IConvertible interfaces. *sigh*
-
-2001-07-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * String.cs: Many logic/other fixes and better usage of the
- features of c#
- (tolower): New convenience method to help condense code.
- (toupper): Another new helper method.
- (Compare): Use the new helper methods.
- (ToLower): use tolower().
- (ToUpper): use toupper().
- (LastIndexOfAny): Implemented.
- (BoyerMoore): New private helper method that implements a modified
- version of the Boyer-Moore search algorithm. Noothing uses it yet
- as I'm not 100% sure it even works properly with unicode strings
- not to mention it uses a huge lookup-table :-)
- (Split): Implemented.
-
-2001-07-13 Jeffrey Stedfast <fejj@ximian.com>
-
- * TODO: Added things that need to be finished in System.String
-
- * String.cs: New source file implementing the System.String class
-
-2001-07-12 Sean MacIsaac <macisaac@ximian.com>
-
- * TypeCode.cs: UInt64 was UInt63.
-
- * Object.cs: Fixed a numer of compiler errors.
-
- * Array.cs: Fixed some compiler errors.
-
- * IComparable.cs: Fixed some compiler errors.
-
- * ICloneable.cs: Fixed some compiler errors.
-
- * IConvertible.cs: Fixed some compiler errors.
-
- * IFormattable.cs: Fixed a compiler error.
-
- * IFormatProvider.cs: Fixed a compiler error.
-
- * IDisposable.cs: Fixed a compiler error.
-
- * IFormatProvider.cs: Added public accesability type to
- IFormatProvider.
-
- * Exception.cs: Added a using statement to remove compile time
- error.
-
- * ApplicationException.cs: Removed a ; that was causing a compiler
- error.
-
- * Int16.cs: Fixed some compiler errors.
-
- * Int32.cs: Fixed some compiler errors.
-
- * Int64.cs: Fixed some compiler errors.
-
- * SystemException.cs: Fixed a compiler error.
-
- * UInt16.cs: Fixed some compiler errors.
-
- * UInt32.cs: Fixed some compiler errors.
-
- * UInt64.cs: Fixed some compiler errors.
-
- * Void.cs: Fixed a compiler error.
-
-2001-07-12 Joe Shaw <joe@ximian.com>
-
- * Array.cs: Fix backwards parameters to Array.SetValue()
- throughout.
- (BinarySearch): Fix backward logic surrounding whether to call
- value.CompareTo or comparer.Compare.
- (LastIndexOf): Stop being stupid. I am so not used to strongly
- bounded arrays...
- (Sort): Implement a quicksort.
-
-2001-07-11 Joe Shaw <joe@ximian.com>
-
- * Array.cs: Change all instances of trying to access an array with
- the index operator to calls to GetValue and SetValue, and add
- InternalGetValue and InternalSetValue which are internal calls
- into the runtime. Ew.
-
-2001-07-10 Joe Shaw <joe@ximian.com>
-
- * Array.cs: Implemented everything but Sort().
-
-2001-07-09 Jeffrey Stedfast <fejj@ximian.com>
-
- * Object.cs (Object::Equals): Object variable name is `o'.
-
-2001-07-06 Joe Shaw <joe@ximian.com>
-
- * Int16.cs, Int32.cs, Int64.cs, UInt16.cs, UInt32.cs, UInt64.cs:
- Implement the IComparable and IFormattable interfaces. Fix a typo
- (publig -> public)
-
- * ApplicationException.cs, ArgumentException.cs,
- ArgumentNullException.cs, ArgumentOutOfRangeException.cs,
- ArtithmeticException.cs, ArrayTypeMismatchException.cs,
- DivideByZeroException.cs, DuplicateWaitObjectException.cs,
- ExecutionEngineException.cs, FormatException.cs,
- IndexOutOfRangeException.cs, InvalidCastException.cs,
- InvalidOperationException.cs, InvalidProgramException.cs,
- MulticateNotSupportedException.cs, NotFiniteNumberException.cs,
- NotSupportedException.cs, NullReferenceException.cs,
- OutOfMemoryException.cs, OverflowException.cs, RankException.cs,
- StackOverflowException.cs, SystemException.cs,
- TypeInitializationException.cs: Added all of the exceptions
- specified by the language spec. Mmmm... bloat.
-
-2001-07-06 Miguel de Icaza <miguel@ximian.com>
-
- * Int64.cs, Int32.cs: Put. Parsing and ToString missing. Should
- do a generic routine all of these guys use.
-
- * Int16.cs: identified missing methods.
-
- * UInt16.cs, UInt32.cs, UInt64.cs: Add.
-
-2001-06-26 Miguel de Icaza <miguel@ximian.com>
-
- * TypeCode.cs: Implement
-
- * Void.cs: Implement.
-
- * TODO: Add file to keep track of pending tasks.
-
- * Object.cs, ValueType.cs: Implement.
diff --git a/mcs/class/corlib/System/Char.cs b/mcs/class/corlib/System/Char.cs
deleted file mode 100644
index 58e5dc33ab6..00000000000
--- a/mcs/class/corlib/System/Char.cs
+++ /dev/null
@@ -1,399 +0,0 @@
-//
-// System.Char.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-// Note about the ToString()'s. ECMA says there's only a ToString() method,
-// BUT it is just a wrapper for ToString(null). However there is no other ToString
-// in the docs. Turning to the NET framework sdk reveals that there is a
-// ToString(formatprovider) method, as well as a 'static ToString (char c)' method,
-// which appears to just be a Convert.ToString(char c) type method. ECMA also
-// doesn't list this class as implementing IFormattable.
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- [Serializable]
- public struct Char : IComparable, IConvertible { //, IFormattable {
- public const char MaxValue = (char) 0xffff;
- public const char MinValue = (char) 0;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public char value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Char))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Char"));
-
- char xv = (char) v;
- if (value == xv)
- return 0;
-
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Char))
- return false;
-
- return ((Char) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern double GetNumericValue (char c);
-
- public static double GetNumericValue (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
-
- return GetNumericValue (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern UnicodeCategory GetUnicodeCategory (char c);
-
- public static UnicodeCategory GetUnicodeCategory (string str, int index) {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText ("The value of index is less "+
- "than zero, or greater than or equal to the length of str"));
-
- return GetUnicodeCategory (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsControl (char c);
-
- public static bool IsControl (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("Str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsControl (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsDigit (char c);
-
- public static bool IsDigit (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("Str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsDigit (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsLetter (char c);
-
- public static bool IsLetter (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsLetter (str[index]);
- }
-
- public static bool IsLetterOrDigit (char c)
- {
- if (IsLetter (c) == false && IsDigit (c) == false)
- return false;
- else
- return true;
- }
-
- public static bool IsLetterOrDigit (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsLetterOrDigit (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsLower (char c);
-
- public static bool IsLower (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsLower (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsNumber (char c);
-
- public static bool IsNumber (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsNumber (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsPunctuation (char c);
-
- public static bool IsPunctuation (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsPunctuation (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsSeparator (char c);
-
- public static bool IsSeparator (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsSeparator (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsSurrogate (char c);
-
- public static bool IsSurrogate (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsSurrogate (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsSymbol (char c);
-
- public static bool IsSymbol (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsSymbol (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsUpper (char c);
-
- public static bool IsUpper (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsUpper (str[index]);
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern bool IsWhiteSpace (char c);
-
- public static bool IsWhiteSpace (string str, int index)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (index < 0 || index >= str.Length)
- throw new ArgumentOutOfRangeException (Locale.GetText (
- "The value of index is less than zero, or greater than or equal to the length of str"));
-
- return IsWhiteSpace (str[index]);
- }
-
- public static char Parse (string str)
- {
- if (str == null)
- throw new ArgumentNullException (Locale.GetText ("str is a null reference"));
-
- if (str.Length != 1)
- throw new FormatException ("string contains more than one character.");
-
- return str [0];
- }
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern char ToLower (char c);
-
- [MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
- public static extern char ToUpper (char c);
-
- public override string ToString ()
- {
- // LAMESPEC: ECMA draft lists this as returning ToString (null),
- // However it doesn't list another ToString() method.
- return new String (value, 1);
- }
-
- public string ToString (IFormatProvider fp)
- {
- // LAMESPEC: ECMA draft doesn't say Char implements IFormattable
- return new String (value, 1);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Char;
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte(value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return value;
- }
-
- [CLSCompliant(false)]
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- string IConvertible.ToString (IFormatProvider provider)
- {
- return ToString(provider);
- }
-
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/CharEnumerator.cs b/mcs/class/corlib/System/CharEnumerator.cs
deleted file mode 100644
index 7689a5a3b4c..00000000000
--- a/mcs/class/corlib/System/CharEnumerator.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// System.CharEnumerator.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System.Collections;
-
-namespace System
-{
- [Serializable]
- public sealed class CharEnumerator : IEnumerator, ICloneable
- {
- private string str;
- private int index;
- private int length;
- // Representation invariant:
- // length == str.Length
- // -1 <= index <= length
-
- // Constructor
- internal CharEnumerator (string s)
- {
- str = s;
- index = -1;
- length = s.Length;
- }
-
- // Property
- public char Current
- {
- get {
- if (index == -1 || index == length)
- throw new InvalidOperationException
- ("The position is not valid.");
-
- return str [index];
- }
- }
-
- object IEnumerator.Current
- {
- get {
- if (index == -1 || index == length)
- throw new InvalidOperationException
- ("The position is not valid");
-
- return str [index];
- }
- }
-
- // Methods
- public object Clone ()
- {
- CharEnumerator x = new CharEnumerator (str);
- x.index = index;
- return x;
- }
-
- public bool MoveNext ()
- {
- // Representation invariant holds: -1 <= index <= length
-
- index ++;
-
- // Now: 0 <= index <= length+1;
- // <=>
- // 0 <= index < length (OK) ||
- // length <= index <= length+1 (Out of bounds)
-
- if (index >= length) {
- index = length;
- // Invariant restored:
- // length == index
- // =>
- // -1 <= index <= length
- return false;
- }
- else
- return true;
- }
-
- public void Reset ()
- {
- index = -1;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Console.cs b/mcs/class/corlib/System/Console.cs
deleted file mode 100644
index 79951bfa149..00000000000
--- a/mcs/class/corlib/System/Console.cs
+++ /dev/null
@@ -1,319 +0,0 @@
-//
-// System.Console.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.IO;
-
-namespace System {
-
- public sealed class Console {
-
- private static TextWriter stdout;
- private static TextWriter stderr;
- private static TextReader stdin;
-
- static Console ()
- {
- stderr = new StreamWriter (OpenStandardError ());
- ((StreamWriter)stderr).AutoFlush = true;
- stdout = new StreamWriter (OpenStandardOutput ());
- ((StreamWriter)stdout).AutoFlush = true;
- stdin = new StreamReader (OpenStandardInput ());
- }
-
- private Console () {}
-
- public static TextWriter Error
- {
- get {
- return stderr;
- }
- }
-
- public static TextWriter Out
- {
- get {
- return stdout;
- }
- }
-
- public static TextReader In
- {
- get {
- return stdin;
- }
- }
-
- public static Stream OpenStandardError ()
- {
- return OpenStandardError (0);
- }
-
- public static Stream OpenStandardError (int bufferSize)
- {
- return new FileStream (MonoIO.ConsoleError,
- FileAccess.Write,
- false, bufferSize);
- }
-
- public static Stream OpenStandardInput ()
- {
- return OpenStandardInput (0);
- }
-
- public static Stream OpenStandardInput (int bufferSize)
- {
- return new FileStream (MonoIO.ConsoleInput,
- FileAccess.Read,
- false, bufferSize);
- }
-
- public static Stream OpenStandardOutput ()
- {
- return OpenStandardOutput (0);
- }
-
- public static Stream OpenStandardOutput (int bufferSize)
- {
- return new FileStream (MonoIO.ConsoleOutput,
- FileAccess.Write,
- false, bufferSize);
- }
-
- public static void SetError (TextWriter newError)
- {
- if (newError == null)
- throw new ArgumentNullException ();
-
- stderr = newError;
- }
-
- public static void SetIn (TextReader newIn)
- {
- if (newIn == null)
- throw new ArgumentNullException ();
-
- stdin = newIn;
- }
-
- public static void SetOut (TextWriter newOut)
- {
- if (newOut == null)
- throw new ArgumentNullException ();
-
- stdout = newOut;
- }
-
- public static void Write (bool value)
- {
- stdout.Write (value);
- }
-
- public static void Write (char value)
- {
- stdout.Write (value);
- }
-
- public static void Write (char[] value)
- {
- stdout.Write (value);
- }
-
- public static void Write (decimal value)
- {
- stdout.Write (value);
- }
-
- public static void Write (double value)
- {
- stdout.Write (value);
- }
-
- public static void Write (int value)
- {
- stdout.Write (value);
- }
-
- public static void Write (long value)
- {
- stdout.Write (value);
- }
-
- public static void Write (object value)
- {
- stdout.Write (value);
- }
-
- public static void Write (float value)
- {
- stdout.Write (value);
- }
-
- public static void Write (string value)
- {
- stdout.Write (value);
- }
-
- [CLSCompliant(false)]
- public static void Write (uint value)
- {
- stdout.Write (value);
- }
-
- [CLSCompliant(false)]
- public static void Write (ulong value)
- {
- stdout.Write (value);
- }
-
- public static void Write (string format, object arg0)
- {
- stdout.Write (format, arg0);
- }
-
- public static void Write (string format, params object[] arg)
- {
- stdout.Write (format, arg);
- }
-
- public static void Write (char[] buffer, int index, int count)
- {
- stdout.Write (buffer, index, count);
- }
-
- public static void Write (string format, object arg0, object arg1)
- {
- stdout.Write (format, arg0, arg1);
- }
-
- public static void Write (string format, object arg0, object arg1, object arg2 )
- {
- stdout.Write (format, arg0, arg1, arg2);
- }
-
- public static void WriteLine ()
- {
- stdout.WriteLine ();
- }
-
- public static void WriteLine (bool value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (char value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (char[] value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (decimal value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (double value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (int value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (long value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (object value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (float value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- [CLSCompliant(false)]
- public static void WriteLine (uint value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- [CLSCompliant(false)]
- public static void WriteLine (ulong value)
- {
- stdout.Write (value);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, object arg0)
- {
- stdout.Write (format, arg0);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, params object[] arg)
- {
- stdout.Write (format, arg);
- stdout.WriteLine();
- }
-
- public static void WriteLine (char[] buffer, int index, int count)
- {
- stdout.Write (buffer, index, count);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, object arg0, object arg1)
- {
- stdout.Write (format, arg0, arg1);
- stdout.WriteLine();
- }
-
- public static void WriteLine (string format, object arg0, object arg1, object arg2)
- {
- stdout.Write (format, arg0, arg1, arg2);
- stdout.WriteLine();
- }
-
- public static int Read ()
- {
- return stdin.Read ();
- }
-
- public static string ReadLine ()
- {
- return stdin.ReadLine ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ContextBoundObject.cs b/mcs/class/corlib/System/ContextBoundObject.cs
deleted file mode 100644
index 92e95e454aa..00000000000
--- a/mcs/class/corlib/System/ContextBoundObject.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// System.ContextBoundObject.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-namespace System {
-
- /// <summary>
- /// Base class for all the context-bound classes
- /// </summary>
- [MonoTODO]
- [Serializable]
- public abstract class ContextBoundObject : MarshalByRefObject {
-
- protected ContextBoundObject ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ContextMarshalException.cs b/mcs/class/corlib/System/ContextMarshalException.cs
deleted file mode 100644
index bb058cf2e09..00000000000
--- a/mcs/class/corlib/System/ContextMarshalException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.ContextMarshalException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class ContextMarshalException : SystemException
- {
- // Constructors
- public ContextMarshalException ()
- : base (Locale.GetText ("Attempt to marshal and object across a context failed."))
- {
- }
-
- public ContextMarshalException (string message)
- : base (message)
- {
- }
-
- protected ContextMarshalException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public ContextMarshalException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ContextStaticAttribute.cs b/mcs/class/corlib/System/ContextStaticAttribute.cs
deleted file mode 100755
index 054c9845e6f..00000000000
--- a/mcs/class/corlib/System/ContextStaticAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// System.ContextStaticAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The ContextStatic attribute is used to flag fields as being unique
- /// </summary>
- ///
- /// <remarks>
- ///
- /// </remarks>
- [AttributeUsage (AttributeTargets.Field)]
- [Serializable]
- public class ContextStaticAttribute : Attribute {
-
- public ContextStaticAttribute () : base ()
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Convert.cs b/mcs/class/corlib/System/Convert.cs
deleted file mode 100644
index 97b7800e9ac..00000000000
--- a/mcs/class/corlib/System/Convert.cs
+++ /dev/null
@@ -1,2463 +0,0 @@
-//
-// System.Convert.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// System.Convert class. This was written word for word off the
-// Library specification for System.Convert in the ECMA TC39 TG2
-// and TG3 working documents. The first page of which has a table
-// for all legal conversion scenerios.
-//
-// This header and the one above it can be formatted however, just trying
-// to keep it consistent w/ the existing mcs headers.
-//
-// This Convert class could be written another way, with each type
-// implementing IConvertible and defining their own conversion functions,
-// and this class just calling the type's implementation. Or, they can
-// be defined here and the implementing type can use these functions when
-// defining their IConvertible interface. Byte's ToBoolean() calls
-// Convert.ToBoolean(byte), or Convert.ToBoolean(byte) calls
-// byte.ToBoolean(). The first case is what is done here.
-//
-// See http://lists.ximian.com/archives/public/mono-list/2001-July/000525.html
-//
-// There are also conversion functions that are not defined in
-// the ECMA draft, such as there is no bool ToBoolean(DateTime value),
-// and placing that somewhere won't compile w/ this Convert since the
-// function doesn't exist. However calling that when using Microsoft's
-// System.Convert doesn't produce any compiler errors, it just throws
-// an InvalidCastException at runtime.
-//
-// Whenever a decimal, double, or single is converted to an integer
-// based type, it is even rounded. This uses Math.Round which only
-// has Round(decimal) and Round(double), so in the Convert from
-// single cases the value is passed to Math as a double. This
-// may not be completely necessary.
-//
-// The .NET Framework SDK lists DBNull as a member of this class
-// as 'public static readonly object DBNull;'.
-//
-// It should also be decided if all the cast return values should be
-// returned as unchecked or not.
-//
-// All the XML function comments were auto generated which is why they
-// sound someone redundant.
-//
-// TYPE | BOOL BYTE CHAR DT DEC DBL I16 I32 I64 SBYT SNGL STR UI16 UI32 UI64
-// -----+--------------------------------------------------------------------
-// BOOL | X X X X X X X X X X X X X
-// BYTE | X X X X X X X X X X X X X X
-// CHAR | X X X X X X X X X X
-// DT | X X
-// DEC | X X X X X X X X X X X X X
-// DBL | X X X X X X X X X X X X X
-// I16 | X X X X X X X X X X X X X X
-// I32 | X X X X X X X X X X X X X X
-// I64 | X X X X X X X X X X X X X X
-// SBYT | X X X X X X X X X X X X X X
-// SNGL | X X X X X X X X X X X X X
-// STR | X X X X X X X X X X X X X X X
-// UI16 | X X X X X X X X X X X X X X
-// UI32 | X X X X X X X X X X X X X X
-// UI64 | X X X X X X X X X X X X X X
-//
-
-using System.Globalization;
-using System.Security.Cryptography;
-using System.Text;
-
-namespace System {
-
-// [CLSCompliant(false)]
- public sealed class Convert {
-
- // Fields
- public static readonly object DBNull = System.DBNull.Value;
-
- private Convert () {}
-
- // ========== BASE 64 Conversions ========== //
- // the BASE64 convert methods are using the Base64 converting methods
- // from System.Security.Cryptography.ToBase64Transform and
- // System.Security.Cryptography.FromBase64Transform
- //
- // should be changed to a stand-alone class Base64Encoder & Base64Decoder
-
- public static byte[] FromBase64CharArray(char[] inArray, int offset, int length)
- {
- if (inArray == null)
- throw new ArgumentNullException();
-
- if ((offset < 0) || (length < 0) || (offset + length > inArray.Length))
- throw new ArgumentOutOfRangeException();
-
- if (length < 4 || length % 4 != 0)
- throw new FormatException();
-
- byte[] inArr = new System.Text.UTF8Encoding().GetBytes(inArray, offset, length);
- FromBase64Transform t = new FromBase64Transform();
-
- return t.TransformFinalBlock(inArr, 0, inArr.Length);
- }
-
- public static byte[] FromBase64String(string s)
- {
- if (s == null)
- throw new ArgumentNullException();
-
- char[] inArr = s.ToCharArray();
-
- return FromBase64CharArray(inArr, 0, inArr.Length);
- }
-
- public static TypeCode GetTypeCode (object value)
- {
- if (value == null)
- return TypeCode.Empty;
- else
- return Type.GetTypeCode (value.GetType ());
- }
-
- public static bool IsDBNull (object value)
- {
- if (value is DBNull)
- return true;
- else
- return false;
- }
-
- public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length,
- char[] outArray, int offsetOut)
- {
- if (inArray == null || outArray == null)
- throw new ArgumentNullException();
-
- if (offsetIn < 0 || length < 0 || offsetOut < 0 || (offsetIn + length) > inArray.Length)
- throw new ArgumentOutOfRangeException();
-
- ToBase64Transform t = new ToBase64Transform();
- byte[] outArr = t.TransformFinalBlock(inArray, offsetIn, length);
-
- char[] cOutArr = new System.Text.ASCIIEncoding().GetChars(outArr);
-
- if ((offsetOut + cOutArr.Length) > outArray.Length)
- throw new ArgumentOutOfRangeException();
-
- Array.Copy(cOutArr, 0, outArray, offsetOut, cOutArr.Length);
-
- return cOutArr.Length;
- }
-
- public static string ToBase64String(byte[] inArray)
- {
- if (inArray == null)
- throw new ArgumentNullException();
-
- return ToBase64String(inArray, 0, inArray.Length);
- }
-
- public static string ToBase64String(byte[] inArray, int offset, int length)
- {
- if (inArray == null)
- throw new ArgumentNullException();
-
- if (offset < 0 || length < 0 || (offset + length) > inArray.Length)
- throw new ArgumentOutOfRangeException();
-
- // FIXME: change to stand alone Base64 Encoder class
- ToBase64Transform t = new ToBase64Transform();
- byte[] outArr = t.TransformFinalBlock(inArray, offset, length);
-
- return (new System.Text.ASCIIEncoding().GetString(outArr));
- }
-
- // ========== Boolean Conversions ========== //
-
- public static bool ToBoolean (bool value)
- {
- return value;
- }
-
- public static bool ToBoolean (byte value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (char value)
- {
- throw new InvalidCastException (Locale.GetText ("Can't convert char to bool"));
- }
-
- public static bool ToBoolean (DateTime value)
- {
- throw new InvalidCastException (Locale.GetText ("Can't convert date to bool"));
- }
-
- public static bool ToBoolean (decimal value)
- {
- return (value != 0M);
- }
-
- public static bool ToBoolean (double value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (float value)
- {
- return (value != 0f);
- }
-
- public static bool ToBoolean (int value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (long value)
- {
- return (value != 0);
- }
-
- [CLSCompliant (false)]
- public static bool ToBoolean (sbyte value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (short value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (string value)
- {
- return Boolean.Parse (value);
- }
-
- public static bool ToBoolean (string value, IFormatProvider provider)
- {
- return Boolean.Parse (value); // provider is ignored.
- }
-
- [CLSCompliant (false)]
- public static bool ToBoolean (uint value)
- {
- return (value != 0);
- }
-
- [CLSCompliant (false)]
- public static bool ToBoolean (ulong value)
- {
- return (value != 0);
- }
-
- [CLSCompliant (false)]
- public static bool ToBoolean (ushort value)
- {
- return (value != 0);
- }
-
- public static bool ToBoolean (object value)
- {
- return ToBoolean (value, null);
- }
-
- public static bool ToBoolean (object value, IFormatProvider provider)
- {
- if (value == null)
- return false;
- return ((IConvertible) value).ToBoolean (provider);
- }
-
- // ========== Byte Conversions ========== //
-
- public static byte ToByte (bool value)
- {
- return (byte)(value ? 1 : 0);
- }
-
- public static byte ToByte (byte value)
- {
- return value;
- }
-
- public static byte ToByte (char value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static byte ToByte (decimal value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- // Returned Even-Rounded
- return (byte)(Math.Round (value));
- }
-
- public static byte ToByte (double value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- // This and the float version of ToByte are the only ones
- // the spec listed as checking for .NaN and Infinity overflow
- if (Double.IsNaN(value) || Double.IsInfinity(value))
- throw new OverflowException (Locale.GetText (
- "Value is equal to Double.NaN, Double.PositiveInfinity, or Double.NegativeInfinity"));
-
- // Returned Even-Rounded
- return (byte)(Math.Round (value));
- }
-
- public static byte ToByte (float value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.Minalue"));
-
- // This and the double version of ToByte are the only ones
- // the spec listed as checking for .NaN and Infinity overflow
- if (Single.IsNaN(value) || Single.IsInfinity(value))
- throw new OverflowException (Locale.GetText (
- "Value is equal to Single.NaN, Single.PositiveInfinity, or Single.NegativeInfinity"));
-
- // Returned Even-Rounded, pass it as a double, could have this
- // method just call Convert.ToByte ( (double)value)
- return (byte)(Math.Round ( (double)value));
- }
-
- public static byte ToByte (int value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (long value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- [CLSCompliant (false)]
- public static byte ToByte (sbyte value)
- {
- if (value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (short value)
- {
- if (value > Byte.MaxValue || value < Byte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue or less than Byte.MinValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (string value)
- {
- return Byte.Parse (value);
- }
-
- public static byte ToByte (string value, IFormatProvider provider)
- {
- return Byte.Parse (value, provider);
- }
-
- public static byte ToByte (string value, int fromBase)
- {
-
- int retVal = ConvertFromBase (value, fromBase);
-
- if (retVal < (int) Byte.MinValue || retVal > (int) Byte.MaxValue)
- throw new OverflowException ();
- else
- return (byte) retVal;
- }
-
- [CLSCompliant (false)]
- public static byte ToByte (uint value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- [CLSCompliant (false)]
- public static byte ToByte (ulong value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- [CLSCompliant (false)]
- public static byte ToByte (ushort value)
- {
- if (value > Byte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Byte.MaxValue"));
-
- return (byte)value;
- }
-
- public static byte ToByte (object value)
- {
- return ToByte (value, null);
- }
-
- public static byte ToByte (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToByte (provider);
- }
-
- // ========== Char Conversions ========== //
-
- public static char ToChar (bool value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static char ToChar (byte value)
- {
- return (char)value;
- }
-
- public static char ToChar (char value)
- {
- return value;
- }
-
- public static char ToChar (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static char ToChar (decimal value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static char ToChar (double value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static char ToChar (int value)
- {
- if (value > Char.MaxValue || value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue or less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (long value)
- {
- if (value > Char.MaxValue || value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue or less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (float value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static char ToChar (sbyte value)
- {
- if (value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (short value)
- {
- if (value < Char.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than Char.MinValue"));
-
- return (char)value;
- }
-
- public static char ToChar (string value)
- {
- return Char.Parse (value);
- }
-
- public static char ToChar (string value, IFormatProvider provider)
- {
- return Char.Parse (value); // provider is ignored.
- }
-
- [CLSCompliant (false)]
- public static char ToChar (uint value)
- {
- if (value > Char.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue"));
-
- return (char)value;
- }
-
- [CLSCompliant (false)]
- public static char ToChar (ulong value)
- {
- if (value > Char.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue"));
-
- return (char)value;
- }
-
- [CLSCompliant (false)]
- public static char ToChar (ushort value)
- {
- if (value > Char.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Char.MaxValue"));
-
- return (char)value;
- }
-
- public static char ToChar (object value)
- {
- return ToChar (value, null);
- }
-
- public static char ToChar (object value, IFormatProvider provider)
- {
- if (value == null)
- return (char) 0;
- return ((IConvertible) value).ToChar (provider);
- }
-
- // ========== DateTime Conversions ========== //
-
- public static DateTime ToDateTime (string value)
- {
- return DateTime.Parse (value);
- }
-
- public static DateTime ToDateTime (string value, IFormatProvider provider)
- {
- return DateTime.Parse (value, provider);
- }
-
- public static DateTime ToDateTime (bool value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (byte value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (char value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (DateTime value)
- {
- return value;
- }
-
- public static DateTime ToDateTime (decimal value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (double value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (short value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (int value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (long value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (float value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static DateTime ToDateTime (object value)
- {
- return ToDateTime (value, null);
- }
-
- public static DateTime ToDateTime (object value, IFormatProvider provider)
- {
- if (value == null)
- return DateTime.MinValue;
- return ((IConvertible) value).ToDateTime (provider);
- }
-
- [CLSCompliant (false)]
- public static DateTime ToDateTime (sbyte value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
- [CLSCompliant (false)]
- public static DateTime ToDateTime (ushort value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static DateTime ToDateTime (uint value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static DateTime ToDateTime (ulong value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- // ========== Decimal Conversions ========== //
-
- public static decimal ToDecimal (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static decimal ToDecimal (byte value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (char value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static decimal ToDecimal (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static decimal ToDecimal (decimal value)
- {
- return value;
- }
-
- public static decimal ToDecimal (double value)
- {
- if (value > (double)Decimal.MaxValue || value < (double)Decimal.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Decimal.MaxValue or less than Decimal.MinValue"));
-
- return (decimal)value;
- }
-
- public static decimal ToDecimal (float value)
- {
- return (decimal) value;
- }
-
- public static decimal ToDecimal (int value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (long value)
- {
- return (decimal)value;
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (sbyte value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (short value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (string value)
- {
- return Decimal.Parse (value);
- }
-
- public static decimal ToDecimal (string value, IFormatProvider provider)
- {
- return Decimal.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (uint value)
- {
- return (decimal)value;
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (ulong value)
- {
- return (decimal)value;
- }
-
- [CLSCompliant (false)]
- public static decimal ToDecimal (ushort value)
- {
- return (decimal)value;
- }
-
- public static decimal ToDecimal (object value)
- {
- return ToDecimal (value, null);
- }
-
- public static decimal ToDecimal (object value, IFormatProvider provider)
- {
- if (value == null)
- return new Decimal (0);
- return ((IConvertible) value).ToDecimal (provider);
- }
-
-
- // ========== Double Conversions ========== //
-
- public static double ToDouble (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static double ToDouble (byte value)
- {
- return (double) value;
- }
-
- public static double ToDouble (char value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static double ToDouble (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static double ToDouble (decimal value)
- {
- return (double)value;
- }
-
- public static double ToDouble (double value)
- {
- return value;
- }
-
- public static double ToDouble (float value)
- {
- return (double) value;
- }
-
- public static double ToDouble (int value)
- {
- return (double)value;
- }
-
- public static double ToDouble (long value)
- {
- return (double)value;
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (sbyte value)
- {
- return (double)value;
- }
-
- public static double ToDouble (short value)
- {
- return (double)value;
- }
-
- public static double ToDouble (string value)
- {
- return Double.Parse (value);
- }
-
- public static double ToDouble (string value, IFormatProvider provider)
- {
- return Double.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (uint value)
- {
- return (double)value;
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (ulong value)
- {
- return (double)value;
- }
-
- [CLSCompliant (false)]
- public static double ToDouble (ushort value)
- {
- return (double)value;
- }
-
- public static double ToDouble (object value)
- {
- return ToDouble (value, null);
- }
-
- public static double ToDouble (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0.0;
- return ((IConvertible) value).ToDouble (provider);
- }
-
- // ========== Int16 Conversions ========== //
-
- public static short ToInt16 (bool value)
- {
- return (short)(value ? 1 : 0);
- }
-
- public static short ToInt16 (byte value)
- {
- return (short)value;
- }
-
- public static short ToInt16 (char value)
- {
- if (value > Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
-
- return (short)value;
- }
-
- public static short ToInt16 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static short ToInt16 (decimal value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- // Returned Even-Rounded
- return (short)(Math.Round (value));
- }
-
- public static short ToInt16 (double value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- // Returned Even-Rounded
- return (short)(Math.Round (value));
- }
-
- public static short ToInt16 (float value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- // Returned Even-Rounded, use Math.Round pass as a double.
- return (short)Math.Round ( (double)value);
- }
-
- public static short ToInt16 (int value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- return (short)value;
- }
-
- public static short ToInt16 (long value)
- {
- if (value > Int16.MaxValue || value < Int16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue or less than Int16.MinValue"));
-
- return (short)value;
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (sbyte value)
- {
- return (short)value;
- }
-
- public static short ToInt16 (short value)
- {
- return value;
- }
-
- public static short ToInt16 (string value)
- {
- return Int16.Parse (value);
- }
-
- public static short ToInt16 (string value, IFormatProvider provider)
- {
- return Int16.Parse (value, provider);
- }
-
-
- public static short ToInt16 (string value, int fromBase)
- {
- return Convert.ToInt16 (ConvertFromBase (value, fromBase));
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (uint value)
- {
- if (value > Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
-
- return (short)value;
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (ulong value)
- {
- if (value > (ulong)Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
- return (short)value;
- }
-
- [CLSCompliant (false)]
- public static short ToInt16 (ushort value)
- {
- if (value > Int16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int16.MaxValue"));
-
- return (short)value;
- }
-
- public static short ToInt16 (object value)
- {
- return ToInt16 (value, null);
- }
-
- public static short ToInt16 (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToInt16 (provider);
- }
-
- // ========== Int32 Conversions ========== //
-
- public static int ToInt32 (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static int ToInt32 (byte value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (char value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static int ToInt32 (decimal value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- // Returned Even-Rounded
- return (int)(Math.Round (value));
- }
-
- public static int ToInt32 (double value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- // Returned Even-Rounded
- return (int)(Math.Round (value));
- }
-
- public static int ToInt32 (float value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- // Returned Even-Rounded, pass as a double, could just call
- // Convert.ToInt32 ( (double)value);
- return (int)(Math.Round ( (double)value));
- }
-
- public static int ToInt32 (int value)
- {
- return value;
- }
-
- public static int ToInt32 (long value)
- {
- if (value > Int32.MaxValue || value < Int32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue or less than Int32.MinValue"));
-
- return (int)value;
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (sbyte value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (short value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (string value)
- {
- return Int32.Parse (value);
- }
-
- public static int ToInt32 (string value, IFormatProvider provider)
- {
- return Int32.Parse (value, provider);
- }
-
-
- public static int ToInt32 (string value, int fromBase)
- {
- return ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (uint value)
- {
- if (value > Int32.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue"));
-
- return (int)value;
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (ulong value)
- {
- if (value > Int32.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int32.MaxValue"));
-
- return (int)value;
- }
-
- [CLSCompliant (false)]
- public static int ToInt32 (ushort value)
- {
- return (int)value;
- }
-
- public static int ToInt32 (object value)
- {
- return ToInt32 (value, null);
- }
-
- public static int ToInt32 (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToInt32 (provider);
- }
-
- // ========== Int64 Conversions ========== //
-
- public static long ToInt64 (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static long ToInt64 (byte value)
- {
- return (long)(ulong)value;
- }
-
- public static long ToInt64 (char value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static long ToInt64 (decimal value)
- {
- if (value > Int64.MaxValue || value < Int64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue or less than Int64.MinValue"));
-
- // Returned Even-Rounded
- return (long)(Math.Round (value));
- }
-
- public static long ToInt64 (double value)
- {
- if (value > Int64.MaxValue || value < Int64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue or less than Int64.MinValue"));
-
- // Returned Even-Rounded
- return (long)(Math.Round (value));
- }
-
- public static long ToInt64 (float value)
- {
- if (value > Int64.MaxValue || value < Int64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue or less than Int64.MinValue"));
-
- // Returned Even-Rounded, pass to Math as a double, could
- // just call Convert.ToInt64 ( (double)value);
- return (long)(Math.Round ( (double)value));
- }
-
- public static long ToInt64 (int value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (long value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (sbyte value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (short value)
- {
- return (long)value;
- }
-
- public static long ToInt64 (string value)
- {
- return Int64.Parse (value);
- }
-
- public static long ToInt64 (string value, IFormatProvider provider)
- {
- return Int64.Parse (value, provider);
- }
-
- public static long ToInt64 (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- return ConvertFromBase64 (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (uint value)
- {
- return (long)(ulong)value;
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (ulong value)
- {
- if (value > Int64.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Int64.MaxValue"));
-
- return (long)value;
- }
-
- [CLSCompliant (false)]
- public static long ToInt64 (ushort value)
- {
- return (long)(ulong)value;
- }
-
- public static long ToInt64 (object value)
- {
- return ToInt64 (value, null);
- }
-
- public static long ToInt64 (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToInt64 (provider);
- }
-
- // ========== SByte Conversions ========== //
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (bool value)
- {
- return (sbyte)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (byte value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (char value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (decimal value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- // Returned Even-Rounded
- return (sbyte)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (double value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- // Returned Even-Rounded
- return (sbyte)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (float value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.Minalue"));
-
- // Returned Even-Rounded, pass as double to Math
- return (sbyte)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (int value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (long value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (sbyte value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (short value)
- {
- if (value > SByte.MaxValue || value < SByte.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue or less than SByte.MinValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (string value)
- {
- return SByte.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (string value, IFormatProvider provider)
- {
- return SByte.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (string value, int fromBase)
- {
- int retVal = ConvertFromBase (value, fromBase);
-
- if (retVal == 255)
- return (sbyte)-1;
-
- if (retVal < (int) SByte.MinValue || retVal > (int) SByte.MaxValue)
- throw new OverflowException ();
- else
- return (sbyte) retVal;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (uint value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (ulong value)
- {
- if (value > (ulong)SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (ushort value)
- {
- if (value > SByte.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than SByte.MaxValue"));
-
- return (sbyte)value;
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (object value)
- {
- return ToSByte (value, null);
- }
-
- [CLSCompliant (false)]
- public static sbyte ToSByte (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToSByte (provider);
- }
-
- // ========== Single Conversions ========== //
-
- public static float ToSingle (bool value)
- {
- return value ? 1 : 0;
- }
-
- public static float ToSingle (byte value)
- {
- return (float)value;
- }
-
- public static float ToSingle (Char value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static float ToSingle (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- public static float ToSingle (decimal value)
- {
- return (float)value;
- }
-
- public static float ToSingle (double value)
- {
- if (value > Single.MaxValue || value < Single.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than Single.MaxValue or less than Single.MinValue"));
-
- return (float)value;
- }
-
- public static float ToSingle (float value)
- {
- return value;
- }
-
- public static float ToSingle (int value)
- {
- return (float)value;
- }
-
- public static float ToSingle (long value)
- {
- return (float)value;
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (sbyte value)
- {
- return (float)value;
- }
-
- public static float ToSingle (short value)
- {
- return (float)value;
- }
-
- public static float ToSingle (string value)
- {
- return Single.Parse (value);
- }
-
- public static float ToSingle (string value, IFormatProvider provider)
- {
- return Single.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (uint value)
- {
- return (float)value;
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (ulong value)
- {
- return (float)value;
- }
-
- [CLSCompliant (false)]
- public static float ToSingle (ushort value)
- {
- return (float)value;
- }
-
- public static float ToSingle (object value)
- {
- return ToSingle (value, null);
- }
-
-// [CLSCompliant (false)]
- public static float ToSingle (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToSingle (provider);
- }
-
- // ========== String Conversions ========== //
-
- public static string ToString (bool value)
- {
- return value.ToString ();
- }
-
- public static string ToString (bool value, IFormatProvider provider)
- {
- return value.ToString (); // the same as ToString (bool).
- }
-
- public static string ToString (byte value)
- {
- return value.ToString ();
- }
-
- public static string ToString (byte value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (byte value, int toBase)
- {
- if (NotValidBase (toBase))
- throw new ArgumentException ("toBase is not valid.");
-
- return ConvertToBase ((int) value, toBase);
- }
-
- public static string ToString (char value)
- {
- return value.ToString ();
- }
-
- public static string ToString (char value, IFormatProvider provider)
- {
- return value.ToString (); // the same as ToString (char)
- }
-
- public static string ToString (DateTime value)
- {
- return value.ToString ();
- }
-
- public static string ToString (DateTime value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (decimal value)
- {
- return value.ToString ();
- }
-
- public static string ToString (decimal value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (double value)
- {
- return value.ToString ();
- }
-
- public static string ToString (double value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (float value)
- {
- return value.ToString ();
- }
-
- public static string ToString (float value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (int value)
- {
- return value.ToString ();
- }
-
- public static string ToString (int value, int toBase)
- {
- if (NotValidBase (toBase))
- throw new ArgumentException ("toBase is not valid.");
-
- return ConvertToBase ((int) value, toBase);
- }
-
- public static string ToString (int value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (long value)
- {
- return value.ToString ();
- }
-
- public static string ToString (long value, int toBase)
- {
- if (NotValidBase (toBase))
- throw new ArgumentException ("toBase is not valid.");
-
- return ConvertToBase (value, toBase);
- }
-
- public static string ToString (long value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (object value)
- {
- return ToString (value, null);
- }
-
- public static string ToString (object value, IFormatProvider provider)
- {
- if (value is IConvertible)
- return ((IConvertible) value).ToString (provider);
- else if (value != null)
- return value.ToString ();
- return String.Empty;
- }
-
- [CLSCompliant (false)]
- public static string ToString (sbyte value)
- {
- return value.ToString ();
- }
-
- [CLSCompliant (false)]
- public static string ToString (sbyte value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (short value)
- {
- return value.ToString ();
- }
-
- public static string ToString (short value, int toBase)
- {
- if (NotValidBase (toBase))
- throw new ArgumentException ("toBase is not valid.");
-
- return ConvertToBase ((int) value, toBase);
- }
-
- public static string ToString (short value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- public static string ToString (string value)
- {
- return value;
- }
-
- public static string ToString (string value, IFormatProvider provider)
- {
- return value; // provider is ignored.
- }
-
- [CLSCompliant (false)]
- public static string ToString (uint value)
- {
- return value.ToString ();
- }
-
- [CLSCompliant (false)]
- public static string ToString (uint value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- [CLSCompliant (false)]
- public static string ToString (ulong value)
- {
- return value.ToString ();
- }
-
- [CLSCompliant (false)]
- public static string ToString (ulong value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- [CLSCompliant (false)]
- public static string ToString (ushort value)
- {
- return value.ToString ();
- }
-
- [CLSCompliant (false)]
- public static string ToString (ushort value, IFormatProvider provider)
- {
- return value.ToString (provider);
- }
-
- // ========== UInt16 Conversions ========== //
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (bool value)
- {
- return (ushort)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (byte value)
- {
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (char value)
- {
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (decimal value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- // Returned Even-Rounded
- return (ushort)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (double value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- // Returned Even-Rounded
- return (ushort)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (float value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- // Returned Even-Rounded, pass as double to Math
- return (ushort)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (int value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (long value)
- {
- if (value > UInt16.MaxValue || value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue or less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (sbyte value)
- {
- if (value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (short value)
- {
- if (value < UInt16.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt16.MinValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (string value)
- {
- return UInt16.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (string value, IFormatProvider provider)
- {
- return UInt16.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (string value, int fromBase)
- {
- return (ushort) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (uint value)
- {
- if (value > UInt16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (ulong value)
- {
- if (value > (ulong)UInt16.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt16.MaxValue"));
-
- return (ushort)value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (ushort value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (object value)
- {
- return ToUInt16 (value, null);
- }
-
- [CLSCompliant (false)]
- public static ushort ToUInt16 (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToUInt16 (provider);
- }
-
- // ========== UInt32 Conversions ========== //
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (bool value)
- {
- return (uint)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (byte value)
- {
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (char value)
- {
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (DateTime value)
- {
- throw new InvalidCastException ("This conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (decimal value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- // Returned Even-Rounded
- return (uint)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (double value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- // Returned Even-Rounded
- return (uint)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (float value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- // Returned Even-Rounded, pass as double to Math
- return (uint)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (int value)
- {
- if (value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (long value)
- {
- if (value > UInt32.MaxValue || value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue or less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (sbyte value)
- {
- if (value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (short value)
- {
- if (value < UInt32.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt32.MinValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (string value)
- {
- return UInt32.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (string value, IFormatProvider provider)
- {
- return UInt32.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (string value, int fromBase)
- {
- return (uint) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (uint value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (ulong value)
- {
- if (value > UInt32.MaxValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt32.MaxValue"));
-
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (ushort value)
- {
- return (uint)value;
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (object value)
- {
- return ToUInt32 (value, null);
- }
-
- [CLSCompliant (false)]
- public static uint ToUInt32 (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToUInt32 (provider);
- }
-
-
- // ========== UInt64 Conversions ========== //
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (bool value)
- {
- return (ulong)(value ? 1 : 0);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (byte value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (char value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (DateTime value)
- {
- throw new InvalidCastException ("The conversion is not supported.");
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (decimal value)
- {
- if (value > UInt64.MaxValue || value < UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt64.MaxValue or less than UInt64.MinValue"));
-
- // Returned Even-Rounded
- return (ulong)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (double value)
- {
- if (value > UInt64.MaxValue || value < UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt64.MaxValue or less than UInt64.MinValue"));
-
- // Returned Even-Rounded
- return (ulong)(Math.Round (value));
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (float value)
- {
- if (value > UInt64.MaxValue || value < UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is greater than UInt64.MaxValue or less than UInt64.MinValue"));
-
- // Returned Even-Rounded, pass as a double to Math
- return (ulong)(Math.Round ( (double)value));
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (int value)
- {
- if (value < (int)UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt64.MinValue"));
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (long value)
- {
- if (value < (long)UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt64.MinValue"));
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (sbyte value)
- {
- if (value < (sbyte)UInt64.MinValue)
- throw new OverflowException
- ("Value is less than UInt64.MinValue");
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (short value)
- {
- if (value < (short)UInt64.MinValue)
- throw new OverflowException (Locale.GetText (
- "Value is less than UInt64.MinValue"));
-
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (string value)
- {
- return UInt64.Parse (value);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (string value, IFormatProvider provider)
- {
- return UInt64.Parse (value, provider);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (string value, int fromBase)
- {
- return (ulong) ConvertFromBase (value, fromBase);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (uint value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (ulong value)
- {
- return value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (ushort value)
- {
- return (ulong)value;
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (object value)
- {
- return ToUInt64 (value, null);
- }
-
- [CLSCompliant (false)]
- public static ulong ToUInt64 (object value, IFormatProvider provider)
- {
- if (value == null)
- return 0;
- return ((IConvertible) value).ToUInt64 (provider);
- }
-
-
- // ========== Conversion / Helper Functions ========== //
-
- public static object ChangeType (object value, Type conversionType)
- {
- CultureInfo ci = CultureInfo.CurrentCulture;
- NumberFormatInfo number = ci.NumberFormat;
- return ToType (value, conversionType, number);
- }
-
- public static object ChangeType (object value, TypeCode typeCode)
- {
- CultureInfo ci = CultureInfo.CurrentCulture;
- Type conversionType = conversionTable [(int)typeCode];
- NumberFormatInfo number = ci.NumberFormat;
- return ToType (value, conversionType, number);
- }
-
- public static object ChangeType (object value, Type conversionType, IFormatProvider provider)
- {
- return ToType (value, conversionType, provider);
- }
-
- public static object ChangeType (object value, TypeCode typeCode, IFormatProvider provider)
- {
- Type conversionType = conversionTable [(int)typeCode];
- return ToType (value, conversionType, provider);
- }
-
- private static bool NotValidBase (int value)
- {
- if ((value == 2) || (value == 8) ||
- (value == 10) || (value == 16))
- return false;
-
- return true;
- }
-
- private static int ConvertFromBase (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- int chars = 0;
- int result = 0;
- int digitValue;
-
- foreach (char c in value) {
- if (Char.IsNumber (c))
- digitValue = c - '0';
- else if (Char.IsLetter (c))
- digitValue = Char.ToLower(c) - 'a' + 10;
- else
- throw new FormatException ("This is an invalid string: " + value);
-
- if (digitValue >= fromBase)
- throw new FormatException ("the digits are invalid.");
-
- result = (fromBase) * result + digitValue;
- chars ++;
- }
-
- if (chars == 0)
- throw new FormatException ("Could not find any digits.");
-
- if (result > Int32.MaxValue || result < Int32.MinValue)
- throw new OverflowException ("There is an overflow.");
-
- return result;
- }
-
- private static long ConvertFromBase64 (string value, int fromBase)
- {
- if (NotValidBase (fromBase))
- throw new ArgumentException ("fromBase is not valid.");
-
- int chars = 0;
- int digitValue;
- long result = 0;
-
- foreach (char c in value) {
- if (Char.IsNumber (c))
- digitValue = c - '0';
- else if (Char.IsLetter (c))
- digitValue = Char.ToLower(c) - 'a' + 10;
- else
- throw new FormatException ("This is an invalid string: " + value);
-
- if (digitValue >= fromBase)
- throw new FormatException ("the digits are invalid.");
-
- result = (fromBase) * result + digitValue;
- chars ++;
- }
-
- if (chars == 0)
- throw new FormatException ("Could not find any digits.");
-
- if (result > Int64.MaxValue || result < Int64.MinValue)
- throw new OverflowException ("There is an overflow.");
-
- return result;
- }
-
- private static string ConvertToBase (int value, int toBase)
- {
- StringBuilder sb = new StringBuilder ();
- BuildConvertedString (sb, value, toBase);
- return sb.ToString ();
- }
-
- private static string ConvertToBase (long value, int toBase)
- {
- StringBuilder sb = new StringBuilder ();
- BuildConvertedString64 (sb, value, toBase);
- return sb.ToString ();
- }
-
-
- internal static void BuildConvertedString (StringBuilder sb, int value, int toBase)
- {
- int divided = value / toBase;
- int reminder = value % toBase;
-
- if (divided > 0)
- BuildConvertedString (sb, divided, toBase);
-
- if (reminder >= 10)
- sb.Append ((char) (reminder + 'a' - 10));
- else
- sb.Append ((char) (reminder + '0'));
- }
-
- internal static void BuildConvertedString64 (StringBuilder sb, long value, int toBase)
- {
- long divided = value / toBase;
- long reminder = value % toBase;
-
- if (divided > 0)
- BuildConvertedString64 (sb, divided, toBase);
-
- if (reminder >= 10)
- sb.Append ((char) (reminder + 'a' - 10));
- else
- sb.Append ((char) (reminder + '0'));
- }
-
- // Lookup table for the conversion ToType method. Order
- // is important! Used by ToType for comparing the target
- // type, and uses hardcoded array indexes.
- private static Type[] conversionTable = {
- // Valid ICovnertible Types
- null, // 0 empty
- typeof (object), // 1 TypeCode.Object
- typeof (DBNull), // 2 TypeCode.DBNull
- typeof (Boolean), // 3 TypeCode.Boolean
- typeof (Char), // 4 TypeCode.Char
- typeof (SByte), // 5 TypeCode.SByte
- typeof (Byte), // 6 TypeCode.Byte
- typeof (Int16), // 7 TypeCode.Int16
- typeof (UInt16), // 8 TypeCode.UInt16
- typeof (Int32), // 9 TypeCode.Int32
- typeof (UInt32), // 10 TypeCode.UInt32
- typeof (Int64), // 11 TypeCode.Int64
- typeof (UInt64), // 12 TypeCode.UInt64
- typeof (Single), // 13 TypeCode.Single
- typeof (Double), // 14 TypeCode.Double
- typeof (Decimal), // 15 TypeCode.Decimal
- typeof (DateTime), // 16 TypeCode.DateTime
- null, // 17 null.
- typeof (String), // 18 TypeCode.String
- };
-
- // Function to convert an object to another type and return
- // it as an object. In place for the core data types to use
- // when implementing IConvertible. Uses hardcoded indexes in
- // the conversionTypes array, so if modify carefully.
- internal static object ToType (object value, Type conversionType,
- IFormatProvider provider)
- {
- if (value == null && conversionType == null)
- return null;
-
- if (value == null)
- throw new NullReferenceException ("Value is null.");
-
- if (value is IConvertible) {
- IConvertible convertValue = (IConvertible) value;
-
- if (conversionType == conversionTable[0]) // 0 Empty
- throw new ArgumentNullException ();
-
- else if (conversionType == conversionTable[1]) // 1 TypeCode.Object
- return (object) value;
-
- else if (conversionType == conversionTable[2]) // 2 TypeCode.DBNull
- throw new InvalidCastException (); // It's not IConvertible
-
- else if (conversionType == conversionTable[3]) // 3 TypeCode.Boolean
- return (object) convertValue.ToBoolean (provider);
-
- else if (conversionType == conversionTable[4]) // 4 TypeCode.Char
- return (object) convertValue.ToChar (provider);
-
- else if (conversionType == conversionTable[5]) // 5 TypeCode.SByte
- return (object) convertValue.ToSByte (provider);
-
- else if (conversionType == conversionTable[6]) // 6 TypeCode.Byte
- return (object) convertValue.ToByte (provider);
-
- else if (conversionType == conversionTable[7]) // 7 TypeCode.Int16
- return (object) convertValue.ToInt16 (provider);
-
- else if (conversionType == conversionTable[8]) // 8 TypeCode.UInt16
- return (object) convertValue.ToUInt16 (provider);
-
- else if (conversionType == conversionTable[9]) // 9 TypeCode.Int32
- return (object) convertValue.ToInt32 (provider);
-
- else if (conversionType == conversionTable[10]) // 10 TypeCode.UInt32
- return (object) convertValue.ToUInt32 (provider);
-
- else if (conversionType == conversionTable[11]) // 11 TypeCode.Int64
- return (object) convertValue.ToInt64 (provider);
-
- else if (conversionType == conversionTable[12]) // 12 TypeCode.UInt64
- return (object) convertValue.ToUInt64 (provider);
-
- else if (conversionType == conversionTable[13]) // 13 TypeCode.Single
- return (object) convertValue.ToSingle (provider);
-
- else if (conversionType == conversionTable[14]) // 14 TypeCode.Double
- return (object) convertValue.ToDouble (provider);
-
- else if (conversionType == conversionTable[15]) // 15 TypeCode.Decimal
- return (object) convertValue.ToDecimal (provider);
-
- else if (conversionType == conversionTable[16]) // 16 TypeCode.DateTime
- return (object) convertValue.ToDateTime (provider);
-
- else if (conversionType == conversionTable[18]) // 18 TypeCode.String
- return (object) convertValue.ToString (provider);
- else
- throw new ArgumentException (Locale.GetText ("Unknown target conversion type"));
- } else
- // Not in the conversion table
- throw new InvalidCastException ((Locale.GetText (
- "Value is not a convertible object: " + value.GetType().ToString() + " to " + conversionType.FullName)));
- }
- }
-}
diff --git a/mcs/class/corlib/System/CrossAppDomainDelegate.cs b/mcs/class/corlib/System/CrossAppDomainDelegate.cs
deleted file mode 100755
index d8cded40afa..00000000000
--- a/mcs/class/corlib/System/CrossAppDomainDelegate.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.CrossAppDomainDelegate.cs
-//
-// Paolo Molaro
-//
-// (C) 2002 Ximian, Inc.
-
-namespace System
-{
- public delegate void CrossAppDomainDelegate ();
-}
diff --git a/mcs/class/corlib/System/DBNull.cs b/mcs/class/corlib/System/DBNull.cs
deleted file mode 100644
index f1a98085350..00000000000
--- a/mcs/class/corlib/System/DBNull.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// System.DBNull.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public sealed class DBNull : ISerializable, IConvertible
- {
- // Fields
- public static readonly DBNull Value = new DBNull ();
-
- // Private constructor
- private DBNull () {}
-
- // Methods
- [MonoTODO]
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- }
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.DBNull;
- }
-
- [MonoTODO]
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return false;
- }
-
- [MonoTODO]
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return Byte.MinValue;
- }
-
- [MonoTODO]
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return Char.MinValue;
- }
-
- [MonoTODO]
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return DateTime.MinValue;
- }
-
- [MonoTODO]
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return Decimal.MinValue;
- }
-
- [MonoTODO]
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return Double.MinValue;
- }
-
- [MonoTODO]
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return Int16.MinValue;
- }
-
- [MonoTODO]
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return Int32.MinValue;
- }
-
- [MonoTODO]
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return Int64.MinValue;
- }
-
- [MonoTODO]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return SByte.MinValue;
- }
-
- [MonoTODO]
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return Single.MinValue;
- }
-
- [MonoTODO]
- object IConvertible.ToType (Type type, IFormatProvider provider)
- {
- return null;
- }
-
- [MonoTODO]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return UInt16.MinValue;
- }
-
- [MonoTODO]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return UInt32.MinValue;
- }
-
- [MonoTODO]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return UInt64.MinValue;
- }
-
- public override string ToString ()
- {
- return String.Empty;
- }
-
- public string ToString (IFormatProvider provider)
- {
- return String.Empty;
- }
- }
-}
diff --git a/mcs/class/corlib/System/DateTime.cs b/mcs/class/corlib/System/DateTime.cs
deleted file mode 100644
index acc1f5ed39d..00000000000
--- a/mcs/class/corlib/System/DateTime.cs
+++ /dev/null
@@ -1,1463 +0,0 @@
-//
-// System.DateTime.cs
-//
-// author:
-// Marcel Narings (marcel@narings.nl)
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2001 Marcel Narings
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-
-namespace System
-{
- /// <summary>
- /// The DateTime structure represents dates and time ranging from
- /// 1-1-0001 12:00:00 AM to 31-12-9999 23:59:00 Common Era.
- /// </summary>
- ///
- [Serializable]
- public struct DateTime : IComparable , IFormattable , IConvertible
- {
- private TimeSpan ticks;
-
- private const int dp400 = 146097;
- private const int dp100 = 36524;
- private const int dp4 = 1461;
-
- // w32 file time starts counting from 1/1/1601 00:00 GMT
- // which is the constant ticks from the .NET epoch
- private const long w32file_epoch = 504911232000000000L;
-
- //
- // The UnixEpoch, it begins on Jan 1, 1970 at 0:0:0, expressed
- // in Ticks
- //
- internal const long UnixEpoch = 621355968000000000L;
-
- public static readonly DateTime MaxValue = new DateTime (false,TimeSpan.MaxValue);
- public static readonly DateTime MinValue = new DateTime (false,TimeSpan.MinValue);
-
- private enum Which
- {
- Day,
- DayYear,
- Month,
- Year
- };
-
- private static int[] daysmonth = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
- private static int[] daysmonthleap = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
- private static int AbsoluteDays (int year, int month, int day)
- {
- int[] days;
- int temp = 0, m=1 ;
-
- days = (IsLeapYear(year) ? daysmonthleap : daysmonth);
-
- while (m < month)
- temp += days[m++];
- return ((day-1) + temp + (365* (year-1)) + ((year-1)/4) - ((year-1)/100) + ((year-1)/400));
- }
-
- private int FromTicks(Which what)
- {
- int num400, num100, num4, numyears;
- int M =1;
-
- int[] days = daysmonth;
- int totaldays = this.ticks.Days;
-
- num400 = (totaldays / dp400);
- totaldays -= num400 * dp400;
-
- num100 = (totaldays / dp100);
- if (num100 == 4) // leap
- num100 = 3;
- totaldays -= (num100 * dp100);
-
- num4 = totaldays / dp4;
- totaldays -= (num4 * dp4);
-
- numyears = totaldays / 365 ;
-
- if (numyears == 4) //leap
- numyears =3 ;
- if (what == Which.Year )
- return num400*400 + num100*100 + num4*4 + numyears + 1;
-
- totaldays -= (numyears * 365) ;
- if (what == Which.DayYear )
- return totaldays + 1;
-
- if ((numyears==3) && ((num100 == 3) || !(num4 == 24)) ) //31 dec leapyear
- days = daysmonthleap;
-
- while (totaldays >= days[M])
- totaldays -= days[M++];
-
- if (what == Which.Month )
- return M;
-
- return totaldays +1;
- }
-
-
- // Constructors
-
- /// <summary>
- /// Constructs a DateTime for specified ticks
- /// </summary>
- ///
- public DateTime (long newticks)
- // `local' must default to false here to avoid
- // a recursion loop.
- : this (false, newticks) {}
-
- internal DateTime (bool local, long newticks)
- : this (true, new TimeSpan (newticks))
- {
- if (local) {
- TimeZone tz = TimeZone.CurrentTimeZone;
-
- TimeSpan utcoffset = tz.GetUtcOffset (this);
-
- ticks = ticks + utcoffset;
- }
- }
-
- public DateTime (int year, int month, int day)
- : this (year, month, day,0,0,0,0) {}
-
- public DateTime (int year, int month, int day, int hour, int minute, int second)
- : this (year, month, day, hour, minute, second, 0) {}
-
- public DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond)
- {
- if ( year < 1 || year > 9999 ||
- month < 1 || month >12 ||
- day < 1 || day > DaysInMonth(year, month) ||
- hour < 0 || hour > 23 ||
- minute < 0 || minute > 59 ||
- second < 0 || second > 59 )
- throw new ArgumentOutOfRangeException() ;
-
- ticks = new TimeSpan (AbsoluteDays(year,month,day), hour, minute, second, millisecond);
- }
-
- public DateTime (int year, int month, int day, Calendar calendar)
- : this (year, month, day, 0, 0, 0, 0, calendar) {}
-
-
- public DateTime (int year, int month, int day, int hour, int minute, int second, Calendar calendar)
- : this (year, month, day, hour, minute, second, 0, calendar) {}
-
-
- public DateTime (int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar)
- : this (year, month, day, hour, minute, second, millisecond)
- {
- if (calendar == null)
- throw new ArgumentNullException();
- }
-
- internal DateTime (bool check, TimeSpan value)
- {
- if (check && (value.Ticks < MinValue.Ticks || value.Ticks > MaxValue.Ticks))
- throw new ArgumentOutOfRangeException ();
-
- ticks = value;
- }
-
- /* Properties */
-
- public DateTime Date
- {
- get
- {
- return new DateTime (Year, Month, Day);
- }
- }
-
- public int Month
- {
- get
- {
- return FromTicks(Which.Month);
- }
- }
-
-
- public int Day
- {
- get
- {
- return FromTicks(Which.Day);
- }
- }
-
- public DayOfWeek DayOfWeek
- {
- get
- {
- return ( (DayOfWeek) ((ticks.Days+1) % 7) );
- }
- }
-
- public int DayOfYear
- {
- get
- {
- return FromTicks(Which.DayYear);
- }
- }
-
- public TimeSpan TimeOfDay
- {
- get
- {
- return new TimeSpan(ticks.Ticks % TimeSpan.TicksPerDay );
- }
-
- }
-
- public int Hour
- {
- get
- {
- return ticks.Hours;
- }
- }
-
- public int Minute
- {
- get
- {
- return ticks.Minutes;
- }
- }
-
- public int Second
- {
- get
- {
- return ticks.Seconds;
- }
- }
-
- public int Millisecond
- {
- get
- {
- return ticks.Milliseconds;
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern long GetNow ();
-
- public static DateTime Now
- {
- get
- {
- return new DateTime (true, GetNow ());
- }
- }
-
- public long Ticks
- {
- get
- {
- return ticks.Ticks;
- }
- }
-
- public static DateTime Today
- {
- get
- {
- return new DateTime (false, (GetNow () / TimeSpan.TicksPerDay) * TimeSpan.TicksPerDay);
- }
- }
-
- public static DateTime UtcNow
- {
- get {
- return new DateTime (GetNow ());
- }
- }
-
- public int Year
- {
- get
- {
- return FromTicks(Which.Year);
- }
- }
-
- /* methods */
-
- public DateTime Add (TimeSpan ts)
- {
- return new DateTime (true, ticks) + ts;
- }
-
- public DateTime AddDays (double days)
- {
- return AddMilliseconds (days * 86400000);
- }
-
- public DateTime AddTicks (long t)
- {
- return Add (new TimeSpan (t));
- }
-
- public DateTime AddHours (double hours)
- {
- return AddMilliseconds (hours * 3600000);
- }
-
- public DateTime AddMilliseconds (double ms)
- {
- long msticks;
-
- msticks = (long) (ms += ms > 0 ? 0.5 : -0.5) * TimeSpan.TicksPerMillisecond ;
-
- return AddTicks (msticks);
- }
-
- public DateTime AddMinutes (double minutes)
- {
- return AddMilliseconds (minutes * 60000);
- }
-
- public DateTime AddMonths (int months)
- {
- int day, month, year, maxday ;
- DateTime temp ;
-
- day = this.Day;
- month = this.Month + (months % 12);
- year = this.Year + months/12 ;
-
- if (month < 1)
- {
- month = 12 + month ;
- year -- ;
- }
- else if (month>12)
- {
- month = month -12;
- year ++;
- }
- maxday = DaysInMonth(year, month);
- if (day > maxday)
- day = maxday;
-
- temp = new DateTime (year, month, day);
- return temp.Add (this.TimeOfDay);
- }
-
- public DateTime AddSeconds (double seconds)
- {
- return AddMilliseconds (seconds*1000);
- }
-
- public DateTime AddYears (int years )
- {
- return AddMonths(years * 12);
- }
-
- public static int Compare (DateTime t1, DateTime t2)
- {
- if (t1.ticks < t2.ticks)
- return -1;
- else if (t1.ticks > t2.ticks)
- return 1;
- else
- return 0;
- }
-
- public int CompareTo (object v)
- {
- if ( v == null)
- return 1;
-
- if (!(v is System.DateTime))
- throw new ArgumentException (Locale.GetText (
- "Value is not a System.DateTime"));
-
- return Compare (this, (DateTime) v);
- }
-
- public static int DaysInMonth (int year, int month)
- {
- int[] days ;
-
- if (month < 1 || month >12)
- throw new ArgumentOutOfRangeException ();
-
- days = (IsLeapYear(year) ? daysmonthleap : daysmonth);
- return days[month];
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.DateTime))
- return false;
-
- return ((DateTime) o).ticks == ticks;
- }
-
- public static bool Equals (DateTime t1, DateTime t2 )
- {
- return (t1.ticks == t2.ticks );
- }
-
- public static DateTime FromFileTime (long fileTime)
- {
- return new DateTime (w32file_epoch + fileTime);
- }
-
- // TODO: Implement me.
- [MonoTODO]
- public static DateTime FromOADate (double d)
- {
- return new DateTime(0);
- }
-
- // TODO: Implement me.
- [MonoTODO]
- public string[] GetDateTimeFormats()
- {
- return null;
- }
-
- //TODO: implement me
- [MonoTODO]
- public string[] GetDateTimeFormats(char format)
- {
- return null;
- }
-
- // TODO: implement me
- [MonoTODO]
- public string[] GetDateTimeFormats(IFormatProvider provider)
- {
- return null;
- }
-
- //TODO: implement me
- [MonoTODO]
- public string[] GetDateTimeFormats(char format,IFormatProvider provider )
- {
- return null;
- }
-
- public override int GetHashCode ()
- {
- return (int) ticks.Ticks;
- }
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.DateTime;
- }
-
- public static bool IsLeapYear (int year)
- {
- return ( (year % 4 == 0 && year % 100 != 0) || year % 400 == 0) ;
- }
-
- public static DateTime Parse (string s)
- {
- return Parse (s, null);
- }
-
- public static DateTime Parse (string s, IFormatProvider fp)
- {
- return Parse (s, null, DateTimeStyles.AllowWhiteSpaces);
- }
-
- public static DateTime Parse (string s, IFormatProvider fp, DateTimeStyles styles)
- {
- string[] formats = {
- // Full date and time
- "F", "G", "r", "s", "u", "U",
- // Full date and time, but no seconds
- "f", "g",
- // Only date
- "d", "D",
- // Only time
- "T", "t",
- // Only date, but no year
- "m",
- // Only date, but no day
- "y"
- };
-
- return ParseExact (s, formats, fp, styles);
- }
-
- public static DateTime ParseExact (string s, string format, IFormatProvider fp)
- {
- return ParseExact (s, format, fp, DateTimeStyles.None);
- }
-
- internal static int _ParseNumber (string s, int digits, bool leadingzero,
- bool sloppy_parsing, out int num_parsed)
- {
- int number = 0, i;
-
- if (sloppy_parsing)
- leadingzero = false;
-
- if (!leadingzero) {
- int real_digits = 0;
- for (i = 0; i < digits; i++) {
- if ((i >= s.Length) || !Char.IsDigit (s[i]))
- break;
-
- real_digits++;
- }
-
- digits = real_digits;
- }
-
- if (s.Length < digits) {
- num_parsed = -1;
- return 0;
- }
-
- for (i = 0; i < digits; i++) {
- char c = s[i];
- if (!Char.IsDigit (c)) {
- num_parsed = -1;
- return 0;
- }
-
- number = number * 10 + (byte) (c - '0');
- }
-
- num_parsed = digits;
- return number;
- }
-
- internal static int _ParseEnum (string s, string[] values, out int num_parsed)
- {
- int i;
-
- for (i = 0; i < values.Length; i++) {
- if (s.Length < values[i].Length)
- continue;
- String tmp = s.Substring (0, values[i].Length);
- if (String.Compare (tmp, values[i], true) == 0) {
- num_parsed = values[i].Length;
- return i;
- }
- }
-
- num_parsed = -1;
- return -1;
- }
-
- internal static bool _ParseString (string s, int maxlength, string value, out int num_parsed)
- {
- if (maxlength > 0)
- value = value.Substring (0, maxlength);
-
- s = s.Substring (0, value.Length);
-
- if (String.Compare (s, value, true) == 0) {
- num_parsed = value.Length;
- return true;
- }
-
- num_parsed = -1;
- return false;
- }
-
- internal static bool _DoParse (string s, string format, bool exact,
- out DateTime result,
- DateTimeFormatInfo dfi,
- DateTimeStyles style)
- {
- bool useutc = false, use_localtime = true;
- bool sloppy_parsing = false;
-
- if (format.Length == 1)
- format = _GetStandardPattern (format[0], dfi, out useutc);
-
- if ((style & DateTimeStyles.AllowLeadingWhite) != 0) {
- format = format.TrimStart (null);
- s = s.TrimStart (null);
- }
-
- if ((style & DateTimeStyles.AllowTrailingWhite) != 0) {
- format = format.TrimEnd (null);
- s = s.TrimEnd (null);
- }
-
- if ((style & DateTimeStyles.AllowInnerWhite) != 0)
- sloppy_parsing = true;
-
- char[] chars = format.ToCharArray ();
- int len = format.Length, pos = 0, num = 0;
-
- int day = -1, dayofweek = -1, month = -1, year = -1;
- int hour = -1, minute = -1, second = -1, millisecond = -1;
- int ampm = -1;
- int tzsign = -1, tzoffset = -1, tzoffmin = -1;
-
- result = new DateTime (0);
- while (pos+num < len)
- {
- if (s.Length == 0)
- break;
-
- if (Char.IsWhiteSpace (s[0])) {
- s = s.Substring (1);
-
- if (Char.IsWhiteSpace (chars[pos])) {
- pos++;
- continue;
- }
-
- if ((style & DateTimeStyles.AllowInnerWhite) == 0)
- return false;
- }
-
- if (chars[pos] == '\'') {
- num = 1;
- while (pos+num < len) {
- if (chars[pos+num] == '\'')
- break;
-
- if (s.Length == 0)
- return false;
- if (s[0] != chars[pos+num])
- return false;
- s = s.Substring (1);
-
- num++;
- }
- if (pos+num > len)
- return false;
-
- pos += num + 1;
- num = 0;
- continue;
- } else if (chars[pos] == '\\') {
- if (pos+1 >= len)
- return false;
-
- if (s[0] != chars[pos+num])
- return false;
- s = s.Substring (1);
- if (s.Length == 0)
- return false;
-
- pos++;
- continue;
- } else if (chars[pos] == '%') {
- pos++;
- continue;
- }
-
- if ((pos+num+1 < len) && (chars[pos+num+1] == chars[pos+num])) {
- num++;
- continue;
- }
-
- int num_parsed = 0;
-
- switch (chars[pos])
- {
- case 'd':
- if (day != -1)
- return false;
- if (num == 0)
- day = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else if (num == 1)
- day = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- else if (num == 2)
- dayofweek = _ParseEnum (s, dfi.AbbreviatedDayNames, out num_parsed);
- else
- {
- dayofweek = _ParseEnum (s, dfi.DayNames, out num_parsed);
- num = 3;
- }
- break;
- case 'M':
- if (month != -1)
- return false;
- if (num == 0)
- month = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else if (num == 1)
- month = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- else if (num == 2)
- month = _ParseEnum (s, dfi.AbbreviatedMonthNames , out num_parsed) + 1;
- else
- {
- month = _ParseEnum (s, dfi.MonthNames, out num_parsed) + 1;
- num = 3;
- }
- if ((month < 1) || (month > 12))
- return false;
- break;
- case 'y':
- if (year != -1)
- return false;
- if (num == 0) {
- year = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- year += (year < 30) ? 2000 : 1900;
- } else if (num < 3) {
- year = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- year += (year < 30) ? 2000 : 1900;
- } else {
- year = _ParseNumber (s, 4, false, sloppy_parsing, out num_parsed);
- num = 3;
- }
- break;
- case 'h':
- if (hour != -1)
- return false;
- if (num == 0)
- hour = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- hour = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (hour >= 12)
- return false;
- break;
- case 'H':
- if ((hour != -1) || (ampm >= 0))
- return false;
- if (num == 0)
- hour = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- hour = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (hour >= 24)
- return false;
- ampm = -2;
- break;
- case 'm':
- if (minute != -1)
- return false;
- if (num == 0)
- minute = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- minute = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (minute >= 60)
- return false;
- break;
- case 's':
- if (second != -1)
- return false;
- if (num == 0)
- second = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else
- {
- second = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- num = 1;
- }
- if (second >= 60)
- return false;
- break;
- case 'f':
- if (millisecond != -1)
- return false;
- num = Math.Min (num, 6);
- millisecond = _ParseNumber (s, num+1, true, sloppy_parsing, out num_parsed);
- break;
- case 't':
- if (ampm != -1)
- return false;
- if (num == 0)
- {
- if (_ParseString (s, 1, dfi.AMDesignator, out num_parsed))
- ampm = 0;
- else if (_ParseString (s, 1, dfi.PMDesignator, out num_parsed))
- ampm = 1;
- else
- return false;
- }
- else
- {
- if (_ParseString (s, 0, dfi.AMDesignator, out num_parsed))
- ampm = 0;
- else if (_ParseString (s, 0, dfi.PMDesignator, out num_parsed))
- ampm = 1;
- else
- return false;
- num = 1;
- }
- break;
- case 'z':
- if (tzsign != -1)
- return false;
- if (s[0] == '+')
- tzsign = 0;
- else if (s[0] == '-')
- tzsign = 1;
- else
- return false;
- s = s.Substring (1);
- if (num == 0)
- tzoffset = _ParseNumber (s, 2, false, sloppy_parsing, out num_parsed);
- else if (num == 1)
- tzoffset = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- else
- {
- tzoffset = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- if (num_parsed < 0)
- return false;
- s = s.Substring (num_parsed);
- if (!_ParseString (s, 0, dfi.TimeSeparator, out num_parsed))
- return false;
- s = s.Substring (num_parsed);
- tzoffmin = _ParseNumber (s, 2, true, sloppy_parsing, out num_parsed);
- if (num_parsed < 0)
- return false;
- num = 2;
- }
- break;
- case ':':
- if (!_ParseString (s, 0, dfi.TimeSeparator, out num_parsed))
- return false;
- break;
- case '/':
- if (!_ParseString (s, 0, dfi.DateSeparator, out num_parsed))
- return false;
- break;
- default:
- if (s[0] != chars[pos])
- return false;
- num = 0;
- num_parsed = 1;
- break;
- }
-
- if (num_parsed < 0)
- return false;
-
- s = s.Substring (num_parsed);
-
- pos = pos + num + 1;
- num = 0;
- }
-
- if (hour == -1)
- hour = 0;
- if (minute == -1)
- minute = 0;
- if (second == -1)
- second = 0;
- if (millisecond == -1)
- millisecond = 0;
-
- // If no date was given
- if ((day == -1) && (month == -1) && (year == -1)) {
- if ((style & DateTimeStyles.NoCurrentDateDefault) != 0) {
- day = 1;
- month = 1;
- year = 1;
- } else {
- day = Today.Day;
- month = Today.Month;
- year = Today.Year;
- }
- }
-
- if (day == -1)
- day = 1;
- if (month == -1)
- month = 1;
- if (year == -1) {
- if ((style & DateTimeStyles.NoCurrentDateDefault) != 0)
- year = 1;
- else
- year = Today.Year;
- }
-
- if (ampm == 1)
- hour = hour + 12;
-
- result = new DateTime (year, month, day, hour, minute, second, millisecond);
-
- if ((dayofweek != -1) && (dayofweek != (int) result.DayOfWeek))
- throw new FormatException (Locale.GetText ("String was not recognized as valid DateTime because the day of week was incorrect."));
-
- // If no timezone was specified, default to the local timezone.
- TimeSpan utcoffset;
- if (useutc)
- utcoffset = new TimeSpan (0, 0, 0);
- else if (tzsign == -1) {
- TimeZone tz = TimeZone.CurrentTimeZone;
- utcoffset = tz.GetUtcOffset (result);
- } else {
- if ((style & DateTimeStyles.AdjustToUniversal) != 0)
- use_localtime = false;
-
- if (tzoffmin == -1)
- tzoffmin = 0;
- if (tzoffset == -1)
- tzoffset = 0;
- if (tzsign == 1)
- tzoffset = -tzoffset;
-
- utcoffset = new TimeSpan (tzoffset, tzoffmin, 0);
- }
-
- long newticks = (result.ticks - utcoffset).Ticks;
-
- result = new DateTime (use_localtime, newticks);
-
- return true;
- }
-
-
- public static DateTime ParseExact (string s, string format,
- IFormatProvider fp, DateTimeStyles style)
- {
- string[] formats;
-
- formats = new string [1];
- formats[0] = format;
-
- return ParseExact (s, formats, fp, style);
- }
-
- public static DateTime ParseExact (string s, string[] formats,
- IFormatProvider fp,
- DateTimeStyles style)
- {
- DateTimeFormatInfo dfi = DateTimeFormatInfo.GetInstance (fp);
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
- if (formats.Length == 0)
- throw new ArgumentNullException (Locale.GetText ("format is null"));
-
- int i;
- for (i = 0; i < formats.Length; i++)
- {
- DateTime result;
-
- if (_DoParse (s, formats[i], true, out result, dfi, style))
- return result;
- }
-
- throw new FormatException ();
- }
-
- public TimeSpan Subtract(DateTime dt)
- {
- return new TimeSpan(ticks.Ticks) - dt.ticks;
- }
-
- public DateTime Subtract(TimeSpan ts)
- {
- TimeSpan newticks;
-
- newticks = (new TimeSpan (ticks.Ticks)) - ts;
- return new DateTime(true,newticks);
- }
-
- public long ToFileTime()
- {
- if(ticks.Ticks < w32file_epoch) {
- throw new ArgumentOutOfRangeException("file time is not valid");
- }
-
- return(ticks.Ticks - w32file_epoch);
- }
-
- public string ToLongDateString()
- {
- return ToString ("D");
- }
-
- public string ToLongTimeString()
- {
- return ToString ("T");
- }
-
- [MonoTODO]
- public double ToOADate()
- {
- // TODO implement me
- return 0;
- }
-
- public string ToShortDateString()
- {
- return ToString ("d");
- }
-
- public string ToShortTimeString()
- {
- return ToString ("t");
- }
-
- public override string ToString ()
- {
- return ToString ("G", null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- internal static string _GetStandardPattern (char format, DateTimeFormatInfo dfi, out bool useutc)
- {
- String pattern;
-
- useutc = false;
-
- switch (format)
- {
- case 'd':
- pattern = dfi.ShortDatePattern;
- break;
- case 'D':
- pattern = dfi.LongDatePattern;
- break;
- case 'f':
- pattern = dfi.LongDatePattern + " " + dfi.ShortTimePattern;
- break;
- case 'F':
- pattern = dfi.FullDateTimePattern;
- break;
- case 'g':
- pattern = dfi.ShortDatePattern + " " + dfi.ShortTimePattern;
- break;
- case 'G':
- pattern = dfi.ShortDatePattern + " " + dfi.LongTimePattern;
- break;
- case 'm':
- case 'M':
- pattern = dfi.MonthDayPattern;
- break;
- case 'r':
- case 'R':
- pattern = dfi.RFC1123Pattern;
- // commented by LP 09/jun/2002, rfc 1123 pattern is always in GMT
- // useutc= true;
- break;
- case 's':
- pattern = dfi.SortableDateTimePattern;
- break;
- case 't':
- pattern = dfi.ShortTimePattern;
- break;
- case 'T':
- pattern = dfi.LongTimePattern;
- break;
- case 'u':
- pattern = dfi.UniversalSortableDateTimePattern;
- useutc = true;
- break;
- case 'U':
- pattern = dfi.LongDatePattern + " " + dfi.LongTimePattern;
- useutc = true;
- break;
- case 'y':
- case 'Y':
- pattern = dfi.YearMonthPattern;
- break;
- default:
- pattern = null;
- break;
- }
-
- return pattern;
- }
-
- internal string _ToString (string format, DateTimeFormatInfo dfi)
- {
- String str = null, result = null;
- char[] chars = format.ToCharArray ();
- int len = format.Length, pos = 0, num = 0;
-
- TimeZone tz = TimeZone.CurrentTimeZone;
- TimeSpan utcoffset = tz.GetUtcOffset (this);
-
- while (pos < len)
- {
- if (chars[pos] == '\'') {
- num = 1;
- while (pos+num <= len) {
- if (chars[pos+num] == '\'')
- break;
-
- result += chars[pos+num];
- num++;
- }
- if (pos+num > len)
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- pos += num+1;
- num = 0;
- continue;
- } else if (chars[pos] == '\\') {
- if (pos+1 >= len)
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
-
- result += chars[pos+1];
- pos += 2;
- continue;
- } else if (chars[pos] == '%') {
- pos++;
- continue;
- }
-
- if ((pos+num+1 < len) && (chars[pos+num+1] == chars[pos+num])) {
- num++;
- continue;
- }
-
- switch (chars[pos])
- {
- case 'd':
- if (num == 0)
- str = Day.ToString ("d");
- else if (num == 1)
- str = Day.ToString ("d02");
- else if (num == 2)
- str = dfi.GetAbbreviatedDayName (DayOfWeek);
- else {
- str = dfi.GetDayName (DayOfWeek);
- num = 3;
- }
- break;
- case 'M':
- if (num == 0)
- str = Month.ToString ("d");
- else if (num == 1)
- str = Month.ToString ("d02");
- else if (num == 2)
- str = dfi.GetAbbreviatedMonthName (Month);
- else {
- str = dfi.GetMonthName (Month);
- num = 3;
- }
- break;
- case 'y':
- if (num == 0) {
- int shortyear = Year % 100;
- str = shortyear.ToString ("d");
- } else if (num == 1) {
- int shortyear = Year % 100;
- str = shortyear.ToString ("d02");
- } else {
- str = Year.ToString ("d");
- num = 3;
- }
- break;
- case 'g':
- // FIXME
- break;
- case 'f':
- num = Math.Min (num, 6);
-
- long ms = (long) Millisecond;
- long exp = 10;
- for (int i = 0; i < num; i++)
- exp = exp * 10;
- long maxexp = TimeSpan.TicksPerMillisecond;
-
- exp = Math.Min (exp, maxexp);
- ms = ms * exp / maxexp;
-
- String prec = (num+1).ToString ("d02");
- str = ms.ToString (String.Concat ("d", prec));
-
- break;
- case 'h':
- if (num == 0) {
- int shorthour = Hour % 12;
- str = shorthour.ToString ("d");
- } else {
- int shorthour = Hour % 12;
- str = shorthour.ToString ("d02");
- num = 1;
- }
- break;
- case 'H':
- if (num == 0)
- str = Hour.ToString ("d");
- else {
- str = Hour.ToString ("d02");
- num = 1;
- }
- break;
- case 'm':
- if (num == 0)
- str = Minute.ToString ("d");
- else {
- str = Minute.ToString ("d02");
- num = 1;
- }
- break;
- case 's':
- if (num == 0)
- str = Second.ToString ("d");
- else {
- str = Second.ToString ("d02");
- num = 1;
- }
- break;
- case 't':
- if (Hour < 12)
- str = dfi.AMDesignator;
- else
- str = dfi.PMDesignator;
-
- if (num == 0)
- str = str.Substring (0,1);
- else
- num = 1;
- break;
- case 'z':
- if (num == 0) {
- int offset = utcoffset.Hours;
- str = offset.ToString ("d");
- if (offset > 0)
- str = String.Concat ("+", str);
- } else if (num == 1) {
- int offset = utcoffset.Hours;
- str = offset.ToString ("d02");
- if (offset > 0)
- str = String.Concat ("+", str);
- } else if (num == 2) {
- int offhour = utcoffset.Hours;
- int offminute = utcoffset.Minutes;
- str = offhour.ToString ("d02");
- str = String.Concat (str, dfi.TimeSeparator);
- str = String.Concat (str, offminute.ToString ("d02"));
- if (offhour > 0)
- str = String.Concat ("+", str);
- num = 2;
- }
- break;
- case ':':
- str = dfi.TimeSeparator;
- num = 0;
- break;
- case '/':
- str = dfi.DateSeparator;
- num = 0;
- break;
- default:
- str = String.Concat (chars [pos]);
- num = 0;
- break;
- }
-
- result = String.Concat (result, str);
-
- pos += num + 1;
- num = 0;
- }
-
- return result;
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- DateTimeFormatInfo dfi = DateTimeFormatInfo.GetInstance(fp);
-
- if (format == null)
- format = dfi.FullDateTimePattern;
-
- bool useutc = false;
-
- if (format.Length == 1) {
- char fchar = (format.ToCharArray ())[0];
- format = _GetStandardPattern (fchar, dfi, out useutc);
- }
-
- if (useutc)
- return this.ToUniversalTime ()._ToString (format, dfi);
- else
- return this._ToString (format, dfi);
- }
-
- public DateTime ToLocalTime()
- {
- TimeZone tz = TimeZone.CurrentTimeZone;
-
- TimeSpan offset = tz.GetUtcOffset (this);
-
- return new DateTime (true, ticks + offset);
- }
-
- public DateTime ToUniversalTime()
- {
- TimeZone tz = TimeZone.CurrentTimeZone;
-
- TimeSpan offset = tz.GetUtcOffset (this);
-
- return new DateTime (true, ticks - offset);
- }
-
- /* OPERATORS */
-
- public static DateTime operator +(DateTime d, TimeSpan t)
- {
- return new DateTime (true, d.ticks + t);
- }
-
- public static bool operator ==(DateTime d1, DateTime d2)
- {
- return (d1.ticks == d2.ticks);
- }
-
- public static bool operator >(DateTime t1,DateTime t2)
- {
- return (t1.ticks > t2.ticks);
- }
-
- public static bool operator >=(DateTime t1,DateTime t2)
- {
- return (t1.ticks >= t2.ticks);
- }
-
- public static bool operator !=(DateTime d1, DateTime d2)
- {
- return (d1.ticks != d2.ticks);
- }
-
- public static bool operator <(DateTime t1, DateTime t2)
- {
- return (t1.ticks < t2.ticks );
- }
-
- public static bool operator <=(DateTime t1,DateTime t2)
- {
- return (t1.ticks <= t2.ticks);
- }
-
- public static TimeSpan operator -(DateTime d1,DateTime d2)
- {
- return new TimeSpan((d1.ticks - d2.ticks).Ticks);
- }
-
- public static DateTime operator -(DateTime d,TimeSpan t)
- {
- return new DateTime (true, d.ticks - t);
- }
-
- bool IConvertible.ToBoolean(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- byte IConvertible.ToByte(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- char IConvertible.ToChar(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- // TODO Implement me
- [MonoTODO]
- public System.DateTime ToDateTime(IFormatProvider provider)
- {
- return new System.DateTime(true,this.ticks);
- }
-
- decimal IConvertible.ToDecimal(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- double IConvertible.ToDouble(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- Int16 IConvertible.ToInt16(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- Int32 IConvertible.ToInt32(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- Int64 IConvertible.ToInt64(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- SByte IConvertible.ToSByte(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- Single IConvertible.ToSingle(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- object IConvertible.ToType(Type conversionType,IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- UInt16 IConvertible.ToUInt16(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- UInt32 IConvertible.ToUInt32(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- UInt64 IConvertible.ToUInt64(IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
- }
-}
-
-namespace System
-{
- public enum DayOfWeek
- {
- Sunday,
- Monday,
- Tuesday,
- Wednesday,
- Thursday,
- Friday,
- Saturday
- }
-}
diff --git a/mcs/class/corlib/System/Decimal.cs b/mcs/class/corlib/System/Decimal.cs
deleted file mode 100644
index e0b0616cc22..00000000000
--- a/mcs/class/corlib/System/Decimal.cs
+++ /dev/null
@@ -1,1113 +0,0 @@
-//
-// System.Decimal.cs
-//
-// Represents a floating-point decimal data type with up to 29
-// significant digits, suitable for financial and commercial calculations.
-//
-// Author:
-// Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) 2001 Martin Weindel
-//
-
-using System;
-using System.Globalization;
-using System.Text;
-using System.Runtime.CompilerServices;
-#if MSTEST
-using System.Runtime.InteropServices;
-#endif
-
-
-namespace System
-{
- /// <summary>
- /// Represents a floating-point decimal data type with up to 29 significant
- /// digits, suitable for financial and commercial calculations
- /// </summary>
- [Serializable]
- public struct Decimal: IComparable, IFormattable, IConvertible
- {
- public static readonly Decimal MinValue = new Decimal(-1, -1, -1, true, 0);
- public static readonly Decimal MaxValue = new Decimal(-1, -1, -1, false, 0);
- public static readonly Decimal MinusOne = new Decimal(1, 0, 0, true, 0);
- public static readonly Decimal One = new Decimal(1, 0, 0, false, 0);
- public static readonly Decimal Zero = new Decimal(0, 0, 0, false, 0);
-
- // maximal decimal value as double
- private static readonly double dDecMaxValue = 7.922816251426433759354395033e28;
- // epsilon decimal value as double
- private static readonly double dDecEpsilon = 0.5e-28; // == 0.5 * 1 / 10^28
-
- // some constants
- private const int DECIMAL_DIVIDE_BY_ZERO = 5;
- private const uint MAX_SCALE = 28;
- private const int iMAX_SCALE = 28;
- private const uint SIGN_FLAG = 0x80000000;
- private const uint SCALE_MASK = 0x00FF0000;
- private const int SCALE_SHIFT = 16;
- private const uint RESERVED_SS32_BITS = 0x7F00FFFF;
-
- // internal representation of decimal
- private uint ss32;
- private uint hi32;
- private uint lo32;
- private uint mid32;
-
- // LAMESPEC: this constructor is missing in specification
- // but exists in MS Csharp implementation
- public Decimal(int lo, int mid, int hi, bool isNegative, byte scale)
- {
- unchecked
- {
- lo32 = (uint) lo;
- mid32 = (uint) mid;
- hi32 = (uint) hi;
-
- if (scale > MAX_SCALE)
- {
- throw new ArgumentOutOfRangeException (Locale.GetText ("scale must be between 0 and 28"));
- }
-
- ss32 = scale;
- ss32 <<= SCALE_SHIFT;
- if (isNegative) ss32 |= SIGN_FLAG;
- }
- }
-
- public Decimal(int val)
- {
- unchecked
- {
- hi32 = mid32 = 0;
- if (val < 0)
- {
- ss32 = SIGN_FLAG;
- lo32 = ((uint)~val) + 1;
- }
- else
- {
- ss32 = 0;
- lo32 = (uint) val;
- }
- }
- }
-
- [CLSCompliant(false)]
- public Decimal(uint val)
- {
- lo32 = val;
- ss32 = hi32 = mid32 = 0;
- }
-
- public Decimal(long val)
- {
- unchecked
- {
- hi32 = 0;
- if (val < 0)
- {
- ss32 = SIGN_FLAG;
- ulong u = ((ulong)~val) + 1;
- lo32 = (uint)u;
- mid32 = (uint)(u >> 32);
- }
- else
- {
- ss32 = 0;
- ulong u = (ulong)val;
- lo32 = (uint)u;
- mid32 = (uint)(u >> 32);
- }
- }
- }
-
- [CLSCompliant(false)]
- public Decimal(ulong uval)
- {
- unchecked
- {
- ss32 = hi32 = 0;
- lo32 = (uint)uval;
- mid32 = (uint)(uval >> 32);
- }
- }
-
- public Decimal(float val)
- {
- if (double2decimal(out this, val, 7) != 0)
- {
- throw new OverflowException();
- }
- }
-
- public Decimal(double val)
- {
- if (double2decimal(out this, val, 15) != 0)
- {
- throw new OverflowException();
- }
- }
-
- public Decimal(int[] bits)
- {
- if (bits == null)
- {
- throw new ArgumentNullException(Locale.GetText ("Bits is a null reference"));
- }
-
- if (bits.GetLength(0) != 4)
- {
- throw new ArgumentException(Locale.GetText ("bits does not contain four values"));
- }
-
- unchecked {
- lo32 = (uint) bits[0];
- mid32 = (uint) bits[1];
- hi32 = (uint) bits[2];
- ss32 = (uint) bits[3];
- byte scale = (byte)(ss32 >> SCALE_SHIFT);
- if (scale > MAX_SCALE || (ss32 & RESERVED_SS32_BITS) != 0)
- {
- throw new ArgumentException(Locale.GetText ("Invalid bits[3]"));
- }
- }
- }
-
- public static int[] GetBits(Decimal d)
- {
- unchecked
- {
- return new int[] { (int)d.lo32, (int)d.mid32, (int)d.hi32,
- (int)d.ss32 };
- }
- }
-
- public static Decimal Negate(Decimal d)
- {
- d.ss32 ^= SIGN_FLAG;
- return d;
- }
-
-
- public static Decimal Add(Decimal d1, Decimal d2)
- {
- if (decimalIncr(ref d1, ref d2) == 0)
- return d1;
- else
- throw new OverflowException(Locale.GetText ("Overflow on adding decimal number"));
- }
-
- public static Decimal Subtract(Decimal d1, Decimal d2)
- {
- d2.ss32 ^= SIGN_FLAG;
- int result = decimalIncr(ref d1, ref d2);
- if (result == 0)
- return d1;
- else
- throw new OverflowException(Locale.GetText ("Overflow on subtracting decimal numbers ("+result+")"));
- }
-
- public override int GetHashCode()
- {
- return (int)lo32;
- }
-
- public static Decimal operator +(Decimal d1, Decimal d2)
- {
- return Add(d1, d2);
- }
-
- public static Decimal operator --(Decimal d)
- {
- return Add(d, MinusOne);
- }
-
- public static Decimal operator ++(Decimal d)
- {
- return Add(d, One);
- }
-
- public static Decimal operator -(Decimal d1, Decimal d2)
- {
- return Subtract(d1, d2);
- }
-
- public static Decimal operator -(Decimal d)
- {
- return Negate(d);
- }
-
- public static Decimal operator +(Decimal d)
- {
- return d;
- }
-
- public static Decimal operator *(Decimal d1, Decimal d2)
- {
- return Multiply(d1, d2);
- }
-
- public static Decimal operator /(Decimal d1, Decimal d2)
- {
- return Divide(d1, d2);
- }
-
- public static Decimal operator %(Decimal d1, Decimal d2)
- {
- return Remainder(d1, d2);
- }
-
- public static explicit operator byte(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Byte.MaxValue || result < Byte.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (byte) result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator sbyte(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > SByte.MaxValue || result < SByte.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (sbyte) result;
- }
-
- public static explicit operator char(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Char.MaxValue || result < Char.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (char) result;
- }
-
- public static explicit operator short(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Int16.MaxValue || result < Int16.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (short) result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator ushort(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > UInt16.MaxValue || result < UInt16.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (ushort) result;
- }
-
- public static explicit operator int(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > Int32.MaxValue || result < Int32.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (int) result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator uint(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- if (result > UInt32.MaxValue || result < UInt32.MinValue)
- {
- throw new System.OverflowException();
- }
-
- return (uint) result;
- }
-
- public static explicit operator long(Decimal val)
- {
- long result;
-
- if (decimal2Int64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- return result;
- }
-
- [CLSCompliant(false)]
- public static explicit operator ulong(Decimal val)
- {
- ulong result;
-
- if (decimal2UInt64(ref val, out result) != 0)
- {
- throw new System.OverflowException();
- }
-
- return result;
- }
-
- public static implicit operator Decimal(byte val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(sbyte val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(short val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(ushort val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(char val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(int val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(uint val)
- {
- return new Decimal(val);
- }
-
- public static implicit operator Decimal(long val)
- {
- return new Decimal(val);
- }
-
- [CLSCompliant(false)]
- public static implicit operator Decimal(ulong val)
- {
- return new Decimal(val);
- }
-
- public static explicit operator Decimal(float val)
- {
- return new Decimal(val);
- }
-
- public static explicit operator Decimal(double val)
- {
- return new Decimal(val);
- }
-
- public static explicit operator float(Decimal val)
- {
- return (float) (double) val;
- }
-
- public static explicit operator double(Decimal val)
- {
- return decimal2double(ref val);
- }
-
-
- public static bool operator !=(Decimal d1, Decimal d2)
- {
- return !Equals(d1, d2);
- }
-
- public static bool operator ==(Decimal d1, Decimal d2)
- {
- return Equals(d1, d2);
- }
-
- public static bool operator >(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) > 0;
- }
-
- public static bool operator >=(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) >= 0;
- }
-
- public static bool operator <(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) < 0;
- }
-
- public static bool operator <=(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) <= 0;
- }
-
- public static bool Equals(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2) == 0;
- }
-
- public override bool Equals(object o)
- {
- if (!(o is Decimal))
- return false;
-
- return Equals((Decimal) o, this);
- }
-
- public static Decimal Floor(Decimal d)
- {
- decimalFloorAndTrunc(ref d, 1);
- return d;
- }
-
- public static Decimal Truncate(Decimal d)
- {
- decimalFloorAndTrunc(ref d, 0);
- return d;
- }
-
- public static Decimal Round(Decimal d, int decimals)
- {
- if (decimals < 0 || decimals > iMAX_SCALE)
- {
- throw new ArgumentOutOfRangeException(Locale.GetText ("decimals must be between 0 and 28"));
- }
-
- decimalRound(ref d, decimals);
- return d;
- }
-
- public static Decimal Multiply(Decimal d1, Decimal d2)
- {
- if (decimalMult(ref d1, ref d2) != 0)
- {
- throw new OverflowException();
- }
-
- return d1;
- }
-
- public static Decimal Divide(Decimal d1, Decimal d2)
- {
- Decimal d3;
- int rc = decimalDiv(out d3, ref d1, ref d2);
-
- if (rc != 0)
- {
- if (rc == DECIMAL_DIVIDE_BY_ZERO)
- throw new DivideByZeroException();
- else
- throw new OverflowException();
- }
-
- return d3;
- }
-
- public static Decimal Remainder(Decimal d1, Decimal d2)
- {
- Decimal d3;
- int rc = decimalIntDiv(out d3, ref d1, ref d2);
-
- if (rc != 0)
- {
- if (rc == DECIMAL_DIVIDE_BY_ZERO)
- throw new DivideByZeroException();
- else
- throw new OverflowException();
- }
-
- return d1 - d3 * d2;
- }
-
- public static int Compare(Decimal d1, Decimal d2)
- {
- return decimalCompare(ref d1, ref d2);
- }
-
- public int CompareTo(object val)
- {
- if (val == null)
- return 1;
-
- if (!(val is Decimal))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Decimal"));
-
- Decimal d2 = (Decimal)val;
- return decimalCompare(ref this, ref d2);
- }
-
- public static Decimal Parse(string s)
- {
- return Parse(s, NumberStyles.Number, null);
- }
-
- public static Decimal Parse(string s, NumberStyles style)
- {
- return Parse(s, style, null);
- }
-
- public static Decimal Parse(string s, IFormatProvider provider)
- {
- return Parse(s, NumberStyles.Number, provider);
- }
-
- private static NumberFormatInfo GetNumberFormatInfoFromIFormatProvider(IFormatProvider provider)
- {
- NumberFormatInfo nfi = null;
-
- if (provider != null)
- {
- nfi = (NumberFormatInfo) provider.GetFormat(typeof(System.Decimal));
- if (nfi == null && provider is NumberFormatInfo)
- {
- nfi = (NumberFormatInfo) provider;
- }
- }
-
- if (nfi == null)
- {
- nfi = NumberFormatInfo.CurrentInfo;
- }
-
- return nfi;
- }
-
- private static string stripStyles(string s, NumberStyles style, NumberFormatInfo nfi,
- out int decPos, out bool isNegative, out bool expFlag, out int exp)
- {
- string invalidChar = Locale.GetText ("Invalid character at position ");
- string invalidExponent = Locale.GetText ("Invalid exponent");
- isNegative = false;
- expFlag = false;
- exp = 0;
- decPos = -1;
-
- bool hasSign = false;
- bool hasOpeningParentheses = false;
- bool hasDecimalPoint = false;
- bool allowedLeadingWhiteSpace = ((style & NumberStyles.AllowLeadingWhite) != 0);
- bool allowedTrailingWhiteSpace = ((style & NumberStyles.AllowTrailingWhite) != 0);
- bool allowedLeadingSign = ((style & NumberStyles.AllowLeadingSign) != 0);
- bool allowedTrailingSign = ((style & NumberStyles.AllowTrailingSign) != 0);
- bool allowedParentheses = ((style & NumberStyles.AllowParentheses) != 0);
- bool allowedThousands = ((style & NumberStyles.AllowThousands) != 0);
- bool allowedDecimalPoint = ((style & NumberStyles.AllowDecimalPoint) != 0);
- bool allowedExponent = ((style & NumberStyles.AllowExponent) != 0);
-
- /* get rid of currency symbol */
- bool hasCurrency = false;
- if ((style & NumberStyles.AllowCurrencySymbol) != 0)
- {
- int index = s.IndexOf(nfi.CurrencySymbol);
- if (index >= 0)
- {
- s = s.Remove(index, nfi.CurrencySymbol.Length);
- hasCurrency = true;
- }
- }
-
- string decimalSep = (hasCurrency) ? nfi.CurrencyDecimalSeparator : nfi.NumberDecimalSeparator;
- string groupSep = (hasCurrency) ? nfi.CurrencyGroupSeparator : nfi.NumberGroupSeparator;
-
- int pos = 0;
- int len = s.Length;
-
- StringBuilder sb = new StringBuilder(len);
-
- // leading
- while (pos < len)
- {
- char ch = s[pos];
- if (Char.IsDigit(ch))
- {
- break; // end of leading
- }
- else if (allowedLeadingWhiteSpace && Char.IsWhiteSpace(ch))
- {
- pos++;
- }
- else if (allowedParentheses && ch == '(' && !hasSign && !hasOpeningParentheses)
- {
- hasOpeningParentheses = true;
- hasSign = true;
- isNegative = true;
- pos++;
- }
- else if (allowedLeadingSign && ch == nfi.NegativeSign[0] && !hasSign)
- {
- int slen = nfi.NegativeSign.Length;
- if (slen == 1 || s.IndexOf(nfi.NegativeSign, pos, slen) == pos)
- {
- hasSign = true;
- isNegative = true;
- pos += slen;
- }
- }
- else if (allowedLeadingSign && ch == nfi.PositiveSign[0] && !hasSign)
- {
- int slen = nfi.PositiveSign.Length;
- if (slen == 1 || s.IndexOf(nfi.PositiveSign, pos, slen) == pos)
- {
- hasSign = true;
- pos += slen;
- }
- }
- else if (allowedDecimalPoint && ch == decimalSep[0])
- {
- int slen = decimalSep.Length;
- if (slen != 1 && s.IndexOf(decimalSep, pos, slen) != pos)
- {
- throw new FormatException(invalidChar + pos);
- }
- break;
- }
- else
- {
- throw new FormatException(invalidChar + pos);
- }
- }
-
- if (pos == len)
- throw new FormatException(Locale.GetText ("No digits found"));
-
- // digits
- while (pos < len)
- {
- char ch = s[pos];
- if (Char.IsDigit(ch))
- {
- sb.Append(ch);
- pos++;
- }
- else if (allowedThousands && ch == groupSep[0])
- {
- int slen = groupSep.Length;
- if (slen != 1 && s.IndexOf(groupSep, pos, slen) != pos)
- {
- throw new FormatException(invalidChar + pos);
- }
- pos += slen;
- }
- else if (allowedDecimalPoint && ch == decimalSep[0] && !hasDecimalPoint)
- {
- int slen = decimalSep.Length;
- if (slen == 1 || s.IndexOf(decimalSep, pos, slen) == pos)
- {
- decPos = sb.Length;
- hasDecimalPoint = true;
- pos += slen;
- }
- }
- else
- {
- break;
- }
- }
-
- // exponent
- if (pos < len)
- {
- char ch = s[pos];
- if (allowedExponent && Char.ToUpper(ch) == 'E')
- {
- expFlag = true;
- pos++; if (pos >= len) throw new FormatException(invalidExponent);
- ch = s[pos];
- bool isNegativeExp = false;
- if (ch == nfi.PositiveSign[0])
- {
- int slen = nfi.PositiveSign.Length;
- if (slen == 1 || s.IndexOf(nfi.PositiveSign, pos, slen) == pos)
- {
- pos += slen; if (pos >= len) throw new FormatException(invalidExponent);
- }
- }
- else if (ch == nfi.NegativeSign[0])
- {
- int slen = nfi.NegativeSign.Length;
- if (slen == 1 || s.IndexOf(nfi.NegativeSign, pos, slen) == pos)
- {
- pos += slen; if (pos >= len) throw new FormatException(invalidExponent);
- isNegativeExp = true;
- }
- }
- ch = s[pos];
- if (!Char.IsDigit(ch)) throw new FormatException(invalidExponent);
- exp = ch - '0';
- pos++;
- while (pos < len && Char.IsDigit(s[pos]))
- {
- exp *= 10;
- exp += s[pos] - '0';
- pos++;
- }
- if (isNegativeExp) exp *= -1;
- }
- }
-
- // trailing
- while (pos < len)
- {
- char ch = s[pos];
- if (allowedTrailingWhiteSpace && Char.IsWhiteSpace(ch))
- {
- pos++;
- }
- else if (allowedParentheses && ch == ')' && hasOpeningParentheses)
- {
- hasOpeningParentheses = false;
- pos++;
- }
- else if (allowedTrailingSign && ch == nfi.NegativeSign[0] && !hasSign)
- {
- int slen = nfi.NegativeSign.Length;
- if (slen == 1 || s.IndexOf(nfi.NegativeSign, pos, slen) == pos)
- {
- hasSign = true;
- isNegative = true;
- pos += slen;
- }
- }
- else if (allowedTrailingSign && ch == nfi.PositiveSign[0] && !hasSign)
- {
- int slen = nfi.PositiveSign.Length;
- if (slen == 1 || s.IndexOf(nfi.PositiveSign, pos, slen) == pos)
- {
- hasSign = true;
- pos += slen;
- }
- }
- else
- {
- throw new FormatException(invalidChar + pos);
- }
- }
-
- if (hasOpeningParentheses) throw new FormatException (
- Locale.GetText ("Closing Parentheses not found"));
-
- if (!hasDecimalPoint) decPos = sb.Length;
-
- return sb.ToString();
- }
-
- public static Decimal Parse(string s, NumberStyles style, IFormatProvider provider)
- {
- NumberFormatInfo nfi = GetNumberFormatInfoFromIFormatProvider(provider);
-
- if (s == null) throw new ArgumentNullException (Locale.GetText ("string s"));
-
- int iDecPos, exp;
- bool isNegative, expFlag;
- s = stripStyles(s, style, nfi, out iDecPos, out isNegative, out expFlag, out exp);
-
- if (iDecPos < 0)
- throw new Exception (Locale.GetText ("Error in System.Decimal.Parse"));
- uint decPos = (uint) iDecPos;
-
- Decimal d;
- int digits = s.Length;
- int sign = (isNegative) ? 1 : 0;
- if (string2decimal(out d, s, decPos, sign) != 0)
- {
- throw new OverflowException();
- }
-
- if (expFlag)
- {
- if (decimalSetExponent(ref d, exp) != 0)
- throw new OverflowException();
- }
-
- return d;
- }
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Decimal;
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return Convert.ToType (this, conversionType, provider);
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return Convert.ToBoolean (this);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return Convert.ToByte (this);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- throw new InvalidCastException ();
- }
-
- [CLSCompliant (false)]
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException ();
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return this;
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return Convert.ToDouble (this);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return Convert.ToInt16 (this);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return Convert.ToInt32 (this);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return Convert.ToInt64 (this);
- }
-
- [CLSCompliant (false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return Convert.ToSByte (this);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return Convert.ToSingle (this);
- }
-
- [CLSCompliant (false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return Convert.ToUInt16 (this);
- }
-
- [CLSCompliant (false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return Convert.ToUInt32 (this);
- }
-
- [CLSCompliant (false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return Convert.ToUInt64 (this);
- }
-
- public string ToString(string format, IFormatProvider provider)
- {
- NumberFormatInfo nfi = GetNumberFormatInfoFromIFormatProvider(provider);
-
- if (format == null) format = "G";
-
- return DecimalFormatter.NumberToString(format, nfi, this);
- }
-
- public override string ToString()
- {
- return ToString("G", null);
- }
-
- public string ToString(string format)
- {
- return ToString(format, null);
- }
-
- public string ToString(IFormatProvider provider)
- {
- return ToString("G", provider);
- }
-
-#if !MSTEST
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimal2UInt64(ref Decimal val,
- out ulong result);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimal2Int64(ref Decimal val,
- out long result);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int double2decimal(out Decimal erg,
- double val, int digits);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalIncr(ref Decimal d1, ref Decimal d2);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern int decimal2string(ref Decimal val,
- int digits, int decimals, char[] bufDigits, int bufSize, out int decPos, out int sign);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern int string2decimal(out Decimal val, String sDigits, uint decPos, int sign);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern int decimalSetExponent(ref Decimal val, int exp);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern double decimal2double(ref Decimal val);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void decimalFloorAndTrunc(ref Decimal val,
- int floorFlag);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void decimalRound(ref Decimal val, int decimals);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalMult(ref Decimal pd1, ref Decimal pd2);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalIntDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern int decimalCompare(ref Decimal d1, ref Decimal d2);
-#else
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2UInt64")]
- private static extern int decimal2UInt64(ref Decimal val,
- out ulong result);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2Int64")]
- private static extern int decimal2Int64(ref Decimal val,
- out long result);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="double2decimal")]
- private static extern int double2decimal(out Decimal erg,
- double val, int digits);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalIncr")]
- private static extern int decimalIncr(ref Decimal d1, ref Decimal d2);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2string")]
- internal static extern int decimal2string(ref Decimal val,
- int digits, int decimals,
- [MarshalAs(UnmanagedType.LPWStr)]StringBuilder bufDigits,
- int bufSize, out int decPos, out int sign);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="string2decimal")]
- internal static extern int string2decimal(out Decimal val,
- [MarshalAs(UnmanagedType.LPWStr)]String sDigits,
- uint decPos, int sign);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalSetExponent")]
- internal static extern int decimalSetExponent(ref Decimal val, int exp);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimal2double")]
- private static extern double decimal2double(ref Decimal val);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalFloorAndTrunc")]
- private static extern void decimalFloorAndTrunc(ref Decimal val,
- int floorFlag);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalRound")]
- private static extern void decimalRound(ref Decimal val, int decimals);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalMult")]
- private static extern int decimalMult(ref Decimal pd1, ref Decimal pd2);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalDiv")]
- private static extern int decimalDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalIntDiv")]
- private static extern int decimalIntDiv(out Decimal pc, ref Decimal pa, ref Decimal pb);
-
- //![MethodImplAttribute(MethodImplOptions.InternalCall)]
- [DllImport("libdec", EntryPoint="decimalCompare")]
- private static extern int decimalCompare(ref Decimal d1, ref Decimal d2);
-
-#endif
- }
-}
diff --git a/mcs/class/corlib/System/DecimalFormatter.cs b/mcs/class/corlib/System/DecimalFormatter.cs
deleted file mode 100644
index 4003b91adfa..00000000000
--- a/mcs/class/corlib/System/DecimalFormatter.cs
+++ /dev/null
@@ -1,389 +0,0 @@
-//
-// System.DecimalFormatter.cs
-//
-// Author:
-// Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, Derek Holden dholden@draper.com
-//
-
-//
-// Internal class for formatting decimal numbers.
-
-using System.Globalization;
-using System.Text;
-using S = System; // only used for switching test implementation
-
-namespace System
-{
-
- internal sealed class DecimalFormatter
- {
-
- private static bool ParseFormat (string format, out char specifier, out int precision)
- {
- precision = -1;
- specifier = '\0';
-
- int length = format.Length;
- if (length < 1 || length > 3)
- return false;
-
- char[] chars = format.ToCharArray ();
- specifier = Char.ToUpper(chars[0]);
-
- if (length == 1)
- return true;
-
- if (length == 2)
- {
- if (chars[1] < '0' || chars[1] > '9')
- return false;
-
- precision = chars[1] - '0';
- }
- else
- {
- if (chars[1] < '0' || chars[2] < '0' || chars[1] > '9' || chars[2] > '9')
- return false;
-
- precision = (chars[1] - '0') * 10 + (chars[2] - '0');
- }
-
- return true;
- }
-
- public static string NumberToString(string format, NumberFormatInfo nfi, S.Decimal value)
- {
- char specifier;
- int precision;
- if (!DecimalFormatter.ParseFormat(format, out specifier, out precision))
- {
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
-
- int digits = -1;
- int decimals = 0;
- // first calculate number of digits or decimals needed for format
- switch (specifier)
- {
- case 'C':
- decimals = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- break;
- case 'F': goto case 'N';
- case 'N':
- decimals = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- break;
- case 'G':
- digits = (precision >= 0) ? precision : 0;
- break;
- case 'E':
- digits = (precision >= 0) ? precision+1 : 7;
- break;
- case 'P':
- decimals = (precision >= 0) ? precision+2 : nfi.PercentDecimalDigits+2;
- break;
- case 'Z':
- digits = 0;
- break;
- }
-
- // get digit string
- const int bufSize = 40;
- int decPos = 0, sign = 0;
-#if !MSTEST
- char[] buf = new char[bufSize];
- if (S.Decimal.decimal2string(ref value, digits, decimals, buf, bufSize, out decPos, out sign) != 0)
- {
- throw new FormatException(); // should never happen
- }
-
- string TempString = new String(buf);
- TempString = TempString.Trim(new char[] {(char)0x0});
- StringBuilder sb = new StringBuilder(TempString, TempString.Length);
-#else
- StringBuilder sb = new StringBuilder(bufSize);
- if (S.Decimal.decimal2string(ref value, digits, decimals, sb, bufSize, out decPos, out sign) != 0)
- {
- throw new FormatException(); // should never happen
- }
-#endif
-
- if (sb.ToString () == String.Empty && decPos > 0 && sign == 0)
- sb.Append ('0');
-
- // now build the format
- switch (specifier)
- {
- case 'C': return FormatCurrency(nfi, sb, decimals, decPos, sign);
- case 'N': return FormatNumber(nfi, sb, decimals, decPos, sign);
- case 'F': return FormatFixedPoint(nfi, sb, decimals, decPos, sign);
- case 'G': return FormatGeneral(nfi, sb, digits, decPos, sign, format[0]);
- case 'E': return FormatExponential(nfi, sb, digits, decPos, sign, format[0], true);
- case 'P': return FormatPercent(nfi, sb, decimals, decPos, sign);
- case 'Z': return FormatNormalized(nfi, sb, digits, decPos, sign);
- default:
- throw new FormatException (Locale.GetText ("The specified format is invalid"));
- }
- }
-
- private static string FormatFixedPoint(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- if (decimals > 0)
- {
- sb.Insert((decPos <= 0) ? 1 : decPos, nfi.NumberDecimalSeparator);
- }
-
- if (sign != 0)
- {
- sb.Insert(0, nfi.NegativeSign);
- }
-
- return sb.ToString();
- }
-
- private static string FormatExponential(NumberFormatInfo nfi, StringBuilder sb,
- int digits, int decPos, int sign, char echar, bool exp3flag)
- {
- // insert decimal separator
- if (digits > 1 || (digits == 0 && sb.Length > 1))
- {
- sb.Insert(1, nfi.NumberDecimalSeparator);
- }
-
- // insert sign
- if (sign != 0)
- {
- sb.Insert(0, nfi.NegativeSign);
- }
-
- // append exponent
- sb.Append(echar);
- decPos--;
- sb.Append((decPos >= 0) ? nfi.PositiveSign : nfi.NegativeSign);
- if (decPos < 0) decPos *= -1;
- if (exp3flag) sb.Append('0');
- sb.Append((char)('0' + decPos/10));
- sb.Append((char)('0' + decPos%10));
-
- return sb.ToString();
- }
-
- private static string FormatGeneral(NumberFormatInfo nfi, StringBuilder sb,
- int digits, int decPos, int sign, char gchar)
- {
- int dig = digits;
- bool bFix = (digits == 0 && decPos >= -3) || (digits >= decPos && decPos >= -3 && digits != 0);
-
- // remove trailing digits
- while (sb.Length > 1 && (sb.Length > decPos || !bFix) && sb[sb.Length-1] == '0')
- {
- sb.Remove(sb.Length-1, 1);
- if (dig != 0) dig--;
- }
-
- if (bFix)
- {
- while (decPos <= 0)
- {
- sb.Insert(0, '0');
- if (dig != 0 && decPos != 0) dig++;
- decPos++;
- }
- return FormatFixedPoint(nfi, sb, sb.Length - decPos, decPos, sign);
- }
- else
- {
- return FormatExponential(nfi, sb, dig, decPos, sign, (char)(gchar-2), false);
- }
- }
-
- private static string FormatGroupAndDec(StringBuilder sb, int decimals, int decPos,
- int[] groupSizes, string groupSeparator, string decSeparator)
- {
- int offset = 0;
-
- // Groups
- if (decPos > 0)
- {
- if (groupSizes != null)
- {
- int lastSize = 0;
- int digitCount = 0;
- for (int i = 0; i < groupSizes.GetLength(0); i++)
- {
- int size = groupSizes[i];
- if (size > 0)
- {
- digitCount += size;
- if (digitCount < decPos)
- {
- sb.Insert(decPos - digitCount, groupSeparator);
- offset += groupSeparator.Length;
- }
- }
- lastSize = size;
- }
-
- if (lastSize > 0)
- {
- while (true)
- {
- digitCount +=lastSize;
- if (digitCount >= decPos) break;
- sb.Insert(decPos - digitCount, groupSeparator);
- offset += groupSeparator.Length;
- }
- }
- }
- }
-
- if (decimals > 0)
- {
- sb.Insert(offset + ((decPos <= 0) ? 1 : decPos), decSeparator);
- }
-
- return sb.ToString();
- }
-
- private static string FormatNumber(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- string s = FormatGroupAndDec(sb, decimals, decPos,
- nfi.NumberGroupSizes, nfi.NumberGroupSeparator, nfi.NumberDecimalSeparator);
-
- // sign
- if (sign != 0)
- {
- switch (nfi.NumberNegativePattern)
- {
- case 0:
- return "(" + s + ")";
- case 1:
- return nfi.NegativeSign + s;
- case 2:
- return nfi.NegativeSign + " " + s;
- case 3:
- return s + nfi.NegativeSign;
- case 4:
- return s + " " + nfi.NegativeSign;
- default:
- throw new ArgumentException(Locale.GetText ("Invalid NumberNegativePattern"));
- }
- }
- else
- {
- return s;
- }
- }
-
- private static string FormatCurrency(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- string s = FormatGroupAndDec(sb, decimals, decPos,
- nfi.CurrencyGroupSizes, nfi.CurrencyGroupSeparator, nfi.CurrencyDecimalSeparator);
-
- if (sign != 0)
- { // negative
- switch (nfi.CurrencyNegativePattern)
- {
- case 0:
- return "(" + nfi.CurrencySymbol + s + ")";
- case 1:
- return nfi.NegativeSign + nfi.CurrencySymbol + s;
- case 2:
- return nfi.CurrencySymbol + nfi.NegativeSign + s;
- case 3:
- return nfi.CurrencySymbol + s + nfi.NegativeSign;
- case 4:
- return "(" + s + nfi.CurrencySymbol + ")";
- case 5:
- return nfi.NegativeSign + s + nfi.CurrencySymbol;
- case 6:
- return s + nfi.NegativeSign + nfi.CurrencySymbol;
- case 7:
- return s + nfi.CurrencySymbol + nfi.NegativeSign;
- case 8:
- return nfi.NegativeSign + s + " " + nfi.CurrencySymbol;
- case 9:
- return nfi.NegativeSign + nfi.CurrencySymbol + " " + s;
- case 10:
- return s + " " + nfi.CurrencySymbol + nfi.NegativeSign;
- case 11:
- return nfi.CurrencySymbol + " " + s + nfi.NegativeSign;
- case 12:
- return nfi.CurrencySymbol + " " + nfi.NegativeSign + s;
- case 13:
- return s + nfi.NegativeSign + " " + nfi.CurrencySymbol;
- case 14:
- return "(" + nfi.CurrencySymbol + " " + s + ")";
- case 15:
- return "(" + s + " " + nfi.CurrencySymbol + ")";
- default:
- throw new ArgumentException(Locale.GetText ("Invalid CurrencyNegativePattern"));
- }
- }
- else
- {
- switch (nfi.CurrencyPositivePattern)
- {
- case 0:
- return nfi.CurrencySymbol + s;
- case 1:
- return s + nfi.CurrencySymbol;
- case 2:
- return nfi.CurrencySymbol + " " + s;
- case 3:
- return s + " " + nfi.CurrencySymbol;
- default:
- throw new ArgumentException(Locale.GetText ("Invalid CurrencyPositivePattern"));
- }
- }
- }
-
- private static string FormatPercent(NumberFormatInfo nfi, StringBuilder sb,
- int decimals, int decPos, int sign)
- {
- string s = FormatGroupAndDec(sb, decimals, decPos+2,
- nfi.PercentGroupSizes, nfi.PercentGroupSeparator, nfi.PercentDecimalSeparator);
-
- if (sign != 0)
- { // negative
- switch (nfi.PercentNegativePattern)
- {
- case 0:
- return nfi.NegativeSign + s + " " + nfi.PercentSymbol;
- case 1:
- return nfi.NegativeSign + s + nfi.PercentSymbol;
- case 2:
- return nfi.NegativeSign + nfi.PercentSymbol + s;
- default:
- throw new ArgumentException(Locale.GetText ("Invalid PercentNegativePattern"));
- }
- }
- else
- {
- switch (nfi.PercentPositivePattern)
- {
- case 0:
- return s + " " + nfi.PercentSymbol;
- case 1:
- return s + nfi.PercentSymbol;
- case 2:
- return nfi.PercentSymbol + s;
- default:
- throw new ArgumentException("Invalid PercentPositivePattern");
- }
- }
- }
-
- [MonoTODO]
- private static string FormatNormalized(NumberFormatInfo nfi, StringBuilder sb,
- int digits, int decPos, int sign)
- {
- //LAMESPEC: how should this format look like ? Is this a fixed point format ?
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs
deleted file mode 100644
index 5c332cd8cf4..00000000000
--- a/mcs/class/corlib/System/Delegate.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-//
-// System.Delegate.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement
-//
-
-using System;
-using System.Globalization;
-using System.Reflection;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [MonoTODO]
- public abstract class Delegate : ICloneable, ISerializable {
- protected Type target_type;
- protected object m_target;
- protected string method_name;
- protected IntPtr method_ptr;
- protected IntPtr delegate_trampoline;
- protected MethodInfo method_info;
-
- protected Delegate (object target, string method)
- {
- if (target == null)
- throw new ArgumentNullException (Locale.GetText ("Target object is null"));
-
- if (method == null)
- throw new ArgumentNullException (Locale.GetText ("method name is null"));
-
- this.target_type = null;
- this.method_ptr = IntPtr.Zero;
- this.m_target = target;
- this.method_name = method;
- }
-
- protected Delegate (Type target_type, string method)
- {
- if (m_target == null)
- throw new ArgumentNullException (Locale.GetText ("Target type is null"));
-
- if (method == null)
- throw new ArgumentNullException (Locale.GetText ("method string is null"));
-
- this.target_type = target_type;
- this.method_ptr = IntPtr.Zero;
- this.m_target = null;
- this.method_name = method;
- }
-
- public MethodInfo Method {
- get {
- return method_info;
- }
- }
-
- public object Target {
- get {
- return m_target;
- }
- }
-
- //
- // Methods
- //
-
- public object DynamicInvoke( object[] args )
- {
- return DynamicInvokeImpl( args );
- }
-
- public virtual object DynamicInvokeImpl( object[] args )
- {
- return Method.Invoke( m_target, args );
- }
-
- public virtual object Clone()
- {
- return MemberwiseClone();
- }
-
- public override bool Equals (object o)
- {
- if ( o == null )
- return false;
-
- if ( o.GetType() != this.GetType() )
- return false;
-
- Delegate d = (Delegate) o;
- if ((d.target_type == target_type) &&
- (d.m_target == m_target) &&
- (d.method_name == method_name) &&
- (d.method_ptr == method_ptr))
- return true;
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (int)method_ptr;
- }
-
- // This is from ISerializable
- [MonoTODO]
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- // TODO: IMPLEMENT ME
- }
-
- public virtual Delegate[] GetInvocationList()
- {
- return new Delegate[] { this };
- }
-
- /// <symmary>
- /// Returns a new MulticastDelegate holding the
- /// concatenated invocation lists of MulticastDelegates a and b
- /// </symmary>
- public static Delegate Combine (Delegate a, Delegate b)
- {
- if (a == null){
- if (b == null)
- return null;
- return b;
- } else
- if (b == null)
- return a;
-
- if (a.GetType () != b.GetType ())
- throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types"));
-
- return a.CombineImpl (b);
- }
-
- /// <symmary>
- /// Returns a new MulticastDelegate holding the
- /// concatenated invocation lists of an Array of MulticastDelegates
- /// </symmary>
- public static Delegate Combine( Delegate[] delegates )
- {
- Delegate retval = null;
-
- foreach ( Delegate next in delegates )
- retval = Combine( retval, next );
-
- return retval;
- }
-
-
- protected virtual Delegate CombineImpl (Delegate d)
- {
- throw new MulticastNotSupportedException ("");
- }
-
-
- public static Delegate Remove( Delegate source, Delegate value )
- {
- if ( source == null )
- return null;
-
- return source.RemoveImpl( value );
- }
-
- protected virtual Delegate RemoveImpl( Delegate d )
- {
- if ( this.Equals( d ) )
- return null;
-
- return this;
- }
-
- public static bool operator ==( Delegate a, Delegate b )
- {
- if ((object)a == null) {
- if ((object)b == null)
- return true;
- return false;
- }
- return a.Equals( b );
- }
-
- public static bool operator !=( Delegate a, Delegate b )
- {
- return !(a == b);
- }
- }
-}
diff --git a/mcs/class/corlib/System/DivideByZeroException.cs b/mcs/class/corlib/System/DivideByZeroException.cs
deleted file mode 100644
index 74582bb361d..00000000000
--- a/mcs/class/corlib/System/DivideByZeroException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.DivideByZeroException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class DivideByZeroException : ArithmeticException {
- // Constructors
- public DivideByZeroException ()
- : base (Locale.GetText ("Division by zero"))
- {
- }
-
- public DivideByZeroException (string message)
- : base (message)
- {
- }
-
- public DivideByZeroException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected DivideByZeroException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/DllNotFoundException.cs b/mcs/class/corlib/System/DllNotFoundException.cs
deleted file mode 100644
index cc332020623..00000000000
--- a/mcs/class/corlib/System/DllNotFoundException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.DllNotFoundException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class DllNotFoundException : TypeLoadException
- {
- // Constructors
- public DllNotFoundException ()
- : base (Locale.GetText ("DLL not found."))
- {
- }
-
- public DllNotFoundException (string message)
- : base (message)
- {
- }
-
- protected DllNotFoundException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public DllNotFoundException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Double.cs b/mcs/class/corlib/System/Double.cs
deleted file mode 100644
index 9983aedf901..00000000000
--- a/mcs/class/corlib/System/Double.cs
+++ /dev/null
@@ -1,428 +0,0 @@
-//
-// System.Double.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Bob Smith (bob@thestuff.net)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-// (C) Bob Smith. http://www.thestuff.net
-//
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- [Serializable]
- public struct Double : IComparable, IFormattable, IConvertible {
- public const double Epsilon = 4.9406564584124650e-324;
- public const double MaxValue = 1.7976931348623157e308;
- public const double MinValue = -1.7976931348623157e308;
- public const double NaN = 0.0d / 0.0d;
- public const double NegativeInfinity = -1.0d / 0.0d;
- public const double PositiveInfinity = 1.0d / 0.0d;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public double value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Double))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Double"));
-
- if (IsPositiveInfinity(value) && IsPositiveInfinity((double) v)){
- return 0;
- }
-
- if (IsNegativeInfinity(value) && IsNegativeInfinity((double) v)){
- return 0;
- }
-
- if (IsNaN((double) v)) {
- if (IsNaN(value))
- return 0;
- else
- return 1;
- }
-
- return (int) (value - ((double) v));
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Double))
- return false;
-
- if (IsNaN ((double)o)) {
- if (IsNaN(value))
- return true;
- else
- return false;
- }
-
- return ((double) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- public static bool IsInfinity (double d)
- {
- return (d == PositiveInfinity || d == NegativeInfinity);
- }
-
- public static bool IsNaN (double d)
- {
- return (d != d);
- }
-
- public static bool IsNegativeInfinity (double d)
- {
- return (d < 0.0d && (d == NegativeInfinity || d == PositiveInfinity));
- }
-
- public static bool IsPositiveInfinity (double d)
- {
- return (d > 0.0d && (d == NegativeInfinity || d == PositiveInfinity));
- }
-
- public static double Parse (string s)
- {
- return Parse (s, (NumberStyles.Float | NumberStyles.AllowThousands), null);
- }
-
- public static double Parse (string s, IFormatProvider fp)
- {
- return Parse (s, (NumberStyles.Float | NumberStyles.AllowThousands), fp);
- }
-
- public static double Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- // We're intentionally using constants here to avoid some bigger headaches in mcs.
- // This struct must be compiled before System.Enum so we can't use enums here.
- private const int State_AllowSign = 1;
- private const int State_Digits = 2;
- private const int State_Decimal = 3;
- private const int State_ExponentSign = 4;
- private const int State_Exponent = 5;
- private const int State_ConsumeWhiteSpace = 6;
-
- [MonoTODO("check if digits are group in correct numbers between the group separators")]
- public static double Parse (string s, NumberStyles style, IFormatProvider provider)
- {
- if (s == null) throw new ArgumentNullException();
- if (style > NumberStyles.Any)
- {
- throw new ArgumentException();
- }
- NumberFormatInfo format = NumberFormatInfo.GetInstance(provider);
- if (format == null) throw new Exception("How did this happen?");
- if (s == format.NaNSymbol) return Double.NaN;
- if (s == format.PositiveInfinitySymbol) return Double.PositiveInfinity;
- if (s == format.NegativeInfinitySymbol) return Double.NegativeInfinity;
-
- //
- // validate and prepare string for C
- //
- int len = s.Length;
- byte [] b = new byte [len + 1];
- int didx = 0;
- int sidx = 0;
- char c;
-
- if ((style & NumberStyles.AllowLeadingWhite) != 0){
- while (sidx < len && Char.IsWhiteSpace (c = s [sidx]))
- sidx++;
-
- if (sidx == len)
- throw new FormatException();
- }
-
- bool allow_trailing_white = ((style & NumberStyles.AllowTrailingWhite) != 0);
-
- //
- // Machine state
- //
- int state = State_AllowSign;
-
- //
- // Setup
- //
- string decimal_separator = null;
- string group_separator = null;
- int decimal_separator_len = 0;
- int group_separator_len = 0;
- if ((style & NumberStyles.AllowDecimalPoint) != 0){
- decimal_separator = format.NumberDecimalSeparator;
- decimal_separator_len = decimal_separator.Length;
- }
- if ((style & NumberStyles.AllowThousands) != 0){
- group_separator = format.NumberGroupSeparator;
- group_separator_len = group_separator.Length;
- }
- string positive = format.PositiveSign;
- string negative = format.NegativeSign;
-
- for (; sidx < len; sidx++){
- c = s [sidx];
-
- switch (state){
- case State_AllowSign:
- if ((style & NumberStyles.AllowLeadingSign) != 0){
- if (c == positive [0] &&
- s.Substring (sidx, positive.Length) == positive){
- state = State_Digits;
- sidx += positive.Length-1;
- continue;
- }
-
- if (c == negative [0] &&
- s.Substring (sidx, negative.Length) == negative){
- state = State_Digits;
- b [didx++] = (byte) '-';
- sidx += negative.Length-1;
- continue;
- }
- }
- state = State_Digits;
- goto case State_Digits;
-
- case State_Digits:
- if (Char.IsDigit (c)){
- b [didx++] = (byte) c;
- break;
- }
- if (c == 'e' || c == 'E')
- goto case State_Decimal;
-
- if (decimal_separator != null &&
- decimal_separator [0] == c){
- if (s.Substring (sidx, decimal_separator_len) ==
- decimal_separator){
- b [didx++] = (byte) '.';
- sidx += decimal_separator_len-1;
- state = State_Decimal;
- break;
- }
- }
- if (group_separator != null &&
- group_separator [0] == c){
- if (s.Substring (sidx, group_separator_len) ==
- group_separator){
- sidx += group_separator_len-1;
- state = State_Digits;
- break;
- }
- }
-
- if (Char.IsWhiteSpace (c))
- goto case State_ConsumeWhiteSpace;
-
- throw new FormatException ("Unknown char: " + c);
-
- case State_Decimal:
- if (Char.IsDigit (c)){
- b [didx++] = (byte) c;
- break;
- }
-
- if (c == 'e' || c == 'E'){
- if ((style & NumberStyles.AllowExponent) == 0)
- throw new FormatException ("Unknown char: " + c);
- b [didx++] = (byte) c;
- state = State_ExponentSign;
- break;
- }
-
- if (Char.IsWhiteSpace (c))
- goto case State_ConsumeWhiteSpace;
- throw new FormatException ("Unknown char: " + c);
-
- case State_ExponentSign:
- if (Char.IsDigit (c)){
- state = State_Exponent;
- goto case State_Exponent;
- }
-
- if (c == positive [0] &&
- s.Substring (sidx, positive.Length) == positive){
- state = State_Digits;
- sidx += positive.Length-1;
- continue;
- }
-
- if (c == negative [0] &&
- s.Substring (sidx, negative.Length) == negative){
- state = State_Digits;
- b [didx++] = (byte) '-';
- sidx += negative.Length-1;
- continue;
- }
-
- if (Char.IsWhiteSpace (c))
- goto case State_ConsumeWhiteSpace;
-
- throw new FormatException ("Unknown char: " + c);
-
- case State_Exponent:
- if (Char.IsDigit (c)){
- b [didx++] = (byte) c;
- break;
- }
-
- if (Char.IsWhiteSpace (c))
- goto case State_ConsumeWhiteSpace;
- throw new FormatException ("Unknown char: " + c);
-
- case State_ConsumeWhiteSpace:
- if (allow_trailing_white && Char.IsWhiteSpace (c))
- break;
- throw new FormatException ("Unknown char");
- }
- }
-
- b [didx] = 0;
- unsafe {
- fixed (byte *p = &b [0]){
- double retVal = ParseImpl (p);
- if (IsPositiveInfinity(retVal) || IsNegativeInfinity(retVal))
- throw new OverflowException();
-
- return retVal;
- }
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe private static extern double ParseImpl (byte *byte_ptr);
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- [MonoTODO]
- public string ToString (string format, IFormatProvider fp)
- {
- // FIXME: Need to pass format and provider info to this call too.
- return ToStringImpl(value);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern string ToStringImpl (double value);
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Double;
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType(value, conversionType, provider);
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean(value);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte(value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- [CLSCompliant(false)]
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- throw new InvalidCastException();
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal(value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble(value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16(value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32(value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64(value);
- }
-
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte(value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle(value);
- }
-
-/*
- string IConvertible.ToString (IFormatProvider provider)
- {
- return ToString(provider);
- }
-*/
-
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16(value);
- }
-
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32(value);
- }
-
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64(value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/DuplicateWaitObjectException.cs b/mcs/class/corlib/System/DuplicateWaitObjectException.cs
deleted file mode 100644
index beddfd0c5ac..00000000000
--- a/mcs/class/corlib/System/DuplicateWaitObjectException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.DuplicateWaitObjectException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class DuplicateWaitObjectException : ArgumentException {
- // Constructors
- public DuplicateWaitObjectException ()
- : base (Locale.GetText ("Duplicate objects in argument"))
- {
- }
-
- public DuplicateWaitObjectException (string param_name)
- : base (Locale.GetText ("Duplicate objects in argument"), param_name)
- {
- }
-
- public DuplicateWaitObjectException (string param_name, string message)
- : base (message, param_name)
- {
- }
-
- protected DuplicateWaitObjectException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/EntryPointNotFoundException.cs b/mcs/class/corlib/System/EntryPointNotFoundException.cs
deleted file mode 100644
index 672d5261490..00000000000
--- a/mcs/class/corlib/System/EntryPointNotFoundException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.EntryPointNotFoundException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class EntryPointNotFoundException : TypeLoadException
- {
- // Constructors
- public EntryPointNotFoundException ()
- : base (Locale.GetText ("Cannot load class because of missing entry method."))
- {
- }
-
- public EntryPointNotFoundException (string message)
- : base (message)
- {
- }
-
- protected EntryPointNotFoundException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public EntryPointNotFoundException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/Enum.cs b/mcs/class/corlib/System/Enum.cs
deleted file mode 100644
index 8f7d67fec04..00000000000
--- a/mcs/class/corlib/System/Enum.cs
+++ /dev/null
@@ -1,557 +0,0 @@
-//
-// System.Enum.cs
-//
-// Authors:
-// Miguel de Icaza (miguel@ximian.com)
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System.Collections;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
- internal struct MonoEnumInfo {
- internal Type utype;
- internal Array values;
- internal string[] names;
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void get_enum_info (Type enumType, out MonoEnumInfo info);
-
- internal static void GetInfo (Type enumType, out MonoEnumInfo info) {
- get_enum_info (enumType, out info);
- Array.Sort (info.values, info.names);
- }
- };
-
- [MonoTODO]
- public abstract class Enum : ValueType, IComparable, IConvertible {
-
- // IConvertible methods Start -->
-
- [CLSCompliant(false)]
- public TypeCode GetTypeCode () {
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (this.GetType (), out info);
- return Type.GetTypeCode (info.utype);
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return Convert.ToBoolean (get_value (), provider);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return Convert.ToByte (get_value (), provider);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return Convert.ToChar (get_value (), provider);
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return Convert.ToDateTime (get_value (), provider);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return Convert.ToDecimal (get_value (), provider);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return Convert.ToDouble (get_value (), provider);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return Convert.ToInt16 (get_value (), provider);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return Convert.ToInt32 (get_value (), provider);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return Convert.ToInt64 (get_value (), provider);
- }
-
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return Convert.ToSByte (get_value (), provider);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return Convert.ToSingle (get_value (), provider);
- }
-
- [MonoTODO]
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- throw new NotImplementedException ();
- }
-
- [CLSCompliant(false)]
- public ushort ToUInt16 (IFormatProvider provider)
- {
- return Convert.ToUInt16 (get_value (), provider);
- }
-
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return Convert.ToUInt32 (get_value (), provider);
- }
-
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return Convert.ToUInt64 (get_value (), provider);
- }
-
- // <-- End IConvertible methods
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern object get_value ();
-
- public static Array GetValues (Type enumType) {
- if (null == enumType)
- throw new ArgumentNullException ("enumType cannot be null.");
-
- if (!enumType.IsEnum)
- throw new ArgumentException ("enumType is not an Enum type.");
-
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
- return info.values;
- }
-
- public static string[] GetNames (Type enumType) {
- if (null == enumType)
- throw new ArgumentNullException ("enumType cannot be null.");
-
- if (!enumType.IsEnum)
- throw new ArgumentException ("enumType is not an Enum type.");
-
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
- return info.names;
- }
-
- public static string GetName (Type enumType, object value) {
- if (null == enumType)
- throw new ArgumentNullException ("enumType cannot be null.");
- if (null == value)
- throw new ArgumentNullException ("value cannot be null.");
-
- if (!enumType.IsEnum)
- throw new ArgumentException ("enumType is not an Enum type.");
-
- MonoEnumInfo info;
- int i;
- value = ToObject (enumType, value);
- MonoEnumInfo.GetInfo (enumType, out info);
- for (i = 0; i < info.values.Length; ++i) {
- if (value.Equals (info.values.GetValue (i)))
- return info.names [i];
- }
- return null;
- }
-
- public static bool IsDefined (Type enumType, object value) {
- if (null == enumType)
- throw new ArgumentNullException ("enumType cannot be null.");
- if (null == value)
- throw new ArgumentNullException ("value cannot be null.");
-
- if (!enumType.IsEnum)
- throw new ArgumentException ("enumType is not an Enum type.");
-
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
-
- Type vType = value.GetType ();
- if (vType == typeof(String)) {
- return ((IList)(info.names)).Contains (value);
- } else if ((vType == info.utype) || (vType == enumType)) {
- int i;
- value = ToObject (enumType, value);
- MonoEnumInfo.GetInfo (enumType, out info);
- for (i = 0; i < info.values.Length; ++i) {
- if (value.Equals (info.values.GetValue (i)))
- return true;
- }
- return false;
- } else {
- throw new ArgumentException("The value parameter is not the correct type."
- + "It must be type String or the same type as the underlying type"
- + "of the Enum.");
- }
-
-
- }
-
- public static Type GetUnderlyingType (Type enumType) {
- if (null == enumType)
- throw new ArgumentNullException ("enumType cannot be null.");
-
- if (!enumType.IsEnum)
- throw new ArgumentException ("enumType is not an Enum type.");
-
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
- return info.utype;
- }
-
- public static object Parse (Type enumType, string value)
- {
- // Note: Parameters are checked in the other overload
- return Parse (enumType, value, false);
- }
-
- public static object Parse (Type enumType, string value, bool ignoreCase)
- {
- if (null == enumType)
- throw new ArgumentNullException ("enumType cannot be null.");
-
- if (null == value)
- throw new ArgumentNullException ("value cannot be null.");
-
- if (!enumType.IsEnum)
- throw new ArgumentException ("enumType is not an Enum type.");
-
- if (String.Empty == value.Trim())
- throw new ArgumentException ("value cannot be empty string.");
-
- MonoEnumInfo info;
- int i;
- MonoEnumInfo.GetInfo (enumType, out info);
-
- long retVal = 0;
- string[] names = value.Split(new char[] {','});
- TypeCode typeCode = ((Enum) info.values.GetValue (0)).GetTypeCode ();
- foreach (string name in names) {
- bool found = false;
- for (i = 0; i < info.values.Length; ++i) {
- if (String.Compare (name, info.names [i], ignoreCase) == 0) {
- switch (typeCode) {
- case TypeCode.Byte:
- retVal |= (long)((byte)info.values.GetValue (i));
- break;
- case TypeCode.SByte:
- retVal |= (long)((SByte)info.values.GetValue (i));
- break;
- case TypeCode.Int16:
- retVal |= (long)((short)info.values.GetValue (i));
- break;
- case TypeCode.Int32:
- retVal |= (long)((int)info.values.GetValue (i));
- break;
- case TypeCode.Int64:
- retVal |= (long)info.values.GetValue (i);
- break;
- case TypeCode.UInt16:
- retVal |= (long)((UInt16)info.values.GetValue (i));
- break;
- case TypeCode.UInt32:
- retVal |= (long)((UInt32)info.values.GetValue (i));
- break;
- case TypeCode.UInt64:
- retVal |= (long)((UInt64)info.values.GetValue (i));
- break;
- }
- found = true;
- break;
- }
- }
- if (!found)
- throw new ArgumentException ("The requested value was not found");
-
- }
- return ToObject(enumType, retVal);
- }
-
- /// <summary>
- /// Compares the enum value with another enum value of the same type.
- /// </summary>
- ///
- /// <remarks>
- ///
- public int CompareTo (object obj)
- {
- Type thisType;
-
- if (obj == null)
- return 1;
-
- thisType = this.GetType();
- if (obj.GetType() != thisType){
- throw new ArgumentException(
- "Object must be the same type as the "
- + "enum. The type passed in was "
- + obj.GetType().ToString()
- + "; the enum type was "
- + thisType.ToString() + ".");
- }
-
- object value1, value2;
-
- value1 = this.get_value ();
- value2 = ((Enum)obj).get_value();
-
- return ((IComparable)value1).CompareTo (value2);
- }
-
- public override string ToString ()
- {
- return ToString ("G", null);
- }
-
- public string ToString (IFormatProvider provider)
- {
- return ToString ("G", provider);
- }
-
- public string ToString (String format)
- {
- return ToString (format, null);
- }
-
- [MonoTODO]
- public string ToString (String format, IFormatProvider provider)
- {
- // provider is not used for Enums
-
- if (format == String.Empty || format == null){
- format = "G";
- }
- return Format (this.GetType(), this.get_value (), format);
- }
-
- public static object ToObject(Type enumType, byte value)
- {
- return ToObject (enumType, (object)value);
- }
-
- public static object ToObject(Type enumType, short value)
- {
- return ToObject (enumType, (object)value);
- }
- public static object ToObject(Type enumType, int value)
- {
- return ToObject (enumType, (object)value);
- }
- public static object ToObject(Type enumType, long value)
- {
- return ToObject (enumType, (object)value);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public static extern object ToObject(Type enumType, object value);
-
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, sbyte value)
- {
- return ToObject (enumType, (object)value);
- }
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, ushort value)
- {
- return ToObject (enumType, (object)value);
- }
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, uint value)
- {
- return ToObject (enumType, (object)value);
- }
- [CLSCompliant(false)]
- public static object ToObject(Type enumType, ulong value)
- {
- return ToObject (enumType, (object)value);
- }
-
- public override bool Equals (object obj)
- {
- if (null == obj)
- return false;
-
- if (obj.GetType() != this.GetType())
- return false;
-
- object v1 = this.get_value ();
- object v2 = ((Enum)obj).get_value ();
-
- return v1.Equals (v2);
- }
-
- public override int GetHashCode ()
- {
- object v = this.get_value ();
- return v.GetHashCode ();
- }
-
- [MonoTODO]
- public static string Format (Type enumType, object value, string format)
- {
- if (null == enumType)
- throw new ArgumentNullException("enumType cannot be null");
- if (null == value)
- throw new ArgumentNullException("value cannot be null");
- if (null == format)
- throw new ArgumentNullException("format cannot be null");
-
- if (!enumType.IsEnum)
- throw new ArgumentException("enumType is not an Enum Type");
-
- Type vType = value.GetType();
- if (vType != enumType && vType != Enum.GetUnderlyingType(enumType))
- throw new ArgumentException();
-
-
- if (format.Length != 1)
- throw new FormatException ("Format String can be only \"G\",\"g\",\"X\"," +
- "\"x\",\"F\",\"f\",\"D\" or \"d\".");
-
- char formatChar = format [0];
- if ((formatChar == 'G' || formatChar == 'g')
- && Attribute.IsDefined(enumType, typeof(FlagsAttribute)))
- formatChar = 'F';
-
- string retVal = "";
- switch (formatChar) {
- case 'G':
- case 'g':
- retVal = GetName (enumType, value);
- if (retVal == null)
- retVal = value.ToString();
- break;
- case 'X':
- case 'x':
- retVal = value.ToString();
- long xValue = Int64.Parse(retVal);
- // FIXME: Not sure if padding should always be with precision
- // 8, if it's culture specific, or what. This works for me.
- retVal = xValue.ToString("x8");
- break;
- case 'D':
- case 'd':
- retVal = value.ToString();
- break;
- case 'F':
- case 'f':
- MonoEnumInfo info;
- MonoEnumInfo.GetInfo (enumType, out info);
- // This is ugly, yes. We need to handle the different integer
- // types for enums. If someone else has a better idea, be my guest.
- switch (((Enum)info.values.GetValue (0)).GetTypeCode()) {
- case TypeCode.Byte:
- byte byteFlag = (byte)value;
- byte byteenumValue;
- for (int i = info.values.Length-1; i>=0 && byteFlag != 0; i--) {
- byteenumValue = (byte)info.values.GetValue (i);
- if ((byteenumValue & byteFlag) == byteenumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- byteFlag -= byteenumValue;
- }
- }
- break;
- case TypeCode.SByte:
- SByte sbyteFlag = (SByte)value;
- SByte sbyteenumValue;
- for (int i = info.values.Length-1; i>=0 && sbyteFlag != 0; i--) {
- sbyteenumValue = (SByte)info.values.GetValue (i);
- if ((sbyteenumValue & sbyteFlag) == sbyteenumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- sbyteFlag -= sbyteenumValue;
- }
- }
- break;
- case TypeCode.Int16:
- short Int16Flag = (short)value;
- short Int16enumValue;
- for (int i = info.values.Length-1; i>=0 && Int16Flag != 0; i--) {
- Int16enumValue = (short)info.values.GetValue (i);
- if ((Int16enumValue & Int16Flag) == Int16enumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- Int16Flag -= Int16enumValue;
- }
- }
- break;
- case TypeCode.Int32:
- int Int32Flag = (int)value;
- int Int32enumValue;
- for (int i = info.values.Length-1; i>=0 && Int32Flag != 0; i--) {
- Int32enumValue = (int)info.values.GetValue (i);
- if ((Int32enumValue & Int32Flag) == Int32enumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- Int32Flag -= Int32enumValue;
- }
- }
- break;
- case TypeCode.Int64:
- long Int64Flag = (long)value;
- long Int64enumValue;
- for (int i = info.values.Length-1; i>=0 && Int64Flag != 0; i--) {
- Int64enumValue = (long)info.values.GetValue (i);
- if ((Int64enumValue & Int64Flag) == Int64enumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- Int64Flag -= Int64enumValue;
- }
- }
- break;
- case TypeCode.UInt16:
- UInt16 UInt16Flag = (UInt16)value;
- UInt16 UInt16enumValue;
- for (int i = info.values.Length-1; i>=0 && UInt16Flag != 0; i--) {
- UInt16enumValue = (UInt16)info.values.GetValue (i);
- if ((UInt16enumValue & UInt16Flag) == UInt16enumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- UInt16Flag -= UInt16enumValue;
- }
- }
- break;
- case TypeCode.UInt32:
- UInt32 UInt32Flag = (UInt32)value;
- UInt32 UInt32enumValue;
- for (int i = info.values.Length-1; i>=0 && UInt32Flag != 0; i--) {
- UInt32enumValue = (UInt32)info.values.GetValue (i);
- if ((UInt32enumValue & UInt32Flag) == UInt32enumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- UInt32Flag -= UInt32enumValue;
- }
- }
- break;
- case TypeCode.UInt64:
- UInt64 UInt64Flag = (UInt64)value;
- UInt64 UInt64enumValue;
- for (int i = info.values.Length-1; i>=0 && UInt64Flag != 0; i--) {
- UInt64enumValue = (UInt64)info.values.GetValue (i);
- if ((UInt64enumValue & UInt64Flag) == UInt64enumValue){
- retVal = info.names[i] + (retVal == String.Empty ? "" : ", ") + retVal;
- UInt64Flag -= UInt64enumValue;
- }
- }
- break;
- }
- break;
- default:
- throw new FormatException ("Format String can be only \"G\",\"g\",\"X\"," +
- "\"x\",\"F\",\"f\",\"D\" or \"d\".");
- }
-
- return retVal;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Environment.cs b/mcs/class/corlib/System/Environment.cs
deleted file mode 100644
index ccb608bff74..00000000000
--- a/mcs/class/corlib/System/Environment.cs
+++ /dev/null
@@ -1,291 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.Environment.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Dan Lewis (dihlewis@yahoo.co.uk)
-// Created: Saturday, August 11, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.IO;
-//using System.Diagnostics;
-using System.Collections;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-
-namespace System
-{
- public sealed class Environment
- {
- private Environment () {}
-
- [MonoTODO]
- public enum SpecialFolder
- { // TODO: Determine if these windoze style folder identifiers
- // have unix/linux counterparts
- Programs = 0x02,
- Personal = 0x05,
- Favorites = 0x06,
- Startup = 0x07,
- Recent = 0x08,
- SendTo = 0x09,
- StartMenu = 0x0b,
- DesktopDirectory = 0x10,
- Templates = 0x15,
- ApplicationData = 0x1a,
- LocalApplicationData = 0x1c,
- InternetCache = 0x20,
- Cookies = 0x21,
- History = 0x22,
- CommonApplicationData = 0x23,
- System = 0x25,
- ProgramFiles = 0x26,
- CommonProgramFiles = 0x2b,
- }
-
- // TODO: Make sure the security attributes do what I expect
-
- /// <summary>
- /// Gets the command line for this process
- /// </summary>
- public static string CommandLine
- { // TODO: Coordinate with implementor of EnvironmentPermissionAttribute
- // [EnvironmentPermissionAttribute(SecurityAction.Demand, Read = "COMMANDLINE")]
- get
- {
- // FIXME: we may need to quote, but any sane person
- // should use GetCommandLineArgs () instead.
- return String.Join (" ", GetCommandLineArgs ());
- }
- }
-
- /// <summary>
- /// Gets or sets the current directory. Actually this is supposed to get
- /// and/or set the process start directory acording to the documentation
- /// but actually test revealed at beta2 it is just Getting/Setting the CurrentDirectory
- /// </summary>
- public static string CurrentDirectory
- {
- // originally it was my thought that the external call would be made in
- // the directory class however that class has additional security requirements
- // so the Directory class will call this class for its get/set current directory
-
- // [EnvironmentPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
- get
- {
- return MonoIO.GetCurrentDirectory ();
- }
- [MonoTODO("disabled because of compile error. Need mcs magic.")]
- //[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- set
- {
- MonoIO.SetCurrentDirectory (value);
- }
- }
-
- /// <summary>
- /// Gets or sets the exit code of this process
- /// </summary>
- [MonoTODO]
- public static int ExitCode
- { // TODO: find a way to implement this property
- get
- {
- throw new NotImplementedException ();
- }
- set
- {
- throw new NotImplementedException ();
- }
- }
-
- /// <summary>
- /// Gets the name of the local computer
- /// </summary>
- public extern static string MachineName {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- /// <summary>
- /// Gets the standard new line value
- /// </summary>
- public extern static string NewLine {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- /// <summary>
- /// Gets the current OS version information
- /// </summary>
- [MonoTODO]
- public static OperatingSystem OSVersion {
- get
- {
- return null;
- }
- }
-
- /// <summary>
- /// Get StackTrace
- /// </summary>
- public static string StackTrace {
- get {
- try {
- throw new Exception ();
- } catch (Exception e) {
- return e.StackTrace;
- }
- }
- }
-
- /// <summary>
- /// Get a fully qualified path to the system directory
- /// </summary>
- public static string SystemDirectory
- {
- get
- {
- return GetFolderPath(SpecialFolder.System);
- }
- }
-
- /// <summary>
- /// Get the number of milliseconds that have elapsed since the system was booted
- /// </summary>
- public extern static int TickCount {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
- }
-
- /// <summary>
- /// Get UserDomainName
- /// </summary>
- [MonoTODO]
- public static string UserDomainName {
- get {
- return MachineName;
- }
- }
-
- /// <summary>
- /// Gets a flag indicating whether the process is in interactive mode
- /// </summary>
- [MonoTODO]
- public static bool UserInteractive
- {
- get
- {
- return false;
- }
- }
-
- /// <summary>
- /// Get the user name of current process is running under
- /// </summary>
- [MonoTODO]
- public static string UserName
- {
- get
- {
- // TODO: needs more research/work/thought
- string result = GetEnvironmentVariable("USERNAME");
- if(result == null || result.Equals(string.Empty))
- {
- result = GetEnvironmentVariable("USER");
- }
- return result;
- }
- }
-
- /// <summary>
- /// Get the version of the common language runtime
- /// </summary>
- [MonoTODO]
- public static Version Version {
- get {
- return new Version();
- }
- }
-
- /// <summary>
- /// Get the amount of physical memory mapped to process
- /// </summary>
- [MonoTODO]
- public static long WorkingSet
- {
- get
- {
- return 0;
- }
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static void Exit(int exitCode);
-
- /// <summary>
- /// Substitute environment variables in the argument "name"
- /// </summary>
- [MonoTODO]
- public static string ExpandEnvironmentVariables(string name)
- {
- return name;
- }
-
- /// <summary>
- /// Return an array of the command line arguments of the current process
- /// </summary>
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static string[] GetCommandLineArgs();
-
- /// <summary>
- /// Return a string containing the value of the environment
- /// variable identifed by parameter "variable"
- /// </summary>
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static string GetEnvironmentVariable (string name);
-
- /// <summary>
- /// Return a set of all environment variables and their values
- /// </summary>
-
- public static IDictionary GetEnvironmentVariables()
- {
- Hashtable vars = new Hashtable ();
- foreach (string name in GetEnvironmentVariableNames ())
- vars [name] = GetEnvironmentVariable (name);
-
- return vars;
- }
-
- /// <summary>
- /// Returns the fully qualified path of the
- /// folder specified by the "folder" parameter
- /// </summary>
- [MonoTODO]
- public static string GetFolderPath(SpecialFolder folder)
- {
- return null;
- }
-
- /// <summary>
- /// Returns an array of the logical drives
- /// </summary>
- [MonoTODO]
- public static string[] GetLogicalDrives()
- {
- return null;
- }
-
- // private methods
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- private extern static string [] GetEnvironmentVariableNames ();
-
- }
-}
diff --git a/mcs/class/corlib/System/EventArgs.cs b/mcs/class/corlib/System/EventArgs.cs
deleted file mode 100644
index c2460152d2e..00000000000
--- a/mcs/class/corlib/System/EventArgs.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.EventArgs.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Mon 07/16/2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System {
-
- [Serializable]
- public class EventArgs
- {
- public static readonly EventArgs Empty = new EventArgs();
-
- public EventArgs() { }
- }
-
-} // System
-
-
diff --git a/mcs/class/corlib/System/EventHandler.cs b/mcs/class/corlib/System/EventHandler.cs
deleted file mode 100644
index 407255b604e..00000000000
--- a/mcs/class/corlib/System/EventHandler.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.EventHandler.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public delegate void EventHandler (object sender, EventArgs e);
-
-}
-
-
diff --git a/mcs/class/corlib/System/Exception.cs b/mcs/class/corlib/System/Exception.cs
deleted file mode 100644
index cd951f302b9..00000000000
--- a/mcs/class/corlib/System/Exception.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-//
-// System.Exception.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Reflection;
-
-namespace System {
-
- [Serializable]
-// [ClassInterface (ClassInterfaceType.AutoDual)] (no implementation yet)
- [MonoTODO]
- public class Exception : ISerializable {
- IntPtr [] trace_ips;
- Exception inner_exception;
- string message;
- string help_link;
- string class_name;
- string stack_trace = "TODO: implement stack traces";
- string remote_stack_trace = "TODO: Implement remote stack trace";
- int remote_stack_index;
- int hresult;
- string source;
-
- public Exception ()
- {
- inner_exception = null;
- message = "";
- }
-
- public Exception (string msg)
- {
- inner_exception = null;
- message = msg;
- }
-
- protected Exception (SerializationInfo info, StreamingContext sc)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- class_name = info.GetString ("ClassName");
- message = info.GetString ("Message");
- inner_exception = (Exception) info.GetValue ("InnerException", typeof (Exception));
- help_link = info.GetString ("HelpURL");
- stack_trace = info.GetString ("StackTraceString");
- remote_stack_trace = info.GetString ("RemoteStackTrace");
- remote_stack_index = info.GetInt32 ("RemoteStackIndex");
- hresult = info.GetInt32 ("HResult");
- source = info.GetString ("Source");
- }
-
- public Exception (string msg, Exception e)
- {
- inner_exception = e;
- message = msg;
- }
-
- public Exception InnerException {
- get {
- return inner_exception;
- }
- }
-
- public virtual string HelpLink {
- get {
- return help_link;
- }
-
- set {
- help_link = value;
- }
- }
-
- protected int HResult {
- get {
- return hresult;
- }
-
- set {
- hresult = value;
- }
- }
-
- public virtual string Message {
- get {
- return message;
- }
- }
-
- [MonoTODO]
- public virtual string Source {
- get {
- // TODO: if source is null, we must return
- // the name of the assembly where the error
- // originated.
- return source;
- }
-
- set {
- source = value;
- }
- }
-
- public virtual string StackTrace {
- get {
- return stack_trace;
- }
- }
-
- [MonoTODO]
- public MethodBase TargetSite {
- get {
- // TODO: Implement this.
- return null;
- }
- }
-
- public virtual Exception GetBaseException ()
- {
- Exception inner = inner_exception;
-
- while (inner != null){
- if (inner.InnerException != null)
- inner = inner.InnerException;
- else
- return inner;
- }
-
- return this;
- }
-
- public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("ClassName", class_name);
- info.AddValue ("Message", message);
- info.AddValue ("InnerException", inner_exception);
- info.AddValue ("HelpURL", help_link);
- info.AddValue ("StackTraceString", stack_trace);
- info.AddValue ("RemoteStackTrace", remote_stack_trace);
- info.AddValue ("RemoteStackIndex", remote_stack_index);
- info.AddValue ("HResult", hresult);
- info.AddValue ("Source", source);
- }
-
- public override string ToString ()
- {
- return this.GetType ().FullName + "\n" +
- message +
- GetBaseException ().GetType ().FullName +
- stack_trace;
- }
- }
-}
-
diff --git a/mcs/class/corlib/System/ExecutionEngineException.cs b/mcs/class/corlib/System/ExecutionEngineException.cs
deleted file mode 100644
index f005ecb70f0..00000000000
--- a/mcs/class/corlib/System/ExecutionEngineException.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.ExecutionEngineException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- [Serializable]
- 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 inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/FieldAccessException.cs b/mcs/class/corlib/System/FieldAccessException.cs
deleted file mode 100644
index 342a405ddd6..00000000000
--- a/mcs/class/corlib/System/FieldAccessException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.FieldAccessException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class FieldAccessException : MemberAccessException
- {
- // Constructors
- public FieldAccessException ()
- : base (Locale.GetText ("Attempt to access a private/protected field failed."))
- {
- }
-
- public FieldAccessException (string message)
- : base (message)
- {
- }
-
- protected FieldAccessException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public FieldAccessException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/FlagsAttribute.cs b/mcs/class/corlib/System/FlagsAttribute.cs
deleted file mode 100755
index 8c2b40defa0..00000000000
--- a/mcs/class/corlib/System/FlagsAttribute.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// System.FlagsAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-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)]
- [Serializable]
- public class FlagsAttribute : Attribute {
-
- // No methods.
-
- }
-}
diff --git a/mcs/class/corlib/System/FormatException.cs b/mcs/class/corlib/System/FormatException.cs
deleted file mode 100644
index 2140db44359..00000000000
--- a/mcs/class/corlib/System/FormatException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.FormatException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class FormatException : SystemException {
- // Constructors
- public FormatException ()
- : base (Locale.GetText ("Invalid format"))
- {
- }
-
- public FormatException (string message)
- : base (message)
- {
- }
-
- public FormatException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected FormatException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/GC.cs b/mcs/class/corlib/System/GC.cs
deleted file mode 100755
index f478a1f1589..00000000000
--- a/mcs/class/corlib/System/GC.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-//
-// System/GC.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System {
- public sealed class GC {
-
- private GC () {}
-
- /* as long as we use Boehm... */
- public static int MaxGeneration {
- get {return 0;}
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- extern static void InternalCollect (int generation);
-
- public static void Collect () {
- InternalCollect (MaxGeneration);
- }
-
- public static void Collect (int generation) {
- if (generation < 0 || generation > MaxGeneration)
- throw new ArgumentOutOfRangeException ("generation");
- InternalCollect (generation);
- }
-
- public static int GetGeneration (object obj) {
- return 0;
- }
-
- public static int GetGeneration (WeakReference wo) {
- if (!wo.IsAlive)
- throw new ArgumentException ();
- return 0;
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static long GetTotalMemory (bool forceFullCollection);
-
- /* this icall has weird semantics check the docs... */
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static void KeepAlive (object obj);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static void ReRegisterForFinalize (object obj);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static void SuppressFinalize (object obj);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static void WaitForPendingFinalizers();
-
- }
-}
diff --git a/mcs/class/corlib/System/Guid.cs b/mcs/class/corlib/System/Guid.cs
deleted file mode 100755
index 5f15c707ce0..00000000000
--- a/mcs/class/corlib/System/Guid.cs
+++ /dev/null
@@ -1,654 +0,0 @@
-//
-// System.Guid
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using System.Globalization;
-using System.Security.Cryptography;
-
-namespace System {
-
-[Serializable]
-public struct Guid : IFormattable, IComparable {
-
- private uint _timeLow;
- private ushort _timeMid;
- private ushort _timeHighAndVersion;
- private byte _clockSeqHiAndReserved;
- private byte _clockSeqLow;
- private byte _node0;
- private byte _node1;
- private byte _node2;
- private byte _node3;
- private byte _node4;
- private byte _node5;
-
- internal class GuidState {
- protected Random _prnd; // Pseudo RNG
- protected RandomNumberGenerator _rnd; // Strong RNG
- protected bool _usePRnd; // 'true' for pseudo RNG
- protected ushort _clockSeq;
- protected ulong _lastTimestamp;
- protected byte[] _mac;
-
- public int NextInt(uint x)
- {
- if (_usePRnd) {
- return _prnd.Next ((int) x);
- }
- else {
- byte[] b = new byte[4];
- _rnd.GetBytes (b);
-
- uint res = BitConverter.ToUInt32 (b, 0);
- res = (res % x);
- return (int) res;
- }
- }
-
- public void NextBytes(byte[] b)
- {
- if ( _usePRnd ) {
- _prnd . NextBytes (b);
- }
- else {
- _rnd . GetBytes (b);
- }
- }
-
- [MonoTODO("Get real MAC address")]
- public GuidState (bool usePRnd)
- {
- _usePRnd = usePRnd;
- if ( _usePRnd ) {
- _prnd = new Random (unchecked((int) DateTime.Now.Ticks));
- }
- else {
- _rnd = RandomNumberGenerator.Create ();
- }
- _clockSeq = (ushort) NextInt (0x4000); // 14 bits
- _lastTimestamp = 0ul;
- _mac = new byte[6];
- NextBytes (_mac);
- _mac[0] |= 0x80;
- }
-
- public ulong NewTimestamp ()
- {
- ulong timestamp;
-
- do {
- timestamp = (ulong) (DateTime.UtcNow - new DateTime (1582, 10, 15, 0, 0, 0)).Ticks;
- if (timestamp < _lastTimestamp) {
- // clock moved backwards!
- _clockSeq++;
- _clockSeq = (ushort) (_clockSeq & 0x3fff);
- return timestamp;
- }
- if (timestamp > _lastTimestamp) {
- _lastTimestamp = timestamp;
- return timestamp;
- }
- }
- while (true);
- }
-
- public ushort ClockSeq {
- get {
- return _clockSeq;
- }
- }
-
- public byte[] MAC {
- get {
- return _mac;
- }
-
- }
-
- };
-
- internal class GuidParser {
-
- private string _src;
- private int _length;
- private int _cur;
-
- public GuidParser (string src)
- {
- _src = src;
- Reset ();
- }
-
- private void Reset ()
- {
- _cur = 0;
- _length = _src.Length;
- }
-
- private bool AtEnd ()
- {
- return _cur >= _length;
- }
-
- private void ThrowFormatException ()
- {
- throw new FormatException (Locale.GetText ("Invalid format for Guid.Guid(string)"));
- }
-
- private ulong ParseHex(int length, bool strictLength)
- {
- ulong res = 0;
- int i;
- bool end = false;
-
- for (i=0; (!end) && i<length; ++i) {
- if (AtEnd ()) {
- if (strictLength || i==0) {
- ThrowFormatException ();
- }
- else {
- end = true;
- }
- }
- else {
- char c = Char.ToLower (_src[_cur]);
- if (Char.IsDigit (c)) {
- res = res * 16 + c - '0';
- _cur++;
- }
- else if (c >= 'a' && c <= 'f') {
- res = res * 16 + c - 'a' + 10;
- _cur++;
- }
- else {
- if (strictLength || i==0) {
- ThrowFormatException ();
- }
- else {
- end = true;
- }
- }
- }
- }
-
- return res;
- }
-
- private bool ParseOptChar (char c)
- {
- if (!AtEnd() && _src[_cur] == c) {
- _cur++;
- return true;
- }
- else {
- return false;
- }
- }
-
- private void ParseChar (char c)
- {
- bool b = ParseOptChar (c);
- if (!b) {
- ThrowFormatException ();
- }
- }
-
- private Guid ParseGuid1 ()
- {
- bool openBrace;
- int a;
- short b;
- short c;
- byte[] d = new byte[8];
- int i;
-
- openBrace = ParseOptChar ('{');
- a = (int) ParseHex(8, true);
- ParseChar('-');
- b = (short) ParseHex(4, true);
- ParseChar('-');
- c = (short) ParseHex(4, true);
- ParseChar('-');
- for (i=0; i<8; ++i) {
- d[i] = (byte) ParseHex(2, true);
- if (i == 1) {
- ParseChar('-');
- }
- }
-
- if (openBrace && !ParseOptChar('}')) {
- ThrowFormatException ();
- }
-
- return new Guid(a, b, c, d);
- }
-
- private void ParseHexPrefix ()
- {
- ParseChar ('0');
- ParseChar ('x');
- }
-
- private Guid ParseGuid2 ()
- {
- int a;
- short b;
- short c;
- byte[] d = new byte [8];
- int i;
-
- ParseChar ('{');
- ParseHexPrefix ();
- a = (int) ParseHex (8, false);
- ParseChar (',');
- ParseHexPrefix ();
- b = (short) ParseHex (4, false);
- ParseChar (',');
- ParseHexPrefix ();
- c = (short) ParseHex (4, false);
- ParseChar (',');
- ParseChar ('{');
- for (i=0; i<8; ++i) {
- ParseHexPrefix ();
- d[i] = (byte) ParseHex (2, false);
- if (i != 7) {
- ParseChar (',');
- }
-
- }
- ParseChar ('}');
- ParseChar ('}');
-
- return new Guid (a,b,c,d);
-
- }
-
- public Guid Parse ()
- {
- Guid g;
-
- try {
- g = ParseGuid1 ();
- }
- catch (FormatException) {
- Reset ();
- g = ParseGuid2 ();
- }
- if (!AtEnd () ) {
- ThrowFormatException ();
- }
- return g;
- }
-
- }
-
- private static GuidState _guidState = new GuidState ( true /* use pseudo RNG? */ );
-
- private static void CheckNull (object o)
- {
- if (o == null) {
- throw new ArgumentNullException (Locale.GetText ("Value cannot be null."));
- }
- }
-
- private static void CheckLength (byte[] o, int l)
- {
- if (o . Length != l) {
- throw new ArgumentException (String.Format (Locale.GetText ("Array should be exactly {0} bytes long."), l));
- }
- }
-
- private static void CheckArray (byte[] o, int l)
- {
- CheckNull (o);
- CheckLength (o, l);
- }
-
- public Guid (byte[] b)
- {
- CheckArray (b, 16);
- _timeLow = System.BitConverter.ToUInt32 (b, 0);
- _timeMid = System.BitConverter.ToUInt16 (b, 4);
- _timeHighAndVersion = System.BitConverter.ToUInt16 (b, 6);
- _clockSeqHiAndReserved = b[8];
- _clockSeqLow = b[9];
- _node0 = b[10];
- _node1 = b[11];
- _node2 = b[12];
- _node3 = b[13];
- _node4 = b[14];
- _node5 = b[15];
- }
-
- public Guid (string g)
- {
- CheckNull (g);
-
- GuidParser p = new GuidParser (g);
- Guid guid = p.Parse();
-
- this = guid;
- }
-
- public Guid (int a, short b, short c, byte[] d)
- {
- CheckArray(d, 8);
- _timeLow = (uint) a;
- _timeMid = (ushort) b;
- _timeHighAndVersion = (ushort) c;
- _clockSeqHiAndReserved = d[0];
- _clockSeqLow = d[1];
- _node0 = d[2];
- _node1 = d[3];
- _node2 = d[4];
- _node3 = d[5];
- _node4 = d[6];
- _node5 = d[7];
- }
-
- public Guid (
- int a,
- short b,
- short c,
- byte d,
- byte e,
- byte f,
- byte g,
- byte h,
- byte i,
- byte j,
- byte k)
- : this((uint) a, (ushort) b, (ushort) c, d, e, f, g, h, i, j, k) {}
-
- [CLSCompliant(false)]
- public Guid (
- uint a,
- ushort b,
- ushort c,
- byte d,
- byte e,
- byte f,
- byte g,
- byte h,
- byte i,
- byte j,
- byte k)
- {
- _timeLow = a;
- _timeMid = b;
- _timeHighAndVersion = c;
- _clockSeqHiAndReserved = d;
- _clockSeqLow = e;
- _node0 = f;
- _node1 = g;
- _node2 = h;
- _node3 = i;
- _node4 = j;
- _node5 = k;
- }
-
- public static readonly Guid Empty = new Guid(0,0,0,0,0,0,0,0,0,0,0);
-
- private static int Compare (uint x, uint y)
- {
- if (x < y) {
- return -1;
- }
- else {
- return 1;
- }
- }
-
- public int CompareTo (object value )
- {
- if (value == null )
- return 1;
-
- if (!(value is Guid)) {
- throw new ArgumentException (Locale.GetText (
- "Argument of System.Guid.CompareTo should be a Guid"));
- }
-
- Guid v = (Guid) value;
-
- if (_timeLow != v._timeLow ) {
- return Compare(_timeLow, v._timeLow);
- }
- else if (_timeMid != v._timeMid) {
- return Compare(_timeMid, v._timeMid);
- }
- else if (_timeHighAndVersion != v._timeHighAndVersion) {
- return Compare(_timeHighAndVersion, v._timeHighAndVersion);
- }
- else if (_clockSeqHiAndReserved != v._clockSeqHiAndReserved) {
- return Compare(_clockSeqHiAndReserved, v._clockSeqHiAndReserved);
- }
- else if (_clockSeqLow != v._clockSeqLow) {
- return Compare(_clockSeqLow, v._clockSeqLow);
- }
- else if (_node0 != v._node0) {
- return Compare(_node0, v._node0);
- }
- else if (_node1 != v._node1) {
- return Compare(_node1, v._node1);
- }
- else if (_node2 != v._node2) {
- return Compare(_node2, v._node2);
- }
- else if (_node3 != v._node3) {
- return Compare(_node3, v._node3);
- }
- else if (_node4 != v._node4) {
- return Compare(_node4, v._node4);
- }
- else if (_node5 != v._node5) {
- return Compare(_node5, v._node5);
- }
-
- return 0;
- }
-
- public override bool Equals ( object o )
- {
- try {
- return CompareTo (o) == 0;
- }
- catch ( ArgumentException ) {
- return false;
- }
- }
-
- public override int GetHashCode ()
- {
- int res;
-
- res = (int) _timeLow;
- res = res ^ ((int) _timeMid << 16 | _timeHighAndVersion);
- res = res ^ ((int) _clockSeqHiAndReserved << 24);
- res = res ^ ((int) _clockSeqLow << 16);
- res = res ^ ((int) _node0 << 8);
- res = res ^ ((int) _node1);
- res = res ^ ((int) _node2 << 24);
- res = res ^ ((int) _node3 << 16);
- res = res ^ ((int) _node4 << 8);
- res = res ^ ((int) _node5);
-
- return res;
- }
-
- private static Guid NewTimeGuid()
- {
- ulong timestamp = _guidState.NewTimestamp ();
-
- // Bit [31..0] (32 bits) for timeLow
- uint timeLow = (uint) (timestamp & 0x00000000fffffffful);
- // Bit [47..32] (16 bits) for timeMid
- ushort timeMid = (ushort) ((timestamp & 0x0000ffff00000000ul) >> 32);
- // Bit [59..48] (12 bits) for timeHi
- ushort timeHi = (ushort) ((timestamp & 0x0fff000000000000ul) >> 48);
- // Bit [7..0] (8 bits) for clockSeqLo
- byte clockSeqLow = (byte) (Guid._guidState.ClockSeq & 0x00ffu);
- // Bit [13..8] (6 bits) for clockSeqHi
- byte clockSeqHi = (byte) ((Guid._guidState.ClockSeq & 0x3f00u) >> 8);
- byte[] mac = _guidState.MAC;
-
- clockSeqHi = (byte) (clockSeqHi | 0x80u); // Bit[7] = 1, Bit[6] = 0 (Variant)
- timeHi = (ushort) (timeHi | 0x1000u); // Bit[15..13] = 1 (Guid is time-based)
-
- return new Guid(timeLow, timeMid, timeHi, clockSeqHi, clockSeqLow, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
- }
-
- private static Guid NewRandomGuid ()
- {
- byte[] b = new byte[16];
-
- _guidState.NextBytes (b);
-
- Guid res = new Guid(b);
- // Mask in Variant 1-0 in Bit[7..6]
- res._clockSeqHiAndReserved = (byte) ((res._clockSeqHiAndReserved & 0x3fu) | 0x80u);
- // Mask in Version 4 (random based Guid) in Bits[15..13]
- res._timeHighAndVersion = (ushort) ((res._timeHighAndVersion & 0x0fffu) | 0x4000u);
- return res;
- }
-
- [MonoTODO]
- public static Guid NewGuid ()
- {
- return NewRandomGuid();
- }
-
- public byte[] ToByteArray ()
- {
- byte[] res = new byte[16];
- byte[] tmp;
- int d = 0;
- int s;
-
- tmp = BitConverter.GetBytes(_timeLow);
- for (s=0; s<4; ++s) {
- res[d++] = tmp[s];
- }
-
- tmp = BitConverter.GetBytes(_timeMid);
- for (s=0; s<2; ++s) {
- res[d++] = tmp[s];
- }
-
- tmp = BitConverter.GetBytes(_timeHighAndVersion);
- for (s=0; s<2; ++s) {
- res[d++] = tmp[s];
- }
-
- res[8] = _clockSeqHiAndReserved;
- res[9] = _clockSeqLow;
- res[10] = _node0;
- res[11] = _node1;
- res[12] = _node2;
- res[13] = _node3;
- res[14] = _node4;
- res[15] = _node5;
-
- return res;
- }
-
- private string BaseToString(bool h, bool p, bool b)
- {
- string res = "";
-
- if (p) {
- res += "(";
- }
- else if (b) {
- res += "{";
- }
-
- res += _timeLow.ToString ("x8");
- if (h) {
- res += "-";
- }
- res += _timeMid.ToString ("x4");
- if (h) {
- res += "-";
- }
- res += _timeHighAndVersion.ToString ("x4");
- if (h) {
- res += "-";
- }
- res += _clockSeqHiAndReserved.ToString ("x2");
- res += _clockSeqLow.ToString ("x2");
- if (h) {
- res += "-";
- }
- res += _node0.ToString ("x2");
- res += _node1.ToString ("x2");
- res += _node2.ToString ("x2");
- res += _node3.ToString ("x2");
- res += _node4.ToString ("x2");
- res += _node5.ToString ("x2");
-
- if (p) {
- res += ")";
- }
- else if (b) {
- res += "}";
- }
-
- return res;
- }
-
- public override string ToString ()
- {
- return BaseToString (true, false, false);
- }
-
- public string ToString (string format)
- {
- string f;
- bool h = true;
- bool p = false;
- bool b = false;
-
- if (format != null) {
- f = format.ToLower();
-
- if (f == "b") {
- b = true;
- }
- else if (f == "p") {
- p = true;
- }
- else if (f == "n") {
- h = false;
- }
- else if (f != "d" && f != "") {
- throw new FormatException ( Locale.GetText ("Argument to Guid.ToString(string format) should be \"b\", \"B\", \"d\", \"D\", \"n\", \"N\", \"p\" or \"P\""));
- }
- }
-
- return BaseToString (h, p, b);
- }
-
- public string ToString (string format, IFormatProvider provider)
- {
- return ToString (format);
- }
-
- public static bool operator == (Guid a, Guid b)
- {
- return a.Equals(b);
- }
-
- public static bool operator != (Guid a, Guid b)
- {
- return !( a.Equals (b) );
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/System/IAppDomainSetup.cs b/mcs/class/corlib/System/IAppDomainSetup.cs
deleted file mode 100644
index 31eddcd62b7..00000000000
--- a/mcs/class/corlib/System/IAppDomainSetup.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-
-//
-// System/IAppDomainSetup.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System {
-
- 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; }
- }
-}
diff --git a/mcs/class/corlib/System/IAsyncResult.cs b/mcs/class/corlib/System/IAsyncResult.cs
deleted file mode 100644
index 74ec69b8c7a..00000000000
--- a/mcs/class/corlib/System/IAsyncResult.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.IAsyncResult.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Mon 08/24/2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Threading;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- public interface IAsyncResult
- {
- object AsyncState
- {
- get;
- }
-
- WaitHandle AsyncWaitHandle
- {
- get;
- }
-
- bool CompletedSynchronously
- {
- get;
- }
-
- bool IsCompleted
- {
- get;
- }
- }
-
-} // Namespace System
-
-
diff --git a/mcs/class/corlib/System/ICloneable.cs b/mcs/class/corlib/System/ICloneable.cs
deleted file mode 100644
index 792550db1f5..00000000000
--- a/mcs/class/corlib/System/ICloneable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.ICloneable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface ICloneable {
- object Clone ();
- }
-}
diff --git a/mcs/class/corlib/System/IComparable.cs b/mcs/class/corlib/System/IComparable.cs
deleted file mode 100644
index 50af10d15e2..00000000000
--- a/mcs/class/corlib/System/IComparable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.IComparable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IComparable {
- int CompareTo (object obj);
- }
-}
diff --git a/mcs/class/corlib/System/IConvertible.cs b/mcs/class/corlib/System/IConvertible.cs
deleted file mode 100644
index 95612b04c21..00000000000
--- a/mcs/class/corlib/System/IConvertible.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// System.IConvertible.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// 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
-//
-
-namespace System {
-
- [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);
- }
-}
diff --git a/mcs/class/corlib/System/ICustomFormatter.cs b/mcs/class/corlib/System/ICustomFormatter.cs
deleted file mode 100644
index 1c51ab9c025..00000000000
--- a/mcs/class/corlib/System/ICustomFormatter.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.ICustomFormatter.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface ICustomFormatter {
- string Format (string format, object arg, IFormatProvider formatProvider);
- }
-}
diff --git a/mcs/class/corlib/System/IDisposable.cs b/mcs/class/corlib/System/IDisposable.cs
deleted file mode 100644
index 6c3ca1b6367..00000000000
--- a/mcs/class/corlib/System/IDisposable.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// System.IDisposable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IDisposable {
-
- void Dispose ();
-
- }
-}
diff --git a/mcs/class/corlib/System/IFormatProvider.cs b/mcs/class/corlib/System/IFormatProvider.cs
deleted file mode 100644
index 266c62d1295..00000000000
--- a/mcs/class/corlib/System/IFormatProvider.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.IFormatProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IFormatProvider {
- object GetFormat (Type format_type);
- }
-}
diff --git a/mcs/class/corlib/System/IFormattable.cs b/mcs/class/corlib/System/IFormattable.cs
deleted file mode 100644
index 1769f4034c0..00000000000
--- a/mcs/class/corlib/System/IFormattable.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.IFormattable.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public interface IFormattable {
- string ToString (string format, IFormatProvider format_provider);
- }
-}
diff --git a/mcs/class/corlib/System/IServiceProvider.cs b/mcs/class/corlib/System/IServiceProvider.cs
deleted file mode 100644
index 13992c20145..00000000000
--- a/mcs/class/corlib/System/IServiceProvider.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.IServiceProvider.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-
-namespace System {
-
-// [ComVisible(false)]
- public interface IServiceProvider {
-
- object GetService (Type serviceType);
-
- }
-}
diff --git a/mcs/class/corlib/System/IndexOutOfRangeException.cs b/mcs/class/corlib/System/IndexOutOfRangeException.cs
deleted file mode 100644
index 7246ddefb7e..00000000000
--- a/mcs/class/corlib/System/IndexOutOfRangeException.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.IndexOutOfRangeException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- [Serializable]
- 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 inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Int16.cs b/mcs/class/corlib/System/Int16.cs
deleted file mode 100644
index fdc85c6f54a..00000000000
--- a/mcs/class/corlib/System/Int16.cs
+++ /dev/null
@@ -1,237 +0,0 @@
-//
-// System.Int16.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public struct Int16 : IComparable, IFormattable, IConvertible {
-
- public const short MaxValue = 32767;
- public const short MinValue = -32768;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public short value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Int16))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Int16"));
-
- short xv = (short) v;
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Int16))
- return false;
-
- return ((short) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static short Parse (string s)
- {
- short val = 0;
- int len;
- int i, sign = 1;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- sign = -1;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- val = checked ((short) (val * 10 + (c - '0') * sign));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- return val;
- }
-
- public static short Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static short Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- public static short Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- int tmpResult = Int32.Parse (s, style, fp);
- if (tmpResult > Int16.MaxValue || tmpResult < Int16.MinValue)
- throw new OverflowException ("Value too large or too small.");
-
- return (short) tmpResult;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Int16;
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return System.Convert.ToDateTime (value);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32 (value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
-
- [CLSCompliant (false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType (value, conversionType, provider);
- }
-
- [CLSCompliant (false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
-
- [CLSCompliant (false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
-
- [CLSCompliant (false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/Int32.cs b/mcs/class/corlib/System/Int32.cs
deleted file mode 100644
index ca495036b5e..00000000000
--- a/mcs/class/corlib/System/Int32.cs
+++ /dev/null
@@ -1,490 +0,0 @@
-//
-// System.Int32.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Threading;
-
-namespace System {
-
- [Serializable]
- public struct Int32 : IComparable, IFormattable, IConvertible {
-
- public const int MaxValue = 0x7fffffff;
- public const int MinValue = -2147483648;
-
- public int value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Int32))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Int32"));
-
- int xv = (int) v;
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Int32))
- return false;
-
- return ((int) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- public static int Parse (string s)
- {
- int val = 0;
- int len;
- int i, sign = 1;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- sign = -1;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- val = checked (val * 10 + (c - '0') * sign);
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- return val;
- }
-
- public static int Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static int Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- internal static void CheckStyle (NumberStyles style)
- {
- if ((style & NumberStyles.AllowHexSpecifier) != 0) {
- NumberStyles ne = style ^ NumberStyles.AllowHexSpecifier;
- if ((ne & NumberStyles.AllowLeadingWhite) != 0)
- ne ^= NumberStyles.AllowLeadingWhite;
- if ((ne & NumberStyles.AllowTrailingWhite) != 0)
- ne ^= NumberStyles.AllowTrailingWhite;
- if (ne != 0)
- throw new ArgumentException (
- "With AllowHexSpecifier only " +
- "AllowLeadingWhite and AllowTrailingWhite " +
- "are permitted.");
- }
- }
-
- internal static int JumpOverWhite (int pos, string s, bool excp)
- {
- while (pos < s.Length && Char.IsWhiteSpace (s [pos]))
- pos++;
-
- if (excp && pos >= s.Length)
- throw new FormatException ("Input string was not in the correct format.");
-
- return pos;
- }
-
- internal static void FindSign (ref int pos, string s, NumberFormatInfo nfi,
- ref bool foundSign, ref bool negative)
- {
- if ((pos + nfi.NegativeSign.Length) <= s.Length &&
- s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign) {
- negative = true;
- foundSign = true;
- pos += nfi.NegativeSign.Length;
- }
- else if ((pos + nfi.PositiveSign.Length) < s.Length &&
- s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign) {
- negative = false;
- pos += nfi.PositiveSign.Length;
- foundSign = true;
- }
- }
-
- internal static void FindCurrency (ref int pos,
- string s,
- NumberFormatInfo nfi,
- ref bool foundCurrency)
- {
- if ((pos + nfi.CurrencySymbol.Length) <= s.Length &&
- s.Substring (pos, nfi.CurrencySymbol.Length) == nfi.CurrencySymbol) {
- foundCurrency = true;
- pos += nfi.CurrencySymbol.Length;
- }
- }
-
- internal static bool FindOther (ref int pos,
- string s,
- string other)
- {
- if ((pos + other.Length) <= s.Length &&
- s.Substring (pos, other.Length) == other) {
- pos += other.Length;
- return true;
- }
-
- return false;
- }
-
- internal static bool ValidDigit (char e, bool allowHex)
- {
- if (allowHex)
- return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
-
- return Char.IsDigit (e);
- }
-
- public static int Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- if (s == null)
- throw new ArgumentNullException ();
-
- if (s.Length == 0)
- throw new FormatException ("Input string was not " +
- "in the correct format.");
-
- NumberFormatInfo nfi;
- if (fp != null) {
- Type typeNFI = typeof (System.Globalization.NumberFormatInfo);
- nfi = (NumberFormatInfo) fp.GetFormat (typeNFI);
- }
- else
- nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
-
- CheckStyle (style);
-
- bool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;
- bool AllowExponent = (style & NumberStyles.AllowExponent) != 0;
- bool AllowHexSpecifier = (style & NumberStyles.AllowHexSpecifier) != 0;
- bool AllowThousands = (style & NumberStyles.AllowThousands) != 0;
- bool AllowDecimalPoint = (style & NumberStyles.AllowDecimalPoint) != 0;
- bool AllowParentheses = (style & NumberStyles.AllowParentheses) != 0;
- bool AllowTrailingSign = (style & NumberStyles.AllowTrailingSign) != 0;
- bool AllowLeadingSign = (style & NumberStyles.AllowLeadingSign) != 0;
- bool AllowTrailingWhite = (style & NumberStyles.AllowTrailingWhite) != 0;
- bool AllowLeadingWhite = (style & NumberStyles.AllowLeadingWhite) != 0;
-
- int pos = 0;
-
- if (AllowLeadingWhite)
- pos = JumpOverWhite (pos, s, true);
-
- bool foundOpenParentheses = false;
- bool negative = false;
- bool foundSign = false;
- bool foundCurrency = false;
-
- // Pre-number stuff
- if (AllowParentheses && s [pos] == '(') {
- foundOpenParentheses = true;
- foundSign = true;
- negative = true; // MS always make the number negative when there parentheses
- // even when NumberFormatInfo.NumberNegativePattern != 0!!!
- pos++;
- if (AllowLeadingWhite)
- pos = JumpOverWhite (pos, s, true);
-
- if (s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign)
- throw new FormatException ("Input string was not in the correct " +
- "format.");
- if (s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign)
- throw new FormatException ("Input string was not in the correct " +
- "format.");
- }
-
- if (AllowLeadingSign && !foundSign) {
- // Sign + Currency
- FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowLeadingWhite)
- pos = JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol) {
- FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- if (foundCurrency && AllowLeadingWhite)
- pos = JumpOverWhite (pos, s, true);
- }
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency) {
- if (AllowLeadingWhite)
- pos = JumpOverWhite (pos, s, true);
- if (foundCurrency) {
- if (!foundSign && AllowLeadingSign) {
- FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- if (foundSign && AllowLeadingWhite)
- pos = JumpOverWhite (pos, s, true);
- }
- }
- }
- }
-
- int number = 0;
- int nDigits = 0;
- bool decimalPointFound = false;
- int digitValue;
- char hexDigit;
-
- // Number stuff
- do {
-
- if (!ValidDigit (s [pos], AllowHexSpecifier)) {
- if (AllowThousands &&
- FindOther (ref pos, s, nfi.NumberGroupSeparator))
- continue;
- else
- if (!decimalPointFound && AllowDecimalPoint &&
- FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
- decimalPointFound = true;
- continue;
- }
-
- break;
- }
- else if (AllowHexSpecifier) {
- nDigits++;
- hexDigit = s [pos++];
- if (Char.IsDigit (hexDigit))
- digitValue = (int) (hexDigit - '0');
- else if (Char.IsLower (hexDigit))
- digitValue = (int) (hexDigit - 'a' + 10);
- else
- digitValue = (int) (hexDigit - 'A' + 10);
-
- number = checked (number * 16 - digitValue);
- }
- else if (decimalPointFound) {
- nDigits++;
- // Allows decimal point as long as it's only
- // followed by zeroes.
- if (s [pos++] != '0')
- throw new OverflowException ("Value too large or too " +
- "small.");
- }
- else {
- nDigits++;
-
- try {
- // Calculations done as negative
- // (abs (MinValue) > abs (MaxValue))
- number = checked (
- number * 10 -
- (int) (s [pos++] - '0')
- );
- } catch (OverflowException) {
- throw new OverflowException ("Value too large or too " +
- "small.");
- }
- }
- } while (pos < s.Length);
-
- // Post number stuff
- if (nDigits == 0)
- throw new FormatException ("Input string was not in the correct format.");
-
- if (AllowTrailingSign && !foundSign) {
- // Sign + Currency
- FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowTrailingWhite)
- pos = JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol)
- FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency) {
- if (AllowTrailingWhite)
- pos = JumpOverWhite (pos, s, true);
- if (!foundSign && AllowTrailingSign)
- FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- }
- }
-
- if (AllowTrailingWhite && pos < s.Length)
- pos = JumpOverWhite (pos, s, false);
-
- if (foundOpenParentheses) {
- if (pos >= s.Length || s [pos++] != ')')
- throw new FormatException ("Input string was not in the correct " +
- "format.");
- if (AllowTrailingWhite && pos < s.Length)
- pos = JumpOverWhite (pos, s, false);
- }
-
- if (pos < s.Length)
- throw new FormatException ("Input string was not in the correct format.");
-
-
- if (!negative)
- number = -number;
-
- return number;
- }
-
- public override string ToString ()
- {
- return IntegerFormatter.FormatGeneral(value, 0, null, true);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp )
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString (format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Int32;
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return System.Convert.ToDateTime (value);
- }
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return value;
- }
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType (value, conversionType, provider);
- }
-
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/Int64.cs b/mcs/class/corlib/System/Int64.cs
deleted file mode 100644
index a25e42e3725..00000000000
--- a/mcs/class/corlib/System/Int64.cs
+++ /dev/null
@@ -1,432 +0,0 @@
-//
-// System.Int64.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Threading;
-
-namespace System {
-
- [Serializable]
- public struct Int64 : IComparable, IFormattable, IConvertible {
-
- public const long MaxValue = 0x7fffffffffffffff;
- public const long MinValue = -9223372036854775808;
-
- public long value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Int64))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Int64"));
-
- if (value == (long) v)
- return 0;
-
- if (value < (long) v)
- return -1;
-
- return 1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Int64))
- return false;
-
- return ((long) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int)(value & 0xffffffff) ^ (int)(value >> 32);
- }
-
- public static long Parse (string s)
- {
- long val = 0;
- int len;
- int i;
- int sign = 1;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- sign = -1;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- val = checked (val * 10 + (c - '0') * sign);
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- return val;
- }
-
- public static long Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- public static long Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- public static long Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- if (s == null)
- throw new ArgumentNullException ();
-
- if (s.Length == 0)
- throw new FormatException ("Input string was not " +
- "in the correct format: s.Length==0.");
-
- NumberFormatInfo nfi;
- if (fp != null) {
- Type typeNFI = typeof (System.Globalization.NumberFormatInfo);
- nfi = (NumberFormatInfo) fp.GetFormat (typeNFI);
- }
- else
- nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
-
- Int32.CheckStyle (style);
-
- bool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;
- bool AllowExponent = (style & NumberStyles.AllowExponent) != 0;
- bool AllowHexSpecifier = (style & NumberStyles.AllowHexSpecifier) != 0;
- bool AllowThousands = (style & NumberStyles.AllowThousands) != 0;
- bool AllowDecimalPoint = (style & NumberStyles.AllowDecimalPoint) != 0;
- bool AllowParentheses = (style & NumberStyles.AllowParentheses) != 0;
- bool AllowTrailingSign = (style & NumberStyles.AllowTrailingSign) != 0;
- bool AllowLeadingSign = (style & NumberStyles.AllowLeadingSign) != 0;
- bool AllowTrailingWhite = (style & NumberStyles.AllowTrailingWhite) != 0;
- bool AllowLeadingWhite = (style & NumberStyles.AllowLeadingWhite) != 0;
-
- int pos = 0;
-
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
-
- bool foundOpenParentheses = false;
- bool negative = false;
- bool foundSign = false;
- bool foundCurrency = false;
-
- // Pre-number stuff
- if (AllowParentheses && s [pos] == '(') {
- foundOpenParentheses = true;
- foundSign = true;
- negative = true; // MS always make the number negative when there parentheses
- // even when NumberFormatInfo.NumberNegativePattern != 0!!!
- pos++;
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
-
- if (s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign)
- throw new FormatException ("Input string was not in the correct " +
- "format: Has Negative Sign.");
- if (s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign)
- throw new FormatException ("Input string was not in the correct " +
- "format: Has Positive Sign.");
- }
-
- if (AllowLeadingSign && !foundSign) {
- // Sign + Currency
- Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol) {
- Int32.FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- if (foundCurrency && AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- }
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency) {
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (foundCurrency) {
- if (!foundSign && AllowLeadingSign) {
- Int32.FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- if (foundSign && AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- }
- }
- }
- }
-
- long number = 0;
- int nDigits = 0;
- bool decimalPointFound = false;
- int digitValue;
- char hexDigit;
-
- // Number stuff
- do {
-
- if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
- if (AllowThousands &&
- (Int32.FindOther (ref pos, s, nfi.NumberGroupSeparator)
- || Int32.FindOther (ref pos, s, nfi.CurrencyGroupSeparator)))
- continue;
- else
- if (!decimalPointFound && AllowDecimalPoint &&
- (Int32.FindOther (ref pos, s, nfi.NumberDecimalSeparator)
- || Int32.FindOther (ref pos, s, nfi.CurrencyDecimalSeparator))) {
- decimalPointFound = true;
- continue;
- }
-
- break;
- }
- else if (AllowHexSpecifier) {
- nDigits++;
- hexDigit = s [pos++];
- if (Char.IsDigit (hexDigit))
- digitValue = (int) (hexDigit - '0');
- else if (Char.IsLower (hexDigit))
- digitValue = (int) (hexDigit - 'a' + 10);
- else
- digitValue = (int) (hexDigit - 'A' + 10);
-
- number = checked (number * 16 - digitValue);
- }
- else if (decimalPointFound) {
- nDigits++;
- // Allows decimal point as long as it's only
- // followed by zeroes.
- if (s [pos++] != '0')
- throw new OverflowException ("Value too large or too " +
- "small.");
- }
- else {
- nDigits++;
-
- try {
- // Calculations done as negative
- // (abs (MinValue) > abs (MaxValue))
- number = checked (
- number * 10 -
- (long) (s [pos++] - '0')
- );
- } catch (OverflowException) {
- throw new OverflowException ("Value too large or too " +
- "small.");
- }
- }
- } while (pos < s.Length);
-
- // Post number stuff
- if (nDigits == 0)
- throw new FormatException ("Input string was not in the correct format: nDigits == 0.");
-
- if (AllowTrailingSign && !foundSign) {
- // Sign + Currency
- Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowTrailingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol)
- Int32.FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- if (nfi.CurrencyPositivePattern == 3 && s[pos++] != ' ')
- throw new FormatException ("Input string was not in the correct format: no space between number and currency symbol.");
-
- Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency && pos < s.Length) {
- if (AllowTrailingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (!foundSign && AllowTrailingSign)
- Int32.FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- }
- }
-
- if (AllowTrailingWhite && pos < s.Length)
- pos = Int32.JumpOverWhite (pos, s, false);
-
- if (foundOpenParentheses) {
- if (pos >= s.Length || s [pos++] != ')')
- throw new FormatException ("Input string was not in the correct " +
- "format: No room for close parens.");
- if (AllowTrailingWhite && pos < s.Length)
- pos = Int32.JumpOverWhite (pos, s, false);
- }
-
- if (pos < s.Length)
- throw new FormatException ("Input string was not in the correct format: Did not parse entire string. pos = "
- + pos + " s.Length = " + s.Length);
-
-
- if (!negative)
- number = -number;
-
- return number;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString (format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Int64;
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return System.Convert.ToDateTime (value);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32 (value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
-
- [CLSCompliant (false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType (value, conversionType, provider);
- }
-
- [CLSCompliant (false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
-
- [CLSCompliant (false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
-
- [CLSCompliant (false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/IntPtr.cs b/mcs/class/corlib/System/IntPtr.cs
deleted file mode 100644
index bb12f2482f1..00000000000
--- a/mcs/class/corlib/System/IntPtr.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// System.IntPtr.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// Maintainer:
-// Michael Lambert, michaellambert@email.com
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// Remarks: Requires '/unsafe' compiler option. This class uses void*,
-// in overloaded constructors, conversion, and cast members in
-// the public interface. Using pointers is not valid CLS and
-// the methods in question have been marked with the
-// CLSCompliant attribute that avoid compiler warnings.
-//
-// FIXME: How do you specify a native int in C#? I am going to have to do some figuring out
-//
-
-using System;
-using System.Runtime.Serialization;
-
-#if __MonoCS__
-#else
-[
- assembly: System.CLSCompliant(true)
-]
-#endif
-
-namespace System {
-
- [
- CLSCompliant(true)
- ]
- [Serializable]
- public unsafe struct IntPtr : ISerializable {
-
- private void *value;
-
- public static readonly IntPtr Zero;
-
- static IntPtr ()
- {
- Zero.value = (void *) 0;
- }
-
- public IntPtr (int i32)
- {
- value = (void *) i32;
- }
-
- public IntPtr (long i64)
- {
- value = (void *) i64;
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public IntPtr (void *ptr)
- {
- value = ptr;
- }
-
- public static int Size {
- get {
- return sizeof (void *);
- }
- }
-
- public void GetObjectData (SerializationInfo si, StreamingContext sc)
- {
- if( si == null )
- throw new ArgumentNullException( "si" );
-
- si.AddValue("value", (long) value);
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.IntPtr))
- return false;
-
- return ((IntPtr) o).value == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- public int ToInt32 ()
- {
- return (int) value;
- }
-
- public long ToInt64 ()
- {
- return (long) value;
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public void *ToPointer ()
- {
- return value;
- }
-
- override public string ToString ()
- {
- if (Size == 4)
- return ((int) value).ToString ();
- else
- return ((long) value).ToString ();
- }
-
- public static bool operator == (IntPtr a, IntPtr b)
- {
- return (a.value == b.value);
- }
-
- public static bool operator != (IntPtr a, IntPtr b)
- {
- return (a.value != b.value);
- }
-
- public static explicit operator IntPtr (int value)
- {
- return new IntPtr (value);
- }
-
- public static explicit operator IntPtr (long value)
- {
- return new IntPtr (value);
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public static explicit operator IntPtr (void *value)
- {
- return new IntPtr (value);
- }
-
- public static explicit operator int (IntPtr value)
- {
- return (int) value.value;
- }
-
- public static explicit operator long (IntPtr value)
- {
- return (long) value.value;
- }
-
- [
- CLSCompliant(false)
- ]
- unsafe public static explicit operator void * (IntPtr value)
- {
- return value.value;
- }
- }
-}
diff --git a/mcs/class/corlib/System/IntegerFormatter.cs b/mcs/class/corlib/System/IntegerFormatter.cs
deleted file mode 100644
index b53ad1f46b6..00000000000
--- a/mcs/class/corlib/System/IntegerFormatter.cs
+++ /dev/null
@@ -1,4030 +0,0 @@
-//
-// System.IntegerFormatter.cs
-//
-// Author:
-// Derek Holden (dholden@draper.com)
-//
-// (C) Derek Holden dholden@draper.com
-//
-
-//
-// Format integer types. Completely based off ECMA docs
-// for IFormattable specification. Has been tested w/
-// all integral types, from boundry to boundry, w/ all
-// formats A## ("G", "G0" ... "G99", "P", "P0" ... "P99").
-//
-// If you make any changes, please make sure to check the
-// boundry format precisions (0, 99) and the min / max values
-// of the data types (Int32.[Max/Min]Value).
-//
-// Using int as an example, it is currently set up as
-//
-// Int32 {
-// int value;
-// public string ToString (string format, NumberFormatInfo nfi) {
-// return IntegerFormatter.NumberToString (format, nfi, value);
-// }
-//
-// IntegerFormatter {
-// public string NumberToString (string format, NumberFormatInfo nfi, int value) {
-// ParseFormat (format);
-// switch (format type) {
-// case 'G' FormatGeneral(value, precision);
-// case 'R' throw Exception("Invalid blah blah");
-// case 'C' FromatCurrency(value, precision, nfi);
-// etc...
-// }
-// }
-// }
-//
-// There is a property in NumberFormatInfo for NegativeSign, though the
-// definition of IFormattable just uses '-' in context. So all the
-// hardcoded uses of '-' in here may need to be changed to nfi.NegativeSign
-//
-// For every integral type.
-//
-// Before every Format<Format Type> block there is a small paragraph
-// detailing its requirements, and a blurb of what I was thinking
-// at the time.
-//
-// Some speedup suggestions to be done when after this appears
-// to be working properly:
-//
-// * Deal w/ out of range numbers better. Specifically with
-// regards to boundry cases such as Long.MinValue etc.
-// The previous way of if (value < 0) value = -value;
-// fails under this assumption, since the largest
-// possible MaxValue is < absolute value of the MinValue.
-// I do the first iteration outside of the loop, and then
-// convert the number to positive, then continue in the loop.
-//
-// * Replace all occurances of max<Type>Length with their
-// numerical values. Plus the places where things are set
-// to max<Type>Length - 1. Hardcode these to numbers.
-//
-// * Move the code for all the NumberToString()'s into the
-// the main ToString (string, NumberFormatInfo) method in
-// the data types themselves. That way they'd be throwing
-// their own exceptions on error and it'd save a function
-// call.
-//
-// * For integer to char buffer transformation, you could
-// implement the calculations of the 10's and 100's place
-// the same time w/ another table to shorten loop time.
-//
-// * Someone smarter can prolly find a much more efficient
-// way of formatting the exponential notation. It's still
-// done in pass, just may have too many repositioning
-// calculations.
-//
-// * Decide whether it be better to have functions that
-// handle formatting for all types, or just cast their
-// values out and format them. Just if library size is
-// more important than speed in saving a cast and a
-// function call.
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace System {
-
- public sealed class IntegerFormatter {
-
- private static int maxByteLength = 4;
- private static int maxShortLength = 6;
- private static int maxIntLength = 12;
- private static int maxLongLength = 22;
-
- private static char[] digitLowerTable;
-/**
- * This makes a TypeNotInitialized exception be thrown.
- * { '0', '1', '2', '3', '4', '5', '6', '7',
- * '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
- */
-
- private static char[] digitUpperTable;
-/*
- * { '0', '1', '2', '3', '4', '5', '6', '7',
- * '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- */
-
- static IntegerFormatter ()
- {
- int i;
-
- digitLowerTable = new char[16];
- digitUpperTable = new char[16];
-
- for (i = 0; i < 10; i++){
- digitLowerTable[i] = (char) ('0' + i);
- digitUpperTable[i] = (char) ('0' + i);
- }
-
- char lc = (char ) ('a' - i);
- char uc = (char ) ('A' - i);
- while (i < 16){
- digitLowerTable[i] = (char) (lc + i);
- digitUpperTable[i] = (char) (uc + i);
- i++;
- }
- }
-
- private static bool IsDigit (char c)
- {
- return !(c < '0' || c > '9');
- }
-
- private static bool IsLetter (char c)
- {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
- }
-
- private static bool ParseFormat (string format, out char specifier, out int precision, out bool custom)
- {
- precision = -1;
- specifier = '\0';
- custom = false;
-
- int length = format.Length;
- // TODO: Could an empty string be a custom format string?
- if (length < 1)
- return false;
-
- char[] chars = format.ToCharArray ();
- specifier = chars[0];
-
- // TODO: IsLetter() and IsDigit() should be replaced by Char.Is*()
- if (IsLetter(specifier) && length <= 3) {
- switch (length){
- case 1:
- return true;
- case 2:
- if (IsDigit(chars[1])) {
- precision = chars[1] - '0';
- return true;
- }
- break;
- case 3:
- if (IsDigit(chars[1]) && IsDigit(chars[2])) {
- precision = chars[1] - '0';
- precision = precision * 10 + chars[2] - '0';
- return true;
- }
- break;
- }
-
- }
-
- // We've got a custom format string.
- custom = true;
- return true;
- }
-
- // ============ Public Interface to all the integer types ============ //
-
- public static string NumberToString (string format, NumberFormatInfo nfi, byte value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, short value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this insance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, int value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- public static string NumberToString (string format, NumberFormatInfo nfi, long value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- [CLSCompliant (false)]
- public static string NumberToString (string format, NumberFormatInfo nfi, sbyte value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- [CLSCompliant (false)]
- public static string NumberToString (string format, NumberFormatInfo nfi, ushort value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- [CLSCompliant (false)]
- public static string NumberToString (string format, NumberFormatInfo nfi, uint value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- [CLSCompliant (false)]
- public static string NumberToString (string format, NumberFormatInfo nfi, ulong value)
- {
- char specifier;
- int precision;
- bool custom;
-
- if (!ParseFormat (format, out specifier, out precision, out custom))
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
-
- if (custom){
- return FormatCustom (format, value, nfi);
- }
-
- switch(specifier) {
- case 'c': return FormatCurrency (value, precision, nfi);
- case 'C': return FormatCurrency (value, precision, nfi);
- case 'd': return FormatDecimal (value, precision);
- case 'D': return FormatDecimal (value, precision);
- case 'e': return FormatExponential (value, precision, false);
- case 'E': return FormatExponential (value, precision, true);
- case 'f': return FormatFixedPoint (value, precision, nfi);
- case 'F': return FormatFixedPoint (value, precision, nfi);
- case 'g': return FormatGeneral (value, precision, nfi, false);
- case 'G': return FormatGeneral (value, precision, nfi, true);
- case 'n': return FormatNumber (value, precision, nfi);
- case 'N': return FormatNumber (value, precision, nfi);
- case 'p': return FormatPercent (value, precision, nfi);
- case 'P': return FormatPercent (value, precision, nfi);
- case 'r': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'R': throw new FormatException (Locale.GetText ("The specified format cannot be used in this instance"));
- case 'x': return FormatHexadecimal (value, precision, false);
- case 'X': return FormatHexadecimal (value, precision, true);
- default:
- throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
- }
- }
-
- // ============ Currency Type Formating ============ //
-
- //
- // Currency Format: Used for strings containing a monetary value. The
- // CurrencySymbol, CurrencyGroupSizes, CurrencyGroupSeparator, and
- // CurrencyDecimalSeparator members of a NumberFormatInfo supply
- // the currency symbol, size and separator for digit groupings, and
- // decimal separator, respectively.
- // CurrencyNegativePattern and CurrencyPositivePattern determine the
- // symbols used to represent negative and positive values. For example,
- // a negative value may be prefixed with a minus sign, or enclosed in
- // parentheses.
- // If the precision specifier is omitted
- // NumberFormatInfo.CurrencyDecimalDigits determines the number of
- // decimal places in the string. Results are rounded to the nearest
- // representable value when necessary.
- //
- // The pattern of the NumberFormatInfo determines how the output looks, where
- // the dollar sign goes, where the negative sign goes, etc.
- // IFormattable documentation lists the patterns and their values,
- // I have them commented out in the large switch statement
- //
-
- private static string FormatCurrency (byte value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((uint)value, precision, nfi);
- }
-
- private static string FormatCurrency (short value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((int)value, precision, nfi);
- }
-
- private static string FormatCurrency (int value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = negative ? nfi.CurrencyNegativePattern : nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -$nnn
- // break;
- // case 2: // $-nnn
- // break;
- case 3: // $nnn-
- buffy[--position] = '-';
- break;
- case 4: // (nnn$)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 5: // -nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 6: // nnn-$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 7: // nnn$-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 8: // -nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- // case 9: // -$ nnn
- // break;
- case 10: // nnn $-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 11: // $ nnn-
- buffy[--position] = '-';
- break;
- // case 12: // $ -nnn
- // break;
- case 13: // nnn- $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- case 14: // ($ nnn)
- buffy[--position] = ')';
- break;
- case 15: // (nnn $)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // just in place to take care of the negative boundries (Int32.MinValue)
- if (negative) {
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 1: // -$nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 2: // $-nnn
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 3: // $nnn-
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 4: // (nnn$)
- buffy[--position] = '(';
- break;
- case 5: // -nnn$
- buffy[--position] = '-';
- break;
- // case 6: // nnn-$
- // break;
- // case 7: // nnn$-
- // break;
- case 8: // -nnn $
- buffy[--position] = '-';
- break;
- // case 9: // -$ nnn
- // break;
- // case 10: // nnn $-
- // break;
- case 11: // $ nnn-
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 12: // $ -nnn
- buffy[--position] = '-';
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 13: // nnn- $
- // break;
- case 14: // ($ nnn)
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 15: // (nnn $)
- buffy[--position] = '(';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatCurrency (long value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = negative ? nfi.CurrencyNegativePattern : nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -$nnn
- // break;
- // case 2: // $-nnn
- // break;
- case 3: // $nnn-
- buffy[--position] = '-';
- break;
- case 4: // (nnn$)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 5: // -nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 6: // nnn-$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 7: // nnn$-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 8: // -nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- // case 9: // -$ nnn
- // break;
- case 10: // nnn $-
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 11: // $ nnn-
- buffy[--position] = '-';
- break;
- // case 12: // $ -nnn
- // break;
- case 13: // nnn- $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- case 14: // ($ nnn)
- buffy[--position] = ')';
- break;
- case 15: // (nnn $)
- buffy[--position] = ')';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- if (negative) {
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // ($nnn)
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 1: // -$nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- case 2: // $-nnn
- buffy[--position] = '-';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 3: // $nnn-
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 4: // (nnn$)
- buffy[--position] = '(';
- break;
- case 5: // -nnn$
- buffy[--position] = '-';
- break;
- // case 6: // nnn-$
- // break;
- // case 7: // nnn$-
- // break;
- case 8: // -nnn $
- buffy[--position] = '-';
- break;
- // case 9: // -$ nnn
- // break;
- // case 10: // nnn $-
- // break;
- case 11: // $ nnn-
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- case 12: // $ -nnn
- buffy[--position] = '-';
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 13: // nnn- $
- // break;
- case 14: // ($ nnn)
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = '(';
- break;
- case 15: // (nnn $)
- buffy[--position] = '(';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatCurrency (sbyte value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((int)value, precision, nfi);
- }
-
- private static string FormatCurrency (ushort value, int precision, NumberFormatInfo nfi)
- {
- return FormatCurrency ((uint)value, precision, nfi);
- }
-
- private static string FormatCurrency (uint value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible, no negative
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatCurrency (ulong value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.CurrencyGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.CurrencyDecimalSeparator.ToCharArray ();
- char[] currencySymbol = nfi.CurrencySymbol.ToCharArray ();
- int[] groupSizes = nfi.CurrencyGroupSizes;
- int pattern = nfi.CurrencyPositivePattern;
- int symbolLength = currencySymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.CurrencyDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible, no negative
- i = symbolLength;
- switch (pattern) {
- // case 0: // $nnn
- // break;
- case 1: // nnn$
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 2: // $ nnn
- // break;
- case 3: // nnn $
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- i = symbolLength;
- switch (pattern) {
- case 0: // $nnn
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 1: // nnn$
- // break;
- case 2: // $ nnn
- buffy[--position] = ' ';
- do {
- buffy[--position] = currencySymbol[--i];
- } while (i > 0);
- break;
- // case 3: // nnn $
- // break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Format Decimal Types ============ //
-
- //
- // Used only for integral data types. Negative values are
- // represented by using a '-' sign. The precision specifies
- // how many digits are to appear in the string. If it is >
- // how many digits we need, the left side is padded w/ 0's.
- // If it is smaller than what we need, it is discarded.
- //
- // Fairly simple implementation. Fill the buffer from right
- // to left w/ numbers, then if we still have precision left
- // over, pad w/ zeros.
- //
-
- private static string FormatDecimal (byte value, int precision)
- {
- return FormatDecimal ((uint)value, precision);
- }
-
- private static string FormatDecimal (short value, int precision)
- {
- return FormatDecimal ((int)value, precision);
- }
-
- private static string FormatDecimal (int value, int precision)
- {
- int size = (precision > 0) ? (maxIntLength + precision) : maxIntLength;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatDecimal (long value, int precision)
- {
- int size = (precision > 0) ? (maxLongLength + precision) : maxLongLength;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatDecimal (sbyte value, int precision)
- {
- return FormatDecimal ((int)value, precision);
- }
-
- private static string FormatDecimal (ushort value, int precision)
- {
- return FormatDecimal ((uint)value, precision);
- }
-
- private static string FormatDecimal (uint value, int precision)
- {
- int size = (precision > 0) ? (maxIntLength + precision) : maxIntLength;
- char[] buffy = new char[size];
- int position = size;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatDecimal (ulong value, int precision)
- {
- int size = (precision > 0) ? (maxLongLength + precision) : maxLongLength;
- char[] buffy = new char[size];
- int position = size;
-
- // get our value into a buffer from right to left
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // if we have precision left over, fill with 0's
- precision -= (size - position);
- while (precision-- > 0 && position > 1)
- buffy[--position] = '0';
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Format Exponentials ============ //
-
- //
- // Used for strings in the format [-]M.DDDDDDe+XXX.
- // Exaclty one non-zero digit must appear in M, w/
- // a '-' sign if negative. The precision determines
- // number of decimal places, if not given go 6 places.
- // If precision > the number of places we need, it
- // is right padded w/ 0's. If it is smaller than what
- // we need, we cut off and round. The format specifier
- // decides whether we use an uppercase E or lowercase e.
- //
- // Tried to do this in one pass of one buffer, but it
- // wasn't happening. Get a buffer + 7 extra slots for
- // the -, ., E, +, and XXX. Parse the value into another
- // temp buffer, then build the new string. For the
- // integral data types, there are a couple things that
- // can be hardcoded. Since an int and a long can't be
- // larger than 20 something spaces, the first X w/
- // always be 0, and the the exponential value will only
- // be 2 digits long. Also integer types w/ always
- // have a positive exponential.
- //
-
- private static string FormatExponential (byte value, int precision, bool upper)
- {
- return FormatExponential ((uint)value, precision, upper);
- }
-
- private static string FormatExponential (short value, int precision, bool upper)
- {
- return FormatExponential ((int)value, precision, upper);
- }
-
- private static string FormatExponential (int value, int precision, bool upper)
- {
- bool negative = (value < 0);
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxIntLength];
- int exponent = 0, position = maxIntLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- uint number = (negative) ? (uint)((-(value + 1)) + 1) : (uint)value;
-
- // need to calculate the number of places to know if we need to round later
- if (negative && value <= -10) {
- value /= -10;
- exp++;
- }
-
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // go left to right in filling up new string
- if (negative)
- buffy[idx++] = '-';
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxIntLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- private static string FormatExponential (long value, int precision, bool upper)
- {
- bool negative = (value < 0);
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxLongLength];
- int exponent = 0, position = maxLongLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- ulong number = (negative) ? (ulong)((-(value + 1)) + 1) : (ulong)value;
-
- // need to calculate the number of places to know if we need to round later
- if (negative && value <= -10) {
- value /= -10;
- exp++;
- }
-
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // go left to right in filling up new string
- if (negative)
- buffy[idx++] = '-';
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxLongLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- private static string FormatExponential (sbyte value, int precision, bool upper)
- {
- return FormatExponential ((int)value, precision, upper);
- }
-
- private static string FormatExponential (ushort value, int precision, bool upper)
- {
- return FormatExponential ((uint)value, precision, upper);
- }
-
- private static string FormatExponential (uint value, int precision, bool upper)
- {
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxIntLength];
- int exponent = 0, position = maxIntLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
- ulong number = (ulong)value;
-
- // need to calculate the number of places to know if we need to round later
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxIntLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- private static string FormatExponential (ulong value, int precision, bool upper)
- {
- int padding = (precision >= 0) ? precision : 6;
- char[] buffy = new char[(padding + 8)];
- char[] tmp = new char [maxLongLength];
- int exponent = 0, position = maxLongLength;
- int exp = 0, idx = 0;
- ulong pow = 10;
- ulong number = value;
-
- // need to calculate the number of places to know if we need to round later
- while (value >= 10) {
- value /= 10;
- exp++;
- }
-
- if (exp > padding) {
-
- // highest number we should goto before we round
- while (idx++ <= padding)
- pow *= 10;
-
- // get our value into a buffer
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
- }
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number% 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
- idx = 0;
-
- // we know we have at least one in there, followed
- // by a decimal point
- buffy[idx++] = tmp[position++];
- if (precision != 0)
- buffy[idx++] = '.';
-
- // copy over the remaining digits until we run out,
- // or we've passed our specified precision
- while (padding > 0 && position < maxLongLength) {
- buffy[idx++] = tmp[position++];
- padding--;
- }
-
- // if we still have more precision to go, add some
- // zeros
- while (padding > 0) {
- buffy[idx++] = '0';
- padding--;
- }
-
- // we know these next 3 spots
- buffy[idx++] = upper ? 'E' : 'e';
- buffy[idx++] = '+';
- buffy[idx++] = '0';
-
- // next two digits depend on our length
- if (exponent >= 10) {
- buffy[idx++] = digitLowerTable[(exponent / 10)];
- buffy[idx] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[idx++] = '0';
- buffy[idx] = digitLowerTable[exponent];
- }
-
- return new string(buffy, 0, ++idx);
- }
-
- // ============ Format Fixed Points ============ //
-
- //
- // Used for strings in the following form "[-]M.DD...D"
- // At least one non-zero digit precedes the '.', w/ a
- // '-' before that if negative. Precision specifies number
- // of decimal places 'D' to go. If not given, use
- // NumberFormatInfo.NumbeDecimalDigits. Results are rounded
- // if necessary.
- //
- // Fairly simple implementation for integral types. Going
- // from right to left, fill up precision number of 0's,
- // plop a . down, then go for our number.
- //
-
- private static string FormatFixedPoint (byte value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((uint)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (short value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((int)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (int value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxIntLength) : (nfi.NumberDecimalDigits + maxIntLength);
- char[] buffy = new char[padding];
- int position = padding;
- bool negative = (value < 0);
-
- // fill up w/ precision # of 0's
- while (position > (maxIntLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- if (negative)
- if (value <= -10) {
- buffy[position--] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (padding - position));
- }
-
- private static string FormatFixedPoint (long value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxLongLength) : (nfi.NumberDecimalDigits + maxLongLength);
- char[] buffy = new char[padding];
- int position = padding;
- bool negative = (value < 0);
-
- // fill up w/ precision # of 0's
- while (position > (maxLongLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- if (negative)
- if (value <= -10) {
- buffy[position--] = digitLowerTable[-(value % 10)];
- value = value / -10;
- } else value = -value;
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- if (negative)
- buffy[--position] = '-';
-
- return new string (buffy, position, (padding - position));
- }
-
- private static string FormatFixedPoint (sbyte value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((int)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (ushort value, int precision, NumberFormatInfo nfi)
- {
- return FormatFixedPoint ((uint)value, precision, nfi);
- }
-
- private static string FormatFixedPoint (uint value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxIntLength) : (nfi.NumberDecimalDigits + maxIntLength);
- char[] buffy = new char[padding];
- int position = padding;
-
- // fill up w/ precision # of 0's
- while (position > (maxIntLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- return new string (buffy, position, (padding - position));
- }
-
- private static string FormatFixedPoint (ulong value, int precision, NumberFormatInfo nfi)
- {
- int padding = (precision >= 0) ? (precision + maxLongLength) : (nfi.NumberDecimalDigits + maxLongLength);
- char[] buffy = new char[padding];
- int position = padding;
-
- // fill up w/ precision # of 0's
- while (position > (maxLongLength - 1))
- buffy[--position] = '0';
-
- if (precision != 0)
- buffy[position--] = '.';
-
- // fill up w/ the value
- while (value >= 10) {
- buffy[position--] = digitLowerTable[(value % 10)];
- value = value / 10;
- }
-
- buffy[position] = digitLowerTable[value];
-
- return new string (buffy, position, (padding - position));
- }
-
- // ============ Format General ============ //
-
- //
- // Strings are formatted in either Fixed Point or Exponential
- // format. Results are rounded when needed. If no precision is
- // given, the defaults are:
- //
- // short & ushort: 5
- // int & uint: 10
- // long & ulong: 19
- // float: 7
- // double: 15
- // decimal: 29
- //
- // The value is formatted using fixed-point if exponent >= -4
- // and exponent < precision, where exponent is he exponenent of
- // the value in exponential format. The decimal point and trailing
- // zeros are removed when possible.
- //
- // For all other values, exponential format is used. The case of
- // the format specifier determines whether 'e' or 'E' prefixes
- // the exponent.
- //
- // In either case, the number of digits that appear in the result
- // (not including the exponent) will not exceed the value of the
- // precision. The result is rounded as needed.
- //
- // Integral values are formatted using Fixed Point whenever
- // precision is omitted. (This actually doesn't make sense when
- // coupled w/ the 1st paragraph).
- //
- // Okay, so the decimal point is removed along with any trailing
- // zeros. So, ignoring the last paragraph, we can consider an int
- // ToString() to format it w/ exponential format w/ a default
- // precision of 10, but since it will just be .00000000, it's
- // discarded.
- //
-
- internal static string FormatGeneral (byte value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((uint)value, precision, nfi, upper);
- }
-
- internal static string FormatGeneral (short value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((int)value, precision, nfi, upper);
- }
-
- internal static string FormatGeneral (int value, int precision, NumberFormatInfo nfi, bool upper)
- {
- bool negative = (value < 0);
- char[] tmp = new char [maxIntLength];
- int exponent = 0;
- int position = maxIntLength;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- uint number = (negative) ? (uint)((-(value + 1)) + 1) : (uint)value;
-
- // get number into a buffer, going to be doing this no matter what
- if (negative)
- if (value <= -10) {
- tmp[--position] = digitLowerTable[-(value % 10)];
- value /= -10;
- exponent++;
- } else value = -value;
-
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[value];
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision) {
- if (negative)
- tmp[--position] = '-';
-
- return new string (tmp, position, (maxIntLength - position));
- }
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxIntLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)(precision + 6);
- char[] buffy = new char[pow];
-
- if (negative)
- buffy[position++] = '-';
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- internal static string FormatGeneral (long value, int precision, NumberFormatInfo nfi, bool upper)
- {
- bool negative = (value < 0);
- char[] tmp = new char [maxLongLength];
- int exponent = 0;
- int position = maxLongLength;
-
- // ugly, but doing it since abs(Int32.MinValue) > Int.MaxValue
- ulong number = (negative) ? (ulong)(-(value + 1) + 1) : (ulong)value;
-
- // get number into a buffer, going to be doing this no matter what
- if (negative)
- if (value <= -10) {
- tmp[--position] = digitLowerTable[-(value % 10)];
- value /= -10;
- } else value = -value;
-
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- tmp[--position] = digitLowerTable[value];
- exponent = (maxLongLength - position) - 1;
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision) {
- if (negative)
- tmp[--position] = '-';
-
- return new string (tmp, position, (maxLongLength - position));
- }
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxLongLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)precision + 6;
- char[] buffy = new char[pow];
-
- if (negative)
- buffy[position++] = '-';
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- internal static string FormatGeneral (sbyte value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((int)value, precision, nfi, upper);
- }
-
- internal static string FormatGeneral (ushort value, int precision, NumberFormatInfo nfi, bool upper) {
- return FormatGeneral ((uint)value, precision, nfi, upper);
- }
-
- internal static string FormatGeneral (uint value, int precision, NumberFormatInfo nfi, bool upper)
- {
- char[] tmp = new char [maxIntLength];
- int exponent = 0;
- int position = maxIntLength;
- ulong number = (ulong)value;
-
- // get number into a buffer, going to be doing this no matter what
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- }
-
- tmp[--position] = digitLowerTable[value];
- exponent = (maxIntLength - position) - 1;
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision)
- return new string (tmp, position, (maxIntLength - position));
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxIntLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)(precision + 6);
- char[] buffy = new char[pow];
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- internal static string FormatGeneral (ulong value, int precision, NumberFormatInfo nfi, bool upper)
- {
- char[] tmp = new char [maxLongLength];
- int exponent = 0;
- int position = maxLongLength;
- ulong number = value;
-
- // get number into a buffer, going to be doing this no matter what
- while (value >= 10) {
- tmp[--position] = digitLowerTable[(value % 10)];
- value /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[value];
-
- // integral values are formatted using fixed point when precision
- // is not specified. But also trailing decimal point and zeros are
- // discared. So for int's it will always be .00, so just compute
- // here and save the call to FormatFixedPoint & trim.
- if (precision <= 0 || exponent < precision)
- return new string (tmp, position, (maxLongLength - position));
-
- // else our exponent was > precision, use exponential format
- // precision = number of digits to show.
- int idx = 0;
- ulong pow = 1;
-
- exponent = 0;
- position = maxLongLength;
-
- // Loop through while our number is less than the 10 ^ precision, then
- // add 5 to that to round it out, and keep continuing
- while (idx++ <= precision)
- pow *= 10;
-
- while (number > pow) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- number += 5;
-
- while (number >= 10) {
- tmp[--position] = digitLowerTable[(number % 10)];
- number /= 10;
- exponent++;
- }
-
- tmp[--position] = digitLowerTable[number];
-
- // finally, make our final buffer, at least precision + 6 for 'E+XX' and '-'
- // and reuse pow for size
- idx = position;
- position = 0;
- pow = (ulong)precision + 6;
- char[] buffy = new char[pow];
-
- buffy[position++] = tmp[idx++];
- buffy[position] = '.';
-
- // for the remaining precisions copy over rounded tmp
- precision--;
- while (precision-- > 0)
- buffy[++position] = tmp[idx++];
-
- // get rid of ending zeros
- while (buffy[position] == '0')
- position--;
-
- // if we backed up all the way to the ., over write it
- if (buffy[position] != '.')
- position++;
-
- // ints can only be +, e or E depending on format, plus XX
- buffy[position++] = upper ? 'E' : 'e';
- buffy[position++] = '+';
-
- if (exponent >= 10) {
- buffy[position++] = digitLowerTable[(exponent / 10)];
- buffy[position++] = digitLowerTable[(exponent % 10)];
- } else {
- buffy[position++] = '0';
- buffy[position++] = digitLowerTable[exponent];
- }
-
- return new string (buffy, 0, position);
- }
-
- // ============ Format Number ============ //
-
- //
- // Used for strings in the following form "[-]d,ddd,ddd.dd...d"
- // The minus sign only appears if it is negative. At least one
- // non-zero digit preceeds the decimal separator. The precision
- // specifier determines the number of decimal places. If it is
- // not given, use NumberFormatInfo.NumberDecimalDigits.
- // The NumberGroupSizes, NumberGroupSeparator, and NumberDecimalSeparator
- // members of NumberFormatInfo supply the size and separator
- // for digit groupings. See IFormattable.
- //
- // The group sizes is an array of ints that determine the grouping
- // of numbers. All digits are in the range 1-9, with the last digit
- // being between 0-9. The number formats the string backwards, with
- // the last digit being the group size for the rest of (leftmost) the
- // the string, 0 being none.
- //
- // For instance:
- // groupSizes = { 3, 2, 1, 0 };
- // int n = 1234567890 => "1234,5,67,890"
- // groupSizes = { 3, 2, 1 };
- // int n = 1234567890 => "1,2,3,4,5,67,890"
- // groupSizes = { 2, 0 };
- // int n = 1234567890 => "1234567,90";
- //
- // Not too difficult, jsut keep track of where you are in the array
- // and when to print the separator
- //
- // The max size of the buffer is assume we have a separator every
- // number, plus the precision on the end, plus a spot for the negative
- // and a spot for decimal separator.
- //
-
- private static string FormatNumber (byte value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((uint)value, precision, nfi);
- }
-
- private static string FormatNumber (short value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((int)value, precision, nfi);
- }
-
- private static string FormatNumber (int value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int pattern = nfi.NumberNegativePattern;
- int size = maxIntLength + (maxIntLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 4;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -nnn
- // break;
- // case 2: // - nnn
- // break;
- case 3: // nnn-
- buffy[--position] = '-';
- break;
- case 4: // nnn -
- buffy[--position] = '-';
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = '(';
- break;
- case 1: // -nnn
- buffy[--position] = '-';
- break;
- case 2: // - nnn
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- // case 3: // nnn-
- // break;
- // case 4: // nnn -
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatNumber (long value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int pattern = nfi.NumberNegativePattern;
- int size = maxLongLength + (maxLongLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 4;
- char[] buffy = new char[size];
- int position = size;
- bool negative = (value < 0);
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = ')';
- break;
- // case 1: // -nnn
- // break;
- // case 2: // - nnn
- // break;
- case 3: // nnn-
- buffy[--position] = '-';
- break;
- case 4: // nnn -
- buffy[--position] = '-';
- buffy[--position] = ' ';
- break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // pattern for negative values, defined in NumberFormatInfo
- if (negative) {
- switch (pattern) {
- case 0: // (nnn)
- buffy[--position] = '(';
- break;
- case 1: // -nnn
- buffy[--position] = '-';
- break;
- case 2: // - nnn
- buffy[--position] = ' ';
- buffy[--position] = '-';
- break;
- // case 3: // nnn-
- // break;
- // case 4: // nnn -
- // break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatNumber (sbyte value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((int)value, precision, nfi);
- }
-
- private static string FormatNumber (ushort value, int precision, NumberFormatInfo nfi) {
- return FormatNumber ((uint)value, precision, nfi);
- }
-
- private static string FormatNumber (uint value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int size = maxIntLength + (maxIntLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 2;
- char[] buffy = new char[size];
- int position = size;
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatNumber (ulong value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- char[] groupSeparator = nfi.NumberGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.NumberDecimalSeparator.ToCharArray ();
- int[] groupSizes = nfi.NumberGroupSizes;
-
- int padding = (precision >= 0) ? precision : nfi.NumberDecimalDigits;
- int size = maxLongLength + (maxLongLength * groupSeparator.Length) + padding +
- decimalSeparator.Length + 2;
- char[] buffy = new char[size];
- int position = size;
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator
- if (position != size) {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Percent Formatting ============ //
-
- //
- // Percent Format: Used for strings containing a percentage. The
- // PercentSymbol, PercentGroupSizes, PercentGroupSeparator, and
- // PercentDecimalSeparator members of a NumberFormatInfo supply
- // the Percent symbol, size and separator for digit groupings, and
- // decimal separator, respectively.
- // PercentNegativePattern and PercentPositivePattern determine the
- // symbols used to represent negative and positive values. For example,
- // a negative value may be prefixed with a minus sign, or enclosed in
- // parentheses.
- // If no precision is specified, the number of decimal places in the result
- // is set by NumberFormatInfo.PercentDecimalDigits. Results are
- // rounded to the nearest representable value when necessary.
- // The result is scaled by 100 (.99 becomes 99%).
- //
- // The pattern of the number determines how the output looks, where
- // the percent sign goes, where the negative sign goes, etc.
- // IFormattable documentation lists the patterns and their values,
- // I have them commented out in the switch statement
- //
-
- private static string FormatPercent (byte value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((uint)value, precision, nfi);
- }
-
- private static string FormatPercent (short value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((int)value, precision, nfi);
- }
-
- private static string FormatPercent (int value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = negative ? nfi.PercentNegativePattern : nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // %nnn
- // break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // all values are multiplied by 100, so tack on two 0's
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- buffy[--position] = '-';
- break;
- case 1: // -nnn%
- buffy[--position] = '-';
- break;
- case 2: // -%nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatPercent (long value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
- bool negative = (value < 0);
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = negative ? nfi.PercentNegativePattern : nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- case 0: // nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // %nnn
- // break;
- }
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- // all values are multiplied by 100, so tack on two 0's
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- // negative hack for numbers past MinValue
- if (negative)
- if (value <= -10) {
- buffy[--position] = digitLowerTable[-(value % 10)];
- value = value / -10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- } else value = -value;
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- // end the pattern on the left hand side
- if (negative) {
- i = symbolLength;
-
- switch (pattern) {
- case 0: // -nnn %
- buffy[--position] = '-';
- break;
- case 1: // -nnn%
- buffy[--position] = '-';
- break;
- case 2: // -%nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = '-';
- break;
- }
- } else {
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatPercent (sbyte value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((int)value, precision, nfi);
- }
-
- private static string FormatPercent (ushort value, int precision, NumberFormatInfo nfi)
- {
- return FormatPercent ((uint)value, precision, nfi);
- }
-
- private static string FormatPercent (uint value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxIntLength + (groupSeparator.Length * maxIntLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- i = symbolLength;
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- private static string FormatPercent (ulong value, int precision, NumberFormatInfo nfi)
- {
- int i, j, k;
-
- char[] groupSeparator = nfi.PercentGroupSeparator.ToCharArray ();
- char[] decimalSeparator = nfi.PercentDecimalSeparator.ToCharArray ();
- char[] percentSymbol = nfi.PercentSymbol.ToCharArray ();
- int[] groupSizes = nfi.PercentGroupSizes;
- int pattern = nfi.PercentPositivePattern;
- int symbolLength = percentSymbol.Length;
-
- int padding = (precision >= 0) ? precision : nfi.PercentDecimalDigits;
- int size = maxLongLength + (groupSeparator.Length * maxLongLength) + padding + 2 +
- decimalSeparator.Length + symbolLength;
- char[] buffy = new char[size];
- int position = size;
-
- // set up the pattern from IFormattible
- i = symbolLength;
- switch (pattern) {
- case 0: // -nnn %
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- buffy[--position] = ' ';
- break;
- case 1: // -nnn%
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- // case 2: // -%nnn
- // break;
- }
-
- // right pad it w/ precision 0's
- while (padding-- > 0)
- buffy[--position] = '0';
-
- // put on decimal separator if we moved over and put a 0
- if (position < size && buffy[position] == '0') {
- i = decimalSeparator.Length;
- do {
- buffy[--position] = decimalSeparator[--i];
- } while (i > 0);
- }
-
- // loop through, keeping track of where you are in the
- // group sizes array and putting out the group separator
- // when needed
- j = 0;
- k = groupSizes[j++];
-
- if (value != 0)
- for (int c = 0; c < 2; c++) {
- buffy[--position] = '0';
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- while (value >= 10) {
- buffy[--position] = digitLowerTable[(value % 10)];
- value /= 10;
-
- if (--k == 0) {
- i = groupSeparator.Length;
- do {
- buffy[--position] = groupSeparator[--i];
- } while (i > 0);
-
- k = (j < groupSizes.Length) ?
- groupSizes[j++] : groupSizes[(groupSizes.Length - 1)];
- }
- }
-
- buffy[--position] = digitLowerTable[value];
-
- i = symbolLength;
- switch (pattern) {
- // case 0: // nnn %
- // break;
- // case 1: // nnn%
- // break;
- case 2: // %nnn
- do {
- buffy[--position] = percentSymbol[--i];
- } while (i > 0);
- break;
- }
-
- return new string (buffy, position, (size - position));
- }
-
- // ============ Format Hexadecimal ============ //
-
- //
- // For strings in base 16. Only valid w/ integers. Precision
- // specifies number of digits in the string, if it specifies
- // more digits than we need, left pad w/ 0's. The case of the
- // the format specifier 'X' or 'x' determines lowercase or
- // capital digits in the output.
- //
- // Whew. Straight forward Hex formatting, however only
- // go 8 places max when dealing with an int (not counting
- // precision padding) and 16 when dealing with a long. This
- // is to cut off the loop when dealing with negative values,
- // which will loop forever when you hit -1;
- //
-
- private static string FormatHexadecimal (byte value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxByteLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- ushort mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[(value & mask)];
- value = (byte)(value >> 4);
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (short value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxShortLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- short mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 4 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = (short)(value >> 4);
- } while (value != 0 && position > (size - 4));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (int value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxIntLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- int mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 8 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = value >> 4;
- } while (value != 0 && position > (size - 8));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (long value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxLongLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- long mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 16 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = value >> 4;
- } while (value != 0 && position > (size - 16));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (sbyte value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxByteLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- short mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. If value is negavite stop after 2 F's
- do {
- buffy[--position] = table[(value & mask)];
- value = (sbyte)(value >> 4);
- } while (value != 0 && position > (size - 2));
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (ushort value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxShortLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- int mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[(value & mask)];
- value = (ushort)(value >> 4);
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (uint value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxIntLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- uint mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[(value & mask)];
- value = value >> 4;
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- private static string FormatHexadecimal (ulong value, int precision, bool upper)
- {
- if (precision < 0) precision = 0;
- int size = maxLongLength + precision;
- char[] buffy = new char[size];
- char[] table = upper ? digitUpperTable : digitLowerTable;
- int position = size;
- ulong mask = (1 << 4) - 1;
-
- // loop through right to left, shifting and looking up
- // our value. Don't worry about negative
- do {
- buffy[--position] = table[value & mask];
- value = value >> 4;
- } while (value != 0);
-
- // pad w/ 0's if they want more length, if not, ignore
- precision -= (size - position);
- while (precision > 0 && position > 1) {
- buffy[--position] = '0';
- precision--;
- }
-
- return new string(buffy, position, (size - position));
- }
-
- // ============ Format Custom ============ //
-
- private static string FormatCustom (string format, sbyte number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- int sign = (number < 0) ? -1 : (number > 0) ? 1 : 0;
- return fp.FormatNumber (strnum, sign);
- }
-
- private static string FormatCustom (string format, short number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- int sign = (number < 0) ? -1 : (number > 0) ? 1 : 0;
- return fp.FormatNumber (strnum, sign);
- }
-
- private static string FormatCustom (string format, int number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- int sign = (number < 0) ? -1 : (number > 0) ? 1 : 0;
- return fp.FormatNumber (strnum, sign);
- }
-
- private static string FormatCustom (string format, long number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- int sign = (number < 0) ? -1 : (number > 0) ? 1 : 0;
- return fp.FormatNumber (strnum, sign);
- }
-
- private static string FormatCustom (string format, byte number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- return fp.FormatNumber (strnum, (number == 0) ? 0 : 1);
- }
-
- private static string FormatCustom (string format, ushort number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- return fp.FormatNumber (strnum, (number == 0) ? 0 : 1);
- }
-
- private static string FormatCustom (string format, uint number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- return fp.FormatNumber (strnum, (number == 0) ? 0 : 1);
- }
-
- private static string FormatCustom (string format, ulong number, NumberFormatInfo nfi)
- {
- string strnum = FormatGeneral (number, -1, nfi, true);
- FormatParse fp = new FormatParse (format); // FIXME: use nfi!
- return fp.FormatNumber (strnum, (number == 0) ? 0 : 1);
- }
- }
-
-class FormatSection {
- public int nph;
- public int nphPreDot;
- public int npercent;
- public int ndividers;
- public int ntokens;
- public string [] tokens;
- public int [] TokenTypes;
- public bool HaveDot;
- public bool HaveSci;
- public bool sciSignAlways = false;
- public int sciDigits;
- public int numCommas;
-}
-
-class FormatParse {
- const int AS_IS = 0;
- const int PH_0 = 1;
- const int PH_NUMBER = 2;
- const int COMMA = 3;
- const int PERCENT = 4;
- const int DIVIDERS = 5;
- const int DOT = 6;
- const int ESCAPE_SEQ = 7;
- const int SCIENTIFIC = 8;
- const int NEW_SECTION = 9;
- private FormatSection [] sections = new FormatSection[3];
- private int nsections = 0;
- private int pos; // Position in the format string
- private int group = 0; // Used in FormatPlain to insert a comma between groups of digits
- private bool isNegative;
-
- private FormatParse ()
- {
- }
-
- public FormatParse (string format)
- {
- parseFormat (format);
- }
-
- private void FormatSci (char [] digits, ArrayList outputList, FormatSection sec)
- {
- int tokidx = sec.ntokens - 1;
-
- // Output everything until we get to the SCIENTIFIC
- while (tokidx >= 0 && sec.TokenTypes [tokidx] != SCIENTIFIC){
- outputList.Add ((string) sec.tokens [tokidx--]);
- }
-
- // Exponent
- int exponent = digits.Length - sec.nph;
- outputList.Add ((string) exponent.ToString ());
- if (sec.sciSignAlways && exponent > 0)
- outputList.Add ("+");
- outputList.Add ((string) sec.tokens [tokidx--]);
-
- if (exponent < 0) {
- char [] newDigits;
- exponent = -exponent;
- newDigits = new char [digits.Length + exponent];
- Array.Copy (digits, 0, newDigits, exponent, digits.Length);
- for (int i = 0; i < exponent; i++)
- newDigits[i] = '0';
- digits = newDigits;
- }
-
- // Now format the rest
- int digitIdx = 0;
- if (sec.HaveDot)
- FormatDot (digits, ref digitIdx, outputList, sec, tokidx, 0);
- else
- FormatPlain (digits, ref digitIdx, outputList, sec, tokidx, 0, sec.numCommas > 0);
- }
-
- private void FormatDot (char [] digits, ref int digitIdx, ArrayList outputList,
- FormatSection sec, int lastToken, int firstToken)
- {
- int tokidx = lastToken;
- int type;
-
- while (tokidx >= firstToken) {
- type = sec.TokenTypes [tokidx];
- if (type == DOT || type == PH_NUMBER || type == PH_0)
- break;
- tokidx--;
- }
-
- if (tokidx > 0) {
- char [] postDotDigits = new char [sec.nph - sec.nphPreDot];
- int max = (postDotDigits.Length > digits.Length) ? digits.Length : postDotDigits.Length;
- Array.Copy (digits, 0, postDotDigits, 0, max);
- int postDotDigitsIdx = 0;
- FormatPlain (postDotDigits, ref postDotDigitsIdx, outputList, sec, lastToken, tokidx, false);
- tokidx--;
- digitIdx += max;
- FormatPlain (digits, ref digitIdx, outputList, sec, tokidx, 0, sec.numCommas > 0);
- }
- }
-
- private void FormatPlain (char [] digits, ref int digitIdx, ArrayList outputList,
- FormatSection sec, int lastToken, int firstToken, bool insertComma)
- {
- int tokidx = lastToken;
- int type;
-
- while (tokidx >= firstToken) {
- type = sec.TokenTypes [tokidx];
- if (type == PH_0 || type == PH_NUMBER) {
- //FIXME: PH_NUMBER should also check for significant digits
- // Console.WriteLine ("group : {0}", group);
- int i = sec.tokens [tokidx].Length - 1;
- while (i >= 0) {
- if (insertComma && group == 3) {
- outputList.Add (","); // FIXME: from NumberFormatInfo
- group = 0;
- }
-
- if (digitIdx < digits.Length)
- outputList.Add ((string) digits[digitIdx++].ToString ());
- else
- outputList.Add ("0");
- i--;
- if (insertComma)
- group++;
- sec.nph--;
- while (sec.nph == 0 && digitIdx < digits.Length) {
- // Flush the numbers left
- if (insertComma && group == 3){
- outputList.Add (","); // FIXME: from NumberFormatInfo
- group = 0;
- }
- outputList.Add ((string) digits [digitIdx++].ToString ());
- if (insertComma)
- group++;
- }
-
- if (sec.nph == 0 && isNegative)
- outputList.Add ("-");
- }
- } else {
- outputList.Add ((string) sec.tokens [tokidx]);
- }
- tokidx--;
- }
-
- }
-
- private char [] AdjustDigits (string number, FormatSection sec)
- {
- char [] digits = number.ToCharArray ();
- char [] newDigits = digits;
- int decPointIdx = 0;
- int postDot = 0;
-
- decPointIdx -= sec.ndividers * 3;
- decPointIdx += sec.npercent * 2;
- if (sec.HaveDot){
- postDot = sec.nph - sec.nphPreDot;
- decPointIdx += postDot;
- }
-
- if (decPointIdx > 0) {
- newDigits = new char [digits.Length + decPointIdx];
- Array.Copy (digits, 0, newDigits, 0, digits.Length);
- for (int i = 0; i < decPointIdx; i++)
- newDigits[digits.Length + i] = '0';
- } else if (decPointIdx < 0) {
- decPointIdx = -decPointIdx;
- if (decPointIdx >= digits.Length) {
- if (sec.HaveSci){
- } else {
- // The numbers turns into 0 when formatting applied
- digits = new char [1] {'0'};
- }
- } else {
- int newLength = digits.Length - decPointIdx + postDot - 1;
- newDigits = new char [newLength];
- int max = digits.Length >= newLength ? newLength : digits.Length;
- Array.Copy (digits, 0, newDigits, 0, max);
- if (newLength > digits.Length)
- for (int i = 0; i < decPointIdx; i++)
- newDigits[digits.Length + i] = '0';
- }
- }
-
- return newDigits;
- }
-
- public string FormatNumber (string number, int signValue)
- {
- char [] digits;
-
- isNegative = signValue < 0;
- int section = 0;
- if (signValue < 0 && nsections > 0)
- section = 1;
- if (signValue == 0 && nsections > 1)
- section = 2;
-
- if (number [0] == '-')
- number = number.Substring (1);
-
- FormatSection sec = sections [section];
- digits = AdjustDigits (number.ToString (), sec);
- if (digits.Length == 1 && digits [0] == '0')
- if (nsections > 2)
- sec = sections [2]; // Format as a 0
- else
- sec = sections [0]; // Format as positive
-
- ArrayList outputList = new ArrayList ();
-
- int digitIdx = 0;
- Array.Reverse (digits);
-
- if (sec.HaveSci)
- FormatSci (digits, outputList, sec);
- else if (sec.HaveDot)
- FormatDot (digits, ref digitIdx, outputList, sec, sec.ntokens - 1, 0);
- else
- FormatPlain (digits, ref digitIdx, outputList, sec, sec.ntokens - 1, 0, sec.numCommas > 0);
-
- string result = "";
- for (int i = outputList.Count - 1; i >= 0; i--) {
- result += (string) outputList[i];
- }
-
- return result;
- }
-
- private void parseFormat (string format)
- {
- char [] fmt_chars = format.ToCharArray ();
- int fmtlen = fmt_chars.Length;
- int type = AS_IS;
- int prevType = AS_IS;
- string token;
-
- sections[0] = new FormatSection();
- while (pos < fmtlen) {
-
- token = getNextToken (fmt_chars, fmtlen, out type);
- if (type == NEW_SECTION) {
- nsections++;
- if (nsections > 3)
- break;
- sections[nsections] = new FormatSection();
- } else {
- prevType = AddToken (token, type, prevType);
- }
- }
- }
-
- private int AddToken (string token, int type, int prevType)
- {
- FormatSection sec = sections[nsections];
- string [] newTokens = new string [sec.ntokens + 1];
- int [] newTokenTypes = new int [sec.ntokens + 1];
- for (int i = 0; i < sec.ntokens; i++) {
- newTokens[i] = sec.tokens[i];
- newTokenTypes[i] = sec.TokenTypes[i];
- }
-
- switch (type) {
- case ESCAPE_SEQ :
- type = AS_IS;
- break;
- case COMMA :
- if (!sec.HaveDot && (prevType == PH_0 || prevType == PH_NUMBER)) {
- sec.numCommas++;
- } else
- type = AS_IS;
-
- token = "";
- break;
- case DOT :
- if (!sec.HaveDot && (prevType == PH_0 || prevType == PH_NUMBER ||
- prevType == DIVIDERS || prevType == COMMA)) {
- sec.HaveDot = true;
- sec.nphPreDot = sec.nph;
- } else
- type = AS_IS;
-
- break;
- case PERCENT :
- sec.npercent++;
- break;
- case DIVIDERS :
- token = "";
- if (!sec.HaveDot)
- sec.ndividers = token.Length;
- else
- type = AS_IS;
- break;
- case PH_0 :
- if (!sec.HaveSci)
- sec.nph += token.Length;
- else
- type = AS_IS;
- break;
- case PH_NUMBER :
- if (!sec.HaveSci)
- sec.nph += token.Length;
- else
- type = AS_IS;
- break;
- case SCIENTIFIC :
- if (!sec.HaveSci && sec.nph > 0) {
- sec.HaveSci = true;
- char [] sci = token.ToCharArray ();
- sec.sciSignAlways = sci[1] == '+' ? true : false;
- int expLen = sci[1] == '0' ? token.Length - 1 : token.Length - 2;
- sec.sciDigits = expLen;
- token = sci[0].ToString ();
- } else {
- type = AS_IS;
- }
- break;
- }
-
- newTokens[sec.ntokens] = token;
- newTokenTypes[sec.ntokens] = type;
- sec.tokens = newTokens;
- sec.TokenTypes = newTokenTypes;
- sec.ntokens++;
- return type;
- }
-
- private string getNextToken (char [] fmt_chars, int fmtlen, out int type)
- {
- int curpos = pos;
- string result = null;
- char current;
-
- type = AS_IS; // Default
- current = fmt_chars[curpos];
- if (current == ';'){
- type = NEW_SECTION;
- result = "NEW_SECTION";
- pos++;
- }
- else if (current == '\'' || current == '"') {
- char Quote = current;
- curpos++;
- int endpos = Array.IndexOf (fmt_chars, current, curpos);
- if (endpos == -1)
- endpos = fmtlen;
- result = new string (fmt_chars, curpos, endpos - curpos);
- pos = endpos + 1;
- }
- else if (current == '\\') { //MS seems not to translate escape seqs!
- type = ESCAPE_SEQ;
- current = fmt_chars[++pos];
- result = current.ToString ();
- pos++;
- }
- else if (current == '%') {
- type = PERCENT;
- result = "%";
- pos++;
- }
- else if (current == '.') {
- type = DOT;
- result = ".";
- pos++;
- }
- else if (current == ',') {
- int begpos = curpos;
-
- while (++curpos < fmtlen && fmt_chars[curpos] == ',');
- if (curpos == fmtlen || fmt_chars[curpos] == '.') {
- // ,,,,
- result = new string (fmt_chars, begpos, curpos - begpos);
- type = DIVIDERS;
- pos = curpos;
- } else {
- result = ",";
- type = COMMA;
- pos++;
- }
- }
- else if (current == '0' || current == '#') {
- char placeHolder = current;
- int begpos = curpos;
- type = placeHolder == '0' ? PH_0 : PH_NUMBER;
- curpos++;
- while (curpos < fmtlen && fmt_chars [curpos] == placeHolder)
- curpos++;
- result = new string (fmt_chars, begpos, curpos - begpos);
- pos = curpos;
- }
- else if (current == 'e' || current == 'E') {
- if (fmtlen <= curpos + 1){
- result = current.ToString ();
- pos++;
- }
- else {
- char next1 = fmt_chars [curpos + 1];
-
- if (next1 != '-' && next1 != '+' && next1 != '0') {
- result = new string (fmt_chars, curpos, 2);
- pos += 2;
- }
- else {
- int begpos = curpos;
-
- if (next1 == '-' || next1 == '+')
- curpos++;
-
- curpos++;
-
- if (curpos < fmtlen && fmt_chars [curpos] == '0'){
- type = SCIENTIFIC;
- while (curpos < fmtlen && fmt_chars [curpos] == '0')
- curpos++;
- }
-
- result = new string (fmt_chars, begpos, curpos - begpos);
- pos = curpos;
- }
- }
- }
- else {
- char [] format_spec = { '0', '#', ',', '.', '%', 'E', 'e', '"', '\'', '\\' };
- int nextFE;
-
- while (curpos < fmtlen) {
- current = fmt_chars[curpos];
- nextFE = Array.IndexOf (format_spec, current);
- if (nextFE != -1)
- break;
- curpos++;
- }
-
- result = new string (fmt_chars, pos, curpos - pos);
- pos = curpos;
- }
-
- return result;
- }
-}
-
-}
diff --git a/mcs/class/corlib/System/InvalidCastException.cs b/mcs/class/corlib/System/InvalidCastException.cs
deleted file mode 100644
index 1d16ad5ce4d..00000000000
--- a/mcs/class/corlib/System/InvalidCastException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.InvalidCastException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class InvalidCastException : SystemException {
- // Constructors
- public InvalidCastException ()
- : base (Locale.GetText ("Cannot cast from source type to destination type"))
- {
- }
-
- public InvalidCastException (string message)
- : base (message)
- {
- }
-
- public InvalidCastException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected InvalidCastException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/InvalidOperationException.cs b/mcs/class/corlib/System/InvalidOperationException.cs
deleted file mode 100644
index fddef520eb6..00000000000
--- a/mcs/class/corlib/System/InvalidOperationException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.InvalidOperationException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
- [Serializable]
- public class InvalidOperationException : SystemException {
- // Constructors
- public InvalidOperationException ()
- : base (Locale.GetText ("The requested operation cannot be performed"))
- {
- }
-
- public InvalidOperationException (string message)
- : base (message)
- {
- }
-
- public InvalidOperationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected InvalidOperationException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/InvalidProgramException.cs b/mcs/class/corlib/System/InvalidProgramException.cs
deleted file mode 100644
index da235f0bf8e..00000000000
--- a/mcs/class/corlib/System/InvalidProgramException.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.InvalidProgramException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- [Serializable]
- public sealed class InvalidProgramException : SystemException {
- // Constructors
- public InvalidProgramException ()
- : base (Locale.GetText ("Metadata is incorrect"))
- {
- }
-
- public InvalidProgramException (string message)
- : base (message)
- {
- }
-
- public InvalidProgramException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/LoaderOptimization.cs b/mcs/class/corlib/System/LoaderOptimization.cs
deleted file mode 100644
index 23b865a32e5..00000000000
--- a/mcs/class/corlib/System/LoaderOptimization.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.LoaderOptimization.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- public enum LoaderOptimization
- {
- NotSpecified = 0,
- SingleDomain = 1,
- MultiDomain = 2,
- MultiDomainHost = 3
- }
-}
diff --git a/mcs/class/corlib/System/LoaderOptimizationAttribute.cs b/mcs/class/corlib/System/LoaderOptimizationAttribute.cs
deleted file mode 100644
index 5a531965306..00000000000
--- a/mcs/class/corlib/System/LoaderOptimizationAttribute.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.LoaderOptimizationAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- 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; }
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/LocalDataStoreSlot.cs b/mcs/class/corlib/System/LocalDataStoreSlot.cs
deleted file mode 100755
index 721d3ca880e..00000000000
--- a/mcs/class/corlib/System/LocalDataStoreSlot.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// System.LocalDataStoreSlot.cs
-//
-// Author:
-// Dick Porter (dick@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace System
-{
- public sealed class LocalDataStoreSlot
- {
- }
-}
diff --git a/mcs/class/corlib/System/MTAThreadAttribute.cs b/mcs/class/corlib/System/MTAThreadAttribute.cs
deleted file mode 100644
index 514bca495a4..00000000000
--- a/mcs/class/corlib/System/MTAThreadAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.MTAThreadAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class MTAThreadAttribute : Attribute
- {
- // Constructors
- public MTAThreadAttribute () : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/MarshalByRefObject.cs b/mcs/class/corlib/System/MarshalByRefObject.cs
deleted file mode 100644
index 53051ceba32..00000000000
--- a/mcs/class/corlib/System/MarshalByRefObject.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// System.MarshalByRefObject.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Remoting;
-
-namespace System {
-
- [Serializable]
- public abstract class MarshalByRefObject {
-
- public virtual ObjRef CreateObjRef (Type type)
- {
- return null;
- }
-
- public object GetLifetimeService ()
- {
- return null;
- }
-
- public virtual object InitializeLifetimeService ()
- {
- return null;
- }
-
- protected MarshalByRefObject ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Math.cs b/mcs/class/corlib/System/Math.cs
deleted file mode 100644
index b38a6766679..00000000000
--- a/mcs/class/corlib/System/Math.cs
+++ /dev/null
@@ -1,375 +0,0 @@
-//
-// System.Math.cs
-//
-// Author:
-// Bob Smith (bob@thestuff.net)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2001 Bob Smith. http://www.thestuff.net
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System
-{
-// [CLSCompliant(false)]
- public sealed class Math
- {
- public const double E = 2.7182818284590452354;
- public const double PI = 3.14159265358979323846;
-
- private Math () {}
-
- public static decimal Abs(decimal value)
- {
- return (value < 0)? -value: value;
- }
- public static double Abs(double value)
- {
- return (value < 0)? -value: value;
- }
- public static float Abs(float value)
- {
- return (value < 0)? -value: value;
- }
- public static int Abs(int value)
- {
- if (value == Int32.MinValue)
- throw new OverflowException (Locale.GetText (Locale.GetText ("Value is too small")));
- return (value < 0)? -value: value;
- }
- public static long Abs(long value)
- {
- if (value == Int64.MinValue)
- throw new OverflowException(Locale.GetText ("Value is too small"));
- return (value < 0)? -value: value;
- }
- [CLSCompliant (false)]
- public static sbyte Abs(sbyte value)
- {
- if (value == SByte.MinValue)
- throw new OverflowException(Locale.GetText ("Value is too small"));
- return (sbyte)((value < 0)? -value: value);
- }
- public static short Abs(short value)
- {
- if (value == Int16.MinValue)
- throw new OverflowException(Locale.GetText ("Value is too small"));
- return (short)((value < 0)? -value: value);
- }
-
- public static double Ceiling(double a)
- {
- if (Double.IsNaN(a)){
- return Double.NaN;
- }
-
- if (Double.IsNegativeInfinity(a)){
- return Double.NegativeInfinity;
- }
-
- if (Double.IsPositiveInfinity(a)){
- return Double.PositiveInfinity;
- }
-
- double b = (double)((long)a);
- return (b < a)? b+1: b;
- }
- public static double Floor(double d) {
- if (Double.IsNaN(d)){
- return Double.NaN;
- }
-
- if (Double.IsNegativeInfinity(d)){
- return Double.NegativeInfinity;
- }
-
- if (Double.IsPositiveInfinity(d)){
- return Double.PositiveInfinity;
- }
-
- double b = (double)((long)d);
- return (d < 0 && d != b) ? --b : b;
- }
- public static double IEEERemainder(double x, double y)
- {
- double r;
- if (y == 0) return Double.NaN;
- r = x - (y * Math.Round(x/y));
- if (r != 0) return r;
- return (x > 0)? 0: -0;
- }
- public static double Log(double a, double newBase)
- {
- if (a == 0) return Double.NegativeInfinity;
- else if (a < 0) return Double.NaN;
- return Log(a)/Log(newBase);
- }
-
- public static byte Max(byte val1, byte val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static decimal Max(decimal val1, decimal val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static double Max(double val1, double val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static float Max(float val1, float val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static int Max(int val1, int val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static long Max(long val1, long val2)
- {
- return (val1 > val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static sbyte Max(sbyte val1, sbyte val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static short Max(short val1, short val2)
- {
- return (val1 > val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static uint Max(uint val1, uint val2)
- {
- return (val1 > val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static ulong Max(ulong val1, ulong val2)
- {
- return (val1 > val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static ushort Max(ushort val1, ushort val2)
- {
- return (val1 > val2)? val1: val2;
- }
- public static byte Min(byte val1, byte val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static decimal Min(decimal val1, decimal val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static double Min(double val1, double val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static float Min(float val1, float val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static int Min(int val1, int val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static long Min(long val1, long val2)
- {
- return (val1 < val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static sbyte Min(sbyte val1, sbyte val2)
- {
- return (val1 < val2)? val1: val2;
- }
- public static short Min(short val1, short val2)
- {
- return (val1 < val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static uint Min(uint val1, uint val2)
- {
- return (val1 < val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static ulong Min(ulong val1, ulong val2)
- {
- return (val1 < val2)? val1: val2;
- }
-
- [CLSCompliant (false)]
- public static ushort Min(ushort val1, ushort val2)
- {
- return (val1 < val2)? val1: val2;
- }
-
- public static decimal Round(decimal d)
- {
- decimal r = (decimal)((long)d);
- decimal a = Abs (d - r);
- if (a > .5M) return (r >= 0 ? ++r : --r);
- else if (a <.5M) return r;
- else
- {
- if (r%2 == 0) return r;
- else return ++r;
- }
- }
- public static decimal Round(decimal d, int decimals)
- {
- long p = 1;
- int c;
- decimal retval = d;
- if (decimals < 0 || decimals > 15)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Value is too small or too big."));
- else if (decimals == 0)
- return Math.Round(d);
- for (c=0; c<decimals; c++) p*=10;
- retval*=p;
- retval=Math.Round(retval);
- retval/=p;
- return retval;
- }
- public static double Round(double d)
- {
- double r = (double)((long)d);
- double a = Abs (d - r);
- if (a > .5) return (r >= 0 ? ++r : --r);
- else if (a <.5) return r;
- else
- {
- if (r%2 == 0) return r;
- else return ++r;
- }
- }
- public static double Round(double value, int digits) {
- long p = 1;
- int c;
- double retval = value;
- if (digits < 0 || digits > 15)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Value is too small or too big."));
- else if (digits == 0)
- return Math.Round(value);
- for (c=0; c<digits; c++) p*=10;
- retval*=p;
- retval=Math.Round(retval);
- retval/=p;
- return retval;
- }
- public static int Sign(decimal value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(double value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(float value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(int value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(long value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
-
- [CLSCompliant (false)]
- public static int Sign(sbyte value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
- public static int Sign(short value)
- {
- if (value > 0) return 1;
- return (value == 0)? 0: -1;
- }
-
- // internal calls
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Sin (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Cos (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Tan (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Sinh (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Cosh (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Tanh (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Acos (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Asin (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Atan (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Atan2 (double y, double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Exp (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Log (double x);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Log10 (double x);
-
- public static double Pow (double x, double y) {
- if (Double.IsNaN (x) || Double.IsNaN (y))
- return Double.NaN;
- if (Double.IsNegativeInfinity (x))
- if (((int)y & 1) == 1)
- return Double.NegativeInfinity;
- else
- return Double.PositiveInfinity;
- if (Double.IsPositiveInfinity (x))
- if (Double.IsNegativeInfinity (y))
- return 0;
- else
- return Double.PositiveInfinity;
- if (Double.IsNegativeInfinity (y) || Double.IsPositiveInfinity (y))
- return Double.NaN;
-
- return PowImpl (x, y);
- }
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double PowImpl (double x, double y);
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- public extern static double Sqrt (double x);
- }
-}
diff --git a/mcs/class/corlib/System/MemberAccessException.cs b/mcs/class/corlib/System/MemberAccessException.cs
deleted file mode 100644
index 97a556fb7e4..00000000000
--- a/mcs/class/corlib/System/MemberAccessException.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class MemberAccessException : SystemException {
-
- public MemberAccessException ()
- : base (Locale.GetText ("A member access exception has occurred."))
- {
- }
-
- public MemberAccessException (string message)
- : base (message)
- {
- }
-
- protected MemberAccessException (SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public MemberAccessException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/MethodAccessException.cs b/mcs/class/corlib/System/MethodAccessException.cs
deleted file mode 100644
index 16295606174..00000000000
--- a/mcs/class/corlib/System/MethodAccessException.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// System.MethodAccessException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class MethodAccessException : MemberAccessException
- {
- // Constructors
- public MethodAccessException ()
- : base (Locale.GetText ("Attempt to access a private/protected method failed."))
- {
- }
-
- public MethodAccessException (string message)
- : base (message)
- {
- }
-
- protected MethodAccessException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public MethodAccessException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/MissingFieldException.cs b/mcs/class/corlib/System/MissingFieldException.cs
deleted file mode 100644
index 78feaab1fdb..00000000000
--- a/mcs/class/corlib/System/MissingFieldException.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// System.MissingFieldException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class MissingFieldException : MissingMemberException
- {
- // Constructors
- public MissingFieldException ()
- : base (Locale.GetText ("Field does not exist."))
- {
- }
-
- public MissingFieldException (string message)
- : base (message)
- {
- }
-
- protected MissingFieldException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public MissingFieldException (string message, Exception innerException)
- : base (message, innerException)
- {
- }
-
- public MissingFieldException (string className, string fieldName)
- : base (className, fieldName)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/MissingMemberException.cs b/mcs/class/corlib/System/MissingMemberException.cs
deleted file mode 100644
index f2215fa7543..00000000000
--- a/mcs/class/corlib/System/MissingMemberException.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.MissingMemberException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class MissingMemberException : MemberAccessException {
-
- // Fields
- protected string ClassName;
- protected string MemberName;
- protected byte[] Signature;
-
- public MissingMemberException ()
- : base (Locale.GetText ("A missing member exception has occurred."))
- {
- }
-
- public MissingMemberException (string message)
- : base (message)
- {
- }
-
- public MissingMemberException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected MissingMemberException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- ClassName = info.GetString ("MMClassName");
- MemberName = info.GetString ("MMMemberName");
- Signature = (byte[]) info.GetValue ("MMSignature", Signature.GetType ());
- }
-
- public MissingMemberException (string className, string memberName)
- {
- ClassName = className;
- MemberName = memberName;
- }
-
- // Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("MMClassName", ClassName);
- info.AddValue ("MMMemberName", MemberName);
- info.AddValue ("MMSignature", Signature);
- }
- }
-}
diff --git a/mcs/class/corlib/System/MissingMethodException.cs b/mcs/class/corlib/System/MissingMethodException.cs
deleted file mode 100644
index 90b3b3a9c85..00000000000
--- a/mcs/class/corlib/System/MissingMethodException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-using System.Runtime.Serialization;
-using System.Globalization;
-
-
-namespace System
-{
- [Serializable]
- public class MissingMethodException : MissingMemberException
- {
-
- public MissingMethodException ()
- : base (Locale.GetText ("A missing method exception has occurred."))
- {
- }
-
- public MissingMethodException (string message)
- : base (message)
- {
- }
-
- protected MissingMethodException (SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public MissingMethodException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- public MissingMethodException (string className, string methodName)
- : base (className, methodName)
- {
- }
- }
-}
-
-
diff --git a/mcs/class/corlib/System/MonoCustomAttrs.cs b/mcs/class/corlib/System/MonoCustomAttrs.cs
deleted file mode 100755
index 1954e2a293d..00000000000
--- a/mcs/class/corlib/System/MonoCustomAttrs.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-// System.MonoCustomAttrs.cs
-// Hooks into the runtime to get custom attributes for reflection handles
-//
-// Paolo Molaro (lupus@ximian.com)
-//
-// (c) 2002 Ximian, Inc.
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.Runtime.CompilerServices;
-
-namespace System {
- internal class MonoCustomAttrs {
-
- static Hashtable handle_to_attrs = new Hashtable ();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern object[] GetCustomAttributes (ICustomAttributeProvider obj);
-
- private static object[] from_cache (ICustomAttributeProvider obj) {
- object[] res = (object[])handle_to_attrs [obj];
- if (res != null)
- return res;
- res = GetCustomAttributes (obj);
- handle_to_attrs.Add (obj, res);
- return res;
- }
-
- internal static object[] GetCustomAttributes (ICustomAttributeProvider obj, Type attributeType, bool inherit) {
- object[] res = from_cache (obj);
- // shortcut
- if (res.Length == 1 && res[0].GetType () == attributeType)
- return (object[])res.Clone ();
- ArrayList a = new ArrayList ();
- Type btype = obj as Type;
- do {
- foreach (object attr in res) {
- if (attributeType.Equals (attr.GetType ()))
- a.Add (attr);
- }
- if (btype != null && ((btype = btype.BaseType) != null)) {
- res = from_cache (btype);
- } else {
- break;
- }
- } while (inherit && btype != null && ((btype = btype.BaseType) != null));
- Attribute[] r = new Attribute [a.Count];
- a.CopyTo (r);
- return r;
- }
-
- internal static object[] GetCustomAttributes (ICustomAttributeProvider obj, bool inherit) {
- Type btype = obj as Type;
- if (!inherit || btype == null) {
- return (Object[])from_cache (obj).Clone ();
- } else {
- ArrayList a = new ArrayList ();
- a.AddRange (from_cache (obj));
- while ((btype = btype.BaseType) != null) {
- a.AddRange (from_cache (btype));
- }
- Attribute[] r = new Attribute [a.Count];
- a.CopyTo (r);
- return (object[])r;
- }
- }
- internal static bool IsDefined (ICustomAttributeProvider obj, Type attributeType, bool inherit) {
- object[] res = from_cache (obj);
- foreach (object attr in res) {
- if (attributeType.Equals (attr.GetType ()))
- return true;
- }
- Type btype = obj as Type;
- if (inherit && (btype != null) && ((btype = btype.BaseType) != null))
- return IsDefined (btype, attributeType, inherit);
- return false;
- }
- }
-}
diff --git a/mcs/class/corlib/System/MonoDummy.cs b/mcs/class/corlib/System/MonoDummy.cs
deleted file mode 100644
index 6d79023ee44..00000000000
--- a/mcs/class/corlib/System/MonoDummy.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.MonoDummy.cs
-//
-// Author:
-// Dietmar Maurer (dietmar@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- public class MonoDummy {
-
- public MonoDummy ()
- {
- throw new ExecutionEngineException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/MonoType.cs b/mcs/class/corlib/System/MonoType.cs
deleted file mode 100644
index 7cc909bc4c9..00000000000
--- a/mcs/class/corlib/System/MonoType.cs
+++ /dev/null
@@ -1,337 +0,0 @@
-//
-// System.MonoType
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Paolo Molaro (lupus@ximian.com)
-// Patrik Torstensson (patrik.torstensson@labs2.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Globalization;
-
-namespace System
-{
- internal struct MonoTypeInfo {
- public string name;
- public string name_space;
- public Type parent;
- public Type etype;
- public Assembly assembly;
- public TypeAttributes attrs;
- public int rank;
- public bool isbyref;
- public bool ispointer;
- public bool isprimitive;
- }
-
- internal class MonoType : Type
- {
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void type_from_obj (MonoType type, Object obj);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void get_type_info (RuntimeTypeHandle type, out MonoTypeInfo info);
-
- [MonoTODO]
- internal MonoType (Object obj)
- {
- // this should not be used - lupus
- type_from_obj (this, obj);
-
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern TypeAttributes get_attributes (Type type);
-
- protected override TypeAttributes GetAttributeFlagsImpl ()
- {
- return get_attributes (this);
- }
-
- [MonoTODO]
- protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr,
- Binder binder,
- CallingConventions callConvention,
- Type[] types,
- ParameterModifier[] modifiers)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr);
-
- [MonoTODO]
- public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override EventInfo[] GetEvents (BindingFlags bindingAttr);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override FieldInfo GetField (string name, BindingFlags bindingAttr);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override FieldInfo[] GetFields (BindingFlags bindingAttr);
-
- public override Type GetInterface (string name, bool ignoreCase)
- {
- if (name == null)
- throw new ArgumentNullException ();
-
- Type[] interfaces = GetInterfaces();
-
- foreach (Type type in interfaces)
- if (String.Compare (type.Name, name, ignoreCase) == 0)
- return type;
-
- return null;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- [MonoTODO]
- public extern override Type[] GetInterfaces();
-
- public override MemberInfo[] GetMembers( BindingFlags bindingAttr)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override MethodInfo[] GetMethods (BindingFlags bindingAttr);
-
- protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr,
- Binder binder,
- CallingConventions callConvention,
- Type[] types, ParameterModifier[] modifiers)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public override Type GetNestedType( string name, BindingFlags bindingAttr)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override Type[] GetNestedTypes (BindingFlags bindingAttr);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override PropertyInfo[] GetProperties( BindingFlags bindingAttr);
-
- [MonoTODO]
- protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr,
- Binder binder, Type returnType,
- Type[] types,
- ParameterModifier[] modifiers)
- {
- // fixme: needs to use the binder, and send the modifiers to that binder
- if (null == name || types == null)
- throw new ArgumentNullException ();
-
- PropertyInfo ret = null;
- PropertyInfo [] props = GetProperties(bindingAttr);
-
- foreach (PropertyInfo info in props) {
- if (info.Name != name)
- continue;
-
- if (returnType != null)
- if (info.GetGetMethod().ReturnType != returnType)
- continue;
-
- if (types.Length > 0) {
- if (info.GetIndexParameters().Length != types.Length)
- continue;
-
- // fixme: compare parameters
- }
-
- if (null != ret)
- throw new AmbiguousMatchException();
-
- ret = info;
- }
-
- return ret;
- }
-
- protected override bool HasElementTypeImpl ()
- {
- return IsArrayImpl() || IsByRefImpl() || IsPointerImpl ();
- }
-
- protected override bool IsArrayImpl ()
- {
- return type_is_subtype_of (this, typeof (System.Array), false);
- }
-
- protected override bool IsByRefImpl ()
- {
- MonoTypeInfo info;
-
- get_type_info (_impl, out info);
- return info.isbyref;
- }
-
- protected override bool IsCOMObjectImpl ()
- {
- return false;
- }
-
- protected override bool IsPointerImpl ()
- {
- MonoTypeInfo info;
-
- get_type_info (_impl, out info);
- return info.ispointer;
- }
-
- protected override bool IsPrimitiveImpl ()
- {
- MonoTypeInfo info;
-
- get_type_info (_impl, out info);
- return info.isprimitive;
- }
-
- protected override bool IsValueTypeImpl ()
- {
- return type_is_subtype_of (this, typeof (System.ValueType), false) &&
- this != typeof (System.ValueType) &&
- this != typeof (System.Enum);
- }
-
- public override object InvokeMember (string name, BindingFlags invokeAttr,
- Binder binder, object target, object[] args,
- ParameterModifier[] modifiers,
- CultureInfo culture, string[] namedParameters)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override Type GetElementType ();
-
- public override Type UnderlyingSystemType {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.etype;
- }
- }
-
- public override Assembly Assembly {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.assembly;
- }
- }
-
- public override string AssemblyQualifiedName {
- get {
- return getFullName () + "," + Assembly.ToString ();
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern string getFullName();
-
- public override Type BaseType {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.parent;
- }
- }
-
- public override string FullName {
- get {
- return getFullName ();
- }
- }
-
- public override Guid GUID {
- get {
- return Guid.Empty;
- }
- }
-
- public override bool IsDefined (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
- }
-
- public override object[] GetCustomAttributes (bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
- }
-
- public override object[] GetCustomAttributes (Type attributeType, bool inherit)
- {
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
- }
-
- public override MemberTypes MemberType {
- get {
- return MemberTypes.TypeInfo;
- }
- }
-
- public override string Name {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.name;
- }
- }
-
- public override string Namespace {
- get {
- MonoTypeInfo info;
- get_type_info (_impl, out info);
- return info.name_space;
- }
- }
-
- public override Module Module {
- get {
- return null;
- }
- }
-
- public override Type ReflectedType {
- get {
- return null;
- }
- }
-
- public override RuntimeTypeHandle TypeHandle {
- get {
- return _impl;
- }
- }
-
- public override int GetArrayRank ()
- {
- MonoTypeInfo info;
-
- get_type_info (_impl, out info);
- return info.rank;
- }
- }
-}
diff --git a/mcs/class/corlib/System/MulticastDelegate.cs b/mcs/class/corlib/System/MulticastDelegate.cs
deleted file mode 100644
index b7ececfd737..00000000000
--- a/mcs/class/corlib/System/MulticastDelegate.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-//
-// System.MultiCastDelegate.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Remove Missing
-//
-
-using System.Globalization;
-
-namespace System {
-
- public abstract class MulticastDelegate : Delegate
- {
- private MulticastDelegate prev;
- private MulticastDelegate kpm_next;
-
- protected MulticastDelegate (object target, string method)
- : base (target, method)
- {
- prev = null;
- }
-
- protected MulticastDelegate (Type target_type, string method)
- : base (target_type, method)
- {
- prev = null;
- }
-
-#if NOTYET
- private MulticastDelegate (Type target_type, string method, Delegate [] list)
- : base (target_type, method)
- {
- invocation_list = (Delegate[])list.Clone ();
- }
-#endif
-
-#if NOTYET
- public MethodInfo Method {
- get {
- return null;
- }
- }
-#endif
-
- public override object DynamicInvokeImpl( object[] args )
- {
- if ( prev != null )
- prev.DynamicInvokeImpl( args );
-
- return base.DynamicInvokeImpl( args );
- }
-
- // <remarks>
- // Equals: two multicast delegates are equal if their base is equal
- // and their invocations list is equal.
- // </remarks>
- public override bool Equals (object o)
- {
- if ( ! base.Equals( o ) )
- return false;
-
- MulticastDelegate d = (MulticastDelegate) o;
-
- if ( this.prev == null ) {
- if ( d.prev == null )
- return true;
- else
- return false;
- }
-
- return this.prev.Equals( d.prev );
- }
-
- //
- // FIXME: This could use some improvements.
- //
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- // <summary>
- // Return, in order of invocation, the invocation list
- // of a MulticastDelegate
- // </summary>
- public override Delegate[] GetInvocationList()
- {
- throw new NotImplementedException();
- }
-
- // <summary>
- // Combines this MulticastDelegate with the (Multicast)Delegate `follow'.
- // This does _not_ combine with Delegates. ECMA states the whole delegate
- // thing should have better been a simple System.Delegate class.
- // Compiler generated delegates are always MulticastDelegates.
- // </summary>
- protected override Delegate CombineImpl( Delegate follow )
- {
- MulticastDelegate combined, orig, clone;
-
- if ( this.GetType() != follow.GetType() )
- throw new ArgumentException( Locale.GetText("Incompatible Delegate Types") );
-
- combined = (MulticastDelegate)follow.Clone();
-
- for ( clone = combined, orig = ((MulticastDelegate)follow).prev;
- orig != null; orig = orig.prev ) {
-
- clone.prev = (MulticastDelegate)orig.Clone();
- clone = clone.prev;
- }
-
- clone.prev = (MulticastDelegate)this.Clone();
-
- for ( clone = clone.prev, orig = this.prev;
- orig != null; orig = orig.prev ) {
-
- clone.prev = (MulticastDelegate)orig.Clone();
- clone = clone.prev;
- }
-
- return combined;
- }
-
- private bool BaseEquals( MulticastDelegate value )
- {
- return base.Equals( value );
- }
-
- /*
- * Perform a slightly crippled version of
- * Knuth-Pratt-Morris over MulticastDelegate chains.
- * Border values are set as pointers in kpm_next;
- * Generally, KPM border arrays are length n+1 for
- * strings of n. This one works with length n at the
- * expense of a few additional comparisions.
- */
- private static MulticastDelegate KPM( MulticastDelegate needle,
- MulticastDelegate haystack,
- out MulticastDelegate tail )
- {
- MulticastDelegate nx, hx;
-
- // preprocess
- hx = needle;
- nx = needle.kpm_next = null;
- do {
- while ( nx != null && !nx.BaseEquals(hx) )
- nx = nx.kpm_next;
-
- hx = hx.prev;
- if (hx == null)
- break;
-
- nx = nx == null ? needle : nx.prev;
- if ( hx.BaseEquals(nx) )
- hx.kpm_next = nx.kpm_next;
- else
- hx.kpm_next = nx;
-
- } while (true);
-
- // match
- MulticastDelegate match = haystack;
- nx = needle;
- hx = haystack;
- do {
- while ( nx != null && !nx.BaseEquals(hx) ) {
- nx = nx.kpm_next;
- match = match.prev;
- }
-
- nx = nx == null ? needle : nx.prev;
- if ( nx == null ) {
- // bingo
- tail = hx.prev;
- return match;
- }
-
- hx = hx.prev;
- } while ( hx != null );
-
- tail = null;
- return null;
- }
-
- protected override Delegate RemoveImpl( Delegate value )
- {
- if ( value == null )
- return this;
-
- // match this with value
- MulticastDelegate head, tail;
- head = KPM((MulticastDelegate)value, this, out tail);
- if ( head == null )
- return this;
-
- // duplicate chain without head..tail
- MulticastDelegate prev = null, retval = null, orig;
- for ( orig = this; (object)orig != (object)head; orig = orig.prev ) {
- MulticastDelegate clone = (MulticastDelegate)orig.Clone();
- if ( prev != null )
- prev.prev = clone;
- else
- retval = clone;
- prev = clone;
- }
- for ( orig = tail; (object)orig != null; orig = orig.prev ) {
- MulticastDelegate clone = (MulticastDelegate)orig.Clone();
- if ( prev != null )
- prev.prev = clone;
- else
- retval = clone;
- prev = clone;
- }
- if ( prev != null )
- prev.prev = null;
-
- return retval;
- }
-
- public static bool operator == (MulticastDelegate a, MulticastDelegate b)
- {
- if ((object)a == null) {
- if ((object)b == null)
- return true;
- return false;
- }
- return a.Equals (b);
- }
-
- public static bool operator != (MulticastDelegate a, MulticastDelegate b)
- {
- return !(a == b);
- }
- }
-}
diff --git a/mcs/class/corlib/System/MulticastNotSupportedException.cs b/mcs/class/corlib/System/MulticastNotSupportedException.cs
deleted file mode 100644
index 6417207fa72..00000000000
--- a/mcs/class/corlib/System/MulticastNotSupportedException.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.MulticastNotSupportedException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-namespace System {
-
- [Serializable]
- 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)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NonSerializedAttribute.cs b/mcs/class/corlib/System/NonSerializedAttribute.cs
deleted file mode 100755
index 7ac82dfe67a..00000000000
--- a/mcs/class/corlib/System/NonSerializedAttribute.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-
-//
-// System/NonSerializedAttribute.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
- public sealed class NonSerializedAttribute : Attribute {
- public NonSerializedAttribute() {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NotFiniteNumberException.cs b/mcs/class/corlib/System/NotFiniteNumberException.cs
deleted file mode 100644
index dd3cc054b48..00000000000
--- a/mcs/class/corlib/System/NotFiniteNumberException.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// System.NotFiniteNumberException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class NotFiniteNumberException : ArithmeticException {
- double offending_number;
-
- // Constructors
- public NotFiniteNumberException ()
- : base (Locale.GetText ("The number encountered was not a finite quantity"))
- {
- }
-
- public NotFiniteNumberException (double offending_number)
- {
- this.offending_number = offending_number;
- }
-
- public NotFiniteNumberException (string message)
- : base (message)
- {
- }
-
- public NotFiniteNumberException (string message, double offending_number)
- {
- this.offending_number = offending_number;
- }
-
- public NotFiniteNumberException (string message, double offending_number, Exception inner)
- : base (message, inner)
- {
- this.offending_number = offending_number;
- }
-
- protected NotFiniteNumberException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- offending_number = info.GetDouble ("OffendingNumber");
- }
-
- // Properties
- public double OffendingNumber {
- get {
- return offending_number;
- }
- }
-
- // Method
-
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("OffendingNumber", offending_number);
- }
- }
-}
diff --git a/mcs/class/corlib/System/NotImplementedException.cs b/mcs/class/corlib/System/NotImplementedException.cs
deleted file mode 100755
index 5a7f80b3338..00000000000
--- a/mcs/class/corlib/System/NotImplementedException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.NotImplementedException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class NotImplementedException : SystemException {
- // Constructors
- public NotImplementedException ()
- : base (Locale.GetText ("The requested feature is not yet implemented"))
- {
- }
-
- public NotImplementedException (string message)
- : base (message)
- {
- }
-
- public NotImplementedException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected NotImplementedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NotSupportedException.cs b/mcs/class/corlib/System/NotSupportedException.cs
deleted file mode 100644
index de3fb785b5b..00000000000
--- a/mcs/class/corlib/System/NotSupportedException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.NotSupportedException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class NotSupportedException : SystemException {
- // Constructors
- public NotSupportedException ()
- : base (Locale.GetText ("Operation is not supported"))
- {
- }
-
- public NotSupportedException (string message)
- : base (message)
- {
- }
-
- public NotSupportedException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected NotSupportedException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/NullReferenceException.cs b/mcs/class/corlib/System/NullReferenceException.cs
deleted file mode 100644
index 009732ce07b..00000000000
--- a/mcs/class/corlib/System/NullReferenceException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.NullReferenceException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class NullReferenceException : SystemException {
- // Constructors
- public NullReferenceException ()
- : base (Locale.GetText ("A null value was found where an object instance was required"))
- {
- }
-
- public NullReferenceException (string message)
- : base (message)
- {
- }
-
- public NullReferenceException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected NullReferenceException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Object.cs b/mcs/class/corlib/System/Object.cs
deleted file mode 100644
index 54850461227..00000000000
--- a/mcs/class/corlib/System/Object.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// System.Object.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- public class Object {
-
- // <summary>
- // Compares this object to the specified object.
- // Returns true if they are equal, false otherwise.
- // </summary>
- public virtual bool Equals (object o)
- {
- return this == o;
- }
-
- // <summary>
- // Compares two objects for equality
- // </summary>
- public static bool Equals (object a, object b)
- {
- if (a == b)
- return true;
-
- if (a == null || b == null)
- return false;
-
- return a.Equals (b);
- }
-
- // <summary>
- // Initializes a new instance of the object class.
- // </summary>
- public Object ()
- {
- }
-
- // <summary>
- // Object destructor.
- // </summary>
- ~Object ()
- {
- }
-
- // <summary>
- // Returns a hashcode for this object. Each derived
- // class should return a hash code that makes sense
- // for that particular implementation of the object.
- // </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern virtual int GetHashCode ();
-
- // <summary>
- // Returns the Type associated with the object.
- // </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern Type GetType ();
-
- // <summary>
- // Shallow copy of the object.
- // </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- protected extern object MemberwiseClone ();
-
- // <summary>
- // Returns a stringified representation of the object.
- // This is not supposed to be used for user presentation,
- // use Format() for that and IFormattable.
- //
- // ToString is mostly used for debugging purposes.
- // </summary>
- public virtual string ToString ()
- {
- return GetType().FullName;
- }
-
- // <summary>
- // Tests whether a is equal to b.
- // Can not figure out why this even exists
- // </summary>
- public static bool ReferenceEquals (object a, object b)
- {
- return (a == b);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal extern IntPtr obj_address ();
-
- void FieldGetter (string typeName, string fieldName, ref object val)
- {
- /* never called */
- }
-
- void FieldSetter (string typeName, string fieldName, object val)
- {
- /* never called */
- }
- }
-}
diff --git a/mcs/class/corlib/System/ObjectDisposedException.cs b/mcs/class/corlib/System/ObjectDisposedException.cs
deleted file mode 100755
index b1e390aa5be..00000000000
--- a/mcs/class/corlib/System/ObjectDisposedException.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// System.ObjectDisposedException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class ObjectDisposedException : 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;
- }
-
- 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);
- }
- }
-}
diff --git a/mcs/class/corlib/System/ObsoleteAttribute.cs b/mcs/class/corlib/System/ObsoleteAttribute.cs
deleted file mode 100644
index 6215c9379fd..00000000000
--- a/mcs/class/corlib/System/ObsoleteAttribute.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.ObsoleteAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Enum | AttributeTargets.Constructor |
- AttributeTargets.Method | AttributeTargets.Property |
- AttributeTargets.Field | AttributeTargets.Event |
- AttributeTargets.Interface | AttributeTargets.Delegate)]
- [Serializable]
- public sealed class ObsoleteAttribute : Attribute
- {
- private string message;
- private bool isError = false;
-
- // Constructors
- public ObsoleteAttribute ()
- : base ()
- {
- }
-
- public ObsoleteAttribute (string message)
- {
- this.message = message;
- }
-
- public ObsoleteAttribute (string message, bool error)
- {
- this.message = message;
- this.isError = error;
- }
-
- // Properties
- public string Message {
- get { return message; }
- }
-
- public bool IsError {
- get { return isError; }
- }
- }
-}
diff --git a/mcs/class/corlib/System/OperatingSystem.cs b/mcs/class/corlib/System/OperatingSystem.cs
deleted file mode 100644
index 93729bb4a45..00000000000
--- a/mcs/class/corlib/System/OperatingSystem.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.OperatingSystem.cs
-//
-// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
-//
-// Author: Jim Richardson, develop@wtfo-guru.com
-// Created: Saturday, August 11, 2001
-//
-//------------------------------------------------------------------------------
-
-using System;
-using System.Globalization;
-
-namespace System
-{
- /// <summary>
- /// Class representing a specific operating system version for a specific platform
- /// </summary>
- [Serializable]
- public sealed class OperatingSystem : ICloneable
- {
- private System.PlatformID itsPlatform;
- private Version itsVersion;
-
- public OperatingSystem(PlatformID platform, Version version)
- {
- if(version == null)
- {
- throw new ArgumentNullException();
- }
-
- itsPlatform = platform;
- itsVersion = version;
- }
-
- /// <summary>
- /// Get the PlatformID
- /// </summary>
- public PlatformID Platform
- {
- get
- {
- return itsPlatform;
- }
- }
-
- /// <summary>
- /// Gets the version object
- /// </summary>
- public Version Version
- {
- get
- {
- return itsVersion;
- }
- }
-
- /// <summary>
- /// Return a clone of this object
- /// </summary>
- public object Clone()
- {
- return new OperatingSystem(itsPlatform, itsVersion);
- }
-
- /// <summary>
- /// Return true if obj equals this object
- /// </summary>
- public override bool Equals(object obj)
- {
- //Check for null and compare run-time types.
- if (obj == null || GetType() != obj.GetType()) return false;
- OperatingSystem os = (OperatingSystem)obj;
- return (itsPlatform == os.itsPlatform) &&
- (os.itsVersion.Equals(itsVersion));
- }
-
- /// <summary>
- /// Return hash code
- /// </summary>
- public override int GetHashCode()
- { // this leave us enuf for 256 unique platforms which should suffice for a good while
- return ((int)itsPlatform << 24) | itsVersion.GetHashCode() >> 8;
- }
-
- /// <summary>
- /// Return a string reprentation of this instance
- /// </summary>
- public override string ToString()
- {
- string str;
-
- switch(itsPlatform)
- {
- case System.PlatformID.Win32NT: str = "Microsoft Windows NT"; break;
- case System.PlatformID.Win32S: str = "Microsoft Win32S"; break;
- case System.PlatformID.Win32Windows: str = "Microsoft Windows 98"; break;
- case System.PlatformID.Unix: str = "Unix"; break;
- default: str = Locale.GetText ("<unknown>"); break;
- }
-
- return str + " " + itsVersion.ToString();
- }
- }
-}
diff --git a/mcs/class/corlib/System/OutOfMemoryException.cs b/mcs/class/corlib/System/OutOfMemoryException.cs
deleted file mode 100644
index a4f2388390d..00000000000
--- a/mcs/class/corlib/System/OutOfMemoryException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.OutOfMemoryException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class OutOfMemoryException : SystemException {
- // Constructors
- public OutOfMemoryException ()
- : base (Locale.GetText ("There is insufficient memory to continue execution"))
- {
- }
-
- public OutOfMemoryException (string message)
- : base (message)
- {
- }
-
- public OutOfMemoryException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected OutOfMemoryException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/OverflowException.cs b/mcs/class/corlib/System/OverflowException.cs
deleted file mode 100644
index 61e63e1e3a1..00000000000
--- a/mcs/class/corlib/System/OverflowException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.OverflowExceptionException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class OverflowException : ArithmeticException {
- // Constructors
- public OverflowException ()
- : base (Locale.GetText ("Number overflow"))
- {
- }
-
- public OverflowException (string message)
- : base (message)
- {
- }
-
- public OverflowException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected OverflowException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/ParamArrayAttribute.cs b/mcs/class/corlib/System/ParamArrayAttribute.cs
deleted file mode 100644
index 322def26b8b..00000000000
--- a/mcs/class/corlib/System/ParamArrayAttribute.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// System.ParamArrayAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// Used to flag that the method will take a variable number
- /// of arguments
- /// </summary>
- [AttributeUsage(AttributeTargets.Parameter)]
- public sealed class ParamArrayAttribute : Attribute {
-
- public ParamArrayAttribute ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/PlatformID.cs b/mcs/class/corlib/System/PlatformID.cs
deleted file mode 100644
index 56d2299e9fb..00000000000
--- a/mcs/class/corlib/System/PlatformID.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// PlatformID.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:29 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum PlatformID {
-
- /// <summary>
- /// </summary>
- Win32S = 0,
-
- /// <summary>
- /// </summary>
- Win32Windows = 1,
-
- /// <summary>
- /// </summary>
- Win32NT = 2,
-
- /// <summary>
- /// </summary>
- Unix = 128
- } // PlatformID
-
-} // System
diff --git a/mcs/class/corlib/System/PlatformNotSupportedException.cs b/mcs/class/corlib/System/PlatformNotSupportedException.cs
deleted file mode 100644
index 18960191d0a..00000000000
--- a/mcs/class/corlib/System/PlatformNotSupportedException.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// System.PlatformNotSupportedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- public class PlatformNotSupportedException : NotSupportedException
- {
- // Constructors
- public PlatformNotSupportedException ()
- : base (Locale.GetText ("This platform is not supported."))
- {
- }
-
- public PlatformNotSupportedException (string message)
- : base (message)
- {
- }
-
- protected PlatformNotSupportedException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- public PlatformNotSupportedException (string message, Exception innerException)
- :base (message, innerException)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/Random.cs b/mcs/class/corlib/System/Random.cs
deleted file mode 100644
index 03f8c5edcca..00000000000
--- a/mcs/class/corlib/System/Random.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// System.Random.cs
-//
-// Author:
-// Bob Smith (bob@thestuff.net)
-//
-// (C) 2001 Bob Smith. http://www.thestuff.net
-//
-
-using System;
-using System.Globalization;
-
-namespace System
-{
- [Serializable]
- public class Random
- {
- private int S = 1;
- private const int A = 16807;
- private const int M = 2147483647;
- private const int Q = 127773;
- private const int R = 2836;
-
- public Random()
- {
- S = (int)(DateTime.Now.Ticks);
- }
-
- public Random(int Seed)
- {
- S = Seed;
- }
-
- public virtual int Next()
- {
- return (int)(this.Sample()*Int32.MaxValue);
- }
-
- public virtual int Next(int maxValue)
- {
- if (maxValue < 0)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Max value is less then min value."));
- else if (maxValue == 0)
- return 0;
- return (int)(this.Sample()*maxValue);
- }
-
- public virtual int Next(int minValue, int maxValue)
- {
- if (minValue > maxValue)
- throw new ArgumentOutOfRangeException(Locale.GetText (
- "Min value is greater then max value."));
- else if (minValue == maxValue)
- return minValue;
- return (int)(this.Sample()*(maxValue - minValue))+minValue;
- }
- public virtual void NextBytes(byte[] buffer)
- {
- int i, l;
- if (buffer == null)
- throw new ArgumentNullException();
- l = buffer.GetUpperBound(0);
- for (i = buffer.GetLowerBound(0); i < l; i++)
- {
- buffer[i] = (byte)(this.Sample()*Byte.MaxValue);
- }
- }
-
- public virtual double NextDouble ()
- {
- return this.Sample();
- }
-
- protected virtual double Sample ()
- {
- S = A*(S%Q)-R*(S/Q);
- if (S < 0)
- S+=M;
- return S/(double)Int32.MaxValue;
- }
- }
-}
diff --git a/mcs/class/corlib/System/RankException.cs b/mcs/class/corlib/System/RankException.cs
deleted file mode 100644
index 89813a4a123..00000000000
--- a/mcs/class/corlib/System/RankException.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.RankException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class RankException : SystemException {
- // Constructors
- public RankException ()
- : base (Locale.GetText ("Two arrays must have the same number of dimensions"))
- {
- }
-
- public RankException (string message)
- : base (message)
- {
- }
-
- public RankException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected RankException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/ResolveEventArgs.cs b/mcs/class/corlib/System/ResolveEventArgs.cs
deleted file mode 100644
index e0c10a65950..00000000000
--- a/mcs/class/corlib/System/ResolveEventArgs.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.ResolveEventArgs.cs
-//
-// Copyright (C) 2001 Nick Drochak, All Rights Reserved
-//
-// Author: Nick Drochak, ndrochak@gol.com
-// Created: 2002-01-06
-//
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace System {
-
- public class ResolveEventArgs : EventArgs
- {
- private string m_Name;
- public string Name {get{return m_Name;}}
-
- public ResolveEventArgs(string name){
- m_Name = name;
- }
-
- } // ResolveEventArgs
-
-} // System
-
-
diff --git a/mcs/class/corlib/System/ResolveEventHandler.cs b/mcs/class/corlib/System/ResolveEventHandler.cs
deleted file mode 100644
index 36471295a85..00000000000
--- a/mcs/class/corlib/System/ResolveEventHandler.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.ResolveEventHandler
-//
-// Sean MacIsaac
-//
-// (C) 2001 Ximian, Inc.
-
-namespace System
-{
- public delegate Reflection.Assembly ResolveEventHandler (object sender, ResolveEventArgs args);
-}
diff --git a/mcs/class/corlib/System/RuntimeArgumentHandle.cs b/mcs/class/corlib/System/RuntimeArgumentHandle.cs
deleted file mode 100644
index 790f3c1a24d..00000000000
--- a/mcs/class/corlib/System/RuntimeArgumentHandle.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// System.RuntimeArgumentHandle.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- public struct RuntimeArgumentHandle
- {
- // This class has no members, its only use is for supporting
- // va_args from C and C++.
- }
-}
diff --git a/mcs/class/corlib/System/RuntimeFieldHandle.cs b/mcs/class/corlib/System/RuntimeFieldHandle.cs
deleted file mode 100755
index f4536856af9..00000000000
--- a/mcs/class/corlib/System/RuntimeFieldHandle.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// System.RuntimeFieldHandle.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- [MonoTODO]
- [Serializable]
- public struct RuntimeFieldHandle : ISerializable {
- IntPtr value;
-
- public IntPtr Value {
- get {
- return (IntPtr) value;
- }
- }
-
- RuntimeFieldHandle (SerializationInfo info, StreamingContext context)
- {
- Type t;
-
- if (info == null)
- throw new ArgumentNullException ("info");
-
- t = (Type) info.GetValue ("TypeObj", typeof (Type));
-
- value = t.TypeHandle.Value;
- if (value == (IntPtr) 0)
- throw new SerializationException (Locale.GetText ("Insufficient state"));
- }
-
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- info.AddValue ("TypeObj", value, value.GetType ());
- }
- }
-}
diff --git a/mcs/class/corlib/System/RuntimeMethodHandle.cs b/mcs/class/corlib/System/RuntimeMethodHandle.cs
deleted file mode 100755
index 649f7aa2c79..00000000000
--- a/mcs/class/corlib/System/RuntimeMethodHandle.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// System.RuntimeMethodHandle.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- //[MonoTODO]
- [Serializable]
- public struct RuntimeMethodHandle : ISerializable {
- IntPtr value;
-
- public IntPtr Value {
- get {
- return (IntPtr) value;
- }
- }
-
- // This is from ISerializable
- [MonoTODO]
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
-
- }
-}
diff --git a/mcs/class/corlib/System/RuntimeTypeHandle.cs b/mcs/class/corlib/System/RuntimeTypeHandle.cs
deleted file mode 100644
index f81d5a3730d..00000000000
--- a/mcs/class/corlib/System/RuntimeTypeHandle.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// System.RuntimeTypeHandle.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public struct RuntimeTypeHandle : ISerializable {
- IntPtr value;
-
- public IntPtr Value {
- get {
- return (IntPtr) value;
- }
- }
-
- [MonoTODO]
- public void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- throw new NotImplementedException ();
- }
- }
-}
diff --git a/mcs/class/corlib/System/SByte.cs b/mcs/class/corlib/System/SByte.cs
deleted file mode 100644
index bdc15f7cec4..00000000000
--- a/mcs/class/corlib/System/SByte.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-//
-// System.SByte.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [CLSCompliant(false)]
- [Serializable]
- public struct SByte : IComparable, IFormattable, IConvertible {
-
- public const sbyte MinValue = -128;
- public const sbyte MaxValue = 127;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public sbyte value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.SByte))
- throw new ArgumentException (Locale.GetText ("Value is not a System.SByte"));
-
- sbyte xv = (sbyte) v;
- if (value == xv)
- return 0;
- if (value > xv)
- return 1;
- else
- return -1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.SByte))
- return false;
-
- return ((sbyte) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- [CLSCompliant(false)]
- public static sbyte Parse (string s)
- {
- int ival = 0;
- int len;
- int i;
- bool neg = false;
- bool digits_seen = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- c = s [i];
- if (c == '+')
- i++;
- else if (c == '-'){
- neg = true;
- i++;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- ival = checked (ival * 10 - (int) (c - '0'));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- ival = neg ? ival : -ival;
- if (ival < SByte.MinValue || ival > SByte.MaxValue)
- throw new OverflowException ();
-
- return (sbyte) ival;
- }
-
- [CLSCompliant(false)]
- public static sbyte Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- [CLSCompliant(false)]
- public static sbyte Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [CLSCompliant(false)]
- public static sbyte Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- int tmpResult = Int32.Parse (s, style, fp);
- if (tmpResult > SByte.MaxValue || tmpResult < SByte.MinValue)
- throw new OverflowException ("Value too large or too small.");
-
- return (sbyte) tmpResult;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== ICovnertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.SByte;
- }
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- throw new NotImplementedException ();
- }
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32 (value);
- }
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return value;
- }
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- throw new NotImplementedException ();
- }
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/STAThreadAttribute.cs b/mcs/class/corlib/System/STAThreadAttribute.cs
deleted file mode 100644
index da8e92cd0df..00000000000
--- a/mcs/class/corlib/System/STAThreadAttribute.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// System.STAThreadAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Method)]
- public sealed class STAThreadAttribute : Attribute
- {
- // Constructors
- public STAThreadAttribute () : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/SerializableAttribute.cs b/mcs/class/corlib/System/SerializableAttribute.cs
deleted file mode 100755
index e283d4afc39..00000000000
--- a/mcs/class/corlib/System/SerializableAttribute.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.SerializableAttribute.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-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, AllowMultiple=false)]
- public sealed class SerializableAttribute : Attribute {
- }
-}
diff --git a/mcs/class/corlib/System/Single.cs b/mcs/class/corlib/System/Single.cs
deleted file mode 100644
index 4c6c938f7a3..00000000000
--- a/mcs/class/corlib/System/Single.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-//
-// System.Single.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- [Serializable]
- public struct Single : IComparable, IFormattable, IConvertible {
- public const float Epsilon = 1.4e-45f;
- public const float MaxValue = 3.40282346638528859e38f;
- public const float MinValue = -3.40282346638528859e38f;
- public const float NaN = 0.0f / 0.0f;
- public const float PositiveInfinity = 1.0f / 0.0f;
- public const float NegativeInfinity = -1.0f / 0.0f;
-
- // VES needs to know about value. public is workaround
- // so source will compile
- public float value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.Single))
- throw new ArgumentException (Locale.GetText ("Value is not a System.Single"));
-
- return (int) (value - ((float) v));
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.Single))
- return false;
-
- return ((float) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- public static bool IsInfinity (float f)
- {
- return (f == PositiveInfinity || f == NegativeInfinity);
- }
-
- public static bool IsNaN (float f)
- {
- return (f != f);
- }
-
- public static bool IsNegativeInfinity (float f)
- {
- return (f < 0.0f && (f == NegativeInfinity || f == PositiveInfinity));
- }
-
- public static bool IsPositiveInfinity (float f)
- {
- return (f > 0.0f && (f == NegativeInfinity || f == PositiveInfinity));
- }
-
- public static float Parse (string s)
- {
- double parsed_value = Double.Parse (
- s, (NumberStyles.Float | NumberStyles.AllowThousands), null);
- if (parsed_value > (double) float.MaxValue)
- throw new OverflowException();
-
- return (float) parsed_value;
- }
-
- public static float Parse (string s, IFormatProvider fp)
- {
- double parsed_value = Double.Parse (
- s, (NumberStyles.Float | NumberStyles.AllowThousands), fp);
- if (parsed_value > (double) float.MaxValue)
- throw new OverflowException();
-
- return (float) parsed_value;
- }
-
- public static float Parse (string s, NumberStyles style)
- {
- double parsed_value = Double.Parse (s, style, null);
- if (parsed_value > (double) float.MaxValue)
- throw new OverflowException();
-
- return (float) parsed_value;
- }
-
- public static float Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- double parsed_value = Double.Parse (s, style, fp);
- if (parsed_value > (double) float.MaxValue)
- throw new OverflowException();
-
- return (float) parsed_value;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- [MonoTODO]
- public string ToString (string format, IFormatProvider fp)
- {
- // FIXME: Need to pass format and provider info to this call too.
- return ToStringImpl(value);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern string ToStringImpl (float value);
-
- // ============= IConvertible Methods ============ //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.Single;
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return System.Convert.ToDateTime (value);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32 (value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
-
- [CLSCompliant (false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType (value, conversionType, provider);
- }
-
- [CLSCompliant (false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
-
- [CLSCompliant (false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
-
- [CLSCompliant (false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/StackOverflowException.cs b/mcs/class/corlib/System/StackOverflowException.cs
deleted file mode 100644
index 82edf55c607..00000000000
--- a/mcs/class/corlib/System/StackOverflowException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.StackOverflowException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- 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 inner)
- : base (message, inner)
- {
- }
-
- internal StackOverflowException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs
deleted file mode 100644
index fab78b71c7c..00000000000
--- a/mcs/class/corlib/System/String.cs
+++ /dev/null
@@ -1,1097 +0,0 @@
-//
-// System.String.cs
-//
-// Authors:
-// Patrik Torstensson (patrik.torstensson@labs2.com)
-// Jeffrey Stedfast (fejj@ximian.com)
-// Dan Lewis (dihlewis@yahoo.co.uk)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
- [Serializable]
- public sealed class String : IConvertible, IComparable, ICloneable, IEnumerable {
- private int length;
-
- public static readonly String Empty = "";
-
- [CLSCompliant(false), MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe public extern String(char *value);
-
- [CLSCompliant(false), MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe public extern String(char *value, int sindex, int length);
-
- [CLSCompliant(false), MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe public extern String(sbyte *value);
-
- [CLSCompliant(false), MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe public extern String(sbyte *value, int sindex, int length);
-
- [CLSCompliant(false), MethodImplAttribute(MethodImplOptions.InternalCall)]
- unsafe public extern String(sbyte *value, int sindex, int length, Encoding enc);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern String(char [] val, int sindex, int length);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern String(char [] val);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern String(char c, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override int GetHashCode();
-
- public static bool Equals(String str1, String str2) {
- if ((Object) str1 == (Object) str2)
- return true;
-
- if (null == (Object) str1 || null == (Object) str2)
- return false;
-
- if (str1.length != str2.length)
- return false;
-
- return InternalEquals(str1, str2);
- }
-
- public static bool operator == (String str1, String str2) {
- return Equals(str1, str2);
- }
-
- public static bool operator != (String str1, String str2) {
- return !Equals(str1, str2);
- }
-
- public override bool Equals(Object obj) {
- if (null == obj)
- return false;
-
- if (!(obj is String))
- return false;
-
- return InternalEquals(this, (String) obj);
- }
-
- public bool Equals(String value) {
- if (null == value)
- return false;
-
- if (length != value.length)
- return false;
-
- return InternalEquals(this, value);
- }
-
- [IndexerName("Chars")]
- public extern char this[int index] {
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- get;
- }
-
- public Object Clone() {
- return this;
- }
-
- public TypeCode GetTypeCode () {
- return TypeCode.String;
- }
-
- public void CopyTo(int sindex, char[] dest, int dindex, int count) {
- // LAMESPEC: should I null-terminate?
-
- if (dest == null)
- throw new ArgumentNullException();
-
- if (sindex < 0 || dindex < 0 || count < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (sindex + count > Length)
- throw new ArgumentOutOfRangeException ();
-
- if (dindex + count > dest.Length)
- throw new ArgumentOutOfRangeException ();
-
- InternalCopyTo(sindex, dest, dindex, count);
- }
-
- public char[] ToCharArray() {
- return ToCharArray(0, length);
- }
-
- public char[] ToCharArray(int sindex, int length) {
- if (sindex < 0 || length < 0 || sindex + length > this.length)
- throw new ArgumentOutOfRangeException ();
-
- char [] tmp = new char[length];
-
- InternalCopyTo(sindex, tmp, 0, length);
-
- return tmp;
- }
-
- public String [] Split(params char [] separator) {
- return Split(separator, Int32.MaxValue);
- }
-
- public String[] Split(char[] separator, int count) {
- if (null == separator) {
- separator = WhiteChars;
- }
-
- if (count < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (count == 0)
- return new String[0];
-
- if (count == 1)
- return new String[1] { ToString() };
-
- return InternalSplit(separator, count);
- }
-
- public String Substring (int sindex) {
- if (sindex < 0 || sindex > this.length) {
- throw new ArgumentOutOfRangeException();
- }
-
- string tmp = InternalAllocateStr(this.length - sindex);
- InternalStrcpy(tmp, 0, this, sindex, length - sindex);
-
- return tmp;
- }
-
- public String Substring (int sindex, int length) {
- if (length < 0 || sindex < 0 || sindex + length > this.length) {
- throw new ArgumentOutOfRangeException();
- }
-
- if (length == 0)
- return String.Empty;
-
- string tmp = InternalAllocateStr(length);
- InternalStrcpy(tmp, 0, this, sindex, length);
-
- return tmp;
- }
-
- private static readonly char[] WhiteChars = { (char) 0x9, (char) 0xA, (char) 0xB, (char) 0xC, (char) 0xD, (char) 0x20, (char) 0xA0, (char) 0x2000, (char) 0x2001, (char) 0x2002, (char) 0x2003, (char) 0x2004, (char) 0x2005,
- (char) 0x2006, (char) 0x2007, (char) 0x2008, (char) 0x2009, (char) 0x200A, (char) 0x200B, (char) 0x3000, (char) 0xFEFF };
-
- public String Trim(params char[] chars) {
- if (null == chars || chars.Length == 0)
- chars = WhiteChars;
-
- return InternalTrim(chars, 0);
- }
-
- public String TrimStart(params char[] chars) {
- if (null == chars || chars.Length == 0)
- chars = WhiteChars;
-
- return InternalTrim(chars, 1);
- }
-
- public String TrimEnd(params char[] chars) {
- if (null == chars || chars.Length == 0)
- chars = WhiteChars;
-
- return InternalTrim(chars, 2);
- }
-
- public static int Compare(String s1, String s2) {
- return Compare(s1, s2, false);
- }
-
- public static int Compare(String s1, String s2, bool inCase) {
- if (null == s1) {
- if (null == s2)
- return 0;
- else
- return -1;
- } else if (null == s2)
- return 1;
-
- return InternalCompare(s1, 0, s2, 0, Math.Max(s1.length, s2.length), inCase);
- }
-
- [MonoTODO()]
- public static int Compare(String s1, String s2, bool inCase, CultureInfo culture) {
- return Compare(s1, s2, inCase);
- }
-
- public static int Compare(String s1, int i1, String s2, int i2, int length) {
- return Compare(s1, i1, s2, i2, length, false);
- }
-
- public static int Compare(String s1, int i1, String s2, int i2, int length, bool inCase) {
- if (null == s1) {
- if (null == s2)
- return 0;
- else
- return -1;
- } else if (null == s2)
- return 1;
-
- if (length < 0 || i1 < 0 || i2 < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (i1 > s1.length || i2 > s2.length)
- throw new ArgumentOutOfRangeException ();
-
- if (length == 0)
- return 0;
-
- return InternalCompare(s1, i1, s2, i2, length, inCase);
- }
-
- [MonoTODO()]
- public static int Compare(String s1, int i1, String s2, int i2, int length, bool inCase, CultureInfo culture) {
- return Compare(s1, i1, s2, i2, length, inCase);
- }
-
- public int CompareTo(Object value) {
- if (null == value)
- return 1;
-
- if (!(value is String))
- throw new ArgumentException();
-
- return String.Compare(this, (String) value, false);
- }
-
- public int CompareTo(String str) {
- if (null == str)
- return 1;
-
- return Compare(this, str, false);
- }
-
- public static int CompareOrdinal(String s1, String s2) {
- if (null == s1 || null == s2) {
- if ((Object)s1 == (Object) s2) {
- return 0;
- }
-
- return (s1 == null) ? -1 : 1;
- }
-
- return InternalCompare(s1, 0, s2, 0, Math.Max(s1.length, s2.length), false);
- }
-
- public static int CompareOrdinal(String s1, int i1, String s2, int i2, int length) {
- if (null == s1 || null == s2) {
- if ((Object)s1 == (Object) s2) {
- return 0;
- }
-
- return (s1 == null) ? -1 : 1;
- }
-
- if (i1 < 0 || i2 < 0 || length < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (i1 > s1.length || i2 > s2.length)
- throw new ArgumentOutOfRangeException ();
-
- return InternalCompare(s1, i1, s2, i2, length, false);
- }
-
- public bool EndsWith(String value) {
- if (null == value)
- throw new ArgumentNullException();
-
- if (value.length > this.length) {
- return false;
- }
-
- return (0 == Compare(this, length - value.length, value, 0, value.length));
- }
-
- public int IndexOfAny(char [] arr) {
- if (null == arr)
- throw new ArgumentNullException();
-
- return InternalIndexOfAny(arr, 0, this.length);
- }
-
- public int IndexOfAny(char [] arr, int sindex) {
- if (null == arr)
- throw new ArgumentNullException();
- if (sindex < 0 || sindex >= this.length)
- throw new ArgumentOutOfRangeException();
-
- return InternalIndexOfAny(arr, sindex, this.length - sindex);
- }
-
- public int IndexOfAny(char [] arr, int sindex, int count) {
- if (null == arr)
- throw new ArgumentNullException();
- if (sindex < 0 || count < 0 || sindex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- return InternalIndexOfAny(arr, sindex, count);
- }
-
- public int IndexOf(char value) {
- return InternalIndexOf(value, 0, this.length);
- }
-
- public int IndexOf(String value) {
- return IndexOf(value, 0, this.length);
- }
-
- public int IndexOf(char value, int sindex) {
- if (sindex < 0 || sindex > this.length) {
- throw new ArgumentOutOfRangeException();
- }
-
- if (sindex == this.length)
- return -1;
-
- return InternalIndexOf(value, sindex, this.length - sindex);
- }
-
- public int IndexOf(String value, int sindex) {
- if (sindex == this.length)
- return -1;
-
- return IndexOf(value, sindex, this.length - sindex);
- }
-
- public int IndexOf(char value, int sindex, int count) {
- if (sindex < 0 || count < 0 || sindex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- if (sindex == 0 && this.length == 0)
- return -1;
-
- return InternalIndexOf(value, sindex, count);
- }
-
- public int IndexOf(String value, int sindex, int count) {
- if (null == value)
- throw new ArgumentNullException();
-
- if (sindex < 0 || count < 0 || sindex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- if (sindex == 0 && this.length == 0)
- return -1;
-
- return InternalIndexOf(value, sindex, count);
- }
-
- public int LastIndexOfAny(char [] arr) {
- if (null == arr)
- throw new ArgumentNullException();
-
- return InternalLastIndexOfAny(arr, this.length - 1, this.length);
- }
-
- public int LastIndexOfAny(char [] arr, int sindex) {
- if (null == arr)
- throw new ArgumentNullException();
-
- if (sindex < 0 || sindex > this.length)
- throw new ArgumentOutOfRangeException();
-
- if (this.length == 0)
- return -1;
-
- return InternalLastIndexOfAny(arr, sindex, sindex + 1);
- }
-
- public int LastIndexOfAny(char [] arr, int sindex, int count) {
- if (null == arr)
- throw new ArgumentNullException();
-
- if (sindex < 0 || count < 0 || sindex > this.length || sindex - count < -1)
- throw new ArgumentOutOfRangeException();
-
- if (this.length == 0)
- return -1;
-
- return InternalLastIndexOfAny(arr, sindex, count);
- }
-
- public int LastIndexOf(char value) {
- return InternalLastIndexOf(value, this.length - 1, this.length);
- }
-
- public int LastIndexOf(String value) {
- if (null == value)
- throw new ArgumentNullException();
-
- if (value.length == 0)
- return 0;
-
- if (this.length == 0)
- return -1;
-
- return InternalLastIndexOf(value, this.length - 1, this.length);
- }
-
- public int LastIndexOf(char value, int sindex){
- return LastIndexOf(value, sindex, sindex + 1);
- }
-
- public int LastIndexOf(String value, int sindex) {
- return LastIndexOf(value, sindex, sindex + 1);
- }
-
- public int LastIndexOf(char value, int sindex, int count) {
- if (sindex < 0 || count < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (sindex >= this.length || sindex - count + 1 < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (sindex == 0 && this.length == 0)
- return -1;
-
- return InternalLastIndexOf(value, sindex, count);
- }
-
- public int LastIndexOf(String value, int sindex, int count) {
- if (null == value)
- throw new ArgumentNullException();
-
- if (sindex < 0 || sindex > this.length)
- throw new ArgumentOutOfRangeException ();
-
- if (count < 0 || sindex - count + 1 < 0)
- throw new ArgumentOutOfRangeException ();
-
- if (value.length > sindex)
- return -1;
-
- if (value == String.Empty)
- return sindex;
-
- if (sindex == 0 && this.length == 0)
- return -1;
-
- return InternalLastIndexOf(value, sindex, count);
- }
-
- public String PadLeft(int width) {
- return PadLeft(width, ' ');
- }
-
- public String PadLeft(int width, char chr) {
- if (width < 0)
- throw new ArgumentException();
-
- if (width < this.length)
- return String.Copy(this);
-
- return InternalPad(width, chr, false);
- }
-
- public String PadRight(int width) {
- return PadRight(width, ' ');
- }
-
- public String PadRight(int width, char chr) {
- if (width < 0)
- throw new ArgumentException();
-
- if (width < this.length)
- return String.Copy(this);
-
- return InternalPad(width, chr, true);
- }
-
- public bool StartsWith(String value) {
- if (null == value)
- throw new ArgumentNullException();
-
- if (this.length < value.length)
- return false;
-
- return (0 == Compare(this, 0, value, 0 , value.length));
- }
-
-
- public String Replace (char oldChar, char newChar) {
- return InternalReplace(oldChar, newChar);
- }
-
- public String Replace(String oldValue, String newValue) {
- if (null == oldValue)
- throw new ArgumentNullException();
-
- return InternalReplace(oldValue, newValue);
- }
-
- public String Remove(int sindex, int count) {
- if (sindex < 0 || count < 0 || sindex + count > this.length)
- throw new ArgumentOutOfRangeException ();
-
- return InternalRemove(sindex, count);
- }
-
- public String ToLower() {
- return InternalToLower();
- }
-
- public String ToLower(CultureInfo culture) {
- throw new NotImplementedException();
- }
-
- public String ToUpper() {
- return InternalToUpper();
- }
-
- public String ToUpper(CultureInfo culture) {
- throw new NotImplementedException();
- }
-
- public override String ToString() {
- return this;
- }
-
- public String ToString(IFormatProvider provider) {
- return this;
- }
-
- public String Trim() {
- return Trim(null);
- }
-
- public static String Format(String format, Object arg0) {
- return Format(null, format, new Object[] {arg0});
- }
-
- public static String Format(String format, Object arg0, Object arg1) {
- return Format(null, format, new Object[] {arg0, arg1});
- }
-
- public static String Format(String format, Object arg0, Object arg1, Object arg2) {
- return Format(null, format, new Object[] {arg0, arg1, arg2});
- }
-
- public static string Format (string format, params object[] args) {
- return Format (null, format, args);
- }
-
- public static string Format (IFormatProvider provider, string format, params object[] args) {
- if (format == null || args == null)
- throw new ArgumentNullException ();
-
- StringBuilder result = new StringBuilder ();
-
- int ptr = 0;
- int start = ptr;
- while (ptr < format.length) {
- char c = format[ptr ++];
-
- if (c == '{') {
- result.Append (format, start, ptr - start - 1);
-
- // check for escaped open bracket
-
- if (format[ptr] == '{') {
- start = ptr ++;
- continue;
- }
-
- // parse specifier
-
- int n, width;
- bool left_align;
- string arg_format;
-
- ParseFormatSpecifier (format, ref ptr, out n, out width, out left_align, out arg_format);
- if (n >= args.Length)
- throw new FormatException ("Index (zero based) must be greater than or equal to zero and less than the size of the argument list.");
-
- // format argument
-
- object arg = args[n];
-
- string str;
- if (arg == null)
- str = "";
- else if (arg is IFormattable)
- str = ((IFormattable)arg).ToString (arg_format, provider);
- else
- str = arg.ToString ();
-
- // pad formatted string and append to result
-
- if (width > str.length) {
- string pad = new String (' ', width - str.length);
-
- if (left_align) {
- result.Append (str);
- result.Append (pad);
- }
- else {
- result.Append (pad);
- result.Append (str);
- }
- }
- else
- result.Append (str);
-
- start = ptr;
- }
- else if (c == '}' && format[ptr] == '}') {
- result.Append (format, start, ptr - start - 1);
- start = ptr ++;
- }
- }
-
- if (start < format.length)
- result.Append (format.Substring (start));
-
- return result.ToString ();
- }
-
- public static String Copy (String str) {
- if (str == null)
- throw new ArgumentNullException ();
-
- int length = str.length;
-
- String tmp = InternalAllocateStr(length);
- InternalStrcpy(tmp, 0, str);
- return tmp;
- }
-
- public static String Concat(Object obj) {
- if (null == obj)
- return String.Empty;
-
- return obj.ToString();
- }
-
- public static String Concat(Object obj1, Object obj2) {
- if (null == obj1)
- obj1 = String.Empty;
-
- if (null == obj2)
- obj2 = String.Empty;
-
- return Concat(obj1.ToString(), obj2.ToString());
- }
-
- public static String Concat(Object obj1, Object obj2, Object obj3) {
- if (null == obj1)
- obj1 = String.Empty;
-
- if (null == obj2)
- obj2 = String.Empty;
-
- if (null == obj3)
- obj3 = String.Empty;
-
- return Concat(obj1.ToString(), obj2.ToString(), obj3.ToString());
- }
-
- //
- // I can not find the "__arglist" argument on the spec
- //
-#if !__MonoCS__
- [CLSCompliant(false)]
- public static String Concat (Object arg0, Object arg1, Object arg2, Object arg3, __arglist) {
- throw new NotImplementedException();
- }
-#endif
-
- public static String Concat(String s1, String s2) {
- if (null == s1) {
- if (null == s2) { return String.Empty; }
- return s2;
- }
-
- if (null == s2) { return s1; }
-
- String tmp = InternalAllocateStr(s1.length + s2.length);
-
- InternalStrcpy(tmp, 0, s1);
- InternalStrcpy(tmp, s1.length, s2);
-
- return tmp;
- }
-
- public static String Concat(String s1, String s2, String s3) {
- if (null == s1 && null == s2 && null == s3) {
- return String.Empty;
- }
-
- if (null == s1) { s1 = String.Empty; }
- if (null == s2) { s2 = String.Empty; }
- if (null == s3) { s3 = String.Empty; }
-
- String tmp = InternalAllocateStr(s1.length + s2.length + s3.length);
-
- InternalStrcpy(tmp, 0, s1);
- InternalStrcpy(tmp, s1.length, s2);
- InternalStrcpy(tmp, s1.length + s2.length, s3);
-
- return tmp;
- }
-
- public static String Concat(String s1, String s2, String s3, String s4) {
- if (null == s1 && null == s2 && null == s3 && null == s4) {
- return String.Empty;
- }
-
- if (null == s1) { s1 = String.Empty; }
- if (null == s2) { s2 = String.Empty; }
- if (null == s3) { s3 = String.Empty; }
- if (null == s4) { s4 = String.Empty; }
-
- String tmp = InternalAllocateStr(s1.length + s2.length + s3.length + s4.length);
-
- InternalStrcpy(tmp, 0, s1);
- InternalStrcpy(tmp, s1.length, s2);
- InternalStrcpy(tmp, s1.length + s2.length, s3);
- InternalStrcpy(tmp, s1.length + s2.length + s3.length, s4);
-
- return tmp;
- }
-
- public static String Concat(params Object[] args) {
- string [] strings;
- int len, i, currentpos;
-
- if (null == args)
- throw new ArgumentNullException ();
-
- strings = new string [args.Length];
- len = 0;
- i = 0;
- foreach (object arg in args) {
- /* use Empty for each null argument */
- if (arg == null)
- strings[i] = String.Empty;
- else
- strings[i] = arg.ToString ();
- len += strings[i].length;
- i++;
- }
-
- if (len == 0)
- return String.Empty;
-
- currentpos = 0;
-
- String tmp = InternalAllocateStr(len);
- for (i = 0; i < strings.Length; i++) {
- InternalStrcpy(tmp, currentpos, strings[i]);
- currentpos += strings[i].length;
- }
-
- return tmp;
- }
-
- public static String Concat(params String[] values) {
- int len, i, currentpos;
-
- if (values == null)
- throw new ArgumentNullException ();
-
- len = 0;
- foreach (string value in values)
- len += value != null ? value.length : 0;
-
- if (len == 0)
- return String.Empty;
-
- currentpos = 0;
-
- String tmp = InternalAllocateStr(len);
- for (i = 0; i < values.Length; i++) {
- if (values[i] == null)
- continue;
-
- InternalStrcpy(tmp, currentpos, values[i]);
- currentpos += values[i].length;
- }
-
- return tmp;
- }
-
- public String Insert(int sindex, String value) {
- if (null == value)
- throw new ArgumentNullException();
-
- if (sindex < 0 || sindex > this.length)
- throw new ArgumentOutOfRangeException();
-
- return InternalInsert(sindex, value);
- }
-
-
- public static string Intern (string str) {
- if (null == str)
- throw new ArgumentNullException ();
-
- return InternalIntern(str);
- }
-
- public static string IsInterned (string str) {
- if (null == str)
- throw new ArgumentNullException();
-
- return InternalIsInterned(str);
- }
-
- public static string Join (string separator, string [] value) {
- if (value == null)
- throw new ArgumentNullException ();
-
- return Join(separator, value, 0, value.Length);
- }
-
- public static string Join(string separator, string[] value, int sindex, int count) {
- if (value == null)
- throw new ArgumentNullException ();
-
- if (sindex + count > value.Length)
- throw new ArgumentOutOfRangeException ();
-
- if (sindex == value.Length)
- return String.Empty;
-
- return InternalJoin(separator, value, sindex, count);
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider) {
- return Convert.ToBoolean (this);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider) {
- return Convert.ToByte (this);
- }
-
- char IConvertible.ToChar (IFormatProvider provider) {
- return Convert.ToChar (this);
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider) {
- return Convert.ToDateTime (this);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider) {
- return Convert.ToDecimal (this);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider) {
- return Convert.ToDouble (this);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider) {
- return Convert.ToInt16 (this);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider) {
- return Convert.ToInt32 (this);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider) {
- return Convert.ToInt64 (this);
- }
-
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider) {
- return Convert.ToSByte (this);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider) {
- return Convert.ToSingle (this);
- }
- string IConvertible.ToString (IFormatProvider format) {
- return this;
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider) {
- return Convert.ToType (this, conversionType, provider);
- }
-
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider) {
- return Convert.ToUInt16 (this);
- }
-
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider) {
- return Convert.ToUInt32 (this);
- }
-
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider) {
- return Convert.ToUInt64 (this);
- }
-
- TypeCode IConvertible.GetTypeCode () {
- return TypeCode.String;
- }
-
- public int Length {
- get {
- return length;
- }
- }
-
- public CharEnumerator GetEnumerator () {
- return new CharEnumerator (this);
- }
-
- IEnumerator IEnumerable.GetEnumerator () {
- return new CharEnumerator (this);
- }
-
- private static void ParseFormatSpecifier (string str, ref int ptr, out int n, out int width, out bool left_align, out string format) {
- // parses format specifier of form:
- // N,[[-]M][:F]}
- //
- // where:
-
- try {
- // N = argument number (non-negative integer)
-
- n = ParseDecimal (str, ref ptr);
- if (n < 0)
- throw new FormatException ("Input string was not in correct format.");
-
- // M = width (non-negative integer)
-
- if (str[ptr] == ',') {
- left_align = (str[++ ptr] == '-');
- if (left_align)
- ++ ptr;
-
- width = ParseDecimal (str, ref ptr);
- if (width < 0)
- throw new FormatException ("Input string was not in correct format.");
- }
- else {
- width = 0;
- left_align = false;
- }
-
- // F = argument format (string)
-
- if (str[ptr] == ':') {
- int start = ++ ptr;
- while (str[ptr] != '}')
- ++ ptr;
-
- format = str.Substring (start, ptr - start);
- }
- else
- format = null;
-
- if (str[ptr ++] != '}')
- throw new FormatException ("Input string was not in correct format.");
- }
- catch (IndexOutOfRangeException) {
- throw new FormatException ("Input string was not in correct format.");
- }
- }
-
- private static int ParseDecimal (string str, ref int ptr) {
- int p = ptr;
- int n = 0;
- while (true) {
- char c = str[p];
- if (c < '0' || '9' < c)
- break;
-
- n = n * 10 + c - '0';
- ++ p;
- }
-
- if (p == ptr)
- return -1;
-
- ptr = p;
- return n;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static string InternalJoin(string separator, string[] value, int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalInsert(int sindex, String value);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalReplace(char oldChar, char newChar);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalReplace(String oldValue, String newValue);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalRemove(int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern void InternalCopyTo(int sindex, char[] dest, int dindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String[] InternalSplit(char[] separator, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalTrim(char[] chars, int typ);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern int InternalIndexOf(char value, int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern int InternalIndexOf(string value, int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern int InternalIndexOfAny(char [] arr, int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern int InternalLastIndexOf(char value, int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern int InternalLastIndexOf(String value, int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern int InternalLastIndexOfAny(char [] anyOf, int sindex, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalPad(int width, char chr, bool right);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalToLower();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern String InternalToUpper();
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static String InternalAllocateStr(int length);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void InternalStrcpy(String dest, int destPos, String src);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static void InternalStrcpy(String dest, int destPos, String src, int startPos, int count);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static string InternalIntern(string str);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static string InternalIsInterned(string str);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static int InternalCompare(String s1, int i1, String s2, int i2, int length, bool inCase);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private extern static bool InternalEquals(String s1, String s2);
- }
-}
diff --git a/mcs/class/corlib/System/SystemException.cs b/mcs/class/corlib/System/SystemException.cs
deleted file mode 100644
index 7e41953645f..00000000000
--- a/mcs/class/corlib/System/SystemException.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// System.SystemException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.Serialization;
-using System;
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public class SystemException : Exception {
- // Constructors
- public SystemException ()
- : base (Locale.GetText ("A system exception has occurred."))
- {
- }
-
- public SystemException (string message)
- : base (message)
- {
- }
-
- protected SystemException(SerializationInfo info, StreamingContext context)
- : base (info, context) {
- }
-
- public SystemException (string message, Exception inner)
- : base (message, inner)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/TODO b/mcs/class/corlib/System/TODO
deleted file mode 100644
index 065809deedb..00000000000
--- a/mcs/class/corlib/System/TODO
+++ /dev/null
@@ -1,22 +0,0 @@
-System.Object:
- Need a mechanism for getting an object underlying type.
-
-System.ValueType:
- Need to lock memory and "scan" the actual contents to compute
- hash code and do comparissions. Should be simple to do with
- C#, the problem is figuring out the size of the object.
-
-System.String:
- Need to implement the Format() and CompareOrdinal() methods
- as we all implement all of the methods that take into account
- CultureInfo or Encoding stuff.
-
-System.Array:
- It's not possible to test to see if the whole thing works, as
- GetValue() and SetValue() make calls into the runtime. However,
- I've tried my implementations of things like BinarySearch() and
- Sort() on the MS-provided System.Array and they seem to work fine.
- According to the spec, System.Array implements the IList interface.
- The spec doesn't have the methods for those interfaces, however,
- the class doesn't (yet) implement that interface and those methods
- are not (yet) written.
diff --git a/mcs/class/corlib/System/TODOAttribute.cs b/mcs/class/corlib/System/TODOAttribute.cs
deleted file mode 100644
index 0920ce8f92d..00000000000
--- a/mcs/class/corlib/System/TODOAttribute.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All, AllowMultiple=true)]
- public class MonoTODOAttribute : Attribute {
-
- private string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment
- {
- get { return comment; }
- }
- }
-}
diff --git a/mcs/class/corlib/System/ThreadStaticAttribute.cs b/mcs/class/corlib/System/ThreadStaticAttribute.cs
deleted file mode 100644
index 97d06667a6b..00000000000
--- a/mcs/class/corlib/System/ThreadStaticAttribute.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// System.ThreadStaticAttribute.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System
-{
- [AttributeUsage (AttributeTargets.Field)]
- [Serializable]
- public class ThreadStaticAttribute : Attribute
- {
- // Constructors
- public ThreadStaticAttribute () : base ()
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/TimeSpan.cs b/mcs/class/corlib/System/TimeSpan.cs
deleted file mode 100644
index e9976a3173d..00000000000
--- a/mcs/class/corlib/System/TimeSpan.cs
+++ /dev/null
@@ -1,551 +0,0 @@
-//
-// System.TimeSpan.cs
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2001 Duco Fijma
-//
-
-using System.Globalization;
-
-namespace System {
-
-[Serializable]
-public struct TimeSpan : IComparable {
-
- private long _ticks;
-
- public TimeSpan (long value) { _ticks = value; }
- public TimeSpan (int hours, int minutes, int seconds)
- : this(false, 0, hours, minutes, seconds, 0, 0) {}
- public TimeSpan (int days, int hours, int minutes, int seconds)
- : this(false, days, hours, minutes, seconds, 0, 0) {}
- public TimeSpan (int days, int hours, int minutes, int seconds, int milliseconds)
- : this(false, days, hours, minutes, seconds, milliseconds, 0) {}
-
- internal TimeSpan (bool sign, int days, int hours, int minutes, int seconds, int milliseconds, long ticks)
- {
- checked {
- _ticks = TicksPerDay * days +
- TicksPerHour * hours +
- TicksPerMinute * minutes +
- TicksPerSecond * seconds +
- TicksPerMillisecond * milliseconds +
- ticks;
- if ( sign ) {
- _ticks = -_ticks;
- }
- }
- }
-
- public static readonly TimeSpan MaxValue = new TimeSpan (long.MaxValue);
- public static readonly TimeSpan MinValue = new TimeSpan (long.MinValue);
- public const long TicksPerDay = 864000000000L;
- public const long TicksPerHour = 36000000000L;
- public const long TicksPerMillisecond = 10000L;
- public const long TicksPerMinute = 600000000L;
- public const long TicksPerSecond = 10000000L;
- public static readonly TimeSpan Zero = new TimeSpan (0L);
-
- public int Days
- {
- get {
- return (int) TotalDays;
- }
- }
-
- public int Hours
- {
- get {
- return (int) (_ticks % TicksPerDay / TicksPerHour);
- }
- }
-
- public int Milliseconds
- {
- get
- {
- return (int) (_ticks % TicksPerSecond / TicksPerMillisecond);
- }
- }
-
- public int Minutes
- {
- get
- {
- return (int) (_ticks % TicksPerHour / TicksPerMinute);
- }
- }
-
- public int Seconds
- {
- get
- {
- return (int) (_ticks % TicksPerMinute / TicksPerSecond);
- }
- }
-
- public long Ticks
- {
- get
- {
- return _ticks;
- }
- }
-
- public double TotalDays
- {
- get
- {
- return (double) _ticks / TicksPerDay;
- }
- }
-
- public double TotalHours
- {
- get
- {
- return (double) _ticks / TicksPerHour;
- }
- }
-
- public double TotalMilliseconds
- {
- get
- {
- return (double) _ticks / TicksPerMillisecond;
- }
- }
-
- public double TotalMinutes
- {
- get {
- return (double) _ticks / TicksPerMinute;
- }
- }
-
- public double TotalSeconds
- {
- get {
- return (double) _ticks / TicksPerSecond;
- }
- }
-
- public TimeSpan Add (TimeSpan ts)
- {
- checked {
- return new TimeSpan (_ticks + ts.Ticks);
- }
- }
-
- public static int Compare (TimeSpan t1, TimeSpan t2)
- {
- if (t1._ticks < t2._ticks) {
- return -1;
- }
- else if (t1._ticks > t2._ticks) {
- return 1;
- }
- else {
- return 0;
- }
- }
-
- public int CompareTo (object value)
- {
- if (value == null )
- return 1;
-
- if (!(value is TimeSpan)) {
- throw new ArgumentException (Locale.GetText (
- "Argument of System.TimeSpan.CompareTo should be a TimeSpan"));
- }
-
- return Compare(this, (TimeSpan) value);
- }
-
- public TimeSpan Duration ()
- {
- checked {
- return new TimeSpan (Math.Abs (_ticks));
- }
- }
-
- public override bool Equals (object value)
- {
- if (!(value is TimeSpan)) {
- return false;
- }
- return Equals (this, (TimeSpan) value);
- }
-
- public static bool Equals (TimeSpan t1, TimeSpan t2)
- {
- return t1._ticks == t2._ticks;
- }
-
- // Implementing FromDays -> FromHours -> FromMinutes -> FromSeconds ->
- // FromMilliseconds as done here is probably not the most efficient
- // way.
- public static TimeSpan FromDays (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan ((int) value,0,0,0,0) + FromHours ((value - ((int) value)) * 24);
- }
-
- public static TimeSpan FromHours (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan ((int) value,0,0) + FromMinutes ((value - ((int) value)) * 60);
- }
-
- public static TimeSpan FromMinutes (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan (0, (int) value, 0) + FromSeconds((value - ((int) value)) * 60);
- }
-
- public static TimeSpan FromSeconds (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan (0, 0, 0, (int) value) + FromMilliseconds((value - ((int) value)) * 1000);
-
- }
-
- public static TimeSpan FromMilliseconds (double value)
- {
- if (Double.IsNaN (value) || Double.IsNegativeInfinity (value)) {
- return MinValue;
- }
-
- if (Double.IsPositiveInfinity (value)) {
- return MaxValue;
- }
-
- return new TimeSpan (0, 0, 0, 0, (int) value);
- }
-
- public static TimeSpan FromTicks (long value)
- {
- return new TimeSpan (value);
- }
-
- public override int GetHashCode ()
- {
- return _ticks.GetHashCode ();
- }
-
- public TimeSpan Negate ()
- {
- checked {
- return new TimeSpan (-_ticks);
- }
- }
-
- public static TimeSpan Parse (string s)
- {
- if (s == null) {
- throw new ArgumentNullException (
- Locale.GetText ("null reference passed to TimeSpan.Parse"));
- }
-
- Parser p = new Parser (s);
- return p.Execute ();
- }
-
- public TimeSpan Subtract (TimeSpan ts)
- {
- checked {
- return new TimeSpan (_ticks - ts.Ticks);
- }
- }
-
- public override string ToString ()
- {
- string res = "";
-
- if (_ticks < 0) {
- res += "-";
- }
-
- // We need to take absolute values of all components.
- // Can't handle negative timespans by negating the TimeSpan
- // as a whole. This would lead to an overflow for the
- // degenerate case "TimeSpan.MinValue.ToString()".
- if (Days != 0) {
- res += Math.Abs (Days) + "." ;
- }
-
- res += string.Format ("{0:D2}:{1:D2}:{2:D2}", Math.Abs(Hours), Math.Abs(Minutes), Math.Abs(Seconds));
-
- int fractional = (int) Math.Abs (_ticks % TicksPerSecond);
- if (fractional != 0) {
- res += string.Format (".{0:D7}", fractional);
- }
-
- return res;
- }
-
- public static TimeSpan operator + (TimeSpan t1, TimeSpan t2)
- {
- return t1.Add (t2);
- }
-
- public static bool operator == (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) == 0;
- }
-
- public static bool operator > (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) == 1;
- }
-
- public static bool operator >= (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) != -1;
- }
-
- public static bool operator != (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) != 0;
- }
-
- public static bool operator < (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) == -1;
- }
-
- public static bool operator <= (TimeSpan t1, TimeSpan t2)
- {
- return Compare (t1, t2) != 1;
- }
-
- public static TimeSpan operator - (TimeSpan t1, TimeSpan t2)
- {
- return t1.Subtract (t2);
- }
-
- public static TimeSpan operator - (TimeSpan t)
- {
- return t.Negate ();
- }
-
- public static TimeSpan operator + (TimeSpan t)
- {
- return t;
- }
-
-// Class Parser implements simple parser for TimeSpan::Parse
-internal class Parser {
-
- private string _src;
- private int _cur;
- private int _length;
-
- public Parser (string src)
- {
- _src = src;
- Reset ();
- }
-
- public void Reset ()
- {
- _cur = 0;
- _length = _src.Length;
- }
-
- public bool AtEnd
- {
- get {
- return _cur >= _length;
- }
- }
-
- private void ThrowFormatException()
- {
- throw new FormatException (Locale.GetText ("Invalid format for TimeSpan.Parse"));
- }
-
- // All "Parse" functions throw a FormatException on syntax error.
- // Their return value is semantic value of the item parsed.
-
- // Range checking is spread over three different places:
- // 1) When parsing "int" values, an exception is thrown immediately
- // when the value parsed exceeds the maximum value for an int.
- // 2) An explicit check is built in that checks for hours > 23 and
- // for minutes and seconds > 59.
- // 3) Throwing an exceptions for a final TimeSpan value > MaxValue
- // or < MinValue is left to the TimeSpan constructor called.
-
- // Parse zero or more whitespace chars.
- private void ParseWhiteSpace ()
- {
- while (!AtEnd && Char.IsWhiteSpace (_src, _cur)) {
- _cur++;
- }
- }
-
- // Parse optional sign character.
- private bool ParseSign ()
- {
- bool res = false;
-
- if (!AtEnd && _src[_cur] == '-') {
- res = true;
- _cur++;
- }
-
- return res;
- }
-
- // Parse simple int value
- private int ParseInt ()
- {
- int res = 0;
- int count = 0;
-
- while (!AtEnd && Char.IsDigit (_src, _cur)) {
- checked {
- res = res*10 + _src[_cur] - '0';
- }
- _cur++;
- count++;
- }
-
- if (count == 0) {
- ThrowFormatException ();
- }
-
- return res;
- }
-
- // Parse optional dot
- private bool ParseOptDot ()
- {
- if (AtEnd) {
- return false;
- }
-
- if (_src[_cur] == '.') {
- _cur++;
- return true;
- }
- else {
- return false;
- }
- }
-
- // Parse NON-optional colon
- private void ParseColon ()
- {
- if (!AtEnd && _src[_cur] == ':') {
- _cur++;
- }
- else {
- ThrowFormatException ();
- }
- }
-
- // Parse [1..7] digits, representing fractional seconds (ticks)
- private long ParseTicks ()
- {
- long mag = 1000000;
- long res = 0;
- bool digitseen = false;
-
- while ( mag > 0 && !AtEnd && Char.IsDigit (_src, _cur) ) {
- res = res + (_src[_cur] - '0') * mag;
- _cur++;
- mag = mag / 10;
- digitseen = true;
- }
-
- if (!digitseen) {
- ThrowFormatException ();
- }
-
- return res;
- }
-
- public TimeSpan Execute ()
- {
- bool sign;
- int days;
- int hours;
- int minutes;
- int seconds;
- long ticks;
-
- // Parse [ws][dd.]hh:mm:ss[.ff][ws]
- ParseWhiteSpace ();
- sign = ParseSign ();
- days = ParseInt ();
- if (ParseOptDot ()) {
- hours = ParseInt ();
- }
- else {
- hours = days;
- days = 0;
- }
- ParseColon();
- minutes = ParseInt ();
- ParseColon();
- seconds = ParseInt ();
- if ( ParseOptDot () ) {
- ticks = ParseTicks ();
- }
- else {
- ticks = 0;
- }
- ParseWhiteSpace ();
-
- if ( !AtEnd ) {
- ThrowFormatException ();
- }
-
- if ( hours > 23 || minutes > 59 || seconds > 59 ) {
- throw new OverflowException (Locale.GetText (
- "Value outside range in TimeSpan.Parse" ));
- }
-
- TimeSpan ts = new TimeSpan (sign, days, hours, minutes, seconds, 0, ticks);
-
- return ts;
- }
-
-}
-
-} /* TimeSpan */
-}
-
-
diff --git a/mcs/class/corlib/System/TimeZone.cs b/mcs/class/corlib/System/TimeZone.cs
deleted file mode 100644
index ce77e0d3d3f..00000000000
--- a/mcs/class/corlib/System/TimeZone.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-//
-// System.TimeZone.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-// Ajay Kumar Dwivedi (adwiv@yahoo.com)
-// Martin Baulig (martin@gnome.org)
-//
-// (C) Ximian, Inc.
-//
-
-using System.Collections;
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- [Serializable]
- public abstract class TimeZone
- {
- // Fields
- private static TimeZone currentTimeZone;
-
- // Constructor
- protected TimeZone ()
- {
- }
-
- // Properties
- public static TimeZone CurrentTimeZone
- {
- get {
- if (currentTimeZone == null)
- currentTimeZone = new CurrentTimeZone ();
-
- return currentTimeZone;
- }
- }
-
- public abstract string DaylightName
- {
- get;
- }
-
- public abstract string StandardName
- {
- get;
- }
-
- // Methods
- public abstract DaylightTime GetDaylightChanges (int year);
-
- public abstract TimeSpan GetUtcOffset (DateTime time);
-
- public virtual bool IsDaylightSavingTime (DateTime time)
- {
- return IsDaylightSavingTime (time, GetDaylightChanges (time.Year));
- }
-
- public static bool IsDaylightSavingTime (DateTime time, DaylightTime daylightTimes)
- {
- if (daylightTimes == null)
- throw new ArgumentNullException ("daylightTimes");
-
- // If Start == End, then DST is off
- if (daylightTimes.Start.Ticks == daylightTimes.End.Ticks)
- return false;
-
- //We are in the northern hemisphere.
- if (daylightTimes.Start.Ticks < daylightTimes.End.Ticks) {
- if (daylightTimes.Start.Ticks < time.Ticks
- && daylightTimes.End.Ticks > time.Ticks)
- return true; // time lies between Start and End
-
- } else { // We are in the southern hemisphere.
- if (time.Year == daylightTimes.Start.Year && time.Year == daylightTimes.End.Year)
- if (time.Ticks < daylightTimes.End.Ticks
- || time.Ticks > daylightTimes.Start.Ticks)
- return true; // time is less than End OR more than Start
- }
-
- return false;
- }
-
- public virtual DateTime ToLocalTime (DateTime time)
- {
- return time + GetUtcOffset (time);
- }
-
- public virtual DateTime ToUniversalTime (DateTime time)
- {
- return time - GetUtcOffset (time);
- }
- }
-
- internal class CurrentTimeZone : TimeZone
- {
- // Fields
- private static string daylightName;
- private static string standardName;
-
- // A yearwise cache of DaylightTime.
- private static Hashtable daylightCache = new Hashtable (1);
-
- // the offset when daylightsaving is not on.
- private static TimeSpan utcOffsetWithOutDLS;
-
- // the offset when daylightsaving is on.
- private static TimeSpan utcOffsetWithDLS;
-
- internal enum TimeZoneData {
- DaylightSavingStartIdx,
- DaylightSavingEndIdx,
- UtcOffsetIdx,
- AdditionalDaylightOffsetIdx
- };
-
- internal enum TimeZoneNames {
- StandardNameIdx,
- DaylightNameIdx
- };
-
- // Internal method to get timezone data.
- // data[0]: start of daylight saving time (in DateTime ticks).
- // data[1]: end of daylight saving time (in DateTime ticks).
- // data[2]: utcoffset (in TimeSpan ticks).
- // data[3]: additional offset when daylight saving (in TimeSpan ticks).
- // name[0]: name of this timezone when not daylight saving.
- // name[1]: name of this timezone when daylight saving.
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern bool GetTimeZoneData (int year,
- out Int64[] data,
- out string[] names);
-
- // Constructor
- internal CurrentTimeZone ()
- : base ()
- {
- Int64[] data;
- string[] names;
-
- DateTime now = new DateTime(DateTime.GetNow ());
- if (!GetTimeZoneData (now.Year, out data, out names))
- throw new NotSupportedException (Locale.GetText ("Can't get timezone name"));
-
- standardName = Locale.GetText (names[(int)TimeZoneNames.StandardNameIdx]);
- daylightName = Locale.GetText (names[(int)TimeZoneNames.DaylightNameIdx]);
-
- utcOffsetWithOutDLS = new TimeSpan (data[(int)TimeZoneData.UtcOffsetIdx]);
- utcOffsetWithDLS = new TimeSpan (data[(int)TimeZoneData.UtcOffsetIdx] + data[(int)TimeZoneData.AdditionalDaylightOffsetIdx]);
- }
-
- // Properties
- public override string DaylightName
- {
- get { return daylightName; }
- }
-
- public override string StandardName
- {
- get { return standardName; }
- }
-
- // Methods
- [MonoTODO]
- public override DaylightTime GetDaylightChanges (int year)
- {
- if (year < 1 || year > 9999)
- throw new ArgumentOutOfRangeException (year + " is not in a range between 1 and 9999.");
-
- if (daylightCache [year] == null) {
- Int64[] data;
- string[] names;
-
- if (!GetTimeZoneData (year, out data, out names))
- throw new ArgumentException (Locale.GetText ("Can't get timezone data for " + year));
-
- DaylightTime dlt = new DaylightTime (new DateTime (data[(int)TimeZoneData.DaylightSavingStartIdx]),
- new DateTime (data[(int)TimeZoneData.DaylightSavingEndIdx]),
- new TimeSpan (data[(int)TimeZoneData.AdditionalDaylightOffsetIdx]));
- daylightCache.Add (year, dlt);
- }
-
- return (DaylightTime) daylightCache [year];
- }
-
- public override TimeSpan GetUtcOffset (DateTime time)
- {
- if (IsDaylightSavingTime (time))
- return utcOffsetWithDLS;
-
- return utcOffsetWithOutDLS;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Type.cs b/mcs/class/corlib/System/Type.cs
deleted file mode 100644
index bea8d18d1d9..00000000000
--- a/mcs/class/corlib/System/Type.cs
+++ /dev/null
@@ -1,930 +0,0 @@
-//
-// System.Type.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// TODO: Mucho left to implement.
-//
-
-using System.Reflection;
-using System.Collections;
-using System.Runtime.CompilerServices;
-using System.Globalization;
-
-namespace System {
-
- //
- // FIXME: Implement the various IReflect dependencies
- //
-
- [MonoTODO]
- [Serializable]
- public abstract class Type : MemberInfo, IReflect {
-
- internal RuntimeTypeHandle _impl;
-
- public static readonly char Delimiter = '.';
- public static readonly Type[] EmptyTypes = {};
- public static readonly MemberFilter FilterAttribute = new MemberFilter (FilterAttribute_impl);
- public static readonly MemberFilter FilterName = new MemberFilter (FilterName_impl);
- public static readonly MemberFilter FilterNameIgnoreCase = new MemberFilter (FilterNameIgnoreCase_impl);
- public static readonly object Missing;
-
- private const BindingFlags DefaultBindingFlags =
- BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
-
- /* implementation of the delegates for MemberFilter */
- static bool FilterName_impl (MemberInfo m, object filterCriteria)
- {
- string name = (string) filterCriteria;
- return name.Equals (m.Name);
- }
-
- static bool FilterNameIgnoreCase_impl (MemberInfo m, object filterCriteria)
- {
- string name = (string) filterCriteria;
- return String.Compare (name, m.Name, true) == 0;
- }
-
- [MonoTODO]
- static bool FilterAttribute_impl (MemberInfo m, object filterCriteria)
- {
- throw new NotImplementedException ("FilterAttribute_impl");
- }
-
- protected Type ()
- {
- }
-
- /// <summary>
- /// The assembly where the type is defined.
- /// </summary>
- public abstract Assembly Assembly {
- get;
- }
-
- /// <summary>
- /// Gets the fully qualified name for the type including the
- /// assembly name where the type is defined.
- /// </summary>
- public abstract string AssemblyQualifiedName {
- get;
- }
-
- /// <summary>
- /// Returns the Attributes associated with the type.
- /// </summary>
- public TypeAttributes Attributes {
- get {
- return GetAttributeFlagsImpl ();
- }
- }
-
- /// <summary>
- /// Returns the basetype for this type
- /// </summary>
- public abstract Type BaseType {
- get;
- }
-
- /// <summary>
- /// Returns the class that declares the member.
- /// </summary>
- public override Type DeclaringType {
- get {
- return this;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- [MonoTODO]
- public static Binder DefaultBinder {
- get {
- return null;
- }
- }
-
- /// <summary>
- /// The full name of the type including its namespace
- /// </summary>
- public abstract string FullName {
- get;
- }
-
- public abstract Guid GUID {
- get;
- }
-
- public bool HasElementType {
- get {
- return HasElementTypeImpl ();
- }
- }
-
- public bool IsAbstract {
- get {
- return (Attributes & TypeAttributes.Abstract) != 0;
- }
- }
-
- public bool IsAnsiClass {
- get {
- return (Attributes & TypeAttributes.StringFormatMask)
- == TypeAttributes.AnsiClass;
- }
- }
-
- public bool IsArray {
- get {
- return IsArrayImpl ();
- }
- }
-
- public bool IsAutoClass {
- get {
- return (Attributes & TypeAttributes.StringFormatMask) == TypeAttributes.AutoClass;
- }
- }
-
- public bool IsAutoLayout {
- get {
- return (Attributes & TypeAttributes.LayoutMask) == TypeAttributes.AutoLayout;
- }
- }
-
- public bool IsByRef {
- get {
- return IsByRefImpl ();
- }
- }
-
- public bool IsClass {
- get {
- if (this == typeof (System.Enum) || this == typeof (System.ValueType))
- return true;
- if (IsInterface)
- return false;
- return !type_is_subtype_of (this, typeof (System.ValueType), false);
- }
- }
-
- public bool IsCOMObject {
- get {
- return IsCOMObjectImpl ();
- }
- }
-
- public bool IsContextful {
- get {
- return IsContextfulImpl ();
- }
- }
-
- public bool IsEnum {
- get {
- return type_is_subtype_of (this, typeof (System.Enum), false) &&
- this != typeof (System.Enum);
- }
- }
-
- public bool IsExplicitLayout {
- get {
- return (Attributes & TypeAttributes.LayoutMask) == TypeAttributes.ExplicitLayout;
- }
- }
-
- public bool IsImport {
- get {
- return (Attributes & TypeAttributes.Import) != 0;
- }
- }
-
- public bool IsInterface {
- get {
- return (Attributes & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface;
- }
- }
-
- public bool IsLayoutSequential {
- get {
- return (Attributes & TypeAttributes.LayoutMask) == TypeAttributes.SequentialLayout;
- }
- }
-
- public bool IsMarshalByRef {
- get {
- return IsMarshalByRefImpl ();
- }
- }
-
- public bool IsNestedAssembly {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedAssembly;
- }
- }
-
- public bool IsNestedFamANDAssem {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamANDAssem;
- }
- }
-
- public bool IsNestedFamily {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamily;
- }
- }
-
- public bool IsNestedFamORAssem {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedFamORAssem;
- }
- }
-
- public bool IsNestedPrivate {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate;
- }
- }
-
- public bool IsNestedPublic {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic;
- }
- }
-
- public bool IsNotPublic {
- get {
- return !IsPublic;
- }
- }
-
- public bool IsPointer {
- get {
- return IsPointerImpl ();
- }
- }
-
- public bool IsPrimitive {
- get {
- return IsPrimitiveImpl ();
- }
- }
-
- public bool IsPublic {
- get {
- return (Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public;
- }
- }
-
- public bool IsSealed {
- get {
- return (Attributes & TypeAttributes.Sealed) != 0;
- }
- }
-
- public bool IsSerializable {
- get {
- return (Attributes & TypeAttributes.Serializable) != 0;
- }
- }
-
- public bool IsSpecialName {
- get {
- return (Attributes & TypeAttributes.SpecialName) != 0;
- }
- }
-
- public bool IsUnicodeClass {
- get {
- return (Attributes & TypeAttributes.StringFormatMask) == TypeAttributes.UnicodeClass;
- }
- }
-
- public bool IsValueType {
- get {
- return IsValueTypeImpl ();
- }
- }
-
- public override MemberTypes MemberType {
- get {return MemberTypes.TypeInfo;}
- }
-
- public abstract Module Module {get;}
-
- public abstract string Namespace {get;}
-
- public override Type ReflectedType {
- get {
- return this;
- }
- }
-
- public abstract RuntimeTypeHandle TypeHandle {get;}
-
- public ConstructorInfo TypeInitializer {
- get {
- return GetConstructorImpl (
- BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static,
- null,
- CallingConventions.Any,
- EmptyTypes,
- null);
- }
- }
-
- public abstract Type UnderlyingSystemType {get;}
-
- public override bool Equals (object o)
- {
- if (o == null)
- return false;
-
- // TODO: return UnderlyingSystemType == o.UnderlyingSystemType;
- Type cmp = o as Type;
- if (cmp == null)
- return false;
- return Equals (cmp);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern bool Equals (Type type);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Type internal_from_handle (RuntimeTypeHandle handle);
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Type internal_from_name (string name);
-
- public static Type GetType(string typeName)
- {
- return internal_from_name (typeName);
- }
-
- public static Type GetType(string typeName, bool throwOnError)
- {
- // LAMESPEC: what kinds of errors cause exception to be thrown?
- return internal_from_name (typeName);
- }
-
- [MonoTODO]
- public static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
- {
- throw new NotImplementedException ();
- }
-
- public static Type[] GetTypeArray (object[] args) {
- if (args == null)
- throw new ArgumentNullException ("args");
-
- Type[] ret;
- ret = new Type [args.Length];
- for (int i = 0; i < args.Length; ++i)
- ret [i] = args[i].GetType ();
- return ret;
- }
-
- [MonoTODO]
- public static TypeCode GetTypeCode (Type type)
- {
- // FIXME -- this is most likely too simplistic for all cases;
- // e.g. Enums
-
- if (type.IsArray)
- return TypeCode.Object;
-
- Type ust = type.UnderlyingSystemType;
-
- if (ust == typeof (Boolean))
- return TypeCode.Boolean;
- if (ust == typeof (Byte))
- return TypeCode.Byte;
- if (ust == typeof (Char))
- return TypeCode.Char;
- if (ust == typeof (DateTime))
- return TypeCode.DateTime;
- if (ust == typeof (DBNull))
- return TypeCode.DBNull;
- if (ust == typeof (Decimal))
- return TypeCode.Decimal;
- if (ust == typeof (Double))
- return TypeCode.Double;
- if (ust == typeof (Int16))
- return TypeCode.Int16;
- if (ust == typeof (Int32))
- return TypeCode.Int32;
- if (ust == typeof (Int64))
- return TypeCode.Int64;
- if (ust == typeof (SByte))
- return TypeCode.SByte;
- if (ust == typeof (Single))
- return TypeCode.Single;
- if (ust == typeof (String))
- return TypeCode.String;
- if (ust == typeof (UInt16))
- return TypeCode.UInt16;
- if (ust == typeof (UInt32))
- return TypeCode.UInt32;
- if (ust == typeof (UInt64))
- return TypeCode.UInt64;
-
- return TypeCode.Object;
- }
-
- [MonoTODO]
- public static Type GetTypeFromCLSID (Guid clsid)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Type GetTypeFromCLSID (Guid clsid, bool throwOnError)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Type GetTypeFromCLSID (Guid clsid, string server)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Type GetTypeFromCLSID (Guid clsid, string server, bool throwOnError)
- {
- throw new NotImplementedException ();
- }
-
- public static Type GetTypeFromHandle (RuntimeTypeHandle handle)
- {
- return internal_from_handle (handle);
- }
-
- [MonoTODO]
- public static Type GetTypeFromProgID (string progID)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Type GetTypeFromProgID (string progID, bool throwOnError)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Type GetTypeFromProgID (string progID, string server)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public static Type GetTypeFromProgID (string progID, string server, bool throwOnError)
- {
- throw new NotImplementedException ();
- }
-
- public static RuntimeTypeHandle GetTypeHandle (object o)
- {
- return o.GetType().TypeHandle;
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- internal static extern bool type_is_subtype_of (Type a, Type b, bool check_interfaces);
-
- public virtual bool IsSubclassOf (Type c)
- {
- return type_is_subtype_of (this, c, false);
- }
-
- [MonoTODO]
- public virtual Type[] FindInterfaces (TypeFilter filter, object filterCriteria)
- {
- // FIXME
- throw new NotImplementedException ();
- }
-
- public Type GetInterface (string name) {
- return GetInterface (name, false);
- }
-
- public abstract Type GetInterface (string name, bool ignoreCase);
-
- public virtual InterfaceMapping GetInterfaceMap (Type interfaceType) {
- throw new NotImplementedException ();
- }
-
- public abstract Type[] GetInterfaces ();
-
- [MonoTODO]
- public virtual bool IsAssignableFrom (Type c)
- {
- // FIXME
- return type_is_subtype_of (c, this, true);
- }
-
- public virtual bool IsInstanceOfType (object o) {
- if (o != null) {
- return o.GetType().IsSubclassOf (this);
- }
- return false;
- }
-
- public virtual int GetArrayRank ()
- {
- throw new NotSupportedException (); // according to MSDN
- }
-
- public abstract Type GetElementType ();
-
- public EventInfo GetEvent (string name)
- {
- return GetEvent (name, DefaultBindingFlags);
- }
-
- public abstract EventInfo GetEvent (string name, BindingFlags bindingAttr);
-
- public virtual EventInfo[] GetEvents ()
- {
- return GetEvents (DefaultBindingFlags);
- }
-
- public abstract EventInfo[] GetEvents (BindingFlags bindingAttr);
-
- public FieldInfo GetField( string name)
- {
- return GetField (name, DefaultBindingFlags);
- }
-
- public abstract FieldInfo GetField( string name, BindingFlags bindingAttr);
-
- public FieldInfo[] GetFields ()
- {
- return GetFields (DefaultBindingFlags);
- }
-
- public abstract FieldInfo[] GetFields (BindingFlags bindingAttr);
-
- public override int GetHashCode()
- {
- return (int)_impl.Value;
- }
-
- public MemberInfo[] GetMember( string name)
- {
- return GetMember (name, DefaultBindingFlags);
- }
-
- public virtual MemberInfo[] GetMember( string name, BindingFlags bindingAttr)
- {
- return GetMember (name, MemberTypes.All, bindingAttr);
- }
-
- public virtual MemberInfo[] GetMember (string name, MemberTypes type,
- BindingFlags bindingAttr)
- {
- throw new NotSupportedException (); // according to MSDN
- }
-
- public MemberInfo[] GetMembers()
- {
- return GetMembers (DefaultBindingFlags);
- }
-
- public abstract MemberInfo[] GetMembers (BindingFlags bindingAttr);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern MethodInfo get_method (Type type, string name, Type[] types);
-
- public MethodInfo GetMethod (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- return GetMethodImpl (
- name, DefaultBindingFlags, null, CallingConventions.Any, null, null);
- }
-
- public MethodInfo GetMethod (string name, BindingFlags bindingAttr)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
-
- return GetMethodImpl (name, bindingAttr, null, CallingConventions.Any, null, null);
- }
-
- [MonoTODO]
- public MethodInfo GetMethod (string name, Type[] types)
- {
- //TODO: return GetMethod (
- // name, DefaultBindingFlags, null, CallingConventions.Any, types, null);
- return get_method (this, name, types);
- }
-
- public MethodInfo GetMethod( string name, Type[] types, ParameterModifier[] modifiers)
- {
- return GetMethod (name, DefaultBindingFlags, null,
- CallingConventions.Any, types, modifiers);
- }
-
- public MethodInfo GetMethod (string name, BindingFlags bindingAttr, Binder binder,
- Type[] types, ParameterModifier[] modifiers)
- {
-
- return GetMethod (name, bindingAttr, binder,
- CallingConventions.Any, types, modifiers);
- }
-
- public MethodInfo GetMethod (string name, BindingFlags bindingAttr,
- Binder binder, CallingConventions callConvention,
- Type[] types, ParameterModifier[] modifiers)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- if (types == null)
- throw new ArgumentNullException ("types");
-
- return GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
- }
-
- protected abstract MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr,
- Binder binder,
- CallingConventions callConvention,
- Type[] types, ParameterModifier[] modifiers);
-
- public MethodInfo[] GetMethods ()
- {
- return GetMethods (DefaultBindingFlags);
- }
-
- public abstract MethodInfo[] GetMethods (BindingFlags bindingAttr);
-
- public Type GetNestedType (string name)
- {
- return GetNestedType (name, DefaultBindingFlags);
- }
-
- public abstract Type GetNestedType (string name, BindingFlags bindingAttr);
-
- public Type[] GetNestedTypes ()
- {
- return GetNestedTypes (DefaultBindingFlags);
- }
-
- public abstract Type[] GetNestedTypes (BindingFlags bindingAttr);
-
-
- public PropertyInfo[] GetProperties ()
- {
- return GetProperties (DefaultBindingFlags);
- }
-
- public abstract PropertyInfo[] GetProperties (BindingFlags bindingAttr);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern PropertyInfo get_property (Type type, string name, Type[] types);
-
-
- public PropertyInfo GetProperty (string name)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
-
- return GetPropertyImpl (name, DefaultBindingFlags, null, null, new Type[0], null);
- }
-
- public PropertyInfo GetProperty (string name, BindingFlags bindingAttr)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- return GetPropertyImpl (name, bindingAttr, null, null, new Type[0], null);
- }
-
- public PropertyInfo GetProperty (string name, Type returnType)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- return GetPropertyImpl (name, DefaultBindingFlags, null, returnType, new Type[0], null);
- }
-
- [MonoTODO]
- public PropertyInfo GetProperty (string name, Type[] types)
- {
- // TODO: return GetProperty (name, DefaultBindingFlags, null, null, types, null);
- return get_property (this, name, types);
- }
-
- public PropertyInfo GetProperty (string name, Type returnType, Type[] types)
- {
- return GetProperty (name, DefaultBindingFlags, null, returnType, types, null);
- }
-
- public PropertyInfo GetProperty( string name, Type returnType, Type[] types,
- ParameterModifier[] modifiers)
- {
- return GetProperty (name, DefaultBindingFlags, null, returnType, types, modifiers);
- }
-
- public PropertyInfo GetProperty (string name, BindingFlags bindingAttr,
- Binder binder, Type returnType,
- Type[] types, ParameterModifier[] modifiers)
- {
- if (name == null)
- throw new ArgumentNullException ("name");
- if (types == null)
- throw new ArgumentNullException ("types");
-
- return GetPropertyImpl (name, bindingAttr, binder, returnType, types, modifiers);
- }
-
- protected abstract PropertyInfo GetPropertyImpl (string name,
- BindingFlags bindingAttr,
- Binder binder, Type returnType,
- Type[] types,
- ParameterModifier[] modifiers);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern ConstructorInfo get_constructor (Type type, Type[] types);
-
- protected abstract ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr,
- Binder binder,
- CallingConventions callConvention,
- Type[] types,
- ParameterModifier[] modifiers);
-
- protected abstract TypeAttributes GetAttributeFlagsImpl ();
- protected abstract bool HasElementTypeImpl ();
- protected abstract bool IsArrayImpl ();
- protected abstract bool IsByRefImpl ();
- protected abstract bool IsCOMObjectImpl ();
- protected abstract bool IsPointerImpl ();
- protected abstract bool IsPrimitiveImpl ();
- protected abstract bool IsValueTypeImpl ();
-
- protected virtual bool IsContextfulImpl ()
- {
- return typeof (ContextBoundObject).IsAssignableFrom (this);
- }
-
- protected virtual bool IsMarshalByRefImpl ()
- {
- return typeof (MarshalByRefObject).IsAssignableFrom (this);
- }
-
- [MonoTODO]
- public ConstructorInfo GetConstructor (Type[] types)
- {
- // TODO: return GetConstructor
- // (BindingFlags.Public | BindingFlags.NonPublic, null, types, null);
-
- return get_constructor (this, types);
- }
-
- public ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder,
- Type[] types, ParameterModifier[] modifiers)
- {
- return GetConstructor (
- bindingAttr, binder, CallingConventions.Any, types, modifiers);
- }
-
- public ConstructorInfo GetConstructor (BindingFlags bindingAttr, Binder binder,
- CallingConventions callConvention,
- Type[] types, ParameterModifier[] modifiers)
- {
- if (types == null)
- throw new ArgumentNullException ("types");
-
- return GetConstructorImpl (bindingAttr, binder, callConvention, types, modifiers);
- }
-
- public ConstructorInfo[] GetConstructors ()
- {
- return GetConstructors (BindingFlags.Public | BindingFlags.NonPublic);
- }
-
- public abstract ConstructorInfo[] GetConstructors (BindingFlags bindingAttr);
-
- [MonoTODO]
- public virtual MemberInfo[] GetDefaultMembers ()
- {
- throw new NotImplementedException ();
- }
-
- public virtual MemberInfo[] FindMembers (MemberTypes memberType, BindingFlags bindingAttr,
- MemberFilter filter, object filterCriteria)
- {
- MemberInfo[] result;
- ArrayList l = new ArrayList ();
-
- // Console.WriteLine ("FindMembers for {0} (Type: {1}): {2}",
- // this.FullName, this.GetType().FullName, this.obj_address());
-
- if ((memberType & MemberTypes.Constructor) != 0) {
- ConstructorInfo[] c = GetConstructors (bindingAttr);
- if (filter != null) {
- foreach (MemberInfo m in c) {
- if (filter (m, filterCriteria))
- l.Add (m);
- }
- } else {
- l.AddRange (c);
- }
- }
- if ((memberType & MemberTypes.Event) != 0) {
- EventInfo[] c = GetEvents (bindingAttr);
- if (filter != null) {
- foreach (MemberInfo m in c) {
- if (filter (m, filterCriteria))
- l.Add (m);
- }
- } else {
- l.AddRange (c);
- }
- }
- if ((memberType & MemberTypes.Field) != 0) {
- FieldInfo[] c = GetFields (bindingAttr);
- if (filter != null) {
- foreach (MemberInfo m in c) {
- if (filter (m, filterCriteria))
- l.Add (m);
- }
- } else {
- l.AddRange (c);
- }
- }
- if ((memberType & MemberTypes.Method) != 0) {
- MethodInfo[] c = GetMethods (bindingAttr);
- if (filter != null) {
- foreach (MemberInfo m in c) {
- if (filter (m, filterCriteria))
- l.Add (m);
- }
- } else {
- l.AddRange (c);
- }
- }
- if ((memberType & MemberTypes.Property) != 0) {
- PropertyInfo[] c;
- int count = l.Count;
- Type ptype;
- if (filter != null) {
- ptype = this;
- while ((l.Count == count) && (ptype != null)) {
- c = ptype.GetProperties (bindingAttr);
- foreach (MemberInfo m in c) {
- if (filter (m, filterCriteria))
- l.Add (m);
- }
- ptype = ptype.BaseType;
- }
- } else {
- c = GetProperties (bindingAttr);
- l.AddRange (c);
- }
- }
- if ((memberType & MemberTypes.NestedType) != 0) {
- Type[] c = GetNestedTypes (bindingAttr);
- if (filter != null) {
- foreach (MemberInfo m in c) {
- if (filter (m, filterCriteria)) {
- l.Add (m);
- }
- }
- } else {
- l.AddRange (c);
- }
- }
- result = new MemberInfo [l.Count];
- l.CopyTo (result);
- return result;
- }
-
- [MonoTODO]
- public object InvokeMember (string name, BindingFlags invokeAttr, Binder binder,
- object target, object[] args)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public object InvokeMember (string name, BindingFlags invokeAttr, Binder binder,
- object target, object[] args, CultureInfo culture)
- {
- throw new NotImplementedException ();
- }
-
- public abstract object InvokeMember (string name, BindingFlags invokeAttr,
- Binder binder, object target, object[] args,
- ParameterModifier[] modifiers,
- CultureInfo culture, string[] namedParameters);
-
- public override string ToString()
- {
- return FullName;
- }
- }
-}
diff --git a/mcs/class/corlib/System/TypeCode.cs b/mcs/class/corlib/System/TypeCode.cs
deleted file mode 100644
index e2ef3f4a746..00000000000
--- a/mcs/class/corlib/System/TypeCode.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// TypeCode.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:09 UTC
-// Source file: all.xml
-// URL: http://devresource.hp.com/devresource/Docs/TechPapers/CSharp/all.xml
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-
-
-namespace System {
-
-
- /// <summary>
- /// </summary>
- public enum TypeCode {
-
- /// <summary>
- /// </summary>
- Empty = 0,
-
- /// <summary>
- /// </summary>
- Object = 1,
-
- /// <summary>
- /// </summary>
- DBNull = 2,
-
- /// <summary>
- /// </summary>
- Boolean = 3,
-
- /// <summary>
- /// </summary>
- Char = 4,
-
- /// <summary>
- /// </summary>
- SByte = 5,
-
- /// <summary>
- /// </summary>
- Byte = 6,
-
- /// <summary>
- /// </summary>
- Int16 = 7,
-
- /// <summary>
- /// </summary>
- UInt16 = 8,
-
- /// <summary>
- /// </summary>
- Int32 = 9,
-
- /// <summary>
- /// </summary>
- UInt32 = 10,
-
- /// <summary>
- /// </summary>
- Int64 = 11,
-
- /// <summary>
- /// </summary>
- UInt64 = 12,
-
- /// <summary>
- /// </summary>
- Single = 13,
-
- /// <summary>
- /// </summary>
- Double = 14,
-
- /// <summary>
- /// </summary>
- Decimal = 15,
-
- /// <summary>
- /// </summary>
- DateTime = 16,
-
- /// <summary>
- /// </summary>
- String = 18,
- } // TypeCode
-
-} // System
diff --git a/mcs/class/corlib/System/TypeInitializationException.cs b/mcs/class/corlib/System/TypeInitializationException.cs
deleted file mode 100644
index cae537d64b5..00000000000
--- a/mcs/class/corlib/System/TypeInitializationException.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// System.TypeInitializationException.cs
-//
-// Author:
-// Joe Shaw (joe@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-using System.Globalization;
-using System.Runtime.Serialization;
-namespace System {
-
- [Serializable]
- public sealed class TypeInitializationException : SystemException {
- string type_name;
-
- // Constructors
- public TypeInitializationException (string type_name, Exception inner)
- : base (Locale.GetText ("An exception was thrown by the type initializer for ") + type_name, inner)
- {
- this.type_name = type_name;
- }
-
- // 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);
- }
- }
-
-}
diff --git a/mcs/class/corlib/System/TypeLoadException.cs b/mcs/class/corlib/System/TypeLoadException.cs
deleted file mode 100644
index 91458786b3a..00000000000
--- a/mcs/class/corlib/System/TypeLoadException.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// System.TypeLoadException
-//
-// Author:
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class TypeLoadException : SystemException {
-
- // Fields
- private string msg;
- private string type;
-
- // Constructors
- public TypeLoadException ()
- : base (Locale.GetText ("A type load exception has occurred."))
- {
- msg = Locale.GetText ("A type load exception has occured.");
- }
-
- public TypeLoadException (string message)
- : base (message)
- {
- msg = message;
- }
-
- public TypeLoadException (string message, Exception inner)
- : base (message, inner)
- {
- msg = message;
- }
-
- protected TypeLoadException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
-
- // Properties
- public override string Message
- {
- get { return msg; }
- }
-
- public string TypeName
- {
- get { return type; }
- }
-
- // Methods
- //
- // It seems like this object serializes more fields than those described.
- // Those fields are TypeLoadClassName, TypeLoadAssemblyName,
- // TypeLoadMessageArg and TypeLoadResourceID.
- //
- [MonoTODO]
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info is null.");
- base.GetObjectData (info, context);
- }
- }
-}
diff --git a/mcs/class/corlib/System/TypeUnloadedException.cs b/mcs/class/corlib/System/TypeUnloadedException.cs
deleted file mode 100644
index 10929e3fe68..00000000000
--- a/mcs/class/corlib/System/TypeUnloadedException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.TypeUnloadedException.cs
-//
-// Author:
-// Duncan Mak (duncan@ximian.com)
-//
-// 2002 (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System
-{
- [Serializable]
- 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)
- {
- }
-
- }
-}
-
diff --git a/mcs/class/corlib/System/UInt16.cs b/mcs/class/corlib/System/UInt16.cs
deleted file mode 100644
index a8256a7e00c..00000000000
--- a/mcs/class/corlib/System/UInt16.cs
+++ /dev/null
@@ -1,241 +0,0 @@
-//
-// System.UInt16.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [CLSCompliant(false)]
- [Serializable]
- public struct UInt16 : IComparable, IFormattable, IConvertible {
-
- public const ushort MaxValue = 0xffff;
- public const ushort MinValue = 0;
-
- public ushort value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if(!(v is System.UInt16))
- throw new ArgumentException (Locale.GetText ("Value is not a System.UInt16"));
-
- return value - ((ushort) v);
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.UInt16))
- return false;
-
- return ((ushort) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return value;
- }
-
- [CLSCompliant(false)]
- public static ushort Parse (string s)
- {
- ushort val = 0;
- int len;
- int i;
- bool digits_seen = false;
- bool has_negative_sign = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- if (s [i] == '+')
- i++;
- else
- if (s[i] == '-'){
- i++;
- has_negative_sign = true;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- ushort d = (ushort) (c - '0');
-
- val = checked ((ushort) (val * 10 + d));
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- if (has_negative_sign)
- throw new OverflowException ();
-
- return val;
-
- }
-
- [CLSCompliant(false)]
- public static ushort Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- [CLSCompliant(false)]
- public static ushort Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [CLSCompliant(false)]
- public static ushort Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- uint tmpResult = UInt32.Parse (s, style, fp);
- if (tmpResult > UInt16.MaxValue || tmpResult < UInt16.MinValue)
- throw new OverflowException ("Value too large or too small.");
-
- return (ushort) tmpResult;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.UInt16;
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return System.Convert.ToDateTime (value);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32 (value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
-
- [CLSCompliant (false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType (value, conversionType, provider);
- }
-
- [CLSCompliant (false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
-
- [CLSCompliant (false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
-
- [CLSCompliant (false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/UInt32.cs b/mcs/class/corlib/System/UInt32.cs
deleted file mode 100644
index 6a04d6b13af..00000000000
--- a/mcs/class/corlib/System/UInt32.cs
+++ /dev/null
@@ -1,429 +0,0 @@
-//
-// System.UInt32.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Threading;
-
-namespace System {
-
- [CLSCompliant(false)]
- [Serializable]
- public struct UInt32 : IComparable, IFormattable, IConvertible {
-
- public const uint MaxValue = 0xffffffff;
- public const uint MinValue = 0;
-
- public uint value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.UInt32))
- throw new ArgumentException (Locale.GetText ("Value is not a System.UInt32"));
-
- if (value == (uint) v)
- return 0;
-
- if (value < (uint) v)
- return -1;
-
- return 1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.UInt32))
- return false;
-
- return ((uint) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int) value;
- }
-
- [CLSCompliant(false)]
- public static uint Parse (string s)
- {
- uint val = 0;
- int len;
- int i;
- bool digits_seen = false;
- bool has_negative_sign = false;
-
- if (s == null)
- throw new ArgumentNullException (Locale.GetText ("s is null"));
-
- len = s.Length;
-
- char c;
- for (i = 0; i < len; i++){
- c = s [i];
- if (!Char.IsWhiteSpace (c))
- break;
- }
-
- if (i == len)
- throw new FormatException ();
-
- if (s [i] == '+')
- i++;
- else
- if (s[i] == '-'){
- i++;
- has_negative_sign = true;
- }
-
- for (; i < len; i++){
- c = s [i];
-
- if (c >= '0' && c <= '9'){
- uint d = (uint) (c - '0');
-
- val = checked (val * 10 + d);
- digits_seen = true;
- } else {
- if (Char.IsWhiteSpace (c)){
- for (i++; i < len; i++){
- if (!Char.IsWhiteSpace (s [i]))
- throw new FormatException ();
- }
- break;
- } else
- throw new FormatException ();
- }
- }
- if (!digits_seen)
- throw new FormatException ();
-
- if (has_negative_sign)
- throw new OverflowException ();
-
- return val;
- }
-
- [CLSCompliant(false)]
- public static uint Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- [CLSCompliant(false)]
- public static uint Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [CLSCompliant(false)]
- public static uint Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- if (s == null)
- throw new ArgumentNullException ();
-
- if (s.Length == 0)
- throw new FormatException ("Input string was not in the correct format.");
-
- NumberFormatInfo nfi;
- if (fp != null) {
- Type typeNFI = typeof (System.Globalization.NumberFormatInfo);
- nfi = (NumberFormatInfo) fp.GetFormat (typeNFI);
- }
- else
- nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
-
- Int32.CheckStyle (style);
-
- bool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;
- bool AllowExponent = (style & NumberStyles.AllowExponent) != 0;
- bool AllowHexSpecifier = (style & NumberStyles.AllowHexSpecifier) != 0;
- bool AllowThousands = (style & NumberStyles.AllowThousands) != 0;
- bool AllowDecimalPoint = (style & NumberStyles.AllowDecimalPoint) != 0;
- bool AllowParentheses = (style & NumberStyles.AllowParentheses) != 0;
- bool AllowTrailingSign = (style & NumberStyles.AllowTrailingSign) != 0;
- bool AllowLeadingSign = (style & NumberStyles.AllowLeadingSign) != 0;
- bool AllowTrailingWhite = (style & NumberStyles.AllowTrailingWhite) != 0;
- bool AllowLeadingWhite = (style & NumberStyles.AllowLeadingWhite) != 0;
-
- int pos = 0;
-
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
-
- bool foundOpenParentheses = false;
- bool negative = false;
- bool foundSign = false;
- bool foundCurrency = false;
-
- // Pre-number stuff
- if (AllowParentheses && s [pos] == '(') {
- foundOpenParentheses = true;
- foundSign = true;
- negative = true; // MS always make the number negative when there parentheses
- // even when NumberFormatInfo.NumberNegativePattern != 0!!!
- pos++;
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
-
- if (s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign)
- throw new FormatException ("Input string was not in the correct format.");
- if (s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign)
- throw new FormatException ("Input string was not in the correct format.");
- }
-
- if (AllowLeadingSign && !foundSign) {
- // Sign + Currency
- Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol) {
- Int32.FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- if (foundCurrency && AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- }
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency) {
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (foundCurrency) {
- if (!foundSign && AllowLeadingSign) {
- Int32.FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- if (foundSign && AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- }
- }
- }
- }
-
- uint number = 0;
- int nDigits = 0;
- bool decimalPointFound = false;
- uint digitValue;
- char hexDigit;
-
- // Number stuff
- // Just the same as Int32, but this one adds instead of substract
- do {
-
- if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
- if (AllowThousands &&
- Int32.FindOther (ref pos, s, nfi.NumberGroupSeparator))
- continue;
- else
- if (!decimalPointFound && AllowDecimalPoint &&
- Int32.FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
- decimalPointFound = true;
- continue;
- }
-
- break;
- }
- else if (AllowHexSpecifier) {
- nDigits++;
- hexDigit = s [pos++];
- if (Char.IsDigit (hexDigit))
- digitValue = (uint) (hexDigit - '0');
- else if (Char.IsLower (hexDigit))
- digitValue = (uint) (hexDigit - 'a' + 10);
- else
- digitValue = (uint) (hexDigit - 'A' + 10);
-
- number = checked (number * 16 + digitValue);
- }
- else if (decimalPointFound) {
- nDigits++;
- // Allows decimal point as long as it's only
- // followed by zeroes.
- if (s [pos++] != '0')
- throw new OverflowException ("Value too large or too small.");
- }
- else {
- nDigits++;
-
- try {
- number = checked (
- number * 10 +
- (uint) (s [pos++] - '0')
- );
- } catch (OverflowException) {
- throw new OverflowException ("Value too large or too small.");
- }
- }
- } while (pos < s.Length);
-
- // Post number stuff
- if (nDigits == 0)
- throw new FormatException ("Input string was not in the correct format.");
-
- if (AllowTrailingSign && !foundSign) {
- // Sign + Currency
- Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowTrailingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol)
- Int32. FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency) {
- if (AllowTrailingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (!foundSign && AllowTrailingSign)
- Int32.FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- }
- }
-
- if (AllowTrailingWhite && pos < s.Length)
- pos = Int32.JumpOverWhite (pos, s, false);
-
- if (foundOpenParentheses) {
- if (pos >= s.Length || s [pos++] != ')')
- throw new FormatException ("Input string was not in the correct " +
- "format.");
- if (AllowTrailingWhite && pos < s.Length)
- pos = Int32.JumpOverWhite (pos, s, false);
- }
-
- if (pos < s.Length)
- throw new FormatException ("Input string was not in the correct format.");
-
- if (negative)
- throw new OverflowException ( "Value too large or too small.");
-
- return number;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.UInt32;
- }
-
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
-
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
-
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
-
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- return System.Convert.ToDateTime (value);
- }
-
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
-
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
-
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
-
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32 (value);
- }
-
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
-
- [CLSCompliant (false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
-
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
-
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- return System.Convert.ToType (value, conversionType, provider);
- }
-
- [CLSCompliant (false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
-
- [CLSCompliant (false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
-
- [CLSCompliant (false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return System.Convert.ToUInt64 (value);
- }
- }
-}
diff --git a/mcs/class/corlib/System/UInt64.cs b/mcs/class/corlib/System/UInt64.cs
deleted file mode 100644
index 27a55dde59c..00000000000
--- a/mcs/class/corlib/System/UInt64.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-//
-// System.UInt64.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Threading;
-
-namespace System {
-
- [CLSCompliant(false)]
- [Serializable]
- public struct UInt64 : IComparable, IFormattable, IConvertible {
- public const ulong MaxValue = 0xffffffffffffffff;
- public const ulong MinValue = 0;
-
- public ulong value;
-
- public int CompareTo (object v)
- {
- if (v == null)
- return 1;
-
- if (!(v is System.UInt64))
- throw new ArgumentException (Locale.GetText ("Value is not a System.UInt64"));
-
- if (value == (ulong) v)
- return 0;
-
- if (value < (ulong) v)
- return -1;
-
- return 1;
- }
-
- public override bool Equals (object o)
- {
- if (!(o is System.UInt64))
- return false;
-
- return ((ulong) o) == value;
- }
-
- public override int GetHashCode ()
- {
- return (int)(value & 0xffffffff) ^ (int)(value >> 32);
- }
-
- [CLSCompliant(false)]
- public static ulong Parse (string s)
- {
- return Parse (s, NumberStyles.Integer, null);
- }
-
- [CLSCompliant(false)]
- public static ulong Parse (string s, IFormatProvider fp)
- {
- return Parse (s, NumberStyles.Integer, fp);
- }
-
- [CLSCompliant(false)]
- public static ulong Parse (string s, NumberStyles style)
- {
- return Parse (s, style, null);
- }
-
- [CLSCompliant(false)]
- public static ulong Parse (string s, NumberStyles style, IFormatProvider fp)
- {
- if (s == null)
- throw new ArgumentNullException ();
-
- if (s.Length == 0)
- throw new FormatException ("Input string was not in the correct format.");
-
- NumberFormatInfo nfi;
- if (fp != null) {
- Type typeNFI = typeof (System.Globalization.NumberFormatInfo);
- nfi = (NumberFormatInfo) fp.GetFormat (typeNFI);
- }
- else
- nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
-
- Int32.CheckStyle (style);
-
- bool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;
- bool AllowExponent = (style & NumberStyles.AllowExponent) != 0;
- bool AllowHexSpecifier = (style & NumberStyles.AllowHexSpecifier) != 0;
- bool AllowThousands = (style & NumberStyles.AllowThousands) != 0;
- bool AllowDecimalPoint = (style & NumberStyles.AllowDecimalPoint) != 0;
- bool AllowParentheses = (style & NumberStyles.AllowParentheses) != 0;
- bool AllowTrailingSign = (style & NumberStyles.AllowTrailingSign) != 0;
- bool AllowLeadingSign = (style & NumberStyles.AllowLeadingSign) != 0;
- bool AllowTrailingWhite = (style & NumberStyles.AllowTrailingWhite) != 0;
- bool AllowLeadingWhite = (style & NumberStyles.AllowLeadingWhite) != 0;
-
- int pos = 0;
-
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
-
- bool foundOpenParentheses = false;
- bool negative = false;
- bool foundSign = false;
- bool foundCurrency = false;
-
- // Pre-number stuff
- if (AllowParentheses && s [pos] == '(') {
- foundOpenParentheses = true;
- foundSign = true;
- negative = true; // MS always make the number negative when there parentheses
- // even when NumberFormatInfo.NumberNegativePattern != 0!!!
- pos++;
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
-
- if (s.Substring (pos, nfi.NegativeSign.Length) == nfi.NegativeSign)
- throw new FormatException ("Input string was not in the correct format.");
- if (s.Substring (pos, nfi.PositiveSign.Length) == nfi.PositiveSign)
- throw new FormatException ("Input string was not in the correct format.");
- }
-
- if (AllowLeadingSign && !foundSign) {
- // Sign + Currency
- Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol) {
- Int32.FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- if (foundCurrency && AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- }
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency) {
- if (AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (foundCurrency) {
- if (!foundSign && AllowLeadingSign) {
- Int32.FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- if (foundSign && AllowLeadingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- }
- }
- }
- }
-
- ulong number = 0;
- int nDigits = 0;
- bool decimalPointFound = false;
- ulong digitValue;
- char hexDigit;
-
- // Number stuff
- // Just the same as Int32, but this one adds instead of substract
- do {
-
- if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
- if (AllowThousands &&
- Int32.FindOther (ref pos, s, nfi.NumberGroupSeparator))
- continue;
- else
- if (!decimalPointFound && AllowDecimalPoint &&
- Int32.FindOther (ref pos, s, nfi.NumberDecimalSeparator)) {
- decimalPointFound = true;
- continue;
- }
-
- break;
- }
- else if (AllowHexSpecifier) {
- nDigits++;
- hexDigit = s [pos++];
- if (Char.IsDigit (hexDigit))
- digitValue = (ulong) (hexDigit - '0');
- else if (Char.IsLower (hexDigit))
- digitValue = (ulong) (hexDigit - 'a' + 10);
- else
- digitValue = (ulong) (hexDigit - 'A' + 10);
-
- number = checked (number * 16 + digitValue);
- }
- else if (decimalPointFound) {
- nDigits++;
- // Allows decimal point as long as it's only
- // followed by zeroes.
- if (s [pos++] != '0')
- throw new OverflowException ("Value too large or too small.");
- }
- else {
- nDigits++;
-
- try {
- number = checked (
- number * 10 +
- (ulong) (s [pos++] - '0')
- );
- } catch (OverflowException) {
- throw new OverflowException ("Value too large or too small.");
- }
- }
- } while (pos < s.Length);
-
- // Post number stuff
- if (nDigits == 0)
- throw new FormatException ("Input string was not in the correct format.");
-
- if (AllowTrailingSign && !foundSign) {
- // Sign + Currency
- Int32.FindSign (ref pos, s, nfi, ref foundSign, ref negative);
- if (foundSign) {
- if (AllowTrailingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (AllowCurrencySymbol)
- Int32.FindCurrency (ref pos, s, nfi,
- ref foundCurrency);
- }
- }
-
- if (AllowCurrencySymbol && !foundCurrency) {
- // Currency + sign
- Int32.FindCurrency (ref pos, s, nfi, ref foundCurrency);
- if (foundCurrency) {
- if (AllowTrailingWhite)
- pos = Int32.JumpOverWhite (pos, s, true);
- if (!foundSign && AllowTrailingSign)
- Int32.FindSign (ref pos, s, nfi, ref foundSign,
- ref negative);
- }
- }
-
- if (AllowTrailingWhite && pos < s.Length)
- pos = Int32.JumpOverWhite (pos, s, false);
-
- if (foundOpenParentheses) {
- if (pos >= s.Length || s [pos++] != ')')
- throw new FormatException ("Input string was not in the correct " +
- "format.");
- if (AllowTrailingWhite && pos < s.Length)
- pos = Int32.JumpOverWhite (pos, s, false);
- }
-
- if (pos < s.Length)
- throw new FormatException ("Input string was not in the correct format.");
-
- if (negative)
- throw new OverflowException ( "Value too large or too small.");
-
- return number;
- }
-
- public override string ToString ()
- {
- return ToString (null, null);
- }
-
- public string ToString (IFormatProvider fp)
- {
- return ToString (null, fp);
- }
-
- public string ToString (string format)
- {
- return ToString (format, null);
- }
-
- public string ToString (string format, IFormatProvider fp)
- {
- NumberFormatInfo nfi = NumberFormatInfo.GetInstance( fp );
-
- if ( format == null )
- format = "G";
-
- return IntegerFormatter.NumberToString(format, nfi, value);
- }
-
- // =========== IConvertible Methods =========== //
-
- public TypeCode GetTypeCode ()
- {
- return TypeCode.UInt64;
- }
- bool IConvertible.ToBoolean (IFormatProvider provider)
- {
- return System.Convert.ToBoolean (value);
- }
- byte IConvertible.ToByte (IFormatProvider provider)
- {
- return System.Convert.ToByte (value);
- }
- char IConvertible.ToChar (IFormatProvider provider)
- {
- return System.Convert.ToChar (value);
- }
- DateTime IConvertible.ToDateTime (IFormatProvider provider)
- {
- throw new NotImplementedException ();
- }
- decimal IConvertible.ToDecimal (IFormatProvider provider)
- {
- return System.Convert.ToDecimal (value);
- }
- double IConvertible.ToDouble (IFormatProvider provider)
- {
- return System.Convert.ToDouble (value);
- }
- short IConvertible.ToInt16 (IFormatProvider provider)
- {
- return System.Convert.ToInt16 (value);
- }
- int IConvertible.ToInt32 (IFormatProvider provider)
- {
- return System.Convert.ToInt32 (value);
- }
- long IConvertible.ToInt64 (IFormatProvider provider)
- {
- return System.Convert.ToInt64 (value);
- }
- [CLSCompliant(false)]
- sbyte IConvertible.ToSByte (IFormatProvider provider)
- {
- return System.Convert.ToSByte (value);
- }
- float IConvertible.ToSingle (IFormatProvider provider)
- {
- return System.Convert.ToSingle (value);
- }
- object IConvertible.ToType (Type conversionType, IFormatProvider provider)
- {
- throw new NotImplementedException ();
- }
- [CLSCompliant(false)]
- ushort IConvertible.ToUInt16 (IFormatProvider provider)
- {
- return System.Convert.ToUInt16 (value);
- }
- [CLSCompliant(false)]
- uint IConvertible.ToUInt32 (IFormatProvider provider)
- {
- return System.Convert.ToUInt32 (value);
- }
- [CLSCompliant(false)]
- ulong IConvertible.ToUInt64 (IFormatProvider provider)
- {
- return value;
- }
- }
-}
diff --git a/mcs/class/corlib/System/UIntPtr.cs b/mcs/class/corlib/System/UIntPtr.cs
deleted file mode 100644
index cbbe6ca928a..00000000000
--- a/mcs/class/corlib/System/UIntPtr.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// System.UIntPtr.cs
-//
-// Copyright (C) 2001 Michael Lambert, All Rights Reserved
-//
-// Author: Michael Lambert, michaellambert@email.com
-// Created: Thu 07/31/2001
-//
-// Remarks: Requires '/unsafe' compiler option. This class uses void*,
-// ulong, and uint in overloaded constructors, conversion, and
-// cast members in the public interface. Using pointers is not
-// valid CLS and the methods in question have been marked with
-// the CLSCompliant attribute that avoid compiler warnings.
-//
-//------------------------------------------------------------------------------
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-
-namespace System
-{
-
-[
- StructLayout(LayoutKind.Auto),
- CLSCompliant(false)
-]
-[Serializable]
-public unsafe struct UIntPtr : ISerializable
-{
- public static readonly UIntPtr Zero = new UIntPtr(0);
- private void* _pointer;
-
- [
- CLSCompliant(false)
- ]
- public UIntPtr(ulong value)
- {
- _pointer = (void*) value;
- }
-
- [
- CLSCompliant(false)
- ]
- public UIntPtr(uint value)
- {
- _pointer = (void*)value;
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe UIntPtr(void* value)
- {
- _pointer = value;
- }
-
- public override bool Equals(object obj)
- {
- if( obj is UIntPtr )
- {
- UIntPtr obj2 = (UIntPtr)obj;
- return this._pointer == obj2._pointer;
- }
-
- return false;
- }
- public override int GetHashCode()
- {
- return (int)_pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public uint ToUInt32()
- {
- return (uint) _pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public ulong ToUInt64()
- {
- return (ulong) _pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe void* ToPointer()
- {
- return _pointer;
- }
- public override string ToString()
- {
- return ((uint) _pointer).ToString();
- }
-
- // Interface ISerializable
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if( info == null )
- throw new ArgumentNullException( "info" );
- // if( context == null ) -- context is struct can't be null.
- // throw new ArgumentNullException( "context" );
-
- info.AddValue("pointer", (ulong)_pointer);
- }
-
- public static bool operator ==(UIntPtr value1, UIntPtr value2)
- {
- return value1._pointer == value2._pointer;
- }
- public static bool operator !=(UIntPtr value1, UIntPtr value2)
- {
- return value1._pointer != value2._pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator ulong(UIntPtr value)
- {
- return (ulong)value._pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator uint(UIntPtr value)
- {
- return (uint)value._pointer;
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator UIntPtr(ulong value)
- {
- return new UIntPtr(value);
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe static explicit operator UIntPtr(void* value)
- {
- return new UIntPtr(value);
- }
-
- [
- CLSCompliant(false)
- ]
- public unsafe static explicit operator void*(UIntPtr value)
- {
- return value.ToPointer();
- }
-
- [
- CLSCompliant(false)
- ]
- public static explicit operator UIntPtr(uint value)
- {
- return new UIntPtr(value);
- }
-
- public static int Size
- {
- get
- {
- return sizeof(void*);
- }
- }
-}
-
-} // Namespace
-
diff --git a/mcs/class/corlib/System/UnauthorizedAccessException.cs b/mcs/class/corlib/System/UnauthorizedAccessException.cs
deleted file mode 100755
index 6059045f76b..00000000000
--- a/mcs/class/corlib/System/UnauthorizedAccessException.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// System.UnauthorizedAccessException.cs
-//
-// Author:
-// Paolo Molaro (lupus@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-
-namespace System {
-
- [Serializable]
- public class UnauthorizedAccessException : SystemException {
- // Constructors
- public UnauthorizedAccessException ()
- : base (Locale.GetText ("Access to the requested resource is not authorized"))
- {
- }
-
- public UnauthorizedAccessException (string message)
- : base (message)
- {
- }
-
- public UnauthorizedAccessException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected UnauthorizedAccessException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
diff --git a/mcs/class/corlib/System/UnhandledExceptionEventArgs.cs b/mcs/class/corlib/System/UnhandledExceptionEventArgs.cs
deleted file mode 100755
index 81e318eeec4..00000000000
--- a/mcs/class/corlib/System/UnhandledExceptionEventArgs.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// System.UnhandledExceptionEventArgs.cs
-//
-// Author:
-// Chris Hynes (chrish@assistedsolutions.com)
-//
-// (C) 2001 Chris Hynes
-//
-
-using System;
-using System.Reflection;
-
-namespace System
-{
- [Serializable]
- 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
- {
- get
- {
- return exception;
- }
- }
-
- public bool IsTerminating
- {
- get
- {
- return m_isTerminating;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/System/UnhandledExceptionEventHandler.cs b/mcs/class/corlib/System/UnhandledExceptionEventHandler.cs
deleted file mode 100755
index 710af2b4713..00000000000
--- a/mcs/class/corlib/System/UnhandledExceptionEventHandler.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// System.UnhandledExceptionEventHandler.cs
-//
-// Paolo Molaro
-//
-// (C) 2002 Ximian, Inc.
-
-namespace System
-{
- public delegate void UnhandledExceptionEventHandler (object sender, UnhandledExceptionEventArgs args);
-}
diff --git a/mcs/class/corlib/System/ValueType.cs b/mcs/class/corlib/System/ValueType.cs
deleted file mode 100644
index 733491f38b0..00000000000
--- a/mcs/class/corlib/System/ValueType.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// System.ValueType.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Runtime.CompilerServices;
-
-namespace System {
-
- [Serializable]
- public abstract class ValueType {
-
- // <summary>
- // ValueType constructor
- // </summary>
- protected ValueType ()
- {
- }
-
- // <summary>
- // True if this instance and o represent the same type
- // and have the same value.
- // </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override bool Equals (object o);
-
- // <summary>
- // Gets a hashcode for this value type using the
- // bits in the structure
- // </summary>
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- public extern override int GetHashCode ();
-
- // <summary>
- // Stringified representation of this ValueType.
- // Must be overriden for better results, by default
- // it just returns the Type name.
- // </summary>
- public override string ToString ()
- {
- return GetType().FullName;
- }
- }
-}
diff --git a/mcs/class/corlib/System/Version.cs b/mcs/class/corlib/System/Version.cs
deleted file mode 100644
index 616e7d5d030..00000000000
--- a/mcs/class/corlib/System/Version.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-//
-// System.Version.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System.Globalization;
-
-namespace System {
-
- [Serializable]
- public sealed class Version : ICloneable, IComparable {
-
- int major, minor, build, revision;
-
- private const int UNDEFINED = -1;
-
- private void CheckedSet (int defined, int major, int minor, int build, int revision)
- {
- // defined should be 2, 3 or 4
-
- if (major < 0) {
- throw new ArgumentOutOfRangeException ("major");
- }
- this.major = major;
-
- if (minor < 0) {
- throw new ArgumentOutOfRangeException ("minor");
- }
- this.minor = minor;
-
- if (defined == 2) {
- this.build = UNDEFINED;
- this.revision = UNDEFINED;
- return;
- }
-
- if (build < 0) {
- throw new ArgumentOutOfRangeException ("build");
- }
- this.build = build;
-
- if (defined == 3) {
- this.revision = UNDEFINED;
- return;
- }
-
- if (revision < 0) {
- throw new ArgumentOutOfRangeException ("revision");
- }
- this.revision = revision;
- }
-
- public Version ()
- {
- CheckedSet (2, 0, 0, -1, -1);
- }
-
- public Version (string version)
- {
- int n;
- string [] vals;
- int major = -1, minor = -1, build = -1, revision = -1;
-
- if (version == null) {
- throw new ArgumentNullException ("version");
- }
-
- vals = version.Split (new Char [] {'.'});
- n = vals.Length;
-
- if (n < 2 || n > 4) {
- throw new ArgumentException (Locale.GetText ("There must be 2, 3 or 4 components in the version string"));
- }
-
- if (n > 0)
- major = int.Parse (vals [0]);
- if (n > 1)
- minor = int.Parse (vals [1]);
- if (n > 2)
- build = int.Parse (vals [2]);
- if (n > 3)
- revision = int.Parse (vals [3]);
-
- CheckedSet (n, major, minor, build, revision);
- }
-
- public Version (int major, int minor)
- {
- CheckedSet (2, major, minor, 0, 0);
- }
-
- public Version (int major, int minor, int build)
- {
- CheckedSet (3, major, minor, build, 0);
- }
-
- public Version (int major, int minor, int build, int revision)
- {
- CheckedSet (4, major, minor, build, revision);
- }
-
- public int Build {
- get {
- return build;
- }
- }
-
- public int Major {
- get {
- return major;
- }
- }
-
- public int Minor {
- get {
- return minor;
- }
- }
-
- public int Revision {
- get {
- return revision;
- }
- }
-
- public object Clone ()
- {
- return new Version (major, minor, build, revision);
- }
-
- public int CompareTo (object version)
- {
- Version v;
-
- // LAMESPEC: Docs are unclear whether an
- // ArgumentNullException should be thrown are
- // that a value > 0 should be returned.
- if (version == null)
- return 1;
- // throw new ArgumentNullException ("version");
-
- if (! (version is Version))
- throw new ArgumentException (Locale.GetText ("Argument to Version.CompareTo must be a Version"));
-
- v = version as Version;
-
- if (this.major > v.major)
- return 1;
- else if (this.major < v.major)
- return -1;
-
- if (this.minor > v.minor)
- return 1;
- else if (this.minor < v.minor)
- return -1;
-
- if (this.build > v.build)
- return 1;
- else if (this.build < v.build)
- return -1;
-
- if (this.revision > v.revision)
- return 1;
- else if (this.revision < v.revision)
- return -1;
-
- return 0;
- }
-
- public override bool Equals (object obj)
- {
- Version x;
-
- if (obj == null || !(obj is Version))
- return false;
-
- x = (Version) obj;
-
- if ((x.major == major) &&
- (x.minor == minor) &&
- (x.build == build) &&
- (x.revision == revision))
- return true;
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (revision << 24) | (build << 16) | (minor << 8) | major;
- }
-
- // <summary>
- // Returns a stringified representation of the version, format:
- // major.minor[.build[.revision]]
- // </summary>
- public override string ToString ()
- {
- string mm = major.ToString () + "." + minor.ToString ();
-
- if (build != UNDEFINED)
- mm = mm + "." + build.ToString ();
- if (revision != UNDEFINED)
- mm = mm + "." + revision.ToString ();
-
- return mm;
- }
-
- // <summary>
- // LAME: This API is lame, since there is no way of knowing
- // how many fields a Version object has, it is unfair to throw
- // an ArgumentException, but this is what the spec claims.
- //
- // ie, Version a = new Version (1, 2); a.ToString (3) should
- // throw the expcetion.
- // </summary>
- public string ToString (int fields)
- {
- if (fields == 0)
- return "";
- if (fields == 1)
- return major.ToString ();
- if (fields == 2)
- return major.ToString () + "." + minor.ToString ();
- if (fields == 3){
- if (build == UNDEFINED)
- throw new ArgumentException (Locale.GetText ("fields is larger than the number of components defined in this instance"));
- return major.ToString () + "." + minor.ToString () + "." +
- build.ToString ();
- }
- if (fields == 4){
- if (build == UNDEFINED || revision == UNDEFINED)
- throw new ArgumentException (Locale.GetText ("fields is larger than the number of components defined in this instance"));
- return major.ToString () + "." + minor.ToString () + "." +
- build.ToString () + "." + revision.ToString ();
- }
- throw new ArgumentException (Locale.GetText ("Invalid fields parameter: ") + fields.ToString());
- }
-
- public static bool operator== (Version v1, Version v2)
- {
- return v1.Equals (v2);
- }
-
- public static bool operator!= (Version v1, Version v2)
- {
- return !v1.Equals (v2);
- }
-
- public static bool operator> (Version v1, Version v2)
- {
- return v1.CompareTo (v2) > 0;
- }
-
- public static bool operator>= (Version v1, Version v2)
- {
- return v1.CompareTo (v2) >= 0;
- }
-
- public static bool operator< (Version v1, Version v2)
- {
- return v1.CompareTo (v2) < 0;
- }
-
- public static bool operator<= (Version v1, Version v2)
- {
- return v1.CompareTo (v2) <= 0;
- }
-
- }
-}
-
-
-
diff --git a/mcs/class/corlib/System/Void.cs b/mcs/class/corlib/System/Void.cs
deleted file mode 100644
index 768d75e7141..00000000000
--- a/mcs/class/corlib/System/Void.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// System.Void.cs
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-namespace System {
-
- [Serializable]
- public struct Void {
- }
-}
diff --git a/mcs/class/corlib/System/WeakReference.cs b/mcs/class/corlib/System/WeakReference.cs
deleted file mode 100755
index 12541ac7c6f..00000000000
--- a/mcs/class/corlib/System/WeakReference.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// System.WeakReference.cs
-//
-// Author:
-// Ajay kumar Dwivedi (adwiv@yahoo.com)
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System
-{
- /// <summary>
- /// Summary description for WeakReference.
- /// </summary>
- [Serializable]
- public class WeakReference : ISerializable
- {
- //Fields
- private bool isLongReference;
- private GCHandle gcHandle;
-
- // Helper method for constructors
- //Should not be called from any other method.
- private void AllocateHandle(Object target)
- {
- if(this.isLongReference)
- {
- this.gcHandle = GCHandle.Alloc(target, GCHandleType.WeakTrackResurrection);
- }
- else
- {
- this.gcHandle = GCHandle.Alloc(target, GCHandleType.Weak);
- }
- }
-
-
- //Constructors
- public WeakReference(object target)
- : this(target,false)
- {}
-
-
- public WeakReference(object target, bool trackResurrection)
- {
- this.isLongReference = trackResurrection;
- AllocateHandle(target);
- }
-
-
- protected WeakReference(SerializationInfo info, StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- this.isLongReference = info.GetBoolean("IsLongReference");
- //TODO: How to load the exact type?
- //Does that matter? No idea :(
- Object target = info.GetValue("TargetObject",typeof(System.Object));
-
- AllocateHandle(target);
- }
-
-
- // Properties
- public virtual bool IsAlive
- {
- get
- {
- //Target property takes care of the exception
- return (Target != null);
- }
- }
-
- public virtual object Target
- {
- get
- {
- //Exception is thrown by gcHandle's Target
- return this.gcHandle.Target;
- }
- set
- {
- this.gcHandle.Target = value;
- }
- }
-
- public virtual bool TrackResurrection
- {
- get
- {
- return this.isLongReference;
- }
- }
-
- //Methods
- ~WeakReference()
- {
- gcHandle.Free();
- }
-
- //TODO
- public virtual void GetObjectData(SerializationInfo info,StreamingContext context)
- {
- if (info == null)
- throw new ArgumentNullException ("info");
-
- info.AddValue("IsLongReference",this.isLongReference);
- try
- {
- info.AddValue("TargetObject",Target);
- }
- catch(Exception)
- {
- info.AddValue("TargetObject",null);
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/class/corlib/System/_AppDomain.cs b/mcs/class/corlib/System/_AppDomain.cs
deleted file mode 100755
index 08ef787b2ea..00000000000
--- a/mcs/class/corlib/System/_AppDomain.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-//
-// System._AppDomain
-//
-// Author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-
-using System.Security;
-using System.Security.Policy;
-using System.Security.Principal;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Globalization;
-using System.Runtime.Remoting;
-
-namespace System
-{
-
-[CLSCompliant(false)]
-public interface _AppDomain {
-
- string BaseDirectory {get; }
- string DynamicDirectory {get; }
- Evidence Evidence {get; }
- string FriendlyName {get; }
- string RelativeSearchPath {get; }
- bool ShadowCopyFiles {get; }
-
- void AppendPrivatePath (string path);
- void ClearPrivatePath ();
- void ClearShadowCopyPath ();
-
- ObjectHandle CreateInstance (string assemblyName, string typeName);
- ObjectHandle CreateInstance (
- string assemblyName,
- string typeName,
- object[] activationAttributes);
- ObjectHandle CreateInstance (
- string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes);
-
- ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
- ObjectHandle CreateInstanceFrom (
- string assemblyName, string typeName,
- object[] activationAttributes);
- ObjectHandle CreateInstanceFrom (string assemblyName,
- string typeName,
- bool ignoreCase,
- BindingFlags bindingAttr,
- Binder binder,
- object[] args,
- CultureInfo culture,
- object[] activationAttributes,
- Evidence securityAttribtutes);
-
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access, string dir);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions);
- AssemblyBuilder DefineDynamicAssembly (
- AssemblyName name,
- AssemblyBuilderAccess access,
- string dir,
- Evidence evidence,
- PermissionSet requiredPermissions,
- PermissionSet optionalPermissions,
- PermissionSet refusedPersmissions,
- bool isSynchronized);
-
- void DoCallBack (CrossAppDomainDelegate theDelegate);
- bool Equals (object other);
-
- int ExecuteAssembly (string assemblyFile);
- int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
- int ExecuteAssembly (
- string assemblyFile,
- Evidence assemblySecurity,
- string[] args);
-
- Assembly[] GetAssemblies ();
- object GetData (string name);
- int GetHashCode();
- object GetLifetimeService ();
- Type GetType ();
- object InitializeLifetimeService ();
-
- Assembly Load (AssemblyName assemblyRef);
- Assembly Load (byte[] rawAssembly);
- Assembly Load (string assemblyString);
- Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
- Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
- Assembly Load (string assemblyString, Evidence assemblySecurity);
- Assembly Load (
- byte[] rawAssembly,
- byte[] rawSymbolStore,
- Evidence securityEvidence);
-
- void SetAppDomainPolicy (PolicyLevel domainPolicy);
- void SetCachePath (string s);
- void SetData (string name, object data);
- void SetPrincipalPolicy (PrincipalPolicy policy);
- void SetShadowCopyPath (string s);
- void SetThreadPrincipal (IPrincipal principal);
- //string ToString ();
-
- event AssemblyLoadEventHandler AssemblyLoad;
- event ResolveEventHandler AssemblyResolve;
- event EventHandler DomainUnload;
- event EventHandler ProcessExit;
- event ResolveEventHandler ResourceResolve;
- event ResolveEventHandler TypeResolve;
- event UnhandledExceptionEventHandler UnhandledException;
-}
-
-}
diff --git a/mcs/class/corlib/Test/.cvsignore b/mcs/class/corlib/Test/.cvsignore
deleted file mode 100644
index 335c71fd7fa..00000000000
--- a/mcs/class/corlib/Test/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.dll
-*.pdb
diff --git a/mcs/class/corlib/Test/AllTests.cs b/mcs/class/corlib/Test/AllTests.cs
deleted file mode 100644
index e7a49c01fef..00000000000
--- a/mcs/class/corlib/Test/AllTests.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Mono.Tests.AllTests.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(System.AllTests.Suite);
- suite.AddTest(System.Collections.AllTests.Suite);
- suite.AddTest(System.Security.AllTests.Suite);
- suite.AddTest(System.Security.Cryptography.AllTests.Suite);
- suite.AddTest(System.IO.AllTests.Suite);
- suite.AddTest(System.Text.AllTests.Suite);
- suite.AddTest(System.Security.Permissions.AllTests.Suite);
- suite.AddTest(System.Resources.AllTests.Suite);
- suite.AddTest(System.Runtime.Serialization.AllTests.Suite);
-// suite.AddTest(System.Security.Policy.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/ChangeLog b/mcs/class/corlib/Test/ChangeLog
deleted file mode 100644
index 7938051d613..00000000000
--- a/mcs/class/corlib/Test/ChangeLog
+++ /dev/null
@@ -1,216 +0,0 @@
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add missing test: System.Runtime.Serialization.
-
-2002-06-01 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Change the order of the builds. Just makes it a
- bit faster for my testing since I need the linux dll.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * Added System.Security.Cryptography.FromBase64TransformTest.cs.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * TheTests.cs: Removed.
-
- * MartinTests.cs: Removed.
-
- * corlib_test.build: Don't create Runtest.corlib.exe anymore.
-
-2002/05/07 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Do not run the System.Net tests from here, they belong
- in the System assembly tests.
-
-2002-04-27 Lawrence Pit <loz@cable.a2000.nl>
-
- * System.Security/: added directory
- * AllTests.cs: added Syste,Security suite.
-
-2002-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * System.Net/: added directory.
- * AllTests.cs: added System.Net suite.
-
-2002/04/04 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Again; disable running of NUnit tests against mono
- corlib. There are so many icalls now, that these tests need
- to be run inside mint and mono. Will change this soon to run
- the tests using both. It still runs the tests against the mscorlib
- to validate the tests themselves.
-
-2002-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * corlib_test.build: don't exclude IntegerFormatterTest.
-
- * System/AllTests.cs: added IntegerFormatterTest suite.
-
- * System/IntegerFormatterTest.cs: totally reworked to use NUnit. Right
- now it fails cause I haven't implemented Parse () methods yet. With
- corlib_reference.dll runs ok.
-
-2002/03/28 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Re-exclude it in a couple of places where it was
- breaking the build. This test is not an NUnit test. So, it doesn't
- belong in these dll's until it's made a proper NUnit test.
-
-2002-03-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * corlib_test.build: remove two more lines that excluded
- IntegerFormatterTest.
-
-2002/03/28 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Don't exclude IntegerFormatterTest any more.
-
-2002-03-20 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: On 'clean' remove all the dll's and pdb's
-
-2002/03/19 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Re-include tests into the build.
-
-2002-03-18 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: build RunTests.corlib.exe with only mono class
- libs. This tells what we are missing to run the tests.
-
-2002/03/18 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: disable running of NUnit tests against mono
- corlib. There are so many icalls now, that these tests need
- to be run inside mint and mono. Will change this soon to run
- the tests using both. It still runs the tests against the mscorlib
- to validate the tests themselves.
-
-2002/03/07 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: resolve chicken and egg problem. Only build and
- execute test assemblies when 'make test' is specified. Need to do a
- 'make' first now before 'make test'.
-
-2002-03-03 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Turn on debug flag for complier so that...well...
- debugging is easier.
-
-2002-03-01 Duncan Mak <duncan@ximian.com>
-
- * System.Runtime.Serialization/ObjectIDGeneratorTests.cs: Added
- test for System.Runtime.Serialization.ObjectIDGenerator.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- * RunTests.cs: Removed. This is now in the nant directory.
-
- * corlib_test.build: Don't link TheTests.cs into the dlls, renamed
- RunTests.exe to RunTests.corlib.exe and link it against NUnitBase.dll.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- * scan-tests.pl: Moved to ../../../tools/.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: New file. This contains all the tests which already
- work on Linux.
-
- * RunTests.cs: A small custom testrunner to run the tests on Linux.
-
- * scan-tests.pl: Call this perl script with either MartinTests.cs or
- AllTests.cs as argument and redirect the output the TheTests.cs - it'll
- create a file which calls all the tests.
-
- * TheTests.cs: This is automatically generated from scan-tests.pl but
- needs some manual editing, so it's in CVS.
-
- * corlib_test.build: In addition to the libraries, create an executable
- called RunTests.exe which contains all the tests and the custom test
- runner. You can run this executable on Windows to test things with
- mscorlib or on Linux using the mono runtime.
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * */*.cs: added zero-args constructors for all the test classes.
-
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * System.Security.Cryptography.RNGCryptoServiceProviderTest.cs:
- Fixed typo
-
-2002-02-21 Mark Crichton <crichton@gimp.org>
-
- * Addded System.Security.Cryptography.RNGCryptoServiceProviderTest.cs
- * System.Security.Cryptography/AllTests.cs: Added
- RNGCryptoServiceProviderTest.
-
-2002-02-17 Duco Fijma <duco@lorentz.xs4all.nl>
- * Added System/GuidTest.cs
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Remove duplicate excludes for
- * AllTests.cs: Add System.Security.Policy tests. However, commented
- this out because NUnit is throwing an exception. Need to figure
- that out first.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: compile with mscorlib to test the tests. This
- will be our "reference" check to make sure the tests work.
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add System.Resources.AllTests.Suite
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add System.Security.Permissions.AllTests.Suite
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * .cvsignore: ignore the debug files *.pdb
-
-2002-01-04 Duco Fijma <duco@lorentz.xs4all.nl>
- * Added System/TimeSpanTest.cs
-
-2002-01-04 John R. Hicks <angryjohn69@nc.rr.com>
- * Added DebugTest to System.Diagnostics tests.
-2001-11-08 Nick Drochak <ndrochak@gol.com>
-
- * corlib_test.build: Include test for Queue in the dll
-
-2001-10-15 Martin Weindel <martin.weindel@t-online.de>
-
- * added System/DecimalTest.cs and System/DecimalTest2.cs
-
-2001-10-11 Jeffrey Stedfast <fejj@ximian.com>
-
- * System/StringTest.cs: Added.
-
-2001-10-10 Thomas Neidhart <tome@sbox.tugraz.at>
-
- * added directory System.Security.Cryptography
- * added TestSuite for all Crypto classes
- * added tests for System.Security.Cryptography.AsymmetricAlgorithm
- and System.Security.Cryptography.SymmetricAlgorithm
-
-2001-10-02 Martin Weindel <martin.weindel@t-online.de>
-
- * added directory System
- * added tests for System.Int64
-
-2001-08-29 Alexander Klyubin <klyubin@aqris.com>
-
- * Added tests for System.Diagnostics.StackFrame and
- System.Diagnostics.StackTrace. The tests only run against
- Microsoft's implementation as StackTrace and StackFrame classes in
- Mono are not yet properly implemented.
-
- Note that StackFrameTest runs properly only if compiled with
- /debug switch.
diff --git a/mcs/class/corlib/Test/System.Collections/AllTests.cs b/mcs/class/corlib/Test/System.Collections/AllTests.cs
deleted file mode 100644
index 70f735c6b7d..00000000000
--- a/mcs/class/corlib/Test/System.Collections/AllTests.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(ArrayListTest.Suite);
- suite.AddTest(BitArrayTest.Suite);
- suite.AddTest(CaseInsensitiveComparerTest.Suite);
- suite.AddTest(CaseInsensitiveHashCodeProviderTest.Suite);
- suite.AddTest(CollectionBaseTest.Suite);
- suite.AddTest(ComparerTest.Suite);
- suite.AddTest(HashtableTest.Suite);
- suite.AddTest(QueueTest.Suite);
- suite.AddTest(ReadOnlyCollectionBaseTest.Suite);
- suite.AddTest(SortedListTest.Suite);
- suite.AddTest(StackTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs b/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs
deleted file mode 100644
index 49be77b17a8..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ArrayListTest.cs
+++ /dev/null
@@ -1,1451 +0,0 @@
-// ArrayListTest.cs - NUnit Test Cases for the System.Collections.ArrayList class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>ArrayList test.</summary>
-public class ArrayListTest : TestCase {
- public ArrayListTest() : base ("MonoTests.System.ArrayListTest testsuite") {}
- public ArrayListTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ArrayListTest));
- }
- }
-
- public void TestCtor() {
- {
- ArrayList al1 = new ArrayList();
- AssertNotNull("no basic ArrayList", al1);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null icollection error not thrown",
- errorThrown);
- }
- {
- // what can I say? I like chars. [--DB]
- char[] coll = {'a', 'b', 'c', 'd'};
- ArrayList al1 = new ArrayList(coll);
- AssertNotNull("no icollection ArrayList", al1);
- for (int i = 0; i < coll.Length; i++) {
- AssertEquals(i + " not ctor'ed properly.",
- coll[i], al1[i]);
- }
- }
- {
- try {
- Char[,] c1 = new Char[2,2];
- ArrayList al1 = new ArrayList(c1);
- Fail ("Should fail with multi-dimensional array in constructor.");
- } catch (RankException) {
- }
- }
-
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative capacity error not thrown",
- errorThrown);
- }
- }
-
- public void TestCapacity() {
- for (int i = 1; i < 100; i++) {
- ArrayList al1 = new ArrayList(i);
- AssertEquals("Bad capacity of " + i,
- i, al1.Capacity);
- }
- {
- ArrayList al1 = new ArrayList(0);
- // LAMESPEC:
- // AssertEquals("Bad capacity when set to 0",
- // 16, al1.Capacity);
- al1.Add ("?");
- AssertEquals("Bad capacity when set to 0",
- 16, al1.Capacity);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("Bad default capacity",
- 16, al1.Capacity);
- }
- }
-
- public void TestCount() {
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("Bad initial count",
- 0, al1.Count);
- for (int i = 1; i <= 100; i++) {
- al1.Add(i);
- AssertEquals("Bad count " + i,
- i, al1.Count);
- }
- }
- for (int i = 0; i < 100; i++) {
- char[] coll = new Char[i];
- ArrayList al1 = new ArrayList(coll);
- AssertEquals("Bad count for " + i,
- i, al1.Count);
- }
- }
-
- public void TestIsFixed() {
- ArrayList al1 = new ArrayList();
- Assert("should not be fixed by default", !al1.IsFixedSize);
- ArrayList al2 = ArrayList.FixedSize(al1);
- Assert("fixed-size wrapper not working", al2.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- ArrayList al1 = new ArrayList();
- Assert("should not be ReadOnly by default", !al1.IsReadOnly);
- ArrayList al2 = ArrayList.ReadOnly(al1);
- Assert("read-only wrapper not working", al2.IsReadOnly);
- }
-
- public void TestIsSynchronized() {
- ArrayList al1 = new ArrayList();
- Assert("should not be synchronized by default",
- !al1.IsSynchronized);
- ArrayList al2 = ArrayList.Synchronized(al1);
- Assert("synchronized wrapper not working", al2.IsSynchronized);
- }
-
- public void TestItem() {
- ArrayList al1 = new ArrayList();
- {
- bool errorThrown = false;
- try {
- object o = al1[-1];
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative item error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- object o = al1[1];
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end item error not thrown",
- errorThrown);
- }
- for (int i = 0; i <= 100; i++) {
- al1.Add(i);
- }
- for (int i = 0; i <= 100; i++) {
- AssertEquals("item not fetched for " + i,
- i, al1[i]);
- }
- }
-
- public void TestAdapter() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.Adapter(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("null adapter error not thrown",
- errorThrown);
- }
- {
- char[] list = {'a', 'b', 'c', 'd'};
- ArrayList al1 = ArrayList.Adapter(list);
- AssertNotNull("Couldn't get an adapter", al1);
- for (int i = 0; i < list.Length; i++) {
- AssertEquals("adapter not adapting", list[i], al1[i]);
- }
- list[0] = 'z';
- for (int i = 0; i < list.Length; i++) {
- AssertEquals("adapter not adapting", list[i], al1[i]);
- }
- }
- // TODO - test other adapter types?
- }
-
- public void TestAdd() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Add("Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Add("Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- for (int i = 1; i <= 100; i++) {
- al1.Add(i);
- AssertEquals("add failed " + i,
- i, al1.Count);
- AssertEquals("add failed " + i,
- i, al1[i-1]);
-
- }
- }
- {
- string [] strArray = new string [] {};
- ArrayList al1 = new ArrayList (strArray);
- al1.Add ("Hi!");
- al1.Add ("Hi!");
- AssertEquals ("add failed", 2, al1.Count);
- }
- }
-
- public void TestAddRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- String[] s1 = {"Hi!"};
- al1.AddRange(s1);
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- String[] s1 = {"Hi!"};
- al1.AddRange(s1);
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList();
- al1.AddRange(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
-
- {
- ArrayList a1 = new ArrayList();
- AssertEquals("ArrayList should start empty",
- 0, a1.Count);
- char[] coll = {'a', 'b', 'c'};
- a1.AddRange(coll);
- AssertEquals("ArrayList has wrong elements",
- 3, a1.Count);
- a1.AddRange(coll);
- AssertEquals("ArrayList has wrong elements",
- 6, a1.Count);
- }
- }
-
- public void TestBinarySearch() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList();
- String[] s1 = {"This", "is", "a", "test"};
- al1.AddRange(s1);
- al1.BinarySearch(42);
- } catch (InvalidOperationException) {
- // this is what .NET throws
- errorThrown = true;
- } catch (ArgumentException) {
- // this is what the docs say it should throw
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("search-for-wrong-type error not thrown",
- errorThrown);
- }
-
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- ArrayList al1 = new ArrayList(arr);
- Assert("couldn't find elem #1",
- al1.BinarySearch('c') >= 3);
- Assert("couldn't find elem #2",
- al1.BinarySearch('c') < 6);
- }
- {
- char[] arr = {'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- ArrayList al1 = new ArrayList(arr);
- AssertEquals("couldn't find next-higher elem",
- -4, al1.BinarySearch('c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- ArrayList al1 = new ArrayList(arr);
- AssertEquals("couldn't find end",
- -9, al1.BinarySearch('e'));
- }
-
- }
-
- // TODO - BinarySearch with IComparer
-
- public void TestClear() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Clear();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Clear();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("add to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- al1.Add('c');
- AssertEquals("should have one element",
- 1, al1.Count);
- al1.Clear();
- AssertEquals("should be empty",
- 0, al1.Count);
- }
- {
- int[] i1 = {1,2,3,4};
- ArrayList al1 = new ArrayList(i1);
- AssertEquals("should have elements",
- i1.Length, al1.Count);
- int capacity = al1.Capacity;
- al1.Clear();
- AssertEquals("should be empty again",
- 0, al1.Count);
- AssertEquals("capacity shouldn't have changed",
- capacity, al1.Capacity);
- }
- }
-
- public void TestClone() {
- {
- char[] c1 = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(c1);
- ArrayList al2 = (ArrayList)al1.Clone();
- AssertEquals("ArrayList match", al1[0], al2[0]);
- AssertEquals("ArrayList match", al1[1], al2[1]);
- AssertEquals("ArrayList match", al1[2], al2[2]);
- }
- {
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- char[][] d1 = {d10, d11, d12};
- ArrayList al1 = new ArrayList(d1);
- ArrayList al2 = (ArrayList)al1.Clone();
- AssertEquals("Array match", al1[0], al2[0]);
- AssertEquals("Array match", al1[1], al2[1]);
- AssertEquals("Array match", al1[2], al2[2]);
-
- ((char[])al1[0])[0] = 'z';
- AssertEquals("shallow copy", al1[0], al2[0]);
- }
- }
-
- public void TestContains() {
- char[] c1 = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(c1);
- Assert("never find a null", !al1.Contains(null));
- Assert("can't find value", al1.Contains('b'));
- Assert("shouldn't find value", !al1.Contains('?'));
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- al1.CopyTo(null, 2);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("error not thrown 1", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[,] c2 = new Char[2,2];
- al1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("error not thrown 2", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- // This appears to be a bug in the ArrayList Constructor.
- // It throws a RankException if a multidimensional Array
- // is passed. The docs imply that an IEnumerator is used
- // to retrieve the items from the collection, so this should
- // work. In anycase this test is for CopyTo, so use what
- // works on both platforms.
- //Char[,] c1 = new Char[2,2];
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("error not thrown 3", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("error not thrown 4", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("error not thrown 5", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 6: " + e.ToString());
- }
- Assert("error not thrown 6", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String[] c1 = {"String", "array"};
- ArrayList al1 = new ArrayList(c1);
- Char[] c2 = new Char[2];
- al1.CopyTo(c2, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 7: " + e.ToString());
- }
- Assert("error not thrown 7", errorThrown);
- }
-
- Char[] orig = {'a', 'b', 'c', 'd'};
- ArrayList al = new ArrayList(orig);
- Char[] copy = new Char[10];
- Array.Clear(copy, 0, copy.Length);
- al.CopyTo(copy, 3);
- AssertEquals("Wrong CopyTo 0", (char)0, copy[0]);
- AssertEquals("Wrong CopyTo 1", (char)0, copy[1]);
- AssertEquals("Wrong CopyTo 2", (char)0, copy[2]);
- AssertEquals("Wrong CopyTo 3", orig[0], copy[3]);
- AssertEquals("Wrong CopyTo 4", orig[1], copy[4]);
- AssertEquals("Wrong CopyTo 5", orig[2], copy[5]);
- AssertEquals("Wrong CopyTo 6", orig[3], copy[6]);
- AssertEquals("Wrong CopyTo 7", (char)0, copy[7]);
- AssertEquals("Wrong CopyTo 8", (char)0, copy[8]);
- AssertEquals("Wrong CopyTo 9", (char)0, copy[9]);
- }
-
- public void TestFixedSize() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.FixedSize(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error not thrown", errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arrays start un-fixed.",
- false, al1.IsFixedSize);
- ArrayList al2 = ArrayList.FixedSize(al1);
- AssertEquals("should be fixed.",
- true, al2.IsFixedSize);
- }
- }
-
- public void TestGetEnumerator() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- IEnumerator en = a.GetEnumerator(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("out-of-range index error not thrown",
- errorThrown);
- }
- {
- String[] s1 = {"this", "is", "a", "test"};
- ArrayList al1 = new ArrayList(s1);
- IEnumerator en = al1.GetEnumerator();
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- AssertEquals("Not enumerating",
- al1[i], en.Current);
- }
- }
- {
- String[] s1 = {"this", "is", "a", "test"};
- ArrayList al1 = new ArrayList(s1);
- IEnumerator en = al1.GetEnumerator(1,2);
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < 2; i++) {
- en.MoveNext();
- AssertEquals("Not enumerating",
- al1[i+1], en.Current);
- }
- }
- }
-
- public void TestGetRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList();
- ArrayList b = a.GetRange(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("out-of-range index error not thrown",
- errorThrown);
- }
- {
- char[] chars = {'a', 'b', 'c', 'd', 'e', 'f'};
- ArrayList a = new ArrayList(chars);
- ArrayList b = a.GetRange(1, 3);
- AssertEquals("GetRange returned wrong size ArrayList", 3, b.Count);
- for (int i = 0; i < b.Count; i++) {
- AssertEquals("range didn't work",
- chars[i+1], b[i]);
- }
-
- a[2] = '?'; // should screw up ArrayList b.
- bool errorThrown = false;
- try {
- int i = b.Count;
- } catch (InvalidOperationException) {
- errorThrown = true;
- }
- AssertEquals("Munging 'a' should mess up 'b'",
- true, errorThrown);
- }
- }
-
- public void TestIndexOf() {
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.IndexOf('a', 0, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(2);
- int i = a.IndexOf('a', 1, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end indexof error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList a = new ArrayList(c);
- AssertEquals("never find null",
- -1, a.IndexOf(null));
- AssertEquals("never find null",
- -1, a.IndexOf(null, 0));
- AssertEquals("never find null",
- -1, a.IndexOf(null, 0, 5));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c'));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c', 2));
- AssertEquals("can't find elem",
- 2, a.IndexOf('c', 2, 2));
- AssertEquals("shouldn't find elem",
- -1, a.IndexOf('c', 3, 2));
- AssertEquals("shouldn't find", -1, a.IndexOf('?'));
- AssertEquals("shouldn't find", -1, a.IndexOf(3));
- }
- }
-
- public void TestInsert() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- al1.Insert(0, "Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Insert(0, "Hi!");
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.Insert(-1, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.Insert(4, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arraylist starts empty", 0, al1.Count);
- al1.Insert(0, 'a');
- al1.Insert(1, 'b');
- al1.Insert(0, 'c');
- AssertEquals("arraylist needs stuff", 3, al1.Count);
- AssertEquals("arraylist got stuff", 'c', al1[0]);
- AssertEquals("arraylist got stuff", 'a', al1[1]);
- AssertEquals("arraylist got stuff", 'b', al1[2]);
- }
- }
-
- public void TestInsertRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList());
- string[] s = {"Hi!"};
- al1.InsertRange(0, s);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- string[] s = {"Hi!"};
- al1.InsertRange(0, s);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("insert to read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- string[] s = {"Hi!"};
- al1.InsertRange(-1, s);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("negative index insert error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- string[] s = {"Hi!"};
- al1.InsertRange(4, s);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out-of-range insert error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.InsertRange(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null insert error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c'};
- ArrayList a = new ArrayList(c);
- a.InsertRange(1, c);
- AssertEquals("bad insert 1", 'a', a[0]);
- AssertEquals("bad insert 2", 'a', a[1]);
- AssertEquals("bad insert 3", 'b', a[2]);
- AssertEquals("bad insert 4", 'c', a[3]);
- AssertEquals("bad insert 5", 'b', a[4]);
- AssertEquals("bad insert 6", 'c', a[5]);
- }
- }
-
- public void TestLastIndexOf() {
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', -1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("first negative lastindexof error not thrown",
- //errorThrown);
- //}
- {
- bool errorThrown = false;
- try {
- ArrayList a = new ArrayList(1);
- int i = a.LastIndexOf('a', 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("past-end lastindexof error not thrown",
- errorThrown);
- }
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', 0, -1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("second negative lastindexof error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(1);
- //int i = a.LastIndexOf('a', 0, 2);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("past-end lastindexof error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //ArrayList a = new ArrayList(2);
- //int i = a.LastIndexOf('a', 0, 2);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("past-end lastindexof error not thrown",
- //errorThrown);
- //}
- int iTest = 0;
- try {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList a = new ArrayList(c);
- AssertEquals("never find null",
- -1, a.LastIndexOf(null));
- iTest++;
- AssertEquals("never find null",
- -1, a.LastIndexOf(null, 4));
- iTest++;
- AssertEquals("never find null",
- -1, a.LastIndexOf(null, 4, 5));
- iTest++;
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c'));
- iTest++;
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c', 4));
- iTest++;
- AssertEquals("can't find elem",
- 2, a.LastIndexOf('c', 3, 2));
- iTest++;
- AssertEquals("shouldn't find elem",
- -1, a.LastIndexOf('c', 4, 2));
- iTest++;
- AssertEquals("shouldn't find", -1, a.LastIndexOf('?'));
- iTest++;
- AssertEquals("shouldn't find", -1, a.LastIndexOf(1));
- } catch (Exception e) {
- Fail ("Unexpected exception caught when iTest=" + iTest + ". e=" + e);
- }
- }
-
- public void TestReadOnly() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.ReadOnly(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error not thrown", errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- AssertEquals("arrays start writeable.",
- false, al1.IsReadOnly);
- ArrayList al2 = ArrayList.ReadOnly(al1);
- AssertEquals("should be readonly.",
- true, al2.IsReadOnly);
- }
- }
-
- public void TestRemove() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.Remove(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.Remove(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove read only error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.Remove(1);
- a.Remove('?');
- AssertEquals("should be unchanged", c.Length, a.Count);
- a.Remove('a');
- AssertEquals("should be changed", 2, a.Count);
- AssertEquals("should have shifted", 'b', a[0]);
- AssertEquals("should have shifted", 'c', a[1]);
- }
- }
-
- public void TestRemoveAt() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.RemoveAt(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove from fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.RemoveAt(1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("remove from read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveAt(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("remove at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveAt(4);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("remove at out-of-range index error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.RemoveAt(0);
- AssertEquals("should be changed", 2, a.Count);
- AssertEquals("should have shifted", 'b', a[0]);
- AssertEquals("should have shifted", 'c', a[1]);
- }
- }
-
- public void TestRemoveRange() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.FixedSize(new ArrayList(3));
- al1.RemoveRange(0, 1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("removerange from fixed size error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.RemoveRange(0, 1);
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("removerange from read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("removerange at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("removerange at negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.RemoveRange(2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("removerange at bad range error not thrown",
- errorThrown);
- }
- {
- char[] c = {'a','b','c'};
- ArrayList a = new ArrayList(c);
- a.RemoveRange(1,2);
- AssertEquals("should be changed", 1, a.Count);
- AssertEquals("should have shifted", 'a', a[0]);
- }
- }
-
- public void TestRepeat() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = ArrayList.Repeat('c', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("repeat negative copies error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = ArrayList.Repeat("huh?", 0);
- AssertEquals("should be nothing in array",
- 0, al1.Count);
- }
- {
- ArrayList al1 = ArrayList.Repeat("huh?", 3);
- AssertEquals("should be something in array",
- 3, al1.Count);
- AssertEquals("array elem doesn't check",
- "huh?", al1[0]);
- AssertEquals("array elem doesn't check",
- "huh?", al1[1]);
- AssertEquals("array elem doesn't check",
- "huh?", al1[2]);
- }
- }
-
- public void TestReverse() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Reverse();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("reverse on read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(0, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(3, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- }
- {
- char[] c = {'a', 'b', 'c', 'd', 'e'};
- ArrayList al1 = new ArrayList(c);
- al1.Reverse(2,1);
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be no change yet",
- c[i], al1[i]);
- }
- al1.Reverse();
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be reversed",
- c[i], al1[4-i]);
- }
- al1.Reverse();
- for (int i = 0; i < al1.Count; i++) {
- AssertEquals("Should be back to normal",
- c[i], al1[i]);
- }
- al1.Reverse(1,3);
- AssertEquals("Should be back to normal", c[0], al1[0]);
- AssertEquals("Should be back to normal", c[3], al1[1]);
- AssertEquals("Should be back to normal", c[2], al1[2]);
- AssertEquals("Should be back to normal", c[1], al1[3]);
- AssertEquals("Should be back to normal", c[4], al1[4]);
- }
- }
-
- public void TestSetRange() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList(3));
- al1.SetRange(0, c);
- } catch (NotSupportedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("setrange on read only error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("setrange with null error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(-1, c);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("setrange with negative index error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = new ArrayList(3);
- al1.SetRange(2, c);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("setrange with too much error not thrown",
- errorThrown);
- }
-
- {
- char[] c = {'a', 'b', 'c'};
- ArrayList al1 = ArrayList.Repeat('?', 3);
- Assert("no match yet", c[0] != (char)al1[0]);
- Assert("no match yet", c[1] != (char)al1[1]);
- Assert("no match yet", c[2] != (char)al1[2]);
- al1.SetRange(0, c);
- AssertEquals("should match", c[0], al1[0]);
- AssertEquals("should match", c[1], al1[1]);
- AssertEquals("should match", c[2], al1[2]);
- }
- }
-
- public void TestSort() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.Sort();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("sort on read only error not thrown",
- errorThrown);
- }
- {
- char[] starter = {'d', 'b', 'f', 'e', 'a', 'c'};
- ArrayList al1 = new ArrayList(starter);
- al1.Sort();
- AssertEquals("Should be sorted", 'a', al1[0]);
- AssertEquals("Should be sorted", 'b', al1[1]);
- AssertEquals("Should be sorted", 'c', al1[2]);
- AssertEquals("Should be sorted", 'd', al1[3]);
- AssertEquals("Should be sorted", 'e', al1[4]);
- AssertEquals("Should be sorted", 'f', al1[5]);
- }
- }
-
- // TODO - Sort with IComparers
-
- // TODO - Synchronize
-
- public void TestToArray() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 = new ArrayList(3);
- al1.ToArray(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("toarray with null error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- string s = "huh?";
- ArrayList al1 = new ArrayList(c);
- al1.ToArray(s.GetType());
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("toarray with bad type error not thrown",
- errorThrown);
- }
- {
- char[] c1 = {'a', 'b', 'c', 'd', 'e'};
- ArrayList al1 = new ArrayList(c1);
- object[] o2 = al1.ToArray();
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("should be copy", c1[i], o2[i]);
- }
- Array c2 = al1.ToArray(c1[0].GetType());
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("should be copy",
- c1[i], c2.GetValue(i));
- }
- }
- }
-
- public void TestTrimToSize() {
- {
- bool errorThrown = false;
- try {
- ArrayList al1 =
- ArrayList.ReadOnly(new ArrayList());
- al1.TrimToSize();
- } catch (NotSupportedException) {
- errorThrown = true;
- }
- Assert("trim read only error not thrown",
- errorThrown);
- }
- {
- ArrayList al1 = new ArrayList();
- int capacity = al1.Capacity;
- int size = capacity / 2;
- for (int i = 1; i <=size; i++) {
- al1.Add('?');
- }
- al1.RemoveAt(0);
- al1.TrimToSize();
- AssertEquals("no capacity match",
- size - 1, al1.Capacity);
-
- al1.Clear();
- al1.TrimToSize();
- AssertEquals("no default capacity",
- capacity, al1.Capacity);
- }
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs b/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs
deleted file mode 100644
index 7d29eb44911..00000000000
--- a/mcs/class/corlib/Test/System.Collections/BitArrayTest.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-//
-// BitArrayTest.cs - NUnit Test Cases for the System.Collections.BitArray class
-//
-// Author: David Menestrina (dmenest@yahoo.com)
-//
-
-using NUnit.Framework;
-using System.Collections;
-using System;
-
-namespace MonoTests.System.Collections
-{
-
-public class BitArrayTest : TestCase
-{
- private BitArray testBa;
- private bool [] testPattern;
- private BitArray op1;
- private BitArray op2;
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(BitArrayTest));
- }
- }
-
- private void verifyPattern(BitArray ba, bool[] pattern)
- {
- AssertEquals(ba.Length, pattern.Length);
- for (int i = 0; i < pattern.Length; i++)
- AssertEquals(ba[i], pattern[i]);
- }
-
- public BitArrayTest() : base ("MonoTests.System.Collections.BitArrayTest testcase") {}
- public BitArrayTest( string name ) : base(name) { }
-
- protected override void SetUp()
- {
- testPattern = new bool[70];
-
- int i;
- for(i = 0; i < testPattern.Length/2; i++)
- testPattern[i] = ((i % 2) == 0);
- for(; i < testPattern.Length; i++)
- testPattern[i] = ((i % 2) != 0);
-
- testBa = new BitArray(70);
- for(i = 0; i < testBa.Length/2; i++)
- testBa[i] = ((i % 2) == 0);
- for(; i < testBa.Length; i++)
- testBa[i] = ((i % 2) != 0);
-
- // for TestAnd, TestOr, TestNot, TestXor
- op1 = new BitArray(new int[] { 0x33333333, 0x33333333 });
- op2 = new BitArray(new int[] { 0x66666666, 0x66666666 });
- }
-
- public void TestBoolConstructor()
- {
- BitArray ba = new BitArray(testPattern);
- verifyPattern(ba, testPattern);
- }
-
- public void TestCopyConstructor()
- {
- BitArray ba = new BitArray(testBa);
-
- verifyPattern(ba, testPattern);
- }
-
- public void TestByteConstructor()
- {
- byte [] byteArr = new byte[] { 0xaa, 0x55, 0xaa, 0x55, 0x80 };
- BitArray ba = new BitArray(byteArr);
-
- AssertEquals("Lengths not equal", ba.Length, byteArr.Length * 8);
-
- // spot check
- Assert("7 not true", ba[7]);
- Assert("6 not false", !ba[6]);
- Assert("15 not false", !ba[15]);
- Assert("14 not true", ba[14]);
- Assert("39 not true", ba[39]);
- Assert("35 not false", !ba[35]);
-
- }
-
- public void TestIntConstructor()
- {
- int [] intArr = new int[] { ~0x55555555, 0x55555551 };
- BitArray ba = new BitArray(intArr);
-
- AssertEquals(ba.Length, intArr.Length * 32);
-
- // spot check
-
- Assert(ba[31]);
- Assert(!ba[30]);
- Assert(!ba[63]);
- Assert(ba[62]);
- Assert(ba[32]);
- Assert(!ba[35]);
- }
-
- public void TestValConstructor()
- {
- BitArray ba = new BitArray(64, false);
-
- AssertEquals(ba.Length, 64);
- foreach (bool b in ba)
- Assert(!b);
-
- ba = new BitArray(64, true);
-
- AssertEquals(ba.Length, 64);
- foreach (bool b in ba)
- Assert(b);
- }
-
- public void TestClone()
- {
- BitArray ba = (BitArray)testBa.Clone();
-
- verifyPattern(ba, testPattern);
-
- // ensure that changes in ba don't get propagated to testBa
- ba[0] = false;
- ba[1] = false;
- ba[2] = false;
-
- verifyPattern(testBa, testPattern);
- }
-
- public void TestSetLength()
- {
- int origLen = testBa.Length;
- testBa.Length += 33;
-
- AssertEquals(origLen + 33, testBa.Length);
- for (int i = origLen; i < testBa.Length; i++)
- testBa[i] = true;
-
- testBa.Length -= 33;
- verifyPattern(testBa, testPattern);
- }
-
- public void TestAnd()
- {
- BitArray result = op1.And(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestOr()
- {
- BitArray result = op1.Or(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(result[i++]);
- Assert(result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestNot()
- {
- BitArray result = op1.Not();
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(!result[i++]);
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(result[i++]);
- }
- }
-
- public void TestXor()
- {
- BitArray result = op1.Xor(op2);
- AssertEquals(result.Length, op1.Length);
- for (int i = 0; i < result.Length; )
- {
- Assert(result[i++]);
- Assert(!result[i++]);
- Assert(result[i++]);
- Assert(!result[i++]);
- }
- }
-
- public void TestSetAll()
- {
- testBa.SetAll(false);
- foreach(bool b in testBa)
- Assert(!b);
- testBa.SetAll(true);
- foreach(bool b in testBa)
- Assert(b);
- }
-
- public void TestCopyToBool()
- {
- try {
- bool[] barray = new bool[testBa.Length + 10];
-
- testBa.CopyTo(barray, 5);
-
- for (int i = 0; i < testBa.Length; i++)
- AssertEquals(testBa[i], barray[i+5]);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCopyToByte()
- {
- try {
- testBa.Length = 34;
- byte[] barray = new byte[5 + 10];
-
- testBa.CopyTo(barray, 5);
-
- for (int i = 5; i < 9; i++)
- AssertEquals(0x55, barray[i] & 0xff);
-
- // FIXME: MS fails on the next line. This is because
- // we truncated testBa.Length, and MS's internal array still
- // has the old bits set. CopyTo() doesn't say specifically
- // whether the "junk" bits (bits past Length, but within Length
- // rounded up to 32) will be copied as 0, or if those bits are
- // undefined.
- //AssertEquals(0x01, barray[9] & 0xff);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCopyToInt()
- {
- try {
- testBa.Length = 34;
- int[] iarray = new int[2 + 10];
-
- testBa.CopyTo(iarray, 5);
-
- AssertEquals(0x55555555, iarray[5]);
- // FIXME: Same thing here as in TestCopyToByte
- //AssertEquals(0x01, iarray[6]);
- }
- catch(Exception e){
- Fail("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestEnumerator()
- {
-
- try {
- IEnumerator e = testBa.GetEnumerator();
-
- for (int i = 0; e.MoveNext(); i++)
- AssertEquals(e.Current, testPattern[i]);
-
- Assert(!e.MoveNext());
- // read, to make sure reading isn't considered a write.
- bool b = testBa[0];
-
- e.Reset();
- for (int i = 0; e.MoveNext(); i++)
- AssertEquals(e.Current, testPattern[i]);
-
- try
- {
- e.Reset();
- testBa[0] = !testBa[0];
- e.MoveNext();
- Fail("IEnumerator.MoveNext() should throw when collection modified.");
- }
- catch (InvalidOperationException)
- {
- }
- }
- catch(Exception ex){
- Fail("Unexpected exception thrown: " + ex.ToString());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs
deleted file mode 100644
index 9bd8ba35ec9..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveComparerTest.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// CaseInsensitiveComparerTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>CaseInsensitiveComparer test suite.</summary>
- public class CaseInsensitiveComparerTest : TestCase {
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CaseInsensitiveComparerTest));
- }
- }
-
- public CaseInsensitiveComparerTest() : base ("MonoTests.System.Collections.CaseInsensitiveComparerTest testcase") {}
-
- public CaseInsensitiveComparerTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a CaseInsensitiveComparer.
- Assert((CaseInsensitiveComparer.Default
- as CaseInsensitiveComparer) != null);
- }
-
- public void TestCompare () {
- CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();
-
- Assert(cic.Compare ("WILD WEST", "Wild West") == 0);
- Assert(cic.Compare ("WILD WEST", "wild west") == 0);
- Assert(cic.Compare ("Zeus", "Mars") > 0);
- Assert(cic.Compare ("Earth", "Venus") < 0);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs b/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs
deleted file mode 100644
index 86419a02ce4..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CaseInsensitiveHashCodeProviderTest.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// CaseInsensitiveHashCodeProviderTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>CaseInsensitiveHashCodeProvider test suite.</summary>
- public class CaseInsensitiveHashCodeProviderTest : TestCase {
- public CaseInsensitiveHashCodeProviderTest() : base ("MonoTests.System.Collections.CaseInsensitiveHashCodeProviderTest testcase") {}
-
- public CaseInsensitiveHashCodeProviderTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(CaseInsensitiveHashCodeProviderTest));
- }
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a CaseInsensitiveHashCodeProvider.
- Assert((CaseInsensitiveHashCodeProvider.Default
- as CaseInsensitiveHashCodeProvider) != null);
- }
-
- public void TestHashCode () {
- CaseInsensitiveHashCodeProvider cih = new CaseInsensitiveHashCodeProvider ();
- int h1 = cih.GetHashCode ("Test String");
- int h2 = cih.GetHashCode ("test string");
- int h3 = cih.GetHashCode ("TEST STRING");
-
- Assert("Mixed Case != lower case", h1 == h2);
- Assert("Mixed Case != UPPER CASE", h1 == h3);
-
- h1 = cih.GetHashCode ("one");
- h2 = cih.GetHashCode ("another");
- // Actually this is quite possible.
- Assert(h1 != h2);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/ChangeLog b/mcs/class/corlib/Test/System.Collections/ChangeLog
deleted file mode 100644
index 68d2d9d502e..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ChangeLog
+++ /dev/null
@@ -1,91 +0,0 @@
-2002-06-25 Nick Drochak <ndrochak@gol.com>
-
- * QueueTest.cs: Trap some unexpected exceptions and add a bit of
- verbosity to some assert messages.
-
-2002-06-20 Nick Drochak <ndrochak@gol.com>
-
- * SortedListTest.cs: Make tests pass against ms.net.
- * QueueTest.cs: Make tests pass against ms.net.
-
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Sort names and include missing tests.
- * SortedListTest.cs: Change Console.WriteLine() into Fail().
-
-2002-05-27 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestLastIndexOf): Add try-catch block to report
- where we are throwing.
-
-2002-05-21 Lawrence Pit <loz@cable.a2000.nl>
-
- * ArrayListTest.cs: Added several tests to test for 0 capacity
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs: Test for RankException when constructing from a
- multi-dimensional array. Confirmed behavior from MS.NET
-
-2002-05-01 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestBinarySearch) : accomodate possible bug in
- .NET runtime.
-
-2002/05/01 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestCopyTo) : Make assert messages unique and
- avoid possible MS.NET bug when test is run on .NET.
-
-2002/04/30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestInsertRange) : Make assert messages unique.
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestTrimToSize): Change test so that it doesn't
- rely on the specific timing of a capacity change. Our corlib doubles
- capacity sooner than the reference system does.
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs: Catch unexpected exception typs and report as
- failures.
-
-2002-04-29 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (TestBinarySearch): Catch the correct exception here.
-
-2002-04-29 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs (): Remove test on unsorted array. Behavior is
- undefined according to docs. Re-added test that was commented out.
-
-2002-03-24 Duncan Mak <duncan@ximian.com>
-
- * SortedListTest.cs: Committed to CVS for Jaak Simm <jaaksimm@firm.ee>.
-
-2002-02-28 Nick Drochak <ndrochak@gol.com>
-
- * HashtableTest.cs: make the second test class public. The was showing
- as an error whe run against the mscorlib. Might be because of the
- new NUnit that was just checked in.
-
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * ArrayListTest.cs: Add a small assert for a bug that I found and fixed
- in ArrayList. Make sure it doesn't come up again.
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * QueueTest.cs: Put in correct namespace.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * StackTest.cs: Removed test for IsReadonly. Doesn't exist in .NET 1.0
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * BitArrayTest.cs: wrapped try-catch blocks around several of the tests.
- NUnit doesn't properly catch exception here anymore. Must be something
- to do with upgrading to .NET.1.0. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs b/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
deleted file mode 100644
index 12ca737e391..00000000000
--- a/mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// System.Collections.CollectionBase
-// Test suite for System.Collections.CollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
-
-public class CollectionBaseTest : TestCase
-{
- public CollectionBaseTest () : base ("System.Collection.CollectionBase testsuite") {}
- public CollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteCollection : CollectionBase
- {
- // These fields are used as markers to test the On* hooks.
- public bool onClearFired;
- public bool onClearCompleteFired;
-
- public bool onInsertFired;
- public int onInsertIndex;
- public bool onInsertCompleteFired;
- public int onInsertCompleteIndex;
-
- public bool onRemoveFired;
- public int onRemoveIndex;
- public bool onRemoveCompleteFired;
- public int onRemoveCompleteIndex;
-
- public bool onSetFired;
- public int onSetOldValue;
- public int onSetNewValue;
- public bool onSetCompleteFired;
- public int onSetCompleteOldValue;
- public int onSetCompleteNewValue;
-
- // This constructor is used to test OnValid()
- public ConcreteCollection()
- {
- IList listObj;
- listObj = this;
- listObj.Add(null);
- }
-
- // This constructor puts consecutive integers into the list
- public ConcreteCollection(int i) {
- IList listObj;
- listObj = this;
-
- int j;
- for (j = 0; j< i; j++) {
- listObj.Add(j);
- }
- }
-
- // A helper method to look at a value in the list at a specific index
- public int PeekAt(int index)
- {
- IList listObj;
- listObj = this;
- return (int) listObj[index];
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClear() {
- this.onClearFired = true;
- }
-
- // Mark the flag if this hook is fired
- protected override void OnClearComplete()
- {
- this.onClearCompleteFired = true;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsert(int index, object value)
- {
- this.onInsertFired = true;
- this.onInsertIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsertComplete(int index, object value)
- {
- this.onInsertCompleteFired = true;
- this.onInsertCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemove(int index, object value)
- {
- this.onRemoveFired = true;
- this.onRemoveIndex = index;
- }
-
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemoveComplete(int index, object value)
- {
- this.onRemoveCompleteFired = true;
- this.onRemoveCompleteIndex = index;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSet(int index, object oldValue, object newValue)
- {
- this.onSetFired = true;
- this.onSetOldValue = (int) oldValue;
- this.onSetNewValue = (int) newValue;
- }
-
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSetComplete(int index, object oldValue, object newValue)
- {
- this.onSetCompleteFired = true;
- this.onSetCompleteOldValue = (int) oldValue;
- this.onSetCompleteNewValue = (int) newValue;
- }
- } // public class ConcreteCollection
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof(CollectionBaseTest));
- }
- }
-
- // Check the count property
- public void TestCount() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(4 == myCollection.Count);
- }
-
- // Make sure GetEnumerator returns an object
- public void TestGetEnumerator() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(null != myCollection.GetEnumerator());
- }
-
- // OnValid disallows nulls
- public void TestOnValid() {
- ConcreteCollection myCollection;
- try {
- myCollection = new ConcreteCollection();
- }
- catch (ArgumentNullException) {
- }
- }
-
- // Test various Insert paths
- public void TestInsert() {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // The constructor inserts
- myCollection = new ConcreteCollection(numberOfItems);
- Assert(myCollection.onInsertFired);
- Assert(myCollection.onInsertCompleteFired);
-
- // Using the IList interface, check inserts in the middle
- IList listObj = myCollection;
- listObj.Insert(1, 9);
- Assert(myCollection.onInsertIndex == 1);
- Assert(myCollection.onInsertCompleteIndex == 1);
- Assert(myCollection.PeekAt(1) == 9);
- }
-
- // Test Clear and it's hooks
- public void TestClear()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 1;
- myCollection = new ConcreteCollection(numberOfItems);
- myCollection.Clear();
- Assert(myCollection.Count == 0);
- Assert(myCollection.onClearFired);
- Assert(myCollection.onClearCompleteFired);
- }
-
- // Test RemoveAt, other removes and the hooks
- public void TestRemove()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- // Set up a test collection
- myCollection = new ConcreteCollection(numberOfItems);
-
- // The list is 0-based. So if we remove the second one
- myCollection.RemoveAt(1);
-
- // We should see the original third one in it's place
- Assert(myCollection.PeekAt(1) == 2);
- Assert(myCollection.onRemoveFired);
- Assert(myCollection.onRemoveIndex == 1);
- Assert(myCollection.onRemoveCompleteFired);
- Assert(myCollection.onRemoveCompleteIndex == 1);
- IList listObj = myCollection;
- listObj.Remove(0);
- // Confirm parameters are being passed to the hooks
- Assert(myCollection.onRemoveIndex == 0);
- Assert(myCollection.onRemoveCompleteIndex == 0);
- }
-
- // Test the random access feature
- public void TestSet()
- {
- ConcreteCollection myCollection;
- int numberOfItems;
- numberOfItems = 3;
- myCollection = new ConcreteCollection(numberOfItems);
- IList listObj = myCollection;
- listObj[0] = 99;
- Assert((int) listObj[0] == 99);
- Assert(myCollection.onSetFired);
- Assert(myCollection.onSetCompleteFired);
- Assert(myCollection.onSetOldValue == 0);
- Assert(myCollection.onSetCompleteOldValue == 0);
- Assert(myCollection.onSetNewValue == 99);
- Assert(myCollection.onSetCompleteNewValue == 99);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs b/mcs/class/corlib/Test/System.Collections/ComparerTest.cs
deleted file mode 100644
index 38b78de39e7..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ComparerTest.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// ComparerTest
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
- /// <summary>Comparer test suite.</summary>
- public class ComparerTest : TestCase {
- public ComparerTest() : base ("MonoTests.System.Collections.ComparerTest testcase") {}
- public ComparerTest(String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite(typeof(ComparerTest));
- }
- }
-
- public void TestDefaultInstance ()
- {
- // Make sure the instance returned by Default
- // is really a Comparer.
- Assert((Comparer.Default as Comparer) != null);
- }
-
- public void TestCompare ()
- {
- Comparer c = Comparer.Default;
-
- bool thrown = false;
-
- try {
- c.Compare (new Object (), new Object ());
- } catch (ArgumentException) {
- thrown = true;
- }
-
- Assert("ArgumentException expected", thrown);
-
- Assert(c.Compare (1, 2) < 0);
- Assert(c.Compare (2, 2) == 0);
- Assert(c.Compare (3, 2) > 0);
-
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs b/mcs/class/corlib/Test/System.Collections/HashtableTest.cs
deleted file mode 100644
index b37b16ffd1b..00000000000
--- a/mcs/class/corlib/Test/System.Collections/HashtableTest.cs
+++ /dev/null
@@ -1,761 +0,0 @@
-// HashtableTest.cs - NUnit Test Cases for the System.Collections.Hashtable class
-//
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>Hashtable test.</summary>
-public class HashtableTest : TestCase {
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite();
-
- suite.AddTest(new TestSuite(typeof(HashtableTest)));
- suite.AddTest(new TestSuite(typeof(HashtableTest2)));
- return suite;
- }
- }
-
- public void TestCtor1() {
- Hashtable h = new Hashtable();
- AssertNotNull("No hash table", h);
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- string[] keys = {"this", "is", "a", "test"};
- char[] values = {'a', 'b', 'c', 'd'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values[i];
- }
- Hashtable h2 = new Hashtable(h1);
- for (int i = 0; i < keys.Length; i++) {
- AssertEquals("No match for key " + keys[i],
- values[i], h2[keys[i]]);
- }
- }
- }
- // TODO - Ctors for capacity and load (how to test? any access?)
- // TODO - Ctors with IComparer, IHashCodeProvider, Serialization
-
- public void TestCount() {
- Hashtable h = new Hashtable();
- AssertEquals("new table - count zero", 0, h.Count);
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- AssertEquals("Count wrong for " + i,
- i, h.Count);
- }
- for (int i = 1; i <= max; i++) {
- h[i] = i * 2;
- AssertEquals("Count shouldn't change at " + i,
- max, h.Count);
- }
- }
-
- public void TestIsFixedSize() {
- Hashtable h = new Hashtable();
- AssertEquals("hashtable not fixed by default",
- false, h.IsFixedSize);
- // TODO - any way to get a fixed-size hashtable?
- }
-
- public void TestIsReadOnly() {
- Hashtable h = new Hashtable();
- AssertEquals("hashtable not read-only by default",
- false, h.IsReadOnly);
- // TODO - any way to get a read-only hashtable?
- }
-
- public void TestIsSynchronized() {
- Hashtable h = new Hashtable();
- Assert("hashtable not synced by default", !h.IsSynchronized);
- Hashtable h2 = Hashtable.Synchronized(h);
- Assert("hashtable should by synced", h2.IsSynchronized);
- }
-
- public void TestItem() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object o = h[null];
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- // TODO - if read-only and/or fixed-size is possible,
- // test 'NotSupportedException' here
-
- {
- Hashtable h = new Hashtable();
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- AssertEquals("value wrong for " + i,
- i, h[i]);
- }
- }
- }
-
- public void TestKeys() {
- string[] keys = {"this", "is", "a", "test"};
- char[] values1 = {'a', 'b', 'c', 'd'};
- char[] values2 = {'e', 'f', 'g', 'h'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values1[i];
- }
- AssertEquals("keys wrong size",
- keys.Length, h1.Keys.Count);
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values2[i];
- }
- AssertEquals("keys wrong size 2",
- keys.Length, h1.Keys.Count);
- }
-
- // TODO - SyncRoot
-
- public void TestValues() {
- string[] keys = {"this", "is", "a", "test"};
- char[] values1 = {'a', 'b', 'c', 'd'};
- char[] values2 = {'e', 'f', 'g', 'h'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values1[i];
- }
- AssertEquals("values wrong size",
- keys.Length, h1.Values.Count);
- for (int i = 0; i < keys.Length; i++) {
- h1[keys[i]] = values2[i];
- }
- AssertEquals("values wrong size 2",
- keys.Length, h1.Values.Count);
- }
-
- public void TestAdd() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Add(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Add('a', 1);
- h.Add('a', 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("re-add error not thrown",
- errorThrown);
- }
- // TODO - hit NotSupportedException
- {
- Hashtable h = new Hashtable();
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h.Add(i, i);
- AssertEquals("value wrong for " + i,
- i, h[i]);
- }
- }
- }
-
- public void TestClear() {
- // TODO - hit NotSupportedException
- Hashtable h = new Hashtable();
- AssertEquals("new table - count zero", 0, h.Count);
- int max = 100;
- for (int i = 1; i <= max; i++) {
- h[i] = i;
- }
- Assert("table don't gots stuff", h.Count > 0);
- h.Clear();
- AssertEquals("Table should be cleared",
- 0, h.Count);
- }
-
- public void TestClone() {
- {
- char[] c1 = {'a', 'b', 'c'};
- char[] c2 = {'d', 'e', 'f'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < c1.Length; i++) {
- h1[c1[i]] = c2[i];
- }
- Hashtable h2 = (Hashtable)h1.Clone();
- AssertNotNull("got no clone!", h2);
- AssertNotNull("clone's got nothing!", h2[c1[0]]);
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Hashtable match",
- h1[c1[i]], h2[c1[i]]);
- }
- }
- {
- char[] c1 = {'a', 'b', 'c'};
- char[] c20 = {'1', '2'};
- char[] c21 = {'3', '4'};
- char[] c22 = {'5', '6'};
- char[][] c2 = {c20, c21, c22};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < c1.Length; i++) {
- h1[c1[i]] = c2[i];
- }
- Hashtable h2 = (Hashtable)h1.Clone();
- AssertNotNull("got no clone!", h2);
- AssertNotNull("clone's got nothing!", h2[c1[0]]);
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("Hashtable match",
- h1[c1[i]], h2[c1[i]]);
- }
-
- ((char[])h1[c1[0]])[0] = 'z';
- AssertEquals("shallow copy", h1[c1[0]], h2[c1[0]]);
- }
- }
-
- public void TestContains() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- bool result = h.Contains(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("'a'? it's in there!", h.Contains('a'));
- Assert("'b'? no way!", !h.Contains('b'));
- }
- }
-
- public void TestContainsKey() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- bool result = h.ContainsKey(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null add error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("'a'? it's in there!", h.ContainsKey('a'));
- Assert("'b'? no way!", !h.ContainsKey('b'));
- }
- }
-
- public void TestContainsValue() {
- {
- Hashtable h = new Hashtable();
- h['a'] = "blue";
- Assert("blue? it's in there!",
- h.ContainsValue("blue"));
- Assert("green? no way!",
- !h.ContainsValue("green"));
- }
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.CopyTo(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object[] o = new Object[1];
- h.CopyTo(o, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- Object[,] o = new Object[1,1];
- h.CopyTo(o, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("multi-dim array error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h['a'] = 1; // no error if table is empty
- Object[] o = new Object[5];
- h.CopyTo(o, 5);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("no room in array error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h['a'] = 1;
- h['b'] = 2;
- h['c'] = 2;
- Object[] o = new Object[2];
- h.CopyTo(o, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("table too big error not thrown",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h["blue"] = 1;
- h["green"] = 2;
- h["red"] = 3;
- Char[] o = new Char[3];
- h.CopyTo(o, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("invalid cast error not thrown",
- errorThrown);
- }
-
- {
- Hashtable h = new Hashtable();
- h['a'] = 1;
- h['b'] = 2;
- DictionaryEntry[] o = new DictionaryEntry[2];
- h.CopyTo(o,0);
- AssertEquals("first copy fine.", 'a', o[0].Key);
- AssertEquals("first copy fine.", 1, o[0].Value);
- AssertEquals("second copy fine.", 'b', o[1].Key);
- AssertEquals("second copy fine.", 2, o[1].Value);
- }
- }
-
- public void TestGetEnumerator() {
- String[] s1 = {"this", "is", "a", "test"};
- Char[] c1 = {'a', 'b', 'c', 'd'};
- Hashtable h1 = new Hashtable();
- for (int i = 0; i < s1.Length; i++) {
- h1[s1[i]] = c1[i];
- }
- IDictionaryEnumerator en = h1.GetEnumerator();
- AssertNotNull("No enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- Assert("Not enumerating for " + en.Key,
- Array.IndexOf(s1, en.Key) >= 0);
- Assert("Not enumerating for " + en.Value,
- Array.IndexOf(c1, en.Value) >= 0);
- }
- }
-
- // TODO - GetObjectData
- // TODO - OnDeserialization
-
- public void TestRemove() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = new Hashtable();
- h.Remove(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- string[] keys = {"this", "is", "a", "test"};
- char[] values = {'a', 'b', 'c', 'd'};
- Hashtable h = new Hashtable();
- for (int i = 0; i < keys.Length; i++) {
- h[keys[i]] = values[i];
- }
- AssertEquals("not enough in table",
- 4, h.Count);
- h.Remove("huh?");
- AssertEquals("not enough in table",
- 4, h.Count);
- h.Remove("this");
- AssertEquals("Wrong count in table",
- 3, h.Count);
- h.Remove("this");
- AssertEquals("Wrong count in table",
- 3, h.Count);
- }
- }
-
- public void TestSynchronized() {
- {
- bool errorThrown = false;
- try {
- Hashtable h = Hashtable.Synchronized(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null hashtable error not thrown",
- errorThrown);
- }
- {
- Hashtable h = new Hashtable();
- Assert("hashtable not synced by default",
- !h.IsSynchronized);
- Hashtable h2 = Hashtable.Synchronized(h);
- Assert("hashtable should by synced",
- h2.IsSynchronized);
- }
- }
-
-
- protected Hashtable ht;
- private static Random rnd;
-
- public HashtableTest() : base ("MonoTests.System.Collections.HashtableTest testcase") {}
- public HashtableTest(String name) : base(name) {}
-
- protected override void SetUp() {
- ht=new Hashtable();
- rnd=new Random();
- }
-
- private void SetDefaultData() {
- ht.Clear();
- ht.Add("k1","another");
- ht.Add("k2","yet");
- ht.Add("k3","hashtable");
- }
-
-
- public void TestAddRemoveClear() {
- ht.Clear();
- Assert(ht.Count==0);
-
- SetDefaultData();
- Assert(ht.Count==3);
-
- bool thrown=false;
- try {
- ht.Add("k2","cool");
- } catch (ArgumentException) {thrown=true;}
- Assert("Must throw ArgumentException!",thrown);
-
- ht["k2"]="cool";
- Assert(ht.Count==3);
- Assert(ht["k2"].Equals("cool"));
-
- }
-
- public void TestCopyTo2() {
- SetDefaultData();
- Object[] entries=new Object[ht.Count];
- ht.CopyTo(entries,0);
- Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
-
- public void TestUnderHeavyLoad() {
- ht.Clear();
- int max=100000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (ht[key]==null) {
- ht[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(ht.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- ht.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(ht[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- ICollection keys=ht.Keys;
- int nKeys=0;
- foreach (Object key in keys) {
- Assert((key as String) != null);
- nKeys++;
- }
- Assert(nKeys==ht.Count);
-
-
- ICollection vals=ht.Values;
- int nVals=0;
- foreach (Object val in vals) {
- Assert((val as String) != null);
- nVals++;
- }
- Assert(nVals==ht.Count);
-
- }
-
-
- public class HashtableTest2 : TestCase {
-
- protected Hashtable ht;
- private static Random rnd;
-
- public HashtableTest2 (String name) : base(name)
- {
- }
-
- protected override void SetUp ()
- {
- ht=new Hashtable ();
- rnd=new Random ();
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(HashtableTest2));
- }
- }
-
- private void SetDefaultData ()
- {
- ht.Clear ();
- ht.Add ("k1","another");
- ht.Add ("k2","yet");
- ht.Add ("k3","hashtable");
- }
-
-
- public void TestAddRemoveClear ()
- {
- ht.Clear ();
- Assert (ht.Count == 0);
-
- SetDefaultData ();
- Assert (ht.Count == 3);
-
- bool thrown=false;
- try {
- ht.Add ("k2","cool");
- } catch (ArgumentException) {thrown=true;}
- Assert("Must throw ArgumentException!",thrown);
-
- ht["k2"]="cool";
- Assert(ht.Count == 3);
- Assert(ht["k2"].Equals("cool"));
-
- }
-
- public void TestCopyTo ()
- {
- SetDefaultData ();
- Object[] entries=new Object[ht.Count];
- ht.CopyTo (entries,0);
- Assert("Not an entry.",entries[0] is DictionaryEntry);
- }
-
-
- public void TestUnderHeavyLoad ()
- {
- ht.Clear ();
-
- int max=100000;
- String[] cache=new String[max*2];
- int n=0;
-
- for (int i=0;i<max;i++) {
- int id=rnd.Next()&0xFFFF;
- String key=""+id+"-key-"+id;
- String val="value-"+id;
- if (ht[key]==null) {
- ht[key]=val;
- cache[n]=key;
- cache[n+max]=val;
- n++;
- }
- }
-
- Assert(ht.Count==n);
-
- for (int i=0;i<n;i++) {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
-
- int r1=(n/3);
- int r2=r1+(n/5);
-
- for (int i=r1;i<r2;i++) {
- ht.Remove(cache[i]);
- }
-
-
- for (int i=0;i<n;i++) {
- if (i>=r1 && i<r2) {
- Assert(ht[cache[i]]==null);
- } else {
- String key=cache[i];
- String val=ht[key] as String;
- String err="ht[\""+key+"\"]=\""+val+
- "\", expected \""+cache[i+max]+"\"";
- Assert(err,val!=null && val.Equals(cache[i+max]));
- }
- }
-
- ICollection keys=ht.Keys;
- int nKeys=0;
- foreach (Object key in keys) {
- Assert((key as String) != null);
- nKeys++;
- }
- Assert(nKeys==ht.Count);
-
-
- ICollection vals=ht.Values;
- int nVals=0;
- foreach (Object val in vals) {
- Assert((val as String) != null);
- nVals++;
- }
- Assert(nVals==ht.Count);
-
- }
-
- /// <summary>
- /// Test hashtable with CaseInsensitiveHashCodeProvider
- /// and CaseInsensitive comparer.
- /// </summary>
- public void TestCaseInsensitive ()
- {
- // Not very meaningfull test, just to make
- // sure that hcp is set properly set.
- Hashtable ciHashtable = new Hashtable(11,1.0f,CaseInsensitiveHashCodeProvider.Default,CaseInsensitiveComparer.Default);
- ciHashtable ["key1"] = "value";
- ciHashtable ["key2"] = "VALUE";
- Assert(ciHashtable ["key1"].Equals ("value"));
- Assert(ciHashtable ["key2"].Equals ("VALUE"));
-
- ciHashtable ["KEY1"] = "new_value";
- Assert(ciHashtable ["key1"].Equals ("new_value"));
-
- }
-
-
- public void TestCopyConstructor ()
- {
- SetDefaultData ();
-
- Hashtable htCopy = new Hashtable (ht);
-
- Assert(ht.Count == htCopy.Count);
- }
-
-
- public void TestEnumerator ()
- {
- SetDefaultData ();
-
- IEnumerator e = ht.GetEnumerator ();
-
- while (e.MoveNext ()) {}
-
- Assert (!e.MoveNext ());
-
- }
-
-
- }
-
-
-}
-}
diff --git a/mcs/class/corlib/Test/System.Collections/QueueTest.cs b/mcs/class/corlib/Test/System.Collections/QueueTest.cs
deleted file mode 100644
index 003c5384c79..00000000000
--- a/mcs/class/corlib/Test/System.Collections/QueueTest.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// System.Collections.QueueTest
-// Test suite for System.Collections.Queue
-//
-// Author:
-// Ricardo Fernández Pascual
-//
-// (C) 2001 Ricardo Fernández Pascual
-//
-
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
-
- public class QueueTest : TestCase {
-
- public QueueTest ()
- : base ("System.Collection.Queue testsuite") {}
- public QueueTest (String name) : base (name) {}
-
- protected Queue q1;
- protected Queue q2;
- protected Queue emptyQueue;
-
- protected override void SetUp () {
- q1 = new Queue (10);
- for (int i = 0; i < 100; i++)
- q1.Enqueue (i);
-
- q2 = new Queue (50, 1.5f);
- for (int i = 50; i < 100; i++)
- q2.Enqueue (i);
-
- emptyQueue = new Queue ();
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (QueueTest));
- }
- }
-
- public void TestConstructors () {
- Assert (q1.Count == 100);
- Assert (q2.Count == 50);
- Assert (emptyQueue.Count == 0);
- // TODO: Test Queue (ICollection)
- }
-
- // TODO: should test all methods from ICollection,
- // but it should be done in ICollectionTest.cs... ??
-
- public void TestCopyTo () {
- int[] a1 = new int[100];
- int[] a2 = new int[60];
-
- string progress_marker = "";
- try {
- progress_marker = "before first CopyTo";
- q1.CopyTo (a1, 0);
- for (int i = 0; i < 100; i++)
- AssertEquals (i, a1[i]);
-
- // Remove some items from q2 and add other
- // items, to avoid having an "easy" just created
- // Queue
- for (int i = 50; i < 60; i++)
- Assert (i == (int) q2.Dequeue ());
- for (int i = 100; i < 110; i++)
- q2.Enqueue (i);
-
- progress_marker = "before second CopyTo";
- q2.CopyTo (a2, 10);
- for (int i = 60; i < 110; i++)
- Assert (i == a2[i - 60 + 10]);
-
- // Copying an empty Queue should not modify the array
- progress_marker = "before third CopyTo";
- emptyQueue.CopyTo (a2, 10);
- for (int i = 60; i < 110; i++)
- Assert (i == a2[i - 60 + 10]);
- } catch (Exception e) {
- Fail ("Unexpected exception at marker <" + progress_marker + ">: e = " + e);
- }
-
- }
-
- public void TestEnumerator () {
- int i;
- IEnumerator e;
- e = q1.GetEnumerator ();
- i = 0;
- while (e.MoveNext ()) {
- AssertEquals ("q1 at i=" + i, i, ((int) e.Current));
- i++;
- }
- e = q2.GetEnumerator ();
- i = 50;
- while (e.MoveNext ()) {
- AssertEquals (i, ((int) e.Current));
- i++;
- }
- e = emptyQueue.GetEnumerator ();
- if (e.MoveNext ())
- Fail ("Empty Queue enumerator returning elements!");
-
- e = q1.GetEnumerator ();
- try {
- e.MoveNext ();
- q1.Enqueue (0);
- e.MoveNext ();
- Fail ("#1 Should have thrown InvalidOperationException");
- } catch (InvalidOperationException) { }
- e = q1.GetEnumerator ();
- }
-
- public void TestClone () {
- Queue q3 = (Queue) q2.Clone ();
- Assert (q3.Count == q2.Count);
- for (int i = 0; i < 50; i++)
- Assert (q2.Dequeue ().Equals (q3.Dequeue ()));
- Assert (q3.Count == 0);
- Assert (q2.Count == 0);
- }
-
- public void ClearTest () {
- q1.Clear ();
- Assert (q1.Count == 0);
- q2.Clear ();
- Assert (q2.Count == 0);
- emptyQueue.Clear ();
- Assert (emptyQueue.Count == 0);
- }
-
- public void ContainsTest () {
- for (int i = 0; i < 100; i++) {
- Assert (q1.Contains (i));
- Assert (!emptyQueue.Contains (i));
- if (i < 50)
- Assert (!q2.Contains (i));
- else
- Assert (q2.Contains (i));
- }
- }
-
- public void EnqueueDequeuePeekTest () {
- int q1size = q1.Count;
- int q2size = q2.Count;
- q2.Enqueue (null);
- Assert (q2.Count == ++q2size);
- for (int i = 0; i < 50; i++) {
- int k = (int) q1.Peek ();
- Assert (q1.Count == q1size);
- int j = (int) q1.Dequeue ();
- Assert (q1.Count == --q1size);
- Assert (i == j);
- Assert (j == k);
- q2.Enqueue (j);
- Assert (q2.Count == ++q2size);
- }
- for (int i = 50; i < 100; i++) {
- Assert (((int) q2.Dequeue ()) == i);
- Assert (q2.Count == --q2size);
- }
- Assert (q2.Peek () == null);
- Assert (q2.Dequeue () == null);
- Assert (q2.Count == --q2size);
- for (int i = 0; i < 50; i++) {
- Assert (((int) q2.Dequeue ()) == i);
- Assert (q2.Count == --q2size);
- }
- }
-
- // TODO: test Syncronized operation
-
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs b/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs
deleted file mode 100644
index 1ec201d2db2..00000000000
--- a/mcs/class/corlib/Test/System.Collections/ReadOnlyCollectionBaseTest.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// System.Collections.ReadOnlyCollectionBase
-// Test suite for System.Collections.ReadOnlyCollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections {
- public class ReadOnlyCollectionBaseTest : TestCase {
- public ReadOnlyCollectionBaseTest () : base ("System.Collection.ReadOnlyCollectionBase testsuite") {}
- public ReadOnlyCollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteReadOnlyCollection : ReadOnlyCollectionBase
- {
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(ReadOnlyCollectionBaseTest));
- }
- }
-
- // Make sure that the Count is 0 for a new object
- public void TestZeroCountOnNew()
- {
- ConcreteReadOnlyCollection myCollection;
- myCollection = new ConcreteReadOnlyCollection();
- Assert(0 == myCollection.Count);
- }
-
- // Make sure we get an object from GetEnumerator()
- public void TestGetEnumerator()
- {
- ConcreteReadOnlyCollection myCollection;
- myCollection = new ConcreteReadOnlyCollection();
- Assert(null != myCollection.GetEnumerator());
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs b/mcs/class/corlib/Test/System.Collections/SortedListTest.cs
deleted file mode 100755
index 71668a28873..00000000000
--- a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs
+++ /dev/null
@@ -1,624 +0,0 @@
-// SortedListTest.cs - NUnit Test Cases for the System.Collections.SortedList class
-//
-// Jaak Simm
-//
-// Thanks go to David Brandt (bucky@keystreams.com),
-// because this file is based on his ArrayListTest.cs
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-// main TODO: additional tests for functions affected by
-// fixedsize and read-only properties
-
-
-using System;
-using System.Collections;
-
-using NUnit.Framework;
-
-
-namespace MonoTests.System.Collections {
-
-
-/// <summary>SortedList test.</summary>
-public class SortedListTest : TestCase {
- public SortedListTest() : base ("MonoTests.System.SortedListTest testsuite") {}
- public SortedListTest(string name) : base(name) {}
-
- protected SortedList sl1;
- protected SortedList sl2;
- protected SortedList emptysl;
- protected const int icap=16;
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SortedListTest));
- }
- }
-
- public void TestConstructor1() {
- SortedList temp1 = new SortedList();
- AssertNotNull("sl.constructor-1: returns null", temp1);
- AssertEquals("sl.constructor-1: incorrect initial capacity", temp1.Capacity, icap);
- }
-
- public void TestConstructor2() {
- Comparer c = Comparer.Default;
- SortedList temp1 = new SortedList(c);
- AssertNotNull("sl.constructor-2: returns null", temp1);
- AssertEquals("sl.constructor-2: incorrect initial capacity", temp1.Capacity, icap);
- }
-
- public void TestConstructor3() {
- Hashtable d = new Hashtable();
- d.Add("one", "Mircosoft");
- d.Add("two", "will");
- d.Add("three", "rule");
- d.Add("four", "the world");
-
- SortedList temp1 = new SortedList(d);
- AssertNotNull("sl.constructor-3: returns null", temp1);
- AssertEquals("sl.constructor-3: incorrect initial capacity", temp1.Capacity, 4);
- AssertEquals("sl.constructor-3: incorrect count", temp1.Count, 4);
-
- try {
- d=null;
- temp1 = new SortedList(d);
- Fail ("sl.constructor-3: does not throw ArgumentNullException");
- } catch (ArgumentNullException) {}
- try {
- d = new Hashtable();
- d.Add("one", "Mircosoft");
- d.Add("two", "will");
- d.Add("three", "rule");
- d.Add("four", "the world");
- d.Add(7987,"lkj");
- temp1 = new SortedList(d);
- Fail ("sl.constructor-3: does not throw InvalidCastException");
- } catch (InvalidOperationException) {
- } catch (Exception e) {
- Fail ("Unexpected Exception throw: e=" + e);
- }
- }
-
- public void TestConstructor4() {
- SortedList temp1 = new SortedList(17);
- AssertNotNull("sl.constructor-4: returns null", temp1);
- AssertEquals("sl.constructor-4: incorrect initial capacity", temp1.Capacity, 17);
- try {
- temp1 = new SortedList(-6);
- Fail ("sl.constructor-4: does not throw ArgumentOutOfRangeException, with negative values");
- } catch (ArgumentOutOfRangeException) {}
- try {
- temp1 = new SortedList(0);
- } catch (ArgumentOutOfRangeException) {
- Fail ("sl.constructor-4: throws ArgumentOutOfRangeException with 0");
- }
- }
-
- public void TestConstructor5() {
- Comparer c = Comparer.Default;
- SortedList temp1 = new SortedList(c,27);
- AssertNotNull("sl.constructor-5: returns null", temp1);
- AssertEquals("sl.constructor-5: incorrect initial capacity", temp1.Capacity, 27);
- try {
- temp1 = new SortedList(-12);
- Fail ("sl.constructor-5: does not throw ArgumentOutOfRangeException, with negative values");
- } catch (ArgumentOutOfRangeException) {}
- }
-
- public void TestIsSynchronized() {
- SortedList sl1 = new SortedList();
- Assert("sl: should not be synchronized by default",
- !sl1.IsSynchronized);
- SortedList sl2 = SortedList.Synchronized(sl1);
- Assert("sl: synchronized wrapper not working", sl2.IsSynchronized);
- }
-
- public void TestCapacity() {
- for (int i = 0; i < 100; i++) {
- SortedList sl1 = new SortedList(i);
- AssertEquals("Bad capacity of " + i,
- i, sl1.Capacity);
- }
- }
-
- public void TestCount() {
- {
- SortedList sl1 = new SortedList();
- AssertEquals("Bad initial count",
- 0, sl1.Count);
- for (int i = 1; i <= 100; i++) {
- sl1.Add(""+i,""+i);
- AssertEquals("Bad count " + i,
- i, sl1.Count);
- }
- }
- }
-
- public void TestIsFixed() {
- SortedList sl1 = new SortedList();
- Assert("should not be fixed by default", !sl1.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- SortedList sl1 = new SortedList();
- Assert("should not be ReadOnly by default", !sl1.IsReadOnly);
- }
-
-
- public void TestItem() {
- SortedList sl1 = new SortedList();
- string key = null;
- {
- try {
- object o = sl1[-1];
- } catch (ArgumentNullException) {
- Fail ("sl.Item: throws ArgumentNullException with negative values");
- }
- try {
- object o = sl1[key];
- Fail ("sl.Item: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
- }
-
- for (int i = 0; i <= 100; i++) {
- sl1.Add("kala "+i,i);
- }
- for (int i = 0; i <= 100; i++) {
- AssertEquals("sl.Item: item not fetched for " + i,
- i, sl1["kala "+i]);
- }
- }
-
- public void TestSyncRoot()
- {
- SortedList sl1 = new SortedList();
- AssertEquals("sl.SyncRoot: does not function",false, sl1.SyncRoot == null);
- /*
- lock( sl1.SyncRoot ) {
- foreach ( Object item in sl1 ) {
- item="asdf";
- Assert ("sl.SyncRoot: item not read-only",item.IsReadOnly);
- }
- }
- */
- }
-
- public void TestValues()
- {
- SortedList sl1 = new SortedList();
- ICollection ic1 = sl1.Values;
- for (int i = 0; i <= 100; i++) {
- sl1.Add("kala "+i,i);
- AssertEquals("sl.Values: .Values has different count",ic1.Count,sl1.Count);
- }
- }
-
-
- // TODO: Add with IComparer
- public void TestAdd() {
- // seems SortedList cannot be set fixedsize or readonly
- SortedList sl1 = new SortedList();
- string key = null;
- {
- try {
- sl1.Add(key,"kala");
- Fail ("sl.Add: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
- }
-
- {
- for (int i = 1; i <= 100; i++) {
- sl1.Add("kala "+i,i);
- AssertEquals("sl.Add: incorrect count",i,sl1.Count);
- AssertEquals("sl.Add: incorrect value",i,sl1["kala "+i]);
- }
- }
- {
- try {
- sl1.Add("kala",10);
- sl1.Add("kala",11);
- Fail ("sl.Add: does not throw ArgumentException when adding existing key");
- } catch (ArgumentException) {}
- }
- }
-
-
- public void TestClear() {
- {
- SortedList sl1 = new SortedList(10);
- sl1.Add("kala",'c');
- sl1.Add("kala2",'d');
- AssertEquals("sl.Clear: capacity is incorrect",10, sl1.Capacity);
- AssertEquals("sl.Clear: should have one element", 2, sl1.Count);
- sl1.Clear();
- AssertEquals("sl.Clear: is not cleared",0, sl1.Count);
- AssertEquals("sl.Clear: capacity is altered",16, sl1.Capacity);
- }
- }
-
- public void TestClone() {
- {
- SortedList sl1 = new SortedList(10);
- for (int i = 0; i <= 50; i++) {sl1.Add("kala "+i,i);}
- SortedList sl2 = (SortedList)sl1.Clone();
- for (int i = 0; i <= 50; i++) {
- AssertEquals("sl.Clone: copying failed @"+i, sl1["kala "+i], sl2["kala "+i]);
- }
- }
- {
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- //char[][] d1 = {d10, d11, d12};
- SortedList sl1 = new SortedList();
- sl1.Add("d1",d10);
- sl1.Add("d2",d11);
- sl1.Add("d3",d12);
- SortedList sl2 = (SortedList)sl1.Clone();
- AssertEquals("sl.Clone: Array not matching", sl1["d1"], sl2["d1"]);
- AssertEquals("sl.Clone: Array not matching", sl1["d2"], sl2["d2"]);
- AssertEquals("sl.Clone: Array not matching", sl1["d3"], sl2["d3"]);
-
- ((char[])sl1["d1"])[0] = 'z';
- AssertEquals("s1.Clone: shallow copy", sl1["d1"], sl2["d1"]);
- }
- }
-
- public void TestContains() {
- SortedList sl1 = new SortedList(55);
- for (int i = 0; i <= 50; i++) {sl1.Add("kala "+i,i);}
-
- try {
- if (sl1.Contains(null)){}
- Fail ("sl.Contains: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
-
- Assert("sl.Contains: can't find existing key", sl1.Contains("kala 17"));
- Assert("sl.Contains: finds non-existing key", !sl1.Contains("ohoo"));
- }
-
- public void TestContainsKey() {
- SortedList sl1 = new SortedList(55);
- for (int i = 0; i <= 50; i++) {sl1.Add("kala "+i,i);}
-
- try {
- if (sl1.ContainsKey(null)){}
- Fail ("sl.ContainsKey: does not throw ArgumentNullException with null key");
- } catch (ArgumentNullException) {}
-
- Assert("sl.ContainsKey: can't find existing key", sl1.ContainsKey("kala 17"));
- Assert("sl.ContainsKey: finds non-existing key", !sl1.ContainsKey("ohoo"));
- }
-
- public void TestContainsValue() {
- SortedList sl1 = new SortedList(55);
- sl1.Add(0, "zero");
- sl1.Add(1, "one");
- sl1.Add(2, "two");
- sl1.Add(3, "three");
- sl1.Add(4, "four");
- Assert("sl.ContainsValue: can't find existing value", sl1.ContainsValue("zero"));
- Assert("sl.ContainsValue: finds non-existing value", !sl1.ContainsValue("ohoo"));
- Assert("sl.ContainsValue: finds non-existing value", !sl1.ContainsValue(null));
- }
-
- public void TestCopyTo() {
- SortedList sl1 = new SortedList();
- for (int i = 0; i <= 10; i++) {sl1.Add("kala "+i,i);}
- {
- try {
- sl1.CopyTo(null, 2);
- Fail("sl.CopyTo: does not throw ArgumentNullException when target null");
- } catch (ArgumentNullException) {}
- }
- {
- try {
- Char[,] c2 = new Char[2,2];
- sl1.CopyTo(c2, 2);
- Fail("sl.CopyTo: does not throw ArgumentException when target is multiarray");
- } catch (ArgumentException) {}
- }
- {
- try {
- Char[] c1 = new Char[2];
- sl1.CopyTo(c1, -2);
- Fail("sl.CopyTo: does not throw ArgumentOutOfRangeException when index is negative");
- } catch (ArgumentOutOfRangeException) {}
- }
- {
- try {
- Char[] c1 = new Char[2];
- sl1.CopyTo(c1, 3);
- Fail("sl.CopyTo: does not throw ArgumentException when index is too large");
- } catch (ArgumentException) {}
- }
- {
- try {
- Char[] c1 = new Char[2];
- sl1.CopyTo(c1, 1);
- Fail("sl.CopyTo: does not throw ArgumentException when SortedList too big for the array");
- } catch (ArgumentException) {}
- }
- {
- try {
- Char[] c2 = new Char[15];
- sl1.CopyTo(c2, 0);
- Fail("sl.CopyTo: does not throw InvalidCastException when incompatible data types");
- } catch (InvalidCastException) {}
- }
-
- // CopyTo function does not work well with SortedList
- // even example at MSDN gave InvalidCastException
- // thus, it is NOT testet here
- /*
- sl1.Clear();
- for (int i = 0; i <= 5; i++) {sl1.Add(i,""+i);}
- Char[] copy = new Char[15];
- Array.Clear(copy,0,copy.Length);
- copy.SetValue( "The", 0 );
- copy.SetValue( "quick", 1 );
- copy.SetValue( "brown", 2 );
- copy.SetValue( "fox", 3 );
- copy.SetValue( "jumped", 4 );
- copy.SetValue( "over", 5 );
- copy.SetValue( "the", 6 );
- copy.SetValue( "lazy", 7 );
- copy.SetValue( "dog", 8 );
- sl1.CopyTo(copy,1);
- AssertEquals("sl.CopyTo: incorrect copy(1).","The", copy.GetValue(0));
- AssertEquals("sl.CopyTo: incorrect copy(1).","quick", copy.GetValue(1));
- for (int i=2; i<8; i++) AssertEquals("sl.CopyTo: incorrect copy(2).",sl1["kala "+(i-2)], copy.GetValue(i));
- AssertEquals("sl.CopyTo: incorrect copy(3).","dog", copy.GetValue(8));
- */
- }
-
- public SortedList DefaultSL() {
- SortedList sl1 = new SortedList();
- sl1.Add( 1.0, "The" );
- sl1.Add( 1.1, "quick" );
- sl1.Add( 34.0, "brown" );
- sl1.Add( -100.75, "fox" );
- sl1.Add( 1.4, "jumped" );
- sl1.Add( 1.5, "over" );
- sl1.Add( 1.6, "the" );
- sl1.Add( 1.7, "lazy" );
- sl1.Add( 1.8, "dog" );
- return sl1;
- }
-
- public IList DefaultValues() {
- IList il = new ArrayList();
- il.Add( "fox" );
- il.Add( "The" );
- il.Add( "quick" );
- il.Add( "jumped" );
- il.Add( "over" );
- il.Add( "the" );
- il.Add( "lazy" );
- il.Add( "dog" );
- il.Add( "brown" );
- return il;
- }
-
- public void TestGetByIndex() {
- SortedList sl1 = DefaultSL();
- AssertEquals("cl.GetByIndex: failed(1)",sl1.GetByIndex(4),"over");
- AssertEquals("cl.GetByIndex: failed(2)",sl1.GetByIndex(8),"brown");
- try {
- sl1.GetByIndex(-1);
- Fail("sl.GetByIndex: does not throw ArgumentOutOfRangeException with negative index");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.GetByIndex(100);
- Fail("sl.GetByIndex: does not throw ArgumentOutOfRangeException with too large index");
- } catch (ArgumentOutOfRangeException) {}
- }
-
- public void TestGetEnumerator() {
- SortedList sl1 = DefaultSL();
- IDictionaryEnumerator e = sl1.GetEnumerator();
- AssertNotNull("sl.GetEnumerator: does not return enumerator", e);
- AssertEquals("sl.GetEnumerator: enumerator not working(1)",e.MoveNext(),true);
- AssertNotNull("sl.GetEnumerator: enumerator not working(2)",e.Current);
- }
-
- public void TestGetKey() {
- SortedList sl1 = DefaultSL();
- AssertEquals("sl.GetKey: failed(1)",sl1.GetKey(4),1.5);
- AssertEquals("sl.GetKey: failed(2)",sl1.GetKey(8),34.0);
- try {
- sl1.GetKey(-1);
- Fail("sl.GetKey: does not throw ArgumentOutOfRangeException with negative index");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.GetKey(100);
- Fail("sl.GetKey: does not throw ArgumentOutOfRangeException with too large index");
- } catch (ArgumentOutOfRangeException) {}
- }
-
- public void TestGetKeyList() {
- SortedList sl1 = DefaultSL();
- IList keys = sl1.GetKeyList();
- AssertNotNull("sl.GetKeyList: does not return keylist", keys);
- Assert("sl.GetKeyList: keylist is not readonly", keys.IsReadOnly);
- AssertEquals("sl.GetKeyList: incorrect keylist size",keys.Count,9);
- AssertEquals("sl.GetKeyList: incorrect key(1)",keys[3],1.4);
- sl1.Add(33.9,"ehhe");
- AssertEquals("sl.GetKeyList: incorrect keylist size",keys.Count,10);
- AssertEquals("sl.GetKeyList: incorrect key(2)",keys[8],33.9);
- }
-
- public void TestGetValueList() {
- SortedList sl1 = DefaultSL();
- IList originalvals = DefaultValues();
- IList vals = sl1.GetValueList();
- AssertNotNull("sl.GetValueList: does not return valuelist", vals);
- Assert("sl.GetValueList: valuelist is not readonly", vals.IsReadOnly);
- AssertEquals("sl.GetValueList: incorrect valuelist size",vals.Count,sl1.Count);
- for (int i=0; i<sl1.Count; i++) {
- AssertEquals("sl.GetValueList: incorrect key(1)",vals[i],originalvals[i]);
- }
-
- sl1.Add(0.01,"ehhe");
- AssertEquals("sl.GetValueList: incorrect valuelist size",vals.Count,10);
- AssertEquals("sl.GetValueList: incorrect value(2)",vals[8],"dog");
- }
-
- // TODO: IEnumerable.GetEnumerator [Explicit Interface Implementation]
- /*
- public void TestIEnumerable_GetEnumerator() {
- SortedList sl1 = DefaultSL();
- IEnumerator e = sl1.IEnumerable.GetEnumerator();
- AssertNotNull("sl.GetEnumerator: does not return enumerator", e);
- AssertEquals("sl.GetEnumerator: enumerator not working(1)",e.MoveNext(),true);
- AssertNotNull("sl.GetEnumerator: enumerator not working(2)",e.Current);
- }
- */
-
- public void TestIndexOfKey() {
- SortedList sl1 = new SortedList(24);
- string s=null;
- int t;
- for (int i = 0; i <= 50; i++) {
- s=string.Format("{0:D2}", i);
- sl1.Add("kala "+s,i);
- }
- AssertEquals("sl.IndexOfKey: does not return -1 for non-existing key",sl1.IndexOfKey("kala "),-1);
- s=null;
- try {
- t=sl1.IndexOfKey(s);
- Fail("sl.IndexOfKey: ArgumentNullException not caught, when key is null");
- }
- catch (ArgumentNullException) {}
- try {
- t=sl1.IndexOfKey(10);
- Fail("sl.IndexOfKey: InvalidOperationException not caught, when key invalid");
- }
- catch (InvalidOperationException) {}
- for (int i=0; i<=50; i++) {
- s=string.Format("{0:D2}", i);
- AssertEquals("sl.IndexOfKey: incorrect index key",sl1.IndexOfKey("kala "+s),i);
- }
- }
-
- public void TestIndexOfValue() {
- SortedList sl1 = new SortedList(24);
- string s=null;
- for (int i = 0; i < 50; i++) {
- s=string.Format("{0:D2}", i);
- sl1.Add("kala "+s,100+i*i);
- }
- for (int i = 0; i < 50; i++) {
- s=string.Format("{0:D2}", i+50);
- sl1.Add("kala "+s,100+i*i);
- }
- AssertEquals("sl.IndexOfValue: does not return -1 for non-existing value(1)",sl1.IndexOfValue(102),-1);
- AssertEquals("sl.IndexOfValue: does not return -1 for non-existing value(2)",sl1.IndexOfValue(null),-1);
- for (int i=0; i<50; i++) {
- AssertEquals("sl.IndexOfValue: incorrect index key",sl1.IndexOfValue(100+i*i),i);
- }
- }
-
-
- public void TestRemove() {
- SortedList sl1 = new SortedList(24);
- string s=null;
- int k;
- for (int i = 0; i < 50; i++) sl1.Add("kala "+i,i);
-
- try {
- sl1.Remove(s);
- Fail("sl.Remove: ArgumentNullException not caught, when key is null");
- } catch (ArgumentNullException) {}
- k=sl1.Count;
- sl1.Remove("kala ");
- AssertEquals("sl.Remove: removes an item, when non-existing key given",sl1.Count,k);
- try {
- sl1.Remove(15);
- Fail("sl.Remove: IComparer exception is not thrown");
- } catch (Exception) {}
-
- for (int i=15; i<20; i++) sl1.Remove("kala "+i);
- for (int i=45; i<55; i++) sl1.Remove("kala "+i);
-
- AssertEquals("sl.Remove: removing failed",sl1.Count,40);
- for (int i=45; i<55; i++)
- AssertEquals("sl.Remove: removing failed(2)",sl1["kala "+i],null);
- }
-
- public void TestRemoveAt() {
- SortedList sl1 = new SortedList(24);
- int k;
- string s=null;
- for (int i = 0; i < 50; i++) {
- s=string.Format("{0:D2}", i);
- sl1.Add("kala "+s,i);
- }
-
- try {
- sl1.RemoveAt(-1);
- Fail("sl.RemoveAt: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.RemoveAt(100);
- Fail("sl.RemoveAt: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
- k=sl1.Count;
-
- for (int i=0; i<20; i++) sl1.RemoveAt(9);
-
- AssertEquals("sl.RemoveAt: removing failed",sl1.Count,30);
- for (int i=0; i<9; i++)
- AssertEquals("sl.RemoveAt: removing failed(2)",sl1["kala "+string.Format("{0:D2}", i)],i);
- for (int i=9; i<29; i++)
- AssertEquals("sl.RemoveAt: removing failed(3)",sl1["kala "+string.Format("{0:D2}", i)],null);
- for (int i=29; i<50; i++)
- AssertEquals("sl.RemoveAt: removing failed(4)",sl1["kala "+string.Format("{0:D2}", i)],i);
- }
-
- public void TestSetByIndex() {
- SortedList sl1 = new SortedList(24);
- for (int i = 49; i>=0; i--) sl1.Add(100+i,i);
-
- try {
- sl1.SetByIndex(-1,77);
- Fail("sl.SetByIndex: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
- try {
- sl1.SetByIndex(100,88);
- Fail("sl.SetByIndex: ArgumentOutOfRangeException not caught, when key is out of range");
- } catch (ArgumentOutOfRangeException) {}
-
- for(int i=5; i<25; i++) sl1.SetByIndex(i,-1);
- for(int i=0; i<5; i++)
- AssertEquals("sl.SetByIndex: set failed(1)",sl1[100+i],i);
- for(int i=5; i<25; i++)
- AssertEquals("sl.SetByIndex: set failed(2)",sl1[100+i],-1);
- for(int i=25; i<50; i++)
- AssertEquals("sl.SetByIndex: set failed(3)",sl1[100+i],i);
-
- }
-
- public void TestTrimToSize() {
- SortedList sl1 = new SortedList(24);
-
- sl1.TrimToSize();
- AssertEquals("sl.TrimToSize: incorrect capacity after trimming empty list",icap,sl1.Capacity);
-
- for (int i = 72; i>=0; i--) sl1.Add(100+i,i);
- sl1.TrimToSize();
- AssertEquals("sl.TrimToSize: incorrect capacity after trimming a list",73,sl1.Capacity);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Collections/StackTest.cs b/mcs/class/corlib/Test/System.Collections/StackTest.cs
deleted file mode 100644
index fdcc3b07cce..00000000000
--- a/mcs/class/corlib/Test/System.Collections/StackTest.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// StackTest.cs
-//
-// Author:
-// Chris Hynes <chrish@assistedsolutions.com>
-//
-// (C) 2001 Chris Hynes
-//
-
-using System;
-
-using System.Collections;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
- public class StackTest: TestCase
- {
- private Stack stack1;
- private Stack stack2;
- private Stack stackInt;
-
- public void TestConstructor()
- {
- AssertEquals(false, stack1 == null);
- }
-
- public void TestICollectionConstructor()
- {
- Stack stackTest = new Stack(new int[] {0, 1, 2, 3, 4});
-
- for (int i = 4; i >= 0; i--)
- AssertEquals(i, stackTest.Pop());
-
- AssertEquals(0, stackTest.Count);
- }
-
- public void TestIntConstructor()
- {
- Stack stackTest = new Stack(50);
-
- AssertEquals(false, stackTest == null);
- }
-
- public void TestCount()
- {
- Stack stackTest = new Stack();
-
- stackTest.Push(50);
- stackTest.Push(5);
- stackTest.Push(0);
- stackTest.Push(50);
-
- AssertEquals(4, stackTest.Count);
- }
-
- public void TestIsSyncronized()
- {
- AssertEquals(false, stack1.IsSynchronized);
- AssertEquals(true, Stack.Synchronized(stack1).IsSynchronized);
- }
-
- public void TestSyncRoot()
- {
- AssertEquals(false, stack1.SyncRoot == null);
- }
-
- public void TestGetEnumerator()
- {
- stackInt.Pop();
-
- int j = 3;
-
- foreach (int i in stackInt)
- {
- AssertEquals(j--, i);
- }
-
- stackInt.Clear();
-
- IEnumerator e = stackInt.GetEnumerator();
-
- AssertEquals(false, e.MoveNext());
- }
-
- public void TestClear()
- {
- stackInt.Clear();
-
- AssertEquals(0, stackInt.Count);
- }
-
- public void TestClone()
- {
- Stack clone = (Stack)stackInt.Clone();
-
- while (stackInt.Count > 0)
- {
- AssertEquals(stackInt.Pop(), clone.Pop());
- }
- }
-
- public void TestContains()
- {
- string toLocate = "test";
-
- stackInt.Push(toLocate);
-
- stackInt.Push("chaff");
-
- Assert(stackInt.Contains(toLocate));
-
- stackInt.Pop();
-
- Assert(stackInt.Contains(toLocate));
-
- stackInt.Pop();
-
- Assert(!stackInt.Contains(toLocate));
- }
-
- public void TestCopyTo()
- {
- int[] arr = new int[stackInt.Count - 1];
- int[,] arrMulti;
-
- try
- {
- stackInt.CopyTo(null, 0);
- Fail("Should throw an ArgumentNullException");
- }
- catch (ArgumentNullException) {}
-
- try
- {
- stackInt.CopyTo(arr, -1);
- Fail("Should throw an ArgumentOutOfRangeException");
- }
- catch (ArgumentOutOfRangeException) {}
-
- try
- {
- stackInt.CopyTo(arrMulti = new int[1, 1], 1);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[2], 3);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[3], 2);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- try
- {
- stackInt.CopyTo(arr = new int[2], 3);
- Fail("Should throw an ArgumentException");
- }
- catch (ArgumentException) {}
-
- arr = new int[stackInt.Count];
-
- stackInt.CopyTo(arr, 0);
-
- int j = 4;
-
- for (int i = 0; i < 4; i++)
- {
- AssertEquals(j--, arr[i]);
- }
- }
-
- public void TestSyncronized()
- {
- Stack syncStack = Stack.Synchronized(stackInt);
-
- syncStack.Push(5);
-
- for (int i = 5; i >= 0; i--)
- AssertEquals(i, syncStack.Pop());
- }
-
- public void TestPushPeekPop()
- {
- stackInt.Pop();
-
- int topVal = (int)stackInt.Peek();
-
- AssertEquals(3, topVal);
-
- AssertEquals(4, stackInt.Count);
-
- AssertEquals(topVal, stackInt.Pop());
-
- AssertEquals(2, stackInt.Pop());
-
- Stack test = new Stack();
- test.Push(null);
-
- AssertEquals(null, test.Pop());
- }
-
- public void TestToArray()
- {
- object[] arr = stackInt.ToArray();
-
- AssertEquals(stackInt.Count, arr.Length);
-
- for (int i = 0; i < 5; i++)
- AssertEquals(arr[i], stackInt.Pop());
- }
-
- static void Main(string[] args)
- {
- //
- // TODO: Add code to start application here
- //
- }
-
- protected override void SetUp()
- {
- stack1 = new Stack();
- stack2 = new Stack();
-
- stackInt = new Stack();
-
- for (int i = 0; i < 5; i++)
- stackInt.Push(i);
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite stackSuite = new TestSuite();
-
- stackSuite.AddTest(new StackTest("TestConstructor"));
- stackSuite.AddTest(new StackTest("TestICollectionConstructor"));
- stackSuite.AddTest(new StackTest("TestIntConstructor"));
-
- stackSuite.AddTest(new StackTest("TestCount"));
- stackSuite.AddTest(new StackTest("TestIsSyncronized"));
- stackSuite.AddTest(new StackTest("TestSyncRoot"));
-
- stackSuite.AddTest(new StackTest("TestGetEnumerator"));
- stackSuite.AddTest(new StackTest("TestClear"));
- stackSuite.AddTest(new StackTest("TestClone"));
- stackSuite.AddTest(new StackTest("TestContains"));
- stackSuite.AddTest(new StackTest("TestPushPeekPop"));
- stackSuite.AddTest(new StackTest("TestCopyTo"));
- stackSuite.AddTest(new StackTest("TestSyncronized"));
- stackSuite.AddTest(new StackTest("TestToArray"));
-
- return stackSuite;
- }
- }
-
- public StackTest() : base ("MonoTests.System.Collections.StackTest testcase") {}
- public StackTest(string name): base(name) {}
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs b/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs
deleted file mode 100644
index d6eab84474c..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/AllTests.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(DebugTest.Suite);
- suite.AddTest(StackTraceTest.Suite);
- suite.AddTest(StackFrameTest.Suite);
- suite.AddTest(TextWriterTraceListenerTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog b/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
deleted file mode 100644
index cd80e678c90..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add missing test: DebugTest
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * DebugTest.cs: Put in correct namespace.
- * TextWriterTraceListenerTest.cs: Put in correct namespace. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs b/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs
deleted file mode 100644
index 5d620ea5813..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/DebugTest.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// MonoTests.System.Diagnostics.DebugTest.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2002
-using System;
-using System.Diagnostics;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics
-{
- public class DebugTest
- {
- private DebugTest()
- {
-
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(DebugTest1.Suite);
- return suite;
- }
- }
-
- private class DebugTest1 : TestCase
- {
- public DebugTest1(string name) : base(name)
- {
-
- }
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(DebugTest1));
- }
- }
-
- protected override void SetUp()
- {
- Debug.Listeners.Add(new TextWriterTraceListener(Console.Error));
- }
-
- protected override void TearDown()
- {
-
- }
-
- public void TestAssert()
- {
- Debug.Assert(false, "Testing Assertions");
- }
-
- public void TestFail()
- {
- Debug.Fail("Testing Fail method");
- }
-
- public void TestWrite()
- {
- Debug.Write("Testing Write", "Testing the output of the Write method");
- }
-
- public void TestWriteIf()
- {
- Debug.WriteIf(true, "Testing WriteIf");
- Debug.WriteIf(false, "Testing WriteIf", "Passed false");
- }
-
- public void TestWriteLine()
- {
- Debug.WriteLine("Testing WriteLine method");
- }
-
- public void TestWriteLineIf()
- {
- Debug.WriteLineIf(true, "Testing WriteLineIf");
- Debug.WriteLineIf(false, "Testing WriteLineIf", "Passed false");
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
deleted file mode 100644
index ce35039c1a4..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/StackFrameTest.cs
+++ /dev/null
@@ -1,350 +0,0 @@
-//
-// MonoTests.System.Diagnostics.StackFrameTest.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Diagnostics;
-using System.Reflection;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- public class StackFrameTest {
- private StackFrameTest() {}
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(StackFrameTest1.Suite);
- suite.AddTest(StackFrameTest2.Suite);
- suite.AddTest(StackFrameTest3.Suite);
- return suite;
- }
- }
-
- /// <summary>
- /// Tests the case where StackFrame is created for specified file name and
- /// location inside it.
- /// </summary>
- private class StackFrameTest1 : TestCase {
- public StackFrameTest1(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest1));
- }
- }
-
- protected override void SetUp() {
- frame1 = new StackFrame("dir/someFile", 13, 45);
- frame2 = new StackFrame("SomeFile2.cs", 24);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertEquals("File name (1)",
- "dir/someFile",
- frame1.GetFileName());
-
- AssertEquals("File name (2)",
- "SomeFile2.cs",
- frame2.GetFileName());
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 13,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 24,
- frame2.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 45,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 0,
- frame2.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)", (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- this.GetType(),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "SetUp",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)", (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
- }
- }
-
- /// <summary>
- /// Tests the case where StackFrame is created for current method.
- /// </summary>
- /// <remarks>
- /// FIXME: Must be compiled with /debug switch. Otherwise some file
- /// information will be incorrect for the following test cases.
- /// What's the best way to do both types of tests with and without
- /// debug information?
- /// </remarks>
- private class StackFrameTest2 : TestCase {
- public StackFrameTest2(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
- private StackFrame frame3;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest2));
- }
- }
-
- protected override void SetUp() {
- frame1 = new StackFrame();
- frame2 = new StackFrame(true);
- frame3 = new StackFrame(0);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- frame3 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertNull("File name (1)",
- frame1.GetFileName());
-
- Assert("File name (2) " + frame2.GetFileName()
- + " ends with StackFrameTest.cs",
- frame2.GetFileName().EndsWith("StackFrameTest.cs"));
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 0,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 154,
- frame2.GetFileLineNumber());
-
- AssertEquals("Line number (3)",
- 0,
- frame3.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 0,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 25,
- frame2.GetFileColumnNumber());
-
- AssertEquals("Column number (3)",
- 0,
- frame3.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)",
- (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- this.GetType(),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "SetUp",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)",
- (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
-
- Assert("Method not null (3)",
- (frame3.GetMethod() != null));
-
- AssertEquals("Class declaring the method (3)",
- this.GetType(),
- frame3.GetMethod().DeclaringType);
- AssertEquals("Method name (3)",
- "SetUp",
- frame3.GetMethod().Name);
- }
- }
-
-
- /// <summary>
- /// Tests the case where StackFrame is created for current method but
- /// skipping some frames.
- /// </summary>
- /// <remarks>
- /// FIXME: Must be compiled with /debug switch. Otherwise some file
- /// information will be incorrect for the following test cases.
- /// What's the best way to do both types of tests with and without
- /// debug information?
- /// </remarks>
- private class StackFrameTest3 : TestCase {
- public StackFrameTest3(string name) : base(name) {}
-
- private StackFrame frame1;
- private StackFrame frame2;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackFrameTest3));
- }
- }
-
- protected override void SetUp() {
- // In order to get better test cases with stack traces
- NestedSetUp();
- }
-
- private void NestedSetUp() {
- frame1 = new StackFrame(2);
- frame2 = new StackFrame(1, true);
- }
-
- protected override void TearDown() {
- frame1 = null;
- frame2 = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting file name works.
- /// </summary>
- public void TestGetFileName() {
- AssertNull("File name (1)",
- frame1.GetFileName());
-
- Assert("File name (2) " + frame2.GetFileName()
- + " ends with StackFrameTest.cs",
- frame2.GetFileName().EndsWith("StackFrameTest.cs"));
- }
-
- /// <summary>
- /// Tests whether getting file line number works.
- /// </summary>
- public void TestGetFileLineNumber() {
- AssertEquals("Line number (1)",
- 0,
- frame1.GetFileLineNumber());
-
- AssertEquals("Line number (2)",
- 277,
- frame2.GetFileLineNumber());
- }
-
- /// <summary>
- /// Tests whether getting file column number works.
- /// </summary>
- public void TestGetFileColumnNumber() {
- AssertEquals("Column number (1)",
- 0,
- frame1.GetFileColumnNumber());
-
- AssertEquals("Column number (2)",
- 17,
- frame2.GetFileColumnNumber());
- }
-
-
- /// <summary>
- /// Tests whether getting method associated with frame works.
- /// </summary>
- public void TestGetMethod() {
- Assert("Method not null (1)", (frame1.GetMethod() != null));
-
- AssertEquals("Class declaring the method (1)",
- typeof(NUnit.Framework.TestCase),
- frame1.GetMethod().DeclaringType);
- AssertEquals("Method name (1)",
- "RunBare",
- frame1.GetMethod().Name);
-
- Assert("Method not null (2)", (frame2.GetMethod() != null));
-
- AssertEquals("Class declaring the method (2)",
- this.GetType(),
- frame2.GetMethod().DeclaringType);
- AssertEquals("Method name (2)",
- "SetUp",
- frame2.GetMethod().Name);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs b/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs
deleted file mode 100644
index 84a7b4876a6..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/StackTraceTest.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// MonoTests.System.Diagnostics.StackTraceTest.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using System.Diagnostics;
-using System.Reflection;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics {
- public class StackTraceTest {
- private StackTraceTest() {}
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(StackTraceTest1.Suite);
- return suite;
- }
- }
-
- /// <summary>
- /// Tests the case where StackTrace is created for specified
- /// stack frame.
- /// </summary>
- private class StackTraceTest1 : TestCase {
- public StackTraceTest1(string name) : base(name) {}
-
- private StackTrace trace;
- private StackFrame frame;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(StackTraceTest1));
- }
- }
-
- protected override void SetUp() {
- frame = new StackFrame("dir/someFile",
- 13,
- 45);
- trace = new StackTrace(frame);
- }
-
- protected override void TearDown() {
- trace = null;
- }
-
-
-
- /// <summary>
- /// Tests whether getting number of frames works.
- /// </summary>
- public void TestFrameCount() {
- AssertEquals("Frame count",
- 1,
- trace.FrameCount);
- }
-
- /// <summary>
- /// Tests whether getting frames by index which is out of
- /// range works.
- /// </summary>
- public void TestGetFrameOutOfRange() {
- Assert("Frame with index -1 == null",
- (trace.GetFrame(-1) == null));
-
- Assert("Frame with index -129 = null",
- (trace.GetFrame(-129) == null));
-
- Assert("Frame with index 1 = null",
- (trace.GetFrame(1) == null));
-
- Assert("Frame with index 145 = null",
- (trace.GetFrame(145) == null));
-
- }
-
-
- /// <summary>
- /// Tests whether getting frames by index works.
- /// </summary>
- public void TestGetFrame() {
- AssertEquals("Frame with index 0",
- frame,
- trace.GetFrame(0));
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs b/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs
deleted file mode 100644
index c7cc8e35b90..00000000000
--- a/mcs/class/corlib/Test/System.Diagnostics/TextWriterTraceListenerTest.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// MonoTests.System.Diagnostics.TextWriterTraceListenerTest.cs
-//
-// Author:
-// John R. Hicks (angryjohn69@nc.rr.com)
-//
-// (C) 2001
-
-using System;
-using System.IO;
-using System.Text;
-using System.Diagnostics;
-using NUnit.Framework;
-
-namespace MonoTests.System.Diagnostics
-{
-
- public class TextWriterTraceListenerTest
- {
- private TextWriterTraceListenerTest()
- {
-
- }
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(TextWriterTraceListenerTest1.Suite);
- return suite;
- }
- }
-
- private class TextWriterTraceListenerTest1 : TestCase
- {
- public TextWriterTraceListenerTest1(string name) : base(name)
- {
- }
-
- private TextWriterTraceListener listener;
-
- internal static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(TextWriterTraceListenerTest1));
- }
- }
-
- protected override void SetUp()
- {
- listener = new TextWriterTraceListener();
- listener.Writer = Console.Out;
- }
-
- protected override void TearDown()
- {
- listener = null;
- }
-
- public void TestWrite()
- {
- Assert("Null Listener", !(listener == null));
- Assert("Null Writer", !(listener.Writer == null));
- listener.Write("Test Message\n");
-
- }
-
- public void TestWriteLine()
- {
- Assert("Null Listener", !(listener == null));
- Assert("Null Writer", !(listener.Writer == null));
- listener.WriteLine("Test WriteLine Message");
- }
-
- public void TestFlush()
- {
- listener.Flush();
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Globalization/AllTests.cs b/mcs/class/corlib/Test/System.Globalization/AllTests.cs
deleted file mode 100644
index 7d80e617556..00000000000
--- a/mcs/class/corlib/Test/System.Globalization/AllTests.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// System.Globalization/AllTests.cs
-//
-// (C) 2002 Ulrich Kunitz
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Globalization {
-
-/// <summary>
-/// Combines all available unit tests into one test suite.
-/// </summary>
-public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(CalendarTest.Suite);
- return suite;
- }
- }
-} // class AllTests
-
-} // namespace MonoTests.System.Globalization
diff --git a/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs b/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs
deleted file mode 100644
index 83d6b68ea91..00000000000
--- a/mcs/class/corlib/Test/System.Globalization/CalendarTest.cs
+++ /dev/null
@@ -1,602 +0,0 @@
-// CalendarTest.cs
-//
-// (C) 2002 Ulrich Kunitz
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.IO;
-
-namespace MonoTests.System.Globalization
-{
-
-sealed class Date {
- private int _day, _month, _year, _era;
-
- public int Day {
- get {
- return _day;
- }
- set {
- if (value < 1 || value > 31)
- throw new ArgumentOutOfRangeException(
- "Day",
- "Day must be between 1 and 31.");
- _day = value;
- }
- }
-
- public int Month {
- get {
- return _month;
- }
- set {
- if (value < 1 || value > 13)
- throw new ArgumentOutOfRangeException(
- "Month",
- "Month must be between 1 and 13.");
- _month = value;
- }
- }
-
- public int Year {
- get {
- return _year;
- }
- set {
- _year = value;
- }
- }
-
- public int Era {
- get {
- return _era;
- }
- set {
- if (value < 1 || value > 10)
- throw new ArgumentOutOfRangeException(
- "Era",
- "Era must be between 1 and 10.");
- _era = value;
- }
- }
-
- public Date(int day, int month, int year, int era) {
- Day = day;
- Month = month;
- Year = year;
- Era = era;
- }
- public Date(int day, int month, int year) : this(day,month,year,1) {}
- public Date() : this(1,1,1,1) {}
-
- public DateTime ToDateTime(Calendar cal) {
- return cal.ToDateTime(Year,Month,Day,0,0,0,0,Era);
- }
-
- public void FromDateTime(Calendar cal, DateTime time) {
- Date dmy = new Date();
- dmy.Day = cal.GetDayOfMonth(time);
- dmy.Month = cal.GetMonth(time);
- dmy.Year = cal.GetYear(time);
- dmy.Era = cal.GetEra(time);
- Day = dmy.Day;
- Month = dmy.Month;
- Year = dmy.Year;
- Era = dmy.Era;
- }
-
- public override string ToString() {
- StringWriter sw = new StringWriter();
- sw.Write("{0}.{1}.{2}", Day, Month, Year);
- if (Era != 1) {
- sw.Write(" era {0}", Era);
- }
- return sw.ToString();
- }
-
- public override bool Equals(Object b) {
- if (b == null || GetType() != b.GetType())
- return false;
- return Equals(this, (Date)b);
- }
-
- public static bool Equals(Date a, Date b) {
- if (a == b)
- return true;
- if (a.Year != b.Year)
- return false;
- if (a.Month != b.Month)
- return false;
- if (a.Day != b.Day)
- return false;
- if (a.Era != b.Era)
- return false;
- return true;
- }
-
- public override int GetHashCode() {
- return ToString().GetHashCode();
- }
-} // class Date
-
-public class CalendarTest : TestCase {
- public CalendarTest() : base("System.Globalization.CalendarTest") {}
- public CalendarTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CalendarTest));
- }
- }
-
- private Calendar[] acal;
- private GregorianCalendar gcal;
- private JulianCalendar jucal;
- private HijriCalendar hical;
- private HebrewCalendar hecal;
- private JapaneseCalendar jacal;
- private TaiwanCalendar tacal;
- private KoreanCalendar kcal;
- private ThaiBuddhistCalendar tbcal;
-
- protected override void SetUp() {
- gcal = new GregorianCalendar();
- jucal = new JulianCalendar();
- hical = new HijriCalendar();
- hecal = new HebrewCalendar();
- jacal = new JapaneseCalendar();
- tacal = new TaiwanCalendar();
- kcal = new KoreanCalendar();
- tbcal = new ThaiBuddhistCalendar();
- acal = new Calendar[] {
- gcal, jucal, hical, hecal, jacal,
- tacal, kcal, tbcal};
- }
-
- private void RowCheck(params Date[] adate) {
- if (adate.Length != acal.Length)
- throw new ArgumentException(
- "Number of Date arguments doesn't match " +
- "length of calendar array.");
-
- DateTime timeG = adate[0].ToDateTime(gcal);
- for (int i = 0; i < acal.Length; i++) {
- Date date = adate[i];
- if (date == null)
- continue;
- Calendar cal = acal[i];
-
- DateTime time = date.ToDateTime(cal);
- StringWriter sw = new StringWriter();
- sw.Write("Calendar {0} computes wrong DateTime.",
- cal);
- AssertEquals(sw.ToString(), timeG, time);
-
- sw = new StringWriter();
- Date ndate = new Date();
- ndate.FromDateTime(cal, time);
- sw.Write("Calendar {0} computes wrong date", cal);
- AssertEquals(sw.ToString(), date, ndate);
- }
- }
-
- // We are testing the implementation against the reference dates in
- // Calendrical Calcualation. Please note that the CLR uses another
- // epoch for the HijriCalendar, which might be the perfect thing
- // to do.
- public void TestCCTable() {
- // Gr Ju Hi He Ja Ta Ko TB
- RowCheck(new Date(24,9,70,1),
- new Date(26,9,70,1),
- null,
- null,
- null,
- null,
- new Date(24,9,2403,1),
- new Date(24,9,613,1));
- RowCheck(new Date(2,10,135,1),
- new Date(3,10,135,1),
- null,
- null,
- null,
- null,
- new Date(2,10,2468,1),
- new Date(2,10,678,1));
- RowCheck(new Date(8,1,470,1),
- new Date(7,1,470,1),
- null,
- null,
- null,
- null,
- new Date(8,1,2803,1),
- new Date(8,1,1013,1));
- RowCheck(new Date(20,5,576,1),
- new Date(18,5,576,1),
- null,
- null,
- null,
- null,
- new Date(20,5,2909,1),
- new Date(20,5,1119,1));
- RowCheck(new Date(10,11,694,1),
- new Date(7,11,694,1),
- new Date(14,7,75,1),
- null,
- null,
- null,
- new Date(10,11,3027,1),
- new Date(10,11,1237,1));
- RowCheck(new Date(25,4,1013,1),
- new Date(19,4,1013,1),
- new Date(6,10,403,1),
- null,
- null,
- null,
- new Date(25,4,3346,1),
- new Date(25,4,1556,1));
- RowCheck(new Date(24,5,1096,1),
- new Date(18,5,1096,1),
- new Date(23,5,489,1),
- null,
- null,
- null,
- new Date(24,5,3429,1),
- new Date(24,5,1639,1));
- RowCheck(new Date(23,3,1190,1),
- new Date(16,3,1190,1),
- new Date(8,2,586,1),
- null,
- null,
- null,
- new Date(23,3,3523,1),
- new Date(23,3,1733,1));
- RowCheck(new Date(10,3,1240,1),
- new Date(3,3,1240,1),
- new Date(8,8,637,1),
- null,
- null,
- null,
- new Date(10,3,3573,1),
- new Date(10,3,1783,1));
- RowCheck(new Date(2,4,1288,1),
- new Date(26,3,1288,1),
- new Date(21,2,687,1),
- null,
- null,
- null,
- new Date(2,4,3621,1),
- new Date(2,4,1831,1));
- RowCheck(new Date(27,4,1298,1),
- new Date(20,4,1298,1),
- new Date(8,7,697,1),
- null,
- null,
- null,
- new Date(27,4,3631,1),
- new Date(27,4,1841,1));
- RowCheck(new Date(12,6,1391,1),
- new Date(4,6,1391,1),
- new Date(2,7,793,1),
- null,
- null,
- null,
- new Date(12,6,3724,1),
- new Date(12,6,1934,1));
- RowCheck(new Date(3,2,1436,1),
- new Date(25,1,1436,1),
- new Date(7,7,839,1),
- null,
- null,
- null,
- new Date(3,2,3769,1),
- new Date(3,2,1979,1));
- RowCheck(new Date(9,4,1492,1),
- new Date(31,3,1492,1),
- new Date(2,6,897,1),
- null,
- null,
- null,
- new Date(9,4,3825,1),
- new Date(9,4,2035,1));
- RowCheck(new Date(19,9,1553,1),
- new Date(9,9,1553,1),
- new Date(1,10,960,1),
- null,
- null,
- null,
- new Date(19,9,3886,1),
- new Date(19,9,2096,1));
- RowCheck(new Date(5,3,1560,1),
- new Date(24,2,1560,1),
- new Date(28,5,967,1),
- null,
- null,
- null,
- new Date(5,3,3893,1),
- new Date(5,3,2103,1));
- RowCheck(new Date(10,6,1648,1),
- new Date(31,5,1648,1),
- new Date(19,5,1058,1),
- new Date(20,9,5408,1),
- null,
- null,
- new Date(10,6,3981,1),
- new Date(10,6,2191,1));
- RowCheck(new Date(30,6,1680,1),
- new Date(20,6,1680,1),
- new Date(3,6,1091,1),
- new Date(3,11,5440,1),
- null,
- null,
- new Date(30,6,4013,1),
- new Date(30,6,2223,1));
- RowCheck(new Date(24,7,1716,1),
- new Date(13,7,1716,1),
- new Date(5,8,1128,1),
- new Date(5,11,5476,1),
- null,
- null,
- new Date(24,7,4049,1),
- new Date(24,7,2259,1));
- RowCheck(new Date(19,6,1768,1),
- new Date(8,6,1768,1),
- new Date(4,2,1182,1),
- new Date(4,10,5528,1),
- null,
- null,
- new Date(19,6,4101,1),
- new Date(19,6,2311,1));
- RowCheck(new Date(2,8,1819,1),
- new Date(21,7,1819,1),
- new Date(11,10,1234,1),
- new Date(11,11,5579,1),
- null,
- null,
- new Date(2,8,4152,1),
- new Date(2,8,2362,1));
- RowCheck(new Date(27,3,1839,1),
- new Date(15,3,1839,1),
- new Date(12,1,1255,1),
- new Date(12,7,5599,1),
- null,
- null,
- new Date(27,3,4172,1),
- new Date(27,3,2382,1));
- RowCheck(new Date(19,4,1903,1),
- new Date(6,4,1903,1),
- new Date(22,1,1321,1),
- new Date(22,7,5663,1),
- new Date(19,4,36,1),
- null,
- new Date(19,4,4236,1),
- new Date(19,4,2446,1));
- RowCheck(new Date(25,8,1929,1),
- new Date(12,8,1929,1),
- new Date(20,3,1348,1),
- new Date(19,12,5689,1),
- new Date(25,8,4,3),
- new Date(25,8,18,1),
- new Date(25,8,4262,1),
- new Date(25,8,2472,1));
- RowCheck(new Date(29,9,1941,1),
- new Date(16,9,1941,1),
- new Date(9,9,1360,1),
- new Date(8,1,5702,1),
- new Date(29,9,16,3),
- new Date(29,9,30,1),
- new Date(29,9,4274,1),
- new Date(29,9,2484,1));
- RowCheck(new Date(19,4,1943,1),
- new Date(6,4,1943,1),
- new Date(14,4,1362,1),
- new Date(14,8,5703,1),
- new Date(19,4,18,3),
- new Date(19,4,32,1),
- new Date(19,4,4276,1),
- new Date(19,4,2486,1));
- RowCheck(new Date(7,10,1943,1),
- new Date(24,9,1943,1),
- new Date(8,10,1362,1),
- new Date(8,1,5704,1),
- new Date(7,10,18,3),
- new Date(7,10,32,1),
- new Date(7,10,4276,1),
- new Date(7,10,2486,1));
- RowCheck(new Date(17,3,1992,1),
- new Date(4,3,1992,1),
- new Date(14,9,1412,1),
- new Date(12,7,5752,1),
- new Date(17,3,4,4),
- new Date(17,3,81,1),
- new Date(17,3,4325,1),
- new Date(17,3,2535,1));
- RowCheck(new Date(25,5,1996,1),
- new Date(12,5,1996,1),
- new Date(8,1,1417,1),
- new Date(7,9,5756,1),
- new Date(25,5,8,4),
- new Date(25,5,85,1),
- new Date(25,5,4329,1),
- new Date(25,5,2539,1));
- RowCheck(new Date(10,11,2038,1),
- new Date(28,10,2038,1),
- new Date(13,10,1460,1),
- new Date(12,2,5799,1),
- new Date(10,11,50,4),
- new Date(10,11,127,1),
- new Date(10,11,4371,1),
- new Date(10,11,2581,1));
- RowCheck(new Date(18,7,2094,1),
- new Date(5,7,2094,1),
- new Date(6,3,1518,1),
- new Date(5,11,5854,1),
- new Date(18,7,106,4),
- new Date(18,7,183,1),
- new Date(18,7,4427,1),
- new Date(18,7,2637,1));
- }
-
- public void TestCalendarType() {
- GregorianCalendar gc = new GregorianCalendar(
- GregorianCalendarTypes.Arabic);
- AssertEquals("A01 Gregorian ctor " +
- "with GregorianCalendarTypes parameter",
- GregorianCalendarTypes.Arabic,
- gc.CalendarType);
- gc.CalendarType = GregorianCalendarTypes.MiddleEastFrench;
- AssertEquals("A02 GregorianCalendar.CalendarType",
- GregorianCalendarTypes.MiddleEastFrench,
- gc.CalendarType);
- }
-
- public void TestStandardEras() {
- AssertEquals("B01 ADEra", 1, GregorianCalendar.ADEra);
- AssertEquals("B02 HebrewEra", 1, HebrewCalendar.HebrewEra);
- AssertEquals("B03 HjriEra", 1, HijriCalendar.HijriEra);
- AssertEquals("B04 JulianEra", 1, JulianCalendar.JulianEra);
- AssertEquals("B05 KoreanEra", 1, KoreanCalendar.KoreanEra);
- AssertEquals("B06 ThaiBuddhistEra", 1,
- ThaiBuddhistCalendar.ThaiBuddhistEra);
- }
-
- public void TestCurrentEra() {
- AssertEquals("C01 GregorianCalendar.CurrentEra",
- 0, GregorianCalendar.CurrentEra);
- AssertEquals("C02 HebrewCalendar.CurrentEra",
- 0, HebrewCalendar.CurrentEra);
- AssertEquals("C03 HijriCalendar.CurrentEra",
- 0, HijriCalendar.CurrentEra);
- AssertEquals("C04 JapaneseCalendar.CurrentEra",
- 0, JapaneseCalendar.CurrentEra);
- AssertEquals("C05 JulianCalendar.CurrentEra",
- 0, JulianCalendar.CurrentEra);
- AssertEquals("C06 KoreanCalendar.CurrentEra",
- 0, KoreanCalendar.CurrentEra);
- AssertEquals("C07 TaiwanCalendar.CurrentEra",
- 0, TaiwanCalendar.CurrentEra);
- AssertEquals("C08 ThaiBuddhistCalendar.CurrentEra",
- 0,
- ThaiBuddhistCalendar.CurrentEra);
- }
-
- public void TestErasProperty() {
- foreach (Calendar cal in acal) {
- int check = 1;
- if (cal is JapaneseCalendar)
- check = 4;
- AssertEquals(String.Format("D01 {0}.Eras.Length", cal),
- check, cal.Eras.Length);
- cal.Eras[0] = 29;
- Assert(String.Format("D02 {0}.Eras readonly", cal),
- cal.Eras[0] != 29);
- }
- }
-
- public void TestTwoDigitYearMax() {
- AssertEquals("E01 TwoDigitYearMax GregorianCalendar",
- 2029, gcal.TwoDigitYearMax);
- AssertEquals("E02 TwoDigitYearMax HebrewCalendar",
- 5790, hecal.TwoDigitYearMax);
- AssertEquals("E03 TwoDigitYearMax HijriCalendar",
- 1451, hical.TwoDigitYearMax);
- AssertEquals("E04 TwoDigitYearMax JapaneseCalendar",
- 99, jacal.TwoDigitYearMax);
- AssertEquals("E05 TwoDigitYearMax JulianCalendar",
- 2029, jucal.TwoDigitYearMax);
- AssertEquals("E06 TwoDigitYearMax KoreanCalendar",
- 4362, kcal.TwoDigitYearMax);
- AssertEquals("E07 TwoDigitYearMax TaiwanCalendar",
- 99, tacal.TwoDigitYearMax);
- AssertEquals("E08 TwoDigitYearMax ThaiBuddhistCalendar",
- 2572, tbcal.TwoDigitYearMax);
- foreach (Calendar cal in acal) {
- bool exception = false;
- try {
- cal.TwoDigitYearMax = 99;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert(String.Format("E09 {0}.TwoDigitYearMax 99 " +
- " out of range exception", cal),
- exception);
-
- exception = false;
- int m = 10000;
- try {
- m = cal.GetYear(DateTime.MaxValue)+1;
- cal.TwoDigitYearMax = m;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert(String.Format("E10 {0}.TwoDigitYearMax out " +
- " of range exception value {1}",
- cal, m),
- exception);
- }
- }
-
- /* UK TODO: breaks with current DateTime implementation.
- * I've a newer one that works, but that requires to much changes.
- * for now.
- public void TestToFourDigitYear() {
- foreach (Calendar cal in acal) {
- bool working = true;
- int mod = 2000;
- if (cal is HebrewCalendar)
- mod = 5500;
- if (cal is KoreanCalendar)
- mod = 3000;
- if (cal is JapaneseCalendar)
- working = false;
- if (cal is TaiwanCalendar)
- working = false;
- cal.TwoDigitYearMax = mod + 229;
- AssertEquals(
- String.Format("F01 {0}.TwoDigitYearMax", cal),
- mod+229 , cal.TwoDigitYearMax);
- AssertEquals(
- String.Format("F02 {0}.ToFourDigitYear(29)",
- cal),
- working ? mod+229 : 29,
- cal.ToFourDigitYear(29));
- AssertEquals(
- String.Format("F03 {0}.ToFourDigitYear(30)",
- cal),
- working ? mod+130 : 30,
- cal.ToFourDigitYear(30));
- AssertEquals(
- String.Format("F04 {0}.ToFourDigitYear({1})",
- cal, mod),
- mod, cal.ToFourDigitYear(mod));
- bool exception = false;
- try {
- cal.ToFourDigitYear(-1);
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert(String.Format(
- "F05 {0}.ToFourDigitYear(-1) exception",
- cal), exception);
- exception = false;
- try {
- cal.ToFourDigitYear(15000);
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert(String.Format(
- "F05 {0}.ToFourDigitYear(15000) exception",
- cal), exception);
- }
- }
- */
-
- // TODO: more tests :-)
-} // class CalendarTest
-
-} // namespace MonoTests.System.Globalization
diff --git a/mcs/class/corlib/Test/System.IO/AllTests.cs b/mcs/class/corlib/Test/System.IO/AllTests.cs
deleted file mode 100644
index 16858d83b05..00000000000
--- a/mcs/class/corlib/Test/System.IO/AllTests.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.IO {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(MemoryStreamTest.Suite);
- suite.AddTest(StreamReaderTest.Suite);
- suite.AddTest(StreamWriterTest.Suite);
- suite.AddTest(PathTest.Suite);
- suite.AddTest(StringReaderTest.Suite);
- suite.AddTest(StringWriterTest.Suite);
- suite.AddTest(FileTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.IO/ChangeLog b/mcs/class/corlib/Test/System.IO/ChangeLog
deleted file mode 100644
index ecf65195013..00000000000
--- a/mcs/class/corlib/Test/System.IO/ChangeLog
+++ /dev/null
@@ -1,95 +0,0 @@
-2002-06-12 Nick Drochak <ndrochak@gol.com>
-
- * StringReaderTest.cs: Regression test for a bug that we had were
- ReadLine() was not returning null when the string ended with newline.
-
-2002-05-15 Nick Drochak <ndrochak@gol.com>
-
- * StreamReaderTest.cs:
- * StreamWriterTest.cs:
- Make sure invalid file name has invalid characters in it. These are
- platform dependant.
-
-2002-05-14 Nick Drochak <ndrochak@gol.com>
-
- * FileTest.cs: Delete temporary files after each test method; Catch
- unexpected exceptions and report them; Make some Assert messages
- unique; Make sure temp files exist before trying Move and Delete, etc.
-
-2002-05-13 Mike Gray <mike@mikegray.org>
-
- * FileTest.cs: Adding better tests for File.Delete, File.Move
-
-2002-05-12 Mike Gray <mike@mikegray.org>
-
- * FileTest.cs: Adding better tests for File.Exists, File.Create,
- and File.Copy
-
-2002-05-12 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Add a couple more tests.
- * PathTest.cs: Make tests work a bit better on W32 and Linux.
-
-2002/05/10 Nick Drochak <ndrochak@gol.com>
-
- * StreamWriterTest.cs: Use "resources" directory and use OS friendly
- directory separator characters. This makes the tests run correctly
- against MS.NET, but not yet in mono on Linux.
-
-2002/05/08 Nick Drochak <ndrochak@gol.com>
-
- * FileTest.cs: Use "resources" directory and use OS friendly
- directory separator characters. This makes the tests run correctly
- against MS.NET, but not yet in mono on Linux.
-
-2002-05-08 Nick Drochak <ndrochak@gol.com>
-
- * StreamWriter.cs: Wrap a try-catch around block of code to find out
- what exception is being thrown when it shouldn't.
-
-2002-05-07 Nick Drochak <ndrochak@gol.com>
-
- * FileTest.cs: Added TestOpen() from Mike Gray.
- * AllTests.cs: Added missing FileTest.Suite as pointed out by Mike
- as well.
-
-2002-05-05 Nick Drochak <ndrochak@gol.com>
-
- * StreamReaderTest.cs: Change location of sample file. In some places,
- use memory stream instead of file stream to eliminate reliance on file
- io for now. That area is still a bit immature. Added a bunch of
- markers to tell where errors were occuring.
-
- * resources: New directory to hold files open/read, etc. by unit
- tests.
-
-2002-05-01 Nick Drochak <ndrochak@gol.com>
-
- * StreamReaderTest.cs:
- * StreamWriterTest.cs: Catch and display exception info where it wasn't
- being caught before.
-
-2002-03-02 Jason Diamond <jason@injektilo.org>
-
- * StringReader.cs: Added test for peeking and reading at the end of
- a string.
-
-2002-02-28 Nick Drochak <ndrochak@gol.com>
-
- * MemoryStreamTest.cs
- * StreamWriterTest.cs
- * StringReaderTest.cs: Fix test bugs found by running against mscorlib.
- AssertEquals() requires the expected and atual values to be the same
- type if they are to be considered equal.
-
-2002-02-05 Duncan Mak <duncan@ximian.com>
-
- * FileTest.cs: Added to CVS. However, this portion of the code
- can't be tested right now.
-
-2002-01-20 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: removed duplicate MemoryStream test
- * MemoryStreamTest.cs: wrapped try-catch blocks around read/write/seek
- tests. These were throwing exceptions that NUnit wasn't catching. I
- don't think it used to behave this way before .NET.1.0. \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.IO/FileTest.cs b/mcs/class/corlib/Test/System.IO/FileTest.cs
deleted file mode 100644
index 210e7f6eb85..00000000000
--- a/mcs/class/corlib/Test/System.IO/FileTest.cs
+++ /dev/null
@@ -1,441 +0,0 @@
-//
-// FileTest.cs: Test cases for System.IO.File
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-namespace MonoTests.System.IO
-{
- public class FileTest : TestCase
- {
- public FileTest ()
- : base ("System.IO.File testsuite")
- {
- }
-
- public FileTest (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- }
-
- protected override void TearDown ()
- {
- File.Delete ("resources" + Path.DirectorySeparatorChar + "baz");
- File.Delete ("resources" + Path.DirectorySeparatorChar + "bar");
- File.Delete ("resources" + Path.DirectorySeparatorChar + "foo");
- }
-
- public static ITest Suite
- {
- get { return new TestSuite (typeof (FileTest)); }
- }
-
- public void TestExists ()
- {
- int i = 0;
- try {
- Assert ("null filename should not exist", !File.Exists (null));
- i++;
- Assert ("empty filename should not exist", !File.Exists (""));
- i++;
- Assert ("whitespace filename should not exist", !File.Exists (" \t\t \t \n\t\n \n"));
- i++;
- Assert ("File resources" + Path.DirectorySeparatorChar + "AFile.txt should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "AFile.txt"));
- i++;
- Assert ("File resources" + Path.DirectorySeparatorChar + "doesnotexist should not exist", !File.Exists ("resources" + Path.DirectorySeparatorChar + "doesnotexist"));
- } catch (Exception e) {
- Fail ("Unexpected exception at i = " + i + ". e=" + e);
- }
- }
-
- public void TestCreate ()
- {
- FileStream stream;
-
- /* exception test: File.Create(null) */
- try {
- stream = File.Create (null);
- Fail ("File.Create(null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create(null) unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Create("") */
- try {
- stream = File.Create ("");
- Fail ("File.Create('') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create('') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Create(" ") */
- try {
- stream = File.Create (" ");
- Fail ("File.Create(' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create(' ') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Create(directory_not_found) */
- try {
- stream = File.Create ("directory_does_not_exist" + Path.DirectorySeparatorChar + "foo");
- Fail ("File.Create(directory_does_not_exist) should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Create(directory_does_not_exist) unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* positive test: create resources/foo */
- try {
- stream = File.Create ("resources" + Path.DirectorySeparatorChar + "foo");
- Assert ("File should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- stream.Close ();
- } catch (Exception e) {
- Fail ("File.Create(resources/foo) unexpected exception caught: e=" + e.ToString());
- }
-
- /* positive test: repeat test above again to test for overwriting file */
- try {
- stream = File.Create ("resources" + Path.DirectorySeparatorChar + "foo");
- Assert ("File should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- stream.Close ();
- } catch (Exception e) {
- Fail ("File.Create(resources/foo) unexpected exception caught: e=" + e.ToString());
- }
- }
-
- public void TestCopy ()
- {
- /* exception test: File.Copy(null, b) */
- try {
- File.Copy (null, "b");
- Fail ("File.Copy(null, 'b') should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy(null, 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(a, null) */
- try {
- File.Copy ("a", null);
- Fail ("File.Copy('a', null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('a', null) unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Copy("", b) */
- try {
- File.Copy ("", "b");
- Fail ("File.Copy('', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(a, "") */
- try {
- File.Copy ("a", "");
- Fail ("File.Copy('a', '') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('a', '') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Copy(" ", b) */
- try {
- File.Copy (" ", "b");
- Fail ("File.Copy(' ', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy(' ', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(a, " ") */
- try {
- File.Copy ("a", " ");
- Fail ("File.Copy('a', ' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('a', ' ') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Copy(doesnotexist, b) */
- try {
- File.Copy ("doesnotexist", "b");
- Fail ("File.Copy('doesnotexist', 'b') should throw FileNotFoundException");
- } catch (FileNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Copy('doesnotexist', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* positive test: copy resources/AFile.txt to resources/bar */
- try {
- File.Delete ("resources" + Path.DirectorySeparatorChar + "bar");
- File.Copy ("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "bar");
- Assert ("File AFile.txt should still exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "AFile.txt"));
- Assert ("File bar should exist after File.Copy", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- } catch (Exception e) {
- Fail ("#1 File.Copy('resources/AFile.txt', 'resources/bar') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Copy(resources/AFile.txt, resources/bar) (default is overwrite == false) */
- try {
- File.Copy ("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "bar");
- Fail ("File.Copy('resources/AFile.txt', 'resources/bar') should throw IOException");
- } catch (IOException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("#2 File.Copy('resources/AFile.txt', 'resources/bar') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* positive test: copy resources/AFile.txt to resources/bar, overwrite */
- try {
- Assert ("File bar should exist before File.Copy", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- File.Copy ("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "bar", true);
- Assert ("File AFile.txt should still exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "AFile.txt"));
- Assert ("File bar should exist after File.Copy", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- } catch (Exception e) {
- Fail ("File.Copy('resources/AFile.txt', 'resources/bar', true) unexpected exception caught: e=" + e.ToString());
- }
-
-
- }
-
- public void TestDelete ()
- {
-
- /* exception test: File.Delete(null) */
- try {
- File.Delete (null);
- Fail ("File.Delete(null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete(null) unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Delete("") */
- try {
- File.Delete ("");
- Fail ("File.Delete('') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete('') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Delete(" ") */
- try {
- File.Delete (" ");
- Fail ("File.Delete(' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete(' ') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Delete(directory_not_found) */
- try {
- File.Delete ("directory_does_not_exist" + Path.DirectorySeparatorChar + "foo");
- Fail ("File.Delete(directory_does_not_exist) should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Delete(directory_does_not_exist) unexpected exception caught: e=" + e.ToString());
- }
-
- if (!File.Exists ("resources" + Path.DirectorySeparatorChar + "foo")) {
- FileStream f = File.Create("resources" + Path.DirectorySeparatorChar + "foo");
- f.Close();
- }
-
- Assert ("File resources" + Path.DirectorySeparatorChar + "foo should exist for TestDelete to succeed", File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- try {
- File.Delete ("resources" + Path.DirectorySeparatorChar + "foo");
- } catch (Exception e) {
- Fail ("Unable to delete resources" + Path.DirectorySeparatorChar + "foo: e=" + e.ToString());
- }
- Assert ("File resources" + Path.DirectorySeparatorChar + "foo should not exist after File.Delete", !File.Exists ("resources" + Path.DirectorySeparatorChar + "foo"));
- }
-
-
- public void TestMove ()
- {
- /* exception test: File.Move(null, b) */
- try {
- File.Move (null, "b");
- Fail ("File.Move(null, 'b') should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move(null, 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(a, null) */
- try {
- File.Move ("a", null);
- Fail ("File.Move('a', null) should throw ArgumentNullException");
- } catch (ArgumentNullException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('a', null) unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Move("", b) */
- try {
- File.Move ("", "b");
- Fail ("File.Move('', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(a, "") */
- try {
- File.Move ("a", "");
- Fail ("File.Move('a', '') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('a', '') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Move(" ", b) */
- try {
- File.Move (" ", "b");
- Fail ("File.Move(' ', 'b') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move(' ', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(a, " ") */
- try {
- File.Move ("a", " ");
- Fail ("File.Move('a', ' ') should throw ArgumentException");
- } catch (ArgumentException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('a', ' ') unexpected exception caught: e=" + e.ToString());
- }
-
-
- /* exception test: File.Move(doesnotexist, b) */
- try {
- File.Move ("doesnotexist", "b");
- Fail ("File.Move('doesnotexist', 'b') should throw FileNotFoundException");
- } catch (FileNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('doesnotexist', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(resources/foo, doesnotexist/b) */
- File.Copy("resources" + Path.DirectorySeparatorChar + "AFile.txt", "resources" + Path.DirectorySeparatorChar + "foo", true);
- try {
- File.Move ("resources" + Path.DirectorySeparatorChar + "foo", "doesnotexist" + Path.DirectorySeparatorChar + "b");
- Fail ("File.Move('resources/foo', 'b') should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (FileNotFoundException) {
- // LAMESPEC
- // do nothing, this is (kind of) what we expect
- } catch (Exception e) {
- Fail ("File.Move('resources/foo', 'doesnotexist/b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(doesnotexist/foo, b) */
- try {
- File.Move ("doesnotexist" + Path.DirectorySeparatorChar + "foo", "b");
- Fail ("File.Move('doesnotexist/foo', 'b') should throw DirectoryNotFoundException");
- } catch (DirectoryNotFoundException) {
- // do nothing, this is what we expect
- } catch (FileNotFoundException) {
- // LAMESPEC
- // do nothing, this is (kind of) what we expect
- } catch (Exception e) {
- Fail ("File.Move('doesnotexist/foo', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- /* exception test: File.Move(resources/foo, resources) */
- try {
- File.Move ("resources" + Path.DirectorySeparatorChar + "foo", "resources");
- Fail ("File.Move('resources/foo', 'resources') should throw IOException");
- } catch (IOException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("File.Move('resources/foo', 'resources') unexpected exception caught: e=" + e.ToString());
- }
-
- /* positive test: File.Move(a, a) shouldn't throw exception */
- try {
- File.Move ("resources" + Path.DirectorySeparatorChar + "foo", "resources" + Path.DirectorySeparatorChar + "foo");
- } catch (Exception e) {
- Fail ("File.Move('doesnotexist/foo', 'b') unexpected exception caught: e=" + e.ToString());
- }
-
- if (!File.Exists ("resources" + Path.DirectorySeparatorChar + "bar")) {
- FileStream f = File.Create("resources" + Path.DirectorySeparatorChar + "bar");
- f.Close();
- }
-
- Assert ("File resources" + Path.DirectorySeparatorChar + "bar should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- File.Move ("resources" + Path.DirectorySeparatorChar + "bar", "resources" + Path.DirectorySeparatorChar + "baz");
- Assert ("File resources" + Path.DirectorySeparatorChar + "bar should not exist", !File.Exists ("resources" + Path.DirectorySeparatorChar + "bar"));
- Assert ("File resources" + Path.DirectorySeparatorChar + "baz should exist", File.Exists ("resources" + Path.DirectorySeparatorChar + "baz"));
- }
-
- public void TestOpen ()
- {
- try {
- FileStream stream = File.Open ("resources" + Path.DirectorySeparatorChar + "AFile.txt", FileMode.Open);
- } catch (Exception e) {
- Fail ("Unable to open resources" + Path.DirectorySeparatorChar + "AFile.txt: e=" + e.ToString());
- }
-
- /* Exception tests */
- try {
- FileStream stream = File.Open ("filedoesnotexist", FileMode.Open);
- Fail ("File 'filedoesnotexist' should not exist");
- } catch (FileNotFoundException) {
- // do nothing, this is what we expect
- } catch (Exception e) {
- Fail ("Unexpect exception caught: e=" + e.ToString());
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs b/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs
deleted file mode 100644
index c9ff831877d..00000000000
--- a/mcs/class/corlib/Test/System.IO/MemoryStreamTest.cs
+++ /dev/null
@@ -1,154 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-// TODO: Add some testing for the CanXXX properties, exceptions,
-// various different constructors.
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class MemoryStreamTest : TestCase {
-
- private MemoryStream testStream;
- private byte[] testStreamData;
-
- public MemoryStreamTest() : base ("MonoTests.System.IO.MemoryStream testcase") { }
- public MemoryStreamTest( string name ): base(name) { }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(MemoryStreamTest));
- }
- }
-
- protected override void SetUp() {
- testStreamData = new byte[100];
-
- for( int i = 0; i < 100; i++ ) {
- testStreamData[i] = (byte)(100 - i);
- }
-
- testStream = new MemoryStream( testStreamData );
- }
-
- //
- // Verify that the first count bytes in testBytes are the same as
- // the count bytes from index start in testStreamData
- //
- private void VerifyTestData( byte[] testBytes, int start, int count) {
- if( testBytes == null ) {
- throw new ArgumentNullException();
- } else if( ( start < 0 || count < 0 ) || start + count > testStreamData.Length || start > testStreamData.Length ) {
- throw new ArgumentOutOfRangeException();
- }
-
- for( int test = 0; test < count; test++ ) {
- if( testBytes[ test ] != testStreamData[ start + test ] ) {
- string failStr = String.Format( "testByte {0} (testStream {1}) was <{2}>, expecting <{3}>", test, start+test,
- testBytes[ test ], testStreamData[ start+test] );
- Fail( failStr );
- }
- }
- }
-
- public void TestConstructors() {
- MemoryStream ms = new MemoryStream();
-
- AssertEquals("A1", 0L, ms.Length );
- AssertEquals("A2", 0, ms.Capacity );
- AssertEquals("A3", true, ms.CanWrite );
-
- ms = new MemoryStream( 10 );
-
- AssertEquals("A4", 0L, ms.Length );
- AssertEquals("A5", 10, ms.Capacity );
- }
-
- public void TestRead() {
- byte[] readBytes = new byte[20];
-
- try {
- /* Test simple read */
- testStream.Read( readBytes, 0, 10 );
- VerifyTestData( readBytes, 0, 10 );
-
- /* Seek back to beginning */
-
- testStream.Seek( 0, SeekOrigin.Begin );
-
- /* Read again, bit more this time */
- testStream.Read( readBytes, 0, 20 );
- VerifyTestData( readBytes, 0, 20 );
-
- /* Seek to 20 bytes from End */
- testStream.Seek( -20, SeekOrigin.End );
- testStream.Read( readBytes, 0, 20);
- VerifyTestData( readBytes, 80, 20);
-
- int readByte = testStream.ReadByte();
- AssertEquals( -1, readByte );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-
- public void TestWriteBytes() {
- byte[] readBytes = new byte[100];
-
- try {
- MemoryStream ms = new MemoryStream( 100 );
-
- for( int i = 0; i < 100; i++ ) {
- ms.WriteByte( testStreamData[i] );
- }
-
- ms.Seek( 0, SeekOrigin.Begin);
-
- testStream.Read( readBytes, 0, 100 );
-
- VerifyTestData( readBytes, 0, 100 );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-
- public void TestWriteBlock() {
- byte[] readBytes = new byte[100];
-
- try {
- MemoryStream ms = new MemoryStream( 100 );
-
- ms.Write( testStreamData, 0, 100 );
-
- ms.Seek( 0, SeekOrigin.Begin);
-
- testStream.Read( readBytes, 0, 100 );
-
- VerifyTestData( readBytes, 0, 100 );
-
- byte[] arrayBytes = testStream.ToArray();
-
- VerifyTestData( arrayBytes, 0, 100 );
- }
- catch(Exception e){
- Fail("Threw an unexpected exception:"+e.ToString());
- return;
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/PathTest.cs b/mcs/class/corlib/Test/System.IO/PathTest.cs
deleted file mode 100644
index 2fd2c6da186..00000000000
--- a/mcs/class/corlib/Test/System.IO/PathTest.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// System.IO.Path Test Cases
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add a more thorough workout for some
-// of the "trickier" functions.
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class PathTest : TestCase {
-
- string path1;
- string path2;
- string path3;
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(PathTest));
- }
- }
-
- public PathTest() : base ("MonoTests.System.IO.PathTest testcase") { }
- public PathTest( string name ): base(name) { }
-
- protected override void SetUp() {
- if ('/' == Path.VolumeSeparatorChar){
- path1 = "/foo/test.txt";
- path2 = "/etc";
- path3 = "init.d";
- } else {
- path1 = "c:\\foo\\test.txt";
- path2 = "c:\\winnt";
- path3 = "system32";
- }
-
- // For Mac. Figure this out when we need it
- //path1 = "foo:test.txt";
- //path2 = "foo";
- //path3 = "bar";
- }
-
-
- public void TestChangeExtension() {
- string testPath = Path.ChangeExtension( path1, "doc" );
-
- #if WINDOWS
- AssertEquals( "c:\\foo\\test.doc", testPath );
- #elif UNIX
- AssertEquals( "/foo/test.doc", testPath );
- #elif MAC
- AssertEquals( "foo:test.doc", testPath );
- #endif
- }
-
- public void TestCombine() {
- string testPath = Path.Combine( path2, path3 );
-
- #if WINDOWS
- AssertEquals( "c:\\winnt\\system32", testPath );
- #elif UNIX
- AssertEquals( "/etc/init.d", testPath );
- #elif MAC
- AssertEquals( "foo:bar", testPath );
- #endif
- }
-
- public void TestDirectoryName() {
- string testDirName = Path.GetDirectoryName( path1 );
-
- #if WINDOWS
- AssertEquals( "c:\\foo", testDirName );
- #elif UNIX
- AssertEquals( "/etc", testDirName );
- #elif MAC
- AssertEquals( "foo", testDirName );
- #endif
- }
-
- public void TestGetExtension() {
- string testExtn = Path.GetExtension( path1 );
-
- AssertEquals( ".txt", testExtn );
-
- testExtn = Path.GetExtension( path2 );
-
- AssertEquals ( "", testExtn );
- }
-
- public void TestGetFileName() {
- string testFileName = Path.GetFileName( path1 );
-
- AssertEquals( "test.txt", testFileName );
- }
-
- public void TestGetFileNameWithoutExtension() {
- string testFileName = Path.GetFileNameWithoutExtension( path1 );
-
- AssertEquals( "test", testFileName );
- }
-
- public void TestGetFullPath() {
- string testFullPath = Path.GetFullPath( "foo.txt" );
- // AssertEquals( "foo.txt", testFullPath );
- }
-
- public void TestGetTempPath() {
- string getTempPath = Path.GetTempPath();
- Assert ("Temp Path should not be empty", getTempPath != String.Empty);
- }
-
- public void TestGetTempFileName() {
- string getTempFileName = "";
- try {
- getTempFileName = Path.GetTempFileName();
- Assert ("Temp file name should not be empty", getTempFileName != String.Empty);
- Assert ("File should exist", File.Exists(getTempFileName));
- } finally {
- if (getTempFileName != null && getTempFileName != String.Empty){
- File.Delete(getTempFileName);
- }
- }
- }
-
- public void TestHasExtension() {
- AssertEquals( true, Path.HasExtension( "foo.txt" ) );
- AssertEquals( false, Path.HasExtension( "foo" ) );
- AssertEquals( true, Path.HasExtension( path1 ) );
- AssertEquals( false, Path.HasExtension( path2 ) );
- }
-
- public void TestRooted() {
- Assert ("Path should be rooted", Path.IsPathRooted(path2));
- Assert ("Path should NOT be rooted", !Path.IsPathRooted(path3));
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs b/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs
deleted file mode 100644
index 5a07d426ccc..00000000000
--- a/mcs/class/corlib/Test/System.IO/StreamReaderTest.cs
+++ /dev/null
@@ -1,558 +0,0 @@
-// StreamReaderTest.cs - NUnit Test Cases for the SystemIO.StreamReader class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class StreamReaderTest : TestCase
-{
- public StreamReaderTest() :
- base ("MonoTests.System.StreamReaderTest testsuite") {}
- public StreamReaderTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StreamReaderTest));
- }
- }
-
- private string _codeFileName = "resources" + Path.DirectorySeparatorChar + "AFile.txt";
-
- public void TestCtor1() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("");
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile");
- } catch (FileNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file");
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0]);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- }
- public void TestCtor3() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("null stream error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f, false);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f, false);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((Stream)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_codeFileName, FileMode.Open, FileAccess.Write);
- try {
- StreamReader r = new StreamReader(f, true);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- FileStream f = new FileStream(_codeFileName,
- FileMode.Open,
- FileAccess.Read);
- StreamReader r = new StreamReader(f, true);
- AssertNotNull("no stream reader", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor4() {
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("", false);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile", false);
- } catch (FileNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file", false);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], false);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName, false);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("", true);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 6: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader((string)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 7: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentfile", true);
- } catch (FileNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 8: " + e.ToString());
- }
- Assert("fileNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("nonexistentdir/file", true);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 9: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamReader r = new StreamReader("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], true);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 10: " + e.ToString());
- }
- Assert("invalid filename error not thrown", errorThrown);
- }
- {
- // this is probably incestuous, but, oh well.
- StreamReader r = new StreamReader(_codeFileName, true);
- AssertNotNull("no stream reader", r);
- r.Close();
- }
- }
-
- // TODO - Ctor with Encoding
-
- public void TestBaseStream() {
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("wrong base stream ", m, r.BaseStream);
- r.Close();
- m.Close();
- } catch (Exception e) {
- Fail ("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- public void TestCurrentEncoding() {
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("wrong encoding",
- Encoding.UTF8, r.CurrentEncoding);
- } catch (Exception e) {
- Fail ("Unexpected exception thrown: " + e.ToString());
- }
- }
-
- // TODO - Close - annoying spec - won't commit to any exceptions. How to test?
- // TODO - DiscardBufferedData - I have no clue how to test this function.
-
- public void TestPeek() {
- // FIXME - how to get an IO Exception?
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- m.Close();
- int nothing = r.Peek();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- }
- Assert("nothing-to-peek-at error not thrown", errorThrown);
- }
- {
- Byte[] b = {1, 2, 3, 4, 5, 6};
- MemoryStream m = new MemoryStream(b);
-
- StreamReader r = new StreamReader(m);
- for (int i = 1; i <= 6; i++) {
- AssertEquals("peek incorrect", i, r.Peek());
- r.Read();
- }
- AssertEquals("should be none left", -1, r.Peek());
- }
- }
-
- public void TestRead() {
- // FIXME - how to get an IO Exception?
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- m.Close();
- int nothing = r.Read();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("nothing-to-read error not thrown", errorThrown);
- }
- {
- Byte[] b = {1, 2, 3, 4, 5, 6};
- MemoryStream m = new MemoryStream(b);
-
- StreamReader r = new StreamReader(m);
- for (int i = 1; i <= 6; i++) {
- AssertEquals("read incorrect", i, r.Read());
- }
- AssertEquals("Should be none left", -1, r.Read());
- }
-
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- r.Read(null, 0, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null buffer error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, 0, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("too-long range error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, -1, 2);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("out of range error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Byte[] b = {};
- StreamReader r = new StreamReader(new MemoryStream(b));
- Char[] c = new Char[1];
- r.Read(c, 0, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("out of range error not thrown", errorThrown);
- }
- {
- int ii = 1;
- try {
- Byte[] b = {(byte)'a', (byte)'b', (byte)'c',
- (byte)'d', (byte)'e', (byte)'f',
- (byte)'g'};
- MemoryStream m = new MemoryStream(b);
- ii++;
- StreamReader r = new StreamReader(m);
- ii++;
-
- char[] buffer = new Char[7];
- ii++;
- char[] target = {'g','d','e','f','b','c','a'};
- ii++;
- r.Read(buffer, 6, 1);
- ii++;
- r.Read(buffer, 4, 2);
- ii++;
- r.Read(buffer, 1, 3);
- ii++;
- r.Read(buffer, 0, 1);
- ii++;
- for (int i = 0; i < target.Length; i++) {
- AssertEquals("read no work",
- target[i], buffer[i]);
- i++;
- }
-
- } catch (Exception e) {
- Fail ("Caught when ii=" + ii + ". e:" + e.ToString());
- }
- }
- }
-
- public void TestReadLine() {
- // TODO Out Of Memory Exc? IO Exc?
- Byte[] b = new Byte[8];
- b[0] = (byte)'a';
- b[1] = (byte)'\n';
- b[2] = (byte)'b';
- b[3] = (byte)'\n';
- b[4] = (byte)'c';
- b[5] = (byte)'\n';
- b[6] = (byte)'d';
- b[7] = (byte)'\n';
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("line doesn't match", "a", r.ReadLine());
- AssertEquals("line doesn't match", "b", r.ReadLine());
- AssertEquals("line doesn't match", "c", r.ReadLine());
- AssertEquals("line doesn't match", "d", r.ReadLine());
- AssertEquals("line doesn't match", null, r.ReadLine());
- }
-
- public void TestReadToEnd() {
- // TODO Out Of Memory Exc? IO Exc?
- Byte[] b = new Byte[8];
- b[0] = (byte)'a';
- b[1] = (byte)'\n';
- b[2] = (byte)'b';
- b[3] = (byte)'\n';
- b[4] = (byte)'c';
- b[5] = (byte)'\n';
- b[6] = (byte)'d';
- b[7] = (byte)'\n';
- MemoryStream m = new MemoryStream(b);
- StreamReader r = new StreamReader(m);
- AssertEquals("line doesn't match", "a\nb\nc\nd\n", r.ReadToEnd());
- AssertEquals("line doesn't match", "", r.ReadToEnd());
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs b/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs
deleted file mode 100644
index 232f1cfbc33..00000000000
--- a/mcs/class/corlib/Test/System.IO/StreamWriterTest.cs
+++ /dev/null
@@ -1,353 +0,0 @@
-// StreamWriterTest.cs - NUnit Test Cases for the SystemIO.StreamWriter class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-using System.Text;
-
-namespace MonoTests.System.IO
-{
-
-public class StreamWriterTest : TestCase
-{
- public StreamWriterTest() :
- base ("MonoTests.System.StreamWriterTest testsuite") {}
- public StreamWriterTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StreamWriterTest));
- }
- }
-
- private string _codeFileName = "StreamWriterTest.temp";
- private string _thisCodeFileName = "resources" + Path.DirectorySeparatorChar + "AFile.txt";
-
- // TODO - ctors
- public void TestCtor1() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((Stream)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- FileStream f = new FileStream(_thisCodeFileName,
- FileMode.Open,
- FileAccess.Read);
- try {
- StreamWriter r = new StreamWriter(f);
- r.Close();
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- f.Close();
- Assert("no read error not thrown", errorThrown);
- }
- {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- AssertNotNull("no stream writer", r);
- r.Close();
- f.Close();
- }
- }
- public void TestCtor2() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("");
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file");
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0]);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("1 invalid filename error not thrown", errorThrown);
- }
- // TODO - Security/Auth exceptions
- {
- StreamWriter r = new StreamWriter(_codeFileName);
- AssertNotNull("no stream writer", r);
- r.Close();
- }
- }
- public void TestCtor3() {
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("", false);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null, false);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 2: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file", false);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 3: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], false);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 4: " + e.ToString());
- }
- Assert("2 invalid filename error not thrown", errorThrown);
- }
- {
- StreamWriter r = new StreamWriter(_codeFileName, false);
- AssertNotNull("no stream writer", r);
- r.Close();
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("", true);
- } catch (ArgumentException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 5: " + e.ToString());
- }
- Assert("empty string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter((string)null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 6: " + e.ToString());
- }
- Assert("null string error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("nonexistentdir/file", true);
- } catch (DirectoryNotFoundException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 7: " + e.ToString());
- }
- Assert("dirNotFound error not thrown", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- StreamWriter r = new StreamWriter("!$what? what? Huh? !$*#" + Path.InvalidPathChars[0], true);
- } catch (IOException) {
- errorThrown = true;
- } catch (ArgumentException) {
- // FIXME - the spec says 'IOExc', but the
- // compiler says 'ArgExc'...
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 8: " + e.ToString());
- }
- Assert("3 invalid filename error not thrown", errorThrown);
- }
- {
- try {
- StreamWriter r = new StreamWriter(_codeFileName, true);
- AssertNotNull("no stream writer", r);
- r.Close();
- } catch (Exception e) {
- Fail ("Unxpected exception e=" + e.ToString());
- }
- }
- }
-
- // TODO - ctors with Encoding
-
- // TODO - AutoFlush
- public void TestAutoFlush() {
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.AutoFlush = false;
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be nothing before flush",
- 0L, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4L, m.Length);
- }
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.AutoFlush = true;
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be something before flush",
- 4L, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4L, m.Length);
- }
- }
-
- public void TestBaseStream() {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- AssertEquals("wrong base stream ", f, r.BaseStream);
- r.Close();
- f.Close();
- }
-
- public void TestEncoding() {
- StreamWriter r = new StreamWriter(_codeFileName);
- AssertEquals("wrong encoding",
- Encoding.UTF8.GetType(), r.Encoding.GetType());
- r.Close();
- }
-
- // TODO - Close - not entirely sure how to test Close
- //public void TestClose() {
- //{
- //MemoryStream m = new MemoryStream();
- //StreamWriter w = new StreamWriter(m);
- //StreamReader r = new StreamReader(m);
- //w.Write(1);
- //w.Write(2);
- //w.Write(3);
- //w.Write(4);
- //AssertEquals("Should be nothing before close",
- //0, m.Length);
- //AssertEquals("Should be nothing in reader",
- //-1, r.Peek());
- //w.Close();
- //AssertEquals("Should be something after close",
- //1, r.Peek());
- //}
- //}
-
- // TODO - Flush
- public void TestFlush() {
- {
- bool errorThrown = false;
- try {
- FileStream f = new FileStream(_codeFileName,
- FileMode.Append,
- FileAccess.Write);
- StreamWriter r = new StreamWriter(f);
- r.Close();
- r.Flush();
- } catch (ObjectDisposedException) {
- errorThrown = true;
- } catch (Exception e) {
- Fail ("Incorrect exception thrown at 1: " + e.ToString());
- }
- Assert("can't flush closed error not thrown", errorThrown);
- }
- {
- MemoryStream m = new MemoryStream();
- StreamWriter w = new StreamWriter(m);
- w.Write(1);
- w.Write(2);
- w.Write(3);
- w.Write(4);
- AssertEquals("Should be nothing before flush",
- 0L, m.Length);
- w.Flush();
- AssertEquals("Should be something after flush",
- 4L, m.Length);
- }
- }
-
- // TODO - Write - test errors, functionality tested in TestFlush.
-}
-}
diff --git a/mcs/class/corlib/Test/System.IO/StringReaderTest.cs b/mcs/class/corlib/Test/System.IO/StringReaderTest.cs
deleted file mode 100644
index 3391379baf7..00000000000
--- a/mcs/class/corlib/Test/System.IO/StringReaderTest.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-// TODO: Some of the tests could be a bit more thorough
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-
-namespace MonoTests.System.IO {
-
-public class StringReaderTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringReaderTest));
- }
- }
-
- public StringReaderTest() : base ("MonoTests.System.IO.StringReaderTest testcase") { }
- public StringReaderTest( string name ): base(name) { }
-
- public void TestReadLine() {
- string testme = "a\nb\nc\n";
- StringReader sr = new StringReader (testme);
- string inputLine;
- int lines = 0;
- while ((inputLine = sr.ReadLine ()) != null)
- lines++;
-
- AssertEquals ("Incorrect number of lines", 3, lines);
- }
-
- public void TestPeekRead() {
- StringReader reader = new StringReader( "Test String" );
-
- char c = (char)reader.Peek();
- AssertEquals("A1", 'T', c );
-
- char read = (char)reader.Read();
-
- AssertEquals("A2", 'T', read );
-
- c = (char)reader.Peek();
-
- AssertEquals("A3", 'e', c );
- }
-
- public void TestPeekAndReadAtEndOfString() {
- StringReader reader = new StringReader("x");
-
- char c = (char)reader.Peek();
- AssertEquals("A1", 'x', c );
-
- c = (char)reader.Read();
- AssertEquals("A2", 'x', c);
-
- int i = reader.Peek();
- AssertEquals("A3", -1, i);
-
- i = reader.Read();
- AssertEquals("A4", -1, i);
-
- i = reader.Peek();
- AssertEquals("A5", -1, i);
- }
-
- public void TestPeekAndReadEmptyString() {
- StringReader reader = new StringReader("");
-
- int i = reader.Peek();
- AssertEquals("A1", -1, i);
-
- i = reader.Read();
- AssertEquals("A2", -1, i);
- }
-
- public void TestRead() {
- StringReader reader = new StringReader( "Test String" );
-
- /* Read from start of string */
- char[] test = new char[5];
-
- int charsRead = reader.Read( test, 0, 5 );
-
- AssertEquals( 5, charsRead );
- AssertEquals( "Test ", new String(test) );
-
- /* Read to end of string */
- //reader = new StringReader( "Test String" );
-
- test = new char[6];
- charsRead = reader.Read( test, 0, 6 );
- AssertEquals( 6, charsRead);
- AssertEquals( "String", new String( test ) );
-
- /* Read past end of string */
-
- test = new char[6];
- reader = new StringReader( "Foo" );
- charsRead = reader.Read( test, 0, 6 );
- AssertEquals( 3, charsRead );
- AssertEquals( "Foo\0\0\0", new String( test ) );
-
- }
-
- public void TestReadEOL() {
- StringReader reader = new StringReader( "Line1\rLine2\r\nLine3\nLine4" );
-
- string test = reader.ReadLine();
-
- AssertEquals( "Line1", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line2", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line3", test );
-
- test = reader.ReadLine();
-
- AssertEquals( "Line4", test );
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.IO/StringWriterTest.cs b/mcs/class/corlib/Test/System.IO/StringWriterTest.cs
deleted file mode 100644
index bf254ace832..00000000000
--- a/mcs/class/corlib/Test/System.IO/StringWriterTest.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// System.IO.StringWriter
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// TODO: Add some testing for exceptions
-//
-
-using NUnit.Framework;
-using System.IO;
-using System;
-using System.Text;
-
-namespace MonoTests.System.IO {
-
-public class StringWriterTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringWriterTest));
- }
- }
-
- public StringWriterTest() : base ("MonoTests.System.IO.StringWriterTest testcase") { }
- public StringWriterTest( string name ): base(name) { }
-
- public void TestConstructors() {
- StringBuilder sb = new StringBuilder("Test String");
-
- StringWriter writer = new StringWriter( sb );
- AssertEquals( sb, writer.GetStringBuilder() );
- }
-
- public void TestWrite() {
- StringWriter writer = new StringWriter();
-
- AssertEquals( String.Empty, writer.ToString() );
-
- writer.Write( 'A' );
- AssertEquals( "A", writer.ToString() );
-
- writer.Write( " foo" );
- AssertEquals( "A foo", writer.ToString() );
-
-
- char[] testBuffer = "Test String".ToCharArray();
-
- writer.Write( testBuffer, 0, 4 );
- AssertEquals( "A fooTest", writer.ToString() );
-
- writer.Write( testBuffer, 5, 6 );
- AssertEquals( "A fooTestString", writer.ToString() );
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System.Resources/AllTests.cs b/mcs/class/corlib/Test/System.Resources/AllTests.cs
deleted file mode 100644
index 66bbb159c4a..00000000000
--- a/mcs/class/corlib/Test/System.Resources/AllTests.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// MonoTests.System.Resources.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Resources {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
-//FIXME: ResourceReader is not ready yet.
-// suite.AddTest(ResourceReaderTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Resources/ChangeLog b/mcs/class/corlib/Test/System.Resources/ChangeLog
deleted file mode 100644
index 538c52e81d3..00000000000
--- a/mcs/class/corlib/Test/System.Resources/ChangeLog
+++ /dev/null
@@ -1,26 +0,0 @@
-2002/06/14 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Disable ResourceReaderTest for now. The class is not
- ready yet.
-
-2002-05-22 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Fix path name to resource files (again).
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Fix path name to resource files
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs:
- * Empty.resources:
- * MyResources.resources: Added files
- * ResourceReaderTest.cs: Test the enumerator
-
-2002-01-24 Nick Drochak <ndrochak@gol.com>
-
- * ResourceReaderTest.cs: Add new file. This test is not done yet.
- Wanted to save it in cvs for 'disaster recovery' purposes.
- Just in case.
-
diff --git a/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs b/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
deleted file mode 100644
index 9fc95af4f1e..00000000000
--- a/mcs/class/corlib/Test/System.Resources/ResourceReaderTest.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// MonoTests.System.Resources.ResourceReaderTest.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-
-using System;
-using System.Resources;
-using System.IO;
-
-using System.Collections;
-using MonoTests.System.Resources;
-using NUnit.Framework;
-
-namespace MonoTests.System.Resources {
-
- public class ResourceReaderTest : TestCase {
- private static string m_ResourceFile = "resources" + Path.DirectorySeparatorChar + "MyResources.resources";
- private static string m_BadResourceFile = "resources" + Path.DirectorySeparatorChar + "Empty.resources";
-
- public ResourceReaderTest() : base ("MonoTests.System.Resources.ResourceReaderTest testcase") { }
- public ResourceReaderTest(String name) : base(name) {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ResourceReaderTest));
- }
- }
-
- protected override void SetUp() {
- }
-
- public void TestConstructorStringExceptions() {
- ResourceReader r;
- try {
- r = new ResourceReader((String)null);
- Fail("Should throw exception on null");
- } catch{}
- try {
- r = new ResourceReader("");
- Fail("Should throw exception on empty path");
- } catch{}
- try {
- // use a file name that is *very* unlikely to exsist
- r = new ResourceReader("j38f8axvnn9h38hfa9nxn93f8hav4zvag87vvah32o");
- Fail("Should throw exception on file not found");
- } catch{}
- try {
- r = new ResourceReader(m_BadResourceFile);
- Fail("Should throw exception on bad resource file");
- }
- catch {}
- }
-
- public void TestConstructorString() {
- if (!File.Exists(m_ResourceFile)) {
- Fail("Resource file is not where it should be:" + Directory.GetCurrentDirectory()+ "\\" + m_ResourceFile);
- }
- ResourceReader r = null;
- try {
- r = new ResourceReader(m_ResourceFile);
- }
- catch {
- Fail("Should have been able to open resource file.");
- }
- finally {
- if (null != r)
- r.Close();
- }
- Assert("String constructor should not be null", null != r);
- }
-
- public void TestConstructorStreamExceptions() {
- ResourceReader r;
- try {
- r = new ResourceReader((Stream)null);
- Fail("Should throw exception on null");
- } catch{}
-
- try {
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- stream.Close();
- r = new ResourceReader(stream);
- Fail("Should throw exception on cannot read");
- } catch{}
- }
-
- public void TestStream(){
- ResourceReader r = null;
- try {
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- r = new ResourceReader(stream);
- }
- catch{
- Fail("Should not throw exception constructing from stream");
- }
- finally {
- if (null != r) {
- r.Close();
- }
- }
- }
-
- public void TestClose() {
- ResourceReader r = null;
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- r = new ResourceReader(stream);
- r.Close();
- try {
- stream = new FileStream (m_ResourceFile, FileMode.Open);
- }
- catch{
- Fail("Should be able to open the stream again after close");
- }
- finally {
- if (null != stream) {
- stream.Close();
- }
- }
- }
-
- public void TestEnumerator(){
- ResourceReader reader = null;
- Stream stream = new FileStream (m_ResourceFile, FileMode.Open);
- reader = new ResourceReader(stream);
- IDictionaryEnumerator en = reader.GetEnumerator();
- // Goes through the enumerator, printing out the key and value pairs.
- while (en.MoveNext()) {
- DictionaryEntry de = (DictionaryEntry)en.Current;
- Assert("Current.Key should not be empty",String.Empty != (string)de.Key);
- Assert("Current.Value should not be empty",String.Empty != (string)de.Value);
- Assert("Current.Value should not be empty",String.Empty != (string)de.Value);
- Assert("Entry.Key should not be empty",String.Empty != (string)en.Key);
- Assert("Entry.Value should not be empty",String.Empty != (string)en.Value);
- }
- reader.Close();
- }
- } // class ResourceReaderTest
-} // namespace MonoTests.System.Resources \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs b/mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs
deleted file mode 100644
index 8ec0e278803..00000000000
--- a/mcs/class/corlib/Test/System.Runtime.Serialization/AllTests.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// MonoTests.System.Runtime.Serialization.AllTests
-//
-// Authors:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) 2002 Ximian, Inc. (http://www.ximian.com)
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Serialization {
- public class AllTests : TestCase
- {
- public AllTests (string name) : base(name) {}
-
- public static ITest Suite
- {
- get {
- TestSuite suite = new TestSuite();
- suite.AddTest(ObjectIDGeneratorTests.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog b/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog
deleted file mode 100644
index 9e051847759..00000000000
--- a/mcs/class/corlib/Test/System.Runtime.Serialization/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-2002-06-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * AllTests.cs: New file to make 'make test' work.
- * ChangeLog: New file.
-
diff --git a/mcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs b/mcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs
deleted file mode 100755
index fc53fe9234a..00000000000
--- a/mcs/class/corlib/Test/System.Runtime.Serialization/ObjectIDGeneratorTests.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// System.Runtime.Serialization.ObjectIDGeneratorTests.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Diagnostics;
-using System.Runtime.Serialization;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Runtime.Serialization
-{
- public class ObjectIDGeneratorTests : TestCase
- {
- ObjectIDGenerator generator;
-
- string obj1 = "obj1";
- int obj2 = 42;
- long id;
-
- public static ITest Suite {
- get { return new TestSuite (typeof (ObjectIDGeneratorTests)); }
- }
-
- public ObjectIDGeneratorTests (string name)
- : base (name)
- {
- }
-
- protected override void SetUp ()
- {
- generator = new ObjectIDGenerator ();
- }
-
- //
- // Tests adding an ID for a new object
- //
- public void TestGetId1 ()
- {
- bool testBool1;
- id = generator.GetId (obj1, out testBool1);
-
- AssertEquals ("A1", 1L, id); // should start at 1
- AssertEquals ("A2", true, testBool1); // firstTime should be true
- }
-
- //
- // Tests getting the ID for an existing object
- //
- public void TestGetId2 ()
- {
- bool testBool1;
- bool testBool2;
- id = generator.GetId (obj1, out testBool1);
- long testId1 = generator.GetId (obj1, out testBool2);
-
- AssertEquals ("B1", testId1, id); // same object, same ID
- AssertEquals ("B2", false, testBool2); // no longer firstTime
- }
-
- //
- // Tests getting the ID for an existing object
- //
- public void TestHasId1 ()
- {
- bool testBool1;
- bool testBool3;
- id = generator.GetId (obj1, out testBool1);
- long testId2 = generator.HasId (obj1, out testBool3);
-
- AssertEquals ("C1", false, testBool3); // this has been inserted before
- AssertEquals ("C2", id, testId2); // we should get the same ID
- }
-
- //
- // Tests getting the ID for a non-existent object
- //
- public void TestHasId2 ()
- {
- bool testBool4;
- long testId3 = generator.HasId (obj2, out testBool4);
-
- AssertEquals ("D1", 0L, testId3);
- AssertEquals ("D2", true, testBool4);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs b/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs
deleted file mode 100644
index 90edff9d031..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/AllTests.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.AllCryptoTests.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
- /// <summary>
- /// Combines all available crypto unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(SymmetricAlgorithmTest.Suite);
- suite.AddTest(AsymmetricAlgorithmTest.Suite);
- suite.AddTest(RNGCryptoServiceProviderTest.Suite);
- suite.AddTest(FromBase64TransformTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs
deleted file mode 100755
index 37da7bf16fe..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/AsymmetricAlgorithmTest.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.AsymmetricAlgorithmTest.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class AsymmetricAlgorithmTest : TestCase {
- private AsymmetricAlgorithm _algo;
-
- public AsymmetricAlgorithmTest() : base ("MonoTests.System.Security.Cryptography.AsymmetricAlgorithmTest testcase") {
- _algo = null;
- }
- public AsymmetricAlgorithmTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(AsymmetricAlgorithmTest));
- }
- }
-
- protected override void SetUp() {
- _algo = AsymmetricAlgorithm.Create();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- bool thrown = false;
- try {
- KeySizes[] keys = _algo.LegalKeySizes;
- foreach (KeySizes myKey in keys) {
- for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
- _algo.KeySize = i;
- }
- }
- } catch (CryptographicException) {thrown=true;}
- Assert("Properties (2)", !thrown);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs b/mcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs
deleted file mode 100755
index 34a7612e80f..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/FromBase64Transform.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.FromBase64Transform.cs
-//
-// Author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using System.Security.Cryptography;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class FromBase64TransformTest : TestCase {
- private FromBase64Transform _algo;
-
- public FromBase64TransformTest() : base ("MonoTests.System.Security.Cryptography.FromBase64Transform testcase") {
- _algo = null;
- }
- public FromBase64TransformTest(String name) : base(name)
- {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(FromBase64TransformTest));
- }
- }
-
- protected override void SetUp() {
- _algo = new FromBase64Transform ();
- }
-
- protected void TransformFinalBlock (string name, byte[] input, byte[] expected,
- int inputOffset, int inputCount)
- {
- byte[] output = _algo.TransformFinalBlock (input, inputOffset, inputCount);
-
- AssertEquals (name, expected.Length, output.Length);
- for (int i = 0; i < expected.Length; i++)
- AssertEquals (name + "(" + i + ")", expected [i], output [i]);
- }
-
- protected void TransformFinalBlock (string name, byte[] input, byte[] expected)
- {
- TransformFinalBlock (name, input, expected, 0, input.Length);
- }
-
- public void TestFinalBlock ()
- {
- {
- byte[] input = { 114, 108, 112, 55, 81, 115, 110, 69 };
- byte[] expected = { 174, 90, 123, 66, 201, 196 };
-
- TransformFinalBlock ("#A1", input, expected);
- }
- {
- byte[] input = { 114, 108, 112, 55, 81, 115, 61, 61 };
- byte[] expected = { 174, 90, 123, 66 };
-
- TransformFinalBlock ("#A2", input, expected);
- }
- {
- byte[] input = { 114, 108, 112, 55, 81, 115, 61, 61 };
- byte[] expected = { 150, 158, 208 };
-
- TransformFinalBlock ("#A3", input, expected, 1, 5);
- }
- }
-
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs
deleted file mode 100644
index f9d16d58df1..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/RNGCryptoServiceProviderTest.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.RNGCryptoServiceProviderTest.cs
-//
-// Author:
-// Mark Crichton (crichton@gimp.org)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class RNGCryptoServiceProviderTest : TestCase {
- private RNGCryptoServiceProvider _algo;
-
- public RNGCryptoServiceProviderTest() : base ("MonoTests.System.Security.Cryptography.RNGCryptoServiceProviderTest testcase") {
- _algo = null;
- }
- public RNGCryptoServiceProviderTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RNGCryptoServiceProviderTest));
- }
- }
-
- protected override void SetUp() {
- _algo = new RNGCryptoServiceProvider();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- byte[] random = new Byte[25];
-
- // The C code doesn't throw an exception yet.
- _algo.GetBytes(random);
-
- // This one we can check...
- _algo.GetNonZeroBytes(random);
-
- foreach (Byte rnd_byte in random) {
- Assert("Properties (2)", rnd_byte != 0);
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs
deleted file mode 100755
index 0c4c8786925..00000000000
--- a/mcs/class/corlib/Test/System.Security.Cryptography/SymmetricAlgorithmTest.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// TestSuite.System.Security.Cryptography.SymmetricAlgorithmTest.cs
-//
-// Author:
-// Thomas Neidhart (tome@sbox.tugraz.at)
-//
-
-
-using System;
-using System.Security.Cryptography;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Cryptography {
-
- public class SymmetricAlgorithmTest : TestCase {
- private SymmetricAlgorithm _algo;
-
- public SymmetricAlgorithmTest() : base ("MonoTests.System.Security.Cryptography.SymmetricAlgorithmTest testcase") {
- _algo = null;
- }
- public SymmetricAlgorithmTest(String name) : base(name) {
- _algo = null;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SymmetricAlgorithmTest));
- }
- }
-
- protected override void SetUp() {
- _algo = SymmetricAlgorithm.Create();
- }
-
- private void SetDefaultData() {
- }
-
- public void TestProperties() {
- Assert("Properties (1)", _algo != null);
-
- bool thrown = false;
- try
- {
- // try setting an illegal blocksize -> must throw an exception
- _algo.BlockSize = 12;
- } catch (CryptographicException) {thrown = true;}
- Assert("Properties (2)", thrown);
-
- byte[] key = _algo.Key;
- Assert("Properties (3)", key != null);
-
- thrown = false;
- try {
- KeySizes[] keys = _algo.LegalKeySizes;
- foreach (KeySizes myKey in keys) {
- for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
- _algo.KeySize = i;
- }
- }
- } catch (CryptographicException) {thrown=true;}
- Assert("Properties (4)", !thrown);
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs b/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs
deleted file mode 100644
index 95782000656..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// MonoTests.System.Security.Permissions.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Permissions {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(FileIOPermissionTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog b/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog
deleted file mode 100644
index 16d10adaf53..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/ChangeLog
+++ /dev/null
@@ -1,18 +0,0 @@
-2002-06-18 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: Use Unix paths if it looks like we are not
- running the tests on Windows. Need to expand this when we run the
- tests on Mac OS's (and others I suppose). Also consolidated some
- redundant code.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: Remove intersect test where it was trying
- to intersect a permission with itself. This throws an exception
- with mscorlib.
-
-2002-01-14 Nick Drochak <ndrochak@gol.com>
-
- * FileIOPermissionTest.cs: New File.
- * AllTests.cs: New File.
-
diff --git a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs b/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs
deleted file mode 100644
index e4df95d0fd6..00000000000
--- a/mcs/class/corlib/Test/System.Security.Permissions/FileIOPermissionTest.cs
+++ /dev/null
@@ -1,297 +0,0 @@
-//
-// MonoTests.System.Security.Permissions.FileIOPermissionTest.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak II
-//
-// Note: Only Unix and Windows file paths are tested. To run the tests on Mac OS's
-// search for the "FIXME" notes below and adjust accordingly.
-
-using System;
-using System.Security;
-using System.Security.Permissions;
-using System.IO;
-
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Permissions {
-
- public class FileIOPermissionTest : TestCase {
-
- public FileIOPermissionTest() : base ("MonoTests.System.Security.Permissions.FileIOPermissionTest testcase") { }
- public FileIOPermissionTest(String name) : base(name) {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(FileIOPermissionTest));
- }
- }
-
- string[] pathArrayGood;
- string[] pathArrayBad;
- FileIOPermission p;
- FileIOPermission p2;
- string[] pathsInPermission;
- string[] pathArrayGood2;
- FileIOPermission unrestricted;
-
- protected override void SetUp() {
- p = null;
- pathsInPermission = null;
- pathArrayGood = new string[2];
- pathArrayBad = new string[2];
- pathArrayGood2 = new string[3];
- // FIXME: Adjust to run on Mac OS's
- if (Path.VolumeSeparatorChar == ':') {
- pathArrayGood[0] = "c:\\temp1";
- pathArrayGood[1] = "d:\\temp2";
- pathArrayBad[0] = "c:\\temp1";
- pathArrayBad[1] = "d:\\temp*";
- pathArrayGood2[0] = "c:\\temp1";
- pathArrayGood2[1] = "d:\\temp2";
- pathArrayGood2[2] = "z:\\something";
- }
- else {
- pathArrayGood[0] = "/temp1";
- pathArrayGood[1] = "/usr/temp2";
- pathArrayBad[0] = "/temp1";
- pathArrayBad[1] = "/usr/temp*";
- pathArrayGood2[0] = "/temp1";
- pathArrayGood2[1] = "/usr/temp2";
- pathArrayGood2[2] = "/usr/bin/something";
- }
- }
-
- private void SetDefaultData() {
- }
-
- public void TestConstructorPermissionState() {
- p = new FileIOPermission(PermissionState.None);
- AssertEquals("Should be Restricted", false, p.IsUnrestricted());
- p = new FileIOPermission(PermissionState.Unrestricted);
- AssertEquals("Should be Unrestricted", true, p.IsUnrestricted());
- try{
- p = new FileIOPermission((PermissionState)77);
- Fail("Should have thrown an exception on invalid PermissionState");
- }
- catch{
- // we should be here if things are working. nothing to do
- }
- }
-
- public void TestConstructorString() {
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "this path is not rooted");
- Fail("Should have thrown an exception on path not rooted");
- }
- catch{}
-
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "<this is not a valid path>");
- Fail("Should have thrown an exception on invalid characters in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, "\\\\mycomputer\\test*");
- Fail("Should have thrown an exception on wildcards not allowed in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission((FileIOPermissionAccess)77, "c:\\temp");
- Fail("Should have thrown an exception on invalid access value");
- }
- catch{}
-
- string pathToAdd;
- // FIXME: Adjust to run on Mac OS's
- if (Path.VolumeSeparatorChar == ':')
- pathToAdd = "c:\\temp";
- else
- pathToAdd = "/temp";
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathToAdd);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 1 but got: "+pathsInPermission.Length, pathsInPermission.Length == 1);
- Assert("Does not contain expected path from constructor: "+pathToAdd, pathsInPermission[0] == pathToAdd);
- }
-
- public void TestConstructorStringArray() {
- try{
- p = new FileIOPermission(FileIOPermissionAccess.Append, pathArrayBad);
- Fail("Should have thrown an exception on wildcards not allowed in path");
- }
- catch{}
-
- try{
- p = new FileIOPermission((FileIOPermissionAccess)77, pathArrayGood);
- Fail("Should have thrown an exception on invalid access value");
- }
- catch{}
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
-
- }
-
- public void TestAddPathListStringArray() {
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Does not contain correct number of paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
-
- p.AddPathList(FileIOPermissionAccess.Append, pathArrayGood);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should still contain correct number Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Append);
- Assert("Should contain correct number of Append paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- foreach (string s in pathsInPermission){
- Assert("Unexpected path in the Permission: " + s, Array.IndexOf(pathsInPermission, s) >=0);
- }
- }
-
- public void TestIntersect() {
- FileIOPermission intersection;
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- p.AllFiles = FileIOPermissionAccess.Append;
- p.AllLocalFiles = FileIOPermissionAccess.Write;
-
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
-
- intersection = (FileIOPermission)p.Intersect(unrestricted);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have Append bit in AllFiles.", (intersection.AllFiles & FileIOPermissionAccess.Append) != 0);
- Assert("Should have Write bit in AllLocalFiles.", (intersection.AllLocalFiles & FileIOPermissionAccess.Write) != 0);
-
- intersection = (FileIOPermission)unrestricted.Intersect(p);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have Append bit in AllFiles.", (intersection.AllFiles & FileIOPermissionAccess.Append) != 0);
- Assert("Should have Write bit in AllLocalFiles.", (intersection.AllLocalFiles & FileIOPermissionAccess.Write) != 0);
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append | FileIOPermissionAccess.Read, pathArrayGood2);
- p2.AllFiles = FileIOPermissionAccess.Append | FileIOPermissionAccess.Write;
- p2.AllLocalFiles = FileIOPermissionAccess.Write | FileIOPermissionAccess.Read;
- intersection = (FileIOPermission)p.Intersect(p2);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- AssertNotNull ("Should have some paths", pathsInPermission);
- AssertEquals ("Should contain correct number of Read paths", 2, pathsInPermission.Length);
- AssertEquals ("Should have only Append bit in AllFiles.", FileIOPermissionAccess.Append, intersection.AllFiles);
- AssertEquals ("Should have only Write bit in AllLocalFiles.", FileIOPermissionAccess.Write, intersection.AllLocalFiles);
-
- intersection = (FileIOPermission)p2.Intersect(p);
- pathsInPermission = intersection.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should contain correct number of Read paths. Expected 2 but got: "+pathsInPermission.Length, pathsInPermission.Length == 2);
- Assert("Should have only Append bit in AllFiles.", intersection.AllFiles == FileIOPermissionAccess.Append);
- Assert("Should have only Write bit in AllLocalFiles.", intersection.AllLocalFiles == FileIOPermissionAccess.Write);
- }
-
- public void TestIsSubsetOf() {
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
- Assert("IsSubsetOf reflective test failed", unrestricted.IsSubsetOf(unrestricted));
-
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- p.AllFiles = FileIOPermissionAccess.Append;
- p.AllLocalFiles = FileIOPermissionAccess.Write;
- Assert("#1 IsSubsetOf reflective test failed", p.IsSubsetOf(p));
- Assert("#1 IsSubsetOf false test failed", !unrestricted.IsSubsetOf(p));
- Assert("#1 IsSubsetOf true test failed", p.IsSubsetOf(unrestricted));
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append | FileIOPermissionAccess.Read, pathArrayGood2);
- p2.AllFiles = FileIOPermissionAccess.Append | FileIOPermissionAccess.Write;
- p2.AllLocalFiles = FileIOPermissionAccess.Write | FileIOPermissionAccess.Read;
- Assert("#2 IsSubsetOf reflective test failed", p2.IsSubsetOf(p2));
- Assert("#2 IsSubsetOf true test failed", p.IsSubsetOf(p2));
- Assert("#2 IsSubsetOf false test failed", !p2.IsSubsetOf(p));
- }
-
- public void TestUnion() {
- FileIOPermission union;
-
- unrestricted = new FileIOPermission(PermissionState.Unrestricted);
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- union = (FileIOPermission)unrestricted.Union(p);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should get an unrestricted permission", union.IsUnrestricted());
- Assert("Path list should be empty", pathsInPermission == null);
-
- union = (FileIOPermission)p.Union(unrestricted);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Should get an unrestricted permission", union.IsUnrestricted());
- Assert("Path list should be empty", pathsInPermission == null);
-
- p2 = new FileIOPermission(FileIOPermissionAccess.Append, pathArrayGood2);
-
- union = (FileIOPermission)p.Union(p2);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == pathArrayGood.Length);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Append);
- Assert("Path list should have 3 for Append", pathsInPermission.Length == pathArrayGood2.Length);
-
- union = (FileIOPermission)p2.Union(p);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == pathArrayGood.Length);
- pathsInPermission = union.GetPathList(FileIOPermissionAccess.Append);
- Assert("Path list should have 3 for Append", pathsInPermission.Length == pathArrayGood2.Length);
- }
-
- public void TestFromXML() {
- p = new FileIOPermission(PermissionState.None);
- SecurityElement esd;
-
- esd = new SecurityElement("IPermission");
- esd.AddAttribute("class", "FileIOPermission");
- esd.AddAttribute("version", "1");
- esd.AddAttribute("Unrestricted", "true");
- p.FromXml(esd);
- Assert("Should get an unrestricted permission", p.IsUnrestricted());
-
- esd = new SecurityElement("IPermission");
- esd.AddAttribute("class", "FileIOPermission");
- esd.AddAttribute("version", "1");
- // FIXME: Adjust to run on Mac OS's
- if (Path.VolumeSeparatorChar == ':') {
- esd.AddAttribute("Read", "c:\\temp;d:\\temp2");
- esd.AddAttribute("Write", "c:\\temp;d:\\temp2;z:\\temp3");
- }
- else {
- esd.AddAttribute("Read", "/temp;/usr/temp2");
- esd.AddAttribute("Write", "/temp;/usr/temp2;/usr/bin/temp3");
- }
- p = new FileIOPermission(PermissionState.None);
- p.FromXml(esd);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Read);
- Assert("Path list should have 2 for Read", pathsInPermission.Length == 2);
- pathsInPermission = p.GetPathList(FileIOPermissionAccess.Write);
- Assert("Path list should have 2 for Write", pathsInPermission.Length == 3);
- }
-
- public void TestToXML() {
- SecurityElement esd;
- string read;
- p = new FileIOPermission(FileIOPermissionAccess.Read, pathArrayGood);
- esd = p.ToXml();
- Assert("Esd tag incorrect", esd.Tag == "IPermission");
- Assert("Esd version incorrect", (String)esd.Attributes["version"] == "1");
- read = (String)esd.Attributes["Read"];
- pathsInPermission = read.Split(';');
- Assert("Path list should have 2 for Read", pathsInPermission.Length == 2);
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs b/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs
deleted file mode 100644
index a0632fdd70c..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// MonoTests.System.Security.Policy.AllTests.cs
-//
-// Author:
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak II
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security.Policy {
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(CodeGroupTest.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System.Security.Policy/ChangeLog b/mcs/class/corlib/Test/System.Security.Policy/ChangeLog
deleted file mode 100644
index 51b9aae2eab..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/ChangeLog
+++ /dev/null
@@ -1,15 +0,0 @@
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add new file.
-
-2002-02-07 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: Tests everything except the (To|From)Xml methods.
-
-2002-02-01 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: Still not done, checking in now just in case
-
-2002-01-30 Nick Drochak <ndrochak@gol.com>
-
- * CodeGroupTest.cs: New File. Not done, but checking in now just in case \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs b/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs
deleted file mode 100644
index 73415017c3d..00000000000
--- a/mcs/class/corlib/Test/System.Security.Policy/CodeGroupTest.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-//
-// MonoTests.System.Security.Policy.CodeGroupTest
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak, All rights reserved.
-
-using NUnit.Framework;
-using System;
-using System.Security;
-using System.Security.Policy;
-using System.Security.Permissions;
-
-namespace MonoTests.System.Security.Policy
-{
-
- public class CodeGroupTest : TestCase
- {
-
- public CodeGroupTest( string name ): base(name)
- {
- }
-
- public CodeGroupTest() : base("CodeGroupTest")
- {
- }
-
- public static ITest Suite
- {
- get
- {
- return new TestSuite(typeof(CodeGroupTest));
- }
- }
-
- protected override void SetUp()
- {
- }
-
- public class MyCodeGroup : CodeGroup
- {
- public MyCodeGroup(IMembershipCondition membershipCondition,
- PolicyStatement policy) :base(membershipCondition, policy)
- {
- }
-
- public override CodeGroup Copy()
- {
- return this;
- }
-
- public override string MergeLogic
- {
- get
- {
- return "";
- }
- }
-
- public override PolicyStatement Resolve( Evidence evidence)
- {
- return (PolicyStatement)null;
- }
-
- public override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
- {
- return this;
- }
- }
-
- public void TestConstructorExceptions()
- {
- MyCodeGroup cg;
- try
- {
- cg = new MyCodeGroup(null, null);
- Fail("Constructor should throw exception on null paramters");
- }
- catch(Exception e)
- {
- Assert("Should have caught an ArgumentNull Exception", e is ArgumentNullException);
- }
- }
-
- public void TestConstructor()
- {
- MyCodeGroup cg = null;
- try
- {
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- Assert("PolicyStatement property not set correctly by constructor.", cg.PolicyStatement != null);
- Assert("MembershipCondition property not set correctly by constructor.", cg.MembershipCondition != null);
- }
- catch(Exception e)
- {
- Fail("Constructor failed. Exception caught was: " + e.ToString());
- }
- }
-
- public void TestDescriptionProperty()
- {
- MyCodeGroup cg = null;
- const string description = "Test Description";
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.Description = description;
- Assert("Description not the expected value", cg.Description == description);
- }
-
- public void TestNameProperty()
- {
- MyCodeGroup cg = null;
- const string name = "Test Name";
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.Name = name;
- Assert("Description not the expected value", cg.Name == name);
- }
-
- public void TestChildren()
- {
- MyCodeGroup cg = null;
- cg = new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.None)));
- cg.AddChild(new MyCodeGroup(new AllMembershipCondition(), new PolicyStatement(new PermissionSet(PermissionState.Unrestricted))));
- Assert("Unexpected number of children", cg.Children.Count == 1);
- }
-
- public void TestAttributeStringProperty()
- {
- MyCodeGroup cg = null;
- PolicyStatementAttribute psa = PolicyStatementAttribute.LevelFinal;
- PolicyStatement ps = new PolicyStatement(new PermissionSet(PermissionState.None));
- ps.Attributes = psa;
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- AssertEquals("AttributeString", psa.ToString(), cg.AttributeString);
- }
-
- public void TestPermissionSetNameProperty()
- {
- MyCodeGroup cg = null;
- const string ps_Name = "TestName";
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- AssertEquals("AttributeString", ps_Name, cg.PermissionSetName);
- }
-
- public void TestEquals()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cg2 = null;
- const string ps_Name = "TestName";
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
- bool isEquals;
- isEquals = cg.Equals(cg);
-
- isEquals = cg.Equals("Not Equal to this");
- Assert("CodeGroup should not be equal to a non-CodeGroup type", !isEquals);
-
- cg2 = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg2.Name = "SomeOtherName";
- cg2.Description = "Some Other Description";
-
- isEquals = cg.Equals(cg2);
- Assert("CodeGroup should not be equal when Name or Description is different", !isEquals);
-
- cg2 = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cg2.Name = cg.Name;
- cg2.Description = cg.Description;
- isEquals = cg.Equals(cg2);
- Assert("CodeGroup should not be equal when Membership Condition is different", !isEquals);
- }
-
- public void TestEqualsWithChildren()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cg2 = null;
- MyCodeGroup cgChild = null;
- const string ps_Name = "TestName";
- bool isEquals;
-
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
-
- cgChild = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild.Name = "ChildName";
- cgChild.Description = "Child Descripiton";
-
- cg.AddChild(cgChild);
-
- cg2 = new MyCodeGroup(cg.MembershipCondition, cg.PolicyStatement);
- cg2.Name = cg.Name;
- cg2.Description = cg.Description;
-
- isEquals = cg.Equals(cg2);
- Assert("Should be equal when Children are ignored", isEquals);
-
- isEquals = cg.Equals(cg2, true);
- Assert("Should not be equal when Child count is different", !isEquals);
-
- cg2.AddChild(cgChild);
- isEquals = cg2.Equals(cg, true);
- Assert("Should be equal when children are equal", isEquals);
- }
-
-
- public void TestRemoveChild()
- {
- MyCodeGroup cg = null;
- MyCodeGroup cgChild = null;
- MyCodeGroup cgChild2 = null;
- const string ps_Name = "TestName";
-
- PolicyStatement ps = new PolicyStatement(new NamedPermissionSet(ps_Name));
- cg = new MyCodeGroup(new AllMembershipCondition(), ps);
- cg.Name = "SomeName";
- cg.Description = "Some Description";
-
- cgChild = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild.Name = "ChildName";
- cgChild.Description = "Child Descripiton";
-
- cg.AddChild(cgChild);
-
- cgChild2 = new MyCodeGroup(new ApplicationDirectoryMembershipCondition(), ps);
- cgChild2.Name = "ChildName2";
- cgChild2.Description = "Child Descripiton 2";
-
- cg.AddChild(cgChild2);
-
- AssertEquals("Should be two children before the call to Remove()", 2, cg.Children.Count);
-
- cg.RemoveChild(cgChild);
-
- AssertEquals("Remaing child does not have correct name", "ChildName2", ((CodeGroup)cg.Children[0]).Name);
- try
- {
- cg.RemoveChild(cgChild);
- Fail("Should have throw error on trying to remove non-existant child");
- }
- catch{}
- }
- } // public class CodeGroupTest
-
-} // namespace MonoTests.System.Security.Policy \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System.Security/AllTests.cs b/mcs/class/corlib/Test/System.Security/AllTests.cs
deleted file mode 100644
index 5f32c30411d..00000000000
--- a/mcs/class/corlib/Test/System.Security/AllTests.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// TestSuite.System.Security.AllSecurityTests.cs
-//
-// Lawrence Pit <loz@cable.a2000.nl>
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Security {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
-
- public AllTests (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (SecurityElementTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Security/ChangeLog b/mcs/class/corlib/Test/System.Security/ChangeLog
deleted file mode 100644
index 609aa291d8e..00000000000
--- a/mcs/class/corlib/Test/System.Security/ChangeLog
+++ /dev/null
@@ -1,10 +0,0 @@
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * SecurityElementTest.cs: Catch and report unexpected exceptions.
-
-2002-04-27 Lawrence Pit <loz@cable.a2000.nl>
-
- * ChangeLog: added
- * AllTests.cs: added
- * SecurityElementTest.cs: added
-
diff --git a/mcs/class/corlib/Test/System.Security/SecurityElementTest.cs b/mcs/class/corlib/Test/System.Security/SecurityElementTest.cs
deleted file mode 100644
index d4f58882a01..00000000000
--- a/mcs/class/corlib/Test/System.Security/SecurityElementTest.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// SecurityElementTest.cs - NUnit Test Cases for System.Security.SecurityElement
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.Security;
-
-namespace MonoTests.System.Security
-{
-
-public class SecurityElementTest : TestCase
-{
- SecurityElement elem;
-
- public SecurityElementTest () :
- base ("[MonoTests.System.Security.SecurityElementTest]") {}
-
- public SecurityElementTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- elem = CreateElement ();
- }
-
- protected override void TearDown () {}
-
- private SecurityElement CreateElement ()
- {
- SecurityElement elem = new SecurityElement ("IPermission");
- elem.AddAttribute ("class", "System");
- elem.AddAttribute ("version", "1");
-
- SecurityElement child = new SecurityElement ("ConnectAccess");
- elem.AddChild (child);
-
- SecurityElement grandchild = new SecurityElement ("ENDPOINT", "some text");
- grandchild.AddAttribute ("transport", "All");
- grandchild.AddAttribute ("host", "localhost");
- grandchild.AddAttribute ("port", "8080");
- child.AddChild (grandchild);
-
- SecurityElement grandchild2 = new SecurityElement ("ENDPOINT");
- grandchild2.AddAttribute ("transport", "Tcp");
- grandchild2.AddAttribute ("host", "www.ximian.com");
- grandchild2.AddAttribute ("port", "All");
- child.AddChild (grandchild2);
-
- return elem;
- }
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (SecurityElementTest));
- }
- }
-
- public void TestConstructors ()
- {
-
- }
-
- public void TestAddAttribute ()
- {
- try {
- elem.AddAttribute (null, "valid");
- Fail ("#1");
- } catch (ArgumentNullException) { }
- try {
- elem.AddAttribute ("valid", null);
- Fail ("#2");
- } catch (ArgumentNullException) { }
- try {
- elem.AddAttribute ("<invalid>", "valid");
- Fail ("#3");
- } catch (ArgumentException) { }
- try {
- elem.AddAttribute ("valid", "invalid\"");
- Fail ("#4");
- } catch (ArgumentException) { }
- try {
- elem.AddAttribute ("valid", "valid\'");
- } catch (ArgumentException) { Fail ("#5"); }
- try {
- elem.AddAttribute ("valid", "valid&");
- Fail ("#6");
- // in xml world this is actually not considered valid
- // but it is by MS.Net
- } catch (ArgumentException) { }
- try {
- elem.AddAttribute ("valid", "<invalid>");
- Fail ("#7");
- } catch (ArgumentException) { }
- }
-
- public void TestAttributes ()
- {
- Hashtable h = elem.Attributes;
-
- /*
- // this will result in an InvalidCastException on MS.Net
- // I have no clue why
-
- h.Add ("<invalid>", "valid");
- try {
- elem.Attributes = h;
- Fail ("#1");
- } catch (ArgumentException) { }
- */
-
- h = elem.Attributes;
- h.Add ("valid", "\"invalid\"");
- try {
- elem.Attributes = h;
- Fail ("#2");
- } catch (ArgumentException) { }
-
- h = elem.Attributes;
- h.Add ("foo", "bar");
- Assert ("#3", elem.Attributes.Count != h.Count);
-
- elem.Attributes = h;
- Assert ("#4", elem.Attribute ("foo") != null);
- }
-
- public void TestEqual ()
- {
- int iTest = 0;
- try {
- SecurityElement elem2 = CreateElement ();
- iTest++;
- Assert ("#1", elem.Equal (elem2));
- iTest++;
- SecurityElement child = (SecurityElement) elem2.Children [0];
- iTest++;
- child = (SecurityElement) child.Children [1];
- iTest++;
- child.Text = "some text";
- iTest++;
- Assert ("#2", !elem.Equal (elem2));
- } catch (Exception e) {
- Fail ("Unexpected Exception at iTest = " + iTest + ". e = " + e);
- }
- }
-
- public void TestEscape ()
- {
- AssertEquals ("#1", SecurityElement.Escape ("foo<>\"'& bar"), "foo&lt;&gt;&quot;&apos;&amp; bar");
- }
-
- public void TestIsValidAttributeName ()
- {
- Assert ("#1", !SecurityElement.IsValidAttributeName ("x x"));
- Assert ("#2", !SecurityElement.IsValidAttributeName ("x<x"));
- Assert ("#3", !SecurityElement.IsValidAttributeName ("x>x"));
- Assert ("#4", SecurityElement.IsValidAttributeName ("x\"x"));
- Assert ("#5", SecurityElement.IsValidAttributeName ("x'x"));
- Assert ("#6", SecurityElement.IsValidAttributeName ("x&x"));
- }
-
- public void TestIsValidAttributeValue ()
- {
- Assert ("#1", SecurityElement.IsValidAttributeValue ("x x"));
- Assert ("#2", !SecurityElement.IsValidAttributeValue ("x<x"));
- Assert ("#3", !SecurityElement.IsValidAttributeValue ("x>x"));
- Assert ("#4", !SecurityElement.IsValidAttributeValue ("x\"x"));
- Assert ("#5", SecurityElement.IsValidAttributeValue ("x'x"));
- Assert ("#6", SecurityElement.IsValidAttributeValue ("x&x"));
- }
-
- public void TestIsValidTag ()
- {
- Assert ("#1", !SecurityElement.IsValidTag ("x x"));
- Assert ("#2", !SecurityElement.IsValidTag ("x<x"));
- Assert ("#3", !SecurityElement.IsValidTag ("x>x"));
- Assert ("#4", SecurityElement.IsValidTag ("x\"x"));
- Assert ("#5", SecurityElement.IsValidTag ("x'x"));
- Assert ("#6", SecurityElement.IsValidTag ("x&x"));
- }
-
- public void TestIsValidText ()
- {
- Assert ("#1", SecurityElement.IsValidText ("x x"));
- Assert ("#2", !SecurityElement.IsValidText ("x<x"));
- Assert ("#3", !SecurityElement.IsValidText ("x>x"));
- Assert ("#4", SecurityElement.IsValidText ("x\"x"));
- Assert ("#5", SecurityElement.IsValidText ("x'x"));
- Assert ("#6", SecurityElement.IsValidText ("x&x"));
- }
-
- public void TestSearchForChildByTag ()
- {
- SecurityElement child = null;
- try {
- child = elem.SearchForChildByTag (null);
- Fail ("#1 should have thrown an ArgumentNullException");
- } catch (ArgumentNullException) { }
-
- child = elem.SearchForChildByTag ("doesnotexist");
- AssertEquals ("#2", child, null);
-
- child = elem.SearchForChildByTag ("ENDPOINT");
- AssertEquals ("#3", child, null);
-
- child = (SecurityElement) elem.Children [0];
- child = child.SearchForChildByTag ("ENDPOINT");
- AssertEquals ("#4", child.Attribute ("transport"), "All");
- }
-
- public void TestSearchForTextOfTag ()
- {
- try {
- string t1 = elem.SearchForTextOfTag (null);
- Fail ("#1 should have thrown an ArgumentNullException");
- } catch (ArgumentNullException) { }
-
- string t2 = elem.SearchForTextOfTag ("ENDPOINT");
- AssertEquals ("#2", t2, "some text");
- }
-}
-
-}
-
diff --git a/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs b/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs
deleted file mode 100755
index 971a37fc633..00000000000
--- a/mcs/class/corlib/Test/System.Text/ASCIIEncodingTest.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-// ASCIIEncodingTest - NUnit Test Cases for the System.Text.ASCIIEncoding class
-//
-// Author: Mike Kestner <mkestner@speakeasy.net>
-//
-// <c> 2002 Mike Kestner
-
-using NUnit.Framework;
-using System.Text;
-using System;
-
-
-namespace MonoTests.System.Text {
-
- public class ASCIIEncodingTest : TestCase {
-
- private char[] testchars;
- private byte[] testbytes;
-
- public static ITest Suite {
- get {
- TestSuite suite = new TestSuite ();
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes1"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes2"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes3"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes4"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes5"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetBytes6"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars1"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars2"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars3"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetChars4"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetString1"));
- suite.AddTest (new ASCIIEncodingTest ("TestGetString2"));
- suite.AddTest (new ASCIIEncodingTest ("TestDecoder"));
- suite.AddTest (new ASCIIEncodingTest ("TestEncoder"));
- return suite;
- }
- }
-
- public ASCIIEncodingTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- testchars = new char[4];
- testchars[0] = 'T';
- testchars[1] = 'e';
- testchars[2] = 's';
- testchars[3] = 't';
- testbytes = new byte[4];
- testbytes[0] = (byte) 'T';
- testbytes[1] = (byte) 'e';
- testbytes[2] = (byte) 's';
- testbytes[3] = (byte) 't';
- }
-
- // Test GetBytes(char[])
- public void TestGetBytes1 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = ascii_encoding.GetBytes(testchars);
- for (int i = 0; i < testchars.Length; i++)
- AssertEquals (testchars[i], (char) bytes[i]);
- }
-
- // Test GetBytes(char[], int, int)
- public void TestGetBytes2 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = ascii_encoding.GetBytes(testchars, 1, 1);
- AssertEquals (1, bytes.Length);
- AssertEquals (testchars[1], (char) bytes[0]);
- }
-
- // Test non-ASCII char in char[]
- public void TestGetBytes3 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- testchars[2] = (char) 0x80;
- byte[] bytes = ascii_encoding.GetBytes(testchars);
- AssertEquals ('T', (char) bytes[0]);
- AssertEquals ('e', (char) bytes[1]);
- AssertEquals ('?', (char) bytes[2]);
- AssertEquals ('t', (char) bytes[3]);
- }
-
- // Test GetBytes(char[], int, int, byte[], int)
- public void TestGetBytes4 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = new Byte[1];
- int cnt = ascii_encoding.GetBytes(testchars, 1, 1, bytes, 0);
- AssertEquals (1, cnt);
- AssertEquals (testchars[1], (char) bytes[0]);
- }
-
- // Test GetBytes(string, int, int, byte[], int)
- public void TestGetBytes5 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = new Byte[1];
- int cnt = ascii_encoding.GetBytes("Test", 1, 1, bytes, 0);
- AssertEquals ('e', (char) bytes[0]);
- }
-
- // Test GetBytes(string)
- public void TestGetBytes6 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = ascii_encoding.GetBytes("Test");
- for (int i = 0; i < testchars.Length; i++)
- AssertEquals (testchars[i], (char) bytes[i]);
- }
-
- // Test GetChars(byte[])
- public void TestGetChars1 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = ascii_encoding.GetChars(testbytes);
- for (int i = 0; i < testbytes.Length; i++)
- AssertEquals (testbytes[i], (byte) chars[i]);
- }
-
- // Test GetChars(byte[], int, int)
- public void TestGetChars2 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = ascii_encoding.GetChars(testbytes, 1, 1);
- AssertEquals (1, chars.Length);
- AssertEquals (testbytes[1], (byte) chars[0]);
- }
-
- // Test non-ASCII char in byte[]
- public void TestGetChars3 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- testbytes[2] = 0x80;
- char[] chars = ascii_encoding.GetChars(testbytes);
- AssertEquals ('T', chars[0]);
- AssertEquals ('e', chars[1]);
- AssertEquals ('?', chars[2]);
- AssertEquals ('t', chars[3]);
- }
-
- // Test GetChars(byte[], int, int, char[], int)
- public void TestGetChars4 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = new char[1];
- int cnt = ascii_encoding.GetChars(testbytes, 1, 1, chars, 0);
- AssertEquals (1, cnt);
- AssertEquals (testbytes[1], (byte) chars[0]);
- }
-
- // Test GetString(char[])
- public void TestGetString1 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- string str = ascii_encoding.GetString(testbytes);
- AssertEquals ("Test", str);
- }
-
- // Test GetString(char[], int, int)
- public void TestGetString2 ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- string str = ascii_encoding.GetString(testbytes, 1, 2);
- AssertEquals ("es", str);
- }
-
- // Test Decoder
- public void TestDecoder ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- char[] chars = new char[1];
- int cnt = ascii_encoding.GetDecoder().GetChars(testbytes, 1, 1, chars, 0);
- AssertEquals (1, cnt);
- AssertEquals (testbytes[1], (byte) chars[0]);
- }
-
- // Test Decoder
- public void TestEncoder ()
- {
- Encoding ascii_encoding = Encoding.ASCII;
- byte[] bytes = new Byte[1];
- int cnt = ascii_encoding.GetEncoder().GetBytes(testchars, 1, 1, bytes, 0, false);
- AssertEquals (1, cnt);
- AssertEquals (testchars[1], (char) bytes[0]);
- }
-
- }
-
-}
diff --git a/mcs/class/corlib/Test/System.Text/AllTests.cs b/mcs/class/corlib/Test/System.Text/AllTests.cs
deleted file mode 100644
index 1069b3a3f91..00000000000
--- a/mcs/class/corlib/Test/System.Text/AllTests.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System.Text {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- //suite.AddTest(StringBuilderTest.Suite);
- suite.AddTest(ASCIIEncodingTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System.Text/ChangeLog b/mcs/class/corlib/Test/System.Text/ChangeLog
deleted file mode 100644
index 46c490e50a2..00000000000
--- a/mcs/class/corlib/Test/System.Text/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2002-03-17 Mike Kestner <mkestner@speakeasy.net>
-
- * ASCIIEncodingTest.cs : New suite for ASCIIEncoding.
- * AllTests.cs : Add the new suite.
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Remove StringBuilderTest suite. There's a major failure
- when it's included and the test errors aren't displayed.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * StringBuilderTest.cs: Fixed tests that were failing against mscorlib.
diff --git a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs b/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
deleted file mode 100644
index 9f2677e1f1c..00000000000
--- a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// StringBuilderTest.dll - NUnit Test Cases for the System.Text.StringBuilder class
-//
-// Author: Marcin Szczepanski (marcins@zipworld.com.au)
-//
-// NOTES: I've also run all these tests against the MS implementation of
-// System.Text.StringBuilder to confirm that they return the same results
-// and they do.
-//
-// TODO: Add tests for the AppendFormat methods once the AppendFormat methods
-// are implemented in the StringBuilder class itself
-//
-// TODO: Potentially add more variations on Insert / Append tests for all the
-// possible types. I don't really think that's necessary as they all
-// pretty much just do .ToString().ToCharArray() and then use the Append / Insert
-// CharArray function. The ToString() bit for each type should be in the unit
-// tests for those types, and the unit test for ToCharArray should be in the
-// string test type. If someone wants to add those tests here for completness
-// (and some double checking) then feel free :)
-//
-
-using NUnit.Framework;
-using System.Text;
-using System;
-
-namespace MonoTests.System.Text {
-
-public class StringBuilderTest : TestCase {
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(StringBuilderTest));
- }
- }
-
- public StringBuilderTest( string name ) : base(name) { }
-
-
- private StringBuilder sb;
-
- public void TestConstructor1()
- {
- // check the parameterless ctor
- sb = new StringBuilder();
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- AssertEquals(16, sb.Capacity);
- }
-
- public void TestConstructor2()
- {
- // check ctor that specifies the capacity
- sb = new StringBuilder(10);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- // check that capacity is not less than default
- AssertEquals(10, sb.Capacity);
-
- sb = new StringBuilder(42);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- // check that capacity is set
- AssertEquals(42, sb.Capacity);
- }
-
- public void TestConstructor3() {
- // check ctor that specifies the capacity & maxCapacity
- sb = new StringBuilder(444, 1234);
- AssertEquals(String.Empty, sb.ToString());
- AssertEquals(0, sb.Length);
- AssertEquals(444, sb.Capacity);
- AssertEquals(1234, sb.MaxCapacity);
- }
-
- public void TestConstructor4()
- {
- // check for exception in ctor that specifies the capacity & maxCapacity
- try {
- sb = new StringBuilder(9999, 15);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("Capacity exeeds MaxCapacity");
- }
-
- public void TestConstructor5() {
- String someString = null;
- sb = new StringBuilder(someString);
- AssertEquals("Should be empty string", String.Empty, sb.ToString());
- }
-
- public void TestConstructor6() {
- // check for exception in ctor that prevents startIndex less than zero
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, -1, 3, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex not allowed to be less than zero.");
- }
-
- public void TestConstructor7() {
- // check for exception in ctor that prevents length less than zero
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 2, -222, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("Length not allowed to be less than zero.");
- }
-
- public void TestConstructor8() {
- // check for exception in ctor that ensures substring is contained in given string
- // check that startIndex is not too big
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 10000, 4, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
- }
-
- public void TestConstructor9() {
- // check for exception in ctor that ensures substring is contained in given string
- // check that length doesn't go beyond end of string
- try {
- String someString = "someString";
- sb = new StringBuilder(someString, 4, 4000, 18);
- }
- catch (ArgumentOutOfRangeException) {
- return;
- }
- // if we didn't catch an exception, then we have a problem Houston.
- NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
- }
-
- public void TestConstructor10() {
- // check that substring is taken properly and made into a StringBuilder
- String someString = "someString";
- sb = new StringBuilder(someString, 4, 6, 18);
- string expected = "String";
- AssertEquals( expected, sb.ToString());
- }
-
- public void TestAppend() {
- StringBuilder sb = new StringBuilder( "Foo" );
- sb.Append( "Two" );
- string expected = "FooTwo";
- AssertEquals( expected, sb.ToString() );
- }
-
- public void TestInsert() {
- StringBuilder sb = new StringBuilder();
-
- AssertEquals( String.Empty, sb.ToString() );
- /* Test empty StringBuilder conforms to spec */
-
- sb.Insert( 0, "Foo" ); /* Test insert at start of empty string */
-
- AssertEquals( "Foo", sb.ToString() );
-
- sb.Insert( 1, "!!" ); /* Test insert not at start of string */
-
- AssertEquals( "F!!oo", sb.ToString() );
-
- sb.Insert( 5, ".." ); /* Test insert at end of string */
-
- AssertEquals( "F!!oo..", sb.ToString() );
-
- sb.Insert( 0, 1234 ); /* Test insert of a number (at start of string) */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234F!!oo..", sb.ToString() );
-
- sb.Insert( 5, 1.5 ); /* Test insert of a decimal (and end of string) */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234F1.5!!oo..", sb.ToString() );
-
- sb.Insert( 4, 'A' ); /* Test char insert in middle of string */
-
- // FIX: Why does this test fail?
- //AssertEquals( "1234AF1.5!!oo..", sb.ToString() );
-
- }
-
- public void TestReplace() {
- StringBuilder sb = new StringBuilder( "Foobarbaz" );
-
- sb.Replace( "bar", "!!!" ); /* Test same length replace in middle of string */
-
- AssertEquals( "Foo!!!baz", sb.ToString() );
-
- sb.Replace( "Foo", "ABcD" ); /* Test longer replace at start of string */
-
- AssertEquals( "ABcD!!!baz", sb.ToString() );
-
- sb.Replace( "baz", "00" ); /* Test shorter replace at end of string */
-
- AssertEquals( "ABcD!!!00", sb.ToString() );
-
- sb.Replace( sb.ToString(), null ); /* Test string clear as in spec */
-
- AssertEquals( String.Empty, sb.ToString() );
-
- /* | 10 20 30
- /* |0123456789012345678901234567890| */
- sb.Append( "abc this is testing abc the abc abc partial replace abc" );
-
- sb.Replace( "abc", "!!!", 0, 31 ); /* Partial replace at start of string */
-
- AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
-
- sb.Replace( "testing", "", 0, 15 ); /* Test replace across boundary */
-
- AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
-
- sb.Replace( "!!!", "" ); /* Test replace with empty string */
-
- AssertEquals(" this is testing the abc partial replace abc", sb.ToString() );
- }
-
- public void TestAppendFormat() {
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/AllTests.cs b/mcs/class/corlib/Test/System/AllTests.cs
deleted file mode 100644
index 4c943007a4d..00000000000
--- a/mcs/class/corlib/Test/System/AllTests.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// Testsuite.System.AllSystemTests.cs
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
-
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest (ArrayTest.Suite);
- suite.AddTest (AttributeTest.Suite);
- suite.AddTest (BitConverterTest.Suite);
- suite.AddTest (BooleanTest.Suite);
- suite.AddTest (ByteTest.Suite);
- suite.AddTest (CharEnumeratorTest.Suite);
- suite.AddTest (CharTest.Suite);
- suite.AddTest (ConsoleTest.Suite);
- suite.AddTest (ConvertTest.Suite);
- suite.AddTest (DateTimeTest.Suite);
- suite.AddTest (DecimalTest.Suite);
- suite.AddTest (DecimalTest2.Suite);
- suite.AddTest (DoubleTest.Suite);
- suite.AddTest (EnumTest.Suite);
- suite.AddTest (ExceptionTest.Suite);
- suite.AddTest (GuidTest.Suite);
- suite.AddTest (Int16Test.Suite);
- suite.AddTest (Int32Test.Suite);
- suite.AddTest (Int64Test.Suite);
- suite.AddTest (IntegerFormatterTest.Suite);
- suite.AddTest (MathTest.Suite);
- suite.AddTest (MulticastDelegateTest.Suite);
- suite.AddTest (ObjectTest.Suite);
- suite.AddTest (RandomTest.Suite);
- suite.AddTest (ResolveEventArgsTest.Suite);
- suite.AddTest (SByteTest.Suite);
- suite.AddTest (StringTest.Suite);
- suite.AddTest (TimeSpanTest.Suite);
- suite.AddTest (TimeZoneTest.Suite);
- suite.AddTest (UInt16Test.Suite);
- suite.AddTest (UInt32Test.Suite);
- suite.AddTest (UInt64Test.Suite);
- suite.AddTest (VersionTest.Suite);
- return suite;
- }
- }
- }
-}
-
diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs
deleted file mode 100644
index fec2b2ac240..00000000000
--- a/mcs/class/corlib/Test/System/ArrayTest.cs
+++ /dev/null
@@ -1,1996 +0,0 @@
-// ArrayTest.cs - NUnit Test Cases for the System.Array class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Collections;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class ArrayTest : TestCase
-{
- public ArrayTest() : base ("MonoTests.System.ArrayTest testsuite") {}
- public ArrayTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ArrayTest));
- }
- }
-
- public void TestIsFixedSize() {
- char[] a1 = {'a'};
- Assert("All arrays are fixed", a1.IsFixedSize);
- }
-
- public void TestIsReadOnly() {
- char[] a1 = {'a'};
- Assert("No array is readonly", !a1.IsReadOnly);
- }
-
- public void TestIsSynchronized() {
- char[] a1 = {'a'};
- Assert("No array is synchronized", !a1.IsSynchronized);
- }
-
- public void TestLength() {
- {
- char[] a1 = { };
- AssertEquals("Zero length array", 0, a1.Length);
- }
- {
- char[] a1 = {'c'};
- AssertEquals("One-length array", 1, a1.Length);
- }
- {
- char[] a1 = {'c', 'c'};
- AssertEquals("Two-length array", 2, a1.Length);
- }
- }
-
- public void TestRank() {
- char[] a1 = { 'c', 'd', 'e' };
- AssertEquals("Rank one", 1, a1.Rank);
-
- char[,] a2 = new Char[3,3];
- AssertEquals("Rank two", 2, a2.Rank);
-
- char[,,] a3 = new Char[3,3,3];
- AssertEquals("Rank three", 3, a3.Rank);
- }
-
- public void TestBinarySearch1() {
- bool errorThrown = false;
- try {
- Array.BinarySearch(null, "blue");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#B01", errorThrown);
- errorThrown = false;
- try {
- char[,] c1 = new Char[2,2];
- Array.BinarySearch(c1, "needle");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#B02", errorThrown);
-
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- Assert("#B05",
- Array.BinarySearch(arr, 'c') >= 3);
- Assert("#B06",
- Array.BinarySearch(arr, 'c') < 6);
- }
- {
- char[] arr = {'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- AssertEquals("#B07",
- -4, Array.BinarySearch(arr, 'c'));
- }
- {
- char[] arr = {'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- AssertEquals("#B08",
- -9, Array.BinarySearch(arr, 'e'));
- }
- }
- public void TestBinarySearch2() {
- bool errorThrown = false;
- try {
- Array.BinarySearch(null, 0, 1, "blue");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#B20", errorThrown);
- errorThrown = false;
- try {
- char[,] c1 = new Char[2,2];
- Array.BinarySearch(c1, 0, 1, "needle");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#B21", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, -1, 1, 'a');
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#B22", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, 0, -1, 'a');
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#B23", errorThrown);
- errorThrown = false;
- try {
- char[] c1 = {'a'};
- Array.BinarySearch(c1, 0, 4, 'a');
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#B24", errorThrown);
-
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- Assert("#B26",
- Array.BinarySearch(arr, 2, 8, 'c') >= 5);
- Assert("#B27",
- Array.BinarySearch(arr, 2, 8, 'c') < 8);
- }
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'd', 'd', 'd', 'e', 'e'};
- AssertEquals("#B28",
- -6, Array.BinarySearch(arr, 2, 8, 'c'));
- }
- {
- char[] arr = {'z', 'z', 'a', 'b', 'b', 'c', 'c', 'c', 'd', 'd'};
- AssertEquals("#B29",
- -11, Array.BinarySearch(arr, 2, 8, 'e'));
- }
- }
-
- // TODO - testBinarySearch with explicit IComparer args
-
- public void TestClear() {
- bool errorThrown = false;
- try {
- Array.Clear(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#C01", errorThrown);
-
- int[] i1 = { 1, 2, 3, 4 };
- {
- int[] compare = {1,2,3,4};
- AssertEquals("#C02", compare[0], i1[0]);
- AssertEquals("#C03", compare[1], i1[1]);
- AssertEquals("#C04", compare[2], i1[2]);
- AssertEquals("#C05", compare[3], i1[3]);
- }
- Array.Clear(i1, 3, 1);
- {
- int[] compare = {1,2,3,0};
- AssertEquals("#C06", compare[0], i1[0]);
- AssertEquals("#C07", compare[1], i1[1]);
- AssertEquals("#C08", compare[2], i1[2]);
- AssertEquals("#C09", compare[3], i1[3]);
- }
- Array.Clear(i1, 1, 1);
- {
- int[] compare = {1,0,3,0};
- AssertEquals("#C10", compare[0], i1[0]);
- AssertEquals("#C11", compare[1], i1[1]);
- AssertEquals("#C12", compare[2], i1[2]);
- AssertEquals("#C13", compare[3], i1[3]);
- }
- Array.Clear(i1, 1, 3);
- {
- int[] compare = {1,0,0,0};
- AssertEquals("#C14", compare[0], i1[0]);
- AssertEquals("#C15", compare[1], i1[1]);
- AssertEquals("#C16", compare[2], i1[2]);
- AssertEquals("#C17", compare[3], i1[3]);
- }
-
- string[] s1 = { "red", "green", "blue" };
- Array.Clear(s1, 0, 3);
- {
- string[] compare = {null, null, null};
- AssertEquals("#C18", compare[0], s1[0]);
- AssertEquals("#C19", compare[1], s1[1]);
- AssertEquals("#C20", compare[2], s1[2]);
- }
- }
-
- public void TestClone() {
- char[] c1 = {'a', 'b', 'c'};
- char[] c2 = (char[])c1.Clone();
- AssertEquals("#D01", c1[0], c2[0]);
- AssertEquals("#D02", c1[1], c2[1]);
- AssertEquals("#D03", c1[2], c2[2]);
-
- char[] d10 = {'a', 'b'};
- char[] d11 = {'a', 'c'};
- char[] d12 = {'b', 'c'};
- char[][] d1 = {d10, d11, d12};
- char[][] d2 = (char[][])d1.Clone();
- AssertEquals("#D04", d1[0], d2[0]);
- AssertEquals("#D05", d1[1], d2[1]);
- AssertEquals("#D06", d1[2], d2[2]);
-
- d1[0][0] = 'z';
- AssertEquals("#D07", d1[0], d2[0]);
- }
-
- public void TestCopy() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = {};
- Array.Copy(c1, null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#E01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = {};
- Array.Copy(null, c1, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#E02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[,] c2 = new Char[1,1];
- Array.Copy(c1, c2, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#E03", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- string[] s1 = new String[1];
- Array.Copy(c1, s1, 1);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
- Assert("#E04", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Object[] o1 = new Object[1];
- o1[0] = "hello";
- Array.Copy(o1, c1, 1);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("#E05", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[1];
- Array.Copy(c1, c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#E06", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[2];
- Array.Copy(c1, c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E07", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[1];
- Char[] c2 = new Char[2];
- Array.Copy(c2, c1, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E08", errorThrown);
- }
-
- char[] orig = {'a', 'b', 'd', 'a'};
- char[] copy = new Char[4];
- Array.Copy(orig, copy, 4);
- for (int i = 0; i < orig.Length; i++) {
- AssertEquals("#E09(" + i + ")",
- orig[i], copy[i]);
- }
- Array.Clear(copy, 0, copy.Length);
- for (int i = 0; i < orig.Length; i++) {
- AssertEquals("#E10(" + i + ")",
- (char)0, copy[i]);
- }
- Array.Copy(orig, copy, 2);
- AssertEquals("#E11", orig[0], copy[0]);
- AssertEquals("#E12", orig[1], copy[1]);
- Assert("#E13", orig[2] != copy[2]);
- Assert("#E14", orig[3] != copy[3]);
- }
- public void TestCopy2() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- Array.Copy(c2, 1, c1, 0, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E31", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- Array.Copy(c2, 0, c1, 1, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E32", errorThrown);
- }
-
- char[] orig = {'a', 'b', 'd', 'a'};
- char[] copy = new Char[4];
- Array.Copy(orig, 1, copy, 1, 3);
- Assert("#E33", copy[0] != orig[0]);
- for (int i = 1; i < orig.Length; i++) {
- AssertEquals("#E34(" + i + ")",
- orig[i], copy[i]);
- }
- Array.Clear(copy, 0, copy.Length);
- Array.Copy(orig, 1, copy, 0, 2);
- AssertEquals("#E35", orig[1], copy[0]);
- AssertEquals("#E36", orig[2], copy[1]);
- Assert("#E37", copy[2] != orig[2]);
- Assert("#E38", copy[3] != orig[3]);
- }
-
- public void TestCopyTo() {
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- c1.CopyTo(null, 2);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#E61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[,] c2 = new Char[2,2];
- c1.CopyTo(c2, 2);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E62", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[,] c1 = new Char[2,2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, -1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#E63", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[,] c1 = new Char[2,2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 2);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#E64", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#E65", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E66", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Char[] c1 = new Char[2];
- Char[] c2 = new Char[2];
- c1.CopyTo(c2, 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E67", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String[] c1 = new String[2];
- Char[] c2 = new Char[2];
- // FIXME: Our implementation doesn't throw an exception if
- // this is uninitialized.
- c1[0] = "Hello";
- c1[1] = "World";
- c1.CopyTo(c2, 0);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
- Assert("#E68", errorThrown);
- }
-
- Char[] orig = {'a', 'b', 'c', 'd'};
- Char[] copy = new Char[10];
- Array.Clear(copy, 0, copy.Length);
- orig.CopyTo(copy, 3);
- AssertEquals("#E69", (char)0, copy[0]);
- AssertEquals("#E70", (char)0, copy[1]);
- AssertEquals("#E71", (char)0, copy[2]);
- AssertEquals("#E72", orig[0], copy[3]);
- AssertEquals("#E73", orig[1], copy[4]);
- AssertEquals("#E74", orig[2], copy[5]);
- AssertEquals("#E75", orig[3], copy[6]);
- AssertEquals("#E76", (char)0, copy[7]);
- AssertEquals("#E77", (char)0, copy[8]);
- AssertEquals("#E78", (char)0, copy[9]);
-
- {
- // The following is valid and must not throw an exception.
- bool errorThrown = false;
- try {
- int[] src = new int [0];
- int[] dest = new int [0];
- src.CopyTo (dest, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#E79", !errorThrown);
- }
- }
-
- public void TestCreateInstance() {
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(null, 12);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#F01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(Type.GetType("System.Char"), -3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#F02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(Type.GetType("System.Char"), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#F03", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.CreateInstance(Type.GetType("System.Char"), null, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#F04", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- int[] lengths = new int [0];
- Array.CreateInstance(Type.GetType("System.Char"), lengths);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#F05", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- int[] lengths = new int [1];
- int[] bounds = new int [2];
- // FIXME: Broken
- // Array.CreateInstance(Type.GetType("System.Char"), lengths, bounds);
- errorThrown = true;
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#F06", errorThrown);
- }
-
- char[] c1 = (char[])Array.CreateInstance(Type.GetType("System.Char"), 12);
- AssertEquals("#F07", 12, c1.Length);
-
- Array c2 = Array.CreateInstance(Type.GetType("System.Char"), 12, 5);
- AssertEquals("#F08", 2, c2.Rank);
- AssertEquals("#F09", 60, c2.Length);
-
-
- {
- int[] lengths = { 3 };
- int[] bounds = { 5 };
- int[] src = { 512, 718, 912 };
- Array array = Array.CreateInstance(typeof(int), lengths, bounds);
-
- AssertEquals("#F10", 3, array.Length);
- AssertEquals("#F11", 5, array.GetLowerBound(0));
- AssertEquals("#F12", 7, array.GetUpperBound(0));
-
- src.CopyTo (array, 5);
-
- for (int i = 0; i < src.Length; i++)
- AssertEquals("#F13(" + i + ")", src[i], array.GetValue(i+5));
- }
-
- }
-
- public void TestGetEnumerator() {
- String[] s1 = {"this", "is", "a", "test"};
- IEnumerator en = s1.GetEnumerator ();
- AssertNotNull ("#G01", en);
-
- Assert ("#G02", en.MoveNext ());
- AssertEquals ("#G03", "this", en.Current);
- Assert ("#G04", en.MoveNext ());
- AssertEquals ("#G05", "is", en.Current);
- Assert ("#G06", en.MoveNext ());
- AssertEquals ("#G07", "a", en.Current);
- Assert ("#G08", en.MoveNext ());
- AssertEquals ("#G09", "test", en.Current);
- Assert ("#G10", !en.MoveNext ());
-
- en.Reset ();
- Assert("#G11", en.MoveNext ());
- AssertEquals ("#G12", "this", en.Current);
-
- // mutation does not invalidate array enumerator!
- s1.SetValue ("change", 1);
- Assert ("#G13", en.MoveNext ());
- AssertEquals ("#G14", "change", en.Current);
- }
-
- public void TestGetEnumeratorMultipleDimension() {
- String[,] s1 = {{"this", "is"}, {"a", "test"}};
- IEnumerator en = s1.GetEnumerator ();
- AssertNotNull ("#AA01", en);
-
- Assert ("#AA02", en.MoveNext ());
- AssertEquals ("#AA03", "this", en.Current);
- Assert ("#AA04", en.MoveNext ());
- AssertEquals ("#AA05", "is", en.Current);
- Assert ("#AA06", en.MoveNext ());
- AssertEquals ("#AA07", "a", en.Current);
- Assert ("#AA08", en.MoveNext ());
- AssertEquals ("#AA09", "test", en.Current);
- Assert ("#AA10", !en.MoveNext ());
-
- en.Reset ();
- Assert("#AA11", en.MoveNext ());
- AssertEquals ("#AA12", "this", en.Current);
-
- int[] idxs = {0,1};
- // mutation does not invalidate array enumerator!
- s1.SetValue ("change", idxs);
- Assert ("#AA13", en.MoveNext ());
- AssertEquals ("#AA14", "change", en.Current);
- }
-
- public void TestGetEnumeratorNonZeroLowerBounds() {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance( typeof(String), myLengthsArray, myBoundsArray );
- for ( int i = myArray.GetLowerBound(0); i <= myArray.GetUpperBound(0); i++ )
- for ( int j = myArray.GetLowerBound(1); j <= myArray.GetUpperBound(1); j++ ) {
- int[] myIndicesArray = new int[2] { i, j };
- myArray.SetValue( Convert.ToString(i) + j, myIndicesArray );
- }
- IEnumerator en = myArray.GetEnumerator ();
- AssertNotNull ("#AB01", en);
-
- // check the first couple of values
- Assert ("#AB02", en.MoveNext ());
- AssertEquals ("#AB03", "23", en.Current);
- Assert ("#AB04", en.MoveNext ());
- AssertEquals ("#AB05", "24", en.Current);
-
- // then check the last element's value
- string lastElement;
- do {
- lastElement = (string)en.Current;
- } while (en.MoveNext());
- AssertEquals ("#AB06", "47", lastElement);
- }
-
- public void TestIList_Add () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).Add ("can not");
- Fail ("IList.Add should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.Add threw wrong exception type");
- }
-
- Fail("IList.Add shouldn't get this far");
- }
-
- public void TestIList_Insert () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).Insert (0, "can not");
- Fail ("IList.Insert should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.Insert threw wrong exception type");
- }
-
- Fail("IList.Insert shouldn't get this far");
- }
-
- public void TestIList_Remove () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).Remove ("can not");
- Fail ("IList.Remove should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.Remove threw wrong exception type");
- }
-
- Fail("IList.Remove shouldn't get this far");
- }
-
- public void TestIList_RemoveAt () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
- try {
- ((IList)myArray).RemoveAt (0);
- Fail ("IList.RemoveAt should throw");
- }
- catch (NotSupportedException) {
- return;
- }
- catch (Exception) {
- Fail ("IList.RemoveAt threw wrong exception type");
- }
-
- Fail("IList.RemoveAt shouldn't get this far");
- }
-
- public void TestIList_Contains () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
-
- try {
- bool b = ((IList)myArray).Contains ("23");
- Fail("IList.Contains should throw with multi-dimensional arrays");
- }
- catch (RankException) {
- int[] iArr = new int[3] { 1, 2, 3};
- // check the first and last items
- Assert("AC01", ((IList)iArr).Contains (1));
- Assert("AC02", ((IList)iArr).Contains (3));
-
- // and one that is definately not there
- Assert("AC03", !((IList)iArr).Contains (42));
- return;
- }
-
- Fail("Should not get here");
- }
-
- public void TestIList_IndexOf () {
- int[] myLengthsArray = new int[2] { 3, 5 };
- int[] myBoundsArray = new int[2] { 2, 3 };
-
- Array myArray=Array.CreateInstance ( typeof(String), myLengthsArray, myBoundsArray );
-
- try {
- bool b = ((IList)myArray).Contains ("23");
- Fail("IList.Contains should throw with multi-dimensional arrays");
- }
- catch (RankException) {
- int[] iArr = new int[3] { 1, 2, 3};
- // check the first and last items
- AssertEquals("AD01", 0, ((IList)iArr).IndexOf (1));
- AssertEquals("AD02", 2, ((IList)iArr).IndexOf (3));
-
- // and one that is definately not there
- AssertEquals("AD03", -1, ((IList)iArr).IndexOf (42));
- }
- catch (Exception e) {
- Fail("Unexpected exception: " + e.ToString());
- }
-
- // check that wierd case whem lowerbound is Int32.MinValue,
- // so that IndexOf() needs to return Int32.MaxValue when it cannot find the object
- int[] myLengthArray = new int[1] { 3 };
- int[] myBoundArray = new int[1] { Int32.MinValue };
- Array myExtremeArray=Array.CreateInstance ( typeof(String), myLengthArray, myBoundArray );
- AssertEquals("AD04", Int32.MaxValue, ((IList)myExtremeArray).IndexOf (42));
-
- }
-
- public void TestGetLength() {
- {
- bool errorThrown = false;
- try {
- char[] c1 = {'a', 'b', 'c'};
- c1.GetLength(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = {'a', 'b', 'c'};
- c1.GetLength(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H02", errorThrown);
- }
-
- char[] c2 = new Char[5];
- AssertEquals("#H03",
- 5, c2.GetLength(0));
-
- char[,] c3 = new Char[6,7];
- AssertEquals("#H04",
- 6, c3.GetLength(0));
- AssertEquals("#H05",
- 7, c3.GetLength(1));
- }
-
- public void TestGetLowerBound() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetLowerBound(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H31", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetLowerBound(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H32", errorThrown);
- }
-
- char[] c1 = new Char[5];
- AssertEquals("#H33",
- 0, c1.GetLowerBound(0));
-
- char[,] c2 = new Char[4,4];
- AssertEquals("#H34",
- 0, c2.GetLowerBound(0));
- AssertEquals("#H35",
- 0, c2.GetLowerBound(1));
- }
-
- public void TestGetUpperBound() {
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetUpperBound(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetUpperBound(1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#H62", errorThrown);
- }
-
- char[] c1 = new Char[5];
- AssertEquals("#H63",
- 4, c1.GetUpperBound(0));
-
- char[,] c2 = new Char[4,6];
- AssertEquals("#H64",
- 3, c2.GetUpperBound(0));
- AssertEquals("#H65",
- 5, c2.GetUpperBound(1));
- }
-
- public void TestGetValue1() {
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetValue(-1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.GetValue(4);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I03", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("#I04(" + i + ")", c1[i], c1.GetValue(i));
- }
- }
- public void TestGetValue2() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(-1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.GetValue(4,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I23", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("#I24(" + i + "," + j + ")",
- c1[i,j], c1.GetValue(i, j));
- }
- }
- }
- public void TestGetValue3() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(1,1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.GetValue(-1, 1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.GetValue(4,1,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I43", errorThrown);
- }
-
- char[,,] c1 = new Char[4,2,3];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int remains = i % 6;
- int second = remains / 3;
- int third = remains % 3;
- c1[first,second, third] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- for (int k = 0; k < c1.GetLength(2); k++) {
- AssertEquals("#I44(" + i + "," + j + ")",
- c1[i,j,k], c1.GetValue(i,j,k));
- }
- }
- }
- }
- public void TestGetValueN() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.GetValue(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#I61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- int[] coords = {1, 1};
- c.GetValue(coords);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#I62", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {-1, 1};
- c.GetValue(coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I63", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {4, 1};
- c.GetValue(coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#I64", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- int[] coords = {i, j};
- AssertEquals("#I65(" + i + "," + j + ")",
- c1[i,j], c1.GetValue(coords));
- }
- }
- }
-
- public void TestIndexOf1() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#J01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#J02", errorThrown);
- }
-
- String[] s1 = {"this", "is", "a", "test"};
- AssertEquals("#J03", -1, Array.IndexOf(s1, null));
- AssertEquals("#J04", -1, Array.IndexOf(s1, "nothing"));
- AssertEquals("#J05", 0, Array.IndexOf(s1, "this"));
- AssertEquals("#J06", 3, Array.IndexOf(s1, "test"));
- }
- public void TestIndexOf2() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?", 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#J21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?", 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#J22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#J23", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#J24", -1, Array.IndexOf(s1, null, 1));
- AssertEquals("#J25", -1, Array.IndexOf(s1, "nothing", 1));
- AssertEquals("#J26", -1, Array.IndexOf(s1, "this", 1));
- AssertEquals("#J27", 1, Array.IndexOf(s1, "is", 1));
- AssertEquals("#J28", 4, Array.IndexOf(s1, "test", 1));
- }
- public void TestIndexOf3() {
- {
- bool errorThrown = false;
- try {
- Array.IndexOf(null, "huh?", 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#J41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.IndexOf(c, "huh?", 0, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#J42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 3, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#J43", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.IndexOf(c, "huh?", 0, 5);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#J44", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#J45", -1, Array.IndexOf(s1, null, 1, 3));
- AssertEquals("#J46", -1, Array.IndexOf(s1, "nothing", 1, 3));
- AssertEquals("#J47", -1, Array.IndexOf(s1, "this", 1, 3));
- AssertEquals("#J48", 1, Array.IndexOf(s1, "is", 1, 3));
- AssertEquals("#J49", -1, Array.IndexOf(s1, "test", 1, 3));
- AssertEquals("#J50", 3, Array.IndexOf(s1, "a", 1, 3));
- }
-
- public void TestLastIndexOf1() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#K01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?");
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#K02", errorThrown);
- }
-
- String[] s1 = {"this", "is", "a", "a", "test"};
- AssertEquals("#K03", -1, Array.LastIndexOf(s1, null));
- AssertEquals("#K04", -1, Array.LastIndexOf(s1, "nothing"));
- AssertEquals("#K05", 0, Array.LastIndexOf(s1, "this"));
- AssertEquals("#K06", 4, Array.LastIndexOf(s1, "test"));
- AssertEquals("#K07", 3, Array.LastIndexOf(s1, "a"));
- }
- public void TestLastIndexOf2() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?", 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#K21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?", 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#K22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#K23", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#K24", -1, Array.LastIndexOf(s1, null, 3));
- AssertEquals("#K25", -1, Array.LastIndexOf(s1, "nothing", 3));
- AssertEquals("#K26", -1, Array.LastIndexOf(s1, "test", 3));
- AssertEquals("#K27", 3, Array.LastIndexOf(s1, "a", 3));
- AssertEquals("#K28", 0, Array.LastIndexOf(s1, "this", 3));
- }
- public void TestLastIndexOf3() {
- {
- bool errorThrown = false;
- try {
- Array.LastIndexOf(null, "huh?", 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#K41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.LastIndexOf(c, "huh?", 0, 1);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#K42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 3, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#K43", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- Array.LastIndexOf(c, "huh?", 0, 5);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#K44", errorThrown);
- }
-
- String[] s1 = {"this", "is", "really", "a", "test"};
- AssertEquals("#K45",
- -1, Array.LastIndexOf(s1, null, 3, 3));
- AssertEquals("#K46",
- -1, Array.LastIndexOf(s1, "nothing", 3, 3));
- AssertEquals("#K47",
- -1, Array.LastIndexOf(s1, "this", 3, 3));
- AssertEquals("#K48",
- 1, Array.LastIndexOf(s1, "is", 3, 3));
- AssertEquals("#K49",
- -1, Array.LastIndexOf(s1, "test", 3, 3));
- AssertEquals("#K50",
- 3, Array.LastIndexOf(s1, "a", 3, 3));
- }
-
- public void TestReverse() {
- {
- bool errorThrown = false;
- try {
- Array.Reverse(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#L01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.Reverse(c);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#L02", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- Array.Reverse(c1);
- AssertEquals("#L03", 'd', c1[0]);
- AssertEquals("#L04", 'c', c1[1]);
- AssertEquals("#L05", 'b', c1[2]);
- AssertEquals("#L06", 'a', c1[3]);
-
- {
- bool errorThrown = false;
- try {
- Array.Reverse(null, 0, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#L07", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- Array.Reverse(c, 0, 0);
- } catch (RankException) {
- errorThrown = true;
- }
- Assert("#L08", errorThrown);
- }
- //{
- //bool errorThrown = false;
- //try {
- // char[] c = new Char[2];
- // Array.Reverse(c, 0, 3);
- //} catch (ArgumentOutOfRangeException) {
- // errorThrown = true;
- //}
- //Assert("#L09", errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- // char[] c = new Char[2];
- // Array.Reverse(c, 3, 0);
- //} catch (ArgumentOutOfRangeException) {
- // errorThrown = true;
- //}
- //Assert("#L10", errorThrown);
- //}
-
- char[] c2 = { 'a', 'b', 'c', 'd'};
- Array.Reverse(c2, 1, 2);
- AssertEquals("#L11", 'a', c2[0]);
- AssertEquals("#L12", 'c', c2[1]);
- AssertEquals("#L13", 'b', c2[2]);
- AssertEquals("#L14", 'd', c2[3]);
- }
-
- public void TestSetValue1() {
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.SetValue("buh", -1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = {'a', 'b', 'c'};
- c.SetValue("buh", 4);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M03", errorThrown);
- }
-
- char[] c1 = {'a', 'b', 'c', 'd'};
- char[] c2 = new char[4];
- for (int i = 0; i < c1.Length; i++) {
- c2.SetValue(c1[i], i);
- }
- for (int i = 0; i < c1.Length; i++) {
- AssertEquals("#M04(" + i + ")", c1[i], c2[i]);
- }
-
- int[] c3 = { 1, 2, 3 };
- long[] c4 = new long [3];
-
- for (int i = 0; i < c3.Length; i++)
- c4.SetValue (c3 [i], i);
- c3.CopyTo (c4, 0);
- for (int i = 0; i < c3.Length; i++)
- Assert ("#M05(" + i + ")", c3[i] == c4[i]);
-
- Object[] c5 = new Object [3];
- long[] c6 = new long [3];
-
- c4.CopyTo (c5, 0);
-
- c5.CopyTo (c6, 0);
- // for (int i = 0; i < c5.Length; i++)
- // Assert ("#M06(" + i + ")", c5[i] == c6[i]);
- }
-
- public void TestSetValue2() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", 1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M21", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", -1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M22", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- c.SetValue("buh", 4,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M23", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- char[,] c2 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- c2.SetValue(c1[first,second], first, second);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("#M24(" + i + "," + j + ")",
- c1[i,j], c2[i, j]);
- }
- }
- }
- public void TestSetValue3() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", 1,1,1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M41", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.SetValue("buh", -1, 1, 1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M42", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,,] c = new Char[2,2,2];
- c.SetValue("buh", 4,1,1);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M43", errorThrown);
- }
-
- char[,,] c1 = new Char[4,2,3];
- char[,,] c2 = new Char[4,2,3];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int remains = i % 6;
- int second = remains / 3;
- int third = remains % 3;
- c1[first,second, third] = (char)(((int)'a')+i);
- c2.SetValue(c1[first, second, third], first, second, third);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- for (int k = 0; k < c1.GetLength(2); k++) {
- AssertEquals("#M44(" + i + "," + j + " )",
- c1[i,j,k], c2[i,j,k]);
- }
- }
- }
- }
- public void TestSetValueN() {
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- c.SetValue("buh", null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#M61", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c = new Char[2];
- int[] coords = {1, 1};
- c.SetValue("buh", coords);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M62", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {-1, 1};
- c.SetValue("buh", coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M63", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[,] c = new Char[2,2];
- int[] coords = {4, 1};
- c.SetValue("buh", coords);
- } catch (IndexOutOfRangeException) {
- errorThrown = true;
- }
- Assert("#M64", errorThrown);
- }
-
- char[,] c1 = new Char[4,6];
- char[,] c2 = new Char[4,6];
- for (int i = 0; i < 24; i++) {
- int first = i / 6;
- int second = i % 6;
- c1[first,second] = (char)(((int)'a')+i);
- int[] coords = {first, second};
- c2.SetValue(c1[first,second], coords);
- }
- for (int i = 0; i < c1.GetLength(0); i++) {
- for (int j = 0; j < c1.GetLength(1); j++) {
- AssertEquals("#M65(" + i + "," + j + ")",
- c1[i,j], c2[i,j]);
- }
- }
- }
-
- public void TestSetValue4() {
- {
- int[] c1 = { 1, 2, 3 };
- long[] c2 = new long [3];
-
- for (int i = 0; i < c1.Length; i++)
- c2.SetValue (c1 [i], i);
-
- for (int i = 0; i < c1.Length; i++) {
- Assert ("#M81(" + i + ")", c1[i] == c2[i]);
- AssertEquals ("#M82(" + i + ")", typeof (long), c2[i].GetType ());
- }
- }
- {
- long[] c1 = { 1, 2, 3 };
- int[] c2 = new int [3];
- bool errorThrown = false;
- try {
- c2.SetValue (c1 [0], 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M83", errorThrown);
- }
- {
- int[] c1 = { 1, 2, 3 };
- Object[] c2 = new Object [3];
-
- for (int i = 0; i < c1.Length; i++)
- c2.SetValue (c1 [i], i);
-
- for (int i = 0; i < c1.Length; i++)
- AssertEquals ("#M84(" + i + ")", c1[i], Convert.ToInt32 (c2[i]));
- }
- {
- Object[] c1 = new Object [3];
- Object[] c2 = new Object [3];
- c1[0] = new Object ();
-
- for (int i = 0; i < c1.Length; i++)
- c2.SetValue (c1 [i], i);
-
- for (int i = 0; i < c1.Length; i++)
- AssertEquals ("#M85(" + i + ")", c1[i], c2[i]);
- }
- {
- Object[] c1 = new Object [3];
- string[] c2 = new String [3];
- string test = "hello";
- c1[0] = test;
-
- c2.SetValue (c1 [0], 0);
- AssertEquals ("#M86", c1[0], c2[0]);
- AssertEquals ("#M87", "hello", c2[0]);
- }
- {
- char[] c1 = { 'a', 'b', 'c' };
- string[] c2 = new string [3];
- bool errorThrown = false;
- try {
- c2.SetValue (c1 [0], 0);
- // FIXME
- errorThrown = true;
- } catch (InvalidCastException) {
- errorThrown = true;
- }
- Assert("#M88", errorThrown);
- }
- {
- Single[] c1 = { 1.2F, 2.3F, 3.4F, 4.5F };
- long[] c2 = new long [3];
- bool errorThrown = false;
- try {
- c2.SetValue (c1 [0], 0);
- // FIXME
- errorThrown = true;
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("#M89", errorThrown);
- }
- {
- Type[] types = {
- typeof (Boolean),
- typeof (Byte),
- typeof (Char),
- typeof (Double),
- typeof (Int16),
- typeof (Int32),
- typeof (Int64),
- typeof (SByte),
- typeof (Single),
- typeof (UInt16),
- typeof (UInt32),
- typeof (UInt64)
- };
-
- bool v1 = true;
- Byte v2 = 1;
- Char v3 = 'a';
- Double v4 = -1.2;
- Int16 v5 = -32;
- Int32 v6 = -234;
- Int64 v7 = -34523;
- SByte v8 = -1;
- Single v9 = -4.8F;
- UInt16 v10 = 24234;
- UInt32 v11 = 235354;
- UInt64 v12 = 234552;
-
- Object[] va1 = { v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12 };
- Object[] va2 = { "true", "1", "a", "-1.2", "-32", "-234", "-34523", "-1",
- "-4.8F", "24234", "235354", "234552" };
-
- Object[][] vt = { va1, va1, va1, va1, va1, va1, va1, va1, va1, va1, va1, va1 };
-
- int[] arg_ex = {
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
- 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1,
- 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
- 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0,
- 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0
- };
-
- // SetValue
-
- for (int i = 0; i < types.Length; i++) {
- for (int j = 0; j < types.Length; j++) {
- Array array = Array.CreateInstance (types [j], 2);
-
- Object value = vt[j][i];
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (ArgumentException) {
- errorThrown = true;
- }
-
- int ex_index = (i * types.Length) + j;
-
- AssertEquals ("#M90(" + types [i] + "," + types [j] + ")",
- errorThrown, arg_ex [ex_index] == 1);
- }
- }
-
- for (int i = 0; i < types.Length; i++) {
- String[] array = new String [2];
-
- Object value = va1 [i];
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
-
- Assert ("#M91(" + types [i] + ")", errorThrown);
- }
-
- for (int i = 0; i < types.Length; i++) {
- Array array = Array.CreateInstance (types [i], 2);
-
- Object value = va2 [i];
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
-
- Assert ("#M92(" + types [i] + ")", errorThrown);
- }
-
- for (int i = 0; i < types.Length; i++) {
- Array array = Array.CreateInstance (types [i], 2);
-
- Object value = null;
-
- bool errorThrown = false;
- try {
- array.SetValue (value, 0);
- } catch (InvalidCastException) {
- errorThrown = true;
- }
-
- Assert ("#M93(" + types [i] + ")", !errorThrown);
- }
-
- // Copy
-
- for (int i = 0; i < types.Length; i++) {
- for (int j = 0; j < types.Length; j++) {
- Array source = Array.CreateInstance (types [i], 2);
- Array array = Array.CreateInstance (types [j], 2);
-
- source.SetValue (vt[j][i], 0);
- source.SetValue (vt[j][i], 1);
-
- bool errorThrown = false;
- try {
- Array.Copy (source, array, 2);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
-
- int ex_index = (i * types.Length) + j;
-
- AssertEquals ("#M94(" + types [i] + "," + types [j] + ")",
- errorThrown, arg_ex [ex_index] == 1);
- }
- }
-
- for (int i = 0; i < types.Length; i++) {
- Array source = Array.CreateInstance (types [i], 2);
- String[] array = new String [2];
-
- source.SetValue (va1 [i], 0);
- source.SetValue (va1 [i], 1);
-
- bool errorThrown = false;
- try {
- Array.Copy (source, array, 2);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
-
- Assert ("#M95(" + types [i] + ")", errorThrown);
- }
-
- for (int i = 0; i < types.Length; i++) {
- String[] source = new String [2];
- Array array = Array.CreateInstance (types [i], 2);
-
- source.SetValue (va2 [i], 0);
- source.SetValue (va2 [i], 1);
-
- bool errorThrown = false;
- try {
- Array.Copy (source, array, 2);
- } catch (ArrayTypeMismatchException) {
- errorThrown = true;
- }
-
- Assert ("#M96(" + types [i] + ")", errorThrown);
- }
- }
- }
-
-
- public void TestSort() {
- {
- bool errorThrown = false;
- try {
- Array.Sort(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N01", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Array.Sort(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N02", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = new Char[2];
- Array.Sort(null, c1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N03", errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- char[] c1 = new Char[2];
- Array.Sort(null, c1, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("#N04", errorThrown);
- }
-
- // note: null second array => just sort first array
- char[] starter = {'d', 'b', 'f', 'e', 'a', 'c'};
- int[] starter1 = {1,2,3,4,5,6};
- {
- char[] c1 = (char[])starter.Clone();
- Array.Sort(c1);
- AssertEquals("#N21", 'a', c1[0]);
- AssertEquals("#N22", 'b', c1[1]);
- AssertEquals("#N23", 'c', c1[2]);
- AssertEquals("#N24", 'd', c1[3]);
- AssertEquals("#N25", 'e', c1[4]);
- AssertEquals("#N26", 'f', c1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- int[] i1 = (int[])starter1.Clone();
- Array.Sort(c1, i1);
- AssertEquals("#N41", 'a', c1[0]);
- AssertEquals("#N42", 'b', c1[1]);
- AssertEquals("#N43", 'c', c1[2]);
- AssertEquals("#N44", 'd', c1[3]);
- AssertEquals("#N45", 'e', c1[4]);
- AssertEquals("#N46", 'f', c1[5]);
- AssertEquals("#N47", 5, i1[0]);
- AssertEquals("#N48", 2, i1[1]);
- AssertEquals("#N49", 6, i1[2]);
- AssertEquals("#N50", 1, i1[3]);
- AssertEquals("#N51", 4, i1[4]);
- AssertEquals("#N52", 3, i1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- Array.Sort(c1, 1, 4);
- AssertEquals("#N61", 'd', c1[0]);
- AssertEquals("#N62", 'a', c1[1]);
- AssertEquals("#N63", 'b', c1[2]);
- AssertEquals("#N64", 'e', c1[3]);
- AssertEquals("#N65", 'f', c1[4]);
- AssertEquals("#N66", 'c', c1[5]);
- }
- {
- char[] c1 = (char[])starter.Clone();
- int[] i1 = (int[])starter1.Clone();
- Array.Sort(c1, i1, 1, 4);
- AssertEquals("#N81", 'd', c1[0]);
- AssertEquals("#N82", 'a', c1[1]);
- AssertEquals("#N83", 'b', c1[2]);
- AssertEquals("#N84", 'e', c1[3]);
- AssertEquals("#N85", 'f', c1[4]);
- AssertEquals("#N86", 'c', c1[5]);
- AssertEquals("#N87", 1, i1[0]);
- AssertEquals("#N88", 5, i1[1]);
- AssertEquals("#N89", 2, i1[2]);
- AssertEquals("#N90", 4, i1[3]);
- AssertEquals("#N91", 3, i1[4]);
- AssertEquals("#N92", 6, i1[5]);
- }
- }
-
- // TODO - TestSort passed-in IComparable versions
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/AttributeTest.cs b/mcs/class/corlib/Test/System/AttributeTest.cs
deleted file mode 100755
index febe82fe118..00000000000
--- a/mcs/class/corlib/Test/System/AttributeTest.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-//
-// AttributeTest.cs - NUnit Test Cases for the System.Attribute class
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-// Inner namespace for some test helper classes
-using MonoTests.System.AttributeTestInternals;
-
-namespace AttributeTestInternals
-{
-
-[AttributeUsage(AttributeTargets.Class, AllowMultiple=true, Inherited=false)]
-internal class MyCustomAttribute : Attribute {
-
- private string _info;
-
- public MyCustomAttribute (string info)
- {
- _info = info;
- }
-
- public string Info
- {
- get {
- return _info;
- }
- }
-
-}
-
-[AttributeUsage(AttributeTargets.Class)]
-internal class YourCustomAttribute : Attribute {
-
- private int _value;
-
- public YourCustomAttribute (int value)
- {
- _value = value;
- }
-
- public int Value
- {
- get {
- return _value;
- }
- }
-}
-
-[AttributeUsage(AttributeTargets.Class)]
-internal class UnusedAttribute : Attribute {
-}
-
-[MyCustomAttribute("MyBaseClass"), YourCustomAttribute(37)]
-internal class MyClass {
- int Value { get { return 42; }}
-}
-
-[MyCustomAttribute("MyDerivedClass")]
-internal class MyDerivedClass : MyClass {
- public void Do () {}
-}
-
-} // Namespace MonoTests.System.AttributeTestInternals
-
-public class AttributeTest : TestCase {
-
- public AttributeTest () : base("MonoTests.System.AttributeTest testcase") {}
- public AttributeTest (string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(AttributeTest));
- }
- }
-
- public void TestIsDefined ()
- {
- AssertEquals ("A1", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(MyCustomAttribute)));
- AssertEquals ("A2", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(YourCustomAttribute)));
- AssertEquals ("A3", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(UnusedAttribute)));
- AssertEquals ("A4", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(MyCustomAttribute), true));
- AssertEquals ("A5", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(YourCustomAttribute), true));
- AssertEquals ("A6", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(UnusedAttribute), false));
- AssertEquals ("A7", true, Attribute.IsDefined(typeof(MyDerivedClass), typeof(MyCustomAttribute), false));
- AssertEquals ("A8", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(YourCustomAttribute), false));
- AssertEquals ("A9", false, Attribute.IsDefined(typeof(MyDerivedClass), typeof(UnusedAttribute), false));
- }
-
-/*
- public static void TestIsDefaultAttribute ()
- {
- Console.WriteLine(">>>IsDefaultAttribute");
-
- Attribute a = Attribute.GetCustomAttribute(typeof(MyClass), typeof(MyCustomAttribute));
- Console.WriteLine (a.IsDefaultAttribute() );
- }
-
- private static void WriteAttribute (Attribute a)
- {
- if (a == null) {
- Console.WriteLine ("NULL");
- }
- else {
- Console.WriteLine (a);
- }
- }
-*/
-
- public void TestGetCustomAttribute ()
- {
- int i = 1;
- Type t = typeof(MyDerivedClass);
- try {
- AssertEquals ("A1", "MyDerivedClass", ((MyCustomAttribute) (Attribute.GetCustomAttribute(typeof(MyDerivedClass), typeof(MyCustomAttribute), false))).Info);
- i++;
- AssertEquals ("A2", null, ((YourCustomAttribute) (Attribute.GetCustomAttribute(typeof(MyDerivedClass), typeof(YourCustomAttribute), false))));
- i++;
- AssertEquals ("A3", "MyDerivedClass", ((MyCustomAttribute) (Attribute.GetCustomAttribute(typeof(MyDerivedClass), typeof(MyCustomAttribute)))).Info);
- i++;
- AssertEquals ("A4", 37, ((YourCustomAttribute) (Attribute.GetCustomAttribute(t, typeof(YourCustomAttribute)))).Value);
- } catch (Exception e) {
- Fail ("Unexpected exception thrown at i=" + i + " with t=" + t + ". e=" + e);
- }
- }
-/*
-
- public static void WriteAttributes (Attribute[] attrs)
- {
- Console.WriteLine("length = {0}", attrs.Length);
- foreach (Attribute a in attrs) {
- WriteAttribute (a);
- }
- }
-
-
- private static void TestGetCustomAttributes ()
- {
- Console.WriteLine(">>>GetCustomAttributes");
-
-
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), typeof(MyCustomAttribute)));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), typeof(MyCustomAttribute), true));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), typeof(MyCustomAttribute), false));
-
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass)));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), true));
- WriteAttributes (Attribute.GetCustomAttributes(typeof(MyDerivedClass), false));
- }
-
-*/
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/BitConverterTest.cs b/mcs/class/corlib/Test/System/BitConverterTest.cs
deleted file mode 100755
index 6510b83255e..00000000000
--- a/mcs/class/corlib/Test/System/BitConverterTest.cs
+++ /dev/null
@@ -1,545 +0,0 @@
-//
-// BitConverterTest.cs - NUnit Test Cases for System.BitConverter
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class BitConverterTest : TestCase {
-
- public BitConverterTest () : base ("System.BitConverter testsuite") {}
- public BitConverterTest (string name) : base(name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown() {}
-
- // this property is required. You need change the parameter for
- // typeof() below to be your class.
- public static ITest Suite {
- get {
- return new TestSuite(typeof(BitConverterTest));
- }
- }
-
- public void TestIsLittleEndian ()
- {
- byte[] b;
-
- b = BitConverter.GetBytes (1);
- AssertEquals ("A1", b[0] == 1, BitConverter.IsLittleEndian );
- }
-
- private void PrivateTestSingle (float v1)
- {
- float v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 4, b.Length);
-
- v2 = BitConverter.ToSingle (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToSingle (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToSingle (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToSingle ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestSingle()
- {
- PrivateTestSingle (0.1f);
- PrivateTestSingle (24.1e30f);
- }
-
- private void PrivateTestDouble (double v1)
- {
- double v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 8, b.Length);
-
- v2 = BitConverter.ToDouble (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToDouble (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToDouble (larger, 3);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToDouble ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestDouble ()
- {
- double d = 123.321;
-
- AssertEquals("A1", d, BitConverter.Int64BitsToDouble (BitConverter.DoubleToInt64Bits (d)));
-
- PrivateTestDouble (0.1);
- PrivateTestDouble (24.1e77);
- }
-
- private void PrivateTestBool (bool v1)
- {
- bool v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 1, b.Length);
-
- v2 = BitConverter.ToBoolean (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToBoolean (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToBoolean (larger, 4);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToBoolean ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestBool () {
- PrivateTestBool(true);
- PrivateTestBool(false);
- }
-
- private void PrivateTestChar (char v1)
- {
- char v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 2, b.Length);
-
- v2 = BitConverter.ToChar (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToChar (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToChar (larger, 3);
- exception = false;
- }
- // LAMESPEC:
- // the docs say it should be ArgumentOutOfRangeException, but
- // the mscorlib throws an ArgumentException.
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToChar ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestChar ()
- {
- PrivateTestChar('A');
- PrivateTestChar('\x01ff');
- }
-
- private void PrivateTestInt16 (short v1)
- {
- short v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 2, b.Length);
-
- v2 = BitConverter.ToInt16 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToInt16 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToInt16 (larger, 3);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToInt16 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestInt16 ()
- {
- PrivateTestInt16 (0);
- PrivateTestInt16 (1000);
- PrivateTestInt16 (-32768);
- PrivateTestInt16 (32767);
- }
-
- private void PrivateTestUInt16 (ushort v1)
- {
- ushort v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 2, b.Length);
-
- v2 = BitConverter.ToUInt16 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToUInt16 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToUInt16 (larger, 3);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToUInt16 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestUInt16 ()
- {
- PrivateTestUInt16 (0);
- PrivateTestUInt16 (1000);
- PrivateTestUInt16 (65535);
- }
-
- private void PrivateTestInt32 (int v1)
- {
- int v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 4, b.Length);
-
- v2 = BitConverter.ToInt32 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToInt32 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToInt32 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToInt32 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestInt32 ()
- {
- PrivateTestInt32 (0);
- PrivateTestInt32 (1000);
- PrivateTestInt32 (-2147483648);
- PrivateTestInt32 (2147483647);
- }
-
- private void PrivateTestUInt32 (uint v1)
- {
- uint v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals ("A1", 4, b.Length);
-
- v2 = BitConverter.ToUInt32 (b, 0);
- AssertEquals ("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToUInt32 (larger, 1);
- AssertEquals ("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToUInt32 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToUInt32 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestUInt32 ()
- {
- PrivateTestUInt32 (0u);
- PrivateTestUInt32 (1000u);
- PrivateTestUInt32 (4294967295u);
- }
-
- private void PrivateTestInt64 (long v1)
- {
- long v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals ("A1", 8, b.Length);
-
- v2 = BitConverter.ToInt64 (b, 0);
- AssertEquals ("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToInt64 (larger, 1);
- AssertEquals ("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToInt64 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToInt64 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestInt64 ()
- {
- PrivateTestInt64 (0);
- PrivateTestInt64 (1000);
- PrivateTestInt64 (-9223372036854775808);
- PrivateTestInt64 (9223372036854775807);
- }
-
- private void PrivateTestUInt64 (ulong v1)
- {
- ulong v2;
- byte[] b;
- byte[] larger = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 };
- bool exception;
-
- b = BitConverter.GetBytes (v1);
- AssertEquals("A1", 8, b.Length);
-
- v2 = BitConverter.ToUInt64 (b, 0);
- AssertEquals("A2", v1, v2);
-
- b.CopyTo (larger, 1);
- v2 = BitConverter.ToUInt64 (larger, 1);
- AssertEquals("A3", v1, v2);
-
- try {
- v2 = BitConverter.ToUInt64 (larger, 8);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- v2 = BitConverter.ToUInt64 ((byte[]) null, 77);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A5", exception);
- }
-
- public void TestUInt64 ()
- {
- PrivateTestUInt64 (0);
- PrivateTestUInt64 (1000);
- PrivateTestUInt64 (18446744073709551615);
- }
-
- public void TestToString ()
- {
- string s;
- bool exception;
-
- byte[] b = new byte[] {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
-
- AssertEquals ("A1", "00-11-22-33-44-55-66-77-88-99-AA-BB-CC-DD-EE-FF", BitConverter.ToString (b));
- AssertEquals ("A2", "66-77-88-99-AA-BB-CC-DD-EE-FF", BitConverter.ToString (b, 6));
- AssertEquals ("A3", "66-77-88", BitConverter.ToString (b, 6, 3));
-
- try {
- s = BitConverter.ToString ((byte[]) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- s = BitConverter.ToString (b, 20);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A5", exception);
-
- try {
- s = BitConverter.ToString ((byte[]) null, 20);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A6", exception);
-
- try {
- s = BitConverter.ToString (b, 20, 3);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A7", exception);
-
- try {
- s = BitConverter.ToString ((byte[]) null, 20, 3);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A8", exception);
-
- try {
- s = BitConverter.ToString (b, 16, 0);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A9", exception);
-
-
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/BooleanTest.cs b/mcs/class/corlib/Test/System/BooleanTest.cs
deleted file mode 100644
index a7bae95c993..00000000000
--- a/mcs/class/corlib/Test/System/BooleanTest.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-// BooleanTest.cs - NUnit Test Cases for the System.Boolean class
-//
-// Bob Doan <bdoan@sicompos.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class BooleanTest : TestCase
-{
- public BooleanTest () : base ("MonoTests.System.BooleanTests testcase") {}
- public BooleanTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (BooleanTest));
- }
- }
-
- public void TestStrings ()
- {
- AssertEquals("Wrong False string", "False", Boolean.FalseString);
- AssertEquals("Wrong True string", "True", Boolean.TrueString);
- }
-
- public void TestCompareTo() {
- Boolean t=true,f=false;
- String s = "What Ever";
- AssertEquals("CompareTo Failed", true, f.CompareTo(t) < 0);
- AssertEquals("CompareTo Failed", 0, f.CompareTo(f));
- AssertEquals("CompareTo Failed", 0, t.CompareTo(t));
- AssertEquals("CompareTo Failed", true, t.CompareTo(f) > 0);
- AssertEquals("CompareTo Failed", true, t.CompareTo(null) > 0);
- try {
- t.CompareTo(s);
- Fail("CompareTo should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("CompareTo should be a System.ArgumentException", typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals() {
- Boolean t=true, f=false;
- String s = "What Ever";
- AssertEquals("Equals Failed", true, t.Equals(t));
- AssertEquals("Equals Failed", true, f.Equals(f));
- AssertEquals("Equals Failed", false, f.Equals(t));
- AssertEquals("Equals Failed", false, t.Equals(null));
- AssertEquals("Equals Failed", false, t.Equals(s));
- }
-
- public void TestGetHashCode() {
- Boolean t=true, f=false;
- AssertEquals("GetHashCode True failed", 1, t.GetHashCode());
- AssertEquals("GetHashCode True failed", 0, f.GetHashCode());
- }
-
- public void TestGetType() {
- Boolean t=true, f=false;
- AssertEquals("GetType failed", true, Object.ReferenceEquals(t.GetType(), f.GetType()));
- }
-
- public void TestGetTypeCode() {
- Boolean b=true;
- AssertEquals("GetTypeCode failed", TypeCode.Boolean, b.GetTypeCode());
- }
-
- public void TestParse() {
- AssertEquals("Parse True failed", true, Boolean.Parse("True"));
- AssertEquals("Parse True failed", true, Boolean.Parse(" True"));
- AssertEquals("Parse True failed", true, Boolean.Parse("True "));
- AssertEquals("Parse True failed", true, Boolean.Parse("tRuE"));
- AssertEquals("Parse False failed", false, Boolean.Parse("False"));
- AssertEquals("Parse False failed", false, Boolean.Parse(" False"));
- AssertEquals("Parse False failed", false, Boolean.Parse("False "));
- AssertEquals("Parse False failed", false, Boolean.Parse("fAlSe"));
-
- try {
- Boolean.Parse("not-t-or-f");
- Fail("Parse should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("Parse should be a System.FormatException", typeof(FormatException) == e.GetType());
- }
-
- try {
- Boolean.Parse(null);
- Fail("Parse should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Parse should be a System.ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
- }
-
- public void TestToString() {
- Boolean t=true,f=false;
- AssertEquals("ToString True Failed", Boolean.TrueString, t.ToString());
- AssertEquals("ToString False Failed", Boolean.FalseString, f.ToString());
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ByteTest.cs b/mcs/class/corlib/Test/System/ByteTest.cs
deleted file mode 100644
index 751d5c22517..00000000000
--- a/mcs/class/corlib/Test/System/ByteTest.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-// ByteTest.cs - NUnit Test Cases for the System.Byte struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class ByteTest : TestCase
-{
- private const Byte MyByte1 = 42;
- private const Byte MyByte2 = 0;
- private const Byte MyByte3 = 255;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "255";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = { "",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results1_Nfi = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"255.00000",
- "00255", "2.55000e+002", "255.00000",
- "255", "255.00000", "25,500.00000 %", "000ff"};
- private string[] Results2_Nfi = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"255.00000",
- "00255", "2.55000e+002", "255.00000",
- "255", "255.00000", "25,500.00000 %", "000ff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public ByteTest() : base ("MonoTests.System.ByteTests testcase") {}
- public ByteTest(string name) : base(name) {}
-
- protected override void SetUp() {
- int cdd = NumberFormatInfo.CurrentInfo.CurrencyDecimalDigits;
- string csym = NumberFormatInfo.CurrentInfo.CurrencySymbol;
- string csuffix = (cdd > 0 ? "." : "").PadRight(cdd + (cdd > 0 ? 1 : 0), '0');
- Results1[0] = csym + "0" + csuffix;
- }
-
- protected override void TearDown () {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ByteTest));
- }
- }
-
- public void TestMinMax()
- {
- AssertEquals(Byte.MinValue, MyByte2);
- AssertEquals(Byte.MaxValue, MyByte3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyByte3.CompareTo(MyByte2) > 0);
- Assert(MyByte2.CompareTo(MyByte2) == 0);
- Assert(MyByte1.CompareTo((Byte)42) == 0);
- Assert(MyByte2.CompareTo(MyByte3) < 0);
- try {
- MyByte2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyByte1.Equals(MyByte1));
- Assert(MyByte1.Equals((Byte)42));
- Assert(MyByte1.Equals((Int16)42) == false);
- Assert(MyByte1.Equals(MyByte2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyByte1.GetHashCode();
- MyByte2.GetHashCode();
- MyByte3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert("MyByte1="+MyByte1+", MyString1="+MyString1+", Parse="+Byte.Parse(MyString1) , MyByte1 == Byte.Parse(MyString1));
- Assert("MyByte2", MyByte2 == Byte.Parse(MyString2));
- Assert("MyByte3", MyByte3 == Byte.Parse(MyString3));
-
- try {
- Byte.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Should get ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Byte.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("not-a-number", typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = Byte.MaxValue + 1;
- Byte.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert("OverflowException", typeof(OverflowException) == e.GetType());
- }
-
- //test Parse(string s, NumberStyles style)
- AssertEquals(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ",
- (byte)42, Byte.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ",
- NumberStyles.Currency));
- try {
- Byte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 and NumberStyles.Integer", typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(" 42 and Nfi", 42 == Byte.Parse(" 42 ", Nfi));
- try {
- Byte.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("%42 and Nfi", typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert("NumberStyles.HexNumber", 16 == Byte.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Byte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42, NumberStyles.Integer, Nfi", typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals("Compare failed for MyString1 and MyByte1", MyString1, MyByte1.ToString());
- AssertEquals("Compare failed for MyString2 and MyByte2", MyString2, MyByte2.ToString());
- AssertEquals("Compare failed for MyString3 and MyByte3", MyString3, MyByte3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("Compare failed for Formats1["+i.ToString()+"]", Results1[i], MyByte2.ToString(Formats1[i]));
- AssertEquals("Compare failed for Formats2["+i.ToString()+"]", Results2[i], MyByte3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("Compare failed for Formats1["+i.ToString()+"] with Nfi", Results1_Nfi[i], MyByte2.ToString(Formats1[i], Nfi));
- AssertEquals("Compare failed for Formats2["+i.ToString()+"] with Nfi", Results2_Nfi[i], MyByte3.ToString(Formats2[i], Nfi));
- }
- try {
- MyByte1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- AssertEquals("Exception is the wrong type", typeof(FormatException), e.GetType());
- }
-
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog
deleted file mode 100644
index 0f6fe6db0d0..00000000000
--- a/mcs/class/corlib/Test/System/ChangeLog
+++ /dev/null
@@ -1,468 +0,0 @@
-2002-06-20 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest2.cs: Make tests pass against ms.net.
-
-2002-06-19 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add missing test: DecimalTest2
- * DecimalTest2.cs: Convert Console.Writeline() into a Fail()
-
-2002/06/14 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: Make currency symbol test more culturally sensitive.
-
-2002-06-14 Nick Drochak <ndrochak@gol.com>
-
- * DateTimeTest.cs: Make some of the tests a bit more timezone neutral.
-
-2002-06-12 Nick Drochak <ndrochak@gol.com>
-
- * ConvertTest.cs: Punt bug in DateTime.Parse() over to that test.
- * DateTimeTest.cs: Add test for date format of yyyy-mm-dd which mono
- doesn't handle automagically like ms.net does. This smells like a
- LAMESPEC, however.
-
-2002/06/12 Nick Drochak <ndrochak@gol.com>
-
- * RandomTest.cs: Exercise Next(min,max) a little more, especially
- boundary conditions.
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Check for "end of string" conditions for IndexOf() and
- Substring().
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * DoubleTest.cs: Add some more detail to failure message.
- * Int64Test.cs: Add some details, and fix a copy-paste error.
- * UInt32Test.cs: Fix currency symbol/culture issues
- * UInt64Test.cs: Fix currency symbol/culture issues
-
-2002/06/11 Nick Drochak <ndrochak@gol.com>
-
- * DateTimeTest.cs: Remove RunTest override and put culture manipulation
- in SetUp and TearDown like the other tests.
- * TimeZoneTest.cs: Same.
-
-2002-06-11 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: Set the culture to en-US for testing.
- * MathTest.cs: mono is more precise in Log2, so change test to compare
- values within a slightly larger margin of error.
-
-2002/06/10 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: More culture indepenence. Fixes the problems we were
- having with tests failing against MS.NET.
- * Int64Test.cs: Same plus some formatting fixes.
- * RandomTest.cs: Split Assert into two to figure out which one part is
- failing.
-
-2002-06-09 Lawrence Pit <loz@cable.a2000.nl>
-
- * DateTimeTest.cs: Making tests culture independent
-
-2002-06-07 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Catch unexpected exception and report it.
-
-2002/06/04 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs: Fix currency constant that we use for the expected
- value. Try to be more culture-diverse.
-
-2002/06/03 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Fix some errors that were showing up when run against
- ms.net.
-
-2002-06-02 Nick Drochak <ndrochak@gol.com>
-
- * ConvertTest.cs: Use en-US culture since that's all we support in our
- corlib right now. Change constants accordingly. Also added a bunch of
- try-catch blocks to show which Assert is failing.
-
-2002-06-02 Duncan Mak <duncan@ximian.com>
-
- * ConvertTest.cs (TestToDecimal): Fixed typo in case #H11.
-
-2002-06-01 Nick Drochak <ndrochak@gol.com>
-
- * BugTest.cs: Remove, bug fixed. Yay!
- * AllTests.cs: Remove BugTest from suite.
-
-2002-05-31 Nick Drochak <ndrochak@gol.com>
-
- * BugTest.cs: Small file to show NullReferenceException bug
- * AllTests.cs: Include BugTest.cs in the suite.
-
-2002-05-29 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Use AssertEquals to get nice error report, and mark
- each one with a unique message string so we know which one failed.
-
-2002-05-29 Lawrence Pit <loz@cable.a2000.nl>
-
- * DateTimeTest.cs: Added tests M01 to M03 to TestParseExact,
- passing typeof this class as arg in property Suite.
-
-2002-05-22 Lawrence Pit <loz@cable.a2000.nl>
-
- * ConsoleTest.cs: Added test writing null.
-
-2002-05-21 Nick Drochak <ndrochak@gol.com>
-
- * MathTest.cs:
- (TestPow): Add try-catch to determine where we are throwing.
- (TestLog): Re-enable failing test
- (TestLog2): same although this test still fails on mono. Not
- sure what the proper value to use here. It works on MS.NET
-
-2002-05-21 Nick Drochak <ndrochak@gol.com>
-
- * MathTest.cs: Better reporting of failures
- * Int64Test.cs: Add try-catch to determine where we are throwing.
-
-2002-05-20 Nick Drochak <ndrochak@gol.com>
-
- * AttributeTest.cs (TestGetCustomAttribute): Add try-catch to find out
- which assert is failing.
-
-2002-05-19 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: Removed.
-
-2002-05-14 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: A couple more tests
-
-2002-05-07 Nick Drochak <ndrochak@gol.com>
-
- * ExceptionTest.cs: New File. Provided by Linus Upson.
-
-2002-05-05 Lawrence Pit <loz@cable.a2000.nl>
-
- * StringTest.cs: Added test for replace function
-
-2002-04-30 Nick Drochak <ndrochak@gol.com>
-
- * UInt32Test.cs: More verbose on unexepected exception to eliminate
- compiler warning.
-
-2002-04-28 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Mark Assert() messages with unique identifiers.
- * DecimalTest2.cs: Write out more info in the Report method. Need this
- to determine why op_Subtraction() is failing in the next line.
- * MathTest.cs:
- * DoubleTest.cs:
- * UInt32Test.cs: Add try-catch blocks to find out where the test is
- failing.
-
-2002-04-28 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs (TestIList_IndexOf): Display exception details if we get
- an unexpected one.
-
-2002/04/24 Nick Drochak <ndrochak@gol.com>
-
- * IntegerFormatterTest.cs: Remove Console.WriteLines and use
- AssertEquals() instead.
-
-2002-04-22 Nick Drochak <ndrochak@gol.com>
-
- * StringTest.cs: Add unique markers to Assert messages.
-
-2002-04-09 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs: Remove BinarySearch test on unsorted arrays. The
- behavior is undefined if the array isn't sorted.
-
-2002/04/09 Nick Drochak <ndrochak@gol.com>
-
- * DecimalTest.cs: Use AssertEquals() for better diagnostic message.
-
-2002-04-09 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs: Use AssertEquals() for better diagnostic message.
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs: Add a few tests for differently underlying types and
- the [Flags] attribute to test ToString().
-
-2002-04-08 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs: Add test for ToString for the case where the enum
- has [Flags] on it, and a mask value is used.
-
-2002-04-04 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs: Change one Assert() message string so the two are
- unique. And clean up exception catching logic.
-
-2002/03/28 Nick Drochak <ndrochak@gol.com>
-
- * IntegerFormatterTest.cs: Eliminate warnings about unused exception
- variables.
-
-2002-03-28 Nick Drochak <ndrochak@gol.com>
-
- * EnumTest.cs(TestFormat): Use Fail() instead of AssertEquals() in
- try-catch blocks. Add test to check if correct exception is being
- thrown.
-
-2002/03/18 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs:
- * Int64Test.cs:
- * SByteTest.cs: Do not hard code the "$" as the currency symbol to
- use for Parse tests. This isn not really the fix we need. These
- number formats vary wildly depending on the culture the system
- runs with. We need a much better strategy here for testing this.
- * Int32Test.cs: Use #if NOTYET-#endif to disable a test. This removes
- an annoying compile warning.
-
-2002-03-18 Nick Drochak <ndrochak@gol.com>
-
- * DoubleTest.cs:
- * EnumTest.cs: Add unique identifier to Assert()'s. Needed to find
- which one was faling on Linux.
-
-2002-03-12 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs: Add tests for IList methods and for enumerator on
- an array with non-zero lower bounds.
-
-2002-03-09 Nick Drochak <ndrochak@gol.com>
-
- * ArrayTest.cs: Enable the enumerator test and include test for
- Multi-dimensional array enumerator. Also include test for
- mutation _not_ invalidating the enumerator.
-
-2002-03-09 Martin Baulig <martin@gnome.org>
-
- * Int16Test.cs, Int32Tests.cs, UInt16Tests.cs: Use "en-US" culture and
- don't let the user override.
-
- * Int32Tests.cs: Cleanup. Use unique names in Assert()s, use AssertEquals()
- where appropriate etc.
-
-2002-03-08 Martin Baulig <martin@gnome.org>
-
- * StringTest.cs: More String.Split tests.
-
-2002-03-07 Martin Baulig <martin@gnome.org>
-
- * StringTest.cs: Added a few more tests for the bug fixes I just
- committed to String.cs.
-
-2002-03-07 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs: Fixed the FIXME in test #E05.
-
-2002-03-06 Duco Fijma <duco@lorentz.xs4all.nl>
- * CharEnumeratorTest.cs: made test regarding out-of-bounds checking
- a bit stronger (new failures fixed in CharEnumerator.cs).
-
-2002-03-06 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs (TestSetValue4): Added testcases #M94-#M96 for Array.Copy.
-
- * ArrayTest.cs (TestCopyTo): Added testcases #F10-#F13 for arrays with
- non-zero lower bounds.
-
- * ArrayTest.cs (TestCopyTo): Added test for copying an empty array
- to an empty array.
-
-2002-03-06 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs: Use unique labels for all the tests.
- (TestSetValue4): A big new testcase.
-
-2002-03-06 Nick Drochak <ndrochak@gol.com>
-
- * VersionTest.cs: Fix for mscorlib behavior vs. docs. CompareTo(null)
- is legal.
- * UInt16Test.cs:
- * UInt32Test.cs:
- * UInt64Test.cs: Use NumberFormatInfo.InvariantInfo.CurrencySymbol
- where "$" was used. Should help suppress false negatives on systems
- where "$" is not the currency symbol.
-
-2002-03-04 Duco Fijma <duco@lorentz.xs4all.nl>
- * VersionTest.cs: created test cases for System.Version
-
-2002-03-03 Duco Fijma <duco@lorentz.xs4all.nl>
- * CharEnumeratorTest.cs: completed the test cases
-
-2002-03-03 Nick Drochak <ndrochak@gol.com>
-
- * DateTimeTest.cs: make static member non-static -- wouldn't work on
- Windows if it was static. Doesn't _need_ to be static anyway.
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
- * AttributeTest.cs: created, far from complete.
- * CharEnumeratorTest.cs: created. Contains just the basic case.
- * AllTests.cs: added the two new tests above
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
- * BitConverterTest.cs: added one test for bug fix made to BitConverter
- * class.
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * ArrayTest.cs: Commented out a few bits which are not yet implemented and
- marked them with FIXME's.
-
- * DecimalTest.cs, DecimalTest2.cs: Added zero-arg constructors.
-
- * MartinTests.cs: Enabled ArrayTests.cs.
-
-2002-03-01 Duco Fijma <duco@lorentz.xs4all.nl>
-
- * BitConverterTest.cs: completed test cases
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: 15 tests currently work on Linux, call them all and
- provide comments for the non-working tests.
-
-2002-02-28 Duncan Mak <duncan@ximian.com>
-
- * MathTest.cs: Committed for Jon Guymon <gnarg@slackworks.com>.
-
-2002-02-28 Martin Baulig <martin@gnome.org>
-
- * String.cs (TestCompare): Added a few tests.
- (TestFormat): Please don't compare two strings with Assert (... == ...),
- use AssertEquals instead - this gives you a better idea what went wrong
- if the test fails.
-
-2002-02-28 Nick Drochak <ndrochak@gol.com>
-
- * BitConverterTest.cs: Test was trying to catch the wrong Exception.
- The MSDN docs clearly say ArgumentOutOfRangeException, but that's
- not what get's thrown.
-
- * DoubleTest.cs: Get working against mscorlib reference.
-
-2002-02-27 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: changed to reflect new meaning of Guid.ToString("")
- and Guid.ToString(null)
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * MartinTests.cs: New file. This contains all the test which already
- work on Linux.
-
- * String.cs: Added two testcases to TestTrim(), TestTrimStart() and
- TestTrimEnd().
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTimeTest.cs: Added testcases for the parsers. Use the invariant
- culture to run this test suite.
-
- * TimeZoneTest.cs: Use the invariant culture to run this test suite.
-
-2002-02-26 Duco Fijma <duco@lorentz.xs4all>
- * TimeSpanTest.cs: added test from TimeSpan.FromMilliseconds
-
-2002-02-26 Martin Baulig <martin@gnome.org>
-
- * DateTimeTest.cs: New test.
-
- * TimeZoneTest.cs: New test.
-
-2002-02-25 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: all methods of System.Guid are now covered
- * BitConverterTest.cs: created, not yet complete
-
-2002-02-21 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: changed according to fix in System.Guid
-
-2002-02-20 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: One array was giving us trouble. Not sure why, but
- it's related to the number of elements in an Array. For short Arrays
- the compiler doesn't use the PrivateImplmentationDetails struct,
- but for longer ones it does. That's when our corlib fails. I paired
- down the array for now.
-
-2002-02-19 Duco Fijma <duco@lorentz.xs4all.nl>
- * GuidTest.cs: added a few cases
-
-2002-02-18 Nick Drochak <ndrochak@gol.com>
-
- * GuidTest.cs: Fix compile error. Needed to cast the null in the call to
- constructor to avoid ambiguity.
-
-2002-02-11 Nick Drochak <ndrochak@gol.com>
-
- * Int64Test.cs: Various fixes to make tests work against the ms corlib.
- Currency Symbol tests seem to be system dependant. Not sure if this
- will work on other systems, so please test it if you can. The most
- disturbing one is negative numbers. Should they be (n) or -n ?
-
-2002-02-10 Nick Drochak <ndrochak@gol.com>
-
- * AllTests.cs: Add Int64Test to the Suite
- * Int64Test.cs: Change static member to instance member. This was
- causing NUnitConsole some grief. Should be instance member anyway.
-
-2002-02-09 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs:
- * Int16Test.cs:
- * Int32Test.cs:
- * SByteTest.cs:
- * UInt16Test.cs:
- * UInt32Test.cs:
- * UInt64Test.cs: Fixed tests where a "$" was hard coded. Change it to
- use NumberFormatInfo.CurrentInfo.CurrencySymbol. Also used
- NumberFormatInfo.InvariantInfo.CurrencySymbol where appropriate. These
- tests all pass now with mscorlib.
-
-2002-01-06 Nick Drochak <ndrochak@gol.com>
-
- * ResolveEventArgsTest.cs: New test.
- * AllTests.cs: Added new test to suite.
-
-2001-12-27 Nick Drochak <ndrochak@gol.com>
-
- * UInt32Test.cs: Added messages to Asserts()'s to find out which one was faliing.
-
-2001-12-21 Miguel de Icaza <miguel@ximian.com>
-
- * UInt32Test.cs: Added tests for UInt32.Parse.
-
- * Int32Test.cs: Added tests for Int32.Parse for various cases.
-
-2001-12-08 Nick Drochak <ndrochak@gol.com>
-
- * ByteTest.cs: Added messages to Assert()'s to find out which one was failing.
-
-2001-11-28 Nick Drochak <ndrochak@gol.com>
-
- * Int16Test.cs Int32Test.cs SByteTest.cs: Surgically removed tests that rely on culture of system. These need to be crafted a bit differently.
-
-2001-11-27 Nick Drochak <ndrochak@gol.com>
-
- * SByteTest.cs: Add messages to Assert()'s so we can tell where the tests fail.
-
-2002-02-21 Bob Doan <bdoan@sicompos.com>
-
- * BooleanTest.cs: Added New test suite
- * AllTests.cs: Added new Boolean test to suite.
-
-2002-02-24 Bob Doan <bdoan@sicompos.com>
-
- * BooleanTest.cs: Use correct argument order in AssertEquals
- * AllTests.cs: Added new Double test to suite.
- * DoubleTest.cs: Add new test suite
-
-2002-02-24 Bob Doan <bdoan@sicompos.com>
-
- * DoubleTest.cs: Added parse tests to Double test suite, removed GetHashCodeTests
diff --git a/mcs/class/corlib/Test/System/CharEnumeratorTest.cs b/mcs/class/corlib/Test/System/CharEnumeratorTest.cs
deleted file mode 100755
index da7fecbc221..00000000000
--- a/mcs/class/corlib/Test/System/CharEnumeratorTest.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// CharEnumeratorTest.cs - NUnit Test Cases for the System.CharEnumerator class
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class CharEnumeratorTest : TestCase
-{
- public CharEnumeratorTest () : base ("MonoTests.System.CharEnumeratorTest testcase") {}
- public CharEnumeratorTest (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (CharEnumeratorTest));
- }
- }
-
- string _s;
-
- protected override void SetUp ()
- {
- _s = "Emma en Sophie";
- }
-
- private string GetFromEnumerator (CharEnumerator ce)
- {
- string res = "";
- bool cont = true;
-
- while (cont) {
- res += ce.Current;
- cont = ce.MoveNext ();
- }
-
- return res;
- }
-
- public void TestBasic ()
- {
- CharEnumerator ce = _s.GetEnumerator ();
-
- ce.MoveNext ();
-
- AssertEquals ("A1", _s, GetFromEnumerator (ce));
- }
-
- public void TestClone ()
- {
- CharEnumerator ce1, ce2=null;
- bool cont;
-
- ce1 = _s.GetEnumerator ();
- cont = ce1.MoveNext ();
- while (cont) {
- if (ce1.Current == 'S') {
- ce2 = (CharEnumerator) (ce1.Clone ());
- }
- cont = ce1.MoveNext ();
- }
-
- AssertEquals ("A1", "Sophie", GetFromEnumerator(ce2));
- }
-
- public void TestReadOutOfBounds ()
- {
- char c;
- bool exception;
- CharEnumerator ce = _s.GetEnumerator ();
-
- try {
- c = ce.Current;
- exception = false;
- }
- catch (InvalidOperationException) {
- exception = true;
- }
- Assert ("A1", exception);
-
- AssertEquals("A2", true, ce.MoveNext ());
-
- AssertEquals ("A3", _s, GetFromEnumerator (ce));
-
- try {
- c = ce.Current;
- }
- catch (InvalidOperationException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- AssertEquals("A5", false, ce.MoveNext() );
- AssertEquals("A6", false, ce.MoveNext() );
-
- ce.Reset ();
-
- try {
- c = ce.Current;
- }
- catch (InvalidOperationException) {
- exception = true;
- }
- Assert ("A7", exception);
-
- AssertEquals ("A8", true, ce.MoveNext ());
-
- AssertEquals ("A9", _s, GetFromEnumerator (ce));
-
- AssertEquals ("A10", false, ce.MoveNext ());
- AssertEquals ("A11", false, ce.MoveNext ());
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/CharTest.cs b/mcs/class/corlib/Test/System/CharTest.cs
deleted file mode 100644
index 3f89fd24381..00000000000
--- a/mcs/class/corlib/Test/System/CharTest.cs
+++ /dev/null
@@ -1,500 +0,0 @@
-// CharTest.cs - NUnit Test Cases for the System.Char struct
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class CharTest : TestCase
-{
- public CharTest() : base ("MonoTests.System.CharTest testsuite") {}
- public CharTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(CharTest));
- }
- }
-
- public void TestCompareTo()
- {
- Char c1 = 'a';
- Char c2 = 'b';
- Char c3 = 'b';
- Assert("Less than", c1.CompareTo(c2) == -1);
- Assert("Greater than", c2.CompareTo(c1) == 1);
- Assert("Equal 1", c2.CompareTo(c3) == 0);
- Assert("Equal 2", c1.CompareTo(c1) == 0);
- }
-
- public void TestEquals()
- {
- Char c1 = 'a';
- Char c2 = 'b';
- Char c3 = 'b';
- Assert("Same", c1.Equals(c1));
- Assert("Same value", c2.Equals(c3));
- Assert("Not same", !c1.Equals(c2));
- }
-
- public void TestGetHashValue()
- {
- Char c1 = ' ';
- AssertEquals("deterministic hash code ", c1.GetHashCode(), c1.GetHashCode());
- // TODO - the spec doesn't say what algorithm is used to get hash codes. So far, just a weak test for determinism and mostly-uniqueness.
- }
-
- public void TestGetNumericValue()
- {
- Char c1 = ' ';
- Char c2 = '3';
- AssertEquals("code 1", -1.0, Char.GetNumericValue(c1), 0.1);
- AssertEquals("code 2", 3.0, Char.GetNumericValue(c2), 0.1);
-
- string s1 = " 3 ";
- AssertEquals("space not number", -1.0, Char.GetNumericValue(s1, 0), 0.1);
- AssertEquals("space not number", 3.0, Char.GetNumericValue(s1, 1), 0.1);
- AssertEquals("space not number", -1.0, Char.GetNumericValue(s1, 2), 0.1);
- }
-
- public void TestGetUnicodeCategory()
- {
- {
- char Pe1 = ']';
- char Pe2 = '}';
- char Pe3 = ')';
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe1));
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe2));
- AssertEquals("Close Punctuation",
- UnicodeCategory.ClosePunctuation,
- Char.GetUnicodeCategory(Pe3));
- }
- // TODO - ConnectorPunctuation
- {
- char c1 = (char)0; // 0000-001F, 007F-009F
- char c2 = (char)0x001F;
- char c3 = (char)0x007F;
- char c4 = (char)0x00F;
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c1));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c2));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c3));
- AssertEquals("Control",
- UnicodeCategory.Control,
- Char.GetUnicodeCategory(c4));
- }
- {
- // TODO - more currencies?
- char c1 = '$';
- AssertEquals("Currency",
- UnicodeCategory.CurrencySymbol,
- Char.GetUnicodeCategory(c1));
- }
- {
- char c1 = '-';
- AssertEquals("Dash Punctuation",
- UnicodeCategory.DashPunctuation,
- Char.GetUnicodeCategory(c1));
- }
- {
- char c1 = '2';
- char c2 = '7';
- AssertEquals("Decimal Digit",
- UnicodeCategory.DecimalDigitNumber,
- Char.GetUnicodeCategory(c1));
- AssertEquals("Decimal Digit",
- UnicodeCategory.DecimalDigitNumber,
- Char.GetUnicodeCategory(c2));
- }
- // TODO - EnclosingMark
- // TODO - FinalQuotePunctuation
- // TODO - Format
- // TODO - InitialQuotePunctuation
- // TODO - LetterNumber
- // TODO - LineSeparator (not '\n', that's a control char)
- {
- char c1 = 'a';
- char c2 = 'z';
- AssertEquals("LowercaseLetter",
- UnicodeCategory.LowercaseLetter,
- Char.GetUnicodeCategory(c1));
- AssertEquals("LowercaseLetter",
- UnicodeCategory.LowercaseLetter,
- Char.GetUnicodeCategory(c2));
- }
- {
- char c1 = '+';
- char c2 = '=';
- AssertEquals("MathSymbol",
- UnicodeCategory.MathSymbol,
- Char.GetUnicodeCategory(c1));
- AssertEquals("MathSymbol",
- UnicodeCategory.MathSymbol,
- Char.GetUnicodeCategory(c2));
- }
- // TODO - ModifierSymbol
- // TODO - NonSpacingMark
- // TODO - OpenPunctuation
- {
- char c1 = '[';
- char c2 = '{';
- char c3 = '(';
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c1));
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c2));
- AssertEquals("OpenPunctuation",
- UnicodeCategory.OpenPunctuation,
- Char.GetUnicodeCategory(c3));
- }
- // TODO - OtherLetter
- // TODO - OtherNotAssigned
- // TODO - OtherNumber
- {
- char c1 = '/';
- AssertEquals("OtherPunctuation",
- UnicodeCategory.OtherPunctuation,
- Char.GetUnicodeCategory(c1));
- }
- // TODO - OtherSymbol
- // TODO - ParagraphSeparator
- // TODO - PrivateUse
- {
- char c1 = ' ';
- AssertEquals("SpaceSeparator",
- UnicodeCategory.SpaceSeparator,
- Char.GetUnicodeCategory(c1));
- }
- // TODO - SpacingCombiningMark
- {
- char c1 = (char)0xD800; // D800-DBFF
- char c2 = (char)0xDBFF; // D800-DBFF
- char c3 = (char)0xDC01; // DC00-DEFF
- char c4 = (char)0xDEFF; // DC00-DEFF
- AssertEquals("High Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c1));
- AssertEquals("High Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c2));
- AssertEquals("Low Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c3));
- AssertEquals("Low Surrogate",
- UnicodeCategory.Surrogate,
- Char.GetUnicodeCategory(c4));
- }
- // TODO - TitlecaseLetter
- // TODO - UppercaseLetter
- {
- char c1 = 'A';
- char c2 = 'Z';
- AssertEquals("UppercaseLetter",
- UnicodeCategory.UppercaseLetter,
- Char.GetUnicodeCategory(c1));
- AssertEquals("UppercaseLetter",
- UnicodeCategory.UppercaseLetter,
- Char.GetUnicodeCategory(c2));
- }
- }
-
- public void TestIsControl()
- {
- // control is 0000-001F, 007F-009F
- char c1 = (char)0;
- char c2 = (char)0x001F;
- char c3 = (char)0x007F;
- char c4 = (char)0x009F;
- Assert("Not control", !Char.IsControl(' '));
- Assert("control", Char.IsControl(c1));
- Assert("control", Char.IsControl(c2));
- Assert("control", Char.IsControl(c3));
- Assert("control", Char.IsControl(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not control", !Char.IsControl(s1, 0));
- Assert("control", Char.IsControl(s1, 1));
- Assert("control", Char.IsControl(s1, 2));
- Assert("control", Char.IsControl(s1, 3));
- Assert("control", Char.IsControl(s1, 4));
- }
-
- public void TestIsDigit()
- {
- char c1 = '0';
- char c2 = '9';
- Assert("Not digit", !Char.IsDigit(' '));
- Assert("digit", Char.IsDigit(c1));
- Assert("digit", Char.IsDigit(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not digit", !Char.IsDigit(s1, 0));
- Assert("digit", Char.IsDigit(s1, 1));
- Assert("digit", Char.IsDigit(s1, 2));
- }
-
- public void TestIsLetter()
- {
- char c1 = 'a';
- char c2 = 'z';
- char c3 = 'A';
- char c4 = 'Z';
- Assert("Not letter", !Char.IsLetter(' '));
- Assert("letter", Char.IsLetter(c1));
- Assert("letter", Char.IsLetter(c2));
- Assert("letter", Char.IsLetter(c3));
- Assert("letter", Char.IsLetter(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not letter", !Char.IsLetter(s1, 0));
- Assert("letter", Char.IsLetter(s1, 1));
- Assert("letter", Char.IsLetter(s1, 2));
- Assert("letter", Char.IsLetter(s1, 3));
- Assert("letter", Char.IsLetter(s1, 4));
- }
-
- public void TestIsLetterOrDigit()
- {
- char c1 = 'a';
- char c2 = 'z';
- char c3 = 'A';
- char c4 = 'Z';
- char c5 = '0';
- char c6 = '9';
- Assert("Not letterordigit", !Char.IsLetterOrDigit(' '));
- Assert("letterordigit", Char.IsLetterOrDigit(c1));
- Assert("letterordigit", Char.IsLetterOrDigit(c2));
- Assert("letterordigit", Char.IsLetterOrDigit(c3));
- Assert("letterordigit", Char.IsLetterOrDigit(c4));
- Assert("letterordigit", Char.IsLetterOrDigit(c5));
- Assert("letterordigit", Char.IsLetterOrDigit(c6));
-
- string s1 = " " + c1 + c2 + c3 + c4 + c5 + c6;
- Assert("Not letterordigit", !Char.IsLetterOrDigit(s1, 0));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 1));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 2));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 3));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 4));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 5));
- Assert("letterordigit", Char.IsLetterOrDigit(s1, 6));
- }
-
- public void TestIsLower()
- {
- char c1 = 'a';
- char c2 = 'z';
- Assert("Not lower", !Char.IsLower(' '));
- Assert("lower", Char.IsLower(c1));
- Assert("lower", Char.IsLower(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not lower", !Char.IsLower(s1, 0));
- Assert("lower", Char.IsLower(s1, 1));
- Assert("lower", Char.IsLower(s1, 2));
- }
-
- public void TestIsNumber()
- {
- char c1 = '0';
- char c2 = '9';
- // TODO - IsNumber of less obvious characters
-
- Assert("Not number", !Char.IsNumber(' '));
- Assert("number", Char.IsNumber(c1));
- Assert("number", Char.IsNumber(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not number", !Char.IsNumber(s1, 0));
- Assert("number", Char.IsNumber(s1, 1));
- Assert("number", Char.IsNumber(s1, 2));
- }
-
- public void TestIsPunctuation()
- {
- char c1 = '.';
- char c2 = '?';
- Assert("Not punctuation", !Char.IsPunctuation(' '));
- Assert("punctuation", Char.IsPunctuation(c1));
- Assert("punctuation", Char.IsPunctuation(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not punctuation", !Char.IsPunctuation(s1, 0));
- Assert("punctuation", Char.IsPunctuation(s1, 1));
- Assert("punctuation", Char.IsPunctuation(s1, 2));
- }
-
- public void TestIsSeparator()
- {
- char c1 = ' ';
-
- Assert("Not separator", !Char.IsSeparator('.'));
- Assert("separator1", Char.IsSeparator(c1));
-
- string s1 = "." + c1;
- Assert("Not separator", !Char.IsSeparator(s1, 0));
- Assert("separator1-2", Char.IsSeparator(s1, 1));
- }
-
- public void TestIsSurrogate()
- {
- // high surrogate - D800-DBFF
- // low surrogate - DC00-DEFF
- char c1 = (char)0xD800;
- char c2 = (char)0xDBFF;
- char c3 = (char)0xDC00;
- char c4 = (char)0xDEFF;
- Assert("Not surrogate", !Char.IsSurrogate(' '));
- Assert("surrogate1", Char.IsSurrogate(c1));
- Assert("surrogate2", Char.IsSurrogate(c2));
- Assert("surrogate3", Char.IsSurrogate(c3));
- Assert("surrogate4", Char.IsSurrogate(c4));
-
- string s1 = " " + c1 + c2 + c3 + c4;
- Assert("Not surrogate", !Char.IsSurrogate(s1, 0));
- Assert("surrogate1-2", Char.IsSurrogate(s1, 1));
- Assert("surrogate2-2", Char.IsSurrogate(s1, 2));
- Assert("surrogate3-2", Char.IsSurrogate(s1, 3));
- Assert("surrogate4-2", Char.IsSurrogate(s1, 4));
- }
-
- public void TestIsSymbol()
- {
- char c1 = '+';
- char c2 = '=';
- Assert("Not symbol", !Char.IsSymbol(' '));
- Assert("symbol", Char.IsSymbol(c1));
- Assert("symbol", Char.IsSymbol(c2));
-
- string s1 = " " + c1 + c2;
- Assert("Not symbol", !Char.IsSymbol(s1, 0));
- Assert("symbol", Char.IsSymbol(s1, 1));
- Assert("symbol", Char.IsSymbol(s1, 2));
- }
-
- public void TestIsUpper()
- {
- char c1 = 'A';
- char c2 = 'Z';
- Assert("Not upper", !Char.IsUpper('a'));
- Assert("upper", Char.IsUpper(c1));
- Assert("upper", Char.IsUpper(c2));
-
- string s1 = "a" + c1 + c2;
- Assert("Not upper", !Char.IsUpper(s1, 0));
- Assert("upper", Char.IsUpper(s1, 1));
- Assert("upper", Char.IsUpper(s1, 2));
- }
-
- public void TestIsWhiteSpace()
- {
- char c1 = ' ';
- char c2 = '\n';
- char c3 = '\t';
-
- Assert("Not whitespace", !Char.IsWhiteSpace('.'));
- Assert("whitespace1", Char.IsWhiteSpace(c1));
- Assert("whitespace2", Char.IsWhiteSpace(c2));
- Assert("whitespace3", Char.IsWhiteSpace(c3));
-
- string s1 = "." + c1 + c2 + c3;
- Assert("Not whitespace", !Char.IsWhiteSpace(s1, 0));
- Assert("whitespace1-2", Char.IsWhiteSpace(s1, 1));
- Assert("whitespace2-2", Char.IsWhiteSpace(s1, 2));
- Assert("whitespace3-2", Char.IsWhiteSpace(s1, 3));
- }
-
-
- public void TestParse()
- {
- char c1 = 'a';
- string s1 = "a";
- Assert(c1.Equals(Char.Parse(s1)));
- }
-
- public void TestToLower()
- {
- char a1 = 'a';
- char a2 = 'A';
- char a3 = 'z';
- char a4 = 'Z';
- char a5 = ' ';
- char a6 = '+';
- char b1 = 'a';
- char b2 = 'a';
- char b3 = 'z';
- char b4 = 'z';
- char b5 = ' ';
- char b6 = '+';
- AssertEquals("char lowered", b1, Char.ToLower(a1));
- AssertEquals("char lowered", b2, Char.ToLower(a2));
- AssertEquals("char lowered", b3, Char.ToLower(a3));
- AssertEquals("char lowered", b4, Char.ToLower(a4));
- AssertEquals("char lowered", b5, Char.ToLower(a5));
- AssertEquals("char lowered", b6, Char.ToLower(a6));
- }
-
- public void TestToUpper()
- {
- char a1 = 'a';
- char a2 = 'A';
- char a3 = 'z';
- char a4 = 'Z';
- char a5 = ' ';
- char a6 = '+';
- char b1 = 'A';
- char b2 = 'A';
- char b3 = 'Z';
- char b4 = 'Z';
- char b5 = ' ';
- char b6 = '+';
- AssertEquals("char uppered", b1, Char.ToUpper(a1));
- AssertEquals("char uppered", b2, Char.ToUpper(a2));
- AssertEquals("char uppered", b3, Char.ToUpper(a3));
- AssertEquals("char uppered", b4, Char.ToUpper(a4));
- AssertEquals("char uppered", b5, Char.ToUpper(a5));
- AssertEquals("char uppered", b6, Char.ToUpper(a6));
- }
-
-
- public void TestToString()
- {
- char c1 = 'a';
- string s1 = "a";
- Assert(s1.Equals(c1.ToString()));
- }
-
- public void TestGetTypeCode()
- {
- char c1 = 'a';
- Assert(c1.GetTypeCode().Equals(TypeCode.Char));
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ConsoleTest.cs b/mcs/class/corlib/Test/System/ConsoleTest.cs
deleted file mode 100644
index da949017630..00000000000
--- a/mcs/class/corlib/Test/System/ConsoleTest.cs
+++ /dev/null
@@ -1,294 +0,0 @@
-// ConsoleTest.cs - NUnit Test Cases for the System.Console class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-
-namespace MonoTests.System
-{
-
-public class ConsoleTest : TestCase
-{
- public ConsoleTest() : base ("MonoTests.System.ConsoleTest testsuite") {}
- public ConsoleTest(string name) : base(name) {}
-
- TextWriter _err;
- TextReader _in;
- TextWriter _out;
- protected override void SetUp()
- {
- _err = Console.Error;
- _in = Console.In;
- _out = Console.Out;
- }
-
- protected override void TearDown()
- {
- Console.SetError(_err);
- Console.SetIn(_in);
- Console.SetOut(_out);
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ConsoleTest));
- }
- }
-
- public void TestError() {
- AssertNotNull("No error", Console.Error);
- }
-
- public void TestIn() {
- AssertNotNull("No in", Console.In);
- }
-
- public void TestOut() {
- AssertNotNull("No out", Console.Out);
- }
-
- public void TestOpenStandardError() {
- {
- Stream err = Console.OpenStandardError();
- AssertNotNull("Can't open error", err);
- }
- {
- Stream err = Console.OpenStandardError(512);
- AssertNotNull("Can't open error", err);
- }
- // Spec says these are here, MS implementation says no.
- //{
- //bool errorThrown = false;
- //try {
- //Stream err = Console.OpenStandardError(-1);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("negative buffer error not thrown",
- //errorThrown);
- //}
- //{
- //bool errorThrown = false;
- //try {
- //Stream err = Console.OpenStandardError(0);
- //} catch (ArgumentOutOfRangeException) {
- //errorThrown = true;
- //}
- //Assert("zero buffer error not thrown", errorThrown);
- //}
- }
-
- public void TestOpenStandardInput() {
- {
- Stream in1 = Console.OpenStandardInput();
- AssertNotNull("Can't open input", in1);
- }
- {
- Stream in1 = Console.OpenStandardInput(512);
- AssertNotNull("Can't open input", in1);
- }
- // see commented-out tests in TestOpenStandardError
- }
-
- public void TestOpenStandardOutput() {
- {
- Stream out1 = Console.OpenStandardOutput();
- AssertNotNull("Can't open output", out1);
- }
- {
- Stream out1 = Console.OpenStandardOutput(512);
- AssertNotNull("Can't open output", out1);
- }
- // see commented-out tests in TestOpenStandardError
- }
-
- public void TestRead() {
- String testStr = "This is a readline test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- char val = (char) Console.Read();
- AssertEquals("Wrong read", 'T', val);
- }
-
- public void TestReadLine() {
- String testStr = "This is a readline test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- String line = Console.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
-
- public void TestSetError() {
- {
- bool errorThrown = false;
- try {
- Console.SetError(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null error error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stderr test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetError(w);
- Console.Error.WriteLine(testStr);
- s.Position = 0;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestSetIn() {
- {
- bool errorThrown = false;
- try {
- Console.SetIn(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null in error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stdin test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetIn(r);
- w.WriteLine(testStr);
- s.Position = 0;
- String line = Console.In.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestSetOut() {
- {
- bool errorThrown = false;
- try {
- Console.SetOut(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null out error not thrown", errorThrown);
- }
- {
- String testStr = "This is a stdout test";
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
- Console.Out.WriteLine(testStr);
- s.Position = 0;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- }
- }
-
- public void TestWrite() {
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
-
- long endPos = 0;
-
- String testStr = "This is a stdout write test";
- Console.Write(testStr);
- s.Position = endPos;
- String line = r.ReadToEnd();
- AssertEquals("Wrong line", testStr, line);
- endPos = s.Position;
-
- Boolean[] booleans = {true, false};
- foreach (bool b in booleans ) {
- Console.Write(b);
- s.Position = endPos;
- line = r.ReadToEnd();
- AssertEquals("Wrong boolean", b.ToString(), line);
- endPos = s.Position;
- }
-
- Char[] chars = {'a', ';', '?'};
- foreach (Char c in chars ) {
- Console.Write(c);
- s.Position = endPos;
- line = r.ReadToEnd();
- AssertEquals("Wrong char", c.ToString(), line);
- endPos = s.Position;
- }
-
- // test writing a null value
- string x = null;
- Console.Write (x);
-
- // TODO - Likewise for char[], decimal, double, int, long, object, single, uint32, uint64
- // TODO - write with format string
- }
-
- public void TestWriteLine() {
- Stream s = new MemoryStream();
- TextWriter w = new StreamWriter(s);
- ((StreamWriter)w).AutoFlush = true;
- TextReader r = new StreamReader(s);
- Console.SetOut(w);
-
- long endPos = 0;
-
- String testStr = "This is a stdout writeline test";
- Console.WriteLine(testStr);
- s.Position = endPos;
- String line = r.ReadLine();
- AssertEquals("Wrong line", testStr, line);
- endPos = s.Position;
-
- Boolean[] booleans = {true, false};
- foreach (bool b in booleans ) {
- Console.WriteLine(b);
- s.Position = endPos;
- line = r.ReadLine();
- AssertEquals("Wrong boolean", b.ToString(), line);
- endPos = s.Position;
- }
-
- Char[] chars = {'a', ';', '?'};
- foreach (Char c in chars ) {
- Console.WriteLine(c);
- s.Position = endPos;
- line = r.ReadLine();
- AssertEquals("Wrong char", c.ToString(), line);
- endPos = s.Position;
- }
-
- // test writing a null value
- string x = null;
- Console.WriteLine (x);
-
- // TODO - Likewise for char[], decimal, double, int, long, object, single, uint32, uint64
- // TODO - write with format string
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/ConvertTest.cs b/mcs/class/corlib/Test/System/ConvertTest.cs
deleted file mode 100755
index d4fc75aaca6..00000000000
--- a/mcs/class/corlib/Test/System/ConvertTest.cs
+++ /dev/null
@@ -1,2734 +0,0 @@
-// TestConvert.cs - NUnit Test Cases for System.Convert class
-//
-// Krister Hansson (ds99krha@thn.htu.se)
-// Andreas Jonsson (ds99anjn@thn.htu.se)
-//
-// (C) Krister Hansson & Andreas Jonsson
-//
-
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
- public class ConvertTest : TestCase
- {
- public ConvertTest() : base ("MonoTests.System.ConvertTest testsuite") {}
- public ConvertTest(string name) : base(name) {}
-
- bool boolTrue;
- bool boolFalse;
- byte tryByte;
- char tryChar;
- DateTime tryDT;
- decimal tryDec;
- double tryDbl;
- short tryInt16;
- int tryInt32;
- long tryInt64;
- object tryObj;
- sbyte trySByte;
- float tryFloat;
- string falseString;
- string trueString;
- string nullString;
- string tryStr;
- ushort tryUI16;
- uint tryUI32;
- ulong tryUI64;
- CultureInfo ci;
-
- protected override void SetUp() {
- boolTrue = true;
- boolFalse = false;
- tryByte = 0;
- tryChar = 'a';
- tryDT = new DateTime(2002,1,1);
- tryDec = 1234.2345m;
- tryDbl = 0;
- tryInt16 = 1234;
- tryInt32 = 12345;
- tryInt64 = 123456789012;
- tryObj = new Object();
- trySByte = 123;
- tryFloat = 1234.2345f;
- falseString = "false";
- trueString = "true";
- nullString = "null";
- tryStr = "foobar";
- tryUI16 = 34567;
- tryUI32 = 567891234;
- tryUI64 = 0;
- ci = new CultureInfo("en-US");
- ci.NumberFormat.NumberDecimalDigits = 3;
- }
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ConvertTest));
- }
- }
-
- public void TestChangeType() {
- int iTest = 1;
- try {
- AssertEquals("#A01", (short)12345, Convert.ChangeType(tryInt32, typeof(short)));
- iTest++;
- AssertEquals("#A02", 'A', Convert.ChangeType(65, typeof(char)));
- iTest++;
- AssertEquals("#A03", 66, Convert.ChangeType('B', typeof(int)));
- iTest++;
- AssertEquals("#A04", ((ulong)12345), Convert.ChangeType(tryInt32, typeof(ulong)));
-
- iTest++;
- AssertEquals("#A05", true, Convert.ChangeType(tryDec, TypeCode.Boolean));
- iTest++;
- AssertEquals("#A06", 'f', Convert.ChangeType("f", TypeCode.Char));
- iTest++;
- AssertEquals("#A07", (decimal)123456789012, Convert.ChangeType(tryInt64, TypeCode.Decimal));
- iTest++;
- AssertEquals("#A08", (int)34567, Convert.ChangeType(tryUI16, TypeCode.Int32));
-
- iTest++;
- AssertEquals("#A09", (double)567891234, Convert.ChangeType(tryUI32, typeof(double), ci));
- iTest++;
- AssertEquals("#A10", (ushort)0, Convert.ChangeType(tryByte, typeof(ushort), ci));
- iTest++;
- AssertEquals("#A11", (decimal)567891234, Convert.ChangeType(tryUI32, typeof(decimal), ci));
- iTest++;
- AssertEquals("#A12", (float)1234, Convert.ChangeType(tryInt16, typeof(float), ci));
- iTest++;
- AssertEquals("#A13", null, Convert.ChangeType(null, null, ci));
-
- iTest++;
- AssertEquals("#A14", (decimal)0, Convert.ChangeType(tryByte, TypeCode.Decimal, ci));
- iTest++;
- AssertEquals("#A15", "f", Convert.ChangeType('f', TypeCode.String, ci));
- iTest++;
- AssertEquals("#A16", 'D', Convert.ChangeType(68, TypeCode.Char, ci));
- iTest++;
- AssertEquals("#A17", (long)34567, Convert.ChangeType(tryUI16, TypeCode.Int64, ci));
- iTest++;
- AssertEquals("#A18", null, Convert.ChangeType(null, TypeCode.Empty, ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ChangeType(boolTrue, typeof(char));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(tryChar, typeof(DateTime));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(ci, TypeCode.String);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(tryInt32, null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A28", typeof(ArgumentNullException), e.GetType());
- }
-
- try
- {
- Convert.ChangeType(boolTrue, typeof(DateTime), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A29", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(ci, typeof(DateTime), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A30", typeof(InvalidCastException), e.GetType());
- }
-
- /* Should throw ArgumentException but throws InvalidCastException
- try {
- Convert.ChangeType(tryUI32, typeof(FormatException), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A??", typeof(ArgumentException), e.GetType());
- }*/
-
- try {
- Convert.ChangeType(tryUI32, TypeCode.Byte, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ChangeType(boolTrue, TypeCode.Char, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A32", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ChangeType(boolTrue, null, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#A33", typeof(ArgumentNullException), e.GetType());
- }
- }
-
- public void TestGetTypeCode() {
- AssertEquals("#B01", TypeCode.String, Convert.GetTypeCode(tryStr));
- AssertEquals("#B02", TypeCode.UInt16, Convert.GetTypeCode(tryUI16));
- AssertEquals("#B03", TypeCode.UInt32, Convert.GetTypeCode(tryUI32));
- AssertEquals("#B04", TypeCode.UInt64, Convert.GetTypeCode(tryUI64));
- AssertEquals("#B05", TypeCode.Double, Convert.GetTypeCode(tryDbl));
- AssertEquals("#B06", TypeCode.Int16, Convert.GetTypeCode(tryInt16));
- AssertEquals("#B07", TypeCode.Int64, Convert.GetTypeCode(tryInt64));
- AssertEquals("#B08", TypeCode.Object, Convert.GetTypeCode(tryObj));
- AssertEquals("#B09", TypeCode.SByte, Convert.GetTypeCode(trySByte));
- AssertEquals("#B10", TypeCode.Single, Convert.GetTypeCode(tryFloat));
- AssertEquals("#B11", TypeCode.Byte, Convert.GetTypeCode(tryByte));
- AssertEquals("#B12", TypeCode.Char, Convert.GetTypeCode(tryChar));
- AssertEquals("#B13", TypeCode.DateTime, Convert.GetTypeCode(tryDT));
- AssertEquals("#B14", TypeCode.Decimal, Convert.GetTypeCode(tryDec));
- AssertEquals("#B15", TypeCode.Int32, Convert.GetTypeCode(tryInt32));
- AssertEquals("#B16", TypeCode.Boolean, Convert.GetTypeCode(boolTrue));
- }
-
- public void TestIsDBNull() {
- AssertEquals("#C01", false, Convert.IsDBNull(tryInt32));
- AssertEquals("#C02", true, Convert.IsDBNull(Convert.DBNull));
- AssertEquals("#C03", false, Convert.IsDBNull(boolTrue));
- AssertEquals("#C04", false, Convert.IsDBNull(tryChar));
- AssertEquals("#C05", false, Convert.IsDBNull(tryFloat));
- }
-
- public void TestToBoolean() {
- tryObj = (object)tryDbl;
-
- AssertEquals("#D01", true, Convert.ToBoolean(boolTrue));
- AssertEquals("#D02", false, Convert.ToBoolean(tryByte));
- AssertEquals("#D03", true, Convert.ToBoolean(tryDec));
- AssertEquals("#D04", false, Convert.ToBoolean(tryDbl));
- AssertEquals("#D05", true, Convert.ToBoolean(tryInt16));
- AssertEquals("#D06", true, Convert.ToBoolean(tryInt32));
- AssertEquals("#D07", true, Convert.ToBoolean(tryInt64));
- AssertEquals("#D08", false, Convert.ToBoolean(tryObj));
- AssertEquals("#D09", true, Convert.ToBoolean(trySByte));
- AssertEquals("#D10", true, Convert.ToBoolean(tryFloat));
- AssertEquals("#D11", true, Convert.ToBoolean(trueString));
- AssertEquals("#D12", false, Convert.ToBoolean(falseString));
- AssertEquals("#D13", true, Convert.ToBoolean(tryUI16));
- AssertEquals("#D14", true, Convert.ToBoolean(tryUI32));
- AssertEquals("#D15", false, Convert.ToBoolean(tryUI64));
- AssertEquals("#D16", false, Convert.ToBoolean(tryObj,ci));
- AssertEquals("#D17", true, Convert.ToBoolean(trueString, ci));
- AssertEquals("#D18", false, Convert.ToBoolean(falseString, ci));
-
- try {
- Convert.ToBoolean(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToBoolean(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToBoolean(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D22", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToBoolean(nullString);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D23", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestToByte() {
-
- AssertEquals("#E01", (byte)1, Convert.ToByte(boolTrue));
- AssertEquals("#E02", (byte)0, Convert.ToByte(boolFalse));
- AssertEquals("#E03", tryByte, Convert.ToByte(tryByte));
- AssertEquals("#E04", (byte)114, Convert.ToByte('r'));
- AssertEquals("#E05", (byte)201, Convert.ToByte((decimal)200.6));
- AssertEquals("#E06", (byte)125, Convert.ToByte((double)125.4));
- AssertEquals("#E07", (byte)255, Convert.ToByte((short)255));
- AssertEquals("#E08", (byte)254, Convert.ToByte((int)254));
- AssertEquals("#E09", (byte)34, Convert.ToByte((long)34));
- AssertEquals("#E10", (byte)1, Convert.ToByte((object)boolTrue));
- AssertEquals("#E11", (byte)123, Convert.ToByte((float)123.49f));
- AssertEquals("#E12", (byte)57, Convert.ToByte("57"));
- AssertEquals("#E13", (byte)75, Convert.ToByte((ushort)75));
- AssertEquals("#E14", (byte)184, Convert.ToByte((uint)184));
- AssertEquals("#E15", (byte)241, Convert.ToByte((ulong)241));
- AssertEquals("#E16", (byte)123, Convert.ToByte(trySByte, ci));
- AssertEquals("#E17", (byte)27, Convert.ToByte("011011", 2));
- AssertEquals("#E18", (byte)13, Convert.ToByte("15", 8));
- AssertEquals("#E19", (byte)27, Convert.ToByte("27", 10));
- AssertEquals("#E20", (byte)250, Convert.ToByte("FA", 16));
-
- try {
- Convert.ToByte('\u03A9'); // sign of Omega on Win2k
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#D26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToByte((decimal)22000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((double)255.5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte(-tryInt16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((int)-256);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((object)ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E32", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToByte((sbyte)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((float)-0.6f);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte("1a1");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E35", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToByte("457");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((ushort)30000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((uint)300);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte((ulong)987654321321);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToByte("10010111", 3);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E40", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToByte("3F3", 16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#E41", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToChar(){
- tryByte = 58;
- AssertEquals("#F01", ':', Convert.ToChar(tryByte));
- AssertEquals("#F02", 'a', Convert.ToChar(tryChar));
- AssertEquals("#F03", 'A', Convert.ToChar((short)65));
- AssertEquals("#F04", 'x', Convert.ToChar((int)120));
- AssertEquals("#F05", '"', Convert.ToChar((long)34));
- AssertEquals("#F06", '-', Convert.ToChar((sbyte)45));
- AssertEquals("#F07", '@', Convert.ToChar("@"));
- AssertEquals("#F08", 'K', Convert.ToChar((ushort)75));
- AssertEquals("#F09", '=', Convert.ToChar((uint)61));
- AssertEquals("#F10", 'Č', Convert.ToChar((ulong)200));
- AssertEquals("#F11", '{', Convert.ToChar((object)trySByte, ci));
- AssertEquals("#F12", 'o', Convert.ToChar(tryStr.Substring(1,1), ci));
-
- try {
- Convert.ToChar(boolTrue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F22", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryDbl);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F23", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar((short)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F24", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(Int32.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(Int32.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar((long)-123);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F29", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(-trySByte);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryFloat);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F31", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar("foo");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F32", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToChar(null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F33", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToChar(new Exception(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F34", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToChar(null, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F35", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToChar("", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F36", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToChar(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#F37", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestToDateTime() {
- string dateString = "01/01/2002";
-
- int iTest = 1;
- try {
- AssertEquals("#G01", tryDT, Convert.ToDateTime(tryDT));
- iTest++;
- AssertEquals("#G02", tryDT, Convert.ToDateTime(dateString));
- iTest++;
- AssertEquals("#G03", tryDT, Convert.ToDateTime(dateString, ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToDateTime(boolTrue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G10", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryByte);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G11", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G12", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G13", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryDbl);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G14", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryInt16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G15", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryInt32);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G16", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G17", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G18", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(trySByte);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G19", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryFloat);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime("20a2-01-01");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G21", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToDateTime("20002-25-01");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G22", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryUI16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G23", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryUI32);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G24", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(tryUI64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDateTime("20a2-01-01", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#G27", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestToDecimal() {
- AssertEquals("#H01", (decimal)1, Convert.ToDecimal(boolTrue));
- AssertEquals("#H02", (decimal)0, Convert.ToDecimal(boolFalse));
- AssertEquals("#H03", (decimal)tryByte, Convert.ToDecimal(tryByte));
- AssertEquals("#H04", tryDec, Convert.ToDecimal(tryDec));
- AssertEquals("#H05", (decimal)tryDbl, Convert.ToDecimal(tryDbl));
- AssertEquals("#H06", (decimal)tryInt16, Convert.ToDecimal(tryInt16));
- AssertEquals("#H07", (decimal)tryInt32, Convert.ToDecimal(tryInt32));
- AssertEquals("#H08", (decimal)tryInt64, Convert.ToDecimal(tryInt64));
- AssertEquals("#H09", (decimal)trySByte, Convert.ToDecimal(trySByte));
- AssertEquals("#H10", (decimal)tryFloat, Convert.ToDecimal(tryFloat));
- AssertEquals("#H11", (decimal)23456.432, Convert.ToDecimal("23456.432"));
- AssertEquals("#H12", (decimal)tryUI16, Convert.ToDecimal(tryUI16));
- AssertEquals("#H13", (decimal)tryUI32, Convert.ToDecimal(tryUI32));
- AssertEquals("#H14", (decimal)tryUI64, Convert.ToDecimal(tryUI64));
- AssertEquals("#H15", (decimal)63784, Convert.ToDecimal("63784", ci));
-
- try {
- Convert.ToDecimal(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H22", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(double.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H23", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H24", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H25", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = decimal.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDecimal(maxDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDecimal(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H28", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = decimal.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDecimal(maxDec, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#H29", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToDouble() {
- int iTest = 1;
- try {
- AssertEquals("#I01", (double)1, Convert.ToDouble(boolTrue));
- iTest++;
- AssertEquals("#I02", (double)0, Convert.ToDouble(boolFalse));
- iTest++;
- AssertEquals("#I03", (double)tryByte, Convert.ToDouble(tryByte));
- iTest++;
- AssertEquals("#I04", tryDbl, Convert.ToDouble(tryDbl));
- iTest++;
- AssertEquals("#I05", (double)tryDec, Convert.ToDouble(tryDec));
- iTest++;
- AssertEquals("#I06", (double)tryInt16, Convert.ToDouble(tryInt16));
- iTest++;
- AssertEquals("#I07", (double)tryInt32, Convert.ToDouble(tryInt32));
- iTest++;
- AssertEquals("#I08", (double)tryInt64, Convert.ToDouble(tryInt64));
- iTest++;
- AssertEquals("#I09", (double)trySByte, Convert.ToDouble(trySByte));
- iTest++;
- AssertEquals("#I10", (double)tryFloat, Convert.ToDouble(tryFloat));
- iTest++;
- AssertEquals("#I11", (double)23456.432, Convert.ToDouble("23456.432"));
- iTest++;
- AssertEquals("#I12", (double)tryUI16, Convert.ToDouble(tryUI16));
- iTest++;
- AssertEquals("#I13", (double)tryUI32, Convert.ToDouble(tryUI32));
- iTest++;
- AssertEquals("#I14", (double)tryUI64, Convert.ToDouble(tryUI64));
- iTest++;
- AssertEquals("#H15", (double)63784, Convert.ToDouble("63784", ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToDouble(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I21", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I22", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I23", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = double.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDouble(maxDec);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I24", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDouble(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I26", typeof(FormatException), e.GetType());
- }
-
- try {
- string maxDec = double.MaxValue.ToString();
- maxDec = maxDec + "1";
- Convert.ToDouble(maxDec, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToDouble(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#I28", typeof(InvalidCastException), e.GetType());
- }
- }
-
- public void TestToInt16() {
- AssertEquals("#J01", (short)0, Convert.ToInt16(boolFalse));
- AssertEquals("#J02", (short)1, Convert.ToInt16(boolTrue));
- AssertEquals("#J03", (short)97, Convert.ToInt16(tryChar));
- AssertEquals("#J04", (short)1234, Convert.ToInt16(tryDec));
- AssertEquals("#J05", (short)0, Convert.ToInt16(tryDbl));
- AssertEquals("#J06", (short)1234, Convert.ToInt16(tryInt16));
- AssertEquals("#J07", (short)12345, Convert.ToInt16(tryInt32));
- AssertEquals("#J08", (short)30000, Convert.ToInt16((long)30000));
- AssertEquals("#J09", (short)123, Convert.ToInt16(trySByte));
- AssertEquals("#J10", (short)1234, Convert.ToInt16(tryFloat));
- AssertEquals("#J11", (short)578, Convert.ToInt16("578"));
- AssertEquals("#J12", (short)15500, Convert.ToInt16((ushort)15500));
- AssertEquals("#J13", (short)5489, Convert.ToInt16((uint)5489));
- AssertEquals("#J14", (short)9876, Convert.ToInt16((ulong)9876));
- AssertEquals("#J15", (short)14, Convert.ToInt16("14", ci));
- AssertEquals("#J16", (short)11, Convert.ToInt16("01011", 2));
- AssertEquals("#J17", (short)1540, Convert.ToInt16("3004", 8));
- AssertEquals("#J18", (short)321, Convert.ToInt16("321", 10));
- AssertEquals("#J19", (short)2748, Convert.ToInt16("ABC", 16));
-
- try {
- Convert.ToInt16(char.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt16((decimal)(short.MaxValue + 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((decimal)(short.MinValue - 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((double)(short.MaxValue + 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((double)(short.MinValue - 1));
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(50000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(-50000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(-tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J35", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt16((float)32767.5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16((float)-33000.54);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J38", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt16("-33000");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(ushort.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(uint.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J41", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J43", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt16(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J44", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt16("-33000", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J45", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt16("321", 11);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J46", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToInt16("D8BF1", 16);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#J47", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToInt32() {
- long tryMax = long.MaxValue;
- long tryMin = long.MinValue;
- AssertEquals("#K01", (int)0, Convert.ToInt32(boolFalse));
- AssertEquals("#K02", (int)1, Convert.ToInt32(boolTrue));
- AssertEquals("#K03", (int)0, Convert.ToInt32(tryByte));
- AssertEquals("#K04", (int)97, Convert.ToInt32(tryChar));
- AssertEquals("#K05", (int)1234, Convert.ToInt32(tryDec));
- AssertEquals("#K06", (int)0, Convert.ToInt32(tryDbl));
- AssertEquals("#K07", (int)1234, Convert.ToInt32(tryInt16));
- AssertEquals("#K08", (int)12345, Convert.ToInt32(tryInt32));
- AssertEquals("#K09", (int)60000, Convert.ToInt32((long)60000));
- AssertEquals("#K10", (int)123, Convert.ToInt32(trySByte));
- AssertEquals("#K11", (int)1234, Convert.ToInt32(tryFloat));
- AssertEquals("#K12", (int)9876, Convert.ToInt32((string)"9876"));
- AssertEquals("#K13", (int)34567, Convert.ToInt32(tryUI16));
- AssertEquals("#K14", (int)567891234, Convert.ToInt32(tryUI32));
- AssertEquals("#K15", (int)0, Convert.ToInt32(tryUI64));
- AssertEquals("#K16", (int)123, Convert.ToInt32("123", ci));
- AssertEquals("#K17", (int)128, Convert.ToInt32("10000000", 2));
- AssertEquals("#K18", (int)302, Convert.ToInt32("456", 8));
- AssertEquals("#K19", (int)456, Convert.ToInt32("456", 10));
- AssertEquals("#K20", (int)1110, Convert.ToInt32("456", 16));
-
- try {
- Convert.ToInt32(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt32((decimal)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((decimal)tryMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((double)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((double)tryMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(-tryInt64);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K32", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt32((float)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((float)tryMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K35", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt32("-46565465123");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32("46565465123");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((uint)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32((ulong)tryMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K40", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt32(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K41", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt32("-46565465123", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt32("654", 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#K43", typeof(ArgumentException), e.GetType());
- }
- }
- public void TestToInt64() {
- decimal longMax = long.MaxValue;
- longMax += 1;
- decimal longMin = long.MinValue;
- longMin -= 1;
-
- AssertEquals("#L01", (long)0, Convert.ToInt64(boolFalse));
- AssertEquals("#L02", (long)1, Convert.ToInt64(boolTrue));
- AssertEquals("#L03", (long)97, Convert.ToInt64(tryChar));
- AssertEquals("#L04", (long)1234, Convert.ToInt64(tryDec));
- AssertEquals("#L05", (long)0, Convert.ToInt64(tryDbl));
- AssertEquals("#L06", (long)1234, Convert.ToInt64(tryInt16));
- AssertEquals("#L07", (long)12345, Convert.ToInt64(tryInt32));
- AssertEquals("#L08", (long)123456789012, Convert.ToInt64(tryInt64));
- AssertEquals("#L09", (long)123, Convert.ToInt64(trySByte));
- AssertEquals("#L10", (long)1234, Convert.ToInt64(tryFloat));
- AssertEquals("#L11", (long)564897, Convert.ToInt64("564897"));
- AssertEquals("#L12", (long)34567, Convert.ToInt64(tryUI16));
- AssertEquals("#L13", (long)567891234, Convert.ToInt64(tryUI32));
- AssertEquals("#L14", (long)0, Convert.ToInt64(tryUI64));
- AssertEquals("#L15", (long)-2548751, Convert.ToInt64("-2548751", ci));
- AssertEquals("#L16", (long)24987562, Convert.ToInt64("1011111010100011110101010", 2));
- AssertEquals("#L17", (long)-24578965, Convert.ToInt64("1777777777777642172153", 8));
- AssertEquals("#L18", (long)248759757, Convert.ToInt64("248759757", 10));
- AssertEquals("#L19", (long)256, Convert.ToInt64("100", 16));
-
- try {
- Convert.ToInt64(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L20", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt64((decimal)longMax + 1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L21", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((decimal)longMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L24", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((double)longMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((double)longMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64(new Exception());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToInt64((float)longMax);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64((float)longMin);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64("-567b3");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L30", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt64(longMax.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L32", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToInt64(longMin.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToInt64("321", 11);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#L34", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToSByte() {
- int iTest = 1;
- try {
- AssertEquals("#M01", (sbyte)0, Convert.ToSByte(boolFalse));
- iTest++;
- AssertEquals("#M02", (sbyte)1, Convert.ToSByte(boolTrue));
- iTest++;
- AssertEquals("#M03", (sbyte)97, Convert.ToSByte(tryChar));
- iTest++;
- AssertEquals("#M04", (sbyte)15, Convert.ToSByte((decimal)15));
- iTest++;
- AssertEquals("#M05", (sbyte)0, Convert.ToSByte(tryDbl));
- iTest++;
- AssertEquals("#M06", (sbyte)127, Convert.ToSByte((short)127));
- iTest++;
- AssertEquals("#M07", (sbyte)-128, Convert.ToSByte((int)-128));
- iTest++;
- AssertEquals("#M08", (sbyte)30, Convert.ToSByte((long)30));
- iTest++;
- AssertEquals("#M09", (sbyte)123, Convert.ToSByte(trySByte));
- iTest++;
- AssertEquals("#M10", (sbyte)12, Convert.ToSByte((float)12.46987f));
- iTest++;
- AssertEquals("#M11", (sbyte)1, Convert.ToSByte("1"));
- iTest++;
- AssertEquals("#M12", (sbyte)99, Convert.ToSByte((ushort)99));
- iTest++;
- AssertEquals("#M13", (sbyte)54, Convert.ToSByte((uint)54));
- iTest++;
- AssertEquals("#M14", (sbyte)127, Convert.ToSByte((ulong)127));
- iTest++;
- AssertEquals("#M15", (sbyte)14, Convert.ToSByte("14", ci));
- iTest++;
- AssertEquals("#M16", (sbyte)11, Convert.ToSByte("01011", 2));
- iTest++;
- AssertEquals("#M17", (sbyte)5, Convert.ToSByte("5", 8));
- iTest++;
- AssertEquals("#M18", (sbyte)100, Convert.ToSByte("100", 10));
- iTest++;
- AssertEquals("#M19", (sbyte)-1, Convert.ToSByte("FF", 16));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToSByte((byte)200);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M25", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((char)130);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSByte((decimal)127.5m);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((decimal)-200m);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((double)150);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((double)-128.6);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((short)150);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((short)-300);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((int)1500);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((int)-1286);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M35", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((long)128);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((long)-129);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(new NumberFormatInfo());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M38", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSByte((float)333);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((float)-666);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte("B3");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M41", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSByte("251");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(ushort.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M43", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte((uint)600);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M44", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M45", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte(ci, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M46", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSByte(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M47", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSByte("325", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M48", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSByte("5D", 15);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M49", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToSByte("111111111", 2);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#M50", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToSingle() {
- int iTest = 1;
- try {
- AssertEquals("#N01", (float)0, Convert.ToSingle(boolFalse));
- iTest++;
- AssertEquals("#N02", (float)1, Convert.ToSingle(boolTrue));
- iTest++;
- AssertEquals("#N03", (float)0, Convert.ToSingle(tryByte));
- iTest++;
- AssertEquals("#N04", (float)1234,234, Convert.ToSingle(tryDec));
- iTest++;
- AssertEquals("#N05", (float)0, Convert.ToSingle(tryDbl));
- iTest++;
- AssertEquals("#N06", (float)1234, Convert.ToSingle(tryInt16));
- iTest++;
- AssertEquals("#N07", (float)12345, Convert.ToSingle(tryInt32));
- iTest++;
- AssertEquals("#N08", (float)123456789012, Convert.ToSingle(tryInt64));
- iTest++;
- AssertEquals("#N09", (float)123, Convert.ToSingle(trySByte));
- iTest++;
- AssertEquals("#N10", (float)1234,2345, Convert.ToSingle(tryFloat));
- iTest++;
- AssertEquals("#N11", (float)987, Convert.ToSingle("987"));
- iTest++;
- AssertEquals("#N12", (float)34567, Convert.ToSingle(tryUI16));
- iTest++;
- AssertEquals("#N13", (float)567891234, Convert.ToSingle(tryUI32));
- iTest++;
- AssertEquals("#N14", (float)0, Convert.ToSingle(tryUI64));
- iTest++;
- AssertEquals("#N15", (float)654.234, Convert.ToSingle("654.234", ci));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToSingle(tryChar);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N26", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N27", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle("A345H");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N28", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSingle(double.MaxValue.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToSingle(tryObj, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N30", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToSingle("J345K", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N31", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToSingle("11000000000000000000000000000000000000000000000", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#N32", typeof(OverflowException), e.GetType());
- }
- }
-
- public void TestToString() {
-
- tryByte = 123;
- AssertEquals("#O01", "False", Convert.ToString(boolFalse));
- AssertEquals("#O02", "True", Convert.ToString(boolTrue));
- AssertEquals("#O03", "123", Convert.ToString(tryByte));
- AssertEquals("#O04", "a", Convert.ToString(tryChar));
- AssertEquals("#O05", tryDT.ToString(), Convert.ToString(tryDT));
- AssertEquals("#O06", tryDec.ToString(), Convert.ToString(tryDec));
- AssertEquals("#O07", tryDbl.ToString(), Convert.ToString(tryDbl));
- AssertEquals("#O08", "1234", Convert.ToString(tryInt16));
- AssertEquals("#O09", "12345", Convert.ToString(tryInt32));
- AssertEquals("#O10", "123456789012", Convert.ToString(tryInt64));
- AssertEquals("#O11", "123", Convert.ToString(trySByte));
- AssertEquals("#O12", tryFloat.ToString(), Convert.ToString(tryFloat));
- AssertEquals("#O13", "foobar", Convert.ToString(tryStr));
- AssertEquals("#O14", "34567", Convert.ToString(tryUI16));
- AssertEquals("#O15", "567891234", Convert.ToString(tryUI32));
- AssertEquals("#O16", "True", Convert.ToString(boolTrue, ci));
- AssertEquals("#O17", "False", Convert.ToString(boolFalse, ci));
- AssertEquals("#O18", "123", Convert.ToString(tryByte, ci));
- AssertEquals("#O19", "1111011", Convert.ToString(tryByte, 2));
- AssertEquals("#O20", "173", Convert.ToString(tryByte, 8));
- AssertEquals("#O21", "123", Convert.ToString(tryByte, 10));
- AssertEquals("#O22", "7b", Convert.ToString(tryByte, 16));
- AssertEquals("#O23", "a", Convert.ToString(tryChar, ci));
- AssertEquals("#O24", tryDT.ToString(ci), Convert.ToString(tryDT, ci));
- AssertEquals("#O25", tryDec.ToString(ci), Convert.ToString(tryDec,ci));
- AssertEquals("#O26", tryDbl.ToString(ci), Convert.ToString(tryDbl, ci));
- AssertEquals("#O27", "1234", Convert.ToString(tryInt16, ci));
- AssertEquals("#O28", "10011010010", Convert.ToString(tryInt16, 2));
- AssertEquals("#O29", "2322", Convert.ToString(tryInt16, 8));
- AssertEquals("#O30", "1234", Convert.ToString(tryInt16, 10));
- AssertEquals("#O31", "4d2", Convert.ToString(tryInt16, 16));
- AssertEquals("#O32", "12345", Convert.ToString(tryInt32, ci));
- AssertEquals("#O33", "11000000111001", Convert.ToString(tryInt32, 2));
- AssertEquals("#O34", "30071", Convert.ToString(tryInt32, 8));
- AssertEquals("#O35", "12345", Convert.ToString(tryInt32, 10));
- AssertEquals("#O36", "3039", Convert.ToString(tryInt32, 16));
- AssertEquals("#O37", "123456789012", Convert.ToString(tryInt64, ci));
- AssertEquals("#O38", "1110010111110100110010001101000010100",
- Convert.ToString(tryInt64, 2));
- AssertEquals("#O39", "1627646215024", Convert.ToString(tryInt64, 8));
- AssertEquals("#O40", "123456789012", Convert.ToString(tryInt64, 10));
- AssertEquals("#O41", "1cbe991a14", Convert.ToString(tryInt64, 16));
- AssertEquals("#O42", "123", Convert.ToString((trySByte), ci));
- AssertEquals("#O43", tryFloat.ToString(ci), Convert.ToString((tryFloat), ci));
- AssertEquals("#O44", "foobar", Convert.ToString((tryStr), ci));
- AssertEquals("#O45", "34567", Convert.ToString((tryUI16), ci));
- AssertEquals("#O46", "567891234", Convert.ToString((tryUI32), ci));
- AssertEquals("#O47", "0", Convert.ToString(tryUI64));
- AssertEquals("#O48", "0", Convert.ToString((tryUI64), ci));
-
- try {
- Convert.ToString(tryInt16, 5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#O55", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToString(tryInt32, 17);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#O56", typeof(ArgumentException), e.GetType());
- }
-
- try {
- Convert.ToString(tryInt64, 1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#O57", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToUInt16() {
- AssertEquals("#P01", (ushort)0, Convert.ToUInt16(boolFalse));
- AssertEquals("#P02", (ushort)1, Convert.ToUInt16(boolTrue));
- AssertEquals("#P03", (ushort)0, Convert.ToUInt16(tryByte));
- AssertEquals("#P04", (ushort)97, Convert.ToUInt16(tryChar));
- AssertEquals("#P05", (ushort)1234, Convert.ToUInt16(tryDec));
- AssertEquals("#P06", (ushort)0, Convert.ToUInt16(tryDbl));
- AssertEquals("#P07", (ushort)1234, Convert.ToUInt16(tryInt16));
- AssertEquals("#P08", (ushort)12345, Convert.ToUInt16(tryInt32));
- AssertEquals("#P09", (ushort)43752, Convert.ToUInt16((long)43752));
- AssertEquals("#P10", (ushort)123, Convert.ToUInt16(trySByte));
- AssertEquals("#P11", (ushort)1234, Convert.ToUInt16(tryFloat));
- AssertEquals("#P12", (ushort)123, Convert.ToUInt16((string)"123"));
- AssertEquals("#P13", (ushort)34567, Convert.ToUInt16(tryUI16));
- AssertEquals("#P14", (ushort)56789, Convert.ToUInt16((uint)56789));
- AssertEquals("#P15", (ushort)0, Convert.ToUInt16(tryUI64));
- AssertEquals("#P16", (ushort)31, Convert.ToUInt16("31", ci));
- AssertEquals("#P17", (ushort)14, Convert.ToUInt16("1110", 2));
- AssertEquals("#P18", (ushort)32, Convert.ToUInt16("40", 8));
- AssertEquals("#P19", (ushort)40, Convert.ToUInt16("40", 10));
- AssertEquals("#P20", (ushort)64, Convert.ToUInt16("40", 16));
-
-
- try {
- Convert.ToUInt16(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(decimal.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(decimal.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(double.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(short.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(int.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(int.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(long.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(long.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P35", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(sbyte.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(float.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(float.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("1A2");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P39", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("-32800");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(int.MaxValue.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P41", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("1A2", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P43", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("-32800", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P44", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("456987", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P45", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt16("40", 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#P46", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToUInt32() {
- AssertEquals("#Q01", (uint)1, Convert.ToUInt32(boolTrue));
- AssertEquals("#Q02", (uint)0, Convert.ToUInt32(boolFalse));
- AssertEquals("#Q03", (uint)0, Convert.ToUInt32(tryByte));
- AssertEquals("#Q04", (uint)97, Convert.ToUInt32(tryChar));
- AssertEquals("#Q05", (uint)1234, Convert.ToUInt32(tryDec));
- AssertEquals("#Q06", (uint)0, Convert.ToUInt32(tryDbl));
- AssertEquals("#Q07", (uint)1234, Convert.ToUInt32(tryInt16));
- AssertEquals("#Q08", (uint)12345, Convert.ToUInt32(tryInt32));
- AssertEquals("#Q09", (uint)1234567890, Convert.ToUInt32((long)1234567890));
- AssertEquals("#Q10", (uint)123, Convert.ToUInt32(trySByte));
- AssertEquals("#Q11", (uint)1234, Convert.ToUInt32(tryFloat));
- AssertEquals("#Q12", (uint)3456789, Convert.ToUInt32("3456789"));
- AssertEquals("#Q13", (uint)34567, Convert.ToUInt32(tryUI16));
- AssertEquals("#Q14", (uint)567891234, Convert.ToUInt32(tryUI32));
- AssertEquals("#Q15", (uint)0, Convert.ToUInt32(tryUI64));
- AssertEquals("#Q16", (uint)415, Convert.ToUInt32("110011111", 2));
- AssertEquals("#Q17", (uint)156, Convert.ToUInt32("234" ,8));
- AssertEquals("#Q18", (uint)234, Convert.ToUInt32("234" ,10));
- AssertEquals("#Q19", (uint)564, Convert.ToUInt32("234" ,16));
-
-
- try {
- Convert.ToUInt32(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(decimal.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32((decimal)-150);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32((double)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(short.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(int.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(long.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32((long)-50000);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q33", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(new Exception());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q34", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(sbyte.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q35", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(float.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(float.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q37", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("45t54");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q38", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("-55");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(ulong.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q40", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(new Exception(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q41", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(tryStr, ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q42", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("-50", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q43", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32(decimal.MaxValue.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q44", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt32("1001110", 1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#Q45", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToUInt64()
- {
- int iTest = 1;
- try {
- AssertEquals("#R01", (ulong)1, Convert.ToUInt64(boolTrue));
- iTest++;
- AssertEquals("#R02", (ulong)0, Convert.ToUInt64(boolFalse));
- iTest++;
- AssertEquals("#R03", (ulong)0, Convert.ToUInt64(tryByte));
- iTest++;
- AssertEquals("#R04", (ulong)97, Convert.ToUInt64(tryChar));
- iTest++;
- AssertEquals("#R05", (ulong)1234, Convert.ToUInt64(tryDec));
- iTest++;
- AssertEquals("#R06", (ulong)0, Convert.ToUInt64(tryDbl));
- iTest++;
- AssertEquals("#R07", (ulong)1234, Convert.ToUInt64(tryInt16));
- iTest++;
- AssertEquals("#R08", (ulong)12345, Convert.ToUInt64(tryInt32));
- iTest++;
- AssertEquals("#R09", (ulong)123456789012, Convert.ToUInt64(tryInt64));
- iTest++;
- AssertEquals("#R10", (ulong)123, Convert.ToUInt64(trySByte));
- iTest++;
- AssertEquals("#R11", (ulong)1234, Convert.ToUInt64(tryFloat));
- iTest++;
- AssertEquals("#R12", (ulong)345678, Convert.ToUInt64("345678"));
- iTest++;
- AssertEquals("#R13", (ulong)34567, Convert.ToUInt64(tryUI16));
- iTest++;
- AssertEquals("#R14", (ulong)567891234, Convert.ToUInt64(tryUI32));
- iTest++;
- AssertEquals("#R15", (ulong)0, Convert.ToUInt64(tryUI64));
- iTest++;
- AssertEquals("#R16", (ulong)123, Convert.ToUInt64("123", ci));
- iTest++;
- AssertEquals("#R17", (ulong)4, Convert.ToUInt64("100", 2));
- iTest++;
- AssertEquals("#R18", (ulong)64, Convert.ToUInt64("100", 8));
- iTest++;
- AssertEquals("#R19", (ulong)100, Convert.ToUInt64("100", 10));
- iTest++;
- AssertEquals("#R20", (ulong)256, Convert.ToUInt64("100", 16));
- } catch (Exception e) {
- Fail ("Unexpected exception caught when iTest = " + iTest + ": e = " + e);
- }
-
- try {
- Convert.ToUInt64(tryDT);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R25", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R26", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64((decimal)-140);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R27", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(double.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R28", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64((double)-1);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R29", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(short.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R30", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(int.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R31", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(long.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R32", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(tryObj);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R33", typeof(InvalidCastException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(sbyte.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R34", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(float.MinValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R35", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(float.MaxValue);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R36", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("234rt78");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R37", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("-68");
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R38", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MaxValue.ToString());
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R39", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("23rd2", ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R40", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MinValue.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R41", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64(decimal.MaxValue.ToString(), ci);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R42", typeof(OverflowException), e.GetType());
- }
-
- try {
- Convert.ToUInt64("132", 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#R43", typeof(ArgumentException), e.GetType());
- }
- }
-
- public void TestToBase64CharArray() {
- byte[] byteArr = {33, 127, 255, 109, 170, 54};
- // 0 1 2 3 4 5 6 7
- char[] expectedCharArr = {'I', 'X', '/', '/', 'b', 'a', 'o', '2'};
- char[] result = new Char[8];
-
- Convert.ToBase64CharArray(byteArr, 0, byteArr.Length, result, 0);
-
- for (int i = 0; i < expectedCharArr.Length; i++) {
- AssertEquals("#S0" + i, expectedCharArr[i], result[i]);
- }
-
- try {
- Convert.ToBase64CharArray(null, 0, byteArr.Length, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S10", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, -1, byteArr.Length, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S11", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 0, -5, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S12", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 0, byteArr.Length, result, -2);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S13", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 4, byteArr.Length, result, 0);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S14", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64CharArray(byteArr, 0, byteArr.Length, result, 2);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#S15", typeof(ArgumentOutOfRangeException), e.GetType());
- }
- }
- public void TestToBase64String() {
- byte[] byteArr = {33, 127, 255, 109, 170, 54};
- string expectedStr = "IX//bao2";
- string result1;
- string result2;
-
- result1 = Convert.ToBase64String(byteArr);
- result2 = Convert.ToBase64String(byteArr, 0, byteArr.Length);
-
- AssertEquals("#T01", expectedStr, result1);
- AssertEquals("#T02", expectedStr, result2);
-
- try {
- Convert.ToBase64String(null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T05", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.ToBase64String(byteArr, -1, byteArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T06", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64String(byteArr, 0, -10);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T07", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.ToBase64String(byteArr, 4, byteArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#T08", typeof(ArgumentOutOfRangeException), e.GetType());
- }
- }
-
- /* Have experienced some problems with FromBase64CharArray using mono. Something
- * about error in a unicode file.
- *
- * However the test seems to run fine using mono in a cygwin environment
- */
- public void TestFromBase64CharArray() {
-
- char[] charArr = {'M','o','n','o','m','o','n','o'};
- byte[] expectedByteArr = {50, 137, 232, 154, 137, 232};
-
- byte[] fromCharArr = Convert.FromBase64CharArray(charArr, 0, 8);
-
- for (int i = 0; i < fromCharArr.Length; i++){
- AssertEquals("#U0" + i, expectedByteArr[i], fromCharArr[i]);
- }
-
- try {
- Convert.FromBase64CharArray(null, 0, charArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U10", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, -1, charArr.Length);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U11", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, -5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U12", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, 3);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U13", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, 9);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U14", typeof(ArgumentOutOfRangeException), e.GetType());
- }
-
- try {
- Convert.FromBase64CharArray(charArr, 0, 5);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#U15", typeof(FormatException), e.GetType());
- }
- }
-
- /* Have experienced some problems with FromBase64String using mono. Something about
- * error in a unicode file.
- *
- * However the test seems to run fine using mono in a cygwin environment
- */
- public void TestFromBase64String() {
- string str = "Monomono";
- string err01 = "foo";
-
- byte[] expectedByteArr = {50, 137, 232, 154, 137, 232};
- byte[] fromStr = Convert.FromBase64String(str);
-
- for (int i = 0; i < fromStr.Length; i++){
- AssertEquals("#V0" + i, expectedByteArr[i], fromStr[i]);
- }
-
- try {
- Convert.FromBase64String(null);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#V10", typeof(ArgumentNullException), e.GetType());
- }
-
- try {
- Convert.FromBase64String(err01);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#V11", typeof(FormatException), e.GetType());
- }
-
- try {
- Convert.FromBase64String(tryStr);
- Fail();
- }
- catch (Exception e) {
- AssertEquals("#V12", typeof(FormatException), e.GetType());
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System/DateTimeTest.cs b/mcs/class/corlib/Test/System/DateTimeTest.cs
deleted file mode 100755
index 0ef803ef37a..00000000000
--- a/mcs/class/corlib/Test/System/DateTimeTest.cs
+++ /dev/null
@@ -1,358 +0,0 @@
-//
-// DateTimeTest.cs - NUnit Test Cases for the System.DateTime struct
-//
-// author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Free Software Foundation
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class DateTimeTest : TestCase
-{
- private CultureInfo oldcult;
-
- long[] myTicks = {
- 631501920000000000L, // 25 Feb 2002 - 00:00:00
- 631502475130080000L, // 25 Feb 2002 - 15:25:13,8
- 631502115130080000L, // 25 Feb 2002 - 05:25:13,8
- 631502115000000000L, // 25 Feb 2002 - 05:25:00
- 631502115130000000L, // 25 Feb 2002 - 05:25:13
- 631502079130000000L, // 25 Feb 2002 - 04:25:13
- 629197085770000000L // 06 Nov 1994 - 08:49:37
- };
-
- public DateTimeTest() : base ("MonoTests.System.DateTimeTest testcase") {}
- public DateTimeTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof (DateTimeTest));
- }
- }
-
- protected override void SetUp()
- {
- // the current culture determines the result of formatting
- oldcult = Thread.CurrentThread.CurrentCulture;
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("");
- }
-
- protected override void TearDown ()
- {
- Thread.CurrentThread.CurrentCulture = oldcult;
- }
-
- public void TestCtors ()
- {
- DateTime t1 = new DateTime (2002,2,25);
- AssertEquals("A01", myTicks[0], t1.Ticks);
- DateTime t2 = new DateTime (2002,2,25,15,25,13,8);
- AssertEquals("A02", myTicks[1], t2.Ticks);
- AssertEquals("A03", myTicks[0], t2.Date.Ticks);
- AssertEquals("A04", 2002, t2.Year);
- AssertEquals("A05", 2, t2.Month);
- AssertEquals("A06", 25, t2.Day);
- AssertEquals("A07", 15, t2.Hour);
- AssertEquals("A08", 25, t2.Minute);
- AssertEquals("A09", 13, t2.Second);
- AssertEquals("A10", 8, t2.Millisecond);
- DateTime t3 = new DateTime (2002,2,25,5,25,13,8);
- AssertEquals("A11", myTicks[2], t3.Ticks);
- }
-
- public void TestToString ()
- {
- DateTime t1 = new DateTime (myTicks[2]);
- DateTime t2 = new DateTime (myTicks[1]);
- // Standard patterns
- AssertEquals("B01", "02/25/2002", t1.ToString ("d"));
- AssertEquals("B02", "Monday, 25 February 2002", t1.ToString ("D"));
- AssertEquals("B03", "Monday, 25 February 2002 05:25", t1.ToString ("f"));
- AssertEquals("B04", "Monday, 25 February 2002 05:25:13", t1.ToString ("F"));
- AssertEquals("B05", "02/25/2002 05:25", t1.ToString ("g"));
- AssertEquals("B06", "02/25/2002 05:25:13", t1.ToString ("G"));
- AssertEquals("B07", "February 25", t1.ToString ("m"));
- AssertEquals("B08", "February 25", t1.ToString ("M"));
- AssertEquals("B09", "Mon, 25 Feb 2002 05:25:13 GMT", t1.ToString ("r"));
- AssertEquals("B10", "Mon, 25 Feb 2002 05:25:13 GMT", t1.ToString ("R"));
- AssertEquals("B11", "2002-02-25T05:25:13", t1.ToString ("s"));
- AssertEquals("B12", "05:25", t1.ToString ("t"));
- AssertEquals("B13", "05:25:13", t1.ToString ("T"));
- AssertEquals("B14", "2002-02-25 05:25:13Z", t1.ToString ("u"));
- AssertEquals("B15", "Sunday, 24 February 2002 11:25:13", t1.ToUniversalTime().ToString ("U"));
- AssertEquals("B16", "2002 February", t1.ToString ("y"));
- AssertEquals("B17", "2002 February", t1.ToString ("Y"));
-
- // Custom patterns
- AssertEquals("C01", "25", t1.ToString ("%d"));
- AssertEquals("C02", "25", t1.ToString ("dd"));
- AssertEquals("C03", "Mon", t1.ToString ("ddd"));
- AssertEquals("C04", "Monday", t1.ToString ("dddd"));
- AssertEquals("C05", "2", t1.ToString ("%M"));
- AssertEquals("C06", "02", t1.ToString ("MM"));
- AssertEquals("C07", "Feb", t1.ToString ("MMM"));
- AssertEquals("C08", "February", t1.ToString ("MMMM"));
- AssertEquals("C09", "2", t1.ToString ("%y"));
- AssertEquals("C10", "02", t1.ToString ("yy"));
- AssertEquals("C11", "2002", t1.ToString ("yyyy"));
- AssertEquals("C12", "5", t1.ToString ("%h"));
- AssertEquals("C13", "05", t1.ToString ("hh"));
- AssertEquals("C14", "3", t2.ToString ("%h"));
- AssertEquals("C15", "03", t2.ToString ("hh"));
- AssertEquals("C16", "15", t2.ToString ("%H"));
- AssertEquals("C17", "15", t2.ToString ("HH"));
- AssertEquals("C18", "25", t2.ToString ("%m"));
- AssertEquals("C19", "25", t2.ToString ("mm"));
- AssertEquals("C20", "13", t2.ToString ("%s"));
- AssertEquals("C21", "13", t2.ToString ("ss"));
- AssertEquals("C22", "A", t1.ToString ("%t"));
- AssertEquals("C23", "P", t2.ToString ("%t"));
- AssertEquals("C24", "AM", t1.ToString ("tt"));
- AssertEquals("C25", "PM", t2.ToString ("tt"));
- long offset = TimeZone.CurrentTimeZone.GetUtcOffset(t1).Ticks / 36000000000;
- AssertEquals("C26", offset.ToString("+#;-#;0"), t1.ToString ("%z"));
- AssertEquals("C27", offset.ToString("+00;-00;00"), t1.ToString ("zz"));
- AssertEquals("C28", offset.ToString("+00;-00;00") + ":00", t1.ToString ("zzz"));
- AssertEquals("C29", " : ", t1.ToString (" : "));
- AssertEquals("C30", " / ", t1.ToString (" / "));
- AssertEquals("C31", " yyy ", t1.ToString (" 'yyy' "));
- AssertEquals("C32", " d", t1.ToString (" \\d"));
- }
-
- public void TestParseExact ()
- {
- // Standard patterns
- DateTime t1 = DateTime.ParseExact ("02/25/2002", "d", null);
- AssertEquals ("D01", myTicks[0], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002", "D", null);
- AssertEquals ("D02", myTicks[0], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25", "f", null);
- AssertEquals ("D03", myTicks[3], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13", "F", null);
- AssertEquals ("D04", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("02/25/2002 05:25", "g", null);
- AssertEquals ("D05", myTicks[3], t1.Ticks);
- t1 = DateTime.ParseExact ("02/25/2002 05:25:13", "G", null);
- AssertEquals ("D06", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("2002-02-25 04:25:13Z", "u", null);
- AssertEquals ("D07", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 04:25:13", "U", null);
- AssertEquals ("D08", myTicks[4], t1.Ticks);
-
- DateTime t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.ParseExact ("February 25", "m", null);
- AssertEquals ("D09", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.ParseExact ("February 25", "M", null);
- AssertEquals ("D10", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.ParseExact ("Mon, 25 Feb 2002 04:25:13 GMT", "r", null);
- AssertEquals ("D11", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Mon, 25 Feb 2002 04:25:13 GMT", "R", null);
- AssertEquals ("D12", myTicks[4], t1.Ticks);
-
- t1 = DateTime.ParseExact ("2002-02-25T05:25:13", "s", null);
- AssertEquals ("D13", myTicks[4], t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,0);
- t1 = DateTime.ParseExact ("05:25", "t", null);
- AssertEquals("D14", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,13);
- t1 = DateTime.ParseExact ("05:25:13", "T", null);
- AssertEquals("D15", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.ParseExact ("2002 February", "y", null);
- AssertEquals ("D16", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.ParseExact ("2002 February", "Y", null);
- AssertEquals ("D16", t2.Ticks, t1.Ticks);
-
- // Custom patterns
- t2 = new DateTime (2002, 1, 25);
- t1 = DateTime.ParseExact ("25", "%d", null);
- AssertEquals ("E01", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("25", "dd", null);
- AssertEquals ("E02", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 1);
- t1 = DateTime.ParseExact ("2", "%M", null);
- AssertEquals ("E03", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("02", "MM", null);
- AssertEquals ("E04", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("Feb", "MMM", null);
- AssertEquals ("E05", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("February", "MMMM", null);
- AssertEquals ("E06", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2005, 1, 1);
- t1 = DateTime.ParseExact ("5", "%y", null);
- AssertEquals ("E07", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("05", "yy", null);
- AssertEquals ("E08", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("2005", "yyyy", null);
- AssertEquals ("E09", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5, 0, 0);
- t1 = DateTime.ParseExact ("5A", "ht", null);
- AssertEquals ("E10", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("05A", "hht", null);
- AssertEquals ("E11", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (15, 0, 0);
- t1 = DateTime.ParseExact ("3P", "ht", null);
- AssertEquals ("E12", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("03P", "hht", null);
- AssertEquals ("E13", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5, 0, 0);
- t1 = DateTime.ParseExact ("5", "%H", null);
- AssertEquals ("E14", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (15, 0, 0);
- t1 = DateTime.ParseExact ("15", "%H", null);
- AssertEquals ("E15", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("15", "HH", null);
- AssertEquals ("E16", t2.Ticks, t1.Ticks);
-
- // Time zones
- t2 = DateTime.Today + new TimeSpan (17, 18, 0);
- t1 = DateTime.ParseExact ("11:18AM -5", "h:mmtt z", null);
- AssertEquals ("F01", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("11:18AM -05:00", "h:mmtt zzz", null);
- AssertEquals ("F02", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("7:18PM +03", "h:mmtt zz", null);
- AssertEquals ("F03", t2.Ticks, t1.Ticks);
- t1 = DateTime.ParseExact ("7:48PM +03:30", "h:mmtt zzz", null);
- AssertEquals ("F04", t2.Ticks, t1.Ticks);
-
- // Options
- t2 = DateTime.Today + new TimeSpan (16, 18, 0);
- t1 = DateTime.ParseExact ("11:18AM -5", "h:mmtt z",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G01", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13", "F",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G02", myTicks[4], t1.Ticks);
- t1 = DateTime.ParseExact ("Monday, 25 February 2002 05:25:13",
- "dddd, dd MMMM yyyy HH:mm:ss",
- null, DateTimeStyles.AdjustToUniversal);
- AssertEquals ("G03", myTicks[4], t1.Ticks);
-
- t1 = DateTime.ParseExact ("02/25/2002", "d", null,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("G04", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact (" 02/25/2002", "d", null,
- DateTimeStyles.AllowLeadingWhite);
- AssertEquals ("G05", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact ("02/25/2002 ", "d", null,
- DateTimeStyles.AllowTrailingWhite);
- AssertEquals ("G06", myTicks[0], t1.Ticks);
-
- t1 = DateTime.ParseExact (" 02 / 25 / 2002 ", "d", null,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("G07", myTicks[0], t1.Ticks);
-
- // Multi Custom Patterns
- string rfc1123_date = "r";
- string rfc850_date = "dddd, dd'-'MMM'-'yy HH':'mm':'ss 'GMT'";
- string asctime_date = "ddd MMM d HH':'mm':'ss yyyy";
- string [] formats = new string [] {rfc1123_date, rfc850_date, asctime_date};
- CultureInfo enUS = new CultureInfo("en-US", false);
- t1 = DateTime.ParseExact ("Sun, 06 Nov 1994 08:49:37 GMT", formats[0], enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M01", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sunday, 06-Nov-94 08:49:37 GMT", formats[1], enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M02", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sun Nov 6 08:49:37 1994", formats[2], enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M03", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sun, 06 Nov 1994 08:49:37 GMT", formats, enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M04", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sunday, 06-Nov-94 08:49:37 GMT", formats, enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M05", myTicks[6], t1.Ticks);
- t1 = DateTime.ParseExact ("Sun Nov 6 08:49:37 1994", formats, enUS,
- DateTimeStyles.AllowWhiteSpaces);
- AssertEquals ("M06", myTicks[6], t1.Ticks);
- }
-
- public void TestParse ()
- {
- // Standard patterns
- DateTime t1 = DateTime.Parse ("02/25/2002");
- AssertEquals ("H00", myTicks[0], t1.Ticks);
- try {
- t1 = DateTime.Parse ("2002-02-25");
- }
- catch (Exception e) {
- Fail ("Unexpected exception. e=" + e);
- }
- AssertEquals ("H01", myTicks[0], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002");
- AssertEquals ("H02", myTicks[0], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002 05:25");
- AssertEquals ("H03", myTicks[3], t1.Ticks);
- t1 = DateTime.Parse ("Monday, 25 February 2002 05:25:13");
- AssertEquals ("H04", myTicks[4], t1.Ticks);
- t1 = DateTime.Parse ("02/25/2002 05:25");
- AssertEquals ("H05", myTicks[3], t1.Ticks);
- t1 = DateTime.Parse ("02/25/2002 05:25:13");
- AssertEquals ("H06", myTicks[4], t1.Ticks);
- t1 = DateTime.Parse ("2002-02-25 04:25:13Z");
- AssertEquals ("H07", myTicks[4], t1.Ticks);
-
- DateTime t2 = new DateTime (DateTime.Today.Year, 2, 25);
- t1 = DateTime.Parse ("February 25");
- AssertEquals ("H08", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 8);
- t1 = DateTime.Parse ("February 08");
- AssertEquals ("H09", t2.Ticks, t1.Ticks);
-
- t1 = DateTime.Parse ("Mon, 25 Feb 2002 04:25:13 GMT");
- AssertEquals ("H10", myTicks[4], t1.Ticks);
-
- t1 = DateTime.Parse ("2002-02-25T05:25:13");
- AssertEquals ("H11", myTicks[4], t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,0);
- t1 = DateTime.Parse ("05:25");
- AssertEquals("H12", t2.Ticks, t1.Ticks);
-
- t2 = DateTime.Today + new TimeSpan (5,25,13);
- t1 = DateTime.Parse ("05:25:13");
- AssertEquals("H13", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.Parse ("2002 February");
- AssertEquals ("H14", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (2002, 2, 1);
- t1 = DateTime.Parse ("2002 February");
- AssertEquals ("H15", t2.Ticks, t1.Ticks);
-
- t2 = new DateTime (DateTime.Today.Year, 2, 8);
- t1 = DateTime.Parse ("February 8");
- AssertEquals ("H16", t2.Ticks, t1.Ticks);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/DecimalTest.cs b/mcs/class/corlib/Test/System/DecimalTest.cs
deleted file mode 100644
index a670f641b31..00000000000
--- a/mcs/class/corlib/Test/System/DecimalTest.cs
+++ /dev/null
@@ -1,873 +0,0 @@
-// DecimalTest.cs - NUnit Test Cases for the System.Decimal struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-
-using NUnit.Framework;
-using System;
-using S = System; // for implementation switching only
-
-using System.Globalization;
-using System.Runtime.CompilerServices;
-using System.Threading;
-
-namespace MonoTests.System {
- internal struct ParseTest
- {
- public ParseTest(String str, bool exceptionFlag)
- {
- this.str = str;
- this.exceptionFlag = exceptionFlag;
- this.style = NumberStyles.Number;
- this.d = 0;
- }
-
- public ParseTest(String str, S.Decimal d)
- {
- this.str = str;
- this.exceptionFlag = false;
- this.style = NumberStyles.Number;
- this.d = d;
- }
-
- public ParseTest(String str, S.Decimal d, NumberStyles style)
- {
- this.str = str;
- this.exceptionFlag = false;
- this.style = style;
- this.d = d;
- }
-
- public String str;
- public S.Decimal d;
- public NumberStyles style;
- public bool exceptionFlag;
- }
-
- internal struct ToStringTest
- {
- public ToStringTest(String format, S.Decimal d, String str)
- {
- this.format = format;
- this.d = d;
- this.str = str;
- }
-
- public String format;
- public S.Decimal d;
- public String str;
- }
-
- /// <summary>
- /// Tests for System.Decimal
- /// </summary>
- public class DecimalTest : TestCase
- {
- public DecimalTest() : base ("MonoTests.System.DecimalTest testcase") {}
- public DecimalTest(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(DecimalTest)); }
- }
-
- private const int negativeBitValue = unchecked ((int)0x80000000);
- private const int negativeScale4Value = unchecked ((int)0x80040000);
- private int [] parts0 = {0,0,0,0}; //Positive Zero.
- private int [] parts1 = {1,0,0,0};
- private int [] parts2 = {0,1,0,0};
- private int [] parts3 = {0,0,1,0};
- private int [] parts4 = {0,0,0,negativeBitValue}; // Negative zero.
- private int [] parts5 = {1,1,1,0};
- private int [] partsMaxValue = {-1,-1,-1,0};
- private int [] partsMinValue = {-1,-1,-1,negativeBitValue};
- private int [] parts6 = {1234, 5678, 8888, negativeScale4Value};
- private NumberFormatInfo NfiUser;
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- NfiUser = new NumberFormatInfo();
- NfiUser.CurrencyDecimalDigits = 3;
- NfiUser.CurrencyDecimalSeparator = ",";
- NfiUser.CurrencyGroupSeparator = "_";
- NfiUser.CurrencyGroupSizes = new int[] { 2,1,0 };
- NfiUser.CurrencyNegativePattern = 10;
- NfiUser.CurrencyPositivePattern = 3;
- NfiUser.CurrencySymbol = "XYZ";
- NfiUser.NumberDecimalSeparator = "##";
- NfiUser.NumberDecimalDigits = 4;
- NfiUser.NumberGroupSeparator = "__";
- NfiUser.NumberGroupSizes = new int[] { 2,1 };
- NfiUser.PercentDecimalDigits = 1;
- NfiUser.PercentDecimalSeparator = ";";
- NfiUser.PercentGroupSeparator = "~";
- NfiUser.PercentGroupSizes = new int[] {1};
- NfiUser.PercentNegativePattern = 2;
- NfiUser.PercentPositivePattern = 2;
- NfiUser.PercentSymbol = "%%%";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public void TestToString()
- {
- ToStringTest[] tab = {
- new ToStringTest("F", 12.345678m, "12.35"),
- new ToStringTest("F3", 12.345678m, "12.346"),
- new ToStringTest("F0", 12.345678m, "12"),
- new ToStringTest("F7", 12.345678m, "12.3456780"),
- new ToStringTest("g", 12.345678m, "12.345678"),
- new ToStringTest("E", 12.345678m, "1.234568E+001"),
- new ToStringTest("E3", 12.345678m, "1.235E+001"),
- new ToStringTest("E0", 12.345678m, "1E+001"),
- new ToStringTest("e8", 12.345678m, "1.23456780e+001"),
- new ToStringTest("F", 0.0012m, "0.00"),
- new ToStringTest("F3", 0.0012m, "0.001"),
- new ToStringTest("F0", 0.0012m, "0"),
- new ToStringTest("F6", 0.0012m, "0.001200"),
- new ToStringTest("e", 0.0012m, "1.200000e-003"),
- new ToStringTest("E3", 0.0012m, "1.200E-003"),
- new ToStringTest("E0", 0.0012m, "1E-003"),
- new ToStringTest("E6", 0.0012m, "1.200000E-003"),
- new ToStringTest("F4", -0.001234m, "-0.0012"),
- new ToStringTest("E3", -0.001234m, "-1.234E-003"),
- new ToStringTest("g", -0.000012m, "-1.2e-05"),
- new ToStringTest("g", -0.00012m, "-0.00012"),
- new ToStringTest("g4", -0.00012m, "-0.00012"),
- new ToStringTest("g7", -0.00012m, "-0.00012"),
- new ToStringTest("g", -0.0001234m, "-0.0001234"),
- new ToStringTest("g", -0.0012m, "-0.0012"),
- new ToStringTest("g", -0.001234m, "-0.001234"),
- new ToStringTest("g", -0.012m, "-0.012"),
- new ToStringTest("g4", -0.012m, "-0.012"),
- new ToStringTest("g", -0.12m, "-0.12"),
- new ToStringTest("g", -1.2m, "-1.2"),
- new ToStringTest("g4", -120m, "-120"),
- new ToStringTest("g", -12m, "-12"),
- new ToStringTest("g", -120m, "-120"),
- new ToStringTest("g", -1200m, "-1200"),
- new ToStringTest("g4", -1200m, "-1200"),
- new ToStringTest("g", -1234m, "-1234"),
- new ToStringTest("g", -12000m, "-12000"),
- new ToStringTest("g4", -12000m, "-1.2e+04"),
- new ToStringTest("g5", -12000m, "-12000"),
- new ToStringTest("g", -12345m, "-12345"),
- new ToStringTest("g", -120000m, "-120000"),
- new ToStringTest("g4", -120000m, "-1.2e+05"),
- new ToStringTest("g5", -120000m, "-1.2e+05"),
- new ToStringTest("g6", -120000m, "-120000"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g5", -123456.1m, "-1.2346e+05"),
- new ToStringTest("g6", -123456.1m, "-123456"),
- new ToStringTest("g", -1200000m, "-1200000"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g", -123456.1m, "-123456.1"),
- new ToStringTest("g", -1234567.1m, "-1234567.1"),
- new ToStringTest("g", -12000000m, "-12000000"),
- new ToStringTest("g", -12345678.1m, "-12345678.1"),
- new ToStringTest("g", -12000000000000000000m, "-12000000000000000000"),
- new ToStringTest("F", -123, "-123.00"),
- new ToStringTest("F3", -123, "-123.000"),
- new ToStringTest("F0", -123, "-123"),
- new ToStringTest("E3", -123, "-1.230E+002"),
- new ToStringTest("E0", -123, "-1E+002"),
- new ToStringTest("E", -123, "-1.230000E+002"),
- new ToStringTest("F3", S.Decimal.MinValue, "-79228162514264337593543950335.000"),
- new ToStringTest("F", S.Decimal.MinValue, "-79228162514264337593543950335.00"),
- new ToStringTest("F0", S.Decimal.MinValue, "-79228162514264337593543950335"),
- new ToStringTest("E", S.Decimal.MinValue, "-7.922816E+028"),
- new ToStringTest("E3", S.Decimal.MinValue, "-7.923E+028"),
- new ToStringTest("E28", S.Decimal.MinValue, "-7.9228162514264337593543950335E+028"),
- new ToStringTest("E30", S.Decimal.MinValue, "-7.922816251426433759354395033500E+028"),
- new ToStringTest("E0", S.Decimal.MinValue, "-8E+028"),
- new ToStringTest("N3", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.000"),
- new ToStringTest("N0", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335"),
- new ToStringTest("N", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.00"),
- new ToStringTest("n3", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.000"),
- new ToStringTest("n0", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335"),
- new ToStringTest("n", S.Decimal.MinValue, "-79,228,162,514,264,337,593,543,950,335.00"),
- new ToStringTest("C", 123456.7890m, NumberFormatInfo.InvariantInfo.CurrencySymbol + "123,456.79"),
- new ToStringTest("C", -123456.7890m, "(" + NumberFormatInfo.InvariantInfo.CurrencySymbol + "123,456.79)"),
- new ToStringTest("C3", 1123456.7890m, NumberFormatInfo.InvariantInfo.CurrencySymbol + "1,123,456.789"),
- new ToStringTest("P", 123456.7891m, "12,345,678.91 %"),
- new ToStringTest("P", -123456.7892m, "-12,345,678.92 %"),
- new ToStringTest("P3", 1234.56789m, "123,456.789 %"),
- };
-
- NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;
-
- for (int i = 0; i < tab.Length; i++)
- {
- try
- {
- string s = tab[i].d.ToString(tab[i].format, nfi);
- AssertEquals("A01 tab[" + i + "].format = '" + tab[i].format + "')", tab[i].str, s);
- }
- catch (OverflowException)
- {
- Fail(tab[i].d.ToString(tab[i].format, nfi) + " (format = '" + tab[i].format + "'): unexpected exception !");
- }
- catch (NUnit.Framework.AssertionFailedError e) {
- throw e;
- }
- catch (Exception e) {
- Fail ("Unexpected Exception when i = " + i + ". e = " + e);
- }
- }
- }
-
- public void TestCurrencyPattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234567.8976m;
- string[] ergCurrencyNegativePattern = new String[16] {
- "(XYZ1234_5_67,898)", "-XYZ1234_5_67,898", "XYZ-1234_5_67,898", "XYZ1234_5_67,898-",
- "(1234_5_67,898XYZ)", "-1234_5_67,898XYZ", "1234_5_67,898-XYZ", "1234_5_67,898XYZ-",
- "-1234_5_67,898 XYZ", "-XYZ 1234_5_67,898", "1234_5_67,898 XYZ-", "XYZ 1234_5_67,898-",
- "XYZ -1234_5_67,898", "1234_5_67,898- XYZ", "(XYZ 1234_5_67,898)", "(1234_5_67,898 XYZ)",
- };
-
- for (int i = 0; i < ergCurrencyNegativePattern.Length; i++)
- {
- nfi2.CurrencyNegativePattern = i;
- if (d.ToString("C", nfi2) != ergCurrencyNegativePattern[i])
- {
- Fail("CurrencyNegativePattern #" + i + " failed: " +
- d.ToString("C", nfi2) + " != " + ergCurrencyNegativePattern[i]);
- }
- }
-
- d = 1234567.8976m;
- string[] ergCurrencyPositivePattern = new String[4] {
- "XYZ1234_5_67,898", "1234_5_67,898XYZ", "XYZ 1234_5_67,898", "1234_5_67,898 XYZ",
- };
-
- for (int i = 0; i < ergCurrencyPositivePattern.Length; i++)
- {
- nfi2.CurrencyPositivePattern = i;
- if (d.ToString("C", nfi2) != ergCurrencyPositivePattern[i])
- {
- Fail("CurrencyPositivePattern #" + i + " failed: " +
- d.ToString("C", nfi2) + " != " + ergCurrencyPositivePattern[i]);
- }
- }
- }
-
- public void TestNumberNegativePattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234.89765m;
- string[] ergNumberNegativePattern = new String[5] {
- "(1__2__34##8977)", "-1__2__34##8977", "- 1__2__34##8977", "1__2__34##8977-", "1__2__34##8977 -",
- };
-
- for (int i = 0; i < ergNumberNegativePattern.Length; i++)
- {
- nfi2.NumberNegativePattern = i;
- AssertEquals ("NumberNegativePattern #" + i, ergNumberNegativePattern[i], d.ToString("N", nfi2));
- }
- }
-
- public void TestPercentPattern()
- {
- NumberFormatInfo nfi2 = (NumberFormatInfo)NfiUser.Clone();
- S.Decimal d = -1234.8976m;
- string[] ergPercentNegativePattern = new String[3] {
- "-1~2~3~4~8~9;8 %%%", "-1~2~3~4~8~9;8%%%", "-%%%1~2~3~4~8~9;8"
- };
-
- for (int i = 0; i < ergPercentNegativePattern.Length; i++)
- {
- nfi2.PercentNegativePattern = i;
- if (d.ToString("P", nfi2) != ergPercentNegativePattern[i])
- {
- Fail("PercentNegativePattern #" + i + " failed: " +
- d.ToString("P", nfi2) + " != " + ergPercentNegativePattern[i]);
- }
- }
-
- d = 1234.8976m;
- string[] ergPercentPositivePattern = new String[3] {
- "1~2~3~4~8~9;8 %%%", "1~2~3~4~8~9;8%%%", "%%%1~2~3~4~8~9;8"
- };
-
- for (int i = 0; i < ergPercentPositivePattern.Length; i++)
- {
- nfi2.PercentPositivePattern = i;
- if (d.ToString("P", nfi2) != ergPercentPositivePattern[i])
- {
- Fail("PercentPositivePattern #" + i + " failed: " +
- d.ToString("P", nfi2) + " != " + ergPercentPositivePattern[i]);
- }
- }
- }
-
- public void TestParse()
- {
- ParseTest[] tab = {
- new ParseTest("1.2345", 1.2345m),
- new ParseTest("-9876543210", -9876543210m),
- new ParseTest(NumberFormatInfo.InvariantInfo.CurrencySymbol
- + " ( 79,228,162,514,264,337,593,543,950,335.000 ) ", S.Decimal.MinValue, NumberStyles.Currency),
- new ParseTest("1.234567890e-10", (S.Decimal)1.234567890e-10, NumberStyles.Float),
- new ParseTest("1.234567890e-24", 1.2346e-24m, NumberStyles.Float),
- new ParseTest(" 47896396.457983645462346E10 ", 478963964579836454.62346m, NumberStyles.Float),
- new ParseTest("-7922816251426433759354395033.250000000000001", -7922816251426433759354395033.3m),
- new ParseTest("-00000000000000795033.2500000000000000", -795033.25m),
- new ParseTest("-000000000000001922816251426433759354395033.300000000000000", -1922816251426433759354395033.3m),
- new ParseTest("-7922816251426433759354395033.150000000000", -7922816251426433759354395033.2m),
- new ParseTest("-7922816251426433759354395033.2400000000000", -7922816251426433759354395033.2m),
- new ParseTest("-7922816251426433759354395033.2600000000000", -7922816251426433759354395033.3m)
- };
-
- S.Decimal d;
- for (int i = 0; i < tab.Length; i++)
- {
- try
- {
- d = S.Decimal.Parse(tab[i].str, tab[i].style, NumberFormatInfo.InvariantInfo);
- if (tab[i].exceptionFlag)
- {
- Fail(tab[i].str + ": missing exception !");
- }
- else if (d != tab[i].d)
- {
- Fail(tab[i].str + " != " + d);
- }
- }
- catch (OverflowException)
- {
- if (!tab[i].exceptionFlag)
- {
- Fail(tab[i].str + ": unexpected exception !");
- }
- }
- }
-
- try
- {
- d = S.Decimal.Parse(null);
- Fail("Expected ArgumentNullException");
- }
- catch (ArgumentNullException)
- {
- //ok
- }
-
- try
- {
- d = S.Decimal.Parse("123nx");
- Fail("Expected FormatException");
- }
- catch (FormatException)
- {
- //ok
- }
-
- try
- {
- d = S.Decimal.Parse("79228162514264337593543950336");
- Fail("Expected OverflowException" + d);
- }
- catch (OverflowException)
- {
- //ok
- }
- }
-
- public void TestConstants()
- {
- Assert(0m == (decimal)S.Decimal.Zero);
- Assert(1m == (decimal)S.Decimal.One);
- Assert(-1m == (decimal)S.Decimal.MinusOne);
- Assert(0m == (decimal)S.Decimal.Zero);
- Assert(79228162514264337593543950335m == (decimal)S.Decimal.MaxValue);
- Assert(-79228162514264337593543950335m == (decimal)S.Decimal.MinValue);
- }
-
- public void TestConstructInt32()
- {
- decimal[] dtab = {0m, 1m, -1m, 123456m, -1234567m};
- int[] itab = {0, 1, -1, 123456, -1234567};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("Int32 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- int n = (int) d;
- if (n != itab[i])
- {
- Fail("Decimal -> Int32: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(Int32.MaxValue);
- Assert((int)d == Int32.MaxValue);
-
- d = new S.Decimal(Int32.MinValue);
- Assert((int)d == Int32.MinValue);
- }
-
- public void TestConstructUInt32()
- {
- decimal[] dtab = {0m, 1m, 123456m, 123456789m};
- uint[] itab = {0, 1, 123456, 123456789};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("UInt32 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- uint n = (uint) d;
- if (n != itab[i])
- {
- Fail("Decimal -> UInt32: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(UInt32.MaxValue);
- Assert((uint)d == UInt32.MaxValue);
-
- d = new Decimal(UInt32.MinValue);
- Assert((uint)d == UInt32.MinValue);
- }
-
- public void TestConstructInt64()
- {
- decimal[] dtab = {0m, 1m, -1m, 9876543m, -9876543210m, 12345678987654321m};
- long[] itab = {0, 1, -1, 9876543, -9876543210L, 12345678987654321L};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("Int64 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- long n = (long) d;
- if (n != itab[i])
- {
- Fail("Decimal -> Int64: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(Int64.MaxValue);
- Assert((long)d == Int64.MaxValue);
-
- d = new Decimal(Int64.MinValue);
- Assert((long)d == Int64.MinValue);
- }
-
- public void TestConstructUInt64()
- {
- decimal[] dtab = {0m, 1m, 987654321m, 123456789876543210m};
- ulong[] itab = {0, 1, 987654321, 123456789876543210L};
-
- S.Decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = new S.Decimal(itab[i]);
- if ((decimal)d != dtab[i])
- {
- Fail("UInt64 -> Decimal: " + itab[i] + " != " + d);
- }
- else
- {
- ulong n = (ulong) d;
- if (n != itab[i])
- {
- Fail("Decimal -> UInt64: " + d + " != " + itab[i]);
- }
- }
- }
-
- d = new S.Decimal(UInt64.MaxValue);
- Assert((ulong)d == UInt64.MaxValue);
-
- d = new Decimal(UInt64.MinValue);
- Assert((ulong)d == UInt64.MinValue);
- }
-
- public void TestConstructSingle()
- {
- S.Decimal d;
-
- d = new S.Decimal(-1.2345678f);
- AssertEquals("A#01", -1.234568m, (decimal)d);
-
- d=3;
- AssertEquals("A#02", 3.0f, (float)d);
-
- d = new S.Decimal(0.0f);
- AssertEquals("A#03", 0m, (decimal)d);
- AssertEquals("A#04", 0.0f, (float)d);
-
- d = new S.Decimal(1.0f);
- AssertEquals("A#05", 1m, (decimal)d);
- AssertEquals("A#06", 1.0f, (float)d);
-
- d = new S.Decimal(-1.2345678f);
- AssertEquals("A#07", -1.234568m, (decimal)d);
- AssertEquals("A#08", -1.234568f, (float)d);
-
- d = new S.Decimal(1.2345673f);
- AssertEquals("A#09", 1.234567m, (decimal)d);
-
- d = new S.Decimal(1.2345673e7f);
- AssertEquals("A#10", 12345670m, (decimal)d);
-
- d = new S.Decimal(1.2345673e-17f);
- AssertEquals("A#11", 0.00000000000000001234567m, (decimal)d);
- AssertEquals("A#12", 1.234567e-17f, (float)d);
-
- // test exceptions
- try
- {
- d = new S.Decimal(Single.MaxValue);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Single.NaN);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Single.PositiveInfinity);
- Fail();
- }
- catch (OverflowException)
- {
- }
- }
-
- public void TestConstructSingleRounding()
- {
- decimal d;
-
- d = new S.Decimal(1765.2356f);
- Assert(d == 1765.236m);
-
- d = new S.Decimal(1765.23554f);
- Assert("failed banker's rule rounding test 1", d == 1765.236m);
-
- d = new S.Decimal(1765.2354f);
- Assert(d == 1765.235m);
-
- d = new S.Decimal(1765.2346f);
- Assert(d == 1765.235m);
-
- d = new S.Decimal(1765.23454f);
- Assert("failed banker's rule rounding test 2", d == 1765.234m);
-
- d = new S.Decimal(1765.2344f);
- Assert(d == 1765.234m);
-
- d = new S.Decimal(0.00017652356f);
- Assert(d == 0.0001765236m);
-
- d = new S.Decimal(0.000176523554f);
- Assert("failed banker's rule rounding test 3", d == 0.0001765236m);
-
- d = new S.Decimal(0.00017652354f);
- Assert(d == 0.0001765235m);
-
- d = new S.Decimal(0.00017652346f);
- Assert(d == 0.0001765235m);
-
- d = new S.Decimal(0.000176523454f);
- Assert("failed banker's rule rounding test 4", d == 0.0001765234m);
-
- d = new S.Decimal(0.00017652344f);
- Assert(d == 0.0001765234m);
-
- d = new S.Decimal(3.7652356e10f);
- Assert(d == 37652360000m);
-
- d = new S.Decimal(3.7652356e20f);
- Assert(d == 376523600000000000000m);
-
- d = new S.Decimal(3.76523554e20f);
- Assert("failed banker's rule rounding test 5", d == 376523600000000000000m);
-
- d = new S.Decimal(3.7652352e20f);
- Assert(d == 376523500000000000000m);
-
- d = new S.Decimal(3.7652348e20f);
- Assert(d == 376523500000000000000m);
-
- d = new S.Decimal(3.76523454e20f);
- Assert("failed banker's rule rounding test 6", d == 376523400000000000000m);
-
- d = new S.Decimal(3.7652342e20f);
- Assert(d == 376523400000000000000m);
- }
-
- public void TestConstructDouble()
- {
- S.Decimal d;
-
- d = new S.Decimal(0.0);
- Assert((decimal)d == 0m);
-
- d = new S.Decimal(1.0);
- Assert((decimal)d == 1m);
- Assert(1.0 == (double)d);
-
- d = new S.Decimal(-1.2345678901234);
- Assert((decimal)d == -1.2345678901234m);
- Assert(-1.2345678901234 == (double)d);
-
- d = new S.Decimal(1.2345678901234);
- Assert((decimal)d == 1.2345678901234m);
-
- d = new S.Decimal(1.2345678901234e8);
- Assert((decimal)d == 123456789.01234m);
- Assert(1.2345678901234e8 == (double)d);
-
- d = new S.Decimal(1.2345678901234e16);
- Assert((decimal)d == 12345678901234000m);
- Assert(1.2345678901234e16 == (double)d);
-
- d = new S.Decimal(1.2345678901234e24);
- Assert((decimal)d == 1234567890123400000000000m);
- Assert(1.2345678901234e24 == (double)d);
-
- d = new S.Decimal(1.2345678901234e28);
- Assert((decimal)d == 1.2345678901234e28m);
- Assert(1.2345678901234e28 == (double)d);
-
- d = new S.Decimal(7.2345678901234e28);
- Assert((decimal)d == 7.2345678901234e28m);
- Assert(new S.Decimal((double)d) == d);
-
- d = new S.Decimal(1.2345678901234e-8);
- Assert((decimal)d == 1.2345678901234e-8m);
-
- d = new S.Decimal(1.2345678901234e-14);
- Assert((decimal)d == 1.2345678901234e-14m);
- Assert(1.2345678901234e-14 == (double)d);
-
- d = new S.Decimal(1.2342278901234e-25);
- Assert((decimal)d == 1.234e-25m);
-
- // test exceptions
- try
- {
- d = new S.Decimal(8e28);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(8e48);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Double.NaN);
- Fail();
- }
- catch (OverflowException)
- {
- }
-
- try
- {
- d = new S.Decimal(Double.PositiveInfinity);
- Fail();
- }
- catch (OverflowException)
- {
- }
- }
-
- public void TestConstructDoubleRound()
- {
- decimal d;
-
- d = new S.Decimal(1765.231234567857);
- Assert(d == 1765.23123456786m);
-
- d = new S.Decimal(1765.2312345678554);
- Assert("failed banker's rule rounding test 1", d == 1765.23123456786m);
- Assert(1765.23123456786 == (double)d);
-
- d = new S.Decimal(1765.231234567853);
- Assert(d == 1765.23123456785m);
-
- d = new S.Decimal(1765.231234567847);
- Assert(d == 1765.23123456785m);
-
- d = new S.Decimal(1765.231234567843);
- Assert(d == 1765.23123456784m);
-
- d = new S.Decimal(1.765231234567857e-9);
- Assert(d == 1.76523123456786e-9m);
-
- d = new S.Decimal(1.7652312345678554e-9);
- Assert("failed banker's rule rounding test 3", d == 1.76523123456786e-9m);
-
- d = new S.Decimal(1.765231234567853e-9);
- Assert(d == 1.76523123456785e-9m);
-
- d = new S.Decimal(1.765231234567857e+24);
- Assert(d == 1.76523123456786e+24m);
-
- d = new S.Decimal(1.7652312345678554e+24);
- Assert("failed banker's rule rounding test 4", d == 1.76523123456786e+24m);
-
- d = new S.Decimal(1.765231234567853e+24);
- Assert(d == 1.76523123456785e+24m);
-
- d = new S.Decimal(1765.2312345678454);
- Assert(d == 1765.23123456785m);
- }
-
- public void TestNegate()
- {
- decimal d;
-
- d = new S.Decimal(12345678);
- Assert((decimal)S.Decimal.Negate(d) == -12345678m);
- }
-
- public void TestPartConstruct()
- {
- decimal d;
-
- d = new Decimal(parts0);
- Assert(d == 0);
-
- d = new Decimal(parts1);
- Assert(d == 1);
-
- d = new Decimal(parts2);
- Assert(d == 4294967296m);
-
- d = new Decimal(parts3);
- Assert(d == 18446744073709551616m);
-
- d = new Decimal(parts4);
- Assert(d == 0m);
-
- d = new Decimal(parts5);
- Assert(d == 18446744078004518913m);
-
- d = new Decimal(partsMaxValue);
- Assert(d == Decimal.MaxValue);
-
- d = new Decimal(partsMinValue);
- Assert(d == Decimal.MinValue);
-
- d = new Decimal(parts6);
- int[] erg = Decimal.GetBits(d);
- for (int i = 0; i < 4; i++)
- {
- Assert(erg[i] == parts6[i]);
- }
- }
-
- public void TestFloorTruncate()
- {
- decimal[,] dtab = {
- {0m, 0m, 0m}, {1m, 1m, 1m}, {-1m, -1m, -1m}, {1.1m, 1m, 1m},
- {-1.000000000001m, -2m, -1m}, {12345.67890m,12345m,12345m},
- {-123456789012345.67890m, -123456789012346m, -123456789012345m},
- {S.Decimal.MaxValue, S.Decimal.MaxValue, S.Decimal.MaxValue},
- {S.Decimal.MinValue, S.Decimal.MinValue, S.Decimal.MinValue},
- {6.999999999m, 6m, 6m}, {-6.999999999m, -7m, -6m},
- {0.00001m, 0m, 0m}, {-0.00001m, -1m, 0m}
- };
-
- decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = S.Decimal.Floor(dtab[i,0]);
- if (d != dtab[i,1])
- {
- Fail("Floor: Floor(" + dtab[i,0] + ") != " + d);
- }
- d = S.Decimal.Truncate(dtab[i,0]);
- if (d != dtab[i,2])
- {
- Fail("Truncate: Truncate(" + dtab[i,0] + ") != " + d);
- }
- }
- }
-
- public void TestRound()
- {
- decimal[,] dtab = {
- {1m, 0, 1m}, {1.234567890m, 1, 1.2m},
- {1.234567890m, 2, 1.23m}, {1.23450000001m, 3, 1.235m},
- {1.2345m, 3, 1.234m}, {1.2355m, 3, 1.236m},
- {1.234567890m, 4, 1.2346m}, {1.23567890m, 2, 1.24m},
- {47893764694.4578563236436621m, 7, 47893764694.4578563m},
- {-47893764694.4578563236436621m, 9, -47893764694.457856324m},
- {-47893764694.4578m, 5, -47893764694.4578m}
- };
-
- decimal d;
-
- for (int i = 0; i < dtab.GetLength(0); i++)
- {
- d = S.Decimal.Round(dtab[i,0], (int)dtab[i,1]);
- if (d != dtab[i,2])
- {
- Fail("Round: Round(" + dtab[i,0] + "," + (int)dtab[i,1] + ") != " + d);
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/mcs/class/corlib/Test/System/DecimalTest2.cs b/mcs/class/corlib/Test/System/DecimalTest2.cs
deleted file mode 100644
index d7859c8b456..00000000000
--- a/mcs/class/corlib/Test/System/DecimalTest2.cs
+++ /dev/null
@@ -1,3126 +0,0 @@
-// DecimalTest.cs - NUnit Test Cases for the System.Decimal struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-
-using NUnit.Framework;
-using System;
-using S = System; // used for implementation switching
-using System.Globalization;
-using System.Runtime.CompilerServices;
-
-namespace MonoTests.System
-{
-
- public enum TestResultInfo
- {
- Ok = 0,
- Overflow = 1,
- ReverseRound = 2,
- DivideByZero = 3,
- ReverseOverflow = 4
- }
-
- public struct TestResult
- {
- public TestResult(int i, decimal v)
- {
- info = (TestResultInfo) i;
- val = v;
- }
-
- public TestResultInfo info;
- public decimal val;
- }
-
-
- /// <summary>
- /// Tests for System.Decimal
- /// </summary>
- public class DecimalTest2 : TestCase
- {
- public DecimalTest2() : base ("MonoTests.System.DecimalTest2 testcase") {}
- public DecimalTest2(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(DecimalTest2)); }
- }
-
- private void ReportOpError(string msg, int i, int j, decimal d1, decimal d2, decimal d3, decimal d3b)
- {
- Fail ("*** " + msg + " for d1=" + d1 + " i=" + i + " d2=" + d2 + " j=" + j + " d3=" + d3 + " d3b=" + d3b + "\n"
- + "Ist:" + d3 + " Soll:" + d3b + " delta=" + (d3 - d3b) + " == " + (d3 == d3b));
- }
-
- public void TestCompare()
- {
- const int size = 14;
- decimal[] data = new decimal[size] {
- 0m, 1m, -1m, 2m, 10m, 0.1m, 0.11m,
- 79228162514264337593543950335m,
- -79228162514264337593543950335m,
- 27703302467091960609331879.532m,
- -3203854.9559968181492513385018m,
- -3203854.9559968181492513385017m,
- -48466870444188873796420.0286m,
- -48466870444188873796420.02860m
- };
-
- short[,] cmpTable = new short[size,size] {
- {0,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,1,1},
- {1,0,1,-1,-1,1,1,-1,1,-1,1,1,1,1},
- {-1,-1,0,-1,-1,-1,-1,-1,1,-1,1,1,1,1},
- {1,1,1,0,-1,1,1,-1,1,-1,1,1,1,1},
- {1,1,1,1,0,1,1,-1,1,-1,1,1,1,1},
- {1,-1,1,-1,-1,0,-1,-1,1,-1,1,1,1,1},
- {1,-1,1,-1,-1,1,0,-1,1,-1,1,1,1,1},
- {1,1,1,1,1,1,1,0,1,1,1,1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1},
- {1,1,1,1,1,1,1,-1,1,0,1,1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,0,-1,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,1,0,1,1},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,0,0},
- {-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,0,0}
- };
-
- for (int i = 0; i < size; i++)
- {
- S.Decimal d1 = data[i];
- for (int j = 0; j < size; j++)
- {
- Assert(cmpTable[i,j] == -cmpTable[j,i]);
- int x = cmpTable[i,j];
- S.Decimal d2 = data[j];
-
- int y = S.Decimal.Compare(d1, d2);
- if (y < 0) y = -1;
- else if (y > 0) y = 1;
- Assert(x == y);
-
- y = d1.CompareTo(d2);
- if (y < 0) y = -1;
- else if (y > 0) y = 1;
- Assert(x == y);
-
- bool b = d1 < d2;
- if (x != -1) b = !b;
- Assert(b);
-
- b = d1 <= d2;
- if (x == 1) b = !b;
- Assert(b);
-
- b = d1 >= d2;
- if (x == -1) b = !b;
- Assert(b);
-
- b = d1 > d2;
- if (x != 1) b = !b;
- Assert(b);
-
- b = d1 == d2;
- if (x != 0) b = !b;
- Assert(b);
-
- b = d1.Equals(d2);
- if (x != 0) b = !b;
- Assert(b);
-
- b = S.Decimal.Equals(d1, d2);
- if (x != 0) b = !b;
- Assert(b);
- }
- }
- }
-
- public void TestRemainder()
- {
- Assert((decimal)S.Decimal.Remainder(3.6m, 1.3m) == 1.0m);
- Assert((decimal)S.Decimal.Remainder(79228162514264337593543950335m ,
- 27703302467091960609331879.53200m) == 24420760848422211464106753m);
-
- Assert((decimal)S.Decimal.Remainder(45937986975432m, 43987453m)
- == 42334506m);
- Assert((decimal)S.Decimal.Remainder(45937986975000m, 5000m)
- == 0m);
- Assert((decimal)S.Decimal.Remainder(-54789548973.6234m, 1.3356m)
- == -0.1074m);
- }
-
- public void TestAdd()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Add_build2;
- int errOverflow = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Add(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Add: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else
- {
- ReportOpError("Add: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- else if (tr.info == TestResultInfo.Ok)
- {
- d4 = S.Decimal.Subtract(d3, d2);
- if (d4 != d1)
- {
- ReportOpError("Subtract: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Add: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong additions, " + errOverflow + " wrong overflows");
- }
- }
-
- public void TestMult()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Mult_build2;
- int errOverflow = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Multiply(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Mult: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else
- {
- ReportOpError("Mult: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Mult: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
-
- if (d2 != 0 && tr.info != TestResultInfo.Overflow)
- {
- try
- {
- d4 = S.Decimal.Divide(d3, d2);
- if (d4 != d1 && tr.info != TestResultInfo.ReverseRound)
- {
- ReportOpError("MultDiv: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.ReverseOverflow)
- {
- ReportOpError("MultDiv: unexpected overflow", i, j, d3, d2, d4, d1);
- errOverflow++;
- }
- }
- }
-
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong multiplications, " + errOverflow + " wrong overflows");
- }
- }
-
- public void TestDiv()
- {
- decimal[] args = auto_build2;
- TestResult[] trs = trAuto_Div_build2;
- int errOverflow = 0;
- int errDivideByZero = 0;
- int errOp = 0;
- int count = args.GetLength(0);
- int n = 0;
- for (int i = 0; i < count; i++)
- {
- decimal d1 = args[i];
- for (int j = 0; j < count; j++, n++)
- {
- decimal d2 = args[j];
- decimal d3 = 0;
- decimal d4 = 0;
- TestResult tr = trs[n];
- try
- {
- d3 = S.Decimal.Divide(d1, d2);
- if (d3 != tr.val)
- {
- if (tr.info == TestResultInfo.Overflow)
- {
- ReportOpError("Div: expected overflow", i, j, d1, d2, d3, tr.val);
- errOverflow++;
- }
- else if (tr.info == TestResultInfo.DivideByZero)
- {
- ReportOpError("Div: expected divide by zero", i, j, d1, d2, d3, tr.val);
- errDivideByZero++;
- }
- else
- {
- ReportOpError("Div: result mismatch", i, j, d1, d2, d3, tr.val);
- errOp++;
- }
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.Overflow)
- {
- ReportOpError("Div: unexpected overflow", i, j, d1, d2, d3, 0);
- errOverflow++;
- }
- }
- catch (DivideByZeroException)
- {
- if (tr.info != TestResultInfo.DivideByZero)
- {
- ReportOpError("Div: unexpected divide by zero", i, j, d1, d2, d3, 0);
- errDivideByZero++;
- }
- }
-
- if (d3 != 0)
- {
- try
- {
- d4 = S.Decimal.Multiply(d3, d2);
- if (d4 != d1 && tr.info != TestResultInfo.ReverseRound)
- {
- ReportOpError("DivMult: result mismatch", i, j, d3, d2, d4, d1);
- errOp++;
- }
- }
- catch (OverflowException)
- {
- if (tr.info != TestResultInfo.ReverseOverflow)
- {
- ReportOpError("DivMult: unexpected overflow", i, j, d3, d2, d4, d1);
- errOverflow++;
- }
- }
- }
- }
- }
-
- if (errOverflow + errOp > 0)
- {
- Fail("" + errOp + " wrong division, " + errOverflow + " wrong overflows, " + errDivideByZero + " wrong divide by zero, ");
- }
- }
-
- #region Data
-
-
- // generated argument list build2
- decimal[] auto_build2 = new decimal[] {
- 0m, // 0
- 1m, // 1
- -1m, // 2
- 2m, // 3
- 10m, // 4
- 0.1m, // 5
- 79228162514264337593543950335m, // 6
- -79228162514264337593543950335m, // 7
- 27703302467091960609331879.532m, // 8
- -3203854.9559968181492513385018m, // 9
- -48466870444188873796420.028868m, // 10
- -545193693242804794.30331374676m, // 11
- 0.7629234053338741809892531431m, // 12
- -400453059665371395972.33474452m, // 13
- 222851627785191714190050.61676m, // 14
- 14246043379204153213661335.584m, // 15
- -421123.30446308691436596648186m, // 16
- 24463288738299545.200508898642m, // 17
- -5323259153836385912697776.001m, // 18
- 102801066199805834724673169.19m, // 19
- 7081320760.3793287174700927968m, // 20
- 415752273939.77704245656837041m, // 21
- -6389392489892.6362673670820462m, // 22
- 442346282742915.0596416330681m, // 23
- -512833780867323.89020837443764m, // 24
- 608940580690915704.1450897514m, // 25
- -42535053313319986966115.037787m, // 26
- -7808274522591953107485.8812311m, // 27
- 1037807626804273037330059471.7m, // 28
- -4997122966.448652425771563042m, // 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Add_build2 = new TestResult[] {
- new TestResult(0, 0m), // 0 + 0
- new TestResult(0, 1m), // 0 + 1
- new TestResult(0, -1m), // 0 + 2
- new TestResult(0, 2m), // 0 + 3
- new TestResult(0, 10m), // 0 + 4
- new TestResult(0, 0.1m), // 0 + 5
- new TestResult(0, 79228162514264337593543950335m), // 0 + 6
- new TestResult(0, -79228162514264337593543950335m), // 0 + 7
- new TestResult(0, 27703302467091960609331879.532m), // 0 + 8
- new TestResult(0, -3203854.9559968181492513385018m), // 0 + 9
- new TestResult(0, -48466870444188873796420.028868m), // 0 + 10
- new TestResult(0, -545193693242804794.30331374676m), // 0 + 11
- new TestResult(0, 0.7629234053338741809892531431m), // 0 + 12
- new TestResult(0, -400453059665371395972.33474452m), // 0 + 13
- new TestResult(0, 222851627785191714190050.61676m), // 0 + 14
- new TestResult(0, 14246043379204153213661335.584m), // 0 + 15
- new TestResult(0, -421123.30446308691436596648186m), // 0 + 16
- new TestResult(0, 24463288738299545.200508898642m), // 0 + 17
- new TestResult(0, -5323259153836385912697776.001m), // 0 + 18
- new TestResult(0, 102801066199805834724673169.19m), // 0 + 19
- new TestResult(0, 7081320760.3793287174700927968m), // 0 + 20
- new TestResult(0, 415752273939.77704245656837041m), // 0 + 21
- new TestResult(0, -6389392489892.6362673670820462m), // 0 + 22
- new TestResult(0, 442346282742915.0596416330681m), // 0 + 23
- new TestResult(0, -512833780867323.89020837443764m), // 0 + 24
- new TestResult(0, 608940580690915704.1450897514m), // 0 + 25
- new TestResult(0, -42535053313319986966115.037787m), // 0 + 26
- new TestResult(0, -7808274522591953107485.8812311m), // 0 + 27
- new TestResult(0, 1037807626804273037330059471.7m), // 0 + 28
- new TestResult(0, -4997122966.448652425771563042m), // 0 + 29
- new TestResult(0, 1m), // 1 + 0
- new TestResult(0, 2m), // 1 + 1
- new TestResult(0, 0m), // 1 + 2
- new TestResult(0, 3m), // 1 + 3
- new TestResult(0, 11m), // 1 + 4
- new TestResult(0, 1.1m), // 1 + 5
- new TestResult(1, 0m), // 1 + 6
- new TestResult(0, -79228162514264337593543950334m), // 1 + 7
- new TestResult(0, 27703302467091960609331880.532m), // 1 + 8
- new TestResult(0, -3203853.9559968181492513385018m), // 1 + 9
- new TestResult(0, -48466870444188873796419.028868m), // 1 + 10
- new TestResult(0, -545193693242804793.30331374676m), // 1 + 11
- new TestResult(0, 1.7629234053338741809892531431m), // 1 + 12
- new TestResult(0, -400453059665371395971.33474452m), // 1 + 13
- new TestResult(0, 222851627785191714190051.61676m), // 1 + 14
- new TestResult(0, 14246043379204153213661336.584m), // 1 + 15
- new TestResult(0, -421122.30446308691436596648186m), // 1 + 16
- new TestResult(0, 24463288738299546.200508898642m), // 1 + 17
- new TestResult(0, -5323259153836385912697775.001m), // 1 + 18
- new TestResult(0, 102801066199805834724673170.19m), // 1 + 19
- new TestResult(0, 7081320761.3793287174700927968m), // 1 + 20
- new TestResult(0, 415752273940.77704245656837041m), // 1 + 21
- new TestResult(0, -6389392489891.6362673670820462m), // 1 + 22
- new TestResult(0, 442346282742916.0596416330681m), // 1 + 23
- new TestResult(0, -512833780867322.89020837443764m), // 1 + 24
- new TestResult(0, 608940580690915705.1450897514m), // 1 + 25
- new TestResult(0, -42535053313319986966114.037787m), // 1 + 26
- new TestResult(0, -7808274522591953107484.8812311m), // 1 + 27
- new TestResult(0, 1037807626804273037330059472.7m), // 1 + 28
- new TestResult(0, -4997122965.448652425771563042m), // 1 + 29
- new TestResult(0, -1m), // 2 + 0
- new TestResult(0, 0m), // 2 + 1
- new TestResult(0, -2m), // 2 + 2
- new TestResult(0, 1m), // 2 + 3
- new TestResult(0, 9m), // 2 + 4
- new TestResult(0, -0.9m), // 2 + 5
- new TestResult(0, 79228162514264337593543950334m), // 2 + 6
- new TestResult(1, 0m), // 2 + 7
- new TestResult(0, 27703302467091960609331878.532m), // 2 + 8
- new TestResult(0, -3203855.9559968181492513385018m), // 2 + 9
- new TestResult(0, -48466870444188873796421.028868m), // 2 + 10
- new TestResult(0, -545193693242804795.30331374676m), // 2 + 11
- new TestResult(0, -0.2370765946661258190107468569m), // 2 + 12
- new TestResult(0, -400453059665371395973.33474452m), // 2 + 13
- new TestResult(0, 222851627785191714190049.61676m), // 2 + 14
- new TestResult(0, 14246043379204153213661334.584m), // 2 + 15
- new TestResult(0, -421124.30446308691436596648186m), // 2 + 16
- new TestResult(0, 24463288738299544.200508898642m), // 2 + 17
- new TestResult(0, -5323259153836385912697777.001m), // 2 + 18
- new TestResult(0, 102801066199805834724673168.19m), // 2 + 19
- new TestResult(0, 7081320759.3793287174700927968m), // 2 + 20
- new TestResult(0, 415752273938.77704245656837041m), // 2 + 21
- new TestResult(0, -6389392489893.6362673670820462m), // 2 + 22
- new TestResult(0, 442346282742914.0596416330681m), // 2 + 23
- new TestResult(0, -512833780867324.89020837443764m), // 2 + 24
- new TestResult(0, 608940580690915703.1450897514m), // 2 + 25
- new TestResult(0, -42535053313319986966116.037787m), // 2 + 26
- new TestResult(0, -7808274522591953107486.8812311m), // 2 + 27
- new TestResult(0, 1037807626804273037330059470.7m), // 2 + 28
- new TestResult(0, -4997122967.448652425771563042m), // 2 + 29
- new TestResult(0, 2m), // 3 + 0
- new TestResult(0, 3m), // 3 + 1
- new TestResult(0, 1m), // 3 + 2
- new TestResult(0, 4m), // 3 + 3
- new TestResult(0, 12m), // 3 + 4
- new TestResult(0, 2.1m), // 3 + 5
- new TestResult(1, 0m), // 3 + 6
- new TestResult(0, -79228162514264337593543950333m), // 3 + 7
- new TestResult(0, 27703302467091960609331881.532m), // 3 + 8
- new TestResult(0, -3203852.9559968181492513385018m), // 3 + 9
- new TestResult(0, -48466870444188873796418.028868m), // 3 + 10
- new TestResult(0, -545193693242804792.30331374676m), // 3 + 11
- new TestResult(0, 2.7629234053338741809892531431m), // 3 + 12
- new TestResult(0, -400453059665371395970.33474452m), // 3 + 13
- new TestResult(0, 222851627785191714190052.61676m), // 3 + 14
- new TestResult(0, 14246043379204153213661337.584m), // 3 + 15
- new TestResult(0, -421121.30446308691436596648186m), // 3 + 16
- new TestResult(0, 24463288738299547.200508898642m), // 3 + 17
- new TestResult(0, -5323259153836385912697774.001m), // 3 + 18
- new TestResult(0, 102801066199805834724673171.19m), // 3 + 19
- new TestResult(0, 7081320762.3793287174700927968m), // 3 + 20
- new TestResult(0, 415752273941.77704245656837041m), // 3 + 21
- new TestResult(0, -6389392489890.6362673670820462m), // 3 + 22
- new TestResult(0, 442346282742917.0596416330681m), // 3 + 23
- new TestResult(0, -512833780867321.89020837443764m), // 3 + 24
- new TestResult(0, 608940580690915706.1450897514m), // 3 + 25
- new TestResult(0, -42535053313319986966113.037787m), // 3 + 26
- new TestResult(0, -7808274522591953107483.8812311m), // 3 + 27
- new TestResult(0, 1037807626804273037330059473.7m), // 3 + 28
- new TestResult(0, -4997122964.448652425771563042m), // 3 + 29
- new TestResult(0, 10m), // 4 + 0
- new TestResult(0, 11m), // 4 + 1
- new TestResult(0, 9m), // 4 + 2
- new TestResult(0, 12m), // 4 + 3
- new TestResult(0, 20m), // 4 + 4
- new TestResult(0, 10.1m), // 4 + 5
- new TestResult(1, 0m), // 4 + 6
- new TestResult(0, -79228162514264337593543950325m), // 4 + 7
- new TestResult(0, 27703302467091960609331889.532m), // 4 + 8
- new TestResult(0, -3203844.9559968181492513385018m), // 4 + 9
- new TestResult(0, -48466870444188873796410.028868m), // 4 + 10
- new TestResult(0, -545193693242804784.30331374676m), // 4 + 11
- new TestResult(0, 10.762923405333874180989253143m), // 4 + 12
- new TestResult(0, -400453059665371395962.33474452m), // 4 + 13
- new TestResult(0, 222851627785191714190060.61676m), // 4 + 14
- new TestResult(0, 14246043379204153213661345.584m), // 4 + 15
- new TestResult(0, -421113.30446308691436596648186m), // 4 + 16
- new TestResult(0, 24463288738299555.200508898642m), // 4 + 17
- new TestResult(0, -5323259153836385912697766.001m), // 4 + 18
- new TestResult(0, 102801066199805834724673179.19m), // 4 + 19
- new TestResult(0, 7081320770.3793287174700927968m), // 4 + 20
- new TestResult(0, 415752273949.77704245656837041m), // 4 + 21
- new TestResult(0, -6389392489882.6362673670820462m), // 4 + 22
- new TestResult(0, 442346282742925.0596416330681m), // 4 + 23
- new TestResult(0, -512833780867313.89020837443764m), // 4 + 24
- new TestResult(0, 608940580690915714.1450897514m), // 4 + 25
- new TestResult(0, -42535053313319986966105.037787m), // 4 + 26
- new TestResult(0, -7808274522591953107475.8812311m), // 4 + 27
- new TestResult(0, 1037807626804273037330059481.7m), // 4 + 28
- new TestResult(0, -4997122956.448652425771563042m), // 4 + 29
- new TestResult(0, 0.1m), // 5 + 0
- new TestResult(0, 1.1m), // 5 + 1
- new TestResult(0, -0.9m), // 5 + 2
- new TestResult(0, 2.1m), // 5 + 3
- new TestResult(0, 10.1m), // 5 + 4
- new TestResult(0, 0.2m), // 5 + 5
- new TestResult(2, 79228162514264337593543950335m), // 5 + 6
- new TestResult(2, -79228162514264337593543950335m), // 5 + 7
- new TestResult(0, 27703302467091960609331879.632m), // 5 + 8
- new TestResult(0, -3203854.8559968181492513385018m), // 5 + 9
- new TestResult(0, -48466870444188873796419.928868m), // 5 + 10
- new TestResult(0, -545193693242804794.20331374676m), // 5 + 11
- new TestResult(0, 0.8629234053338741809892531431m), // 5 + 12
- new TestResult(0, -400453059665371395972.23474452m), // 5 + 13
- new TestResult(0, 222851627785191714190050.71676m), // 5 + 14
- new TestResult(0, 14246043379204153213661335.684m), // 5 + 15
- new TestResult(0, -421123.20446308691436596648186m), // 5 + 16
- new TestResult(0, 24463288738299545.300508898642m), // 5 + 17
- new TestResult(0, -5323259153836385912697775.901m), // 5 + 18
- new TestResult(0, 102801066199805834724673169.29m), // 5 + 19
- new TestResult(0, 7081320760.4793287174700927968m), // 5 + 20
- new TestResult(0, 415752273939.87704245656837041m), // 5 + 21
- new TestResult(0, -6389392489892.5362673670820462m), // 5 + 22
- new TestResult(0, 442346282742915.1596416330681m), // 5 + 23
- new TestResult(0, -512833780867323.79020837443764m), // 5 + 24
- new TestResult(0, 608940580690915704.2450897514m), // 5 + 25
- new TestResult(0, -42535053313319986966114.937787m), // 5 + 26
- new TestResult(0, -7808274522591953107485.7812311m), // 5 + 27
- new TestResult(0, 1037807626804273037330059471.8m), // 5 + 28
- new TestResult(0, -4997122966.348652425771563042m), // 5 + 29
- new TestResult(0, 79228162514264337593543950335m), // 6 + 0
- new TestResult(1, 0m), // 6 + 1
- new TestResult(0, 79228162514264337593543950334m), // 6 + 2
- new TestResult(1, 0m), // 6 + 3
- new TestResult(1, 0m), // 6 + 4
- new TestResult(0, 79228162514264337593543950335m), // 6 + 5
- new TestResult(1, 0m), // 6 + 6
- new TestResult(0, 0m), // 6 + 7
- new TestResult(1, 0m), // 6 + 8
- new TestResult(0, 79228162514264337593540746480m), // 6 + 9
- new TestResult(0, 79228114047393893404670153915m), // 6 + 10
- new TestResult(0, 79228162513719143900301145541m), // 6 + 11
- new TestResult(1, 0m), // 6 + 12
- new TestResult(0, 79228162113811277928172554363m), // 6 + 13
- new TestResult(1, 0m), // 6 + 14
- new TestResult(1, 0m), // 6 + 15
- new TestResult(0, 79228162514264337593543529212m), // 6 + 16
- new TestResult(1, 0m), // 6 + 17
- new TestResult(0, 79222839255110501207631252559m), // 6 + 18
- new TestResult(1, 0m), // 6 + 19
- new TestResult(1, 0m), // 6 + 20
- new TestResult(1, 0m), // 6 + 21
- new TestResult(0, 79228162514264331204151460442m), // 6 + 22
- new TestResult(1, 0m), // 6 + 23
- new TestResult(0, 79228162514263824759763083011m), // 6 + 24
- new TestResult(1, 0m), // 6 + 25
- new TestResult(0, 79228119979211024273556984220m), // 6 + 26
- new TestResult(0, 79228154705989815001590842849m), // 6 + 27
- new TestResult(1, 0m), // 6 + 28
- new TestResult(0, 79228162514264337588546827369m), // 6 + 29
- new TestResult(0, -79228162514264337593543950335m), // 7 + 0
- new TestResult(0, -79228162514264337593543950334m), // 7 + 1
- new TestResult(1, 0m), // 7 + 2
- new TestResult(0, -79228162514264337593543950333m), // 7 + 3
- new TestResult(0, -79228162514264337593543950325m), // 7 + 4
- new TestResult(0, -79228162514264337593543950335m), // 7 + 5
- new TestResult(0, 0m), // 7 + 6
- new TestResult(1, 0m), // 7 + 7
- new TestResult(0, -79200459211797245632934618455m), // 7 + 8
- new TestResult(1, 0m), // 7 + 9
- new TestResult(1, 0m), // 7 + 10
- new TestResult(1, 0m), // 7 + 11
- new TestResult(0, -79228162514264337593543950334m), // 7 + 12
- new TestResult(1, 0m), // 7 + 13
- new TestResult(0, -79227939662636552401829760284m), // 7 + 14
- new TestResult(0, -79213916470885133440330288999m), // 7 + 15
- new TestResult(1, 0m), // 7 + 16
- new TestResult(0, -79228162514239874304805650790m), // 7 + 17
- new TestResult(1, 0m), // 7 + 18
- new TestResult(0, -79125361448064531758819277166m), // 7 + 19
- new TestResult(0, -79228162514264337586462629575m), // 7 + 20
- new TestResult(0, -79228162514264337177791676395m), // 7 + 21
- new TestResult(1, 0m), // 7 + 22
- new TestResult(0, -79228162514263895247261207420m), // 7 + 23
- new TestResult(1, 0m), // 7 + 24
- new TestResult(0, -79228162513655397012853034631m), // 7 + 25
- new TestResult(1, 0m), // 7 + 26
- new TestResult(1, 0m), // 7 + 27
- new TestResult(0, -78190354887460064556213890863m), // 7 + 28
- new TestResult(1, 0m), // 7 + 29
- new TestResult(0, 27703302467091960609331879.532m), // 8 + 0
- new TestResult(0, 27703302467091960609331880.532m), // 8 + 1
- new TestResult(0, 27703302467091960609331878.532m), // 8 + 2
- new TestResult(0, 27703302467091960609331881.532m), // 8 + 3
- new TestResult(0, 27703302467091960609331889.532m), // 8 + 4
- new TestResult(0, 27703302467091960609331879.632m), // 8 + 5
- new TestResult(1, 0m), // 8 + 6
- new TestResult(2, -79200459211797245632934618455m), // 8 + 7
- new TestResult(0, 55406604934183921218663759.064m), // 8 + 8
- new TestResult(0, 27703302467091960606128024.576m), // 8 + 9
- new TestResult(0, 27654835596647771735535459.503m), // 8 + 10
- new TestResult(0, 27703301921898267366527085.229m), // 8 + 11
- new TestResult(0, 27703302467091960609331880.295m), // 8 + 12
- new TestResult(0, 27702902014032295237935907.197m), // 8 + 13
- new TestResult(0, 27926154094877152323521930.149m), // 8 + 14
- new TestResult(0, 41949345846296113822993215.116m), // 8 + 15
- new TestResult(0, 27703302467091960608910756.228m), // 8 + 16
- new TestResult(0, 27703302491555249347631424.733m), // 8 + 17
- new TestResult(0, 22380043313255574696634103.531m), // 8 + 18
- new TestResult(2, 130504368666897795334005048.72m), // 8 + 19
- new TestResult(0, 27703302467091967690652639.911m), // 8 + 20
- new TestResult(0, 27703302467092376361605819.309m), // 8 + 21
- new TestResult(0, 27703302467085571216841986.896m), // 8 + 22
- new TestResult(0, 27703302467534306892074794.592m), // 8 + 23
- new TestResult(0, 27703302466579126828464555.642m), // 8 + 24
- new TestResult(0, 27703303076032541300247583.677m), // 8 + 25
- new TestResult(0, 27660767413778640622365764.494m), // 8 + 26
- new TestResult(0, 27695494192569368656224393.651m), // 8 + 27
- new TestResult(2, 1065510929271364997939391351.2m), // 8 + 28
- new TestResult(0, 27703302467091955612208913.083m), // 8 + 29
- new TestResult(0, -3203854.9559968181492513385018m), // 9 + 0
- new TestResult(0, -3203853.9559968181492513385018m), // 9 + 1
- new TestResult(0, -3203855.9559968181492513385018m), // 9 + 2
- new TestResult(0, -3203852.9559968181492513385018m), // 9 + 3
- new TestResult(0, -3203844.9559968181492513385018m), // 9 + 4
- new TestResult(0, -3203854.8559968181492513385018m), // 9 + 5
- new TestResult(2, 79228162514264337593540746480m), // 9 + 6
- new TestResult(1, 0m), // 9 + 7
- new TestResult(2, 27703302467091960606128024.576m), // 9 + 8
- new TestResult(0, -6407709.9119936362985026770036m), // 9 + 9
- new TestResult(2, -48466870444188877000274.984865m), // 9 + 10
- new TestResult(2, -545193693246008649.25931056491m), // 9 + 11
- new TestResult(0, -3203854.1930734128153771575125m), // 9 + 12
- new TestResult(2, -400453059665374599827.29074134m), // 9 + 13
- new TestResult(2, 222851627785191710986195.66076m), // 9 + 14
- new TestResult(2, 14246043379204153210457480.628m), // 9 + 15
- new TestResult(0, -3624978.2604599050636173049837m), // 9 + 16
- new TestResult(2, 24463288735095690.244512080493m), // 9 + 17
- new TestResult(2, -5323259153836385915901630.957m), // 9 + 18
- new TestResult(2, 102801066199805834721469314.23m), // 9 + 19
- new TestResult(2, 7078116905.4233318993208414583m), // 9 + 20
- new TestResult(2, 415749070084.82104563841911907m), // 9 + 21
- new TestResult(2, -6389395693747.5922641852312975m), // 9 + 22
- new TestResult(2, 442346279539060.10364481491885m), // 9 + 23
- new TestResult(2, -512833784071178.84620519258689m), // 9 + 24
- new TestResult(2, 608940580687711849.18909293325m), // 9 + 25
- new TestResult(2, -42535053313319990169969.993784m), // 9 + 26
- new TestResult(2, -7808274522591956311340.8372279m), // 9 + 27
- new TestResult(2, 1037807626804273037326855616.7m), // 9 + 28
- new TestResult(2, -5000326821.4046492439208143805m), // 9 + 29
- new TestResult(0, -48466870444188873796420.028868m), // 10 + 0
- new TestResult(0, -48466870444188873796419.028868m), // 10 + 1
- new TestResult(0, -48466870444188873796421.028868m), // 10 + 2
- new TestResult(0, -48466870444188873796418.028868m), // 10 + 3
- new TestResult(0, -48466870444188873796410.028868m), // 10 + 4
- new TestResult(0, -48466870444188873796419.928868m), // 10 + 5
- new TestResult(2, 79228114047393893404670153915m), // 10 + 6
- new TestResult(1, 0m), // 10 + 7
- new TestResult(2, 27654835596647771735535459.503m), // 10 + 8
- new TestResult(0, -48466870444188877000274.984865m), // 10 + 9
- new TestResult(2, -96933740888377747592840.05774m), // 10 + 10
- new TestResult(0, -48467415637882116601214.332182m), // 10 + 11
- new TestResult(0, -48466870444188873796419.265945m), // 10 + 12
- new TestResult(0, -48867323503854245192392.363613m), // 10 + 13
- new TestResult(2, 174384757341002840393630.58789m), // 10 + 14
- new TestResult(2, 14197576508759964339864915.555m), // 10 + 15
- new TestResult(0, -48466870444188874217543.333331m), // 10 + 16
- new TestResult(0, -48466845980900135496874.828359m), // 10 + 17
- new TestResult(2, -5371726024280574786494196.0299m), // 10 + 18
- new TestResult(2, 102752599329361645850876749.16m), // 10 + 19
- new TestResult(0, -48466870444181792475659.649539m), // 10 + 20
- new TestResult(0, -48466870443773121522480.251826m), // 10 + 21
- new TestResult(0, -48466870450578266286312.665135m), // 10 + 22
- new TestResult(0, -48466870001842591053504.969226m), // 10 + 23
- new TestResult(0, -48466870957022654663743.919076m), // 10 + 24
- new TestResult(0, -48466261503608182880715.883778m), // 10 + 25
- new TestResult(2, -91001923757508860762535.06666m), // 10 + 26
- new TestResult(0, -56275144966780826903905.910099m), // 10 + 27
- new TestResult(2, 1037759159933828848456263051.7m), // 10 + 28
- new TestResult(0, -48466870444193870919386.47752m), // 10 + 29
- new TestResult(0, -545193693242804794.30331374676m), // 11 + 0
- new TestResult(0, -545193693242804793.30331374676m), // 11 + 1
- new TestResult(0, -545193693242804795.30331374676m), // 11 + 2
- new TestResult(0, -545193693242804792.30331374676m), // 11 + 3
- new TestResult(0, -545193693242804784.30331374676m), // 11 + 4
- new TestResult(0, -545193693242804794.20331374676m), // 11 + 5
- new TestResult(2, 79228162513719143900301145541m), // 11 + 6
- new TestResult(1, 0m), // 11 + 7
- new TestResult(2, 27703301921898267366527085.229m), // 11 + 8
- new TestResult(0, -545193693246008649.25931056491m), // 11 + 9
- new TestResult(2, -48467415637882116601214.332182m), // 11 + 10
- new TestResult(2, -1090387386485609588.6066274935m), // 11 + 11
- new TestResult(0, -545193693242804793.54039034143m), // 11 + 12
- new TestResult(2, -400998253358614200766.63805827m), // 11 + 13
- new TestResult(2, 222851082591498471385256.31345m), // 11 + 14
- new TestResult(2, 14246042834010459970856541.281m), // 11 + 15
- new TestResult(0, -545193693243225917.60777683367m), // 11 + 16
- new TestResult(0, -520730404504505249.10280484812m), // 11 + 17
- new TestResult(2, -5323259699030079155502570.3043m), // 11 + 18
- new TestResult(2, 102801065654612141481868374.89m), // 11 + 19
- new TestResult(0, -545193686161484033.92398502929m), // 11 + 20
- new TestResult(0, -545193277490530854.52627129019m), // 11 + 21
- new TestResult(0, -545200082635294686.93958111384m), // 11 + 22
- new TestResult(0, -544751346960061879.24367211369m), // 11 + 23
- new TestResult(0, -545706527023672118.1935221212m), // 11 + 24
- new TestResult(0, 63746887448110909.84177600464m), // 11 + 25
- new TestResult(2, -42535598507013229770909.341101m), // 11 + 26
- new TestResult(2, -7808819716285195912280.1845448m), // 11 + 27
- new TestResult(2, 1037807626259079344087254677.4m), // 11 + 28
- new TestResult(0, -545193698239927760.75196617253m), // 11 + 29
- new TestResult(0, 0.7629234053338741809892531431m), // 12 + 0
- new TestResult(0, 1.7629234053338741809892531431m), // 12 + 1
- new TestResult(0, -0.2370765946661258190107468569m), // 12 + 2
- new TestResult(0, 2.7629234053338741809892531431m), // 12 + 3
- new TestResult(2, 10.762923405333874180989253143m), // 12 + 4
- new TestResult(0, 0.8629234053338741809892531431m), // 12 + 5
- new TestResult(1, 0m), // 12 + 6
- new TestResult(2, -79228162514264337593543950334m), // 12 + 7
- new TestResult(2, 27703302467091960609331880.295m), // 12 + 8
- new TestResult(2, -3203854.1930734128153771575125m), // 12 + 9
- new TestResult(2, -48466870444188873796419.265945m), // 12 + 10
- new TestResult(2, -545193693242804793.54039034143m), // 12 + 11
- new TestResult(0, 1.5258468106677483619785062862m), // 12 + 12
- new TestResult(2, -400453059665371395971.57182111m), // 12 + 13
- new TestResult(2, 222851627785191714190051.37968m), // 12 + 14
- new TestResult(2, 14246043379204153213661336.347m), // 12 + 15
- new TestResult(2, -421122.54153968158049178549261m), // 12 + 16
- new TestResult(2, 24463288738299545.963432303976m), // 12 + 17
- new TestResult(2, -5323259153836385912697775.2381m), // 12 + 18
- new TestResult(2, 102801066199805834724673169.95m), // 12 + 19
- new TestResult(2, 7081320761.1422521228039669778m), // 12 + 20
- new TestResult(2, 415752273940.53996586190224459m), // 12 + 21
- new TestResult(2, -6389392489891.873343961748172m), // 12 + 22
- new TestResult(2, 442346282742915.82256503840197m), // 12 + 23
- new TestResult(2, -512833780867323.12728496910377m), // 12 + 24
- new TestResult(2, 608940580690915704.90801315673m), // 12 + 25
- new TestResult(2, -42535053313319986966114.274864m), // 12 + 26
- new TestResult(2, -7808274522591953107485.1183077m), // 12 + 27
- new TestResult(2, 1037807626804273037330059472.5m), // 12 + 28
- new TestResult(2, -4997122965.685729020437688861m), // 12 + 29
- new TestResult(0, -400453059665371395972.33474452m), // 13 + 0
- new TestResult(0, -400453059665371395971.33474452m), // 13 + 1
- new TestResult(0, -400453059665371395973.33474452m), // 13 + 2
- new TestResult(0, -400453059665371395970.33474452m), // 13 + 3
- new TestResult(0, -400453059665371395962.33474452m), // 13 + 4
- new TestResult(0, -400453059665371395972.23474452m), // 13 + 5
- new TestResult(2, 79228162113811277928172554363m), // 13 + 6
- new TestResult(1, 0m), // 13 + 7
- new TestResult(2, 27702902014032295237935907.197m), // 13 + 8
- new TestResult(0, -400453059665374599827.29074134m), // 13 + 9
- new TestResult(2, -48867323503854245192392.363613m), // 13 + 10
- new TestResult(0, -400998253358614200766.63805827m), // 13 + 11
- new TestResult(0, -400453059665371395971.57182111m), // 13 + 12
- new TestResult(2, -800906119330742791944.669489m), // 13 + 13
- new TestResult(2, 222451174725526342794078.28202m), // 13 + 14
- new TestResult(2, 14245642926144487842265363.249m), // 13 + 15
- new TestResult(0, -400453059665371817095.63920761m), // 13 + 16
- new TestResult(0, -400428596376633096427.13423562m), // 13 + 17
- new TestResult(2, -5323659606896051284093748.3357m), // 13 + 18
- new TestResult(2, 102800665746746169353277196.86m), // 13 + 19
- new TestResult(0, -400453059658290075211.9554158m), // 13 + 20
- new TestResult(0, -400453059249619122032.55770206m), // 13 + 21
- new TestResult(0, -400453066054763885864.97101189m), // 13 + 22
- new TestResult(0, -400452617319088653057.27510289m), // 13 + 23
- new TestResult(0, -400453572499152263296.22495289m), // 13 + 24
- new TestResult(0, -399844119084680480268.18965477m), // 13 + 25
- new TestResult(2, -42935506372985358362087.372532m), // 13 + 26
- new TestResult(2, -8208727582257324503458.215976m), // 13 + 27
- new TestResult(2, 1037807226351213371958663499.4m), // 13 + 28
- new TestResult(0, -400453059670368518938.78339695m), // 13 + 29
- new TestResult(0, 222851627785191714190050.61676m), // 14 + 0
- new TestResult(0, 222851627785191714190051.61676m), // 14 + 1
- new TestResult(0, 222851627785191714190049.61676m), // 14 + 2
- new TestResult(0, 222851627785191714190052.61676m), // 14 + 3
- new TestResult(0, 222851627785191714190060.61676m), // 14 + 4
- new TestResult(0, 222851627785191714190050.71676m), // 14 + 5
- new TestResult(1, 0m), // 14 + 6
- new TestResult(2, -79227939662636552401829760284m), // 14 + 7
- new TestResult(2, 27926154094877152323521930.149m), // 14 + 8
- new TestResult(0, 222851627785191710986195.66076m), // 14 + 9
- new TestResult(0, 174384757341002840393630.58789m), // 14 + 10
- new TestResult(0, 222851082591498471385256.31345m), // 14 + 11
- new TestResult(0, 222851627785191714190051.37968m), // 14 + 12
- new TestResult(0, 222451174725526342794078.28202m), // 14 + 13
- new TestResult(0, 445703255570383428380101.23352m), // 14 + 14
- new TestResult(2, 14468895006989344927851386.201m), // 14 + 15
- new TestResult(0, 222851627785191713768927.3123m), // 14 + 16
- new TestResult(0, 222851652248480452489595.81727m), // 14 + 17
- new TestResult(2, -5100407526051194198507725.3842m), // 14 + 18
- new TestResult(2, 103023917827591026438863219.81m), // 14 + 19
- new TestResult(0, 222851627785198795510810.99609m), // 14 + 20
- new TestResult(0, 222851627785607466463990.3938m), // 14 + 21
- new TestResult(0, 222851627778802321700157.98049m), // 14 + 22
- new TestResult(0, 222851628227537996932965.6764m), // 14 + 23
- new TestResult(0, 222851627272357933322726.72655m), // 14 + 24
- new TestResult(0, 222852236725772405105754.76185m), // 14 + 25
- new TestResult(0, 180316574471871727223935.57897m), // 14 + 26
- new TestResult(0, 215043353262599761082564.73553m), // 14 + 27
- new TestResult(2, 1038030478432058229044249522.3m), // 14 + 28
- new TestResult(0, 222851627785186717067084.16811m), // 14 + 29
- new TestResult(0, 14246043379204153213661335.584m), // 15 + 0
- new TestResult(0, 14246043379204153213661336.584m), // 15 + 1
- new TestResult(0, 14246043379204153213661334.584m), // 15 + 2
- new TestResult(0, 14246043379204153213661337.584m), // 15 + 3
- new TestResult(0, 14246043379204153213661345.584m), // 15 + 4
- new TestResult(0, 14246043379204153213661335.684m), // 15 + 5
- new TestResult(1, 0m), // 15 + 6
- new TestResult(2, -79213916470885133440330288999m), // 15 + 7
- new TestResult(0, 41949345846296113822993215.116m), // 15 + 8
- new TestResult(0, 14246043379204153210457480.628m), // 15 + 9
- new TestResult(0, 14197576508759964339864915.555m), // 15 + 10
- new TestResult(0, 14246042834010459970856541.281m), // 15 + 11
- new TestResult(0, 14246043379204153213661336.347m), // 15 + 12
- new TestResult(0, 14245642926144487842265363.249m), // 15 + 13
- new TestResult(0, 14468895006989344927851386.201m), // 15 + 14
- new TestResult(0, 28492086758408306427322671.168m), // 15 + 15
- new TestResult(0, 14246043379204153213240212.28m), // 15 + 16
- new TestResult(0, 14246043403667441951960880.785m), // 15 + 17
- new TestResult(0, 8922784225367767300963559.583m), // 15 + 18
- new TestResult(2, 117047109579009987938334504.77m), // 15 + 19
- new TestResult(0, 14246043379204160294982095.963m), // 15 + 20
- new TestResult(0, 14246043379204568965935275.361m), // 15 + 21
- new TestResult(0, 14246043379197763821171442.948m), // 15 + 22
- new TestResult(0, 14246043379646499496404250.644m), // 15 + 23
- new TestResult(0, 14246043378691319432794011.694m), // 15 + 24
- new TestResult(0, 14246043988144733904577039.729m), // 15 + 25
- new TestResult(0, 14203508325890833226695220.546m), // 15 + 26
- new TestResult(0, 14238235104681561260553849.703m), // 15 + 27
- new TestResult(2, 1052053670183477190543720807.3m), // 15 + 28
- new TestResult(0, 14246043379204148216538369.135m), // 15 + 29
- new TestResult(0, -421123.30446308691436596648186m), // 16 + 0
- new TestResult(0, -421122.30446308691436596648186m), // 16 + 1
- new TestResult(0, -421124.30446308691436596648186m), // 16 + 2
- new TestResult(0, -421121.30446308691436596648186m), // 16 + 3
- new TestResult(0, -421113.30446308691436596648186m), // 16 + 4
- new TestResult(0, -421123.20446308691436596648186m), // 16 + 5
- new TestResult(2, 79228162514264337593543529212m), // 16 + 6
- new TestResult(1, 0m), // 16 + 7
- new TestResult(2, 27703302467091960608910756.228m), // 16 + 8
- new TestResult(2, -3624978.2604599050636173049837m), // 16 + 9
- new TestResult(2, -48466870444188874217543.333331m), // 16 + 10
- new TestResult(2, -545193693243225917.60777683367m), // 16 + 11
- new TestResult(0, -421122.54153968158049178549261m), // 16 + 12
- new TestResult(2, -400453059665371817095.63920761m), // 16 + 13
- new TestResult(2, 222851627785191713768927.3123m), // 16 + 14
- new TestResult(2, 14246043379204153213240212.28m), // 16 + 15
- new TestResult(2, -842246.6089261738287319329637m), // 16 + 16
- new TestResult(2, 24463288737878421.896045811728m), // 16 + 17
- new TestResult(2, -5323259153836385913118899.3055m), // 16 + 18
- new TestResult(2, 102801066199805834724252045.89m), // 16 + 19
- new TestResult(2, 7080899637.0748656305557268303m), // 16 + 20
- new TestResult(2, 415751852816.47257936965400444m), // 16 + 21
- new TestResult(2, -6389392911015.9407304539964122m), // 16 + 22
- new TestResult(2, 442346282321791.75517854615373m), // 16 + 23
- new TestResult(2, -512833781288447.19467146135201m), // 16 + 24
- new TestResult(2, 608940580690494580.84062666449m), // 16 + 25
- new TestResult(2, -42535053313319987387238.34225m), // 16 + 26
- new TestResult(2, -7808274522591953528609.1856942m), // 16 + 27
- new TestResult(2, 1037807626804273037329638348.4m), // 16 + 28
- new TestResult(2, -4997544089.7531155126859290085m), // 16 + 29
- new TestResult(0, 24463288738299545.200508898642m), // 17 + 0
- new TestResult(0, 24463288738299546.200508898642m), // 17 + 1
- new TestResult(0, 24463288738299544.200508898642m), // 17 + 2
- new TestResult(0, 24463288738299547.200508898642m), // 17 + 3
- new TestResult(0, 24463288738299555.200508898642m), // 17 + 4
- new TestResult(0, 24463288738299545.300508898642m), // 17 + 5
- new TestResult(1, 0m), // 17 + 6
- new TestResult(2, -79228162514239874304805650790m), // 17 + 7
- new TestResult(2, 27703302491555249347631424.733m), // 17 + 8
- new TestResult(0, 24463288735095690.244512080493m), // 17 + 9
- new TestResult(2, -48466845980900135496874.828359m), // 17 + 10
- new TestResult(2, -520730404504505249.10280484812m), // 17 + 11
- new TestResult(0, 24463288738299545.963432303976m), // 17 + 12
- new TestResult(2, -400428596376633096427.13423562m), // 17 + 13
- new TestResult(2, 222851652248480452489595.81727m), // 17 + 14
- new TestResult(2, 14246043403667441951960880.785m), // 17 + 15
- new TestResult(0, 24463288737878421.896045811728m), // 17 + 16
- new TestResult(0, 48926577476599090.401017797284m), // 17 + 17
- new TestResult(2, -5323259129373097174398230.8005m), // 17 + 18
- new TestResult(2, 102801066224269123462972714.39m), // 17 + 19
- new TestResult(0, 24463295819620305.579837616112m), // 17 + 20
- new TestResult(0, 24463704490573484.97755135521m), // 17 + 21
- new TestResult(0, 24456899345809652.56424153156m), // 17 + 22
- new TestResult(0, 24905635021042460.26015053171m), // 17 + 23
- new TestResult(0, 23950454957432221.310300524204m), // 17 + 24
- new TestResult(2, 633403869429215249.34559865004m), // 17 + 25
- new TestResult(2, -42535028850031248666569.837278m), // 17 + 26
- new TestResult(2, -7808250059303214807940.6807222m), // 17 + 27
- new TestResult(2, 1037807626828736326068359016.9m), // 17 + 28
- new TestResult(0, 24463283741176578.75185647287m), // 17 + 29
- new TestResult(0, -5323259153836385912697776.001m), // 18 + 0
- new TestResult(0, -5323259153836385912697775.001m), // 18 + 1
- new TestResult(0, -5323259153836385912697777.001m), // 18 + 2
- new TestResult(0, -5323259153836385912697774.001m), // 18 + 3
- new TestResult(0, -5323259153836385912697766.001m), // 18 + 4
- new TestResult(0, -5323259153836385912697775.901m), // 18 + 5
- new TestResult(2, 79222839255110501207631252559m), // 18 + 6
- new TestResult(1, 0m), // 18 + 7
- new TestResult(0, 22380043313255574696634103.531m), // 18 + 8
- new TestResult(0, -5323259153836385915901630.957m), // 18 + 9
- new TestResult(0, -5371726024280574786494196.0299m), // 18 + 10
- new TestResult(0, -5323259699030079155502570.3043m), // 18 + 11
- new TestResult(0, -5323259153836385912697775.2381m), // 18 + 12
- new TestResult(0, -5323659606896051284093748.3357m), // 18 + 13
- new TestResult(0, -5100407526051194198507725.3842m), // 18 + 14
- new TestResult(0, 8922784225367767300963559.583m), // 18 + 15
- new TestResult(0, -5323259153836385913118899.3055m), // 18 + 16
- new TestResult(0, -5323259129373097174398230.8005m), // 18 + 17
- new TestResult(0, -10646518307672771825395552.002m), // 18 + 18
- new TestResult(2, 97477807045969448811975393.19m), // 18 + 19
- new TestResult(0, -5323259153836378831377015.6217m), // 18 + 20
- new TestResult(0, -5323259153835970160423836.224m), // 18 + 21
- new TestResult(0, -5323259153842775305187668.6373m), // 18 + 22
- new TestResult(0, -5323259153394039629954860.9414m), // 18 + 23
- new TestResult(0, -5323259154349219693565099.8912m), // 18 + 24
- new TestResult(0, -5323258544895805221782071.8559m), // 18 + 25
- new TestResult(0, -5365794207149705899663891.0388m), // 18 + 26
- new TestResult(0, -5331067428358977865805261.8822m), // 18 + 27
- new TestResult(2, 1032484367650436651417361695.7m), // 18 + 28
- new TestResult(0, -5323259153836390909820742.4497m), // 18 + 29
- new TestResult(0, 102801066199805834724673169.19m), // 19 + 0
- new TestResult(0, 102801066199805834724673170.19m), // 19 + 1
- new TestResult(0, 102801066199805834724673168.19m), // 19 + 2
- new TestResult(0, 102801066199805834724673171.19m), // 19 + 3
- new TestResult(0, 102801066199805834724673179.19m), // 19 + 4
- new TestResult(0, 102801066199805834724673169.29m), // 19 + 5
- new TestResult(1, 0m), // 19 + 6
- new TestResult(2, -79125361448064531758819277166m), // 19 + 7
- new TestResult(0, 130504368666897795334005048.72m), // 19 + 8
- new TestResult(0, 102801066199805834721469314.23m), // 19 + 9
- new TestResult(0, 102752599329361645850876749.16m), // 19 + 10
- new TestResult(0, 102801065654612141481868374.89m), // 19 + 11
- new TestResult(0, 102801066199805834724673169.95m), // 19 + 12
- new TestResult(0, 102800665746746169353277196.86m), // 19 + 13
- new TestResult(0, 103023917827591026438863219.81m), // 19 + 14
- new TestResult(0, 117047109579009987938334504.77m), // 19 + 15
- new TestResult(0, 102801066199805834724252045.89m), // 19 + 16
- new TestResult(0, 102801066224269123462972714.39m), // 19 + 17
- new TestResult(0, 97477807045969448811975393.19m), // 19 + 18
- new TestResult(0, 205602132399611669449346338.38m), // 19 + 19
- new TestResult(0, 102801066199805841805993929.57m), // 19 + 20
- new TestResult(0, 102801066199806250476947108.97m), // 19 + 21
- new TestResult(0, 102801066199799445332183276.55m), // 19 + 22
- new TestResult(0, 102801066200248181007416084.25m), // 19 + 23
- new TestResult(0, 102801066199293000943805845.3m), // 19 + 24
- new TestResult(0, 102801066808746415415588873.34m), // 19 + 25
- new TestResult(0, 102758531146492514737707054.15m), // 19 + 26
- new TestResult(0, 102793257925283242771565683.31m), // 19 + 27
- new TestResult(2, 1140608693004078872054732640.9m), // 19 + 28
- new TestResult(0, 102801066199805829727550202.74m), // 19 + 29
- new TestResult(0, 7081320760.3793287174700927968m), // 20 + 0
- new TestResult(0, 7081320761.3793287174700927968m), // 20 + 1
- new TestResult(0, 7081320759.3793287174700927968m), // 20 + 2
- new TestResult(0, 7081320762.3793287174700927968m), // 20 + 3
- new TestResult(0, 7081320770.3793287174700927968m), // 20 + 4
- new TestResult(0, 7081320760.4793287174700927968m), // 20 + 5
- new TestResult(1, 0m), // 20 + 6
- new TestResult(2, -79228162514264337586462629575m), // 20 + 7
- new TestResult(2, 27703302467091967690652639.911m), // 20 + 8
- new TestResult(0, 7078116905.4233318993208414583m), // 20 + 9
- new TestResult(2, -48466870444181792475659.649539m), // 20 + 10
- new TestResult(2, -545193686161484033.92398502929m), // 20 + 11
- new TestResult(0, 7081320761.1422521228039669778m), // 20 + 12
- new TestResult(2, -400453059658290075211.9554158m), // 20 + 13
- new TestResult(2, 222851627785198795510810.99609m), // 20 + 14
- new TestResult(2, 14246043379204160294982095.963m), // 20 + 15
- new TestResult(0, 7080899637.0748656305557268303m), // 20 + 16
- new TestResult(2, 24463295819620305.579837616112m), // 20 + 17
- new TestResult(2, -5323259153836378831377015.6217m), // 20 + 18
- new TestResult(2, 102801066199805841805993929.57m), // 20 + 19
- new TestResult(2, 14162641520.758657434940185594m), // 20 + 20
- new TestResult(2, 422833594700.15637117403846321m), // 20 + 21
- new TestResult(2, -6382311169132.2569386496119534m), // 20 + 22
- new TestResult(2, 442353364063675.43897035053819m), // 20 + 23
- new TestResult(2, -512826699546563.51087965696755m), // 20 + 24
- new TestResult(2, 608940587772236464.52441846887m), // 20 + 25
- new TestResult(2, -42535053313312905645354.658458m), // 20 + 26
- new TestResult(2, -7808274522584871786725.5019024m), // 20 + 27
- new TestResult(2, 1037807626804273044411380232.1m), // 20 + 28
- new TestResult(0, 2084197793.9306762916985297548m), // 20 + 29
- new TestResult(0, 415752273939.77704245656837041m), // 21 + 0
- new TestResult(0, 415752273940.77704245656837041m), // 21 + 1
- new TestResult(0, 415752273938.77704245656837041m), // 21 + 2
- new TestResult(0, 415752273941.77704245656837041m), // 21 + 3
- new TestResult(0, 415752273949.77704245656837041m), // 21 + 4
- new TestResult(0, 415752273939.87704245656837041m), // 21 + 5
- new TestResult(1, 0m), // 21 + 6
- new TestResult(2, -79228162514264337177791676395m), // 21 + 7
- new TestResult(2, 27703302467092376361605819.309m), // 21 + 8
- new TestResult(0, 415749070084.82104563841911907m), // 21 + 9
- new TestResult(2, -48466870443773121522480.251826m), // 21 + 10
- new TestResult(2, -545193277490530854.52627129019m), // 21 + 11
- new TestResult(0, 415752273940.53996586190224459m), // 21 + 12
- new TestResult(2, -400453059249619122032.55770206m), // 21 + 13
- new TestResult(2, 222851627785607466463990.3938m), // 21 + 14
- new TestResult(2, 14246043379204568965935275.361m), // 21 + 15
- new TestResult(0, 415751852816.47257936965400444m), // 21 + 16
- new TestResult(2, 24463704490573484.97755135521m), // 21 + 17
- new TestResult(2, -5323259153835970160423836.224m), // 21 + 18
- new TestResult(2, 102801066199806250476947108.97m), // 21 + 19
- new TestResult(0, 422833594700.15637117403846321m), // 21 + 20
- new TestResult(2, 831504547879.5540849131367408m), // 21 + 21
- new TestResult(2, -5973640215952.8592249105136758m), // 21 + 22
- new TestResult(2, 442762035016854.83668408963647m), // 21 + 23
- new TestResult(2, -512418028593384.11316591786927m), // 21 + 24
- new TestResult(2, 608940996443189643.92213220797m), // 21 + 25
- new TestResult(2, -42535053312904234692175.260745m), // 21 + 26
- new TestResult(2, -7808274522176200833546.1041886m), // 21 + 27
- new TestResult(2, 1037807626804273453082333411.5m), // 21 + 28
- new TestResult(0, 410755150973.32839003079680737m), // 21 + 29
- new TestResult(0, -6389392489892.6362673670820462m), // 22 + 0
- new TestResult(0, -6389392489891.6362673670820462m), // 22 + 1
- new TestResult(0, -6389392489893.6362673670820462m), // 22 + 2
- new TestResult(0, -6389392489890.6362673670820462m), // 22 + 3
- new TestResult(0, -6389392489882.6362673670820462m), // 22 + 4
- new TestResult(0, -6389392489892.5362673670820462m), // 22 + 5
- new TestResult(2, 79228162514264331204151460442m), // 22 + 6
- new TestResult(1, 0m), // 22 + 7
- new TestResult(2, 27703302467085571216841986.896m), // 22 + 8
- new TestResult(0, -6389395693747.5922641852312975m), // 22 + 9
- new TestResult(2, -48466870450578266286312.665135m), // 22 + 10
- new TestResult(2, -545200082635294686.93958111384m), // 22 + 11
- new TestResult(0, -6389392489891.873343961748172m), // 22 + 12
- new TestResult(2, -400453066054763885864.97101189m), // 22 + 13
- new TestResult(2, 222851627778802321700157.98049m), // 22 + 14
- new TestResult(2, 14246043379197763821171442.948m), // 22 + 15
- new TestResult(0, -6389392911015.9407304539964122m), // 22 + 16
- new TestResult(2, 24456899345809652.56424153156m), // 22 + 17
- new TestResult(2, -5323259153842775305187668.6373m), // 22 + 18
- new TestResult(2, 102801066199799445332183276.55m), // 22 + 19
- new TestResult(0, -6382311169132.2569386496119534m), // 22 + 20
- new TestResult(0, -5973640215952.8592249105136758m), // 22 + 21
- new TestResult(2, -12778784979785.272534734164092m), // 22 + 22
- new TestResult(2, 435956890253022.42337426598605m), // 22 + 23
- new TestResult(2, -519223173357216.52647574151969m), // 22 + 24
- new TestResult(2, 608934191298425811.50882238432m), // 22 + 25
- new TestResult(2, -42535053319709379456007.674054m), // 22 + 26
- new TestResult(2, -7808274528981345597378.5174985m), // 22 + 27
- new TestResult(2, 1037807626804266647937569579.1m), // 22 + 28
- new TestResult(0, -6394389612859.0849197928536092m), // 22 + 29
- new TestResult(0, 442346282742915.0596416330681m), // 23 + 0
- new TestResult(0, 442346282742916.0596416330681m), // 23 + 1
- new TestResult(0, 442346282742914.0596416330681m), // 23 + 2
- new TestResult(0, 442346282742917.0596416330681m), // 23 + 3
- new TestResult(0, 442346282742925.0596416330681m), // 23 + 4
- new TestResult(0, 442346282742915.1596416330681m), // 23 + 5
- new TestResult(1, 0m), // 23 + 6
- new TestResult(2, -79228162514263895247261207420m), // 23 + 7
- new TestResult(2, 27703302467534306892074794.592m), // 23 + 8
- new TestResult(0, 442346279539060.10364481491885m), // 23 + 9
- new TestResult(2, -48466870001842591053504.969226m), // 23 + 10
- new TestResult(2, -544751346960061879.24367211369m), // 23 + 11
- new TestResult(0, 442346282742915.82256503840197m), // 23 + 12
- new TestResult(2, -400452617319088653057.27510289m), // 23 + 13
- new TestResult(2, 222851628227537996932965.6764m), // 23 + 14
- new TestResult(2, 14246043379646499496404250.644m), // 23 + 15
- new TestResult(0, 442346282321791.75517854615373m), // 23 + 16
- new TestResult(2, 24905635021042460.26015053171m), // 23 + 17
- new TestResult(2, -5323259153394039629954860.9414m), // 23 + 18
- new TestResult(2, 102801066200248181007416084.25m), // 23 + 19
- new TestResult(0, 442353364063675.43897035053819m), // 23 + 20
- new TestResult(0, 442762035016854.83668408963647m), // 23 + 21
- new TestResult(0, 435956890253022.42337426598605m), // 23 + 22
- new TestResult(0, 884692565485830.1192832661362m), // 23 + 23
- new TestResult(0, -70487498124408.83056674136954m), // 23 + 24
- new TestResult(2, 609382926973658619.20473138447m), // 23 + 25
- new TestResult(2, -42535052870973704223199.978145m), // 23 + 26
- new TestResult(2, -7808274080245670364570.8215895m), // 23 + 27
- new TestResult(2, 1037807626804715383612802386.8m), // 23 + 28
- new TestResult(0, 442341285619948.61098920729654m), // 23 + 29
- new TestResult(0, -512833780867323.89020837443764m), // 24 + 0
- new TestResult(0, -512833780867322.89020837443764m), // 24 + 1
- new TestResult(0, -512833780867324.89020837443764m), // 24 + 2
- new TestResult(0, -512833780867321.89020837443764m), // 24 + 3
- new TestResult(0, -512833780867313.89020837443764m), // 24 + 4
- new TestResult(0, -512833780867323.79020837443764m), // 24 + 5
- new TestResult(2, 79228162514263824759763083011m), // 24 + 6
- new TestResult(1, 0m), // 24 + 7
- new TestResult(2, 27703302466579126828464555.642m), // 24 + 8
- new TestResult(0, -512833784071178.84620519258689m), // 24 + 9
- new TestResult(2, -48466870957022654663743.919076m), // 24 + 10
- new TestResult(2, -545706527023672118.1935221212m), // 24 + 11
- new TestResult(0, -512833780867323.12728496910377m), // 24 + 12
- new TestResult(2, -400453572499152263296.22495289m), // 24 + 13
- new TestResult(2, 222851627272357933322726.72655m), // 24 + 14
- new TestResult(2, 14246043378691319432794011.694m), // 24 + 15
- new TestResult(0, -512833781288447.19467146135201m), // 24 + 16
- new TestResult(2, 23950454957432221.310300524204m), // 24 + 17
- new TestResult(2, -5323259154349219693565099.8912m), // 24 + 18
- new TestResult(2, 102801066199293000943805845.3m), // 24 + 19
- new TestResult(0, -512826699546563.51087965696755m), // 24 + 20
- new TestResult(0, -512418028593384.11316591786927m), // 24 + 21
- new TestResult(0, -519223173357216.52647574151969m), // 24 + 22
- new TestResult(0, -70487498124408.83056674136954m), // 24 + 23
- new TestResult(2, -1025667561734647.7804167488753m), // 24 + 24
- new TestResult(2, 608427746910048380.25488137696m), // 24 + 25
- new TestResult(2, -42535053826153767833438.927995m), // 24 + 26
- new TestResult(2, -7808275035425733974809.7714395m), // 24 + 27
- new TestResult(2, 1037807626803760203549192147.8m), // 24 + 28
- new TestResult(0, -512838777990290.3388608002092m), // 24 + 29
- new TestResult(0, 608940580690915704.1450897514m), // 25 + 0
- new TestResult(0, 608940580690915705.1450897514m), // 25 + 1
- new TestResult(0, 608940580690915703.1450897514m), // 25 + 2
- new TestResult(0, 608940580690915706.1450897514m), // 25 + 3
- new TestResult(0, 608940580690915714.1450897514m), // 25 + 4
- new TestResult(0, 608940580690915704.2450897514m), // 25 + 5
- new TestResult(1, 0m), // 25 + 6
- new TestResult(2, -79228162513655397012853034631m), // 25 + 7
- new TestResult(2, 27703303076032541300247583.677m), // 25 + 8
- new TestResult(0, 608940580687711849.18909293325m), // 25 + 9
- new TestResult(2, -48466261503608182880715.883778m), // 25 + 10
- new TestResult(0, 63746887448110909.84177600464m), // 25 + 11
- new TestResult(0, 608940580690915704.90801315673m), // 25 + 12
- new TestResult(2, -399844119084680480268.18965477m), // 25 + 13
- new TestResult(2, 222852236725772405105754.76185m), // 25 + 14
- new TestResult(2, 14246043988144733904577039.729m), // 25 + 15
- new TestResult(0, 608940580690494580.84062666449m), // 25 + 16
- new TestResult(0, 633403869429215249.34559865004m), // 25 + 17
- new TestResult(2, -5323258544895805221782071.8559m), // 25 + 18
- new TestResult(2, 102801066808746415415588873.34m), // 25 + 19
- new TestResult(0, 608940587772236464.52441846887m), // 25 + 20
- new TestResult(0, 608940996443189643.92213220797m), // 25 + 21
- new TestResult(0, 608934191298425811.50882238432m), // 25 + 22
- new TestResult(0, 609382926973658619.20473138447m), // 25 + 23
- new TestResult(0, 608427746910048380.25488137696m), // 25 + 24
- new TestResult(0, 1217881161381831408.2901795028m), // 25 + 25
- new TestResult(2, -42534444372739296050410.892697m), // 25 + 26
- new TestResult(2, -7807665582011262191781.7361413m), // 25 + 27
- new TestResult(2, 1037807627413213618020975175.8m), // 25 + 28
- new TestResult(0, 608940575693792737.69643732563m), // 25 + 29
- new TestResult(0, -42535053313319986966115.037787m), // 26 + 0
- new TestResult(0, -42535053313319986966114.037787m), // 26 + 1
- new TestResult(0, -42535053313319986966116.037787m), // 26 + 2
- new TestResult(0, -42535053313319986966113.037787m), // 26 + 3
- new TestResult(0, -42535053313319986966105.037787m), // 26 + 4
- new TestResult(0, -42535053313319986966114.937787m), // 26 + 5
- new TestResult(2, 79228119979211024273556984220m), // 26 + 6
- new TestResult(1, 0m), // 26 + 7
- new TestResult(2, 27660767413778640622365764.494m), // 26 + 8
- new TestResult(0, -42535053313319990169969.993784m), // 26 + 9
- new TestResult(2, -91001923757508860762535.06666m), // 26 + 10
- new TestResult(0, -42535598507013229770909.341101m), // 26 + 11
- new TestResult(0, -42535053313319986966114.274864m), // 26 + 12
- new TestResult(0, -42935506372985358362087.372532m), // 26 + 13
- new TestResult(2, 180316574471871727223935.57897m), // 26 + 14
- new TestResult(2, 14203508325890833226695220.546m), // 26 + 15
- new TestResult(0, -42535053313319987387238.34225m), // 26 + 16
- new TestResult(0, -42535028850031248666569.837278m), // 26 + 17
- new TestResult(2, -5365794207149705899663891.0388m), // 26 + 18
- new TestResult(2, 102758531146492514737707054.15m), // 26 + 19
- new TestResult(0, -42535053313312905645354.658458m), // 26 + 20
- new TestResult(0, -42535053312904234692175.260745m), // 26 + 21
- new TestResult(0, -42535053319709379456007.674054m), // 26 + 22
- new TestResult(0, -42535052870973704223199.978145m), // 26 + 23
- new TestResult(0, -42535053826153767833438.927995m), // 26 + 24
- new TestResult(0, -42534444372739296050410.892697m), // 26 + 25
- new TestResult(2, -85070106626639973932230.07557m), // 26 + 26
- new TestResult(0, -50343327835911940073600.919018m), // 26 + 27
- new TestResult(2, 1037765091750959717343093356.7m), // 26 + 28
- new TestResult(0, -42535053313324984089081.486439m), // 26 + 29
- new TestResult(0, -7808274522591953107485.8812311m), // 27 + 0
- new TestResult(0, -7808274522591953107484.8812311m), // 27 + 1
- new TestResult(0, -7808274522591953107486.8812311m), // 27 + 2
- new TestResult(0, -7808274522591953107483.8812311m), // 27 + 3
- new TestResult(0, -7808274522591953107475.8812311m), // 27 + 4
- new TestResult(0, -7808274522591953107485.7812311m), // 27 + 5
- new TestResult(2, 79228154705989815001590842849m), // 27 + 6
- new TestResult(1, 0m), // 27 + 7
- new TestResult(2, 27695494192569368656224393.651m), // 27 + 8
- new TestResult(0, -7808274522591956311340.8372279m), // 27 + 9
- new TestResult(2, -56275144966780826903905.910099m), // 27 + 10
- new TestResult(0, -7808819716285195912280.1845448m), // 27 + 11
- new TestResult(0, -7808274522591953107485.1183077m), // 27 + 12
- new TestResult(2, -8208727582257324503458.215976m), // 27 + 13
- new TestResult(2, 215043353262599761082564.73553m), // 27 + 14
- new TestResult(2, 14238235104681561260553849.703m), // 27 + 15
- new TestResult(0, -7808274522591953528609.1856942m), // 27 + 16
- new TestResult(0, -7808250059303214807940.6807222m), // 27 + 17
- new TestResult(2, -5331067428358977865805261.8822m), // 27 + 18
- new TestResult(2, 102793257925283242771565683.31m), // 27 + 19
- new TestResult(0, -7808274522584871786725.5019024m), // 27 + 20
- new TestResult(0, -7808274522176200833546.1041886m), // 27 + 21
- new TestResult(0, -7808274528981345597378.5174985m), // 27 + 22
- new TestResult(0, -7808274080245670364570.8215895m), // 27 + 23
- new TestResult(0, -7808275035425733974809.7714395m), // 27 + 24
- new TestResult(0, -7807665582011262191781.7361413m), // 27 + 25
- new TestResult(2, -50343327835911940073600.919018m), // 27 + 26
- new TestResult(2, -15616549045183906214971.762462m), // 27 + 27
- new TestResult(2, 1037799818529750445376951985.8m), // 27 + 28
- new TestResult(0, -7808274522596950230452.3298835m), // 27 + 29
- new TestResult(0, 1037807626804273037330059471.7m), // 28 + 0
- new TestResult(0, 1037807626804273037330059472.7m), // 28 + 1
- new TestResult(0, 1037807626804273037330059470.7m), // 28 + 2
- new TestResult(0, 1037807626804273037330059473.7m), // 28 + 3
- new TestResult(0, 1037807626804273037330059481.7m), // 28 + 4
- new TestResult(0, 1037807626804273037330059471.8m), // 28 + 5
- new TestResult(1, 0m), // 28 + 6
- new TestResult(2, -78190354887460064556213890863m), // 28 + 7
- new TestResult(0, 1065510929271364997939391351.2m), // 28 + 8
- new TestResult(0, 1037807626804273037326855616.7m), // 28 + 9
- new TestResult(0, 1037759159933828848456263051.7m), // 28 + 10
- new TestResult(0, 1037807626259079344087254677.4m), // 28 + 11
- new TestResult(0, 1037807626804273037330059472.5m), // 28 + 12
- new TestResult(0, 1037807226351213371958663499.4m), // 28 + 13
- new TestResult(0, 1038030478432058229044249522.3m), // 28 + 14
- new TestResult(0, 1052053670183477190543720807.3m), // 28 + 15
- new TestResult(0, 1037807626804273037329638348.4m), // 28 + 16
- new TestResult(0, 1037807626828736326068359016.9m), // 28 + 17
- new TestResult(0, 1032484367650436651417361695.7m), // 28 + 18
- new TestResult(0, 1140608693004078872054732640.9m), // 28 + 19
- new TestResult(0, 1037807626804273044411380232.1m), // 28 + 20
- new TestResult(0, 1037807626804273453082333411.5m), // 28 + 21
- new TestResult(0, 1037807626804266647937569579.1m), // 28 + 22
- new TestResult(0, 1037807626804715383612802386.8m), // 28 + 23
- new TestResult(0, 1037807626803760203549192147.8m), // 28 + 24
- new TestResult(0, 1037807627413213618020975175.8m), // 28 + 25
- new TestResult(0, 1037765091750959717343093356.7m), // 28 + 26
- new TestResult(0, 1037799818529750445376951985.8m), // 28 + 27
- new TestResult(0, 2075615253608546074660118943.4m), // 28 + 28
- new TestResult(0, 1037807626804273032332936505.3m), // 28 + 29
- new TestResult(0, -4997122966.448652425771563042m), // 29 + 0
- new TestResult(0, -4997122965.448652425771563042m), // 29 + 1
- new TestResult(0, -4997122967.448652425771563042m), // 29 + 2
- new TestResult(0, -4997122964.448652425771563042m), // 29 + 3
- new TestResult(0, -4997122956.448652425771563042m), // 29 + 4
- new TestResult(0, -4997122966.348652425771563042m), // 29 + 5
- new TestResult(2, 79228162514264337588546827369m), // 29 + 6
- new TestResult(1, 0m), // 29 + 7
- new TestResult(2, 27703302467091955612208913.083m), // 29 + 8
- new TestResult(0, -5000326821.4046492439208143805m), // 29 + 9
- new TestResult(2, -48466870444193870919386.47752m), // 29 + 10
- new TestResult(2, -545193698239927760.75196617253m), // 29 + 11
- new TestResult(0, -4997122965.685729020437688861m), // 29 + 12
- new TestResult(2, -400453059670368518938.78339695m), // 29 + 13
- new TestResult(2, 222851627785186717067084.16811m), // 29 + 14
- new TestResult(2, 14246043379204148216538369.135m), // 29 + 15
- new TestResult(0, -4997544089.7531155126859290085m), // 29 + 16
- new TestResult(2, 24463283741176578.75185647287m), // 29 + 17
- new TestResult(2, -5323259153836390909820742.4497m), // 29 + 18
- new TestResult(2, 102801066199805829727550202.74m), // 29 + 19
- new TestResult(0, 2084197793.9306762916985297548m), // 29 + 20
- new TestResult(2, 410755150973.32839003079680737m), // 29 + 21
- new TestResult(2, -6394389612859.0849197928536092m), // 29 + 22
- new TestResult(2, 442341285619948.61098920729654m), // 29 + 23
- new TestResult(2, -512838777990290.3388608002092m), // 29 + 24
- new TestResult(2, 608940575693792737.69643732563m), // 29 + 25
- new TestResult(2, -42535053313324984089081.486439m), // 29 + 26
- new TestResult(2, -7808274522596950230452.3298835m), // 29 + 27
- new TestResult(2, 1037807626804273032332936505.3m), // 29 + 28
- new TestResult(0, -9994245932.897304851543126084m), // 29 + 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Mult_build2 = new TestResult[] {
- new TestResult(0, 0m), // 0 * 0
- new TestResult(0, 0m), // 0 * 1
- new TestResult(0, 0m), // 0 * 2
- new TestResult(0, 0m), // 0 * 3
- new TestResult(0, 0m), // 0 * 4
- new TestResult(0, 0m), // 0 * 5
- new TestResult(0, 0m), // 0 * 6
- new TestResult(0, 0m), // 0 * 7
- new TestResult(0, 0m), // 0 * 8
- new TestResult(0, 0m), // 0 * 9
- new TestResult(0, 0m), // 0 * 10
- new TestResult(0, 0m), // 0 * 11
- new TestResult(0, 0m), // 0 * 12
- new TestResult(0, 0m), // 0 * 13
- new TestResult(0, 0m), // 0 * 14
- new TestResult(0, 0m), // 0 * 15
- new TestResult(0, 0m), // 0 * 16
- new TestResult(0, 0m), // 0 * 17
- new TestResult(0, 0m), // 0 * 18
- new TestResult(0, 0m), // 0 * 19
- new TestResult(0, 0m), // 0 * 20
- new TestResult(0, 0m), // 0 * 21
- new TestResult(0, 0m), // 0 * 22
- new TestResult(0, 0m), // 0 * 23
- new TestResult(0, 0m), // 0 * 24
- new TestResult(0, 0m), // 0 * 25
- new TestResult(0, 0m), // 0 * 26
- new TestResult(0, 0m), // 0 * 27
- new TestResult(0, 0m), // 0 * 28
- new TestResult(0, 0m), // 0 * 29
- new TestResult(0, 0m), // 1 * 0
- new TestResult(0, 1m), // 1 * 1
- new TestResult(0, -1m), // 1 * 2
- new TestResult(0, 2m), // 1 * 3
- new TestResult(0, 10m), // 1 * 4
- new TestResult(0, 0.1m), // 1 * 5
- new TestResult(0, 79228162514264337593543950335m), // 1 * 6
- new TestResult(0, -79228162514264337593543950335m), // 1 * 7
- new TestResult(0, 27703302467091960609331879.532m), // 1 * 8
- new TestResult(0, -3203854.9559968181492513385018m), // 1 * 9
- new TestResult(0, -48466870444188873796420.028868m), // 1 * 10
- new TestResult(0, -545193693242804794.30331374676m), // 1 * 11
- new TestResult(0, 0.7629234053338741809892531431m), // 1 * 12
- new TestResult(0, -400453059665371395972.33474452m), // 1 * 13
- new TestResult(0, 222851627785191714190050.61676m), // 1 * 14
- new TestResult(0, 14246043379204153213661335.584m), // 1 * 15
- new TestResult(0, -421123.30446308691436596648186m), // 1 * 16
- new TestResult(0, 24463288738299545.200508898642m), // 1 * 17
- new TestResult(0, -5323259153836385912697776.001m), // 1 * 18
- new TestResult(0, 102801066199805834724673169.19m), // 1 * 19
- new TestResult(0, 7081320760.3793287174700927968m), // 1 * 20
- new TestResult(0, 415752273939.77704245656837041m), // 1 * 21
- new TestResult(0, -6389392489892.6362673670820462m), // 1 * 22
- new TestResult(0, 442346282742915.0596416330681m), // 1 * 23
- new TestResult(0, -512833780867323.89020837443764m), // 1 * 24
- new TestResult(0, 608940580690915704.1450897514m), // 1 * 25
- new TestResult(0, -42535053313319986966115.037787m), // 1 * 26
- new TestResult(0, -7808274522591953107485.8812311m), // 1 * 27
- new TestResult(0, 1037807626804273037330059471.7m), // 1 * 28
- new TestResult(0, -4997122966.448652425771563042m), // 1 * 29
- new TestResult(0, 0m), // 2 * 0
- new TestResult(0, -1m), // 2 * 1
- new TestResult(0, 1m), // 2 * 2
- new TestResult(0, -2m), // 2 * 3
- new TestResult(0, -10m), // 2 * 4
- new TestResult(0, -0.1m), // 2 * 5
- new TestResult(0, -79228162514264337593543950335m), // 2 * 6
- new TestResult(0, 79228162514264337593543950335m), // 2 * 7
- new TestResult(0, -27703302467091960609331879.532m), // 2 * 8
- new TestResult(0, 3203854.9559968181492513385018m), // 2 * 9
- new TestResult(0, 48466870444188873796420.028868m), // 2 * 10
- new TestResult(0, 545193693242804794.30331374676m), // 2 * 11
- new TestResult(0, -0.7629234053338741809892531431m), // 2 * 12
- new TestResult(0, 400453059665371395972.33474452m), // 2 * 13
- new TestResult(0, -222851627785191714190050.61676m), // 2 * 14
- new TestResult(0, -14246043379204153213661335.584m), // 2 * 15
- new TestResult(0, 421123.30446308691436596648186m), // 2 * 16
- new TestResult(0, -24463288738299545.200508898642m), // 2 * 17
- new TestResult(0, 5323259153836385912697776.001m), // 2 * 18
- new TestResult(0, -102801066199805834724673169.19m), // 2 * 19
- new TestResult(0, -7081320760.3793287174700927968m), // 2 * 20
- new TestResult(0, -415752273939.77704245656837041m), // 2 * 21
- new TestResult(0, 6389392489892.6362673670820462m), // 2 * 22
- new TestResult(0, -442346282742915.0596416330681m), // 2 * 23
- new TestResult(0, 512833780867323.89020837443764m), // 2 * 24
- new TestResult(0, -608940580690915704.1450897514m), // 2 * 25
- new TestResult(0, 42535053313319986966115.037787m), // 2 * 26
- new TestResult(0, 7808274522591953107485.8812311m), // 2 * 27
- new TestResult(0, -1037807626804273037330059471.7m), // 2 * 28
- new TestResult(0, 4997122966.448652425771563042m), // 2 * 29
- new TestResult(0, 0m), // 3 * 0
- new TestResult(0, 2m), // 3 * 1
- new TestResult(0, -2m), // 3 * 2
- new TestResult(0, 4m), // 3 * 3
- new TestResult(0, 20m), // 3 * 4
- new TestResult(0, 0.2m), // 3 * 5
- new TestResult(1, 0m), // 3 * 6
- new TestResult(1, 0m), // 3 * 7
- new TestResult(0, 55406604934183921218663759.064m), // 3 * 8
- new TestResult(0, -6407709.9119936362985026770036m), // 3 * 9
- new TestResult(2, -96933740888377747592840.05774m), // 3 * 10
- new TestResult(0, -1090387386485609588.6066274935m), // 3 * 11
- new TestResult(0, 1.5258468106677483619785062862m), // 3 * 12
- new TestResult(2, -800906119330742791944.669489m), // 3 * 13
- new TestResult(0, 445703255570383428380101.23352m), // 3 * 14
- new TestResult(0, 28492086758408306427322671.168m), // 3 * 15
- new TestResult(0, -842246.6089261738287319329637m), // 3 * 16
- new TestResult(0, 48926577476599090.401017797284m), // 3 * 17
- new TestResult(0, -10646518307672771825395552.002m), // 3 * 18
- new TestResult(0, 205602132399611669449346338.38m), // 3 * 19
- new TestResult(2, 14162641520.758657434940185594m), // 3 * 20
- new TestResult(0, 831504547879.5540849131367408m), // 3 * 21
- new TestResult(2, -12778784979785.272534734164092m), // 3 * 22
- new TestResult(0, 884692565485830.1192832661362m), // 3 * 23
- new TestResult(0, -1025667561734647.7804167488753m), // 3 * 24
- new TestResult(0, 1217881161381831408.2901795028m), // 3 * 25
- new TestResult(2, -85070106626639973932230.07557m), // 3 * 26
- new TestResult(0, -15616549045183906214971.762462m), // 3 * 27
- new TestResult(0, 2075615253608546074660118943.4m), // 3 * 28
- new TestResult(0, -9994245932.897304851543126084m), // 3 * 29
- new TestResult(0, 0m), // 4 * 0
- new TestResult(0, 10m), // 4 * 1
- new TestResult(0, -10m), // 4 * 2
- new TestResult(0, 20m), // 4 * 3
- new TestResult(0, 100m), // 4 * 4
- new TestResult(0, 1m), // 4 * 5
- new TestResult(1, 0m), // 4 * 6
- new TestResult(1, 0m), // 4 * 7
- new TestResult(0, 277033024670919606093318795.32m), // 4 * 8
- new TestResult(0, -32038549.559968181492513385018m), // 4 * 9
- new TestResult(0, -484668704441888737964200.28868m), // 4 * 10
- new TestResult(0, -5451936932428047943.0331374676m), // 4 * 11
- new TestResult(0, 7.629234053338741809892531431m), // 4 * 12
- new TestResult(0, -4004530596653713959723.3474452m), // 4 * 13
- new TestResult(0, 2228516277851917141900506.1676m), // 4 * 14
- new TestResult(0, 142460433792041532136613355.84m), // 4 * 15
- new TestResult(0, -4211233.0446308691436596648186m), // 4 * 16
- new TestResult(0, 244632887382995452.00508898642m), // 4 * 17
- new TestResult(0, -53232591538363859126977760.01m), // 4 * 18
- new TestResult(0, 1028010661998058347246731691.9m), // 4 * 19
- new TestResult(0, 70813207603.793287174700927968m), // 4 * 20
- new TestResult(0, 4157522739397.7704245656837041m), // 4 * 21
- new TestResult(0, -63893924898926.362673670820462m), // 4 * 22
- new TestResult(0, 4423462827429150.596416330681m), // 4 * 23
- new TestResult(0, -5128337808673238.9020837443764m), // 4 * 24
- new TestResult(0, 6089405806909157041.450897514m), // 4 * 25
- new TestResult(0, -425350533133199869661150.37787m), // 4 * 26
- new TestResult(0, -78082745225919531074858.812311m), // 4 * 27
- new TestResult(0, 10378076268042730373300594717m), // 4 * 28
- new TestResult(0, -49971229664.48652425771563042m), // 4 * 29
- new TestResult(0, 0m), // 5 * 0
- new TestResult(0, 0.1m), // 5 * 1
- new TestResult(0, -0.1m), // 5 * 2
- new TestResult(0, 0.2m), // 5 * 3
- new TestResult(0, 1m), // 5 * 4
- new TestResult(0, 0.01m), // 5 * 5
- new TestResult(0, 7922816251426433759354395033.5m), // 5 * 6
- new TestResult(0, -7922816251426433759354395033.5m), // 5 * 7
- new TestResult(0, 2770330246709196060933187.9532m), // 5 * 8
- new TestResult(0, -320385.49559968181492513385018m), // 5 * 9
- new TestResult(0, -4846687044418887379642.0028868m), // 5 * 10
- new TestResult(0, -54519369324280479.430331374676m), // 5 * 11
- new TestResult(0, 0.0762923405333874180989253143m), // 5 * 12
- new TestResult(0, -40045305966537139597.233474452m), // 5 * 13
- new TestResult(0, 22285162778519171419005.061676m), // 5 * 14
- new TestResult(0, 1424604337920415321366133.5584m), // 5 * 15
- new TestResult(0, -42112.330446308691436596648186m), // 5 * 16
- new TestResult(0, 2446328873829954.5200508898642m), // 5 * 17
- new TestResult(0, -532325915383638591269777.6001m), // 5 * 18
- new TestResult(0, 10280106619980583472467316.919m), // 5 * 19
- new TestResult(0, 708132076.03793287174700927968m), // 5 * 20
- new TestResult(0, 41575227393.977704245656837041m), // 5 * 21
- new TestResult(0, -638939248989.26362673670820462m), // 5 * 22
- new TestResult(0, 44234628274291.50596416330681m), // 5 * 23
- new TestResult(0, -51283378086732.389020837443764m), // 5 * 24
- new TestResult(0, 60894058069091570.41450897514m), // 5 * 25
- new TestResult(0, -4253505331331998696611.5037787m), // 5 * 26
- new TestResult(0, -780827452259195310748.58812311m), // 5 * 27
- new TestResult(0, 103780762680427303733005947.17m), // 5 * 28
- new TestResult(0, -499712296.6448652425771563042m), // 5 * 29
- new TestResult(0, 0m), // 6 * 0
- new TestResult(0, 79228162514264337593543950335m), // 6 * 1
- new TestResult(0, -79228162514264337593543950335m), // 6 * 2
- new TestResult(1, 0m), // 6 * 3
- new TestResult(1, 0m), // 6 * 4
- new TestResult(0, 7922816251426433759354395033.5m), // 6 * 5
- new TestResult(1, 0m), // 6 * 6
- new TestResult(1, 0m), // 6 * 7
- new TestResult(1, 0m), // 6 * 8
- new TestResult(1, 0m), // 6 * 9
- new TestResult(1, 0m), // 6 * 10
- new TestResult(1, 0m), // 6 * 11
- new TestResult(4, 60445019543728147377669509413m), // 6 * 12
- new TestResult(1, 0m), // 6 * 13
- new TestResult(1, 0m), // 6 * 14
- new TestResult(1, 0m), // 6 * 15
- new TestResult(1, 0m), // 6 * 16
- new TestResult(1, 0m), // 6 * 17
- new TestResult(1, 0m), // 6 * 18
- new TestResult(1, 0m), // 6 * 19
- new TestResult(1, 0m), // 6 * 20
- new TestResult(1, 0m), // 6 * 21
- new TestResult(1, 0m), // 6 * 22
- new TestResult(1, 0m), // 6 * 23
- new TestResult(1, 0m), // 6 * 24
- new TestResult(1, 0m), // 6 * 25
- new TestResult(1, 0m), // 6 * 26
- new TestResult(1, 0m), // 6 * 27
- new TestResult(1, 0m), // 6 * 28
- new TestResult(1, 0m), // 6 * 29
- new TestResult(0, 0m), // 7 * 0
- new TestResult(0, -79228162514264337593543950335m), // 7 * 1
- new TestResult(0, 79228162514264337593543950335m), // 7 * 2
- new TestResult(1, 0m), // 7 * 3
- new TestResult(1, 0m), // 7 * 4
- new TestResult(0, -7922816251426433759354395033.5m), // 7 * 5
- new TestResult(1, 0m), // 7 * 6
- new TestResult(1, 0m), // 7 * 7
- new TestResult(1, 0m), // 7 * 8
- new TestResult(1, 0m), // 7 * 9
- new TestResult(1, 0m), // 7 * 10
- new TestResult(1, 0m), // 7 * 11
- new TestResult(4, -60445019543728147377669509413m), // 7 * 12
- new TestResult(1, 0m), // 7 * 13
- new TestResult(1, 0m), // 7 * 14
- new TestResult(1, 0m), // 7 * 15
- new TestResult(1, 0m), // 7 * 16
- new TestResult(1, 0m), // 7 * 17
- new TestResult(1, 0m), // 7 * 18
- new TestResult(1, 0m), // 7 * 19
- new TestResult(1, 0m), // 7 * 20
- new TestResult(1, 0m), // 7 * 21
- new TestResult(1, 0m), // 7 * 22
- new TestResult(1, 0m), // 7 * 23
- new TestResult(1, 0m), // 7 * 24
- new TestResult(1, 0m), // 7 * 25
- new TestResult(1, 0m), // 7 * 26
- new TestResult(1, 0m), // 7 * 27
- new TestResult(1, 0m), // 7 * 28
- new TestResult(1, 0m), // 7 * 29
- new TestResult(0, 0m), // 8 * 0
- new TestResult(0, 27703302467091960609331879.532m), // 8 * 1
- new TestResult(0, -27703302467091960609331879.532m), // 8 * 2
- new TestResult(0, 55406604934183921218663759.064m), // 8 * 3
- new TestResult(0, 277033024670919606093318795.32m), // 8 * 4
- new TestResult(0, 2770330246709196060933187.9532m), // 8 * 5
- new TestResult(1, 0m), // 8 * 6
- new TestResult(1, 0m), // 8 * 7
- new TestResult(1, 0m), // 8 * 8
- new TestResult(1, 0m), // 8 * 9
- new TestResult(1, 0m), // 8 * 10
- new TestResult(1, 0m), // 8 * 11
- new TestResult(2, 21135497857188116458095236.68m), // 8 * 12
- new TestResult(1, 0m), // 8 * 13
- new TestResult(1, 0m), // 8 * 14
- new TestResult(1, 0m), // 8 * 15
- new TestResult(1, 0m), // 8 * 16
- new TestResult(1, 0m), // 8 * 17
- new TestResult(1, 0m), // 8 * 18
- new TestResult(1, 0m), // 8 * 19
- new TestResult(1, 0m), // 8 * 20
- new TestResult(1, 0m), // 8 * 21
- new TestResult(1, 0m), // 8 * 22
- new TestResult(1, 0m), // 8 * 23
- new TestResult(1, 0m), // 8 * 24
- new TestResult(1, 0m), // 8 * 25
- new TestResult(1, 0m), // 8 * 26
- new TestResult(1, 0m), // 8 * 27
- new TestResult(1, 0m), // 8 * 28
- new TestResult(1, 0m), // 8 * 29
- new TestResult(0, 0m), // 9 * 0
- new TestResult(0, -3203854.9559968181492513385018m), // 9 * 1
- new TestResult(0, 3203854.9559968181492513385018m), // 9 * 2
- new TestResult(0, -6407709.9119936362985026770036m), // 9 * 3
- new TestResult(0, -32038549.559968181492513385018m), // 9 * 4
- new TestResult(0, -320385.49559968181492513385018m), // 9 * 5
- new TestResult(1, 0m), // 9 * 6
- new TestResult(1, 0m), // 9 * 7
- new TestResult(1, 0m), // 9 * 8
- new TestResult(2, 10264686579065.373559419307221m), // 9 * 9
- new TestResult(1, 0m), // 9 * 10
- new TestResult(2, 1746721516074169126608222.1692m), // 9 * 11
- new TestResult(2, -2444295.933224902121034426698m), // 9 * 12
- new TestResult(2, 1282993519852989666698903060.5m), // 9 * 13
- new TestResult(1, 0m), // 9 * 14
- new TestResult(1, 0m), // 9 * 15
- new TestResult(0, 1349217986089.8179781485646335m), // 9 * 16
- new TestResult(0, -78376828864182146369609.767831m), // 9 * 17
- new TestResult(1, 0m), // 9 * 18
- new TestResult(1, 0m), // 9 * 19
- new TestResult(0, -22687524613144469.045656755412m), // 9 * 20
- new TestResult(0, -1332009983328901461.3254059884m), // 9 * 21
- new TestResult(0, 20470686794551372519.831909846m), // 9 * 22
- new TestResult(0, -1417213330232658207868.9685141m), // 9 * 23
- new TestResult(0, 1643045050434361863551.7087135m), // 9 * 24
- new TestResult(0, -1950957297354170624860913.7855m), // 9 * 25
- new TestResult(1, 0m), // 9 * 26
- new TestResult(0, 25016579026989918165002777574m), // 9 * 27
- new TestResult(1, 0m), // 9 * 28
- new TestResult(2, 16010057181782036.694377696165m), // 9 * 29
- new TestResult(0, 0m), // 10 * 0
- new TestResult(0, -48466870444188873796420.028868m), // 10 * 1
- new TestResult(0, 48466870444188873796420.028868m), // 10 * 2
- new TestResult(2, -96933740888377747592840.05774m), // 10 * 3
- new TestResult(0, -484668704441888737964200.28868m), // 10 * 4
- new TestResult(0, -4846687044418887379642.0028868m), // 10 * 5
- new TestResult(1, 0m), // 10 * 6
- new TestResult(1, 0m), // 10 * 7
- new TestResult(1, 0m), // 10 * 8
- new TestResult(1, 0m), // 10 * 9
- new TestResult(1, 0m), // 10 * 10
- new TestResult(1, 0m), // 10 * 11
- new TestResult(0, -36976509845156274734545.845161m), // 10 * 12
- new TestResult(1, 0m), // 10 * 13
- new TestResult(1, 0m), // 10 * 14
- new TestResult(1, 0m), // 10 * 15
- new TestResult(2, 20410528638441139616161910791m), // 10 * 16
- new TestResult(1, 0m), // 10 * 17
- new TestResult(1, 0m), // 10 * 18
- new TestResult(1, 0m), // 10 * 19
- new TestResult(1, 0m), // 10 * 20
- new TestResult(1, 0m), // 10 * 21
- new TestResult(1, 0m), // 10 * 22
- new TestResult(1, 0m), // 10 * 23
- new TestResult(1, 0m), // 10 * 24
- new TestResult(1, 0m), // 10 * 25
- new TestResult(1, 0m), // 10 * 26
- new TestResult(1, 0m), // 10 * 27
- new TestResult(1, 0m), // 10 * 28
- new TestResult(1, 0m), // 10 * 29
- new TestResult(0, 0m), // 11 * 0
- new TestResult(0, -545193693242804794.30331374676m), // 11 * 1
- new TestResult(0, 545193693242804794.30331374676m), // 11 * 2
- new TestResult(2, -1090387386485609588.6066274935m), // 11 * 3
- new TestResult(0, -5451936932428047943.0331374676m), // 11 * 4
- new TestResult(0, -54519369324280479.430331374676m), // 11 * 5
- new TestResult(1, 0m), // 11 * 6
- new TestResult(1, 0m), // 11 * 7
- new TestResult(1, 0m), // 11 * 8
- new TestResult(2, 1746721516074169126608222.1692m), // 11 * 9
- new TestResult(1, 0m), // 11 * 10
- new TestResult(1, 0m), // 11 * 11
- new TestResult(0, -415941029015352223.2321562927m), // 11 * 12
- new TestResult(1, 0m), // 11 * 13
- new TestResult(1, 0m), // 11 * 14
- new TestResult(1, 0m), // 11 * 15
- new TestResult(0, 229593769670844494339647.60593m), // 11 * 16
- new TestResult(1, 0m), // 11 * 17
- new TestResult(1, 0m), // 11 * 18
- new TestResult(1, 0m), // 11 * 19
- new TestResult(0, -3860691418388152934958161711.9m), // 11 * 20
- new TestResult(1, 0m), // 11 * 21
- new TestResult(1, 0m), // 11 * 22
- new TestResult(1, 0m), // 11 * 23
- new TestResult(1, 0m), // 11 * 24
- new TestResult(1, 0m), // 11 * 25
- new TestResult(1, 0m), // 11 * 26
- new TestResult(1, 0m), // 11 * 27
- new TestResult(1, 0m), // 11 * 28
- new TestResult(2, 2724399925666581324856736883m), // 11 * 29
- new TestResult(0, 0m), // 12 * 0
- new TestResult(0, 0.7629234053338741809892531431m), // 12 * 1
- new TestResult(0, -0.7629234053338741809892531431m), // 12 * 2
- new TestResult(0, 1.5258468106677483619785062862m), // 12 * 3
- new TestResult(0, 7.629234053338741809892531431m), // 12 * 4
- new TestResult(2, 0.0762923405333874180989253143m), // 12 * 5
- new TestResult(0, 60445019543728147377669509413m), // 12 * 6
- new TestResult(0, -60445019543728147377669509413m), // 12 * 7
- new TestResult(0, 21135497857188116458095236.68m), // 12 * 8
- new TestResult(0, -2444295.933224902121034426698m), // 12 * 9
- new TestResult(0, -36976509845156274734545.845161m), // 12 * 10
- new TestResult(0, -415941029015352223.2321562927m), // 12 * 11
- new TestResult(0, 0.5820521224062348791152865214m), // 12 * 12
- new TestResult(0, -305515011956274243325.23330625m), // 12 * 13
- new TestResult(0, 170018722754075475876563.00661m), // 12 * 14
- new TestResult(0, 10868639927396524825477357.557m), // 12 * 15
- new TestResult(0, -321284.82550643216389212760083m), // 12 * 16
- new TestResult(0, 18663615549889303.426127037208m), // 12 * 17
- new TestResult(0, -4061239001119573143590088.0528m), // 12 * 18
- new TestResult(0, 78429339497108899549297058.831m), // 12 * 19
- new TestResult(0, 5402505348.7700567259404098662m), // 12 * 20
- new TestResult(0, 317187140609.43641612785737895m), // 12 * 21
- new TestResult(0, -4874617076403.5713301079734445m), // 12 * 22
- new TestResult(0, 337476332367005.49979200414696m), // 12 * 23
- new TestResult(0, -391252894469544.55412631906773m), // 12 * 24
- new TestResult(0, 464575021466700199.22364418475m), // 12 * 25
- new TestResult(0, -32450987719855972399063.033158m), // 12 * 26
- new TestResult(0, -5957115388557583551533.0994303m), // 12 * 27
- new TestResult(0, 791767728722982425613218218.59m), // 12 * 28
- new TestResult(0, -3812422070.43511700405678157m), // 12 * 29
- new TestResult(0, 0m), // 13 * 0
- new TestResult(0, -400453059665371395972.33474452m), // 13 * 1
- new TestResult(0, 400453059665371395972.33474452m), // 13 * 2
- new TestResult(2, -800906119330742791944.669489m), // 13 * 3
- new TestResult(0, -4004530596653713959723.3474452m), // 13 * 4
- new TestResult(0, -40045305966537139597.233474452m), // 13 * 5
- new TestResult(1, 0m), // 13 * 6
- new TestResult(1, 0m), // 13 * 7
- new TestResult(1, 0m), // 13 * 8
- new TestResult(2, 1282993519852989666698903060.5m), // 13 * 9
- new TestResult(1, 0m), // 13 * 10
- new TestResult(1, 0m), // 13 * 11
- new TestResult(0, -305515011956274243325.23330625m), // 13 * 12
- new TestResult(1, 0m), // 13 * 13
- new TestResult(1, 0m), // 13 * 14
- new TestResult(1, 0m), // 13 * 15
- new TestResult(2, 168640115768634908407809010.03m), // 13 * 16
- new TestResult(1, 0m), // 13 * 17
- new TestResult(1, 0m), // 13 * 18
- new TestResult(1, 0m), // 13 * 19
- new TestResult(1, 0m), // 13 * 20
- new TestResult(1, 0m), // 13 * 21
- new TestResult(1, 0m), // 13 * 22
- new TestResult(1, 0m), // 13 * 23
- new TestResult(1, 0m), // 13 * 24
- new TestResult(1, 0m), // 13 * 25
- new TestResult(1, 0m), // 13 * 26
- new TestResult(1, 0m), // 13 * 27
- new TestResult(1, 0m), // 13 * 28
- new TestResult(1, 0m), // 13 * 29
- new TestResult(0, 0m), // 14 * 0
- new TestResult(0, 222851627785191714190050.61676m), // 14 * 1
- new TestResult(0, -222851627785191714190050.61676m), // 14 * 2
- new TestResult(0, 445703255570383428380101.23352m), // 14 * 3
- new TestResult(0, 2228516277851917141900506.1676m), // 14 * 4
- new TestResult(0, 22285162778519171419005.061676m), // 14 * 5
- new TestResult(1, 0m), // 14 * 6
- new TestResult(1, 0m), // 14 * 7
- new TestResult(1, 0m), // 14 * 8
- new TestResult(1, 0m), // 14 * 9
- new TestResult(1, 0m), // 14 * 10
- new TestResult(1, 0m), // 14 * 11
- new TestResult(0, 170018722754075475876563.00661m), // 14 * 12
- new TestResult(1, 0m), // 14 * 13
- new TestResult(1, 0m), // 14 * 14
- new TestResult(1, 0m), // 14 * 15
- new TestResult(1, 0m), // 14 * 16
- new TestResult(1, 0m), // 14 * 17
- new TestResult(1, 0m), // 14 * 18
- new TestResult(1, 0m), // 14 * 19
- new TestResult(1, 0m), // 14 * 20
- new TestResult(1, 0m), // 14 * 21
- new TestResult(1, 0m), // 14 * 22
- new TestResult(1, 0m), // 14 * 23
- new TestResult(1, 0m), // 14 * 24
- new TestResult(1, 0m), // 14 * 25
- new TestResult(1, 0m), // 14 * 26
- new TestResult(1, 0m), // 14 * 27
- new TestResult(1, 0m), // 14 * 28
- new TestResult(1, 0m), // 14 * 29
- new TestResult(0, 0m), // 15 * 0
- new TestResult(0, 14246043379204153213661335.584m), // 15 * 1
- new TestResult(0, -14246043379204153213661335.584m), // 15 * 2
- new TestResult(0, 28492086758408306427322671.168m), // 15 * 3
- new TestResult(0, 142460433792041532136613355.84m), // 15 * 4
- new TestResult(0, 1424604337920415321366133.5584m), // 15 * 5
- new TestResult(1, 0m), // 15 * 6
- new TestResult(1, 0m), // 15 * 7
- new TestResult(1, 0m), // 15 * 8
- new TestResult(1, 0m), // 15 * 9
- new TestResult(1, 0m), // 15 * 10
- new TestResult(1, 0m), // 15 * 11
- new TestResult(0, 10868639927396524825477357.557m), // 15 * 12
- new TestResult(1, 0m), // 15 * 13
- new TestResult(1, 0m), // 15 * 14
- new TestResult(1, 0m), // 15 * 15
- new TestResult(1, 0m), // 15 * 16
- new TestResult(1, 0m), // 15 * 17
- new TestResult(1, 0m), // 15 * 18
- new TestResult(1, 0m), // 15 * 19
- new TestResult(1, 0m), // 15 * 20
- new TestResult(1, 0m), // 15 * 21
- new TestResult(1, 0m), // 15 * 22
- new TestResult(1, 0m), // 15 * 23
- new TestResult(1, 0m), // 15 * 24
- new TestResult(1, 0m), // 15 * 25
- new TestResult(1, 0m), // 15 * 26
- new TestResult(1, 0m), // 15 * 27
- new TestResult(1, 0m), // 15 * 28
- new TestResult(1, 0m), // 15 * 29
- new TestResult(0, 0m), // 16 * 0
- new TestResult(0, -421123.30446308691436596648186m), // 16 * 1
- new TestResult(0, 421123.30446308691436596648186m), // 16 * 2
- new TestResult(2, -842246.6089261738287319329637m), // 16 * 3
- new TestResult(0, -4211233.0446308691436596648186m), // 16 * 4
- new TestResult(0, -42112.330446308691436596648186m), // 16 * 5
- new TestResult(1, 0m), // 16 * 6
- new TestResult(1, 0m), // 16 * 7
- new TestResult(1, 0m), // 16 * 8
- new TestResult(0, 1349217986089.8179781485646335m), // 16 * 9
- new TestResult(2, 20410528638441139616161910791m), // 16 * 10
- new TestResult(0, 229593769670844494339647.60593m), // 16 * 11
- new TestResult(0, -321284.82550643216389212760083m), // 16 * 12
- new TestResult(2, 168640115768634908407809010.03m), // 16 * 13
- new TestResult(1, 0m), // 16 * 14
- new TestResult(1, 0m), // 16 * 15
- new TestResult(2, 177344837561.90979904837123025m), // 16 * 16
- new TestResult(2, -10302060991507324713598.483586m), // 16 * 17
- new TestResult(1, 0m), // 16 * 18
- new TestResult(1, 0m), // 16 * 19
- new TestResult(2, -2982109198574002.1833628108505m), // 16 * 20
- new TestResult(2, -175082971439561442.82206371811m), // 16 * 21
- new TestResult(2, 2690722078855217643.0013135833m), // 16 * 22
- new TestResult(2, -186282328305659347664.31347679m), // 16 * 23
- new TestResult(2, 215966256439146035447.16512997m), // 16 * 24
- new TestResult(0, -256439069562229438659442.67473m), // 16 * 25
- new TestResult(2, 17912502206818886711664532432m), // 16 * 26
- new TestResult(0, 3288246369108855691627019039.6m), // 16 * 27
- new TestResult(1, 0m), // 16 * 28
- new TestResult(2, 2104404936439239.9111285468803m), // 16 * 29
- new TestResult(0, 0m), // 17 * 0
- new TestResult(0, 24463288738299545.200508898642m), // 17 * 1
- new TestResult(0, -24463288738299545.200508898642m), // 17 * 2
- new TestResult(0, 48926577476599090.401017797284m), // 17 * 3
- new TestResult(0, 244632887382995452.00508898642m), // 17 * 4
- new TestResult(0, 2446328873829954.5200508898642m), // 17 * 5
- new TestResult(1, 0m), // 17 * 6
- new TestResult(1, 0m), // 17 * 7
- new TestResult(1, 0m), // 17 * 8
- new TestResult(0, -78376828864182146369609.767831m), // 17 * 9
- new TestResult(1, 0m), // 17 * 10
- new TestResult(1, 0m), // 17 * 11
- new TestResult(0, 18663615549889303.426127037208m), // 17 * 12
- new TestResult(1, 0m), // 17 * 13
- new TestResult(1, 0m), // 17 * 14
- new TestResult(1, 0m), // 17 * 15
- new TestResult(2, -10302060991507324713598.483586m), // 17 * 16
- new TestResult(1, 0m), // 17 * 17
- new TestResult(1, 0m), // 17 * 18
- new TestResult(1, 0m), // 17 * 19
- new TestResult(0, 173232394409674404469121757.58m), // 17 * 20
- new TestResult(2, 10170667920993375211218037940m), // 17 * 21
- new TestResult(1, 0m), // 17 * 22
- new TestResult(1, 0m), // 17 * 23
- new TestResult(1, 0m), // 17 * 24
- new TestResult(1, 0m), // 17 * 25
- new TestResult(1, 0m), // 17 * 26
- new TestResult(1, 0m), // 17 * 27
- new TestResult(1, 0m), // 17 * 28
- new TestResult(0, -122246061989021334943606343.1m), // 17 * 29
- new TestResult(0, 0m), // 18 * 0
- new TestResult(0, -5323259153836385912697776.001m), // 18 * 1
- new TestResult(0, 5323259153836385912697776.001m), // 18 * 2
- new TestResult(0, -10646518307672771825395552.002m), // 18 * 3
- new TestResult(0, -53232591538363859126977760.01m), // 18 * 4
- new TestResult(0, -532325915383638591269777.6001m), // 18 * 5
- new TestResult(1, 0m), // 18 * 6
- new TestResult(1, 0m), // 18 * 7
- new TestResult(1, 0m), // 18 * 8
- new TestResult(1, 0m), // 18 * 9
- new TestResult(1, 0m), // 18 * 10
- new TestResult(1, 0m), // 18 * 11
- new TestResult(2, -4061239001119573143590088.0528m), // 18 * 12
- new TestResult(1, 0m), // 18 * 13
- new TestResult(1, 0m), // 18 * 14
- new TestResult(1, 0m), // 18 * 15
- new TestResult(1, 0m), // 18 * 16
- new TestResult(1, 0m), // 18 * 17
- new TestResult(1, 0m), // 18 * 18
- new TestResult(1, 0m), // 18 * 19
- new TestResult(1, 0m), // 18 * 20
- new TestResult(1, 0m), // 18 * 21
- new TestResult(1, 0m), // 18 * 22
- new TestResult(1, 0m), // 18 * 23
- new TestResult(1, 0m), // 18 * 24
- new TestResult(1, 0m), // 18 * 25
- new TestResult(1, 0m), // 18 * 26
- new TestResult(1, 0m), // 18 * 27
- new TestResult(1, 0m), // 18 * 28
- new TestResult(1, 0m), // 18 * 29
- new TestResult(0, 0m), // 19 * 0
- new TestResult(0, 102801066199805834724673169.19m), // 19 * 1
- new TestResult(0, -102801066199805834724673169.19m), // 19 * 2
- new TestResult(0, 205602132399611669449346338.38m), // 19 * 3
- new TestResult(0, 1028010661998058347246731691.9m), // 19 * 4
- new TestResult(0, 10280106619980583472467316.919m), // 19 * 5
- new TestResult(1, 0m), // 19 * 6
- new TestResult(1, 0m), // 19 * 7
- new TestResult(1, 0m), // 19 * 8
- new TestResult(1, 0m), // 19 * 9
- new TestResult(1, 0m), // 19 * 10
- new TestResult(1, 0m), // 19 * 11
- new TestResult(0, 78429339497108899549297058.831m), // 19 * 12
- new TestResult(1, 0m), // 19 * 13
- new TestResult(1, 0m), // 19 * 14
- new TestResult(1, 0m), // 19 * 15
- new TestResult(1, 0m), // 19 * 16
- new TestResult(1, 0m), // 19 * 17
- new TestResult(1, 0m), // 19 * 18
- new TestResult(1, 0m), // 19 * 19
- new TestResult(1, 0m), // 19 * 20
- new TestResult(1, 0m), // 19 * 21
- new TestResult(1, 0m), // 19 * 22
- new TestResult(1, 0m), // 19 * 23
- new TestResult(1, 0m), // 19 * 24
- new TestResult(1, 0m), // 19 * 25
- new TestResult(1, 0m), // 19 * 26
- new TestResult(1, 0m), // 19 * 27
- new TestResult(1, 0m), // 19 * 28
- new TestResult(1, 0m), // 19 * 29
- new TestResult(0, 0m), // 20 * 0
- new TestResult(0, 7081320760.3793287174700927968m), // 20 * 1
- new TestResult(0, -7081320760.3793287174700927968m), // 20 * 2
- new TestResult(2, 14162641520.758657434940185594m), // 20 * 3
- new TestResult(0, 70813207603.793287174700927968m), // 20 * 4
- new TestResult(0, 708132076.03793287174700927968m), // 20 * 5
- new TestResult(1, 0m), // 20 * 6
- new TestResult(1, 0m), // 20 * 7
- new TestResult(1, 0m), // 20 * 8
- new TestResult(0, -22687524613144469.045656755412m), // 20 * 9
- new TestResult(1, 0m), // 20 * 10
- new TestResult(0, -3860691418388152934958161711.9m), // 20 * 11
- new TestResult(0, 5402505348.7700567259404098662m), // 20 * 12
- new TestResult(1, 0m), // 20 * 13
- new TestResult(1, 0m), // 20 * 14
- new TestResult(1, 0m), // 20 * 15
- new TestResult(2, -2982109198574002.1833628108505m), // 20 * 16
- new TestResult(2, 173232394409674404469121757.58m), // 20 * 17
- new TestResult(1, 0m), // 20 * 18
- new TestResult(1, 0m), // 20 * 19
- new TestResult(0, 50145103711379274243.914175878m), // 20 * 20
- new TestResult(2, 2944075208624656937377.9493098m), // 20 * 21
- new TestResult(0, -45245337684888495429839.445203m), // 20 * 22
- new TestResult(2, 3132395915264028802867467.4171m), // 20 * 23
- new TestResult(2, -3631540499079604049748263.216m), // 20 * 24
- new TestResult(0, 4312103575884025168661620716.9m), // 20 * 25
- new TestResult(1, 0m), // 20 * 26
- new TestResult(1, 0m), // 20 * 27
- new TestResult(1, 0m), // 20 * 28
- new TestResult(2, -35386230604481178142.543841269m), // 20 * 29
- new TestResult(0, 0m), // 21 * 0
- new TestResult(0, 415752273939.77704245656837041m), // 21 * 1
- new TestResult(0, -415752273939.77704245656837041m), // 21 * 2
- new TestResult(2, 831504547879.5540849131367408m), // 21 * 3
- new TestResult(0, 4157522739397.7704245656837041m), // 21 * 4
- new TestResult(0, 41575227393.977704245656837041m), // 21 * 5
- new TestResult(1, 0m), // 21 * 6
- new TestResult(1, 0m), // 21 * 7
- new TestResult(1, 0m), // 21 * 8
- new TestResult(2, -1332009983328901461.3254059884m), // 21 * 9
- new TestResult(1, 0m), // 21 * 10
- new TestResult(1, 0m), // 21 * 11
- new TestResult(0, 317187140609.43641612785737895m), // 21 * 12
- new TestResult(1, 0m), // 21 * 13
- new TestResult(1, 0m), // 21 * 14
- new TestResult(1, 0m), // 21 * 15
- new TestResult(2, -175082971439561442.82206371811m), // 21 * 16
- new TestResult(2, 10170667920993375211218037940m), // 21 * 17
- new TestResult(1, 0m), // 21 * 18
- new TestResult(1, 0m), // 21 * 19
- new TestResult(2, 2944075208624656937377.9493098m), // 21 * 20
- new TestResult(2, 172849953286095412912252.49708m), // 21 * 21
- new TestResult(2, -2656404456766597431365611.212m), // 21 * 22
- new TestResult(0, 183906472919174492029733196.17m), // 21 * 23
- new TestResult(0, -213211810548723232636647639.7m), // 21 * 24
- new TestResult(1, 0m), // 21 * 25
- new TestResult(1, 0m), // 21 * 26
- new TestResult(1, 0m), // 21 * 27
- new TestResult(1, 0m), // 21 * 28
- new TestResult(0, -2077565236457711426002.3992246m), // 21 * 29
- new TestResult(0, 0m), // 22 * 0
- new TestResult(0, -6389392489892.6362673670820462m), // 22 * 1
- new TestResult(0, 6389392489892.6362673670820462m), // 22 * 2
- new TestResult(2, -12778784979785.272534734164092m), // 22 * 3
- new TestResult(0, -63893924898926.362673670820462m), // 22 * 4
- new TestResult(0, -638939248989.26362673670820462m), // 22 * 5
- new TestResult(1, 0m), // 22 * 6
- new TestResult(1, 0m), // 22 * 7
- new TestResult(1, 0m), // 22 * 8
- new TestResult(2, 20470686794551372519.831909846m), // 22 * 9
- new TestResult(1, 0m), // 22 * 10
- new TestResult(1, 0m), // 22 * 11
- new TestResult(0, -4874617076403.5713301079734445m), // 22 * 12
- new TestResult(1, 0m), // 22 * 13
- new TestResult(1, 0m), // 22 * 14
- new TestResult(1, 0m), // 22 * 15
- new TestResult(2, 2690722078855217643.0013135833m), // 22 * 16
- new TestResult(1, 0m), // 22 * 17
- new TestResult(1, 0m), // 22 * 18
- new TestResult(1, 0m), // 22 * 19
- new TestResult(0, -45245337684888495429839.445203m), // 22 * 20
- new TestResult(2, -2656404456766597431365611.212m), // 22 * 21
- new TestResult(2, 40824336389896422046045259.169m), // 22 * 22
- new TestResult(2, -2826324016889506134750576955.1m), // 22 * 23
- new TestResult(2, 3276696308036925201560804370m), // 22 * 24
- new TestResult(1, 0m), // 22 * 25
- new TestResult(1, 0m), // 22 * 26
- new TestResult(1, 0m), // 22 * 27
- new TestResult(1, 0m), // 22 * 28
- new TestResult(2, 31928579952897032005741.500403m), // 22 * 29
- new TestResult(0, 0m), // 23 * 0
- new TestResult(0, 442346282742915.0596416330681m), // 23 * 1
- new TestResult(0, -442346282742915.0596416330681m), // 23 * 2
- new TestResult(0, 884692565485830.1192832661362m), // 23 * 3
- new TestResult(0, 4423462827429150.596416330681m), // 23 * 4
- new TestResult(0, 44234628274291.50596416330681m), // 23 * 5
- new TestResult(1, 0m), // 23 * 6
- new TestResult(1, 0m), // 23 * 7
- new TestResult(1, 0m), // 23 * 8
- new TestResult(2, -1417213330232658207868.9685141m), // 23 * 9
- new TestResult(1, 0m), // 23 * 10
- new TestResult(1, 0m), // 23 * 11
- new TestResult(2, 337476332367005.49979200414696m), // 23 * 12
- new TestResult(1, 0m), // 23 * 13
- new TestResult(1, 0m), // 23 * 14
- new TestResult(1, 0m), // 23 * 15
- new TestResult(2, -186282328305659347664.31347679m), // 23 * 16
- new TestResult(1, 0m), // 23 * 17
- new TestResult(1, 0m), // 23 * 18
- new TestResult(1, 0m), // 23 * 19
- new TestResult(2, 3132395915264028802867467.4171m), // 23 * 20
- new TestResult(0, 183906472919174492029733196.17m), // 23 * 21
- new TestResult(2, -2826324016889506134750576955.1m), // 23 * 22
- new TestResult(1, 0m), // 23 * 23
- new TestResult(1, 0m), // 23 * 24
- new TestResult(1, 0m), // 23 * 25
- new TestResult(1, 0m), // 23 * 26
- new TestResult(1, 0m), // 23 * 27
- new TestResult(1, 0m), // 23 * 28
- new TestResult(2, -2210458768617810051106106.871m), // 23 * 29
- new TestResult(0, 0m), // 24 * 0
- new TestResult(0, -512833780867323.89020837443764m), // 24 * 1
- new TestResult(0, 512833780867323.89020837443764m), // 24 * 2
- new TestResult(2, -1025667561734647.7804167488753m), // 24 * 3
- new TestResult(0, -5128337808673238.9020837443764m), // 24 * 4
- new TestResult(0, -51283378086732.389020837443764m), // 24 * 5
- new TestResult(1, 0m), // 24 * 6
- new TestResult(1, 0m), // 24 * 7
- new TestResult(1, 0m), // 24 * 8
- new TestResult(0, 1643045050434361863551.7087135m), // 24 * 9
- new TestResult(1, 0m), // 24 * 10
- new TestResult(1, 0m), // 24 * 11
- new TestResult(0, -391252894469544.55412631906773m), // 24 * 12
- new TestResult(1, 0m), // 24 * 13
- new TestResult(1, 0m), // 24 * 14
- new TestResult(1, 0m), // 24 * 15
- new TestResult(2, 215966256439146035447.16512997m), // 24 * 16
- new TestResult(1, 0m), // 24 * 17
- new TestResult(1, 0m), // 24 * 18
- new TestResult(1, 0m), // 24 * 19
- new TestResult(2, -3631540499079604049748263.216m), // 24 * 20
- new TestResult(0, -213211810548723232636647639.7m), // 24 * 21
- new TestResult(2, 3276696308036925201560804370m), // 24 * 22
- new TestResult(1, 0m), // 24 * 23
- new TestResult(1, 0m), // 24 * 24
- new TestResult(1, 0m), // 24 * 25
- new TestResult(1, 0m), // 24 * 26
- new TestResult(1, 0m), // 24 * 27
- new TestResult(1, 0m), // 24 * 28
- new TestResult(2, 2562693464342799730524457.4865m), // 24 * 29
- new TestResult(0, 0m), // 25 * 0
- new TestResult(0, 608940580690915704.1450897514m), // 25 * 1
- new TestResult(0, -608940580690915704.1450897514m), // 25 * 2
- new TestResult(0, 1217881161381831408.2901795028m), // 25 * 3
- new TestResult(0, 6089405806909157041.450897514m), // 25 * 4
- new TestResult(0, 60894058069091570.41450897514m), // 25 * 5
- new TestResult(1, 0m), // 25 * 6
- new TestResult(1, 0m), // 25 * 7
- new TestResult(1, 0m), // 25 * 8
- new TestResult(0, -1950957297354170624860913.7855m), // 25 * 9
- new TestResult(1, 0m), // 25 * 10
- new TestResult(1, 0m), // 25 * 11
- new TestResult(0, 464575021466700199.22364418475m), // 25 * 12
- new TestResult(1, 0m), // 25 * 13
- new TestResult(1, 0m), // 25 * 14
- new TestResult(1, 0m), // 25 * 15
- new TestResult(0, -256439069562229438659442.67473m), // 25 * 16
- new TestResult(1, 0m), // 25 * 17
- new TestResult(1, 0m), // 25 * 18
- new TestResult(1, 0m), // 25 * 19
- new TestResult(0, 4312103575884025168661620716.9m), // 25 * 20
- new TestResult(1, 0m), // 25 * 21
- new TestResult(1, 0m), // 25 * 22
- new TestResult(1, 0m), // 25 * 23
- new TestResult(1, 0m), // 25 * 24
- new TestResult(1, 0m), // 25 * 25
- new TestResult(1, 0m), // 25 * 26
- new TestResult(1, 0m), // 25 * 27
- new TestResult(1, 0m), // 25 * 28
- new TestResult(0, -3042950960973153681431212945.8m), // 25 * 29
- new TestResult(0, 0m), // 26 * 0
- new TestResult(0, -42535053313319986966115.037787m), // 26 * 1
- new TestResult(0, 42535053313319986966115.037787m), // 26 * 2
- new TestResult(2, -85070106626639973932230.07557m), // 26 * 3
- new TestResult(0, -425350533133199869661150.37787m), // 26 * 4
- new TestResult(0, -4253505331331998696611.5037787m), // 26 * 5
- new TestResult(1, 0m), // 26 * 6
- new TestResult(1, 0m), // 26 * 7
- new TestResult(1, 0m), // 26 * 8
- new TestResult(1, 0m), // 26 * 9
- new TestResult(1, 0m), // 26 * 10
- new TestResult(1, 0m), // 26 * 11
- new TestResult(0, -32450987719855972399063.033158m), // 26 * 12
- new TestResult(1, 0m), // 26 * 13
- new TestResult(1, 0m), // 26 * 14
- new TestResult(1, 0m), // 26 * 15
- new TestResult(2, 17912502206818886711664532432m), // 26 * 16
- new TestResult(1, 0m), // 26 * 17
- new TestResult(1, 0m), // 26 * 18
- new TestResult(1, 0m), // 26 * 19
- new TestResult(1, 0m), // 26 * 20
- new TestResult(1, 0m), // 26 * 21
- new TestResult(1, 0m), // 26 * 22
- new TestResult(1, 0m), // 26 * 23
- new TestResult(1, 0m), // 26 * 24
- new TestResult(1, 0m), // 26 * 25
- new TestResult(1, 0m), // 26 * 26
- new TestResult(1, 0m), // 26 * 27
- new TestResult(1, 0m), // 26 * 28
- new TestResult(1, 0m), // 26 * 29
- new TestResult(0, 0m), // 27 * 0
- new TestResult(0, -7808274522591953107485.8812311m), // 27 * 1
- new TestResult(0, 7808274522591953107485.8812311m), // 27 * 2
- new TestResult(2, -15616549045183906214971.762462m), // 27 * 3
- new TestResult(0, -78082745225919531074858.812311m), // 27 * 4
- new TestResult(0, -780827452259195310748.58812311m), // 27 * 5
- new TestResult(1, 0m), // 27 * 6
- new TestResult(1, 0m), // 27 * 7
- new TestResult(1, 0m), // 27 * 8
- new TestResult(0, 25016579026989918165002777574m), // 27 * 9
- new TestResult(1, 0m), // 27 * 10
- new TestResult(1, 0m), // 27 * 11
- new TestResult(0, -5957115388557583551533.0994303m), // 27 * 12
- new TestResult(1, 0m), // 27 * 13
- new TestResult(1, 0m), // 27 * 14
- new TestResult(1, 0m), // 27 * 15
- new TestResult(0, 3288246369108855691627019039.6m), // 27 * 16
- new TestResult(1, 0m), // 27 * 17
- new TestResult(1, 0m), // 27 * 18
- new TestResult(1, 0m), // 27 * 19
- new TestResult(1, 0m), // 27 * 20
- new TestResult(1, 0m), // 27 * 21
- new TestResult(1, 0m), // 27 * 22
- new TestResult(1, 0m), // 27 * 23
- new TestResult(1, 0m), // 27 * 24
- new TestResult(1, 0m), // 27 * 25
- new TestResult(1, 0m), // 27 * 26
- new TestResult(1, 0m), // 27 * 27
- new TestResult(1, 0m), // 27 * 28
- new TestResult(1, 0m), // 27 * 29
- new TestResult(0, 0m), // 28 * 0
- new TestResult(0, 1037807626804273037330059471.7m), // 28 * 1
- new TestResult(0, -1037807626804273037330059471.7m), // 28 * 2
- new TestResult(0, 2075615253608546074660118943.4m), // 28 * 3
- new TestResult(0, 10378076268042730373300594717m), // 28 * 4
- new TestResult(0, 103780762680427303733005947.17m), // 28 * 5
- new TestResult(1, 0m), // 28 * 6
- new TestResult(1, 0m), // 28 * 7
- new TestResult(1, 0m), // 28 * 8
- new TestResult(1, 0m), // 28 * 9
- new TestResult(1, 0m), // 28 * 10
- new TestResult(1, 0m), // 28 * 11
- new TestResult(0, 791767728722982425613218218.59m), // 28 * 12
- new TestResult(1, 0m), // 28 * 13
- new TestResult(1, 0m), // 28 * 14
- new TestResult(1, 0m), // 28 * 15
- new TestResult(1, 0m), // 28 * 16
- new TestResult(1, 0m), // 28 * 17
- new TestResult(1, 0m), // 28 * 18
- new TestResult(1, 0m), // 28 * 19
- new TestResult(1, 0m), // 28 * 20
- new TestResult(1, 0m), // 28 * 21
- new TestResult(1, 0m), // 28 * 22
- new TestResult(1, 0m), // 28 * 23
- new TestResult(1, 0m), // 28 * 24
- new TestResult(1, 0m), // 28 * 25
- new TestResult(1, 0m), // 28 * 26
- new TestResult(1, 0m), // 28 * 27
- new TestResult(1, 0m), // 28 * 28
- new TestResult(1, 0m), // 28 * 29
- new TestResult(0, 0m), // 29 * 0
- new TestResult(0, -4997122966.448652425771563042m), // 29 * 1
- new TestResult(0, 4997122966.448652425771563042m), // 29 * 2
- new TestResult(0, -9994245932.897304851543126084m), // 29 * 3
- new TestResult(0, -49971229664.48652425771563042m), // 29 * 4
- new TestResult(0, -499712296.6448652425771563042m), // 29 * 5
- new TestResult(1, 0m), // 29 * 6
- new TestResult(1, 0m), // 29 * 7
- new TestResult(1, 0m), // 29 * 8
- new TestResult(2, 16010057181782036.694377696165m), // 29 * 9
- new TestResult(1, 0m), // 29 * 10
- new TestResult(2, 2724399925666581324856736883m), // 29 * 11
- new TestResult(2, -3812422070.43511700405678157m), // 29 * 12
- new TestResult(1, 0m), // 29 * 13
- new TestResult(1, 0m), // 29 * 14
- new TestResult(1, 0m), // 29 * 15
- new TestResult(2, 2104404936439239.9111285468803m), // 29 * 16
- new TestResult(2, -122246061989021334943606343.1m), // 29 * 17
- new TestResult(1, 0m), // 29 * 18
- new TestResult(1, 0m), // 29 * 19
- new TestResult(0, -35386230604481178142.543841269m), // 29 * 20
- new TestResult(0, -2077565236457711426002.3992246m), // 29 * 21
- new TestResult(2, 31928579952897032005741.500403m), // 29 * 22
- new TestResult(2, -2210458768617810051106106.871m), // 29 * 23
- new TestResult(2, 2562693464342799730524457.4865m), // 29 * 24
- new TestResult(0, -3042950960973153681431212945.8m), // 29 * 25
- new TestResult(1, 0m), // 29 * 26
- new TestResult(1, 0m), // 29 * 27
- new TestResult(1, 0m), // 29 * 28
- new TestResult(0, 24971237941808579837.350664893m), // 29 * 29
- };
-
-
- // generated result list build2
- TestResult[] trAuto_Div_build2 = new TestResult[] {
- new TestResult(3, 0m), // 0 / 0
- new TestResult(0, 0m), // 0 / 1
- new TestResult(0, 0m), // 0 / 2
- new TestResult(0, 0m), // 0 / 3
- new TestResult(0, 0m), // 0 / 4
- new TestResult(0, 0m), // 0 / 5
- new TestResult(0, 0m), // 0 / 6
- new TestResult(0, 0m), // 0 / 7
- new TestResult(0, 0m), // 0 / 8
- new TestResult(0, 0m), // 0 / 9
- new TestResult(0, 0m), // 0 / 10
- new TestResult(0, 0m), // 0 / 11
- new TestResult(0, 0m), // 0 / 12
- new TestResult(0, 0m), // 0 / 13
- new TestResult(0, 0m), // 0 / 14
- new TestResult(0, 0m), // 0 / 15
- new TestResult(0, 0m), // 0 / 16
- new TestResult(0, 0m), // 0 / 17
- new TestResult(0, 0m), // 0 / 18
- new TestResult(0, 0m), // 0 / 19
- new TestResult(0, 0m), // 0 / 20
- new TestResult(0, 0m), // 0 / 21
- new TestResult(0, 0m), // 0 / 22
- new TestResult(0, 0m), // 0 / 23
- new TestResult(0, 0m), // 0 / 24
- new TestResult(0, 0m), // 0 / 25
- new TestResult(0, 0m), // 0 / 26
- new TestResult(0, 0m), // 0 / 27
- new TestResult(0, 0m), // 0 / 28
- new TestResult(0, 0m), // 0 / 29
- new TestResult(3, 0m), // 1 / 0
- new TestResult(0, 1m), // 1 / 1
- new TestResult(0, -1m), // 1 / 2
- new TestResult(0, 0.5m), // 1 / 3
- new TestResult(0, 0.1m), // 1 / 4
- new TestResult(0, 10m), // 1 / 5
- new TestResult(0, 0m), // 1 / 6
- new TestResult(0, 0m), // 1 / 7
- new TestResult(2, 3.61E-26m), // 1 / 8
- new TestResult(2, -3.121239924198969049581E-07m), // 1 / 9
- new TestResult(2, -2.06327E-23m), // 1 / 10
- new TestResult(2, -1.8342105061E-18m), // 1 / 11
- new TestResult(0, 1.3107475704751451797758879069m), // 1 / 12
- new TestResult(2, -2.4971716E-21m), // 1 / 13
- new TestResult(2, 4.4873E-24m), // 1 / 14
- new TestResult(2, 7.02E-26m), // 1 / 15
- new TestResult(2, -2.3746014276625098667414E-06m), // 1 / 16
- new TestResult(2, 4.08775782642E-17m), // 1 / 17
- new TestResult(2, -1.879E-25m), // 1 / 18
- new TestResult(2, 9.7E-27m), // 1 / 19
- new TestResult(2, 1.412165941691409118E-10m), // 1 / 20
- new TestResult(2, 2.4052784859689137E-12m), // 1 / 21
- new TestResult(2, -1.565094023542766E-13m), // 1 / 22
- new TestResult(2, 2.2606723262128E-15m), // 1 / 23
- new TestResult(2, -1.9499495495573E-15m), // 1 / 24
- new TestResult(2, 1.6421963517E-18m), // 1 / 25
- new TestResult(2, -2.351E-23m), // 1 / 26
- new TestResult(2, -1.280693E-22m), // 1 / 27
- new TestResult(2, 1E-27m), // 1 / 28
- new TestResult(2, -2.00115147598754898E-10m), // 1 / 29
- new TestResult(3, 0m), // 2 / 0
- new TestResult(0, -1m), // 2 / 1
- new TestResult(0, 1m), // 2 / 2
- new TestResult(0, -0.5m), // 2 / 3
- new TestResult(0, -0.1m), // 2 / 4
- new TestResult(0, -10m), // 2 / 5
- new TestResult(0, 0m), // 2 / 6
- new TestResult(0, 0m), // 2 / 7
- new TestResult(2, -3.61E-26m), // 2 / 8
- new TestResult(2, 3.121239924198969049581E-07m), // 2 / 9
- new TestResult(2, 2.06327E-23m), // 2 / 10
- new TestResult(2, 1.8342105061E-18m), // 2 / 11
- new TestResult(0, -1.3107475704751451797758879069m), // 2 / 12
- new TestResult(2, 2.4971716E-21m), // 2 / 13
- new TestResult(2, -4.4873E-24m), // 2 / 14
- new TestResult(2, -7.02E-26m), // 2 / 15
- new TestResult(2, 2.3746014276625098667414E-06m), // 2 / 16
- new TestResult(2, -4.08775782642E-17m), // 2 / 17
- new TestResult(2, 1.879E-25m), // 2 / 18
- new TestResult(2, -9.7E-27m), // 2 / 19
- new TestResult(2, -1.412165941691409118E-10m), // 2 / 20
- new TestResult(2, -2.4052784859689137E-12m), // 2 / 21
- new TestResult(2, 1.565094023542766E-13m), // 2 / 22
- new TestResult(2, -2.2606723262128E-15m), // 2 / 23
- new TestResult(2, 1.9499495495573E-15m), // 2 / 24
- new TestResult(2, -1.6421963517E-18m), // 2 / 25
- new TestResult(2, 2.351E-23m), // 2 / 26
- new TestResult(2, 1.280693E-22m), // 2 / 27
- new TestResult(2, -1E-27m), // 2 / 28
- new TestResult(2, 2.00115147598754898E-10m), // 2 / 29
- new TestResult(3, 0m), // 3 / 0
- new TestResult(0, 2m), // 3 / 1
- new TestResult(0, -2m), // 3 / 2
- new TestResult(0, 1m), // 3 / 3
- new TestResult(0, 0.2m), // 3 / 4
- new TestResult(0, 20m), // 3 / 5
- new TestResult(0, 0m), // 3 / 6
- new TestResult(0, 0m), // 3 / 7
- new TestResult(2, 7.22E-26m), // 3 / 8
- new TestResult(2, -6.242479848397938099161E-07m), // 3 / 9
- new TestResult(2, -4.12653E-23m), // 3 / 10
- new TestResult(2, -3.6684210122E-18m), // 3 / 11
- new TestResult(0, 2.6214951409502903595517758138m), // 3 / 12
- new TestResult(2, -4.9943432E-21m), // 3 / 13
- new TestResult(2, 8.9746E-24m), // 3 / 14
- new TestResult(2, 1.404E-25m), // 3 / 15
- new TestResult(2, -4.7492028553250197334829E-06m), // 3 / 16
- new TestResult(2, 8.17551565284E-17m), // 3 / 17
- new TestResult(2, -3.757E-25m), // 3 / 18
- new TestResult(2, 1.95E-26m), // 3 / 19
- new TestResult(2, 2.824331883382818237E-10m), // 3 / 20
- new TestResult(2, 4.8105569719378275E-12m), // 3 / 21
- new TestResult(2, -3.130188047085533E-13m), // 3 / 22
- new TestResult(2, 4.5213446524256E-15m), // 3 / 23
- new TestResult(2, -3.8998990991146E-15m), // 3 / 24
- new TestResult(2, 3.2843927034E-18m), // 3 / 25
- new TestResult(2, -4.702E-23m), // 3 / 26
- new TestResult(2, -2.561385E-22m), // 3 / 27
- new TestResult(2, 1.9E-27m), // 3 / 28
- new TestResult(2, -4.002302951975097959E-10m), // 3 / 29
- new TestResult(3, 0m), // 4 / 0
- new TestResult(0, 10m), // 4 / 1
- new TestResult(0, -10m), // 4 / 2
- new TestResult(0, 5m), // 4 / 3
- new TestResult(0, 1m), // 4 / 4
- new TestResult(0, 100m), // 4 / 5
- new TestResult(2, 1E-28m), // 4 / 6
- new TestResult(2, -1E-28m), // 4 / 7
- new TestResult(2, 3.61E-25m), // 4 / 8
- new TestResult(2, -3.1212399241989690495806E-06m), // 4 / 9
- new TestResult(2, -2.063265E-22m), // 4 / 10
- new TestResult(2, -1.83421050609E-17m), // 4 / 11
- new TestResult(0, 13.107475704751451797758879069m), // 4 / 12
- new TestResult(2, -2.49717158E-20m), // 4 / 13
- new TestResult(2, 4.48729E-23m), // 4 / 14
- new TestResult(2, 7.019E-25m), // 4 / 15
- new TestResult(2, -2.37460142766250986674143E-05m), // 4 / 16
- new TestResult(2, 4.087757826422E-16m), // 4 / 17
- new TestResult(2, -1.8785E-24m), // 4 / 18
- new TestResult(2, 9.73E-26m), // 4 / 19
- new TestResult(2, 1.4121659416914091185E-09m), // 4 / 20
- new TestResult(2, 2.40527848596891375E-11m), // 4 / 21
- new TestResult(2, -1.5650940235427663E-12m), // 4 / 22
- new TestResult(2, 2.26067232621278E-14m), // 4 / 23
- new TestResult(2, -1.94994954955729E-14m), // 4 / 24
- new TestResult(2, 1.64219635168E-17m), // 4 / 25
- new TestResult(2, -2.351002E-22m), // 4 / 26
- new TestResult(2, -1.2806927E-21m), // 4 / 27
- new TestResult(2, 9.6E-27m), // 4 / 28
- new TestResult(2, -2.0011514759875489796E-09m), // 4 / 29
- new TestResult(3, 0m), // 5 / 0
- new TestResult(0, 0.1m), // 5 / 1
- new TestResult(0, -0.1m), // 5 / 2
- new TestResult(0, 0.05m), // 5 / 3
- new TestResult(0, 0.01m), // 5 / 4
- new TestResult(0, 1m), // 5 / 5
- new TestResult(0, 0m), // 5 / 6
- new TestResult(0, 0m), // 5 / 7
- new TestResult(2, 3.6E-27m), // 5 / 8
- new TestResult(2, -3.12123992419896904958E-08m), // 5 / 9
- new TestResult(2, -2.0633E-24m), // 5 / 10
- new TestResult(2, -1.834210506E-19m), // 5 / 11
- new TestResult(0, 0.1310747570475145179775887907m), // 5 / 12
- new TestResult(2, -2.497172E-22m), // 5 / 13
- new TestResult(2, 4.487E-25m), // 5 / 14
- new TestResult(2, 7E-27m), // 5 / 15
- new TestResult(2, -2.374601427662509866741E-07m), // 5 / 16
- new TestResult(2, 4.0877578264E-18m), // 5 / 17
- new TestResult(2, -1.88E-26m), // 5 / 18
- new TestResult(2, 1E-27m), // 5 / 19
- new TestResult(2, 1.41216594169140912E-11m), // 5 / 20
- new TestResult(2, 2.405278485968914E-13m), // 5 / 21
- new TestResult(2, -1.56509402354277E-14m), // 5 / 22
- new TestResult(2, 2.260672326213E-16m), // 5 / 23
- new TestResult(2, -1.949949549557E-16m), // 5 / 24
- new TestResult(2, 1.642196352E-19m), // 5 / 25
- new TestResult(2, -2.351E-24m), // 5 / 26
- new TestResult(2, -1.28069E-23m), // 5 / 27
- new TestResult(2, 1E-28m), // 5 / 28
- new TestResult(2, -2.00115147598754898E-11m), // 5 / 29
- new TestResult(3, 0m), // 6 / 0
- new TestResult(0, 79228162514264337593543950335m), // 6 / 1
- new TestResult(0, -79228162514264337593543950335m), // 6 / 2
- new TestResult(4, 39614081257132168796771975168m), // 6 / 3
- new TestResult(4, 7922816251426433759354395034m), // 6 / 4
- new TestResult(1, 0m), // 6 / 5
- new TestResult(0, 1m), // 6 / 6
- new TestResult(0, -1m), // 6 / 7
- new TestResult(2, 2859.8815108190596050496514036m), // 6 / 8
- new TestResult(2, -24729010396044602218186.765763m), // 6 / 9
- new TestResult(0, -1634686.9890330150250120997619m), // 6 / 10
- new TestResult(2, -145321128061.87519668639091926m), // 6 / 11
- new TestResult(1, 0m), // 6 / 12
- new TestResult(0, -197846315.8215581473367403789m), // 6 / 13
- new TestResult(0, 355519.78373087286985534915017m), // 6 / 14
- new TestResult(0, 5561.4152228343398478498516935m), // 6 / 15
- new TestResult(0, -188135307817449443294332.61564m), // 6 / 16
- new TestResult(4, 3238655413907.0152158135371692m), // 6 / 17
- new TestResult(0, -14883.393842880239095927799143m), // 6 / 18
- new TestResult(0, 770.69397665852204557888702506m), // 6 / 19
- new TestResult(4, 11188331272543609822.484506627m), // 6 / 20
- new TestResult(0, 190565794778408772.72439011791m), // 6 / 21
- new TestResult(4, -12399952364735014.543439368391m), // 6 / 22
- new TestResult(2, 179108914452685.79816067884477m), // 6 / 23
- new TestResult(2, -154490919806941.48506503891762m), // 6 / 24
- new TestResult(2, 130108199431.16705963085822836m), // 6 / 25
- new TestResult(2, -1862655.7707746844883926874832m), // 6 / 26
- new TestResult(2, -10146692.753313261555369747673m), // 6 / 27
- new TestResult(0, 76.341858036091015923443233609m), // 6 / 28
- new TestResult(2, -15854755435520147876.101506668m), // 6 / 29
- new TestResult(3, 0m), // 7 / 0
- new TestResult(0, -79228162514264337593543950335m), // 7 / 1
- new TestResult(0, 79228162514264337593543950335m), // 7 / 2
- new TestResult(4, -39614081257132168796771975168m), // 7 / 3
- new TestResult(4, -7922816251426433759354395034m), // 7 / 4
- new TestResult(1, 0m), // 7 / 5
- new TestResult(0, -1m), // 7 / 6
- new TestResult(0, 1m), // 7 / 7
- new TestResult(2, -2859.8815108190596050496514036m), // 7 / 8
- new TestResult(2, 24729010396044602218186.765763m), // 7 / 9
- new TestResult(0, 1634686.9890330150250120997619m), // 7 / 10
- new TestResult(2, 145321128061.87519668639091926m), // 7 / 11
- new TestResult(1, 0m), // 7 / 12
- new TestResult(0, 197846315.8215581473367403789m), // 7 / 13
- new TestResult(0, -355519.78373087286985534915017m), // 7 / 14
- new TestResult(0, -5561.4152228343398478498516935m), // 7 / 15
- new TestResult(0, 188135307817449443294332.61564m), // 7 / 16
- new TestResult(4, -3238655413907.0152158135371692m), // 7 / 17
- new TestResult(0, 14883.393842880239095927799143m), // 7 / 18
- new TestResult(0, -770.69397665852204557888702506m), // 7 / 19
- new TestResult(4, -11188331272543609822.484506627m), // 7 / 20
- new TestResult(0, -190565794778408772.72439011791m), // 7 / 21
- new TestResult(4, 12399952364735014.543439368391m), // 7 / 22
- new TestResult(2, -179108914452685.79816067884477m), // 7 / 23
- new TestResult(2, 154490919806941.48506503891762m), // 7 / 24
- new TestResult(2, -130108199431.16705963085822836m), // 7 / 25
- new TestResult(2, 1862655.7707746844883926874832m), // 7 / 26
- new TestResult(2, 10146692.753313261555369747673m), // 7 / 27
- new TestResult(0, -76.341858036091015923443233609m), // 7 / 28
- new TestResult(2, 15854755435520147876.101506668m), // 7 / 29
- new TestResult(3, 0m), // 8 / 0
- new TestResult(0, 27703302467091960609331879.532m), // 8 / 1
- new TestResult(0, -27703302467091960609331879.532m), // 8 / 2
- new TestResult(0, 13851651233545980304665939.766m), // 8 / 3
- new TestResult(0, 2770330246709196060933187.9532m), // 8 / 4
- new TestResult(0, 277033024670919606093318795.32m), // 8 / 5
- new TestResult(2, 0.0003496648361888264585379374m), // 8 / 6
- new TestResult(2, -0.0003496648361888264585379374m), // 8 / 7
- new TestResult(0, 1m), // 8 / 8
- new TestResult(2, -8646865369244722339.540450168m), // 8 / 9
- new TestResult(0, -571.59255824023515226354006889m), // 8 / 10
- new TestResult(0, -50813688.438531062464476589278m), // 8 / 11
- new TestResult(0, 36312036402878882966329689.018m), // 8 / 12
- new TestResult(0, -69179.899612307954004328275068m), // 8 / 13
- new TestResult(2, 124.31276694014267187689413445m), // 8 / 14
- new TestResult(0, 1.9446313428704152390534655913m), // 8 / 15
- new TestResult(0, -65784301589322901428.917817252m), // 8 / 16
- new TestResult(2, 1132443914.7758524269197245123m), // 8 / 17
- new TestResult(0, -5.2041994700045071214948001057m), // 8 / 18
- new TestResult(2, 0.2694845831000173532986745484m), // 8 / 19
- new TestResult(0, 3912166021640285.6025706982227m), // 8 / 20
- new TestResult(0, 66634157414385.824002109431498m), // 8 / 21
- new TestResult(0, -4335827312364.3201348613764117m), // 8 / 22
- new TestResult(0, 62628089232.056911382057917869m), // 8 / 23
- new TestResult(0, -54020042166.955319300276527479m), // 8 / 24
- new TestResult(0, 45494262.240922193719761217507m), // 8 / 25
- new TestResult(0, -651.30522496410233725620872491m), // 8 / 26
- new TestResult(0, -3547.9416594456341168641639951m), // 8 / 27
- new TestResult(2, 0.0266940632845404098551052086m), // 8 / 28
- new TestResult(0, -5543850462175058.4016671641533m), // 8 / 29
- new TestResult(3, 0m), // 9 / 0
- new TestResult(0, -3203854.9559968181492513385018m), // 9 / 1
- new TestResult(0, 3203854.9559968181492513385018m), // 9 / 2
- new TestResult(0, -1601927.4779984090746256692509m), // 9 / 3
- new TestResult(0, -320385.49559968181492513385018m), // 9 / 4
- new TestResult(0, -32038549.559968181492513385018m), // 9 / 5
- new TestResult(2, -4.04383E-23m), // 9 / 6
- new TestResult(2, 4.04383E-23m), // 9 / 7
- new TestResult(2, -1.156488458E-19m), // 9 / 8
- new TestResult(0, 1m), // 9 / 9
- new TestResult(2, 6.61040196455E-17m), // 9 / 10
- new TestResult(2, 5.8765444202781065E-12m), // 9 / 11
- new TestResult(0, -4199445.0997275825559060668592m), // 9 / 12
- new TestResult(2, 8.0005755447943E-15m), // 9 / 13
- new TestResult(2, -1.43766280186E-17m), // 9 / 14
- new TestResult(2, -2.248943704E-19m), // 9 / 15
- new TestResult(0, 7.6078785525336521046280405305m), // 9 / 16
- new TestResult(2, -1.309658317109623269E-10m), // 9 / 17
- new TestResult(2, 6.018596622E-19m), // 9 / 18
- new TestResult(2, -3.1165581E-20m), // 9 / 19
- new TestResult(2, -0.0004524374850977934825669157m), // 9 / 20
- new TestResult(2, -7.7061633978240275370839E-06m), // 9 / 21
- new TestResult(2, 5.014334243928492665444E-07m), // 9 / 22
- new TestResult(2, -7.242866236221657103E-09m), // 9 / 23
- new TestResult(2, 6.2473555282928855602E-09m), // 9 / 24
- new TestResult(2, -5.261358920047113E-12m), // 9 / 25
- new TestResult(2, 7.53226975501E-17m), // 9 / 26
- new TestResult(2, 4.103153579868E-16m), // 9 / 27
- new TestResult(2, -3.0871376E-21m), // 9 / 28
- new TestResult(2, 0.0006411399074043056427231896m), // 9 / 29
- new TestResult(3, 0m), // 10 / 0
- new TestResult(0, -48466870444188873796420.028868m), // 10 / 1
- new TestResult(0, 48466870444188873796420.028868m), // 10 / 2
- new TestResult(0, -24233435222094436898210.014434m), // 10 / 3
- new TestResult(0, -4846687044418887379642.0028868m), // 10 / 4
- new TestResult(0, -484668704441888737964200.28868m), // 10 / 5
- new TestResult(2, -6.11737908669317400216E-07m), // 10 / 6
- new TestResult(2, 6.11737908669317400216E-07m), // 10 / 7
- new TestResult(2, -0.001749497934470499347067655m), // 10 / 8
- new TestResult(2, 15127673103138133.38384122385m), // 10 / 9
- new TestResult(0, 1m), // 10 / 10
- new TestResult(2, 88898.44296603758700885485801m), // 10 / 11
- new TestResult(0, -63527832683254186820073.01815m), // 10 / 12
- new TestResult(2, 121.03009147860926410013615872m), // 10 / 13
- new TestResult(2, -0.217484928990092181791376891m), // 10 / 14
- new TestResult(2, -0.0034021285176583848675539818m), // 10 / 15
- new TestResult(2, 115089499751104803.45385549602m), // 10 / 16
- new TestResult(2, -1981208.2898040400164777217752m), // 10 / 17
- new TestResult(2, 0.0091047362233453526323903968m), // 10 / 18
- new TestResult(2, -0.0004714627215051239953535366m), // 10 / 19
- new TestResult(0, -6844326374165.3505116694016252m), // 10 / 20
- new TestResult(2, -116576320761.65010852644993727m), // 10 / 21
- new TestResult(0, 7585520927.2021546507200976307m), // 10 / 22
- new TestResult(2, -109567712.75131768812510902617m), // 10 / 23
- new TestResult(2, 94507952.1910976087542637813m), // 10 / 24
- new TestResult(0, -79592.11782075260884714858998m), // 10 / 25
- new TestResult(0, 1.1394571457845409462816707224m), // 10 / 26
- new TestResult(0, 6.2071166048219727069770728387m), // 10 / 27
- new TestResult(2, -4.67012085789282405269787E-05m), // 10 / 28
- new TestResult(2, 9698954932588.587842740128447m), // 10 / 29
- new TestResult(3, 0m), // 11 / 0
- new TestResult(0, -545193693242804794.30331374676m), // 11 / 1
- new TestResult(0, 545193693242804794.30331374676m), // 11 / 2
- new TestResult(0, -272596846621402397.15165687338m), // 11 / 3
- new TestResult(0, -54519369324280479.430331374676m), // 11 / 4
- new TestResult(0, -5451936932428047943.0331374676m), // 11 / 5
- new TestResult(2, -6.8813118459568899E-12m), // 11 / 6
- new TestResult(2, 6.8813118459568899E-12m), // 11 / 7
- new TestResult(2, -1.96797365184322821747E-08m), // 11 / 8
- new TestResult(2, 170168032177.09280206999941461m), // 11 / 9
- new TestResult(2, 1.12487909420644868170014E-05m), // 11 / 10
- new TestResult(0, 1m), // 11 / 11
- new TestResult(0, -714611308856377959.50595110446m), // 11 / 12
- new TestResult(2, 0.0013614421967418161221277362m), // 11 / 13
- new TestResult(2, -2.4464424992592870530962E-06m), // 11 / 14
- new TestResult(2, -3.82698324531749191876E-08m), // 11 / 15
- new TestResult(2, 1294617722326.9607230936474447m), // 11 / 16
- new TestResult(0, -22.286197864690758108786295635m), // 11 / 17
- new TestResult(2, 1.024172743590536270877E-07m), // 11 / 18
- new TestResult(2, -5.3033855911879105358E-09m), // 11 / 19
- new TestResult(0, -76990396.522244266468310204941m), // 11 / 20
- new TestResult(2, -1311342.6610428539176292952583m), // 11 / 21
- new TestResult(2, 85327.93909675220473779587097m), // 11 / 22
- new TestResult(2, -1232.5042947397459817875590485m), // 11 / 23
- new TestResult(2, 1063.1001965602823514109428061m), // 11 / 24
- new TestResult(2, -0.8953150940018113683593315845m), // 11 / 25
- new TestResult(2, 1.28175152203717976446025E-05m), // 11 / 26
- new TestResult(2, 6.98225570406594773014162E-05m), // 11 / 27
- new TestResult(2, -5.253321320461122964E-10m), // 11 / 28
- new TestResult(2, 109101516.393194182269828744m), // 11 / 29
- new TestResult(3, 0m), // 12 / 0
- new TestResult(0, 0.7629234053338741809892531431m), // 12 / 1
- new TestResult(0, -0.7629234053338741809892531431m), // 12 / 2
- new TestResult(2, 0.3814617026669370904946265716m), // 12 / 3
- new TestResult(2, 0.0762923405333874180989253143m), // 12 / 4
- new TestResult(0, 7.629234053338741809892531431m), // 12 / 5
- new TestResult(0, 0m), // 12 / 6
- new TestResult(0, 0m), // 12 / 7
- new TestResult(2, 2.75E-26m), // 12 / 8
- new TestResult(2, -2.381266991833920788159E-07m), // 12 / 9
- new TestResult(2, -1.57411E-23m), // 12 / 10
- new TestResult(2, -1.3993621254E-18m), // 12 / 11
- new TestResult(0, 1m), // 12 / 12
- new TestResult(2, -1.9051506E-21m), // 12 / 13
- new TestResult(2, 3.4235E-24m), // 12 / 14
- new TestResult(2, 5.36E-26m), // 12 / 15
- new TestResult(2, -1.8116390075029613252172E-06m), // 12 / 16
- new TestResult(2, 3.11864612111E-17m), // 12 / 17
- new TestResult(2, -1.433E-25m), // 12 / 18
- new TestResult(2, 7.4E-27m), // 12 / 19
- new TestResult(2, 1.077374449131727051E-10m), // 12 / 20
- new TestResult(2, 1.8350432532917088E-12m), // 12 / 21
- new TestResult(2, -1.194046862108942E-13m), // 12 / 22
- new TestResult(2, 1.7247198294583E-15m), // 12 / 23
- new TestResult(2, -1.4876621505775E-15m), // 12 / 24
- new TestResult(2, 1.2528700328E-18m), // 12 / 25
- new TestResult(2, -1.79363E-23m), // 12 / 26
- new TestResult(2, -9.7707E-23m), // 12 / 27
- new TestResult(2, 7E-28m), // 12 / 28
- new TestResult(2, -1.526725298649329415E-10m), // 12 / 29
- new TestResult(3, 0m), // 13 / 0
- new TestResult(0, -400453059665371395972.33474452m), // 13 / 1
- new TestResult(0, 400453059665371395972.33474452m), // 13 / 2
- new TestResult(0, -200226529832685697986.16737226m), // 13 / 3
- new TestResult(0, -40045305966537139597.233474452m), // 13 / 4
- new TestResult(0, -4004530596653713959723.3474452m), // 13 / 5
- new TestResult(2, -5.0544282103383796846E-09m), // 13 / 6
- new TestResult(2, 5.0544282103383796846E-09m), // 13 / 7
- new TestResult(2, -1.44550657865090008770424E-05m), // 13 / 8
- new TestResult(0, 124991007759518.90460797449561m), // 13 / 9
- new TestResult(2, 0.0082624080324415766315344098m), // 13 / 10
- new TestResult(0, 734.51520923413833710945795487m), // 13 / 11
- new TestResult(0, -524892875045723911444.75281192m), // 13 / 12
- new TestResult(0, 1m), // 13 / 13
- new TestResult(2, -0.0017969492242227235536064218m), // 13 / 14
- new TestResult(2, -2.81097739916991934127E-05m), // 13 / 15
- new TestResult(0, 950916407193211.1625559901416m), // 13 / 16
- new TestResult(2, -16369.551287616739221174657438m), // 13 / 17
- new TestResult(2, 7.52270457050304262522489E-05m), // 13 / 18
- new TestResult(2, -3.8954173771607025488213E-06m), // 13 / 19
- new TestResult(0, -56550617210.555523949138629466m), // 13 / 20
- new TestResult(2, -963201129.053543593301215979m), // 13 / 21
- new TestResult(0, 62674669.039168758653283589393m), // 13 / 22
- new TestResult(2, -905293.1499327386264702284996m), // 13 / 23
- new TestResult(0, 780863.26331332938464898250347m), // 13 / 24
- new TestResult(0, -657.62255360122271090761257385m), // 13 / 25
- new TestResult(2, 0.0094146598739531437042039072m), // 13 / 26
- new TestResult(2, 0.0512857300939825548661107378m), // 13 / 27
- new TestResult(2, -3.858644408872661628546E-07m), // 13 / 28
- new TestResult(2, 80136723141.3087985919301071m), // 13 / 29
- new TestResult(3, 0m), // 14 / 0
- new TestResult(0, 222851627785191714190050.61676m), // 14 / 1
- new TestResult(0, -222851627785191714190050.61676m), // 14 / 2
- new TestResult(0, 111425813892595857095025.30838m), // 14 / 3
- new TestResult(0, 22285162778519171419005.061676m), // 14 / 4
- new TestResult(0, 2228516277851917141900506.1676m), // 14 / 5
- new TestResult(2, 2.8127829891936371496034E-06m), // 14 / 6
- new TestResult(2, -2.8127829891936371496034E-06m), // 14 / 7
- new TestResult(2, 0.0080442260647412496180191824m), // 14 / 8
- new TestResult(0, -69557339781586865.090190294226m), // 14 / 9
- new TestResult(0, -4.5980197554082303507855592074m), // 14 / 10
- new TestResult(0, -408756.79698287266169556154972m), // 14 / 11
- new TestResult(0, 292102229695871398106087.53771m), // 14 / 12
- new TestResult(0, -556.49875161751071295835933612m), // 14 / 13
- new TestResult(0, 1m), // 14 / 14
- new TestResult(2, 0.0156430541346309720805875037m), // 14 / 15
- new TestResult(0, -529183793495630496.21134784463m), // 14 / 16
- new TestResult(0, 9109634.856097530429701051341m), // 14 / 17
- new TestResult(2, -0.0418637570227228532534385582m), // 14 / 18
- new TestResult(2, 0.0021677949074190888565424407m), // 14 / 19
- new TestResult(0, 31470347880873.8650457716423m), // 14 / 20
- new TestResult(0, 536020225874.87383772032904409m), // 14 / 21
- new TestResult(0, -34878375078.338063831579069802m), // 14 / 22
- new TestResult(0, 503794507.78545299809142202221m), // 14 / 23
- new TestResult(0, -434549431.21784335466036244264m), // 14 / 24
- new TestResult(0, 365966.13011459996262470838791m), // 14 / 25
- new TestResult(0, -5.2392464667583952349382510034m), // 14 / 26
- new TestResult(0, -28.540444773093892153704750451m), // 14 / 27
- new TestResult(2, 0.0002147330796473523774307252m), // 14 / 28
- new TestResult(0, -44595986386856.427962855912902m), // 14 / 29
- new TestResult(3, 0m), // 15 / 0
- new TestResult(0, 14246043379204153213661335.584m), // 15 / 1
- new TestResult(0, -14246043379204153213661335.584m), // 15 / 2
- new TestResult(0, 7123021689602076606830667.792m), // 15 / 3
- new TestResult(0, 1424604337920415321366133.5584m), // 15 / 4
- new TestResult(0, 142460433792041532136613355.84m), // 15 / 5
- new TestResult(2, 0.000179810346814988644017588m), // 15 / 6
- new TestResult(2, -0.000179810346814988644017588m), // 15 / 7
- new TestResult(2, 0.5142362863101488055319975668m), // 15 / 8
- new TestResult(0, -4446531935704239606.853757764m), // 15 / 9
- new TestResult(0, -293.9336344319759696558350238m), // 15 / 10
- new TestResult(0, -26130242.436351157631251931791m), // 15 / 11
- new TestResult(0, 18672966748175371201221341.455m), // 15 / 12
- new TestResult(0, -35574.814663942145387025413585m), // 15 / 13
- new TestResult(0, 63.926135612238008074953534656m), // 15 / 14
- new TestResult(0, 1m), // 15 / 15
- new TestResult(0, -33828674946800228646.235978357m), // 15 / 16
- new TestResult(0, 582343753.18886100200299543357m), // 15 / 17
- new TestResult(0, -2.676188208672362394790189458m), // 15 / 18
- new TestResult(2, 0.1385787512311916118536189686m), // 15 / 19
- new TestResult(0, 2011777726397049.7148998294303m), // 15 / 20
- new TestResult(0, 34265701650179.633435597272951m), // 15 / 21
- new TestResult(0, -2229639735192.3415269889385254m), // 15 / 22
- new TestResult(0, 32205636025.393565317814400562m), // 15 / 23
- new TestResult(0, -27779065870.252746877787654023m), // 15 / 24
- new TestResult(0, 23394800.463191857206004010592m), // 15 / 25
- new TestResult(0, -334.92478013993600679391750784m), // 15 / 26
- new TestResult(0, -1824.480342998389574945394373m), // 15 / 27
- new TestResult(2, 0.0137270559699701534233028604m), // 15 / 28
- new TestResult(0, -2850849073527704.1131980257228m), // 15 / 29
- new TestResult(3, 0m), // 16 / 0
- new TestResult(0, -421123.30446308691436596648186m), // 16 / 1
- new TestResult(0, 421123.30446308691436596648186m), // 16 / 2
- new TestResult(0, -210561.65223154345718298324093m), // 16 / 3
- new TestResult(0, -42112.330446308691436596648186m), // 16 / 4
- new TestResult(0, -4211233.0446308691436596648186m), // 16 / 5
- new TestResult(2, -5.3153E-24m), // 16 / 6
- new TestResult(2, 5.3153E-24m), // 16 / 7
- new TestResult(2, -1.52011951E-20m), // 16 / 8
- new TestResult(2, 0.1314426870900784765046305445m), // 16 / 9
- new TestResult(2, 8.6888899697E-18m), // 16 / 10
- new TestResult(2, 7.724287894055618E-13m), // 16 / 11
- new TestResult(0, -551986.34819545603591091806686m), // 16 / 12
- new TestResult(2, 1.0516171478749E-15m), // 16 / 13
- new TestResult(2, -1.8897026181E-18m), // 16 / 14
- new TestResult(2, -2.95607204E-20m), // 16 / 15
- new TestResult(0, 1m), // 16 / 16
- new TestResult(2, -1.72145008370758982E-11m), // 16 / 17
- new TestResult(2, 7.91100512E-20m), // 16 / 18
- new TestResult(2, -4.0964877E-21m), // 16 / 19
- new TestResult(2, -5.94695987815313124908788E-05m), // 16 / 20
- new TestResult(2, -1.012918824165199591208E-06m), // 16 / 21
- new TestResult(2, 6.59097566989758101184E-08m), // 16 / 22
- new TestResult(2, -9.520218003229776933E-10m), // 16 / 23
- new TestResult(2, 8.211691978458736692E-10m), // 16 / 24
- new TestResult(2, -6.915671541963459E-13m), // 16 / 25
- new TestResult(2, 9.9006177649E-18m), // 16 / 26
- new TestResult(2, 5.39329532081E-17m), // 16 / 27
- new TestResult(2, -4.057817E-22m), // 16 / 28
- new TestResult(2, 8.42731522299060351340978E-05m), // 16 / 29
- new TestResult(3, 0m), // 17 / 0
- new TestResult(0, 24463288738299545.200508898642m), // 17 / 1
- new TestResult(0, -24463288738299545.200508898642m), // 17 / 2
- new TestResult(0, 12231644369149772.600254449321m), // 17 / 3
- new TestResult(0, 2446328873829954.5200508898642m), // 17 / 4
- new TestResult(0, 244632887382995452.00508898642m), // 17 / 5
- new TestResult(2, 3.087701135804474E-13m), // 17 / 6
- new TestResult(2, -3.087701135804474E-13m), // 17 / 7
- new TestResult(2, 8.830459389222225669E-10m), // 17 / 8
- new TestResult(0, -7635579348.7187565660747357791m), // 17 / 9
- new TestResult(2, -5.047424872722036356353E-07m), // 17 / 10
- new TestResult(2, -0.0448708212173039475800037318m), // 17 / 11
- new TestResult(0, 32065196279558108.529140993113m), // 17 / 12
- new TestResult(2, -6.10890294076955781848965E-05m), // 17 / 13
- new TestResult(2, 1.097738840026777145636E-07m), // 17 / 14
- new TestResult(2, 1.7171988100225883459E-09m), // 17 / 15
- new TestResult(0, -58090560363.286299748647320613m), // 17 / 16
- new TestResult(0, 1m), // 17 / 17
- new TestResult(2, -4.5955472073286630491E-09m), // 17 / 18
- new TestResult(2, 2.379672667086185355E-10m), // 17 / 19
- new TestResult(0, 3454622.3177989620890093190782m), // 17 / 20
- new TestResult(0, 58841.022098277508341771781449m), // 17 / 21
- new TestResult(0, -3828.7347000513678647353825371m), // 17 / 22
- new TestResult(0, 55.303479858826432190514052161m), // 17 / 23
- new TestResult(0, -47.702178855937114485246771806m), // 17 / 24
- new TestResult(2, 0.0401735235161089558399723624m), // 17 / 25
- new TestResult(2, -5.751324339033751411128E-07m), // 17 / 26
- new TestResult(2, -3.1329954739064384030107E-06m), // 17 / 27
- new TestResult(2, 2.35720841767462147E-11m), // 17 / 28
- new TestResult(0, -4895474.6366157719700764456737m), // 17 / 29
- new TestResult(3, 0m), // 18 / 0
- new TestResult(0, -5323259153836385912697776.001m), // 18 / 1
- new TestResult(0, 5323259153836385912697776.001m), // 18 / 2
- new TestResult(0, -2661629576918192956348888.0005m), // 18 / 3
- new TestResult(0, -532325915383638591269777.6001m), // 18 / 4
- new TestResult(0, -53232591538363859126977760.01m), // 18 / 5
- new TestResult(2, -6.71889765571425396685425E-05m), // 18 / 6
- new TestResult(2, 6.71889765571425396685425E-05m), // 18 / 7
- new TestResult(2, -0.1921525117866271842350897941m), // 18 / 8
- new TestResult(2, 1661516899781174928.9093780261m), // 18 / 9
- new TestResult(2, 109.83294578440517035615430815m), // 18 / 10
- new TestResult(0, 9763977.866606841461047851247m), // 18 / 11
- new TestResult(0, -6977449002900619940294072.5616m), // 18 / 12
- new TestResult(2, 13293.091475651689504900168879m), // 18 / 13
- new TestResult(2, -23.887010414694002921991680138m), // 18 / 14
- new TestResult(2, -0.3736657970315521134142448751m), // 18 / 15
- new TestResult(2, 12640618786517406225.453062932m), // 18 / 16
- new TestResult(2, -217601942.68166121398235985303m), // 18 / 17
- new TestResult(0, 1m), // 18 / 18
- new TestResult(2, -0.0517821395304403973786481636m), // 18 / 19
- new TestResult(0, -751732527584477.35915419894761m), // 18 / 20
- new TestResult(2, -12803920717959.743225565448731m), // 18 / 21
- new TestResult(2, 833140108743.8650907762143944m), // 18 / 22
- new TestResult(2, -12034144654.336754703603784598m), // 18 / 23
- new TestResult(2, 10380086789.199979490407779016m), // 18 / 24
- new TestResult(2, -8741836.761472709884309939817m), // 18 / 25
- new TestResult(2, 125.14993491660654415586289072m), // 18 / 26
- new TestResult(0, 681.74590153489282094280759828m), // 18 / 27
- new TestResult(2, -0.0051293313099156230719389272m), // 18 / 28
- new TestResult(2, 1065264791276391.4723331595476m), // 18 / 29
- new TestResult(3, 0m), // 19 / 0
- new TestResult(0, 102801066199805834724673169.19m), // 19 / 1
- new TestResult(0, -102801066199805834724673169.19m), // 19 / 2
- new TestResult(0, 51400533099902917362336584.595m), // 19 / 3
- new TestResult(0, 10280106619980583472467316.919m), // 19 / 4
- new TestResult(0, 1028010661998058347246731691.9m), // 19 / 5
- new TestResult(2, 0.0012975318742410238535080931m), // 19 / 6
- new TestResult(2, -0.0012975318742410238535080931m), // 19 / 7
- new TestResult(0, 3.7107874168403053465719309061m), // 19 / 8
- new TestResult(0, -32086679207305516282.844795417m), // 19 / 9
- new TestResult(0, -2121.0584726774239906503858037m), // 19 / 10
- new TestResult(0, -188558795.66094477019222763757m), // 19 / 11
- new TestResult(0, 134746247763650063417846672.74m), // 19 / 12
- new TestResult(0, -256711.90097962787395549999647m), // 19 / 13
- new TestResult(0, 461.29825131408293475234811789m), // 19 / 14
- new TestResult(0, 7.2161135175168023022995955438m), // 19 / 15
- new TestResult(0, -244111558563287122929.04506056m), // 19 / 16
- new TestResult(0, 4202258629.2276083227657702227m), // 19 / 17
- new TestResult(0, -19.311677908019711128996883838m), // 19 / 18
- new TestResult(0, 1m), // 19 / 19
- new TestResult(0, 14517216445692969.517326696553m), // 19 / 20
- new TestResult(0, 247265192865059.0518154425151m), // 19 / 21
- new TestResult(0, -16089333432314.039236231362245m), // 19 / 22
- new TestResult(0, 232399525463.06860877964908684m), // 19 / 23
- new TestResult(0, -200456892730.3205001486617745m), // 19 / 24
- new TestResult(0, 168819535.86204710848979659043m), // 19 / 25
- new TestResult(0, -2416.8552333191352676140967438m), // 19 / 26
- new TestResult(0, -13165.657265554370962757268367m), // 19 / 27
- new TestResult(2, 0.0990559941406113443335355768m), // 19 / 28
- new TestResult(0, -20572050535883517.889932557941m), // 19 / 29
- new TestResult(3, 0m), // 20 / 0
- new TestResult(0, 7081320760.3793287174700927968m), // 20 / 1
- new TestResult(0, -7081320760.3793287174700927968m), // 20 / 2
- new TestResult(0, 3540660380.1896643587350463984m), // 20 / 3
- new TestResult(0, 708132076.03793287174700927968m), // 20 / 4
- new TestResult(0, 70813207603.793287174700927968m), // 20 / 5
- new TestResult(2, 8.93788337E-20m), // 20 / 6
- new TestResult(2, -8.93788337E-20m), // 20 / 7
- new TestResult(2, 2.556128739088E-16m), // 20 / 8
- new TestResult(0, -2210.250107335496183875574735m), // 20 / 9
- new TestResult(2, -1.461064165166945E-13m), // 20 / 10
- new TestResult(2, -1.2988632935681496171E-08m), // 20 / 11
- new TestResult(2, 9281823982.422412820396304075m), // 20 / 12
- new TestResult(2, -1.76832729566273202E-11m), // 20 / 13
- new TestResult(2, 3.17759436211301E-14m), // 20 / 14
- new TestResult(2, 4.970728062443E-16m), // 20 / 15
- new TestResult(2, -16815.314387332923907118773285m), // 20 / 16
- new TestResult(2, 2.894672435964370128732E-07m), // 20 / 17
- new TestResult(2, -1.3302603829227E-15m), // 20 / 18
- new TestResult(2, 6.88837287603E-17m), // 20 / 19
- new TestResult(0, 1m), // 20 / 20
- new TestResult(2, 0.0170325484771854288433021822m), // 20 / 21
- new TestResult(2, -0.0011082932800859005017661851m), // 20 / 22
- new TestResult(2, 1.60085458760255588702037E-05m), // 20 / 23
- new TestResult(2, -1.38082182269723557757959E-05m), // 20 / 24
- new TestResult(2, 1.16289191177647018971E-08m), // 20 / 25
- new TestResult(2, -1.6648200034492E-13m), // 20 / 26
- new TestResult(2, -9.068995640318096E-13m), // 20 / 27
- new TestResult(2, 6.8233462325E-18m), // 20 / 28
- new TestResult(2, -1.4170795491574366313541174399m), // 20 / 29
- new TestResult(3, 0m), // 21 / 0
- new TestResult(0, 415752273939.77704245656837041m), // 21 / 1
- new TestResult(0, -415752273939.77704245656837041m), // 21 / 2
- new TestResult(2, 207876136969.8885212282841852m), // 21 / 3
- new TestResult(0, 41575227393.977704245656837041m), // 21 / 4
- new TestResult(0, 4157522739397.7704245656837041m), // 21 / 5
- new TestResult(2, 5.2475314427E-18m), // 21 / 6
- new TestResult(2, -5.2475314427E-18m), // 21 / 7
- new TestResult(2, 1.50073181503771E-14m), // 21 / 8
- new TestResult(2, -129766.25959973387113808743405m), // 21 / 9
- new TestResult(2, -8.5780713738991847E-12m), // 21 / 10
- new TestResult(2, -7.625771887911763590261E-07m), // 21 / 11
- new TestResult(0, 544946282986.07977368508338172m), // 21 / 12
- new TestResult(2, -1.0382047630930577807E-09m), // 21 / 13
- new TestResult(2, 1.8656012436244067E-12m), // 21 / 14
- new TestResult(2, 2.91837012476515E-14m), // 21 / 15
- new TestResult(2, -987245.9432513294606844938685m), // 21 / 16
- new TestResult(2, 1.69949461164997956913075E-05m), // 21 / 17
- new TestResult(2, -7.81010771643817E-14m), // 21 / 18
- new TestResult(2, 4.0442408752037E-15m), // 21 / 19
- new TestResult(0, 58.711120143850993772970798576m), // 21 / 20
- new TestResult(0, 1m), // 21 / 21
- new TestResult(2, -0.0650691399217460043995169619m), // 21 / 22
- new TestResult(2, 0.0009398796602556869430220663m), // 21 / 23
- new TestResult(2, -0.0008106959592962871308194687m), // 21 / 24
- new TestResult(2, 6.827468674662091164433E-07m), // 21 / 25
- new TestResult(2, -9.7743447240392408E-12m), // 21 / 26
- new TestResult(2, -5.32450892622776623E-11m), // 21 / 27
- new TestResult(2, 4.006063004374E-16m), // 21 / 28
- new TestResult(2, -83.19832766397646235747803502m), // 21 / 29
- new TestResult(3, 0m), // 22 / 0
- new TestResult(0, -6389392489892.6362673670820462m), // 22 / 1
- new TestResult(0, 6389392489892.6362673670820462m), // 22 / 2
- new TestResult(0, -3194696244946.3181336835410231m), // 22 / 3
- new TestResult(0, -638939248989.26362673670820462m), // 22 / 4
- new TestResult(0, -63893924898926.362673670820462m), // 22 / 5
- new TestResult(2, -8.06454710942E-17m), // 22 / 6
- new TestResult(2, 8.06454710942E-17m), // 22 / 7
- new TestResult(2, -2.306364917136659E-13m), // 22 / 8
- new TestResult(2, 1994282.6930829954142428134453m), // 22 / 9
- new TestResult(2, 1.31830102322167113E-10m), // 22 / 10
- new TestResult(2, 1.17194908324940723524544E-05m), // 22 / 11
- new TestResult(2, -8374880682938.911591614017805m), // 22 / 12
- new TestResult(2, 1.59554093436863052632E-08m), // 22 / 13
- new TestResult(2, -2.8671060442293101E-11m), // 22 / 14
- new TestResult(2, -4.485029505960676E-13m), // 22 / 15
- new TestResult(2, 15172260.52839517272431927284m), // 22 / 16
- new TestResult(2, -0.0002611828915663923103773216m), // 22 / 17
- new TestResult(2, 1.2002783079399592E-12m), // 22 / 18
- new TestResult(2, -6.21529788171079E-14m), // 22 / 19
- new TestResult(2, -902.2882462325251912660653119m), // 22 / 20
- new TestResult(2, -15.368268294350108200187006165m), // 22 / 21
- new TestResult(0, 1m), // 22 / 22
- new TestResult(2, -0.0144443227832120251558802997m), // 22 / 23
- new TestResult(2, 0.0124589930076108753677011728m), // 22 / 24
- new TestResult(2, -1.04926370363477969575619E-05m), // 22 / 25
- new TestResult(2, 1.50214752120500522E-10m), // 22 / 26
- new TestResult(2, 8.182848171393031905E-10m), // 22 / 27
- new TestResult(2, -6.156625105529E-15m), // 22 / 28
- new TestResult(2, 1278.6142211812409691677177837m), // 22 / 29
- new TestResult(3, 0m), // 23 / 0
- new TestResult(0, 442346282742915.0596416330681m), // 23 / 1
- new TestResult(0, -442346282742915.0596416330681m), // 23 / 2
- new TestResult(0, 221173141371457.52982081653405m), // 23 / 3
- new TestResult(0, 44234628274291.50596416330681m), // 23 / 4
- new TestResult(0, 4423462827429150.596416330681m), // 23 / 5
- new TestResult(2, 5.5831950244116E-15m), // 23 / 6
- new TestResult(2, -5.5831950244116E-15m), // 23 / 7
- new TestResult(2, 1.59672762216117307E-11m), // 23 / 8
- new TestResult(0, -138066887.80181919317571960944m), // 23 / 9
- new TestResult(2, -9.1267762636395250963E-09m), // 23 / 10
- new TestResult(2, -0.0008113561991369439495762269m), // 23 / 11
- new TestResult(0, 579804315413987.55317875373327m), // 23 / 12
- new TestResult(2, -1.104614566093091384748E-06m), // 23 / 13
- new TestResult(2, 1.9849362876061009571E-09m), // 23 / 14
- new TestResult(2, 3.10504658008156699E-11m), // 23 / 15
- new TestResult(2, -1050396114.5225303515983863327m), // 23 / 16
- new TestResult(2, 0.018082044792709369766201304m), // 23 / 17
- new TestResult(2, -8.30968904499273382E-11m), // 23 / 18
- new TestResult(2, 4.3029347758238576E-12m), // 23 / 19
- new TestResult(0, 62466.635492334295970467255163m), // 23 / 20
- new TestResult(2, 1063.9659972298557739709718754m), // 23 / 21
- new TestResult(0, -69.231352345729507070036842909m), // 23 / 22
- new TestResult(0, 1m), // 23 / 23
- new TestResult(2, -0.8625529347828887027197930493m), // 23 / 24
- new TestResult(2, 0.000726419451699245356034835m), // 23 / 25
- new TestResult(2, -1.03995704315807902618E-08m), // 23 / 26
- new TestResult(2, -5.66509644945319386873E-08m), // 23 / 27
- new TestResult(2, 4.262314819414408E-13m), // 23 / 28
- new TestResult(0, -88520.19166085901375500091819m), // 23 / 29
- new TestResult(3, 0m), // 24 / 0
- new TestResult(0, -512833780867323.89020837443764m), // 24 / 1
- new TestResult(0, 512833780867323.89020837443764m), // 24 / 2
- new TestResult(0, -256416890433661.94510418721882m), // 24 / 3
- new TestResult(0, -51283378086732.389020837443764m), // 24 / 4
- new TestResult(0, -5128337808673238.9020837443764m), // 24 / 5
- new TestResult(2, -6.4728723296466E-15m), // 24 / 6
- new TestResult(2, 6.4728723296466E-15m), // 24 / 7
- new TestResult(2, -1.85116478974485417E-11m), // 24 / 8
- new TestResult(0, 160067727.13209967231293920454m), // 24 / 9
- new TestResult(2, 1.05811201789450821647E-08m), // 24 / 10
- new TestResult(2, 0.0009406451087447388135269385m), // 24 / 11
- new TestResult(0, -672195632329427.78049892650167m), // 24 / 12
- new TestResult(2, 1.280633943203881720602E-06m), // 24 / 13
- new TestResult(2, -2.3012341707535026743E-09m), // 24 / 14
- new TestResult(2, -3.59983307095596564E-11m), // 24 / 15
- new TestResult(2, 1217775828.2011100471829103026m), // 24 / 16
- new TestResult(2, -0.0209634030139388041036175456m), // 24 / 17
- new TestResult(2, 9.63383081768117492E-11m), // 24 / 18
- new TestResult(2, -4.988603716138233E-12m), // 24 / 19
- new TestResult(0, -72420.639908967018993409156115m), // 24 / 20
- new TestResult(2, -1233.5080599982704934889448056m), // 24 / 21
- new TestResult(2, 80.26330855062892819843621147m), // 24 / 22
- new TestResult(0, -1.1593491363538259770624590073m), // 24 / 23
- new TestResult(0, 1m), // 24 / 24
- new TestResult(2, -0.0008421737639581399076256596m), // 24 / 25
- new TestResult(2, 1.20567329983039744731E-08m), // 24 / 26
- new TestResult(2, 6.56782467603468627053E-08m), // 24 / 27
- new TestResult(2, -4.941511004756208E-13m), // 24 / 28
- new TestResult(2, 102625.80775189204591883200668m), // 24 / 29
- new TestResult(3, 0m), // 25 / 0
- new TestResult(0, 608940580690915704.1450897514m), // 25 / 1
- new TestResult(0, -608940580690915704.1450897514m), // 25 / 2
- new TestResult(0, 304470290345457852.0725448757m), // 25 / 3
- new TestResult(0, 60894058069091570.41450897514m), // 25 / 4
- new TestResult(0, 6089405806909157041.450897514m), // 25 / 5
- new TestResult(2, 7.6859106833543095E-12m), // 25 / 6
- new TestResult(2, -7.6859106833543095E-12m), // 25 / 7
- new TestResult(2, 2.19807938571316735336E-08m), // 25 / 8
- new TestResult(2, -190064965191.73899284873850192m), // 25 / 9
- new TestResult(2, -1.2564058192949139177057E-05m), // 25 / 10
- new TestResult(2, -1.1169252106878663178369471734m), // 25 / 11
- new TestResult(2, 798167386704341861.9682340376m), // 25 / 12
- new TestResult(2, -0.0015206291124352045188095451m), // 25 / 13
- new TestResult(2, 2.7324933039209294299951E-06m), // 25 / 14
- new TestResult(2, 4.27445406757517405142E-08m), // 25 / 15
- new TestResult(0, -1445991172270.2862199666258075m), // 25 / 16
- new TestResult(2, 24.892016245451201449485802529m), // 25 / 17
- new TestResult(2, -1.143924357415629812325E-07m), // 25 / 18
- new TestResult(2, 5.9234850687965514433E-09m), // 25 / 19
- new TestResult(2, 85992514.8565500475609760009m), // 25 / 20
- new TestResult(2, 1464671.6779692768786214751455m), // 25 / 21
- new TestResult(2, -95304.9263532013818698238713m), // 25 / 22
- new TestResult(2, 1376.6151190758908669955780933m), // 25 / 23
- new TestResult(2, -1187.4034110254054607086172841m), // 25 / 24
- new TestResult(0, 1m), // 25 / 25
- new TestResult(2, -1.43162058880087033607313E-05m), // 25 / 26
- new TestResult(2, -7.79865742334041504368931E-05m), // 25 / 27
- new TestResult(2, 5.867567022667099857E-10m), // 25 / 28
- new TestResult(2, -121858234.18383411295432055833m), // 25 / 29
- new TestResult(3, 0m), // 26 / 0
- new TestResult(0, -42535053313319986966115.037787m), // 26 / 1
- new TestResult(0, 42535053313319986966115.037787m), // 26 / 2
- new TestResult(2, -21267526656659993483057.518894m), // 26 / 3
- new TestResult(0, -4253505331331998696611.5037787m), // 26 / 4
- new TestResult(0, -425350533133199869661150.37787m), // 26 / 5
- new TestResult(2, -5.368678505659136383798E-07m), // 26 / 6
- new TestResult(2, 5.368678505659136383798E-07m), // 26 / 7
- new TestResult(2, -0.0015353784395866262203076433m), // 26 / 8
- new TestResult(2, 13276210657946598.343741130625m), // 26 / 9
- new TestResult(2, 0.8776108901502200170717671109m), // 26 / 10
- new TestResult(0, 78018.241664392812128305230978m), // 26 / 11
- new TestResult(0, -55752717790464947101601.359896m), // 26 / 12
- new TestResult(2, 106.21732631750483463727976216m), // 26 / 13
- new TestResult(2, -0.1908671421252521905897157731m), // 26 / 14
- new TestResult(2, -0.0029857450367876236635795704m), // 26 / 15
- new TestResult(2, 101003798323510611.65980529603m), // 26 / 16
- new TestResult(0, -1738729.9707879186275737174853m), // 26 / 17
- new TestResult(2, 0.0079904156615530673319808542m), // 26 / 18
- new TestResult(2, -0.0004137608186927571471957746m), // 26 / 19
- new TestResult(0, -6006655361709.8810944800037905m), // 26 / 20
- new TestResult(2, -102308648634.06932650747319597m), // 26 / 21
- new TestResult(0, 6657135773.1750052361186583781m), // 26 / 22
- new TestResult(2, -96157817.91940752862823678187m), // 26 / 23
- new TestResult(2, 82941208.04870360868726566113m), // 26 / 24
- new TestResult(0, -69850.909369611886817979504214m), // 26 / 25
- new TestResult(0, 1m), // 26 / 26
- new TestResult(0, 5.4474331288240229212686639513m), // 26 / 27
- new TestResult(2, -4.09854892320443047650146E-05m), // 26 / 28
- new TestResult(0, 8511908471915.937756062101659m), // 26 / 29
- new TestResult(3, 0m), // 27 / 0
- new TestResult(0, -7808274522591953107485.8812311m), // 27 / 1
- new TestResult(0, 7808274522591953107485.8812311m), // 27 / 2
- new TestResult(2, -3904137261295976553742.9406156m), // 27 / 3
- new TestResult(0, -780827452259195310748.58812311m), // 27 / 4
- new TestResult(0, -78082745225919531074858.812311m), // 27 / 5
- new TestResult(2, -9.85542801296968307756E-08m), // 27 / 6
- new TestResult(2, 9.85542801296968307756E-08m), // 27 / 7
- new TestResult(2, -0.000281853563555002197999826m), // 27 / 8
- new TestResult(2, 2437149817901964.8960845694514m), // 27 / 9
- new TestResult(2, 0.1611053994415304138070003376m), // 27 / 10
- new TestResult(2, 14322.019163773595213651372685m), // 27 / 11
- new TestResult(2, -10234676860090376638967.506512m), // 27 / 12
- new TestResult(2, 19.498601232106311831598265533m), // 27 / 13
- new TestResult(2, -0.0350379963574616786880617938m), // 27 / 14
- new TestResult(2, -0.0005481012737887758520091497m), // 27 / 15
- new TestResult(2, 18541539828927654.501195934005m), // 27 / 16
- new TestResult(2, -319183.3529057512147016471775m), // 27 / 17
- new TestResult(2, 0.0014668221660718241029342142m), // 27 / 18
- new TestResult(2, -7.59551900698740123366376E-05m), // 27 / 19
- new TestResult(2, -1102657934418.1103423727465413m), // 27 / 20
- new TestResult(2, -18781074721.729615778535996388m), // 27 / 21
- new TestResult(2, 1222068378.9489912725931951927m), // 27 / 22
- new TestResult(2, -17651950.128695901472129097893m), // 27 / 23
- new TestResult(0, 15225741.38814783974528909088m), // 27 / 24
- new TestResult(2, -12822.719933909700245783228909m), // 27 / 25
- new TestResult(2, 0.1835726986181246222761380025m), // 27 / 26
- new TestResult(0, 1m), // 27 / 27
- new TestResult(2, -7.5238168625104611316081E-06m), // 27 / 28
- new TestResult(2, 1562554008580.0861321324839011m), // 27 / 29
- new TestResult(3, 0m), // 28 / 0
- new TestResult(0, 1037807626804273037330059471.7m), // 28 / 1
- new TestResult(0, -1037807626804273037330059471.7m), // 28 / 2
- new TestResult(0, 518903813402136518665029735.85m), // 28 / 3
- new TestResult(0, 103780762680427303733005947.17m), // 28 / 4
- new TestResult(0, 10378076268042730373300594717m), // 28 / 5
- new TestResult(2, 0.013098973822817421173845813m), // 28 / 6
- new TestResult(2, -0.013098973822817421173845813m), // 28 / 7
- new TestResult(0, 37.461513046578399246836695461m), // 28 / 8
- new TestResult(0, -323924659841968113506.41166762m), // 28 / 9
- new TestResult(0, -21412.722077843692663812014719m), // 28 / 10
- new TestResult(0, -1903557652.3848013647110715272m), // 28 / 11
- new TestResult(0, 1360303825454277040707598638.1m), // 28 / 12
- new TestResult(0, -2591583.7118874583629347087379m), // 28 / 13
- new TestResult(0, 4656.9443405844146143879311m), // 28 / 14
- new TestResult(0, 72.848832421725332869329889807m), // 28 / 15
- new TestResult(0, -2464379472248467996678.919247m), // 28 / 16
- new TestResult(0, 42423062487.893912564215173398m), // 28 / 17
- new TestResult(0, -194.95718634257023426451589779m), // 28 / 18
- new TestResult(0, 10.095300225653040883323838635m), // 28 / 19
- new TestResult(0, 146555658460058271.30028503504m), // 28 / 20
- new TestResult(0, 2496216357326773.3203945609668m), // 28 / 21
- new TestResult(0, -162426651429846.93508891542812m), // 28 / 22
- new TestResult(0, 2346142981848.9761467960716552m), // 28 / 23
- new TestResult(0, -2023672514414.1119557698582125m), // 28 / 24
- new TestResult(0, 1704283898.4827658021193146276m), // 28 / 25
- new TestResult(0, -24398.879182297399040382596287m), // 28 / 26
- new TestResult(0, -132911.26276382163838029345835m), // 28 / 27
- new TestResult(0, 1m), // 28 / 28
- new TestResult(0, -207681026417050638.7817636979m), // 28 / 29
- new TestResult(3, 0m), // 29 / 0
- new TestResult(0, -4997122966.448652425771563042m), // 29 / 1
- new TestResult(0, 4997122966.448652425771563042m), // 29 / 2
- new TestResult(0, -2498561483.224326212885781521m), // 29 / 3
- new TestResult(0, -499712296.6448652425771563042m), // 29 / 4
- new TestResult(0, -49971229664.48652425771563042m), // 29 / 5
- new TestResult(2, -6.30725591E-20m), // 29 / 6
- new TestResult(2, 6.30725591E-20m), // 29 / 7
- new TestResult(2, -1.803800457503E-16m), // 29 / 8
- new TestResult(0, 1559.7219709011119254589559305m), // 29 / 9
- new TestResult(2, 1.031038918059089E-13m), // 29 / 10
- new TestResult(2, 9.1657754452841005337E-09m), // 29 / 11
- new TestResult(0, -6549966787.6381215871101448624m), // 29 / 12
- new TestResult(2, 1.24786734570697837E-11m), // 29 / 13
- new TestResult(2, -2.24235425880102E-14m), // 29 / 14
- new TestResult(2, -3.507726905944E-16m), // 29 / 15
- new TestResult(2, 11866.175330334086443056587349m), // 29 / 16
- new TestResult(2, -2.042702851569255038994E-07m), // 29 / 17
- new TestResult(2, 9.387337384931E-16m), // 29 / 18
- new TestResult(2, -4.86096414286E-17m), // 29 / 19
- new TestResult(2, -0.705676685966272906628710787m), // 29 / 20
- new TestResult(2, -0.0120194723629401016807892544m), // 29 / 21
- new TestResult(2, 0.0007820967289697085504718691m), // 29 / 22
- new TestResult(2, -1.1296857600932761513324E-05m), // 29 / 23
- new TestResult(2, 9.7441376775089367720444E-06m), // 29 / 24
- new TestResult(2, -8.2062571043940289217E-09m), // 29 / 25
- new TestResult(2, 1.17482466276439E-13m), // 29 / 26
- new TestResult(2, 6.399778788502251E-13m), // 29 / 27
- new TestResult(2, -4.8150763565E-18m), // 29 / 28
- new TestResult(0, 1m), // 29 / 29
- };
-
- #endregion
- }
-}
diff --git a/mcs/class/corlib/Test/System/DoubleTest.cs b/mcs/class/corlib/Test/System/DoubleTest.cs
deleted file mode 100644
index fbc38aff23e..00000000000
--- a/mcs/class/corlib/Test/System/DoubleTest.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-// BooleanTest.cs - NUnit Test Cases for the System.Double class
-//
-// Bob Doan <bdoan@sicompos.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class DoubleTest : TestCase
-{
- private const Double d_zero = 0.0;
- private const Double d_neg = -1234.5678;
- private const Double d_pos = 1234.9999;
- private const Double d_pos2 = 1234.9999;
- private const Double d_nan = Double.NaN;
- private const Double d_pinf = Double.PositiveInfinity;
- private const Double d_ninf = Double.NegativeInfinity;
- private const String s = "What Ever";
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
-
- private string[] string_values = {
- "1", ".1", "1.1", "-12", "44.444432", ".000021121",
- " .00001", " .223 ", " -221.3233",
- " 1.7976931348623157e308 ", "+1.7976931348623157E308", "-1.7976931348623157e308",
- "4.9406564584124650e-324",
- "6.28318530717958647692528676655900577",
- "1e-05",
- };
- private double[] double_values = {
- 1, .1, 1.1, -12, 44.444432, .000021121,
- .00001, .223, -221.3233,
- 1.7976931348623157e308, 1.7976931348623157e308, -1.7976931348623157e308,
- 4.9406564584124650e-324,
- 6.28318530717958647692528676655900577,
- 1e-05
- };
-
- public DoubleTest () : base ("MonoTests.System.DoubleTests testcase") {}
- public DoubleTest (string name) : base (name) {}
-
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (DoubleTest));
- }
- }
-
- public void TestPublicFields ()
- {
- AssertEquals("Epsilon Field has wrong value", 3.9406564584124654e-324, Double.Epsilon);
- AssertEquals("MaxValue Field has wrong value", 1.7976931348623157e+308, Double.MaxValue);
- AssertEquals("MinValue Field has wrong value", -1.7976931348623157e+308, Double.MinValue);
- AssertEquals("NegativeInfinity Field has wrong value", (double)-1.0 / (double)(0.0), Double.NegativeInfinity);
- AssertEquals("PositiveInfinity Field has wrong value", (double)1.0 / (double)(0.0), Double.PositiveInfinity);
- }
-
- public void TestCompareTo () {
- //If you do int foo = d_ninf.CompareTo(d_pinf); Assert(".." foo < 0, true) this works.... WHY???
- AssertEquals("CompareTo Infinity failed", d_ninf.CompareTo(d_pinf) < 0, true);
-
- AssertEquals("CompareTo Failed01", d_neg.CompareTo(d_pos) < 0, true);
- AssertEquals("CompareTo NaN Failed", d_nan.CompareTo(d_neg) < 0, true);
-
- AssertEquals("CompareTo Failed02", 0, d_pos.CompareTo(d_pos2));
- AssertEquals("CompareTo Failed03", 0, d_pinf.CompareTo(d_pinf));
- AssertEquals("CompareTo Failed04", 0, d_ninf.CompareTo(d_ninf));
- AssertEquals("CompareTo Failed05", 0, d_nan.CompareTo(d_nan));
-
- Assert("CompareTo Failed06", d_pos.CompareTo(d_neg) > 0);
- Assert("CompareTo Failed07", d_pos.CompareTo(d_nan) > 0);
- Assert("CompareTo Failed08", d_pos.CompareTo(null) > 0);
-
- try {
- d_pos.CompareTo(s);
- Fail("CompareTo should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("CompareTo should be a System.ArgumentException", typeof(ArgumentException) == e.GetType());
- }
-
- }
-
- public void TestEquals () {
- AssertEquals("Equals Failed", true, d_pos.Equals(d_pos2));
- AssertEquals("Equals Failed", false, d_pos.Equals(d_neg));
- AssertEquals("Equals Failed", false, d_pos.Equals(s));
-
- }
-
- public void TestTypeCode () {
- AssertEquals("GetTypeCode Failed", TypeCode.Double, d_pos.GetTypeCode());
- }
-
- public void TestIsInfinity() {
- AssertEquals("IsInfinity Failed", true, Double.IsInfinity(Double.PositiveInfinity));
- AssertEquals("IsInfinity Failed", true, Double.IsInfinity(Double.NegativeInfinity));
- AssertEquals("IsInfinity Failed", false, Double.IsInfinity(12));
- }
-
- public void TestIsNan() {
- AssertEquals("IsNan Failed", true, Double.IsNaN(Double.NaN));
- AssertEquals("IsNan Failed", false, Double.IsNaN(12));
- AssertEquals("IsNan Failed", false, Double.IsNaN(Double.PositiveInfinity));
- }
-
- public void TestIsNegativeInfinity() {
- AssertEquals("IsNegativeInfinity Failed", true, Double.IsNegativeInfinity(Double.NegativeInfinity));
- AssertEquals("IsNegativeInfinity Failed", false, Double.IsNegativeInfinity(12));
- }
-
- public void TestIsPositiveInfinity() {
- AssertEquals("IsPositiveInfinity Failed", true, Double.IsPositiveInfinity(Double.PositiveInfinity));
- AssertEquals("IsPositiveInfinity Failed", false, Double.IsPositiveInfinity(12));
- }
-
- public void TestParse() {
- int i=0;
- try {
- for(i=0;i<string_values.Length;i++) {
- AssertEquals("Parse Failed", double_values[i], Double.Parse(string_values[i]));
- }
- } catch (Exception e) {
- Fail("TestParse: i=" + i + " failed with e = " + e.ToString());
- }
-
- try {
- AssertEquals("Parse Failed NumberStyles.Float", 10.1111, Double.Parse(" 10.1111 ", NumberStyles.Float, Nfi));
- } catch (Exception e) {
- Fail("TestParse: Parse Failed NumberStyles.Float with e = " + e.ToString());
- }
-
- try {
- AssertEquals("Parse Failed NumberStyles.AllowThousands", 1234.5678, Double.Parse("1,234.5678", NumberStyles.Float | NumberStyles.AllowThousands, Nfi));
- } catch (Exception e) {
- Fail("TestParse: Parse Failed NumberStyles.AllowThousands with e = " + e.ToString());
- }
-
- try {
- Double.Parse(null);
- Fail("Parse should raise a ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Parse should be a ArgumentNullException", typeof(ArgumentNullException) == e.GetType());
- }
-
- try {
- Double.Parse("save the elk");
- Fail("Parse should raise a FormatException");
- }
- catch (Exception e) {
- Assert("Parse should be a FormatException", typeof(FormatException) == e.GetType());
- }
-
- double ovf_plus = 0;
- try {
- ovf_plus = Double.Parse("1.79769313486232e308");
- Fail("Parse should have raised an OverflowException +");
- }
- catch (Exception e) {
- AssertEquals("Should be an OverflowException + for " + ovf_plus, typeof(OverflowException), e.GetType());
- }
-
- try {
- Double.Parse("-1.79769313486232e308");
- Fail("Parse should have raised an OverflowException -");
- }
- catch (Exception e) {
- AssertEquals("Should be an OverflowException -", typeof(OverflowException), e.GetType());
- }
-
-
- }
-
- public void TestToString() {
- //ToString is not yet Implemented......
- //AssertEquals("ToString Failed", "1234.9999", d_pos.ToString());
- }
-
-}
-}
diff --git a/mcs/class/corlib/Test/System/EnumTest.cs b/mcs/class/corlib/Test/System/EnumTest.cs
deleted file mode 100644
index 4b6ac0f786c..00000000000
--- a/mcs/class/corlib/Test/System/EnumTest.cs
+++ /dev/null
@@ -1,728 +0,0 @@
-// EnumTest.cs - NUnit Test Cases for the System.Enum class
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.IO;
-
-
-namespace MonoTests.System
-{
-
-public class EnumTest : TestCase
-{
- public EnumTest() : base ("MonoTests.System.EnumTest testsuite") {}
- public EnumTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(EnumTest));
- }
- }
-
- enum TestingEnum {This, Is, A, Test};
- enum TestingEnum2 {This, Is, A, Test};
-
- public void TestCompareTo() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum();
- Enum e3 = new TestingEnum2();
-
- AssertEquals("An enum should equal itself",
- 0, e1.CompareTo(e1));
- AssertEquals("An enum should equal a copy",
- 0, e1.CompareTo(e2));
-
- TestingEnum x = TestingEnum.This;
- TestingEnum y = TestingEnum.Is;
- AssertEquals("should equal", 0, x.CompareTo(x));
- AssertEquals("less than", -1, x.CompareTo(y));
- AssertEquals("greater than", 1, y.CompareTo(x));
-
- {
- bool errorThrown = false;
- try {
- e1.CompareTo(e3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("1) Compare type mismatch not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- ((Enum)e1).CompareTo((Enum)e3);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("2) Compare type mismatch not caught.",
- errorThrown);
- }
- }
-
- public void TestEquals() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum();
- Enum e3 = new TestingEnum2();
-
- Assert("An enum should equal itself", e1.Equals(e1));
- Assert("An enum should equal a copy", e1.Equals(e2));
-
- Assert("Shouldn't match", !e1.Equals(e3));
- Assert("Shouldn't match null", !e1.Equals(null));
- }
-
- public void TestFormat() {
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(null, x, "G");
- Fail("null first arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("first arg null, wrong exception: " + e.ToString());
- }
- Fail ("01 - Should not be here");
-
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), null, "G");
- Fail("null second arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("second arg null, wrong exception: " + e.ToString());
- }
- Fail ("02 - Should not be here");
-
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), x, null);
- Fail("null third arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("third arg null, wrong exception: " + e.ToString());
- }
- Fail ("03 - Should not be here");
-
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Format(bad.GetType(), x, "G");
- Fail("bad type arg not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("bad type, wrong exception: " + e.ToString());
- }
- Fail ("04 - Should not be here");
-
- try {
- TestingEnum x = TestingEnum.Test;
- TestingEnum2 y = TestingEnum2.Test;
- Enum.Format(y.GetType(), x, "G");
- Fail("wrong enum type not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("wrong enum type, wrong exception: " + e.ToString());
- }
- Fail ("05 - Should not be here");
-
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), bad, "G");
- Fail("non-enum object not caught.");
- } catch (ArgumentNullException) {
- return;
- } catch (Exception e) {
- Fail("non-enum object, wrong exception: " + e.ToString());
- }
- Fail ("06 - Should not be here");
-
- string[] codes = {"a", "b", "c", "ad", "e", "af", "ag", "h",
- "i", "j", "k", "l", "m", "n", "o", "p",
- "q", "r", "s", "t", "u", "v", "w", "ax",
- "y", "z"};
- foreach (string code in codes) {
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Format(x.GetType(), x, code);
- Fail ("bad format code not caught - " + code);
- } catch (FormatException) {
-
- } catch (Exception e) {
- Fail ("bad format code, wrong exception: " + e.ToString());
- }
- }
-
- {
- TestingEnum x = TestingEnum.Test;
- AssertEquals("decimal format wrong",
- "3", Enum.Format(x.GetType(), x, "d"));
- AssertEquals("named format wrong",
- "Test", Enum.Format(x.GetType(), x, "g"));
- AssertEquals("hex format wrong",
- "00000003", Enum.Format(x.GetType(), x, "x"));
- AssertEquals("bitfield format wrong",
- "Test", Enum.Format(x.GetType(), x, "f"));
- }
- }
-
- public void TestGetHashCode() {
- Enum e1 = new TestingEnum();
- Enum e2 = new TestingEnum2();
-
- AssertEquals("hash code is deterministic",
- e1.GetHashCode(), e1.GetHashCode());
- }
-
- public void GetName() {
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(null, x);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(bad.GetType(), x);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- TestingEnum2 y = TestingEnum2.Test;
- Enum.GetName(y.GetType(), x);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("wrong enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.GetName(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum object not caught.",
- errorThrown);
- }
- {
- TestingEnum x = TestingEnum.This;
- TestingEnum y = TestingEnum.Is;
- TestingEnum z = TestingEnum.A;
-
- AssertEquals("first name doesn't match",
- "This", Enum.GetName(x.GetType(), x));
- AssertEquals("second name doesn't match",
- "Is", Enum.GetName(y.GetType(), y));
- AssertEquals("third name doesn't match",
- "A", Enum.GetName(z.GetType(), z));
- }
- }
-
- public void TestGetNames() {
- {
- bool errorThrown = false;
- try {
- Enum.GetNames(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- TestingEnum x = TestingEnum.This;
- string[] match = {"This", "Is", "A", "Test"};
- string[] names = Enum.GetNames(x.GetType());
- AssertNotNull("Got no names", names);
- AssertEquals("names wrong size",
- match.Length, names.Length);
- for (int i = 0; i < names.Length; i++) {
- AssertEquals("name mismatch",
- match[i], names[i]);
- }
- }
- }
-
- public void TestGetTypeCode() {
- TestingEnum x = TestingEnum.This;
- TestingEnum y = new TestingEnum();
- AssertEquals("01 bad type code",
- TypeCode.Int32, x.GetTypeCode());
- AssertEquals("02 bad type code",
- TypeCode.Int32, y.GetTypeCode());
- }
-
- enum TestShortEnum : short { zero, one, two, three, four, five, six};
- public void TestGetUnderlyingType() {
- {
- bool errorThrown = false;
- try {
- Enum.GetUnderlyingType(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.GetUnderlyingType(bad.GetType());
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- short sh = 5;
- int i = 5;
- Enum t1 = new TestingEnum();
- Enum t2 = new TestShortEnum();
- AssertEquals("Wrong default underlying type",
- i.GetType(),
- Enum.GetUnderlyingType(t1.GetType()));
- AssertEquals("Not short underlying type",
- sh.GetType(),
- Enum.GetUnderlyingType(t2.GetType()));
- }
- }
-
- public void TestGetValues() {
- {
- bool errorThrown = false;
- try {
- Enum.GetValues(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.GetValues(bad.GetType());
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- Enum t1 = new TestingEnum();
- Array a1 = Enum.GetValues(t1.GetType());
- for (int i= 0; i < a1.Length; i++) {
- AssertEquals("wrong enum value",
- (TestingEnum)i,
- a1.GetValue(i));
- }
- }
- {
- Enum t1 = new TestShortEnum();
- Array a1 = Enum.GetValues(t1.GetType());
- for (short i= 0; i < a1.Length; i++) {
- AssertEquals("wrong short enum value",
- (TestShortEnum)i,
- a1.GetValue(i));
- }
- }
- }
-
- public void TestIsDefined() {
- {
- bool errorThrown = false;
- try {
- Enum.IsDefined(null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.IsDefined(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- int i = 4;
- Enum.IsDefined(bad.GetType(), i);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
-
- try {
- TestingEnum x = TestingEnum.Test;
- short i = 4;
- Enum.IsDefined(x.GetType(), i);
- Fail("wrong underlying type not caught.");
- } catch (ArgumentException) {
- } catch (Exception e) {
- Fail("wrong Exception thrown ("+e.ToString()+")for underlying type not caught.");
- }
-
- // spec says yes, MS impl says no.
- //{
- //bool errorThrown = false;
- //try {
- //String bad = "huh?";
- //TestingEnum x = TestingEnum.Test;
- //Enum.IsDefined(x.GetType(), bad);
- //} catch (ExecutionEngineException) {
- //errorThrown = true;
- //}
- //Assert("non-enum object not caught.",
- //errorThrown);
- //}
- {
- Enum t1 = new TestingEnum();
- int i = 0;
- for (i = 0;
- i < Enum.GetValues(t1.GetType()).Length; i++) {
- Assert("should have value for i=" + i,
- Enum.IsDefined(t1.GetType(), i));
- }
- Assert("Shouldn't have value",
- !Enum.IsDefined(t1.GetType(), i));
- }
- }
-
- public void TestParse1() {
- {
- bool errorThrown = false;
- try {
- String name = "huh?";
- Enum.Parse(null, name);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- Enum.Parse(bad.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = "";
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = " ";
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("space-only string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("parse first enum",
- TestingEnum.This,
- Enum.Parse(t1.GetType(), "This"));
- AssertEquals("parse second enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "Is"));
- AssertEquals("parse third enum",
- TestingEnum.A,
- Enum.Parse(t1.GetType(), "A"));
- AssertEquals("parse last enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "Test"));
-
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "This,Is"));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,Test"));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,Is,A"));
- }
- }
- public void TestParse2() {
- {
- bool errorThrown = true;
- try {
- String name = "huh?";
- Enum.Parse(null, name, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null first arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), null, true);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null second arg not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "huh?";
- Enum.Parse(bad.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("non-enum type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = "";
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("empty string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- TestingEnum x = TestingEnum.Test;
- String bad = " ";
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("space-only string not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "huh?";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad, true);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- bool errorThrown = true;
- try {
- String bad = "test";
- TestingEnum x = TestingEnum.Test;
- Enum.Parse(x.GetType(), bad, false);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("not-in-enum error not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("parse first enum",
- TestingEnum.This,
- Enum.Parse(t1.GetType(), "this", true));
- AssertEquals("parse second enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "is", true));
- AssertEquals("parse third enum",
- TestingEnum.A,
- Enum.Parse(t1.GetType(), "a", true));
- AssertEquals("parse last enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "test", true));
-
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Is,
- Enum.Parse(t1.GetType(), "This,is", true));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,test", true));
- AssertEquals("parse bitwise-or enum",
- TestingEnum.Test,
- Enum.Parse(t1.GetType(), "This,is,A", true));
- }
- }
-
- public void TestToObject() {
- {
- bool errorThrown = false;
- try {
- Enum.ToObject(null, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- bool errorThrown = false;
- try {
- Enum.ToObject("huh?".GetType(), 1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("null type not caught.",
- errorThrown);
- }
- {
- TestingEnum t1 = new TestingEnum();
- AssertEquals("Should get object",
- TestingEnum.This,
- Enum.ToObject(t1.GetType(), 0));
- }
- // TODO - should probably test all the different underlying types
- }
-
- [Flags]
- enum SomeEnum {a,b,c};
-
- [Flags]
- enum SomeByteEnum : byte {a,b,c};
-
- [Flags]
- enum SomeInt64Enum : long {a,b,c};
-
- public void TestToString() {
- AssertEquals("invalid string", "This",
- TestingEnum.This.ToString());
- AssertEquals("invalid string", "Is",
- TestingEnum.Is.ToString());
- AssertEquals("invalid string", "A",
- TestingEnum.A.ToString());
- AssertEquals("invalid string", "Test",
- TestingEnum.Test.ToString());
-
- Enum is1 = TestingEnum.Is;
-
- AssertEquals("decimal parse wrong",
- "1", is1.ToString("d"));
- AssertEquals("named format wrong",
- "Is", is1.ToString("g"));
- AssertEquals("hex format wrong",
- "00000001", is1.ToString("x"));
- AssertEquals("bitfield format wrong",
- "Is", is1.ToString("f"));
-
-
- AssertEquals("bitfield with flags format wrong for Int32 enum",
- "b, c", ((SomeEnum)3).ToString("f"));
- AssertEquals("bitfield with flags format wrong for Byte enum",
- "b, c", ((SomeByteEnum)3).ToString("f"));
- AssertEquals("bitfield with flags format wrong for Int64 enum",
- "b, c", ((SomeInt64Enum)3).ToString("f"));
- }
-
- // TODO - ToString with IFormatProviders
-}
-}
diff --git a/mcs/class/corlib/Test/System/ExceptionTest.cs b/mcs/class/corlib/Test/System/ExceptionTest.cs
deleted file mode 100644
index d0f6b80f3f8..00000000000
--- a/mcs/class/corlib/Test/System/ExceptionTest.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// ExceptionTest.cs - NUnit Test Cases for the System.Exception class
-//
-// Linus Upson (linus@linus.com)
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System
-{
- public class ExceptionTest : TestCase
- {
- public ExceptionTest() : base ("MonoTests.System.ExceptionTest testsuite") {}
- public ExceptionTest(string name) : base(name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ExceptionTest));
- }
- }
-
- // This test makes sure that exceptions thrown on block boundaries are
- // handled in the correct block. The meaning of the 'caught' variable is
- // a little confusing since there are two catchers: the method being
- // tested the the method calling the test. There is probably a better
- // name, but I can't think of it right now.
-
- public void TestThrowOnBlockBoundaries()
- {
- bool caught;
-
- try {
- caught = false;
- ThrowBeforeTry();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown before try blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtBeginOfTry();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at begin of try blocks should be caught", !caught);
-
- try {
- caught = false;
- ThrowAtEndOfTry();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at end of try blocks should be caught", !caught);
-
- try {
- caught = false;
- ThrowAtBeginOfCatch();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at begin of catch blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtEndOfCatch();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at end of catch blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtBeginOfFinally();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at begin of finally blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAtEndOfFinally();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown at end of finally blocks should not be caught", caught);
-
- try {
- caught = false;
- ThrowAfterFinally();
- } catch {
- caught = true;
- }
- Assert("Exceptions thrown after finally blocks should not be caught", caught);
- }
-
- private static void DoNothing()
- {
- }
-
- private static void ThrowException()
- {
- throw new Exception();
- }
-
- private static void ThrowBeforeTry()
- {
- ThrowException();
- try {
- DoNothing();
- } catch (Exception) {
- DoNothing();
- }
- }
-
- private static void ThrowAtBeginOfTry()
- {
- DoNothing();
- try {
- ThrowException();
- DoNothing();
- } catch (Exception) {
- DoNothing();
- }
- }
-
- private static void ThrowAtEndOfTry()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- }
- }
-
- private static void ThrowAtBeginOfCatch()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- throw;
- }
- }
-
- private static void ThrowAtEndOfCatch()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- throw;
- }
- }
-
- private static void ThrowAtBeginOfFinally()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- } finally {
- ThrowException();
- DoNothing();
- }
- }
-
- private static void ThrowAtEndOfFinally()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- } finally {
- DoNothing();
- ThrowException();
- }
- }
-
- private static void ThrowAfterFinally()
- {
- DoNothing();
- try {
- DoNothing();
- ThrowException();
- } catch (Exception) {
- DoNothing();
- } finally {
- DoNothing();
- }
- ThrowException();
- }
- }
-}
diff --git a/mcs/class/corlib/Test/System/GuidTest.cs b/mcs/class/corlib/Test/System/GuidTest.cs
deleted file mode 100755
index e3b19008886..00000000000
--- a/mcs/class/corlib/Test/System/GuidTest.cs
+++ /dev/null
@@ -1,247 +0,0 @@
-//
-// GuidTest.cs - NUnit Test Cases for the System.Guid struct
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class GuidTest : TestCase
-{
- public GuidTest () : base ("MonoTests.System.GuidTest testcase") {}
- public GuidTest (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (GuidTest));
- }
- }
-
- public void TestCtor1 ()
- {
- Guid g = new Guid (new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f});
- bool exception;
-
- if (BitConverter.IsLittleEndian) {
- AssertEquals ("A1", "03020100-0504-0706-0809-0a0b0c0d0e0f", g.ToString ());
- }
- else {
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ());
- }
-
- try {
- Guid g1 = new Guid ((byte[]) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A2", exception);
-
- try {
- Guid g1 = new Guid (new byte[] {0x00, 0x01, 0x02});
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A3", exception);
- }
-
- public void TestCtor2 ()
- {
- Guid g1 = new Guid ("00010203-0405-0607-0809-0a0b0c0d0e0f");
- Guid g2 = new Guid ("{00010203-0405-0607-0809-0A0B0C0D0E0F}");
- Guid g3 = new Guid ("{0x00010203,0x0405,0x0607,{0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}}");
- Guid g4;
- Guid g5;
-
- bool exception;
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString ());
- AssertEquals ("A2", "00010203-0405-0607-0809-0a0b0c0d0e0f", g2.ToString ());
- AssertEquals ("A3", "00010203-0405-0607-0809-0a0b0c0d0e0f", g3.ToString ());
-
- try {
- g4 = new Guid ((string) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- try {
- g5 = new Guid ("invalid");
- exception = false;
- }
- catch (FormatException) {
- exception = true;
- }
- Assert ("A5", exception);
-
- }
-
- public void TestCtor4 ()
- {
- Guid g1 = new Guid (0x00010203, (short) 0x0405, (short) 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (unchecked ((int) 0xffffffff), unchecked ((short) 0xffff), unchecked((short) 0xffff), 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString ());
- AssertEquals ("A2", "ffffffff-ffff-ffff-ffff-ffffffffffff", g2.ToString ());
-
- }
-
- public void TestCtor5 ()
- {
- Guid g1 = new Guid (0x00010203u, (ushort) 0x0405u, (ushort) 0x0607u, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0xffffffffu, (ushort) 0xffffu, (ushort) 0xffffu, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff);
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g1.ToString ());
- AssertEquals ("A2", "ffffffff-ffff-ffff-ffff-ffffffffffff", g2.ToString ());
-
- }
-
- public void TestEmpty ()
- {
- AssertEquals ("A1", "00000000-0000-0000-0000-000000000000", Guid.Empty.ToString ());
- }
-
- public void TestNewGuid ()
- {
- Guid g1 = Guid.NewGuid ();
- Guid g2 = Guid.NewGuid ();
-
- Assert ("A1", g1 != g2);
- }
-
- public void TestEqualityOp ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
-
- AssertEquals ("A1", true, g1 == g1);
- AssertEquals ("A2", true, g1 == g2);
- AssertEquals ("A3", false, g1 == g3);
- }
-
- public void TestInequalityOp ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
-
- AssertEquals ("A1", false, g1 != g1);
- AssertEquals ("A2", false, g1 != g2);
- AssertEquals ("A3", true, g1 != g3);
- }
-
- public void TestEquals ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x11223344, 0x5566, 0x6677, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff);
- string s = "This is not a Guid!";
-
- AssertEquals ("A1", true, g1.Equals (g1));
- AssertEquals ("A2", true, g1.Equals (g2));
- AssertEquals ("A3", false, g1.Equals (g3));
- AssertEquals ("A4", false, g1.Equals (null));
- AssertEquals ("A5", false, g1.Equals (s));
- }
-
- public void TestCompareTo ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g2 = new Guid (0x00010204, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g3 = new Guid (0x00010203, 0x0405, 0x0607, 0x09, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- Guid g4 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x1f);
- bool exception;
-
- Assert ("A1", g1.CompareTo (g2) < 0);
- Assert ("A2", g1.CompareTo (g3) < 0);
- Assert ("A3", g1.CompareTo (g4) < 0);
- Assert ("A4", g2.CompareTo (g1) > 0);
- Assert ("A5", g3.CompareTo (g1) > 0);
- Assert ("A6", g4.CompareTo (g1) > 0);
- Assert ("A7", g1.CompareTo (g1) == 0);
- Assert ("A8", g1.CompareTo (null) > 0);
-
- try {
- g1.CompareTo ("Say what?");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A9", exception);
- }
-
- public void TestGetHashCode ()
- {
- // We don't test anything but the availibility of this member
- int res = Guid.NewGuid ().GetHashCode ();
-
- Assert ("A1", true);
- }
-
- public void TestToByteArray ()
- {
- Guid g1 = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- byte[] b = g1.ToByteArray ();
-
- AssertEquals ("A1", 0x00010203, BitConverter.ToInt32 (b, 0));
- AssertEquals ("A2", (short) 0x0405, BitConverter.ToInt16 (b, 4));
- AssertEquals ("A3", (short) 0x0607, BitConverter.ToInt16 (b, 6));
- for (int i=8; i<16; ++i) {
- AssertEquals ("A1", (byte) i, b [i]);
- }
-
- }
-
- public void TestToString ()
- {
- Guid g = new Guid (0x00010203, 0x0405, 0x0607, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
- bool exception;
-
- AssertEquals ("A1", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ());
- AssertEquals ("A2", "000102030405060708090a0b0c0d0e0f", g.ToString ("N"));
- AssertEquals ("A3", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ("D"));
- AssertEquals ("A4", "{00010203-0405-0607-0809-0a0b0c0d0e0f}", g.ToString ("B"));
- AssertEquals ("A5", "(00010203-0405-0607-0809-0a0b0c0d0e0f)", g.ToString ("P"));
- AssertEquals ("A6", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString (""));
- AssertEquals ("A7", "00010203-0405-0607-0809-0a0b0c0d0e0f", g.ToString ((string)null));
-
- try {
- g.ToString ("X");
- exception = false;
- }
- catch (FormatException) {
- exception = true;
- }
- Assert ("A8", exception);
-
- try {
- g.ToString ("This is invalid");
- exception = false;
- }
- catch (FormatException) {
- exception = true;
- }
- Assert ("A9", exception);
-
- AssertEquals ("A10", "{00010203-0405-0607-0809-0a0b0c0d0e0f}", g.ToString ("B", null));
-
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int16Test.cs b/mcs/class/corlib/Test/System/Int16Test.cs
deleted file mode 100644
index 717b35420b6..00000000000
--- a/mcs/class/corlib/Test/System/Int16Test.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-// Int16Test.cs - NUnit Test Cases for the System.Int16 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class Int16Test : TestCase
-{
- private const Int16 MyInt16_1 = -42;
- private const Int16 MyInt16_2 = -32768;
- private const Int16 MyInt16_3 = 32767;
- private const string MyString1 = "-42";
- private const string MyString2 = "-32768";
- private const string MyString3 = "32767";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {null, "-32768", "-3.276800e+004", "-32768.00",
- "-32768", "-32,768.00", "-3,276,800.00 %", "8000"};
- private string[] Results2 = {null, "32767", "3.27670e+004", "32767.00000",
- "32767", "32,767.00000", "3,276,700.00000 %", "07fff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"32,768.00)", "-32768", "-3.276800e+004", "-32768.00",
- "-32768", "-32,768.00", "-3,276,800.00 %", "8000"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"32,767.00000", "32767", "3.27670e+004", "32767.00000",
- "32767", "32,767.00000", "3,276,700.00000 %", "07fff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public Int16Test() : base ("MonoTests.System.Int16Test testcase") {}
- public Int16Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = "("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"32,768.00)";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"32,767.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(Int16Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(Int16.MinValue, MyInt16_2);
- AssertEquals(Int16.MaxValue, MyInt16_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyInt16_3.CompareTo(MyInt16_2) > 0);
- Assert(MyInt16_2.CompareTo(MyInt16_2) == 0);
- Assert(MyInt16_1.CompareTo((Int16)(-42)) == 0);
- Assert(MyInt16_2.CompareTo(MyInt16_3) < 0);
- try {
- MyInt16_2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyInt16_1.Equals(MyInt16_1));
- Assert(MyInt16_1.Equals((Int16)(-42)));
- Assert(MyInt16_1.Equals((SByte)(-42)) == false);
- Assert(MyInt16_1.Equals(MyInt16_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt16_1.GetHashCode();
- MyInt16_2.GetHashCode();
- MyInt16_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyInt16_1 == Int16.Parse(MyString1));
- Assert(MyInt16_2 == Int16.Parse(MyString2));
- Assert(MyInt16_3 == Int16.Parse(MyString3));
- try {
- Int16.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Int16.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = Int16.MaxValue + 1;
- Int16.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == Int16.Parse(" $42 ", NumberStyles.Currency));
- try {
- Int16.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == Int16.Parse(" -42 ", Nfi));
- try {
- Int16.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == Int16.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int16.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- Assert(String.Compare(MyString1, MyInt16_1.ToString()) == 0);
- Assert(String.Compare(MyString2, MyInt16_2.ToString()) == 0);
- Assert(String.Compare(MyString3, MyInt16_3.ToString()) == 0);
- //test ToString(string format)
- /*
- TODO: These tests are culture sensitive. Need to find a way to determine the culture
- of the system to decide the correct expected result.
- for (int i=0; i < Formats1.Length; i++) {
- Assert(String.Compare(Results1[i], MyInt16_2.ToString(Formats1[i])) == 0);
- Assert(String.Compare(Results2[i], MyInt16_3.ToString(Formats2[i])) == 0);
- }
- */
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MyInt16_2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MyInt16_2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MyInt16_2.ToString(Formats1[i], Nfi)) == 0);
- Assert("i="+i+", ResultsNfi2[i]="+ResultsNfi2[i]+", MyInt16_3.ToString(Formats2[i]="+Formats2[i]+"): Expected "+ResultsNfi2[i]+" but got "+MyInt16_3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MyInt16_3.ToString(Formats2[i], Nfi)) == 0);
- }
- try {
- MyInt16_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int32Test.cs b/mcs/class/corlib/Test/System/Int32Test.cs
deleted file mode 100644
index a74247b2d35..00000000000
--- a/mcs/class/corlib/Test/System/Int32Test.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-// Int32Test.cs - NUnit Test Cases for the System.Int32 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class Int32Test : TestCase
-{
- private const Int32 MyInt32_1 = -42;
- private const Int32 MyInt32_2 = -2147483648;
- private const Int32 MyInt32_3 = 2147483647;
- private const string MyString1 = "-42";
- private const string MyString2 = "-2147483648";
- private const string MyString3 = "2147483647";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {null,
- "-2147483648", "-2.147484e+009", "-2147483648.00",
- "-2147483648", "-2,147,483,648.00", "-214,748,364,800.00 %", "80000000"};
- private string[] Results2 = {null,
- "2147483647", "2.14748e+009", "2147483647.00000",
- "2.1475e+09", "2,147,483,647.00000", "214,748,364,700.00000 %", "7fffffff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"2,147,483,648.00)",
- "-2147483648", "-2.147484e+009", "-2147483648.00",
- "-2147483648", "-2,147,483,648.00", "-214,748,364,800.00 %", "80000000"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"2,147,483,647.00000",
- "2147483647", "2.14748e+009", "2147483647.00000",
- "2.1475e+09", "2,147,483,647.00000", "214,748,364,700.00000 %", "7fffffff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public Int32Test() : base ("MonoTests.System.Int32Test testcase") {}
- public Int32Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = "("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,648.00)";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"2,147,483,647.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(Int32Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals("#A01", Int32.MinValue, MyInt32_2);
- AssertEquals("#A02", Int32.MaxValue, MyInt32_3);
- }
-
- public void TestCompareTo()
- {
- Assert("MyInt32_3.CompareTo(MyInt32_2) > 0", MyInt32_3.CompareTo(MyInt32_2) > 0);
- Assert("MyInt32_2.CompareTo(MyInt32_2) == 0", MyInt32_2.CompareTo(MyInt32_2) == 0);
- Assert("MyInt32_1.CompareTo((Int32)(-42)) == 0", MyInt32_1.CompareTo((Int32)(-42)) == 0);
- Assert("MyInt32_2.CompareTo(MyInt32_3) < 0", MyInt32_2.CompareTo(MyInt32_3) < 0);
- try {
- MyInt32_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert("typeof(ArgumentException) == e.GetType()", typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert ("#B01", MyInt32_1.Equals (MyInt32_1));
- Assert ("#B02", MyInt32_1.Equals ((Int32)(-42)));
- Assert ("#B03", MyInt32_1.Equals ((SByte)(-42)) == false);
- Assert ("#B04", MyInt32_1.Equals (MyInt32_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt32_1.GetHashCode();
- MyInt32_2.GetHashCode();
- MyInt32_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- AssertEquals ("#C01", MyInt32_1, Int32.Parse (MyString1));
- AssertEquals ("#C02", MyInt32_2, Int32.Parse (MyString2));
- AssertEquals ("#C03", MyInt32_3, Int32.Parse (MyString3));
-
- AssertEquals ("#C04", 1, Int32.Parse ("1"));
- AssertEquals ("#C05", 1, Int32.Parse (" 1"));
- AssertEquals ("#C06", 1, Int32.Parse (" 1"));
- AssertEquals ("#C07", 1, Int32.Parse ("1 "));
- AssertEquals ("#C08", 1, Int32.Parse ("+1"));
- AssertEquals ("#C09", -1, Int32.Parse ("-1"));
- AssertEquals ("#C10", -1, Int32.Parse (" -1"));
- AssertEquals ("#C11", -1, Int32.Parse (" -1 "));
- AssertEquals ("#C12", -1, Int32.Parse (" -1 "));
-
- try {
- Int32.Parse(null);
- Fail ("#C13: Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert ("#C14", typeof (ArgumentNullException) == e.GetType());
- }
- try {
- Int32.Parse("not-a-number");
- Fail ("#C15: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#C16", typeof (FormatException) == e.GetType());
- }
- try {
- double OverInt = (double)Int32.MaxValue + 1;
- Int32.Parse(OverInt.ToString());
- Fail ("#C17: Should raise a System.OverflowException");
- }
- catch (Exception e) {
- AssertEquals ("#C18", typeof (OverflowException), e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- AssertEquals ("#C19", 42, Int32.Parse (" $42 ", NumberStyles.Currency));
- try {
- Int32.Parse("$42", NumberStyles.Integer);
- Fail ("#C20: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#C21", typeof (FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- AssertEquals ("#C22", -42, Int32.Parse (" -42 ", Nfi));
- try {
- Int32.Parse("%42", Nfi);
- Fail ("#C23: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#C24", typeof (FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- AssertEquals ("#C25", 16, Int32.Parse (" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int32.Parse("$42", NumberStyles.Integer, Nfi);
- Fail ("#C26: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("#C27", typeof (FormatException) == e.GetType());
- }
-
- try {
- Int32.Parse (" - 1 ");
- Fail ("#C28: Should raise FormatException");
- } catch (Exception e){
- Assert ("#C29", typeof (FormatException) == e.GetType ());
- }
-
- try {
- Int32.Parse (" - ");
- Fail ("#C30: Should raise FormatException");
- } catch (Exception e){
- Assert ("#C31", typeof (FormatException) == e.GetType ());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals ("#D01", MyString1, MyInt32_1.ToString ());
- AssertEquals ("#D02", MyString2, MyInt32_2.ToString ());
- AssertEquals ("#D03", MyString3, MyInt32_3.ToString ());
-
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals ("#D04(" + i + "," + Formats1 [i] + ")",
- ResultsNfi1 [i], MyInt32_2.ToString (Formats1 [i], Nfi));
- AssertEquals ("#D05(" + i + "," + Formats2 [i] + ")",
- ResultsNfi2 [i], MyInt32_3.ToString (Formats2 [i], Nfi));
- }
-
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals ("#D06(" + i + ")", Results1 [i],
- MyInt32_2.ToString(Formats1[i]));
- AssertEquals ("#D07(" + i + ")", Results2 [i],
- MyInt32_3.ToString(Formats2[i]));
- }
-
- try {
- MyInt32_1.ToString("z");
- Fail ("#D08: Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert ("#D09", typeof (FormatException) == e.GetType());
- }
- }
-
- public void TestCustomToString()
- {
- // FIXME: Not yet implemented.
-#if NOTYET
- // culture sensitive?
-
- int i = 123;
-
- AssertEquals ("Custom format string 00000", "00123", i.ToString ("00000"));
- AssertEquals ("Custom format string ####", "123", i.ToString ("####"));
-#endif
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/Int64Test.cs b/mcs/class/corlib/Test/System/Int64Test.cs
deleted file mode 100644
index 173f8185430..00000000000
--- a/mcs/class/corlib/Test/System/Int64Test.cs
+++ /dev/null
@@ -1,363 +0,0 @@
-// Int64Test.cs - NUnit Test Cases for the System.Int64 struct
-//
-// Author: Martin Weindel (martin.weindel@t-online.de)
-//
-// (C) Martin Weindel, 2001
-//
-// tests ToString and Parse function with the culture independent
-// NumberFormatInfo.InvariantInfo
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
- /// <summary>
- /// Tests for System.Int64
- /// </summary>
-namespace MonoTests.System
-{
-
-public class Int64Test : TestCase
-{
- private const Int64 MyInt64_1 = -42;
- private const Int64 MyInt64_2 = -9223372036854775808;
- private const Int64 MyInt64_3 = 9223372036854775807;
- private const string MyString1 = "-42";
- private const string MyString2 = "-9223372036854775808";
- private const string MyString3 = "9223372036854775807";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"", "-9223372036854775808", "-9.223372e+018", "-9223372036854775808.00",
- "-9223372036854775808", "-9,223,372,036,854,775,808.00", "-922,337,203,685,477,580,800.00 %", "8000000000000000"};
- private string[] Results2 = {"", "9223372036854775807", "9.22337e+018", "9223372036854775807.00000",
- "9.2234e+18", "9,223,372,036,854,775,807.00000", "922,337,203,685,477,580,700.00000 %", "7fffffffffffffff"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"9,223,372,036,854,775,808.00)", "-9223372036854775808", "-9.223372e+018", "-9223372036854775808.00",
- "-9223372036854775808", "-9,223,372,036,854,775,808.00", "-922,337,203,685,477,580,800.00 %", "8000000000000000"};
- private string[] ResultsNfi2 = {""+NumberFormatInfo.InvariantInfo.CurrencySymbol+"9,223,372,036,854,775,807.00000", "9223372036854775807", "9.22337e+018", "9223372036854775807.00000",
- "9.2234e+18", "9,223,372,036,854,775,807.00000", "922,337,203,685,477,580,700.00000 %", "7fffffffffffffff"};
-
- // FIXME: This is failing with an ArgumentException. Seems to be related to the number of elements in the arrary,
- // not the values themselves
-/* private long[] vals
- = { 0, Int64.MaxValue, Int64.MinValue,
- 1L, 12L, 123L, 1234L, -123L,
- 1234567890123456L, 6543210987654321L };
-*/
- private long[] vals
- = { 0, Int64.MaxValue, Int64.MinValue };
-
- private const long val1 = -1234567L;
- private const long val2 = 1234567L;
- private const string sval1Test1 = " -1,234,567 ";
- private const string sval1Test2 = " -1234567 ";
- //private const string sval1Test3 = " -12345,,,,67 "; // interesting: this case works on SDK Beta2, but the specification says nothing about this case
- private const string sval1Test4 = " -12345 67 ";
- private string sval1Test5 = " -"+NumberFormatInfo.InvariantInfo.CurrencySymbol+"1,234,567.00 ";
- private string sval1Test6 = "("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"1,234,567.00)";
- private const string sval1Test7 = "-1,234,567.00";
- private const string sval1UserCur1 = "1234/5/67:000 XYZ-";
- private const string sval2UserCur1 = "1234/5/67:000 XYZ";
- private const string sval1UserPercent1 = "-%%%1~2~3~4~5~6~7~0~0;0";
- private const string sval2UserPercent1 = "%%%1~2~3~4~5~6~7~0~0;0";
- private const NumberStyles style1 = NumberStyles.AllowLeadingWhite | NumberStyles.AllowLeadingSign
- | NumberStyles.AllowTrailingWhite | NumberStyles.AllowThousands;
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
- private NumberFormatInfo NfiUser;
-
- public Int64Test() : base("MonoTests.System.Int64Test") {}
- public Int64Test(string name) : base(name) {}
-
- public static ITest Suite
- {
- get { return new TestSuite(typeof(Int64Test)); }
- }
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- int cdd = NumberFormatInfo.CurrentInfo.CurrencyDecimalDigits;
- string csym = NumberFormatInfo.CurrentInfo.CurrencySymbol;
- string csuffix = (cdd > 0 ? "." : "").PadRight(cdd + (cdd > 0 ? 1 : 0), '0');
- Results1[0] = "(" + csym + "9,223,372,036,854,775,808" + csuffix + ")";
- Results2[0] = csym + "9,223,372,036,854,775,807.00000";
- NfiUser = new NumberFormatInfo();
- NfiUser.CurrencyDecimalDigits = 3;
- NfiUser.CurrencyDecimalSeparator = ":";
- NfiUser.CurrencyGroupSeparator = "/";
- NfiUser.CurrencyGroupSizes = new int[] { 2,1,0 };
- NfiUser.CurrencyNegativePattern = 10; // n $-
- NfiUser.CurrencyPositivePattern = 3; // n $
- NfiUser.CurrencySymbol = "XYZ";
- NfiUser.PercentDecimalDigits = 1;
- NfiUser.PercentDecimalSeparator = ";";
- NfiUser.PercentGroupSeparator = "~";
- NfiUser.PercentGroupSizes = new int[] {1};
- NfiUser.PercentNegativePattern = 2;
- NfiUser.PercentPositivePattern = 2;
- NfiUser.PercentSymbol = "%%%";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(Int64.MinValue, MyInt64_2);
- AssertEquals(Int64.MaxValue, MyInt64_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyInt64_3.CompareTo(MyInt64_2) > 0);
- Assert(MyInt64_2.CompareTo(MyInt64_2) == 0);
- Assert(MyInt64_1.CompareTo((Int64)(-42)) == 0);
- Assert(MyInt64_2.CompareTo(MyInt64_3) < 0);
- try {
- MyInt64_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyInt64_1.Equals(MyInt64_1));
- Assert(MyInt64_1.Equals((Int64)(-42)));
- Assert(MyInt64_1.Equals((SByte)(-42)) == false);
- Assert(MyInt64_1.Equals(MyInt64_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyInt64_1.GetHashCode();
- MyInt64_2.GetHashCode();
- MyInt64_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestRoundTripGeneral()
- {
- foreach(long lv in vals)
- {
- string s = lv.ToString(Nfi);
- long lv2 = Int64.Parse(s);
- Assert(lv == lv2);
- long lv3 = Int64.Parse(s, NumberStyles.Integer, Nfi);
- Assert(lv == lv3);
- }
- }
-
- public void TestRoundTripHex()
- {
- foreach(long lv in vals)
- {
- string s = lv.ToString("x", Nfi);
- long lv2 = Int64.Parse(s, NumberStyles.HexNumber, Nfi);
- Assert(lv == lv2);
- }
- }
-
- public void TestParseNull()
- {
- try
- {
- Int64.Parse(null);
- Fail("Should raise System.ArgumentNullException");
- }
- catch (ArgumentNullException)
- {
- // ok
- }
- }
-
- public void TestParse()
- {
- long lv;
-
- lv = Int64.Parse(sval1Test1, style1, Nfi);
- AssertEquals("Long value should be equal for Test1", val1, lv);
-
- try
- {
- lv = Int64.Parse(sval1Test1, Nfi);
- Fail("Should raise FormatException 1");
- }
- catch (FormatException)
- {
- // ok
- }
-
- lv = Int64.Parse(sval1Test2, style1, Nfi);
- AssertEquals("Value should be the same for Test2 with style1", val1, lv);
- lv = Int64.Parse(sval1Test2, Nfi);
- AssertEquals("Value should be the same for Test2 without style1", val1, lv);
-
- try
- {
- lv = Int64.Parse(sval1Test4, style1, Nfi);
- Fail("Should raise FormatException 3");
- }
- catch (FormatException)
- {
- // ok
- }
-
- lv = Int64.Parse(sval1Test5, NumberStyles.Currency, Nfi);
- AssertEquals("Value should be the same for Test5 and currency style", val1, lv);
-
- //test Parse(string s)
- Assert(MyInt64_1 == Int64.Parse(MyString1));
- Assert(MyInt64_2 == Int64.Parse(MyString2));
- Assert(MyInt64_3 == Int64.Parse(MyString3));
- try {
- Int64.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- Int64.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- try {
- double OverInt = (double)Int64.MaxValue + 1;
- Int64.Parse(OverInt.ToString(), NumberStyles.Float);
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- try {
- double OverInt = (double)Int64.MaxValue + 1;
- Int64.Parse(OverInt.ToString(), NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- AssertEquals("A1", (long)42, Int64.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- Int64.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == Int64.Parse(" -42 ", Nfi));
- try {
- Int64.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == Int64.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- Int64.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- string s;
-
- s = val1.ToString("c", Nfi);
- Assert("val1 does not become sval1Test6", s.Equals(sval1Test6));
-
- s = val1.ToString("n", Nfi);
- AssertEquals("val1 does not become sval1Test7", sval1Test7, s);
-
- //test ToString()
- AssertEquals("MyInt64_1.ToString()", MyString1, MyInt64_1.ToString());
- AssertEquals("MyInt64_2.ToString()", MyString2, MyInt64_2.ToString());
- AssertEquals("MyInt64_3.ToString()", MyString3, MyInt64_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("MyInt64_2.ToString(Formats1["+i+"])", Results1[i], MyInt64_2.ToString(Formats1[i]));
- AssertEquals("MyInt64_3.ToString(Formats2["+i+"])", Results2[i], MyInt64_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("MyInt64_2.ToString(Formats1["+i+"], Nfi)", ResultsNfi1[i], MyInt64_2.ToString(Formats1[i], Nfi));
- AssertEquals("MyInt64_3.ToString(Formats2["+i+"], Nfi)", ResultsNfi2[i], MyInt64_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyInt64_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- AssertEquals("Exception is wrong type", typeof(FormatException), e.GetType());
- }
- }
-
- public void TestUserCurrency()
- {
- string s= "";
- long v;
- int iTest = 1;
- try {
- s = val1.ToString("c", NfiUser);
- iTest++;
- AssertEquals("Currency value type 1 is not what we want to try to parse", sval1UserCur1, s);
- iTest++;
- v = Int64.Parse(s, NumberStyles.Currency, NfiUser);
- iTest++;
- Assert(v == val1);
- } catch (Exception e) {
- Fail ("1 Unexpected exception at iTest = " + iTest + ", s = " + s + ":e = " + e);
- }
-
- iTest = 1;
- try {
- s = val2.ToString("c", NfiUser);
- iTest++;
- AssertEquals("Currency value type 2 is not what we want to try to parse", sval2UserCur1, s);
- iTest++;
- v = Int64.Parse(s, NumberStyles.Currency, NfiUser);
- iTest++;
- Assert(v == val2);
- } catch (Exception e) {
- Fail ("2 Unexpected exception at iTest = " + iTest + ":e = " + e);
- }
- }
-
- public void TestUserPercent()
- {
- string s;
-
- s = val1.ToString("p", NfiUser);
- Assert(s.Equals(sval1UserPercent1));
-
- s = val2.ToString("p", NfiUser);
- Assert(s.Equals(sval2UserPercent1));
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs b/mcs/class/corlib/Test/System/IntegerFormatterTest.cs
deleted file mode 100644
index 33f352aecf9..00000000000
--- a/mcs/class/corlib/Test/System/IntegerFormatterTest.cs
+++ /dev/null
@@ -1,2016 +0,0 @@
-//
-// IntegerFormatterTest.cs - NUnit Test Cases for System.IntegerFormatter
-//
-// Author:
-// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.IO;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class IntegerFormatterTest : TestCase
-{
- private const int INT32 = 0;
- private const int INT64 = 1;
- private const int UINT32 = 2;
- private const int UINT64 = 3;
- private int testType;
-
- public IntegerFormatterTest () :
- base ("[MonoTests.System.IntegerFormatterTest]") {}
-
- public IntegerFormatterTest (string name) : base (name) {}
-
- protected override void SetUp () {}
-
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(IntegerFormatterTest));
- }
- }
-
- public void TestStandard ()
- {
- // Make the test Culture insensitive
- NumberFormatInfo nfi = new NumberFormatInfo ();
- nfi.CurrencySymbol = "$";
-
- StringReader sr = new StringReader (tutti);
-
- string inputLine;
- while ((inputLine = sr.ReadLine ()) != null) {
- if (inputLine.IndexOf ('(') != -1)
- ProcessLine (inputLine, nfi);
- else
- ChangeType (inputLine);
- }
-
- sr.Close ();
- }
-
- private void ProcessLine (string testLine, NumberFormatInfo nfi)
- {
- string number = "0";
- string format = "X";
- string expected = "XXX";
- int idxStart;
- int idxEnd;
-
- idxStart = testLine.IndexOf ('(');
- if (idxStart != -1){
- idxStart++;
- idxEnd = testLine.IndexOf (')');
- number = testLine.Substring (idxStart,
- idxEnd - idxStart);
- }
-
- idxStart = testLine.IndexOf ('(', idxStart);
- if (idxStart != -1) {
- idxStart++;
- idxEnd = testLine.IndexOf (')', idxStart);
- format = testLine.Substring (idxStart,
- idxEnd - idxStart);
- }
-
- idxStart = testLine.IndexOf ('(', idxStart);
- if (idxStart != -1) {
- idxStart++;
- idxEnd = testLine.LastIndexOf (')');
- expected = testLine.Substring (idxStart,
- idxEnd - idxStart);
- }
-
- DoTest (number, format, expected, nfi);
- }
-
- private void DoTest (string number,
- string format,
- string expected,
- NumberFormatInfo nfi)
- {
- string id = number + " " + format;
-
- switch (testType) {
- case INT32:
- int i32 = Int32.Parse (number, nfi);
- AssertEquals(id, expected, i32.ToString (format, nfi));
- break;
- case INT64:
- long i64 = Int64.Parse (number, nfi);
- AssertEquals(id, expected, i64.ToString (format, nfi));
- break;
- case UINT32:
- uint ui32 = UInt32.Parse (number, nfi);
- AssertEquals(id, expected, ui32.ToString (format, nfi));
- break;
- case UINT64:
- ulong ui64 = UInt64.Parse (number, nfi);
- AssertEquals(id, expected, ui64.ToString (format, nfi));
- break;
- }
- }
-
- private void ChangeType (string newType)
- {
- if (newType == "Int32")
- testType = INT32;
- else if (newType == "Int64")
- testType = INT64;
- else if (newType == "UInt32")
- testType = UINT32;
- else if (newType == "UInt64")
- testType = UINT64;
- else throw new Exception ("Test of type '" + newType + "' not supported.");
-
- }
-
- private static string tutti = "Int32\n" +
-"(-2147483648) (C) (($2,147,483,648.00))\n" +
-"(-2147483648) (C0) (($2,147,483,648))\n" +
-"(-2147483648) (C1) (($2,147,483,648.0))\n" +
-"(-2147483648) (C2) (($2,147,483,648.00))\n" +
-"(-2147483648) (C3) (($2,147,483,648.000))\n" +
-"(-2147483648) (C4) (($2,147,483,648.0000))\n" +
-"(-2147483648) (C5) (($2,147,483,648.00000))\n" +
-"(-2147483648) (C6) (($2,147,483,648.000000))\n" +
-"(-2147483648) (C7) (($2,147,483,648.0000000))\n" +
-"(-2147483648) (C8) (($2,147,483,648.00000000))\n" +
-"(-2147483648) (C9) (($2,147,483,648.000000000))\n" +
-"(-2147483648) (C10) (($2,147,483,648.0000000000))\n" +
-"(-2147483648) (C99) (($2,147,483,648.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-2147483648) (D) (-2147483648)\n" +
-"(-2147483648) (D0) (-2147483648)\n" +
-"(-2147483648) (D1) (-2147483648)\n" +
-"(-2147483648) (D2) (-2147483648)\n" +
-"(-2147483648) (D3) (-2147483648)\n" +
-"(-2147483648) (D4) (-2147483648)\n" +
-"(-2147483648) (D5) (-2147483648)\n" +
-"(-2147483648) (D6) (-2147483648)\n" +
-"(-2147483648) (D7) (-2147483648)\n" +
-"(-2147483648) (D8) (-2147483648)\n" +
-"(-2147483648) (D9) (-2147483648)\n" +
-"(-2147483648) (D10) (-2147483648)\n" +
-"(-2147483648) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002147483648)\n" +
-"(-2147483648) (E) (-2.147484E+009)\n" +
-"(-2147483648) (E0) (-2E+009)\n" +
-"(-2147483648) (E1) (-2.1E+009)\n" +
-"(-2147483648) (E2) (-2.15E+009)\n" +
-"(-2147483648) (E3) (-2.147E+009)\n" +
-"(-2147483648) (E4) (-2.1475E+009)\n" +
-"(-2147483648) (E5) (-2.14748E+009)\n" +
-"(-2147483648) (E6) (-2.147484E+009)\n" +
-"(-2147483648) (E7) (-2.1474836E+009)\n" +
-"(-2147483648) (E8) (-2.14748365E+009)\n" +
-"(-2147483648) (E9) (-2.147483648E+009)\n" +
-"(-2147483648) (E10) (-2.1474836480E+009)\n" +
-"(-2147483648) (E99) (-2.147483648000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+009)\n" +
-"(-2147483648) (F) (-2147483648.00)\n" +
-"(-2147483648) (F0) (-2147483648)\n" +
-"(-2147483648) (F1) (-2147483648.0)\n" +
-"(-2147483648) (F2) (-2147483648.00)\n" +
-"(-2147483648) (F3) (-2147483648.000)\n" +
-"(-2147483648) (F4) (-2147483648.0000)\n" +
-"(-2147483648) (F5) (-2147483648.00000)\n" +
-"(-2147483648) (F6) (-2147483648.000000)\n" +
-"(-2147483648) (F7) (-2147483648.0000000)\n" +
-"(-2147483648) (F8) (-2147483648.00000000)\n" +
-"(-2147483648) (F9) (-2147483648.000000000)\n" +
-"(-2147483648) (F10) (-2147483648.0000000000)\n" +
-"(-2147483648) (F99) (-2147483648.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-2147483648) (G) (-2147483648)\n" +
-"(-2147483648) (G0) (-2147483648)\n" +
-"(-2147483648) (G1) (-2E+09)\n" +
-"(-2147483648) (G2) (-2.1E+09)\n" +
-"(-2147483648) (G3) (-2.15E+09)\n" +
-"(-2147483648) (G4) (-2.147E+09)\n" +
-"(-2147483648) (G5) (-2.1475E+09)\n" +
-"(-2147483648) (G6) (-2.14748E+09)\n" +
-"(-2147483648) (G7) (-2.147484E+09)\n" +
-"(-2147483648) (G8) (-2.1474836E+09)\n" +
-"(-2147483648) (G9) (-2.14748365E+09)\n" +
-"(-2147483648) (G10) (-2147483648)\n" +
-"(-2147483648) (G99) (-2147483648)\n" +
-"(-2147483648) (N) (-2,147,483,648.00)\n" +
-"(-2147483648) (N0) (-2,147,483,648)\n" +
-"(-2147483648) (N1) (-2,147,483,648.0)\n" +
-"(-2147483648) (N2) (-2,147,483,648.00)\n" +
-"(-2147483648) (N3) (-2,147,483,648.000)\n" +
-"(-2147483648) (N4) (-2,147,483,648.0000)\n" +
-"(-2147483648) (N5) (-2,147,483,648.00000)\n" +
-"(-2147483648) (N6) (-2,147,483,648.000000)\n" +
-"(-2147483648) (N7) (-2,147,483,648.0000000)\n" +
-"(-2147483648) (N8) (-2,147,483,648.00000000)\n" +
-"(-2147483648) (N9) (-2,147,483,648.000000000)\n" +
-"(-2147483648) (N10) (-2,147,483,648.0000000000)\n" +
-"(-2147483648) (N99) (-2,147,483,648.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-2147483648) (P) (-214,748,364,800.00 %)\n" +
-"(-2147483648) (P0) (-214,748,364,800 %)\n" +
-"(-2147483648) (P1) (-214,748,364,800.0 %)\n" +
-"(-2147483648) (P2) (-214,748,364,800.00 %)\n" +
-"(-2147483648) (P3) (-214,748,364,800.000 %)\n" +
-"(-2147483648) (P4) (-214,748,364,800.0000 %)\n" +
-"(-2147483648) (P5) (-214,748,364,800.00000 %)\n" +
-"(-2147483648) (P6) (-214,748,364,800.000000 %)\n" +
-"(-2147483648) (P7) (-214,748,364,800.0000000 %)\n" +
-"(-2147483648) (P8) (-214,748,364,800.00000000 %)\n" +
-"(-2147483648) (P9) (-214,748,364,800.000000000 %)\n" +
-"(-2147483648) (P10) (-214,748,364,800.0000000000 %)\n" +
-"(-2147483648) (P99) (-214,748,364,800.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-2147483648) (X) (80000000)\n" +
-"(-2147483648) (X0) (80000000)\n" +
-"(-2147483648) (X1) (80000000)\n" +
-"(-2147483648) (X2) (80000000)\n" +
-"(-2147483648) (X3) (80000000)\n" +
-"(-2147483648) (X4) (80000000)\n" +
-"(-2147483648) (X5) (80000000)\n" +
-"(-2147483648) (X6) (80000000)\n" +
-"(-2147483648) (X7) (80000000)\n" +
-"(-2147483648) (X8) (80000000)\n" +
-"(-2147483648) (X9) (080000000)\n" +
-"(-2147483648) (X10) (0080000000)\n" +
-"(-2147483648) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000)\n" +
-"(2147483647) (C) ($2,147,483,647.00)\n" +
-"(2147483647) (C0) ($2,147,483,647)\n" +
-"(2147483647) (C1) ($2,147,483,647.0)\n" +
-"(2147483647) (C2) ($2,147,483,647.00)\n" +
-"(2147483647) (C3) ($2,147,483,647.000)\n" +
-"(2147483647) (C4) ($2,147,483,647.0000)\n" +
-"(2147483647) (C5) ($2,147,483,647.00000)\n" +
-"(2147483647) (C6) ($2,147,483,647.000000)\n" +
-"(2147483647) (C7) ($2,147,483,647.0000000)\n" +
-"(2147483647) (C8) ($2,147,483,647.00000000)\n" +
-"(2147483647) (C9) ($2,147,483,647.000000000)\n" +
-"(2147483647) (C10) ($2,147,483,647.0000000000)\n" +
-"(2147483647) (C99) ($2,147,483,647.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(2147483647) (D) (2147483647)\n" +
-"(2147483647) (D0) (2147483647)\n" +
-"(2147483647) (D1) (2147483647)\n" +
-"(2147483647) (D2) (2147483647)\n" +
-"(2147483647) (D3) (2147483647)\n" +
-"(2147483647) (D4) (2147483647)\n" +
-"(2147483647) (D5) (2147483647)\n" +
-"(2147483647) (D6) (2147483647)\n" +
-"(2147483647) (D7) (2147483647)\n" +
-"(2147483647) (D8) (2147483647)\n" +
-"(2147483647) (D9) (2147483647)\n" +
-"(2147483647) (D10) (2147483647)\n" +
-"(2147483647) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002147483647)\n" +
-"(2147483647) (E) (2.147484E+009)\n" +
-"(2147483647) (E0) (2E+009)\n" +
-"(2147483647) (E1) (2.1E+009)\n" +
-"(2147483647) (E2) (2.15E+009)\n" +
-"(2147483647) (E3) (2.147E+009)\n" +
-"(2147483647) (E4) (2.1475E+009)\n" +
-"(2147483647) (E5) (2.14748E+009)\n" +
-"(2147483647) (E6) (2.147484E+009)\n" +
-"(2147483647) (E7) (2.1474836E+009)\n" +
-"(2147483647) (E8) (2.14748365E+009)\n" +
-"(2147483647) (E9) (2.147483647E+009)\n" +
-"(2147483647) (E10) (2.1474836470E+009)\n" +
-"(2147483647) (E99) (2.147483647000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+009)\n" +
-"(2147483647) (F) (2147483647.00)\n" +
-"(2147483647) (F0) (2147483647)\n" +
-"(2147483647) (F1) (2147483647.0)\n" +
-"(2147483647) (F2) (2147483647.00)\n" +
-"(2147483647) (F3) (2147483647.000)\n" +
-"(2147483647) (F4) (2147483647.0000)\n" +
-"(2147483647) (F5) (2147483647.00000)\n" +
-"(2147483647) (F6) (2147483647.000000)\n" +
-"(2147483647) (F7) (2147483647.0000000)\n" +
-"(2147483647) (F8) (2147483647.00000000)\n" +
-"(2147483647) (F9) (2147483647.000000000)\n" +
-"(2147483647) (F10) (2147483647.0000000000)\n" +
-"(2147483647) (F99) (2147483647.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(2147483647) (G) (2147483647)\n" +
-"(2147483647) (G0) (2147483647)\n" +
-"(2147483647) (G1) (2E+09)\n" +
-"(2147483647) (G2) (2.1E+09)\n" +
-"(2147483647) (G3) (2.15E+09)\n" +
-"(2147483647) (G4) (2.147E+09)\n" +
-"(2147483647) (G5) (2.1475E+09)\n" +
-"(2147483647) (G6) (2.14748E+09)\n" +
-"(2147483647) (G7) (2.147484E+09)\n" +
-"(2147483647) (G8) (2.1474836E+09)\n" +
-"(2147483647) (G9) (2.14748365E+09)\n" +
-"(2147483647) (G10) (2147483647)\n" +
-"(2147483647) (G99) (2147483647)\n" +
-"(2147483647) (N) (2,147,483,647.00)\n" +
-"(2147483647) (N0) (2,147,483,647)\n" +
-"(2147483647) (N1) (2,147,483,647.0)\n" +
-"(2147483647) (N2) (2,147,483,647.00)\n" +
-"(2147483647) (N3) (2,147,483,647.000)\n" +
-"(2147483647) (N4) (2,147,483,647.0000)\n" +
-"(2147483647) (N5) (2,147,483,647.00000)\n" +
-"(2147483647) (N6) (2,147,483,647.000000)\n" +
-"(2147483647) (N7) (2,147,483,647.0000000)\n" +
-"(2147483647) (N8) (2,147,483,647.00000000)\n" +
-"(2147483647) (N9) (2,147,483,647.000000000)\n" +
-"(2147483647) (N10) (2,147,483,647.0000000000)\n" +
-"(2147483647) (N99) (2,147,483,647.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(2147483647) (P) (214,748,364,700.00 %)\n" +
-"(2147483647) (P0) (214,748,364,700 %)\n" +
-"(2147483647) (P1) (214,748,364,700.0 %)\n" +
-"(2147483647) (P2) (214,748,364,700.00 %)\n" +
-"(2147483647) (P3) (214,748,364,700.000 %)\n" +
-"(2147483647) (P4) (214,748,364,700.0000 %)\n" +
-"(2147483647) (P5) (214,748,364,700.00000 %)\n" +
-"(2147483647) (P6) (214,748,364,700.000000 %)\n" +
-"(2147483647) (P7) (214,748,364,700.0000000 %)\n" +
-"(2147483647) (P8) (214,748,364,700.00000000 %)\n" +
-"(2147483647) (P9) (214,748,364,700.000000000 %)\n" +
-"(2147483647) (P10) (214,748,364,700.0000000000 %)\n" +
-"(2147483647) (P99) (214,748,364,700.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(2147483647) (X) (7FFFFFFF)\n" +
-"(2147483647) (X0) (7FFFFFFF)\n" +
-"(2147483647) (X1) (7FFFFFFF)\n" +
-"(2147483647) (X2) (7FFFFFFF)\n" +
-"(2147483647) (X3) (7FFFFFFF)\n" +
-"(2147483647) (X4) (7FFFFFFF)\n" +
-"(2147483647) (X5) (7FFFFFFF)\n" +
-"(2147483647) (X6) (7FFFFFFF)\n" +
-"(2147483647) (X7) (7FFFFFFF)\n" +
-"(2147483647) (X8) (7FFFFFFF)\n" +
-"(2147483647) (X9) (07FFFFFFF)\n" +
-"(2147483647) (X10) (007FFFFFFF)\n" +
-"(2147483647) (X99) (00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (C) (($100.00))\n" +
-"(-100) (C0) (($100))\n" +
-"(-100) (C1) (($100.0))\n" +
-"(-100) (C2) (($100.00))\n" +
-"(-100) (C3) (($100.000))\n" +
-"(-100) (C4) (($100.0000))\n" +
-"(-100) (C5) (($100.00000))\n" +
-"(-100) (C6) (($100.000000))\n" +
-"(-100) (C7) (($100.0000000))\n" +
-"(-100) (C8) (($100.00000000))\n" +
-"(-100) (C9) (($100.000000000))\n" +
-"(-100) (C10) (($100.0000000000))\n" +
-"(-100) (C99) (($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-100) (D) (-100)\n" +
-"(-100) (D0) (-100)\n" +
-"(-100) (D1) (-100)\n" +
-"(-100) (D2) (-100)\n" +
-"(-100) (D3) (-100)\n" +
-"(-100) (D4) (-0100)\n" +
-"(-100) (D5) (-00100)\n" +
-"(-100) (D6) (-000100)\n" +
-"(-100) (D7) (-0000100)\n" +
-"(-100) (D8) (-00000100)\n" +
-"(-100) (D9) (-000000100)\n" +
-"(-100) (D10) (-0000000100)\n" +
-"(-100) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(-100) (E) (-1.000000E+002)\n" +
-"(-100) (E0) (-1E+002)\n" +
-"(-100) (E1) (-1.0E+002)\n" +
-"(-100) (E2) (-1.00E+002)\n" +
-"(-100) (E3) (-1.000E+002)\n" +
-"(-100) (E4) (-1.0000E+002)\n" +
-"(-100) (E5) (-1.00000E+002)\n" +
-"(-100) (E6) (-1.000000E+002)\n" +
-"(-100) (E7) (-1.0000000E+002)\n" +
-"(-100) (E8) (-1.00000000E+002)\n" +
-"(-100) (E9) (-1.000000000E+002)\n" +
-"(-100) (E10) (-1.0000000000E+002)\n" +
-"(-100) (E99) (-1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(-100) (F) (-100.00)\n" +
-"(-100) (F0) (-100)\n" +
-"(-100) (F1) (-100.0)\n" +
-"(-100) (F2) (-100.00)\n" +
-"(-100) (F3) (-100.000)\n" +
-"(-100) (F4) (-100.0000)\n" +
-"(-100) (F5) (-100.00000)\n" +
-"(-100) (F6) (-100.000000)\n" +
-"(-100) (F7) (-100.0000000)\n" +
-"(-100) (F8) (-100.00000000)\n" +
-"(-100) (F9) (-100.000000000)\n" +
-"(-100) (F10) (-100.0000000000)\n" +
-"(-100) (F99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (G) (-100)\n" +
-"(-100) (G0) (-100)\n" +
-"(-100) (G1) (-1E+02)\n" +
-"(-100) (G2) (-1E+02)\n" +
-"(-100) (G3) (-100)\n" +
-"(-100) (G4) (-100)\n" +
-"(-100) (G5) (-100)\n" +
-"(-100) (G6) (-100)\n" +
-"(-100) (G7) (-100)\n" +
-"(-100) (G8) (-100)\n" +
-"(-100) (G9) (-100)\n" +
-"(-100) (G10) (-100)\n" +
-"(-100) (G99) (-100)\n" +
-"(-100) (N) (-100.00)\n" +
-"(-100) (N0) (-100)\n" +
-"(-100) (N1) (-100.0)\n" +
-"(-100) (N2) (-100.00)\n" +
-"(-100) (N3) (-100.000)\n" +
-"(-100) (N4) (-100.0000)\n" +
-"(-100) (N5) (-100.00000)\n" +
-"(-100) (N6) (-100.000000)\n" +
-"(-100) (N7) (-100.0000000)\n" +
-"(-100) (N8) (-100.00000000)\n" +
-"(-100) (N9) (-100.000000000)\n" +
-"(-100) (N10) (-100.0000000000)\n" +
-"(-100) (N99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (P) (-10,000.00 %)\n" +
-"(-100) (P0) (-10,000 %)\n" +
-"(-100) (P1) (-10,000.0 %)\n" +
-"(-100) (P2) (-10,000.00 %)\n" +
-"(-100) (P3) (-10,000.000 %)\n" +
-"(-100) (P4) (-10,000.0000 %)\n" +
-"(-100) (P5) (-10,000.00000 %)\n" +
-"(-100) (P6) (-10,000.000000 %)\n" +
-"(-100) (P7) (-10,000.0000000 %)\n" +
-"(-100) (P8) (-10,000.00000000 %)\n" +
-"(-100) (P9) (-10,000.000000000 %)\n" +
-"(-100) (P10) (-10,000.0000000000 %)\n" +
-"(-100) (P99) (-10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-100) (X) (FFFFFF9C)\n" +
-"(-100) (X0) (FFFFFF9C)\n" +
-"(-100) (X1) (FFFFFF9C)\n" +
-"(-100) (X2) (FFFFFF9C)\n" +
-"(-100) (X3) (FFFFFF9C)\n" +
-"(-100) (X4) (FFFFFF9C)\n" +
-"(-100) (X5) (FFFFFF9C)\n" +
-"(-100) (X6) (FFFFFF9C)\n" +
-"(-100) (X7) (FFFFFF9C)\n" +
-"(-100) (X8) (FFFFFF9C)\n" +
-"(-100) (X9) (0FFFFFF9C)\n" +
-"(-100) (X10) (00FFFFFF9C)\n" +
-"(-100) (X99) (0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFF9C)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n" +
-"Int64\n" +
-"(-9223372036854775808) (C) (($9,223,372,036,854,775,808.00))\n" +
-"(-9223372036854775808) (C0) (($9,223,372,036,854,775,808))\n" +
-"(-9223372036854775808) (C1) (($9,223,372,036,854,775,808.0))\n" +
-"(-9223372036854775808) (C2) (($9,223,372,036,854,775,808.00))\n" +
-"(-9223372036854775808) (C3) (($9,223,372,036,854,775,808.000))\n" +
-"(-9223372036854775808) (C4) (($9,223,372,036,854,775,808.0000))\n" +
-"(-9223372036854775808) (C5) (($9,223,372,036,854,775,808.00000))\n" +
-"(-9223372036854775808) (C6) (($9,223,372,036,854,775,808.000000))\n" +
-"(-9223372036854775808) (C7) (($9,223,372,036,854,775,808.0000000))\n" +
-"(-9223372036854775808) (C8) (($9,223,372,036,854,775,808.00000000))\n" +
-"(-9223372036854775808) (C9) (($9,223,372,036,854,775,808.000000000))\n" +
-"(-9223372036854775808) (C10) (($9,223,372,036,854,775,808.0000000000))\n" +
-"(-9223372036854775808) (C99) (($9,223,372,036,854,775,808.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-9223372036854775808) (D) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D0) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D1) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D2) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D3) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D4) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D5) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D6) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D7) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D8) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D9) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D10) (-9223372036854775808)\n" +
-"(-9223372036854775808) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000009223372036854775808)\n" +
-"(-9223372036854775808) (E) (-9.223372E+018)\n" +
-"(-9223372036854775808) (E0) (-9E+018)\n" +
-"(-9223372036854775808) (E1) (-9.2E+018)\n" +
-"(-9223372036854775808) (E2) (-9.22E+018)\n" +
-"(-9223372036854775808) (E3) (-9.223E+018)\n" +
-"(-9223372036854775808) (E4) (-9.2234E+018)\n" +
-"(-9223372036854775808) (E5) (-9.22337E+018)\n" +
-"(-9223372036854775808) (E6) (-9.223372E+018)\n" +
-"(-9223372036854775808) (E7) (-9.2233720E+018)\n" +
-"(-9223372036854775808) (E8) (-9.22337204E+018)\n" +
-"(-9223372036854775808) (E9) (-9.223372037E+018)\n" +
-"(-9223372036854775808) (E10) (-9.2233720369E+018)\n" +
-"(-9223372036854775808) (E99) (-9.223372036854775808000000000000000000000000000000000000000000000000000000000000000000000000000000000E+018)\n" +
-"(-9223372036854775808) (F) (-9223372036854775808.00)\n" +
-"(-9223372036854775808) (F0) (-9223372036854775808)\n" +
-"(-9223372036854775808) (F1) (-9223372036854775808.0)\n" +
-"(-9223372036854775808) (F2) (-9223372036854775808.00)\n" +
-"(-9223372036854775808) (F3) (-9223372036854775808.000)\n" +
-"(-9223372036854775808) (F4) (-9223372036854775808.0000)\n" +
-"(-9223372036854775808) (F5) (-9223372036854775808.00000)\n" +
-"(-9223372036854775808) (F6) (-9223372036854775808.000000)\n" +
-"(-9223372036854775808) (F7) (-9223372036854775808.0000000)\n" +
-"(-9223372036854775808) (F8) (-9223372036854775808.00000000)\n" +
-"(-9223372036854775808) (F9) (-9223372036854775808.000000000)\n" +
-"(-9223372036854775808) (F10) (-9223372036854775808.0000000000)\n" +
-"(-9223372036854775808) (F99) (-9223372036854775808.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-9223372036854775808) (G) (-9223372036854775808)\n" +
-"(-9223372036854775808) (G0) (-9223372036854775808)\n" +
-"(-9223372036854775808) (G1) (-9E+18)\n" +
-"(-9223372036854775808) (G2) (-9.2E+18)\n" +
-"(-9223372036854775808) (G3) (-9.22E+18)\n" +
-"(-9223372036854775808) (G4) (-9.223E+18)\n" +
-"(-9223372036854775808) (G5) (-9.2234E+18)\n" +
-"(-9223372036854775808) (G6) (-9.22337E+18)\n" +
-"(-9223372036854775808) (G7) (-9.223372E+18)\n" +
-"(-9223372036854775808) (G8) (-9.223372E+18)\n" +
-"(-9223372036854775808) (G9) (-9.22337204E+18)\n" +
-"(-9223372036854775808) (G10) (-9.223372037E+18)\n" +
-"(-9223372036854775808) (G99) (-9223372036854775808)\n" +
-"(-9223372036854775808) (N) (-9,223,372,036,854,775,808.00)\n" +
-"(-9223372036854775808) (N0) (-9,223,372,036,854,775,808)\n" +
-"(-9223372036854775808) (N1) (-9,223,372,036,854,775,808.0)\n" +
-"(-9223372036854775808) (N2) (-9,223,372,036,854,775,808.00)\n" +
-"(-9223372036854775808) (N3) (-9,223,372,036,854,775,808.000)\n" +
-"(-9223372036854775808) (N4) (-9,223,372,036,854,775,808.0000)\n" +
-"(-9223372036854775808) (N5) (-9,223,372,036,854,775,808.00000)\n" +
-"(-9223372036854775808) (N6) (-9,223,372,036,854,775,808.000000)\n" +
-"(-9223372036854775808) (N7) (-9,223,372,036,854,775,808.0000000)\n" +
-"(-9223372036854775808) (N8) (-9,223,372,036,854,775,808.00000000)\n" +
-"(-9223372036854775808) (N9) (-9,223,372,036,854,775,808.000000000)\n" +
-"(-9223372036854775808) (N10) (-9,223,372,036,854,775,808.0000000000)\n" +
-"(-9223372036854775808) (N99) (-9,223,372,036,854,775,808.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-9223372036854775808) (P) (-922,337,203,685,477,580,800.00 %)\n" +
-"(-9223372036854775808) (P0) (-922,337,203,685,477,580,800 %)\n" +
-"(-9223372036854775808) (P1) (-922,337,203,685,477,580,800.0 %)\n" +
-"(-9223372036854775808) (P2) (-922,337,203,685,477,580,800.00 %)\n" +
-"(-9223372036854775808) (P3) (-922,337,203,685,477,580,800.000 %)\n" +
-"(-9223372036854775808) (P4) (-922,337,203,685,477,580,800.0000 %)\n" +
-"(-9223372036854775808) (P5) (-922,337,203,685,477,580,800.00000 %)\n" +
-"(-9223372036854775808) (P6) (-922,337,203,685,477,580,800.000000 %)\n" +
-"(-9223372036854775808) (P7) (-922,337,203,685,477,580,800.0000000 %)\n" +
-"(-9223372036854775808) (P8) (-922,337,203,685,477,580,800.00000000 %)\n" +
-"(-9223372036854775808) (P9) (-922,337,203,685,477,580,800.000000000 %)\n" +
-"(-9223372036854775808) (P10) (-922,337,203,685,477,580,800.0000000000 %)\n" +
-"(-9223372036854775808) (P99) (-922,337,203,685,477,580,800.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-9223372036854775808) (X) (8000000000000000)\n" +
-"(-9223372036854775808) (X0) (8000000000000000)\n" +
-"(-9223372036854775808) (X1) (8000000000000000)\n" +
-"(-9223372036854775808) (X2) (8000000000000000)\n" +
-"(-9223372036854775808) (X3) (8000000000000000)\n" +
-"(-9223372036854775808) (X4) (8000000000000000)\n" +
-"(-9223372036854775808) (X5) (8000000000000000)\n" +
-"(-9223372036854775808) (X6) (8000000000000000)\n" +
-"(-9223372036854775808) (X7) (8000000000000000)\n" +
-"(-9223372036854775808) (X8) (8000000000000000)\n" +
-"(-9223372036854775808) (X9) (8000000000000000)\n" +
-"(-9223372036854775808) (X10) (8000000000000000)\n" +
-"(-9223372036854775808) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000)\n" +
-"(9223372036854775807) (C) ($9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (C0) ($9,223,372,036,854,775,807)\n" +
-"(9223372036854775807) (C1) ($9,223,372,036,854,775,807.0)\n" +
-"(9223372036854775807) (C2) ($9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (C3) ($9,223,372,036,854,775,807.000)\n" +
-"(9223372036854775807) (C4) ($9,223,372,036,854,775,807.0000)\n" +
-"(9223372036854775807) (C5) ($9,223,372,036,854,775,807.00000)\n" +
-"(9223372036854775807) (C6) ($9,223,372,036,854,775,807.000000)\n" +
-"(9223372036854775807) (C7) ($9,223,372,036,854,775,807.0000000)\n" +
-"(9223372036854775807) (C8) ($9,223,372,036,854,775,807.00000000)\n" +
-"(9223372036854775807) (C9) ($9,223,372,036,854,775,807.000000000)\n" +
-"(9223372036854775807) (C10) ($9,223,372,036,854,775,807.0000000000)\n" +
-"(9223372036854775807) (C99) ($9,223,372,036,854,775,807.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(9223372036854775807) (D) (9223372036854775807)\n" +
-"(9223372036854775807) (D0) (9223372036854775807)\n" +
-"(9223372036854775807) (D1) (9223372036854775807)\n" +
-"(9223372036854775807) (D2) (9223372036854775807)\n" +
-"(9223372036854775807) (D3) (9223372036854775807)\n" +
-"(9223372036854775807) (D4) (9223372036854775807)\n" +
-"(9223372036854775807) (D5) (9223372036854775807)\n" +
-"(9223372036854775807) (D6) (9223372036854775807)\n" +
-"(9223372036854775807) (D7) (9223372036854775807)\n" +
-"(9223372036854775807) (D8) (9223372036854775807)\n" +
-"(9223372036854775807) (D9) (9223372036854775807)\n" +
-"(9223372036854775807) (D10) (9223372036854775807)\n" +
-"(9223372036854775807) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000009223372036854775807)\n" +
-"(9223372036854775807) (E) (9.223372E+018)\n" +
-"(9223372036854775807) (E0) (9E+018)\n" +
-"(9223372036854775807) (E1) (9.2E+018)\n" +
-"(9223372036854775807) (E2) (9.22E+018)\n" +
-"(9223372036854775807) (E3) (9.223E+018)\n" +
-"(9223372036854775807) (E4) (9.2234E+018)\n" +
-"(9223372036854775807) (E5) (9.22337E+018)\n" +
-"(9223372036854775807) (E6) (9.223372E+018)\n" +
-"(9223372036854775807) (E7) (9.2233720E+018)\n" +
-"(9223372036854775807) (E8) (9.22337204E+018)\n" +
-"(9223372036854775807) (E9) (9.223372037E+018)\n" +
-"(9223372036854775807) (E10) (9.2233720369E+018)\n" +
-"(9223372036854775807) (E99) (9.223372036854775807000000000000000000000000000000000000000000000000000000000000000000000000000000000E+018)\n" +
-"(9223372036854775807) (F) (9223372036854775807.00)\n" +
-"(9223372036854775807) (F0) (9223372036854775807)\n" +
-"(9223372036854775807) (F1) (9223372036854775807.0)\n" +
-"(9223372036854775807) (F2) (9223372036854775807.00)\n" +
-"(9223372036854775807) (F3) (9223372036854775807.000)\n" +
-"(9223372036854775807) (F4) (9223372036854775807.0000)\n" +
-"(9223372036854775807) (F5) (9223372036854775807.00000)\n" +
-"(9223372036854775807) (F6) (9223372036854775807.000000)\n" +
-"(9223372036854775807) (F7) (9223372036854775807.0000000)\n" +
-"(9223372036854775807) (F8) (9223372036854775807.00000000)\n" +
-"(9223372036854775807) (F9) (9223372036854775807.000000000)\n" +
-"(9223372036854775807) (F10) (9223372036854775807.0000000000)\n" +
-"(9223372036854775807) (F99) (9223372036854775807.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(9223372036854775807) (G) (9223372036854775807)\n" +
-"(9223372036854775807) (G0) (9223372036854775807)\n" +
-"(9223372036854775807) (G1) (9E+18)\n" +
-"(9223372036854775807) (G2) (9.2E+18)\n" +
-"(9223372036854775807) (G3) (9.22E+18)\n" +
-"(9223372036854775807) (G4) (9.223E+18)\n" +
-"(9223372036854775807) (G5) (9.2234E+18)\n" +
-"(9223372036854775807) (G6) (9.22337E+18)\n" +
-"(9223372036854775807) (G7) (9.223372E+18)\n" +
-"(9223372036854775807) (G8) (9.223372E+18)\n" +
-"(9223372036854775807) (G9) (9.22337204E+18)\n" +
-"(9223372036854775807) (G10) (9.223372037E+18)\n" +
-"(9223372036854775807) (G99) (9223372036854775807)\n" +
-"(9223372036854775807) (N) (9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (N0) (9,223,372,036,854,775,807)\n" +
-"(9223372036854775807) (N1) (9,223,372,036,854,775,807.0)\n" +
-"(9223372036854775807) (N2) (9,223,372,036,854,775,807.00)\n" +
-"(9223372036854775807) (N3) (9,223,372,036,854,775,807.000)\n" +
-"(9223372036854775807) (N4) (9,223,372,036,854,775,807.0000)\n" +
-"(9223372036854775807) (N5) (9,223,372,036,854,775,807.00000)\n" +
-"(9223372036854775807) (N6) (9,223,372,036,854,775,807.000000)\n" +
-"(9223372036854775807) (N7) (9,223,372,036,854,775,807.0000000)\n" +
-"(9223372036854775807) (N8) (9,223,372,036,854,775,807.00000000)\n" +
-"(9223372036854775807) (N9) (9,223,372,036,854,775,807.000000000)\n" +
-"(9223372036854775807) (N10) (9,223,372,036,854,775,807.0000000000)\n" +
-"(9223372036854775807) (N99) (9,223,372,036,854,775,807.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(9223372036854775807) (P) (922,337,203,685,477,580,700.00 %)\n" +
-"(9223372036854775807) (P0) (922,337,203,685,477,580,700 %)\n" +
-"(9223372036854775807) (P1) (922,337,203,685,477,580,700.0 %)\n" +
-"(9223372036854775807) (P2) (922,337,203,685,477,580,700.00 %)\n" +
-"(9223372036854775807) (P3) (922,337,203,685,477,580,700.000 %)\n" +
-"(9223372036854775807) (P4) (922,337,203,685,477,580,700.0000 %)\n" +
-"(9223372036854775807) (P5) (922,337,203,685,477,580,700.00000 %)\n" +
-"(9223372036854775807) (P6) (922,337,203,685,477,580,700.000000 %)\n" +
-"(9223372036854775807) (P7) (922,337,203,685,477,580,700.0000000 %)\n" +
-"(9223372036854775807) (P8) (922,337,203,685,477,580,700.00000000 %)\n" +
-"(9223372036854775807) (P9) (922,337,203,685,477,580,700.000000000 %)\n" +
-"(9223372036854775807) (P10) (922,337,203,685,477,580,700.0000000000 %)\n" +
-"(9223372036854775807) (P99) (922,337,203,685,477,580,700.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(9223372036854775807) (X) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X0) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X1) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X2) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X3) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X4) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X5) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X6) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X7) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X8) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X9) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X10) (7FFFFFFFFFFFFFFF)\n" +
-"(9223372036854775807) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFFFFFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (C) (($100.00))\n" +
-"(-100) (C0) (($100))\n" +
-"(-100) (C1) (($100.0))\n" +
-"(-100) (C2) (($100.00))\n" +
-"(-100) (C3) (($100.000))\n" +
-"(-100) (C4) (($100.0000))\n" +
-"(-100) (C5) (($100.00000))\n" +
-"(-100) (C6) (($100.000000))\n" +
-"(-100) (C7) (($100.0000000))\n" +
-"(-100) (C8) (($100.00000000))\n" +
-"(-100) (C9) (($100.000000000))\n" +
-"(-100) (C10) (($100.0000000000))\n" +
-"(-100) (C99) (($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))\n" +
-"(-100) (D) (-100)\n" +
-"(-100) (D0) (-100)\n" +
-"(-100) (D1) (-100)\n" +
-"(-100) (D2) (-100)\n" +
-"(-100) (D3) (-100)\n" +
-"(-100) (D4) (-0100)\n" +
-"(-100) (D5) (-00100)\n" +
-"(-100) (D6) (-000100)\n" +
-"(-100) (D7) (-0000100)\n" +
-"(-100) (D8) (-00000100)\n" +
-"(-100) (D9) (-000000100)\n" +
-"(-100) (D10) (-0000000100)\n" +
-"(-100) (D99) (-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(-100) (E) (-1.000000E+002)\n" +
-"(-100) (E0) (-1E+002)\n" +
-"(-100) (E1) (-1.0E+002)\n" +
-"(-100) (E2) (-1.00E+002)\n" +
-"(-100) (E3) (-1.000E+002)\n" +
-"(-100) (E4) (-1.0000E+002)\n" +
-"(-100) (E5) (-1.00000E+002)\n" +
-"(-100) (E6) (-1.000000E+002)\n" +
-"(-100) (E7) (-1.0000000E+002)\n" +
-"(-100) (E8) (-1.00000000E+002)\n" +
-"(-100) (E9) (-1.000000000E+002)\n" +
-"(-100) (E10) (-1.0000000000E+002)\n" +
-"(-100) (E99) (-1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(-100) (F) (-100.00)\n" +
-"(-100) (F0) (-100)\n" +
-"(-100) (F1) (-100.0)\n" +
-"(-100) (F2) (-100.00)\n" +
-"(-100) (F3) (-100.000)\n" +
-"(-100) (F4) (-100.0000)\n" +
-"(-100) (F5) (-100.00000)\n" +
-"(-100) (F6) (-100.000000)\n" +
-"(-100) (F7) (-100.0000000)\n" +
-"(-100) (F8) (-100.00000000)\n" +
-"(-100) (F9) (-100.000000000)\n" +
-"(-100) (F10) (-100.0000000000)\n" +
-"(-100) (F99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (G) (-100)\n" +
-"(-100) (G0) (-100)\n" +
-"(-100) (G1) (-1E+02)\n" +
-"(-100) (G2) (-1E+02)\n" +
-"(-100) (G3) (-100)\n" +
-"(-100) (G4) (-100)\n" +
-"(-100) (G5) (-100)\n" +
-"(-100) (G6) (-100)\n" +
-"(-100) (G7) (-100)\n" +
-"(-100) (G8) (-100)\n" +
-"(-100) (G9) (-100)\n" +
-"(-100) (G10) (-100)\n" +
-"(-100) (G99) (-100)\n" +
-"(-100) (N) (-100.00)\n" +
-"(-100) (N0) (-100)\n" +
-"(-100) (N1) (-100.0)\n" +
-"(-100) (N2) (-100.00)\n" +
-"(-100) (N3) (-100.000)\n" +
-"(-100) (N4) (-100.0000)\n" +
-"(-100) (N5) (-100.00000)\n" +
-"(-100) (N6) (-100.000000)\n" +
-"(-100) (N7) (-100.0000000)\n" +
-"(-100) (N8) (-100.00000000)\n" +
-"(-100) (N9) (-100.000000000)\n" +
-"(-100) (N10) (-100.0000000000)\n" +
-"(-100) (N99) (-100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(-100) (P) (-10,000.00 %)\n" +
-"(-100) (P0) (-10,000 %)\n" +
-"(-100) (P1) (-10,000.0 %)\n" +
-"(-100) (P2) (-10,000.00 %)\n" +
-"(-100) (P3) (-10,000.000 %)\n" +
-"(-100) (P4) (-10,000.0000 %)\n" +
-"(-100) (P5) (-10,000.00000 %)\n" +
-"(-100) (P6) (-10,000.000000 %)\n" +
-"(-100) (P7) (-10,000.0000000 %)\n" +
-"(-100) (P8) (-10,000.00000000 %)\n" +
-"(-100) (P9) (-10,000.000000000 %)\n" +
-"(-100) (P10) (-10,000.0000000000 %)\n" +
-"(-100) (P99) (-10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(-100) (X) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X0) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X1) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X2) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X3) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X4) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X5) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X6) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X7) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X8) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X9) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X10) (FFFFFFFFFFFFFF9C)\n" +
-"(-100) (X99) (00000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFF9C)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n" +
-"UInt32\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (C) ($4,294,967,295.00)\n" +
-"(4294967295) (C0) ($4,294,967,295)\n" +
-"(4294967295) (C1) ($4,294,967,295.0)\n" +
-"(4294967295) (C2) ($4,294,967,295.00)\n" +
-"(4294967295) (C3) ($4,294,967,295.000)\n" +
-"(4294967295) (C4) ($4,294,967,295.0000)\n" +
-"(4294967295) (C5) ($4,294,967,295.00000)\n" +
-"(4294967295) (C6) ($4,294,967,295.000000)\n" +
-"(4294967295) (C7) ($4,294,967,295.0000000)\n" +
-"(4294967295) (C8) ($4,294,967,295.00000000)\n" +
-"(4294967295) (C9) ($4,294,967,295.000000000)\n" +
-"(4294967295) (C10) ($4,294,967,295.0000000000)\n" +
-"(4294967295) (C99) ($4,294,967,295.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (D) (4294967295)\n" +
-"(4294967295) (D0) (4294967295)\n" +
-"(4294967295) (D1) (4294967295)\n" +
-"(4294967295) (D2) (4294967295)\n" +
-"(4294967295) (D3) (4294967295)\n" +
-"(4294967295) (D4) (4294967295)\n" +
-"(4294967295) (D5) (4294967295)\n" +
-"(4294967295) (D6) (4294967295)\n" +
-"(4294967295) (D7) (4294967295)\n" +
-"(4294967295) (D8) (4294967295)\n" +
-"(4294967295) (D9) (4294967295)\n" +
-"(4294967295) (D10) (4294967295)\n" +
-"(4294967295) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004294967295)\n" +
-"(4294967295) (E) (4.294967E+009)\n" +
-"(4294967295) (E0) (4E+009)\n" +
-"(4294967295) (E1) (4.3E+009)\n" +
-"(4294967295) (E2) (4.29E+009)\n" +
-"(4294967295) (E3) (4.295E+009)\n" +
-"(4294967295) (E4) (4.2950E+009)\n" +
-"(4294967295) (E5) (4.29497E+009)\n" +
-"(4294967295) (E6) (4.294967E+009)\n" +
-"(4294967295) (E7) (4.2949673E+009)\n" +
-"(4294967295) (E8) (4.29496730E+009)\n" +
-"(4294967295) (E9) (4.294967295E+009)\n" +
-"(4294967295) (E10) (4.2949672950E+009)\n" +
-"(4294967295) (E99) (4.294967295000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+009)\n" +
-"(4294967295) (F) (4294967295.00)\n" +
-"(4294967295) (F0) (4294967295)\n" +
-"(4294967295) (F1) (4294967295.0)\n" +
-"(4294967295) (F2) (4294967295.00)\n" +
-"(4294967295) (F3) (4294967295.000)\n" +
-"(4294967295) (F4) (4294967295.0000)\n" +
-"(4294967295) (F5) (4294967295.00000)\n" +
-"(4294967295) (F6) (4294967295.000000)\n" +
-"(4294967295) (F7) (4294967295.0000000)\n" +
-"(4294967295) (F8) (4294967295.00000000)\n" +
-"(4294967295) (F9) (4294967295.000000000)\n" +
-"(4294967295) (F10) (4294967295.0000000000)\n" +
-"(4294967295) (F99) (4294967295.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (G) (4294967295)\n" +
-"(4294967295) (G0) (4294967295)\n" +
-"(4294967295) (G1) (4E+09)\n" +
-"(4294967295) (G2) (4.3E+09)\n" +
-"(4294967295) (G3) (4.29E+09)\n" +
-"(4294967295) (G4) (4.295E+09)\n" +
-"(4294967295) (G5) (4.295E+09)\n" +
-"(4294967295) (G6) (4.29497E+09)\n" +
-"(4294967295) (G7) (4.294967E+09)\n" +
-"(4294967295) (G8) (4.2949673E+09)\n" +
-"(4294967295) (G9) (4.2949673E+09)\n" +
-"(4294967295) (G10) (4294967295)\n" +
-"(4294967295) (G99) (4294967295)\n" +
-"(4294967295) (N) (4,294,967,295.00)\n" +
-"(4294967295) (N0) (4,294,967,295)\n" +
-"(4294967295) (N1) (4,294,967,295.0)\n" +
-"(4294967295) (N2) (4,294,967,295.00)\n" +
-"(4294967295) (N3) (4,294,967,295.000)\n" +
-"(4294967295) (N4) (4,294,967,295.0000)\n" +
-"(4294967295) (N5) (4,294,967,295.00000)\n" +
-"(4294967295) (N6) (4,294,967,295.000000)\n" +
-"(4294967295) (N7) (4,294,967,295.0000000)\n" +
-"(4294967295) (N8) (4,294,967,295.00000000)\n" +
-"(4294967295) (N9) (4,294,967,295.000000000)\n" +
-"(4294967295) (N10) (4,294,967,295.0000000000)\n" +
-"(4294967295) (N99) (4,294,967,295.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(4294967295) (P) (429,496,729,500.00 %)\n" +
-"(4294967295) (P0) (429,496,729,500 %)\n" +
-"(4294967295) (P1) (429,496,729,500.0 %)\n" +
-"(4294967295) (P2) (429,496,729,500.00 %)\n" +
-"(4294967295) (P3) (429,496,729,500.000 %)\n" +
-"(4294967295) (P4) (429,496,729,500.0000 %)\n" +
-"(4294967295) (P5) (429,496,729,500.00000 %)\n" +
-"(4294967295) (P6) (429,496,729,500.000000 %)\n" +
-"(4294967295) (P7) (429,496,729,500.0000000 %)\n" +
-"(4294967295) (P8) (429,496,729,500.00000000 %)\n" +
-"(4294967295) (P9) (429,496,729,500.000000000 %)\n" +
-"(4294967295) (P10) (429,496,729,500.0000000000 %)\n" +
-"(4294967295) (P99) (429,496,729,500.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(4294967295) (X) (FFFFFFFF)\n" +
-"(4294967295) (X0) (FFFFFFFF)\n" +
-"(4294967295) (X1) (FFFFFFFF)\n" +
-"(4294967295) (X2) (FFFFFFFF)\n" +
-"(4294967295) (X3) (FFFFFFFF)\n" +
-"(4294967295) (X4) (FFFFFFFF)\n" +
-"(4294967295) (X5) (FFFFFFFF)\n" +
-"(4294967295) (X6) (FFFFFFFF)\n" +
-"(4294967295) (X7) (FFFFFFFF)\n" +
-"(4294967295) (X8) (FFFFFFFF)\n" +
-"(4294967295) (X9) (0FFFFFFFF)\n" +
-"(4294967295) (X10) (00FFFFFFFF)\n" +
-"(4294967295) (X99) (0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n" +
-"UInt64\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (C) ($18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (C0) ($18,446,744,073,709,551,615)\n" +
-"(18446744073709551615) (C1) ($18,446,744,073,709,551,615.0)\n" +
-"(18446744073709551615) (C2) ($18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (C3) ($18,446,744,073,709,551,615.000)\n" +
-"(18446744073709551615) (C4) ($18,446,744,073,709,551,615.0000)\n" +
-"(18446744073709551615) (C5) ($18,446,744,073,709,551,615.00000)\n" +
-"(18446744073709551615) (C6) ($18,446,744,073,709,551,615.000000)\n" +
-"(18446744073709551615) (C7) ($18,446,744,073,709,551,615.0000000)\n" +
-"(18446744073709551615) (C8) ($18,446,744,073,709,551,615.00000000)\n" +
-"(18446744073709551615) (C9) ($18,446,744,073,709,551,615.000000000)\n" +
-"(18446744073709551615) (C10) ($18,446,744,073,709,551,615.0000000000)\n" +
-"(18446744073709551615) (C99) ($18,446,744,073,709,551,615.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (D) (18446744073709551615)\n" +
-"(18446744073709551615) (D0) (18446744073709551615)\n" +
-"(18446744073709551615) (D1) (18446744073709551615)\n" +
-"(18446744073709551615) (D2) (18446744073709551615)\n" +
-"(18446744073709551615) (D3) (18446744073709551615)\n" +
-"(18446744073709551615) (D4) (18446744073709551615)\n" +
-"(18446744073709551615) (D5) (18446744073709551615)\n" +
-"(18446744073709551615) (D6) (18446744073709551615)\n" +
-"(18446744073709551615) (D7) (18446744073709551615)\n" +
-"(18446744073709551615) (D8) (18446744073709551615)\n" +
-"(18446744073709551615) (D9) (18446744073709551615)\n" +
-"(18446744073709551615) (D10) (18446744073709551615)\n" +
-"(18446744073709551615) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000018446744073709551615)\n" +
-"(18446744073709551615) (E) (1.844674E+019)\n" +
-"(18446744073709551615) (E0) (2E+019)\n" +
-"(18446744073709551615) (E1) (1.8E+019)\n" +
-"(18446744073709551615) (E2) (1.84E+019)\n" +
-"(18446744073709551615) (E3) (1.845E+019)\n" +
-"(18446744073709551615) (E4) (1.8447E+019)\n" +
-"(18446744073709551615) (E5) (1.84467E+019)\n" +
-"(18446744073709551615) (E6) (1.844674E+019)\n" +
-"(18446744073709551615) (E7) (1.8446744E+019)\n" +
-"(18446744073709551615) (E8) (1.84467441E+019)\n" +
-"(18446744073709551615) (E9) (1.844674407E+019)\n" +
-"(18446744073709551615) (E10) (1.8446744074E+019)\n" +
-"(18446744073709551615) (E99) (1.844674407370955161500000000000000000000000000000000000000000000000000000000000000000000000000000000E+019)\n" +
-"(18446744073709551615) (F) (18446744073709551615.00)\n" +
-"(18446744073709551615) (F0) (18446744073709551615)\n" +
-"(18446744073709551615) (F1) (18446744073709551615.0)\n" +
-"(18446744073709551615) (F2) (18446744073709551615.00)\n" +
-"(18446744073709551615) (F3) (18446744073709551615.000)\n" +
-"(18446744073709551615) (F4) (18446744073709551615.0000)\n" +
-"(18446744073709551615) (F5) (18446744073709551615.00000)\n" +
-"(18446744073709551615) (F6) (18446744073709551615.000000)\n" +
-"(18446744073709551615) (F7) (18446744073709551615.0000000)\n" +
-"(18446744073709551615) (F8) (18446744073709551615.00000000)\n" +
-"(18446744073709551615) (F9) (18446744073709551615.000000000)\n" +
-"(18446744073709551615) (F10) (18446744073709551615.0000000000)\n" +
-"(18446744073709551615) (F99) (18446744073709551615.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (G) (18446744073709551615)\n" +
-"(18446744073709551615) (G0) (18446744073709551615)\n" +
-"(18446744073709551615) (G1) (2E+19)\n" +
-"(18446744073709551615) (G2) (1.8E+19)\n" +
-"(18446744073709551615) (G3) (1.84E+19)\n" +
-"(18446744073709551615) (G4) (1.845E+19)\n" +
-"(18446744073709551615) (G5) (1.8447E+19)\n" +
-"(18446744073709551615) (G6) (1.84467E+19)\n" +
-"(18446744073709551615) (G7) (1.844674E+19)\n" +
-"(18446744073709551615) (G8) (1.8446744E+19)\n" +
-"(18446744073709551615) (G9) (1.84467441E+19)\n" +
-"(18446744073709551615) (G10) (1.844674407E+19)\n" +
-"(18446744073709551615) (G99) (18446744073709551615)\n" +
-"(18446744073709551615) (N) (18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (N0) (18,446,744,073,709,551,615)\n" +
-"(18446744073709551615) (N1) (18,446,744,073,709,551,615.0)\n" +
-"(18446744073709551615) (N2) (18,446,744,073,709,551,615.00)\n" +
-"(18446744073709551615) (N3) (18,446,744,073,709,551,615.000)\n" +
-"(18446744073709551615) (N4) (18,446,744,073,709,551,615.0000)\n" +
-"(18446744073709551615) (N5) (18,446,744,073,709,551,615.00000)\n" +
-"(18446744073709551615) (N6) (18,446,744,073,709,551,615.000000)\n" +
-"(18446744073709551615) (N7) (18,446,744,073,709,551,615.0000000)\n" +
-"(18446744073709551615) (N8) (18,446,744,073,709,551,615.00000000)\n" +
-"(18446744073709551615) (N9) (18,446,744,073,709,551,615.000000000)\n" +
-"(18446744073709551615) (N10) (18,446,744,073,709,551,615.0000000000)\n" +
-"(18446744073709551615) (N99) (18,446,744,073,709,551,615.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(18446744073709551615) (P) (1,844,674,407,370,955,161,500.00 %)\n" +
-"(18446744073709551615) (P0) (1,844,674,407,370,955,161,500 %)\n" +
-"(18446744073709551615) (P1) (1,844,674,407,370,955,161,500.0 %)\n" +
-"(18446744073709551615) (P2) (1,844,674,407,370,955,161,500.00 %)\n" +
-"(18446744073709551615) (P3) (1,844,674,407,370,955,161,500.000 %)\n" +
-"(18446744073709551615) (P4) (1,844,674,407,370,955,161,500.0000 %)\n" +
-"(18446744073709551615) (P5) (1,844,674,407,370,955,161,500.00000 %)\n" +
-"(18446744073709551615) (P6) (1,844,674,407,370,955,161,500.000000 %)\n" +
-"(18446744073709551615) (P7) (1,844,674,407,370,955,161,500.0000000 %)\n" +
-"(18446744073709551615) (P8) (1,844,674,407,370,955,161,500.00000000 %)\n" +
-"(18446744073709551615) (P9) (1,844,674,407,370,955,161,500.000000000 %)\n" +
-"(18446744073709551615) (P10) (1,844,674,407,370,955,161,500.0000000000 %)\n" +
-"(18446744073709551615) (P99) (1,844,674,407,370,955,161,500.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(18446744073709551615) (X) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X0) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X1) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X2) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X3) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X4) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X5) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X6) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X7) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X8) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X9) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X10) (FFFFFFFFFFFFFFFF)\n" +
-"(18446744073709551615) (X99) (00000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF)\n" +
-"(0) (C) ($0.00)\n" +
-"(0) (C0) ($0)\n" +
-"(0) (C1) ($0.0)\n" +
-"(0) (C2) ($0.00)\n" +
-"(0) (C3) ($0.000)\n" +
-"(0) (C4) ($0.0000)\n" +
-"(0) (C5) ($0.00000)\n" +
-"(0) (C6) ($0.000000)\n" +
-"(0) (C7) ($0.0000000)\n" +
-"(0) (C8) ($0.00000000)\n" +
-"(0) (C9) ($0.000000000)\n" +
-"(0) (C10) ($0.0000000000)\n" +
-"(0) (C99) ($0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (D) (0)\n" +
-"(0) (D0) (0)\n" +
-"(0) (D1) (0)\n" +
-"(0) (D2) (00)\n" +
-"(0) (D3) (000)\n" +
-"(0) (D4) (0000)\n" +
-"(0) (D5) (00000)\n" +
-"(0) (D6) (000000)\n" +
-"(0) (D7) (0000000)\n" +
-"(0) (D8) (00000000)\n" +
-"(0) (D9) (000000000)\n" +
-"(0) (D10) (0000000000)\n" +
-"(0) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (E) (0.000000E+000)\n" +
-"(0) (E0) (0E+000)\n" +
-"(0) (E1) (0.0E+000)\n" +
-"(0) (E2) (0.00E+000)\n" +
-"(0) (E3) (0.000E+000)\n" +
-"(0) (E4) (0.0000E+000)\n" +
-"(0) (E5) (0.00000E+000)\n" +
-"(0) (E6) (0.000000E+000)\n" +
-"(0) (E7) (0.0000000E+000)\n" +
-"(0) (E8) (0.00000000E+000)\n" +
-"(0) (E9) (0.000000000E+000)\n" +
-"(0) (E10) (0.0000000000E+000)\n" +
-"(0) (E99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+000)\n" +
-"(0) (F) (0.00)\n" +
-"(0) (F0) (0)\n" +
-"(0) (F1) (0.0)\n" +
-"(0) (F2) (0.00)\n" +
-"(0) (F3) (0.000)\n" +
-"(0) (F4) (0.0000)\n" +
-"(0) (F5) (0.00000)\n" +
-"(0) (F6) (0.000000)\n" +
-"(0) (F7) (0.0000000)\n" +
-"(0) (F8) (0.00000000)\n" +
-"(0) (F9) (0.000000000)\n" +
-"(0) (F10) (0.0000000000)\n" +
-"(0) (F99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (G) (0)\n" +
-"(0) (G0) (0)\n" +
-"(0) (G1) (0)\n" +
-"(0) (G2) (0)\n" +
-"(0) (G3) (0)\n" +
-"(0) (G4) (0)\n" +
-"(0) (G5) (0)\n" +
-"(0) (G6) (0)\n" +
-"(0) (G7) (0)\n" +
-"(0) (G8) (0)\n" +
-"(0) (G9) (0)\n" +
-"(0) (G10) (0)\n" +
-"(0) (G99) (0)\n" +
-"(0) (N) (0.00)\n" +
-"(0) (N0) (0)\n" +
-"(0) (N1) (0.0)\n" +
-"(0) (N2) (0.00)\n" +
-"(0) (N3) (0.000)\n" +
-"(0) (N4) (0.0000)\n" +
-"(0) (N5) (0.00000)\n" +
-"(0) (N6) (0.000000)\n" +
-"(0) (N7) (0.0000000)\n" +
-"(0) (N8) (0.00000000)\n" +
-"(0) (N9) (0.000000000)\n" +
-"(0) (N10) (0.0000000000)\n" +
-"(0) (N99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(0) (P) (0.00 %)\n" +
-"(0) (P0) (0 %)\n" +
-"(0) (P1) (0.0 %)\n" +
-"(0) (P2) (0.00 %)\n" +
-"(0) (P3) (0.000 %)\n" +
-"(0) (P4) (0.0000 %)\n" +
-"(0) (P5) (0.00000 %)\n" +
-"(0) (P6) (0.000000 %)\n" +
-"(0) (P7) (0.0000000 %)\n" +
-"(0) (P8) (0.00000000 %)\n" +
-"(0) (P9) (0.000000000 %)\n" +
-"(0) (P10) (0.0000000000 %)\n" +
-"(0) (P99) (0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(0) (X) (0)\n" +
-"(0) (X0) (0)\n" +
-"(0) (X1) (0)\n" +
-"(0) (X2) (00)\n" +
-"(0) (X3) (000)\n" +
-"(0) (X4) (0000)\n" +
-"(0) (X5) (00000)\n" +
-"(0) (X6) (000000)\n" +
-"(0) (X7) (0000000)\n" +
-"(0) (X8) (00000000)\n" +
-"(0) (X9) (000000000)\n" +
-"(0) (X10) (0000000000)\n" +
-"(0) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (C) ($100.00)\n" +
-"(100) (C0) ($100)\n" +
-"(100) (C1) ($100.0)\n" +
-"(100) (C2) ($100.00)\n" +
-"(100) (C3) ($100.000)\n" +
-"(100) (C4) ($100.0000)\n" +
-"(100) (C5) ($100.00000)\n" +
-"(100) (C6) ($100.000000)\n" +
-"(100) (C7) ($100.0000000)\n" +
-"(100) (C8) ($100.00000000)\n" +
-"(100) (C9) ($100.000000000)\n" +
-"(100) (C10) ($100.0000000000)\n" +
-"(100) (C99) ($100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (D) (100)\n" +
-"(100) (D0) (100)\n" +
-"(100) (D1) (100)\n" +
-"(100) (D2) (100)\n" +
-"(100) (D3) (100)\n" +
-"(100) (D4) (0100)\n" +
-"(100) (D5) (00100)\n" +
-"(100) (D6) (000100)\n" +
-"(100) (D7) (0000100)\n" +
-"(100) (D8) (00000100)\n" +
-"(100) (D9) (000000100)\n" +
-"(100) (D10) (0000000100)\n" +
-"(100) (D99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100)\n" +
-"(100) (E) (1.000000E+002)\n" +
-"(100) (E0) (1E+002)\n" +
-"(100) (E1) (1.0E+002)\n" +
-"(100) (E2) (1.00E+002)\n" +
-"(100) (E3) (1.000E+002)\n" +
-"(100) (E4) (1.0000E+002)\n" +
-"(100) (E5) (1.00000E+002)\n" +
-"(100) (E6) (1.000000E+002)\n" +
-"(100) (E7) (1.0000000E+002)\n" +
-"(100) (E8) (1.00000000E+002)\n" +
-"(100) (E9) (1.000000000E+002)\n" +
-"(100) (E10) (1.0000000000E+002)\n" +
-"(100) (E99) (1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E+002)\n" +
-"(100) (F) (100.00)\n" +
-"(100) (F0) (100)\n" +
-"(100) (F1) (100.0)\n" +
-"(100) (F2) (100.00)\n" +
-"(100) (F3) (100.000)\n" +
-"(100) (F4) (100.0000)\n" +
-"(100) (F5) (100.00000)\n" +
-"(100) (F6) (100.000000)\n" +
-"(100) (F7) (100.0000000)\n" +
-"(100) (F8) (100.00000000)\n" +
-"(100) (F9) (100.000000000)\n" +
-"(100) (F10) (100.0000000000)\n" +
-"(100) (F99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (G) (100)\n" +
-"(100) (G0) (100)\n" +
-"(100) (G1) (1E+02)\n" +
-"(100) (G2) (1E+02)\n" +
-"(100) (G3) (100)\n" +
-"(100) (G4) (100)\n" +
-"(100) (G5) (100)\n" +
-"(100) (G6) (100)\n" +
-"(100) (G7) (100)\n" +
-"(100) (G8) (100)\n" +
-"(100) (G9) (100)\n" +
-"(100) (G10) (100)\n" +
-"(100) (G99) (100)\n" +
-"(100) (N) (100.00)\n" +
-"(100) (N0) (100)\n" +
-"(100) (N1) (100.0)\n" +
-"(100) (N2) (100.00)\n" +
-"(100) (N3) (100.000)\n" +
-"(100) (N4) (100.0000)\n" +
-"(100) (N5) (100.00000)\n" +
-"(100) (N6) (100.000000)\n" +
-"(100) (N7) (100.0000000)\n" +
-"(100) (N8) (100.00000000)\n" +
-"(100) (N9) (100.000000000)\n" +
-"(100) (N10) (100.0000000000)\n" +
-"(100) (N99) (100.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)\n" +
-"(100) (P) (10,000.00 %)\n" +
-"(100) (P0) (10,000 %)\n" +
-"(100) (P1) (10,000.0 %)\n" +
-"(100) (P2) (10,000.00 %)\n" +
-"(100) (P3) (10,000.000 %)\n" +
-"(100) (P4) (10,000.0000 %)\n" +
-"(100) (P5) (10,000.00000 %)\n" +
-"(100) (P6) (10,000.000000 %)\n" +
-"(100) (P7) (10,000.0000000 %)\n" +
-"(100) (P8) (10,000.00000000 %)\n" +
-"(100) (P9) (10,000.000000000 %)\n" +
-"(100) (P10) (10,000.0000000000 %)\n" +
-"(100) (P99) (10,000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 %)\n" +
-"(100) (X) (64)\n" +
-"(100) (X0) (64)\n" +
-"(100) (X1) (64)\n" +
-"(100) (X2) (64)\n" +
-"(100) (X3) (064)\n" +
-"(100) (X4) (0064)\n" +
-"(100) (X5) (00064)\n" +
-"(100) (X6) (000064)\n" +
-"(100) (X7) (0000064)\n" +
-"(100) (X8) (00000064)\n" +
-"(100) (X9) (000000064)\n" +
-"(100) (X10) (0000000064)\n" +
-"(100) (X99) (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064)\n";
-}
-
-}
-
diff --git a/mcs/class/corlib/Test/System/MathTest.cs b/mcs/class/corlib/Test/System/MathTest.cs
deleted file mode 100755
index a6b8feb799a..00000000000
--- a/mcs/class/corlib/Test/System/MathTest.cs
+++ /dev/null
@@ -1,614 +0,0 @@
-// MathTest.cs
-//
-// Jon Guymon (guymon@slackworks.com)
-//
-// (C) 2002 Jon Guymon
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests.System
-{
-
-public class MathTest : TestCase {
-
- public MathTest() : base ("System.Math testsuite") {}
- public MathTest(string name) : base(name) {}
-
- protected override void SetUp() {}
- protected override void TearDown() {}
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(MathTest));
- }
- }
-
- static double x = 0.1234;
- static double y = 12.345;
-
- public void TestDecimalAbs() {
- decimal a = -9.0M;
-
- Assert(9.0M == Math.Abs(a));
- }
-
-
- public void TestDoubleAbs() {
- double a = -9.0D;
-
- Assert(9.0D == Math.Abs(a));
- }
-
- public void TestFloatAbs() {
- float a = -9.0F;
-
- Assert(9.0F == Math.Abs(a));
- }
-
- public void TestLongAbs() {
- long a = -9L;
- long b = Int64.MinValue;
-
- Assert(9L == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestIntAbs() {
- int a = -9;
- int b = Int32.MinValue;
-
- Assert(9 == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestSbyteAbs() {
- sbyte a = -9;
- sbyte b = SByte.MinValue;
-
- Assert(9 == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestShortAbs() {
- short a = -9;
- short b = Int16.MinValue;
-
- Assert(9 == Math.Abs(a));
- try {
- Math.Abs(b);
- Fail("Should raise System.OverflowException");
- } catch(Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- }
-
- public void TestAcos() {
- double a = Math.Acos(x);
- double b = 1.4470809809523457;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Acos(-1.01D)));
- Assert(double.IsNaN(Math.Acos(1.01D)));
- }
-
- public void TestAsin() {
- double a = Math.Asin(x);
- double b = 0.12371534584255098;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Asin(-1.01D)));
- Assert(double.IsNaN(Math.Asin(1.01D)));
- }
-
- public void TestAtan() {
- double a = Math.Atan(x);
- double b = 0.12277930094473837;
- double c = 1.5707963267948966;
- double d = -1.5707963267948966;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert("should return NaN",
- double.IsNaN(Math.Atan(double.NaN)));
- Assert(Math.Atan(double.PositiveInfinity).ToString("G99")+" != "+c.ToString("G99"),
- Math.Abs((double)Math.Atan(double.PositiveInfinity) - c) <= double.Epsilon);
- Assert(Math.Atan(double.NegativeInfinity).ToString("G99")+" != "+d.ToString("G99"),
- Math.Abs((double)Math.Atan(double.NegativeInfinity) - d) <= double.Epsilon);
- }
-
- public void TestAtan2() {
- double a = Math.Atan2(x, y);
- double b = 0.0099956168687207747;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Acos(-2D)));
- Assert(double.IsNaN(Math.Acos(2D)));
- }
-
- public void TestCos() {
- double a = Math.Cos(x);
- double b = 0.99239587670489104;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestCosh() {
- double a = Math.Cosh(x);
- double b = 1.0076234465130722;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(Math.Cosh(double.NegativeInfinity) == double.PositiveInfinity);
- Assert(Math.Cosh(double.PositiveInfinity) == double.PositiveInfinity);
- Assert(double.IsNaN(Math.Cosh(double.NaN)));
- }
-
- public void TestSin() {
- double a = Math.Sin(x);
- double b = 0.12308705821137626;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestSinh() {
- double a = Math.Sinh(x);
- double b = 0.12371341868561381;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestTan() {
- double a = Math.Tan(x);
- double b = 0.12403019913793806;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestTanh() {
- double a = Math.Tanh(x);
- double b = 0.12277743150353424;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestSqrt() {
- double a = Math.Sqrt(x);
- double b = 0.35128336140500593;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- }
-
- public void TestExp() {
- double a = Math.Exp(x);
- double b = 1.1313368651986859;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Exp(double.NaN)));
- Assert(Math.Exp(double.NegativeInfinity) == 0);
- Assert(Math.Exp(double.PositiveInfinity) == double.PositiveInfinity);
- }
-
- public void TestCeiling() {
- int iTest = 1;
- try {
- double a = Math.Ceiling(1.5);
- double b = 2;
-
- iTest++;
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- iTest++;
- Assert(Math.Ceiling(double.NegativeInfinity) == double.NegativeInfinity);
- iTest++;
- Assert(Math.Ceiling(double.PositiveInfinity) == double.PositiveInfinity);
- iTest++;
- Assert(double.IsNaN(Math.Ceiling(double.NaN)));
- } catch (Exception e) {
- Fail("Unexpected Exception at iTest=" + iTest + ": " + e);
- }
- }
-
- public void TestFloor() {
- try {
- double a = Math.Floor(1.5);
- double b = 1;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(Math.Floor(double.NegativeInfinity) == double.NegativeInfinity);
- Assert(Math.Floor(double.PositiveInfinity) == double.PositiveInfinity);
- Assert(double.IsNaN(Math.Floor(double.NaN)));
- } catch (Exception e) {
- Fail("Unexpected Exception: " + e.ToString());
- }
- }
-
- public void TestIEEERemainder() {
- double a = Math.IEEERemainder(y, x);
- double b = 0.0050000000000007816;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.IEEERemainder(y, 0)));
- }
-
- public void TestLog() {
- double a = Math.Log(y);
- double b = 2.513251122797143;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Log(-1)));
- Assert(double.IsNaN(Math.Log(double.NaN)));
-
- // MS docs say this should be PositiveInfinity
- Assert(Math.Log(0) == double.NegativeInfinity);
- Assert(Math.Log(double.PositiveInfinity) == double.PositiveInfinity);
- }
-
- public void TestLog2() {
- double a = Math.Log(x, y);
- double b = -0.83251695325303621;
-
- Assert(a + " != " + b + " because diff is " + Math.Abs(a - b), (Math.Abs(a - b) <= 1e-14));
- Assert(double.IsNaN(Math.Log(-1, y)));
- Assert(double.IsNaN(Math.Log(double.NaN, y)));
- Assert(double.IsNaN(Math.Log(x, double.NaN)));
- Assert(double.IsNaN(Math.Log(double.NegativeInfinity, y)));
- Assert(double.IsNaN(Math.Log(x, double.NegativeInfinity)));
- Assert(double.IsNaN(Math.Log(double.PositiveInfinity, double.PositiveInfinity)));
-
- // MS docs say this should be PositiveInfinity
- Assert(Math.Log(0, y) == double.NegativeInfinity);
- Assert(Math.Log(double.PositiveInfinity, y) == double.PositiveInfinity);
- Assert(Math.Log(x, double.PositiveInfinity) == 0);
- }
-
- public void TestLog10() {
- double a = Math.Log10(x);
- double b = -0.90868484030277719;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"),
- (Math.Abs(a - b) <= double.Epsilon));
- Assert(double.IsNaN(Math.Log10(-1)));
- Assert(double.IsNaN(Math.Log10(double.NaN)));
-
- // MS docs say this should be PositiveInfinity
- Assert(Math.Log10(0) == double.NegativeInfinity);
- Assert(Math.Log10(double.PositiveInfinity) == double.PositiveInfinity);
-
- }
-
- public void TestPow() {
- int iTest = 1;
-
- try {
- double a = Math.Pow(y, x);
- double b = 1.363609446060212;
-
- Assert(a.ToString("G99") + " != " + b.ToString("G99"), (Math.Abs(a - b) <= double.Epsilon));
- iTest++;
- Assert (double.IsNaN(Math.Pow(y, double.NaN)));
- iTest++;
- Assert (double.IsNaN(Math.Pow(double.NaN, x)));
- iTest++;
- Assert ("Math.Pow(double.NegativeInfinity, 1) should be NegativeInfinity", double.IsNegativeInfinity(Math.Pow(double.NegativeInfinity, 1)));
- iTest++;
- Assert ("Math.Pow(double.NegativeInfinity, 2) should be PositiveInfinity", double.IsPositiveInfinity(Math.Pow(double.NegativeInfinity, 2)));
-
- // MS docs say this should be 0
- iTest++;
- Assert(double.IsNaN(Math.Pow(1, double.NegativeInfinity)));
- iTest++;
- AssertEquals ("Math.Pow(double.PositiveInfinity, double.NegativeInfinity)", (double)0, Math.Pow(double.PositiveInfinity, double.NegativeInfinity));
- iTest++;
- Assert ("Math.Pow(double.PositiveInfinity, 1) should be PositiveInfinity", double.IsPositiveInfinity(Math.Pow(double.PositiveInfinity, 1)));
-
- // MS docs say this should be PositiveInfinity
- iTest++;
- Assert ("Math.Pow(1, double.PositiveInfinity) should be NaN", double.IsNaN(Math.Pow(1, double.PositiveInfinity)));
- } catch (Exception e) {
- Fail ("Unexpected exception at iTest=" + iTest + ". e=" + e);
- }
- }
-
- public void TestByteMax() {
- byte a = 1;
- byte b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestDecimalMax() {
- decimal a = 1.5M;
- decimal b = 2.5M;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestDoubleMax() {
- double a = 1.5D;
- double b = 2.5D;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestFloatMax() {
- float a = 1.5F;
- float b = 2.5F;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestIntMax() {
- int a = 1;
- int b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestLongMax() {
- long a = 1L;
- long b = 2L;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestSbyteMax() {
- sbyte a = 1;
- sbyte b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestShortMax() {
- short a = 1;
- short b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestUintMax() {
- uint a = 1U;
- uint b = 2U;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestUlongMax() {
- ulong a = 1UL;
- ulong b = 2UL;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestUshortMax() {
- ushort a = 1;
- ushort b = 2;
-
- Assert(b == Math.Max(a, b));
- Assert(b == Math.Max(b, a));
- }
-
- public void TestByteMin() {
- byte a = 1;
- byte b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestDecimalMin() {
- decimal a = 1.5M;
- decimal b = 2.5M;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestDoubleMin() {
- double a = 1.5D;
- double b = 2.5D;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestFloatMin() {
- float a = 1.5F;
- float b = 2.5F;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestIntMin() {
- int a = 1;
- int b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestLongMin() {
- long a = 1L;
- long b = 2L;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestSbyteMin() {
- sbyte a = 1;
- sbyte b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestShortMin() {
- short a = 1;
- short b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestUintMin() {
- uint a = 1U;
- uint b = 2U;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestUlongMin() {
- ulong a = 1UL;
- ulong b = 2UL;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestUshortMin() {
- ushort a = 1;
- ushort b = 2;
-
- Assert(a == Math.Min(a, b));
- Assert(a == Math.Min(b, a));
- }
-
- public void TestDecimalRound() {
- decimal a = 1.5M;
- decimal b = 2.5M;
-
- Assert(Math.Round(a) + " != 2", Math.Round(a) == 2);
- Assert(Math.Round(b) + " != 2", Math.Round(b) == 2);
- }
-
- public void TestDecimalRound2() {
- decimal a = 3.45M;
- decimal b = 3.46M;
-
- AssertEquals ("Should round down", Math.Round(a, 1), 3.4M);
- AssertEquals ("Should round up", Math.Round(b, 1), 3.5M);
- }
-
- public void TestDoubleRound() {
- double a = 1.5D;
- double b = 2.5D;
-
- AssertEquals ("Should round up", Math.Round(a), 2D);
- AssertEquals ("Should round down", Math.Round(b), 2D);
- }
-
- public void TestDoubleRound2() {
- double a = 3.45D;
- double b = 3.46D;
-
- AssertEquals ("Should round down", Math.Round(a, 1), 3.4D);
- AssertEquals ("Should round up", Math.Round(b, 1), 3.5D);
- }
-
- public void TestDecimalSign() {
- decimal a = -5M;
- decimal b = 5M;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0M) == 0);
- }
-
- public void TestDoubleSign() {
- double a = -5D;
- double b = 5D;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0D) == 0);
- }
-
- public void TestFloatSign() {
- float a = -5F;
- float b = 5F;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0F) == 0);
- }
-
- public void TestIntSign() {
- int a = -5;
- int b = 5;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- }
-
- public void TestLongSign() {
- long a = -5L;
- long b = 5L;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0L) == 0);
- }
-
- public void TestSbyteSign() {
- sbyte a = -5;
- sbyte b = 5;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0) == 0);
- }
-
- public void TestShortSign() {
- short a = -5;
- short b = 5;
-
- Assert(Math.Sign(a) == -1);
- Assert(Math.Sign(b) == 1);
- Assert(Math.Sign(0) == 0);
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/MulticastDelegate.cs b/mcs/class/corlib/Test/System/MulticastDelegate.cs
deleted file mode 100644
index 18eef7cc1e0..00000000000
--- a/mcs/class/corlib/Test/System/MulticastDelegate.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-// MulticastDelegate.cs - NUnit Test Cases for MulticastDelegates (C# delegates)
-//
-// Daniel Stodden (stodden@in.tum.de)
-//
-// (C) Daniel Stodden
-//
-
-// these are the standard namespaces you will need. You may need to add more
-// depending on your tests.
-using NUnit.Framework;
-using System;
-
-// all test namespaces start with "MonoTests." Append the Namespace that
-// contains the class you are testing, e.g. MonoTests.System.Collections
-namespace MonoTests.System
-{
-
-// the class name should end with "Test" and start with the name of the class
-// you are testing, e.g. CollectionBaseTest
-public class MulticastDelegateTest : TestCase {
-
- // there should be two constructors for your class. The first one
- // (without parameters) should set the name to something unique.
- // Of course the name of the method is the same as the name of the
- // class
- public MulticastDelegateTest() : base ("System.MulticastDelegate") {}
- public MulticastDelegateTest(string name) : base(name) {}
-
- // this method is run before each Test* method is called. You can put
- // variable initialization, etc. here that is common to each test.
- // Just leave the method empty if you don't need to use it.
- protected override void SetUp() {}
-
- // this method is run after each Test* method is called. You can put
- // clean-up code, etc. here. Whatever needs to be done after each test.
- // Just leave the method empty if you don't need to use it.
- protected override void TearDown() {}
-
- // this property is required. You need change the parameter for
- // typeof() below to be your class.
- public static ITest Suite {
- get {
- return new TestSuite(typeof(MulticastDelegateTest));
- }
- }
-
- private delegate char MyDelegate( ref string s );
-
- private char MethodA( ref string s )
- {
- s += "a";
- return 'a';
- }
-
- private char MethodB( ref string s )
- {
- s += "b";
- return 'b';
- }
-
- private char MethodC( ref string s )
- {
- s += "c";
- return 'c';
- }
-
- private char MethodD( ref string s )
- {
- s += "d";
- return 'd';
- }
-
- public void TestEquals()
- {
- MyDelegate dela = new MyDelegate( MethodA );
- MyDelegate delb = new MyDelegate( MethodB );
- MyDelegate delc = new MyDelegate( MethodC );
-
- AssertEquals( "#A01", false, dela == delb );
-
- MyDelegate del1, del2;
-
- del1 = dela + delb;
- del2 = delb + delc;
- AssertEquals( "#A02", false, del1 == del2 );
-
- del1 += delc;
- del2 = dela + del2;
- AssertEquals( "#A03", true, del1 == del2 );
- }
-
- public void TestCombineRemove()
- {
- MyDelegate dela = new MyDelegate( MethodA );
- MyDelegate delb = new MyDelegate( MethodB );
- MyDelegate delc = new MyDelegate( MethodC );
- MyDelegate deld = new MyDelegate( MethodD );
-
- string val;
- char res;
-
- // test combine
- MyDelegate del1, del2;
- del1 = dela + delb + delb + delc + delb + delb + deld;
- val = "";
- res = del1( ref val );
- AssertEquals( "#A01", "abbcbbd", val );
- AssertEquals( "#A02", 'd', res );
-
- // test remove
- del2 = del1 - ( delb + delb );
- val = "";
- res = del2( ref val );
- AssertEquals( "#A03", "abbcd", val );
- AssertEquals( "#A04", 'd', res );
-
- // we did not affect del1, did we?
- val = "";
- res = del1( ref val );
- AssertEquals( "#A05", "abbcbbd", val );
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System/ObjectTest.cs b/mcs/class/corlib/Test/System/ObjectTest.cs
deleted file mode 100644
index 5a9545f390a..00000000000
--- a/mcs/class/corlib/Test/System/ObjectTest.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-// ObjectTest.cs - NUnit Test Cases for the System.Object struct
-//
-// David Brandt (bucky@keystreams.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class ObjectTest : TestCase
-{
- public ObjectTest() : base ("MonoTests.System.ObjectTest testsuite") {}
- public ObjectTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- protected override void TearDown()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(ObjectTest));
- }
- }
-
- public void TestCtor() {
- Object o = new Object();
- AssertNotNull("Can I at least get an _Object_, please?", o);
- }
-
- public void TestEquals1() {
- {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- x.Equals(x));
- Assert("object should not equal null",
- !x.Equals(null));
- Assert("Different objects should not equal 1",
- !x.Equals(y));
- Assert("Different objects should not equal 2",
- !y.Equals(x));
- }
- {
- double x = Double.NaN;
- double y = Double.NaN;
- Assert("NaNs should always equal each other",
- ((Object)x).Equals(y));
- }
- }
- public void TestEquals2() {
- {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- Object.Equals(x,x));
- Assert("object should not equal null",
- !Object.Equals(x,null));
- Assert("null should not equal object",
- !Object.Equals(null,x));
- Assert("Different objects should not equal 1",
- !Object.Equals(x,y));
- Assert("Different objects should not equal 2",
- !Object.Equals(y,x));
- Assert("null should not equal null",
- Object.Equals(null,null));
- }
- {
- double x = Double.NaN;
- double y = Double.NaN;
- Assert("NaNs should always equal each other",
- Object.Equals(x,y));
- }
- }
-
- public void TestGetHashCode() {
- Object x = new Object();
- AssertEquals("Object's hash code should not change",
- x.GetHashCode(), x.GetHashCode());
- }
-
- public void TestGetType() {
- Object x = new Object();
- AssertNotNull("Should get a type for Object", x.GetType());
- AssertEquals("Bad name for Object type", "System.Object",
- x.GetType().ToString());
- }
-
- public void TestReferenceEquals() {
- Object x = new Object();
- Object y = new Object();
- Assert("Object should equal itself",
- Object.ReferenceEquals(x,x));
- Assert("object should not equal null",
- !Object.ReferenceEquals(x,null));
- Assert("null should not equal object",
- !Object.ReferenceEquals(null,x));
- Assert("Different objects should not equal 1",
- !Object.ReferenceEquals(x,y));
- Assert("Different objects should not equal 2",
- !Object.ReferenceEquals(y,x));
- Assert("null should not equal null",
- Object.ReferenceEquals(null,null));
- }
-
- public void TestToString() {
- Object x = new Object();
- Object y = new Object();
- AssertEquals("All Objects should have same string rep",
- x.ToString(), y.ToString());
- }
-}
-}
diff --git a/mcs/class/corlib/Test/System/RandomTest.cs b/mcs/class/corlib/Test/System/RandomTest.cs
deleted file mode 100644
index 74146dea1c6..00000000000
--- a/mcs/class/corlib/Test/System/RandomTest.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// System.Random Test Cases
-//
-// Author: Bob Smith <bob@thestuff.net>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System {
-
-public class RandomTest : TestCase
-{
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RandomTest));
- }
- }
-
- public RandomTest() : base ("MonoTests.System.RandomTest testcase") {}
- public RandomTest(string name): base(name){}
- public void TestDouble()
- {
- Random r = new Random();
- int i;
- double c=0;
- for (i=0; i<20; i++) c+=r.NextDouble();
- c/=i;
- Assert (c.ToString() + " is out of range.", c < .7 && c > .3);
- }
- public void TestSeed()
- {
- Random r = new Random(42);
- Random r2 = new Random(42);
- int i;
- double c=0, c2=0;
- for (i=0; i<20; i++)
- {
- c += r.NextDouble();
- c2 += r2.NextDouble();
- }
- AssertEquals(c, c2);
- }
- public void TestNext()
- {
- Random r = new Random();
- int i;
- long c;
- for (i=0; i<20; i++)
- {
- c = r.Next();
- Assert (c < Int32.MaxValue && c >= 0);
- }
- }
- public void TestNextMax()
- {
- Random r = new Random();
- int i;
- long c;
- for (i=0; i<20; i++)
- {
- c = r.Next(10);
- Assert (c < 10 && c >= 0);
- }
- }
- public void TestNextMinMax()
- {
- Random r = new Random();
- int i;
- long c;
- AssertEquals ("#1 Failed where min == max", 42, r.Next (42, 42));
- AssertEquals ("#2 Failed where min == max", Int32.MaxValue, r.Next (Int32.MaxValue,Int32.MaxValue));
- AssertEquals ("#3 Failed where min == max", Int32.MinValue, r.Next (Int32.MinValue,Int32.MinValue));
- AssertEquals ("#4 Failed where min == max", 0, r.Next (0, 0));
- for (i = 1; i <= Int32.MaxValue / 2; i *= 2)
- {
- c = r.Next (i, i * 2);
- Assert ("At i=" + i + " c < i*2 failed", c < i * 2);
- Assert ("At i=" + i + " c >= i failed", c >= i);
- }
- for (i = -1; i >= Int32.MinValue / 2; i *= 2)
- {
- c = r.Next (i * 2, i);
- Assert ("At i=" + i + " c < i*2 failed", c < i);
- Assert ("At i=" + i + " c >= i failed", c >= i * 2);
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs b/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs
deleted file mode 100644
index 728408b3b1d..00000000000
--- a/mcs/class/corlib/Test/System/ResolveEventArgsTest.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// System.ResolveEventArgs Test Cases
-//
-// Author: Nick Drochak <ndrochak@gol.com>
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System {
-
-public class ResolveEventArgsTest : TestCase
-{
- public static ITest Suite {
- get {
- return new TestSuite(typeof(RandomTest));
- }
- }
-
- public ResolveEventArgsTest() : base ("MonoTests.System.ResolveEventArgsTest testcase") {}
- public ResolveEventArgsTest(string name): base(name){}
-
- public void TestTheWholeThing()
- {
- ResolveEventArgs REA = new ResolveEventArgs("REA_Name");
- Assert ("Name property not correct", REA.Name == "REA_Name");
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/SByteTest.cs b/mcs/class/corlib/Test/System/SByteTest.cs
deleted file mode 100644
index 0005eb55c63..00000000000
--- a/mcs/class/corlib/Test/System/SByteTest.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-// SByteTest.cs - NUnit Test Cases for the System.SByte struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class SByteTest : TestCase
-{
- private const SByte MySByte1 = -42;
- private const SByte MySByte2 = -128;
- private const SByte MySByte3 = 127;
- private const string MyString1 = "-42";
- private const string MyString2 = "-128";
- private const string MyString3 = "127";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"("+NumberFormatInfo.CurrentInfo.CurrencySymbol+"128.00)",
- "-128", "-1.280000e+002", "-128.00",
- "-128", "-128.00", "-12,800.00 %", "80"};
- private string[] Results2 = {NumberFormatInfo.CurrentInfo.CurrencySymbol+"127.00000",
- "00127", "1.27000e+002", "127.00000",
- "127", "127.00000", "12,700.00000 %", "0007f"};
- private string[] ResultsNfi1 = {"("+NumberFormatInfo.InvariantInfo.CurrencySymbol+"128.00)",
- "-128", "-1.280000e+002", "-128.00",
- "-128", "-128.00", "-12,800.00 %", "80"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"127.00000",
- "00127", "1.27000e+002", "127.00000",
- "127", "127.00000", "12,700.00000 %", "0007f"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public SByteTest() : base ("MonoTests.System.SByteTest testcase") {}
- public SByteTest(string name) : base(name) {}
-
- protected override void SetUp()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(SByteTest));
- }
- }
-
- public void TestMinMax()
- {
- AssertEquals(SByte.MinValue, MySByte2);
- AssertEquals(SByte.MaxValue, MySByte3);
- }
-
- public void TestCompareTo()
- {
- Assert(MySByte3.CompareTo(MySByte2) > 0);
- Assert(MySByte2.CompareTo(MySByte2) == 0);
- Assert(MySByte1.CompareTo((SByte)(-42)) == 0);
- Assert(MySByte2.CompareTo(MySByte3) < 0);
- try {
- MySByte2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MySByte1.Equals(MySByte1));
- Assert(MySByte1.Equals((SByte)(-42)));
- Assert(MySByte1.Equals((Int16)(-42)) == false);
- Assert(MySByte1.Equals(MySByte2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MySByte1.GetHashCode();
- MySByte2.GetHashCode();
- MySByte3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MySByte1 == SByte.Parse(MyString1));
- Assert(MySByte2 == SByte.Parse(MyString2));
- Assert(MySByte3 == SByte.Parse(MyString3));
- try {
- SByte.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- SByte.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = SByte.MaxValue + 1;
- SByte.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- AssertEquals("A1", (sbyte)42, SByte.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- SByte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(-42 == SByte.Parse(" -42 ", Nfi));
- try {
- SByte.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == SByte.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- SByte.Parse(NumberFormatInfo.CurrentInfo.CurrencySymbol+"42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- Assert("MyString1, MySByte1.ToString()", String.Compare(MyString1, MySByte1.ToString()) == 0);
- Assert("MyString2, MySByte2.ToString()", String.Compare(MyString2, MySByte2.ToString()) == 0);
- Assert("MyString3, MySByte3.ToString()", String.Compare(MyString3, MySByte3.ToString()) == 0);
- //test ToString(string format)
- /*
- TODO: These tests depend on the culture of the system running the test.
- So, this needs to be tested in a different way.
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", Results1[i]="+Results1[i]+", MySByte2.ToString(Formats1[i])="+MySByte2.ToString(Formats1[i]), String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
- Assert("Results2[i], MySByte3.ToString(Formats2[i])", String.Compare(Results2[i], MySByte3.ToString(Formats2[i])) == 0);
- }
- */
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MySByte2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MySByte2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MySByte2.ToString(Formats1[i], Nfi)) == 0);
- Assert("ResultsNfi2[i], MySByte3.ToString(Formats2[i], Nfi):"+ResultsNfi2[i]+"<==>"+MySByte3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MySByte3.ToString(Formats2[i], Nfi)) == 0);
- }
- try {
- MySByte1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("typeof(FormatException) == e.GetType()", typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/StringTest.cs b/mcs/class/corlib/Test/System/StringTest.cs
deleted file mode 100644
index 9cdb8c2c776..00000000000
--- a/mcs/class/corlib/Test/System/StringTest.cs
+++ /dev/null
@@ -1,1083 +0,0 @@
-// StringTest.cs - NUnit Test Cases for the System.String class
-//
-// Jeffrey Stedfast <fejj@ximian.com>
-// David Brandt <bucky@keystreams.com>
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class StringTest : TestCase
-{
- public StringTest() : base ("MonoTests.System.StringTest testcase") {}
- public StringTest (string name) : base (name) {}
-
- protected override void SetUp ()
- {
- }
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (StringTest));
- }
- }
-
- public void TestLength ()
- {
- string str = "test string";
-
- AssertEquals("wrong length", 11, str.Length);
- }
-
- public void TestCompare ()
- {
- string lesser = "abc";
- string medium = "abcd";
- string greater = "xyz";
- string caps = "ABC";
-
- AssertEquals(0, String.Compare(null, null));
- AssertEquals(1, String.Compare(lesser, null));
-
- Assert (String.Compare (lesser, greater) < 0);
- Assert (String.Compare (greater, lesser) > 0);
- Assert (String.Compare (lesser, lesser) == 0);
- Assert (String.Compare (lesser, medium) < 0);
-
- Assert (String.Compare (lesser, caps, true) == 0);
- Assert (String.Compare (lesser, caps, false) != 0);
- AssertEquals ("A01", String.Compare ("a", "b"), -1);
- AssertEquals ("A02", String.Compare ("b", "a"), 1);
- AssertEquals ("A03", String.Compare ("A", "a"), 1);
- AssertEquals ("A04", String.Compare ("a", "A"), -1);
-
-
- // TODO - test with CultureInfo
-
- string needle = "ab";
- string haystack = "abbcbacab";
- AssertEquals("basic substring check #1", 0,
- String.Compare(needle, 0, haystack, 0, 2));
- AssertEquals("basic substring check #2", -1,
- String.Compare(needle, 0, haystack, 0, 3));
- AssertEquals("basic substring check #3", 0,
- String.Compare("ab", 0, "ab", 0, 2));
- AssertEquals("basic substring check #4", 0,
- String.Compare("ab", 0, "ab", 0, 3));
- AssertEquals("basic substring check #5", 0,
- String.Compare("abc", 0, "ab", 0, 2));
- AssertEquals("basic substring check #6", 1,
- String.Compare("abc", 0, "ab", 0, 5));
- AssertEquals("basic substring check #7", -1,
- String.Compare("ab", 0, "abc", 0, 5));
-
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check #1/" + i, String.Compare(needle, 0, haystack, i, 2) != 0);
- Assert("loop substring check #2/" + i, String.Compare(needle, 0, haystack, i, 3) != 0);
- } else {
- AssertEquals("loop substring check #3/" + i, 0, String.Compare(needle, 0, haystack, i, 2));
- AssertEquals("loop substring check #4/" + i, 0, String.Compare(needle, 0, haystack, i, 3));
- }
- }
-
- needle = "AB";
- AssertEquals("basic substring check #8", 0,
- String.Compare(needle, 0, haystack, 0, 2, true));
- AssertEquals("basic substring check #9", 1,
- String.Compare(needle, 0, haystack, 0, 2, false));
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check #5/" + i, String.Compare(needle, 0, haystack, i, 2, true) != 0);
- Assert("loop substring check #6/" + i, String.Compare(needle, 0, haystack, i, 2, false) != 0);
- } else {
- AssertEquals("loop substring check #7/" + i, 0, String.Compare(needle, 0, haystack, i, 2, true));
- AssertEquals("loop substring check #8/" + i, 1, String.Compare(needle, 0, haystack, i, 2, false));
- }
- }
-
- // TODO - extended format call with CultureInfo
- }
-
- public void TestCompareOrdinal ()
- {
- string lesser = "abc";
- string medium = "abcd";
- string greater = "xyz";
-
- AssertEquals(0, String.CompareOrdinal(null, null));
- AssertEquals(1, String.CompareOrdinal(lesser, null));
-
- Assert (String.CompareOrdinal (lesser, greater) < 0);
- Assert (String.CompareOrdinal (greater, lesser) > 0);
- Assert (String.CompareOrdinal (lesser, lesser) == 0);
- Assert (String.CompareOrdinal (lesser, medium) < 0);
-
- string needle = "ab";
- string haystack = "abbcbacab";
- AssertEquals("basic substring check", 0,
- String.CompareOrdinal(needle, 0, haystack, 0, 2));
- AssertEquals("basic substring miss", -1,
- String.CompareOrdinal(needle, 0, haystack, 0, 3));
- for (int i = 1; i <= (haystack.Length - needle.Length); i++) {
- if (i != 7) {
- Assert("loop substring check " + i, String.CompareOrdinal(needle, 0, haystack, i, 2) != 0);
- Assert("loop substring check " + i, String.CompareOrdinal(needle, 0, haystack, i, 3) != 0);
- } else {
- AssertEquals("loop substring check " + i, 0, String.CompareOrdinal(needle, 0, haystack, i, 2));
- AssertEquals("loop substring check " + i, 0, String.CompareOrdinal(needle, 0, haystack, i, 3));
- }
- }
- }
-
- public void TestCompareTo ()
- {
- string lower = "abc";
- string greater = "xyz";
- string lesser = "abc";
-
- Assert (lower.CompareTo (greater) < 0);
- Assert (lower.CompareTo (lower) == 0);
- Assert (greater.CompareTo (lesser) > 0);
- }
-
- public void TestConcat ()
- {
- string string1 = "string1";
- string string2 = "string2";
- string concat = "string1string2";
-
- Assert (String.Concat (string1, string2) == concat);
- }
-
- public void TestCopy()
- {
- string s1 = "original";
- string s2 = String.Copy(s1);
- AssertEquals("String copy no good", s1, s2);
-
- bool errorThrown = false;
- try {
- string s = String.Copy(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null copy shouldn't be good", errorThrown);
- }
-
- public void TestCopyTo()
- {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- s1.CopyTo(0, (char[])null, 0, s1.Length);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null CopyTo shouldn't be good", errorThrown);
-
- char[] c1 = new char[s1.Length];
- string s2 = new String(c1);
- Assert("char string not bad to start", !s1.Equals(s2));
- for (int i = 0; i < s1.Length; i++) {
- s1.CopyTo(i, c1, i, 1);
- }
- s2 = new String(c1);
- AssertEquals("char-by-char copy bad", s1, s2);
- }
-
- public void TestEndsWith()
- {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- bool huh = s1.EndsWith(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null EndsWith shouldn't be good", errorThrown);
-
- Assert("should match", s1.EndsWith("l"));
- Assert("should match 2", s1.EndsWith("inal"));
- Assert("should fail", !s1.EndsWith("ina"));
- }
-
- public void TestEquals()
- {
- string s1 = "original";
- string yes = "original";
- object y = yes;
- string no = "copy";
-
- Assert("No match for null", !s1.Equals(null));
- Assert("Should match object", s1.Equals(y));
- Assert("Should match", s1.Equals(yes));
- Assert("Shouldn't match", !s1.Equals(no));
-
- Assert("Static nulls should match", String.Equals(null, null));
- Assert("Should match", String.Equals(s1, yes));
- Assert("Shouldn't match", !String.Equals(s1, no));
- }
-
- public void TestFormat ()
- {
- AssertEquals ("Empty format string.", "", String.Format ("", 0));
- AssertEquals ("Single argument.", "100", String.Format ("{0}", 100));
- AssertEquals ("Single argument, right justified.", "X 37X", String.Format ("X{0,5}X", 37));
- AssertEquals ("Single argument, left justified.", "X37 X", String.Format ("X{0,-5}X", 37));
- AssertEquals ("Two arguments.", "The 3 wise men.", String.Format ("The {0} wise {1}.", 3, "men"));
- AssertEquals ("Three arguments.", "do re me fa so.", String.Format ("{0} re {1} fa {2}.", "do", "me", "so"));
- AssertEquals ("Formatted argument.", "###00c0ffee#", String.Format ("###{0:x8}#", 0xc0ffee));
- AssertEquals ("Formatted argument, right justified.", "# 033#", String.Format ("#{0,5:x3}#", 0x33));
- AssertEquals ("Formatted argument, left justified.", "#033 #", String.Format ("#{0,-5:x3}#", 0x33));
- AssertEquals ("Escaped bracket", "typedef struct _MonoObject { ... } MonoObject;", String.Format ("typedef struct _{0} {{ ... }} MonoObject;", "MonoObject"));
- AssertEquals ("With Slash", "Could not find file \"a/b\"", String.Format ("Could not find file \"{0}\"", "a/b"));
- AssertEquals ("With BackSlash", "Could not find file \"a\\b\"", String.Format ("Could not find file \"{0}\"", "a\\b"));
-
- // TODO test format exceptions
-
- // TODO test argument null exceptions
- // This should work, but it doesn't currently.
- // I think I broke the spec...
- //bool errorThrown = false;
- //try {
- //string s = String.Format(null, " ");
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 1", errorThrown);
- //errorThrown = false;
- //try {
- //string s = String.Format(null, " ", " ");
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 2", errorThrown);
- //errorThrown = false;
- //try {
- //string s = String.Format(" ", null);
- //} catch (ArgumentNullException) {
- //errorThrown = true;
- //}
- //Assert("error not thrown 3", errorThrown);
- }
-
- public void TestGetEnumerator()
- {
- string s1 = "original";
- char[] c1 = new char[s1.Length];
- string s2 = new String(c1);
- Assert("pre-enumerated string should not match", !s1.Equals(s2));
- CharEnumerator en = s1.GetEnumerator();
- AssertNotNull("null enumerator", en);
-
- for (int i = 0; i < s1.Length; i++) {
- en.MoveNext();
- c1[i] = en.Current;
- }
- s2 = new String(c1);
- AssertEquals("enumerated string should match", s1, s2);
- }
-
- public void TestGetHashCode()
- {
- string s1 = "original";
- // TODO - weak test, currently. Just verifies determinicity.
- AssertEquals("same string, same hash code",
- s1.GetHashCode(), s1.GetHashCode());
- }
-
- public void TestGetType() {
- string s1 = "original";
- AssertEquals("String type", "System.String", s1.GetType().ToString());
- }
-
- public void TestGetTypeCode() {
- string s1 = "original";
- Assert(s1.GetTypeCode().Equals(TypeCode.String));
- }
-
- public void TestIndexOf() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- int i = s1.IndexOf('q', s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf('q', s1.Length + 1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf("huh", s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf("huh", s1.Length + 1, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOf(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- AssertEquals("basic char index", 1, s1.IndexOf('r'));
- AssertEquals("basic char index", 2, s1.IndexOf('i'));
- AssertEquals("basic char index - no", -1, s1.IndexOf('q'));
-
- AssertEquals("basic string index", 1, s1.IndexOf("rig"));
- AssertEquals("basic string index", 2, s1.IndexOf("i"));
- AssertEquals("basic string index - no", -1, s1.IndexOf("rag"));
-
- AssertEquals("stepped char index", 1, s1.IndexOf('r', 1));
- AssertEquals("stepped char index", 2, s1.IndexOf('i', 1));
- AssertEquals("stepped char index", 4, s1.IndexOf('i', 3));
- AssertEquals("stepped char index", -1, s1.IndexOf('i', 5));
- AssertEquals("stepped char index", -1, s1.IndexOf('l', s1.Length));
-
- AssertEquals("stepped limited char index",
- 1, s1.IndexOf('r', 1, 1));
- AssertEquals("stepped limited char index",
- -1, s1.IndexOf('r', 0, 1));
- AssertEquals("stepped limited char index",
- 2, s1.IndexOf('i', 1, 3));
- AssertEquals("stepped limited char index",
- 4, s1.IndexOf('i', 3, 3));
- AssertEquals("stepped limited char index",
- -1, s1.IndexOf('i', 5, 3));
-
- s1 = "original original";
- AssertEquals("stepped string index 1",
- 0, s1.IndexOf("original", 0));
- AssertEquals("stepped string index 2",
- 9, s1.IndexOf("original", 1));
- AssertEquals("stepped string index 3",
- -1, s1.IndexOf("original", 10));
- AssertEquals("stepped limited string index 1",
- 1, s1.IndexOf("rig", 0, 5));
- AssertEquals("stepped limited string index 2",
- -1, s1.IndexOf("rig", 0, 3));
- AssertEquals("stepped limited string index 3",
- 10, s1.IndexOf("rig", 2, 15));
- AssertEquals("stepped limited string index 4",
- -1, s1.IndexOf("rig", 2, 3));
- }
-
- public void TestIndexOfAny() {
- string s1 = "abcdefghijklm";
-
- bool errorThrown = false;
- try {
- int i = s1.IndexOfAny(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- char[] c1 = {'a', 'e', 'i', 'o', 'u'};
- AssertEquals("first vowel", 0, s1.IndexOfAny(c1));
- AssertEquals("second vowel", 4, s1.IndexOfAny(c1, 1));
- AssertEquals("out of vowels", -1, s1.IndexOfAny(c1, 9));
- AssertEquals("second vowel in range",
- 4, s1.IndexOfAny(c1, 1, 4));
- AssertEquals("second vowel out of range",
- -1, s1.IndexOfAny(c1, 1, 3));
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(c1, s1.Length+1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.IndexOfAny(c1, s1.Length+1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
- }
-
- public void TestInsert() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- string result = s1.Insert(0, null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("Null arg error", errorThrown);
-
- errorThrown = false;
- try {
- string result = s1.Insert(s1.Length+1, "Hi!");
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- AssertEquals("front insert",
- "Hi!original", s1.Insert(0, "Hi!"));
- AssertEquals("back insert",
- "originalHi!", s1.Insert(s1.Length, "Hi!"));
- AssertEquals("middle insert",
- "origHi!inal", s1.Insert(4, "Hi!"));
- }
-
- public void TestIntern() {
- bool errorThrown = false;
- try {
- string s = String.Intern(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- string s1 = "original";
- AssertEquals("One string's reps are both the same",
- String.Intern(s1), String.Intern(s1));
-
- string s2 = "originally";
- Assert("Different strings, different reps",
- String.Intern(s1) != String.Intern(s2));
- }
-
- public void TestIsInterned() {
- bool errorThrown = false;
- try {
- string s = String.IsInterned(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- // FIXME - it seems like this should work, but no.
- // I don't know how it's possible to get a null
- // returned from IsInterned.
- //Assert("no intern for regular string",
- //String.IsInterned("original") == null);
-
- string s1 = "original";
- AssertEquals("is interned", s1, String.IsInterned(s1));
- }
-
- public void TestJoin() {
- bool errorThrown = false;
- try {
- string s = String.Join(" ", null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null arg error", errorThrown);
-
- string[] chunks = {"this", "is", "a", "test"};
- AssertEquals("Basic join", "this is a test",
- String.Join(" ", chunks));
- AssertEquals("Basic join", "this.is.a.test",
- String.Join(".", chunks));
-
- AssertEquals("Subset join", "is a",
- String.Join(" ", chunks, 1, 2));
- AssertEquals("Subset join", "is.a",
- String.Join(".", chunks, 1, 2));
- AssertEquals("Subset join", "is a test",
- String.Join(" ", chunks, 1, 3));
-
- errorThrown = false;
- try {
- string s = String.Join(" ", chunks, 2, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- }
-
- public void TestLastIndexOf() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- int i = s1.LastIndexOf('q', -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf('q', -1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error for char", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf("huh", s1.Length + 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf("huh", s1.Length + 1, 3);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range for string", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null, 0);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOf(null, 0, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null string error", errorThrown);
-
- AssertEquals("basic char index", 1, s1.LastIndexOf('r'));
- AssertEquals("basic char index", 4, s1.LastIndexOf('i'));
- AssertEquals("basic char index - no", -1, s1.LastIndexOf('q'));
-
- AssertEquals("basic string index", 1, s1.LastIndexOf("rig"));
- AssertEquals("basic string index", 4, s1.LastIndexOf("i"));
- AssertEquals("basic string index - no", -1,
- s1.LastIndexOf("rag"));
-
-
-
- AssertEquals("stepped char index", 1,
- s1.LastIndexOf('r', s1.Length-1));
- AssertEquals("stepped char index", 4,
- s1.LastIndexOf('i', s1.Length-1));
- AssertEquals("stepped char index", 2,
- s1.LastIndexOf('i', 3));
- AssertEquals("stepped char index", -1,
- s1.LastIndexOf('i', 1));
-
- AssertEquals("stepped limited char index",
- 1, s1.LastIndexOf('r', 1, 1));
- AssertEquals("stepped limited char index",
- -1, s1.LastIndexOf('r', 0, 1));
- AssertEquals("stepped limited char index",
- 4, s1.LastIndexOf('i', 6, 3));
- AssertEquals("stepped limited char index",
- 2, s1.LastIndexOf('i', 3, 3));
- AssertEquals("stepped limited char index",
- -1, s1.LastIndexOf('i', 1, 2));
-
- s1 = "original original";
- AssertEquals("stepped string index #1",
- 9, s1.LastIndexOf("original", s1.Length));
- AssertEquals("stepped string index #2",
- 0, s1.LastIndexOf("original", s1.Length-2));
- AssertEquals("stepped string index #3",
- -1, s1.LastIndexOf("original", s1.Length-11));
- AssertEquals("stepped string index #4",
- -1, s1.LastIndexOf("translator", 2));
- AssertEquals("stepped limited string index #1",
- 10, s1.LastIndexOf("rig", s1.Length-1, 10));
- AssertEquals("stepped limited string index #2",
- -1, s1.LastIndexOf("rig", s1.Length, 3));
- AssertEquals("stepped limited string index #3",
- 10, s1.LastIndexOf("rig", s1.Length-2, 15));
- AssertEquals("stepped limited string index #4",
- -1, s1.LastIndexOf("rig", s1.Length-2, 3));
- }
-
- public void TestLastIndexOfAny() {
- string s1 = ".bcdefghijklm";
-
- bool errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null, s1.Length);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(null, s1.Length, 1);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null char[] error", errorThrown);
-
- char[] c1 = {'a', 'e', 'i', 'o', 'u'};
- AssertEquals("first vowel", 8, s1.LastIndexOfAny(c1));
- AssertEquals("second vowel", 4, s1.LastIndexOfAny(c1, 7));
- AssertEquals("out of vowels", -1, s1.LastIndexOfAny(c1, 3));
- AssertEquals("second vowel in range",
- 4, s1.LastIndexOfAny(c1, s1.Length-6, 4));
- AssertEquals("second vowel out of range",
- -1, s1.LastIndexOfAny(c1, s1.Length-6, 3));
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(c1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
-
- errorThrown = false;
- try {
- int i = s1.LastIndexOfAny(c1, -1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Out of range error", errorThrown);
- }
-
- public void TestPadLeft() {
- string s1 = "Hi!";
-
- bool errorThrown = false;
- try {
- string s = s1.PadLeft(-1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Bad argument error", errorThrown);
-
- AssertEquals("Too little padding",
- s1, s1.PadLeft(s1.Length-1));
- AssertEquals("Some padding",
- " Hi!", s1.PadLeft(5));
- }
-
- public void TestPadRight() {
- string s1 = "Hi!";
-
- bool errorThrown = false;
- try {
- string s = s1.PadRight(-1);
- } catch (ArgumentException) {
- errorThrown = true;
- }
- Assert("Bad argument error", errorThrown);
-
- AssertEquals("Too little padding",
- s1, s1.PadRight(s1.Length-1));
- AssertEquals("Some padding",
- "Hi! ", s1.PadRight(5));
- }
-
- public void TestRemove() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- s1.Remove(-1,1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- errorThrown = false;
- try {
- s1.Remove(1,-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
- errorThrown = false;
- try {
- s1.Remove(s1.Length,s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("out of range error", errorThrown);
-
- AssertEquals("basic remove", "oinal",
- s1.Remove(1, 3));
- }
-
- public void TestReplace() {
- string s1 = "original";
-
- AssertEquals("non-hit char", s1, s1.Replace('q','s'));
- AssertEquals("single char", "oxiginal", s1.Replace('r', 'x'));
- AssertEquals("double char", "orxgxnal", s1.Replace('i', 'x'));
-
- bool errorThrown = false;
- try {
- string s = s1.Replace(null, "feh");
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("should get null arg exception", errorThrown);
-
- AssertEquals("replace as remove", "ornal",
- s1.Replace("igi", null));
- AssertEquals("non-hit string", s1, s1.Replace("spam", "eggs"));
- AssertEquals("single string", "orirumal",
- s1.Replace("gin", "rum"));
- AssertEquals("double string", "oreigeinal",
- s1.Replace("i", "ei"));
-
- AssertEquals ("result longer", ":!:", "::".Replace ("::", ":!:"));
- }
-
- public void TestSplit() {
- string s1 = "abcdefghijklm";
- char[] c1 = {'q', 'r'};
- AssertEquals("No splitters", s1, (s1.Split(c1))[0]);
-
- char[] c2 = {'a', 'e', 'i', 'o', 'u'};
- string[] chunks = s1.Split(c2);
- AssertEquals("First chunk", "", chunks[0]);
- AssertEquals("Second chunk", "bcd", chunks[1]);
- AssertEquals("Third chunk", "fgh", chunks[2]);
- AssertEquals("Fourth chunk", "jklm", chunks[3]);
-
- {
- bool errorThrown = false;
- try {
- chunks = s1.Split(c2, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("Split out of range", errorThrown);
- }
-
- chunks = s1.Split(c2, 2);
- AssertEquals("Limited chunk", 2, chunks.Length);
- AssertEquals("First limited chunk", "", chunks[0]);
- AssertEquals("Second limited chunk", "bcdefghijklm", chunks[1]);
-
- string s3 = "1.0";
- char[] c3 = {'.'};
- chunks = s3.Split(c3,2);
- AssertEquals("1.0 split length", 2, chunks.Length);
- AssertEquals("1.0 split first chunk", "1", chunks[0]);
- AssertEquals("1.0 split second chunk", "0", chunks[1]);
-
- string s4 = "1.0.0";
- char[] c4 = {'.'};
- chunks = s4.Split(c4,2);
- AssertEquals("1.0.0 split length", 2, chunks.Length);
- AssertEquals("1.0.0 split first chunk", "1", chunks[0]);
- AssertEquals("1.0.0 split second chunk", "0.0", chunks[1]);
-
- string s5 = ".0.0";
- char[] c5 = {'.'};
- chunks = s5.Split (c5, 2);
- AssertEquals(".0.0 split length", 2, chunks.Length);
- AssertEquals(".0.0 split first chunk", "", chunks[0]);
- AssertEquals(".0.0 split second chunk", "0.0", chunks[1]);
-
- string s6 = ".0";
- char[] c6 = {'.'};
- chunks = s6.Split (c6, 2);
- AssertEquals(".0 split length", 2, chunks.Length);
- AssertEquals(".0 split first chunk", "", chunks[0]);
- AssertEquals(".0 split second chunk", "0", chunks[1]);
-
- string s7 = "0.";
- char[] c7 = {'.'};
- chunks = s7.Split (c7, 2);
- AssertEquals("0. split length", 2, chunks.Length);
- AssertEquals("0. split first chunk", "0", chunks[0]);
- AssertEquals("0. split second chunk", "", chunks[1]);
-
- string s8 = "0.0000";
- char[] c8 = {'.'};
- chunks = s8.Split (c8, 2);
- AssertEquals("0.0000/2 split length", 2, chunks.Length);
- AssertEquals("0.0000/2 split first chunk", "0", chunks[0]);
- AssertEquals("0.0000/2 split second chunk", "0000", chunks[1]);
-
- chunks = s8.Split (c8, 3);
- AssertEquals("0.0000/3 split length", 2, chunks.Length);
- AssertEquals("0.0000/3 split first chunk", "0", chunks[0]);
- AssertEquals("0.0000/3 split second chunk", "0000", chunks[1]);
-
- chunks = s8.Split (c8, 1);
- AssertEquals("0.0000/1 split length", 1, chunks.Length);
- AssertEquals("0.0000/1 split first chunk", "0.0000", chunks[0]);
-
- chunks = s1.Split(c2, 1);
- AssertEquals("Single split", 1, chunks.Length);
- AssertEquals("Single chunk", s1, chunks[0]);
-
- chunks = s1.Split(c2, 0);
- AssertEquals("Zero split", 0, chunks.Length);
- }
-
- public void TestStartsWith() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- bool huh = s1.StartsWith(null);
- } catch (ArgumentNullException) {
- errorThrown = true;
- }
- Assert("null StartsWith shouldn't be good", errorThrown);
-
- Assert("should match", s1.StartsWith("o"));
- Assert("should match 2", s1.StartsWith("orig"));
- Assert("should fail", !s1.StartsWith("rig"));
- }
-
- public void TestSubstring() {
- string s1 = "original";
-
- bool errorThrown = false;
- try {
- string s = s1.Substring(s1.Length+1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(-1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- errorThrown = false;
- try {
- string s = s1.Substring(1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(s1.Length, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- string s = s1.Substring(1, s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- AssertEquals("basic substring", "inal",
- s1.Substring(4));
- AssertEquals("midstring", "igin",
- s1.Substring(2, 4));
- AssertEquals("at end", "",
- s1.Substring(s1.Length, 0));
- }
-
- public void TestToCharArray() {
- string s1 = "original";
- char[] c1 = s1.ToCharArray();
- AssertEquals("right array size", s1.Length, c1.Length);
- AssertEquals("basic char array", s1,
- new String(c1));
-
- bool errorThrown = false;
- try {
- s1.ToCharArray(s1.Length, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(1, s1.Length);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(-1, 1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
- errorThrown = false;
- try {
- s1.ToCharArray(1, -1);
- } catch (ArgumentOutOfRangeException) {
- errorThrown = true;
- }
- Assert("error not thrown", errorThrown);
-
- c1 = s1.ToCharArray(0, 3);
- AssertEquals("Starting char array", "ori", new String(c1));
- }
-
- public void TestToLower() {
- string s1 = "OrIgInAl";
- AssertEquals("lowercase failed", "original", s1.ToLower());
-
- // TODO - Again, with CultureInfo
- }
-
- public void TestToString() {
- string s1 = "original";
- AssertEquals("ToString failed!", s1, s1.ToString());
- }
-
- public void TestToUpper() {
- string s1 = "OrIgInAl";
- AssertEquals("uppercase failed", "ORIGINAL", s1.ToUpper());
-
- // TODO - Again, with CultureInfo
- }
-
- public void TestTrim() {
- string s1 = " original\t\n";
- AssertEquals("basic trim failed", "original", s1.Trim());
- AssertEquals("basic trim failed", "original", s1.Trim(null));
-
- s1 = "original";
- AssertEquals("basic trim failed", "original", s1.Trim());
- AssertEquals("basic trim failed", "original", s1.Trim(null));
-
- s1 = " \t \n ";
- AssertEquals("empty trim failed", "", s1.Trim());
- AssertEquals("empty trim failed", "", s1.Trim(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom trim failed",
- "original", s1.Trim(delims));
- }
-
- public void TestTrimEnd() {
- string s1 = " original\t\n";
- AssertEquals("basic TrimEnd failed",
- " original", s1.TrimEnd(null));
-
- s1 = " original";
- AssertEquals("basic TrimEnd failed",
- " original", s1.TrimEnd(null));
-
- s1 = " \t \n \n ";
- AssertEquals("empty TrimEnd failed",
- "", s1.TrimEnd(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom TrimEnd failed",
- "aaaoriginal", s1.TrimEnd(delims));
- }
-
- public void TestTrimStart() {
- string s1 = " original\t\n";
- AssertEquals("basic TrimStart failed",
- "original\t\n", s1.TrimStart(null));
-
- s1 = "original\t\n";
- AssertEquals("basic TrimStart failed",
- "original\t\n", s1.TrimStart(null));
-
- s1 = " \t \n \n ";
- AssertEquals("empty TrimStart failed",
- "", s1.TrimStart(null));
-
- s1 = "aaaoriginalbbb";
- char[] delims = {'a', 'b'};
- AssertEquals("custom TrimStart failed",
- "originalbbb", s1.TrimStart(delims));
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/TimeSpanTest.cs b/mcs/class/corlib/Test/System/TimeSpanTest.cs
deleted file mode 100755
index c3e59151ac3..00000000000
--- a/mcs/class/corlib/Test/System/TimeSpanTest.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-//
-// TimeSpanTest.cs - NUnit Test Cases for the System.TimeSpan struct
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2001 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class TimeSpanTest : TestCase
-{
- public TimeSpanTest() : base ("MonoTests.System.TimeSpanTest testcase") {}
- public TimeSpanTest (string name): base (name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(TimeSpanTest));
- }
- }
-
- public void TestCtors ()
- {
- TimeSpan t1 = new TimeSpan (1234567890);
-
- AssertEquals ("A1", "00:02:03.4567890", t1.ToString ());
- t1 = new TimeSpan (1,2,3);
- AssertEquals ("A2", "01:02:03", t1.ToString ());
- t1 = new TimeSpan (1,2,3,4);
- AssertEquals ("A3", "1.02:03:04", t1.ToString ());
- t1 = new TimeSpan (1,2,3,4,5);
- AssertEquals ("A4", "1.02:03:04.0050000", t1.ToString ());
- t1 = new TimeSpan (-1,2,-3,4,-5);
- AssertEquals ("A5", "-22:02:56.0050000", t1.ToString ());
- t1 = new TimeSpan (0,25,0,0,0);
- AssertEquals ("A6", "1.01:00:00", t1.ToString ());
- }
-
- public void TestProperties ()
- {
- TimeSpan t1 = new TimeSpan (1,2,3,4,5);
- TimeSpan t2 = -t1;
-
- AssertEquals ("A1", 1, t1.Days);
- AssertEquals ("A2", 2, t1.Hours);
- AssertEquals ("A3", 3, t1.Minutes);
- AssertEquals ("A4", 4, t1.Seconds);
- AssertEquals ("A5", 5, t1.Milliseconds);
- AssertEquals ("A6", -1, t2.Days);
- AssertEquals ("A7", -2, t2.Hours);
- AssertEquals ("A8", -3, t2.Minutes);
- AssertEquals ("A9", -4, t2.Seconds);
- AssertEquals ("A10", -5, t2.Milliseconds);
- }
-
- public void TestAdd ()
- {
- TimeSpan t1 = new TimeSpan (2,3,4,5,6);
- TimeSpan t2 = new TimeSpan (1,2,3,4,5);
- TimeSpan t3 = t1 + t2;
- TimeSpan t4 = t1.Add (t2);
- TimeSpan t5;
- bool exception;
-
- AssertEquals ("A1", 3, t3.Days);
- AssertEquals ("A2", 5, t3.Hours);
- AssertEquals ("A3", 7, t3.Minutes);
- AssertEquals ("A4", 9, t3.Seconds);
- AssertEquals ("A5", 11, t3.Milliseconds);
- AssertEquals ("A6", "3.05:07:09.0110000", t4.ToString ());
- try
- {
- t5 = TimeSpan.MaxValue + new TimeSpan (1);
- exception = false;
- }
- catch (OverflowException)
- {
- exception = true;
- }
- Assert ("A7", exception);
- }
-
- public void TestCompare ()
- {
- TimeSpan t1 = new TimeSpan (-1);
- TimeSpan t2 = new TimeSpan (1);
- int res;
- bool exception;
-
- AssertEquals ("A1", -1, TimeSpan.Compare (t1, t2));
- AssertEquals ("A2", 1, TimeSpan.Compare (t2, t1));
- AssertEquals ("A3", 0, TimeSpan.Compare (t2, t2));
- AssertEquals ("A4", -1, TimeSpan.Compare (TimeSpan.MinValue, TimeSpan.MaxValue));
- AssertEquals ("A5", -1, t1.CompareTo (t2));
- AssertEquals ("A6", 1, t2.CompareTo (t1));
- AssertEquals ("A7", 0, t2.CompareTo (t2));
- AssertEquals ("A8", -1, TimeSpan.Compare (TimeSpan.MinValue, TimeSpan.MaxValue));
-
- AssertEquals ("A9", 1, TimeSpan.Zero.CompareTo (null));
-
- try
- {
- res = TimeSpan.Zero.CompareTo("");
- exception = false;
- }
- catch (ArgumentException)
- {
- exception = true;
- }
- Assert ("A10", exception);
-
- AssertEquals ("A11", false, t1 == t2);
- AssertEquals ("A12", false, t1 > t2);
- AssertEquals ("A13", false, t1 >= t2);
- AssertEquals ("A14", true, t1 != t2);
- AssertEquals ("A15", true, t1 < t2);
- AssertEquals ("A16", true, t1 <= t2);
- }
-
- public void TestNegateAndDuration ()
- {
- TimeSpan t1;
- bool exception;
-
- AssertEquals ("A1", "-00:00:00.0012345", new TimeSpan (12345).Negate ().ToString ());
- AssertEquals ("A2", "00:00:00.0012345", new TimeSpan (-12345).Duration ().ToString ());
-
- try
- {
- t1 = TimeSpan.MinValue.Negate ();
- exception = false;
- }
- catch (OverflowException)
- {
- exception = true;
- }
- Assert ("A3", exception);
-
- try
- {
- t1 = TimeSpan.MinValue.Duration ();
- exception = false;
- }
- catch (OverflowException) {
- exception = true;
- }
- Assert ("A4", exception);
-
- AssertEquals ("A5", "-00:00:00.0000077", (-(new TimeSpan (77))).ToString ());
- AssertEquals("A6", "00:00:00.0000077", (+(new TimeSpan(77))).ToString());
- }
-
- public void TestEquals ()
- {
- TimeSpan t1 = new TimeSpan (1);
- TimeSpan t2 = new TimeSpan (2);
- string s = "justastring";
-
- AssertEquals ("A1", true, t1.Equals (t1));
- AssertEquals ("A2", false, t1.Equals (t2));
- AssertEquals ("A3", false, t1.Equals (s));
- AssertEquals ("A4", false, t1.Equals (null));
- AssertEquals ("A5", true, TimeSpan.Equals (t1, t1));
- AssertEquals ("A6", false, TimeSpan.Equals (t1, t2));
- AssertEquals ("A7", false, TimeSpan.Equals (t1, null));
- AssertEquals ("A8", false, TimeSpan.Equals (t1, s));
- AssertEquals ("A9", false, TimeSpan.Equals (s, t2));
- AssertEquals ("A10", true, TimeSpan.Equals (null,null));
- }
-
- public void TestFromXXXX ()
- {
- AssertEquals ("A1", "12.08:16:48", TimeSpan.FromDays (12.345).ToString ());
- AssertEquals ("A2", "12:20:42", TimeSpan.FromHours (12.345).ToString ());
- AssertEquals ("A3", "00:12:20.7000000", TimeSpan.FromMinutes (12.345).ToString ());
- AssertEquals ("A4", "00:00:12.3450000", TimeSpan.FromSeconds (12.345).ToString ());
- AssertEquals ("A5", "00:00:00.0120000", TimeSpan.FromMilliseconds (12.345).ToString ());
- AssertEquals ("A6", "00:00:00.0012345", TimeSpan.FromTicks (12345).ToString ());
- }
-
- public void TestGetHashCode ()
- {
- AssertEquals ("A1", 77, new TimeSpan (77).GetHashCode ());
- }
-
- private void TestParseHelper (string s, bool expectFormat, bool expectOverflow, string expect)
- {
- bool formatException = false;
- bool overflowException = false;
- string result = "junk ";
-
- try {
- result = TimeSpan.Parse (s).ToString ();
- }
- catch (OverflowException) {
- overflowException = true;
- }
- catch (FormatException) {
- formatException = true;
- }
- AssertEquals ("A1", expectFormat, formatException);
- AssertEquals ("A2", expectOverflow, overflowException);
-
- if (!expectOverflow && !expectFormat) {
- AssertEquals ("A3", expect, result);
- }
- }
-
- public void TestParse ()
- {
- TestParseHelper (" 13:45:15 ",false, false, "13:45:15");
- TestParseHelper (" -1:2:3 ", false, false, "-01:02:03");
-
- TestParseHelper (" 25:0:0 ",false, true, "dontcare");
- TestParseHelper ("aaa", true, false, "dontcare");
-
- TestParseHelper ("-21.23:59:59.9999999", false, false, "-21.23:59:59.9999999");
-
- TestParseHelper ("100000000000000.1:1:1", false, true, "dontcare");
- TestParseHelper ("24:60:60", false, true, "dontcare");
- TestParseHelper ("0001:0002:0003.12 ", false, false, "01:02:03.1200000");
-
- TestParseHelper (" 1:2:3:12345678 ", true, false, "dontcare");
- }
-
- public void TestSubstract ()
- {
- TimeSpan t1 = new TimeSpan (2,3,4,5,6);
- TimeSpan t2 = new TimeSpan (1,2,3,4,5);
- TimeSpan t3 = t1 - t2;
- TimeSpan t4 = t1.Subtract (t2);
- TimeSpan t5;
- bool exception;
-
- AssertEquals ("A1", "1.01:01:01.0010000", t3.ToString ());
- AssertEquals ("A2", "1.01:01:01.0010000", t4.ToString ());
- try {
- t5 = TimeSpan.MinValue - new TimeSpan (1);
- exception = false;
- }
- catch (OverflowException) {
- exception = true;
- }
- Assert ("A3", exception);
- }
-
- public void TestToString ()
- {
- TimeSpan t1 = new TimeSpan (1,2,3,4,5);
- TimeSpan t2 = -t1;
-
- AssertEquals ("A1", "1.02:03:04.0050000", t1.ToString ());
- AssertEquals ("A2", "-1.02:03:04.0050000", t2.ToString ());
- AssertEquals ("A3", "10675199.02:48:05.4775807", TimeSpan.MaxValue.ToString ());
- AssertEquals ("A4", "-10675199.02:48:05.4775808", TimeSpan.MinValue.ToString ());
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/TimeZoneTest.cs b/mcs/class/corlib/Test/System/TimeZoneTest.cs
deleted file mode 100644
index c4440d3fee9..00000000000
--- a/mcs/class/corlib/Test/System/TimeZoneTest.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// TimeZoneTest.cs - NUnit Test Cases for the System.TimeZone struct
-//
-// author:
-// Martin Baulig (martin@gnome.org)
-//
-// (C) 2002 Martin Baulig
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class TimeZoneTest : TestCase
-{
- private CultureInfo oldcult;
-
- public TimeZoneTest() : base ("MonoTests.System.TimeZoneTest testcase") {}
- public TimeZoneTest (string name): base(name) {}
-
- public static ITest Suite
- {
- get {
- return new TestSuite (typeof(TimeZoneTest));
- }
- }
-
- protected override void SetUp ()
- {
- oldcult = Thread.CurrentThread.CurrentCulture;
-
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("");
-
- }
-
- protected override void TearDown ()
- {
- Thread.CurrentThread.CurrentCulture = oldcult;
- }
-
- public void TestCtors ()
- {
- TimeZone t1 = TimeZone.CurrentTimeZone;
- AssertEquals("A01", "CET", t1.StandardName);
- AssertEquals("A02", "CEST", t1.DaylightName);
-
- DaylightTime d1 = t1.GetDaylightChanges (2002);
- AssertEquals("A03", "03/31/2002 01:00:00", d1.Start.ToString ("G"));
- AssertEquals("A04", "10/27/2002 01:00:00", d1.End.ToString ("G"));
- AssertEquals("A05", 36000000000L, d1.Delta.Ticks);
-
- DaylightTime d2 = t1.GetDaylightChanges (1996);
- AssertEquals("A06", "03/31/1996 01:00:00", d2.Start.ToString ("G"));
- AssertEquals("A07", "10/27/1996 01:00:00", d2.End.ToString ("G"));
- AssertEquals("A08", 36000000000L, d2.Delta.Ticks);
-
- DateTime d3 = new DateTime (2002,2,25);
- AssertEquals("A09", false, t1.IsDaylightSavingTime (d3));
- DateTime d4 = new DateTime (2002,4,2);
- AssertEquals("A10", true, t1.IsDaylightSavingTime (d4));
- DateTime d5 = new DateTime (2002,11,4);
- AssertEquals("A11", false, t1.IsDaylightSavingTime (d5));
-
- AssertEquals("A12", 36000000000L, t1.GetUtcOffset (d3).Ticks);
- AssertEquals("A13", 72000000000L, t1.GetUtcOffset (d4).Ticks);
- AssertEquals("A14", 36000000000L, t1.GetUtcOffset (d5).Ticks);
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt16Test.cs b/mcs/class/corlib/Test/System/UInt16Test.cs
deleted file mode 100644
index cc62b30384e..00000000000
--- a/mcs/class/corlib/Test/System/UInt16Test.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-// UInt16Test.cs - NUnit Test Cases for the System.UInt16 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace MonoTests.System
-{
-
-public class UInt16Test : TestCase
-{
- private const UInt16 MyUInt16_1 = 42;
- private const UInt16 MyUInt16_2 = 0;
- private const UInt16 MyUInt16_3 = 65535;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "65535";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {null,
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {null,
- "65535", "6.55350e+004", "65535.00000",
- "65535", "65,535.00000", "6,553,500.00000 %", "0ffff"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"65,535.00000",
- "65535", "6.55350e+004", "65535.00000",
- "65535", "65,535.00000", "6,553,500.00000 %", "0ffff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt16Test() : base ("MonoTests.System.UInt16Test testcase") {}
- public UInt16Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"65,535.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt16Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt16.MinValue, MyUInt16_2);
- AssertEquals(UInt16.MaxValue, MyUInt16_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt16_3.CompareTo(MyUInt16_2) > 0);
- Assert(MyUInt16_2.CompareTo(MyUInt16_2) == 0);
- Assert(MyUInt16_1.CompareTo((UInt16)(42)) == 0);
- Assert(MyUInt16_2.CompareTo(MyUInt16_3) < 0);
- try {
- MyUInt16_2.CompareTo(100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt16_1.Equals(MyUInt16_1));
- Assert(MyUInt16_1.Equals((UInt16)(42)));
- Assert(MyUInt16_1.Equals((SByte)(42)) == false);
- Assert(MyUInt16_1.Equals(MyUInt16_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt16_1.GetHashCode();
- MyUInt16_2.GetHashCode();
- MyUInt16_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyUInt16_1 == UInt16.Parse(MyString1));
- Assert(MyUInt16_2 == UInt16.Parse(MyString2));
- Assert(MyUInt16_3 == UInt16.Parse(MyString3));
- try {
- UInt16.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt16.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- try {
- int OverInt = UInt16.MaxValue + 1;
- UInt16.Parse(OverInt.ToString());
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == UInt16.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- UInt16.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt16.Parse(" 42 ", Nfi));
- try {
- UInt16.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt16.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt16.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals("A1", MyString1, MyUInt16_1.ToString());
- AssertEquals("A2", MyString2, MyUInt16_2.ToString());
- AssertEquals("A3", MyString3, MyUInt16_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("A4:"+i.ToString(), Results1[i], MyUInt16_2.ToString(Formats1[i]));
- AssertEquals("A5:"+i.ToString(), Results2[i], MyUInt16_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals("A6:"+i.ToString(), ResultsNfi1[i], MyUInt16_2.ToString(Formats1[i], Nfi));
- AssertEquals("A7:"+i.ToString(), ResultsNfi2[i], MyUInt16_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt16_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("A8", typeof(FormatException) == e.GetType());
- }
- }
-}
-
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt32Test.cs b/mcs/class/corlib/Test/System/UInt32Test.cs
deleted file mode 100644
index da64ebd7087..00000000000
--- a/mcs/class/corlib/Test/System/UInt32Test.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-// UInt32Test.cs - NUnit Test Cases for the System.UInt32 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class UInt32Test : TestCase
-{
- private const UInt32 MyUInt32_1 = 42;
- private const UInt32 MyUInt32_2 = 0;
- private const UInt32 MyUInt32_3 = 4294967295;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "4294967295";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {"",
- "4294967295", "4.29497e+009", "4294967295.00000",
- "4.295e+09", "4,294,967,295.00000", "429,496,729,500.00000 %", "ffffffff"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"4,294,967,295.00000",
- "4294967295", "4.29497e+009", "4294967295.00000",
- "4.295e+09", "4,294,967,295.00000", "429,496,729,500.00000 %", "ffffffff"};
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt32Test() : base ("MonoTests.System.UInt32Test testcase") {}
- public UInt32Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"4,294,967,295.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt32Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt32.MinValue, MyUInt32_2);
- AssertEquals(UInt32.MaxValue, MyUInt32_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt32_3.CompareTo(MyUInt32_2) > 0);
- Assert(MyUInt32_2.CompareTo(MyUInt32_2) == 0);
- Assert(MyUInt32_1.CompareTo((UInt32)(42)) == 0);
- Assert(MyUInt32_2.CompareTo(MyUInt32_3) < 0);
- Assert (1 == UInt32.Parse ("1"));
- Assert (1 == UInt32.Parse (" 1"));
- Assert (1 == UInt32.Parse (" 1"));
- Assert (1 == UInt32.Parse ("1 "));
- Assert (1 == UInt32.Parse ("+1"));
-
- try {
- UInt32.Parse (" + 1 ");
- Fail ("Should raise FormatException1");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
-
- try {
- UInt32.Parse (" + ");
- Fail ("Should raise FormatException");
- } catch (Exception e){
- Assert (typeof (FormatException) == e.GetType ());
- }
- try {
- MyUInt32_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt32_1.Equals(MyUInt32_1));
- Assert(MyUInt32_1.Equals((UInt32)(42)));
- Assert(MyUInt32_1.Equals((SByte)(42)) == false);
- Assert(MyUInt32_1.Equals(MyUInt32_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt32_1.GetHashCode();
- MyUInt32_2.GetHashCode();
- MyUInt32_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert("Parse problem on \""+MyString1+"\"", MyUInt32_1 == UInt32.Parse(MyString1));
- Assert("Parse problem on \""+MyString2+"\"", MyUInt32_2 == UInt32.Parse(MyString2));
- Assert("Parse problem on \""+MyString3+"\"", MyUInt32_3 == UInt32.Parse(MyString3));
- try {
- UInt32.Parse(null);
- Fail("Should raise a System.ArgumentNullException");
- }
- catch (Exception e) {
- Assert("Did not get ArgumentNullException type", typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt32.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert("Did not get FormatException type", typeof(FormatException) == e.GetType());
- }
- try {
- // TODO: Use this after ToString() is completed. For now, hard code string that generates
- // exception.
- //double OverInt = (double)UInt32.MaxValue + 1;
- //UInt32.Parse(OverInt.ToString());
- UInt32.Parse("4294967296");
- Fail("Should raise a System.OverflowException");
- }
- catch (Exception e) {
- Assert("Did not get OverflowException type on '"+"4294967296"+"'. Instead, got: '"+e.GetType()+"'", typeof(OverflowException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- Assert(42 == UInt32.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- UInt32.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt32.Parse(" 42 ", Nfi));
- try {
- UInt32.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt32.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt32.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- int TestNumber = 1;
- try {
- //test ToString()
- AssertEquals(MyString1, MyUInt32_1.ToString());
- TestNumber++;
- AssertEquals(MyString2, MyUInt32_2.ToString());
- TestNumber++;
- AssertEquals(MyString3, MyUInt32_3.ToString());
- } catch (Exception e) {
- Fail("TestToString: Failed on TestNumber=" + TestNumber
- + " with exception: " + e.ToString());
- }
-
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- try {
- AssertEquals(Results1[i], MyUInt32_2.ToString(Formats1[i]));
- } catch (Exception e) {
- Fail("TestToString: MyUInt32_2.ToString(Formats1[i]) i=" + i
- + ". e = " + e.ToString());
- }
-
- try {
- AssertEquals(Results2[i], MyUInt32_3.ToString(Formats2[i]));
- } catch (Exception e) {
- Fail("TestToString: MyUInt32_3.ToString(Formats2[i]) i=" + i
- + ". e = " + e.ToString());
- }
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(ResultsNfi1[i], MyUInt32_2.ToString(Formats1[i], Nfi));
- AssertEquals(ResultsNfi2[i], MyUInt32_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt32_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-
-}
diff --git a/mcs/class/corlib/Test/System/UInt64Test.cs b/mcs/class/corlib/Test/System/UInt64Test.cs
deleted file mode 100644
index b1c2dac65f2..00000000000
--- a/mcs/class/corlib/Test/System/UInt64Test.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-// UInt64Test.cs - NUnit Test Cases for the System.UInt64 struct
-//
-// Mario Martinez (mariom925@home.om)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-using NUnit.Framework;
-using System;
-using System.Globalization;
-using System.Threading;
-
-namespace MonoTests.System
-{
-
-public class UInt64Test : TestCase
-{
- private const UInt64 MyUInt64_1 = 42;
- private const UInt64 MyUInt64_2 = 0;
- private const UInt64 MyUInt64_3 = 18446744073709551615;
- private const string MyString1 = "42";
- private const string MyString2 = "0";
- private const string MyString3 = "18446744073709551615";
- private string[] Formats1 = {"c", "d", "e", "f", "g", "n", "p", "x" };
- private string[] Formats2 = {"c5", "d5", "e5", "f5", "g5", "n5", "p5", "x5" };
- private string[] Results1 = {"",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] ResultsNfi1 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"0.00",
- "0", "0.000000e+000", "0.00",
- "0", "0.00", "0.00 %", "0"};
- private string[] Results2 = {"",
- "18446744073709551615", "1.84467e+019", "18446744073709551615.00000",
- "1.8447e+19", "18,446,744,073,709,551,615.00000",
- "1,844,674,407,370,955,161,500.00000 %", "ffffffffffffffff"};
- private string[] ResultsNfi2 = {NumberFormatInfo.InvariantInfo.CurrencySymbol+"18,446,744,073,709,551,615.00000",
- "18446744073709551615", "1.84467e+019", "18446744073709551615.00000",
- "1.8447e+19", "18,446,744,073,709,551,615.00000",
- "1,844,674,407,370,955,161,500.00000 %", "ffffffffffffffff"};
-
- private NumberFormatInfo Nfi = NumberFormatInfo.InvariantInfo;
-
- public UInt64Test() : base ("MonoTests.System.UInt64Test testcase") {}
- public UInt64Test(string name) : base(name) {}
-
- private CultureInfo old_culture;
-
- protected override void SetUp()
- {
- old_culture = Thread.CurrentThread.CurrentCulture;
-
- // Set culture to en-US and don't let the user override.
- Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
-
- // We can't initialize this until we set the culture.
- Results1 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"0.00";
- Results2 [0] = NumberFormatInfo.CurrentInfo.CurrencySymbol+"18,446,744,073,709,551,615.00000";
- }
-
- protected override void TearDown()
- {
- Thread.CurrentThread.CurrentCulture = old_culture;
- }
-
- public static ITest Suite {
- get {
- return new TestSuite(typeof(UInt64Test));
- }
- }
-
- public void TestMinMax()
- {
-
- AssertEquals(UInt64.MinValue, MyUInt64_2);
- AssertEquals(UInt64.MaxValue, MyUInt64_3);
- }
-
- public void TestCompareTo()
- {
- Assert(MyUInt64_3.CompareTo(MyUInt64_2) > 0);
- Assert(MyUInt64_2.CompareTo(MyUInt64_2) == 0);
- Assert(MyUInt64_1.CompareTo((UInt64)(42)) == 0);
- Assert(MyUInt64_2.CompareTo(MyUInt64_3) < 0);
- try {
- MyUInt64_2.CompareTo((Int16)100);
- Fail("Should raise a System.ArgumentException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
- }
- }
-
- public void TestEquals()
- {
- Assert(MyUInt64_1.Equals(MyUInt64_1));
- Assert(MyUInt64_1.Equals((UInt64)(42)));
- Assert(MyUInt64_1.Equals((SByte)(42)) == false);
- Assert(MyUInt64_1.Equals(MyUInt64_2) == false);
- }
-
- public void TestGetHashCode()
- {
- try {
- MyUInt64_1.GetHashCode();
- MyUInt64_2.GetHashCode();
- MyUInt64_3.GetHashCode();
- }
- catch {
- Fail("GetHashCode should not raise an exception here");
- }
- }
-
- public void TestParse()
- {
- //test Parse(string s)
- Assert(MyUInt64_1 == UInt64.Parse(MyString1));
- Assert(MyUInt64_2 == UInt64.Parse(MyString2));
- Assert(MyUInt64_3 == UInt64.Parse(MyString3));
- try {
- UInt64.Parse(null);
- Fail("Should raise a ArgumentNullException");
- }
- catch (Exception e) {
- Assert(typeof(ArgumentNullException) == e.GetType());
- }
- try {
- UInt64.Parse("not-a-number");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style)
- try {
- double OverInt = (double)UInt64.MaxValue + 1;
- UInt64.Parse(OverInt.ToString(), NumberStyles.Float);
- Fail("Should raise a OverflowException");
- }
- catch (Exception e) {
- Assert(typeof(OverflowException) == e.GetType());
- }
- try {
- double OverInt = (double)UInt64.MaxValue + 1;
- UInt64.Parse(OverInt.ToString(), NumberStyles.Integer);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- Assert(42 == UInt64.Parse(" "+NumberFormatInfo.CurrentInfo.CurrencySymbol+"42 ", NumberStyles.Currency));
- try {
- UInt64.Parse("$42", NumberStyles.Integer);
- Fail("Should raise a FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, IFormatProvider provider)
- Assert(42 == UInt64.Parse(" 42 ", Nfi));
- try {
- UInt64.Parse("%42", Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- //test Parse(string s, NumberStyles style, IFormatProvider provider)
- Assert(16 == UInt64.Parse(" 10 ", NumberStyles.HexNumber, Nfi));
- try {
- UInt64.Parse("$42", NumberStyles.Integer, Nfi);
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-
- public void TestToString()
- {
- //test ToString()
- AssertEquals(MyString1, MyUInt64_1.ToString());
- AssertEquals(MyString2, MyUInt64_2.ToString());
- AssertEquals(MyString3, MyUInt64_3.ToString());
- //test ToString(string format)
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(Results1[i], MyUInt64_2.ToString(Formats1[i]));
- AssertEquals(Results2[i], MyUInt64_3.ToString(Formats2[i]));
- }
- //test ToString(string format, IFormatProvider provider);
- for (int i=0; i < Formats1.Length; i++) {
- AssertEquals(ResultsNfi1[i], MyUInt64_2.ToString(Formats1[i], Nfi));
- AssertEquals(ResultsNfi2[i], MyUInt64_3.ToString(Formats2[i], Nfi));
- }
- try {
- MyUInt64_1.ToString("z");
- Fail("Should raise a System.FormatException");
- }
- catch (Exception e) {
- Assert(typeof(FormatException) == e.GetType());
- }
- }
-}
-
-}
diff --git a/mcs/class/corlib/Test/System/VersionTest.cs b/mcs/class/corlib/Test/System/VersionTest.cs
deleted file mode 100644
index 32f4c17d6e5..00000000000
--- a/mcs/class/corlib/Test/System/VersionTest.cs
+++ /dev/null
@@ -1,244 +0,0 @@
-//
-// VersionTest.cs - NUnit Test Cases for the System.Version class
-//
-// author:
-// Duco Fijma (duco@lorentz.xs4all.nl)
-//
-// (C) 2002 Duco Fijma
-//
-
-using NUnit.Framework;
-using System;
-
-namespace MonoTests.System
-{
-
-public class VersionTest : TestCase
-{
- public VersionTest () : base ("MonoTests.System.VersionTest testcase") {}
- public VersionTest (string name) : base (name) {}
-
- public static ITest Suite {
- get {
- return new TestSuite (typeof (VersionTest));
- }
- }
-
-
- public void TestCtors ()
- {
- Version v1;
- bool exception;
-
- /*
- v1 = new Version ();
- AssertEquals ("A1", 0, v1.Major);
- AssertEquals ("A2", 0, v1.Minor);
- AssertEquals ("A3", -1, v1.Build);
- AssertEquals ("A4", -1, v1.Revision);
- */
-
- v1 = new Version (23, 7);
- AssertEquals ("A5", 23, v1.Major);
- AssertEquals ("A6", 7, v1.Minor);
- AssertEquals ("A7", -1, v1.Build);
- AssertEquals ("A8", -1, v1.Revision);
-
- v1 = new Version (23, 7, 99);
- AssertEquals ("A9", 23, v1.Major);
- AssertEquals ("A10", 7, v1.Minor);
- AssertEquals ("A11", 99, v1.Build);
- AssertEquals ("A12", -1, v1.Revision);
-
- v1 = new Version (23, 7, 99, 42);
- AssertEquals ("A13", 23, v1.Major);
- AssertEquals ("A14", 7, v1.Minor);
- AssertEquals ("A15", 99, v1.Build);
- AssertEquals ("A16", 42, v1.Revision);
-
- try {
- v1 = new Version (23, -1);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A17", exception);
-
- try {
- v1 = new Version (23, 7, -1);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A18", exception);
-
- try {
- v1 = new Version (23, 7, 99, -1);
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A19", exception);
-
- }
-
- public void TestStringCtor ()
- {
- Version v1;
- bool exception;
-
- v1 = new Version("1.42.79");
- AssertEquals ("A1", 1, v1.Major);
- AssertEquals ("A2", 42, v1.Minor);
- AssertEquals ("A3", 79, v1.Build);
- AssertEquals ("A4", -1, v1.Revision);
-
-
- try {
- v1 = new Version ("1.42.-79");
- exception = false;
- }
- catch (ArgumentOutOfRangeException) {
- exception = true;
- }
- Assert ("A5", exception);
-
- try {
- v1 = new Version ("1");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A6", exception);
-
- try {
- v1 = new Version ("1.2.3.4.5");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A7", exception);
-
- try {
- v1 = new Version ((string) null);
- exception = false;
- }
- catch (ArgumentNullException) {
- exception = true;
- }
- Assert ("A6", exception);
-
-
- }
-
- public void TestClone ()
- {
- Version v1 = new Version (1, 2, 3, 4);
- Version v2 = (Version) v1.Clone ();
-
- Assert ("A1", v1.Equals (v2));
- Assert ("A2", !ReferenceEquals (v1, v2));
- }
-
- public void TestCompareTo ()
- {
- Assert ("A1", new Version (1, 2).CompareTo (new Version (1, 1)) > 0);
- Assert ("A2", new Version (1, 2, 3).CompareTo (new Version (2, 2, 3)) < 0);
- Assert ("A3", new Version (1, 2, 3, 4).CompareTo (new Version (1, 2, 2, 1)) > 0);
-
- Assert ("A4", new Version (1, 3).CompareTo (new Version (1, 2, 2, 1)) > 0);
- Assert ("A5", new Version (1, 2, 2).CompareTo (new Version (1, 2, 2, 1)) < 0);
-
- Assert ("A6", new Version (1, 2).CompareTo (new Version (1, 2)) == 0);
- Assert ("A7", new Version (1, 2, 3).CompareTo (new Version (1, 2, 3)) == 0);
-
- Assert ("A8", new Version (1, 1) < new Version (1, 2));
- Assert ("A9", new Version (1, 2) <= new Version (1, 2));
- Assert ("A10", new Version (1, 2) <= new Version (1, 3));
- Assert ("A11", new Version (1, 2) >= new Version (1, 2));
- Assert ("A12", new Version (1, 3) >= new Version (1, 2));
- Assert ("A13", new Version (1, 3) > new Version (1, 2));
-
- Version v1 = new Version(1, 2);
- bool exception;
-
- // LAMESPEC: Docs say this should throw a ArgumentNullException,
- // but it simply works. Seems any version is subsequent to null
- Assert ("A14:", v1.CompareTo (null) > 0);
-
- try {
- v1.CompareTo ("A string is not a version");
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A15", exception);
-
- }
-
-
- public void TestEquals ()
- {
- Version v1 = new Version (1, 2);
- Version v2 = new Version (1, 2, 3, 4);
- Version v3 = new Version (1, 2, 3, 4);
-
- AssertEquals ("A1", true, v2.Equals (v3));
- AssertEquals ("A2", true, v2.Equals (v2));
- AssertEquals ("A3", false, v1.Equals (v3));
-
- AssertEquals ("A4", true, v2 == v3);
- AssertEquals ("A5", true, v2 == v2);
- AssertEquals ("A6", false, v1 == v3);
-
- AssertEquals ("A7", false, v2.Equals ((Version) null));
- AssertEquals ("A8", false, v2.Equals ("A string"));
-
- }
-
- public void TestToString ()
- {
- Version v1 = new Version (1,2);
- Version v2 = new Version (1,2,3);
- Version v3 = new Version (1,2,3,4);
-
- AssertEquals ("A1", "1.2", v1.ToString ());
- AssertEquals ("A2", "1.2.3", v2.ToString ());
- AssertEquals ("A3", "1.2.3.4", v3.ToString ());
-
- AssertEquals ("A4", "" , v3.ToString (0));
- AssertEquals ("A5", "1" , v3.ToString (1));
- AssertEquals ("A6", "1.2" , v3.ToString (2));
- AssertEquals ("A7", "1.2.3" , v3.ToString (3));
- AssertEquals ("A8", "1.2.3.4" , v3.ToString (4));
-
- bool exception;
-
- try {
- v2.ToString (4);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A9", exception);
-
- try {
- v3.ToString (42);
- exception = false;
- }
- catch (ArgumentException) {
- exception = true;
- }
- Assert ("A10", exception);
- }
-
-}
-
-}
diff --git a/mcs/class/corlib/Test/corlib_test.build b/mcs/class/corlib/Test/corlib_test.build
deleted file mode 100644
index d0840a32f72..00000000000
--- a/mcs/class/corlib/Test/corlib_test.build
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for corlib_test.dll -->
-<!-- Target build (default) builds tests -->
-<!-- Target test runs tests -->
-
-<project name="corlib_test" default="build">
- <property name="debug" value="true"/>
- <property name="nunit_home" value="..\..\..\nunit"/>
-
- <target name="build">
- </target>
-
- <target name="assemblies">
- <csc target="library" output="corlib_linux_test.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- <excludes name="System.Security.Policy/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore_mono.dll"/>
- </references>
- <arg value="/r:..\..\lib\corlib.dll"/>
- <arg value="/r:..\..\lib\System.dll"/>
- <arg value="/nowarn:1595"/>
- <arg value="/nostdlib"/> <!-- don't reference mscorlib -->
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
- </csc>
-
- <csc target="library" output="corlib_test.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/r:corlib_res.dll"/>
- <arg value="/nowarn:1595"/>
- </csc>
-
- <csc target="library" output="corlib_reference.dll" debug="${debug}">
- <sources>
- <includes name="**/*.cs"/>
- </sources>
- <references basedir="..\..\..\nunit">
- <includes name="NUnitCore.dll"/>
- </references>
- <arg value="/nowarn:1595"/>
- </csc>
-</target>
-
-
- <target name="test" depends="assemblies">
-<!-- Do not run the unit tests with mono corlib on ms.net. With all the icalls the results provide no useful info -->
-<!-- Change this to be "mint NUnitConsole" or "mono NUnitConsole" when those are ready to be run on Windows -->
-<!-- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,corlib_test.dll" failonerror="false"/> -->
- <exec program="..\..\..\nunit\NUnitConsole" commandline="MonoTests.AllTests,corlib_reference.dll" failonerror="false"/>
- </target>
-
- <target name="clean">
- <delete file="corlib_test.dll" failonerror="false"/>
- <delete file="corlib_linux_test.dll" failonerror="false"/>
- <delete file="corlib_reference.dll" failonerror="false"/>
-
- <delete file="corlib_test.pdb" failonerror="false"/>
- <delete file="corlib_linux_test.pdb" failonerror="false"/>
- <delete file="corlib_reference.pdb" failonerror="false"/>
-
- </target>
-</project>
diff --git a/mcs/class/corlib/Test/resources/AFile.txt b/mcs/class/corlib/Test/resources/AFile.txt
deleted file mode 100644
index 59072cba2d9..00000000000
--- a/mcs/class/corlib/Test/resources/AFile.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Mono.Tests.AllTests.cs
-//
-// Author:
-// Alexander Klyubin (klyubin@aqris.com)
-//
-// (C) 2001
-//
-
-using System;
-using NUnit.Framework;
-
-namespace MonoTests {
- /// <summary>
- /// Combines all available unit tests into one test suite.
- /// </summary>
- public class AllTests : TestCase {
- public AllTests(string name) : base(name) {}
-
- public static ITest Suite
- {
- get
- {
- TestSuite suite = new TestSuite();
- suite.AddTest(System.AllTests.Suite);
- suite.AddTest(System.Collections.AllTests.Suite);
- suite.AddTest(System.Security.AllTests.Suite);
- suite.AddTest(System.Security.Cryptography.AllTests.Suite);
- suite.AddTest(System.IO.AllTests.Suite);
- suite.AddTest(System.Net.AllTests.Suite);
- suite.AddTest(System.Text.AllTests.Suite);
- suite.AddTest(System.Security.Permissions.AllTests.Suite);
- suite.AddTest(System.Resources.AllTests.Suite);
-// suite.AddTest(System.Security.Policy.AllTests.Suite);
- return suite;
- }
- }
- }
-}
diff --git a/mcs/class/corlib/Test/resources/Empty.resources b/mcs/class/corlib/Test/resources/Empty.resources
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mcs/class/corlib/Test/resources/Empty.resources
+++ /dev/null
diff --git a/mcs/class/corlib/Test/resources/MyResources.resources b/mcs/class/corlib/Test/resources/MyResources.resources
deleted file mode 100644
index b486e9e5111..00000000000
--- a/mcs/class/corlib/Test/resources/MyResources.resources
+++ /dev/null
Binary files differ
diff --git a/mcs/class/corlib/Unix/Errno.cs b/mcs/class/corlib/Unix/Errno.cs
deleted file mode 100755
index 36c3b4bc698..00000000000
--- a/mcs/class/corlib/Unix/Errno.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// Errno.cs: used to provide better information
-//
-
-namespace System.Private {
-
- internal class Errno {
-
- internal static string Message (int code)
- {
- switch (code){
- case Wrapper.EPERM:
- return "No permission";
- case Wrapper.ENOENT:
- return "The name does not exist";
- case Wrapper.EISDIR:
- return "error: Is a directory";
- case Wrapper.EBADF:
- return "Bad file descriptor";
- case Wrapper.ENOMEM:
- return "Out of memory";
- case Wrapper.EEXIST:
- return "File already exists";
- case Wrapper.ENOTEMPTY:
- return "Directory is not empty";
-
- case Wrapper.ESRCH:
- case Wrapper.EINTR:
- case Wrapper.EIO:
- case Wrapper.ENXIO:
- case Wrapper.E2BIG:
- case Wrapper.ENOEXEC:
- case Wrapper.ECHILD:
- case Wrapper.EAGAIN:
- case Wrapper.EACCES:
- case Wrapper.EFAULT:
- case Wrapper.ENOTBLK:
- case Wrapper.EBUSY:
- case Wrapper.EXDEV:
- case Wrapper.ENODEV:
- case Wrapper.EINVAL:
- case Wrapper.ENFILE:
- case Wrapper.EMFILE:
- case Wrapper.ENOTTY:
- case Wrapper.ETXTBSY:
- case Wrapper.EFBIG:
- case Wrapper.ENOSPC:
- case Wrapper.ESPIPE:
- case Wrapper.EROFS:
- case Wrapper.EMLINK:
- case Wrapper.EPIPE:
- case Wrapper.EDOM:
- case Wrapper.ERANGE:
- case Wrapper.EDEADLK:
- case Wrapper.ENAMETOOLONG:
- case Wrapper.ENOLCK:
- case Wrapper.ENOSYS:
- case Wrapper.ELOOP:
- case Wrapper.ENOMSG:
- case Wrapper.EIDRM:
- case Wrapper.ECHRNG:
- case Wrapper.EL2NSYNC:
- case Wrapper.EL3HLT:
- case Wrapper.EL3RST:
- case Wrapper.ELNRNG:
- case Wrapper.EUNATCH:
- case Wrapper.ENOCSI:
- case Wrapper.EL2HLT:
- case Wrapper.EBADE:
- case Wrapper.EBADR:
- case Wrapper.EXFULL:
- case Wrapper.ENOANO:
- case Wrapper.EBADRQC:
- case Wrapper.EBADSLT:
- case Wrapper.EBFONT:
- case Wrapper.ENOSTR:
- case Wrapper.ENODATA:
- case Wrapper.ETIME:
- case Wrapper.ENOSR:
- case Wrapper.ENONET:
- case Wrapper.ENOPKG:
- case Wrapper.EREMOTE:
- case Wrapper.ENOLINK:
- case Wrapper.EADV:
- case Wrapper.ESRMNT:
- case Wrapper.ECOMM:
- case Wrapper.EPROTO:
- case Wrapper.EMULTIHOP:
- case Wrapper.EDOTDOT:
- case Wrapper.EBADMSG:
- case Wrapper.ENOTUNIQ:
- case Wrapper.EBADFD:
- case Wrapper.EREMCHG:
- case Wrapper.ELIBACC:
- case Wrapper.ELIBBAD:
- case Wrapper.ELIBSCN:
- case Wrapper.ELIBMAX:
- case Wrapper.ELIBEXEC:
- case Wrapper.EUSERS:
- case Wrapper.ENOTSOCK:
- case Wrapper.EDESTADDRREQ:
- case Wrapper.EMSGSIZE:
- case Wrapper.EPROTOTYPE:
- case Wrapper.ENOPROTOOPT:
- case Wrapper.EPROTONOSUPPORT:
- case Wrapper.ESOCKTNOSUPPORT:
- case Wrapper.EOPNOTSUPP:
- case Wrapper.EPFNOSUPPORT:
- case Wrapper.EAFNOSUPPORT:
- case Wrapper.EADDRINUSE:
- case Wrapper.EADDRNOTAVAIL:
- case Wrapper.ENETDOWN:
- case Wrapper.ENETUNREACH:
- case Wrapper.ENETRESET:
- case Wrapper.ECONNABORTED:
- case Wrapper.ECONNRESET:
- case Wrapper.ENOBUFS:
- case Wrapper.EISCONN:
- case Wrapper.ENOTCONN:
- case Wrapper.ESHUTDOWN:
- case Wrapper.ETOOMANYREFS:
- case Wrapper.ETIMEDOUT:
- case Wrapper.ECONNREFUSED:
- case Wrapper.EHOSTDOWN:
- case Wrapper.EHOSTUNREACH:
- case Wrapper.EALREADY:
- case Wrapper.EINPROGRESS:
- case Wrapper.ESTALE:
- case Wrapper.EDQUOT:
- case Wrapper.ENOMEDIUM:
- break;
-
- case Wrapper.ENOTDIR:
- return "Not a directory";
- }
- return String.Format ("Errno code={0}", code);
- }
- }
-}
diff --git a/mcs/class/corlib/Unix/Wrapper.cs b/mcs/class/corlib/Unix/Wrapper.cs
deleted file mode 100644
index 76512a67223..00000000000
--- a/mcs/class/corlib/Unix/Wrapper.cs
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Generated automatically: do not edit this file.
- */
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace System.Private {
-
-[CLSCompliant(false)]
-public struct stat {
- public uint st_dev;
- public uint st_mode;
- public uint st_nlink;
- public uint st_uid;
- public uint st_gid;
- public long st_size;
- public uint st_atime;
- public uint st_mtime;
- public uint st_ctime;
-};
-
-public class Wrapper {
-
- public const int SEEK_SET = 0;
- public const int SEEK_CUR = 1;
- public const int SEEK_END = 2;
- public const int O_RDONLY = 0x00000000;
- public const int O_WRONLY = 0x00000001;
- public const int O_RDWR = 0x00000002;
- public const int O_CREAT = 0x00000040;
- public const int O_EXCL = 0x00000080;
- public const int O_NOCTTY = 0x00000100;
- public const int O_TRUNC = 0x00000200;
- public const int O_SYNC = 0x00001000;
- public const int O_APPEND = 0x00000400;
- public const int STDIN_FILENO = 0x00000000;
- public const int STDOUT_FILENO = 0x00000001;
- public const int STDERR_FILENO = 0x00000002;
- public const int S_IFMT = 0x0000f000;
- public const int S_IFSOCK = 0x0000c000;
- public const int S_IFLNK = 0x0000a000;
- public const int S_IFREG = 0x00008000;
- public const int S_IFBLK = 0x00006000;
- public const int S_IFDIR = 0x00004000;
- public const int S_IFCHR = 0x00002000;
- public const int S_IFIFO = 0x00001000;
- public const int S_ISUID = 0x00000800;
- public const int S_ISGID = 0x00000400;
- public const int S_ISVTX = 0x00000200;
- public const int S_IRWXU = 0x000001c0;
- public const int S_IRUSR = 0x00000100;
- public const int S_IWUSR = 0x00000080;
- public const int S_IXUSR = 0x00000040;
- public const int S_IRWXG = 0x00000038;
- public const int S_IRGRP = 0x00000020;
- public const int S_IWGRP = 0x00000010;
- public const int S_IXGRP = 0x00000008;
- public const int S_IRWXO = 0x00000007;
- public const int S_IROTH = 0x00000004;
- public const int S_IWOTH = 0x00000002;
- public const int S_IXOTH = 0x00000001;
- public const int EPERM = 1;
- public const int ENOENT = 2;
- public const int ESRCH = 3;
- public const int EINTR = 4;
- public const int EIO = 5;
- public const int ENXIO = 6;
- public const int E2BIG = 7;
- public const int ENOEXEC = 8;
- public const int EBADF = 9;
- public const int ECHILD = 10;
- public const int EAGAIN = 11;
- public const int ENOMEM = 12;
- public const int EACCES = 13;
- public const int EFAULT = 14;
- public const int ENOTBLK = 15;
- public const int EBUSY = 16;
- public const int EEXIST = 17;
- public const int EXDEV = 18;
- public const int ENODEV = 19;
- public const int EISDIR = 21;
- public const int EINVAL = 22;
- public const int ENFILE = 23;
- public const int EMFILE = 24;
- public const int ENOTTY = 25;
- public const int ETXTBSY = 26;
- public const int EFBIG = 27;
- public const int ENOSPC = 28;
- public const int ESPIPE = 29;
- public const int EROFS = 30;
- public const int EMLINK = 31;
- public const int EPIPE = 32;
- public const int EDOM = 33;
- public const int ERANGE = 34;
- public const int EDEADLK = 35;
- public const int ENAMETOOLONG = 36;
- public const int ENOLCK = 37;
- public const int ENOSYS = 38;
- public const int ENOTEMPTY = 39;
- public const int ELOOP = 40;
- public const int EWOULDBLOCK = 11;
- public const int ENOMSG = 42;
- public const int EIDRM = 43;
- public const int ECHRNG = 44;
- public const int EL2NSYNC = 45;
- public const int EL3HLT = 46;
- public const int EL3RST = 47;
- public const int ELNRNG = 48;
- public const int EUNATCH = 49;
- public const int ENOCSI = 50;
- public const int EL2HLT = 51;
- public const int EBADE = 52;
- public const int EBADR = 53;
- public const int EXFULL = 54;
- public const int ENOANO = 55;
- public const int EBADRQC = 56;
- public const int EBADSLT = 57;
- public const int EDEADLOCK = 35;
- public const int EBFONT = 59;
- public const int ENOSTR = 60;
- public const int ENODATA = 61;
- public const int ETIME = 62;
- public const int ENOSR = 63;
- public const int ENONET = 64;
- public const int ENOPKG = 65;
- public const int EREMOTE = 66;
- public const int ENOLINK = 67;
- public const int EADV = 68;
- public const int ESRMNT = 69;
- public const int ECOMM = 70;
- public const int EPROTO = 71;
- public const int EMULTIHOP = 72;
- public const int EDOTDOT = 73;
- public const int EBADMSG = 74;
- public const int ENOTUNIQ = 76;
- public const int EBADFD = 77;
- public const int EREMCHG = 78;
- public const int ELIBACC = 79;
- public const int ELIBBAD = 80;
- public const int ELIBSCN = 81;
- public const int ELIBMAX = 82;
- public const int ELIBEXEC = 83;
- public const int EUSERS = 87;
- public const int ENOTSOCK = 88;
- public const int EDESTADDRREQ = 89;
- public const int EMSGSIZE = 90;
- public const int EPROTOTYPE = 91;
- public const int ENOPROTOOPT = 92;
- public const int EPROTONOSUPPORT = 93;
- public const int ESOCKTNOSUPPORT = 94;
- public const int EOPNOTSUPP = 95;
- public const int EPFNOSUPPORT = 96;
- public const int EAFNOSUPPORT = 97;
- public const int EADDRINUSE = 98;
- public const int EADDRNOTAVAIL = 99;
- public const int ENETDOWN = 100;
- public const int ENETUNREACH = 101;
- public const int ENETRESET = 102;
- public const int ECONNABORTED = 103;
- public const int ECONNRESET = 104;
- public const int ENOBUFS = 105;
- public const int EISCONN = 106;
- public const int ENOTCONN = 107;
- public const int ESHUTDOWN = 108;
- public const int ETOOMANYREFS = 109;
- public const int ETIMEDOUT = 110;
- public const int ECONNREFUSED = 111;
- public const int EHOSTDOWN = 112;
- public const int EHOSTUNREACH = 113;
- public const int EALREADY = 114;
- public const int EINPROGRESS = 115;
- public const int ESTALE = 116;
- public const int EDQUOT = 122;
- public const int ENOMEDIUM = 123;
- public const int ENOTDIR = 20;
-
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_seek", CharSet=CharSet.Ansi)]
- public unsafe static extern long seek (IntPtr fd, long offset, int whence);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_mkdir", CharSet=CharSet.Ansi)]
- public unsafe static extern int mkdir (string path, int mode);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_rmdir", CharSet=CharSet.Ansi)]
- public unsafe static extern int rmdir (string path);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_read", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int read (IntPtr fd, void * buf, int count);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_write", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int write (IntPtr fd, void * buf, int count);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_fstat", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int fstat (IntPtr fd, stat * buf);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_ftruncate", CharSet=CharSet.Ansi)]
- public unsafe static extern int ftruncate (IntPtr fd, long length);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_open", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr open (string path, int flags, int mode);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_close", CharSet=CharSet.Ansi)]
- public unsafe static extern int close (IntPtr fd);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_stat", CharSet=CharSet.Ansi)]
- [CLSCompliant(false)]
- public unsafe static extern int stat (string path, stat * buf);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_unlink", CharSet=CharSet.Ansi)]
- public unsafe static extern int unlink (string path);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_opendir", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr opendir (string path);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_readdir", CharSet=CharSet.Ansi)]
- public unsafe static extern string readdir (IntPtr dir);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_closedir", CharSet=CharSet.Ansi)]
- public unsafe static extern int closedir (IntPtr dir);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_getenv", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr getenv (string variable);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_environ", CharSet=CharSet.Ansi)]
- public unsafe static extern IntPtr environ ();
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_rename", CharSet=CharSet.Ansi)]
- public unsafe static extern int rename (string source, string target);
-
- [DllImport("monowrapper", EntryPoint="mono_wrapper_utime", CharSet=CharSet.Ansi)]
- public unsafe static extern int utime (string path, int atime, int mtime);
-}
-}
diff --git a/mcs/class/corlib/Unix/common.src b/mcs/class/corlib/Unix/common.src
deleted file mode 100644
index 14f9533ef75..00000000000
--- a/mcs/class/corlib/Unix/common.src
+++ /dev/null
@@ -1 +0,0 @@
-Wrapper.cs \ No newline at end of file
diff --git a/mcs/class/corlib/Unix/mono.src b/mcs/class/corlib/Unix/mono.src
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mcs/class/corlib/Unix/mono.src
+++ /dev/null
diff --git a/mcs/class/corlib/Unix/windows.src b/mcs/class/corlib/Unix/windows.src
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/mcs/class/corlib/Unix/windows.src
+++ /dev/null
diff --git a/mcs/class/corlib/Windows/Windows.cs b/mcs/class/corlib/Windows/Windows.cs
deleted file mode 100644
index 891c26f0b68..00000000000
--- a/mcs/class/corlib/Windows/Windows.cs
+++ /dev/null
@@ -1,694 +0,0 @@
-/*---------------------------------------------------------------------
-
- XX X XXX
- XX XX
- XXX XX XXX XXXXX XX
- XX XXX XX XX XX
- XX XX XX XX XXXXX XX
- XX XX XX XX XX XX X XX
- XXXX XX XX XXX XXXXXXX XXXX
- XX
- XXXXX
-
-Copyright (c) 2001 Intel Corporation. All Rights Reserved.
-
-CREATED: August 15, 2001
-OWNER: Scott D Smith, Joel Marcey
-VERSION: 1.0
----------------------------------------------------------------------*/
-
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.IO;
-using System.Collections;
-
-namespace System.PAL
-{
- /// <summary>
- /// Class that implements IOperatingSystem, providing the requested functionality through calls into APIs available in Windows (this class is a work in progress).
- /// </summary>
- internal class OpSys
- {
-
- //OS Calls (P/Invoke)
-
-
- /*DWORD GetFullPathName(
- LPCTSTR lpFileName, // file name
- DWORD nBufferLength, // size of path buffer
- LPTSTR lpBuffer, // path buffer
- LPTSTR *lpFilePart // address of file name in path
- );*/
-
- [DllImport("kernel32.dll")]
- private static extern uint GetFullPathName(string path, uint bufLength, System.Text.StringBuilder buffer, ref System.Text.StringBuilder fNameAddr);
-
- /*UINT GetTempFileName(
- LPCTSTR lpPathName, // directory name
- LPCTSTR lpPrefixString, // file name prefix
- UINT uUnique, // integer
- LPTSTR lpTempFileName // file name buffer
- );*/
-
- [DllImport("kernel32.dll")]
- private static extern uint GetTempFileName(string path, string prefix, uint unique, System.Text.StringBuilder buffer);
-
- /*DWORD GetTempPath(
- DWORD nBufferLength, // size of buffer
- LPTSTR lpBuffer // path buffer
- );*/
-
- [DllImport("kernel32.dll")]
- private static extern int GetTempPath(int bufferLength, System.Text.StringBuilder buffer);
-
-
-
-
- // Class Constants
-
- private const int EOF = -1; // In stdio.h, EOF is defined as -1
-
-
-
- // For StdInputStream and StdOutputStream
-
- private const int STDOUT = 1; // In stdio.h, the handle to standard out is 1
- private const int STDIN = 0; // In stdio.h, the standard input handle is defined as 0. Will this always be true?
-
-
- // Class Fields
-
- private static bool isNextCharacterResidualNewline = false;
- private static byte residualNewlineByte = 0;
-
-
-
- // Class Constructor
-
- public OpSys()
- {
- }
-
-
- // System.Environment Services
-
- public string NewLineSequence
- {
- get
- {
- return "\r\n";
- }
- }
-
- public char DirectorySeparator
- {
- get
- {
- return (char) 0x005C; // This is a \
- }
- }
-
- public char AltDirectorySeparator
- {
- get
- {
- return (char) 0x002F; // This is a /
- }
- }
-
- public char VolumeSeparator
- {
- get
- {
- return (char) 0x003A; // This is a :
- }
- }
-
- public char PathSeparator
- {
- get
- {
- return (char) 0x003B; // This is a ;
- }
- }
-
- public char[] InvalidPathChars
- {
- get
- {
- char[] ipc = {'"', '<', '>', '|', '\0'};
- return ipc;
- }
- }
-
- public char[] DirVolSeparatorChars
- {
- get
- {
- char[] dsc = new char[] {this.DirectorySeparator, this.AltDirectorySeparator, this.VolumeSeparator};
- return dsc;
- }
- }
- public char ExtensionCharacter
- {
- get
- {
- return (char) 0x002E; // This is a .
- }
- }
-
- public string GetEnvironmentVariable(string eVar)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetEnvironmentVariable(System.String): Stub Method");
- // Call Windows API to get environment variable;
- return null;
- }
-
- public string CommandLine
- {
- get
- {
- return null;
- }
- }
-
- public IDictionary EnvironmentVariables
- {
- get
- {
- return null;
- }
- }
-
- public string MachineName
- {
- get
- {
- return null;
- }
- }
-
- public OperatingSystem OSVersion
- {
- get
- {
- return null;
- }
- }
-
- // System.Path services
-
- public string ChangeExtension(string path, string extension)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:ChangeExtension(System.String, System.String): Stub Method");
- if (path == null || path.Equals(string.Empty))
- {
- return path;
- }
- if (!this.HasExtension(path) && extension != null)
- {
- return string.Concat(path, extension);
- }
- string pathNoExt = path.Substring(0, path.LastIndexOf(this.ExtensionCharacter));
- // If extension is null, concat replaces it with string.Empty
- return string.Concat(pathNoExt, extension);
- }
-
- public string GetExtension(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetExtension(System.String): Stub Method");
- if (path == null)
- {
- return path;
- }
- if (!this.HasExtension(path))
- {
- return string.Empty;
- }
- // It has an extension
- return path.Substring(path.LastIndexOf(this.ExtensionCharacter));
- }
-
- public string GetFileName(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetFileName(System.String): Stub Method");
- if (path == null)
- {
- return null;
- }
- int dvLast = path.LastIndexOfAny(this.DirVolSeparatorChars);
- if (dvLast == -1)
- {
- return path;
- }
- return dvLast + 1 == path.Length ? string.Empty : path.Substring(dvLast + 1);
- }
-
- public long FileLength(string path)
- {
- return 0;
- }
-
- public long FileLength(IntPtr handle)
- {
- return 0;
- }
-
- public string GetFileNameWithoutExtension(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetFileNameWithoutExtension(System.String): Stub Method");
- return this.ChangeExtension(this.GetFileName(path), null);
- }
-
- // TODO: Windows: GetFullPath: Verify logic here. This seems TOO simplistic
- public string GetFullPath(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetFullPath(System.String): Stub Method");
- if (path == null)
- {
- return null;
- }
- // TODO: GetFullPath: What should the size of the buffer be?
- System.Text.StringBuilder buffer = new System.Text.StringBuilder(256);
- // Just temporary to pass in as final parameter
- System.Text.StringBuilder temp = new System.Text.StringBuilder();
- // TODO: GetFullPath: ECMA spec says that an ArgumentException is thrown if system can not retrieve the path. That does not seem right. Returning null for now
- return GetFullPathName(path, (uint) buffer.Capacity, buffer, ref temp) != 0 ? buffer.ToString() : null;
- }
-
- public string GetPathRoot(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetPathRoot(System.String): Stub Method");
- if (path == null)
- {
- return null;
- }
- // TODO: Windows: GetPathRoot: Check logic. Assuming that if there is not dir or vol separators in the first three characters, then relative.
- int dvFirst = path.IndexOfAny(this.DirVolSeparatorChars, 0, 3);
- if (dvFirst == -1)
- {
- return string.Empty;
- }
- if (dvFirst == 0 && path[dvFirst].Equals(this.VolumeSeparator))
- {
- return string.Empty;
- }
- return dvFirst == 1 && path[dvFirst].Equals(this.VolumeSeparator) && (path[dvFirst+1].Equals(this.DirectorySeparator) || path[dvFirst+1].Equals(this.AltDirectorySeparator)) ? path.Substring(0, dvFirst+2) : path.Substring(0, dvFirst+1);
-
- }
-
- public string GetTempFileName()
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetTempFileName(): Stub Method");
- string tPath = this.GetTempPath();
- string prefix = "tmp";
- // TODO: Windows: GetTempFileName: Remove System once our implementation of StringBuilder is done. Same for parameter to P/Invoke
- // TODO: Windows: GetTempFileName: What is the proper length?
- System.Text.StringBuilder buffer = new System.Text.StringBuilder(256);
- // TODO: Windows: GetTempFileName: If an error is returned, what should we do? Right now return null;
- return GetTempFileName(tPath, prefix, 0, buffer) != 0 ? buffer.ToString() : null;
- }
-
- public string GetTempPath()
- {
- //System.Diagnostics.Debug.WriteLine("Windows:GetTempPath(): Stub Method");
- // TODO: Windows: GetTempPath: Remove System once our implementation of StringBuilder is done. Same for parameter to P/Invoke
- // According to docs, LPTSTR maps to StringBuilder for In/Out
- System.Text.StringBuilder buffer = new System.Text.StringBuilder(256);
- // TODO: Windows: GetTempPath: What is the proper length?
- // TODO: Windows: GetTempPath: If an error is returned, what should we do? Right now return null;
- return GetTempPath(buffer.Capacity, buffer) != 0 ? buffer.ToString() : null;
- }
-
- public bool HasExtension(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:HasExtension(System.String): Stub Method");
- int dvLast = path.LastIndexOfAny(this.DirVolSeparatorChars);
- int exLast = path.LastIndexOf(this.ExtensionCharacter);
- if (exLast > dvLast)
- {
- return true;
- }
- return false;
- }
-
- public bool IsPathRooted(string path)
- {
- //System.Diagnostics.Debug.WriteLine("Windows:IsPathRooted(System.String): Stub Method");
- return (this.GetPathRoot(path) == null) || (this.GetPathRoot(path).Equals(string.Empty)) ? false : true;
- }
-
-
- // System.Directory service
-
- public void DeleteDirectory(string path, bool recursive)
- {
- System.Diagnostics.Debug.WriteLine("Windows:DeleteDirectory(System.String, System.Boolean): Stub Method");
- }
-
- public bool ExistsDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:ExistsDirectory(System.String): Stub Method");
- return false;
- }
-
- public DateTime GetCreationTimeDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetCreationTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public string GetCurrentDirectory()
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetCurrentDirectory(): Stub Method");
- return null;
- }
-
- public string[] GetDirectories(string path, string searchPattern)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetDirectories(System.String,System.String): Stub Method");
- return null;
- }
-
- public string[] GetFiles(string path, string searchPattern)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetFiles(System.String, System.String): Stub Method");
- return null;
- }
-
- public string[] GetFileSystemEntries(string path, string searchPattern)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetFileSystemEntries(System.String, System.String): Stub Method");
- return null;
- }
-
- public DateTime GetLastAccessTimeDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastAccessTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastWriteTimeDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastWriteTimeDirectory(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public void MoveDirectory(string sourceDirName, string destDirName)
- {
- System.Diagnostics.Debug.WriteLine("Windows:MoveDirectory(System.String, System.String): Stub Method");
- }
-
- public void SetCreationTimeDirectory(string path, DateTime creationTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCreationTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetCurrentDirectory(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCurrentDirectory(System.String): Stub Method");
- }
-
- public void SetLastAccessTimeDirectory(string path, DateTime lastAccessTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetLastAccessTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastWriteTimeDirectory(string path, DateTime lastWriteTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetLastWriteTimeDirectory(System.String, System.DateTime): Stub Method");
- }
-
-
- // I/O Services
-
-
- public int ReadStdInput(byte[] buffer, int offset, int count)
- {
- return ReadFile(new IntPtr(STDIN), buffer, offset, count);
- }
-
- public void FlushStdOutput(byte[] byteBuf)
- {
- FlushFile (new IntPtr(STDOUT), byteBuf);
- }
-
- public unsafe int ReadFile(IntPtr handle, byte[] buffer, int offset, int count)
- {
- int res;
-
- fixed (void *p = &buffer[offset]) {
- res = _read(handle, p, count);
- }
- return res;
- }
-
- public unsafe int WriteFile(IntPtr handle, byte[] buffer, int offset, int count)
- {
- int res;
-
- fixed (void *p = &buffer [offset]) {
- res = _write(handle, p, count);
- }
- return res;
- }
-
- public int SetLengthFile(IntPtr handle, long length)
- {
- return _ftruncate (handle, (int)length);
- }
-
- public void FlushFile(IntPtr handle, byte[] byteBuf)
- {
- WriteFile (handle, byteBuf, 0, byteBuf.Length);
- }
-
- public IntPtr OpenFile(string path, FileMode mode, FileAccess access, FileShare share)
- {
- int flags = _getUnixFlags (mode, access);
-
- return _open (path, flags, 0x1a4);
- }
-
- public void CloseFile(IntPtr handle)
- {
- _close (handle);
- }
-
- public long SeekFile(IntPtr handle, long offset, SeekOrigin origin)
- {
- switch (origin) {
- case SeekOrigin.End:
- return _lseek (handle, (int)offset, SEEK_END);
- case SeekOrigin.Current:
- return _lseek (handle, (int)offset, SEEK_CUR);
- default:
- return _lseek (handle, (int)offset, SEEK_SET);
- }
- }
-
- public IntPtr CreateFile(string path, FileMode mode, FileAccess access, FileShare share)
- {
- return OpenFile(path, FileMode.CreateNew, access, share);
- }
-
- public void DeleteFile(string path)
- {
- _unlink(path);
- }
-
- public bool ExistsFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:ExistsFile(System.String): Stub Method");
- return false;
- }
-
- public DateTime GetCreationTimeFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetCreationTimeFile(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastAccessTimeFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastAccessTimeFile(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public DateTime GetLastWriteTimeFile(string path)
- {
- System.Diagnostics.Debug.WriteLine("Windows:GetLastWriteFile(System.String): Stub Method");
- return new DateTime(0);
- }
-
- public void SetCreationTimeFile(string path, DateTime creationTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCreationTimeFile(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastAccessTimeFile(string path, DateTime lastAccessTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetLastAccessTimeFile(System.String, System.DateTime): Stub Method");
- }
-
- public void SetLastWriteTimeFile(string path, DateTime lastWriteTime)
- {
- System.Diagnostics.Debug.WriteLine("Windows:SetCLastWriteTimeFile(System.String, System.DateTime): Stub Method");
- }
-
- // DONE: Determine if this should be in a utility class
- /// <summary>
- /// Determines if a byte is part of the newline sequence
- /// </summary>
- /// <param name="c">The byte to compare</param>
- /// <returns>A System.Boolean stating whether the byte is part of the newline</returns>
- private static bool IsPartOfNewlineSequence(byte c)
- {
- char[] newLineArray = System.Environment.NewLine.ToCharArray();
- for (int i = 0; i < newLineArray.Length; i++)
- {
- if (c == (byte) newLineArray[i]) // Or do I need Equals()
- {
- return true;
- }
- }
- return false;
- }
-
- /// <summary>
- /// Determines if a character is a newline character
- /// </summary>
- /// <param name="c">The character to check to see if it is a newline character</param>
- /// <returns></returns>
- public static bool IsPartOfNewlineSequence(char c)
- {
- // DONE: Determine if this method can be moved into TextReader or maybe a utility class (a class with a bunch of static methods...System.IO.IOUtility)
- char[] newLineArray = System.Environment.NewLine.ToCharArray();
- for (int i = 0; i < newLineArray.Length; i++)
- {
- if (c == newLineArray[i]) // TODO: Determine if .Equals() should be used here.
- {
- return true;
- }
- }
- return false;
- }
-
- [ DllImport("msvcrt", EntryPoint="acos") ]
- public extern static double Acos(double d);
-
- [ DllImport("msvcrt", EntryPoint="asin") ]
- public extern static double Asin(double d);
-
- [ DllImport("msvcrt", EntryPoint="atan") ]
- public extern static double Atan(double d);
-
- [ DllImport("msvcrt", EntryPoint="atan2") ]
- public extern static double Atan2(double y, double x);
-
- [ DllImport("msvcrt", EntryPoint="cos") ]
- public extern static double Cos(double d);
-
- [ DllImport("msvcrt", EntryPoint="cosh") ]
- public extern static double Cosh(double d);
-
- [ DllImport("msvcrt", EntryPoint="exp") ]
- public extern static double Exp(double d);
-
- [ DllImport("msvcrt", EntryPoint="log") ]
- public extern static double Log(double d);
-
- [ DllImport("msvcrt", EntryPoint="log10") ]
- public extern static double Log10(double d);
-
- [ DllImport("msvcrt", EntryPoint="pow") ]
- public extern static double Pow(double x, double y);
-
- [ DllImport("msvcrt", EntryPoint="sin") ]
- public extern static double Sin(double d);
-
- [ DllImport("msvcrt", EntryPoint="sinh") ]
- public extern static double Sinh(double d);
-
- [ DllImport("msvcrt", EntryPoint="sqrt") ]
- public extern static double Sqrt(double d);
-
- [ DllImport("msvcrt", EntryPoint="tan") ]
- public extern static double Tan(double d);
-
- [ DllImport("msvcrt", EntryPoint="tanh") ]
- public extern static double Tanh(double d);
-
- [ DllImport("msvcrt", EntryPoint="_read", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _read(IntPtr fd, void *buf, int count);
-
- [ DllImport("msvcrt", EntryPoint="_write", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _write(IntPtr fd, void *buf, int count);
-
- [ DllImport("msvcrt", EntryPoint="_lseek", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _lseek(IntPtr fd, int offset, int whence);
-
- [ DllImport("msvcrt", EntryPoint="_chsize", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _ftruncate (IntPtr fd, int count);
-
- [ DllImport("msvcrt", EntryPoint="_close", CharSet=CharSet.Ansi) ]
- private unsafe static extern void _close(IntPtr fd);
-
- [ DllImport("msvcrt", EntryPoint="_open", CharSet=CharSet.Ansi) ]
- private unsafe static extern IntPtr _open(string path, int flags, int mode);
-
- [ DllImport("msvcrt", EntryPoint="_unlink", CharSet=CharSet.Ansi) ]
- private unsafe static extern int _unlink(string path);
-
- private const int O_RDONLY = 0x000;
- private const int O_WRONLY = 0x001;
- private const int O_RDWR = 0x002;
- private const int O_CREAT = 0x040;
- private const int O_EXCL = 0x080;
- private const int O_TRUNC = 0x200;
- private const int O_APPEND = 0x400;
-
- private const int SEEK_SET = 0;
- private const int SEEK_CUR = 1;
- private const int SEEK_END = 2;
-
- private int _getUnixFlags (FileMode mode, FileAccess access)
- {
- int flags = 0;
- switch (access) {
- case FileAccess.Read:
- flags = O_RDONLY;
- break;
- case FileAccess.Write:
- flags = O_WRONLY;
- break;
- case FileAccess.ReadWrite:
- flags = O_RDWR;
- break;
- }
-
- switch (mode) {
- case FileMode.Append:
- flags |= O_APPEND;
- break;
- case FileMode.Create:
- flags |= O_CREAT;
- break;
- case FileMode.CreateNew:
- flags |= O_CREAT | O_EXCL;
- break;
- case FileMode.Open:
- break;
- case FileMode.OpenOrCreate:
- flags |= O_CREAT;
- break;
- case FileMode.Truncate:
- flags |= O_TRUNC;
- break;
- }
-
- return flags;
- }
- }
-}
diff --git a/mcs/class/corlib/corlib.build b/mcs/class/corlib/corlib.build
deleted file mode 100644
index 75dfd340370..00000000000
--- a/mcs/class/corlib/corlib.build
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for corlib.dll -->
-<!-- Target windows builds libraries _for_ windows -->
-<!-- Target linux builds libraries _for_ linux -->
-
-<project name="corlib" default="build">
- <property name="debug" value="true"/>
- <property name="verbose" value="true"/>
-
- <target name="build">
- <mkdir dir="../lib"/>
- <csc target="library" output="../lib/corlib.dll" debug="${debug}">
- <!-- keep in sync with corlib_cmp.dll below -->
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/nowarn:0679"/> <!-- internal may be overriden -->
- <arg value="/unsafe"/>
-
- <arg value="/nostdlib"/> <!-- don't reference mscorlib -->
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
-
- <sources>
- <includes name="**/*.cs"/>
-
- <excludes name="Test/**"/>
- <excludes name="System.Security.Permissions/SecurityPermissionAttribute.cs"/> <!-- custom security attributes problem -->
-
- <excludes name="Unix/**"/>
- <excludes name="Linux/**"/>
- <excludes name="Windows/**"/>
- <excludes name="System.PAL/**"/>
- </sources>
- </csc>
- <csc target="library" output="../lib/corlib_cmp.dll" debug="${debug}">
- <!-- This dll is used to compare with mscorlib -->
- <!-- It should be the same as corlib.dll minus Object and ValueTyp -->
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/nowarn:0679"/> <!-- internal may be overriden -->
- <arg value="/unsafe"/>
-
- <arg value="/nostdlib"/>
- <arg value="/noconfig"/>
- <arg value="/r:mscorlib.dll"/>
-
- <sources>
- <includes name="**/*.cs"/>
-
- <excludes name="Test/**"/>
- <excludes name="System.Security.Permissions/SecurityPermissionAttribute.cs"/>
-
- <excludes name="Unix/**"/>
- <excludes name="Linux/**"/>
- <excludes name="Windows/**"/>
- <excludes name="System.PAL/**"/>
-
- <excludes name="System/Object.cs"/>
- <excludes name="System/ValueType.cs"/>
- <excludes name="System/Enum.cs"/>
- <excludes name="System/Delegate.cs"/>
- <excludes name="System/MulticastDelegate.cs"/>
- <excludes name="System/Exception.cs"/>
- </sources>
- </csc>
- <!-- NUnit can only run under windows right now, so build for windows
- even though this is inside the linux target -->
- <csc target="library" output="Test/corlib_res.dll" debug="${debug}">
- <arg value="/nowarn:1595"/>
- <arg value="/nowarn:0649"/> <!-- field never assigned to -->
- <arg value="/nowarn:0169"/> <!-- field never used -->
- <arg value="/nowarn:0679"/> <!-- internal may be overriden -->
- <arg value="/unsafe"/>
- <sources>
- <includes name="**/*.cs"/>
-
- <excludes name="Test/**"/>
-
- <excludes name="Unix/**"/>
- <excludes name="Linux/**"/>
- <excludes name="Windows/**"/>
- <excludes name="System.PAL/**"/>
-
- <excludes name="System/Object.cs"/>
- <excludes name="System/ValueType.cs"/>
- <excludes name="System/Enum.cs"/>
- <excludes name="System/Delegate.cs"/>
- <excludes name="System/MulticastDelegate.cs"/>
- <excludes name="System/Exception.cs"/>
- <excludes name="System/Type.cs"/>
- <excludes name="System/MonoType.cs"/>
- <excludes name="System/Array.cs"/>
- <excludes name="System/String.cs"/>
- <excludes name="System/Console.cs"/>
- <excludes name="System/AppDomain.cs"/>
- <excludes name="System/RuntimeTypeHandle.cs"/>
- <excludes name="System/ICloneable.cs"/>
-
- <excludes name="System.Collections/Queue.cs"/>
- <excludes name="System.Collections/ICollection.cs"/>
- <excludes name="System.Collections/IEnumerator.cs"/>
- <excludes name="System.Collections/IEnumerable.cs"/>
- <excludes name="System.Collections/IList.cs"/>
- <excludes name="System.PAL/IOperatingSystem.cs"/>
- <excludes name="System.Reflection.Emit/**"/>
- <excludes name="System.Runtime.CompilerServices/**"/>
- <excludes name="System.Security.Permissions/SecurityPermissionAttribute.cs"/>
- </sources>
- </csc>
- <nant basedir="Test" target="build"/>
- </target>
-
- <target name="mcs-build">
- <mkdir dir="../lib"/>
-
- <mcs target="library" output="../lib/corlib_mcs.dll" debug="false" verbose="${verbose}">
- <arg value="--unsafe"/>
-
- <arg value="--nostdlib"/> <!-- don't reference mscorlib -->
- <arg value="--noconfig"/> <!-- don't reference ms assemblies -->
-
- <sources>
- <includes name="**/*.cs"/>
-
- <excludes name="Test/**"/>
- <excludes name="System.Security.Permissions/SecurityPermissionAttribute.cs"/> <!-- custom security attributes problem -->
-
- <excludes name="Unix/**"/>
- <excludes name="Linux/**"/>
- <excludes name="Windows/**"/>
- <excludes name="System.PAL/**"/>
- </sources>
- </mcs>
-
- </target>
-
- <target name="test" depends="build">
- <nant basedir="Test" target="test"/>
- </target>
-
- <target name="clean">
- <delete file="../lib/corlib.dll" failonerror="false"/>
- <delete file="../lib/corlib.pdb" failonerror="false"/>
- <delete file="../lib/corlib_cmp.dll" failonerror="false"/>
- <delete file="../lib/corlib_cmp.pdb" failonerror="false"/>
- <delete file="Test/corlib_res.dll" failonerror="false"/>
- <delete file="Test/corlib_res.pdb" failonerror="false"/>
- <nant basedir="Test" target="clean"/>
- </target>
-</project>
diff --git a/mcs/class/corlib/list b/mcs/class/corlib/list
deleted file mode 100755
index 4b86d765491..00000000000
--- a/mcs/class/corlib/list
+++ /dev/null
@@ -1,588 +0,0 @@
---unsafe --nostdlib
-Linux/Linux.cs
-System.Collections/ArrayList.cs
-System.Collections/BitArray.cs
-System.Collections/CaseInsensitiveComparer.cs
-System.Collections/CaseInsensitiveHashCodeProvider.cs
-System.Collections/CollectionBase.cs
-System.Collections/Comparer.cs
-System.Collections/DictionaryBase.cs
-System.Collections/DictionaryEntry.cs
-System.Collections/Hashtable.cs
-System.Collections/ICollection.cs
-System.Collections/IComparer.cs
-System.Collections/IDictionary.cs
-System.Collections/IDictionaryEnumerator.cs
-System.Collections/IEnumerable.cs
-System.Collections/IEnumerator.cs
-System.Collections/IHashCodeProvider.cs
-System.Collections/IList.cs
-System.Collections/Queue.cs
-System.Collections/ReadOnlyCollectionBase.cs
-System.Collections/SortedList.cs
-System.Collections/Stack.cs
-System.Configuration.Assemblies/AssemblyHash.cs
-System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
-System.Configuration.Assemblies/AssemblyVersionCompatibility.cs
-System.Configuration.Assemblies/ProcessorID.cs
-System.Diagnostics.SymbolStore/ISymbolBinder.cs
-System.Diagnostics.SymbolStore/ISymbolDocument.cs
-System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs
-System.Diagnostics.SymbolStore/ISymbolMethod.cs
-System.Diagnostics.SymbolStore/ISymbolNamespace.cs
-System.Diagnostics.SymbolStore/ISymbolReader.cs
-System.Diagnostics.SymbolStore/ISymbolScope.cs
-System.Diagnostics.SymbolStore/ISymbolVariable.cs
-System.Diagnostics.SymbolStore/ISymbolWriter.cs
-System.Diagnostics.SymbolStore/SymAddressKind.cs
-System.Diagnostics.SymbolStore/SymDocumentType.cs
-System.Diagnostics.SymbolStore/SymLanguageType.cs
-System.Diagnostics.SymbolStore/SymLanguageVendor.cs
-System.Diagnostics.SymbolStore/SymbolToken.cs
-System.Diagnostics/ConditionalAttribute.cs
-System.Diagnostics/DebuggableAttribute.cs
-System.Diagnostics/Debugger.cs
-System.Diagnostics/DebuggerHiddenAttribute.cs
-System.Diagnostics/DebuggerStepThroughAttribute.cs
-System.Diagnostics/StackFrame.cs
-System.Diagnostics/StackTrace.cs
-System.Globalization/Calendar.cs
-System.Globalization/CalendarWeekRule.cs
-System.Globalization/CompareOptions.cs
-System.Globalization/CultureInfo.cs
-System.Globalization/CultureTypes.cs
-System.Globalization/DateTimeFormatInfo.cs
-System.Globalization/DateTimeStyles.cs
-System.Globalization/DaylightTime.cs
-System.Globalization/GregorianCalendar.cs
-System.Globalization/GregorianCalendarTypes.cs
-System.Globalization/JulianCalendar.cs
-System.Globalization/Locale.cs
-System.Globalization/NumberFormatInfo.cs
-System.Globalization/NumberStyles.cs
-System.Globalization/RegionInfo.cs
-System.Globalization/UnicodeCategory.cs
-System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
-System.IO.IsolatedStorage/IsolatedStorage.cs
-System.IO.IsolatedStorage/IsolatedStorageException.cs
-System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
-System.IO.IsolatedStorage/IsolatedStorageScope.cs
-System.IO/BinaryReader.cs
-System.IO/BinaryWriter.cs
-System.IO/BufferedStream.cs
-System.IO/CheckArgument.cs
-System.IO/CheckPermission.cs
-System.IO/Directory.cs
-System.IO/DirectoryInfo.cs
-System.IO/DirectoryNotFoundException.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/FileShare.cs
-System.IO/FileStream.cs
-System.IO/FileSystemInfo.cs
-System.IO/IOException.cs
-System.IO/MemoryStream.cs
-System.IO/MonoIOStat.cs
-System.IO/Path.cs
-System.IO/PathTooLongException.cs
-System.IO/SeekOrigin.cs
-System.IO/Stream.cs
-System.IO/StreamReader.cs
-System.IO/StreamWriter.cs
-System.IO/StringReader.cs
-System.IO/StringWriter.cs
-System.IO/TextReader.cs
-System.IO/TextWriter.cs
-System.PAL/Platform.cs
-System.Reflection.Emit/AssemblyBuilder.cs
-System.Reflection.Emit/AssemblyBuilderAccess.cs
-System.Reflection.Emit/ConstructorBuilder.cs
-System.Reflection.Emit/CustomAttributeBuilder.cs
-System.Reflection.Emit/EnumBuilder.cs
-System.Reflection.Emit/EventBuilder.cs
-System.Reflection.Emit/EventToken.cs
-System.Reflection.Emit/FieldBuilder.cs
-System.Reflection.Emit/FieldToken.cs
-System.Reflection.Emit/FlowControl.cs
-System.Reflection.Emit/ILGenerator.cs
-System.Reflection.Emit/Label.cs
-System.Reflection.Emit/LocalBuilder.cs
-System.Reflection.Emit/MethodBuilder.cs
-System.Reflection.Emit/MethodToken.cs
-System.Reflection.Emit/ModuleBuilder.cs
-System.Reflection.Emit/OpCode.cs
-System.Reflection.Emit/OpCodeType.cs
-System.Reflection.Emit/OpCodes.cs
-System.Reflection.Emit/OperandType.cs
-System.Reflection.Emit/PEFileKinds.cs
-System.Reflection.Emit/PackingSize.cs
-System.Reflection.Emit/ParameterBuilder.cs
-System.Reflection.Emit/ParameterToken.cs
-System.Reflection.Emit/PropertyBuilder.cs
-System.Reflection.Emit/PropertyToken.cs
-System.Reflection.Emit/SignatureHelper.cs
-System.Reflection.Emit/SignatureToken.cs
-System.Reflection.Emit/StackBehaviour.cs
-System.Reflection.Emit/StringToken.cs
-System.Reflection.Emit/TypeBuilder.cs
-System.Reflection.Emit/TypeToken.cs
-System.Reflection.Emit/UnmanagedMarshal.cs
-System.Reflection/AmbiguousMatchException.cs
-System.Reflection/Assembly.cs
-System.Reflection/AssemblyAlgorithmIdAttribute.cs
-System.Reflection/AssemblyCompanyAttribute.cs
-System.Reflection/AssemblyConfigurationAttribute.cs
-System.Reflection/AssemblyCopyrightAttribute.cs
-System.Reflection/AssemblyCultureAttribute.cs
-System.Reflection/AssemblyDefaultAliasAttribute.cs
-System.Reflection/AssemblyDelaySignAttribute.cs
-System.Reflection/AssemblyDescriptionAttribute.cs
-System.Reflection/AssemblyFileVersionAttribute.cs
-System.Reflection/AssemblyFlagsAttribute.cs
-System.Reflection/AssemblyInformationalVersionAttribute.cs
-System.Reflection/AssemblyKeyFileAttribute.cs
-System.Reflection/AssemblyKeyNameAttribute.cs
-System.Reflection/AssemblyName.cs
-System.Reflection/AssemblyNameFlags.cs
-System.Reflection/AssemblyNameProxy.cs
-System.Reflection/AssemblyProductAttribute.cs
-System.Reflection/AssemblyTitleAttribute.cs
-System.Reflection/AssemblyTradeMarkAttribute.cs
-System.Reflection/AssemblyVersionAttribute.cs
-System.Reflection/Binder.cs
-System.Reflection/BindingFlags.cs
-System.Reflection/CallingConventions.cs
-System.Reflection/ConstructorInfo.cs
-System.Reflection/CustomAttributeFormatException.cs
-System.Reflection/DefaultMemberAttribute.cs
-System.Reflection/EventAttributes.cs
-System.Reflection/EventInfo.cs
-System.Reflection/FieldAttributes.cs
-System.Reflection/FieldInfo.cs
-System.Reflection/ICustomAttributeProvider.cs
-System.Reflection/IReflect.cs
-System.Reflection/InterfaceMapping.cs
-System.Reflection/InvalidFilterCriteriaException.cs
-System.Reflection/ManifestResourceInfo.cs
-System.Reflection/MemberFilter.cs
-System.Reflection/MemberInfo.cs
-System.Reflection/MemberTypes.cs
-System.Reflection/MethodAttributes.cs
-System.Reflection/MethodBase.cs
-System.Reflection/MethodImplAttributes.cs
-System.Reflection/MethodInfo.cs
-System.Reflection/Missing.cs
-System.Reflection/Module.cs
-System.Reflection/MonoField.cs
-System.Reflection/MonoMethod.cs
-System.Reflection/MonoProperty.cs
-System.Reflection/ParameterAttributes.cs
-System.Reflection/ParameterInfo.cs
-System.Reflection/ParameterModifier.cs
-System.Reflection/PropertyAttributes.cs
-System.Reflection/PropertyInfo.cs
-System.Reflection/ReflectionTypeLoadException.cs
-System.Reflection/ResourceAttributes.cs
-System.Reflection/ResourceLocation.cs
-System.Reflection/StrongNameKeyPair.cs
-System.Reflection/TargetException.cs
-System.Reflection/TargetInvocationException.cs
-System.Reflection/TargetParameterCountException.cs
-System.Reflection/TypeAttributes.cs
-System.Reflection/TypeDelegator.cs
-System.Reflection/TypeFilter.cs
-System.Resources/IResourceReader.cs
-System.Resources/IResourceWriter.cs
-System.Resources/MissingManifestResourceException.cs
-System.Resources/NeutralResoucesLanguageAttribute.cs
-System.Resources/ResourceManager.cs
-System.Resources/ResourceReader.cs
-System.Resources/ResourceSet.cs
-System.Resources/ResourceWriter.cs
-System.Resources/SatelliteContractVersionAttribute.cs
-System.Runtime.CompilerServices/IndexerNameAttribute.cs
-System.Runtime.CompilerServices/MethodCodeType.cs
-System.Runtime.CompilerServices/MethodImplAttribute.cs
-System.Runtime.CompilerServices/MethodImplOptions.cs
-System.Runtime.CompilerServices/RuntimeHelpers.cs
-System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
-System.Runtime.InteropServices/CallingConvention.cs
-System.Runtime.InteropServices/CharSet.cs
-System.Runtime.InteropServices/ComInterfaceType.cs
-System.Runtime.InteropServices/DllImportAttribute.cs
-System.Runtime.InteropServices/ExporterEventKind.cs
-System.Runtime.InteropServices/ExternalException.cs
-System.Runtime.InteropServices/FieldOffsetAttribute.cs
-System.Runtime.InteropServices/GCHandle.cs
-System.Runtime.InteropServices/GCHandleType.cs
-System.Runtime.InteropServices/GuidAttribute.cs
-System.Runtime.InteropServices/ICustomAdapter.cs
-System.Runtime.InteropServices/ICustomFactory.cs
-System.Runtime.InteropServices/ICustomMarshaler.cs
-System.Runtime.InteropServices/IRegistrationServices.cs
-System.Runtime.InteropServices/ITypeLibConverter.cs
-System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs
-System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs
-System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs
-System.Runtime.InteropServices/ImporterEventKind.cs
-System.Runtime.InteropServices/InAttribute.cs
-System.Runtime.InteropServices/InterfaceTypeAttribute.cs
-System.Runtime.InteropServices/LayoutKind.cs
-System.Runtime.InteropServices/Marshal.cs
-System.Runtime.InteropServices/MarshalAsAttribute.cs
-System.Runtime.InteropServices/OptionalAttribute.cs
-System.Runtime.InteropServices/OutAttribute.cs
-System.Runtime.InteropServices/PInvokeMap.cs
-System.Runtime.InteropServices/StructLayoutAttribute.cs
-System.Runtime.InteropServices/TypeLibExporterFlags.cs
-System.Runtime.InteropServices/UnmanagedType.cs
-System.Runtime.InteropServices/VarEnum.cs
-System.Runtime.Remoting.Activation/ActivatorLevel.cs
-System.Runtime.Remoting.Activation/IActivator.cs
-System.Runtime.Remoting.Activation/IConstructionCallMessage.cs
-System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs
-System.Runtime.Remoting.Contexts/Context.cs
-System.Runtime.Remoting.Contexts/ContextAttribute.cs
-System.Runtime.Remoting.Contexts/IContextAttribute.cs
-System.Runtime.Remoting.Contexts/IContextProperty.cs
-System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs
-System.Runtime.Remoting.Contexts/IDynamicProperty.cs
-System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs
-System.Runtime.Remoting.Messaging/Header.cs
-System.Runtime.Remoting.Messaging/IMessage.cs
-System.Runtime.Remoting.Messaging/IMethodMessage.cs
-System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs
-System.Runtime.Remoting.Messaging/LogicalCallContext.cs
-System.Runtime.Remoting.Messaging/IMessageSink.cs
-System.Runtime.Remoting.Messaging/IMessageCtrl.cs
-System.Runtime.Remoting/LeaseState.cs
-System.Runtime.Remoting/ObjRef.cs
-System.Runtime.Remoting/ObjectHandle.cs
-System.Runtime.Remoting/SoapMethodOption.cs
-System.Runtime.Remoting/SoapOption.cs
-System.Runtime.Remoting/WellKnownObjectMode.cs
-System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs
-System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs
-System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs
-System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs
-System.Runtime.Serialization.Formatters/IFieldInfo.cs
-System.Runtime.Serialization.Formatters/ISoapMessage.cs
-System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs
-System.Runtime.Serialization.Formatters/InternalElementTypeE.cs
-System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs
-System.Runtime.Serialization.Formatters/InternalMemberValueE.cs
-System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs
-System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs
-System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs
-System.Runtime.Serialization.Formatters/InternalParseStateE.cs
-System.Runtime.Serialization.Formatters/InternalParseTypeE.cs
-System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs
-System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs
-System.Runtime.Serialization/IDeserializationCallback.cs
-System.Runtime.Serialization/IFormatter.cs
-System.Runtime.Serialization/IFormatterConverter.cs
-System.Runtime.Serialization/IObjectReference.cs
-System.Runtime.Serialization/ISerializable.cs
-System.Runtime.Serialization/ISerializationSurrogate.cs
-System.Runtime.Serialization/ISurrogateSelector.cs
-System.Runtime.Serialization/SerializationBinder.cs
-System.Runtime.Serialization/SerializationEntry.cs
-System.Runtime.Serialization/SerializationException.cs
-System.Runtime.Serialization/SerializationInfo.cs
-System.Runtime.Serialization/SerializationInfoEnumerator.cs
-System.Runtime.Serialization/StreamingContext.cs
-System.Runtime.Serialization/StreamingContextStates.cs
-System.Runtime.Serialization/SurrogateSelector.cs
-System.Security.Cryptography/AsymmetricAlgorithm.cs
-System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs
-System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs
-System.Security.Cryptography/AsymmetricSignatureDeformatter.cs
-System.Security.Cryptography/AsymmetricSignatureFormatter.cs
-System.Security.Cryptography/CipherMode.cs
-System.Security.Cryptography/CryptoAPITransform.cs
-System.Security.Cryptography/CryptoStream.cs
-System.Security.Cryptography/CryptoStreamMode.cs
-System.Security.Cryptography/CryptographicException.cs
-System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs
-System.Security.Cryptography/CspParameters.cs
-System.Security.Cryptography/CspProviderFlags.cs
-System.Security.Cryptography/DES.cs
-System.Security.Cryptography/DESCryptoServiceProvider.cs
-System.Security.Cryptography/DSA.cs
-System.Security.Cryptography/DSACryptoServiceProvider.cs
-System.Security.Cryptography/DSAParameters.cs
-System.Security.Cryptography/DSASignatureDeformatter.cs
-System.Security.Cryptography/DSASignatureFormatter.cs
-System.Security.Cryptography/DeriveBytes.cs
-System.Security.Cryptography/FromBase64Transform.cs
-System.Security.Cryptography/HashAlgorithm.cs
-System.Security.Cryptography/ICryptoTransform.cs
-System.Security.Cryptography/KeySizes.cs
-System.Security.Cryptography/MD5.cs
-System.Security.Cryptography/MD5CryptoServiceProvider.cs
-System.Security.Cryptography/PaddingMode.cs
-System.Security.Cryptography/RNGCryptoServiceProvider.cs
-System.Security.Cryptography/RSA.cs
-System.Security.Cryptography/RSAParameters.cs
-System.Security.Cryptography/RandomNumberGenerator.cs
-System.Security.Cryptography/Rijndael.cs
-System.Security.Cryptography/RijndaelManaged.cs
-System.Security.Cryptography/SHA1.cs
-System.Security.Cryptography/SHA1CryptoServiceProvider.cs
-System.Security.Cryptography/SHA256.cs
-System.Security.Cryptography/SHA256Managed.cs
-System.Security.Cryptography/SHA384.cs
-System.Security.Cryptography/SHA384Managed.cs
-System.Security.Cryptography/SHA512.cs
-System.Security.Cryptography/SHA512Managed.cs
-System.Security.Cryptography/SignatureDescription.cs
-System.Security.Cryptography/SymmetricAlgorithm.cs
-System.Security.Cryptography/ToBase64Transform.cs
-System.Security.Cryptography/X509Certificates.cs
-System.Security.Permissions/CodeAccessSecurityAttribute.cs
-System.Security.Permissions/EnvironmentPermissionAccess.cs
-System.Security.Permissions/EnvironmentPermissionAttribute.cs
-System.Security.Permissions/FileDialogPermissionAccess.cs
-System.Security.Permissions/FileDialogPermissionAttribute.cs
-System.Security.Permissions/FileIOPermission.cs
-System.Security.Permissions/FileIOPermissionAccess.cs
-System.Security.Permissions/FileIOPermissionAttribute.cs
-System.Security.Permissions/IUnrestrictedPermission.cs
-System.Security.Permissions/IsolatedStorageContainment.cs
-System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs
-System.Security.Permissions/IsolatedStoragePermission.cs
-System.Security.Permissions/IsolatedStoragePermissionAttribute.cs
-System.Security.Permissions/PermissionSetAttribute.cs
-System.Security.Permissions/PermissionState.cs
-System.Security.Permissions/PrinciplePermissionAttribute.cs
-System.Security.Permissions/ReflectionPermissionAttribute.cs
-System.Security.Permissions/ReflectionPermissionFlag.cs
-System.Security.Permissions/RegistryPermissionAccess.cs
-System.Security.Permissions/RegistryPermissionAttribute.cs
-System.Security.Permissions/SecurityAction.cs
-System.Security.Permissions/SecurityAttribute.cs
-System.Security.Permissions/SecurityPermission.cs
-System.Security.Permissions/SecurityPermissionFlag.cs
-System.Security.Permissions/SiteIdentityPermissionAttribute.cs
-System.Security.Permissions/StrongNamePermissionAttribute.cs
-System.Security.Permissions/UIPermissionAttribute.cs
-System.Security.Permissions/UIPermissionClipboard.cs
-System.Security.Permissions/UIPermissionWindow.cs
-System.Security.Permissions/UrlIdentityPermissionAttribute.cs
-System.Security.Permissions/ZoneIdentityPermissionAttribute.cs
-System.Security.Policy/AllMembershipCondition.cs
-System.Security.Policy/CodeGroup.cs
-System.Security.Policy/Evidence.cs
-System.Security.Policy/FileCodeGroup.cs
-System.Security.Policy/IIdentityPermissionFactory.cs
-System.Security.Policy/IMembershipCondition.cs
-System.Security.Policy/PolicyException.cs
-System.Security.Policy/PolicyLevel.cs
-System.Security.Policy/PolicyStatement.cs
-System.Security.Policy/PolicyStatementAttribute.cs
-System.Security.Principal/GenericIdentity.cs
-System.Security.Principal/GenericPrincipal.cs
-System.Security.Principal/IIdentity.cs
-System.Security.Principal/IPrincipal.cs
-System.Security.Principal/PrincipalPolicy.cs
-System.Security.Principal/WindowsAccountType.cs
-System.Security.Principal/WindowsBuiltInRole.cs
-System.Security/CodeAccessPermission.cs
-System.Security/IEvidenceFactory.cs
-System.Security/IPermission.cs
-System.Security/ISecurityEncodable.cs
-System.Security/ISecurityPolicyEncodable.cs
-System.Security/IStackWalk.cs
-System.Security/NamedPermissionSet.cs
-System.Security/PermissionSet.cs
-System.Security/PolicyLevelType.cs
-System.Security/SecurityElement.cs
-System.Security/SecurityException.cs
-System.Security/SecurityManager.cs
-System.Security/SecurityZone.cs
-System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
-System.Security/UnverifiableCodeAttribute.cs
-System.Security/VerificationException.cs
-System.Security/XmlSyntaxException.cs
-System.Text/ASCIIEncoding.cs
-System.Text/Decoder.cs
-System.Text/Encoder.cs
-System.Text/Encoding.cs
-System.Text/StringBuilder.cs
-System.Text/UTF7Encoding.cs
-System.Text/UTF8Encoding.cs
-System.Text/UnicodeEncoding.cs
-System.Threading/ApartmentState.cs
-System.Threading/AutoResetEvent.cs
-System.Threading/IOCompletionCallback.cs
-System.Threading/Interlocked.cs
-System.Threading/LockCookie.cs
-System.Threading/ManualResetEvent.cs
-System.Threading/Monitor.cs
-System.Threading/Mutex.cs
-System.Threading/NativeEventCalls.cs
-System.Threading/NativeOverlapped.cs
-System.Threading/Overlapped.cs
-System.Threading/ReaderWriterLock.cs
-System.Threading/RegisteredWaitHandle.cs
-System.Threading/SynchronizationLockException.cs
-System.Threading/Thread.cs
-System.Threading/ThreadAbortException.cs
-System.Threading/ThreadInterruptedException.cs
-System.Threading/ThreadPool.cs
-System.Threading/ThreadPriority.cs
-System.Threading/ThreadStart.cs
-System.Threading/ThreadState.cs
-System.Threading/ThreadStateException.cs
-System.Threading/Timeout.cs
-System.Threading/Timer.cs
-System.Threading/TimerCallback.cs
-System.Threading/WaitCallback.cs
-System.Threading/WaitHandle.cs
-System.Threading/WaitOrTimerCallback.cs
-System/AppDomain.cs
-System/AppDomainSetup.cs
-System/AppDomainUnloadedException.cs
-System/ApplicationException.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/Attribute.cs
-System/AttributeTargets.cs
-System/AttributeUsage.cs
-System/BadImageFormatException.cs
-System/BitConverter.cs
-System/Boolean.cs
-System/Buffer.cs
-System/Byte.cs
-System/CLSCompliantAttribute.cs
-System/CannotUnloadAppDomainException.cs
-System/Char.cs
-System/CharEnumerator.cs
-System/Console.cs
-System/ContextBoundObject.cs
-System/ContextMarshalException.cs
-System/ContextStaticAttribute.cs
-System/Convert.cs
-System/CrossAppDomainDelegate.cs
-System/DBNull.cs
-System/DateTime.cs
-System/Decimal.cs
-System/DecimalFormatter.cs
-System/Delegate.cs
-System/DivideByZeroException.cs
-System/DllNotFoundException.cs
-System/Double.cs
-System/DuplicateWaitObjectException.cs
-System/EntryPointNotFoundException.cs
-System/Enum.cs
-System/Environment.cs
-System/EventArgs.cs
-System/EventHandler.cs
-System/Exception.cs
-System/ExecutionEngineException.cs
-System/FieldAccessException.cs
-System/FlagsAttribute.cs
-System/FormatException.cs
-System/GC.cs
-System/Guid.cs
-System/IAppDomainSetup.cs
-System/IAsyncResult.cs
-System/ICloneable.cs
-System/IComparable.cs
-System/IConvertible.cs
-System/ICustomFormatter.cs
-System/IDisposable.cs
-System/IFormatProvider.cs
-System/IFormattable.cs
-System/IServiceProvider.cs
-System/IndexOutOfRangeException.cs
-System/Int16.cs
-System/Int32.cs
-System/Int64.cs
-System/IntPtr.cs
-System/IntegerFormatter.cs
-System/InvalidCastException.cs
-System/InvalidOperationException.cs
-System/InvalidProgramException.cs
-System/LoaderOptimization.cs
-System/LoaderOptimizationAttribute.cs
-System/LocalDataStoreSlot.cs
-System/MTAThreadAttribute.cs
-System/MarshalByRefObject.cs
-System/Math.cs
-System/MemberAccessException.cs
-System/MethodAccessException.cs
-System/MissingFieldException.cs
-System/MissingMemberException.cs
-System/MissingMethodException.cs
-System/MonoCustomAttrs.cs
-System/MonoDummy.cs
-System/MonoType.cs
-System/MulticastDelegate.cs
-System/MulticastNotSupportedException.cs
-System/NonSerializedAttribute.cs
-System/NotFiniteNumberException.cs
-System/NotImplementedException.cs
-System/NotSupportedException.cs
-System/NullReferenceException.cs
-System/Object.cs
-System/ObjectDisposedException.cs
-System/ObsoleteAttribute.cs
-System/OperatingSystem.cs
-System/OutOfMemoryException.cs
-System/OverflowException.cs
-System/ParamArrayAttribute.cs
-System/PlatformID.cs
-System/PlatformNotSupportedException.cs
-System/Random.cs
-System/RankException.cs
-System/ResolveEventArgs.cs
-System/ResolveEventHandler.cs
-System/RuntimeArgumentHandle.cs
-System/RuntimeFieldHandle.cs
-System/RuntimeMethodHandle.cs
-System/RuntimeTypeHandle.cs
-System/SByte.cs
-System/STAThreadAttribute.cs
-System/SerializableAttribute.cs
-System/Single.cs
-System/StackOverflowException.cs
-System/String.cs
-System/SystemException.cs
-System/TODOAttribute.cs
-System/ThreadStaticAttribute.cs
-System/TimeSpan.cs
-System/TimeZone.cs
-System/Type.cs
-System/TypeCode.cs
-System/TypeInitializationException.cs
-System/TypeLoadException.cs
-System/TypeUnloadedException.cs
-System/UInt16.cs
-System/UInt32.cs
-System/UInt64.cs
-System/UIntPtr.cs
-System/UnauthorizedAccessException.cs
-System/UnhandledExceptionEventArgs.cs
-System/UnhandledExceptionEventHandler.cs
-System/ValueType.cs
-System/Version.cs
-System/Void.cs
-System/WeakReference.cs
-System/_AppDomain.cs
-System/a.cs
-Unix/Errno.cs
-Unix/Wrapper.cs
diff --git a/mcs/class/corlib/unix.args b/mcs/class/corlib/unix.args
deleted file mode 100755
index e022c045fee..00000000000
--- a/mcs/class/corlib/unix.args
+++ /dev/null
@@ -1,640 +0,0 @@
---target library
---unsafe --nostdlib --noconfig
--o ../lib/corlib_mcs.dll
-System/Activator.cs
-System/AppDomain.cs
-System/AppDomainSetup.cs
-System/AppDomainUnloadedException.cs
-System/ApplicationException.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/Attribute.cs
-System/AttributeTargets.cs
-System/AttributeUsage.cs
-System/BadImageFormatException.cs
-System/BitConverter.cs
-System/Boolean.cs
-System/Buffer.cs
-System/Byte.cs
-System/CannotUnloadAppDomainException.cs
-System/Char.cs
-System/CharEnumerator.cs
-System/CLSCompliantAttribute.cs
-System/Console.cs
-System/ContextBoundObject.cs
-System/ContextMarshalException.cs
-System/ContextStaticAttribute.cs
-System/Convert.cs
-System/CrossAppDomainDelegate.cs
-System/DateTime.cs
-System/DBNull.cs
-System/Decimal.cs
-System/DecimalFormatter.cs
-System/Delegate.cs
-System/DivideByZeroException.cs
-System/DllNotFoundException.cs
-System/Double.cs
-System/DuplicateWaitObjectException.cs
-System/EntryPointNotFoundException.cs
-System/Enum.cs
-System/Environment.cs
-System/EventArgs.cs
-System/EventHandler.cs
-System/Exception.cs
-System/ExecutionEngineException.cs
-System/FieldAccessException.cs
-System/FlagsAttribute.cs
-System/FormatException.cs
-System/GC.cs
-System/Guid.cs
-System/IAppDomainSetup.cs
-System/IAsyncResult.cs
-System/ICloneable.cs
-System/IComparable.cs
-System/IConvertible.cs
-System/ICustomFormatter.cs
-System/IDisposable.cs
-System/IFormatProvider.cs
-System/IFormattable.cs
-System/IndexOutOfRangeException.cs
-System/Int16.cs
-System/Int32.cs
-System/Int64.cs
-System/IntegerFormatter.cs
-System/IntPtr.cs
-System/InvalidCastException.cs
-System/InvalidOperationException.cs
-System/InvalidProgramException.cs
-System/IServiceProvider.cs
-System/LoaderOptimization.cs
-System/LoaderOptimizationAttribute.cs
-System/LocalDataStoreSlot.cs
-System/MarshalByRefObject.cs
-System/Math.cs
-System/MemberAccessException.cs
-System/MethodAccessException.cs
-System/MissingFieldException.cs
-System/MissingMemberException.cs
-System/MissingMethodException.cs
-System/MonoCustomAttrs.cs
-System/MonoDummy.cs
-System/MonoType.cs
-System/MTAThreadAttribute.cs
-System/MulticastDelegate.cs
-System/MulticastNotSupportedException.cs
-System/NonSerializedAttribute.cs
-System/NotFiniteNumberException.cs
-System/NotImplementedException.cs
-System/NotSupportedException.cs
-System/NullReferenceException.cs
-System/Object.cs
-System/ObjectDisposedException.cs
-System/ObsoleteAttribute.cs
-System/OperatingSystem.cs
-System/OutOfMemoryException.cs
-System/OverflowException.cs
-System/ParamArrayAttribute.cs
-System/PlatformID.cs
-System/PlatformNotSupportedException.cs
-System/Random.cs
-System/RankException.cs
-System/ResolveEventArgs.cs
-System/ResolveEventHandler.cs
-System/RuntimeArgumentHandle.cs
-System/RuntimeFieldHandle.cs
-System/RuntimeMethodHandle.cs
-System/RuntimeTypeHandle.cs
-System/SByte.cs
-System/SerializableAttribute.cs
-System/Single.cs
-System/StackOverflowException.cs
-System/STAThreadAttribute.cs
-System/String.cs
-System/SystemException.cs
-System/ThreadStaticAttribute.cs
-System/TimeSpan.cs
-System/TimeZone.cs
-System/TODOAttribute.cs
-System/Type.cs
-System/TypeCode.cs
-System/TypeInitializationException.cs
-System/TypeLoadException.cs
-System/TypeUnloadedException.cs
-System/UInt16.cs
-System/UInt32.cs
-System/UInt64.cs
-System/UIntPtr.cs
-System/UnauthorizedAccessException.cs
-System/UnhandledExceptionEventArgs.cs
-System/UnhandledExceptionEventHandler.cs
-System/ValueType.cs
-System/Version.cs
-System/Void.cs
-System/WeakReference.cs
-System/_AppDomain.cs
-System.Collections/ArrayList.cs
-System.Collections/BitArray.cs
-System.Collections/CaseInsensitiveComparer.cs
-System.Collections/CaseInsensitiveHashCodeProvider.cs
-System.Collections/CollectionBase.cs
-System.Collections/Comparer.cs
-System.Collections/DictionaryBase.cs
-System.Collections/DictionaryEntry.cs
-System.Collections/Hashtable.cs
-System.Collections/ICollection.cs
-System.Collections/IComparer.cs
-System.Collections/IDictionary.cs
-System.Collections/IDictionaryEnumerator.cs
-System.Collections/IEnumerable.cs
-System.Collections/IEnumerator.cs
-System.Collections/IHashCodeProvider.cs
-System.Collections/IList.cs
-System.Collections/Queue.cs
-System.Collections/ReadOnlyCollectionBase.cs
-System.Collections/SortedList.cs
-System.Collections/Stack.cs
-System.Configuration.Assemblies/AssemblyHash.cs
-System.Configuration.Assemblies/AssemblyHashAlgorithm.cs
-System.Configuration.Assemblies/AssemblyVersionCompatibility.cs
-System.Configuration.Assemblies/ProcessorID.cs
-System.Diagnostics/ConditionalAttribute.cs
-System.Diagnostics/DebuggableAttribute.cs
-System.Diagnostics/Debugger.cs
-System.Diagnostics/DebuggerHiddenAttribute.cs
-System.Diagnostics/DebuggerStepThroughAttribute.cs
-System.Diagnostics/StackFrame.cs
-System.Diagnostics/StackTrace.cs
-System.Diagnostics.SymbolStore/ISymbolBinder.cs
-System.Diagnostics.SymbolStore/ISymbolDocument.cs
-System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs
-System.Diagnostics.SymbolStore/ISymbolMethod.cs
-System.Diagnostics.SymbolStore/ISymbolNamespace.cs
-System.Diagnostics.SymbolStore/ISymbolReader.cs
-System.Diagnostics.SymbolStore/ISymbolScope.cs
-System.Diagnostics.SymbolStore/ISymbolVariable.cs
-System.Diagnostics.SymbolStore/ISymbolWriter.cs
-System.Diagnostics.SymbolStore/SymAddressKind.cs
-System.Diagnostics.SymbolStore/SymbolToken.cs
-System.Diagnostics.SymbolStore/SymDocumentType.cs
-System.Diagnostics.SymbolStore/SymLanguageType.cs
-System.Diagnostics.SymbolStore/SymLanguageVendor.cs
-System.Globalization/Calendar.cs
-System.Globalization/CalendarWeekRule.cs
-System.Globalization/CalendricalCalculations.cs
-System.Globalization/CompareInfo.cs
-System.Globalization/CompareOptions.cs
-System.Globalization/CultureInfo.cs
-System.Globalization/CultureTypes.cs
-System.Globalization/DateTimeFormatInfo.cs
-System.Globalization/DateTimeStyles.cs
-System.Globalization/DaylightTime.cs
-System.Globalization/GregorianCalendar.cs
-System.Globalization/GregorianCalendarTypes.cs
-System.Globalization/HebrewCalendar.cs
-System.Globalization/HijriCalendar.cs
-System.Globalization/JapaneseCalendar.cs
-System.Globalization/JulianCalendar.cs
-System.Globalization/KoreanCalendar.cs
-System.Globalization/Locale.cs
-System.Globalization/NumberFormatInfo.cs
-System.Globalization/NumberStyles.cs
-System.Globalization/RegionInfo.cs
-System.Globalization/TaiwanCalendar.cs
-System.Globalization/ThaiBuddhistCalendar.cs
-System.Globalization/UnicodeCategory.cs
-System.IO/BinaryReader.cs
-System.IO/BinaryWriter.cs
-System.IO/BufferedStream.cs
-System.IO/CheckArgument.cs
-System.IO/CheckPermission.cs
-System.IO/Directory.cs
-System.IO/DirectoryInfo.cs
-System.IO/DirectoryNotFoundException.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/FileShare.cs
-System.IO/FileStream.cs
-System.IO/FileSystemInfo.cs
-System.IO/IOException.cs
-System.IO/MemoryStream.cs
-System.IO/MonoIO.cs
-System.IO/MonoIOError.cs
-System.IO/MonoIOStat.cs
-System.IO/Path.cs
-System.IO/PathTooLongException.cs
-System.IO/SearchPattern.cs
-System.IO/SeekOrigin.cs
-System.IO/Stream.cs
-System.IO/StreamReader.cs
-System.IO/StreamWriter.cs
-System.IO/StringReader.cs
-System.IO/StringWriter.cs
-System.IO/TextReader.cs
-System.IO/TextWriter.cs
-System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
-System.IO.IsolatedStorage/IsolatedStorage.cs
-System.IO.IsolatedStorage/IsolatedStorageException.cs
-System.IO.IsolatedStorage/IsolatedStorageFileStream.cs
-System.IO.IsolatedStorage/IsolatedStorageScope.cs
-System.Reflection/AmbiguousMatchException.cs
-System.Reflection/Assembly.cs
-System.Reflection/AssemblyAlgorithmIdAttribute.cs
-System.Reflection/AssemblyCompanyAttribute.cs
-System.Reflection/AssemblyConfigurationAttribute.cs
-System.Reflection/AssemblyCopyrightAttribute.cs
-System.Reflection/AssemblyCultureAttribute.cs
-System.Reflection/AssemblyDefaultAliasAttribute.cs
-System.Reflection/AssemblyDelaySignAttribute.cs
-System.Reflection/AssemblyDescriptionAttribute.cs
-System.Reflection/AssemblyFileVersionAttribute.cs
-System.Reflection/AssemblyFlagsAttribute.cs
-System.Reflection/AssemblyInformationalVersionAttribute.cs
-System.Reflection/AssemblyKeyFileAttribute.cs
-System.Reflection/AssemblyKeyNameAttribute.cs
-System.Reflection/AssemblyName.cs
-System.Reflection/AssemblyNameFlags.cs
-System.Reflection/AssemblyNameProxy.cs
-System.Reflection/AssemblyProductAttribute.cs
-System.Reflection/AssemblyTitleAttribute.cs
-System.Reflection/AssemblyTradeMarkAttribute.cs
-System.Reflection/AssemblyVersionAttribute.cs
-System.Reflection/Binder.cs
-System.Reflection/BindingFlags.cs
-System.Reflection/CallingConventions.cs
-System.Reflection/ConstructorInfo.cs
-System.Reflection/CustomAttributeFormatException.cs
-System.Reflection/DefaultMemberAttribute.cs
-System.Reflection/EventAttributes.cs
-System.Reflection/EventInfo.cs
-System.Reflection/FieldAttributes.cs
-System.Reflection/FieldInfo.cs
-System.Reflection/ICustomAttributeProvider.cs
-System.Reflection/InterfaceMapping.cs
-System.Reflection/InvalidFilterCriteriaException.cs
-System.Reflection/IReflect.cs
-System.Reflection/ManifestResourceInfo.cs
-System.Reflection/MemberFilter.cs
-System.Reflection/MemberInfo.cs
-System.Reflection/MemberTypes.cs
-System.Reflection/MethodAttributes.cs
-System.Reflection/MethodBase.cs
-System.Reflection/MethodImplAttributes.cs
-System.Reflection/MethodInfo.cs
-System.Reflection/Missing.cs
-System.Reflection/Module.cs
-System.Reflection/MonoEvent.cs
-System.Reflection/MonoField.cs
-System.Reflection/MonoMethod.cs
-System.Reflection/MonoProperty.cs
-System.Reflection/ParameterAttributes.cs
-System.Reflection/ParameterInfo.cs
-System.Reflection/ParameterModifier.cs
-System.Reflection/PropertyAttributes.cs
-System.Reflection/PropertyInfo.cs
-System.Reflection/ReflectionTypeLoadException.cs
-System.Reflection/ResourceAttributes.cs
-System.Reflection/ResourceLocation.cs
-System.Reflection/StrongNameKeyPair.cs
-System.Reflection/TargetException.cs
-System.Reflection/TargetInvocationException.cs
-System.Reflection/TargetParameterCountException.cs
-System.Reflection/TypeAttributes.cs
-System.Reflection/TypeDelegator.cs
-System.Reflection/TypeFilter.cs
-System.Reflection.Emit/AssemblyBuilder.cs
-System.Reflection.Emit/AssemblyBuilderAccess.cs
-System.Reflection.Emit/ConstructorBuilder.cs
-System.Reflection.Emit/CustomAttributeBuilder.cs
-System.Reflection.Emit/EnumBuilder.cs
-System.Reflection.Emit/EventBuilder.cs
-System.Reflection.Emit/EventToken.cs
-System.Reflection.Emit/FieldBuilder.cs
-System.Reflection.Emit/FieldToken.cs
-System.Reflection.Emit/FlowControl.cs
-System.Reflection.Emit/ILGenerator.cs
-System.Reflection.Emit/Label.cs
-System.Reflection.Emit/LocalBuilder.cs
-System.Reflection.Emit/MethodBuilder.cs
-System.Reflection.Emit/MethodToken.cs
-System.Reflection.Emit/ModuleBuilder.cs
-System.Reflection.Emit/MonoArrayMethod.cs
-System.Reflection.Emit/OpCode.cs
-System.Reflection.Emit/OpCodes.cs
-System.Reflection.Emit/OpCodeType.cs
-System.Reflection.Emit/OperandType.cs
-System.Reflection.Emit/PackingSize.cs
-System.Reflection.Emit/ParameterBuilder.cs
-System.Reflection.Emit/ParameterToken.cs
-System.Reflection.Emit/PEFileKinds.cs
-System.Reflection.Emit/PropertyBuilder.cs
-System.Reflection.Emit/PropertyToken.cs
-System.Reflection.Emit/SignatureHelper.cs
-System.Reflection.Emit/SignatureToken.cs
-System.Reflection.Emit/StackBehaviour.cs
-System.Reflection.Emit/StringToken.cs
-System.Reflection.Emit/TypeBuilder.cs
-System.Reflection.Emit/TypeToken.cs
-System.Reflection.Emit/UnmanagedMarshal.cs
-System.Resources/IResourceReader.cs
-System.Resources/IResourceWriter.cs
-System.Resources/MissingManifestResourceException.cs
-System.Resources/NeutralResoucesLanguageAttribute.cs
-System.Resources/ResourceManager.cs
-System.Resources/ResourceReader.cs
-System.Resources/ResourceSet.cs
-System.Resources/ResourceWriter.cs
-System.Resources/SatelliteContractVersionAttribute.cs
-System.Runtime.CompilerServices/IndexerNameAttribute.cs
-System.Runtime.CompilerServices/MethodCodeType.cs
-System.Runtime.CompilerServices/MethodImplAttribute.cs
-System.Runtime.CompilerServices/MethodImplOptions.cs
-System.Runtime.CompilerServices/RuntimeHelpers.cs
-System.Runtime.InteropServices/AssemblyRegistrationFlags.cs
-System.Runtime.InteropServices/AutomationProxyAttribute.cs
-System.Runtime.InteropServices/BINDPTR.cs
-System.Runtime.InteropServices/CallingConvention.cs
-System.Runtime.InteropServices/CharSet.cs
-System.Runtime.InteropServices/ClassInterfaceAttribute.cs
-System.Runtime.InteropServices/ClassInterfaceType.cs
-System.Runtime.InteropServices/CoClassAttribute.cs
-System.Runtime.InteropServices/ComAliasNameAttribute.cs
-System.Runtime.InteropServices/ComConversionLossAttribute.cs
-System.Runtime.InteropServices/ComEventInterfaceAttribute.cs
-System.Runtime.InteropServices/ComImportAttribute.cs
-System.Runtime.InteropServices/ComInterfaceType.cs
-System.Runtime.InteropServices/ComMemberType.cs
-System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs
-System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs
-System.Runtime.InteropServices/ComVisible.cs
-System.Runtime.InteropServices/DESCKIND.cs
-System.Runtime.InteropServices/DISPPARAMS.cs
-System.Runtime.InteropServices/DispIdAttribute.cs
-System.Runtime.InteropServices/DllImportAttribute.cs
-System.Runtime.InteropServices/EXCEPINFO.cs
-System.Runtime.InteropServices/ExporterEventKind.cs
-System.Runtime.InteropServices/ExternalException.cs
-System.Runtime.InteropServices/FieldOffsetAttribute.cs
-System.Runtime.InteropServices/GCHandle.cs
-System.Runtime.InteropServices/GCHandleType.cs
-System.Runtime.InteropServices/GuidAttribute.cs
-System.Runtime.InteropServices/ICustomAdapter.cs
-System.Runtime.InteropServices/ICustomFactory.cs
-System.Runtime.InteropServices/ICustomMarshaler.cs
-System.Runtime.InteropServices/INVOKEKIND.cs
-System.Runtime.InteropServices/IRegistrationServices.cs
-System.Runtime.InteropServices/ITypeLibConverter.cs
-System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs
-System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs
-System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs
-System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs
-System.Runtime.InteropServices/ImporterEventKind.cs
-System.Runtime.InteropServices/InAttribute.cs
-System.Runtime.InteropServices/InterfaceTypeAttribute.cs
-System.Runtime.InteropServices/LCIDConversionAttribute.cs
-System.Runtime.InteropServices/LayoutKind.cs
-System.Runtime.InteropServices/Marshal.cs
-System.Runtime.InteropServices/MarshalAsAttribute.cs
-System.Runtime.InteropServices/OptionalAttribute.cs
-System.Runtime.InteropServices/OutAttribute.cs
-System.Runtime.InteropServices/PInvokeMap.cs
-System.Runtime.InteropServices/PreserveSigAttribute.cs
-System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs
-System.Runtime.InteropServices/ProgIdAttribute.cs
-System.Runtime.InteropServices/StructLayoutAttribute.cs
-System.Runtime.InteropServices/TYPEKIND.cs
-System.Runtime.InteropServices/TypeLibExporterFlags.cs
-System.Runtime.InteropServices/TypeLibFuncAttribute.cs
-System.Runtime.InteropServices/TypeLibFuncFlags.cs
-System.Runtime.InteropServices/TypeLibTypeAttribute.cs
-System.Runtime.InteropServices/TypeLibTypeFlags.cs
-System.Runtime.InteropServices/TypeLibVarAttribute.cs
-System.Runtime.InteropServices/TypeLibVarFlags.cs
-System.Runtime.InteropServices/UCOMTypeComp.cs
-System.Runtime.InteropServices/UCOMTypeInfo.cs
-System.Runtime.InteropServices/UCOMTypeLib.cs
-System.Runtime.InteropServices/UnmanagedType.cs
-System.Runtime.InteropServices/VarEnum.cs
-System.Runtime.Remoting/LeaseState.cs
-System.Runtime.Remoting/ObjectHandle.cs
-System.Runtime.Remoting/ObjRef.cs
-System.Runtime.Remoting/RemotingServices.cs
-System.Runtime.Remoting/SoapMethodOption.cs
-System.Runtime.Remoting/SoapOption.cs
-System.Runtime.Remoting/WellKnownObjectMode.cs
-System.Runtime.Remoting.Activation/ActivatorLevel.cs
-System.Runtime.Remoting.Activation/IActivator.cs
-System.Runtime.Remoting.Activation/IConstructionCallMessage.cs
-System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs
-System.Runtime.Remoting.Contexts/Context.cs
-System.Runtime.Remoting.Contexts/ContextAttribute.cs
-System.Runtime.Remoting.Contexts/IContextAttribute.cs
-System.Runtime.Remoting.Contexts/IContextProperty.cs
-System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs
-System.Runtime.Remoting.Contexts/IDynamicProperty.cs
-System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs
-System.Runtime.Remoting.Messaging/AsyncResult.cs
-System.Runtime.Remoting.Messaging/Header.cs
-System.Runtime.Remoting.Messaging/IMessage.cs
-System.Runtime.Remoting.Messaging/IMessageCtrl.cs
-System.Runtime.Remoting.Messaging/IMessageSink.cs
-System.Runtime.Remoting.Messaging/IMethodCallMessage.cs
-System.Runtime.Remoting.Messaging/IMethodMessage.cs
-System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs
-System.Runtime.Remoting.Messaging/LogicalCallContext.cs
-System.Runtime.Remoting.Messaging/MonoMethodMessage.cs
-System.Runtime.Remoting.Messaging/ReturnMessage.cs
-System.Runtime.Remoting.Proxies/RealProxy.cs
-System.Runtime.Serialization/IDeserializationCallback.cs
-System.Runtime.Serialization/IFormatter.cs
-System.Runtime.Serialization/IFormatterConverter.cs
-System.Runtime.Serialization/IObjectReference.cs
-System.Runtime.Serialization/ISerializable.cs
-System.Runtime.Serialization/ISerializationSurrogate.cs
-System.Runtime.Serialization/ISurrogateSelector.cs
-System.Runtime.Serialization/ObjectIDGenerator.cs
-System.Runtime.Serialization/SerializationBinder.cs
-System.Runtime.Serialization/SerializationEntry.cs
-System.Runtime.Serialization/SerializationException.cs
-System.Runtime.Serialization/SerializationInfo.cs
-System.Runtime.Serialization/SerializationInfoEnumerator.cs
-System.Runtime.Serialization/StreamingContext.cs
-System.Runtime.Serialization/StreamingContextStates.cs
-System.Runtime.Serialization/SurrogateSelector.cs
-System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs
-System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs
-System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs
-System.Runtime.Serialization.Formatters/IFieldInfo.cs
-System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs
-System.Runtime.Serialization.Formatters/InternalElementTypeE.cs
-System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs
-System.Runtime.Serialization.Formatters/InternalMemberValueE.cs
-System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs
-System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs
-System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs
-System.Runtime.Serialization.Formatters/InternalParseStateE.cs
-System.Runtime.Serialization.Formatters/InternalParseTypeE.cs
-System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs
-System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs
-System.Runtime.Serialization.Formatters/ISoapMessage.cs
-System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.cs
-System.Security/CodeAccessPermission.cs
-System.Security/IEvidenceFactory.cs
-System.Security/IPermission.cs
-System.Security/ISecurityEncodable.cs
-System.Security/ISecurityPolicyEncodable.cs
-System.Security/IStackWalk.cs
-System.Security/NamedPermissionSet.cs
-System.Security/PermissionSet.cs
-System.Security/PolicyLevelType.cs
-System.Security/SecurityElement.cs
-System.Security/SecurityException.cs
-System.Security/SecurityManager.cs
-System.Security/SecurityZone.cs
-System.Security/SuppressUnmanagedCodeSecurityAttribute.cs
-System.Security/UnverifiableCodeAttribute.cs
-System.Security/VerificationException.cs
-System.Security/XmlSyntaxException.cs
-System.Security.Cryptography/AsymmetricAlgorithm.cs
-System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs
-System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs
-System.Security.Cryptography/AsymmetricSignatureDeformatter.cs
-System.Security.Cryptography/AsymmetricSignatureFormatter.cs
-System.Security.Cryptography/CipherMode.cs
-System.Security.Cryptography/CryptoAPITransform.cs
-System.Security.Cryptography/CryptographicException.cs
-System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs
-System.Security.Cryptography/CryptoStream.cs
-System.Security.Cryptography/CryptoStreamMode.cs
-System.Security.Cryptography/CspParameters.cs
-System.Security.Cryptography/CspProviderFlags.cs
-System.Security.Cryptography/DeriveBytes.cs
-System.Security.Cryptography/DES.cs
-System.Security.Cryptography/DESCryptoServiceProvider.cs
-System.Security.Cryptography/DSA.cs
-System.Security.Cryptography/DSACryptoServiceProvider.cs
-System.Security.Cryptography/DSAParameters.cs
-System.Security.Cryptography/DSASignatureDeformatter.cs
-System.Security.Cryptography/DSASignatureFormatter.cs
-System.Security.Cryptography/FromBase64Transform.cs
-System.Security.Cryptography/HashAlgorithm.cs
-System.Security.Cryptography/ICryptoTransform.cs
-System.Security.Cryptography/KeySizes.cs
-System.Security.Cryptography/MD5.cs
-System.Security.Cryptography/MD5CryptoServiceProvider.cs
-System.Security.Cryptography/PaddingMode.cs
-System.Security.Cryptography/RandomNumberGenerator.cs
-System.Security.Cryptography/Rijndael.cs
-System.Security.Cryptography/RijndaelManaged.cs
-System.Security.Cryptography/RNGCryptoServiceProvider.cs
-System.Security.Cryptography/RSA.cs
-System.Security.Cryptography/RSAParameters.cs
-System.Security.Cryptography/SHA1.cs
-System.Security.Cryptography/SHA1CryptoServiceProvider.cs
-System.Security.Cryptography/SHA256.cs
-System.Security.Cryptography/SHA256Managed.cs
-System.Security.Cryptography/SHA384.cs
-System.Security.Cryptography/SHA384Managed.cs
-System.Security.Cryptography/SHA512.cs
-System.Security.Cryptography/SHA512Managed.cs
-System.Security.Cryptography/SignatureDescription.cs
-System.Security.Cryptography/SymmetricAlgorithm.cs
-System.Security.Cryptography/ToBase64Transform.cs
-System.Security.Cryptography/X509Certificates.cs
-System.Security.Permissions/CodeAccessSecurityAttribute.cs
-System.Security.Permissions/EnvironmentPermissionAccess.cs
-System.Security.Permissions/EnvironmentPermissionAttribute.cs
-System.Security.Permissions/FileDialogPermissionAccess.cs
-System.Security.Permissions/FileDialogPermissionAttribute.cs
-System.Security.Permissions/FileIOPermission.cs
-System.Security.Permissions/FileIOPermissionAccess.cs
-System.Security.Permissions/FileIOPermissionAttribute.cs
-System.Security.Permissions/IsolatedStorageContainment.cs
-System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs
-System.Security.Permissions/IsolatedStoragePermission.cs
-System.Security.Permissions/IsolatedStoragePermissionAttribute.cs
-System.Security.Permissions/IUnrestrictedPermission.cs
-System.Security.Permissions/PermissionSetAttribute.cs
-System.Security.Permissions/PermissionState.cs
-System.Security.Permissions/PrincipalPermissionAttribute.cs
-System.Security.Permissions/ReflectionPermissionAttribute.cs
-System.Security.Permissions/ReflectionPermissionFlag.cs
-System.Security.Permissions/RegistryPermissionAccess.cs
-System.Security.Permissions/RegistryPermissionAttribute.cs
-System.Security.Permissions/SecurityAction.cs
-System.Security.Permissions/SecurityAttribute.cs
-System.Security.Permissions/SecurityPermission.cs
-System.Security.Permissions/SecurityPermissionFlag.cs
-System.Security.Permissions/SiteIdentityPermissionAttribute.cs
-System.Security.Permissions/StrongNamePermissionAttribute.cs
-System.Security.Permissions/UIPermissionAttribute.cs
-System.Security.Permissions/UIPermissionClipboard.cs
-System.Security.Permissions/UIPermissionWindow.cs
-System.Security.Permissions/UrlIdentityPermissionAttribute.cs
-System.Security.Permissions/ZoneIdentityPermissionAttribute.cs
-System.Security.Policy/AllMembershipCondition.cs
-System.Security.Policy/ApplicationDirectoryMembershipCondition.cs
-System.Security.Policy/CodeGroup.cs
-System.Security.Policy/Evidence.cs
-System.Security.Policy/FileCodeGroup.cs
-System.Security.Policy/IIdentityPermissionFactory.cs
-System.Security.Policy/IMembershipCondition.cs
-System.Security.Policy/PolicyException.cs
-System.Security.Policy/PolicyLevel.cs
-System.Security.Policy/PolicyStatement.cs
-System.Security.Policy/PolicyStatementAttribute.cs
-System.Security.Principal/GenericIdentity.cs
-System.Security.Principal/GenericPrincipal.cs
-System.Security.Principal/IIdentity.cs
-System.Security.Principal/IPrincipal.cs
-System.Security.Principal/PrincipalPolicy.cs
-System.Security.Principal/WindowsAccountType.cs
-System.Security.Principal/WindowsBuiltInRole.cs
-System.Text/ASCIIEncoding.cs
-System.Text/Decoder.cs
-System.Text/Encoder.cs
-System.Text/Encoding.cs
-System.Text/StringBuilder.cs
-System.Text/UnicodeEncoding.cs
-System.Text/UTF7Encoding.cs
-System.Text/UTF8Encoding.cs
-System.Threading/ApartmentState.cs
-System.Threading/AutoResetEvent.cs
-System.Threading/Interlocked.cs
-System.Threading/IOCompletionCallback.cs
-System.Threading/LockCookie.cs
-System.Threading/ManualResetEvent.cs
-System.Threading/Monitor.cs
-System.Threading/Mutex.cs
-System.Threading/NativeEventCalls.cs
-System.Threading/NativeOverlapped.cs
-System.Threading/Overlapped.cs
-System.Threading/ReaderWriterLock.cs
-System.Threading/RegisteredWaitHandle.cs
-System.Threading/SynchronizationLockException.cs
-System.Threading/Thread.cs
-System.Threading/ThreadAbortException.cs
-System.Threading/ThreadInterruptedException.cs
-System.Threading/ThreadPool.cs
-System.Threading/ThreadPriority.cs
-System.Threading/ThreadStart.cs
-System.Threading/ThreadState.cs
-System.Threading/ThreadStateException.cs
-System.Threading/Timeout.cs
-System.Threading/Timer.cs
-System.Threading/TimerCallback.cs
-System.Threading/WaitCallback.cs
-System.Threading/WaitHandle.cs
-System.Threading/WaitOrTimerCallback.cs
diff --git a/mcs/class/library.build b/mcs/class/library.build
deleted file mode 100644
index cc3d05dcf85..00000000000
--- a/mcs/class/library.build
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for class libraries -->
-<!-- Target windows builds libraries _for_ windows -->
-<!-- Target linux builds libraries _for_ linux -->
-
-<project name="corlib" default="build">
- <property name="debug" value="false"/>
-
- <target name="build">
- <nant basedir="corlib" target="build"/>
- <nant basedir="System" target="build"/>
- <nant basedir="System.Drawing" target="build"/>
- <nant basedir="System.XML" target="build"/>
- <nant basedir="System.Data" target="build"/>
- <nant basedir="System.Web" target="build"/>
- <nant basedir="Microsoft.VisualBasic" target="build"/>
- </target>
-
- <target name="test">
- <nant basedir="corlib" target="test"/>
- <nant basedir="System" target="test"/>
- <nant basedir="System.XML" target="test"/>
- <nant basedir="System.Data" target="test"/>
- <nant basedir="Microsoft.VisualBasic" target="test"/>
- </target>
-
- <target name="clean">
- <delete failonerror="false">
- <fileset basedir="lib">
- <includes name="*.dll"/>
- </fileset>
- </delete>
- <nant basedir="corlib" target="clean"/>
- <nant basedir="System" target="clean"/>
- <nant basedir="System.Drawing" target="clean"/>
- <nant basedir="System.XML" target="clean"/>
- <nant basedir="System.Data" target="clean"/>
- <nant basedir="Microsoft.VisualBasic" target="clean"/>
- </target>
-</project>
diff --git a/mcs/class/makefile b/mcs/class/makefile
deleted file mode 100644
index 35e5bb0b0a4..00000000000
--- a/mcs/class/makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-all: linux
-
-linux:
- ../nant/NAnt.exe
-
-push:
- scp lib/*.dll mono-cvs:libs
-
-test:
- ../nant/NAnt.exe test
-
-clean:
- ../nant/NAnt.exe clean
diff --git a/mcs/class/notes/BitVecto32.txt b/mcs/class/notes/BitVecto32.txt
deleted file mode 100644
index fad747dfe76..00000000000
--- a/mcs/class/notes/BitVecto32.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-* Why does CreateSection take a short for the range number?
-
- It would seem like it should be possible to have numbers between 0
- and UInt32.MaxValue in there. Why is the API limiting things to 16
- bits?
-
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/CodeGenerator.xml b/mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/CodeGenerator.xml
deleted file mode 100644
index 2c8646250ba..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/CodeGenerator.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.Compiler.CodeGenerator" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="isCurrentClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="isCurrentDelegate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="isCurrentEnum">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="isCurrentInterface">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="isCurrentStruct">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="CurrentClassName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentMember">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentMemberName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Indent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCurrentClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCurrentDelegate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCurrentEnum">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCurrentInterface">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCurrentStruct">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Output">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ValidateIdentifier(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsValidIdentifier(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GenerateCodeFromStatement(System.IO.TextWriter, System.CodeDom.CodeStatement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="output">TODO</param>
- <param name="expression">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GenerateCodeFromNamespace(System.IO.TextWriter, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="output">TODO</param>
- <param name="expression">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GenerateCodeFromExpression(System.IO.TextWriter, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="output">TODO</param>
- <param name="expression">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsValidLanguateIndependentIdentifier(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/ICodeGenerator.xml b/mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/ICodeGenerator.xml
deleted file mode 100644
index 462a3d7624f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom.Compiler/ICodeGenerator.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.CodeDom.Compiler.ICodeGenerator" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeArrayCreateExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeArrayCreateExpression.xml
deleted file mode 100644
index b8e8b9878e0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeArrayCreateExpression.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeArrayCreateExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeArrayCreateExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeArrayCreateExpression(System.String, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="createType">TODO</param>
- <param name="size">TODO</param>
- </constructor>
- <constructor name="CodeArrayCreateExpression(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="createType">TODO</param>
- <param name="size">TODO</param>
- </constructor>
- <constructor name="CodeArrayCreateExpression(System.String, System.CodeDom.CodeExpression[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="createType">TODO</param>
- <param name="initializers">TODO</param>
- </constructor>
- <property name="SizeExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Initializers">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CreateType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAssignStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAssignStatement.xml
deleted file mode 100644
index 262a7392730..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAssignStatement.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeAssignStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAssignStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeAssignStatement(System.CodeDom.CodeExpression, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="left">TODO</param>
- <param name="right">TODO</param>
- </constructor>
- <property name="Left">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Right">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttachEventStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttachEventStatement.xml
deleted file mode 100644
index d1266e6fc4f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttachEventStatement.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeAttachEventStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAttachEventStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeAttachEventStatement(System.CodeDom.CodeExpression, System.String, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="eventName">TODO</param>
- <param name="newListener">TODO</param>
- </constructor>
- <property name="EventName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NewListener">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgument.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgument.xml
deleted file mode 100644
index 0bae2c15f09..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgument.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeAttributeArgument" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAttributeArgument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeAttributeArgument(System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="CodeAttributeArgument(System.String, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="val">TODO</param>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgumentCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgumentCollection.xml
deleted file mode 100644
index fb1a8ea598d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeArgumentCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeAttributeArgumentCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAttributeArgumentCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeAttributeArgument)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeAttributeArgument[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeBlock.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeBlock.xml
deleted file mode 100644
index a5be704038c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeBlock.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeAttributeBlock" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAttributeBlock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeAttributeBlock(System.CodeDom.CodeAttributeDeclaration[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributes">TODO</param>
- </constructor>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclaration.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclaration.xml
deleted file mode 100644
index be68281d8c6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclaration.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeAttributeDeclaration" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAttributeDeclaration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeAttributeDeclaration(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <constructor name="CodeAttributeDeclaration(System.String, System.CodeDom.CodeAttributeArgument[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="arguments">TODO</param>
- </constructor>
- <property name="Arguments">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclarationCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclarationCollection.xml
deleted file mode 100644
index 81d85a06dda..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeAttributeDeclarationCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeAttributeDeclarationCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAttributeDeclarationCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeAttributeDeclaration)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeAttributeDeclaration[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBaseReferenceExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBaseReferenceExpression.xml
deleted file mode 100644
index 53d58e722d3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBaseReferenceExpression.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeBaseReferenceExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeBaseReferenceExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorExpression.xml
deleted file mode 100644
index 3384b74114f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorExpression.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeBinaryOperatorExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeBinaryOperatorType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeBinaryOperatorType(System.CodeDom.CodeExpression, System.CodeDom.CodeBinaryOperatorExpression.CodeBinaryOperatorType, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="left">TODO</param>
- <param name="oper">TODO</param>
- <param name="right">TODO</param>
- </constructor>
- <property name="Left">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Right">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Operator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorType.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorType.xml
deleted file mode 100644
index 3fd58201cfa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeBinaryOperatorType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.CodeDom.CodeBinaryOperatorType" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCastExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCastExpression.xml
deleted file mode 100644
index 381b67c4524..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCastExpression.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeCastExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeCastExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeCastExpression(System.String, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetType">TODO</param>
- <param name="expression">TODO</param>
- </constructor>
- <property name="Expression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClause.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClause.xml
deleted file mode 100644
index 132696ca756..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClause.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeCatchClause" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeCatchClause">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeCatchClause(System.CodeDom.CodeParameterDeclarationExpression, System.CodeDom.CodeStatement[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="statements">TODO</param>
- </constructor>
- <property name="Statements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Condition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClauseCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClauseCollection.xml
deleted file mode 100644
index 079b59bd95b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCatchClauseCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeCatchClauseCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeCatchClauseCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeCatchClause)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeCatchClause[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClass.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClass.xml
deleted file mode 100644
index 482bec6431e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClass.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeClass" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeClass(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsEnum">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsInterface">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsStruct">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Members">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassCollection.xml
deleted file mode 100644
index d25d3381423..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeClassCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeClassCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeClass)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeClass[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassConstructor.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassConstructor.xml
deleted file mode 100644
index 27653767f21..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassConstructor.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeClassConstructor" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeClassConstructor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassDelegate.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassDelegate.xml
deleted file mode 100644
index a7e89a7e86d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassDelegate.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeClassDelegate" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeClassDelegate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeClassDelegate(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMember.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMember.xml
deleted file mode 100644
index a98be1bef8c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMember.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeClassMember" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MemberAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CustomAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMemberCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMemberCollection.xml
deleted file mode 100644
index 08a240e200b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeClassMemberCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeClassMemberCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeClassMemberCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeClassMember)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeClassMember[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCommentStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCommentStatement.xml
deleted file mode 100644
index c42ebe9f451..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeCommentStatement.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeCommentStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeCommentStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeCommentStatement(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- </constructor>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeConstructor.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeConstructor.xml
deleted file mode 100644
index 940d88a4c68..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeConstructor.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeConstructor" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeConstructor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseConstructorArgs">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ChainedConstructorArgs">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateCreateExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateCreateExpression.xml
deleted file mode 100644
index ce19eec4cd4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateCreateExpression.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeDelegateCreateExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeDelegateCreateExpression(System.String, System.CodeDom.CodeExpression, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="delegateType">TODO</param>
- <param name="targetObject">TODO</param>
- <param name="methodName">TODO</param>
- </constructor>
- <constructor name="CodeDelegateCreateExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="DelegateType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MethodName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeExpression.xml
deleted file mode 100644
index 932732ada24..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeExpression.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeDelegateInvokeExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeDelegateInvokeExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeDelegateInvokeExpression(System.CodeDom.CodeExpression, System.CodeDom.CodeExpression[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="parameters">TODO</param>
- </constructor>
- <constructor name="CodeDelegateInvokeExpression(System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- </constructor>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeStatement.xml
deleted file mode 100644
index 05c9e77b862..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDelegateInvokeStatement.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeDelegateInvokeStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeDelegateInvokeStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeDelegateInvokeStatement(System.CodeDom.CodeStatement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- </constructor>
- <constructor name="CodeDelegateInvokeStatement(System.CodeDom.CodeDelegateInvokeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="delegateInvoke">TODO</param>
- </constructor>
- <constructor name="CodeDelegateInvokeStatement(System.CodeDom.CodeStatement, System.CodeDom.CodeStatement[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="parameters">TODO</param>
- </constructor>
- <property name="DelegateInvoke">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDetachEventStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDetachEventStatement.xml
deleted file mode 100644
index 1aafb197b69..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeDetachEventStatement.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeDetachEventStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeDetachEventStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeDetachEventStatement(System.CodeDom.CodeExpression, System.String, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="eventName">TODO</param>
- <param name="newListener">TODO</param>
- </constructor>
- <property name="EventName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NewListener">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpression.xml
deleted file mode 100644
index 524b3c32db9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpression.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="UserData">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpressionCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpressionCollection.xml
deleted file mode 100644
index 9e539c2d417..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeExpressionCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeExpressionCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeExpressionCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeExpression[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeFieldReferenceExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeFieldReferenceExpression.xml
deleted file mode 100644
index 82dd3f04fb4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeFieldReferenceExpression.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeFieldReferenceExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FieldDirection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="FieldDirection(System.CodeDom.CodeExpression, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="fieldName">TODO</param>
- </constructor>
- <property name="Direction">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FieldName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeForLoopStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeForLoopStatement.xml
deleted file mode 100644
index 86993c7c619..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeForLoopStatement.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeForLoopStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeForLoopStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeForLoopStatement(System.CodeDom.CodeStatement, System.CodeDom.CodeExpression, System.CodeDom.CodeStatement, System.CodeDom.CodeStatement[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initStatement">TODO</param>
- <param name="testExpression">TODO</param>
- <param name="incrementStatement">TODO</param>
- <param name="statements">TODO</param>
- </constructor>
- <property name="InitStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IncrementStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Statements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TestExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeIfStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeIfStatement.xml
deleted file mode 100644
index 629b29d2b62..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeIfStatement.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeIfStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeIfStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeIfStatement(System.CodeDom.CodeExpression, System.CodeDom.CodeStatement[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="trueStatements">TODO</param>
- </constructor>
- <constructor name="CodeIfStatement(System.CodeDom.CodeExpression, System.CodeDom.CodeStatement[], System.CodeDom.CodeStatement[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="trueStatements">TODO</param>
- <param name="falseStatements">TODO</param>
- </constructor>
- <property name="Condition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FalseStatements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TrueStatements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeIndexerExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeIndexerExpression.xml
deleted file mode 100644
index 549f7400d38..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeIndexerExpression.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeIndexerExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeIndexerExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeIndexerExpression(System.CodeDom.CodeExpression, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="index">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLinePragma.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLinePragma.xml
deleted file mode 100644
index 3c55370827b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLinePragma.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeLinePragma" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeLinePragma(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- <param name="lineNumber">TODO</param>
- </constructor>
- <property name="FileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LineNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralClassMember.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralClassMember.xml
deleted file mode 100644
index 2f3cee8fd07..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralClassMember.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeLiteralClassMember" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeLiteralClassMember">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeLiteralClassMember(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- </constructor>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralExpression.xml
deleted file mode 100644
index ef4396e998f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralExpression.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeLiteralExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeLiteralExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeLiteralExpression(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralNamespace.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralNamespace.xml
deleted file mode 100644
index e7281bd205a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralNamespace.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeLiteralNamespace" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeLiteralNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LinePragma">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralStatement.xml
deleted file mode 100644
index e4f0e56a91b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeLiteralStatement.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeLiteralStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeLiteralStatement(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberEvent.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberEvent.xml
deleted file mode 100644
index 3c4e9b3f5be..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberEvent.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeMemberEvent" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeMemberEvent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ImplementsType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivateImplements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberField.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberField.xml
deleted file mode 100644
index a0959219825..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberField.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeMemberField" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeMemberField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeMemberField(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="name">TODO</param>
- </constructor>
- <property name="InitExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberMethod.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberMethod.xml
deleted file mode 100644
index e75321039b8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberMethod.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeMemberMethod" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeMemberMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ImplementsType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivateImplements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Statements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberProperty.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberProperty.xml
deleted file mode 100644
index 424571ce0ca..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMemberProperty.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeMemberProperty" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeMemberProperty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ImplementsType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivateImplements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SetStatements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GetStatements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasGet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeExpression.xml
deleted file mode 100644
index eaec26ed0ac..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeExpression.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeMethodInvokeExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeMethodInvokeExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeMethodInvokeExpression(System.CodeDom.CodeExpression, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="methodName">TODO</param>
- </constructor>
- <constructor name="CodeMethodInvokeExpression(System.CodeDom.CodeExpression, System.String, System.CodeDom.CodeExpression[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="methodName">TODO</param>
- <param name="parameters">TODO</param>
- </constructor>
- <property name="MethodName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeStatement.xml
deleted file mode 100644
index 23d691ef7a6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodInvokeStatement.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeMethodInvokeStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeMethodInvokeStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeMethodInvokeStatement(System.CodeDom.CodeMethodInvokeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="methodInvoke">TODO</param>
- </constructor>
- <constructor name="CodeMethodInvokeStatement(System.CodeDom.CodeExpression, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="methodName">TODO</param>
- </constructor>
- <constructor name="CodeMethodInvokeStatement(System.CodeDom.CodeExpression, System.String, System.CodeDom.CodeExpression[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="methodName">TODO</param>
- <param name="parameters">TODO</param>
- </constructor>
- <property name="MethodName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MethodInvoke">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodReturnStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodReturnStatement.xml
deleted file mode 100644
index 640bf702d64..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeMethodReturnStatement.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeMethodReturnStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeMethodReturnStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespace.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespace.xml
deleted file mode 100644
index ceb7d8a7064..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespace.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeNamespace" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeNamespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="AllowLateBound">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Classes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Imports">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RequireVariableDeclaration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserData">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImport.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImport.xml
deleted file mode 100644
index 273bbf57612..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImport.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeNamespaceImport" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeNamespaceImport">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeNamespaceImport(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nameSpace">TODO</param>
- </constructor>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImportCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImportCollection.xml
deleted file mode 100644
index 7b5d18880fa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeNamespaceImportCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeNamespaceImportCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeNamespaceImportCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeNamespaceImport)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeNamespaceImport[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeObject.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeObject.xml
deleted file mode 100644
index 5ddcb0761d1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeObject.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeObject" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeObjectCreateExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeObjectCreateExpression.xml
deleted file mode 100644
index a02b887ca4c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeObjectCreateExpression.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeObjectCreateExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeObjectCreateExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeObjectCreateExpression(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="createType">TODO</param>
- </constructor>
- <constructor name="CodeObjectCreateExpression(System.String, System.CodeDom.CodeExpression[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="createType">TODO</param>
- <param name="parameters">TODO</param>
- </constructor>
- <property name="CreateType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpression.xml
deleted file mode 100644
index 3fe1477c25f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpression.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeParameterDeclarationExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeParameterDeclarationExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeParameterDeclarationExpression(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="name">TODO</param>
- </constructor>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CustomAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Direction">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml
deleted file mode 100644
index 6031ed5aae4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeParameterDeclarationExpressionCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeParameterDeclarationExpressionCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeParameterDeclarationExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeParameterDeclarationExpression[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodePrimitiveExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodePrimitiveExpression.xml
deleted file mode 100644
index 14093e2ea80..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodePrimitiveExpression.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodePrimitiveExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodePrimitiveExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodePrimitiveExpression(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodePropertyReferenceExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodePropertyReferenceExpression.xml
deleted file mode 100644
index 223cf538fc6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodePropertyReferenceExpression.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodePropertyReferenceExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodePropertyReferenceExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodePropertyReferenceExpression(System.CodeDom.CodeExpression, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetObject">TODO</param>
- <param name="propertyName">TODO</param>
- </constructor>
- <property name="Parameter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PropertyName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatement.xml
deleted file mode 100644
index defd73cc6ce..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatement.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatementCollection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatementCollection.xml
deleted file mode 100644
index ace507bd91b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeStatementCollection.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeStatementCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeStatementCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.CodeDom.CodeStatement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.CodeDom.CodeStatement[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeThisReferenceExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeThisReferenceExpression.xml
deleted file mode 100644
index a74de0cd721..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeThisReferenceExpression.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeThisReferenceExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeThisReferenceExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeThrowExceptionStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeThrowExceptionStatement.xml
deleted file mode 100644
index e3d1f2b8e7c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeThrowExceptionStatement.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeThrowExceptionStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeThrowExceptionStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeThrowExceptionStatement(System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="toThrow">TODO</param>
- </constructor>
- <property name="ToThrow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTryCatchFinallyStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTryCatchFinallyStatement.xml
deleted file mode 100644
index 95a52fafa35..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTryCatchFinallyStatement.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeTryCatchFinallyStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeTryCatchFinallyStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeTryCatchFinallyStatement(System.CodeDom.CodeStatement[], System.CodeDom.CodeCatchClause[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tryStatements">TODO</param>
- <param name="catchClauses">TODO</param>
- </constructor>
- <constructor name="CodeTryCatchFinallyStatement(System.CodeDom.CodeStatement[], System.CodeDom.CodeCatchClause[], System.CodeDom.CodeStatement[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tryStatements">TODO</param>
- <param name="catchClauses">TODO</param>
- <param name="finallyStatements">TODO</param>
- </constructor>
- <property name="FinallyStatements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TryStatements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CatchClauses">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeDeclaration.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeDeclaration.xml
deleted file mode 100644
index 45b5bdc6f92..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeDeclaration.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeTypeDeclaration" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeTypeDeclaration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeMember.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeMember.xml
deleted file mode 100644
index 72f38c7e168..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeMember.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeTypeMember" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeTypeMember">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeOfExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeOfExpression.xml
deleted file mode 100644
index f6f925a645e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeOfExpression.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeTypeOfExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeTypeOfExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeTypeOfExpression(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- </constructor>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeReferenceExpression.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeReferenceExpression.xml
deleted file mode 100644
index a03beb96551..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeTypeReferenceExpression.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeTypeReferenceExpression" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeTypeReferenceExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeTypeReferenceExpression(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- </constructor>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeVariableDeclarationStatement.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/CodeVariableDeclarationStatement.xml
deleted file mode 100644
index bd9ff46e94f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/CodeVariableDeclarationStatement.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CodeDom.CodeVariableDeclarationStatement" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeVariableDeclarationStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CodeVariableDeclarationStatement(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="name">TODO</param>
- </constructor>
- <constructor name="CodeVariableDeclarationStatement(System.String, System.String, System.CodeDom.CodeExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="name">TODO</param>
- <param name="initExpression">TODO</param>
- </constructor>
- <property name="InitExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/FieldDirection.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/FieldDirection.xml
deleted file mode 100644
index 87bac0fb1da..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/FieldDirection.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.CodeDom.FieldDirection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.CodeDom/MemberAttributes.xml b/mcs/docs/apidocs/xml/en/System.CodeDom/MemberAttributes.xml
deleted file mode 100644
index 6fb7fe86f6a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.CodeDom/MemberAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.CodeDom.MemberAttributes" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/BitVector32.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/BitVector32.xml
deleted file mode 100644
index 5fb7ba0b3fe..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/BitVector32.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Collections.Specialized.BitVector32" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Section(System.Collections.Specialized.BitVector32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="source">TODO</param>
- </constructor>
- <constructor name="Section(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="init">TODO</param>
- </constructor>
- <property name="Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateSection(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="maxval">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateMask">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateMask(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prev">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/KeysCollection.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/KeysCollection.xml
deleted file mode 100644
index 4af9734b852..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/KeysCollection.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Specialized.NameObjectCollectionBase+KeysCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="arr">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Get(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/ListDictionary.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/ListDictionary.xml
deleted file mode 100644
index 46cfa7e744d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/ListDictionary.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Specialized.ListDictionary" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ListDictionary">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ListDictionary(System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="comparer">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Keys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Values">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameObjectCollectionBase.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameObjectCollectionBase.xml
deleted file mode 100644
index 11dc715d6ef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameObjectCollectionBase.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Specialized.NameObjectCollectionBase" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Comparer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HashCodeProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Keys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="OnDeserialization(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sender">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="arr">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameValueCollection.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameValueCollection.xml
deleted file mode 100644
index bd371f4af57..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/NameValueCollection.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Specialized.NameValueCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NameValueCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="NameValueCollection(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- </constructor>
- <constructor name="NameValueCollection(System.Collections.Specialized.NameValueCollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="col">TODO</param>
- </constructor>
- <constructor name="NameValueCollection(System.Collections.IHashCodeProvider, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hashProvider">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <constructor name="NameValueCollection(System.Int32, System.Collections.IHashCodeProvider, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- <param name="hashProvider">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <property name="AllKeys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Set(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValues(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValues(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetKey(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Get(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Get(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dest">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Collections.Specialized.NameValueCollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="HasKeys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/Section.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/Section.xml
deleted file mode 100644
index a839c3ac72d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/Section.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Collections.Specialized.BitVector32+Section" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="maxval">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringCollection.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringCollection.xml
deleted file mode 100644
index e3cc77d5eb6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringCollection.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Specialized.StringCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StringCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.String[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringDictionary.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringDictionary.xml
deleted file mode 100644
index 5d9cca465ea..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringDictionary.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Specialized.StringDictionary" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StringDictionary">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Keys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Values">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ContainsValue(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ContainsKey(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringEnumerator.xml b/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringEnumerator.xml
deleted file mode 100644
index cc708fbe37b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections.Specialized/StringEnumerator.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Specialized.StringEnumerator" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Current">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="MoveNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/ArrayList.xml b/mcs/docs/apidocs/xml/en/System.Collections/ArrayList.xml
deleted file mode 100644
index 70c4b7872d0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/ArrayList.xml
+++ /dev/null
@@ -1,326 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.ArrayList" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ArrayList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ArrayList(System.Collections.ICollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- </constructor>
- <constructor name="ArrayList(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- </constructor>
- <property name="Capacity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="arrayIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TrimToSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToArray(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Int32, System.Int32, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetRange(System.Int32, System.Collections.ICollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Reverse(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Reverse">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="RemoveRange(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Object, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="StartIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InsertRange(System.Int32, System.Collections.ICollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetRange(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Int32, System.Array, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="array">TODO</param>
- <param name="arrayIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BinarySearch(System.Int32, System.Int32, System.Object, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <param name="value">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BinarySearch(System.Object, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BinarySearch(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.Collections.ICollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadOnly(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadOnly(System.Collections.IList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Synchronized(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Synchronized(System.Collections.IList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FixedSize(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FixedSize(System.Collections.IList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Repeat(System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Adapter(System.Collections.IList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/BitArray.xml b/mcs/docs/apidocs/xml/en/System.Collections/BitArray.xml
deleted file mode 100644
index b89d3c6b434..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/BitArray.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.BitArray" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BitArray(System.Collections.BitArray)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="orig">TODO</param>
- </constructor>
- <constructor name="BitArray(System.Boolean[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bits">TODO</param>
- </constructor>
- <constructor name="BitArray(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- </constructor>
- <constructor name="BitArray(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- </constructor>
- <constructor name="BitArray(System.Int32[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="words">TODO</param>
- </constructor>
- <constructor name="BitArray(System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- <param name="value">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="And(System.Collections.BitArray)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="operand">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Get(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Not">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Or(System.Collections.BitArray)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="operand">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Set(System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetAll(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Xor(System.Collections.BitArray)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="operand">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveComparer.xml b/mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveComparer.xml
deleted file mode 100644
index a9b0f801b65..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveComparer.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.CaseInsensitiveComparer" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CaseInsensitiveComparer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Compare(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveHashCodeProvider.xml b/mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveHashCodeProvider.xml
deleted file mode 100644
index befb667b8ee..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/CaseInsensitiveHashCodeProvider.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.CaseInsensitiveHashCodeProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CaseInsensitiveHashCodeProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/CollectionBase.xml b/mcs/docs/apidocs/xml/en/System.Collections/CollectionBase.xml
deleted file mode 100644
index b751f54a4c9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/CollectionBase.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.CollectionBase" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="List">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/Comparer.xml b/mcs/docs/apidocs/xml/en/System.Collections/Comparer.xml
deleted file mode 100644
index 31b591364dd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/Comparer.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Comparer" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="Compare(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/DictionaryBase.xml b/mcs/docs/apidocs/xml/en/System.Collections/DictionaryBase.xml
deleted file mode 100644
index 173c93d2e0e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/DictionaryBase.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.DictionaryBase" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Dictionary">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerHashtable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/DictionaryEntry.xml b/mcs/docs/apidocs/xml/en/System.Collections/DictionaryEntry.xml
deleted file mode 100644
index 8dba7909ce7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/DictionaryEntry.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Collections.DictionaryEntry" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DictionaryEntry(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="k">TODO</param>
- <param name="value">TODO</param>
- </constructor>
- <property name="Key">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/EnumeratorMode.xml b/mcs/docs/apidocs/xml/en/System.Collections/EnumeratorMode.xml
deleted file mode 100644
index 8515eb3742f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/EnumeratorMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Collections.SortedList+EnumeratorMode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/Hashtable.xml b/mcs/docs/apidocs/xml/en/System.Collections/Hashtable.xml
deleted file mode 100644
index 03b8ccd913d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/Hashtable.xml
+++ /dev/null
@@ -1,192 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Hashtable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EnumeratorMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="EnumeratorMode(System.Int32, System.Single, System.Collections.IHashCodeProvider, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- <param name="loadFactor">TODO</param>
- <param name="hcp">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Int32, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- <param name="loadFactor">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Int32, System.Collections.IHashCodeProvider, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- <param name="hcp">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IDictionary, System.Single, System.Collections.IHashCodeProvider, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="loadFactor">TODO</param>
- <param name="hcp">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IDictionary, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="loadFactor">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IDictionary)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IDictionary, System.Collections.IHashCodeProvider, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="hcp">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IHashCodeProvider, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hcp">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <property name="comparer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="hcp">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Keys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Values">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="OnDeserialization(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sender">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="arrayIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ContainsValue(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ContainsKey(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Synchronized(System.Collections.Hashtable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="table">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/ICollection.xml b/mcs/docs/apidocs/xml/en/System.Collections/ICollection.xml
deleted file mode 100644
index 2d0140d7f18..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/ICollection.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.ICollection" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/IComparer.xml b/mcs/docs/apidocs/xml/en/System.Collections/IComparer.xml
deleted file mode 100644
index 80fe52dbe49..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/IComparer.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.IComparer" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/IDictionary.xml b/mcs/docs/apidocs/xml/en/System.Collections/IDictionary.xml
deleted file mode 100644
index 6ac8a6bf6ef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/IDictionary.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.IDictionary" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/IDictionaryEnumerator.xml b/mcs/docs/apidocs/xml/en/System.Collections/IDictionaryEnumerator.xml
deleted file mode 100644
index 92c12957f48..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/IDictionaryEnumerator.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.IDictionaryEnumerator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/IEnumerable.xml b/mcs/docs/apidocs/xml/en/System.Collections/IEnumerable.xml
deleted file mode 100644
index 5a2e568d0ed..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/IEnumerable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.IEnumerable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/IEnumerator.xml b/mcs/docs/apidocs/xml/en/System.Collections/IEnumerator.xml
deleted file mode 100644
index 1b21234fc49..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/IEnumerator.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.IEnumerator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/IHashCodeProvider.xml b/mcs/docs/apidocs/xml/en/System.Collections/IHashCodeProvider.xml
deleted file mode 100644
index 333254394f0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/IHashCodeProvider.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.IHashCodeProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/IList.xml b/mcs/docs/apidocs/xml/en/System.Collections/IList.xml
deleted file mode 100644
index 1688ccb2848..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/IList.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Collections.IList" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/Queue.xml b/mcs/docs/apidocs/xml/en/System.Collections/Queue.xml
deleted file mode 100644
index bd61d3aff3e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/Queue.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Queue" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Queue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Queue(System.Collections.ICollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="collection">TODO</param>
- </constructor>
- <constructor name="Queue(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initialCapacity">TODO</param>
- </constructor>
- <constructor name="Queue(System.Int32, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initialCapacity">TODO</param>
- <param name="growFactor">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Peek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Enqueue(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Dequeue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Synchronized(System.Collections.Queue)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="queue">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/ReadOnlyCollectionBase.xml b/mcs/docs/apidocs/xml/en/System.Collections/ReadOnlyCollectionBase.xml
deleted file mode 100644
index fe75e6e9964..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/ReadOnlyCollectionBase.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.ReadOnlyCollectionBase" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/SortedList.xml b/mcs/docs/apidocs/xml/en/System.Collections/SortedList.xml
deleted file mode 100644
index e9e3f80c1d1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/SortedList.xml
+++ /dev/null
@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.SortedList" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EnumeratorMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="EnumeratorMode(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initialCapacity">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IComparer, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="comparer">TODO</param>
- <param name="initialCapacity">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="comparer">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IDictionary)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- </constructor>
- <constructor name="EnumeratorMode(System.Collections.IDictionary, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="comparer">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Keys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Values">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Capacity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="arrayIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TrimToSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetKey(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetByIndex(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByIndex(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ContainsValue(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ContainsKey(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOfValue(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOfKey(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValueList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetKeyList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Synchronized(System.Collections.SortedList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="list">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Collections/Stack.xml b/mcs/docs/apidocs/xml/en/System.Collections/Stack.xml
deleted file mode 100644
index e45abc3472e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Collections/Stack.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Collections.Stack" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Stack">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Stack(System.Collections.ICollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="collection">TODO</param>
- </constructor>
- <constructor name="Stack(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Push(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Pop">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Peek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Synchronized(System.Collections.Stack)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/BrowsableAttribute.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/BrowsableAttribute.xml
deleted file mode 100644
index 39f3d383dc7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/BrowsableAttribute.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.BrowsableAttribute" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BrowsableAttribute(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="browsable">TODO</param>
- </constructor>
- <field name="No">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Yes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Browsable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/CategoryAttribute.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/CategoryAttribute.xml
deleted file mode 100644
index e2e2fb20da1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/CategoryAttribute.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.CategoryAttribute" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CategoryAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="category">TODO</param>
- </constructor>
- <constructor name="CategoryAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Category">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Action">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Appearance">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Behaviour">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Design">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DragDrop">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Focus">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Format">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Key">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Layout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Mouse">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WindowStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/Component.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/Component.xml
deleted file mode 100644
index 134113aecac..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/Component.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.Component" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Component">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Container">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DesignMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Events">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Site">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <event name="Disposed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/ComponentCollection.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/ComponentCollection.xml
deleted file mode 100644
index 0ba0c3930a9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/ComponentCollection.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.ComponentCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ComponentCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/Container.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/Container.xml
deleted file mode 100644
index 962bed57f6e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/Container.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.Container" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Container">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Components">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.ComponentModel.IComponent)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="component">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.ComponentModel.IComponent, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="component">TODO</param>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.ComponentModel.IComponent)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="component">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/DescriptionAttribute.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/DescriptionAttribute.xml
deleted file mode 100644
index e459b406927..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/DescriptionAttribute.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.DescriptionAttribute" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DescriptionAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <constructor name="DescriptionAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Description">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DescriptionValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignOnlyAttribute.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignOnlyAttribute.xml
deleted file mode 100644
index 426cc021f6e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignOnlyAttribute.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.DesignOnlyAttribute" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DesignOnlyAttribute(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="design_only">TODO</param>
- </constructor>
- <field name="No">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Yes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="IsDesignOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibility.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibility.xml
deleted file mode 100644
index 80e8b5a3631..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibility.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.ComponentModel.DesignerSerializationVisibility" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml
deleted file mode 100644
index 6d47e78f9d7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.DesignerSerializationVisibilityAttribute" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="vis">TODO</param>
- </constructor>
- <field name="Content">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Hidden">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Visible">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Visibility">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/EventHandlerList.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/EventHandlerList.xml
deleted file mode 100644
index 0f0e46f70ed..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/EventHandlerList.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.EventHandlerList" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EventHandlerList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddHandler(System.Object, System.Delegate)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveHandler(System.Object, System.Delegate)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/IComponent.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/IComponent.xml
deleted file mode 100644
index 3b1b0c84faa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/IComponent.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.ComponentModel.IComponent" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/IContainer.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/IContainer.xml
deleted file mode 100644
index c41ef2cce1a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/IContainer.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.ComponentModel.IContainer" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/ISite.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/ISite.xml
deleted file mode 100644
index 56352c9374a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/ISite.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.ComponentModel.ISite" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/LocalizableAttribute.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/LocalizableAttribute.xml
deleted file mode 100644
index e387b6a0981..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/LocalizableAttribute.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.LocalizableAttribute" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LocalizableAttribute(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localizable">TODO</param>
- </constructor>
- <field name="No">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Yes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="IsLocalizable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/MemberDescriptor.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/MemberDescriptor.xml
deleted file mode 100644
index 98e3d772c2b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/MemberDescriptor.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.MemberDescriptor" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="AttributeArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Category">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Description">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DesignTimeOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DisplayName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsBrowsable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/PropertyDescriptor.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/PropertyDescriptor.xml
deleted file mode 100644
index d7c40c5910b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/PropertyDescriptor.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.PropertyDescriptor" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="ComponentType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Converter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsLocalizable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PropertyType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SerializationVisibility">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="AddValueChanged(System.Object, System.EventHandler)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="component">TODO</param>
- <param name="handler">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/TypeConverter.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/TypeConverter.xml
deleted file mode 100644
index 9b5c8a93e4d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/TypeConverter.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.TypeConverter" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TypeConverter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.ComponentModel/Win32Exception.xml b/mcs/docs/apidocs/xml/en/System.ComponentModel/Win32Exception.xml
deleted file mode 100644
index 3f32bfa828e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.ComponentModel/Win32Exception.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ComponentModel.Win32Exception" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Win32Exception">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Win32Exception(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="error">TODO</param>
- </constructor>
- <constructor name="Win32Exception(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="error">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- <property name="NativeErrorCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHash.xml b/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHash.xml
deleted file mode 100644
index 233449aaf6b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHash.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Configuration.Assemblies.AssemblyHash" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyHash(System.Configuration.Assemblies.AssemblyHashAlgorithm, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="algorithm">TODO</param>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="AssemblyHash(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Algorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHashAlgorithm.xml b/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHashAlgorithm.xml
deleted file mode 100644
index 8cdf7a2e1a3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyHashAlgorithm.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Configuration.Assemblies.AssemblyHashAlgorithm" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyVersionCompatibility.xml b/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyVersionCompatibility.xml
deleted file mode 100644
index cb17e7340de..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/AssemblyVersionCompatibility.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Configuration.Assemblies.AssemblyVersionCompatibility" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/ProcessorID.xml b/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/ProcessorID.xml
deleted file mode 100644
index 95829b3800a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration.Assemblies/ProcessorID.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Configuration.Assemblies.ProcessorID" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationException.xml b/mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationException.xml
deleted file mode 100644
index b2bba67364f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationException.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Configuration.ConfigurationException" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ConfigurationException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ConfigurationException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ConfigurationException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="ConfigurationException(System.String, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="node">TODO</param>
- </constructor>
- <constructor name="ConfigurationException(System.String, System.Exception, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- <param name="node">TODO</param>
- </constructor>
- <constructor name="ConfigurationException(System.String, System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="filename">TODO</param>
- <param name="line">TODO</param>
- </constructor>
- <constructor name="ConfigurationException(System.String, System.Exception, System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- <param name="filename">TODO</param>
- <param name="line">TODO</param>
- </constructor>
- <property name="BareMessage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Filename">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Line">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetXmlNodeFilename(System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetXmlNodeLineNumber(System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationSettings.xml b/mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationSettings.xml
deleted file mode 100644
index d65c097ebe6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration/ConfigurationSettings.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Configuration.ConfigurationSettings" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="AppSettings">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetConfig(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sectionName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration/DictionarySectionHandler.xml b/mcs/docs/apidocs/xml/en/System.Configuration/DictionarySectionHandler.xml
deleted file mode 100644
index 1a6bb2c81d2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration/DictionarySectionHandler.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Configuration.DictionarySectionHandler" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DictionarySectionHandler">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="KeyAttributeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ValueAttributeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Create(System.Object, System.Object, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parent">TODO</param>
- <param name="context">TODO</param>
- <param name="section">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration/IConfigurationSectionHandler.xml b/mcs/docs/apidocs/xml/en/System.Configuration/IConfigurationSectionHandler.xml
deleted file mode 100644
index 7109e0931a8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration/IConfigurationSectionHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Configuration.IConfigurationSectionHandler" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration/IgnoreSectionHandler.xml b/mcs/docs/apidocs/xml/en/System.Configuration/IgnoreSectionHandler.xml
deleted file mode 100644
index e297b7a77a6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration/IgnoreSectionHandler.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Configuration.IgnoreSectionHandler" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IgnoreSectionHandler">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Create(System.Object, System.Object, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parent">TODO</param>
- <param name="configContext">TODO</param>
- <param name="section">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration/NameValueSectionHandler.xml b/mcs/docs/apidocs/xml/en/System.Configuration/NameValueSectionHandler.xml
deleted file mode 100644
index c55186a1bb1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration/NameValueSectionHandler.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Configuration.NameValueSectionHandler" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NameValueSectionHandler">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="KeyAttributeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ValueAttributeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Create(System.Object, System.Object, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parent">TODO</param>
- <param name="context">TODO</param>
- <param name="section">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Configuration/SingleTagSectionHandler.xml b/mcs/docs/apidocs/xml/en/System.Configuration/SingleTagSectionHandler.xml
deleted file mode 100644
index 46a2dddb41e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Configuration/SingleTagSectionHandler.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Configuration.SingleTagSectionHandler" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SingleTagSectionHandler">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Create(System.Object, System.Object, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parent">TODO</param>
- <param name="context">TODO</param>
- <param name="section">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/AcceptRejectRule.xml b/mcs/docs/apidocs/xml/en/System.Data/AcceptRejectRule.xml
deleted file mode 100644
index f2e691f0586..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/AcceptRejectRule.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.AcceptRejectRule" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/CommandBehavior.xml b/mcs/docs/apidocs/xml/en/System.Data/CommandBehavior.xml
deleted file mode 100644
index bf85abfdaef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/CommandBehavior.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.CommandBehavior" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/CommandType.xml b/mcs/docs/apidocs/xml/en/System.Data/CommandType.xml
deleted file mode 100644
index f26c16afa37..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/CommandType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.CommandType" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/ConnectionState.xml b/mcs/docs/apidocs/xml/en/System.Data/ConnectionState.xml
deleted file mode 100644
index 6d908a83e9c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/ConnectionState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.ConnectionState" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventArgs.xml
deleted file mode 100644
index e677fed9724..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventArgs.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Data.DataColumnChangeEventArgs" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataColumnChangeEventArgs(System.Data.DataRow, System.Data.DataColumn, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="row">TODO</param>
- <param name="column">TODO</param>
- <param name="value">TODO</param>
- </constructor>
- <property name="Column">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProposedValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Row">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventHandler.xml
deleted file mode 100644
index b64826ff7d1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataColumnChangeEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Data.DataColumnChangeEventHandler" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataColumnCollection.xml b/mcs/docs/apidocs/xml/en/System.Data/DataColumnCollection.xml
deleted file mode 100644
index 730c7f4f2af..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataColumnCollection.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Data.DataColumnCollection" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="List">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IndexOf(System.Data.DataColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String, System.Type, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="columnName">TODO</param>
- <param name="type">TODO</param>
- <param name="expression">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="columnName">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="columnName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Data.DataColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.Data.DataColumn[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="columns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CanRemove(System.Data.DataColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="columnName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Data.DataColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <event name="CollectionChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataRowAction.xml b/mcs/docs/apidocs/xml/en/System.Data/DataRowAction.xml
deleted file mode 100644
index 0a8c6853d90..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataRowAction.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.DataRowAction" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataRowChangeEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Data/DataRowChangeEventHandler.xml
deleted file mode 100644
index a117750af16..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataRowChangeEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Data.DataRowChangeEventHandler" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataRowState.xml b/mcs/docs/apidocs/xml/en/System.Data/DataRowState.xml
deleted file mode 100644
index b0ab018917b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataRowState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.DataRowState" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataRowVersion.xml b/mcs/docs/apidocs/xml/en/System.Data/DataRowVersion.xml
deleted file mode 100644
index 30a1c714767..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataRowVersion.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.DataRowVersion" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DataViewRowState.xml b/mcs/docs/apidocs/xml/en/System.Data/DataViewRowState.xml
deleted file mode 100644
index 049c21032b1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DataViewRowState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.DataViewRowState" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/DbType.xml b/mcs/docs/apidocs/xml/en/System.Data/DbType.xml
deleted file mode 100644
index 2de868e090a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/DbType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.DbType" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/FillErrorEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Data/FillErrorEventHandler.xml
deleted file mode 100644
index 1d072a5d68e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/FillErrorEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Data.FillErrorEventHandler" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IColumnMapping.xml b/mcs/docs/apidocs/xml/en/System.Data/IColumnMapping.xml
deleted file mode 100644
index b9e5b505955..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IColumnMapping.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IColumnMapping" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IColumnMappingCollection.xml b/mcs/docs/apidocs/xml/en/System.Data/IColumnMappingCollection.xml
deleted file mode 100644
index e60cca139a3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IColumnMappingCollection.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IColumnMappingCollection" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDBCommand.xml b/mcs/docs/apidocs/xml/en/System.Data/IDBCommand.xml
deleted file mode 100644
index 654519a85dd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDBCommand.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDBCommand" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDBConnection.xml b/mcs/docs/apidocs/xml/en/System.Data/IDBConnection.xml
deleted file mode 100644
index 4f1a37dbdf1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDBConnection.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDBConnection" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDataAdapter.xml b/mcs/docs/apidocs/xml/en/System.Data/IDataAdapter.xml
deleted file mode 100644
index 45e921c3cc2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDataAdapter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDataAdapter" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDataParameter.xml b/mcs/docs/apidocs/xml/en/System.Data/IDataParameter.xml
deleted file mode 100644
index fe855c9a99c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDataParameter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDataParameter" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDataParameterCollection.xml b/mcs/docs/apidocs/xml/en/System.Data/IDataParameterCollection.xml
deleted file mode 100644
index 8c42ad49474..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDataParameterCollection.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDataParameterCollection" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDataReader.xml b/mcs/docs/apidocs/xml/en/System.Data/IDataReader.xml
deleted file mode 100644
index b1f02cd7a1a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDataReader.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDataReader" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDataRecord.xml b/mcs/docs/apidocs/xml/en/System.Data/IDataRecord.xml
deleted file mode 100644
index fb5636d770e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDataRecord.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDataRecord" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDbDataAdapter.xml b/mcs/docs/apidocs/xml/en/System.Data/IDbDataAdapter.xml
deleted file mode 100644
index d4b6117ccee..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDbDataAdapter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDbDataAdapter" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDbDataParameter.xml b/mcs/docs/apidocs/xml/en/System.Data/IDbDataParameter.xml
deleted file mode 100644
index a2c0a569d03..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDbDataParameter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDbDataParameter" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IDbTransaction.xml b/mcs/docs/apidocs/xml/en/System.Data/IDbTransaction.xml
deleted file mode 100644
index f0d467db7bf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IDbTransaction.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.IDbTransaction" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/ITableMapping.xml b/mcs/docs/apidocs/xml/en/System.Data/ITableMapping.xml
deleted file mode 100644
index fa2c1704357..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/ITableMapping.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.ITableMapping" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/ITableMappingCollection.xml b/mcs/docs/apidocs/xml/en/System.Data/ITableMappingCollection.xml
deleted file mode 100644
index 5c08fdec75b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/ITableMappingCollection.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Data.ITableMappingCollection" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/IsolationLevel.xml b/mcs/docs/apidocs/xml/en/System.Data/IsolationLevel.xml
deleted file mode 100644
index 0effdb7b0d1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/IsolationLevel.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.IsolationLevel" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/MappingType.xml b/mcs/docs/apidocs/xml/en/System.Data/MappingType.xml
deleted file mode 100644
index 9de6778792c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/MappingType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.MappingType" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/MergeFailedEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Data/MergeFailedEventHandler.xml
deleted file mode 100644
index fec6b1537a8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/MergeFailedEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Data.MergeFailedEventHandler" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/MissingMappingAction.xml b/mcs/docs/apidocs/xml/en/System.Data/MissingMappingAction.xml
deleted file mode 100644
index 8c1a6366783..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/MissingMappingAction.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.MissingMappingAction" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/MissingSchemaAction.xml b/mcs/docs/apidocs/xml/en/System.Data/MissingSchemaAction.xml
deleted file mode 100644
index 7b8fc38f10e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/MissingSchemaAction.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.MissingSchemaAction" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/ParameterDirection.xml b/mcs/docs/apidocs/xml/en/System.Data/ParameterDirection.xml
deleted file mode 100644
index d4fc5bcfaa0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/ParameterDirection.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.ParameterDirection" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/PropertyAttributes.xml b/mcs/docs/apidocs/xml/en/System.Data/PropertyAttributes.xml
deleted file mode 100644
index 618b6166390..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/PropertyAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.PropertyAttributes" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/Rule.xml b/mcs/docs/apidocs/xml/en/System.Data/Rule.xml
deleted file mode 100644
index ed0162ab860..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/Rule.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.Rule" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/SchemaType.xml b/mcs/docs/apidocs/xml/en/System.Data/SchemaType.xml
deleted file mode 100644
index b68a372ceb7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/SchemaType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.SchemaType" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/SqlDbType.xml b/mcs/docs/apidocs/xml/en/System.Data/SqlDbType.xml
deleted file mode 100644
index 7b126ae8c3c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/SqlDbType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.SqlDbType" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/StateChangeEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Data/StateChangeEventHandler.xml
deleted file mode 100644
index 32ec8625f60..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/StateChangeEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Data.StateChangeEventHandler" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/StatementType.xml b/mcs/docs/apidocs/xml/en/System.Data/StatementType.xml
deleted file mode 100644
index f43605df5be..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/StatementType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.StatementType" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/UpdateRowSource.xml b/mcs/docs/apidocs/xml/en/System.Data/UpdateRowSource.xml
deleted file mode 100644
index 8961d90d9de..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/UpdateRowSource.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.UpdateRowSource" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/UpdateStatus.xml b/mcs/docs/apidocs/xml/en/System.Data/UpdateStatus.xml
deleted file mode 100644
index 11e01b1fa1c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/UpdateStatus.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.UpdateStatus" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/XmlReadMode.xml b/mcs/docs/apidocs/xml/en/System.Data/XmlReadMode.xml
deleted file mode 100644
index 89cee021213..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/XmlReadMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.XmlReadMode" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Data/XmlWriteMode.xml b/mcs/docs/apidocs/xml/en/System.Data/XmlWriteMode.xml
deleted file mode 100644
index c75e22b1975..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Data/XmlWriteMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Data.XmlWriteMode" assembly="System.Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolBinder.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolBinder.xml
deleted file mode 100644
index 115912ea214..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolBinder.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolBinder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocument.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocument.xml
deleted file mode 100644
index 38a65b583d9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocument.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolDocument" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.xml
deleted file mode 100644
index 6dc28c91683..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolDocumentWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolMethod.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolMethod.xml
deleted file mode 100644
index 9f6db0c68dd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolMethod.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolMethod" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolNamespace.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolNamespace.xml
deleted file mode 100644
index 44deb236b5a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolNamespace.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolNamespace" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolReader.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolReader.xml
deleted file mode 100644
index 2146f6de489..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolReader.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolReader" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolScope.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolScope.xml
deleted file mode 100644
index 404d17a0f1e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolScope.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolScope" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolVariable.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolVariable.xml
deleted file mode 100644
index 01a88418d55..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolVariable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolVariable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolWriter.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolWriter.xml
deleted file mode 100644
index 3c95ae985e1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/ISymbolWriter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Diagnostics.SymbolStore.ISymbolWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymAddressKind.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymAddressKind.xml
deleted file mode 100644
index f2af6e6c6d7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymAddressKind.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Diagnostics.SymbolStore.SymAddressKind" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymDocumentType.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymDocumentType.xml
deleted file mode 100644
index 6574e80fd54..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymDocumentType.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.SymbolStore.SymDocumentType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SymDocumentType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageType.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageType.xml
deleted file mode 100644
index 61aa8365b89..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageType.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.SymbolStore.SymLanguageType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SymLanguageType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="Basic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="C">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Cobol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="CPlusPlus">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="CSharp">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="ILAssembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Java">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="JScript">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MCPlusPlus">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Pascal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SMC">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageVendor.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageVendor.xml
deleted file mode 100644
index 1921c6fd94d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymLanguageVendor.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.SymbolStore.SymLanguageVendor" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SymLanguageVendor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="Microsoft">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymbolToken.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymbolToken.xml
deleted file mode 100644
index 4e770fca04f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics.SymbolStore/SymbolToken.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Diagnostics.SymbolStore.SymbolToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SymbolToken(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- </constructor>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/BooleanSwitch.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/BooleanSwitch.xml
deleted file mode 100644
index b436e63d16e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/BooleanSwitch.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.BooleanSwitch" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BooleanSwitch(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="displayName">TODO</param>
- <param name="description">TODO</param>
- </constructor>
- <property name="Enabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/ChangeLog b/mcs/docs/apidocs/xml/en/System.Diagnostics/ChangeLog
deleted file mode 100644
index 395a915cd46..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/ChangeLog
+++ /dev/null
@@ -1,18 +0,0 @@
-2002-05-29 Jonathan Pryor <jonpryor@vt.edu>
- * DefaultTraceListener.xml: Update with information about MONO_TRACE.
-
-2002-05-27 Jonathan Pryor <jonpryor@vt.edu>
- * ChangeLog: Added this file
- * Moved public documentation from the source code into the appropriate XML
- files. Modified:
- - Debug.xml
- - DefaultTraceListener.xml
- - DiagnosticsConfigurationHandler.xml
- - Switch.xml
- - TextWriterTraceListener.xml
- - Trace.xml
- - TraceLevel.xml
- - TraceListener.xml
- - TraceListenerCollection.xml
- - TraceSwitch.xml
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/ConditionalAttribute.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/ConditionalAttribute.xml
deleted file mode 100644
index 38122a680ca..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/ConditionalAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.ConditionalAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ConditionalAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conditionString">TODO</param>
- </constructor>
- <property name="ConditionString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/Debug.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/Debug.xml
deleted file mode 100644
index 03dcd1cc863..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/Debug.xml
+++ /dev/null
@@ -1,261 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<!-- It should be noted that this file is just a copy of `Trace.xml -->
-<monodoc language="en">
- <class name="System.Diagnostics.Trace" assembly="System">
- <summary>Provides a set of methods to help debug code.</summary>
- <remarks>TODO</remarks>
- <property name="AutoFlush">
- <summary>
- Gets or sets value indicating whether Flush should be called
- on the listeners after each write.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IndentLevel">
- <summary>Gets or sets indent level.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IndentSize">
- <summary>The number of spaces in an indent.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Listeners">
- <summary>Returns the listeners collection.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Assert(System.Boolean)">
- <summary>
- Checks for a condition, and prints a stack trace if the
- condition is false.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Assert(System.Boolean, System.String)">
- <summary>
- Checks for a condition, and displays a message if the condition
- is false.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Assert(System.Boolean, System.String, System.String)">
- <summary>
- Checks for a condtion, and displays a message and a detailed
- message string if the condition is false.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <param name="detailMessage">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>Closes the Debug buffer.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String)">
- <summary>Emits the specified error message.</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String, System.String)">
- <summary>
- Emits the specified error message and detailed error
- message.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="detailMessage">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>Flushes the listeners.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Indent">
- <summary>Increments the indent level.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Unindent">
- <summary>Decrements the indent level.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object)">
- <summary>
- Writes the value of the specified object's ToString method to
- the listeners.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>
- Writes the specified message to each listener in the Listeners
- collection.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object, System.String)">
- <summary>
- Writes the category name and value of the specified object's
- ToString method to each listener in the Listeners collection.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.String)">
- <summary>
- Writes the category name and the specified message
- to each listener in the Listeners collection.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.Object)">
- <summary>
- Writes the value of the specified object's ToString method
- to each of the listeners if the condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.String)">
- <summary>
- Writes the specified message to each of the listeners
- if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.Object, System.String)">
- <summary>
- Writes the value of the specified object's ToString message
- and category to each of the listeners if the condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.String, System.String)">
- <summary>
- Writes the category and specified message to each listener
- if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object)">
- <summary>
- Writes the value of the object's ToString method,
- followed by a line terminator, to each listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String)">
- <summary>
- Writes the specified message, followed by a line terminator,
- to each listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object, System.String)">
- <summary>
- Writes the value of the specified object's ToString method,
- along with a category, followed by a line terminator, to each
- listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.String)">
- <summary>
- Writes the specified category and message, followed by a line
- terminator, to each listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.Object)">
- <summary>
- Writes the value of the object's ToString method
- to each listener if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.String)">
- <summary>
- Writes the specified message to each listener
- if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.Object, System.String)">
- <summary>
- Writes the value of the object's ToString method, and a category
- to each listener if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.String, System.String)">
- <summary>
- Writes the specified category and message to each listener,
- followed by a line terminator, if the specified condition
- is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggableAttribute.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggableAttribute.xml
deleted file mode 100644
index 8a0e6cbc5eb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggableAttribute.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.DebuggableAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DebuggableAttribute(System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="isJITTrackingEnabled">TODO</param>
- <param name="isJITOptimizerDisabled">TODO</param>
- </constructor>
- <property name="IsJITTrackingEnabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsJITOptimizerDisabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/Debugger.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/Debugger.xml
deleted file mode 100644
index c67b1655518..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/Debugger.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.Debugger" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Debugger">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="DefaultCategory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="IsAttached">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Break">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsLogging">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Launch">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Log(System.Int32, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <param name="category">TODO</param>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerHiddenAttribute.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerHiddenAttribute.xml
deleted file mode 100644
index a09c3842390..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerHiddenAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.DebuggerHiddenAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DebuggerHiddenAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerStepThroughAttribute.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerStepThroughAttribute.xml
deleted file mode 100644
index c0b79ccbd8d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/DebuggerStepThroughAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.DebuggerStepThroughAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DebuggerStepThroughAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/DefaultTraceListener.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/DefaultTraceListener.xml
deleted file mode 100644
index 973d73bb845..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/DefaultTraceListener.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.DefaultTraceListener" assembly="System">
- <summary>
- Provides the default output methods and behavior for tracing.
- </summary>
- <remarks>
- <para>There are three ways to get output from the
- <c>DefaultTraceListener</c>.</para>
- <list type="number">
- <item><description>Set the <see cref="LogFileName"/> property.
- This will cause all output to be appended to the specified log
- file.
- <para>This is the only mechanism that is consistent across
- both Windows and Unix platforms.</para>
- </description></item>
- <item><description>On Windows, messages are displayed using the
- <c>OutputDebugString</c> API. (Look it up on MSDN.) Messages
- are automatically displayed in the debugger if the program is
- being debugged. If the program isn't being debugged, a
- program such as <c>DebugView</c> (available from
- www.systeminternals.com) can be used to view the output.
- </description></item>
- <item><description>On Unix, behavior is dependant upon the
- <c>MONO_TRACE</c> environment variable.
- <para>If <c>MONO_TRACE</c> isn't set or is empty, messages are
- ignored.</para>
- <para>If <c>MONO_TRACE</c> is set, messages will be sent where
- <c>MONO_TRACE</c> specifies. <c>MONO_TRACE</c> accepts
- three different sets of values:</para>
- <list type="bullet">
- <item>
- <term><c>Console.Out</c></term>
- <description>Send messages to standard output.</description>
- </item>
- <item>
- <term><c>Console.Error</c></term>
- <description>Send messages to standard error.</description>
- </item>
- <item>
- <term>Anything else</term>
- <description>Treat "Anything else" as a file, and append the
- message to the specified file.</description>
- </item>
- </list>
- <para>Both <c>Console.Out</c> and <c>Console.Error</c> allow the
- specification of a "prefix" -- a message that will prefix all
- messages sent to the specified location. The prefix is
- appended to the location, separated from the location with a
- colon (':').
- </para>
- <para>For example,
- <c>export MONO_TRACE="Console.Out:** my prefix "</c>
- would send messages to standard output. Messages would be
- prefixed with the string "<c>** my prefix </c>".
- </para>
- <para>Other valid examples are:
- <list type="bullet">
- <item><description><c>export MONO_TRACE="/dev/stdout"</c>,
- which would also send messages to the console.
- </description></item>
- <item><description><c>export MONO_TRACE="out.txt"</c>, which
- would append messages to the file "out.txt" in the current
- working directory.
- </description></item>
- <item><description><c>export MONO_TRACE="/dev/ttyS0"</c>, which
- would append messages to the serial port, if permitted.
- </description></item>
- </list>
- </para>
- </description></item>
- </list>
- <para>The <c>DefaultTraceListener</c> is not complete.
- MSDN specifies that GUI widgets be used
- for certain features. The short-term solution is to forgo GUI
- widgets and use the normal existing mechanisms (log file, console,
- <c>OutputDebugString</c>).</para>
- </remarks>
- <constructor name="DefaultTraceListener">
- <summary>Create a new instance of the <c>DefaultTraceListener</c>,
- with "Default" as its <see cref="Name"/>.</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AssertUiEnabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LogFileName">
- <summary>
- Gets or sets name of a log file to write trace or debug
- messages to.
- </summary>
- <remarks>TODO</remarks>
- <value>
- The name of a log file to write trace or debug messages to.
- </value>
- </property>
- <method name="WriteLine(System.String)">
- <summary>
- Writes the output to the Console, followed by a newline
- </summary>
- <remarks>TODO</remarks>
- <param name="message">The message to write.</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>Writes the output to the Console.</summary>
- <remarks>TODO</remarks>
- <param name="message">The message to write.</param>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String, System.String)">
- <summary>
- Emits or displays detailed messages and a stack trace
- for an assertion that always fails.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">The message to emit or display.</param>
- <param name="detailMessage">
- The detailed message to emit or display.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String)">
- <summary>
- Emits or displays a message and a stack trace for an
- assertion that always fails.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">The message to emit or display.</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/DiagnosticsConfigurationHandler.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/DiagnosticsConfigurationHandler.xml
deleted file mode 100644
index 951109057b6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/DiagnosticsConfigurationHandler.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.DiagnosticsConfigurationHandler" assembly="System">
- <summary>
- The configuration section handler for the diagnostics section of
- the configuration file. The section handler participates in the
- resolution of configuration settings between the &lt;diagnostics&gt;
- and &lt;/diagnostics&gt; portion of the .config file.
- </summary>
- <remarks>TODO</remarks>
- <constructor name="DiagnosticsConfigurationHandler">
- <summary>
- Initializes a new instance of the
- <see cref="DiagnosticsConfigurationHandler">
- DiagnosticsConfigurationHandler</see> class.
- </summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Create(System.Object, System.Object, System.Xml.XmlNode)">
- <summary>
- Parses the configuration settings between the
- &lt;diagnostics&gt; and &lt;/diagnostics&gt; portion of the
- .config file to populate the values of the object and return it.
- </summary>
- <remarks>Not implemented.</remarks>
- <param name="parent">
- Reference to the &quot;default&quot; value provided by the
- parent IConfigurationSectionHandler.
- </param>
- <param name="configContext">TODO</param>
- <param name="section">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/FileVersionInfo.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/FileVersionInfo.xml
deleted file mode 100644
index 273c6e1acdc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/FileVersionInfo.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.FileVersionInfo" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileVersionInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Comments">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CompanyName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileBuildPart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileDescription">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileMajorPart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileMinorPart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FilePrivatePart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileVersion">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InternalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsDebug">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPatched">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPreRelease">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPrivateBuild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSpecialBuild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Language">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LegalCopyright">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LegalTrademarks">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OriginalFilename">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivateBuild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProductBuildPart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProductMajorPart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProductMinorPart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProductName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProductPrivatePart">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProductVersion">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SpecialBuild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetVersionInfo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/Process.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/Process.xml
deleted file mode 100644
index 5b09088540a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/Process.xml
+++ /dev/null
@@ -1,340 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.Process" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Process">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BasePriority">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EnableRaisingEvents">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ExitCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ExitTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Handle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HandleCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasExited">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Id">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MachineName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MainModule">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MainWindowHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MainWindowTitle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MaxWorkingSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MinWorkingSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Modules">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NonpagedSystemMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PagedMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PagedSystemMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PeakPagedMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PeakVirtualMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PeakWorkingSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PriorityBoostEnabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PriorityClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivateMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivilegedProcessorTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProcessName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProcessorAffinity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Responding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StandardError">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StandardInput">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StandardOutput">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StartInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StartTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SynchronizingObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Threads">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TotalProcessorTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserProcessorTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="VirtualMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WorkingSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CloseMainWindow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="EnterDebugMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetCurrentProcess">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetProcessById(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="processId">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProcessById(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="processId">TODO</param>
- <param name="machineName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProcesses">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetProcesses(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="machineName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProcessesByName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="processName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProcessesByName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="processName">TODO</param>
- <param name="machineName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Kill">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="LeaveDebugMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Refresh">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Start">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Start(System.Diagnostics.ProcessStartInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startInfo">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Start(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Start(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- <param name="arguments">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitForExit">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WaitForExit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitForInputIdle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WaitForInputIdle(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <event name="Exited">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessModule.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessModule.xml
deleted file mode 100644
index 9aac6ffaa38..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessModule.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.ProcessModule" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ProcessModule">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseAddress">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EntryPointAddress">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileVersionInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ModuleMemorySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ModuleName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessPriorityClass.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessPriorityClass.xml
deleted file mode 100644
index ae60fedc540..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/ProcessPriorityClass.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Diagnostics.ProcessPriorityClass" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/StackFrame.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/StackFrame.xml
deleted file mode 100644
index 66c76a28ca3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/StackFrame.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.StackFrame" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StackFrame">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="StackFrame(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="needFileInfo">TODO</param>
- </constructor>
- <constructor name="StackFrame(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="skipFrames">TODO</param>
- </constructor>
- <constructor name="StackFrame(System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="skipFrames">TODO</param>
- <param name="needFileInfo">TODO</param>
- </constructor>
- <constructor name="StackFrame(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- <param name="lineNumber">TODO</param>
- </constructor>
- <constructor name="StackFrame(System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- <param name="lineNumber">TODO</param>
- <param name="colNumber">TODO</param>
- </constructor>
- <field name="OFFSET_UNKNOWN">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="GetNativeOffset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetILOffset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFileColumnNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFileLineNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/StackTrace.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/StackTrace.xml
deleted file mode 100644
index 128664384a3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/StackTrace.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.StackTrace" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StackTrace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="StackTrace(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="needFileInfo">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Exception, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <param name="needFileInfo">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Exception, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <param name="skipFrames">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Exception, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <param name="skipFrames">TODO</param>
- <param name="needFileInfo">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="skipFrames">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Diagnostics.StackFrame)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="frame">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="skipFrames">TODO</param>
- <param name="needFileInfo">TODO</param>
- </constructor>
- <constructor name="StackTrace(System.Threading.Thread, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="targetThread">TODO</param>
- <param name="needFileInfo">TODO</param>
- </constructor>
- <field name="METHODS_TO_SKIP">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="FrameCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetFrame(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/Switch.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/Switch.xml
deleted file mode 100644
index 0a7f1109c3d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/Switch.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.Switch" assembly="System">
- <summary>
- Abstract base class to create new debugging and tracing switches.
- </summary>
- <remarks>TODO</remarks>
- <constructor name="Switch">
- <summary>Initialize a new instance.</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Description">
- <summary>Returns a description of the switch.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DisplayName">
- <summary>Returns a name used to identify the switch.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SwitchSetting">
- <summary>Gets or sets the current setting for this switch.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="OnSwitchSettingChanged">
- <summary>Raises the SwitchSettingChanged event.</summary>
- <remarks>TODO</remarks>
- </method>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/TextWriterTraceListener.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/TextWriterTraceListener.xml
deleted file mode 100644
index 9645cf9117f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/TextWriterTraceListener.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.TextWriterTraceListener" assembly="System">
- <summary>
- Directs tracing or debugging output to a
- <see cref="System.IO.TextWriter">TextWriter</see> or to a
- <see cref="System.IO.Stream">Stream</see>,
- such as <see cref="System.Console.Out">Console.Out</see> or
- <see cref="System.IO.FileStream">FileStream</see>.
- </summary>
- <remarks>TODO</remarks>
- <constructor name="TextWriterTraceListener">
- <summary>
- Initializes a new instance of the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- class with
- <see cref="System.IO.TextWriter">TextWriter</see>
- as the output recipient.
- </summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TextWriterTraceListener(System.IO.Stream)">
- <summary>
- Initializes a new instance of the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- class, using the stream as the output
- recipient of the debugging and tracing output.
- </summary>
- <remarks>TODO</remarks>
- <param name="stream">
- A <see cref="System.IO.Stream">Stream</see> that represents the
- stream the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- writes to.
- </param>
- <exception cref="System.ArgumentNullException">
- The stream is a null reference.
- </exception>
- </constructor>
- <constructor name="TextWriterTraceListener(System.String)">
- <summary>
- Initializes a new instance of the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- class, using the file as the recipient
- of the debugging and tracing output.
- </summary>
- <remarks>TODO</remarks>
- <param name="fileName">
- The name of the file the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- writes to.
- </param>
- <exception cref="System.ArgumentNullException">
- The fileName is null.
- </exception>
- </constructor>
- <constructor name="TextWriterTraceListener(System.IO.TextWriter)">
- <summary>
- Initializes a new instance of the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- class using the specified writer as the
- recipient of the tracing or debugging output.
- </summary>
- <remarks>TODO</remarks>
- <param name="writer">
- A <see cref="System.IO.TextWriter">TextWriter</see> that receives
- output from the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>.
- </param>
- <exception cref="System.ArgumentNullException">
- The writer is a null reference
- </exception>
- </constructor>
- <constructor name="TextWriterTraceListener(System.IO.Stream, System.String)">
- <summary>
- Initializes a new instance of the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- class with the specified name, using the
- stream as the recipient of the tracing or debugging output.
- </summary>
- <remarks>TODO</remarks>
- <param name="stream">
- A <see cref="System.IO.Stream">Stream</see> that represents
- the stream the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- writes to.
- </param>
- <param name="name">The name of the new instance.</param>
- <exception cref="System.ArgumentNullException">
- The stream is a null reference
- </exception>
- </constructor>
- <constructor name="TextWriterTraceListener(System.String, System.String)">
- <summary>
- Initializes a new instance of the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- class with the specified name, using the
- file as the recipient of the tracing or debugging output.
- </summary>
- <remarks>TODO</remarks>
- <param name="fileName">
- The name of the file the <see cref="TextWriterTraceListener">
- TextWriterTraceListener</see> writes to.
- </param>
- <param name="name">The name of the new instance.</param>
- <exception cref="System.ArgumentNullException">
- The file is a null reference.
- </exception>
- </constructor>
- <constructor name="TextWriterTraceListener(System.IO.TextWriter, System.String)">
- <summary>
- Initializes a new instance of the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>
- class with the specified name, using
- the specified writer as the recipient of the tracing or
- debugging output.
- </summary>
- <remarks>TODO</remarks>
- <param name="writer">
- A <see cref="System.IO.TextWriter">TextWriter</see> that receives
- the output from the
- <see cref="TextWriterTraceListener">TextWriterTraceListener</see>.
- </param>
- <param name="name">The name of the new instance.</param>
- <exception cref="System.ArgumentNullException">
- The writer is a null reference.
- </exception>
- </constructor>
- <property name="Writer">
- <summary>
- Gets or sets the writer that receives the debugging or
- tracing output.
- </summary>
- <remarks>TODO</remarks>
- <value>
- A <see cref="System.IO.TextWriter">TextWriter</see> that
- represents the writer that receives the tracing or
- debugging output.
- </value>
- </property>
- <method name="WriteLine(System.String)">
- <summary>
- Writes a message to this instance's
- <see cref="System.IO.Writer">Writer</see>
- followed by a line terminator.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to write.</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>
- Writes a message to this instance's
- <see cref="System.IO.Writer">Writer</see>.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to write.</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>
- Flushes the output buffer for the
- <see cref="System.IO.Writer">Writer</see>.
- </summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>
- Closes the <see cref="System.IO.Writer">Writer</see> so that
- it no longer receives tracing or debugging output.
- </summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/Trace.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/Trace.xml
deleted file mode 100644
index 58857d7225c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/Trace.xml
+++ /dev/null
@@ -1,260 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.Trace" assembly="System">
- <summary>Provides a set of methods to help debug code.</summary>
- <remarks>TODO</remarks>
- <property name="AutoFlush">
- <summary>
- Gets or sets value indicating whether Flush should be called
- on the listeners after each write.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IndentLevel">
- <summary>Gets or sets indent level.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IndentSize">
- <summary>The number of spaces in an indent.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Listeners">
- <summary>Returns the listeners collection.</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Assert(System.Boolean)">
- <summary>
- Checks for a condition, and prints a stack trace if the
- condition is false.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Assert(System.Boolean, System.String)">
- <summary>
- Checks for a condition, and displays a message if the condition
- is false.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Assert(System.Boolean, System.String, System.String)">
- <summary>
- Checks for a condtion, and displays a message and a detailed
- message string if the condition is false.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <param name="detailMessage">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>Closes the Debug buffer.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String)">
- <summary>Emits the specified error message.</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String, System.String)">
- <summary>
- Emits the specified error message and detailed error
- message.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="detailMessage">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>Flushes the listeners.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Indent">
- <summary>Increments the indent level.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Unindent">
- <summary>Decrements the indent level.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object)">
- <summary>
- Writes the value of the specified object's ToString method to
- the listeners.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>
- Writes the specified message to each listener in the Listeners
- collection.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object, System.String)">
- <summary>
- Writes the category name and value of the specified object's
- ToString method to each listener in the Listeners collection.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.String)">
- <summary>
- Writes the category name and the specified message
- to each listener in the Listeners collection.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.Object)">
- <summary>
- Writes the value of the specified object's ToString method
- to each of the listeners if the condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.String)">
- <summary>
- Writes the specified message to each of the listeners
- if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.Object, System.String)">
- <summary>
- Writes the value of the specified object's ToString message
- and category to each of the listeners if the condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteIf(System.Boolean, System.String, System.String)">
- <summary>
- Writes the category and specified message to each listener
- if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object)">
- <summary>
- Writes the value of the object's ToString method,
- followed by a line terminator, to each listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String)">
- <summary>
- Writes the specified message, followed by a line terminator,
- to each listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object, System.String)">
- <summary>
- Writes the value of the specified object's ToString method,
- along with a category, followed by a line terminator, to each
- listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.String)">
- <summary>
- Writes the specified category and message, followed by a line
- terminator, to each listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.Object)">
- <summary>
- Writes the value of the object's ToString method
- to each listener if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.String)">
- <summary>
- Writes the specified message to each listener
- if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.Object, System.String)">
- <summary>
- Writes the value of the object's ToString method, and a category
- to each listener if the specified condition is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="value">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineIf(System.Boolean, System.String, System.String)">
- <summary>
- Writes the specified category and message to each listener,
- followed by a line terminator, if the specified condition
- is true.
- </summary>
- <remarks>TODO</remarks>
- <param name="condition">TODO</param>
- <param name="message">TODO</param>
- <param name="category">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceLevel.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceLevel.xml
deleted file mode 100644
index aab8e5a1b60..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceLevel.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Diagnostics.TraceLevel" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListener.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListener.xml
deleted file mode 100644
index 4da3a53384d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListener.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.TraceListener" assembly="System">
- <summary>
- Provides the abstract base class for the listeners who monitor
- trace and debug output.
- </summary>
- <remarks>TODO</remarks>
- <constructor name="TraceListener">
- <summary>
- Initializes a new instance of the
- <see cref="TraceListener">TraceListener</see> class.
- </summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TraceListener(System.String)">
- <summary>
- Initializes a new instance of the
- <see cref="TraceListener">TraceListener</see> class using the
- specified name as the listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="name">
- The value to return from <see cref="Name"/>.
- </param>
- </constructor>
- <property name="IndentLevel">
- <summary>Gets or sets the indent level.</summary>
- <remarks>TODO</remarks>
- <value>The indent level. The default is zero.</value>
- </property>
- <property name="IndentSize">
- <summary>Gets or sets the number of spaces in an indent.</summary>
- <remarks>TODO</remarks>
- <value>
- The number of spaces in an indent. The default is four spaces.
- </value>
- </property>
- <property name="Name">
- <summary>
- Gets or sets a name for this
- <see cref="TraceListener">TraceListener</see>.
- </summary>
- <remarks>TODO</remarks>
- <value>
- A name for this <see cref="TraceListener">TraceListener</see>.
- The default is the empty string ("").
- </value>
- </property>
- <property name="NeedIndent">
- <summary>
- Gets or sets a value indicating whether to indent the output.
- </summary>
- <remarks>TODO</remarks>
- <value>
- <c>true</c> if the output should be indented;
- otherwise <c>false</c>.
- </value>
- </property>
- <method name="Dispose">
- <summary>
- Releases all resources used by the i
- <see cref="TraceListener">TraceListener</see>.
- </summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteIndent">
- <summary>
- Writes the indent to the listener you create when you implement
- this class, and resets the <see cref="NeedIndent">NeedIndent</see>
- Property to <b>false</b>.
- </summary>
- <remarks>TODO</remarks>
- </method>
- <method name="WriteLine(System.String, System.String)">
- <summary>
- Writes a category name and a message to the listener you create
- when you implement the
- <see cref="TraceListener">TraceListener</see> class, followed
- by a line terminator.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to write.</param>
- <param name="category">
- A category name used to organize the output.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object, System.String)">
- <summary>
- Writes a category name and the value of the object's
- <see cref="System.Object.ToString">ToString</see>
- method to the listener you create when you implement the
- <see cref="TraceListener">TraceListener</see> class, followed
- by a line terminator.
- </summary>
- <remarks>TODO</remarks>
- <param name="o">
- An <see cref="System.Object">Object</see> whose fully qualified
- class name you wish to write.
- </param>
- <param name="category">
- A category name used to organize the output.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String)">
- <summary>
- When overridden in a derived class, writes the specified message
- to the listener you create in the derived class, followed by a
- line terminator.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to write.</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object)">
- <summary>
- Writes the value of the object's
- <see cref="System.Object.ToString">ToString</see>
- method to the listener you create when you implement the
- <see cref="TraceListener">TraceListener</see> class, followed
- by a line terminator.
- </summary>
- <remarks>TODO</remarks>
- <param name="o">
- An <see cref="System.Object">Object</see> whose fully qualified
- class name you want to write.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.String)">
- <summary>
- Writes a category name and a message to the listener you
- create when you implement the
- <see cref="TraceListener">TraceListener</see> class.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to write.</param>
- <param name="category">
- A category name used to organize the output.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object, System.String)">
- <summary>
- Writes a category name and the value of the object's
- <see cref="System.Object.ToString">ToString</see>
- method to the listener you create when you implement the
- <see cref="TraceListener">TraceListener</see> class.
- </summary>
- <remarks>TODO</remarks>
- <param name="o">
- An <see cref="System.Object">Object</see> whose fully qualified
- class name you wish to write.
- </param>
- <param name="category">
- A category name used to organize the output.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>
- When overridden in a derived class, writes the specified message
- to the listener you create in the derived class.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to write.</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object)">
- <summary>Writes the value of the object's
- <see cref="System.Object.ToString">ToString</see>
- method to the listener you create when you implement the
- <see cref="TraceListener">TraceListener</see> class.
- </summary>
- <remarks>TODO</remarks>
- <param name="o">
- An <see cref="System.Object">Object</see> whose fully qualified
- class name you want to write.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>
- When overridden in a derived class, flushes the output buffer.
- </summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String, System.String)">
- <summary>
- Emits an error message, and a detailed error message to the
- listener you create when you implement the
- <see cref="TraceListener">TraceListener</see> class.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to emit.</param>
- <param name="detailMessage">A detailed message to emit.</param>
- <returns>TODO</returns>
- </method>
- <method name="Fail(System.String)">
- <summary>
- Emits an error message to the listener you create when you
- implement the <see cref="TraceListener">TraceListener</see>
- class.
- </summary>
- <remarks>TODO</remarks>
- <param name="message">A message to emit.</param>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>
- When overridden in a derived class, closes the output stream
- so it no longer receives tracing or debugging output.
- </summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc>
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListenerCollection.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListenerCollection.xml
deleted file mode 100644
index 09a34d5fabb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceListenerCollection.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.TraceListenerCollection" assembly="System">
- <summary>Provides a list of TraceListener objects.</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>Returns the number of items in the list.</summary>
- <remarks>TODO</remarks>
- <value>The number of items.</value>
- </property>
- <property name="Item(System.String)">
- <summary>
- Gets the first TraceListener in the list with the
- specified name.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>Returns an enumerator for the list of listeners.</summary>
- <remarks>TODO</remarks>
- <returns>
- List Enumerator of type <see cref="IEnumerator"/>.
- </returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>Removes the listener at the specified index.</summary>
- <remarks>TODO</remarks>
- <param name="index">Location of the listener to remove.</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>Clears all listeners from the list.</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Diagnostics.TraceListener)">
- <summary>Adds a TraceListener to the list.</summary>
- <remarks>TODO</remarks>
- <param name="listener">
- The <see cref="TraceListener"/> being added to the list.
- </param>
- <returns>
- The position in the list where the listener was inserted.
- </returns>
- </method>
- <method name="AddRange(System.Diagnostics.TraceListener[])">
- <summary>
- Adds an array of <see cref="TraceListeners"/>s to the list.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">
- Array of <see cref="TraceListener"/> to add to the list.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.Diagnostics.TraceListenerCollection)">
- <summary>
- Adds the contents of another TraceListenerCollection to this one.
- </summary>
- <remarks>TODO</remarks>
- <param name="value">
- The TraceListenerCollection to copy values from.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Diagnostics.TraceListener)">
- <summary>
- Checks to see if the list contains the specified listener.
- </summary>
- <remarks>TODO</remarks>
- <param name="listener">The listener to search for.</param>
- <returns>
- <c>true</c> if list contains listener; <c>false</c> otherwise.
- </returns>
- </method>
- <method name="CopyTo(System.Diagnostics.TraceListener[], System.Int32)">
- <summary>
- Copies a section of the current TraceListenerCollection to
- the specified array at the specified index.
- </summary>
- <remarks>TODO</remarks>
- <param name="listeners">Array to copy listeners to.</param>
- <param name="index">Starting index of copy.</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Diagnostics.TraceListener)">
- <summary>Gets the index of the specified listener.</summary>
- <remarks>TODO</remarks>
- <param name="listener">The listener to search for.</param>
- <returns>
- The index of the listener in the list, if it exists.
- </returns>
- </method>
- <method name="Insert(System.Int32, System.Diagnostics.TraceListener)">
- <summary>
- Inserts the specified listener into the list at the
- specified index.
- </summary>
- <remarks>TODO</remarks>
- <param name="index">
- Location in the list to insert the listener.
- </param>
- <param name="listener">
- The TraceListener to insert into the list.
- </param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>
- Removes the listener with the specified name from the list,
- if it exists.
- </summary>
- <remarks>TODO</remarks>
- <param name="name">Name of listener to remove.</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Diagnostics.TraceListener)">
- <summary>Removes the specified listener from the list.</summary>
- <remarks>TODO</remarks>
- <param name="listener">The listener to remove.</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceSwitch.xml b/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceSwitch.xml
deleted file mode 100644
index 51ba8e82ffe..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Diagnostics/TraceSwitch.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Diagnostics.TraceSwitch" assembly="System">
- <summary>
- Multi-level switch to provide tracing and debug output without
- recompiling.
- </summary>
- <remarks>TODO</remarks>
- <constructor name="TraceSwitch(System.String, System.String)">
- <summary>Initializes a new instance.</summary>
- <remarks>TODO</remarks>
- <param name="displayName">Name for the switch.</param>
- <param name="description">Description of the switch.</param>
- </constructor>
- <property name="Level">
- <summary>
- Gets or sets the trace level that specifies the messages to
- output for tracing and debugging.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TraceError">
- <summary>
- Gets a value indicating whether the Level is set to Error,
- Warning, Info, or Verbose.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TraceInfo">
- <summary>
- Gets a value indicating whether the Level is set to Info or
- Verbose.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TraceVerbose">
- <summary>
- Gets a value indicating whether the Level is set to Verbose.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TraceWarning">
- <summary>
- Gets a value indicating whether the Level is set to
- Warning, Info, or Verbose.
- </summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc>
-
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/CCGregorianEraHandler.xml b/mcs/docs/apidocs/xml/en/System.Globalization/CCGregorianEraHandler.xml
deleted file mode 100644
index f87a6eb2f34..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/CCGregorianEraHandler.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.CCGregorianEraHandler" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CCGregorianEraHandler">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="appendEra(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nr">TODO</param>
- <param name="rd_start">TODO</param>
- <param name="rd_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="appendEra(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nr">TODO</param>
- <param name="rd_start">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GregorianYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EraYear(System.Int32&amp;, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="era">TODO</param>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CheckDateTime(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ValidDate(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ValidEra(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/CCHijriCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/CCHijriCalendar.xml
deleted file mode 100644
index b9f072d73d2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/CCHijriCalendar.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.CCHijriCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Month">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="is_leap_year(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="fixed_from_dmy(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="day">TODO</param>
- <param name="month">TODO</param>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="year_from_fixed(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="my_from_fixed(System.Int32&amp;, System.Int32&amp;, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="month">TODO</param>
- <param name="year">TODO</param>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="dmy_from_fixed(System.Int32&amp;, System.Int32&amp;, System.Int32&amp;, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="day">TODO</param>
- <param name="month">TODO</param>
- <param name="year">TODO</param>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="month_from_fixed(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="day_from_fixed(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="date_difference(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dayA">TODO</param>
- <param name="monthA">TODO</param>
- <param name="yearA">TODO</param>
- <param name="dayB">TODO</param>
- <param name="monthB">TODO</param>
- <param name="yearB">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="day_number(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="day">TODO</param>
- <param name="month">TODO</param>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="days_remaining(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="day">TODO</param>
- <param name="month">TODO</param>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/Calendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/Calendar.xml
deleted file mode 100644
index 7e3fa317545..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/Calendar.xml
+++ /dev/null
@@ -1,283 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.Calendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="CurrentEra">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="M_DaysInWeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="M_MaxYear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TwoDigitYearMax">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AbbreviatedEraNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EraNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToFourDigitYear(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetWeekOfYear(System.DateTime, System.Globalization.CalendarWeekRule, System.DayOfWeek)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="rule">TODO</param>
- <param name="firstDayOfWeek">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSecond(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMinute(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMilliseconds(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHour(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddWeeks(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="weeks">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSeconds(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="seconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMinutes(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="minutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMilliseconds(System.DateTime, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddHours(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="hours">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddDays(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="days">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/CalendarWeekRule.xml b/mcs/docs/apidocs/xml/en/System.Globalization/CalendarWeekRule.xml
deleted file mode 100644
index 664ec5679a4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/CalendarWeekRule.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.CalendarWeekRule" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/CompareOptions.xml b/mcs/docs/apidocs/xml/en/System.Globalization/CompareOptions.xml
deleted file mode 100644
index 376dcf18f96..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/CompareOptions.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.CompareOptions" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/CultureInfo.xml b/mcs/docs/apidocs/xml/en/System.Globalization/CultureInfo.xml
deleted file mode 100644
index b4c0c72f9b9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/CultureInfo.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.CultureInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CultureInfo(System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- <param name="use_user_override">TODO</param>
- </constructor>
- <constructor name="CultureInfo(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- </constructor>
- <constructor name="CultureInfo(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="use_user_override">TODO</param>
- </constructor>
- <constructor name="CultureInfo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="InvariantCulture">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentCulture">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentUICulture">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LCID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Calendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNeutralCulture">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NumberFormat">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DateTimeFormat">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetFormat(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="formatType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateSpecificCulture(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/CultureTypes.xml b/mcs/docs/apidocs/xml/en/System.Globalization/CultureTypes.xml
deleted file mode 100644
index 46f502874f6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/CultureTypes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.CultureTypes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/DateTimeFormatInfo.xml b/mcs/docs/apidocs/xml/en/System.Globalization/DateTimeFormatInfo.xml
deleted file mode 100644
index 06066ed0cd2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/DateTimeFormatInfo.xml
+++ /dev/null
@@ -1,212 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.DateTimeFormatInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DateTimeFormatInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="theInvariantDateTimeFormatInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AbbreviatedDayNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AbbreviatedMonthNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DayNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MonthNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AMDesignator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PMDesignator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DateSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TimeSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LongDatePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShortDatePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShortTimePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LongTimePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MonthDayPattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="YearMonthPattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullDateTimePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InvariantInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FirstDayOfWeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Calendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CalendarWeekRule">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RFC1123Pattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SortableDateTimePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UniversalSortableDateTimePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetFormat(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="formatType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInstance(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadOnly(System.Globalization.DateTimeFormatInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dtfi">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAbbreviatedEraName(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAbbreviatedMonthName(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="month">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="eraName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEraName(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthName(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="month">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAllDateTimePatterns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetAllDateTimePatterns(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayName(System.DayOfWeek)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dayofweek">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAbbreviatedDayName(System.DayOfWeek)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dayofweek">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/DateTimeStyles.xml b/mcs/docs/apidocs/xml/en/System.Globalization/DateTimeStyles.xml
deleted file mode 100644
index fa9abdf7930..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/DateTimeStyles.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.DateTimeStyles" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/DaylightTime.xml b/mcs/docs/apidocs/xml/en/System.Globalization/DaylightTime.xml
deleted file mode 100644
index f0ae3190441..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/DaylightTime.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.DaylightTime" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DaylightTime(System.DateTime, System.DateTime, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="start">TODO</param>
- <param name="end">TODO</param>
- <param name="delta">TODO</param>
- </constructor>
- <property name="Start">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="End">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Delta">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendar.xml
deleted file mode 100644
index 47abf133fcf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendar.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.GregorianCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="GregorianCalendar(System.Globalization.GregorianCalendarTypes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- </constructor>
- <constructor name="GregorianCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="ADEra">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CalendarType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendarTypes.xml b/mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendarTypes.xml
deleted file mode 100644
index 79e0a20437c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/GregorianCalendarTypes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.GregorianCalendarTypes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/HebrewCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/HebrewCalendar.xml
deleted file mode 100644
index a9ffa3486d8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/HebrewCalendar.xml
+++ /dev/null
@@ -1,201 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.HebrewCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HebrewCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="HebrewEra">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="M_MaxYear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSecond(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMinute(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMilliseconds(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHour(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddWeeks(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="weeks">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSeconds(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="seconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMinutes(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="minutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMilliseconds(System.DateTime, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddHours(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="hours">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddDays(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="days">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/HijriCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/HijriCalendar.xml
deleted file mode 100644
index 2f6709e84ae..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/HijriCalendar.xml
+++ /dev/null
@@ -1,201 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.HijriCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HijriCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="HijriEra">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AddHijriDate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSecond(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMinute(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMilliseconds(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHour(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddWeeks(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="weeks">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSeconds(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="seconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMinutes(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="minutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMilliseconds(System.DateTime, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddHours(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="hours">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddDays(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="days">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/JapaneseCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/JapaneseCalendar.xml
deleted file mode 100644
index 3266f82be86..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/JapaneseCalendar.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.JapaneseCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="JapaneseCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToFourDigitYear(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSecond(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMinute(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMilliseconds(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHour(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddWeeks(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="weeks">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSeconds(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="seconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMinutes(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="minutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMilliseconds(System.DateTime, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddHours(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="hours">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddDays(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="days">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/JulianCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/JulianCalendar.xml
deleted file mode 100644
index 4728d1bc250..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/JulianCalendar.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.JulianCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="JulianCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="JulianEra">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/KoreanCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/KoreanCalendar.xml
deleted file mode 100644
index ea4a29f9804..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/KoreanCalendar.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.KoreanCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="KoreanCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="KoreanEra">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/Month.xml b/mcs/docs/apidocs/xml/en/System.Globalization/Month.xml
deleted file mode 100644
index b41a9cf3e8c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/Month.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.CCHijriCalendar+Month" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/NumberFormatInfo.xml b/mcs/docs/apidocs/xml/en/System.Globalization/NumberFormatInfo.xml
deleted file mode 100644
index 93fd76421fb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/NumberFormatInfo.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.NumberFormatInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NumberFormatInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CurrencyDecimalDigits">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrencyDecimalSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrencyGroupSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrencyGroupSizes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrencyNegativePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrencyPositivePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrencySymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InvariantInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NaNSymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NegativeInfinitySymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NegativeSign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NumberDecimalDigits">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NumberDecimalSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NumberGroupSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NumberGroupSizes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NumberNegativePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PercentDecimalDigits">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PercentDecimalSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PercentGroupSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PercentGroupSizes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PercentNegativePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PercentPositivePattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PercentSymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PerMilleSymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PositiveInfinitySymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PositiveSign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetFormat(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="formatType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadOnly(System.Globalization.NumberFormatInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nfi">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInstance(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/NumberStyles.xml b/mcs/docs/apidocs/xml/en/System.Globalization/NumberStyles.xml
deleted file mode 100644
index 63ca4e8dd1a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/NumberStyles.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.NumberStyles" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/RegionInfo.xml b/mcs/docs/apidocs/xml/en/System.Globalization/RegionInfo.xml
deleted file mode 100644
index 2fa311d7f37..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/RegionInfo.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.RegionInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RegionInfo(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- </constructor>
- <constructor name="RegionInfo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="CurrencySymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentRegion">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DisplayName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EnglishName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMetric">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ISOCurrencySymbol">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/TaiwanCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/TaiwanCalendar.xml
deleted file mode 100644
index d0fd2875971..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/TaiwanCalendar.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.TaiwanCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TaiwanCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToFourDigitYear(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSecond(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMinute(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMilliseconds(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHour(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddWeeks(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="weeks">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSeconds(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="seconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMinutes(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="minutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMilliseconds(System.DateTime, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="milliseconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddHours(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="hours">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddDays(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="days">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/ThaiBuddhistCalendar.xml b/mcs/docs/apidocs/xml/en/System.Globalization/ThaiBuddhistCalendar.xml
deleted file mode 100644
index 0531aaa8e1d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/ThaiBuddhistCalendar.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Globalization.ThaiBuddhistCalendar" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ThaiBuddhistCalendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="ThaiBuddhistEra">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Eras">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToDateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="milliseconds">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapDay(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonthsInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEra(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInYear(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaysInMonth(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="era">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfYear(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfWeek(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDayOfMonth(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.DateTime, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Globalization/UnicodeCategory.xml b/mcs/docs/apidocs/xml/en/System.Globalization/UnicodeCategory.xml
deleted file mode 100644
index 183f7478747..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Globalization/UnicodeCategory.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Globalization.UnicodeCategory" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.xml b/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.xml
deleted file mode 100644
index 4802a848f0d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IO.IsolatedStorage.INormalizeForIsolatedStorage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorage.xml b/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorage.xml
deleted file mode 100644
index cce0d682e0b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorage.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.IsolatedStorage.IsolatedStorage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="AssemblyIdentity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DomainIdentity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MaximumSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Scope">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SeparatorExternal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SeparatorInternal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Remove">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageException.xml b/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageException.xml
deleted file mode 100644
index 3eb3b6f7df5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.IsolatedStorage.IsolatedStorageException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IsolatedStorageException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="IsolatedStorageException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="IsolatedStorageException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageFileStream.xml b/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageFileStream.xml
deleted file mode 100644
index d766ed2ee11..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageFileStream.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.IsolatedStorage.IsolatedStorageFileStream" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IsolatedStorageFileStream(System.String, System.IO.FileMode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="mode">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageScope.xml b/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageScope.xml
deleted file mode 100644
index d8883cb005f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO.IsolatedStorage/IsolatedStorageScope.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.IO.IsolatedStorage.IsolatedStorageScope" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/BinaryReader.xml b/mcs/docs/apidocs/xml/en/System.IO/BinaryReader.xml
deleted file mode 100644
index b93ba0e3448..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/BinaryReader.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.BinaryReader" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BinaryReader(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- </constructor>
- <constructor name="BinaryReader(System.IO.Stream, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <property name="BaseStream">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadUInt64">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadUInt32">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadUInt16">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadSingle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadSByte">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadInt64">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadInt32">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadInt16">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadDouble">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadDecimal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadChars(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadBytes(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadByte">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadBoolean">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="PeekChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/BinaryWriter.xml b/mcs/docs/apidocs/xml/en/System.IO/BinaryWriter.xml
deleted file mode 100644
index 427201d6d3e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/BinaryWriter.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.BinaryWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BinaryWriter(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="output">TODO</param>
- </constructor>
- <constructor name="BinaryWriter(System.IO.Stream, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="output">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <field name="Null">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="BaseStream">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Seek(System.Int32, System.IO.SeekOrigin)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="origin">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/BufferedStream.xml b/mcs/docs/apidocs/xml/en/System.IO/BufferedStream.xml
deleted file mode 100644
index 82ed7514db7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/BufferedStream.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.BufferedStream" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BufferedStream(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- </constructor>
- <constructor name="BufferedStream(System.IO.Stream, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="buffer_size">TODO</param>
- </constructor>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanSeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteByte(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLength(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Seek(System.Int64, System.IO.SeekOrigin)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="origin">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadByte">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/Directory.xml b/mcs/docs/apidocs/xml/en/System.IO/Directory.xml
deleted file mode 100644
index 263548893f8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/Directory.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.Directory" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="CreateDirectory(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Delete(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Delete(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="recurse">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Exists(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLastAccessTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLastWriteTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCreationTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCurrentDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetDirectories(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDirectories(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDirectoryRoot(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFiles(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFiles(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFileSystemEntries(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFileSystemEntries(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLogicalDrives">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetParent(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Move(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="src">TODO</param>
- <param name="dest">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCreationTime(System.String, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="creation_time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCurrentDirectory(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLastAccessTime(System.String, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="last_access_time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLastWriteTime(System.String, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="last_write_time">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/DirectoryInfo.xml b/mcs/docs/apidocs/xml/en/System.IO/DirectoryInfo.xml
deleted file mode 100644
index 1458e89d9d1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/DirectoryInfo.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.DirectoryInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DirectoryInfo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- </constructor>
- <property name="Exists">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Root">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Delete">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateSubdirectory(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFiles">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFiles(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDirectories">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetDirectories(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFileSystemInfos">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFileSystemInfos(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Delete(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="recurse">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveTo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dest">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/DirectoryNotFoundException.xml b/mcs/docs/apidocs/xml/en/System.IO/DirectoryNotFoundException.xml
deleted file mode 100644
index 0a0a5e40678..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/DirectoryNotFoundException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.DirectoryNotFoundException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DirectoryNotFoundException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DirectoryNotFoundException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="DirectoryNotFoundException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/EndOfStreamException.xml b/mcs/docs/apidocs/xml/en/System.IO/EndOfStreamException.xml
deleted file mode 100644
index 4f98bedfca8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/EndOfStreamException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.EndOfStreamException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EndOfStreamException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="EndOfStreamException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="EndOfStreamException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/File.xml b/mcs/docs/apidocs/xml/en/System.IO/File.xml
deleted file mode 100644
index 65a57e3f0b0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/File.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.File" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="AppendText(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sourceFilename">TODO</param>
- <param name="destFilename">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="src">TODO</param>
- <param name="dest">TODO</param>
- <param name="overwrite">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="buffersize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Delete(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Exists(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttributes(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCreationTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLastAccessTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLastWriteTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Move(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="src">TODO</param>
- <param name="dest">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Open(System.String, System.IO.FileMode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="mode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Open(System.String, System.IO.FileMode, System.IO.FileAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Open(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- <param name="share">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="OpenRead(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="OpenText(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="OpenWrite(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetAttributes(System.String, System.IO.FileAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="attributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCreationTime(System.String, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="creation_time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLastAccessTime(System.String, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="last_access_time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLastWriteTime(System.String, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="last_write_time">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileAccess.xml b/mcs/docs/apidocs/xml/en/System.IO/FileAccess.xml
deleted file mode 100644
index e3bb30c1902..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileAccess.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.IO.FileAccess" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileAttributes.xml b/mcs/docs/apidocs/xml/en/System.IO/FileAttributes.xml
deleted file mode 100644
index db7bdb6b53e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.IO.FileAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileInfo.xml b/mcs/docs/apidocs/xml/en/System.IO/FileInfo.xml
deleted file mode 100644
index 161ebdc2d51..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileInfo.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.FileInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileInfo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- </constructor>
- <property name="Exists">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DirectoryName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Directory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Delete">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="OpenText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AppendText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="OpenRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="OpenWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Open(System.IO.FileMode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Open(System.IO.FileMode, System.IO.FileAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Open(System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- <param name="share">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveTo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dest">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="overwrite">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileLoadException.xml b/mcs/docs/apidocs/xml/en/System.IO/FileLoadException.xml
deleted file mode 100644
index 5a1328cecea..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileLoadException.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.FileLoadException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileLoadException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="FileLoadException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="FileLoadException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FusionLog">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileMode.xml b/mcs/docs/apidocs/xml/en/System.IO/FileMode.xml
deleted file mode 100644
index 58ccd2f9ccf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.IO.FileMode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileNotFoundException.xml b/mcs/docs/apidocs/xml/en/System.IO/FileNotFoundException.xml
deleted file mode 100644
index 1c1129ea7ed..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileNotFoundException.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.FileNotFoundException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileNotFoundException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="FileNotFoundException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="FileNotFoundException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="FileNotFoundException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="fileName">TODO</param>
- </constructor>
- <constructor name="FileNotFoundException(System.String, System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="fileName">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- <property name="FileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FusionLog">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileShare.xml b/mcs/docs/apidocs/xml/en/System.IO/FileShare.xml
deleted file mode 100644
index 253ff07e320..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileShare.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.IO.FileShare" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileStream.xml b/mcs/docs/apidocs/xml/en/System.IO/FileStream.xml
deleted file mode 100644
index 7d429a0df74..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileStream.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.FileStream" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileStream(System.IntPtr, System.IO.FileAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="handle">TODO</param>
- <param name="access">TODO</param>
- </constructor>
- <constructor name="FileStream(System.IntPtr, System.IO.FileAccess, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="handle">TODO</param>
- <param name="access">TODO</param>
- <param name="ownsHandle">TODO</param>
- </constructor>
- <constructor name="FileStream(System.IntPtr, System.IO.FileAccess, System.Boolean, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="handle">TODO</param>
- <param name="access">TODO</param>
- <param name="ownsHandle">TODO</param>
- <param name="bufferSize">TODO</param>
- </constructor>
- <constructor name="FileStream(System.IntPtr, System.IO.FileAccess, System.Boolean, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="handle">TODO</param>
- <param name="access">TODO</param>
- <param name="ownsHandle">TODO</param>
- <param name="bufferSize">TODO</param>
- <param name="isAsync">TODO</param>
- </constructor>
- <constructor name="FileStream(System.String, System.IO.FileMode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="mode">TODO</param>
- </constructor>
- <constructor name="FileStream(System.String, System.IO.FileMode, System.IO.FileAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- </constructor>
- <constructor name="FileStream(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- <param name="share">TODO</param>
- </constructor>
- <constructor name="FileStream(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- <param name="share">TODO</param>
- <param name="bufferSize">TODO</param>
- </constructor>
- <constructor name="FileStream(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="mode">TODO</param>
- <param name="access">TODO</param>
- <param name="share">TODO</param>
- <param name="bufferSize">TODO</param>
- <param name="isAsync">TODO</param>
- </constructor>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanSeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Handle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteByte(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="src">TODO</param>
- <param name="src_offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLength(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Seek(System.Int64, System.IO.SeekOrigin)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="origin">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadByte">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dest">TODO</param>
- <param name="dest_offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/FileSystemInfo.xml b/mcs/docs/apidocs/xml/en/System.IO/FileSystemInfo.xml
deleted file mode 100644
index f8e78d87eab..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/FileSystemInfo.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.FileSystemInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Exists">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Extension">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CreationTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LastAccessTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LastWriteTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Delete">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Refresh">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/IOException.xml b/mcs/docs/apidocs/xml/en/System.IO/IOException.xml
deleted file mode 100644
index 9b808f609f1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/IOException.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.IOException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IOException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="IOException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="IOException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="IOException(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="hresult">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/MemoryStream.xml b/mcs/docs/apidocs/xml/en/System.IO/MemoryStream.xml
deleted file mode 100644
index bb28a2f2b5e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/MemoryStream.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.MemoryStream" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MemoryStream">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MemoryStream(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- </constructor>
- <constructor name="MemoryStream(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- </constructor>
- <constructor name="MemoryStream(System.Byte[], System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="writeable">TODO</param>
- </constructor>
- <constructor name="MemoryStream(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- </constructor>
- <constructor name="MemoryStream(System.Byte[], System.Int32, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <param name="writeable">TODO</param>
- </constructor>
- <constructor name="MemoryStream(System.Byte[], System.Int32, System.Int32, System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <param name="writeable">TODO</param>
- <param name="publicallyVisible">TODO</param>
- </constructor>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanSeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Capacity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetBuffer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteByte(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLength(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Seek(System.Int64, System.IO.SeekOrigin)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="loc">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadByte">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/Path.xml b/mcs/docs/apidocs/xml/en/System.IO/Path.xml
deleted file mode 100644
index 5c8cceb292c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/Path.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.Path" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="AltDirectorySeparatorChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="DirectorySeparatorChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="InvalidPathChars">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="PathSeparator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="VolumeSeparatorChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ChangeExtension(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="extension">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Combine(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path1">TODO</param>
- <param name="path2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDirectoryName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetExtension(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFileName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFileNameWithoutExtension(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFullPath(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetPathRoot(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTempFileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetTempPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="HasExtension(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsPathRooted(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/PathTooLongException.xml b/mcs/docs/apidocs/xml/en/System.IO/PathTooLongException.xml
deleted file mode 100644
index 1741279772d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/PathTooLongException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.PathTooLongException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PathTooLongException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="PathTooLongException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="PathTooLongException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/SeekOrigin.xml b/mcs/docs/apidocs/xml/en/System.IO/SeekOrigin.xml
deleted file mode 100644
index bb813b853a0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/SeekOrigin.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.IO.SeekOrigin" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/Stream.xml b/mcs/docs/apidocs/xml/en/System.IO/Stream.xml
deleted file mode 100644
index bf097c21b55..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/Stream.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.Stream" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Null">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanSeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="EndWrite(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="async_result">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndRead(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="async_result">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginWrite(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <param name="cback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginRead(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <param name="cback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteByte(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLength(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Seek(System.Int64, System.IO.SeekOrigin)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="origin">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadByte">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/StreamReader.xml b/mcs/docs/apidocs/xml/en/System.IO/StreamReader.xml
deleted file mode 100644
index 8d33e6decc9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/StreamReader.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.StreamReader" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StreamReader(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.IO.Stream, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="detectEncodingFromByteOrderMarks">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.IO.Stream, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.IO.Stream, System.Text.Encoding, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="encoding">TODO</param>
- <param name="detectEncodingFromByteOrderMarks">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.IO.Stream, System.Text.Encoding, System.Boolean, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="encoding">TODO</param>
- <param name="detectEncodingFromByteOrderMarks">TODO</param>
- <param name="bufferSize">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="detectEncodingFromByteOrderMarks">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.String, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.String, System.Text.Encoding, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="encoding">TODO</param>
- <param name="detectEncodingFromByteOrderMarks">TODO</param>
- </constructor>
- <constructor name="StreamReader(System.String, System.Text.Encoding, System.Boolean, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="encoding">TODO</param>
- <param name="detectEncodingFromByteOrderMarks">TODO</param>
- <param name="bufferSize">TODO</param>
- </constructor>
- <field name="Null">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="BaseStream">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentEncoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ReadToEnd">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dest_buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Peek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="DiscardBufferedData">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/StreamWriter.xml b/mcs/docs/apidocs/xml/en/System.IO/StreamWriter.xml
deleted file mode 100644
index 880ddd36a97..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/StreamWriter.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.StreamWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StreamWriter(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- </constructor>
- <constructor name="StreamWriter(System.IO.Stream, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <constructor name="StreamWriter(System.IO.Stream, System.Text.Encoding, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="encoding">TODO</param>
- <param name="bufferSize">TODO</param>
- </constructor>
- <constructor name="StreamWriter(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- </constructor>
- <constructor name="StreamWriter(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="append">TODO</param>
- </constructor>
- <constructor name="StreamWriter(System.String, System.Boolean, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="append">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <constructor name="StreamWriter(System.String, System.Boolean, System.Text.Encoding, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="append">TODO</param>
- <param name="encoding">TODO</param>
- <param name="bufferSize">TODO</param>
- </constructor>
- <property name="AutoFlush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseStream">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Write(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/StringReader.xml b/mcs/docs/apidocs/xml/en/System.IO/StringReader.xml
deleted file mode 100644
index 60a19b61ee9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/StringReader.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.StringReader" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StringReader(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- </constructor>
- <method name="ReadToEnd">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Peek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/StringWriter.xml b/mcs/docs/apidocs/xml/en/System.IO/StringWriter.xml
deleted file mode 100644
index cd1d33ace1b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/StringWriter.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.StringWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StringWriter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="StringWriter(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="formatProvider">TODO</param>
- </constructor>
- <constructor name="StringWriter(System.Text.StringBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sb">TODO</param>
- </constructor>
- <constructor name="StringWriter(System.Text.StringBuilder, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sb">TODO</param>
- <param name="formatProvider">TODO</param>
- </constructor>
- <property name="Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetStringBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/TextReader.xml b/mcs/docs/apidocs/xml/en/System.IO/TextReader.xml
deleted file mode 100644
index b20ccb2b4cd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/TextReader.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.TextReader" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Null">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ReadToEnd">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadBlock(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Peek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Synchronised(System.IO.TextReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="reader">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.IO/TextWriter.xml b/mcs/docs/apidocs/xml/en/System.IO/TextWriter.xml
deleted file mode 100644
index f35eb655cec..00000000000
--- a/mcs/docs/apidocs/xml/en/System.IO/TextWriter.xml
+++ /dev/null
@@ -1,270 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IO.TextWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Null">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FormatProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NewLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteLine(System.String, System.Object, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <param name="arg2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <param name="arg2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Synchronised(System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/AddressFamily.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/AddressFamily.xml
deleted file mode 100644
index 4e18c966b06..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/AddressFamily.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.AddressFamily" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/LingerOption.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/LingerOption.xml
deleted file mode 100644
index c5b2191bac4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/LingerOption.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Sockets.LingerOption" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LingerOption(System.Boolean, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="enable">TODO</param>
- <param name="secs">TODO</param>
- </constructor>
- <property name="Enabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LingerTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/MulticastOption.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/MulticastOption.xml
deleted file mode 100644
index 489e8403e2a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/MulticastOption.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Sockets.MulticastOption" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MulticastOption(System.Net.IPAddress)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="grp">TODO</param>
- </constructor>
- <constructor name="MulticastOption(System.Net.IPAddress, System.Net.IPAddress)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="grp">TODO</param>
- <param name="addr">TODO</param>
- </constructor>
- <property name="Group">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalAddress">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/NetworkStream.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/NetworkStream.xml
deleted file mode 100644
index 895a52e7640..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/NetworkStream.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Sockets.NetworkStream" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NetworkStream(System.Net.Sockets.Socket)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="socket">TODO</param>
- </constructor>
- <constructor name="NetworkStream(System.Net.Sockets.Socket, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="socket">TODO</param>
- <param name="owns_socket">TODO</param>
- </constructor>
- <constructor name="NetworkStream(System.Net.Sockets.Socket, System.IO.FileAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="socket">TODO</param>
- <param name="access">TODO</param>
- </constructor>
- <constructor name="NetworkStream(System.Net.Sockets.Socket, System.IO.FileAccess, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="socket">TODO</param>
- <param name="access">TODO</param>
- <param name="owns_socket">TODO</param>
- </constructor>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanSeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataAvailable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Readable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Socket">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Writeable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Write(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLength(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Seek(System.Int64, System.IO.SeekOrigin)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="origin">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndWrite(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginWrite(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndRead(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginRead(System.Byte[], System.Int32, System.Int32, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolFamily.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolFamily.xml
deleted file mode 100644
index 19a8603779f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolFamily.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.ProtocolFamily" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolType.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolType.xml
deleted file mode 100644
index da33090e437..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/ProtocolType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.ProtocolType" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SelectMode.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/SelectMode.xml
deleted file mode 100644
index 273faae5544..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SelectMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.SelectMode" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/Socket.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/Socket.xml
deleted file mode 100644
index 48d79259ec7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/Socket.xml
+++ /dev/null
@@ -1,396 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Sockets.Socket" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Socket(System.Net.Sockets.AddressFamily, System.Net.Sockets.SocketType, System.Net.Sockets.ProtocolType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="family">TODO</param>
- <param name="type">TODO</param>
- <param name="proto">TODO</param>
- </constructor>
- <property name="AddressFamily">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Available">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Blocking">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Connected">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Handle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalEndPoint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProtocolType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RemoteEndPoint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SocketType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Select(System.Collections.IList, System.Collections.IList, System.Collections.IList, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="read_list">TODO</param>
- <param name="write_list">TODO</param>
- <param name="err_list">TODO</param>
- <param name="time_us">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Accept">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="BeginAccept(System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginConnect(System.Net.EndPoint, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="end_point">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginReceive(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="socket_flags">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginReceiveFrom(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags, System.Net.EndPoint&amp;, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="socket_flags">TODO</param>
- <param name="remote_end">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginSend(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="socket_flags">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginSendTo(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags, System.Net.EndPoint, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="socket_flags">TODO</param>
- <param name="remote_end">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Bind(System.Net.EndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="local_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Connect(System.Net.EndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndAccept(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="result">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndConnect(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="result">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndReceive(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="result">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndReceiveFrom(System.IAsyncResult, System.Net.EndPoint&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="result">TODO</param>
- <param name="end_point">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndSend(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="result">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndSendTo(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="result">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <param name="name">TODO</param>
- <param name="opt_value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <param name="name">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IOControl(System.Int32, System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ioctl_code">TODO</param>
- <param name="in_value">TODO</param>
- <param name="out_value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Listen(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="backlog">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Poll(System.Int32, System.Net.Sockets.SelectMode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time_us">TODO</param>
- <param name="mode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Receive(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Receive(System.Byte[], System.Net.Sockets.SocketFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="flags">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Receive(System.Byte[], System.Int32, System.Net.Sockets.SocketFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Receive(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReceiveFrom(System.Byte[], System.Net.EndPoint&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReceiveFrom(System.Byte[], System.Net.Sockets.SocketFlags, System.Net.EndPoint&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="flags">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReceiveFrom(System.Byte[], System.Int32, System.Net.Sockets.SocketFlags, System.Net.EndPoint&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReceiveFrom(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags, System.Net.EndPoint&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Send(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Send(System.Byte[], System.Net.Sockets.SocketFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="flags">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Send(System.Byte[], System.Int32, System.Net.Sockets.SocketFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Send(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buf">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SendTo(System.Byte[], System.Net.EndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SendTo(System.Byte[], System.Net.Sockets.SocketFlags, System.Net.EndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="flags">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SendTo(System.Byte[], System.Int32, System.Net.Sockets.SocketFlags, System.Net.EndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SendTo(System.Byte[], System.Int32, System.Int32, System.Net.Sockets.SocketFlags, System.Net.EndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="size">TODO</param>
- <param name="flags">TODO</param>
- <param name="remote_end">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <param name="name">TODO</param>
- <param name="opt_value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <param name="name">TODO</param>
- <param name="opt_value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <param name="name">TODO</param>
- <param name="opt_value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Shutdown(System.Net.Sockets.SocketShutdown)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="how">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketException.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketException.xml
deleted file mode 100644
index fa82470f5f3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketException.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Sockets.SocketException" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SocketException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="SocketException(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="error">TODO</param>
- </constructor>
- <property name="ErrorCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketFlags.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketFlags.xml
deleted file mode 100644
index 96397cb2661..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketFlags.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.SocketFlags" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionLevel.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionLevel.xml
deleted file mode 100644
index 94711691826..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionLevel.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.SocketOptionLevel" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionName.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionName.xml
deleted file mode 100644
index 6904c8d9883..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketOptionName.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.SocketOptionName" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketShutdown.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketShutdown.xml
deleted file mode 100644
index ba09ba7e49c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketShutdown.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.SocketShutdown" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketType.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketType.xml
deleted file mode 100644
index fd2f1e36280..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/SocketType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.Sockets.SocketType" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpClient.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpClient.xml
deleted file mode 100644
index 24e8bd7872e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpClient.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Sockets.TcpClient" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TcpClient">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TcpClient(System.Net.IPEndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="local_end_point">TODO</param>
- </constructor>
- <constructor name="TcpClient(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hostname">TODO</param>
- <param name="port">TODO</param>
- </constructor>
- <property name="Active">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Client">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LingerState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NoDelay">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReceiveBufferSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReceiveTimeout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SendBufferSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SendTimeout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Connect(System.Net.IPEndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="remote_end_point">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Connect(System.Net.IPAddress, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="address">TODO</param>
- <param name="port">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Connect(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hostname">TODO</param>
- <param name="port">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetStream">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpListener.xml b/mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpListener.xml
deleted file mode 100644
index 0479294751b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net.Sockets/TcpListener.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Sockets.TcpListener" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TcpListener(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="port">TODO</param>
- </constructor>
- <constructor name="TcpListener(System.Net.IPEndPoint)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="local_end_point">TODO</param>
- </constructor>
- <constructor name="TcpListener(System.Net.IPAddress, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="listen_ip">TODO</param>
- <param name="port">TODO</param>
- </constructor>
- <property name="Active">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalEndPoint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Server">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="AcceptSocket">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AcceptTcpClient">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Pending">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Start">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Stop">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/Authorization.xml b/mcs/docs/apidocs/xml/en/System.Net/Authorization.xml
deleted file mode 100644
index ebe5779fecf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/Authorization.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Authorization" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Authorization(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="token">TODO</param>
- </constructor>
- <constructor name="Authorization(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="token">TODO</param>
- <param name="complete">TODO</param>
- </constructor>
- <property name="Complete">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/ConnectionModes.xml b/mcs/docs/apidocs/xml/en/System.Net/ConnectionModes.xml
deleted file mode 100644
index df03b257adf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/ConnectionModes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.ConnectionModes" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/Dns.xml b/mcs/docs/apidocs/xml/en/System.Net/Dns.xml
deleted file mode 100644
index ad2e6c6eac2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/Dns.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.Dns" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="BeginGetHostByName(System.String, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hostName">TODO</param>
- <param name="requestCallback">TODO</param>
- <param name="stateObject">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginResolve(System.String, System.AsyncCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hostName">TODO</param>
- <param name="requestCallback">TODO</param>
- <param name="stateObject">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndGetHostByName(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="asyncResult">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndResolve(System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="asyncResult">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHostByAddress(System.Net.IPAddress)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="address">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHostByAddress(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="address">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHostByName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hostName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHostName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Resolve(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hostName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/EndPoint.xml b/mcs/docs/apidocs/xml/en/System.Net/EndPoint.xml
deleted file mode 100644
index 05ac52e956d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/EndPoint.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.EndPoint" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="AddressFamily">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Serialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.Net.SocketAddress)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="address">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/HttpStatusCode.xml b/mcs/docs/apidocs/xml/en/System.Net/HttpStatusCode.xml
deleted file mode 100644
index 6c39c57bfe8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/HttpStatusCode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.HttpStatusCode" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/ICredentials.xml b/mcs/docs/apidocs/xml/en/System.Net/ICredentials.xml
deleted file mode 100644
index d1609e6556b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/ICredentials.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Net.ICredentials" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/IPAddress.xml b/mcs/docs/apidocs/xml/en/System.Net/IPAddress.xml
deleted file mode 100644
index 73a7c90ea60..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/IPAddress.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.IPAddress" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IPAddress(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="addr">TODO</param>
- </constructor>
- <field name="Any">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Broadcast">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Loopback">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="None">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Address">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AddressFamily">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="HostToNetworkOrder(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="host">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HostToNetworkOrder(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="host">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HostToNetworkOrder(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="host">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NetworkToHostOrder(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="network">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NetworkToHostOrder(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="network">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NetworkToHostOrder(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="network">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ip">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLoopback(System.Net.IPAddress)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="addr">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/IPEndPoint.xml b/mcs/docs/apidocs/xml/en/System.Net/IPEndPoint.xml
deleted file mode 100644
index 5f50096899f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/IPEndPoint.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.IPEndPoint" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IPEndPoint(System.Net.IPAddress, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="address">TODO</param>
- <param name="port">TODO</param>
- </constructor>
- <constructor name="IPEndPoint(System.Int64, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="iaddr">TODO</param>
- <param name="port">TODO</param>
- </constructor>
- <field name="MaxPort">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinPort">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Address">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AddressFamily">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Port">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Serialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.Net.SocketAddress)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sockaddr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/IPHostEntry.xml b/mcs/docs/apidocs/xml/en/System.Net/IPHostEntry.xml
deleted file mode 100644
index a5e918b5306..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/IPHostEntry.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.IPHostEntry" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IPHostEntry">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AddressList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Aliases">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HostName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/NetworkAccess.xml b/mcs/docs/apidocs/xml/en/System.Net/NetworkAccess.xml
deleted file mode 100644
index 988e5817574..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/NetworkAccess.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.NetworkAccess" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/NetworkCredential.xml b/mcs/docs/apidocs/xml/en/System.Net/NetworkCredential.xml
deleted file mode 100644
index ff3e0ca2dce..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/NetworkCredential.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.NetworkCredential" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NetworkCredential">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="NetworkCredential(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="userName">TODO</param>
- <param name="password">TODO</param>
- </constructor>
- <constructor name="NetworkCredential(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="userName">TODO</param>
- <param name="password">TODO</param>
- <param name="domain">TODO</param>
- </constructor>
- <property name="Domain">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Password">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetCredential(System.Uri, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="uri">TODO</param>
- <param name="authType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/ProxyUseType.xml b/mcs/docs/apidocs/xml/en/System.Net/ProxyUseType.xml
deleted file mode 100644
index 62ce163226e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/ProxyUseType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.ProxyUseType" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/SocketAddress.xml b/mcs/docs/apidocs/xml/en/System.Net/SocketAddress.xml
deleted file mode 100644
index 7b47eea3484..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/SocketAddress.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Net.SocketAddress" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SocketAddress(System.Net.Sockets.AddressFamily, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="family">TODO</param>
- <param name="size">TODO</param>
- </constructor>
- <constructor name="SocketAddress(System.Net.Sockets.AddressFamily)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="family">TODO</param>
- </constructor>
- <property name="Family">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/TransportType.xml b/mcs/docs/apidocs/xml/en/System.Net/TransportType.xml
deleted file mode 100644
index cd8d90deda7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/TransportType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.TransportType" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/WebExceptionStatus.xml b/mcs/docs/apidocs/xml/en/System.Net/WebExceptionStatus.xml
deleted file mode 100644
index c0b358699ab..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/WebExceptionStatus.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.WebExceptionStatus" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Net/WebStatus.xml b/mcs/docs/apidocs/xml/en/System.Net/WebStatus.xml
deleted file mode 100644
index 257242f549d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Net/WebStatus.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Net.WebStatus" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilder.xml
deleted file mode 100644
index c2e3c7eaeab..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilder.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.AssemblyBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="CodeBase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EntryPoint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Location">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetExportedTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFile(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddResourceFile(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="fileName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddResourceFile(System.String, System.String, System.Reflection.ResourceAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="fileName">TODO</param>
- <param name="attribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicModule(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicModule(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="emitSymbolInfo">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicModule(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="fileName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicModule(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="fileName">TODO</param>
- <param name="emitSymbolInfo">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineResource(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="description">TODO</param>
- <param name="fileName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineResource(System.String, System.String, System.String, System.Reflection.ResourceAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="description">TODO</param>
- <param name="fileName">TODO</param>
- <param name="attribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineUnmanagedResource(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="resource">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineUnmanagedResource(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="resourceFileName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineVersionInfoResource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="DefineVersionInfoResource(System.String, System.String, System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="product">TODO</param>
- <param name="productVersion">TODO</param>
- <param name="company">TODO</param>
- <param name="copyright">TODO</param>
- <param name="trademark">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDynamicModule(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Save(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyFileName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetEntryPoint(System.Reflection.MethodInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="entryMethod">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetEntryPoint(System.Reflection.MethodInfo, System.Reflection.Emit.PEFileKinds)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="entryMethod">TODO</param>
- <param name="fileKind">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilderAccess.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilderAccess.xml
deleted file mode 100644
index 75b595e4c4b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/AssemblyBuilderAccess.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.Emit.AssemblyBuilderAccess" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ConstructorBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ConstructorBuilder.xml
deleted file mode 100644
index c457c2ac8f1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ConstructorBuilder.xml
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.ConstructorBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="TypeBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MethodHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Signature">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InitLocals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Invoke(System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="parameters">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="parameters">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetParameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMethodImplementationFlags">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddDeclarativeSecurity(System.Security.Permissions.SecurityAction, System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- <param name="pset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineParameter(System.Int32, System.Reflection.ParameterAttributes, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="iSequence">TODO</param>
- <param name="attributes">TODO</param>
- <param name="strParamName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetILGenerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetILGenerator(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="size">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetImplementationFlags(System.Reflection.MethodImplAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetModule">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetSymCustomAttribute(System.String, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/CustomAttributeBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/CustomAttributeBuilder.xml
deleted file mode 100644
index 6e20c63d239..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/CustomAttributeBuilder.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.CustomAttributeBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CustomAttributeBuilder(System.Reflection.ConstructorInfo, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="constructorArgs">TODO</param>
- </constructor>
- <constructor name="CustomAttributeBuilder(System.Reflection.ConstructorInfo, System.Object[], System.Reflection.FieldInfo[], System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="constructorArgs">TODO</param>
- <param name="namedFields">TODO</param>
- <param name="fieldValues">TODO</param>
- </constructor>
- <constructor name="CustomAttributeBuilder(System.Reflection.ConstructorInfo, System.Object[], System.Reflection.PropertyInfo[], System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="constructorArgs">TODO</param>
- <param name="namedProperties">TODO</param>
- <param name="propertyValues">TODO</param>
- </constructor>
- <constructor name="CustomAttributeBuilder(System.Reflection.ConstructorInfo, System.Object[], System.Reflection.PropertyInfo[], System.Object[], System.Reflection.FieldInfo[], System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="constructorArgs">TODO</param>
- <param name="namedProperties">TODO</param>
- <param name="propertyValues">TODO</param>
- <param name="namedFields">TODO</param>
- <param name="fieldValues">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EnumBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EnumBuilder.xml
deleted file mode 100644
index 5ff112c663f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EnumBuilder.xml
+++ /dev/null
@@ -1,240 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.EnumBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Assembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AssemblyQualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GUID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Module">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnderlyingField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnderlyingSystemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InvokeMember(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object, System.Object[], System.Reflection.ParameterModifier[], System.Globalization.CultureInfo, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="target">TODO</param>
- <param name="args">TODO</param>
- <param name="modifiers">TODO</param>
- <param name="culture">TODO</param>
- <param name="namedParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperties(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethods(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMembers(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFields(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetField(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructors(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedTypes(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedType(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMember(System.String, System.Reflection.MemberTypes, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="type">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvents(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvents">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEvent(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInterfaces">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInterfaceMap(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="interfaceType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInterface(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="DefineLiteral(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="literalName">TODO</param>
- <param name="literalValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventBuilder.xml
deleted file mode 100644
index b543eeb814d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventBuilder.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.EventBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="AddOtherMethod(System.Reflection.Emit.MethodBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mdBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEventToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetAddOnMethod(System.Reflection.Emit.MethodBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mdBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetRaiseMethod(System.Reflection.Emit.MethodBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mdBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetRemoveOnMethod(System.Reflection.Emit.MethodBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mdBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventToken.xml
deleted file mode 100644
index 0e1960e45cf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/EventToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.EventToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldBuilder.xml
deleted file mode 100644
index 58e4b3a3273..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldBuilder.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.FieldBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FieldHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FieldType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetValue(System.Object, System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="val">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetConstant(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="defaultValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetMarshal(System.Reflection.Emit.UnmanagedMarshal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="unmanagedMarshal">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetOffset(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="iOffset">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldToken.xml
deleted file mode 100644
index 8e8225055bc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FieldToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.FieldToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FlowControl.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FlowControl.xml
deleted file mode 100644
index f40afcadc08..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/FlowControl.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.Emit.FlowControl" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ILGenerator.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ILGenerator.xml
deleted file mode 100644
index 9d3b7a454aa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ILGenerator.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.ILGenerator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="UsingNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="usingNamespace">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ThrowException(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="exceptionType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MarkSequencePoint(System.Diagnostics.SymbolStore.ISymbolDocumentWriter, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="document">TODO</param>
- <param name="startLine">TODO</param>
- <param name="startColumn">TODO</param>
- <param name="endLine">TODO</param>
- <param name="endColumn">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MarkLabel(System.Reflection.Emit.Label)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="loc">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndScope">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="EndExceptionBlock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="EmitWriteLine(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EmitWriteLine(System.Reflection.Emit.LocalBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lbuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EmitWriteLine(System.Reflection.FieldInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="field">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Reflection.Emit.SignatureHelper)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="shelper">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Reflection.MethodInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="method">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Reflection.Emit.LocalBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="lbuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Reflection.Emit.Label[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="labels">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Reflection.Emit.Label)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="label">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Reflection.FieldInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="field">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Reflection.ConstructorInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="constructor">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Emit(System.Reflection.Emit.OpCode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineLabel">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="DeclareLocal(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BeginScope">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="BeginFinallyBlock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="BeginFaultBlock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="BeginExceptionBlock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="BeginExceptFilterBlock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="BeginCatchBlock(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="exceptionType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EmitCall(System.Reflection.Emit.OpCode, System.Reflection.MethodInfo, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="methodinfo">TODO</param>
- <param name="optionalParamTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EmitCalli(System.Reflection.Emit.OpCode, System.Reflection.CallingConventions, System.Type, System.Type[], System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="opcode">TODO</param>
- <param name="call_conv">TODO</param>
- <param name="returnType">TODO</param>
- <param name="paramTypes">TODO</param>
- <param name="optionalParamTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/Label.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/Label.xml
deleted file mode 100644
index b74c4625cbe..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/Label.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.Label" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/LocalBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/LocalBuilder.xml
deleted file mode 100644
index 9509fc3d3e5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/LocalBuilder.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.LocalBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="LocalType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetLocalSymInfo(System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lname">TODO</param>
- <param name="startOffset">TODO</param>
- <param name="endOffset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLocalSymInfo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lname">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodBuilder.xml
deleted file mode 100644
index 9aad40e60d4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodBuilder.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.MethodBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="TypeBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MethodHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnTypeCustomAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetBaseDefinition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="parameters">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetParameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMethodImplementationFlags">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateMethodBody(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="il">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetILGenerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetILGenerator(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="size">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineParameter(System.Int32, System.Reflection.ParameterAttributes, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="position">TODO</param>
- <param name="attributes">TODO</param>
- <param name="strParamName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetImplementationFlags(System.Reflection.MethodImplAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributes">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodToken.xml
deleted file mode 100644
index e1b32b43cae..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/MethodToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.MethodToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ModuleBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ModuleBuilder.xml
deleted file mode 100644
index 1e82dc25201..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ModuleBuilder.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.ModuleBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="FullyQualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetType(System.String, System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <param name="throwOnError">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineType(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineType(System.String, System.Reflection.TypeAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineType(System.String, System.Reflection.TypeAttributes, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineType(System.String, System.Reflection.TypeAttributes, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="interfaces">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineType(System.String, System.Reflection.TypeAttributes, System.Type, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="typesize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineType(System.String, System.Reflection.TypeAttributes, System.Type, System.Reflection.Emit.PackingSize)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="packsize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineType(System.String, System.Reflection.TypeAttributes, System.Type, System.Reflection.Emit.PackingSize, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="packsize">TODO</param>
- <param name="typesize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetArrayMethod(System.Type, System.String, System.Reflection.CallingConventions, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="arrayClass">TODO</param>
- <param name="methodName">TODO</param>
- <param name="callingConvention">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineEnum(System.String, System.Reflection.TypeAttributes, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="visibility">TODO</param>
- <param name="underlyingType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSymWriter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCode.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCode.xml
deleted file mode 100644
index 6f7e1899907..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCode.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.OpCode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OpCodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OperandType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FlowControl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StackBehaviourPop">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StackBehaviourPush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodeType.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodeType.xml
deleted file mode 100644
index 7f4f406ae8b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodeType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.Emit.OpCodeType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodes.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodes.xml
deleted file mode 100644
index 073b8d5bb00..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OpCodes.xml
+++ /dev/null
@@ -1,906 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.OpCodes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="OpCodes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="Add">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Add_Ovf">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Add_Ovf_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="And">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Arglist">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Beq">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Beq_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bge">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bge_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bge_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bge_Un_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bgt">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bgt_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bgt_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bgt_Un_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ble">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ble_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ble_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ble_Un_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Blt">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Blt_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Blt_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Blt_Un_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bne_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Bne_Un_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Box">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Boxval">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Br">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Br_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Break">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Brfalse">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Brfalse_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Brtrue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Brtrue_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Call">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Calli">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Callvirt">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Castclass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ceq">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Cgt">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Cgt_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ckfinite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Clt">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Clt_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_I">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_I1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_I2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_I4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_I8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I1_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I2_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I4_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_I8_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U1_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U2_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U4_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_Ovf_U8_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_R_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_R4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_R8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_U">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_U1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_U2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_U4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Conv_U8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Cpblk">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Cpobj">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Div">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Div_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Dup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Endfilter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Endfinally">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Initblk">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Initobj">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Isinst">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Jmp">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarg">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarg_0">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarg_1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarg_2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarg_3">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarg_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarga">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldarga_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_0">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_3">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_5">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_6">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_7">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_M1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I4_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_I8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_R4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldc_R8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_I">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_I1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_I2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_I4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_I8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_R4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_R8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_Ref">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_U1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_U2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelem_U4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldelema">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldfld">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldflda">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldftn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_I">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_I1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_I2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_I4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_I8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_R4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_R8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_Ref">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_U1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_U2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldind_U4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldlen">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloc">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloc_0">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloc_1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloc_2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloc_3">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloc_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloca">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldloca_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldnull">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldobj">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldsfld">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldsflda">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldstr">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldtoken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ldvirtftn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Leave">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Leave_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Localloc">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Mkrefany">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Mul">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Mul_Ovf">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Mul_Ovf_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Neg">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Newarr">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Newobj">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Nop">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Not">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Or">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Pop">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefix1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefix2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefix3">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefix4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefix5">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefix6">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefix7">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Prefixref">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Refanytype">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Refanyval">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Rem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Rem_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Ret">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Rethrow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Shl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Shr">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Shr_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Sizeof">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Starg">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Starg_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_I">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_I1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_I2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_I4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_I8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_R4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_R8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stelem_Ref">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stfld">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_I">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_I1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_I2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_I4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_I8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_R4">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_R8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stind_Ref">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stloc">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stloc_0">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stloc_1">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stloc_2">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stloc_3">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stloc_S">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stobj">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Stsfld">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Sub">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Sub_Ovf">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Sub_Ovf_Un">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Switch">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Tailcall">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Throw">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Unaligned">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Unbox">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Volatile">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Xor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="TakesSingleByteArgument(System.Reflection.Emit.OpCode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inst">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OperandType.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OperandType.xml
deleted file mode 100644
index e0c868f8dc4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/OperandType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.Emit.OperandType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PEFileKinds.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PEFileKinds.xml
deleted file mode 100644
index a09166ae5a7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PEFileKinds.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.Emit.PEFileKinds" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PackingSize.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PackingSize.xml
deleted file mode 100644
index 71f79d630f3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PackingSize.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.Emit.PackingSize" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterBuilder.xml
deleted file mode 100644
index 6af1e4167bb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterBuilder.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.ParameterBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsIn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsOut">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsOptional">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetMarshal(System.Reflection.Emit.UnmanagedMarshal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="unmanagedMarshal">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetConstant(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="defaultValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterToken.xml
deleted file mode 100644
index c6c21f46333..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/ParameterToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.ParameterToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyBuilder.xml
deleted file mode 100644
index 08c9ab1e657..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyBuilder.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.PropertyBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PropertyToken">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PropertyType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetValue(System.Object, System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="value">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="index">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Object, System.Object, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="value">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="index">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Object, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSetMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetIndexParameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetGetMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAccessors(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddOtherMethod(System.Reflection.Emit.MethodBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mdBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetConstant(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="defaultValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetGetMethod(System.Reflection.Emit.MethodBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mdBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetSetMethod(System.Reflection.Emit.MethodBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mdBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyToken.xml
deleted file mode 100644
index 12faff1b7dc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/PropertyToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.PropertyToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureHelper.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureHelper.xml
deleted file mode 100644
index d11c41ad967..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureHelper.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.SignatureHelper" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFieldSigHelper(System.Reflection.Module)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mod">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLocalVarSigHelper(System.Reflection.Module)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mod">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethodSigHelper(System.Reflection.Module, System.Reflection.CallingConventions, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mod">TODO</param>
- <param name="callingConvention">TODO</param>
- <param name="returnType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethodSigHelper(System.Reflection.Module, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mod">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetPropertySigHelper(System.Reflection.Module, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mod">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddArgument(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="clsArgument">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSentinel">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetSignature">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureToken.xml
deleted file mode 100644
index 040d1c1cd76..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/SignatureToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.SignatureToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/StackBehaviour.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/StackBehaviour.xml
deleted file mode 100644
index f4f84e6398a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/StackBehaviour.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.Emit.StackBehaviour" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/StringToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/StringToken.xml
deleted file mode 100644
index a83f8dba6c2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/StringToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.StringToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeBuilder.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeBuilder.xml
deleted file mode 100644
index cd832ad0f9c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeBuilder.xml
+++ /dev/null
@@ -1,403 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.TypeBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="UnspecifiedTypeSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Assembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AssemblyQualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnderlyingSystemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GUID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Module">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PackingSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InvokeMember(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object, System.Object[], System.Reflection.ParameterModifier[], System.Globalization.CultureInfo, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="target">TODO</param>
- <param name="args">TODO</param>
- <param name="modifiers">TODO</param>
- <param name="culture">TODO</param>
- <param name="namedParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperties(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethods(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMembers(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFields(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetField(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructors(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedTypes(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedType(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvents(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvent(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInterfaces">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInterface(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddDeclarativeSecurity(System.Security.Permissions.SecurityAction, System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- <param name="pset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddInterfaceImplementation(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="interfaceType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineNestedType(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineNestedType(System.String, System.Reflection.TypeAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineNestedType(System.String, System.Reflection.TypeAttributes, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineNestedType(System.String, System.Reflection.TypeAttributes, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="interfaces">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineNestedType(System.String, System.Reflection.TypeAttributes, System.Type, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="typesize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineNestedType(System.String, System.Reflection.TypeAttributes, System.Type, System.Reflection.Emit.PackingSize)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="packsize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineNestedType(System.String, System.Reflection.TypeAttributes, System.Type, System.Reflection.Emit.PackingSize, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attr">TODO</param>
- <param name="parent">TODO</param>
- <param name="packsize">TODO</param>
- <param name="typesize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineConstructor(System.Reflection.MethodAttributes, System.Reflection.CallingConventions, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributes">TODO</param>
- <param name="callingConvention">TODO</param>
- <param name="parameterTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDefaultConstructor(System.Reflection.MethodAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineMethod(System.String, System.Reflection.MethodAttributes, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attributes">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineMethod(System.String, System.Reflection.MethodAttributes, System.Reflection.CallingConventions, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attributes">TODO</param>
- <param name="callingConvention">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefinePInvokeMethod(System.String, System.String, System.String, System.Reflection.MethodAttributes, System.Reflection.CallingConventions, System.Type, System.Type[], System.Runtime.InteropServices.CallingConvention, System.Runtime.InteropServices.CharSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="dllName">TODO</param>
- <param name="entryName">TODO</param>
- <param name="attributes">TODO</param>
- <param name="callingConvention">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <param name="nativeCallConv">TODO</param>
- <param name="nativeCharSet">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefinePInvokeMethod(System.String, System.String, System.Reflection.MethodAttributes, System.Reflection.CallingConventions, System.Type, System.Type[], System.Runtime.InteropServices.CallingConvention, System.Runtime.InteropServices.CharSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="dllName">TODO</param>
- <param name="attributes">TODO</param>
- <param name="callingConvention">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <param name="nativeCallConv">TODO</param>
- <param name="nativeCharSet">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineMethodOverride(System.Reflection.MethodInfo, System.Reflection.MethodInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="methodInfoBody">TODO</param>
- <param name="methodInfoDeclaration">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineField(System.String, System.Type, System.Reflection.FieldAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fieldName">TODO</param>
- <param name="type">TODO</param>
- <param name="attributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineProperty(System.String, System.Reflection.PropertyAttributes, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attributes">TODO</param>
- <param name="returnType">TODO</param>
- <param name="parameterTypes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineTypeInitializer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="customBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCustomAttribute(System.Reflection.ConstructorInfo, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="con">TODO</param>
- <param name="binaryAttribute">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineEvent(System.String, System.Reflection.EventAttributes, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="attributes">TODO</param>
- <param name="eventtype">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineInitializedData(System.String, System.Byte[], System.Reflection.FieldAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="data">TODO</param>
- <param name="attributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineUninitializedData(System.String, System.Int32, System.Reflection.FieldAttributes)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="size">TODO</param>
- <param name="attributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetParent(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parentType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeToken.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeToken.xml
deleted file mode 100644
index 59bff0c653c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/TypeToken.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.Emit.TypeToken" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Token">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/UnmanagedMarshal.xml b/mcs/docs/apidocs/xml/en/System.Reflection.Emit/UnmanagedMarshal.xml
deleted file mode 100644
index 319e6d226f2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection.Emit/UnmanagedMarshal.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Emit.UnmanagedMarshal" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UnmanagedMarshal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ElementCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GetUnmanagedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IIDGuid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="DefineByValArray(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elemCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineByValTStr(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elemCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineLPArray(System.Runtime.InteropServices.UnmanagedType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elemType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineSafeArray(System.Runtime.InteropServices.UnmanagedType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elemType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineUnmanagedMarshal(System.Runtime.InteropServices.UnmanagedType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="unmanagedType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AmbiguousMatchException.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AmbiguousMatchException.xml
deleted file mode 100644
index 3a5d3af8d94..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AmbiguousMatchException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AmbiguousMatchException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AmbiguousMatchException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="AmbiguousMatchException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="AmbiguousMatchException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/Assembly.xml b/mcs/docs/apidocs/xml/en/System.Reflection/Assembly.xml
deleted file mode 100644
index 1242389ea58..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/Assembly.xml
+++ /dev/null
@@ -1,277 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Assembly" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="CodeBase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CopiedCodeBase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EntryPoint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Evidence">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Location">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetName(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="copiedName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="throwOnError">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetExportedTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetManifestResourceStream(System.Type, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetManifestResourceStream(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFile(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFiles">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String, System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="throwOnError">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateQualifiedName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="nCreateQualifiedName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAssembly(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSatelliteAssembly(System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LoadFrom(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyFile">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyString">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.String, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyString">TODO</param>
- <param name="assemblySecurity">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Reflection.AssemblyName)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyRef">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Reflection.AssemblyName, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyRef">TODO</param>
- <param name="assemblySecurity">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rawAssembly">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rawAssembly">TODO</param>
- <param name="rawSymbolStore">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Byte[], System.Byte[], System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rawAssembly">TODO</param>
- <param name="rawSymbolStore">TODO</param>
- <param name="securityEvidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="typeName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="typeName">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.String, System.Boolean, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="typeName">TODO</param>
- <param name="ignoreCase">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="args">TODO</param>
- <param name="culture">TODO</param>
- <param name="activationAttributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLoadedModules">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetModules">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetModule(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetManifestResourceNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetExecutingAssembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetReferencedAssemblies">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetManifestResourceInfo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="resourceName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyAlgorithmIdAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyAlgorithmIdAttribute.xml
deleted file mode 100644
index 0bacf8f7897..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyAlgorithmIdAttribute.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyAlgorithmIdAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="algorithmId">TODO</param>
- </constructor>
- <constructor name="AssemblyAlgorithmIdAttribute(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="algorithmId">TODO</param>
- </constructor>
- <property name="Algorithmid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCompanyAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCompanyAttribute.xml
deleted file mode 100644
index c423f9322dc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCompanyAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyCompanyAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyCompanyAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="company">TODO</param>
- </constructor>
- <property name="Company">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyConfigurationAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyConfigurationAttribute.xml
deleted file mode 100644
index 45c0463df99..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyConfigurationAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyConfigurationAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyConfigurationAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="configuration">TODO</param>
- </constructor>
- <property name="Configuration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCopyrightAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCopyrightAttribute.xml
deleted file mode 100644
index 512143e5958..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCopyrightAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyCopyrightAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyCopyrightAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="copyright">TODO</param>
- </constructor>
- <property name="Copyright">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCultureAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCultureAttribute.xml
deleted file mode 100644
index a79cd465a79..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyCultureAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyCultureAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyCultureAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- </constructor>
- <property name="Culture">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDefaultAliasAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDefaultAliasAttribute.xml
deleted file mode 100644
index 00f488258b8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDefaultAliasAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyDefaultAliasAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyDefaultAliasAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="defaultAlias">TODO</param>
- </constructor>
- <property name="DefaultAlias">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDelaySignAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDelaySignAttribute.xml
deleted file mode 100644
index 50e99963c1c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDelaySignAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyDelaySignAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyDelaySignAttribute(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="delaySign">TODO</param>
- </constructor>
- <property name="DelaySIgn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDescriptionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDescriptionAttribute.xml
deleted file mode 100644
index 5c54d463523..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyDescriptionAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyDescriptionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyDescriptionAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="description">TODO</param>
- </constructor>
- <property name="Description">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFileVersionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFileVersionAttribute.xml
deleted file mode 100644
index 0d560bf351d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFileVersionAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyFileVersionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyFileVersionAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="version">TODO</param>
- </constructor>
- <property name="FileVersion">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFlagsAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFlagsAttribute.xml
deleted file mode 100644
index ad58ed31774..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyFlagsAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyFlagsAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyFlagsAttribute(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="flags">TODO</param>
- </constructor>
- <property name="Flags">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyInformationalVersionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyInformationalVersionAttribute.xml
deleted file mode 100644
index 792c7c81036..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyInformationalVersionAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyInformationalVersionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyInformationalVersionAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="informationalVersion">TODO</param>
- </constructor>
- <property name="InformationalVersion">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyFileAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyFileAttribute.xml
deleted file mode 100644
index 17f3c538355..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyFileAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyKeyFileAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyKeyFileAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keyFile">TODO</param>
- </constructor>
- <property name="KeyFile">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyNameAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyNameAttribute.xml
deleted file mode 100644
index aaa3cd01b05..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyKeyNameAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyKeyNameAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyKeyNameAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keyName">TODO</param>
- </constructor>
- <property name="KeyName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyName.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyName.xml
deleted file mode 100644
index 619bb0c2c9b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyName.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyName" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CodeBase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameFlags.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameFlags.xml
deleted file mode 100644
index 13bde38d9cf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameFlags.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.AssemblyNameFlags" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameProxy.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameProxy.xml
deleted file mode 100644
index 41626ac2931..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyNameProxy.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyNameProxy" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyNameProxy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetAssemblyName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyFile">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyProductAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyProductAttribute.xml
deleted file mode 100644
index 81e087103de..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyProductAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyProductAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyProductAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="product">TODO</param>
- </constructor>
- <property name="Product">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTitleAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTitleAttribute.xml
deleted file mode 100644
index c1471166205..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTitleAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyTitleAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyTitleAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="title">TODO</param>
- </constructor>
- <property name="Title">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTrademarkAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTrademarkAttribute.xml
deleted file mode 100644
index 6e4c3ceb0e9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyTrademarkAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyTrademarkAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyTrademarkAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="trademark">TODO</param>
- </constructor>
- <property name="Trademark">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyVersionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyVersionAttribute.xml
deleted file mode 100644
index 695007dab21..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/AssemblyVersionAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.AssemblyVersionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyVersionAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="version">TODO</param>
- </constructor>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/Binder.xml b/mcs/docs/apidocs/xml/en/System.Reflection/Binder.xml
deleted file mode 100644
index c448c3df786..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/Binder.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Binder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/BindingFlags.xml b/mcs/docs/apidocs/xml/en/System.Reflection/BindingFlags.xml
deleted file mode 100644
index 31ca9cc2b39..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/BindingFlags.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.BindingFlags" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/CallingConventions.xml b/mcs/docs/apidocs/xml/en/System.Reflection/CallingConventions.xml
deleted file mode 100644
index 62900cc2d27..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/CallingConventions.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.CallingConventions" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ConstructorInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ConstructorInfo.xml
deleted file mode 100644
index e925326cfe5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ConstructorInfo.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.ConstructorInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="ConstructorName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TypeConstructorName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Invoke(System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="parameters">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Invoke(System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parameters">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/CustomAttributeFormatException.xml b/mcs/docs/apidocs/xml/en/System.Reflection/CustomAttributeFormatException.xml
deleted file mode 100644
index 92f44cd0b5a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/CustomAttributeFormatException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.CustomAttributeFormatException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CustomAttributeFormatException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CustomAttributeFormatException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="CustomAttributeFormatException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/DefaultMemberAttribute.xml b/mcs/docs/apidocs/xml/en/System.Reflection/DefaultMemberAttribute.xml
deleted file mode 100644
index bcb877ba308..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/DefaultMemberAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.DefaultMemberAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DefaultMemberAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="member_name">TODO</param>
- </constructor>
- <property name="MemberName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/EventAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/EventAttributes.xml
deleted file mode 100644
index 0d90a2e4aae..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/EventAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.EventAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/EventInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/EventInfo.xml
deleted file mode 100644
index 3f31dbae2ea..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/EventInfo.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.EventInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EventHandlerType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMulticast">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSpecialName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetRemoveMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetRaiseMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAddMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddEventHandler(System.Object, System.Delegate)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <param name="handler">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAddMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetRaiseMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetRemoveMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="RemoveEventHandler(System.Object, System.Delegate)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <param name="handler">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/FieldAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/FieldAttributes.xml
deleted file mode 100644
index 2e5155405c8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/FieldAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.FieldAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/FieldInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/FieldInfo.xml
deleted file mode 100644
index 3b3c317e29d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/FieldInfo.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.FieldInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FieldHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FieldType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsLiteral">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsStatic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsInitOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetValue(System.Object, System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="val">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ICustomAttributeProvider.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ICustomAttributeProvider.xml
deleted file mode 100644
index 9b7c98fe670..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ICustomAttributeProvider.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Reflection.ICustomAttributeProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/IReflect.xml b/mcs/docs/apidocs/xml/en/System.Reflection/IReflect.xml
deleted file mode 100644
index c04c002c107..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/IReflect.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Reflection.IReflect" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/InterfaceMapping.xml b/mcs/docs/apidocs/xml/en/System.Reflection/InterfaceMapping.xml
deleted file mode 100644
index 27962317fdc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/InterfaceMapping.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.InterfaceMapping" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="InterfaceMethods">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="InterfaceType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TargetMethods">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TargetType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/InvalidFilterCriteriaException.xml b/mcs/docs/apidocs/xml/en/System.Reflection/InvalidFilterCriteriaException.xml
deleted file mode 100644
index 7ad6a818bc8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/InvalidFilterCriteriaException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.InvalidFilterCriteriaException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="InvalidFilterCriteriaException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="InvalidFilterCriteriaException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="InvalidFilterCriteriaException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ManifestResourceInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ManifestResourceInfo.xml
deleted file mode 100644
index f7e8f5a4053..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ManifestResourceInfo.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.ManifestResourceInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ManifestResourceInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MemberFilter.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MemberFilter.xml
deleted file mode 100644
index 35f2264e974..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MemberFilter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Reflection.MemberFilter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MemberInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MemberInfo.xml
deleted file mode 100644
index 7eee5b7f37b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MemberInfo.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.MemberInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MemberTypes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MemberTypes.xml
deleted file mode 100644
index d83d3710f38..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MemberTypes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.MemberTypes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MethodAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MethodAttributes.xml
deleted file mode 100644
index 88166ec4277..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MethodAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.MethodAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MethodBase.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MethodBase.xml
deleted file mode 100644
index 54ce51269ff..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MethodBase.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.MethodBase" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="MethodHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CallingConvention">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPublic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPrivate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFamily">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAssembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFamilyAndAssembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFamilyOrAssembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsStatic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFinal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsVirtual">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsHideBySig">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAbstract">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSpecialName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsConstructor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="parameters">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetParameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMethodImplementationFlags">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetCurrentMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMethodFromHandle(System.RuntimeMethodHandle)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="handle">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Invoke(System.Object, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="parameters">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MethodImplAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MethodImplAttributes.xml
deleted file mode 100644
index 3ab67ac5c47..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MethodImplAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.MethodImplAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MethodInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MethodInfo.xml
deleted file mode 100644
index 2515971330c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MethodInfo.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.MethodInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnTypeCustomAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetBaseDefinition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/Missing.xml b/mcs/docs/apidocs/xml/en/System.Reflection/Missing.xml
deleted file mode 100644
index 441f3aaff0e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/Missing.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Missing" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/Module.xml b/mcs/docs/apidocs/xml/en/System.Reflection/Module.xml
deleted file mode 100644
index 22815103cd2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/Module.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.Module" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="FilterTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="FilterTypeNameIgnoreCase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Assembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullyQualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ScopeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String, System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <param name="throwOnError">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FindTypes(System.Reflection.TypeFilter, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="filter">TODO</param>
- <param name="filterCriteria">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetField(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetField(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="flags">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFields">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="types">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="callConvention">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethods">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetSignerCertificate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsResource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/MonoEvent.xml b/mcs/docs/apidocs/xml/en/System.Reflection/MonoEvent.xml
deleted file mode 100644
index 11cd9de2dde..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/MonoEvent.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.MonoEvent" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MonoEvent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetRemoveMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetRaiseMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAddMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ParameterAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ParameterAttributes.xml
deleted file mode 100644
index ec76a3e1bc5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ParameterAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.ParameterAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ParameterInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ParameterInfo.xml
deleted file mode 100644
index 9f5ad7c1708..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ParameterInfo.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.ParameterInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="ParameterType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DefaultValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsIn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsLcid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsOptional">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsOut">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsRetval">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Member">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ParameterModifier.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ParameterModifier.xml
deleted file mode 100644
index bd5e0a98ab3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ParameterModifier.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Reflection.ParameterModifier" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ParameterModifier(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="paramaterCount">TODO</param>
- </constructor>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/PropertyAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/PropertyAttributes.xml
deleted file mode 100644
index ce1472de9fd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/PropertyAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.PropertyAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/PropertyInfo.xml b/mcs/docs/apidocs/xml/en/System.Reflection/PropertyInfo.xml
deleted file mode 100644
index ec54c0b3bdb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/PropertyInfo.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.PropertyInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSpecialName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PropertyType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetValue(System.Object, System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="value">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="index">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Object, System.Object, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="value">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="index">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Object, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSetMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetIndexParameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetGetMethod(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAccessors(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nonPublic">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAccessors">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetGetMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetSetMethod">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ReflectionTypeLoadException.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ReflectionTypeLoadException.xml
deleted file mode 100644
index 850cc64bb84..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ReflectionTypeLoadException.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.ReflectionTypeLoadException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ReflectionTypeLoadException(System.Type[], System.Exception[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="classes">TODO</param>
- <param name="exceptions">TODO</param>
- </constructor>
- <constructor name="ReflectionTypeLoadException(System.Type[], System.Exception[], System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="classes">TODO</param>
- <param name="exceptions">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- <property name="Types">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LoaderExceptions">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ResourceAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ResourceAttributes.xml
deleted file mode 100644
index dacb03d5d06..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ResourceAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.ResourceAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/ResourceLocation.xml b/mcs/docs/apidocs/xml/en/System.Reflection/ResourceLocation.xml
deleted file mode 100644
index dc74eff20a5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/ResourceLocation.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.ResourceLocation" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/StrongNameKeyPair.xml b/mcs/docs/apidocs/xml/en/System.Reflection/StrongNameKeyPair.xml
deleted file mode 100644
index 70a35904b43..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/StrongNameKeyPair.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.StrongNameKeyPair" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StrongNameKeyPair(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keyPairArray">TODO</param>
- </constructor>
- <constructor name="StrongNameKeyPair(System.IO.FileStream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keyPairFile">TODO</param>
- </constructor>
- <constructor name="StrongNameKeyPair(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keyPairContainer">TODO</param>
- </constructor>
- <property name="PublicKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/TargetException.xml b/mcs/docs/apidocs/xml/en/System.Reflection/TargetException.xml
deleted file mode 100644
index 875ef0d6d44..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/TargetException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.TargetException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TargetException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TargetException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="TargetException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/TargetInvocationException.xml b/mcs/docs/apidocs/xml/en/System.Reflection/TargetInvocationException.xml
deleted file mode 100644
index a91825216d2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/TargetInvocationException.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.TargetInvocationException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/TargetParameterCountException.xml b/mcs/docs/apidocs/xml/en/System.Reflection/TargetParameterCountException.xml
deleted file mode 100644
index bcb8293f2cb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/TargetParameterCountException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.TargetParameterCountException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TargetParameterCountException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TargetParameterCountException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="TargetParameterCountException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/TypeAttributes.xml b/mcs/docs/apidocs/xml/en/System.Reflection/TypeAttributes.xml
deleted file mode 100644
index 4df8773a742..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/TypeAttributes.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Reflection.TypeAttributes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/TypeDelegator.xml b/mcs/docs/apidocs/xml/en/System.Reflection/TypeDelegator.xml
deleted file mode 100644
index f7083032310..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/TypeDelegator.xml
+++ /dev/null
@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Reflection.TypeDelegator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TypeDelegator(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="delegatingType">TODO</param>
- </constructor>
- <property name="Assembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AssemblyQualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GUID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Module">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnderlyingSystemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InvokeMember(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object, System.Object[], System.Reflection.ParameterModifier[], System.Globalization.CultureInfo, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="target">TODO</param>
- <param name="args">TODO</param>
- <param name="modifiers">TODO</param>
- <param name="culture">TODO</param>
- <param name="namedParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperties(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethods(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMembers(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFields(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetField(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructors(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedTypes(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedType(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMember(System.String, System.Reflection.MemberTypes, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="type">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvents(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvents">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEvent(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInterfaces">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInterfaceMap(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="interfaceType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInterface(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="attributeType">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Reflection/TypeFilter.xml b/mcs/docs/apidocs/xml/en/System.Reflection/TypeFilter.xml
deleted file mode 100644
index b924d176016..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Reflection/TypeFilter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Reflection.TypeFilter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/IResourceReader.xml b/mcs/docs/apidocs/xml/en/System.Resources/IResourceReader.xml
deleted file mode 100644
index b99fa0f108d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/IResourceReader.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Resources.IResourceReader" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/IResourceWriter.xml b/mcs/docs/apidocs/xml/en/System.Resources/IResourceWriter.xml
deleted file mode 100644
index c6ffe6cfbaa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/IResourceWriter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Resources.IResourceWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/MissingManifestResourceException.xml b/mcs/docs/apidocs/xml/en/System.Resources/MissingManifestResourceException.xml
deleted file mode 100644
index 678e30ce10f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/MissingManifestResourceException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Resources.MissingManifestResourceException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MissingManifestResourceException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MissingManifestResourceException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="MissingManifestResourceException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="e">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/NeutralResourcesLanguageAttribute.xml b/mcs/docs/apidocs/xml/en/System.Resources/NeutralResourcesLanguageAttribute.xml
deleted file mode 100644
index f798d9d0b32..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/NeutralResourcesLanguageAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Resources.NeutralResourcesLanguageAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NeutralResourcesLanguageAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cultureName">TODO</param>
- </constructor>
- <property name="CultureName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/ResourceManager.xml b/mcs/docs/apidocs/xml/en/System.Resources/ResourceManager.xml
deleted file mode 100644
index 69acbb88c98..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/ResourceManager.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Resources.ResourceManager" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ResourceManager(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="resourceSource">TODO</param>
- </constructor>
- <constructor name="ResourceManager(System.String, System.Reflection.Assembly)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="baseName">TODO</param>
- <param name="assembly">TODO</param>
- </constructor>
- <constructor name="ResourceManager(System.String, System.Reflection.Assembly, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="baseName">TODO</param>
- <param name="assembly">TODO</param>
- <param name="usingResourceSet">TODO</param>
- </constructor>
- <field name="HeaderVersionNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="BaseName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IgnoreCase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ResourceSetType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ReleaseAllResources">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetString(System.String, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetResourceSet(System.Globalization.CultureInfo, System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- <param name="createIfNotExists">TODO</param>
- <param name="tryParents">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateFileBasedResourceManager(System.String, System.String, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="baseName">TODO</param>
- <param name="resourceDir">TODO</param>
- <param name="usingResourceSet">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/ResourceReader.xml b/mcs/docs/apidocs/xml/en/System.Resources/ResourceReader.xml
deleted file mode 100644
index 5be53e6154d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/ResourceReader.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Resources.ResourceReader" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ResourceReader(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- </constructor>
- <constructor name="ResourceReader(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- </constructor>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/ResourceSet.xml b/mcs/docs/apidocs/xml/en/System.Resources/ResourceSet.xml
deleted file mode 100644
index 7e2c97f547e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/ResourceSet.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Resources.ResourceSet" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ResourceSet(System.Resources.IResourceReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="reader">TODO</param>
- </constructor>
- <constructor name="ResourceSet(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- </constructor>
- <constructor name="ResourceSet(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- </constructor>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetString(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetObject(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetObject(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDefaultWriter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetDefaultReader">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/ResourceWriter.xml b/mcs/docs/apidocs/xml/en/System.Resources/ResourceWriter.xml
deleted file mode 100644
index e1737e13baf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/ResourceWriter.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Resources.ResourceWriter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ResourceWriter(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- </constructor>
- <constructor name="ResourceWriter(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileName">TODO</param>
- </constructor>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Generate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddResource(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddResource(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddResource(System.String, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Resources/SatelliteContractVersionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Resources/SatelliteContractVersionAttribute.xml
deleted file mode 100644
index 98b849f3cd1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Resources/SatelliteContractVersionAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Resources.SatelliteContractVersionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SatelliteContractVersionAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="version">TODO</param>
- </constructor>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/IndexerNameAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/IndexerNameAttribute.xml
deleted file mode 100644
index 511ebe32b23..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/IndexerNameAttribute.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.CompilerServices.IndexerNameAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IndexerNameAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="indexer_name">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodCodeType.xml b/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodCodeType.xml
deleted file mode 100644
index f00e79e4038..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodCodeType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.CompilerServices.MethodCodeType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplAttribute.xml
deleted file mode 100644
index 4564595c8ab..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplAttribute.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.CompilerServices.MethodImplAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MethodImplAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MethodImplAttribute(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="options">TODO</param>
- </constructor>
- <constructor name="MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="options">TODO</param>
- </constructor>
- <field name="MethodCodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplOptions.xml b/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplOptions.xml
deleted file mode 100644
index 67ac30f5ee5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/MethodImplOptions.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.CompilerServices.MethodImplOptions" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/RuntimeHelpers.xml b/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/RuntimeHelpers.xml
deleted file mode 100644
index 222ea016a06..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.CompilerServices/RuntimeHelpers.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.CompilerServices.RuntimeHelpers" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="OffsetToStringData">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InitializeArray(System.Array, System.RuntimeFieldHandle)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="fldHandle">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/AssemblyRegistrationFlags.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/AssemblyRegistrationFlags.xml
deleted file mode 100644
index fc74cc58d59..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/AssemblyRegistrationFlags.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.AssemblyRegistrationFlags" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CallingConvention.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CallingConvention.xml
deleted file mode 100644
index 6d77ef477b3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CallingConvention.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.CallingConvention" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CharSet.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CharSet.xml
deleted file mode 100644
index 98791441587..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/CharSet.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.CharSet" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceAttribute.xml
deleted file mode 100644
index 57b6a3a5291..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceAttribute.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.ClassInterfaceAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ClassInterfaceAttribute(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="classInterfaceType">TODO</param>
- </constructor>
- <constructor name="ClassInterfaceAttribute(System.Runtime.InteropServices.ClassInterfaceType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="classInterfaceType">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceType.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceType.xml
deleted file mode 100644
index aa3d7b2644f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ClassInterfaceType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.ClassInterfaceType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ComInterfaceType.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ComInterfaceType.xml
deleted file mode 100644
index 38bb54f1713..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ComInterfaceType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.ComInterfaceType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/DllImportAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/DllImportAttribute.xml
deleted file mode 100644
index 268829d1efe..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/DllImportAttribute.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.DllImportAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DllImportAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dllName">TODO</param>
- </constructor>
- <field name="CallingConvention">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="CharSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="EntryPoint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="ExactSpelling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="PreserveSig">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SetLastError">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExporterEventKind.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExporterEventKind.xml
deleted file mode 100644
index 239ee958cba..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExporterEventKind.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.ExporterEventKind" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExternalException.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExternalException.xml
deleted file mode 100644
index 11f3477f1c4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ExternalException.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.ExternalException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ExternalException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ExternalException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ExternalException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="ExternalException(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="errorCode">TODO</param>
- </constructor>
- <property name="ErrorCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/FieldOffsetAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/FieldOffsetAttribute.xml
deleted file mode 100644
index 4141b765c65..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/FieldOffsetAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.FieldOffsetAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FieldOffsetAttribute(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandle.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandle.xml
deleted file mode 100644
index b02d62413a6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandle.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Runtime.InteropServices.GCHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="IsAllocated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Target">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="AddrOfPinnedObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Alloc(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Alloc(System.Object, System.Runtime.InteropServices.GCHandleType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Free">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <operator name="op_Explicit(System.Runtime.InteropServices.GCHandle)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.IntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandleType.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandleType.xml
deleted file mode 100644
index 74bfc108fb4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GCHandleType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.GCHandleType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GuidAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GuidAttribute.xml
deleted file mode 100644
index 39415881982..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/GuidAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.GuidAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="GuidAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="guid">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomAdapter.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomAdapter.xml
deleted file mode 100644
index 3a3c60c2c07..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomAdapter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.ICustomAdapter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomFactory.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomFactory.xml
deleted file mode 100644
index 735f6098d42..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomFactory.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.ICustomFactory" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomMarshaler.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomMarshaler.xml
deleted file mode 100644
index b38477dd864..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ICustomMarshaler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.ICustomMarshaler" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/IRegistrationServices.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/IRegistrationServices.xml
deleted file mode 100644
index b4c92087a63..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/IRegistrationServices.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.IRegistrationServices" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibConverter.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibConverter.xml
deleted file mode 100644
index 482844a771c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibConverter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.ITypeLibConverter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNameProvider.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNameProvider.xml
deleted file mode 100644
index ca3a2ce1bee..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNameProvider.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.ITypeLibExporterNameProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNotifySink.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNotifySink.xml
deleted file mode 100644
index ed6aea5e761..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibExporterNotifySink.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.ITypeLibExporterNotifySink" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibImporterNotifySink.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibImporterNotifySink.xml
deleted file mode 100644
index d8f0d83b095..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ITypeLibImporterNotifySink.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.InteropServices.ITypeLibImporterNotifySink" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ImporterEventKind.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ImporterEventKind.xml
deleted file mode 100644
index 6cb53b31f07..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/ImporterEventKind.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.ImporterEventKind" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InAttribute.xml
deleted file mode 100644
index 411fa8d0134..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.InAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="InAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InterfaceTypeAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InterfaceTypeAttribute.xml
deleted file mode 100644
index 4e40deadc2e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/InterfaceTypeAttribute.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.InterfaceTypeAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="interfaceType">TODO</param>
- </constructor>
- <constructor name="InterfaceTypeAttribute(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="interfaceType">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/LayoutKind.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/LayoutKind.xml
deleted file mode 100644
index 0468dfdf90e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/LayoutKind.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.LayoutKind" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/MarshalAsAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/MarshalAsAttribute.xml
deleted file mode 100644
index 65f76224c86..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/MarshalAsAttribute.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.MarshalAsAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MarshalAsAttribute(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="unmanagedType">TODO</param>
- </constructor>
- <constructor name="MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="unmanagedType">TODO</param>
- </constructor>
- <field name="ArraySubType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MarshalCookie">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MarshalType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MarshalTypeRef">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SafeArraySubType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SizeConst">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SizeParamIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OptionalAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OptionalAttribute.xml
deleted file mode 100644
index d5f4bc3583e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OptionalAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.OptionalAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="OptionalAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OutAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OutAttribute.xml
deleted file mode 100644
index 44803c141a8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/OutAttribute.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.OutAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="OutAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="TypeId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/PInvokeMap.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/PInvokeMap.xml
deleted file mode 100644
index 8513a5f5696..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/PInvokeMap.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.PInvokeMap" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/StructLayoutAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/StructLayoutAttribute.xml
deleted file mode 100644
index 6479cd91597..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/StructLayoutAttribute.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.InteropServices.StructLayoutAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StructLayoutAttribute(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="layoutKind">TODO</param>
- </constructor>
- <constructor name="StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="layoutKind">TODO</param>
- </constructor>
- <field name="CharSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Pack">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/TypeLibExporterFlags.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/TypeLibExporterFlags.xml
deleted file mode 100644
index 0402473075e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/TypeLibExporterFlags.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.TypeLibExporterFlags" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/UnmanagedType.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/UnmanagedType.xml
deleted file mode 100644
index 201b0268721..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/UnmanagedType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.UnmanagedType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/VarEnum.xml b/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/VarEnum.xml
deleted file mode 100644
index a0f3aaf4e23..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.InteropServices/VarEnum.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.InteropServices.VarEnum" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/ActivatorLevel.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/ActivatorLevel.xml
deleted file mode 100644
index 19cbde98683..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/ActivatorLevel.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Remoting.Activation.ActivatorLevel" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IActivator.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IActivator.xml
deleted file mode 100644
index 07a950d4128..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IActivator.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Activation.IActivator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionCallMessage.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionCallMessage.xml
deleted file mode 100644
index 58bf5868119..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionCallMessage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Activation.IConstructionCallMessage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionReturnMessage.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionReturnMessage.xml
deleted file mode 100644
index f2f8d4e42db..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Activation/IConstructionReturnMessage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Activation.IConstructionReturnMessage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/Context.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/Context.xml
deleted file mode 100644
index c300f6fdbb3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/Context.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.Contexts.Context" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Context">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="DefaultContext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ContextID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetProperty(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetProperty(System.Runtime.Remoting.Contexts.IContextProperty)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prop">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/ContextAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/ContextAttribute.xml
deleted file mode 100644
index 7eee55e5d81..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/ContextAttribute.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.Contexts.ContextAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ContextAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsNewContextOK(System.Runtime.Remoting.Contexts.Context)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ctx">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Freeze(System.Runtime.Remoting.Contexts.Context)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ctx">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsContextOK(System.Runtime.Remoting.Contexts.Context, System.Runtime.Remoting.Activation.IConstructionCallMessage)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ctx">TODO</param>
- <param name="msg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetPropertiesForNewContext(System.Runtime.Remoting.Activation.IConstructionCallMessage)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="msg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextAttribute.xml
deleted file mode 100644
index afa3202b2f1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextAttribute.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Contexts.IContextAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextProperty.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextProperty.xml
deleted file mode 100644
index 2893cc7da0b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IContextProperty.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Contexts.IContextProperty" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicMessageSink.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicMessageSink.xml
deleted file mode 100644
index 436c49d3529..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicMessageSink.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Contexts.IDynamicMessageSink" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicProperty.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicProperty.xml
deleted file mode 100644
index 2be4ee71ad4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/IDynamicProperty.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Contexts.IDynamicProperty" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/SynchronizationAttribute.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/SynchronizationAttribute.xml
deleted file mode 100644
index ec87c6f2479..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Contexts/SynchronizationAttribute.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Contexts.SynchronizationAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/AsyncResult.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/AsyncResult.xml
deleted file mode 100644
index ce3f8077321..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/AsyncResult.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.Messaging.AsyncResult" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AsyncResult">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AsyncState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AsyncWaitHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CompletedSynchronously">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCompleted">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EndInvokeCalled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AsyncDelegate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/Header.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/Header.xml
deleted file mode 100644
index b1883983449..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/Header.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.Messaging.Header" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Header(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="Header(System.String, System.Object, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <param name="must_understand">TODO</param>
- </constructor>
- <constructor name="Header(System.String, System.Object, System.Boolean, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <param name="must_understand">TODO</param>
- <param name="header_namespace">TODO</param>
- </constructor>
- <field name="HeaderNamespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MustUnderstand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessage.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessage.xml
deleted file mode 100644
index a5198ddfc75..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Messaging.IMessage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageCtrl.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageCtrl.xml
deleted file mode 100644
index 5369b4cbd10..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageCtrl.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Messaging.IMessageCtrl" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageSink.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageSink.xml
deleted file mode 100644
index 49111124191..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMessageSink.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Messaging.IMessageSink" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodCallMessage.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodCallMessage.xml
deleted file mode 100644
index 34d4fcc7bf7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodCallMessage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Messaging.IMethodCallMessage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodMessage.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodMessage.xml
deleted file mode 100644
index d98ed321044..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodMessage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Messaging.IMethodMessage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodReturnMessage.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodReturnMessage.xml
deleted file mode 100644
index 0ee99aa9705..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/IMethodReturnMessage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Remoting.Messaging.IMethodReturnMessage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/LogicalCallContext.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/LogicalCallContext.xml
deleted file mode 100644
index d0245ae4f3b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Messaging/LogicalCallContext.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.Messaging.LogicalCallContext" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="HasInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FreeNamedDataSlot(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetData(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetData(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Proxies/RealProxy.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Proxies/RealProxy.xml
deleted file mode 100644
index bcccb181787..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting.Proxies/RealProxy.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.Proxies.RealProxy" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="GetTransparentProxy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Invoke(System.Runtime.Remoting.Messaging.IMessage)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="msg">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/LeaseState.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/LeaseState.xml
deleted file mode 100644
index dc93d01b373..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/LeaseState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Remoting.LeaseState" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjRef.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjRef.xml
deleted file mode 100644
index 52385994d0d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjRef.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.ObjRef" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ObjRef">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ObjRef(System.MarshalByRefObject, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mbr">TODO</param>
- <param name="type">TODO</param>
- </constructor>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="si">TODO</param>
- <param name="sc">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetRealObject(System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sc">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsFromThisAppDomain">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsFromThisProcess">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjectHandle.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjectHandle.xml
deleted file mode 100644
index 2f1cc7ca2f5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/ObjectHandle.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.ObjectHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ObjectHandle(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- </constructor>
- <method name="GetRealObject(System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InitializeLifetimeService">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Unwrap">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/RemotingServices.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/RemotingServices.xml
deleted file mode 100644
index b0a6eebb280..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/RemotingServices.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Remoting.RemotingServices" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="IsTransparentProxy(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="proxy">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ExecuteMessage(System.MarshalByRefObject, System.Runtime.Remoting.Messaging.IMethodCallMessage)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <param name="reqMsg">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapMethodOption.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapMethodOption.xml
deleted file mode 100644
index 9c979904565..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapMethodOption.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Remoting.SoapMethodOption" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapOption.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapOption.xml
deleted file mode 100644
index 58c26f41096..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/SoapOption.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Remoting.SoapOption" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/WellKnownObjectMode.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/WellKnownObjectMode.xml
deleted file mode 100644
index 417743c6825..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Remoting/WellKnownObjectMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Remoting.WellKnownObjectMode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.xml
deleted file mode 100644
index 7df6dc6cc2a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters.Binary/BinaryArrayTypeEnum.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.Binary.BinaryArrayTypeEnum" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.xml
deleted file mode 100644
index 052efa2666e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.FormatterAssemblyStyle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.xml
deleted file mode 100644
index 31602ed7218..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.FormatterTopObjectStyle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTypeStyle.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTypeStyle.xml
deleted file mode 100644
index 1553903e86b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/FormatterTypeStyle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.FormatterTypeStyle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/IFieldInfo.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/IFieldInfo.xml
deleted file mode 100644
index 1aaee4042ef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/IFieldInfo.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.Formatters.IFieldInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/ISoapMessage.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/ISoapMessage.xml
deleted file mode 100644
index 246b434a4e8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/ISoapMessage.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.Formatters.ISoapMessage" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalArrayTypeE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalArrayTypeE.xml
deleted file mode 100644
index 22b95598d58..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalArrayTypeE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalArrayTypeE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalElementTypeE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalElementTypeE.xml
deleted file mode 100644
index 4684f6d26c2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalElementTypeE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalElementTypeE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberTypeE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberTypeE.xml
deleted file mode 100644
index 0789e88cfc4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberTypeE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalMemberTypeE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberValueE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberValueE.xml
deleted file mode 100644
index fd498783d87..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalMemberValueE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalMemberValueE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalNameSpaceE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalNameSpaceE.xml
deleted file mode 100644
index bdb54cdef63..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalNameSpaceE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalNameSpaceE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectPositionE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectPositionE.xml
deleted file mode 100644
index 54166dc2a90..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectPositionE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalObjectPositionE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectTypeE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectTypeE.xml
deleted file mode 100644
index c49438620a1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalObjectTypeE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalObjectTypeE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseStateE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseStateE.xml
deleted file mode 100644
index 472d9a7e0df..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseStateE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalParseStateE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseTypeE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseTypeE.xml
deleted file mode 100644
index 1e4bc057823..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalParseTypeE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalParseTypeE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.xml
deleted file mode 100644
index 8ce02d3b4c1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalPrimitiveTypeE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.xml
deleted file mode 100644
index 77ff630b3bd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization.Formatters/InternalSerializerTypeE.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.Formatters.InternalSerializerTypeE" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IDeserializationCallback.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IDeserializationCallback.xml
deleted file mode 100644
index 0b81efa9154..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IDeserializationCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.IDeserializationCallback" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatter.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatter.xml
deleted file mode 100644
index 21de0da6997..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.IFormatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatterConverter.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatterConverter.xml
deleted file mode 100644
index 8948ff8e7dc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IFormatterConverter.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.IFormatterConverter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IObjectReference.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IObjectReference.xml
deleted file mode 100644
index ee6170675bd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/IObjectReference.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.IObjectReference" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializable.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializable.xml
deleted file mode 100644
index ae2284955d5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.ISerializable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializationSurrogate.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializationSurrogate.xml
deleted file mode 100644
index c2ddff92c37..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISerializationSurrogate.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.ISerializationSurrogate" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISurrogateSelector.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISurrogateSelector.xml
deleted file mode 100644
index fca838cece7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ISurrogateSelector.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Runtime.Serialization.ISurrogateSelector" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ObjectIDGenerator.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ObjectIDGenerator.xml
deleted file mode 100644
index 27a5fc49ad4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/ObjectIDGenerator.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Serialization.ObjectIDGenerator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ObjectIDGenerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="HasId(System.Object, System.Boolean&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="firstTime">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetId(System.Object, System.Boolean&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="firstTime">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationBinder.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationBinder.xml
deleted file mode 100644
index 95053f10901..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationBinder.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Serialization.SerializationBinder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="BindToType(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationEntry.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationEntry.xml
deleted file mode 100644
index 98d68bc8212..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationEntry.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Runtime.Serialization.SerializationEntry" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ObjectType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationException.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationException.xml
deleted file mode 100644
index db5561dca81..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Serialization.SerializationException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SerializationException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="SerializationException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="SerializationException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfo.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfo.xml
deleted file mode 100644
index 952d009b17a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfo.xml
+++ /dev/null
@@ -1,250 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Serialization.SerializationInfo" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SerializationInfo(System.Type, System.Runtime.Serialization.IFormatterConverter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="converter">TODO</param>
- </constructor>
- <property name="AssemblyName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="AddValue(System.String, System.Object, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.String, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetType(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddValue(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBoolean(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByte(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetChar(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDateTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDecimal(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDouble(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInt16(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInt32(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInt64(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSByte(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetSingle(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetUInt16(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetUInt32(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetUInt64(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfoEnumerator.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfoEnumerator.xml
deleted file mode 100644
index 4e8f179e92d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SerializationInfoEnumerator.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Serialization.SerializationInfoEnumerator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Current">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ObjectType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContext.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContext.xml
deleted file mode 100644
index ac32c8c8f61..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContext.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Runtime.Serialization.StreamingContext" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StreamingContext(System.Runtime.Serialization.StreamingContextStates)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="state">TODO</param>
- </constructor>
- <constructor name="StreamingContext(System.Runtime.Serialization.StreamingContextStates, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="state">TODO</param>
- <param name="additional">TODO</param>
- </constructor>
- <property name="Context">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="State">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContextStates.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContextStates.xml
deleted file mode 100644
index 240c7b3f6ef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/StreamingContextStates.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Runtime.Serialization.StreamingContextStates" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SurrogateSelector.xml b/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SurrogateSelector.xml
deleted file mode 100644
index 812a666b336..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Runtime.Serialization/SurrogateSelector.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Runtime.Serialization.SurrogateSelector" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SurrogateSelector">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetSurrogate(System.Type, System.Runtime.Serialization.StreamingContext, System.Runtime.Serialization.ISurrogateSelector&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="context">TODO</param>
- <param name="selector">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNextSelector">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ChainSelector(System.Runtime.Serialization.ISurrogateSelector)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="selector">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveSurrogate(System.Type, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSurrogate(System.Type, System.Runtime.Serialization.StreamingContext, System.Runtime.Serialization.ISerializationSurrogate)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="context">TODO</param>
- <param name="surrogate">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography.X509Certificates/X509Certificate.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography.X509Certificates/X509Certificate.xml
deleted file mode 100644
index 50f18faad5a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography.X509Certificates/X509Certificate.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.X509Certificates.X509Certificate" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricAlgorithm.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricAlgorithm.xml
deleted file mode 100644
index 02d8efddc2a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricAlgorithm.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.AsymmetricAlgorithm" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="KeyExchangeAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="KeySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LegalKeySizes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SignatureAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToXmlString(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="includePrivateParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXmlString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xmlString">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ValidKeySize(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bitLength">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="algName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.xml
deleted file mode 100644
index 2ab68118867..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.AsymmetricKeyExchangeDeformatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AsymmetricKeyExchangeDeformatter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetKey(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DecryptKeyExchange(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgb">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.xml
deleted file mode 100644
index 2a61e48e7eb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.AsymmetricKeyExchangeFormatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AsymmetricKeyExchangeFormatter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Parameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetKey(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateKeyExchange(System.Byte[], System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <param name="symAlgType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateKeyExchange(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureDeformatter.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureDeformatter.xml
deleted file mode 100644
index fda968216ff..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureDeformatter.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.AsymmetricSignatureDeformatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AsymmetricSignatureDeformatter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="VerifySignature(System.Security.Cryptography.HashAlgorithm, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hash">TODO</param>
- <param name="rgbSignature">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="VerifySignature(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbHash">TODO</param>
- <param name="rgbSignature">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetKey(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetHashAlgorithm(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureFormatter.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureFormatter.xml
deleted file mode 100644
index 403ec7b7d0a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/AsymmetricSignatureFormatter.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.AsymmetricSignatureFormatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AsymmetricSignatureFormatter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="CreateSignature(System.Security.Cryptography.HashAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hash">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateSignature(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbHash">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetKey(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetHashAlgorithm(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CipherMode.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CipherMode.xml
deleted file mode 100644
index a9eb966cd75..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CipherMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Cryptography.CipherMode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoAPITransform.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoAPITransform.xml
deleted file mode 100644
index 33ca36db19c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoAPITransform.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.CryptoAPITransform" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CryptoAPITransform">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CanTransformMultipleBlocks">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="KeyHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OutputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="TransformFinalBlock(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TransformBlock(System.Byte[], System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <param name="outputBuffer">TODO</param>
- <param name="outputOffset">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStream.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStream.xml
deleted file mode 100644
index da818e23e7c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStream.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.CryptoStream" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CryptoStream(System.IO.Stream, System.Security.Cryptography.ICryptoTransform, System.Security.Cryptography.CryptoStreamMode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="transform">TODO</param>
- <param name="mode">TODO</param>
- </constructor>
- <property name="CanRead">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanSeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanWrite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Write(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetLength(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Seek(System.Int64, System.IO.SeekOrigin)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="origin">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FlushFinalBlock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStreamMode.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStreamMode.xml
deleted file mode 100644
index 9d69ee5360a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptoStreamMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Cryptography.CryptoStreamMode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicException.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicException.xml
deleted file mode 100644
index 661f9b52c76..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicException.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.CryptographicException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CryptographicException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CryptographicException(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hr">TODO</param>
- </constructor>
- <constructor name="CryptographicException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="CryptographicException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="CryptographicException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="insert">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicUnexpectedOperationException.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicUnexpectedOperationException.xml
deleted file mode 100644
index bb7606e72d1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CryptographicUnexpectedOperationException.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.CryptographicUnexpectedOperationException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CryptographicUnexpectedOperationException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CryptographicUnexpectedOperationException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="CryptographicUnexpectedOperationException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="CryptographicUnexpectedOperationException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="insert">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspParameters.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspParameters.xml
deleted file mode 100644
index c977f370d51..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspParameters.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.CspParameters" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CspParameters">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CspParameters(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dwTypeIn">TODO</param>
- </constructor>
- <constructor name="CspParameters(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dwTypeIn">TODO</param>
- <param name="strProviderNameIn">TODO</param>
- </constructor>
- <constructor name="CspParameters(System.Int32, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dwTypeIn">TODO</param>
- <param name="strProviderNameIn">TODO</param>
- <param name="strContainerNameIn">TODO</param>
- </constructor>
- <field name="KeyContainerName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="KeyNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="ProviderName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="ProviderType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Flags">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspProviderFlags.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspProviderFlags.xml
deleted file mode 100644
index 802305f7cd7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/CspProviderFlags.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Cryptography.CspProviderFlags" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DES.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DES.xml
deleted file mode 100644
index 3d3ef8f5476..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DES.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.DES" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DES">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Key">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsWeakKey(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbKey">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSemiWeakKey(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbKey">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DESCryptoServiceProvider.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DESCryptoServiceProvider.xml
deleted file mode 100644
index ca18e1f8352..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DESCryptoServiceProvider.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.DESCryptoServiceProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DESCryptoServiceProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Key">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IV">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreateDecryptor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateEncryptor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSA.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSA.xml
deleted file mode 100644
index 2b2f2061e85..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSA.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.DSA" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="VerifySignature(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbHash">TODO</param>
- <param name="rgbSignature">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ImportParameters(System.Security.Cryptography.DSAParameters)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ExportParameters(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="includePrivateParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateSignature(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbHash">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXmlString(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="includePrivateParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXmlString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xmlString">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="algName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSACryptoServiceProvider.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSACryptoServiceProvider.xml
deleted file mode 100644
index fd791164701..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSACryptoServiceProvider.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.DSACryptoServiceProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DSACryptoServiceProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DSACryptoServiceProvider(System.Security.Cryptography.CspParameters)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parameters">TODO</param>
- </constructor>
- <constructor name="DSACryptoServiceProvider(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key_size">TODO</param>
- </constructor>
- <constructor name="DSACryptoServiceProvider(System.Int32, System.Security.Cryptography.CspParameters)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key_size">TODO</param>
- <param name="parameters">TODO</param>
- </constructor>
- <property name="KeyExchangeAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="KeySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LegalKeySizes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SignatureAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PersistKeyInCsp">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="VerifySignature(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hash">TODO</param>
- <param name="sig">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ImportParameters(System.Security.Cryptography.DSAParameters)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ExportParameters(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="include">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateSignature(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgb">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXmlString(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="includePrivateParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXmlString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xmlString">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SignData(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SignData(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SignData(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SignHash(System.Byte[], System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hash">TODO</param>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="VerifyData(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <param name="sig">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSAParameters.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSAParameters.xml
deleted file mode 100644
index 5afed41ddaf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSAParameters.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Security.Cryptography.DSAParameters" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Counter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="G">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="J">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="P">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Q">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Seed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="X">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Y">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureDeformatter.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureDeformatter.xml
deleted file mode 100644
index dee4d1f2426..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureDeformatter.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.DSASignatureDeformatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DSASignatureDeformatter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DSASignatureDeformatter(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- </constructor>
- <method name="VerifySignature(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbHash">TODO</param>
- <param name="rgbSignature">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetKey(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetHashAlgorithm(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureFormatter.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureFormatter.xml
deleted file mode 100644
index a806aee80fa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DSASignatureFormatter.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.DSASignatureFormatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DSASignatureFormatter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DSASignatureFormatter(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- </constructor>
- <method name="CreateSignature(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbHash">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetKey(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetHashAlgorithm(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DeriveBytes.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DeriveBytes.xml
deleted file mode 100644
index 932f27ab9ea..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/DeriveBytes.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.DeriveBytes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cb">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64Transform.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64Transform.xml
deleted file mode 100644
index 6decaea7d0e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64Transform.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.FromBase64Transform" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FromBase64Transform">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="FromBase64Transform(System.Security.Cryptography.FromBase64TransformMode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="mode">TODO</param>
- </constructor>
- <property name="CanTransformMultipleBlocks">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OutputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="TransformFinalBlock(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TransformBlock(System.Byte[], System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <param name="outputBuffer">TODO</param>
- <param name="outputOffset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64TransformMode.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64TransformMode.xml
deleted file mode 100644
index b0aa37a6b17..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/FromBase64TransformMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Cryptography.FromBase64TransformMode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/HashAlgorithm.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/HashAlgorithm.xml
deleted file mode 100644
index cc5bfe55873..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/HashAlgorithm.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.HashAlgorithm" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="CanTransformMultipleBlocks">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Hash">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HashSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OutputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="TransformFinalBlock(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TransformBlock(System.Byte[], System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <param name="outputBuffer">TODO</param>
- <param name="outputOffset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ComputeHash(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="st">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/ICryptoTransform.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/ICryptoTransform.xml
deleted file mode 100644
index 046b56497e3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/ICryptoTransform.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.Cryptography.ICryptoTransform" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/KeySizes.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/KeySizes.xml
deleted file mode 100644
index b5c77c35abf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/KeySizes.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.KeySizes" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="KeySizes(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="minSize">TODO</param>
- <param name="maxSize">TODO</param>
- <param name="skipSize">TODO</param>
- </constructor>
- <property name="MaxSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MinSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SkipSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5.xml
deleted file mode 100644
index 708d9408b53..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.MD5" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="st">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5CryptoServiceProvider.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5CryptoServiceProvider.xml
deleted file mode 100644
index 3e0f44a78d2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/MD5CryptoServiceProvider.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.MD5CryptoServiceProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MD5CryptoServiceProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/PaddingMode.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/PaddingMode.xml
deleted file mode 100644
index 4c5839eaa59..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/PaddingMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Cryptography.PaddingMode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RNGCryptoServiceProvider.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RNGCryptoServiceProvider.xml
deleted file mode 100644
index 7443ba71c7f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RNGCryptoServiceProvider.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.RNGCryptoServiceProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RNGCryptoServiceProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="RNGCryptoServiceProvider(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgb">TODO</param>
- </constructor>
- <constructor name="RNGCryptoServiceProvider(System.Security.Cryptography.CspParameters)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cspParams">TODO</param>
- </constructor>
- <constructor name="RNGCryptoServiceProvider(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- </constructor>
- <method name="GetNonZeroBytes(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSA.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSA.xml
deleted file mode 100644
index 5df368682a0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSA.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.RSA" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RSA">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="ImportParameters(System.Security.Cryptography.RSAParameters)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ExportParameters(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="include">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DecryptValue(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgb">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EncryptValue(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgb">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXmlString(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="include">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXmlString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xml">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="alg">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSAParameters.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSAParameters.xml
deleted file mode 100644
index da9cfec6e24..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RSAParameters.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Security.Cryptography.RSAParameters" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="P">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Q">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="D">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="DP">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="DQ">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="InverseQ">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Modulus">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Exponent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RandomNumberGenerator.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RandomNumberGenerator.xml
deleted file mode 100644
index a7ad8a52873..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RandomNumberGenerator.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.RandomNumberGenerator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RandomNumberGenerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetNonZeroBytes(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rngName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/Rijndael.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/Rijndael.xml
deleted file mode 100644
index db27d4af897..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/Rijndael.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.Rijndael" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Rijndael">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="alg">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RijndaelManaged.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RijndaelManaged.xml
deleted file mode 100644
index 62ea1fb6f71..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/RijndaelManaged.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.RijndaelManaged" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RijndaelManaged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GenerateKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GenerateIV">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateEncryptor(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbKey">TODO</param>
- <param name="rgbIV">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDecryptor(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbKey">TODO</param>
- <param name="rgbIV">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1.xml
deleted file mode 100644
index 4d7ff76537b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA1" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="st">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1CryptoServiceProvider.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1CryptoServiceProvider.xml
deleted file mode 100644
index 30b1ff908f9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA1CryptoServiceProvider.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA1CryptoServiceProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SHA1CryptoServiceProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256.xml
deleted file mode 100644
index 211c74b9967..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA256" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SHA256">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="st">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256Managed.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256Managed.xml
deleted file mode 100644
index 90d7ac1fe77..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA256Managed.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA256Managed" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SHA256Managed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ProcessBlock(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ProcessFinalBlock(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384.xml
deleted file mode 100644
index 35d336b2215..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA384" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SHA384">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="st">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384Managed.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384Managed.xml
deleted file mode 100644
index 310fb4d59c8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA384Managed.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA384Managed" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SHA384Managed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512.xml
deleted file mode 100644
index d230aee7d3b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA512" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SHA512">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="st">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512Managed.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512Managed.xml
deleted file mode 100644
index 96fe63a6806..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SHA512Managed.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SHA512Managed" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SHA512Managed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SignatureDescription.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SignatureDescription.xml
deleted file mode 100644
index 35fa2d7cf46..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SignatureDescription.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SignatureDescription" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SignatureDescription(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="el">TODO</param>
- </constructor>
- <property name="DeformatterAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DigestAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FormatterAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="KeyAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreateFormatter(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDigest">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateDeformatter(System.Security.Cryptography.AsymmetricAlgorithm)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SymmetricAlgorithm.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SymmetricAlgorithm.xml
deleted file mode 100644
index dc790e00af6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/SymmetricAlgorithm.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.SymmetricAlgorithm" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SymmetricAlgorithm">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FeedbackSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IV">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Key">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="KeySize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LegalBlockSizes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LegalKeySizes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Mode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Padding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GenerateKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GenerateIV">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateEncryptor(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbKey">TODO</param>
- <param name="rgbIV">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateEncryptor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateDecryptor(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rgbKey">TODO</param>
- <param name="rgbIV">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDecryptor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ValidKeySize(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bitLength">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Create(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="algName">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/ToBase64Transform.xml b/mcs/docs/apidocs/xml/en/System.Security.Cryptography/ToBase64Transform.xml
deleted file mode 100644
index 5c721a06fe2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Cryptography/ToBase64Transform.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Cryptography.ToBase64Transform" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ToBase64Transform">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CanTransformMultipleBlocks">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OutputBlockSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="TransformFinalBlock(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TransformBlock(System.Byte[], System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inputBuffer">TODO</param>
- <param name="inputOffset">TODO</param>
- <param name="inputCount">TODO</param>
- <param name="outputBuffer">TODO</param>
- <param name="outputOffset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/CodeAccessSecurityAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/CodeAccessSecurityAttribute.xml
deleted file mode 100644
index 6b3049f54f3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/CodeAccessSecurityAttribute.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.CodeAccessSecurityAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeAccessSecurityAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAccess.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAccess.xml
deleted file mode 100644
index 605683160b7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAccess.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.EnvironmentPermissionAccess" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAttribute.xml
deleted file mode 100644
index ef59656253d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/EnvironmentPermissionAttribute.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.EnvironmentPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EnvironmentPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="All">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Write">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAccess.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAccess.xml
deleted file mode 100644
index 29bc1ec1860..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAccess.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.FileDialogPermissionAccess" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAttribute.xml
deleted file mode 100644
index a8922ff6386..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileDialogPermissionAttribute.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.FileDialogPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileDialogPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Open">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Save">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermission.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermission.xml
deleted file mode 100644
index fec369d2a80..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermission.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.FileIOPermission" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileIOPermission(System.Security.Permissions.PermissionState)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="state">TODO</param>
- </constructor>
- <constructor name="FileIOPermission(System.Security.Permissions.FileIOPermissionAccess, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="access">TODO</param>
- <param name="path">TODO</param>
- </constructor>
- <constructor name="FileIOPermission(System.Security.Permissions.FileIOPermissionAccess, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="access">TODO</param>
- <param name="pathList">TODO</param>
- </constructor>
- <property name="AllFiles">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AllLocalFiles">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsUnrestricted">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="esd">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Union(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSubsetOf(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Intersect(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddPathList(System.Security.Permissions.FileIOPermissionAccess, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="access">TODO</param>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddPathList(System.Security.Permissions.FileIOPermissionAccess, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="access">TODO</param>
- <param name="pathList">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetPathList(System.Security.Permissions.FileIOPermissionAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="access">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetPathList(System.Security.Permissions.FileIOPermissionAccess, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="access">TODO</param>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetPathList(System.Security.Permissions.FileIOPermissionAccess, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="access">TODO</param>
- <param name="pathList">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAccess.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAccess.xml
deleted file mode 100644
index de2a6e11e7c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAccess.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.FileIOPermissionAccess" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAttribute.xml
deleted file mode 100644
index 7606b85ed43..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/FileIOPermissionAttribute.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.FileIOPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileIOPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="All">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Append">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PathDiscovery">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Write">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IUnrestrictedPermission.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/IUnrestrictedPermission.xml
deleted file mode 100644
index 4e08349777e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IUnrestrictedPermission.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.Permissions.IUnrestrictedPermission" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageContainment.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageContainment.xml
deleted file mode 100644
index 0c852cd883b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageContainment.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.IsolatedStorageContainment" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.xml
deleted file mode 100644
index acc229238c5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.IsolatedStorageFilePermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IsolatedStorageFilePermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermission.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermission.xml
deleted file mode 100644
index 5bfd52b0b6b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermission.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.IsolatedStoragePermission" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IsolatedStoragePermission(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="UsageAllowed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserQuota">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermissionAttribute.xml
deleted file mode 100644
index f991426a3f4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/IsolatedStoragePermissionAttribute.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.IsolatedStoragePermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IsolatedStoragePermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="UsageAllowed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserQuota">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionSetAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionSetAttribute.xml
deleted file mode 100644
index f7385e96d8c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionSetAttribute.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.PermissionSetAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PermissionSetAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="File">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnicodeEncoded">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XML">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreatePermissionSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionState.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionState.xml
deleted file mode 100644
index ffbdfaa99e3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/PermissionState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.PermissionState" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/PrinciplePermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/PrinciplePermissionAttribute.xml
deleted file mode 100644
index d9c2686c516..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/PrinciplePermissionAttribute.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.PrinciplePermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PrinciplePermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Authenticated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Role">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionAttribute.xml
deleted file mode 100644
index 1855bcb8f92..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionAttribute.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.ReflectionPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ReflectionPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Flags">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberAccess">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectionEmit">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeInformation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionFlag.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionFlag.xml
deleted file mode 100644
index 7412d5c74d3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/ReflectionPermissionFlag.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.ReflectionPermissionFlag" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAccess.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAccess.xml
deleted file mode 100644
index 3d621d82ec0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAccess.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.RegistryPermissionAccess" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAttribute.xml
deleted file mode 100644
index f094e17692e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/RegistryPermissionAttribute.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.RegistryPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RegistryPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="All">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Create">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Write">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAction.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAction.xml
deleted file mode 100644
index b36fcc87cc4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAction.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.SecurityAction" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAttribute.xml
deleted file mode 100644
index 701eb0bae33..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityAttribute.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.SecurityAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SecurityAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Unrestricted">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Action">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermission.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermission.xml
deleted file mode 100644
index b14f2391e2e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermission.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.SecurityPermission" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SecurityPermission(System.Security.Permissions.PermissionState)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="state">TODO</param>
- </constructor>
- <constructor name="SecurityPermission(System.Security.Permissions.SecurityPermissionFlag)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="flags">TODO</param>
- </constructor>
- <property name="Flags">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsUnrestricted">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Union(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSubsetOf(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Intersect(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermissionFlag.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermissionFlag.xml
deleted file mode 100644
index 05948d77703..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SecurityPermissionFlag.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.SecurityPermissionFlag" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SiteIdentityPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/SiteIdentityPermissionAttribute.xml
deleted file mode 100644
index 97246589911..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/SiteIdentityPermissionAttribute.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.SiteIdentityPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SiteIdentityPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Site">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/StrongNameIdentityPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/StrongNameIdentityPermissionAttribute.xml
deleted file mode 100644
index 133b1917b04..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/StrongNameIdentityPermissionAttribute.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.StrongNameIdentityPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StrongNameIdentityPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PublicKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionAttribute.xml
deleted file mode 100644
index 0ef02ed6eeb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionAttribute.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.UIPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UIPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Clipboard">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Window">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionClipboard.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionClipboard.xml
deleted file mode 100644
index a6390ca1a51..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionClipboard.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.UIPermissionClipboard" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionWindow.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionWindow.xml
deleted file mode 100644
index 9376807dcda..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UIPermissionWindow.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Permissions.UIPermissionWindow" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UrlIdentityPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/UrlIdentityPermissionAttribute.xml
deleted file mode 100644
index 0a80842b254..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/UrlIdentityPermissionAttribute.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.UrlIdentityPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UrlIdentityPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Url">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Permissions/ZoneIdentityPermissionAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Permissions/ZoneIdentityPermissionAttribute.xml
deleted file mode 100644
index 2ae65a7e9d0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Permissions/ZoneIdentityPermissionAttribute.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Permissions.ZoneIdentityPermissionAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ZoneIdentityPermissionAttribute(System.Security.Permissions.SecurityAction)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="action">TODO</param>
- </constructor>
- <property name="Zone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreatePermission">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/AllMembershipCondition.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/AllMembershipCondition.xml
deleted file mode 100644
index 465173c55db..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/AllMembershipCondition.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.AllMembershipCondition" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AllMembershipCondition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="ToXml(System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement, System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Check(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/ApplicationDirectoryMembershipCondition.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/ApplicationDirectoryMembershipCondition.xml
deleted file mode 100644
index d034a869755..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/ApplicationDirectoryMembershipCondition.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.ApplicationDirectoryMembershipCondition" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ApplicationDirectoryMembershipCondition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="ToXml(System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement, System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Check(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/CodeGroup.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/CodeGroup.xml
deleted file mode 100644
index dc8ba9558c5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/CodeGroup.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.CodeGroup" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CodeGroup(System.Security.Policy.IMembershipCondition, System.Security.Policy.PolicyStatement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="membershipCondition">TODO</param>
- <param name="policy">TODO</param>
- </constructor>
- <property name="MergeLogic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PolicyStatement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Description">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MembershipCondition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Children">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AttributeString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PermissionSetName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ResolveMatchingCodeGroups(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Resolve(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddChild(System.Security.Policy.CodeGroup)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="group">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Security.Policy.CodeGroup, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cg">TODO</param>
- <param name="compareChildren">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveChild(System.Security.Policy.CodeGroup)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="group">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement, System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToXml(System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/Evidence.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/Evidence.xml
deleted file mode 100644
index c0e73d71f4a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/Evidence.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.Evidence" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Evidence">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetHostEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/FileCodeGroup.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/FileCodeGroup.xml
deleted file mode 100644
index bbd9f14146a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/FileCodeGroup.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.FileCodeGroup" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FileCodeGroup(System.Security.Policy.IMembershipCondition, System.Security.Permissions.FileIOPermissionAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="membershipCondition">TODO</param>
- <param name="access">TODO</param>
- </constructor>
- <property name="MergeLogic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AttributeString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PermissionSetName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ResolveMatchingCodeGroups(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Resolve(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/IIdentityPermissionFactory.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/IIdentityPermissionFactory.xml
deleted file mode 100644
index 1aef2080d7d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/IIdentityPermissionFactory.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.Policy.IIdentityPermissionFactory" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/IMembershipCondition.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/IMembershipCondition.xml
deleted file mode 100644
index bd39f0e165a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/IMembershipCondition.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.Policy.IMembershipCondition" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyException.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyException.xml
deleted file mode 100644
index cd225c24822..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.PolicyException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PolicyException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="PolicyException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="PolicyException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyLevel.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyLevel.xml
deleted file mode 100644
index 6a649b8489f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyLevel.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.PolicyLevel" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="FullTrustAssemblies">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Label">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamedPermissionSets">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RootCodeGroup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StoreLocation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatement.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatement.xml
deleted file mode 100644
index 21e95083418..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatement.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Policy.PolicyStatement" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PolicyStatement(System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="perms">TODO</param>
- </constructor>
- <constructor name="PolicyStatement(System.Security.PermissionSet, System.Security.Policy.PolicyStatementAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="perms">TODO</param>
- <param name="attrs">TODO</param>
- </constructor>
- <property name="PermissionSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AttributeString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToXml(System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement, System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatementAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatementAttribute.xml
deleted file mode 100644
index 0c11d7ff951..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Policy/PolicyStatementAttribute.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Policy.PolicyStatementAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Principal/GenericIdentity.xml b/mcs/docs/apidocs/xml/en/System.Security.Principal/GenericIdentity.xml
deleted file mode 100644
index c5a547fe4f1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Principal/GenericIdentity.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Principal.GenericIdentity" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="GenericIdentity(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="user_name">TODO</param>
- <param name="authentication_type">TODO</param>
- </constructor>
- <constructor name="GenericIdentity(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="AuthenticationType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAuthenticated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Principal/GenericPrincipal.xml b/mcs/docs/apidocs/xml/en/System.Security.Principal/GenericPrincipal.xml
deleted file mode 100644
index 9525f160e83..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Principal/GenericPrincipal.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.Principal.GenericPrincipal" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="GenericPrincipal(System.Security.Principal.IIdentity, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="identity">TODO</param>
- <param name="roles">TODO</param>
- </constructor>
- <property name="Identity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsInRole(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="role">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Principal/IIdentity.xml b/mcs/docs/apidocs/xml/en/System.Security.Principal/IIdentity.xml
deleted file mode 100644
index 145d84fc399..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Principal/IIdentity.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.Principal.IIdentity" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Principal/IPrincipal.xml b/mcs/docs/apidocs/xml/en/System.Security.Principal/IPrincipal.xml
deleted file mode 100644
index f200a22c91c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Principal/IPrincipal.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.Principal.IPrincipal" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security.Principal/PrincipalPolicy.xml b/mcs/docs/apidocs/xml/en/System.Security.Principal/PrincipalPolicy.xml
deleted file mode 100644
index add9d8e8fdb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security.Principal/PrincipalPolicy.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.Principal.PrincipalPolicy" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/CodeAccessPermission.xml b/mcs/docs/apidocs/xml/en/System.Security/CodeAccessPermission.xml
deleted file mode 100644
index 78cae7a757b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/CodeAccessPermission.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.CodeAccessPermission" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="PermitOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Deny">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Assert">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elem">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Union(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSubsetOf(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Intersect(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Demand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/IEvidenceFactory.xml b/mcs/docs/apidocs/xml/en/System.Security/IEvidenceFactory.xml
deleted file mode 100644
index dcd67a37c75..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/IEvidenceFactory.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.IEvidenceFactory" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/IPermission.xml b/mcs/docs/apidocs/xml/en/System.Security/IPermission.xml
deleted file mode 100644
index 1c46e999ed2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/IPermission.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.IPermission" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/ISecurityEncodable.xml b/mcs/docs/apidocs/xml/en/System.Security/ISecurityEncodable.xml
deleted file mode 100644
index fe467a5962c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/ISecurityEncodable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.ISecurityEncodable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/ISecurityPolicyEncodable.xml b/mcs/docs/apidocs/xml/en/System.Security/ISecurityPolicyEncodable.xml
deleted file mode 100644
index 40e3a06f3ba..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/ISecurityPolicyEncodable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.ISecurityPolicyEncodable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/IStackWalk.xml b/mcs/docs/apidocs/xml/en/System.Security/IStackWalk.xml
deleted file mode 100644
index 82361fdefe2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/IStackWalk.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Security.IStackWalk" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/NamedPermissionSet.xml b/mcs/docs/apidocs/xml/en/System.Security/NamedPermissionSet.xml
deleted file mode 100644
index 1146445d9d9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/NamedPermissionSet.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.NamedPermissionSet" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NamedPermissionSet(System.String, System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="set">TODO</param>
- </constructor>
- <constructor name="NamedPermissionSet(System.String, System.Security.Permissions.PermissionState)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="state">TODO</param>
- </constructor>
- <constructor name="NamedPermissionSet(System.Security.NamedPermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="set">TODO</param>
- </constructor>
- <constructor name="NamedPermissionSet(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="Description">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Copy(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/PermissionSet.xml b/mcs/docs/apidocs/xml/en/System.Security/PermissionSet.xml
deleted file mode 100644
index 705da9c6274..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/PermissionSet.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.PermissionSet" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PermissionSet(System.Security.Permissions.PermissionState)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="state">TODO</param>
- </constructor>
- <constructor name="PermissionSet(System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="permSet">TODO</param>
- </constructor>
- <method name="PermitOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Deny">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Demand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Assert">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FromXml(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="et">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Union(System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSubsetOf(System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddPermission(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="perm">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/PolicyLevelType.xml b/mcs/docs/apidocs/xml/en/System.Security/PolicyLevelType.xml
deleted file mode 100644
index 41c92d3e854..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/PolicyLevelType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.PolicyLevelType" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/SecurityElement.xml b/mcs/docs/apidocs/xml/en/System.Security/SecurityElement.xml
deleted file mode 100644
index 0ccd638126c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/SecurityElement.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.SecurityElement" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SecurityElement(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tag">TODO</param>
- <param name="text">TODO</param>
- </constructor>
- <constructor name="SecurityElement(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tag">TODO</param>
- </constructor>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Children">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Tag">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="AddAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddChild(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="child">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Attribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Equal(System.Security.SecurityElement)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Escape(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsInvalidAttributeName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsInvalidAttributeValue(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsInvalidTag(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsInvalidText(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/SecurityException.xml b/mcs/docs/apidocs/xml/en/System.Security/SecurityException.xml
deleted file mode 100644
index 2bbfbb3dda5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/SecurityException.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.SecurityException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SecurityException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="SecurityException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="SecurityException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="SecurityException(System.String, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="type">TODO</param>
- </constructor>
- <constructor name="SecurityException(System.String, System.Type, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="type">TODO</param>
- <param name="state">TODO</param>
- </constructor>
- <property name="PermissionState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PermissionType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/SecurityManager.xml b/mcs/docs/apidocs/xml/en/System.Security/SecurityManager.xml
deleted file mode 100644
index bcb2f2ca8b1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/SecurityManager.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.SecurityManager" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="CheckExecutionRights">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SecurityEnabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsGranted(System.Security.IPermission)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="perm">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LoadPolicyLevelFromFile(System.String, System.Security.PolicyLevelType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LoadPolicyLevelFromString(System.String, System.Security.PolicyLevelType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="PolicyHierarchy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ResolvePolicy(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ResolvePolicy(System.Security.Policy.Evidence, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <param name="reqdPset">TODO</param>
- <param name="optPset">TODO</param>
- <param name="denyPset">TODO</param>
- <param name="denied">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ResolvePolicyGroups(System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SavePolicy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SavePolicyLevel(System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="level">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/SecurityZone.xml b/mcs/docs/apidocs/xml/en/System.Security/SecurityZone.xml
deleted file mode 100644
index 435d97ae587..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/SecurityZone.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Security.SecurityZone" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/SuppressUnmanagedCodeSecurityAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security/SuppressUnmanagedCodeSecurityAttribute.xml
deleted file mode 100644
index 7d2e9c2a941..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/SuppressUnmanagedCodeSecurityAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.SuppressUnmanagedCodeSecurityAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SuppressUnmanagedCodeSecurityAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/UnverifiableCodeAttribute.xml b/mcs/docs/apidocs/xml/en/System.Security/UnverifiableCodeAttribute.xml
deleted file mode 100644
index 56af407c5a8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/UnverifiableCodeAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.UnverifiableCodeAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UnverifiableCodeAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/VerificationException.xml b/mcs/docs/apidocs/xml/en/System.Security/VerificationException.xml
deleted file mode 100644
index a61342f9cbc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/VerificationException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.VerificationException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="VerificationException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="VerificationException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="VerificationException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Security/XmlSyntaxException.xml b/mcs/docs/apidocs/xml/en/System.Security/XmlSyntaxException.xml
deleted file mode 100644
index 234292d528e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Security/XmlSyntaxException.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Security.XmlSyntaxException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSyntaxException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="XmlSyntaxException(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lineNumber">TODO</param>
- </constructor>
- <constructor name="XmlSyntaxException(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lineNumber">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="XmlSyntaxException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="XmlSyntaxException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Capture.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Capture.xml
deleted file mode 100644
index ff181a92125..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Capture.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.Capture" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Index">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Previous">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Checkpoint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsDefined">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CaptureCollection.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CaptureCollection.xml
deleted file mode 100644
index e9c6c5edb01..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CaptureCollection.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.CaptureCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CostDelegate.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CostDelegate.xml
deleted file mode 100644
index 1a0d2903071..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/CostDelegate.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Text.RegularExpressions.IntervalCollection+CostDelegate" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Group.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Group.xml
deleted file mode 100644
index b64687bda40..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Group.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.Group" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Captures">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Success">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Synchronized(System.Text.RegularExpressions.Group)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inner">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/GroupCollection.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/GroupCollection.xml
deleted file mode 100644
index 291deabd7dd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/GroupCollection.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.GroupCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Match.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Match.xml
deleted file mode 100644
index 23c8b82f033..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Match.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.Match" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Groups">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Regex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Result(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="replacement">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Synchronized(System.Text.RegularExpressions.Match)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inner">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NextMatch">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchCollection.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchCollection.xml
deleted file mode 100644
index 3aa2bbd8b97..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchCollection.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.MatchCollection" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchEvaluator.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchEvaluator.xml
deleted file mode 100644
index 74f3c12c364..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/MatchEvaluator.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Text.RegularExpressions.MatchEvaluator" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Regex.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Regex.xml
deleted file mode 100644
index 73dcc274a37..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/Regex.xml
+++ /dev/null
@@ -1,291 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.Regex" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Regex(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- </constructor>
- <constructor name="Regex(System.String, System.Text.RegularExpressions.RegexOptions)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- <param name="options">TODO</param>
- </constructor>
- <property name="Options">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RightToLeft">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GroupCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[], System.Reflection.AssemblyName)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="regexes">TODO</param>
- <param name="aname">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[], System.Reflection.AssemblyName, System.Reflection.Emit.CustomAttributeBuilder[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="regexes">TODO</param>
- <param name="aname">TODO</param>
- <param name="attribs">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[], System.Reflection.AssemblyName, System.Reflection.Emit.CustomAttributeBuilder[], System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="regexes">TODO</param>
- <param name="aname">TODO</param>
- <param name="attribs">TODO</param>
- <param name="resourceFile">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Escape(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Unescape(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsMatch(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Match(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Match(System.String, System.String, System.Text.RegularExpressions.RegexOptions)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <param name="options">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String, System.Text.RegularExpressions.MatchEvaluator)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <param name="evaluator">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String, System.Text.RegularExpressions.MatchEvaluator, System.Text.RegularExpressions.RegexOptions)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <param name="evaluator">TODO</param>
- <param name="options">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <param name="replacement">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String, System.String, System.Text.RegularExpressions.RegexOptions)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <param name="replacement">TODO</param>
- <param name="options">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Split(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Split(System.String, System.String, System.Text.RegularExpressions.RegexOptions)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="pattern">TODO</param>
- <param name="options">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetGroupNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetGroupNumbers">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GroupNameFromNumber(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GroupNumberFromName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsMatch(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsMatch(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="startat">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Match(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Match(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="startat">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Match(System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="startat">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Matches(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Matches(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="startat">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.Text.RegularExpressions.MatchEvaluator)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="evaluator">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.Text.RegularExpressions.MatchEvaluator, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="evaluator">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.Text.RegularExpressions.MatchEvaluator, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="evaluator">TODO</param>
- <param name="count">TODO</param>
- <param name="startat">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="replacement">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="replacement">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="replacement">TODO</param>
- <param name="count">TODO</param>
- <param name="startat">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Split(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Split(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Split(System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="count">TODO</param>
- <param name="startat">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCollectionBase.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCollectionBase.xml
deleted file mode 100644
index b9a8d90c386..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCollectionBase.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.RegexCollectionBase" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCompilationInfo.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCompilationInfo.xml
deleted file mode 100644
index 70d435212e0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexCompilationInfo.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.RegularExpressions.RegexCompilationInfo" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RegexCompilationInfo(System.String, System.Text.RegularExpressions.RegexOptions, System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- <param name="options">TODO</param>
- <param name="name">TODO</param>
- <param name="full_namespace">TODO</param>
- <param name="is_public">TODO</param>
- </constructor>
- <property name="IsPublic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Options">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Pattern">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexOptions.xml b/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexOptions.xml
deleted file mode 100644
index c1501e1b2a8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text.RegularExpressions/RegexOptions.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Text.RegularExpressions.RegexOptions" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/ASCIIEncoding.xml b/mcs/docs/apidocs/xml/en/System.Text/ASCIIEncoding.xml
deleted file mode 100644
index 9cf9c7dec81..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/ASCIIEncoding.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.ASCIIEncoding" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ASCIIEncoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetString(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <param name="byteCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetString(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMaxCharCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="byteCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMaxByteCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="charCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetChars(System.Byte[], System.Int32, System.Int32, System.Char[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <param name="byteCount">TODO</param>
- <param name="chars">TODO</param>
- <param name="charIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCharCount(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCharCount(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.String, System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="charIndex">TODO</param>
- <param name="charCount">TODO</param>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Char[], System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="charIndex">TODO</param>
- <param name="charCount">TODO</param>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByteCount(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByteCount(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByteCount(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/Decoder.xml b/mcs/docs/apidocs/xml/en/System.Text/Decoder.xml
deleted file mode 100644
index 000fc7223e4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/Decoder.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.Decoder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="GetChars(System.Byte[], System.Int32, System.Int32, System.Char[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <param name="byteCount">TODO</param>
- <param name="chars">TODO</param>
- <param name="charIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCharCount(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/Encoder.xml b/mcs/docs/apidocs/xml/en/System.Text/Encoder.xml
deleted file mode 100644
index 46903b52236..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/Encoder.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.Encoder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="GetBytes(System.Char[], System.Int32, System.Int32, System.Byte[], System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="charIndex">TODO</param>
- <param name="charCount">TODO</param>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <param name="flush">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByteCount(System.Char[], System.Int32, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <param name="flush">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/Encoding.xml b/mcs/docs/apidocs/xml/en/System.Text/Encoding.xml
deleted file mode 100644
index 0b8f9263d96..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/Encoding.xml
+++ /dev/null
@@ -1,268 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.Encoding" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Unicode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UTF7">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UTF8">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ASCII">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BigEndianUnicode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BodyName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CodePage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EncodingName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsBrowserDisplay">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsBrowserSave">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMailNewsDisplay">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMailNewsSave">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WebName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WindowsCodePage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetString(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetString(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetPreamble">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMaxCharCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="byteCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMaxByteCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="charCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEncoding(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEncoding(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="codepage">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEncoder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetDecoder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetChars(System.Byte[], System.Int32, System.Int32, System.Char[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <param name="byteCount">TODO</param>
- <param name="chars">TODO</param>
- <param name="charIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetChars(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetChars(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCharCount(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCharCount(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bytes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.String, System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="charIndex">TODO</param>
- <param name="charCount">TODO</param>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Char[], System.Int32, System.Int32, System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="charIndex">TODO</param>
- <param name="charCount">TODO</param>
- <param name="bytes">TODO</param>
- <param name="byteIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByteCount(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByteCount(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByteCount(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="chars">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Convert(System.Text.Encoding, System.Text.Encoding, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="srcEncoding">TODO</param>
- <param name="dstEncoding">TODO</param>
- <param name="bytes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Convert(System.Text.Encoding, System.Text.Encoding, System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="srcEncoding">TODO</param>
- <param name="dstEncoding">TODO</param>
- <param name="bytes">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/StringBuilder.xml b/mcs/docs/apidocs/xml/en/System.Text/StringBuilder.xml
deleted file mode 100644
index 82371ab354d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/StringBuilder.xml
+++ /dev/null
@@ -1,412 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.StringBuilder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StringBuilder(System.String, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- <param name="capacity">TODO</param>
- </constructor>
- <constructor name="StringBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="StringBuilder(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- </constructor>
- <constructor name="StringBuilder(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- <param name="maxCapacity">TODO</param>
- </constructor>
- <constructor name="StringBuilder(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="StringBuilder(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="capacity">TODO</param>
- </constructor>
- <property name="MaxCapacity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Capacity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EnsureCapacity(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="capacity">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Text.StringBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sb">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.Char, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldChar">TODO</param>
- <param name="newChar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.Char, System.Char, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldChar">TODO</param>
- <param name="newChar">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldValue">TODO</param>
- <param name="newValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldValue">TODO</param>
- <param name="newValue">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Char, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="repeatCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="charCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AppendFormat(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AppendFormat(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AppendFormat(System.IFormatProvider, System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <param name="format">TODO</param>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AppendFormat(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AppendFormat(System.String, System.Object, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <param name="arg2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="charCount">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/UTF7Encoding.xml b/mcs/docs/apidocs/xml/en/System.Text/UTF7Encoding.xml
deleted file mode 100644
index 61031c80d33..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/UTF7Encoding.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.UTF7Encoding" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UTF7Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetMaxCharCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="byteCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMaxByteCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="charCount">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/UTF8Encoding.xml b/mcs/docs/apidocs/xml/en/System.Text/UTF8Encoding.xml
deleted file mode 100644
index 503d3146f79..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/UTF8Encoding.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.UTF8Encoding" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UTF8Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetMaxCharCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="byteCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMaxByteCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="charCount">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Text/UnicodeEncoding.xml b/mcs/docs/apidocs/xml/en/System.Text/UnicodeEncoding.xml
deleted file mode 100644
index cff9430dfdb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Text/UnicodeEncoding.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Text.UnicodeEncoding" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UnicodeEncoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="UnicodeEncoding(System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bigEndian">TODO</param>
- <param name="byteOrderMark">TODO</param>
- </constructor>
- <method name="GetMaxCharCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="byteCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMaxByteCount(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="charCount">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ApartmentState.xml b/mcs/docs/apidocs/xml/en/System.Threading/ApartmentState.xml
deleted file mode 100644
index 86b945e7c22..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ApartmentState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Threading.ApartmentState" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/AutoResetEvent.xml b/mcs/docs/apidocs/xml/en/System.Threading/AutoResetEvent.xml
deleted file mode 100644
index f766bc65756..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/AutoResetEvent.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.AutoResetEvent" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AutoResetEvent(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initialState">TODO</param>
- </constructor>
- <method name="Set">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/IOCompletionCallback.xml b/mcs/docs/apidocs/xml/en/System.Threading/IOCompletionCallback.xml
deleted file mode 100644
index e45c2f2ead2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/IOCompletionCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Threading.IOCompletionCallback" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/Interlocked.xml b/mcs/docs/apidocs/xml/en/System.Threading/Interlocked.xml
deleted file mode 100644
index ac9ac6418d4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/Interlocked.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.Interlocked" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="CompareExchange(System.Int32&amp;, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location1">TODO</param>
- <param name="value">TODO</param>
- <param name="comparand">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareExchange(System.Object&amp;, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location1">TODO</param>
- <param name="value">TODO</param>
- <param name="comparand">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareExchange(System.Single&amp;, System.Single, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location1">TODO</param>
- <param name="value">TODO</param>
- <param name="comparand">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Decrement(System.Int32&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Decrement(System.Int64&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Exchange(System.Int32&amp;, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location1">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Exchange(System.Object&amp;, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location1">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Exchange(System.Single&amp;, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location1">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Increment(System.Int32&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Increment(System.Int64&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="location">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/LockCookie.xml b/mcs/docs/apidocs/xml/en/System.Threading/LockCookie.xml
deleted file mode 100644
index 4c890edd520..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/LockCookie.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Threading.LockCookie" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ManualResetEvent.xml b/mcs/docs/apidocs/xml/en/System.Threading/ManualResetEvent.xml
deleted file mode 100644
index f040a0a1641..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ManualResetEvent.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.ManualResetEvent" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ManualResetEvent(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initialState">TODO</param>
- </constructor>
- <method name="Set">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/Monitor.xml b/mcs/docs/apidocs/xml/en/System.Threading/Monitor.xml
deleted file mode 100644
index 6073e366007..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/Monitor.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.Monitor" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="Enter(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Exit(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Pulse(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="PulseAll(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TryEnter(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TryEnter(System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="millisecondsTimeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TryEnter(System.Object, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="timeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Wait(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Wait(System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="millisecondsTimeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Wait(System.Object, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="timeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Wait(System.Object, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="millisecondsTimeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Wait(System.Object, System.TimeSpan, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <param name="timeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/Mutex.xml b/mcs/docs/apidocs/xml/en/System.Threading/Mutex.xml
deleted file mode 100644
index d9221ff3346..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/Mutex.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.Mutex" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Mutex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Mutex(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initiallyOwned">TODO</param>
- </constructor>
- <constructor name="Mutex(System.Boolean, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initiallyOwned">TODO</param>
- <param name="name">TODO</param>
- </constructor>
- <constructor name="Mutex(System.Boolean, System.String, System.Boolean&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="initiallyOwned">TODO</param>
- <param name="name">TODO</param>
- <param name="gotOwnership">TODO</param>
- </constructor>
- <method name="ReleaseMutex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/NativeOverlapped.xml b/mcs/docs/apidocs/xml/en/System.Threading/NativeOverlapped.xml
deleted file mode 100644
index fa6ddd27379..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/NativeOverlapped.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Threading.NativeOverlapped" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="EventHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="InternalHigh">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="InternalLow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="OffsetHigh">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="OffsetLow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/Overlapped.xml b/mcs/docs/apidocs/xml/en/System.Threading/Overlapped.xml
deleted file mode 100644
index 4bf80f64f79..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/Overlapped.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.Overlapped" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Overlapped">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Overlapped(System.Int32, System.Int32, System.Int32, System.IAsyncResult)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offsetLo">TODO</param>
- <param name="offsetHi">TODO</param>
- <param name="hEvent">TODO</param>
- <param name="ar">TODO</param>
- </constructor>
- <property name="AsyncResult">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EventHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OffsetHigh">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OffsetLow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Free(System.Threading.NativeOverlapped*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nativeOverlappedPtr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Unpack(System.Threading.NativeOverlapped*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nativeOverlappedPtr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Pack(System.Threading.IOCompletionCallback)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="iocb">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UnsafePack(System.Threading.IOCompletionCallback)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="iocb">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ReaderWriterLock.xml b/mcs/docs/apidocs/xml/en/System.Threading/ReaderWriterLock.xml
deleted file mode 100644
index c55a4aec1ca..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ReaderWriterLock.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.ReaderWriterLock" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ReaderWriterLock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="IsReaderLockHeld">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsWriterLockHeld">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WriterSeqNum">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="AcquireReaderLock(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="millisecondsTimeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AcquireReaderLock(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="timeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AcquireWriterLock(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="millisecondsTimeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AcquireWriterLock(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="timeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AnyWritersSince(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="seqNum">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DowngradeFromWriterLock(System.Threading.LockCookie&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lockCookie">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReleaseLock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReleaseReaderLock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReleaseWriterLock">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="RestoreLock(System.Threading.LockCookie&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lockCookie">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UpgradeToWriterLock(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="millisecondsTimeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UpgradeToWriterLock(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="timeout">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/RegisteredWaitHandle.xml b/mcs/docs/apidocs/xml/en/System.Threading/RegisteredWaitHandle.xml
deleted file mode 100644
index 0d5864f1d0b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/RegisteredWaitHandle.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.RegisteredWaitHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="Unregister(System.Threading.WaitHandle)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/SynchronizationLockException.xml b/mcs/docs/apidocs/xml/en/System.Threading/SynchronizationLockException.xml
deleted file mode 100644
index b61c07ab162..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/SynchronizationLockException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.SynchronizationLockException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SynchronizationLockException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="SynchronizationLockException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="SynchronizationLockException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/Thread.xml b/mcs/docs/apidocs/xml/en/System.Threading/Thread.xml
deleted file mode 100644
index dcd23005007..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/Thread.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.Thread" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Thread(System.Threading.ThreadStart)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="start">TODO</param>
- </constructor>
- <property name="CurrentContext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentPrincipal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentThread">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ApartmentState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentCulture">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentUICulture">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAlive">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsBackground">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Priority">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ThreadState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="AllocateDataSlot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AllocateNamedDataSlot(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FreeNamedDataSlot(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetData(System.LocalDataStoreSlot)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="slot">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDomain">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetDomainID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetNamedDataSlot(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ResetAbort">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetData(System.LocalDataStoreSlot, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="slot">TODO</param>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sleep(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="millisecondsTimeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sleep(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="timeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Abort">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Abort(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stateInfo">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Interrupt">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Join">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Join(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="millisecondsTimeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Join(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="timeout">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Resume">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Start">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Suspend">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadAbortException.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadAbortException.xml
deleted file mode 100644
index ba0c8be21a3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadAbortException.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.ThreadAbortException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="ExceptionState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventArgs.xml
deleted file mode 100644
index 9696b298749..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventArgs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.ThreadExceptionEventArgs" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ThreadExceptionEventArgs(System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t">TODO</param>
- </constructor>
- <property name="Exception">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventHandler.xml
deleted file mode 100644
index 103b641714d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadExceptionEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Threading.ThreadExceptionEventHandler" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadInterruptedException.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadInterruptedException.xml
deleted file mode 100644
index 47bffca396d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadInterruptedException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.ThreadInterruptedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ThreadInterruptedException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ThreadInterruptedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ThreadInterruptedException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadPool.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadPool.xml
deleted file mode 100644
index 18b1ab0a88a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadPool.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.ThreadPool" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="BindHandle(System.IntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="osHandle">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="QueueUserWorkItem(System.Threading.WaitCallback)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="QueueUserWorkItem(System.Threading.WaitCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="millisecondsTimeOutInterval">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.Int64, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="millisecondsTimeOutInterval">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.TimeSpan, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="timeout">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.UInt32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="millisecondsTimeOutInterval">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UnsafeQueueUserWorkItem(System.Threading.WaitCallback, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="millisecondsTimeOutInterval">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.Int64, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="millisecondsTimeOutInterval">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.TimeSpan, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="timeout">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UnsafeRegisterWaitForSingleObject(System.Threading.WaitHandle, System.Threading.WaitOrTimerCallback, System.Object, System.UInt32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitObject">TODO</param>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="millisecondsTimeOutInterval">TODO</param>
- <param name="executeOnlyOnce">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadPriority.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadPriority.xml
deleted file mode 100644
index 4f33a75c6ac..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadPriority.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Threading.ThreadPriority" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadStart.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadStart.xml
deleted file mode 100644
index a916cc25ddc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadStart.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Threading.ThreadStart" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadState.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadState.xml
deleted file mode 100644
index b9f216ebd38..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Threading.ThreadState" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/ThreadStateException.xml b/mcs/docs/apidocs/xml/en/System.Threading/ThreadStateException.xml
deleted file mode 100644
index 4d77ecbc916..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/ThreadStateException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.ThreadStateException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ThreadStateException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ThreadStateException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ThreadStateException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/Timeout.xml b/mcs/docs/apidocs/xml/en/System.Threading/Timeout.xml
deleted file mode 100644
index 3b3ae9ba4d7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/Timeout.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.Timeout" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Infinite">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/Timer.xml b/mcs/docs/apidocs/xml/en/System.Threading/Timer.xml
deleted file mode 100644
index 066fb6487f7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/Timer.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.Timer" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Timer(System.Threading.TimerCallback, System.Object, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- </constructor>
- <constructor name="Timer(System.Threading.TimerCallback, System.Object, System.Int64, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- </constructor>
- <constructor name="Timer(System.Threading.TimerCallback, System.Object, System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- </constructor>
- <constructor name="Timer(System.Threading.TimerCallback, System.Object, System.UInt32, System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="callback">TODO</param>
- <param name="state">TODO</param>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- </constructor>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Change(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Change(System.Int64, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Change(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Change(System.UInt32, System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dueTime">TODO</param>
- <param name="period">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Dispose(System.Threading.WaitHandle)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="notifyObject">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/TimerCallback.xml b/mcs/docs/apidocs/xml/en/System.Threading/TimerCallback.xml
deleted file mode 100644
index 677fb5a8417..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/TimerCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Threading.TimerCallback" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/WaitCallback.xml b/mcs/docs/apidocs/xml/en/System.Threading/WaitCallback.xml
deleted file mode 100644
index be00fa1081e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/WaitCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Threading.WaitCallback" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/WaitHandle.xml b/mcs/docs/apidocs/xml/en/System.Threading/WaitHandle.xml
deleted file mode 100644
index 43cee182318..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/WaitHandle.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Threading.WaitHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="WaitHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="WaitTimeout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Handle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WaitOne(System.TimeSpan, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="timeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitOne(System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="millisecondsTimeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitOne">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WaitAll(System.Threading.WaitHandle[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitHandles">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitAll(System.Threading.WaitHandle[], System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitHandles">TODO</param>
- <param name="millisecondsTimeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitAll(System.Threading.WaitHandle[], System.TimeSpan, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitHandles">TODO</param>
- <param name="timeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitAny(System.Threading.WaitHandle[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitHandles">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitAny(System.Threading.WaitHandle[], System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitHandles">TODO</param>
- <param name="millisecondsTimeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WaitAny(System.Threading.WaitHandle[], System.TimeSpan, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="waitHandles">TODO</param>
- <param name="timeout">TODO</param>
- <param name="exitContext">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Threading/WaitOrTimerCallback.xml b/mcs/docs/apidocs/xml/en/System.Threading/WaitOrTimerCallback.xml
deleted file mode 100644
index 29ebc232baf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Threading/WaitOrTimerCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Threading.WaitOrTimerCallback" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/Cache.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/Cache.xml
deleted file mode 100644
index deb2c68d103..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/Cache.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Caching.Cache" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Cache">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="NoAbsoluteExpiration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="NoSlidingExpiration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="SingletonCache">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Touch(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String, System.Object, System.Web.Caching.CacheDependency, System.DateTime, System.TimeSpan, System.Web.Caching.CacheItemPriority, System.Web.Caching.CacheItemPriorityDecay, System.Web.Caching.CacheItemRemovedCallback)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <param name="objItem">TODO</param>
- <param name="objDependency">TODO</param>
- <param name="absolutExpiration">TODO</param>
- <param name="slidingExpiration">TODO</param>
- <param name="enumPriority">TODO</param>
- <param name="enumPriorityDecay">TODO</param>
- <param name="eventRemoveCallback">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <param name="objItem">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.String, System.Object, System.Web.Caching.CacheDependency)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <param name="objItem">TODO</param>
- <param name="objDependency">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.String, System.Object, System.Web.Caching.CacheDependency, System.DateTime, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <param name="objItem">TODO</param>
- <param name="objDependency">TODO</param>
- <param name="absolutExpiration">TODO</param>
- <param name="slidingExpiration">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.String, System.Object, System.Web.Caching.CacheDependency, System.DateTime, System.TimeSpan, System.Web.Caching.CacheItemPriority, System.Web.Caching.CacheItemPriorityDecay, System.Web.Caching.CacheItemRemovedCallback)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <param name="objItem">TODO</param>
- <param name="objDependency">TODO</param>
- <param name="absolutExpiration">TODO</param>
- <param name="slidingExpiration">TODO</param>
- <param name="enumPriority">TODO</param>
- <param name="enumPriorityDecay">TODO</param>
- <param name="eventRemoveCallback">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Get(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strKey">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependency.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependency.xml
deleted file mode 100644
index df5ea4b025f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependency.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Caching.CacheDependency" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CacheDependencyCallback">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CacheDependencyCallback(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="filename">TODO</param>
- </constructor>
- <constructor name="CacheDependencyCallback(System.String[], System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="filenames">TODO</param>
- <param name="cachekeys">TODO</param>
- </constructor>
- <property name="IsDisposed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasEvents">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="OnChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Signal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <event name="Changed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependencyCallback.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependencyCallback.xml
deleted file mode 100644
index e30271d091f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheDependencyCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.Caching.CacheDependency+CacheDependencyCallback" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheEntry.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheEntry.xml
deleted file mode 100644
index a6b5d209b5b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheEntry.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Caching.CacheEntry" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Flags(System.Web.Caching.Cache, System.String, System.Object, System.Web.Caching.CacheDependency, System.Web.Caching.CacheItemRemovedCallback, System.DateTime, System.TimeSpan, System.Int64, System.Boolean, System.Web.Caching.CacheItemPriority)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objManager">TODO</param>
- <param name="strKey">TODO</param>
- <param name="objItem">TODO</param>
- <param name="objDependency">TODO</param>
- <param name="eventRemove">TODO</param>
- <param name="dtExpires">TODO</param>
- <param name="tsSpan">TODO</param>
- <param name="longMinHits">TODO</param>
- <param name="boolPublic">TODO</param>
- <param name="enumPriority">TODO</param>
- </constructor>
- <property name="HasUsage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasAbsoluteExpiration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasSlidingExpiration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ExpiresBucket">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ExpiresIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Expires">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SlidingExpiration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Key">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Hits">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MinimumHits">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Priority">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="OnChanged(System.Web.Caching.CacheDependency)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objDependency">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Close(System.Web.Caching.CacheItemRemovedReason)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="enumReason">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TestFlag(System.Web.Caching.CacheEntry.Flags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oFlag">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetFlag(System.Web.Caching.CacheEntry.Flags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oFlag">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheExpires.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheExpires.xml
deleted file mode 100644
index 4d7ec30464a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheExpires.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Caching.CacheExpires" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CacheExpires(System.Web.Caching.Cache)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objManager">TODO</param>
- </constructor>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Web.Caching.CacheEntry)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objEntry">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Web.Caching.CacheEntry)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objEntry">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Update(System.Web.Caching.CacheEntry, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objEntry">TODO</param>
- <param name="ticksExpires">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GarbageCleanup(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="State">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriority.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriority.xml
deleted file mode 100644
index 54e64a182ef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriority.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Caching.CacheItemPriority" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriorityDecay.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriorityDecay.xml
deleted file mode 100644
index aaec2241d10..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemPriorityDecay.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Caching.CacheItemPriorityDecay" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedCallback.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedCallback.xml
deleted file mode 100644
index b98a41cafef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.Caching.CacheItemRemovedCallback" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedReason.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedReason.xml
deleted file mode 100644
index 1d1824bd2c1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/CacheItemRemovedReason.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Caching.CacheItemRemovedReason" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresBucket.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresBucket.xml
deleted file mode 100644
index ef83f386dce..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresBucket.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Caching.ExpiresBucket" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ExpiresBucket(System.Byte, System.Web.Caching.Cache)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bucket">TODO</param>
- <param name="objManager">TODO</param>
- </constructor>
- <property name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Add(System.Web.Caching.CacheEntry)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objEntry">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Web.Caching.CacheEntry)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objEntry">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Update(System.Web.Caching.CacheEntry, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objEntry">TODO</param>
- <param name="ticksExpires">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FlushExpiredItems">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresEntry.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresEntry.xml
deleted file mode 100644
index db235e346e7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/ExpiresEntry.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Web.Caching.ExpiresEntry" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="_objEntry">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="_ticksExpires">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="_intNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Caching/Flags.xml b/mcs/docs/apidocs/xml/en/System.Web.Caching/Flags.xml
deleted file mode 100644
index 8122abe8e88..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Caching/Flags.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Caching.CacheEntry+Flags" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Configuration/AuthenticationMode.xml b/mcs/docs/apidocs/xml/en/System.Web.Configuration/AuthenticationMode.xml
deleted file mode 100644
index 6d5f2dc9730..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Configuration/AuthenticationMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Configuration.AuthenticationMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Configuration/ClientTargetSectionHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.Configuration/ClientTargetSectionHandler.xml
deleted file mode 100644
index c5d4a62ba96..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Configuration/ClientTargetSectionHandler.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Configuration.ClientTargetSectionHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ClientTargetSectionHandler">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="KeyAttributeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ValueAttributeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsAuthPasswordFormat.xml b/mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsAuthPasswordFormat.xml
deleted file mode 100644
index e4226dfcab7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsAuthPasswordFormat.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Configuration.FormsAuthPasswordFormat" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsProtectionEnum.xml b/mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsProtectionEnum.xml
deleted file mode 100644
index a125159b178..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Configuration/FormsProtectionEnum.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Configuration.FormsProtectionEnum" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventArgs.xml
deleted file mode 100644
index 012e1779ccc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventArgs.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.AdCreatedEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AdCreatedEventArgs(System.Collections.IDictionary)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="adProperties">TODO</param>
- </constructor>
- <property name="AdProperties">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AlternateText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NavigateUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventHandler.xml
deleted file mode 100644
index 53e7c326040..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdCreatedEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.AdCreatedEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdRotator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdRotator.xml
deleted file mode 100644
index 73d6b28a8bd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/AdRotator.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.AdRotator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AdRotator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AdvertisementFile">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Font">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="KeywordFilter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Target">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="AdCreated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseCompareValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseCompareValidator.xml
deleted file mode 100644
index b496b8fe9eb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseCompareValidator.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.BaseCompareValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CutoffYear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CanConvert(System.String, System.Web.UI.WebControls.ValidationDataType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseDataList.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseDataList.xml
deleted file mode 100644
index c209e508b77..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseDataList.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.BaseDataList" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BaseDataList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Controls">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellPadding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellSpacing">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataKeyField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataKeys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataMember">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GridLines">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HorizontalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataKeysArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="DataBind">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsBindableType(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <event name="SelectedIndexChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseValidator.xml
deleted file mode 100644
index 1862b9813f4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BaseValidator.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.BaseValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="ControlToValidate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Display">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EnableClientScript">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Enabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ErrorMessage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ForeColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsValid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PropertiesValid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RenderUplevel">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Validate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetValidationProperty(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="component">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BorderStyle.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BorderStyle.xml
deleted file mode 100644
index 856bce48377..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BorderStyle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.BorderStyle" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BoundColumn.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BoundColumn.xml
deleted file mode 100644
index 0cf960afc99..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/BoundColumn.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.BoundColumn" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BoundColumn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="thisExpr">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="DataField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataFormatString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InitializeCell(System.Web.UI.WebControls.TableCell, System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <param name="columnIndex">TODO</param>
- <param name="itemType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Button.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Button.xml
deleted file mode 100644
index a8f71a6fdf9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Button.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Button" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Button">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CausesValidation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandArgument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="Click">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="Command">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumn.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumn.xml
deleted file mode 100644
index 2cc6c5a0019..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumn.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ButtonColumn" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ButtonColumn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ButtonType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataTextField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataTextFormatString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InitializeCell(System.Web.UI.WebControls.TableCell, System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <param name="columnIndex">TODO</param>
- <param name="itemType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumnType.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumnType.xml
deleted file mode 100644
index c6e4916800b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ButtonColumnType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ButtonColumnType" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Calendar.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Calendar.xml
deleted file mode 100644
index c3695b83e35..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Calendar.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Calendar" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Calendar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CellPadding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellSpacing">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DayHeaderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DayNameFormat">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DayStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FirstDayOfWeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NextMonthText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NextPrevFormat">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NextPrevStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OtherMonthDayStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrevMonthText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedDate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedDates">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedDayStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectionMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectMonthText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectorStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectWeekText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowDayHeader">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowGridLines">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowNextPrevMonth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowTitle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TitleFormat">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TitleStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TodayDayStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TodaysDate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="VisibleDate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WeekendDayStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="DayRender">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="SelectionChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="VisibleMonthChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarDay.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarDay.xml
deleted file mode 100644
index 2c1b5095405..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarDay.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.CalendarDay" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CalendarDay(System.DateTime, System.Boolean, System.Boolean, System.Boolean, System.Boolean, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <param name="isWeekend">TODO</param>
- <param name="isToday">TODO</param>
- <param name="isSelected">TODO</param>
- <param name="isOtherMonth">TODO</param>
- <param name="dayNumberText">TODO</param>
- </constructor>
- <property name="Date">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DayNumberText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsOtherMonth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSelectable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSelected">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsToday">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsWeekend">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarSelectionMode.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarSelectionMode.xml
deleted file mode 100644
index 9fb88552b82..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CalendarSelectionMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.CalendarSelectionMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBox.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBox.xml
deleted file mode 100644
index 1e612307213..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBox.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.CheckBox" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CheckBox">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AutoPostBack">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Checked">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SaveCheckedViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TextAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="CheckedChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBoxList.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBoxList.xml
deleted file mode 100644
index 51a8ae6db4d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CheckBoxList.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.CheckBoxList" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CheckBoxList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CellPadding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellSpacing">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatColumns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatDirection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatLayout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TextAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventArgs.xml
deleted file mode 100644
index 2ad9335af55..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventArgs.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.CommandEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CommandEventArgs(System.Web.UI.WebControls.CommandEventArgs)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="e">TODO</param>
- </constructor>
- <constructor name="CommandEventArgs(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="commandName">TODO</param>
- <param name="argument">TODO</param>
- </constructor>
- <property name="CommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandArgument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventHandler.xml
deleted file mode 100644
index 1c2a998efbe..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CommandEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.CommandEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CompareValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CompareValidator.xml
deleted file mode 100644
index b5a6275291b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CompareValidator.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.CompareValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CompareValidator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ControlToCompare">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Operator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ValueToCompare">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CustomValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CustomValidator.xml
deleted file mode 100644
index 91ef681da24..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/CustomValidator.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.CustomValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CustomValidator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ClientValidationFunction">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="ServerValidate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGrid.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGrid.xml
deleted file mode 100644
index 9ed82c0bd92..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGrid.xml
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGrid" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGrid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="CancelCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="DeleteCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="EditCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="NextPageCommandArgument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="PageCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="PrevPageCommandArgument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SelectCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SortCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UpdateCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="AllowCustomPaging">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AllowPaging">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AllowSorting">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AlternatingItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AutoGenerateColumns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BackImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Columns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentPageIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EditItemIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EditItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FooterStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PageCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PagerStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PageSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedItem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowFooter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowHeader">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="VirtualItemCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="CancelCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="DeleteCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="EditCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemCreated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemDataBound">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="PageIndexChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="SortCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="UpdateCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumn.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumn.xml
deleted file mode 100644
index 66ba99aabd1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumn.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridColumn" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridColumn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="FooterStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FooterText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SortExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Visible">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DesignMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Owner">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsTrackingViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InitializeCell(System.Web.UI.WebControls.TableCell, System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <param name="columnIndex">TODO</param>
- <param name="itemType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumnCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumnCollection.xml
deleted file mode 100644
index 3dd558a9ce7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridColumnCollection.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridColumnCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridColumnCollection(System.Web.UI.WebControls.DataGrid, System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="owner">TODO</param>
- <param name="columns">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Web.UI.WebControls.DataGridColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAt(System.Int32, System.Web.UI.WebControls.DataGridColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Web.UI.WebControls.DataGridColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Web.UI.WebControls.DataGridColumn)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="column">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventArgs.xml
deleted file mode 100644
index 860aade8bb9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventArgs.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridCommandEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridCommandEventArgs(System.Web.UI.WebControls.DataGridItem, System.Object, System.Web.UI.WebControls.CommandEventArgs)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <param name="commandSource">TODO</param>
- <param name="originalArgs">TODO</param>
- </constructor>
- <property name="CommandSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventHandler.xml
deleted file mode 100644
index cacf0f7aa78..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridCommandEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.DataGridCommandEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItem.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItem.xml
deleted file mode 100644
index ee949082f87..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItem.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridItem" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridItem(System.Int32, System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="itemIndex">TODO</param>
- <param name="dataSetIndex">TODO</param>
- <param name="itemType">TODO</param>
- </constructor>
- <property name="DataItem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataSetIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemCollection.xml
deleted file mode 100644
index a22c4c552b9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemCollection.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridItemCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridItemCollection(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="items">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventArgs.xml
deleted file mode 100644
index d23ea7db5e4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventArgs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridItemEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridItemEventArgs(System.Web.UI.WebControls.DataGridItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- </constructor>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventHandler.xml
deleted file mode 100644
index be441b64acb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridItemEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.DataGridItemEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventArgs.xml
deleted file mode 100644
index 112468b9e3f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventArgs.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridPageChangedEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridPageChangedEventArgs(System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="commandSource">TODO</param>
- <param name="newPageIndex">TODO</param>
- </constructor>
- <property name="CommandSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NewPageIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventHandler.xml
deleted file mode 100644
index 4d03f497d9c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPageChangedEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.DataGridPageChangedEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPagerStyle.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPagerStyle.xml
deleted file mode 100644
index 5e7d082c24e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridPagerStyle.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridPagerStyle" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Mode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NextPageText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrevPageText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PageButtonCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Position">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Visible">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MergeWith(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyFrom(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventArgs.xml
deleted file mode 100644
index f9afd9a5c9e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventArgs.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataGridSortCommandEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataGridSortCommandEventArgs(System.Object, System.Web.UI.WebControls.DataGridCommandEventArgs)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="commandSource">TODO</param>
- <param name="dce">TODO</param>
- </constructor>
- <property name="CommandSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SortExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventHandler.xml
deleted file mode 100644
index 5acd31112c7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataGridSortCommandEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.DataGridSortCommandEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataKeyCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataKeyCollection.xml
deleted file mode 100644
index eebf56fb108..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataKeyCollection.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataKeyCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataKeyCollection(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keys">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataList.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataList.xml
deleted file mode 100644
index 9f56e3af5c4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataList.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataList" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="CancelCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="DeleteCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="EditCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SelectCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UpdateCommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="AlternatingItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AlternatingItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EditItemIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EditItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EditItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ExtractTemplateRows">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FooterStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FooterTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GridLines">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatColumns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatDirection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatLayout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedItem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SeparatorStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SeparatorTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SeparatorItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowHeader">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowFooter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="CancelCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="DeleteCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="EditCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemCreated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemDataBound">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="UpdateCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventArgs.xml
deleted file mode 100644
index 3b01947fea0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventArgs.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataListCommandEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataListCommandEventArgs(System.Web.UI.WebControls.DataListItem, System.Object, System.Web.UI.WebControls.CommandEventArgs)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <param name="commandSource">TODO</param>
- <param name="originalArgs">TODO</param>
- </constructor>
- <property name="CommandSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventHandler.xml
deleted file mode 100644
index 1d8d65bce37..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListCommandEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.DataListCommandEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItem.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItem.xml
deleted file mode 100644
index fc3cb186399..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItem.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataListItem" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataListItem(System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="itemIndex">TODO</param>
- <param name="itemType">TODO</param>
- </constructor>
- <property name="DataItem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="RenderItem(System.Web.UI.HtmlTextWriter, System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="extractRows">TODO</param>
- <param name="tableLayout">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemCollection.xml
deleted file mode 100644
index 8a8cb7e83ee..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemCollection.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataListItemCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataListItemCollection(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="items">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventArgs.xml
deleted file mode 100644
index 5798d8dc566..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventArgs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DataListItemEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataListItemEventArgs(System.Web.UI.WebControls.DataListItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- </constructor>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventHandler.xml
deleted file mode 100644
index 3fd13672382..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DataListItemEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.DataListItemEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayNameFormat.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayNameFormat.xml
deleted file mode 100644
index 1f39d31d5c0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayNameFormat.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.DayNameFormat" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventArgs.xml
deleted file mode 100644
index 1fa1421fd57..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventArgs.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DayRenderEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DayRenderEventArgs(System.Web.UI.WebControls.TableCell, System.Web.UI.WebControls.CalendarDay)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <param name="day">TODO</param>
- </constructor>
- <property name="Cell">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Day">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventHandler.xml
deleted file mode 100644
index f782ca24c0a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DayRenderEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.DayRenderEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DropDownList.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DropDownList.xml
deleted file mode 100644
index 9caa38c4651..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/DropDownList.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.DropDownList" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DropDownList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BorderColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderWidth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ToolTip">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/EditCommandColumn.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/EditCommandColumn.xml
deleted file mode 100644
index 6606f538d48..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/EditCommandColumn.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.EditCommandColumn" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EditCommandColumn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ButtonType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CancelText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EditText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UpdateText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InitializeCell(System.Web.UI.WebControls.TableCell, System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <param name="columnIndex">TODO</param>
- <param name="itemType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FirstDayOfWeek.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FirstDayOfWeek.xml
deleted file mode 100644
index f6f1c512d3c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FirstDayOfWeek.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.FirstDayOfWeek" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontInfo.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontInfo.xml
deleted file mode 100644
index 4c4b3915f54..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontInfo.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.FontInfo" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Bold">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Italic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Overline">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Strikeout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Underline">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Names">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Owner">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyFrom(System.Web.UI.WebControls.FontInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="source">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MergeWith(System.Web.UI.WebControls.FontInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="with">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ShouldSerializeNames">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontNamesConverter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontNamesConverter.xml
deleted file mode 100644
index 8ad052fc23b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontNamesConverter.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.FontNamesConverter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FontNamesConverter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="ConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <param name="destinationType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CanConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="sourceType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontSize.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontSize.xml
deleted file mode 100644
index 5cef1900068..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontSize.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.FontSize" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnit.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnit.xml
deleted file mode 100644
index d9fd7f2a5d4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnit.xml
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Web.UI.WebControls.FontUnit" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FontUnit(System.Web.UI.WebControls.FontSize)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- </constructor>
- <constructor name="FontUnit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="FontUnit(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="FontUnit(System.Web.UI.WebControls.Unit)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="FontUnit(System.String, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="culture">TODO</param>
- </constructor>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Large">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Larger">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Medium">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Small">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Smaller">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="XLarge">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="XSmall">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="XXLarge">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="XXSmall">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="IsEmpty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Unit">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Point(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="n">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.Web.UI.WebControls.FontUnit, System.Web.UI.WebControls.FontUnit)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="left">TODO</param>
- <param name="right">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.Web.UI.WebControls.FontUnit, System.Web.UI.WebControls.FontUnit)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="left">TODO</param>
- <param name="right">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="n">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnitConverter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnitConverter.xml
deleted file mode 100644
index 7f2e45ebe00..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/FontUnitConverter.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.FontUnitConverter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FontUnitConverter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetStandardValues(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <param name="destinationType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CanConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="sourceType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/GridLines.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/GridLines.xml
deleted file mode 100644
index 58baa8e165b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/GridLines.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.GridLines" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HorizontalAlign.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HorizontalAlign.xml
deleted file mode 100644
index 1fa9733d61b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HorizontalAlign.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.HorizontalAlign" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLink.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLink.xml
deleted file mode 100644
index 1eb59990035..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLink.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.HyperLink" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HyperLink">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NavigateUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Target">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkColumn.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkColumn.xml
deleted file mode 100644
index e71995dc55d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkColumn.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.HyperLinkColumn" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HyperLinkColumn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="DataNavigateUrlField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataNavigateUrlFormatString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataTextField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataTextFormatString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NavigateUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Target">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InitializeCell(System.Web.UI.WebControls.TableCell, System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <param name="columnIndex">TODO</param>
- <param name="itemType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Initialize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkControlBuilder.xml
deleted file mode 100644
index 2999f2d7b28..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/HyperLinkControlBuilder.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.HyperLinkControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HyperLinkControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/IRepeatInfoUser.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/IRepeatInfoUser.xml
deleted file mode 100644
index 25fa2633699..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/IRepeatInfoUser.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.WebControls.IRepeatInfoUser" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Image.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Image.xml
deleted file mode 100644
index 71f8ccf52d5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Image.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Image" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Image">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AlternateText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Enabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Font">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ImageAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageAlign.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageAlign.xml
deleted file mode 100644
index 6482c1bfc58..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageAlign.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ImageAlign" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageButton.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageButton.xml
deleted file mode 100644
index 71a6196222a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ImageButton.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ImageButton" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ImageButton">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CausesValidation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandArgument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TagKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="Click">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="Command">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Label.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Label.xml
deleted file mode 100644
index 7a1a74c46f7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Label.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Label" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Label">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LabelControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LabelControlBuilder.xml
deleted file mode 100644
index 44c93a55267..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LabelControlBuilder.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.LabelControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LabelControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButton.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButton.xml
deleted file mode 100644
index 04f143a5894..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButton.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.LinkButton" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LinkButton">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CausesValidation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandArgument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CommandName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="Click">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="Command">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButtonControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButtonControlBuilder.xml
deleted file mode 100644
index 13d87cc1b8b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LinkButtonControlBuilder.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.LinkButtonControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LinkButtonControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListBox.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListBox.xml
deleted file mode 100644
index 8b6e0c4eacd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListBox.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ListBox" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ListBox">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BorderColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderWidth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Rows">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectionMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ToolTip">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListControl.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListControl.xml
deleted file mode 100644
index 68082d44820..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListControl.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ListControl" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ListControl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AutoPostBack">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataMember">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataTextField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataTextFormatString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataValueField">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedItem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SelectedIndices">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SaveSelectedIndicesViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ClearSelection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <event name="SelectedIndexChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItem.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItem.xml
deleted file mode 100644
index a13df37e66d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItem.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ListItem" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ListItem(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="ListItem(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- </constructor>
- <constructor name="ListItem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Selected">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Dirty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsTrackingViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="FromString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemCollection.xml
deleted file mode 100644
index da2774dcd51..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemCollection.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ListItemCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ListItemCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Capacity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Web.UI.WebControls.ListItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.Web.UI.WebControls.ListItem[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="items">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Web.UI.WebControls.ListItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FindByText(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FindByValue(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Web.UI.WebControls.ListItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Web.UI.WebControls.ListItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Web.UI.WebControls.ListItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemControlBuilder.xml
deleted file mode 100644
index 5b1027ef790..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemControlBuilder.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ListItemControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ListItemControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="HtmlDecodeLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemType.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemType.xml
deleted file mode 100644
index 8382b3c0738..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListItemType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ListItemType" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListSelectionMode.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListSelectionMode.xml
deleted file mode 100644
index bf46ca30284..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ListSelectionMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ListSelectionMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Literal.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Literal.xml
deleted file mode 100644
index 74bb0c4f226..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Literal.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Literal" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Literal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LiteralControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LiteralControlBuilder.xml
deleted file mode 100644
index 2088f45dabb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/LiteralControlBuilder.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.LiteralControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LiteralControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="AppendSubBuilder(System.Web.UI.ControlBuilder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="subBuilder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventArgs.xml
deleted file mode 100644
index 51f3fb2269e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventArgs.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.MonthChangedEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MonthChangedEventArgs(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newDate">TODO</param>
- <param name="previousDate">TODO</param>
- </constructor>
- <property name="NewDate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PreviousDate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventHandler.xml
deleted file mode 100644
index 62939c7efaa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/MonthChangedEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.MonthChangedEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/NextPrevFormat.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/NextPrevFormat.xml
deleted file mode 100644
index b710a1c2074..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/NextPrevFormat.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.NextPrevFormat" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagedDataSource.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagedDataSource.xml
deleted file mode 100644
index d65603c64cb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagedDataSource.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.PagedDataSource" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PagedDataSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AllowCustomPaging">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AllowPaging">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentPageIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataSourceCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FirstIndexInPage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCustomPagingEnabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFirstPage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsLastPage">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPagingEnabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PageCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PageSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="VirtualCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetItemProperties(System.ComponentModel.PropertyDescriptor[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="listAccessors">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetListName(System.ComponentModel.PropertyDescriptor[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="listAccessors">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerMode.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerMode.xml
deleted file mode 100644
index 5924b8703ee..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.PagerMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerPosition.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerPosition.xml
deleted file mode 100644
index f7de2c87434..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PagerPosition.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.PagerPosition" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Panel.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Panel.xml
deleted file mode 100644
index d44b366aae9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Panel.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Panel" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Panel">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BackImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HorizontalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Wrap">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolder.xml
deleted file mode 100644
index 265c249c755..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolder.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.PlaceHolder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PlaceHolder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolderControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolderControlBuilder.xml
deleted file mode 100644
index 19b91fdb1d1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/PlaceHolderControlBuilder.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.PlaceHolderControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PlaceHolderControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButton.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButton.xml
deleted file mode 100644
index e9a85763de1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButton.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RadioButton" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RadioButton">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="GroupName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UniqueGroupNamePrivate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ValueAttributePrivate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButtonList.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButtonList.xml
deleted file mode 100644
index 084c16f5d07..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RadioButtonList.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RadioButtonList" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RadioButtonList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="CellPadding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellSpacing">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatColumns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatDirection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatLayout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TextAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RangeValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RangeValidator.xml
deleted file mode 100644
index a0a18ba3167..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RangeValidator.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RangeValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RangeValidator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="MaximumValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MinimumValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RegularExpressionValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RegularExpressionValidator.xml
deleted file mode 100644
index 62ef297b9dc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RegularExpressionValidator.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RegularExpressionValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RegularExpressionValidator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ValidationExpression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatDirection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatDirection.xml
deleted file mode 100644
index 085919ea6e4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatDirection.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.RepeatDirection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatInfo.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatInfo.xml
deleted file mode 100644
index 5358d08e881..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatInfo.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RepeatInfo" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RepeatInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="OuterTableImplied">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatColumns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatDirection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RepeatLayout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="RenderRepeater(System.Web.UI.HtmlTextWriter, System.Web.UI.WebControls.IRepeatInfoUser, System.Web.UI.WebControls.Style, System.Web.UI.WebControls.WebControl)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="user">TODO</param>
- <param name="controlStyle">TODO</param>
- <param name="baseControl">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatLayout.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatLayout.xml
deleted file mode 100644
index a6a6bb35a97..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeatLayout.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.RepeatLayout" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Repeater.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Repeater.xml
deleted file mode 100644
index 9c59361e3e8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Repeater.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Repeater" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Repeater">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AlternatingItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Controls">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataMember">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DataSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FooterTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SeparatorTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="DataBind">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <event name="ItemCommand">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemCreated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ItemDataBound">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventArgs.xml
deleted file mode 100644
index a12980be588..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventArgs.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RepeaterCommandEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RepeaterCommandEventArgs(System.Web.UI.WebControls.RepeaterItem, System.Object, System.Web.UI.WebControls.CommandEventArgs)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <param name="commandSource">TODO</param>
- <param name="originalArgs">TODO</param>
- </constructor>
- <property name="CommandSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventHandler.xml
deleted file mode 100644
index 93511d98951..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterCommandEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.RepeaterCommandEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItem.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItem.xml
deleted file mode 100644
index 2e65dded93c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItem.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RepeaterItem" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RepeaterItem(System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="itemIndex">TODO</param>
- <param name="itemType">TODO</param>
- </constructor>
- <property name="DataItem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemCollection.xml
deleted file mode 100644
index f1ee3d0d605..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemCollection.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RepeaterItemCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RepeaterItemCollection(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="items">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventArgs.xml
deleted file mode 100644
index 2d16ae80510..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventArgs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RepeaterItemEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RepeaterItemEventArgs(System.Web.UI.WebControls.RepeaterItem)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- </constructor>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventHandler.xml
deleted file mode 100644
index 699cba83b44..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RepeaterItemEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.RepeaterItemEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RequiredFieldValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RequiredFieldValidator.xml
deleted file mode 100644
index 68ed9a3fe34..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/RequiredFieldValidator.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.RequiredFieldValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RequiredFieldValidator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="InitialValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/SelectedDatesCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/SelectedDatesCollection.xml
deleted file mode 100644
index c3cfeb1795a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/SelectedDatesCollection.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.SelectedDatesCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SelectedDatesCollection(System.Collections.ArrayList)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dateList">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="date">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectRange(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fromDate">TODO</param>
- <param name="toDate">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventArgs.xml
deleted file mode 100644
index 7090ac1b1af..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventArgs.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ServerValidateEventArgs" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ServerValidateEventArgs(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="isValid">TODO</param>
- </constructor>
- <property name="IsValid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventHandler.xml
deleted file mode 100644
index d2b2250bb26..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ServerValidateEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.WebControls.ServerValidateEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Style.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Style.xml
deleted file mode 100644
index a6026260f02..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Style.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Style" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Style">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Style(System.Web.UI.StateBag)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bag">TODO</param>
- </constructor>
- <property name="ViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BackColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderWidth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CssClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ForeColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Height">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Width">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Font">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsEmpty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsTrackingViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MergeWith(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="with">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyFrom(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="source">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAttributesToRender(System.Web.UI.HtmlTextWriter, System.Web.UI.WebControls.WebControl)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="owner">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddAttributesToRender(System.Web.UI.HtmlTextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Table.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Table.xml
deleted file mode 100644
index 34edf1058c6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Table.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Table" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Table">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BackImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellPadding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellSpacing">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GridLines">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HorizontalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Rows">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCell.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCell.xml
deleted file mode 100644
index 1a4cda11393..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCell.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableCell" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TableCell">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ColumnSpan">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RowSpan">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HorizontalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="VerticalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Wrap">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellCollection.xml
deleted file mode 100644
index 761d44c229c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellCollection.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableCellCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Web.UI.WebControls.TableCell)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAt(System.Int32, System.Web.UI.WebControls.TableCell)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="cell">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.Web.UI.WebControls.TableCell[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cells">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCellIndex(System.Web.UI.WebControls.TableCell)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Web.UI.WebControls.TableCell)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellControlBuilder.xml
deleted file mode 100644
index a0b244c39a7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableCellControlBuilder.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableCellControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TableCellControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableHeaderCell.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableHeaderCell.xml
deleted file mode 100644
index f28dfdec4ee..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableHeaderCell.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableHeaderCell" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TableHeaderCell">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableItemStyle.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableItemStyle.xml
deleted file mode 100644
index b302c502c74..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableItemStyle.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableItemStyle" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TableItemStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TableItemStyle(System.Web.UI.StateBag)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bag">TODO</param>
- </constructor>
- <property name="HorizontalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="VerticalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Wrap">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MergeWith(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyFrom(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAttributesToRender(System.Web.UI.HtmlTextWriter, System.Web.UI.WebControls.WebControl)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="owner">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRow.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRow.xml
deleted file mode 100644
index 7934db63bb6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRow.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableRow" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TableRow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Cells">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HorizontalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="VerticalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRowCollection.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRowCollection.xml
deleted file mode 100644
index 40125de0f5f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableRowCollection.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableRowCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Web.UI.WebControls.TableRow)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="row">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAt(System.Int32, System.Web.UI.WebControls.TableRow)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="row">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddRange(System.Web.UI.WebControls.TableRow[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rows">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetRowIndex(System.Web.UI.WebControls.TableRow)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="row">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Web.UI.WebControls.TableRow)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="row">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableStyle.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableStyle.xml
deleted file mode 100644
index 6b88020e958..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TableStyle.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TableStyle" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TableStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TableStyle(System.Web.UI.StateBag)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bag">TODO</param>
- </constructor>
- <property name="BackImageUrl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellPadding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CellSpacing">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GridLines">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HorizontalAlign">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MergeWith(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyFrom(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAttributesToRender(System.Web.UI.HtmlTextWriter, System.Web.UI.WebControls.WebControl)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="owner">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TargetConverter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TargetConverter.xml
deleted file mode 100644
index e1af0f07093..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TargetConverter.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TargetConverter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TargetConverter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetStandardValues(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TemplateColumn.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TemplateColumn.xml
deleted file mode 100644
index 1a759c5108b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TemplateColumn.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TemplateColumn" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TemplateColumn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="EditItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FooterTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemTemplate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InitializeCell(System.Web.UI.WebControls.TableCell, System.Int32, System.Web.UI.WebControls.ListItemType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cell">TODO</param>
- <param name="columnIndex">TODO</param>
- <param name="itemType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextAlign.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextAlign.xml
deleted file mode 100644
index 9d974b4527b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextAlign.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.TextAlign" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBox.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBox.xml
deleted file mode 100644
index 3c396c9ee48..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBox.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TextBox" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TextBox">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AutoPostBack">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Columns">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MaxLength">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Rows">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TextMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Wrap">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TagKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <event name="TextChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxControlBuilder.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxControlBuilder.xml
deleted file mode 100644
index fe14b700460..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxControlBuilder.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.TextBoxControlBuilder" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TextBoxControlBuilder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="HtmlDecodeLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AllowWhitespaceLiterals">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxMode.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxMode.xml
deleted file mode 100644
index 78d879f9748..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TextBoxMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.TextBoxMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TitleFormat.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TitleFormat.xml
deleted file mode 100644
index 2a0d32e23e0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/TitleFormat.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.TitleFormat" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Unit.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Unit.xml
deleted file mode 100644
index 28294efe9ea..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Unit.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Web.UI.WebControls.Unit" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Unit(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="Unit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="Unit(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="Unit(System.Double, System.Web.UI.WebControls.UnitType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="type">TODO</param>
- </constructor>
- <constructor name="Unit(System.String, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="culture">TODO</param>
- </constructor>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="IsEmpty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Type">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Percentage(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="n">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Pixel(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="n">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Point(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="n">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.Web.UI.WebControls.Unit, System.Web.UI.WebControls.Unit)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="left">TODO</param>
- <param name="right">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.Web.UI.WebControls.Unit, System.Web.UI.WebControls.Unit)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="left">TODO</param>
- <param name="right">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="n">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitConverter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitConverter.xml
deleted file mode 100644
index 6a97eb416da..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitConverter.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.UnitConverter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UnitConverter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="ConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <param name="destinationType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CanConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="sourceType">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitType.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitType.xml
deleted file mode 100644
index 827bc30c564..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/UnitType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.UnitType" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatedControlConverter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatedControlConverter.xml
deleted file mode 100644
index b4141cd470a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatedControlConverter.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ValidatedControlConverter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ValidatedControlConverter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetStandardValues(System.ComponentModel.ITypeDescriptorContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationCompareOperator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationCompareOperator.xml
deleted file mode 100644
index 37f8ccffd84..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationCompareOperator.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ValidationCompareOperator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationDataType.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationDataType.xml
deleted file mode 100644
index af6cb6b1eed..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationDataType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ValidationDataType" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummary.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummary.xml
deleted file mode 100644
index 5f41b3e3cf5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummary.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.ValidationSummary" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ValidationSummary">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="DisplayMode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EnableClientScript">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ForeColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowMessageBox">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShowSummary">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HeaderText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummaryDisplayMode.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummaryDisplayMode.xml
deleted file mode 100644
index 2c0f858c4a1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidationSummaryDisplayMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ValidationSummaryDisplayMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatorDisplay.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatorDisplay.xml
deleted file mode 100644
index c5c0fb1b269..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/ValidatorDisplay.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.ValidatorDisplay" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/VerticalAlign.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/VerticalAlign.xml
deleted file mode 100644
index d566d156b84..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/VerticalAlign.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.WebControls.VerticalAlign" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebColorConverter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebColorConverter.xml
deleted file mode 100644
index 62641617e4e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebColorConverter.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.WebColorConverter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="WebColorConverter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="ConvertTo(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <param name="destinationType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="context">TODO</param>
- <param name="culture">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebControl.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebControl.xml
deleted file mode 100644
index 46e2f9d3e92..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/WebControl.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.WebControl" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="WebControl(System.Web.UI.HtmlTextWriterTag)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tag">TODO</param>
- </constructor>
- <property name="AccessKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BackColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BorderWidth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ControlStyle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ControlStyleCreated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CssClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Enabled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Font">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ForeColor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Height">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Style">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TabIndex">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ToolTip">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Width">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TagKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TagName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="RenderEndTag(System.Web.UI.HtmlTextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RenderBeginTag(System.Web.UI.HtmlTextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ApplyStyle(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyBaseAttributes(System.Web.UI.WebControls.WebControl)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="controlSrc">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MergeStyle(System.Web.UI.WebControls.Style)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Xml.xml b/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Xml.xml
deleted file mode 100644
index aff03e77704..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI.WebControls/Xml.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.WebControls.Xml" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Document">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DocumentContent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DocumentSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Transform">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TransformSource">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TransformArgumentList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/BuildMethod.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/BuildMethod.xml
deleted file mode 100644
index 9f01cdea29b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/BuildMethod.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.BuildMethod" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/BuildTemplateMethod.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/BuildTemplateMethod.xml
deleted file mode 100644
index 1b9162e5ccc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/BuildTemplateMethod.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.BuildTemplateMethod" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/Control.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/Control.xml
deleted file mode 100644
index 1ad9759f6b6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/Control.xml
+++ /dev/null
@@ -1,171 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.Control" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Control">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ClientID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Controls">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EnableViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamingContainer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Page">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Parent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Site">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TemplateSourceDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UniqueID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Visible">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ChildControlsCreated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Context">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Events">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasChildViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsTrackingViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ViewStateIgnoresCase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Dispose">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="HasControls">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="FindControl(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="id">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DataBind">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="RenderControl(System.Web.UI.HtmlTextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ResolveUrl(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="relativeUrl">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetRenderMethodDelegate(System.Web.UI.RenderMethod)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="renderMethod">TODO</param>
- <returns>TODO</returns>
- </method>
- <event name="DataBinding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="Disposed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="Init">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="Load">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="PreRender">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="Unload">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/DataBindingHandlerAttribute.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/DataBindingHandlerAttribute.xml
deleted file mode 100644
index 7717da85b4b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/DataBindingHandlerAttribute.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.DataBindingHandlerAttribute" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DataBindingHandlerAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DataBindingHandlerAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="typeName">TODO</param>
- </constructor>
- <constructor name="DataBindingHandlerAttribute(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- </constructor>
- <field name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="HandlerTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/DesignTimeParseData.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/DesignTimeParseData.xml
deleted file mode 100644
index df5d993d5ec..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/DesignTimeParseData.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.DesignTimeParseData" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DesignTimeParseData">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="InDesigner">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriter.xml
deleted file mode 100644
index 95f2ca2a694..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriter.xml
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.HtmlTextWriter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HtmlTextWriter(System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- </constructor>
- <constructor name="HtmlTextWriter(System.IO.TextWriter, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="tabString">TODO</param>
- </constructor>
- <field name="DefaultTabString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="DoubleQuoteChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="EndTagLeftChars">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="EqualsChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="EqualsDoubleQuoteString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SelfClosingChars">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SelfClosingTagEnd">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SemicolonChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SingleQuoteChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SlashChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="SpaceChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="StyleEqualsChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TagLeftChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TagRightChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Indent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerWriter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NewLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TagKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TagName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteStyleAttribute(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <param name="fEncode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStyleAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteFullBeginTag(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tagName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteEndTag(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tagName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteBeginTag(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tagName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteAttribute(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <param name="fEncode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RenderEndTag">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="RenderBeginTag(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tagName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RenderBeginTag(System.Web.UI.HtmlTextWriterTag)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="tagKey">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddStyleAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddStyleAttribute(System.Web.UI.HtmlTextWriterStyle, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAttribute(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <param name="fEndode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAttribute(System.Web.UI.HtmlTextWriterAttribute, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <param name="fEncode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddAttribute(System.Web.UI.HtmlTextWriterAttribute, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteLineNoTabs(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterAttribute.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterAttribute.xml
deleted file mode 100644
index bb2ca9d4e9f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterAttribute.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.HtmlTextWriterAttribute" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterStyle.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterStyle.xml
deleted file mode 100644
index 203137709e8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterStyle.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.HtmlTextWriterStyle" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterTag.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterTag.xml
deleted file mode 100644
index a392625cbcc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/HtmlTextWriterTag.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.HtmlTextWriterTag" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/IAttributeAccessor.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/IAttributeAccessor.xml
deleted file mode 100644
index e5b654baa73..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/IAttributeAccessor.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.IAttributeAccessor" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/IDataBindingsAccessor.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/IDataBindingsAccessor.xml
deleted file mode 100644
index e1dd05c4f90..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/IDataBindingsAccessor.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.IDataBindingsAccessor" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/INamingContainer.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/INamingContainer.xml
deleted file mode 100644
index f9523b4563f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/INamingContainer.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.INamingContainer" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/IParserAccessor.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/IParserAccessor.xml
deleted file mode 100644
index bea43a15a98..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/IParserAccessor.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.IParserAccessor" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackDataHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackDataHandler.xml
deleted file mode 100644
index f4fbb2344a5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackDataHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.IPostBackDataHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackEventHandler.xml
deleted file mode 100644
index 6a8eb1746ba..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/IPostBackEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.IPostBackEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/IStateManager.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/IStateManager.xml
deleted file mode 100644
index 82787116fdd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/IStateManager.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.IStateManager" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/ITagNameToTypeMapper.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/ITagNameToTypeMapper.xml
deleted file mode 100644
index cf4cc78ea5e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/ITagNameToTypeMapper.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.ITagNameToTypeMapper" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/ITemplate.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/ITemplate.xml
deleted file mode 100644
index b229b42f18b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/ITemplate.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.ITemplate" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/IValidator.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/IValidator.xml
deleted file mode 100644
index 6d17c690ac2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/IValidator.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Web.UI.IValidator" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/ImageClickEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/ImageClickEventHandler.xml
deleted file mode 100644
index eac19e160c2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/ImageClickEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.UI.ImageClickEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/LiteralControl.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/LiteralControl.xml
deleted file mode 100644
index 275e1291473..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/LiteralControl.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.LiteralControl" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LiteralControl">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="LiteralControl(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- </constructor>
- <property name="Text">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/OutputCacheLocation.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/OutputCacheLocation.xml
deleted file mode 100644
index eaac300ce41..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/OutputCacheLocation.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.OutputCacheLocation" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/Pair.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/Pair.xml
deleted file mode 100644
index 2bdb4e8a463..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/Pair.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.Pair" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Pair(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="first">TODO</param>
- <param name="second">TODO</param>
- </constructor>
- <constructor name="Pair">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="First">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Second">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/PersistenceMode.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/PersistenceMode.xml
deleted file mode 100644
index 6a164cb1d23..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/PersistenceMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.UI.PersistenceMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/PropertyConverter.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/PropertyConverter.xml
deleted file mode 100644
index b024c9104e5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/PropertyConverter.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.PropertyConverter" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="EnumFromString(System.Type, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="enumType">TODO</param>
- <param name="enumValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EnumToString(System.Type, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="enumType">TODO</param>
- <param name="enumValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ObjectFromString(System.Type, System.Reflection.MemberInfo, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objType">TODO</param>
- <param name="propertyInfo">TODO</param>
- <param name="objValue">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/StateBag.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/StateBag.xml
deleted file mode 100644
index 57f89903859..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/StateBag.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.StateBag" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StateBag(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ignoreCase">TODO</param>
- </constructor>
- <constructor name="StateBag">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Keys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Values">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsTrackingViewState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsItemDirty(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetItemDirty(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="dirty">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/StateItem.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/StateItem.xml
deleted file mode 100644
index 01e44ddaaac..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/StateItem.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.StateItem" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="IsDirty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.UI/ToolboxDataAttribute.xml b/mcs/docs/apidocs/xml/en/System.Web.UI/ToolboxDataAttribute.xml
deleted file mode 100644
index d0ae0f2182e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.UI/ToolboxDataAttribute.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.UI.ToolboxDataAttribute" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ToolboxDataAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- </constructor>
- <field name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="IsDefaultAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Utils/FileAction.xml b/mcs/docs/apidocs/xml/en/System.Web.Utils/FileAction.xml
deleted file mode 100644
index 085d6f56cb9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Utils/FileAction.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.Utils.FileAction" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Utils/FileChangeEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.Utils/FileChangeEventHandler.xml
deleted file mode 100644
index b255403ac43..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Utils/FileChangeEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.Utils.FileChangeEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Utils/NativeFileChangeEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web.Utils/NativeFileChangeEventHandler.xml
deleted file mode 100644
index b21ed12a57e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Utils/NativeFileChangeEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.Utils.NativeFileChangeEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Utils/WebEqualComparer.xml b/mcs/docs/apidocs/xml/en/System.Web.Utils/WebEqualComparer.xml
deleted file mode 100644
index 01eef6d0228..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Utils/WebEqualComparer.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Utils.WebEqualComparer" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="WebEqualComparer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web.Utils/WebHashCodeProvider.xml b/mcs/docs/apidocs/xml/en/System.Web.Utils/WebHashCodeProvider.xml
deleted file mode 100644
index 9cc1abdd2ca..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web.Utils/WebHashCodeProvider.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.Utils.WebHashCodeProvider" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="WebHashCodeProvider">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Default">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/BeginEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web/BeginEventHandler.xml
deleted file mode 100644
index 0c60b68a4ea..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/BeginEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.BeginEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/EndEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Web/EndEventHandler.xml
deleted file mode 100644
index 711987b13e0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/EndEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.EndEventHandler" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/EndOfSendNotification.xml b/mcs/docs/apidocs/xml/en/System.Web/EndOfSendNotification.xml
deleted file mode 100644
index 8cf577faf3a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/EndOfSendNotification.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Web.HttpWorkerRequest+EndOfSendNotification" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpCacheRevalidation.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpCacheRevalidation.xml
deleted file mode 100644
index 967947fc262..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpCacheRevalidation.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.HttpCacheRevalidation" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpCacheability.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpCacheability.xml
deleted file mode 100644
index b10489cef05..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpCacheability.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.HttpCacheability" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpCookie.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpCookie.xml
deleted file mode 100644
index 7bfaa9332d7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpCookie.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.HttpCookie" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HttpCookie(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <constructor name="HttpCookie(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- </constructor>
- <property name="Domain">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Expires">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasKeys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Path">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Secure">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Values">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpCookieCollection.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpCookieCollection.xml
deleted file mode 100644
index 938631012d4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpCookieCollection.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.HttpCookieCollection" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HttpCookieCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AllKeys">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Add(System.Web.HttpCookie)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cookie">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dest">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetKey(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Set(System.Web.HttpCookie)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="cookie">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpRuntime.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpRuntime.xml
deleted file mode 100644
index 5277ade0168..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpRuntime.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.HttpRuntime" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HttpRuntime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Cache">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AppDomainAppId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AppDomainAppPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AppDomainAppVirtualPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AppDomainId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AspInstallDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BinDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ClrInstallDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CodegenDir">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsOnUNCShare">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MachineConfigurationDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AppPathDiscovery">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ControlPrincipal">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Reflection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SensitiveInformation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnmanagedCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Unrestricted">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpServerUtility.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpServerUtility.xml
deleted file mode 100644
index 99708dc3a92..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpServerUtility.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.HttpServerUtility" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="HttpServerUtility">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="MachineName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ScriptTimeout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ClearError">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateObject(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="progID">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateObject(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateObjectFromClsid(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="clsid">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Execute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Execute(System.String, System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLastError">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="HtmlDecode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HtmlDecode(System.String, System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="output">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HtmlEncode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HtmlEncode(System.String, System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="output">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MapPath(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Transfer(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Transfer(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <param name="preserveForm">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UrlDecode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UrlDecode(System.String, System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="output">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UrlEncode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UrlEncode(System.String, System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="output">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="UrlPathEncode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpValidationStatus.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpValidationStatus.xml
deleted file mode 100644
index 2ed1766c4b4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpValidationStatus.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.HttpValidationStatus" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/HttpWorkerRequest.xml b/mcs/docs/apidocs/xml/en/System.Web/HttpWorkerRequest.xml
deleted file mode 100644
index 8bf2dd0c926..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/HttpWorkerRequest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Web.HttpWorkerRequest" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EndOfSendNotification">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/ProcessShutdownReason.xml b/mcs/docs/apidocs/xml/en/System.Web/ProcessShutdownReason.xml
deleted file mode 100644
index 75d7eb81a61..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/ProcessShutdownReason.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.ProcessShutdownReason" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/ProcessStatus.xml b/mcs/docs/apidocs/xml/en/System.Web/ProcessStatus.xml
deleted file mode 100644
index 7d85fa562c0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/ProcessStatus.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.ProcessStatus" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Web/TraceMode.xml b/mcs/docs/apidocs/xml/en/System.Web/TraceMode.xml
deleted file mode 100644
index 1fe58d1a5f2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Web/TraceMode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Web.TraceMode" assembly="System.Web">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventArgs.xml
deleted file mode 100644
index 0074606703b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventArgs.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.ValidationEventArgs" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Exception">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Severity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventHandler.xml
deleted file mode 100644
index 2406235558b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/ValidationEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Xml.Schema.ValidationEventHandler" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchema.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchema.xml
deleted file mode 100644
index 48ab802eb39..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchema.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchema" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchema">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="InstanceNamespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="AttributeFormDefault">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AttributeGroups">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BlockDefault">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ElementFormDefault">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Elements">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FinalDefault">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Groups">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Id">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Includes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCompiled">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Notations">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SchemaTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TargetNamespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnhandledAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Language">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Compile(System.Xml.Schema.ValidationEventHandler)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="validationEventHandler">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.IO.TextReader, System.Xml.Schema.ValidationEventHandler)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="reader">TODO</param>
- <param name="validationEventHandler">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.IO.Stream, System.Xml.Schema.ValidationEventHandler)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="validationEventHandler">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read(System.Xml.XmlReader, System.Xml.Schema.ValidationEventHandler)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="reader">TODO</param>
- <param name="validationEventHandler">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.IO.Stream, System.Xml.XmlNamespaceManager)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="stream">TODO</param>
- <param name="namespaceManager">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.IO.TextWriter, System.Xml.XmlNamespaceManager)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="namespaceManager">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Xml.XmlWriter, System.Xml.XmlNamespaceManager)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <param name="namespaceManager">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAll.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAll.xml
deleted file mode 100644
index b9ed588375f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAll.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAll" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAll">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotated.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotated.xml
deleted file mode 100644
index ba8b400c76c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotated.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAnnotated" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAnnotated">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Annotation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Id">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnhandledAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotation.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotation.xml
deleted file mode 100644
index 4257581a80d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnnotation.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAnnotation" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAnnotation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Id">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnhandledAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAny.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAny.xml
deleted file mode 100644
index e822dda3812..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAny.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAny" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAny">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProcessContents">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnyAttribute.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnyAttribute.xml
deleted file mode 100644
index ad401ea0a57..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAnyAttribute.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAnyAttribute" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAnyAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ProcessContents">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAppInfo.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAppInfo.xml
deleted file mode 100644
index 77912b20c4b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAppInfo.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAppInfo" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAppInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Markup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Source">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttribute.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttribute.xml
deleted file mode 100644
index c3112798ee1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttribute.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAttribute" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AttributeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DefaultValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FixedValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Form">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="QualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RefName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SchemaType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SchemaTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Use">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroup.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroup.xml
deleted file mode 100644
index 71a4f94f483..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroup.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAttributeGroup" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAttributeGroup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AnyAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RedefinedAttributeGroup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroupRef.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroupRef.xml
deleted file mode 100644
index 3b43321dc77..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaAttributeGroupRef.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaAttributeGroupRef" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaAttributeGroupRef">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="RefName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaChoice.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaChoice.xml
deleted file mode 100644
index 1bd5f6d9804..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaChoice.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaChoice" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaChoice">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollection.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollection.xml
deleted file mode 100644
index 363bf38bab6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollection.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaCollection" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="XmlSchemaCollection(System.Xml.XmlNameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nametable">TODO</param>
- </constructor>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Add(System.String, System.Xml.XmlReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ns">TODO</param>
- <param name="reader">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ns">TODO</param>
- <param name="uri">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Xml.Schema.XmlSchema)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="schema">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Xml.Schema.XmlSchemaCollection)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="schema">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Xml.Schema.XmlSchema)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="schema">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Xml.Schema.XmlSchema[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <event name="ValidationEventHandler">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollectionEnumerator.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollectionEnumerator.xml
deleted file mode 100644
index 399a6f2be2c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaCollectionEnumerator.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaCollectionEnumerator" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Current">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="MoveNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContent.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContent.xml
deleted file mode 100644
index 7d945f9a4ce..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContent.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaComplexContent" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaComplexContent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Content">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMixed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentExtension.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentExtension.xml
deleted file mode 100644
index 710d219e57f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentExtension.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaComplexContentExtension" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaComplexContentExtension">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AnyAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Particle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentRestriction.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentRestriction.xml
deleted file mode 100644
index 0f717fd3e35..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexContentRestriction.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaComplexContentRestriction" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaComplexContentRestriction">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AnyAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Particle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexType.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexType.xml
deleted file mode 100644
index 2f426b78c08..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaComplexType.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaComplexType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaComplexType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Block">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAbstract">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMixed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AnyAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ContentModel">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Particle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AttributeUses">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AttributeWildcard">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BlockResolved">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ContentType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ContentTypeParticle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContent.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContent.xml
deleted file mode 100644
index c89646367a4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContent.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaContent" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentModel.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentModel.xml
deleted file mode 100644
index 6d5c2088765..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentModel.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaContentModel" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Content">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentProcessing.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentProcessing.xml
deleted file mode 100644
index e36b7e84ad7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentProcessing.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.Schema.XmlSchemaContentProcessing" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentType.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentType.xml
deleted file mode 100644
index d73d8537db5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaContentType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.Schema.XmlSchemaContentType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDatatype.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDatatype.xml
deleted file mode 100644
index afe65a6b627..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDatatype.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaDatatype" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="TokenizedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ValueType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ParseValue(System.String, System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="nameTable">TODO</param>
- <param name="nsmgr">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDerivationMethod.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDerivationMethod.xml
deleted file mode 100644
index ea0df9878bb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDerivationMethod.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.Schema.XmlSchemaDerivationMethod" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDocumentation.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDocumentation.xml
deleted file mode 100644
index 442ecacd2d3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaDocumentation.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaDocumentation" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaDocumentation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Markup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Source">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Language">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaElement.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaElement.xml
deleted file mode 100644
index 2326615f301..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaElement.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaElement" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="IsAbstract">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Block">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DefaultValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Final">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FixedValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Form">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNillable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RefName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SchemaTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SubstitutionGroup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Constraints">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SchemaType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BlockResolved">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ElementType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FinalResolved">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="QualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaEnumerationFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaEnumerationFacet.xml
deleted file mode 100644
index 29f758db2d0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaEnumerationFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaEnumerationFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaEnumerationFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaException.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaException.xml
deleted file mode 100644
index 9ab0f104ca5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaException.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaException" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- <property name="LineNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LinePosition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SourceSchemaObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SourceUri">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaExternal.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaExternal.xml
deleted file mode 100644
index 8cde2f06706..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaExternal.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaExternal" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Id">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Schema">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SchemaLocation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnhandledAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFacet.xml
deleted file mode 100644
index dba18bd2392..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFacet.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="IsFixed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaForm.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaForm.xml
deleted file mode 100644
index e861d5bc52e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaForm.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.Schema.XmlSchemaForm" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFractionDigitsFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFractionDigitsFacet.xml
deleted file mode 100644
index edecd71515b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaFractionDigitsFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaFractionDigitsFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaFractionDigitsFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroup.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroup.xml
deleted file mode 100644
index 6fc3195382d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroup.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaGroup" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaGroup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Particle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupBase.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupBase.xml
deleted file mode 100644
index 0f70d69626b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupBase.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaGroupBase" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupRef.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupRef.xml
deleted file mode 100644
index 69dbedf187f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaGroupRef.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaGroupRef" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaGroupRef">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Particle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RefName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaIdentityConstraint.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaIdentityConstraint.xml
deleted file mode 100644
index 45aae6a1390..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaIdentityConstraint.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaIdentityConstraint" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaIdentityConstraint">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Fields">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Selector">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="QualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaImport.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaImport.xml
deleted file mode 100644
index 841a70a2580..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaImport.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaImport" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaImport">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Annotation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaInclude.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaInclude.xml
deleted file mode 100644
index 0f66695a602..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaInclude.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaInclude" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaInclude">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Annotation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKey.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKey.xml
deleted file mode 100644
index 73f63e5d1a0..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKey.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaKey" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaKey">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKeyref.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKeyref.xml
deleted file mode 100644
index 4e36755dfe9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaKeyref.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaKeyref" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaKeyref">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Refer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaLengthFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaLengthFacet.xml
deleted file mode 100644
index 5db9b6ad4f9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaLengthFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaLengthFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaLengthFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.xml
deleted file mode 100644
index cc1b9f383d5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxExclusiveFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaMaxExclusiveFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaMaxExclusiveFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.xml
deleted file mode 100644
index 25cd201dad6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxInclusiveFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaMaxInclusiveFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaMaxInclusiveFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxLengthFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxLengthFacet.xml
deleted file mode 100644
index 8d2e208b137..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMaxLengthFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaMaxLengthFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaMaxLengthFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinExclusiveFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinExclusiveFacet.xml
deleted file mode 100644
index 7a8fddf565a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinExclusiveFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaMinExclusiveFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaMinExclusiveFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinInclusiveFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinInclusiveFacet.xml
deleted file mode 100644
index f80284b88a5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinInclusiveFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaMinInclusiveFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaMinInclusiveFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinLengthFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinLengthFacet.xml
deleted file mode 100644
index 73368379d13..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaMinLengthFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaMinLengthFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaMinLengthFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNotation.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNotation.xml
deleted file mode 100644
index e955e77a00c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNotation.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaNotation" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaNotation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Public">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNumericFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNumericFacet.xml
deleted file mode 100644
index bfcf3fe3869..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaNumericFacet.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaNumericFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObject.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObject.xml
deleted file mode 100644
index 2ad7e630598..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObject.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaObject" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="LineNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LinePosition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SourceUri">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespaces">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectCollection.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectCollection.xml
deleted file mode 100644
index b6e080dd061..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectCollection.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaObjectCollection" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaObjectCollection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="XmlSchemaObjectCollection(System.Xml.Schema.XmlSchemaObject)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="parent">TODO</param>
- </constructor>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Add(System.Xml.Schema.XmlSchemaObject)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Contains(System.Xml.Schema.XmlSchemaObject)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Xml.Schema.XmlSchemaObject[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Xml.Schema.XmlSchemaObject)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.Xml.Schema.XmlSchemaObject)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Xml.Schema.XmlSchemaObject)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="item">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectEnumerator.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectEnumerator.xml
deleted file mode 100644
index ea55500857f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectEnumerator.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaObjectEnumerator" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Current">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="MoveNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectTable.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectTable.xml
deleted file mode 100644
index d076dab50c2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaObjectTable.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaObjectTable" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Names">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Values">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Contains(System.Xml.XmlQualifiedName)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaParticle.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaParticle.xml
deleted file mode 100644
index 161c53d77a8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaParticle.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaParticle" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="MaxOccursString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MinOccursString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MaxOccurs">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MinOccurs">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaPatternFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaPatternFacet.xml
deleted file mode 100644
index 8790fb09a60..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaPatternFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaPatternFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaPatternFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaRedefine.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaRedefine.xml
deleted file mode 100644
index 1f4b8f58bc1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaRedefine.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaRedefine" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaRedefine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AttributeGroups">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Groups">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SchemaTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSequence.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSequence.xml
deleted file mode 100644
index 4d259546431..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSequence.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSequence" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSequence">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Items">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContent.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContent.xml
deleted file mode 100644
index bd5ff0b3187..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContent.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleContent" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSimpleContent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Content">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentExtension.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentExtension.xml
deleted file mode 100644
index ae536b81b61..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentExtension.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleContentExtension" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSimpleContentExtension">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="AnyAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentRestriction.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentRestriction.xml
deleted file mode 100644
index bd82e67b320..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleContentRestriction.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleContentRestriction" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSimpleContentRestriction">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AnyAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Facets">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleType.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleType.xml
deleted file mode 100644
index 60cc1ba947e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleType.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSimpleType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Content">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeContent.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeContent.xml
deleted file mode 100644
index 68f2d9f183e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeContent.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleTypeContent" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeList.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeList.xml
deleted file mode 100644
index 75e67bfd7ce..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeList.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleTypeList" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSimpleTypeList">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ItemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.xml
deleted file mode 100644
index 5a2bc87dd44..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleTypeRestriction" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSimpleTypeRestriction">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Facets">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeUnion.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeUnion.xml
deleted file mode 100644
index f91d2ef02a9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaSimpleTypeUnion.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaSimpleTypeUnion" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaSimpleTypeUnion">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="BaseTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaTotalDigitsFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaTotalDigitsFacet.xml
deleted file mode 100644
index ecb34b186fd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaTotalDigitsFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaTotalDigitsFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaTotalDigitsFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaType.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaType.xml
deleted file mode 100644
index 014e95feac1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaType.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Final">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseSchemaType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Datatype">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DerivedBy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FinalResolved">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMixed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="QualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUnique.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUnique.xml
deleted file mode 100644
index 59e3539aae1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUnique.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaUnique" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaUnique">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUse.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUse.xml
deleted file mode 100644
index a1805e5f7a7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaUse.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.Schema.XmlSchemaUse" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.xml
deleted file mode 100644
index deabb059f2e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaWhiteSpaceFacet.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaWhiteSpaceFacet" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaWhiteSpaceFacet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaXPath.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaXPath.xml
deleted file mode 100644
index bcf34da65d5..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSchemaXPath.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.Schema.XmlSchemaXPath" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlSchemaXPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="XPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSeverityType.xml b/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSeverityType.xml
deleted file mode 100644
index 063be488cb8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.Schema/XmlSeverityType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.Schema.XmlSeverityType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/IXPathNavigable.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/IXPathNavigable.xml
deleted file mode 100644
index 0d5b2d0b9ab..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/IXPathNavigable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Xml.XPath.IXPathNavigable" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathExpression.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathExpression.xml
deleted file mode 100644
index f46f860a956..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathExpression.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XPath.XPathExpression" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Expression">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReturnType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetContext(System.Xml.XmlNamespaceManager)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nsManager">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AddSort(System.Object, System.Xml.XPath.XmlSortOrder, System.Xml.XPath.XmlCaseOrder, System.String, System.Xml.XPath.XmlDataType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="expr">TODO</param>
- <param name="order">TODO</param>
- <param name="caseOrder">TODO</param>
- <param name="lang">TODO</param>
- <param name="dataType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSort(System.Object, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="expr">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNamespaceScope.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNamespaceScope.xml
deleted file mode 100644
index 6105b9d0179..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNamespaceScope.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XPath.XPathNamespaceScope" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNavigator.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNavigator.xml
deleted file mode 100644
index 1f39dfe6572..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNavigator.xml
+++ /dev/null
@@ -1,288 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XPath.XPathNavigator" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasChildren">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsEmptyElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamespaceURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Prefix">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlLang">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SelectDescendants(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="namespaceURI">TODO</param>
- <param name="matchSelf">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectDescendants(System.Xml.XPath.XPathNodeType, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="matchSelf">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectChildren(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectChildren(System.Xml.XPath.XPathNodeType)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectAncestors(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="namespaceURI">TODO</param>
- <param name="matchSelf">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectAncestors(System.Xml.XPath.XPathNodeType, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="matchSelf">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Select(System.Xml.XPath.XPathExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="expr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Select(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToPrevious">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToParent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToNextNamespace(System.Xml.XPath.XPathNamespaceScope)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="namespaceScope">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToNextAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToId(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="id">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToFirstNamespace(System.Xml.XPath.XPathNamespaceScope)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="namespaceScope">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToFirstChild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToFirstAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToFirst">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveTo(System.Xml.XPath.XPathNavigator)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Matches(System.Xml.XPath.XPathExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="expr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Matches(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSamePosition(System.Xml.XPath.XPathNavigator)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDescendant(System.Xml.XPath.XPathNavigator)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nav">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Evaluate(System.Xml.XPath.XPathExpression, System.Xml.XPath.XPathNodeIterator)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="expr">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Evaluate(System.Xml.XPath.XPathExpression)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="expr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Evaluate(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compile(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ComparePosition(System.Xml.XPath.XPathNavigator)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nav">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToFirstNamespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToNextNamespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeIterator.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeIterator.xml
deleted file mode 100644
index fd41655f363..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeIterator.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XPath.XPathNodeIterator" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Current">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentPosition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="MoveNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeType.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeType.xml
deleted file mode 100644
index da5610933d8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathNodeType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XPath.XPathNodeType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathResultType.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathResultType.xml
deleted file mode 100644
index e5658414659..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathResultType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XPath.XPathResultType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathScanner.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathScanner.xml
deleted file mode 100644
index b38ba50a98b..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathScanner.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XPath.XPathScanner" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XPathScanner(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- </constructor>
- <property name="TokenType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Scan">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathTokenType.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathTokenType.xml
deleted file mode 100644
index 0fa8d8a62b8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XPathTokenType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XPath.XPathTokenType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlDataType.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlDataType.xml
deleted file mode 100644
index 6fe40fb98a9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlDataType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XPath.XmlDataType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlSortOrder.xml b/mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlSortOrder.xml
deleted file mode 100644
index 55177785804..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml.XPath/XmlSortOrder.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XPath.XmlSortOrder" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/EntityHandling.xml b/mcs/docs/apidocs/xml/en/System.Xml/EntityHandling.xml
deleted file mode 100644
index 1a0967bfb37..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/EntityHandling.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.EntityHandling" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/Formatting.xml b/mcs/docs/apidocs/xml/en/System.Xml/Formatting.xml
deleted file mode 100644
index fd67ab9c3dd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/Formatting.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.Formatting" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/IHasXmlNode.xml b/mcs/docs/apidocs/xml/en/System.Xml/IHasXmlNode.xml
deleted file mode 100644
index a9f4d27556d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/IHasXmlNode.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Xml.IHasXmlNode" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/IXmlLineInfo.xml b/mcs/docs/apidocs/xml/en/System.Xml/IXmlLineInfo.xml
deleted file mode 100644
index 997b1b35bf2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/IXmlLineInfo.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.Xml.IXmlLineInfo" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/NameTable.xml b/mcs/docs/apidocs/xml/en/System.Xml/NameTable.xml
deleted file mode 100644
index 961b8690629..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/NameTable.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.NameTable" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="Get(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Get(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <param name="start">TODO</param>
- <param name="len">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="key">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/ReadState.xml b/mcs/docs/apidocs/xml/en/System.Xml/ReadState.xml
deleted file mode 100644
index a3f356debd3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/ReadState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.ReadState" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/ValidationType.xml b/mcs/docs/apidocs/xml/en/System.Xml/ValidationType.xml
deleted file mode 100644
index 35c7c032888..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/ValidationType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.ValidationType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/WhitespaceHandling.xml b/mcs/docs/apidocs/xml/en/System.Xml/WhitespaceHandling.xml
deleted file mode 100644
index cbbc45eba63..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/WhitespaceHandling.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.WhitespaceHandling" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/WriteState.xml b/mcs/docs/apidocs/xml/en/System.Xml/WriteState.xml
deleted file mode 100644
index 7805202cae9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/WriteState.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.WriteState" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlAttribute.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlAttribute.xml
deleted file mode 100644
index 5ceb3a05c34..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlAttribute.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlAttribute" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamespaceURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OwnerDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OwnerElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ParentNode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Prefix">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Specified">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LastLinkedChild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlAttributeCollection.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlAttributeCollection.xml
deleted file mode 100644
index 332e22c8c35..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlAttributeCollection.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlAttributeCollection" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="ItemOf">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemOf">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemOf">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="RemoveAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAll">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Xml.XmlAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Prepend(System.Xml.XmlAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InsertBefore(System.Xml.XmlAttribute, System.Xml.XmlAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newNode">TODO</param>
- <param name="refNode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InsertAfter(System.Xml.XmlAttribute, System.Xml.XmlAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newNode">TODO</param>
- <param name="refNode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Append(System.Xml.XmlAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetNamedItem(System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Xml.XmlAttribute[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlCDataSection.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlCDataSection.xml
deleted file mode 100644
index 515f6201dbd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlCDataSection.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlCDataSection" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlCaseOrder.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlCaseOrder.xml
deleted file mode 100644
index ab7f8ddc62a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlCaseOrder.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XmlCaseOrder" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlCharacterData.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlCharacterData.xml
deleted file mode 100644
index 3de21092924..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlCharacterData.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlCharacterData" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Substring(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReplaceData(System.Int32, System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <param name="strData">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InsertData(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="strData">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DeleteData(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AppendData(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strData">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlComment.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlComment.xml
deleted file mode 100644
index b156db70c0f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlComment.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlComment" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlDeclaration.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlDeclaration.xml
deleted file mode 100644
index 158b719db77..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlDeclaration.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlDeclaration" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Standalone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlDocument.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlDocument.xml
deleted file mode 100644
index 0076c6c2982..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlDocument.xml
+++ /dev/null
@@ -1,353 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlDocument" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="XmlDocument(System.Xml.NameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nt">TODO</param>
- </constructor>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DocumentElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DocumentType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Implementation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LastLinkedChild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OwnerDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PreserveWhitespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlResolver">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Save(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Save(System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="writer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Save(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="filename">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Save(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="outStream">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadNode(System.Xml.XmlReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="reader">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LoadXml(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xml">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Xml.XmlReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xmlReader">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.IO.TextReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="txtReader">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="filename">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inStream">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ImportNode(System.Xml.XmlNode, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementsByTagName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementsByTagName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementById(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elementId">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateXmlDeclaration(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="version">TODO</param>
- <param name="encoding">TODO</param>
- <param name="standalone">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateWhitespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateTextNode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateSignificantWhitespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateProcessingInstruction(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateNode(System.Xml.XmlNodeType, System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="prefix">TODO</param>
- <param name="name">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateNode(System.Xml.XmlNodeType, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <param name="name">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateNode(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nodeTypeString">TODO</param>
- <param name="name">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateEntityReference(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateElement(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDocumentType(System.String, System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="publicId">TODO</param>
- <param name="systemId">TODO</param>
- <param name="internalSubset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDocumentFragment">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateComment(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateCDataSection(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateAttribute(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="qualifiedName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateElement(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateElement(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="qualifiedName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <event name="NodeChanged">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="NodeChanging">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="NodeInserted">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="NodeInserting">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="NodeRemoved">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="NodeRemoving">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentFragment.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentFragment.xml
deleted file mode 100644
index 2bd03f6e8bc..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentFragment.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlDocumentFragment" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="InnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OwnerDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ParentNode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentType.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentType.xml
deleted file mode 100644
index 685ea39d2d4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlDocumentType.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlDocumentType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Entities">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InternalSubset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Notations">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PublicId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SystemId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlElement.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlElement.xml
deleted file mode 100644
index ee59cd10bdb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlElement.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlElement" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsEmpty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LastLinkedChild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamespaceURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NextSibling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OwnerDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Prefix">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetAttributeNode(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetAttributeNode(System.Xml.XmlAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetAttribute(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAttributeNode(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAttributeNode(System.Xml.XmlAttribute)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAttributeAt(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAllAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="HasAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HasAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementsByTagName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementsByTagName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttributeNode(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttributeNode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAll">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlEntity.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlEntity.xml
deleted file mode 100644
index 7bd48c60fe6..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlEntity.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlEntity" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NotationName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OuterXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PublicId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SystemId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlEntityReference.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlEntityReference.xml
deleted file mode 100644
index d56affacbe4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlEntityReference.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlEntityReference" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlException.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlException.xml
deleted file mode 100644
index a03533f65ef..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlException.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlException" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- <property name="LineNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LinePosition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlImplementation.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlImplementation.xml
deleted file mode 100644
index 12d216e91d7..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlImplementation.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlImplementation" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlImplementation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="CreateDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="HasFeature(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strFeature">TODO</param>
- <param name="strVersion">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlLinkedNode.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlLinkedNode.xml
deleted file mode 100644
index e64df943276..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlLinkedNode.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlLinkedNode" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="NextSibling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NextLinkedSibling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PreviousSibling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNameTable.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNameTable.xml
deleted file mode 100644
index 521983da4e9..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNameTable.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlNameTable" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="Get(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Get(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNamedNodeMap.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNamedNodeMap.xml
deleted file mode 100644
index 7f8fad291e1..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNamedNodeMap.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlNamedNodeMap" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="SetNamedItem(System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="node">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveNamedItem(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveNamedItem(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Item(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNamedItem(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNamedItem(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNamespaceManager.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNamespaceManager.xml
deleted file mode 100644
index 60a64db256e..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNamespaceManager.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlNamespaceManager" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlNamespaceManager(System.Xml.XmlNameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nameTable">TODO</param>
- </constructor>
- <property name="DefaultNamespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="RemoveNamespace(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="uri">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="PushScope">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="PopScope">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="LookupPrefix(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="uri">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LookupNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HasNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddNamespace(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="uri">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNode.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNode.xml
deleted file mode 100644
index 73ee8c06982..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNode.xml
+++ /dev/null
@@ -1,250 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlNode" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ChildNodes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FirstChild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasChildNodes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LastChild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LastLinkedChild">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamespaceURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NextSibling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OuterXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OwnerDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ParentNode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Prefix">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PreviousSibling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CreateNavigator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Supports(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="feature">TODO</param>
- <param name="version">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectSingleNode(System.String, System.Xml.XmlNamespaceManager)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <param name="nsmgr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectSingleNode(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectNodes(System.String, System.Xml.XmlNamespaceManager)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <param name="nsmgr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SelectNodes(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xpath">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReplaceChild(System.Xml.XmlNode, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newChild">TODO</param>
- <param name="oldChild">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveChild(System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldChild">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="RemoveAll">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="PrependChild(System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newChild">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Normalize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="InsertBefore(System.Xml.XmlNode, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newChild">TODO</param>
- <param name="refChild">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InsertAfter(System.Xml.XmlNode, System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newChild">TODO</param>
- <param name="refChild">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetPrefixOfNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNamespaceOfPrefix(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AppendChild(System.Xml.XmlNode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newChild">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedAction.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedAction.xml
deleted file mode 100644
index 0bfc1d4f304..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedAction.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XmlNodeChangedAction" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventArgs.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventArgs.xml
deleted file mode 100644
index 6637d3894a2..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventArgs.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlNodeChangedEventArgs" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Action">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Node">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OldParent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NewParent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventHandler.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventHandler.xml
deleted file mode 100644
index 512c3019cf4..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeChangedEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.Xml.XmlNodeChangedEventHandler" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeList.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeList.xml
deleted file mode 100644
index 1aba015739f..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeList.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlNodeList" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ItemOf">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Item(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeOrder.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeOrder.xml
deleted file mode 100644
index 84aa3a066d3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeOrder.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XmlNodeOrder" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeType.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeType.xml
deleted file mode 100644
index 868de8f0992..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNodeType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XmlNodeType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlNotation.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlNotation.xml
deleted file mode 100644
index 01d767cb095..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlNotation.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlNotation" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="InnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OuterXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PublicId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SystemId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlParserContext.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlParserContext.xml
deleted file mode 100644
index 57c3782f3a8..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlParserContext.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlParserContext" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.Xml.XmlSpace)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nt">TODO</param>
- <param name="nsMgr">TODO</param>
- <param name="xmlLang">TODO</param>
- <param name="xmlSpace">TODO</param>
- </constructor>
- <constructor name="XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.Xml.XmlSpace, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nt">TODO</param>
- <param name="nsMgr">TODO</param>
- <param name="xmlLang">TODO</param>
- <param name="xmlSpace">TODO</param>
- <param name="enc">TODO</param>
- </constructor>
- <constructor name="XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.String, System.String, System.String, System.String, System.String, System.Xml.XmlSpace)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nt">TODO</param>
- <param name="nsMgr">TODO</param>
- <param name="docTypeName">TODO</param>
- <param name="pubId">TODO</param>
- <param name="sysId">TODO</param>
- <param name="internalSubset">TODO</param>
- <param name="baseURI">TODO</param>
- <param name="xmlLang">TODO</param>
- <param name="xmlSpace">TODO</param>
- </constructor>
- <constructor name="XmlParserContext(System.Xml.XmlNameTable, System.Xml.XmlNamespaceManager, System.String, System.String, System.String, System.String, System.String, System.String, System.Xml.XmlSpace, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="nt">TODO</param>
- <param name="nsMgr">TODO</param>
- <param name="docTypeName">TODO</param>
- <param name="pubId">TODO</param>
- <param name="sysId">TODO</param>
- <param name="internalSubset">TODO</param>
- <param name="baseURI">TODO</param>
- <param name="xmlLang">TODO</param>
- <param name="xmlSpace">TODO</param>
- <param name="enc">TODO</param>
- </constructor>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DocTypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InternalSubset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamespaceManager">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PublicId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SystemId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlLang">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlSpace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlProcessingInstruction.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlProcessingInstruction.xml
deleted file mode 100644
index bb48f448652..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlProcessingInstruction.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlProcessingInstruction" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Data">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="InnerText">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Target">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlQualifiedName.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlQualifiedName.xml
deleted file mode 100644
index 66f584e1bfa..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlQualifiedName.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlQualifiedName" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlQualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="XmlQualifiedName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <constructor name="XmlQualifiedName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ns">TODO</param>
- </constructor>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="IsEmpty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.Xml.XmlQualifiedName, System.Xml.XmlQualifiedName)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.Xml.XmlQualifiedName, System.Xml.XmlQualifiedName)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlReader.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlReader.xml
deleted file mode 100644
index 83ea519aabf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlReader.xml
+++ /dev/null
@@ -1,298 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlReader" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="AttributeCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CanResolveEntity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Depth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EOF">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasAttributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsDefault">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsEmptyElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamespaceURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Prefix">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="QuoteChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReadState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlLang">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlSpace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Skip">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ResolveEntity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadStartElement(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadStartElement(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadStartElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadOuterXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadInnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadEndElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadElementString(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadElementString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadElementString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadAttributeValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToNextAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToFirstAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToContent">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToAttribute(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LookupNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsStartElement(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsStartElement(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsStartElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsNameToken(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlResolver.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlResolver.xml
deleted file mode 100644
index 065f4b332bb..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlResolver.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlResolver" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Credentials">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ResolveUri(System.Uri, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="baseUri">TODO</param>
- <param name="relativeUri">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEntity(System.Uri, System.String, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="absoluteUri">TODO</param>
- <param name="role">TODO</param>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlSignificantWhitespace.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlSignificantWhitespace.xml
deleted file mode 100644
index ef9231ab78d..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlSignificantWhitespace.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlSignificantWhitespace" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlSpace.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlSpace.xml
deleted file mode 100644
index f6f1a9ecdbf..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlSpace.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XmlSpace" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlText.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlText.xml
deleted file mode 100644
index 8f0cbb1cda3..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlText.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlText" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SplitText(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlTextReader.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlTextReader.xml
deleted file mode 100644
index e6df4043bfe..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlTextReader.xml
+++ /dev/null
@@ -1,349 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlTextReader" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlTextReader(System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="url">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.IO.TextReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.IO.Stream, System.Xml.XmlNameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="nt">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.String, System.IO.Stream)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="url">TODO</param>
- <param name="input">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.String, System.IO.TextReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="url">TODO</param>
- <param name="input">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.String, System.Xml.XmlNameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="url">TODO</param>
- <param name="nt">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.IO.TextReader, System.Xml.XmlNameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="input">TODO</param>
- <param name="nt">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.IO.Stream, System.Xml.XmlNodeType, System.Xml.XmlParserContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xmlFragment">TODO</param>
- <param name="fragType">TODO</param>
- <param name="context">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.String, System.IO.Stream, System.Xml.XmlNameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="url">TODO</param>
- <param name="input">TODO</param>
- <param name="nt">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.String, System.IO.TextReader, System.Xml.XmlNameTable)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="url">TODO</param>
- <param name="input">TODO</param>
- <param name="nt">TODO</param>
- </constructor>
- <constructor name="XmlTextReader(System.String, System.Xml.XmlNodeType, System.Xml.XmlParserContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="xmlFragment">TODO</param>
- <param name="fragType">TODO</param>
- <param name="context">TODO</param>
- </constructor>
- <property name="AttributeCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Depth">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Encoding">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="EOF">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsDefault">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsEmptyElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LineNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LinePosition">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespaces">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NamespaceURI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NameTable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Normalization">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Prefix">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="QuoteChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReadState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WhitespaceHandling">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlLang">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlResolver">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlSpace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ResolveEntity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadOuterXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadInnerXml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadAttributeValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToNextAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToFirstAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveToAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MoveToAttribute(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LookupNamespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="namespaceURI">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAttribute(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetRemainder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadBase64(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadBinHex(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ReadChars(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ResetState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlTextWriter.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlTextWriter.xml
deleted file mode 100644
index 2689f39d9dd..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlTextWriter.xml
+++ /dev/null
@@ -1,254 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlTextWriter" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlTextWriter(System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- </constructor>
- <constructor name="XmlTextWriter(System.IO.Stream, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <constructor name="XmlTextWriter(System.String, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="filename">TODO</param>
- <param name="encoding">TODO</param>
- </constructor>
- <property name="BaseStream">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Formatting">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IndentingOverriden">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Indentation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IndentChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespaces">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="QuoteChar">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WriteState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlLang">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlSpace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteWhitespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ws">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteSurrogateCharEntity(System.Char, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lowChar">TODO</param>
- <param name="highChar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartElement(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartDocument(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="standalone">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartAttribute(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteRaw(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteRaw(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteQualifiedName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteProcessingInstruction(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteNmToken(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteFullEndElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteEntityRef(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteEndElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteEndDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteEndAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteDocType(System.String, System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="pubid">TODO</param>
- <param name="sysid">TODO</param>
- <param name="subset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteComment(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteChars(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteCharEntity(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ch">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteCData(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteBinHex(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteBase64(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LookupPrefix(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlTokenizedType.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlTokenizedType.xml
deleted file mode 100644
index 76aeb7c160c..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlTokenizedType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Xml.XmlTokenizedType" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlUrlResolver.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlUrlResolver.xml
deleted file mode 100644
index bb380274c73..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlUrlResolver.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlUrlResolver" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="XmlUrlResolver">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="Credentials">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ResolveUri(System.Uri, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="baseUri">TODO</param>
- <param name="relativeUri">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEntity(System.Uri, System.String, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="absoluteUri">TODO</param>
- <param name="role">TODO</param>
- <param name="ofObjectToReturn">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlWhitespace.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlWhitespace.xml
deleted file mode 100644
index c3c4107b96a..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlWhitespace.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlWhitespace" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="LocalName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NodeType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteContentTo(System.Xml.XmlWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="w">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CloneNode(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="deep">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System.Xml/XmlWriter.xml b/mcs/docs/apidocs/xml/en/System.Xml/XmlWriter.xml
deleted file mode 100644
index 4123f6b9644..00000000000
--- a/mcs/docs/apidocs/xml/en/System.Xml/XmlWriter.xml
+++ /dev/null
@@ -1,275 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Xml.XmlWriter" assembly="System.Xml">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="WriteState">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlLang">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="XmlSpace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="WriteWhitespace(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ws">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteSurrogateCharEntity(System.Char, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lowChar">TODO</param>
- <param name="highChar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartElement(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartDocument(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="standalone">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartAttribute(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteRaw(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteRaw(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteQualifiedName(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteProcessingInstruction(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteNode(System.Xml.XmlReader, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="reader">TODO</param>
- <param name="defattr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteNmToken(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteFullEndElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteEntityRef(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteEndElement">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteEndDocument">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteEndAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteDocType(System.String, System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="pubid">TODO</param>
- <param name="sysid">TODO</param>
- <param name="subset">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteComment(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteChars(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteCharEntity(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ch">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteCData(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="text">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteBinHex(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteBase64(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteAttributes(System.Xml.XmlReader, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="reader">TODO</param>
- <param name="defattr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LookupPrefix(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Flush">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Close">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteAttributeString(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteAttributeString(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteAttributeString(System.String, System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="prefix">TODO</param>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteElementString(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteElementString(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartAttribute(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartElement(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteStartElement(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="localName">TODO</param>
- <param name="ns">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AppDomain.xml b/mcs/docs/apidocs/xml/en/System/AppDomain.xml
deleted file mode 100644
index f0c153b4190..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AppDomain.xml
+++ /dev/null
@@ -1,426 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.AppDomain" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="SetupInformation">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="RelativeSearchPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DynamicDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShadowCopyFiles">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FriendlyName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Evidence">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentDomain">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="SetThreadPrincipal(System.Security.Principal.IPrincipal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="principal">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetShadowCopyPath(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="policy">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetData(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="data">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetCachePath(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetAppDomainPolicy(System.Security.Policy.PolicyLevel)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="domainPolicy">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Byte[], System.Byte[], System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rawAssembly">TODO</param>
- <param name="rawSymbolStore">TODO</param>
- <param name="securityEvidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.String, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyString">TODO</param>
- <param name="assemblySecurity">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Byte[], System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rawAssembly">TODO</param>
- <param name="rawSymbolStore">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Reflection.AssemblyName, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyRef">TODO</param>
- <param name="assemblySecurity">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyString">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="rawAssembly">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Load(System.Reflection.AssemblyName)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyRef">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetData(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetAssemblies">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ExecuteAssembly(System.String, System.Security.Policy.Evidence, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyFile">TODO</param>
- <param name="assemblySecurity">TODO</param>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ExecuteAssembly(System.String, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyFile">TODO</param>
- <param name="assemblySecurity">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ExecuteAssembly(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyFile">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DoCallBack(System.CrossAppDomainDelegate)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="theDelegate">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.String, System.Security.Policy.Evidence, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="dir">TODO</param>
- <param name="evidence">TODO</param>
- <param name="requiredPermissions">TODO</param>
- <param name="optionalPermissions">TODO</param>
- <param name="refusedPersmissions">TODO</param>
- <param name="isSynchronized">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.String, System.Security.Policy.Evidence, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="dir">TODO</param>
- <param name="evidence">TODO</param>
- <param name="requiredPermissions">TODO</param>
- <param name="optionalPermissions">TODO</param>
- <param name="refusedPersmissions">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.String, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="dir">TODO</param>
- <param name="requiredPermissions">TODO</param>
- <param name="optionalPermissions">TODO</param>
- <param name="refusedPersmissions">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.Security.Policy.Evidence, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="evidence">TODO</param>
- <param name="requiredPermissions">TODO</param>
- <param name="optionalPermissions">TODO</param>
- <param name="refusedPersmissions">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.Security.PermissionSet, System.Security.PermissionSet, System.Security.PermissionSet)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="requiredPermissions">TODO</param>
- <param name="optionalPermissions">TODO</param>
- <param name="refusedPersmissions">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.String, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="dir">TODO</param>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="dir">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <param name="evidence">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="access">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstanceFrom(System.String, System.String, System.Boolean, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[], System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <param name="ignoreCase">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="args">TODO</param>
- <param name="culture">TODO</param>
- <param name="activationAttributes">TODO</param>
- <param name="securityAttribtutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstanceFrom(System.String, System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <param name="activationAttributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstanceFrom(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.String, System.String, System.Boolean, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[], System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <param name="ignoreCase">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="args">TODO</param>
- <param name="culture">TODO</param>
- <param name="activationAttributes">TODO</param>
- <param name="securityAttribtutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.String, System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <param name="activationAttributes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="assemblyName">TODO</param>
- <param name="typeName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ClearShadowCopyPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ClearPrivatePath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="AppendPrivatePath(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="path">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InitializeLifetimeService">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="other">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDomain(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="friendlyName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDomain(System.String, System.Security.Policy.Evidence)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="friendlyName">TODO</param>
- <param name="securityInfo">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDomain(System.String, System.Security.Policy.Evidence, System.AppDomainSetup)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="friendlyName">TODO</param>
- <param name="securityInfo">TODO</param>
- <param name="info">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateDomain(System.String, System.Security.Policy.Evidence, System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="friendlyName">TODO</param>
- <param name="securityInfo">TODO</param>
- <param name="appBasePath">TODO</param>
- <param name="appRelativeSearchPath">TODO</param>
- <param name="shadowCopyFiles">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Unload(System.AppDomain)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="domain">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCurrentThreadId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <event name="AssemblyLoad">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="AssemblyResolve">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="DomainUnload">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ProcessExit">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="ResourceResolve">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="TypeResolve">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- <event name="UnhandledException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <data>TODO</data>
- </event>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AppDomainSetup.xml b/mcs/docs/apidocs/xml/en/System/AppDomainSetup.xml
deleted file mode 100644
index 4f5fd4829d2..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AppDomainSetup.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.AppDomainSetup" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AppDomainSetup">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <property name="ApplicationBase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ApplicationName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CachePath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ConfigurationFile">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DisallowPublisherPolicy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DynamicBase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LicenseFile">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivateBinPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PrivateBinPathProbe">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShadowCopyDirectories">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ShadowCopyFiles">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AppDomainUnloadedException.xml b/mcs/docs/apidocs/xml/en/System/AppDomainUnloadedException.xml
deleted file mode 100644
index 42ee2a67875..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AppDomainUnloadedException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.AppDomainUnloadedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AppDomainUnloadedException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="AppDomainUnloadedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="AppDomainUnloadedException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ApplicationException.xml b/mcs/docs/apidocs/xml/en/System/ApplicationException.xml
deleted file mode 100644
index 9a6abc6bebd..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ApplicationException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ApplicationException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ApplicationException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ApplicationException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ApplicationException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ArgumentException.xml b/mcs/docs/apidocs/xml/en/System/ArgumentException.xml
deleted file mode 100644
index 461ad043025..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ArgumentException.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ArgumentException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ArgumentException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ArgumentException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ArgumentException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="ArgumentException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="param_name">TODO</param>
- </constructor>
- <constructor name="ArgumentException(System.String, System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="param_name">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <property name="ParamName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ArgumentNullException.xml b/mcs/docs/apidocs/xml/en/System/ArgumentNullException.xml
deleted file mode 100644
index 02879fb4751..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ArgumentNullException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ArgumentNullException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ArgumentNullException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ArgumentNullException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="param_name">TODO</param>
- </constructor>
- <constructor name="ArgumentNullException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="param_name">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ArgumentOutOfRangeException.xml b/mcs/docs/apidocs/xml/en/System/ArgumentOutOfRangeException.xml
deleted file mode 100644
index 448920d228a..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ArgumentOutOfRangeException.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ArgumentOutOfRangeException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ArgumentOutOfRangeException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ArgumentOutOfRangeException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="param_name">TODO</param>
- </constructor>
- <constructor name="ArgumentOutOfRangeException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="param_name">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ArgumentOutOfRangeException(System.String, System.Object, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="param_name">TODO</param>
- <param name="actual_value">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- <property name="ActualValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ArithmeticException.xml b/mcs/docs/apidocs/xml/en/System/ArithmeticException.xml
deleted file mode 100644
index 689a582a9f3..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ArithmeticException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ArithmeticException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ArithmeticException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ArithmeticException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ArithmeticException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Array.xml b/mcs/docs/apidocs/xml/en/System/Array.xml
deleted file mode 100644
index bea80e8505e..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Array.xml
+++ /dev/null
@@ -1,366 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Array" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Rank">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Item">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Count">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSynchronized">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SyncRoot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFixedSize">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsReadOnly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetLength(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dimension">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLowerBound(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dimension">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Int32[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="idxs">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Object, System.Int32[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="idxs">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetUpperBound(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dimension">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="idx">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="idx1">TODO</param>
- <param name="idx2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetValue(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="idx1">TODO</param>
- <param name="idx2">TODO</param>
- <param name="idx3">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="idx">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Object, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="idx1">TODO</param>
- <param name="idx2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetValue(System.Object, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="idx1">TODO</param>
- <param name="idx2">TODO</param>
- <param name="idx3">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.Type, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elementType">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.Type, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elementType">TODO</param>
- <param name="l1">TODO</param>
- <param name="l2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.Type, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elementType">TODO</param>
- <param name="l1">TODO</param>
- <param name="l2">TODO</param>
- <param name="l3">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.Type, System.Int32[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elementType">TODO</param>
- <param name="lengths">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CreateInstance(System.Type, System.Int32[], System.Int32[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="elementType">TODO</param>
- <param name="lengths">TODO</param>
- <param name="bounds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BinarySearch(System.Array, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BinarySearch(System.Array, System.Object, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BinarySearch(System.Array, System.Int32, System.Int32, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BinarySearch(System.Array, System.Int32, System.Int32, System.Object, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <param name="value">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clear(System.Array, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy(System.Array, System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="source">TODO</param>
- <param name="dest">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy(System.Array, System.Int32, System.Array, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="source">TODO</param>
- <param name="source_idx">TODO</param>
- <param name="dest">TODO</param>
- <param name="dest_idx">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Array, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Array, System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Array, System.Object, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Array, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Array, System.Object, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Array, System.Object, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="value">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Reverse(System.Array)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Reverse(System.Array, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array, System.Array)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keys">TODO</param>
- <param name="items">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array, System.Array, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keys">TODO</param>
- <param name="items">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array, System.Array, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keys">TODO</param>
- <param name="items">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array, System.Int32, System.Int32, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sort(System.Array, System.Array, System.Int32, System.Int32, System.Collections.IComparer)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="keys">TODO</param>
- <param name="items">TODO</param>
- <param name="index">TODO</param>
- <param name="length">TODO</param>
- <param name="comparer">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ArrayTypeMismatchException.xml b/mcs/docs/apidocs/xml/en/System/ArrayTypeMismatchException.xml
deleted file mode 100644
index e600fab3934..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ArrayTypeMismatchException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ArrayTypeMismatchException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ArrayTypeMismatchException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ArrayTypeMismatchException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ArrayTypeMismatchException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AssemblyLoadEventArgs.xml b/mcs/docs/apidocs/xml/en/System/AssemblyLoadEventArgs.xml
deleted file mode 100644
index 1f160d15332..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AssemblyLoadEventArgs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.AssemblyLoadEventArgs" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AssemblyLoadEventArgs(System.Reflection.Assembly)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="loadedAssembly">TODO</param>
- </constructor>
- <property name="LoadedAssembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AssemblyLoadEventHandler.xml b/mcs/docs/apidocs/xml/en/System/AssemblyLoadEventHandler.xml
deleted file mode 100644
index 1ebbcbc3366..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AssemblyLoadEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.AssemblyLoadEventHandler" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AsyncCallback.xml b/mcs/docs/apidocs/xml/en/System/AsyncCallback.xml
deleted file mode 100644
index 83060a95222..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AsyncCallback.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.AsyncCallback" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Attribute.xml b/mcs/docs/apidocs/xml/en/System/Attribute.xml
deleted file mode 100644
index 21c038a86a0..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Attribute.xml
+++ /dev/null
@@ -1,261 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Attribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="TypeId">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Match(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefaultAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.MemberInfo, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.Assembly, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.Module, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Assembly)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.ParameterInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.MemberInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Module)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Assembly, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Module, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.MemberInfo, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Module, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.Assembly, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.Module, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.ParameterInfo, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.MemberInfo, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.Assembly, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.Module, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="element">TODO</param>
- <param name="attribute_type">TODO</param>
- <param name="inherit">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AttributeTargets.xml b/mcs/docs/apidocs/xml/en/System/AttributeTargets.xml
deleted file mode 100644
index c335b966a0f..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AttributeTargets.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.AttributeTargets" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/AttributeUsageAttribute.xml b/mcs/docs/apidocs/xml/en/System/AttributeUsageAttribute.xml
deleted file mode 100644
index ff002391a3e..00000000000
--- a/mcs/docs/apidocs/xml/en/System/AttributeUsageAttribute.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.AttributeUsageAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="AttributeUsageAttribute(System.AttributeTargets)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="validOn">TODO</param>
- </constructor>
- <property name="AllowMultiple">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Inherited">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ValidOn">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/BadImageFormatException.xml b/mcs/docs/apidocs/xml/en/System/BadImageFormatException.xml
deleted file mode 100644
index 469d739ef56..00000000000
--- a/mcs/docs/apidocs/xml/en/System/BadImageFormatException.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.BadImageFormatException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="BadImageFormatException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="BadImageFormatException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="BadImageFormatException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="BadImageFormatException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="fileName">TODO</param>
- </constructor>
- <constructor name="BadImageFormatException(System.String, System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="fileName">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FileName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FusionLog">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/BitConverter.xml b/mcs/docs/apidocs/xml/en/System/BitConverter.xml
deleted file mode 100644
index 6815a7f37af..00000000000
--- a/mcs/docs/apidocs/xml/en/System/BitConverter.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.BitConverter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="IsLittleEndian">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="DoubleToInt64Bits(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Int64BitsToDouble(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetBytes(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Byte[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="start_index">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Boolean.xml b/mcs/docs/apidocs/xml/en/System/Boolean.xml
deleted file mode 100644
index 3342c26b09a..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Boolean.xml
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Boolean" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="FalseString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TrueString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Buffer.xml b/mcs/docs/apidocs/xml/en/System/Buffer.xml
deleted file mode 100644
index 36a69613977..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Buffer.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Buffer" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="ByteLength(System.Array)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetByte(System.Array, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetByte(System.Array, System.Int32, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="array">TODO</param>
- <param name="index">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="BlockCopy(System.Array, System.Int32, System.Array, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="src">TODO</param>
- <param name="src_offset">TODO</param>
- <param name="dest">TODO</param>
- <param name="dest_offset">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Byte.xml b/mcs/docs/apidocs/xml/en/System/Byte.xml
deleted file mode 100644
index 1d2dfd6b9b6..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Byte.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Byte" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/CLSCompliantAttribute.xml b/mcs/docs/apidocs/xml/en/System/CLSCompliantAttribute.xml
deleted file mode 100644
index 128f73c1122..00000000000
--- a/mcs/docs/apidocs/xml/en/System/CLSCompliantAttribute.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CLSCompliantAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CLSCompliantAttribute(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="is_compliant">TODO</param>
- </constructor>
- <property name="IsCompliant">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/CannotUnloadAppDomainException.xml b/mcs/docs/apidocs/xml/en/System/CannotUnloadAppDomainException.xml
deleted file mode 100644
index 3980908e9e8..00000000000
--- a/mcs/docs/apidocs/xml/en/System/CannotUnloadAppDomainException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CannotUnloadAppDomainException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="CannotUnloadAppDomainException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="CannotUnloadAppDomainException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="CannotUnloadAppDomainException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Char.xml b/mcs/docs/apidocs/xml/en/System/Char.xml
deleted file mode 100644
index 07aed173f66..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Char.xml
+++ /dev/null
@@ -1,344 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Char" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetNumericValue(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNumericValue(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetUnicodeCategory(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetUnicodeCategory(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsControl(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsControl(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDigit(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDigit(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLetter(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLetter(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLetterOrDigit(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLetterOrDigit(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLower(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLower(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsNumber(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsNumber(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsPunctuation(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsPunctuation(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSeparator(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSeparator(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSurrogate(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSurrogate(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSymbol(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSymbol(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsUpper(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsUpper(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsWhiteSpace(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsWhiteSpace(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToLower(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUpper(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/CharEnumerator.xml b/mcs/docs/apidocs/xml/en/System/CharEnumerator.xml
deleted file mode 100644
index ce2e96fe447..00000000000
--- a/mcs/docs/apidocs/xml/en/System/CharEnumerator.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.CharEnumerator" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Current">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Reset">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="MoveNext">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Console.xml b/mcs/docs/apidocs/xml/en/System/Console.xml
deleted file mode 100644
index 06f7edf2522..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Console.xml
+++ /dev/null
@@ -1,311 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Console" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Error">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Out">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="In">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="OpenStandardError">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="OpenStandardError(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bufferSize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="OpenStandardInput">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="OpenStandardInput(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bufferSize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="OpenStandardOutput">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="OpenStandardOutput(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bufferSize">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetError(System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newError">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetIn(System.IO.TextReader)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newIn">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="SetOut(System.IO.TextWriter)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newOut">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Write(System.String, System.Object, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <param name="arg2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <param name="index">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="WriteLine(System.String, System.Object, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <param name="arg2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Read">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ReadLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ContextBoundObject.xml b/mcs/docs/apidocs/xml/en/System/ContextBoundObject.xml
deleted file mode 100644
index ae31dd241e0..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ContextBoundObject.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ContextBoundObject" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ContextMarshalException.xml b/mcs/docs/apidocs/xml/en/System/ContextMarshalException.xml
deleted file mode 100644
index 58da7a376ec..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ContextMarshalException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ContextMarshalException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ContextMarshalException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ContextMarshalException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ContextMarshalException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ContextStaticAttribute.xml b/mcs/docs/apidocs/xml/en/System/ContextStaticAttribute.xml
deleted file mode 100644
index 79890c0323b..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ContextStaticAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ContextStaticAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ContextStaticAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Convert.xml b/mcs/docs/apidocs/xml/en/System/Convert.xml
deleted file mode 100644
index 5eb24ebab39..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Convert.xml
+++ /dev/null
@@ -1,1924 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Convert" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="DBNull">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="FromBase64CharArray(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inArray">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromBase64String(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDBNull(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBase64CharArray(System.Byte[], System.Int32, System.Int32, System.Char[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inArray">TODO</param>
- <param name="offsetIn">TODO</param>
- <param name="length">TODO</param>
- <param name="outArray">TODO</param>
- <param name="offsetOut">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBase64String(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inArray">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBase64String(System.Byte[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="inArray">TODO</param>
- <param name="offset">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Boolean, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Byte, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Byte, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="toBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Char, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.DateTime, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Decimal, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Double, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Single, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int32, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int64, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int64, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.SByte, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int16, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int16, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.UInt32, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.UInt64, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.UInt16, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="fromBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64(System.Object, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ChangeType(System.Object, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="conversionType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ChangeType(System.Object, System.TypeCode)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="typeCode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ChangeType(System.Object, System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ChangeType(System.Object, System.TypeCode, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="typeCode">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/CrossAppDomainDelegate.xml b/mcs/docs/apidocs/xml/en/System/CrossAppDomainDelegate.xml
deleted file mode 100644
index 25680b2a6e7..00000000000
--- a/mcs/docs/apidocs/xml/en/System/CrossAppDomainDelegate.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.CrossAppDomainDelegate" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/DBNull.xml b/mcs/docs/apidocs/xml/en/System/DBNull.xml
deleted file mode 100644
index b1f576b9e77..00000000000
--- a/mcs/docs/apidocs/xml/en/System/DBNull.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.DBNull" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/DateTime.xml b/mcs/docs/apidocs/xml/en/System/DateTime.xml
deleted file mode 100644
index 68f23aa5f60..00000000000
--- a/mcs/docs/apidocs/xml/en/System/DateTime.xml
+++ /dev/null
@@ -1,565 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.DateTime" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DateTime(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="newticks">TODO</param>
- </constructor>
- <constructor name="DateTime(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- </constructor>
- <constructor name="DateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- </constructor>
- <constructor name="DateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="millisecond">TODO</param>
- </constructor>
- <constructor name="DateTime(System.Int32, System.Int32, System.Int32, System.Globalization.Calendar)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="calendar">TODO</param>
- </constructor>
- <constructor name="DateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Globalization.Calendar)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="calendar">TODO</param>
- </constructor>
- <constructor name="DateTime(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Int32, System.Globalization.Calendar)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <param name="day">TODO</param>
- <param name="hour">TODO</param>
- <param name="minute">TODO</param>
- <param name="second">TODO</param>
- <param name="millisecond">TODO</param>
- <param name="calendar">TODO</param>
- </constructor>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Date">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Month">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Day">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DayOfWeek">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DayOfYear">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TimeOfDay">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Hour">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Minute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Second">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Millisecond">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Now">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Ticks">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Today">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UtcNow">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Year">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ts">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddDays(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="days">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddTicks(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddHours(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hours">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMilliseconds(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ms">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMinutes(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="minutes">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddMonths(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="months">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddSeconds(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="seconds">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="AddYears(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="years">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="DaysInMonth(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <param name="month">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromFileTime(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fileTime">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromOADate(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDateTimeFormats">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetDateTimeFormats(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDateTimeFormats(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDateTimeFormats(System.Char, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsLeapYear(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider, System.Globalization.DateTimeStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <param name="styles">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ParseExact(System.String, System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ParseExact(System.String, System.String, System.IFormatProvider, System.Globalization.DateTimeStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ParseExact(System.String, System.String[], System.IFormatProvider, System.Globalization.DateTimeStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="formats">TODO</param>
- <param name="fp">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Subtract(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="dt">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Subtract(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ts">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToFileTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToLongDateString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToLongTimeString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToOADate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToShortDateString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToShortTimeString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToLocalTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToUniversalTime">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <operator name="op_Addition(System.DateTime, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="t">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Equality(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThan(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThanOrEqual(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThan(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThanOrEqual(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Subtraction(System.DateTime, System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Subtraction(System.DateTime, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="t">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/DayOfWeek.xml b/mcs/docs/apidocs/xml/en/System/DayOfWeek.xml
deleted file mode 100644
index 2369ad409e0..00000000000
--- a/mcs/docs/apidocs/xml/en/System/DayOfWeek.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.DayOfWeek" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Decimal.xml b/mcs/docs/apidocs/xml/en/System/Decimal.xml
deleted file mode 100644
index a7d26f86a0f..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Decimal.xml
+++ /dev/null
@@ -1,454 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Decimal" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Decimal(System.Int32, System.Int32, System.Int32, System.Boolean, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="lo">TODO</param>
- <param name="mid">TODO</param>
- <param name="hi">TODO</param>
- <param name="isNegative">TODO</param>
- <param name="scale">TODO</param>
- </constructor>
- <constructor name="Decimal(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- </constructor>
- <constructor name="Decimal(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- </constructor>
- <constructor name="Decimal(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- </constructor>
- <constructor name="Decimal(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="uval">TODO</param>
- </constructor>
- <constructor name="Decimal(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- </constructor>
- <constructor name="Decimal(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- </constructor>
- <constructor name="Decimal(System.Int32[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bits">TODO</param>
- </constructor>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinusOne">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="One">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Zero">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetBits(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Negate(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Subtract(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Floor(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Truncate(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Round(System.Decimal, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="decimals">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Multiply(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Divide(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remainder(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Addition(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Decrement(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Increment(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Subtraction(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_UnaryNegation(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_UnaryPlus(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Multiply(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Division(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Modulus(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Implicit(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Equality(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThan(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThanOrEqual(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThan(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThanOrEqual(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d1">TODO</param>
- <param name="d2">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/DivideByZeroException.xml b/mcs/docs/apidocs/xml/en/System/DivideByZeroException.xml
deleted file mode 100644
index 29ae2214d0a..00000000000
--- a/mcs/docs/apidocs/xml/en/System/DivideByZeroException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.DivideByZeroException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DivideByZeroException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DivideByZeroException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="DivideByZeroException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/DllNotFoundException.xml b/mcs/docs/apidocs/xml/en/System/DllNotFoundException.xml
deleted file mode 100644
index fe5466feaae..00000000000
--- a/mcs/docs/apidocs/xml/en/System/DllNotFoundException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.DllNotFoundException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DllNotFoundException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DllNotFoundException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="DllNotFoundException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Double.xml b/mcs/docs/apidocs/xml/en/System/Double.xml
deleted file mode 100644
index c48866e507d..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Double.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Double" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Epsilon">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="NaN">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="NegativeInfinity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="PositiveInfinity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsInfinity(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsNaN(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsNegativeInfinity(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsPositiveInfinity(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/DuplicateWaitObjectException.xml b/mcs/docs/apidocs/xml/en/System/DuplicateWaitObjectException.xml
deleted file mode 100644
index 48ce9f3dc12..00000000000
--- a/mcs/docs/apidocs/xml/en/System/DuplicateWaitObjectException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.DuplicateWaitObjectException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="DuplicateWaitObjectException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="DuplicateWaitObjectException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="param_name">TODO</param>
- </constructor>
- <constructor name="DuplicateWaitObjectException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="param_name">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/EntryPointNotFoundException.xml b/mcs/docs/apidocs/xml/en/System/EntryPointNotFoundException.xml
deleted file mode 100644
index 4eb1fc85173..00000000000
--- a/mcs/docs/apidocs/xml/en/System/EntryPointNotFoundException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.EntryPointNotFoundException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EntryPointNotFoundException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="EntryPointNotFoundException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="EntryPointNotFoundException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Environment.xml b/mcs/docs/apidocs/xml/en/System/Environment.xml
deleted file mode 100644
index 7f73d9e4b36..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Environment.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Environment" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="CommandLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="CurrentDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ExitCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MachineName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="NewLine">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="OSVersion">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StackTrace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="SystemDirectory">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TickCount">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserDomainName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserInteractive">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="WorkingSet">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Exit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="exitCode">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ExpandEnvironmentVariables(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetCommandLineArgs">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEnvironmentVariable(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnvironmentVariables">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetFolderPath(System.Environment.SpecialFolder)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="folder">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLogicalDrives">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/EventArgs.xml b/mcs/docs/apidocs/xml/en/System/EventArgs.xml
deleted file mode 100644
index 8ce6c56729f..00000000000
--- a/mcs/docs/apidocs/xml/en/System/EventArgs.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.EventArgs" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="EventArgs">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/EventHandler.xml b/mcs/docs/apidocs/xml/en/System/EventHandler.xml
deleted file mode 100644
index d8fa6f11845..00000000000
--- a/mcs/docs/apidocs/xml/en/System/EventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.EventHandler" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ExecutionEngineException.xml b/mcs/docs/apidocs/xml/en/System/ExecutionEngineException.xml
deleted file mode 100644
index 29f31398fbb..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ExecutionEngineException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ExecutionEngineException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ExecutionEngineException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ExecutionEngineException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ExecutionEngineException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/FieldAccessException.xml b/mcs/docs/apidocs/xml/en/System/FieldAccessException.xml
deleted file mode 100644
index e66e2839461..00000000000
--- a/mcs/docs/apidocs/xml/en/System/FieldAccessException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.FieldAccessException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FieldAccessException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="FieldAccessException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="FieldAccessException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/FlagsAttribute.xml b/mcs/docs/apidocs/xml/en/System/FlagsAttribute.xml
deleted file mode 100644
index 0a56c423023..00000000000
--- a/mcs/docs/apidocs/xml/en/System/FlagsAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.FlagsAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FlagsAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/FormatException.xml b/mcs/docs/apidocs/xml/en/System/FormatException.xml
deleted file mode 100644
index 31abaf59d68..00000000000
--- a/mcs/docs/apidocs/xml/en/System/FormatException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.FormatException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="FormatException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="FormatException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="FormatException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/GC.xml b/mcs/docs/apidocs/xml/en/System/GC.xml
deleted file mode 100644
index dededd93f08..00000000000
--- a/mcs/docs/apidocs/xml/en/System/GC.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.GC" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="SuppressFinalize(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Guid.xml b/mcs/docs/apidocs/xml/en/System/Guid.xml
deleted file mode 100644
index a5236a8de70..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Guid.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Guid" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Guid(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="b">TODO</param>
- </constructor>
- <constructor name="Guid(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="g">TODO</param>
- </constructor>
- <constructor name="Guid(System.Int32, System.Int16, System.Int16, System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <param name="c">TODO</param>
- <param name="d">TODO</param>
- </constructor>
- <constructor name="Guid(System.Int32, System.Int16, System.Int16, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <param name="c">TODO</param>
- <param name="d">TODO</param>
- <param name="e">TODO</param>
- <param name="f">TODO</param>
- <param name="g">TODO</param>
- <param name="h">TODO</param>
- <param name="i">TODO</param>
- <param name="j">TODO</param>
- <param name="k">TODO</param>
- </constructor>
- <constructor name="Guid(System.UInt32, System.UInt16, System.UInt16, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <param name="c">TODO</param>
- <param name="d">TODO</param>
- <param name="e">TODO</param>
- <param name="f">TODO</param>
- <param name="g">TODO</param>
- <param name="h">TODO</param>
- <param name="i">TODO</param>
- <param name="j">TODO</param>
- <param name="k">TODO</param>
- </constructor>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="NewGuid">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToByteArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.Guid, System.Guid)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.Guid, System.Guid)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IAppDomainSetup.xml b/mcs/docs/apidocs/xml/en/System/IAppDomainSetup.xml
deleted file mode 100644
index e66a4e5bebd..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IAppDomainSetup.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IAppDomainSetup" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IAsyncResult.xml b/mcs/docs/apidocs/xml/en/System/IAsyncResult.xml
deleted file mode 100644
index a5148f5f87c..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IAsyncResult.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IAsyncResult" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ICloneable.xml b/mcs/docs/apidocs/xml/en/System/ICloneable.xml
deleted file mode 100644
index 239dd98c16e..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ICloneable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.ICloneable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IComparable.xml b/mcs/docs/apidocs/xml/en/System/IComparable.xml
deleted file mode 100644
index b760c09b67e..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IComparable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IComparable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IConvertible.xml b/mcs/docs/apidocs/xml/en/System/IConvertible.xml
deleted file mode 100644
index a2474443c8b..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IConvertible.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IConvertible" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IDisposable.xml b/mcs/docs/apidocs/xml/en/System/IDisposable.xml
deleted file mode 100644
index 64f187f3167..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IDisposable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IDisposable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IFormatProvider.xml b/mcs/docs/apidocs/xml/en/System/IFormatProvider.xml
deleted file mode 100644
index 4e38edf58d3..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IFormatProvider.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IFormatProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IFormattable.xml b/mcs/docs/apidocs/xml/en/System/IFormattable.xml
deleted file mode 100644
index a4b63678a42..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IFormattable.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IFormattable" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IServiceProvider.xml b/mcs/docs/apidocs/xml/en/System/IServiceProvider.xml
deleted file mode 100644
index dd49f1a5256..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IServiceProvider.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System.IServiceProvider" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IndexOutOfRangeException.xml b/mcs/docs/apidocs/xml/en/System/IndexOutOfRangeException.xml
deleted file mode 100644
index d99b0ffdfc2..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IndexOutOfRangeException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IndexOutOfRangeException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IndexOutOfRangeException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="IndexOutOfRangeException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="IndexOutOfRangeException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Int16.xml b/mcs/docs/apidocs/xml/en/System/Int16.xml
deleted file mode 100644
index a77115e18da..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Int16.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Int16" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Int32.xml b/mcs/docs/apidocs/xml/en/System/Int32.xml
deleted file mode 100644
index 5b1a4cf7862..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Int32.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Int32" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Int64.xml b/mcs/docs/apidocs/xml/en/System/Int64.xml
deleted file mode 100644
index 4b41733dd52..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Int64.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Int64" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IntPtr.xml b/mcs/docs/apidocs/xml/en/System/IntPtr.xml
deleted file mode 100644
index b28512927c6..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IntPtr.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.IntPtr" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IntPtr(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i32">TODO</param>
- </constructor>
- <constructor name="IntPtr(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="i64">TODO</param>
- </constructor>
- <constructor name="IntPtr(System.Void*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ptr">TODO</param>
- </constructor>
- <field name="Zero">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="si">TODO</param>
- <param name="sc">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToPointer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.IntPtr, System.IntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.IntPtr, System.IntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Void*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.IntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.IntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.IntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/IntegerFormatter.xml b/mcs/docs/apidocs/xml/en/System/IntegerFormatter.xml
deleted file mode 100644
index 57fa716d366..00000000000
--- a/mcs/docs/apidocs/xml/en/System/IntegerFormatter.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.IntegerFormatter" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="IntegerFormatter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="NumberToString(System.String, System.Globalization.NumberFormatInfo, System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="nfi">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/InvalidCastException.xml b/mcs/docs/apidocs/xml/en/System/InvalidCastException.xml
deleted file mode 100644
index 5fc51c4dc84..00000000000
--- a/mcs/docs/apidocs/xml/en/System/InvalidCastException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.InvalidCastException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="InvalidCastException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="InvalidCastException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="InvalidCastException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/InvalidOperationException.xml b/mcs/docs/apidocs/xml/en/System/InvalidOperationException.xml
deleted file mode 100644
index aeb66fe35aa..00000000000
--- a/mcs/docs/apidocs/xml/en/System/InvalidOperationException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.InvalidOperationException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="InvalidOperationException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="InvalidOperationException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="InvalidOperationException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/InvalidProgramException.xml b/mcs/docs/apidocs/xml/en/System/InvalidProgramException.xml
deleted file mode 100644
index 29bbfb054f0..00000000000
--- a/mcs/docs/apidocs/xml/en/System/InvalidProgramException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.InvalidProgramException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="InvalidProgramException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="InvalidProgramException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="InvalidProgramException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/LoaderOptimization.xml b/mcs/docs/apidocs/xml/en/System/LoaderOptimization.xml
deleted file mode 100644
index 72bd0496a13..00000000000
--- a/mcs/docs/apidocs/xml/en/System/LoaderOptimization.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.LoaderOptimization" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/LoaderOptimizationAttribute.xml b/mcs/docs/apidocs/xml/en/System/LoaderOptimizationAttribute.xml
deleted file mode 100644
index 17bef7724ac..00000000000
--- a/mcs/docs/apidocs/xml/en/System/LoaderOptimizationAttribute.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.LoaderOptimizationAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LoaderOptimizationAttribute(System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="LoaderOptimizationAttribute(System.LoaderOptimization)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/LocalDataStoreSlot.xml b/mcs/docs/apidocs/xml/en/System/LocalDataStoreSlot.xml
deleted file mode 100644
index 7c8d7ca3268..00000000000
--- a/mcs/docs/apidocs/xml/en/System/LocalDataStoreSlot.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.LocalDataStoreSlot" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="LocalDataStoreSlot">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MTAThreadAttribute.xml b/mcs/docs/apidocs/xml/en/System/MTAThreadAttribute.xml
deleted file mode 100644
index 1f515ee74aa..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MTAThreadAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MTAThreadAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MTAThreadAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MarshalByRefObject.xml b/mcs/docs/apidocs/xml/en/System/MarshalByRefObject.xml
deleted file mode 100644
index 2e0885081ee..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MarshalByRefObject.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MarshalByRefObject" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <method name="InitializeLifetimeService">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetLifetimeService">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CreateObjRef(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Math.xml b/mcs/docs/apidocs/xml/en/System/Math.xml
deleted file mode 100644
index 4dc60f68739..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Math.xml
+++ /dev/null
@@ -1,398 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Math" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="E">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="PI">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="Abs(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Abs(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Abs(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Abs(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Abs(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Abs(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Abs(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Ceiling(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Floor(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IEEERemainder(System.Double, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <param name="y">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Log(System.Double, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="newBase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.Byte, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.Double, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.Single, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.Int64, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.SByte, System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.Int16, System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.UInt32, System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.UInt64, System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Max(System.UInt16, System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.Byte, System.Byte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.Decimal, System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.Double, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.Single, System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.Int64, System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.SByte, System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.Int16, System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.UInt32, System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.UInt64, System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Min(System.UInt16, System.UInt16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="val1">TODO</param>
- <param name="val2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Round(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Round(System.Decimal, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <param name="decimals">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Round(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="d">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Round(System.Double, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="digits">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sign(System.Decimal)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sign(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sign(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sign(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sign(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sign(System.SByte)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sign(System.Int16)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sin(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Cos(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Tan(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sinh(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Cosh(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Tanh(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Acos(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Asin(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Atan(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Atan2(System.Double, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="y">TODO</param>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Exp(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Log(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Log10(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Pow(System.Double, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <param name="y">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Sqrt(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="x">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MemberAccessException.xml b/mcs/docs/apidocs/xml/en/System/MemberAccessException.xml
deleted file mode 100644
index eac96a1ae5a..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MemberAccessException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MemberAccessException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MemberAccessException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MemberAccessException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="MemberAccessException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MethodAccessException.xml b/mcs/docs/apidocs/xml/en/System/MethodAccessException.xml
deleted file mode 100644
index c68a27b1510..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MethodAccessException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MethodAccessException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MethodAccessException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MethodAccessException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="MethodAccessException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MissingFieldException.xml b/mcs/docs/apidocs/xml/en/System/MissingFieldException.xml
deleted file mode 100644
index 30f98adcd08..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MissingFieldException.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MissingFieldException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MissingFieldException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MissingFieldException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="MissingFieldException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- <constructor name="MissingFieldException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <param name="fieldName">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MissingMemberException.xml b/mcs/docs/apidocs/xml/en/System/MissingMemberException.xml
deleted file mode 100644
index 7825779d182..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MissingMemberException.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MissingMemberException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MissingMemberException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MissingMemberException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="MissingMemberException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <constructor name="MissingMemberException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="className">TODO</param>
- <param name="memberName">TODO</param>
- </constructor>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MissingMethodException.xml b/mcs/docs/apidocs/xml/en/System/MissingMethodException.xml
deleted file mode 100644
index 06c0ff131dc..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MissingMethodException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MissingMethodException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MissingMethodException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MissingMethodException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="MissingMethodException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MonoDummy.xml b/mcs/docs/apidocs/xml/en/System/MonoDummy.xml
deleted file mode 100644
index 9647a380b5f..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MonoDummy.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MonoDummy" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MonoDummy">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MonoTODOAttribute.xml b/mcs/docs/apidocs/xml/en/System/MonoTODOAttribute.xml
deleted file mode 100644
index 1134d19bfcb..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MonoTODOAttribute.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MonoTODOAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MonoTODOAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MonoTODOAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="comment">TODO</param>
- </constructor>
- <property name="Comment">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/MulticastNotSupportedException.xml b/mcs/docs/apidocs/xml/en/System/MulticastNotSupportedException.xml
deleted file mode 100644
index 88a50bdfecf..00000000000
--- a/mcs/docs/apidocs/xml/en/System/MulticastNotSupportedException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.MulticastNotSupportedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="MulticastNotSupportedException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="MulticastNotSupportedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="MulticastNotSupportedException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/NonSerializedAttribute.xml b/mcs/docs/apidocs/xml/en/System/NonSerializedAttribute.xml
deleted file mode 100644
index 517d471da5d..00000000000
--- a/mcs/docs/apidocs/xml/en/System/NonSerializedAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.NonSerializedAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NonSerializedAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/NotFiniteNumberException.xml b/mcs/docs/apidocs/xml/en/System/NotFiniteNumberException.xml
deleted file mode 100644
index 0dca3b530e7..00000000000
--- a/mcs/docs/apidocs/xml/en/System/NotFiniteNumberException.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.NotFiniteNumberException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NotFiniteNumberException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="NotFiniteNumberException(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="offending_number">TODO</param>
- </constructor>
- <constructor name="NotFiniteNumberException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="NotFiniteNumberException(System.String, System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="offending_number">TODO</param>
- </constructor>
- <constructor name="NotFiniteNumberException(System.String, System.Double, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="offending_number">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <property name="OffendingNumber">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/NotImplementedException.xml b/mcs/docs/apidocs/xml/en/System/NotImplementedException.xml
deleted file mode 100644
index 0f2773339c8..00000000000
--- a/mcs/docs/apidocs/xml/en/System/NotImplementedException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.NotImplementedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NotImplementedException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="NotImplementedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="NotImplementedException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/NotSupportedException.xml b/mcs/docs/apidocs/xml/en/System/NotSupportedException.xml
deleted file mode 100644
index 3f6f972dab9..00000000000
--- a/mcs/docs/apidocs/xml/en/System/NotSupportedException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.NotSupportedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NotSupportedException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="NotSupportedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="NotSupportedException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/NullReferenceException.xml b/mcs/docs/apidocs/xml/en/System/NullReferenceException.xml
deleted file mode 100644
index 1d0540b28ba..00000000000
--- a/mcs/docs/apidocs/xml/en/System/NullReferenceException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.NullReferenceException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="NullReferenceException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="NullReferenceException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="NullReferenceException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ObjectDisposedException.xml b/mcs/docs/apidocs/xml/en/System/ObjectDisposedException.xml
deleted file mode 100644
index 05db743f2b4..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ObjectDisposedException.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ObjectDisposedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ObjectDisposedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objectName">TODO</param>
- </constructor>
- <constructor name="ObjectDisposedException(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="objectName">TODO</param>
- <param name="message">TODO</param>
- </constructor>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ObjectName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ObsoleteAttribute.xml b/mcs/docs/apidocs/xml/en/System/ObsoleteAttribute.xml
deleted file mode 100644
index 682b19e784b..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ObsoleteAttribute.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ObsoleteAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ObsoleteAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="ObsoleteAttribute(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="ObsoleteAttribute(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="error">TODO</param>
- </constructor>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsError">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/OperatingSystem.xml b/mcs/docs/apidocs/xml/en/System/OperatingSystem.xml
deleted file mode 100644
index 1ded618514e..00000000000
--- a/mcs/docs/apidocs/xml/en/System/OperatingSystem.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.OperatingSystem" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="OperatingSystem(System.PlatformID, System.Version)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="platform">TODO</param>
- <param name="version">TODO</param>
- </constructor>
- <property name="Platform">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/OutOfMemoryException.xml b/mcs/docs/apidocs/xml/en/System/OutOfMemoryException.xml
deleted file mode 100644
index 9de8aa08af3..00000000000
--- a/mcs/docs/apidocs/xml/en/System/OutOfMemoryException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.OutOfMemoryException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="OutOfMemoryException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="OutOfMemoryException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="OutOfMemoryException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/OverflowException.xml b/mcs/docs/apidocs/xml/en/System/OverflowException.xml
deleted file mode 100644
index 3e8617eeada..00000000000
--- a/mcs/docs/apidocs/xml/en/System/OverflowException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.OverflowException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="OverflowException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="OverflowException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="OverflowException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ParamArrayAttribute.xml b/mcs/docs/apidocs/xml/en/System/ParamArrayAttribute.xml
deleted file mode 100644
index 4c0b4a1c0a3..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ParamArrayAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ParamArrayAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ParamArrayAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/PlatformID.xml b/mcs/docs/apidocs/xml/en/System/PlatformID.xml
deleted file mode 100644
index 3ac63a822ff..00000000000
--- a/mcs/docs/apidocs/xml/en/System/PlatformID.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.PlatformID" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/PlatformNotSupportedException.xml b/mcs/docs/apidocs/xml/en/System/PlatformNotSupportedException.xml
deleted file mode 100644
index 0b78710d4b0..00000000000
--- a/mcs/docs/apidocs/xml/en/System/PlatformNotSupportedException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.PlatformNotSupportedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="PlatformNotSupportedException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="PlatformNotSupportedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="PlatformNotSupportedException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Random.xml b/mcs/docs/apidocs/xml/en/System/Random.xml
deleted file mode 100644
index b77b7c483a9..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Random.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Random" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Random">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Random(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="Seed">TODO</param>
- </constructor>
- <method name="NextDouble">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="NextBytes(System.Byte[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="buffer">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Next(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="minValue">TODO</param>
- <param name="maxValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Next(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="maxValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Next">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/RankException.xml b/mcs/docs/apidocs/xml/en/System/RankException.xml
deleted file mode 100644
index 5cbcfebf565..00000000000
--- a/mcs/docs/apidocs/xml/en/System/RankException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.RankException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="RankException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="RankException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="RankException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ResolveEventArgs.xml b/mcs/docs/apidocs/xml/en/System/ResolveEventArgs.xml
deleted file mode 100644
index 77771134dc3..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ResolveEventArgs.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ResolveEventArgs" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ResolveEventArgs(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- </constructor>
- <property name="Name">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ResolveEventHandler.xml b/mcs/docs/apidocs/xml/en/System/ResolveEventHandler.xml
deleted file mode 100644
index 43fcb9782d6..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ResolveEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.ResolveEventHandler" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/RuntimeArgumentHandle.xml b/mcs/docs/apidocs/xml/en/System/RuntimeArgumentHandle.xml
deleted file mode 100644
index 8908991d47c..00000000000
--- a/mcs/docs/apidocs/xml/en/System/RuntimeArgumentHandle.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.RuntimeArgumentHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/RuntimeFieldHandle.xml b/mcs/docs/apidocs/xml/en/System/RuntimeFieldHandle.xml
deleted file mode 100644
index ff0f5dcd56d..00000000000
--- a/mcs/docs/apidocs/xml/en/System/RuntimeFieldHandle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.RuntimeFieldHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/RuntimeMethodHandle.xml b/mcs/docs/apidocs/xml/en/System/RuntimeMethodHandle.xml
deleted file mode 100644
index 65f767842d7..00000000000
--- a/mcs/docs/apidocs/xml/en/System/RuntimeMethodHandle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.RuntimeMethodHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/RuntimeTypeHandle.xml b/mcs/docs/apidocs/xml/en/System/RuntimeTypeHandle.xml
deleted file mode 100644
index 6e177412341..00000000000
--- a/mcs/docs/apidocs/xml/en/System/RuntimeTypeHandle.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.RuntimeTypeHandle" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="Value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/SByte.xml b/mcs/docs/apidocs/xml/en/System/SByte.xml
deleted file mode 100644
index 42175ecc4ce..00000000000
--- a/mcs/docs/apidocs/xml/en/System/SByte.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.SByte" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/STAThreadAttribute.xml b/mcs/docs/apidocs/xml/en/System/STAThreadAttribute.xml
deleted file mode 100644
index 3dcf8381a22..00000000000
--- a/mcs/docs/apidocs/xml/en/System/STAThreadAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.STAThreadAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="STAThreadAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/SerializableAttribute.xml b/mcs/docs/apidocs/xml/en/System/SerializableAttribute.xml
deleted file mode 100644
index c01e94817fc..00000000000
--- a/mcs/docs/apidocs/xml/en/System/SerializableAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.SerializableAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SerializableAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Single.xml b/mcs/docs/apidocs/xml/en/System/Single.xml
deleted file mode 100644
index 18b93d8ccef..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Single.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Single" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Epsilon">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="NaN">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="PositiveInfinity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="NegativeInfinity">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsInfinity(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="f">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsNaN(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="f">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsNegativeInfinity(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="f">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsPositiveInfinity(System.Single)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="f">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/SpecialFolder.xml b/mcs/docs/apidocs/xml/en/System/SpecialFolder.xml
deleted file mode 100644
index c61bab16fa8..00000000000
--- a/mcs/docs/apidocs/xml/en/System/SpecialFolder.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.Environment+SpecialFolder" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/StackOverflowException.xml b/mcs/docs/apidocs/xml/en/System/StackOverflowException.xml
deleted file mode 100644
index 97be57541d8..00000000000
--- a/mcs/docs/apidocs/xml/en/System/StackOverflowException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.StackOverflowException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="StackOverflowException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="StackOverflowException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="StackOverflowException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/String.xml b/mcs/docs/apidocs/xml/en/System/String.xml
deleted file mode 100644
index 20ef1ca3d79..00000000000
--- a/mcs/docs/apidocs/xml/en/System/String.xml
+++ /dev/null
@@ -1,630 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.String" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="String(System.Char*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="String(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="String(System.SByte*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="String(System.Char, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <param name="count">TODO</param>
- </constructor>
- <constructor name="String(System.Char*, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- </constructor>
- <constructor name="String(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- </constructor>
- <constructor name="String(System.SByte*, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- </constructor>
- <constructor name="String(System.SByte*, System.Int32, System.Int32, System.Text.Encoding)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- <param name="enc">TODO</param>
- </constructor>
- <field name="Empty">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Length">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Chars">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="strB">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="strB">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.String, System.String, System.Boolean, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="strB">TODO</param>
- <param name="ignoreCase">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.String, System.Int32, System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="indexA">TODO</param>
- <param name="strB">TODO</param>
- <param name="indexB">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.String, System.Int32, System.String, System.Int32, System.Int32, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="indexA">TODO</param>
- <param name="strB">TODO</param>
- <param name="indexB">TODO</param>
- <param name="length">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.String, System.Int32, System.String, System.Int32, System.Int32, System.Boolean, System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="indexA">TODO</param>
- <param name="strB">TODO</param>
- <param name="indexB">TODO</param>
- <param name="length">TODO</param>
- <param name="ignoreCase">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareOrdinal(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="strB">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareOrdinal(System.String, System.Int32, System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="strA">TODO</param>
- <param name="indexA">TODO</param>
- <param name="strB">TODO</param>
- <param name="indexB">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="arg">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str0">TODO</param>
- <param name="str1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.Object, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <param name="arg2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str0">TODO</param>
- <param name="str1">TODO</param>
- <param name="str2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Concat(System.String, System.String, System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str0">TODO</param>
- <param name="str1">TODO</param>
- <param name="str2">TODO</param>
- <param name="str3">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Copy(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CopyTo(System.Int32, System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="sourceIndex">TODO</param>
- <param name="destination">TODO</param>
- <param name="destinationIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="EndsWith(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Format(System.String, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Format(System.String, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Format(System.String, System.Object, System.Object, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="arg0">TODO</param>
- <param name="arg1">TODO</param>
- <param name="arg2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Format(System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Format(System.IFormatProvider, System.String, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <param name="format">TODO</param>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEnumerator">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Char, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.Char, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOf(System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOfAny(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOfAny(System.Char[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IndexOfAny(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Insert(System.Int32, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startIndex">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Intern(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsInterned(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="str">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Join(System.String, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="separator">TODO</param>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Join(System.String, System.String[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="separator">TODO</param>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Char, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.Char, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOf(System.String, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOfAny(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOfAny(System.Char[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="LastIndexOfAny(System.Char[], System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="values">TODO</param>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="PadLeft(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="totalWidth">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="PadLeft(System.Int32, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="totalWidth">TODO</param>
- <param name="padChar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="PadRight(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="totalWidth">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="PadRight(System.Int32, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="totalWidth">TODO</param>
- <param name="padChar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Remove(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startIndex">TODO</param>
- <param name="count">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.Char, System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldChar">TODO</param>
- <param name="newChar">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Replace(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="oldValue">TODO</param>
- <param name="newValue">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Split(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="separator">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Split(System.Char[], System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="separator">TODO</param>
- <param name="maxCount">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="StartsWith(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Substring(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startIndex">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Substring(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToCharArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToCharArray(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="startIndex">TODO</param>
- <param name="length">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToLower">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToLower(System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUpper">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToUpper(System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Trim">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Trim(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="trimChars">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TrimEnd(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="trimChars">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="TrimStart(System.Char[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="trimChars">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="a">TODO</param>
- <param name="b">TODO</param>
- <returns>TODO</returns>
- </operator>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/SystemException.xml b/mcs/docs/apidocs/xml/en/System/SystemException.xml
deleted file mode 100644
index 0ab0152e457..00000000000
--- a/mcs/docs/apidocs/xml/en/System/SystemException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.SystemException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="SystemException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="SystemException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="SystemException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/ThreadStaticAttribute.xml b/mcs/docs/apidocs/xml/en/System/ThreadStaticAttribute.xml
deleted file mode 100644
index e74c0789ca4..00000000000
--- a/mcs/docs/apidocs/xml/en/System/ThreadStaticAttribute.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.ThreadStaticAttribute" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="ThreadStaticAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/TimeSpan.xml b/mcs/docs/apidocs/xml/en/System/TimeSpan.xml
deleted file mode 100644
index d2d45f7dd90..00000000000
--- a/mcs/docs/apidocs/xml/en/System/TimeSpan.xml
+++ /dev/null
@@ -1,292 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.TimeSpan" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TimeSpan(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="TimeSpan(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="hours">TODO</param>
- <param name="minutes">TODO</param>
- <param name="seconds">TODO</param>
- </constructor>
- <constructor name="TimeSpan(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="days">TODO</param>
- <param name="hours">TODO</param>
- <param name="minutes">TODO</param>
- <param name="seconds">TODO</param>
- </constructor>
- <constructor name="TimeSpan(System.Int32, System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="days">TODO</param>
- <param name="hours">TODO</param>
- <param name="minutes">TODO</param>
- <param name="seconds">TODO</param>
- <param name="milliseconds">TODO</param>
- </constructor>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Zero">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TicksPerDay">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TicksPerHour">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TicksPerMillisecond">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TicksPerMinute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="TicksPerSecond">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Days">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Hours">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Milliseconds">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Minutes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Seconds">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Ticks">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TotalDays">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TotalHours">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TotalMilliseconds">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TotalMinutes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TotalSeconds">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Add(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ts">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Compare(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Duration">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromDays(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromHours(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromMinutes(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromSeconds(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromMilliseconds(System.Double)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromTicks(System.Int64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Negate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Subtract(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="ts">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Addition(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Equality(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThan(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThanOrEqual(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThan(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThanOrEqual(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Subtraction(System.TimeSpan, System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t1">TODO</param>
- <param name="t2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_UnaryNegation(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_UnaryPlus(System.TimeSpan)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="t">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/TimeZone.xml b/mcs/docs/apidocs/xml/en/System/TimeZone.xml
deleted file mode 100644
index 7f13481afe1..00000000000
--- a/mcs/docs/apidocs/xml/en/System/TimeZone.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.TimeZone" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <property name="CurrentTimeZone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DaylightName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="StandardName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="ToUniversalTime(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToLocalTime(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDaylightSavingTime(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetUtcOffset(System.DateTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDaylightChanges(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="year">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsDaylightSavingTime(System.DateTime, System.Globalization.DaylightTime)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="time">TODO</param>
- <param name="daylightTimes">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Type.xml b/mcs/docs/apidocs/xml/en/System/Type.xml
deleted file mode 100644
index 371e0537f42..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Type.xml
+++ /dev/null
@@ -1,758 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Type" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="Delimiter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="EmptyTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="FilterAttribute">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="FilterName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="FilterNameIgnoreCase">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="Missing">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Assembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AssemblyQualifiedName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Attributes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="BaseType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DeclaringType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="DefaultBinder">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="FullName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="GUID">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HasElementType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAbstract">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAnsiClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsArray">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAutoClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsAutoLayout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsByRef">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsCOMObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsContextful">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsEnum">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsExplicitLayout">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsImport">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsInterface">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsLayoutSequential">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsMarshalByRef">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNestedAssembly">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNestedFamANDAssem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNestedFamily">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNestedFamORAssem">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNestedPrivate">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNestedPublic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsNotPublic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPointer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPrimitive">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsPublic">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSealed">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSerializable">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsSpecialName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsUnicodeClass">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsValueType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="MemberType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Module">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Namespace">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="ReflectedType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeHandle">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeInitializer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UnderlyingSystemType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="InvokeMember(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object, System.Object[], System.Reflection.ParameterModifier[], System.Globalization.CultureInfo, System.String[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="target">TODO</param>
- <param name="args">TODO</param>
- <param name="modifiers">TODO</param>
- <param name="culture">TODO</param>
- <param name="namedParameters">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperty(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Type, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="returnType">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperty(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperties(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethods(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMembers(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMember(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFields(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetField(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FindMembers(System.Reflection.MemberTypes, System.Reflection.BindingFlags, System.Reflection.MemberFilter, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="memberType">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="filter">TODO</param>
- <param name="filterCriteria">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetDefaultMembers">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructors(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedTypes(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedType(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMember(System.String, System.Reflection.MemberTypes, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="type">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvents(System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvents">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetEvent(System.String, System.Reflection.BindingFlags)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetElementType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetArrayRank">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="IsInstanceOfType(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsAssignableFrom(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInterfaces">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetInterfaceMap(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="interfaceType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInterface(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FindInterfaces(System.Reflection.TypeFilter, System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="filter">TODO</param>
- <param name="filterCriteria">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="typeName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="typeName">TODO</param>
- <param name="throwOnError">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetType(System.String, System.Boolean, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="typeName">TODO</param>
- <param name="throwOnError">TODO</param>
- <param name="ignoreCase">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeArray(System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromCLSID(System.Guid)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="clsid">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromCLSID(System.Guid, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="clsid">TODO</param>
- <param name="throwOnError">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromCLSID(System.Guid, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="clsid">TODO</param>
- <param name="server">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromCLSID(System.Guid, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="clsid">TODO</param>
- <param name="server">TODO</param>
- <param name="throwOnError">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromHandle(System.RuntimeTypeHandle)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="handle">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromProgID(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="progID">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromProgID(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="progID">TODO</param>
- <param name="throwOnError">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromProgID(System.String, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="progID">TODO</param>
- <param name="server">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeFromProgID(System.String, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="progID">TODO</param>
- <param name="server">TODO</param>
- <param name="throwOnError">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeHandle(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsSubclassOf(System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="c">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetInterface(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetEvent(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetField(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetFields">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMember(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMembers">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="types">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethod(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="callConvention">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetMethods">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedType(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetNestedTypes">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetProperties">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetProperty(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperty(System.String, System.Type)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="returnType">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperty(System.String, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="types">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperty(System.String, System.Type, System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="returnType">TODO</param>
- <param name="types">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetProperty(System.String, System.Type, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="returnType">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructor(System.Type[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="types">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructor(System.Reflection.BindingFlags, System.Reflection.Binder, System.Reflection.CallingConventions, System.Type[], System.Reflection.ParameterModifier[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="bindingAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="callConvention">TODO</param>
- <param name="types">TODO</param>
- <param name="modifiers">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetConstructors">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="InvokeMember(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object, System.Object[])">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="target">TODO</param>
- <param name="args">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="InvokeMember(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object, System.Object[], System.Globalization.CultureInfo)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <param name="invokeAttr">TODO</param>
- <param name="binder">TODO</param>
- <param name="target">TODO</param>
- <param name="args">TODO</param>
- <param name="culture">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/TypeCode.xml b/mcs/docs/apidocs/xml/en/System/TypeCode.xml
deleted file mode 100644
index 899d9f8400b..00000000000
--- a/mcs/docs/apidocs/xml/en/System/TypeCode.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.TypeCode" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/TypeInitializationException.xml b/mcs/docs/apidocs/xml/en/System/TypeInitializationException.xml
deleted file mode 100644
index e465dfc8a7d..00000000000
--- a/mcs/docs/apidocs/xml/en/System/TypeInitializationException.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.TypeInitializationException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TypeInitializationException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="type_name">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <property name="TypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/TypeLoadException.xml b/mcs/docs/apidocs/xml/en/System/TypeLoadException.xml
deleted file mode 100644
index 49e924048e0..00000000000
--- a/mcs/docs/apidocs/xml/en/System/TypeLoadException.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.TypeLoadException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TypeLoadException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TypeLoadException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="TypeLoadException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- <property name="Message">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TypeName">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/TypeUnloadedException.xml b/mcs/docs/apidocs/xml/en/System/TypeUnloadedException.xml
deleted file mode 100644
index 94ee9063814..00000000000
--- a/mcs/docs/apidocs/xml/en/System/TypeUnloadedException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.TypeUnloadedException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="TypeUnloadedException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="TypeUnloadedException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="TypeUnloadedException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="innerException">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UInt16.xml b/mcs/docs/apidocs/xml/en/System/UInt16.xml
deleted file mode 100644
index 400ed0d93d6..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UInt16.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.UInt16" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UInt32.xml b/mcs/docs/apidocs/xml/en/System/UInt32.xml
deleted file mode 100644
index 61270db013d..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UInt32.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.UInt32" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UInt64.xml b/mcs/docs/apidocs/xml/en/System/UInt64.xml
deleted file mode 100644
index 05617cfb193..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UInt64.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.UInt64" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <field name="value">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MaxValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="MinValue">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <method name="ToUInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToType(System.Type, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="conversionType">TODO</param>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSingle(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToSByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt64(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt32(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToInt16(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDouble(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDecimal(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToDateTime(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToChar(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToByte(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToBoolean(System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="provider">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetTypeCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="o">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Parse(System.String, System.Globalization.NumberStyles, System.IFormatProvider)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="s">TODO</param>
- <param name="style">TODO</param>
- <param name="fp">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="format">TODO</param>
- <returns>TODO</returns>
- </method>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UIntPtr.xml b/mcs/docs/apidocs/xml/en/System/UIntPtr.xml
deleted file mode 100644
index 2c29054edc6..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UIntPtr.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.UIntPtr" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UIntPtr(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="UIntPtr(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <constructor name="UIntPtr(System.Void*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- </constructor>
- <field name="Zero">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="Size">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt32">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToUInt64">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToPointer">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.UIntPtr, System.UIntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value1">TODO</param>
- <param name="value2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.UIntPtr, System.UIntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value1">TODO</param>
- <param name="value2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.UIntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.UIntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.UInt64)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.Void*)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.UIntPtr)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Explicit(System.UInt32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="value">TODO</param>
- <returns>TODO</returns>
- </operator>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UnauthorizedAccessException.xml b/mcs/docs/apidocs/xml/en/System/UnauthorizedAccessException.xml
deleted file mode 100644
index eb5de2697ae..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UnauthorizedAccessException.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.UnauthorizedAccessException" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UnauthorizedAccessException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="UnauthorizedAccessException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- <constructor name="UnauthorizedAccessException(System.String, System.Exception)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- <param name="inner">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventArgs.xml b/mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventArgs.xml
deleted file mode 100644
index 8997b926dab..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventArgs.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.UnhandledExceptionEventArgs" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UnhandledExceptionEventArgs(System.Object, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="exception">TODO</param>
- <param name="isTerminating">TODO</param>
- </constructor>
- <property name="ExceptionObject">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsTerminating">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventHandler.xml b/mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventHandler.xml
deleted file mode 100644
index b00ec29905f..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UnhandledExceptionEventHandler.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <delegate name="System.UnhandledExceptionEventHandler" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </delegate>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Uri.xml b/mcs/docs/apidocs/xml/en/System/Uri.xml
deleted file mode 100644
index 1917d253ecd..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Uri.xml
+++ /dev/null
@@ -1,233 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Uri" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Uri(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="uri">TODO</param>
- </constructor>
- <constructor name="Uri(System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="uri">TODO</param>
- <param name="dontEscape">TODO</param>
- </constructor>
- <constructor name="Uri(System.Uri, System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="baseUri">TODO</param>
- <param name="relativeUri">TODO</param>
- </constructor>
- <constructor name="Uri(System.Uri, System.String, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="baseUri">TODO</param>
- <param name="relativeUri">TODO</param>
- <param name="dontEscape">TODO</param>
- </constructor>
- <field name="SchemeDelimiter">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UriSchemeFile">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UriSchemeFtp">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UriSchemeGopher">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UriSchemeHttp">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UriSchemeHttps">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UriSchemeMailto">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <field name="UriSchemeNntp">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </field>
- <property name="AbsolutePath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="AbsoluteUri">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Authority">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Fragment">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Host">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="HostNameType">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsDefaultPort">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsFile">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsLoopback">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="IsUnc">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="LocalPath">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="PathAndQuery">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Port">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Query">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Scheme">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Segments">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserEscaped">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="UserInfo">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="compared">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="CheckHostName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="name">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="CheckSchemeName(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="schemeName">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="FromHex(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="digit">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HexEscape(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="character">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="HexUnescape(System.String, System.Int32&amp;)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsHexDigit(System.Char)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="character">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="IsHexEncoding(System.String, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="pattern">TODO</param>
- <param name="index">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="GetLeftPart(System.UriPartial)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="part">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="MakeRelative(System.Uri)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="toUri">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UriFormatException.xml b/mcs/docs/apidocs/xml/en/System/UriFormatException.xml
deleted file mode 100644
index 21024af1120..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UriFormatException.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.UriFormatException" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="UriFormatException">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="UriFormatException(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="message">TODO</param>
- </constructor>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UriHostNameType.xml b/mcs/docs/apidocs/xml/en/System/UriHostNameType.xml
deleted file mode 100644
index 05997be4025..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UriHostNameType.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.UriHostNameType" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/UriPartial.xml b/mcs/docs/apidocs/xml/en/System/UriPartial.xml
deleted file mode 100644
index 2a0365c09ac..00000000000
--- a/mcs/docs/apidocs/xml/en/System/UriPartial.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <enum name="System.UriPartial" assembly="System">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <member name="TODO" />
- </enum>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Version.xml b/mcs/docs/apidocs/xml/en/System/Version.xml
deleted file mode 100644
index d2dc0664213..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Version.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.Version" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="Version">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </constructor>
- <constructor name="Version(System.String)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="version">TODO</param>
- </constructor>
- <constructor name="Version(System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="major">TODO</param>
- <param name="minor">TODO</param>
- </constructor>
- <constructor name="Version(System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="major">TODO</param>
- <param name="minor">TODO</param>
- <param name="build">TODO</param>
- </constructor>
- <constructor name="Version(System.Int32, System.Int32, System.Int32, System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="major">TODO</param>
- <param name="minor">TODO</param>
- <param name="build">TODO</param>
- <param name="revision">TODO</param>
- </constructor>
- <property name="Build">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Major">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Minor">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Revision">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="CompareTo(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="version">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="Clone">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="GetHashCode">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="Equals(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="obj">TODO</param>
- <returns>TODO</returns>
- </method>
- <method name="ToString">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <returns>TODO</returns>
- </method>
- <method name="ToString(System.Int32)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="fields">TODO</param>
- <returns>TODO</returns>
- </method>
- <operator name="op_Equality(System.Version, System.Version)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v1">TODO</param>
- <param name="v2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_Inequality(System.Version, System.Version)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v1">TODO</param>
- <param name="v2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThan(System.Version, System.Version)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v1">TODO</param>
- <param name="v2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_GreaterThanOrEqual(System.Version, System.Version)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v1">TODO</param>
- <param name="v2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThan(System.Version, System.Version)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v1">TODO</param>
- <param name="v2">TODO</param>
- <returns>TODO</returns>
- </operator>
- <operator name="op_LessThanOrEqual(System.Version, System.Version)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="v1">TODO</param>
- <param name="v2">TODO</param>
- <returns>TODO</returns>
- </operator>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/Void.xml b/mcs/docs/apidocs/xml/en/System/Void.xml
deleted file mode 100644
index 454ef01d3ab..00000000000
--- a/mcs/docs/apidocs/xml/en/System/Void.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <struct name="System.Void" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </struct>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/WeakReference.xml b/mcs/docs/apidocs/xml/en/System/WeakReference.xml
deleted file mode 100644
index ab5b93831e8..00000000000
--- a/mcs/docs/apidocs/xml/en/System/WeakReference.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <class name="System.WeakReference" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <constructor name="WeakReference(System.Object)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- </constructor>
- <constructor name="WeakReference(System.Object, System.Boolean)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="target">TODO</param>
- <param name="trackResurrection">TODO</param>
- </constructor>
- <property name="IsAlive">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="Target">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <property name="TrackResurrection">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <value>TODO</value>
- </property>
- <method name="GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- <param name="info">TODO</param>
- <param name="context">TODO</param>
- <returns>TODO</returns>
- </method>
- </class>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/apidocs/xml/en/System/_AppDomain.xml b/mcs/docs/apidocs/xml/en/System/_AppDomain.xml
deleted file mode 100644
index c162b997a20..00000000000
--- a/mcs/docs/apidocs/xml/en/System/_AppDomain.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE monodoc SYSTEM "http://www.go-mono.org/monodoc.dtd">
-<monodoc language="en">
- <interface name="System._AppDomain" assembly="corlib">
- <summary>TODO</summary>
- <remarks>TODO</remarks>
- </interface>
-</monodoc> \ No newline at end of file
diff --git a/mcs/docs/clr-abi.txt b/mcs/docs/clr-abi.txt
deleted file mode 100755
index 99cce56c71f..00000000000
--- a/mcs/docs/clr-abi.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-* The generated code from the JIT by Microsoft uses registers
- to pass arguments to functions rather than pushing then on the
- stack. \ No newline at end of file
diff --git a/mcs/docs/compiler b/mcs/docs/compiler
deleted file mode 100755
index 91ac4980107..00000000000
--- a/mcs/docs/compiler
+++ /dev/null
@@ -1,374 +0,0 @@
- The Internals of the Mono C# Compiler
-
- Miguel de Icaza
- (miguel@ximian.com)
- 2002
-
-* Abstract
-
- The Mono C# compiler is a C# compiler written in C# itself.
- Its goals are to provide a free and alternate implementation
- of the C# language. The Mono C# compiler generates ECMA CIL
- images through the use of the System.Reflection.Emit API which
- enable the compiler to be platform independent.
-
-* Overview: How the compiler fits together
-
- The compilation process is managed by the compiler driver (it
- lives in driver.cs).
-
- The compiler reads a set of C# source code files, and parses
- them. Any assemblies or modules that the user might want to
- use with his project are loaded after parsing is done.
-
- Once all the files have been parsed, the type hierarchy is
- resolved. First interfaces are resolved, then types and
- enumerations.
-
- Once the type hierarchy is resolved, every type is populated:
- fields, methods, indexers, properties, events and delegates
- are entered into the type system.
-
- At this point the program skeleton has been completed. The
- next process is to actually emit the code for each of the
- executable methods. The compiler drives this from
- RootContext.EmitCode.
-
- Each type then has to populate its methods: populating a
- method requires creating a structure that is used as the state
- of the block being emitted (this is the EmitContext class) and
- then generating code for the topmost statement (the Block).
-
- Code generation has two steps: the first step is the semantic
- analysis (Resolve method) that resolves any pending tasks, and
- guarantees that the code is correct. The second phase is the
- actual code emission. All errors are flagged during in the
- "Resolution" process.
-
- After all code has been emitted, then the compiler closes all
- the types (this basically tells the Reflection.Emit library to
- finish up the types), resources, and definition of the entry
- point are done at this point, and the output is saved to
- disk.
-
-* The parsing process
-
- All the input files that make up a program need to be read in
- advance, because C# allows declarations to happen after an
- entity is used, for example, the following is a valid program:
-
- class X : Y {
- static void Main ()
- {
- a = "hello"; b = "world";
- }
- string a;
- }
-
- class Y {
- public string b;
- }
-
- At the time the assignment expression `a = "hello"' is parsed,
- it is not know whether a is a class field from this class, or
- its parents, or whether it is a property access or a variable
- reference. The actual meaning of `a' will not be discvored
- until the semantic analysis phase.
-
-** The Tokenizer and the pre-processor
-
- The tokenizer is contained in the file `cs-tokenizer.cs', and
- the main entry point is the `token ()' method. The tokenizer
- implements the `yyParser.yyInput' interface, which is what the
- Yacc/Jay parser will use when fetching tokens.
-
- Token definitions are generated by jay during the compilation
- process, and those can be references from the tokenizer class
- with the `Token.' prefix.
-
- Each time a token is returned, the location for the token is
- recorded into the `Location' property, that can be accessed by
- the parser. The parser retrieves the Location properties as
- it builds its internal representation to allow the semantic
- analysis phase to produce error messages that can pin point
- the location of the problem.
-
- Some tokens have values associated with it, for example when
- the tokenizer encounters a string, it will return a
- LITERAL_STRING token, and the actual string parsed will be
- available in the `Value' property of the tokenizer. The same
- mechanism is used to return integers and floating point
- numbers.
-
- C# has a limited pre-processor that allows conditional
- compilation, but it is not as fully featured as the C
- pre-processor, and most notably, macros are missing. This
- makes it simple to implement in very few lines and mesh it
- with the tokenizer.
-
- The `handle_preprocessing_directive' method in the tokenizer
- handles all the pre-processing, and it is invoked when the '#'
- symbol is found as the first token in a line.
-
- The state of the pre-processor is contained in a Stack called
- `ifstack', this state is used to track the if/elif/else/endif
- nesting and the current state. The state is encoded in the
- top of the stack as a number of values `TAKING',
- `TAKEN_BEFORE', `ELSE_SEEN', `PARENT_TAKING'.
-
-** Locations
-
- Locations are encoded as a 32-bit number (the Location
- struct) that map each input source line to a linear number.
- As new files are parsed, the Location manager is informed of
- the new file, to allow it to map back from an int constant to
- a file + line number.
-
- The tokenizer also tracks the column number for a token, but
- this is currently not being used or encoded. It could
- probably be encoded in the low 9 bits, allowing for columns
- from 1 to 512 to be encoded.
-
-* The Parser
-
- The parser is written using Jay, which is a port of Berkeley
- Yacc to Java, that I later ported to C#.
-
- Many people ask why the grammar of the parser does not match
- exactly the definition in the C# specification. The reason is
- simple: the grammar in the C# specification is designed to be
- consumed by humans, and not by a computer program. Before
- you can feed this grammar to a tool, it needs to be simplified
- to allow the tool to generate a correct parser for it.
-
- In the Mono C# compiler, we use a class for each of the
- statements and expressions in the C# language. For example,
- there is a `While' class for the the `while' statement, a
- `Cast' class to represent a cast expression and so on.
-
- There is a Statement class, and an Expression class which are
- the base classes for statements and expressions.
-
-** Namespaces
-
- Using list.
-
-* Internal Representation
-
-** Expressions
-
-*** The Expression Class
-
- The utility functions that can be called by all children of
- Expression.
-
-** Constants
-
- Constants in the Mono C# compiler are reprensented by the
- abstract class `Constant'. Constant is in turn derived from
- Expression. The base constructor for `Constant' just sets the
- expression class to be an `ExprClass.Value', Constants are
- born in a fully resolved state, so the `DoResolve' method
- only returns a reference to itself.
-
- Each Constant should implement the `GetValue' method which
- returns an object with the actual contents of this constant, a
- utility virtual method called `AsString' is used to render a
- diagnostic message. The output of AsString is shown to the
- developer when an error or a warning is triggered.
-
- Constant classes also participate in the constant folding
- process. Constant folding is invoked by those expressions
- that can be constant folded invoking the functionality
- provided by the ConstantFold class (cfold.cs).
-
- Each Constant has to implement a number of methods to convert
- itself into a Constant of a different type. These methods are
- called `ConvertToXXXX' and they are invoked by the wrapper
- functions `ToXXXX'. These methods only perform implicit
- numeric conversions. Explicit conversions are handled by the
- `Cast' expression class.
-
- The `ToXXXX' methods are the entry point, and provide error
- reporting in case a conversion can not be performed.
-
-** Constant Folding
-
- The C# language requires constant folding to be implemented.
- Constant folding is hooked up in the Binary.Resolve method.
- If both sides of a binary expression are constants, then the
- ConstantFold.BinaryFold routine is invoked.
-
- This routine implements all the binary operator rules, it
- is a mirror of the code that generates code for binary
- operators, but that has to be evaluated at runtime.
-
- If the constants can be folded, then a new constant expression
- is returned, if not, then the null value is returned (for
- example, the concatenation of a string constant and a numeric
- constant is deferred to the runtime).
-
-** Side effects
-
- a [i++]++
- a [i++] += 5;
-
-** Statements
-
-* The semantic analysis
-
- Hence, the compiler driver has to parse all the input files.
- Once all the input files have been parsed, and an internal
- representation of the input program exists, the following
- steps are taken:
-
- * The interface hierarchy is resolved first.
- As the interface hierarchy is constructed,
- TypeBuilder objects are created for each one of
- them.
-
- * Classes and structure hierarchy is resolved next,
- TypeBuilder objects are created for them.
-
- * Constants and enumerations are resolved.
-
- * Method, indexer, properties, delegates and event
- definitions are now entered into the TypeBuilders.
-
- * Elements that contain code are now invoked to
- perform semantic analysis and code generation.
-
-* Output Generation
-
-** Code Generation
-
- The EmitContext class is created any time that IL code is to
- be generated (methods, properties, indexers and attributes all
- create EmitContexts).
-
- The EmitContext keeps track of the current namespace and type
- container. This is used during name resolution.
-
- An EmitContext is used by the underlying code generation
- facilities to track the state of code generation:
-
- * The ILGenerator used to generate code for this
- method.
-
- * The TypeContainer where the code lives, this is used
- to access the TypeBuilder.
-
- * The DeclSpace, this is used to resolve names through
- RootContext.LookupType in the various statements and
- expressions.
-
- Code generation state is also tracked here:
-
- * CheckState:
-
- This variable tracks the `checked' state of the
- compilation, it controls whether we should generate
- code that does overflow checking, or if we generate
- code that ignores overflows.
-
- The default setting comes from the command line
- option to generate checked or unchecked code plus
- any source code changes using the checked/unchecked
- statements or expressions. Contrast this with the
- ConstantCheckState flag.
-
- * ConstantCheckState
-
- The constant check state is always set to `true' and
- cant be changed from the command line. The source
- code can change this setting with the `checked' and
- `unchecked' statements and expressions.
-
- * IsStatic
-
- Whether we are emitting code inside a static or
- instance method
-
- * ReturnType
-
- The value that is allowed to be returned or NULL if
- there is no return type.
-
-
- * ContainerType
-
- Points to the Type (extracted from the
- TypeContainer) that declares this body of code
- summary>
-
-
- * IsConstructor
-
- Whether this is generating code for a constructor
-
- * CurrentBlock
-
- Tracks the current block being generated.
-
- * ReturnLabel;
-
- The location where return has to jump to return the
- value
-
- A few variables are used to track the state for checking in
- for loops, or in try/catch statements:
-
- * InFinally
-
- Whether we are in a Finally block
-
- * InTry
-
- Whether we are in a Try block
-
- * InCatch
-
- Whether we are in a Catch block
-
- * InUnsafe
- Whether we are inside an unsafe block
-
-* Miscelaneous
-
-** Error Processing.
-
- Errors are reported during the various stages of the
- compilation process. The compiler stops its processing if
- there are errors between the various phases. This simplifies
- the code, because it is safe to assume always that the data
- structures that the compiler is operating on are always
- consistent.
-
- The error codes in the Mono C# compiler are the same as those
- found in the Microsoft C# compiler, with a few exceptions
- (where we report a few more errors, those are documented in
- mcs/errors/errors.txt). The goal is to reduce confussion to
- the users, and also to help us track the progress of the
- compiler in terms of the errors we report.
-
- The Report class provides error and warning display functions,
- and also keeps an error count which is used to stop the
- compiler between the phases.
-
- A couple of debugging tools are available here, and are useful
- when extending or fixing bugs in the compiler. If the
- `--fatal' flag is passed to the compiler, the Report.Error
- routine will throw an exception. This can be used to pinpoint
- the location of the bug and examine the variables around the
- error location.
-
- Warnings can be turned into errors by using the `--werror'
- flag to the compiler.
-
- The report class also ignores warnings that have been
- specified on the command line with the `--nowarn' flag.
-
- Finally, code in the compiler uses the global variable
- RootContext.WarningLevel in a few places to decide whether a
- warning is worth reporting to the user or not.
-
diff --git a/mcs/docs/order.txt b/mcs/docs/order.txt
deleted file mode 100755
index fb23b66c014..00000000000
--- a/mcs/docs/order.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-The plans:
-
- Currently types and base classes are being registered. \ No newline at end of file
diff --git a/mcs/doctools/.cvsignore b/mcs/doctools/.cvsignore
deleted file mode 100644
index 378eac25d31..00000000000
--- a/mcs/doctools/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build
diff --git a/mcs/doctools/ChangeLog b/mcs/doctools/ChangeLog
deleted file mode 100644
index 393d023425c..00000000000
--- a/mcs/doctools/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2002-03-28 John Barnette <jbarn@httcb.net>
-
- * makefile: added gui target, no longer uses CVS NAnt
-
- * doctools.build: Reworked, added gui target.
-
-2002-02-24 Nick Drochak <ndrochak@gol.com>
-
- * makefile: have 'clean' target remove the build directory
-
-2002-02-14 Nick Drochak <ndrochak@gol.com>
-
- * doctools.build: Fix build script so doctools will compile (doesn't run yet though)
diff --git a/mcs/doctools/README.build b/mcs/doctools/README.build
deleted file mode 100644
index f29dd30eddc..00000000000
--- a/mcs/doctools/README.build
+++ /dev/null
@@ -1,8 +0,0 @@
-28 March 2002 (jbarn)
-
-The NAnt buildfile for doctools uses tasks that exist in NAnt 0.7.x,
-and are not available in the version of NAnt (0.6) in our CVS tree.
-As I really don't want to go through the hell of getting the newer version
-of NAnt into our tree, the makefile and build files under doctools require
-NAnt 0.7.x or greater to be in the path somewhere.
-
diff --git a/mcs/doctools/doctools.build b/mcs/doctools/doctools.build
deleted file mode 100644
index 4d2fee7f6b6..00000000000
--- a/mcs/doctools/doctools.build
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- NOTE: this buildfile requires NAnt 0.7.x or greater. -->
-
-<project name="doctools" default="gui">
- <property name="build.dir" value="build" />
- <property name="build.resource.dir" value="${build.dir}/res" />
- <property name="debug" value="true" />
- <property name="src.dir" value="src" />
-
- <target name="init">
- <mkdir dir="${build.dir}" />
- </target>
-
- <target name="docstub" depends="init">
- <csc target="exe" output="${build.dir}/docstub.exe">
- <sources>
- <includes name="src/Console/docstub.cs" />
- </sources>
- </csc>
- </target>
-
- <target name="core" depends="init">
- <csc target="library" output="${build.dir}/Mono.Doc.Core.dll" debug="${debug}">
- <sources>
- <includes name="${src.dir}/Core/*.cs" />
- </sources>
- <references>
- <includes name="System.dll" />
- </references>
- </csc>
- </target>
-
- <target name="docval" depends="init">
- <csc target="exe" output="${build.dir}/docval.exe" debug="${debug}">
- <sources>
- <includes name="${src.dir}/Console/docval.cs" />
- </sources>
- </csc>
- </target>
-
- <target name="gui" depends="init,core">
- <mkdir dir="${build.resource.dir}" />
- <resgen input="etc/gui/ImageResources.resx"
- output="${build.resource.dir}/Mono.Doc.Gui.ImageResources.resources"
- />
- <resgen input="etc/gui/TextResources.resx"
- output="${build.resource.dir}/Mono.Doc.Gui.TextResources.resources"
- />
-
- <csc target="winexe" debug="${debug}" output="${build.dir}/monodoc.exe">
- <sources>
- <includes name="${src.dir}/Gui/*.cs" />
- </sources>
- <references>
- <includes name="System.dll" />
- <includes name="System.Data.dll" />
- <includes name="System.Drawing.dll" />
- <includes name="System.Windows.Forms.dll" />
- <includes name="${build.dir}\Mono.Doc.Core.dll" />
- </references>
-
- <arg value="/resource:${build.resource.dir}\Mono.Doc.Gui.ImageResources.resources" />
- <arg value="/resource:${build.resource.dir}\Mono.Doc.Gui.TextResources.resources" />
- </csc>
- </target>
-
- <target name="clean">
- <delete dir="${build.dir}" />
- </target>
-</project>
diff --git a/mcs/doctools/etc/gui/AboutMonodoc.png b/mcs/doctools/etc/gui/AboutMonodoc.png
deleted file mode 100644
index 9cf817597c4..00000000000
--- a/mcs/doctools/etc/gui/AboutMonodoc.png
+++ /dev/null
Binary files differ
diff --git a/mcs/doctools/etc/gui/AssemblyBrowser.png b/mcs/doctools/etc/gui/AssemblyBrowser.png
deleted file mode 100644
index b7de659ce54..00000000000
--- a/mcs/doctools/etc/gui/AssemblyBrowser.png
+++ /dev/null
Binary files differ
diff --git a/mcs/doctools/etc/gui/ErrorExplosion.png b/mcs/doctools/etc/gui/ErrorExplosion.png
deleted file mode 100644
index cd3d9572781..00000000000
--- a/mcs/doctools/etc/gui/ErrorExplosion.png
+++ /dev/null
Binary files differ
diff --git a/mcs/doctools/etc/gui/ImageResources.resx b/mcs/doctools/etc/gui/ImageResources.resx
deleted file mode 100644
index ff32aaf2d35..00000000000
--- a/mcs/doctools/etc/gui/ImageResources.resx
+++ /dev/null
@@ -1,504 +0,0 @@
-ďťż<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 1.3
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">1.3</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1">this is my long string</data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- [base64 mime encoded serialized .NET Framework object]
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- [base64 mime encoded string representing a byte array form of the .NET Framework object]
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>1.3</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="AboutMonodoc.Bitmap" type="System.Drawing.Bitmap, System.Drawing, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>
- iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAK0dJREFUeF7tndvq
- Z0eVgHsewScQfAEvfAARciEiitHQTrRD1E7UG49IGMUbURFEUBREUfBCHJBhLvRCwQMiY1CI4oGIIgoe
- Bg9jTIjaHrHnS69OpVKHVatqn3977Yvm3/tXtapq1fpq1Xn/2wMPPHDFH9eAa2BDDQChP64B18BWGnjT
- m950Zau0PV3XgGvgzW9+82tf+9qnILypPo888kjx9973eir+q2vgPBp4y1ve8vrXv/7ee+99GoT/sfuH
- lmPnDw3bzp+7d//83wmev/3tbxD4qle9itpwCGeGeucEkr3dM3j3xTP4m9/85k9/+tP169evXbt29epV
- h9Ah3B2VDuGuu6QzE7OAOPeE05l2CB3CSWg6hA5hsxE5Xnf0i1/8Ypgx+/znPz8JkeUj7x/CD33oQ//5
- 5DMdmCUkNI346AEOBuFnPvMZCHzf+97Hfgb+rUH49re//aMf/Si/Js9nP/vZD3zgA3b0EEKURAgv3/3u
- dxuFDED4wQ9+8OMf//h/lx5+esc73jEgsxaFUjAlQBlRJootIkSKQPqDH/yAkMmCAS/5ifXl2dl773vf
- G1oH0o2fxx577A9/+MPRwYvzfyQIP/KRj9y4cQOLkR1FRQj59cc//jG2Qj196UtfIkx4Pvaxjz300EP8
- hBC4AtQaSJ/61Ke++93visEhhIhBCP/96U9/yvtf/vKXpNVE0QjMe97zHjz8z3/+85CogBE/IWnq7+tf
- /zpAGoUrwUgURT3jGc9AnwmEoAVgv/3tb3mP3sjJHXfcISHl4b+8FG187nOfu++++yaiCO3I+dnPfmZR
- wj//+c+//OUvADmFxkcffRQJ8vz+97+3ixqOWEziMBAKgVhDsIMEQshBj9QfzGAfta1/RCciloe03CsG
- ITBw11131YQ85znPIRXSAnjdKzY5wekJexSNLSNI1jctPutZz7r//vsBkijUKNGbSdQCgDFCwm5h/sb/
- ABL4feUrX+G/AIauSFHPEhLQJ/AMu0ScnrA3oARofPzxx+38SEgo+sc//iEpokzyL61zU85wREXyMSCk
- F5oQGHtCMBDvBzlNixF7AkW0H3OIY+wVAuqYaRHm4CEVQmj4f/jDH0q2E/YoBZYN59iHPMCQNAqEISLR
- ESLbnboefO+f//xnJAfA+BsI8UWCH6jb9zCTf6IAUq8/hFv6tNOV8Pe//93uykDuX//6FwYQqx2Fk42/
- /vWvCi3GiDTu//X058tf/jIvYsn8l5fyZu8QfvKTn/zJT34ilRT3hQKEvAcDLEDxfkVjChyCHw4QIah4
- TAjVX+vc1sAQBvJsY/rSZ6Zu6Ct++tOfxl8xPJSX5BAakz4hLxGFQDuEknrcrUBFQMjQC2n5SRrUIk9S
- BbFiMWji4kLtnVKaIVJUlEBnmEbhj3/8I91FQkKIogS4wk01XRkB6MeSaF4Wmjnkk1xNiCVioOu5z30u
- crBemOSPF73oRYFDNP/sZz87pLJfCOl/yk5UjKPIBub44IMPSv8zViiq5CfgrPmQYDrEwm6CA8yFKI4o
- CMEjifEVx4dFMEArZwA5QhrjvSJRyIdGiRg34dKaEBGxFg6LqQuEcUtHflCjSOYJEzPSRy3SSAtCSGOn
- 9BOf+ARcJQ1BUAL6BFHhOUaC9o5YuR8LSlAQCnLIZM3PY0uKM7REhDpJSCAUDvkXd3LPPffIG2gMv+7a
- E5JpakjpXsrQLmiTkGhQOvdMqzD1gn/jX5liSQw3nl3gV5lulW6qiA1CZJZVhGB/xYGi9GSKg8OcCvFC
- ScMhboT6aDo0AjCGJHDSg5UxqjJbA8PgRxJ5syVlDwJFkwTDETE3E2CQ4SJvxH0Vh6+8J0DTGYoPLCqB
- ROMUEwjFiGVgVlNCc7aGotV62tQvPduaJ+yKGGMm4AEhdngwCOMRS6418BM7EHJQEM0kbXneM6Q/wGRm
- XmciM7hZKkAmbIpzpzAmKGI6eWYwvuJ6SQIh5pX7QGnFQcs4tCMYgfMOFepS+qXSkSPz+rAZrRIMEvBU
- NZZAkeEfwXJRVMQ3v/lNHUKi5z5QlFAcVRaRoK7hsKiEZr9UYQljGIMwj5hDyCDwne98p3RKD+MJxYPl
- cxLJUERmR/SFe8iEw+JIQKRJ2w9mytIF1i9zIfmoiUzSrc17pAmETKLkeSBu76BOYE6agwBzsVOqWF7Q
- pyiBrmBzfoUAgJq3RzRkdFx1CAlQVAJkJj4w747GQMo0SVEJ8FnzZtIXqLVEtEE6hPaIOYTC3pEgZL8c
- w0ImJ77//e9LVzD3P9KLgy7L6jlhYLV4f4cYn2XdD8yw0bC2lnRrdQjpDZJKMr7lv7xksGcZzsVhRFpi
- EyikJo33+vqHKEFxgAlahCR8MjiU4igQSqyiEmr9WAUnRoA1JYB0LSKrGrUxIb0JZl+mR8TpPfOZz5Qp
- Gel/4gMZHPKvzJTya5in2e/ETLxp9f3vf39R10Kg7rtiMOAH15rALHZjJBBpJAfMeS0iRIeQyshdB+ni
- HnsJlPBFgeJX856trEYqPdIuAgUzDD0fJOsQFv0nSlD8pwIhP0FUrlWUgJOsLVrUJjllYkkZUg5H1Itw
- DAgBkpnSpPlE0V0EYpe0TMXGu9iTVHbDMCubVzySmcVJYgW6WFXP2xHcCC+HF9xxhkCVtCky5Vt0rfHc
- TD7hrMNTdG4M/8KcVsiGIodF+ZoS+KnmP3ULxhnWlFBzhmG5L+5HyGBYcYPf+c53Hn74YZhP5gubEfX8
- J7OjL3zhC/d7nhBXnkM4sIEbJ5b3hXohlPWPxPp5o0BIzYUNdyEi9YfXGnODxAIqbDr3RYBB1Spi8b3F
- RqQ5q5kEoAPZBSHQFpUALUrSuhHLNqmiEgCmFpf5VX4lYrxjBgL1FX84HIt4IZ4QCBNFJ9vWmts4JQC8
- JT1JmOyFENh6ISwaCiSwKjgMIRFl4ippDmjgSU5Z7cCF5vkf8IRA2CWnpgR9iR/T5wl2HP4b/mBlr6YE
- ffn+Rz/6Udg7+r3vfS9JIkmXX0M2EItBhk2nErIYvvhT8vIw3VGmZxJFj0FITzKRMwZhPlGkeELZpZlP
- LIGQcYW9BqpspilKViZ7yE8XPDU3xTY3uxwC15SgzwYJG0UO5b0seBSVoEzP5DLzhGph4vdxxsbeHwZC
- pklzCCHK6ABDMHqw0yFkojW3JwVCeCiueer+yuIhcXf5KBdzpIzKfM9cEHZ5wmJgskr+iysTgfzcySRA
- 4pdqSlDWG8YgLGYm9mx5Y5F78rh3yq8HhpBeZW83EhRngVAGY/YxIX3OvL8k9mchTQ/DqDKfZeEN06HK
- +Qm7B1NGa7UxoZzGSB76nDUl6GPRoieMu478zVxoUQn6gmECjN0TFiPqA78QJfecB4ZwoBu5FYQ4pXxJ
- Q5ZGpkNYFC4LhptAKKcxcq5YhKgpoQmh4kzEpvF4uXBRgsJGEYxa99LoOZPWIf+vQ7iNJ4STYjs9vEIY
- 0zXgZmfsjubOTYGwqITmDhux2pjDfLaDic2am61BWJtNCWnl5NfagmJ3tNZHzeUHT/jiF79410sU+Zjw
- WJ5wOQgZcPb2dY8FYU5R4kwIwARML4R673HNX707+sQG7oGxZdeYcFFPeDYI86kRh3ClOxGX84TsJl0B
- wuJwaJbuaHGpUJ/12coTFpXQ7I5anFJxqVCUYIm+bRj3hE/M5teO5CrrH12esDhsm3FiJt8vogvfBMLi
- 7Ghzw3fxPGHODBMzNSVsC5gldYdQuzpxLgjpMebbtaSdNp4hVCZREZIPOPE566wT5iMxdmAWZ0dZz6gp
- QT85ZbHjmhL0dUKL5BXCOIRrQMgW7XyTMRDycuLNhbJYn28W0TfELeoJyU8RKrZo15RQhDasWzQxkMX6
- ohKUDdlNsasFcAjXgLC205rZ/IGThLFXZKic79iSgxTKhrgZIbQv+kNmce8oEvQbMZowyE18xdMklitn
- mvKXDnA6CDk7P8se1K4xoey0Lh57U/a1WNbxsY/8mLIczlA6unNB2LV3FM/GKYqiErjVYvgUBRrgPERR
- CcqRwqW56pJ/OgiZCM1PYyw9MQNOykH45uVOysYX2oL8wgU2l+uHM7aCUI7VF28DULaP6gbNUYaaEvS+
- KFcGy/2/8kBs8yiT5GQ4Yq0gh4Hwa1/72vSN13KUKZnGWGGJIhyEz2cm8JDDp5mYesl7g2hJtkQrjnQr
- CHF3nKwvKkE5zaRDyNRLTQlygV3xkXsxwrXLdODlbC5Y6kcKByLmWwuSLB0GQo5vJV0OWGIw0HuKIodw
- YLG+9xSF8CCH6xM/LFcqDEzPMJjMpwSVO2ZiJmsQNu93SjqNvd1Rosvh+qISatMzCoTyjZqkVRUlKIeY
- xHnmHWO5skjxn8MR9XbkSBAmupa7IewXzIRDvdNP1nOot3iekJtOa9dbCAP4vfymQBpyKqlrrUIuL026
- BiiEXFkGmUUIa0sLymitBqF+NImRYVEJOMliK1Dcw4nGOJLLaLCohOTwRLzJhr/BrHabJm0iMpVtpUpE
- Ngwku3mKm3tCccIfx9g7Khc95ath1CVHCi1XrQkbEJvLkfXirk+mMbuTVwZ9G97rEPIr1pNfO01B7PeO
- Fi+xl/sOIdPy7bTi+cbmLGVOIzjleiAb+qWJcl1iUQnKvaPJ6SEIlHu44+veRAm8jzui+QG/4pELmVyV
- SwlixxWftGhGLPY885fJZnSB8M4779zpN+vf9a538TWYX/3qV8UrD2m35NNc9EvpZ1L3uS/C7qGU9/xK
- d7+4VCWXvcu93Xi5IpByFTfM1y41kS8Z8KtkQ1x0PjArIiQdIThsTtLQp61dH9y8vBQHyPwQQ1DymS+y
- y2ASDPj8Q+3aJe7txfvJN0Xlq2n5PhUZXIkoVMFkTO7f5AbuBCFRArGKN3DHpkwYhcDkSoucAVjKG/T4
- oqraqYhmxGK3swhhCMmvO4UQ1/etb30LtKhLKib/blG8KET7h04ZMcrNvOH2JzAIzMAqvxKmdnmrfMGC
- dj18fSHc2iQXliKZXwmDkdWEyNeUSEisEBSLsyOBw1gOJihJ46aK3gyEwlec4uZfvoikExh/+ZCxUO3W
- TUQFNZITHF3Mg3y9jLREDzzKZd6IIhX5MEHxTu7AYVEJ8bdHxV7FlBmVQYLMqeRKKN69XYSwpgEZ49RY
- UjyhHjERmDjnnUKI9/vqV7/6mte8RvkMUL5DQq51CBBCERagMFOUIC+xs1iOcnV3TQhWgoTaFCUcUjGS
- vVgC+RffDpDQKL6LFXkCSyuQXznHexhTeqGyVaD55cOkILRK5CHeXY3r6xWCTOTULsYnz8hUlEBEaAQ8
- 5iSxVLkfraYE+TpFzk8CoWVMWINQH0zSBNi7owfwhED44Q9/+HnPex42Fz+YrLTB+SPBaHpjeGrDaAU/
- +SmBuSYnzltioCJBWSeADekZ5lYV3DI/8VCo3IeHrnhzzw0JFTvhTSVQugRC4+cfY8nkU/k6BT1V+SDp
- RCU0L3SK50hkkjPvkcrMFqTVzuPKV/osEYP3zud4klki/vvtb3+b/F+/fn1fh3qBkAIXH7qpeAZ5wtfk
- GRCGJ9yljSdEZcNPDLMiRNLlGuIQRjps2L0OofAZOpnEsnypFz7Dx6dg2DINI55w7EkgHBPS/Ggh40z5
- VOiAEmBGWQ+srQ3QsSRWjJMMB5JJnTz6cERlleIwSxTFY4u9i4QrhGcACfzyMCi1bD0jDCyFb9ZjHOL9
- Ym8fD1blosSuJQ0lG70X/i4Xnlmf8M36phJYD6CPav86b8IAEWVsKS2mjMbp0DY/Mzoc0QLhvjyh8aTw
- ClBNTMIIYQhGcjIOpJOZPLxvzp32Jkf45aAalkwfFd/ItKpMw9JVCw89ySYn+sp4/Cuoh8t/u8QORyzm
- zT3hRMoa0QeoWDnKMCqrRbRDddCQDqFDuBpNgwkdFC17th1Ch3CQjdWi2a35oCEdQodwNZoGEzooWvZs
- O4QO4SAbq0WzW/NBQzqEDuFqNA0mdFC07Nl2CB3CQTZWi2a35oOGdAgdwtVoGkzooGjZs+0QOoSDbKwW
- zW7NBw2pQbisec4hfeV17YHkVrPU4YQOariXlG2HcICsjijDbKwW8ZKs+aBlcQg7iBoIuhpLwwkd1HAv
- KdsO4QBZHVGG2Vgt4iVZ80HL4hB2EDUQdDWWhhM6qOFeUrYdwgGyOqIMs7FaxEuy5oOWxSHsIGog6Gos
- DSe0Q8ONT+sNH9vdYblqWXIIB8jqiDLMxmoR92OssMfhXY7MhwPvQuN+crhQThzCDqIGgq7G0nBCCxmW
- XSzgcdMEl7sIe1zqEe4y5eKJQ3zbzF7YYkiHcICsjijDbKwWcaIBTY8uV9lz51J+vSUX7ejXqE1PfQ8S
- HMIOogaCrsbScEKbWyEQ1m5SBE6HcI6tZUvKGKBi5SjDbKwWcQ8Qho5oQqNDeHNJfOaRvTJRA8mtxtJw
- QptDSAZkSkYu2I7vAnUIHcIB6NIow2ysFnEPEIY8MEMTfzbQIXQIHcI2oXIVejucLQRzofEXBwKEcRLh
- /vXwh032/3XlM07FKH84mE/MzECaImI1hzac0LDphIhdxq0nx6pgE0IkJEwOF6GW86XlJxl2CB3Cp0wi
- cTIxZorbKbopiZvEarqXBEKAZKyYoyJv8nTjl0qukrwlzlxpU4r5D9FzObXyJu8FQvm40NWrV6/wTRJ5
- GCLPM3mypJRlAZpD+rCDWi1isLnE+Jrva55wWA4Ccwh5U4QwsfgAfPJH7HNqMCd+yeIea02AxUvn+gme
- 0CGcg7lMxmosDSdU9BhKf8xiykWAEzdbtHU7hIm5F31grTnQO9JjEBZlFkXleoi7o09MDrsnnJfFYTZW
- i1gbUA17QqVP2By8dUFY82BTcp6zbXH4tTarBqEyJnQI5wXwCWmrsTScUNPIhv1JM2LO5ACEOXJjEDZB
- UorTjFtrmEQD3h2dH7xY4jAbq0WMTTaZMIj5DD8loyw9Su6sauElpAXCYrc2zl4YLnYVrZbVWnlz5Qhp
- IXUJYNGbT8ycHcJmF3HNAEUIlS5iyNvjjz9+48YN1vpl20388Ib3TD8OfNAX+RxoRDjfAw5HPWLhHP7g
- Pb8SZlhRvkThEA4bT3fEgEqREygiQLxOyN9ynrA2WcJPrO8LeHwmnRkNxlTxBlT+5g2L/hySIgyHFe0o
- gh/oyge0EX7//fcnRz049sEb3vMrwslG15dGg/ocQoewm6WBCGLNMSpXnnyEE/gRUy5CWEwxfLmanW4B
- PD49D3IIkYe/w08cUxQULWcUwQmowA8J4YwVwskq/4bMx6Xgm9tEGVCOQ+gQDphNRxSsmW/BY/rBmrFp
- QS5wEswaYMKJXuw7eMI8PQhELJCEDd/8IYzxHuZxoWFTOGkFkCCWMHQglTIQlyYDqHKApSwkFG80FxQJ
- zE8dqnkyqEPoEA6YjTUKBIo1B8zAD3J4KZ1POBGzhrf8VGENwkBgEEufECEMz/LeJqlIHgKHErh2UlHy
- TNJJ+NCVJQkSQgJyEpfoEC6L05j01SY5hxOy8tQfLhCYeCHwS65vwvNI3y/p6cm2tTxlJMSBicV/FecW
- uArM4JYBpniBDY1CTCwer+g5SY73+NVQOpHZr6enliiuXbvm29bGQNNiDbOxWsQBozFGSaxZ/E9tPBac
- W3zJRfEoE+QgB48aiIJV0tLvZZNYse8iVj6EI3sEi9sCep74vWKRCSwDXURJT3jsHgDvjs4P3rHWCY1E
- 9QZLrBm0dGcliwHYdMxJEUK6hfHkjXgqy6Vs+K44ogzhkkYBLOMDjQxQCaNPqJK0PPZ510SZDqFD2MuX
- KTyuKbZmHBeANS8RhRPAizuNiW9BAlTEkzekUvNUSUbFGcYjT+KSzxCMXmsSgBkdmDcVeEIgh9AhnGA+
- laj4hKRThwtiINdMCeSwewVCHBfC4+kQxm+WJQdJGkcXe1q6neQzNA2kjrRYOGlNWYVvllcCOIQOodFU
- OoJBBWOk2JqNPcZksT7vjkJy7GBJAsn2JXI8bRI9vl848cN0oWNEO8rfGdQhdAg7TcYQPEHFvoBWO1kf
- 0qTnGU/JiCsz5Oh2EFqHxNfFE7AIj/0ko0260HbhwyEdQodw2HiqERNUsGbjVhILhPEqOX/Hg7pmSWTU
- F7vo2NmS7US4cbTZTFcP4BA6hBNNqBB92JoHIOzlpAvCLsKH9egQOoTDxqN5wjF/tTSEMrlq9IS9fd1h
- PTqEDuGw8VghtFuzBcJ4TNg7bJPVvBjC+HMXONV4gaR31mdYjw6hQzhsPBqEyb5K/I9lrr8JYTLl0zuB
- ySJEvF4PZvEKR7JAIr9aVlYmatAhdAgnmlAhejLXjzWz+qcfXBApTQjzxY+upTzGeLGvk2nbsMJBM5H4
- SeMeg4kadAgdwokmVIiOS0nWCWXjaHNjVxNC2QYQ75gx4k0u8y0EABlP2+bbcWS3ndEZEl2eXoU6hA5h
- r820w4u5JyfuwLI52diEkLTZRxav9RnxJiKuOG4acIPyIZq4PMnGVHy43MGrb8oBPITz/PrXv7bsYk00
- 6BA6hG2oBkIwyZGMvmR6BktVfIUFQlnri6dnlIMOIed0NYunKPJDVXnzIeeAaxyGc1g0B8opZEWHDqFD
- OIBYO4rslk6cIWaK88EfFt0FnPBT8i2KYlcwOU9YO/IXcinnCeNdqcJVMRs0H/F5QplKlfD4yXiLHBmW
- 073hRDIR3RMuS9SA9NWOBQ4n1OZpNIScc0/Oy+MPMVkMV25Ak0socI/hsqb4LJ90BSET6iSw5MV+sl4u
- a0JIzJXu2YTYZIspHDIQRQii+FVuA+AB7NDQiFj7RtagV/eEA2R1RBlmY7WIo4i14wEAaMV3W4QFOrkB
- Lb6OCScpuCbXpcEkKBL4C1/4QuxkAodhkibcMYO/Ajx6j7Atd6WFGVEmWuQ6KX2MJ4ch41PzIedyw1py
- 3ZNRbE1lDmEHUQNBV2NpOKE2TBNCyC1PYBAP4fKryuSWJMLI+fT8DiXeJBCKP4Q3cUfBf8JkwBuKYFuO
- 6vMv7+V6G8uKpZyapwXJM5PknyTItlFsUZcO4QBZHVGG2Vgt4gTETFFBhc4kqGCpYBb3NvlbmJFuHm5T
- LvAVP4Nxh5+k+6qMJKXDKfeOxhdkyL2g0Cj44SHtSwi0IDLkC5IDfsl1prjc5uqLT8x0YDNv0NVYGk6o
- SVJy7XwzfDGArLaFoZQMqGS8J73HBx98UG74xe55KQ/GzU+WURZhBGC59CV+5IZsPBv4KZcI18oVJCdi
- J17sHSfnnnBe6FJpw2ysFtECVe2DJ5a49jADhNiFS8iJSUyM7mPCZWGrSV+NpeGEEsBqHzAJBmQMX/zw
- i/41mKLkAE/8oRVdTs3Wc4SaH8DJua1xmHwHpqt1cE+4LJzDbKwWMf50UWw6Ne/XDJ+YaTN8EW/F+mvy
- m3avRyzmM0fLIUw/vb0sQHNIX42l4YQskDTdWmKstfA1yGt9RQWMAWeYQxgLqekhYXuJHql7wjlQq8sY
- ZmO1iEYIc06M5miR3wth0+kVAxhdqF4uY6m7cqhBuKx5ziF9NUsdTmjAdpeo5lpzXutzJr3BYjClY1b0
- eE0GigLtHcKm3TczUGwL7LGGK84hHObLFFGsOVhS/LdiNMVuUtPIjAGUjpze7cwHb7XuXC0Jy/tipzFv
- RJRSjE3MJA1NraaMLYWxLiSYQ2hiaThQV2V44KU1MOysah1m/b2xOA7hMF+miMZq8GDraGAhCCdm3iE0
- sTQcaGL1ePQzaMAhHObLFPEMNuRlnKgBh9DE0nCgidXj0c+gAYdwmC9TxDPYkJdxogYcQhNLw4EmVo9H
- P4MGHMJhvkwRz2BDXsaJGnAITSwNB5pYPR79DBpwCIf5MkU8gw15GSdqwCE0sTQcaGL1ePQzaMAhHObL
- FPEMNuRlnKgBh9DE0nCgidXj0c+gAYdwmC9TxDPYkJdxogYcQhNLw4EmVo9HP4MGHMJhvkwRz2BDXsaJ
- GnAITSwNB5pYPR79DBpwCIf5MkU8gw15GSdqwCE0sTQcaGL1ePQzaMAhHObLFPEMNuRlnKgBh9DE0nCg
- idXj0c+gAYdwmC9TxDPYkJdxogYcQhNLw4EmVo9HP4MGHMJhvkwRz2BDXsaJGnAITSwNB5pYPR79DBpw
- CIf5MkU8gw15GSdqwCE0sTQcaLh6+HItTx69+H79b5gMl8sj5hpwCIf5MkWcYnNFCBGYv1cgnHjn9JT8
- e1yjBhxCE0vDgYQZwSZxYvF/i/7NDiHCjd9IMpqFB1tTAw7hMF+miFKXCW+hgmPMcuQcwjVJ2DAth9DE
- 0nCgAGETvCUg9L7ohmjZk3YIh/kyRdwWQqWbajcRD7m0BhxCE0vDgYwQ+phwaUPfs3yHcJgvU8QwIIzn
- ZpKhYD5tI0yGJ+7KFt/7xMyeGWvmzSE0sTQcqFkBswTwdcJZ1LiVEIdwmC9TxHXq1Sdg1tHzQqk4hCaW
- hgMtVG0u9pI04BAO82WKeEm24mVZSAMOoYml4UALVZuLvSQNOITDfJkiXpKteFkW0oBDaGJpONBC1eZi
- L0kDDuEwX6aIl2QrXpaFNOAQmlgaDrRQtbnYS9KAQzjMlyniJdmKl2UhDTiEJpaGAy1UbS72kjTgEA7z
- ZYp4SbbiZVlIAw6hiaXhQAtVm4u9JA04hMN8mSJekq14WRbSgENoYmk40ELV5mIvSQMO4TBfpoiXZCte
- loU04BCaWBoOtFC1udhL0oBDOMyXKeIl2YqXZSENaBCarGzTQAspxcW6BtbUgEO4prY9LddAQQMOoZuF
- a2BjDTiEG1eAJ+8acAjdBlwDG2vAIdy4Ajx514BD6DbgGthYAw7hxhXgybsGzgih8smx4jchFCuZ5dbd
- Wn7s1kk25CFKnqVZMhnk67mKcyKZMUa0F7ZYxjj6LOXtys/EwGeEsKiyMRL2UN9xHpaw+KAuY2GTPBhj
- ddnxhX2Z+FwQ5p9Yoe6Tr6/YaSz6nK62v5ifPEtN51MLkGcmd5ihFPFPRSs3ljdxyHkbEVOq5Cd2pHb3
- vgTzXQ3EQOBzQSgKKmJmZ6/mGZLqt1tDkrT+32IdB9gs8OSw5RxaurW18tYgVMKHKHFcXZ819drVPkDL
- QlEcwtuKnQXCGAa7NRS/0Vtzkk07aDqNGDmRlr8xQlgsbyKt5gmb2UiEW9o4u86balwzgEM4J4RjNafz
- 39s6rAlhzS3HbBcJL5Kv0Jsn5J5w06MTUeIzGn2vree+YrgZntgdDd3LxK01u82KLzJ6Qh1CEVJzsxZP
- qNSvQ3hUCItfwF1oYsbCpCU/zYYmHlDlfba4UxeoiKMkTimEj9OtdbPz90n0vIEIb2pxa/mxdEeLbUdT
- gZsHOGN3dEalW0ibMbmlRR2lOHo+j1KKUJsO4STDPlx96x28xHFNUs2SkS9J7ejJIVzSWFy2a8CgAYfQ
- oCQP4hpYUgMO4ZLaddmuAYMGHEKDkjyIa2BJDTiES2rXZbsGDBpwCA1K8iCugSU14BAuqV2X7RowaMAh
- NCjJHCTeL5KvZc2yumVcyivuXJklA2ZlrBGwtkOItA+kf4dwNluJa92IyljaRpbyLWNjye05VqLzkNVj
- 6d8hnM3GFDbyDZnxFkrJQYie7K7M81ds44tJJGITG40tVcmPCMnlK4qLwzebjCRwM3xcijgPx9U/ED70
- 0EN33HHHtWvX+PfKA08+N2/e3Ms27Xo+ZgNoJkG6sRb7TsHEixxaulW52JjqmO2E9ib8Ercmv6az3vDD
- ujc2Rgq0oYBJSZPmKcmhXsBE4Rb9iycEP56rV686hMMmkUYsmkix5dbrySKn6Hlq1pB4NiX12Ea7nOFw
- 4Nj6mzWh+0yL3vJmKG+nLHIm6j9AiCd0CJv13hHAUnlzGUExW80muZl60RN2qOBWUB2VXmnG/mdXD2J6
- IzhR/w7hFDN4WtykFd8PhMH1FZt5iyfs0tFW3dHj6t8h7DIwLXDSeUva7KSHFv4bExLzEAeIRzXFnl7e
- HUqi5wYa3tTixs6k2N2q6aIr8BTtF2k36m1v+peJGR8TTrGHmeMu14WbOaNbi1tIUQuJrWnLlyi2tqMs
- /WJbvrtc7iNDS9Cyvv4dwn1Yk+fixBpwCE9c+V70fWjAIdxHPXguTqwBh/DEle9F34cGHMJ91IPn4sQa
- cAhPXPle9H1owCHcRz14Lk6sAYfwxJXvRd+HBhzCfdSD5+LEGnAIT1z5XvR9aMAh3Ec9eC5OrAGH8MSV
- 70XfhwYcwn3Ug+fixBpwCE9c+V70fWjAIdxHPXguTqwBh/DEle9F34cGHMJ91IPn4sQacAhPXPle9H1o
- wCHcRz14Lk6sAQ3CE6vFi+4aWE8DDuF6uvaUXANFDTiEbhiugY014BBuXAGevGvAIXQbcA1srAGHcLYK
- WO3694k5TvK5xP25wzncVWaGS9Eb0SHs1ZgWPrahNe2pN62t8tnUdW9BmgIPEcAhnLOaasatfMWF5JOv
- tYQ3xa+4xL9K1gc8sOQz/6BKeB8nnX86JqjMUi47V/aQc9bZDmQ5hHNWQhHC4seDYn7C38kf+X9zXItR
- mkWqfW5BkZ8TYixXMzMx0vbAlxTSIZyzNhXPUPspN0HduIvZ7fUhRU+Y+0Ydj4F86rruLcWcNbepLIdw
- TvUHMzIOugY854wQ5qJqGBTfO4RzmY5DOJcmbw/Pmp4tTm8JCGsjvWa67gnnNIUeWQ5hj7bUsPlAK3aM
- zZ5qAklRWlFIGBYWR3T5y1hI/GvyPm5Nauk2C9XVw+wKPFu17UCQQ7hlJZzW7GpKP6dCHMLNIMx93WZZ
- 2U3CDuHVq1evPPDkc/Pmzd1UjWfENXDJGnBPeMm162U7hAYcwkNUk2fykjXgEF5y7XrZDqEBh/AQ1eSZ
- vGQNOISXXLtetkNowCE8RDV5Ji9ZAw7hJdfuOmXLF/eaO2zWyZiksvl6bHPx0yFc0x4uLa2ifdc2dhs3
- tS+hoyYGExOdKN8hnKh/j144HBwrxXICo1eJtW2uNTk1SCweO2k7uvb01pxwkq5AeMetx3fM9BqDh7/d
- 31Ooyx3jRL9R87RKZVgaghAmpy50a2vF1EukZ5hfgycUDn3bmnPVrYGmkeUSp3PYNdIbhjDJec0Dzwih
- e8Ju+/MIMvNh94RFrzJFjRaei8NRy9jVWC6HcEoNetwZNGCEUJ+YESdjyU0zuVzOFAib3dSkGdJTL7ZZ
- cXfUPaHFBjzMUxpQumfF7qLShzQSKEYcP8UeY+LBhvOZAx8ai6TV0MtbCyzy44kZHxM6YNtowO4Gt8nf
- wqn6EsXCCnbxBg3Y3aBB2PGCOITHqzPP8YVpwCG8sAr14hxPAw7h8erMc3xhGnAIL6xCvTjH04BDeLw6
- 8xxfmAYcwgurUC/O8TTgEB6vzjzHF6YBh/DCKnTV4hS3jyTbU2pbTFbN6HyJFZc0J5bRIZyvfs4nqQah
- aCLfdXkZi/LF3aHysmvrT5DjEJ4PnflKXNzcHMTXtjLnlqrsBc0zq7idXE4cOGkaAjNd5BSVp+uhpm+H
- cD5LPLGkAQib7tHiLWNsanmI3yduKvw3rjpLuk2cuoQ4hCdGZ62i1zxh3lmNPZjFjuMwyd9FZ1jsHieJ
- WtKdRXN5urzheovr169fu3bNjzLNomQXclsDdgh7VVaEMElOcblFT9ibh+nh3RNO16FLaGhgQwj1/qpD
- 6LZ7Cg2ETlc8TxPYSH7t6o7GcWtykkmX4piwGGbNunFPuKa2PS3XgKYBX6Jw+3ANbKwBh3DjCvDkXQMO
- oduAa2BjDTiEG1eAJ+8acAjdBlwDG2vAIdy4Ajx514BD6DbgGthYAw7hxhXgybsGHEK3gY01kG+5npKh
- eMNakJNsspkif2Lc2hYf38A9UbEefaoG8s3WUyTWdnIjs4jolLQG4iZ54L/uCQfU6FFua6DmxHo9T/FU
- RGAmJ0eXr0AY11yykTX/yZ5ulzNPto/HEPpHQh2tPg3UbD0hKglWTKMI4bD8PEW9sZAs1bxx8X3Mp5H5
- uG+cJBe+yuTnCftM0EPHlq0YpUVRNQiTJBJaapJ17BWvm48hLeWq6aGZveAS/XPZFiPxMAUN1Gzd4voS
- cRZPmHgSpUomQmjxwEnftcs+EtcauqP0Rd0TdmnSA6dfya5Bktt0sbuYezkj5Iq0INPo/Yp56Oqm5mYR
- +9KafO+OOk7jGih2F2XAE57c6RWxzI01kZOAVJSvdF+b4RPnFvKT9EibcvRGJ4ku//Xu6LgJesyja0Dv
- uK5WOl+iWE3VntC+NFDz1evn0iFcX+eeomvgaRpwCN0gXAMba8Ah3LgCPHnXgEPoNuAa2FgDDuHGFeDJ
- uwYcQrcB18DGGnAIN64AT9414BC6DZg08OCtJw9ae28S6oFuacAh3NIQima9ZYbUtGu5PVYpdqheDUJ+
- +19/zBr4n1sPwb/xjW+EvyW2/Dd5GYIVA4eIBIuFBGnxe/k7kVPLeAimpytliZ+QYvI+D0kA2Y9iVt6p
- A/7iF7949NFH77333rvvvvuuu+668sCt561vfeuNGzcee+yxR/zp0cDDt54kRvIm/m8eWOLWwhTlS/gQ
- pSYzzlUtvJ43S25DKg/denqUd96wv/vd72iEXv7yl7/sZS97yUtecuVtb3vbG9/4xte97nWvfvWrX/nK
- V/67Pz0aeMELXpAH52XyhDDF8Pwav6/9HSdkCWMJr8ux5LZHWx72tgb4Ou9LX/pS8JPnyhve8Ib77rvv
- nnvu4Yc777wz/OB/WDTw/Oc/Pw9WfCnBaj/F72t/xwlZwljC63IsubVoycPoGrgCga94xStiLl1ldg1M
- gbAIAC8tgFnCdEGYpGtvMkIqcmeRXXUeMmjg/wGWxDeDO3nJPAAAAABJRU5ErkJggg==
-</value>
- </data>
- <data name="AssemblyTree.Bitmap" type="System.Drawing.Bitmap, System.Drawing, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>
- iVBORw0KGgoAAAANSUhEUgAAAPAAAAAQCAYAAAAoEfIQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAACExJREFUaEPtml1o
- XEUUxzdPPlUCRURFqFACIoWIgvQhEARFBSUgVBCEhfjx0JfVYkAUW8hFrFTyVhASUkGtpYagQqG0pbHR
- QEtNtA/FlLZXQhtsTVmMFl0IHuecmXN37ux83f3KUgxM7u69c++cmTm/8z8zd/sAoOT66+vrS/GaqPOQ
- s5K6MDU1NT86OjoUqtfp68LmeWHvptuB/ewlWzo97r32fOW72wy7vu8V34gdr7lLc8NYd3hgeM56DwJs
- FlERwU33XAXYc5EIT231+Nzk5GS6uLg4j0dfvU5fk3aW5kP2dtoOFRR7xpZu9LeX2kiSJF1YWLAV9A0M
- 8A0+z+d6wXfQlr3f7N3XX+mvll4vwZZ37oL73r2niucaWNVPMLi7BbQILx1FwaOrY3TPpHiK+BMQpzaI
- 8RyX0ESzDTa7wgNPAGM1CkChtjp1XQUSbH/TbWmXY27WeLI/6EcZIBPxL6EBNgsCbDuPUDcLcCv9d9nj
- 87/pH6bLp5dPD88uzY6MHByZHZjYCgMHtkL5UHk6x4YcjLrilmYkvHxEgH1KrAOMo6kDrEFLzhxSaBu8
- ugP6gghCy3OZJCUQxQlxK5MRgt6Al6r7bAk9DyffVUL35sZOzGuz/ab7BCZF73fBV8RupaQgjlxoXtsN
- sM/WZvuP/cS5E0NHcxjbb1u9wfHBpVfPPQ4PjvcDgq3NbSmdUUpL0KLafq6O2ne8RsVQNhNgVmEFK4Er
- /0oEcCuQ2hxIRlQqDAsC480YmnFGdCQxCZSC4RG/mwPtgJfsaQZiOeklTAWpKeMYlWXQeOO8JUKxmoCY
- nTdBtSsIsRoPHqYoe/WgoxRThzf7rAPsC3KWazR/PJf2Oayreiv9Z3hp7D0Qb9Sq/ddOvABcbq8tDZp2
- Yfr80qlHYdeJx0BPpVF9CdhqtSpTZUOB9e82iE2ACVXxTAFyBi4jLACm86VRUSwpbitwo6ProPAkieNR
- bcJISRJhHxYJv3s9xNc49WJoze+yy5QBqICVDya+gOJrX63lqArNkyoMM3733d8Ab0GITectAnF9PIov
- afBeHV7sp6bA9NkEGAdCBjj3UY1XVs82frpfttJ/A14ZQAXENr9HcNeWp2F99SvYqF2GlYVKlWHGNTAW
- VN63Lz0Fu396ErZ/dC+do0JOgZFZQUwKzBBrSsx1TIjDADO+pMAdAZgBsqkcwpsBloc3p6AcqW1A2BRX
- KTI9IwLewuqFz1UKbCpv9h3nTrfb7IMKiHJ+GV4D4pj7ZdCTChwLsa6+Nqd1BR4NXhfEDSl0PdAF4JUZ
- RAZ5VADE+gX774CXA3DO73AcEFb495T4+AmVjb/Pwfq1Q7DxDwak81Ce3glPH30Yxn8bgY//fBmemNoO
- lSOVCeV7UoF1iE0lzqDlNFqmYpROUlGbWBmqTSiwT315skN1bI7CAGeQSxVrgFdcZ4dpWHNiH20O1xCt
- 1TpcZQKcyuc03uXMnjSwdQXmIF2HN2o9ywpEjp6H13u/ob5UNwZiHV6eL02Jc8uvIgrM9nOuxRDHAKyW
- DYX6r+ZSNieVl+AV563jRgBvHGwotT8SuHFhF1w4uRN2vLcNygtD8Mr8EDy7f3BJY0KtkTQ4MZ3OlFit
- iTXlJWNmFq/e4kH2A9wdBXZFdB3gulrm02YVwWmtyc6mH0MKrAcYzAIYYJo0oVysWpoDWQKIc62rVMO9
- BuZsgI+8YUJ9SJIrau3La2DpVFoQ892vKS5nEdQfH5CkQBJaHppogM3nmlA7MiSaOwSEj/gZ/9ScyjHU
- 9qvxewzATfdftE3AavDyuJh9IIBvCfVd+4BKbWUsA7e2fklU/wuq6RG4f2wLDI7vEECXZzOfyyBUabRN
- iTMHQHBnZmi9PLNw9XYcwDJlwb9OptCxALvqMbC2zamYNbAJMTkIT14A4oi1bqY+emBx9UU/3wAxOhVC
- HfmaDevpTswBKXS/UmE0JQpeX19CbamA5VwDM7z6MQZg9u+i/c9S6Ah4sQoBnH4IN848j+tfAe+EWA8f
- E5dWMATJsvw+pOlnkF48AOvXtV1o3fFyqbJaE3NHGVyEF4s4n0uhdRXGe+qbWHl4O7GJ5Zv8GAWOASFm
- Fzo3lnmKckpsOmTEWjcN2chZhJ6K5+yR0DrhDd2vVDeovuz0ckOvdXhD/cbrnLLaVJgV2IQwFmAdYs6o
- QgGFbVKbVrRP4bsHAd5YehNWz+8Tt+KPxb5oLMtjAOvfwq+nX8z5Qu4lOEVrXYk1xWVwMXVmFcg5iFgH
- M8Q6wKi6rLwI72YAjBBjIbsdO4ExjhJTJ2uDK2uK50o9YxQ4pu2QipnzVuSZRZRfqW/LyhtrX0iBdYg1
- CIMpdD4Gy2AUA2996rOlhDcAI8A3Tz4Ht38/Y10L0/r4l7egtrofd6vLObvMQcoglhtVpLaUMlvAbeig
- 2szC+2zghgDmaGcOUtGBs028Akuu/wqkkLFOlNmOAcICb12ZXL8cau19b4ydRZzPNYahdroNL6sdv0Iy
- 18G2tTD6J0Md6o/p40Xq++Zcfw6/MoLaj0JlD9jLxQqsHB+q4jtjL8CZIyqAca0bCxDVw3e8MSVyDVZ0
- wDzw4oZOx+DldjMFLtiWrnDm53aMQbeeEesr7bQnRoFFexm0DDuC3E47mn0WArwy/4bYyPoS4LpIo1Wp
- Xa7A2tkRSI8NwvLhB2D17NhEg+C6Gi2SMjUosUo1fE7ZqhoUHSyyJUnmutFuN9sqOg53Yv2Qn/V6cESA
- q1cOQ+3n12Dtu2cg/foRuPDp3bA03V+9fHxkVmxqVWy/ziKxvRMn1BOUon551Y4xEU7TtbbaYe//zwj/
- Iq9TYyRARVijgDVt+A+t1PRPsQlSHgAAAABJRU5ErkJggg==
-</value>
- </data>
- <data name="ErrorExplosion.Bitmap" type="System.Drawing.Bitmap, System.Drawing, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>
- iVBORw0KGgoAAAANSUhEUgAAAEEAAABACAIAAADKyY23AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAJtZJREFUaEPdendb
- Wtu37vk4999zz/M7u6UYNYm9K2JDVBSlWrCBvWADBBt2RVERBXvvvfeeWGKMJaYnJjGarPsuYe9zznM/
- wb37Gc/akyWa8c456jvmv/3b/x//+VOe+jia+DiYedqaeFj9RXn6u6fVnwHOj0J9bIVMipjvk87zTuN6
- JXM84liUWKaLIMAh3M8ulm4bF+CQGOScxHRJCHSIZ9gnBNknMh1S2S7pXDcxj4KnYYE3ScGOqUyHtGDH
- lGCnxED7WLq1gGYR4WMJ4dPsOV42IVTLIIpFoJsl3fmJj8NjDztTBtU6yNM20MOG7vrUy8HU29EMa66f
- C4fyMMLnSbSfFSQ2wMZ4BFSr32zv/S+oDgA0e5MAZzMm5THHwzKUZh1JtzNomRjiGs90jgmwD/exZFHN
- mG4mXE/bCLqzkEmNC/EUBbuLQtwSue6pYV7ZAp+8uEBlMqsoKQRSnMIuSGDKYvwyeNSMMM+MMO9kjrso
- yCWa4RLP8kjh0+KMf9aa4/mU5WHB8rAKuRMm5WmQ25NA18fQB8JwMccb/DSQYh7s8TTE0wJPiBGDl/Uf
- NLs/3Sz+olo/8HV4FODyGN8OoT5luZPCpz4N97KKpNkKfG3DvK1Y1MeBro8CnB8yKfZ8mmtMsJeI7S1k
- ecZxPdMi6TlxgeVprEZFdHtpUosyXpsXUyeNKElmSiO9MsN9IKk8r/hgt0h/J4gwxCM5lJ7Op6ZyKUls
- SnywSxTDkettzXAxpdnd43paYR/ZVAsIFvhoEBwO08sOgoPyc7MwYvC0/svPydTT3szdxoRieQ9gcCA+
- dg/9nUxJ9M6mLLfHnDs8ga7Ykkd+zib+Lo84FKsoOs6HtDFokMqnyIS+xWkho1Vxy7rs3Z6Cne787a48
- PNfbZHOa9O6yJJ0iVpXOVcYH5cX45UbRJREkqqwI7/gQJy7VnG7/B832D3+nB2xPSz7djudlzfe2gdIh
- lCcMp0f+Dg8DHE2wCKZYsj1seN72HE9bhvNjIwZvBxMHs/9wszGFAAZs0dveFO6BM4Fp+VjfowOPwyO6
- gwnN/qGvg4mfq3kg1ULoY5fGdJOGecvCPSVhFHmke3mKX4OUdb1UQ2w3ETvNP5Zrvy1U/1yrJzY0WL+d
- 1TzrUU7XpvcpRZ15UU2S0MrEgDwBVRhkHx1gE063hkT420cFukQHu0ES2J5JXG88BX6OTFdzut19wAh2
- e+xn8Vuw/YNQypMIHI6LmRGDn5MZ7CeYahngYg4VSS2dTCHetvepln/4Opu5W//lZvmHh+09YMB7ro+d
- iO0l5npIBbSy5GB1Drc2K1gjC5ltTrtcURNvh4izXuKk+/ZZy7e1BmJLR+y23S43/Npo/LFS93pEud2S
- udIsXmrO6i0TVaYGJUb4RDMd0/iuXNffFFFURaxPAsspiUdRiBjyOEYa3xNHEeBkznC1oDtbUG3M/OEe
- Lvj4ONDtSRDlb3/Afvs7m3O8beFJ+AG+AcFX6Y44B3LjYTmwUUiw+xM4enSgEzw4g+OeG0krTQrU5oaN
- 16UeTZTfHHQRb8Z+nfbcvuggjruIo44fuzpiv53Y7/i+SoL5ulB72CNfrE+erU9eas4ZrU3V5Qly4kKS
- eNS8OEZ2qFuDNLxeJihICpYnBKcgoPE8YoKcsfd0e3jpU2DwtCV1MwhgQIznANMHDMMr/Aw7Db0BAGtA
- 8rT8V5DrI5bbI3+7P0Jc7sczHbLCPBA0JaFURZRXaRy9Scbb6FLcHnYTl2PEq15of/285eag7faw/eZ5
- CwnmVe+PZ/rPC+o3U5WHA4VbHfKtzvzVtryByoS6TJY4wh+hAm6dyfcoEAXmRNLjmK4I63xP7JclgpWf
- 40Oa3QPssj/Cri15CIYtNhzI33HJ5j5geFj9CePBxkN87B4AA6yL7+sQ7W+XGY6o4hnHsBZznBplYcPV
- aX3lCX2l8X2loqGq+BV9zruFOuKknzju+bbRSLzsudnTQ2kg+fZcD6Mi3gzhcIjn3ecTVVPq5PZ8QUdR
- zFB1ykhNykB5vCw6MNTDIsrXLplFTWC6CXztEYV8bR/4O97H3uHw6Q4PfO0fwpwCnJ7Q7c0QV/ASoQXP
- ILf/CwNUN3gCzgEQYV0Chmt6mAfCfFkqOz+WVpMWPKHO2O0p3u7I3+3O3+nKOxoq/rzS+OtZ+88d3ffV
- uq/LtcTztputpp97LcSLzh/7rT+PO4nzvptXXT+22rY6Fc25Ycp4/4rU4CZ5RE9x7FA5XIKHFMmjmgsD
- XRGLOB7WoT72wW5PobpBUYRH5AckikDnxwHIdK6PDMKkmLE9//YHgy0ZABiOyeDWTHcLuC/X6wnSUEaY
- hzzKpyo5sCMvYrhMNFIWu9mWtdchuRgvu91s+rml/TJX9Wm2/Ha9/tsKKcRBB3E2SBx2fN9t/rrb/GlT
- 82mleUmfC4svTeNUZYXV5YQ2ZrObs5kdhbHFcQyu+yOet6Wv/X1EP+wuwuh/OS581+0J0/VJEBKXkznT
- zTSYYoY0xfWyCKfbGm0JABCaYDzQ/h+XAAasYU5IOmG+Nslct+KkoPocXrOU150fMVYhOhlUvJ0qxd4T
- O03ElpaMoesaYrfpy2Lt1ZKaeN5OHPd+X9e8m638MF/9fkH1a79vrlkmF/rHsVzFAlqlmNNfFreiy1xs
- yh5WpcYxbRFbETwCXBE8TAKc7jHcnwZQnsAhkXDvAJgF30mIuynbwxw7G+ZrFRlgZ8RAdzSFx0BjhCoo
- DTFke7aXDc4hJpga4e+I0FGTHd5WJGrPjxqtiIdffpyv+LWpIba1d3mg8teaGvJ9ofJ6TXO9XE9s6xGI
- 3o6XnvQp3k2UISLt9SqxBdEB1qG+NuIo34a86IVm6dl4JWLUlCYzIciaR7NguD1iUqHJg0CXewHuFv5u
- T0it7g4BqZbMti7myIZwd5Q8kXQb1D5GDOSXKE95KD9cHmHLMyL9IKjqYG0Chl1qhGc8hxrP8pLHsGsz
- IzXS0CFV7PFUIbHZeLNSdzVffbVU82NTe7ur/77d9Gm14Wat9nq97sNy3YvR0qWWnOm6lNn61KXG9JZ8
- kTozNNLDtDyBsdlVPFARO9OQ8POg5dNc3WarPJvj6mH277D4YKoV6gAuzQqlUbC7hUE3VIQQuIQfjMXJ
- BNEWKTyW4ZQQQjFiwM/wVRwWMjm8SsSixjBdgt3Nkfbx5PqYR/jZwOFS2F6ZXM9cgXtvueDTVj0w/Fxr
- +LqgAoybDQ3xTI+g9Hq6/NNC5eVMxW6vYqQmqas4prsktksZ2SJjN0oj2wrjYfodhfGrHYVDVaKlVjEw
- IHu8X2xokoaFe1uggIUteNv9FeRuZgCAYgfqAQY+4ok1Uh4AhPvaxwQ4wlH/J4Y7xECPcgUuT1Z18DOa
- RVTAk8QQpxSOexrbPZXplMm2a8vnXi6pcAi3q/XfF2vgzbfIx89a4Bsnw3nTdXEzDUmDVfGtypjOsviB
- mrR2pbA6NVCVwVNnhylFAbUZ/C6lqL9ceDReSlwOE2fdSCODNclJLBf4HhwA0QVeYcBg2F8cAtvT2iAA
- EEazAwDUjtDKiAFYIUGuJFb8AoKan8M9nvfTRCSyGHpJin9JcmBJYlBlCqsug4us1Fsa9Xy4CLZ+NV8D
- Q/8wVYGjQClxtVB11CdpyQ3RStmqzJDytOByMQ9eVJXOKY73rxSzpBGeYo5LYayfSszGER2OVxAnA8SJ
- 7nK5qrkgNJyGXTfFOZA+4P4YJSYqVsOuQ2mDIPdxqXAGa1TvaTwPVI1GDIYCHWEYv4aABY+JDbDNjfap
- zeHrC2J7KoQ9pcJOZexARfJ0Q/Z4bdpMY8b+QPHxgPLtdM3H+bo3E1Vvpyo/zaveTJYc9kgW9dl95XGV
- 6UxxKDXKn+x1kNSxBdWZnOxwanFCoC4/TiuL0uaGTzakn8zUEK97dkcLCuK9/Bx+hxUhorC8LEkbpj4J
- 9YLjklsO08czys8eH/GMZTgkBLuIue7/hcHgN/gFUaBjdpgX/hk47kBlEnRd1EvW2yWbHfLVFsmyTrKg
- zRmtShqrTt5oz9/qUD7rLT8arDwaLD8ZKTsdL381rDzsVZyMV210F/WrUlVZYZIo35xImiojtKcstUzM
- zBPSmguEPRXi2qxQnEyTPHxnqJS4GJptlaTyXX3tUfA/QFJCJxREMUGMiaCRjgubge/iaZBsgS8aqTS2
- WyrLNYtPNZ5DGN1REOAii/QtEJLG2leagJi93Zl72Jt/PFBwMFB4NKTc7Zavt+bMN4p7lTEt0rD+4nid
- QtSQE6GVhPeUxM9osoBwuTlruTljqSlzuVU2XCtukAqqMvjNeaKukmT4sSSamiv0aS6Ia8iNLooLVETT
- ShL8xhrEe6MqtSQUgRLNgJ8TBF0kUtijSF/r2AB77DfpijwP6C2J8suNZShEQfJov5xw75wwTxSdRgzx
- HG/0U3VZYbXpbJT1I5WJa7qsZx2S457cs8G83S7pdkfOqi59rSVro00yVp3YlMXViNnxDEeemwnP9UEm
- x7Uug92qEHTkhXUVRHTKOb1KQVUKI9rbNNLLLC+KVhBFE3mZxTEtc6I8NHlCeEh5Gqc0iZkWYotiu14S
- IWQ4oD9huFj5Oj31tn0Q5GYa5msBozAASOd7ZkXQoH1xCrcqSwD7wXYrYvzRS5WnsP/GwHZHQigU0Yvi
- /CrTQrTyyNYiETyhpVDYUZKgzxNiv6vFfJiEOieyMjNMLgxM5VIRQ+D9iNaIxYokXm4CJzmUFsN0Q7yD
- JLGpqM/ZHk9SQ31RsYfR7TP47rnRvspEZnFSMBZwEnAIogCbaJZniLcN2bc4PoBPo5RArYoiIi7IIYXj
- JouhA3BNdmi1mKuM85NFUOUx9ML4wIp0LqKcRiIwYogMcBAGu6ZxnFPZTmKeqyzKWxHrC5+Wx9AK4vyz
- Qz1SQ5xF/rYx/jbYMPgW39OC6WyChhtdL4TjZYXmC1pCVxSV8EW+pxXKT4SRQGfTRI4Pyji+t52Abhnp
- ZwUJpz3lepiyKA851Ec8T7PwQFeWpzWqI5RJ+JsGALFMJ4TaZLYroOZEeOXH0ksSGWVJgaWJDABAAVqX
- E66VRzcroowYBP62UQz7eKajkGEHwSIh2AnPxBBn7AS2HIwG7BURDaGNjG7etneh2hLbhuLeUAz72P7l
- bfMnWSfbPvCzN0F1EOhsTrO5D+IDdShZ8LghgpuiqsPX7liIeyhL8RKBCPGUDKYeFmRU9LFCtZ8Q4prO
- dwevA5GEexSK/KvTWRppeLNCoMriA0BjrgAAUPwaMaCjh4AyMSxSuFSDoI1CK4iWH9EgKsAZ+wrtIRxv
- O66PPWwJ2wYlQOQYlAMA4KHZPvK1M0XV4Gv70Mf6flwQFRJgZ0J3MfN1NqU5PcITHbm/22MIFgw3M/wd
- Ps02ws8OAgCgCEB2ZIZSDSdQnhJSl82Huq15UW350U1QXUGGZnQyTbJQIwZxqAcE6orDvDPCffBMD/XC
- R8AAJMQ1NFbAgPQOAGQZQyUF2wbtoTSeBhjwDZL1IGPLY2RMYAh0ME0P9S2I57JdAcCMhs7E2cwP3SIF
- NelTLPARfwd2CGMGAQd6JpHtAmUQlGHS2P6KVBYAkOpKw7RSvjaHR67l4Whi2wrQS/1tSzg1tAfgtqTR
- dAjIEvwV7ATMURRoj7AAc0pkwVldQWyBZQj1dbgj50gYJA3lYQG7gjMAACzE9y4+IufQbP6CbxQkhHSW
- pcN9ses4ChCK3g4PITgNlNZB4Ca8LOCQAAD7SWA549/NiYQr0pFD1Nn8BklYg4SvyeZB+yYJXyfDR56+
- IAJpdEydMtWQbjwHWRRNEesH91UmBhbGB2ADciI8wGrhCRfP5LmnsVwSgxyBB/EOSQeZEnxZqK8d9g+C
- Bc/HBjBgVzgKbycTKIqCx8vmX2E+TyqzeAsdSkm4O07M4DlwIUOPhl/Br995sAv2CADQVUuiaPBahC9d
- XjSENHopaTOI3b0lQmRYFA1D1QlTGjEKgrVWqRFDaQqrUswjHT85qDghQBHtLY/yQqhF01gg9FVE+qD9
- T2e7IjohO6bx3HEsyWwK9EZfEclwDvdzgG8YzgSn4eP80Mfxgb/LfQ+rfw+nmSN/bQ9VyaOpdPu/GM4P
- 0YJBAl1MEENxAnAAnEBKqCdsGEwmTAjK1OZEqCXhMCEcAiynWRYOAD3FosnaNBQKC3rJYot0iZSctbYc
- IwZdbkRHQUxNNg8F0j+CjxBVFhf0UVkKA6jAnWSHukOQ4cUct3SWGw4H7C8SqsDHBtwEuEAEU2xzkKu1
- l+VjtqttiMMf1cn+u215md7mHPfHiMiBjg/QpbDczDhu5tF0eyRgxECYbr4owBDy0axqcwVN8sgWeQSM
- R5vDaVWED1SIJutTZrXiuaaM5z2FkGfdBbudeRAjBnV6sCaL05QnMIhWEdEoD9fkhtVL+QZRZXDKU5io
- 2yCFIoZM4AMDA0EGNgVcMpIGrAu1DWpMVI0Myj3UPEFuNp4WfwgDHg/XiN7M1kyUCsHVASFaFDQqbIo5
- MMPBMkJJyylNCkEKQ6GA6KmXk8Gns0iIqgyWg6JhXJU0p8lAwYaybbtbvtch2+9WvOgvfDmofDVcYsTQ
- mS9AFQSqyyDw+v8uSNiIZSR7JYmol0SqsyPARJQkhCDho0CEBSN7wEkE/vYRdAcIw/0/ve1+QytLs/+9
- sybh12kf8WpgpyOXZKvATYDFcnqEjh6/gugnjfavEfPqMvgNWfzGrFBUOu1yAcjM4fKkFa10tVmyppOu
- 6yWbrbLdTvlBX+HxcPFZf/6bkeJPU5Xf5muvF+uMGHqLIvqLI3tLYyB9ZbHoTgYr44arE0ZUiaM1Se0l
- Il1BlEYWASYCMDSy6MbcGAjKUpR0JGcTHwRVEJFTuJ4JHCrf77Gv4z2OtwNaSl15ws5Y6U5fYU6wdeBd
- m353ROZIZEg+oPhLklgtckFbXlR3QQxUHylPmKlJX2nK2WpTbOmle+2Kg+7Cg578/e68o76Cs9Gyt9NV
- VzMV12AYVu8oiHWNEcOCJgWCqhMl50KjeK4hbaYuBTKtTsYTrGinMrolTwBqCCGiWSbQ5UZCkHSQaOpz
- QqvSWYhmIP9EgXYC2lPQDUGulnxvSqCLFaKNMoG+3FoUh2YdGDzh9485no8R4hD9UJvBcfVSXrsivK84
- FlTDTG3ysjZzu1XyvEvxrFN+1Fd4OlIG1c9GS15PlH9cUF2DtF2uvVlR366ii6zD2ojher0JJAq6mXcz
- Nedj5ccDRTC43XbpVkv2ph7AxMAGWWzMmq1Ln6hOGUaHWSxsk/Nbc3m6XK5Oxm+U8FCoyiOpYrY9qhUe
- xZrr5iTwIXtFgPy8PlAtYoPVCnJ9iAIpKdheHu2B72slrM78cJz8iCoe5P5KS9Zmu3S3K/dZj+J5r/zF
- kBI9yeVM1ds51du5KrA7V+t1N7tNP3YaDXK9rfm2WW/EgI7+GuzQ806SoN4EXdd4tVT/ZbEODCnkcqIU
- bdq76aq3k9WvxypOBoqPegr2O/KfdUp32iRb7ZK9LsXBQNFeT8FiU+ZYdXy9hJ0f7ZcSRE0NoZYmB8zp
- Ml9P19cnM9HTRfpZopXDAY7V4oSTljWpu+05r2ZVl8sNnzf13/bafuy1Xu+2XO80Qz6uNnzZ0H7d1n7b
- abraavi6rbne097u64iTTuIVONwuLH697DBiOBtSvOyTng7kG+RssAAMO0ihz7PV6JhBXkDAAHxfUH+d
- q/k6BxKp/mYZvFjT9bIaLShIse9r2i9LmpPR0u0O6bwueViViPhYEOutU4RcLFZ8XKqFQSvi/PJFvvrC
- 6P2Rqu9brd9WG0k6cFd/9bzjx4se4nSIeD1MXIAi6CeJ55MukiY8H7iT3juNO0h51Um87ifeDJITAjxf
- 9xsxLGrT5jUpK82SJW32fEMGZEFDWg6ec/VieMiiNgPesqrP2WzPBcf6rLdwv195PlIOY4W8Gq08n1Cd
- T6rPJmpPx9XzbfkzenmDlKMQOC/pMt7Mq8C9Xm83aguFWTynvuJooL3Z0P5Yb7rdgU6gynuIsz5wsr/O
- e39d9P287L+57Lu+6Lk9I+Xnea9BsL457f7xquv2dd9/FyOG7U7ZVod0s02x3pK7qpNC1vQygwAY1IXS
- UH29VQokgATOi/T4mgQwlgPKyL6iqMESsL/xg2VxvSVxqIozeS4JAU/0irDXs3XEYS/xohfW3FstBobm
- HNbLkRKcG2hw4nkPsd9HksrgxjF2uegnLgfu9njw15sBAwCgIl9i198NE+9HiA+jeEO+xGnciRHDXo9i
- pysXBg1FQUJis7c7FQbBRzDbh4PK5334KX4kXb3z8kVtOjDDxbGvbfIw5FS9Ar11aH0mB7QFcnl+jA/Y
- 1f2B8pOxSuKo72anbbW3slDoU5lIH6kQLjamHvQXvBwufTla9m5V/XGj4esz3c1R+89XJBjyQLD3wICj
- OO0mOfOTzn/kH+3/B4at9uz1lgwkke122WYrEooEC2QlPLfapFgYBF+A/PMRvAESSGdhFCIvSN/pJtms
- Tj7TnNskF6nEYWBfekoSx6vTQDB/WdHdbLf3V6fLIt01Ody5piwcKfbldKwCE4nrPR2GFT+PwJP3ExeD
- Rn9AZnw3QrwdJi4HyfM57yMPCk9y0Uec9v4jxnM46svb75Eie4PIQFQ96MnDAh+RVrDA07DA++ddZKon
- w1FL9nqbHOGlRcGvFQdVpwaUJvqhwYe15Ap8M7lUMcs5T+C501XSJuOdjlW9mamdbJICA7iMjmIhGG/M
- 444GlChD3i2qIJ8Q7Hd15AhvS/t1XfN9U4uTwQjm+37Lj8O2v+0NGPp/HbZDfh60QW73W40YPi/Vflqs
- uVqp+4I4s1gDweLraj2EfIk4u1T/ebHu43zte8TByYrzsdLTkeJnvfmgORa0GSBssLXTjRnDqmSwqxWp
- nJwwary/RU0689tWNyqA88nKn3sdW/0VmXxcErAmmYfUoNa80LEq4ao2fUGbuKBJ2GgVHw8XXE6VvZks
- ezddAfb/3XLN+5XaD6vqT+v1nzca/pFrxMM7AU4wvEYMhiEIsddK7Oh/bjX/2sYks4V41ka+2WtFukAM
- udloRuqAYI0331Y0SD1IQBdTFacTFfAZUGnjqoQuZQSoENRXOJbNHuWX9ZbZ+qTvm80ImmP1WQkMK/Qk
- cO6JRtk04l5jGqYw+325e92S48G8j3PVIP2/LapvVzTETitx1Em86DLKYQeOCLz61YbmdrsZglETBHy7
- EcO3FTVynGESBSIeT6zxxiBvJiuQ4N7PVH+cq4FggZR3OVGOb2J0S/7F3dav69qzyUoEt7mGlIq0IJS9
- 1eLA92stp1NVL0aKMKf7sqa+WGrBCKtMzO6uzsQtgp7SuN1uBXHQTRx2QhsUEeQOrms/T1d9nCj/NleD
- GRIJ4ATJoY98vuj6td+GSR+5uYb9xUbv6I0Yfqw03Kxq3s5UXEyUYLRDyoTy25KK2Gz4vlh1PFL6YrgE
- mRihCfaDJ9bY+F8nrcRF94+TtptXHYh91wft4OvHqmL1abwuSdRYecrrqaaLae1uX+nX7R7ieOzrRm+f
- Mq42OWhWnd2eGzFUHL+uk7+d0V6/6LzC0Oh06MNK46elxvPRqvcTtTvNktfjZcieN6jtNhuJZzpio+7n
- YjmxXPlloeHdlOrrCrJq44vBYiOG8yHlxXDx+wVkqNKT0eKT4YL9LsmLPtnlaNH5cN7rGdV+f8FGWw7o
- SpgNPoK9XNFlnM6V3B63Eu8Rtod+HHecTJevt2ZvtGaPlgvn61Owx9e7bV93Wy+XaonzQeLNMPFx/sNa
- E/j6i1nVaHXskk58Oa8iXvbdvmonzruQBFBNvJ6tOBtTvhoqWqxLmKyMRjnzFXaF6mNNAxv7iUJ1rwVm
- /HWh7vtSw5e5WmhuxHA5Xgnu+nm/Ek3G/mDR+VT1yVgZCod3oOZXNJjonE2Vn4yXYIERG3E2dL2jx5tP
- 6+rbo1ZDiv2+33Y4pgROhK/LhQpMWG6PWogPw8Rp+5d9DXHZ+eus9eaF7vZYjzc/X7YdTOR92FITb/qJ
- T6PXx03EOySynq97jYcj8vPpkhfDisUG0UZLzlaH7Hyq5mxShTg+2yDe6CyETKkSEf1fDha/n66BBf0d
- WwdKjgZKdHmRzYqICU324ZjqxVjNwUjF+XTd+yXtbm/u8VjxB9Q2h13ExQg5SD8bwv4Rr8eJ12NknXM+
- TLzsf7/W+G4B49A+xMRbVDuI7h9Gfp1B+07iI86hh9T43SDxEX+h/2q/mXjdCwv8cqBHFiM+TyMtfNrS
- rXVKLmZrMARbQ9fWVdRZGNOQzSlJCEhg2OASFC4QgTeI9rXAHKMihYkOGzM+IwZMnSFJLGfcAcCdA1zY
- QcdTLWZjBIgas6UwdFiduN6bfzhZ9XK29nim5mROfbpQv4w2pbd4a6hsY0AJ8h1cA64vfFrSvd/s+Ljd
- cXs8/PV595u1ZpR0P08Gfh33Xz/v+Lyle7/e9GJa9Wy0bGuoZK2/eKI5e3dE9WKmca27ZEIjRTs6osoa
- rMhsy4uvyeTHYwBJfcRyfeBt8R/gEEA+kANoN4sgT2vMWfg067z4YCOGYNf7IW5gm83BDqHK5/tYhLia
- BDr9yaGY8D3MmM6/syn3wn3MhIHWiSwHiCjIJtrfIoFhh9thmMniozDQMtL7ocjHVMZ3QZUhj/RUZ3Ea
- srjYxcGKJDD7a62KjVb5XnfR0XDVbKOkuzgOjEkWn4J7ZylM59Rglzg/W4HHU6btvRgf2zi6c5ibBeYP
- Afb3oDqmQeByMKlCF0VicLfxdn5Ksb7vYXv/v+5rUKz+pNrc87J/6GrxO67I4DqT6+N/eVj+5ud439eO
- vBR3d9vgPggLsEPgiEAiAS3b9XGIqzluHPnY/YZpMUkJ+zyJo1tL+S4ZIXb1GSwQKv0lQqh+0Ffybq4R
- de7VsvZ6s31NLwewYiENlE9SkF2cv5XA01TkZ41fj/R+Gu7xBOJv9Z8g8e9ukZADdsyo/Owf4O4PBASP
- n8OfGLWBFAQLbDwHiu0jDwdzPCnWDz3tH3nZPQIkw4zdy/ovXGTCHTs/l6c0R3P8CII108PW3948nO4q
- YLjxcSOMTZUIg9Sy2CG1/Hxes91b9Hqh4dVENcrEvW75SmPas3bZmzElhndoiEfKotG1LepkB+Pq/TH1
- Rn/ZZJNkuUc5pc+d1udp8qNAq6WHuvED3Hn+FAbFCjDC/TDGBf9Lcgj5AvfccFfUlyPqjM6SBCMGHxsT
- L5uHPjamXlYmEG8bc7qDBd3J2tfRytvBAuSpr4OZj80DUKhhNAfcKQuwf8ClWijCKa2KyMm6zNkGctaP
- mvftfANxMnL1DM824iU6ssZPKzVnY4XH/YqLsWKkmouhvPOBgrejZa+Hit+Pl+G21o9l1a9l9fVsNUiK
- n+vNF+OVo+VxdWmBlfE03C2CpIS4CQOcoujOMYHuKaH+2UJuuZiPKUx9dnizNBRlvxED3dEc4mX7p6fN
- H7if6GH9O+h1GBJ8A7M9WCRoCAibYhrsfA9OAjJ0pCEXO/3jedfNfjfyABmmLoZQHZD97mbD11X1XbJv
- QK9DbLVAoB9Kr522bJSP31dbPi9oLyerUIOhJHs7WrKuSSG73KGS0/GayzntVH3WWoeyrTilQRaTL2SA
- IGXj/oAzOaGL9ncANQgrwpgPlIouX2jEAPPA5Teq7X/4uvzJ8jbl+ZpxvB6EUH4Lcv7fTMd/D3L6VyzD
- Qh7rWZ8b2lOZOKBKmm7OOZioeb9WRyAsotA/0BNIFIe6z+uqN3MlP5e1H8YqPk3VXM3WvRmtvJrD7auu
- 78v687na9gLQpuHzTbKR6lSUrls9+Rfz6heDpego0BspYzxwp6VdGacvEHVVpNblRtfLY3AlCzc70MSC
- ZUxj26WE2ICQB7EpifYvTGKrJNFGDDA4prulkEfNFjEqZZEtZUm9tWnj2szF9tyt3qL98Yrj2erTRfXV
- LoqLUeKk7+uuHs07GhfcULraafq4VocCEykW6enzKu5ukO77fqru1VD5SHkciDokJty42hoorUoLwjwK
- AVQu8M6L9h6oTtnsL9kfUW33lWXzEZ1sUkNwSda2XhEljfZVxPlW5/B6qpNn9LlLrbKZxvTBSmGPMkwn
- D6/JYKFZx2UqUCRGDORIxtEEswWwdJhdp3MouObTmBOGafR+f+X5ourXyy7i4wTZCr7s/LhW82GlGrv+
- crJ6vjmzLZ+PUeJgmbBTEdYhD51SJU/UJLblh3UqI0FwJIdYJAZbKuK9MRStzWbnRlGV8Qwwk8kYMgXa
- Fif61WSxypL8kVvj/Z+IuQ6SCLc0lkO9LDyD75IQ9DgnwqlaHNBTFjXfLEYxhvIR1dDZSNGL/vy1JvFg
- aaReyjJiYDr9hetDvpa/MWx+Z9r+Hmz7G9fhd6GnaS7XuUJEb1Ywtvql1zAYNLKHLRdzpS/HFe+XK8bV
- KXo5ryzOB/6nTgmqFPlq0ljTqoxxTaq+KFybx9PIeRVihlrK1RZFVmWzO4oEg1WJ0xrJiCoDFBsCCyYg
- PaUx4BTBL07Wp+FK2mxT1uFY1d5g6f5IxdV2+9V267ft1qtN/Ze1po/LGtQ+b2ar340rP89Wfl6oxq2i
- s4kyIwY0JdXpwVopFx0Myvr1rsK9/rLD0cpX0+qLec3H3WaSM70YIEsjNOMnnSTJ87LjbK7qLe5JLqpR
- YCOMHo+UX0zV/drr+7zZejFffzyBl6SDflpu/bDY+npa+2ZBffu86/t215v5prcLzZdzmjcLdYgHn1Ya
- UVPiNh2u+kEn4qAL1Sex34ko/AFU0Ir2eqsFrez1dtuXteYPSxpUnMcjJa/GK15NVp7PqIwY2gujR6qT
- DwZzT6eL0TThAhsqfrJqPwPhM3r7Cm3uCCigqz399UEredPwsIX05rM24l3vzxf6T+u113tNYLWOR5XL
- TamrzSTZuKHNXq1LX6/LXKlOWypL2VBlztaJnvXkYvK91Jhx0KdEpz7fkHjQL389WYpK+aBX9moo73Ki
- +HKs8HRQftSdfdIjP+yUbOkzlhpSxiuFIIVbZNzGTKauIBJmWRRPk0VS8oVef/eiG3BKFWgF3OkkTd9A
- +BgE3fdF76/nTV821J836r7ttdzg/iTqvMtx4qwHBvZxq/7det3pUtX+ZNH6QO5Kr+RwuBgMO6Ybu715
- 2Kqz6ernA4XL+kx0eSOVIngL7jDiFjLK5KPhstNJ1dmc6uVUxcFo8XafYkEvnqjHjCcJi66i2BlNDmSl
- NX+oMhkft7pLIM8HqxZ18pcT9UejtRhQGDH8v/6//wOxEBXYZyzgPgAAAABJRU5ErkJggg==
-</value>
- </data>
-</root> \ No newline at end of file
diff --git a/mcs/doctools/etc/gui/TextResources.resx b/mcs/doctools/etc/gui/TextResources.resx
deleted file mode 100644
index 29d380cc385..00000000000
--- a/mcs/doctools/etc/gui/TextResources.resx
+++ /dev/null
@@ -1,138 +0,0 @@
-ďťż<?xml version="1.0" encoding="utf-8" ?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 1.3
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">1.3</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1">this is my long string</data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- [base64 mime encoded serialized .NET Framework object]
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- [base64 mime encoded string representing a byte array form of the .NET Framework object]
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>1.3</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="Monodoc.Version">
- <value>0.0</value>
- </data>
- <data name="Form.About.Title">
- <value>About Monodoc</value>
- </data>
- <data name="Menu.File">
- <value>File</value>
- </data>
- <data name="Menu.File.Exit">
- <value>Exit</value>
- </data>
- <data name="Menu.Edit">
- <value>Edit</value>
- </data>
- <data name="Menu.Window">
- <value>Window</value>
- </data>
- <data name="Menu.Help">
- <value>Help</value>
- </data>
- <data name="Menu.Window.About">
- <value>About Monodoc...</value>
- </data>
- <data name="Menu.Window.Cascade">
- <value>Cascade</value>
- </data>
- <data name="Menu.Window.TileHorizontal">
- <value>Tile Horizontal</value>
- </data>
- <data name="Menu.Window.TileVertical">
- <value>TileVertical</value>
- </data>
- <data name="Form.Main.Title">
- <value>Monodoc</value>
- </data>
- <data name="Buttons.Close">
- <value>Close</value>
- </data>
-</root> \ No newline at end of file
diff --git a/mcs/doctools/etc/gui/readme.txt b/mcs/doctools/etc/gui/readme.txt
deleted file mode 100644
index 2b54b334365..00000000000
--- a/mcs/doctools/etc/gui/readme.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Monodoc GUI Graphical Resources
--------------------------------
-These are the original files for graphical resources that end up in
-ImageResources.resx.
-
-Filename --> Resource Name
-
-AboutMonodoc.png --> AboutMonodoc.Bitmap
-AssemblyBrowser.png --> AssemblyTree.Bitmap
-
-* TODO: Figure out a way to generate the .resx file programatically.
-
-
-Monodoc GUI Text Resources
---------------------------
-These files contain text used by the GUI, such as menu and button names,
-abstracted out for easy internationalization.
-
-TextResources.resx --> Standard (English) text resources.
-
diff --git a/mcs/doctools/etc/monodoc.dtd b/mcs/doctools/etc/monodoc.dtd
deleted file mode 100644
index fbdac7184ed..00000000000
--- a/mcs/doctools/etc/monodoc.dtd
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Root element -->
-<!ELEMENT monodoc (class | delegate | enum | interface | struct)*>
-<!ATTLIST monodoc
- language CDATA #REQUIRED
->
-
-<!-- Type-level tags -->
-<!ELEMENT class (summary, remarks?, (class | delegate | enum | interface | struct | constructor | event | field | method | operator | property)*, seealso*)>
-<!ATTLIST class
- name CDATA #REQUIRED
- assembly CDATA #IMPLIED
->
-
-<!ELEMENT delegate (summary, remarks?, param*, seealso*)>
-<!ATTLIST delegate
- name CDATA #REQUIRED
- assembly CDATA #IMPLIED
->
-<!ELEMENT enum (summary, remarks?, member+)>
-<!ATTLIST enum
- name CDATA #REQUIRED
- assembly CDATA #IMPLIED
->
-
-<!ELEMENT interface (summary, remarks?, seealso*)>
-<!ATTLIST interface
- name CDATA #REQUIRED
- assembly CDATA #IMPLIED
->
-
-<!ELEMENT struct (summary, remarks?, (class | delegate | enum | interface | struct | constructor | event | field | method | operator | property)*, seealso*)>
-<!ATTLIST struct
- name CDATA #REQUIRED
- assembly CDATA #IMPLIED
->
-
-<!-- Member-level tags -->
-<!ELEMENT constructor (summary, remarks?, param*, exception*, seealso*)>
-<!ATTLIST constructor
- name CDATA #REQUIRED
->
-
-<!ELEMENT event (summary, remarks?, data, seealso*)>
-<!ATTLIST event
- name CDATA #REQUIRED
->
-
-<!ELEMENT field (summary, remarks?, seealso*)>
-<!ATTLIST field
- name CDATA #REQUIRED
->
-
-<!ELEMENT method (summary, remarks?, param*, exception*, returns?, seealso*)>
-<!ATTLIST method
- name CDATA #REQUIRED
->
-
-<!ELEMENT operator (summary, remarks?, param*, exception*, returns?, seealso*)>
-<!ATTLIST operator
- name CDATA #REQUIRED
->
-
-<!ELEMENT property (summary, remarks?, value, exception*, seealso*)>
-<!ATTLIST property
- name CDATA #REQUIRED
->
-
-<!-- Member-info level tags -->
-<!ELEMENT data (#PCDATA | c | example | list | para | see)*>
-
-<!ELEMENT exception (#PCDATA | c | example | list | para | paramref | see)*>
-<!ATTLIST exception
- cref CDATA #REQUIRED
->
-
-<!ELEMENT member (#PCDATA | c | see)*>
-<!ATTLIST member
- name CDATA #REQUIRED
->
-
-<!ELEMENT param (#PCDATA | c | example | list | para | see)*>
-<!ATTLIST param
- name CDATA #REQUIRED
->
-
-<!ELEMENT remarks (#PCDATA | c | example | list | para | paramref | see)*>
-
-<!ELEMENT returns (#PCDATA | c | example | list | para | paramref | see)*>
-
-<!ELEMENT seealso EMPTY>
-<!ATTLIST seealso
- cref CDATA #REQUIRED
->
-
-<!ELEMENT summary (#PCDATA | c | example | list | para | paramref | see)*>
-
-<!ELEMENT value (#PCDATA | c | example | list | para | paramref | see)*>
-
-<!-- Formatting and presentation tags -->
-
-<!ELEMENT c (#PCDATA)>
-
-<!ELEMENT code (#PCDATA)>
-<!ATTLIST code
- lang CDATA #REQUIRED
->
-
-<!ELEMENT description (#PCDATA | c | see)*>
-
-<!ELEMENT example (#PCDATA | c | code | para | see)*>
-
-<!ELEMENT item (term?, description)>
-
-<!ELEMENT list (listheader?, item+)>
-<!ATTLIST list
- type (bullet | number | table) #REQUIRED
->
-
-<!ELEMENT listheader (term?, description)>
-
-<!ELEMENT para (#PCDATA | c | example | list | paramref | see)*>
-
-<!ELEMENT paramref EMPTY>
-<!ATTLIST paramref
- name CDATA #REQUIRED
->
-
-<!ELEMENT see (#PCDATA)>
-<!ATTLIST see
- cref CDATA #REQUIRED
->
-
-<!ELEMENT term (#PCDATA)>
diff --git a/mcs/doctools/makefile b/mcs/doctools/makefile
deleted file mode 100755
index c7fe192bd46..00000000000
--- a/mcs/doctools/makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-docstub:
- NAnt docstub
-
-docval:
- NAnt docval
-
-gui:
- NAnt gui
-
-clean:
- rm -rf build
diff --git a/mcs/doctools/src/Console/docstub.cs b/mcs/doctools/src/Console/docstub.cs
deleted file mode 100644
index ca23f7675bb..00000000000
--- a/mcs/doctools/src/Console/docstub.cs
+++ /dev/null
@@ -1,693 +0,0 @@
-// docstub.cs
-//
-// Adam Treat (manyoso@yahoo.com)
-// (C) 2002 Adam Treat
-//
-// DocStub is based heavily upon the NDoc project
-// ndoc.sourceforge.net
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Diagnostics;
-using System.IO;
-using System.Reflection;
-using System.Xml;
-using System.Text;
-
-namespace Mono.Util {
-
- class DocStub {
-
- Assembly assembly;
- bool nested;
- string assembly_file, directory, language, classname, currentNamespace, docname;
-
- void Usage()
- {
- Console.Write (
- "docstub -l <lang> -d <directory> -a <assembly>\n\n" +
- " -d || --dir <directory> The directory to write the xml files to.\n" +
- " -a || --assembly <assembly> Specifies the target assembly to load and parse.\n" +
- " -l || --language <two-letter ISO code> Specifies the language encoding.\n\n");
- }
-
- public static void Main(string[] args)
- {
- DocStub stub = new DocStub(args);
- }
-
- public DocStub(string[] args)
- {
- assembly_file = null;
- directory = null;
- int argc = args.Length;
-
- for(int i = 0; i < argc; i++) {
-
- string arg = args[i];
-
- if(arg.StartsWith("-")) {
-
- switch(arg) {
-
- case "-d": case "--directory":
- if((i + 1) >= argc) {
- Usage();
- return;
- }
- directory = args[++i];
- continue;
-
- case "-a": case "--assembly":
- if((i + 1) >= argc) {
- Usage();
- return;
- }
- assembly_file = args[++i];
- continue;
- case "-l": case "--language":
- if((i + 1) >= argc) {
- Usage();
- return;
- }
- language = args[++i];
- continue;
-
- default:
- Usage();
- return;
- }
- }
- }
-
- if(assembly_file == null) {
- Usage();
- return;
- } else if(directory == null) {
- Usage();
- return;
- }
-
- if (!Directory.Exists(directory) && directory != null) {
- Directory.CreateDirectory(directory);
- }
-
- // Call the main driver to get some things done
- MakeXml();
- }
-
- // Builds an XmlDocument with the reflected metadata
- private void MakeXml()
- {
- try {
- assembly = LoadAssembly(Path.GetFullPath(assembly_file));
- }
- catch (Exception e) {
- Console.WriteLine(e.Message);
- }
- Write();
- }
-
- private void Write()
- {
- foreach(Module module in assembly.GetModules()) {
- WriteNamespaces(module);
- }
- }
-
- private void WriteNamespaces(Module module)
- {
- Type[] types = GetMyTypes(module);
- StringCollection namespaceNames = GetNamespaceNames(types);
- XmlTextWriter dummy = new XmlTextWriter("temp.xml", new UTF8Encoding());
-
- foreach (string namespaceName in namespaceNames) {
- currentNamespace = namespaceName;
- WriteClasses(dummy, types);
- WriteInterfaces(dummy, types);
- WriteStructures(dummy, types);
- WriteDelegates(dummy, types);
- WriteEnumerations(dummy, types);
- }
-
- dummy.Close();
- File.Delete("temp.xml");
- }
-
- private XmlTextWriter StartDocument()
- {
- if (!Directory.Exists(directory+"/"+currentNamespace) && directory != null) {
- Directory.CreateDirectory(directory+"/"+currentNamespace);
- }
-
- string filename = directory+"/"+currentNamespace+"/"+docname+".xml";
- XmlTextWriter writer = new XmlTextWriter (filename, new UTF8Encoding());
- writer.Formatting = Formatting.Indented;
- writer.Indentation=4;
- writer.WriteStartDocument();
- writer.WriteDocType("monodoc", null, "http://www.go-mono.org/monodoc.dtd", null);
- writer.WriteStartElement("monodoc");
- writer.WriteAttributeString("language",language);
- return writer;
- }
-
- private void EndDocument(XmlTextWriter writer)
- {
- writer.WriteEndElement();
- writer.WriteEndDocument();
- nested = false;
- writer.Close();
- }
-
- private bool IsDelegate(Type type)
- {
- return type.BaseType.FullName == "System.Delegate" ||
- type.BaseType.FullName == "System.MulticastDelegate";
- }
-
- private string GetTypeName(Type type)
- {
- return type.FullName.Replace('+', '.');
- }
-
- private StringCollection GetNamespaceNames(Type[] types)
- {
- StringCollection namespaceNames = new StringCollection();
- foreach (Type type in types) {
- if (!namespaceNames.Contains(type.Namespace)) {
- namespaceNames.Add(type.Namespace);
- }
- }
- return namespaceNames;
- }
-
- private bool IsAlsoAnEvent(Type type, string fullName)
- {
- bool isEvent = false;
-
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic |
- BindingFlags.DeclaredOnly;
-
- foreach (EventInfo eventInfo in type.GetEvents(bindingFlags)) {
-
- if (eventInfo.EventHandlerType.FullName == fullName) {
-
- isEvent = true;
- break;
- }
- }
-
- return isEvent;
- }
-
- private bool IsAlsoAnEvent(FieldInfo field)
- {
- return IsAlsoAnEvent(field.DeclaringType, field.FieldType.FullName);
- }
-
- private bool IsAlsoAnEvent(PropertyInfo property)
- {
- return IsAlsoAnEvent(property.DeclaringType, property.PropertyType.FullName);
- }
-
- // Loads an assembly.
- public static Assembly LoadAssembly(string filename)
- {
- if (!File.Exists(filename)) {
- throw new ApplicationException("can't find assembly " + filename);
- }
-
- FileStream fs = File.Open(filename, FileMode.Open, FileAccess.Read);
- byte[] buffer = new byte[fs.Length];
- fs.Read(buffer, 0, (int)fs.Length);
- fs.Close();
-
- return Assembly.Load(buffer);
- }
-
- private Type[] GetMyTypes(Module module)
- {
- int i = 0;
- Type[] temp = module.GetTypes();
- ArrayList list = new ArrayList();
- foreach (Type type in temp) {
- if (MustDocumentType(type)) {
- list.Add(type);
- }
- }
- Type[] types = new Type[list.Count];
- foreach (Type type in list) {
- types[i++] = type;
- }
- return types;
- }
-
- private bool MustDocumentType(Type type)
- {
- if (type != null) {
- return ((type.IsPublic ||
- type.IsNestedPublic) &&
- !type.FullName.Equals("Driver") &&
- !type.FullName.Equals("Profile"));
- } else {
- return false;
- }
- }
-
- private bool MustDocumentMethod(MethodBase method)
- {
- return (method.IsPublic);
- }
-
- private bool MustDocumentField(FieldInfo field)
- {
- return (field.IsPublic);
- }
-
- private string GetParameterTypes(ParameterInfo[] parameters)
- {
- if (parameters.Length != 0) {
- StringBuilder sb = new StringBuilder();
- sb.Append("(");
- foreach (ParameterInfo parameter in parameters) {
-
- sb.Append(GetTypeName(parameter.ParameterType) + ", ");
- }
- sb.Remove(sb.Length-2, 2);
- sb.Append(")");
- return sb.ToString();
- } else {
- return "";
- }
- }
-
- private void WriteClasses(XmlTextWriter writer, Type[] types)
- {
- foreach (Type type in types) {
- if (type.IsClass && !IsDelegate(type) && type.Namespace.Equals(currentNamespace)) {
- classname = type.FullName;
- docname = type.Name;
- if (!nested) {
-
- writer = StartDocument();
- WriteClass(writer, type);
- EndDocument(writer);
- } else {
- WriteClass(writer, type);
- }
- }
- }
- }
-
- private void WriteInterfaces(XmlTextWriter writer, Type[] types)
- {
- foreach (Type type in types) {
-
- if (type.IsInterface && type.Namespace.Equals(currentNamespace)) {
-
- classname = type.FullName;
- docname = type.Name;
- if (!nested) {
-
- writer = StartDocument();
- WriteInterface(writer, type);
- EndDocument(writer);
- } else {
- WriteInterface(writer, type);
- }
- }
- }
- }
-
- private void WriteStructures(XmlTextWriter writer, Type[] types)
- {
- foreach (Type type in types) {
-
- if (type.IsValueType && !type.IsEnum && type.Namespace.Equals(currentNamespace)) {
-
- classname = type.FullName;
- docname = type.Name;
- if (!nested) {
-
- writer = StartDocument();
- WriteClass(writer, type);
- EndDocument(writer);
- } else {
- WriteClass(writer, type);
- }
- }
- }
- }
-
- private void WriteDelegates(XmlTextWriter writer, Type[] types)
- {
- foreach (Type type in types) {
-
- if (type.IsClass && IsDelegate(type) && type.Namespace.Equals(currentNamespace)) {
-
- classname = type.FullName;
- docname = type.Name;
- if (!nested) {
-
- writer = StartDocument();
- WriteDelegate(writer, type);
- EndDocument(writer);
- } else {
- WriteDelegate(writer, type);
- }
- }
- }
- }
-
- private void WriteEnumerations(XmlTextWriter writer, Type[] types)
- {
- foreach (Type type in types) {
-
- if (type.IsEnum && type.Namespace.Equals(currentNamespace)) {
-
- classname = type.FullName;
- docname = type.Name;
- if (!nested) {
-
- writer = StartDocument();
- WriteEnumeration(writer, type);
- EndDocument(writer);
- } else {
- WriteEnumeration(writer, type);
- }
- }
- }
- }
-
- // Writes XML documenting a class or struct.
- private void WriteClass(XmlTextWriter writer, Type type)
- {
- Type[] types = type.GetNestedTypes();
- AssemblyName assemblyName = assembly.GetName();
- bool isStruct = type.IsValueType;
- nested = false;
-
- writer.WriteStartElement(isStruct ? "struct" : "class");
- writer.WriteAttributeString("name", type.FullName);
- writer.WriteAttributeString("assembly", assemblyName.Name);
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
-
- WriteClasses(writer, types);
- WriteInterfaces(writer, types);
- WriteStructures(writer, types);
- WriteDelegates(writer, types);
- WriteEnumerations(writer, types);
-
- WriteConstructors(writer, type);
- WriteFields(writer, type);
- WriteProperties(writer, type);
- WriteMethods(writer, type);
- WriteOperators(writer, type);
- WriteEvents(writer, type);
-
- writer.WriteEndElement();
- }
-
- // Writes XML documenting an interface.
- private void WriteInterface(XmlTextWriter writer, Type type)
- {
- AssemblyName assemblyName = assembly.GetName();
-
- writer.WriteStartElement("interface");
- writer.WriteAttributeString("name", type.FullName);
- writer.WriteAttributeString("assembly", assemblyName.Name);
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
- writer.WriteEndElement();
- }
-
- // Writes XML documenting a delegate.
- private void WriteDelegate(XmlTextWriter writer, Type type)
- {
- AssemblyName assemblyName = assembly.GetName();
-
- writer.WriteStartElement("delegate");
- writer.WriteAttributeString("name", type.FullName);
- writer.WriteAttributeString("assembly", assemblyName.Name);
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
- writer.WriteEndElement();
- }
-
- // Writes XML documenting an enumeration.
- private void WriteEnumeration(XmlTextWriter writer, Type type)
- {
- Type[] types = type.GetNestedTypes();
- AssemblyName assemblyName = assembly.GetName();
-
- writer.WriteStartElement("enum");
- writer.WriteAttributeString("name", type.FullName);
- writer.WriteAttributeString("assembly", assemblyName.Name);
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
-
- writer.WriteStartElement("member");
- writer.WriteAttributeString("name", "TODO");
- writer.WriteEndElement();
-
- writer.WriteEndElement();
- }
-
- private void WriteConstructors(XmlTextWriter writer, Type type)
- {
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Public |
- BindingFlags.NonPublic;
-
- ConstructorInfo[] constructors = type.GetConstructors(bindingFlags);
-
- foreach (ConstructorInfo constructor in constructors) {
-
- if (MustDocumentMethod(constructor)) {
-
- WriteConstructor(writer, constructor);
- }
- }
- }
-
- private void WriteFields(XmlTextWriter writer, Type type)
- {
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic;
-
- foreach (FieldInfo field in type.GetFields(bindingFlags)) {
-
- if (!IsAlsoAnEvent(field) && MustDocumentField(field)) {
-
- WriteField(writer, field);
- }
- }
- }
-
- private void WriteProperties(XmlTextWriter writer, Type type)
- {
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic;
-
- PropertyInfo[] properties = type.GetProperties(bindingFlags);
-
- foreach (PropertyInfo property in properties) {
-
- MethodInfo getMethod = property.GetGetMethod(true);
- MethodInfo setMethod = property.GetSetMethod(true);
-
- bool hasGetter = (getMethod != null);
- bool hasSetter = (setMethod != null);
-
- if ((hasGetter || hasSetter) && !IsAlsoAnEvent(property)) {
-
- WriteProperty(writer, property, property.DeclaringType.FullName != type.FullName);
- }
- }
- }
-
- private void WriteMethods(XmlTextWriter writer, Type type)
- {
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic;
-
- MethodInfo[] methods = type.GetMethods(bindingFlags);
-
- foreach (MethodInfo method in methods) {
-
- if (!(method.Name.StartsWith("get_")) &&
- !(method.Name.StartsWith("set_")) &&
- !(method.Name.StartsWith("add_")) &&
- !(method.Name.StartsWith("remove_")) &&
- !(method.Name.StartsWith("op_")) && MustDocumentMethod(method))
- {
- WriteMethod(writer, method, method.DeclaringType.FullName != type.FullName);
- }
- }
- }
-
- private void WriteOperators(XmlTextWriter writer, Type type)
- {
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic;
-
- MethodInfo[] methods = type.GetMethods(bindingFlags);
-
- foreach (MethodInfo method in methods) {
-
- if (method.Name.StartsWith("op_") && MustDocumentMethod(method)) {
-
- WriteOperator(writer, method);
- }
- }
- }
-
- private void WriteEvents(XmlTextWriter writer, Type type)
- {
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic |
- BindingFlags.DeclaredOnly;
-
- foreach (EventInfo eventInfo in type.GetEvents(bindingFlags)) {
-
- MethodInfo addMethod = eventInfo.GetAddMethod(true);
-
- if (addMethod != null && MustDocumentMethod(addMethod)) {
-
- WriteEvent(writer, eventInfo);
- }
- }
- }
-
- // Writes XML documenting a field.
- private void WriteField(XmlTextWriter writer, FieldInfo field)
- {
- writer.WriteStartElement("field");
- writer.WriteAttributeString("name", field.Name);
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
- writer.WriteEndElement();
- }
-
- // Writes XML documenting an event.
- private void WriteEvent(XmlTextWriter writer, EventInfo eventInfo)
- {
- writer.WriteStartElement("event");
- writer.WriteAttributeString("name", eventInfo.Name);
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
- writer.WriteElementString("data","TODO");
-
- writer.WriteEndElement();
- }
-
- // Writes XML documenting a constructor.
- private void WriteConstructor(XmlTextWriter writer, ConstructorInfo constructor)
- {
- writer.WriteStartElement("constructor");
- writer.WriteAttributeString("name", docname + GetParameterTypes(constructor.GetParameters()));
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
-
- foreach (ParameterInfo parameter in constructor.GetParameters()) {
-
- WriteParameter(writer, parameter);
- }
-
- writer.WriteEndElement();
- }
-
- // Writes XML documenting a property.
- private void WriteProperty(XmlTextWriter writer, PropertyInfo property, bool inherited )
- {
- if (!inherited) {
-
- writer.WriteStartElement("property");
- writer.WriteAttributeString("name", property.Name);
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
- writer.WriteElementString("value","TODO");
-
- writer.WriteEndElement();
- }
- }
-
- // Writes XML documenting an operator.
- private void WriteOperator(XmlTextWriter writer, MethodInfo method)
- {
- if (method != null) {
-
- writer.WriteStartElement("operator");
- writer.WriteAttributeString("name", method.Name + GetParameterTypes(method.GetParameters()));
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
-
- foreach (ParameterInfo parameter in method.GetParameters()) {
-
- WriteParameter(writer, parameter);
- }
-
- writer.WriteElementString("returns", "TODO");
-
- writer.WriteEndElement();
- }
- }
-
- // Writes XML documenting a method.
- private void WriteMethod(XmlTextWriter writer, MethodInfo method, bool inherited)
- {
- if (!inherited && method != null) {
-
- writer.WriteStartElement("method");
- writer.WriteAttributeString("name", method.Name + GetParameterTypes(method.GetParameters()));
- writer.WriteElementString("summary","TODO");
- writer.WriteElementString("remarks","TODO");
-
- foreach (ParameterInfo parameter in method.GetParameters()) {
-
- WriteParameter(writer, parameter);
- }
-
- writer.WriteElementString("returns", "TODO");
-
- writer.WriteEndElement();
- }
- }
-
- private void WriteParameter(XmlTextWriter writer, ParameterInfo parameter)
- {
- writer.WriteStartElement("param");
- writer.WriteAttributeString("name", parameter.Name);
- writer.WriteString("TODO");
- writer.WriteEndElement();
- }
- }
-}
diff --git a/mcs/doctools/src/Console/docval.cs b/mcs/doctools/src/Console/docval.cs
deleted file mode 100644
index 9c3b691c609..00000000000
--- a/mcs/doctools/src/Console/docval.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-// docval.cs
-//
-// Adam Treat (manyoso@yahoo.com)
-// (C) 2002 Adam Treat
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-
-using System;
-using System.Xml;
-
-namespace Mono.Util {
-
- class DocVal {
-
- string file;
-
- void Usage()
- {
- Console.Write ("docval [file]\n\n");
- }
-
- public static void Main(string[] args)
- {
- DocVal val = new DocVal(args);
- }
-
- public DocVal(string [] args)
- {
- bool pass = true;
- file = null;
- int argc = args.Length;
-
- for(int i = 0; i < argc; i++) {
- string arg = args[i];
- if(arg.EndsWith(".xml")) {
- file = arg;
- }
- }
-
- if(file == null) {
- Usage();
- return;
- }
-
- try {
- XmlTextReader read = new XmlTextReader(file);
- XmlValidatingReader validate = new XmlValidatingReader(read);
- validate.ValidationType = ValidationType.Auto;
- while (validate.Read()) {
- switch (validate.NodeType) {
- case XmlNodeType.XmlDeclaration:
- Console.WriteLine("** XML declaration");
- break;
- case XmlNodeType.DocumentType:
- Console.WriteLine("** DocumentType node");
- break;
- case XmlNodeType.Document:
- Console.WriteLine("** Document node");
- break;
- case XmlNodeType.Element:
- Console.WriteLine("** Element: {0}", validate.Name);
- break;
- case XmlNodeType.EndElement:
- Console.WriteLine("** End Element: {0}", validate.Name);
- break;
- case XmlNodeType.Text:
- Console.WriteLine("** Text: {0}", validate.Value);
- break;
- case XmlNodeType.Comment:
- Console.WriteLine("** Comment: {1}", validate.Name, validate.Value);
- break;
- case XmlNodeType.Whitespace:
- break;
- default:
- pass = false;
- Console.WriteLine("** ERROR: Unknown node type");
- break;
- }
- }
- } catch (Exception e) {
- pass = false;
- Console.WriteLine(e);
- }
- if(pass) {
- Console.Write("\n Validation: PASSED!\n\n");
- } else {
- Console.Write("\n Validation: FAILED!\n\n");
- }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/.cvsignore b/mcs/doctools/src/Core/.cvsignore
deleted file mode 100644
index ebc8ba26975..00000000000
--- a/mcs/doctools/src/Core/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-obj
-*.user
diff --git a/mcs/doctools/src/Core/AbstractClassStructDoc.cs b/mcs/doctools/src/Core/AbstractClassStructDoc.cs
deleted file mode 100644
index 033ea88a5db..00000000000
--- a/mcs/doctools/src/Core/AbstractClassStructDoc.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-// AbstractClassStructDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public abstract class AbstractClassStructDoc : AbstractTypeDoc
- {
- // constructor | event | field | method | operator | property
- protected ValueConstrainedArrayList constructors;
- protected ValueConstrainedArrayList events;
- protected ValueConstrainedArrayList fields;
- protected ValueConstrainedArrayList methods;
- protected ValueConstrainedArrayList operators;
- protected ValueConstrainedArrayList properties;
-
- // nested items
- protected ValueConstrainedArrayList classes;
- protected ValueConstrainedArrayList delegates;
- protected ValueConstrainedArrayList enums;
- protected ValueConstrainedArrayList interfaces;
- protected ValueConstrainedArrayList structs;
-
- public AbstractClassStructDoc(string name) : base(name)
- {
- this.constructors = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.ConstructorDoc", true));
- this.events = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.EventDoc", true));
- this.fields = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.FieldDoc", true));
- this.methods = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.MethodDoc", true));
- this.operators = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.OperatorDoc", true));
- this.properties = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.PropertyDoc", true));
- this.classes = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.ClassDoc", true));
- this.enums = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.EnumDoc", true));
- this.interfaces = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.InterfaceDoc", true));
- this.structs = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.StructDoc", true));
- }
-
- public AbstractClassStructDoc() : this(string.Empty)
- {
- }
-
- public ValueConstrainedArrayList Constructors
- {
- get { return this.constructors; }
- }
-
- public ValueConstrainedArrayList Events
- {
- get { return this.events; }
- }
-
- public ValueConstrainedArrayList Fields
- {
- get { return this.fields; }
- }
-
- public ValueConstrainedArrayList Methods
- {
- get { return this.methods; }
- }
-
- public ValueConstrainedArrayList Operators
- {
- get { return this.operators; }
- }
-
- public ValueConstrainedArrayList Properties
- {
- get { return this.properties; }
- }
-
- public ValueConstrainedArrayList NestedClasses
- {
- get { return this.classes; }
- }
-
- public ValueConstrainedArrayList NestedDelegates
- {
- get { return this.delegates; }
- }
-
- public ValueConstrainedArrayList NestedEnums
- {
- get { return this.enums; }
- }
-
- public ValueConstrainedArrayList NestedInterfaces
- {
- get { return this.interfaces; }
- }
-
- public ValueConstrainedArrayList NestedStructs
- {
- get { return this.structs; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/AbstractDoc.cs b/mcs/doctools/src/Core/AbstractDoc.cs
deleted file mode 100644
index 48eb0b7b26f..00000000000
--- a/mcs/doctools/src/Core/AbstractDoc.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// AbstractDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections.Specialized;
-
-namespace Mono.Doc.Core
-{
- public abstract class AbstractDoc
- {
- protected string name;
- protected string summary;
- protected string remarks;
- protected string language;
- protected StringCollection seeAlso;
-
- public AbstractDoc(string name)
- {
- this.name = name;
- this.summary = string.Empty;
- this.remarks = string.Empty;
- this.language = string.Empty;
- this.seeAlso = new StringCollection();
- }
-
- public AbstractDoc() : this(string.Empty)
- {
- }
-
- public string Summary
- {
- get { return this.summary; }
- set { this.summary = value; }
- }
-
- public string Remarks
- {
- get { return this.remarks; }
- set { this.remarks = value; }
- }
-
- public string Name
- {
- get { return this.name; }
- set { this.name = value; }
- }
-
- public StringCollection SeeAlso
- {
- get { return this.seeAlso; }
- }
-
- public string Language
- {
- get { return this.language; }
- set { this.language = value; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/AbstractMethodOperatorDoc.cs b/mcs/doctools/src/Core/AbstractMethodOperatorDoc.cs
deleted file mode 100644
index 33bef57faa4..00000000000
--- a/mcs/doctools/src/Core/AbstractMethodOperatorDoc.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// AbstractMethodOperatorDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections.Specialized;
-
-namespace Mono.Doc.Core
-{
- public abstract class AbstractMethodOperatorDoc : AbstractDoc
- {
- protected ValueConstrainedArrayList exceptions;
- protected StringDictionary parameters;
- protected string returns;
-
- public AbstractMethodOperatorDoc(string name) : base(name)
- {
- this.exceptions = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.ExceptionDoc", true));
- this.parameters = new StringDictionary();
- }
-
- public AbstractMethodOperatorDoc() : this(string.Empty)
- {
- }
-
- public ValueConstrainedArrayList Exceptions
- {
- get { return this.exceptions; }
- }
-
- public StringDictionary Parameters
- {
- get { return this.parameters; }
- }
-
- public string Returns
- {
- get { return this.returns; }
- set { this.returns = value; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/AbstractTypeDoc.cs b/mcs/doctools/src/Core/AbstractTypeDoc.cs
deleted file mode 100644
index 611024ed7fd..00000000000
--- a/mcs/doctools/src/Core/AbstractTypeDoc.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// AbstractTypeDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public abstract class AbstractTypeDoc : AbstractDoc
- {
- protected string assembly;
-
- public AbstractTypeDoc(string name) : base(name)
- {
- this.assembly = string.Empty;
- }
-
- public AbstractTypeDoc() : this(string.Empty)
- {
- }
-
- public string Assembly
- {
- get { return this.assembly; }
- set { this.assembly = value; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/AssemblyInfo.cs b/mcs/doctools/src/Core/AssemblyInfo.cs
deleted file mode 100644
index 8e9127507a2..00000000000
--- a/mcs/doctools/src/Core/AssemblyInfo.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-// AssemblyInfo.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
diff --git a/mcs/doctools/src/Core/AssemblyLoader.cs b/mcs/doctools/src/Core/AssemblyLoader.cs
deleted file mode 100644
index 2affd86bb14..00000000000
--- a/mcs/doctools/src/Core/AssemblyLoader.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-// AssemblyLoader.cs
-// John Barnette (jbarn@httcb.net)
-// Adam Treat (manyoso@yahoo.com)
-//
-// Copyright (c) 2002 John Barnette
-// Copyright (c) 2002 Adam Treat
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-
-namespace Mono.Doc.Core
-{
- public class AssemblyLoader
- {
- #region Instance Fields
-
- private Assembly assem;
-
- #endregion // Instance Fields
-
- #region Constructors and Destructors
-
- // TODO: add a constructor that allows specification of type and member visibility
- public AssemblyLoader(string fileName)
- {
- if (!File.Exists(fileName))
- {
- throw new ApplicationException(
- "Cannot find assembly file: " + fileName
- );
- }
-
- FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read);
- byte[] buffer = new byte[fs.Length];
- fs.Read(buffer, 0, (int)fs.Length);
- fs.Close();
-
- assem = Assembly.Load(buffer);
- }
-
- #endregion // Constructors and Destructors
-
- #region Private Instance Methods
-
- // TODO: visibility should be configurable in constructor
- private bool MustDocumentType(Type type)
- {
- if (type != null)
- {
- return ((type.IsPublic ||
- type.IsNestedPublic) &&
- !type.FullName.Equals("Driver") &&
- !type.FullName.Equals("Profile")
- );
- }
-
- return false;
- }
-
- // TODO: visibility should be configurable in constructor
- private bool MustDocumentMethod(MethodBase method)
- {
- return (method.IsPublic);
- }
-
- // TODO: visibility should be configurable in constructor
- private bool MustDocumentField(FieldInfo field)
- {
- return (field.IsPublic);
- }
-
- private bool IsAlsoAnEvent(Type type, string fullName)
- {
- bool isEvent = false;
-
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic |
- BindingFlags.DeclaredOnly;
-
- foreach (EventInfo eventInfo in type.GetEvents(bindingFlags))
- {
-
- if (eventInfo.EventHandlerType.FullName == fullName)
- {
-
- isEvent = true;
- break;
- }
- }
-
- return isEvent;
- }
-
- private bool IsAlsoAnEvent(FieldInfo field)
- {
- return IsAlsoAnEvent(field.DeclaringType, field.FieldType.FullName);
- }
-
- private bool IsAlsoAnEvent(PropertyInfo property)
- {
- return IsAlsoAnEvent(property.DeclaringType, property.PropertyType.FullName);
- }
-
- #endregion // Private Instance Methods
-
- #region Public Instance Methods
-
- public Type[] GetTypes()
- {
- ArrayList list = new ArrayList();
-
- foreach (Module m in assem.GetModules())
- {
- Type[] moduleTypes = m.GetTypes();
-
- foreach (Type type in moduleTypes)
- {
- if (MustDocumentType(type))
- {
- list.Add(type);
- }
- }
- }
-
- Type[] types = new Type[list.Count];
- int i = 0;
-
- foreach (Type type in list)
- {
- types[i++] = type;
- }
-
- return types;
- }
-
- public ConstructorInfo[] GetConstructors(Type t)
- {
- // TODO: should be configurable in constructor
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Public |
- BindingFlags.NonPublic ;
-
- ArrayList ctorList = new ArrayList();
-
- foreach (ConstructorInfo ctor in t.GetConstructors(bindingFlags))
- {
- if (MustDocumentMethod(ctor))
- {
- ctorList.Add(ctor);
- }
- }
-
- ConstructorInfo[] constructors = new ConstructorInfo[ctorList.Count];
- int i = 0;
-
- foreach (ConstructorInfo c in ctorList)
- {
- constructors[i++] = c;
- }
-
- return constructors;
- }
-
- public FieldInfo[] GetFields(Type t)
- {
- // TODO: should be configurable in constructor
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic ;
-
- ArrayList fieldList = new ArrayList();
-
- foreach (FieldInfo field in t.GetFields(bindingFlags))
- {
- if (MustDocumentField(field))
- {
- fieldList.Add(field);
- }
- }
-
- FieldInfo[] fields = new FieldInfo[fieldList.Count];
- int i = 0;
-
- foreach (FieldInfo f in fieldList)
- {
- fields[i++] = f;
- }
-
- return fields;
- }
-
- public PropertyInfo[] GetProperties(Type t)
- {
- // TODO: should be configurable in constructor
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic ;
-
- ArrayList propertyList = new ArrayList();
-
- foreach (PropertyInfo property in t.GetProperties(bindingFlags))
- {
- bool hasAccessor = (property.GetGetMethod(true) != null);
- bool hasMutator = (property.GetSetMethod(true) != null);
-
- if ((hasAccessor || hasMutator) && !IsAlsoAnEvent(property))
- {
- propertyList.Add(property);
- }
- }
-
- PropertyInfo[] properties = new PropertyInfo[propertyList.Count];
- int i = 0;
-
- foreach (PropertyInfo p in propertyList)
- {
- properties[i++] = p;
- }
-
- return properties;
- }
-
- public MethodInfo[] GetMethods(Type t)
- {
- // TODO: should be configurable in constructor
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic ;
-
- ArrayList methodList = new ArrayList();
-
- foreach (MethodInfo method in t.GetMethods(bindingFlags))
- {
- if (!(method.Name.StartsWith("get_")) &&
- !(method.Name.StartsWith("set_")) &&
- !(method.Name.StartsWith("add_")) &&
- !(method.Name.StartsWith("remove_")) &&
- !(method.Name.StartsWith("op_")) &&
- MustDocumentMethod(method))
- {
- methodList.Add(method);
- }
- }
-
- MethodInfo[] methods = new MethodInfo[methodList.Count];
- int i = 0;
-
- foreach (MethodInfo m in methodList)
- {
- methods[i++] = m;
- }
-
- return methods;
- }
-
- public MethodInfo[] GetOperators(Type t)
- {
- // TODO: should be configurable in constructor
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic ;
-
- ArrayList operatorList = new ArrayList();
-
- foreach (MethodInfo operatorMethod in t.GetMethods(bindingFlags))
- {
- if (operatorMethod.Name.StartsWith("op_") && MustDocumentMethod(operatorMethod))
- {
- operatorList.Add(operatorMethod);
- }
- }
-
- MethodInfo[] operators = new MethodInfo[operatorList.Count];
- int i = 0;
-
- foreach (MethodInfo m in operatorList)
- {
- operators[i++] = m;
- }
-
- return operators;
- }
-
- public EventInfo[] GetEvents(Type t)
- {
- // TODO: should be configurable in constructor
- BindingFlags bindingFlags =
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic |
- BindingFlags.DeclaredOnly;
-
- ArrayList eventList = new ArrayList();
-
- foreach (EventInfo eventInfo in t.GetEvents(bindingFlags))
- {
-
- MethodInfo addMethod = eventInfo.GetAddMethod(true);
-
- if (addMethod != null && MustDocumentMethod(addMethod))
- {
- eventList.Add(eventInfo);
- }
- }
-
- EventInfo[] events = new EventInfo[eventList.Count];
- int i = 0;
-
- foreach (EventInfo e in eventList)
- {
- events[i++] = e;
- }
-
- return events;
- }
-
- #endregion // Public Instance Methods
-
- #region Public Instance Properties
-
- public Assembly Assembly
- {
- get { return assem; }
- }
-
- #endregion // Public Instance Properties
- }
-}
diff --git a/mcs/doctools/src/Core/ClassDoc.cs b/mcs/doctools/src/Core/ClassDoc.cs
deleted file mode 100644
index 46a857d8edc..00000000000
--- a/mcs/doctools/src/Core/ClassDoc.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// ClassDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class ClassDoc : AbstractClassStructDoc
- {
- public ClassDoc(string name) : base(name)
- {
- }
-
- public ClassDoc() : this(string.Empty)
- {
- }
- }
-}
diff --git a/mcs/doctools/src/Core/ConstructorDoc.cs b/mcs/doctools/src/Core/ConstructorDoc.cs
deleted file mode 100644
index 152b1ae1009..00000000000
--- a/mcs/doctools/src/Core/ConstructorDoc.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-// ConstructorDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections.Specialized;
-
-namespace Mono.Doc.Core
-{
- public class ConstructorDoc : AbstractDoc
- {
- public ValueConstrainedArrayList exceptions;
- public StringDictionary parameters;
-
- public ConstructorDoc(string name) : base(name)
- {
- this.exceptions = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.ExceptionDoc", true));
- this.parameters = new StringDictionary();
- }
-
- public ConstructorDoc() : this(string.Empty)
- {
- }
-
- public ValueConstrainedArrayList Exceptions
- {
- get { return this.exceptions; }
- }
-
- public StringDictionary Parameters
- {
- get { return this.parameters; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/Core.csproj b/mcs/doctools/src/Core/Core.csproj
deleted file mode 100644
index dc93538ea85..00000000000
--- a/mcs/doctools/src/Core/Core.csproj
+++ /dev/null
@@ -1,223 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{73F5A60D-A5E3-4852-B4C6-478275E733F9}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "Mono.Doc.Core"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Library"
- RootNamespace = "Mono.Doc.Core"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "..\..\build\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "..\..\build\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AbstractClassStructDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AbstractDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AbstractMethodOperatorDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AbstractTypeDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AssemblyInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AssemblyLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ClassDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ConstructorDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "DelegateDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "DocProject.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "EnumDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "EventDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ExceptionDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "FieldDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "InterfaceDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "MethodDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "MonodocException.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "NamingFlags.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "NotifyArrayList.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "NotifyCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "NotifyHashtable.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "OperatorDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "PropertyDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "RecursiveFileList.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "SortedStringValues.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "StructDoc.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TypeNameHelper.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ValueConstrainedArrayList.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/doctools/src/Core/DelegateDoc.cs b/mcs/doctools/src/Core/DelegateDoc.cs
deleted file mode 100644
index 5b5f54d9009..00000000000
--- a/mcs/doctools/src/Core/DelegateDoc.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// DelegateDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections.Specialized;
-
-namespace Mono.Doc.Core
-{
- public class DelegateDoc : AbstractTypeDoc
- {
- private StringDictionary parameters;
-
- public DelegateDoc(string name) : base(name)
- {
- this.parameters = new StringDictionary();
- }
-
- public DelegateDoc() : this (string.Empty)
- {
- }
-
- public StringDictionary Parameters
- {
- get { return this.parameters; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/DocProject.cs b/mcs/doctools/src/Core/DocProject.cs
deleted file mode 100644
index 6d2c2ee4545..00000000000
--- a/mcs/doctools/src/Core/DocProject.cs
+++ /dev/null
@@ -1,327 +0,0 @@
-// DocProject.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Doc.Core
-{
- public class DocProject
- {
- # region Public Static Fields
-
- public static string UntitledProjectName = "Untitled"; // TODO: i18n
-
- #endregion // Public Static Fields
-
- #region Private Instance Fields
-
- private ArrayList assemblyFiles;
- private ArrayList xmlDirectories;
- private Hashtable properties;
- private bool isModified;
- private bool isNewProject;
- private string projectFileName;
-
- #endregion // Private Instace Fields
-
- #region Public Events
-
- public event EventHandler Modified;
-
- public DocProject()
- {
- assemblyFiles = new ArrayList();
- xmlDirectories = new ArrayList();
- properties = new Hashtable();
- isModified = false;
- isNewProject = true;
- projectFileName = DocProject.UntitledProjectName;
- }
-
- #endregion // Public Events
-
- #region Public Instance Methods
-
- public void Load(string fileName)
- {
- Clear();
-
- XmlTextReader xml = null;
-
- try
- {
- StreamReader stream = new StreamReader(fileName);
- xml = new XmlTextReader(stream);
-
- xml.MoveToContent();
- xml.ReadStartElement("monodoc-project");
-
- while (xml.Read())
- {
- if (xml.NodeType == XmlNodeType.Element)
- {
- switch (xml.Name)
- {
- case "assemblies":
- LoadAssemblies(xml);
- break;
- case "xmlDocs":
- LoadXmlDirectories(xml);
- break;
- case "properties":
- LoadProperties(xml);
- break;
- }
- }
- }
- }
- catch (Exception e)
- {
- // FIXME: i18n
- throw new MonodocException(
- "Problem reading project file '" + fileName + "'.\n" + e.Message, e
- );
- }
- finally
- {
- if (xml != null) xml.Close();
- }
-
-
- projectFileName = fileName;
- isModified = false;
- isNewProject = false;
- }
-
- public void Save()
- {
- Save(projectFileName);
- }
-
- public void Save(string fileName)
- {
- if (DocProject.UntitledProjectName == fileName)
- {
- throw new MonodocException("Cannot save untitled (default) project.");
- }
-
- XmlTextWriter xml = null;
-
- try
- {
- StreamWriter stream = new StreamWriter(fileName, false, new UTF8Encoding());
- xml = new XmlTextWriter(stream);
- xml.Formatting = Formatting.Indented;
- xml.Indentation = 4;
-
- // <monodoc-project>
- xml.WriteStartElement("monodoc-project");
-
- SaveAssemblies(xml);
- SaveXmlDirectories(xml);
- SaveProperties(xml);
-
- // </monodoc-project>
- xml.WriteEndElement();
-
- }
- catch (Exception e)
- {
- // TODO: i18n
- throw new MonodocException(
- "Problem saving project file '" + fileName + "'.\n" + e.Message, e
- );
- }
- finally
- {
- if (xml != null) xml.Close();
- }
-
- projectFileName = fileName;
- isModified = false;
- isNewProject = false;
- }
-
- public void Clear()
- {
- assemblyFiles.Clear();
- xmlDirectories.Clear();
- properties.Clear();
-
- projectFileName = DocProject.UntitledProjectName;
- isModified = false;
- isNewProject = true;
- }
-
- #endregion // Public Instance Methods
-
- #region Private Instance Methods
-
- private void LoadAssemblies(XmlTextReader xml)
- {
- while (xml.Read() && !(xml.NodeType == XmlNodeType.EndElement && xml.Name == "assemblies"))
- {
- if (xml.NodeType == XmlNodeType.Element && xml.Name == "assembly")
- {
- assemblyFiles.Add(xml["location"]);
- }
- }
- }
-
- private void LoadXmlDirectories(XmlTextReader xml)
- {
- while (xml.Read() && !(xml.NodeType == XmlNodeType.EndElement && xml.Name == "xmlDocs"))
- {
- if (xml.NodeType == XmlNodeType.Element && xml.Name == "directory")
- {
- xmlDirectories.Add(xml["location"]);
- }
- }
- }
-
- // TODO: this is dropping the first property, and I'm too tired to know why.
- private void LoadProperties(XmlTextReader xml)
- {
- while (xml.Read() && !(xml.NodeType == XmlNodeType.EndElement && xml.Name == "properties"))
- {
- if (xml.NodeType == XmlNodeType.Element && xml.Name == "property")
- {
- Console.WriteLine("project property load: {0} = '{1}'",
- xml["name"], xml["value"]);
-
- properties[xml["name"]] = xml["value"];
- }
- }
- }
-
- private void SaveAssemblies(XmlTextWriter xml)
- {
- // <assemblies>
- xml.WriteStartElement("assemblies");
-
- foreach (string assemblyFile in assemblyFiles)
- {
- // <assembly location="...">
- xml.WriteStartElement("assembly");
- xml.WriteAttributeString("location", assemblyFile);
-
- // </assembly>
- xml.WriteEndElement();
- }
-
- // </assemblies>
- xml.WriteEndElement();
- }
-
- private void SaveXmlDirectories(XmlTextWriter xml)
- {
- // <xmlDocs>
- xml.WriteStartElement("xmlDocs");
-
- foreach (string xmlDir in xmlDirectories)
- {
- // <directory location="...">
- xml.WriteStartElement("directory");
- xml.WriteAttributeString("location", xmlDir);
-
- // </directory>
- xml.WriteEndElement();
- }
-
- // </xmlDocs>
- xml.WriteEndElement();
- }
-
- private void SaveProperties(XmlTextWriter xml)
- {
- // <properties>
- xml.WriteStartElement("properties");
-
- foreach (string name in properties.Keys)
- {
- // <property name="..." value="...">
- xml.WriteStartElement("property");
- xml.WriteAttributeString("name", name);
- xml.WriteAttributeString("value", properties[name].ToString());
-
- // </property>
- xml.WriteEndElement();
- }
-
- // </properties>
- xml.WriteEndElement();
- }
-
- #endregion // Private Instance Methods
-
- #region Public Instance Properties
-
- public string FilePath
- {
- get { return projectFileName; }
- set { projectFileName = value; }
- }
-
- public bool IsModified
- {
- get { return isModified; }
- set
- {
- if (value && Modified != null)
- {
- isModified = value;
- Modified(this, new EventArgs());
- }
- else
- {
- isModified = value;
- }
- }
- }
-
- public bool IsNewProject
- {
- get { return isNewProject; }
- set { isNewProject = value; }
- }
-
- public ArrayList AssemblyFiles
- {
- get { return assemblyFiles; }
- }
-
- public ArrayList XmlDirectories
- {
- get { return xmlDirectories; }
- }
-
- public Hashtable Properties
- {
- get { return properties; }
- }
-
- #endregion // Public Instance Properties
- }
-}
diff --git a/mcs/doctools/src/Core/EnumDoc.cs b/mcs/doctools/src/Core/EnumDoc.cs
deleted file mode 100644
index e66ade83da8..00000000000
--- a/mcs/doctools/src/Core/EnumDoc.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// EnumDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections.Specialized;
-
-namespace Mono.Doc.Core
-{
- public class EnumDoc : AbstractTypeDoc
- {
- private StringDictionary members;
-
- public EnumDoc(string name) : base(name)
- {
- this.members = new StringDictionary();
- }
-
- public EnumDoc() : this(string.Empty)
- {
- }
-
- public StringDictionary Members
- {
- get { return this.members; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/EventDoc.cs b/mcs/doctools/src/Core/EventDoc.cs
deleted file mode 100644
index 36ae95ac916..00000000000
--- a/mcs/doctools/src/Core/EventDoc.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// EventDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION 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 Mono.Doc.Core
-{
- public class EventDoc : AbstractDoc
- {
- private string data;
-
- public EventDoc(string name) : base(name)
- {
- this.data = string.Empty;
- }
-
- public EventDoc() : this(string.Empty)
- {
- }
-
- public string Data
- {
- get { return this.data; }
- set { this.data = value; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/ExceptionDoc.cs b/mcs/doctools/src/Core/ExceptionDoc.cs
deleted file mode 100644
index b6b12c8062a..00000000000
--- a/mcs/doctools/src/Core/ExceptionDoc.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// ExceptionDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class ExceptionDoc
- {
- private string cref;
- private string description;
-
- public ExceptionDoc()
- {
- this.cref = string.Empty;
- this.description = string.Empty;
- }
-
- public ExceptionDoc(string cref, string description)
- {
- this.cref = cref;
- this.description = description;
- }
-
- public string Cref
- {
- get { return this.cref; }
- set { this.cref = value; }
- }
-
- public string Description
- {
- get { return this.description; }
- set { this.description = value; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/FieldDoc.cs b/mcs/doctools/src/Core/FieldDoc.cs
deleted file mode 100644
index 19de9094d27..00000000000
--- a/mcs/doctools/src/Core/FieldDoc.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// FieldDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class FieldDoc : AbstractDoc
- {
- public FieldDoc(string name) : base(name)
- {
- }
-
- public FieldDoc() : this(string.Empty)
- {
- }
- }
-}
diff --git a/mcs/doctools/src/Core/InterfaceDoc.cs b/mcs/doctools/src/Core/InterfaceDoc.cs
deleted file mode 100644
index a43223824ba..00000000000
--- a/mcs/doctools/src/Core/InterfaceDoc.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// InterfaceDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class InterfaceDoc : AbstractTypeDoc
- {
- public InterfaceDoc(string name) : base(name)
- {
- }
-
- public InterfaceDoc() : this(string.Empty)
- {
- }
- }
-}
diff --git a/mcs/doctools/src/Core/MethodDoc.cs b/mcs/doctools/src/Core/MethodDoc.cs
deleted file mode 100644
index 0d9bf382aae..00000000000
--- a/mcs/doctools/src/Core/MethodDoc.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// MethodDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class MethodDoc : AbstractMethodOperatorDoc
- {
- public MethodDoc(string name) : base(name)
- {
- }
-
- public MethodDoc() : this(string.Empty)
- {
- }
- }
-}
diff --git a/mcs/doctools/src/Core/MonodocException.cs b/mcs/doctools/src/Core/MonodocException.cs
deleted file mode 100644
index 1aacaace08e..00000000000
--- a/mcs/doctools/src/Core/MonodocException.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// MonodocException.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class MonodocException : ApplicationException
- {
- public MonodocException() : base()
- {
- }
-
- public MonodocException(string msg) : base(msg)
- {
- }
-
- public MonodocException(string msg, Exception nested) : base(msg, nested)
- {
- }
- }
-}
diff --git a/mcs/doctools/src/Core/NamingFlags.cs b/mcs/doctools/src/Core/NamingFlags.cs
deleted file mode 100644
index f4f6d4042fd..00000000000
--- a/mcs/doctools/src/Core/NamingFlags.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// NamingFlags.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- [Flags]
- public enum NamingFlags
- {
- None = 1,
- FullName = 2,
- TypeSpecifier = 4,
- ForceMethodParams = 8,
- HideMethodParams = 16,
- ShortParamTypes = 32
- }
-} \ No newline at end of file
diff --git a/mcs/doctools/src/Core/NotifyArrayList.cs b/mcs/doctools/src/Core/NotifyArrayList.cs
deleted file mode 100644
index 9efea5fcd63..00000000000
--- a/mcs/doctools/src/Core/NotifyArrayList.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-// NotifyArrayList.cs
-// John Sohn (jsohn@columbus.rr.com)
-//
-// Copyright (c) 2002 John Sohn
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-
-using System;
-using System.Collections;
-
-namespace Mono.Doc.Core
-{
- /// <summary>
- /// An implementation of the ArrayList class that provides
- /// a mechanism to receive a notification event
- /// when the elements of the array are changed
- /// </summary>
- public class NotifyArrayList : ArrayList, INotifyCollection
- {
- #region Protected Instance Fields
-
- protected NotifyCollectionHandler handler = null;
-
- #endregion
-
- #region Constructors and Destructors
-
- public NotifyArrayList() : base()
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyArrayList(ICollection collection)
- : base(collection)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyArrayList(int i) : base(i)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- #endregion // Constructors and Destructors
-
- #region Public Instance Fields
-
- /// <summary>
- /// The event handler that will be called whenever
- /// a change is made to the ArrayList.
- /// </summary>
- public event CollectionModifiedEventHandler Modified;
-
- #endregion // Public Instance Fields
-
- #region Public Instance Methods
-
- /// <summary>
- /// Turns off notification event calling. Notification
- /// events will not be sent until EndUpdate() is called.
- /// </summary>
- public virtual void BeginUpdate()
- {
- handler.BeginUpdate();
- }
-
- /// <summary>
- /// Resumes notification event calling previously
- /// turned off by calling BeginUpdate().
- /// </summary>
- public virtual void EndUpdate()
- {
- handler.EndUpdate();
- }
-
- /// <summary>
- /// Invokes the Modified event.
- /// </summary>
- public void SetModifiedEvent()
- {
- if (Modified != null)
- {
- Modified(this);
- }
- }
-
- // the following overridden functions modify the contents
- // of the collection
- public override object this[int index]
- {
- set
- {
- base[index] = value;
- handler.OnModified();
- }
- }
-
- public override int Add(object value)
- {
- int status = base.Add(value);
- handler.OnModified();
- return status;
- }
-
- public override void AddRange(ICollection c)
- {
- base.AddRange(c);
- handler.OnModified();
- }
-
- public override void Clear()
- {
- base.Clear();
- handler.OnModified();
- }
-
- public override void Insert(int index, object value)
- {
- base.Insert(index, value);
- handler.OnModified();
- }
-
- public override void InsertRange(int index, ICollection c) {
- base.InsertRange(index, c);
- handler.OnModified();
- }
-
- public override void Remove(object obj) {
- base.Remove(obj);
- handler.OnModified();
- }
-
- public override void RemoveAt(int index) {
- base.RemoveAt(index);
- handler.OnModified();
- }
-
- public override void RemoveRange(int index,int count) {
- base.RemoveRange(index, count);
- handler.OnModified();
- }
-
- public override void Reverse() {
- base.Reverse();
- handler.OnModified();
- }
-
- public override void SetRange(int index,ICollection c) {
- base.SetRange(index, c);
- handler.OnModified();
- }
-
- public override void Sort() {
- base.Sort();
- handler.OnModified();
- }
-
- #endregion // Public Instance Methods
- }
-}
-
diff --git a/mcs/doctools/src/Core/NotifyCollection.cs b/mcs/doctools/src/Core/NotifyCollection.cs
deleted file mode 100644
index 1d098e14dac..00000000000
--- a/mcs/doctools/src/Core/NotifyCollection.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// NotifyCollections.cs
-// John Sohn (jsohn@columbus.rr.com)
-//
-// Copyright (c) 2002 John Sohn
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
-
-using System;
-using System.Collections;
-
-namespace Mono.Doc.Core
-{
- public delegate void CollectionModifiedEventHandler(object sender);
-
- public interface INotifyCollection
- {
- event CollectionModifiedEventHandler Modified;
- void BeginUpdate();
- void EndUpdate();
- void SetModifiedEvent();
- }
-
- public class NotifyCollectionHandler
- {
- private bool callModifiedEvent = true;
- private bool changedDuringUpdate = false;
- INotifyCollection collection;
-
- public NotifyCollectionHandler(INotifyCollection collection)
- {
- this.collection = collection;
- }
-
- public void BeginUpdate()
- {
- callModifiedEvent = false;
- changedDuringUpdate = false;
- }
-
- public void EndUpdate()
- {
- // call the event if changes occured between the
- // begin/end update calls
- if (changedDuringUpdate)
- {
- collection.SetModifiedEvent();
- }
-
- changedDuringUpdate = false;
- callModifiedEvent = true;
- }
-
- public void OnModified()
- {
- // if in the middle of begin/end update
- // save the event call until EndUpdate()
- if (!callModifiedEvent)
- {
- changedDuringUpdate = true;
- }
- else
- {
- collection.SetModifiedEvent();
- }
- }
- }
-}
-
diff --git a/mcs/doctools/src/Core/NotifyHashtable.cs b/mcs/doctools/src/Core/NotifyHashtable.cs
deleted file mode 100644
index d05a45f1e42..00000000000
--- a/mcs/doctools/src/Core/NotifyHashtable.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-// NotifyHashtable.cs
-// John Sohn (jsohn@columbus.rr.com)
-//
-// Copyright (c) 2002 John Sohn
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-
-namespace Mono.Doc.Core
-{
- /// <summary>
- /// An implementation of the Hashtable class that provides
- /// a mechanism to receive a notification event
- /// when the elements of the Hashtable are changed
- // </summary>
- public class NotifyHashtable : Hashtable, INotifyCollection
- {
- #region Protected Instance Fields
-
- protected NotifyCollectionHandler handler = null;
-
- #endregion
-
- #region Constructors and Destructor
-
- public NotifyHashtable() : base()
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(IDictionary d) : base(d)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(int i) : base(i)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(IDictionary d, float f) : base(d, f)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(IHashCodeProvider hp, IComparer c)
- : base(hp, c)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(int i, float f) : base(i, f)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- protected NotifyHashtable(SerializationInfo si,
- StreamingContext sc) : base(si, sc)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(IDictionary d, IHashCodeProvider hcp,
- IComparer c) : base(d, hcp, c)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(int i, IHashCodeProvider hcp,
- IComparer c) : base(i, hcp, c)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(IDictionary d, float f,
- IHashCodeProvider hcp, IComparer c)
- : base(d, f, hcp, c)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- public NotifyHashtable(int i, float f, IHashCodeProvider hcp,
- IComparer c) : base(i, f, hcp, c)
- {
- handler = new NotifyCollectionHandler(this);
- }
-
- #endregion
-
- #region Public Instance Fields
-
- /// <summary>
- /// The event handler that will be called whenever
- /// a change is made to the Hashtable.
- /// </summary>
- public event CollectionModifiedEventHandler Modified;
-
- #endregion // Public Instance Fields
-
- #region Public Instance Methods
-
- /// <summary>
- /// Turns off notification event calling. Notification
- /// events will not be sent until EndUpdate() is called.
- /// </summary>
- public virtual void BeginUpdate()
- {
- handler.BeginUpdate();
- }
-
- /// <summary>
- /// Resumes notification event calling previously
- /// turned off by calling BeginUpdate().
- /// </summary>
- public virtual void EndUpdate()
- {
- handler.EndUpdate();
- }
-
- public virtual void SetModifiedEvent()
- {
- if (Modified != null)
- {
- Modified(this);
- }
- }
-
- public override object this[object key]
- {
- set
- {
- base[key] = value;
- handler.OnModified();
- }
- }
-
- public override void Add(object key,object value)
- {
- base.Add(key, value);
- handler.OnModified();
- }
-
- public override void Clear()
- {
- base.Clear();
- handler.OnModified();
- }
-
- public override void Remove(object key)
- {
- base.Remove(key);
- handler.OnModified();
- }
- #endregion // Public Instance Methods
- }
-}
-
diff --git a/mcs/doctools/src/Core/OperatorDoc.cs b/mcs/doctools/src/Core/OperatorDoc.cs
deleted file mode 100644
index 4bb45808fa0..00000000000
--- a/mcs/doctools/src/Core/OperatorDoc.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// OperatorDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class OperatorDoc : AbstractMethodOperatorDoc
- {
- public OperatorDoc(string name) : base(name)
- {
- }
-
- public OperatorDoc() : this(string.Empty)
- {
- }
- }
-}
diff --git a/mcs/doctools/src/Core/PropertyDoc.cs b/mcs/doctools/src/Core/PropertyDoc.cs
deleted file mode 100644
index 9c82c75cbcf..00000000000
--- a/mcs/doctools/src/Core/PropertyDoc.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-// PropertyDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class PropertyDoc : AbstractDoc
- {
- private string value;
- private ValueConstrainedArrayList exceptions;
-
- public PropertyDoc(string name) : base(name)
- {
- this.value = string.Empty;
- this.exceptions = new ValueConstrainedArrayList(Type.GetType("Mono.Doc.Core.ExceptionDoc", true));
- }
-
- public PropertyDoc() : this(string.Empty)
- {
- }
-
- public string Value
- {
- get { return this.value; }
- set { this.value = value; }
- }
-
- public ValueConstrainedArrayList Exceptions
- {
- get { return this.exceptions; }
- }
- }
-}
diff --git a/mcs/doctools/src/Core/RecursiveFileList.cs b/mcs/doctools/src/Core/RecursiveFileList.cs
deleted file mode 100644
index 3f1a556a904..00000000000
--- a/mcs/doctools/src/Core/RecursiveFileList.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-// RecursiveFileList.cs
-// John Sohn (jsohn@columbus.rr.com)
-//
-// Copyright (c) 2002 John Sohn
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections;
-using System.IO;
-
-
-namespace Mono.Doc.Core
-{
- /// <summary>
- /// Recurses through the given directory and subdirectories based on a
- /// filter (wildcard) passed into the constructor. The results are placed
- /// in the Files property which is an ArrayList of System.IO.FileInfo objects
- /// </summary>
- public class RecursiveFileList
- {
- #region Private Instance Fields
-
- private ArrayList fileInfoList;
-
- #endregion // Private Instance Fields
-
- #region Constructors and Destructors
-
- /// <summary>Constructor for RecursiveFileList.</summary>
- /// <param name="path">The directory to recurse.</param>
- /// <exception cref="DirectoryNotFoundException">Thrown if an invalid path is specified.</exception>
- public RecursiveFileList(string path) : this(path, null)
- {
- }
-
- /// <summary>
- /// Constructor for RecursiveFileList.
- /// </summary>
- /// <param name="path">The directory to recurse.</param>
- /// <param name="filter">Wildcard of files to collect.</param>
- /// <exception cref="DirectoryNotFoundException">Thrown if an invalid path is specified.</exception>
- public RecursiveFileList(string path, string filter)
- {
- this.fileInfoList = new ArrayList();
- AddFilesInPath(path, filter);
- }
-
- #endregion // Constructors and Destructors
-
- #region Private Instance Methods
-
- private void AddFilesInPath(string path, string filter)
- {
- DirectoryInfo dir = new DirectoryInfo(path);
-
-
- if (filter == null)
- {
- filter = "*.*";
- }
-
- foreach (FileSystemInfo fi in dir.GetFiles(filter))
- {
- this.fileInfoList.Add(fi);
- }
-
-
- foreach (DirectoryInfo di in dir.GetDirectories())
- {
- AddFilesInPath(di.FullName, filter);
- }
- }
-
- #endregion // Private Instance Methods
-
- #region Public Instance Properties
-
- /// <summary>
- /// Contains an ArrayList of System.IO.FileInfo objects
- /// based on the path (and optional filter) passed to the constructor.
- /// </summary>
- public ArrayList Files
- {
- get { return this.fileInfoList; }
- }
-
- #endregion // Public Instance Properties
- }
-}
-
diff --git a/mcs/doctools/src/Core/SortedStringValues.cs b/mcs/doctools/src/Core/SortedStringValues.cs
deleted file mode 100644
index 9f1e130de4c..00000000000
--- a/mcs/doctools/src/Core/SortedStringValues.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// SortedStringValues.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// The original concept for this class was presented in an MSDN online article
-// by Eric Gunnerson.
-
-using System;
-using System.Collections;
-
-namespace Mono.Doc.Core
-{
- public class SortedStringValues : IEnumerable
- {
- private IEnumerable enumerable;
-
- public SortedStringValues(IEnumerable enumerable)
- {
- this.enumerable = enumerable;
- }
-
- internal class SortedStringValuesEnumerator : IEnumerator
- {
- private ArrayList items = new ArrayList();
- private int current;
-
- internal SortedStringValuesEnumerator(IEnumerator enumerator)
- {
- while (enumerator.MoveNext())
- {
- items.Add(enumerator.Current.ToString());
- }
-
- IDisposable disposable = enumerator as IDisposable;
-
- if (disposable != null)
- {
- disposable.Dispose();
- }
-
- items.Sort();
- current = -1;
- }
-
- public void Reset()
- {
- current = -1;
- }
-
- public bool MoveNext()
- {
- if (++current == items.Count) return false;
-
- return true;
- }
-
- public object Current
- {
- get { return items[current]; }
- }
- }
-
- public IEnumerator GetEnumerator()
- {
- return new SortedStringValuesEnumerator(enumerable.GetEnumerator());
- }
- }
-}
diff --git a/mcs/doctools/src/Core/StructDoc.cs b/mcs/doctools/src/Core/StructDoc.cs
deleted file mode 100644
index 6d628bc17d3..00000000000
--- a/mcs/doctools/src/Core/StructDoc.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// StructDoc.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Core
-{
- public class StructDoc : AbstractClassStructDoc
- {
- public StructDoc(string name) : base(name)
- {
- }
-
- public StructDoc() : this(string.Empty)
- {
- }
- }
-}
diff --git a/mcs/doctools/src/Core/TypeNameHelper.cs b/mcs/doctools/src/Core/TypeNameHelper.cs
deleted file mode 100644
index 3c5d4c8570f..00000000000
--- a/mcs/doctools/src/Core/TypeNameHelper.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-// TypeNameHelper.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Reflection;
-using System.Text;
-
-namespace Mono.Doc.Core
-{
- /// <summary>
- /// Generates friendly names for types.
- /// </summary>
- public sealed class TypeNameHelper
- {
- private TypeNameHelper()
- {
- // can't instantiate this class
- }
-
-
- /// <summary>
- /// Given a MemberInfo object, creates a friendly string name without
- /// full qualifiers or a type prefix.
- /// </summary>
- /// <param name="m">The MemberInfo to name</param>
- /// <returns>A friendly name</returns>
- public static string GetName(MemberInfo m) {
- return GetName(m, NamingFlags.None);
- }
-
-
- /// <summary>
- /// Given a MemberInfo object, creates a friendly string name.
- /// </summary>
- /// <param name="m">The MemberInfo to name</param>
- /// <param name="flags">NamingFlags can be combined to alter the output</param>
- /// <returns>A friendly name</returns>
- public static string GetName(MemberInfo m, NamingFlags flags)
- {
- StringBuilder name = new StringBuilder();
-
- // type specifier
- if ((flags & NamingFlags.TypeSpecifier) != 0) {
- // append a type specifier to this name
- string type = null;
-
- if (m is ConstructorInfo) {
- type = "C";
- } else if (m is MethodInfo) {
- type = "M";
- } else if (m is EventInfo) {
- type = "E";
- } else if (m is FieldInfo) {
- type = "F";
- } else if (m is PropertyInfo) {
- type = "P";
- } else if (m is Type) {
- type = "T";
- } else {
- type = "!";
- }
-
- name.Append(type + ":");
- }
-
- // first-class types
- if (m.DeclaringType == null && m is Type) {
- return name.Append((m as Type).FullName).ToString();
- }
-
- // full name
- if (((flags & NamingFlags.FullName) != 0) && m.DeclaringType != null) {
- name.Append(m.DeclaringType.FullName + ".");
- }
-
- // normal name
- name.Append(m.Name.Replace(".", "#")); // for #ctor
-
- // for methods and constructors, params are part of the name
- if (m is MethodBase) {
- MethodBase method = m as MethodBase;
- ParameterInfo[] parameters = method.GetParameters();
-
- if (parameters.Length > 0 && ((flags & NamingFlags.HideMethodParams) == 0)) {
- bool first = true;
- name.Append("(");
-
- foreach (ParameterInfo p in parameters) {
- if (!first) name.Append(",");
- first = false;
- name.Append(((flags & NamingFlags.ShortParamTypes) != 0) ?
- p.ParameterType.Name : p.ParameterType.FullName);
- }
-
- name.Append(")");
- } else if ((flags & NamingFlags.ForceMethodParams) != 0) {
- name.Append("()");
- }
- }
-
- return name.ToString();
- }
- }
-}
diff --git a/mcs/doctools/src/Core/ValueConstrainedArrayList.cs b/mcs/doctools/src/Core/ValueConstrainedArrayList.cs
deleted file mode 100644
index 0fdfad47ca3..00000000000
--- a/mcs/doctools/src/Core/ValueConstrainedArrayList.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-// ValueConstrainedArrayList.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections;
-
-namespace Mono.Doc.Core
-{
- public class ValueConstrainedArrayList : ArrayList
- {
- #region Protected Instance Fields
-
- protected Type allowed;
-
- #endregion // Protected Instance Fields
-
- #region Constructors and Destructors
-
- public ValueConstrainedArrayList(Type allowed) : base()
- {
- if (allowed == null)
- {
- throw new ArgumentNullException("allowed", "Specified Type constraint cannot be null.");
- }
-
- this.allowed = allowed;
- }
-
- public ValueConstrainedArrayList(Type allowed, ICollection c)
- {
- if (allowed == null)
- {
- throw new ArgumentNullException("allowed", "Specified Type constraint cannot be null.");
- }
-
- this.allowed = allowed;
-
- this.AddRange(c);
- }
-
- public ValueConstrainedArrayList(Type allowed, int capacity) : base(capacity)
- {
- if (allowed == null)
- {
- throw new ArgumentNullException("allowed", "Specified Type constraint cannot be null.");
- }
-
- this.allowed = allowed;
- }
-
- #endregion // Constructors and Destructors
-
- #region Public Instance Methods
-
- public override int Add(object value)
- {
- if (allowed != value.GetType())
- {
- throw new ArgumentException("Values in constrained collection must be of type " + allowed.ToString() +
- ".", "value"
- );
- }
-
- return base.Add(value);
- }
-
- public override void AddRange(ICollection c)
- {
- foreach (object o in c)
- {
- if (allowed != o.GetType())
- {
- throw new ArgumentException("Values in constrained collection must be of type " +
- allowed.ToString() + ".", "c"
- );
- }
- }
-
- base.AddRange(c);
- }
-
- public override void Insert(int index, object value)
- {
- if (allowed != value.GetType())
- {
- throw new ArgumentException("Values in constrained collection must be of type " + allowed.ToString() +
- ".", "value"
- );
- }
-
- base.Insert(index, value);
- }
-
- public override void InsertRange(int index, ICollection c)
- {
- foreach (object o in c)
- {
- if (allowed != o.GetType())
- {
- throw new ArgumentException("Values in constrained collection must be of type " +
- allowed.ToString() + ".", "c"
- );
- }
- }
-
- base.InsertRange(index, c);
- }
-
- public override void SetRange(int index, ICollection c)
- {
- foreach (object o in c)
- {
- if (allowed != o.GetType())
- {
- throw new ArgumentException("Values in constrained collection must be of type " +
- allowed.ToString() + ".", "c"
- );
- }
- }
-
- base.SetRange(index, c);
- }
-
- #endregion // Public Instance Methods
-
- #region Public Instance Properties
-
- public override object this[int index]
- {
- get { return base[index]; }
- set
- {
- if (allowed != value.GetType())
- {
- throw new ArgumentException("Values in constrained collection must be of type " +
- allowed.ToString() + "." + "value"
- );
- }
-
- base[index] = value;
- }
- }
-
- #endregion // Public Instance Properties
- }
-}
diff --git a/mcs/doctools/src/Gui/.cvsignore b/mcs/doctools/src/Gui/.cvsignore
deleted file mode 100644
index 83e41579c07..00000000000
--- a/mcs/doctools/src/Gui/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-obj
-*.resx
diff --git a/mcs/doctools/src/Gui/AboutForm.cs b/mcs/doctools/src/Gui/AboutForm.cs
deleted file mode 100644
index 443b04d5fa3..00000000000
--- a/mcs/doctools/src/Gui/AboutForm.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-// AboutForm.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- public class AboutForm : Form
- {
- private PictureBox aboutLogo;
- private Button closeButton;
-
- public AboutForm()
- {
- aboutLogo = new PictureBox();
- closeButton = new Button();
-
- this.SuspendLayout();
-
- // aboutLogo properties
- aboutLogo.Dock = DockStyle.Fill;
- aboutLogo.Image = GuiResources.AboutMonodocBitmap;
- aboutLogo.Name = "aboutLogo";
- aboutLogo.Size = new Size(300, 300);
-
- // closeButton properties
- closeButton.Location = new Point(96, 272);
- closeButton.Name = "closeButton";
- closeButton.Size = new Size(104, 24);
- closeButton.TabIndex = 0;
- closeButton.Text = GuiResources.GetString("Buttons.Close");
-
-
- // form properties
- this.AutoScaleBaseSize = new Size(5, 13);
- this.BackColor = Color.White;
- this.ClientSize = new Size(300, 300);
- this.FormBorderStyle = FormBorderStyle.FixedSingle;
- this.Icon = GuiResources.OpenBookIcon;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "AboutForm";
- this.ShowInTaskbar = false;
- this.StartPosition = FormStartPosition.CenterParent;
- this.Text = GuiResources.GetString("Form.About.Title");
-
- // bind events
- closeButton.Click += new EventHandler(closeButton_Click);
-
- // add components
- this.Controls.AddRange(new Control[] { closeButton, aboutLogo});
-
- this.ResumeLayout(false);
- }
-
- // events
- private void closeButton_Click(object sender, EventArgs args)
- {
- this.Close();
- }
- }
-}
diff --git a/mcs/doctools/src/Gui/AssemblyTreeImages.cs b/mcs/doctools/src/Gui/AssemblyTreeImages.cs
deleted file mode 100644
index 363bdeef6ac..00000000000
--- a/mcs/doctools/src/Gui/AssemblyTreeImages.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-// AssemblyTreeImages.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for AssemblyBrowserImages.
- /// </summary>
- public class AssemblyTreeImages
- {
- private static Image[] images = null;
- private static ImageList imageList = null;
-
- // this class cannot be instantiated
- private AssemblyTreeImages()
- {
- }
-
- static AssemblyTreeImages()
- {
- Bitmap b = GuiResources.AssemblyTreeBitmap;
- int count = (int) b.Width / b.Height;
- images = new Image[count];
- Rectangle rect = new Rectangle(0, 0, b.Height, b.Height);
- imageList = new ImageList();
-
- for (int j = 0; j < count; j++)
- {
- images[j] = b.Clone(rect, b.PixelFormat);
- rect.X += b.Height;
-
- imageList.Images.Add(images[j]);
- }
- }
-
- // access as an ImageList for TreeView, ToolBar
- public static ImageList List { get { return imageList; } }
-
- public static Image AssemblyClosedImage { get { return images[AssemblyClosed]; } }
- public static Image AssemblyOpenImage { get { return images[AssemblyOpen]; } }
- public static Image NamespaceImage { get { return images[Namespace]; } }
- public static Image ClassImage { get { return images[Class]; } }
- public static Image InterfaceImage { get { return images[Interface]; } }
- public static Image StructImage { get { return images[Struct]; } }
- public static Image EnumImage { get { return images[Enum]; } }
- public static Image ConstructorImage { get { return images[Constructor]; } }
- public static Image MethodImage { get { return images[Method]; } }
- public static Image EventImage { get { return images[Event]; } }
- public static Image PropertyImage { get { return images[Property]; } }
- public static Image DelegateImage { get { return images[Delegate]; } }
- public static Image OperatorImage { get { return images[Operator]; } }
- public static Image FieldImage { get { return images[Field]; } }
- public static Image ShortcutsImage { get { return images[Shortcuts]; } }
-
- // imageList indexes
- public static int AssemblyClosed = 0;
- public static int AssemblyOpen = 1;
- public static int Namespace = 2;
- public static int Class = 3;
- public static int Interface = 4;
- public static int Struct = 5;
- public static int Enum = 6;
- public static int Constructor = 7;
- public static int Method = 8;
- public static int Event = 9;
- public static int Property = 10;
- public static int Delegate = 11;
- public static int Operator = 12;
- public static int Field = 13;
- public static int Shortcuts = 14;
- }
-}
diff --git a/mcs/doctools/src/Gui/AssemblyTreeLoader.cs b/mcs/doctools/src/Gui/AssemblyTreeLoader.cs
deleted file mode 100644
index 152e22a4752..00000000000
--- a/mcs/doctools/src/Gui/AssemblyTreeLoader.cs
+++ /dev/null
@@ -1,461 +0,0 @@
-// AssemblyTreeLoader.cs
-// John Barnette (jbarn@httcb.net)
-// Adam Treat (manyoso@yahoo.com)
-//
-// Copyright (c) 2002 John Barnette
-// Copyright (c) 2002 Adam Treat
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Much of the reflection guts of this class come from the original Monodoc
-// XML stub generator, by Adam Treat, and much of the guts of *that* were
-// derived from NDoc (http://ndoc.sourceforge.net).
-
-using Mono.Doc.Core;
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- public class AssemblyTreeLoader
- {
- #region Instance Fields
-
- private AssemblyLoader loader;
-
- #endregion // Instance Fields
-
- #region Constructors and Destructors
-
- public AssemblyTreeLoader(AssemblyLoader loader)
- {
- this.loader = loader;
- }
-
- #endregion // Constructors and Destructors
-
- #region Private Instance Methods
-
- private TreeNode GetNodeForType(Type t)
- {
- string nodeName = GetTypeDisplayName(t) + " ";
- TreeNode typeNode = new TreeNode();
- typeNode.Tag =
- TypeNameHelper.GetName(t, NamingFlags.TypeSpecifier | NamingFlags.FullName);
-
- if (t.IsClass && !IsDelegate(t))
- {
- // Type is class
- typeNode.ImageIndex = AssemblyTreeImages.Class;
- typeNode.SelectedImageIndex = AssemblyTreeImages.Class;
- typeNode.Text = nodeName + "Class"; // TODO: i18n
-
- // Constructors, Fields, Properties, Methods, Operators, Events
- TreeNode[] categories = new TreeNode[6];
- categories[0] = GetConstructorsNode(t);
- categories[1] = GetFieldsNode(t);
- categories[2] = GetPropertiesNode(t);
- categories[3] = GetMethodsNode(t);
- categories[4] = GetOperatorsNode(t);
- categories[5] = GetEventsNode(t);
-
- foreach (TreeNode cat in categories)
- {
- if (cat != null)
- {
- typeNode.Nodes.Add(cat);
- }
- }
- }
- else if (t.IsInterface)
- {
- // Type is interface
- typeNode.ImageIndex = AssemblyTreeImages.Interface;
- typeNode.SelectedImageIndex = AssemblyTreeImages.Interface;
- typeNode.Text = nodeName + "Interface"; // TODO: i18n
-
- // Methods, properties, events
- TreeNode methodsNode = GetMethodsNode(t);
- TreeNode propsNode = GetPropertiesNode(t);
- TreeNode eventsNode = GetEventsNode(t);
-
- if (methodsNode != null)
- {
- typeNode.Nodes.Add(methodsNode);
- }
-
- if (propsNode != null)
- {
- typeNode.Nodes.Add(propsNode);
- }
-
- if (eventsNode != null)
- {
- typeNode.Nodes.Add(eventsNode);
- }
- }
- else if (t.IsValueType && !t.IsEnum)
- {
- // Type is struct
- typeNode.ImageIndex = AssemblyTreeImages.Struct;
- typeNode.SelectedImageIndex = AssemblyTreeImages.Struct;
- typeNode.Text = nodeName + "Structure"; // TODO: i18n
-
- // Constructors, Fields, Properties, Methods, Operators, Events
- TreeNode[] categories = new TreeNode[6];
- categories[0] = GetConstructorsNode(t);
- categories[1] = GetFieldsNode(t);
- categories[2] = GetPropertiesNode(t);
- categories[3] = GetMethodsNode(t);
- categories[4] = GetOperatorsNode(t);
- categories[5] = GetEventsNode(t);
-
- foreach (TreeNode cat in categories)
- {
- if (cat != null)
- {
- typeNode.Nodes.Add(cat);
- }
- }
- }
- else if (t.IsEnum)
- {
- // Type is enumeration
- typeNode.ImageIndex = AssemblyTreeImages.Enum;
- typeNode.SelectedImageIndex = AssemblyTreeImages.Enum;
- typeNode.Text = nodeName + "Enumeration"; // TODO: i18n
- }
- else if (t.IsClass && IsDelegate(t))
- {
- // Type is delegate
- typeNode.ImageIndex = AssemblyTreeImages.Delegate;
- typeNode.SelectedImageIndex = AssemblyTreeImages.Delegate;
- typeNode.Text = nodeName + "Delegate"; // TODO: i18n
- }
- else
- {
- MessageBox.Show(
- "Encountered unexpected type during tree load: " + t.FullName,
- "What the heck is this?"
- );
- }
-
- return typeNode;
- }
-
- private TreeNode GetConstructorsNode(Type t)
- {
- ConstructorInfo[] ctors = loader.GetConstructors(t);
-
- if (ctors.Length > 0)
- {
- TreeNode cNode = new TreeNode("Constructors");
- cNode.ImageIndex = AssemblyTreeImages.Constructor;
- cNode.SelectedImageIndex = AssemblyTreeImages.Constructor;
-
- foreach (ConstructorInfo ctor in ctors)
- {
- TreeNode ctorNode = new TreeNode();
- ctorNode.ImageIndex = AssemblyTreeImages.Constructor;
- ctorNode.SelectedImageIndex = AssemblyTreeImages.Constructor;
- ctorNode.Tag = GetTag(ctor);
- ctorNode.Text = TypeNameHelper.GetName(ctor,
- NamingFlags.ForceMethodParams | NamingFlags.ShortParamTypes).
- Replace("#ctor", t.Name + " Constructor ").
- Replace(",", ", ");
-
- cNode.Nodes.Add(ctorNode);
- }
-
- return cNode;
- }
- else
- {
- return null;
- }
- }
-
- private TreeNode GetFieldsNode(Type t)
- {
- FieldInfo[] fields = loader.GetFields(t);
-
- if (fields.Length > 0)
- {
- TreeNode fNode = new TreeNode("Fields");
- fNode.ImageIndex = AssemblyTreeImages.Field;
- fNode.SelectedImageIndex = AssemblyTreeImages.Field;
-
- foreach (FieldInfo field in fields)
- {
- TreeNode fieldNode = new TreeNode();
- fieldNode.ImageIndex = AssemblyTreeImages.Field;
- fieldNode.SelectedImageIndex = AssemblyTreeImages.Field;
- fieldNode.Tag = GetTag(field);
- fieldNode.Text = field.Name + " Field";
-
- fNode.Nodes.Add(fieldNode);
- }
-
- return fNode;
- }
- else
- {
- return null;
- }
- }
-
- private TreeNode GetPropertiesNode(Type t)
- {
- PropertyInfo[] properties = loader.GetProperties(t);
-
- if (properties.Length > 0)
- {
- TreeNode pNode = new TreeNode("Properties");
- pNode.ImageIndex = AssemblyTreeImages.Property;
- pNode.SelectedImageIndex = AssemblyTreeImages.Property;
-
- foreach (PropertyInfo property in properties)
- {
- TreeNode propertyNode = new TreeNode();
- propertyNode.ImageIndex = AssemblyTreeImages.Property;
- propertyNode.SelectedImageIndex = AssemblyTreeImages.Property;
- propertyNode.Tag = GetTag(property);
- propertyNode.Text = property.Name + " Property";
-
- pNode.Nodes.Add(propertyNode);
- }
-
- return pNode;
- }
- else
- {
- return null;
- }
- }
-
- private TreeNode GetMethodsNode(Type t)
- {
- MethodInfo[] methods = loader.GetMethods(t);
-
- if (methods.Length > 0)
- {
- TreeNode mNode = new TreeNode("Methods");
- mNode.ImageIndex = AssemblyTreeImages.Method;
- mNode.SelectedImageIndex = AssemblyTreeImages.Method;
- Hashtable overloads = new Hashtable();
-
- // group method overloads by name
- foreach (MethodInfo method in methods)
- {
- ArrayList overloadList = overloads[method.Name] as ArrayList;
-
- if (overloadList == null)
- {
- overloadList = new ArrayList();
- overloads[method.Name] = overloadList;
-
- overloadList.Add(method);
- }
- else
- {
- overloadList.Add(method);
- }
- }
-
- // create nodes, grouping overloaded methods
- foreach (string methodName in overloads.Keys)
- {
- ArrayList overloadList = overloads[methodName] as ArrayList;
-
- if (overloadList.Count > 1)
- {
- // overloaded method
- TreeNode overloadNode = new TreeNode();
- overloadNode.ImageIndex = AssemblyTreeImages.Method;
- overloadNode.SelectedImageIndex = AssemblyTreeImages.Method;
- overloadNode.Text = methodName + " Method";
- overloadNode.Tag = "TODO:OVERLOAD";
-
- foreach (MethodInfo m in overloadList)
- {
- overloadNode.Nodes.Add(GetOverloadedMethodNode(m));
- }
-
- mNode.Nodes.Add(overloadNode);
- }
- else
- {
- // not overloaded
- MethodInfo m = overloadList[0] as MethodInfo;
- TreeNode methodNode = new TreeNode();
- methodNode.ImageIndex = AssemblyTreeImages.Method;
- methodNode.SelectedImageIndex = AssemblyTreeImages.Method;
- methodNode.Tag = GetTag(m);
- methodNode.Text = m.Name +
- TypeNameHelper.GetName(m, NamingFlags.HideMethodParams).
- Replace(m.Name, " ") + " Method";
-
- mNode.Nodes.Add(methodNode);
- }
- }
-
- return mNode;
- }
- else
- {
- return null;
- }
- }
-
- private TreeNode GetOverloadedMethodNode(MethodInfo m)
- {
- TreeNode mNode = new TreeNode();
- mNode.Tag = GetTag(m);
- mNode.Text = m.Name + TypeNameHelper.GetName(m,
- NamingFlags.ForceMethodParams | NamingFlags.ShortParamTypes).
- Replace(",", ", ").Replace(m.Name, " ") + " Method";
-
- return mNode;
- }
-
- private TreeNode GetOperatorsNode(Type t)
- {
- MethodInfo[] operatorMethods = loader.GetOperators(t);
-
- if (operatorMethods.Length > 0)
- {
- TreeNode oNode = new TreeNode("Operators");
- oNode.ImageIndex = AssemblyTreeImages.Operator;
- oNode.SelectedImageIndex = AssemblyTreeImages.Operator;
-
- foreach (MethodInfo om in operatorMethods)
- {
- TreeNode omNode = new TreeNode();
- omNode.ImageIndex = AssemblyTreeImages.Operator;
- omNode.SelectedImageIndex = AssemblyTreeImages.Operator;
- omNode.Tag = GetTag(om);
- omNode.Text = om.Name.Replace("op_", "") + " Operator";
-
- oNode.Nodes.Add(omNode);
- }
-
- return oNode;
- }
- else
- {
- return null;
- }
- }
-
- private TreeNode GetEventsNode(Type t)
- {
- EventInfo[] events = loader.GetEvents(t);
-
- if (events.Length > 0)
- {
- TreeNode eNode = new TreeNode("Events");
- eNode.ImageIndex = AssemblyTreeImages.Event;
- eNode.SelectedImageIndex = AssemblyTreeImages.Event;
-
- foreach (EventInfo e in events)
- {
- TreeNode eiNode = new TreeNode();
- eiNode.ImageIndex = AssemblyTreeImages.Event;
- eiNode.SelectedImageIndex = AssemblyTreeImages.Event;
- eiNode.Tag = GetTag(e);
- eiNode.Text = e.Name + " Event";
-
- eNode.Nodes.Add(eiNode);
- }
-
- return eNode;
- }
- else
- {
- return null;
- }
- }
-
- private bool IsDelegate(Type type)
- {
- return type.BaseType.FullName == "System.Delegate" ||
- type.BaseType.FullName == "System.MulticastDelegate";
- }
-
- private string GetTypeDisplayName(Type type)
- {
- string[] s = type.FullName.Split(new char[] {'.'});
- string name = s[s.Length - 1];
-
- return name.Replace('+', '.');
- }
-
- private string GetTag(MemberInfo m)
- {
- return TypeNameHelper.GetName(m, NamingFlags.TypeSpecifier | NamingFlags.FullName);
- }
-
- #endregion // Private Instance Methods
-
- #region Public Instance Methods
-
- public void LoadNode(TreeNode node)
- {
- // create root element
- TreeNode root = new TreeNode(loader.Assembly.GetName().Name + " Assembly");
- root.ImageIndex = AssemblyTreeImages.AssemblyOpen;
- root.SelectedImageIndex = AssemblyTreeImages.AssemblyOpen;
- root.Tag = "A:" + loader.Assembly.GetName().Name;
-
- node.Nodes.Add(root);
-
- // dictionary of namespaces
- Hashtable namespaces = new Hashtable();
-
- foreach (Type t in loader.GetTypes())
- {
- TreeNode nsNode = (TreeNode) namespaces[t.Namespace];
-
- if (nsNode == null)
- {
- nsNode = new TreeNode(t.Namespace);
- nsNode.ImageIndex = AssemblyTreeImages.Namespace;
- nsNode.SelectedImageIndex = AssemblyTreeImages.Namespace;
- nsNode.Tag = "N:" + t.Namespace;
- namespaces[t.Namespace] = nsNode;
-
- }
-
- // TODO: sort types before adding
- TreeNode typeNode = GetNodeForType(t);
-
- nsNode.Nodes.Add(typeNode);
- }
-
-
- // add sorted namespace nodes to root
- foreach (string nsName in new SortedStringValues(namespaces.Keys))
- {
- root.Nodes.Add((TreeNode) namespaces[nsName]);
- }
- }
-
- #endregion // Public Instance Methods
- }
-}
diff --git a/mcs/doctools/src/Gui/DirectorySelectorForm.cs b/mcs/doctools/src/Gui/DirectorySelectorForm.cs
deleted file mode 100644
index 7e51e61515c..00000000000
--- a/mcs/doctools/src/Gui/DirectorySelectorForm.cs
+++ /dev/null
@@ -1,318 +0,0 @@
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.IO;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for DirectorySelectorForm.
- /// </summary>
- public class DirectorySelectorForm : System.Windows.Forms.Form
- {
- private DirectoryInfo currentDirectory;
- private string selectedDirectoryName;
-
- private System.Windows.Forms.Label labelPath;
- private System.Windows.Forms.TextBox textBoxPath;
- private System.Windows.Forms.TreeView tree;
- private System.Windows.Forms.Button buttonOK;
- private System.Windows.Forms.Button buttonCancel;
- private System.Windows.Forms.Button buttonParentDir;
-
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public DirectorySelectorForm()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
-
- this.buttonParentDir.ImageList = AssemblyTreeImages.List;
- this.buttonParentDir.ImageIndex = AssemblyTreeImages.Shortcuts; // TODO: need prev. dir icon
- this.tree.ImageList = AssemblyTreeImages.List;
- this.tree.ImageIndex = AssemblyTreeImages.Shortcuts; // TODO: need folder icon
- this.tree.SelectedImageIndex = AssemblyTreeImages.Shortcuts; // TODO: need folder icon
-
- if (SetCurrentDirectory(Directory.GetCurrentDirectory()))
- {
- this.textBoxPath.Text = this.currentDirectory.FullName;
- this.selectedDirectoryName = this.currentDirectory.FullName;
-
- InitializeTree();
- }
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Private Instance Methods
-
- private void InitializeTree()
- {
- this.tree.Nodes.Clear();
-
- foreach (DirectoryInfo dirInfo in this.currentDirectory.GetDirectories())
- {
- TreeNode dirNode = new TreeNode(dirInfo.Name);
- dirNode.Tag = dirInfo.FullName;
-
- CreateSubdirectoryNodes(dirNode);
- this.tree.Nodes.Add(dirNode);
- }
- }
-
- private void CreateSubdirectoryNodes(TreeNode dirNode)
- {
- DirectoryInfo dirInfo = new DirectoryInfo(dirNode.Tag as string);
-
- foreach (DirectoryInfo childDirInfo in dirInfo.GetDirectories())
- {
- TreeNode childDirNode = new TreeNode(childDirInfo.Name);
- childDirNode.Tag = childDirInfo.FullName;
-
- dirNode.Nodes.Add(childDirNode);
- }
- }
-
- private bool SetCurrentDirectory(string dirName)
- {
- string errorMessage = null;
- DirectoryInfo newDirectory = null;
-
- try
- {
- newDirectory = new DirectoryInfo(dirName);
- }
- catch (ArgumentNullException)
- {
- errorMessage = "cannot be null.";
- }
- catch (DirectoryNotFoundException)
- {
- errorMessage = "was not found.";
- }
- catch (ArgumentException)
- {
- errorMessage = "contains invalid characters.";
- }
- catch (PathTooLongException)
- {
- errorMessage = "is too long.";
- }
-
- if (errorMessage != null)
- {
- MessageBox.Show("The selected path " + errorMessage,
- "Problem Opening Directory",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error
- );
-
- return false;
- }
- else
- {
- this.currentDirectory = newDirectory;
-
- return true;
- }
- }
-
- #endregion // Private Instance Methods
-
- #region Public Instance Properties
-
- public string DirectoryName
- {
- get { return selectedDirectoryName; }
- }
-
- #endregion // Public Instance Properties
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.labelPath = new System.Windows.Forms.Label();
- this.textBoxPath = new System.Windows.Forms.TextBox();
- this.tree = new System.Windows.Forms.TreeView();
- this.buttonOK = new System.Windows.Forms.Button();
- this.buttonCancel = new System.Windows.Forms.Button();
- this.buttonParentDir = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // labelPath
- //
- this.labelPath.Location = new System.Drawing.Point(8, 8);
- this.labelPath.Name = "labelPath";
- this.labelPath.Size = new System.Drawing.Size(40, 16);
- this.labelPath.TabIndex = 0;
- this.labelPath.Text = "Path:";
- this.labelPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // textBoxPath
- //
- this.textBoxPath.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.textBoxPath.Location = new System.Drawing.Point(48, 6);
- this.textBoxPath.Name = "textBoxPath";
- this.textBoxPath.Size = new System.Drawing.Size(232, 20);
- this.textBoxPath.TabIndex = 1;
- this.textBoxPath.Text = "";
- this.textBoxPath.Leave += new System.EventHandler(this.textBoxPath_Leave);
- //
- // tree
- //
- this.tree.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.tree.ImageIndex = -1;
- this.tree.Location = new System.Drawing.Point(8, 32);
- this.tree.Name = "tree";
- this.tree.SelectedImageIndex = -1;
- this.tree.Size = new System.Drawing.Size(304, 288);
- this.tree.TabIndex = 3;
- this.tree.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.tree_BeforeSelect);
- this.tree.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tree_BeforeExpand);
- //
- // buttonOK
- //
- this.buttonOK.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.buttonOK.Location = new System.Drawing.Point(144, 328);
- this.buttonOK.Name = "buttonOK";
- this.buttonOK.TabIndex = 4;
- this.buttonOK.Text = "OK";
- this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
- //
- // buttonCancel
- //
- this.buttonCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.buttonCancel.Location = new System.Drawing.Point(232, 328);
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.TabIndex = 5;
- this.buttonCancel.Text = "Cancel";
- this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
- //
- // buttonParentDir
- //
- this.buttonParentDir.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.buttonParentDir.Location = new System.Drawing.Point(288, 5);
- this.buttonParentDir.Name = "buttonParentDir";
- this.buttonParentDir.Size = new System.Drawing.Size(24, 23);
- this.buttonParentDir.TabIndex = 6;
- this.buttonParentDir.Text = "..";
- this.buttonParentDir.Click += new System.EventHandler(this.buttonParentDir_Click);
- //
- // DirectorySelectorForm
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(320, 358);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.buttonParentDir,
- this.buttonCancel,
- this.buttonOK,
- this.tree,
- this.textBoxPath,
- this.labelPath});
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
- this.Name = "DirectorySelectorForm";
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
- this.Text = "Select Directory";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void buttonCancel_Click(object sender, System.EventArgs e)
- {
- this.DialogResult = DialogResult.Cancel;
- this.Close();
- }
-
- private void buttonOK_Click(object sender, System.EventArgs e)
- {
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
-
- private void textBoxPath_Leave(object sender, System.EventArgs e)
- {
- if (SetCurrentDirectory(textBoxPath.Text))
- {
- InitializeTree();
- }
- }
-
- private void tree_BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
- {
- foreach (TreeNode childDirNode in e.Node.Nodes)
- {
- if (childDirNode.Nodes.Count == 0)
- {
- CreateSubdirectoryNodes(childDirNode);
- }
- }
- }
-
- private void tree_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
- {
- string path = e.Node.Tag as string;
- this.textBoxPath.Text = path;
- this.selectedDirectoryName = path;
- }
-
- private void buttonParentDir_Click(object sender, System.EventArgs e)
- {
- DirectoryInfo parent = this.currentDirectory.Parent;
-
- if (parent != null && SetCurrentDirectory(parent.FullName))
- {
- textBoxPath.Text = parent.FullName;
- InitializeTree();
- }
- }
- }
-}
diff --git a/mcs/doctools/src/Gui/EditPropertyForm.cs b/mcs/doctools/src/Gui/EditPropertyForm.cs
deleted file mode 100644
index 431ec38377f..00000000000
--- a/mcs/doctools/src/Gui/EditPropertyForm.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for EditPropertyForm.
- /// </summary>
- public class EditPropertyForm : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Label labelPropertyName;
- private System.Windows.Forms.Label labelPropertyValue;
- private System.Windows.Forms.TextBox textBoxPropertyName;
- private System.Windows.Forms.TextBox textBoxPropertyValue;
- private System.Windows.Forms.Button buttonOk;
- private System.Windows.Forms.Button buttonCancel;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public EditPropertyForm()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.labelPropertyName = new System.Windows.Forms.Label();
- this.labelPropertyValue = new System.Windows.Forms.Label();
- this.textBoxPropertyName = new System.Windows.Forms.TextBox();
- this.textBoxPropertyValue = new System.Windows.Forms.TextBox();
- this.buttonOk = new System.Windows.Forms.Button();
- this.buttonCancel = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // labelPropertyName
- //
- this.labelPropertyName.Location = new System.Drawing.Point(8, 8);
- this.labelPropertyName.Name = "labelPropertyName";
- this.labelPropertyName.Size = new System.Drawing.Size(100, 16);
- this.labelPropertyName.TabIndex = 0;
- this.labelPropertyName.Text = "Property Name";
- //
- // labelPropertyValue
- //
- this.labelPropertyValue.Location = new System.Drawing.Point(8, 56);
- this.labelPropertyValue.Name = "labelPropertyValue";
- this.labelPropertyValue.Size = new System.Drawing.Size(96, 16);
- this.labelPropertyValue.TabIndex = 1;
- this.labelPropertyValue.Text = "Property Value";
- //
- // textBoxPropertyName
- //
- this.textBoxPropertyName.Location = new System.Drawing.Point(8, 24);
- this.textBoxPropertyName.Name = "textBoxPropertyName";
- this.textBoxPropertyName.Size = new System.Drawing.Size(272, 20);
- this.textBoxPropertyName.TabIndex = 2;
- this.textBoxPropertyName.Text = "New Property";
- //
- // textBoxPropertyValue
- //
- this.textBoxPropertyValue.Location = new System.Drawing.Point(8, 72);
- this.textBoxPropertyValue.Name = "textBoxPropertyValue";
- this.textBoxPropertyValue.Size = new System.Drawing.Size(272, 20);
- this.textBoxPropertyValue.TabIndex = 3;
- this.textBoxPropertyValue.Text = "Property Value";
- //
- // buttonOk
- //
- this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
- this.buttonOk.Location = new System.Drawing.Point(120, 104);
- this.buttonOk.Name = "buttonOk";
- this.buttonOk.TabIndex = 4;
- this.buttonOk.Text = "OK";
- this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click);
- //
- // buttonCancel
- //
- this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonCancel.Location = new System.Drawing.Point(208, 104);
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.TabIndex = 5;
- this.buttonCancel.Text = "Cancel";
- this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
- //
- // EditPropertyForm
- //
- this.AcceptButton = this.buttonOk;
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.CancelButton = this.buttonCancel;
- this.ClientSize = new System.Drawing.Size(292, 136);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.buttonCancel,
- this.buttonOk,
- this.textBoxPropertyValue,
- this.textBoxPropertyName,
- this.labelPropertyValue,
- this.labelPropertyName});
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
- this.Name = "EditPropertyForm";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "Edit Project Property";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void buttonCancel_Click(object sender, System.EventArgs e)
- {
- this.Close();
- }
-
- private void buttonOk_Click(object sender, System.EventArgs e)
- {
- this.Close();
- }
-
- #region Public Instance Properties
-
- public string PropertyName
- {
- get { return this.textBoxPropertyName.Text; }
- set { this.textBoxPropertyName.Text = value; }
- }
-
- public string PropertyValue
- {
- get { return this.textBoxPropertyValue.Text; }
- set { this.textBoxPropertyValue.Text = value; }
- }
-
- #endregion // Public Instance Properties
- }
-}
diff --git a/mcs/doctools/src/Gui/ExampleCodeEditorForm.cs b/mcs/doctools/src/Gui/ExampleCodeEditorForm.cs
deleted file mode 100644
index aae0001d991..00000000000
--- a/mcs/doctools/src/Gui/ExampleCodeEditorForm.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-// ExampleCodeEditorForm.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for ExampleCodeEditorForm.
- /// </summary>
- public class ExampleCodeEditorForm : System.Windows.Forms.Form
- {
- // TODO: figure out how to munge TextBox to support simple autoindent.
-
- private System.Windows.Forms.Label labelExampleLanguage;
- private System.Windows.Forms.ComboBox comboBoxExampleLanguage;
- private System.Windows.Forms.Button buttonOk;
- private System.Windows.Forms.Button buttonCancel;
- private System.Windows.Forms.TextBox textBoxExampleText;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public ExampleCodeEditorForm()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.labelExampleLanguage = new System.Windows.Forms.Label();
- this.comboBoxExampleLanguage = new System.Windows.Forms.ComboBox();
- this.buttonOk = new System.Windows.Forms.Button();
- this.buttonCancel = new System.Windows.Forms.Button();
- this.textBoxExampleText = new System.Windows.Forms.TextBox();
- this.SuspendLayout();
- //
- // labelExampleLanguage
- //
- this.labelExampleLanguage.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.labelExampleLanguage.Location = new System.Drawing.Point(168, 8);
- this.labelExampleLanguage.Name = "labelExampleLanguage";
- this.labelExampleLanguage.Size = new System.Drawing.Size(112, 16);
- this.labelExampleLanguage.TabIndex = 0;
- this.labelExampleLanguage.Text = "Example Language:";
- this.labelExampleLanguage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // comboBoxExampleLanguage
- //
- this.comboBoxExampleLanguage.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.comboBoxExampleLanguage.Items.AddRange(new object[] {
- "C#"});
- this.comboBoxExampleLanguage.Location = new System.Drawing.Point(280, 6);
- this.comboBoxExampleLanguage.Name = "comboBoxExampleLanguage";
- this.comboBoxExampleLanguage.Size = new System.Drawing.Size(121, 21);
- this.comboBoxExampleLanguage.TabIndex = 1;
- //
- // buttonOk
- //
- this.buttonOk.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.buttonOk.Location = new System.Drawing.Point(248, 353);
- this.buttonOk.Name = "buttonOk";
- this.buttonOk.Size = new System.Drawing.Size(64, 24);
- this.buttonOk.TabIndex = 2;
- this.buttonOk.Text = "OK";
- //
- // buttonCancel
- //
- this.buttonCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonCancel.Location = new System.Drawing.Point(328, 353);
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.Size = new System.Drawing.Size(64, 24);
- this.buttonCancel.TabIndex = 3;
- this.buttonCancel.Text = "Cancel";
- //
- // textBoxExampleText
- //
- this.textBoxExampleText.AcceptsReturn = true;
- this.textBoxExampleText.AcceptsTab = true;
- this.textBoxExampleText.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.textBoxExampleText.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.textBoxExampleText.Location = new System.Drawing.Point(8, 32);
- this.textBoxExampleText.Multiline = true;
- this.textBoxExampleText.Name = "textBoxExampleText";
- this.textBoxExampleText.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.textBoxExampleText.Size = new System.Drawing.Size(392, 313);
- this.textBoxExampleText.TabIndex = 4;
- this.textBoxExampleText.Text = "// example code";
- this.textBoxExampleText.WordWrap = false;
- //
- // ExampleCodeEditorForm
- //
- this.AcceptButton = this.buttonOk;
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.CancelButton = this.buttonCancel;
- this.ClientSize = new System.Drawing.Size(408, 382);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.textBoxExampleText,
- this.buttonCancel,
- this.buttonOk,
- this.comboBoxExampleLanguage,
- this.labelExampleLanguage});
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
- this.Name = "ExampleCodeEditorForm";
- this.ShowInTaskbar = false;
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
- this.Text = "Example Code Editor";
- this.ResumeLayout(false);
-
- }
- #endregion
- }
-}
diff --git a/mcs/doctools/src/Gui/GenericEditorForm.cs b/mcs/doctools/src/Gui/GenericEditorForm.cs
deleted file mode 100644
index 4af61c0791d..00000000000
--- a/mcs/doctools/src/Gui/GenericEditorForm.cs
+++ /dev/null
@@ -1,232 +0,0 @@
-// GenericEditorForm.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for GenericEditorForm.
- /// </summary>
- public class GenericEditorForm : System.Windows.Forms.Form
- {
- protected System.Windows.Forms.ToolBar toolBar;
- protected System.Windows.Forms.Label labelSummary;
- protected System.Windows.Forms.TextBox textBoxSummary;
- protected System.Windows.Forms.Label labelRemarks;
- protected System.Windows.Forms.TextBox textBoxRemarks;
- protected System.Windows.Forms.Label labelSeeAlso;
- protected System.Windows.Forms.ComboBox comboBoxLanguage;
- protected System.Windows.Forms.Label labelLanguage;
- protected System.Windows.Forms.ListView listViewSeeAlso;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public GenericEditorForm()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- // TODO: hack so I can see the toolbar and ListView
- toolBar.ImageList = AssemblyTreeImages.List;
- listViewSeeAlso.SmallImageList = AssemblyTreeImages.List;
-
- for (int j = 0; j < toolBar.ImageList.Images.Count; j++)
- {
- ToolBarButton b = new ToolBarButton();
- b.ImageIndex = j;
- toolBar.Buttons.Add(b);
-
- ListViewItem i = new ListViewItem("See Also " + j.ToString(), j);
- listViewSeeAlso.Items.Add(i);
- }
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.toolBar = new System.Windows.Forms.ToolBar();
- this.labelSummary = new System.Windows.Forms.Label();
- this.textBoxSummary = new System.Windows.Forms.TextBox();
- this.labelRemarks = new System.Windows.Forms.Label();
- this.textBoxRemarks = new System.Windows.Forms.TextBox();
- this.labelSeeAlso = new System.Windows.Forms.Label();
- this.comboBoxLanguage = new System.Windows.Forms.ComboBox();
- this.labelLanguage = new System.Windows.Forms.Label();
- this.listViewSeeAlso = new System.Windows.Forms.ListView();
- this.SuspendLayout();
- //
- // toolBar
- //
- this.toolBar.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.toolBar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
- this.toolBar.Divider = false;
- this.toolBar.Dock = System.Windows.Forms.DockStyle.None;
- this.toolBar.DropDownArrows = true;
- this.toolBar.Location = new System.Drawing.Point(8, 0);
- this.toolBar.Name = "toolBar";
- this.toolBar.ShowToolTips = true;
- this.toolBar.Size = new System.Drawing.Size(416, 23);
- this.toolBar.TabIndex = 0;
- this.toolBar.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right;
- this.toolBar.Wrappable = false;
- //
- // labelSummary
- //
- this.labelSummary.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.labelSummary.Location = new System.Drawing.Point(8, 64);
- this.labelSummary.Name = "labelSummary";
- this.labelSummary.Size = new System.Drawing.Size(416, 16);
- this.labelSummary.TabIndex = 1;
- this.labelSummary.Text = "Summary";
- //
- // textBoxSummary
- //
- this.textBoxSummary.AcceptsReturn = true;
- this.textBoxSummary.AcceptsTab = true;
- this.textBoxSummary.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.textBoxSummary.Location = new System.Drawing.Point(8, 80);
- this.textBoxSummary.Multiline = true;
- this.textBoxSummary.Name = "textBoxSummary";
- this.textBoxSummary.Size = new System.Drawing.Size(416, 72);
- this.textBoxSummary.TabIndex = 2;
- this.textBoxSummary.Text = "Insert summary here.";
- //
- // labelRemarks
- //
- this.labelRemarks.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.labelRemarks.Location = new System.Drawing.Point(8, 160);
- this.labelRemarks.Name = "labelRemarks";
- this.labelRemarks.Size = new System.Drawing.Size(416, 16);
- this.labelRemarks.TabIndex = 3;
- this.labelRemarks.Text = "Remarks";
- //
- // textBoxRemarks
- //
- this.textBoxRemarks.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.textBoxRemarks.Location = new System.Drawing.Point(8, 176);
- this.textBoxRemarks.Multiline = true;
- this.textBoxRemarks.Name = "textBoxRemarks";
- this.textBoxRemarks.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.textBoxRemarks.Size = new System.Drawing.Size(416, 192);
- this.textBoxRemarks.TabIndex = 3;
- this.textBoxRemarks.Text = "Insert remarks here.";
- //
- // labelSeeAlso
- //
- this.labelSeeAlso.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.labelSeeAlso.Location = new System.Drawing.Point(8, 376);
- this.labelSeeAlso.Name = "labelSeeAlso";
- this.labelSeeAlso.Size = new System.Drawing.Size(416, 16);
- this.labelSeeAlso.TabIndex = 5;
- this.labelSeeAlso.Text = "See Also";
- //
- // comboBoxLanguage
- //
- this.comboBoxLanguage.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.comboBoxLanguage.Location = new System.Drawing.Point(304, 32);
- this.comboBoxLanguage.Name = "comboBoxLanguage";
- this.comboBoxLanguage.Size = new System.Drawing.Size(121, 21);
- this.comboBoxLanguage.TabIndex = 1;
- this.comboBoxLanguage.Text = "English (en)";
- //
- // labelLanguage
- //
- this.labelLanguage.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.labelLanguage.Location = new System.Drawing.Point(8, 34);
- this.labelLanguage.Name = "labelLanguage";
- this.labelLanguage.Size = new System.Drawing.Size(296, 16);
- this.labelLanguage.TabIndex = 8;
- this.labelLanguage.Text = "Language:";
- this.labelLanguage.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // listViewSeeAlso
- //
- this.listViewSeeAlso.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.listViewSeeAlso.GridLines = true;
- this.listViewSeeAlso.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
- this.listViewSeeAlso.LabelWrap = false;
- this.listViewSeeAlso.Location = new System.Drawing.Point(8, 392);
- this.listViewSeeAlso.Name = "listViewSeeAlso";
- this.listViewSeeAlso.Size = new System.Drawing.Size(416, 72);
- this.listViewSeeAlso.Sorting = System.Windows.Forms.SortOrder.Ascending;
- this.listViewSeeAlso.TabIndex = 4;
- this.listViewSeeAlso.View = System.Windows.Forms.View.List;
- //
- // GenericEditorForm
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(432, 477);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.listViewSeeAlso,
- this.labelLanguage,
- this.comboBoxLanguage,
- this.labelSeeAlso,
- this.textBoxRemarks,
- this.labelRemarks,
- this.textBoxSummary,
- this.labelSummary,
- this.toolBar});
- this.Name = "GenericEditorForm";
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
- this.Text = "GenericEditorForm";
- this.ResumeLayout(false);
-
- }
- #endregion
- }
-}
diff --git a/mcs/doctools/src/Gui/Gui.csproj b/mcs/doctools/src/Gui/Gui.csproj
deleted file mode 100644
index 6e5ec50d107..00000000000
--- a/mcs/doctools/src/Gui/Gui.csproj
+++ /dev/null
@@ -1,238 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{B76CBA27-ABBD-45FE-AFC3-A629BC13BAAE}"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "monodoc"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "WinExe"
- RootNamespace = "Mono.Doc.Gui"
- StartupObject = "Mono.Doc.Gui.GuiDriver"
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = "..\..\build\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "..\..\build\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "Core"
- Project = "{73F5A60D-A5E3-4852-B4C6-478275E733F9}"
- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
- />
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.Drawing"
- AssemblyName = "System.Drawing"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll"
- />
- <Reference
- Name = "System.Windows.Forms"
- AssemblyName = "System.Windows.Forms"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AboutForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AboutForm.resx"
- DependentUpon = "AboutForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "AssemblyTreeImages.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AssemblyTreeLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "DirectorySelectorForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "DirectorySelectorForm.resx"
- DependentUpon = "DirectorySelectorForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "EditPropertyForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "EditPropertyForm.resx"
- DependentUpon = "EditPropertyForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "ExampleCodeEditorForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ExampleCodeEditorForm.resx"
- DependentUpon = "ExampleCodeEditorForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "GenericEditorForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "GenericEditorForm.resx"
- DependentUpon = "GenericEditorForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "GuiDriver.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "GuiResources.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ImageResources.resx"
- Link = "..\..\etc\gui\ImageResources.resx"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "MainForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "MainForm.resx"
- DependentUpon = "MainForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "MdiToolBar.cs"
- SubType = "Component"
- BuildAction = "Compile"
- />
- <File
- RelPath = "MdiToolBar.resx"
- DependentUpon = "MdiToolBar.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "ProjectOptionsForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ProjectOptionsForm.resx"
- DependentUpon = "ProjectOptionsForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "TestingForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestingForm.resx"
- DependentUpon = "TestingForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "TextResources.resx"
- Link = "..\..\etc\gui\TextResources.resx"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "TypeEditorForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TypeEditorForm.resx"
- DependentUpon = "TypeEditorForm.cs"
- BuildAction = "EmbeddedResource"
- />
- <File
- RelPath = "UnexpectedErrorForm.cs"
- SubType = "Form"
- BuildAction = "Compile"
- />
- <File
- RelPath = "UnexpectedErrorForm.resx"
- DependentUpon = "UnexpectedErrorForm.cs"
- BuildAction = "EmbeddedResource"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/doctools/src/Gui/GuiDriver.cs b/mcs/doctools/src/Gui/GuiDriver.cs
deleted file mode 100644
index 21ccee8929a..00000000000
--- a/mcs/doctools/src/Gui/GuiDriver.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// GuiDriver.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- public abstract class GuiDriver
- {
- [STAThread]
- public static void Main(string[] args)
- {
- try
- {
- // DEBUG: testing UnexpectedErrorForm
- //throw new ApplicationException("test exception");
- Application.Run(new MainForm((args.Length > 0) ? args[0] : null));
- }
- catch (Exception e)
- {
- UnexpectedErrorForm error = new UnexpectedErrorForm(e);
- error.ShowDialog();
- }
- }
- }
-}
diff --git a/mcs/doctools/src/Gui/GuiResources.cs b/mcs/doctools/src/Gui/GuiResources.cs
deleted file mode 100644
index a3136c7b617..00000000000
--- a/mcs/doctools/src/Gui/GuiResources.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-// GuiResources.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Reflection;
-using System.Resources;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for Resources.
- /// </summary>
- public class GuiResources
- {
- private static ResourceManager imageMgr = null;
- private static ResourceManager textMgr = null;
-
- // this class cannot be instantiated
- private GuiResources()
- {
- }
-
- static GuiResources()
- {
- imageMgr = new ResourceManager("Mono.Doc.Gui.ImageResources", Assembly.GetExecutingAssembly());
- textMgr = new ResourceManager("Mono.Doc.Gui.TextResources", Assembly.GetExecutingAssembly());
- }
-
- public static Bitmap AssemblyTreeBitmap
- {
- get { return (Bitmap) imageMgr.GetObject("AssemblyTree.Bitmap"); }
- }
-
- public static Bitmap AboutMonodocBitmap
- {
- get { return (Bitmap) imageMgr.GetObject("AboutMonodoc.Bitmap"); }
- }
-
- public static Bitmap ErrorExplosionBitmap
- {
- get { return (Bitmap) imageMgr.GetObject("ErrorExplosion.Bitmap"); }
- }
-
- public static Icon OpenBookIcon
- {
- get { return (Icon) imageMgr.GetObject("OpenBook.Icon"); }
- }
-
- public static Icon ClosedBookIcon
- {
- get { return (Icon) imageMgr.GetObject("ClosedBook.Icon"); }
- }
-
- public static string GetString(string key)
- {
- return textMgr.GetString(key);
- }
- }
-}
diff --git a/mcs/doctools/src/Gui/MainForm.cs b/mcs/doctools/src/Gui/MainForm.cs
deleted file mode 100644
index 10c952db1d1..00000000000
--- a/mcs/doctools/src/Gui/MainForm.cs
+++ /dev/null
@@ -1,898 +0,0 @@
-// MainForm.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Drawing;
-using System.IO;
-using System.Reflection;
-using System.Windows.Forms;
-
-using Mono.Doc.Core;
-
-namespace Mono.Doc.Gui
-{
- public class MainForm : Form
- {
- #region Private Instance Fields
-
- // project
- private DocProject project;
- private string projectName;
-
- // mdi toolbar
- private MdiToolBar mdiToolBar;
-
- // main menu / items
- private MainMenu mainMenu;
- private MenuItem menuFile;
- private MenuItem menuFileNew;
- private MenuItem menuFileOpen;
- private MenuItem menuFileClose;
- private MenuItem menuFileSave;
- private MenuItem menuFileSaveAs;
- private MenuItem menuFileSeparator1;
- private MenuItem menuFileRecent;
- private MenuItem menuFileSeparator2;
- private MenuItem menuFileExit;
- private MenuItem menuEdit;
- private MenuItem menuWindow;
- private MenuItem menuWindowCascade;
- private MenuItem menuWindowTile;
- private MenuItem menuWindowTileHorizontal;
- private MenuItem menuDebug;
- private MenuItem menuDebugHaltAndCatchFire;
- private MenuItem menuDebugDisplayGeneric;
- private MenuItem menuHelp;
- private MenuItem menuHelpAbout;
-
- // tree context menu / items
- private ContextMenu treeProjectMenu;
- private MenuItem treeMenuProjectAddAssembly;
- private MenuItem treeMenuProjectAddDirectory;
- private MenuItem treeMenuProjectSeparator1;
- private MenuItem treeMenuProjectOptions;
- private ContextMenu treeShortcutMenu;
- private MenuItem treeMenuShortcutClear;
- private ContextMenu treeDirectoryMenu;
- private MenuItem treeMenuDirectoryAdd;
- private ContextMenu treeAssemblyMenu;
- private MenuItem treeMenuAssemblyAdd;
-
- // status bar
- private StatusBar status;
-
- // project tree
- private TreeView tree;
- private TreeNode treeProjectRootNode;
- private TreeNode treeShortcutsNode;
- private TreeNode treeDirectoryNode;
- private TreeNode treeAssemblyNode;
-
- // splitter
- private Splitter verticalSplitter;
-
- #endregion // Private Instance Fields
-
- #region Constructors and Destructors
-
- public MainForm(string projectFile)
- {
- this.project = new DocProject();
- this.project.Modified += new EventHandler(this.project_Modified );
-
- UpdateTitle();
-
- this.SuspendLayout();
-
- // this
- this.AutoScaleBaseSize = new Size(5, 13);
- this.IsMdiContainer = true;
- this.Name = "MainForm";
-
- // mdiToolBar
- this.mdiToolBar = new MdiToolBar();
- this.mdiToolBar.Dock = DockStyle.Top; // TODO: make this configurable
- this.mdiToolBar.TextAlign = ToolBarTextAlign.Right;
- this.mdiToolBar.Divider = true; // TODO: only if it's docked at the top.
- this.mdiToolBar.ImageList = AssemblyTreeImages.List;
- this.mdiToolBar.Appearance = ToolBarAppearance.Flat;
-
- // set initial size to 75% of the current screen
- // TODO: this should only happen if we have no size prefs
- // HACK: not sure how best to determine the current screen for multihead users
- Rectangle workArea = Screen.PrimaryScreen.WorkingArea;
- int x = (int) (workArea.Width * 0.75);
- int y = (int) (workArea.Height * 0.75);
- this.ClientSize = new Size(x, y);
-
- // won't completely remove flicker, but it helps
- this.SetStyle(ControlStyles.DoubleBuffer, true);
-
- // main menu / items
- this.mainMenu = new MainMenu();
- this.menuFile = new MenuItem();
- this.menuFileNew = new MenuItem();
- this.menuFileOpen = new MenuItem();
- this.menuFileClose = new MenuItem();
- this.menuFileSave = new MenuItem();
- this.menuFileSaveAs = new MenuItem();
- this.menuFileSeparator1 = new MenuItem();
- this.menuFileRecent = new MenuItem();
- this.menuFileSeparator2 = new MenuItem();
- this.menuFileExit = new MenuItem();
- this.menuEdit = new MenuItem();
- this.menuWindow = new MenuItem();
- this.menuWindowCascade = new MenuItem();
- this.menuWindowTile = new MenuItem();
- this.menuWindowTileHorizontal = new MenuItem();
- this.menuDebug = new MenuItem();
- this.menuDebugHaltAndCatchFire = new MenuItem();
- this.menuDebugDisplayGeneric = new MenuItem();
- this.menuHelp = new MenuItem();
- this.menuHelpAbout = new MenuItem();
-
- InitializeMainMenu();
-
- // status bar
- this.status = new StatusBar();
- this.status.Text = "Ready.";
-
- // project tree
- this.tree = new TreeView();
- this.treeAssemblyNode = new TreeNode();
- this.treeDirectoryNode = new TreeNode();
- this.treeProjectRootNode = new TreeNode();
- this.treeShortcutsNode = new TreeNode();
-
- InitializeTree();
-
- // vertical splitter
- // TODO: figure out how to store location in prefs
- this.verticalSplitter = new Splitter();
- this.verticalSplitter.Name = "verticalSplitter";
- this.verticalSplitter.TabStop = false;
-
- // add components and layout
- this.Menu = this.mainMenu;
- this.Controls.AddRange(new Control[] {
- this.mdiToolBar,
- this.verticalSplitter,
- this.tree,
- this.status
- });
-
- this.ResumeLayout(false);
-
- // project tree context menus
- this.treeProjectMenu = new ContextMenu();
- this.treeMenuProjectAddAssembly = new MenuItem();
- this.treeMenuProjectAddDirectory = new MenuItem();
- this.treeMenuProjectSeparator1 = new MenuItem();
- this.treeMenuProjectOptions = new MenuItem();
-
- this.treeShortcutMenu = new ContextMenu();
- this.treeMenuShortcutClear = new MenuItem();
-
- this.treeDirectoryMenu = new ContextMenu();
- this.treeMenuDirectoryAdd = new MenuItem();
-
- this.treeAssemblyMenu = new ContextMenu();
- this.treeMenuAssemblyAdd = new MenuItem();
-
- InitializeTreeContextMenu();
- }
-
- protected override void Dispose(bool disposing)
- {
- base.Dispose(disposing);
- }
-
- #endregion // Constructors and Destructors
-
- #region Private Instance Methods
-
- private void DisplayCorrectTreeMenu(Point showAt)
- {
- ContextMenu displayMenu = null;
-
- if (this.treeProjectRootNode == tree.SelectedNode)
- {
- displayMenu = this.treeProjectMenu;
- }
- else if (this.treeShortcutsNode == tree.SelectedNode)
- {
- displayMenu = this.treeShortcutMenu;
- }
- else if (this.treeDirectoryNode == tree.SelectedNode)
- {
- displayMenu = this.treeDirectoryMenu;
- }
- else if (this.treeAssemblyNode == tree.SelectedNode)
- {
- displayMenu = this.treeAssemblyMenu;
- }
-
- if (displayMenu != null)
- {
- displayMenu.Show(this.tree, showAt);
- }
- }
-
- private void Clear()
- {
- project.Clear();
- }
-
- private void CloseProject()
- {
- if (project.IsModified)
- {
- // TODO: i18n
- DialogResult r = MessageBox.Show(
- "Save changes to " + projectName + "?",
- "Save Modified Project",
- MessageBoxButtons.YesNoCancel,
- MessageBoxIcon.Question,
- MessageBoxDefaultButton.Button1
- );
-
- switch (r)
- {
- case DialogResult.Yes:
- SaveOrSaveAsProject();
- Clear();
- UpdateTitle();
- InitializeTree();
- break;
- case DialogResult.No:
- Clear();
- UpdateTitle();
- InitializeTree();
- break;
- }
- }
- else
- {
- Clear();
- UpdateTitle();
- InitializeTree();
- }
- }
-
- private void UpdateTitle()
- {
- string title = GuiResources.GetString("Form.Main.Title");
-
- if (project.IsNewProject)
- {
- projectName = DocProject.UntitledProjectName;
- }
- else
- {
- projectName = Path.GetFileName(project.FilePath);
- projectName = projectName.Substring(0, projectName.LastIndexOf('.'));
- }
-
- this.Text = projectName + (project.IsModified ? "*" : "") + " - " + title;
- }
-
- private void SaveOrSaveAsProject()
- {
- if (project.IsNewProject)
- {
- SaveAsProject();
- }
- else
- {
- SaveProject();
- }
- }
-
- private void SaveAsProject()
- {
- SaveFileDialog save = new SaveFileDialog();
-
- if (project.IsNewProject)
- {
- save.FileName =
- "." +
- Path.DirectorySeparatorChar +
- DocProject.UntitledProjectName +
- ".mdproj"; // TODO: abstract constant
- }
- else
- {
- save.FileName = project.FilePath;
- }
-
- save.Filter = "Monodoc Project Files (*.mdproj)|*.mdproj|All Files (*.*)|*.*"; // TODO: abstract constrant
- save.RestoreDirectory = true;
-
- if (save.ShowDialog() == DialogResult.OK)
- {
- project.FilePath = save.FileName;
- SaveProject();
- InitializeTree();
- }
- }
-
- private void SaveProject()
- {
- try
- {
- project.Save();
- UpdateTitle();
- }
- catch (MonodocException mde)
- {
- // TODO: error handling
- MessageBox.Show("MonodocException during project save: " + mde.Message);
- }
- catch (Exception e)
- {
- // TODO: better error handling
- MessageBox.Show("OTHER exception during project open: " + e.Message);
- }
- }
-
- private void LoadSourceDocuments()
- {
- int fileCount = 0;
-
- try
- {
- foreach (string dirName in this.project.XmlDirectories)
- {
- // TODO: abstract constant
- RecursiveFileList fileList = new RecursiveFileList(dirName, "*.xml");
-
- foreach (FileInfo f in fileList.Files)
- {
- this.status.Text = "Scanning file: " + f.Name;
- fileCount++;
- }
- }
-
- this.status.Text = "Scanned " + fileCount + " XML source files.";
- }
- catch (Exception e)
- {
- // TODO: better error handling
- MessageBox.Show("Problem while trying to scan XML source directories.\n" +
- e.Message + "\n" +
- e.StackTrace
- );
- }
- }
-
- private void OpenProject(string fileName)
- {
- try
- {
- project.Load(fileName);
- UpdateTitle();
- InitializeTree();
- LoadSourceDocuments();
- }
- catch (MonodocException mde)
- {
- // TODO: better error handling
- MessageBox.Show("MonodocException during project open: " + mde.Message);
- }
- catch (Exception e)
- {
- // TODO: better error handling
- MessageBox.Show("OTHER exception during project open: " + e.Message + "\n" + e.StackTrace);
- }
- }
-
- #endregion // Private Instance Methods
-
- #region Tree Init
-
- private void InitializeTree()
- {
-
- // tree
- this.tree.Dock = DockStyle.Left;
- this.tree.ImageList = AssemblyTreeImages.List;
- this.tree.ImageIndex = 0;
- this.tree.SelectedImageIndex = 0;
- this.tree.Name = "tree";
- this.tree.TabIndex = 1;
- this.tree.AfterSelect += new TreeViewEventHandler(this.tree_AfterSelect);
- this.tree.MouseUp += new MouseEventHandler(this.tree_MouseUp);
-
- // treeAssemblyNode
- this.treeAssemblyNode.Text = "Assemblies"; // TODO: i18n
- this.treeAssemblyNode.ImageIndex = AssemblyTreeImages.AssemblyClosed;
- this.treeAssemblyNode.SelectedImageIndex = AssemblyTreeImages.AssemblyClosed;
- this.treeAssemblyNode.Tag = "ASSEMBLIES"; // TODO: abstract constant
-
- // treeDirectoryNode
- this.treeDirectoryNode.Text = "Source Directories"; // TODO: i18n
- this.treeDirectoryNode.ImageIndex = AssemblyTreeImages.Shortcuts; // TODO: folder image
- this.treeDirectoryNode.SelectedImageIndex = AssemblyTreeImages.Shortcuts;
- this.treeDirectoryNode.Tag = "DIRECTORIES"; // TODO: abstract constant
-
- // treeProjectRootNode
- this.treeProjectRootNode.Text = projectName + " Project"; // TODO: i18n
- this.treeProjectRootNode.ImageIndex = AssemblyTreeImages.Shortcuts; // TODO: project image
- this.treeProjectRootNode.SelectedImageIndex = AssemblyTreeImages.Shortcuts;
- this.treeProjectRootNode.Tag = "PROJECT"; // TODO: abstract constant
-
- // treeShortcutsNode
- this.treeShortcutsNode.Text = "Shortcuts"; // TODO: i18n
- this.treeShortcutsNode.ImageIndex = AssemblyTreeImages.Shortcuts;
- this.treeShortcutsNode.SelectedImageIndex = AssemblyTreeImages.Shortcuts;
- this.treeShortcutsNode.Tag = "SHORTCUTS"; // TODO: abstract constant
-
- this.tree.BeginUpdate();
- this.tree.Nodes.Clear();
-
- // ugh. appears necessary to effectively rebuild the tree.
- TreeNode[] nodesToRemove = new TreeNode[] {
- this.treeAssemblyNode,
- this.treeDirectoryNode,
- this.treeProjectRootNode,
- this.treeShortcutsNode
- };
-
- foreach (TreeNode n in nodesToRemove)
- {
- n.Nodes.Clear();
-
- if (n.Parent != null)
- {
- n.Remove();
- }
- }
-
- tree.Nodes.Add(this.treeProjectRootNode);
-
- this.treeProjectRootNode.Nodes.AddRange(
- new TreeNode[] {
- this.treeShortcutsNode,
- this.treeDirectoryNode,
- this.treeAssemblyNode
- });
-
- // project xml directories
- foreach (string xmlDir in project.XmlDirectories)
- {
- TreeNode dirNode = new TreeNode(xmlDir);
- dirNode.ImageIndex = AssemblyTreeImages.Shortcuts; // TODO: folder image
- dirNode.SelectedImageIndex = AssemblyTreeImages.Shortcuts;
- dirNode.Tag = "DIRECTORY:" + xmlDir;
-
- this.treeDirectoryNode.Nodes.Add(dirNode);
- }
-
- // project assemblies
- try
- {
- foreach (string assemblyFile in this.project.AssemblyFiles)
- {
- AssemblyLoader asmLoader = new AssemblyLoader(assemblyFile);
- AssemblyTreeLoader treeLoader = new AssemblyTreeLoader(asmLoader);
-
- treeLoader.LoadNode(this.treeAssemblyNode);
- }
- }
- catch (ApplicationException ae)
- {
- // TODO: better error handling
- MessageBox.Show(ae.Message, "Error Loading project assemblies");
- }
-
- this.treeProjectRootNode.Expand();
- this.treeAssemblyNode.Expand();
- this.treeDirectoryNode.Expand();
- this.tree.EndUpdate();
- }
-
- #endregion // Tree Init
-
- #region Tree Events
-
- private void tree_AfterSelect(object sender, TreeViewEventArgs args)
- {
- this.status.Text = (string) args.Node.Tag;
- }
-
- private void tree_MouseUp(object sender, MouseEventArgs args)
- {
- if (args.Button == MouseButtons.Right)
- {
- tree.SelectedNode = tree.GetNodeAt(args.X, args.Y);
-
- if (tree.SelectedNode != null)
- {
- Point menuLoc = this.PointToClient(tree.PointToScreen(new Point(args.X, args.Y)));
- this.status.Text = "display tree menu at " + menuLoc.ToString();
- DisplayCorrectTreeMenu(menuLoc);
- }
- }
- }
-
- #endregion // Tree Events
-
- #region Tree Context Menu Init
-
- private void InitializeTreeContextMenu()
- {
- // treeProjectMenu
- this.treeProjectMenu.MenuItems.AddRange(
- new MenuItem[] {
- this.treeMenuProjectAddAssembly,
- this.treeMenuProjectAddDirectory,
- this.treeMenuProjectSeparator1,
- this.treeMenuProjectOptions
- });
-
- this.treeMenuProjectAddAssembly.Index = 0;
- this.treeMenuProjectAddAssembly.Text = "Add Assembly..."; // TODO: i18n
- this.treeMenuProjectAddAssembly.Click +=
- new EventHandler(this.treeMenuProjectAddAssembly_Click);
-
- this.treeMenuProjectAddDirectory.Index = 1;
- this.treeMenuProjectAddDirectory.Text = "Add Directory..."; // TODO: i18n
- this.treeMenuProjectAddDirectory.Click +=
- new EventHandler(this.treeMenuProjectAddDirectory_Click);
-
- this.treeMenuProjectSeparator1.Index = 2;
- this.treeMenuProjectSeparator1.Text = "-";
-
- this.treeMenuProjectOptions.Index = 3;
- this.treeMenuProjectOptions.Text = "Options..."; // TODO: i18n
- this.treeMenuProjectOptions.Click +=
- new EventHandler(this.treeMenuProjectOptions_Click);
-
- // treeShortcutMenu
- this.treeShortcutMenu.MenuItems.AddRange(
- new MenuItem[] {
- this.treeMenuShortcutClear
- });
-
- this.treeMenuShortcutClear.Index = 0;
- this.treeMenuShortcutClear.Text = "Clear Shortcuts"; // TODO: i18n
- this.treeMenuShortcutClear.Click += new EventHandler(this.treeMenuShortcutClear_Click);
-
- // treeDirectoryMenu
- this.treeDirectoryMenu.MenuItems.AddRange(
- new MenuItem[] {
- this.treeMenuDirectoryAdd
- });
-
- this.treeMenuDirectoryAdd.Index = 0;
- this.treeMenuDirectoryAdd.Text = "Add Directory..."; // TODO: i18n
- this.treeMenuDirectoryAdd.Click += new EventHandler(this.treeMenuDirectoryAdd_Click);
-
- // treeAssemblyMenu
- this.treeAssemblyMenu.MenuItems.AddRange(
- new MenuItem[] {
- this.treeMenuAssemblyAdd
- });
-
- this.treeMenuAssemblyAdd.Index = 0;
- this.treeMenuAssemblyAdd.Text = "Add Assembly..."; // TODO: i18n
- this.treeMenuAssemblyAdd.Click += new EventHandler(this.treeMenuAssemblyAdd_Click);
- }
-
- #endregion // Tree Context Menu Init
-
- #region Tree Context Menu Events
-
- private void treeMenuProjectAddAssembly_Click(object sender, EventArgs args)
- {
- MessageBox.Show("TODO: add assembly to project");
- }
-
- private void treeMenuProjectAddDirectory_Click(object sender, EventArgs args)
- {
- MessageBox.Show("TODO: add source directory to project");
- }
-
- private void treeMenuProjectOptions_Click(object sender, EventArgs args)
- {
- ProjectOptionsForm options = new ProjectOptionsForm(this.project);
- options.ShowDialog();
- options.Dispose();
- }
-
- private void treeMenuShortcutClear_Click(object sender, EventArgs args)
- {
- treeShortcutsNode.Nodes.Clear();
- }
-
- private void treeMenuDirectoryAdd_Click(object sender, EventArgs args)
- {
- this.treeMenuProjectAddDirectory_Click(sender, args);
- }
-
- private void treeMenuAssemblyAdd_Click(object sender, EventArgs args)
- {
- this.treeMenuProjectAddAssembly_Click(sender, args);
- }
-
- #endregion // Tree Context Menu Events
-
- #region Main Menu Init
-
- private void InitializeMainMenu()
- {
- // main
- this.mainMenu.MenuItems.AddRange(
- new MenuItem[] {
- this.menuFile,
- this.menuEdit,
- this.menuWindow,
- this.menuDebug,
- this.menuHelp
- });
-
- // File
- this.menuFile.Index = 0;
- this.menuFile.Text = "File"; // TODO: i18n
-
- this.menuFile.MenuItems.AddRange(
- new MenuItem[] {
- this.menuFileNew,
- this.menuFileOpen,
- this.menuFileClose,
- this.menuFileSave,
- this.menuFileSaveAs,
- this.menuFileSeparator1,
- this.menuFileRecent,
- this.menuFileSeparator2,
- this.menuFileExit
- });
-
- // File|New Project
- this.menuFileNew.Index = 0;
- this.menuFileNew.Text = "New Project"; // TODO: i18n
- this.menuFileNew.Click += new EventHandler(this.menuFileNew_Click);
-
- // File|Open Project
- this.menuFileOpen.Index = 1;
- this.menuFileOpen.Text = "Open Project..."; // TODO: i18n
- this.menuFileOpen.Click += new EventHandler(this.menuFileOpen_Click);
-
-
- // File|Save Project
- this.menuFileSave.Index = 2;
- this.menuFileSave.Text = "Save Project"; // TODO: i18n
- this.menuFileSave.Click += new EventHandler(this.menuFileSave_Click);
-
- // File|Save Project As
- this.menuFileSaveAs.Index = 3;
- this.menuFileSaveAs.Text = "Save Project As..."; // TODO: i18n
- this.menuFileSaveAs.Click += new EventHandler(this.menuFileSaveAs_Click);
-
- // File|Separator1
- this.menuFileSeparator1.Index = 4;
- this.menuFileSeparator1.Text = "-";
-
- // File|Recent Projects
- this.menuFileRecent.Index = 5;
- this.menuFileRecent.Text = "Recent Projects"; // TODO: i18n
-
- // File|Separator2
- this.menuFileSeparator2.Index = 6;
- this.menuFileSeparator2.Text = "-";
-
- // File|Close Project
- this.menuFileClose.Index = 7;
- this.menuFileClose.Text = "Close Project"; // TODO: i18n
- this.menuFileClose.Click += new EventHandler(this.menuFileClose_Click);
-
- // File|Exit
- this.menuFileExit.Index = 8;
- this.menuFileExit.Text = "Exit"; // TODO: i18n
- this.menuFileExit.Click += new EventHandler(this.menuFileExit_Click);
-
- // Edit
- this.menuEdit.Index = 1;
- this.menuEdit.Text = "Edit"; // TODO: i18n
-
- // Window
- this.menuWindow.Index = 2;
- this.menuWindow.Text = "Window"; // TODO: i18n
- this.menuWindow.MdiList = true;
-
- this.menuWindow.MenuItems.AddRange(
- new MenuItem[] {
- this.menuWindowCascade,
- this.menuWindowTile,
- this.menuWindowTileHorizontal
- });
-
- // Window|Cascade
- this.menuWindowCascade.Index = 0;
- this.menuWindowCascade.Text = "Cascade"; // TODO: i18n
- this.menuWindowCascade.Click += new EventHandler(this.menuWindowCascade_Click);
-
- // Window|Tile
- this.menuWindowTile.Index = 1;
- this.menuWindowTile.Text = "Tile"; // TODO: i18n
- this.menuWindowTile.Click += new EventHandler(this.menuWindowTile_Click);
-
- // Window|Tile Horizontal
- this.menuWindowTileHorizontal.Index = 2;
- this.menuWindowTileHorizontal.Text = "Tile Horizontal"; // TODO: i18n
- this.menuWindowTileHorizontal.Click += new EventHandler(this.menuWindowTileHorizontal_Click);
-
- // DEBUG
- this.menuDebug.Index = 3;
- this.menuDebug.Text = "DEBUG";
-
- this.menuDebug.MenuItems.AddRange(
- new MenuItem[] {
- this.menuDebugHaltAndCatchFire,
- this.menuDebugDisplayGeneric
- });
-
- // DEBUG|Halt and Catch Fire
- this.menuDebugHaltAndCatchFire.Index = 0;
- this.menuDebugHaltAndCatchFire.Text = "Halt and Catch Fire";
- this.menuDebugHaltAndCatchFire.Click += new EventHandler(this.menuDebugHaltAndCatchFire_Click);
-
- // DEBUG|Display Generic
- this.menuDebugDisplayGeneric.Index = 1;
- this.menuDebugDisplayGeneric.Text = "Display Generic Form";
- this.menuDebugDisplayGeneric.Click += new EventHandler(this.menuDebugDisplayGeneric_Click);
-
- // Help
- this.menuHelp.Index = 4;
- this.menuHelp.Text = "Help"; // TODO: i18n
-
- this.menuHelp.MenuItems.AddRange(
- new MenuItem[] {
- this.menuHelpAbout
- });
-
- // Help|About
- this.menuHelpAbout.Index = 0;
- this.menuHelpAbout.Text = "About..."; // TODO: i18n
- this.menuHelpAbout.Click += new EventHandler(this.menuHelpAbout_Click);
- }
-
- #endregion // Main Menu Init
-
- #region Main Menu Events
-
- private void menuFileNew_Click(object sender, EventArgs e)
- {
- CloseProject();
- }
-
- private void menuFileOpen_Click(object sender, EventArgs e)
- {
- OpenFileDialog open = new OpenFileDialog();
- open.Filter = "Monodoc Project Files (*.mdproj)|*.mdproj| All Files (*.*)|*.*";
-
- if (open.ShowDialog() == DialogResult.OK)
- {
- OpenProject(open.FileName);
- }
- }
-
- private void menuFileClose_Click(object sender, EventArgs e)
- {
- CloseProject();
- }
-
- private void menuFileSave_Click(object sender, EventArgs e)
- {
- if (project.IsNewProject || project.IsModified)
- {
- SaveOrSaveAsProject();
- }
- }
-
- private void menuFileSaveAs_Click(object sender, EventArgs e)
- {
- SaveAsProject();
- }
-
- private void menuFileExit_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
-
- private void menuWindowCascade_Click(object sender, EventArgs e)
- {
- this.LayoutMdi(MdiLayout.Cascade);
- }
-
- private void menuWindowTile_Click(object sender, EventArgs e)
- {
- this.LayoutMdi(MdiLayout.TileVertical);
- }
-
- private void menuWindowTileHorizontal_Click(object sender, EventArgs e)
- {
- this.LayoutMdi(MdiLayout.TileHorizontal);
- }
-
- private void menuDebugHaltAndCatchFire_Click(object sender, EventArgs e)
- {
- throw new ApplicationException("Test Exception Message",
- new ApplicationException("Inner Exception Message")
- );
- }
-
- private void menuDebugDisplayGeneric_Click(object sender, EventArgs e)
- {
- GenericEditorForm generic = new GenericEditorForm();
- generic.MdiParent = this;
- generic.Tag = "mditoolbarimageindex[1]";
- generic.Show();
- }
-
- private void menuHelpAbout_Click(object sender, EventArgs e)
- {
- Form aboutForm = new AboutForm();
- aboutForm.ShowDialog();
- }
-
- #endregion // Main Menu Events
-
- #region Other Events and Handlers
-
- private void project_Modified(object sender, EventArgs args)
- {
- UpdateTitle();
- InitializeTree();
- }
-
- protected override void OnClosing(CancelEventArgs e)
- {
- base.OnClosing(e);
-
- // this code is nearly duplicated from CloseProject()
- if (project.IsModified)
- {
- // TODO: i18n
- DialogResult r = MessageBox.Show(
- "Save changes to " + projectName + "?",
- "Save Modified Project",
- MessageBoxButtons.YesNoCancel,
- MessageBoxIcon.Question,
- MessageBoxDefaultButton.Button1
- );
-
- switch (r)
- {
- case DialogResult.Yes:
- SaveOrSaveAsProject();
- break;
- case DialogResult.Cancel:
- e.Cancel = true;
- break;
- }
- }
- }
- #endregion // Other Events and Handlers
- }
-}
diff --git a/mcs/doctools/src/Gui/MdiToolBar.cs b/mcs/doctools/src/Gui/MdiToolBar.cs
deleted file mode 100644
index 3bdc16e8b78..00000000000
--- a/mcs/doctools/src/Gui/MdiToolBar.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-// MdiToolBar.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- public class MdiToolBar : ToolBar
- {
- #region Private Instance Fields
-
- private Hashtable mdiChildren = null;
- private Form currentMdiChild = null;
-
- #endregion // Private Instance Fields
-
- #region Constructors and Destructors
-
- public MdiToolBar() : base()
- {
- this.mdiChildren = new Hashtable();
- }
-
- #endregion // Constructors and Destructors
-
- #region Event Handlers
-
- private void mdiParent_MdiChildActivate(object sender, EventArgs args)
- {
- Form activeMdiChild = ((Form) sender).ActiveMdiChild;
-
- if (activeMdiChild != null)
- {
- if (this.mdiChildren[activeMdiChild] == null)
- {
- // need a new button
- ToolBarButton newButton = new ToolBarButton(activeMdiChild.Text);
- newButton.Style = ToolBarButtonStyle.ToggleButton;
- this.mdiChildren[activeMdiChild] = newButton;
- activeMdiChild.Closing += new CancelEventHandler(this.mdiChild_Closing);
-
- // tooltip
- newButton.ToolTipText = activeMdiChild.Text;
-
- // separators
- if ((this.Appearance == ToolBarAppearance.Flat) && (this.Buttons.Count > 0))
- {
- ToolBarButton sep = new ToolBarButton();
- sep.Style = ToolBarButtonStyle.Separator;
-
- this.Buttons.Add(sep);
- }
-
- // image index. if the mdi child form's Tag property is a string
- // and contains the text "mditoolbarimageindex[n]", where n is
- // an integer, the associated button's ImageIndex property will be
- // set to n.
-
- String formTag = activeMdiChild.Tag as string;
-
- if (formTag != null)
- {
- string lookFor = "mditoolbarimageindex[";
- int index = formTag.IndexOf(lookFor);
-
- if (index != -1)
- {
- int startIndex = index + lookFor.Length;
- int endIndex = formTag.IndexOf("]", startIndex);
- string imageIndexStr = formTag.Substring(startIndex, endIndex - startIndex);
-
- MessageBox.Show("mditoolbar: imageIndexStr: " + imageIndexStr);
-
- try
- {
- newButton.ImageIndex = int.Parse(imageIndexStr);
- }
- catch
- {
- }
- }
- }
- else
- {
- // use default index
- newButton.ImageIndex = 0;
- }
-
- this.Buttons.Add(newButton);
- }
-
- this.CurrentMdiChild = activeMdiChild;
- }
- else
- {
- // last MDI child removed; clean up
- this.mdiChildren.Clear();
- this.Buttons.Clear();
- this.currentMdiChild = null;
- }
- }
-
- private void mdiChild_Closing(object sender, CancelEventArgs args)
- {
- ToolBarButton b = (ToolBarButton) this.mdiChildren[sender];
-
- // deal with separators
- if ((this.Appearance == ToolBarAppearance.Flat) && (this.Buttons.Count > 1))
- {
- int bIndex = this.Buttons.IndexOf(b);
-
- if (bIndex == 0)
- {
- this.Buttons.RemoveAt(bIndex + 1);
- }
- else
- {
- this.Buttons.RemoveAt(bIndex - 1);
- }
- }
-
- this.Buttons.Remove(b);
- this.mdiChildren.Remove(sender);
- }
-
- #endregion // Event Handlers
-
- #region Overridden Event Handlers
-
- protected override void OnButtonClick(ToolBarButtonClickEventArgs args)
- {
- base.OnButtonClick(args);
-
- args.Button.Pushed = true;
-
- // linear search, but double-hashing seems worthless.
- foreach (Form keyChild in this.mdiChildren.Keys)
- {
- if (args.Button == this.mdiChildren[keyChild])
- {
- keyChild.Activate();
- break;
- }
- }
- }
-
- protected override void OnParentChanged(EventArgs args)
- {
- base.OnParentChanged(args);
-
- // TODO: potential for multiple registration of event handler?
- if (this.Parent is Form && ((Form) this.Parent).IsMdiContainer)
- {
- ((Form) this.Parent).MdiChildActivate
- += new EventHandler(this.mdiParent_MdiChildActivate);
- }
- }
-
- #endregion // Overridden Event Handlers
-
- #region Private Instance Properties
-
- private Form CurrentMdiChild
- {
- get { return this.currentMdiChild; }
- set
- {
- if (this.currentMdiChild != null)
- {
- ToolBarButton child = this.mdiChildren[this.currentMdiChild] as ToolBarButton;
-
- if (child != null)
- {
- child.Pushed = false;
- }
- }
-
- ((ToolBarButton) this.mdiChildren[value]).Pushed = true;
- this.currentMdiChild = value;
- }
- }
-
- #endregion // Private Instance Properties
- }
-}
diff --git a/mcs/doctools/src/Gui/ProjectOptionsForm.cs b/mcs/doctools/src/Gui/ProjectOptionsForm.cs
deleted file mode 100644
index 1b67d749ce5..00000000000
--- a/mcs/doctools/src/Gui/ProjectOptionsForm.cs
+++ /dev/null
@@ -1,560 +0,0 @@
-// ProjectOptionsForm.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using Mono.Doc.Core;
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for ProjectOptionsForm.
- /// </summary>
- public class ProjectOptionsForm : System.Windows.Forms.Form
- {
- private DocProject project;
- private bool isModified;
-
- private System.Windows.Forms.Button buttonOK;
- private System.Windows.Forms.Button buttonCancel;
- private System.Windows.Forms.Button buttonApply;
- private System.Windows.Forms.GroupBox groupBoxAssemblies;
- private System.Windows.Forms.Button buttonAssemblyRemove;
- private System.Windows.Forms.Button buttonAssemblyAdd;
- private System.Windows.Forms.ListBox listBoxAssembliesToDocument;
- private System.Windows.Forms.GroupBox groupBoxDirectories;
- private System.Windows.Forms.Button buttonDirectoryRemove;
- private System.Windows.Forms.Button buttonDirectoryAdd;
- private System.Windows.Forms.ListBox listBoxXmlSourceDirectories;
- private System.Windows.Forms.GroupBox groupBoxProperties;
- private System.Windows.Forms.ListView listViewProperties;
- private System.Windows.Forms.ToolBar toolBarProperties;
- private System.Windows.Forms.ToolBarButton toolBarButtonNewProperty;
- private System.Windows.Forms.ToolBarButton toolBarButtonEditProperty;
- private System.Windows.Forms.ToolBarButton toolBarButtonRemoveProperty;
- private System.Windows.Forms.ColumnHeader columnHeaderName;
- private System.Windows.Forms.ColumnHeader columnHeaderValue;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public ProjectOptionsForm(DocProject project)
- {
- //this.SetStyle(ControlStyles.DoubleBuffer, true);
-
- this.project = project;
- this.isModified = false;
-
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
-
- this.toolBarProperties.ImageList = AssemblyTreeImages.List; // TODO: need real images
-
- // load list of assemblies
- this.listBoxAssembliesToDocument.BeginUpdate();
- this.listBoxAssembliesToDocument.Items.Clear();
-
- foreach (string assemblyFile in project.AssemblyFiles)
- {
- this.listBoxAssembliesToDocument.Items.Add(assemblyFile);
- }
-
- this.listBoxAssembliesToDocument.EndUpdate();
-
- // load list of XML directories
- this.listBoxXmlSourceDirectories.BeginUpdate();
- this.listBoxXmlSourceDirectories.Items.Clear();
-
- foreach (string xmlDir in project.XmlDirectories)
- {
- this.listBoxXmlSourceDirectories.Items.Add(xmlDir);
- }
-
- this.listBoxXmlSourceDirectories.EndUpdate();
-
- // load properties
- foreach (string name in project.Properties.Keys)
- {
- ListViewItem entry = new ListViewItem(name);
-
- entry.SubItems.Add(project.Properties[name] as string);
- this.listViewProperties.Items.Add(entry);
- }
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.buttonOK = new System.Windows.Forms.Button();
- this.buttonCancel = new System.Windows.Forms.Button();
- this.buttonApply = new System.Windows.Forms.Button();
- this.groupBoxAssemblies = new System.Windows.Forms.GroupBox();
- this.buttonAssemblyRemove = new System.Windows.Forms.Button();
- this.buttonAssemblyAdd = new System.Windows.Forms.Button();
- this.listBoxAssembliesToDocument = new System.Windows.Forms.ListBox();
- this.groupBoxDirectories = new System.Windows.Forms.GroupBox();
- this.buttonDirectoryRemove = new System.Windows.Forms.Button();
- this.buttonDirectoryAdd = new System.Windows.Forms.Button();
- this.listBoxXmlSourceDirectories = new System.Windows.Forms.ListBox();
- this.groupBoxProperties = new System.Windows.Forms.GroupBox();
- this.toolBarProperties = new System.Windows.Forms.ToolBar();
- this.toolBarButtonNewProperty = new System.Windows.Forms.ToolBarButton();
- this.toolBarButtonEditProperty = new System.Windows.Forms.ToolBarButton();
- this.toolBarButtonRemoveProperty = new System.Windows.Forms.ToolBarButton();
- this.listViewProperties = new System.Windows.Forms.ListView();
- this.columnHeaderName = new System.Windows.Forms.ColumnHeader();
- this.columnHeaderValue = new System.Windows.Forms.ColumnHeader();
- this.groupBoxAssemblies.SuspendLayout();
- this.groupBoxDirectories.SuspendLayout();
- this.groupBoxProperties.SuspendLayout();
- this.SuspendLayout();
- //
- // buttonOK
- //
- this.buttonOK.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.buttonOK.Location = new System.Drawing.Point(168, 394);
- this.buttonOK.Name = "buttonOK";
- this.buttonOK.TabIndex = 10;
- this.buttonOK.Text = "OK";
- this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
- //
- // buttonCancel
- //
- this.buttonCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonCancel.Location = new System.Drawing.Point(344, 394);
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.Size = new System.Drawing.Size(72, 23);
- this.buttonCancel.TabIndex = 11;
- this.buttonCancel.Text = "Cancel";
- this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
- //
- // buttonApply
- //
- this.buttonApply.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
- this.buttonApply.Location = new System.Drawing.Point(256, 394);
- this.buttonApply.Name = "buttonApply";
- this.buttonApply.TabIndex = 12;
- this.buttonApply.Text = "Apply";
- this.buttonApply.Click += new System.EventHandler(this.buttonApply_Click);
- //
- // groupBoxAssemblies
- //
- this.groupBoxAssemblies.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.buttonAssemblyRemove,
- this.buttonAssemblyAdd,
- this.listBoxAssembliesToDocument});
- this.groupBoxAssemblies.Location = new System.Drawing.Point(9, 8);
- this.groupBoxAssemblies.Name = "groupBoxAssemblies";
- this.groupBoxAssemblies.Size = new System.Drawing.Size(408, 96);
- this.groupBoxAssemblies.TabIndex = 17;
- this.groupBoxAssemblies.TabStop = false;
- this.groupBoxAssemblies.Text = "Assemblies";
- //
- // buttonAssemblyRemove
- //
- this.buttonAssemblyRemove.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.buttonAssemblyRemove.Location = new System.Drawing.Point(320, 40);
- this.buttonAssemblyRemove.Name = "buttonAssemblyRemove";
- this.buttonAssemblyRemove.Size = new System.Drawing.Size(80, 19);
- this.buttonAssemblyRemove.TabIndex = 8;
- this.buttonAssemblyRemove.Text = "Remove";
- this.buttonAssemblyRemove.Click += new System.EventHandler(this.buttonAssemblyRemove_Click);
- //
- // buttonAssemblyAdd
- //
- this.buttonAssemblyAdd.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.buttonAssemblyAdd.Location = new System.Drawing.Point(320, 16);
- this.buttonAssemblyAdd.Name = "buttonAssemblyAdd";
- this.buttonAssemblyAdd.Size = new System.Drawing.Size(80, 19);
- this.buttonAssemblyAdd.TabIndex = 7;
- this.buttonAssemblyAdd.Text = "Add...";
- this.buttonAssemblyAdd.Click += new System.EventHandler(this.buttonAssemblyAdd_Click);
- //
- // listBoxAssembliesToDocument
- //
- this.listBoxAssembliesToDocument.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.listBoxAssembliesToDocument.Location = new System.Drawing.Point(8, 16);
- this.listBoxAssembliesToDocument.Name = "listBoxAssembliesToDocument";
- this.listBoxAssembliesToDocument.Size = new System.Drawing.Size(304, 69);
- this.listBoxAssembliesToDocument.TabIndex = 6;
- //
- // groupBoxDirectories
- //
- this.groupBoxDirectories.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.buttonDirectoryRemove,
- this.buttonDirectoryAdd,
- this.listBoxXmlSourceDirectories});
- this.groupBoxDirectories.Location = new System.Drawing.Point(9, 112);
- this.groupBoxDirectories.Name = "groupBoxDirectories";
- this.groupBoxDirectories.Size = new System.Drawing.Size(408, 96);
- this.groupBoxDirectories.TabIndex = 18;
- this.groupBoxDirectories.TabStop = false;
- this.groupBoxDirectories.Text = "XML Source Directories";
- //
- // buttonDirectoryRemove
- //
- this.buttonDirectoryRemove.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.buttonDirectoryRemove.Location = new System.Drawing.Point(320, 40);
- this.buttonDirectoryRemove.Name = "buttonDirectoryRemove";
- this.buttonDirectoryRemove.Size = new System.Drawing.Size(80, 19);
- this.buttonDirectoryRemove.TabIndex = 8;
- this.buttonDirectoryRemove.Text = "Remove";
- this.buttonDirectoryRemove.Click += new System.EventHandler(this.buttonDirectoryRemove_Click);
- //
- // buttonDirectoryAdd
- //
- this.buttonDirectoryAdd.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.buttonDirectoryAdd.Location = new System.Drawing.Point(320, 16);
- this.buttonDirectoryAdd.Name = "buttonDirectoryAdd";
- this.buttonDirectoryAdd.Size = new System.Drawing.Size(80, 19);
- this.buttonDirectoryAdd.TabIndex = 7;
- this.buttonDirectoryAdd.Text = "Add...";
- this.buttonDirectoryAdd.Click += new System.EventHandler(this.buttonDirectoryAdd_Click);
- //
- // listBoxXmlSourceDirectories
- //
- this.listBoxXmlSourceDirectories.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.listBoxXmlSourceDirectories.Location = new System.Drawing.Point(8, 16);
- this.listBoxXmlSourceDirectories.Name = "listBoxXmlSourceDirectories";
- this.listBoxXmlSourceDirectories.Size = new System.Drawing.Size(304, 69);
- this.listBoxXmlSourceDirectories.TabIndex = 6;
- //
- // groupBoxProperties
- //
- this.groupBoxProperties.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.toolBarProperties,
- this.listViewProperties});
- this.groupBoxProperties.Location = new System.Drawing.Point(9, 216);
- this.groupBoxProperties.Name = "groupBoxProperties";
- this.groupBoxProperties.Size = new System.Drawing.Size(408, 168);
- this.groupBoxProperties.TabIndex = 19;
- this.groupBoxProperties.TabStop = false;
- this.groupBoxProperties.Text = "Properties";
- //
- // toolBarProperties
- //
- this.toolBarProperties.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.toolBarProperties.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
- this.toolBarButtonNewProperty,
- this.toolBarButtonEditProperty,
- this.toolBarButtonRemoveProperty});
- this.toolBarProperties.Divider = false;
- this.toolBarProperties.Dock = System.Windows.Forms.DockStyle.None;
- this.toolBarProperties.DropDownArrows = true;
- this.toolBarProperties.Location = new System.Drawing.Point(8, 16);
- this.toolBarProperties.Name = "toolBarProperties";
- this.toolBarProperties.ShowToolTips = true;
- this.toolBarProperties.Size = new System.Drawing.Size(392, 23);
- this.toolBarProperties.TabIndex = 2;
- this.toolBarProperties.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right;
- this.toolBarProperties.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBarProperties_ButtonClick);
- //
- // toolBarButtonNewProperty
- //
- this.toolBarButtonNewProperty.ImageIndex = 0;
- this.toolBarButtonNewProperty.ToolTipText = "New Property";
- //
- // toolBarButtonEditProperty
- //
- this.toolBarButtonEditProperty.Enabled = false;
- this.toolBarButtonEditProperty.ImageIndex = 1;
- this.toolBarButtonEditProperty.ToolTipText = "Edit Property";
- //
- // toolBarButtonRemoveProperty
- //
- this.toolBarButtonRemoveProperty.Enabled = false;
- this.toolBarButtonRemoveProperty.ImageIndex = 2;
- this.toolBarButtonRemoveProperty.ToolTipText = "Remove Property";
- //
- // listViewProperties
- //
- this.listViewProperties.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this.listViewProperties.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeaderName,
- this.columnHeaderValue});
- this.listViewProperties.FullRowSelect = true;
- this.listViewProperties.GridLines = true;
- this.listViewProperties.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
- this.listViewProperties.Location = new System.Drawing.Point(8, 40);
- this.listViewProperties.Name = "listViewProperties";
- this.listViewProperties.Size = new System.Drawing.Size(392, 120);
- this.listViewProperties.TabIndex = 1;
- this.listViewProperties.View = System.Windows.Forms.View.Details;
- this.listViewProperties.SelectedIndexChanged += new System.EventHandler(this.listViewProperties_SelectedIndexChanged);
- //
- // columnHeaderName
- //
- this.columnHeaderName.Text = "Name";
- this.columnHeaderName.Width = 171;
- //
- // columnHeaderValue
- //
- this.columnHeaderValue.Text = "Value";
- this.columnHeaderValue.Width = 217;
- //
- // ProjectOptionsForm
- //
- this.AcceptButton = this.buttonOK;
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.CancelButton = this.buttonCancel;
- this.ClientSize = new System.Drawing.Size(426, 423);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.groupBoxProperties,
- this.groupBoxAssemblies,
- this.buttonApply,
- this.buttonCancel,
- this.buttonOK,
- this.groupBoxDirectories});
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.Name = "ProjectOptionsForm";
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.Text = "Monodoc Project Options";
- this.groupBoxAssemblies.ResumeLayout(false);
- this.groupBoxDirectories.ResumeLayout(false);
- this.groupBoxProperties.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- #region Private Instance Methods
-
- private void SaveProjectChanges()
- {
- project.AssemblyFiles.Clear();
-
- foreach (string assemblyFile in this.listBoxAssembliesToDocument.Items)
- {
- project.AssemblyFiles.Add(assemblyFile);
- }
-
- project.XmlDirectories.Clear();
-
- foreach (string xmlDir in this.listBoxXmlSourceDirectories.Items)
- {
- project.XmlDirectories.Add(xmlDir);
- }
-
- project.Properties.Clear();
-
- foreach (ListViewItem prop in this.listViewProperties.Items)
- {
- project.Properties[prop.SubItems[0].Text] = prop.SubItems[1].Text;
- }
-
- project.IsModified = true;
- this.isModified = false;
- }
-
- #endregion // Private Instance Methods
-
- private void buttonCancel_Click(object sender, System.EventArgs e)
- {
- this.Close();
- }
-
- private void buttonApply_Click(object sender, System.EventArgs e)
- {
- if (this.isModified)
- {
- SaveProjectChanges();
- }
- }
-
- private void buttonOK_Click(object sender, System.EventArgs e)
- {
- if (this.isModified)
- {
- SaveProjectChanges();
- }
-
- this.Close();
- }
-
- private void buttonAssemblyAdd_Click(object sender, System.EventArgs e)
- {
- OpenFileDialog open = new OpenFileDialog();
- open.Filter = "Assembly Files (*.dll; *.exe)|*.dll; *.exe|All Files (*.*)|*.*";
-
- if (open.ShowDialog() == DialogResult.OK)
- {
- this.listBoxAssembliesToDocument.Items.Add(open.FileName);
- this.isModified = true;
- }
- }
-
- private void buttonAssemblyRemove_Click(object sender, System.EventArgs e)
- {
- this.listBoxAssembliesToDocument.Items.Remove(
- this.listBoxAssembliesToDocument.SelectedItem
- );
- this.isModified = true;
- }
-
- private void buttonDirectoryAdd_Click(object sender, System.EventArgs e)
- {
- DirectorySelectorForm dirSel = new DirectorySelectorForm();
-
- if (dirSel.ShowDialog() == DialogResult.OK)
- {
- this.listBoxXmlSourceDirectories.Items.Add(dirSel.DirectoryName);
- this.isModified = true;
- }
-
- dirSel.Dispose();
- }
- private void buttonDirectoryRemove_Click(object sender, System.EventArgs e)
- {
- this.listBoxXmlSourceDirectories.Items.Remove(
- this.listBoxXmlSourceDirectories.SelectedItem
- );
- this.isModified = true;
- }
-
- private void toolBarProperties_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
- {
- if (e.Button == toolBarButtonNewProperty)
- {
- EditPropertyForm edit = new EditPropertyForm();
-
- if (edit.ShowDialog() == DialogResult.OK)
- {
- ListViewItem item = null;
-
- foreach (ListViewItem existingItem in this.listViewProperties.Items)
- {
- if (existingItem.Text == edit.PropertyName)
- {
- item = existingItem;
- break;
- }
- }
-
- if (item != null)
- {
- DialogResult dr = MessageBox.Show(
- "A property named " + edit.PropertyName + " already exists. Overwrite?",
- "Property Exists", MessageBoxButtons.YesNo, MessageBoxIcon.Question
- );
-
- if (dr == DialogResult.Yes && item.SubItems[1].Text != edit.PropertyValue)
- {
- item.SubItems[0].Text = edit.PropertyName;
- item.SubItems[1].Text = edit.PropertyValue;
- this.isModified = true;
- }
- }
- else
- {
- ListViewItem newProperty = new ListViewItem(edit.PropertyName);
-
- newProperty.SubItems.Add(edit.PropertyValue);
- this.listViewProperties.Items.Add(newProperty);
-
- newProperty.Selected = true;
- this.isModified = true;
- }
- }
-
- edit.Dispose();
- }
- else if (e.Button == toolBarButtonEditProperty)
- {
- if (this.listViewProperties.SelectedItems.Count > 0)
- {
- ListViewItem selectedItem = this.listViewProperties.SelectedItems[0];
- EditPropertyForm edit = new EditPropertyForm();
- edit.PropertyName = selectedItem.SubItems[0].Text;
- edit.PropertyValue = selectedItem.SubItems[1].Text;
-
- if (edit.ShowDialog(this) == DialogResult.OK &&
- (selectedItem.SubItems[0].Text != edit.PropertyName ||
- selectedItem.SubItems[1].Text != edit.PropertyValue))
- {
- selectedItem.SubItems[0].Text = edit.PropertyName;
- selectedItem.SubItems[1].Text = edit.PropertyValue;
- selectedItem.Selected = true;
- this.isModified = true;
- }
-
- edit.Dispose();
- }
- }
- else if (e.Button == toolBarButtonRemoveProperty)
- {
- foreach (ListViewItem item in this.listViewProperties.SelectedItems)
- {
- item.Remove();
- }
- }
- }
-
- private void listViewProperties_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- if (this.listViewProperties.SelectedItems.Count > 0)
- {
- this.toolBarButtonEditProperty.Enabled = true;
- this.toolBarButtonRemoveProperty.Enabled = true;
- }
- else
- {
- this.toolBarButtonEditProperty.Enabled = false;
- this.toolBarButtonRemoveProperty.Enabled = false;
- }
- }
- }
-}
diff --git a/mcs/doctools/src/Gui/TypeEditorForm.cs b/mcs/doctools/src/Gui/TypeEditorForm.cs
deleted file mode 100644
index 7fa9784276e..00000000000
--- a/mcs/doctools/src/Gui/TypeEditorForm.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-// TypeEditorForm.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-
-namespace Mono.Doc.Gui
-{
- public class TypeEditorForm : GenericEditorForm
- {
- private System.Windows.Forms.Label labelMembers;
- private System.Windows.Forms.ComboBox comboBoxMembers;
-
- private void InitializeComponent()
- {
- this.labelMembers = new System.Windows.Forms.Label();
- this.comboBoxMembers = new System.Windows.Forms.ComboBox();
- this.SuspendLayout();
- //
- // toolBar
- //
- //this.toolBar.ButtonSize = new System.Drawing.Size(43, 22);
- this.toolBar.Visible = true;
- //
- // labelSummary
- //
- this.labelSummary.Visible = true;
- //
- // textBoxSummary
- //
- this.textBoxSummary.Visible = true;
- //
- // labelRemarks
- //
- this.labelRemarks.Visible = true;
- //
- // textBoxRemarks
- //
- this.textBoxRemarks.Visible = true;
- //
- // labelSeeAlso
- //
- this.labelSeeAlso.Visible = true;
- //
- // comboBoxLanguage
- //
- this.comboBoxLanguage.ItemHeight = 13;
- this.comboBoxLanguage.Visible = true;
- //
- // labelLanguage
- //
- this.labelLanguage.Location = new System.Drawing.Point(232, 34);
- this.labelLanguage.Size = new System.Drawing.Size(72, 16);
- this.labelLanguage.Visible = true;
- //
- // listView1
- //
- this.listViewSeeAlso.Visible = true;
- //
- // labelMembers
- //
- this.labelMembers.Location = new System.Drawing.Point(8, 34);
- this.labelMembers.Name = "labelMembers";
- this.labelMembers.Size = new System.Drawing.Size(56, 16);
- this.labelMembers.TabIndex = 10;
- this.labelMembers.Text = "Members:";
- //
- // comboBoxMembers
- //
- this.comboBoxMembers.Location = new System.Drawing.Point(64, 32);
- this.comboBoxMembers.Name = "comboBoxMembers";
- this.comboBoxMembers.Size = new System.Drawing.Size(168, 21);
- this.comboBoxMembers.TabIndex = 11;
- this.comboBoxMembers.Text = "comboBox1";
- //
- // TypeEditorForm
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(432, 469);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.listViewSeeAlso,
- this.labelLanguage,
- this.comboBoxLanguage,
- this.labelSeeAlso,
- this.textBoxRemarks,
- this.labelRemarks,
- this.textBoxSummary,
- this.labelSummary,
- this.toolBar,
- this.comboBoxMembers,
- this.labelMembers});
- this.Name = "TypeEditorForm";
- this.Text = "TypeEditorForm";
- this.ResumeLayout(false);
-
- }
-
- public TypeEditorForm() : base()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/mcs/doctools/src/Gui/UnexpectedErrorForm.cs b/mcs/doctools/src/Gui/UnexpectedErrorForm.cs
deleted file mode 100644
index 1d692fa86d1..00000000000
--- a/mcs/doctools/src/Gui/UnexpectedErrorForm.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-// UnexpectedErrorForm.cs
-// John Barnette (jbarn@httcb.net)
-//
-// Copyright (c) 2002 John Barnette
-//
-// This file is part of Monodoc, a multilingual API documentation tool.
-//
-// Monodoc is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// Monodoc 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Monodoc; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace Mono.Doc.Gui
-{
- /// <summary>
- /// Summary description for UnexpectedErrorForm.
- /// </summary>
- public class UnexpectedErrorForm : System.Windows.Forms.Form
- {
- private System.Windows.Forms.PictureBox pictureBoxExplosion;
- private System.Windows.Forms.Label labelErrorExplanation;
- private System.Windows.Forms.TextBox textBoxErrorMessage;
- private System.Windows.Forms.Button buttonSendErrorReport;
- private System.Windows.Forms.Button buttonQuit;
- private System.Windows.Forms.Button buttonContinue;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public UnexpectedErrorForm(Exception e)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
-
- this.pictureBoxExplosion.Image = GuiResources.ErrorExplosionBitmap;
-
- this.textBoxErrorMessage.Text +=
- "Exception: " + e.GetType().FullName + "\n" +
- "Message: " + e.Message + "\n\n" +
- "Stack Trace: \n" + e.StackTrace + "\n\n";
-
- while (e.InnerException != null)
- {
- e = e.InnerException;
- this.textBoxErrorMessage.Text +=
- "--- NESTED EXCEPTION ---\n" +
- "Exception: " + e.GetType().FullName + "\n" +
- "Message: " + e.Message + "\n\n" +
- "Stack Trace: \n" + e.StackTrace + "\n\n";
- }
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.pictureBoxExplosion = new System.Windows.Forms.PictureBox();
- this.labelErrorExplanation = new System.Windows.Forms.Label();
- this.textBoxErrorMessage = new System.Windows.Forms.TextBox();
- this.buttonQuit = new System.Windows.Forms.Button();
- this.buttonSendErrorReport = new System.Windows.Forms.Button();
- this.buttonContinue = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // pictureBoxExplosion
- //
- this.pictureBoxExplosion.Location = new System.Drawing.Point(8, 8);
- this.pictureBoxExplosion.Name = "pictureBoxExplosion";
- this.pictureBoxExplosion.Size = new System.Drawing.Size(65, 64);
- this.pictureBoxExplosion.TabIndex = 0;
- this.pictureBoxExplosion.TabStop = false;
- //
- // labelErrorExplanation
- //
- this.labelErrorExplanation.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
- this.labelErrorExplanation.Location = new System.Drawing.Point(96, 8);
- this.labelErrorExplanation.Name = "labelErrorExplanation";
- this.labelErrorExplanation.Size = new System.Drawing.Size(216, 64);
- this.labelErrorExplanation.TabIndex = 1;
- this.labelErrorExplanation.Text = "Kaboom! Monodoc has thrown an unexpected exception. Seeing as we\'re in heavy de" +
- "velopment, this is hardly surprising. Relevant debugging information follows.";
- //
- // textBoxErrorMessage
- //
- this.textBoxErrorMessage.AcceptsReturn = true;
- this.textBoxErrorMessage.Location = new System.Drawing.Point(8, 88);
- this.textBoxErrorMessage.Multiline = true;
- this.textBoxErrorMessage.Name = "textBoxErrorMessage";
- this.textBoxErrorMessage.ReadOnly = true;
- this.textBoxErrorMessage.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.textBoxErrorMessage.Size = new System.Drawing.Size(304, 216);
- this.textBoxErrorMessage.TabIndex = 2;
- this.textBoxErrorMessage.Text = "";
- //
- // buttonQuit
- //
- this.buttonQuit.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonQuit.Location = new System.Drawing.Point(144, 312);
- this.buttonQuit.Name = "buttonQuit";
- this.buttonQuit.TabIndex = 3;
- this.buttonQuit.Text = "Quit";
- this.buttonQuit.Click += new System.EventHandler(this.buttonExit_Click);
- //
- // buttonSendErrorReport
- //
- this.buttonSendErrorReport.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonSendErrorReport.Location = new System.Drawing.Point(8, 312);
- this.buttonSendErrorReport.Name = "buttonSendErrorReport";
- this.buttonSendErrorReport.Size = new System.Drawing.Size(117, 23);
- this.buttonSendErrorReport.TabIndex = 4;
- this.buttonSendErrorReport.Text = "Send Error Report";
- this.buttonSendErrorReport.Click += new System.EventHandler(this.buttonSendErrorReport_Click);
- //
- // buttonContinue
- //
- this.buttonContinue.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonContinue.Location = new System.Drawing.Point(232, 312);
- this.buttonContinue.Name = "buttonContinue";
- this.buttonContinue.TabIndex = 5;
- this.buttonContinue.Text = "Continue";
- this.buttonContinue.Click += new System.EventHandler(this.buttonContinue_Click);
- //
- // UnexpectedErrorForm
- //
- this.AcceptButton = this.buttonQuit;
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.CancelButton = this.buttonContinue;
- this.ClientSize = new System.Drawing.Size(320, 341);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.buttonContinue,
- this.buttonSendErrorReport,
- this.buttonQuit,
- this.textBoxErrorMessage,
- this.labelErrorExplanation,
- this.pictureBoxExplosion});
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "UnexpectedErrorForm";
- this.Text = "Monodoc Error";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void buttonExit_Click(object sender, System.EventArgs e)
- {
- Application.Exit();
- }
-
- private void buttonSendErrorReport_Click(object sender, System.EventArgs e)
- {
- MessageBox.Show("TODO: This is coming, as soon as I figure out the best " +
- "delivery mechanism. Promise.", "Unimplemented Feature"
- );
- }
-
- private void buttonContinue_Click(object sender, System.EventArgs e)
- {
- MessageBox.Show("TODO: implement continue.", "Unimplemented Feature");
- }
- }
-}
diff --git a/mcs/doctools/src/doctools.sln b/mcs/doctools/src/doctools.sln
deleted file mode 100644
index b336c2a1e26..00000000000
--- a/mcs/doctools/src/doctools.sln
+++ /dev/null
@@ -1,27 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gui", "Gui\Gui.csproj", "{B76CBA27-ABBD-45FE-AFC3-A629BC13BAAE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Core\Core.csproj", "{73F5A60D-A5E3-4852-B4C6-478275E733F9}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {B76CBA27-ABBD-45FE-AFC3-A629BC13BAAE}.Debug.ActiveCfg = Release|.NET
- {B76CBA27-ABBD-45FE-AFC3-A629BC13BAAE}.Debug.Build.0 = Release|.NET
- {B76CBA27-ABBD-45FE-AFC3-A629BC13BAAE}.Release.ActiveCfg = Release|.NET
- {B76CBA27-ABBD-45FE-AFC3-A629BC13BAAE}.Release.Build.0 = Release|.NET
- {73F5A60D-A5E3-4852-B4C6-478275E733F9}.Debug.ActiveCfg = Release|.NET
- {73F5A60D-A5E3-4852-B4C6-478275E733F9}.Debug.Build.0 = Release|.NET
- {73F5A60D-A5E3-4852-B4C6-478275E733F9}.Release.ActiveCfg = Release|.NET
- {73F5A60D-A5E3-4852-B4C6-478275E733F9}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/mcs/errors/1529.cs b/mcs/errors/1529.cs
deleted file mode 100755
index 06dd1f74a89..00000000000
--- a/mcs/errors/1529.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs1529.cs: Using clause must precede all other namespace elements
-// Line:
-class X { }
-using System;
diff --git a/mcs/errors/ChangeLog b/mcs/errors/ChangeLog
deleted file mode 100644
index 37fd224fb40..00000000000
--- a/mcs/errors/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2002-06-24 Andrew Birkett <adb@tardis.ed.ac.uk>
-
- * fail: cs0121.cs, cs0157.cs and cs1501.cs no longer fail.
- * cs0176.cs: Method has to be public for correct test
- * cs0196.cs, cs0242.cs: Do 'return' to stop null statement warning.
- * cs0255.cs: Add assignment to stop 'unused variable' warning.
- * makefile: Output is now like "Running test 42 .. OK". Added --unsafe to
- make cs0193.cs, cs0196.cs and cs0214-3.cs work.
-
diff --git a/mcs/errors/bug1.cs b/mcs/errors/bug1.cs
deleted file mode 100755
index 934f0f9bce2..00000000000
--- a/mcs/errors/bug1.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// FIXED
-//
-interface A {
- void B ();
-}
-
-interface X {
- void B ();
-}
-
-
-class B : A, X {
- void X.B () {}
- void A.B () {}
-
-}
diff --git a/mcs/errors/bug10.cs b/mcs/errors/bug10.cs
deleted file mode 100644
index 5b2ff627ffa..00000000000
--- a/mcs/errors/bug10.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// fixed
-//
-using System;
-
-public class Blah {
-
- public void Connect ()
- {
- }
-
- public void Button1_Click (int i, int j)
- {
- Console.WriteLine ("Button1 was clicked !");
- Console.WriteLine ("Answer : " + (i+j));
- }
-
- public static int Main ()
- {
- Blah b = new Blah ();
-
- b.Connect ();
-
- b.OnClick ();
-
- Console.WriteLine ("Test passes");
- return 0;
- }
-
-}
diff --git a/mcs/errors/bug11.cs b/mcs/errors/bug11.cs
deleted file mode 100755
index b48bc1893f7..00000000000
--- a/mcs/errors/bug11.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// fixed
-//
-class Location {
- static public int Null {
- get {
- return 1;
- }
- }
-}
-
-class X {
- Location Location;
- X ()
- {
- int a = Location.Null;
- }
-
- static void Main () {}
-}
-
-
-
diff --git a/mcs/errors/bug12.cs b/mcs/errors/bug12.cs
deleted file mode 100755
index 27c24e93eb7..00000000000
--- a/mcs/errors/bug12.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Collections;
-
- class PtrHashtable : Hashtable {
- class PtrComparer : IComparer {
- public int Compare (object x, object y)
- {
- if (x == y)
- return 0;
- else
- return 1;
- }
- }
-
- public PtrHashtable ()
- {
- comparer = new PtrComparer ();
- }
- }
-
diff --git a/mcs/errors/bug13.cs b/mcs/errors/bug13.cs
deleted file mode 100755
index 91016d0a7c7..00000000000
--- a/mcs/errors/bug13.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-
-class X {
- static void Main ()
- {
- Type t = null;
-
- if (t.GetType () == null)
- return;
- }
-}
diff --git a/mcs/errors/bug14.cs b/mcs/errors/bug14.cs
deleted file mode 100755
index 9167d9afbbf..00000000000
--- a/mcs/errors/bug14.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// fixed
-//
-using System;
-
-class X {
-
- static void Main ()
- {
- string msg = String.Format ("{0} {1} {2} {3}", "one", 3, 3, "two");
-
- Console.WriteLine (msg);
- }
-}
-
diff --git a/mcs/errors/bug15.cs b/mcs/errors/bug15.cs
deleted file mode 100755
index d233407af32..00000000000
--- a/mcs/errors/bug15.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// fixed
-//
-using System;
-
-class X {
-
- void A ()
- {
- }
-
- static void Main ()
- {
- int loop = 0;
-
- goto a;
- b:
- loop++;
- a:
- Console.WriteLine ("Hello");
- for (;;){
- goto b;
- }
- }
-}
diff --git a/mcs/errors/bug16.cs b/mcs/errors/bug16.cs
deleted file mode 100644
index 4b8503cf127..00000000000
--- a/mcs/errors/bug16.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Fixed
-//
-
-using System;
-
-public class Blah {
-
- public static void Main ()
- {
- ushort i;
- sbyte j;
-
- i = 10;
- j = 20;
-
- Console.WriteLine (i);
- Console.WriteLine (j);
-
- Console.WriteLine ("Hello there !");
- }
-}
-
-
diff --git a/mcs/errors/bug17.cs b/mcs/errors/bug17.cs
deleted file mode 100755
index d922487cf34..00000000000
--- a/mcs/errors/bug17.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-//
-// Fixed
-//
-class X {
- static void Main ()
- {
-double x = 64.0;
-System.Console.WriteLine("x = " + x.ToBoolean(null));
-}
-}
diff --git a/mcs/errors/bug18.cs b/mcs/errors/bug18.cs
deleted file mode 100755
index 61e0f0af006..00000000000
--- a/mcs/errors/bug18.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace A {
- interface B {
- }
-}
-
-class X {
- static void A (object A)
- {
- object x = (A.B) A;
- }
-
- static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/bug19.cs b/mcs/errors/bug19.cs
deleted file mode 100755
index 15755b6faaa..00000000000
--- a/mcs/errors/bug19.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace N1
-{
- public enum A
- {
- A_1, A_2, A_3
- }
-
- public class B
- {
- const A b = A.A_1;
- }
-}
-
-
-
-
-
-
diff --git a/mcs/errors/bug2.cs b/mcs/errors/bug2.cs
deleted file mode 100755
index 61f6eea2bce..00000000000
--- a/mcs/errors/bug2.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// fixed
-//
-class X {
-
- static void A (ref int a)
- {
- a++;
- }
-
- // Int32&
- static void B (ref int a)
- {
- // Int32&&
- A (ref a);
- }
-
- static int Main ()
- {
- int a = 10;
-
- B (ref a);
-
- if (a == 11)
- return 0;
- else
- return 1;
- }
-}
diff --git a/mcs/errors/bug3.cs b/mcs/errors/bug3.cs
deleted file mode 100755
index af24ecc011b..00000000000
--- a/mcs/errors/bug3.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Fixed, incorporated into test
-//
-using System;
-
-using System.Runtime.InteropServices;
-
-[StructLayout (LayoutKind.Explicit)]
-struct A {
- [FieldOffset (0)]
- public int a;
- [FieldOffset (0)]
- public byte b1;
- [FieldOffset (1)]
- public byte b2;
- [FieldOffset (2)]
- public byte b3;
- [FieldOffset (3)]
- public byte b4;
-}
-
-class X {
- static void Main ()
- {
- A a = new A ();
-
- a.a = 0x12345678;
-
- Console.WriteLine ("b1: " + a.b1);
- Console.WriteLine ("b2: " + a.b2);
- Console.WriteLine ("b3: " + a.b3);
- Console.WriteLine ("b4: " + a.b4);
-
- }
-}
-
diff --git a/mcs/errors/bug4.cs b/mcs/errors/bug4.cs
deleted file mode 100755
index 775cfe30349..00000000000
--- a/mcs/errors/bug4.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// Fixed
-//
-using System;
-
-class X {
- static void Main ()
- {
- try {
- throw new Exception ();
- } catch (Exception e) {
- Console.WriteLine ("Caught");
- throw;
- } catch {
- Console.WriteLine ("Again");
- }
- }
-}
diff --git a/mcs/errors/bug5.cs b/mcs/errors/bug5.cs
deleted file mode 100755
index 03fce159750..00000000000
--- a/mcs/errors/bug5.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// fixed
-//
-interface I {
- void a ();
-}
-
-abstract class X : I {
- public abstract void a ();
-}
-
-class Y : X {
- override public void a () {
- System.Console.WriteLine ("Hello!");
- return;
- }
-
- static void Main () {
- Y y = new Y ();
-
- ((I) y ).a ();
- }
-}
diff --git a/mcs/errors/bug6.cs b/mcs/errors/bug6.cs
deleted file mode 100755
index 9cbf071393d..00000000000
--- a/mcs/errors/bug6.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// fixed
-//
-public class X {
-
- public enum Blah { A }
-
-}
-
-public class Y : X {
-
- Blah x;
-
-}
diff --git a/mcs/errors/bug7.cs b/mcs/errors/bug7.cs
deleted file mode 100755
index fcd35bc6cdb..00000000000
--- a/mcs/errors/bug7.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-public enum X :byte {
- a, b
-}
-
-public class Y {
-
- const X myconst = X.a;
-
- static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/bug8.cs b/mcs/errors/bug8.cs
deleted file mode 100755
index 47846f7c4c9..00000000000
--- a/mcs/errors/bug8.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-//
-// The problem here is that `(Type)' is being recognized as a Property
-// but inside a Cast expression this is invalid.
-//
-class X {
-
- int Type {
- get {
- return 1;
- }
- }
-
- static void Main ()
- {
- Type t = (Type) null;
- }
-
-}
diff --git a/mcs/errors/bug9.cs b/mcs/errors/bug9.cs
deleted file mode 100755
index f0c436a1ad0..00000000000
--- a/mcs/errors/bug9.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-enum A {
-a, b
-}
-
-class X {
- const A a = A.a;
-}
diff --git a/mcs/errors/cs-11.cs b/mcs/errors/cs-11.cs
deleted file mode 100644
index 5adc40a2573..00000000000
--- a/mcs/errors/cs-11.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// cs-11.cs : Delegate creation expression takes only one argument
-// Line : 17
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static void Main ()
- {
- Blah i = new Blah ();
-
- MyDelegate del = new MyDelegate ();
- }
-}
-
diff --git a/mcs/errors/cs-12.cs b/mcs/errors/cs-12.cs
deleted file mode 100755
index fe4b09b37a2..00000000000
--- a/mcs/errors/cs-12.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-class Y {
- byte b;
-
- public static implicit operator int (Y i)
- {
- return i.b;
- }
-
-// public static implicit operator byte (Y i)
-// {
-// return i.b;
-// }
-
- public Y (byte b)
- {
- this.b = b;
- }
-}
-
-class X {
- static void Main ()
- {
- Y y = new Y (1);
-
- switch (y){
- case 0:
- break;
- case 1:
- break;
- }
-
- int a = y;
- }
-}
diff --git a/mcs/errors/cs-20.cs b/mcs/errors/cs-20.cs
deleted file mode 100644
index 6f33e0dcfd3..00000000000
--- a/mcs/errors/cs-20.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// cs-20.cs : Cannot find attribute type My (maybe you forgot to set the usage using the AttributeUsage attribute ?).
-// Line : 18
-
-using System;
-using System.Reflection;
-
-namespace Test {
-
- //[AttributeUsage (AttributeTargets.All)]
- public class MyAttribute: Attribute {
- public string val;
- public MyAttribute (string stuff) {
- System.Console.WriteLine (stuff);
- val = stuff;
- }
- }
-
- [My("testclass")]
-
- public class Test {
- static public int Main() {
- System.Reflection.MemberInfo info = typeof (Test);
- object[] attributes = info.GetCustomAttributes (false);
- for (int i = 0; i < attributes.Length; i ++) {
- System.Console.WriteLine(attributes[i]);
- }
- if (attributes.Length != 2)
- return 1;
- MyAttribute attr = (MyAttribute) attributes [0];
- if (attr.val != "testclass")
- return 2;
- return 0;
- }
- }
-}
diff --git a/mcs/errors/cs0017.cs b/mcs/errors/cs0017.cs
deleted file mode 100755
index 7942594be2f..00000000000
--- a/mcs/errors/cs0017.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0017.cs: Program has more than one entry point
-// Line: 7
-class X {
-static void Main () {}
-}
-class Y {
-static void Main () {
-}
-}
diff --git a/mcs/errors/cs0019-2.cs b/mcs/errors/cs0019-2.cs
deleted file mode 100755
index d9753a29a1c..00000000000
--- a/mcs/errors/cs0019-2.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// cs0019.cs : Operator + cannot be applied to operands of type `int' and `Test.Zub'
-// Line : 11
-using System;
-
-class Test {
-
- enum Zub :byte {
- Foo = 99,
- Bar,
- Baz
- }
-
-
- static void Main ()
- {
- int v = 1;
- object foo = (v + Zub.Foo);
- }
-}
-
diff --git a/mcs/errors/cs0019-3.cs b/mcs/errors/cs0019-3.cs
deleted file mode 100755
index e49fde2ab13..00000000000
--- a/mcs/errors/cs0019-3.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// cs0019.cs : Operator + cannot be applied to operands of type `int' and `Test.Zub'
-// Line : 11
-using System;
-
-class Test {
-
- enum Zub :byte {
- Foo = 99,
- Bar,
- Baz
- }
-
-
- static void Main ()
- {
- object v = (Zub.Foo + Zub.Foo);
- }
-}
-
diff --git a/mcs/errors/cs0019-4.cs b/mcs/errors/cs0019-4.cs
deleted file mode 100755
index 938735e69a2..00000000000
--- a/mcs/errors/cs0019-4.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// cs0019.cs : Operator + cannot be applied to operands of type `int' and `Test.Zub'
-// Line : 11
-using System;
-
-class Test {
-
- enum Zub :byte {
- Foo = 99,
- Bar,
- Baz
- }
-
-
- static void Main ()
- {
- Zub a = Zub.Foo, b = Zub.Bar;
- object v = (a + b);
- }
-}
-
diff --git a/mcs/errors/cs0019-5.cs b/mcs/errors/cs0019-5.cs
deleted file mode 100755
index 6b8da99ef80..00000000000
--- a/mcs/errors/cs0019-5.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-class X {
-}
-
-class Y {
-}
-
-class T {
- static void Main ()
- {
- X x = new X ();
- Y y = new Y ();
-
- if (x == y){
- }
- }
-}
diff --git a/mcs/errors/cs0019.cs b/mcs/errors/cs0019.cs
deleted file mode 100644
index c3dbd4f9b93..00000000000
--- a/mcs/errors/cs0019.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0019.cs : Operator + cannot be applied to operands of type `Foo' and `int'
-// Line : 11
-
-public class Foo {
-
- public static void Main ()
- {
-
- Foo k = new Foo ();
-
- int i = k + 6;
-
- }
-}
diff --git a/mcs/errors/cs0020.cs b/mcs/errors/cs0020.cs
deleted file mode 100755
index 228401b453c..00000000000
--- a/mcs/errors/cs0020.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0020.cs : Division by constant zero.
-// Line : 999999999
-
-using System;
-
-public class X {
- static void Main ()
- {
- int i = 1 / 0;
- Console.WriteLine (i);
- }
-}
diff --git a/mcs/errors/cs0023.cs b/mcs/errors/cs0023.cs
deleted file mode 100644
index 6a2cd5518c9..00000000000
--- a/mcs/errors/cs0023.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0023.cs : Operator ~ cannot be applied to operand of type `Foo'
-// Line : 10
-
-public class Foo {
-
- public static void Main ()
- {
- Foo k = new Foo ();
-
- int i = ~ k;
-
- }
-}
diff --git a/mcs/errors/cs0026-2.cs b/mcs/errors/cs0026-2.cs
deleted file mode 100755
index a4f41cdb51d..00000000000
--- a/mcs/errors/cs0026-2.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0026: use of this is not allowed in a static field initializer
-//
-class X {
- static object o = this;
-
- static int Main ()
- {
- return 1;
- }
-}
diff --git a/mcs/errors/cs0026.cs b/mcs/errors/cs0026.cs
deleted file mode 100755
index e4b5ca7e580..00000000000
--- a/mcs/errors/cs0026.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0026: use of this is not allowed in static methods
-// Line: 6
-class X {
- static void A ()
- {
- this = null;
- }
-}
diff --git a/mcs/errors/cs0028.cs b/mcs/errors/cs0028.cs
deleted file mode 100755
index 5cbf73f5130..00000000000
--- a/mcs/errors/cs0028.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0028: has the wrong signature to be an entry point
-// Line: 8
-
-class T {
- public static int Main ()
- {
- }
- public static int Main (int foo)
- {
- }
-}
-
diff --git a/mcs/errors/cs0029.cs b/mcs/errors/cs0029.cs
deleted file mode 100755
index 4f701c4e085..00000000000
--- a/mcs/errors/cs0029.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0029: cannot implicitly conver type `double' to `decimal'
-// Line: 7
-
-class T {
- public static int Main (string [] args)
- {
- decimal d = 100d;
-
- return 1;
- }
-}
-
diff --git a/mcs/errors/cs0030.cs b/mcs/errors/cs0030.cs
deleted file mode 100644
index 7226eb2855c..00000000000
--- a/mcs/errors/cs0030.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0030.cs : Cannot convert type 'Blah' to 'float'
-// Line : 12
-
-public class Blah {
-
- public static int Main ()
- {
- Blah k;
-
- k = new Blah ();
-
- float f = (float) k;
-
- }
-}
diff --git a/mcs/errors/cs0031.cs b/mcs/errors/cs0031.cs
deleted file mode 100644
index c79ba6975de..00000000000
--- a/mcs/errors/cs0031.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0031.cs : Constant value '256' cannot be converted to a byte
-// Line : 7
-
-public class Blah {
-
- public enum MyEnum : byte {
- Foo = 256,
- Bar
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0034.cs b/mcs/errors/cs0034.cs
deleted file mode 100755
index 2d5917abee5..00000000000
--- a/mcs/errors/cs0034.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0034: operator >= is ambiguous on types ulong and sbyte
-// Line: 7
-class X {
-
- bool ret (ulong u, sbyte s)
- {
- return (u >= s);
- }
-
- bool ret (ulong u, short s)
- {
- return (u >= s);
- }
-
-}
diff --git a/mcs/errors/cs0039.cs b/mcs/errors/cs0039.cs
deleted file mode 100755
index 494fe68f956..00000000000
--- a/mcs/errors/cs0039.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// cs0039.cs: as operator can not convert explicitly from type to type
-// line: 8
-class A {
- public static void Main ()
- {
- decimal tryDec;
- tryDec = 1234.2345M;
-
- object a = tryDec as string;
- }
-}
-
-
-
-
-
diff --git a/mcs/errors/cs0051.cs b/mcs/errors/cs0051.cs
deleted file mode 100755
index 177c0028638..00000000000
--- a/mcs/errors/cs0051.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0051.cs: Inconsistent accessibility: parameter type `MyClass.X' is less accessible than method MyClass.method(MyClass.X)
-// Line: 12
-
-public class MyClass {
-
- //
- // To fix change the next line to "public enum X {
- enum X {
- a, b
- }
-
- public void method (X arg)
- {
- }
-}
diff --git a/mcs/errors/cs0060.cs b/mcs/errors/cs0060.cs
deleted file mode 100755
index 0e571b72987..00000000000
--- a/mcs/errors/cs0060.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0060.cs: Incosistent accessability between X and Y.X
-// Line: 6
-class X {
-}
-
-public class Y : X {
-}
diff --git a/mcs/errors/cs0066.cs b/mcs/errors/cs0066.cs
deleted file mode 100644
index e7e6f5e3479..00000000000
--- a/mcs/errors/cs0066.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// cs0066.cs : 'Button.Click' : event must be of a delegate type
-// Line : 10
-
-using System;
-
-public delegate void EventHandler (object sender, EventArgs e);
-
-public class Button {
-
- public event Blah Click;
-
- public void Reset ()
- {
- Click = null;
- }
-}
-
-public class Blah {
-
- public static void Main ()
- {
- Blah b = new Blah ();
- }
-
-}
diff --git a/mcs/errors/cs0070.cs b/mcs/errors/cs0070.cs
deleted file mode 100644
index 826c97b301a..00000000000
--- a/mcs/errors/cs0070.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// cs0070.cs : The event 'Click' can only appear on the left-side of a += or -= (except when used from within the type 'Button')
-// Line : 20
-
-using System;
-
-public delegate void EventHandler (int i, int j);
-
-public class Button {
-
- public event EventHandler Click;
-
-}
-
-public class Blah {
-
- Button Button1 = new Button ();
-
- public void Connect ()
- {
- Button1.Click = new EventHandler (Button1_Click);
- }
-
- public void Button1_Click (int i, int j)
- {
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0107.cs b/mcs/errors/cs0107.cs
deleted file mode 100755
index fd02f7e2c2a..00000000000
--- a/mcs/errors/cs0107.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs0107.cs: More than one protection modifier
-// Line: 4
-class X {
- public private class X {
- }
-}
diff --git a/mcs/errors/cs0108.cs b/mcs/errors/cs0108.cs
deleted file mode 100755
index a516acc7d38..00000000000
--- a/mcs/errors/cs0108.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0108.cs: The new keyword is required on MEMBER because it hides MEMBER2
-// Line:
-
-class Base {
- public void F () {}
-}
-
-class Derived : Base {
- void F () {}
-}
diff --git a/mcs/errors/cs0110.cs b/mcs/errors/cs0110.cs
deleted file mode 100755
index 81abb2390f3..00000000000
--- a/mcs/errors/cs0110.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-class A {
- int a;
-
- class B {
- int b;
-
- class C {
- int c;
-
- void m ()
- {
- c = 1;
- }
-
- enum F {
- A, B, C, D = X, E
- }
-
- const int X = Y + 1;
- const int Y = 1 + (int) F.E;
- }
- }
-
- static int Main (string [] args)
- {
- return 0;
- }
-
-}
diff --git a/mcs/errors/cs0111.cs b/mcs/errors/cs0111.cs
deleted file mode 100644
index 968e204f64a..00000000000
--- a/mcs/errors/cs0111.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-// cs111.cs : Class `Blah' already contains a definition with the same return value and parameter types for method `Foo'
-// Line : 10
-
-public class Blah {
-
- static public void Foo (int i, int j)
- {
- }
-
- static public void Foo (int i, int j)
- {
- }
-
- public static void Main ()
- {
- int i = 1;
- int j = 2;
-
- Foo (i, j);
- }
-}
diff --git a/mcs/errors/cs0113.cs b/mcs/errors/cs0113.cs
deleted file mode 100755
index 6ddf367cf5d..00000000000
--- a/mcs/errors/cs0113.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-class X {
- public virtual override void Y () {}
-}
diff --git a/mcs/errors/cs0114.cs b/mcs/errors/cs0114.cs
deleted file mode 100755
index a617710997d..00000000000
--- a/mcs/errors/cs0114.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0114.cs: Y.XX hides inherited member X.XX. Must use `override' or `new' keyword
-// Line: 8
-public abstract class X {
- public abstract void XX ();
-}
-
-class Y : X {
- void XX () {}
-}
diff --git a/mcs/errors/cs0115.cs b/mcs/errors/cs0115.cs
deleted file mode 100755
index f3ae9aa468d..00000000000
--- a/mcs/errors/cs0115.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-class X {
- public override void Bla ()
- {
- }
-}
diff --git a/mcs/errors/cs0117.cs b/mcs/errors/cs0117.cs
deleted file mode 100755
index 7b942b47625..00000000000
--- a/mcs/errors/cs0117.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0117: `int' does not contain a definition for 'E'.
-// Line: 7
-
-class T {
- public static int Main (string [] args )
- {
- int x = 1.E;
- return 0;
- }
-}
diff --git a/mcs/errors/cs0118.cs b/mcs/errors/cs0118.cs
deleted file mode 100755
index bd3afe1a62a..00000000000
--- a/mcs/errors/cs0118.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0118.cs: X.s denotes a 'field' where a class was expected
-// Line: 6
-class X {
- string s;
-
- s MyProperty {
- get {
- return s;
- }
- }
-}
diff --git a/mcs/errors/cs0120-2.cs b/mcs/errors/cs0120-2.cs
deleted file mode 100755
index 68899fc9e80..00000000000
--- a/mcs/errors/cs0120-2.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Threading;
-using System.Reflection;
-using System.Reflection.Emit;
-
-public class Test {
-
- public Test () : this (Add8(4), 6) {
- string hostName = System.Net.Dns.GetHostName ();
- Console.WriteLine ("Hostname: " + hostName);
- }
-
- public Test (int i, int j) {
- Console.WriteLine ("GOT : " + i + " : " + j);
- }
-
-
- public static void Main (String[] args) {
- Test t = new Test ();
- }
-
- private int Add8 (int i) {
- return i + 8;
- }
-
-}
diff --git a/mcs/errors/cs0120.cs b/mcs/errors/cs0120.cs
deleted file mode 100755
index 817b2d5ea35..00000000000
--- a/mcs/errors/cs0120.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0120: Ie, a static method invoking a non-static method
-// `An object reference is required for the nonstatic field, method or property test.method()
-// Line: 11
-
-class test {
-
- void method ()
- {
- }
-
- public static int Main (string [] args){
- method ();
- return 1;
- }
-}
diff --git a/mcs/errors/cs0121.cs b/mcs/errors/cs0121.cs
deleted file mode 100755
index 7a8797ee680..00000000000
--- a/mcs/errors/cs0121.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// cs0121.cs: ambigous call when selecting function due to implicit casts
-// Line: 15
-
-class X {
- static void a (int i, double d)
- {
- }
-
- static void a (double d, int i)
- {
- }
-
- public static void Main ()
- {
- a (0, 0);
- }
-}
diff --git a/mcs/errors/cs0122.cs b/mcs/errors/cs0122.cs
deleted file mode 100755
index 47078b0fdf8..00000000000
--- a/mcs/errors/cs0122.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// cs0122.cs: y.x is inaccessible due to its protection level
-// Line: 15
-using System;
-
-class Y {
- void x () {}
-
-}
-
-class X {
- static int Main ()
- {
- Y y = new Y ();
-
- y.x ();
- return 0;
- }
-}
diff --git a/mcs/errors/cs0126.cs b/mcs/errors/cs0126.cs
deleted file mode 100644
index 2742abfdb09..00000000000
--- a/mcs/errors/cs0126.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0126: an object of type `int' is expected in the return statement
-// Line: 7
-
-class X {
- int X ()
- {
- return;
- }
-}
diff --git a/mcs/errors/cs0127.cs b/mcs/errors/cs0127.cs
deleted file mode 100755
index 2a72c6a1a3d..00000000000
--- a/mcs/errors/cs0127.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0127.cs: Since 'X.fn' returns void, a return keyword must not be followed by an object expression
-// Line: 6
-class X {
- void fn ()
- {
- return 1;
- }
-}
diff --git a/mcs/errors/cs0128.cs b/mcs/errors/cs0128.cs
deleted file mode 100755
index 09a3d042f99..00000000000
--- a/mcs/errors/cs0128.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0128: a local variable named `x' is already defined in this scope
-// Line:
-
-class x {
- static int y ()
- {
- int x = 1;
- int x = 2;
-
- return x + x;
- }
-}
diff --git a/mcs/errors/cs0131.cs b/mcs/errors/cs0131.cs
deleted file mode 100755
index ef025a2039a..00000000000
--- a/mcs/errors/cs0131.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0131.cs: left hand side of an assignment must be variable, property access or indexer
-// Line:
-class X {
- void A ()
- {
- 5 = 4;
- }
-}
diff --git a/mcs/errors/cs0132.cs b/mcs/errors/cs0132.cs
deleted file mode 100755
index 1b4ebf2c7b4..00000000000
--- a/mcs/errors/cs0132.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0132.cs: A static parameter must not have any parameters
-// Line: 4
-class X {
- static X (int x)
- {
- }
-}
diff --git a/mcs/errors/cs0133.cs b/mcs/errors/cs0133.cs
deleted file mode 100755
index a8d0e08abe7..00000000000
--- a/mcs/errors/cs0133.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0133.cs: the expression being assigned to `x' must be constant
-// Line: 6
-class X {
- X (int arg)
- {
- const int x = arg;
- }
-}
diff --git a/mcs/errors/cs0136-2.cs b/mcs/errors/cs0136-2.cs
deleted file mode 100755
index 4dc9d547e32..00000000000
--- a/mcs/errors/cs0136-2.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0136.cs: local variable j can not be declared, because there is something with that name already
-// Line: 5
-class X {
- public static void Bar (int j, params int [] args)
- {
- foreach (int j in args)
- ;
- }
-}
diff --git a/mcs/errors/cs0136.cs b/mcs/errors/cs0136.cs
deleted file mode 100755
index 3927a72616b..00000000000
--- a/mcs/errors/cs0136.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0136: A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i'
-// Line: 8
-class X {
- void b ()
- {
- int i;
- {
- string i;
- }
- }
-}
-
-
diff --git a/mcs/errors/cs0139.cs b/mcs/errors/cs0139.cs
deleted file mode 100644
index 11eb5d7f750..00000000000
--- a/mcs/errors/cs0139.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0139.cs: No loop to exit to in continue or break.
-// Line: 6
-class X {
- void A ()
- {
- continue;
- }
-}
diff --git a/mcs/errors/cs0144-2.cs b/mcs/errors/cs0144-2.cs
deleted file mode 100755
index d6a94543115..00000000000
--- a/mcs/errors/cs0144-2.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0144.cs: can not create instances of abstract classes or interfaces
-// Line: 11
-interface X {
- void A ();
-
-}
-
-class Demo {
- static void Main ()
- {
- object x = new X ();
- }
-}
diff --git a/mcs/errors/cs0144.cs b/mcs/errors/cs0144.cs
deleted file mode 100755
index 4b754ce5750..00000000000
--- a/mcs/errors/cs0144.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0144.cs: can not create instances of abstract classes or interfaces
-// Line: 11
-abstract class X {
- public abstract void B ();
-
-}
-
-class Demo {
- static void Main ()
- {
- object x = new X ();
- }
-}
diff --git a/mcs/errors/cs0146.cs b/mcs/errors/cs0146.cs
deleted file mode 100644
index 8b81c046864..00000000000
--- a/mcs/errors/cs0146.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0146.cs: circular class definition
-// Line: 6
-class A : B {
-}
-
-class B : A {
-}
diff --git a/mcs/errors/cs0150.cs b/mcs/errors/cs0150.cs
deleted file mode 100644
index fc67a91086e..00000000000
--- a/mcs/errors/cs0150.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0150.cs :
-// Line :
-
-using System;
-
-public class Blah {
-
- public static void Main ()
- {
- int foo = 6;
-
- int [] i = new int [foo] { 0, 1, 2, 3, 4, 5 };
- }
-}
diff --git a/mcs/errors/cs0151.cs b/mcs/errors/cs0151.cs
deleted file mode 100755
index 03ef7c2e9a9..00000000000
--- a/mcs/errors/cs0151.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-// cs0151.cs: An integral value expected
-// Line: 12
-class Y {
- byte b;
-}
-
-class X {
- static void Main ()
- {
- Y y = new Y ();
-
- switch (y){
- case 0:
- break;
- case 1:
- break;
- }
- }
-}
diff --git a/mcs/errors/cs0152.cs b/mcs/errors/cs0152.cs
deleted file mode 100755
index bf2c3e520ec..00000000000
--- a/mcs/errors/cs0152.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0152.cs: The label `case X:' already occurs in this switch statement
-// Line: 9
-class X {
- void f (int i)
- {
- switch (i){
- case 1:
- break;
- case 1:
- break;
- }
- }
-}
diff --git a/mcs/errors/cs0153.cs b/mcs/errors/cs0153.cs
deleted file mode 100755
index c102bfa4672..00000000000
--- a/mcs/errors/cs0153.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0153.cs: goto default only allowed in switch statement
-// Line:
-class X {
- void Main ()
- {
- goto default;
- }
-}
diff --git a/mcs/errors/cs0157.cs b/mcs/errors/cs0157.cs
deleted file mode 100755
index a56dd964da0..00000000000
--- a/mcs/errors/cs0157.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0157.cs: Control can not leave the body of a finally clause
-// Line: 9
-
-class X {
- void A ()
- {
- try {
- } finally {
- return;
- }
- }
-}
diff --git a/mcs/errors/cs0159-2.cs b/mcs/errors/cs0159-2.cs
deleted file mode 100755
index aeb30d78a35..00000000000
--- a/mcs/errors/cs0159-2.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// cs0159-2.cs: No such case 20
-
-class y {
- enum X { A = 1, B = 1, C = 1 }
-
- static void Main ()
- {
- int x = 1;
-
- switch (x){
- case 1: break;
- case 2: goto case 20;
- }
- }
-}
-
diff --git a/mcs/errors/cs0159.cs b/mcs/errors/cs0159.cs
deleted file mode 100755
index 65aa5cb2dfb..00000000000
--- a/mcs/errors/cs0159.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// cs0159.cs: No default target for goto default
-// Line:
-
-class X {
-
- static int m (int n)
- {
- switch (n){
- case 0:
- goto default;
-
- case 1:
- return 1;
- }
-
- return 10;
- }
-
- static void Main ()
- {
- m (1);
- }
-}
diff --git a/mcs/errors/cs0164.cs b/mcs/errors/cs0164.cs
deleted file mode 100755
index dbb530460a9..00000000000
--- a/mcs/errors/cs0164.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0164.cs: This label has not been referenced
-// Line: 5
-class X {
- void D () {
- a:
-
- return;
- }
-}
diff --git a/mcs/errors/cs0165-2.cs b/mcs/errors/cs0165-2.cs
deleted file mode 100755
index 3d0d3a9e2af..00000000000
--- a/mcs/errors/cs0165-2.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-class T {
- void fun (ref int a)
- {
- if (a == 3)
- a = 2;
- }
-
- void x ()
- {
- int x;
-
- if (System.Console.Read () == 1)
- x = 1;
- fun (ref x);
- }
-}
diff --git a/mcs/errors/cs0165.cs b/mcs/errors/cs0165.cs
deleted file mode 100755
index 48b7c52558d..00000000000
--- a/mcs/errors/cs0165.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0165.cs: Use of unassigned local variable
-// Line: 9
-
-class T {
- public T ()
- {
- int errors;
-
- errors += 1;
- }
-}
diff --git a/mcs/errors/cs0169.cs b/mcs/errors/cs0169.cs
deleted file mode 100755
index bcd47c81491..00000000000
--- a/mcs/errors/cs0169.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0169.cs: warning, private field `prv' is never used
-// Line: 4
-class X {
- int x;
-
- void blah ()
- {
- }
-
- static void Main () {}
-}
diff --git a/mcs/errors/cs0171.cs b/mcs/errors/cs0171.cs
deleted file mode 100755
index 5b2b2343b2a..00000000000
--- a/mcs/errors/cs0171.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0171.cs: field x must be initialized before constructor X ends.
-// Line:
-struct X {
- public readonly int x;
-
- X (int a)
- {
- }
-
- static void Main () {}
-}
diff --git a/mcs/errors/cs0172.cs b/mcs/errors/cs0172.cs
deleted file mode 100755
index c0496e9b83f..00000000000
--- a/mcs/errors/cs0172.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-class X {
- public static implicit operator X (Y y)
- {
- return null;
- }
-}
-
-class Y {
- public static implicit operator Y (X x)
- {
- return null;
- }
-}
-
-class Main
-{
- static void Main ()
- {
- X x = new X ();
- Y y = new Y ();
-
- object d = (x == x) ? x : y;
- }
-
-}
diff --git a/mcs/errors/cs0176.cs b/mcs/errors/cs0176.cs
deleted file mode 100755
index 889971fc117..00000000000
--- a/mcs/errors/cs0176.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0176.cs: cannot be accessed with an instance reference, use typename instead
-// Line: 12
-class X {
- public static void void_method ()
- {
- }
-}
-
-class Y {
- void m (X arg)
- {
- arg.void_method ();
- }
-}
diff --git a/mcs/errors/cs0178.cs b/mcs/errors/cs0178.cs
deleted file mode 100644
index 47be8ec08a7..00000000000
--- a/mcs/errors/cs0178.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0178.cs :
-// Line :
-
-using System;
-
-public class Blah {
-
- public static void Main ()
- {
- int [,] i = new int [4,2] { 0, 1, 2, 3, 4, 5 };
- }
-}
diff --git a/mcs/errors/cs0179.cs b/mcs/errors/cs0179.cs
deleted file mode 100755
index ed7eee8895b..00000000000
--- a/mcs/errors/cs0179.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs0179.cs: member can not be declared extern and have a body
-// Line:
-
-class X {
-
- public extern int extern_method ()
- {
- }
-
- public static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/cs0180.cs b/mcs/errors/cs0180.cs
deleted file mode 100755
index 7f1714e7331..00000000000
--- a/mcs/errors/cs0180.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0179.cs: member can not be declared extern and abstract
-// Line:
-
-class X {
-
- public extern abstract int extern_method ();
-
- public static void Main ()
- {
- }
-}
-
diff --git a/mcs/errors/cs0183.cs b/mcs/errors/cs0183.cs
deleted file mode 100755
index 228445ff6b7..00000000000
--- a/mcs/errors/cs0183.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0183.cs: the expression is always of the type `x'
-// Line:
-
-class X {
-
- static void Main ()
- {
- int i;
-
- if (i is int){
- }
- }
-}
diff --git a/mcs/errors/cs0184.cs b/mcs/errors/cs0184.cs
deleted file mode 100755
index 014b945f21b..00000000000
--- a/mcs/errors/cs0184.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0184.cs: The expression is never of the provided type
-// Line:
-
-class X {
-
- static void Main ()
- {
- int a;
-
- if (a is byte){
- }
- }
-}
diff --git a/mcs/errors/cs0185.cs b/mcs/errors/cs0185.cs
deleted file mode 100755
index 6efb95560a6..00000000000
--- a/mcs/errors/cs0185.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0185.cs: object is not a reference type (as expected by lock)
-// Line:
-
-class X {
- static void Main ()
- {
- lock (5) {
- }
- }
-}
-
diff --git a/mcs/errors/cs0187.cs b/mcs/errors/cs0187.cs
deleted file mode 100755
index dd9562abd70..00000000000
--- a/mcs/errors/cs0187.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-class X {
- static void Main ()
- {
- X x = new X();
-
- x++;
- }
-}
diff --git a/mcs/errors/cs0191.cs b/mcs/errors/cs0191.cs
deleted file mode 100755
index 6b3cc5df250..00000000000
--- a/mcs/errors/cs0191.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0191: can not assign to readonly variable outside constructor
-// Line: 8
-class X {
- readonly int a;
-
- void Y ()
- {
- a = 1;
- }
-}
-
-
diff --git a/mcs/errors/cs0193.cs b/mcs/errors/cs0193.cs
deleted file mode 100755
index 2d412139eef..00000000000
--- a/mcs/errors/cs0193.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0193.cs: * or -> operator can only be applied to pointer types.
-// Line: 8
-
-unsafe class X {
- static void Main ()
- {
- int a;
- if (*a == 0)
- return 1;
-
- return 0;
- }
-}
diff --git a/mcs/errors/cs0196.cs b/mcs/errors/cs0196.cs
deleted file mode 100755
index 57dd9c2b7b1..00000000000
--- a/mcs/errors/cs0196.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0196.cs: pointers must be indexed by a single value
-// line: 8
-using System;
-unsafe class ZZ {
- static void Main () {
- int *p = null;
-
- if (p [10,4] == 4)
- return;
- }
-}
diff --git a/mcs/errors/cs0198.cs b/mcs/errors/cs0198.cs
deleted file mode 100755
index 60bce195511..00000000000
--- a/mcs/errors/cs0198.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0198: can not assign to static readonly variable outside static constructor
-// Line: 8
-class X {
- static readonly int a;
-
- static void Y ()
- {
- a = 1;
- }
-}
-
-
diff --git a/mcs/errors/cs0200.cs b/mcs/errors/cs0200.cs
deleted file mode 100755
index 87ec5c6786f..00000000000
--- a/mcs/errors/cs0200.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs0200: can not assign to property X.P -- it is readonly
-// line: 12
-class X {
- static int P {
- get {
- return 1;
- }
- }
-
- static int Main ()
- {
- P = 10;
- return 1;
- }
-}
diff --git a/mcs/errors/cs0206.cs b/mcs/errors/cs0206.cs
deleted file mode 100755
index 03c79bf1a9a..00000000000
--- a/mcs/errors/cs0206.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// cs0206.cs: indexers or properties can not be used as ref or out arguments
-// Line:
-class X {
- static int P { get { return 1; } set { } }
-
- static int m (out int v)
- {
- v = 1;
- return 1;
- }
-
- static void Main ()
- {
- m (out P);
- }
-}
diff --git a/mcs/errors/cs0214-2.cs b/mcs/errors/cs0214-2.cs
deleted file mode 100755
index 364a9b5a9a1..00000000000
--- a/mcs/errors/cs0214-2.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-class X {
- static void Main ()
- {
- int b;
- int a = (int *) b;
- }
-}
diff --git a/mcs/errors/cs0214-3.cs b/mcs/errors/cs0214-3.cs
deleted file mode 100755
index e40bbfb7247..00000000000
--- a/mcs/errors/cs0214-3.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-struct X {
- static unsafe void *a ()
- {
- return null;
- }
-
- static void Main ()
- {
- a ();
- }
-
-}
diff --git a/mcs/errors/cs0214.cs b/mcs/errors/cs0214.cs
deleted file mode 100644
index 08eb088af39..00000000000
--- a/mcs/errors/cs0214.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0214: Pointer can only be used in unsafe context
-// Line: 4
-class X {
- void *a;
-}
diff --git a/mcs/errors/cs0215.cs b/mcs/errors/cs0215.cs
deleted file mode 100644
index 3c875505e94..00000000000
--- a/mcs/errors/cs0215.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0215.cs : The return type of operator True or False must be bool
-// Line : 11
-
-class Blah {
-
- public static void Main ()
- {
-
- }
-
- public static int operator true (Blah i) {}
-
-}
diff --git a/mcs/errors/cs0216.cs b/mcs/errors/cs0216.cs
deleted file mode 100644
index c218c51f20d..00000000000
--- a/mcs/errors/cs0216.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0216.cs: If you define operator <, you also need to define >
-// Line:
-class X {
- public static X operator < (X a, int b)
- {
- return null;
- }
-}
-
diff --git a/mcs/errors/cs0234.cs b/mcs/errors/cs0234.cs
deleted file mode 100755
index 3ef7cfab0bc..00000000000
--- a/mcs/errors/cs0234.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-//cs0243: NonExistant does not exist in this namespace
-
-using Nonexistant;
-
diff --git a/mcs/errors/cs0239.cs b/mcs/errors/cs0239.cs
deleted file mode 100644
index 0f3608643bc..00000000000
--- a/mcs/errors/cs0239.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// cs0239.cs : `X.MyMethod' : cannot override inherited member `Bar.MyMethod' because it is sealed.
-// Line : 25
-
-using System;
-
-public class Foo {
-
- public virtual void MyMethod ()
- {
- Console.WriteLine ("This is me !");
- }
-}
-
-public class Bar : Foo {
-
- public sealed override void MyMethod ()
- {
-
- }
-
-}
-
-public class X : Bar {
-
- public override void MyMethod ()
- {
-
- }
-
- public static void Main ()
- {
-
- }
-}
diff --git a/mcs/errors/cs0242.cs b/mcs/errors/cs0242.cs
deleted file mode 100755
index c775f17342e..00000000000
--- a/mcs/errors/cs0242.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0242: operation is not defined for void *
-// Line: 8
-using System;
-unsafe class ZZ {
- static void Main () {
- void *p = null;
-
- if (p [10] == 4)
- return;
- }
-}
diff --git a/mcs/errors/cs0246.cs b/mcs/errors/cs0246.cs
deleted file mode 100644
index 8cf6b9a081d..00000000000
--- a/mcs/errors/cs0246.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0246.cs: can not find type `B'
-// Line: 4
-interface A : B {
-}
diff --git a/mcs/errors/cs0255.cs b/mcs/errors/cs0255.cs
deleted file mode 100755
index 7fe38d595a0..00000000000
--- a/mcs/errors/cs0255.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0255.cs: Can not use stackalloc in finally or catch
-// Line: 10
-unsafe class X {
-
- static void Main ()
- {
- try {
- } catch {
- char *ptr = stackalloc char [10];
- ptr = ptr;
- }
- }
-}
diff --git a/mcs/errors/cs0284.cs b/mcs/errors/cs0284.cs
deleted file mode 100755
index 7d867e57120..00000000000
--- a/mcs/errors/cs0284.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// cs0284.cs: Can not create array with negative size
-// Line: 7
-
-class X {
- static void Main ()
- {
- int [] x = new int [-4];
- }
-}
diff --git a/mcs/errors/cs0500.cs b/mcs/errors/cs0500.cs
deleted file mode 100755
index d59cee21359..00000000000
--- a/mcs/errors/cs0500.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-abstract class X {
- public abstract void B () {
- }
-}
diff --git a/mcs/errors/cs0501.cs b/mcs/errors/cs0501.cs
deleted file mode 100755
index 1448d79e91e..00000000000
--- a/mcs/errors/cs0501.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0501.cs: `Class.X' must declare a body because it is not marked abstract or extern
-// Line: 4
-class Class {
- virtual public void X ();
-}
diff --git a/mcs/errors/cs0503.cs b/mcs/errors/cs0503.cs
deleted file mode 100755
index e8e8e048568..00000000000
--- a/mcs/errors/cs0503.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0503.cs: The abstract method `Class.X' cannot be marked virtual
-// Line: 4
-abstract class Class {
- virtual abstract public void X ();
-}
diff --git a/mcs/errors/cs0509.cs b/mcs/errors/cs0509.cs
deleted file mode 100644
index f89988f2cb3..00000000000
--- a/mcs/errors/cs0509.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0509.cs: base class is sealed
-// Line: 7
-struct V {
- int v;
-}
-
-class X : V {
-}
diff --git a/mcs/errors/cs0513.cs b/mcs/errors/cs0513.cs
deleted file mode 100755
index d2664371b04..00000000000
--- a/mcs/errors/cs0513.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0513.cs: X.myAbstract is abstract but it is contained in non-abstract class
-// Line: 5
-
-class X {
- public abstract void myAbstract ();
-}
-
-class Y : X {
-}
-
diff --git a/mcs/errors/cs0515.cs b/mcs/errors/cs0515.cs
deleted file mode 100755
index 3ffb5c7b0bd..00000000000
--- a/mcs/errors/cs0515.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0515.cs: access modifiers are not allowed on static constructors
-// Line: 4
-class X {
- public static X ()
- {
- }
-}
diff --git a/mcs/errors/cs0523.cs b/mcs/errors/cs0523.cs
deleted file mode 100755
index 43b016e6264..00000000000
--- a/mcs/errors/cs0523.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0523.cs: circular structure definition
-//
-
-struct A {
- B b;
-}
-
-struct B {
- A a;
-}
-
-class Y { static void Main () {} }
diff --git a/mcs/errors/cs0527-2.cs b/mcs/errors/cs0527-2.cs
deleted file mode 100644
index e312377061b..00000000000
--- a/mcs/errors/cs0527-2.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-class A1 {
-}
-
-class A2 {
-}
-
-class B : A1, A2 {
-}
diff --git a/mcs/errors/cs0527.cs b/mcs/errors/cs0527.cs
deleted file mode 100644
index 994add02c67..00000000000
--- a/mcs/errors/cs0527.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0527: type in interface list is not an interface
-// Line: 6
-class X {
-}
-
-interface A : X {
-}
diff --git a/mcs/errors/cs0528.cs b/mcs/errors/cs0528.cs
deleted file mode 100755
index 84b1d06cef0..00000000000
--- a/mcs/errors/cs0528.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0528: `A' is already listed in interface list
-// Line: 6
-interface A {
- void stuff ();
-}
-class C: A, A {
- public void stuff () {}
- static void Main() {}
-}
-
diff --git a/mcs/errors/cs0529.cs b/mcs/errors/cs0529.cs
deleted file mode 100644
index 52e725162d0..00000000000
--- a/mcs/errors/cs0529.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0529: Recursive interface definition
-// Line: 3
-interface A : B {
-}
-
-interface B : A {
-}
diff --git a/mcs/errors/cs0534.cs b/mcs/errors/cs0534.cs
deleted file mode 100755
index fe865887ce1..00000000000
--- a/mcs/errors/cs0534.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0534.cs: `Y' does not implement inherited abstract member `myAbstract'
-// Line: 5
-
-abstract class X {
- public abstract void myAbstract ();
-}
-
-class Y : X {
-static void Main (){}
-}
-
diff --git a/mcs/errors/cs0539.cs b/mcs/errors/cs0539.cs
deleted file mode 100755
index a9bf22fc40f..00000000000
--- a/mcs/errors/cs0539.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0539.cs: Member in explicit interface declaration is not a member of the interface
-// Line:
-
-interface A {
-}
-
-class X : A {
- void A.B () {}
- static void Main () {}
-}
diff --git a/mcs/errors/cs0540.cs b/mcs/errors/cs0540.cs
deleted file mode 100755
index 25d5d78ade1..00000000000
--- a/mcs/errors/cs0540.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0540.cs: containing class does not implement interface
-// Line:
-
-interface A {
-}
-
-class B {
- void A.B () {}
-
- static void Main () {}
-}
diff --git a/mcs/errors/cs0542.cs b/mcs/errors/cs0542.cs
deleted file mode 100755
index 61bcdcd88e3..00000000000
--- a/mcs/errors/cs0542.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs0542.cs: member names can not be the same as their enclosing type
-// Line: 4
-class X {
- int X;
-}
-
diff --git a/mcs/errors/cs0543.cs b/mcs/errors/cs0543.cs
deleted file mode 100644
index b59d0e834f5..00000000000
--- a/mcs/errors/cs0543.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1008.cs : Enumerator value for 'Bar' is too large to fit in its type
-// Line : 9
-
-public class Blah {
-
- public enum MyEnum : byte {
- Foo = 255,
- Bar
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0552.cs b/mcs/errors/cs0552.cs
deleted file mode 100755
index 7fe395005de..00000000000
--- a/mcs/errors/cs0552.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-// cs0552.cs: user-defined conversion to/from interface
-// Line: 12
-//
-using System;
-using System.IO;
-
-//
-//
-// Implicit conversion to an interface is not permitted
-//
-class NoIDispose {
- public static implicit operator IDisposable (NoIDispose a)
- {
- return a.x;
- }
-}
-
diff --git a/mcs/errors/cs0555.cs b/mcs/errors/cs0555.cs
deleted file mode 100644
index 110f952d25f..00000000000
--- a/mcs/errors/cs0555.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0555.cs : User-defined conversion cannot take an object of the enclosing type
-// and convert to an object of the enclosing type
-// Line : 8
-
-class Blah {
-
- public static void Main () {}
-
- public static implicit operator Blah (Blah i) {}
-
-}
diff --git a/mcs/errors/cs0556.cs b/mcs/errors/cs0556.cs
deleted file mode 100644
index 36ff437d65b..00000000000
--- a/mcs/errors/cs0556.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs0556.cs : User-defined conversion must convert to or from the enclosing type
-// Line : 8
-
-class Blah {
-
- public static void Main () {}
-
- public static implicit operator int (int i) {}
-
-}
diff --git a/mcs/errors/cs0563.cs b/mcs/errors/cs0563.cs
deleted file mode 100644
index af369883b2c..00000000000
--- a/mcs/errors/cs0563.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0563.cs: One of the parameters to the binary operator should be the containing type
-// Line: 4
-class X {
- public static int operator + (int a, int b)
- {
- }
-}
diff --git a/mcs/errors/cs0574.cs b/mcs/errors/cs0574.cs
deleted file mode 100755
index 1b88bf0173f..00000000000
--- a/mcs/errors/cs0574.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0574.cs: Name of destructor must match name of class:
-// Line: 6
-
-class X {
-
- ~Y ()
- {
- }
-
- static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0575.cs b/mcs/errors/cs0575.cs
deleted file mode 100755
index 16d0b7aa49e..00000000000
--- a/mcs/errors/cs0575.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0575.cs: destructors are only allowed in class types
-// Line: 5
-struct X {
-
- ~X ()
- {
- }
-
- static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs0592.cs b/mcs/errors/cs0592.cs
deleted file mode 100644
index 02dd459cdbe..00000000000
--- a/mcs/errors/cs0592.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// cs0592.cs : Attribute 'Simple' is not valid on this declaration type. It is valid on 'constructor' declarations only.
-// Line : 22
-
-using System;
-
-[AttributeUsage (AttributeTargets.Constructor, AllowMultiple = true)]
- public class SimpleAttribute : Attribute {
-
- string name = null;
-
- public string MyNamedArg;
-
- public SimpleAttribute (string name)
- {
- this.name = name;
- }
-
-
- }
-
-[Simple ("Dummy", MyNamedArg = "Dude!")]
- public class Blah {
-
- public static void Main ()
- {
- }
- }
-
-
diff --git a/mcs/errors/cs0601.cs b/mcs/errors/cs0601.cs
deleted file mode 100644
index 020787e74cf..00000000000
--- a/mcs/errors/cs0601.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0601.cs : The DllImport attribute must be specified on a method marked 'static' and 'extern'.
-// Line : 9
-
-using System;
-using System.Runtime.InteropServices;
-
-class Test {
- [DllImport("cygwin1.dll", EntryPoint="puts", CharSet=CharSet.Ansi)]
- public extern int puts (string name);
-
-}
diff --git a/mcs/errors/cs0616.cs b/mcs/errors/cs0616.cs
deleted file mode 100755
index ecb7f28cda7..00000000000
--- a/mcs/errors/cs0616.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0616.cs: 'FakeAttribute': is not an attribute class
-// Line: 8
-
-class FakeAttribute {
-}
-
-class T {
- [Fake]
- static int Main() {
- return 0;
- }
-}
diff --git a/mcs/errors/cs0617.cs b/mcs/errors/cs0617.cs
deleted file mode 100644
index e75266d9d1f..00000000000
--- a/mcs/errors/cs0617.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// cs0617,cs : 'MyNamedArg' is not a valid named attribute argument. Named attribute arguments must be fields which are not readonly, static or const, or properties with a set accessor which are not static.
-// Line : 20
-
-using System;
-
-[AttributeUsage (AttributeTargets.Class, AllowMultiple = true)]
- public class SimpleAttribute : Attribute {
-
- string name = null;
-
- public readonly string MyNamedArg;
-
- public SimpleAttribute (string name)
- {
- this.name = name;
- }
-
- }
-
-[Simple ("Dummy", MyNamedArg = "Dude!")]
- public class Blah {
-
- public static void Main ()
- {
- }
- }
diff --git a/mcs/errors/cs0621.cs b/mcs/errors/cs0621.cs
deleted file mode 100755
index 87bc932088c..00000000000
--- a/mcs/errors/cs0621.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-// cs0621.cs: X.method virtual or abstract methods can not be private
-// Line:
-class X {
- virtual void method () {}
-}
diff --git a/mcs/errors/cs0642.cs b/mcs/errors/cs0642.cs
deleted file mode 100755
index 9c73cd6baf1..00000000000
--- a/mcs/errors/cs0642.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-class X{
- static void Main ()
- {
- if (true);
- }
-}
diff --git a/mcs/errors/cs0644.cs b/mcs/errors/cs0644.cs
deleted file mode 100755
index 5e93f4ef509..00000000000
--- a/mcs/errors/cs0644.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0644.cs: Cannot inherit from special class
-// Line: 3
-class X : System.ValueType {
-}
diff --git a/mcs/errors/cs0645.cs b/mcs/errors/cs0645.cs
deleted file mode 100755
index ff866d9dcad..00000000000
--- a/mcs/errors/cs0645.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0645.cs: identifier too long
-// Line: 3
-class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa {
-}
diff --git a/mcs/errors/cs0646.cs b/mcs/errors/cs0646.cs
deleted file mode 100644
index 78b7f4e3c77..00000000000
--- a/mcs/errors/cs0646.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// cs0646.cs : Cannot specify the DefaultMember attribute on a type containing an indexer
-// Line : 8
-
-using System;
-using System.Reflection;
-
-[DefaultMember ("Item")]
-public class Foo {
-
- string bar;
-
- public static void Main ()
- {
- Console.WriteLine ("foo");
- }
-
- string this [int idx] {
- get {
- return "foo";
- }
- set {
- bar = value;
- }
- }
-}
-
diff --git a/mcs/errors/cs0649.cs b/mcs/errors/cs0649.cs
deleted file mode 100755
index 1642edd35bb..00000000000
--- a/mcs/errors/cs0649.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-// cs0649.cs: Field `X.s' is never assigned to, and will always have its default value null
-// Line: 4
-class X {
- string s;
-
- string Value {
- get {
- return s;
- }
- }
-}
diff --git a/mcs/errors/cs0654.cs b/mcs/errors/cs0654.cs
deleted file mode 100755
index 9622867128b..00000000000
--- a/mcs/errors/cs0654.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs0654.cs: Method referenced without argument list.
-// Line: 12
-class X {
- int a (int a)
- {
- return 0;
- }
-
- void b ()
- {
- int x = a;
- }
-}
diff --git a/mcs/errors/cs0658.cs b/mcs/errors/cs0658.cs
deleted file mode 100644
index e4da1e82b72..00000000000
--- a/mcs/errors/cs0658.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// cs0658.cs : Invalid attribute location "blah"
-// Line : 8
-
-public class MyClass {
-
- delegate int MyDelegate (int i, int j);
-
- [blah:Help("blah")]
- public static MyClass operator/ (MyClass i, MyClass j)
- {
-
- }
-
- public static implicit operator MyClass (Object o)
- {
-
- }
-}
diff --git a/mcs/errors/cs0664.cs b/mcs/errors/cs0664.cs
deleted file mode 100755
index daa1f39b717..00000000000
--- a/mcs/errors/cs0664.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0664.cs: Literal of type double cannot be implicity converted to Float, use F suffix
-// Line: 6
-class X {
- void A ()
- {
- float f = 2.0;
- }
-}
diff --git a/mcs/errors/cs0668.cs b/mcs/errors/cs0668.cs
deleted file mode 100755
index 04408a390d2..00000000000
--- a/mcs/errors/cs0668.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// cs0668.cs: Two indexers have different names, they should have the same name across the board.
-// Line:
-
-using System.Runtime.CompilerServices;
-class A {
- [IndexerName ("Blah")]
- int this [int a] {
- get { return 1; }
- }
-
- [IndexerName ("Foo")]
- int this [string b] {
- get { return 2; }
- }
-
- public static int Main ()
- {
- int a = 5;
-
- if (!(a is object))
- return 3;
-
- return 0;
- }
-}
-
-
-
diff --git a/mcs/errors/cs0677.cs b/mcs/errors/cs0677.cs
deleted file mode 100755
index 822724a9b53..00000000000
--- a/mcs/errors/cs0677.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-// cs0677.cs: X.a volatile field can not be of type "A"
-// Line: 8
-using System;
-
-struct A { int a; }
-
-class X {
- public volatile A a;
- static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs1001.cs b/mcs/errors/cs1001.cs
deleted file mode 100755
index d9fa6b29d28..00000000000
--- a/mcs/errors/cs1001.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// cs1001: identifier expected
-// Line: 8
-
-class T {
-
- // Change (args) to (string args) to fix it
- public static int Main (args)
- {
- }
-}
diff --git a/mcs/errors/cs1002.cs b/mcs/errors/cs1002.cs
deleted file mode 100755
index 65de1280ea9..00000000000
--- a/mcs/errors/cs1002.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// cs1002.cs: ; expected
-// Line: 8
-
-class T {
- void member ()
- {
- int a = 1 | 2
- int b;
- }
-}
diff --git a/mcs/errors/cs1008.cs b/mcs/errors/cs1008.cs
deleted file mode 100644
index 3c49e166dd8..00000000000
--- a/mcs/errors/cs1008.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1008.cs : Type byte, sbyte, short, ushort, int, uint, long, or ulong expected
-// Line : 7
-
-public class Blah {
-
- public enum MyEnum {
- Foo = "foo",
- Bar
- }
-
- public static void Main ()
- {
- }
-}
diff --git a/mcs/errors/cs1011.cs b/mcs/errors/cs1011.cs
deleted file mode 100755
index ce78e701617..00000000000
--- a/mcs/errors/cs1011.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs1011: Empty character literal
-// Line: 5
-
-class T {
- char c = '';
-}
diff --git a/mcs/errors/cs1012.cs b/mcs/errors/cs1012.cs
deleted file mode 100755
index 61e65b63a88..00000000000
--- a/mcs/errors/cs1012.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-// cs1012: Too many characters in character literal
-// Line: 5
-
-class x {
- char x = 'xx';
-}
diff --git a/mcs/errors/cs1019.cs b/mcs/errors/cs1019.cs
deleted file mode 100644
index 4fe30f842f7..00000000000
--- a/mcs/errors/cs1019.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// cs1019.cs : Overloadable unary operator expected
-// Line : 18
-
-public class MyClass {
-
- public int this[int ndx]
- {
- get { }
- set { }
- }
-
- public event EventHandler Click
- {
- add { }
- remove { }
- }
-
- public static MyClass operator/ (MyClass i)
- {
-
- }
-
- public static implicit operator MyClass (Object o)
- {
-
- }
-}
diff --git a/mcs/errors/cs102.cs b/mcs/errors/cs102.cs
deleted file mode 100755
index 68f366156f3..00000000000
--- a/mcs/errors/cs102.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs102.cs: The class 'X' already contains a definition for 'A'
-// Line: 6
-class X {
- const int A = 10;
-
- int A () {}
-}
diff --git a/mcs/errors/cs1020.cs b/mcs/errors/cs1020.cs
deleted file mode 100644
index 891a613331f..00000000000
--- a/mcs/errors/cs1020.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// cs1020.cs : Overloadable binary operator expected
-// Line : 19
-
-
-public class MyClass {
-
- public int this[int ndx]
- {
- get { }
- set { }
- }
-
- public event EventHandler Click
- {
- add { }
- remove { }
- }
-
- public static MyClass operator++ (MyClass i, MyClass j)
- {
-
- }
-
- public static implicit operator MyClass (Object o)
- {
-
- }
-}
diff --git a/mcs/errors/cs1032.cs b/mcs/errors/cs1032.cs
deleted file mode 100755
index e6640a68fe9..00000000000
--- a/mcs/errors/cs1032.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs1032: tokens seen before define
-// Line: 4
-class X {
-#define A
-
- static void Main () {
- }
-}
diff --git a/mcs/errors/cs1501-2.cs b/mcs/errors/cs1501-2.cs
deleted file mode 100755
index 18d3b1a381d..00000000000
--- a/mcs/errors/cs1501-2.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1501: no match for this argument list
-// Line: 11
-class X {
-
- X (int a)
- {
- }
-
- static void Main ()
- {
- new X ();
- }
-}
-
diff --git a/mcs/errors/cs1501.cs b/mcs/errors/cs1501.cs
deleted file mode 100755
index 10342181e28..00000000000
--- a/mcs/errors/cs1501.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs1501.cs: No overload for method `Base' takes `0' arguments
-// Line: 12
-class Base {
- Base (string x)
- {
- }
-}
-
-// Notice how there is no invocation to "base (something)"
-
-class Derived : Base {
- Derived ()
- {
- }
-}
diff --git a/mcs/errors/cs1510.cs b/mcs/errors/cs1510.cs
deleted file mode 100755
index 4feba3810f6..00000000000
--- a/mcs/errors/cs1510.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs1510: an lvalue is required for ref or out argument
-// Line: 11
-class X {
- public static void m (ref int i)
- {
- i++;
- }
-
- static void Main ()
- {
- m (ref 4);
- }
-}
diff --git a/mcs/errors/cs1511.cs b/mcs/errors/cs1511.cs
deleted file mode 100755
index 4ec26c689b4..00000000000
--- a/mcs/errors/cs1511.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1511.cs: Base modifier not allowed in static code
-// Line:
-
-class Y {
- public int a;
-}
-
-class X : Y {
-
- static void Main ()
- {
- base.a = 1;
- }
-}
diff --git a/mcs/errors/cs1513.cs b/mcs/errors/cs1513.cs
deleted file mode 100755
index 819528ced96..00000000000
--- a/mcs/errors/cs1513.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-namespace X {
-
-
diff --git a/mcs/errors/cs1518.cs b/mcs/errors/cs1518.cs
deleted file mode 100755
index 89036e1ee62..00000000000
--- a/mcs/errors/cs1518.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-//cs1518.cs: namespace can only contain class, interface, enum, struct or delegate
-// Line: 5
-namespace X {
-
- sealed fe {}
-}
diff --git a/mcs/errors/cs1520.cs b/mcs/errors/cs1520.cs
deleted file mode 100755
index 23dbafd0fcc..00000000000
--- a/mcs/errors/cs1520.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// cs1520: Class, struct or interface method must have a return type
-// Line: 9
-
-class test {
-
- // To fix add a return type
-
- public static Main (string[] args)
- {
- }
-}
diff --git a/mcs/errors/cs1523.cs b/mcs/errors/cs1523.cs
deleted file mode 100755
index fda07fd98f6..00000000000
--- a/mcs/errors/cs1523.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1523: case or default must precede code in switch statement
-// Line: 11
-
-class X {
-
- static void Main ()
- {
- int i = 0;
-
- switch (i){
- i = 4;
- }
- }
-}
diff --git a/mcs/errors/cs1524.cs b/mcs/errors/cs1524.cs
deleted file mode 100755
index b43976cc0bd..00000000000
--- a/mcs/errors/cs1524.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// cs1524.cs: expected catch or finally
-// Line: 12
-
-namespace Test {
- public class Test {
- public static int Main () {
- int a;
- try {
- a = 1;
- }
-
- return 0;
- }
- }
-}
diff --git a/mcs/errors/cs1525.cs b/mcs/errors/cs1525.cs
deleted file mode 100755
index dc1459ceac0..00000000000
--- a/mcs/errors/cs1525.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs1525: Invalid expression term.
-// Line: 7
-class X {
- X ()
- {
- label1:
- }
-}
diff --git a/mcs/errors/cs1526.cs b/mcs/errors/cs1526.cs
deleted file mode 100755
index 582d451ea89..00000000000
--- a/mcs/errors/cs1526.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs1526: new expression requires () or [] after type
-// Line: 6
-class X {
- static void Main ()
- {
- X x = new X;
- }
-}
diff --git a/mcs/errors/cs1527.cs b/mcs/errors/cs1527.cs
deleted file mode 100755
index 663f880cd58..00000000000
--- a/mcs/errors/cs1527.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs1527.cs: namespace elements cant explicitly be declared protected or private
-// Line:
-private class X {
-}
diff --git a/mcs/errors/cs1528.cs b/mcs/errors/cs1528.cs
deleted file mode 100755
index 7223adc8f40..00000000000
--- a/mcs/errors/cs1528.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1528.cs: cant specify constructor arguments in declaration
-// Line:
-class X {
- X (int a)
- {
- }
-}
-
-class Y {
- static void Main ()
- {
- X x (4);
- }
-}
diff --git a/mcs/errors/cs1529.cs b/mcs/errors/cs1529.cs
deleted file mode 100755
index d822cb7cef1..00000000000
--- a/mcs/errors/cs1529.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs1529.cs: Using clause must precede all other namespace elements
-// Line: 4
-class X { }
-using System;
diff --git a/mcs/errors/cs1530.cs b/mcs/errors/cs1530.cs
deleted file mode 100755
index 7ed13b49dcf..00000000000
--- a/mcs/errors/cs1530.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs1530.cs: New not allowed on namespace declarations
-// Line:
-namespace A {
-
- new class X {
- }
-}
diff --git a/mcs/errors/cs1552.cs b/mcs/errors/cs1552.cs
deleted file mode 100755
index b64f87bf1c2..00000000000
--- a/mcs/errors/cs1552.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// cs1552.cs: Array type specified, [] must appear before parameter name
-// Line: 8
-
-class T {
- // To fix: change (string args[]) to (string [] args)
-
- public static int Main (string args[])
- {
- }
-}
diff --git a/mcs/errors/cs1579.cs b/mcs/errors/cs1579.cs
deleted file mode 100755
index 93fc43044af..00000000000
--- a/mcs/errors/cs1579.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-// cs1579.cs: foreach statement cannot operate on variables of type X because X does not contain a definition for GetEnumerator or is not accessible
-// Line: 10
-class X {
-}
-
-class Y {
- void yy (X b)
- {
-
- foreach (object a in b)
- ;
- }
-}
diff --git a/mcs/errors/cs1593.cs b/mcs/errors/cs1593.cs
deleted file mode 100644
index 755cd703170..00000000000
--- a/mcs/errors/cs1593.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// cs1593.cs : Delegate 'Blah.MyDelegate' does not take '1' arguments
-// Line : 21
-
-using System;
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static int Main ()
- {
- Blah i = new Blah ();
-
- MyDelegate del = new MyDelegate (i.Foo);
-
- int number = del (2);
-
- if (number == 5)
- return 0;
- else
- return 1;
-
- }
-
-}
diff --git a/mcs/errors/cs1594.cs b/mcs/errors/cs1594.cs
deleted file mode 100644
index 0ffb3d9e761..00000000000
--- a/mcs/errors/cs1594.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// cs1594.cs : Delegate 'Blah.MyDelegate' has some invalid arguments.
-// Line : 21
-
-using System;
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static int Main ()
- {
- Blah i = new Blah ();
-
- MyDelegate del = new MyDelegate (i.Foo);
-
- int number = del (2, "a string");
-
- if (number == 5)
- return 0;
- else
- return 1;
-
- }
-
-}
diff --git a/mcs/errors/cs1604.cs b/mcs/errors/cs1604.cs
deleted file mode 100755
index 1e87da758a1..00000000000
--- a/mcs/errors/cs1604.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// cs1604.cs: m is a readonly variable
-// line: 10
-using System.IO;
-
-class X {
-
- static void Main ()
- {
- using (MemoryStream m = new MemoryStream ()){
- m = null;
- }
- }
-}
-
diff --git a/mcs/errors/cs5001.cs b/mcs/errors/cs5001.cs
deleted file mode 100755
index 712760b76e0..00000000000
--- a/mcs/errors/cs5001.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-//cs5001: Program x does not have an entry point defined
-
-using System;
-using System.Collections;
-
-namespace Butt {
-}
-
diff --git a/mcs/errors/errors.txt b/mcs/errors/errors.txt
deleted file mode 100755
index 4f7050be037..00000000000
--- a/mcs/errors/errors.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-We use negative numbers for the compiler, and leave the possitive
-numbers to match the Microsoft numbers:
-
--1 An Primary Expression was parsed, when a Type was expected.
- This happens because my parser knowledge is limited, and I
- am not good at writing grammars. It is still an error,
- but if I were smarter, I would have found a Bison/Yacc way
- of handling it.
-
--2 Internal error, an interface is being defined inside an
- interface (This should never happen).
-
--3 Constant type is not one of sbyte, byte, short, ushort, int,
- uint, long, ulong, char, float, double, decimal, bool, string, enum
- or null type.
-
--5 A search for a name on a Type returned matches that contain
- methods and non-methods. They have the same name, and I do
- not know how this is possible to begin with.
-
--6 Generic internal compiler error.
-
--7 Internal compiler error/library error: no default constructor
- for a built-in type. Ie, decimal (int 32)
-
--8 User-defined conversion cannot convert from or to object type.
-
--9 User-defined conversion cannot convert from or to an interface type.
-
--10 User-defined conversion cannot convert between types that derive
- from each other.
-
--11 Delegate creation expression takes only one argument
-
--12 More than one integral conversion exists for the type on a
- switch statement.
-
--13 No return with a value found. Warning, since we currently
- do not perform flow analysis, and can not tell whether a
- ret is required or not.
-
--14 Invalid number passed to probe
-
--15 Can not locate default assembly path
-
--16 Can not use System.Enum.ToObject (type, ConstantValue) with
- user defined types.
-
--17 A type has already been defined (try --nostdlib)
-
--18 Do not know how to generate debugging information for this platform.
-
--19 Can not find required utility function in the core libraries.
-
--20 Cannot find attribute type Blah (maybe you forgot to set the
- usage using the AttributeUsage attribute ?).
-
--21 Bug in Microsoft compiler while applying named attribute for
- StructLayout.CharSet value.
-
--22 Location of previous error
-
--23 .NET runtime error when encoding attributes whose constructor
- takes an object, but an enumeration value that is boxed is
- passed.
-
- Sample:
- using System.ComponentModel;
- [DefaultValue (CollectionChangeAction.Add)]
- class X { static void Main () { } }
diff --git a/mcs/errors/fail b/mcs/errors/fail
deleted file mode 100755
index 7ff0429db42..00000000000
--- a/mcs/errors/fail
+++ /dev/null
@@ -1,30 +0,0 @@
-The following tests failed:
-
-cs0051.cs: We don't complain about inconsistent accessibility.
-cs0060.cs: We don't complain about inconsistent accessibility.
-cs0108.cs: We should re-enable the test code in the compiler
-cs0110.cs: Stack overflow in the compiler
-cs0111.cs: We don't complain about second occurance of method definition.
-cs0118.cs: We report the error, but the CSC error gives more information.
-cs0136.cs: Similar error reported (reuse of variable name, 128)
-cs0136-2.cs: Similar error reported (reuse of variable name, 128)
-cs0164.cs: We dont emit the warning for an unused label
-cs0165.cs: We need data flow analysis
-cs0165-2.cs: We need data flow analysis
-cs0171.cs: We do not track unassigned struct fields on struct constructors
-cs0216.cs: We do not report missing operators.
-cs0234.cs: Will be hard to fix;
-cs0255.cs: Error isn't flagged.
-cs0523.cs: Error isn't flagged.
-cs0529.cs: We get error CS0146 instead
-cs0654.cs: Compiler crash
-cs1001.cs: Compiler emits syntax error; Its ok.
-cs1513.cs: Syntax error; We could provide better message
-cs1518.cs: Syntax error; We could provide better message
-cs1525.cs: Syntax error; We could provide better message
-cs1528.cs: Syntax error; We could provide better message
-cs1529.cs: Syntax error; We could provide better message
-cs1552.cs: Syntax error; We could provide better message
-cs1604.cs: Error isn't flagged.
-cs-20.cs: Attribute error isn't flagged
-
diff --git a/mcs/errors/makefile b/mcs/errors/makefile
deleted file mode 100755
index bbc7930bb85..00000000000
--- a/mcs/errors/makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Compile at the maximum warning level to probe for warnings
-#
-#MCS=mono ../mcs/mcs.exe --wlevel 4 # for linux
-MCS=../mcs/mcs.exe --wlevel 4 # for windows
-
-
-all:
- @ failed=false; \
- for i in cs*.cs; do \
- case $$i in \
- cs[0-9]*-[0-9]*cs) \
- error=`echo $$i | sed -e 's/cs*//' -e 's/.cs//' -e 's/-.*//'`; \
- ;;\
- cs[0-9-]*cs) \
- error=`echo $$i | sed -e 's/cs*//' -e 's/.cs//'`; \
- ;;\
- esac; \
- echo -n "Running test $$i ... "; \
- if $(MCS) --unsafe --expect-error $$error $$i > /dev/null; \
- then echo OK; \
- else echo FAILED; \
- flist="$$flist $$i"; \
- failed=true; \
- fi; \
- done; \
- if $$failed; then \
- echo "The following tests failed: $$flist"; \
- else \
- echo All tests passed; \
- fi \ No newline at end of file
diff --git a/mcs/jay/.cvsignore b/mcs/jay/.cvsignore
deleted file mode 100755
index 75b36e0911d..00000000000
--- a/mcs/jay/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-jay
-jay.exe
diff --git a/mcs/jay/ACKNOWLEDGEMENTS b/mcs/jay/ACKNOWLEDGEMENTS
deleted file mode 100644
index b66bb250645..00000000000
--- a/mcs/jay/ACKNOWLEDGEMENTS
+++ /dev/null
@@ -1,25 +0,0 @@
- Berkeley Yacc owes much to the unflagging efforts of Keith Bostic.
-His badgering kept me working on it long after I was ready to quit.
-
- Berkeley Yacc is based on the excellent algorithm for computing LALR(1)
-lookaheads developed by Tom Pennello and Frank DeRemer. The algorithm is
-described in their almost impenetrable article in TOPLAS 4,4.
-
- Finally, much of the credit for the latest version must go to those
-who pointed out deficiencies of my earlier releases. Among the most
-prolific contributors were
-
- Benson I. Margulies
- Dave Gentzel
- Antoine Verheijen
- Peter S. Housel
- Dale Smith
- Ozan Yigit
- John Campbell
- Bill Sommerfeld
- Paul Hilfinger
- Gary Bridgewater
- Dave Bakken
- Dan Lanciani
- Richard Sargent
- Parag Patel
diff --git a/mcs/jay/ChangeLog b/mcs/jay/ChangeLog
deleted file mode 100755
index 20b2931583a..00000000000
--- a/mcs/jay/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2001-07-15 Sean MacIsaac <macisaac@ximian.com>
-
- * makefile: added windows and unix targets.
-
-2001-07-14 Sean MacIsaac <macisaac@ximian.com>
-
- * main.c: fixed error in command line flag -c if it was not first
- option.
-
diff --git a/mcs/jay/NEW_FEATURES b/mcs/jay/NEW_FEATURES
deleted file mode 100644
index b030c625b00..00000000000
--- a/mcs/jay/NEW_FEATURES
+++ /dev/null
@@ -1,46 +0,0 @@
- The -r option has been implemented. The -r option tells Yacc to
-put the read-only tables in y.tab.c and the code and variables in
-y.code.c. Keith Bostic asked for this option so that :yyfix could be
-eliminated.
-
- The -l and -t options have been implemented. The -l option tells
-Yacc not to include #line directives in the code it produces. The -t
-option causes debugging code to be included in the compiled parser.
-
- The code for error recovery has been changed to implement the same
-algorithm as AT&T Yacc. There will still be differences in the way
-error recovery works because AT&T Yacc uses more default reductions
-than Berkeley Yacc.
-
- The environment variable TMPDIR determines the directory where
-temporary files will be created. If TMPDIR is defined, temporary files
-will be created in the directory whose pathname is the value of TMPDIR.
-By default, temporary files are created in /tmp.
-
- The keywords are now case-insensitive. For example, %nonassoc,
-%NONASSOC, %NonAssoc, and %nOnAsSoC are all equivalent.
-
- Commas and semicolons that are not part of C code are treated as
-commentary.
-
- Line-end comments, as in BCPL, are permitted. Line-end comments
-begin with // and end at the next end-of-line. Line-end comments are
-permitted in C code; they are converted to C comments on output.
-
- The form of y.output files has been changed to look more like
-those produced by AT&T Yacc.
-
- A new kind of declaration has been added. The form of the declaration
-is
-
- %ident string
-
-where string is a sequence of characters begining with a double quote
-and ending with either a double quote or the next end-of-line, whichever
-comes first. The declaration will cause a #ident directive to be written
-near the start of the output file.
-
- If a parser has been compiled with debugging code, that code can be
-enabled by setting an environment variable. If the environment variable
-YYDEBUG is set to 0, debugging output is suppressed. If it is set to 1,
-debugging output is written to standard output.
diff --git a/mcs/jay/NOTES b/mcs/jay/NOTES
deleted file mode 100644
index 9db3c96ce1b..00000000000
--- a/mcs/jay/NOTES
+++ /dev/null
@@ -1,9 +0,0 @@
-Berkeley Yacc reflects its origins. The reason so many routines
-use exactly six register variables is that Berkeley Yacc was
-developed on a VAX using PCC. PCC placed at most six variables
-in registers. I went to considerable effort to find which six
-variables most belonged in registers. Changes in machines and
-compilers make that effort worthless, perhaps even harmful.
-
-The code contains many instances where address calculations are
-performed in particular ways to optimize the code for the VAX.
diff --git a/mcs/jay/README b/mcs/jay/README
deleted file mode 100644
index e3995505b8a..00000000000
--- a/mcs/jay/README
+++ /dev/null
@@ -1,9 +0,0 @@
-This is a port of Jay to C#, the original Jay can be found here:
- http://www.informatik.uni-osnabrueck.de/bernd/jay/
-
-This is a temporary solution as we move to a Bison-generated parser
-as it would provide better error recovery.
-
-The original README from Jay is in `README.jay'
-
-Miguel
diff --git a/mcs/jay/README.jay b/mcs/jay/README.jay
deleted file mode 100644
index 94b7b72e6e4..00000000000
--- a/mcs/jay/README.jay
+++ /dev/null
@@ -1,55 +0,0 @@
- This version of Berkeley Yacc was taken from the BSD-Lite CD and targeted
-to Java by
-
- axel.schreiner@informatik.uni-osnabrueck.de
-
-Makefile -> makefile removed Berkeleyisms, call it jay
-defs.h eliminate -dlpr options, %union, output_file, #ident
- eliminate sekeleton.c references
-error.c eliminate %union
-main.c eliminate -dlpr options, %union, output_file
-output.c eliminate -dlpr options, %union, output_file
- fix #define, short, -t/yyDebug
- respell YYERRCODE, YYTABLESIZE, YYFINAL, YYMAXTOKEN
- output trailer last
- switch to filter behaviour
-reader.c eliminate output_file, #ident
- #line -> // line, pass //
- yyvsp[] -> yyVals[yyTop], yyval -> yyVal
-skeleton.c -> skeleton Java skeleton
-test removed
-yacc.1 -> jay.1 adapted
-yyfix.* removed
-
-Types: there is a significant difference. yacc uses %union to cast the value
-stack and <tag> to select alternatives. This works for l- and r-values alike.
-jay uses Object as the value stack and <tag> to set a class. l-values must not
-be cast. $n should not be assigned to, but $$ usually is. $n is referenced,
-but $$ usually is not. Consequently jay casts $n and $<tag>$ but not $<>n
-and $$. This makes assignment to $n references to $$ kludgily possible.
-As another kludge, to prevent 'untyped' messages and to avoid unnecessary
-casts, casts to "Object" are not emitted.
--------------------------------------------------------------------------------
- Berkeley Yacc is an LALR(1) parser generator. Berkeley Yacc has been made
-as compatible as possible with AT&T Yacc. Berkeley Yacc can accept any input
-specification that conforms to the AT&T Yacc documentation. Specifications
-that take advantage of undocumented features of AT&T Yacc will probably be
-rejected.
-
- Berkeley Yacc is distributed with no warranty whatever. The code is certain
-to contain errors. Neither the author nor any contributor takes responsibility
-for any consequences of its use.
-
- Berkeley Yacc is in the public domain. The data structures and algorithms
-used in Berkeley Yacc are all either taken from documents available to the
-general public or are inventions of the author. Anyone may freely distribute
-source or binary forms of Berkeley Yacc whether unchanged or modified.
-Distributers may charge whatever fees they can obtain for Berkeley Yacc.
-Programs generated by Berkeley Yacc may be distributed freely.
-
- Please report bugs to
-
- robert.corbett@eng.Sun.COM
-
-Include a small example if possible. Please include the banner string from
-skeleton.c with the bug report. Do not expect rapid responses.
diff --git a/mcs/jay/closure.c b/mcs/jay/closure.c
deleted file mode 100644
index 5f63c5f32cd..00000000000
--- a/mcs/jay/closure.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)closure.c 5.3 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include "defs.h"
-
-short *itemset;
-short *itemsetend;
-unsigned *ruleset;
-
-static unsigned *first_derives;
-static unsigned *EFF;
-
-
-set_EFF()
-{
- register unsigned *row;
- register int symbol;
- register short *sp;
- register int rowsize;
- register int i;
- register int rule;
-
- rowsize = WORDSIZE(nvars);
- EFF = NEW2(nvars * rowsize, unsigned);
-
- row = EFF;
- for (i = start_symbol; i < nsyms; i++)
- {
- sp = derives[i];
- for (rule = *sp; rule > 0; rule = *++sp)
- {
- symbol = ritem[rrhs[rule]];
- if (ISVAR(symbol))
- {
- symbol -= start_symbol;
- SETBIT(row, symbol);
- }
- }
- row += rowsize;
- }
-
- reflexive_transitive_closure(EFF, nvars);
-
-#ifdef DEBUG
- print_EFF();
-#endif
-}
-
-
-set_first_derives()
-{
- register unsigned *rrow;
- register unsigned *vrow;
- register int j;
- register unsigned k;
- register unsigned cword;
- register short *rp;
-
- int rule;
- int i;
- int rulesetsize;
- int varsetsize;
-
- rulesetsize = WORDSIZE(nrules);
- varsetsize = WORDSIZE(nvars);
- first_derives = NEW2(nvars * rulesetsize, unsigned) - ntokens * rulesetsize;
-
- set_EFF();
-
- rrow = first_derives + ntokens * rulesetsize;
- for (i = start_symbol; i < nsyms; i++)
- {
- vrow = EFF + ((i - ntokens) * varsetsize);
- k = BITS_PER_WORD;
- for (j = start_symbol; j < nsyms; k++, j++)
- {
- if (k >= BITS_PER_WORD)
- {
- cword = *vrow++;
- k = 0;
- }
-
- if (cword & (1 << k))
- {
- rp = derives[j];
- while ((rule = *rp++) >= 0)
- {
- SETBIT(rrow, rule);
- }
- }
- }
-
- vrow += varsetsize;
- rrow += rulesetsize;
- }
-
-#ifdef DEBUG
- print_first_derives();
-#endif
-
- FREE(EFF);
-}
-
-
-closure(nucleus, n)
-short *nucleus;
-int n;
-{
- register int ruleno;
- register unsigned word;
- register unsigned i;
- register short *csp;
- register unsigned *dsp;
- register unsigned *rsp;
- register int rulesetsize;
-
- short *csend;
- unsigned *rsend;
- int symbol;
- int itemno;
-
- rulesetsize = WORDSIZE(nrules);
- rsp = ruleset;
- rsend = ruleset + rulesetsize;
- for (rsp = ruleset; rsp < rsend; rsp++)
- *rsp = 0;
-
- csend = nucleus + n;
- for (csp = nucleus; csp < csend; ++csp)
- {
- symbol = ritem[*csp];
- if (ISVAR(symbol))
- {
- dsp = first_derives + symbol * rulesetsize;
- rsp = ruleset;
- while (rsp < rsend)
- *rsp++ |= *dsp++;
- }
- }
-
- ruleno = 0;
- itemsetend = itemset;
- csp = nucleus;
- for (rsp = ruleset; rsp < rsend; ++rsp)
- {
- word = *rsp;
- if (word)
- {
- for (i = 0; i < BITS_PER_WORD; ++i)
- {
- if (word & (1 << i))
- {
- itemno = rrhs[ruleno+i];
- while (csp < csend && *csp < itemno)
- *itemsetend++ = *csp++;
- *itemsetend++ = itemno;
- while (csp < csend && *csp == itemno)
- ++csp;
- }
- }
- }
- ruleno += BITS_PER_WORD;
- }
-
- while (csp < csend)
- *itemsetend++ = *csp++;
-
-#ifdef DEBUG
- print_closure(n);
-#endif
-}
-
-
-
-finalize_closure()
-{
- FREE(itemset);
- FREE(ruleset);
- FREE(first_derives + ntokens * WORDSIZE(nrules));
-}
-
-
-#ifdef DEBUG
-
-print_closure(n)
-int n;
-{
- register short *isp;
-
- printf("\n\nn = %d\n\n", n);
- for (isp = itemset; isp < itemsetend; isp++)
- printf(" %d\n", *isp);
-}
-
-
-print_EFF()
-{
- register int i, j;
- register unsigned *rowp;
- register unsigned word;
- register unsigned k;
-
- printf("\n\nEpsilon Free Firsts\n");
-
- for (i = start_symbol; i < nsyms; i++)
- {
- printf("\n%s", symbol_name[i]);
- rowp = EFF + ((i - start_symbol) * WORDSIZE(nvars));
- word = *rowp++;
-
- k = BITS_PER_WORD;
- for (j = 0; j < nvars; k++, j++)
- {
- if (k >= BITS_PER_WORD)
- {
- word = *rowp++;
- k = 0;
- }
-
- if (word & (1 << k))
- printf(" %s", symbol_name[start_symbol + j]);
- }
- }
-}
-
-
-print_first_derives()
-{
- register int i;
- register int j;
- register unsigned *rp;
- register unsigned cword;
- register unsigned k;
-
- printf("\n\n\nFirst Derives\n");
-
- for (i = start_symbol; i < nsyms; i++)
- {
- printf("\n%s derives\n", symbol_name[i]);
- rp = first_derives + i * WORDSIZE(nrules);
- k = BITS_PER_WORD;
- for (j = 0; j <= nrules; k++, j++)
- {
- if (k >= BITS_PER_WORD)
- {
- cword = *rp++;
- k = 0;
- }
-
- if (cword & (1 << k))
- printf(" %d\n", j);
- }
- }
-
- fflush(stdout);
-}
-
-#endif
diff --git a/mcs/jay/defs.h b/mcs/jay/defs.h
deleted file mode 100644
index ac1d63f53a3..00000000000
--- a/mcs/jay/defs.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- *
- * @(#)defs.h 5.6 (Berkeley) 5/24/93
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-
-
-/* machine-dependent definitions */
-/* the following definitions are for the Tahoe */
-/* they might have to be changed for other machines */
-
-/* MAXCHAR is the largest unsigned character value */
-/* MAXSHORT is the largest value of a C short */
-/* MINSHORT is the most negative value of a C short */
-/* MAXTABLE is the maximum table size */
-/* BITS_PER_WORD is the number of bits in a C unsigned */
-/* WORDSIZE computes the number of words needed to */
-/* store n bits */
-/* BIT returns the value of the n-th bit starting */
-/* from r (0-indexed) */
-/* SETBIT sets the n-th bit starting from r */
-
-#define MAXCHAR 255
-#define MAXSHORT 32767
-#define MINSHORT -32768
-#define MAXTABLE 32500
-#define BITS_PER_WORD 32
-#define WORDSIZE(n) (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
-#define BIT(r, n) ((((r)[(n)>>5])>>((n)&31))&1)
-#define SETBIT(r, n) ((r)[(n)>>5]|=((unsigned)1<<((n)&31)))
-
-
-/* character names */
-
-#define NUL '\0' /* the null character */
-#define NEWLINE '\n' /* line feed */
-#define SP ' ' /* space */
-#define BS '\b' /* backspace */
-#define HT '\t' /* horizontal tab */
-#define VT '\013' /* vertical tab */
-#define CR '\r' /* carriage return */
-#define FF '\f' /* form feed */
-#define QUOTE '\'' /* single quote */
-#define DOUBLE_QUOTE '\"' /* double quote */
-#define BACKSLASH '\\' /* backslash */
-
-
-/* defines for constructing filenames */
-
-#define CODE_SUFFIX ".code.c"
-#define DEFINES_SUFFIX ".tab.h"
-#define OUTPUT_SUFFIX ".tab.c"
-#define VERBOSE_SUFFIX ".output"
-
-
-/* keyword codes */
-
-#define TOKEN 0
-#define LEFT 1
-#define RIGHT 2
-#define NONASSOC 3
-#define MARK 4
-#define TEXT 5
-#define TYPE 6
-#define START 7
-
-
-/* symbol classes */
-
-#define UNKNOWN 0
-#define TERM 1
-#define NONTERM 2
-
-
-/* the undefined value */
-
-#define UNDEFINED (-1)
-
-
-/* action codes */
-
-#define SHIFT 1
-#define REDUCE 2
-
-
-/* character macros */
-
-#define IS_IDENT(c) (isalnum(c) || (c) == '_' || (c) == '.' || (c) == '$')
-#define IS_OCTAL(c) ((c) >= '0' && (c) <= '7')
-#define NUMERIC_VALUE(c) ((c) - '0')
-
-
-/* symbol macros */
-
-#define ISTOKEN(s) ((s) < start_symbol)
-#define ISVAR(s) ((s) >= start_symbol)
-
-
-/* storage allocation macros */
-
-#define CALLOC(k,n) (calloc((unsigned)(k),(unsigned)(n)))
-#define FREE(x) (free((char*)(x)))
-#define MALLOC(n) (malloc((unsigned)(n)))
-#define NEW(t) ((t*)allocate(sizeof(t)))
-#define NEW2(n,t) ((t*)allocate((unsigned)((n)*sizeof(t))))
-#define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n)))
-
-
-/* the structure of a symbol table entry */
-
-typedef struct bucket bucket;
-struct bucket
-{
- struct bucket *link;
- struct bucket *next;
- char *name;
- char *tag;
- short value;
- short index;
- short prec;
- char class;
- char assoc;
-};
-
-
-/* the structure of the LR(0) state machine */
-
-typedef struct core core;
-struct core
-{
- struct core *next;
- struct core *link;
- short number;
- short accessing_symbol;
- short nitems;
- short items[1];
-};
-
-
-/* the structure used to record shifts */
-
-typedef struct shifts shifts;
-struct shifts
-{
- struct shifts *next;
- short number;
- short nshifts;
- short shift[1];
-};
-
-
-/* the structure used to store reductions */
-
-typedef struct reductions reductions;
-struct reductions
-{
- struct reductions *next;
- short number;
- short nreds;
- short rules[1];
-};
-
-
-/* the structure used to represent parser actions */
-
-typedef struct action action;
-struct action
-{
- struct action *next;
- short symbol;
- short number;
- short prec;
- char action_code;
- char assoc;
- char suppressed;
-};
-
-
-/* global variables */
-
-extern char tflag;
-extern char vflag;
-
-extern char *myname;
-extern char *cptr;
-extern char *line;
-extern int lineno;
-extern int outline;
-
-extern char *action_file_name;
-extern char *input_file_name;
-extern char *prolog_file_name;
-extern char *local_file_name;
-extern char *verbose_file_name;
-
-extern FILE *action_file;
-extern FILE *input_file;
-extern FILE *prolog_file;
-extern FILE *local_file;
-extern FILE *verbose_file;
-
-extern int nitems;
-extern int nrules;
-extern int nsyms;
-extern int ntokens;
-extern int nvars;
-extern int ntags;
-
-extern char *line_format;
-
-extern int start_symbol;
-extern char **symbol_name;
-extern short *symbol_value;
-extern short *symbol_prec;
-extern char *symbol_assoc;
-
-extern short *ritem;
-extern short *rlhs;
-extern short *rrhs;
-extern short *rprec;
-extern char *rassoc;
-
-extern short **derives;
-extern char *nullable;
-
-extern bucket *first_symbol;
-extern bucket *last_symbol;
-
-extern int nstates;
-extern core *first_state;
-extern shifts *first_shift;
-extern reductions *first_reduction;
-extern short *accessing_symbol;
-extern core **state_table;
-extern shifts **shift_table;
-extern reductions **reduction_table;
-extern unsigned *LA;
-extern short *LAruleno;
-extern short *lookaheads;
-extern short *goto_map;
-extern short *from_state;
-extern short *to_state;
-
-extern action **parser;
-extern int SRtotal;
-extern int RRtotal;
-extern short *SRconflicts;
-extern short *RRconflicts;
-extern short *defred;
-extern short *rules_used;
-extern short nunused;
-extern short final_state;
-
-/* global functions */
-
-extern char *allocate();
-extern bucket *lookup();
-extern bucket *make_bucket();
-
-
-/* system variables */
-
-extern int errno;
-
-
-/* system functions */
-
-extern void free();
-extern char *calloc();
-extern char *malloc();
-extern char *realloc();
-extern char *strcpy();
diff --git a/mcs/jay/depend b/mcs/jay/depend
deleted file mode 100644
index 134445ffddd..00000000000
--- a/mcs/jay/depend
+++ /dev/null
@@ -1,11 +0,0 @@
-closure.o: closure.c defs.h
-error.o: error.c defs.h
-lalr.o: lalr.c defs.h
-lr0.o: lr0.c defs.h
-main.o: main.c defs.h
-mkpar.o: mkpar.c defs.h
-output.o: output.c defs.h
-reader.o: reader.c defs.h
-symtab.o: symtab.c defs.h
-verbose.o: verbose.c defs.h
-warshall.o: warshall.c defs.h
diff --git a/mcs/jay/error.c b/mcs/jay/error.c
deleted file mode 100644
index dd8bf291c20..00000000000
--- a/mcs/jay/error.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)error.c 5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
-
-/* routines for printing error messages */
-
-#include "defs.h"
-
-
-fatal(msg)
-char *msg;
-{
- fprintf(stderr, "%s: f - %s\n", myname, msg);
- done(2);
-}
-
-
-no_space()
-{
- fprintf(stderr, "%s: f - out of space\n", myname);
- done(2);
-}
-
-
-open_error(filename)
-char *filename;
-{
- fprintf(stderr, "%s: f - cannot open \"%s\"\n", myname, filename);
- done(2);
-}
-
-
-unexpected_EOF()
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unexpected end-of-file\n",
- myname, lineno, input_file_name);
- done(1);
-}
-
-
-print_pos(st_line, st_cptr)
-char *st_line;
-char *st_cptr;
-{
- register char *s;
-
- if (st_line == 0) return;
- for (s = st_line; *s != '\n'; ++s)
- {
- if (isprint(*s) || *s == '\t')
- putc(*s, stderr);
- else
- putc('?', stderr);
- }
- putc('\n', stderr);
- for (s = st_line; s < st_cptr; ++s)
- {
- if (*s == '\t')
- putc('\t', stderr);
- else
- putc(' ', stderr);
- }
- putc('^', stderr);
- putc('\n', stderr);
-}
-
-
-syntax_error(st_lineno, st_line, st_cptr)
-int st_lineno;
-char *st_line;
-char *st_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", syntax error\n",
- myname, st_lineno, input_file_name);
- print_pos(st_line, st_cptr);
- done(1);
-}
-
-
-unterminated_comment(c_lineno, c_line, c_cptr)
-int c_lineno;
-char *c_line;
-char *c_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unmatched /*\n",
- myname, c_lineno, input_file_name);
- print_pos(c_line, c_cptr);
- done(1);
-}
-
-
-unterminated_string(s_lineno, s_line, s_cptr)
-int s_lineno;
-char *s_line;
-char *s_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unterminated string\n",
- myname, s_lineno, input_file_name);
- print_pos(s_line, s_cptr);
- done(1);
-}
-
-
-unterminated_text(t_lineno, t_line, t_cptr)
-int t_lineno;
-char *t_line;
-char *t_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unmatched %%{\n",
- myname, t_lineno, input_file_name);
- print_pos(t_line, t_cptr);
- done(1);
-}
-
-
-illegal_tag(t_lineno, t_line, t_cptr)
-int t_lineno;
-char *t_line;
-char *t_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal tag\n",
- myname, t_lineno, input_file_name);
- print_pos(t_line, t_cptr);
- done(1);
-}
-
-
-illegal_character(c_cptr)
-char *c_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal character\n",
- myname, lineno, input_file_name);
- print_pos(line, c_cptr);
- done(1);
-}
-
-
-used_reserved(s)
-char *s;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal use of reserved symbol \
-%s\n", myname, lineno, input_file_name, s);
- done(1);
-}
-
-
-tokenized_start(s)
-char *s;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s cannot be \
-declared to be a token\n", myname, lineno, input_file_name, s);
- done(1);
-}
-
-
-retyped_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the type of %s has been \
-redeclared\n", myname, lineno, input_file_name, s);
-}
-
-
-reprec_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the precedence of %s has been \
-redeclared\n", myname, lineno, input_file_name, s);
-}
-
-
-revalued_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the value of %s has been \
-redeclared\n", myname, lineno, input_file_name, s);
-}
-
-
-terminal_start(s)
-char *s;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s is a \
-token\n", myname, lineno, input_file_name, s);
- done(1);
-}
-
-
-restarted_warning()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the start symbol has been \
-redeclared\n", myname, lineno, input_file_name);
-}
-
-
-no_grammar()
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", no grammar has been \
-specified\n", myname, lineno, input_file_name);
- done(1);
-}
-
-
-terminal_lhs(s_lineno)
-int s_lineno;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", a token appears on the lhs \
-of a production\n", myname, s_lineno, input_file_name);
- done(1);
-}
-
-
-prec_redeclared()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", conflicting %%prec \
-specifiers\n", myname, lineno, input_file_name);
-}
-
-
-unterminated_action(a_lineno, a_line, a_cptr)
-int a_lineno;
-char *a_line;
-char *a_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", unterminated action\n",
- myname, a_lineno, input_file_name);
- print_pos(a_line, a_cptr);
- done(1);
-}
-
-
-dollar_warning(a_lineno, i)
-int a_lineno;
-int i;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", $%d references beyond the \
-end of the current rule\n", myname, a_lineno, input_file_name, i);
-}
-
-
-dollar_error(a_lineno, a_line, a_cptr)
-int a_lineno;
-char *a_line;
-char *a_cptr;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", illegal $-name\n",
- myname, a_lineno, input_file_name);
- print_pos(a_line, a_cptr);
- done(1);
-}
-
-
-untyped_lhs()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", $$ is untyped\n",
- myname, lineno, input_file_name);
- /** done(1); */
-}
-
-
-untyped_rhs(i, s)
-int i;
-char *s;
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", $%d (%s) is untyped\n",
- myname, lineno, input_file_name, i, s);
- /** done(1); */
-}
-
-
-unknown_rhs(i)
-int i;
-{
- fprintf(stderr, "%s: e - line %d of \"%s\", $%d is untyped\n",
- myname, lineno, input_file_name, i);
- done(1);
-}
-
-
-default_action_warning()
-{
- fprintf(stderr, "%s: w - line %d of \"%s\", the default action assigns an \
-undefined value to $$\n", myname, lineno, input_file_name);
-}
-
-
-undefined_goal(s)
-char *s;
-{
- fprintf(stderr, "%s: e - the start symbol %s is undefined\n", myname, s);
- done(1);
-}
-
-
-undefined_symbol_warning(s)
-char *s;
-{
- fprintf(stderr, "%s: w - the symbol %s is undefined\n", myname, s);
-}
diff --git a/mcs/jay/jay.1 b/mcs/jay/jay.1
deleted file mode 100644
index 85040fd5694..00000000000
--- a/mcs/jay/jay.1
+++ /dev/null
@@ -1,120 +0,0 @@
-.\" Copyright (c) 1989, 1990 The Regents of the University of California.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" Robert Paul Corbett.
-.\"
-.\" 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.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
-.\" 4. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
-.\"
-.\" @(#)yacc.1 5.8 (Berkeley) 5/24/93
-.\"
-.TH JAY 1 "May 24, 1993 / July 8, 1998"
-.UC 6
-.SH NAME
-jay \- an LALR(1) parser generator for Java and C#
-.SH SYNOPSIS
-.B jay [ -tv ] [ -c ] [ -b
-.I file_prefix
-.B ] [ -V
-.I yyValue
-.B ]
-.I filename
-.B <
-.I skeleton
-.SH DESCRIPTION
-.I Jay
-reads the grammar specification in the file
-.I filename
-and generates an LR(1) parser for it.
-The parsers consist of a set of LALR(1) parsing tables and a driver routine
-from the file
-.I skeleton
-written in the Java programming language.
-.I Jay
-writes the parse tables and the driver routine to standard output.
-.PP
-The following options are available:
-.RS
-.TP
-\fB-b \fIfile_prefix\fR
-The
-.B -b
-option changes the prefix prepended to the output file names to
-the string denoted by
-.IR file_prefix.
-The default prefix is the character
-.IR y.
-.TP
-.B -c
-The
-.B -c
-option makes jay generate C# code instead of the default Java.
-.TP
-.B -t
-The
-.B -t
-option arranges for
-debugging information to be incorporated in the compiled code.
-.TP
-.B -v
-The
-.B -v
-option causes a human-readable description of the generated parser to
-be written to the file
-.IR y.output.
-.RE
-.PP
-If the environment variable TMPDIR is set, the string denoted by
-TMPDIR will be used as the name of the directory where the temporary
-files are created.
-.SH FILES
-.IR skeleton
-.br
-.IR y.output
-.br
-.IR /tmp/yacc.aXXXXXX
-.br
-.IR /tmp/yacc.tXXXXXX
-.br
-.IR /tmp/yacc.uXXXXXX
-.SH DIAGNOSTICS
-If there are rules that are never reduced, the number of such rules is
-reported on standard error.
-If there are any LALR(1) conflicts, the number of conflicts is reported
-on standard error.
-.SH HISTORY
-.I Jay
-is derived from Berkeley
-.I yacc .
-Input conventions closely follow those of
-.I yacc ;
-for details,
-consult the parser
-.I skeleton
-file and the commented example included with the sources.
diff --git a/mcs/jay/lalr.c b/mcs/jay/lalr.c
deleted file mode 100644
index bf9aec846b7..00000000000
--- a/mcs/jay/lalr.c
+++ /dev/null
@@ -1,678 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)lalr.c 5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
-
-#include "defs.h"
-
-typedef
- struct shorts
- {
- struct shorts *next;
- short value;
- }
- shorts;
-
-int tokensetsize;
-short *lookaheads;
-short *LAruleno;
-unsigned *LA;
-short *accessing_symbol;
-core **state_table;
-shifts **shift_table;
-reductions **reduction_table;
-short *goto_map;
-short *from_state;
-short *to_state;
-
-short **transpose();
-
-static int infinity;
-static int maxrhs;
-static int ngotos;
-static unsigned *F;
-static short **includes;
-static shorts **lookback;
-static short **R;
-static short *INDEX;
-static short *VERTICES;
-static int top;
-
-
-lalr()
-{
- tokensetsize = WORDSIZE(ntokens);
-
- set_state_table();
- set_accessing_symbol();
- set_shift_table();
- set_reduction_table();
- set_maxrhs();
- initialize_LA();
- set_goto_map();
- initialize_F();
- build_relations();
- compute_FOLLOWS();
- compute_lookaheads();
-}
-
-
-
-set_state_table()
-{
- register core *sp;
-
- state_table = NEW2(nstates, core *);
- for (sp = first_state; sp; sp = sp->next)
- state_table[sp->number] = sp;
-}
-
-
-
-set_accessing_symbol()
-{
- register core *sp;
-
- accessing_symbol = NEW2(nstates, short);
- for (sp = first_state; sp; sp = sp->next)
- accessing_symbol[sp->number] = sp->accessing_symbol;
-}
-
-
-
-set_shift_table()
-{
- register shifts *sp;
-
- shift_table = NEW2(nstates, shifts *);
- for (sp = first_shift; sp; sp = sp->next)
- shift_table[sp->number] = sp;
-}
-
-
-
-set_reduction_table()
-{
- register reductions *rp;
-
- reduction_table = NEW2(nstates, reductions *);
- for (rp = first_reduction; rp; rp = rp->next)
- reduction_table[rp->number] = rp;
-}
-
-
-
-set_maxrhs()
-{
- register short *itemp;
- register short *item_end;
- register int length;
- register int max;
-
- length = 0;
- max = 0;
- item_end = ritem + nitems;
- for (itemp = ritem; itemp < item_end; itemp++)
- {
- if (*itemp >= 0)
- {
- length++;
- }
- else
- {
- if (length > max) max = length;
- length = 0;
- }
- }
-
- maxrhs = max;
-}
-
-
-
-initialize_LA()
-{
- register int i, j, k;
- register reductions *rp;
-
- lookaheads = NEW2(nstates + 1, short);
-
- k = 0;
- for (i = 0; i < nstates; i++)
- {
- lookaheads[i] = k;
- rp = reduction_table[i];
- if (rp)
- k += rp->nreds;
- }
- lookaheads[nstates] = k;
-
- LA = NEW2(k * tokensetsize, unsigned);
- LAruleno = NEW2(k, short);
- lookback = NEW2(k, shorts *);
-
- k = 0;
- for (i = 0; i < nstates; i++)
- {
- rp = reduction_table[i];
- if (rp)
- {
- for (j = 0; j < rp->nreds; j++)
- {
- LAruleno[k] = rp->rules[j];
- k++;
- }
- }
- }
-}
-
-
-set_goto_map()
-{
- register shifts *sp;
- register int i;
- register int symbol;
- register int k;
- register short *temp_map;
- register int state2;
- register int state1;
-
- goto_map = NEW2(nvars + 1, short) - ntokens;
- temp_map = NEW2(nvars + 1, short) - ntokens;
-
- ngotos = 0;
- for (sp = first_shift; sp; sp = sp->next)
- {
- for (i = sp->nshifts - 1; i >= 0; i--)
- {
- symbol = accessing_symbol[sp->shift[i]];
-
- if (ISTOKEN(symbol)) break;
-
- if (ngotos == MAXSHORT)
- fatal("too many gotos");
-
- ngotos++;
- goto_map[symbol]++;
- }
- }
-
- k = 0;
- for (i = ntokens; i < nsyms; i++)
- {
- temp_map[i] = k;
- k += goto_map[i];
- }
-
- for (i = ntokens; i < nsyms; i++)
- goto_map[i] = temp_map[i];
-
- goto_map[nsyms] = ngotos;
- temp_map[nsyms] = ngotos;
-
- from_state = NEW2(ngotos, short);
- to_state = NEW2(ngotos, short);
-
- for (sp = first_shift; sp; sp = sp->next)
- {
- state1 = sp->number;
- for (i = sp->nshifts - 1; i >= 0; i--)
- {
- state2 = sp->shift[i];
- symbol = accessing_symbol[state2];
-
- if (ISTOKEN(symbol)) break;
-
- k = temp_map[symbol]++;
- from_state[k] = state1;
- to_state[k] = state2;
- }
- }
-
- FREE(temp_map + ntokens);
-}
-
-
-
-/* Map_goto maps a state/symbol pair into its numeric representation. */
-
-int
-map_goto(state, symbol)
-int state;
-int symbol;
-{
- register int high;
- register int low;
- register int middle;
- register int s;
-
- low = goto_map[symbol];
- high = goto_map[symbol + 1];
-
- for (;;)
- {
- assert(low <= high);
- middle = (low + high) >> 1;
- s = from_state[middle];
- if (s == state)
- return (middle);
- else if (s < state)
- low = middle + 1;
- else
- high = middle - 1;
- }
-}
-
-
-
-initialize_F()
-{
- register int i;
- register int j;
- register int k;
- register shifts *sp;
- register short *edge;
- register unsigned *rowp;
- register short *rp;
- register short **reads;
- register int nedges;
- register int stateno;
- register int symbol;
- register int nwords;
-
- nwords = ngotos * tokensetsize;
- F = NEW2(nwords, unsigned);
-
- reads = NEW2(ngotos, short *);
- edge = NEW2(ngotos + 1, short);
- nedges = 0;
-
- rowp = F;
- for (i = 0; i < ngotos; i++)
- {
- stateno = to_state[i];
- sp = shift_table[stateno];
-
- if (sp)
- {
- k = sp->nshifts;
-
- for (j = 0; j < k; j++)
- {
- symbol = accessing_symbol[sp->shift[j]];
- if (ISVAR(symbol))
- break;
- SETBIT(rowp, symbol);
- }
-
- for (; j < k; j++)
- {
- symbol = accessing_symbol[sp->shift[j]];
- if (nullable[symbol])
- edge[nedges++] = map_goto(stateno, symbol);
- }
-
- if (nedges)
- {
- reads[i] = rp = NEW2(nedges + 1, short);
-
- for (j = 0; j < nedges; j++)
- rp[j] = edge[j];
-
- rp[nedges] = -1;
- nedges = 0;
- }
- }
-
- rowp += tokensetsize;
- }
-
- SETBIT(F, 0);
- digraph(reads);
-
- for (i = 0; i < ngotos; i++)
- {
- if (reads[i])
- FREE(reads[i]);
- }
-
- FREE(reads);
- FREE(edge);
-}
-
-
-
-build_relations()
-{
- register int i;
- register int j;
- register int k;
- register short *rulep;
- register short *rp;
- register shifts *sp;
- register int length;
- register int nedges;
- register int done;
- register int state1;
- register int stateno;
- register int symbol1;
- register int symbol2;
- register short *shortp;
- register short *edge;
- register short *states;
- register short **new_includes;
-
- includes = NEW2(ngotos, short *);
- edge = NEW2(ngotos + 1, short);
- states = NEW2(maxrhs + 1, short);
-
- for (i = 0; i < ngotos; i++)
- {
- nedges = 0;
- state1 = from_state[i];
- symbol1 = accessing_symbol[to_state[i]];
-
- for (rulep = derives[symbol1]; *rulep >= 0; rulep++)
- {
- length = 1;
- states[0] = state1;
- stateno = state1;
-
- for (rp = ritem + rrhs[*rulep]; *rp >= 0; rp++)
- {
- symbol2 = *rp;
- sp = shift_table[stateno];
- k = sp->nshifts;
-
- for (j = 0; j < k; j++)
- {
- stateno = sp->shift[j];
- if (accessing_symbol[stateno] == symbol2) break;
- }
-
- states[length++] = stateno;
- }
-
- add_lookback_edge(stateno, *rulep, i);
-
- length--;
- done = 0;
- while (!done)
- {
- done = 1;
- rp--;
- if (ISVAR(*rp))
- {
- stateno = states[--length];
- edge[nedges++] = map_goto(stateno, *rp);
- if (nullable[*rp] && length > 0) done = 0;
- }
- }
- }
-
- if (nedges)
- {
- includes[i] = shortp = NEW2(nedges + 1, short);
- for (j = 0; j < nedges; j++)
- shortp[j] = edge[j];
- shortp[nedges] = -1;
- }
- }
-
- new_includes = transpose(includes, ngotos);
-
- for (i = 0; i < ngotos; i++)
- if (includes[i])
- FREE(includes[i]);
-
- FREE(includes);
-
- includes = new_includes;
-
- FREE(edge);
- FREE(states);
-}
-
-
-add_lookback_edge(stateno, ruleno, gotono)
-int stateno, ruleno, gotono;
-{
- register int i, k;
- register int found;
- register shorts *sp;
-
- i = lookaheads[stateno];
- k = lookaheads[stateno + 1];
- found = 0;
- while (!found && i < k)
- {
- if (LAruleno[i] == ruleno)
- found = 1;
- else
- ++i;
- }
- assert(found);
-
- sp = NEW(shorts);
- sp->next = lookback[i];
- sp->value = gotono;
- lookback[i] = sp;
-}
-
-
-
-short **
-transpose(R, n)
-short **R;
-int n;
-{
- register short **new_R;
- register short **temp_R;
- register short *nedges;
- register short *sp;
- register int i;
- register int k;
-
- nedges = NEW2(n, short);
-
- for (i = 0; i < n; i++)
- {
- sp = R[i];
- if (sp)
- {
- while (*sp >= 0)
- nedges[*sp++]++;
- }
- }
-
- new_R = NEW2(n, short *);
- temp_R = NEW2(n, short *);
-
- for (i = 0; i < n; i++)
- {
- k = nedges[i];
- if (k > 0)
- {
- sp = NEW2(k + 1, short);
- new_R[i] = sp;
- temp_R[i] = sp;
- sp[k] = -1;
- }
- }
-
- FREE(nedges);
-
- for (i = 0; i < n; i++)
- {
- sp = R[i];
- if (sp)
- {
- while (*sp >= 0)
- *temp_R[*sp++]++ = i;
- }
- }
-
- FREE(temp_R);
-
- return (new_R);
-}
-
-
-
-compute_FOLLOWS()
-{
- digraph(includes);
-}
-
-
-compute_lookaheads()
-{
- register int i, n;
- register unsigned *fp1, *fp2, *fp3;
- register shorts *sp, *next;
- register unsigned *rowp;
-
- rowp = LA;
- n = lookaheads[nstates];
- for (i = 0; i < n; i++)
- {
- fp3 = rowp + tokensetsize;
- for (sp = lookback[i]; sp; sp = sp->next)
- {
- fp1 = rowp;
- fp2 = F + tokensetsize * sp->value;
- while (fp1 < fp3)
- *fp1++ |= *fp2++;
- }
- rowp = fp3;
- }
-
- for (i = 0; i < n; i++)
- for (sp = lookback[i]; sp; sp = next)
- {
- next = sp->next;
- FREE(sp);
- }
-
- FREE(lookback);
- FREE(F);
-}
-
-
-digraph(relation)
-short **relation;
-{
- register int i;
-
- infinity = ngotos + 2;
- INDEX = NEW2(ngotos + 1, short);
- VERTICES = NEW2(ngotos + 1, short);
- top = 0;
-
- R = relation;
-
- for (i = 0; i < ngotos; i++)
- INDEX[i] = 0;
-
- for (i = 0; i < ngotos; i++)
- {
- if (INDEX[i] == 0 && R[i])
- traverse(i);
- }
-
- FREE(INDEX);
- FREE(VERTICES);
-}
-
-
-
-traverse(i)
-register int i;
-{
- register unsigned *fp1;
- register unsigned *fp2;
- register unsigned *fp3;
- register int j;
- register short *rp;
-
- int height;
- unsigned *base;
-
- VERTICES[++top] = i;
- INDEX[i] = height = top;
-
- base = F + i * tokensetsize;
- fp3 = base + tokensetsize;
-
- rp = R[i];
- if (rp)
- {
- while ((j = *rp++) >= 0)
- {
- if (INDEX[j] == 0)
- traverse(j);
-
- if (INDEX[i] > INDEX[j])
- INDEX[i] = INDEX[j];
-
- fp1 = base;
- fp2 = F + j * tokensetsize;
-
- while (fp1 < fp3)
- *fp1++ |= *fp2++;
- }
- }
-
- if (INDEX[i] == height)
- {
- for (;;)
- {
- j = VERTICES[top--];
- INDEX[j] = infinity;
-
- if (i == j)
- break;
-
- fp1 = base;
- fp2 = F + j * tokensetsize;
-
- while (fp1 < fp3)
- *fp2++ = *fp1++;
- }
- }
-}
diff --git a/mcs/jay/lr0.c b/mcs/jay/lr0.c
deleted file mode 100644
index 43106ea6cf3..00000000000
--- a/mcs/jay/lr0.c
+++ /dev/null
@@ -1,637 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)lr0.c 5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-extern short *itemset;
-extern short *itemsetend;
-extern unsigned *ruleset;
-
-int nstates;
-core *first_state;
-shifts *first_shift;
-reductions *first_reduction;
-
-int get_state();
-core *new_state();
-
-static core **state_set;
-static core *this_state;
-static core *last_state;
-static shifts *last_shift;
-static reductions *last_reduction;
-
-static int nshifts;
-static short *shift_symbol;
-
-static short *redset;
-static short *shiftset;
-
-static short **kernel_base;
-static short **kernel_end;
-static short *kernel_items;
-
-
-allocate_itemsets()
-{
- register short *itemp;
- register short *item_end;
- register int symbol;
- register int i;
- register int count;
- register int max;
- register short *symbol_count;
-
- count = 0;
- symbol_count = NEW2(nsyms, short);
-
- item_end = ritem + nitems;
- for (itemp = ritem; itemp < item_end; itemp++)
- {
- symbol = *itemp;
- if (symbol >= 0)
- {
- count++;
- symbol_count[symbol]++;
- }
- }
-
- kernel_base = NEW2(nsyms, short *);
- kernel_items = NEW2(count, short);
-
- count = 0;
- max = 0;
- for (i = 0; i < nsyms; i++)
- {
- kernel_base[i] = kernel_items + count;
- count += symbol_count[i];
- if (max < symbol_count[i])
- max = symbol_count[i];
- }
-
- shift_symbol = symbol_count;
- kernel_end = NEW2(nsyms, short *);
-}
-
-
-allocate_storage()
-{
- allocate_itemsets();
- shiftset = NEW2(nsyms, short);
- redset = NEW2(nrules + 1, short);
- state_set = NEW2(nitems, core *);
-}
-
-
-append_states()
-{
- register int i;
- register int j;
- register int symbol;
-
-#ifdef TRACE
- fprintf(stderr, "Entering append_states()\n");
-#endif
- for (i = 1; i < nshifts; i++)
- {
- symbol = shift_symbol[i];
- j = i;
- while (j > 0 && shift_symbol[j - 1] > symbol)
- {
- shift_symbol[j] = shift_symbol[j - 1];
- j--;
- }
- shift_symbol[j] = symbol;
- }
-
- for (i = 0; i < nshifts; i++)
- {
- symbol = shift_symbol[i];
- shiftset[i] = get_state(symbol);
- }
-}
-
-
-free_storage()
-{
- FREE(shift_symbol);
- FREE(redset);
- FREE(shiftset);
- FREE(kernel_base);
- FREE(kernel_end);
- FREE(kernel_items);
- FREE(state_set);
-}
-
-
-
-generate_states()
-{
- allocate_storage();
- itemset = NEW2(nitems, short);
- ruleset = NEW2(WORDSIZE(nrules), unsigned);
- set_first_derives();
- initialize_states();
-
- while (this_state)
- {
- closure(this_state->items, this_state->nitems);
- save_reductions();
- new_itemsets();
- append_states();
-
- if (nshifts > 0)
- save_shifts();
-
- this_state = this_state->next;
- }
-
- finalize_closure();
- free_storage();
-}
-
-
-
-int
-get_state(symbol)
-int symbol;
-{
- register int key;
- register short *isp1;
- register short *isp2;
- register short *iend;
- register core *sp;
- register int found;
- register int n;
-
-#ifdef TRACE
- fprintf(stderr, "Entering get_state(%d)\n", symbol);
-#endif
-
- isp1 = kernel_base[symbol];
- iend = kernel_end[symbol];
- n = iend - isp1;
-
- key = *isp1;
- assert(0 <= key && key < nitems);
- sp = state_set[key];
- if (sp)
- {
- found = 0;
- while (!found)
- {
- if (sp->nitems == n)
- {
- found = 1;
- isp1 = kernel_base[symbol];
- isp2 = sp->items;
-
- while (found && isp1 < iend)
- {
- if (*isp1++ != *isp2++)
- found = 0;
- }
- }
-
- if (!found)
- {
- if (sp->link)
- {
- sp = sp->link;
- }
- else
- {
- sp = sp->link = new_state(symbol);
- found = 1;
- }
- }
- }
- }
- else
- {
- state_set[key] = sp = new_state(symbol);
- }
-
- return (sp->number);
-}
-
-
-
-initialize_states()
-{
- register int i;
- register short *start_derives;
- register core *p;
-
- start_derives = derives[start_symbol];
- for (i = 0; start_derives[i] >= 0; ++i)
- continue;
-
- p = (core *) MALLOC(sizeof(core) + i*sizeof(short));
- if (p == 0) no_space();
-
- p->next = 0;
- p->link = 0;
- p->number = 0;
- p->accessing_symbol = 0;
- p->nitems = i;
-
- for (i = 0; start_derives[i] >= 0; ++i)
- p->items[i] = rrhs[start_derives[i]];
-
- first_state = last_state = this_state = p;
- nstates = 1;
-}
-
-
-new_itemsets()
-{
- register int i;
- register int shiftcount;
- register short *isp;
- register short *ksp;
- register int symbol;
-
- for (i = 0; i < nsyms; i++)
- kernel_end[i] = 0;
-
- shiftcount = 0;
- isp = itemset;
- while (isp < itemsetend)
- {
- i = *isp++;
- symbol = ritem[i];
- if (symbol > 0)
- {
- ksp = kernel_end[symbol];
- if (!ksp)
- {
- shift_symbol[shiftcount++] = symbol;
- ksp = kernel_base[symbol];
- }
-
- *ksp++ = i + 1;
- kernel_end[symbol] = ksp;
- }
- }
-
- nshifts = shiftcount;
-}
-
-
-
-core *
-new_state(symbol)
-int symbol;
-{
- register int n;
- register core *p;
- register short *isp1;
- register short *isp2;
- register short *iend;
-
-#ifdef TRACE
- fprintf(stderr, "Entering new_state(%d)\n", symbol);
-#endif
-
- if (nstates >= MAXSHORT)
- fatal("too many states");
-
- isp1 = kernel_base[symbol];
- iend = kernel_end[symbol];
- n = iend - isp1;
-
- p = (core *) allocate((unsigned) (sizeof(core) + (n - 1) * sizeof(short)));
- p->accessing_symbol = symbol;
- p->number = nstates;
- p->nitems = n;
-
- isp2 = p->items;
- while (isp1 < iend)
- *isp2++ = *isp1++;
-
- last_state->next = p;
- last_state = p;
-
- nstates++;
-
- return (p);
-}
-
-
-/* show_cores is used for debugging */
-
-show_cores()
-{
- core *p;
- int i, j, k, n;
- int itemno;
-
- k = 0;
- for (p = first_state; p; ++k, p = p->next)
- {
- if (k) printf("\n");
- printf("state %d, number = %d, accessing symbol = %s\n",
- k, p->number, symbol_name[p->accessing_symbol]);
- n = p->nitems;
- for (i = 0; i < n; ++i)
- {
- itemno = p->items[i];
- printf("%4d ", itemno);
- j = itemno;
- while (ritem[j] >= 0) ++j;
- printf("%s :", symbol_name[rlhs[-ritem[j]]]);
- j = rrhs[-ritem[j]];
- while (j < itemno)
- printf(" %s", symbol_name[ritem[j++]]);
- printf(" .");
- while (ritem[j] >= 0)
- printf(" %s", symbol_name[ritem[j++]]);
- printf("\n");
- fflush(stdout);
- }
- }
-}
-
-
-/* show_ritems is used for debugging */
-
-show_ritems()
-{
- int i;
-
- for (i = 0; i < nitems; ++i)
- printf("ritem[%d] = %d\n", i, ritem[i]);
-}
-
-
-/* show_rrhs is used for debugging */
-show_rrhs()
-{
- int i;
-
- for (i = 0; i < nrules; ++i)
- printf("rrhs[%d] = %d\n", i, rrhs[i]);
-}
-
-
-/* show_shifts is used for debugging */
-
-show_shifts()
-{
- shifts *p;
- int i, j, k;
-
- k = 0;
- for (p = first_shift; p; ++k, p = p->next)
- {
- if (k) printf("\n");
- printf("shift %d, number = %d, nshifts = %d\n", k, p->number,
- p->nshifts);
- j = p->nshifts;
- for (i = 0; i < j; ++i)
- printf("\t%d\n", p->shift[i]);
- }
-}
-
-
-save_shifts()
-{
- register shifts *p;
- register short *sp1;
- register short *sp2;
- register short *send;
-
- p = (shifts *) allocate((unsigned) (sizeof(shifts) +
- (nshifts - 1) * sizeof(short)));
-
- p->number = this_state->number;
- p->nshifts = nshifts;
-
- sp1 = shiftset;
- sp2 = p->shift;
- send = shiftset + nshifts;
-
- while (sp1 < send)
- *sp2++ = *sp1++;
-
- if (last_shift)
- {
- last_shift->next = p;
- last_shift = p;
- }
- else
- {
- first_shift = p;
- last_shift = p;
- }
-}
-
-
-
-save_reductions()
-{
- register short *isp;
- register short *rp1;
- register short *rp2;
- register int item;
- register int count;
- register reductions *p;
- register short *rend;
-
- count = 0;
- for (isp = itemset; isp < itemsetend; isp++)
- {
- item = ritem[*isp];
- if (item < 0)
- {
- redset[count++] = -item;
- }
- }
-
- if (count)
- {
- p = (reductions *) allocate((unsigned) (sizeof(reductions) +
- (count - 1) * sizeof(short)));
-
- p->number = this_state->number;
- p->nreds = count;
-
- rp1 = redset;
- rp2 = p->rules;
- rend = rp1 + count;
-
- while (rp1 < rend)
- *rp2++ = *rp1++;
-
- if (last_reduction)
- {
- last_reduction->next = p;
- last_reduction = p;
- }
- else
- {
- first_reduction = p;
- last_reduction = p;
- }
- }
-}
-
-
-set_derives()
-{
- register int i, k;
- register int lhs;
- register short *rules;
-
- derives = NEW2(nsyms, short *);
- rules = NEW2(nvars + nrules, short);
-
- k = 0;
- for (lhs = start_symbol; lhs < nsyms; lhs++)
- {
- derives[lhs] = rules + k;
- for (i = 0; i < nrules; i++)
- {
- if (rlhs[i] == lhs)
- {
- rules[k] = i;
- k++;
- }
- }
- rules[k] = -1;
- k++;
- }
-
-#ifdef DEBUG
- print_derives();
-#endif
-}
-
-free_derives()
-{
- FREE(derives[start_symbol]);
- FREE(derives);
-}
-
-#ifdef DEBUG
-print_derives()
-{
- register int i;
- register short *sp;
-
- printf("\nDERIVES\n\n");
-
- for (i = start_symbol; i < nsyms; i++)
- {
- printf("%s derives ", symbol_name[i]);
- for (sp = derives[i]; *sp >= 0; sp++)
- {
- printf(" %d", *sp);
- }
- putchar('\n');
- }
-
- putchar('\n');
-}
-#endif
-
-
-set_nullable()
-{
- register int i, j;
- register int empty;
- int done;
-
- nullable = MALLOC(nsyms);
- if (nullable == 0) no_space();
-
- for (i = 0; i < nsyms; ++i)
- nullable[i] = 0;
-
- done = 0;
- while (!done)
- {
- done = 1;
- for (i = 1; i < nitems; i++)
- {
- empty = 1;
- while ((j = ritem[i]) >= 0)
- {
- if (!nullable[j])
- empty = 0;
- ++i;
- }
- if (empty)
- {
- j = rlhs[-j];
- if (!nullable[j])
- {
- nullable[j] = 1;
- done = 0;
- }
- }
- }
- }
-
-#ifdef DEBUG
- for (i = 0; i < nsyms; i++)
- {
- if (nullable[i])
- printf("%s is nullable\n", symbol_name[i]);
- else
- printf("%s is not nullable\n", symbol_name[i]);
- }
-#endif
-}
-
-
-free_nullable()
-{
- FREE(nullable);
-}
-
-
-lr0()
-{
- set_derives();
- set_nullable();
- generate_states();
-}
diff --git a/mcs/jay/main.c b/mcs/jay/main.c
deleted file mode 100644
index c6954eb9285..00000000000
--- a/mcs/jay/main.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-static char sccsid[] = "@(#)main.c 5.5 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include <signal.h>
-#include "defs.h"
-
-char tflag;
-char vflag;
-char csharp = 0;
-
-char *file_prefix = "y";
-char *myname = "yacc";
-char *temp_form = "yacc.XXXXXXX";
-
-int lineno;
-int outline;
-
-char *action_file_name;
-char *input_file_name = "";
-char *prolog_file_name;
-char *local_file_name;
-char *verbose_file_name;
-
-FILE *action_file; /* a temp file, used to save actions associated */
- /* with rules until the parser is written */
-FILE *input_file; /* the input file */
-FILE *prolog_file; /* temp files, used to save text until all */
-FILE *local_file; /* symbols have been defined */
-FILE *verbose_file; /* y.output */
-
-int nitems;
-int nrules;
-int nsyms;
-int ntokens;
-int nvars;
-
-int start_symbol;
-char **symbol_name;
-short *symbol_value;
-short *symbol_prec;
-char *symbol_assoc;
-
-short *ritem;
-short *rlhs;
-short *rrhs;
-short *rprec;
-char *rassoc;
-short **derives;
-char *nullable;
-
-extern char *mktemp();
-extern char *getenv();
-
-done(k)
-int k;
-{
- if (action_file) { fclose(action_file); unlink(action_file_name); }
- if (prolog_file) { fclose(prolog_file); unlink(prolog_file_name); }
- if (local_file) { fclose(local_file); unlink(local_file_name); }
- exit(k);
-}
-
-
-void
-onintr(signo)
- int signo;
-{
- done(1);
-}
-
-
-set_signals()
-{
-#ifdef SIGINT
- if (signal(SIGINT, SIG_IGN) != SIG_IGN)
- signal(SIGINT, onintr);
-#endif
-#ifdef SIGTERM
- if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
- signal(SIGTERM, onintr);
-#endif
-#ifdef SIGHUP
- if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
- signal(SIGHUP, onintr);
-#endif
-}
-
-
-usage()
-{
- fprintf(stderr, "usage: %s [-tvc] [-b file_prefix] filename\n", myname);
- exit(1);
-}
-
-
-getargs(argc, argv)
-int argc;
-char *argv[];
-{
- register int i;
- register char *s;
-
- if (argc > 0) myname = argv[0];
- for (i = 1; i < argc; ++i)
- {
- s = argv[i];
- if (*s != '-') break;
- switch (*++s)
- {
- case '\0':
- input_file = stdin;
- if (i + 1 < argc) usage();
- return;
-
- case '-':
- ++i;
- goto no_more_options;
-
- case 'b':
- if (*++s)
- file_prefix = s;
- else if (++i < argc)
- file_prefix = argv[i];
- else
- usage();
- continue;
-
- case 't':
- tflag = 1;
- break;
-
- case 'c':
- csharp = 1;
- line_format = "#line %d \"%s\"\n";
- break;
-
- case 'v':
- vflag = 1;
- break;
-
- default:
- usage();
- }
-
- for (;;)
- {
- switch (*++s)
- {
- case '\0':
- goto end_of_option;
-
- case 't':
- tflag = 1;
- break;
-
- case 'v':
- vflag = 1;
- break;
-
- case 'c':
- csharp = 1;
- break;
-
- default:
- usage();
- }
- }
-end_of_option:;
- }
-
-no_more_options:;
- if (i + 1 != argc) usage();
- input_file_name = argv[i];
-}
-
-
-char *
-allocate(n)
-unsigned n;
-{
- register char *p;
-
- p = NULL;
- if (n)
- {
- p = CALLOC(1, n);
- if (!p) no_space();
- }
- return (p);
-}
-
-
-create_file_names()
-{
- int i, len;
- char *tmpdir;
-
- tmpdir = getenv("TMPDIR");
- if (tmpdir == 0) tmpdir = "/tmp";
-
- len = strlen(tmpdir);
- i = len + 13;
- if (len && tmpdir[len-1] != '/')
- ++i;
-
- action_file_name = MALLOC(i);
- if (action_file_name == 0) no_space();
- prolog_file_name = MALLOC(i);
- if (prolog_file_name == 0) no_space();
- local_file_name = MALLOC(i);
- if (local_file_name == 0) no_space();
-
- strcpy(action_file_name, tmpdir);
- strcpy(prolog_file_name, tmpdir);
- strcpy(local_file_name, tmpdir);
-
- if (len && tmpdir[len - 1] != '/')
- {
- action_file_name[len] = '/';
- prolog_file_name[len] = '/';
- local_file_name[len] = '/';
- ++len;
- }
-
- strcpy(action_file_name + len, temp_form);
- strcpy(prolog_file_name + len, temp_form);
- strcpy(local_file_name + len, temp_form);
-
- action_file_name[len + 5] = 'a';
- prolog_file_name[len + 5] = 'p';
- local_file_name[len + 5] = 'l';
-
- mktemp(action_file_name);
- mktemp(prolog_file_name);
- mktemp(local_file_name);
-
- len = strlen(file_prefix);
-
- if (vflag)
- {
- verbose_file_name = MALLOC(len + 8);
- if (verbose_file_name == 0)
- no_space();
- strcpy(verbose_file_name, file_prefix);
- strcpy(verbose_file_name + len, VERBOSE_SUFFIX);
- }
-}
-
-
-open_files()
-{
- create_file_names();
-
- if (input_file == 0)
- {
- input_file = fopen(input_file_name, "r");
- if (input_file == 0)
- open_error(input_file_name);
- }
-
- action_file = fopen(action_file_name, "w");
- if (action_file == 0)
- open_error(action_file_name);
-
- prolog_file = fopen(prolog_file_name, "w");
- if (prolog_file == 0)
- open_error(prolog_file_name);
-
- local_file = fopen(local_file_name, "w");
- if (local_file == 0)
- open_error(local_file_name);
-
- if (vflag)
- {
- verbose_file = fopen(verbose_file_name, "w");
- if (verbose_file == 0)
- open_error(verbose_file_name);
- }
-}
-
-
-int
-main(argc, argv)
-int argc;
-char *argv[];
-{
- set_signals();
- getargs(argc, argv);
- open_files();
- reader();
- lr0();
- lalr();
- make_parser();
- verbose();
- output();
- done(0);
- /*NOTREACHED*/
-}
diff --git a/mcs/jay/makefile b/mcs/jay/makefile
deleted file mode 100644
index 10991a5435f..00000000000
--- a/mcs/jay/makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-all = jay
-c = closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \
- symtab.c verbose.c warshall.c
-
-CFLAGS=#-g
-
-jay: $(c:.c=.o) ; $(CC) -o $@ $(CFLAGS) $(c:.c=.o)
-
-clean:
- rm -f jay *.o
-
-windows: jay
-
-linux: jay
diff --git a/mcs/jay/mkpar.c b/mcs/jay/mkpar.c
deleted file mode 100644
index 42ead14514d..00000000000
--- a/mcs/jay/mkpar.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)mkpar.c 5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-action **parser;
-int SRtotal;
-int RRtotal;
-short *SRconflicts;
-short *RRconflicts;
-short *defred;
-short *rules_used;
-short nunused;
-short final_state;
-
-static int SRcount;
-static int RRcount;
-
-extern action *parse_actions();
-extern action *get_shifts();
-extern action *add_reductions();
-extern action *add_reduce();
-
-
-make_parser()
-{
- register int i;
-
- parser = NEW2(nstates, action *);
- for (i = 0; i < nstates; i++)
- parser[i] = parse_actions(i);
-
- find_final_state();
- remove_conflicts();
- unused_rules();
- if (SRtotal + RRtotal > 0) total_conflicts();
- defreds();
-}
-
-
-action *
-parse_actions(stateno)
-register int stateno;
-{
- register action *actions;
-
- actions = get_shifts(stateno);
- actions = add_reductions(stateno, actions);
- return (actions);
-}
-
-
-action *
-get_shifts(stateno)
-int stateno;
-{
- register action *actions, *temp;
- register shifts *sp;
- register short *to_state;
- register int i, k;
- register int symbol;
-
- actions = 0;
- sp = shift_table[stateno];
- if (sp)
- {
- to_state = sp->shift;
- for (i = sp->nshifts - 1; i >= 0; i--)
- {
- k = to_state[i];
- symbol = accessing_symbol[k];
- if (ISTOKEN(symbol))
- {
- temp = NEW(action);
- temp->next = actions;
- temp->symbol = symbol;
- temp->number = k;
- temp->prec = symbol_prec[symbol];
- temp->action_code = SHIFT;
- temp->assoc = symbol_assoc[symbol];
- actions = temp;
- }
- }
- }
- return (actions);
-}
-
-action *
-add_reductions(stateno, actions)
-int stateno;
-register action *actions;
-{
- register int i, j, m, n;
- register int ruleno, tokensetsize;
- register unsigned *rowp;
-
- tokensetsize = WORDSIZE(ntokens);
- m = lookaheads[stateno];
- n = lookaheads[stateno + 1];
- for (i = m; i < n; i++)
- {
- ruleno = LAruleno[i];
- rowp = LA + i * tokensetsize;
- for (j = ntokens - 1; j >= 0; j--)
- {
- if (BIT(rowp, j))
- actions = add_reduce(actions, ruleno, j);
- }
- }
- return (actions);
-}
-
-
-action *
-add_reduce(actions, ruleno, symbol)
-register action *actions;
-register int ruleno, symbol;
-{
- register action *temp, *prev, *next;
-
- prev = 0;
- for (next = actions; next && next->symbol < symbol; next = next->next)
- prev = next;
-
- while (next && next->symbol == symbol && next->action_code == SHIFT)
- {
- prev = next;
- next = next->next;
- }
-
- while (next && next->symbol == symbol &&
- next->action_code == REDUCE && next->number < ruleno)
- {
- prev = next;
- next = next->next;
- }
-
- temp = NEW(action);
- temp->next = next;
- temp->symbol = symbol;
- temp->number = ruleno;
- temp->prec = rprec[ruleno];
- temp->action_code = REDUCE;
- temp->assoc = rassoc[ruleno];
-
- if (prev)
- prev->next = temp;
- else
- actions = temp;
-
- return (actions);
-}
-
-
-find_final_state()
-{
- register int goal, i;
- register short *to_state;
- register shifts *p;
-
- p = shift_table[0];
- to_state = p->shift;
- goal = ritem[1];
- for (i = p->nshifts - 1; i >= 0; --i)
- {
- final_state = to_state[i];
- if (accessing_symbol[final_state] == goal) break;
- }
-}
-
-
-unused_rules()
-{
- register int i;
- register action *p;
-
- rules_used = (short *) MALLOC(nrules*sizeof(short));
- if (rules_used == 0) no_space();
-
- for (i = 0; i < nrules; ++i)
- rules_used[i] = 0;
-
- for (i = 0; i < nstates; ++i)
- {
- for (p = parser[i]; p; p = p->next)
- {
- if (p->action_code == REDUCE && p->suppressed == 0)
- rules_used[p->number] = 1;
- }
- }
-
- nunused = 0;
- for (i = 3; i < nrules; ++i)
- if (!rules_used[i]) ++nunused;
-
- if (nunused)
- if (nunused == 1)
- fprintf(stderr, "%s: 1 rule never reduced\n", myname);
- else
- fprintf(stderr, "%s: %d rules never reduced\n", myname, nunused);
-}
-
-
-remove_conflicts()
-{
- register int i;
- register int symbol;
- register action *p, *pref;
-
- SRtotal = 0;
- RRtotal = 0;
- SRconflicts = NEW2(nstates, short);
- RRconflicts = NEW2(nstates, short);
- for (i = 0; i < nstates; i++)
- {
- SRcount = 0;
- RRcount = 0;
- symbol = -1;
- for (p = parser[i]; p; p = p->next)
- {
- if (p->symbol != symbol)
- {
- pref = p;
- symbol = p->symbol;
- }
- else if (i == final_state && symbol == 0)
- {
- SRcount++;
- p->suppressed = 1;
- }
- else if (pref->action_code == SHIFT)
- {
- if (pref->prec > 0 && p->prec > 0)
- {
- if (pref->prec < p->prec)
- {
- pref->suppressed = 2;
- pref = p;
- }
- else if (pref->prec > p->prec)
- {
- p->suppressed = 2;
- }
- else if (pref->assoc == LEFT)
- {
- pref->suppressed = 2;
- pref = p;
- }
- else if (pref->assoc == RIGHT)
- {
- p->suppressed = 2;
- }
- else
- {
- pref->suppressed = 2;
- p->suppressed = 2;
- }
- }
- else
- {
- SRcount++;
- p->suppressed = 1;
- }
- }
- else
- {
- RRcount++;
- p->suppressed = 1;
- }
- }
- SRtotal += SRcount;
- RRtotal += RRcount;
- SRconflicts[i] = SRcount;
- RRconflicts[i] = RRcount;
- }
-}
-
-
-total_conflicts()
-{
- fprintf(stderr, "%s: ", myname);
- if (SRtotal == 1)
- fprintf(stderr, "1 shift/reduce conflict");
- else if (SRtotal > 1)
- fprintf(stderr, "%d shift/reduce conflicts", SRtotal);
-
- if (SRtotal && RRtotal)
- fprintf(stderr, ", ");
-
- if (RRtotal == 1)
- fprintf(stderr, "1 reduce/reduce conflict");
- else if (RRtotal > 1)
- fprintf(stderr, "%d reduce/reduce conflicts", RRtotal);
-
- fprintf(stderr, ".\n");
-}
-
-
-int
-sole_reduction(stateno)
-int stateno;
-{
- register int count, ruleno;
- register action *p;
-
- count = 0;
- ruleno = 0;
- for (p = parser[stateno]; p; p = p->next)
- {
- if (p->action_code == SHIFT && p->suppressed == 0)
- return (0);
- else if (p->action_code == REDUCE && p->suppressed == 0)
- {
- if (ruleno > 0 && p->number != ruleno)
- return (0);
- if (p->symbol != 1)
- ++count;
- ruleno = p->number;
- }
- }
-
- if (count == 0)
- return (0);
- return (ruleno);
-}
-
-
-defreds()
-{
- register int i;
-
- defred = NEW2(nstates, short);
- for (i = 0; i < nstates; i++)
- defred[i] = sole_reduction(i);
-}
-
-free_action_row(p)
-register action *p;
-{
- register action *q;
-
- while (p)
- {
- q = p->next;
- FREE(p);
- p = q;
- }
-}
-
-free_parser()
-{
- register int i;
-
- for (i = 0; i < nstates; i++)
- free_action_row(parser[i]);
-
- FREE(parser);
-}
diff --git a/mcs/jay/output.c b/mcs/jay/output.c
deleted file mode 100644
index 81e4755c9cd..00000000000
--- a/mcs/jay/output.c
+++ /dev/null
@@ -1,1173 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)output.c 5.7 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include "defs.h"
-#include <string.h>
-
-static int nvectors;
-static int nentries;
-static short **froms;
-static short **tos;
-static short *tally;
-static short *width;
-static short *state_count;
-static short *order;
-static short *base;
-static short *pos;
-static int maxtable;
-static short *table;
-static short *check;
-static int lowzero;
-static int high;
-extern int csharp;
-
-output () {
- int lno = 0;
- char buf [128];
-
- free_itemsets();
- free_shifts();
- free_reductions();
-
- while (fgets(buf, sizeof buf, stdin) != NULL) {
- char * cp;
- ++ lno;
- if (buf[strlen(buf)-1] != '\n')
- fprintf(stderr, "jay: line %d is too long\n", lno), done(1);
- switch (buf[0]) {
- case '#': continue;
- case 't': if (!tflag) fputs("//t", stdout);
- case '.': break;
- default:
- cp = strtok(buf, " \t\r\n");
- if (cp)
- if (strcmp(cp, "actions") == 0) output_semantic_actions();
- else if (strcmp(cp, "debug") == 0) output_debug();
- else if (strcmp(cp, "epilog") == 0) output_trailing_text();
- else if (strcmp(cp, "prolog") == 0)
- output_stored_text(prolog_file, prolog_file_name);
- else if (strcmp(cp, "local") == 0)
- output_stored_text(local_file, local_file_name);
- else if (strcmp(cp, "tables") == 0)
- output_rule_data(), output_yydefred(), output_actions();
- else if (strcmp(cp, "tokens") == 0)
- output_defines(strtok(NULL, "\r\n"));
- else
- fprintf(stderr, "jay: unknown call (%s) in line %d\n", cp, lno);
- continue;
- }
- fputs(buf+1, stdout), ++ outline;
- }
- free_parser();
-}
-
-output_rule_data()
-{
- register int i;
- register int j;
-
-
- printf(" %s static %s short [] yyLhs = {%16d,",
- csharp ? "" : " protected",
- csharp ? "" : " final",
- symbol_value[start_symbol]);
-
- j = 10;
- for (i = 3; i < nrules; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", symbol_value[rlhs[i]]);
- }
- outline += 2;
- printf("\n };\n");
-
- printf(" %s static %s short [] yyLen = {%12d,",
- csharp ? "" : "protected",
- csharp ? "" : "final",
- 2);
-
- j = 10;
- for (i = 3; i < nrules; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- j++;
-
- printf("%5d,", rrhs[i + 1] - rrhs[i] - 1);
- }
- outline += 2;
- printf("\n };\n");
-}
-
-
-output_yydefred()
-{
- register int i, j;
-
- printf(" %s static %s short [] yyDefRed = {%13d,",
- csharp ? "" : "protected",
- csharp ? "" : "final",
- (defred[0] ? defred[0] - 2 : 0));
-
- j = 10;
- for (i = 1; i < nstates; i++)
- {
- if (j < 10)
- ++j;
- else
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
-
- printf("%5d,", (defred[i] ? defred[i] - 2 : 0));
- }
-
- outline += 2;
- printf("\n };\n");
-}
-
-
-output_actions()
-{
- nvectors = 2*nstates + nvars;
-
- froms = NEW2(nvectors, short *);
- tos = NEW2(nvectors, short *);
- tally = NEW2(nvectors, short);
- width = NEW2(nvectors, short);
-
- token_actions();
- FREE(lookaheads);
- FREE(LA);
- FREE(LAruleno);
- FREE(accessing_symbol);
-
- goto_actions();
- FREE(goto_map + ntokens);
- FREE(from_state);
- FREE(to_state);
-
- sort_actions();
- pack_table();
- output_base();
- output_table();
- output_check();
-}
-
-
-token_actions()
-{
- register int i, j;
- register int shiftcount, reducecount;
- register int max, min;
- register short *actionrow, *r, *s;
- register action *p;
-
- actionrow = NEW2(2*ntokens, short);
- for (i = 0; i < nstates; ++i)
- {
- if (parser[i])
- {
- for (j = 0; j < 2*ntokens; ++j)
- actionrow[j] = 0;
-
- shiftcount = 0;
- reducecount = 0;
- for (p = parser[i]; p; p = p->next)
- {
- if (p->suppressed == 0)
- {
- if (p->action_code == SHIFT)
- {
- ++shiftcount;
- actionrow[p->symbol] = p->number;
- }
- else if (p->action_code == REDUCE && p->number != defred[i])
- {
- ++reducecount;
- actionrow[p->symbol + ntokens] = p->number;
- }
- }
- }
-
- tally[i] = shiftcount;
- tally[nstates+i] = reducecount;
- width[i] = 0;
- width[nstates+i] = 0;
- if (shiftcount > 0)
- {
- froms[i] = r = NEW2(shiftcount, short);
- tos[i] = s = NEW2(shiftcount, short);
- min = MAXSHORT;
- max = 0;
- for (j = 0; j < ntokens; ++j)
- {
- if (actionrow[j])
- {
- if (min > symbol_value[j])
- min = symbol_value[j];
- if (max < symbol_value[j])
- max = symbol_value[j];
- *r++ = symbol_value[j];
- *s++ = actionrow[j];
- }
- }
- width[i] = max - min + 1;
- }
- if (reducecount > 0)
- {
- froms[nstates+i] = r = NEW2(reducecount, short);
- tos[nstates+i] = s = NEW2(reducecount, short);
- min = MAXSHORT;
- max = 0;
- for (j = 0; j < ntokens; ++j)
- {
- if (actionrow[ntokens+j])
- {
- if (min > symbol_value[j])
- min = symbol_value[j];
- if (max < symbol_value[j])
- max = symbol_value[j];
- *r++ = symbol_value[j];
- *s++ = actionrow[ntokens+j] - 2;
- }
- }
- width[nstates+i] = max - min + 1;
- }
- }
- }
- FREE(actionrow);
-}
-
-goto_actions()
-{
- register int i, j, k;
-
- state_count = NEW2(nstates, short);
-
- k = default_goto(start_symbol + 1);
- printf(" protected static %s short [] yyDgoto = {%14d,", csharp ? "" : "final", k);
- save_column(start_symbol + 1, k);
-
- j = 10;
- for (i = start_symbol + 2; i < nsyms; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- k = default_goto(i);
- printf("%5d,", k);
- save_column(i, k);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(state_count);
-}
-
-int
-default_goto(symbol)
-int symbol;
-{
- register int i;
- register int m;
- register int n;
- register int default_state;
- register int max;
-
- m = goto_map[symbol];
- n = goto_map[symbol + 1];
-
- if (m == n) return (0);
-
- for (i = 0; i < nstates; i++)
- state_count[i] = 0;
-
- for (i = m; i < n; i++)
- state_count[to_state[i]]++;
-
- max = 0;
- default_state = 0;
- for (i = 0; i < nstates; i++)
- {
- if (state_count[i] > max)
- {
- max = state_count[i];
- default_state = i;
- }
- }
-
- return (default_state);
-}
-
-
-
-save_column(symbol, default_state)
-int symbol;
-int default_state;
-{
- register int i;
- register int m;
- register int n;
- register short *sp;
- register short *sp1;
- register short *sp2;
- register int count;
- register int symno;
-
- m = goto_map[symbol];
- n = goto_map[symbol + 1];
-
- count = 0;
- for (i = m; i < n; i++)
- {
- if (to_state[i] != default_state)
- ++count;
- }
- if (count == 0) return;
-
- symno = symbol_value[symbol] + 2*nstates;
-
- froms[symno] = sp1 = sp = NEW2(count, short);
- tos[symno] = sp2 = NEW2(count, short);
-
- for (i = m; i < n; i++)
- {
- if (to_state[i] != default_state)
- {
- *sp1++ = from_state[i];
- *sp2++ = to_state[i];
- }
- }
-
- tally[symno] = count;
- width[symno] = sp1[-1] - sp[0] + 1;
-}
-
-sort_actions()
-{
- register int i;
- register int j;
- register int k;
- register int t;
- register int w;
-
- order = NEW2(nvectors, short);
- nentries = 0;
-
- for (i = 0; i < nvectors; i++)
- {
- if (tally[i] > 0)
- {
- t = tally[i];
- w = width[i];
- j = nentries - 1;
-
- while (j >= 0 && (width[order[j]] < w))
- j--;
-
- while (j >= 0 && (width[order[j]] == w) && (tally[order[j]] < t))
- j--;
-
- for (k = nentries - 1; k > j; k--)
- order[k + 1] = order[k];
-
- order[j + 1] = i;
- nentries++;
- }
- }
-}
-
-
-pack_table()
-{
- register int i;
- register int place;
- register int state;
-
- base = NEW2(nvectors, short);
- pos = NEW2(nentries, short);
-
- maxtable = 1000;
- table = NEW2(maxtable, short);
- check = NEW2(maxtable, short);
-
- lowzero = 0;
- high = 0;
-
- for (i = 0; i < maxtable; i++)
- check[i] = -1;
-
- for (i = 0; i < nentries; i++)
- {
- state = matching_vector(i);
-
- if (state < 0)
- place = pack_vector(i);
- else
- place = base[state];
-
- pos[i] = place;
- base[order[i]] = place;
- }
-
- for (i = 0; i < nvectors; i++)
- {
- if (froms[i])
- FREE(froms[i]);
- if (tos[i])
- FREE(tos[i]);
- }
-
- FREE(froms);
- FREE(tos);
- FREE(pos);
-}
-
-
-/* The function matching_vector determines if the vector specified by */
-/* the input parameter matches a previously considered vector. The */
-/* test at the start of the function checks if the vector represents */
-/* a row of shifts over terminal symbols or a row of reductions, or a */
-/* column of shifts over a nonterminal symbol. Berkeley Yacc does not */
-/* check if a column of shifts over a nonterminal symbols matches a */
-/* previously considered vector. Because of the nature of LR parsing */
-/* tables, no two columns can match. Therefore, the only possible */
-/* match would be between a row and a column. Such matches are */
-/* unlikely. Therefore, to save time, no attempt is made to see if a */
-/* column matches a previously considered vector. */
-/* */
-/* Matching_vector is poorly designed. The test could easily be made */
-/* faster. Also, it depends on the vectors being in a specific */
-/* order. */
-
-int
-matching_vector(vector)
-int vector;
-{
- register int i;
- register int j;
- register int k;
- register int t;
- register int w;
- register int match;
- register int prev;
-
- i = order[vector];
- if (i >= 2*nstates)
- return (-1);
-
- t = tally[i];
- w = width[i];
-
- for (prev = vector - 1; prev >= 0; prev--)
- {
- j = order[prev];
- if (width[j] != w || tally[j] != t)
- return (-1);
-
- match = 1;
- for (k = 0; match && k < t; k++)
- {
- if (tos[j][k] != tos[i][k] || froms[j][k] != froms[i][k])
- match = 0;
- }
-
- if (match)
- return (j);
- }
-
- return (-1);
-}
-
-
-
-int
-pack_vector(vector)
-int vector;
-{
- register int i, j, k, l;
- register int t;
- register int loc;
- register int ok;
- register short *from;
- register short *to;
- int newmax;
-
- i = order[vector];
- t = tally[i];
- assert(t);
-
- from = froms[i];
- to = tos[i];
-
- j = lowzero - from[0];
- for (k = 1; k < t; ++k)
- if (lowzero - from[k] > j)
- j = lowzero - from[k];
- for (;; ++j)
- {
- if (j == 0)
- continue;
- ok = 1;
- for (k = 0; ok && k < t; k++)
- {
- loc = j + from[k];
- if (loc >= maxtable)
- {
- if (loc >= MAXTABLE)
- fatal("maximum table size exceeded");
-
- newmax = maxtable;
- do { newmax += 200; } while (newmax <= loc);
- table = (short *) REALLOC(table, newmax*sizeof(short));
- if (table == 0) no_space();
- check = (short *) REALLOC(check, newmax*sizeof(short));
- if (check == 0) no_space();
- for (l = maxtable; l < newmax; ++l)
- {
- table[l] = 0;
- check[l] = -1;
- }
- maxtable = newmax;
- }
-
- if (check[loc] != -1)
- ok = 0;
- }
- for (k = 0; ok && k < vector; k++)
- {
- if (pos[k] == j)
- ok = 0;
- }
- if (ok)
- {
- for (k = 0; k < t; k++)
- {
- loc = j + from[k];
- table[loc] = to[k];
- check[loc] = from[k];
- if (loc > high) high = loc;
- }
-
- while (check[lowzero] != -1)
- ++lowzero;
-
- return (j);
- }
- }
-}
-
-
-
-output_base()
-{
- register int i, j;
-
- printf(" protected static %s short [] yySindex = {%13d,", csharp?"":"final", base[0]);
-
- j = 10;
- for (i = 1; i < nstates; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", base[i]);
- }
-
- outline += 2;
- printf("\n };\n protected static %s short [] yyRindex = {%13d,",
- csharp ? "" : "final",
- base[nstates]);
-
- j = 10;
- for (i = nstates + 1; i < 2*nstates; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", base[i]);
- }
-
- outline += 2;
- printf("\n };\n protected static %s short [] yyGindex = {%13d,",
- csharp ? "" : "final",
- base[2*nstates]);
-
- j = 10;
- for (i = 2*nstates + 1; i < nvectors - 1; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", base[i]);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(base);
-}
-
-
-
-output_table()
-{
- register int i;
- register int j;
-
- printf(" protected static %s short [] yyTable = {%14d,", csharp ? "" : "final", table[0]);
-
- j = 10;
- for (i = 1; i <= high; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", table[i]);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(table);
-}
-
-
-
-output_check()
-{
- register int i;
- register int j;
-
- printf(" protected static %s short [] yyCheck = {%14d,",
- csharp ? "" : "final",
- check[0]);
-
- j = 10;
- for (i = 1; i <= high; i++)
- {
- if (j >= 10)
- {
- ++outline;
- putchar('\n');
- j = 1;
- }
- else
- ++j;
-
- printf("%5d,", check[i]);
- }
-
- outline += 2;
- printf("\n };\n");
- FREE(check);
-}
-
-
-int
-is_C_identifier(name)
-char *name;
-{
- register char *s;
- register int c;
-
- s = name;
- c = *s;
- if (c == '"')
- {
- c = *++s;
- if (!isalpha(c) && c != '_' && c != '$')
- return (0);
- while ((c = *++s) != '"')
- {
- if (!isalnum(c) && c != '_' && c != '$')
- return (0);
- }
- return (1);
- }
-
- if (!isalpha(c) && c != '_' && c != '$')
- return (0);
- while (c = *++s)
- {
- if (!isalnum(c) && c != '_' && c != '$')
- return (0);
- }
- return (1);
-}
-
-
-output_defines(prefix)
-char *prefix;
-{
- register int c, i;
- register char *s;
-
- for (i = 2; i < ntokens; ++i)
- {
- s = symbol_name[i];
- if (is_C_identifier(s))
- {
- if (prefix)
- printf(" %s ", prefix);
- c = *s;
- if (c == '"')
- {
- while ((c = *++s) != '"')
- {
- putchar(c);
- }
- }
- else
- {
- do
- {
- putchar(c);
- }
- while (c = *++s);
- }
- ++outline;
- printf(" = %d%s\n", symbol_value[i], csharp ? ";" : ";");
- }
- }
-
- ++outline;
- printf(" %s yyErrorCode = %d%s\n", prefix ? prefix : "", symbol_value[1], csharp ? ";" : ";");
-}
-
-
-output_stored_text(file, name)
-FILE *file;
-char *name;
-{
- register int c;
- register FILE *in;
-
- fflush(file);
- in = fopen(name, "r");
- if (in == NULL)
- open_error(name);
- if ((c = getc(in)) != EOF) {
- if (c == '\n')
- ++outline;
- putchar(c);
- while ((c = getc(in)) != EOF)
- {
- if (c == '\n')
- ++outline;
- putchar(c);
- }
- printf(line_format, ++outline + 1, "-");
- }
- fclose(in);
-}
-
-
-output_debug()
-{
- register int i, j, k, max;
- char **symnam, *s;
- char * prefix = tflag ? "" : "//t";
-
- ++outline;
- printf(" protected static %s int yyFinal = %d;\n", csharp ? "" : "final", final_state);
-
- ++outline;
- printf("%s public static %s string [] yyRule = {\n", prefix, csharp ? "" : "final");
- for (i = 2; i < nrules; ++i)
- {
- printf("%s \"%s :", prefix, symbol_name[rlhs[i]]);
- for (j = rrhs[i]; ritem[j] > 0; ++j)
- {
- s = symbol_name[ritem[j]];
- if (s[0] == '"')
- {
- printf(" \\\"");
- while (*++s != '"')
- {
- if (*s == '\\')
- {
- if (s[1] == '\\')
- printf("\\\\\\\\");
- else
- printf("\\\\%c", s[1]);
- ++s;
- }
- else
- putchar(*s);
- }
- printf("\\\"");
- }
- else if (s[0] == '\'')
- {
- if (s[1] == '"')
- printf(" '\\\"'");
- else if (s[1] == '\\')
- {
- if (s[2] == '\\')
- printf(" '\\\\\\\\");
- else
- printf(" '\\\\%c", s[2]);
- s += 2;
- while (*++s != '\'')
- putchar(*s);
- putchar('\'');
- }
- else
- printf(" '%c'", s[1]);
- }
- else
- printf(" %s", s);
- }
- ++outline;
- printf("\",\n");
- }
- ++ outline;
- printf("%s };\n", prefix);
-
- max = 0;
- for (i = 2; i < ntokens; ++i)
- if (symbol_value[i] > max)
- max = symbol_value[i];
-
- /* need yyName for yyExpecting() */
-
- printf(" protected static %s string [] yyName = {", csharp ? "" : "final");
- symnam = (char **) MALLOC((max+1)*sizeof(char *));
- if (symnam == 0) no_space();
-
- /* Note that it is not necessary to initialize the element */
- /* symnam[max]. */
- for (i = 0; i < max; ++i)
- symnam[i] = 0;
- for (i = ntokens - 1; i >= 2; --i)
- symnam[symbol_value[i]] = symbol_name[i];
- symnam[0] = "end-of-file";
-
- j = 70; fputs(" ", stdout);
- for (i = 0; i <= max; ++i)
- {
- if (s = symnam[i])
- {
- if (s[0] == '"')
- {
- k = 7;
- while (*++s != '"')
- {
- ++k;
- if (*s == '\\')
- {
- k += 2;
- if (*++s == '\\')
- ++k;
- }
- }
- j += k;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = k;
- }
- printf("\"\\\"");
- s = symnam[i];
- while (*++s != '"')
- {
- if (*s == '\\')
- {
- printf("\\\\");
- if (*++s == '\\')
- printf("\\\\");
- else
- putchar(*s);
- }
- else
- putchar(*s);
- }
- printf("\\\"\",");
- }
- else if (s[0] == '\'')
- {
- if (s[1] == '"')
- {
- j += 7;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = 7;
- }
- printf("\"'\\\"'\",");
- }
- else
- {
- k = 5;
- while (*++s != '\'')
- {
- ++k;
- if (*s == '\\')
- {
- k += 2;
- if (*++s == '\\')
- ++k;
- }
- }
- j += k;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = k;
- }
- printf("\"'");
- s = symnam[i];
- while (*++s != '\'')
- {
- if (*s == '\\')
- {
- printf("\\\\");
- if (*++s == '\\')
- printf("\\\\");
- else
- putchar(*s);
- }
- else
- putchar(*s);
- }
- printf("'\",");
- }
- }
- else
- {
- k = strlen(s) + 3;
- j += k;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = k;
- }
- putchar('"');
- do { putchar(*s); } while (*++s);
- printf("\",");
- }
- }
- else
- {
- j += 5;
- if (j > 70)
- {
- ++outline;
- printf("\n ");
- j = 5;
- }
- printf("null,");
- }
- }
- outline += 2;
- printf("\n };\n");
- FREE(symnam);
-}
-
-output_trailing_text()
-{
- register int c, last;
- register FILE *in;
-
- if (line == 0)
- return;
-
- in = input_file;
- c = *cptr;
- if (c == '\n')
- {
- ++lineno;
- if ((c = getc(in)) == EOF)
- return;
- ++outline;
- printf(line_format, lineno, input_file_name);
- if (c == '\n')
- ++outline;
- putchar(c);
- last = c;
- }
- else
- {
- ++outline;
- printf(line_format, lineno, input_file_name);
- do { putchar(c); } while ((c = *++cptr) != '\n');
- ++outline;
- putchar('\n');
- last = '\n';
- }
-
- while ((c = getc(in)) != EOF)
- {
- if (c == '\n')
- ++outline;
- putchar(c);
- last = c;
- }
-
- if (last != '\n')
- {
- ++outline;
- putchar('\n');
- }
- printf(line_format, ++outline + 1, "-");
-}
-
-
-output_semantic_actions()
-{
- register int c, last;
-
- fclose(action_file);
- action_file = fopen(action_file_name, "r");
- if (action_file == NULL)
- open_error(action_file_name);
-
- if ((c = getc(action_file)) == EOF)
- return;
-
- last = c;
- if (c == '\n')
- ++outline;
- putchar(c);
- while ((c = getc(action_file)) != EOF)
- {
- if (c == '\n')
- ++outline;
- putchar(c);
- last = c;
- }
-
- if (last != '\n')
- {
- ++outline;
- putchar('\n');
- }
-
- printf(line_format, ++outline + 1, "-");
-}
-
-
-free_itemsets()
-{
- register core *cp, *next;
-
- FREE(state_table);
- for (cp = first_state; cp; cp = next)
- {
- next = cp->next;
- FREE(cp);
- }
-}
-
-
-free_shifts()
-{
- register shifts *sp, *next;
-
- FREE(shift_table);
- for (sp = first_shift; sp; sp = next)
- {
- next = sp->next;
- FREE(sp);
- }
-}
-
-
-
-free_reductions()
-{
- register reductions *rp, *next;
-
- FREE(reduction_table);
- for (rp = first_reduction; rp; rp = next)
- {
- next = rp->next;
- FREE(rp);
- }
-}
diff --git a/mcs/jay/reader.c b/mcs/jay/reader.c
deleted file mode 100644
index f2cdd5af834..00000000000
--- a/mcs/jay/reader.c
+++ /dev/null
@@ -1,1627 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)reader.c 5.7 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-/* The line size must be a positive integer. One hundred was chosen */
-/* because few lines in Yacc input grammars exceed 100 characters. */
-/* Note that if a line exceeds LINESIZE characters, the line buffer */
-/* will be expanded to accomodate it. */
-
-#define LINESIZE 100
-
-char *cache;
-int cinc, cache_size;
-
-int ntags, tagmax;
-char **tag_table;
-
-char saw_eof;
-char *cptr, *line;
-int linesize;
-
-bucket *goal;
-int prec;
-int gensym;
-char last_was_action;
-
-int maxitems;
-bucket **pitem;
-
-int maxrules;
-bucket **plhs;
-
-int name_pool_size;
-char *name_pool;
-
-char *line_format = "\t\t\t\t\t// line %d \"%s\"\n";
-
-
-cachec(c)
-int c;
-{
- assert(cinc >= 0);
- if (cinc >= cache_size)
- {
- cache_size += 256;
- cache = REALLOC(cache, cache_size);
- if (cache == 0) no_space();
- }
- cache[cinc] = c;
- ++cinc;
-}
-
-
-get_line()
-{
- register FILE *f = input_file;
- register int c;
- register int i;
-
- if (saw_eof || (c = getc(f)) == EOF)
- {
- if (line) { FREE(line); line = 0; }
- cptr = 0;
- saw_eof = 1;
- return;
- }
-
- if (line == 0 || linesize != (LINESIZE + 1))
- {
- if (line) FREE(line);
- linesize = LINESIZE + 1;
- line = MALLOC(linesize);
- if (line == 0) no_space();
- }
-
- i = 0;
- ++lineno;
- for (;;)
- {
- line[i] = c;
- if (c == '\n') { cptr = line; return; }
- if (++i >= linesize)
- {
- linesize += LINESIZE;
- line = REALLOC(line, linesize);
- if (line == 0) no_space();
- }
- c = getc(f);
- if (c == EOF)
- {
- line[i] = '\n';
- saw_eof = 1;
- cptr = line;
- return;
- }
- }
-}
-
-
-char *
-dup_line()
-{
- register char *p, *s, *t;
-
- if (line == 0) return (0);
- s = line;
- while (*s != '\n') ++s;
- p = MALLOC(s - line + 1);
- if (p == 0) no_space();
-
- s = line;
- t = p;
- while ((*t++ = *s++) != '\n') continue;
- return (p);
-}
-
-
-skip_comment()
-{
- register char *s;
-
- int st_lineno = lineno;
- char *st_line = dup_line();
- char *st_cptr = st_line + (cptr - line);
-
- s = cptr + 2;
- for (;;)
- {
- if (*s == '*' && s[1] == '/')
- {
- cptr = s + 2;
- FREE(st_line);
- return;
- }
- if (*s == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_comment(st_lineno, st_line, st_cptr);
- s = cptr;
- }
- else
- ++s;
- }
-}
-
-
-int
-nextc()
-{
- register char *s;
-
- if (line == 0)
- {
- get_line();
- if (line == 0)
- return (EOF);
- }
-
- s = cptr;
- for (;;)
- {
- switch (*s)
- {
- case '\n':
- get_line();
- if (line == 0) return (EOF);
- s = cptr;
- break;
-
- case ' ':
- case '\t':
- case '\f':
- case '\r':
- case '\v':
- case ',':
- case ';':
- ++s;
- break;
-
- case '\\':
- cptr = s;
- return ('%');
-
- case '/':
- if (s[1] == '*')
- {
- cptr = s;
- skip_comment();
- s = cptr;
- break;
- }
- else if (s[1] == '/')
- {
- get_line();
- if (line == 0) return (EOF);
- s = cptr;
- break;
- }
- /* fall through */
-
- default:
- cptr = s;
- return (*s);
- }
- }
-}
-
-
-int
-keyword()
-{
- register int c;
- char *t_cptr = cptr;
-
- c = *++cptr;
- if (isalpha(c))
- {
- cinc = 0;
- for (;;)
- {
- if (isalpha(c))
- {
- if (isupper(c)) c = tolower(c);
- cachec(c);
- }
- else if (isdigit(c) || c == '_' || c == '.' || c == '$')
- cachec(c);
- else
- break;
- c = *++cptr;
- }
- cachec(NUL);
-
- if (strcmp(cache, "token") == 0 || strcmp(cache, "term") == 0)
- return (TOKEN);
- if (strcmp(cache, "type") == 0)
- return (TYPE);
- if (strcmp(cache, "left") == 0)
- return (LEFT);
- if (strcmp(cache, "right") == 0)
- return (RIGHT);
- if (strcmp(cache, "nonassoc") == 0 || strcmp(cache, "binary") == 0)
- return (NONASSOC);
- if (strcmp(cache, "start") == 0)
- return (START);
- }
- else
- {
- ++cptr;
- if (c == '{')
- return (TEXT);
- if (c == '%' || c == '\\')
- return (MARK);
- if (c == '<')
- return (LEFT);
- if (c == '>')
- return (RIGHT);
- if (c == '0')
- return (TOKEN);
- if (c == '2')
- return (NONASSOC);
- }
- syntax_error(lineno, line, t_cptr);
- /*NOTREACHED*/
-}
-
-
-copy_text(f)
-FILE *f;
-{
- register int c;
- int quote;
- int need_newline = 0;
- int t_lineno = lineno;
- char *t_line = dup_line();
- char *t_cptr = t_line + (cptr - line - 2);
-
- if (*cptr == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_text(t_lineno, t_line, t_cptr);
- }
- fprintf(f, line_format, lineno, input_file_name);
-
-loop:
- c = *cptr++;
- switch (c)
- {
- case '\n':
- next_line:
- putc('\n', f);
- need_newline = 0;
- get_line();
- if (line) goto loop;
- unterminated_text(t_lineno, t_line, t_cptr);
-
- case '\'':
- case '"':
- {
- int s_lineno = lineno;
- char *s_line = dup_line();
- char *s_cptr = s_line + (cptr - line - 1);
-
- quote = c;
- putc(c, f);
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == quote)
- {
- need_newline = 1;
- FREE(s_line);
- goto loop;
- }
- if (c == '\n')
- unterminated_string(s_lineno, s_line, s_cptr);
- if (c == '\\')
- {
- c = *cptr++;
- putc(c, f);
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_string(s_lineno, s_line, s_cptr);
- }
- }
- }
- }
-
- case '/':
- putc(c, f);
- need_newline = 1;
- c = *cptr;
- if (c == '/')
- {
- do putc(c, f); while ((c = *++cptr) != '\n');
- goto next_line;
- }
- if (c == '*')
- {
- int c_lineno = lineno;
- char *c_line = dup_line();
- char *c_cptr = c_line + (cptr - line - 1);
-
- putc('*', f);
- ++cptr;
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == '*' && *cptr == '/')
- {
- putc('/', f);
- ++cptr;
- FREE(c_line);
- goto loop;
- }
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_comment(c_lineno, c_line, c_cptr);
- }
- }
- }
- need_newline = 1;
- goto loop;
-
- case '%':
- case '\\':
- if (*cptr == '}')
- {
- if (need_newline) putc('\n', f);
- ++cptr;
- FREE(t_line);
- return;
- }
- /* fall through */
-
- default:
- putc(c, f);
- need_newline = 1;
- goto loop;
- }
-}
-
-int
-hexval(c)
-int c;
-{
- if (c >= '0' && c <= '9')
- return (c - '0');
- if (c >= 'A' && c <= 'F')
- return (c - 'A' + 10);
- if (c >= 'a' && c <= 'f')
- return (c - 'a' + 10);
- return (-1);
-}
-
-
-bucket *
-get_literal()
-{
- register int c, quote;
- register int i;
- register int n;
- register char *s;
- register bucket *bp;
- int s_lineno = lineno;
- char *s_line = dup_line();
- char *s_cptr = s_line + (cptr - line);
-
- quote = *cptr++;
- cinc = 0;
- for (;;)
- {
- c = *cptr++;
- if (c == quote) break;
- if (c == '\n') unterminated_string(s_lineno, s_line, s_cptr);
- if (c == '\\')
- {
- char *c_cptr = cptr - 1;
-
- c = *cptr++;
- switch (c)
- {
- case '\n':
- get_line();
- if (line == 0) unterminated_string(s_lineno, s_line, s_cptr);
- continue;
-
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- n = c - '0';
- c = *cptr;
- if (IS_OCTAL(c))
- {
- n = (n << 3) + (c - '0');
- c = *++cptr;
- if (IS_OCTAL(c))
- {
- n = (n << 3) + (c - '0');
- ++cptr;
- }
- }
- if (n > MAXCHAR) illegal_character(c_cptr);
- c = n;
- break;
-
- case 'x':
- c = *cptr++;
- n = hexval(c);
- if (n < 0 || n >= 16)
- illegal_character(c_cptr);
- for (;;)
- {
- c = *cptr;
- i = hexval(c);
- if (i < 0 || i >= 16) break;
- ++cptr;
- n = (n << 4) + i;
- if (n > MAXCHAR) illegal_character(c_cptr);
- }
- c = n;
- break;
-
- case 'a': c = 7; break;
- case 'b': c = '\b'; break;
- case 'f': c = '\f'; break;
- case 'n': c = '\n'; break;
- case 'r': c = '\r'; break;
- case 't': c = '\t'; break;
- case 'v': c = '\v'; break;
- }
- }
- cachec(c);
- }
- FREE(s_line);
-
- n = cinc;
- s = MALLOC(n);
- if (s == 0) no_space();
-
- for (i = 0; i < n; ++i)
- s[i] = cache[i];
-
- cinc = 0;
- if (n == 1)
- cachec('\'');
- else
- cachec('"');
-
- for (i = 0; i < n; ++i)
- {
- c = ((unsigned char *)s)[i];
- if (c == '\\' || c == cache[0])
- {
- cachec('\\');
- cachec(c);
- }
- else if (isprint(c))
- cachec(c);
- else
- {
- cachec('\\');
- switch (c)
- {
- case 7: cachec('a'); break;
- case '\b': cachec('b'); break;
- case '\f': cachec('f'); break;
- case '\n': cachec('n'); break;
- case '\r': cachec('r'); break;
- case '\t': cachec('t'); break;
- case '\v': cachec('v'); break;
- default:
- cachec(((c >> 6) & 7) + '0');
- cachec(((c >> 3) & 7) + '0');
- cachec((c & 7) + '0');
- break;
- }
- }
- }
-
- if (n == 1)
- cachec('\'');
- else
- cachec('"');
-
- cachec(NUL);
- bp = lookup(cache);
- bp->class = TERM;
- if (n == 1 && bp->value == UNDEFINED)
- bp->value = *(unsigned char *)s;
- FREE(s);
-
- return (bp);
-}
-
-
-int
-is_reserved(name)
-char *name;
-{
- char *s;
-
- if (strcmp(name, ".") == 0 ||
- strcmp(name, "$accept") == 0 ||
- strcmp(name, "$end") == 0)
- return (1);
-
- if (name[0] == '$' && name[1] == '$' && isdigit(name[2]))
- {
- s = name + 3;
- while (isdigit(*s)) ++s;
- if (*s == NUL) return (1);
- }
-
- return (0);
-}
-
-
-bucket *
-get_name()
-{
- register int c;
-
- cinc = 0;
- for (c = *cptr; IS_IDENT(c); c = *++cptr)
- cachec(c);
- cachec(NUL);
-
- if (is_reserved(cache)) used_reserved(cache);
-
- return (lookup(cache));
-}
-
-
-int
-get_number()
-{
- register int c;
- register int n;
-
- n = 0;
- for (c = *cptr; isdigit(c); c = *++cptr)
- n = 10*n + (c - '0');
-
- return (n);
-}
-
-
-char *
-get_tag(int emptyOk)
-{
- register int c;
- register int i;
- register char *s;
- int t_lineno = lineno;
- char *t_line = dup_line();
- char *t_cptr = t_line + (cptr - line);
-
- ++cptr;
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (emptyOk && c == '>') {
- ++cptr; return 0; // 0 indicates empty tag if emptyOk
- }
- if (!isalpha(c) && c != '_' && c != '$')
- illegal_tag(t_lineno, t_line, t_cptr);
-
- cinc = 0;
- do { cachec(c); c = *++cptr; } while (IS_IDENT(c));
- cachec(NUL);
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != '>')
- illegal_tag(t_lineno, t_line, t_cptr);
- ++cptr;
-
- for (i = 0; i < ntags; ++i)
- {
- if (strcmp(cache, tag_table[i]) == 0)
- return (tag_table[i]);
- }
-
- if (ntags >= tagmax)
- {
- tagmax += 16;
- tag_table = (char **)
- (tag_table ? REALLOC(tag_table, tagmax*sizeof(char *))
- : MALLOC(tagmax*sizeof(char *)));
- if (tag_table == 0) no_space();
- }
-
- s = MALLOC(cinc);
- if (s == 0) no_space();
- strcpy(s, cache);
- tag_table[ntags] = s;
- ++ntags;
- FREE(t_line);
- return (s);
-}
-
-
-declare_tokens(assoc)
-int assoc;
-{
- register int c;
- register bucket *bp;
- int value;
- char *tag = 0;
-
- if (assoc != TOKEN) ++prec;
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c == '<')
- {
- tag = get_tag(0);
- c = nextc();
- if (c == EOF) unexpected_EOF();
- }
-
- for (;;)
- {
- if (isalpha(c) || c == '_' || c == '.' || c == '$')
- bp = get_name();
- else if (c == '\'' || c == '"')
- bp = get_literal();
- else
- return;
-
- if (bp == goal) tokenized_start(bp->name);
- bp->class = TERM;
-
- if (tag)
- {
- if (bp->tag && tag != bp->tag)
- retyped_warning(bp->name);
- bp->tag = tag;
- }
-
- if (assoc != TOKEN)
- {
- if (bp->prec && prec != bp->prec)
- reprec_warning(bp->name);
- bp->assoc = assoc;
- bp->prec = prec;
- }
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- value = UNDEFINED;
- if (isdigit(c))
- {
- value = get_number();
- if (bp->value != UNDEFINED && value != bp->value)
- revalued_warning(bp->name);
- bp->value = value;
- c = nextc();
- if (c == EOF) unexpected_EOF();
- }
- }
-}
-
-
-declare_types()
-{
- register int c;
- register bucket *bp;
- char *tag;
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != '<') syntax_error(lineno, line, cptr);
- tag = get_tag(0);
-
- for (;;)
- {
- c = nextc();
- if (isalpha(c) || c == '_' || c == '.' || c == '$')
- bp = get_name();
- else if (c == '\'' || c == '"')
- bp = get_literal();
- else
- return;
-
- if (bp->tag && tag != bp->tag)
- retyped_warning(bp->name);
- bp->tag = tag;
- }
-}
-
-
-declare_start()
-{
- register int c;
- register bucket *bp;
-
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (!isalpha(c) && c != '_' && c != '.' && c != '$')
- syntax_error(lineno, line, cptr);
- bp = get_name();
- if (bp->class == TERM)
- terminal_start(bp->name);
- if (goal && goal != bp)
- restarted_warning();
- goal = bp;
-}
-
-
-read_declarations()
-{
- register int c, k;
-
- cache_size = 256;
- cache = MALLOC(cache_size);
- if (cache == 0) no_space();
-
- for (;;)
- {
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != '%') syntax_error(lineno, line, cptr);
- switch (k = keyword())
- {
- case MARK:
- return;
-
- case TEXT:
- copy_text(prolog_file);
- break;
-
- case TOKEN:
- case LEFT:
- case RIGHT:
- case NONASSOC:
- declare_tokens(k);
- break;
-
- case TYPE:
- declare_types();
- break;
-
- case START:
- declare_start();
- break;
- }
- }
-}
-
-
-initialize_grammar()
-{
- nitems = 4;
- maxitems = 300;
- pitem = (bucket **) MALLOC(maxitems*sizeof(bucket *));
- if (pitem == 0) no_space();
- pitem[0] = 0;
- pitem[1] = 0;
- pitem[2] = 0;
- pitem[3] = 0;
-
- nrules = 3;
- maxrules = 100;
- plhs = (bucket **) MALLOC(maxrules*sizeof(bucket *));
- if (plhs == 0) no_space();
- plhs[0] = 0;
- plhs[1] = 0;
- plhs[2] = 0;
- rprec = (short *) MALLOC(maxrules*sizeof(short));
- if (rprec == 0) no_space();
- rprec[0] = 0;
- rprec[1] = 0;
- rprec[2] = 0;
- rassoc = (char *) MALLOC(maxrules*sizeof(char));
- if (rassoc == 0) no_space();
- rassoc[0] = TOKEN;
- rassoc[1] = TOKEN;
- rassoc[2] = TOKEN;
-}
-
-
-expand_items()
-{
- maxitems += 300;
- pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *));
- if (pitem == 0) no_space();
-}
-
-
-expand_rules()
-{
- maxrules += 100;
- plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *));
- if (plhs == 0) no_space();
- rprec = (short *) REALLOC(rprec, maxrules*sizeof(short));
- if (rprec == 0) no_space();
- rassoc = (char *) REALLOC(rassoc, maxrules*sizeof(char));
- if (rassoc == 0) no_space();
-}
-
-
-advance_to_start()
-{
- register int c;
- register bucket *bp;
- char *s_cptr;
- int s_lineno;
-
- for (;;)
- {
- c = nextc();
- if (c != '%') break;
- s_cptr = cptr;
- switch (keyword())
- {
- case MARK:
- no_grammar();
-
- case TEXT:
- copy_text(local_file);
- break;
-
- case START:
- declare_start();
- break;
-
- default:
- syntax_error(lineno, line, s_cptr);
- }
- }
-
- c = nextc();
- if (!isalpha(c) && c != '_' && c != '.' && c != '_')
- syntax_error(lineno, line, cptr);
- bp = get_name();
- if (goal == 0)
- {
- if (bp->class == TERM)
- terminal_start(bp->name);
- goal = bp;
- }
-
- s_lineno = lineno;
- c = nextc();
- if (c == EOF) unexpected_EOF();
- if (c != ':') syntax_error(lineno, line, cptr);
- start_rule(bp, s_lineno);
- ++cptr;
-}
-
-
-start_rule(bp, s_lineno)
-register bucket *bp;
-int s_lineno;
-{
- if (bp->class == TERM)
- terminal_lhs(s_lineno);
- bp->class = NONTERM;
- if (nrules >= maxrules)
- expand_rules();
- plhs[nrules] = bp;
- rprec[nrules] = UNDEFINED;
- rassoc[nrules] = TOKEN;
-}
-
-
-end_rule()
-{
- register int i;
-
- if (!last_was_action && plhs[nrules]->tag)
- {
- for (i = nitems - 1; pitem[i]; --i) continue;
- if (pitem[i+1] == 0 || pitem[i+1]->tag != plhs[nrules]->tag)
- default_action_warning(); /** if classes don't match exactly **/
- } /** bug: could be superclass... **/
-
- last_was_action = 0;
- if (nitems >= maxitems) expand_items();
- pitem[nitems] = 0;
- ++nitems;
- ++nrules;
-}
-
-
-insert_empty_rule()
-{
- register bucket *bp, **bpp;
-
- assert(cache);
- sprintf(cache, "$$%d", ++gensym);
- bp = make_bucket(cache);
- last_symbol->next = bp;
- last_symbol = bp;
- bp->tag = plhs[nrules]->tag;
- bp->class = NONTERM;
-
- if ((nitems += 2) > maxitems)
- expand_items();
- bpp = pitem + nitems - 1;
- *bpp-- = bp;
- while (bpp[0] = bpp[-1]) --bpp;
-
- if (++nrules >= maxrules)
- expand_rules();
- plhs[nrules] = plhs[nrules-1];
- plhs[nrules-1] = bp;
- rprec[nrules] = rprec[nrules-1];
- rprec[nrules-1] = 0;
- rassoc[nrules] = rassoc[nrules-1];
- rassoc[nrules-1] = TOKEN;
-}
-
-
-add_symbol()
-{
- register int c;
- register bucket *bp;
- int s_lineno = lineno;
-
- c = *cptr;
- if (c == '\'' || c == '"')
- bp = get_literal();
- else
- bp = get_name();
-
- c = nextc();
- if (c == ':')
- {
- end_rule();
- start_rule(bp, s_lineno);
- ++cptr;
- return;
- }
-
- if (last_was_action)
- insert_empty_rule();
- last_was_action = 0;
-
- if (++nitems > maxitems)
- expand_items();
- pitem[nitems-1] = bp;
-}
-
-
-copy_action()
-{
- register int c;
- register int i, n;
- int depth;
- int quote;
- char *tag;
- register FILE *f = action_file;
- int a_lineno = lineno;
- char *a_line = dup_line();
- char *a_cptr = a_line + (cptr - line);
-
- if (last_was_action)
- insert_empty_rule();
- last_was_action = 1;
-
- fprintf(f, "case %d:\n", nrules - 2);
- fprintf(f, line_format, lineno, input_file_name);
- putc(' ', f); putc(' ', f);
- if (*cptr == '=') ++cptr;
-
- n = 0;
- for (i = nitems - 1; pitem[i]; --i) ++n;
-
- depth = 0;
-loop:
- c = *cptr;
- if (c == '$')
- {
- if (cptr[1] == '<')
- {
- int d_lineno = lineno;
- char *d_line = dup_line();
- char *d_cptr = d_line + (cptr - line);
-
- ++cptr;
- tag = get_tag(1);
- c = *cptr;
- if (c == '$')
- { if (tag && strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVal)", tag);
- else fprintf(f, "yyVal");
- ++cptr;
- FREE(d_line);
- goto loop;
- }
- else if (isdigit(c))
- {
- i = get_number();
- if (i > n) dollar_warning(d_lineno, i);
- if (tag && strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVals[%d+yyTop])", tag, i - n);
- else fprintf(f, "yyVals[%d+yyTop]", i - n);
- FREE(d_line);
- goto loop;
- }
- else if (c == '-' && isdigit(cptr[1]))
- {
- ++cptr;
- i = -get_number() - n;
- if (tag && strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVals[%d+yyTop])", tag, i);
- else fprintf(f, "yyVals[%d+yyTop]", tag, i);
- FREE(d_line);
- goto loop;
- }
- else
- dollar_error(d_lineno, d_line, d_cptr);
- }
- else if (cptr[1] == '$')
- {
- if (ntags && plhs[nrules]->tag == 0)
- untyped_lhs();
- fprintf(f, "yyVal");
- cptr += 2;
- goto loop;
- }
- else if (isdigit(cptr[1]))
- {
- ++cptr;
- i = get_number();
- if (ntags)
- {
- if (i <= 0 || i > n)
- unknown_rhs(i);
- tag = pitem[nitems + i - n - 1]->tag;
- if (tag == 0)
- untyped_rhs(i, pitem[nitems + i - n - 1]->name),
- fprintf(f, "yyVals[%d+yyTop]", i - n);
- else if (strcmp(tag, "Object"))
- fprintf(f, "((%s)yyVals[%d+yyTop])", tag, i - n);
- else
- fprintf(f, "yyVals[%d+yyTop]", i - n);
- }
- else
- {
- if (i > n)
- dollar_warning(lineno, i);
- fprintf(f, "yyVals[%d+yyTop]", i - n);
- }
- goto loop;
- }
- else if (cptr[1] == '-')
- {
- cptr += 2;
- i = get_number();
- if (ntags)
- unknown_rhs(-i);
- fprintf(f, "yyVals[%d+yyTop]", -i - n);
- goto loop;
- }
- }
- if (isalpha(c) || c == '_' || c == '$')
- {
- do
- {
- putc(c, f);
- c = *++cptr;
- } while (isalnum(c) || c == '_' || c == '$');
- goto loop;
- }
- putc(c, f);
- ++cptr;
- switch (c)
- {
- case '\n':
- next_line:
- get_line();
- if (line) goto loop;
- unterminated_action(a_lineno, a_line, a_cptr);
-
- case ';':
- if (depth > 0) goto loop;
- fprintf(f, "\nbreak;\n");
- return;
-
- case '{':
- ++depth;
- goto loop;
-
- case '}':
- if (--depth > 0) goto loop;
- fprintf(f, "\n break;\n");
- return;
-
- case '\'':
- case '"':
- {
- int s_lineno = lineno;
- char *s_line = dup_line();
- char *s_cptr = s_line + (cptr - line - 1);
-
- quote = c;
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == quote)
- {
- FREE(s_line);
- goto loop;
- }
- if (c == '\n')
- unterminated_string(s_lineno, s_line, s_cptr);
- if (c == '\\')
- {
- c = *cptr++;
- putc(c, f);
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_string(s_lineno, s_line, s_cptr);
- }
- }
- }
- }
-
- case '/':
- c = *cptr;
- if (c == '/')
- {
- putc('*', f);
- while ((c = *++cptr) != '\n')
- {
- if (c == '*' && cptr[1] == '/')
- fprintf(f, "* ");
- else
- putc(c, f);
- }
- fprintf(f, "*/\n");
- goto next_line;
- }
- if (c == '*')
- {
- int c_lineno = lineno;
- char *c_line = dup_line();
- char *c_cptr = c_line + (cptr - line - 1);
-
- putc('*', f);
- ++cptr;
- for (;;)
- {
- c = *cptr++;
- putc(c, f);
- if (c == '*' && *cptr == '/')
- {
- putc('/', f);
- ++cptr;
- FREE(c_line);
- goto loop;
- }
- if (c == '\n')
- {
- get_line();
- if (line == 0)
- unterminated_comment(c_lineno, c_line, c_cptr);
- }
- }
- }
- goto loop;
-
- default:
- goto loop;
- }
-}
-
-
-int
-mark_symbol()
-{
- register int c;
- register bucket *bp;
-
- c = cptr[1];
- if (c == '%' || c == '\\')
- {
- cptr += 2;
- return (1);
- }
-
- if (c == '=')
- cptr += 2;
- else if ((c == 'p' || c == 'P') &&
- ((c = cptr[2]) == 'r' || c == 'R') &&
- ((c = cptr[3]) == 'e' || c == 'E') &&
- ((c = cptr[4]) == 'c' || c == 'C') &&
- ((c = cptr[5], !IS_IDENT(c))))
- cptr += 5;
- else
- syntax_error(lineno, line, cptr);
-
- c = nextc();
- if (isalpha(c) || c == '_' || c == '.' || c == '$')
- bp = get_name();
- else if (c == '\'' || c == '"')
- bp = get_literal();
- else
- {
- syntax_error(lineno, line, cptr);
- /*NOTREACHED*/
- }
-
- if (rprec[nrules] != UNDEFINED && bp->prec != rprec[nrules])
- prec_redeclared();
-
- rprec[nrules] = bp->prec;
- rassoc[nrules] = bp->assoc;
- return (0);
-}
-
-
-read_grammar()
-{
- register int c;
-
- initialize_grammar();
- advance_to_start();
-
- for (;;)
- {
- c = nextc();
- if (c == EOF) break;
- if (isalpha(c) || c == '_' || c == '.' || c == '$' || c == '\'' ||
- c == '"')
- add_symbol();
- else if (c == '{' || c == '=')
- copy_action();
- else if (c == '|')
- {
- end_rule();
- start_rule(plhs[nrules-1], 0);
- ++cptr;
- }
- else if (c == '%')
- {
- if (mark_symbol()) break;
- }
- else
- syntax_error(lineno, line, cptr);
- }
- end_rule();
-}
-
-
-free_tags()
-{
- register int i;
-
- if (tag_table == 0) return;
-
- for (i = 0; i < ntags; ++i)
- {
- assert(tag_table[i]);
- FREE(tag_table[i]);
- }
- FREE(tag_table);
-}
-
-
-pack_names()
-{
- register bucket *bp;
- register char *p, *s, *t;
-
- name_pool_size = 13; /* 13 == sizeof("$end") + sizeof("$accept") */
- for (bp = first_symbol; bp; bp = bp->next)
- name_pool_size += strlen(bp->name) + 1;
- name_pool = MALLOC(name_pool_size);
- if (name_pool == 0) no_space();
-
- strcpy(name_pool, "$accept");
- strcpy(name_pool+8, "$end");
- t = name_pool + 13;
- for (bp = first_symbol; bp; bp = bp->next)
- {
- p = t;
- s = bp->name;
- while (*t++ = *s++) continue;
- FREE(bp->name);
- bp->name = p;
- }
-}
-
-
-check_symbols()
-{
- register bucket *bp;
-
- if (goal->class == UNKNOWN)
- undefined_goal(goal->name);
-
- for (bp = first_symbol; bp; bp = bp->next)
- {
- if (bp->class == UNKNOWN)
- {
- undefined_symbol_warning(bp->name);
- bp->class = TERM;
- }
- }
-}
-
-
-pack_symbols()
-{
- register bucket *bp;
- register bucket **v;
- register int i, j, k, n;
-
- nsyms = 2;
- ntokens = 1;
- for (bp = first_symbol; bp; bp = bp->next)
- {
- ++nsyms;
- if (bp->class == TERM) ++ntokens;
- }
- start_symbol = ntokens;
- nvars = nsyms - ntokens;
-
- symbol_name = (char **) MALLOC(nsyms*sizeof(char *));
- if (symbol_name == 0) no_space();
- symbol_value = (short *) MALLOC(nsyms*sizeof(short));
- if (symbol_value == 0) no_space();
- symbol_prec = (short *) MALLOC(nsyms*sizeof(short));
- if (symbol_prec == 0) no_space();
- symbol_assoc = MALLOC(nsyms);
- if (symbol_assoc == 0) no_space();
-
- v = (bucket **) MALLOC(nsyms*sizeof(bucket *));
- if (v == 0) no_space();
-
- v[0] = 0;
- v[start_symbol] = 0;
-
- i = 1;
- j = start_symbol + 1;
- for (bp = first_symbol; bp; bp = bp->next)
- {
- if (bp->class == TERM)
- v[i++] = bp;
- else
- v[j++] = bp;
- }
- assert(i == ntokens && j == nsyms);
-
- for (i = 1; i < ntokens; ++i)
- v[i]->index = i;
-
- goal->index = start_symbol + 1;
- k = start_symbol + 2;
- while (++i < nsyms)
- if (v[i] != goal)
- {
- v[i]->index = k;
- ++k;
- }
-
- goal->value = 0;
- k = 1;
- for (i = start_symbol + 1; i < nsyms; ++i)
- {
- if (v[i] != goal)
- {
- v[i]->value = k;
- ++k;
- }
- }
-
- k = 0;
- for (i = 1; i < ntokens; ++i)
- {
- n = v[i]->value;
- if (n > 256)
- {
- for (j = k++; j > 0 && symbol_value[j-1] > n; --j)
- symbol_value[j] = symbol_value[j-1];
- symbol_value[j] = n;
- }
- }
-
- if (v[1]->value == UNDEFINED)
- v[1]->value = 256;
-
- j = 0;
- n = 257;
- for (i = 2; i < ntokens; ++i)
- {
- if (v[i]->value == UNDEFINED)
- {
- while (j < k && n == symbol_value[j])
- {
- while (++j < k && n == symbol_value[j]) continue;
- ++n;
- }
- v[i]->value = n;
- ++n;
- }
- }
-
- symbol_name[0] = name_pool + 8;
- symbol_value[0] = 0;
- symbol_prec[0] = 0;
- symbol_assoc[0] = TOKEN;
- for (i = 1; i < ntokens; ++i)
- {
- symbol_name[i] = v[i]->name;
- symbol_value[i] = v[i]->value;
- symbol_prec[i] = v[i]->prec;
- symbol_assoc[i] = v[i]->assoc;
- }
- symbol_name[start_symbol] = name_pool;
- symbol_value[start_symbol] = -1;
- symbol_prec[start_symbol] = 0;
- symbol_assoc[start_symbol] = TOKEN;
- for (++i; i < nsyms; ++i)
- {
- k = v[i]->index;
- symbol_name[k] = v[i]->name;
- symbol_value[k] = v[i]->value;
- symbol_prec[k] = v[i]->prec;
- symbol_assoc[k] = v[i]->assoc;
- }
-
- FREE(v);
-}
-
-
-pack_grammar()
-{
- register int i, j;
- int assoc, prec;
-
- ritem = (short *) MALLOC(nitems*sizeof(short));
- if (ritem == 0) no_space();
- rlhs = (short *) MALLOC(nrules*sizeof(short));
- if (rlhs == 0) no_space();
- rrhs = (short *) MALLOC((nrules+1)*sizeof(short));
- if (rrhs == 0) no_space();
- rprec = (short *) REALLOC(rprec, nrules*sizeof(short));
- if (rprec == 0) no_space();
- rassoc = REALLOC(rassoc, nrules);
- if (rassoc == 0) no_space();
-
- ritem[0] = -1;
- ritem[1] = goal->index;
- ritem[2] = 0;
- ritem[3] = -2;
- rlhs[0] = 0;
- rlhs[1] = 0;
- rlhs[2] = start_symbol;
- rrhs[0] = 0;
- rrhs[1] = 0;
- rrhs[2] = 1;
-
- j = 4;
- for (i = 3; i < nrules; ++i)
- {
- rlhs[i] = plhs[i]->index;
- rrhs[i] = j;
- assoc = TOKEN;
- prec = 0;
- while (pitem[j])
- {
- ritem[j] = pitem[j]->index;
- if (pitem[j]->class == TERM)
- {
- prec = pitem[j]->prec;
- assoc = pitem[j]->assoc;
- }
- ++j;
- }
- ritem[j] = -i;
- ++j;
- if (rprec[i] == UNDEFINED)
- {
- rprec[i] = prec;
- rassoc[i] = assoc;
- }
- }
- rrhs[i] = j;
-
- FREE(plhs);
- FREE(pitem);
-}
-
-
-print_grammar()
-{
- register int i, j, k;
- int spacing;
- register FILE *f = verbose_file;
-
- if (!vflag) return;
-
- k = 1;
- for (i = 2; i < nrules; ++i)
- {
- if (rlhs[i] != rlhs[i-1])
- {
- if (i != 2) fprintf(f, "\n");
- fprintf(f, "%4d %s :", i - 2, symbol_name[rlhs[i]]);
- spacing = strlen(symbol_name[rlhs[i]]) + 1;
- }
- else
- {
- fprintf(f, "%4d ", i - 2);
- j = spacing;
- while (--j >= 0) putc(' ', f);
- putc('|', f);
- }
-
- while (ritem[k] >= 0)
- {
- fprintf(f, " %s", symbol_name[ritem[k]]);
- ++k;
- }
- ++k;
- putc('\n', f);
- }
-}
-
-
-reader()
-{
- create_symbol_table();
- read_declarations();
- read_grammar();
- free_symbol_table();
- free_tags();
- pack_names();
- check_symbols();
- pack_symbols();
- pack_grammar();
- free_symbols();
- print_grammar();
-}
diff --git a/mcs/jay/skeleton b/mcs/jay/skeleton
deleted file mode 100644
index 07135c082f2..00000000000
--- a/mcs/jay/skeleton
+++ /dev/null
@@ -1,268 +0,0 @@
-# jay skeleton
-
-# character in column 1 determines outcome...
-# # is a comment
-# . is copied
-# t is copied as //t if -t is set
-# other lines are interpreted to call jay procedures
-
-.// created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de
-.
- prolog ## %{ ... %} prior to the first %%
-
-.// %token constants
-.
- tokens public static final int
-.
-. /** thrown for irrecoverable syntax errors and stack overflow.
-. */
-. public static class yyException extends java.lang.Exception {
-. public yyException (String message) {
-. super(message);
-. }
-. }
-.
-. /** must be implemented by a scanner object to supply input to the parser.
-. */
-. public interface yyInput {
-. /** move on to next token.
-. @return false if positioned beyond tokens.
-. @throws IOException on input error.
-. */
-. boolean advance () throws java.io.IOException;
-. /** classifies current token.
-. Should not be called if advance() returned false.
-. @return current %token or single character.
-. */
-. int token ();
-. /** associated with current token.
-. Should not be called if advance() returned false.
-. @return value for token().
-. */
-. Object value ();
-. }
-.
-. /** simplified error message.
-. @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
-. */
-. public void yyerror (String message) {
-. yyerror(message, null);
-. }
-.
-. /** (syntax) error message.
-. Can be overwritten to control message format.
-. @param message text to be displayed.
-. @param expected vector of acceptable tokens, if available.
-. */
-. public void yyerror (String message, String[] expected) {
-. if (expected != null && expected.length > 0) {
-. System.err.print(message+", expecting");
-. for (int n = 0; n < expected.length; ++ n)
-. System.err.print(" "+expected[n]);
-. System.err.println();
-. } else
-. System.err.println(message);
-. }
-.
-. /** debugging support, requires the package jay.yydebug.
-. Set to null to suppress debugging messages.
-. */
-t protected jay.yydebug.yyDebug yydebug;
-.
- debug ## tables for debugging support
-.
-. /** index-checked interface to yyName[].
-. @param token single character or %token value.
-. @return token name or [illegal] or [unknown].
-. */
-t public static final String yyname (int token) {
-t if (token < 0 || token > yyName.length) return "[illegal]";
-t String name;
-t if ((name = yyName[token]) != null) return name;
-t return "[unknown]";
-t }
-.
-. /** computes list of expected tokens on error by tracing the tables.
-. @param state for which to compute the list.
-. @return list of token names.
-. */
-. protected String[] yyExpecting (int state) {
-. int token, n, len = 0;
-. boolean[] ok = new boolean[yyName.length];
-.
-. if ((n = yySindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. token < yyName.length && n+token < yyTable.length; ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-. if ((n = yyRindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. token < yyName.length && n+token < yyTable.length; ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-.
-. String result[] = new String[len];
-. for (n = token = 0; n < len; ++ token)
-. if (ok[token]) result[n++] = yyName[token];
-. return result;
-. }
-.
-. /** the generated parser, with debugging messages.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @param yydebug debug message writer implementing yyDebug, or null.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyInput yyLex, Object yydebug)
-. throws java.io.IOException, yyException {
-t this.yydebug = (jay.yydebug.yyDebug)yydebug;
-. return yyparse(yyLex);
-. }
-.
-. /** initial size and increment of the state/value stack [default 256].
-. This is not final so that it can be overwritten outside of invocations
-. of yyparse().
-. */
-. protected int yyMax;
-.
-. /** executed at the beginning of a reduce action.
-. Used as $$ = yyDefault($1), prior to the user-specified action, if any.
-. Can be overwritten to provide deep copy, etc.
-. @param first value for $1, or null.
-. @return first.
-. */
-. protected Object yyDefault (Object first) {
-. return first;
-. }
-.
-. /** the generated parser.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyInput yyLex)
-. throws java.io.IOException, yyException {
-. if (yyMax <= 0) yyMax = 256; // initial size
-. int yyState = 0, yyStates[] = new int[yyMax]; // state stack
-. Object yyVal = null, yyVals[] = new Object[yyMax]; // value stack
-. int yyToken = -1; // current input
-. int yyErrorFlag = 0; // #tks to shift
-.
- local ## %{ ... %} after the first %%
-
-. yyLoop: for (int yyTop = 0;; ++ yyTop) {
-. if (yyTop >= yyStates.length) { // dynamically increase
-. int[] i = new int[yyStates.length+yyMax];
-. System.arraycopy(yyStates, 0, i, 0, yyStates.length);
-. yyStates = i;
-. Object[] o = new Object[yyVals.length+yyMax];
-. System.arraycopy(yyVals, 0, o, 0, yyVals.length);
-. yyVals = o;
-. }
-. yyStates[yyTop] = yyState;
-. yyVals[yyTop] = yyVal;
-t if (yydebug != null) yydebug.push(yyState, yyVal);
-.
-. yyDiscarded: for (;;) { // discarding a token does not change stack
-. int yyN;
-. if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (yydebug != null)
-t yydebug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
-. }
-. if ((yyN = yySindex[yyState]) != 0 && (yyN += yyToken) >= 0
-. && yyN < yyTable.length && yyCheck[yyN] == yyToken) {
-t if (yydebug != null)
-t yydebug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
-. yyState = yyTable[yyN]; // shift to yyN
-. yyVal = yyLex.value();
-. yyToken = -1;
-. if (yyErrorFlag > 0) -- yyErrorFlag;
-. continue yyLoop;
-. }
-. if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
-. && yyN < yyTable.length && yyCheck[yyN] == yyToken)
-. yyN = yyTable[yyN]; // reduce (yyN)
-. else
-. switch (yyErrorFlag) {
-.
-. case 0:
-. yyerror("syntax error", yyExpecting(yyState));
-t if (yydebug != null) yydebug.error("syntax error");
-.
-. case 1: case 2:
-. yyErrorFlag = 3;
-. do {
-. if ((yyN = yySindex[yyStates[yyTop]]) != 0
-. && (yyN += yyErrorCode) >= 0 && yyN < yyTable.length
-. && yyCheck[yyN] == yyErrorCode) {
-t if (yydebug != null)
-t yydebug.shift(yyStates[yyTop], yyTable[yyN], 3);
-. yyState = yyTable[yyN];
-. yyVal = yyLex.value();
-. continue yyLoop;
-. }
-t if (yydebug != null) yydebug.pop(yyStates[yyTop]);
-. } while (-- yyTop >= 0);
-t if (yydebug != null) yydebug.reject();
-. throw new yyException("irrecoverable syntax error");
-.
-. case 3:
-. if (yyToken == 0) {
-t if (yydebug != null) yydebug.reject();
-. throw new yyException("irrecoverable syntax error at end-of-file");
-. }
-t if (yydebug != null)
-t yydebug.discard(yyState, yyToken, yyname(yyToken),
-t yyLex.value());
-. yyToken = -1;
-. continue yyDiscarded; // leave stack alone
-. }
-. }
-. int yyV = yyTop + 1-yyLen[yyN];
-t if (yydebug != null)
-t yydebug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]);
-. yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
-. switch (yyN) {
-
- actions ## code from the actions within the grammar
-
-. }
-. yyTop -= yyLen[yyN];
-. yyState = yyStates[yyTop];
-. int yyM = yyLhs[yyN];
-. if (yyState == 0 && yyM == 0) {
-t if (yydebug != null) yydebug.shift(0, yyFinal);
-. yyState = yyFinal;
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (yydebug != null)
-t yydebug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
-. }
-. if (yyToken == 0) {
-t if (yydebug != null) yydebug.accept(yyVal);
-. return yyVal;
-. }
-. continue yyLoop;
-. }
-. if ((yyN = yyGindex[yyM]) != 0 && (yyN += yyState) >= 0
-. && yyN < yyTable.length && yyCheck[yyN] == yyState)
-. yyState = yyTable[yyN];
-. else
-. yyState = yyDgoto[yyM];
-t if (yydebug != null) yydebug.shift(yyStates[yyTop], yyState);
-. continue yyLoop;
-. }
-. }
-. }
-.
- tables ## tables for rules, default reduction, and action calls
-.
- epilog ## text following second %%
diff --git a/mcs/jay/skeleton.cs b/mcs/jay/skeleton.cs
deleted file mode 100644
index a2ed00734f7..00000000000
--- a/mcs/jay/skeleton.cs
+++ /dev/null
@@ -1,352 +0,0 @@
-# jay skeleton
-
-# character in column 1 determines outcome...
-# # is a comment
-# . is copied
-# t is copied as //t if -t is set
-# other lines are interpreted to call jay procedures
-
-.// created by jay 0.7 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de
-.
- prolog ## %{ ... %} prior to the first %%
-
-.
-. /** simplified error message.
-. @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
-. */
-. public void yyerror (string message) {
-. yyerror(message, null);
-. }
-.
-. /** (syntax) error message.
-. Can be overwritten to control message format.
-. @param message text to be displayed.
-. @param expected vector of acceptable tokens, if available.
-. */
-. public void yyerror (string message, string[] expected) {
-. if ((expected != null) && (expected.Length > 0)) {
-. System.Console.Write (message+", expecting");
-. for (int n = 0; n < expected.Length; ++ n)
-. System.Console.Write (" "+expected[n]);
-. System.Console.WriteLine ();
-. } else
-. System.Console.WriteLine (message);
-. }
-.
-. /** debugging support, requires the package jay.yydebug.
-. Set to null to suppress debugging messages.
-. */
-t protected yydebug.yyDebug debug;
-.
- debug ## tables for debugging support
-.
-. /** index-checked interface to yyName[].
-. @param token single character or %token value.
-. @return token name or [illegal] or [unknown].
-. */
-t public static string yyname (int token) {
-t if ((token < 0) || (token > yyName.Length)) return "[illegal]";
-t string name;
-t if ((name = yyName[token]) != null) return name;
-t return "[unknown]";
-t }
-.
-. /** computes list of expected tokens on error by tracing the tables.
-. @param state for which to compute the list.
-. @return list of token names.
-. */
-. protected string[] yyExpecting (int state) {
-. int token, n, len = 0;
-. bool[] ok = new bool[yyName.Length];
-.
-. if ((n = yySindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-. if ((n = yyRindex[state]) != 0)
-. for (token = n < 0 ? -n : 0;
-. (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
-. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
-. ++ len;
-. ok[token] = true;
-. }
-.
-. string [] result = new string[len];
-. for (n = token = 0; n < len; ++ token)
-. if (ok[token]) result[n++] = yyName[token];
-. return result;
-. }
-.
-. /** the generated parser, with debugging messages.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @param yydebug debug message writer implementing yyDebug, or null.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyParser.yyInput yyLex, Object yyd)
-. {
-t this.debug = (yydebug.yyDebug)yyd;
-. return yyparse(yyLex);
-. }
-.
-. /** initial size and increment of the state/value stack [default 256].
-. This is not final so that it can be overwritten outside of invocations
-. of yyparse().
-. */
-. protected int yyMax;
-.
-. /** executed at the beginning of a reduce action.
-. Used as $$ = yyDefault($1), prior to the user-specified action, if any.
-. Can be overwritten to provide deep copy, etc.
-. @param first value for $1, or null.
-. @return first.
-. */
-. protected Object yyDefault (Object first) {
-. return first;
-. }
-.
-. /** the generated parser.
-. Maintains a state and a value stack, currently with fixed maximum size.
-. @param yyLex scanner.
-. @return result of the last reduction, if any.
-. @throws yyException on irrecoverable parse error.
-. */
-. public Object yyparse (yyParser.yyInput yyLex)
-. {
-. if (yyMax <= 0) yyMax = 256; // initial size
-. int yyState = 0; // state stack ptr
-. int [] yyStates = new int[yyMax]; // state stack
-. Object yyVal = null; // value stack ptr
-. Object [] yyVals = new Object[yyMax]; // value stack
-. int yyToken = -1; // current input
-. int yyErrorFlag = 0; // #tks to shift
-.
- local ## %{ ... %} after the first %%
-
-. int yyTop = 0;
-. goto skip;
-. yyLoop:
-. yyTop++;
-. skip:
-. for (;; ++ yyTop) {
-. if (yyTop >= yyStates.Length) { // dynamically increase
-. int[] i = new int[yyStates.Length+yyMax];
-. System.Array.Copy(yyStates, i, 0);
-. yyStates = i;
-. Object[] o = new Object[yyVals.Length+yyMax];
-. System.Array.Copy(yyVals, o, 0);
-. yyVals = o;
-. }
-. yyStates[yyTop] = yyState;
-. yyVals[yyTop] = yyVal;
-t if (debug != null) debug.push(yyState, yyVal);
-.
-. yyDiscarded: for (;;) { // discarding a token does not change stack
-. int yyN;
-. if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (debug != null)
-t debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
-. }
-. if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
-. && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
-t if (debug != null)
-t debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
-. yyState = yyTable[yyN]; // shift to yyN
-. yyVal = yyLex.value();
-. yyToken = -1;
-. if (yyErrorFlag > 0) -- yyErrorFlag;
-. goto yyLoop;
-. }
-. if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
-. && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
-. yyN = yyTable[yyN]; // reduce (yyN)
-. else
-. switch (yyErrorFlag) {
-.
-. case 0:
-. yyerror("syntax error", yyExpecting(yyState));
-t if (debug != null) debug.error("syntax error");
-. goto case 1;
-. case 1: case 2:
-. yyErrorFlag = 3;
-. do {
-. if ((yyN = yySindex[yyStates[yyTop]]) != 0
-. && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
-. && yyCheck[yyN] == Token.yyErrorCode) {
-t if (debug != null)
-t debug.shift(yyStates[yyTop], yyTable[yyN], 3);
-. yyState = yyTable[yyN];
-. yyVal = yyLex.value();
-. goto yyLoop;
-. }
-t if (debug != null) debug.pop(yyStates[yyTop]);
-. } while (-- yyTop >= 0);
-t if (debug != null) debug.reject();
-. throw new yyParser.yyException("irrecoverable syntax error");
-.
-. case 3:
-. if (yyToken == 0) {
-t if (debug != null) debug.reject();
-. throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
-. }
-t if (debug != null)
-t debug.discard(yyState, yyToken, yyname(yyToken),
-t yyLex.value());
-. yyToken = -1;
-. goto yyDiscarded; // leave stack alone
-. }
-. }
-. int yyV = yyTop + 1-yyLen[yyN];
-t if (debug != null)
-t debug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]);
-. yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
-. switch (yyN) {
-
- actions ## code from the actions within the grammar
-
-. }
-. yyTop -= yyLen[yyN];
-. yyState = yyStates[yyTop];
-. int yyM = yyLhs[yyN];
-. if (yyState == 0 && yyM == 0) {
-t if (debug != null) debug.shift(0, yyFinal);
-. yyState = yyFinal;
-. if (yyToken < 0) {
-. yyToken = yyLex.advance() ? yyLex.token() : 0;
-t if (debug != null)
-t debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
-. }
-. if (yyToken == 0) {
-t if (debug != null) debug.accept(yyVal);
-. return yyVal;
-. }
-. goto yyLoop;
-. }
-. if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)
-. && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))
-. yyState = yyTable[yyN];
-. else
-. yyState = yyDgoto[yyM];
-t if (debug != null) debug.shift(yyStates[yyTop], yyState);
-. goto yyLoop;
-. }
-. }
-. }
-.
- tables ## tables for rules, default reduction, and action calls
-.
- epilog ## text following second %%
-.namespace yydebug {
-. using System;
-. public interface yyDebug {
-. void push (int state, Object value);
-. void lex (int state, int token, string name, Object value);
-. void shift (int from, int to, int errorFlag);
-. void pop (int state);
-. void discard (int state, int token, string name, Object value);
-. void reduce (int from, int to, int rule, string text, int len);
-. void shift (int from, int to);
-. void accept (Object value);
-. void error (string message);
-. void reject ();
-. }
-.
-. class yyDebugSimple : yyDebug {
-. void println (string s){
-. Console.WriteLine (s);
-. }
-.
-. public void push (int state, Object value) {
-. println ("push\tstate "+state+"\tvalue "+value);
-. }
-.
-. public void lex (int state, int token, string name, Object value) {
-. println("lex\tstate "+state+"\treading "+name+"\tvalue "+value);
-. }
-.
-. public void shift (int from, int to, int errorFlag) {
-. switch (errorFlag) {
-. default: // normally
-. println("shift\tfrom state "+from+" to "+to);
-. break;
-. case 0: case 1: case 2: // in error recovery
-. println("shift\tfrom state "+from+" to "+to
-. +"\t"+errorFlag+" left to recover");
-. break;
-. case 3: // normally
-. println("shift\tfrom state "+from+" to "+to+"\ton error");
-. break;
-. }
-. }
-.
-. public void pop (int state) {
-. println("pop\tstate "+state+"\ton error");
-. }
-.
-. public void discard (int state, int token, string name, Object value) {
-. println("discard\tstate "+state+"\ttoken "+name+"\tvalue "+value);
-. }
-.
-. public void reduce (int from, int to, int rule, string text, int len) {
-. println("reduce\tstate "+from+"\tuncover "+to
-. +"\trule ("+rule+") "+text);
-. }
-.
-. public void shift (int from, int to) {
-. println("goto\tfrom state "+from+" to "+to);
-. }
-.
-. public void accept (Object value) {
-. println("accept\tvalue "+value);
-. }
-.
-. public void error (string message) {
-. println("error\t"+message);
-. }
-.
-. public void reject () {
-. println("reject");
-. }
-.
-. }
-.}
-.// %token constants
-. class Token {
- tokens public const int
-. }
-. namespace yyParser {
-. using System;
-. /** thrown for irrecoverable syntax errors and stack overflow.
-. */
-. public class yyException : System.Exception {
-. public yyException (string message) : base (message) {
-. }
-. }
-.
-. /** must be implemented by a scanner object to supply input to the parser.
-. */
-. public interface yyInput {
-. /** move on to next token.
-. @return false if positioned beyond tokens.
-. @throws IOException on input error.
-. */
-. bool advance (); // throws java.io.IOException;
-. /** classifies current token.
-. Should not be called if advance() returned false.
-. @return current %token or single character.
-. */
-. int token ();
-. /** associated with current token.
-. Should not be called if advance() returned false.
-. @return value for token().
-. */
-. Object value ();
-. }
-. }
-.} // close outermost namespace, that MUST HAVE BEEN opened in the prolog
diff --git a/mcs/jay/symtab.c b/mcs/jay/symtab.c
deleted file mode 100644
index 0c5f55c535b..00000000000
--- a/mcs/jay/symtab.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)symtab.c 5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
-
-#include "defs.h"
-
-/* TABLE_SIZE is the number of entries in the symbol table. */
-/* TABLE_SIZE must be a power of two. */
-
-#define TABLE_SIZE 1024
-
-
-bucket **symbol_table;
-bucket *first_symbol;
-bucket *last_symbol;
-
-
-int
-hash(name)
-char *name;
-{
- register char *s;
- register int c, k;
-
- assert(name && *name);
- s = name;
- k = *s;
- while (c = *++s)
- k = (31*k + c) & (TABLE_SIZE - 1);
-
- return (k);
-}
-
-
-bucket *
-make_bucket(name)
-char *name;
-{
- register bucket *bp;
-
- assert(name);
- bp = (bucket *) MALLOC(sizeof(bucket));
- if (bp == 0) no_space();
- bp->link = 0;
- bp->next = 0;
- bp->name = MALLOC(strlen(name) + 1);
- if (bp->name == 0) no_space();
- bp->tag = 0;
- bp->value = UNDEFINED;
- bp->index = 0;
- bp->prec = 0;
- bp-> class = UNKNOWN;
- bp->assoc = TOKEN;
-
- if (bp->name == 0) no_space();
- strcpy(bp->name, name);
-
- return (bp);
-}
-
-
-bucket *
-lookup(name)
-char *name;
-{
- register bucket *bp, **bpp;
-
- bpp = symbol_table + hash(name);
- bp = *bpp;
-
- while (bp)
- {
- if (strcmp(name, bp->name) == 0) return (bp);
- bpp = &bp->link;
- bp = *bpp;
- }
-
- *bpp = bp = make_bucket(name);
- last_symbol->next = bp;
- last_symbol = bp;
-
- return (bp);
-}
-
-
-create_symbol_table()
-{
- register int i;
- register bucket *bp;
-
- symbol_table = (bucket **) MALLOC(TABLE_SIZE*sizeof(bucket *));
- if (symbol_table == 0) no_space();
- for (i = 0; i < TABLE_SIZE; i++)
- symbol_table[i] = 0;
-
- bp = make_bucket("error");
- bp->index = 1;
- bp->class = TERM;
-
- first_symbol = bp;
- last_symbol = bp;
- symbol_table[hash("error")] = bp;
-}
-
-
-free_symbol_table()
-{
- FREE(symbol_table);
- symbol_table = 0;
-}
-
-
-free_symbols()
-{
- register bucket *p, *q;
-
- for (p = first_symbol; p; p = q)
- {
- q = p->next;
- FREE(p);
- }
-}
diff --git a/mcs/jay/verbose.c b/mcs/jay/verbose.c
deleted file mode 100644
index 33ae265ee2e..00000000000
--- a/mcs/jay/verbose.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)verbose.c 5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
-
-#include "defs.h"
-
-static short *null_rules;
-
-verbose()
-{
- register int i;
-
- if (!vflag) return;
-
- null_rules = (short *) MALLOC(nrules*sizeof(short));
- if (null_rules == 0) no_space();
- fprintf(verbose_file, "\f\n");
- for (i = 0; i < nstates; i++)
- print_state(i);
- FREE(null_rules);
-
- if (nunused)
- log_unused();
- if (SRtotal || RRtotal)
- log_conflicts();
-
- fprintf(verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
- nvars);
- fprintf(verbose_file, "%d grammar rules, %d states\n", nrules - 2, nstates);
-}
-
-
-log_unused()
-{
- register int i;
- register short *p;
-
- fprintf(verbose_file, "\n\nRules never reduced:\n");
- for (i = 3; i < nrules; ++i)
- {
- if (!rules_used[i])
- {
- fprintf(verbose_file, "\t%s :", symbol_name[rlhs[i]]);
- for (p = ritem + rrhs[i]; *p >= 0; ++p)
- fprintf(verbose_file, " %s", symbol_name[*p]);
- fprintf(verbose_file, " (%d)\n", i - 2);
- }
- }
-}
-
-
-log_conflicts()
-{
- register int i;
-
- fprintf(verbose_file, "\n\n");
- for (i = 0; i < nstates; i++)
- {
- if (SRconflicts[i] || RRconflicts[i])
- {
- fprintf(verbose_file, "State %d contains ", i);
- if (SRconflicts[i] == 1)
- fprintf(verbose_file, "1 shift/reduce conflict");
- else if (SRconflicts[i] > 1)
- fprintf(verbose_file, "%d shift/reduce conflicts",
- SRconflicts[i]);
- if (SRconflicts[i] && RRconflicts[i])
- fprintf(verbose_file, ", ");
- if (RRconflicts[i] == 1)
- fprintf(verbose_file, "1 reduce/reduce conflict");
- else if (RRconflicts[i] > 1)
- fprintf(verbose_file, "%d reduce/reduce conflicts",
- RRconflicts[i]);
- fprintf(verbose_file, ".\n");
- }
- }
-}
-
-
-print_state(state)
-int state;
-{
- if (state)
- fprintf(verbose_file, "\n\n");
- if (SRconflicts[state] || RRconflicts[state])
- print_conflicts(state);
- fprintf(verbose_file, "state %d\n", state);
- print_core(state);
- print_nulls(state);
- print_actions(state);
-}
-
-
-print_conflicts(state)
-int state;
-{
- register int symbol, act, number;
- register action *p;
-
- symbol = -1;
- for (p = parser[state]; p; p = p->next)
- {
- if (p->suppressed == 2)
- continue;
-
- if (p->symbol != symbol)
- {
- symbol = p->symbol;
- number = p->number;
- if (p->action_code == SHIFT)
- act = SHIFT;
- else
- act = REDUCE;
- }
- else if (p->suppressed == 1)
- {
- if (state == final_state && symbol == 0)
- {
- fprintf(verbose_file, "%d: shift/reduce conflict \
-(accept, reduce %d) on $end\n", state, p->number - 2);
- }
- else
- {
- if (act == SHIFT)
- {
- fprintf(verbose_file, "%d: shift/reduce conflict \
-(shift %d, reduce %d) on %s\n", state, number, p->number - 2,
- symbol_name[symbol]);
- }
- else
- {
- fprintf(verbose_file, "%d: reduce/reduce conflict \
-(reduce %d, reduce %d) on %s\n", state, number - 2, p->number - 2,
- symbol_name[symbol]);
- }
- }
- }
- }
-}
-
-
-print_core(state)
-int state;
-{
- register int i;
- register int k;
- register int rule;
- register core *statep;
- register short *sp;
- register short *sp1;
-
- statep = state_table[state];
- k = statep->nitems;
-
- for (i = 0; i < k; i++)
- {
- sp1 = sp = ritem + statep->items[i];
-
- while (*sp >= 0) ++sp;
- rule = -(*sp);
- fprintf(verbose_file, "\t%s : ", symbol_name[rlhs[rule]]);
-
- for (sp = ritem + rrhs[rule]; sp < sp1; sp++)
- fprintf(verbose_file, "%s ", symbol_name[*sp]);
-
- putc('.', verbose_file);
-
- while (*sp >= 0)
- {
- fprintf(verbose_file, " %s", symbol_name[*sp]);
- sp++;
- }
- fprintf(verbose_file, " (%d)\n", -2 - *sp);
- }
-}
-
-
-print_nulls(state)
-int state;
-{
- register action *p;
- register int i, j, k, nnulls;
-
- nnulls = 0;
- for (p = parser[state]; p; p = p->next)
- {
- if (p->action_code == REDUCE &&
- (p->suppressed == 0 || p->suppressed == 1))
- {
- i = p->number;
- if (rrhs[i] + 1 == rrhs[i+1])
- {
- for (j = 0; j < nnulls && i > null_rules[j]; ++j)
- continue;
-
- if (j == nnulls)
- {
- ++nnulls;
- null_rules[j] = i;
- }
- else if (i != null_rules[j])
- {
- ++nnulls;
- for (k = nnulls - 1; k > j; --k)
- null_rules[k] = null_rules[k-1];
- null_rules[j] = i;
- }
- }
- }
- }
-
- for (i = 0; i < nnulls; ++i)
- {
- j = null_rules[i];
- fprintf(verbose_file, "\t%s : . (%d)\n", symbol_name[rlhs[j]],
- j - 2);
- }
- fprintf(verbose_file, "\n");
-}
-
-
-print_actions(stateno)
-int stateno;
-{
- register action *p;
- register shifts *sp;
- register int as;
-
- if (stateno == final_state)
- fprintf(verbose_file, "\t$end accept\n");
-
- p = parser[stateno];
- if (p)
- {
- print_shifts(p);
- print_reductions(p, defred[stateno]);
- }
-
- sp = shift_table[stateno];
- if (sp && sp->nshifts > 0)
- {
- as = accessing_symbol[sp->shift[sp->nshifts - 1]];
- if (ISVAR(as))
- print_gotos(stateno);
- }
-}
-
-
-print_shifts(p)
-register action *p;
-{
- register int count;
- register action *q;
-
- count = 0;
- for (q = p; q; q = q->next)
- {
- if (q->suppressed < 2 && q->action_code == SHIFT)
- ++count;
- }
-
- if (count > 0)
- {
- for (; p; p = p->next)
- {
- if (p->action_code == SHIFT && p->suppressed == 0)
- fprintf(verbose_file, "\t%s shift %d\n",
- symbol_name[p->symbol], p->number);
- }
- }
-}
-
-
-print_reductions(p, defred)
-register action *p;
-register int defred;
-{
- register int k, anyreds;
- register action *q;
-
- anyreds = 0;
- for (q = p; q ; q = q->next)
- {
- if (q->action_code == REDUCE && q->suppressed < 2)
- {
- anyreds = 1;
- break;
- }
- }
-
- if (anyreds == 0)
- fprintf(verbose_file, "\t. error\n");
- else
- {
- for (; p; p = p->next)
- {
- if (p->action_code == REDUCE && p->number != defred)
- {
- k = p->number - 2;
- if (p->suppressed == 0)
- fprintf(verbose_file, "\t%s reduce %d\n",
- symbol_name[p->symbol], k);
- }
- }
-
- if (defred > 0)
- fprintf(verbose_file, "\t. reduce %d\n", defred - 2);
- }
-}
-
-
-print_gotos(stateno)
-int stateno;
-{
- register int i, k;
- register int as;
- register short *to_state;
- register shifts *sp;
-
- putc('\n', verbose_file);
- sp = shift_table[stateno];
- to_state = sp->shift;
- for (i = 0; i < sp->nshifts; ++i)
- {
- k = to_state[i];
- as = accessing_symbol[k];
- if (ISVAR(as))
- fprintf(verbose_file, "\t%s goto %d\n", symbol_name[as], k);
- }
-}
diff --git a/mcs/jay/warshall.c b/mcs/jay/warshall.c
deleted file mode 100644
index 4672244e368..00000000000
--- a/mcs/jay/warshall.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Robert Paul Corbett.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS 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.
- */
-
-#ifndef lint
-static char sccsid[] = "@(#)warshall.c 5.4 (Berkeley) 5/24/93";
-#endif /* not lint */
-
-#include "defs.h"
-
-transitive_closure(R, n)
-unsigned *R;
-int n;
-{
- register int rowsize;
- register unsigned i;
- register unsigned *rowj;
- register unsigned *rp;
- register unsigned *rend;
- register unsigned *ccol;
- register unsigned *relend;
- register unsigned *cword;
- register unsigned *rowi;
-
- rowsize = WORDSIZE(n);
- relend = R + n*rowsize;
-
- cword = R;
- i = 0;
- rowi = R;
- while (rowi < relend)
- {
- ccol = cword;
- rowj = R;
-
- while (rowj < relend)
- {
- if (*ccol & (1 << i))
- {
- rp = rowi;
- rend = rowj + rowsize;
- while (rowj < rend)
- *rowj++ |= *rp++;
- }
- else
- {
- rowj += rowsize;
- }
-
- ccol += rowsize;
- }
-
- if (++i >= BITS_PER_WORD)
- {
- i = 0;
- cword++;
- }
-
- rowi += rowsize;
- }
-}
-
-reflexive_transitive_closure(R, n)
-unsigned *R;
-int n;
-{
- register int rowsize;
- register unsigned i;
- register unsigned *rp;
- register unsigned *relend;
-
- transitive_closure(R, n);
-
- rowsize = WORDSIZE(n);
- relend = R + n*rowsize;
-
- i = 0;
- rp = R;
- while (rp < relend)
- {
- *rp |= (1 << i);
- if (++i >= BITS_PER_WORD)
- {
- i = 0;
- rp++;
- }
-
- rp += rowsize;
- }
-}
diff --git a/mcs/makefile b/mcs/makefile
deleted file mode 100755
index 981259a664c..00000000000
--- a/mcs/makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-DIRS=jay nant mcs class nunit tools
-
-all: linux
-
-windows:
- for i in $(DIRS); do \
- (cd $$i; make linux) \
- done
-
-linux:
- for i in $(DIRS); do \
- (cd $$i; make linux) || exit 1; \
- done
-
-test:
- (cd nunit; make)
- (cd class; make test)
-
-clean:
- for i in $(DIRS); do \
- (cd $$i; make clean) \
- done
-
diff --git a/mcs/mbas/.cvsignore b/mcs/mbas/.cvsignore
deleted file mode 100644
index 23c8dc48e2f..00000000000
--- a/mcs/mbas/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-mbas.pdb
-mbas.exe
-mb-parser.cs
-y.output
-*.pdb
-mbas.csproj.user
-mbas.suo
-D/bin
-D/obj
-D/bin/*
-D/obj/*
diff --git a/mcs/mbas/AssemblyInfo.cs b/mcs/mbas/AssemblyInfo.cs
deleted file mode 100644
index be476f85c0d..00000000000
--- a/mcs/mbas/AssemblyInfo.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly: AssemblyTitle("MonoBASIC Compiler")]
-[assembly: AssemblyDescription("This is a compiler for the MonoBASIC language, \nwhich is a superset of Visual Basic.NET")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("(c)2002 Rafael Teixeira")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: Mono.GetOptions.Author("Ravi Pratap")]
-[assembly: Mono.GetOptions.Author("Miguel de Icaza")]
-[assembly: Mono.GetOptions.Author("Rafael Teixeira")]
-
-[assembly: Mono.GetOptions.LicensingWith(Mono.GetOptions.Licenses.GPL)]
-[assembly: Mono.GetOptions.ForMoreInformation("http://www.go-mono.com")]
-[assembly: Mono.GetOptions.UsageClause("mbas [options] source-files")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
diff --git a/mcs/mbas/ChangeLog b/mcs/mbas/ChangeLog
deleted file mode 100644
index 6b78ce3ca55..00000000000
--- a/mcs/mbas/ChangeLog
+++ /dev/null
@@ -1,75 +0,0 @@
-2002-06-23 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged attribute.cs, class.cs, ecore.cs, rootcontext.cs, support.cs and typemanager.cs from mcs/mcs, to resync
- * makefile makes csc reference a copy of Mono.GetOptions.dll (mbas.sln now compiles to mbas dir instead of mbas/bin/Debug)
-
-2002-06-21 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged attribute.cs, class.cs, interface.cs, expression.cs, ecore.cs,
- modifiers.cs, rootcontext.cs, statement.cs and typemanager.cs from mcs/mcs, to resync
- * added pending.cs from mcs/mcs, to resync
-
-2002-06-15 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged assign.cs, attribute.cs, enum.cs and namespace.cs from mcs/mcs, to resync
- * namespace.cs needed some fixing, because CSharpParser isn´t available
-
-2002-06-15 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged delegate.cs, ecore.cs, typemanager.cs and rootcontext.cs from mcs/mcs, to resolve expression.cs blues
-
-2002-06-15 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * oops merged expression.cs from mcs/mcs is breaking my make
- * driver.cs, assemblyinfo.cs wasn´t ready for prime time (offending lines were commented out)
-
-2002-06-15 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged expression.cs from mcs/mcs
-
-2002-06-12 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * corrected Module.TypeAttr property getter in module.cs
-
-2002-06-12 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged typemanager.cs from mcs/mcs
-
-2002-06-10 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged expression.cs and interface.cs from mcs/mcs
-
-2002-06-09 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged const.cs, enum.cs, expression.cs and typemanager.cs from mcs/mcs
- * comments on module.cs
-
-2002-06-07 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged class.cs, attribute.cs from mcs/mcs
-
-2002-06-07 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged class.cs, enum.cs, expression.cs, interface.cs, rootcontext.cs and typemanager.cs from mcs/mcs
- * added module.cs (class Mono.MonoBASIC.Module - derived from Mono.CSharp.Class)
- * added System.XML and Microsoft.VisualBasic to the default config (driver.cs)
-
-2002-06-07 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged class.cs and ecore.cs from mcs/mcs
-
-2002-06-02 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * copied methods MakeName and CheckDef from mcs\cs-parser.jay to GenericParser.cs
- where they are inherited by mb-parser.jay/cs
- * put some code on the Module rule in mb-parser.jay to at least generate a class in the assembly,
- if I jump over the entry-point check code, while debugging
-
-2002-05-31 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * class Mono.MonoBASIC.Tokenizer now handles
- - all valid line-terminators (CR, LF, CRLF, LS and PS)
- - escaped identifiers (like [Integer])
- - old-fashioned comments syntax (REM Blah-Blah)
-
-2002-05-31 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * modified mbas.ico to be a small version of mono´s logo (see mcs\MonoIcon.png)
-
-2002-05-31 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * squashed some reduce/reduce conflicts out of mb-parser.jay
-
-2002-05-31 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
- * merged codegen.cs from mcs
- * altered Driver.cs to work with new codegen.cs
-
-2002-05-27 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
-
- * merged all I could from mcs source files into mbas
- * added VS.NET Solution and Project Files for mbas
- * added icon file and a vb-sources-filled testmbas directory
- * started this ChangeLog
diff --git a/mcs/mbas/assign.cs b/mcs/mbas/assign.cs
deleted file mode 100644
index aff163825fa..00000000000
--- a/mcs/mbas/assign.cs
+++ /dev/null
@@ -1,370 +0,0 @@
-//
-// assign.cs: Assignments.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001, 2002 Ximian, Inc.
-//
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// This interface is implemented by expressions that can be assigned to.
- /// </summary>
- /// <remarks>
- /// This interface is implemented by Expressions whose values can not
- /// store the result on the top of the stack.
- ///
- /// Expressions implementing this (Properties, Indexers and Arrays) would
- /// perform an assignment of the Expression "source" into its final
- /// location.
- ///
- /// No values on the top of the stack are expected to be left by
- /// invoking this method.
- /// </remarks>
- public interface IAssignMethod {
- //
- // This method will emit the code for the actual assignment
- //
- void EmitAssign (EmitContext ec, Expression source);
-
- //
- // This method is invoked before any code generation takes
- // place, and it is a mechanism to inform that the expression
- // will be invoked more than once, and that the method should
- // use temporary values to avoid having side effects
- //
- // Example: a [ g () ] ++
- //
- void CacheTemporaries (EmitContext ec);
- }
-
- /// <summary>
- /// An Expression to hold a temporary value.
- /// </summary>
- /// <remarks>
- /// The LocalTemporary class is used to hold temporary values of a given
- /// type to "simulate" the expression semantics on property and indexer
- /// access whose return values are void.
- ///
- /// The local temporary is used to alter the normal flow of code generation
- /// basically it creates a local variable, and its emit instruction generates
- /// code to access this value, return its address or save its value.
- /// </remarks>
- public class LocalTemporary : Expression, IMemoryLocation {
- LocalBuilder builder;
-
- public LocalTemporary (EmitContext ec, Type t)
- {
- type = t;
- eclass = ExprClass.Value;
- builder = ec.GetTemporaryStorage (t);
- }
-
- public void Release (EmitContext ec)
- {
- ec.FreeTemporaryStorage (builder);
- builder = null;
- }
-
- public LocalTemporary (LocalBuilder b, Type t)
- {
- type = t;
- eclass = ExprClass.Value;
- builder = b;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldloc, builder);
- }
-
- public void Store (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Stloc, builder);
- }
-
- public void AddressOf (EmitContext ec, AddressOp mode)
- {
- ec.ig.Emit (OpCodes.Ldloca, builder);
- }
- }
-
- /// <summary>
- /// The Assign node takes care of assigning the value of source into
- /// the expression represented by target.
- /// </summary>
- public class Assign : ExpressionStatement {
- protected Expression target, source;
- public Location l;
-
- public Assign (Expression target, Expression source, Location l)
- {
- this.target = target;
- this.source = source;
- this.l = l;
- }
-
- public Expression Target {
- get {
- return target;
- }
-
- set {
- target = value;
- }
- }
-
- public Expression Source {
- get {
- return source;
- }
-
- set {
- source = value;
- }
- }
-
- public static void error70 (EventInfo ei, Location l)
- {
- Report.Error (70, l, "The event '" + ei.Name +
- "' can only appear on the left-side of a += or -= (except when" +
- " used from within the type '" + ei.DeclaringType + "')");
- }
-
- //
- // Will return either `this' or an instance of `New'.
- //
- public override Expression DoResolve (EmitContext ec)
- {
- source = source.Resolve (ec);
- if (source == null)
- return null;
-
- target = target.ResolveLValue (ec, source);
-
- if (target == null)
- return null;
-
- Type target_type = target.Type;
- Type source_type = source.Type;
-
- type = target_type;
- eclass = ExprClass.Value;
-
- //
- // If we are doing a property assignment, then
- // set the `value' field on the property, and Resolve
- // it.
- //
- if (target is PropertyExpr){
- PropertyExpr property_assign = (PropertyExpr) target;
-
- if (source_type != target_type){
- source = ConvertImplicitRequired (ec, source, target_type, l);
- if (source == null)
- return null;
- }
-
- //
- // FIXME: Maybe handle this in the LValueResolve
- //
- if (!property_assign.VerifyAssignable ())
- return null;
-
- return this;
- }
-
- if (target is IndexerAccess)
- return this;
-
- if (target is EventExpr) {
-
- Binary tmp;
- EventInfo ei = ((EventExpr) target).EventInfo;
-
-
- Expression ml = MemberLookup (
- ec, ec.ContainerType, ei.Name,
- MemberTypes.Event, AllBindingFlags, l);
-
- if (ml == null) {
- //
- // If this is the case, then the Event does not belong
- // to this TypeContainer and so, according to the spec
- // is allowed to only appear on the left hand of
- // the += and -= operators
- //
- // Note that if target will not appear as an EventExpr
- // in the case it is being referenced within the same type container;
- // it will appear as a FieldExpr in that case.
- //
-
- if (!(source is Binary)) {
- error70 (ei, l);
- return null;
- } else {
- tmp = ((Binary) source);
- if (tmp.Oper != Binary.Operator.Addition &&
- tmp.Oper != Binary.Operator.Subtraction) {
- error70 (ei, l);
- return null;
- }
- }
- }
- }
-
- if (source is New && target_type.IsSubclassOf (TypeManager.value_type)){
- New n = (New) source;
-
- n.ValueTypeVariable = target;
- return n;
- }
-
- if (target.eclass != ExprClass.Variable && target.eclass != ExprClass.EventAccess){
- Report.Error (131, l,
- "Left hand of an assignment must be a variable, " +
- "a property or an indexer");
- return null;
- }
-
- if (target_type == source_type)
- return this;
-
- //
- // If this assignemnt/operator was part of a compound binary
- // operator, then we allow an explicit conversion, as detailed
- // in the spec.
- //
-
- if (this is CompoundAssign){
- CompoundAssign a = (CompoundAssign) this;
-
- Binary b = source as Binary;
- if (b != null && b.IsBuiltinOperator){
- //
- // 1. if the source is explicitly convertible to the
- // target_type
- //
-
- source = ConvertExplicit (ec, source, target_type, l);
- if (source == null){
- Error_CannotConvertImplicit (l, source_type, target_type);
- return null;
- }
-
- //
- // 2. and the original right side is implicitly convertible to
- // the type of target_type.
- //
- if (StandardConversionExists (a.original_source, target_type))
- return this;
-
- Error_CannotConvertImplicit (l, a.original_source.Type, target_type);
- return null;
- }
- }
-
- source = ConvertImplicitRequired (ec, source, target_type, l);
- if (source == null)
- return null;
-
- return this;
- }
-
- void Emit (EmitContext ec, bool is_statement)
- {
- if (target is EventExpr) {
- ((EventExpr) target).EmitAddOrRemove (ec, source);
- return;
- }
-
- //
- // FIXME! We need a way to "probe" if the process can
- // just use `dup' to propagate the result
- //
- IAssignMethod am = (IAssignMethod) target;
-
- if (this is CompoundAssign){
- am.CacheTemporaries (ec);
- }
-
- if (is_statement)
- am.EmitAssign (ec, source);
- else {
- LocalTemporary tempo;
-
- tempo = new LocalTemporary (ec, source.Type);
-
- source.Emit (ec);
- tempo.Store (ec);
- am.EmitAssign (ec, tempo);
- tempo.Emit (ec);
- tempo.Release (ec);
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- Emit (ec, false);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec, true);
- }
- }
-
-
- //
- // This class is used for compound assignments.
- //
- class CompoundAssign : Assign {
- Binary.Operator op;
- public Expression original_source;
-
- public CompoundAssign (Binary.Operator op, Expression target, Expression source, Location l)
- : base (target, source, l)
- {
- original_source = source;
- this.op = op;
- }
-
- public Expression ResolveSource (EmitContext ec)
- {
- return original_source.Resolve (ec);
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- target = target.ResolveLValue (ec, source);
- if (target == null)
- return null;
-
- original_source = original_source.Resolve (ec);
- if (original_source == null)
- return null;
-
- //
- // Only now we can decouple the original source/target
- // into a tree, to guarantee that we do not have side
- // effects.
- //
- source = new Binary (op, target, original_source, l);
- return base.DoResolve (ec);
- }
- }
-}
-
-
-
-
diff --git a/mcs/mbas/attribute.cs b/mcs/mbas/attribute.cs
deleted file mode 100644
index 0cde743b88e..00000000000
--- a/mcs/mbas/attribute.cs
+++ /dev/null
@@ -1,794 +0,0 @@
-//
-// attribute.cs: Attribute Handler
-//
-// Author: Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-using System.Text;
-
-namespace Mono.CSharp {
-
- public class Attribute {
- public readonly string Name;
- public readonly ArrayList Arguments;
-
- Location Location;
-
- public Type Type;
-
- //
- // The following are only meaningful when the attribute
- // being emitted is one of the builtin ones
- //
- AttributeTargets Targets;
- bool AllowMultiple;
- bool Inherited;
-
- bool UsageAttr = false;
-
- MethodImplOptions ImplOptions;
- UnmanagedType UnmanagedType;
- CustomAttributeBuilder cb;
-
- public Attribute (string name, ArrayList args, Location loc)
- {
- Name = name;
- Arguments = args;
- Location = loc;
- }
-
- void Error_InvalidNamedArgument (string name)
- {
- Report.Error (617, Location, "'" + name + "' is not a valid named attribute " +
- "argument. Named attribute arguments must be fields which are not " +
- "readonly, static or const, or properties with a set accessor which "+
- "are not static.");
- }
-
- void Error_AttributeArgumentNotValid ()
- {
- Report.Error (182, Location,
- "An attribute argument must be a constant expression, typeof " +
- "expression or array creation expression");
- }
-
- static void Error_AttributeConstructorMismatch (Location loc)
- {
- Report.Error (
- -6, loc,
- "Could not find a constructor for this argument list.");
- }
-
- private Type CheckAttributeType (EmitContext ec) {
- Type t;
- bool isattributeclass = true;
-
- t = RootContext.LookupType (ec.DeclSpace, Name, true, Location);
- if (t != null) {
- isattributeclass = t.IsSubclassOf (TypeManager.attribute_type);
- if (isattributeclass)
- return t;
- }
- t = RootContext.LookupType (ec.DeclSpace, Name + "Attribute", true, Location);
- if (t != null) {
- if (t.IsSubclassOf (TypeManager.attribute_type))
- return t;
- }
- if (!isattributeclass) {
- Report.Error (616, Location, "'" + Name + "': is not an attribute class");
- return null;
- }
- if (t != null) {
- Report.Error (616, Location, "'" + Name + "Attribute': is not an attribute class");
- return null;
- }
- Report.Error (
- 246, Location, "Could not find attribute '" + Name + "' (are you" +
- " missing a using directive or an assembly reference ?)");
- return null;
- }
-
- public Type ResolveType (EmitContext ec)
- {
- Type = CheckAttributeType (ec);
- return Type;
- }
-
-
- public CustomAttributeBuilder Resolve (EmitContext ec)
- {
- if (Type == null)
- Type = CheckAttributeType (ec);
- if (Type == null)
- return null;
-
- bool MethodImplAttr = false;
- bool MarshalAsAttr = false;
-
- UsageAttr = false;
-
- if (Type == TypeManager.attribute_usage_type)
- UsageAttr = true;
- if (Type == TypeManager.methodimpl_attr_type)
- MethodImplAttr = true;
- if (Type == TypeManager.marshal_as_attr_type)
- MarshalAsAttr = true;
-
- // Now we extract the positional and named arguments
-
- ArrayList pos_args = new ArrayList ();
- ArrayList named_args = new ArrayList ();
- int pos_arg_count = 0;
-
- if (Arguments != null) {
- pos_args = (ArrayList) Arguments [0];
- if (pos_args != null)
- pos_arg_count = pos_args.Count;
- if (Arguments.Count > 1)
- named_args = (ArrayList) Arguments [1];
- }
-
- object [] pos_values = new object [pos_arg_count];
-
- //
- // First process positional arguments
- //
-
- int i;
- for (i = 0; i < pos_arg_count; i++) {
- Argument a = (Argument) pos_args [i];
- Expression e;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- e = a.Expr;
- if (e is Constant) {
- pos_values [i] = ((Constant) e).GetValue ();
- } else if (e is TypeOf) {
- pos_values [i] = ((TypeOf) e).TypeArg;
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- if (UsageAttr)
- this.Targets = (AttributeTargets) pos_values [0];
-
- if (MethodImplAttr)
- this.ImplOptions = (MethodImplOptions) pos_values [0];
-
- if (MarshalAsAttr)
- this.UnmanagedType =
- (System.Runtime.InteropServices.UnmanagedType) pos_values [0];
- }
-
- //
- // Now process named arguments
- //
-
- ArrayList field_infos = new ArrayList ();
- ArrayList prop_infos = new ArrayList ();
- ArrayList field_values = new ArrayList ();
- ArrayList prop_values = new ArrayList ();
-
- for (i = 0; i < named_args.Count; i++) {
- DictionaryEntry de = (DictionaryEntry) named_args [i];
- string member_name = (string) de.Key;
- Argument a = (Argument) de.Value;
- Expression e;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression member = Expression.MemberLookup (
- ec, Type, member_name,
- MemberTypes.Field | MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- Location);
-
- if (member == null || !(member is PropertyExpr || member is FieldExpr)) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- e = a.Expr;
- if (member is PropertyExpr) {
- PropertyExpr pe = (PropertyExpr) member;
- PropertyInfo pi = pe.PropertyInfo;
-
- if (!pi.CanWrite) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- if (e is Constant) {
- object o = ((Constant) e).GetValue ();
- prop_values.Add (o);
-
- if (UsageAttr) {
- if (member_name == "AllowMultiple")
- this.AllowMultiple = (bool) o;
- if (member_name == "Inherited")
- this.Inherited = (bool) o;
- }
-
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- prop_infos.Add (pi);
-
- } else if (member is FieldExpr) {
- FieldExpr fe = (FieldExpr) member;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.IsInitOnly) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- //
- // Handle charset here, and set the TypeAttributes
-
- if (e is Constant){
- object value = ((Constant) e).GetValue ();
-
- field_values.Add (value);
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- field_infos.Add (fi);
- }
- }
-
- Expression mg = Expression.MemberLookup (
- ec, Type, ".ctor", MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance, Location);
-
- if (mg == null) {
- Error_AttributeConstructorMismatch (Location);
- return null;
- }
-
- MethodBase constructor = Invocation.OverloadResolve (
- ec, (MethodGroupExpr) mg, pos_args, Location);
-
- if (constructor == null) {
- Error_AttributeConstructorMismatch (Location);
- return null;
- }
-
- PropertyInfo [] prop_info_arr = new PropertyInfo [prop_infos.Count];
- FieldInfo [] field_info_arr = new FieldInfo [field_infos.Count];
- object [] field_values_arr = new object [field_values.Count];
- object [] prop_values_arr = new object [prop_values.Count];
-
- field_infos.CopyTo (field_info_arr, 0);
- field_values.CopyTo (field_values_arr, 0);
-
- prop_values.CopyTo (prop_values_arr, 0);
- prop_infos.CopyTo (prop_info_arr, 0);
-
- try {
- cb = new CustomAttributeBuilder (
- (ConstructorInfo) constructor, pos_values,
- prop_info_arr, prop_values_arr,
- field_info_arr, field_values_arr);
- } catch {
- //
- // Sample:
- // using System.ComponentModel;
- // [DefaultValue (CollectionChangeAction.Add)]
- // class X { static void Main () {} }
- //
- Report.Warning (
- -23, Location,
- "The compiler can not encode this attribute in .NET due to\n" +
- "\ta bug in the .NET runtime. Try the Mono runtime");
- }
-
- return cb;
- }
-
- static string GetValidPlaces (Attribute attr)
- {
- StringBuilder sb = new StringBuilder ();
- AttributeTargets targets = 0;
-
- TypeContainer a = TypeManager.LookupAttr (attr.Type);
-
- if (a == null) {
-
- System.Attribute [] attrs = null;
-
- try {
- attrs = System.Attribute.GetCustomAttributes (attr.Type);
-
- } catch {
- Report.Error (-20, attr.Location, "Cannot find attribute type " + attr.Name +
- " (maybe you forgot to set the usage using the" +
- " AttributeUsage attribute ?).");
- return null;
- }
-
- foreach (System.Attribute tmp in attrs)
- if (tmp is AttributeUsageAttribute)
- targets = ((AttributeUsageAttribute) tmp).ValidOn;
- } else
- targets = a.Targets;
-
-
- if ((targets & AttributeTargets.Assembly) != 0)
- sb.Append ("'assembly' ");
-
- if ((targets & AttributeTargets.Class) != 0)
- sb.Append ("'class' ");
-
- if ((targets & AttributeTargets.Constructor) != 0)
- sb.Append ("'constructor' ");
-
- if ((targets & AttributeTargets.Delegate) != 0)
- sb.Append ("'delegate' ");
-
- if ((targets & AttributeTargets.Enum) != 0)
- sb.Append ("'enum' ");
-
- if ((targets & AttributeTargets.Event) != 0)
- sb.Append ("'event' ");
-
- if ((targets & AttributeTargets.Field) != 0)
- sb.Append ("'field' ");
-
- if ((targets & AttributeTargets.Interface) != 0)
- sb.Append ("'interface' ");
-
- if ((targets & AttributeTargets.Method) != 0)
- sb.Append ("'method' ");
-
- if ((targets & AttributeTargets.Module) != 0)
- sb.Append ("'module' ");
-
- if ((targets & AttributeTargets.Parameter) != 0)
- sb.Append ("'parameter' ");
-
- if ((targets & AttributeTargets.Property) != 0)
- sb.Append ("'property' ");
-
- if ((targets & AttributeTargets.ReturnValue) != 0)
- sb.Append ("'return value' ");
-
- if ((targets & AttributeTargets.Struct) != 0)
- sb.Append ("'struct' ");
-
- return sb.ToString ();
-
- }
-
- public static void Error_AttributeNotValidForElement (Attribute a, Location loc)
- {
- Report.Error (
- 592, loc, "Attribute '" + a.Name +
- "' is not valid on this declaration type. " +
- "It is valid on " + GetValidPlaces (a) + "declarations only.");
- }
-
- public static bool CheckAttribute (Attribute a, object element)
- {
- TypeContainer attr = TypeManager.LookupAttr (a.Type);
- AttributeTargets targets = 0;
-
-
- if (attr == null) {
-
- System.Attribute [] attrs = null;
-
- try {
- attrs = System.Attribute.GetCustomAttributes (a.Type);
-
- } catch {
- Report.Error (-20, a.Location, "Cannot find attribute type " + a.Name +
- " (maybe you forgot to set the usage using the" +
- " AttributeUsage attribute ?).");
- return false;
- }
-
- foreach (System.Attribute tmp in attrs)
- if (tmp is AttributeUsageAttribute)
- targets = ((AttributeUsageAttribute) tmp).ValidOn;
- } else
- targets = attr.Targets;
-
- if (element is Class) {
- if ((targets & AttributeTargets.Class) != 0)
- return true;
- else
- return false;
-
- } else if (element is Struct) {
- if ((targets & AttributeTargets.Struct) != 0)
- return true;
- else
- return false;
- } else if (element is Constructor) {
- if ((targets & AttributeTargets.Constructor) != 0)
- return true;
- else
- return false;
- } else if (element is Delegate) {
- if ((targets & AttributeTargets.Delegate) != 0)
- return true;
- else
- return false;
- } else if (element is Enum) {
- if ((targets & AttributeTargets.Enum) != 0)
- return true;
- else
- return false;
- } else if (element is Event || element is InterfaceEvent) {
- if ((targets & AttributeTargets.Event) != 0)
- return true;
- else
- return false;
- } else if (element is Field || element is FieldBuilder) {
- if ((targets & AttributeTargets.Field) != 0)
- return true;
- else
- return false;
- } else if (element is Interface) {
- if ((targets & AttributeTargets.Interface) != 0)
- return true;
- else
- return false;
- } else if (element is Method || element is Operator || element is InterfaceMethod || element is Accessor) {
- if ((targets & AttributeTargets.Method) != 0)
- return true;
- else
- return false;
- } else if (element is ParameterBuilder) {
- if ((targets & AttributeTargets.Parameter) != 0)
- return true;
- else
- return false;
- } else if (element is Property || element is Indexer ||
- element is InterfaceProperty || element is InterfaceIndexer) {
- if ((targets & AttributeTargets.Property) != 0)
- return true;
- else
- return false;
- } else if (element is AssemblyBuilder){
- if ((targets & AttributeTargets.Assembly) != 0)
- return true;
- else
- return false;
- }
-
- return false;
- }
-
- //
- // This method should be invoked to pull the IndexerName attribute from an
- // Indexer if it exists.
- //
- public static string ScanForIndexerName (EmitContext ec, Attributes opt_attrs)
- {
- if (opt_attrs == null)
- return null;
- if (opt_attrs.AttributeSections == null)
- return null;
-
- foreach (AttributeSection asec in opt_attrs.AttributeSections) {
- if (asec.Attributes == null)
- continue;
-
- foreach (Attribute a in asec.Attributes){
- if (a.ResolveType (ec) == null)
- return null;
-
- if (a.Type != TypeManager.indexer_name_type)
- continue;
-
- //
- // So we have found an IndexerName, pull the data out.
- //
- if (a.Arguments == null || a.Arguments [0] == null){
- Error_AttributeConstructorMismatch (a.Location);
- return null;
- }
- ArrayList pos_args = (ArrayList) a.Arguments [0];
- if (pos_args.Count == 0){
- Error_AttributeConstructorMismatch (a.Location);
- return null;
- }
-
- Argument arg = (Argument) pos_args [0];
- if (!arg.Resolve (ec, a.Location))
- return null;
-
- Expression e = arg.Expr;
- if (!(e is StringConstant)){
- Error_AttributeConstructorMismatch (a.Location);
- return null;
- }
-
- //
- // Remove the attribute from the list
- //
- asec.Attributes.Remove (a);
-
- return (((StringConstant) e).Value);
- }
- }
- return null;
- }
-
- //
- // Applies the attributes to the `builder'.
- //
- public static void ApplyAttributes (EmitContext ec, object builder, object kind,
- Attributes opt_attrs, Location loc)
- {
- if (opt_attrs == null)
- return;
- if (opt_attrs.AttributeSections == null)
- return;
-
- foreach (AttributeSection asec in opt_attrs.AttributeSections) {
- if (asec.Attributes == null)
- continue;
-
- if (asec.Target == "assembly" && !(builder is AssemblyBuilder))
- continue;
-
- foreach (Attribute a in asec.Attributes) {
- CustomAttributeBuilder cb = a.Resolve (ec);
-
- if (cb == null)
- continue;
-
- if (!(kind is TypeContainer))
- if (!CheckAttribute (a, kind)) {
- Error_AttributeNotValidForElement (a, loc);
- return;
- }
-
- if (kind is Method || kind is Operator || kind is InterfaceMethod) {
- if (a.Type == TypeManager.methodimpl_attr_type) {
- if (a.ImplOptions == MethodImplOptions.InternalCall)
- ((MethodBuilder) builder).
- SetImplementationFlags (
- MethodImplAttributes.InternalCall |
- MethodImplAttributes.Runtime);
- } else if (a.Type != TypeManager.dllimport_type){
- ((MethodBuilder) builder).SetCustomAttribute (cb);
- }
- } else if (kind is Constructor) {
- ((ConstructorBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Field) {
- ((FieldBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Property || kind is Indexer ||
- kind is InterfaceProperty || kind is InterfaceIndexer) {
- ((PropertyBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Event || kind is InterfaceEvent) {
- ((MyEventBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is ParameterBuilder) {
-
- if (a.Type == TypeManager.marshal_as_attr_type) {
- UnmanagedMarshal marshal =
- UnmanagedMarshal.DefineUnmanagedMarshal (a.UnmanagedType);
-
- ((ParameterBuilder) builder).SetMarshal (marshal);
- } else
- ((ParameterBuilder) builder).SetCustomAttribute (cb);
-
- } else if (kind is Enum) {
- ((TypeBuilder) builder).SetCustomAttribute (cb);
-
- } else if (kind is TypeContainer) {
- TypeContainer tc = (TypeContainer) kind;
-
- if (a.UsageAttr) {
- tc.Targets = a.Targets;
- tc.AllowMultiple = a.AllowMultiple;
- tc.Inherited = a.Inherited;
-
- } else if (a.Type == TypeManager.default_member_type) {
- if (tc.Indexers != null) {
- Report.Error (646, loc,
- "Cannot specify the DefaultMember attribute on" +
- " a type containing an indexer");
- return;
- }
-
- } else {
- if (!CheckAttribute (a, kind)) {
- Error_AttributeNotValidForElement (a, loc);
- return;
- }
- }
-
- try {
- ((TypeBuilder) builder).SetCustomAttribute (cb);
- } catch (System.ArgumentException) {
- Report.Warning (
- -21, loc,
- "The CharSet named property on StructLayout\n"+
- "\tdoes not work correctly on Microsoft.NET\n"+
- "\tYou might want to remove the CharSet declaration\n"+
- "\tor compile using the Mono runtime instead of the\n"+
- "\tMicrosoft .NET runtime");
- }
-
- } else if (kind is AssemblyBuilder){
- ((AssemblyBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is ModuleBuilder) {
- ((ModuleBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is FieldBuilder) {
- ((FieldBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Accessor) {
- ((MethodBuilder) builder).SetCustomAttribute (cb);
- } else
- throw new Exception ("Unknown kind: " + kind);
- }
- }
- }
-
- public MethodBuilder DefinePInvokeMethod (EmitContext ec, TypeBuilder builder, string name,
- MethodAttributes flags, Type ret_type, Type [] param_types)
- {
- //
- // We extract from the attribute the information we need
- //
-
- if (Arguments == null) {
- Console.WriteLine ("Internal error : this is not supposed to happen !");
- return null;
- }
-
- Type = CheckAttributeType (ec);
- if (Type == null)
- return null;
-
- ArrayList named_args = new ArrayList ();
-
- ArrayList pos_args = (ArrayList) Arguments [0];
- if (Arguments.Count > 1)
- named_args = (ArrayList) Arguments [1];
-
-
- string dll_name = null;
-
- Argument tmp = (Argument) pos_args [0];
-
- if (!tmp.Resolve (ec, Location))
- return null;
-
- if (tmp.Expr is Constant)
- dll_name = (string) ((Constant) tmp.Expr).GetValue ();
- else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- // Now we process the named arguments
- CallingConvention cc = CallingConvention.Winapi;
- CharSet charset = CharSet.Ansi;
- bool preserve_sig = true;
- bool exact_spelling = false;
- bool set_last_err = false;
- string entry_point = null;
-
- for (int i = 0; i < named_args.Count; i++) {
-
- DictionaryEntry de = (DictionaryEntry) named_args [i];
-
- string member_name = (string) de.Key;
- Argument a = (Argument) de.Value;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression member = Expression.MemberLookup (
- ec, Type, member_name,
- MemberTypes.Field | MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- Location);
-
- if (member == null || !(member is FieldExpr)) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- if (member is FieldExpr) {
- FieldExpr fe = (FieldExpr) member;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.IsInitOnly) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- if (a.Expr is Constant) {
- Constant c = (Constant) a.Expr;
-
- if (member_name == "CallingConvention")
- cc = (CallingConvention) c.GetValue ();
- else if (member_name == "CharSet")
- charset = (CharSet) c.GetValue ();
- else if (member_name == "EntryPoint")
- entry_point = (string) c.GetValue ();
- else if (member_name == "SetLastError")
- set_last_err = (bool) c.GetValue ();
- else if (member_name == "ExactSpelling")
- exact_spelling = (bool) c.GetValue ();
- else if (member_name == "PreserveSig")
- preserve_sig = (bool) c.GetValue ();
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- }
- }
-
- MethodBuilder mb = builder.DefinePInvokeMethod (
- name, dll_name, flags | MethodAttributes.HideBySig,
- CallingConventions.Standard,
- ret_type,
- param_types,
- cc,
- charset);
-
- if (preserve_sig)
- mb.SetImplementationFlags (MethodImplAttributes.PreserveSig);
-
- return mb;
- }
-
- }
-
- public class AttributeSection {
-
- public readonly string Target;
- public readonly ArrayList Attributes;
-
- public AttributeSection (string target, ArrayList attrs)
- {
- Target = target;
- Attributes = attrs;
- }
-
- }
-
- public class Attributes {
- public ArrayList AttributeSections;
- public Location Location;
-
- public Attributes (AttributeSection a, Location loc)
- {
- AttributeSections = new ArrayList ();
- AttributeSections.Add (a);
-
- }
-
- public void AddAttribute (AttributeSection a)
- {
- if (a != null)
- AttributeSections.Add (a);
- }
- }
-}
diff --git a/mcs/mbas/cfold.cs b/mcs/mbas/cfold.cs
deleted file mode 100644
index 1c564ce3e4c..00000000000
--- a/mcs/mbas/cfold.cs
+++ /dev/null
@@ -1,1013 +0,0 @@
-//
-// cfold.cs: Constant Folding
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2002 Ximian, Inc.
-//
-
-using System;
-
-namespace Mono.CSharp {
-
- public class ConstantFold {
-
- //
- // Performs the numeric promotions on the left and right expresions
- // and desposits the results on `lc' and `rc'.
- //
- // On success, the types of `lc' and `rc' on output will always match,
- // and the pair will be one of:
- //
- // (double, double)
- // (float, float)
- // (ulong, ulong)
- // (long, long)
- // (uint, uint)
- // (int, int)
- //
- static void DoConstantNumericPromotions (Binary.Operator oper,
- ref Constant left, ref Constant right,
- Location loc)
- {
- if (left is DoubleConstant || right is DoubleConstant){
- //
- // If either side is a double, convert the other to a double
- //
- if (!(left is DoubleConstant))
- left = left.ToDouble (loc);
-
- if (!(right is DoubleConstant))
- right = right.ToDouble (loc);
- return;
- } else if (left is FloatConstant || right is FloatConstant) {
- //
- // If either side is a float, convert the other to a float
- //
- if (!(left is FloatConstant))
- left = left.ToFloat (loc);
-
- if (!(right is FloatConstant))
- right = right.ToFloat (loc);
-; return;
- } else if (left is ULongConstant || right is ULongConstant){
- //
- // If either operand is of type ulong, the other operand is
- // converted to type ulong. or an error ocurrs if the other
- // operand is of type sbyte, short, int or long
- //
- Constant match, other;
-
- if (left is ULongConstant){
- other = right;
- match = left;
- if (!(right is ULongConstant))
- right = right.ToULong (loc);
- } else {
- other = left;
- match = right;
- left = left.ToULong (loc);
- }
-
-#if WRONG
- if (other is SByteConstant || other is ShortConstant ||
- other is IntConstant || other is LongConstant){
- Binary.Error_OperatorAmbiguous
- (loc, oper, other.Type, match.Type);
- left = null;
- right = null;
- }
-#endif
- return;
- } else if (left is LongConstant || right is LongConstant){
- //
- // If either operand is of type long, the other operand is converted
- // to type long.
- //
- if (!(left is LongConstant))
- left = left.ToLong (loc);
- else if (!(right is LongConstant))
- right = right.ToLong (loc);
- return;
- } else if (left is UIntConstant || right is UIntConstant){
- //
- // If either operand is of type uint, and the other
- // operand is of type sbyte, short or int, othe operands are
- // converted to type long.
- //
- if (!(left is UIntConstant))
- left = left.ToUInt (loc);
- else if (!(right is UIntConstant))
- right = right.ToUInt (loc);
- return;
- } else {
- //
- // Force conversions to int32
- //
- if (!(left is IntConstant))
- left = left.ToInt (loc);
- if (!(right is IntConstant))
- right = right.ToInt (loc);
- }
- return;
- }
-
- static void Error_CompileTimeOverflow (Location loc)
- {
- Report.Error (220, loc, "The operation overflows at compile time in checked mode");
- }
-
- /// <summary>
- /// Constant expression folder for binary operations.
- ///
- /// Returns null if the expression can not be folded.
- /// </summary>
- static public Expression BinaryFold (EmitContext ec, Binary.Operator oper,
- Constant left, Constant right, Location loc)
- {
- Type lt = left.Type;
- Type rt = right.Type;
- Type result_type = null;
- bool bool_res;
-
- //
- // Enumerator folding
- //
- if (rt == lt && left is EnumConstant)
- result_type = lt;
-
- //
- // During an enum evaluation, we need to unwrap enumerations
- //
- if (ec.InEnumContext){
- if (left is EnumConstant)
- left = ((EnumConstant) left).Child;
-
- if (right is EnumConstant)
- right = ((EnumConstant) right).Child;
- }
-
- switch (oper){
- case Binary.Operator.BitwiseOr:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- if (left is IntConstant){
- IntConstant v;
- int res = ((IntConstant) left).Value | ((IntConstant) right).Value;
-
- v = new IntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is UIntConstant){
- UIntConstant v;
- uint res = ((UIntConstant)left).Value | ((UIntConstant)right).Value;
-
- v = new UIntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is LongConstant){
- LongConstant v;
- long res = ((LongConstant)left).Value | ((LongConstant)right).Value;
-
- v = new LongConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is ULongConstant){
- ULongConstant v;
- ulong res = ((ULongConstant)left).Value |
- ((ULongConstant)right).Value;
-
- v = new ULongConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- }
- break;
-
- case Binary.Operator.BitwiseAnd:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- if (left is IntConstant){
- IntConstant v;
- int res = ((IntConstant) left).Value & ((IntConstant) right).Value;
-
- v = new IntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is UIntConstant){
- UIntConstant v;
- uint res = ((UIntConstant)left).Value & ((UIntConstant)right).Value;
-
- v = new UIntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is LongConstant){
- LongConstant v;
- long res = ((LongConstant)left).Value & ((LongConstant)right).Value;
-
- v = new LongConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is ULongConstant){
- ULongConstant v;
- ulong res = ((ULongConstant)left).Value &
- ((ULongConstant)right).Value;
-
- v = new ULongConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- }
- break;
-
- case Binary.Operator.ExclusiveOr:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- if (left is IntConstant){
- IntConstant v;
- int res = ((IntConstant) left).Value ^ ((IntConstant) right).Value;
-
- v = new IntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is UIntConstant){
- UIntConstant v;
- uint res = ((UIntConstant)left).Value ^ ((UIntConstant)right).Value;
-
- v = new UIntConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is LongConstant){
- LongConstant v;
- long res = ((LongConstant)left).Value ^ ((LongConstant)right).Value;
-
- v = new LongConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- } else if (left is ULongConstant){
- ULongConstant v;
- ulong res = ((ULongConstant)left).Value ^
- ((ULongConstant)right).Value;
-
- v = new ULongConstant (res);
- if (result_type == null)
- return v;
- else
- return new EnumConstant (v, result_type);
- }
- break;
-
- case Binary.Operator.Addition:
- Constant result;
- bool left_is_string = left is StringConstant;
- bool right_is_string = right is StringConstant;
-
- //
- // If both sides are strings, then concatenate, if
- // one is a string, and the other is not, then defer
- // to runtime concatenation
- //
- if (left_is_string || right_is_string){
- if (left_is_string && right_is_string)
- return new StringConstant (
- ((StringConstant) left).Value +
- ((StringConstant) right).Value);
-
- return null;
- }
-
- //
- // handle "E operator + (E x, U y)"
- // handle "E operator + (Y y, E x)"
- //
- // note that E operator + (E x, E y) is invalid
- //
- Type wrap_as = null;
- if (left is EnumConstant){
- if (right is EnumConstant){
- return null;
- }
- if (((EnumConstant) left).Child.Type != right.Type)
- return null;
-
- wrap_as = left.Type;
- } else if (right is EnumConstant){
- if (((EnumConstant) right).Child.Type != left.Type)
- return null;
- wrap_as = right.Type;
- }
-
- result = null;
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- try {
- if (left is DoubleConstant){
- double res;
-
- if (ec.ConstantCheckState)
- res = checked (((DoubleConstant) left).Value +
- ((DoubleConstant) right).Value);
- else
- res = unchecked (((DoubleConstant) left).Value +
- ((DoubleConstant) right).Value);
-
- result = new DoubleConstant (res);
- } else if (left is FloatConstant){
- float res;
-
- if (ec.ConstantCheckState)
- res = checked (((FloatConstant) left).Value +
- ((FloatConstant) right).Value);
- else
- res = unchecked (((FloatConstant) left).Value +
- ((FloatConstant) right).Value);
-
- result = new FloatConstant (res);
- } else if (left is ULongConstant){
- ulong res;
-
- if (ec.ConstantCheckState)
- res = checked (((ULongConstant) left).Value +
- ((ULongConstant) right).Value);
- else
- res = unchecked (((ULongConstant) left).Value +
- ((ULongConstant) right).Value);
-
- result = new ULongConstant (res);
- } else if (left is LongConstant){
- long res;
-
- if (ec.ConstantCheckState)
- res = checked (((LongConstant) left).Value +
- ((LongConstant) right).Value);
- else
- res = unchecked (((LongConstant) left).Value +
- ((LongConstant) right).Value);
-
- result = new LongConstant (res);
- } else if (left is UIntConstant){
- uint res;
-
- if (ec.ConstantCheckState)
- res = checked (((UIntConstant) left).Value +
- ((UIntConstant) right).Value);
- else
- res = unchecked (((UIntConstant) left).Value +
- ((UIntConstant) right).Value);
-
- result = new UIntConstant (res);
- } else if (left is IntConstant){
- int res;
-
- if (ec.ConstantCheckState)
- res = checked (((IntConstant) left).Value +
- ((IntConstant) right).Value);
- else
- res = unchecked (((IntConstant) left).Value +
- ((IntConstant) right).Value);
-
- result = new IntConstant (res);
- } else {
- throw new Exception ( "Unexepected input: " + left);
- }
- } catch (OverflowException){
- Error_CompileTimeOverflow (loc);
- }
-
- if (wrap_as != null)
- return new EnumConstant (result, wrap_as);
- else
- return result;
-
- case Binary.Operator.Subtraction:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- try {
- if (left is DoubleConstant){
- double res;
-
- if (ec.ConstantCheckState)
- res = checked (((DoubleConstant) left).Value -
- ((DoubleConstant) right).Value);
- else
- res = unchecked (((DoubleConstant) left).Value -
- ((DoubleConstant) right).Value);
-
- return new DoubleConstant (res);
- } else if (left is FloatConstant){
- float res;
-
- if (ec.ConstantCheckState)
- res = checked (((FloatConstant) left).Value -
- ((FloatConstant) right).Value);
- else
- res = unchecked (((FloatConstant) left).Value -
- ((FloatConstant) right).Value);
-
- return new FloatConstant (res);
- } else if (left is ULongConstant){
- ulong res;
-
- if (ec.ConstantCheckState)
- res = checked (((ULongConstant) left).Value -
- ((ULongConstant) right).Value);
- else
- res = unchecked (((ULongConstant) left).Value -
- ((ULongConstant) right).Value);
-
- return new ULongConstant (res);
- } else if (left is LongConstant){
- long res;
-
- if (ec.ConstantCheckState)
- res = checked (((LongConstant) left).Value -
- ((LongConstant) right).Value);
- else
- res = unchecked (((LongConstant) left).Value -
- ((LongConstant) right).Value);
-
- return new LongConstant (res);
- } else if (left is UIntConstant){
- uint res;
-
- if (ec.ConstantCheckState)
- res = checked (((UIntConstant) left).Value -
- ((UIntConstant) right).Value);
- else
- res = unchecked (((UIntConstant) left).Value -
- ((UIntConstant) right).Value);
-
- return new UIntConstant (res);
- } else if (left is IntConstant){
- int res;
-
- if (ec.ConstantCheckState)
- res = checked (((IntConstant) left).Value -
- ((IntConstant) right).Value);
- else
- res = unchecked (((IntConstant) left).Value -
- ((IntConstant) right).Value);
-
- return new IntConstant (res);
- } else {
- throw new Exception ( "Unexepected input: " + left);
- }
- } catch (OverflowException){
- Error_CompileTimeOverflow (loc);
- }
- break;
-
- case Binary.Operator.Multiply:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- try {
- if (left is DoubleConstant){
- double res;
-
- if (ec.ConstantCheckState)
- res = checked (((DoubleConstant) left).Value *
- ((DoubleConstant) right).Value);
- else
- res = unchecked (((DoubleConstant) left).Value *
- ((DoubleConstant) right).Value);
-
- return new DoubleConstant (res);
- } else if (left is FloatConstant){
- float res;
-
- if (ec.ConstantCheckState)
- res = checked (((FloatConstant) left).Value *
- ((FloatConstant) right).Value);
- else
- res = unchecked (((FloatConstant) left).Value *
- ((FloatConstant) right).Value);
-
- return new FloatConstant (res);
- } else if (left is ULongConstant){
- ulong res;
-
- if (ec.ConstantCheckState)
- res = checked (((ULongConstant) left).Value *
- ((ULongConstant) right).Value);
- else
- res = unchecked (((ULongConstant) left).Value *
- ((ULongConstant) right).Value);
-
- return new ULongConstant (res);
- } else if (left is LongConstant){
- long res;
-
- if (ec.ConstantCheckState)
- res = checked (((LongConstant) left).Value *
- ((LongConstant) right).Value);
- else
- res = unchecked (((LongConstant) left).Value *
- ((LongConstant) right).Value);
-
- return new LongConstant (res);
- } else if (left is UIntConstant){
- uint res;
-
- if (ec.ConstantCheckState)
- res = checked (((UIntConstant) left).Value *
- ((UIntConstant) right).Value);
- else
- res = unchecked (((UIntConstant) left).Value *
- ((UIntConstant) right).Value);
-
- return new UIntConstant (res);
- } else if (left is IntConstant){
- int res;
-
- if (ec.ConstantCheckState)
- res = checked (((IntConstant) left).Value *
- ((IntConstant) right).Value);
- else
- res = unchecked (((IntConstant) left).Value *
- ((IntConstant) right).Value);
-
- return new IntConstant (res);
- } else {
- throw new Exception ( "Unexepected input: " + left);
- }
- } catch (OverflowException){
- Error_CompileTimeOverflow (loc);
- }
- break;
-
- case Binary.Operator.Division:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- try {
- if (left is DoubleConstant){
- double res;
-
- if (ec.ConstantCheckState)
- res = checked (((DoubleConstant) left).Value /
- ((DoubleConstant) right).Value);
- else
- res = unchecked (((DoubleConstant) left).Value /
- ((DoubleConstant) right).Value);
-
- return new DoubleConstant (res);
- } else if (left is FloatConstant){
- float res;
-
- if (ec.ConstantCheckState)
- res = checked (((FloatConstant) left).Value /
- ((FloatConstant) right).Value);
- else
- res = unchecked (((FloatConstant) left).Value /
- ((FloatConstant) right).Value);
-
- return new FloatConstant (res);
- } else if (left is ULongConstant){
- ulong res;
-
- if (ec.ConstantCheckState)
- res = checked (((ULongConstant) left).Value /
- ((ULongConstant) right).Value);
- else
- res = unchecked (((ULongConstant) left).Value /
- ((ULongConstant) right).Value);
-
- return new ULongConstant (res);
- } else if (left is LongConstant){
- long res;
-
- if (ec.ConstantCheckState)
- res = checked (((LongConstant) left).Value /
- ((LongConstant) right).Value);
- else
- res = unchecked (((LongConstant) left).Value /
- ((LongConstant) right).Value);
-
- return new LongConstant (res);
- } else if (left is UIntConstant){
- uint res;
-
- if (ec.ConstantCheckState)
- res = checked (((UIntConstant) left).Value /
- ((UIntConstant) right).Value);
- else
- res = unchecked (((UIntConstant) left).Value /
- ((UIntConstant) right).Value);
-
- return new UIntConstant (res);
- } else if (left is IntConstant){
- int res;
-
- if (ec.ConstantCheckState)
- res = checked (((IntConstant) left).Value /
- ((IntConstant) right).Value);
- else
- res = unchecked (((IntConstant) left).Value /
- ((IntConstant) right).Value);
-
- return new IntConstant (res);
- } else {
- throw new Exception ( "Unexepected input: " + left);
- }
- } catch (OverflowException){
- Error_CompileTimeOverflow (loc);
-
- } catch (DivideByZeroException) {
- Report.Error (020, loc, "Division by constant zero");
- }
-
- break;
-
- case Binary.Operator.Modulus:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- try {
- if (left is DoubleConstant){
- double res;
-
- if (ec.ConstantCheckState)
- res = checked (((DoubleConstant) left).Value %
- ((DoubleConstant) right).Value);
- else
- res = unchecked (((DoubleConstant) left).Value %
- ((DoubleConstant) right).Value);
-
- return new DoubleConstant (res);
- } else if (left is FloatConstant){
- float res;
-
- if (ec.ConstantCheckState)
- res = checked (((FloatConstant) left).Value %
- ((FloatConstant) right).Value);
- else
- res = unchecked (((FloatConstant) left).Value %
- ((FloatConstant) right).Value);
-
- return new FloatConstant (res);
- } else if (left is ULongConstant){
- ulong res;
-
- if (ec.ConstantCheckState)
- res = checked (((ULongConstant) left).Value %
- ((ULongConstant) right).Value);
- else
- res = unchecked (((ULongConstant) left).Value %
- ((ULongConstant) right).Value);
-
- return new ULongConstant (res);
- } else if (left is LongConstant){
- long res;
-
- if (ec.ConstantCheckState)
- res = checked (((LongConstant) left).Value %
- ((LongConstant) right).Value);
- else
- res = unchecked (((LongConstant) left).Value %
- ((LongConstant) right).Value);
-
- return new LongConstant (res);
- } else if (left is UIntConstant){
- uint res;
-
- if (ec.ConstantCheckState)
- res = checked (((UIntConstant) left).Value %
- ((UIntConstant) right).Value);
- else
- res = unchecked (((UIntConstant) left).Value %
- ((UIntConstant) right).Value);
-
- return new UIntConstant (res);
- } else if (left is IntConstant){
- int res;
-
- if (ec.ConstantCheckState)
- res = checked (((IntConstant) left).Value %
- ((IntConstant) right).Value);
- else
- res = unchecked (((IntConstant) left).Value %
- ((IntConstant) right).Value);
-
- return new IntConstant (res);
- } else {
- throw new Exception ( "Unexepected input: " + left);
- }
- } catch (OverflowException){
- Error_CompileTimeOverflow (loc);
- }
- break;
-
- //
- // There is no overflow checking on left shift
- //
- case Binary.Operator.LeftShift:
- IntConstant ic = right.ToInt (loc);
- if (ic == null){
- Binary.Error_OperatorCannotBeApplied (loc, "<<", lt, rt);
- return null;
- }
- int lshift_val = ic.Value;
-
- IntConstant lic;
- if ((lic = left.ConvertToInt ()) != null)
- return new IntConstant (lic.Value << lshift_val);
-
- UIntConstant luic;
- if ((luic = left.ConvertToUInt ()) != null)
- return new UIntConstant (luic.Value << lshift_val);
-
- LongConstant llc;
- if ((llc = left.ConvertToLong ()) != null)
- return new LongConstant (llc.Value << lshift_val);
-
- ULongConstant lulc;
- if ((lulc = left.ConvertToULong ()) != null)
- return new ULongConstant (lulc.Value << lshift_val);
-
- Binary.Error_OperatorCannotBeApplied (loc, "<<", lt, rt);
- break;
-
- //
- // There is no overflow checking on right shift
- //
- case Binary.Operator.RightShift:
- IntConstant sic = right.ToInt (loc);
- if (sic == null){
- Binary.Error_OperatorCannotBeApplied (loc, ">>", lt, rt);
- return null;
- }
- int rshift_val = sic.Value;
-
- IntConstant ric;
- if ((ric = left.ConvertToInt ()) != null)
- return new IntConstant (ric.Value >> rshift_val);
-
- UIntConstant ruic;
- if ((ruic = left.ConvertToUInt ()) != null)
- return new UIntConstant (ruic.Value >> rshift_val);
-
- LongConstant rlc;
- if ((rlc = left.ConvertToLong ()) != null)
- return new LongConstant (rlc.Value >> rshift_val);
-
- ULongConstant rulc;
- if ((rulc = left.ConvertToULong ()) != null)
- return new ULongConstant (rulc.Value >> rshift_val);
-
- Binary.Error_OperatorCannotBeApplied (loc, ">>", lt, rt);
- break;
-
- case Binary.Operator.LogicalAnd:
- if (left is BoolConstant && right is BoolConstant){
- return new BoolConstant (
- ((BoolConstant) left).Value &&
- ((BoolConstant) right).Value);
- }
- break;
-
- case Binary.Operator.LogicalOr:
- if (left is BoolConstant && right is BoolConstant){
- return new BoolConstant (
- ((BoolConstant) left).Value ||
- ((BoolConstant) right).Value);
- }
- break;
-
- case Binary.Operator.Equality:
- if (left is BoolConstant && right is BoolConstant){
- return new BoolConstant (
- ((BoolConstant) left).Value ==
- ((BoolConstant) right).Value);
-
- }
- if (left is StringConstant && right is StringConstant){
- return new BoolConstant (
- ((StringConstant) left).Value ==
- ((StringConstant) right).Value);
-
- }
-
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- bool_res = false;
- if (left is DoubleConstant)
- bool_res = ((DoubleConstant) left).Value ==
- ((DoubleConstant) right).Value;
- else if (left is FloatConstant)
- bool_res = ((FloatConstant) left).Value ==
- ((FloatConstant) right).Value;
- else if (left is ULongConstant)
- bool_res = ((ULongConstant) left).Value ==
- ((ULongConstant) right).Value;
- else if (left is LongConstant)
- bool_res = ((LongConstant) left).Value ==
- ((LongConstant) right).Value;
- else if (left is UIntConstant)
- bool_res = ((UIntConstant) left).Value ==
- ((UIntConstant) right).Value;
- else if (left is IntConstant)
- bool_res = ((IntConstant) left).Value ==
- ((IntConstant) right).Value;
- else
- return null;
-
- return new BoolConstant (bool_res);
-
- case Binary.Operator.Inequality:
- if (left is BoolConstant && right is BoolConstant){
- return new BoolConstant (
- ((BoolConstant) left).Value !=
- ((BoolConstant) right).Value);
- }
- if (left is StringConstant && right is StringConstant){
- return new BoolConstant (
- ((StringConstant) left).Value !=
- ((StringConstant) right).Value);
-
- }
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- bool_res = false;
- if (left is DoubleConstant)
- bool_res = ((DoubleConstant) left).Value !=
- ((DoubleConstant) right).Value;
- else if (left is FloatConstant)
- bool_res = ((FloatConstant) left).Value !=
- ((FloatConstant) right).Value;
- else if (left is ULongConstant)
- bool_res = ((ULongConstant) left).Value !=
- ((ULongConstant) right).Value;
- else if (left is LongConstant)
- bool_res = ((LongConstant) left).Value !=
- ((LongConstant) right).Value;
- else if (left is UIntConstant)
- bool_res = ((UIntConstant) left).Value !=
- ((UIntConstant) right).Value;
- else if (left is IntConstant)
- bool_res = ((IntConstant) left).Value !=
- ((IntConstant) right).Value;
- else
- return null;
-
- return new BoolConstant (bool_res);
-
- case Binary.Operator.LessThan:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- bool_res = false;
- if (left is DoubleConstant)
- bool_res = ((DoubleConstant) left).Value <
- ((DoubleConstant) right).Value;
- else if (left is FloatConstant)
- bool_res = ((FloatConstant) left).Value <
- ((FloatConstant) right).Value;
- else if (left is ULongConstant)
- bool_res = ((ULongConstant) left).Value <
- ((ULongConstant) right).Value;
- else if (left is LongConstant)
- bool_res = ((LongConstant) left).Value <
- ((LongConstant) right).Value;
- else if (left is UIntConstant)
- bool_res = ((UIntConstant) left).Value <
- ((UIntConstant) right).Value;
- else if (left is IntConstant)
- bool_res = ((IntConstant) left).Value <
- ((IntConstant) right).Value;
- else
- return null;
-
- return new BoolConstant (bool_res);
-
- case Binary.Operator.GreaterThan:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- bool_res = false;
- if (left is DoubleConstant)
- bool_res = ((DoubleConstant) left).Value >
- ((DoubleConstant) right).Value;
- else if (left is FloatConstant)
- bool_res = ((FloatConstant) left).Value >
- ((FloatConstant) right).Value;
- else if (left is ULongConstant)
- bool_res = ((ULongConstant) left).Value >
- ((ULongConstant) right).Value;
- else if (left is LongConstant)
- bool_res = ((LongConstant) left).Value >
- ((LongConstant) right).Value;
- else if (left is UIntConstant)
- bool_res = ((UIntConstant) left).Value >
- ((UIntConstant) right).Value;
- else if (left is IntConstant)
- bool_res = ((IntConstant) left).Value >
- ((IntConstant) right).Value;
- else
- return null;
-
- return new BoolConstant (bool_res);
-
- case Binary.Operator.GreaterThanOrEqual:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- bool_res = false;
- if (left is DoubleConstant)
- bool_res = ((DoubleConstant) left).Value >=
- ((DoubleConstant) right).Value;
- else if (left is FloatConstant)
- bool_res = ((FloatConstant) left).Value >=
- ((FloatConstant) right).Value;
- else if (left is ULongConstant)
- bool_res = ((ULongConstant) left).Value >=
- ((ULongConstant) right).Value;
- else if (left is LongConstant)
- bool_res = ((LongConstant) left).Value >=
- ((LongConstant) right).Value;
- else if (left is UIntConstant)
- bool_res = ((UIntConstant) left).Value >=
- ((UIntConstant) right).Value;
- else if (left is IntConstant)
- bool_res = ((IntConstant) left).Value >=
- ((IntConstant) right).Value;
- else
- return null;
-
- return new BoolConstant (bool_res);
-
- case Binary.Operator.LessThanOrEqual:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
- if (left == null || right == null)
- return null;
-
- bool_res = false;
- if (left is DoubleConstant)
- bool_res = ((DoubleConstant) left).Value <=
- ((DoubleConstant) right).Value;
- else if (left is FloatConstant)
- bool_res = ((FloatConstant) left).Value <=
- ((FloatConstant) right).Value;
- else if (left is ULongConstant)
- bool_res = ((ULongConstant) left).Value <=
- ((ULongConstant) right).Value;
- else if (left is LongConstant)
- bool_res = ((LongConstant) left).Value <=
- ((LongConstant) right).Value;
- else if (left is UIntConstant)
- bool_res = ((UIntConstant) left).Value <=
- ((UIntConstant) right).Value;
- else if (left is IntConstant)
- bool_res = ((IntConstant) left).Value <=
- ((IntConstant) right).Value;
- else
- return null;
-
- return new BoolConstant (bool_res);
- }
-
- return null;
- }
- }
-}
diff --git a/mcs/mbas/class.cs b/mcs/mbas/class.cs
deleted file mode 100644
index d7ed00c856f..00000000000
--- a/mcs/mbas/class.cs
+++ /dev/null
@@ -1,4042 +0,0 @@
-//
-// class.cs: Class and Struct handlers
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001, 2002 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Diagnostics.SymbolStore;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// This is the base class for structs and classes.
- /// </summary>
- public class TypeContainer : DeclSpace {
- // Holds a list of classes and structures
- ArrayList types;
-
- // Holds the list of properties
- ArrayList properties;
-
- // Holds the list of enumerations
- ArrayList enums;
-
- // Holds the list of delegates
- ArrayList delegates;
-
- // Holds the list of constructors
- ArrayList instance_constructors;
-
- // Holds the list of fields
- ArrayList fields;
-
- // Holds a list of fields that have initializers
- ArrayList initialized_fields;
-
- // Holds a list of static fields that have initializers
- ArrayList initialized_static_fields;
-
- // Holds the list of constants
- ArrayList constants;
-
- // Holds the list of
- ArrayList interfaces;
-
- // Holds order in which interfaces must be closed
- ArrayList interface_order;
-
- // Holds the methods.
- ArrayList methods;
-
- // Holds the events
- ArrayList events;
-
- // Holds the indexers
- ArrayList indexers;
-
- // Holds the operators
- ArrayList operators;
-
- // The emit context for toplevel objects.
- EmitContext ec;
-
- //
- // Pointers to the default constructor and the default static constructor
- //
- Constructor default_constructor;
- Constructor default_static_constructor;
-
- //
- // Whether we have seen a static constructor for this class or not
- //
- bool have_static_constructor = false;
-
- //
- // Whether we have at least one non-static field
- //
- bool have_nonstatic_fields = false;
-
- //
- // This one is computed after we can distinguish interfaces
- // from classes from the arraylist `type_bases'
- //
- string base_class_name;
-
- ArrayList type_bases;
-
- // Attributes for this type
- protected Attributes attributes;
-
- // Information in the case we are an attribute type
-
- public AttributeTargets Targets = AttributeTargets.All;
- public bool AllowMultiple = false;
- public bool Inherited;
-
- // The interfaces we implement.
- Type [] ifaces;
-
- //
- // The indexer name for this class
- //
- public string IndexerName;
-
- public TypeContainer (TypeContainer parent, string name, Location l)
- : base (parent, name, l)
- {
- string n;
- types = new ArrayList ();
-
- if (parent == null)
- n = "";
- else
- n = parent.Name;
-
- base_class_name = null;
-
- //Console.WriteLine ("New class " + name + " inside " + n);
- }
-
- public AdditionResult AddConstant (Const constant)
- {
- AdditionResult res;
- string name = constant.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (constants == null)
- constants = new ArrayList ();
-
- constants.Add (constant);
- DefineName (name, constant);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddEnum (Mono.CSharp.Enum e)
- {
- AdditionResult res;
- string name = e.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (enums == null)
- enums = new ArrayList ();
-
- enums.Add (e);
- DefineName (name, e);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddClass (Class c)
- {
- AdditionResult res;
- string name = c.Name;
-
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, c);
- types.Add (c);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddStruct (Struct s)
- {
- AdditionResult res;
- string name = s.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, s);
- types.Add (s);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddDelegate (Delegate d)
- {
- AdditionResult res;
- string name = d.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (delegates == null)
- delegates = new ArrayList ();
-
- DefineName (name, d);
- delegates.Add (d);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddMethod (Method method)
- {
- string name = method.Name;
- Object value = defined_names [name];
-
- if (value != null && (!(value is Method)))
- return AdditionResult.NameExists;
-
- if (methods == null)
- methods = new ArrayList ();
-
- if (method.Name.IndexOf (".") != -1)
- methods.Insert (0, method);
- else
- methods.Add (method);
-
- if (value != null)
- DefineName (name, method);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddConstructor (Constructor c)
- {
- if (c.Name != Basename)
- return AdditionResult.NotAConstructor;
-
- bool is_static = (c.ModFlags & Modifiers.STATIC) != 0;
-
- if (is_static){
- have_static_constructor = true;
- if (default_static_constructor != null){
- Console.WriteLine ("I have a static constructor already");
- Console.WriteLine (" " + default_static_constructor);
- return AdditionResult.MethodExists;
- }
-
- default_static_constructor = c;
- } else {
- if (c.IsDefault ()){
- if (default_constructor != null)
- return AdditionResult.MethodExists;
- default_constructor = c;
- }
-
- if (instance_constructors == null)
- instance_constructors = new ArrayList ();
-
- instance_constructors.Add (c);
- }
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddInterface (Interface iface)
- {
- AdditionResult res;
- string name = iface.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (interfaces == null)
- interfaces = new ArrayList ();
- interfaces.Add (iface);
- DefineName (name, iface);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddField (Field field)
- {
- AdditionResult res;
- string name = field.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (fields == null)
- fields = new ArrayList ();
-
- fields.Add (field);
-
- if (field.Initializer != null){
- if ((field.ModFlags & Modifiers.STATIC) != 0){
- if (initialized_static_fields == null)
- initialized_static_fields = new ArrayList ();
-
- initialized_static_fields.Add (field);
-
- //
- // We have not seen a static constructor,
- // but we will provide static initialization of fields
- //
- have_static_constructor = true;
- } else {
- if (initialized_fields == null)
- initialized_fields = new ArrayList ();
-
- initialized_fields.Add (field);
- }
- }
-
- if ((field.ModFlags & Modifiers.STATIC) == 0)
- have_nonstatic_fields = true;
-
- DefineName (name, field);
- return AdditionResult.Success;
- }
-
- public AdditionResult AddProperty (Property prop)
- {
- AdditionResult res;
- string name = prop.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (properties == null)
- properties = new ArrayList ();
-
- if (prop.Name.IndexOf (".") != -1)
- properties.Insert (0, prop);
- else
- properties.Add (prop);
- DefineName (name, prop);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddEvent (Event e)
- {
- AdditionResult res;
- string name = e.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (events == null)
- events = new ArrayList ();
-
- events.Add (e);
- DefineName (name, e);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddIndexer (Indexer i)
- {
- if (indexers == null)
- indexers = new ArrayList ();
-
- if (i.InterfaceType != null)
- indexers.Insert (0, i);
- else
- indexers.Add (i);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddOperator (Operator op)
- {
- if (operators == null)
- operators = new ArrayList ();
-
- operators.Add (op);
-
- return AdditionResult.Success;
- }
-
- public void RegisterOrder (Interface iface)
- {
- if (interface_order == null)
- interface_order = new ArrayList ();
-
- interface_order.Add (iface);
- }
-
- public ArrayList Types {
- get {
- return types;
- }
- }
-
- public ArrayList Methods {
- get {
- return methods;
- }
- }
-
- public ArrayList Constants {
- get {
- return constants;
- }
- }
-
- public ArrayList Interfaces {
- get {
- return interfaces;
- }
- }
-
- public string Base {
- get {
- return base_class_name;
- }
- }
-
- public ArrayList Bases {
- get {
- return type_bases;
- }
-
- set {
- type_bases = value;
- }
- }
-
- public ArrayList Fields {
- get {
- return fields;
- }
- }
-
- public ArrayList InstanceConstructors {
- get {
- return instance_constructors;
- }
- }
-
- public ArrayList Properties {
- get {
- return properties;
- }
- }
-
- public ArrayList Events {
- get {
- return events;
- }
- }
-
- public ArrayList Enums {
- get {
- return enums;
- }
- }
-
- public ArrayList Indexers {
- get {
- return indexers;
- }
- }
-
- public ArrayList Operators {
- get {
- return operators;
- }
- }
-
- public ArrayList Delegates {
- get {
- return delegates;
- }
- }
-
- public Attributes OptAttributes {
- get {
- return attributes;
- }
- }
-
- public bool HaveStaticConstructor {
- get {
- return have_static_constructor;
- }
- }
-
- public virtual TypeAttributes TypeAttr {
- get {
- return Modifiers.TypeAttr (ModFlags, this);
- }
- }
-
- //
- // Emits the instance field initializers
- //
- public bool EmitFieldInitializers (EmitContext ec)
- {
- ArrayList fields;
- ILGenerator ig = ec.ig;
- Expression instance_expr;
-
- if (ec.IsStatic){
- fields = initialized_static_fields;
- instance_expr = null;
- } else {
- fields = initialized_fields;
- instance_expr = new This (Location.Null).Resolve (ec);
- }
-
- if (fields == null)
- return true;
-
- foreach (Field f in fields){
- Object init = f.Initializer;
-
- Expression e;
- if (init is Expression)
- e = (Expression) init;
- else {
- string base_type = f.Type.Substring (0, f.Type.IndexOf ("["));
- string rank = f.Type.Substring (f.Type.IndexOf ("["));
- e = new ArrayCreation (base_type, rank, (ArrayList)init, f.Location);
- }
-
- Location l = f.Location;
- FieldExpr fe = new FieldExpr (f.FieldBuilder, l);
- fe.InstanceExpression = instance_expr;
- Expression a = new Assign (fe, e, l);
-
- a = a.Resolve (ec);
- if (a == null)
- return false;
-
- if (a is ExpressionStatement)
- ((ExpressionStatement) a).EmitStatement (ec);
- else {
- throw new Exception ("Assign.Resolve returned a non ExpressionStatement");
- }
- }
-
- return true;
- }
-
- //
- // Defines the default constructors
- //
- void DefineDefaultConstructor (bool is_static)
- {
- Constructor c;
- int mods = 0;
-
- c = new Constructor (Basename, Parameters.GetEmptyReadOnlyParameters (),
- new ConstructorBaseInitializer (null, new Location (-1)),
- new Location (-1));
-
- if (is_static)
- mods = Modifiers.STATIC;
-
- c.ModFlags = mods;
-
- AddConstructor (c);
-
- c.Block = new Block (null);
-
- }
-
- public void ReportStructInitializedInstanceError ()
- {
- string n = TypeBuilder.FullName;
-
- foreach (Field f in initialized_fields){
- Report.Error (
- 573, Location,
- "`" + n + "." + f.Name + "': can not have " +
- "instance field initializers in structs");
- }
- }
-
- /// <remarks>
- /// The pending methods that need to be implemented (interfaces or abstract methods)
- /// </remarks>
- public PendingImplementation Pending;
-
- /// <summary>
- /// This function computes the Base class and also the
- /// list of interfaces that the class or struct @c implements.
- ///
- /// The return value is an array (might be null) of
- /// interfaces implemented (as Types).
- ///
- /// The @parent argument is set to the parent object or null
- /// if this is `System.Object'.
- /// </summary>
- Type [] GetClassBases (bool is_class, out Type parent, out bool error)
- {
- ArrayList bases = Bases;
- int count;
- int start, j, i;
-
- error = false;
-
- if (is_class)
- parent = null;
- else
- parent = TypeManager.value_type;
-
- if (bases == null){
- if (is_class){
- if (RootContext.StdLib)
- parent = TypeManager.object_type;
- else if (Name != "System.Object")
- parent = TypeManager.object_type;
- } else {
- //
- // If we are compiling our runtime,
- // and we are defining ValueType, then our
- // parent is `System.Object'.
- //
- if (!RootContext.StdLib && Name == "System.ValueType")
- parent = TypeManager.object_type;
- }
-
- return null;
- }
-
- //
- // Bases should be null if there are no bases at all
- //
- count = bases.Count;
-
- if (is_class){
- string name = (string) bases [0];
- Type first = FindType (name);
-
- if (first == null){
- error = true;
- return null;
- }
-
- if (first.IsClass){
- parent = first;
- start = 1;
- } else {
- parent = TypeManager.object_type;
- start = 0;
- }
-
- } else {
- start = 0;
- }
-
- Type [] ifaces = new Type [count-start];
-
- for (i = start, j = 0; i < count; i++, j++){
- string name = (string) bases [i];
- Type t = FindType (name);
-
- if (t == null){
- error = true;
- return null;
- }
-
- if (is_class == false && !t.IsInterface){
- Report.Error (527, "In Struct `" + Name + "', type `"+
- name +"' is not an interface");
- error = true;
- return null;
- }
-
- if (t.IsSealed) {
- string detail = "";
-
- if (t.IsValueType)
- detail = " (a class can not inherit from a struct/enum)";
-
- Report.Error (509, "class `"+ Name +
- "': Cannot inherit from sealed class `"+
- bases [i]+"'"+detail);
- error = true;
- return null;
- }
-
- if (t.IsClass) {
- if (parent != null){
- Report.Error (527, "In Class `" + Name + "', type `"+
- name+"' is not an interface");
- error = true;
- return null;
- }
- }
-
- for (int x = 0; x < j; x++) {
- if (t == ifaces [x]) {
- Report.Error (528, "`" + name + "' is already listed in interface list");
- error = true;
- return null;
- }
- }
-
- ifaces [j] = t;
- }
-
- return TypeManager.ExpandInterfaces (ifaces);
- }
-
- //
- // Defines the type in the appropriate ModuleBuilder or TypeBuilder.
- //
- public override TypeBuilder DefineType ()
- {
- Type parent;
- bool error;
- bool is_class;
-
- if (TypeBuilder != null)
- return TypeBuilder;
-
- if (InTransit)
- return null;
-
- InTransit = true;
-
- if (this is Class)
- is_class = true;
- else
- is_class = false;
-
- ec = new EmitContext (this, Mono.CSharp.Location.Null, null, null, ModFlags);
-
- ifaces = GetClassBases (is_class, out parent, out error);
-
- if (error)
- return null;
-
- if (is_class && parent != null){
- if (parent == TypeManager.enum_type ||
- (parent == TypeManager.value_type && RootContext.StdLib) ||
- parent == TypeManager.delegate_type ||
- parent == TypeManager.array_type){
- Report.Error (
- 644, Location, "`" + Name + "' cannot inherit from " +
- "special class `" + TypeManager.CSharpName (parent) + "'");
- return null;
- }
- }
-
- if (!is_class && TypeManager.value_type == null)
- throw new Exception ();
-
- TypeAttributes type_attributes = TypeAttr;
-
- // if (parent_builder is ModuleBuilder) {
- if (IsTopLevel){
- ModuleBuilder builder = CodeGen.ModuleBuilder;
-
- //
- // Structs with no fields need to have a ".size 1"
- // appended
- //
-
- if (!is_class && !have_nonstatic_fields)
- TypeBuilder = builder.DefineType (Name,
- type_attributes,
- parent,
- PackingSize.Unspecified, 1);
- else
- //
- // classes or structs with fields
- //
- TypeBuilder = builder.DefineType (Name,
- type_attributes,
- parent,
- ifaces);
- } else {
- TypeBuilder builder = Parent.TypeBuilder;
-
- //
- // Structs with no fields need to have a ".size 1"
- // appended
- //
- if (!is_class && !have_nonstatic_fields)
- TypeBuilder = builder.DefineNestedType (Basename,
- type_attributes,
- parent,
- PackingSize.Unspecified);
- else {
- //
- // classes or structs with fields
- //
- TypeBuilder = builder.DefineNestedType (Basename,
- type_attributes,
- parent,
- ifaces);
- }
- }
-
- //
- // Finish the setup for the EmitContext
- //
- ec.ContainerType = TypeBuilder;
-
- TypeManager.AddUserType (Name, TypeBuilder, this, ifaces);
-
- if (parent == TypeManager.attribute_type ||
- parent.IsSubclassOf (TypeManager.attribute_type)) {
- RootContext.RegisterAttribute (this);
- TypeManager.RegisterAttrType (TypeBuilder, this);
- } else
- RootContext.RegisterOrder (this);
-
- if (Interfaces != null) {
- foreach (Interface iface in Interfaces)
- iface.DefineType ();
- }
-
- if (Types != null) {
- foreach (TypeContainer tc in Types)
- tc.DefineType ();
- }
-
- if (Delegates != null) {
- foreach (Delegate d in Delegates)
- d.DefineType ();
- }
-
- if (Enums != null) {
- foreach (Enum en in Enums)
- en.DefineType ();
- }
-
- InTransit = false;
- return TypeBuilder;
- }
-
-
- /// <summary>
- /// Defines the MemberCore objects that are in the `list' Arraylist
- ///
- /// The `defined_names' array contains a list of members defined in
- /// a base class
- /// </summary>
- static ArrayList remove_list = new ArrayList ();
- void DefineMembers (ArrayList list, MemberInfo [] defined_names)
- {
- int idx;
-
- remove_list.Clear ();
-
- foreach (MemberCore mc in list){
- if (!mc.Define (this)){
- remove_list.Add (mc);
- continue;
- }
-
- if (defined_names == null)
- continue;
-
- idx = Array.BinarySearch (defined_names, mc.Name, mif_compare);
- if (idx < 0){
- if (RootContext.WarningLevel >= 4){
- if ((mc.ModFlags & Modifiers.NEW) != 0)
- Warning_KewywordNewNotRequired (mc.Location, mc);
- }
- continue;
- }
-
- MemberInfo match = defined_names [idx];
-
- if (match is PropertyInfo && ((mc.ModFlags & Modifiers.OVERRIDE) != 0))
- continue;
-
- //
- // If we are both methods, let the method resolution emit warnings
- //
- if (match is MethodBase && mc is MethodCore)
- continue;
-
- if ((mc.ModFlags & Modifiers.NEW) == 0)
- Warning_KeywordNewRequired (mc.Location, defined_names [idx]);
- }
-
- foreach (object o in remove_list)
- list.Remove (o);
-
- remove_list.Clear ();
- }
-
- //
- // Defines the indexers, and also verifies that the IndexerNameAttribute in the
- // class is consisten. Either it is `Item' or it is the name defined by all the
- // indexers with the `IndexerName' attribute.
- //
- // Turns out that the IndexerNameAttribute is applied to each indexer,
- // but it is never emitted, instead a DefaultName attribute is attached
- // to the class.
- //
- void DefineIndexers ()
- {
- string class_indexer_name = null;
-
- foreach (Indexer i in Indexers){
- string name;
-
- i.Define (this);
-
- name = i.IndexerName;
- if (class_indexer_name == null){
- class_indexer_name = name;
- continue;
- }
-
- if (name == class_indexer_name)
- continue;
-
- Report.Error (
- 668, "Two indexers have different names, " +
- " you should use the same name for all your indexers");
- }
- if (class_indexer_name == null)
- class_indexer_name = "Item";
- IndexerName = class_indexer_name;
- }
-
- /// <summary>
- /// Populates our TypeBuilder with fields and methods
- /// </summary>
- public override bool Define (TypeContainer parent)
- {
- MemberInfo [] defined_names = null;
-
- if (RootContext.WarningLevel > 1){
- Type ptype;
-
- //
- // This code throws an exception in the comparer
- // I guess the string is not an object?
- //
- ptype = TypeBuilder.BaseType;
- if (ptype != null){
- defined_names = FindMembers (
- ptype, MemberTypes.All & ~MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.Static, null, null);
-
- Array.Sort (defined_names, mif_compare);
- }
- }
-
- if (constants != null)
- DefineMembers (constants, defined_names);
-
- if (fields != null)
- DefineMembers (fields, defined_names);
-
- if (this is Class){
- if (instance_constructors == null){
- if (default_constructor == null)
- DefineDefaultConstructor (false);
- }
-
- if (initialized_static_fields != null &&
- default_static_constructor == null)
- DefineDefaultConstructor (true);
- }
-
- if (this is Struct){
- //
- // Structs can not have initialized instance
- // fields
- //
- if (initialized_static_fields != null &&
- default_static_constructor == null)
- DefineDefaultConstructor (true);
-
- if (initialized_fields != null)
- ReportStructInitializedInstanceError ();
- }
-
- Pending = PendingImplementation.GetPendingImplementations (this);
-
- //
- // Constructors are not in the defined_names array
- //
- if (instance_constructors != null)
- DefineMembers (instance_constructors, null);
-
- if (default_static_constructor != null)
- default_static_constructor.Define (this);
-
- if (methods != null)
- DefineMembers (methods, defined_names);
-
- if (properties != null)
- DefineMembers (properties, defined_names);
-
- if (events != null)
- DefineMembers (events, defined_names);
-
- if (indexers != null) {
- DefineIndexers ();
- } else
- IndexerName = "Item";
-
- if (operators != null)
- DefineMembers (operators, null);
-
- if (enums != null)
- DefineMembers (enums, defined_names);
-
- if (delegates != null)
- DefineMembers (delegates, defined_names);
-
- return true;
- }
-
- /// <summary>
- /// Looks up the alias for the name
- /// </summary>
- public string LookupAlias (string name)
- {
- if (Namespace != null)
- return Namespace.LookupAlias (name);
- else
- return null;
- }
-
- /// <summary>
- /// This function is based by a delegate to the FindMembers routine
- /// </summary>
- static bool AlwaysAccept (MemberInfo m, object filterCriteria)
- {
- return true;
- }
-
- /// <summary>
- /// This filter is used by FindMembers, and we just keep
- /// a global for the filter to `AlwaysAccept'
- /// </summary>
- static MemberFilter accepting_filter;
-
-
- /// <summary>
- /// A member comparission method based on name only
- /// </summary>
- static IComparer mif_compare;
-
- static TypeContainer ()
- {
- accepting_filter = new MemberFilter (AlwaysAccept);
- mif_compare = new MemberInfoCompare ();
- }
-
- /// <summary>
- /// This method returns the members of this type just like Type.FindMembers would
- /// Only, we need to use this for types which are _being_ defined because MS'
- /// implementation can't take care of that.
- /// </summary>
- //
- // FIXME: return an empty static array instead of null, that cleans up
- // some code and is consistent with some coding conventions I just found
- // out existed ;-)
- //
- //
- // Notice that in various cases we check if our field is non-null,
- // something that would normally mean that there was a bug elsewhere.
- //
- // The problem happens while we are defining p-invoke methods, as those
- // will trigger a FindMembers, but this happens before things are defined
- //
- // Since the whole process is a no-op, it is fine to check for null here.
- //
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
- bool priv = (bf & BindingFlags.NonPublic) != 0;
-
- if (filter == null)
- filter = accepting_filter;
-
- if ((mt & MemberTypes.Field) != 0) {
- if (fields != null) {
- foreach (Field f in fields) {
- if ((f.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- FieldBuilder fb = f.FieldBuilder;
- if (fb != null && filter (fb, criteria) == true)
- members.Add (fb);
- }
- }
-
- if (constants != null) {
- foreach (Const con in constants) {
- if ((con.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- FieldBuilder fb = con.FieldBuilder;
- if (fb != null && filter (fb, criteria) == true)
- members.Add (fb);
- }
- }
- }
-
- if ((mt & MemberTypes.Method) != 0) {
- if (methods != null) {
- foreach (Method m in methods) {
- if ((m.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- MethodBuilder mb = m.MethodBuilder;
-
- if (mb != null && filter (mb, criteria) == true)
- members.Add (mb);
- }
- }
-
- if (operators != null){
- foreach (Operator o in operators) {
- if ((o.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- MethodBuilder ob = o.OperatorMethodBuilder;
- if (ob != null && filter (ob, criteria) == true)
- members.Add (ob);
- }
- }
-
- if (properties != null){
- foreach (Property p in properties){
- if ((p.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- MethodBuilder b;
-
- b = p.GetBuilder;
- if (b != null && filter (b, criteria) == true)
- members.Add (b);
-
- b = p.SetBuilder;
- if (b != null && filter (b, criteria) == true)
- members.Add (b);
- }
- }
- }
-
- if ((mt & MemberTypes.Event) != 0) {
- if (events != null)
- foreach (Event e in events) {
- if ((e.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- MemberInfo eb = e.EventBuilder;
- if (eb != null && filter (eb, criteria) == true)
- members.Add (e.EventBuilder);
- }
- }
-
- if ((mt & MemberTypes.Property) != 0){
- if (properties != null)
- foreach (Property p in properties) {
- if ((p.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- MemberInfo pb = p.PropertyBuilder;
- if (pb != null && filter (pb, criteria) == true) {
- members.Add (p.PropertyBuilder);
- }
- }
-
- if (indexers != null)
- foreach (Indexer ix in indexers) {
- if ((ix.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
-
- MemberInfo ib = ix.PropertyBuilder;
- if (ib != null && filter (ib, criteria) == true) {
- members.Add (ix.PropertyBuilder);
- }
- }
- }
-
- if ((mt & MemberTypes.NestedType) != 0) {
-
- if (Types != null)
- foreach (TypeContainer t in Types)
- if (filter (t.TypeBuilder, criteria) == true)
- members.Add (t.TypeBuilder);
-
- if (Enums != null)
- foreach (Enum en in Enums)
- if (filter (en.TypeBuilder, criteria) == true)
- members.Add (en.TypeBuilder);
-
- }
-
- if ((mt & MemberTypes.Constructor) != 0){
- if (instance_constructors != null){
- foreach (Constructor c in instance_constructors){
- ConstructorBuilder cb = c.ConstructorBuilder;
-
- if (cb != null)
- if (filter (cb, criteria) == true)
- members.Add (cb);
- }
- }
-
- if (default_static_constructor != null){
- ConstructorBuilder cb =
- default_static_constructor.ConstructorBuilder;
-
- if (filter (cb, criteria) == true)
- members.Add (cb);
- }
- }
-
- //
- // Lookup members in parent if requested.
- //
- if (((bf & BindingFlags.DeclaredOnly) == 0) && (TypeBuilder.BaseType != null)) {
- MemberInfo [] mi;
-
- mi = FindMembers (TypeBuilder.BaseType, mt, bf, filter, criteria);
- if (mi != null)
- members.AddRange (mi);
- }
-
- int count = members.Count;
- if (count > 0){
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi);
- return mi;
- }
-
- return null;
- }
-
- public MemberInfo GetFieldFromEvent (EventExpr event_expr)
- {
- if (events == null)
- return null;
-
- EventInfo ei = event_expr.EventInfo;
-
- foreach (Event e in events) {
-
- if (e.FieldBuilder == null)
- continue;
-
- if (Type.FilterName (e.FieldBuilder, ei.Name))
- return e.FieldBuilder;
- }
-
- return null;
- }
-
- public static MemberInfo [] FindMembers (Type t, MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- TypeContainer tc = TypeManager.LookupTypeContainer (t);
-
- if (tc != null)
- return tc.FindMembers (mt, bf, filter, criteria);
- else
- return t.FindMembers (mt, bf, filter, criteria);
- }
-
- //
- // FindMethods will look for methods not only in the type `t', but in
- // any interfaces implemented by the type.
- //
- public static MethodInfo [] FindMethods (Type t, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- return null;
- }
-
- /// <summary>
- /// Emits the values for the constants
- /// </summary>
- public void EmitConstants ()
- {
- if (constants != null)
- foreach (Const con in constants)
- con.EmitConstant (this);
- return;
- }
-
- /// <summary>
- /// Emits the code, this step is performed after all
- /// the types, enumerations, constructors
- /// </summary>
- public void Emit ()
- {
- if (instance_constructors != null)
- foreach (Constructor c in instance_constructors)
- c.Emit (this);
-
- if (default_static_constructor != null)
- default_static_constructor.Emit (this);
-
- if (methods != null)
- foreach (Method m in methods)
- m.Emit (this);
-
- if (operators != null)
- foreach (Operator o in operators)
- o.Emit (this);
-
- if (properties != null)
- foreach (Property p in properties)
- p.Emit (this);
-
- if (indexers != null){
- foreach (Indexer ix in indexers)
- ix.Emit (this);
-
- CustomAttributeBuilder cb = Interface.EmitDefaultMemberAttr (
- this, IndexerName, ModFlags, Location);
- TypeBuilder.SetCustomAttribute (cb);
- }
-
- if (fields != null)
- foreach (Field f in fields)
- f.Emit (this);
-
- if (events != null){
- foreach (Event e in Events)
- e.Emit (this);
- }
-
- if (Pending != null)
- if (Pending.VerifyPendingMethods ())
- return;
-
- Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes, Location);
-
- //
- // Check for internal or private fields that were never assigned
- //
- if (fields != null && RootContext.WarningLevel >= 3) {
- foreach (Field f in fields) {
- if ((f.ModFlags & Modifiers.PUBLIC) != 0)
- continue;
-
- if (f.status == 0){
- Report.Warning (
- 169, f.Location, "Private field " +
- MakeName (f.Name) + " is never used");
- continue;
- }
-
- //
- // Only report 649 on level 4
- //
- if (RootContext.WarningLevel < 4)
- continue;
-
- if ((f.status & Field.Status.ASSIGNED) != 0)
- continue;
-
- Report.Warning (
- 649, f.Location,
- "Field " + MakeName (f.Name) + " is never assigned " +
- " to and will always have its default value");
- }
- }
-
-// if (types != null)
-// foreach (TypeContainer tc in types)
-// tc.Emit ();
- }
-
- public override void CloseType ()
- {
- try {
- if (!Created){
- Created = true;
- TypeBuilder.CreateType ();
- }
- } catch (TypeLoadException){
- //
- // This is fine, the code still created the type
- //
-// Report.Warning (-20, "Exception while creating class: " + TypeBuilder.Name);
-// Console.WriteLine (e.Message);
- } catch {
- Console.WriteLine ("In type: " + Name);
- throw;
- }
-
- if (Enums != null)
- foreach (Enum en in Enums)
- en.CloseType ();
-
- if (interface_order != null){
- foreach (Interface iface in interface_order)
- iface.CloseType ();
- }
-
- if (Types != null){
- foreach (TypeContainer tc in Types)
- if (tc is Struct)
- tc.CloseType ();
-
- foreach (TypeContainer tc in Types)
- if (!(tc is Struct))
- tc.CloseType ();
- }
-
- if (Delegates != null)
- foreach (Delegate d in Delegates)
- d.CloseDelegate ();
- }
-
- public string MakeName (string n)
- {
- return "`" + Name + "." + n + "'";
- }
-
- public void Warning_KeywordNewRequired (Location l, MemberInfo mi)
- {
- Report.Warning (
- 108, l, "The keyword new is required on " +
- MakeName (mi.Name) + " because it hides `" +
- mi.ReflectedType.Name + "." + mi.Name + "'");
- }
-
- public void Warning_KewywordNewNotRequired (Location l, MemberCore mc)
- {
- Report.Warning (
- 109, l, "The member " + MakeName (mc.Name) + " does not hide an " +
- "inherited member, the keyword new is not required");
- }
-
- public static int CheckMember (string name, MemberInfo mi, int ModFlags)
- {
- return 0;
- }
-
- //
- // Performs the validation on a Method's modifiers (properties have
- // the same properties).
- //
- public bool MethodModifiersValid (int flags, string n, Location loc)
- {
- const int vao = (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE);
- const int nv = (Modifiers.NEW | Modifiers.VIRTUAL);
- bool ok = true;
- string name = MakeName (n);
-
- //
- // At most one of static, virtual or override
- //
- if ((flags & Modifiers.STATIC) != 0){
- if ((flags & vao) != 0){
- Report.Error (
- 112, loc, "static method " + name + "can not be marked " +
- "as virtual, abstract or override");
- ok = false;
- }
- }
-
- if ((flags & Modifiers.OVERRIDE) != 0 && (flags & nv) != 0){
- Report.Error (
- 113, loc, name +
- " marked as override cannot be marked as new or virtual");
- ok = false;
- }
-
- //
- // If the declaration includes the abstract modifier, then the
- // declaration does not include static, virtual or extern
- //
- if ((flags & Modifiers.ABSTRACT) != 0){
- if ((flags & Modifiers.EXTERN) != 0){
- Report.Error (
- 180, loc, name + " can not be both abstract and extern");
- ok = false;
- }
-
- if ((flags & Modifiers.VIRTUAL) != 0){
- Report.Error (
- 503, loc, name + " can not be both abstract and virtual");
- ok = false;
- }
-
- if ((ModFlags & Modifiers.ABSTRACT) == 0){
- Report.Error (
- 513, loc, name +
- " is abstract but its container class is not");
- ok = false;
-
- }
- }
-
- if ((flags & Modifiers.PRIVATE) != 0){
- if ((flags & vao) != 0){
- Report.Error (
- 621, loc, name +
- " virtual or abstract members can not be private");
- ok = false;
- }
- }
-
- if ((flags & Modifiers.SEALED) != 0){
- if ((flags & Modifiers.OVERRIDE) == 0){
- Report.Error (
- 238, loc, name +
- " cannot be sealed because it is not an override");
- ok = false;
- }
- }
-
- return ok;
- }
-
- //
- // Returns true if `type' is as accessible as the flags `flags'
- // given for this member
- //
- static public bool AsAccessible (Type type, int flags)
- {
- return true;
- }
-
- Hashtable builder_and_args;
-
- public bool RegisterMethod (MethodBuilder mb, InternalParameters ip, Type [] args)
- {
- if (builder_and_args == null)
- builder_and_args = new Hashtable ();
- return true;
- }
-
- /// <summary>
- /// Performs checks for an explicit interface implementation. First it
- /// checks whether the `interface_type' is a base inteface implementation.
- /// Then it checks whether `name' exists in the interface type.
- /// </summary>
- public bool VerifyImplements (Type interface_type, string full, string name, Location loc)
- {
- bool found = false;
-
- if (ifaces != null){
- foreach (Type t in ifaces){
- if (t == interface_type){
- found = true;
- break;
- }
- }
- }
-
- if (!found){
- Report.Error (540, "`" + full + "': containing class does not implement interface `" + interface_type.FullName + "'");
- return false;
- }
-
- return true;
- }
-
- public static void Error_ExplicitInterfaceNotMemberInterface (Location loc, string name)
- {
- Report.Error (539, loc, "Explicit implementation: `" + name + "' is not a member of the interface");
- }
- }
-
- public class Class : TypeContainer {
- // <summary>
- // Modifiers allowed in a class declaration
- // </summary>
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.ABSTRACT |
- Modifiers.SEALED |
- Modifiers.UNSAFE;
-
- public Class (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- int accmods;
-
- if (parent.Parent == null)
- accmods = Modifiers.INTERNAL;
- else
- accmods = Modifiers.PRIVATE;
-
- this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
- this.attributes = attrs;
- }
-
- //
- // FIXME: How do we deal with the user specifying a different
- // layout?
- //
- public override TypeAttributes TypeAttr {
- get {
- return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class;
- }
- }
- }
-
- public class Struct : TypeContainer {
- // <summary>
- // Modifiers allowed in a struct declaration
- // </summary>
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- public Struct (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- int accmods;
-
- if (parent.Parent == null)
- accmods = Modifiers.INTERNAL;
- else
- accmods = Modifiers.PRIVATE;
-
- this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
-
- this.ModFlags |= Modifiers.SEALED;
- this.attributes = attrs;
-
- }
-
- //
- // FIXME: Allow the user to specify a different set of attributes
- // in some cases (Sealed for example is mandatory for a class,
- // but what SequentialLayout can be changed
- //
- public override TypeAttributes TypeAttr {
- get {
- return base.TypeAttr |
- TypeAttributes.SequentialLayout |
- TypeAttributes.Sealed |
- TypeAttributes.BeforeFieldInit;
- }
- }
- }
-
- public abstract class MethodCore : MemberCore {
- public readonly Parameters Parameters;
- Block block;
-
- //
- // Parameters, cached for semantic analysis.
- //
- InternalParameters parameter_info;
-
- public MethodCore (string name, Parameters parameters, Location l)
- : base (name, l)
- {
- Name = name;
- Parameters = parameters;
- }
-
- //
- // Returns the System.Type array for the parameters of this method
- //
- Type [] parameter_types;
- public Type [] ParameterTypes (TypeContainer parent)
- {
- if (Parameters == null)
- return TypeManager.NoTypes;
-
- if (parameter_types == null)
- parameter_types = Parameters.GetParameterInfo (parent);
-
- return parameter_types;
- }
-
- public InternalParameters ParameterInfo
- {
- get {
- return parameter_info;
- }
-
- set {
- parameter_info = value;
- }
- }
-
- public Block Block {
- get {
- return block;
- }
-
- set {
- block = value;
- }
- }
-
- public CallingConventions GetCallingConvention (bool is_class)
- {
- CallingConventions cc = 0;
-
- cc = Parameters.GetCallingConvention ();
-
- if (is_class)
- if ((ModFlags & Modifiers.STATIC) == 0)
- cc |= CallingConventions.HasThis;
-
- // FIXME: How is `ExplicitThis' used in C#?
-
- return cc;
- }
-
- public void LabelParameters (EmitContext ec, Type [] parameters, MethodBase builder)
- {
- //
- // Define each type attribute (in/out/ref) and
- // the argument names.
- //
- Parameter [] p = Parameters.FixedParameters;
- int i = 0;
-
- MethodBuilder mb = null;
- ConstructorBuilder cb = null;
-
- if (builder is MethodBuilder)
- mb = (MethodBuilder) builder;
- else
- cb = (ConstructorBuilder) builder;
-
- if (p != null){
- for (i = 0; i < p.Length; i++) {
- ParameterBuilder pb;
-
- if (mb == null)
- pb = cb.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
- else
- pb = mb.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
-
- Attributes attr = p [i].OptAttributes;
- if (attr != null)
- Attribute.ApplyAttributes (ec, pb, pb, attr, Location);
- }
- }
-
- if (Parameters.ArrayParameter != null){
- ParameterBuilder pb;
- Parameter array_param = Parameters.ArrayParameter;
-
- if (mb == null)
- pb = cb.DefineParameter (
- i + 1, array_param.Attributes,
- array_param.Name);
- else
- pb = mb.DefineParameter (
- i + 1, array_param.Attributes,
- array_param.Name);
-
- CustomAttributeBuilder a = new CustomAttributeBuilder (
- TypeManager.cons_param_array_attribute, new object [0]);
-
- pb.SetCustomAttribute (a);
- }
- }
- }
-
- public class Method : MethodCore {
- public readonly string ReturnType;
- public MethodBuilder MethodBuilder;
- public readonly Attributes OptAttributes;
-
- MethodAttributes flags;
-
- /// <summary>
- /// Modifiers allowed in a class declaration
- /// </summary>
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.VIRTUAL |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.ABSTRACT |
- Modifiers.UNSAFE |
- Modifiers.EXTERN;
-
- //
- // return_type can be "null" for VOID values.
- //
- public Method (string return_type, int mod, string name, Parameters parameters,
- Attributes attrs, Location l)
- : base (name, parameters, l)
- {
- ReturnType = return_type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
- OptAttributes = attrs;
- }
-
- //
- // Returns the `System.Type' for the ReturnType of this
- // function. Provides a nice cache. (used between semantic analysis
- // and actual code generation
- //
- Type type_return_type;
-
- public Type GetReturnType (TypeContainer parent)
- {
- if (type_return_type == null)
- type_return_type = RootContext.LookupType (
- parent, ReturnType, false, Location);
-
- return type_return_type;
- }
-
- void DuplicateEntryPoint (MethodInfo b, Location location)
- {
- Report.Error (
- 17, location,
- "Program `" + CodeGen.FileName +
- "' has more than one entry point defined: `" +
- TypeManager.CSharpSignature(b) + "'");
- }
-
- void Report28 (MethodInfo b)
- {
- if (RootContext.WarningLevel < 4)
- return;
-
- Report.Warning (
- 28, Location,
- "`" + TypeManager.CSharpSignature(b) +
- "' has the wrong signature to be an entry point");
- }
-
- public bool IsEntryPoint (MethodBuilder b, InternalParameters pinfo)
- {
- if (b.ReturnType != TypeManager.void_type &&
- b.ReturnType != TypeManager.int32_type)
- return false;
-
- if (pinfo.Count == 0)
- return true;
-
- if (pinfo.Count > 1)
- return false;
-
- Type t = pinfo.ParameterType(0);
- if (t.IsArray &&
- (t.GetArrayRank() == 1) &&
- (t.GetElementType() == TypeManager.string_type) &&
- (pinfo.ParameterModifier(0) == Parameter.Modifier.NONE))
- return true;
- else
- return false;
- }
-
- //
- // Creates the type
- //
- public override bool Define (TypeContainer parent)
- {
- Type ret_type = GetReturnType (parent);
- Type [] parameters = ParameterTypes (parent);
- bool error = false;
- MethodInfo implementing = null;
- Type iface_type = null;
- string iface = "", short_name;
- bool explicit_impl = false;
-
- // Check if the return type and arguments were correct
- if (ret_type == null || parameters == null)
- return false;
-
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
-
- flags = Modifiers.MethodAttr (ModFlags);
-
- //
- // verify accessibility
- //
- if (!TypeContainer.AsAccessible (ret_type, ModFlags))
- return false;
-
- if (ret_type.IsPointer && !UnsafeOK (parent))
- return false;
-
- foreach (Type partype in parameters){
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- error = true;
- if (partype.IsPointer && !UnsafeOK (parent))
- error = true;
- }
-
- if (error)
- return false;
-
- //
- // Verify if the parent has a type with the same name, and then
- // check whether we have to create a new slot for it or not.
- //
- Type ptype = parent.TypeBuilder.BaseType;
-
- // ptype is only null for System.Object while compiling corlib.
- if (ptype != null){
- MethodSignature ms = new MethodSignature (Name, null, parameters);
- MemberInfo [] mi, mi_static, mi_instance;
-
- mi_static = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static,
- MethodSignature.inheritable_method_signature_filter, ms);
-
- mi_instance = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance,
- MethodSignature.inheritable_method_signature_filter,
- ms);
-
- if (mi_instance != null && mi_instance.Length > 0){
- mi = mi_instance;
- } else if (mi_static != null && mi_static.Length > 0)
- mi = mi_static;
- else
- mi = null;
-
- if (mi != null && mi.Length > 0){
- if (!CheckMethodAgainstBase (parent, flags, (MethodInfo) mi [0])){
- return false;
- }
- } else {
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- Report.Error (115, Location,
- parent.MakeName (Name) +
- " no suitable methods found to override");
- }
- }
- } else if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- //
- // If we implement an interface, extract the interface name.
- //
- if (Name.IndexOf (".") != -1){
- int pos = Name.LastIndexOf (".");
- iface = Name.Substring (0, pos);
-
- iface_type = RootContext.LookupType (parent, iface, false, Location);
- short_name = Name.Substring (pos + 1);
-
- if (iface_type == null)
- return false;
-
- // Compute the full name that we need to export
- Name = iface_type.FullName + "." + short_name;
-
- if (!parent.VerifyImplements (iface_type, short_name, Name, Location))
- return false;
-
- explicit_impl = true;
- } else
- short_name = Name;
-
- //
- // Check if we are an implementation of an interface method or
- // a method
- //
- if (parent.Pending != null){
- implementing = parent.Pending.IsInterfaceMethod (
- iface_type, short_name, ret_type, parameters);
-
- if (iface_type != null && implementing == null){
- TypeContainer.Error_ExplicitInterfaceNotMemberInterface (Location, short_name);
- return false;
- }
- }
-
- //
- // For implicit implementations, make sure we are public, for
- // explicit implementations, make sure we are private.
- //
- if (implementing != null){
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (iface_type == null){
- //
- // We already catch different accessibility settings
- // so we just need to check that we are not private
- //
- if ((ModFlags & Modifiers.PRIVATE) != 0)
- implementing = null;
-
- //
- // Static is not allowed
- //
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if ((ModFlags & (Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location, "`public' or `abstract' modifiers "+
- "are not allowed in explicit interface declarations"
- );
- implementing = null;
- }
- }
- }
-
- //
- // If implementing is still valid, set flags
- //
- if (implementing != null){
- // Console.WriteLine ("Implementing for:" + (iface_type != null ? iface_type.FullName : "<null>") + " " + short_name);
-
- if (implementing.DeclaringType.IsInterface)
- flags |= MethodAttributes.NewSlot;
-
- flags |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
-
- //
- // clear the pending implementation flag
- //
- parent.Pending.ImplementMethod (
- iface_type, short_name, ret_type, parameters, explicit_impl);
- }
-
- Attribute dllimport_attr = null;
- if (OptAttributes != null && OptAttributes.AttributeSections != null) {
- foreach (AttributeSection asec in OptAttributes.AttributeSections) {
- if (asec.Attributes == null)
- continue;
-
- foreach (Attribute a in asec.Attributes)
- if (a.Name.IndexOf ("DllImport") != -1) {
- flags |= MethodAttributes.PinvokeImpl;
- dllimport_attr = a;
- }
- }
- }
-
- //
- // Finally, define the method
- //
-
- if ((flags & MethodAttributes.PinvokeImpl) != 0) {
-
- if ((ModFlags & Modifiers.STATIC) == 0) {
- Report.Error (601, Location, "The DllImport attribute must be specified on " +
- "a method marked 'static' and 'extern'.");
- return false;
- }
-
- EmitContext ec = new EmitContext (
- parent, Location, null, GetReturnType (parent), ModFlags);
-
- MethodBuilder = dllimport_attr.DefinePInvokeMethod (
- ec, parent.TypeBuilder,
- Name, flags, ret_type, parameters);
- } else {
- MethodBuilder = parent.TypeBuilder.DefineMethod (
- Name, flags,
- GetCallingConvention (parent is Class),
- ret_type, parameters);
-
- if (implementing != null && explicit_impl)
- parent.TypeBuilder.DefineMethodOverride (
- MethodBuilder, implementing);
- }
-
- if (MethodBuilder == null)
- return false;
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- ParameterInfo = new InternalParameters (parent, Parameters);
-
- if (!TypeManager.RegisterMethod (MethodBuilder, ParameterInfo,
- parameters)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name + "' already contains a definition with " +
- " the same return value and parameter types for method `" +
- Name + "'");
- return false;
- }
-
- //
- // This is used to track the Entry Point,
- //
- if (Name == "Main" &&
- ((ModFlags & Modifiers.STATIC) != 0) &&
- (RootContext.MainClass == null ||
- RootContext.MainClass == parent.TypeBuilder.FullName)){
- if (IsEntryPoint (MethodBuilder, ParameterInfo)) {
- if (RootContext.EntryPoint == null) {
- RootContext.EntryPoint = MethodBuilder;
- RootContext.EntryPointLocation = Location;
- } else {
- DuplicateEntryPoint (RootContext.EntryPoint, RootContext.EntryPointLocation);
- DuplicateEntryPoint (MethodBuilder, Location);
- }
- } else
- Report28(MethodBuilder);
- }
-
- return true;
- }
-
- //
- // Emits the code
- //
- public void Emit (TypeContainer parent)
- {
- ILGenerator ig;
- EmitContext ec;
-
- if ((flags & MethodAttributes.PinvokeImpl) == 0)
- ig = MethodBuilder.GetILGenerator ();
- else
- ig = null;
-
- ec = new EmitContext (parent, Location, ig, GetReturnType (parent), ModFlags);
-
- if (OptAttributes != null)
- Attribute.ApplyAttributes (ec, MethodBuilder, this, OptAttributes, Location);
-
-
- LabelParameters (ec, ParameterTypes (parent), MethodBuilder);
-
- //
- // abstract or extern methods have no bodies
- //
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0){
- if (Block != null){
- if ((ModFlags & Modifiers.ABSTRACT) != 0){
- Report.Error (
- 500, "Abstract method `" +
- TypeManager.CSharpSignature (MethodBuilder) +
- "' can not have a body");
- }
- }
- return;
- }
-
- //
- // Handle destructors specially
- //
- // FIXME: This code generates buggy code
- //
- if (Name == "Finalize" && type_return_type == TypeManager.void_type)
- EmitDestructor (ec);
- else {
- ISymbolWriter sw = CodeGen.SymbolWriter;
-
- if ((sw != null) && (!Location.IsNull (Location))) {
- MethodToken token = MethodBuilder.GetToken ();
- sw.OpenMethod (new SymbolToken (token.Token));
- sw.SetMethodSourceRange (Location.SymbolDocument,
- Location.Row, 0,
- Block.EndLocation.SymbolDocument,
- Block.EndLocation.Row, 0);
-
- ec.EmitTopBlock (Block, Location);
-
- sw.CloseMethod ();
- } else
- ec.EmitTopBlock (Block, Location);
- }
- }
-
- void EmitDestructor (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- Label finish = ig.DefineLabel ();
- bool old_in_try = ec.InTry;
-
- ig.BeginExceptionBlock ();
- ec.InTry = true;
- ec.ReturnLabel = finish;
- ec.EmitTopBlock (Block, Location);
- ec.InTry = old_in_try;
-
- ig.MarkLabel (finish);
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- ig.BeginFinallyBlock ();
-
- if (ec.ContainerType.BaseType != null) {
- Expression member_lookup = Expression.MemberLookup (
- ec, ec.ContainerType.BaseType, "Finalize",
- MemberTypes.Method, Expression.AllBindingFlags, Location);
-
- if (member_lookup != null){
- MethodGroupExpr parent_destructor = ((MethodGroupExpr) member_lookup);
-
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Call, (MethodInfo) parent_destructor.Methods [0]);
- }
- }
- ec.InFinally = old_in_finally;
-
- ig.EndExceptionBlock ();
- //ig.MarkLabel (ec.ReturnLabel);
- ig.Emit (OpCodes.Ret);
- }
- }
-
- public abstract class ConstructorInitializer {
- ArrayList argument_list;
- ConstructorInfo parent_constructor;
- Location location;
-
- public ConstructorInitializer (ArrayList argument_list, Location location)
- {
- this.argument_list = argument_list;
- this.location = location;
- }
-
- public ArrayList Arguments {
- get {
- return argument_list;
- }
- }
-
- public bool Resolve (EmitContext ec)
- {
- Expression parent_constructor_group;
- Type t;
-
- if (argument_list != null){
- foreach (Argument a in argument_list){
- if (!a.Resolve (ec, location))
- return false;
- }
- }
-
- if (this is ConstructorBaseInitializer) {
- if (ec.ContainerType.BaseType == null)
- return true;
-
- t = ec.ContainerType.BaseType;
- } else
- t = ec.ContainerType;
-
- parent_constructor_group = Expression.MemberLookup (
- ec, t, ".ctor",
- MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly,
- location);
-
- if (parent_constructor_group == null){
- Report.Error (1501, location,
- "Can not find a constructor for this argument list");
- return false;
- }
-
- parent_constructor = (ConstructorInfo) Invocation.OverloadResolve (ec,
- (MethodGroupExpr) parent_constructor_group, argument_list, location);
-
- if (parent_constructor == null){
- Report.Error (1501, location,
- "Can not find a constructor for this argument list");
- return false;
- }
-
- return true;
- }
-
- public void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldarg_0);
- if (argument_list != null)
- Invocation.EmitArguments (ec, null, argument_list);
- if (parent_constructor != null)
- ec.ig.Emit (OpCodes.Call, parent_constructor);
- }
- }
-
- public class ConstructorBaseInitializer : ConstructorInitializer {
- public ConstructorBaseInitializer (ArrayList argument_list, Location l) : base (argument_list, l)
- {
- }
- }
-
- public class ConstructorThisInitializer : ConstructorInitializer {
- public ConstructorThisInitializer (ArrayList argument_list, Location l) : base (argument_list, l)
- {
- }
- }
-
- public class Constructor : MethodCore {
- public ConstructorBuilder ConstructorBuilder;
- public ConstructorInitializer Initializer;
- public Attributes OptAttributes;
-
- // <summary>
- // Modifiers allowed for a constructor.
- // </summary>
- const int AllowedModifiers =
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.STATIC |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- //
- // The spec claims that static is not permitted, but
- // my very own code has static constructors.
- //
- public Constructor (string name, Parameters args, ConstructorInitializer init, Location l)
- : base (name, args, l)
- {
- Initializer = init;
- }
-
- //
- // Returns true if this is a default constructor
- //
- public bool IsDefault ()
- {
- if ((ModFlags & Modifiers.STATIC) != 0)
- return (Parameters.FixedParameters == null ? true : Parameters.Empty) &&
- (Parameters.ArrayParameter == null ? true : Parameters.Empty);
-
- else
- return (Parameters.FixedParameters == null ? true : Parameters.Empty) &&
- (Parameters.ArrayParameter == null ? true : Parameters.Empty) &&
- (Initializer is ConstructorBaseInitializer) &&
- (Initializer.Arguments == null);
- }
-
- //
- // Creates the ConstructorBuilder
- //
- public override bool Define (TypeContainer parent)
- {
- MethodAttributes ca = (MethodAttributes.RTSpecialName |
- MethodAttributes.SpecialName);
-
- Type [] parameters = ParameterTypes (parent);
-
- if (parameters == null)
- return false;
-
- if ((ModFlags & Modifiers.STATIC) != 0)
- ca |= MethodAttributes.Static;
- else {
- if (parent is Struct && parameters.Length == 0){
- Report.Error (
- 568, Location,
- "Structs can not contain explicit parameterless " +
- "constructors");
- return false;
- }
- ca |= MethodAttributes.Public | MethodAttributes.HideBySig;
- }
-
- foreach (Type partype in parameters)
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- return false;
-
- ConstructorBuilder = parent.TypeBuilder.DefineConstructor (
- ca, GetCallingConvention (parent is Class), parameters);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- ParameterInfo = new InternalParameters (parent, Parameters);
-
- if (!TypeManager.RegisterMethod (ConstructorBuilder, ParameterInfo, parameters)) {
- Report.Error (
- 111, Location,
- "Class `" +parent.Name+ "' already contains a definition with the " +
- "same return value and parameter types for constructor `" + Name
- + "'");
- return false;
- }
-
- return true;
- }
-
- //
- // Emits the code
- //
- public void Emit (TypeContainer parent)
- {
- ILGenerator ig = ConstructorBuilder.GetILGenerator ();
- EmitContext ec = new EmitContext (parent, Location, ig, null, ModFlags, true);
-
- if (parent is Class && ((ModFlags & Modifiers.STATIC) == 0)){
- if (Initializer == null)
- Initializer = new ConstructorBaseInitializer (null, parent.Location);
-
-
- //
- // Spec mandates that Initializers will not have
- // `this' access
- //
- ec.IsStatic = true;
- if (!Initializer.Resolve (ec))
- return;
- ec.IsStatic = false;
- }
-
- LabelParameters (ec, ParameterTypes (parent), ConstructorBuilder);
-
- //
- // Classes can have base initializers and instance field initializers.
- //
- if (parent is Class){
- if ((ModFlags & Modifiers.STATIC) == 0){
- parent.EmitFieldInitializers (ec);
-
- Initializer.Emit (ec);
- }
- }
-
- if ((ModFlags & Modifiers.STATIC) != 0)
- parent.EmitFieldInitializers (ec);
-
- Attribute.ApplyAttributes (ec, ConstructorBuilder, this, OptAttributes, Location);
-
- ec.EmitTopBlock (Block, Location);
- }
- }
-
- //
- // Fields and Events both generate FieldBuilders, we use this to share
- // their common bits. This is also used to flag usage of the field
- //
- abstract public class FieldBase : MemberCore {
- public readonly string Type;
- public readonly Object Initializer;
- public readonly Attributes OptAttributes;
- public FieldBuilder FieldBuilder;
- public Status status;
-
- [Flags]
- public enum Status : byte { ASSIGNED = 1, USED = 2 }
-
- //
- // The constructor is only exposed to our children
- //
- protected FieldBase (string type, int mod, int allowed_mod, string name,
- object init, Attributes attrs, Location loc)
- : base (name, loc)
- {
- Type = type;
- ModFlags = Modifiers.Check (allowed_mod, mod, Modifiers.PRIVATE, loc);
- Initializer = init;
- OptAttributes = attrs;
- }
- }
-
- //
- // The Field class is used to represents class/struct fields during parsing.
- //
- public class Field : FieldBase {
- // <summary>
- // Modifiers allowed in a class declaration
- // </summary>
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.VOLATILE |
- Modifiers.UNSAFE |
- Modifiers.READONLY;
-
- public Field (string type, int mod, string name, Object expr_or_array_init,
- Attributes attrs, Location loc)
- : base (type, mod, AllowedModifiers, name, expr_or_array_init, attrs, loc)
- {
- }
-
- public override bool Define (TypeContainer parent)
- {
- Type t = RootContext.LookupType (parent, Type, false, Location);
-
- if (t == null)
- return false;
-
- if (!TypeContainer.AsAccessible (t, ModFlags))
- return false;
-
- if (t.IsPointer && !UnsafeOK (parent))
- return false;
-
- if (RootContext.WarningLevel > 1){
- Type ptype = parent.TypeBuilder.BaseType;
-
- // ptype is only null for System.Object while compiling corlib.
- if (ptype != null){
- MemberInfo [] mi;
-
- mi = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.Public |
- BindingFlags.Static | BindingFlags.Instance,
- System.Type.FilterName, Name);
- }
- }
-
- if ((ModFlags & Modifiers.VOLATILE) != 0){
- if (!t.IsClass){
- if (TypeManager.IsEnumType (t))
- t = TypeManager.EnumToUnderlying (t);
-
- if (!((t == TypeManager.bool_type) ||
- (t == TypeManager.sbyte_type) ||
- (t == TypeManager.byte_type) ||
- (t == TypeManager.short_type) ||
- (t == TypeManager.ushort_type) ||
- (t == TypeManager.int32_type) ||
- (t == TypeManager.uint32_type) ||
- (t == TypeManager.char_type) ||
- (t == TypeManager.float_type))){
- Report.Error (
- 677, Location, parent.MakeName (Name) +
- " A volatile field can not be of type `" +
- TypeManager.CSharpName (t) + "'");
- return false;
- }
- }
- }
-
- FieldBuilder = parent.TypeBuilder.DefineField (
- Name, t, Modifiers.FieldAttr (ModFlags));
-
- TypeManager.RegisterFieldBase (FieldBuilder, this);
- return true;
- }
-
- public void Emit (TypeContainer tc)
- {
- EmitContext ec = new EmitContext (tc, Location, null,
- FieldBuilder.FieldType, ModFlags);
-
- Attribute.ApplyAttributes (ec, FieldBuilder, this, OptAttributes, Location);
- }
- }
-
- //
- // `set' and `get' accessors are represented with an Accessor.
- //
- public class Accessor {
- //
- // Null if the accessor is empty, or a Block if not
- //
- public Block Block;
- public Attributes OptAttributes;
-
- public Accessor (Block b, Attributes attrs)
- {
- Block = b;
- OptAttributes = attrs;
- }
- }
-
- public class Property : MemberCore {
- public readonly string Type;
- public Accessor Get, Set;
- public PropertyBuilder PropertyBuilder;
- public Attributes OptAttributes;
- public MethodBuilder GetBuilder, SetBuilder;
-
- //
- // The type, once we compute it.
- Type PropertyType;
-
- bool explicit_impl;
-
- //
- // If true, the interface type we are explicitly implementing
- //
- Type explicit_iface_type = null;
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.ABSTRACT |
- Modifiers.UNSAFE |
- Modifiers.EXTERN |
- Modifiers.VIRTUAL;
-
- public Property (string type, string name, int mod_flags,
- Accessor get_block, Accessor set_block,
- Attributes attrs, Location loc)
- : base (name, loc)
- {
- Type = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
- Get = get_block;
- Set = set_block;
- OptAttributes = attrs;
- }
-
- //
- // Checks our base implementation if any
- //
- bool CheckBase (MethodAttributes flags, TypeContainer parent)
- {
- //
- // Find properties with the same name on the base class
- //
-
- MemberInfo [] props;
- MemberInfo [] props_static = TypeManager.MemberLookup (
- parent.TypeBuilder,
- parent.TypeBuilder.BaseType,
- MemberTypes.Property, BindingFlags.Public | BindingFlags.Static,
- Name);
-
- MemberInfo [] props_instance = TypeManager.MemberLookup (
- parent.TypeBuilder,
- parent.TypeBuilder.BaseType,
- MemberTypes.Property, BindingFlags.Public | BindingFlags.Instance,
- Name);
-
- //
- // Find if we have anything
- //
- if (props_static != null && props_static.Length > 0)
- props = props_static;
- else if (props_instance != null && props_instance.Length > 0)
- props = props_instance;
- else
- props = null;
-
- //
- // If we have something on the base.
- if (props != null && props.Length > 0){
- if (props.Length > 1)
- throw new Exception ("Should not happen");
-
- PropertyInfo pi = (PropertyInfo) props [0];
-
- MethodInfo inherited_get = TypeManager.GetPropertyGetter (pi);
- MethodInfo inherited_set = TypeManager.GetPropertySetter (pi);
-
- MethodInfo reference = inherited_get == null ?
- inherited_set : inherited_get;
-
- if (reference != null)
- if (!CheckMethodAgainstBase (parent, flags, reference))
- return false;
-
- } else {
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- Report.Error (115, Location,
- parent.MakeName (Name) +
- " no suitable properties found to override");
- return false;
- }
- }
- return true;
- }
-
- bool DefineMethod (TypeContainer parent, string short_name,
- MethodAttributes flags, bool is_get, ref bool is_implementing)
- {
- Type [] parameters = TypeManager.NoTypes;
- MethodInfo implementing = null;
- Type fn_type;
- string name, prefix;
-
- if (explicit_impl)
- prefix = explicit_iface_type.FullName + ".";
- else
- prefix = "";
-
- if (is_get){
- fn_type = PropertyType;
- name = "get_" + short_name;
- } else {
- name = "set_" + short_name;
- parameters = new Type [1];
- parameters [0] = PropertyType;
- fn_type = TypeManager.void_type;
- }
-
- if (parent.Pending != null){
- implementing = parent.Pending.IsInterfaceMethod (
- explicit_iface_type, name, fn_type, parameters);
-
- if (explicit_iface_type != null && implementing == null){
- TypeContainer.Error_ExplicitInterfaceNotMemberInterface (Location, name);
- return false;
- }
- }
-
- //
- // For implicit implementations, make sure we are public, for
- // explicit implementations, make sure we are private.
- //
- if (implementing != null){
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (explicit_iface_type == null){
- //
- // We already catch different accessibility settings
- // so we just need to check that we are not private
- //
- if ((ModFlags & Modifiers.PRIVATE) != 0)
- implementing = null;
-
- //
- // Static is not allowed
- //
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if ((ModFlags & (Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location, "`public' or `abstract' modifiers "+
- "are not allowed in explicit interface declarations"
- );
- implementing = null;
- }
- }
- }
-
- //
- // If implementing is still valid, set flags
- //
- if (implementing != null){
- //
- // When implementing interface methods, set NewSlot.
- //
- if (implementing.DeclaringType.IsInterface)
- flags |= MethodAttributes.NewSlot;
-
- flags |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
-
- //
- // clear the pending implemntation flag
- //
- parent.Pending.ImplementMethod (
- explicit_iface_type, name, fn_type, parameters, explicit_impl);
-
- is_implementing = true;
- }
-
- //
- // If this is not an explicit interface implementation,
- // clear implementing, as it is only used for explicit
- // interface implementation
- //
- if (Name.IndexOf (".") == -1)
- implementing = null;
-
- if (is_get){
- GetBuilder = parent.TypeBuilder.DefineMethod (
- prefix + name, flags, PropertyType, null);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- GetBuilder, implementing);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- InternalParameters ip = new InternalParameters (
- parent, Parameters.GetEmptyReadOnlyParameters ());
-
- if (!TypeManager.RegisterMethod (GetBuilder, ip, null)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types as the " +
- "'get' method of property `" + Name + "'");
- return false;
- }
- } else {
- SetBuilder = parent.TypeBuilder.DefineMethod (
- prefix + name, flags, null, parameters);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- SetBuilder, implementing);
-
- SetBuilder.DefineParameter (1, ParameterAttributes.None, "value");
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ip = new InternalParameters (
- parent, new Parameters (parms, null, Location));
-
- if (!TypeManager.RegisterMethod (SetBuilder, ip, parameters)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types as the " +
- "'set' method of property `" + Name + "'");
- return false;
- }
- }
-
- return true;
- }
-
- public override bool Define (TypeContainer parent)
- {
- string short_name;
-
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
-
- MethodAttributes flags = Modifiers.MethodAttr (ModFlags);
-
- flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;
-
- // Lookup Type, verify validity
- PropertyType = RootContext.LookupType (parent, Type, false, Location);
- if (PropertyType == null)
- return false;
-
- // verify accessibility
- if (!TypeContainer.AsAccessible (PropertyType, ModFlags))
- return false;
-
- if (PropertyType.IsPointer && !UnsafeOK (parent))
- return false;
-
- if (!CheckBase (flags, parent))
- return false;
-
- //
- // Check for explicit interface implementation
- //
- if (Name.IndexOf (".") != -1){
- int pos = Name.LastIndexOf (".");
- string iface = Name.Substring (0, pos);
-
- explicit_iface_type = RootContext.LookupType (parent, iface, false, Location);
- if (explicit_iface_type == null)
- return false;
-
- short_name = Name.Substring (pos + 1);
-
- // Compute the full name that we need to export.
- Name = explicit_iface_type.FullName + "." + short_name;
-
- if (!parent.VerifyImplements (explicit_iface_type, short_name, Name, Location))
- return false;
-
- explicit_impl = true;
- } else {
- explicit_impl = false;
- short_name = Name;
- }
-
- bool is_implementing = false;
- if (Get != null)
- if (!DefineMethod (parent, short_name, flags, true, ref is_implementing))
- return false;
-
- if (Set != null)
- if (!DefineMethod (parent, short_name, flags, false, ref is_implementing))
- return false;
-
- // FIXME - PropertyAttributes.HasDefault ?
-
- PropertyAttributes prop_attr =
- PropertyAttributes.RTSpecialName |
- PropertyAttributes.SpecialName;
-
- if (!explicit_impl){
- PropertyBuilder = parent.TypeBuilder.DefineProperty (
- Name, prop_attr, PropertyType, null);
-
- if (Get != null)
- PropertyBuilder.SetGetMethod (GetBuilder);
-
- if (Set != null)
- PropertyBuilder.SetSetMethod (SetBuilder);
-
- //
- // HACK for the reasons exposed above
- //
- if (!TypeManager.RegisterProperty (PropertyBuilder, GetBuilder, SetBuilder)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name +
- "' already contains a definition for the property `" +
- Name + "'");
- return false;
- }
- }
- return true;
- }
-
- public void Emit (TypeContainer tc)
- {
- ILGenerator ig;
- EmitContext ec;
-
- ec = new EmitContext (tc, Location, null, PropertyType, ModFlags);
-
- //
- // The PropertyBuilder can be null for explicit implementations, in that
- // case, we do not actually emit the ".property", so there is nowhere to
- // put the attribute
- //
- if (PropertyBuilder != null)
- Attribute.ApplyAttributes (ec, PropertyBuilder, this, OptAttributes, Location);
-
-
- //
- // abstract or extern properties have no bodies
- //
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
- return;
-
- if (Get != null){
- ig = GetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, PropertyType, ModFlags);
-
- Attribute.ApplyAttributes (ec, GetBuilder, Get, Get.OptAttributes, Location);
- ec.EmitTopBlock (Get.Block, Location);
- }
-
- if (Set != null){
- ig = SetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, null, ModFlags);
-
- Attribute.ApplyAttributes (ec, SetBuilder, Set, Set.OptAttributes, Location);
- ec.EmitTopBlock (Set.Block, Location);
- }
- }
- }
-
-
- /// </summary>
- /// Gigantic workaround for lameness in SRE follows :
- /// This class derives from EventInfo and attempts to basically
- /// wrap around the EventBuilder so that FindMembers can quickly
- /// return this in it search for members
- /// </summary>
- public class MyEventBuilder : EventInfo {
-
- //
- // We use this to "point" to our Builder which is
- // not really a MemberInfo
- //
- EventBuilder MyBuilder;
-
- //
- // We "catch" and wrap these methods
- //
- MethodInfo raise, remove, add;
-
- EventAttributes attributes;
- Type declaring_type, reflected_type, event_type;
- string name;
-
- public MyEventBuilder (TypeBuilder type_builder, string name, EventAttributes event_attr, Type event_type)
- {
- MyBuilder = type_builder.DefineEvent (name, event_attr, event_type);
-
- // And now store the values in our own fields.
-
- declaring_type = type_builder;
-
- reflected_type = type_builder;
-
- attributes = event_attr;
- this.name = name;
- this.event_type = event_type;
- }
-
- //
- // Methods that you have to override. Note that you only need
- // to "implement" the variants that take the argument (those are
- // the "abstract" methods, the others (GetAddMethod()) are
- // regular.
- //
- public override MethodInfo GetAddMethod (bool nonPublic)
- {
- return add;
- }
-
- public override MethodInfo GetRemoveMethod (bool nonPublic)
- {
- return remove;
- }
-
- public override MethodInfo GetRaiseMethod (bool nonPublic)
- {
- return raise;
- }
-
- //
- // These methods make "MyEventInfo" look like a Builder
- //
- public void SetRaiseMethod (MethodBuilder raiseMethod)
- {
- raise = raiseMethod;
- MyBuilder.SetRaiseMethod (raiseMethod);
- }
-
- public void SetRemoveOnMethod (MethodBuilder removeMethod)
- {
- remove = removeMethod;
- MyBuilder.SetRemoveOnMethod (removeMethod);
- }
-
- public void SetAddOnMethod (MethodBuilder addMethod)
- {
- add = addMethod;
- MyBuilder.SetAddOnMethod (addMethod);
- }
-
- public void SetCustomAttribute (CustomAttributeBuilder cb)
- {
- MyBuilder.SetCustomAttribute (cb);
- }
-
- public override object [] GetCustomAttributes (bool inherit)
- {
- // FIXME : There's nothing which can be seemingly done here because
- // we have no way of getting at the custom attribute objects of the
- // EventBuilder !
- return null;
- }
-
- public override object [] GetCustomAttributes (Type t, bool inherit)
- {
- // FIXME : Same here !
- return null;
- }
-
- public override bool IsDefined (Type t, bool b)
- {
- return true;
- }
-
- public override EventAttributes Attributes {
- get {
- return attributes;
- }
- }
-
- public override string Name {
- get {
- return name;
- }
- }
-
- public override Type DeclaringType {
- get {
- return declaring_type;
- }
- }
-
- public override Type ReflectedType {
- get {
- return reflected_type;
- }
- }
-
- public Type EventType {
- get {
- return event_type;
- }
- }
- }
-
- public class Event : FieldBase {
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.VIRTUAL |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.UNSAFE |
- Modifiers.ABSTRACT;
-
- public readonly Accessor Add;
- public readonly Accessor Remove;
- public MyEventBuilder EventBuilder;
-
- Type EventType;
- MethodBuilder AddBuilder, RemoveBuilder;
-
- public Event (string type, string name, Object init, int mod, Accessor add,
- Accessor remove, Attributes attrs, Location loc)
- : base (type, mod, AllowedModifiers, name, init, attrs, loc)
- {
- Add = add;
- Remove = remove;
- }
-
- public override bool Define (TypeContainer parent)
- {
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
-
- MethodAttributes m_attr = Modifiers.MethodAttr (ModFlags);
- EventAttributes e_attr = EventAttributes.RTSpecialName | EventAttributes.SpecialName;
-
- EventType = RootContext.LookupType (parent, Type, false, Location);
- if (EventType == null)
- return false;
-
- if (!TypeContainer.AsAccessible (EventType, ModFlags))
- return false;
-
- if (EventType.IsPointer && !UnsafeOK (parent))
- return false;
-
- if (!EventType.IsSubclassOf (TypeManager.delegate_type)) {
- Report.Error (66, Location, "'" + parent.Name + "." + Name +
- "' : event must be of a delegate type");
- return false;
- }
-
- Type [] parameters = new Type [1];
- parameters [0] = EventType;
-
- EventBuilder = new MyEventBuilder (parent.TypeBuilder, Name, e_attr, EventType);
-
- if (Add == null && Remove == null){
- FieldBuilder = parent.TypeBuilder.DefineField (
- Name, EventType, FieldAttributes.Private);
- TypeManager.RegisterFieldBase (FieldBuilder, this);
- }
-
- //
- // Now define the accessors
- //
- string add_name = "add_" + Name;
-
- AddBuilder = parent.TypeBuilder.DefineMethod (
- add_name, m_attr, null, parameters);
- AddBuilder.DefineParameter (1, ParameterAttributes.None, "value");
- EventBuilder.SetAddOnMethod (AddBuilder);
- if (parent.Pending != null)
- parent.Pending.ImplementMethod (null, add_name, null, parameters, false);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ip = new InternalParameters (
- parent, new Parameters (parms, null, Location));
-
- if (!TypeManager.RegisterMethod (AddBuilder, ip, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name + "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'add' method of event `" + Name + "'");
- return false;
- }
-
- string remove_name = "remove_" + Name;
- RemoveBuilder = parent.TypeBuilder.DefineMethod (
- remove_name, m_attr, null, parameters);
- RemoveBuilder.DefineParameter (1, ParameterAttributes.None, "value");
- EventBuilder.SetRemoveOnMethod (RemoveBuilder);
-
- //
- // This looks like dead code
- //
- //if (parent.Pending != null)
- // parent.Pending.IsInterfaceMethod (null, remove_name, null, parameters, false);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
-
- if (!TypeManager.RegisterMethod (RemoveBuilder, ip, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name + "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'remove' method of event `" + Name + "'");
- return false;
- }
-
- if (!TypeManager.RegisterEvent (EventBuilder, AddBuilder, RemoveBuilder)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition for the event `" +
- Name + "'");
- return false;
- }
-
- return true;
- }
-
- void EmitDefaultMethod (EmitContext ec, bool is_add)
- {
- ILGenerator ig = ec.ig;
- MethodInfo method = null;
-
- if (is_add)
- method = TypeManager.delegate_combine_delegate_delegate;
- else
- method = TypeManager.delegate_remove_delegate_delegate;
-
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldfld, (FieldInfo) FieldBuilder);
- ig.Emit (OpCodes.Ldarg_1);
- ig.Emit (OpCodes.Call, method);
- ig.Emit (OpCodes.Castclass, EventType);
- ig.Emit (OpCodes.Stfld, (FieldInfo) FieldBuilder);
- ig.Emit (OpCodes.Ret);
- }
-
- public void Emit (TypeContainer tc)
- {
- EmitContext ec;
- ILGenerator ig;
-
- ig = AddBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, TypeManager.void_type, ModFlags);
-
- if (Add != null) {
- Attribute.ApplyAttributes (ec, AddBuilder, Add, Add.OptAttributes, Location);
- ec.EmitTopBlock (Add.Block, Location);
- } else
- EmitDefaultMethod (ec, true);
-
- ig = RemoveBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, TypeManager.void_type, ModFlags);
-
- if (Remove != null) {
- Attribute.ApplyAttributes (ec, RemoveBuilder, Remove, Remove.OptAttributes, Location);
- ec.EmitTopBlock (Remove.Block, Location);
- } else
- EmitDefaultMethod (ec, false);
-
- ec = new EmitContext (tc, Location, null, EventType, ModFlags);
- Attribute.ApplyAttributes (ec, EventBuilder, this, OptAttributes, Location);
-
- }
-
- }
-
- //
- // FIXME: This does not handle:
- //
- // int INTERFACENAME [ args ]
- // Does not
- //
- // Only:
- //
- // int this [ args ]
-
- public class Indexer : MemberCore {
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.VIRTUAL |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.UNSAFE |
- Modifiers.EXTERN |
- Modifiers.ABSTRACT;
-
- public readonly string Type;
- public readonly string InterfaceType;
- public readonly Parameters FormalParameters;
- public readonly Accessor Get, Set;
- public Attributes OptAttributes;
- public MethodBuilder GetBuilder;
- public MethodBuilder SetBuilder;
- public PropertyBuilder PropertyBuilder;
- public Type IndexerType;
- public string IndexerName;
-
- EmitContext ec;
-
- public Indexer (string type, string int_type, int flags, Parameters parms,
- Accessor get_block, Accessor set_block, Attributes attrs, Location loc)
- : base ("", loc)
- {
-
- Type = type;
- InterfaceType = int_type;
- ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PRIVATE, loc);
- FormalParameters = parms;
- Get = get_block;
- Set = set_block;
- OptAttributes = attrs;
- }
-
- bool DefineMethod (TypeContainer parent, Type explicit_iface_type,
- Type ret_type, string name,
- Type [] parameters, MethodAttributes attr, bool is_get)
- {
- MethodInfo implementing = null;
- bool is_implementation;
-
- if (parent.Pending != null){
- implementing = parent.Pending.IsInterfaceMethod (
- explicit_iface_type, name, ret_type, parameters);
-
- if (explicit_iface_type != null && implementing == null){
- TypeContainer.Error_ExplicitInterfaceNotMemberInterface (Location, "this");
- return false;
- }
- }
-
- is_implementation = implementing != null;
-
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (implementing != null){
- if (explicit_iface_type == null){
- //
- // We already catch different accessibility settings
- // so we just need to check that we are not private
- //
- if ((ModFlags & Modifiers.PRIVATE) != 0)
- implementing = null;
-
- //
- // Static is not allowed
- //
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if((ModFlags&(Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location,
- "`public' or `abstract' modifiers are not "+
- "allowed in explicit interface declarations"
- );
- implementing = null;
- }
- }
- }
- if (implementing != null){
- //
- // When implementing interface methods, set NewSlot.
- //
- if (implementing.DeclaringType.IsInterface)
- attr |= MethodAttributes.NewSlot;
-
- attr |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
-
- //
- // clear the pending implementing flag
- //
- parent.Pending.ImplementMethod (
- explicit_iface_type, name, ret_type, parameters, true);
- }
-
- //
- // If this is not an explicit interface implementation,
- // clear implementing, as it is only used for explicit
- // interface implementation
- //
- if (InterfaceType == null)
- implementing = null;
-
- string prefix;
- if (explicit_iface_type == null)
- prefix = "";
- else
- prefix = explicit_iface_type.FullName + ".";
-
- if (is_get){
- string meth_name = prefix + "get_" + IndexerName;
-
- GetBuilder = parent.TypeBuilder.DefineMethod (
- meth_name, attr, IndexerType, parameters);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- GetBuilder, implementing);
- } else {
- string meth_name = prefix + "set_" + IndexerName;
-
- SetBuilder = parent.TypeBuilder.DefineMethod (
- meth_name, attr, null, parameters);
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- SetBuilder, implementing);
- }
-
- return is_implementation;
- }
-
- public override bool Define (TypeContainer parent)
- {
- PropertyAttributes prop_attr =
- PropertyAttributes.RTSpecialName |
- PropertyAttributes.SpecialName;
- bool error = false;
-
- IndexerType = RootContext.LookupType (parent, Type, false, Location);
- Type [] parameters = FormalParameters.GetParameterInfo (parent);
-
- // Check if the return type and arguments were correct
- if (IndexerType == null || parameters == null)
- return false;
-
- if (!parent.MethodModifiersValid (ModFlags, InterfaceType == null ?
- "this" : InterfaceType, Location))
- return false;
-
- //
- // verify accessibility and unsafe pointers
- //
- if (!TypeContainer.AsAccessible (IndexerType, ModFlags))
- return false;
-
- if (IndexerType.IsPointer && !UnsafeOK (parent))
- return false;
-
- foreach (Type partype in parameters){
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- error = true;
- if (partype.IsPointer && !UnsafeOK (parent))
- error = true;
- }
-
- if (error)
- return false;
-
- Type explicit_iface_type = null;
-
- if (InterfaceType != null){
- explicit_iface_type = RootContext.LookupType (parent, InterfaceType, false, Location);
- if (explicit_iface_type == null)
- return false;
-
- if (!parent.VerifyImplements (explicit_iface_type, "this", "this", Location))
- return false;
- }
-
- ec = new EmitContext (parent, Location, null, IndexerType, ModFlags);
-
- IndexerName = Attribute.ScanForIndexerName (ec, OptAttributes);
- if (IndexerName == null)
- IndexerName = "Item";
-
- MethodAttributes attr = Modifiers.MethodAttr (ModFlags);
-
- bool is_implementing = false;
-
- if (Get != null){
- is_implementing = DefineMethod (
- parent, explicit_iface_type, IndexerType, "get_" + IndexerName,
- parameters, attr, true);
- InternalParameters pi = new InternalParameters (parent, FormalParameters);
- if (!TypeManager.RegisterMethod (GetBuilder, pi, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'get' indexer");
- return false;
- }
- }
-
- if (Set != null){
- int top = parameters.Length;
- Type [] set_pars = new Type [top + 1];
- parameters.CopyTo (set_pars, 0);
- set_pars [top] = IndexerType;
-
- Parameter [] fixed_parms = FormalParameters.FixedParameters;
-
- if (fixed_parms == null){
- throw new Exception ("We currently do not support only array arguments in an indexer");
- // BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG
- // BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG
- //
- // Here is the problem: the `value' parameter has
- // to come *after* the array parameter in the declaration
- // like this:
- // X (object [] x, Type value)
- // .param [0]
- //
- // BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG
- // BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG
-
- }
-
- Parameter [] tmp = new Parameter [fixed_parms.Length + 1];
-
-
- fixed_parms.CopyTo (tmp, 0);
- tmp [fixed_parms.Length] = new Parameter (
- Type, "value", Parameter.Modifier.NONE, null);
-
- Parameters set_formal_params = new Parameters (tmp, null, Location);
-
- is_implementing = DefineMethod (
- parent, explicit_iface_type, TypeManager.void_type,
- "set_" + IndexerName, set_pars, attr, false);
-
- InternalParameters ip = new InternalParameters (parent, set_formal_params);
-
- if (!TypeManager.RegisterMethod (SetBuilder, ip, set_pars)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name + "' already contains a " +
- "definition with the " +
- "same return value and parameter types for the " +
- "'set' indexer");
- return false;
- }
- }
-
- //
- // Now name the parameters
- //
- Parameter [] p = FormalParameters.FixedParameters;
- if (p != null) {
- int i;
-
- for (i = 0; i < p.Length; ++i) {
- if (Get != null)
- GetBuilder.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
-
- if (Set != null)
- SetBuilder.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
- }
-
- if (Set != null)
- SetBuilder.DefineParameter (
- i + 1, ParameterAttributes.None, "value");
-
- if (i != parameters.Length) {
- Parameter array_param = FormalParameters.ArrayParameter;
- SetBuilder.DefineParameter (i + 1, array_param.Attributes,
- array_param.Name);
- }
- }
-
-
- //
- // Only define the PropertyBuilder if we are not implementing
- // an interface property.
- //
- if (!is_implementing){
- PropertyBuilder = parent.TypeBuilder.DefineProperty (
- IndexerName, prop_attr, IndexerType, parameters);
-
- if (GetBuilder != null)
- PropertyBuilder.SetGetMethod (GetBuilder);
-
- if (SetBuilder != null)
- PropertyBuilder.SetSetMethod (SetBuilder);
-
- TypeManager.RegisterProperty (PropertyBuilder, GetBuilder, SetBuilder);
- }
-
- return true;
- }
-
- public void Emit (TypeContainer tc)
- {
- ILGenerator ig;
-
- //
- // The PropertyBuilder can be null for explicit implementations, in that
- // case, we do not actually emit the ".property", so there is nowhere to
- // put the attribute
- //
- if (PropertyBuilder != null)
- Attribute.ApplyAttributes (
- ec, PropertyBuilder, this, OptAttributes, Location);
-
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
- return;
-
- if (Get != null){
- ig = GetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, IndexerType, ModFlags);
-
- ec.EmitTopBlock (Get.Block, Location);
- }
-
- if (Set != null){
- ig = SetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, null, ModFlags);
-
- ec.EmitTopBlock (Set.Block, Location);
- }
- }
- }
-
- public class Operator : MemberCore {
-
- const int AllowedModifiers =
- Modifiers.PUBLIC |
- Modifiers.UNSAFE |
- Modifiers.EXTERN |
- Modifiers.STATIC;
-
- const int RequiredModifiers =
- Modifiers.PUBLIC |
- Modifiers.STATIC;
-
- public enum OpType : byte {
-
- // Unary operators
- LogicalNot,
- OnesComplement,
- Increment,
- Decrement,
- True,
- False,
-
- // Unary and Binary operators
- Addition,
- Subtraction,
-
- UnaryPlus,
- UnaryNegation,
-
- // Binary operators
- Multiply,
- Division,
- Modulus,
- BitwiseAnd,
- BitwiseOr,
- ExclusiveOr,
- LeftShift,
- RightShift,
- Equality,
- Inequality,
- GreaterThan,
- LessThan,
- GreaterThanOrEqual,
- LessThanOrEqual,
-
- // Implicit and Explicit
- Implicit,
- Explicit
- };
-
- public readonly OpType OperatorType;
- public readonly string ReturnType;
- public readonly string FirstArgType;
- public readonly string FirstArgName;
- public readonly string SecondArgType;
- public readonly string SecondArgName;
- public readonly Block Block;
- public Attributes OptAttributes;
- public MethodBuilder OperatorMethodBuilder;
-
- public string MethodName;
- public Method OperatorMethod;
-
- public Operator (OpType type, string ret_type, int flags, string arg1type, string arg1name,
- string arg2type, string arg2name, Block block, Attributes attrs, Location loc)
- : base ("", loc)
- {
- OperatorType = type;
- ReturnType = ret_type;
- ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PUBLIC, loc);
- FirstArgType = arg1type;
- FirstArgName = arg1name;
- SecondArgType = arg2type;
- SecondArgName = arg2name;
- Block = block;
- OptAttributes = attrs;
- }
-
- string Prototype (TypeContainer parent)
- {
- return parent.Name + ".operator " + OperatorType + " (" + FirstArgType + "," +
- SecondArgType + ")";
- }
-
- public override bool Define (TypeContainer parent)
- {
- int length = 1;
- MethodName = "op_" + OperatorType;
-
- if (SecondArgType != null)
- length = 2;
-
- Parameter [] param_list = new Parameter [length];
-
- if ((ModFlags & RequiredModifiers) != RequiredModifiers){
- Report.Error (
- 558, Location,
- "User defined operators `" +
- Prototype (parent) +
- "' must be declared static and public");
- return false;
- }
-
- param_list[0] = new Parameter (FirstArgType, FirstArgName,
- Parameter.Modifier.NONE, null);
- if (SecondArgType != null)
- param_list[1] = new Parameter (SecondArgType, SecondArgName,
- Parameter.Modifier.NONE, null);
-
- OperatorMethod = new Method (ReturnType, ModFlags, MethodName,
- new Parameters (param_list, null, Location),
- OptAttributes, Mono.CSharp.Location.Null);
-
- OperatorMethod.Define (parent);
-
- if (OperatorMethod.MethodBuilder == null)
- return false;
-
- OperatorMethodBuilder = OperatorMethod.MethodBuilder;
-
- Type [] param_types = OperatorMethod.ParameterTypes (parent);
- Type declaring_type = OperatorMethodBuilder.DeclaringType;
- Type return_type = OperatorMethod.GetReturnType (parent);
- Type first_arg_type = param_types [0];
-
- // Rules for conversion operators
-
- if (OperatorType == OpType.Implicit || OperatorType == OpType.Explicit) {
- if (first_arg_type == return_type && first_arg_type == declaring_type){
- Report.Error (
- 555, Location,
- "User-defined conversion cannot take an object of the " +
- "enclosing type and convert to an object of the enclosing" +
- " type");
- return false;
- }
-
- if (first_arg_type != declaring_type && return_type != declaring_type){
- Report.Error (
- 556, Location,
- "User-defined conversion must convert to or from the " +
- "enclosing type");
- return false;
- }
-
- if (first_arg_type == TypeManager.object_type ||
- return_type == TypeManager.object_type){
- Report.Error (
- -8, Location,
- "User-defined conversion cannot convert to or from " +
- "object type");
- return false;
- }
-
- if (first_arg_type.IsInterface || return_type.IsInterface){
- Report.Error (
- 552, Location,
- "User-defined conversion cannot convert to or from an " +
- "interface type");
- return false;
- }
-
- if (first_arg_type.IsSubclassOf (return_type) ||
- return_type.IsSubclassOf (first_arg_type)){
- Report.Error (
- -10, Location,
- "User-defined conversion cannot convert between types " +
- "that derive from each other");
- return false;
- }
- } else if (SecondArgType == null) {
- // Checks for Unary operators
-
- if (first_arg_type != declaring_type){
- Report.Error (
- 562, Location,
- "The parameter of a unary operator must be the " +
- "containing type");
- return false;
- }
-
- if (OperatorType == OpType.Increment || OperatorType == OpType.Decrement) {
- if (return_type != declaring_type){
- Report.Error (
- 559, Location,
- "The parameter and return type for ++ and -- " +
- "must be the containing type");
- return false;
- }
-
- }
-
- if (OperatorType == OpType.True || OperatorType == OpType.False) {
- if (return_type != TypeManager.bool_type){
- Report.Error (
- 215, Location,
- "The return type of operator True or False " +
- "must be bool");
- return false;
- }
- }
-
- } else {
- // Checks for Binary operators
-
- if (first_arg_type != declaring_type &&
- param_types [1] != declaring_type){
- Report.Error (
- 563, Location,
- "One of the parameters of a binary operator must " +
- "be the containing type");
- return false;
- }
- }
-
- return true;
- }
-
- public void Emit (TypeContainer parent)
- {
- EmitContext ec = new EmitContext (parent, Location, null, null, ModFlags);
- Attribute.ApplyAttributes (ec, OperatorMethodBuilder, this, OptAttributes, Location);
-
- //
- // abstract or extern methods have no bodies
- //
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
- return;
-
- OperatorMethod.Block = Block;
- OperatorMethod.Emit (parent);
- }
- }
-
- //
- // This is used to compare method signatures
- //
- struct MethodSignature {
- public string Name;
- public Type RetType;
- public Type [] Parameters;
-
- /// <summary>
- /// This delegate is used to extract methods which have the
- /// same signature as the argument
- /// </summary>
- public static MemberFilter method_signature_filter;
-
- /// <summary>
- /// This delegate is used to extract inheritable methods which
- /// have the same signature as the argument. By inheritable,
- /// this means that we have permissions to override the method
- /// from the current assembly and class
- /// </summary>
- public static MemberFilter inheritable_method_signature_filter;
-
- static MethodSignature ()
- {
- method_signature_filter = new MemberFilter (MemberSignatureCompare);
- inheritable_method_signature_filter = new MemberFilter (
- InheritableMemberSignatureCompare);
- }
-
- public MethodSignature (string name, Type ret_type, Type [] parameters)
- {
- Name = name;
- RetType = ret_type;
-
- if (parameters == null)
- Parameters = TypeManager.NoTypes;
- else
- Parameters = parameters;
- }
-
- public override int GetHashCode ()
- {
- return Name.GetHashCode ();
- }
-
- public override bool Equals (Object o)
- {
- MethodSignature other = (MethodSignature) o;
-
- if (other.Name != Name)
- return false;
-
- if (other.RetType != RetType)
- return false;
-
- if (Parameters == null){
- if (other.Parameters == null)
- return true;
- return false;
- }
-
- if (other.Parameters == null)
- return false;
-
- int c = Parameters.Length;
- if (other.Parameters.Length != c)
- return false;
-
- for (int i = 0; i < c; i++)
- if (other.Parameters [i] != Parameters [i])
- return false;
-
- return true;
- }
-
- static bool MemberSignatureCompare (MemberInfo m, object filter_criteria)
- {
- MethodInfo mi;
-
- if (! (m is MethodInfo))
- return false;
-
- MethodSignature sig = (MethodSignature) filter_criteria;
-
- if (m.Name != sig.Name)
- return false;
-
- mi = (MethodInfo) m;
-
- //
- // we use sig.RetType == null to mean `do not check the
- // method return value.
- //
- if (sig.RetType != null)
- if (mi.ReturnType != sig.RetType)
- return false;
-
- Type [] args = TypeManager.GetArgumentTypes (mi);
- Type [] sigp = sig.Parameters;
-
- if (args.Length != sigp.Length)
- return false;
-
- for (int i = args.Length; i > 0; ){
- i--;
- if (args [i] != sigp [i])
- return false;
- }
- return true;
- }
-
- //
- // This filter should be used when we are requesting methods that
- // we want to override.
- //
- // This makes a number of assumptions, for example
- // that the methods being extracted are of a parent
- // class (this means we know implicitly that we are
- // being called to find out about members by a derived
- // class).
- //
- static bool InheritableMemberSignatureCompare (MemberInfo m, object filter_criteria)
- {
- if (MemberSignatureCompare (m, filter_criteria)){
- MethodInfo mi = (MethodInfo) m;
- MethodAttributes prot = mi.Attributes & MethodAttributes.MemberAccessMask;
-
- // If only accessible to the current class.
- if (prot == MethodAttributes.Private)
- return false;
-
- // If only accessible to the defining assembly or
- if (prot == MethodAttributes.FamANDAssem ||
- prot == MethodAttributes.Assembly){
- if (m.DeclaringType.Assembly == CodeGen.AssemblyBuilder)
- return true;
- else
- return false;
- }
-
- // Anything else (FamOrAssembly and Public) is fine
- return true;
- }
- return false;
- }
- }
-}
diff --git a/mcs/mbas/codegen.cs b/mcs/mbas/codegen.cs
deleted file mode 100644
index 819acf29363..00000000000
--- a/mcs/mbas/codegen.cs
+++ /dev/null
@@ -1,467 +0,0 @@
-//
-// codegen.cs: The code generator
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics.SymbolStore;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Code generator class.
- /// </summary>
- public class CodeGen {
- static AppDomain current_domain;
- public static AssemblyBuilder AssemblyBuilder;
- public static ModuleBuilder ModuleBuilder;
-
- static public ISymbolWriter SymbolWriter;
-
- public static string Basename (string name)
- {
- int pos = name.LastIndexOf ("/");
-
- if (pos != -1)
- return name.Substring (pos + 1);
-
- pos = name.LastIndexOf ("\\");
- if (pos != -1)
- return name.Substring (pos + 1);
-
- return name;
- }
-
- public static string Dirname (string name)
- {
- int pos = name.LastIndexOf ("/");
-
- if (pos != -1)
- return name.Substring (0, pos);
-
- pos = name.LastIndexOf ("\\");
- if (pos != -1)
- return name.Substring (0, pos);
-
- return ".";
- }
-
- static string TrimExt (string name)
- {
- int pos = name.LastIndexOf (".");
-
- return name.Substring (0, pos);
- }
-
- static public string FileName;
-
- //
- // This routine initializes the Mono runtime SymbolWriter.
- //
- static void InitMonoSymbolWriter (string basename, string[] debug_args)
- {
- string symbol_output = basename + "-debug.s";
-
- Type itype = SymbolWriter.GetType ();
- if (itype == null)
- return;
-
- Type[] arg_types = new Type [2];
- arg_types [0] = typeof (string);
- arg_types [1] = typeof (string[]);
-
- MethodInfo initialize = itype.GetMethod ("Initialize", arg_types);
- if (initialize == null)
- return;
-
- object[] args = new object [2];
- args [0] = symbol_output;
- args [1] = debug_args;
-
- initialize.Invoke (SymbolWriter, args);
- }
-
- //
- // Initializes the symbol writer
- //
- static void InitializeSymbolWriter (string basename, string[] args)
- {
- SymbolWriter = ModuleBuilder.GetSymWriter ();
-
- //
- // If we got an ISymbolWriter instance, initialize it.
- //
- if (SymbolWriter == null)
- return;
-
- //
- // Due to lacking documentation about the first argument of the
- // Initialize method, we cannot use Microsoft's default symbol
- // writer yet.
- //
- // If we're using the mono symbol writer, the SymbolWriter object
- // is of type MonoSymbolWriter - but that's defined in a dynamically
- // loaded DLL - that's why we're doing a comparision based on the type
- // name here instead of using `SymbolWriter is MonoSymbolWriter'.
- //
- Type sym_type = ((object) SymbolWriter).GetType ();
-
- switch (sym_type.Name){
- case "MonoSymbolWriter":
- InitMonoSymbolWriter (basename, args);
- break;
-
- default:
- Report.Error (
- -18, "Cannot generate debugging information on this platform");
- break;
- }
- }
-
- //
- // Initializes the code generator variables
- //
- static public void Init (string name, string output, bool want_debugging_support,
- string[] debug_args)
- {
- AssemblyName an;
-
- FileName = output;
- an = new AssemblyName ();
- an.Name = TrimExt (Basename (name));
- current_domain = AppDomain.CurrentDomain;
- AssemblyBuilder = current_domain.DefineDynamicAssembly (
- an, AssemblyBuilderAccess.RunAndSave, Dirname (name));
-
- //
- // Pass a path-less name to DefineDynamicModule. Wonder how
- // this copes with output in different directories then.
- // FIXME: figure out how this copes with --output /tmp/blah
- //
- // If the third argument is true, the ModuleBuilder will dynamically
- // load the default symbol writer.
- //
- ModuleBuilder = AssemblyBuilder.DefineDynamicModule (
- Basename (name), Basename (output), want_debugging_support);
-
- if (want_debugging_support)
- InitializeSymbolWriter (an.Name, debug_args);
- }
-
- static public void Save (string name)
- {
- try {
- AssemblyBuilder.Save (Basename (name));
- } catch (System.IO.IOException io){
- Report.Error (16, "Coult not write to file `"+name+"', cause: " + io.Message);
- }
- }
-
- static public void SaveSymbols ()
- {
- if (SymbolWriter != null) {
- // If we have a symbol writer, call its Close() method to write
- // the symbol file to disk.
- //
- // When using Mono's default symbol writer, the Close() method must
- // be called after the assembly has already been written to disk since
- // it opens the assembly and reads its metadata.
- SymbolWriter.Close ();
- }
- }
- }
-
- /// <summary>
- /// An Emit Context is created for each body of code (from methods,
- /// properties bodies, indexer bodies or constructor bodies)
- /// </summary>
- public class EmitContext {
- public DeclSpace DeclSpace;
- public TypeContainer TypeContainer;
- public ILGenerator ig;
-
- /// <summary>
- /// This variable tracks the `checked' state of the compilation,
- /// it controls whether we should generate code that does overflow
- /// checking, or if we generate code that ignores overflows.
- ///
- /// The default setting comes from the command line option to generate
- /// checked or unchecked code plus any source code changes using the
- /// checked/unchecked statements or expressions. Contrast this with
- /// the ConstantCheckState flag.
- /// </summary>
-
- public bool CheckState;
-
- /// <summary>
- /// The constant check state is always set to `true' and cant be changed
- /// from the command line. The source code can change this setting with
- /// the `checked' and `unchecked' statements and expressions.
- /// </summary>
- public bool ConstantCheckState;
-
- /// <summary>
- /// Whether we are emitting code inside a static or instance method
- /// </summary>
- public bool IsStatic;
-
- /// <summary>
- /// The value that is allowed to be returned or NULL if there is no
- /// return type.
- /// </summary>
- public Type ReturnType;
-
- /// <summary>
- /// Points to the Type (extracted from the TypeContainer) that
- /// declares this body of code
- /// </summary>
- public Type ContainerType;
-
- /// <summary>
- /// Whether this is generating code for a constructor
- /// </summary>
- public bool IsConstructor;
-
- /// <summary>
- /// Keeps track of the Type to LocalBuilder temporary storage created
- /// to store structures (used to compute the address of the structure
- /// value on structure method invocations)
- /// </summary>
- public Hashtable temporary_storage;
-
- public Block CurrentBlock;
-
- /// <summary>
- /// The location where we store the return value.
- /// </summary>
- LocalBuilder return_value;
-
- /// <summary>
- /// The location where return has to jump to return the
- /// value
- /// </summary>
- public Label ReturnLabel;
-
- /// <summary>
- /// Whether we are in a Finally block
- /// </summary>
- public bool InFinally;
-
- /// <summary>
- /// Whether we are in a Try block
- /// </summary>
- public bool InTry;
-
- /// <summary>
- /// Whether we are in a Catch block
- /// </summary>
- public bool InCatch;
-
- /// <summary>
- /// Whether we are inside an unsafe block
- /// </summary>
- public bool InUnsafe;
-
- /// <summary>
- /// Location for this EmitContext
- /// </summary>
- public Location loc;
-
- /// <summary>
- /// Used to "flag" the resolution process to only lookup types,
- /// and nothing else. This is an out-of-band communication
- /// path to SimpleName from the cast operation.
- /// </summary>
- public bool OnlyLookupTypes;
-
- /// <summary>
- /// Inside an enum definition, we do not resolve enumeration values
- /// to their enumerations, but rather to the underlying type/value
- /// This is so EnumVal + EnumValB can be evaluated.
- ///
- /// There is no "E operator + (E x, E y)", so during an enum evaluation
- /// we relax the rules
- /// </summary>
- public bool InEnumContext;
-
- public EmitContext (TypeContainer parent, DeclSpace ds, Location l, ILGenerator ig,
- Type return_type, int code_flags, bool is_constructor)
- {
- this.ig = ig;
-
- TypeContainer = parent;
- DeclSpace = ds;
- CheckState = RootContext.Checked;
- ConstantCheckState = true;
-
- IsStatic = (code_flags & Modifiers.STATIC) != 0;
- ReturnType = return_type;
- IsConstructor = is_constructor;
- CurrentBlock = null;
- ContainerType = parent.TypeBuilder;
- InUnsafe = ((parent.ModFlags | code_flags) & Modifiers.UNSAFE) != 0;
- OnlyLookupTypes = false;
- loc = l;
-
- if (ReturnType == TypeManager.void_type)
- ReturnType = null;
- }
-
- public EmitContext (TypeContainer tc, Location l, ILGenerator ig,
- Type return_type, int code_flags, bool is_constructor)
- : this (tc, tc, l, ig, return_type, code_flags, is_constructor)
- {
- }
-
- public EmitContext (TypeContainer tc, Location l, ILGenerator ig,
- Type return_type, int code_flags)
- : this (tc, tc, l, ig, return_type, code_flags, false)
- {
- }
-
- public void EmitTopBlock (Block block, Location loc)
- {
- bool has_ret = false;
-
-// Console.WriteLine ("Emitting: " + loc);
-
- if (CodeGen.SymbolWriter != null)
- Mark (loc);
-
- if (block != null){
- int errors = Report.Errors;
-
- block.EmitMeta (this, block);
-
- if (Report.Errors == errors){
- if (!block.Resolve (this))
- return;
-
- has_ret = block.Emit (this);
-
- if (Report.Errors == errors){
- if (RootContext.WarningLevel >= 3)
- block.UsageWarning ();
- }
- }
- }
-
- if (ReturnType != null && !has_ret){
- //
- // FIXME: we need full flow analysis to implement this
- // correctly and emit an error instead of a warning.
- //
- //
- Report.Error (161, loc, "Not all code paths return a value");
- return;
- }
-
- if (return_value != null){
- ig.MarkLabel (ReturnLabel);
- ig.Emit (OpCodes.Ldloc, return_value);
- ig.Emit (OpCodes.Ret);
- } else {
- if (!has_ret){
- if (!InTry)
- ig.Emit (OpCodes.Ret);
- }
- }
- }
-
- /// <summary>
- /// This is called immediately before emitting an IL opcode to tell the symbol
- /// writer to which source line this opcode belongs.
- /// </summary>
- public void Mark (Location loc)
- {
- if (!Location.IsNull (loc)) {
- ISymbolDocumentWriter doc = loc.SymbolDocument;
-
- if (doc != null)
- ig.MarkSequencePoint (doc, loc.Row, 0, loc.Row, 0);
- } }
-
-
- /// <summary>
- /// Returns a temporary storage for a variable of type t as
- /// a local variable in the current body.
- /// </summary>
- public LocalBuilder GetTemporaryStorage (Type t)
- {
- LocalBuilder location;
-
- if (temporary_storage != null){
- location = (LocalBuilder) temporary_storage [t];
- if (location != null)
- return location;
- }
-
- location = ig.DeclareLocal (t);
-
- return location;
- }
-
- public void FreeTemporaryStorage (LocalBuilder b)
- {
- // Empty for now.
- }
-
- /// <summary>
- /// Current loop begin and end labels.
- /// </summary>
- public Label LoopBegin, LoopEnd;
-
- /// <summary>
- /// Whether we are inside a loop and break/continue are possible.
- /// </summary>
- public bool InLoop;
-
- /// <summary>
- /// Default target in a switch statement. Only valid if
- /// InSwitch is true
- /// </summary>
- public Label DefaultTarget;
-
- /// <summary>
- /// If this is non-null, points to the current switch statement
- /// </summary>
- public Switch Switch;
-
- /// <summary>
- /// ReturnValue creates on demand the LocalBuilder for the
- /// return value from the function. By default this is not
- /// used. This is only required when returns are found inside
- /// Try or Catch statements.
- /// </summary>
- public LocalBuilder TemporaryReturn ()
- {
- if (return_value == null){
- return_value = ig.DeclareLocal (ReturnType);
- ReturnLabel = ig.DefineLabel ();
- }
-
- return return_value;
- }
-
- /// <summary>
- /// A dynamic This that is shared by all variables in a emitcontext.
- /// Created on demand.
- /// </summary>
- public Expression my_this;
- public Expression This {
- get {
- if (my_this == null)
- my_this = new This (loc).Resolve (this);
-
- return my_this;
- }
- }
- }
-}
diff --git a/mcs/mbas/const.cs b/mcs/mbas/const.cs
deleted file mode 100644
index aba1d6b531b..00000000000
--- a/mcs/mbas/const.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// const.cs: Constant declarations.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-
-//
-// This is needed because the following situation arises:
-//
-// The FieldBuilder is declared with the real type for an enumeration
-//
-// When we attempt to set the value for the constant, the FieldBuilder.SetConstant
-// function aborts because it requires its argument to be of the same type
-//
-
-namespace Mono.CSharp {
-
- using System;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Collections;
-
- public class Const : MemberCore {
- public readonly string ConstantType;
- public Expression Expr;
- public Attributes OptAttributes;
- public FieldBuilder FieldBuilder;
-
- object ConstantValue = null;
- Type type;
-
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE;
-
- public Const (string constant_type, string name, Expression expr, int mod_flags,
- Attributes attrs, Location loc)
- : base (name, loc)
- {
- ConstantType = constant_type;
- Name = name;
- Expr = expr;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
- OptAttributes = attrs;
- }
-
- public FieldAttributes FieldAttr {
- get {
- return FieldAttributes.Literal | FieldAttributes.Static |
- Modifiers.FieldAttr (ModFlags) ;
- }
- }
-
-#if DEBUG
- void dump_tree (Type t)
- {
- Console.WriteLine ("Dumping hierarchy");
- while (t != null){
- Console.WriteLine (" " + t.FullName + " " +
- (t.GetType ().IsEnum ? "yes" : "no"));
- t = t.BaseType;
- }
- }
-#endif
-
- /// <summary>
- /// Defines the constant in the @parent
- /// </summary>
- public override bool Define (TypeContainer parent)
- {
- type = RootContext.LookupType (parent, ConstantType, true, Location);
-
- if (type == null)
- return false;
-
- if (!TypeManager.IsBuiltinType (type) &&
- (!type.IsSubclassOf (TypeManager.enum_type))) {
- Report.Error (
- -3, Location,
- "Constant type is not valid (only system types are allowed)");
- return false;
- }
-
- Type ptype = parent.TypeBuilder.BaseType;
-
- if (ptype != null) {
- MemberInfo [] mi = TypeContainer.FindMembers (
- ptype, MemberTypes.Field, BindingFlags.Public,
- Type.FilterName, Name);
-
- if (mi == null || mi.Length == 0)
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- } else if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- FieldBuilder = parent.TypeBuilder.DefineField (Name, type, FieldAttr);
-
- TypeManager.RegisterConstant (FieldBuilder, this);
-
- return true;
- }
-
- /// <summary>
- /// Looks up the value of a constant field. Defines it if it hasn't
- /// already been. Similar to LookupEnumValue in spirit.
- /// </summary>
- public object LookupConstantValue (EmitContext ec)
- {
- if (ConstantValue != null)
- return ConstantValue;
-
- Expr = Expr.Resolve (ec);
-
- if (Expr == null) {
- Report.Error (150, Location, "A constant value is expected");
- return null;
- }
-
- if (!(Expr is Constant)) {
- Report.Error (150, Location, "A constant value is expected");
- return null;
- }
-
- ConstantValue = ((Constant) Expr).GetValue ();
-
- if (type != Expr.Type) {
- try {
- ConstantValue = TypeManager.ChangeType (ConstantValue, type);
- } catch {
- Expression.Error_CannotConvertImplicit (Location, Expr.Type, type);
- return null;
- }
-
- if (type == TypeManager.int32_type)
- Expr = new IntConstant ((int) ConstantValue);
- else if (type == TypeManager.uint32_type)
- Expr = new UIntConstant ((uint) ConstantValue);
- else if (type == TypeManager.int64_type)
- Expr = new LongConstant ((long) ConstantValue);
- else if (type == TypeManager.uint64_type)
- Expr = new ULongConstant ((ulong) ConstantValue);
- else if (type == TypeManager.float_type)
- Expr = new FloatConstant ((float) ConstantValue);
- else if (type == TypeManager.double_type)
- Expr = new DoubleConstant ((double) ConstantValue);
- else if (type == TypeManager.string_type)
- Expr = new StringConstant ((string) ConstantValue);
- else if (type == TypeManager.short_type)
- Expr = new ShortConstant ((short) ConstantValue);
- else if (type == TypeManager.ushort_type)
- Expr = new UShortConstant ((ushort) ConstantValue);
- else if (type == TypeManager.sbyte_type)
- Expr = new SByteConstant ((sbyte) ConstantValue);
- else if (type == TypeManager.byte_type)
- Expr = new ByteConstant ((byte) ConstantValue);
- else if (type == TypeManager.char_type)
- Expr = new CharConstant ((char) ConstantValue);
- else if (type == TypeManager.bool_type)
- Expr = new BoolConstant ((bool) ConstantValue);
- }
-
- if (type.IsEnum){
- //
- // This sadly does not work for our user-defined enumerations types ;-(
- //
- try {
- ConstantValue = System.Enum.ToObject (
- type, ConstantValue);
- } catch (ArgumentException){
- Report.Error (
- -16, Location,
- ".NET SDK 1.0 does not permit to create the constant "+
- " field from a user-defined enumeration");
- }
- }
-
- FieldBuilder.SetConstant (ConstantValue);
-
- if (!TypeManager.RegisterFieldValue (FieldBuilder, ConstantValue))
- return null;
-
- return ConstantValue;
- }
-
-
- /// <summary>
- /// Emits the field value by evaluating the expression
- /// </summary>
- public void EmitConstant (TypeContainer parent)
- {
- EmitContext ec = new EmitContext (parent, Location, null, type, ModFlags);
- LookupConstantValue (ec);
-
- return;
- }
- }
-}
-
-
diff --git a/mcs/mbas/constant.cs b/mcs/mbas/constant.cs
deleted file mode 100644
index 2bfdfc031f5..00000000000
--- a/mcs/mbas/constant.cs
+++ /dev/null
@@ -1,969 +0,0 @@
-//
-// constant.cs: Constants.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-
-namespace Mono.CSharp {
-
- using System;
- using System.Reflection.Emit;
-
- /// <summary>
- /// Base class for constants and literals.
- /// </summary>
- public abstract class Constant : Expression {
- /// <remarks>
- /// This is different from ToString in that ToString
- /// is supposed to be there for debugging purposes,
- /// and is not guaranteed to be useful for anything else,
- /// AsString() will provide something that can be used
- /// for round-tripping C# code. Maybe it can be used
- /// for IL assembly as well.
- /// </remarks>
- public abstract string AsString ();
-
- override public string ToString ()
- {
- return this.GetType ().Name + " (" + AsString () + ")";
- }
-
- /// <summary>
- /// This is used to obtain the actual value of the literal
- /// cast into an object.
- /// </summary>
- public abstract object GetValue ();
-
- /// <summary>
- /// Constants are always born in a fully resolved state
- /// </summary>
- public override Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- //
- // The various ToXXXX conversion functions are used by the constant
- // folding evaluator. A null value is returned if the conversion is
- // not possible.
- //
- // Note: not all the patterns for catching `implicit_conv' are the same.
- // some implicit conversions can never be performed between two types
- // even if the conversion would be lossless (for example short to uint),
- // but some conversions are explicitly permitted by the standard provided
- // that there will be no loss of information (for example, int to uint).
- //
- public DoubleConstant ToDouble (Location loc)
- {
- DoubleConstant c = ConvertToDouble ();
-
- if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.double_type);
-
- return c;
- }
-
- public FloatConstant ToFloat (Location loc)
- {
- FloatConstant c = ConvertToFloat ();
-
- if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.float_type);
-
- return c;
- }
-
- public ULongConstant ToULong (Location loc)
- {
- ULongConstant c = ConvertToULong ();
-
- if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.uint64_type);
-
- return c;
- }
-
- public LongConstant ToLong (Location loc)
- {
- LongConstant c = ConvertToLong ();
-
- if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.int64_type);
-
- return c;
- }
-
- public UIntConstant ToUInt (Location loc)
- {
- UIntConstant c = ConvertToUInt ();
-
- if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.uint32_type);
-
- return c;
- }
-
- public IntConstant ToInt (Location loc)
- {
- IntConstant c = ConvertToInt ();
-
- if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.int32_type);
-
- return c;
- }
-
- public virtual DoubleConstant ConvertToDouble ()
- {
- return null;
- }
-
- public virtual FloatConstant ConvertToFloat ()
- {
- return null;
- }
-
- public virtual ULongConstant ConvertToULong ()
- {
- return null;
- }
-
- public virtual LongConstant ConvertToLong ()
- {
- return null;
- }
-
- public virtual UIntConstant ConvertToUInt ()
- {
- return null;
- }
-
- public virtual IntConstant ConvertToInt ()
- {
- return null;
- }
- }
-
- public class BoolConstant : Constant {
- public readonly bool Value;
-
- public BoolConstant (bool val)
- {
- type = TypeManager.bool_type;
- eclass = ExprClass.Value;
-
- Value = val;
- }
-
- override public string AsString ()
- {
- return Value ? "true" : "false";
- }
-
- public override object GetValue ()
- {
- return (object) Value;
- }
-
-
- public override void Emit (EmitContext ec)
- {
- if (Value)
- ec.ig.Emit (OpCodes.Ldc_I4_1);
- else
- ec.ig.Emit (OpCodes.Ldc_I4_0);
- }
- }
-
- public class ByteConstant : Constant {
- public readonly byte Value;
-
- public ByteConstant (byte v)
- {
- type = TypeManager.byte_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return new ULongConstant (Value);
- }
-
- public override LongConstant ConvertToLong ()
- {
- return new LongConstant (Value);
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return new UIntConstant (Value);
- }
-
- public override IntConstant ConvertToInt ()
- {
- return new IntConstant (Value);
- }
- }
-
- public class CharConstant : Constant {
- public readonly char Value;
-
- public CharConstant (char v)
- {
- type = TypeManager.char_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- static public string descape (char c)
- {
- switch (c){
- case '\a':
- return "\\a";
- case '\b':
- return "\\b";
- case '\n':
- return "\\n";
- case '\t':
- return "\\t";
- case '\v':
- return "\\v";
- case '\r':
- return "\\r";
- case '\\':
- return "\\\\";
- case '\f':
- return "\\f";
- case '\0':
- return "\\0";
- case '"':
- return "\\\"";
- case '\'':
- return "\\\'";
- }
- return c.ToString ();
- }
-
- public override string AsString ()
- {
- return "\"" + descape (Value) + "\"";
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return new ULongConstant (Value);
- }
-
- public override LongConstant ConvertToLong ()
- {
- return new LongConstant (Value);
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return new UIntConstant (Value);
- }
-
- public override IntConstant ConvertToInt ()
- {
- return new IntConstant (Value);
- }
- }
-
- public class SByteConstant : Constant {
- public readonly sbyte Value;
-
- public SByteConstant (sbyte v)
- {
- type = TypeManager.sbyte_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- if (Value >= 0)
- return new ULongConstant ((ulong) Value);
-
- return null;
- }
-
- public override LongConstant ConvertToLong ()
- {
- return new LongConstant (Value);
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return null;
- }
-
- public override IntConstant ConvertToInt ()
- {
- return new IntConstant (Value);
- }
- }
-
- public class ShortConstant : Constant {
- public readonly short Value;
-
- public ShortConstant (short v)
- {
- type = TypeManager.short_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return null;
- }
-
- public override LongConstant ConvertToLong ()
- {
- return new LongConstant (Value);
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return null;
- }
-
- public override IntConstant ConvertToInt ()
- {
- return new IntConstant (Value);
- }
- }
-
- public class UShortConstant : Constant {
- public readonly ushort Value;
-
- public UShortConstant (ushort v)
- {
- type = TypeManager.ushort_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return new ULongConstant (Value);
- }
-
- public override LongConstant ConvertToLong ()
- {
- return new LongConstant (Value);
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return new UIntConstant (Value);
- }
-
- public override IntConstant ConvertToInt ()
- {
- return new IntConstant (Value);
- }
- }
-
- public class IntConstant : Constant {
- public readonly int Value;
-
- public IntConstant (int v)
- {
- type = TypeManager.int32_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- static public void EmitInt (ILGenerator ig, int i)
- {
- switch (i){
- case -1:
- ig.Emit (OpCodes.Ldc_I4_M1);
- break;
-
- case 0:
- ig.Emit (OpCodes.Ldc_I4_0);
- break;
-
- case 1:
- ig.Emit (OpCodes.Ldc_I4_1);
- break;
-
- case 2:
- ig.Emit (OpCodes.Ldc_I4_2);
- break;
-
- case 3:
- ig.Emit (OpCodes.Ldc_I4_3);
- break;
-
- case 4:
- ig.Emit (OpCodes.Ldc_I4_4);
- break;
-
- case 5:
- ig.Emit (OpCodes.Ldc_I4_5);
- break;
-
- case 6:
- ig.Emit (OpCodes.Ldc_I4_6);
- break;
-
- case 7:
- ig.Emit (OpCodes.Ldc_I4_7);
- break;
-
- case 8:
- ig.Emit (OpCodes.Ldc_I4_8);
- break;
-
- default:
- if (i >= -128 && i <= 127){
- ig.Emit (OpCodes.Ldc_I4_S, (sbyte) i);
- } else
- ig.Emit (OpCodes.Ldc_I4, i);
- break;
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- EmitInt (ec.ig, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- if (Value < 0)
- return null;
-
- return new ULongConstant ((ulong) Value);
- }
-
- public override LongConstant ConvertToLong ()
- {
- return new LongConstant (Value);
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- if (Value < 0)
- return null;
-
- return new UIntConstant ((uint) Value);
- }
-
- public override IntConstant ConvertToInt ()
- {
- return this;
- }
- }
-
- public class UIntConstant : Constant {
- public readonly uint Value;
-
- public UIntConstant (uint v)
- {
- type = TypeManager.uint32_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- IntLiteral.EmitInt (ec.ig, unchecked ((int) Value));
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return new ULongConstant (Value);
- }
-
- public override LongConstant ConvertToLong ()
- {
- return new LongConstant (Value);
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return this;
- }
-
- public override IntConstant ConvertToInt ()
- {
- return null;
- }
- }
-
- public class LongConstant : Constant {
- public readonly long Value;
-
- public LongConstant (long v)
- {
- type = TypeManager.int64_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- EmitLong (ig, Value);
- }
-
- static public void EmitLong (ILGenerator ig, long l)
- {
- ig.Emit (OpCodes.Ldc_I8, l);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- if (Value < 0)
- return null;
-
- return new ULongConstant ((ulong) Value);
- }
-
- public override LongConstant ConvertToLong ()
- {
- return this;
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return null;
- }
-
- public override IntConstant ConvertToInt ()
- {
- return null;
- }
- }
-
- public class ULongConstant : Constant {
- public readonly ulong Value;
-
- public ULongConstant (ulong v)
- {
- type = TypeManager.uint64_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- LongLiteral.EmitLong (ig, unchecked ((long) Value));
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return new FloatConstant (Value);
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return this;
- }
-
- public override LongConstant ConvertToLong ()
- {
- return null;
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return null;
- }
-
- public override IntConstant ConvertToInt ()
- {
- return null;
- }
- }
-
- public class FloatConstant : Constant {
- public readonly float Value;
-
- public FloatConstant (float v)
- {
- type = TypeManager.float_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldc_R4, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return new DoubleConstant (Value);
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return this;
- }
-
- public override LongConstant ConvertToLong ()
- {
- return null;
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return null;
- }
-
- public override IntConstant ConvertToInt ()
- {
- return null;
- }
- }
-
- public class DoubleConstant : Constant {
- public readonly double Value;
-
- public DoubleConstant (double v)
- {
- type = TypeManager.double_type;
- eclass = ExprClass.Value;
- Value = v;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldc_R8, Value);
- }
-
- public override string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return this;
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return null;
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return null;
- }
-
- public override LongConstant ConvertToLong ()
- {
- return null;
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return null;
- }
-
- public override IntConstant ConvertToInt ()
- {
- return null;
- }
- }
-
- public class DecimalConstant : Constant {
- public readonly decimal Value;
-
- public DecimalConstant (decimal d)
- {
- type = TypeManager.decimal_type;
- eclass = ExprClass.Value;
- Value = d;
- }
-
- override public string AsString ()
- {
- return Value.ToString ();
- }
-
- public override object GetValue ()
- {
- return (object) Value;
- }
-
- public override void Emit (EmitContext ec)
- {
- int [] words = Decimal.GetBits (Value);
-
- //
- // FIXME: we could optimize this, and call a better
- // constructor
- //
-
- ILGenerator ig = ec.ig;
-
- IntConstant.EmitInt (ig, words [0]);
- IntConstant.EmitInt (ig, words [1]);
- IntConstant.EmitInt (ig, words [2]);
-
- // sign
- IntConstant.EmitInt (ig, words [3] >> 31);
-
- // power
- IntConstant.EmitInt (ig, (words [3] >> 16) & 0xff);
-
- ig.Emit (OpCodes.Newobj, TypeManager.void_decimal_ctor_five_args);
- }
- }
-
- public class StringConstant : Constant {
- public readonly string Value;
-
- public StringConstant (string s)
- {
- type = TypeManager.string_type;
- eclass = ExprClass.Value;
- Value = s;
- }
-
- // FIXME: Escape the string.
- override public string AsString ()
- {
- return "\"" + Value + "\"";
- }
-
- public override object GetValue ()
- {
- return Value;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldstr, Value);
- }
- }
-
-}
-
-
diff --git a/mcs/mbas/decl.cs b/mcs/mbas/decl.cs
deleted file mode 100644
index 8e3377acb45..00000000000
--- a/mcs/mbas/decl.cs
+++ /dev/null
@@ -1,484 +0,0 @@
-//
-// decl.cs: Declaration base class for structs, classes, enums and interfaces.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-// TODO: Move the method verification stuff from the class.cs and interface.cs here
-//
-
-using System;
-using System.Collections;
-using System.Reflection.Emit;
-using System.Reflection;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Base representation for members. This is only used to keep track
- /// of Name, Location and Modifier flags.
- /// </summary>
- public abstract class MemberCore {
- /// <summary>
- /// Public name
- /// </summary>
- public string Name;
-
- /// <summary>
- /// Modifier flags that the user specified in the source code
- /// </summary>
- public int ModFlags;
-
- /// <summary>
- /// Location where this declaration happens
- /// </summary>
- public readonly Location Location;
-
- public MemberCore (string name, Location loc)
- {
- Name = name;
- Location = loc;
- }
-
- protected void WarningNotHiding (TypeContainer parent)
- {
- Report.Warning (
- 109, Location,
- "The member `" + parent.Name + "." + Name + "' does not hide an " +
- "inherited member. The keyword new is not required");
-
- }
-
- static string MethodBaseName (MethodBase mb)
- {
- return "`" + mb.ReflectedType.Name + "." + mb.Name + "'";
- }
-
- void Error_CannotChangeAccessModifiers (TypeContainer parent, MethodInfo parent_method)
- {
- //
- // FIXME: report the old/new permissions?
- //
- Report.Error (
- 507, "`" + parent_method + "." + Name +
- ": can't change the access modifiers from `" +
- parent_method.DeclaringType.Name + "." + parent_method.Name + "'");
- }
-
- //
- // Performs various checks on the MethodInfo `mb' regarding the modifier flags
- // that have been defined.
- //
- // `name' is the user visible name for reporting errors (this is used to
- // provide the right name regarding method names and properties)
- //
- protected bool CheckMethodAgainstBase (TypeContainer parent,
- MethodAttributes my_attrs, MethodInfo mb)
- {
- bool ok = true;
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- if (!(mb.IsAbstract || mb.IsVirtual)){
- Report.Error (
- 506, Location, parent.MakeName (Name) +
- ": cannot override inherited member " +
- MethodBaseName (mb) + " because it is not " +
- "virtual, abstract or override");
- ok = false;
- }
-
- // Now we check that the overriden method is not final
-
- if (mb.IsFinal) {
- Report.Error (239, Location, parent.MakeName (Name) + " : cannot " +
- "override inherited member " + MethodBaseName (mb) +
- " because it is sealed.");
- ok = false;
- }
-
- //
- // Check that the permissions are not being changed
- //
- MethodAttributes thisp = my_attrs & MethodAttributes.MemberAccessMask;
- MethodAttributes parentp = mb.Attributes & MethodAttributes.MemberAccessMask;
-
- if (thisp != parentp){
- Error_CannotChangeAccessModifiers (parent, mb);
- ok = false;
- }
- }
-
- if (mb.IsVirtual || mb.IsAbstract){
- if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
- if (Name != "Finalize" && (RootContext.WarningLevel >= 2)){
- Report.Warning (
- 114, Location, parent.MakeName (Name) +
- " hides inherited member " + MethodBaseName (mb) +
- ". To make the current member override that " +
- "implementation, add the override keyword, " +
- "otherwise use the new keyword");
- }
- }
- }
-
- return ok;
- }
-
- public abstract bool Define (TypeContainer parent);
-
- //
- // Whehter is it ok to use an unsafe pointer in this type container
- //
- public bool UnsafeOK (DeclSpace parent)
- {
- //
- // First check if this MemberCore modifier flags has unsafe set
- //
- if ((ModFlags & Modifiers.UNSAFE) != 0)
- return true;
-
- if (parent.UnsafeContext)
- return true;
-
- Expression.UnsafeError (Location);
- return false;
- }
- }
-
- //
- // FIXME: This is temporary outside DeclSpace, because I have to fix a bug
- // in MCS that makes it fail the lookup for the enum
- //
-
- /// <summary>
- /// The result value from adding an declaration into
- /// a struct or a class
- /// </summary>
- public enum AdditionResult {
- /// <summary>
- /// The declaration has been successfully
- /// added to the declation space.
- /// </summary>
- Success,
-
- /// <summary>
- /// The symbol has already been defined.
- /// </summary>
- NameExists,
-
- /// <summary>
- /// Returned if the declation being added to the
- /// name space clashes with its container name.
- ///
- /// The only exceptions for this are constructors
- /// and static constructors
- /// </summary>
- EnclosingClash,
-
- /// <summary>
- /// Returned if a constructor was created (because syntactically
- /// it looked like a constructor) but was not (because the name
- /// of the method is not the same as the container class
- /// </summary>
- NotAConstructor,
-
- /// <summary>
- /// This is only used by static constructors to emit the
- /// error 111, but this error for other things really
- /// happens at another level for other functions.
- /// </summary>
- MethodExists
- }
-
- /// <summary>
- /// Base class for structs, classes, enumerations and interfaces.
- /// </summary>
- /// <remarks>
- /// They all create new declaration spaces. This
- /// provides the common foundation for managing those name
- /// spaces.
- /// </remarks>
- public abstract class DeclSpace : MemberCore {
- /// <summary>
- /// this points to the actual definition that is being
- /// created with System.Reflection.Emit
- /// </summary>
- public TypeBuilder TypeBuilder;
-
- /// <summary>
- /// This variable tracks whether we have Closed the type
- /// </summary>
- public bool Created = false;
-
- //
- // This is the namespace in which this typecontainer
- // was declared. We use this to resolve names.
- //
- public Namespace Namespace;
-
- public Hashtable Cache = new Hashtable ();
-
- public string Basename;
-
- /// <summary>
- /// defined_names is used for toplevel objects
- /// </summary>
- protected Hashtable defined_names;
-
- TypeContainer parent;
-
- public DeclSpace (TypeContainer parent, string name, Location l)
- : base (name, l)
- {
- Basename = name.Substring (1 + name.LastIndexOf ('.'));
- defined_names = new Hashtable ();
- this.parent = parent;
- }
-
- /// <summary>
- /// Returns a status code based purely on the name
- /// of the member being added
- /// </summary>
- protected AdditionResult IsValid (string name)
- {
- if (name == Basename)
- return AdditionResult.EnclosingClash;
-
- if (defined_names.Contains (name))
- return AdditionResult.NameExists;
-
- return AdditionResult.Success;
- }
-
- /// <summary>
- /// Introduce @name into this declaration space and
- /// associates it with the object @o. Note that for
- /// methods this will just point to the first method. o
- /// </summary>
- protected void DefineName (string name, object o)
- {
- defined_names.Add (name, o);
- }
-
- /// <summary>
- /// Returns the object associated with a given name in the declaration
- /// space. This is the inverse operation of `DefineName'
- /// </summary>
- public object GetDefinition (string name)
- {
- return defined_names [name];
- }
-
- bool in_transit = false;
-
- /// <summary>
- /// This function is used to catch recursive definitions
- /// in declarations.
- /// </summary>
- public bool InTransit {
- get {
- return in_transit;
- }
-
- set {
- in_transit = value;
- }
- }
-
- public TypeContainer Parent {
- get {
- return parent;
- }
- }
-
- //
- // root_types contains all the types. All TopLevel types
- // hence have a parent that points to `root_types', that is
- // why there is a non-obvious test down here.
- //
- public bool IsTopLevel {
- get {
- if (parent != null){
- if (parent.parent == null)
- return true;
- }
- return false;
- }
- }
-
- public virtual void CloseType ()
- {
- if (!Created){
- try {
- TypeBuilder.CreateType ();
- } catch {
- //
- // The try/catch is needed because
- // nested enumerations fail to load when they
- // are defined.
- //
- // Even if this is the right order (enumerations
- // declared after types).
- //
- // Note that this still creates the type and
- // it is possible to save it
- }
- Created = true;
- }
- }
-
- /// <remarks>
- /// Should be overriten by the appropriate declaration space
- /// <remarks>
- public abstract TypeBuilder DefineType ();
-
- //
- // Whether this is an `unsafe context'
- //
- public bool UnsafeContext {
- get {
- if ((ModFlags & Modifiers.UNSAFE) != 0)
- return true;
- if (parent != null)
- return parent.UnsafeContext;
- return false;
- }
- }
-
- public static string MakeFQN (string nsn, string name)
- {
- string prefix = (nsn == "" ? "" : nsn + ".");
-
- return prefix + name;
- }
-
- Type LookupInterfaceOrClass (string ns, string name, out bool error)
- {
- DeclSpace parent;
- Type t;
-
- error = false;
- name = MakeFQN (ns, name);
-
- t = TypeManager.LookupType (name);
- if (t != null)
- return t;
-
- parent = (DeclSpace) RootContext.Tree.Decls [name];
- if (parent == null)
- return null;
-
- t = parent.DefineType ();
- if (t == null){
- Report.Error (146, "Class definition is circular: `"+name+"'");
- error = true;
- return null;
- }
- return t;
- }
-
- /// <summary>
- /// GetType is used to resolve type names at the DeclSpace level.
- /// Use this to lookup class/struct bases, interface bases or
- /// delegate type references
- /// </summary>
- ///
- /// <remarks>
- /// Contrast this to LookupType which is used inside method bodies to
- /// lookup types that have already been defined. GetType is used
- /// during the tree resolution process and potentially define
- /// recursively the type
- /// </remarks>
- public Type FindType (string name)
- {
- Type t;
- bool error;
-
- //
- // For the case the type we are looking for is nested within this one
- // or is in any base class
- //
- DeclSpace containing_ds = this;
-
- while (containing_ds != null){
- Type current_type = containing_ds.TypeBuilder;
-
- while (current_type != null) {
- string pre = current_type.FullName;
-
- t = LookupInterfaceOrClass (pre, name, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
-
- current_type = current_type.BaseType;
- }
- containing_ds = containing_ds.Parent;
- }
-
- //
- // Attempt to lookup the class on our namespace and all it's implicit parents
- //
- for (string ns = Namespace.Name; ns != null; ns = RootContext.ImplicitParent (ns)) {
-
- t = LookupInterfaceOrClass (ns, name, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
- }
-
- //
- // Attempt to do a direct unqualified lookup
- //
- t = LookupInterfaceOrClass ("", name, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
-
- //
- // Attempt to lookup the class on any of the `using'
- // namespaces
- //
-
- for (Namespace ns = Namespace; ns != null; ns = ns.Parent){
-
- t = LookupInterfaceOrClass (ns.Name, name, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
-
- //
- // Now check the using clause list
- //
- ArrayList using_list = ns.UsingTable;
-
- if (using_list == null)
- continue;
-
- foreach (string n in using_list){
- t = LookupInterfaceOrClass (n, name, out error);
- if (error)
- return null;
-
- if (t != null)
- return t;
- }
-
- }
-
- Report.Error (246, Location, "Can not find type `"+name+"'");
- return null;
- }
- }
-}
diff --git a/mcs/mbas/delegate.cs b/mcs/mbas/delegate.cs
deleted file mode 100644
index a53c81a8494..00000000000
--- a/mcs/mbas/delegate.cs
+++ /dev/null
@@ -1,717 +0,0 @@
-//
-// delegate.cs: Delegate Handler
-//
-// Author: Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Text;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Holds Delegates
- /// </summary>
- public class Delegate : DeclSpace {
- public readonly string ReturnType;
- public Parameters Parameters;
- public Attributes OptAttributes;
-
- public ConstructorBuilder ConstructorBuilder;
- public MethodBuilder InvokeBuilder;
- public MethodBuilder BeginInvokeBuilder;
- public MethodBuilder EndInvokeBuilder;
-
- Type [] param_types;
- Type ret_type;
-
- Expression instance_expr;
- MethodBase delegate_method;
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- public Delegate (TypeContainer parent, string type, int mod_flags,
- string name, Parameters param_list,
- Attributes attrs, Location l)
- : base (parent, name, l)
- {
- this.ReturnType = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC, l);
- Parameters = param_list;
- OptAttributes = attrs;
- }
-
- public override TypeBuilder DefineType ()
- {
- TypeAttributes attr;
-
- if (TypeBuilder != null)
- return TypeBuilder;
-
- if (IsTopLevel) {
- ModuleBuilder builder = CodeGen.ModuleBuilder;
- attr = TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.Sealed;
-
- TypeBuilder = builder.DefineType (
- Name, attr, TypeManager.multicast_delegate_type);
- } else {
- TypeBuilder builder = Parent.TypeBuilder;
- attr = TypeAttributes.NestedPublic | TypeAttributes.Class |
- TypeAttributes.Sealed;
-
- string name = Name.Substring (1 + Name.LastIndexOf ('.'));
- TypeBuilder = builder.DefineNestedType (
- name, attr, TypeManager.multicast_delegate_type);
- }
-
- TypeManager.AddDelegateType (Name, TypeBuilder, this);
-
- return TypeBuilder;
- }
-
- public override bool Define (TypeContainer parent)
- {
- MethodAttributes mattr;
- int i;
-
- // FIXME: POSSIBLY make this static, as it is always constant
- //
- Type [] const_arg_types = new Type [2];
- const_arg_types [0] = TypeManager.object_type;
- const_arg_types [1] = TypeManager.intptr_type;
-
- mattr = MethodAttributes.RTSpecialName | MethodAttributes.SpecialName |
- MethodAttributes.HideBySig | MethodAttributes.Public;
-
- ConstructorBuilder = TypeBuilder.DefineConstructor (mattr,
- CallingConventions.Standard,
- const_arg_types);
-
- ConstructorBuilder.DefineParameter (1, ParameterAttributes.None, "object");
- ConstructorBuilder.DefineParameter (2, ParameterAttributes.None, "method");
- //
- // HACK because System.Reflection.Emit is lame
- //
- //
- // FIXME: POSSIBLY make these static, as they are always the same
- Parameter [] fixed_pars = new Parameter [2];
- fixed_pars [0] = new Parameter (null, null, Parameter.Modifier.NONE, null);
- fixed_pars [1] = new Parameter (null, null, Parameter.Modifier.NONE, null);
- Parameters const_parameters = new Parameters (fixed_pars, null, Location);
-
- TypeManager.RegisterMethod (
- ConstructorBuilder,
- new InternalParameters (const_arg_types, const_parameters),
- const_arg_types);
-
-
- ConstructorBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- //
- // Here the various methods like Invoke, BeginInvoke etc are defined
- //
- // First, call the `out of band' special method for
- // defining recursively any types we need:
-
- if (!Parameters.ComputeAndDefineParameterTypes (this))
- return false;
-
- param_types = Parameters.GetParameterInfo (this);
- if (param_types == null)
- return false;
-
- //
- // Invoke method
- //
-
- // Check accessibility
- foreach (Type partype in param_types)
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- return false;
-
- ret_type = FindType (ReturnType);
- if (ret_type == null)
- return false;
-
- if (!TypeContainer.AsAccessible (ret_type, ModFlags))
- return false;
-
- //
- // We don't have to check any others because they are all
- // guaranteed to be accessible - they are standard types.
- //
-
- CallingConventions cc = Parameters.GetCallingConvention ();
-
- mattr = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual;
-
- InvokeBuilder = TypeBuilder.DefineMethod ("Invoke",
- mattr,
- cc,
- ret_type,
- param_types);
-
- i = 0;
- if (Parameters.FixedParameters != null){
- int top = Parameters.FixedParameters.Length;
- Parameter p;
-
- for (; i < top; i++) {
- p = Parameters.FixedParameters [i];
-
- InvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- }
- }
- if (Parameters.ArrayParameter != null){
- Parameter p = Parameters.ArrayParameter;
-
- InvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- }
-
- InvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- TypeManager.RegisterMethod (InvokeBuilder,
- new InternalParameters (parent, Parameters),
- param_types);
-
- //
- // BeginInvoke
- //
- int params_num = param_types.Length;
- Type [] async_param_types = new Type [params_num + 2];
-
- param_types.CopyTo (async_param_types, 0);
-
- async_param_types [params_num] = TypeManager.asynccallback_type;
- async_param_types [params_num + 1] = TypeManager.object_type;
-
- mattr = MethodAttributes.Public | MethodAttributes.HideBySig |
- MethodAttributes.Virtual | MethodAttributes.NewSlot;
-
- BeginInvokeBuilder = TypeBuilder.DefineMethod ("BeginInvoke",
- mattr,
- cc,
- TypeManager.iasyncresult_type,
- async_param_types);
-
- i = 0;
- if (Parameters.FixedParameters != null){
- int top = Parameters.FixedParameters.Length;
- Parameter p;
-
- for (i = 0 ; i < top; i++) {
- p = Parameters.FixedParameters [i];
-
- BeginInvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- }
- }
- if (Parameters.ArrayParameter != null){
- Parameter p = Parameters.ArrayParameter;
-
- BeginInvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- i++;
- }
-
- BeginInvokeBuilder.DefineParameter (i + 1, ParameterAttributes.None, "callback");
- BeginInvokeBuilder.DefineParameter (i + 2, ParameterAttributes.None, "object");
-
- BeginInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- Parameter [] async_params = new Parameter [params_num + 2];
- int n = 0;
- if (Parameters.FixedParameters != null){
- Parameters.FixedParameters.CopyTo (async_params, 0);
- n = Parameters.FixedParameters.Length;
- }
- if (Parameters.ArrayParameter != null)
- async_params [n] = Parameters.ArrayParameter;
-
- async_params [params_num] = new Parameter ("System.AsyncCallback", "callback",
- Parameter.Modifier.NONE, null);
- async_params [params_num + 1] = new Parameter ("System.Object", "object",
- Parameter.Modifier.NONE, null);
-
- Parameters async_parameters = new Parameters (async_params, null, Location);
-
- async_parameters.ComputeAndDefineParameterTypes (this);
- TypeManager.RegisterMethod (BeginInvokeBuilder,
- new InternalParameters (parent, async_parameters),
- async_param_types);
-
- //
- // EndInvoke
- //
- Type [] end_param_types = new Type [1];
- end_param_types [0] = TypeManager.iasyncresult_type;
-
- EndInvokeBuilder = TypeBuilder.DefineMethod ("EndInvoke",
- mattr,
- cc,
- ret_type,
- end_param_types);
- EndInvokeBuilder.DefineParameter (1, ParameterAttributes.None, "result");
-
- EndInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- Parameter [] end_params = new Parameter [1];
- end_params [0] = new Parameter ("System.IAsyncResult", "result",
- Parameter.Modifier.NONE, null);
-
- TypeManager.RegisterMethod (EndInvokeBuilder,
- new InternalParameters (
- parent,
- new Parameters (end_params, null, Location)),
- end_param_types);
-
- return true;
- }
-
- /// <summary>
- /// Verifies whether the method in question is compatible with the delegate
- /// Returns the method itself if okay and null if not.
- /// </summary>
- public static MethodBase VerifyMethod (EmitContext ec, Type delegate_type, MethodBase mb,
- Location loc)
- {
- ParameterData pd = Invocation.GetParameterData (mb);
-
- int pd_count = pd.Count;
-
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return null;
- }
-
- MethodBase invoke_mb = ((MethodGroupExpr) ml).Methods [0];
-
- ParameterData invoke_pd = Invocation.GetParameterData (invoke_mb);
-
- if (invoke_pd.Count != pd_count)
- return null;
-
- bool mismatch = false;
- for (int i = pd_count; i > 0; ) {
- i--;
-
- if (invoke_pd.ParameterType (i) == pd.ParameterType (i))
- continue;
- else {
- mismatch = true;
- break;
- }
- }
-
- if (mismatch) {
- Report.Error (
- 123, loc, "Method '" + Invocation.FullMethodDesc (mb) +
- "' does not match delegate '" +
- FullDelegateDesc (delegate_type, invoke_mb, invoke_pd) + "'");
- return null;
- }
-
- if (((MethodInfo) invoke_mb).ReturnType == ((MethodInfo) mb).ReturnType)
- return mb;
- else
- mismatch = true;
-
- if (mismatch) {
- Report.Error (123, loc, "Method '" + Invocation.FullMethodDesc (mb) +
- "' does not match delegate '" +
- FullDelegateDesc (delegate_type, invoke_mb, invoke_pd) + "'");
- return null;
- }
-
- return null;
- }
-
- // <summary>
- // Verifies whether the invocation arguments are compatible with the
- // delegate's target method
- // </summary>
- public static bool VerifyApplicability (EmitContext ec,
- Type delegate_type,
- ArrayList args,
- Location loc)
- {
- int arg_count;
-
- if (args == null)
- arg_count = 0;
- else
- arg_count = args.Count;
-
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
- ParameterData pd = Invocation.GetParameterData (mb);
-
- int pd_count = pd.Count;
-
- bool not_params_method = (pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS);
-
- if (not_params_method && pd_count != arg_count) {
- Report.Error (1593, loc,
- "Delegate '" + delegate_type.ToString ()
- + "' does not take '" + arg_count + "' arguments");
- return false;
- }
-
- return Invocation.VerifyArgumentsCompat (ec, args, arg_count, mb, !not_params_method,
- delegate_type, loc);
- }
-
- /// <summary>
- /// Verifies whether the delegate in question is compatible with this one in
- /// order to determine if instantiation from the same is possible.
- /// </summary>
- public static bool VerifyDelegate (EmitContext ec, Type delegate_type, Type probe_type, Location loc)
- {
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
- ParameterData pd = Invocation.GetParameterData (mb);
-
- Expression probe_ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(probe_ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase probe_mb = ((MethodGroupExpr) probe_ml).Methods [0];
- ParameterData probe_pd = Invocation.GetParameterData (probe_mb);
-
- if (((MethodInfo) mb).ReturnType != ((MethodInfo) probe_mb).ReturnType)
- return false;
-
- if (pd.Count != probe_pd.Count)
- return false;
-
- for (int i = pd.Count; i > 0; ) {
- i--;
-
- if (pd.ParameterType (i) != probe_pd.ParameterType (i) ||
- pd.ParameterModifier (i) != probe_pd.ParameterModifier (i))
- return false;
- }
-
- return true;
- }
-
- public static string FullDelegateDesc (Type del_type, MethodBase mb, ParameterData pd)
- {
- StringBuilder sb = new StringBuilder (TypeManager.CSharpName (((MethodInfo) mb).ReturnType));
-
- sb.Append (" " + del_type.ToString ());
- sb.Append (" (");
-
- int length = pd.Count;
-
- for (int i = length; i > 0; ) {
- i--;
-
- sb.Append (TypeManager.CSharpName (pd.ParameterType (length - i - 1)));
- if (i != 0)
- sb.Append (", ");
- }
-
- sb.Append (")");
- return sb.ToString ();
-
- }
-
- // Hack around System.Reflection as found everywhere else
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf, MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if ((mt & MemberTypes.Method) != 0) {
- if (filter (ConstructorBuilder, criteria))
- members.Add (ConstructorBuilder);
-
- if (filter (InvokeBuilder, criteria))
- members.Add (InvokeBuilder);
-
- if (filter (BeginInvokeBuilder, criteria))
- members.Add (BeginInvokeBuilder);
-
- if (filter (EndInvokeBuilder, criteria))
- members.Add (EndInvokeBuilder);
- }
-
- int count = members.Count;
-
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
- }
-
- return null;
- }
-
- public void CloseDelegate ()
- {
- TypeBuilder.CreateType ();
- }
-
- public Expression InstanceExpression {
- get {
- return instance_expr;
- }
- set {
- instance_expr = value;
- }
- }
-
- public MethodBase TargetMethod {
- get {
- return delegate_method;
- }
- set {
- delegate_method = value;
- }
- }
-
- public Type TargetReturnType {
- get {
- return ret_type;
- }
- }
-
- public Type [] ParameterTypes {
- get {
- return param_types;
- }
- }
-
- }
-
- public class NewDelegate : Expression {
-
- public ArrayList Arguments;
-
- MethodBase constructor_method;
- MethodBase delegate_method;
- Expression delegate_instance_expr;
-
- Location Location;
-
- public NewDelegate (Type type, ArrayList Arguments, Location loc)
- {
- this.type = type;
- this.Arguments = Arguments;
- this.Location = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- if (Arguments == null) {
- Report.Error (-11, Location,
- "Delegate creation expression takes only one argument");
- return null;
- }
-
- if (Arguments.Count != 1) {
- Report.Error (-11, Location,
- "Delegate creation expression takes only one argument");
- return null;
- }
-
- Expression ml = Expression.MemberLookup (
- ec, type, ".ctor", Location);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, Location, "Internal error : Could not find delegate constructor!");
- return null;
- }
-
- constructor_method = ((MethodGroupExpr) ml).Methods [0];
- Argument a = (Argument) Arguments [0];
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression e = a.Expr;
-
- if (e is MethodGroupExpr) {
- MethodGroupExpr mg = (MethodGroupExpr) e;
-
- foreach (MethodInfo mi in mg.Methods){
- delegate_method = Delegate.VerifyMethod (ec, type, mi, Location);
-
- if (delegate_method != null)
- break;
- }
-
- if (delegate_method == null) {
- Report.Error (-14, Location, "Ambiguous method reference in delegate creation");
- return null;
- }
-
- if (mg.InstanceExpression != null)
- delegate_instance_expr = mg.InstanceExpression.Resolve (ec);
- else {
- if (!ec.IsStatic)
- delegate_instance_expr = ec.This;
- else
- delegate_instance_expr = null;
- }
-
- if (delegate_instance_expr != null)
- if (delegate_instance_expr.Type.IsValueType)
- delegate_instance_expr = new BoxedCast (delegate_instance_expr);
-
- eclass = ExprClass.Value;
- return this;
- }
-
- Type e_type = e.Type;
-
- if (!TypeManager.IsDelegateType (e_type)) {
- Report.Error (-12, Location, "Cannot create a delegate from something " +
- "not a delegate or a method.");
- return null;
- }
-
- // This is what MS' compiler reports. We could always choose
- // to be more verbose and actually give delegate-level specifics
-
- if (!Delegate.VerifyDelegate (ec, type, e_type, Location)) {
- Report.Error (29, Location, "Cannot implicitly convert type '" + e_type + "' " +
- "to type '" + type + "'");
- return null;
- }
-
- Expression invoke_method = Expression.MemberLookup (
- ec, e_type, "Invoke", MemberTypes.Method,
- Expression.AllBindingFlags, Location);
-
- if (invoke_method == null) {
- Report.Error (-200, Location, "Internal error ! COuld not find Invoke method!");
- return null;
- }
-
- delegate_instance_expr = e;
- delegate_method = ((MethodGroupExpr) invoke_method).Methods [0];
-
- eclass = ExprClass.Value;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- if (delegate_instance_expr == null ||
- delegate_method.IsStatic)
- ec.ig.Emit (OpCodes.Ldnull);
- else
- delegate_instance_expr.Emit (ec);
-
- ec.ig.Emit (OpCodes.Ldftn, (MethodInfo) delegate_method);
- ec.ig.Emit (OpCodes.Newobj, (ConstructorInfo) constructor_method);
- }
- }
-
- public class DelegateInvocation : ExpressionStatement {
-
- public Expression InstanceExpr;
- public ArrayList Arguments;
- public Location Location;
-
- MethodBase method;
-
- public DelegateInvocation (Expression instance_expr, ArrayList args, Location loc)
- {
- this.InstanceExpr = instance_expr;
- this.Arguments = args;
- this.Location = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Type del_type = InstanceExpr.Type;
- if (del_type == null)
- return null;
-
- if (Arguments != null){
- foreach (Argument a in Arguments){
- if (!a.Resolve (ec, Location))
- return null;
- }
- }
-
- if (!Delegate.VerifyApplicability (ec, del_type, Arguments, Location))
- return null;
-
- Expression ml = Expression.MemberLookup (ec, del_type, "Invoke", Location);
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, Location, "Internal error : could not find Invoke method!");
- return null;
- }
-
- method = ((MethodGroupExpr) ml).Methods [0];
- type = ((MethodInfo) method).ReturnType;
- eclass = ExprClass.Value;
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Delegate del = TypeManager.LookupDelegate (InstanceExpr.Type);
-
- //
- // Invocation on delegates call the virtual Invoke member
- // so we are always `instance' calls
- //
- Invocation.EmitCall (ec, false, false, InstanceExpr, method, Arguments, Location);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec);
- //
- // Pop the return value if there is one
- //
- if (method is MethodInfo){
- if (((MethodInfo) method).ReturnType != TypeManager.void_type)
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- }
-}
diff --git a/mcs/mbas/driver.cs b/mcs/mbas/driver.cs
deleted file mode 100644
index ad58df4596f..00000000000
--- a/mcs/mbas/driver.cs
+++ /dev/null
@@ -1,853 +0,0 @@
-//
-// driver.cs: The compiler command line driver.
-//
-// Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
-// Based on mcs by : Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2002 Rafael Teixeira
-//
-
-namespace Mono.Languages
-{
- using System;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Collections;
- using System.IO;
- using System.Globalization;
- using Mono.CSharp;
- using Mono.GetOptions;
-
- enum Target {
- Library, Exe, Module, WinExe
- };
-
- /// <summary>
- /// The compiler driver.
- /// </summary>
- public class Driver
- {
-
- //
- // Assemblies references to be linked. Initialized with
- // mscorlib.dll elsewhere.
- static ArrayList references;
-
- //
- // If any of these fail, we ignore the problem. This is so
- // that we can list all the assemblies in Windows and not fail
- // if they are missing on Linux.
- //
- static ArrayList soft_references;
-
- // Lookup paths
- static ArrayList link_paths;
-
- // Whether we want to only run the tokenizer
- static bool tokenize = false;
-
- static int error_count = 0;
-
- static string first_source;
-
- static Target target = Target.Exe;
- static string target_ext = ".exe";
-
- static bool want_debugging_support = false;
- static ArrayList debug_arglist = new ArrayList ();
-
- static bool parse_only = false;
- static bool timestamps = false;
-
- //
- // Whether to load the initial config file (what CSC.RSP has by default)
- //
- static bool load_default_config = true;
-
- static Hashtable source_files = new Hashtable ();
-
- //
- // An array of the defines from the command line
- //
- static ArrayList defines;
-
- //
- // A list of resource files
- //
- static ArrayList resources = new ArrayList();
-
- //
- // Last time we took the time
- //
- static DateTime last_time;
- static void ShowTime (string msg)
- {
- DateTime now = DateTime.Now;
- TimeSpan span = now - last_time;
- last_time = now;
-
- Console.WriteLine (
- "[{0:00}:{1:000}] {2}",
- (int) span.TotalSeconds, span.Milliseconds, msg);
- }
-
-
- static void Usage (bool is_error)
- {
- Console.WriteLine ( @"
-MonoBASIC Compiler, Copyright (C)2002 Rafael Teixeira.
-Usage: mbas [options] source-files
-Options:
- --about About the MonoBASIC compiler
- --checked Set default context to checked
- --define SYM Defines the symbol SYM
- --fatal Makes errors fatal
- -g, --debug Write symbolic debugging information to FILE-debug.s
- -h, --help Prints this usage instructions
- -L PATH Adds PATH to the assembly link path
- -m CLASS,
- --main CLASS Specifies CLASS as main (starting) class
- --noconfig Disables implicit references to assemblies
- --nostdlib Does not load core libraries
- --nowarn XXX Ignores warning number XXX
- -o FNAME,
- --output FNAME Specifies output file
- --parse Only parses the source file (for debugging the tokenizer)
- --probe X Probes for the source to generate code X on line L
- -r ASSEMBLY References an assembly
- --recurse SPEC Recursively compiles the files in SPEC ([dir]/file)
- --resource FILE Adds FILE as a resource
- --stacktrace Shows stack trace at error location
- --target KIND Specifies the target (KIND is one of: exe, winexe, library, module)
- --tokenize Only tokenizes source files
- --timestamp Displays time stamps of various compiler events
- --unsafe Allows unsafe code
- --werror Treat warnings as errors
- -v Verbose parsing (for debugging the parser)
- --wlevel LEVEL Sets warning level (the highest is 4, the default)
- @file Read response file for more options
-");
-
- }
-
-
- static void About ()
- {
-// Options.ShowAbout();
- }
-
- static void error (string msg)
- {
- Console.WriteLine ("Error: " + msg);
- }
-
- static void notice (string msg)
- {
- Console.WriteLine (msg);
- }
-
- private static Mono.GetOptions.OptionList Options;
-
- private static bool SetVerboseParsing(object nothing)
- {
- GenericParser.yacc_verbose_flag = true;
- return true;
- }
-
- private static bool SetMainClass(object className)
- {
- RootContext.MainClass = (string)className;
- return true;
- }
-
- private static bool AddFile(object fileName)
- {
- string f = (string)fileName;
- if (first_source == null)
- first_source = f;
-
- if (source_files.Contains(f))
- {
- Report.Error (1516, "Source file `" + f + "' specified multiple times");
- return false;
- }
- else
- source_files.Add(f, f);
-
- return true;
- }
-
- public static int Main (string[] args)
- {
- Options = new OptionList();
- Options.ShowTitle();
- Options.AddParameterReader(new OptionFound(AddFile));
- Options.AddAbout(' ',"about", "About the MonoBASIC compiler");
- Options.AddBooleanSwitch('v',"verbose", "Verbose parsing (for debugging the parser)", new OptionFound(SetVerboseParsing) );
- Options.AddSymbolAdder('m',"main", "Specifies CLASS as main (starting) class", "CLASS", new OptionFound(SetMainClass) );
- MainDriver(args);
- return (error_count + Report.Errors) != 0 ? 1 : 0;
- }
-
- static public int LoadAssembly (string assembly, bool soft)
- {
- Assembly a;
- string total_log = "";
-
- try {
- char[] path_chars = { '/', '\\', '.' };
-
- if (assembly.IndexOfAny (path_chars) != -1)
- a = Assembly.LoadFrom (assembly);
- else
- a = Assembly.Load (assembly);
- TypeManager.AddAssembly (a);
- return 0;
- } catch (FileNotFoundException){
- foreach (string dir in link_paths){
- string full_path = dir + "/" + assembly + ".dll";
-
- try {
- a = Assembly.LoadFrom (full_path);
- TypeManager.AddAssembly (a);
- return 0;
- } catch (FileNotFoundException ff) {
- total_log += ff.FusionLog;
- continue;
- }
- }
- if (soft)
- return 0;
- } catch (BadImageFormatException f) {
- error ("// Bad file format while loading assembly");
- error ("Log: " + f.FusionLog);
- return 1;
- } catch (FileLoadException f){
- error ("File Load Exception: " + assembly);
- error ("Log: " + f.FusionLog);
- return 1;
- } catch (ArgumentNullException){
- error ("// Argument Null exception ");
- return 1;
- }
-
- Report.Error (6, "Can not find assembly `" + assembly + "'" );
- Console.WriteLine ("Log: \n" + total_log);
-
- return 0;
- }
-
- /// <summary>
- /// Loads all assemblies referenced on the command line
- /// </summary>
- static public int LoadReferences ()
- {
- int errors = 0;
-
- foreach (string r in references)
- errors += LoadAssembly (r, false);
-
- foreach (string r in soft_references)
- errors += LoadAssembly (r, true);
-
- return errors;
- }
-
- static void SetupDefaultDefines ()
- {
- defines = new ArrayList ();
- defines.Add ("__MonoBASIC__");
- }
-
-
- //
- // Returns the directory where the system assemblies are installed
- //
- static string GetSystemDir ()
- {
- Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies ();
-
- foreach (Assembly a in assemblies){
- string codebase = a.CodeBase;
- if (codebase.EndsWith ("corlib.dll")){
- return codebase.Substring (0, codebase.LastIndexOf ("/"));
- }
- }
-
- Report.Error (-15, "Can not compute my system path");
- return "";
- }
-
- //
- // Given a path specification, splits the path from the file/pattern
- //
- static void SplitPathAndPattern (string spec, out string path, out string pattern)
- {
- int p = spec.LastIndexOf ("/");
- if (p != -1){
- //
- // Windows does not like /file.cs, switch that to:
- // "\", "file.cs"
- //
- if (p == 0){
- path = "\\";
- pattern = spec.Substring (1);
- } else {
- path = spec.Substring (0, p);
- pattern = spec.Substring (p + 1);
- }
- return;
- }
-
- p = spec.LastIndexOf ("\\");
- if (p != -1){
- path = spec.Substring (0, p);
- pattern = spec.Substring (p + 1);
- return;
- }
-
- path = ".";
- pattern = spec;
- }
-
-
- static int ProcessSourceFile(string filename)
- {
- if (tokenize)
- GenericParser.Tokenize(filename);
- else
- return GenericParser.Parse(filename);
-
- return 0;
- }
-
- static bool AddFiles (string spec, bool recurse)
- {
- string path, pattern;
- int errors = 0;
-
- SplitPathAndPattern (spec, out path, out pattern);
- if (pattern.IndexOf ("*") == -1){
- return AddFile (spec);
- }
-
- string [] files = null;
- try {
- files = Directory.GetFiles (path, pattern);
- } catch (System.IO.DirectoryNotFoundException) {
- Report.Error (2001, "Source file `" + spec + "' could not be found");
- return false;
- } catch (System.IO.IOException){
- Report.Error (2001, "Source file `" + spec + "' could not be found");
- return false;
- }
- foreach (string f in files)
- AddFile (f);
-
- if (!recurse)
- return true;
-
- string [] dirs = null;
-
- try {
- dirs = Directory.GetDirectories (path);
- } catch {
- }
-
- foreach (string d in dirs) {
-
- // Don't include path in this string, as each
- // directory entry already does
- AddFiles (d + "/" + pattern, true);
- }
-
-
- return true;
- }
-
- static void DefineDefaultConfig ()
- {
- //
- // For now the "default config" is harcoded into the compiler
- // we can move this outside later
- //
- string [] default_config =
- {
- "System",
- "System.Data",
- "System.Xml",
- "Microsoft.VisualBasic", // just for now
-#if false
- //
- // Is it worth pre-loading all this stuff?
- //
- "Accessibility",
- "System.Configuration.Install",
- "System.Design",
- "System.DirectoryServices",
- "System.Drawing.Design",
- "System.Drawing",
- "System.EnterpriseServices",
- "System.Management",
- "System.Messaging",
- "System.Runtime.Remoting",
- "System.Runtime.Serialization.Formatters.Soap",
- "System.Security",
- "System.ServiceProcess",
- "System.Web",
- "System.Web.RegularExpressions",
- "System.Web.Services",
- "System.Windows.Forms"
-#endif
- };
-
- int p = 0;
- foreach (string def in default_config)
- soft_references.Insert (p++, def);
- }
-
- /// <summary>
- /// Parses the arguments, and drives the compilation
- /// process.
- /// </summary>
- ///
- /// <remarks>
- /// TODO: Mostly structured to debug the compiler
- /// now, needs to be turned into a real driver soon.
- /// </remarks>
- static void MainDriver (string [] args)
- {
- int errors = 0, i;
- string output_file = null;
- bool parsing_options = true;
-
- references = new ArrayList ();
- soft_references = new ArrayList ();
- link_paths = new ArrayList ();
- SetupDefaultDefines ();
-
- //
- // Setup defaults
- //
- // This is not required because Assembly.Load knows about this
- // path.
- //
- link_paths.Add (GetSystemDir ());
-
- if (!Options.ProcessArgs(args))
- return;
-
-/* int argc = args.Length;
- for (i = 0; i < argc; i++){
- string arg = args [i];
- //
- // Prepare to recurse
- //
-
- if (parsing_options && (arg.StartsWith ("-"))){
- switch (arg){
-
- case "--":
- parsing_options = false;
- continue;
-
- case "--parse":
- parse_only = true;
- continue;
-
- case "--unsafe":
- RootContext.Unsafe = true;
- continue;
-
- case "/?": case "/h": case "/help":
- case "--help":
- Usage (false);
- return;
-
- case "--define":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- defines.Add (args [++i]);
- continue;
-
- case "--probe": {
- int code = 0;
-
- try {
- code = Int32.Parse (
- args [++i], NumberStyles.AllowLeadingSign);
- Report.SetProbe (code);
- } catch {
- Report.Error (-14, "Invalid number specified");
- }
- continue;
- }
-
- case "--tokenize": {
- tokenize = true;
- continue;
- }
-
- case "-o":
- case "--output":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- output_file = args [++i];
- string bname = CodeGen.Basename (output_file);
- if (bname.IndexOf (".") == -1)
- output_file += ".exe";
- continue;
-
- case "--checked":
- RootContext.Checked = true;
- continue;
-
- case "--stacktrace":
- Report.Stacktrace = true;
- continue;
-
- case "--target":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
-
- string type = args [++i];
- switch (type){
- case "library":
- target = Target.Library;
- target_ext = ".dll";
- break;
-
- case "exe":
- target = Target.Exe;
- break;
-
- case "winexe":
- target = Target.WinExe;
- break;
-
- case "module":
- target = Target.Module;
- target_ext = ".dll";
- break;
- default:
- Usage (true);
- return;
- }
- continue;
-
- case "-r":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
-
- references.Add(args [++i]);
- continue;
-
- case "--resource":
- if ((i + 1) >= argc)
- {
- Usage (true);
- Console.WriteLine("Missing argument to --resource");
- return;
- }
-
- resources.Add(args [++i]);
- continue;
-
-
- case "-L":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- link_paths.Add (args [++i]);
- continue;
-
- case "--nostdlib":
- RootContext.StdLib = false;
- continue;
-
- case "--fatal":
- Report.Fatal = true;
- continue;
-
- case "--werror":
- Report.WarningsAreErrors = true;
- continue;
-
- case "--nowarn":
- if ((i + 1) >= argc){
- Usage (true);
- return;
- }
- int warn;
-
- try {
- warn = Int32.Parse (args [++i]);
- } catch {
- Usage (true);
- return;
- }
- Report.SetIgnoreWarning (warn);
- continue;
-
- case "--wlevel":
- if ((i + 1) >= argc){
- Report.Error (
- 1900,
- "--wlevel requires an value from 0 to 4");
- error_count++;
- return;
- }
- int level;
-
- try {
- level = Int32.Parse (args [++i]);
- } catch {
- Report.Error (
- 1900,
- "--wlevel requires an value from 0 to 4");
- return;
- }
- if (level < 0 || level > 4){
- Report.Error (1900, "Warning level must be 0 to 4");
- return;
- } else
- RootContext.WarningLevel = level;
- continue;
-
- case "--about":
- About ();
- return;
-
- case "--recurse":
- if ((i + 1) >= argc){
- Console.WriteLine ("--recurse requires an argument");
- error_count++;
- return;
- }
- AddFiles (args [++i], true);
- continue;
-
- case "--timestamp":
- timestamps = true;
- last_time = DateTime.Now;
- debug_arglist.Add("timestamp");
- continue;
-
- case "--debug": case "-g":
- want_debugging_support = true;
- continue;
-
- case "--debug-args":
- if ((i + 1) >= argc){
- Console.WriteLine ("--debug-args requires an argument");
- error_count++;
- return;
- }
- char[] sep = { ',' };
- debug_arglist.AddRange (args [++i].Split (sep));
- continue;
-
- case "--noconfig":
- load_default_config = false;
- continue;
-
- default:
- Console.WriteLine ("Unknown option: " + arg);
- errors++;
- continue;
- }
- }
-
- // Rafael: Does not compile them yet!!!
- errors += AddFiles(arg, false);
- }
-*/
- //Rafael: Compile all source files!!!
- foreach(string filename in source_files.Values)
- errors += ProcessSourceFile(filename);
-
- if (first_source == null)
- {
- Report.Error (2008, "No files to compile were specified");
- return;
- }
-
- if (tokenize)
- return;
-
- if (Report.Errors > 0)
- return;
-
- if (parse_only)
- return;
-
- //
- // Load Core Library for default compilation
- //
- if (RootContext.StdLib)
- references.Insert (0, "mscorlib");
-
- if (load_default_config)
- DefineDefaultConfig ();
-
- if (errors > 0){
- error ("Parsing failed");
- return;
- }
-
- //
- // Load assemblies required
- //
- if (timestamps)
- ShowTime ("Loading references");
- errors += LoadReferences ();
- if (timestamps)
- ShowTime (" References loaded");
-
- if (errors > 0){
- error ("Could not load one or more assemblies");
- return;
- }
-
- error_count = errors;
-
- //
- // Quick hack
- //
- if (output_file == null){
- int pos = first_source.LastIndexOf (".");
-
- if (pos > 0)
- output_file = first_source.Substring (0, pos) + target_ext;
- else
- output_file = first_source + target_ext;
- }
-
- string[] debug_args = new string [debug_arglist.Count];
- debug_arglist.CopyTo(debug_args);
- CodeGen.Init (output_file, output_file, want_debugging_support, debug_args);
-
- TypeManager.AddModule (CodeGen.ModuleBuilder);
-
- //
- // Before emitting, we need to get the core
- // types emitted from the user defined types
- // or from the system ones.
- //
- if (timestamps)
- ShowTime ("Initializing Core Types");
- if (!RootContext.StdLib){
- RootContext.ResolveCore ();
- if (Report.Errors > 0)
- return;
- }
-
- TypeManager.InitCoreTypes ();
- if (timestamps)
- ShowTime (" Core Types done");
-
- //
- // The second pass of the compiler
- //
- if (timestamps)
- ShowTime ("Resolving tree");
- RootContext.ResolveTree ();
- if (timestamps)
- ShowTime ("Populate tree");
-
- if (Report.Errors > 0){
- error ("Compilation failed");
- return;
- }
-
- if (!RootContext.StdLib)
- RootContext.BootCorlib_PopulateCoreTypes ();
- RootContext.PopulateTypes ();
-
- TypeManager.InitCodeHelpers ();
-
- if (Report.Errors > 0){
- error ("Compilation failed");
- return;
- }
-
- //
- // The code generator
- //
- if (timestamps)
- ShowTime ("Emitting code");
- RootContext.EmitCode ();
- if (timestamps)
- ShowTime (" done");
-
- if (Report.Errors > 0){
- error ("Compilation failed");
- return;
- }
-
- if (timestamps)
- ShowTime ("Closing types");
-
- RootContext.CloseTypes ();
-
-// PEFileKinds k = PEFileKinds.ConsoleApplication;
-//
-// if (target == Target.Library || target == Target.Module)
-// k = PEFileKinds.Dll;
-// else if (target == Target.Exe)
-// k = PEFileKinds.ConsoleApplication;
-// else if (target == Target.WinExe)
-// k = PEFileKinds.WindowApplication;
-//
-// if (target == Target.Exe || target == Target.WinExe){
-// MethodInfo ep = RootContext.EntryPoint;
-//
-// if (ep == null){
-// Report.Error (5001, "Program " + output_file +
-// " does not have an entry point defined");
-// return;
-// }
-//
-// CodeGen.AssemblyBuilder.SetEntryPoint (ep, k);
-// }
-
- //
- // Add the resources
- //
- if (resources != null){
- foreach (string file in resources)
- CodeGen.AssemblyBuilder.AddResourceFile (file, file);
- }
-
- CodeGen.Save (output_file);
- if (timestamps)
- ShowTime ("Saved output");
-
- if (want_debugging_support) {
- CodeGen.SaveSymbols ();
- if (timestamps)
- ShowTime ("Saved symbols");
- }
-
- if (Report.Errors > 0){
- error ("Compilation failed");
- return;
- } else if (Report.ProbeCode != 0){
- error ("Failed to report code " + Report.ProbeCode);
- Environment.Exit (124);
- }
- }
-
- }
-}
diff --git a/mcs/mbas/ecore.cs b/mcs/mbas/ecore.cs
deleted file mode 100644
index 335a7767550..00000000000
--- a/mcs/mbas/ecore.cs
+++ /dev/null
@@ -1,3892 +0,0 @@
-//
-// ecore.cs: Core of the Expression representation for the intermediate tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-
-namespace Mono.CSharp {
- using System;
- using System.Collections;
- using System.Diagnostics;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Text;
-
- /// <remarks>
- /// The ExprClass class contains the is used to pass the
- /// classification of an expression (value, variable, namespace,
- /// type, method group, property access, event access, indexer access,
- /// nothing).
- /// </remarks>
- public enum ExprClass : byte {
- Invalid,
-
- Value,
- Variable,
- Namespace,
- Type,
- MethodGroup,
- PropertyAccess,
- EventAccess,
- IndexerAccess,
- Nothing,
- }
-
- //
- // This is just as a hint to AddressOf of what will be done with the
- // address.
- [Flags]
- public enum AddressOp {
- Store = 1,
- Load = 2,
- LoadStore = 3
- };
-
- /// <summary>
- /// This interface is implemented by variables
- /// </summary>
- public interface IMemoryLocation {
- /// <summary>
- /// The AddressOf method should generate code that loads
- /// the address of the object and leaves it on the stack.
- ///
- /// The `mode' argument is used to notify the expression
- /// of whether this will be used to read from the address or
- /// write to the address.
- ///
- /// This is just a hint that can be used to provide good error
- /// reporting, and should have no other side effects.
- /// </summary>
- void AddressOf (EmitContext ec, AddressOp mode);
- }
-
- /// <remarks>
- /// Base class for expressions
- /// </remarks>
- public abstract class Expression {
- public ExprClass eclass;
- protected Type type;
-
- public Type Type {
- get {
- return type;
- }
-
- set {
- type = value;
- }
- }
-
- /// <summary>
- /// Utility wrapper routine for Error, just to beautify the code
- /// </summary>
- static protected void Error (int error, string s)
- {
- Report.Error (error, s);
- }
-
- static protected void Error (int error, Location loc, string s)
- {
- Report.Error (error, loc, s);
- }
-
- /// <summary>
- /// Utility wrapper routine for Warning, just to beautify the code
- /// </summary>
- static protected void Warning (int warning, string s)
- {
- Report.Warning (warning, s);
- }
-
- static public void Error_CannotConvertType (Location loc, Type source, Type target)
- {
- Report.Error (30, loc, "Cannot convert type '" +
- TypeManager.CSharpName (source) + "' to '" +
- TypeManager.CSharpName (target) + "'");
- }
-
- /// <summary>
- /// Performs semantic analysis on the Expression
- /// </summary>
- ///
- /// <remarks>
- /// The Resolve method is invoked to perform the semantic analysis
- /// on the node.
- ///
- /// The return value is an expression (it can be the
- /// same expression in some cases) or a new
- /// expression that better represents this node.
- ///
- /// For example, optimizations of Unary (LiteralInt)
- /// would return a new LiteralInt with a negated
- /// value.
- ///
- /// If there is an error during semantic analysis,
- /// then an error should be reported (using Report)
- /// and a null value should be returned.
- ///
- /// There are two side effects expected from calling
- /// Resolve(): the the field variable "eclass" should
- /// be set to any value of the enumeration
- /// `ExprClass' and the type variable should be set
- /// to a valid type (this is the type of the
- /// expression).
- /// </remarks>
- public abstract Expression DoResolve (EmitContext ec);
-
- public virtual Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- return DoResolve (ec);
- }
-
- /// <summary>
- /// Resolves an expression and performs semantic analysis on it.
- /// </summary>
- ///
- /// <remarks>
- /// Currently Resolve wraps DoResolve to perform sanity
- /// checking and assertion checking on what we expect from Resolve.
- /// </remarks>
- public Expression Resolve (EmitContext ec)
- {
- Expression e = DoResolve (ec);
-
- if (e != null){
-
- if (e is SimpleName){
- SimpleName s = (SimpleName) e;
-
- Report.Error (
- 103, s.Location,
- "The name `" + s.Name + "' could not be found in `" +
- ec.DeclSpace.Name + "'");
- return null;
- }
-
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e.GetType () +
- " ExprClass is Invalid after resolve");
-
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception (
- "Expression " + e.GetType () +
- " did not set its type after Resolve\n" +
- "called from: " + this.GetType ());
- }
-
- return e;
- }
-
- /// <summary>
- /// Performs expression resolution and semantic analysis, but
- /// allows SimpleNames to be returned.
- /// </summary>
- ///
- /// <remarks>
- /// This is used by MemberAccess to construct long names that can not be
- /// partially resolved (namespace-qualified names for example).
- /// </remarks>
- public Expression ResolveWithSimpleName (EmitContext ec)
- {
- Expression e;
-
- if (this is SimpleName)
- e = ((SimpleName) this).DoResolveAllowStatic (ec);
- else
- e = DoResolve (ec);
-
- if (e != null){
- if (e is SimpleName)
- return e;
-
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e +
- " ExprClass is Invalid after resolve");
-
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception ("Expression " + e +
- " did not set its type after Resolve");
- }
-
- return e;
- }
-
- /// <summary>
- /// Resolves an expression for LValue assignment
- /// </summary>
- ///
- /// <remarks>
- /// Currently ResolveLValue wraps DoResolveLValue to perform sanity
- /// checking and assertion checking on what we expect from Resolve
- /// </remarks>
- public Expression ResolveLValue (EmitContext ec, Expression right_side)
- {
- Expression e = DoResolveLValue (ec, right_side);
-
- if (e != null){
- if (e is SimpleName){
- SimpleName s = (SimpleName) e;
-
- Report.Error (
- 103, s.Location,
- "The name `" + s.Name + "' could not be found in `" +
- ec.DeclSpace.Name + "'");
- return null;
- }
-
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e +
- " ExprClass is Invalid after resolve");
-
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception ("Expression " + e +
- " did not set its type after Resolve");
- }
-
- return e;
- }
-
- /// <summary>
- /// Emits the code for the expression
- /// </summary>
- ///
- /// <remarks>
- /// The Emit method is invoked to generate the code
- /// for the expression.
- /// </remarks>
- public abstract void Emit (EmitContext ec);
-
- /// <summary>
- /// Protected constructor. Only derivate types should
- /// be able to be created
- /// </summary>
-
- protected Expression ()
- {
- eclass = ExprClass.Invalid;
- type = null;
- }
-
- /// <summary>
- /// Returns a literalized version of a literal FieldInfo
- /// </summary>
- ///
- /// <remarks>
- /// The possible return values are:
- /// IntConstant, UIntConstant
- /// LongLiteral, ULongConstant
- /// FloatConstant, DoubleConstant
- /// StringConstant
- ///
- /// The value returned is already resolved.
- /// </remarks>
- public static Constant Constantify (object v, Type t)
- {
- if (t == TypeManager.int32_type)
- return new IntConstant ((int) v);
- else if (t == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- else if (t == TypeManager.int64_type)
- return new LongConstant ((long) v);
- else if (t == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- else if (t == TypeManager.float_type)
- return new FloatConstant ((float) v);
- else if (t == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- else if (t == TypeManager.string_type)
- return new StringConstant ((string) v);
- else if (t == TypeManager.short_type)
- return new ShortConstant ((short)v);
- else if (t == TypeManager.ushort_type)
- return new UShortConstant ((ushort)v);
- else if (t == TypeManager.sbyte_type)
- return new SByteConstant (((sbyte)v));
- else if (t == TypeManager.byte_type)
- return new ByteConstant ((byte)v);
- else if (t == TypeManager.char_type)
- return new CharConstant ((char)v);
- else if (t == TypeManager.bool_type)
- return new BoolConstant ((bool) v);
- else if (TypeManager.IsEnumType (t)){
- Constant e = Constantify (v, TypeManager.TypeToCoreType (v.GetType ()));
-
- return new EnumConstant (e, t);
- } else
- throw new Exception ("Unknown type for constant (" + t +
- "), details: " + v);
- }
-
- /// <summary>
- /// Returns a fully formed expression after a MemberLookup
- /// </summary>
- public static Expression ExprClassFromMemberInfo (EmitContext ec, MemberInfo mi, Location loc)
- {
- if (mi is EventInfo)
- return new EventExpr ((EventInfo) mi, loc);
- else if (mi is FieldInfo)
- return new FieldExpr ((FieldInfo) mi, loc);
- else if (mi is PropertyInfo)
- return new PropertyExpr ((PropertyInfo) mi, loc);
- else if (mi is Type){
- return new TypeExpr ((System.Type) mi);
- }
-
- return null;
- }
-
- //
- // FIXME: Probably implement a cache for (t,name,current_access_set)?
- //
- // This code could use some optimizations, but we need to do some
- // measurements. For example, we could use a delegate to `flag' when
- // something can not any longer be a method-group (because it is something
- // else).
- //
- // Return values:
- // If the return value is an Array, then it is an array of
- // MethodBases
- //
- // If the return value is an MemberInfo, it is anything, but a Method
- //
- // null on error.
- //
- // FIXME: When calling MemberLookup inside an `Invocation', we should pass
- // the arguments here and have MemberLookup return only the methods that
- // match the argument count/type, unlike we are doing now (we delay this
- // decision).
- //
- // This is so we can catch correctly attempts to invoke instance methods
- // from a static body (scan for error 120 in ResolveSimpleName).
- //
- //
- // FIXME: Potential optimization, have a static ArrayList
- //
-
- public static Expression MemberLookup (EmitContext ec, Type t, string name,
- MemberTypes mt, BindingFlags bf, Location loc)
- {
- MemberInfo [] mi = TypeManager.MemberLookup (ec.ContainerType, t, mt, bf, name);
-
- if (mi == null)
- return null;
-
- int count = mi.Length;
-
- if (count > 1)
- return new MethodGroupExpr (mi, loc);
-
- if (mi [0] is MethodBase)
- return new MethodGroupExpr (mi, loc);
-
- return ExprClassFromMemberInfo (ec, mi [0], loc);
- }
-
- public const MemberTypes AllMemberTypes =
- MemberTypes.Constructor |
- MemberTypes.Event |
- MemberTypes.Field |
- MemberTypes.Method |
- MemberTypes.NestedType |
- MemberTypes.Property;
-
- public const BindingFlags AllBindingFlags =
- BindingFlags.Public |
- BindingFlags.Static |
- BindingFlags.Instance;
-
- public static Expression MemberLookup (EmitContext ec, Type t, string name, Location loc)
- {
- return MemberLookup (ec, t, name, AllMemberTypes, AllBindingFlags, loc);
- }
-
- public static Expression MethodLookup (EmitContext ec, Type t, string name, Location loc)
- {
- return MemberLookup (ec, t, name, MemberTypes.Method, AllBindingFlags, loc);
- }
-
- /// <summary>
- /// This is a wrapper for MemberLookup that is not used to "probe", but
- /// to find a final definition. If the final definition is not found, we
- /// look for private members and display a useful debugging message if we
- /// find it.
- /// </summary>
- public static Expression MemberLookupFinal (EmitContext ec, Type t, string name,
- Location loc)
- {
- return MemberLookupFinal (ec, t, name, MemberTypes.Method, AllBindingFlags, loc);
- }
-
- public static Expression MemberLookupFinal (EmitContext ec, Type t, string name,
- MemberTypes mt, BindingFlags bf, Location loc)
- {
- Expression e;
-
- e = MemberLookup (ec, t, name, mt, bf, loc);
-
- if (e != null)
- return e;
-
- e = MemberLookup (ec, t, name, AllMemberTypes,
- AllBindingFlags | BindingFlags.NonPublic, loc);
- if (e == null){
- Report.Error (
- 117, loc, "`" + t + "' does not contain a definition " +
- "for `" + name + "'");
- } else {
- Report.Error (
- 122, loc, "`" + t + "." + name +
- "' is inaccessible due to its protection level");
- }
-
- return null;
- }
-
- static EmptyExpression MyEmptyExpr;
- static public Expression ImplicitReferenceConversion (Expression expr, Type target_type)
- {
- Type expr_type = expr.Type;
-
- if (expr_type == null && expr.eclass == ExprClass.MethodGroup){
- // if we are a method group, emit a warning
-
- expr.Emit (null);
- }
-
- if (target_type == TypeManager.object_type) {
- //
- // A pointer type cannot be converted to object
- //
- if (expr_type.IsPointer)
- return null;
-
- if (expr_type.IsValueType)
- return new BoxedCast (expr);
- if (expr_type.IsClass || expr_type.IsInterface)
- return new EmptyCast (expr, target_type);
- } else if (expr_type.IsSubclassOf (target_type)) {
- return new EmptyCast (expr, target_type);
- } else {
-
- // This code is kind of mirrored inside StandardConversionExists
- // with the small distinction that we only probe there
- //
- // Always ensure that the code here and there is in sync
-
- // from the null type to any reference-type.
- if (expr is NullLiteral && !target_type.IsValueType)
- return new EmptyCast (expr, target_type);
-
- // from any class-type S to any interface-type T.
- if (expr_type.IsClass && target_type.IsInterface) {
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return new EmptyCast (expr, target_type);
- else
- return null;
- }
-
- // from any interface type S to interface-type T.
- if (expr_type.IsInterface && target_type.IsInterface) {
-
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return new EmptyCast (expr, target_type);
- else
- return null;
- }
-
- // from an array-type S to an array-type of type T
- if (expr_type.IsArray && target_type.IsArray) {
- if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type expr_element_type = expr_type.GetElementType ();
-
- if (MyEmptyExpr == null)
- MyEmptyExpr = new EmptyExpression ();
-
- MyEmptyExpr.SetType (expr_element_type);
- Type target_element_type = target_type.GetElementType ();
-
- if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
- if (StandardConversionExists (MyEmptyExpr,
- target_element_type))
- return new EmptyCast (expr, target_type);
- }
- }
-
-
- // from an array-type to System.Array
- if (expr_type.IsArray && target_type == TypeManager.array_type)
- return new EmptyCast (expr, target_type);
-
- // from any delegate type to System.Delegate
- if (expr_type.IsSubclassOf (TypeManager.delegate_type) &&
- target_type == TypeManager.delegate_type)
- return new EmptyCast (expr, target_type);
-
- // from any array-type or delegate type into System.ICloneable.
- if (expr_type.IsArray || expr_type.IsSubclassOf (TypeManager.delegate_type))
- if (target_type == TypeManager.icloneable_type)
- return new EmptyCast (expr, target_type);
-
- return null;
-
- }
-
- return null;
- }
-
- /// <summary>
- /// Handles expressions like this: decimal d; d = 1;
- /// and changes them into: decimal d; d = new System.Decimal (1);
- /// </summary>
- static Expression InternalTypeConstructor (EmitContext ec, Expression expr, Type target)
- {
- ArrayList args = new ArrayList ();
-
- args.Add (new Argument (expr, Argument.AType.Expression));
-
- Expression ne = new New (target.FullName, args,
- new Location (-1));
-
- return ne.Resolve (ec);
- }
-
- /// <summary>
- /// Implicit Numeric Conversions.
- ///
- /// expr is the expression to convert, returns a new expression of type
- /// target_type or null if an implicit conversion is not possible.
- /// </summary>
- static public Expression ImplicitNumericConversion (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
-
- //
- // Attempt to do the implicit constant expression conversions
-
- if (expr is IntConstant){
- Expression e;
-
- e = TryImplicitIntConversion (target_type, (IntConstant) expr);
-
- if (e != null)
- return e;
- } else if (expr is LongConstant && target_type == TypeManager.uint64_type){
- //
- // Try the implicit constant expression conversion
- // from long to ulong, instead of a nice routine,
- // we just inline it
- //
- long v = ((LongConstant) expr).Value;
- if (v > 0)
- return new ULongConstant ((ulong) v);
- }
-
- //
- // If we have an enumeration, extract the underlying type,
- // use this during the comparission, but wrap around the original
- // target_type
- //
- Type real_target_type = target_type;
-
- if (TypeManager.IsEnumType (real_target_type))
- real_target_type = TypeManager.EnumToUnderlying (real_target_type);
-
- if (expr_type == real_target_type)
- return new EmptyCast (expr, target_type);
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to short, int, long, float, double.
- //
- if (real_target_type == TypeManager.int32_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.short_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I2);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to short, ushort, int, uint, long, ulong, float, double
- //
- if ((real_target_type == TypeManager.short_type) ||
- (real_target_type == TypeManager.ushort_type) ||
- (real_target_type == TypeManager.int32_type) ||
- (real_target_type == TypeManager.uint32_type))
- return new EmptyCast (expr, target_type);
-
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to int, long, float, double
- //
- if (real_target_type == TypeManager.int32_type)
- return new EmptyCast (expr, target_type);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to int, uint, long, ulong, float, double
- //
- if (real_target_type == TypeManager.uint32_type)
- return new EmptyCast (expr, target_type);
-
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int32_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to long, float, double
- //
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to long, ulong, float, double
- //
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if ((expr_type == TypeManager.uint64_type) ||
- (expr_type == TypeManager.int64_type)){
- //
- // From long/ulong to float, double
- //
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to ushort, int, uint, long, ulong, float, double
- //
- if ((real_target_type == TypeManager.ushort_type) ||
- (real_target_type == TypeManager.int32_type) ||
- (real_target_type == TypeManager.uint32_type))
- return new EmptyCast (expr, target_type);
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.float_type){
- //
- // float to double
- //
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- }
-
- return null;
- }
-
- //
- // Tests whether an implicit reference conversion exists between expr_type
- // and target_type
- //
- public static bool ImplicitReferenceConversionExists (Expression expr, Type target_type)
- {
- Type expr_type = expr.Type;
-
- //
- // This is the boxed case.
- //
- if (target_type == TypeManager.object_type) {
- if ((expr_type.IsClass) ||
- (expr_type.IsValueType) ||
- (expr_type.IsInterface))
- return true;
-
- } else if (expr_type.IsSubclassOf (target_type)) {
- return true;
-
- } else {
- // Please remember that all code below actually comes
- // from ImplicitReferenceConversion so make sure code remains in sync
-
- // from any class-type S to any interface-type T.
- if (expr_type.IsClass && target_type.IsInterface) {
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return true;
- }
-
- // from any interface type S to interface-type T.
- if (expr_type.IsInterface && target_type.IsInterface)
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return true;
-
- // from an array-type S to an array-type of type T
- if (expr_type.IsArray && target_type.IsArray) {
- if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type expr_element_type = expr_type.GetElementType ();
-
- if (MyEmptyExpr == null)
- MyEmptyExpr = new EmptyExpression ();
-
- MyEmptyExpr.SetType (expr_element_type);
- Type target_element_type = target_type.GetElementType ();
-
- if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
- if (StandardConversionExists (MyEmptyExpr,
- target_element_type))
- return true;
- }
- }
-
- // from an array-type to System.Array
- if (expr_type.IsArray && target_type.IsAssignableFrom (expr_type))
- return true;
-
- // from any delegate type to System.Delegate
- if (expr_type.IsSubclassOf (TypeManager.delegate_type) &&
- target_type == TypeManager.delegate_type)
- if (target_type.IsAssignableFrom (expr_type))
- return true;
-
- // from any array-type or delegate type into System.ICloneable.
- if (expr_type.IsArray || expr_type.IsSubclassOf (TypeManager.delegate_type))
- if (target_type == TypeManager.icloneable_type)
- return true;
-
- // from the null type to any reference-type.
- if (expr is NullLiteral && !target_type.IsValueType)
- return true;
-
- }
-
- return false;
- }
-
- /// <summary>
- /// Same as StandardConversionExists except that it also looks at
- /// implicit user defined conversions - needed for overload resolution
- /// </summary>
- public static bool ImplicitConversionExists (EmitContext ec, Expression expr, Type target_type)
- {
- if (StandardConversionExists (expr, target_type) == true)
- return true;
-
- Expression dummy = ImplicitUserConversion (ec, expr, target_type, Location.Null);
-
- if (dummy != null)
- return true;
-
- return false;
- }
-
- /// <summary>
- /// Determines if a standard implicit conversion exists from
- /// expr_type to target_type
- /// </summary>
- public static bool StandardConversionExists (Expression expr, Type target_type)
- {
- Type expr_type = expr.Type;
-
- if (expr_type == target_type)
- return true;
-
- // First numeric conversions
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to short, int, long, float, double.
- //
- if ((target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.short_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to short, ushort, int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.short_type) ||
- (target_type == TypeManager.ushort_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to int, long, float, double
- //
- if ((target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to long, float, double
- //
- if ((target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to long, ulong, float, double
- //
- if ((target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if ((expr_type == TypeManager.uint64_type) ||
- (expr_type == TypeManager.int64_type)) {
- //
- // From long/ulong to float, double
- //
- if ((target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to ushort, int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.ushort_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.float_type){
- //
- // float to double
- //
- if (target_type == TypeManager.double_type)
- return true;
- }
-
- if (ImplicitReferenceConversionExists (expr, target_type))
- return true;
-
- if (expr is IntConstant){
- int value = ((IntConstant) expr).Value;
-
- if (target_type == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return true;
- } else if (target_type == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return true;
- } else if (target_type == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return true;
- } else if (target_type == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return true;
- } else if (target_type == TypeManager.uint32_type){
- if (value >= 0)
- return true;
- } else if (target_type == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64. But we need an opcode
- // to do it.
- //
- if (value >= 0)
- return true;
- }
-
- if (value == 0 && expr is IntLiteral && TypeManager.IsEnumType (target_type))
- return true;
- }
-
- if (expr is LongConstant && target_type == TypeManager.uint64_type){
- //
- // Try the implicit constant expression conversion
- // from long to ulong, instead of a nice routine,
- // we just inline it
- //
- long v = ((LongConstant) expr).Value;
- if (v > 0)
- return true;
- }
-
- if (target_type.IsSubclassOf (TypeManager.enum_type) && expr is IntLiteral){
- IntLiteral i = (IntLiteral) expr;
-
- if (i.Value == 0)
- return true;
- }
- return false;
- }
-
- //
- // Used internally by FindMostEncompassedType, this is used
- // to avoid creating lots of objects in the tight loop inside
- // FindMostEncompassedType
- //
- static EmptyExpression priv_fmet_param;
-
- /// <summary>
- /// Finds "most encompassed type" according to the spec (13.4.2)
- /// amongst the methods in the MethodGroupExpr
- /// </summary>
- static Type FindMostEncompassedType (ArrayList types)
- {
- Type best = null;
-
- if (priv_fmet_param == null)
- priv_fmet_param = new EmptyExpression ();
-
- foreach (Type t in types){
- priv_fmet_param.SetType (t);
-
- if (best == null) {
- best = t;
- continue;
- }
-
- if (StandardConversionExists (priv_fmet_param, best))
- best = t;
- }
-
- return best;
- }
-
- //
- // Used internally by FindMostEncompassingType, this is used
- // to avoid creating lots of objects in the tight loop inside
- // FindMostEncompassingType
- //
- static EmptyExpression priv_fmee_ret;
-
- /// <summary>
- /// Finds "most encompassing type" according to the spec (13.4.2)
- /// amongst the types in the given set
- /// </summary>
- static Type FindMostEncompassingType (ArrayList types)
- {
- Type best = null;
-
- if (priv_fmee_ret == null)
- priv_fmee_ret = new EmptyExpression ();
-
- foreach (Type t in types){
- priv_fmee_ret.SetType (best);
-
- if (best == null) {
- best = t;
- continue;
- }
-
- if (StandardConversionExists (priv_fmee_ret, t))
- best = t;
- }
-
- return best;
- }
-
- //
- // Used to avoid creating too many objects
- //
- static EmptyExpression priv_fms_expr;
-
- /// <summary>
- /// Finds the most specific source Sx according to the rules of the spec (13.4.4)
- /// by making use of FindMostEncomp* methods. Applies the correct rules separately
- /// for explicit and implicit conversion operators.
- /// </summary>
- static public Type FindMostSpecificSource (MethodGroupExpr me, Type source_type,
- bool apply_explicit_conv_rules,
- Location loc)
- {
- ArrayList src_types_set = new ArrayList ();
-
- if (priv_fms_expr == null)
- priv_fms_expr = new EmptyExpression ();
-
- //
- // If any operator converts from S then Sx = S
- //
- foreach (MethodBase mb in me.Methods){
- ParameterData pd = Invocation.GetParameterData (mb);
- Type param_type = pd.ParameterType (0);
-
- if (param_type == source_type)
- return param_type;
-
- if (apply_explicit_conv_rules) {
- //
- // From the spec :
- // Find the set of applicable user-defined conversion operators, U. This set
- // consists of the
- // user-defined implicit or explicit conversion operators declared by
- // the classes or structs in D that convert from a type encompassing
- // or encompassed by S to a type encompassing or encompassed by T
- //
- priv_fms_expr.SetType (param_type);
- if (StandardConversionExists (priv_fms_expr, source_type))
- src_types_set.Add (param_type);
- else {
- priv_fms_expr.SetType (source_type);
- if (StandardConversionExists (priv_fms_expr, param_type))
- src_types_set.Add (param_type);
- }
- } else {
- //
- // Only if S is encompassed by param_type
- //
- priv_fms_expr.SetType (source_type);
- if (StandardConversionExists (priv_fms_expr, param_type))
- src_types_set.Add (param_type);
- }
- }
-
- //
- // Explicit Conv rules
- //
- if (apply_explicit_conv_rules) {
- ArrayList candidate_set = new ArrayList ();
-
- foreach (Type param_type in src_types_set){
- priv_fms_expr.SetType (source_type);
-
- if (StandardConversionExists (priv_fms_expr, param_type))
- candidate_set.Add (param_type);
- }
-
- if (candidate_set.Count != 0)
- return FindMostEncompassedType (candidate_set);
- }
-
- //
- // Final case
- //
- if (apply_explicit_conv_rules)
- return FindMostEncompassingType (src_types_set);
- else
- return FindMostEncompassedType (src_types_set);
- }
-
- //
- // Useful in avoiding proliferation of objects
- //
- static EmptyExpression priv_fmt_expr;
-
- /// <summary>
- /// Finds the most specific target Tx according to section 13.4.4
- /// </summary>
- static public Type FindMostSpecificTarget (MethodGroupExpr me, Type target,
- bool apply_explicit_conv_rules,
- Location loc)
- {
- ArrayList tgt_types_set = new ArrayList ();
-
- if (priv_fmt_expr == null)
- priv_fmt_expr = new EmptyExpression ();
-
- //
- // If any operator converts to T then Tx = T
- //
- foreach (MethodInfo mi in me.Methods){
- Type ret_type = mi.ReturnType;
-
- if (ret_type == target)
- return ret_type;
-
- if (apply_explicit_conv_rules) {
- //
- // From the spec :
- // Find the set of applicable user-defined conversion operators, U.
- //
- // This set consists of the
- // user-defined implicit or explicit conversion operators declared by
- // the classes or structs in D that convert from a type encompassing
- // or encompassed by S to a type encompassing or encompassed by T
- //
- priv_fms_expr.SetType (ret_type);
- if (StandardConversionExists (priv_fms_expr, target))
- tgt_types_set.Add (ret_type);
- else {
- priv_fms_expr.SetType (target);
- if (StandardConversionExists (priv_fms_expr, ret_type))
- tgt_types_set.Add (ret_type);
- }
- } else {
- //
- // Only if T is encompassed by param_type
- //
- priv_fms_expr.SetType (ret_type);
- if (StandardConversionExists (priv_fms_expr, target))
- tgt_types_set.Add (ret_type);
- }
- }
-
- //
- // Explicit conv rules
- //
- if (apply_explicit_conv_rules) {
- ArrayList candidate_set = new ArrayList ();
-
- foreach (Type ret_type in tgt_types_set){
- priv_fmt_expr.SetType (ret_type);
-
- if (StandardConversionExists (priv_fmt_expr, target))
- candidate_set.Add (ret_type);
- }
-
- if (candidate_set.Count != 0)
- return FindMostEncompassingType (candidate_set);
- }
-
- //
- // Okay, final case !
- //
- if (apply_explicit_conv_rules)
- return FindMostEncompassedType (tgt_types_set);
- else
- return FindMostEncompassingType (tgt_types_set);
- }
-
- /// <summary>
- /// User-defined Implicit conversions
- /// </summary>
- static public Expression ImplicitUserConversion (EmitContext ec, Expression source,
- Type target, Location loc)
- {
- return UserDefinedConversion (ec, source, target, loc, false);
- }
-
- /// <summary>
- /// User-defined Explicit conversions
- /// </summary>
- static public Expression ExplicitUserConversion (EmitContext ec, Expression source,
- Type target, Location loc)
- {
- return UserDefinedConversion (ec, source, target, loc, true);
- }
-
- /// <summary>
- /// Computes the MethodGroup for the user-defined conversion
- /// operators from source_type to target_type. `look_for_explicit'
- /// controls whether we should also include the list of explicit
- /// operators
- /// </summary>
- static MethodGroupExpr GetConversionOperators (EmitContext ec,
- Type source_type, Type target_type,
- Location loc, bool look_for_explicit)
- {
- Expression mg1 = null, mg2 = null;
- Expression mg5 = null, mg6 = null, mg7 = null, mg8 = null;
- string op_name;
-
- //
- // FIXME : How does the False operator come into the picture ?
- // This doesn't look complete and very correct !
- //
- if (target_type == TypeManager.bool_type && !look_for_explicit)
- op_name = "op_True";
- else
- op_name = "op_Implicit";
-
- MethodGroupExpr union3;
-
- mg1 = MethodLookup (ec, source_type, op_name, loc);
- if (source_type.BaseType != null)
- mg2 = MethodLookup (ec, source_type.BaseType, op_name, loc);
-
- if (mg1 == null)
- union3 = (MethodGroupExpr) mg2;
- else if (mg2 == null)
- union3 = (MethodGroupExpr) mg1;
- else
- union3 = Invocation.MakeUnionSet (mg1, mg2, loc);
-
- mg1 = MethodLookup (ec, target_type, op_name, loc);
- if (mg1 != null){
- if (union3 != null)
- union3 = Invocation.MakeUnionSet (union3, mg1, loc);
- else
- union3 = (MethodGroupExpr) mg1;
- }
-
- if (target_type.BaseType != null)
- mg1 = MethodLookup (ec, target_type.BaseType, op_name, loc);
-
- if (mg1 != null){
- if (union3 != null)
- union3 = Invocation.MakeUnionSet (union3, mg1, loc);
- else
- union3 = (MethodGroupExpr) mg1;
- }
-
- MethodGroupExpr union4 = null;
-
- if (look_for_explicit) {
- op_name = "op_Explicit";
-
- mg5 = MemberLookup (ec, source_type, op_name, loc);
- if (source_type.BaseType != null)
- mg6 = MethodLookup (ec, source_type.BaseType, op_name, loc);
-
- mg7 = MemberLookup (ec, target_type, op_name, loc);
- if (target_type.BaseType != null)
- mg8 = MethodLookup (ec, target_type.BaseType, op_name, loc);
-
- MethodGroupExpr union5 = Invocation.MakeUnionSet (mg5, mg6, loc);
- MethodGroupExpr union6 = Invocation.MakeUnionSet (mg7, mg8, loc);
-
- union4 = Invocation.MakeUnionSet (union5, union6, loc);
- }
-
- return Invocation.MakeUnionSet (union3, union4, loc);
- }
-
- /// <summary>
- /// User-defined conversions
- /// </summary>
- static public Expression UserDefinedConversion (EmitContext ec, Expression source,
- Type target, Location loc,
- bool look_for_explicit)
- {
- MethodGroupExpr union;
- Type source_type = source.Type;
- MethodBase method = null;
-
- union = GetConversionOperators (ec, source_type, target, loc, look_for_explicit);
- if (union == null)
- return null;
-
- Type most_specific_source, most_specific_target;
-
-#if BLAH
- foreach (MethodBase m in union.Methods){
- Console.WriteLine ("Name: " + m.Name);
- Console.WriteLine (" : " + ((MethodInfo)m).ReturnType);
- }
-#endif
-
- most_specific_source = FindMostSpecificSource (union, source_type, look_for_explicit, loc);
- if (most_specific_source == null)
- return null;
-
- most_specific_target = FindMostSpecificTarget (union, target, look_for_explicit, loc);
- if (most_specific_target == null)
- return null;
-
- int count = 0;
-
- foreach (MethodBase mb in union.Methods){
- ParameterData pd = Invocation.GetParameterData (mb);
- MethodInfo mi = (MethodInfo) mb;
-
- if (pd.ParameterType (0) == most_specific_source &&
- mi.ReturnType == most_specific_target) {
- method = mb;
- count++;
- }
- }
-
- if (method == null || count > 1) {
- Report.Error (-11, loc, "Ambiguous user defined conversion");
- return null;
- }
-
- //
- // This will do the conversion to the best match that we
- // found. Now we need to perform an implict standard conversion
- // if the best match was not the type that we were requested
- // by target.
- //
- if (look_for_explicit)
- source = ConvertExplicitStandard (ec, source, most_specific_source, loc);
- else
- source = ConvertImplicitStandard (ec, source, most_specific_source, loc);
-
- if (source == null)
- return null;
-
- Expression e;
- e = new UserCast ((MethodInfo) method, source);
- if (e.Type != target){
- if (!look_for_explicit)
- e = ConvertImplicitStandard (ec, e, target, loc);
- else
- e = ConvertExplicitStandard (ec, e, target, loc);
- }
- return e;
- }
-
- /// <summary>
- /// Converts implicitly the resolved expression `expr' into the
- /// `target_type'. It returns a new expression that can be used
- /// in a context that expects a `target_type'.
- /// </summary>
- static public Expression ConvertImplicit (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression e;
-
- if (expr_type == target_type)
- return expr;
-
- if (target_type == null)
- throw new Exception ("Target type is null");
-
- e = ConvertImplicitStandard (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- e = ImplicitUserConversion (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- return null;
- }
-
-
- /// <summary>
- /// Attempts to apply the `Standard Implicit
- /// Conversion' rules to the expression `expr' into
- /// the `target_type'. It returns a new expression
- /// that can be used in a context that expects a
- /// `target_type'.
- ///
- /// This is different from `ConvertImplicit' in that the
- /// user defined implicit conversions are excluded.
- /// </summary>
- static public Expression ConvertImplicitStandard (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression e;
-
- if (expr_type == target_type)
- return expr;
-
- e = ImplicitNumericConversion (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- e = ImplicitReferenceConversion (expr, target_type);
- if (e != null)
- return e;
-
- if (target_type.IsSubclassOf (TypeManager.enum_type) && expr is IntLiteral){
- IntLiteral i = (IntLiteral) expr;
-
- if (i.Value == 0)
- return new EmptyCast (expr, target_type);
- }
-
- if (ec.InUnsafe) {
- if (expr_type.IsPointer){
- if (target_type == TypeManager.void_ptr_type)
- return new EmptyCast (expr, target_type);
-
- //
- // yep, comparing pointer types cant be done with
- // t1 == t2, we have to compare their element types.
- //
- if (target_type.IsPointer){
- if (target_type.GetElementType()==expr_type.GetElementType())
- return expr;
- }
- }
-
- if (target_type.IsPointer){
- if (expr is NullLiteral)
- return new EmptyCast (expr, target_type);
- }
- }
-
- return null;
- }
-
- /// <summary>
- /// Attemps to perform an implict constant conversion of the IntConstant
- /// into a different data type using casts (See Implicit Constant
- /// Expression Conversions)
- /// </summary>
- static protected Expression TryImplicitIntConversion (Type target_type, IntConstant ic)
- {
- int value = ic.Value;
-
- //
- // FIXME: This could return constants instead of EmptyCasts
- //
- if (target_type == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return new SByteConstant ((sbyte) value);
- } else if (target_type == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return new ByteConstant ((byte) value);
- } else if (target_type == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return new ShortConstant ((short) value);
- } else if (target_type == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return new UShortConstant ((ushort) value);
- } else if (target_type == TypeManager.uint32_type){
- if (value >= 0)
- return new UIntConstant ((uint) value);
- } else if (target_type == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64. But we need an opcode
- // to do it.
- //
- if (value >= 0)
- return new ULongConstant ((ulong) value);
- }
-
- if (value == 0 && ic is IntLiteral && TypeManager.IsEnumType (target_type))
- return new EnumConstant (ic, target_type);
-
- return null;
- }
-
- static public void Error_CannotConvertImplicit (Location loc, Type source, Type target)
- {
- string msg = "Cannot convert implicitly from `"+
- TypeManager.CSharpName (source) + "' to `" +
- TypeManager.CSharpName (target) + "'";
-
- Error (29, loc, msg);
- }
-
- /// <summary>
- /// Attemptes to implicityly convert `target' into `type', using
- /// ConvertImplicit. If there is no implicit conversion, then
- /// an error is signaled
- /// </summary>
- static public Expression ConvertImplicitRequired (EmitContext ec, Expression source,
- Type target_type, Location loc)
- {
- Expression e;
-
- e = ConvertImplicit (ec, source, target_type, loc);
- if (e != null)
- return e;
-
- if (source is DoubleLiteral && target_type == TypeManager.float_type){
- Error (664, loc,
- "Double literal cannot be implicitly converted to " +
- "float type, use F suffix to create a float literal");
- }
-
- Error_CannotConvertImplicit (loc, source.Type, target_type);
-
- return null;
- }
-
- /// <summary>
- /// Performs the explicit numeric conversions
- /// </summary>
- static Expression ConvertNumericExplicit (EmitContext ec, Expression expr,
- Type target_type)
- {
- Type expr_type = expr.Type;
-
- //
- // If we have an enumeration, extract the underlying type,
- // use this during the comparission, but wrap around the original
- // target_type
- //
- Type real_target_type = target_type;
-
- if (TypeManager.IsEnumType (real_target_type))
- real_target_type = TypeManager.EnumToUnderlying (real_target_type);
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to byte, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U1);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_CH);
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to sbyte and char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U1_I1);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U1_CH);
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to sbyte, byte, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U1);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_CH);
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to sbyte, byte, short, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_I2);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_CH);
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to sbyte, byte, short, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_CH);
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to sbyte, byte, short, ushort, int, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I4);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_CH);
- } else if (expr_type == TypeManager.int64_type){
- //
- // From long to sbyte, byte, short, ushort, int, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_CH);
- } else if (expr_type == TypeManager.uint64_type){
- //
- // From ulong to sbyte, byte, short, ushort, int, uint, long, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_CH);
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to sbyte, byte, short
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_I2);
- } else if (expr_type == TypeManager.float_type){
- //
- // From float to sbyte, byte, short,
- // ushort, int, uint, long, ulong, char
- // or decimal
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I8);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_CH);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.double_type){
- //
- // From double to byte, byte, short,
- // ushort, int, uint, long, ulong,
- // char, float or decimal
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I8);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_CH);
- if (real_target_type == TypeManager.float_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- }
-
- // decimal is taken care of by the op_Explicit methods.
-
- return null;
- }
-
- /// <summary>
- /// Returns whether an explicit reference conversion can be performed
- /// from source_type to target_type
- /// </summary>
- public static bool ExplicitReferenceConversionExists (Type source_type, Type target_type)
- {
- bool target_is_value_type = target_type.IsValueType;
-
- if (source_type == target_type)
- return true;
-
- //
- // From object to any reference type
- //
- if (source_type == TypeManager.object_type && !target_is_value_type)
- return true;
-
- //
- // From any class S to any class-type T, provided S is a base class of T
- //
- if (target_type.IsSubclassOf (source_type))
- return true;
-
- //
- // From any interface type S to any interface T provided S is not derived from T
- //
- if (source_type.IsInterface && target_type.IsInterface){
- if (!target_type.IsSubclassOf (source_type))
- return true;
- }
-
- //
- // From any class type S to any interface T, provided S is not sealed
- // and provided S does not implement T.
- //
- if (target_type.IsInterface && !source_type.IsSealed &&
- !TypeManager.ImplementsInterface (source_type, target_type))
- return true;
-
- //
- // From any interface-type S to to any class type T, provided T is not
- // sealed, or provided T implements S.
- //
- if (source_type.IsInterface &&
- (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type)))
- return true;
-
-
- // From an array type S with an element type Se to an array type T with an
- // element type Te provided all the following are true:
- // * S and T differe only in element type, in other words, S and T
- // have the same number of dimensions.
- // * Both Se and Te are reference types
- // * An explicit referenc conversions exist from Se to Te
- //
- if (source_type.IsArray && target_type.IsArray) {
- if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type source_element_type = source_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!source_element_type.IsValueType && !target_element_type.IsValueType)
- if (ExplicitReferenceConversionExists (source_element_type,
- target_element_type))
- return true;
- }
- }
-
-
- // From System.Array to any array-type
- if (source_type == TypeManager.array_type &&
- target_type.IsArray){
- return true;
- }
-
- //
- // From System delegate to any delegate-type
- //
- if (source_type == TypeManager.delegate_type &&
- target_type.IsSubclassOf (TypeManager.delegate_type))
- return true;
-
- //
- // From ICloneable to Array or Delegate types
- //
- if (source_type == TypeManager.icloneable_type &&
- (target_type == TypeManager.array_type ||
- target_type == TypeManager.delegate_type))
- return true;
-
- return false;
- }
-
- /// <summary>
- /// Implements Explicit Reference conversions
- /// </summary>
- static Expression ConvertReferenceExplicit (Expression source, Type target_type)
- {
- Type source_type = source.Type;
- bool target_is_value_type = target_type.IsValueType;
-
- //
- // From object to any reference type
- //
- if (source_type == TypeManager.object_type && !target_is_value_type)
- return new ClassCast (source, target_type);
-
-
- //
- // From any class S to any class-type T, provided S is a base class of T
- //
- if (target_type.IsSubclassOf (source_type))
- return new ClassCast (source, target_type);
-
- //
- // From any interface type S to any interface T provided S is not derived from T
- //
- if (source_type.IsInterface && target_type.IsInterface){
- if (TypeManager.ImplementsInterface (source_type, target_type))
- return null;
- else
- return new ClassCast (source, target_type);
- }
-
- //
- // From any class type S to any interface T, provides S is not sealed
- // and provided S does not implement T.
- //
- if (target_type.IsInterface && !source_type.IsSealed) {
- if (TypeManager.ImplementsInterface (source_type, target_type))
- return null;
- else
- return new ClassCast (source, target_type);
-
- }
-
- //
- // From any interface-type S to to any class type T, provided T is not
- // sealed, or provided T implements S.
- //
- if (source_type.IsInterface) {
- if (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type))
- return new ClassCast (source, target_type);
- else
- return null;
- }
-
- // From an array type S with an element type Se to an array type T with an
- // element type Te provided all the following are true:
- // * S and T differe only in element type, in other words, S and T
- // have the same number of dimensions.
- // * Both Se and Te are reference types
- // * An explicit referenc conversions exist from Se to Te
- //
- if (source_type.IsArray && target_type.IsArray) {
- if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type source_element_type = source_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!source_element_type.IsValueType && !target_element_type.IsValueType)
- if (ExplicitReferenceConversionExists (source_element_type,
- target_element_type))
- return new ClassCast (source, target_type);
- }
- }
-
-
- // From System.Array to any array-type
- if (source_type == TypeManager.array_type &&
- target_type.IsArray) {
- return new ClassCast (source, target_type);
- }
-
- //
- // From System delegate to any delegate-type
- //
- if (source_type == TypeManager.delegate_type &&
- target_type.IsSubclassOf (TypeManager.delegate_type))
- return new ClassCast (source, target_type);
-
- //
- // From ICloneable to Array or Delegate types
- //
- if (source_type == TypeManager.icloneable_type &&
- (target_type == TypeManager.array_type ||
- target_type == TypeManager.delegate_type))
- return new ClassCast (source, target_type);
-
- return null;
- }
-
- /// <summary>
- /// Performs an explicit conversion of the expression `expr' whose
- /// type is expr.Type to `target_type'.
- /// </summary>
- static public Expression ConvertExplicit (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression ne = ConvertImplicitStandard (ec, expr, target_type, loc);
-
- if (ne != null)
- return ne;
-
- ne = ConvertNumericExplicit (ec, expr, target_type);
- if (ne != null)
- return ne;
-
- //
- // Unboxing conversion.
- //
- if (expr_type == TypeManager.object_type && target_type.IsValueType)
- return new UnboxCast (expr, target_type);
-
- //
- // Enum types
- //
- if (expr_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression e;
-
- //
- // FIXME: Is there any reason we should have EnumConstant
- // dealt with here instead of just using always the
- // UnderlyingSystemType to wrap the type?
- //
- if (expr is EnumConstant)
- e = ((EnumConstant) expr).Child;
- else {
- e = new EmptyCast (expr, TypeManager.EnumToUnderlying (expr_type));
- }
-
- Expression t = ConvertImplicit (ec, e, target_type, loc);
- if (t != null)
- return t;
-
- return ConvertNumericExplicit (ec, e, target_type);
- }
-
- ne = ConvertReferenceExplicit (expr, target_type);
- if (ne != null)
- return ne;
-
- if (ec.InUnsafe){
- if (target_type.IsPointer){
- if (expr_type.IsPointer)
- return new EmptyCast (expr, target_type);
-
- if (expr_type == TypeManager.sbyte_type ||
- expr_type == TypeManager.byte_type ||
- expr_type == TypeManager.short_type ||
- expr_type == TypeManager.ushort_type ||
- expr_type == TypeManager.int32_type ||
- expr_type == TypeManager.uint32_type ||
- expr_type == TypeManager.uint64_type ||
- expr_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U);
- }
- if (expr_type.IsPointer){
- if (target_type == TypeManager.sbyte_type ||
- target_type == TypeManager.byte_type ||
- target_type == TypeManager.short_type ||
- target_type == TypeManager.ushort_type ||
- target_type == TypeManager.int32_type ||
- target_type == TypeManager.uint32_type ||
- target_type == TypeManager.uint64_type ||
- target_type == TypeManager.int64_type){
- Expression e = new EmptyCast (expr, TypeManager.uint32_type);
- Expression ci, ce;
-
- ci = ConvertImplicitStandard (ec, e, target_type, loc);
-
- if (ci != null)
- return ci;
-
- ce = ConvertNumericExplicit (ec, e, target_type);
- if (ce != null)
- return ce;
- //
- // We should always be able to go from an uint32
- // implicitly or explicitly to the other integral
- // types
- //
- throw new Exception ("Internal compiler error");
- }
- }
- }
-
- ne = ExplicitUserConversion (ec, expr, target_type, loc);
- if (ne != null)
- return ne;
-
- Error_CannotConvertType (loc, expr_type, target_type);
- return null;
- }
-
- /// <summary>
- /// Same as ConvertExplicit, only it doesn't include user defined conversions
- /// </summary>
- static public Expression ConvertExplicitStandard (EmitContext ec, Expression expr,
- Type target_type, Location l)
- {
- Expression ne = ConvertImplicitStandard (ec, expr, target_type, l);
-
- if (ne != null)
- return ne;
-
- ne = ConvertNumericExplicit (ec, expr, target_type);
- if (ne != null)
- return ne;
-
- ne = ConvertReferenceExplicit (expr, target_type);
- if (ne != null)
- return ne;
-
- Error_CannotConvertType (l, expr.Type, target_type);
- return null;
- }
-
- static string ExprClassName (ExprClass c)
- {
- switch (c){
- case ExprClass.Invalid:
- return "Invalid";
- case ExprClass.Value:
- return "value";
- case ExprClass.Variable:
- return "variable";
- case ExprClass.Namespace:
- return "namespace";
- case ExprClass.Type:
- return "type";
- case ExprClass.MethodGroup:
- return "method group";
- case ExprClass.PropertyAccess:
- return "property access";
- case ExprClass.EventAccess:
- return "event access";
- case ExprClass.IndexerAccess:
- return "indexer access";
- case ExprClass.Nothing:
- return "null";
- }
- throw new Exception ("Should not happen");
- }
-
- /// <summary>
- /// Reports that we were expecting `expr' to be of class `expected'
- /// </summary>
- protected void report118 (Location loc, Expression expr, string expected)
- {
- string kind = "Unknown";
-
- if (expr != null)
- kind = ExprClassName (expr.eclass);
-
- Error (118, loc, "Expression denotes a `" + kind +
- "' where a `" + expected + "' was expected");
- }
-
- static void Error_ConstantValueCannotBeConverted (Location l, string val, Type t)
- {
- Report.Error (31, l, "Constant value `" + val + "' cannot be converted to " +
- TypeManager.CSharpName (t));
- }
-
- public static void UnsafeError (Location loc)
- {
- Report.Error (214, loc, "Pointers may only be used in an unsafe context");
- }
-
- /// <summary>
- /// Converts the IntConstant, UIntConstant, LongConstant or
- /// ULongConstant into the integral target_type. Notice
- /// that we do not return an `Expression' we do return
- /// a boxed integral type.
- ///
- /// FIXME: Since I added the new constants, we need to
- /// also support conversions from CharConstant, ByteConstant,
- /// SByteConstant, UShortConstant, ShortConstant
- ///
- /// This is used by the switch statement, so the domain
- /// of work is restricted to the literals above, and the
- /// targets are int32, uint32, char, byte, sbyte, ushort,
- /// short, uint64 and int64
- /// </summary>
- public static object ConvertIntLiteral (Constant c, Type target_type, Location loc)
- {
- string s = "";
-
- if (c.Type == target_type)
- return ((Constant) c).GetValue ();
-
- //
- // Make into one of the literals we handle, we dont really care
- // about this value as we will just return a few limited types
- //
- if (c is EnumConstant)
- c = ((EnumConstant)c).WidenToCompilerConstant ();
-
- if (c is IntConstant){
- int v = ((IntConstant) c).Value;
-
- if (target_type == TypeManager.uint32_type){
- if (v >= 0)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v >= SByte.MinValue && v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v >= Int16.MinValue && v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v >= UInt16.MinValue && v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type){
- if (v > 0)
- return (ulong) v;
- }
-
- s = v.ToString ();
- } else if (c is UIntConstant){
- uint v = ((UIntConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- if (v <= Int32.MaxValue)
- return (int) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
- s = v.ToString ();
- } else if (c is LongConstant){
- long v = ((LongConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- if (v >= UInt32.MinValue && v <= UInt32.MaxValue)
- return (int) v;
- } else if (target_type == TypeManager.uint32_type){
- if (v >= 0 && v <= UInt32.MaxValue)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v >= SByte.MinValue && v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v >= Int16.MinValue && v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v >= UInt16.MinValue && v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.uint64_type){
- if (v > 0)
- return (ulong) v;
- }
- s = v.ToString ();
- } else if (c is ULongConstant){
- ulong v = ((ULongConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- if (v <= Int32.MaxValue)
- return (int) v;
- } else if (target_type == TypeManager.uint32_type){
- if (v <= UInt32.MaxValue)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= (int) SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= UInt16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v <= UInt16.MaxValue)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type){
- if (v <= Int64.MaxValue)
- return (long) v;
- }
- s = v.ToString ();
- } else if (c is ByteConstant){
- byte v = ((ByteConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type)
- return (uint) v;
- else if (target_type == TypeManager.char_type)
- return (char) v;
- else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type)
- return (short) v;
- else if (target_type == TypeManager.ushort_type)
- return (ushort) v;
- else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
- s = v.ToString ();
- } else if (c is SByteConstant){
- sbyte v = ((SByteConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type){
- if (v >= 0)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= 0)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= 0)
- return (byte) v;
- } else if (target_type == TypeManager.short_type)
- return (short) v;
- else if (target_type == TypeManager.ushort_type){
- if (v >= 0)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type){
- if (v >= 0)
- return (ulong) v;
- }
- s = v.ToString ();
- } else if (c is ShortConstant){
- short v = ((ShortConstant) c).Value;
-
- if (target_type == TypeManager.int32_type){
- return (int) v;
- } else if (target_type == TypeManager.uint32_type){
- if (v >= 0)
- return (uint) v;
- } else if (target_type == TypeManager.char_type){
- if (v >= 0)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v >= SByte.MinValue && v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.ushort_type){
- if (v >= 0)
- return (ushort) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
-
- s = v.ToString ();
- } else if (c is UShortConstant){
- ushort v = ((UShortConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type)
- return (uint) v;
- else if (target_type == TypeManager.char_type){
- if (v >= Char.MinValue && v <= Char.MaxValue)
- return (char) v;
- } else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= Int16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
-
- s = v.ToString ();
- } else if (c is CharConstant){
- char v = ((CharConstant) c).Value;
-
- if (target_type == TypeManager.int32_type)
- return (int) v;
- else if (target_type == TypeManager.uint32_type)
- return (uint) v;
- else if (target_type == TypeManager.byte_type){
- if (v >= Byte.MinValue && v <= Byte.MaxValue)
- return (byte) v;
- } else if (target_type == TypeManager.sbyte_type){
- if (v <= SByte.MaxValue)
- return (sbyte) v;
- } else if (target_type == TypeManager.short_type){
- if (v <= Int16.MaxValue)
- return (short) v;
- } else if (target_type == TypeManager.ushort_type)
- return (short) v;
- else if (target_type == TypeManager.int64_type)
- return (long) v;
- else if (target_type == TypeManager.uint64_type)
- return (ulong) v;
-
- s = v.ToString ();
- }
- Error_ConstantValueCannotBeConverted (loc, s, target_type);
- return null;
- }
-
- //
- // Load the object from the pointer.
- //
- public static void LoadFromPtr (ILGenerator ig, Type t)
- {
- if (t == TypeManager.int32_type)
- ig.Emit (OpCodes.Ldind_I4);
- else if (t == TypeManager.uint32_type)
- ig.Emit (OpCodes.Ldind_U4);
- else if (t == TypeManager.short_type)
- ig.Emit (OpCodes.Ldind_I2);
- else if (t == TypeManager.ushort_type)
- ig.Emit (OpCodes.Ldind_U2);
- else if (t == TypeManager.char_type)
- ig.Emit (OpCodes.Ldind_U2);
- else if (t == TypeManager.byte_type)
- ig.Emit (OpCodes.Ldind_U1);
- else if (t == TypeManager.sbyte_type)
- ig.Emit (OpCodes.Ldind_I1);
- else if (t == TypeManager.uint64_type)
- ig.Emit (OpCodes.Ldind_I8);
- else if (t == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldind_I8);
- else if (t == TypeManager.float_type)
- ig.Emit (OpCodes.Ldind_R4);
- else if (t == TypeManager.double_type)
- ig.Emit (OpCodes.Ldind_R8);
- else if (t == TypeManager.bool_type)
- ig.Emit (OpCodes.Ldind_I1);
- else if (t == TypeManager.intptr_type)
- ig.Emit (OpCodes.Ldind_I);
- else if (TypeManager.IsEnumType (t))
- LoadFromPtr (ig, TypeManager.EnumToUnderlying (t));
- else if (t.IsValueType)
- ig.Emit (OpCodes.Ldobj, t);
- else
- ig.Emit (OpCodes.Ldind_Ref);
- }
-
- //
- // The stack contains the pointer and the value of type `type'
- //
- public static void StoreFromPtr (ILGenerator ig, Type type)
- {
- if (type.IsEnum)
- type = TypeManager.EnumToUnderlying (type);
- if (type == TypeManager.int32_type || type == TypeManager.uint32_type)
- ig.Emit (OpCodes.Stind_I4);
- else if (type == TypeManager.int64_type || type == TypeManager.uint64_type)
- ig.Emit (OpCodes.Stind_I8);
- else if (type == TypeManager.char_type || type == TypeManager.short_type ||
- type == TypeManager.ushort_type)
- ig.Emit (OpCodes.Stind_I2);
- else if (type == TypeManager.float_type)
- ig.Emit (OpCodes.Stind_R4);
- else if (type == TypeManager.double_type)
- ig.Emit (OpCodes.Stind_R8);
- else if (type == TypeManager.byte_type || type == TypeManager.sbyte_type ||
- type == TypeManager.bool_type)
- ig.Emit (OpCodes.Stind_I1);
- else if (type == TypeManager.intptr_type)
- ig.Emit (OpCodes.Stind_I);
- else if (type.IsValueType)
- ig.Emit (OpCodes.Stobj, type);
- else
- ig.Emit (OpCodes.Stind_Ref);
- }
-
- //
- // Returns the size of type `t' if known, otherwise, 0
- //
- public static int GetTypeSize (Type t)
- {
- if (t == TypeManager.int32_type ||
- t == TypeManager.uint32_type ||
- t == TypeManager.float_type)
- return 4;
- else if (t == TypeManager.int64_type ||
- t == TypeManager.uint64_type ||
- t == TypeManager.double_type)
- return 8;
- else if (t == TypeManager.byte_type ||
- t == TypeManager.sbyte_type ||
- t == TypeManager.bool_type)
- return 1;
- else if (t == TypeManager.short_type ||
- t == TypeManager.char_type ||
- t == TypeManager.ushort_type)
- return 2;
- else
- return 0;
- }
-
- //
- // Default implementation of IAssignMethod.CacheTemporaries
- //
- public void CacheTemporaries (EmitContext ec)
- {
- }
- }
-
- /// <summary>
- /// This is just a base class for expressions that can
- /// appear on statements (invocations, object creation,
- /// assignments, post/pre increment and decrement). The idea
- /// being that they would support an extra Emition interface that
- /// does not leave a result on the stack.
- /// </summary>
- public abstract class ExpressionStatement : Expression {
-
- /// <summary>
- /// Requests the expression to be emitted in a `statement'
- /// context. This means that no new value is left on the
- /// stack after invoking this method (constrasted with
- /// Emit that will always leave a value on the stack).
- /// </summary>
- public abstract void EmitStatement (EmitContext ec);
- }
-
- /// <summary>
- /// This kind of cast is used to encapsulate the child
- /// whose type is child.Type into an expression that is
- /// reported to return "return_type". This is used to encapsulate
- /// expressions which have compatible types, but need to be dealt
- /// at higher levels with.
- ///
- /// For example, a "byte" expression could be encapsulated in one
- /// of these as an "unsigned int". The type for the expression
- /// would be "unsigned int".
- ///
- /// </summary>
- public class EmptyCast : Expression {
- protected Expression child;
-
- public EmptyCast (Expression child, Type return_type)
- {
- eclass = child.eclass;
- type = return_type;
- this.child = child;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- child.Emit (ec);
- }
- }
-
- /// <summary>
- /// This class is used to wrap literals which belong inside Enums
- /// </summary>
- public class EnumConstant : Constant {
- public Constant Child;
-
- public EnumConstant (Constant child, Type enum_type)
- {
- eclass = child.eclass;
- this.Child = child;
- type = enum_type;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Child.Emit (ec);
- }
-
- public override object GetValue ()
- {
- return Child.GetValue ();
- }
-
- //
- // Converts from one of the valid underlying types for an enumeration
- // (int32, uint32, int64, uint64, short, ushort, byte, sbyte) to
- // one of the internal compiler literals: Int/UInt/Long/ULong Literals.
- //
- public Constant WidenToCompilerConstant ()
- {
- Type t = TypeManager.EnumToUnderlying (Child.Type);
- object v = ((Constant) Child).GetValue ();;
-
- if (t == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (t == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (t == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (t == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (t == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (t == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (t == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (t == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
-
- throw new Exception ("Invalid enumeration underlying type: " + t);
- }
-
- //
- // Extracts the value in the enumeration on its native representation
- //
- public object GetPlainValue ()
- {
- Type t = TypeManager.EnumToUnderlying (Child.Type);
- object v = ((Constant) Child).GetValue ();;
-
- if (t == TypeManager.int32_type)
- return (int) v;
- if (t == TypeManager.uint32_type)
- return (uint) v;
- if (t == TypeManager.int64_type)
- return (long) v;
- if (t == TypeManager.uint64_type)
- return (ulong) v;
- if (t == TypeManager.short_type)
- return (short) v;
- if (t == TypeManager.ushort_type)
- return (ushort) v;
- if (t == TypeManager.byte_type)
- return (byte) v;
- if (t == TypeManager.sbyte_type)
- return (sbyte) v;
-
- return null;
- }
-
- public override string AsString ()
- {
- return Child.AsString ();
- }
-
- public override DoubleConstant ConvertToDouble ()
- {
- return Child.ConvertToDouble ();
- }
-
- public override FloatConstant ConvertToFloat ()
- {
- return Child.ConvertToFloat ();
- }
-
- public override ULongConstant ConvertToULong ()
- {
- return Child.ConvertToULong ();
- }
-
- public override LongConstant ConvertToLong ()
- {
- return Child.ConvertToLong ();
- }
-
- public override UIntConstant ConvertToUInt ()
- {
- return Child.ConvertToUInt ();
- }
-
- public override IntConstant ConvertToInt ()
- {
- return Child.ConvertToInt ();
- }
- }
-
- /// <summary>
- /// This kind of cast is used to encapsulate Value Types in objects.
- ///
- /// The effect of it is to box the value type emitted by the previous
- /// operation.
- /// </summary>
- public class BoxedCast : EmptyCast {
-
- public BoxedCast (Expression expr)
- : base (expr, TypeManager.object_type)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- base.Emit (ec);
-
- ec.ig.Emit (OpCodes.Box, child.Type);
- }
- }
-
- public class UnboxCast : EmptyCast {
- public UnboxCast (Expression expr, Type return_type)
- : base (expr, return_type)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Type t = type;
- ILGenerator ig = ec.ig;
-
- base.Emit (ec);
- ig.Emit (OpCodes.Unbox, t);
-
- LoadFromPtr (ig, t);
- }
- }
-
- /// <summary>
- /// This is used to perform explicit numeric conversions.
- ///
- /// Explicit numeric conversions might trigger exceptions in a checked
- /// context, so they should generate the conv.ovf opcodes instead of
- /// conv opcodes.
- /// </summary>
- public class ConvCast : EmptyCast {
- public enum Mode : byte {
- I1_U1, I1_U2, I1_U4, I1_U8, I1_CH,
- U1_I1, U1_CH,
- I2_I1, I2_U1, I2_U2, I2_U4, I2_U8, I2_CH,
- U2_I1, U2_U1, U2_I2, U2_CH,
- I4_I1, I4_U1, I4_I2, I4_U2, I4_U4, I4_U8, I4_CH,
- U4_I1, U4_U1, U4_I2, U4_U2, U4_I4, U4_CH,
- I8_I1, I8_U1, I8_I2, I8_U2, I8_I4, I8_U4, I8_U8, I8_CH,
- U8_I1, U8_U1, U8_I2, U8_U2, U8_I4, U8_U4, U8_I8, U8_CH,
- CH_I1, CH_U1, CH_I2,
- R4_I1, R4_U1, R4_I2, R4_U2, R4_I4, R4_U4, R4_I8, R4_U8, R4_CH,
- R8_I1, R8_U1, R8_I2, R8_U2, R8_I4, R8_U4, R8_I8, R8_U8, R8_CH, R8_R4
- }
-
- Mode mode;
- bool checked_state;
-
- public ConvCast (EmitContext ec, Expression child, Type return_type, Mode m)
- : base (child, return_type)
- {
- mode = m;
- checked_state = ec.CheckState;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- base.Emit (ec);
-
- if (checked_state){
- switch (mode){
- case Mode.I1_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I1_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I1_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I1_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I1_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U1_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U1_CH: /* nothing */ break;
-
- case Mode.I2_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.I2_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I2_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I2_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I2_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I2_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U2_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U2_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.U2_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
- case Mode.U2_CH: /* nothing */ break;
-
- case Mode.I4_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.I4_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I4_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.I4_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I4_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I4_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I4_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U4_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U4_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.U4_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
- case Mode.U4_U2: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
- case Mode.U4_I4: ig.Emit (OpCodes.Conv_Ovf_I4_Un); break;
- case Mode.U4_CH: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
-
- case Mode.I8_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.I8_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.I8_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.I8_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.I8_I4: ig.Emit (OpCodes.Conv_Ovf_I4); break;
- case Mode.I8_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.I8_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.I8_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.U8_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.U8_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.U8_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
- case Mode.U8_U2: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
- case Mode.U8_I4: ig.Emit (OpCodes.Conv_Ovf_I4_Un); break;
- case Mode.U8_U4: ig.Emit (OpCodes.Conv_Ovf_U4_Un); break;
- case Mode.U8_I8: ig.Emit (OpCodes.Conv_Ovf_I8_Un); break;
- case Mode.U8_CH: ig.Emit (OpCodes.Conv_Ovf_U2_Un); break;
-
- case Mode.CH_I1: ig.Emit (OpCodes.Conv_Ovf_I1_Un); break;
- case Mode.CH_U1: ig.Emit (OpCodes.Conv_Ovf_U1_Un); break;
- case Mode.CH_I2: ig.Emit (OpCodes.Conv_Ovf_I2_Un); break;
-
- case Mode.R4_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.R4_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.R4_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.R4_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.R4_I4: ig.Emit (OpCodes.Conv_Ovf_I4); break;
- case Mode.R4_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.R4_I8: ig.Emit (OpCodes.Conv_Ovf_I8); break;
- case Mode.R4_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.R4_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
-
- case Mode.R8_I1: ig.Emit (OpCodes.Conv_Ovf_I1); break;
- case Mode.R8_U1: ig.Emit (OpCodes.Conv_Ovf_U1); break;
- case Mode.R8_I2: ig.Emit (OpCodes.Conv_Ovf_I2); break;
- case Mode.R8_U2: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.R8_I4: ig.Emit (OpCodes.Conv_Ovf_I4); break;
- case Mode.R8_U4: ig.Emit (OpCodes.Conv_Ovf_U4); break;
- case Mode.R8_I8: ig.Emit (OpCodes.Conv_Ovf_I8); break;
- case Mode.R8_U8: ig.Emit (OpCodes.Conv_Ovf_U8); break;
- case Mode.R8_CH: ig.Emit (OpCodes.Conv_Ovf_U2); break;
- case Mode.R8_R4: ig.Emit (OpCodes.Conv_R4); break;
- }
- } else {
- switch (mode){
- case Mode.I1_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I1_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I1_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.I1_U8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.I1_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U1_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U1_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.I2_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.I2_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I2_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I2_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.I2_U8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.I2_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U2_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U2_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.U2_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.U2_CH: /* nothing */ break;
-
- case Mode.I4_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.I4_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I4_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.I4_U4: /* nothing */ break;
- case Mode.I4_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I4_U8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.I4_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U4_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U4_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.U4_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.U4_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.U4_I4: /* nothing */ break;
- case Mode.U4_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.I8_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.I8_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.I8_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.I8_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.I8_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.I8_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.I8_U8: /* nothing */ break;
- case Mode.I8_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.U8_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.U8_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.U8_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.U8_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.U8_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.U8_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.U8_I8: /* nothing */ break;
- case Mode.U8_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.CH_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.CH_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.CH_I2: ig.Emit (OpCodes.Conv_I2); break;
-
- case Mode.R4_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.R4_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.R4_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.R4_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.R4_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.R4_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.R4_I8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.R4_U8: ig.Emit (OpCodes.Conv_U8); break;
- case Mode.R4_CH: ig.Emit (OpCodes.Conv_U2); break;
-
- case Mode.R8_I1: ig.Emit (OpCodes.Conv_I1); break;
- case Mode.R8_U1: ig.Emit (OpCodes.Conv_U1); break;
- case Mode.R8_I2: ig.Emit (OpCodes.Conv_I2); break;
- case Mode.R8_U2: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.R8_I4: ig.Emit (OpCodes.Conv_I4); break;
- case Mode.R8_U4: ig.Emit (OpCodes.Conv_U4); break;
- case Mode.R8_I8: ig.Emit (OpCodes.Conv_I8); break;
- case Mode.R8_U8: ig.Emit (OpCodes.Conv_U8); break;
- case Mode.R8_CH: ig.Emit (OpCodes.Conv_U2); break;
- case Mode.R8_R4: ig.Emit (OpCodes.Conv_R4); break;
- }
- }
- }
- }
-
- public class OpcodeCast : EmptyCast {
- OpCode op, op2;
- bool second_valid;
-
- public OpcodeCast (Expression child, Type return_type, OpCode op)
- : base (child, return_type)
-
- {
- this.op = op;
- second_valid = false;
- }
-
- public OpcodeCast (Expression child, Type return_type, OpCode op, OpCode op2)
- : base (child, return_type)
-
- {
- this.op = op;
- this.op2 = op2;
- second_valid = true;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- base.Emit (ec);
- ec.ig.Emit (op);
-
- if (second_valid)
- ec.ig.Emit (op2);
- }
- }
-
- /// <summary>
- /// This kind of cast is used to encapsulate a child and cast it
- /// to the class requested
- /// </summary>
- public class ClassCast : EmptyCast {
- public ClassCast (Expression child, Type return_type)
- : base (child, return_type)
-
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- base.Emit (ec);
-
- ec.ig.Emit (OpCodes.Castclass, type);
- }
-
- }
-
- /// <summary>
- /// SimpleName expressions are initially formed of a single
- /// word and it only happens at the beginning of the expression.
- /// </summary>
- ///
- /// <remarks>
- /// The expression will try to be bound to a Field, a Method
- /// group or a Property. If those fail we pass the name to our
- /// caller and the SimpleName is compounded to perform a type
- /// lookup. The idea behind this process is that we want to avoid
- /// creating a namespace map from the assemblies, as that requires
- /// the GetExportedTypes function to be called and a hashtable to
- /// be constructed which reduces startup time. If later we find
- /// that this is slower, we should create a `NamespaceExpr' expression
- /// that fully participates in the resolution process.
- ///
- /// For example `System.Console.WriteLine' is decomposed into
- /// MemberAccess (MemberAccess (SimpleName ("System"), "Console"), "WriteLine")
- ///
- /// The first SimpleName wont produce a match on its own, so it will
- /// be turned into:
- /// MemberAccess (SimpleName ("System.Console"), "WriteLine").
- ///
- /// System.Console will produce a TypeExpr match.
- ///
- /// The downside of this is that we might be hitting `LookupType' too many
- /// times with this scheme.
- /// </remarks>
- public class SimpleName : Expression {
- public readonly string Name;
- public readonly Location Location;
-
- public SimpleName (string name, Location l)
- {
- Name = name;
- Location = l;
- }
-
- public static void Error120 (Location l, string name)
- {
- Report.Error (
- 120, l,
- "An object reference is required " +
- "for the non-static field `"+name+"'");
- }
-
- //
- // Checks whether we are trying to access an instance
- // property, method or field from a static body.
- //
- Expression MemberStaticCheck (Expression e)
- {
- if (e is FieldExpr){
- FieldInfo fi = ((FieldExpr) e).FieldInfo;
-
- if (!fi.IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else if (e is MethodGroupExpr){
- MethodGroupExpr mg = (MethodGroupExpr) e;
-
- if (!mg.RemoveInstanceMethods ()){
- Error120 (Location, mg.Methods [0].Name);
- return null;
- }
- return e;
- } else if (e is PropertyExpr){
- if (!((PropertyExpr) e).IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else if (e is EventExpr) {
- if (!((EventExpr) e).IsStatic) {
- Error120 (Location, Name);
- return null;
- }
- }
-
- return e;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- return SimpleNameResolve (ec, null, false);
- }
-
- public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- return SimpleNameResolve (ec, right_side, false);
- }
-
-
- public Expression DoResolveAllowStatic (EmitContext ec)
- {
- return SimpleNameResolve (ec, null, true);
- }
-
- /// <remarks>
- /// 7.5.2: Simple Names.
- ///
- /// Local Variables and Parameters are handled at
- /// parse time, so they never occur as SimpleNames.
- ///
- /// The `allow_static' flag is used by MemberAccess only
- /// and it is used to inform us that it is ok for us to
- /// avoid the static check, because MemberAccess might end
- /// up resolving the Name as a Type name and the access as
- /// a static type access.
- ///
- /// ie: Type Type; .... { Type.GetType (""); }
- ///
- /// Type is both an instance variable and a Type; Type.GetType
- /// is the static method not an instance method of type.
- /// </remarks>
- Expression SimpleNameResolve (EmitContext ec, Expression right_side, bool allow_static)
- {
- Expression e = null;
-
- //
- // Stage 1: Performed by the parser (binding to locals or parameters).
- //
- if (!ec.OnlyLookupTypes){
- Block current_block = ec.CurrentBlock;
- if (current_block != null && current_block.IsVariableDefined (Name)){
- LocalVariableReference var;
-
- var = new LocalVariableReference (ec.CurrentBlock, Name, Location);
-
- if (right_side != null)
- return var.ResolveLValue (ec, right_side);
- else
- return var.Resolve (ec);
- }
-
- //
- // Stage 2: Lookup members
- //
-
- //
- // For enums, the TypeBuilder is not ec.DeclSpace.TypeBuilder
- // Hence we have two different cases
- //
-
- DeclSpace lookup_ds = ec.DeclSpace;
- do {
- if (lookup_ds.TypeBuilder == null)
- break;
-
- e = MemberLookup (ec, lookup_ds.TypeBuilder, Name, Location);
- if (e != null)
- break;
-
- //
- // Classes/structs keep looking, enums break
- //
- if (lookup_ds is TypeContainer)
- lookup_ds = ((TypeContainer) lookup_ds).Parent;
- else
- break;
- } while (lookup_ds != null);
-
- if (e == null && ec.ContainerType != null)
- e = MemberLookup (ec, ec.ContainerType, Name, Location);
- }
-
- // Continuation of stage 2
- if (e == null){
- //
- // Stage 3: Lookup symbol in the various namespaces.
- //
- DeclSpace ds = ec.DeclSpace;
- Type t;
- string alias_value;
-
- if ((t = RootContext.LookupType (ds, Name, true, Location)) != null)
- return new TypeExpr (t);
-
- //
- // Stage 2 part b: Lookup up if we are an alias to a type
- // or a namespace.
- //
- // Since we are cheating: we only do the Alias lookup for
- // namespaces if the name does not include any dots in it
- //
-
- if (Name.IndexOf ('.') == -1 && (alias_value = ec.TypeContainer.LookupAlias (Name)) != null) {
- // System.Console.WriteLine (Name + " --> " + alias_value);
- if ((t = RootContext.LookupType (ds, alias_value, true, Location))
- != null)
- return new TypeExpr (t);
-
- // we have alias value, but it isn't Type, so try if it's namespace
- return new SimpleName (alias_value, Location);
- }
-
- // No match, maybe our parent can compose us
- // into something meaningful.
- return this;
- }
-
- //
- // Stage 2 continues here.
- //
- if (e is TypeExpr)
- return e;
-
- if (ec.OnlyLookupTypes)
- return null;
-
- if (e is FieldExpr){
- FieldExpr fe = (FieldExpr) e;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.FieldType.IsPointer && !ec.InUnsafe){
- UnsafeError (Location);
- }
-
- if (ec.IsStatic){
- if (!allow_static && !fi.IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else {
- // If we are not in static code and this
- // field is not static, set the instance to `this'.
-
- if (!fi.IsStatic)
- fe.InstanceExpression = ec.This;
- }
-
-
- if (fi is FieldBuilder) {
- Const c = TypeManager.LookupConstant ((FieldBuilder) fi);
-
- if (c != null) {
- object o = c.LookupConstantValue (ec);
- object real_value = ((Constant)c.Expr).GetValue ();
- return Constantify (real_value, fi.FieldType);
- }
- }
-
- if (fi.IsLiteral) {
- Type t = fi.FieldType;
- Type decl_type = fi.DeclaringType;
- object o;
-
- if (fi is FieldBuilder)
- o = TypeManager.GetValue ((FieldBuilder) fi);
- else
- o = fi.GetValue (fi);
-
- if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression enum_member = MemberLookup (
- ec, decl_type, "value__", MemberTypes.Field,
- AllBindingFlags, Location);
-
- Enum en = TypeManager.LookupEnum (decl_type);
-
- Constant c;
- if (en != null)
- c = Constantify (o, en.UnderlyingType);
- else
- c = Constantify (o, enum_member.Type);
-
- return new EnumConstant (c, decl_type);
- }
-
- Expression exp = Constantify (o, t);
- }
-
- return e;
- }
-
- if (e is EventExpr) {
- //
- // If the event is local to this class, we transform ourselves into
- // a FieldExpr
- //
- EventExpr ee = (EventExpr) e;
-
- Expression ml = MemberLookup (
- ec, ec.DeclSpace.TypeBuilder, ee.EventInfo.Name,
- MemberTypes.Event, AllBindingFlags, Location);
-
- if (ml != null) {
- MemberInfo mi = ec.TypeContainer.GetFieldFromEvent ((EventExpr) ml);
-
- if (mi == null) {
- //
- // If this happens, then we have an event with its own
- // accessors and private field etc so there's no need
- // to transform ourselves : we should instead flag an error
- //
- Assign.error70 (ee.EventInfo, Location);
- return null;
- }
-
- ml = ExprClassFromMemberInfo (ec, mi, Location);
-
- if (ml == null) {
- Report.Error (-200, Location, "Internal error!!");
- return null;
- }
-
- Expression instance_expr;
-
- FieldInfo fi = ((FieldExpr) ml).FieldInfo;
-
- if (fi.IsStatic)
- instance_expr = null;
- else {
- instance_expr = ec.This;
- instance_expr = instance_expr.Resolve (ec);
- }
-
- return MemberAccess.ResolveMemberAccess (ec, ml, instance_expr, Location, null);
- }
- }
-
-
- if (ec.IsStatic){
- if (allow_static)
- return e;
-
- return MemberStaticCheck (e);
- } else
- return e;
- }
-
- public override void Emit (EmitContext ec)
- {
- //
- // If this is ever reached, then we failed to
- // find the name as a namespace
- //
-
- Error (103, Location, "The name `" + Name +
- "' does not exist in the class `" +
- ec.DeclSpace.Name + "'");
- }
- }
-
- /// <summary>
- /// Fully resolved expression that evaluates to a type
- /// </summary>
- public class TypeExpr : Expression {
- public TypeExpr (Type t)
- {
- Type = t;
- eclass = ExprClass.Type;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- override public void Emit (EmitContext ec)
- {
- throw new Exception ("Implement me");
- }
- }
-
- /// <summary>
- /// MethodGroup Expression.
- ///
- /// This is a fully resolved expression that evaluates to a type
- /// </summary>
- public class MethodGroupExpr : Expression {
- public MethodBase [] Methods;
- Location loc;
- Expression instance_expression = null;
-
- public MethodGroupExpr (MemberInfo [] mi, Location l)
- {
- Methods = new MethodBase [mi.Length];
- mi.CopyTo (Methods, 0);
- eclass = ExprClass.MethodGroup;
- type = TypeManager.object_type;
- loc = l;
- }
-
- public MethodGroupExpr (ArrayList list, Location l)
- {
- Methods = new MethodBase [list.Count];
-
- try {
- list.CopyTo (Methods, 0);
- } catch {
- foreach (MemberInfo m in list){
- if (!(m is MethodBase)){
- Console.WriteLine ("Name " + m.Name);
- Console.WriteLine ("Found a: " + m.GetType ().FullName);
- }
- }
- throw;
- }
- loc = l;
- eclass = ExprClass.MethodGroup;
- type = TypeManager.object_type;
- }
-
- //
- // `A method group may have associated an instance expression'
- //
- public Expression InstanceExpression {
- get {
- return instance_expression;
- }
-
- set {
- instance_expression = value;
- }
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- public void ReportUsageError ()
- {
- Report.Error (654, loc, "Method `" + Methods [0].DeclaringType + "." +
- Methods [0].Name + "()' is referenced without parentheses");
- }
-
- override public void Emit (EmitContext ec)
- {
- ReportUsageError ();
- }
-
- bool RemoveMethods (bool keep_static)
- {
- ArrayList smethods = new ArrayList ();
-
- foreach (MethodBase mb in Methods){
- if (mb.IsStatic == keep_static)
- smethods.Add (mb);
- }
-
- if (smethods.Count == 0)
- return false;
-
- Methods = new MethodBase [smethods.Count];
- smethods.CopyTo (Methods, 0);
-
- return true;
- }
-
- /// <summary>
- /// Removes any instance methods from the MethodGroup, returns
- /// false if the resulting set is empty.
- /// </summary>
- public bool RemoveInstanceMethods ()
- {
- return RemoveMethods (true);
- }
-
- /// <summary>
- /// Removes any static methods from the MethodGroup, returns
- /// false if the resulting set is empty.
- /// </summary>
- public bool RemoveStaticMethods ()
- {
- return RemoveMethods (false);
- }
- }
-
- /// <summary>
- /// Fully resolved expression that evaluates to a Field
- /// </summary>
- public class FieldExpr : Expression, IAssignMethod, IMemoryLocation {
- public readonly FieldInfo FieldInfo;
- public Expression InstanceExpression;
- Location loc;
-
- public FieldExpr (FieldInfo fi, Location l)
- {
- FieldInfo = fi;
- eclass = ExprClass.Variable;
- type = fi.FieldType;
- loc = l;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- if (!FieldInfo.IsStatic){
- if (InstanceExpression == null){
- throw new Exception ("non-static FieldExpr without instance var\n" +
- "You have to assign the Instance variable\n" +
- "Of the FieldExpr to set this\n");
- }
-
- InstanceExpression = InstanceExpression.Resolve (ec);
- if (InstanceExpression == null)
- return null;
- }
-
- return this;
- }
-
- void Report_AssignToReadonly (bool is_instance)
- {
- string msg;
-
- if (is_instance)
- msg = "Readonly field can not be assigned outside " +
- "of constructor or variable initializer";
- else
- msg = "A static readonly field can only be assigned in " +
- "a static constructor";
-
- Report.Error (is_instance ? 191 : 198, loc, msg);
- }
-
- override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- Expression e = DoResolve (ec);
-
- if (e == null)
- return null;
-
- if (!FieldInfo.IsInitOnly)
- return this;
-
- //
- // InitOnly fields can only be assigned in constructors
- //
-
- if (ec.IsConstructor)
- return this;
-
- Report_AssignToReadonly (true);
-
- return null;
- }
-
- override public void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- bool is_volatile = false;
-
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
-
- if ((f.ModFlags & Modifiers.VOLATILE) != 0)
- is_volatile = true;
-
- f.status |= Field.Status.USED;
- }
-
- if (FieldInfo.IsStatic){
- if (is_volatile)
- ig.Emit (OpCodes.Volatile);
-
- ig.Emit (OpCodes.Ldsfld, FieldInfo);
- } else {
- if (InstanceExpression.Type.IsValueType){
- IMemoryLocation ml;
- LocalTemporary tempo = null;
-
- if (!(InstanceExpression is IMemoryLocation)){
- tempo = new LocalTemporary (
- ec, InstanceExpression.Type);
-
- InstanceExpression.Emit (ec);
- tempo.Store (ec);
- ml = tempo;
- } else
- ml = (IMemoryLocation) InstanceExpression;
-
- ml.AddressOf (ec, AddressOp.Load);
- } else
- InstanceExpression.Emit (ec);
-
- if (is_volatile)
- ig.Emit (OpCodes.Volatile);
-
- ig.Emit (OpCodes.Ldfld, FieldInfo);
- }
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- FieldAttributes fa = FieldInfo.Attributes;
- bool is_static = (fa & FieldAttributes.Static) != 0;
- bool is_readonly = (fa & FieldAttributes.InitOnly) != 0;
- ILGenerator ig = ec.ig;
-
- if (is_readonly && !ec.IsConstructor){
- Report_AssignToReadonly (!is_static);
- return;
- }
-
- if (!is_static){
- Expression instance = InstanceExpression;
-
- if (instance.Type.IsValueType){
- if (instance is IMemoryLocation){
- IMemoryLocation ml = (IMemoryLocation) instance;
-
- ml.AddressOf (ec, AddressOp.Store);
- } else
- throw new Exception ("The " + instance + " of type " +
- instance.Type +
- " represents a ValueType and does " +
- "not implement IMemoryLocation");
- } else
- instance.Emit (ec);
- }
- source.Emit (ec);
-
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
-
- if ((f.ModFlags & Modifiers.VOLATILE) != 0)
- ig.Emit (OpCodes.Volatile);
- }
-
- if (is_static)
- ig.Emit (OpCodes.Stsfld, FieldInfo);
- else
- ig.Emit (OpCodes.Stfld, FieldInfo);
-
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
-
- f.status |= Field.Status.ASSIGNED;
- }
- }
-
- public void AddressOf (EmitContext ec, AddressOp mode)
- {
- ILGenerator ig = ec.ig;
-
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
- if ((f.ModFlags & Modifiers.VOLATILE) != 0)
- ig.Emit (OpCodes.Volatile);
- }
-
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
-
- if ((mode & AddressOp.Store) != 0)
- f.status |= Field.Status.ASSIGNED;
- if ((mode & AddressOp.Load) != 0)
- f.status |= Field.Status.USED;
- }
-
- //
- // Handle initonly fields specially: make a copy and then
- // get the address of the copy.
- //
- if (FieldInfo.IsInitOnly){
- LocalBuilder local;
-
- Emit (ec);
- local = ig.DeclareLocal (type);
- ig.Emit (OpCodes.Stloc, local);
- ig.Emit (OpCodes.Ldloca, local);
- return;
- }
-
- if (FieldInfo.IsStatic)
- ig.Emit (OpCodes.Ldsflda, FieldInfo);
- else {
- InstanceExpression.Emit (ec);
- ig.Emit (OpCodes.Ldflda, FieldInfo);
- }
- }
- }
-
- /// <summary>
- /// Expression that evaluates to a Property. The Assign class
- /// might set the `Value' expression if we are in an assignment.
- ///
- /// This is not an LValue because we need to re-write the expression, we
- /// can not take data from the stack and store it.
- /// </summary>
- public class PropertyExpr : ExpressionStatement, IAssignMethod {
- public readonly PropertyInfo PropertyInfo;
- public readonly bool IsStatic;
- public bool IsBase;
- MethodInfo [] Accessors;
- Location loc;
-
- Expression instance_expr;
-
- public PropertyExpr (PropertyInfo pi, Location l)
- {
- PropertyInfo = pi;
- eclass = ExprClass.PropertyAccess;
- IsStatic = false;
- loc = l;
- Accessors = TypeManager.GetAccessors (pi);
-
- if (Accessors != null)
- foreach (MethodInfo mi in Accessors){
- if (mi != null)
- if (mi.IsStatic)
- IsStatic = true;
- }
- else
- Accessors = new MethodInfo [2];
-
- type = pi.PropertyType;
- }
-
- //
- // The instance expression associated with this expression
- //
- public Expression InstanceExpression {
- set {
- instance_expr = value;
- }
-
- get {
- return instance_expr;
- }
- }
-
- public bool VerifyAssignable ()
- {
- if (!PropertyInfo.CanWrite){
- Report.Error (200, loc,
- "The property `" + PropertyInfo.Name +
- "' can not be assigned to, as it has not set accessor");
- return false;
- }
-
- return true;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- if (!PropertyInfo.CanRead){
- Report.Error (154, loc,
- "The property `" + PropertyInfo.Name +
- "' can not be used in " +
- "this context because it lacks a get accessor");
- return null;
- }
-
- type = PropertyInfo.PropertyType;
-
- return this;
- }
-
- override public void Emit (EmitContext ec)
- {
- MethodInfo method = Accessors [0];
-
- //
- // Special case: length of single dimension array is turned into ldlen
- //
- if (method == TypeManager.int_array_get_length){
- Type iet = instance_expr.Type;
-
- //
- // System.Array.Length can be called, but the Type does not
- // support invoking GetArrayRank, so test for that case first
- //
- if (iet != TypeManager.array_type && (iet.GetArrayRank () == 1)){
- instance_expr.Emit (ec);
- ec.ig.Emit (OpCodes.Ldlen);
- return;
- }
- }
-
- Invocation.EmitCall (ec, IsBase, IsStatic, instance_expr, method, null, loc);
-
- }
-
- //
- // Implements the IAssignMethod interface for assignments
- //
- public void EmitAssign (EmitContext ec, Expression source)
- {
- Argument arg = new Argument (source, Argument.AType.Expression);
- ArrayList args = new ArrayList ();
-
- args.Add (arg);
- Invocation.EmitCall (ec, false, IsStatic, instance_expr, Accessors [1], args, loc);
- }
-
- override public void EmitStatement (EmitContext ec)
- {
- Emit (ec);
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- /// <summary>
- /// Fully resolved expression that evaluates to an Event
- /// </summary>
- public class EventExpr : Expression {
- public readonly EventInfo EventInfo;
- Location loc;
- public Expression InstanceExpression;
-
- public readonly bool IsStatic;
-
- MethodInfo add_accessor, remove_accessor;
-
- public EventExpr (EventInfo ei, Location loc)
- {
- EventInfo = ei;
- this.loc = loc;
- eclass = ExprClass.EventAccess;
-
- add_accessor = TypeManager.GetAddMethod (ei);
- remove_accessor = TypeManager.GetRemoveMethod (ei);
-
- if (add_accessor.IsStatic || remove_accessor.IsStatic)
- IsStatic = true;
-
- if (EventInfo is MyEventBuilder)
- type = ((MyEventBuilder) EventInfo).EventType;
- else
- type = EventInfo.EventHandlerType;
- }
-
- override public Expression DoResolve (EmitContext ec)
- {
- // We are born fully resolved
- return this;
- }
-
- override public void Emit (EmitContext ec)
- {
- throw new Exception ("Should not happen I think");
- }
-
- public void EmitAddOrRemove (EmitContext ec, Expression source)
- {
- Expression handler = ((Binary) source).Right;
-
- Argument arg = new Argument (handler, Argument.AType.Expression);
- ArrayList args = new ArrayList ();
-
- args.Add (arg);
-
- if (((Binary) source).Oper == Binary.Operator.Addition)
- Invocation.EmitCall (
- ec, false, IsStatic, InstanceExpression, add_accessor, args, loc);
- else
- Invocation.EmitCall (
- ec, false, IsStatic, InstanceExpression, remove_accessor, args, loc);
- }
- }
-}
diff --git a/mcs/mbas/enum.cs b/mcs/mbas/enum.cs
deleted file mode 100644
index fc2bae1b297..00000000000
--- a/mcs/mbas/enum.cs
+++ /dev/null
@@ -1,470 +0,0 @@
-//
-// enum.cs: Enum handling.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-// Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Enumeration container
- /// </summary>
- public class Enum : DeclSpace {
-
- ArrayList ordered_enums;
- public readonly string BaseType;
- public Attributes OptAttributes;
-
- public Type UnderlyingType;
-
- Hashtable member_to_location;
- Hashtable member_to_attributes;
-
- //
- // This is for members that have been defined
- //
- Hashtable member_to_value;
-
- ArrayList field_builders;
-
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE;
-
- public Enum (TypeContainer parent, string type, int mod_flags, string name, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- this.BaseType = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC, l);
- OptAttributes = attrs;
-
- ordered_enums = new ArrayList ();
- member_to_location = new Hashtable ();
- member_to_value = new Hashtable ();
- field_builders = new ArrayList ();
- }
-
- /// <summary>
- /// Adds @name to the enumeration space, with @expr
- /// being its definition.
- /// </summary>
- public AdditionResult AddEnumMember (string name, Expression expr, Location loc,
- Attributes opt_attrs)
- {
- if (defined_names.Contains (name))
- return AdditionResult.NameExists;
-
- DefineName (name, expr);
-
- ordered_enums.Add (name);
- member_to_location.Add (name, loc);
-
- if (member_to_attributes == null)
- member_to_attributes = new Hashtable ();
-
- member_to_attributes.Add (name, opt_attrs);
-
- return AdditionResult.Success;
- }
-
- //
- // This is used by corlib compilation: we map from our
- // type to a type that is consumable by the DefineField
- //
- Type MapToInternalType (Type t)
- {
- if (t == TypeManager.int32_type)
- return typeof (int);
- if (t == TypeManager.int64_type)
- return typeof (long);
- if (t == TypeManager.uint32_type)
- return typeof (uint);
- if (t == TypeManager.uint64_type)
- return typeof (ulong);
- if (t == TypeManager.float_type)
- return typeof (float);
- if (t == TypeManager.double_type)
- return typeof (double);
- if (t == TypeManager.byte_type)
- return typeof (byte);
- if (t == TypeManager.sbyte_type)
- return typeof (sbyte);
- if (t == TypeManager.char_type)
- return typeof (char);
- if (t == TypeManager.short_type)
- return typeof (short);
- if (t == TypeManager.ushort_type)
- return typeof (ushort);
-
- throw new Exception ();
- }
-
- public override TypeBuilder DefineType ()
- {
- if (TypeBuilder != null)
- return TypeBuilder;
-
- TypeAttributes attr = TypeAttributes.Class | TypeAttributes.Sealed;
-
- UnderlyingType = TypeManager.LookupType (BaseType);
-
- if (UnderlyingType != TypeManager.int32_type &&
- UnderlyingType != TypeManager.uint32_type &&
- UnderlyingType != TypeManager.int64_type &&
- UnderlyingType != TypeManager.uint64_type &&
- UnderlyingType != TypeManager.short_type &&
- UnderlyingType != TypeManager.ushort_type &&
- UnderlyingType != TypeManager.byte_type &&
- UnderlyingType != TypeManager.sbyte_type) {
- Report.Error (1008, Location,
- "Type byte, sbyte, short, ushort, int, uint, " +
- "long, or ulong expected (got: " +
- TypeManager.CSharpName (UnderlyingType) + ")");
- return null;
- }
-
- if (IsTopLevel) {
- ModuleBuilder builder = CodeGen.ModuleBuilder;
-
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- attr |= TypeAttributes.Public;
- else
- attr |= TypeAttributes.NotPublic;
-
- TypeBuilder = builder.DefineType (Name, attr, TypeManager.enum_type);
- } else {
- TypeBuilder builder = Parent.TypeBuilder;
-
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- attr |= TypeAttributes.NestedPublic;
- else
- attr |= TypeAttributes.NestedPrivate;
-
-
- TypeBuilder = builder.DefineNestedType (
- Basename, attr, TypeManager.enum_type);
- }
-
- //
- // Call MapToInternalType for corlib
- //
- TypeBuilder.DefineField ("value__", UnderlyingType,
- FieldAttributes.Public | FieldAttributes.SpecialName
- | FieldAttributes.RTSpecialName);
-
- TypeManager.AddEnumType (Name, TypeBuilder, this);
-
- return TypeBuilder;
- }
-
- bool IsValidEnumConstant (Expression e)
- {
- if (!(e is Constant))
- return false;
-
- if (e is IntConstant || e is UIntConstant || e is LongConstant ||
- e is ByteConstant || e is SByteConstant || e is ShortConstant ||
- e is UShortConstant || e is ULongConstant || e is EnumConstant)
- return true;
- else
- return false;
- }
-
- object GetNextDefaultValue (object default_value)
- {
- if (UnderlyingType == TypeManager.int32_type) {
- int i = (int) default_value;
-
- if (i < System.Int32.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.uint32_type) {
- uint i = (uint) default_value;
-
- if (i < System.UInt32.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.int64_type) {
- long i = (long) default_value;
-
- if (i < System.Int64.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.uint64_type) {
- ulong i = (ulong) default_value;
-
- if (i < System.UInt64.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.short_type) {
- short i = (short) default_value;
-
- if (i < System.Int16.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.ushort_type) {
- ushort i = (ushort) default_value;
-
- if (i < System.UInt16.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.byte_type) {
- byte i = (byte) default_value;
-
- if (i < System.Byte.MaxValue)
- return ++i;
- else
- return null;
- } else if (UnderlyingType == TypeManager.sbyte_type) {
- sbyte i = (sbyte) default_value;
-
- if (i < System.SByte.MaxValue)
- return ++i;
- else
- return null;
- }
-
- return null;
- }
-
- void Error_ConstantValueCannotBeConverted (object val, Location loc)
- {
- if (val is Constant)
- Report.Error (31, loc, "Constant value '" + ((Constant) val).AsString () +
- "' cannot be converted" +
- " to a " + TypeManager.CSharpName (UnderlyingType));
- else
- Report.Error (31, loc, "Constant value '" + val +
- "' cannot be converted" +
- " to a " + TypeManager.CSharpName (UnderlyingType));
- return;
- }
-
- /// <summary>
- /// This is used to lookup the value of an enum member. If the member is undefined,
- /// it attempts to define it and return its value
- /// </summary>
- public object LookupEnumValue (EmitContext ec, string name, Location loc)
- {
- object default_value = null;
- Constant c = null;
-
- default_value = member_to_value [name];
-
- if (default_value != null)
- return default_value;
-
- //
- // This may happen if we're calling a method in System.Enum, for instance
- // Enum.IsDefined().
- //
- if (!defined_names.Contains (name))
- return null;
-
- //
- // So if the above doesn't happen, we have a member that is undefined
- // We now proceed to define it
- //
- Expression val = this [name];
-
- if (val == null) {
-
- int idx = ordered_enums.IndexOf (name);
-
- if (idx == 0)
- default_value = 0;
- else {
- for (int i = 0; i < idx; ++i) {
- string n = (string) ordered_enums [i];
- Location m_loc = (Mono.CSharp.Location)
- member_to_location [n];
- default_value = LookupEnumValue (ec, n, m_loc);
- }
-
- default_value = GetNextDefaultValue (default_value);
- }
-
- } else {
- bool old = ec.InEnumContext;
- ec.InEnumContext = true;
- val = val.Resolve (ec);
- ec.InEnumContext = old;
-
- if (val == null) {
- Report.Error (-12, loc, "Definition is circular.");
- return null;
- }
-
- if (IsValidEnumConstant (val)) {
- c = (Constant) val;
- default_value = c.GetValue ();
-
- if (default_value == null) {
- Error_ConstantValueCannotBeConverted (c, loc);
- return null;
- }
-
- } else {
- Report.Error (
- 1008, loc,
- "Type byte, sbyte, short, ushort, int, uint, long, or " +
- "ulong expected (have: " + val + ")");
- return null;
- }
- }
-
- FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
- | FieldAttributes.Literal;
-
- FieldBuilder fb = TypeBuilder.DefineField (name, UnderlyingType, attr);
-
- try {
- default_value = TypeManager.ChangeType (default_value, UnderlyingType);
- } catch {
- Error_ConstantValueCannotBeConverted (c, loc);
- return null;
- }
-
- fb.SetConstant (default_value);
- field_builders.Add (fb);
- member_to_value [name] = default_value;
-
- if (!TypeManager.RegisterFieldValue (fb, default_value))
- return null;
-
- //
- // Now apply attributes
- //
- Attribute.ApplyAttributes (ec, fb, fb, (Attributes) member_to_attributes [name], loc);
-
- return default_value;
- }
-
- public override bool Define (TypeContainer parent)
- {
- //
- // If there was an error during DefineEnum, return
- //
- if (TypeBuilder == null)
- return false;
-
- EmitContext ec = new EmitContext (parent, this, Location, null,
- UnderlyingType, ModFlags, false);
-
- object default_value = 0;
-
- FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
- | FieldAttributes.Literal;
-
-
- foreach (string name in ordered_enums) {
- //
- // Have we already been defined, thanks to some cross-referencing ?
- //
- if (member_to_value.Contains (name))
- continue;
-
- Location loc = (Mono.CSharp.Location) member_to_location [name];
-
- if (this [name] != null) {
- default_value = LookupEnumValue (ec, name, loc);
-
- if (default_value == null)
- return true;
-
- } else {
- FieldBuilder fb = TypeBuilder.DefineField (
- name, UnderlyingType, attr);
-
- if (default_value == null) {
- Report.Error (543, loc, "Enumerator value for '" + name + "' is too large to " +
- "fit in its type");
- return false;
- }
-
- try {
- default_value = TypeManager.ChangeType (default_value, UnderlyingType);
- } catch {
- Error_ConstantValueCannotBeConverted (default_value, loc);
- return false;
- }
-
- fb.SetConstant (default_value);
- field_builders.Add (fb);
- member_to_value [name] = default_value;
-
- if (!TypeManager.RegisterFieldValue (fb, default_value))
- return false;
-
- //
- // Apply attributes on the enum member
- //
- Attribute.ApplyAttributes (ec, fb, fb, (Attributes) member_to_attributes [name], loc);
- }
-
- default_value = GetNextDefaultValue (default_value);
- }
-
- Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes, Location);
-
- return true;
- }
-
- //
- // Hack around System.Reflection as found everywhere else
- //
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if ((mt & MemberTypes.Field) != 0) {
- foreach (FieldBuilder fb in field_builders)
- if (filter (fb, criteria) == true)
- members.Add (fb);
- }
-
- int count = members.Count;
-
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
- }
-
- return null;
- }
-
- public ArrayList ValueNames {
- get {
- return ordered_enums;
- }
- }
-
- // indexer
- public Expression this [string name] {
- get {
- return (Expression) defined_names [name];
- }
- }
- }
-}
diff --git a/mcs/mbas/expression.cs b/mcs/mbas/expression.cs
deleted file mode 100644
index b30dcd28bac..00000000000
--- a/mcs/mbas/expression.cs
+++ /dev/null
@@ -1,6371 +0,0 @@
-//
-// expression.cs: Expression representation for the IL tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-#define USE_OLD
-
-namespace Mono.CSharp {
- using System;
- using System.Collections;
- using System.Reflection;
- using System.Reflection.Emit;
- using System.Text;
-
- /// <summary>
- /// This is just a helper class, it is generated by Unary, UnaryMutator
- /// when an overloaded method has been found. It just emits the code for a
- /// static call.
- /// </summary>
- public class StaticCallExpr : ExpressionStatement {
- ArrayList args;
- MethodInfo mi;
-
- StaticCallExpr (MethodInfo m, ArrayList a)
- {
- mi = m;
- args = a;
-
- type = m.ReturnType;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- if (args != null)
- Invocation.EmitArguments (ec, mi, args);
-
- ec.ig.Emit (OpCodes.Call, mi);
- return;
- }
-
- static public Expression MakeSimpleCall (EmitContext ec, MethodGroupExpr mg,
- Expression e, Location loc)
- {
- ArrayList args;
- MethodBase method;
-
- args = new ArrayList (1);
- args.Add (new Argument (e, Argument.AType.Expression));
- method = Invocation.OverloadResolve (ec, (MethodGroupExpr) mg, args, loc);
-
- if (method == null)
- return null;
-
- return new StaticCallExpr ((MethodInfo) method, args);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec);
- if (type != TypeManager.void_type)
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- /// <summary>
- /// Unary expressions.
- /// </summary>
- ///
- /// <remarks>
- /// Unary implements unary expressions. It derives from
- /// ExpressionStatement becuase the pre/post increment/decrement
- /// operators can be used in a statement context.
- /// </remarks>
- public class Unary : Expression {
- public enum Operator : byte {
- UnaryPlus, UnaryNegation, LogicalNot, OnesComplement,
- Indirection, AddressOf, TOP
- }
-
- public Operator Oper;
- public Expression Expr;
- Location loc;
-
- public Unary (Operator op, Expression expr, Location loc)
- {
- this.Oper = op;
- this.Expr = expr;
- this.loc = loc;
- }
-
- /// <summary>
- /// Returns a stringified representation of the Operator
- /// </summary>
- static public string OperName (Operator oper)
- {
- switch (oper){
- case Operator.UnaryPlus:
- return "+";
- case Operator.UnaryNegation:
- return "-";
- case Operator.LogicalNot:
- return "!";
- case Operator.OnesComplement:
- return "~";
- case Operator.AddressOf:
- return "&";
- case Operator.Indirection:
- return "*";
- }
-
- return oper.ToString ();
- }
-
- static string [] oper_names;
-
- static Unary ()
- {
- oper_names = new string [(int)Operator.TOP];
-
- oper_names [(int) Operator.UnaryPlus] = "op_UnaryPlus";
- oper_names [(int) Operator.UnaryNegation] = "op_UnaryNegation";
- oper_names [(int) Operator.LogicalNot] = "op_LogicalNot";
- oper_names [(int) Operator.OnesComplement] = "op_OnesComplement";
- oper_names [(int) Operator.Indirection] = "op_Indirection";
- oper_names [(int) Operator.AddressOf] = "op_AddressOf";
- }
-
- void Error23 (Type t)
- {
- Report.Error (
- 23, loc, "Operator " + OperName (Oper) +
- " cannot be applied to operand of type `" +
- TypeManager.CSharpName (t) + "'");
- }
-
- /// <remarks>
- /// The result has been already resolved:
- ///
- /// FIXME: a minus constant -128 sbyte cant be turned into a
- /// constant byte.
- /// </remarks>
- static Expression TryReduceNegative (Expression expr)
- {
- Expression e = null;
-
- if (expr is IntConstant)
- e = new IntConstant (-((IntConstant) expr).Value);
- else if (expr is UIntConstant){
- uint value = ((UIntConstant) expr).Value;
-
- if (value < 2147483649)
- return new IntConstant (-(int)value);
- else
- e = new LongConstant (value);
- }
- else if (expr is LongConstant)
- e = new LongConstant (-((LongConstant) expr).Value);
- else if (expr is ULongConstant){
- ulong value = ((ULongConstant) expr).Value;
-
- if (value < 9223372036854775809)
- return new LongConstant(-(long)value);
- }
- else if (expr is FloatConstant)
- e = new FloatConstant (-((FloatConstant) expr).Value);
- else if (expr is DoubleConstant)
- e = new DoubleConstant (-((DoubleConstant) expr).Value);
- else if (expr is DecimalConstant)
- e = new DecimalConstant (-((DecimalConstant) expr).Value);
- else if (expr is ShortConstant)
- e = new IntConstant (-((ShortConstant) expr).Value);
- else if (expr is UShortConstant)
- e = new IntConstant (-((UShortConstant) expr).Value);
- return e;
- }
-
- Expression Reduce (EmitContext ec, Expression e)
- {
- Type expr_type = e.Type;
-
- switch (Oper){
- case Operator.UnaryPlus:
- return e;
-
- case Operator.UnaryNegation:
- return TryReduceNegative (e);
-
- case Operator.LogicalNot:
- if (expr_type != TypeManager.bool_type) {
- Error23 (expr_type);
- return null;
- }
-
- BoolConstant b = (BoolConstant) e;
- return new BoolConstant (!(b.Value));
-
- case Operator.OnesComplement:
- if (!((expr_type == TypeManager.int32_type) ||
- (expr_type == TypeManager.uint32_type) ||
- (expr_type == TypeManager.int64_type) ||
- (expr_type == TypeManager.uint64_type) ||
- (expr_type.IsSubclassOf (TypeManager.enum_type)))){
- Error23 (expr_type);
- return null;
- }
-
- if (e is EnumConstant){
- EnumConstant enum_constant = (EnumConstant) e;
-
- Expression reduced = Reduce (ec, enum_constant.Child);
-
- return new EnumConstant ((Constant) reduced, enum_constant.Type);
- }
-
- if (expr_type == TypeManager.int32_type)
- return new IntConstant (~ ((IntConstant) e).Value);
- if (expr_type == TypeManager.uint32_type)
- return new UIntConstant (~ ((UIntConstant) e).Value);
- if (expr_type == TypeManager.int64_type)
- return new LongConstant (~ ((LongConstant) e).Value);
- if (expr_type == TypeManager.uint64_type)
- return new ULongConstant (~ ((ULongConstant) e).Value);
-
- Error23 (expr_type);
- return null;
- }
- throw new Exception ("Can not constant fold");
- }
-
- Expression ResolveOperator (EmitContext ec)
- {
- Type expr_type = Expr.Type;
-
- //
- // Step 1: Perform Operator Overload location
- //
- Expression mg;
- string op_name;
-
- op_name = oper_names [(int) Oper];
-
- mg = MemberLookup (ec, expr_type, op_name, MemberTypes.Method, AllBindingFlags, loc);
-
- if (mg != null) {
- Expression e = StaticCallExpr.MakeSimpleCall (
- ec, (MethodGroupExpr) mg, Expr, loc);
-
- if (e == null){
- Error23 (expr_type);
- return null;
- }
-
- return e;
- }
-
- // Only perform numeric promotions on:
- // +, -
-
- if (expr_type == null)
- return null;
-
- //
- // Step 2: Default operations on CLI native types.
- //
- if (Expr is Constant)
- return Reduce (ec, Expr);
-
- if (Oper == Operator.LogicalNot){
- if (expr_type != TypeManager.bool_type) {
- Error23 (Expr.Type);
- return null;
- }
-
- type = TypeManager.bool_type;
- return this;
- }
-
- if (Oper == Operator.OnesComplement) {
- if (!((expr_type == TypeManager.int32_type) ||
- (expr_type == TypeManager.uint32_type) ||
- (expr_type == TypeManager.int64_type) ||
- (expr_type == TypeManager.uint64_type) ||
- (expr_type.IsSubclassOf (TypeManager.enum_type)))){
- Expression e;
-
- e = ConvertImplicit (ec, Expr, TypeManager.int32_type, loc);
- if (e != null){
- type = TypeManager.int32_type;
- return this;
- }
- e = ConvertImplicit (ec, Expr, TypeManager.uint32_type, loc);
- if (e != null){
- type = TypeManager.uint32_type;
- return this;
- }
- e = ConvertImplicit (ec, Expr, TypeManager.int64_type, loc);
- if (e != null){
- type = TypeManager.int64_type;
- return this;
- }
- e = ConvertImplicit (ec, Expr, TypeManager.uint64_type, loc);
- if (e != null){
- type = TypeManager.uint64_type;
- return this;
- }
- Error23 (expr_type);
- return null;
- }
- type = expr_type;
- return this;
- }
-
- if (Oper == Operator.UnaryPlus) {
- //
- // A plus in front of something is just a no-op, so return the child.
- //
- return Expr;
- }
-
- //
- // Deals with -literals
- // int operator- (int x)
- // long operator- (long x)
- // float operator- (float f)
- // double operator- (double d)
- // decimal operator- (decimal d)
- //
- if (Oper == Operator.UnaryNegation){
- Expression e = null;
-
- //
- // transform - - expr into expr
- //
- if (Expr is Unary){
- Unary unary = (Unary) Expr;
-
- if (unary.Oper == Operator.UnaryNegation)
- return unary.Expr;
- }
-
- //
- // perform numeric promotions to int,
- // long, double.
- //
- //
- // The following is inneficient, because we call
- // ConvertImplicit too many times.
- //
- // It is also not clear if we should convert to Float
- // or Double initially.
- //
- if (expr_type == TypeManager.uint32_type){
- //
- // FIXME: handle exception to this rule that
- // permits the int value -2147483648 (-2^31) to
- // bt wrote as a decimal interger literal
- //
- type = TypeManager.int64_type;
- Expr = ConvertImplicit (ec, Expr, type, loc);
- return this;
- }
-
- if (expr_type == TypeManager.uint64_type){
- //
- // FIXME: Handle exception of `long value'
- // -92233720368547758087 (-2^63) to be wrote as
- // decimal integer literal.
- //
- Error23 (expr_type);
- return null;
- }
-
- if (expr_type == TypeManager.float_type){
- type = expr_type;
- return this;
- }
-
- e = ConvertImplicit (ec, Expr, TypeManager.int32_type, loc);
- if (e != null){
- Expr = e;
- type = e.Type;
- return this;
- }
-
- e = ConvertImplicit (ec, Expr, TypeManager.int64_type, loc);
- if (e != null){
- Expr = e;
- type = e.Type;
- return this;
- }
-
- e = ConvertImplicit (ec, Expr, TypeManager.double_type, loc);
- if (e != null){
- Expr = e;
- type = e.Type;
- return this;
- }
-
- Error23 (expr_type);
- return null;
- }
-
- if (Oper == Operator.AddressOf){
- if (Expr.eclass != ExprClass.Variable){
- Error (211, loc, "Cannot take the address of non-variables");
- return null;
- }
-
- if (!ec.InUnsafe) {
- UnsafeError (loc);
- return null;
- }
-
- if (!TypeManager.VerifyUnManaged (Expr.Type, loc)){
- return null;
- }
-
- string ptr_type_name = Expr.Type.FullName + "*";
- type = TypeManager.LookupType (ptr_type_name);
-
- return this;
- }
-
- if (Oper == Operator.Indirection){
- if (!ec.InUnsafe){
- UnsafeError (loc);
- return null;
- }
-
- if (!expr_type.IsPointer){
- Report.Error (
- 193, loc,
- "The * or -> operator can only be applied to pointers");
- return null;
- }
-
- //
- // We create an Indirection expression, because
- // it can implement the IMemoryLocation.
- //
- return new Indirection (Expr);
- }
-
- Error (187, loc, "No such operator '" + OperName (Oper) + "' defined for type '" +
- TypeManager.CSharpName (expr_type) + "'");
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expr = Expr.Resolve (ec);
-
- if (Expr == null)
- return null;
-
- eclass = ExprClass.Value;
- return ResolveOperator (ec);
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Type expr_type = Expr.Type;
-
- switch (Oper) {
- case Operator.UnaryPlus:
- throw new Exception ("This should be caught by Resolve");
-
- case Operator.UnaryNegation:
- Expr.Emit (ec);
- ig.Emit (OpCodes.Neg);
- break;
-
- case Operator.LogicalNot:
- Expr.Emit (ec);
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Ceq);
- break;
-
- case Operator.OnesComplement:
- Expr.Emit (ec);
- ig.Emit (OpCodes.Not);
- break;
-
- case Operator.AddressOf:
- ((IMemoryLocation)Expr).AddressOf (ec, AddressOp.LoadStore);
- break;
-
- default:
- throw new Exception ("This should not happen: Operator = "
- + Oper.ToString ());
- }
- }
-
- /// <summary>
- /// This will emit the child expression for `ec' avoiding the logical
- /// not. The parent will take care of changing brfalse/brtrue
- /// </summary>
- public void EmitLogicalNot (EmitContext ec)
- {
- if (Oper != Operator.LogicalNot)
- throw new Exception ("EmitLogicalNot can only be called with !expr");
-
- Expr.Emit (ec);
- }
-
- public override string ToString ()
- {
- return "Unary (" + Oper + ", " + Expr + ")";
- }
-
- }
-
- //
- // Unary operators are turned into Indirection expressions
- // after semantic analysis (this is so we can take the address
- // of an indirection).
- //
- public class Indirection : Expression, IMemoryLocation, IAssignMethod {
- Expression expr;
- LocalTemporary temporary;
- bool have_temporary;
-
- public Indirection (Expression expr)
- {
- this.expr = expr;
- this.type = expr.Type.GetElementType ();
- eclass = ExprClass.Variable;
- }
-
- void LoadExprValue (EmitContext ec)
- {
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- if (temporary != null){
- if (have_temporary){
- temporary.Emit (ec);
- return;
- }
- expr.Emit (ec);
- ec.ig.Emit (OpCodes.Dup);
- temporary.Store (ec);
- have_temporary = true;
- } else
- expr.Emit (ec);
-
- LoadFromPtr (ig, Type);
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- if (temporary != null){
- if (have_temporary){
- temporary.Emit (ec);
- return;
- }
- expr.Emit (ec);
- ec.ig.Emit (OpCodes.Dup);
- temporary.Store (ec);
- have_temporary = true;
- } else
- expr.Emit (ec);
-
- source.Emit (ec);
- StoreFromPtr (ec.ig, type);
- }
-
- public void AddressOf (EmitContext ec, AddressOp Mode)
- {
- if (temporary != null){
- if (have_temporary){
- temporary.Emit (ec);
- return;
- }
- expr.Emit (ec);
- ec.ig.Emit (OpCodes.Dup);
- temporary.Store (ec);
- have_temporary = true;
- } else
- expr.Emit (ec);
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // Born fully resolved
- //
- return this;
- }
-
- public new void CacheTemporaries (EmitContext ec)
- {
- temporary = new LocalTemporary (ec, type);
- }
- }
-
- /// <summary>
- /// Unary Mutator expressions (pre and post ++ and --)
- /// </summary>
- ///
- /// <remarks>
- /// UnaryMutator implements ++ and -- expressions. It derives from
- /// ExpressionStatement becuase the pre/post increment/decrement
- /// operators can be used in a statement context.
- ///
- /// FIXME: Idea, we could split this up in two classes, one simpler
- /// for the common case, and one with the extra fields for more complex
- /// classes (indexers require temporary access; overloaded require method)
- ///
- /// Maybe we should have classes PreIncrement, PostIncrement, PreDecrement,
- /// PostDecrement, that way we could save the `Mode' byte as well.
- /// </remarks>
- public class UnaryMutator : ExpressionStatement {
- public enum Mode : byte {
- PreIncrement, PreDecrement, PostIncrement, PostDecrement
- }
-
- Mode mode;
- Location loc;
- Expression expr;
- LocalTemporary temp_storage;
-
- //
- // This is expensive for the simplest case.
- //
- Expression method;
-
- public UnaryMutator (Mode m, Expression e, Location l)
- {
- mode = m;
- loc = l;
- expr = e;
- }
-
- static string OperName (Mode mode)
- {
- return (mode == Mode.PreIncrement || mode == Mode.PostIncrement) ?
- "++" : "--";
- }
-
- void Error23 (Type t)
- {
- Report.Error (
- 23, loc, "Operator " + OperName (mode) +
- " cannot be applied to operand of type `" +
- TypeManager.CSharpName (t) + "'");
- }
-
- /// <summary>
- /// Returns whether an object of type `t' can be incremented
- /// or decremented with add/sub (ie, basically whether we can
- /// use pre-post incr-decr operations on it, but it is not a
- /// System.Decimal, which we require operator overloading to catch)
- /// </summary>
- static bool IsIncrementableNumber (Type t)
- {
- return (t == TypeManager.sbyte_type) ||
- (t == TypeManager.byte_type) ||
- (t == TypeManager.short_type) ||
- (t == TypeManager.ushort_type) ||
- (t == TypeManager.int32_type) ||
- (t == TypeManager.uint32_type) ||
- (t == TypeManager.int64_type) ||
- (t == TypeManager.uint64_type) ||
- (t == TypeManager.char_type) ||
- (t.IsSubclassOf (TypeManager.enum_type)) ||
- (t == TypeManager.float_type) ||
- (t == TypeManager.double_type) ||
- (t.IsPointer && t != TypeManager.void_ptr_type);
- }
-
- Expression ResolveOperator (EmitContext ec)
- {
- Type expr_type = expr.Type;
-
- //
- // Step 1: Perform Operator Overload location
- //
- Expression mg;
- string op_name;
-
- if (mode == Mode.PreIncrement || mode == Mode.PostIncrement)
- op_name = "op_Increment";
- else
- op_name = "op_Decrement";
-
- mg = MemberLookup (ec, expr_type, op_name, MemberTypes.Method, AllBindingFlags, loc);
-
- if (mg == null && expr_type.BaseType != null)
- mg = MemberLookup (ec, expr_type.BaseType, op_name,
- MemberTypes.Method, AllBindingFlags, loc);
-
- if (mg != null) {
- method = StaticCallExpr.MakeSimpleCall (
- ec, (MethodGroupExpr) mg, expr, loc);
-
- type = method.Type;
- return this;
- }
-
- //
- // The operand of the prefix/postfix increment decrement operators
- // should be an expression that is classified as a variable,
- // a property access or an indexer access
- //
- type = expr_type;
- if (expr.eclass == ExprClass.Variable){
- if (IsIncrementableNumber (expr_type) ||
- expr_type == TypeManager.decimal_type){
- return this;
- }
- } else if (expr.eclass == ExprClass.IndexerAccess){
- IndexerAccess ia = (IndexerAccess) expr;
-
- temp_storage = new LocalTemporary (ec, expr.Type);
-
- expr = ia.ResolveLValue (ec, temp_storage);
- if (expr == null)
- return null;
-
- return this;
- } else if (expr.eclass == ExprClass.PropertyAccess){
- PropertyExpr pe = (PropertyExpr) expr;
-
- if (pe.VerifyAssignable ())
- return this;
-
- return null;
- } else {
- report118 (loc, expr, "variable, indexer or property access");
- return null;
- }
-
- Error (187, loc, "No such operator '" + OperName (mode) + "' defined for type '" +
- TypeManager.CSharpName (expr_type) + "'");
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
-
- if (expr == null)
- return null;
-
- eclass = ExprClass.Value;
- return ResolveOperator (ec);
- }
-
- static int PtrTypeSize (Type t)
- {
- return GetTypeSize (t.GetElementType ());
- }
-
- //
- // Loads the proper "1" into the stack based on the type
- //
- static void LoadOne (ILGenerator ig, Type t)
- {
- if (t == TypeManager.uint64_type || t == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldc_I8, 1L);
- else if (t == TypeManager.double_type)
- ig.Emit (OpCodes.Ldc_R8, 1.0);
- else if (t == TypeManager.float_type)
- ig.Emit (OpCodes.Ldc_R4, 1.0F);
- else if (t.IsPointer){
- int n = PtrTypeSize (t);
-
- if (n == 0)
- ig.Emit (OpCodes.Sizeof, t);
- else
- IntConstant.EmitInt (ig, n);
- } else
- ig.Emit (OpCodes.Ldc_I4_1);
- }
-
-
- //
- // FIXME: We need some way of avoiding the use of temp_storage
- // for some types of storage (parameters, local variables,
- // static fields) and single-dimension array access.
- //
- void EmitCode (EmitContext ec, bool is_expr)
- {
- ILGenerator ig = ec.ig;
- IAssignMethod ia = (IAssignMethod) expr;
- Type expr_type = expr.Type;
-
- if (temp_storage == null)
- temp_storage = new LocalTemporary (ec, expr_type);
-
- ia.CacheTemporaries (ec);
- ig.Emit (OpCodes.Nop);
- switch (mode){
- case Mode.PreIncrement:
- case Mode.PreDecrement:
- if (method == null){
- expr.Emit (ec);
-
- LoadOne (ig, expr_type);
-
- //
- // Select the opcode based on the check state (then the type)
- // and the actual operation
- //
- if (ec.CheckState){
- if (expr_type == TypeManager.int32_type ||
- expr_type == TypeManager.int64_type){
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- } else if (expr_type == TypeManager.uint32_type ||
- expr_type == TypeManager.uint64_type){
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub_Ovf_Un);
- else
- ig.Emit (OpCodes.Add_Ovf_Un);
- } else {
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- }
- } else {
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub);
- else
- ig.Emit (OpCodes.Add);
- }
- } else
- method.Emit (ec);
-
- temp_storage.Store (ec);
- ia.EmitAssign (ec, temp_storage);
- if (is_expr)
- temp_storage.Emit (ec);
- break;
-
- case Mode.PostIncrement:
- case Mode.PostDecrement:
- if (is_expr)
- expr.Emit (ec);
-
- if (method == null){
- if (!is_expr)
- expr.Emit (ec);
- else
- ig.Emit (OpCodes.Dup);
-
- LoadOne (ig, expr_type);
-
- if (ec.CheckState){
- if (expr_type == TypeManager.int32_type ||
- expr_type == TypeManager.int64_type){
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- } else if (expr_type == TypeManager.uint32_type ||
- expr_type == TypeManager.uint64_type){
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub_Ovf_Un);
- else
- ig.Emit (OpCodes.Add_Ovf_Un);
- } else {
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- }
- } else {
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub);
- else
- ig.Emit (OpCodes.Add);
- }
- } else {
- method.Emit (ec);
- }
-
- temp_storage.Store (ec);
- ia.EmitAssign (ec, temp_storage);
- break;
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- EmitCode (ec, true);
-
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- EmitCode (ec, false);
- }
-
- }
-
- /// <summary>
- /// Base class for the `Is' and `As' classes.
- /// </summary>
- ///
- /// <remarks>
- /// FIXME: Split this in two, and we get to save the `Operator' Oper
- /// size.
- /// </remarks>
- public abstract class Probe : Expression {
- public readonly string ProbeType;
- protected Expression expr;
- protected Type probe_type;
- protected Location loc;
-
- public Probe (Expression expr, string probe_type, Location l)
- {
- ProbeType = probe_type;
- loc = l;
- this.expr = expr;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- probe_type = RootContext.LookupType (ec.DeclSpace, ProbeType, false, loc);
-
- if (probe_type == null)
- return null;
-
- expr = expr.Resolve (ec);
-
- return this;
- }
- }
-
- /// <summary>
- /// Implementation of the `is' operator.
- /// </summary>
- public class Is : Probe {
- public Is (Expression expr, string probe_type, Location l)
- : base (expr, probe_type, l)
- {
- }
-
- enum Action {
- AlwaysTrue, AlwaysNull, AlwaysFalse, LeaveOnStack, Probe
- }
-
- Action action;
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- expr.Emit (ec);
-
- switch (action){
- case Action.AlwaysFalse:
- ig.Emit (OpCodes.Pop);
- IntConstant.EmitInt (ig, 0);
- return;
- case Action.AlwaysTrue:
- ig.Emit (OpCodes.Pop);
- ig.Emit (OpCodes.Nop);
- IntConstant.EmitInt (ig, 1);
- return;
- case Action.LeaveOnStack:
- // the `e != null' rule.
- return;
- case Action.Probe:
- ig.Emit (OpCodes.Isinst, probe_type);
- ig.Emit (OpCodes.Ldnull);
- ig.Emit (OpCodes.Cgt_Un);
- return;
- }
- throw new Exception ("never reached");
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expression e = base.DoResolve (ec);
-
- if (e == null)
- return null;
-
- Type etype = expr.Type;
- bool warning_always_matches = false;
- bool warning_never_matches = false;
-
- type = TypeManager.bool_type;
- eclass = ExprClass.Value;
-
- //
- // First case, if at compile time, there is an implicit conversion
- // then e != null (objects) or true (value types)
- //
- e = ConvertImplicitStandard (ec, expr, probe_type, loc);
- if (e != null){
- expr = e;
- if (etype.IsValueType)
- action = Action.AlwaysTrue;
- else
- action = Action.LeaveOnStack;
-
- warning_always_matches = true;
- } else if (ExplicitReferenceConversionExists (etype, probe_type)){
- //
- // Second case: explicit reference convresion
- //
- if (expr is NullLiteral)
- action = Action.AlwaysFalse;
- else
- action = Action.Probe;
- } else {
- action = Action.AlwaysFalse;
- warning_never_matches = true;
- }
-
- if (RootContext.WarningLevel >= 1){
- if (warning_always_matches)
- Report.Warning (
- 183, loc,
- "The expression is always of type `" +
- TypeManager.CSharpName (probe_type) + "'");
- else if (warning_never_matches){
- if (!(probe_type.IsInterface || expr.Type.IsInterface))
- Report.Warning (
- 184, loc,
- "The expression is never of type `" +
- TypeManager.CSharpName (probe_type) + "'");
- }
- }
-
- return this;
- }
- }
-
- /// <summary>
- /// Implementation of the `as' operator.
- /// </summary>
- public class As : Probe {
- public As (Expression expr, string probe_type, Location l)
- : base (expr, probe_type, l)
- {
- }
-
- bool do_isinst = false;
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- expr.Emit (ec);
-
- if (do_isinst)
- ig.Emit (OpCodes.Isinst, probe_type);
- }
-
- static void Error_CannotConvertType (Type source, Type target, Location loc)
- {
- Report.Error (
- 39, loc, "as operator can not convert from `" +
- TypeManager.CSharpName (source) + "' to `" +
- TypeManager.CSharpName (target) + "'");
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expression e = base.DoResolve (ec);
-
- if (e == null)
- return null;
-
- type = probe_type;
- eclass = ExprClass.Value;
- Type etype = expr.Type;
-
- e = ConvertImplicit (ec, expr, probe_type, loc);
- if (e != null){
- expr = e;
- do_isinst = false;
- return this;
- }
-
- if (ExplicitReferenceConversionExists (etype, probe_type)){
- do_isinst = true;
- return this;
- }
-
- Error_CannotConvertType (etype, probe_type, loc);
- return null;
- }
- }
-
- /// <summary>
- /// This represents a typecast in the source language.
- ///
- /// FIXME: Cast expressions have an unusual set of parsing
- /// rules, we need to figure those out.
- /// </summary>
- public class Cast : Expression {
- Expression target_type;
- Expression expr;
- Location loc;
-
- public Cast (Expression cast_type, Expression expr, Location loc)
- {
- this.target_type = cast_type;
- this.expr = expr;
- this.loc = loc;
- }
-
- public Expression TargetType {
- get {
- return target_type;
- }
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- set {
- expr = value;
- }
- }
-
- /// <summary>
- /// Attempts to do a compile-time folding of a constant cast.
- /// </summary>
- Expression TryReduce (EmitContext ec, Type target_type)
- {
- if (expr is ByteConstant){
- byte v = ((ByteConstant) expr).Value;
-
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is SByteConstant){
- sbyte v = ((SByteConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is ShortConstant){
- short v = ((ShortConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is UShortConstant){
- ushort v = ((UShortConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is IntConstant){
- int v = ((IntConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is UIntConstant){
- uint v = ((UIntConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is LongConstant){
- long v = ((LongConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is ULongConstant){
- ulong v = ((ULongConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is FloatConstant){
- float v = ((FloatConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.double_type)
- return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
- if (expr is DoubleConstant){
- double v = ((DoubleConstant) expr).Value;
-
- if (target_type == TypeManager.byte_type)
- return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
- return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
- return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
- return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
- return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
- return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
- return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
- return new ULongConstant ((ulong) v);
- if (target_type == TypeManager.float_type)
- return new FloatConstant ((float) v);
- if (target_type == TypeManager.char_type)
- return new CharConstant ((char) v);
- }
-
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
- if (expr == null)
- return null;
-
- bool old_state = ec.OnlyLookupTypes;
- ec.OnlyLookupTypes = true;
- target_type = target_type.Resolve (ec);
- ec.OnlyLookupTypes = old_state;
-
- if (target_type == null){
- Report.Error (-10, loc, "Can not resolve type");
- return null;
- }
-
- if (target_type.eclass != ExprClass.Type){
- report118 (loc, target_type, "class");
- return null;
- }
-
- type = target_type.Type;
- eclass = ExprClass.Value;
-
- if (type == null)
- return null;
-
- if (expr is Constant){
- Expression e = TryReduce (ec, type);
-
- if (e != null)
- return e;
- }
-
- expr = ConvertExplicit (ec, expr, type, loc);
- return expr;
- }
-
- public override void Emit (EmitContext ec)
- {
- //
- // This one will never happen
- //
- throw new Exception ("Should not happen");
- }
- }
-
- /// <summary>
- /// Binary operators
- /// </summary>
- public class Binary : Expression {
- public enum Operator : byte {
- Multiply, Division, Modulus,
- Addition, Subtraction,
- LeftShift, RightShift,
- LessThan, GreaterThan, LessThanOrEqual, GreaterThanOrEqual,
- Equality, Inequality,
- BitwiseAnd,
- ExclusiveOr,
- BitwiseOr,
- LogicalAnd,
- LogicalOr,
- TOP
- }
-
- Operator oper;
- Expression left, right;
-
- //
- // After resolution, method might contain the operator overload
- // method.
- //
- protected MethodBase method;
- ArrayList Arguments;
-
- Location loc;
-
- bool DelegateOperation;
-
- // This must be kept in sync with Operator!!!
- static string [] oper_names;
-
- static Binary ()
- {
- oper_names = new string [(int) Operator.TOP];
-
- oper_names [(int) Operator.Multiply] = "op_Multiply";
- oper_names [(int) Operator.Division] = "op_Division";
- oper_names [(int) Operator.Modulus] = "op_Modulus";
- oper_names [(int) Operator.Addition] = "op_Addition";
- oper_names [(int) Operator.Subtraction] = "op_Subtraction";
- oper_names [(int) Operator.LeftShift] = "op_LeftShift";
- oper_names [(int) Operator.RightShift] = "op_RightShift";
- oper_names [(int) Operator.LessThan] = "op_LessThan";
- oper_names [(int) Operator.GreaterThan] = "op_GreaterThan";
- oper_names [(int) Operator.LessThanOrEqual] = "op_LessThanOrEqual";
- oper_names [(int) Operator.GreaterThanOrEqual] = "op_GreaterThanOrEqual";
- oper_names [(int) Operator.Equality] = "op_Equality";
- oper_names [(int) Operator.Inequality] = "op_Inequality";
- oper_names [(int) Operator.BitwiseAnd] = "op_BitwiseAnd";
- oper_names [(int) Operator.BitwiseOr] = "op_BitwiseOr";
- oper_names [(int) Operator.ExclusiveOr] = "op_ExclusiveOr";
- oper_names [(int) Operator.LogicalOr] = "op_LogicalOr";
- oper_names [(int) Operator.LogicalAnd] = "op_LogicalAnd";
- }
-
- public Binary (Operator oper, Expression left, Expression right, Location loc)
- {
- this.oper = oper;
- this.left = left;
- this.right = right;
- this.loc = loc;
- }
-
- public Operator Oper {
- get {
- return oper;
- }
- set {
- oper = value;
- }
- }
-
- public Expression Left {
- get {
- return left;
- }
- set {
- left = value;
- }
- }
-
- public Expression Right {
- get {
- return right;
- }
- set {
- right = value;
- }
- }
-
-
- /// <summary>
- /// Returns a stringified representation of the Operator
- /// </summary>
- static string OperName (Operator oper)
- {
- switch (oper){
- case Operator.Multiply:
- return "*";
- case Operator.Division:
- return "/";
- case Operator.Modulus:
- return "%";
- case Operator.Addition:
- return "+";
- case Operator.Subtraction:
- return "-";
- case Operator.LeftShift:
- return "<<";
- case Operator.RightShift:
- return ">>";
- case Operator.LessThan:
- return "<";
- case Operator.GreaterThan:
- return ">";
- case Operator.LessThanOrEqual:
- return "<=";
- case Operator.GreaterThanOrEqual:
- return ">=";
- case Operator.Equality:
- return "==";
- case Operator.Inequality:
- return "!=";
- case Operator.BitwiseAnd:
- return "&";
- case Operator.BitwiseOr:
- return "|";
- case Operator.ExclusiveOr:
- return "^";
- case Operator.LogicalOr:
- return "||";
- case Operator.LogicalAnd:
- return "&&";
- }
-
- return oper.ToString ();
- }
-
- public override string ToString ()
- {
- return "operator " + OperName (oper) + "(" + left.ToString () + ", " +
- right.ToString () + ")";
- }
-
- Expression ForceConversion (EmitContext ec, Expression expr, Type target_type)
- {
- if (expr.Type == target_type)
- return expr;
-
- return ConvertImplicit (ec, expr, target_type, new Location (-1));
- }
-
- public static void Error_OperatorAmbiguous (Location loc, Operator oper, Type l, Type r)
- {
- Report.Error (
- 34, loc, "Operator `" + OperName (oper)
- + "' is ambiguous on operands of type `"
- + TypeManager.CSharpName (l) + "' "
- + "and `" + TypeManager.CSharpName (r)
- + "'");
- }
-
- //
- // Note that handling the case l == Decimal || r == Decimal
- // is taken care of by the Step 1 Operator Overload resolution.
- //
- bool DoNumericPromotions (EmitContext ec, Type l, Type r)
- {
- if (l == TypeManager.double_type || r == TypeManager.double_type){
- //
- // If either operand is of type double, the other operand is
- // conveted to type double.
- //
- if (r != TypeManager.double_type)
- right = ConvertImplicit (ec, right, TypeManager.double_type, loc);
- if (l != TypeManager.double_type)
- left = ConvertImplicit (ec, left, TypeManager.double_type, loc);
-
- type = TypeManager.double_type;
- } else if (l == TypeManager.float_type || r == TypeManager.float_type){
- //
- // if either operand is of type float, the other operand is
- // converted to type float.
- //
- if (r != TypeManager.double_type)
- right = ConvertImplicit (ec, right, TypeManager.float_type, loc);
- if (l != TypeManager.double_type)
- left = ConvertImplicit (ec, left, TypeManager.float_type, loc);
- type = TypeManager.float_type;
- } else if (l == TypeManager.uint64_type || r == TypeManager.uint64_type){
- Expression e;
- Type other;
- //
- // If either operand is of type ulong, the other operand is
- // converted to type ulong. or an error ocurrs if the other
- // operand is of type sbyte, short, int or long
- //
- if (l == TypeManager.uint64_type){
- if (r != TypeManager.uint64_type){
- if (right is IntConstant){
- IntConstant ic = (IntConstant) right;
-
- e = TryImplicitIntConversion (l, ic);
- if (e != null)
- right = e;
- } else if (right is LongConstant){
- long ll = ((LongConstant) right).Value;
-
- if (ll > 0)
- right = new ULongConstant ((ulong) ll);
- } else {
- e = ImplicitNumericConversion (ec, right, l, loc);
- if (e != null)
- right = e;
- }
- }
- other = right.Type;
- } else {
- if (left is IntConstant){
- e = TryImplicitIntConversion (r, (IntConstant) left);
- if (e != null)
- left = e;
- } else if (left is LongConstant){
- long ll = ((LongConstant) left).Value;
-
- if (ll > 0)
- left = new ULongConstant ((ulong) ll);
- } else {
- e = ImplicitNumericConversion (ec, left, r, loc);
- if (e != null)
- left = e;
- }
- other = left.Type;
- }
-
- if ((other == TypeManager.sbyte_type) ||
- (other == TypeManager.short_type) ||
- (other == TypeManager.int32_type) ||
- (other == TypeManager.int64_type))
- Error_OperatorAmbiguous (loc, oper, l, r);
- type = TypeManager.uint64_type;
- } else if (l == TypeManager.int64_type || r == TypeManager.int64_type){
- //
- // If either operand is of type long, the other operand is converted
- // to type long.
- //
- if (l != TypeManager.int64_type)
- left = ConvertImplicit (ec, left, TypeManager.int64_type, loc);
- if (r != TypeManager.int64_type)
- right = ConvertImplicit (ec, right, TypeManager.int64_type, loc);
-
- type = TypeManager.int64_type;
- } else if (l == TypeManager.uint32_type || r == TypeManager.uint32_type){
- //
- // If either operand is of type uint, and the other
- // operand is of type sbyte, short or int, othe operands are
- // converted to type long.
- //
- Type other = null;
-
- if (l == TypeManager.uint32_type){
- if (right is IntConstant){
- IntConstant ic = (IntConstant) right;
- int val = ic.Value;
-
- if (val >= 0)
- right = new UIntConstant ((uint) val);
-
- type = l;
- return true;
- }
- other = r;
- }
- else if (r == TypeManager.uint32_type){
- if (left is IntConstant){
- IntConstant ic = (IntConstant) left;
- int val = ic.Value;
-
- if (val >= 0)
- left = new UIntConstant ((uint) val);
-
- type = r;
- return true;
- }
-
- other = l;
- }
-
- if ((other == TypeManager.sbyte_type) ||
- (other == TypeManager.short_type) ||
- (other == TypeManager.int32_type)){
- left = ForceConversion (ec, left, TypeManager.int64_type);
- right = ForceConversion (ec, right, TypeManager.int64_type);
- type = TypeManager.int64_type;
- } else {
- //
- // if either operand is of type uint, the other
- // operand is converd to type uint
- //
- left = ForceConversion (ec, left, TypeManager.uint32_type);
- right = ForceConversion (ec, right, TypeManager.uint32_type);
- type = TypeManager.uint32_type;
- }
- } else if (l == TypeManager.decimal_type || r == TypeManager.decimal_type){
- if (l != TypeManager.decimal_type)
- left = ConvertImplicit (ec, left, TypeManager.decimal_type, loc);
- if (r != TypeManager.decimal_type)
- right = ConvertImplicit (ec, right, TypeManager.decimal_type, loc);
-
- type = TypeManager.decimal_type;
- } else {
- Expression l_tmp, r_tmp;
-
- l_tmp = ForceConversion (ec, left, TypeManager.int32_type);
- if (l_tmp == null)
- return false;
-
- r_tmp = ForceConversion (ec, right, TypeManager.int32_type);
- if (r_tmp == null)
- return false;
-
- left = l_tmp;
- right = r_tmp;
-
- type = TypeManager.int32_type;
- }
-
- return true;
- }
-
- static public void Error_OperatorCannotBeApplied (Location loc, string name, Type l, Type r)
- {
- Error (19, loc,
- "Operator " + name + " cannot be applied to operands of type `" +
- TypeManager.CSharpName (l) + "' and `" +
- TypeManager.CSharpName (r) + "'");
- }
-
- void Error_OperatorCannotBeApplied ()
- {
- Error_OperatorCannotBeApplied (loc, OperName (oper), left.Type, right.Type);
- }
-
- static bool is_32_or_64 (Type t)
- {
- return (t == TypeManager.int32_type || t == TypeManager.uint32_type ||
- t == TypeManager.int64_type || t == TypeManager.uint64_type);
- }
-
- Expression CheckShiftArguments (EmitContext ec)
- {
- Expression e;
- Type l = left.Type;
- Type r = right.Type;
-
- e = ForceConversion (ec, right, TypeManager.int32_type);
- if (e == null){
- Error_OperatorCannotBeApplied ();
- return null;
- }
- right = e;
-
- if (((e = ConvertImplicit (ec, left, TypeManager.int32_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.uint32_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.int64_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.uint64_type, loc)) != null)){
- left = e;
- type = e.Type;
-
- return this;
- }
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- Expression ResolveOperator (EmitContext ec)
- {
- Type l = left.Type;
- Type r = right.Type;
-
- bool overload_failed = false;
-
- //
- // Step 1: Perform Operator Overload location
- //
- Expression left_expr, right_expr;
-
- string op = oper_names [(int) oper];
-
- MethodGroupExpr union;
- left_expr = MemberLookup (ec, l, op, MemberTypes.Method, AllBindingFlags, loc);
- if (r != l){
- right_expr = MemberLookup (
- ec, r, op, MemberTypes.Method, AllBindingFlags, loc);
- union = Invocation.MakeUnionSet (left_expr, right_expr, loc);
- } else
- union = (MethodGroupExpr) left_expr;
-
- if (union != null) {
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- method = Invocation.OverloadResolve (ec, union, Arguments, Location.Null);
- if (method != null) {
- MethodInfo mi = (MethodInfo) method;
-
- type = mi.ReturnType;
- return this;
- } else {
- overload_failed = true;
- }
- }
-
- //
- // Step 2: Default operations on CLI native types.
- //
-
- //
- // Step 0: String concatenation (because overloading will get this wrong)
- //
- if (oper == Operator.Addition){
- //
- // If any of the arguments is a string, cast to string
- //
-
- if (l == TypeManager.string_type){
-
- if (r == TypeManager.void_type) {
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- if (r == TypeManager.string_type){
- if (left is Constant && right is Constant){
- StringConstant ls = (StringConstant) left;
- StringConstant rs = (StringConstant) right;
-
- return new StringConstant (
- ls.Value + rs.Value);
- }
-
- // string + string
- method = TypeManager.string_concat_string_string;
- } else {
- // string + object
- method = TypeManager.string_concat_object_object;
- right = ConvertImplicit (ec, right,
- TypeManager.object_type, loc);
- }
- type = TypeManager.string_type;
-
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- return this;
-
- } else if (r == TypeManager.string_type){
- // object + string
-
- if (l == TypeManager.void_type) {
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- method = TypeManager.string_concat_object_object;
- left = ConvertImplicit (ec, left, TypeManager.object_type, loc);
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- type = TypeManager.string_type;
-
- return this;
- }
-
- //
- // Transform a + ( - b) into a - b
- //
- if (right is Unary){
- Unary right_unary = (Unary) right;
-
- if (right_unary.Oper == Unary.Operator.UnaryNegation){
- oper = Operator.Subtraction;
- right = right_unary.Expr;
- r = right.Type;
- }
- }
- }
-
- if (oper == Operator.Equality || oper == Operator.Inequality){
- if (l == TypeManager.bool_type || r == TypeManager.bool_type){
- if (r != TypeManager.bool_type || l != TypeManager.bool_type){
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- type = TypeManager.bool_type;
- return this;
- }
-
- //
- // operator != (object a, object b)
- // operator == (object a, object b)
- //
- // For this to be used, both arguments have to be reference-types.
- // Read the rationale on the spec (14.9.6)
- //
- // Also, if at compile time we know that the classes do not inherit
- // one from the other, then we catch the error there.
- //
- if (!(l.IsValueType || r.IsValueType)){
- type = TypeManager.bool_type;
-
- if (l == r)
- return this;
-
- if (l.IsSubclassOf (r) || r.IsSubclassOf (l))
- return this;
-
- //
- // Also, a standard conversion must exist from either one
- //
- if (!(StandardConversionExists (left, r) ||
- StandardConversionExists (right, l))){
- Error_OperatorCannotBeApplied ();
- return null;
- }
- //
- // We are going to have to convert to an object to compare
- //
- if (l != TypeManager.object_type)
- left = new EmptyCast (left, TypeManager.object_type);
- if (r != TypeManager.object_type)
- right = new EmptyCast (right, TypeManager.object_type);
-
- //
- // FIXME: CSC here catches errors cs254 and cs252
- //
- return this;
- }
- }
-
- // Only perform numeric promotions on:
- // +, -, *, /, %, &, |, ^, ==, !=, <, >, <=, >=
- //
- if (oper == Operator.Addition || oper == Operator.Subtraction) {
- if (l.IsSubclassOf (TypeManager.delegate_type) &&
- r.IsSubclassOf (TypeManager.delegate_type)) {
-
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- if (oper == Operator.Addition)
- method = TypeManager.delegate_combine_delegate_delegate;
- else
- method = TypeManager.delegate_remove_delegate_delegate;
-
- DelegateOperation = true;
- type = l;
- return this;
- }
-
- //
- // Pointer arithmetic:
- //
- // T* operator + (T* x, int y);
- // T* operator + (T* x, uint y);
- // T* operator + (T* x, long y);
- // T* operator + (T* x, ulong y);
- //
- // T* operator + (int y, T* x);
- // T* operator + (uint y, T *x);
- // T* operator + (long y, T *x);
- // T* operator + (ulong y, T *x);
- //
- // T* operator - (T* x, int y);
- // T* operator - (T* x, uint y);
- // T* operator - (T* x, long y);
- // T* operator - (T* x, ulong y);
- //
- // long operator - (T* x, T *y)
- //
- if (l.IsPointer){
- if (r.IsPointer && oper == Operator.Subtraction){
- if (r == l)
- return new PointerArithmetic (
- false, left, right, TypeManager.int64_type);
- } else if (is_32_or_64 (r))
- return new PointerArithmetic (
- oper == Operator.Addition, left, right, l);
- } else if (r.IsPointer && is_32_or_64 (l) && oper == Operator.Addition)
- return new PointerArithmetic (
- true, right, left, r);
- }
-
- //
- // Enumeration operators
- //
- bool lie = TypeManager.IsEnumType (l);
- bool rie = TypeManager.IsEnumType (r);
- if (lie || rie){
- Expression temp;
-
- //
- // operator + (E e, U x)
- //
- if (oper == Operator.Addition){
- if (lie && rie){
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- Type enum_type = lie ? l : r;
- Type other_type = lie ? r : l;
- Type underlying_type = TypeManager.EnumToUnderlying (enum_type);
-;
-
- if (underlying_type != other_type){
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- type = enum_type;
- return this;
- }
-
- if (!rie){
- temp = ConvertImplicit (ec, right, l, loc);
- if (temp != null)
- right = temp;
- } if (!lie){
- temp = ConvertImplicit (ec, left, r, loc);
- if (temp != null){
- left = temp;
- l = r;
- }
- }
-
- if (oper == Operator.Equality || oper == Operator.Inequality ||
- oper == Operator.LessThanOrEqual || oper == Operator.LessThan ||
- oper == Operator.GreaterThanOrEqual || oper == Operator.GreaterThan){
- type = TypeManager.bool_type;
- return this;
- }
-
- if (oper == Operator.BitwiseAnd ||
- oper == Operator.BitwiseOr ||
- oper == Operator.ExclusiveOr){
- type = l;
- return this;
- }
- return null;
- }
-
- if (oper == Operator.LeftShift || oper == Operator.RightShift)
- return CheckShiftArguments (ec);
-
- if (oper == Operator.LogicalOr || oper == Operator.LogicalAnd){
- if (l != TypeManager.bool_type || r != TypeManager.bool_type){
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- type = TypeManager.bool_type;
- return this;
- }
-
- //
- // operator & (bool x, bool y)
- // operator | (bool x, bool y)
- // operator ^ (bool x, bool y)
- //
- if (l == TypeManager.bool_type && r == TypeManager.bool_type){
- if (oper == Operator.BitwiseAnd ||
- oper == Operator.BitwiseOr ||
- oper == Operator.ExclusiveOr){
- type = l;
- return this;
- }
- }
-
- //
- // Pointer comparison
- //
- if (l.IsPointer && r.IsPointer){
- if (oper == Operator.Equality || oper == Operator.Inequality ||
- oper == Operator.LessThan || oper == Operator.LessThanOrEqual ||
- oper == Operator.GreaterThan || oper == Operator.GreaterThanOrEqual){
- type = TypeManager.bool_type;
- return this;
- }
- }
-
- //
- // We are dealing with numbers
- //
- if (overload_failed){
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- if (!DoNumericPromotions (ec, l, r)){
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- if (left == null || right == null)
- return null;
-
- //
- // reload our cached types if required
- //
- l = left.Type;
- r = right.Type;
-
- if (oper == Operator.BitwiseAnd ||
- oper == Operator.BitwiseOr ||
- oper == Operator.ExclusiveOr){
- if (l == r){
- if (!((l == TypeManager.int32_type) ||
- (l == TypeManager.uint32_type) ||
- (l == TypeManager.int64_type) ||
- (l == TypeManager.uint64_type)))
- type = l;
- } else {
- Error_OperatorCannotBeApplied ();
- return null;
- }
- }
-
- if (oper == Operator.Equality ||
- oper == Operator.Inequality ||
- oper == Operator.LessThanOrEqual ||
- oper == Operator.LessThan ||
- oper == Operator.GreaterThanOrEqual ||
- oper == Operator.GreaterThan){
- type = TypeManager.bool_type;
- }
-
- return this;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- left = left.Resolve (ec);
- right = right.Resolve (ec);
-
- if (left == null || right == null)
- return null;
-
- if (left.Type == null)
- throw new Exception (
- "Resolve returned non null, but did not set the type! (" +
- left + ") at Line: " + loc.Row);
- if (right.Type == null)
- throw new Exception (
- "Resolve returned non null, but did not set the type! (" +
- right + ") at Line: "+ loc.Row);
-
- eclass = ExprClass.Value;
-
- if (left is Constant && right is Constant){
- Expression e = ConstantFold.BinaryFold (
- ec, oper, (Constant) left, (Constant) right, loc);
- if (e != null)
- return e;
- }
-
- return ResolveOperator (ec);
- }
-
- public bool IsBranchable ()
- {
- if (oper == Operator.Equality ||
- oper == Operator.Inequality ||
- oper == Operator.LessThan ||
- oper == Operator.GreaterThan ||
- oper == Operator.LessThanOrEqual ||
- oper == Operator.GreaterThanOrEqual){
- return true;
- } else
- return false;
- }
-
- /// <summary>
- /// This entry point is used by routines that might want
- /// to emit a brfalse/brtrue after an expression, and instead
- /// they could use a more compact notation.
- ///
- /// Typically the code would generate l.emit/r.emit, followed
- /// by the comparission and then a brtrue/brfalse. The comparissions
- /// are sometimes inneficient (there are not as complete as the branches
- /// look for the hacks in Emit using double ceqs).
- ///
- /// So for those cases we provide EmitBranchable that can emit the
- /// branch with the test
- /// </summary>
- public void EmitBranchable (EmitContext ec, int target)
- {
- OpCode opcode;
- bool close_target = false;
- ILGenerator ig = ec.ig;
-
- //
- // short-circuit operators
- //
- if (oper == Operator.LogicalAnd){
- left.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- right.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- } else if (oper == Operator.LogicalOr){
- left.Emit (ec);
- ig.Emit (OpCodes.Brtrue, target);
- right.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- }
-
- left.Emit (ec);
- right.Emit (ec);
-
- switch (oper){
- case Operator.Equality:
- if (close_target)
- opcode = OpCodes.Beq_S;
- else
- opcode = OpCodes.Beq;
- break;
-
- case Operator.Inequality:
- if (close_target)
- opcode = OpCodes.Bne_Un_S;
- else
- opcode = OpCodes.Bne_Un;
- break;
-
- case Operator.LessThan:
- if (close_target)
- opcode = OpCodes.Blt_S;
- else
- opcode = OpCodes.Blt;
- break;
-
- case Operator.GreaterThan:
- if (close_target)
- opcode = OpCodes.Bgt_S;
- else
- opcode = OpCodes.Bgt;
- break;
-
- case Operator.LessThanOrEqual:
- if (close_target)
- opcode = OpCodes.Ble_S;
- else
- opcode = OpCodes.Ble;
- break;
-
- case Operator.GreaterThanOrEqual:
- if (close_target)
- opcode = OpCodes.Bge_S;
- else
- opcode = OpCodes.Ble;
- break;
-
- default:
- throw new Exception ("EmitBranchable called on non-EmitBranchable operator: "
- + oper.ToString ());
- }
-
- ig.Emit (opcode, target);
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Type l = left.Type;
- Type r = right.Type;
- OpCode opcode;
-
- if (method != null) {
-
- // Note that operators are static anyway
-
- if (Arguments != null)
- Invocation.EmitArguments (ec, method, Arguments);
-
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
-
- if (DelegateOperation)
- ig.Emit (OpCodes.Castclass, type);
-
- return;
- }
-
- //
- // Handle short-circuit operators differently
- // than the rest
- //
- if (oper == Operator.LogicalAnd){
- Label load_zero = ig.DefineLabel ();
- Label end = ig.DefineLabel ();
-
- left.Emit (ec);
- ig.Emit (OpCodes.Brfalse, load_zero);
- right.Emit (ec);
- ig.Emit (OpCodes.Br, end);
- ig.MarkLabel (load_zero);
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.MarkLabel (end);
- return;
- } else if (oper == Operator.LogicalOr){
- Label load_one = ig.DefineLabel ();
- Label end = ig.DefineLabel ();
-
- left.Emit (ec);
- ig.Emit (OpCodes.Brtrue, load_one);
- right.Emit (ec);
- ig.Emit (OpCodes.Br, end);
- ig.MarkLabel (load_one);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.MarkLabel (end);
- return;
- }
-
- left.Emit (ec);
- right.Emit (ec);
-
- switch (oper){
- case Operator.Multiply:
- if (ec.CheckState){
- if (l == TypeManager.int32_type || l == TypeManager.int64_type)
- opcode = OpCodes.Mul_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
- opcode = OpCodes.Mul_Ovf_Un;
- else
- opcode = OpCodes.Mul;
- } else
- opcode = OpCodes.Mul;
-
- break;
-
- case Operator.Division:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
- opcode = OpCodes.Div_Un;
- else
- opcode = OpCodes.Div;
- break;
-
- case Operator.Modulus:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
- opcode = OpCodes.Rem_Un;
- else
- opcode = OpCodes.Rem;
- break;
-
- case Operator.Addition:
- if (ec.CheckState){
- if (l == TypeManager.int32_type || l == TypeManager.int64_type)
- opcode = OpCodes.Add_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
- opcode = OpCodes.Add_Ovf_Un;
- else
- opcode = OpCodes.Add;
- } else
- opcode = OpCodes.Add;
- break;
-
- case Operator.Subtraction:
- if (ec.CheckState){
- if (l == TypeManager.int32_type || l == TypeManager.int64_type)
- opcode = OpCodes.Sub_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
- opcode = OpCodes.Sub_Ovf_Un;
- else
- opcode = OpCodes.Sub;
- } else
- opcode = OpCodes.Sub;
- break;
-
- case Operator.RightShift:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
- opcode = OpCodes.Shr_Un;
- else
- opcode = OpCodes.Shr;
- break;
-
- case Operator.LeftShift:
- opcode = OpCodes.Shl;
- break;
-
- case Operator.Equality:
- opcode = OpCodes.Ceq;
- break;
-
- case Operator.Inequality:
- ec.ig.Emit (OpCodes.Ceq);
- ec.ig.Emit (OpCodes.Ldc_I4_0);
-
- opcode = OpCodes.Ceq;
- break;
-
- case Operator.LessThan:
- opcode = OpCodes.Clt;
- break;
-
- case Operator.GreaterThan:
- opcode = OpCodes.Cgt;
- break;
-
- case Operator.LessThanOrEqual:
- ec.ig.Emit (OpCodes.Cgt);
- ec.ig.Emit (OpCodes.Ldc_I4_0);
-
- opcode = OpCodes.Ceq;
- break;
-
- case Operator.GreaterThanOrEqual:
- ec.ig.Emit (OpCodes.Clt);
- ec.ig.Emit (OpCodes.Ldc_I4_1);
-
- opcode = OpCodes.Sub;
- break;
-
- case Operator.BitwiseOr:
- opcode = OpCodes.Or;
- break;
-
- case Operator.BitwiseAnd:
- opcode = OpCodes.And;
- break;
-
- case Operator.ExclusiveOr:
- opcode = OpCodes.Xor;
- break;
-
- default:
- throw new Exception ("This should not happen: Operator = "
- + oper.ToString ());
- }
-
- ig.Emit (opcode);
- }
-
- public bool IsBuiltinOperator {
- get {
- return method == null;
- }
- }
- }
-
- public class PointerArithmetic : Expression {
- Expression left, right;
- bool is_add;
-
- //
- // We assume that `l' is always a pointer
- //
- public PointerArithmetic (bool is_addition, Expression l, Expression r, Type t)
- {
- type = t;
- eclass = ExprClass.Variable;
- left = l;
- right = r;
- is_add = is_addition;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Type op_type = left.Type;
- ILGenerator ig = ec.ig;
- int size = GetTypeSize (op_type.GetElementType ());
-
- if (right.Type.IsPointer){
- //
- // handle (pointer - pointer)
- //
- left.Emit (ec);
- right.Emit (ec);
- ig.Emit (OpCodes.Sub);
-
- if (size != 1){
- if (size == 0)
- ig.Emit (OpCodes.Sizeof, op_type);
- else
- IntLiteral.EmitInt (ig, size);
- ig.Emit (OpCodes.Div);
- }
- ig.Emit (OpCodes.Conv_I8);
- } else {
- //
- // handle + and - on (pointer op int)
- //
- left.Emit (ec);
- ig.Emit (OpCodes.Conv_I);
- right.Emit (ec);
- if (size != 1){
- if (size == 0)
- ig.Emit (OpCodes.Sizeof, op_type);
- else
- IntLiteral.EmitInt (ig, size);
- ig.Emit (OpCodes.Mul);
- }
- if (is_add)
- ig.Emit (OpCodes.Add);
- else
- ig.Emit (OpCodes.Sub);
- }
- }
- }
-
- /// <summary>
- /// Implements the ternary conditiona operator (?:)
- /// </summary>
- public class Conditional : Expression {
- Expression expr, trueExpr, falseExpr;
- Location loc;
-
- public Conditional (Expression expr, Expression trueExpr, Expression falseExpr, Location l)
- {
- this.expr = expr;
- this.trueExpr = trueExpr;
- this.falseExpr = falseExpr;
- this.loc = l;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- public Expression TrueExpr {
- get {
- return trueExpr;
- }
- }
-
- public Expression FalseExpr {
- get {
- return falseExpr;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
-
- if (expr.Type != TypeManager.bool_type)
- expr = Expression.ConvertImplicitRequired (
- ec, expr, TypeManager.bool_type, loc);
-
- trueExpr = trueExpr.Resolve (ec);
- falseExpr = falseExpr.Resolve (ec);
-
- if (expr == null || trueExpr == null || falseExpr == null)
- return null;
-
- eclass = ExprClass.Value;
- if (trueExpr.Type == falseExpr.Type)
- type = trueExpr.Type;
- else {
- Expression conv;
- Type true_type = trueExpr.Type;
- Type false_type = falseExpr.Type;
-
- if (trueExpr is NullLiteral){
- type = false_type;
- return this;
- } else if (falseExpr is NullLiteral){
- type = true_type;
- return this;
- }
-
- //
- // First, if an implicit conversion exists from trueExpr
- // to falseExpr, then the result type is of type falseExpr.Type
- //
- conv = ConvertImplicit (ec, trueExpr, false_type, loc);
- if (conv != null){
- //
- // Check if both can convert implicitl to each other's type
- //
- if (ConvertImplicit (ec, falseExpr, true_type, loc) != null){
- Report.Error (
- 172, loc,
- "Can not compute type of conditional expression " +
- "as `" + TypeManager.CSharpName (trueExpr.Type) +
- "' and `" + TypeManager.CSharpName (falseExpr.Type) +
- "' convert implicitly to each other");
- return null;
- }
- type = false_type;
- trueExpr = conv;
- } else if ((conv = ConvertImplicit(ec, falseExpr, true_type,loc))!= null){
- type = true_type;
- falseExpr = conv;
- } else {
- Error (173, loc, "The type of the conditional expression can " +
- "not be computed because there is no implicit conversion" +
- " from `" + TypeManager.CSharpName (trueExpr.Type) + "'" +
- " and `" + TypeManager.CSharpName (falseExpr.Type) + "'");
- return null;
- }
- }
-
- if (expr is BoolConstant){
- BoolConstant bc = (BoolConstant) expr;
-
- if (bc.Value)
- return trueExpr;
- else
- return falseExpr;
- }
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label false_target = ig.DefineLabel ();
- Label end_target = ig.DefineLabel ();
-
- expr.Emit (ec);
- ig.Emit (OpCodes.Brfalse, false_target);
- trueExpr.Emit (ec);
- ig.Emit (OpCodes.Br, end_target);
- ig.MarkLabel (false_target);
- falseExpr.Emit (ec);
- ig.MarkLabel (end_target);
- }
-
- }
-
- /// <summary>
- /// Local variables
- /// </summary>
- public class LocalVariableReference : Expression, IAssignMethod, IMemoryLocation {
- public readonly string Name;
- public readonly Block Block;
- Location loc;
- VariableInfo variable_info;
-
- public LocalVariableReference (Block block, string name, Location l)
- {
- Block = block;
- Name = name;
- loc = l;
- eclass = ExprClass.Variable;
- }
-
- public VariableInfo VariableInfo {
- get {
- if (variable_info == null)
- variable_info = Block.GetVariableInfo (Name);
- return variable_info;
- }
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- VariableInfo vi = VariableInfo;
-
- if (Block.IsConstant (Name)) {
- Expression e = Block.GetConstantExpression (Name);
-
- vi.Used = true;
- return e;
- }
-
- type = vi.VariableType;
- return this;
- }
-
- override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- Expression e = DoResolve (ec);
-
- if (e == null)
- return null;
-
- VariableInfo vi = VariableInfo;
-
-#if BROKEN
- //
- // Sigh: this breaks `using' and `fixed'. Need to review that
- //
- if (vi.ReadOnly){
- Report.Error (
- 1604, loc,
- "cannot assign to `" + Name + "' because it is readonly");
- return null;
- }
-#endif
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- VariableInfo vi = VariableInfo;
- ILGenerator ig = ec.ig;
-
- ig.Emit (OpCodes.Ldloc, vi.LocalBuilder);
- vi.Used = true;
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- ILGenerator ig = ec.ig;
- VariableInfo vi = VariableInfo;
-
- vi.Assigned = true;
-
- source.Emit (ec);
-
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
- }
-
- public void AddressOf (EmitContext ec, AddressOp mode)
- {
- VariableInfo vi = VariableInfo;
-
- if ((mode & AddressOp.Load) != 0)
- vi.Used = true;
- if ((mode & AddressOp.Store) != 0)
- vi.Assigned = true;
-
- ec.ig.Emit (OpCodes.Ldloca, vi.LocalBuilder);
- }
- }
-
- /// <summary>
- /// This represents a reference to a parameter in the intermediate
- /// representation.
- /// </summary>
- public class ParameterReference : Expression, IAssignMethod, IMemoryLocation {
- Parameters pars;
- String name;
- int idx;
- public bool is_ref;
-
- public ParameterReference (Parameters pars, int idx, string name)
- {
- this.pars = pars;
- this.idx = idx;
- this.name = name;
- eclass = ExprClass.Variable;
- }
-
- //
- // Notice that for ref/out parameters, the type exposed is not the
- // same type exposed externally.
- //
- // for "ref int a":
- // externally we expose "int&"
- // here we expose "int".
- //
- // We record this in "is_ref". This means that the type system can treat
- // the type as it is expected, but when we generate the code, we generate
- // the alternate kind of code.
- //
- public override Expression DoResolve (EmitContext ec)
- {
- type = pars.GetParameterInfo (ec.DeclSpace, idx, out is_ref);
- eclass = ExprClass.Variable;
-
- return this;
- }
-
- //
- // This method is used by parameters that are references, that are
- // being passed as references: we only want to pass the pointer (that
- // is already stored in the parameter, not the address of the pointer,
- // and not the value of the variable).
- //
- public void EmitLoad (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
-
- if (!is_ref)
- return;
-
- //
- // If we are a reference, we loaded on the stack a pointer
- // Now lets load the real value
- //
- LoadFromPtr (ig, type);
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- ILGenerator ig = ec.ig;
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (is_ref){
- // Load the pointer
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
- }
-
- source.Emit (ec);
-
- if (is_ref)
- StoreFromPtr (ig, type);
- else {
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Starg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Starg, arg_idx);
- }
-
- }
-
- public void AddressOf (EmitContext ec, AddressOp mode)
- {
- int arg_idx = idx;
-
- if (!ec.IsStatic)
- arg_idx++;
-
- if (arg_idx <= 255)
- ec.ig.Emit (OpCodes.Ldarga_S, (byte) arg_idx);
- else
- ec.ig.Emit (OpCodes.Ldarga, arg_idx);
- }
- }
-
- /// <summary>
- /// Used for arguments to New(), Invocation()
- /// </summary>
- public class Argument {
- public enum AType : byte {
- Expression,
- Ref,
- Out
- };
-
- public readonly AType ArgType;
- public Expression expr;
-
- public Argument (Expression expr, AType type)
- {
- this.expr = expr;
- this.ArgType = type;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
-
- set {
- expr = value;
- }
- }
-
- public Type Type {
- get {
- if (ArgType == AType.Ref || ArgType == AType.Out)
- return TypeManager.LookupType (expr.Type.ToString () + "&");
- else
- return expr.Type;
- }
- }
-
- public Parameter.Modifier GetParameterModifier ()
- {
- if (ArgType == AType.Ref || ArgType == AType.Out)
- return Parameter.Modifier.OUT;
-
- return Parameter.Modifier.NONE;
- }
-
- public static string FullDesc (Argument a)
- {
- return (a.ArgType == AType.Ref ? "ref " :
- (a.ArgType == AType.Out ? "out " : "")) +
- TypeManager.CSharpName (a.Expr.Type);
- }
-
- public bool Resolve (EmitContext ec, Location loc)
- {
- expr = expr.Resolve (ec);
-
- if (ArgType == AType.Expression)
- return expr != null;
-
- if (expr.eclass != ExprClass.Variable){
- //
- // We just probe to match the CSC output
- //
- if (expr.eclass == ExprClass.PropertyAccess ||
- expr.eclass == ExprClass.IndexerAccess){
- Report.Error (
- 206, loc,
- "A property or indexer can not be passed as an out or ref " +
- "parameter");
- } else {
- Report.Error (
- 1510, loc,
- "An lvalue is required as an argument to out or ref");
- }
- return false;
- }
-
- return expr != null;
- }
-
- public void Emit (EmitContext ec)
- {
- //
- // Ref and Out parameters need to have their addresses taken.
- //
- // ParameterReferences might already be references, so we want
- // to pass just the value
- //
- if (ArgType == AType.Ref || ArgType == AType.Out){
- AddressOp mode = AddressOp.Store;
-
- if (ArgType == AType.Ref)
- mode |= AddressOp.Load;
-
- if (expr is ParameterReference){
- ParameterReference pr = (ParameterReference) expr;
-
- if (pr.is_ref)
- pr.EmitLoad (ec);
- else {
-
- pr.AddressOf (ec, mode);
- }
- } else
- ((IMemoryLocation)expr).AddressOf (ec, mode);
- } else
- expr.Emit (ec);
- }
- }
-
- /// <summary>
- /// Invocation of methods or delegates.
- /// </summary>
- public class Invocation : ExpressionStatement {
- public readonly ArrayList Arguments;
- Location loc;
-
- Expression expr;
- MethodBase method = null;
- bool is_base;
-
- static Hashtable method_parameter_cache;
-
- static Invocation ()
- {
- method_parameter_cache = new PtrHashtable ();
- }
-
- //
- // arguments is an ArrayList, but we do not want to typecast,
- // as it might be null.
- //
- // FIXME: only allow expr to be a method invocation or a
- // delegate invocation (7.5.5)
- //
- public Invocation (Expression expr, ArrayList arguments, Location l)
- {
- this.expr = expr;
- Arguments = arguments;
- loc = l;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- /// <summary>
- /// Returns the Parameters (a ParameterData interface) for the
- /// Method `mb'
- /// </summary>
- public static ParameterData GetParameterData (MethodBase mb)
- {
- object pd = method_parameter_cache [mb];
- object ip;
-
- if (pd != null)
- return (ParameterData) pd;
-
-
- ip = TypeManager.LookupParametersByBuilder (mb);
- if (ip != null){
- method_parameter_cache [mb] = ip;
-
- return (ParameterData) ip;
- } else {
- ParameterInfo [] pi = mb.GetParameters ();
- ReflectionParameters rp = new ReflectionParameters (pi);
- method_parameter_cache [mb] = rp;
-
- return (ParameterData) rp;
- }
- }
-
- /// <summary>
- /// Determines "better conversion" as specified in 7.4.2.3
- /// Returns : 1 if a->p is better
- /// 0 if a->q or neither is better
- /// </summary>
- static int BetterConversion (EmitContext ec, Argument a, Type p, Type q, Location loc)
- {
- Type argument_type = a.Type;
- Expression argument_expr = a.Expr;
-
- if (argument_type == null)
- throw new Exception ("Expression of type " + a.Expr + " does not resolve its type");
-
- if (p == q)
- return 0;
-
- if (argument_type == p)
- return 1;
-
- if (argument_type == q)
- return 0;
-
- //
- // Now probe whether an implicit constant expression conversion
- // can be used.
- //
- // An implicit constant expression conversion permits the following
- // conversions:
- //
- // * A constant-expression of type `int' can be converted to type
- // sbyte, byute, short, ushort, uint, ulong provided the value of
- // of the expression is withing the range of the destination type.
- //
- // * A constant-expression of type long can be converted to type
- // ulong, provided the value of the constant expression is not negative
- //
- // FIXME: Note that this assumes that constant folding has
- // taken place. We dont do constant folding yet.
- //
-
- if (argument_expr is IntConstant){
- IntConstant ei = (IntConstant) argument_expr;
- int value = ei.Value;
-
- if (p == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return 1;
- } else if (p == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return 1;
- } else if (p == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return 1;
- } else if (p == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return 1;
- } else if (p == TypeManager.uint32_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint32
- //
- if (value >= 0)
- return 1;
- } else if (p == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64
- //
- if (value >= 0)
- return 1;
- }
- } else if (argument_type == TypeManager.int64_type && argument_expr is LongConstant){
- LongConstant lc = (LongConstant) argument_expr;
-
- if (p == TypeManager.uint64_type){
- if (lc.Value > 0)
- return 1;
- }
- }
-
- if (q == null) {
- Expression tmp = ConvertImplicit (ec, argument_expr, p, loc);
-
- if (tmp != null)
- return 1;
- else
- return 0;
- }
-
- Expression p_tmp = new EmptyExpression (p);
- Expression q_tmp = new EmptyExpression (q);
-
- if (StandardConversionExists (p_tmp, q) == true &&
- StandardConversionExists (q_tmp, p) == false)
- return 1;
-
- if (p == TypeManager.sbyte_type)
- if (q == TypeManager.byte_type || q == TypeManager.ushort_type ||
- q == TypeManager.uint32_type || q == TypeManager.uint64_type)
- return 1;
-
- if (p == TypeManager.short_type)
- if (q == TypeManager.ushort_type || q == TypeManager.uint32_type ||
- q == TypeManager.uint64_type)
- return 1;
-
- if (p == TypeManager.int32_type)
- if (q == TypeManager.uint32_type || q == TypeManager.uint64_type)
- return 1;
-
- if (p == TypeManager.int64_type)
- if (q == TypeManager.uint64_type)
- return 1;
-
- return 0;
- }
-
- /// <summary>
- /// Determines "Better function"
- /// </summary>
- /// <remarks>
- /// and returns an integer indicating :
- /// 0 if candidate ain't better
- /// 1 if candidate is better than the current best match
- /// </remarks>
- static int BetterFunction (EmitContext ec, ArrayList args,
- MethodBase candidate, MethodBase best,
- bool expanded_form, Location loc)
- {
- ParameterData candidate_pd = GetParameterData (candidate);
- ParameterData best_pd;
- int argument_count;
-
- if (args == null)
- argument_count = 0;
- else
- argument_count = args.Count;
-
- int cand_count = candidate_pd.Count;
-
- if (cand_count == 0 && argument_count == 0)
- return 1;
-
- if (candidate_pd.ParameterModifier (cand_count - 1) != Parameter.Modifier.PARAMS)
- if (cand_count != argument_count)
- return 0;
-
- if (best == null) {
- int x = 0;
-
- if (argument_count == 0 && cand_count == 1 &&
- candidate_pd.ParameterModifier (cand_count - 1) == Parameter.Modifier.PARAMS)
- return 1;
-
- for (int j = argument_count; j > 0;) {
- j--;
-
- Argument a = (Argument) args [j];
- Type t = candidate_pd.ParameterType (j);
-
- if (candidate_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- t = t.GetElementType ();
-
- x = BetterConversion (ec, a, t, null, loc);
-
- if (x <= 0)
- break;
- }
-
- if (x > 0)
- return 1;
- else
- return 0;
- }
-
- best_pd = GetParameterData (best);
-
- int rating1 = 0, rating2 = 0;
-
- for (int j = 0; j < argument_count; ++j) {
- int x, y;
-
- Argument a = (Argument) args [j];
-
- Type ct = candidate_pd.ParameterType (j);
- Type bt = best_pd.ParameterType (j);
-
- if (candidate_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- ct = ct.GetElementType ();
-
- if (best_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- bt = bt.GetElementType ();
-
- x = BetterConversion (ec, a, ct, bt, loc);
- y = BetterConversion (ec, a, bt, ct, loc);
-
- if (x < y)
- return 0;
-
- rating1 += x;
- rating2 += y;
- }
-
- if (rating1 > rating2)
- return 1;
- else
- return 0;
- }
-
- public static string FullMethodDesc (MethodBase mb)
- {
- string ret_type = "";
-
- if (mb is MethodInfo)
- ret_type = TypeManager.CSharpName (((MethodInfo) mb).ReturnType);
-
- StringBuilder sb = new StringBuilder (ret_type + " " + mb.Name);
- ParameterData pd = GetParameterData (mb);
-
- int count = pd.Count;
- sb.Append (" (");
-
- for (int i = count; i > 0; ) {
- i--;
-
- sb.Append (pd.ParameterDesc (count - i - 1));
- if (i != 0)
- sb.Append (", ");
- }
-
- sb.Append (")");
- return sb.ToString ();
- }
-
- public static MethodGroupExpr MakeUnionSet (Expression mg1, Expression mg2, Location loc)
- {
- MemberInfo [] miset;
- MethodGroupExpr union;
-
- if (mg1 == null){
- if (mg2 == null)
- return null;
- return (MethodGroupExpr) mg2;
- } else {
- if (mg2 == null)
- return (MethodGroupExpr) mg1;
- }
-
- MethodGroupExpr left_set = null, right_set = null;
- int length1 = 0, length2 = 0;
-
- left_set = (MethodGroupExpr) mg1;
- length1 = left_set.Methods.Length;
-
- right_set = (MethodGroupExpr) mg2;
- length2 = right_set.Methods.Length;
-
- ArrayList common = new ArrayList ();
-
- foreach (MethodBase l in left_set.Methods){
- foreach (MethodBase r in right_set.Methods){
- if (l != r)
- continue;
- common.Add (r);
- break;
- }
- }
-
- miset = new MemberInfo [length1 + length2 - common.Count];
- left_set.Methods.CopyTo (miset, 0);
-
- int k = length1;
-
- foreach (MemberInfo mi in right_set.Methods){
- if (!common.Contains (mi))
- miset [k++] = mi;
- }
-
- union = new MethodGroupExpr (miset, loc);
-
- return union;
- }
-
- /// <summary>
- /// Determines is the candidate method, if a params method, is applicable
- /// in its expanded form to the given set of arguments
- /// </summary>
- static bool IsParamsMethodApplicable (EmitContext ec, ArrayList arguments, MethodBase candidate)
- {
- int arg_count;
-
- if (arguments == null)
- arg_count = 0;
- else
- arg_count = arguments.Count;
-
- ParameterData pd = GetParameterData (candidate);
-
- int pd_count = pd.Count;
-
- if (pd_count == 0)
- return false;
-
- if (pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS)
- return false;
-
- if (pd_count - 1 > arg_count)
- return false;
-
- if (pd_count == 1 && arg_count == 0)
- return true;
-
- //
- // If we have come this far, the case which remains is when the number of parameters
- // is less than or equal to the argument count.
- //
- for (int i = 0; i < pd_count - 1; ++i) {
-
- Argument a = (Argument) arguments [i];
-
- Parameter.Modifier a_mod = a.GetParameterModifier ();
- Parameter.Modifier p_mod = pd.ParameterModifier (i);
-
- if (a_mod == p_mod) {
-
- if (a_mod == Parameter.Modifier.NONE)
- if (!ImplicitConversionExists (ec, a.Expr, pd.ParameterType (i)))
- return false;
-
- if (a_mod == Parameter.Modifier.REF ||
- a_mod == Parameter.Modifier.OUT) {
- Type pt = pd.ParameterType (i);
-
- if (!pt.IsByRef)
- pt = TypeManager.LookupType (pt.FullName + "&");
-
- if (pt != a.Type)
- return false;
- }
- } else
- return false;
-
- }
-
- Type element_type = pd.ParameterType (pd_count - 1).GetElementType ();
-
- for (int i = pd_count - 1; i < arg_count; i++) {
- Argument a = (Argument) arguments [i];
-
- if (!StandardConversionExists (a.Expr, element_type))
- return false;
- }
-
- return true;
- }
-
- /// <summary>
- /// Determines if the candidate method is applicable (section 14.4.2.1)
- /// to the given set of arguments
- /// </summary>
- static bool IsApplicable (EmitContext ec, ArrayList arguments, MethodBase candidate)
- {
- int arg_count;
-
- if (arguments == null)
- arg_count = 0;
- else
- arg_count = arguments.Count;
-
- ParameterData pd = GetParameterData (candidate);
-
- int pd_count = pd.Count;
-
- if (arg_count != pd.Count)
- return false;
-
- for (int i = arg_count; i > 0; ) {
- i--;
-
- Argument a = (Argument) arguments [i];
-
- Parameter.Modifier a_mod = a.GetParameterModifier ();
- Parameter.Modifier p_mod = pd.ParameterModifier (i);
-
- if (a_mod == p_mod ||
- (a_mod == Parameter.Modifier.NONE && p_mod == Parameter.Modifier.PARAMS)) {
- if (a_mod == Parameter.Modifier.NONE)
- if (!ImplicitConversionExists (ec, a.Expr, pd.ParameterType (i)))
- return false;
-
- if (a_mod == Parameter.Modifier.REF ||
- a_mod == Parameter.Modifier.OUT) {
- Type pt = pd.ParameterType (i);
-
- if (!pt.IsByRef)
- pt = TypeManager.LookupType (pt.FullName + "&");
-
- if (pt != a.Type)
- return false;
- }
- } else
- return false;
- }
-
- return true;
- }
-
-
-
- /// <summary>
- /// Find the Applicable Function Members (7.4.2.1)
- ///
- /// me: Method Group expression with the members to select.
- /// it might contain constructors or methods (or anything
- /// that maps to a method).
- ///
- /// Arguments: ArrayList containing resolved Argument objects.
- ///
- /// loc: The location if we want an error to be reported, or a Null
- /// location for "probing" purposes.
- ///
- /// Returns: The MethodBase (either a ConstructorInfo or a MethodInfo)
- /// that is the best match of me on Arguments.
- ///
- /// </summary>
- public static MethodBase OverloadResolve (EmitContext ec, MethodGroupExpr me,
- ArrayList Arguments, Location loc)
- {
- ArrayList afm = new ArrayList ();
- MethodBase method = null;
- int argument_count;
- ArrayList candidates = new ArrayList ();
-
-
- foreach (MethodBase candidate in me.Methods){
- int x;
-
- // Check if candidate is applicable (section 14.4.2.1)
- if (!IsApplicable (ec, Arguments, candidate))
- continue;
-
- candidates.Add (candidate);
- x = BetterFunction (ec, Arguments, candidate, method, false, loc);
-
- if (x == 0)
- continue;
-
- method = candidate;
- }
-
- if (Arguments == null)
- argument_count = 0;
- else
- argument_count = Arguments.Count;
-
- //
- // Now we see if we can find params functions, applicable in their expanded form
- // since if they were applicable in their normal form, they would have been selected
- // above anyways
- //
- bool chose_params_expanded = false;
-
- if (method == null) {
- candidates = new ArrayList ();
- foreach (MethodBase candidate in me.Methods){
- if (!IsParamsMethodApplicable (ec, Arguments, candidate))
- continue;
-
- candidates.Add (candidate);
-
- int x = BetterFunction (ec, Arguments, candidate, method, true, loc);
- if (x == 0)
- continue;
-
- method = candidate;
- chose_params_expanded = true;
- }
- }
-
- if (method == null)
- return null;
-
- //
- // Now check that there are no ambiguities i.e the selected method
- // should be better than all the others
- //
-
- foreach (MethodBase candidate in candidates){
- if (candidate == method)
- continue;
-
- //
- // If a normal method is applicable in the sense that it has the same
- // number of arguments, then the expanded params method is never applicable
- // so we debar the params method.
- //
- if (IsParamsMethodApplicable (ec, Arguments, candidate) &&
- IsApplicable (ec, Arguments, method))
- continue;
-
- int x = BetterFunction (ec, Arguments, method, candidate,
- chose_params_expanded, loc);
-
- if (x != 1) {
- Report.Error (
- 121, loc,
- "Ambiguous call when selecting function due to implicit casts");
- return null;
- }
- }
-
- //
- // And now check if the arguments are all compatible, perform conversions
- // if necessary etc. and return if everything is all right
- //
-
- if (VerifyArgumentsCompat (ec, Arguments, argument_count, method,
- chose_params_expanded, null, loc))
- return method;
- else
- return null;
- }
-
- public static bool VerifyArgumentsCompat (EmitContext ec, ArrayList Arguments,
- int argument_count,
- MethodBase method,
- bool chose_params_expanded,
- Type delegate_type,
- Location loc)
- {
- ParameterData pd = GetParameterData (method);
- int pd_count = pd.Count;
-
- for (int j = 0; j < argument_count; j++) {
- Argument a = (Argument) Arguments [j];
- Expression a_expr = a.Expr;
- Type parameter_type = pd.ParameterType (j);
-
- if (pd.ParameterModifier (j) == Parameter.Modifier.PARAMS &&
- chose_params_expanded)
- parameter_type = parameter_type.GetElementType ();
-
- if (a.Type != parameter_type){
- Expression conv;
-
- conv = ConvertImplicit (ec, a_expr, parameter_type, loc);
-
- if (conv == null) {
- if (!Location.IsNull (loc)) {
- if (delegate_type == null)
- Error (1502, loc,
- "The best overloaded match for method '" +
- FullMethodDesc (method) +
- "' has some invalid arguments");
- else
- Report.Error (1594, loc,
- "Delegate '" + delegate_type.ToString () +
- "' has some invalid arguments.");
- Error (1503, loc,
- "Argument " + (j+1) +
- ": Cannot convert from '" + Argument.FullDesc (a)
- + "' to '" + pd.ParameterDesc (j) + "'");
- }
-
- return false;
- }
-
- //
- // Update the argument with the implicit conversion
- //
- if (a_expr != conv)
- a.Expr = conv;
- }
-
- if (a.GetParameterModifier () != pd.ParameterModifier (j) &&
- pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS) {
- if (!Location.IsNull (loc)) {
- Console.WriteLine ("A:P: " + a.GetParameterModifier ());
- Console.WriteLine ("PP:: " + pd.ParameterModifier (j));
- Console.WriteLine ("PT: " + parameter_type.IsByRef);
- Error (1502, loc,
- "The best overloaded match for method '" + FullMethodDesc (method)+
- "' has some invalid arguments");
- Error (1503, loc,
- "Argument " + (j+1) +
- ": Cannot convert from '" + Argument.FullDesc (a)
- + "' to '" + pd.ParameterDesc (j) + "'");
- }
-
- return false;
- }
- }
-
- return true;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // First, resolve the expression that is used to
- // trigger the invocation
- //
- if (expr is BaseAccess)
- is_base = true;
-
- expr = expr.Resolve (ec);
- if (expr == null)
- return null;
-
- if (!(expr is MethodGroupExpr)) {
- Type expr_type = expr.Type;
-
- if (expr_type != null){
- bool IsDelegate = TypeManager.IsDelegateType (expr_type);
- if (IsDelegate)
- return (new DelegateInvocation (
- this.expr, Arguments, loc)).Resolve (ec);
- }
- }
-
- if (!(expr is MethodGroupExpr)){
- report118 (loc, this.expr, "method group");
- return null;
- }
-
- //
- // Next, evaluate all the expressions in the argument list
- //
- if (Arguments != null){
- foreach (Argument a in Arguments){
- if (!a.Resolve (ec, loc))
- return null;
- }
- }
-
- method = OverloadResolve (ec, (MethodGroupExpr) this.expr, Arguments, loc);
-
- if (method == null){
- Error (-6, loc,
- "Could not find any applicable function for this argument list");
- return null;
- }
-
- if (method is MethodInfo)
- type = ((MethodInfo)method).ReturnType;
-
- if (type.IsPointer){
- if (!ec.InUnsafe){
- UnsafeError (loc);
- return null;
- }
- }
-
- eclass = ExprClass.Value;
- return this;
- }
-
- // <summary>
- // Emits the list of arguments as an array
- // </summary>
- static void EmitParams (EmitContext ec, int idx, ArrayList arguments)
- {
- ILGenerator ig = ec.ig;
- int count = arguments.Count - idx;
- Argument a = (Argument) arguments [idx];
- Type t = a.expr.Type;
- string array_type = t.FullName + "[]";
- LocalBuilder array;
-
- array = ig.DeclareLocal (Type.GetType (array_type));
- IntConstant.EmitInt (ig, count);
- ig.Emit (OpCodes.Newarr, t);
- ig.Emit (OpCodes.Stloc, array);
-
- int top = arguments.Count;
- for (int j = idx; j < top; j++){
- a = (Argument) arguments [j];
-
- ig.Emit (OpCodes.Ldloc, array);
- IntConstant.EmitInt (ig, j - idx);
- a.Emit (ec);
-
- ArrayAccess.EmitStoreOpcode (ig, t);
- }
- ig.Emit (OpCodes.Ldloc, array);
- }
-
- /// <summary>
- /// Emits a list of resolved Arguments that are in the arguments
- /// ArrayList.
- ///
- /// The MethodBase argument might be null if the
- /// emission of the arguments is known not to contain
- /// a `params' field (for example in constructors or other routines
- /// that keep their arguments in this structure
- /// </summary>
- public static void EmitArguments (EmitContext ec, MethodBase mb, ArrayList arguments)
- {
- ParameterData pd;
- if (mb != null)
- pd = GetParameterData (mb);
- else
- pd = null;
-
- //
- // If we are calling a params method with no arguments, special case it
- //
- if (arguments == null){
- if (pd != null && pd.Count > 0 &&
- pd.ParameterModifier (0) == Parameter.Modifier.PARAMS){
- ILGenerator ig = ec.ig;
-
- IntConstant.EmitInt (ig, 0);
- ig.Emit (OpCodes.Newarr, pd.ParameterType (0).GetElementType ());
- }
-
- return;
- }
-
- int top = arguments.Count;
-
- for (int i = 0; i < top; i++){
- Argument a = (Argument) arguments [i];
-
- if (pd != null){
- if (pd.ParameterModifier (i) == Parameter.Modifier.PARAMS){
- //
- // Special case if we are passing the same data as the
- // params argument, do not put it in an array.
- //
- if (pd.ParameterType (i) == a.Type)
- a.Emit (ec);
- else
- EmitParams (ec, i, arguments);
- return;
- }
- }
-
- a.Emit (ec);
- }
- }
-
- /// <remarks>
- /// is_base tells whether we want to force the use of the `call'
- /// opcode instead of using callvirt. Call is required to call
- /// a specific method, while callvirt will always use the most
- /// recent method in the vtable.
- ///
- /// is_static tells whether this is an invocation on a static method
- ///
- /// instance_expr is an expression that represents the instance
- /// it must be non-null if is_static is false.
- ///
- /// method is the method to invoke.
- ///
- /// Arguments is the list of arguments to pass to the method or constructor.
- /// </remarks>
- public static void EmitCall (EmitContext ec, bool is_base,
- bool is_static, Expression instance_expr,
- MethodBase method, ArrayList Arguments, Location loc)
- {
- ILGenerator ig = ec.ig;
- bool struct_call = false;
-
- Type decl_type = method.DeclaringType;
-
- //
- // This checks the `ConditionalAttribute' on the method, and the
- // ObsoleteAttribute
- //
- TypeManager.MethodFlags flags = TypeManager.GetMethodFlags (method);
- if ((flags & TypeManager.MethodFlags.IsObsolete) != 0){
- Report.Warning (
- 612, loc, "`" + TypeManager.CSharpSignature (method)+
- "' is obsolete");
- }
- if ((flags & TypeManager.MethodFlags.ShouldIgnore) != 0)
- return;
-
- if (!is_static){
- if (decl_type.IsValueType)
- struct_call = true;
- //
- // If this is ourselves, push "this"
- //
- if (instance_expr == null){
- ig.Emit (OpCodes.Ldarg_0);
- } else {
- //
- // Push the instance expression
- //
- if (instance_expr.Type.IsSubclassOf (TypeManager.value_type)){
- //
- // Special case: calls to a function declared in a
- // reference-type with a value-type argument need
- // to have their value boxed.
-
- struct_call = true;
- if (decl_type.IsValueType){
- //
- // If the expression implements IMemoryLocation, then
- // we can optimize and use AddressOf on the
- // return.
- //
- // If not we have to use some temporary storage for
- // it.
- if (instance_expr is IMemoryLocation){
- ((IMemoryLocation)instance_expr).
- AddressOf (ec, AddressOp.LoadStore);
- }
- else {
- Type t = instance_expr.Type;
-
- instance_expr.Emit (ec);
- LocalBuilder temp = ig.DeclareLocal (t);
- ig.Emit (OpCodes.Stloc, temp);
- ig.Emit (OpCodes.Ldloca, temp);
- }
- } else {
- instance_expr.Emit (ec);
- ig.Emit (OpCodes.Box, instance_expr.Type);
- }
- } else
- instance_expr.Emit (ec);
- }
- }
-
- EmitArguments (ec, method, Arguments);
-
- if (is_static || struct_call || is_base){
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
- } else {
- if (method is MethodInfo)
- ig.Emit (OpCodes.Callvirt, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Callvirt, (ConstructorInfo) method);
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- MethodGroupExpr mg = (MethodGroupExpr) this.expr;
-
- EmitCall (
- ec, is_base, method.IsStatic, mg.InstanceExpression, method, Arguments, loc);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec);
-
- //
- // Pop the return value if there is one
- //
- if (method is MethodInfo){
- if (((MethodInfo)method).ReturnType != TypeManager.void_type)
- ec.ig.Emit (OpCodes.Pop);
- }
- }
- }
-
- //
- // This class is used to "disable" the code generation for the
- // temporary variable when initializing value types.
- //
- class EmptyAddressOf : EmptyExpression, IMemoryLocation {
- public void AddressOf (EmitContext ec, AddressOp Mode)
- {
- // nothing
- }
- }
-
- /// <summary>
- /// Implements the new expression
- /// </summary>
- public class New : ExpressionStatement {
- public readonly ArrayList Arguments;
- public readonly string RequestedType;
-
- Location loc;
- MethodBase method = null;
-
- //
- // If set, the new expression is for a value_target, and
- // we will not leave anything on the stack.
- //
- Expression value_target;
-
- public New (string requested_type, ArrayList arguments, Location l)
- {
- RequestedType = requested_type;
- Arguments = arguments;
- loc = l;
- }
-
- public Expression ValueTypeVariable {
- get {
- return value_target;
- }
-
- set {
- value_target = value;
- }
- }
-
- //
- // This function is used to disable the following code sequence for
- // value type initialization:
- //
- // AddressOf (temporary)
- // Construct/Init
- // LoadTemporary
- //
- // Instead the provide will have provided us with the address on the
- // stack to store the results.
- //
- static Expression MyEmptyExpression;
-
- public void DisableTemporaryValueType ()
- {
- if (MyEmptyExpression == null)
- MyEmptyExpression = new EmptyAddressOf ();
-
- //
- // To enable this, look into:
- // test-34 and test-89 and self bootstrapping.
- //
- // For instance, we can avoid a copy by using `newobj'
- // instead of Call + Push-temp on value types.
-// value_target = MyEmptyExpression;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = RootContext.LookupType (ec.DeclSpace, RequestedType, false, loc);
-
- if (type == null)
- return null;
-
- bool IsDelegate = TypeManager.IsDelegateType (type);
-
- if (IsDelegate)
- return (new NewDelegate (type, Arguments, loc)).Resolve (ec);
-
- if (type.IsInterface || type.IsAbstract){
- Report.Error (
- 144, loc, "It is not possible to create instances of interfaces " +
- "or abstract classes");
- return null;
- }
-
- bool is_struct = false;
- is_struct = type.IsSubclassOf (TypeManager.value_type);
- eclass = ExprClass.Value;
-
- //
- // SRE returns a match for .ctor () on structs (the object constructor),
- // so we have to manually ignore it.
- //
- if (is_struct && Arguments == null)
- return this;
-
- Expression ml;
- ml = MemberLookupFinal (ec, type, ".ctor",
- MemberTypes.Constructor,
- AllBindingFlags | BindingFlags.DeclaredOnly, loc);
-
- if (ml == null)
- return null;
-
- if (! (ml is MethodGroupExpr)){
- if (!is_struct){
- report118 (loc, ml, "method group");
- return null;
- }
- }
-
- if (ml != null) {
- if (Arguments != null){
- foreach (Argument a in Arguments){
- if (!a.Resolve (ec, loc))
- return null;
- }
- }
-
- method = Invocation.OverloadResolve (ec, (MethodGroupExpr) ml,
- Arguments, loc);
-
- }
-
- if (method == null && !is_struct) {
- Error (1501, loc,
- "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
- return this;
- }
-
- //
- // This DoEmit can be invoked in two contexts:
- // * As a mechanism that will leave a value on the stack (new object)
- // * As one that wont (init struct)
- //
- // You can control whether a value is required on the stack by passing
- // need_value_on_stack. The code *might* leave a value on the stack
- // so it must be popped manually
- //
- // If we are dealing with a ValueType, we have a few
- // situations to deal with:
- //
- // * The target is a ValueType, and we have been provided
- // the instance (this is easy, we are being assigned).
- //
- // * The target of New is being passed as an argument,
- // to a boxing operation or a function that takes a
- // ValueType.
- //
- // In this case, we need to create a temporary variable
- // that is the argument of New.
- //
- // Returns whether a value is left on the stack
- //
- bool DoEmit (EmitContext ec, bool need_value_on_stack)
- {
- bool is_value_type = type.IsSubclassOf (TypeManager.value_type);
- ILGenerator ig = ec.ig;
-
- if (is_value_type){
- IMemoryLocation ml;
-
- if (value_target == null)
- value_target = new LocalTemporary (ec, type);
-
- ml = (IMemoryLocation) value_target;
- ml.AddressOf (ec, AddressOp.Store);
- }
-
- if (method != null)
- Invocation.EmitArguments (ec, method, Arguments);
-
- if (is_value_type){
- if (method == null)
- ig.Emit (OpCodes.Initobj, type);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
- if (need_value_on_stack){
- value_target.Emit (ec);
- return true;
- }
- return false;
- } else {
- ig.Emit (OpCodes.Newobj, (ConstructorInfo) method);
- return true;
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- DoEmit (ec, true);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- if (DoEmit (ec, false))
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- /// <summary>
- /// 14.5.10.2: Represents an array creation expression.
- /// </summary>
- ///
- /// <remarks>
- /// There are two possible scenarios here: one is an array creation
- /// expression that specifies the dimensions and optionally the
- /// initialization data and the other which does not need dimensions
- /// specified but where initialization data is mandatory.
- /// </remarks>
- public class ArrayCreation : ExpressionStatement {
- string requested_type, rank;
- ArrayList initializers;
- Location loc;
-
- //
- // The list of Argument types.
- // This is used to construct the `newarray' or constructor signature
- //
- ArrayList arguments;
-
- //
- // Method used to create the array object.
- //
- MethodBase new_method = null;
-
- Type array_element_type;
- Type underlying_type;
- bool is_one_dimensional = false;
- bool is_builtin_type = false;
- bool expect_initializers = false;
- int dimensions = 0;
-
- ArrayList array_data;
-
- Hashtable bounds;
-
- //
- // The number of array initializers that we can handle
- // via the InitializeArray method - through EmitStaticInitializers
- //
- int num_automatic_initializers;
-
- public ArrayCreation (string requested_type, ArrayList exprs, string rank, ArrayList initializers, Location l)
- {
- this.requested_type = requested_type;
- this.initializers = initializers;
- this.rank = rank;
- loc = l;
-
- arguments = new ArrayList ();
-
- foreach (Expression e in exprs)
- arguments.Add (new Argument (e, Argument.AType.Expression));
- }
-
- public ArrayCreation (string requested_type, string rank, ArrayList initializers, Location l)
- {
- this.requested_type = requested_type;
- this.initializers = initializers;
- loc = l;
-
- this.rank = rank.Substring (0, rank.LastIndexOf ("["));
-
- string tmp = rank.Substring (rank.LastIndexOf ("["));
-
- dimensions = tmp.Length - 1;
- expect_initializers = true;
- }
-
- public static string FormArrayType (string base_type, int idx_count, string rank)
- {
- StringBuilder sb = new StringBuilder (base_type);
-
- sb.Append (rank);
-
- sb.Append ("[");
- for (int i = 1; i < idx_count; i++)
- sb.Append (",");
-
- sb.Append ("]");
-
- return sb.ToString ();
- }
-
- public static string FormElementType (string base_type, int idx_count, string rank)
- {
- StringBuilder sb = new StringBuilder (base_type);
-
- sb.Append ("[");
- for (int i = 1; i < idx_count; i++)
- sb.Append (",");
-
- sb.Append ("]");
-
- sb.Append (rank);
-
- string val = sb.ToString ();
-
- return val.Substring (0, val.LastIndexOf ("["));
- }
-
- void error178 ()
- {
- Report.Error (178, loc, "Incorrectly structured array initializer");
- }
-
- public bool CheckIndices (EmitContext ec, ArrayList probe, int idx, bool specified_dims)
- {
- if (specified_dims) {
- Argument a = (Argument) arguments [idx];
-
- if (!a.Resolve (ec, loc))
- return false;
-
- if (!(a.Expr is Constant)) {
- Report.Error (150, loc, "A constant value is expected");
- return false;
- }
-
- int value = (int) ((Constant) a.Expr).GetValue ();
-
- if (value != probe.Count) {
- error178 ();
- return false;
- }
-
- bounds [idx] = value;
- }
-
- foreach (object o in probe) {
- if (o is ArrayList) {
- bool ret = CheckIndices (ec, (ArrayList) o, idx + 1, specified_dims);
- if (!ret)
- return false;
- } else {
- Expression tmp = (Expression) o;
- tmp = tmp.Resolve (ec);
- if (tmp == null)
- continue;
-
- // Console.WriteLine ("I got: " + tmp);
- // Handle initialization from vars, fields etc.
-
- Expression conv = ConvertImplicitRequired (
- ec, tmp, underlying_type, loc);
-
- if (conv == null)
- return false;
-
- if (conv is StringConstant)
- array_data.Add (conv);
- else if (conv is Constant) {
- array_data.Add (conv);
- num_automatic_initializers++;
- } else
- array_data.Add (conv);
- }
- }
-
- return true;
- }
-
- public void UpdateIndices (EmitContext ec)
- {
- int i = 0;
- for (ArrayList probe = initializers; probe != null;) {
- if (probe.Count > 0 && probe [0] is ArrayList) {
- Expression e = new IntConstant (probe.Count);
- arguments.Add (new Argument (e, Argument.AType.Expression));
-
- bounds [i++] = probe.Count;
-
- probe = (ArrayList) probe [0];
-
- } else {
- Expression e = new IntConstant (probe.Count);
- arguments.Add (new Argument (e, Argument.AType.Expression));
-
- bounds [i++] = probe.Count;
- probe = null;
- }
- }
-
- }
-
- public bool ValidateInitializers (EmitContext ec)
- {
- if (initializers == null) {
- if (expect_initializers)
- return false;
- else
- return true;
- }
-
- underlying_type = RootContext.LookupType (
- ec.DeclSpace, requested_type, false, loc);
-
- if (underlying_type == null)
- return false;
-
- //
- // We use this to store all the date values in the order in which we
- // will need to store them in the byte blob later
- //
- array_data = new ArrayList ();
- bounds = new Hashtable ();
-
- bool ret;
-
- if (arguments != null) {
- ret = CheckIndices (ec, initializers, 0, true);
- return ret;
- } else {
- arguments = new ArrayList ();
-
- ret = CheckIndices (ec, initializers, 0, false);
-
- if (!ret)
- return false;
-
- UpdateIndices (ec);
-
- if (arguments.Count != dimensions) {
- error178 ();
- return false;
- }
-
- return ret;
- }
- }
-
- void Error_NegativeArrayIndex ()
- {
- Report.Error (284, loc, "Can not create array with a negative size");
- }
-
- //
- // Converts `source' to an int, uint, long or ulong.
- //
- Expression ExpressionToArrayArgument (EmitContext ec, Expression source)
- {
- Expression target;
-
- bool old_checked = ec.CheckState;
- ec.CheckState = true;
-
- target = ConvertImplicit (ec, source, TypeManager.int32_type, loc);
- if (target == null){
- target = ConvertImplicit (ec, source, TypeManager.uint32_type, loc);
- if (target == null){
- target = ConvertImplicit (ec, source, TypeManager.int64_type, loc);
- if (target == null){
- target = ConvertImplicit (ec, source, TypeManager.uint64_type, loc);
- if (target == null)
- Expression.Error_CannotConvertImplicit (loc, source.Type, TypeManager.int32_type);
- }
- }
- }
- ec.CheckState = old_checked;
-
- //
- // Only positive constants are allowed at compile time
- //
- if (target is Constant){
- if (target is IntConstant){
- if (((IntConstant) target).Value < 0){
- Error_NegativeArrayIndex ();
- return null;
- }
- }
-
- if (target is LongConstant){
- if (((LongConstant) target).Value < 0){
- Error_NegativeArrayIndex ();
- return null;
- }
- }
-
- }
-
- return target;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- int arg_count;
-
- //
- // First step is to validate the initializers and fill
- // in any missing bits
- //
- if (!ValidateInitializers (ec))
- return null;
-
- if (arguments == null)
- arg_count = 0;
- else {
- arg_count = arguments.Count;
- foreach (Argument a in arguments){
- if (!a.Resolve (ec, loc))
- return null;
-
- Expression real_arg = ExpressionToArrayArgument (ec, a.expr);
- if (real_arg == null)
- return null;
-
- a.expr = real_arg;
- }
- }
-
- string array_type = FormArrayType (requested_type, arg_count, rank);
- string element_type = FormElementType (requested_type, arg_count, rank);
-
- type = RootContext.LookupType (ec.DeclSpace, array_type, false, loc);
-
- array_element_type = RootContext.LookupType (
- ec.DeclSpace, element_type, false, loc);
-
- if (type == null)
- return null;
-
- if (arg_count == 1) {
- is_one_dimensional = true;
- eclass = ExprClass.Value;
- return this;
- }
-
- is_builtin_type = TypeManager.IsBuiltinType (type);
-
- if (is_builtin_type) {
- Expression ml;
-
- ml = MemberLookup (ec, type, ".ctor", MemberTypes.Constructor,
- AllBindingFlags, loc);
-
- if (!(ml is MethodGroupExpr)) {
- report118 (loc, ml, "method group");
- return null;
- }
-
- if (ml == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
-
- new_method = Invocation.OverloadResolve (ec, (MethodGroupExpr) ml, arguments, loc);
-
- if (new_method == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
-
- eclass = ExprClass.Value;
- return this;
- } else {
- ModuleBuilder mb = CodeGen.ModuleBuilder;
- ArrayList args = new ArrayList ();
-
- if (arguments != null) {
- for (int i = 0; i < arg_count; i++)
- args.Add (TypeManager.int32_type);
- }
-
- Type [] arg_types = null;
-
- if (args.Count > 0)
- arg_types = new Type [args.Count];
-
- args.CopyTo (arg_types, 0);
-
- new_method = mb.GetArrayMethod (type, ".ctor", CallingConventions.HasThis, null,
- arg_types);
-
- if (new_method == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
- }
-
- eclass = ExprClass.Value;
- return this;
- }
- }
-
- public static byte [] MakeByteBlob (ArrayList array_data, Type underlying_type, Location loc)
- {
- int factor;
- byte [] data;
- byte [] element;
- int count = array_data.Count;
-
- factor = GetTypeSize (underlying_type);
- if (factor == 0)
- return null;
-
- data = new byte [(count * factor + 4) & ~3];
- int idx = 0;
-
- for (int i = 0; i < count; ++i) {
- object v = array_data [i];
-
- if (v is EnumConstant)
- v = ((EnumConstant) v).Child;
-
- if (v is Constant && !(v is StringConstant))
- v = ((Constant) v).GetValue ();
- else {
- idx += factor;
- continue;
- }
-
- if (underlying_type == TypeManager.int64_type){
- if (!(v is Expression)){
- long val = (long) v;
-
- for (int j = 0; j < factor; ++j) {
- data [idx + j] = (byte) (val & 0xFF);
- val = (val >> 8);
- }
- }
- } else if (underlying_type == TypeManager.uint64_type){
- if (!(v is Expression)){
- ulong val = (ulong) v;
-
- for (int j = 0; j < factor; ++j) {
- data [idx + j] = (byte) (val & 0xFF);
- val = (val >> 8);
- }
- }
- } else if (underlying_type == TypeManager.float_type) {
- if (!(v is Expression)){
- element = BitConverter.GetBytes ((float) v);
-
- for (int j = 0; j < factor; ++j)
- data [idx + j] = element [j];
- }
- } else if (underlying_type == TypeManager.double_type) {
- if (!(v is Expression)){
- element = BitConverter.GetBytes ((double) v);
-
- for (int j = 0; j < factor; ++j)
- data [idx + j] = element [j];
- }
- } else if (underlying_type == TypeManager.char_type){
- if (!(v is Expression)){
- int val = (int) ((char) v);
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) (val >> 8);
- }
- } else if (underlying_type == TypeManager.short_type){
- if (!(v is Expression)){
- int val = (int) ((short) v);
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) (val >> 8);
- }
- } else if (underlying_type == TypeManager.ushort_type){
- if (!(v is Expression)){
- int val = (int) ((ushort) v);
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) (val >> 8);
- }
- } else if (underlying_type == TypeManager.int32_type) {
- if (!(v is Expression)){
- int val = (int) v;
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) ((val >> 8) & 0xff);
- data [idx+2] = (byte) ((val >> 16) & 0xff);
- data [idx+3] = (byte) (val >> 24);
- }
- } else if (underlying_type == TypeManager.uint32_type) {
- if (!(v is Expression)){
- uint val = (uint) v;
-
- data [idx] = (byte) (val & 0xff);
- data [idx+1] = (byte) ((val >> 8) & 0xff);
- data [idx+2] = (byte) ((val >> 16) & 0xff);
- data [idx+3] = (byte) (val >> 24);
- }
- } else if (underlying_type == TypeManager.sbyte_type) {
- if (!(v is Expression)){
- sbyte val = (sbyte) v;
- data [idx] = (byte) val;
- }
- } else if (underlying_type == TypeManager.byte_type) {
- if (!(v is Expression)){
- byte val = (byte) v;
- data [idx] = (byte) val;
- }
- } else if (underlying_type == TypeManager.bool_type) {
- if (!(v is Expression)){
- bool val = (bool) v;
- data [idx] = (byte) (val ? 1 : 0);
- }
- } else
- throw new Exception ("Unrecognized type in MakeByteBlob");
-
- idx += factor;
- }
-
- return data;
- }
-
- //
- // Emits the initializers for the array
- //
- void EmitStaticInitializers (EmitContext ec, bool is_expression)
- {
- //
- // First, the static data
- //
- FieldBuilder fb;
- ILGenerator ig = ec.ig;
-
- byte [] data = MakeByteBlob (array_data, underlying_type, loc);
-
- if (data != null) {
- fb = RootContext.MakeStaticData (data);
-
- if (is_expression)
- ig.Emit (OpCodes.Dup);
- ig.Emit (OpCodes.Ldtoken, fb);
- ig.Emit (OpCodes.Call,
- TypeManager.void_initializearray_array_fieldhandle);
- }
- }
-
- //
- // Emits pieces of the array that can not be computed at compile
- // time (variables and string locations).
- //
- // This always expect the top value on the stack to be the array
- //
- void EmitDynamicInitializers (EmitContext ec, bool is_expression)
- {
- ILGenerator ig = ec.ig;
- int dims = bounds.Count;
- int [] current_pos = new int [dims];
- int top = array_data.Count;
- LocalBuilder temp = ig.DeclareLocal (type);
-
- ig.Emit (OpCodes.Stloc, temp);
-
- MethodInfo set = null;
-
- if (dims != 1){
- Type [] args;
- ModuleBuilder mb = null;
- mb = CodeGen.ModuleBuilder;
- args = new Type [dims + 1];
-
- int j;
- for (j = 0; j < dims; j++)
- args [j] = TypeManager.int32_type;
-
- args [j] = array_element_type;
-
- set = mb.GetArrayMethod (
- type, "Set",
- CallingConventions.HasThis | CallingConventions.Standard,
- TypeManager.void_type, args);
- }
-
- for (int i = 0; i < top; i++){
-
- Expression e = null;
-
- if (array_data [i] is Expression)
- e = (Expression) array_data [i];
-
- if (e != null) {
- //
- // Basically we do this for string literals and
- // other non-literal expressions
- //
- if (e is StringConstant || !(e is Constant) ||
- num_automatic_initializers <= 2) {
- Type etype = e.Type;
-
- ig.Emit (OpCodes.Ldloc, temp);
-
- for (int idx = dims; idx > 0; ) {
- idx--;
- IntConstant.EmitInt (ig, current_pos [idx]);
- }
-
- //
- // If we are dealing with a struct, get the
- // address of it, so we can store it.
- //
- if (etype.IsSubclassOf (TypeManager.value_type) &&
- !TypeManager.IsBuiltinType (etype)){
- if (e is New){
- New n = (New) e;
-
- //
- // Let new know that we are providing
- // the address where to store the results
- //
- n.DisableTemporaryValueType ();
- }
-
- ig.Emit (OpCodes.Ldelema, etype);
- }
-
- e.Emit (ec);
-
- if (dims == 1)
- ArrayAccess.EmitStoreOpcode (ig, array_element_type);
- else
- ig.Emit (OpCodes.Call, set);
- }
- }
-
- //
- // Advance counter
- //
- for (int j = 0; j < dims; j++){
- current_pos [j]++;
- if (current_pos [j] < (int) bounds [j])
- break;
- current_pos [j] = 0;
- }
- }
-
- if (is_expression)
- ig.Emit (OpCodes.Ldloc, temp);
- }
-
- void EmitArrayArguments (EmitContext ec)
- {
- foreach (Argument a in arguments)
- a.Emit (ec);
- }
-
- void DoEmit (EmitContext ec, bool is_statement)
- {
- ILGenerator ig = ec.ig;
-
- EmitArrayArguments (ec);
- if (is_one_dimensional)
- ig.Emit (OpCodes.Newarr, array_element_type);
- else {
- if (is_builtin_type)
- ig.Emit (OpCodes.Newobj, (ConstructorInfo) new_method);
- else
- ig.Emit (OpCodes.Newobj, (MethodInfo) new_method);
- }
-
- if (initializers != null){
- //
- // FIXME: Set this variable correctly.
- //
- bool dynamic_initializers = true;
-
- if (underlying_type != TypeManager.string_type &&
- underlying_type != TypeManager.object_type) {
- if (num_automatic_initializers > 2)
- EmitStaticInitializers (ec, dynamic_initializers || !is_statement);
- }
-
- if (dynamic_initializers)
- EmitDynamicInitializers (ec, !is_statement);
- }
- }
-
- public override void Emit (EmitContext ec)
- {
- DoEmit (ec, false);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- DoEmit (ec, true);
- }
-
- }
-
- /// <summary>
- /// Represents the `this' construct
- /// </summary>
- public class This : Expression, IAssignMethod, IMemoryLocation {
- Location loc;
-
- public This (Location loc)
- {
- this.loc = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- eclass = ExprClass.Variable;
- type = ec.ContainerType;
-
- if (ec.IsStatic){
- Report.Error (26, loc,
- "Keyword this not valid in static code");
- return null;
- }
-
- return this;
- }
-
- override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- DoResolve (ec);
-
- if (ec.TypeContainer is Class){
- Report.Error (1604, loc, "Cannot assign to `this'");
- return null;
- }
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldarg_0);
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- source.Emit (ec);
- ec.ig.Emit (OpCodes.Starg, 0);
- }
-
- public void AddressOf (EmitContext ec, AddressOp mode)
- {
- ec.ig.Emit (OpCodes.Ldarg_0);
-
- // FIMXE
- // FIGURE OUT WHY LDARG_S does not work
- //
- // consider: struct X { int val; int P { set { val = value; }}}
- //
- // Yes, this looks very bad. Look at `NOTAS' for
- // an explanation.
- // ec.ig.Emit (OpCodes.Ldarga_S, (byte) 0);
- }
- }
-
- /// <summary>
- /// Implements the typeof operator
- /// </summary>
- public class TypeOf : Expression {
- public readonly string QueriedType;
- Type typearg;
- Location loc;
-
- public TypeOf (string queried_type, Location l)
- {
- QueriedType = queried_type;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- typearg = RootContext.LookupType (
- ec.DeclSpace, QueriedType, false, loc);
-
- if (typearg == null)
- return null;
-
- type = TypeManager.type_type;
- eclass = ExprClass.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldtoken, typearg);
- ec.ig.Emit (OpCodes.Call, TypeManager.system_type_get_type_from_handle);
- }
-
- public Type TypeArg {
- get { return typearg; }
- }
- }
-
- /// <summary>
- /// Implements the sizeof expression
- /// </summary>
- public class SizeOf : Expression {
- public readonly string QueriedType;
- Type type_queried;
- Location loc;
-
- public SizeOf (string queried_type, Location l)
- {
- this.QueriedType = queried_type;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type_queried = RootContext.LookupType (
- ec.DeclSpace, QueriedType, false, loc);
- if (type_queried == null)
- return null;
-
- type = TypeManager.int32_type;
- eclass = ExprClass.Value;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- int size = GetTypeSize (type_queried);
-
- if (size == 0)
- ec.ig.Emit (OpCodes.Sizeof, type_queried);
- else
- IntConstant.EmitInt (ec.ig, size);
- }
- }
-
- /// <summary>
- /// Implements the member access expression
- /// </summary>
- public class MemberAccess : Expression {
- public readonly string Identifier;
- Expression expr;
- Expression member_lookup;
- Location loc;
-
- public MemberAccess (Expression expr, string id, Location l)
- {
- this.expr = expr;
- Identifier = id;
- loc = l;
- }
-
- public Expression Expr {
- get {
- return expr;
- }
- }
-
- static void error176 (Location loc, string name)
- {
- Report.Error (176, loc, "Static member `" +
- name + "' cannot be accessed " +
- "with an instance reference, qualify with a " +
- "type name instead");
- }
-
- static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Location loc)
- {
- if (left_original == null)
- return false;
-
- if (!(left_original is SimpleName))
- return false;
-
- SimpleName sn = (SimpleName) left_original;
-
- Type t = RootContext.LookupType (ec.DeclSpace, sn.Name, true, loc);
- if (t != null)
- return true;
-
- return false;
- }
-
- public static Expression ResolveMemberAccess (EmitContext ec, Expression member_lookup,
- Expression left, Location loc,
- Expression left_original)
- {
- //
- // Method Groups
- //
- if (member_lookup is MethodGroupExpr){
- MethodGroupExpr mg = (MethodGroupExpr) member_lookup;
-
- //
- // Type.MethodGroup
- //
- if (left is TypeExpr){
- if (!mg.RemoveInstanceMethods ()){
- SimpleName.Error120 (loc, mg.Methods [0].Name);
- return null;
- }
-
- return member_lookup;
- }
-
- //
- // Instance.MethodGroup
- //
- if (IdenticalNameAndTypeName (ec, left_original, loc)){
- if (mg.RemoveInstanceMethods ())
- return member_lookup;
- }
-
- if (!mg.RemoveStaticMethods ()){
- error176 (loc, mg.Methods [0].Name);
- return null;
- }
-
- mg.InstanceExpression = left;
- return member_lookup;
-#if ORIGINAL
- if (!mg.RemoveStaticMethods ()){
- if (IdenticalNameAndTypeName (ec, left_original, loc)){
- if (!mg.RemoveInstanceMethods ()){
- SimpleName.Error120 (loc, mg.Methods [0].Name);
- return null;
- }
- return member_lookup;
- }
-
- error176 (loc, mg.Methods [0].Name);
- return null;
- }
-
- mg.InstanceExpression = left;
-
- return member_lookup;
-#endif
- }
-
- if (member_lookup is FieldExpr){
- FieldExpr fe = (FieldExpr) member_lookup;
- FieldInfo fi = fe.FieldInfo;
- Type decl_type = fi.DeclaringType;
-
- if (fi is FieldBuilder) {
- Const c = TypeManager.LookupConstant ((FieldBuilder) fi);
-
- if (c != null) {
- object o = c.LookupConstantValue (ec);
- object real_value = ((Constant) c.Expr).GetValue ();
-
- return Constantify (real_value, fi.FieldType);
- }
- }
-
- if (fi.IsLiteral) {
- Type t = fi.FieldType;
-
- object o;
-
- if (fi is FieldBuilder)
- o = TypeManager.GetValue ((FieldBuilder) fi);
- else
- o = fi.GetValue (fi);
-
- if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression enum_member = MemberLookup (
- ec, decl_type, "value__", MemberTypes.Field,
- AllBindingFlags, loc);
-
- Enum en = TypeManager.LookupEnum (decl_type);
-
- Constant c;
- if (en != null)
- c = Constantify (o, en.UnderlyingType);
- else
- c = Constantify (o, enum_member.Type);
-
- return new EnumConstant (c, decl_type);
- }
-
- Expression exp = Constantify (o, t);
-
- if (!(left is TypeExpr)) {
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
-
- return exp;
- }
-
- if (fi.FieldType.IsPointer && !ec.InUnsafe){
- UnsafeError (loc);
- return null;
- }
-
- if (left is TypeExpr){
- // and refers to a type name or an
- if (!fe.FieldInfo.IsStatic){
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
- return member_lookup;
- } else {
- if (fe.FieldInfo.IsStatic){
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return member_lookup;
-
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
- fe.InstanceExpression = left;
-
- return fe;
- }
- }
-
- if (member_lookup is PropertyExpr){
- PropertyExpr pe = (PropertyExpr) member_lookup;
-
- if (left is TypeExpr){
- if (!pe.IsStatic){
- SimpleName.Error120 (loc, pe.PropertyInfo.Name);
- return null;
- }
- return pe;
- } else {
- if (pe.IsStatic){
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return member_lookup;
- error176 (loc, pe.PropertyInfo.Name);
- return null;
- }
- pe.InstanceExpression = left;
-
- return pe;
- }
- }
-
- if (member_lookup is EventExpr) {
-
- EventExpr ee = (EventExpr) member_lookup;
-
- //
- // If the event is local to this class, we transform ourselves into
- // a FieldExpr
- //
-
- Expression ml = MemberLookup (
- ec, ec.ContainerType,
- ee.EventInfo.Name, MemberTypes.Event, AllBindingFlags, loc);
-
- if (ml != null) {
- MemberInfo mi = ec.TypeContainer.GetFieldFromEvent ((EventExpr) ml);
-
- if (mi == null) {
- //
- // If this happens, then we have an event with its own
- // accessors and private field etc so there's no need
- // to transform ourselves : we should instead flag an error
- //
- Assign.error70 (ee.EventInfo, loc);
- return null;
- }
-
- ml = ExprClassFromMemberInfo (ec, mi, loc);
-
- if (ml == null) {
- Report.Error (-200, loc, "Internal error!!");
- return null;
- }
- return ResolveMemberAccess (ec, ml, left, loc, left_original);
- }
-
- if (left is TypeExpr) {
- if (!ee.IsStatic) {
- SimpleName.Error120 (loc, ee.EventInfo.Name);
- return null;
- }
-
- return ee;
-
- } else {
- if (ee.IsStatic) {
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return ee;
-
- error176 (loc, ee.EventInfo.Name);
- return null;
- }
-
- ee.InstanceExpression = left;
-
- return ee;
- }
- }
-
- if (member_lookup is TypeExpr){
- member_lookup.Resolve (ec);
- return member_lookup;
- }
-
- Console.WriteLine ("Left is: " + left);
- Report.Error (-100, loc, "Support for [" + member_lookup + "] is not present yet");
- Environment.Exit (0);
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are the sole users of ResolveWithSimpleName (ie, the only
- // ones that can cope with it
- //
- Expression original = expr;
- expr = expr.ResolveWithSimpleName (ec);
-
- if (expr == null)
- return null;
-
- if (expr is SimpleName){
- SimpleName child_expr = (SimpleName) expr;
-
- expr = new SimpleName (child_expr.Name + "." + Identifier, loc);
-
- return expr.ResolveWithSimpleName (ec);
- }
-
- //
- // TODO: I mailed Ravi about this, and apparently we can get rid
- // of this and put it in the right place.
- //
- // Handle enums here when they are in transit.
- // Note that we cannot afford to hit MemberLookup in this case because
- // it will fail to find any members at all
- //
-
- Type expr_type = expr.Type;
- if ((expr is TypeExpr) && (expr_type.IsSubclassOf (TypeManager.enum_type))){
-
- Enum en = TypeManager.LookupEnum (expr_type);
-
- if (en != null) {
- object value = en.LookupEnumValue (ec, Identifier, loc);
-
- if (value != null){
- Constant c = Constantify (value, en.UnderlyingType);
- return new EnumConstant (c, expr_type);
- }
- }
- }
-
- if (expr_type.IsPointer){
- Report.Error (23, loc,
- "The `.' operator can not be applied to pointer operands (" +
- TypeManager.CSharpName (expr_type) + ")");
- return null;
- }
-
- member_lookup = MemberLookup (ec, expr_type, Identifier, loc);
-
- if (member_lookup == null){
- //
- // Try looking the member up from the same type, if we find
- // it, we know that the error was due to limited visibility
- //
- object lookup = TypeManager.MemberLookup (
- expr_type, expr_type, AllMemberTypes, AllBindingFlags, Identifier);
- if (lookup == null)
- Report.Error (117, loc, "`" + expr_type + "' does not contain a " +
- "definition for `" + Identifier + "'");
- else
- Report.Error (122, loc, "`" + expr_type + "." + Identifier + "' " +
- "is inaccessible because of its protection level");
-
- return null;
- }
-
- return ResolveMemberAccess (ec, member_lookup, expr, loc, original);
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should not happen");
- }
- }
-
- /// <summary>
- /// Implements checked expressions
- /// </summary>
- public class CheckedExpr : Expression {
-
- public Expression Expr;
-
- public CheckedExpr (Expression e)
- {
- Expr = e;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- bool last_const_check = ec.ConstantCheckState;
-
- ec.ConstantCheckState = true;
- Expr = Expr.Resolve (ec);
- ec.ConstantCheckState = last_const_check;
-
- if (Expr == null)
- return null;
-
- eclass = Expr.eclass;
- type = Expr.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- bool last_check = ec.CheckState;
- bool last_const_check = ec.ConstantCheckState;
-
- ec.CheckState = true;
- ec.ConstantCheckState = true;
- Expr.Emit (ec);
- ec.CheckState = last_check;
- ec.ConstantCheckState = last_const_check;
- }
-
- }
-
- /// <summary>
- /// Implements the unchecked expression
- /// </summary>
- public class UnCheckedExpr : Expression {
-
- public Expression Expr;
-
- public UnCheckedExpr (Expression e)
- {
- Expr = e;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- bool last_const_check = ec.ConstantCheckState;
-
- ec.ConstantCheckState = false;
- Expr = Expr.Resolve (ec);
- ec.ConstantCheckState = last_const_check;
-
- if (Expr == null)
- return null;
-
- eclass = Expr.eclass;
- type = Expr.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- bool last_check = ec.CheckState;
- bool last_const_check = ec.ConstantCheckState;
-
- ec.CheckState = false;
- ec.ConstantCheckState = false;
- Expr.Emit (ec);
- ec.CheckState = last_check;
- ec.ConstantCheckState = last_const_check;
- }
-
- }
-
- /// <summary>
- /// An Element Access expression.
- ///
- /// During semantic analysis these are transformed into
- /// IndexerAccess or ArrayAccess
- /// </summary>
- public class ElementAccess : Expression {
- public ArrayList Arguments;
- public Expression Expr;
- public Location loc;
-
- public ElementAccess (Expression e, ArrayList e_list, Location l)
- {
- Expr = e;
-
- loc = l;
-
- if (e_list == null)
- return;
-
- Arguments = new ArrayList ();
- foreach (Expression tmp in e_list)
- Arguments.Add (new Argument (tmp, Argument.AType.Expression));
-
- }
-
- bool CommonResolve (EmitContext ec)
- {
- Expr = Expr.Resolve (ec);
-
- if (Expr == null)
- return false;
-
- if (Arguments == null)
- return false;
-
- foreach (Argument a in Arguments){
- if (!a.Resolve (ec, loc))
- return false;
- }
-
- return true;
- }
-
- Expression MakePointerAccess ()
- {
- Type t = Expr.Type;
-
- if (t == TypeManager.void_ptr_type){
- Report.Error (
- 242, loc,
- "The array index operation is not valid for void pointers");
- return null;
- }
- if (Arguments.Count != 1){
- Report.Error (
- 196, loc,
- "A pointer must be indexed by a single value");
- return null;
- }
- Expression p = new PointerArithmetic (true, Expr, ((Argument)Arguments [0]).Expr, t);
- return new Indirection (p);
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- if (!CommonResolve (ec))
- return null;
-
- //
- // We perform some simple tests, and then to "split" the emit and store
- // code we create an instance of a different class, and return that.
- //
- // I am experimenting with this pattern.
- //
- Type t = Expr.Type;
-
- if (t.IsArray)
- return (new ArrayAccess (this)).Resolve (ec);
- else if (t.IsPointer)
- return MakePointerAccess ();
- else
- return (new IndexerAccess (this)).Resolve (ec);
- }
-
- public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- if (!CommonResolve (ec))
- return null;
-
- Type t = Expr.Type;
- if (t.IsArray)
- return (new ArrayAccess (this)).ResolveLValue (ec, right_side);
- else if (t.IsPointer)
- return MakePointerAccess ();
- else
- return (new IndexerAccess (this)).ResolveLValue (ec, right_side);
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should never be reached");
- }
- }
-
- /// <summary>
- /// Implements array access
- /// </summary>
- public class ArrayAccess : Expression, IAssignMethod, IMemoryLocation {
- //
- // Points to our "data" repository
- //
- ElementAccess ea;
-
- LocalTemporary [] cached_locations;
-
- public ArrayAccess (ElementAccess ea_data)
- {
- ea = ea_data;
- eclass = ExprClass.Variable;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- ExprClass eclass = ea.Expr.eclass;
-
-#if false
- // As long as the type is valid
- if (!(eclass == ExprClass.Variable || eclass == ExprClass.PropertyAccess ||
- eclass == ExprClass.Value)) {
- report118 (ea.loc, ea.Expr, "variable or value");
- return null;
- }
-#endif
-
- Type t = ea.Expr.Type;
- if (t.GetArrayRank () != ea.Arguments.Count){
- Report.Error (22, ea.loc,
- "Incorrect number of indexes for array " +
- " expected: " + t.GetArrayRank () + " got: " +
- ea.Arguments.Count);
- return null;
- }
- type = TypeManager.TypeToCoreType (t.GetElementType ());
- if (type.IsPointer && !ec.InUnsafe){
- UnsafeError (ea.loc);
- return null;
- }
-
- eclass = ExprClass.Variable;
-
- return this;
- }
-
- /// <summary>
- /// Emits the right opcode to load an object of Type `t'
- /// from an array of T
- /// </summary>
- static public void EmitLoadOpcode (ILGenerator ig, Type type)
- {
- if (type == TypeManager.byte_type || type == TypeManager.bool_type)
- ig.Emit (OpCodes.Ldelem_I1);
- else if (type == TypeManager.sbyte_type)
- ig.Emit (OpCodes.Ldelem_U1);
- else if (type == TypeManager.short_type)
- ig.Emit (OpCodes.Ldelem_I2);
- else if (type == TypeManager.ushort_type)
- ig.Emit (OpCodes.Ldelem_U2);
- else if (type == TypeManager.int32_type)
- ig.Emit (OpCodes.Ldelem_I4);
- else if (type == TypeManager.uint32_type)
- ig.Emit (OpCodes.Ldelem_U4);
- else if (type == TypeManager.uint64_type)
- ig.Emit (OpCodes.Ldelem_I8);
- else if (type == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldelem_I8);
- else if (type == TypeManager.float_type)
- ig.Emit (OpCodes.Ldelem_R4);
- else if (type == TypeManager.double_type)
- ig.Emit (OpCodes.Ldelem_R8);
- else if (type == TypeManager.intptr_type)
- ig.Emit (OpCodes.Ldelem_I);
- else if (type.IsValueType){
- ig.Emit (OpCodes.Ldelema, type);
- ig.Emit (OpCodes.Ldobj, type);
- } else
- ig.Emit (OpCodes.Ldelem_Ref);
- }
-
- /// <summary>
- /// Emits the right opcode to store an object of Type `t'
- /// from an array of T.
- /// </summary>
- static public void EmitStoreOpcode (ILGenerator ig, Type t)
- {
- if (t == TypeManager.byte_type || t == TypeManager.sbyte_type ||
- t == TypeManager.bool_type)
- ig.Emit (OpCodes.Stelem_I1);
- else if (t == TypeManager.short_type || t == TypeManager.ushort_type || t == TypeManager.char_type)
- ig.Emit (OpCodes.Stelem_I2);
- else if (t == TypeManager.int32_type || t == TypeManager.uint32_type)
- ig.Emit (OpCodes.Stelem_I4);
- else if (t == TypeManager.int64_type || t == TypeManager.uint64_type)
- ig.Emit (OpCodes.Stelem_I8);
- else if (t == TypeManager.float_type)
- ig.Emit (OpCodes.Stelem_R4);
- else if (t == TypeManager.double_type)
- ig.Emit (OpCodes.Stelem_R8);
- else if (t == TypeManager.intptr_type)
- ig.Emit (OpCodes.Stelem_I);
- else if (t.IsValueType)
- ig.Emit (OpCodes.Stobj, t);
- else
- ig.Emit (OpCodes.Stelem_Ref);
- }
-
- MethodInfo FetchGetMethod ()
- {
- ModuleBuilder mb = CodeGen.ModuleBuilder;
- int arg_count = ea.Arguments.Count;
- Type [] args = new Type [arg_count];
- MethodInfo get;
-
- for (int i = 0; i < arg_count; i++){
- //args [i++] = a.Type;
- args [i] = TypeManager.int32_type;
- }
-
- get = mb.GetArrayMethod (
- ea.Expr.Type, "Get",
- CallingConventions.HasThis |
- CallingConventions.Standard,
- type, args);
- return get;
- }
-
-
- MethodInfo FetchAddressMethod ()
- {
- ModuleBuilder mb = CodeGen.ModuleBuilder;
- int arg_count = ea.Arguments.Count;
- Type [] args = new Type [arg_count];
- MethodInfo address;
- string ptr_type_name;
- Type ret_type;
-
- ptr_type_name = type.FullName + "&";
- ret_type = Type.GetType (ptr_type_name);
-
- //
- // It is a type defined by the source code we are compiling
- //
- if (ret_type == null){
- ret_type = mb.GetType (ptr_type_name);
- }
-
- for (int i = 0; i < arg_count; i++){
- //args [i++] = a.Type;
- args [i] = TypeManager.int32_type;
- }
-
- address = mb.GetArrayMethod (
- ea.Expr.Type, "Address",
- CallingConventions.HasThis |
- CallingConventions.Standard,
- ret_type, args);
-
- return address;
- }
-
- //
- // Load the array arguments into the stack.
- //
- // If we have been requested to cache the values (cached_locations array
- // initialized), then load the arguments the first time and store them
- // in locals. otherwise load from local variables.
- //
- void LoadArrayAndArguments (EmitContext ec)
- {
- if (cached_locations == null){
- ea.Expr.Emit (ec);
- foreach (Argument a in ea.Arguments)
- a.Expr.Emit (ec);
- return;
- }
-
- ILGenerator ig = ec.ig;
-
- if (cached_locations [0] == null){
- cached_locations [0] = new LocalTemporary (ec, ea.Expr.Type);
- ea.Expr.Emit (ec);
- ig.Emit (OpCodes.Dup);
- cached_locations [0].Store (ec);
-
- int j = 1;
-
- foreach (Argument a in ea.Arguments){
- cached_locations [j] = new LocalTemporary (ec, a.Expr.Type);
- a.Expr.Emit (ec);
- ig.Emit (OpCodes.Dup);
- cached_locations [j].Store (ec);
- j++;
- }
- return;
- }
-
- foreach (LocalTemporary lt in cached_locations)
- lt.Emit (ec);
- }
-
- public new void CacheTemporaries (EmitContext ec)
- {
- cached_locations = new LocalTemporary [ea.Arguments.Count + 1];
- }
-
- public override void Emit (EmitContext ec)
- {
- int rank = ea.Expr.Type.GetArrayRank ();
- ILGenerator ig = ec.ig;
-
- LoadArrayAndArguments (ec);
-
- if (rank == 1)
- EmitLoadOpcode (ig, type);
- else {
- MethodInfo method;
-
- method = FetchGetMethod ();
- ig.Emit (OpCodes.Call, method);
- }
- }
-
- public void EmitAssign (EmitContext ec, Expression source)
- {
- int rank = ea.Expr.Type.GetArrayRank ();
- ILGenerator ig = ec.ig;
- Type t = source.Type;
-
- LoadArrayAndArguments (ec);
-
- //
- // The stobj opcode used by value types will need
- // an address on the stack, not really an array/array
- // pair
- //
- if (rank == 1){
- if (t.IsValueType && !TypeManager.IsBuiltinType (t))
- ig.Emit (OpCodes.Ldelema, t);
- }
-
- source.Emit (ec);
-
- if (rank == 1)
- EmitStoreOpcode (ig, t);
- else {
- ModuleBuilder mb = CodeGen.ModuleBuilder;
- int arg_count = ea.Arguments.Count;
- Type [] args = new Type [arg_count + 1];
- MethodInfo set;
-
- for (int i = 0; i < arg_count; i++){
- //args [i++] = a.Type;
- args [i] = TypeManager.int32_type;
- }
-
- args [arg_count] = type;
-
- set = mb.GetArrayMethod (
- ea.Expr.Type, "Set",
- CallingConventions.HasThis |
- CallingConventions.Standard,
- TypeManager.void_type, args);
-
- ig.Emit (OpCodes.Call, set);
- }
- }
-
- public void AddressOf (EmitContext ec, AddressOp mode)
- {
- int rank = ea.Expr.Type.GetArrayRank ();
- ILGenerator ig = ec.ig;
-
- LoadArrayAndArguments (ec);
-
- if (rank == 1){
- ig.Emit (OpCodes.Ldelema, type);
- } else {
- MethodInfo address = FetchAddressMethod ();
- ig.Emit (OpCodes.Call, address);
- }
- }
- }
-
-
- class Indexers {
- public ArrayList getters, setters;
- static Hashtable map;
-
- static Indexers ()
- {
- map = new Hashtable ();
- }
-
- Indexers (MemberInfo [] mi)
- {
- foreach (PropertyInfo property in mi){
- MethodInfo get, set;
-
- get = property.GetGetMethod (true);
- if (get != null){
- if (getters == null)
- getters = new ArrayList ();
-
- getters.Add (get);
- }
-
- set = property.GetSetMethod (true);
- if (set != null){
- if (setters == null)
- setters = new ArrayList ();
- setters.Add (set);
- }
- }
- }
-
- static private Indexers GetIndexersForTypeOrInterface (Type caller_type, Type lookup_type)
- {
- Indexers ix = (Indexers) map [lookup_type];
-
- if (ix != null)
- return ix;
-
- string p_name = TypeManager.IndexerPropertyName (lookup_type);
-
- MemberInfo [] mi = TypeManager.MemberLookup (
- caller_type, lookup_type, MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance, p_name);
-
- if (mi == null || mi.Length == 0)
- return null;
-
- ix = new Indexers (mi);
- map [lookup_type] = ix;
-
- return ix;
- }
-
- static public Indexers GetIndexersForType (Type caller_type, Type lookup_type, Location loc)
- {
- Indexers ix = (Indexers) map [lookup_type];
-
- if (ix != null)
- return ix;
-
- ix = GetIndexersForTypeOrInterface (caller_type, lookup_type);
- if (ix != null)
- return ix;
-
- Type [] ifaces = TypeManager.GetInterfaces (lookup_type);
- if (ifaces != null) {
- foreach (Type itype in ifaces) {
- ix = GetIndexersForTypeOrInterface (caller_type, itype);
- if (ix != null)
- return ix;
- }
- }
-
- Report.Error (21, loc,
- "Type `" + TypeManager.CSharpName (lookup_type) +
- "' does not have any indexers defined");
- return null;
- }
- }
-
- /// <summary>
- /// Expressions that represent an indexer call.
- /// </summary>
- public class IndexerAccess : Expression, IAssignMethod {
- //
- // Points to our "data" repository
- //
- ElementAccess ea;
- MethodInfo get, set;
- Indexers ilist;
- ArrayList set_arguments;
-
- public IndexerAccess (ElementAccess ea_data)
- {
- ea = ea_data;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Type indexer_type = ea.Expr.Type;
-
- //
- // Step 1: Query for all `Item' *properties*. Notice
- // that the actual methods are pointed from here.
- //
- // This is a group of properties, piles of them.
-
- if (ilist == null)
- ilist = Indexers.GetIndexersForType (
- ec.ContainerType, indexer_type, ea.loc);
-
-
- //
- // Step 2: find the proper match
- //
- if (ilist != null && ilist.getters != null && ilist.getters.Count > 0){
- Location loc = ea.loc;
-
- get = (MethodInfo) Invocation.OverloadResolve (
- ec, new MethodGroupExpr (ilist.getters, loc), ea.Arguments, loc);
- }
-
- if (get == null){
- Report.Error (154, ea.loc,
- "indexer can not be used in this context, because " +
- "it lacks a `get' accessor");
- return null;
- }
-
- type = get.ReturnType;
- if (type.IsPointer && !ec.InUnsafe){
- UnsafeError (ea.loc);
- return null;
- }
-
- eclass = ExprClass.IndexerAccess;
- return this;
- }
-
- public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
- {
- Type indexer_type = ea.Expr.Type;
- Type right_type = right_side.Type;
-
- if (ilist == null)
- ilist = Indexers.GetIndexersForType (
- ec.ContainerType, indexer_type, ea.loc);
-
- if (ilist != null && ilist.setters != null && ilist.setters.Count > 0){
- Location loc = ea.loc;
-
- set_arguments = (ArrayList) ea.Arguments.Clone ();
- set_arguments.Add (new Argument (right_side, Argument.AType.Expression));
-
- set = (MethodInfo) Invocation.OverloadResolve (
- ec, new MethodGroupExpr (ilist.setters, loc), set_arguments, loc);
- }
-
- if (set == null){
- Report.Error (200, ea.loc,
- "indexer X.this [" + TypeManager.CSharpName (right_type) +
- "] lacks a `set' accessor");
- return null;
- }
-
- type = TypeManager.void_type;
- eclass = ExprClass.IndexerAccess;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Invocation.EmitCall (ec, false, false, ea.Expr, get, ea.Arguments, ea.loc);
- }
-
- //
- // source is ignored, because we already have a copy of it from the
- // LValue resolution and we have already constructed a pre-cached
- // version of the arguments (ea.set_arguments);
- //
- public void EmitAssign (EmitContext ec, Expression source)
- {
- Invocation.EmitCall (ec, false, false, ea.Expr, set, set_arguments, ea.loc);
- }
- }
-
- /// <summary>
- /// The base operator for method names
- /// </summary>
- public class BaseAccess : Expression {
- string member;
- Location loc;
-
- public BaseAccess (string member, Location l)
- {
- this.member = member;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Expression member_lookup;
- Type current_type = ec.ContainerType;
- Type base_type = current_type.BaseType;
- Expression e;
-
- if (ec.IsStatic){
- Report.Error (1511, loc,
- "Keyword base is not allowed in static method");
- return null;
- }
-
- member_lookup = MemberLookup (ec, base_type, member, loc);
- if (member_lookup == null)
- return null;
-
- Expression left;
-
- if (ec.IsStatic)
- left = new TypeExpr (base_type);
- else
- left = ec.This;
-
- e = MemberAccess.ResolveMemberAccess (ec, member_lookup, left, loc, null);
- if (e is PropertyExpr){
- PropertyExpr pe = (PropertyExpr) e;
-
- pe.IsBase = true;
- }
-
- return e;
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should never be called");
- }
- }
-
- /// <summary>
- /// The base indexer operator
- /// </summary>
- public class BaseIndexerAccess : Expression {
- ArrayList Arguments;
- Location loc;
-
- public BaseIndexerAccess (ArrayList args, Location l)
- {
- Arguments = args;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Type current_type = ec.ContainerType;
- Type base_type = current_type.BaseType;
- Expression member_lookup;
-
- if (ec.IsStatic){
- Report.Error (1511, loc,
- "Keyword base is not allowed in static method");
- return null;
- }
-
- member_lookup = MemberLookup (ec, base_type, "get_Item", MemberTypes.Method, AllBindingFlags, loc);
- if (member_lookup == null)
- return null;
-
- return MemberAccess.ResolveMemberAccess (ec, member_lookup, ec.This, loc, null);
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should never be called");
- }
- }
-
- /// <summary>
- /// This class exists solely to pass the Type around and to be a dummy
- /// that can be passed to the conversion functions (this is used by
- /// foreach implementation to typecast the object return value from
- /// get_Current into the proper type. All code has been generated and
- /// we only care about the side effect conversions to be performed
- ///
- /// This is also now used as a placeholder where a no-action expression
- /// is needed (the `New' class).
- /// </summary>
- public class EmptyExpression : Expression {
- public EmptyExpression ()
- {
- type = TypeManager.object_type;
- eclass = ExprClass.Value;
- }
-
- public EmptyExpression (Type t)
- {
- type = t;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- // nothing, as we only exist to not do anything.
- }
-
- //
- // This is just because we might want to reuse this bad boy
- // instead of creating gazillions of EmptyExpressions.
- // (CanConvertImplicit uses it)
- //
- public void SetType (Type t)
- {
- type = t;
- }
- }
-
- public class UserCast : Expression {
- MethodBase method;
- Expression source;
-
- public UserCast (MethodInfo method, Expression source)
- {
- this.method = method;
- this.source = source;
- type = method.ReturnType;
- eclass = ExprClass.Value;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- source.Emit (ec);
-
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
-
- }
- }
-
- // <summary>
- // This class is used to "construct" the type during a typecast
- // operation. Since the Type.GetType class in .NET can parse
- // the type specification, we just use this to construct the type
- // one bit at a time.
- // </summary>
- public class ComposedCast : Expression {
- Expression left;
- string dim;
- Location loc;
-
- public ComposedCast (Expression left, string dim, Location l)
- {
- this.left = left;
- this.dim = dim;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- left = left.Resolve (ec);
- if (left == null)
- return null;
-
- if (left.eclass != ExprClass.Type){
- report118 (loc, left, "type");
- return null;
- }
-
- type = RootContext.LookupType (
- ec.DeclSpace, left.Type.FullName + dim, false, loc);
- if (type == null)
- return null;
-
- if (!ec.InUnsafe && type.IsPointer){
- UnsafeError (loc);
- return null;
- }
-
- eclass = ExprClass.Type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("This should never be called");
- }
- }
-
- //
- // This class is used to represent the address of an array, used
- // only by the Fixed statement, this is like the C "&a [0]" construct.
- //
- public class ArrayPtr : Expression {
- Expression array;
-
- public ArrayPtr (Expression array)
- {
- Type array_type = array.Type.GetElementType ();
-
- this.array = array;
-
- string array_ptr_type_name = array_type.FullName + "*";
-
- type = Type.GetType (array_ptr_type_name);
- if (type == null){
- ModuleBuilder mb = CodeGen.ModuleBuilder;
-
- type = mb.GetType (array_ptr_type_name);
- }
-
- eclass = ExprClass.Value;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- array.Emit (ec);
- IntLiteral.EmitInt (ig, 0);
- ig.Emit (OpCodes.Ldelema, array.Type.GetElementType ());
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- //
- // We are born fully resolved
- //
- return this;
- }
- }
-
- //
- // Used by the fixed statement
- //
- public class StringPtr : Expression {
- LocalBuilder b;
-
- public StringPtr (LocalBuilder b)
- {
- this.b = b;
- eclass = ExprClass.Value;
- type = TypeManager.char_ptr_type;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- // This should never be invoked, we are born in fully
- // initialized state.
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- ig.Emit (OpCodes.Ldloc, b);
- ig.Emit (OpCodes.Conv_I);
- ig.Emit (OpCodes.Call, TypeManager.int_get_offset_to_string_data);
- ig.Emit (OpCodes.Add);
- }
- }
-
- //
- // Implements the `stackalloc' keyword
- //
- public class StackAlloc : Expression {
- Type otype;
- string t;
- Expression count;
- Location loc;
-
- public StackAlloc (string type, Expression count, Location l)
- {
- t = type;
- this.count = count;
- loc = l;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- count = count.Resolve (ec);
- if (count == null)
- return null;
-
- if (count.Type != TypeManager.int32_type){
- count = ConvertImplicitRequired (ec, count, TypeManager.int32_type, loc);
- if (count == null)
- return null;
- }
-
- if (ec.InCatch || ec.InFinally){
- Report.Error (255, loc,
- "stackalloc can not be used in a catch or finally block");
- return null;
- }
-
- otype = RootContext.LookupType (ec.DeclSpace, t, false, loc);
-
- if (otype == null)
- return null;
-
- if (!TypeManager.VerifyUnManaged (otype, loc))
- return null;
-
- string ptr_name = otype.FullName + "*";
- type = Type.GetType (ptr_name);
- if (type == null){
- ModuleBuilder mb = CodeGen.ModuleBuilder;
-
- type = mb.GetType (ptr_name);
- }
- eclass = ExprClass.Value;
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- int size = GetTypeSize (otype);
- ILGenerator ig = ec.ig;
-
- if (size == 0)
- ig.Emit (OpCodes.Sizeof, otype);
- else
- IntConstant.EmitInt (ig, size);
- count.Emit (ec);
- ig.Emit (OpCodes.Mul);
- ig.Emit (OpCodes.Localloc);
- }
- }
-}
diff --git a/mcs/mbas/genericparser.cs b/mcs/mbas/genericparser.cs
deleted file mode 100644
index f31f0be075c..00000000000
--- a/mcs/mbas/genericparser.cs
+++ /dev/null
@@ -1,336 +0,0 @@
-//
-// GenericParser.cs: The Base Parser for the Mono compilers
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 Ximian, Inc.
-//
-
-namespace Mono.Languages
-{
- using System;
- using System.Reflection;
- using System.Collections;
- using System.IO;
- using Mono.CSharp;
-
- /// <summary>
- /// Base class to support multiple Jay generated parsers
- /// </summary>
- public abstract class GenericParser
- {
- // ---------------------------------------------------
- // Class state
-
- // Count of errors found while parsing
- static protected int global_errors;
-
- // Maps extensions to specific parsers
- static private Hashtable mapOfParsers;
-
- // Indicates if parsing should be verbose
- static public bool yacc_verbose_flag = false;
-
- // Context to use
- static public ArrayList defines;
-
- // ---------------------------------------------------
- // Instance state
-
- // Name of the file we are parsing
- protected string name;
-
- // Input stream to parse from.
- protected System.IO.TextReader input;
-
- // Current namespace definition
- protected Namespace current_namespace;
-
- // Current typecontainer definition
- protected TypeContainer current_container;
-
- // ---------------------------------------------------
- // What the descendants MUST reimplement
-
- /// <summary>
- /// Parses the current "input"
- /// </summary>
- public abstract int parse();
-
- /// <summary>
- /// Lists the extensions this parser can handle
- /// </summary>
- public abstract string[] extensions();
- /* {
- string [] list = { ".cs" };
- return list;
- } */
-
- // ---------------------------------------------------
- // What the descendants DONT HAVE to reimplement
-
- /// <summary>
- /// Initializes this parser from a file and parses it
- /// </summary>
- /// <param name="fileName">Name of the file to be parsed</param>
- /// <param name="context">Context to output the parsed tree</param>
- public int ParseFile(string fileName)
- {
- // file exceptions must be caught by caller
-
- global_errors = 0;
- name = fileName;
- // TODO: Encoding switching as needed
- // We are here forcing StreamReader to assume current system codepage,
- // because normally it defaults to UTF-8
- input = new StreamReader(fileName, System.Text.Encoding.Default);
- //rc = context;
- return parse();
- }
-
- /// <summary>
- /// Initializes this parser from a string and parses it
- /// </summary>
- /// <param name="source">String to be parsed</param>
- /// <param name="sourceName">Name of the source to be parsed (just for error reporting)</param>
- /// <param name="context">Context to output the parsed tree</param>
- public int ParseString(string source, string sourceName)
- {
- global_errors = 0;
- name = sourceName;
- input = new StringReader(source);
- //rc = context;
- return parse();
- }
-
- // ---------------------------------------------------
- // Class methods
-
- static private void MapParsers()
- {
-
- mapOfParsers = new Hashtable();
-
- Assembly thisAssembly = Assembly.GetExecutingAssembly();
- foreach(Type type in thisAssembly.GetTypes())
- {
- if (type.BaseType != null)
- if (type.BaseType.FullName == "Mono.Languages.GenericParser")
- {
- GenericParser parser = (GenericParser)Activator.CreateInstance(type);
- foreach(string fileExtension in parser.extensions())
- {
- string theFileExtension = fileExtension.ToLower();
- if (mapOfParsers.Contains(theFileExtension))
- Console.WriteLine("[TRACE] " + type.FullName + " can't try to parse '" + theFileExtension + "' files too");
- else
- mapOfParsers.Add(theFileExtension, parser);
- }
- }
- }
- }
-
- /// <summary>
- /// Find the descendant parser that knows how to parse the specified file
- /// based on the files extension
- /// </summary>
- /// <param name="fileName">Name of the file to be parsed</param>
- public static GenericParser GetSpecificParserFor(string fileName)
- {
- int i;
- string fileExtension;
-
- if (mapOfParsers == null)
- MapParsers();
-
- if ((i = fileName.LastIndexOf(".")) < 0)
- return null;
- else
- fileExtension = fileName.Substring(i).ToLower();
-
- return (GenericParser)mapOfParsers[fileExtension];
- }
-
-
- public static int Tokenize(string fileName)
- {
- GenericParser parser = GetSpecificParserFor(fileName);
-
- if (parser == null)
- {
- Console.WriteLine("Do not know how to compile " + fileName);
- return 1;
- }
-
-/* Stream input;
-
- try {
- input = File.OpenRead (input_file);
-
- } catch {
- Report.Error (2001, "Source file '" + input_file + "' could not be opened");
- return 1;
- }
-
- using (input){
- Tokenizer lexer = new Tokenizer (input, input_file, defines);
- int token, tokens = 0, errors = 0;
-
- while ((token = lexer.token ()) != Token.EOF){
- Location l = lexer.Location;
- tokens++;
- if (token == Token.ERROR)
- errors++;
- }
- Console.WriteLine ("Tokenized: " + tokens + " found " + errors + " errors");
- }
-*/
- return 0;
- }
-
-
- /// <summary>
- /// Find the descendant parser that knows how to parse the specified file
- /// based on the files extension, and parses it using the chosen parser
- /// </summary>
- /// <param name="fileName">Name of the file to be parsed</param>
- /// <param name="context">Context to output the parsed tree</param>
- public static int Parse(string fileName)
- {
- int errors;
- GenericParser parser = GetSpecificParserFor(fileName);
-
- if (parser == null)
- {
- Console.WriteLine("Do not know how to compile " + fileName);
- return 1;
- }
-
- try
- {
- errors = parser.ParseFile(fileName);
- }
- catch (FileNotFoundException ex)
- {
- error(2001, "Source file \'" + fileName + "\' could not be found!!!");
- Console.WriteLine (ex);
- return 1;
- }
- catch (Exception ex)
- {
- Console.WriteLine (ex);
- Console.WriteLine ("Compilation aborted");
- return 1;
- }
-
- return errors;
- }
-
- // <summary>
- // Given the @class_name name, it creates a fully qualified name
- // based on the containing declaration space
- // </summary>
- protected string MakeName(string class_name)
- {
- string ns = current_namespace.Name;
- string container_name = current_container.Name;
-
- if (container_name == "")
- {
- if (ns != "")
- return ns + "." + class_name;
- else
- return class_name;
- }
- else
- return container_name + "." + class_name;
- }
-
- // <summary>
- // Used to report back to the user the result of a declaration
- // in the current declaration space
- // </summary>
- protected void CheckDef (AdditionResult result, string name, Location l)
- {
- if (result == AdditionResult.Success)
- return;
-
- switch (result)
- {
- case AdditionResult.NameExists:
- Report.Error (102, l, "The container '" + current_container.Name +
- "' already contains a definition for '"+
- name + "'");
- break;
-
-
- //
- // This is handled only for static Constructors, because
- // in reality we handle these by the semantic analysis later
- //
- case AdditionResult.MethodExists:
- Report.Error (
- 111, l, "Class `"+current_container.Name+
- "' already defines a member called '" +
- name + "' with the same parameter types (more than one default constructor)");
- break;
-
- case AdditionResult.EnclosingClash:
- Report.Error (542, l, "Member names cannot be the same as their enclosing type");
- break;
-
- case AdditionResult.NotAConstructor:
- Report.Error (1520, l, "Class, struct, or interface method must have a return type");
- break;
- }
- }
-
- // <summary>
- // Used to report back to the user the result of a declaration
- // in the current declaration space
- // </summary>
- protected void CheckDef (bool result, string name, Location l)
- {
- if (result)
- return;
- CheckDef (AdditionResult.NameExists, name, l);
- }
-
-
- /// <summary>
- /// Emits error messages and increments a global count of them
- /// </summary>
- /// <param name="code"></param>
- /// <param name="desc"></param>
- static public void error (int code, string desc)
- {
- Console.WriteLine ("error MC"+code+": "+ desc);
- global_errors++;
- }
-
- // Emits error messages with location info.
- // FIXME : Ideally, all error reporting should happen
- // with Report.Error but how do you get at that non-static
- // method everywhere you need it ?
- static public void error (int code, Mono.CSharp.Location l, string text)
- {
- Console.WriteLine (l.Name + "(" + l.Row + ",?" + /*l.Col +*/
- "): error MC" + code + ": " + text);
- global_errors++;
- }
-
- // ---------------------------------------------------
- // Constructors
-
- public GenericParser()
- {
- // DO NOTHING
- }
-
- }
-}
-
-
-
diff --git a/mcs/mbas/interface.cs b/mcs/mbas/interface.cs
deleted file mode 100644
index 873e6af9d73..00000000000
--- a/mcs/mbas/interface.cs
+++ /dev/null
@@ -1,852 +0,0 @@
-//
-// interface.cs: Interface handler
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-using System.Collections;
-using System;
-using System.IO;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Interfaces
- /// </summary>
- public class Interface : DeclSpace {
- const MethodAttributes interface_method_attributes =
- MethodAttributes.Public |
- MethodAttributes.Abstract |
- MethodAttributes.HideBySig |
- MethodAttributes.NewSlot |
- MethodAttributes.Virtual;
-
- const MethodAttributes property_attributes =
- MethodAttributes.Public |
- MethodAttributes.Abstract |
- MethodAttributes.HideBySig |
- MethodAttributes.NewSlot |
- MethodAttributes.SpecialName |
- MethodAttributes.Virtual;
-
- ArrayList bases;
-
- ArrayList defined_method;
- ArrayList defined_indexer;
- ArrayList defined_events;
- ArrayList defined_properties;
-
- ArrayList method_builders;
- ArrayList property_builders;
-
- Attributes OptAttributes;
-
- // These will happen after the semantic analysis
-
- // Hashtable defined_indexers;
- // Hashtable defined_methods;
-
- /// <summary>
- /// Modifiers allowed in a class declaration
- /// </summary>
- public const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- public Interface (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
- {
- ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
- OptAttributes = attrs;
-
- method_builders = new ArrayList ();
- property_builders = new ArrayList ();
- }
-
- public AdditionResult AddMethod (InterfaceMethod imethod)
- {
- string name = imethod.Name;
- Object value = defined_names [name];
-
- if (value != null){
- if (!(value is InterfaceMethod))
- return AdditionResult.NameExists;
- }
-
- if (defined_method == null)
- defined_method = new ArrayList ();
-
- defined_method.Add (imethod);
- if (value == null)
- DefineName (name, imethod);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddProperty (InterfaceProperty iprop)
- {
- AdditionResult res;
- string name = iprop.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, iprop);
-
- if (defined_properties == null)
- defined_properties = new ArrayList ();
-
- defined_properties.Add (iprop);
- return AdditionResult.Success;
- }
-
- public AdditionResult AddEvent (InterfaceEvent ievent)
- {
- string name = ievent.Name;
- AdditionResult res;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, ievent);
-
- if (defined_events == null)
- defined_events = new ArrayList ();
-
- defined_events.Add (ievent);
- return AdditionResult.Success;
- }
-
- public bool AddIndexer (InterfaceIndexer iindexer)
- {
- if (defined_indexer == null)
- defined_indexer = new ArrayList ();
-
- defined_indexer.Add (iindexer);
- return true;
- }
-
- public ArrayList InterfaceMethods {
- get {
- return defined_method;
- }
- }
-
- public ArrayList InterfaceProperties {
- get {
- return defined_properties;
- }
- }
-
- public ArrayList InterfaceEvents {
- get {
- return defined_events;
- }
- }
-
- public ArrayList InterfaceIndexers {
- get {
- return defined_indexer;
- }
- }
-
- public ArrayList Bases {
- get {
- return bases;
- }
-
- set {
- bases = value;
- }
- }
-
- public virtual TypeAttributes InterfaceAttr {
- get {
- TypeAttributes x = TypeAttributes.Interface | TypeAttributes.Abstract;
-
- if (IsTopLevel == false) {
-
- if ((ModFlags & Modifiers.PROTECTED) != 0
- && (ModFlags & Modifiers.INTERNAL) != 0)
- x |= TypeAttributes.NestedFamORAssem;
- else if ((ModFlags & Modifiers.PROTECTED) != 0)
- x |= TypeAttributes.NestedFamily;
- else if ((ModFlags & Modifiers.INTERNAL) != 0)
- x |= TypeAttributes.NestedAssembly;
- else if ((ModFlags & Modifiers.PUBLIC) != 0)
- x |= TypeAttributes.NestedPublic;
- else
- x |= TypeAttributes.NestedPrivate;
- } else {
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- x |= TypeAttributes.Public;
- else if ((ModFlags & Modifiers.PRIVATE) != 0)
- x |= TypeAttributes.NotPublic;
- }
-
- if ((ModFlags & Modifiers.ABSTRACT) != 0)
- x |= TypeAttributes.Abstract;
-
- if ((ModFlags & Modifiers.SEALED) != 0)
- x |= TypeAttributes.Sealed;
-
- return x;
- }
- }
-
- void Error111 (InterfaceMemberBase ib)
- {
- Report.Error (
- 111,
- "Interface `" + Name + "' already contains a definition with the " +
- "same return value and parameter types for member `" + ib.Name + "'");
- }
-
- bool RegisterMethod (MethodBase mb, InternalParameters ip, Type [] types)
- {
- if (!TypeManager.RegisterMethod (mb, ip, types))
- return false;
-
- method_builders.Add (mb);
- return true;
- }
-
- public MethodInfo [] GetMethods ()
- {
- int n = method_builders.Count;
- MethodInfo [] mi = new MethodInfo [n];
-
- method_builders.CopyTo (mi, 0);
-
- return mi;
- }
-
- // Hack around System.Reflection as found everywhere else
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf, MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if ((mt & MemberTypes.Method) != 0) {
- foreach (MethodBuilder mb in method_builders)
- if (filter (mb, criteria))
- members.Add (mb);
- }
-
- if ((mt & MemberTypes.Property) != 0) {
- foreach (PropertyBuilder pb in property_builders)
- if (filter (pb, criteria))
- members.Add (pb);
- }
-
- if (((bf & BindingFlags.DeclaredOnly) == 0) && (TypeBuilder.BaseType != null)) {
- MemberInfo [] parent_mi;
-
- parent_mi = TypeContainer.FindMembers (
- TypeBuilder.BaseType, mt, bf, filter, criteria);
-
- if (parent_mi != null)
- members.AddRange (parent_mi);
- }
-
- // The rest of the cases, if any, are unhandled at present.
-
- int count = members.Count;
-
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
- }
-
- return null;
- }
-
- //
- // Populates the methods in the interface
- //
- void PopulateMethod (TypeContainer parent, DeclSpace decl_space, InterfaceMethod im)
- {
- Type return_type = RootContext.LookupType (this, im.ReturnType, false, im.Location);
- Type [] arg_types = im.ParameterTypes (this);
- MethodBuilder mb;
- Parameter [] p;
- int i;
-
- if (return_type == null)
- return;
-
- if (return_type.IsPointer && !UnsafeOK (this))
- return;
-
- foreach (Type t in arg_types){
-
- if (t == null)
- return;
-
- if (t.IsPointer && !UnsafeOK (this))
- return;
- }
-
- //
- // Create the method
- //
- mb = TypeBuilder.DefineMethod (
- im.Name, interface_method_attributes,
- return_type, arg_types);
-
- InternalParameters ip = new InternalParameters (arg_types, im.Parameters);
-
- if (!RegisterMethod (mb, ip, arg_types)) {
- Error111 (im);
- return;
- }
-
- //
- // Define each type attribute (in/out/ref) and
- // the argument names.
- //
- p = im.Parameters.FixedParameters;
- if (p != null){
- for (i = 0; i < p.Length; i++)
- mb.DefineParameter (i + 1, p [i].Attributes, p [i].Name);
-
- if (i != arg_types.Length)
- Console.WriteLine ("Implement the type definition for params");
- }
-
- EmitContext ec = new EmitContext (parent, decl_space, Location, null,
- return_type, ModFlags, false);
-
- if (im.OptAttributes != null)
- Attribute.ApplyAttributes (ec, mb, im, im.OptAttributes, Location);
- }
-
- //
- // Populates the properties in the interface
- //
- void PopulateProperty (TypeContainer parent, DeclSpace decl_space, InterfaceProperty ip)
- {
- PropertyBuilder pb;
- MethodBuilder get = null, set = null;
- Type prop_type = RootContext.LookupType (this, ip.Type, false, ip.Location);
- Type [] setter_args = new Type [1];
-
- if (prop_type == null)
- return;
-
- if (prop_type.IsPointer && !UnsafeOK (this))
- return;
-
- setter_args [0] = prop_type;
-
- //
- // FIXME: properties are missing the following
- // flags: hidebysig newslot specialname
- //
- pb = TypeBuilder.DefineProperty (
- ip.Name, PropertyAttributes.None,
- prop_type, null);
-
- if (ip.HasGet){
- get = TypeBuilder.DefineMethod (
- "get_" + ip.Name, property_attributes ,
- prop_type, null);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Type [] null_types = null;
- InternalParameters inp = new InternalParameters
- (null_types, Parameters.GetEmptyReadOnlyParameters ());
-
- if (!RegisterMethod (get, inp, null)) {
- Error111 (ip);
- return;
- }
-
- pb.SetGetMethod (get);
- }
-
- if (ip.HasSet){
- setter_args [0] = prop_type;
-
- set = TypeBuilder.DefineMethod (
- "set_" + ip.Name, property_attributes,
- TypeManager.void_type, setter_args);
-
- set.DefineParameter (1, ParameterAttributes.None, "value");
- pb.SetSetMethod (set);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (ip.Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ipp = new InternalParameters (
- this, new Parameters (parms, null, Location.Null));
-
- if (!RegisterMethod (set, ipp, setter_args)) {
- Error111 (ip);
- return;
- }
- }
-
- EmitContext ec = new EmitContext (parent, decl_space, Location, null,
- null, ModFlags, false);
-
- if (ip.OptAttributes != null)
- Attribute.ApplyAttributes (ec, pb, ip, ip.OptAttributes, Location);
-
- TypeManager.RegisterProperty (pb, get, set);
- property_builders.Add (pb);
- }
-
- //
- // Populates the events in the interface
- //
- void PopulateEvent (TypeContainer parent, DeclSpace decl_space, InterfaceEvent ie)
- {
- //
- // FIXME: We need to do this after delegates have been
- // declared or we declare them recursively.
- //
- }
-
- //
- // Populates the indexers in the interface
- //
- void PopulateIndexer (TypeContainer parent, DeclSpace decl_space, InterfaceIndexer ii)
- {
- PropertyBuilder pb;
- Type prop_type = RootContext.LookupType (this, ii.Type, false, ii.Location);
- Type [] arg_types = ii.ParameterTypes (this);
- Type [] value_arg_types;
-
- if (prop_type == null)
- return;
-
- if (prop_type.IsPointer && !UnsafeOK (this))
- return;
-
- //
- // Sets up the extra invisible `value' argument for setters.
- //
- if (arg_types != null){
- int count = arg_types.Length;
- value_arg_types = new Type [count + 1];
-
- arg_types.CopyTo (value_arg_types, 0);
- value_arg_types [count] = prop_type;
-
- foreach (Type t in arg_types){
- if (t.IsPointer && !UnsafeOK (this))
- return;
- }
- } else {
- value_arg_types = new Type [1];
-
- value_arg_types [1] = prop_type;
- }
-
- pb = TypeBuilder.DefineProperty (
- "Item", PropertyAttributes.None,
- prop_type, arg_types);
-
- MethodBuilder set_item = null, get_item = null;
- if (ii.HasGet){
- Parameter [] p = ii.Parameters.FixedParameters;
-
- get_item = TypeBuilder.DefineMethod (
- "get_Item", property_attributes, prop_type, arg_types);
- pb.SetGetMethod (get_item);
- //
- // HACK because System.Reflection.Emit is lame
- //
- InternalParameters ip = new InternalParameters (
- arg_types, ii.Parameters);
-
- if (!RegisterMethod (get_item, ip, arg_types)) {
- Error111 (ii);
- return;
- }
-
- if (p != null){
- for (int i = 0; i < p.Length; i++)
- get_item.DefineParameter (
- i + 1,
- p [i].Attributes, p [i].Name);
- }
- }
-
- if (ii.HasSet){
- Parameter [] p = ii.Parameters.FixedParameters;
- Parameter [] pv;
- int i = 0;
-
- pv = new Parameter [p.Length + 1];
- p.CopyTo (pv, 0);
- pv [p.Length] = new Parameter (ii.Type, "value", Parameter.Modifier.NONE, null);
- Parameters value_params = new Parameters (pv, null, Location.Null);
- value_params.GetParameterInfo (decl_space);
-
- set_item = TypeBuilder.DefineMethod (
- "set_Item", property_attributes,
- TypeManager.void_type, value_arg_types);
- pb.SetSetMethod (set_item);
- //
- // HACK because System.Reflection.Emit is lame
- //
- InternalParameters ip = new InternalParameters (
- value_arg_types, value_params);
- if (!RegisterMethod (set_item, ip, value_arg_types)) {
- Error111 (ii);
- return;
- }
-
- if (p != null){
- for (; i < p.Length; i++)
- set_item.DefineParameter (
- i + 1,
- p [i].Attributes, p [i].Name);
- }
-
- set_item.DefineParameter (i + 1, ParameterAttributes.None, "value");
- }
-
- EmitContext ec = new EmitContext (parent, decl_space, Location, null,
- null, ModFlags, false);
-
- if (ii.OptAttributes != null)
- Attribute.ApplyAttributes (ec, pb, ii, ii.OptAttributes, Location);
-
- property_builders.Add (pb);
- }
-
- /// <summary>
- /// Performs the semantic analysis for all the interface members
- /// that were declared
- /// </summary>
- bool SemanticAnalysis ()
- {
- Hashtable methods = new Hashtable ();
-
-
- if (defined_method != null){
- foreach (InterfaceMethod im in defined_method){
- string sig = im.GetSignature (this);
-
- //
- // If there was an undefined Type on the signatures
- //
- if (sig == null)
- continue;
-
- if (methods [sig] != null){
- Error111 (im);
- return false;
- }
- }
- }
-
- //
- // FIXME: Here I should check i
- //
- return true;
- }
-
- Type GetInterfaceTypeByName (string name)
- {
- Type t = FindType (name);
-
- if (t == null)
- return null;
-
- if (t.IsInterface)
- return t;
-
- string cause;
-
- if (t.IsValueType)
- cause = "is a struct";
- else if (t.IsClass)
- cause = "is a class";
- else
- cause = "Should not happen.";
-
- Report.Error (527, Location, "`"+name+"' " + cause +
- ", need an interface instead");
-
- return null;
- }
-
- //
- // Returns the list of interfaces that this interface implements
- // Or null if it does not implement any interface.
- //
- // Sets the error boolean accoringly.
- //
- Type [] GetInterfaceBases (out bool error)
- {
- Type [] tbases;
- int i;
-
- error = false;
- if (Bases == null)
- return null;
-
- tbases = new Type [Bases.Count];
- i = 0;
-
- foreach (string name in Bases){
- Type t;
-
- t = GetInterfaceTypeByName (name);
- if (t == null){
- error = true;
- return null;
- }
-
- tbases [i++] = t;
- }
-
- return TypeManager.ExpandInterfaces (tbases);
- }
-
- //
- // <summary>
- // Defines the Interface in the appropriate ModuleBuilder or TypeBuilder
- // </summary>
- //
- // TODO:
- // Rework the way we recurse, because for recursive
- // definitions of interfaces (A:B and B:A) we report the
- // error twice, rather than once.
-
- public override TypeBuilder DefineType ()
- {
- Type [] ifaces;
- bool error;
-
- if (TypeBuilder != null)
- return TypeBuilder;
-
- if (InTransit)
- return null;
-
- InTransit = true;
-
- ifaces = GetInterfaceBases (out error);
-
- if (error)
- return null;
-
- if (IsTopLevel) {
- ModuleBuilder builder = CodeGen.ModuleBuilder;
-
- TypeBuilder = builder.DefineType (
- Name,
- InterfaceAttr,
- (Type)null, // Parent Type
- ifaces);
- RootContext.RegisterOrder (this);
- } else {
- TypeBuilder builder = Parent.TypeBuilder;
-
- TypeBuilder = builder.DefineNestedType (
- Basename,
- InterfaceAttr,
- (Type) null, //parent type
- ifaces);
-
- TypeContainer tc = TypeManager.LookupTypeContainer (builder);
- tc.RegisterOrder (this);
- }
-
- TypeManager.AddUserInterface (Name, TypeBuilder, this, ifaces);
- InTransit = false;
-
- return TypeBuilder;
- }
-
- /// <summary>
- /// Performs semantic analysis, and then generates the IL interfaces
- /// </summary>
- public override bool Define (TypeContainer parent)
- {
- if (!SemanticAnalysis ())
- return false;
-
- if (defined_method != null){
- foreach (InterfaceMethod im in defined_method)
- PopulateMethod (parent, this, im);
- }
-
- if (defined_properties != null){
- foreach (InterfaceProperty ip in defined_properties)
- PopulateProperty (parent, this, ip);
- }
-
- if (defined_events != null)
- foreach (InterfaceEvent ie in defined_events)
- PopulateEvent (parent, this, ie);
-
- //
- // FIXME: Pull the right indexer name out of the `IndexerName' attribute
- //
- if (defined_indexer != null) {
- foreach (InterfaceIndexer ii in defined_indexer)
- PopulateIndexer (parent, this, ii);
-
- CustomAttributeBuilder cb = EmitDefaultMemberAttr (
- parent, "Item", ModFlags, Location);
- if (cb != null)
- TypeBuilder.SetCustomAttribute (cb);
- }
-
- return true;
- }
-
- public static CustomAttributeBuilder EmitDefaultMemberAttr (TypeContainer parent,
- string name,
- int flags,
- Location loc)
- {
- EmitContext ec = new EmitContext (parent, loc, null, null, flags);
-
- Expression ml = Expression.MemberLookup (ec, TypeManager.default_member_type,
- ".ctor", MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance,
- Location.Null);
-
- if (!(ml is MethodGroupExpr)) {
- Console.WriteLine ("Internal error !!!!");
- return null;
- }
-
- MethodGroupExpr mg = (MethodGroupExpr) ml;
-
- MethodBase constructor = mg.Methods [0];
-
- string [] vals = { name };
-
- CustomAttributeBuilder cb = null;
- try {
- cb = new CustomAttributeBuilder ((ConstructorInfo) constructor, vals);
- } catch {
- Report.Warning (-100, "Can not set the indexer default member attribute");
- }
-
- return cb;
- }
-
- }
-
- public class InterfaceMemberBase {
- public readonly string Name;
- public readonly bool IsNew;
- public Attributes OptAttributes;
-
- public InterfaceMemberBase (string name, bool is_new, Attributes attrs)
- {
- Name = name;
- IsNew = is_new;
- OptAttributes = attrs;
- }
- }
-
- public class InterfaceProperty : InterfaceMemberBase {
- public readonly bool HasSet;
- public readonly bool HasGet;
- public readonly string Type;
- public readonly string type;
- public readonly Location Location;
-
- public InterfaceProperty (string type, string name,
- bool is_new, bool has_get, bool has_set,
- Attributes attrs, Location loc)
- : base (name, is_new, attrs)
- {
- Type = type;
- HasGet = has_get;
- HasSet = has_set;
- Location = loc;
- }
- }
-
- public class InterfaceEvent : InterfaceMemberBase {
- public readonly string Type;
-
- public InterfaceEvent (string type, string name, bool is_new, Attributes attrs)
- : base (name, is_new, attrs)
- {
- Type = type;
- }
- }
-
- public class InterfaceMethod : InterfaceMemberBase {
- public readonly string ReturnType;
- public readonly Parameters Parameters;
- public readonly Location Location;
-
- public InterfaceMethod (string return_type, string name, bool is_new, Parameters args,
- Attributes attrs, Location l)
- : base (name, is_new, attrs)
- {
- this.ReturnType = return_type;
- this.Parameters = args;
- Location = l;
- }
-
- /// <summary>
- /// Returns the signature for this interface method
- /// </summary>
- public string GetSignature (DeclSpace ds)
- {
- Type ret = RootContext.LookupType (ds, ReturnType, false, Location);
- string args = Parameters.GetSignature (ds);
-
- if ((ret == null) || (args == null))
- return null;
-
- return (IsNew ? "new-" : "") + ret.FullName + "(" + args + ")";
- }
-
- public Type [] ParameterTypes (DeclSpace ds)
- {
- return Parameters.GetParameterInfo (ds);
- }
- }
-
- public class InterfaceIndexer : InterfaceMemberBase {
- public readonly bool HasGet, HasSet;
- public readonly Parameters Parameters;
- public readonly string Type;
- public readonly Location Location;
-
- public InterfaceIndexer (string type, Parameters args, bool do_get, bool do_set,
- bool is_new, Attributes attrs, Location loc)
- : base ("", is_new, attrs)
- {
- Type = type;
- Parameters = args;
- HasGet = do_get;
- HasSet = do_set;
- Location = loc;
- }
-
- public Type [] ParameterTypes (DeclSpace ds)
- {
- return Parameters.GetParameterInfo (ds);
- }
- }
-}
diff --git a/mcs/mbas/literal.cs b/mcs/mbas/literal.cs
deleted file mode 100644
index a307030db6a..00000000000
--- a/mcs/mbas/literal.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// literal.cs: Literal representation for the IL tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-//
-// Notice that during parsing we create objects of type Literal, but the
-// types are not loaded (thats why the Resolve method has to assign the
-// type at that point).
-//
-// Literals differ from the constants in that we know we encountered them
-// as a literal in the source code (and some extra rules apply there) and
-// they have to be resolved (since during parsing we have not loaded the
-// types yet) while constants are created only after types have been loaded
-// and are fully resolved when born.
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- public class NullLiteral : Constant {
- public static readonly NullLiteral Null;
-
- static NullLiteral ()
- {
- Null = new NullLiteral ();
- }
-
- public NullLiteral ()
- {
- if (Null != null)
- throw new Exception ("More than one null has been created!");
- eclass = ExprClass.Value;
- }
-
- override public string AsString ()
- {
- return "null";
- }
-
- public override object GetValue ()
- {
- return null;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.object_type;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- ec.ig.Emit (OpCodes.Ldnull);
- }
- }
-
- public class BoolLiteral : BoolConstant {
- public BoolLiteral (bool val) : base (val)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.bool_type;
- return this;
- }
- }
-
- public class CharLiteral : CharConstant {
- public CharLiteral (char c) : base (c)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.char_type;
- return this;
- }
- }
-
- public class IntLiteral : IntConstant {
- public IntLiteral (int l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.int32_type;
- return this;
- }
- }
-
- public class UIntLiteral : UIntConstant {
- public UIntLiteral (uint l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.uint32_type;
- return this;
- }
- }
-
- public class LongLiteral : LongConstant {
- public LongLiteral (long l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.int64_type;
-
- return this;
- }
- }
-
- public class ULongLiteral : ULongConstant {
- public ULongLiteral (ulong l) : base (l)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.uint64_type;
- return this;
- }
- }
-
- public class FloatLiteral : FloatConstant {
-
- public FloatLiteral (float f) : base (f)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.float_type;
- return this;
- }
- }
-
- public class DoubleLiteral : DoubleConstant {
- public DoubleLiteral (double d) : base (d)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.double_type;
-
- return this;
- }
- }
-
- public class DecimalLiteral : DecimalConstant {
- public DecimalLiteral (decimal d) : base (d)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.decimal_type;
- return this;
- }
- }
-
- public class StringLiteral : StringConstant {
- public StringLiteral (string s) : base (s)
- {
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- type = TypeManager.string_type;
-
- return this;
- }
- }
-}
diff --git a/mcs/mbas/location.cs b/mcs/mbas/location.cs
deleted file mode 100644
index 1b32f32de6e..00000000000
--- a/mcs/mbas/location.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-//
-// location.cs: Keeps track of the location of source code entity
-//
-// Author:
-// Miguel de Icaza
-//
-// (C) 2001 Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Diagnostics.SymbolStore;
-
-namespace Mono.CSharp {
- /// <summary>
- /// Keeps track of the location in the program
- /// </summary>
- ///
- /// <remarks>
- /// This uses a compact representation and a couple of auxiliary
- /// structures to keep track of tokens to (file,line) mappings.
- ///
- /// We could probably also keep track of columns by storing those
- /// in 8 bits (and say, map anything after char 255 to be `255+').
- /// </remarks>
- public struct Location {
- public int token;
-
- static Hashtable map;
- static Hashtable sym_docs;
- static ArrayList list;
- static int global_count;
- static int module_base;
-
- public readonly static Location Null;
-
- static Location ()
- {
- map = new Hashtable ();
- list = new ArrayList ();
- sym_docs = new Hashtable ();
- global_count = 0;
- module_base = 0;
- Null.token = -1;
- }
-
- static public void Push (string name)
- {
- map.Remove (global_count);
- map.Add (global_count, name);
- list.Add (global_count);
- module_base = global_count;
- }
-
- public Location (int row)
- {
- if (row < 0)
- token = -1;
- else {
- token = module_base + row;
- if (global_count < token)
- global_count = token;
- }
- }
-
- public override string ToString ()
- {
- return Name + ": (" + Row + ")";
- }
-
- /// <summary>
- /// Whether the Location is Null
- /// </summary>
- static public bool IsNull (Location l)
- {
- return l.token == -1;
- }
-
- public string Name {
- get {
- int best = 0;
-
- if (token < 0)
- return "Internal";
-
- foreach (int b in list){
- if (token > b)
- best = b;
- }
- return (string) map [best];
- }
- }
-
- public int Row {
- get {
- int best = 0;
-
- if (token < 0)
- return 1;
-
- foreach (int b in list){
- if (token > b)
- best = b;
- }
- return token - best;
- }
- }
-
- // The ISymbolDocumentWriter interface is used by the symbol writer to
- // describe a single source file - for each source file there's exactly
- // one corresponding ISymbolDocumentWriter instance.
- //
- // This class has an internal hash table mapping source document names
- // to such ISymbolDocumentWriter instances - so there's exactly one
- // instance per document.
- //
- // This property returns the ISymbolDocumentWriter instance which belongs
- // to the location's source file.
- //
- // If we don't have a symbol writer, this property is always null.
- public ISymbolDocumentWriter SymbolDocument {
- get {
- ISymbolWriter sw = CodeGen.SymbolWriter;
- ISymbolDocumentWriter doc;
-
- if (token < 0)
- return null;
-
- // If we don't have a symbol writer, return null.
- if (sw == null)
- return null;
-
- if (sym_docs.Contains (Name))
- // If we already created an ISymbolDocumentWriter
- // instance for this document, return it.
- doc = (ISymbolDocumentWriter) sym_docs [Name];
- else {
- // Create a new ISymbolDocumentWriter instance and
- // store it in the hash table.
- doc = sw.DefineDocument (Name, SymLanguageType.CSharp,
- SymLanguageVendor.Microsoft,
- SymDocumentType.Text);
-
- sym_docs.Add (Name, doc);
- }
-
- return doc;
- }
- }
- }
-}
diff --git a/mcs/mbas/makefile b/mcs/mbas/makefile
deleted file mode 100644
index 704d53535b8..00000000000
--- a/mcs/mbas/makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-CSC=csc.exe
-CSCFLAGS=/nologo /debug+ /debug:full /optimize /target:exe /r:System.dll /r:Mono.GetOptions.dll /out:mbas.exe
-
-VERSION=0.13
-
-COMPILER_SOURCES = \
- AssemblyInfo.cs \
- assign.cs \
- attribute.cs \
- cfold.cs \
- class.cs \
- codegen.cs \
- const.cs \
- constant.cs \
- decl.cs \
- delegate.cs \
- driver.cs \
- enum.cs \
- ecore.cs \
- expression.cs \
- genericparser.cs \
- interface.cs \
- literal.cs \
- location.cs \
- mb-parser.cs \
- mb-tokenizer.cs \
- modifiers.cs \
- module.cs \
- namespace.cs \
- parameter.cs \
- pending.cs \
- report.cs \
- rootcontext.cs \
- statement.cs \
- statementCollection.cs \
- support.cs \
- tree.cs \
- typemanager.cs
-
-all: mbas.exe
-
-parser: mb-parser.cs
-
-mbas.exe: $(COMPILER_SOURCES)
- $(CSC) $(CSCFLAGS) $(COMPILER_SOURCES)
-
-docs: $(COMPILER_SOURCES)
- $(CSC) $(CSCFLAGS) /doc:docs.xml /nowarn:1591 $(COMPILER_SOURCES)
-
-windows: all
-
-linux: all
-
-opt:
- $(CSC) /nologo /optimize+ /r:System.dll /target:exe /out:mbas.exe $(COMPILER_SOURCES)
-
-clean:
- rm -f mbas.exe y.output mbas.pdb *~ .*~ mb-parser.cs mbas.log response
-
-mb-parser.cs: mb-parser.jay
- ../jay/jay -ctv < ../jay/skeleton.cs mb-parser.jay > mb-parser.cs
-
diff --git a/mcs/mbas/mb-parser.jay b/mcs/mbas/mb-parser.jay
deleted file mode 100644
index fa71506b70e..00000000000
--- a/mcs/mbas/mb-parser.jay
+++ /dev/null
@@ -1,513 +0,0 @@
-%{
-//
-// Mono.MonoBASIC.Parser.cs (from .jay): The Parser for the MonoBASIC compiler
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 A Rafael D Teixeira
-//
-// TODO:
-// Nearly everything
-//
-
-namespace Mono.MonoBASIC
-{
- using System.Text;
- using System;
- using System.Collections;
- using Mono.Languages;
- using Mono.CSharp;
-
- /// <summary>
- /// The MonoBASIC Parser
- /// </summary>
- public class Parser : GenericParser
- {
-
-/*
- /// <summary>
- /// Current block is used to add statements as we find
- /// them.
- /// </summary>
- Block current_block;
-
- /// <summary>
- /// Current interface is used by the various declaration
- /// productions in the interface declaration to "add"
- /// the interfaces as we find them.
- /// </summary>
- Interface current_interface;
-
- /// <summary>
- /// This is used by the unary_expression code to resolve
- /// a name against a parameter.
- /// </summary>
- Parameters current_local_parameters;
-
- /// <summary>
- /// Using during property parsing to describe the implicit
- /// value parameter that is passed to the "set" accessor
- /// method
- /// </summary>
- Parameter [] implicit_value_parameters;
-
-*/
- bool UseExtendedSyntax; // for ".mbs" files
-
- public override string[] extensions()
- {
- string [] list = { ".vb", ".mbs" };
- return list;
- }
-
-%}
-
-%token EOF
-%token NONE /* This token is never returned by our lexer */
-%token ERROR // This is used not by the parser, but by the tokenizer.
- // do not remove.
-
-/*
- *These are the MonoBASIC keywords
- */
-%token ADDHANDLER
-%token ADDRESSOF
-%token ALIAS
-%token AND
-%token ANDALSO
-%token ANSI
-%token AS
-%token ASSEMBLY
-%token AUTO
-%token BOOLEAN
-%token BYREF
-%token BYTE
-%token BYVAL
-%token CALL
-%token CASE
-%token CATCH
-%token CBOOL
-%token CBYTE
-%token CCHAR
-%token CDATE
-%token CDEC
-%token CDBL
-%token CHAR
-%token CINT
-%token CLASS
-%token CLNG
-%token COBJ
-//%token COMPARE
-%token CONST
-%token CSHORT
-%token CSNG
-%token CSTR
-%token CTYPE
-%token DATE
-%token DECIMAL
-%token DECLARE
-%token DEFAULT
-%token DELEGATE
-%token DESCRIPTION // MonoBASIC extension
-%token DIM
-%token DO
-%token DOUBLE
-%token EACH
-%token ELSE
-%token ELSEIF
-%token END
-%token ENUM
-%token EOL
-%token ERASE
-%token ERROR
-%token EVENT
-%token EXIT
-//%token EXPLICIT
-%token FALSE
-%token FINALLY
-%token FOR
-%token FRIEND
-%token FUNCTION
-%token GET
-%token GETTYPE
-%token GOTO
-%token HANDLES
-%token IF
-%token IMPLEMENTS
-%token IMPORTS
-%token IN
-%token INHERITS
-%token INTEGER
-%token INTERFACE
-%token IS
-%token LET
-%token LIB
-%token LIKE
-%token LONG
-%token LOOP
-%token ME
-%token MOD
-%token MODULE
-%token MUSTINHERIT
-%token MUSTOVERRIDE
-%token MYBASE
-%token MYCLASS
-%token NAMESPACE
-%token NEW
-%token NEXT
-%token NOT
-%token NOTHING
-%token NOTINHERITABLE
-%token NOTOVERRIDABLE
-%token OBJECT
-%token ON
-%token OPTION
-%token OPTIONAL
-%token OR
-%token ORELSE
-%token OVERLOADS
-%token OVERRIDABLE
-%token OVERRIDES
-%token PARAMETER // MonoBASIC extension
-%token PARAM_ARRAY
-%token PRESERVE
-%token PRIVATE
-%token PROPERTY
-%token PROTECTED
-%token PUBLIC
-%token RAISEEVENT
-%token READONLY
-%token REDIM
-%token REM
-%token REMOVEHANDLER
-%token RESUME
-%token RETURN
-%token SELECT
-%token SET
-%token SHADOWS
-%token SHARED
-%token SHORT
-%token SINGLE
-%token SIZEOF
-%token STATIC
-%token STEP
-%token STOP
-%token STRING
-%token STRUCTURE
-%token SUB
-%token SUMMARY // MonoBASIC extension
-%token SYNCLOCK
-%token THEN
-%token THROW
-%token TO
-%token TRUE
-%token TRY
-%token TYPEOF
-%token UNICODE
-%token UNTIL
-%token VARIANT
-%token WHEN
-%token WHILE
-%token WITH
-%token WITHEVENTS
-%token WRITEONLY
-%token XOR
-
-/* MonoBASIC single character operators/punctuation. */
-%token OPEN_BRACKET "["
-%token CLOSE_BRACKET "]"
-%token OPEN_PARENS "("
-%token CLOSE_PARENS ")"
-%token DOT "."
-%token COMMA ","
-%token COLON ":"
-
-%token PLUS "+"
-%token MINUS "-"
-%token ASSIGN "="
-%token OP_LT "<"
-%token OP_GT ">"
-%token STAR "*"
-%token PERCENT "%"
-%token DIV "/"
-%token OP_EXP "^"
-%token INTERR "?"
-%token OP_IDIV "\\"
-%token OP_CONCAT "&"
-
-/* MonoBASIC multi-character operators. */
-%token OP_LE "<="
-%token OP_GE ">="
-%token OP_EQ "=="
-%token OP_NE "<>"
-%token OP_AND //"and"
-%token OP_OR //"or"
-%token OP_XOR //"xor"
-%token OP_MODULUS //"mod"
-%token OP_MULT_ASSIGN "*="
-%token OP_DIV_ASSIGN "/="
-%token OP_IDIV_ASSIGN "\\="
-%token OP_ADD_ASSIGN "+="
-%token OP_SUB_ASSIGN "-="
-%token OP_CONCAT_ASSIGN "&="
-%token OP_EXP_ASSIGN "^="
-
-/* Numbers */
-%token LITERAL_INTEGER "int literal"
-%token LITERAL_SINGLE "float literal"
-%token LITERAL_DOUBLE "double literal"
-%token LITERAL_DECIMAL "decimal literal"
-%token LITERAL_CHARACTER "character literal"
-%token LITERAL_STRING "string literal"
-
-%token IDENTIFIER
-
-/* Add precedence rules to solve dangling else s/r conflict */
-%nonassoc LOWPREC
-%nonassoc IF
-%nonassoc ELSE
-%right ASSIGN
-%left OP_OR
-%left OP_AND
-%left BITWISE_OR
-%left BITWISE_AND
-%left OP_SHIFT_LEFT OP_SHIFT_RIGHT
-%left PLUS MINUS
-%left STAR DIV PERCENT
-%right BITWISE_NOT CARRET UMINUS
-%nonassoc OP_INC OP_DEC
-%left OPEN_PARENS
-%left OPEN_BRACKET OPEN_BRACE
-%left DOT
-%nonassoc HIGHPREC
-
-%start compilation_unit
-%%
-
-compilation_unit
- : opt_imports_directives
- opt_attributes
- opt_declarations
- EOF
- {
- $$ = $3;
- }
- ;
-
-opt_declarations
- : /* empty */
- | declarations
- ;
-
-declarations
- : declaration
- | declarations declaration
- ;
-
-declaration
- : namespace_declaration
- | type_declaration
- {
- string name = "";
- int mod_flags;
-
- if ($1 is Class){
- Class c = (Class) $1;
- mod_flags = c.ModFlags;
- name = c.Name;
- } else if ($1 is Struct){
- Struct s = (Struct) $1;
- mod_flags = s.ModFlags;
- name = s.Name;
- } else
- break;
-
- if ((mod_flags & (Modifiers.PRIVATE|Modifiers.PROTECTED)) != 0){
- Report.Error (
- 1527, lexer.Location,
- "Namespace elements cannot be explicitly " +
- "declared private or protected in '" + name + "'");
- }
- }
- ;
-
-qualified_identifier
- : IDENTIFIER
- | qualified_identifier DOT IDENTIFIER
- {
- $$ = (($1).ToString ()) + "." + ($3.ToString ());
- }
- ;
-opt_imports_directives
- : /* empty */
- | imports_directives
- ;
-
-imports_directives
- : imports_directive
- | imports_directives imports_directive
- ;
-
-imports_directive
- : /* imports_alias_directive
- | */ imports_namespace_directive
- ;
-
-imports_namespace_directive
- : IMPORTS qualified_identifier EOL
- {
- current_namespace.Using ((string) $2);
- }
- ;
-
-opt_attributes
- : /* empty */
- ;
-
-namespace_declaration
- : NAMESPACE qualified_identifier EOL
- {
- current_namespace = RootContext.Tree.RecordNamespace(current_namespace, name, (string)$2);
- }
- opt_imports_directives
- opt_declarations
- END NAMESPACE EOL
- {
- current_namespace = current_namespace.Parent;
- }
- ;
-
-type_declaration
- : class_declaration
- | module_declaration
-// | struct_declaration
-// | interface_declaration
-// | enum_declaration
-// | delegate_declaration
- ;
-
-class_declaration
- : /* opt_attributes opt_modifiers */
- CLASS IDENTIFIER /* opt_class_interfaces */ EOL
- {
- }
- opt_class_member_declarations
- END CLASS EOL
- {
- }
- ;
-
-opt_module_modifiers
- : /* empty */ { $$ = (int) 0; }
- | PUBLIC { $$ = Modifiers.PUBLIC; }
- | FRIEND { $$ = Modifiers.INTERNAL; }
- ;
-
-module_declaration
- : opt_attributes opt_module_modifiers
- MODULE IDENTIFIER EOL
- {
- Module new_module;
- string name;
-
- name = MakeName((string) $4);
- new_module = new Module(current_container,
- name,
- (int) $2,
- (Attributes) $1,
- lexer.Location);
- current_container = new_module;
- current_container.Namespace = current_namespace;
- RootContext.Tree.RecordDecl(name, new_module);
- }
- opt_class_member_declarations
- END MODULE EOL
- {
- Module new_module = (Module)current_container;
-
- current_container = current_container.Parent;
- CheckDef (current_container.AddClass(new_module), new_module.Name, new_module.Location);
-
- $$ = new_module;
- }
- ;
-
-opt_class_member_declarations
- : /* empty */
- | class_member_declarations
- ;
-
-class_member_declarations
- : class_member_declaration
- | class_member_declarations class_member_declaration
- ;
-
-class_member_declaration
- : /* type_declaration
- | */ sub_declaration
- ;
-
-sub_declaration
- : SUB qualified_identifier OPEN_PARENS opt_formal_parameters CLOSE_PARENS EOL
- opt_statements
- END SUB EOL
- ;
-
-opt_statements
- : /* empty */
- | qualified_identifier OPEN_PARENS opt_actual_parameters CLOSE_PARENS EOL
- ;
-
-opt_formal_parameters
- : /* empty */
- | qualified_identifier AS qualified_identifier
- ;
-
-opt_actual_parameters
- : /* empty */
- | qualified_identifier
- | LITERAL_STRING
- ;
-
-%%
-
-
-Tokenizer lexer;
-
-public Tokenizer Lexer {
- get {
- return lexer;
- }
-}
-
-public override void parse ()
-{
- current_namespace = new Namespace (null, "");
- current_container = RootContext.Tree.Types;
- current_container.Namespace = current_namespace;
-
- UseExtendedSyntax = name.EndsWith(".mbs");
-
- lexer = new Tokenizer (input, name, defines);
- StringBuilder value = new StringBuilder ();
-
- try
- {
- if (yacc_verbose_flag)
- yyparse (lexer, new yydebug.yyDebugSimple ());
- else
- yyparse (lexer);
- }
- catch (Exception e)
- {
- Console.WriteLine (lexer.location + " : Parsing error ");
- Console.WriteLine (e);
- }
-}
-
-/* end end end */
-}
-
-
diff --git a/mcs/mbas/mb-tokenizer.cs b/mcs/mbas/mb-tokenizer.cs
deleted file mode 100644
index 99bfd15f55f..00000000000
--- a/mcs/mbas/mb-tokenizer.cs
+++ /dev/null
@@ -1,864 +0,0 @@
-ďťż//
-// Mono.MonoBASIC.Tokenizer.cs: The Tokenizer for the MonoBASIC compiler
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Based on cs-tokenizer.cs by Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 A Rafael D Teixeira
-//
-
-namespace Mono.MonoBASIC
-{
- using System;
- using System.Text;
- using System.Collections;
- using System.IO;
- using System.Globalization;
- using Mono.Languages;
- using Mono.CSharp;
-
- /// <summary>
- /// Tokenizer for MonoBASIC source code.
- /// </summary>
-
- public class Tokenizer : yyParser.yyInput
- {
- TextReader reader;
- public string ref_name;
- public int ref_line = 1;
- public int line = 1;
- public int col = 1;
- public int current_token;
- bool handle_get_set = false;
-
- public int ExpandedTabsSize = 4;
-
- public string location {
- get {
- string det;
-
- if (current_token == Token.ERROR)
- det = "detail: " + error_details;
- else
- det = "";
-
- return "Line: "+line+" Col: "+col + "\n" +
- "VirtLine: "+ref_line +
- " Token: "+current_token + " " + det;
- }
- }
-
- public bool properties {
- get {
- return handle_get_set;
- }
-
- set {
- handle_get_set = value;
- }
- }
-
- //
- // Class variables
- //
- static Hashtable keywords;
- static NumberStyles styles;
- static NumberFormatInfo csharp_format_info;
-
- //
- // Values for the associated token returned
- //
- System.Text.StringBuilder number;
- int putback_char;
- Object val;
-
- //
- // Details about the error encoutered by the tokenizer
- //
- string error_details;
-
- public string error {
- get {
- return error_details;
- }
- }
-
- public int Line {
- get {
- return line;
- }
- }
-
- public int Col {
- get {
- return col;
- }
- }
-
- static void initTokens ()
- {
- keywords = new Hashtable ();
-
- keywords.Add ("addhandler", Token.ADDHANDLER);
- keywords.Add ("addressof", Token.ADDRESSOF);
- keywords.Add ("alias", Token.ALIAS);
- keywords.Add ("and", Token.AND);
- keywords.Add ("andalso", Token.ANDALSO);
- keywords.Add ("ansi", Token.ANSI);
- keywords.Add ("as", Token.AS);
- keywords.Add ("assembly", Token.ASSEMBLY);
- keywords.Add ("auto", Token.AUTO);
- keywords.Add ("boolean", Token.BOOLEAN);
- keywords.Add ("byref", Token.BYREF);
- keywords.Add ("byte", Token.BYTE);
- keywords.Add ("byval", Token.BYVAL);
- keywords.Add ("call", Token.CALL);
- keywords.Add ("case", Token.CASE);
- keywords.Add ("catch", Token.CATCH);
- keywords.Add ("cbool", Token.CBOOL);
- keywords.Add ("cbyte", Token.CBYTE);
- keywords.Add ("cchar", Token.CCHAR);
- keywords.Add ("cdate", Token.CDATE);
- keywords.Add ("cdec", Token.CDEC);
- keywords.Add ("cdbl", Token.CDBL);
- keywords.Add ("char", Token.CHAR);
- keywords.Add ("cint", Token.CINT);
- keywords.Add ("class", Token.CLASS);
- keywords.Add ("clng", Token.CLNG);
- keywords.Add ("cobj", Token.COBJ);
- //keywords.Add ("compare", Token.COMPARE);
- keywords.Add ("const", Token.CONST);
- keywords.Add ("cshort", Token.CSHORT);
- keywords.Add ("csng", Token.CSNG);
- keywords.Add ("cstr", Token.CSTR);
- keywords.Add ("ctype", Token.CTYPE);
- keywords.Add ("date", Token.DATE);
- keywords.Add ("decimal", Token.DECIMAL);
- keywords.Add ("declare", Token.DECLARE);
- keywords.Add ("default", Token.DEFAULT);
- keywords.Add ("delegate", Token.DELEGATE);
- keywords.Add ("dim", Token.DIM);
- keywords.Add ("do", Token.DO);
- keywords.Add ("double", Token.DOUBLE);
- keywords.Add ("each", Token.EACH);
- keywords.Add ("else", Token.ELSE);
- keywords.Add ("elseif", Token.ELSEIF);
- keywords.Add ("end", Token.END);
- keywords.Add ("enum", Token.ENUM);
- keywords.Add ("erase", Token.ERASE);
- keywords.Add ("error", Token.ERROR);
- keywords.Add ("event", Token.EVENT);
- keywords.Add ("exit", Token.EXIT);
- //keywords.Add ("explicit", Token.EXPLICIT);
- keywords.Add ("false", Token.FALSE);
- keywords.Add ("finally", Token.FINALLY);
- keywords.Add ("for", Token.FOR);
- keywords.Add ("friend", Token.FRIEND);
- keywords.Add ("function", Token.FUNCTION);
- keywords.Add ("get", Token.GET);
- keywords.Add ("gettype", Token.GETTYPE);
- keywords.Add ("goto", Token.GOTO);
- keywords.Add ("handles", Token.HANDLES);
- keywords.Add ("if", Token.IF);
- keywords.Add ("implements", Token.IMPLEMENTS);
- keywords.Add ("imports", Token.IMPORTS);
- keywords.Add ("in", Token.IN);
- keywords.Add ("inherits", Token.INHERITS);
- keywords.Add ("integer", Token.INTEGER);
- keywords.Add ("interface", Token.INTERFACE);
- keywords.Add ("is", Token.IS);
- keywords.Add ("let ", Token.LET );
- keywords.Add ("lib ", Token.LIB );
- keywords.Add ("like ", Token.LIKE );
- keywords.Add ("long", Token.LONG);
- keywords.Add ("loop", Token.LOOP);
- keywords.Add ("me", Token.ME);
- keywords.Add ("mod", Token.MOD);
- keywords.Add ("module", Token.MODULE);
- keywords.Add ("mustinherit", Token.MUSTINHERIT);
- keywords.Add ("mustoverride", Token.MUSTOVERRIDE);
- keywords.Add ("mybase", Token.MYBASE);
- keywords.Add ("myclass", Token.MYCLASS);
- keywords.Add ("namespace", Token.NAMESPACE);
- keywords.Add ("new", Token.NEW);
- keywords.Add ("next", Token.NEXT);
- keywords.Add ("not", Token.NOT);
- keywords.Add ("nothing", Token.NOTHING);
- keywords.Add ("notinheritable", Token.NOTINHERITABLE);
- keywords.Add ("notoverridable", Token.NOTOVERRIDABLE);
- keywords.Add ("object", Token.OBJECT);
- keywords.Add ("on", Token.ON);
- keywords.Add ("option", Token.OPTION);
- keywords.Add ("optional", Token.OPTIONAL);
- keywords.Add ("or", Token.OR);
- keywords.Add ("orelse", Token.ORELSE);
- keywords.Add ("overloads", Token.OVERLOADS);
- keywords.Add ("overridable", Token.OVERRIDABLE);
- keywords.Add ("overrides", Token.OVERRIDES);
- keywords.Add ("paramarray", Token.PARAM_ARRAY);
- keywords.Add ("preserve", Token.PRESERVE);
- keywords.Add ("private", Token.PRIVATE);
- keywords.Add ("property", Token.PROPERTY);
- keywords.Add ("protected", Token.PROTECTED);
- keywords.Add ("public", Token.PUBLIC);
- keywords.Add ("raiseevent", Token.RAISEEVENT);
- keywords.Add ("readonly", Token.READONLY);
- keywords.Add ("redim", Token.REDIM);
- keywords.Add ("rem", Token.REM);
- keywords.Add ("removehandler", Token.REMOVEHANDLER);
- keywords.Add ("resume", Token.RESUME);
- keywords.Add ("return", Token.RETURN);
- keywords.Add ("select", Token.SELECT);
- keywords.Add ("set", Token.SET);
- keywords.Add ("shadows", Token.SHADOWS);
- keywords.Add ("shared", Token.SHARED);
- keywords.Add ("short", Token.SHORT);
- keywords.Add ("single", Token.SINGLE);
- keywords.Add ("sizeof", Token.SIZEOF);
- keywords.Add ("static", Token.STATIC);
- keywords.Add ("step", Token.STEP);
- keywords.Add ("stop", Token.STOP);
- keywords.Add ("string", Token.STRING);
- keywords.Add ("structure", Token.STRUCTURE);
- keywords.Add ("sub", Token.SUB);
- keywords.Add ("synclock", Token.SYNCLOCK);
- keywords.Add ("then", Token.THEN);
- keywords.Add ("throw", Token.THROW);
- keywords.Add ("to", Token.TO);
- keywords.Add ("true", Token.TRUE);
- keywords.Add ("try", Token.TRY);
- keywords.Add ("typeof", Token.TYPEOF);
- keywords.Add ("unicode", Token.UNICODE);
- keywords.Add ("until", Token.UNTIL);
- keywords.Add ("variant", Token.VARIANT);
- keywords.Add ("when", Token.WHEN);
- keywords.Add ("while", Token.WHILE);
- keywords.Add ("with", Token.WITH);
- keywords.Add ("withevents", Token.WITHEVENTS);
- keywords.Add ("writeonly", Token.WRITEONLY);
- keywords.Add ("xor", Token.XOR);
- }
-
- //
- // Class initializer
- //
- static Tokenizer ()
- {
- initTokens ();
- csharp_format_info = new NumberFormatInfo ();
- csharp_format_info.CurrencyDecimalSeparator = ".";
- styles = NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint;
- }
-
- bool is_keyword (string name)
- {
- bool res;
-
- res = keywords.Contains(name.ToLower());
- if ((name == "get" || name == "set") && handle_get_set == false)
- return false;
- return res;
- }
-
- int getKeyword (string name)
- {
- return (int) (keywords [name.ToLower()]);
- }
-
- public Location Location {
- get {
- return new Location (ref_line);
- }
- }
-
- bool is_identifier_start_character (char c)
- {
- return Char.IsLetter (c) || c == '_' ;
- }
-
- bool is_identifier_part_character (char c)
- {
- return (Char.IsLetter (c) || Char.IsDigit (c) || c == '_');
- }
-
- int is_punct (char c, ref bool doread)
- {
- int idx = "{}[](),:;~+-*/%&|^!=<>?".IndexOf (c);
- int d;
- int t;
-
- doread = false;
-
- switch (c){
-// case '[':
-// return Token.OPEN_BRACKET;
-// case ']':
-// return Token.CLOSE_BRACKET;
- case '(':
- return Token.OPEN_PARENS;
- case ')':
- return Token.CLOSE_PARENS;
- case ',':
- return Token.COMMA;
- case ':':
- return Token.COLON;
- case '?':
- return Token.INTERR;
- }
-
- d = peekChar ();
- if (c == '+'){
-
- if (d == '+')
- t = Token.OP_INC;
- else if (d == '=')
- t = Token.OP_ADD_ASSIGN;
- else
- return Token.PLUS;
- doread = true;
- return t;
- }
- if (c == '-'){
- if (d == '=')
- t = Token.OP_SUB_ASSIGN;
- else
- return Token.MINUS;
- doread = true;
- return t;
- }
-
- if (c == '='){
- /*if (d == '='){
- doread = true;
- return Token.OP_EQ;
- }*/
- return Token.ASSIGN;
- }
-
- if (c == '*'){
- if (d == '='){
- doread = true;
- return Token.OP_MULT_ASSIGN;
- }
- return Token.STAR;
- }
-
- if (c == '/'){
- if (d == '='){
- doread = true;
- return Token.OP_DIV_ASSIGN;
- }
- return Token.DIV;
- }
-
- if (c == '\\'){
- if (d == '='){
- doread = true;
- return Token.OP_IDIV_ASSIGN;
- }
- return Token.OP_IDIV;
- }
-
- if (c == '^'){
- if (d == '='){
- doread = true;
- return Token.OP_EXP_ASSIGN;
- }
- return Token.OP_EXP;
- }
-
- if (c == '<'){
- if (d == '>')
- {
- doread = true;
- return Token.OP_NE;
- }
- if (d == '='){
- doread = true;
- return Token.OP_LE;
- }
- return Token.OP_LT;
- }
-
- if (c == '>'){
- if (d == '='){
- doread = true;
- return Token.OP_GE;
- }
- return Token.OP_GT;
- }
- return Token.ERROR;
- }
-
- bool decimal_digits (int c)
- {
- int d;
- bool seen_digits = false;
-
- if (c != -1)
- number.Append ((char) c);
-
- while ((d = peekChar ()) != -1){
- if (Char.IsDigit ((char)d)){
- number.Append ((char) d);
- getChar ();
- seen_digits = true;
- } else
- break;
- }
- return seen_digits;
- }
-
- void hex_digits (int c)
- {
- int d;
-
- if (c != -1)
- number.Append ((char) c);
- while ((d = peekChar ()) != -1){
- char e = Char.ToUpper ((char) d);
-
- if (Char.IsDigit (e) ||
- (e >= 'A' && e <= 'F')){
- number.Append ((char) e);
- getChar ();
- } else
- break;
- }
- }
-
- int real_type_suffix (int c)
- {
- int t;
-
- switch (c){
- case 'F': case 'f':
- t = Token.LITERAL_SINGLE;
- break;
- case 'D': case 'd':
- t = Token.LITERAL_DOUBLE;
- break;
- case 'M': case 'm':
- t= Token.LITERAL_DECIMAL;
- break;
- default:
- return Token.NONE;
- }
- getChar ();
- return t;
- }
-
- int integer_type_suffix (int c)
- {
- // FIXME: Handle U and L suffixes.
- // We also need to see in which kind of
- // Int the thing fits better according to the spec.
- return Token.LITERAL_INTEGER;
- }
-
- void adjust_int (int t)
- {
- val = new System.Int32();
- val = System.Int32.Parse (number.ToString (), 0);
- }
-
- int adjust_real (int t)
- {
- string s = number.ToString ();
-
- Console.WriteLine (s);
- switch (t){
- case Token.LITERAL_DECIMAL:
- val = new System.Decimal ();
- val = System.Decimal.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_DOUBLE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_SINGLE:
- val = new System.Double ();
- val = (float) System.Double.Parse (
- s, styles, csharp_format_info);
- break;
-
- case Token.NONE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- t = Token.LITERAL_DOUBLE;
- break;
- }
- return t;
- }
-
- //
- // Invoked if we know we have .digits or digits
- //
- int is_number (int c)
- {
- bool is_real = false;
- number = new System.Text.StringBuilder ();
- int type;
-
- number.Length = 0;
-
- if (Char.IsDigit ((char)c)){
- if (c == '0' && peekChar () == 'x' || peekChar () == 'X'){
- getChar ();
- hex_digits (-1);
- val = new System.Int32 ();
- val = System.Int32.Parse (number.ToString (), NumberStyles.HexNumber);
- return integer_type_suffix (peekChar ());
- }
- decimal_digits (c);
- c = getChar ();
- }
-
- //
- // We need to handle the case of
- // "1.1" vs "1.string" (LITERAL_SINGLE vs NUMBER DOT IDENTIFIER)
- //
- if (c == '.'){
- if (decimal_digits ('.')){
- is_real = true;
- c = peekChar ();
- } else {
- putback ('.');
- number.Length -= 1;
- adjust_int (Token.LITERAL_INTEGER);
- return Token.LITERAL_INTEGER;
- }
- }
-
- if (c == 'e' || c == 'E'){
- is_real = true;
- number.Append ("e");
- getChar ();
-
- c = peekChar ();
- if (c == '+'){
- number.Append ((char) c);
- getChar ();
- c = peekChar ();
- } else if (c == '-'){
- number.Append ((char) c);
- getChar ();
- c = peekChar ();
- }
- decimal_digits (-1);
- c = peekChar ();
- }
-
- type = real_type_suffix (c);
- if (type == Token.NONE && !is_real){
- type = integer_type_suffix (c);
- adjust_int (type);
- putback (c);
- return type;
- } else
- is_real = true;
-
- if (is_real)
- return adjust_real (type);
-
- Console.WriteLine ("This should not be reached");
- throw new Exception ("Is Number should never reach this point");
- }
-
- int escape (int c)
- {
- int d;
- int v;
-
- d = peekChar ();
- if (c != '\\')
- return c;
-
- switch (d){
- case 'a':
- v = '\a'; break;
- case 'b':
- v = '\b'; break;
- case 'n':
- v = '\n'; break;
- case 't':
- v = '\t'; break;
- case 'v':
- v = '\v'; break;
- case 'r':
- v = 'c'; break;
- case '\\':
- v = '\\'; break;
- case 'f':
- v = '\f'; break;
- case '0':
- v = 0; break;
- case '"':
- v = '"'; break;
- case '\'':
- v = '\''; break;
- default:
- error_details = "cs1009: Unrecognized escape sequence " + (char)d;
- return -1;
- }
- getChar ();
- return v;
- }
-
- int getChar ()
- {
- if (putback_char != -1){
- int x = putback_char;
- putback_char = -1;
-
- return x;
- }
- return reader.Read ();
- }
-
- int peekChar ()
- {
- if (putback_char != -1)
- return putback_char;
- return reader.Peek ();
- }
-
- void putback (int c)
- {
- if (putback_char != -1)
- throw new Exception ("This should not happen putback on putback");
- putback_char = c;
- }
-
- public bool advance ()
- {
- return current_token != Token.EOF ;
- }
-
- public Object Value {
- get {
- return val;
- }
- }
-
- public Object value ()
- {
- return val;
- }
-
- private bool IsEOL(int currentChar)
- {
- if (currentChar == 0x0D)
- {
- if (peekChar() == 0x0A) // if it is a CR-LF pair consume LF also
- getChar();
-
- return true;
- }
- return (currentChar == -1 || currentChar == 0x0A || currentChar == 0x2028 || currentChar == 0x2029);
- }
-
- private int DropComments()
- {
- int d;
- while (!IsEOL(d = getChar ()))
- col++;
- line++;
- ref_line++;
- col = 0;
-
- return Token.EOL;
- }
-
- public int token ()
- {
- int lastToken = current_token;
- do
- {
- current_token = xtoken ();
- if (current_token == 0)
- return Token.EOF;
- if (current_token == Token.REM)
- current_token = DropComments();
- } while (lastToken == Token.EOL && current_token == Token.EOL);
-
- return current_token;
- }
-
- private string GetIdentifier()
- {
- int c = getChar();
- if (is_identifier_start_character ((char) c))
- return GetIdentifier(c);
- else
- return null;
- }
-
- private string GetIdentifier(int c)
- {
- System.Text.StringBuilder id = new System.Text.StringBuilder ();
-
- id.Append ((char) c);
-
- while ((c = peekChar ()) != -1)
- {
- if (is_identifier_part_character ((char) c))
- {
- id.Append ((char)getChar ());
- col++;
- }
- else
- break;
- }
-
- return id.ToString ();
- }
-
- public int xtoken ()
- {
- int t;
- bool doread = false;
- int c;
-
- val = null;
- for (;(c = getChar ()) != -1; col++) {
-
- // Handle line comments.
- if (c == '\'')
- return Token.REM;
-
- // Handle EOL.
- if (IsEOL(c))
- {
- line++;
- ref_line++;
- col = 0;
- if (current_token == Token.EOL) // if last token was also EOL keep skipping
- continue;
- return Token.EOL;
- }
-
- // Handle escaped identifiers
- if (c == '[')
- {
- if ((val = GetIdentifier()) == null)
- break;
- if ((c = getChar()) != ']')
- break;
- return Token.IDENTIFIER;
- }
-
- // Handle unescaped identifiers
- if (is_identifier_start_character ((char) c))
- {
- string id;
- if ((id = GetIdentifier(c)) == null)
- break;
- if (is_keyword(id))
- return getKeyword(id);
- val = id;
- return Token.IDENTIFIER;
- }
-
- // handle numeric literals
- if (c == '.'){
- if (Char.IsDigit ((char) peekChar ()))
- return is_number (c);
- return Token.DOT;
- }
-
- if (Char.IsDigit ((char) c))
- return is_number (c);
-
- /* For now, limited support for pre-processor commands */
- if (col == 1 && c == '#'){
- System.Text.StringBuilder s = new System.Text.StringBuilder ();
-
- while ((c = getChar ()) != -1 && (c != '\n')){
- s.Append ((char) c);
- }
- if (String.Compare (s.ToString (), 0, "line", 0, 4) == 0){
- string arg = s.ToString ().Substring (5);
- int pos;
-
- if ((pos = arg.IndexOf (' ')) != -1 && pos != 0){
- ref_line = System.Int32.Parse (arg.Substring (0, pos));
- pos++;
-
- char [] quotes = { '\"' };
-
- ref_name = arg.Substring (pos);
- ref_name.TrimStart (quotes);
- ref_name.TrimEnd (quotes);
- } else
- ref_line = System.Int32.Parse (arg);
- }
- line++;
- ref_line++;
- continue;
- }
-
- if ((t = is_punct ((char)c, ref doread)) != Token.ERROR){
- if (doread){
- getChar ();
- col++;
- }
- return t;
- }
-
- // Treat string literals
- if (c == '"'){
- System.Text.StringBuilder s = new System.Text.StringBuilder ();
-
- while ((c = getChar ()) != -1){
- if (c == '"'){ // TODO: treat double-doublequotes
- val = s.ToString ();
- return Token.LITERAL_STRING;
- }
-
- c = escape (c);
- if (c == -1)
- return Token.ERROR;
- s.Append ((char) c);
- }
- }
-
- // expand tabs for location and ignore it as whitespace
- if (c == '\t')
- {
- col = (((col + ExpandedTabsSize) / ExpandedTabsSize) * ExpandedTabsSize) - 1;
- continue;
- }
-
- // white space
- if (c == ' ' || c == '\f' || c == '\v')
- continue;
-
- error_details = ((char)c).ToString ();
-
- return Token.ERROR;
- }
-
- if (current_token != Token.EOL) // if last token wasn´t EOL send it before EOF
- return Token.EOL;
-
- return Token.EOF;
- }
-
- public Tokenizer (System.IO.TextReader input, string fname, ArrayList defines)
- {
- this.ref_name = fname;
- reader = input;
- putback_char = -1;
-
- Location.Push (fname);
- }
-
- }
-}
diff --git a/mcs/mbas/mbas.csproj b/mcs/mbas/mbas.csproj
deleted file mode 100644
index f551f2bd48a..00000000000
--- a/mcs/mbas/mbas.csproj
+++ /dev/null
@@ -1,260 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- ProjectGuid = "{D9868C8B-B8C9-43E0-8702-F33AD49F1CC3}"
- >
- <Build>
- <Settings
- ApplicationIcon = "mbas.ico"
- AssemblyKeyContainerName = ""
- AssemblyName = "mbas"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Grid"
- DefaultTargetSchema = "IE50"
- DelaySign = "false"
- OutputType = "Exe"
- RootNamespace = "Mono.Languages"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = ""
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "true"
- Optimize = "false"
- OutputPath = ".\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "285212672"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- HintPath = "..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.dll"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- HintPath = "..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- HintPath = "..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
- />
- <Reference
- Name = "Mono.GetOptions"
- Project = "{8D3008AB-7C0F-4DBE-A305-752926C366A7}"
- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AssemblyInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "assign.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "attribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "cfold.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ChangeLog"
- BuildAction = "None"
- />
- <File
- RelPath = "class.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "codegen.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "const.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "constant.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "decl.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "delegate.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "driver.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ecore.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "enum.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "expression.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "genericparser.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "interface.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "literal.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "location.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "mbas.ico"
- BuildAction = "Content"
- />
- <File
- RelPath = "mb-parser.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "mb-parser.jay"
- BuildAction = "None"
- />
- <File
- RelPath = "mb-tokenizer.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "modifiers.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "module.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "namespace.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "parameter.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "pending.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "report.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "rootcontext.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "statement.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "statementCollection.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "support.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "tree.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "typemanager.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/mbas/mbas.ico b/mcs/mbas/mbas.ico
deleted file mode 100644
index e134617dd82..00000000000
--- a/mcs/mbas/mbas.ico
+++ /dev/null
Binary files differ
diff --git a/mcs/mbas/mbas.sln b/mcs/mbas/mbas.sln
deleted file mode 100644
index 95f0b4a015e..00000000000
--- a/mcs/mbas/mbas.sln
+++ /dev/null
@@ -1,33 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mbas", "mbas.csproj", "{D9868C8B-B8C9-43E0-8702-F33AD49F1CC3}"
-EndProject
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "testmbas", "testmbas\testmbas.vbproj", "{64A40514-2574-4F75-B967-855531F2F01D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.GetOptions", "..\class\Mono.GetOptions\Mono.GetOptions.csproj", "{8D3008AB-7C0F-4DBE-A305-752926C366A7}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {D9868C8B-B8C9-43E0-8702-F33AD49F1CC3}.Debug.ActiveCfg = Debug|.NET
- {D9868C8B-B8C9-43E0-8702-F33AD49F1CC3}.Debug.Build.0 = Debug|.NET
- {D9868C8B-B8C9-43E0-8702-F33AD49F1CC3}.Release.ActiveCfg = Release|.NET
- {D9868C8B-B8C9-43E0-8702-F33AD49F1CC3}.Release.Build.0 = Release|.NET
- {64A40514-2574-4F75-B967-855531F2F01D}.Debug.ActiveCfg = Debug|.NET
- {64A40514-2574-4F75-B967-855531F2F01D}.Debug.Build.0 = Debug|.NET
- {64A40514-2574-4F75-B967-855531F2F01D}.Release.ActiveCfg = Release|.NET
- {64A40514-2574-4F75-B967-855531F2F01D}.Release.Build.0 = Release|.NET
- {8D3008AB-7C0F-4DBE-A305-752926C366A7}.Debug.ActiveCfg = Debug|.NET
- {8D3008AB-7C0F-4DBE-A305-752926C366A7}.Debug.Build.0 = Debug|.NET
- {8D3008AB-7C0F-4DBE-A305-752926C366A7}.Release.ActiveCfg = Release|.NET
- {8D3008AB-7C0F-4DBE-A305-752926C366A7}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/mcs/mbas/modifiers.cs b/mcs/mbas/modifiers.cs
deleted file mode 100644
index 4c114035836..00000000000
--- a/mcs/mbas/modifiers.cs
+++ /dev/null
@@ -1,231 +0,0 @@
-//
-// modifiers.cs: Modifier handling.
-//
-using System;
-using System.Reflection;
-
-namespace Mono.CSharp {
- public class Modifiers {
-
- //
- // The ordering of the following 4 constants
- // has been carefully done.
- //
- public const int PROTECTED = 0x0001;
- public const int PUBLIC = 0x0002;
- public const int PRIVATE = 0x0004;
- public const int INTERNAL = 0x0008;
- public const int NEW = 0x0010;
- public const int ABSTRACT = 0x0020;
- public const int SEALED = 0x0040;
- public const int STATIC = 0x0080;
- public const int READONLY = 0x0100;
- public const int VIRTUAL = 0x0200;
- public const int OVERRIDE = 0x0400;
- public const int EXTERN = 0x0800;
- public const int VOLATILE = 0x1000;
- public const int UNSAFE = 0x2000;
- public const int TOP = 0x2000;
-
- public const int Accessibility =
- PUBLIC | PROTECTED | INTERNAL | PRIVATE;
-
- static public string Name (int i)
- {
- string s = "";
-
- switch (i) {
- case Modifiers.NEW:
- s = "new"; break;
- case Modifiers.PUBLIC:
- s = "public"; break;
- case Modifiers.PROTECTED:
- s = "protected"; break;
- case Modifiers.INTERNAL:
- s = "internal"; break;
- case Modifiers.PRIVATE:
- s = "private"; break;
- case Modifiers.ABSTRACT:
- s = "abstract"; break;
- case Modifiers.SEALED:
- s = "sealed"; break;
- case Modifiers.STATIC:
- s = "static"; break;
- case Modifiers.READONLY:
- s = "readonly"; break;
- case Modifiers.VIRTUAL:
- s = "virtual"; break;
- case Modifiers.OVERRIDE:
- s = "override"; break;
- case Modifiers.EXTERN:
- s = "extern"; break;
- case Modifiers.VOLATILE:
- s = "volatile"; break;
- }
-
- return s;
- }
-
- public static TypeAttributes TypeAttr (int mod_flags, TypeContainer caller)
- {
- TypeAttributes t = 0;
- bool top_level = caller.IsTopLevel;
-
- if (top_level){
- if ((mod_flags & PUBLIC) != 0)
- t |= TypeAttributes.Public;
- if ((mod_flags & PRIVATE) != 0)
- t |= TypeAttributes.NotPublic;
- } else {
- if ((mod_flags & PUBLIC) != 0)
- t |= TypeAttributes.NestedPublic;
- if ((mod_flags & PRIVATE) != 0)
- t |= TypeAttributes.NestedPrivate;
- if ((mod_flags & PROTECTED) != 0 && (mod_flags & INTERNAL) != 0)
- t |= TypeAttributes.NestedFamORAssem;
- if ((mod_flags & PROTECTED) != 0)
- t |= TypeAttributes.NestedFamily;
- if ((mod_flags & INTERNAL) != 0)
- t |= TypeAttributes.NestedAssembly;
- }
-
- if ((mod_flags & SEALED) != 0)
- t |= TypeAttributes.Sealed;
- if ((mod_flags & ABSTRACT) != 0)
- t |= TypeAttributes.Abstract;
-
- // If we do not have static constructors, static methods
- // can be invoked without initializing the type.
- if (!caller.HaveStaticConstructor)
- t |= TypeAttributes.BeforeFieldInit;
-
- return t;
- }
-
- public static FieldAttributes FieldAttr (int mod_flags)
- {
- FieldAttributes fa = 0;
-
- if ((mod_flags & PUBLIC) != 0)
- fa |= FieldAttributes.Public;
- if ((mod_flags & PRIVATE) != 0)
- fa |= FieldAttributes.Private;
- if ((mod_flags & PROTECTED) != 0){
- if ((mod_flags & INTERNAL) != 0)
- fa |= FieldAttributes.FamORAssem;
- else
- fa |= FieldAttributes.Family;
- } else {
- if ((mod_flags & INTERNAL) != 0)
- fa |= FieldAttributes.Assembly;
- }
-
- if ((mod_flags & STATIC) != 0)
- fa |= FieldAttributes.Static;
- if ((mod_flags & READONLY) != 0)
- fa |= FieldAttributes.InitOnly;
-
- return fa;
- }
-
- public static MethodAttributes MethodAttr (int mod_flags)
- {
- MethodAttributes ma = 0;
-
- if ((mod_flags & PUBLIC) != 0)
- ma |= MethodAttributes.Public;
- if ((mod_flags & PRIVATE) != 0)
- ma |= MethodAttributes.Private;
- if ((mod_flags & PROTECTED) != 0){
- if ((mod_flags & INTERNAL) != 0)
- ma |= MethodAttributes.FamORAssem;
- else
- ma |= MethodAttributes.Family;
- } else {
- if ((mod_flags & INTERNAL) != 0)
- ma |= MethodAttributes.Assembly;
- }
-
- if ((mod_flags & STATIC) != 0)
- ma |= MethodAttributes.Static;
- if ((mod_flags & ABSTRACT) != 0){
- ma |= MethodAttributes.Abstract | MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
- }
- if ((mod_flags & SEALED) != 0)
- ma |= MethodAttributes.Final;
-
- if ((mod_flags & VIRTUAL) != 0)
- ma |= MethodAttributes.Virtual;
-
- if ((mod_flags & OVERRIDE) != 0)
- ma |= MethodAttributes.Virtual | MethodAttributes.HideBySig;
- else {
- if ((ma & MethodAttributes.Virtual) != 0)
- ma |= MethodAttributes.NewSlot;
- }
-
- if ((mod_flags & NEW) != 0)
- ma |= MethodAttributes.HideBySig;
-
- return ma;
- }
-
- // <summary>
- // Checks the object @mod modifiers to be in @allowed.
- // Returns the new mask. Side effect: reports any
- // incorrect attributes.
- // </summary>
- public static int Check (int allowed, int mod, int def_access, Location l)
- {
- int invalid_flags = (~allowed) & mod;
- int i;
-
- if (invalid_flags == 0){
- int a = mod;
-
- if ((mod & Modifiers.UNSAFE) != 0){
- if (!RootContext.Unsafe){
- Report.Error (227, l,
- "Unsafe code requires the --unsafe command " +
- "line option to be specified");
- }
- }
-
- //
- // If no accessibility bits provided
- // then provide the defaults.
- //
- if ((mod & Accessibility) == 0){
- mod |= def_access;
- return mod;
- }
-
- //
- // Make sure that no conflicting accessibility
- // bits have been set. Protected+Internal is
- // allowed, that is why they are placed on bits
- // 1 and 4 (so the shift 3 basically merges them)
- //
- a &= 15;
- a |= (a >> 3);
- a = ((a & 2) >> 1) + (a & 5);
- a = ((a & 4) >> 2) + (a & 3);
- if (a > 1)
- Report.Error (107, l, "More than one protection modifier specified");
-
- return mod;
- }
-
- for (i = 1; i < TOP; i <<= 1){
- if ((i & invalid_flags) == 0)
- continue;
-
- Report.Error (106, l, "the modifier `" + Name (i) +
- "' is not valid for this item");
- }
-
- return allowed & mod;
- }
- }
-}
diff --git a/mcs/mbas/module.cs b/mcs/mbas/module.cs
deleted file mode 100644
index ec9982d7e02..00000000000
--- a/mcs/mbas/module.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// module.cs: Module handler
-//
-// Author: Rafael Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2002 Rafael Teixeira
-//
-using System;
-using System.Collections;
-using System.Diagnostics.SymbolStore;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using Mono.CSharp ;
-
-namespace Mono.MonoBASIC
-{
- public class Utils
- {
- public static void AddSpecializedAttribute(ref Attributes attrs, string attributeName, ArrayList args, Location loc)
- {
- Mono.CSharp.Attribute specialAttr = new Mono.CSharp.Attribute(attributeName, args, loc);
- ArrayList al = new ArrayList();
- al.Add(specialAttr);
- AttributeSection asec = new AttributeSection(null, al);
- if (attrs == null)
- attrs = new Attributes(asec, loc);
- else
- attrs.AddAttribute(asec);
- }
- }
-
- /// <summary>
- /// Summary description for module.
- /// </summary>
- public class Module : Mono.CSharp.Class
- {
- // <summary>
- // Modifiers allowed in a class declaration
- // </summary>
- public new const int AllowedModifiers =
- Modifiers.PUBLIC |
- Modifiers.INTERNAL;
-
- public Module(TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, 0, null, l)
- {
- if (parent.Parent != null)
- Report.Error (30617, l,
- "'Module' statements can occur only at file or namespace level");
-
- // overwrite ModFlags
- this.ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.INTERNAL, l);
-
- // add specialized attribute
- Utils.AddSpecializedAttribute(ref attrs, "Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute", null, l);
- this.attributes = attrs;
- }
-
- //
- // FIXME: How do we deal with the user specifying a different
- // layout?
- //
- public override TypeAttributes TypeAttr
- {
- get
- {
- return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.Sealed;
- }
- }
- }
-}
diff --git a/mcs/mbas/namespace.cs b/mcs/mbas/namespace.cs
deleted file mode 100644
index d310d9a4c80..00000000000
--- a/mcs/mbas/namespace.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// namespace.cs: Tracks namespaces
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-using System;
-using System.Collections;
-using Mono.Languages;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Keeps track of the namespaces defined in the C# code.
- /// </summary>
- public class Namespace {
- Namespace parent;
- string name;
- ArrayList using_clauses;
- Hashtable aliases;
- bool decl_found = false;
-
- /// <summary>
- /// Constructor Takes the current namespace and the
- /// name. This is bootstrapped with parent == null
- /// and name = ""
- /// </summary>
- public Namespace (Namespace parent, string name)
- {
- this.name = name;
- this.parent = parent;
- }
-
- /// <summary>
- /// The qualified name of the current namespace
- /// </summary>
- public string Name {
- get {
- string pname = parent != null ? parent.Name : "";
-
- if (pname == "")
- return name;
- else
- return parent.Name + "." + name;
- }
- }
-
- /// <summary>
- /// The parent of this namespace, used by the parser to "Pop"
- /// the current namespace declaration
- /// </summary>
- public Namespace Parent {
- get {
- return parent;
- }
- }
-
- /// <summary>
- /// When a declaration is found in a namespace,
- /// we call this function, to emit an error if the
- /// program attempts to use a using clause afterwards
- /// </summary>
- public void DeclarationFound ()
- {
- decl_found = true;
- }
-
- /// <summary>
- /// Records a new namespace for resolving name references
- /// </summary>
- public void Using (string ns)
- {
- if (decl_found){
- GenericParser.error (1529, "A using clause must precede all other namespace elements");
- return;
- }
-
- if (using_clauses == null)
- using_clauses = new ArrayList ();
-
- using_clauses.Add (ns);
- }
-
- public ArrayList UsingTable {
- get {
- return using_clauses;
- }
- }
-
- public void UsingAlias (string alias, string namespace_or_type, Location loc)
- {
- if (aliases == null)
- aliases = new Hashtable ();
-
- if (aliases.Contains (alias)){
- Report.Error (1537, loc, "The using alias `" + alias +
- "' appeared previously in this namespace");
- return;
- }
-
- aliases [alias] = namespace_or_type;
- }
-
- public string LookupAlias (string alias)
- {
- string value = null;
-
- // System.Console.WriteLine ("Lookup " + alias + " in " + name);
-
- if (aliases != null)
- value = (string) (aliases [alias]);
- if (value == null && Parent != null)
- value = Parent.LookupAlias (alias);
-
- return value;
- }
-
- /// <summary>
- /// Used to validate that all the using clauses are correct
- /// after we are finished parsing all the files
- /// </summary>
- public void VerifyUsing ()
- {
- foreach (DictionaryEntry de in using_clauses){
- if (de.Value == null){
- string name = (string) de.Key;
-
- GenericParser.error (234, "The type or namespace `" +
- name + "' does not exist in the " +
- "class or namespace `" + name + "'");
- }
- }
- }
-
- }
-}
-
diff --git a/mcs/mbas/parameter.cs b/mcs/mbas/parameter.cs
deleted file mode 100644
index 9ad2daa7b6d..00000000000
--- a/mcs/mbas/parameter.cs
+++ /dev/null
@@ -1,419 +0,0 @@
-//
-// parameter.cs: Parameter definition.
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-//
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Collections;
-
-namespace Mono.CSharp {
-
-
- /// <summary>
- /// Represents a single method parameter
- /// </summary>
- public class Parameter {
- [Flags]
- public enum Modifier : byte {
- NONE = 0,
- REF = 1,
- OUT = 2,
- PARAMS = 4,
- }
-
- public readonly string TypeName;
- public readonly string Name;
- public readonly Modifier ModFlags;
- public Attributes OptAttributes;
- public Type parameter_type;
-
- public Parameter (string type, string name, Modifier mod, Attributes attrs)
- {
- Name = name;
- ModFlags = mod;
- TypeName = type;
- OptAttributes = attrs;
- }
-
- // <summary>
- // Resolve is used in method definitions
- // </summary>
- public bool Resolve (DeclSpace ds, Location l)
- {
- parameter_type = RootContext.LookupType (ds, TypeName, false, l);
- return parameter_type != null;
- }
-
- // <summary>
- // ResolveAndDefine is used by delegate declarations, because
- // they happen during the initial tree resolution process
- // </summary>
- public bool ResolveAndDefine (DeclSpace ds)
- {
- parameter_type = ds.FindType (TypeName);
- return parameter_type != null;
- }
-
- public Type ExternalType (DeclSpace ds, Location l)
- {
- if ((ModFlags & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0){
- string n = parameter_type.FullName + "&";
-
- Type t = RootContext.LookupType (ds, n, false, l);
-
- return t;
- }
-
- return parameter_type;
- }
-
- public Type ParameterType {
- get {
- return parameter_type;
- }
- }
-
- public ParameterAttributes Attributes {
- get {
- switch (ModFlags){
- case Modifier.NONE:
- return ParameterAttributes.None;
- case Modifier.REF:
- return ParameterAttributes.None;
- case Modifier.OUT:
- return ParameterAttributes.Out;
- case Modifier.PARAMS:
- return 0;
- }
-
- return ParameterAttributes.None;
- }
- }
-
- /// <summary>
- /// Returns the signature for this parameter evaluating it on the
- /// @tc context
- /// </summary>
- public string GetSignature (DeclSpace ds, Location loc)
- {
- if (parameter_type == null){
- if (!Resolve (ds, loc))
- return null;
- }
-
- return ExternalType (ds, loc).FullName;
- }
- }
-
- /// <summary>
- /// Represents the methods parameters
- /// </summary>
- public class Parameters {
- public Parameter [] FixedParameters;
- public readonly Parameter ArrayParameter;
- string signature;
- Type [] types;
- Location loc;
-
- static Parameters empty_parameters;
-
- public Parameters (Parameter [] fixed_parameters, Parameter array_parameter, Location l)
- {
- FixedParameters = fixed_parameters;
- ArrayParameter = array_parameter;
- loc = l;
- }
-
- /// <summary>
- /// This is used to reuse a set of empty parameters, because they
- /// are common
- /// </summary>
- public static Parameters GetEmptyReadOnlyParameters ()
- {
- if (empty_parameters == null)
- empty_parameters = new Parameters (null, null, Location.Null);
-
- return empty_parameters;
- }
-
- public bool Empty {
- get {
- return (FixedParameters == null) && (ArrayParameter == null);
- }
- }
-
- public void ComputeSignature (DeclSpace ds)
- {
- signature = "";
- if (FixedParameters != null){
- for (int i = 0; i < FixedParameters.Length; i++){
- Parameter par = FixedParameters [i];
-
- signature += par.GetSignature (ds, loc);
- }
- }
- //
- // Note: as per the spec, the `params' arguments (ArrayParameter)
- // are not used in the signature computation for a method
- //
- }
-
- static void error100 (string name)
- {
- Report.Error (
- 100, "The parameter name `" + name + "' is a duplicate");
- }
-
- public bool VerifyArgs ()
- {
- int count;
- int i, j;
-
- if (FixedParameters == null)
- return true;
-
- count = FixedParameters.Length;
- string array_par_name = ArrayParameter != null ? ArrayParameter.Name : null;
- for (i = 0; i < count; i++){
- string base_name = FixedParameters [i].Name;
-
- for (j = i + 1; j < count; j++){
- if (base_name != FixedParameters [j].Name)
- continue;
- error100 (base_name);
- return false;
- }
-
- if (base_name == array_par_name){
- error100 (base_name);
- return false;
- }
- }
- return true;
- }
-
- /// <summary>
- /// Returns the signature of the Parameters evaluated in
- /// the @tc environment
- /// </summary>
- public string GetSignature (DeclSpace ds)
- {
- if (signature == null){
- VerifyArgs ();
- ComputeSignature (ds);
- }
-
- return signature;
- }
-
- /// <summary>
- /// Returns the paramenter information based on the name
- /// </summary>
- public Parameter GetParameterByName (string name, out int idx)
- {
- idx = 0;
- int i = 0;
-
- if (FixedParameters != null){
- foreach (Parameter par in FixedParameters){
- if (par.Name == name){
- idx = i;
- return par;
- }
- i++;
- }
- }
-
- if (ArrayParameter != null){
- if (name == ArrayParameter.Name){
- idx = i;
- return ArrayParameter;
- }
- }
-
- return null;
- }
-
- bool ComputeParameterTypes (DeclSpace ds)
- {
- int extra = (ArrayParameter != null) ? 1 : 0;
- int i = 0;
- int pc;
-
- if (FixedParameters == null)
- pc = extra;
- else
- pc = extra + FixedParameters.Length;
-
- types = new Type [pc];
-
- if (!VerifyArgs ()){
- FixedParameters = null;
- return false;
- }
-
- bool failed = false;
- if (FixedParameters != null){
- foreach (Parameter p in FixedParameters){
- Type t = null;
-
- if (p.Resolve (ds, loc))
- t = p.ExternalType (ds, loc);
- else
- failed = true;
-
- types [i] = t;
- i++;
- }
- }
-
- if (failed)
- types = null;
-
- if (extra > 0){
- if (ArrayParameter.Resolve (ds, loc))
- types [i] = ArrayParameter.ExternalType (ds, loc);
- else
- return false;
- }
-
- return true;
- }
-
- //
- // This variant is used by Delegates, because they need to
- // resolve/define names, instead of the plain LookupType
- //
- public bool ComputeAndDefineParameterTypes (DeclSpace ds)
- {
- int extra = (ArrayParameter != null) ? 1 : 0;
- int i = 0;
- int pc;
-
- if (FixedParameters == null)
- pc = extra;
- else
- pc = extra + FixedParameters.Length;
-
- types = new Type [pc];
-
- if (!VerifyArgs ()){
- FixedParameters = null;
- return false;
- }
-
- bool ok_flag = true;
-
- if (FixedParameters != null){
- foreach (Parameter p in FixedParameters){
- Type t = null;
-
- if (p.ResolveAndDefine (ds))
- t = p.ExternalType (ds, loc);
- else
- ok_flag = false;
-
- types [i] = t;
- i++;
- }
- }
-
- if (extra > 0){
- if (ArrayParameter.ResolveAndDefine (ds))
- types [i] = ArrayParameter.ExternalType (ds, loc);
- else
- ok_flag = false;
- }
-
- //
- // invalidate the cached types
- //
- if (!ok_flag){
- types = null;
- }
-
- return ok_flag;
- }
-
- /// <summary>
- /// Returns the argument types as an array
- /// </summary>
- static Type [] no_types = new Type [0];
-
- public Type [] GetParameterInfo (DeclSpace ds)
- {
- if (types != null)
- return types;
-
- if (FixedParameters == null && ArrayParameter == null)
- return no_types;
-
- if (ComputeParameterTypes (ds) == false){
- types = null;
- return null;
- }
-
- return types;
- }
-
- /// <summary>
- /// Returns the type of a given parameter, and stores in the `is_out'
- /// boolean whether this is an out or ref parameter.
- ///
- /// Note that the returned type will not contain any dereference in this
- /// case (ie, you get "int" for a ref int instead of "int&"
- /// </summary>
- public Type GetParameterInfo (DeclSpace ds, int idx, out bool is_out)
- {
- is_out = false;
-
- if (!VerifyArgs ()){
- FixedParameters = null;
- return null;
- }
-
- if (FixedParameters == null && ArrayParameter == null)
- return null;
-
- if (types == null)
- if (ComputeParameterTypes (ds) == false){
- is_out = false;
- return null;
- }
-
- //
- // If this is a request for the variable lenght arg.
- //
- int array_idx = (FixedParameters != null ? FixedParameters.Length : 0);
- if (idx == array_idx){
- is_out = false;
- return types [idx];
- }
-
- //
- // Otherwise, it is a fixed parameter
- //
- Parameter p = FixedParameters [idx];
- is_out = ((p.ModFlags & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0);
-
- return p.ParameterType;
- }
-
- public CallingConventions GetCallingConvention ()
- {
- // For now this is the only correc thing to do
- return CallingConventions.Standard;
- }
- }
-}
-
-
-
diff --git a/mcs/mbas/pending.cs b/mcs/mbas/pending.cs
deleted file mode 100644
index 68b0cf8c7a2..00000000000
--- a/mcs/mbas/pending.cs
+++ /dev/null
@@ -1,465 +0,0 @@
-//
-// pending.cs: Pending method implementation
-//
-// Author:
-// Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001, 2002 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-
-namespace Mono.CSharp {
-
- struct TypeAndMethods {
- public Type type;
- public MethodInfo [] methods;
-
- // Far from ideal, but we want to avoid creating a copy
- // of methods above.
- public Type [][] args;
-
- //
- // This flag on the method says `We found a match, but
- // because it was private, we could not use the match
- //
- public bool [] found;
- }
-
- public class PendingImplementation {
- /// <summary>
- /// The container for this PendingImplementation
- /// </summary>
- TypeContainer container;
-
- /// <summary>
- /// This filter is used by FindMembers, and it is used to
- /// extract only virtual/abstract fields
- /// </summary>
- static MemberFilter virtual_method_filter;
-
- /// <summary>
- /// This is the array of TypeAndMethods that describes the pending implementations
- /// (both interfaces and abstract methods in parent class)
- /// </summary>
- TypeAndMethods [] pending_implementations;
-
- static bool IsVirtualFilter (MemberInfo m, object filterCriteria)
- {
- if (!(m is MethodInfo))
- return false;
-
- return ((MethodInfo) m).IsVirtual;
- }
-
- /// <summary>
- /// Inits the virtual_method_filter
- /// </summary>
- static PendingImplementation ()
- {
- virtual_method_filter = new MemberFilter (IsVirtualFilter);
- }
-
- // <remarks>
- // Returns a list of the abstract methods that are exposed by all of our
- // parents that we must implement. Notice that this `flattens' the
- // method search space, and takes into account overrides.
- // </remarks>
- static ArrayList GetAbstractMethods (Type t)
- {
- ArrayList list = null;
- bool searching = true;
- Type current_type = t;
-
- do {
- MemberInfo [] mi;
-
- mi = TypeContainer.FindMembers (
- current_type, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.DeclaredOnly,
- virtual_method_filter, null);
-
- if (current_type == TypeManager.object_type)
- searching = false;
- else {
- current_type = current_type.BaseType;
- if (!current_type.IsAbstract)
- searching = false;
- }
-
- if (mi == null)
- continue;
-
- int count = mi.Length;
- if (count == 0)
- continue;
-
- if (count == 1 && !(mi [0] is MethodBase))
- searching = false;
- else
- list = TypeManager.CopyNewMethods (list, mi);
- } while (searching);
-
- if (list == null)
- return null;
-
- for (int i = 0; i < list.Count; i++){
- while (list.Count > i && !((MethodInfo) list [i]).IsAbstract)
- list.RemoveAt (i);
- }
-
- if (list.Count == 0)
- return null;
-
- return list;
- }
-
- PendingImplementation (TypeContainer container, Type [] ifaces, ArrayList abstract_methods, int total)
- {
- TypeBuilder type_builder = container.TypeBuilder;
-
- this.container = container;
- pending_implementations = new TypeAndMethods [total];
-
- int i = 0;
- if (ifaces != null){
- foreach (Type t in ifaces){
- MethodInfo [] mi;
-
- if (t is TypeBuilder){
- Interface iface;
-
- iface = TypeManager.LookupInterface (t);
-
- mi = iface.GetMethods ();
- } else
- mi = t.GetMethods ();
-
- int count = mi.Length;
- pending_implementations [i].type = t;
- pending_implementations [i].methods = mi;
- pending_implementations [i].args = new Type [count][];
- pending_implementations [i].found = new bool [count];
-
- int j = 0;
- foreach (MethodInfo m in mi){
- Type [] types = TypeManager.GetArgumentTypes (m);
-
- pending_implementations [i].args [j] = types;
- j++;
- }
- i++;
- }
- }
-
- if (abstract_methods != null){
- int count = abstract_methods.Count;
- pending_implementations [i].methods = new MethodInfo [count];
-
- abstract_methods.CopyTo (pending_implementations [i].methods, 0);
- pending_implementations [i].found = new bool [count];
- pending_implementations [i].args = new Type [count][];
- pending_implementations [i].type = type_builder;
-
- int j = 0;
- foreach (MemberInfo m in abstract_methods){
- MethodInfo mi = (MethodInfo) m;
-
- Type [] types = TypeManager.GetArgumentTypes (mi);
-
- pending_implementations [i].args [j] = types;
- j++;
- }
- }
- }
-
- //
- // Factory method: if there are pending implementation methods, we return a PendingImplementation
- // object, otherwise we return null.
- //
- // Register method implementations are either abstract methods
- // flagged as such on the base class or interface methods
- //
- static public PendingImplementation GetPendingImplementations (TypeContainer container)
- {
- TypeBuilder type_builder = container.TypeBuilder;
- Type [] ifaces;
- Type b = type_builder.BaseType;
- int icount = 0;
-
- //
- // Notice that TypeBuilders will only return the interfaces that the Type
- // is supposed to implement, not all the interfaces that the type implements.
- //
- // Completely broken. Anyways, we take advantage of this, so we only register
- // the implementations that we need, as they are those that are listed by the
- // TypeBuilder.
- //
- ifaces = type_builder.GetInterfaces ();
-#if DEBUG
- {
- Type x = type_builder;
-
- while (x != null){
- Type [] iff = x.GetInterfaces ();
- Console.WriteLine ("Type: " + x.Name);
-
- foreach (Type tt in iff){
- Console.WriteLine (" Iface: " + tt.Name);
- }
- x = x.BaseType;
- }
- }
-#endif
-
- icount = ifaces.Length;
-
- //
- // If we are implementing an abstract class, and we are not
- // ourselves abstract, and there are abstract methods (C# allows
- // abstract classes that have no abstract methods), then allocate
- // one slot.
- //
- // We also pre-compute the methods.
- //
- bool implementing_abstract = ((b != null) && b.IsAbstract && !type_builder.IsAbstract);
- ArrayList abstract_methods = null;
-
- if (implementing_abstract){
- abstract_methods = GetAbstractMethods (b);
-
- if (abstract_methods == null)
- implementing_abstract = false;
- }
-
- int total = icount + (implementing_abstract ? 1 : 0);
- if (total == 0)
- return null;
-
- return new PendingImplementation (container, ifaces, abstract_methods, total);
- }
-
- public enum Operation {
- //
- // If you change this, review the whole InterfaceMethod routine as there
- // are a couple of assumptions on these three states
- //
- Lookup, ClearOne, ClearAll
- }
-
- /// <summary>
- /// Whether the specified method is an interface method implementation
- /// </summary>
- public MethodInfo IsInterfaceMethod (Type t, string name, Type ret_type, Type [] args)
- {
- return InterfaceMethod (t, name, ret_type, args, Operation.Lookup);
- }
-
- public void ImplementMethod (Type t, string name, Type ret_type, Type [] args, bool clear_one)
- {
- InterfaceMethod (t, name, ret_type, args, clear_one ? Operation.ClearOne : Operation.ClearAll);
- }
-
- /// <remarks>
- /// If a method in Type `t' (or null to look in all interfaces
- /// and the base abstract class) with name `Name', return type `ret_type' and
- /// arguments `args' implements an interface, this method will
- /// return the MethodInfo that this method implements.
- ///
- /// The `Operation op' controls whether to lookup, clear the pending bit, or clear
- /// all the methods with the given signature.
- /// </remarks>
- public MethodInfo InterfaceMethod (Type t, string name, Type ret_type, Type [] args, Operation op)
- {
- int arg_len = args.Length;
-
- if (pending_implementations == null)
- return null;
-
- foreach (TypeAndMethods tm in pending_implementations){
- if (!(t == null || tm.type == t))
- continue;
-
- int i = 0;
- foreach (MethodInfo m in tm.methods){
- if (m == null){
- i++;
- continue;
- }
-
- if (name != m.Name){
- i++;
- continue;
- }
-
- if (ret_type != m.ReturnType){
- if (!((ret_type == null && m.ReturnType == TypeManager.void_type) ||
- (m.ReturnType == null && ret_type == TypeManager.void_type)))
- {
- i++;
- continue;
- }
- }
-
- //
- // Check if we have the same parameters
- //
- if (tm.args [i].Length != arg_len){
- i++;
- continue;
- }
-
- int j, top = args.Length;
- bool fail = false;
-
- for (j = 0; j < top; j++){
- if (tm.args [i][j] != args[j]){
- fail = true;
- break;
- }
- }
- if (fail){
- i++;
- continue;
- }
-
- if (op != Operation.Lookup)
- tm.methods [i] = null;
- tm.found [i] = true;
-
- //
- // Lookups and ClearOne return
- //
- if (op != Operation.ClearAll)
- return m;
- }
-
- // If a specific type was requested, we can stop now.
- if (tm.type == t)
- return null;
- }
- return null;
- }
-
- /// <summary>
- /// C# allows this kind of scenarios:
- /// interface I { void M (); }
- /// class X { public void M (); }
- /// class Y : X, I { }
- ///
- /// For that case, we create an explicit implementation function
- /// I.M in Y.
- /// </summary>
- void DefineProxy (Type iface, MethodInfo parent_method, MethodInfo iface_method,
- Type [] args)
- {
- MethodBuilder proxy;
-
- string proxy_name = iface.Name + "." + iface_method.Name;
-
- proxy = container.TypeBuilder.DefineMethod (
- proxy_name,
- MethodAttributes.HideBySig |
- MethodAttributes.NewSlot |
- MethodAttributes.Virtual,
- CallingConventions.Standard | CallingConventions.HasThis,
- parent_method.ReturnType, args);
-
- int top = args.Length;
- ILGenerator ig = proxy.GetILGenerator ();
-
- ig.Emit (OpCodes.Ldarg_0);
- for (int i = 0; i < top; i++){
- switch (i){
- case 0:
- ig.Emit (OpCodes.Ldarg_1); break;
- case 1:
- ig.Emit (OpCodes.Ldarg_2); break;
- case 2:
- ig.Emit (OpCodes.Ldarg_3); break;
- default:
- ig.Emit (OpCodes.Ldarg, i - 1); break;
- }
- }
- ig.Emit (OpCodes.Call, parent_method);
- ig.Emit (OpCodes.Ret);
-
- container.TypeBuilder.DefineMethodOverride (proxy, iface_method);
- }
-
- /// <summary>
- /// This function tells whether one of our parent classes implements
- /// the given method (which turns out, it is valid to have an interface
- /// implementation in a parent
- /// </summary>
- bool ParentImplements (Type iface_type, MethodInfo mi)
- {
- MethodSignature ms;
-
- Type [] args = TypeManager.GetArgumentTypes (mi);
- ms = new MethodSignature (mi.Name, mi.ReturnType, args);
- MemberInfo [] list = TypeContainer.FindMembers (
- container.TypeBuilder.BaseType, MemberTypes.Method | MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- MethodSignature.method_signature_filter, ms);
-
- if (list == null || list.Length == 0)
- return false;
-
- DefineProxy (iface_type, (MethodInfo) list [0], mi, args);
- return true;
- }
-
- /// <summary>
- /// Verifies that any pending abstract methods or interface methods
- /// were implemented.
- /// </summary>
- public bool VerifyPendingMethods ()
- {
- int top = pending_implementations.Length;
- bool errors = false;
- int i;
-
- for (i = 0; i < top; i++){
- Type type = pending_implementations [i].type;
- int j = 0;
-
- foreach (MethodInfo mi in pending_implementations [i].methods){
- if (mi == null)
- continue;
-
- if (type.IsInterface){
- if (ParentImplements (type, mi))
- continue;
-
- string extra = "";
-
- if (pending_implementations [i].found [j])
- extra = ". (method might be private or static)";
- Report.Error (
- 536, container.Location,
- "`" + container.Name + "' does not implement " +
- "interface member `" +
- type.FullName + "." + mi.Name + "'" + extra);
- } else {
- Report.Error (
- 534, container.Location,
- "`" + container.Name + "' does not implement " +
- "inherited abstract member `" +
- type.FullName + "." + mi.Name + "'");
- }
- errors = true;
- j++;
- }
- }
- return errors;
- }
- } /* end of class */
-}
diff --git a/mcs/mbas/report.cs b/mcs/mbas/report.cs
deleted file mode 100644
index 0ffc2dfc188..00000000000
--- a/mcs/mbas/report.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-//
-// report.cs: report errors and warnings.
-//
-// Author: Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc. (http://www.ximian.com)
-//
-
-//
-// FIXME: currently our class library does not support custom number format strings
-//
-using System;
-using System.Collections;
-using System.Diagnostics;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// This class is used to report errors and warnings t te user.
- /// </summary>
- public class Report {
- /// <summary>
- /// Errors encountered so far
- /// </summary>
- static public int Errors;
-
- /// <summary>
- /// Warnings encountered so far
- /// </summary>
- static public int Warnings;
-
- /// <summary>
- /// Whether errors should be throw an exception
- /// </summary>
- static public bool Fatal;
-
- /// <summary>
- /// Whether warnings should be considered errors
- /// </summary>
- static public bool WarningsAreErrors;
-
- /// <summary>
- /// Whether to dump a stack trace on errors.
- /// </summary>
- static public bool Stacktrace;
-
- //
- // If the error code is reported on the given line,
- // then the process exits with a unique error code.
- //
- // Used for the test suite to excercise the error codes
- //
- static int probe_error = 0;
-
- //
- // Keeps track of the warnings that we are ignoring
- //
- static Hashtable warning_ignore_table;
-
- static void Check (int code)
- {
- if (code == probe_error){
- if (Fatal)
- throw new Exception ();
-
- Environment.Exit (123);
- }
- }
-
- static public void RealError (string msg)
- {
- Errors++;
- Console.WriteLine (msg);
-
- if (Stacktrace)
- Console.WriteLine (new StackTrace ().ToString ());
- if (Fatal)
- throw new Exception (msg);
- }
-
- static public void Error (int code, Location l, string text)
- {
- string msg = String.Format (
- "{0}({1}) error CS{2:0000}: {3}", l.Name, l.Row, code, text);
-// "{0}({1}) error CS{2}: {3}", l.Name, l.Row, code, text);
-
- RealError (msg);
- Check (code);
- }
-
- static public void Warning (int code, Location l, string text)
- {
- if (warning_ignore_table != null){
- if (warning_ignore_table.Contains (code))
- return;
- }
-
- if (WarningsAreErrors)
- Error (code, l, text);
- else {
- string row;
-
- if (Location.IsNull (l))
- row = "";
- else
- row = l.Row.ToString ();
-
- Console.WriteLine (String.Format (
- "{0}({1}) warning CS{2:0000}: {3}",
-// "{0}({1}) warning CS{2}: {3}",
- l.Name, row, code, text));
- Warnings++;
- Check (code);
-
- if (Stacktrace)
- Console.WriteLine (new StackTrace ().ToString ());
- }
- }
-
- static public void Warning (int code, string text)
- {
- Warning (code, Location.Null, text);
- }
-
- static public void Error (int code, string text)
- {
- string msg = String.Format ("error CS{0:0000}: {1}", code, text);
-// string msg = String.Format ("error CS{0}: {1}", code, text);
-
- RealError (msg);
- Check (code);
- }
-
- static public void Message (Message m)
- {
- if (m is ErrorMessage)
- Error (m.code, m.text);
- else
- Warning (m.code, m.text);
- }
-
- static public void SetIgnoreWarning (int code)
- {
- if (warning_ignore_table == null)
- warning_ignore_table = new Hashtable ();
-
- warning_ignore_table [code] = true;
- }
-
- static public void SetProbe (int code)
- {
- probe_error = code;
- }
-
- static public int ProbeCode {
- get {
- return probe_error;
- }
- }
- }
-
- public class Message {
- public int code;
- public string text;
-
- public Message (int code, string text)
- {
- this.code = code;
- this.text = text;
- }
- }
-
- public class WarningMessage : Message {
- public WarningMessage (int code, string text) : base (code, text)
- {
- }
- }
-
- public class ErrorMessage : Message {
- public ErrorMessage (int code, string text) : base (code, text)
- {
- }
-
- //
- // For compatibility reasons with old code.
- //
- public static void report_error (string error)
- {
- Console.Write ("ERROR: ");
- Console.WriteLine (error);
- }
- }
-}
-
-
diff --git a/mcs/mbas/rootcontext.cs b/mcs/mbas/rootcontext.cs
deleted file mode 100644
index a705cc9e9d8..00000000000
--- a/mcs/mbas/rootcontext.cs
+++ /dev/null
@@ -1,773 +0,0 @@
-//
-// rootcontext.cs: keeps track of our tree representation, and assemblies loaded.
-//
-// Author: Miguel de Icaza (miguel@ximian.com)
-// Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics;
-
-namespace Mono.CSharp {
-
- public class RootContext {
-
- //
- // Contains the parsed tree
- //
- static Tree tree;
-
- //
- // This hashtable contains all of the #definitions across the source code
- // it is used by the ConditionalAttribute handler.
- //
- public static Hashtable AllDefines = new Hashtable ();
-
- //
- // The list of global attributes (those that target the assembly)
- //
- static Hashtable global_attributes = new Hashtable ();
-
- //
- // Whether we are being linked against the standard libraries.
- // This is only used to tell whether `System.Object' should
- // have a parent or not.
- //
- public static bool StdLib = true;
-
- //
- // This keeps track of the order in which classes were defined
- // so that we can poulate them in that order.
- //
- // Order is important, because we need to be able to tell by
- // examining the parent's list of methods which ones are virtual
- // or abstract as well as the parent names (to implement new,
- // override).
- //
- static ArrayList type_container_resolve_order;
- static ArrayList interface_resolve_order;
- static ArrayList attribute_types;
-
- //
- // Holds a reference to the Private Implementation Details
- // class.
- //
- static TypeBuilder impl_details_class;
-
- public static int WarningLevel = 2;
-
- //
- // Constructor
- //
- static RootContext ()
- {
- tree = new Tree ();
- interface_resolve_order = new ArrayList ();
- type_container_resolve_order = new ArrayList ();
- }
-
- static public Tree Tree {
- get {
- return tree;
- }
- }
-
- static public string MainClass;
-
- public static void RegisterOrder (Interface iface)
- {
- interface_resolve_order.Add (iface);
- }
-
- public static void RegisterOrder (TypeContainer tc)
- {
- type_container_resolve_order.Add (tc);
- }
-
- public static void RegisterAttribute (TypeContainer tc)
- {
- if (attribute_types == null)
- attribute_types = new ArrayList ();
-
- attribute_types.Add (tc);
- }
-
- //
- // The default compiler checked state
- //
- static public bool Checked = false;
-
- //
- // Whether to allow Unsafe code
- //
- static public bool Unsafe = false;
-
- static string MakeFQN (string nsn, string name)
- {
- string prefix = (nsn == "" ? "" : nsn + ".");
-
- return prefix + name;
- }
-
- // <remarks>
- // This function is used to resolve the hierarchy tree.
- // It processes interfaces, structs and classes in that order.
- //
- // It creates the TypeBuilder's as it processes the user defined
- // types.
- // </remarks>
- static public void ResolveTree ()
- {
- //
- // Process the attribute types separately and before anything else
- //
- if (attribute_types != null)
- foreach (TypeContainer tc in attribute_types)
- tc.DefineType ();
-
- //
- // Interfaces are processed next, as classes and
- // structs might inherit from an object or implement
- // a set of interfaces, we need to be able to tell
- // them appart by just using the TypeManager.
- //
- TypeContainer root = Tree.Types;
-
- ArrayList ifaces = root.Interfaces;
- if (ifaces != null){
- foreach (Interface i in ifaces)
- i.DefineType ();
- }
-
-
- foreach (TypeContainer tc in root.Types)
- tc.DefineType ();
-
- if (root.Delegates != null)
- foreach (Delegate d in root.Delegates)
- d.DefineType ();
-
- if (root.Enums != null)
- foreach (Enum e in root.Enums)
- e.DefineType ();
-
- }
-
- static void Error_TypeConflict (string name, Location loc)
- {
- Report.Error (
- 520, loc, "`" + name + "' conflicts with a predefined type");
- }
-
- static void Error_TypeConflict (string name)
- {
- Report.Error (
- 520, "`" + name + "' conflicts with a predefined type");
- }
-
- //
- // Resolves a single class during the corlib bootstrap process
- //
- static TypeBuilder BootstrapCorlib_ResolveClass (TypeContainer root, string name)
- {
- object o = root.GetDefinition (name);
- if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
- return null;
- }
-
- if (!(o is Class)){
- if (o is DeclSpace){
- DeclSpace d = (DeclSpace) o;
-
- Error_TypeConflict (name, d.Location);
- } else
- Error_TypeConflict (name);
-
- return null;
- }
-
- return ((DeclSpace) o).DefineType ();
- }
-
- //
- // Resolves a struct during the corlib bootstrap process
- //
- static void BootstrapCorlib_ResolveStruct (TypeContainer root, string name)
- {
- object o = root.GetDefinition (name);
- if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
- return;
- }
-
- if (!(o is Struct)){
- if (o is DeclSpace){
- DeclSpace d = (DeclSpace) o;
-
- Error_TypeConflict (name, d.Location);
- } else
- Error_TypeConflict (name);
-
- return;
- }
-
- ((DeclSpace) o).DefineType ();
- }
-
- //
- // Resolves a struct during the corlib bootstrap process
- //
- static void BootstrapCorlib_ResolveInterface (TypeContainer root, string name)
- {
- object o = root.GetDefinition (name);
- if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
- return;
- }
-
- if (!(o is Interface)){
- if (o is DeclSpace){
- DeclSpace d = (DeclSpace) o;
-
- Error_TypeConflict (name, d.Location);
- } else
- Error_TypeConflict (name);
-
- return;
- }
-
- ((DeclSpace) o).DefineType ();
- }
-
- //
- // Resolves a delegate during the corlib bootstrap process
- //
- static void BootstrapCorlib_ResolveDelegate (TypeContainer root, string name)
- {
- object o = root.GetDefinition (name);
- if (o == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined");
- Environment.Exit (0);
- }
-
- if (!(o is Delegate)){
- Error_TypeConflict (name);
- return;
- }
-
- ((DeclSpace) o).DefineType ();
- }
-
-
- /// <summary>
- /// Resolves the core types in the compiler when compiling with --nostdlib
- /// </summary>
- static public void ResolveCore ()
- {
- TypeContainer root = Tree.Types;
-
- TypeManager.object_type = BootstrapCorlib_ResolveClass (root, "System.Object");
- TypeManager.value_type = BootstrapCorlib_ResolveClass (root, "System.ValueType");
- TypeManager.attribute_type = BootstrapCorlib_ResolveClass (root, "System.Attribute");
-
- string [] interfaces_first_stage = {
- "System.IComparable", "System.ICloneable",
- "System.IConvertible",
-
- "System.Collections.IEnumerable",
- "System.Collections.ICollection",
- "System.Collections.IEnumerator",
- "System.Collections.IList",
- "System.IAsyncResult",
- "System.IDisposable",
-
- "System.Runtime.Serialization.ISerializable",
-
- "System.Reflection.IReflect",
- "System.Reflection.ICustomAttributeProvider"
- };
-
- foreach (string iname in interfaces_first_stage)
- BootstrapCorlib_ResolveInterface (root, iname);
-
- //
- // These are the base value types
- //
- string [] structs_first_stage = {
- "System.Byte", "System.SByte",
- "System.Int16", "System.UInt16",
- "System.Int32", "System.UInt32",
- "System.Int64", "System.UInt64",
- };
-
- foreach (string cname in structs_first_stage)
- BootstrapCorlib_ResolveStruct (root, cname);
-
- //
- // Now, we can load the enumerations, after this point,
- // we can use enums.
- //
- TypeManager.InitEnumUnderlyingTypes ();
-
- string [] structs_second_stage = {
- "System.Single", "System.Double",
- "System.Char", "System.Boolean",
- "System.Decimal", "System.Void",
- "System.RuntimeFieldHandle",
- "System.RuntimeTypeHandle",
- "System.IntPtr"
- };
-
- foreach (string cname in structs_second_stage)
- BootstrapCorlib_ResolveStruct (root, cname);
-
- //
- // These are classes that depends on the core interfaces
- //
- string [] classes_second_stage = {
- "System.String", "System.Enum",
- "System.Array", "System.MulticastDelegate",
- "System.Delegate",
-
- "System.Reflection.MemberInfo",
- "System.Type",
-
- //
- // These are not really important in the order, but they
- // are used by the compiler later on (typemanager/CoreLookupType-d)
- //
- "System.Runtime.CompilerServices.RuntimeHelpers",
- "System.Reflection.DefaultMemberAttribute",
- "System.Threading.Monitor",
-
- "System.AttributeUsageAttribute",
- "System.Runtime.InteropServices.DllImportAttribute",
- "System.Runtime.CompilerServices.MethodImplAttribute",
- "System.Runtime.InteropServices.MarshalAsAttribute",
- "System.Diagnostics.ConditionalAttribute",
- "System.ObsoleteAttribute",
- "System.ParamArrayAttribute",
- "System.Security.UnverifiableCodeAttribute",
- "System.Runtime.CompilerServices.IndexerNameAttribute",
- };
-
- foreach (string cname in classes_second_stage)
- BootstrapCorlib_ResolveClass (root, cname);
-
- BootstrapCorlib_ResolveDelegate (root, "System.AsyncCallback");
- }
-
- // <summary>
- // Closes all open types
- // </summary>
- //
- // <remarks>
- // We usually use TypeBuilder types. When we are done
- // creating the type (which will happen after we have added
- // methods, fields, etc) we need to "Define" them before we
- // can save the Assembly
- // </remarks>
- static public void CloseTypes ()
- {
- TypeContainer root = Tree.Types;
-
- ArrayList ifaces = root.Interfaces;
-
- if (root.Enums != null)
- foreach (Enum en in root.Enums)
- en.CloseType ();
-
- if (attribute_types != null)
- foreach (TypeContainer tc in attribute_types)
- tc.CloseType ();
-
- foreach (Interface iface in interface_resolve_order)
- iface.CloseType ();
-
- //
- // We do this in two passes, first we close the structs,
- // then the classes, because it seems the code needs it this
- // way. If this is really what is going on, we should probably
- // make sure that we define the structs in order as well.
- //
- foreach (TypeContainer tc in type_container_resolve_order){
- if (tc is Struct && tc.Parent == tree.Types){
- tc.CloseType ();
- }
- }
-
- foreach (TypeContainer tc in type_container_resolve_order){
- if (!(tc is Struct && tc.Parent == tree.Types))
- tc.CloseType ();
- }
-
- if (root.Delegates != null)
- foreach (Delegate d in root.Delegates)
- d.CloseDelegate ();
-
-
- //
- // If we have a <PrivateImplementationDetails> class, close it
- //
- if (impl_details_class != null){
- impl_details_class.CreateType ();
- }
- }
-
- //
- // This idea is from Felix Arrese-Igor
- //
- // Returns : the implicit parent of a composite namespace string
- // eg. Implicit parent of A.B is A
- //
- static public string ImplicitParent (string ns)
- {
- int i = ns.LastIndexOf (".");
- if (i < 0)
- return null;
-
- return ns.Substring (0, i);
- }
-
- static Type NamespaceLookup (Namespace curr_ns, string name)
- {
- Type t;
-
- //
- // Try in the current namespace and all its implicit parents
- //
- for (string ns = curr_ns.Name; ns != null; ns = ImplicitParent (ns)) {
- t = TypeManager.LookupType (MakeFQN (ns, name));
- if (t != null)
- return t;
- }
-
- //
- // It's possible that name already is fully qualified. So we do
- // a simple direct lookup without adding any namespace names
- //
- t = TypeManager.LookupType (name);
- if (t != null)
- return t;
-
- //
- // Try the aliases in the current namespace
- //
- string alias = curr_ns.LookupAlias (name);
-
- if (alias != null) {
- t = TypeManager.LookupType (alias);
- if (t != null)
- return t;
-
- t = TypeManager.LookupType (MakeFQN (alias, name));
- if (t != null)
- return t;
- }
-
- for (Namespace ns = curr_ns; ns != null; ns = ns.Parent) {
- //
- // Look in the namespace ns
- //
- t = TypeManager.LookupType (MakeFQN (ns.Name, name));
- if (t != null)
- return t;
-
- //
- // Then try with the using clauses
- //
- ArrayList using_list = ns.UsingTable;
-
- if (using_list == null)
- continue;
-
- foreach (string n in using_list) {
- t = TypeManager.LookupType (MakeFQN (n, name));
- if (t != null)
- return t;
- }
-
- //
- // Try with aliases
- //
- string a = ns.LookupAlias (name);
- if (a != null) {
- t = TypeManager.LookupType (a);
- if (t != null)
- return t;
-
- t = TypeManager.LookupType (MakeFQN (a, name));
- if (t != null)
- return t;
- }
- }
-
- return null;
- }
-
- //
- // Public function used to locate types, this can only
- // be used after the ResolveTree function has been invoked.
- //
- // Returns: Type or null if they type can not be found.
- //
- // Come to think of it, this should be a DeclSpace
- //
- static public Type LookupType (DeclSpace ds, string name, bool silent, Location loc)
- {
- Type t;
-
- if (ds.Cache.Contains (name)){
- t = (Type) ds.Cache [name];
- if (t != null)
- return t;
- } else {
- //
- // For the case the type we are looking for is nested within this one
- // or is in any base class
- //
- DeclSpace containing_ds = ds;
- while (containing_ds != null){
- Type current_type = containing_ds.TypeBuilder;
-
- while (current_type != null) {
- //
- // nested class
- //
- t = TypeManager.LookupType (current_type.FullName + "+" + name);
- if (t != null){
- ds.Cache [name] = t;
- return t;
- }
-
- current_type = current_type.BaseType;
- }
-
- containing_ds = containing_ds.Parent;
- }
-
- t = NamespaceLookup (ds.Namespace, name);
- if (t != null){
- ds.Cache [name] = t;
- return t;
- }
- }
-
- if (!silent)
- Report.Error (246, loc, "Cannot find type `"+name+"'");
-
- return null;
- }
-
- // <summary>
- // This is the silent version of LookupType, you can use this
- // to `probe' for a type
- // </summary>
- static public Type LookupType (TypeContainer tc, string name, Location loc)
- {
- return LookupType (tc, name, true, loc);
- }
-
- static public bool IsNamespace (string name)
- {
- Namespace ns;
-
- if (tree.Namespaces != null){
- ns = (Namespace) tree.Namespaces [name];
-
- if (ns != null)
- return true;
- }
-
- return false;
- }
-
- static void Report1530 (Location loc)
- {
- Report.Error (1530, loc, "Keyword new not allowed for namespace elements");
- }
-
- static public void PopulateCoreType (TypeContainer root, string name)
- {
- DeclSpace ds = (DeclSpace) root.GetDefinition (name);
-
- ds.Define (root);
- }
-
- static public void BootCorlib_PopulateCoreTypes ()
- {
- TypeContainer root = tree.Types;
-
- PopulateCoreType (root, "System.Object");
- PopulateCoreType (root, "System.ValueType");
- PopulateCoreType (root, "System.Attribute");
- }
-
- // <summary>
- // Populates the structs and classes with fields and methods
- // </summary>
- //
- // This is invoked after all interfaces, structs and classes
- // have been defined through `ResolveTree'
- static public void PopulateTypes ()
- {
- TypeContainer root = Tree.Types;
-
- if (attribute_types != null)
- foreach (TypeContainer tc in attribute_types)
- tc.Define (root);
-
- if (interface_resolve_order != null){
- foreach (Interface iface in interface_resolve_order)
- if ((iface.ModFlags & Modifiers.NEW) == 0)
- iface.Define (root);
- else
- Report1530 (iface.Location);
- }
-
-
- if (type_container_resolve_order != null){
- foreach (TypeContainer tc in type_container_resolve_order)
- if ((tc.ModFlags & Modifiers.NEW) == 0)
- tc.Define (root);
- else
- Report1530 (tc.Location);
- }
-
- ArrayList delegates = root.Delegates;
- if (delegates != null){
- foreach (Delegate d in delegates)
- if ((d.ModFlags & Modifiers.NEW) == 0)
- d.Define (root);
- else
- Report1530 (d.Location);
- }
-
- ArrayList enums = root.Enums;
- if (enums != null){
- foreach (Enum en in enums)
- if ((en.ModFlags & Modifiers.NEW) == 0)
- en.Define (root);
- else
- Report1530 (en.Location);
- }
- }
-
- static public void EmitCode ()
- {
- //
- // Because of the strange way in which we do things, global
- // attributes must be processed first.
- //
- if (global_attributes.Count > 0){
- AssemblyBuilder ab = CodeGen.AssemblyBuilder;
- TypeContainer dummy = new TypeContainer (null, "", new Location (-1));
- EmitContext temp_ec = new EmitContext (
- dummy, Mono.CSharp.Location.Null, null, null, 0, false);
-
- foreach (DictionaryEntry de in global_attributes){
- Namespace ns = (Namespace) de.Key;
- Attributes attrs = (Attributes) de.Value;
-
- dummy.Namespace = ns;
- Attribute.ApplyAttributes (temp_ec, ab, ab, attrs, attrs.Location);
- }
- }
-
- if (attribute_types != null)
- foreach (TypeContainer tc in attribute_types)
- tc.Emit ();
-
- if (type_container_resolve_order != null) {
- foreach (TypeContainer tc in type_container_resolve_order)
- tc.EmitConstants ();
-
- foreach (TypeContainer tc in type_container_resolve_order)
- tc.Emit ();
- }
-
- if (Unsafe) {
- ConstructorInfo ci = TypeManager.unverifiable_code_type.GetConstructor (new Type [0]);
-
- if (ci == null) {
- Console.WriteLine ("Internal error !");
- return;
- }
-
- CustomAttributeBuilder cb = new CustomAttributeBuilder (ci, new object [0]);
- CodeGen.ModuleBuilder.SetCustomAttribute (cb);
- }
- }
-
- //
- // Public Field, used to track which method is the public entry
- // point.
- //
- static public MethodInfo EntryPoint;
-
- //
- // Track the location of the entry point.
- //
- static public Location EntryPointLocation;
-
- //
- // These are used to generate unique names on the structs and fields.
- //
- static int field_count;
-
- //
- // Makes an initialized struct, returns the field builder that
- // references the data. Thanks go to Sergey Chaban for researching
- // how to do this. And coming up with a shorter mechanism than I
- // was able to figure out.
- //
- // This works but makes an implicit public struct $ArrayType$SIZE and
- // makes the fields point to it. We could get more control if we did
- // use instead:
- //
- // 1. DefineNestedType on the impl_details_class with our struct.
- //
- // 2. Define the field on the impl_details_class
- //
- static public FieldBuilder MakeStaticData (byte [] data)
- {
- FieldBuilder fb;
- int size = data.Length;
-
- if (impl_details_class == null)
- impl_details_class = CodeGen.ModuleBuilder.DefineType (
- "<PrivateImplementationDetails>", TypeAttributes.NotPublic);
-
- fb = impl_details_class.DefineInitializedData (
- "$$field-" + (field_count++), data,
- FieldAttributes.Static | FieldAttributes.Assembly);
-
- return fb;
- }
-
- //
- // Adds a global attribute that was declared in `container',
- // the attribute is in `attr', and it was defined at `loc'
- //
- static public void AddGlobalAttribute (TypeContainer container,
- AttributeSection attr, Location loc)
- {
- Namespace ns = container.Namespace;
- Attributes a = (Attributes) global_attributes [ns];
-
- if (a == null)
- global_attributes [ns] = new Attributes (attr, loc);
- else
- a.AddAttribute (attr);
- }
- }
-}
-
-
diff --git a/mcs/mbas/statement.cs b/mcs/mbas/statement.cs
deleted file mode 100644
index eadde1f62de..00000000000
--- a/mcs/mbas/statement.cs
+++ /dev/null
@@ -1,3141 +0,0 @@
-//
-// statement.cs: Statement representation for the IL tree.
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001, 2002 Ximian, Inc.
-//
-
-using System;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Diagnostics;
-
-namespace Mono.CSharp {
-
- using System.Collections;
-
- public abstract class Statement {
- public Location loc;
-
- ///
- /// Resolves the statement, true means that all sub-statements
- /// did resolve ok.
- //
- public virtual bool Resolve (EmitContext ec)
- {
- return true;
- }
-
- /// <summary>
- /// Return value indicates whether all code paths emitted return.
- /// </summary>
- public abstract bool Emit (EmitContext ec);
-
- public static Expression ResolveBoolean (EmitContext ec, Expression e, Location loc)
- {
- e = e.Resolve (ec);
- if (e == null)
- return null;
-
- if (e.Type != TypeManager.bool_type){
- e = Expression.ConvertImplicit (ec, e, TypeManager.bool_type,
- new Location (-1));
- }
-
- if (e == null){
- Report.Error (
- 31, loc, "Can not convert the expression to a boolean");
- }
-
- if (CodeGen.SymbolWriter != null)
- ec.Mark (loc);
-
- return e;
- }
-
- /// <remarks>
- /// Emits a bool expression.
- /// </remarks>
- public static void EmitBoolExpression (EmitContext ec, Expression bool_expr,
- Label target, bool isTrue)
- {
- ILGenerator ig = ec.ig;
-
- bool invert = false;
- if (bool_expr is Unary){
- Unary u = (Unary) bool_expr;
-
- if (u.Oper == Unary.Operator.LogicalNot){
- invert = true;
-
- u.EmitLogicalNot (ec);
- }
- }
-
- if (!invert)
- bool_expr.Emit (ec);
-
- if (isTrue){
- if (invert)
- ig.Emit (OpCodes.Brfalse, target);
- else
- ig.Emit (OpCodes.Brtrue, target);
- } else {
- if (invert)
- ig.Emit (OpCodes.Brtrue, target);
- else
- ig.Emit (OpCodes.Brfalse, target);
- }
- }
-
- public static void Warning_DeadCodeFound (Location loc)
- {
- Report.Warning (162, loc, "Unreachable code detected");
- }
- }
-
- public class EmptyStatement : Statement {
- public override bool Resolve (EmitContext ec)
- {
- return true;
- }
-
- public override bool Emit (EmitContext ec)
- {
- return false;
- }
- }
-
- public class If : Statement {
- Expression expr;
- public Statement TrueStatement;
- public Statement FalseStatement;
-
- public If (Expression expr, Statement trueStatement, Location l)
- {
- this.expr = expr;
- TrueStatement = trueStatement;
- loc = l;
- }
-
- public If (Expression expr,
- Statement trueStatement,
- Statement falseStatement,
- Location l)
- {
- this.expr = expr;
- TrueStatement = trueStatement;
- FalseStatement = falseStatement;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- expr = ResolveBoolean (ec, expr, loc);
- if (expr == null){
- return false;
- }
-
- if (TrueStatement.Resolve (ec)){
- if (FalseStatement != null){
- if (FalseStatement.Resolve (ec))
- return true;
-
- return false;
- }
- return true;
- }
- return false;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label false_target = ig.DefineLabel ();
- Label end;
- bool is_true_ret, is_false_ret;
-
- //
- // Dead code elimination
- //
- if (expr is BoolConstant){
- bool take = ((BoolConstant) expr).Value;
-
- if (take){
- if (FalseStatement != null){
- Warning_DeadCodeFound (FalseStatement.loc);
- }
- return TrueStatement.Emit (ec);
- } else {
- Warning_DeadCodeFound (TrueStatement.loc);
- if (FalseStatement != null)
- return FalseStatement.Emit (ec);
- }
- }
-
- EmitBoolExpression (ec, expr, false_target, false);
-
- is_true_ret = TrueStatement.Emit (ec);
- is_false_ret = is_true_ret;
-
- if (FalseStatement != null){
- bool branch_emitted = false;
-
- end = ig.DefineLabel ();
- if (!is_true_ret){
- ig.Emit (OpCodes.Br, end);
- branch_emitted = true;
- }
-
- ig.MarkLabel (false_target);
- is_false_ret = FalseStatement.Emit (ec);
-
- if (branch_emitted)
- ig.MarkLabel (end);
- } else {
- ig.MarkLabel (false_target);
- is_false_ret = false;
- }
-
- return is_true_ret && is_false_ret;
- }
- }
-
- public class Do : Statement {
- public Expression expr;
- public readonly Statement EmbeddedStatement;
-
- public Do (Statement statement, Expression boolExpr, Location l)
- {
- expr = boolExpr;
- EmbeddedStatement = statement;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- expr = ResolveBoolean (ec, expr, loc);
- if (expr == null)
- return false;
-
- return EmbeddedStatement.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label loop = ig.DefineLabel ();
- Label old_begin = ec.LoopBegin;
- Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
-
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- ig.MarkLabel (loop);
- EmbeddedStatement.Emit (ec);
- ig.MarkLabel (ec.LoopBegin);
-
- //
- // Dead code elimination
- //
- if (expr is BoolConstant){
- bool res = ((BoolConstant) expr).Value;
-
- if (res)
- ec.ig.Emit (OpCodes.Br, loop);
- } else
- EmitBoolExpression (ec, expr, loop, true);
-
- ig.MarkLabel (ec.LoopEnd);
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- //
- // Inform whether we are infinite or not
- //
- if (expr is BoolConstant){
- BoolConstant bc = (BoolConstant) expr;
-
- if (bc.Value == true)
- return true;
- }
-
- return false;
- }
- }
-
- public class While : Statement {
- public Expression expr;
- public readonly Statement Statement;
-
- public While (Expression boolExpr, Statement statement, Location l)
- {
- this.expr = boolExpr;
- Statement = statement;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- expr = ResolveBoolean (ec, expr, loc);
- if (expr == null)
- return false;
-
- return Statement.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label old_begin = ec.LoopBegin;
- Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- Label while_loop = ig.DefineLabel ();
- bool ret;
-
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- ig.Emit (OpCodes.Br, ec.LoopBegin);
- ig.MarkLabel (while_loop);
-
- //
- // Inform whether we are infinite or not
- //
- if (expr is BoolConstant){
- BoolConstant bc = (BoolConstant) expr;
-
- ig.MarkLabel (ec.LoopBegin);
- if (bc.Value == false){
- Warning_DeadCodeFound (Statement.loc);
- ret = false;
- } else {
- Statement.Emit (ec);
- ig.Emit (OpCodes.Br, ec.LoopBegin);
-
- //
- // Inform that we are infinite (ie, `we return')
- //
- ret = true;
- }
- ig.MarkLabel (ec.LoopEnd);
- } else {
- Statement.Emit (ec);
-
- ig.MarkLabel (ec.LoopBegin);
-
- EmitBoolExpression (ec, expr, while_loop, true);
- ig.MarkLabel (ec.LoopEnd);
-
- ret = false;
- }
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- return ret;
- }
- }
-
- public class For : Statement {
- Expression Test;
- readonly Statement InitStatement;
- readonly Statement Increment;
- readonly Statement Statement;
-
- public For (Statement initStatement,
- Expression test,
- Statement increment,
- Statement statement,
- Location l)
- {
- InitStatement = initStatement;
- Test = test;
- Increment = increment;
- Statement = statement;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- bool ok = true;
-
- if (Test != null){
- Test = ResolveBoolean (ec, Test, loc);
- if (Test == null)
- ok = false;
- }
-
- if (InitStatement != null){
- if (!InitStatement.Resolve (ec))
- ok = false;
- }
-
- if (Increment != null){
- if (!Increment.Resolve (ec))
- ok = false;
- }
-
- return Statement.Resolve (ec) && ok;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label old_begin = ec.LoopBegin;
- Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- Label loop = ig.DefineLabel ();
-
- if (InitStatement != null)
- if (! (InitStatement is EmptyStatement))
- InitStatement.Emit (ec);
-
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- ig.MarkLabel (loop);
-
- //
- // If test is null, there is no test, and we are just
- // an infinite loop
- //
- if (Test != null)
- EmitBoolExpression (ec, Test, ec.LoopEnd, false);
-
- Statement.Emit (ec);
- ig.MarkLabel (ec.LoopBegin);
- if (!(Increment is EmptyStatement))
- Increment.Emit (ec);
- ig.Emit (OpCodes.Br, loop);
- ig.MarkLabel (ec.LoopEnd);
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- //
- // Inform whether we are infinite or not
- //
- if (Test != null){
- if (Test is BoolConstant){
- BoolConstant bc = (BoolConstant) Test;
-
- if (bc.Value)
- return true;
- }
- return false;
- } else
- return true;
- }
- }
-
- public class StatementExpression : Statement {
- Expression expr;
-
- public StatementExpression (ExpressionStatement expr, Location l)
- {
- this.expr = expr;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- expr = (Expression) expr.Resolve (ec);
- return expr != null;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- if (expr is ExpressionStatement)
- ((ExpressionStatement) expr).EmitStatement (ec);
- else {
- expr.Emit (ec);
- ig.Emit (OpCodes.Pop);
- }
-
- return false;
- }
-
- public override string ToString ()
- {
- return "StatementExpression (" + expr + ")";
- }
- }
-
- /// <summary>
- /// Implements the return statement
- /// </summary>
- public class Return : Statement {
- public Expression Expr;
-
- public Return (Expression expr, Location l)
- {
- Expr = expr;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- if (Expr != null){
- Expr = Expr.Resolve (ec);
- if (Expr == null)
- return false;
- }
- return true;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (ec.InFinally){
- Report.Error (157,loc,"Control can not leave the body of the finally block");
- return false;
- }
-
- if (ec.ReturnType == null){
- if (Expr != null){
- Report.Error (127, loc, "Return with a value not allowed here");
- return false;
- }
- } else {
- if (Expr == null){
- Report.Error (126, loc, "An object of type `" +
- TypeManager.CSharpName (ec.ReturnType) + "' is " +
- "expected for the return statement");
- return false;
- }
-
- if (Expr.Type != ec.ReturnType)
- Expr = Expression.ConvertImplicitRequired (
- ec, Expr, ec.ReturnType, loc);
-
- if (Expr == null)
- return false;
-
- Expr.Emit (ec);
-
- if (ec.InTry || ec.InCatch)
- ec.ig.Emit (OpCodes.Stloc, ec.TemporaryReturn ());
- }
-
- if (ec.InTry || ec.InCatch)
- ec.ig.Emit (OpCodes.Leave, ec.ReturnLabel);
- else
- ec.ig.Emit (OpCodes.Ret);
-
- return true;
- }
- }
-
- public class Goto : Statement {
- string target;
- Block block;
-
- public override bool Resolve (EmitContext ec)
- {
- return true;
- }
-
- public Goto (Block parent_block, string label, Location l)
- {
- block = parent_block;
- loc = l;
- target = label;
- }
-
- public string Target {
- get {
- return target;
- }
- }
-
- public override bool Emit (EmitContext ec)
- {
- LabeledStatement label = block.LookupLabel (target);
-
- if (label == null){
- //
- // Maybe we should catch this before?
- //
- Report.Error (
- 159, loc,
- "No such label `" + target + "' in this scope");
- return false;
- }
- Label l = label.LabelTarget (ec);
- ec.ig.Emit (OpCodes.Br, l);
-
- return false;
- }
- }
-
- public class LabeledStatement : Statement {
- string label_name;
- bool defined;
- Label label;
-
- public LabeledStatement (string label_name)
- {
- this.label_name = label_name;
- }
-
- public Label LabelTarget (EmitContext ec)
- {
- if (defined)
- return label;
- label = ec.ig.DefineLabel ();
- defined = true;
-
- return label;
- }
-
- public override bool Emit (EmitContext ec)
- {
- LabelTarget (ec);
- ec.ig.MarkLabel (label);
-
- return false;
- }
- }
-
-
- /// <summary>
- /// `goto default' statement
- /// </summary>
- public class GotoDefault : Statement {
-
- public GotoDefault (Location l)
- {
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (ec.Switch == null){
- Report.Error (153, loc, "goto default is only valid in a switch statement");
- return false;
- }
-
- if (!ec.Switch.GotDefault){
- Report.Error (159, loc, "No default target on switch statement");
- return false;
- }
- ec.ig.Emit (OpCodes.Br, ec.Switch.DefaultTarget);
- return false;
- }
- }
-
- /// <summary>
- /// `goto case' statement
- /// </summary>
- public class GotoCase : Statement {
- Expression expr;
-
- public GotoCase (Expression e, Location l)
- {
- expr = e;
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (ec.Switch == null){
- Report.Error (153, loc, "goto case is only valid in a switch statement");
- return false;
- }
-
- expr = expr.Resolve (ec);
- if (expr == null)
- return false;
-
- if (!(expr is Constant)){
- Report.Error (159, loc, "Target expression for goto case is not constant");
- return false;
- }
-
- object val = Expression.ConvertIntLiteral (
- (Constant) expr, ec.Switch.SwitchType, loc);
-
- if (val == null)
- return false;
-
- SwitchLabel sl = (SwitchLabel) ec.Switch.Elements [val];
-
- if (sl == null){
- Report.Error (
- 159, loc,
- "No such label 'case " + val + "': for the goto case");
- }
-
- ec.ig.Emit (OpCodes.Br, sl.ILLabelCode);
- return true;
- }
- }
-
- public class Throw : Statement {
- Expression expr;
-
- public Throw (Expression expr, Location l)
- {
- this.expr = expr;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- if (expr != null){
- expr = expr.Resolve (ec);
- if (expr == null)
- return false;
- }
- return true;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (expr == null){
- if (ec.InCatch)
- ec.ig.Emit (OpCodes.Rethrow);
- else {
- Report.Error (
- 156, loc,
- "A throw statement with no argument is only " +
- "allowed in a catch clause");
- }
- return false;
- }
-
- expr.Emit (ec);
-
- ec.ig.Emit (OpCodes.Throw);
-
- return true;
- }
- }
-
- public class Break : Statement {
-
- public Break (Location l)
- {
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
-
- if (ec.InLoop == false && ec.Switch == null){
- Report.Error (139, loc, "No enclosing loop or switch to continue to");
- return false;
- }
-
- ig.Emit (OpCodes.Br, ec.LoopEnd);
-
- return false;
- }
- }
-
- public class Continue : Statement {
-
- public Continue (Location l)
- {
- loc = l;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Label begin = ec.LoopBegin;
-
- if (!ec.InLoop){
- Report.Error (139, loc, "No enclosing loop to continue to");
- return false;
- }
-
- //
- // UGH: Non trivial. This Br might cross a try/catch boundary
- // How can we tell?
- //
- // while () {
- // try { ... } catch { continue; }
- // }
- //
- // From:
- // try {} catch { while () { continue; }}
- //
- ec.ig.Emit (OpCodes.Br, begin);
- return false;
- }
- }
-
- public class VariableInfo {
- public readonly string Type;
- public LocalBuilder LocalBuilder;
- public Type VariableType;
- public readonly Location Location;
-
- public bool Used;
- public bool Assigned;
- public bool ReadOnly;
-
- public VariableInfo (string type, Location l)
- {
- Type = type;
- LocalBuilder = null;
- Location = l;
- }
-
- public void MakePinned ()
- {
- TypeManager.MakePinned (LocalBuilder);
- }
- }
-
- /// <summary>
- /// Block represents a C# block.
- /// </summary>
- ///
- /// <remarks>
- /// This class is used in a number of places: either to represent
- /// explicit blocks that the programmer places or implicit blocks.
- ///
- /// Implicit blocks are used as labels or to introduce variable
- /// declarations.
- /// </remarks>
- public class Block : Statement {
- public readonly Block Parent;
- public readonly bool Implicit;
- public readonly Location StartLocation;
- public Location EndLocation;
-
- //
- // The statements in this block
- //
- ArrayList statements;
-
- //
- // An array of Blocks. We keep track of children just
- // to generate the local variable declarations.
- //
- // Statements and child statements are handled through the
- // statements.
- //
- ArrayList children;
-
- //
- // Labels. (label, block) pairs.
- //
- Hashtable labels;
-
- //
- // Keeps track of (name, type) pairs
- //
- Hashtable variables;
-
- //
- // Keeps track of constants
- Hashtable constants;
-
- //
- // Maps variable names to ILGenerator.LocalBuilders
- //
- Hashtable local_builders;
-
- bool used = false;
-
- static int id;
-
- int this_id;
-
- public Block (Block parent)
- : this (parent, false, Location.Null, Location.Null)
- { }
-
- public Block (Block parent, bool implicit_block)
- : this (parent, implicit_block, Location.Null, Location.Null)
- { }
-
- public Block (Block parent, Location start, Location end)
- : this (parent, false, start, end)
- { }
-
- public Block (Block parent, bool implicit_block, Location start, Location end)
- {
- if (parent != null)
- parent.AddChild (this);
-
- this.Parent = parent;
- this.Implicit = implicit_block;
- this.StartLocation = start;
- this.EndLocation = end;
- this.loc = start;
- this_id = id++;
- statements = new ArrayList ();
- }
-
- public int ID {
- get {
- return this_id;
- }
- }
-
- void AddChild (Block b)
- {
- if (children == null)
- children = new ArrayList ();
-
- children.Add (b);
- }
-
- public void SetEndLocation (Location loc)
- {
- EndLocation = loc;
- }
-
- /// <summary>
- /// Adds a label to the current block.
- /// </summary>
- ///
- /// <returns>
- /// false if the name already exists in this block. true
- /// otherwise.
- /// </returns>
- ///
- public bool AddLabel (string name, LabeledStatement target)
- {
- if (labels == null)
- labels = new Hashtable ();
- if (labels.Contains (name))
- return false;
-
- labels.Add (name, target);
- return true;
- }
-
- public LabeledStatement LookupLabel (string name)
- {
- if (labels != null){
- if (labels.Contains (name))
- return ((LabeledStatement) labels [name]);
- }
-
- if (Parent != null)
- return Parent.LookupLabel (name);
-
- return null;
- }
-
- public VariableInfo AddVariable (string type, string name, Parameters pars, Location l)
- {
- if (variables == null)
- variables = new Hashtable ();
-
- if (GetVariableType (name) != null)
- return null;
-
- if (pars != null) {
- int idx = 0;
- Parameter p = pars.GetParameterByName (name, out idx);
- if (p != null)
- return null;
- }
-
- VariableInfo vi = new VariableInfo (type, l);
-
- variables.Add (name, vi);
-
- // Console.WriteLine ("Adding {0} to {1}", name, ID);
- return vi;
- }
-
- public bool AddConstant (string type, string name, Expression value, Parameters pars, Location l)
- {
- if (AddVariable (type, name, pars, l) == null)
- return false;
-
- if (constants == null)
- constants = new Hashtable ();
-
- constants.Add (name, value);
- return true;
- }
-
- public Hashtable Variables {
- get {
- return variables;
- }
- }
-
- public VariableInfo GetVariableInfo (string name)
- {
- if (variables != null) {
- object temp;
- temp = variables [name];
-
- if (temp != null){
- return (VariableInfo) temp;
- }
- }
-
- if (Parent != null)
- return Parent.GetVariableInfo (name);
-
- return null;
- }
-
- public string GetVariableType (string name)
- {
- VariableInfo vi = GetVariableInfo (name);
-
- if (vi != null)
- return vi.Type;
-
- return null;
- }
-
- public Expression GetConstantExpression (string name)
- {
- if (constants != null) {
- object temp;
- temp = constants [name];
-
- if (temp != null)
- return (Expression) temp;
- }
-
- if (Parent != null)
- return Parent.GetConstantExpression (name);
-
- return null;
- }
-
- /// <summary>
- /// True if the variable named @name has been defined
- /// in this block
- /// </summary>
- public bool IsVariableDefined (string name)
- {
- // Console.WriteLine ("Looking up {0} in {1}", name, ID);
- if (variables != null) {
- if (variables.Contains (name))
- return true;
- }
-
- if (Parent != null)
- return Parent.IsVariableDefined (name);
-
- return false;
- }
-
- /// <summary>
- /// True if the variable named @name is a constant
- /// </summary>
- public bool IsConstant (string name)
- {
- Expression e = null;
-
- e = GetConstantExpression (name);
-
- return e != null;
- }
-
- /// <summary>
- /// Use to fetch the statement associated with this label
- /// </summary>
- public Statement this [string name] {
- get {
- return (Statement) labels [name];
- }
- }
-
- /// <returns>
- /// A list of labels that were not used within this block
- /// </returns>
- public string [] GetUnreferenced ()
- {
- // FIXME: Implement me
- return null;
- }
-
- public void AddStatement (Statement s)
- {
- statements.Add (s);
- used = true;
- }
-
- public bool Used {
- get {
- return used;
- }
- }
-
- public void Use ()
- {
- used = true;
- }
-
- /// <summary>
- /// Emits the variable declarations and labels.
- /// </summary>
- /// <remarks>
- /// tc: is our typecontainer (to resolve type references)
- /// ig: is the code generator:
- /// toplevel: the toplevel block. This is used for checking
- /// that no two labels with the same name are used.
- /// </remarks>
- public void EmitMeta (EmitContext ec, Block toplevel)
- {
- DeclSpace ds = ec.DeclSpace;
- ILGenerator ig = ec.ig;
-
- //
- // Process this block variables
- //
- if (variables != null){
- local_builders = new Hashtable ();
-
- foreach (DictionaryEntry de in variables){
- string name = (string) de.Key;
- VariableInfo vi = (VariableInfo) de.Value;
- Type t;
-
- t = RootContext.LookupType (ds, vi.Type, false, vi.Location);
- if (t == null)
- continue;
-
- vi.VariableType = t;
- vi.LocalBuilder = ig.DeclareLocal (t);
-
- if (CodeGen.SymbolWriter != null)
- vi.LocalBuilder.SetLocalSymInfo (name);
-
- if (constants == null)
- continue;
-
- Expression cv = (Expression) constants [name];
- if (cv == null)
- continue;
-
- Expression e = cv.Resolve (ec);
- if (e == null)
- continue;
-
- if (!(e is Constant)){
- Report.Error (133, vi.Location,
- "The expression being assigned to `" +
- name + "' must be constant (" + e + ")");
- continue;
- }
-
- constants.Remove (name);
- constants.Add (name, e);
- }
- }
-
- //
- // Now, handle the children
- //
- if (children != null){
- foreach (Block b in children)
- b.EmitMeta (ec, toplevel);
- }
- }
-
- public void UsageWarning ()
- {
- string name;
-
- if (variables != null){
- foreach (DictionaryEntry de in variables){
- VariableInfo vi = (VariableInfo) de.Value;
-
- if (vi.Used)
- continue;
-
- name = (string) de.Key;
-
- if (vi.Assigned){
- Report.Warning (
- 219, vi.Location, "The variable `" + name +
- "' is assigned but its value is never used");
- } else {
- Report.Warning (
- 168, vi.Location, "The variable `" +
- name +
- "' is declared but never used");
- }
- }
- }
-
- if (children != null)
- foreach (Block b in children)
- b.UsageWarning ();
- }
-
- public override bool Resolve (EmitContext ec)
- {
- Block prev_block = ec.CurrentBlock;
-
- ec.CurrentBlock = this;
- foreach (Statement s in statements){
- if (s.Resolve (ec) == false){
- ec.CurrentBlock = prev_block;
- return false;
- }
- }
-
- ec.CurrentBlock = prev_block;
- return true;
- }
-
- public override bool Emit (EmitContext ec)
- {
- bool is_ret = false;
- Block prev_block = ec.CurrentBlock;
-
- ec.CurrentBlock = this;
-
- if (CodeGen.SymbolWriter != null) {
- ec.Mark (StartLocation);
-
- foreach (Statement s in statements) {
- ec.Mark (s.loc);
-
- is_ret = s.Emit (ec);
- }
-
- ec.Mark (EndLocation);
- } else {
- foreach (Statement s in statements)
- is_ret = s.Emit (ec);
- }
-
- ec.CurrentBlock = prev_block;
- return is_ret;
- }
- }
-
- public class SwitchLabel {
- Expression label;
- object converted;
- public Location loc;
- public Label ILLabel;
- public Label ILLabelCode;
-
- //
- // if expr == null, then it is the default case.
- //
- public SwitchLabel (Expression expr, Location l)
- {
- label = expr;
- loc = l;
- }
-
- public Expression Label {
- get {
- return label;
- }
- }
-
- public object Converted {
- get {
- return converted;
- }
- }
-
- //
- // Resolves the expression, reduces it to a literal if possible
- // and then converts it to the requested type.
- //
- public bool ResolveAndReduce (EmitContext ec, Type required_type)
- {
- ILLabel = ec.ig.DefineLabel ();
- ILLabelCode = ec.ig.DefineLabel ();
-
- if (label == null)
- return true;
-
- Expression e = label.Resolve (ec);
-
- if (e == null)
- return false;
-
- if (!(e is Constant)){
- Console.WriteLine ("Value is: " + label);
- Report.Error (150, loc, "A constant value is expected");
- return false;
- }
-
- if (e is StringConstant || e is NullLiteral){
- if (required_type == TypeManager.string_type){
- converted = label;
- ILLabel = ec.ig.DefineLabel ();
- return true;
- }
- }
-
- converted = Expression.ConvertIntLiteral ((Constant) e, required_type, loc);
- if (converted == null)
- return false;
-
- return true;
- }
- }
-
- public class SwitchSection {
- // An array of SwitchLabels.
- public readonly ArrayList Labels;
- public readonly Block Block;
-
- public SwitchSection (ArrayList labels, Block block)
- {
- Labels = labels;
- Block = block;
- }
- }
-
- public class Switch : Statement {
- public readonly ArrayList Sections;
- public Expression Expr;
-
- /// <summary>
- /// Maps constants whose type type SwitchType to their SwitchLabels.
- /// </summary>
- public Hashtable Elements;
-
- /// <summary>
- /// The governing switch type
- /// </summary>
- public Type SwitchType;
-
- //
- // Computed
- //
- bool got_default;
- Label default_target;
-
- //
- // The types allowed to be implicitly cast from
- // on the governing type
- //
- static Type [] allowed_types;
-
- public Switch (Expression e, ArrayList sects, Location l)
- {
- Expr = e;
- Sections = sects;
- loc = l;
- }
-
- public bool GotDefault {
- get {
- return got_default;
- }
- }
-
- public Label DefaultTarget {
- get {
- return default_target;
- }
- }
-
- //
- // Determines the governing type for a switch. The returned
- // expression might be the expression from the switch, or an
- // expression that includes any potential conversions to the
- // integral types or to string.
- //
- Expression SwitchGoverningType (EmitContext ec, Type t)
- {
- if (t == TypeManager.int32_type ||
- t == TypeManager.uint32_type ||
- t == TypeManager.char_type ||
- t == TypeManager.byte_type ||
- t == TypeManager.sbyte_type ||
- t == TypeManager.ushort_type ||
- t == TypeManager.short_type ||
- t == TypeManager.uint64_type ||
- t == TypeManager.int64_type ||
- t == TypeManager.string_type ||
- t == TypeManager.bool_type ||
- t.IsSubclassOf (TypeManager.enum_type))
- return Expr;
-
- if (allowed_types == null){
- allowed_types = new Type [] {
- TypeManager.sbyte_type,
- TypeManager.byte_type,
- TypeManager.short_type,
- TypeManager.ushort_type,
- TypeManager.int32_type,
- TypeManager.uint32_type,
- TypeManager.int64_type,
- TypeManager.uint64_type,
- TypeManager.char_type,
- TypeManager.bool_type,
- TypeManager.string_type
- };
- }
-
- //
- // Try to find a *user* defined implicit conversion.
- //
- // If there is no implicit conversion, or if there are multiple
- // conversions, we have to report an error
- //
- Expression converted = null;
- foreach (Type tt in allowed_types){
- Expression e;
-
- e = Expression.ImplicitUserConversion (ec, Expr, tt, loc);
- if (e == null)
- continue;
-
- if (converted != null){
- Report.Error (-12, loc, "More than one conversion to an integral " +
- " type exists for type `" +
- TypeManager.CSharpName (Expr.Type)+"'");
- return null;
- } else
- converted = e;
- }
- return converted;
- }
-
- void error152 (string n)
- {
- Report.Error (
- 152, "The label `" + n + ":' " +
- "is already present on this switch statement");
- }
-
- //
- // Performs the basic sanity checks on the switch statement
- // (looks for duplicate keys and non-constant expressions).
- //
- // It also returns a hashtable with the keys that we will later
- // use to compute the switch tables
- //
- bool CheckSwitch (EmitContext ec)
- {
- Type compare_type;
- bool error = false;
- Elements = new Hashtable ();
-
- got_default = false;
-
- if (TypeManager.IsEnumType (SwitchType)){
- compare_type = TypeManager.EnumToUnderlying (SwitchType);
- } else
- compare_type = SwitchType;
-
- foreach (SwitchSection ss in Sections){
- foreach (SwitchLabel sl in ss.Labels){
- if (!sl.ResolveAndReduce (ec, SwitchType)){
- error = true;
- continue;
- }
-
- if (sl.Label == null){
- if (got_default){
- error152 ("default");
- error = true;
- }
- got_default = true;
- continue;
- }
-
- object key = sl.Converted;
-
- if (key is Constant)
- key = ((Constant) key).GetValue ();
-
- if (key == null)
- key = NullLiteral.Null;
-
- string lname = null;
- if (compare_type == TypeManager.uint64_type){
- ulong v = (ulong) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.int64_type){
- long v = (long) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.uint32_type){
- uint v = (uint) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.char_type){
- char v = (char) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.byte_type){
- byte v = (byte) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.sbyte_type){
- sbyte v = (sbyte) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.short_type){
- short v = (short) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.ushort_type){
- ushort v = (ushort) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.string_type){
- if (key is NullLiteral){
- if (Elements.Contains (NullLiteral.Null))
- lname = "null";
- else
- Elements.Add (NullLiteral.Null, null);
- } else {
- string s = (string) key;
-
- if (Elements.Contains (s))
- lname = s;
- else
- Elements.Add (s, sl);
- }
- } else if (compare_type == TypeManager.int32_type) {
- int v = (int) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- } else if (compare_type == TypeManager.bool_type) {
- bool v = (bool) key;
-
- if (Elements.Contains (v))
- lname = v.ToString ();
- else
- Elements.Add (v, sl);
- }
- else
- {
- throw new Exception ("Unknown switch type!" +
- SwitchType + " " + compare_type);
- }
-
- if (lname != null){
- error152 ("case + " + lname);
- error = true;
- }
- }
- }
- if (error)
- return false;
-
- return true;
- }
-
- void EmitObjectInteger (ILGenerator ig, object k)
- {
- if (k is int)
- IntConstant.EmitInt (ig, (int) k);
- else if (k is Constant) {
- EmitObjectInteger (ig, ((Constant) k).GetValue ());
- }
- else if (k is uint)
- IntConstant.EmitInt (ig, unchecked ((int) (uint) k));
- else if (k is long)
- {
- if ((long) k >= int.MinValue && (long) k <= int.MaxValue)
- {
- IntConstant.EmitInt (ig, (int) (long) k);
- ig.Emit (OpCodes.Conv_I8);
- }
- else
- LongConstant.EmitLong (ig, (long) k);
- }
- else if (k is ulong)
- {
- if ((ulong) k < (1L<<32))
- {
- IntConstant.EmitInt (ig, (int) (long) k);
- ig.Emit (OpCodes.Conv_U8);
- }
- else
- {
- LongConstant.EmitLong (ig, unchecked ((long) (ulong) k));
- }
- }
- else if (k is char)
- IntConstant.EmitInt (ig, (int) ((char) k));
- else if (k is sbyte)
- IntConstant.EmitInt (ig, (int) ((sbyte) k));
- else if (k is byte)
- IntConstant.EmitInt (ig, (int) ((byte) k));
- else if (k is short)
- IntConstant.EmitInt (ig, (int) ((short) k));
- else if (k is ushort)
- IntConstant.EmitInt (ig, (int) ((ushort) k));
- else if (k is bool)
- IntConstant.EmitInt (ig, ((bool) k) ? 1 : 0);
- else
- throw new Exception ("Unhandled case");
- }
-
- // structure used to hold blocks of keys while calculating table switch
- class KeyBlock : IComparable
- {
- public KeyBlock (long _nFirst)
- {
- nFirst = nLast = _nFirst;
- }
- public long nFirst;
- public long nLast;
- public ArrayList rgKeys = null;
- public int Length
- {
- get { return (int) (nLast - nFirst + 1); }
- }
- public static long TotalLength (KeyBlock kbFirst, KeyBlock kbLast)
- {
- return kbLast.nLast - kbFirst.nFirst + 1;
- }
- public int CompareTo (object obj)
- {
- KeyBlock kb = (KeyBlock) obj;
- int nLength = Length;
- int nLengthOther = kb.Length;
- if (nLengthOther == nLength)
- return (int) (kb.nFirst - nFirst);
- return nLength - nLengthOther;
- }
- }
-
- /// <summary>
- /// This method emits code for a lookup-based switch statement (non-string)
- /// Basically it groups the cases into blocks that are at least half full,
- /// and then spits out individual lookup opcodes for each block.
- /// It emits the longest blocks first, and short blocks are just
- /// handled with direct compares.
- /// </summary>
- /// <param name="ec"></param>
- /// <param name="val"></param>
- /// <returns></returns>
- bool TableSwitchEmit (EmitContext ec, LocalBuilder val)
- {
- int cElements = Elements.Count;
- object [] rgKeys = new object [cElements];
- Elements.Keys.CopyTo (rgKeys, 0);
- Array.Sort (rgKeys);
-
- // initialize the block list with one element per key
- ArrayList rgKeyBlocks = new ArrayList ();
- foreach (object key in rgKeys)
- rgKeyBlocks.Add (new KeyBlock (Convert.ToInt64 (key)));
-
- KeyBlock kbCurr;
- // iteratively merge the blocks while they are at least half full
- // there's probably a really cool way to do this with a tree...
- while (rgKeyBlocks.Count > 1)
- {
- ArrayList rgKeyBlocksNew = new ArrayList ();
- kbCurr = (KeyBlock) rgKeyBlocks [0];
- for (int ikb = 1; ikb < rgKeyBlocks.Count; ikb++)
- {
- KeyBlock kb = (KeyBlock) rgKeyBlocks [ikb];
- if ((kbCurr.Length + kb.Length) * 2 >= KeyBlock.TotalLength (kbCurr, kb))
- {
- // merge blocks
- kbCurr.nLast = kb.nLast;
- }
- else
- {
- // start a new block
- rgKeyBlocksNew.Add (kbCurr);
- kbCurr = kb;
- }
- }
- rgKeyBlocksNew.Add (kbCurr);
- if (rgKeyBlocks.Count == rgKeyBlocksNew.Count)
- break;
- rgKeyBlocks = rgKeyBlocksNew;
- }
-
- // initialize the key lists
- foreach (KeyBlock kb in rgKeyBlocks)
- kb.rgKeys = new ArrayList ();
-
- // fill the key lists
- int iBlockCurr = 0;
- kbCurr = (KeyBlock) rgKeyBlocks [0];
- foreach (object key in rgKeys)
- {
- bool fNextBlock = (key is UInt64) ? (ulong) key > (ulong) kbCurr.nLast : Convert.ToInt64 (key) > kbCurr.nLast;
- if (fNextBlock)
- kbCurr = (KeyBlock) rgKeyBlocks [++iBlockCurr];
- kbCurr.rgKeys.Add (key);
- }
-
- // sort the blocks so we can tackle the largest ones first
- rgKeyBlocks.Sort ();
-
- // okay now we can start...
- ILGenerator ig = ec.ig;
- Label lblEnd = ig.DefineLabel (); // at the end ;-)
- Label lblDefault = new Label ();
- Type typeKeys = rgKeys [0].GetType (); // used for conversions
-
- for (int iBlock = rgKeyBlocks.Count - 1; iBlock >= 0; --iBlock)
- {
- KeyBlock kb = ((KeyBlock) rgKeyBlocks [iBlock]);
- lblDefault = (iBlock == 0) ? DefaultTarget : ig.DefineLabel ();
- if (kb.Length <= 2)
- {
- foreach (object key in kb.rgKeys)
- {
- ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, key);
- SwitchLabel sl = (SwitchLabel) Elements [key];
- ig.Emit (OpCodes.Beq, sl.ILLabel);
- }
- }
- else
- {
- // TODO: if all the keys in the block are the same and there are
- // no gaps/defaults then just use a range-check.
- if (SwitchType == TypeManager.int64_type ||
- SwitchType == TypeManager.uint64_type)
- {
- // TODO: optimize constant/I4 cases
-
- // check block range (could be > 2^31)
- ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, Convert.ChangeType (kb.nFirst, typeKeys));
- ig.Emit (OpCodes.Blt, lblDefault);
- ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, Convert.ChangeType (kb.nFirst, typeKeys));
- ig.Emit (OpCodes.Bgt, lblDefault);
-
- // normalize range
- ig.Emit (OpCodes.Ldloc, val);
- if (kb.nFirst != 0)
- {
- EmitObjectInteger (ig, Convert.ChangeType (kb.nFirst, typeKeys));
- ig.Emit (OpCodes.Sub);
- }
- ig.Emit (OpCodes.Conv_I4); // assumes < 2^31 labels!
- }
- else
- {
- // normalize range
- ig.Emit (OpCodes.Ldloc, val);
- int nFirst = (int) kb.nFirst;
- if (nFirst > 0)
- {
- IntConstant.EmitInt (ig, nFirst);
- ig.Emit (OpCodes.Sub);
- }
- else if (nFirst < 0)
- {
- IntConstant.EmitInt (ig, -nFirst);
- ig.Emit (OpCodes.Add);
- }
- }
-
- // first, build the list of labels for the switch
- int iKey = 0;
- int cJumps = kb.Length;
- Label [] rgLabels = new Label [cJumps];
- for (int iJump = 0; iJump < cJumps; iJump++)
- {
- object key = kb.rgKeys [iKey];
- if (Convert.ToInt64 (key) == kb.nFirst + iJump)
- {
- SwitchLabel sl = (SwitchLabel) Elements [key];
- rgLabels [iJump] = sl.ILLabel;
- iKey++;
- }
- else
- rgLabels [iJump] = lblDefault;
- }
- // emit the switch opcode
- ig.Emit (OpCodes.Switch, rgLabels);
- }
-
- // mark the default for this block
- if (iBlock != 0)
- ig.MarkLabel (lblDefault);
- }
-
- // TODO: find the default case and emit it here,
- // to prevent having to do the following jump.
- // make sure to mark other labels in the default section
-
- // the last default just goes to the end
- ig.Emit (OpCodes.Br, lblDefault);
-
- // now emit the code for the sections
- bool fFoundDefault = false;
- bool fAllReturn = true;
- foreach (SwitchSection ss in Sections)
- {
- foreach (SwitchLabel sl in ss.Labels)
- {
- ig.MarkLabel (sl.ILLabel);
- ig.MarkLabel (sl.ILLabelCode);
- if (sl.Label == null)
- {
- ig.MarkLabel (lblDefault);
- fFoundDefault = true;
- }
- }
- fAllReturn &= ss.Block.Emit (ec);
- //ig.Emit (OpCodes.Br, lblEnd);
- }
-
- if (!fFoundDefault)
- ig.MarkLabel (lblDefault);
- ig.MarkLabel (lblEnd);
-
- return fAllReturn;
- }
- //
- // This simple emit switch works, but does not take advantage of the
- // `switch' opcode.
- // TODO: remove non-string logic from here
- // TODO: binary search strings?
- //
- bool SimpleSwitchEmit (EmitContext ec, LocalBuilder val)
- {
- ILGenerator ig = ec.ig;
- Label end_of_switch = ig.DefineLabel ();
- Label next_test = ig.DefineLabel ();
- Label null_target = ig.DefineLabel ();
- bool default_found = false;
- bool first_test = true;
- bool pending_goto_end = false;
- bool all_return = true;
- bool is_string = false;
- bool null_found;
-
- //
- // Special processing for strings: we cant compare
- // against null.
- //
- if (SwitchType == TypeManager.string_type){
- ig.Emit (OpCodes.Ldloc, val);
- is_string = true;
-
- if (Elements.Contains (NullLiteral.Null)){
- ig.Emit (OpCodes.Brfalse, null_target);
- } else
- ig.Emit (OpCodes.Brfalse, default_target);
-
- ig.Emit (OpCodes.Ldloc, val);
- ig.Emit (OpCodes.Call, TypeManager.string_isinterneted_string);
- ig.Emit (OpCodes.Stloc, val);
- }
-
- SwitchSection last_section;
- last_section = (SwitchSection) Sections [Sections.Count-1];
-
- foreach (SwitchSection ss in Sections){
- Label sec_begin = ig.DefineLabel ();
-
- if (pending_goto_end)
- ig.Emit (OpCodes.Br, end_of_switch);
-
- int label_count = ss.Labels.Count;
- null_found = false;
- foreach (SwitchLabel sl in ss.Labels){
- ig.MarkLabel (sl.ILLabel);
-
- if (!first_test){
- ig.MarkLabel (next_test);
- next_test = ig.DefineLabel ();
- }
- //
- // If we are the default target
- //
- if (sl.Label == null){
- ig.MarkLabel (default_target);
- default_found = true;
- } else {
- object lit = sl.Converted;
-
- if (lit is NullLiteral){
- null_found = true;
- if (label_count == 1)
- ig.Emit (OpCodes.Br, next_test);
- continue;
-
- }
- if (is_string){
- StringConstant str = (StringConstant) lit;
-
- ig.Emit (OpCodes.Ldloc, val);
- ig.Emit (OpCodes.Ldstr, str.Value);
- if (label_count == 1)
- ig.Emit (OpCodes.Bne_Un, next_test);
- else
- ig.Emit (OpCodes.Beq, sec_begin);
- } else {
- ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, lit);
- ig.Emit (OpCodes.Ceq);
- if (label_count == 1)
- ig.Emit (OpCodes.Brfalse, next_test);
- else
- ig.Emit (OpCodes.Brtrue, sec_begin);
- }
- }
- }
- if (label_count != 1 && ss != last_section)
- ig.Emit (OpCodes.Br, next_test);
-
- if (null_found)
- ig.MarkLabel (null_target);
- ig.MarkLabel (sec_begin);
- foreach (SwitchLabel sl in ss.Labels)
- ig.MarkLabel (sl.ILLabelCode);
- if (ss.Block.Emit (ec))
- pending_goto_end = false;
- else {
- all_return = false;
- pending_goto_end = true;
- }
- first_test = false;
- }
- if (!default_found){
- ig.MarkLabel (default_target);
- all_return = false;
- }
- ig.MarkLabel (next_test);
- ig.MarkLabel (end_of_switch);
-
- return all_return;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- foreach (SwitchSection ss in Sections){
- if (ss.Block.Resolve (ec) != true)
- return false;
- }
-
- return true;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Expr = Expr.Resolve (ec);
- if (Expr == null)
- return false;
-
- Expression new_expr = SwitchGoverningType (ec, Expr.Type);
- if (new_expr == null){
- Report.Error (151, loc, "An integer type or string was expected for switch");
- return false;
- }
-
- // Validate switch.
- SwitchType = new_expr.Type;
-
- if (!CheckSwitch (ec))
- return false;
-
- // Store variable for comparission purposes
- LocalBuilder value = ec.ig.DeclareLocal (SwitchType);
- new_expr.Emit (ec);
- ec.ig.Emit (OpCodes.Stloc, value);
-
- ILGenerator ig = ec.ig;
-
- default_target = ig.DefineLabel ();
-
- //
- // Setup the codegen context
- //
- Label old_end = ec.LoopEnd;
- Switch old_switch = ec.Switch;
-
- ec.LoopEnd = ig.DefineLabel ();
- ec.Switch = this;
-
- // Emit Code.
- bool all_return;
- if (SwitchType == TypeManager.string_type)
- all_return = SimpleSwitchEmit (ec, value);
- else
- all_return = TableSwitchEmit (ec, value);
-
- // Restore context state.
- ig.MarkLabel (ec.LoopEnd);
-
- //
- // Restore the previous context
- //
- ec.LoopEnd = old_end;
- ec.Switch = old_switch;
-
- return all_return;
- }
- }
-
- public class Lock : Statement {
- Expression expr;
- Statement Statement;
-
- public Lock (Expression expr, Statement stmt, Location l)
- {
- this.expr = expr;
- Statement = stmt;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
- return Statement.Resolve (ec) && expr != null;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Type type = expr.Type;
- bool val;
-
- if (type.IsValueType){
- Report.Error (185, loc, "lock statement requires the expression to be " +
- " a reference type (type is: `" +
- TypeManager.CSharpName (type) + "'");
- return false;
- }
-
- ILGenerator ig = ec.ig;
- LocalBuilder temp = ig.DeclareLocal (type);
-
- expr.Emit (ec);
- ig.Emit (OpCodes.Dup);
- ig.Emit (OpCodes.Stloc, temp);
- ig.Emit (OpCodes.Call, TypeManager.void_monitor_enter_object);
-
- // try
- Label end = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- Label finish = ig.DefineLabel ();
- val = Statement.Emit (ec);
- ec.InTry = old_in_try;
- // ig.Emit (OpCodes.Leave, finish);
-
- ig.MarkLabel (finish);
-
- // finally
- ig.BeginFinallyBlock ();
- ig.Emit (OpCodes.Ldloc, temp);
- ig.Emit (OpCodes.Call, TypeManager.void_monitor_exit_object);
- ig.EndExceptionBlock ();
-
- return val;
- }
- }
-
- public class Unchecked : Statement {
- public readonly Block Block;
-
- public Unchecked (Block b)
- {
- Block = b;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- return Block.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- bool previous_state = ec.CheckState;
- bool previous_state_const = ec.ConstantCheckState;
- bool val;
-
- ec.CheckState = false;
- ec.ConstantCheckState = false;
- val = Block.Emit (ec);
- ec.CheckState = previous_state;
- ec.ConstantCheckState = previous_state_const;
-
- return val;
- }
- }
-
- public class Checked : Statement {
- public readonly Block Block;
-
- public Checked (Block b)
- {
- Block = b;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- return Block.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- bool previous_state = ec.CheckState;
- bool previous_state_const = ec.ConstantCheckState;
- bool val;
-
- ec.CheckState = true;
- ec.ConstantCheckState = true;
- val = Block.Emit (ec);
- ec.CheckState = previous_state;
- ec.ConstantCheckState = previous_state_const;
-
- return val;
- }
- }
-
- public class Unsafe : Statement {
- public readonly Block Block;
-
- public Unsafe (Block b)
- {
- Block = b;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- return Block.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- bool previous_state = ec.InUnsafe;
- bool val;
-
- ec.InUnsafe = true;
- val = Block.Emit (ec);
- ec.InUnsafe = previous_state;
-
- return val;
- }
- }
-
- //
- // Fixed statement
- //
- public class Fixed : Statement {
- string type;
- ArrayList declarators;
- Statement statement;
-
- public Fixed (string type, ArrayList decls, Statement stmt, Location l)
- {
- this.type = type;
- declarators = decls;
- statement = stmt;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- return statement.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Type t;
-
- t = RootContext.LookupType (ec.DeclSpace, type, false, loc);
- if (t == null)
- return false;
-
- bool is_ret = false;
-
- foreach (Pair p in declarators){
- VariableInfo vi = (VariableInfo) p.First;
- Expression e = (Expression) p.Second;
-
- //
- // The rules for the possible declarators are pretty wise,
- // but the production on the grammar is more concise.
- //
- // So we have to enforce these rules here.
- //
- // We do not resolve before doing the case 1 test,
- // because the grammar is explicit in that the token &
- // is present, so we need to test for this particular case.
- //
-
- //
- // Case 1: & object.
- //
- if (e is Unary && ((Unary) e).Oper == Unary.Operator.AddressOf){
- Expression child = ((Unary) e).Expr;
-
- vi.MakePinned ();
- if (child is ParameterReference || child is LocalVariableReference){
- Report.Error (
- 213, loc,
- "No need to use fixed statement for parameters or " +
- "local variable declarations (address is already " +
- "fixed)");
- continue;
- }
-
- e = e.Resolve (ec);
- if (e == null)
- continue;
-
- child = ((Unary) e).Expr;
-
- if (!TypeManager.VerifyUnManaged (child.Type, loc))
- continue;
-
- //
- // Store pointer in pinned location
- //
- e.Emit (ec);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- is_ret = statement.Emit (ec);
-
- // Clear the pinned variable.
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Conv_U);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- continue;
- }
-
- e = e.Resolve (ec);
- if (e == null)
- continue;
-
- //
- // Case 2: Array
- //
- if (e.Type.IsArray){
- Type array_type = e.Type.GetElementType ();
-
- vi.MakePinned ();
- //
- // Provided that array_type is unmanaged,
- //
- if (!TypeManager.VerifyUnManaged (array_type, loc))
- continue;
-
- //
- // and T* is implicitly convertible to the
- // pointer type given in the fixed statement.
- //
- ArrayPtr array_ptr = new ArrayPtr (e);
-
- Expression converted = Expression.ConvertImplicitRequired (
- ec, array_ptr, vi.VariableType, loc);
- if (converted == null)
- continue;
-
- //
- // Store pointer in pinned location
- //
- converted.Emit (ec);
-
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- is_ret = statement.Emit (ec);
-
- // Clear the pinned variable.
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Conv_U);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- continue;
- }
-
- //
- // Case 3: string
- //
- if (e.Type == TypeManager.string_type){
- LocalBuilder pinned_string = ig.DeclareLocal (TypeManager.string_type);
- TypeManager.MakePinned (pinned_string);
-
- e.Emit (ec);
- ig.Emit (OpCodes.Stloc, pinned_string);
-
- Expression sptr = new StringPtr (pinned_string);
- Expression converted = Expression.ConvertImplicitRequired (
- ec, sptr, vi.VariableType, loc);
-
- if (converted == null)
- continue;
-
- converted.Emit (ec);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- is_ret = statement.Emit (ec);
-
- // Clear the pinned variable
- ig.Emit (OpCodes.Ldnull);
- ig.Emit (OpCodes.Stloc, pinned_string);
- }
- }
-
- return is_ret;
- }
- }
-
- public class Catch {
- public readonly string Type;
- public readonly string Name;
- public readonly Block Block;
- public readonly Location Location;
-
- public Catch (string type, string name, Block block, Location l)
- {
- Type = type;
- Name = name;
- Block = block;
- Location = l;
- }
- }
-
- public class Try : Statement {
- public readonly Block Fini, Block;
- public readonly ArrayList Specific;
- public readonly Catch General;
-
- //
- // specific, general and fini might all be null.
- //
- public Try (Block block, ArrayList specific, Catch general, Block fini)
- {
- if (specific == null && general == null){
- Console.WriteLine ("CIR.Try: Either specific or general have to be non-null");
- }
-
- this.Block = block;
- this.Specific = specific;
- this.General = general;
- this.Fini = fini;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- bool ok = true;
-
- if (General != null)
- if (!General.Block.Resolve (ec))
- ok = false;
-
- foreach (Catch c in Specific){
- if (!c.Block.Resolve (ec))
- ok = false;
- }
-
- if (!Block.Resolve (ec))
- ok = false;
-
- if (Fini != null)
- if (!Fini.Resolve (ec))
- ok = false;
-
- return ok;
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Label end;
- Label finish = ig.DefineLabel ();;
- bool returns;
-
- end = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- returns = Block.Emit (ec);
- ec.InTry = old_in_try;
-
- //
- // System.Reflection.Emit provides this automatically:
- // ig.Emit (OpCodes.Leave, finish);
-
- bool old_in_catch = ec.InCatch;
- ec.InCatch = true;
- DeclSpace ds = ec.DeclSpace;
-
- foreach (Catch c in Specific){
- Type catch_type = RootContext.LookupType (ds, c.Type, false, c.Location);
- VariableInfo vi;
-
- if (catch_type == null)
- return false;
-
- ig.BeginCatchBlock (catch_type);
-
- if (c.Name != null){
- vi = c.Block.GetVariableInfo (c.Name);
- if (vi == null){
- Console.WriteLine ("This should not happen! variable does not exist in this block");
- Environment.Exit (0);
- }
-
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
- } else
- ig.Emit (OpCodes.Pop);
-
- if (!c.Block.Emit (ec))
- returns = false;
- }
-
- if (General != null){
- ig.BeginCatchBlock (TypeManager.object_type);
- ig.Emit (OpCodes.Pop);
- if (!General.Block.Emit (ec))
- returns = false;
- }
- ec.InCatch = old_in_catch;
-
- ig.MarkLabel (finish);
- if (Fini != null){
- ig.BeginFinallyBlock ();
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- Fini.Emit (ec);
- ec.InFinally = old_in_finally;
- }
-
- ig.EndExceptionBlock ();
-
- //
- // FIXME: Is this correct?
- // Replace with `returns' and check test-18, maybe we can
- // perform an optimization here.
- //
- return returns;
- }
- }
-
- //
- // FIXME: We still do not support the expression variant of the using
- // statement.
- //
- public class Using : Statement {
- object expression_or_block;
- Statement Statement;
-
- public Using (object expression_or_block, Statement stmt, Location l)
- {
- this.expression_or_block = expression_or_block;
- Statement = stmt;
- loc = l;
- }
-
- //
- // Emits the code for the case of using using a local variable declaration.
- //
- bool EmitLocalVariableDecls (EmitContext ec, string type_name, ArrayList var_list)
- {
- ILGenerator ig = ec.ig;
- Expression [] converted_vars;
- bool need_conv = false;
- Type type = RootContext.LookupType (ec.DeclSpace, type_name, false, loc);
- int i = 0;
-
- if (type == null)
- return false;
-
- //
- // The type must be an IDisposable or an implicit conversion
- // must exist.
- //
- converted_vars = new Expression [var_list.Count];
- if (!TypeManager.ImplementsInterface (type, TypeManager.idisposable_type)){
- foreach (DictionaryEntry e in var_list){
- Expression var = (Expression) e.Key;
-
- var = var.Resolve (ec);
- if (var == null)
- return false;
-
- converted_vars [i] = Expression.ConvertImplicit (
- ec, var, TypeManager.idisposable_type, loc);
-
- if (converted_vars [i] == null)
- return false;
- i++;
- }
- need_conv = true;
- }
-
- i = 0;
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- bool error = false;
- foreach (DictionaryEntry e in var_list){
- LocalVariableReference var = (LocalVariableReference) e.Key;
- Expression expr = (Expression) e.Value;
- Expression a;
-
- a = new Assign (var, expr, loc);
- a = a.Resolve (ec);
- if (!need_conv)
- converted_vars [i] = var;
- i++;
- if (a == null){
- error = true;
- continue;
- }
- ((ExpressionStatement) a).EmitStatement (ec);
-
- ig.BeginExceptionBlock ();
-
- }
- if (error)
- return false;
- Statement.Emit (ec);
- ec.InTry = old_in_try;
-
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- var_list.Reverse ();
- foreach (DictionaryEntry e in var_list){
- LocalVariableReference var = (LocalVariableReference) e.Key;
- Label skip = ig.DefineLabel ();
- i--;
-
- ig.BeginFinallyBlock ();
-
- var.Emit (ec);
- ig.Emit (OpCodes.Brfalse, skip);
- converted_vars [i].Emit (ec);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (skip);
- ig.EndExceptionBlock ();
- }
- ec.InFinally = old_in_finally;
-
- return false;
- }
-
- bool EmitExpression (EmitContext ec, Expression expr)
- {
- Type expr_type = expr.Type;
- Expression conv = null;
-
- if (!TypeManager.ImplementsInterface (expr_type, TypeManager.idisposable_type)){
- conv = Expression.ConvertImplicit (
- ec, expr, TypeManager.idisposable_type, loc);
-
- if (conv == null)
- return false;
- }
-
- //
- // Make a copy of the expression and operate on that.
- //
- ILGenerator ig = ec.ig;
- LocalBuilder local_copy = ig.DeclareLocal (expr_type);
- if (conv != null)
- conv.Emit (ec);
- else
- expr.Emit (ec);
- ig.Emit (OpCodes.Stloc, local_copy);
-
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- ig.BeginExceptionBlock ();
- Statement.Emit (ec);
- ec.InTry = old_in_try;
-
- Label skip = ig.DefineLabel ();
- bool old_in_finally = ec.InFinally;
- ig.BeginFinallyBlock ();
- ig.Emit (OpCodes.Ldloc, local_copy);
- ig.Emit (OpCodes.Brfalse, skip);
- ig.Emit (OpCodes.Ldloc, local_copy);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (skip);
- ec.InFinally = old_in_finally;
- ig.EndExceptionBlock ();
-
- return false;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- return Statement.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (expression_or_block is DictionaryEntry){
- string t = (string) ((DictionaryEntry) expression_or_block).Key;
- ArrayList var_list = (ArrayList)((DictionaryEntry)expression_or_block).Value;
-
- return EmitLocalVariableDecls (ec, t, var_list);
- } if (expression_or_block is Expression){
- Expression e = (Expression) expression_or_block;
-
- e = e.Resolve (ec);
- if (e == null)
- return false;
-
- return EmitExpression (ec, e);
- }
- return false;
- }
- }
-
- /// <summary>
- /// Implementation of the foreach C# statement
- /// </summary>
- public class Foreach : Statement {
- string type;
- LocalVariableReference variable;
- Expression expr;
- Statement statement;
-
- public Foreach (string type, LocalVariableReference var, Expression expr,
- Statement stmt, Location l)
- {
- this.type = type;
- this.variable = var;
- this.expr = expr;
- statement = stmt;
- loc = l;
- }
-
- public override bool Resolve (EmitContext ec)
- {
- expr = expr.Resolve (ec);
- return statement.Resolve (ec) && expr != null;
- }
-
- //
- // Retrieves a `public bool MoveNext ()' method from the Type `t'
- //
- static MethodInfo FetchMethodMoveNext (Type t)
- {
- MemberInfo [] move_next_list;
-
- move_next_list = TypeContainer.FindMembers (
- t, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Instance,
- Type.FilterName, "MoveNext");
- if (move_next_list == null || move_next_list.Length == 0)
- return null;
-
- foreach (MemberInfo m in move_next_list){
- MethodInfo mi = (MethodInfo) m;
- Type [] args;
-
- args = TypeManager.GetArgumentTypes (mi);
- if (args != null && args.Length == 0){
- if (mi.ReturnType == TypeManager.bool_type)
- return mi;
- }
- }
- return null;
- }
-
- //
- // Retrieves a `public T get_Current ()' method from the Type `t'
- //
- static MethodInfo FetchMethodGetCurrent (Type t)
- {
- MemberInfo [] move_next_list;
-
- move_next_list = TypeContainer.FindMembers (
- t, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.Instance,
- Type.FilterName, "get_Current");
- if (move_next_list == null || move_next_list.Length == 0)
- return null;
-
- foreach (MemberInfo m in move_next_list){
- MethodInfo mi = (MethodInfo) m;
- Type [] args;
-
- args = TypeManager.GetArgumentTypes (mi);
- if (args != null && args.Length == 0)
- return mi;
- }
- return null;
- }
-
- //
- // This struct records the helper methods used by the Foreach construct
- //
- class ForeachHelperMethods {
- public EmitContext ec;
- public MethodInfo get_enumerator;
- public MethodInfo move_next;
- public MethodInfo get_current;
-
- public ForeachHelperMethods (EmitContext ec)
- {
- this.ec = ec;
- }
- }
-
- static bool GetEnumeratorFilter (MemberInfo m, object criteria)
- {
- if (m == null)
- return false;
-
- if (!(m is MethodInfo))
- return false;
-
- if (m.Name != "GetEnumerator")
- return false;
-
- MethodInfo mi = (MethodInfo) m;
- Type [] args = TypeManager.GetArgumentTypes (mi);
- if (args != null){
- if (args.Length != 0)
- return false;
- }
- ForeachHelperMethods hm = (ForeachHelperMethods) criteria;
- EmitContext ec = hm.ec;
-
- //
- // Check whether GetEnumerator is accessible to us
- //
- MethodAttributes prot = mi.Attributes & MethodAttributes.MemberAccessMask;
-
- Type declaring = mi.DeclaringType;
- if (prot == MethodAttributes.Private){
- if (declaring != ec.ContainerType)
- return false;
- } else if (prot == MethodAttributes.FamANDAssem){
- // If from a different assembly, false
- if (!(mi is MethodBuilder))
- return false;
- //
- // Are we being invoked from the same class, or from a derived method?
- //
- if (ec.ContainerType != declaring){
- if (!ec.ContainerType.IsSubclassOf (declaring))
- return false;
- }
- } else if (prot == MethodAttributes.FamORAssem){
- if (!(mi is MethodBuilder ||
- ec.ContainerType == declaring ||
- ec.ContainerType.IsSubclassOf (declaring)))
- return false;
- } if (prot == MethodAttributes.Family){
- if (!(ec.ContainerType == declaring ||
- ec.ContainerType.IsSubclassOf (declaring)))
- return false;
- }
-
- //
- // Ok, we can access it, now make sure that we can do something
- // with this `GetEnumerator'
- //
- if (mi.ReturnType == TypeManager.ienumerator_type ||
- TypeManager.ienumerator_type.IsAssignableFrom (mi.ReturnType)){
- hm.move_next = TypeManager.bool_movenext_void;
- hm.get_current = TypeManager.object_getcurrent_void;
- return true;
- }
-
- //
- // Ok, so they dont return an IEnumerable, we will have to
- // find if they support the GetEnumerator pattern.
- //
- Type return_type = mi.ReturnType;
-
- hm.move_next = FetchMethodMoveNext (return_type);
- if (hm.move_next == null)
- return false;
- hm.get_current = FetchMethodGetCurrent (return_type);
- if (hm.get_current == null)
- return false;
-
- return true;
- }
-
- /// <summary>
- /// This filter is used to find the GetEnumerator method
- /// on which IEnumerator operates
- /// </summary>
- static MemberFilter FilterEnumerator;
-
- static Foreach ()
- {
- FilterEnumerator = new MemberFilter (GetEnumeratorFilter);
- }
-
- void error1579 (Type t)
- {
- Report.Error (1579, loc,
- "foreach statement cannot operate on variables of type `" +
- t.FullName + "' because that class does not provide a " +
- " GetEnumerator method or it is inaccessible");
- }
-
- static bool TryType (Type t, ForeachHelperMethods hm)
- {
- MemberInfo [] mi;
-
- mi = TypeContainer.FindMembers (t, MemberTypes.Method,
- BindingFlags.Public | BindingFlags.NonPublic |
- BindingFlags.Instance,
- FilterEnumerator, hm);
-
- if (mi == null || mi.Length == 0)
- return false;
-
- hm.get_enumerator = (MethodInfo) mi [0];
- return true;
- }
-
- //
- // Looks for a usable GetEnumerator in the Type, and if found returns
- // the three methods that participate: GetEnumerator, MoveNext and get_Current
- //
- ForeachHelperMethods ProbeCollectionType (EmitContext ec, Type t)
- {
- ForeachHelperMethods hm = new ForeachHelperMethods (ec);
-
- if (TryType (t, hm))
- return hm;
-
- //
- // Now try to find the method in the interfaces
- //
- while (t != null){
- Type [] ifaces = t.GetInterfaces ();
-
- foreach (Type i in ifaces){
- if (TryType (i, hm))
- return hm;
- }
-
- //
- // Since TypeBuilder.GetInterfaces only returns the interface
- // types for this type, we have to keep looping, but once
- // we hit a non-TypeBuilder (ie, a Type), then we know we are
- // done, because it returns all the types
- //
- if ((t is TypeBuilder))
- t = t.BaseType;
- else
- break;
- }
-
- return null;
- }
-
- //
- // FIXME: possible optimization.
- // We might be able to avoid creating `empty' if the type is the sam
- //
- bool EmitCollectionForeach (EmitContext ec, Type var_type, ForeachHelperMethods hm)
- {
- ILGenerator ig = ec.ig;
- LocalBuilder enumerator, disposable;
- Expression empty = new EmptyExpression ();
- Expression conv;
-
- //
- // FIXME: maybe we can apply the same trick we do in the
- // array handling to avoid creating empty and conv in some cases.
- //
- // Although it is not as important in this case, as the type
- // will not likely be object (what the enumerator will return).
- //
- conv = Expression.ConvertExplicit (ec, empty, var_type, loc);
- if (conv == null)
- return false;
-
- enumerator = ig.DeclareLocal (TypeManager.ienumerator_type);
- disposable = ig.DeclareLocal (TypeManager.idisposable_type);
-
- //
- // Instantiate the enumerator
- //
- if (expr.Type.IsValueType){
- if (expr is IMemoryLocation){
- IMemoryLocation ml = (IMemoryLocation) expr;
-
- ml.AddressOf (ec, AddressOp.Load);
- } else
- throw new Exception ("Expr " + expr + " of type " + expr.Type +
- " does not implement IMemoryLocation");
- ig.Emit (OpCodes.Call, hm.get_enumerator);
- } else {
- expr.Emit (ec);
- ig.Emit (OpCodes.Callvirt, hm.get_enumerator);
- }
- ig.Emit (OpCodes.Stloc, enumerator);
-
- //
- // Protect the code in a try/finalize block, so that
- // if the beast implement IDisposable, we get rid of it
- //
- Label l = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
-
- Label end_try = ig.DefineLabel ();
-
- ig.MarkLabel (ec.LoopBegin);
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Callvirt, hm.move_next);
- ig.Emit (OpCodes.Brfalse, end_try);
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Callvirt, hm.get_current);
- variable.EmitAssign (ec, conv);
- statement.Emit (ec);
- ig.Emit (OpCodes.Br, ec.LoopBegin);
- ig.MarkLabel (end_try);
- ec.InTry = old_in_try;
-
- // The runtime provides this for us.
- // ig.Emit (OpCodes.Leave, end);
-
- //
- // Now the finally block
- //
- Label end_finally = ig.DefineLabel ();
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- ig.BeginFinallyBlock ();
-
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Isinst, TypeManager.idisposable_type);
- ig.Emit (OpCodes.Stloc, disposable);
- ig.Emit (OpCodes.Ldloc, disposable);
- ig.Emit (OpCodes.Brfalse, end_finally);
- ig.Emit (OpCodes.Ldloc, disposable);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (end_finally);
- ec.InFinally = old_in_finally;
-
- // The runtime generates this anyways.
- // ig.Emit (OpCodes.Endfinally);
-
- ig.EndExceptionBlock ();
-
- ig.MarkLabel (ec.LoopEnd);
- return false;
- }
-
- //
- // FIXME: possible optimization.
- // We might be able to avoid creating `empty' if the type is the sam
- //
- bool EmitArrayForeach (EmitContext ec, Type var_type)
- {
- Type array_type = expr.Type;
- Type element_type = array_type.GetElementType ();
- Expression conv = null;
- Expression empty = new EmptyExpression (element_type);
-
- conv = Expression.ConvertExplicit (ec, empty, var_type, loc);
- if (conv == null)
- return false;
-
- int rank = array_type.GetArrayRank ();
- ILGenerator ig = ec.ig;
-
- LocalBuilder copy = ig.DeclareLocal (array_type);
-
- //
- // Make our copy of the array
- //
- expr.Emit (ec);
- ig.Emit (OpCodes.Stloc, copy);
-
- if (rank == 1){
- LocalBuilder counter = ig.DeclareLocal (TypeManager.int32_type);
-
- Label loop, test;
-
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Stloc, counter);
- test = ig.DefineLabel ();
- ig.Emit (OpCodes.Br, test);
-
- loop = ig.DefineLabel ();
- ig.MarkLabel (loop);
-
- ig.Emit (OpCodes.Ldloc, copy);
- ig.Emit (OpCodes.Ldloc, counter);
- ArrayAccess.EmitLoadOpcode (ig, var_type);
-
- variable.EmitAssign (ec, conv);
-
- statement.Emit (ec);
-
- ig.MarkLabel (ec.LoopBegin);
- ig.Emit (OpCodes.Ldloc, counter);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.Emit (OpCodes.Add);
- ig.Emit (OpCodes.Stloc, counter);
-
- ig.MarkLabel (test);
- ig.Emit (OpCodes.Ldloc, counter);
- ig.Emit (OpCodes.Ldloc, copy);
- ig.Emit (OpCodes.Ldlen);
- ig.Emit (OpCodes.Conv_I4);
- ig.Emit (OpCodes.Blt, loop);
- } else {
- LocalBuilder [] dim_len = new LocalBuilder [rank];
- LocalBuilder [] dim_count = new LocalBuilder [rank];
- Label [] loop = new Label [rank];
- Label [] test = new Label [rank];
- int dim;
-
- for (dim = 0; dim < rank; dim++){
- dim_len [dim] = ig.DeclareLocal (TypeManager.int32_type);
- dim_count [dim] = ig.DeclareLocal (TypeManager.int32_type);
- test [dim] = ig.DefineLabel ();
- loop [dim] = ig.DefineLabel ();
- }
-
- for (dim = 0; dim < rank; dim++){
- ig.Emit (OpCodes.Ldloc, copy);
- IntLiteral.EmitInt (ig, dim);
- ig.Emit (OpCodes.Callvirt, TypeManager.int_getlength_int);
- ig.Emit (OpCodes.Stloc, dim_len [dim]);
- }
-
- for (dim = 0; dim < rank; dim++){
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Stloc, dim_count [dim]);
- ig.Emit (OpCodes.Br, test [dim]);
- ig.MarkLabel (loop [dim]);
- }
-
- ig.Emit (OpCodes.Ldloc, copy);
- for (dim = 0; dim < rank; dim++)
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
-
- //
- // FIXME: Maybe we can cache the computation of `get'?
- //
- Type [] args = new Type [rank];
- MethodInfo get;
-
- for (int i = 0; i < rank; i++)
- args [i] = TypeManager.int32_type;
-
- ModuleBuilder mb = CodeGen.ModuleBuilder;
- get = mb.GetArrayMethod (
- array_type, "Get",
- CallingConventions.HasThis| CallingConventions.Standard,
- var_type, args);
- ig.Emit (OpCodes.Call, get);
- variable.EmitAssign (ec, conv);
- statement.Emit (ec);
- ig.MarkLabel (ec.LoopBegin);
- for (dim = rank - 1; dim >= 0; dim--){
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
- ig.Emit (OpCodes.Ldc_I4_1);
- ig.Emit (OpCodes.Add);
- ig.Emit (OpCodes.Stloc, dim_count [dim]);
-
- ig.MarkLabel (test [dim]);
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
- ig.Emit (OpCodes.Ldloc, dim_len [dim]);
- ig.Emit (OpCodes.Blt, loop [dim]);
- }
- }
- ig.MarkLabel (ec.LoopEnd);
-
- return false;
- }
-
- public override bool Emit (EmitContext ec)
- {
- Type var_type;
- bool ret_val;
-
- var_type = RootContext.LookupType (ec.DeclSpace, type, false, loc);
- if (var_type == null)
- return false;
-
- //
- // We need an instance variable. Not sure this is the best
- // way of doing this.
- //
- // FIXME: When we implement propertyaccess, will those turn
- // out to return values in ExprClass? I think they should.
- //
- if (!(expr.eclass == ExprClass.Variable || expr.eclass == ExprClass.Value ||
- expr.eclass == ExprClass.PropertyAccess)){
- error1579 (expr.Type);
- return false;
- }
-
- ILGenerator ig = ec.ig;
-
- Label old_begin = ec.LoopBegin, old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- ec.LoopBegin = ig.DefineLabel ();
- ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- if (expr.Type.IsArray)
- ret_val = EmitArrayForeach (ec, var_type);
- else {
- ForeachHelperMethods hm;
-
- hm = ProbeCollectionType (ec, expr.Type);
- if (hm == null){
- error1579 (expr.Type);
- return false;
- }
-
- ret_val = EmitCollectionForeach (ec, var_type, hm);
- }
-
- ec.LoopBegin = old_begin;
- ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- return ret_val;
- }
- }
-}
-
diff --git a/mcs/mbas/statementCollection.cs b/mcs/mbas/statementCollection.cs
deleted file mode 100644
index 7479f48c9ad..00000000000
--- a/mcs/mbas/statementCollection.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// System.CodeDOM CodeStatementCollection Class implementation
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-//
-
-namespace Mono.CSharp {
-
- using System.Collections;
- using System;
-
- public class StatementCollection : IList, ICollection, IEnumerable {
-
- ArrayList statements;
-
- //
- // Constructors
- //
- public StatementCollection ()
- {
- statements = new ArrayList ();
- }
-
- //
- // Properties
- //
- public int Count {
- get {
- return statements.Count;
- }
- }
-
- //
- // Methods
- //
- public void Add (Statement value)
- {
- statements.Add (value);
- }
-
- public void AddRange (Statement [] values)
- {
- foreach (Statement ca in values)
- statements.Add (ca);
-
- }
-
- public void Clear ()
- {
- statements.Clear ();
- }
-
- private class Enumerator : IEnumerator {
- private StatementCollection collection;
- private int currentIndex = -1;
-
- internal Enumerator (StatementCollection collection)
- {
- this.collection = collection;
- }
-
- public object Current {
- get {
- if (currentIndex == collection.Count)
- throw new InvalidOperationException ();
- return collection [currentIndex];
- }
- }
-
- public bool MoveNext ()
- {
- if (currentIndex > collection.Count)
- throw new InvalidOperationException ();
- return ++currentIndex < collection.Count;
- }
-
- public void Reset ()
- {
- currentIndex = -1;
- }
- }
-
- public IEnumerator GetEnumerator ()
- {
- return new StatementCollection.Enumerator (this);
- }
-
- //
- // IList method implementations
- //
- public int Add (object value)
- {
- return statements.Add (value);
- }
-
- public bool Contains (Object value)
- {
- return statements.Contains (value);
- }
-
- public int IndexOf (Object value)
- {
- return statements.IndexOf (value);
- }
-
- public void Insert (int index, Object value)
- {
- statements [index] = value;
- }
-
- public object this[int index] {
- get {
- return statements [index];
- }
-
- set {
- statements [index] = value;
- }
- }
-
- public void Remove (object value)
- {
- statements.Remove (value);
- }
-
- public void RemoveAt (int index)
- {
- statements.RemoveAt (index);
- }
-
- //
- // ICollection method implementations
- //
- public void CopyTo (Array array, int index)
- {
- statements.CopyTo (array, index);
- }
-
- public object SyncRoot {
- get {
- return statements.SyncRoot;
- }
- }
-
- public bool IsReadOnly {
- get {
- return false;
- }
- }
-
- public bool IsSynchronized {
- get {
- return statements.IsSynchronized;
- }
- }
-
- public bool IsFixedSize {
- get {
- return false;
- }
- }
- }
-}
diff --git a/mcs/mbas/support.cs b/mcs/mbas/support.cs
deleted file mode 100644
index b62aabd16f8..00000000000
--- a/mcs/mbas/support.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-//
-// support.cs: Support routines to work around the fact that System.Reflection.Emit
-// can not introspect types that are being constructed
-//
-// Author:
-// Miguel de Icaza (miguel@ximian.com)
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-using System;
-using System.Text;
-using System.Reflection;
-using System.Collections;
-using System.Reflection.Emit;
-using System.Globalization;
-
-namespace Mono.CSharp {
-
- public interface ParameterData {
- Type ParameterType (int pos);
- int Count { get; }
- string ParameterDesc (int pos);
- Parameter.Modifier ParameterModifier (int pos);
- }
-
- public class ReflectionParameters : ParameterData {
- ParameterInfo [] pi;
- bool last_arg_is_params = false;
-
- public ReflectionParameters (ParameterInfo [] pi)
- {
- object [] attrs;
-
- this.pi = pi;
-
- int count = pi.Length-1;
-
- if (count >= 0) {
- attrs = pi [count].GetCustomAttributes (TypeManager.param_array_type, true);
-
- if (attrs == null)
- return;
-
- if (attrs.Length == 0)
- return;
-
- last_arg_is_params = true;
- }
- }
-
- public Type ParameterType (int pos)
- {
- if (last_arg_is_params && pos >= pi.Length - 1)
- return pi [pi.Length - 1].ParameterType;
- else
- return pi [pos].ParameterType;
- }
-
- public string ParameterDesc (int pos)
- {
- StringBuilder sb = new StringBuilder ();
-
- if (pi [pos].IsOut)
- sb.Append ("out ");
-
- if (pi [pos].IsIn)
- sb.Append ("in ");
-
- if (pos >= pi.Length - 1 && last_arg_is_params)
- sb.Append ("params ");
-
- sb.Append (TypeManager.CSharpName (ParameterType (pos)));
-
- return sb.ToString ();
-
- }
-
- public Parameter.Modifier ParameterModifier (int pos)
- {
- int len = pi.Length;
-
- if (pos >= len - 1)
- if (last_arg_is_params)
- return Parameter.Modifier.PARAMS;
-
- Type t = pi [pos].ParameterType;
- if (t.IsByRef)
- return Parameter.Modifier.OUT;
-
- return Parameter.Modifier.NONE;
- }
-
- public int Count {
- get {
- return pi.Length;
- }
- }
-
- }
-
- public class InternalParameters : ParameterData {
- Type [] param_types;
-
- Parameters parameters;
-
- public InternalParameters (Type [] param_types, Parameters parameters)
- {
- this.param_types = param_types;
- this.parameters = parameters;
- }
-
- public InternalParameters (DeclSpace ds, Parameters parameters)
- : this (parameters.GetParameterInfo (ds), parameters)
- {
- }
-
- public int Count {
- get {
- if (param_types == null)
- return 0;
-
- return param_types.Length;
- }
- }
-
- public Type ParameterType (int pos)
- {
- if (param_types == null)
- return null;
-
- Parameter [] fixed_pars = parameters.FixedParameters;
- if (fixed_pars != null){
- int len = fixed_pars.Length;
- if (pos < len)
- return parameters.FixedParameters [pos].ParameterType;
- else
- return parameters.ArrayParameter.ParameterType;
- } else
- return parameters.ArrayParameter.ParameterType;
- }
-
- public string ParameterDesc (int pos)
- {
- string tmp = String.Empty;
- Parameter p;
-
- if (pos >= parameters.FixedParameters.Length)
- p = parameters.ArrayParameter;
- else
- p = parameters.FixedParameters [pos];
-
- if (p.ModFlags == Parameter.Modifier.REF)
- tmp = "ref ";
- else if (p.ModFlags == Parameter.Modifier.OUT)
- tmp = "out ";
- else if (p.ModFlags == Parameter.Modifier.PARAMS)
- tmp = "params ";
-
- Type t = ParameterType (pos);
-
- return tmp + TypeManager.CSharpName (t);
- }
-
- public Parameter.Modifier ParameterModifier (int pos)
- {
- if (parameters.FixedParameters == null) {
- if (parameters.ArrayParameter != null)
- return parameters.ArrayParameter.ModFlags;
- else
- return Parameter.Modifier.NONE;
- }
-
- if (pos >= parameters.FixedParameters.Length)
- return parameters.ArrayParameter.ModFlags;
- else {
- Parameter.Modifier m = parameters.FixedParameters [pos].ModFlags;
-
- //
- // We use a return value of "OUT" for "reference" parameters.
- // both out and ref flags in the source map to reference parameters.
- //
- if (m == Parameter.Modifier.OUT || m == Parameter.Modifier.REF)
- return Parameter.Modifier.OUT;
-
- return Parameter.Modifier.NONE;
- }
- }
-
- }
-
- class PtrHashtable : Hashtable {
- class PtrComparer : IComparer {
- public int Compare (object x, object y)
- {
- if (x == y)
- return 0;
- else
- return 1;
- }
- }
-
- public PtrHashtable ()
- {
- comparer = new PtrComparer ();
- }
- }
-
- //
- // Compares member infos based on their name and
- // also allows one argument to be a string
- //
- class MemberInfoCompare : IComparer {
-
- public int Compare (object a, object b)
- {
- if (a == null || b == null){
- Console.WriteLine ("Invalid information passed");
- throw new Exception ();
- }
-
- if (a is string)
- return String.Compare ((string) a, ((MemberInfo)b).Name);
-
- if (b is string)
- return String.Compare (((MemberInfo)a).Name, (string) b);
-
- return String.Compare (((MemberInfo)a).Name, ((MemberInfo)b).Name);
- }
- }
-
- struct Pair {
- public object First;
- public object Second;
-
- public Pair (object f, object s)
- {
- First = f;
- Second = s;
- }
- }
-}
diff --git a/mcs/mbas/testmbas/.cvsignore b/mcs/mbas/testmbas/.cvsignore
deleted file mode 100644
index e57ea06cf94..00000000000
--- a/mcs/mbas/testmbas/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.exe
-*.pdb
-*.vbproj
-*.vbproj.user
diff --git a/mcs/mbas/testmbas/AssemblyInfo.vb b/mcs/mbas/testmbas/AssemblyInfo.vb
deleted file mode 100644
index f600c94bc01..00000000000
--- a/mcs/mbas/testmbas/AssemblyInfo.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-Imports System.Reflection
-Imports System.Runtime.InteropServices
-
-' General Information about an assembly is controlled through the following
-' set of attributes. Change these attribute values to modify the information
-' associated with an assembly.
-
-' Review the values of the assembly attributes
-
-<Assembly: AssemblyTitle("")>
-<Assembly: AssemblyDescription("")>
-<Assembly: AssemblyCompany("")>
-<Assembly: AssemblyProduct("")>
-<Assembly: AssemblyCopyright("")>
-<Assembly: AssemblyTrademark("")>
-<Assembly: CLSCompliant(True)>
-
-'The following GUID is for the ID of the typelib if this project is exposed to COM
-<Assembly: Guid("EA89BB68-1010-427C-A8B5-917940328A4B")>
-
-' Version information for an assembly consists of the following four values:
-'
-' Major Version
-' Minor Version
-' Build Number
-' Revision
-'
-' You can specify all the values or you can default the Build and Revision Numbers
-' by using the '*' as shown below:
-
-<Assembly: AssemblyVersion("1.0.*")>
diff --git a/mcs/mbas/testmbas/WriteOK.vb b/mcs/mbas/testmbas/WriteOK.vb
deleted file mode 100644
index abe4911b4de..00000000000
--- a/mcs/mbas/testmbas/WriteOK.vb
+++ /dev/null
@@ -1,17 +0,0 @@
-Module WriteOK
-
- Sub Main()
- REM Testing old-fashioned comments
- Console.WriteLine("OK!") ' Simple comments
- End Sub
-
-End Module
-
-Module WriteOK2
-
- Sub [Sub]() ' Escaped identifier
- Console.WriteLine("Sub:OK!")
- End Sub
-
-End Module
-
diff --git a/mcs/mbas/tree.cs b/mcs/mbas/tree.cs
deleted file mode 100644
index 2cf5be8ca5c..00000000000
--- a/mcs/mbas/tree.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// tree.cs: keeps a tree representation of the generated code
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.IO;
-
-namespace Mono.CSharp
-{
-
- public interface ITreeDump {
- int Dump (Tree tree, StreamWriter output);
- void ParseOptions (string options);
- }
-
- // <summary>
- //
- // We store here all the toplevel types that we have parsed,
- // this is the root of all information we have parsed.
- //
- // </summary>
-
- public class Tree {
- TypeContainer root_types;
-
- // <summary>
- // Keeps track of namespaces defined in the source code
- // </summary>
- Hashtable namespaces;
-
- // <summary>
- // Keeps track of all the types definied (classes, structs, ifaces, enums)
- // </summary>
- Hashtable decls;
-
- public Tree ()
- {
- root_types = new TypeContainer (null, "", new Location (-1));
-
- decls = new Hashtable ();
- namespaces = new Hashtable ();
- }
-
- public void RecordDecl (string name, DeclSpace ds)
- {
- if (decls.Contains (name)){
- Report.Error (
- 101, ds.Location,
- "There is already a definition for `" + name + "'");
- DeclSpace other = (DeclSpace) decls [name];
- Report.Error (0,
- other.Location, "(Location of symbol related to previous error)");
- return;
- }
- decls.Add (name, ds);
- }
-
- public Namespace RecordNamespace (Namespace parent, string file, string name)
- {
- Namespace ns = new Namespace (parent, name);
-
- if (namespaces.Contains (file)){
- Hashtable ns_ns = (Hashtable) namespaces [file];
-
- if (ns_ns.Contains (ns.Name))
- return (Namespace) ns_ns [ns.Name];
- ns_ns.Add (ns.Name, ns);
- } else {
- Hashtable new_table = new Hashtable ();
- namespaces [file] = new_table;
-
- new_table.Add (ns.Name, ns);
- }
-
- return ns;
- }
-
- //
- // FIXME: Why are we using Types?
- //
- public TypeContainer Types {
- get {
- return root_types;
- }
- }
-
- public Hashtable Decls {
- get {
- return decls;
- }
- }
-
- public Hashtable Namespaces {
- get {
- return namespaces;
- }
- }
- }
-}
diff --git a/mcs/mbas/typemanager.cs b/mcs/mbas/typemanager.cs
deleted file mode 100644
index 3702757da07..00000000000
--- a/mcs/mbas/typemanager.cs
+++ /dev/null
@@ -1,1687 +0,0 @@
-//
-// typemanager.cs: C# type manager
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-// Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-#define CACHE
-
-using System;
-using System.Globalization;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Text.RegularExpressions;
-using System.Runtime.CompilerServices;
-using System.Diagnostics;
-
-namespace Mono.CSharp {
-
-public class TypeManager {
- //
- // A list of core types that the compiler requires or uses
- //
- static public Type object_type;
- static public Type value_type;
- static public Type string_type;
- static public Type int32_type;
- static public Type uint32_type;
- static public Type int64_type;
- static public Type uint64_type;
- static public Type float_type;
- static public Type double_type;
- static public Type char_type;
- static public Type char_ptr_type;
- static public Type short_type;
- static public Type decimal_type;
- static public Type bool_type;
- static public Type sbyte_type;
- static public Type byte_type;
- static public Type ushort_type;
- static public Type enum_type;
- static public Type delegate_type;
- static public Type multicast_delegate_type;
- static public Type void_type;
- static public Type enumeration_type;
- static public Type array_type;
- static public Type runtime_handle_type;
- static public Type icloneable_type;
- static public Type type_type;
- static public Type ienumerator_type;
- static public Type idisposable_type;
- static public Type default_member_type;
- static public Type iasyncresult_type;
- static public Type asynccallback_type;
- static public Type intptr_type;
- static public Type monitor_type;
- static public Type runtime_field_handle_type;
- static public Type attribute_type;
- static public Type attribute_usage_type;
- static public Type dllimport_type;
- static public Type unverifiable_code_type;
- static public Type methodimpl_attr_type;
- static public Type marshal_as_attr_type;
- static public Type param_array_type;
- static public Type void_ptr_type;
- static public Type indexer_name_type;
- static public object obsolete_attribute_type;
- static public object conditional_attribute_type;
-
- static public Type [] NoTypes;
-
-
- //
- // Internal, not really used outside
- //
- static Type runtime_helpers_type;
-
- //
- // These methods are called by code generated by the compiler
- //
- static public MethodInfo string_concat_string_string;
- static public MethodInfo string_concat_object_object;
- static public MethodInfo string_isinterneted_string;
- static public MethodInfo system_type_get_type_from_handle;
- static public MethodInfo object_getcurrent_void;
- static public MethodInfo bool_movenext_void;
- static public MethodInfo void_dispose_void;
- static public MethodInfo void_monitor_enter_object;
- static public MethodInfo void_monitor_exit_object;
- static public MethodInfo void_initializearray_array_fieldhandle;
- static public MethodInfo int_getlength_int;
- static public MethodInfo delegate_combine_delegate_delegate;
- static public MethodInfo delegate_remove_delegate_delegate;
- static public MethodInfo int_get_offset_to_string_data;
- static public MethodInfo int_array_get_length;
-
- //
- // The attribute constructors.
- //
- static public ConstructorInfo cons_param_array_attribute;
- static public ConstructorInfo void_decimal_ctor_five_args;
-
- // <remarks>
- // Holds the Array of Assemblies that have been loaded
- // (either because it is the default or the user used the
- // -r command line option)
- // </remarks>
- static Assembly [] assemblies;
-
- // <remarks>
- // Keeps a list of module builders. We used this to do lookups
- // on the modulebuilder using GetType -- needed for arrays
- // </remarks>
- static ModuleBuilder [] modules;
-
- // <remarks>
- // This is the type_cache from the assemblies to avoid
- // hitting System.Reflection on every lookup.
- // </summary>
- static Hashtable types;
-
- // <remarks>
- // This is used to hotld the corresponding TypeContainer objects
- // since we need this in FindMembers
- // </remarks>
- static Hashtable typecontainers;
-
- // <remarks>
- // Keeps track of those types that are defined by the
- // user's program
- // </remarks>
- static ArrayList user_types;
-
- // <remarks>
- // Keeps a mapping between TypeBuilders and their TypeContainers
- // </remarks>
- static PtrHashtable builder_to_container;
-
- // <remarks>
- // Tracks the interfaces implemented by typebuilders. We only
- // enter those who do implement or or more interfaces
- // </remarks>
- static PtrHashtable builder_to_ifaces;
-
- // <remarks>
- // Maps MethodBase.RuntimeTypeHandle to a Type array that contains
- // the arguments to the method
- // </remarks>
- static Hashtable method_arguments;
-
- // <remarks>
- // Maybe `method_arguments' should be replaced and only
- // method_internal_params should be kept?
- // <remarks>
- static Hashtable method_internal_params;
-
- static PtrHashtable builder_to_interface;
-
- // <remarks>
- // Keeps track of delegate types
- // </remarks>
-
- static Hashtable builder_to_delegate;
-
- // <remarks>
- // Keeps track of enum types
- // </remarks>
-
- static Hashtable builder_to_enum;
-
- // <remarks>
- // Keeps track of attribute types
- // </remarks>
-
- static Hashtable builder_to_attr;
-
- struct Signature {
- public string name;
- public Type [] args;
- }
-
- /// <summary>
- /// A filter for Findmembers that uses the Signature object to
- /// extract objects
- /// </summary>
- static bool SignatureFilter (MemberInfo mi, object criteria)
- {
- Signature sig = (Signature) criteria;
-
- if (!(mi is MethodBase))
- return false;
-
- if (mi.Name != sig.name)
- return false;
-
- int count = sig.args.Length;
-
- if (mi is MethodBuilder || mi is ConstructorBuilder){
- Type [] candidate_args = GetArgumentTypes ((MethodBase) mi);
-
- if (candidate_args.Length != count)
- return false;
-
- for (int i = 0; i < count; i++)
- if (candidate_args [i] != sig.args [i])
- return false;
-
- return true;
- } else {
- ParameterInfo [] pars = ((MethodBase) mi).GetParameters ();
-
- if (pars.Length != count)
- return false;
-
- for (int i = 0; i < count; i++)
- if (pars [i].ParameterType != sig.args [i])
- return false;
- return true;
- }
- }
-
- // A delegate that points to the filter above.
- static MemberFilter signature_filter;
-
- static TypeManager ()
- {
- assemblies = new Assembly [0];
- modules = null;
- user_types = new ArrayList ();
-
- types = new Hashtable ();
- typecontainers = new Hashtable ();
-
- builder_to_interface = new PtrHashtable ();
- builder_to_delegate = new PtrHashtable ();
- builder_to_enum = new PtrHashtable ();
- builder_to_attr = new PtrHashtable ();
- method_arguments = new PtrHashtable ();
- method_internal_params = new PtrHashtable ();
- builder_to_container = new PtrHashtable ();
- builder_to_ifaces = new PtrHashtable ();
-
- NoTypes = new Type [0];
-
- signature_filter = new MemberFilter (SignatureFilter);
- }
-
- public static void AddUserType (string name, TypeBuilder t, Type [] ifaces)
- {
- try {
- types.Add (name, t);
- } catch {
- Type prev = (Type) types [name];
- TypeContainer tc = (TypeContainer) builder_to_container [prev];
-
- if (tc != null){
- //
- // This probably never happens, as we catch this before
- //
- Report.Error (-17, "The type `" + name + "' has already been defined.");
- return;
- }
-
- tc = (TypeContainer) builder_to_container [t];
-
- Report.Warning (
- 1595, "The type `" + name + "' is defined in an existing assembly;"+
- " Using the new definition from: " + tc.Location);
- Report.Warning (1595, "Previously defined in: " + prev.Assembly.FullName);
-
- types.Remove (name);
- types.Add (name, t);
- }
- user_types.Add (t);
-
- if (ifaces != null)
- builder_to_ifaces [t] = ifaces;
- }
-
- //
- // This entry point is used by types that we define under the covers
- //
- public static void RegisterBuilder (TypeBuilder tb, Type [] ifaces)
- {
- if (ifaces != null)
- builder_to_ifaces [tb] = ifaces;
- }
-
- public static void AddUserType (string name, TypeBuilder t, TypeContainer tc, Type [] ifaces)
- {
- builder_to_container.Add (t, tc);
- typecontainers.Add (name, tc);
- AddUserType (name, t, ifaces);
- }
-
- public static void AddDelegateType (string name, TypeBuilder t, Delegate del)
- {
- types.Add (name, t);
- builder_to_delegate.Add (t, del);
- }
-
- public static void AddEnumType (string name, TypeBuilder t, Enum en)
- {
- types.Add (name, t);
- builder_to_enum.Add (t, en);
- }
-
- public static void AddUserInterface (string name, TypeBuilder t, Interface i, Type [] ifaces)
- {
- AddUserType (name, t, ifaces);
- builder_to_interface.Add (t, i);
- }
-
- public static void RegisterAttrType (Type t, TypeContainer tc)
- {
- builder_to_attr.Add (t, tc);
- }
-
- /// <summary>
- /// Returns the TypeContainer whose Type is `t' or null if there is no
- /// TypeContainer for `t' (ie, the Type comes from a library)
- /// </summary>
- public static TypeContainer LookupTypeContainer (Type t)
- {
- return (TypeContainer) builder_to_container [t];
- }
-
- public static Interface LookupInterface (Type t)
- {
- return (Interface) builder_to_interface [t];
- }
-
- public static Delegate LookupDelegate (Type t)
- {
- return (Delegate) builder_to_delegate [t];
- }
-
- public static Enum LookupEnum (Type t)
- {
- return (Enum) builder_to_enum [t];
- }
-
- public static TypeContainer LookupAttr (Type t)
- {
- return (TypeContainer) builder_to_attr [t];
- }
-
- /// <summary>
- /// Registers an assembly to load types from.
- /// </summary>
- public static void AddAssembly (Assembly a)
- {
- int top = assemblies.Length;
- Assembly [] n = new Assembly [top + 1];
-
- assemblies.CopyTo (n, 0);
-
- n [top] = a;
- assemblies = n;
- }
-
- /// <summary>
- /// Registers a module builder to lookup types from
- /// </summary>
- public static void AddModule (ModuleBuilder mb)
- {
- int top = modules != null ? modules.Length : 0;
- ModuleBuilder [] n = new ModuleBuilder [top + 1];
-
- if (modules != null)
- modules.CopyTo (n, 0);
- n [top] = mb;
- modules = n;
- }
-
- /// <summary>
- /// Returns the Type associated with @name
- /// </summary>
- public static Type LookupType (string name)
- {
- Type t;
-
- //
- // First lookup in user defined and cached values
- //
-
- t = (Type) types [name];
- if (t != null)
- return t;
-
- foreach (Assembly a in assemblies){
- t = a.GetType (name);
- if (t != null){
- types [name] = t;
-
- return t;
- }
- }
-
- foreach (ModuleBuilder mb in modules) {
- t = mb.GetType (name);
- if (t != null) {
- types [name] = t;
- return t;
- }
- }
-
- return null;
- }
-
- /// <summary>
- /// Returns the C# name of a type if possible, or the full type name otherwise
- /// </summary>
- static public string CSharpName (Type t)
- {
- return Regex.Replace (t.FullName,
- @"^System\." +
- @"(Int32|UInt32|Int16|Uint16|Int64|UInt64|" +
- @"Single|Double|Char|Decimal|Byte|SByte|Object|" +
- @"Boolean|String|Void)" +
- @"(\W+|\b)",
- new MatchEvaluator (CSharpNameMatch));
- }
-
- static String CSharpNameMatch (Match match)
- {
- string s = match.Groups [1].Captures [0].Value;
- return s.ToLower ().
- Replace ("int32", "int").
- Replace ("uint32", "uint").
- Replace ("int16", "short").
- Replace ("uint16", "ushort").
- Replace ("int64", "long").
- Replace ("uint64", "ulong").
- Replace ("single", "float").
- Replace ("boolean", "bool")
- + match.Groups [2].Captures [0].Value;
- }
-
- /// <summary>
- /// Returns the signature of the method
- /// </summary>
- static public string CSharpSignature (MethodBase mb)
- {
- string sig = "(";
-
- //
- // FIXME: We should really have a single function to do
- // everything instead of the following 5 line pattern
- //
- ParameterData iparams = LookupParametersByBuilder (mb);
-
- if (iparams == null){
- ParameterInfo [] pi = mb.GetParameters ();
- iparams = new ReflectionParameters (pi);
- }
-
- for (int i = 0; i < iparams.Count; i++) {
- if (i > 0) {
- sig += ", ";
- }
- sig += iparams.ParameterDesc(i);
- }
- sig += ")";
-
- return mb.DeclaringType.Name + "." + mb.Name + sig;
- }
-
- /// <summary>
- /// Looks up a type, and aborts if it is not found. This is used
- /// by types required by the compiler
- /// </summary>
- static Type CoreLookupType (string name)
- {
- Type t = LookupType (name);
-
- if (t == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
- Environment.Exit (0);
- }
-
- return t;
- }
-
- /// <summary>
- /// Returns the MethodInfo for a method named `name' defined
- /// in type `t' which takes arguments of types `args'
- /// </summary>
- static MethodInfo GetMethod (Type t, string name, Type [] args)
- {
- MemberInfo [] mi;
- Signature sig;
-
- sig.name = name;
- sig.args = args;
-
- mi = FindMembers (
- t, MemberTypes.Method,
- instance_and_static | BindingFlags.Public, signature_filter, sig);
- if (mi == null || mi.Length == 0 || !(mi [0] is MethodInfo)){
- Report.Error (-19, "Can not find the core function `" + name + "'");
- return null;
- }
-
- return (MethodInfo) mi [0];
- }
-
- /// <summary>
- /// Returns the ConstructorInfo for "args"
- /// </summary>
- static ConstructorInfo GetConstructor (Type t, Type [] args)
- {
- MemberInfo [] mi;
- Signature sig;
-
- sig.name = ".ctor";
- sig.args = args;
-
- mi = FindMembers (t, MemberTypes.Constructor,
- instance_and_static | BindingFlags.Public | BindingFlags.DeclaredOnly, signature_filter, sig);
- if (mi == null || mi.Length == 0 || !(mi [0] is ConstructorInfo)){
- Report.Error (-19, "Can not find the core constructor for type `" + t.Name + "'");
- return null;
- }
-
- return (ConstructorInfo) mi [0];
- }
-
- public static void InitEnumUnderlyingTypes ()
- {
-
- int32_type = CoreLookupType ("System.Int32");
- int64_type = CoreLookupType ("System.Int64");
- uint32_type = CoreLookupType ("System.UInt32");
- uint64_type = CoreLookupType ("System.UInt64");
- byte_type = CoreLookupType ("System.Byte");
- sbyte_type = CoreLookupType ("System.SByte");
- short_type = CoreLookupType ("System.Int16");
- ushort_type = CoreLookupType ("System.UInt16");
- }
-
- /// <remarks>
- /// The types have to be initialized after the initial
- /// population of the type has happened (for example, to
- /// bootstrap the corlib.dll
- /// </remarks>
- public static void InitCoreTypes ()
- {
- object_type = CoreLookupType ("System.Object");
- value_type = CoreLookupType ("System.ValueType");
-
- InitEnumUnderlyingTypes ();
-
- char_type = CoreLookupType ("System.Char");
- string_type = CoreLookupType ("System.String");
- float_type = CoreLookupType ("System.Single");
- double_type = CoreLookupType ("System.Double");
- char_ptr_type = CoreLookupType ("System.Char*");
- decimal_type = CoreLookupType ("System.Decimal");
- bool_type = CoreLookupType ("System.Boolean");
- enum_type = CoreLookupType ("System.Enum");
-
- multicast_delegate_type = CoreLookupType ("System.MulticastDelegate");
- delegate_type = CoreLookupType ("System.Delegate");
-
- array_type = CoreLookupType ("System.Array");
- void_type = CoreLookupType ("System.Void");
- type_type = CoreLookupType ("System.Type");
-
- runtime_field_handle_type = CoreLookupType ("System.RuntimeFieldHandle");
- runtime_helpers_type = CoreLookupType ("System.Runtime.CompilerServices.RuntimeHelpers");
- default_member_type = CoreLookupType ("System.Reflection.DefaultMemberAttribute");
- runtime_handle_type = CoreLookupType ("System.RuntimeTypeHandle");
- asynccallback_type = CoreLookupType ("System.AsyncCallback");
- iasyncresult_type = CoreLookupType ("System.IAsyncResult");
- ienumerator_type = CoreLookupType ("System.Collections.IEnumerator");
- idisposable_type = CoreLookupType ("System.IDisposable");
- icloneable_type = CoreLookupType ("System.ICloneable");
- monitor_type = CoreLookupType ("System.Threading.Monitor");
- intptr_type = CoreLookupType ("System.IntPtr");
-
- attribute_type = CoreLookupType ("System.Attribute");
- attribute_usage_type = CoreLookupType ("System.AttributeUsageAttribute");
- dllimport_type = CoreLookupType ("System.Runtime.InteropServices.DllImportAttribute");
- methodimpl_attr_type = CoreLookupType ("System.Runtime.CompilerServices.MethodImplAttribute");
- marshal_as_attr_type = CoreLookupType ("System.Runtime.InteropServices.MarshalAsAttribute");
- param_array_type = CoreLookupType ("System.ParamArrayAttribute");
-
- unverifiable_code_type= CoreLookupType ("System.Security.UnverifiableCodeAttribute");
-
- void_ptr_type = CoreLookupType ("System.Void*");
-
- indexer_name_type = CoreLookupType ("System.Runtime.CompilerServices.IndexerNameAttribute");
-
- //
- // Attribute types
- //
- obsolete_attribute_type = CoreLookupType ("System.ObsoleteAttribute");
- conditional_attribute_type = CoreLookupType ("System.Diagnostics.ConditionalAttribute");
- }
-
- //
- // The helper methods that are used by the compiler
- //
- public static void InitCodeHelpers ()
- {
- //
- // Now load the default methods that we use.
- //
- Type [] string_string = { string_type, string_type };
- string_concat_string_string = GetMethod (
- string_type, "Concat", string_string);
-
- Type [] object_object = { object_type, object_type };
- string_concat_object_object = GetMethod (
- string_type, "Concat", object_object);
-
- Type [] string_ = { string_type };
- string_isinterneted_string = GetMethod (
- string_type, "IsInterned", string_);
-
- Type [] runtime_type_handle = { runtime_handle_type };
- system_type_get_type_from_handle = GetMethod (
- type_type, "GetTypeFromHandle", runtime_type_handle);
-
- Type [] delegate_delegate = { delegate_type, delegate_type };
- delegate_combine_delegate_delegate = GetMethod (
- delegate_type, "Combine", delegate_delegate);
-
- delegate_remove_delegate_delegate = GetMethod (
- delegate_type, "Remove", delegate_delegate);
-
- //
- // Void arguments
- //
- Type [] void_arg = { };
- object_getcurrent_void = GetMethod (
- ienumerator_type, "get_Current", void_arg);
- bool_movenext_void = GetMethod (
- ienumerator_type, "MoveNext", void_arg);
- void_dispose_void = GetMethod (
- idisposable_type, "Dispose", void_arg);
- int_get_offset_to_string_data = GetMethod (
- runtime_helpers_type, "get_OffsetToStringData", void_arg);
- int_array_get_length = GetMethod (
- array_type, "get_Length", void_arg);
-
- //
- // object arguments
- //
- Type [] object_arg = { object_type };
- void_monitor_enter_object = GetMethod (
- monitor_type, "Enter", object_arg);
- void_monitor_exit_object = GetMethod (
- monitor_type, "Exit", object_arg);
-
- Type [] array_field_handle_arg = { array_type, runtime_field_handle_type };
-
- void_initializearray_array_fieldhandle = GetMethod (
- runtime_helpers_type, "InitializeArray", array_field_handle_arg);
-
- //
- // Array functions
- //
- Type [] int_arg = { int32_type };
- int_getlength_int = GetMethod (
- array_type, "GetLength", int_arg);
-
- //
- // Decimal constructors
- //
- Type [] dec_arg = { int32_type, int32_type, int32_type, bool_type, byte_type };
- void_decimal_ctor_five_args = GetConstructor (
- decimal_type, dec_arg);
-
- //
- // Attributes
- //
- cons_param_array_attribute = GetConstructor (
- param_array_type, void_arg);
-
- }
-
- const BindingFlags instance_and_static = BindingFlags.Static | BindingFlags.Instance;
-
- //
- // FIXME: This can be optimized easily. speedup by having a single builder mapping
- //
- public static MemberInfo [] FindMembers (Type t, MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
- {
- //
- // We have to take care of arrays specially, because GetType on
- // a TypeBuilder array will return a Type, not a TypeBuilder,
- // and we can not call FindMembers on this type.
- //
- if (t.IsSubclassOf (TypeManager.array_type))
- return TypeManager.array_type.FindMembers (mt, bf, filter, criteria);
-
- if (!(t is TypeBuilder)){
- //
- // Since FindMembers will not lookup both static and instance
- // members, we emulate this behaviour here.
- //
- if ((bf & instance_and_static) == instance_and_static){
- MemberInfo [] i_members = t.FindMembers (
- mt, bf & ~BindingFlags.Static, filter, criteria);
-
- int i_len = i_members.Length;
- if (i_len == 1){
- MemberInfo one = i_members [0];
-
- //
- // If any of these are present, we are done!
- //
- if ((one is Type) || (one is EventInfo) || (one is FieldInfo))
- return i_members;
- }
-
- MemberInfo [] s_members = t.FindMembers (
- mt, bf & ~BindingFlags.Instance, filter, criteria);
-
- int s_len = s_members.Length;
- if (i_len > 0 || s_len > 0){
- MemberInfo [] both = new MemberInfo [i_len + s_len];
-
- i_members.CopyTo (both, 0);
- s_members.CopyTo (both, i_len);
-
- return both;
- } else {
- if (i_len > 0)
- return i_members;
- else
- return s_members;
- }
- }
- return t.FindMembers (mt, bf, filter, criteria);
- }
-
- //
- // FIXME: We should not have builder_to_blah everywhere,
- // we should just have a builder_to_findmemberizable
- // and have them implement a new ICanFindMembers interface
- //
- Enum e = (Enum) builder_to_enum [t];
-
- if (e != null)
- return e.FindMembers (mt, bf, filter, criteria);
-
- Delegate del = (Delegate) builder_to_delegate [t];
-
- if (del != null)
- return del.FindMembers (mt, bf, filter, criteria);
-
- Interface iface = (Interface) builder_to_interface [t];
-
- if (iface != null)
- return iface.FindMembers (mt, bf, filter, criteria);
-
- TypeContainer tc = (TypeContainer) builder_to_container [t];
-
- if (tc != null)
- return tc.FindMembers (mt, bf, filter, criteria);
-
- return null;
- }
-
- public static bool IsBuiltinType (Type t)
- {
- if (t == object_type || t == string_type || t == int32_type || t == uint32_type ||
- t == int64_type || t == uint64_type || t == float_type || t == double_type ||
- t == char_type || t == short_type || t == decimal_type || t == bool_type ||
- t == sbyte_type || t == byte_type || t == ushort_type)
- return true;
- else
- return false;
- }
-
- public static bool IsDelegateType (Type t)
- {
- if (t.IsSubclassOf (TypeManager.delegate_type))
- return true;
- else
- return false;
- }
-
- public static bool IsEnumType (Type t)
- {
- if (t.IsSubclassOf (TypeManager.enum_type))
- return true;
- else
- return false;
- }
-
- public static bool IsInterfaceType (Type t)
- {
- Interface iface = (Interface) builder_to_interface [t];
-
- if (iface != null)
- return true;
- else
- return false;
- }
-
- /// <summary>
- /// Returns the User Defined Types
- /// </summary>
- public static ArrayList UserTypes {
- get {
- return user_types;
- }
- }
-
- public static Hashtable TypeContainers {
- get {
- return typecontainers;
- }
- }
-
- static Hashtable builder_to_constant;
-
- public static void RegisterConstant (FieldBuilder fb, Const c)
- {
- if (builder_to_constant == null)
- builder_to_constant = new PtrHashtable ();
-
- if (builder_to_constant.Contains (fb))
- return;
-
- builder_to_constant.Add (fb, c);
- }
-
- public static Const LookupConstant (FieldBuilder fb)
- {
- if (builder_to_constant == null)
- return null;
-
- return (Const) builder_to_constant [fb];
- }
-
- /// <summary>
- /// Gigantic work around for missing features in System.Reflection.Emit follows.
- /// </summary>
- ///
- /// <remarks>
- /// Since System.Reflection.Emit can not return MethodBase.GetParameters
- /// for anything which is dynamic, and we need this in a number of places,
- /// we register this information here, and use it afterwards.
- /// </remarks>
- static public bool RegisterMethod (MethodBase mb, InternalParameters ip, Type [] args)
- {
- if (args == null)
- args = NoTypes;
-
- method_arguments.Add (mb, args);
- method_internal_params.Add (mb, ip);
-
- return true;
- }
-
- static public InternalParameters LookupParametersByBuilder (MethodBase mb)
- {
- if (! (mb is ConstructorBuilder || mb is MethodBuilder))
- return null;
-
- if (method_internal_params.Contains (mb))
- return (InternalParameters) method_internal_params [mb];
- else
- throw new Exception ("Argument for Method not registered" + mb);
- }
-
- /// <summary>
- /// Returns the argument types for a method based on its methodbase
- ///
- /// For dynamic methods, we use the compiler provided types, for
- /// methods from existing assemblies we load them from GetParameters,
- /// and insert them into the cache
- /// </summary>
- static public Type [] GetArgumentTypes (MethodBase mb)
- {
- if (method_arguments.Contains (mb))
- return (Type []) method_arguments [mb];
- else {
- ParameterInfo [] pi = mb.GetParameters ();
- int c = pi.Length;
- Type [] types = new Type [c];
-
- for (int i = 0; i < c; i++)
- types [i] = pi [i].ParameterType;
-
- method_arguments.Add (mb, types);
- return types;
- }
- }
-
- // <remarks>
- // This is a workaround the fact that GetValue is not
- // supported for dynamic types
- // </remarks>
- static Hashtable fields = new Hashtable ();
- static public bool RegisterFieldValue (FieldBuilder fb, object value)
- {
- if (fields.Contains (fb))
- return false;
-
- fields.Add (fb, value);
-
- return true;
- }
-
- static public object GetValue (FieldBuilder fb)
- {
- return fields [fb];
- }
-
- static Hashtable fieldbuilders_to_fields = new Hashtable ();
- static public bool RegisterFieldBase (FieldBuilder fb, FieldBase f)
- {
- if (fieldbuilders_to_fields.Contains (fb))
- return false;
-
- fieldbuilders_to_fields.Add (fb, f);
- return true;
- }
-
- static public FieldBase GetField (FieldInfo fb)
- {
- return (FieldBase) fieldbuilders_to_fields [fb];
- }
-
- static Hashtable events;
-
- static public bool RegisterEvent (MyEventBuilder eb, MethodBase add, MethodBase remove)
- {
- if (events == null)
- events = new Hashtable ();
-
- if (events.Contains (eb))
- return false;
-
- events.Add (eb, new Pair (add, remove));
-
- return true;
- }
-
- static public MethodInfo GetAddMethod (EventInfo ei)
- {
- if (ei is MyEventBuilder) {
- Pair pair = (Pair) events [ei];
-
- return (MethodInfo) pair.First;
- } else
- return ei.GetAddMethod ();
- }
-
- static public MethodInfo GetRemoveMethod (EventInfo ei)
- {
- if (ei is MyEventBuilder) {
- Pair pair = (Pair) events [ei];
-
- return (MethodInfo) pair.Second;
- } else
- return ei.GetAddMethod ();
- }
-
- static Hashtable properties;
-
- static public bool RegisterProperty (PropertyBuilder pb, MethodBase get, MethodBase set)
- {
- if (properties == null)
- properties = new Hashtable ();
-
- if (properties.Contains (pb))
- return false;
-
- properties.Add (pb, new Pair (get, set));
-
- return true;
- }
-
- //
- // FIXME: we need to return the accessors depending on whether
- // they are visible or not.
- //
- static public MethodInfo [] GetAccessors (PropertyInfo pi)
- {
- MethodInfo [] ret;
-
- if (pi is PropertyBuilder){
- Pair pair = (Pair) properties [pi];
-
- ret = new MethodInfo [2];
- ret [0] = (MethodInfo) pair.First;
- ret [1] = (MethodInfo) pair.Second;
-
- return ret;
- } else {
- MethodInfo [] mi = new MethodInfo [2];
-
- //
- // Why this and not pi.GetAccessors?
- // Because sometimes index 0 is the getter
- // sometimes it is 1
- //
- mi [0] = pi.GetGetMethod (true);
- mi [1] = pi.GetSetMethod (true);
-
- return mi;
- }
- }
-
- static public MethodInfo GetPropertyGetter (PropertyInfo pi)
- {
- if (pi is PropertyBuilder){
- Pair de = (Pair) properties [pi];
-
- return (MethodInfo) de.Second;
- } else
- return pi.GetSetMethod ();
- }
-
- static public MethodInfo GetPropertySetter (PropertyInfo pi)
- {
- if (pi is PropertyBuilder){
- Pair de = (Pair) properties [pi];
-
- return (MethodInfo) de.First;
- } else
- return pi.GetGetMethod ();
- }
-
- /// <summary>
- /// Given an array of interface types, expand and eliminate repeated ocurrences
- /// of an interface.
- /// </summary>
- ///
- /// <remarks>
- /// This expands in context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
- /// be IA, IB, IC.
- /// </remarks>
- public static Type [] ExpandInterfaces (Type [] base_interfaces)
- {
- ArrayList new_ifaces = new ArrayList ();
-
- foreach (Type iface in base_interfaces){
- if (!new_ifaces.Contains (iface))
- new_ifaces.Add (iface);
-
- Type [] implementing = TypeManager.GetInterfaces (iface);
-
- foreach (Type imp in implementing){
- if (!new_ifaces.Contains (imp))
- new_ifaces.Add (imp);
- }
- }
- Type [] ret = new Type [new_ifaces.Count];
- new_ifaces.CopyTo (ret, 0);
- return ret;
- }
-
- /// <summary>
- /// This function returns the interfaces in the type `t'. Works with
- /// both types and TypeBuilders.
- /// </summary>
- public static Type [] GetInterfaces (Type t)
- {
- //
- // The reason for catching the Array case is that Reflection.Emit
- // will not return a TypeBuilder for Array types of TypeBuilder types,
- // but will still throw an exception if we try to call GetInterfaces
- // on the type.
- //
- // Since the array interfaces are always constant, we return those for
- // the System.Array
- //
-
- if (t.IsArray)
- t = TypeManager.array_type;
-
- if (t is TypeBuilder){
- Type [] parent_ifaces;
-
- if (t.BaseType == null)
- parent_ifaces = NoTypes;
- else
- parent_ifaces = GetInterfaces (t.BaseType);
- Type [] type_ifaces = (Type []) builder_to_ifaces [t];
- if (type_ifaces == null)
- type_ifaces = NoTypes;
-
- int parent_count = parent_ifaces.Length;
- Type [] result = new Type [parent_count + type_ifaces.Length];
- parent_ifaces.CopyTo (result, 0);
- type_ifaces.CopyTo (result, parent_count);
-
- return result;
- } else
- return t.GetInterfaces ();
- }
-
- /// <remarks>
- /// The following is used to check if a given type implements an interface.
- /// The cache helps us reduce the expense of hitting Type.GetInterfaces everytime.
- /// </remarks>
- public static bool ImplementsInterface (Type t, Type iface)
- {
- Type [] interfaces;
-
- //
- // FIXME OPTIMIZATION:
- // as soon as we hit a non-TypeBuiler in the interface
- // chain, we could return, as the `Type.GetInterfaces'
- // will return all the interfaces implement by the type
- // or its parents.
- //
- do {
- interfaces = GetInterfaces (t);
-
- if (interfaces != null){
- foreach (Type i in interfaces){
- if (i == iface)
- return true;
- }
- }
-
- t = t.BaseType;
- } while (t != null);
-
- return false;
- }
-
- // This is a custom version of Convert.ChangeType() which works
- // with the TypeBuilder defined types when compiling corlib.
- public static object ChangeType (object value, Type conversionType)
- {
- if (!(value is IConvertible))
- throw new ArgumentException ();
-
- IConvertible convertValue = (IConvertible) value;
- CultureInfo ci = CultureInfo.CurrentCulture;
- NumberFormatInfo provider = ci.NumberFormat;
-
- //
- // We must use Type.Equals() here since `conversionType' is
- // the TypeBuilder created version of a system type and not
- // the system type itself. You cannot use Type.GetTypeCode()
- // on such a type - it'd always return TypeCode.Object.
- //
- if (conversionType.Equals (typeof (Boolean)))
- return (object)(convertValue.ToBoolean (provider));
- else if (conversionType.Equals (typeof (Byte)))
- return (object)(convertValue.ToByte (provider));
- else if (conversionType.Equals (typeof (Char)))
- return (object)(convertValue.ToChar (provider));
- else if (conversionType.Equals (typeof (DateTime)))
- return (object)(convertValue.ToDateTime (provider));
- else if (conversionType.Equals (typeof (Decimal)))
- return (object)(convertValue.ToDecimal (provider));
- else if (conversionType.Equals (typeof (Double)))
- return (object)(convertValue.ToDouble (provider));
- else if (conversionType.Equals (typeof (Int16)))
- return (object)(convertValue.ToInt16 (provider));
- else if (conversionType.Equals (typeof (Int32)))
- return (object)(convertValue.ToInt32 (provider));
- else if (conversionType.Equals (typeof (Int64)))
- return (object)(convertValue.ToInt64 (provider));
- else if (conversionType.Equals (typeof (SByte)))
- return (object)(convertValue.ToSByte (provider));
- else if (conversionType.Equals (typeof (Single)))
- return (object)(convertValue.ToSingle (provider));
- else if (conversionType.Equals (typeof (String)))
- return (object)(convertValue.ToString (provider));
- else if (conversionType.Equals (typeof (UInt16)))
- return (object)(convertValue.ToUInt16 (provider));
- else if (conversionType.Equals (typeof (UInt32)))
- return (object)(convertValue.ToUInt32 (provider));
- else if (conversionType.Equals (typeof (UInt64)))
- return (object)(convertValue.ToUInt64 (provider));
- else if (conversionType.Equals (typeof (Object)))
- return (object)(value);
- else
- throw new InvalidCastException ();
- }
-
- //
- // This is needed, because enumerations from assemblies
- // do not report their underlyingtype, but they report
- // themselves
- //
- public static Type EnumToUnderlying (Type t)
- {
- if (t == TypeManager.enum_type)
- return t;
-
- t = t.UnderlyingSystemType;
- if (!TypeManager.IsEnumType (t))
- return t;
-
- TypeCode tc = Type.GetTypeCode (t);
-
- switch (tc){
- case TypeCode.Boolean:
- return TypeManager.bool_type;
- case TypeCode.Byte:
- return TypeManager.byte_type;
- case TypeCode.SByte:
- return TypeManager.sbyte_type;
- case TypeCode.Char:
- return TypeManager.char_type;
- case TypeCode.Int16:
- return TypeManager.short_type;
- case TypeCode.UInt16:
- return TypeManager.ushort_type;
- case TypeCode.Int32:
- return TypeManager.int32_type;
- case TypeCode.UInt32:
- return TypeManager.uint32_type;
- case TypeCode.Int64:
- return TypeManager.int64_type;
- case TypeCode.UInt64:
- return TypeManager.uint64_type;
- }
- throw new Exception ("Unhandled typecode in enum" + tc);
- }
-
- //
- // When compiling corlib and called with one of the core types, return
- // the corresponding typebuilder for that type.
- //
- public static Type TypeToCoreType (Type t)
- {
- if (RootContext.StdLib)
- return t;
-
- TypeCode tc = Type.GetTypeCode (t);
-
- switch (tc){
- case TypeCode.Boolean:
- return TypeManager.bool_type;
- case TypeCode.Byte:
- return TypeManager.byte_type;
- case TypeCode.SByte:
- return TypeManager.sbyte_type;
- case TypeCode.Char:
- return TypeManager.char_type;
- case TypeCode.Int16:
- return TypeManager.short_type;
- case TypeCode.UInt16:
- return TypeManager.ushort_type;
- case TypeCode.Int32:
- return TypeManager.int32_type;
- case TypeCode.UInt32:
- return TypeManager.uint32_type;
- case TypeCode.Int64:
- return TypeManager.int64_type;
- case TypeCode.UInt64:
- return TypeManager.uint64_type;
- case TypeCode.String:
- return TypeManager.string_type;
- default:
- return t;
- }
- }
-
- /// <summary>
- /// Utility function that can be used to probe whether a type
- /// is managed or not.
- /// </summary>
- public static bool VerifyUnManaged (Type t, Location loc)
- {
- if (t.IsValueType || t.IsPointer){
- //
- // FIXME: this is more complex, we actually need to
- // make sure that the type does not contain any
- // classes itself
- //
- return true;
- }
-
- Report.Error (
- 208, loc,
- "Cannot take the address or size of a variable of a managed type ('" +
- CSharpName (t) + "')");
- return false;
- }
-
- /// <summary>
- /// Returns the name of the indexer in a given type.
- /// </summary>
- /// <remarks>
- /// The default is not always `Item'. The user can change this behaviour by
- /// using the DefaultMemberAttribute in the class.
- ///
- /// For example, the String class indexer is named `Chars' not `Item'
- /// </remarks>
- public static string IndexerPropertyName (Type t)
- {
-
- if (t is TypeBuilder) {
- TypeContainer tc = (TypeContainer) builder_to_container [t];
-
- //
- // FIXME: Temporary hack, until we deploy the IndexerName
- // property code (and attributes) in the interface code.
- //
- if (tc == null){
- return "Item";
- }
-
- return tc.IndexerName;
- }
-
- System.Attribute attr = System.Attribute.GetCustomAttribute (
- t, TypeManager.default_member_type);
- if (attr != null){
- DefaultMemberAttribute dma = (DefaultMemberAttribute) attr;
- return dma.MemberName;
- }
-
- return "Item";
- }
-
- public static void MakePinned (LocalBuilder builder)
- {
- //
- // FIXME: Flag the "LocalBuilder" type as being
- // pinned. Figure out API.
- //
- }
-
-
- //
- // Returns whether the array of memberinfos contains the given method
- //
- static bool ArrayContainsMethod (MemberInfo [] array, MethodBase new_method)
- {
- Type [] new_args = TypeManager.GetArgumentTypes (new_method);
-
- foreach (MethodBase method in array){
- if (method.Name != new_method.Name)
- continue;
-
- Type [] old_args = TypeManager.GetArgumentTypes (method);
- int old_count = old_args.Length;
- int i;
-
- if (new_args.Length != old_count)
- continue;
-
- for (i = 0; i < old_count; i++){
- if (old_args [i] != new_args [i])
- break;
- }
- if (i != old_count)
- continue;
-
- if (!(method is MethodInfo && new_method is MethodInfo))
- return true;
-
- if (((MethodInfo) method).ReturnType == ((MethodInfo) new_method).ReturnType)
- return true;
- }
- return false;
- }
-
- //
- // We copy methods from `new_members' into `target_list' if the signature
- // for the method from in the new list does not exist in the target_list
- //
- // The name is assumed to be the same.
- //
- public static ArrayList CopyNewMethods (ArrayList target_list, MemberInfo [] new_members)
- {
- if (target_list == null){
- target_list = new ArrayList ();
-
- foreach (MemberInfo mi in new_members){
- if (mi is MethodBase)
- target_list.Add (mi);
- }
- return target_list;
- }
-
- MemberInfo [] target_array = new MemberInfo [target_list.Count];
- target_list.CopyTo (target_array, 0);
-
- foreach (MemberInfo mi in new_members){
- MethodBase new_method = (MethodBase) mi;
-
- if (!ArrayContainsMethod (target_array, new_method))
- target_list.Add (new_method);
- }
- return target_list;
- }
-
- [Flags]
- public enum MethodFlags {
- IsObsolete = 1,
- ShouldIgnore = 2
- }
-
- static public MethodFlags GetMethodFlags (MethodBase mb)
- {
- MethodFlags flags = 0;
-
- if (mb.DeclaringType is TypeBuilder){
- //
- // FIXME: Support lookups of Obsolete and ConditionalAttribute
- // on MethodBuilders.
- //
- return 0;
- }
-
- object [] attrs = mb.GetCustomAttributes (false);
- foreach (object ta in attrs){
- if (!(ta is System.Attribute)){
- Console.WriteLine ("Unknown type in GetMethodFlags: " + ta);
- continue;
- }
- System.Attribute a = (System.Attribute) ta;
- if (a.TypeId == TypeManager.obsolete_attribute_type){
- flags |= MethodFlags.IsObsolete;
- continue;
- }
-
- //
- // Skip over conditional code.
- //
- if (a.TypeId == TypeManager.conditional_attribute_type){
- ConditionalAttribute ca = (ConditionalAttribute) a;
-
- if (RootContext.AllDefines [ca.ConditionString] == null)
- flags |= MethodFlags.ShouldIgnore;
- }
- }
-
- return flags;
- }
-
-#region MemberLookup implementation
-
- //
- // Name of the member
- //
- static string closure_name;
-
- //
- // Whether we allow private members in the result (since FindMembers
- // uses NonPublic for both protected and private), we need to distinguish.
- //
- static bool closure_private_ok;
-
- //
- // Who is invoking us and which type is being queried currently.
- //
- static Type closure_invocation_type;
- static Type closure_queried_type;
-
- //
- // The assembly that defines the type is that is calling us
- //
- static Assembly closure_invocation_assembly;
-
- //
- // This filter filters by name + whether it is ok to include private
- // members in the search
- //
- static internal bool FilterWithClosure (MemberInfo m, object filter_criteria)
- {
- //
- // Hack: we know that the filter criteria will always be in the `closure'
- // fields.
- //
-
- if (m.Name != closure_name)
- return false;
-
- //
- // Ugly: we need to find out the type of `m', and depending
- // on this, tell whether we accept or not
- //
- if (m is MethodBase){
- MethodBase mb = (MethodBase) m;
- MethodAttributes ma = mb.Attributes & MethodAttributes.MemberAccessMask;
-
- if (ma == MethodAttributes.Private)
- return closure_private_ok;
-
- //
- // FamAndAssem requires that we not only derivate, but we are on the
- // same assembly.
- //
- if (ma == MethodAttributes.FamANDAssem){
- if (closure_invocation_assembly != mb.DeclaringType.Assembly)
- return false;
- }
-
- // FamORAssem, Family and Public:
- return true;
- }
-
- if (m is FieldInfo){
- FieldInfo fi = (FieldInfo) m;
- FieldAttributes fa = fi.Attributes & FieldAttributes.FieldAccessMask;
-
- if (fa == FieldAttributes.Private)
- return closure_private_ok;
-
- //
- // FamAndAssem requires that we not only derivate, but we are on the
- // same assembly.
- //
- if (fa == FieldAttributes.FamANDAssem){
- if (closure_invocation_assembly != fi.DeclaringType.Assembly)
- return false;
- }
- // FamORAssem, Family and Public:
- return true;
- }
-
- //
- // EventInfos and PropertyInfos, return true
- //
- return true;
- }
-
- static MemberFilter FilterWithClosure_delegate = new MemberFilter (FilterWithClosure);
-
- //
- // Looks up a member called `name' in the `queried_type'. This lookup
- // is done by code that is contained in the definition for `invocation_type'.
- //
- // The binding flags are `bf' and the kind of members being looked up are `mt'
- //
- // Returns an array of a single element for everything but Methods/Constructors
- // that might return multiple matches.
- //
- public static MemberInfo [] MemberLookup (Type invocation_type, Type queried_type,
- MemberTypes mt, BindingFlags original_bf, string name)
- {
- BindingFlags bf = original_bf;
-
- ArrayList method_list = null;
- Type current_type = queried_type;
- bool searching = (original_bf & BindingFlags.DeclaredOnly) == 0;
- bool private_ok;
- bool always_ok_flag = false;
-
- closure_name = name;
- closure_invocation_type = invocation_type;
- closure_invocation_assembly = invocation_type != null ? invocation_type.Assembly : null;
-
- //
- // If we are a nested class, we always have access to our container
- // type names
- //
- if (invocation_type != null){
- string invocation_name = invocation_type.FullName;
- if (invocation_name.IndexOf ('+') != -1){
- string container = queried_type.FullName + "+";
- int container_length = container.Length;
-
- if (invocation_name.Length > container_length){
- string shared = invocation_name.Substring (0, container_length);
-
- if (shared == container)
- always_ok_flag = true;
- }
- }
- }
-
- do {
- MemberInfo [] mi;
-
- //
- // `NonPublic' is lame, because it includes both protected and
- // private methods, so we need to control this behavior by
- // explicitly tracking if a private method is ok or not.
- //
- // The possible cases are:
- // public, private and protected (internal does not come into the
- // equation)
- //
- if (invocation_type != null){
- if (invocation_type == current_type){
- private_ok = true;
- } else
- private_ok = always_ok_flag;
-
- if (private_ok || invocation_type.IsSubclassOf (current_type))
- bf = original_bf | BindingFlags.NonPublic;
- } else {
- private_ok = false;
- bf = original_bf & ~BindingFlags.NonPublic;
- }
-
- closure_private_ok = private_ok;
- closure_queried_type = current_type;
-
- mi = TypeManager.FindMembers (
- current_type, mt, bf | BindingFlags.DeclaredOnly,
- FilterWithClosure_delegate, name);
-
- if (current_type == TypeManager.object_type)
- searching = false;
- else {
- current_type = current_type.BaseType;
-
- //
- // This happens with interfaces, they have a null
- // basetype. Look members up in the Object class.
- //
- if (current_type == null)
- current_type = TypeManager.object_type;
- }
-
- if (mi == null)
- continue;
-
- int count = mi.Length;
-
- if (count == 0)
- continue;
-
- //
- // Events and types are returned by both `static' and `instance'
- // searches, which means that our above FindMembers will
- // return two copies of the same.
- //
- if (count == 1 && !(mi [0] is MethodBase)){
- return mi;
- }
-
- //
- // Multiple properties: we query those just to find out the indexer
- // name
- //
- if (mi [0] is PropertyInfo)
- return mi;
-
- //
- // We found methods, turn the search into "method scan"
- // mode.
- //
-
- method_list = CopyNewMethods (method_list, mi);
- mt &= (MemberTypes.Method | MemberTypes.Constructor);
- } while (searching);
-
- if (method_list != null && method_list.Count > 0)
- return (MemberInfo []) method_list.ToArray (typeof (MemberInfo));
-
- //
- // Interfaces do not list members they inherit, so we have to
- // scan those.
- //
- if (!queried_type.IsInterface)
- return null;
-
- if (queried_type.IsArray)
- queried_type = TypeManager.array_type;
-
- Type [] ifaces = GetInterfaces (queried_type);
- if (ifaces == null)
- return null;
-
- foreach (Type itype in ifaces){
- MemberInfo [] x;
-
- x = MemberLookup (null, itype, mt, bf, name);
- if (x != null)
- return x;
- }
-
- return null;
- }
-#endregion
-
-}
-
-}
diff --git a/mcs/mcs/.cvsignore b/mcs/mcs/.cvsignore
index dddcfd3945c..3730eb61413 100644
--- a/mcs/mcs/.cvsignore
+++ b/mcs/mcs/.cvsignore
@@ -1,8 +1,16 @@
-compiler.pdb
-compiler.exe
-compiler.suo
+*.mdb
+*.pdb
+Web References
+Web References
+Web References
+bin
compiler.csproj
compiler.csproj.user
+compiler.exe
+compiler.pdb
+compiler.suo
cs-parser.cs
+mcs
+obj
+semantic.cache
y.output
-*.pdb
diff --git a/mcs/mcs/AssemblyInfo.cs b/mcs/mcs/AssemblyInfo.cs
new file mode 100644
index 00000000000..a10975f2b26
--- /dev/null
+++ b/mcs/mcs/AssemblyInfo.cs
@@ -0,0 +1,8 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyVersion("1.1.2")]
+[assembly: AssemblyTitle ("Mono C# Compiler")]
+[assembly: AssemblyDescription ("Mono C# Compiler")]
+[assembly: AssemblyCopyright ("2001, 2002, 2003 Ximian, Inc.")]
+[assembly: AssemblyCompany ("Ximian, Inc.")]
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog
index a55afa33d4a..257aa04d07c 100755
--- a/mcs/mcs/ChangeLog
+++ b/mcs/mcs/ChangeLog
@@ -1,3 +1,10023 @@
+2004-11-10 Martin Baulig <martin@ximian.com>
+
+ Merged latest changes into gmcs. Please keep this comment in
+ here, it makes it easier for me to see what changed in MCS since
+ the last time I merged.
+
+2004-11-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Invocation.OverloadResolve): Flag error if we are
+ calling an unsafe method from a safe location.
+
+2004-11-06 Marek Safar <marek.safar@seznam.cz>
+
+ Fix #69167
+ * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
+
+2004-11-06 Miguel de Icaza <miguel@ximian.com>
+
+ * namespace.cs (VerifyUsing): use GetPartialName instead of
+ ToString.
+
+2004-11-05 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Return.Resolve): Fix regression in typo: if
+ `in_exc', we have to request a NeedReturnLabel, this was a typo
+ introduced in the anonymous method check-in. Fixes #69131.
+
+ * Indexers were using the ShortName when defining themselves,
+ causing a regression in the compiler bootstrap when applying the
+ patch from 2004-11-02 (first part), now they use their full name
+ and the bug is gone.
+
+2004-11-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.cs: Strip the path from the names of embedded resources. Fixes
+ #68519.
+
+2004-11-04 Raja R Harinath <rharinath@novell.com>
+
+ Fix error message regression: cs0104-2.cs.
+ * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
+ (AliasEntry.Resolve): Update.
+ * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
+ 'silent' flag.
+ (RootContext.LookupType): Update.
+
+2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
+
+ * cs-parser.jay: Add support for handling accessor modifiers
+ * class: Add support port accessor modifiers and error checking,
+ define PropertyMethod.Define as virtual (not abstract anymore)
+ * ecore.cs: Add checking for proeprties access with access modifiers
+ * iterators.cs: Modify Accessor constructor call based in the modified
+ constructor
+2004-11-02 Ben Maurer <bmaurer@ximian.com>
+
+ * expression.cs (StringConcat): Handle being called twice,
+ as when we have a concat in a field init with more than two
+ ctors in the class
+
+2004-11-02 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
+ special case explicit implementations, we should always produce
+ the .property or .event declaration.
+
+ * decl.cs (MemberName): Renamed GetFullName to GetPartialName
+ since it will not return correct data if people use this
+ unresolved in the presence of using statements (see test-313).
+
+ * class.cs (MethodData.Define): If we are an explicit interface
+ implementation, set the method name to the full name of the
+ interface plus the name of the method.
+
+ Notice that using the method.MethodName.GetFullName() does not
+ work, as it will only contain the name as declared on the source
+ file (it can be a shorthand in the presence of using statements)
+ and not the fully qualifed type name, for example:
+
+ using System;
+
+ class D : ICloneable {
+ object ICloneable.Clone () {
+ }
+ }
+
+ Would produce a method called `ICloneable.Clone' instead of
+ `System.ICloneable.Clone'.
+
+ * namespace.cs (Alias.Resolve): Use GetPartialName.
+
+2004-11-01 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Add error 1055 report.
+
+2004-11-01 Miguel de Icaza <miguel@ximian.com>
+
+ * assign.cs (Assign.DoResolve): Only do the transform of
+ assignment into a New if the types are compatible, if not, fall
+ through and let the implicit code deal with the errors and with
+ the necessary conversions.
+
+2004-11-01 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Add error 1031 report.
+
+ * cs-tokenizer.cs: Add location for error 1038.
+
+2004-10-31 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Add error 1016 report.
+
+2004-10-31 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Add errors 1575,1611 report.
+
+2004-10-31 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Add error 1001 report.
+
+2004-10-31 Marek Safar <marek.safar@seznam.cz>
+
+ Fix #68850
+ * attribute.cs (GetMarshal): Add method argument for
+ caller identification.
+
+ * class.cs, codegen.cs, enum.cs, parameter.cs: Added
+ agument for GetMarshal and RuntimeMissingSupport.
+
+2004-10-31 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (ExtractSecurityPermissionSet): Removed
+ TypeManager.code_access_permission_type.
+
+ * typemanager.cs: Removed TypeManager.code_access_permission_type.
+
+2004-10-27 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (LocalVariableReference.DoResolveLValue): Check
+ for obsolete use of a variable here. Fixes regression on errors
+ cs0619-25 and cs0619-26.
+
+2004-10-27 Marek Safar <marek.safar@seznam.cz>
+
+ Fix #62358, implemented security attribute encoding.
+
+ * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
+ Tests permitted SecurityAction for assembly or other types.
+ (Assembly.ExtractSecurityPermissionSet): New method. Transforms
+ data from SecurityPermissionAttribute to PermisionSet class.
+
+ * class.cs (ApplyAttributeBuilder): Added special handling
+ for System.Security.Permissions.SecurityAttribute based types.
+
+ * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
+ special handling for System.Security.Permissions.SecurityAttribute
+ based types.
+
+ * enum.cs (ApplyAttributeBuilder): Added special handling
+ for System.Security.Permissions.SecurityAttribute based types.
+
+ * parameter.cs (ApplyAttributeBuilder): Added special handling
+ for System.Security.Permissions.SecurityAttribute based types.
+
+ * rootcontext.cs: Next 2 core types.
+
+ * typemanager.cs (TypeManager.security_permission_attr_type):
+ Built in type for the SecurityPermission Attribute.
+ (code_access_permission_type): Build in type.
+
+2004-10-17 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (LocalVariableReference.DoResolveBase, Emit):
+ Remove the tests for `ec.RemapToProxy' from here, and encapsulate
+ all of this information into
+ EmitContext.EmitCapturedVariableInstance.
+
+ * codegen.cs (EmitCapturedVariableInstance): move here the
+ funcionality of emitting an ldarg.0 in the presence of a
+ remapping. This centralizes the instance emit code.
+
+ (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
+ then emit a load of this: it means that we have reached the
+ topmost ScopeInfo: the one that contains the pointer to the
+ instance of the class hosting the anonymous method.
+
+ * anonymous.cs (AddField, HaveCapturedFields): Propagate field
+ captures to the topmost CaptureContext.
+
+2004-10-12 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (LocalVariableReference): Move the knowledge about
+ the iterators into codegen's EmitCapturedVariableInstance.
+
+2004-10-11 Miguel de Icaza <miguel@ximian.com>
+
+ * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
+ all code paths return a value from an anonymous method (it is the
+ same as the 161 error, but for anonymous methods).
+
+2004-10-08 Miguel de Icaza <miguel@ximian.com>
+
+ The introduction of anonymous methods in the compiler changed
+ various ways of doing things in the compiler. The most
+ significant one is the hard split between the resolution phase
+ and the emission phases of the compiler.
+
+ For instance, routines that referenced local variables no
+ longer can safely create temporary variables during the
+ resolution phase: they must do so from the emission phase,
+ since the variable might have been "captured", hence access to
+ it can not be done with the local-variable operations from the runtime.
+
+ * statement.cs
+
+ (Block.Flags): New flag `IsTopLevel' to indicate that this block
+ is a toplevel block.
+
+ (ToplevelBlock): A new kind of Block, these are the blocks that
+ are created by the parser for all toplevel method bodies. These
+ include methods, accessors and anonymous methods.
+
+ These contain some extra information not found in regular blocks:
+ A pointer to an optional CaptureContext (for tracking captured
+ local variables and parameters). A pointer to the parent
+ ToplevelBlock.
+
+ (Return.Resolve): Catch missmatches when returning a value from an
+ anonymous method (error 1662).
+ Invoke NeedReturnLabel from the Resolve phase instead of the emit
+ phase.
+
+ (Break.Resolve): ditto.
+
+ (SwitchLabel): instead of defining the labels during the
+ resolution phase, we now turned the public ILLabel and ILLabelCode
+ labels into methods called GetILLabelCode() and GetILLabel() that
+ only define the label during the Emit phase.
+
+ (GotoCase): Track the SwitchLabel instead of the computed label
+ (its contained therein). Emit the code by using
+ SwitchLabel.GetILLabelCode ().
+
+ (LocalInfo.Flags.Captured): A new flag has been introduce to track
+ whether the Local has been captured or not.
+
+ (LocalInfo.IsCaptured): New property, used to tell whether the
+ local has been captured.
+
+ * anonymous.cs: Vastly updated to contain the anonymous method
+ support.
+
+ The main classes here are: CaptureContext which tracks any
+ captured information for a toplevel block and ScopeInfo used to
+ track the activation frames for various local variables.
+
+ Each toplevel block has an optional capture context associated
+ with it. When a method contains an anonymous method both the
+ toplevel method and the anonymous method will create a capture
+ context. When variables or parameters are captured, they are
+ recorded on the CaptureContext that owns them, for example:
+
+ void Demo () {
+ int a;
+ MyDelegate d = delegate {
+ a = 1;
+ }
+ }
+
+ Here `a' will be recorded as captured on the toplevel
+ CapturedContext, the inner captured context will not have anything
+ (it will only have data if local variables or parameters from it
+ are captured in a nested anonymous method.
+
+ The ScopeInfo is used to track the activation frames for local
+ variables, for example:
+
+ for (int i = 0; i < 10; i++)
+ for (int j = 0; j < 10; j++){
+ MyDelegate d = delegate {
+ call (i, j);
+ }
+ }
+
+ At runtime this captures a single captured variable `i', but it
+ captures 10 different versions of the variable `j'. The variable
+ `i' will be recorded on the toplevel ScopeInfo, while `j' will be
+ recorded on a child.
+
+ The toplevel ScopeInfo will also track information like the `this'
+ pointer if instance variables were referenced (this is necessary
+ as the anonymous method lives inside a nested class in the host
+ type of the method).
+
+ (AnonymousMethod): Expanded to track the Toplevel, implement
+ `AnonymousMethod.Compatible' to tell whether an anonymous method
+ can be converted to a target delegate type.
+
+ The routine now also produces the anonymous method content
+
+ (AnonymousDelegate): A helper class that derives from
+ DelegateCreation, this is used to generate the code necessary to
+ produce the delegate for the anonymous method that was created.
+
+ * assign.cs: API adjustments for new changes in
+ Convert.ImplicitStandardConversionExists.
+
+ * class.cs: Adjustments to cope with the fact that now toplevel
+ blocks are of type `ToplevelBlock'.
+
+ * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
+ insteda of standard blocks.
+
+ Flag errors if params arguments are passed to anonymous methods.
+
+ * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
+ `CurrentAnonymousMethod' which points to the current Anonymous
+ Method. The variable points to the AnonymousMethod class that
+ holds the code being compiled. It is set in the new EmitContext
+ created for the anonymous method.
+
+ (EmitContext.Phase): Introduce a variable and an enumeration to
+ assist in enforcing some rules about when and where we are allowed
+ to invoke certain methods (EmitContext.NeedsReturnLabel is the
+ only one that enfonces this right now).
+
+ (EmitContext.HaveCaptureInfo): new helper method that returns
+ whether we have a CapturedContext initialized.
+
+ (EmitContext.CaptureVariable): New method used to register that a
+ LocalInfo must be flagged for capturing.
+
+ (EmitContext.CapturedParameter): New method used to register that a
+ parameters must be flagged for capturing.
+
+ (EmitContext.CapturedField): New method used to register that a
+ field must be flagged for capturing.
+
+ (EmitContext.HaveCapturedVariables,
+ EmitContext.HaveCapturedFields): Return whether there are captured
+ variables or fields.
+
+ (EmitContext.EmitMethodHostInstance): This is used to emit the
+ instance for the anonymous method. The instance might be null
+ (static methods), this (for anonymous methods that capture nothing
+ and happen to live side-by-side with the current method body) or a
+ more complicated expression if the method has a CaptureContext.
+
+ (EmitContext.EmitTopBlock): Routine that drives the emission of
+ code: it will first resolve the top block, then emit any metadata
+ and then emit the code. The split is done so that we can extract
+ any anonymous methods and flag any captured variables/parameters.
+
+ (EmitContext.ResolveTopBlock): Triggers the resolution phase,
+ during this phase, the ILGenerator should not be used as labels
+ and local variables declared here might not be accessible to any
+ code that is part of an anonymous method.
+
+ Exceptions to this include the temporary variables that are
+ created by some statements internally for holding temporary
+ variables.
+
+ (EmitContext.EmitMeta): New routine, in charge of emitting all the
+ metadata for a cb
+
+ (EmitContext.TemporaryReturn): This method is typically called
+ from the Emit phase, and its the only place where we allow the
+ ReturnLabel to be defined other than the EmitMeta. The reason is
+ that otherwise we would have to duplicate a lot of logic in the
+ Resolve phases of various methods that today is on the Emit
+ phase.
+
+ (EmitContext.NeedReturnLabel): This no longer creates the label,
+ as the ILGenerator is not valid during the resolve phase.
+
+ (EmitContext.EmitThis): Extended the knowledge in this class to
+ work in anonymous methods in addition to iterators.
+
+ (EmitContext.EmitCapturedVariableInstance): This emits whatever
+ code is necessary on the stack to access the instance to a local
+ variable (the variable will be accessed as a field).
+
+ (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
+ EmitContext.EmitAddressOfParameter): Routines to support
+ parameters (not completed at this point).
+
+ Removals: Removed RemapLocal and RemapLocalLValue. We probably
+ will also remove the parameters.
+
+ * convert.cs (Convert): Define a `ConstantEC' which points to a
+ null. This is just to prefity some code that uses
+ ImplicitStandardConversion code and do not have an EmitContext
+ handy.
+
+ The idea is to flag explicitly that at that point in time, it is
+ known that the conversion will not trigger the delegate checking
+ code in implicit conversions (which requires a valid
+ EmitContext).
+
+ Everywhere: pass new EmitContext parameter since
+ ImplicitStandardConversionExists now requires it to check for
+ anonymous method conversions.
+
+ (Convert.ImplicitStandardConversionExists): If the type of an
+ expression is the anonymous_method_type, and the type is a
+ delegate, we invoke the AnonymousMethod.Compatible method to check
+ whether an implicit conversion is possible.
+
+ (Convert.ImplicitConversionStandard): Only do implicit method
+ group conversions if the language level is not ISO_1.
+
+ * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
+ MethodInfo for the Invoke method. used by Delegate and
+ AnonymousDelegate.
+
+ * expression.cs (Binary.DoNumericPromotions): only allow anonymous
+ method conversions if the target type is a delegate.
+
+ Removed extra debugging nops.
+
+ (LocalVariableReference): Turn the `local_info' into a public
+ field.
+
+ Add `prepared' field, the same hack used for FieldExprs to cope
+ with composed assignments, as Local variables do not necessarily
+ operate purely on the stack as they used to: they can be captured
+ fields.
+
+ Add `temp' for a temporary result, like fields.
+
+ Refactor DoResolve and DoResolveLValue into DoResolveBase.
+
+ It now copes with Local variables that are captured and emits the
+ proper instance variable to load it from a field in the captured
+ case.
+
+ (ParameterReference.DoResolveBase): During the resolve phase,
+ capture parameters if we are in an anonymous method.
+
+ (ParameterReference.Emit, ParameterReference.AddressOf): If in an
+ anonymous method, use the EmitContext helper routines to emit the
+ parameter reference.
+
+ * iterators.cs: Set RemapToProxy to true/false during the
+ EmitDispose class.
+
+ * parameters.cs (GetParameterByName): New helper method.
+
+ * typemanager.cs (anonymous_method_type) a new type that
+ represents an anonyous method. This is always an internal type,
+ used as a fencepost to test against the anonymous-methodness of an
+ expression.
+
+2004-10-24 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bugs #63705, #67130
+ * decl.cs (MemberCache.MemberCache): Add parameter to distinguish
+ imported and defined interfaces.
+ (CacheEntry, EntryType): Changed to protected internal.
+
+ * class.cs (TypeContainer.DoDefineMembers): Setup cache for
+ interfaces too.
+
+ * typemanager.cs (LookupInterfaceContainer): New method.
+ Fills member container from base interfaces.
+
+2004-10-20 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
+ 561 report.
+ (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
+
+2004-10-18 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
+ `Type' directly, but call ResolveType() on it.
+ (Catch.Resolve): Likewise.
+ (Foreach.Resolve): Likewise.
+
+2004-10-18 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
+ `Type' directly, but call ResolveType() on it.
+ (Probe.DoResolve): Likewise.
+ (ArrayCreation.LookupType): Likewise.
+ (TypeOf.DoResolve): Likewise.
+ (SizeOf.DoResolve): Likewise.
+
+2004-10-18 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.BetterFunction): Put back
+ TypeManager.TypeToCoreType().
+
+2004-10-18 Raja R Harinath <rharinath@novell.com>
+
+ * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
+ the ResolveType.
+
+2004-10-18 Martin Baulig <martin@ximian.com>
+
+ * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
+ `Type' directly, but call ResolveType() on it.
+
+2004-10-18 Martin Baulig <martin@ximian.com>
+
+ * class.cs (FieldMember.Define): Don't access the TypeExpr's
+ `Type' directly, but call ResolveType() on it.
+ (MemberBase.DoDefine): Likewise.
+
+ * expression.cs (New.DoResolve): Don't access the TypeExpr's
+ `Type' directly, but call ResolveType() on it.
+ (ComposedCast.DoResolveAsTypeStep): Likewise.
+
+ * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
+ `Type' directly, but call ResolveType() on it.
+
+2004-10-17 John Luke <john.luke@gmail.com>
+
+ * class.cs (Operator.GetSignatureForError): use CSharpName
+
+ * parameter.cs (Parameter.GetSignatureForError): Returns
+ correct name even if was not defined.
+
+2004-10-13 Raja R Harinath <rharinath@novell.com>
+
+ Fix #65816.
+ * class.cs (TypeContainer.EmitContext): New property.
+ (DefineNestedTypes): Create an emitcontext for each part.
+ (MethodCore.DoDefineParameters): Use container's emitcontext.
+ Pass type array to InternalParameters.
+ (MemberBase.DoDefine): Use container's emitcontext.
+ (FieldMember.Define): Likewise.
+ (Event.Define): Likewise.
+ (SetMethod.GetParameterInfo): Change argument to EmitContext.
+ Pass type array to InternalParameters.
+ (SetIndexerMethod.GetParameterInfo): Likewise.
+ (SetMethod.Define): Pass emitcontext to GetParameterInfo.
+ * delegate.cs (Define): Pass emitcontext to
+ ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
+ array to InternalParameters.
+ * expression.cs (ParameterReference.DoResolveBase): Pass
+ emitcontext to GetParameterInfo.
+ (ComposedCast.DoResolveAsTypeStep): Remove check on
+ ec.ResolvingTypeTree.
+ * parameter.cs (Parameter.Resolve): Change argument to
+ EmitContext. Use ResolveAsTypeTerminal.
+ (Parameter.GetSignature): Change argument to EmitContext.
+ (Parameters.ComputeSignature): Likewise.
+ (Parameters.ComputeParameterTypes): Likewise.
+ (Parameters.GetParameterInfo): Likewise.
+ (Parameters.ComputeAndDefineParameterTypes): Likewise.
+ Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
+ * support.cs (InternalParameters..ctor): Remove variant that takes
+ a DeclSpace.
+ * typemanager.cs (system_intptr_expr): New.
+ (InitExpressionTypes): Initialize it.
+
+2004-10-12 Chris Toshok <toshok@ximian.com>
+
+ * cs-parser.jay: fix location for try_statement and catch_clause.
+
+2004-10-11 Martin Baulig <martin@ximian.com>
+
+ * report.cs: Don't make --fatal abort on warnings, we have
+ -warnaserror for that.
+
+2004-10-07 Raja R Harinath <rharinath@novell.com>
+
+ More DeclSpace.ResolveType avoidance.
+ * decl.cs (MemberCore.InUnsafe): New property.
+ * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
+ with newly created EmitContext.
+ (FieldMember.Define): Likewise.
+ * delegate.cs (Delegate.Define): Likewise.
+ * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
+ only if normal name-lookup fails.
+ (TypeExpr.DoResolve): Enable error-checking.
+ * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
+ (SizeOf.DoResolve): Likewise.
+ (ComposedCast.DoResolveAsTypeStep): Likewise.
+ (StackAlloc.DoResolve): Likewise.
+ * statement.cs (Block.Flags): Add new flag 'Unsafe'.
+ (Block.Unsafe): New property.
+ (Block.EmitMeta): Set ec.InUnsafe as appropriate.
+ (Unsafe): Set 'unsafe' flag of contained block.
+ (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
+ (Fixed.Resolve): Likewise.
+ (Catch.Resolve): Likewise.
+ (Using.ResolveLocalVariableDecls): Likewise.
+ (Foreach.Resolve): Likewise.
+
+2004-10-05 John Luke <john.luke@gmail.com>
+
+ * cs-parser.jay: add location to error CS0175
+
+2004-10-04 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (Expression.Constantity): Add support for turning null
+ into a constant.
+
+ * const.cs (Const.Define): Allow constants to be reference types
+ as long as the value is Null.
+
+2004-10-04 Juraj Skripsky <js@hotfeet.ch>
+
+ * namespace.cs (NamespaceEntry.Using): No matter which warning
+ level is set, check if this namespace name has already been added.
+
+2004-10-03 Ben Maurer <bmaurer@ximian.com>
+
+ * expression.cs: reftype [!=]= null should always use br[true,false].
+ # 67410
+
+2004-10-03 Marek Safar <marek.safar@seznam.cz>
+
+ Fix #67108
+ * attribute.cs: Enum conversion moved to
+ GetAttributeArgumentExpression to be applied to the all
+ expressions.
+
+2004-10-01 Raja R Harinath <rharinath@novell.com>
+
+ Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
+ * class.c (TypeContainer.DefineType): Flag error if
+ base types aren't accessible due to access permissions.
+ * decl.cs (DeclSpace.ResolveType): Move logic to
+ Expression.ResolveAsTypeTerminal.
+ (DeclSpace.ResolveTypeExpr): Thin layer over
+ Expression.ResolveAsTypeTerminal.
+ (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
+ Refactor code into NestedAccess. Use it.
+ (DeclSpace.NestedAccess): New.
+ * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
+ argument to silence errors. Check access permissions.
+ (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
+ * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
+ (Cast.DoResolve): Likewise.
+ (New.DoResolve): Likewise.
+ (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
+ (TypeOf.DoResolve): Likewise.
+
+ * expression.cs (Invocation.BetterConversion): Return the Type of
+ the better conversion. Implement section 14.4.2.3 more faithfully.
+ (Invocation.BetterFunction): Make boolean. Make correspondence to
+ section 14.4.2.2 explicit.
+ (Invocation.OverloadResolve): Update.
+ (Invocation): Remove is_base field.
+ (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
+ (Invocation.Emit): Likewise.
+
+2004-09-27 Raja R Harinath <rharinath@novell.com>
+
+ * README: Update to changes.
+
+2004-09-24 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Reverted 642 warning fix.
+
+2004-09-23 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #66615
+ * decl.cs (FindMemberWithSameName): Indexer can have more than
+ 1 argument.
+
+2004-09-23 Marek Safar <marek.safar@seznam.cz>
+
+ * expression.cs (LocalVariableReference.DoResolveLValue):
+ Do not report warning 219 for out values.
+ (EmptyExpression.Null): New member to avoid extra allocations.
+
+2004-09-23 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Fix wrong warning 642 report.
+
+ * cs-tokenizer.cs (CheckNextToken): New helper;
+ Inspect next character if is same as expected.
+
+2004-09-23 Martin Baulig <martin@ximian.com>
+
+ * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
+ (Convert.ImplicitReferenceConversionExists): Likewise.
+
+2004-09-23 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (Operator.Define): Add error 448 and 559 report.
+
+2004-09-22 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (MemberBase.IsTypePermitted): New protected
+ method for checking error CS0610.
+
+2004-09-22 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (TypeContainer.HasExplicitLayout): New property
+ Returns whether container has StructLayout attribute set Explicit.
+ (FieldMember): New abstract class for consts and fields.
+ (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
+ (Field): Reuse FieldMember.
+
+ * const.cs (Const): Reuse FieldMember.
+
+ * rootcontext.cs: EmitConstants call moved to class.
+
+2004-09-22 Martin Baulig <martin@ximian.com>
+
+ Thanks to Peter Sestoft for this bug report.
+
+ * expression.cs (Conditional): If both the `trueExpr' and the
+ `falseExpr' is a NullLiteral, return a NullLiteral.
+
+2004-09-22 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Foreach.EmitCollectionForeach): If we're in an
+ iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
+ for the "get_Current" call.
+
+2004-09-22 Martin Baulig <martin@ximian.com>
+
+ Marek and me just fixed one of our oldest bugs: #28562 :-)
+
+ * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
+
+ * attribute.cs (Attribute.GetAttributeArgumentExpression): If
+ we're an EnumConstant, just return that.
+ (Attribute.Resolve): GetAttributeArgumentExpression() may give us
+ an EnumConstant. In this case, we need to use GetValueAsEnumType()
+ to get the value which'll actually be written into the attribute.
+ However, we have to use GetValue() to access the attribute's value
+ in the compiler.
+
+2004-09-22 Marek Safar <marek.safar@seznam.cz>
+
+ * constant.cs (Constant.IsNegative): New abstract property
+ IsNegative.
+
+ * expression.cs (ArrayAccess.DoResolve): Add warning 251.
+ (StackAlloc.DoResolve): Reused IsNegative.
+
+2004-09-21 Martin Baulig <martin@ximian.com>
+
+ * codegen.cs (VariableStorage): Don't store the ILGenerator here;
+ if we're used in an iterator, we may be called from different
+ methods.
+
+ * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
+ we actually have an exception block.
+
+2004-09-20 John Luke <jluke@cfl.rr.com>
+
+ * class.cs, cs-parser.jay: Improve the error report for 1520:
+ report the actual line where the error happens, not where the
+ class was declared.
+
+ * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
+ Pass location information that was available elsewhere.
+
+2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
+ runtime to delay sign assemblies.
+
+2004-09-19 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Do not report the stack trace, this is barely
+ used nowadays.
+
+2004-08-22 John Luke <john.luke@gmail.com>
+
+ * driver.cs : check that a resource id is not already used
+ before adding it, report CS1508 if it is, bug #63637
+
+2004-09-19 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs: Removed dead code.
+
+2004-09-18 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs: Do not report warning CS0067 on the interfaces.
+
+2004-09-16 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Add error 504 report.
+
+2004-09-16 Marek Safar <marek.safar@seznam.cz>
+
+ * rootcontext.cs: WarningLevel is 4 by default now.
+
+ * statement.cs (Fixed.Resolve): Do not null
+ VariableInfo.
+
+2004-09-16 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #55780
+ * ecore.cs (PropertyExpr.FindAccessors): Do not perform
+ deep search when property is not virtual.
+ (PropertyExpr.ResolveAccessors): Make one call for both
+ accessors.
+
+2004-09-15 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #65766
+ * statement.cs: Error 152 report constains also location.
+
+2004-09-15 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #65766
+ * const.cs: Explicitly set constant as static.
+
+2004-09-15 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #64226
+ * cs-parser.jay: Add error 1017 report.
+
+2004-09-15 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #59980, #64224
+ * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
+
+ * typemanager.cs (IsSpecialMethod): Simplified
+
+2004-09-14 Marek Safar <marek.safar@seznam.cz>
+
+ * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
+ condition with better params.
+
+2004-09-14 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #65238
+ * attribute.cs (Resolve): Property has to have both
+ accessors.
+
+2004-09-14 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
+
+2004-09-14 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #61902
+ * codegen.cs (TestObsoleteMethodUsage): Trace when method is
+ called and is obsolete then this member suppress message
+ when call is inside next [Obsolete] method or type.
+
+ * expression.cs: Use TestObsoleteMethodUsage member.
+
+2004-09-14 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay: Sync a bit with the GMCS version.
+
+2004-09-14 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
+ (CSharpParser.yacc_verbose_flag): New public field.
+
+ * genericparser.cs: Removed.
+
+2004-09-14 Raja R Harinath <rharinath@novell.com>
+
+ * cs-parser.jay (event_declaration): Re-enable cs0071 error.
+
+2004-09-13 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (MethodCore.CheckBase): Fix bug #65757.
+
+2004-09-10 Martin Baulig <martin@ximian.com>
+
+ Backported my MemberName changes from GMCS into MCS.
+
+ - we are now using a special `MemberName' class instead of using
+ strings; in GMCS, the `MemberName' also contains the type
+ arguments.
+
+ - changed the grammar rules a bit:
+ * the old `member_name' is now a `namespace_or_type_name':
+ The rule is that we use `namespace_or_type_name' everywhere
+ where we expect either a "member name" (GetEnumerator) or a
+ "member name" with an explicit interface name
+ (IEnumerable.GetEnumerator).
+ In GMCS, the explicit interface name may include type arguments
+ (IEnumerable<T>.GetEnumerator).
+ * we use `member_name' instead of just `IDENTIFIER' for
+ "member names":
+ The rule is that we use `member_name' wherever a member may
+ have type parameters in GMCS.
+
+ * decl.cs (MemberName): New public class.
+ (MemberCore.MemberName): New public readonly field.
+ (MemberCore.ctor): Take a `MemberName' argument, not a string.
+ (DeclSpace): Likewise.
+
+ * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
+ * enum.cs (Enum.ctor): Likewise.
+
+ * namespace.cs (AliasEntry.Alias): Changed type from Expression to
+ MemberName.
+ (AliasEntry.ctor): Take a MemberName, not an Expression.
+ (AliasEntry.UsingAlias): Likewise.
+
+ * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
+ (IMethodData.MemberName): Changed type from string to MemberName.
+ (MemberBase.ExplicitInterfaceName): Likewise.
+ (AbstractPropertyEventMethod.SetupName): Make this private.
+ (AbstractPropertyEventMethod.ctor): Added `string prefix'
+ argument; compute the member name here.
+ (AbstractPropertyEventMethod.UpdateName): Recompute the name based
+ on the `member.MemberName' and the `prefix'.
+
+ * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
+ not `type_name'.
+ (struct_declaration): Use `member_name' instead of `IDENTIFIER';
+ thus, we get a `MemberName' instead of a `string'. These
+ declarations may have type parameters in GMCS.
+ (interface_method_declaration, delegate_declaration): Likewise.
+ (class_declaration, interface_declaration): Likewise.
+ (method_header): Use `namespace_or_type_name' instead of
+ `member_name'. We may be an explicit interface implementation.
+ (property_declaration, event_declaration): Likewise.
+ (member_name): This is now just an `IDENTIFIER', not a
+ `namespace_or_type_name'.
+ (type_name, interface_type): Removed.
+ (namespace_or_type_name): Return a MemberName, not an Expression.
+ (primary_expression): Use `member_name' instead of `IDENTIFIER';
+ call GetTypeExpression() on the MemberName to get an expression.
+ (IndexerDeclaration.interface_type): Changed type from string to
+ MemberName.
+ (MakeName): Operate on MemberName's instead of string's.
+
+2004-09-13 Raja R Harinath <rharinath@novell.com>
+
+ Fix bug #55770.
+ * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
+ (NamespaceEntry.Lookup): Add new argument to flag if we want the
+ lookup to avoid symbols introduced by 'using'.
+ * rootcontext.cs (NamespaceLookup): Update.
+
+2004-09-12 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (TypeContainer.DoDefineMembers): Do not call
+ DefineDefaultConstructor for static classes.
+
+2004-09-12 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (Attribute.Resolve): Add error 653 report.
+
+ * class.cs (Class.ApplyAttributeBuilder): Add error 641
+ report.
+ (Method.ApplyAttributeBuilder): Add error 685 report.
+ (Operator.Define): Add error 564 report.
+
+ * cs-tokenizer.cs (handle_hex): Add error 1013 report.
+
+ * expression.cs (Invocation.DoResolve): Add error
+ 245 and 250 report.
+
+ * parameter.cs (Parameter.ApplyAttributeBuilder): Add
+ error 674 report.
+
+2004-09-11 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (ConstructorInitializer.Resolve):
+ Wrong error number (515->516).
+
+2004-09-11 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (Indexer.Define): Add error 631 report.
+
+2004-09-11 Marek Safar <marek.safar@seznam.cz>
+
+ * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
+
+2004-09-11 Marek Safar <marek.safar@seznam.cz>
+
+ * expression.cs (Probe.DoResolve): Add error CS0241 report.
+
+2004-09-10 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Added error CS0241 report.
+
+2004-09-10 Raja R Harinath <rharinath@novell.com>
+
+ * cs-parser.jay (fixed_statement): Introduce a scope for the
+ declaration in the 'fixed' statement.
+
+2004-09-09 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Added CS0230 error report.
+
+2004-09-09 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Added errors CS0231 and CS0257 report.
+
+2004-09-09 Marek Safar <marek.safar@seznam.cz>
+
+ * expression.cs (Argument.Resolve): Added error CS0192 and
+ CS0199 report.
+
+2004-09-09 Marek Safar <marek.safar@seznam.cz>
+
+ C# 2.0 #pragma warning feature
+
+ * cs-tokenizer.cs (PreProcessPragma): New method;
+ Handles #pragma directive.
+
+ * report.cs (WarningRegions): New class; Support
+ class for #pragma warning directive. It tests whether
+ warning is enabled for a given line.
+
+2004-09-08 Miguel de Icaza <miguel@ximian.com>
+
+ * const.cs: Add more descriptive error report, tahnks to
+ Sebastien.
+
+2004-09-08 Marek Safar <marek.safar@seznam.cz>
+
+ * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
+
+2004-09-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs: Apply patch from Ben: Remove dead code from
+ ArrayCreation, and remove the TurnintoConstant call in const.cs,
+ as that code just threw an exception anwyays.
+
+ * const.cs: Remove the call to the turnintoconstant, for details
+ see bug: #63144
+
+ * literal.cs: The type of the null-literal is the null type; So
+ we use a placeholder type (literal.cs:System.Null, defined here)
+ for it.
+
+ * expression.cs (Conditional.DoResolve): Remove some old code that
+ is no longer needed, conversions have been fixed.
+
+ (ArrayCreationExpression.DoResolve): Return false if we fail to
+ resolve the inner expression.
+
+2004-09-07 Raja R Harinath <rharinath@novell.com>
+
+ Fix test-290.cs.
+ * cs-parser.jay (delegate_declaration): Record a delegate
+ declaration as a type declaration.
+ Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
+
+2004-09-06 Miguel de Icaza <miguel@ximian.com>
+
+ * parameter.cs: Do not crash if the type can not be resolved.
+
+ * expression.cs: Report errors with unsafe pointers, fixes #64896
+
+2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Pointer arith always needs to do a conv.i
+ if the operand is a long. fix 65320
+
+2004-09-04 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed cs0619-37.cs, cs0619-38.cs
+
+ * enum.cs (GetObsoleteAttribute): Removed.
+
+ * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
+ on Enum member is double staged. The first is tested member
+ and then enum.
+
+2004-09-04 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed #56986, #63631, #65231
+
+ * class.cs: (TypeContainer.AddToMemberContainer): New method,
+ adds member to name container.
+ (TypeContainer.AddToTypeContainer): New method, adds type to
+ name container.
+ (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
+ AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
+ AddOperator): Simplified by reusing AddToMemberContainer.
+ (TypeContainer.UserDefinedStaticConstructor): Changed to property
+ instead of field.
+ (Method.CheckForDuplications): Fixed implementation to test all
+ possibilities.
+ (MemberBase): Detection whether member is explicit interface
+ implementation is now in constructor.
+ (MemberBase.UpdateMemberName): Handles IndexerName.
+ (Accessor): Changed to keep also location information.
+ (AbstractPropertyEventMethod): Is derived from MemberCore.
+ (AbstractPropertyEventMethod.IsDummy): Says whether accessor
+ will be emited or not.
+ (PropertyBase.AreAccessorsDuplicateImplementation):
+ Tests whether accessors are not in collision with some method.
+ (Operator): Is derived from MethodCore to simplify common
+ operations.
+
+ * decl.cs (Flags.TestMethodDuplication): Test for duplication
+ must be performed.
+ (DeclSpace.AddToContainer): Adds the member to defined_names
+ table. It tests for duplications and enclosing name conflicts.
+
+ * enum.cs (EnumMember): Clean up to reuse the base structures
+
+2004-09-03 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
+ into TypeContainer, to make partial classes work again.
+
+2004-09-03 Martin Baulig <martin@ximian.com>
+
+ * rootcontext.cs (RootContext.V2): Removed.
+
+2004-03-23 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.OverloadResolve): Added `bool
+ may_fail' argument and use it instead of the Location.IsNull() hack.
+
+2004-09-03 Martin Baulig <martin@ximian.com>
+
+ Merged latest changes into gmcs. Please keep this comment in
+ here, it makes it easier for me to see what changed in MCS since
+ the last time I merged.
+
+2004-09-03 Raja R Harinath <rharinath@novell.com>
+
+ Fix #61128.
+ * expression.cs (BetterConversion): Don't allow either conversion
+ to be null. Remove redundant implicit conversion test when 'q ==
+ null' -- when this function is invoked, we already know that the
+ implicit conversion exists.
+ (BetterFunction): Assume that 'best' is non-null. Remove
+ redundant reimplementation of IsApplicable when 'best' is null.
+ (IsParamsMethodApplicable, IsApplicable): Add new parameter for
+ number of arguments.
+ (IsAncestralType): Extract from OverloadResolve.
+ (OverloadResolve): Make robust to the MethodGroupExpr being
+ unsorted. Implement all the logic of Section 14.5.5.1, and
+ support overloading of methods from multiple applicable types.
+ Clean up logic somewhat. Don't pass null methods to BetterFunction.
+
+ * report.cs (SymbolRelatedToPreviousError): Cleanup output.
+ (RealError, Warning): Append type of report to related symbol.
+
+2004-09-03 Marek Safar <marek.safar@seznam.cz>
+
+ * enum.cs: Fixed CLS-Compliance checks for enum members.
+ Error tests cs3008-8.cs, cs3014-8.cs
+
+2004-09-02 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #62342, #63102
+ * class.cs: ImplementIndexer uses member.IsExplicitImpl
+ like ImplementMethod.
+
+2004-09-02 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (Attribute.GetAttributeArgumentExpression):
+ Fixed bug #65170.
+
+2004-09-02 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Using.EmitLocalVariableDeclFinally): Use
+ TypeManager.GetArgumentTypes() rather than calling GetParameters()
+ on the MethodBase.
+
+2004-09-01 Marek Safar <marek.safar@seznam.cz>
+
+ C# 2.0 Static classes implemented
+
+ * class.cs (TypeContainer): instance_constructors,
+ initialized_fields, initialized_static_fields,
+ default_constructor, base_inteface_types are protected to be
+ accessible from StaticClass.
+ (TypeContainer.DefineDefaultConstructor): New virtual method
+ for custom default constructor generating
+ (StaticClass): New class to handle "Static classes" feature.
+
+ * cs-parser.jay: Handle static keyword on class like instance
+ of StaticClass.
+
+ * driver.cs: Added "/langversion" command line switch with two
+ options (iso-1, default).
+
+2004-08-31 Marek Safar <marek.safar@seznam.cz>
+
+ * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
+
+2004-08-31 Miguel de Icaza <miguel@ximian.com>
+
+ * delegate.cs: Style.
+
+2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * delegate.cs: Add seperate instance expr field for miguel.
+
+2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * PointerArithmetic (Resolve): make sure we are not doing
+ pointer arith on void*. Also, make sure we are resolved
+ by not setting eclass until resolve.
+
+ All callers: Make sure that PointerArithmetic gets resolved.
+
+2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * ArrayCreation (LookupType): If the type does not resolve
+ to an array, give an error.
+
+2004-08-27 Marek Safar <marek.safar@seznam.cz>
+
+ * statement.cs (Try.Resolve): Fixed bug #64222
+
+2004-08-27 Martin Baulig <martin@ximian.com>
+
+ * class.cs
+ (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
+ crash here.
+
+2004-08-26 Marek Safar <marek.safar@seznam.cz>
+
+ * ecore.cs (Constantify): Get underlying type via
+ System.Enum.GetUnderlyingType to avoid StackOverflow on the
+ Windows in special cases.
+
+2004-08-26 Marek Safar <marek.safar@seznam.cz>
+
+ * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
+ for obtaining also private methods.
+ (GetRemoveMethod): Used GetRemoveMethod (true)
+ for obtaining also private methods.
+
+2004-08-24 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Method.Define): Set MethodAttributes.SpecialName and
+ MethodAttributes.HideBySig for operators.
+
+2004-08-23 Martin Baulig <martin@ximian.com>
+
+ Back to the old error reporting system :-)
+
+ * report.cs (Message): Removed.
+ (Report.MessageData, ErrorData, WarningData): Removed.
+ (Report.Error, Warning): Back to the old system.
+
+2004-08-23 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
+
+ * class.cs (TypeContainer.ParentContainer): New public virtual
+ method; replaces the explicit interface implementation.
+ (ClassPart.ParentContainer): Override.
+
+2004-08-23 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Switch): Added support for constant switches; see
+ #59428 or test-285.cs.
+
+2004-08-22 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #62740.
+ * statement.cs (GetEnumeratorFilter): Removed useless
+ logic because C# specs is strict. GetEnumerator must be
+ public.
+
+2004-08-22 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
+ a switch and may break, reset the barrier. Fixes #59867.
+
+2004-08-22 Marek Safar <marek.safar@seznam.cz>
+
+ CLS-Compliance speed up (~5% for corlib)
+
+ * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
+ New method. Tests container for CLS-Compliant names
+
+ * class.cs (TypeContainer.VerifyClsName): New method.
+ Checks whether container name is CLS Compliant.
+ (Constructor): Implements IMethodData.
+
+ * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
+ low-case table for CLS Compliance test.
+ (MemberCache.VerifyClsParameterConflict): New method.
+ Checks method parameters for CS3006 error.
+
+ * enum.cs (EnumMember): Is derived from MemberCore.
+ (Enum.VerifyClsName): Optimized for better performance.
+
+2004-08-06 Marek Safar <marek.safar@seznam.cz>
+
+ * report.cs: Renamed Error_T to Error and changed all
+ references.
+
+2004-08-06 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (TypeContainer.IndexerArrayList): New inner class
+ container for indexers.
+ (TypeContainer.DefaultIndexerName): New constant for default
+ indexer name. Replaced all "Item" with this constant.
+ (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
+
+ * typemanager.cs (TypeManager.default_member_ctor): Cache here
+ DefaultMemberAttribute constructor.
+
+2004-08-05 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
+ Fix bug #59429.
+
+2004-08-05 Marek Safar <marek.safar@seznam.cz>
+
+ * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
+ multi platforms problem.
+
+ * compiler.csproj: Included shared files.
+
+2004-08-04 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug 60333, 55971 in the more general way
+ * attribute.cs (Attribute.GetAttributeArgumentExpression):
+ Added arg_type argument for constant conversion.
+ (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
+
+2004-08-04 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #59760
+ * class.cs (TypeContainer ): New inner classes MethodArrayList,
+ OperatorArrayList, MethodCoreArrayList for typecontainer
+ containers. Changed class member types to these new types.
+ (MethodArrayList.DefineMembers): Added test for CS0659.
+
+2004-08-04 Miguel de Icaza <miguel@ximian.com>
+
+ * cfold.cs: Synchronize the folding with the code in expression.cs
+ Binary.DoNumericPromotions for uint operands.
+
+ * attribute.cs: Revert patch from Raja, it introduced a regression
+ while building Blam-1.2.1 (hard to isolate a test case).
+
+2004-08-04 Marek Safar <marek.safar@seznam.cz>
+
+ Fix for #55382
+ * class.cs:
+ (TypeContainer.Define): Renamed to DefineContainerMembers because of
+ name collision.
+ (MethodCore.parent_method): New member. The method we're overriding
+ if this is an override method.
+ (MethodCore.CheckBase): Moved from Method class and made common.
+ (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
+ private.
+ (MethodCore.CheckForDuplications): New abstract method. For custom
+ member duplication search in a container
+ (MethodCore.FindOutParentMethod): New abstract method. Gets parent
+ method and its return type.
+ (Event.conflict_symbol): New member. Symbol with same name in the
+ parent class.
+
+ * decl.cs:
+ (MemberCache.FindMemberWithSameName): New method. The method
+ is looking for conflict with inherited symbols.
+
+2004-08-04 Martin Baulig <martin@ximian.com>
+
+ * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
+
+ * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
+
+2004-08-03 Marek Safar <marek.safar@seznam.cz>
+
+ * report.cs (Message): New enum for better error, warning reference in
+ the code.
+ (MessageData): New inner abstract class. It generally handles printing of
+ error and warning messages.
+ Removed unused Error, Warning, Message methods.
+
+2004-08-03 Marek Safar <marek.safar@seznam.cz>
+
+ Fix for cs0592-8.cs test
+ * attribute.cs
+ (Attributable.ValidAttributeTargets): Made public.
+ (Attribute.ExplicitTarget): New member for explicit target value.
+ (Attribute.CheckTargets): Now we translate explicit attribute
+ target to Target here.
+
+2004-08-03 Ben Maurer <bmaurer@ximian.com>
+
+ * ecore.cs (MethodGroupExpr): new IsBase property.
+
+ * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
+
+ * delegate.cs (DelegateCreation): store a MethodGroupExpr
+ rather than an instance expr.
+
+ (DelegateCreation.Emit): Use the method group rather than
+ the instance expression. Also, if you have base.Foo as the
+ method for a delegate, make sure to emit ldftn, not ldftnvirt.
+
+ (ResolveMethodGroupExpr): Use the MethodGroupExpr.
+
+ (NewDelegate.DoResolve): Only check for the existance of Invoke
+ if the method is going to be needed. Use MethodGroupExpr.
+
+ (NewDelegate.Emit): Remove, DelegateCreation implements this.
+
+ * expression.cs: For pointer arith., make sure to use
+ the size of the type, not the size of the pointer to
+ the type.
+
+2004-08-03 Marek Safar <marek.safar@seznam.cz>
+
+ Fix for #60722
+ * class.cs (Class): Added error CS0502 test.
+
+2004-08-03 John Luke <jluke@cfl.rr.com>
+ Raja R Harinath <rharinath@novell.com>
+
+ Fix for #60997.
+ * attribute.cs (Attribute.complained_before): New flag.
+ (Attribute.ResolveType, Attribute.Resolve),
+ (Attribute.DefinePInvokeMethod): Set it.
+ (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
+
+2004-08-03 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Binary.ResolveOperator): Don't abort if we can't
+ use a user-defined operator; we still need to do numeric
+ promotions in case one argument is a builtin type and the other
+ one has an implicit conversion to that type. Fixes #62322.
+
+2004-08-02 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (LocalInfo.Flags): Added `IsThis'.
+ (LocalInfo.IsThis): New public property.
+ (Block.EmitMeta): Don't create a LocalBuilder for `this'.
+
+2004-08-01 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.GetClassBases): Don't set the default
+ here since we may get called from GetPartialBases().
+ (TypeContainer.DefineType): If GetClassBases() didn't return a
+ parent, use the default one.
+
+2004-07-30 Duncan Mak <duncan@ximian.com>
+
+ * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
+
+2004-07-30 Martin Baulig <martin@ximian.com>
+
+ * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
+
+ * class.cs (SourceMethod): New public class, derive from the
+ symbol writer's ISourceMethod.
+ (Method): Use the new symbol writer API.
+
+ * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
+ as argument and use the new symbol writer.
+
+ * location.cs
+ (SourceFile): Implement the symbol writer's ISourceFile.
+ (Location.SymbolDocument): Removed.
+ (Location.SourceFile): New public property.
+
+ * symbolwriter.cs: Use the new symbol writer API.
+
+2004-07-30 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile (install-local): Remove. Functionality moved to
+ executable.make.
+
+2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * Makefile: Install mcs.exe.config file together with mcs.exe.
+ * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
+ correct runtime version.
+
+2004-07-25 Martin Baulig <martin@ximian.com>
+
+ * class.cs
+ (TypeContainer.RegisterOrder): Removed, this was unused.
+ (TypeContainer, interface_order): Removed.
+ (TypeContainer.AddClass, AddStruct, AddInterface): Take a
+ TypeContainer as argument since we can also be called with a
+ `PartialContainer' for a partial class/struct/interface.
+ (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
+ of checking whether we're an `Interface' - we could be a
+ `PartialContainer'.
+ (PartialContainer.Register): Override; call
+ AddClass()/AddStruct()/AddInterface() on our parent.
+
+ * cs-parser.jay (interface_member_declaration): Add things to the
+ `current_container', not the `current_class'.
+
+ * rootcontext.cs (RegisterOrder): The overloaded version which
+ takes an `Interface' was unused, removed.
+
+ * typemanager.cs (TypeManager.LookupInterface): Return a
+ `TypeContainer', not an `Interface'.
+ (TypeManager.IsInterfaceType): The `builder_to_declspace' may
+ contain a `PartialContainer' for an interface, so check it's
+ `Kind' to figure out what it is.
+
+2004-07-25 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Class.DefaultTypeAttributes): New public constant.
+ (Struct.DefaultTypeAttributes): Likewise.
+ (Interface.DefaultTypeAttributes): Likewise.
+ (PartialContainer.TypeAttr): Override this and add the
+ DefaultTypeAttributes.
+
+2004-07-25 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
+ we can just use the `Parent' field instead.
+
+2004-07-25 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.Emit): Renamed to EmitType().
+
+2004-07-25 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
+ our parts before defining any methods.
+ (TypeContainer.VerifyImplements): Make this virtual.
+ (ClassPart.VerifyImplements): Override and call VerifyImplements()
+ on our PartialContainer.
+
+2004-07-25 Martin Baulig <martin@ximian.com>
+
+ * iterators.cs (Iterator.Define): Renamed to DefineIterator().
+
+ * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
+ argument, we can just use the `Parent' field instead.
+
+ * class.cs
+ (MemberBase.CheckBase): Removed the `TypeContainer' argument.
+ (MemberBase.DoDefine): Likewise.
+
+2004-07-24 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (MemberCore.Parent): New public field.
+ (DeclSpace.Parent): Moved to MemberCore.
+
+ * class.cs (MethodCore.ds): Removed; use `Parent' instead.
+ (MemberBase.ctor): Added TypeContainer argument, pass it to our
+ parent's .ctor.
+ (FieldBase, Field, Operator): Likewise.
+ (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
+ (EventField, Event): Likewise.
+
+2004-07-23 Martin Baulig <martin@ximian.com>
+
+ * class.cs (PartialContainer): New public class.
+ (ClassPart): New public class.
+ (TypeContainer): Added support for partial classes.
+ (TypeContainer.GetClassBases): Splitted some of the functionality
+ out into GetNormalBases() and GetPartialBases().
+
+ * cs-tokenizer.cs (Token.PARTIAL): New token.
+ (Tokenizer.consume_identifier): Added some hacks to recognize
+ `partial', but only if it's immediately followed by `class',
+ `struct' or `interface'.
+
+ * cs-parser.jay: Added support for partial clases.
+
+2004-07-23 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
+ a `DeclSpace' and also made it readonly.
+ (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
+ (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
+ (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
+
+ * cs-parser.jay: Pass the `current_class', not the
+ `current_container' (at the moment, this is still the same thing)
+ to a new Method, Property, Event, Indexer or Constructor.
+
+2004-07-23 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay (CSharpParser): Added a new `current_class' field
+ and removed the `current_interface' one.
+ (struct_declaration, class_declaration, interface_declaration):
+ Set `current_class' to the newly created class/struct/interface;
+ set their `Bases' and call Register() before parsing their body.
+
+2004-07-23 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Kind): New public enum.
+ (TypeContainer): Made this class abstract.
+ (TypeContainer.Kind): New public readonly field.
+ (TypeContainer.CheckDef): New public method; moved here from
+ cs-parser.jay.
+ (TypeContainer.Register): New public abstract method.
+ (TypeContainer.GetPendingImplementations): New public abstract
+ method.
+ (TypeContainer.GetClassBases): Removed the `is_class' and
+ `is_iface' parameters.
+ (TypeContainer.DefineNestedTypes): Formerly known as
+ DoDefineType().
+ (ClassOrStruct): Made this class abstract.
+
+ * tree.cs (RootTypes): New public type.
+
+2004-07-20 Martin Baulig <martin@ximian.com>
+
+ * tree.cs (Tree.RecordNamespace): Removed.
+ (Tree.Namespaces): Removed.
+
+ * rootcontext.cs (RootContext.IsNamespace): Removed.
+
+ * cs-parser.jay (namespace_declaration): Just create a new
+ NamespaceEntry here.
+
+2004-07-20 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (ExceptionStatement): New abstract class. This is
+ now used as a base class for everyone who's using `finally'.
+ (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
+ our local variables before using them.
+
+ * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
+ virtual method. This is used by Yield.Resolve() to "steal" an
+ outer block's `finally' clauses.
+ (FlowBranchingException): The .ctor now takes an ExceptionStatement
+ argument.
+
+ * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
+ version which takes an ExceptionStatement. This version must be
+ used to create exception branchings.
+
+ * iterator.cs
+ (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
+ (Iterator.EmitMoveNext): Added exception support; protect the
+ block with a `fault' clause, properly handle 'finally' clauses.
+ (Iterator.EmitDispose): Run all the `finally' clauses here.
+
+2004-07-20 Martin Baulig <martin@ximian.com>
+
+ * iterator.cs: This is the first of a set of changes in the
+ iterator code. Match the spec more closely: if we're an
+ IEnumerable, then GetEnumerator() must be called. The first time
+ GetEnumerator() is called, it returns the current instance; all
+ subsequent invocations (if any) must create a copy.
+
+2004-07-19 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs: Resolve the constant expression before returning
+ it.
+
+2004-07-19 Martin Baulig <martin@ximian.com>
+
+ * iterators.cs (Iterator.MapVariable): Don't define fields twice.
+ (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
+ the return type of the new EmitContext.
+
+2004-07-18 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Property.Define): Fix iterators.
+
+ * iterators.cs (Iterator.Define): Moved the
+ `container.AddInterator (this)' call here from the .ctor; only do
+ it if we resolved successfully.
+
+2004-07-17 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
+ `true' for preprocessing directives that we parse. The return
+ value indicates whether we should return to regular tokenizing or
+ not, not whether it was parsed successfully.
+
+ In the past if we were in: #if false ... #line #endif, we would
+ resume parsing after `#line'. See bug 61604.
+
+ * typemanager.cs: Removed an old hack from Gonzalo to get corlib
+ building: IsEnumType should return true only for enums, not for
+ enums or System.Enum itself. This fixes #61593.
+
+ Likely what happened is that corlib was wrong: mcs depended on
+ this bug in some places. The bug got fixed, we had to add the
+ hack, which caused bug 61593.
+
+ * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
+ that was a workaround for the older conditions.
+
+2004-07-16 Ben Maurer <bmaurer@ximian.com>
+
+ * assign.cs: IAssignMethod has a new interface, as documented
+ inline. All assignment code now uses this new api.
+
+ * ecore.cs, expression.cs: All classes which implement
+ IAssignMethod now use the new interface.
+
+ * expression.cs (Invocation): add a hack to EmitCall so that
+ IndexerAccess can be the target of a compound assignment without
+ evaluating its arguments twice.
+
+ * statement.cs: Handle changes in Invocation api.
+
+2004-07-16 Martin Baulig <martin@ximian.com>
+
+ * iterators.cs: Rewrote this. We're now using one single Proxy
+ class for both the IEnumerable and the IEnumerator interface and
+ `Iterator' derives from Class so we can use the high-level API.
+
+ * class.cs (TypeContainer.AddIterator): New method.
+ (TypeContainer.DoDefineType): New protected virtual method, which
+ is called from DefineType().
+ (TypeContainer.DoDefineMembers): Call DefineType() and
+ DefineMembers() on all our iterators.
+ (TypeContainer.Emit): Call Emit() on all our iterators.
+ (TypeContainer.CloseType): Call CloseType() on all our iterators.
+
+ * codegen.cs (EmitContext.CurrentIterator): New public field.
+
+2004-07-15 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs
+ (TypeManager.not_supported_exception_type): New type.
+
+2004-07-14 Martin Baulig <martin@ximian.com>
+
+ * iterators.cs: Use real error numbers.
+
+2004-07-14 Martin Baulig <martin@ximian.com>
+
+ * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
+ requires this to be a System.Collection.IEnumerable and not a
+ class implementing that interface.
+ (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
+
+2004-07-13 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs: Fixed previous fix, it broke some error tests.
+
+2004-07-12 Martin Baulig <martin@ximian.com>
+
+ * enum.cs (Enum.Define): Call Emit() to emit the attributes.
+ Fixes #61293.
+
+2004-07-09 Miguel de Icaza <miguel@ximian.com>
+
+ * assign.cs (LocalTemporary): Add new argument: is_address,If
+ `is_address' is true, then the value that we store is the address
+ to the real value, and not the value itself.
+
+ * ecore.cs (PropertyExpr): use the new local temporary
+ stuff to allow us to handle X.Y += z (where X is a struct)
+
+2004-07-08 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
+ not always return, just like we're doing in Using.Resolve().
+
+2004-07-07 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay (fixed_statement): flag this as Pinned.
+
+2004-07-06 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (TypeManager): Removed MakePinned method, this
+ mechanism is replaced with the .NET 2.x compatible mechanism of
+ calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
+
+ * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
+ Rename `Fixed' to `Pinned' as a flag, to distinguish from the
+ `IsFixed' property which has a different meaning.
+
+2004-07-02 Raja R Harinath <rharinath@novell.com>
+
+ * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
+ visible from inside a nested class, not just the names of the
+ immediately enclosing class.
+ Fix for bug #60730.
+
+2004-06-24 Raja R Harinath <rharinath@novell.com>
+
+ * expression.cs (BetterConversion): Remove buggy special-case
+ handling of "implicit constant expression conversions". At this
+ point, we already know that the conversion is possible -- we're
+ only checking to see which is better.
+
+2004-06-24 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Added error CS0210 test.
+
+2004-06-24 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Added error CS0134 test.
+
+2004-06-24 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #52507
+ * cs-parser.jay: Added error CS0145 test.
+
+2004-06-24 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
+
+2004-06-23 Ben Maurer <bmaurer@ximian.com>
+
+ * expression.cs (StackAlloc.Resolve): The argument may not
+ be a constant; deal with this case.
+
+2004-06-23 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (IndexerName_GetIndexerName): Renamed to
+ GetIndexerAttributeValue.
+ (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
+
+ * class.cs (Indexer.Define): Added error tests for CS0415,
+ CS0609.
+
+2004-06-23 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs (Attribute.Resolve): Keep field code in sync with
+ property code.
+
+2004-06-23 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
+ neither return nor throw, reset the barrier as well. Fixes #60457.
+
+2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * class.cs : EventAttributes is now set to None by default.
+ This fixes bug #60459.
+
+2004-06-18 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #60219
+ * class.cs (ConstructorInitializer.GetOverloadedConstructor):
+ Don't throw exception but return null (it's sufficient now).
+
+2004-06-18 Marek Safar <marek.safar@seznam.cz>
+
+ * typemanager.cs (GetArgumentTypes): Faster implementation.
+
+2004-06-18 Martin Baulig <martin@ximian.com>
+
+ * attribute.cs (Attribute.Resolve): Check whether we're an
+ EmptyCast which a Constant child. Fixes #60333.
+
+2004-06-17 Ben Maurer <bmaurer@ximian.com>
+
+ * statement.cs (EmitCollectionForeach): Account for the fact that
+ not all valuetypes are in areas which we can take the address of.
+ For these variables, we store to a temporary variable. Also, make
+ sure that we dont emit a `callvirt' on a valuetype method.
+
+2004-06-15 Marek Safar <marek.safar@seznam.cz>
+
+ * expression.cs (StackAlloc.DoReSolve): Added test for
+ negative parameter (CS0247).
+
+2004-06-15 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #59792
+ * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
+
+2004-06-15 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #59781
+ * expression.cs: (Binary.DoNumericPromotions): Added conversion for
+ ulong.
+
+2004-06-14 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #58254 & cs1555.cs, cs1556.cs
+ * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
+
+2004-06-14 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Added error CS1669 test for indexers.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.IsParamsMethodApplicable): We need to
+ call this twice: for params and varargs methods.
+
+2004-06-11 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs:
+ (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
+
+2004-06-11 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (Attribute.GetValidTargets): Made public.
+
+ * class.cs:
+ (AbstractPropertyEventMethod): New class for better code sharing.
+ (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
+ CS1667 report.
+ (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
+
+2004-06-11 Raja R Harinath <rharinath@novell.com>
+
+ Fix bug #59477.
+ * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
+ that the call to Resolve is part of a MemberAccess.
+ (Expression.Resolve): Use it for SimpleName resolution.
+ (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
+ Add 'intermediate' boolean argument.
+ (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
+ error message when the SimpleName can be resolved ambiguously
+ between an expression and a type.
+ * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
+ public.
+ (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
+ call on the left-side.
+
+2004-06-11 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs:
+ (MethodCore.VerifyClsCompliance): Added test for error CS3000.
+
+2004-06-11 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
+ varargs methods if applicable.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.EmitCall): Don't use
+ `method.CallingConvention == CallingConventions.VarArgs' since the
+ method could also have `CallingConventions.HasThis'.
+
+2004-06-11 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (Event.GetSignatureForError): Implemented.
+ Fixed crash in error test cs3010.cs
+
+2004-06-10 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs: Change the way we track __arglist to be
+ consistent with the other keywords.
+
+2004-06-09 Miguel de Icaza <miguel@ximian.com>
+
+ * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
+ tomorrow.
+
+2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
+
+ * codegen.cs: Check that all referenced assemblies have a strongname
+ before strongnaming the compiled assembly. If not report error CS1577.
+ Fix bug #56563. Patch by Jackson Harper.
+ * typemanager.cs: Added a method to return all referenced assemblies.
+ Fix bug #56563. Patch by Jackson Harper.
+
+2004-06-08 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs:
+ (Method.ApplyAttributeBuilder): Moved and added conditional
+ attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
+
+ * delegate.cs:
+ (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
+
+2004-06-08 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed #59640
+ * class.cs: (EventField.attribute_targets): Changed default target.
+
+2004-06-08 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.EmitCall): Enable varargs methods.
+
+2004-06-08 Martin Baulig <martin@ximian.com>
+
+ * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
+
+2004-06-07 Martin Baulig <martin@ximian.com>
+
+ Added support for varargs methods.
+
+ * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
+ keyword.
+
+ * cs-parser.jay: Added support for `__arglist'.
+
+ * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
+
+ * expression.cs (Argument.AType): Added `ArgList'.
+ (Invocation): Added support for varargs methods.
+ (ArglistAccess): New public class.
+ (Arglist): New public class.
+
+ * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
+
+ * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
+ a method's top-level block if the method has varargs.
+
+ * support.cs (ReflectionParameters, InternalParameters): Added
+ support for varargs methods.
+
+2004-06-07 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs: Provide location in indexer error report.
+
+ * driver.cs: Use standard names.
+
+ * namespace.cs: Catch the use of using after a namespace has been
+ declared also on using aliases.
+
+2004-06-03 Raja R Harinath <rharinath@novell.com>
+
+ Bug #50820.
+ * typemanager.cs (closure_private_ok, closure_invocation_type)
+ (closure_qualifier_type, closure_invocation_assembly)
+ (FilterWithClosure): Move to ...
+ (Closure): New internal nested class.
+ (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
+ (MemberLookup, RealMemberLookup): Add new almost_match parameter.
+ * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
+ (MemberLookup, MemberLookupFailed): Use it.
+ * expression.cs (New.DoResolve): Treat the lookup for the
+ constructor as being qualified by the 'new'ed type.
+ (Indexers.GetIndexersForTypeOrInterface): Update.
+
+2004-06-03 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs
+ (GetConditionalAttributeValue): New method. Returns
+ condition of ConditionalAttribute.
+ (SearchMulti): New method. Returns all attributes of type 't'.
+ Use it when attribute is AllowMultiple = true.
+ (IsConditionalMethodExcluded): New method.
+
+ * class.cs
+ (Method.IsExcluded): Implemented. Returns true if method has conditional
+ attribute and the conditions is not defined (method is excluded).
+ (IMethodData): Extended interface for ConditionalAttribute support.
+ (PropertyMethod.IsExcluded): Implemented.
+
+ * decl.cs
+ (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
+
+ * expression.cs
+ (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
+ on the method.
+
+2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs (ArrayCreationExpression): Make this just an
+ `expression'. It can't be a statement, so the code here was
+ dead.
+
+2004-06-02 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed #59072
+ * typemanager.cs (GetFullNameSignature): New method for
+ MethodBase types.
+
+2004-06-02 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed #56452
+ * class.cs (MemberBase.GetSignatureForError): New virtual method.
+ Use this method when MethodBuilder is null.
+ (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
+ Added test for error CS0626 (MONO reports error for this situation).
+ (IMethodData.GetSignatureForError): Extended interface.
+
+2004-06-01 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs
+ (AttributeTester.GetObsoleteAttribute): Returns instance of
+ ObsoleteAttribute when type is obsolete.
+
+ * class.cs
+ (TypeContainer.VerifyObsoleteAttribute): Override.
+ (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
+ (MethodCode.VerifyObsoleteAttribute): Override.
+ (MemberBase.VerifyObsoleteAttribute): Override.
+
+ * decl.cs
+ (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
+ and report proper error.
+
+ *delegate.cs
+ Delegate.VerifyObsoleteAttribute): Override.
+
+ * ecore.cs
+ (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
+ and report proper error.
+ (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
+
+ * enum.cs
+ (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
+ and enum member.
+
+ * expression.cs
+ (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
+ New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
+ Added test for ObsoleteAttribute.
+
+ * statement.cs
+ (Catch): Derived from Statement.
+
+2004-06-01 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #59071 & cs0160.cs
+
+ * statement.cs (Try.Resolve): Check here whether order of catch
+ clauses matches their dependencies.
+
+2004-05-31 Miguel de Icaza <miguel@ximian.com>
+
+ * Reverted patch to namespace.cs (Use lookuptypedirect). This
+ caused a regression: #59343. Referencing nested classes from an
+ assembly stopped working.
+
+2004-05-31 Martin Baulig <martin@ximian.com>
+
+ MCS is now frozen for beta 2.
+
+2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * convert.cs: add a trivial cache for overload operator resolution.
+
+2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * decl.cs: If possible, use lookuptypedirect here. We can only do
+ this if there is no `.' after the namespace. Avoids using
+ LookupType, which does lots of slow processing.
+ (FindNestedType) New method, does what it says :-).
+ * namespace.cs: use LookupTypeDirect.
+ * rootcontext.cs: use membercache, if possible.
+ * typemanager.cs (LookupTypeDirect): Cache negative hits too.
+
+2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs:
+ According to the spec,
+
+ In a member access of the form E.I, if E is a single identifier,
+ and if the meaning of E as a simple-name (§7.5.2) is a constant,
+ field, property, localvariable, or parameter with the same type as
+ the meaning of E as a type-name (§3.8), then both possible
+ meanings of E are permitted.
+
+ We did not check that E as a simple-name had the same type as E as
+ a type name.
+
+ This trivial check gives us 5-7% on bootstrap time.
+
+2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs (Invocation.OverloadResolve): Avoid the
+ use of hashtables and boxing here by allocating on demand.
+
+2004-05-30 Martin Baulig <martin@ximian.com>
+
+ * rootcontext.cs (RootContext.LookupType): Don't cache things if
+ we're doing a silent lookup. Don't try to lookup nested types in
+ TypeManager.object_type (thanks to Ben Maurer).
+
+2004-05-30 Martin Baulig <martin@ximian.com>
+
+ Committing a patch from Ben Maurer.
+
+ * rootcontext.cs (RootContext.LookupType): Cache negative results.
+
+2004-05-29 Martin Baulig <martin@ximian.com>
+
+ * class.cs (IMethodData.ShouldIgnore): New method.
+
+ * typemanager.cs (TypeManager.MethodFlags): Don't take a
+ `Location' argument, we don't need it anywhere. Use
+ `IMethodData.ShouldIgnore ()' instead of
+ `MethodData.GetMethodFlags ()'.
+ (TypeManager.AddMethod): Removed.
+ (TypeManager.AddMethod2): Renamed to AddMethod.
+
+2004-05-29 Martin Baulig <martin@ximian.com>
+
+ Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
+
+ * convert.cs (Convert.ImplicitReferenceConversion): If we're
+ converting from a class type S to an interface type and we already
+ have an object on the stack, don't box it again. Fixes #52578.
+
+2004-05-29 Martin Baulig <martin@ximian.com>
+
+ * class.cs (ConstructorInitializer.GetOverloadedConstructor):
+ Added support for `params' parameters. Fixes #59267.
+
+2004-05-29 Martin Baulig <martin@ximian.com>
+
+ * literal.cs (NullPointer): Provide a private .ctor which sets
+ `type' to TypeManager.object_type. Fixes #59048.
+
+2004-05-29 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
+ EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
+
+ * ecore.cs (EventExpr.instance_expr): Make the field private.
+
+2004-05-26 Marek Safar <marek.safar@seznam.cz>
+
+ Fixed bug #50080 & cs0214-2.cs
+ * expression.cs (Cast.DoResolve): Check unsafe context here.
+
+ * statement.cs (Resolve.DoResolve): Likewise.
+
+2004-05-26 Martin Baulig <martin@ximian.com>
+
+ * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
+
+ * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
+ (RootContext.LookupType): Pass down the `silent' flag.
+
+2004-05-25 Martin Baulig <martin@ximian.com>
+
+ * expression.cs
+ (MethodGroupExpr.IdenticalTypeName): New public property.
+ (Invocation.DoResolve): Don't report a CS0176 if the "instance"
+ expression actually refers to a type.
+
+2004-05-25 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
+ for #56176 and made it actually work.
+
+2004-05-25 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (Expression.CacheTemporaries): Make this virtual.
+ (FieldExpr, PropertyExpr): Override and implement
+ CacheTemporaries. Fixes #52279.
+
+2004-05-25 Miguel de Icaza <miguel@ximian.com>
+
+ * location.cs: In the new compiler listing a file twice is a
+ warning, not an error.
+
+2004-05-24 Martin Baulig <martin@ximian.com>
+
+ * enum.cs (Enum.DefineType): For the `BaseType' to be a
+ TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
+
+2004-05-24 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
+ walking the `using' list. Fixes #53921.
+
+2004-05-24 Martin Baulig <martin@ximian.com>
+
+ * const.cs (Const.LookupConstantValue): Added support for
+ EmptyCast's; fixes #55251.
+
+2004-05-24 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
+ DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
+ which does the CS0135 check. The reason is that we first need to
+ check whether the variable actually exists.
+
+2004-05-24 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
+ than RootContext.LookupType() to find the explicit interface
+ type. Fixes #58584.
+
+2004-05-24 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile: Simplify. Use executable.make.
+ * mcs.exe.sources: New file. List of sources of mcs.exe.
+
+2004-05-24 Anders Carlsson <andersca@gnome.org>
+
+ * decl.cs:
+ * enum.cs:
+ Use the invariant culture when doing String.Compare for CLS case
+ sensitivity.
+
+2004-05-23 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (DeclSpace.FindType): Only check the `using' list if we
+ don't have any dots. Fixes #52622, added cs0246-8.cs.
+
+ * namespace.cs (NamespaceEntry.Lookup): Likewise.
+
+2004-05-23 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs (MemberBase.Define): Reuse MemberType member for
+ resolved type. Other methods can use it too.
+
+2004-05-23 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
+ the variable also exists in the current block (otherwise, we need
+ to report a CS0103). Fixes #58670.
+
+2004-05-23 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (Reachability.Reachable): Compute this
+ on-the-fly rather than storing it as a field.
+
+2004-05-23 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (Reachability.And): Manually compute the
+ resulting `barrier' from the reachability.
+
+2004-05-23 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #57835
+ * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
+ instance of ObsoleteAttribute when symbol is obsolete.
+
+ * class.cs
+ (IMethodData): Extended interface for ObsoleteAttribute support.
+
+2004-05-22 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs: Fix bug #55970
+
+2004-05-22 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #52705
+ * attribute.cs
+ (GetObsoleteAttribute): New method. Creates the instance of
+ ObsoleteAttribute.
+ (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
+ ObsoleteAttribute when member is obsolete.
+ (AttributeTester.Report_ObsoleteMessage): Common method for
+ Obsolete error/warning reporting.
+
+ * class.cs
+ (TypeContainer.base_classs_type): New member for storing parent type.
+
+ * decl.cs
+ (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
+ for this MemberCore.
+
+2004-05-21 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs, const.cs: Fix bug #58590
+
+2004-05-21 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
+ out parameters if the end of the method is unreachable. Fixes
+ #58098.
+
+2004-05-21 Marek Safar <marek.safar@seznam.cz>
+
+ * codegen.cs, cs-parser.jay: Removed SetAttributes method.
+ Hari was right, why extra method.
+
+2004-05-21 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
+
+2004-05-20 Martin Baulig <martin@ximian.com>
+
+ Merged this back from gmcs to keep the differences to a minumum.
+
+ * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
+ instead of a Declspace.
+ (Attribute.ResolveType): Likewise.
+ (Attributes.Search): Likewise.
+ (Attributes.Contains): Likewise.
+ (Attributes.GetClsCompliantAttribute): Likewise.
+
+ * class.cs (TypeContainer.VerifyMembers): Added EmitContext
+ argument.
+ (MethodData.ApplyAttributes): Take an EmitContext instead of a
+ DeclSpace.
+
+2004-05-19 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #58688 (MCS does not report error when the same attribute
+ is assigned twice)
+
+ * attribute.cs (Attribute.Emit): Distinction between null and default.
+
+2004-05-19 Raja R Harinath <rharinath@novell.com>
+
+ * cs-parser.jay (attribute): Create a GlobalAttribute for the case
+ of a top-level attribute without an attribute target.
+ * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
+ Make non-static.
+ (Attribute.Conditional_GetConditionName),
+ (Attribute.Obsolete_GetObsoleteMessage): Update.
+ (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
+ part of ScanForIndexerName.
+ (Attribute.CanIgnoreInvalidAttribute): New function.
+ (Attribute.ScanForIndexerName): Move to ...
+ (Attributes.ScanForIndexerName): ... here.
+ (Attributes.Attrs): Rename from now-misnamed AttributeSections.
+ (Attributes.Search): New internal variant that can choose not to
+ complain if types aren't resolved. The original signature now
+ complains.
+ (Attributes.GetClsCompliantAttribute): Use internal variant, with
+ complaints suppressed.
+ (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
+ only if it not useful.
+ (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
+ top-level for attributes that are shared between the assembly
+ and a top-level class.
+ * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
+ * class.cs: Update to reflect changes.
+ (DefineIndexers): Fuse loops.
+ * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
+ a couple more variants of attribute names.
+
+2004-05-18 Marek Safar <marek.safar@seznam.cz>
+
+ Fix bug #52585 (Implemented explicit attribute declaration)
+
+ * attribute.cs:
+ (Attributable.ValidAttributeTargets): New abstract method. It gets
+ list of valid attribute targets for explicit target declaration.
+ (Attribute.Target): It holds target itself.
+ (AttributeSection): Removed.
+ (Attribute.CheckTargets): New method. It checks whether attribute
+ target is valid for the current element.
+
+ * class.cs:
+ (EventProperty): New class. For events that are declared like
+ property (with add and remove accessors).
+ (EventField): New class. For events that are declared like field.
+ class.cs
+
+ * cs-parser.jay: Implemented explicit attribute target declaration.
+
+ * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
+ Override ValidAttributeTargets.
+
+ * parameter.cs:
+ (ReturnParameter): Class for applying custom attributes on
+ the return type.
+ (ParameterAtribute): New class. Class for applying custom
+ attributes on the parameter type.
+
+2004-05-17 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
+ definitions.
+
+ (Method): Allow UNSAFE here.
+
+ * modifiers.cs: Support unsafe reporting.
+
+2004-05-17 Marek Safar <marek.safar@seznam.cz>
+
+ * decl.cs: Fix bug #58478.
+
+2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * statement.cs: When checking for unreachable code on an EmptyStatement,
+ set the location. Fixes bug #58488.
+
+2004-05-13 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Add -pkg handling.
+
+ From Gonzalo: UseShelLExecute=false
+
+2004-05-12 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs:
+ (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
+ for attribute.
+ (Attribute.IsClsCompliaceRequired): Moved to base for better
+ accesibility.
+ (Attribute.UsageAttribute): New property for AttributeUsageAttribute
+ when attribute is AttributeUsageAttribute.
+ (Attribute.GetValidTargets): Simplified.
+ (Attribute.GetAttributeUsage): New method returns AttributeUsage
+ attribute for this type.
+ (Attribute.ApplyAttributes): Method renamed to Emit and make
+ non-static.
+ (GlobalAttributeSection): New class for special handling of global
+ attributes (assembly, module).
+ (AttributeSection.Emit): New method.
+
+ * class.cs: Implemented Attributable abstract methods.
+ (MethodCore.LabelParameters): Moved to Parameter class.
+ (Accessor): Is back simple class.
+ (PropertyMethod): Implemented Attributable abstract class.
+ (DelegateMethod): Implemented Attributable abstract class.
+ (Event): New constructor for disctintion between normal Event
+ and Event with accessors.
+
+ * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
+
+ * codegen.cs, const.cs, decl.cs, delegate.cs:
+ (CommonAssemblyModulClass): Implemented Attributable abstract class
+ and simplified.
+
+ * enum.cs: Implement IAttributeSupport interface.
+ (EnumMember): New class for emum members. Implemented Attributable
+ abstract class
+
+ * parameter.cs:
+ (ParameterBase): Is abstract.
+ (ReturnParameter): New class for easier [return:] attribute handling.
+
+ * typemanager.cs: Removed builder_to_attr.
+
+2004-05-11 Raja R Harinath <rharinath@novell.com>
+
+ Fix bug #57151.
+ * attribute.cs (Attribute.GetPositionalValue): New function.
+ * class.cs (TypeContainer.VerifyMembers): New function.
+ (TypeContainer.Emit): Use it.
+ (ClassOrStruct): New base class for Class and Struct.
+ (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
+ StructLayout(LayoutKind.Explicit) was ascribed to the struct or
+ class.
+ (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
+ then each non-static field should have a FieldOffset attribute.
+ Otherwise, none of the fields should have a FieldOffset attribute.
+ * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
+ and FieldOffset attributes.
+ * typemanager.cs (TypeManager.struct_layout_attribute_type)
+ (TypeManager.field_offset_attribute_type): New core types.
+ (TypeManager.InitCoreTypes): Initialize them.
+
+2004-05-11 Michal Moskal <malekith@pld-linux.org>
+
+ * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
+ Return correct type.
+ From bug #58270.
+
+2004-05-09 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.DoNumericPromotions): 0 long constant can
+ be implicitly converted to ulong.
+
+ * expression.cs: The logic for allowing operator &, | and ^ worked
+ was wrong, it worked before because we did not report an error in
+ an else branch. Fixes 57895.
+
+ * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
+ allow volatile fields to be reference types.
+
+2004-05-07 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Add support for /debug-
+
+2004-05-07 Raja R Harinath <rharinath@novell.com>
+
+ * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
+ Add a 'complain' parameter to silence errors.
+ (Attribute.Resolve): Update to changes. Put in sanity check to catch
+ silently overlooked type-resolutions.
+ (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
+ to reflect changes.
+ (Attributes.Search): New function.
+ (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
+ (Attributes.GetAttributeFullName): Remove hack.
+ * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
+ Update to reflect changes.
+ * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
+ Use Attributes.Search instead of nested loops.
+
+2004-05-07 Marek Safar <marek.safar@seznam.cz>
+
+ * decl.cs:
+ (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
+ (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
+ (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
+
+ * report.cs: (Report.Warning): Renamed to Warning_T because of
+ parameter collision.
+
+2004-05-05 Raja R Harinath <rharinath@novell.com>
+
+ * expression.cs (MemberAccess.ResolveMemberAccess):
+ Exit with non-zero status after Report.Error.
+ * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
+ Likewise.
+ * typemanager.cs (TypeManager.CoreLookupType): Likewise.
+
+2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * support.cs: Don't hang when the file is empty.
+
+2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * support.cs: In SeekableStreamReader, compute the preamble size of the
+ underlying stream. Position changes should take into account that initial
+ count of bytes.
+
+2004-05-03 Todd Berman <tberman@sevenl.net>
+
+ * driver.cs: remove unused GetSysVersion function.
+
+2004-05-03 Todd Berman <tberman@sevenl.net>
+
+ * driver.cs: Remove the hack from saturday, as well as the hack
+ from jackson (LoadAssemblyFromGac), also adds the CWD to the
+ link_paths to get that bit proper.
+
+2004-05-01 Todd Berman <tberman@sevenl.net>
+
+ * driver.cs: Try a LoadFrom before a Load, this checks the current
+ path. This is currently a bug in mono that is be fixed, however, this
+ provides a workaround for now. This will be removed when the bug
+ is fixed.
+
+2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
+
+ * CryptoConvert.cs: Updated to latest version. Fix issue with
+ incomplete key pairs (#57941).
+
+2004-05-01 Todd Berman <tberman@sevenl.net>
+
+ * driver.cs: Remove '.' from path_chars, now System.* loads properly
+ from the GAC
+
+2004-04-30 Jackson Harper <jackson@ximian.com>
+
+ * codegen.cs: Open keys readonly.
+
+2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * typemanager.cs: don't report cyclic struct layout when a struct
+ contains 2 or more fields of the same type. Failed for Pango.AttrShape
+ which has 2 Pango.Rectangle fields.
+
+2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Handle IntPtr comparisons with IL code
+ rather than a method call.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
+ the list of PropertyInfo's in class hierarchy and find the
+ accessor. Fixes #56013.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
+
+ * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ * class.cs (ConstructorInitializer.Resolve): Check whether the
+ parent .ctor is accessible. Fixes #52146.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
+
+ * statement.cs (Using.EmitLocalVariableDecls): Use
+ TypeManager.idisposable_type, not typeof (IDisposable).
+ (Foreach.EmitCollectionForeach): Added support for valuetypes.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Event.Define): Don't emit the field and don't set
+ RTSpecialName and SpecialName for events on interfaces. Fixes
+ #57703.
+
+2004-04-29 Raja R Harinath <rharinath@novell.com>
+
+ Refactor Attribute.ApplyAttributes.
+ * attribute.cs (Attributable): New base class for objects that can
+ have Attributes applied on them.
+ (Attribute): Make AttributeUsage fields public.
+ (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
+ (Attribute.IsInternalCall): New property.
+ (Attribute.UsageAttr): Convert to a public read-only property.
+ (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
+ (Attribute.ResolveType, Attribute.Resolve)
+ (Attribute.ScanForIndexerName): Update to reflect changes.
+ (Attribute.CheckAttributeTarget): Re-format.
+ (Attribute.ApplyAttributes): Refactor, to various
+ Attributable.ApplyAttributeBuilder methods.
+ * decl.cs (MemberCore): Make Attributable.
+ * class.cs (Accessor): Make Attributable.
+ (MethodData.ApplyAttributes): Use proper attribute types, not
+ attribute names.
+ (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
+ (TypeContainer.ApplyAttributeBuilder)
+ (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
+ (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
+ (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
+ (Operator.ApplyAttributeBuilder): New factored-out methods.
+ * const.cs (Const.ApplyAttributeBuilder): Likewise.
+ * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
+ * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
+ * parameter.cs (ParameterBase): New Attributable base class
+ that can also represent Return types.
+ (Parameter): Update to the changes.
+
+2004-04-29 Jackson Harper <jackson@ximian.com>
+
+ * driver.cs: Prefer the corlib system version when looking for
+ assemblies in the GAC. This is still a hack, but its a better hack
+ now.
+
+2004-04-29 Marek Safar <marek.safar@seznam.cz>
+
+ * decl.cs, enum.cs: Improved error 3005 reporting.
+
+ * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
+ (related_symbols): New private member for list of symbols
+ related to reported error/warning.
+
+ * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (Expression.Constantify): If we're an enum and
+ TypeManager.TypeToCoreType() doesn't give us another type, use
+ t.UnderlyingSystemType. Fixes #56178.
+
+2004-04-29 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
+ interfaces and for each interface, only add members directly
+ declared in that interface. Fixes #53255.
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (ConditionalLogicalOperator): Use a temporary
+ variable for `left' to avoid that we evaluate it more than once;
+ bug #52588.
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
+ `void[]' (CS1547).
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (LocalInfo.Resolve): Check whether the type is not
+ void (CS1547).
+
+ * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
+ whether the type is not void (CS1547).
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Unary.DoResolveLValue): Override this and report
+ CS0131 for anything but Operator.Indirection.
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ Committing a patch from Ben Maurer; see bug #50820.
+
+ * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
+ check for classes.
+
+ * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
+ classes.
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ Committing a patch from Ben Maurer; see bug #50820.
+
+ * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
+ check for classes.
+
+ * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
+ classes.
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
+ (Block.AddLabel): Call DoLookupLabel() to only search in the
+ current block.
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * cfold.cs (ConstantFold.BinaryFold): Added special support for
+ comparing StringConstants and NullLiterals in Equality and Inequality.
+
+2004-04-28 Jackson Harper <jackson@ximian.com>
+
+ * driver.cs: Attempt to load referenced assemblies from the
+ GAC. This is the quick and dirty version of this method that
+ doesnt take into account versions and just takes the first
+ canidate found. Will be good enough for now as we will not have more
+ then one version installed into the GAC until I update this method.
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs (TypeManager.CheckStructCycles): New public
+ static method to check for cycles in the struct layout.
+
+ * rootcontext.cs (RootContext.PopulateTypes): Call
+ TypeManager.CheckStructCycles() for each TypeContainer.
+ [Note: We only need to visit each type once.]
+
+2004-04-28 Martin Baulig <martin@ximian.com>
+
+ * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
+
+ * const.cs (Const.LookupConstantValue): Return a `bool' signalling
+ success and added `out object value'. Use a `bool resolved' field
+ to check whether we've already been called rather than
+ `ConstantValue != null' since this breaks for NullLiterals.
+
+2004-04-28 Raja R Harinath <rharinath@novell.com>
+
+ * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
+ setting of this flag, since the 'set' method may be non-public.
+
+2004-04-28 Raja R Harinath <rharinath@novell.com>
+
+ * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
+ check on current_vector.Block.
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
+ a field initializer. Fixes #56459.
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
+ we're not attempting to use an indexer. Fixes #52154.
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Return): Don't create a return label if we don't
+ need it; reverts my change from January 20th. Thanks to Ben
+ Maurer for this.
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ According to the spec, `goto' can only leave a nested scope, but
+ never enter it.
+
+ * statement.cs (Block.LookupLabel): Only lookup in the current
+ block, don't recurse into parent or child blocks.
+ (Block.AddLabel): Check in parent and child blocks, report
+ CS0140/CS0158 if we find a duplicate.
+ (Block): Removed this indexer for label lookups.
+ (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
+ this already does the error reporting for us.
+
+ * flowanalysis.cs
+ (FlowBranching.UsageVector.Block): New public variable; may be null.
+ (FlowBranching.CreateSibling): Added `Block' argument.
+ (FlowBranching.LookupLabel): New public virtual method. Lookup a
+ label for the target of a `goto' and check whether we're not
+ leaving a `finally'.
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
+ a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
+ just for returns).
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Block.AddLabel): Also check for implicit blocks
+ and added a CS0158 check.
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranchingLoop): New class.
+ (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
+ UsageVector's instead of an ArrayList.
+ (FlowBranching.Label): Likewise.
+ (FlowBranching.UsageVector.MergeBreakOrigins): New method.
+ (FlowBranching.AddBreakVector): New method.
+
+2004-04-27 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs: Small regression fix: only convert the type if we
+ the type is different, fixes System.Drawing build.
+
+2004-04-27 Martin Baulig <martin@ximian.com>
+
+ * attribute.cs (Attribute.Resolve): If we have a constant value
+ for a named field or property, implicity convert it to the correct
+ type.
+
+2004-04-27 Raja R Harinath <rharinath@novell.com>
+
+ * statement.cs (Block.Block): Implicit blocks share
+ 'child_variable_names' fields with parent blocks.
+ (Block.AddChildVariableNames): Remove.
+ (Block.AddVariable): Mark variable as "used by a child block" in
+ every surrounding block.
+ * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
+ been used in a child block, complain about violation of "Invariant
+ meaning in blocks" rule.
+ * cs-parser.jay (declare_local_variables): Don't use
+ AddChildVariableNames.
+ (foreach_statement): Don't create an implicit block: 'foreach'
+ introduces a scope.
+
+2004-04-23 Miguel de Icaza <miguel@ximian.com>
+
+ * convert.cs (ImplicitNumericConversion): 0 is also positive when
+ converting from 0L to ulong. Fixes 57522.
+
+2004-04-22 Marek Safar <marek.safar@seznam.cz>
+
+ * decl.cs (FindMemberToOverride): Fix wrong warning for case when
+ derived class hides via 'new' keyword field from base class (test-242.cs).
+ TODO: Handle this in the more general way.
+
+ * class.cs (CheckBase): Ditto.
+
+2004-04-22 Marek Safar <marek.safar@seznam.cz>
+
+ * decl.cs (caching_flags): New member for storing cached values
+ as bit flags.
+ (MemberCore.Flags): New enum where bit flags for caching_flags
+ are defined.
+ (MemberCore.cls_compliance): Moved to caching_flags.
+ (DeclSpace.Created): Moved to caching_flags.
+
+ * class.cs: Use caching_flags instead of DeclSpace.Created
+
+2004-04-21 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
+ if we are only a derived class, not a nested class.
+
+ * typemanager.cs: Same as above, but do this at the MemberLookup
+ level (used by field and methods, properties are handled in
+ PropertyExpr). Allow for the qualified access if we are a nested
+ method.
+
+2004-04-21 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs: Refactoring.
+ (IMethodData): New inteface; Holds links to parent members
+ to avoid member duplication (reduced memory allocation).
+ (Method): Implemented IMethodData interface.
+ (PropertyBase): New inner classes for get/set methods.
+ (PropertyBase.PropertyMethod): Implemented IMethodData interface
+ (Event): New inner classes for add/remove methods.
+ (Event.DelegateMethod): Implemented IMethodData interface.
+
+ * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
+ EmitContext (related to class.cs refactoring).
+
+2004-04-21 Raja R Harinath <rharinath@novell.com>
+
+ * delegate.cs (Delegate.VerifyApplicability): If the number of
+ arguments are the same as the number of parameters, first try to
+ verify applicability ignoring any 'params' modifier on the last
+ parameter.
+ Fixes #56442.
+
+2004-04-16 Raja R Harinath <rharinath@novell.com>
+
+ * class.cs (TypeContainer.AddIndexer): Use
+ 'ExplicitInterfaceName' to determine if interface name was
+ explicitly specified. 'InterfaceType' is not initialized at this time.
+ (TypeContainer.DefineIndexers): Remove use of temporary list. The
+ Indexers array is already in the required order. Initialize
+ 'IndexerName' only if there are normal indexers.
+ (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
+ (TypeContainer.Emit): Emit DefaultMember attribute only if
+ IndexerName is initialized.
+ Fixes #56300.
+
+2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
+
+ * enum.cs (Enum.DefineType): Don't allow char as type for enum.
+ Fixes #57007
+
+2004-04-15 Raja R Harinath <rharinath@novell.com>
+
+ * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
+ attributes.
+ Fix for #56456.
+
+ * attribute.cs (Attribute.Resolve): Check for duplicate named
+ attributes.
+ Fix for #56463.
+
+2004-04-15 Miguel de Icaza <miguel@ximian.com>
+
+ * iterators.cs (MarkYield): track whether we are in an exception,
+ and generate code accordingly. Use a temporary value to store the
+ result for our state.
+
+ I had ignored a bit the interaction of try/catch with iterators
+ since their behavior was not entirely obvious, but now it is
+ possible to verify that our behavior is the same as MS .NET 2.0
+
+ Fixes 54814
+
+2004-04-14 Miguel de Icaza <miguel@ximian.com>
+
+ * iterators.cs: Avoid creating temporaries if there is no work to
+ do.
+
+ * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
+ Enumerations, use TypeManager.EnumToUnderlying and call
+ recursively.
+
+ Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
+ bug #57013
+
+ (This.Emit): Use EmitContext.EmitThis to emit our
+ instance variable.
+
+ (This.EmitAssign): Ditto.
+
+ * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
+ codepaths, we will move all the functionality into
+ Mono.CSharp.This
+
+ (FieldExpr.EmitAssign): Ditto.
+
+ This fixes several hidden bugs that I uncovered while doing a code
+ review of this today.
+
+ * codegen.cs (EmitThis): reworked so the semantics are more clear
+ and also support value types "this" instances.
+
+ * iterators.cs: Changed so that for iterators in value types, we
+ do not pass the value type as a parameter.
+
+ Initialization of the enumerator helpers is now done in the caller
+ instead of passing the parameters to the constructors and having
+ the constructor set the fields.
+
+ The fields have now `assembly' visibility instead of private.
+
+2004-04-11 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Argument.Resolve): Check if fields passed as ref
+ or out are contained in a MarshalByRefObject.
+
+ * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
+ another compiler type.
+
+2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.cs (Indexer.Define): use the new name checking method.
+ Also, return false on an error.
+ * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
+ (is_identifier_[start/part]_character): make static.
+
+2004-04-10 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.ResolveOperator): Do no append strings
+ twice: since we can be invoked more than once (array evaluation)
+ on the same concatenation, take care of this here. Based on a fix
+ from Ben (bug #56454)
+
+2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
+
+ * codegen.cs: Fix another case where CS1548 must be reported (when
+ delay-sign isn't specified and no private is available #56564). Fix
+ loading the ECMA "key" to delay-sign an assembly. Report a CS1548
+ error when MCS is used on the MS runtime and we need to delay-sign
+ (which seems unsupported by AssemblyBuilder - see #56621).
+
+2004-04-08 Marek Safar <marek.safar@seznam.cz>
+
+ * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
+ (TypeManager.ComputeNamespaces): Faster implementation for
+ Microsoft runtime.
+
+ * compiler.csproj: Updated AssemblyName to mcs.
+
+2004-04-07 Miguel de Icaza <miguel@ximian.com>
+
+ * rootcontext.cs: Add new types to the boot resolution.
+
+ * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
+ MulticastDelegate is not allowed.
+
+ * typemanager.cs: Add new types to lookup: System.TypedReference
+ and ArgIterator.
+
+ * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
+ check for TypedReference or ArgIterator, they are not allowed.
+
+ * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
+ makes us properly catch 1510 in some conditions (see bug 56016 for
+ details).
+
+2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
+
+ * CryptoConvert.cs: update from corlib version
+ with endian fixes.
+
+2004-04-05 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Indexer.Define): Check indexername declaration
+
+2004-04-05 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (IsClsCompliant): Fixed problem with handling
+ all three states (compliant, not-compliant, undetected).
+
+2004-03-30 Marek Safar <marek.safar@seznam.cz>
+
+ * attribute.cs (Attribute): Location is now public.
+ (Resolve): Store resolved arguments (pos_values) in attribute class.
+ Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
+ (GetClsCompliantAttributeValue): New method that gets
+ CLSCompliantAttribute value.
+ (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
+ if exists else null.
+ (AttributeTester): New class for CLS-Compliant verification routines.
+
+ * class.cs (Emit): Add CLS-Compliant verification.
+ (Method.GetSignatureForError): Implemented.
+ (Constructor.GetSignatureForError): Implemented
+ (Constructor.HasCompliantArgs): Returns if constructor has
+ CLS-Compliant arguments.
+ (Constructor.Emit): Override.
+ (Construcor.IsIdentifierClsCompliant): New method; For constructors
+ is needed to test only parameters.
+ (FieldBase.GetSignatureForError): Implemented.
+ (TypeContainer): New member for storing base interfaces.
+ (TypeContainer.FindMembers): Search in base interfaces too.
+
+ * codegen.cs (GetClsComplianceAttribute): New method that gets
+ assembly or module CLSCompliantAttribute value.
+ (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
+ for assembly.
+ (ModuleClass.Emit): Add error 3012 test.
+
+ * const.cs (Emit): Override and call base for CLS-Compliant tests.
+
+ * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
+ state for all decl types.
+ (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
+ if CLS-Compliant tests are required.
+ (IsClsCompliaceRequired): New method. Analyze whether code
+ must be CLS-Compliant.
+ (IsExposedFromAssembly): New method. Returns true when MemberCore
+ is exposed from assembly.
+ (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
+ value or gets cached value.
+ (HasClsCompliantAttribute): New method. Returns true if MemberCore
+ is explicitly marked with CLSCompliantAttribute.
+ (IsIdentifierClsCompliant): New abstract method. This method is
+ used to testing error 3005.
+ (IsIdentifierAndParamClsCompliant): New method. Common helper method
+ for identifier and parameters CLS-Compliant testing.
+ (VerifyClsCompliance): New method. The main virtual method for
+ CLS-Compliant verifications.
+ (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
+ null. I don't know why is null (too many public members !).
+ (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
+ and get value of first CLSCompliantAttribute that found.
+
+ * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
+ (VerifyClsCompliance): Override and add extra tests.
+
+ * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
+ clscheck- disable CLS-Compliant verification event if assembly is has
+ CLSCompliantAttribute(true).
+
+ * enum.cs (Emit): Override and call base for CLS-Compliant tests.
+ ApllyAttribute is now called in emit section as in the other cases.
+ Possible future Emit integration.
+ (IsIdentifierClsCompliant): New override.
+ (VerifyClsCompliance): New override.
+ (GetEnumeratorName): Returns full enum name.
+
+ * parameter.cs (GetSignatureForError): Implemented.
+
+ * report.cs (WarningData): New struct for Warning message information.
+ (LocationOfPreviousError): New method.
+ (Warning): New method. Reports warning based on the warning table.
+ (Error_T): New method. Reports error based on the error table.
+
+ * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
+ verifications are done here.
+
+ * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
+
+ * typemanager.cs (cls_compliant_attribute_type): New member thath holds
+ CLSCompliantAttribute.
+ (all_imported_types): New member holds all imported types from other
+ assemblies.
+ (LoadAllImportedTypes): New method fills static table with exported types
+ from all referenced assemblies.
+ (Modules): New property returns all assembly modules.
+
+2004-03-30 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Add a rule to catch wrong event syntax instead of
+ throwing a parser error.
+
+ * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
+ which removes the hardcoded get_/set_ prefixes for properties, as
+ IL allows for the properties to be named something else.
+
+ Bug #56013
+
+ * expression.cs: Do not override operand before we know if it is
+ non-null. Fix 56207
+
+2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * typemanager.cs: support for pinned variables.
+
+2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * decl.cs, typemanager.cs: Avoid using an arraylist
+ as a buffer if there is only one result set.
+
+2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Make sure you cant call a static method
+ with an instance expression, bug #56174.
+
+2004-03-29 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (IsDuplicateImplementation): Improve error reporting to
+ flag 663 (method only differs in parameter modifier).
+
+ * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
+ in preprocessor directives.
+
+ * location.cs (LookupFile): Allow for the empty path.
+
+ * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
+ better approach for some of that patch, but its failing with the
+ CharSet enumeration. For now try/catch will do.
+
+ * typemanager.cs: Do not crash if a struct does not have fields.
+ Fixes 56150.
+
+2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: cs0213, cant fix a fixed expression.
+ fixes 50231.
+
+2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * cs-parser.jay: detect invalid embeded statements gracefully.
+ bug #51113.
+
+2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
+ As a regex:
+ s/
+ the invocation type may not be a subclass of the tye of the item/
+ The type of the item must be a subclass of the invocation item.
+ /g
+
+ Fixes bug #50820.
+
+2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
+
+ * attribute.cs: Added methods to get a string and a bool from an
+ attribute. Required to information from AssemblyKeyFileAttribute,
+ AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
+ * codegen.cs: Modified AssemblyName creation to include support for
+ strongnames. Catch additional exceptions to report them as CS1548.
+ * compiler.csproj: Updated include CryptoConvert.cs.
+ * compiler.csproj.user: Removed file - user specific configuration.
+ * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
+ Mono.Security assembly. The original class is maintained and tested in
+ /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
+ * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
+ like CSC 8.0 (C# v2) supports.
+ * Makefile: Added CryptoConvert.cs to mcs sources.
+ * rootcontext.cs: Added new options for strongnames.
+
+2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * driver.cs: For --expect-error, report error code `2'
+ if the program compiled with no errors, error code `1' if
+ it compiled with an error other than the one expected.
+
+2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
+
+ * compiler.csproj: Updated for Visual Studio .NET 2003.
+ * compiler.csproj.user: Updated for Visual Studio .NET 2003.
+ * compiler.sln: Updated for Visual Studio .NET 2003.
+
+2004-03-24 Ravi Pratap M <ravi@ximian.com>
+
+ * expression.cs: Fix bug #47234. We basically need to apply the
+ rule that we prefer the conversion of null to a reference type
+ when faced with a conversion to 'object' (csc behaviour).
+
+2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * statement.cs: Shorter form for foreach, eliminates
+ a local variable. r=Martin.
+
+2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
+ checks if we can use brtrue/brfalse to test for 0.
+ * expression.cs: use the above in the test for using brtrue/brfalse.
+ cleanup code a bit.
+
+2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Rewrite string concat stuff. Benefits:
+
+ - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
+ - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
+ rather than a concat chain.
+
+ * typemanager.cs: Add lookups for more concat overloads.
+
+2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Emit shorter il code for array init.
+
+ newarr
+ dup
+ // set 1
+
+ // set 2
+
+ newarr
+ stloc.x
+
+ ldloc.x
+ // set 1
+
+ ldloc.x
+ // set 2
+
+2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * statement.cs: Before, two switch blocks would be merged if the
+ total size of the blocks (end_item - begin_item + 1) was less than
+ two times the combined sizes of the blocks.
+
+ Now, it will only merge if after the merge at least half of the
+ slots are filled.
+
+ fixes 55885.
+
+2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
+
+ * class.cs : csc build fix for GetMethods(). See bug #52503.
+
+2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Make sure fp comparisons work with NaN.
+ This fixes bug #54303. Mig approved this patch a long
+ time ago, but we were not able to test b/c the runtime
+ had a related bug.
+
+2004-03-19 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (TypExpr.GetHashCode): implement this overload.
+
+2004-03-19 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MemberCore.IsDuplicateImplementation): Report the
+ error here and not in our caller.
+
+2004-03-19 Martin Baulig <martin@ximian.com>
+
+ * interface.cs: Completely killed this file.
+ (Interface): We're now a TypeContainer and live in class.cs.
+
+ * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
+ argument; we're now also called for interfaces.
+ (TypeContainer.DefineMembers): Allow this method being called
+ multiple times.
+ (TypeContainer.GetMethods): New public method; formerly known as
+ Interface.GetMethod(). This is used by PendingImplementation.
+ (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
+ it's now private and non-static.
+ (Interface): Moved this here; it's now implemented similar to
+ Class and Struct.
+ (Method, Property, Event, Indexer): Added `bool is_interface'
+ argument to their .ctor's.
+ (MemberBase.IsInterface): New public field.
+
+ * cs-parser.jay: Create normal Method, Property, Event, Indexer
+ instances instead of InterfaceMethod, InterfaceProperty, etc.
+ (opt_interface_base): Removed; we now use `opt_class_base' instead.
+ (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
+
+2004-03-19 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodCore.IsDuplicateImplementation): New private
+ method which does the CS0111 checking.
+ (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
+ Use IsDuplicateImplementation().
+
+2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * decl.cs (FindMemberToOverride): New method to find the correct
+ method or property to override in the base class.
+ * class.cs
+ - Make Method/Property use the above method to find the
+ version in the base class.
+ - Remove the InheritableMemberSignatureCompare as it is now
+ dead code.
+
+ This patch makes large code bases much faster to compile, as it is
+ O(n) rather than O(n^2) to do this validation.
+
+ Also, it fixes bug 52458 which is that nested classes are not
+ taken into account when finding the base class member.
+
+ Reviewed/Approved by Martin.
+
+2004-03-17 Marek Safar <marek.safar@seznam.cz>
+
+ * interface.cs: In all interface classes removed redundant
+ member initialization.
+
+2004-03-16 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
+
+2004-03-15 Miguel de Icaza <miguel@ximian.com>
+
+ * decl.cs (DefineTypeAndParents): New helper method to define a
+ type's containers before the type itself is defined; This is a
+ bug exposed by the recent changes to Windows.Forms when an
+ implemented interface was defined inside a class that had not been
+ built yet.
+
+ * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
+
+ (Check): Loop correctly to report errors modifiers
+ (UNSAFE was not in the loop, since it was the same as TOP).
+
+ * interface.cs: Every interface member now takes a ModFlags,
+ instead of a "is_new" bool, which we set on the base MemberCore.
+
+ Every place where we called "UnsafeOk" in the interface, now we
+ call the proper member (InterfaceMethod.UnsafeOK) instead to get
+ the unsafe settings from the member declaration instead of the
+ container interface.
+
+ * cs-parser.jay (opt_new): Allow unsafe here per the spec.
+
+ * pending.cs (TypeAndMethods): Add `get_indexer_name' and
+ `set_indexer_name' to the pending bits (one per type).
+
+ We fixed a bug today that was picking the wrong method to
+ override, since for properties the existing InterfaceMethod code
+ basically ignored the method name. Now we make sure that the
+ method name is one of the valid indexer names.
+
+2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
+
+ * support.cs (SeekableStreamReader): Keep track of stream byte
+ positions and don't mix them with character offsets to the buffer.
+
+ Patch from Gustavo Giráldez
+
+2004-03-15 Marek Safar <marek.safar@seznam.cz>
+
+ * interface.cs (InterfaceSetGetBase): Removed double member
+ initialization, base class does it as well.
+
+2004-03-13 Martin Baulig <martin@ximian.com>
+
+ * class.cs: Reverted Miguel's latest commit; it makes mcs crash
+ when compiling corlib.
+
+2004-03-13 Miguel de Icaza <miguel@ximian.com>
+
+ * convert.cs (ExplicitConversion): We were reporting an error on
+ certain conversions (object_type source to a value type, when the
+ expression was `null') before we had a chance to pass it through
+ the user defined conversions.
+
+ * driver.cs: Replace / and \ in resource specifications to dots.
+ Fixes 50752
+
+ * class.cs: Add check for duplicate operators. Fixes 52477
+
+2004-03-11 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
+ that are in the middle of the statements, not only at the end.
+ Fixes #54987
+
+ * class.cs (TypeContainer.AddField): No longer set the
+ `HaveStaticConstructor' flag, now we call it
+ `UserDefineStaticConstructor' to diferentiate the slightly
+ semantic difference.
+
+ The situation is that we were not adding BeforeFieldInit (from
+ Modifiers.TypeAttr) to classes that could have it.
+ BeforeFieldInit should be set to classes that have no static
+ constructor.
+
+ See:
+
+ http://www.yoda.arachsys.com/csharp/beforefieldinit.html
+
+ And most importantly Zoltan's comment:
+
+ http://bugzilla.ximian.com/show_bug.cgi?id=44229
+
+ "I think beforefieldinit means 'it's ok to initialize the type sometime
+ before its static fields are used', i.e. initialization does not need
+ to be triggered by the first access to the type. Setting this flag
+ helps the JIT to compile better code, since it can run the static
+ constructor at JIT time, and does not need to generate code to call it
+ (possibly lots of times) at runtime. Unfortunately, mcs does not set
+ this flag for lots of classes like String.
+
+ csc sets this flag if the type does not have an explicit static
+ constructor. The reasoning seems to be that if there are only static
+ initalizers for a type, and no static constructor, then the programmer
+ does not care when this initialization happens, so beforefieldinit
+ can be used.
+
+ This bug prevents the AOT compiler from being usable, since it
+ generates so many calls to mono_runtime_class_init that the AOT code
+ is much slower than the JITted code. The JITted code is faster,
+ because it does not generate these calls if the vtable is type is
+ already initialized, which is true in the majority of cases. But the
+ AOT compiler can't do this."
+
+2004-03-10 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (MethodData.Emit): Refactor the code so symbolic
+ information is generated for destructors; For some reasons we
+ were taking a code path that did not generate symbolic information
+ before.
+
+2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.cs: Create a Constructor.CheckBase method that
+ takes care of all validation type code. The method
+ contains some code that was moved from Define.
+
+ It also includes new code that checks for duplicate ctors.
+ This fixes bug #55148.
+
+2004-03-09 Joshua Tauberer <tauberer@for.net>
+
+ * expression.cs (ArrayCreation): Fix: More than 6 nulls in
+ a { ... }-style array creation invokes EmitStaticInitializers
+ which is not good for reference-type arrays. String, decimal
+ and now null constants (NullCast) are not counted toward
+ static initializers.
+
+2004-03-05 Martin Baulig <martin@ximian.com>
+
+ * location.cs (SourceFile.HasLineDirective): New public field;
+ specifies whether the file contains or is referenced by a "#line"
+ directive.
+ (Location.DefineSymbolDocuments): Ignore source files which
+ either contain or are referenced by a "#line" directive.
+
+2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.cs (Method.CheckBase): Avoid using FindMembers, we have
+ direct access to our parent, so check the method inline there.
+
+2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs (Invocation.EmitCall): Miguel's last commit
+ caused a regression. If you had:
+
+ T t = null;
+ t.Foo ();
+
+ In Foo the implict this would be null.
+
+2004-02-27 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Invocation.EmitCall): If the method is not
+ virtual, do not emit a CallVirt to it, use Call.
+
+ * typemanager.cs (GetFullNameSignature): Improve the method to
+ cope with ".ctor" and replace it with the type name.
+
+ * class.cs (ConstructorInitializer.Resolve): Now the method takes
+ as an argument the ConstructorBuilder where it is being defined,
+ to catch the recursive constructor invocations.
+
+2004-02-26 Miguel de Icaza <miguel@ximian.com>
+
+ * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
+ routines to check if a type is an enumerable/enumerator allow
+ classes that implement the IEnumerable or IEnumerator interfaces.
+
+ * class.cs (Property, Operator): Implement IIteratorContainer, and
+ implement SetYields.
+
+ (Property.Define): Do the block swapping for get_methods in the
+ context of iterators. We need to check if Properties also
+ include indexers or not.
+
+ (Operator): Assign the Block before invoking the
+ OperatorMethod.Define, so we can trigger the Iterator code
+ replacement.
+
+ * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
+ Property and Operator classes are not created when we parse the
+ declarator but until we have the block completed, so we use a
+ singleton SimpleIteratorContainer.Simple to flag whether the
+ SetYields has been invoked.
+
+ We propagate this setting then to the Property or the Operator to
+ allow the `yield' to function.
+
+2004-02-25 Marek Safar <marek.safar@seznam.cz>
+
+ * codegen.cs: Implemented attribute support for modules.
+ New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
+ Assembly/Module functionality.
+
+ * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
+ interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
+ Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
+
+2004-02-16 Marek Safar <marek.safar@seznam.cz>
+
+ * interface.cs (FindMembers): The operation is performed on all base
+ interfaces and not only on the first. It is required for future CLS Compliance patch.
+
+2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * statement.cs, codegen.cs:
+ This patch deals with patterns such as:
+
+ public class List : IEnumerable {
+
+ public MyEnumerator GetEnumerator () {
+ return new MyEnumerator(this);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator () {
+ ...
+ }
+
+ public struct MyEnumerator : IEnumerator {
+ ...
+ }
+ }
+
+ Before, there were a few things we did wrong:
+ 1) we would emit callvirt on a struct, which is illegal
+ 2) we emited ldarg when we needed to emit ldarga
+ 3) we would mistakenly call the interface methods on an enumerator
+ type that derived from IEnumerator and was in another assembly. For example:
+
+ public class MyEnumerator : IEnumerator
+
+ Would have the interface methods called, even if there were public impls of the
+ method. In a struct, this lead to invalid IL code.
+
+2004-02-11 Marek Safar <marek.safar@seznam.cz>
+
+ * const.cs: Const is now derived from FieldBase. Method EmitConstant name
+ renamed to Emit.
+
+ * delegate.cs (Define): Fixed crash when delegate type is undefined.
+
+2004-02-11 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Fix small regression: we were not testing V2
+ compiler features correctly.
+
+ * interface.cs: If the emit context is null, then create one
+
+2004-02-09 Marek Safar <marek.safar@seznam.cz>
+
+ * decl.cs (GetSignatureForError): New virtual method to get full name
+ for error messages.
+
+ * attribute.cs (IAttributeSupport): New interface for attribute setting.
+ Now it is possible to rewrite ApplyAttributes method to be less if/else.
+
+ * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
+ Duplicated members and code in these classes has been removed.
+ Better encapsulation in these classes.
+
+2004-02-07 Miguel de Icaza <miguel@ximian.com>
+
+ * assign.cs (Assign.DoResolve): When dealing with compound
+ assignments, there is a new rule in ECMA C# 2.4 (might have been
+ there before, but it is documented here) that states that in:
+
+ a op= b;
+
+ If b is of type int, and the `op' is a shift-operator, then the
+ above is evaluated as:
+
+ a = (int) a op b
+
+ * expression.cs (Binary.ResolveOperator): Instead of testing for
+ int/uint/long/ulong, try to implicitly convert to any of those
+ types and use that in pointer arithmetic.
+
+ * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
+ method to print information for from the type, not from the
+ null-method we were given.
+
+2004-02-01 Duncan Mak <duncan@ximian.com>
+
+ * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
+ parsing for cmd, fixes bug #53694.
+
+2004-02-04 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
+ in the member name duplication tests. Property and operator name duplication
+ was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
+
+2004-02-03 Marek Safar <marek.safar@seznam.cz>
+
+ * interface.cs (PopulateMethod): Fixed crash when interface method
+ returns not existing type (error test cs0246-3.cs).
+
+2004-02-02 Ravi Pratap M <ravi@ximian.com>
+
+ * cs-parser.jay (interface_accessors): Re-write actions to also
+ store attributes attached to get and set methods. Fix spelling
+ while at it.
+
+ (inteface_property_declaration): Modify accordingly.
+
+ (InterfaceAccessorInfo): New helper class to store information to pass
+ around between rules that use interface_accessors.
+
+ * interface.cs (Emit): Apply attributes on the get and set
+ accessors of properties and indexers too.
+
+ * attribute.cs (ApplyAttributes): Modify accordingly to use the
+ right MethodBuilder when applying attributes to the get and set accessors.
+
+2004-01-31 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
+
+2004-01-26 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs: Handle #line hidden from PDC bits.
+
+2004-01-25 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Remove YIELD token, instead use the new grammar
+ changes that treat `yield' specially when present before `break'
+ or `return' tokens.
+
+ * cs-tokenizer.cs: yield is no longer a keyword.
+
+2004-01-23 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
+ setting for default constructors.
+ For default constructors are almost every time set wrong Modifier. The
+ generated IL code has been alright. But inside mcs this values was
+ wrong and this was reason why several of my CLS Compliance tests
+ failed.
+
+2004-01-22 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay (namespace_or_type_name): Return an Expression,
+ not a QualifiedIdentifier. This is what `type_name_expression'
+ was previously doing.
+ (type_name_expression): Removed; the code is now in
+ `namespace_or_type_name'.
+ (qualified_identifier): Removed, use `namespace_or_type_name'
+ instead.
+ (QualifiedIdentifier): Removed this class.
+
+2004-01-22 Martin Baulig <martin@ximian.com>
+
+ * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
+ not a string as alias name.
+
+2004-01-21 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
+ #52730 bug, and instead compute correctly the need to use a
+ temporary variable when requesting an address based on the
+ static/instace modified of the field and the constructor.
+
+2004-01-21 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
+ class and namespace before looking up aliases. Fixes #52517.
+
+2004-01-21 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (UsageVector.Merge): Allow variables being
+ assinged in a 'try'; fixes exception4.cs.
+
+2004-01-21 Marek Safar <marek.safar@seznam.cz>
+ * class.cs : Implemented parameter-less constructor for TypeContainer
+
+ * decl.cs: Attributes are now stored here. New property OptAttributes
+
+ * delegate.cs, enum.cs, interface.cs: Removed attribute member.
+
+ * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
+
+2004-01-21 Marek Safar <marek.safar@seznam.cz>
+
+ * typemanager.cs (CSharpSignature): Now reports also inner class name.
+ (CSharpSignature): New method for indexer and property signature.
+
+2004-01-21 Marek Safar <marek.safar@seznam.cz>
+
+ * pending.cs (IsVirtualFilter): Faster implementation.
+
+2004-01-21 Marek Safar <marek.safar@seznam.cz>
+
+ * typemanager.cs: Avoid inclusion of same assembly more than once.
+
+2004-01-21 Marek Safar <marek.safar@seznam.cz>
+
+ * cs-parser.jay: Fixed problem where the last assembly attribute
+ has been applied also to following declaration (class, struct, etc.)
+
+2004-01-21 Marek Safar <marek.safar@seznam.cz>
+
+ * class.cs: Added error CS0538, CS0539 reporting.
+ Fixed crash on Microsoft runtime when field type is void.
+
+ * cs-parser.jay: Added error CS0537 reporting.
+
+ * pending.cs: Added error CS0535 reporting.
+ Improved error report for errors CS0536, CS0534.
+
+2004-01-20 Miguel de Icaza <miguel@ximian.com>
+
+ Merge a few bits from the Anonymous Method MCS tree.
+
+ * statement.cs (ToplevelBlock): New class for toplevel methods,
+ will hold anonymous methods, lifted variables.
+
+ * cs-parser.jay: Create toplevel blocks for delegates and for
+ regular blocks of code.
+
+2004-01-20 Martin Baulig <martin@ximian.com>
+
+ * codegen.cs (EmitContext): Removed `InTry', `InCatch',
+ `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
+ and `NeedExplicitReturn'; added `IsLastStatement'.
+ (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
+ have a `ReturnLabel' or we're not unreachable.
+
+ * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
+ child's reachability; don't just override ours with it. Fixes
+ #58058 (lluis's example).
+ (FlowBranching): Added public InTryOrCatch(), InCatch(),
+ InFinally(), InLoop(), InSwitch() and
+ BreakCrossesTryCatchBoundary() methods.
+
+ * statement.cs (Return): Do all error checking in Resolve().
+ Unless we are the last statement in a top-level block, always
+ create a return label and jump to it.
+ (Break, Continue): Do all error checking in Resolve(); also make
+ sure we aren't leaving a `finally'.
+ (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
+ statement in a top-level block.
+ (Block.Flags): Added `IsDestructor'.
+ (Block.IsDestructor): New public property.
+
+2004-01-20 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
+
+2004-01-20 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Statement.ResolveUnreachable): New public method.
+ (If, While): Do the dead-code elimination in Resolve(), not in Emit().
+ (Block.Resolve): Resolve unreachable statements.
+
+2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: We need to fix the case where we do
+ not have a temp variable here.
+
+ * assign.cs: Only expression compound assignments need
+ temporary variables.
+
+2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * flowanalysis.cs: Reduce memory allocation in a few ways:
+ - A block with no variables should not allocate a bit
+ vector for itself.
+ - A method with no out parameters does not need any tracking
+ for assignment of the parameters, so we need not allocate
+ any data for it.
+ - The arrays:
+ public readonly Type[] VariableTypes;
+ public readonly string[] VariableNames;
+ Are redundant. The data is already stored in the variable
+ map, so we need not allocate another array for it.
+ - We need to add alot of checks for if (params | locals) == null
+ due to the first two changes.
+
+2004-01-18 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
+ implement IMemoryLocation, we store a copy on a local variable and
+ take the address of it. Patch from Benjamin Jemlich
+
+ * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
+ to use a special "type_name_expression" rule which reduces the
+ number of "QualifiedIdentifier" classes created, and instead
+ directly creates MemberAccess expressions.
+
+2004-01-17 Miguel de Icaza <miguel@ximian.com>
+
+ * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
+ that fixes #52853. Null literal assignment to ValueType
+
+ * class.cs (MethodData.Emit): Instead of checking the name of the
+ method to determine if its a destructor, create a new derived
+ class from Method called Destructor, and test for that.
+
+ * cs-parser.jay: Create a Destructor object instead of a Method.
+
+ Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
+
+ Fixes: 52933
+
+2004-01-16 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.ResolveOperator): Perform an implicit
+ conversion from MethodGroups to their delegate types on the
+ Addition operation.
+
+ * delegate.cs: Introduce a new class DelegateCreation that is the
+ base class for `NewDelegate' and `ImplicitDelegateCreation',
+ factor some code in here.
+
+ * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
+ conversion from MethodGroups to compatible delegate types.
+
+ * ecore.cs (Expression.Resolve): Do not flag error 654
+ (Methodgroupd needs parenthesis) if running on the V2 compiler, as
+ we allow conversions from MethodGroups to delegate types now.
+
+ * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
+ assignments in v2 either.
+
+2004-01-10 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
+ static read-only fields in ctors.
+
+ Applied patch from Benjamin Jemlich
+
+ * expression.cs (UnaryMutator): Avoid leaking local variables.
+
+2004-01-09 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs (IsCastToken): Allow the various native types
+ here to return true, as they can be used like this:
+
+ (XXX) int.MEMBER ()
+
+ Fixed 49836 and all the other dups
+
+2004-01-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.cs: Implement /win32res and /win32icon.
+
+2004-01-08 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Add a rule to improve error handling for the
+ common mistake of placing modifiers after the type.
+
+2004-01-07 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay (interface_event_declaration): Catch
+ initialization of events on interfaces, and report cs0068
+
+ * cs-parser.jay (interface_event_declaration): Catch
+ initialization of events.
+
+ * ecore.cs: Better report missing constructors.
+
+ * expression.cs (Binary.ResolveOperator): My previous bug fix had
+ the error reporting done in the wrong place. Fix.
+
+ * expression.cs (Binary.ResolveOperator): Catch the
+ operator + (E x, E y) error earlier, and later allow for implicit
+ conversions in operator +/- (E e, U x) from U to the underlying
+ type of E.
+
+ * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
+ 52596, if the container class is abstract, the default constructor
+ is protected otherwise its public (before, we were always public).
+
+ * statement.cs (Fixed.Resolve): Catch a couple more errors in the
+ fixed statement.
+
+ (Using.EmitLocalVariableDecls): Applied patch from Benjamin
+ Jemlich that fixes bug #52597, MCS was generating invalid code for
+ idisposable structs. Thanks to Ben for following up with this
+ bug as well.
+
+2004-01-06 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Allow assemblies without code to be generated, fixes
+ 52230.
+
+2004-01-07 Nick Drochak <ndrochak@gol.com>
+
+ * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
+
+2004-01-05 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Add rules to improve error reporting if fields or
+ methods are declared at the namespace level (error 116)
+
+ * Add rules to catch event add/remove
+
+2004-01-04 David Sheldon <dave-mono@earth.li>
+
+ * expression.cs: Added matching ")" to error message for
+ CS0077
+
+2004-01-03 Todd Berman <tberman@gentoo.org>
+
+ * ecore.cs, attribute.cs:
+ Applying fix from #52429.
+
+2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * ecore.cs, expression.cs, statement.cs:
+ Total rewrite of how we handle branching. We
+ now handle complex boolean expressions with fewer
+ jumps. As well if (x == 0) no longer emits a ceq.
+
+ if (x is Foo) is much faster now, because we generate
+ better code.
+
+ Overall, we get a pretty big improvement on our benchmark
+ tests. The code we generate is smaller and more readable.
+
+ I did a full two-stage bootstrap. The patch was reviewed
+ by Martin and Miguel.
+
+2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * cs-parser.jay: Make primary_expression not take a QI.
+ we dont need this because the member_access rule covers
+ us here. So we replace the rule with just IDENTIFIER.
+
+ This has two good effects. First, we remove a s/r conflict.
+ Second, we allocate many fewer QualifiedIdentifier objects.
+
+2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * attribute.cs: Handle MarshalAs attributes as pseudo, and
+ set the correct information via SRE. This prevents
+ hanging on the MS runtime. Fixes #29374.
+
+2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * convert.cs: correctly handle conversions to value types
+ from Enum and ValueType as unboxing conversions.
+
+ Fixes bug #52569. Patch by Benjamin Jemlich.
+
+2004-01-02 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (BetterConversion): Prefer int -> uint
+ over int -> ulong (csc's behaviour). This fixed bug #52046.
+
+2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * decl.cs (MemberCache.FindMembers): now returns a
+ MemberInfo [].
+
+ * typemanager.cs: In general, go with with ^^.
+ (CopyNewMethods): take an IList.
+ (RealMemberLookup): Only allocate an arraylist
+ if we copy from two sets of methods.
+
+ This change basically does two things:
+ 1) Fewer array lists allocated due to CopyNewMethods.
+ 2) the explicit cast in MemberList costed ALOT.
+
+2004-01-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
+ a hashtable to avoid needless string allocations when an identifier is
+ used more than once (the common case).
+
+2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * pending.cs: MS's TypeBuilder.GetInterfaces ()
+ is broken, it will not return anything. So, we
+ have to use the information we have in mcs to
+ do the task.
+
+ * typemanager.cs: Add a cache for GetInterfaces,
+ since this will now be used more often (due to ^^)
+
+ (GetExplicitInterfaces) New method that gets the
+ declared, not effective, interfaces on a type
+ builder (eg, if you have interface IFoo, interface
+ IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
+ { IBar }.
+
+ This patch makes MCS able to bootstrap itself on
+ Windows again.
+
+2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Remove the Nop's that Miguel put
+ in by mistake.
+
+2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * report.cs, codegen.cs: Give the real stack trace to
+ the error when an exception is thrown.
+
+2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * decl.cs: only allocate hashtables for ifaces if
+ it is an iface!
+
+2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: fix the error from cs0121-2.cs
+ (a parent interface has two child interfaces that
+ have a function with the same name and 0 params
+ and the function is called through the parent).
+
+2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.cs, rootcontext.cs, typmanager.cs: do not
+ leak pointers.
+
+2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * codegen.cs: remove stack for the ec flow branching.
+ It is already a linked list, so no need.
+
+2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * Makefile: Allow custom profiler here.
+
+2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * typemanager.cs (LookupType):
+ - Use a static char [], because split takes
+ a param array for args, so it was allocating
+ every time.
+ - Do not store true in a hashtable, it boxes.
+
+2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * flowanalysis.cs: bytify common enums.
+
+2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * modifiers.cs: Add a new set of flags for the
+ flags allowed on explicit interface impls.
+ * cs-parser.jay: catch the use of modifiers in
+ interfaces correctly.
+ * class.cs: catch private void IFoo.Blah ().
+
+ All related to bug #50572.
+
+2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * decl.cs: Rewrite the consistant accessability checking.
+ Accessability is not linear, it must be implemented in
+ a tableish way. Fixes #49704.
+
+2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * expression.cs: Handle negation in a checked context.
+ We must use subtraction from zero. Fixes #38674.
+
+2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.cs: Ignore static void main in DLLs.
+ * rootcontext.cs: Handle the target type here,
+ since we are have to access it from class.cs
+ * driver.cs: account for the above.
+
+2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * report.cs: Give line numbers and files if available.
+
+2003-12-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.cs: Implement /addmodule.
+
+ * typemanager.cs: Change 'modules' field so it now contains Modules not
+ ModuleBuilders.
+
+2003-12-20 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
+ (FieldBase.IsAssigned): Removed this field.
+ (FieldBase.SetAssigned): New public method.
+ (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
+
+2003-12-20 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (LocalVariableReference.DoResolve): Don't set
+ `vi.Used' if we're called from DoResolveLValue().
+
+ * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
+ returns the usage vector it just merged into the current one -
+ pass this one to UsageWarning().
+ (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
+ of the `EmitContext', don't call this recursively on our children.
+
+2003-12-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.cs: Implement /target:module.
+
+2003-12-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * support.cs (CharArrayHashtable): New helper class.
+
+ * cs-tokenizer.cs: Store keywords in a hashtable indexed by
+ char arrays, not strings, so we can avoid creating a string in
+ consume_identifier if the identifier is a keyword.
+
+2003-12-16 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (LocalInfo.Assigned): Removed this property.
+ (LocalInfo.Flags): Removed `Assigned'.
+ (LocalInfo.IsAssigned): New public method; takes the EmitContext
+ and uses flow analysis.
+ (Block.UsageWarning): Made this method private.
+ (Block.Resolve): Call UsageWarning() if appropriate.
+
+ * expression.cs (LocalVariableReference.DoResolve): Always set
+ LocalInfo.Used here.
+
+2003-12-13 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
+ any value here; we're now using flow analysis to figure out
+ whether a statement/block returns a value.
+
+2003-12-13 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
+ working again.
+ (FlowBranching.MergeFinally): Don't call
+ `branching.CheckOutParameters()' here, this is called in
+ MergeTopBlock().
+ (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
+ when adding the `finally' vector.
+
+2003-12-13 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs
+ (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
+ actually work and also fix #48962.
+
+2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * decl.cs: Do not check System.Object for nested types,
+ since we know it does not have any. Big bang for buck:
+
+ BEFORE:
+ Run 1: 8.35 seconds
+ Run 2: 8.32 seconds
+ corlib: 17.99 seconds
+ AFTER:
+ Run 1: 8.17 seconds
+ Run 2: 8.17 seconds
+ corlib: 17.39 seconds
+
+2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.cs (FindMembers): Allocate arraylists on demand. Most of the
+ time we are returning 0 members, so we save alot here.
+
+2003-12-11 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
+ `MergeChild()', also just take the `FlowBranching' as argument;
+ call Merge() on it and return the result.
+ (FlowBranching.Merge): We don't need to do anything if we just
+ have one sibling.
+
+2003-12-11 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs: Use a list of `UsageVector's instead of storing
+ them in an `ArrayList' to reduce memory usage. Thanks to Ben
+ Maurer for this idea.
+
+2003-12-11 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (MergeResult): This class is now gone; we now
+ use the `UsageVector' for this. The reason for this is that if a
+ branching just has one sibling, we don't need to "merge" them at
+ all - that's the next step to do.
+ (FlowBranching.Merge): We now return a `UsageVector' instead of a
+ `MergeResult'.
+
+2003-12-11 Martin Baulig <martin@ximian.com>
+
+ Reworked flow analyis and made it more precise and bug-free. The
+ most important change is that we're now using a special `Reachability'
+ class instead of having "magic" meanings of `FlowReturns'. I'll
+ do some more cleanups and optimizations and also add some more
+ documentation this week.
+
+ * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
+ largely reworked this class.
+ (FlowReturns): Removed `Unreachable' and `Exception'; we now use
+ the new `Reachability' class instead of having "magic" values here.
+ (FlowBranching): We're now using an instance of `Reachability'
+ instead of having separate `Returns', `Breaks' etc. fields.
+
+ * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
+ based on flow analysis; ignore the return value of block.Emit ().
+
+2003-12-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.cs typemanager.cs: Find the mono extensions to corlib even
+ if they are private.
+
+2003-12-09 Martin Baulig <martin@ximian.com>
+
+ * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
+ call them directly on the UsageVector.
+
+2003-12-09 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
+ Changed return type from `FlowReturns' to `Reachability'.
+
+2003-12-09 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
+ (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
+ `Reachable' fields with a single `Reachability' one.
+
+2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.cs (FindMembers): Remove foreach's.
+
+ Bootstrap times:
+
+ BEFORE
+ Run 1: 8.74 seconds
+ Run 2: 8.71 seconds
+
+ AFTER
+ Run 1: 8.64 seconds
+ Run 2: 8.58 seconds
+
+
+2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * cs-parser.jay:
+ * gen-treedump.cs:
+ * statement.cs:
+ This patch does a few things:
+ 1. EmptyStatement is now a singleton, so it is never reallocated.
+ 2. All blah is EmptyStatement constructs have been changed to
+ blah == EmptyStatement.Value, which is much faster and valid
+ now that EmptyStatement is a singleton.
+ 3. When resolving a block, rather than allocating a new array for
+ the non-empty statements, empty statements are replaced with
+ EmptyStatement.Value
+ 4. Some recursive functions have been made non-recursive.
+ Mainly the performance impact is from (3), however (1) and (2) are needed for
+ this to work. (4) does not make a big difference in normal situations, however
+ it makes the profile look saner.
+
+ Bootstrap times:
+
+ BEFORE
+ 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
+ 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
+ Total memory allocated: 56397 KB
+
+ AFTER
+ 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
+ 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
+ Total memory allocated: 55666 KB
+
+2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * support.cs: Rewrite DoubleHash to use its own impl. Is faster
+ than the hashtable in a hashtable version
+
+ * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
+ we always end up concating a string. This results in a huge perf
+ loss, because many strings have to be tracked by the GC. In this
+ patch, we first use a hashtable that works with two keys, so that
+ the strings do not need to be concat'ed.
+
+ Bootstrap times:
+ BEFORE
+ Run 1: 8.74 seconds
+ Run 2: 8.71 seconds
+
+ AFTER
+ Run 1: 8.65 seconds
+ Run 2: 8.56 seconds
+
+2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * Makefile: Add a new target `do-time' that does a quick and simple
+ profile, leaving easy to parse output.
+
+2003-12-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * codegen.cs (Init): Create the dynamic assembly with
+ AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
+
+2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * support.cs: Make the PtrHashtable use only one
+ instance of its comparer.
+
+2003-11-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * typemanager.cs: Fix lookup of GetNamespaces.
+
+2003-11-29 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs: Removed redundant line.
+
+ * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
+ ArrayLists, use for loops with bounds.
+
+ * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
+ arraylist.
+
+ * expression.cs (Invocation.OverloadResolve): Avoid foreach on
+ arraylists, use for loop with bounds.
+
+ The above three changes give us a 0.071 second performance
+ improvement out of 3.294 seconds down to 3.223. On my machine
+ the above changes reduced the memory usage by 1,387 KB during
+ compiler bootstrap.
+
+ * cs-parser.jay (QualifiedIdentifier): New class used to represent
+ QualifiedIdentifiers. Before we created a new string through
+ concatenation, and mostly later on, the result would be
+ manipulated by DecomposeQI through string manipulation.
+
+ This reduced the compiler memory usage for bootstrapping from
+ 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
+ compile times in 0.05 seconds.
+
+2003-11-28 Dick Porter <dick@ximian.com>
+
+ * support.cs: Do string compares with the Invariant culture.
+
+ * rootcontext.cs:
+ * gen-treedump.cs:
+ * expression.cs:
+ * driver.cs:
+ * decl.cs:
+ * codegen.cs:
+ * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
+ the comparison is done with the Invariant culture.
+
+2003-11-27 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
+ GetEnumerator method.
+
+ (ProbeCollectionType): Iterate starting at the most specific type
+ upwards looking for a GetEnumerator
+
+ * expression.cs: Shift count can be up to 31 for int/uint and 63
+ for long/ulong.
+
+2003-11-26 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Block.LookupLabel): Also look for the label on the
+ children blocks. Use a hash table to keep track of visited
+ nodes.
+
+ * cfold.cs (IntConstant to UIntConstant mapping): Only return if
+ we actually did transform the other operand, otherwise fall back
+ to the common codepath that casts to long.
+
+ * cs-tokenizer.cs: Use the same code pattern as the int case.
+ Maybe I should do the parsing myself, and avoid depending on the
+ Parse routines to get this done.
+
+2003-11-25 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
+ which fixes bug 51347. This time test it.
+
+ * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
+ attributes for example can not tell the difference between these.
+ The difference was only a syntax feature of the language.
+
+ * attribute.cs: Apply attributes to delegates.
+
+ * delegate.cs: Call the apply attributes method.
+
+2003-11-24 Miguel de Icaza <miguel@ximian.com>
+
+ * convert.cs (TryImplicitIntConversion): One line bug fix: we were
+ comparing 0 vs Byte.MinValue, not the value
+
+ (ImplicitConversionRequired): When reporting a conversion error,
+ use error 31 to print out the constant error instead of the
+ simpler 29.
+
+ * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
+ which fixes bug 51347.
+
+2003-11-22 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
+ which fixes the -warnaserror command line option.
+
+2003-11-21 Miguel de Icaza <miguel@ximian.com>
+
+ * cfold.cs (DoNumericPromotions): During constant folding of
+ additions on UIntConstant, special case intconstants with
+ IntConstants like we do on the expression binary operator.
+
+2003-11-12 Miguel de Icaza <miguel@ximian.com>
+
+ * convert.cs (ImplicitReferenceConversion): We were missing a case
+ (System.Enum are not value types or class types, so we need to
+ classify them separatedly).
+
+ * driver.cs: We do not support error 2007.
+
+2003-11-12 Jackson Harper <jackson@ximian.com>
+
+ * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
+ system directory. Also use the full file name so users can
+ libraries names mscorlib-o-tron.dll in a non system dir.
+
+2003-11-10 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
+ (TypeManager.InitCoreTypes): Initialize them here, but instead of
+ calling `ResolveType()' on them, directly assign their `Type'.
+
+2003-11-08 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
+ return value and the `out parent' parameter.
+ (TypeContainer.DefineType): Moved the CS0644 check into
+ GetClassBases(). Don't pass the interface types to the
+ `builder.DefineType()'/`builder.DefineNestedType()', but resolve
+ them later and then call `TypeBuilder.AddInterfaceImplementation()'.
+
+ * ecore.cs (TypeExpr.IsAttribute): New property.
+ (TypeExpr.GetInterfaces): New method.
+
+ * interface.cs (Interface.GetInterfaceTypeByName): Return a
+ TypeExpr instead of a Type.
+ (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
+ (Interface.DefineType): Don't pass the interface types to the
+ `builder.Definetype()'/`builder.DefineNestedType()', but resolve
+ them later and then call `TypeBulider.AddInterfaceImplementation()'.
+
+ * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
+ instead of a `Type[]'.
+ (TypeManager.RegisterBuilder): Likewise.
+ (TypeManager.AddUserInterface): Likewise.
+ (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
+ `Type[]' and also return a `TypeExpr[]'.
+ (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
+
+2003-11-08 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
+ Expression.
+
+2003-11-08 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
+ TypeManager.ResolveExpressionTypes().
+
+ * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
+ instead of an Expression.
+ (TypeExpr): This is now an abstract base class for `TypeExpression'.
+ (TypeExpression): New public class; formerly known as `TypeExpr'.
+
+ * expression.cs (ComposedCast): Derive from TypeExpr.
+
+ * typemanager.cs (TypeManager.system_*_expr): These are now
+ TypExpr's instead of Expression's.
+ (TypeManager.ResolveExpressionTypes): New public static function;
+ called from DeclSpace.GetTypeResolveEmitContext() to resolve all
+ of them.
+
+2003-11-06 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (New.DoResolve): Do not dereference value that
+ might be a null return.
+
+ * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
+ sure that the constant value has the right type. Fixes an
+ unreported bug, similar to 50425.
+
+ * const.cs (Const.LookupConstantValue): Call
+ ImplicitStandardConversionExists before doing a conversion to
+ avoid havng the TypeManager.ChangeType do conversions.
+
+ Reduced the number of casts used
+
+ (Const.ChangeType): New routine to enable reuse of the constant
+ type changing code from statement.
+
+ * typemanager.cs (ChangeType): Move common initialization to
+ static global variables.
+
+ Fixes #50425.
+
+ * convert.cs (ImplicitReferenceConversion): Somehow we allowed
+ every value type to go through, even if it was void. Fix that.
+
+ * cs-tokenizer.cs: Use is_identifier_start_character on the start
+ character of the define, and the is_identifier_part_character for
+ the rest of the string.
+
+2003-11-05 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (UnaryMutator.EmitCode): When I updated
+ LocalVariableReference.DoResolve, I overdid it, and dropped an
+ optimization done on local variable references.
+
+2003-11-04 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs: Convert the return from Ldlen into an int.
+
+2003-10-20 Miguel de Icaza <miguel@ximian.com>
+
+ * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
+ the accessibility, this is a special case for toplevel non-public
+ classes (internal for instance).
+
+2003-10-20 Nick Drochak <ndrochak@gol.com>
+
+ * ecore.cs: Fix typo and build. Needed another right paren.
+
+2003-10-19 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs: Applied fix from Ben Maurer. We were handling in the
+ `internal' case regular and protected, but not allowing protected
+ to be evaluated later. Bug 49840
+
+2003-10-15 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
+ to kb.Nlast, and not the kb.nFirst to isolate the switch
+ statement.
+
+ Extract the underlying type, so enumerations of long/ulong are
+ treated like long/ulong.
+
+2003-10-14 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (New): Overload the meaning of RequestedType to
+ track the possible creation of the NewDelegate type, since
+ DoResolve is invoked more than once for new constructors on field
+ initialization.
+
+ See bugs: #48800 and #37014
+
+ * cs-parser.jay (declare_local_constants): Take an arraylist
+ instead of a single constant.
+
+ (local_constant_declaration): It should take a
+ constant_declarators, not a constant_declarator. Fixes 49487
+
+ * convert.cs: Fix error report.
+
+2003-10-13 Jackson Harper <jackson@ximian.com>
+
+ * typemanager.cs (TypeToCoreType): Add float and double this fixes
+ bug #49611
+
+2003-10-09 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodCore): Added additional `DeclSpace ds' argument
+ to the .ctor.
+ (MethodCore.DoDefineParameters): Removed the TypeContainer
+ argument; use the DeclSpace which was passed to the .ctor instead.
+ (MethodCore.CheckParameter): Take a DeclSpace instead of a
+ TypeContainer; we only need a DeclSpace here.
+
+2003-10-09 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodData): Added additional `DeclSpace ds' argument
+ to the .ctor.
+ (MethodData.Define, MethodData.Emit): Pass the `ds' to the
+ EmitContext's .ctor.
+
+2003-10-09 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
+ (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
+ AsAccessible(), moved them as well.
+
+ * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
+
+2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
+
+ * cs-parser.jay : Renamed yyName to yyNames related to jay.
+
+2003-10-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
+ generation for >=, as spotted by Paolo, bug 48679.
+ Patch from David Waite.
+
+ * cs-tokenizer.cs: Add handling for #pragma.
+
+ * cs-parser.jay: Allow for both yield and yield return in the
+ syntax. The anti-cobolization of C# fight will go on!
+
+ * class.cs (TypeBuilder.DefineType): Catch error condition here
+ (Parent.DefineType erroring out and returning null).
+
+ * expression.cs (ArrayCreation.EmitDynamicInitializers): When
+ coping with enumerations variables, we were mistakenly processing
+ them as a regular value type instead of built-in types. Fixes the
+ bug #48063
+
+ * typemanager.cs (IsBuiltinOrEnum): New method.
+
+2003-09-30 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Upgrade: yield now needs the return clause.
+
+2003-09-19 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (MemberCache.SetupCacheForInterface): Take a
+ `MemberCache parent' argument. Normally, an interface doesn't
+ have a parent type except System.Object, but we use this in gmcs
+ for generic type parameters.
+
+2003-09-18 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
+ on `type.IsInterface'; don't check whether the type has a parent
+ to determine whether it's an interface.
+
+2003-09-15 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.DefineType): Added an error flag to
+ avoid reporting duplicate CS0146's ("class definition is
+ circular.").
+
+ * driver.cs (Driver.MainDriver): Abort if
+ RootContext.ResolveTree() reported any errors.
+
+2003-09-07 Martin Baulig <martin@ximian.com>
+
+ * report.cs (Error, Warning): Added overloaded versions which take
+ a `params object[] args' and call String.Format().
+
+2003-09-07 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (DeclSpace..ctor): Don't call
+ NamespaceEntry.DefineName() here; do it in RecordDecl() which is
+ called from Tree.RecordDecl(). Fixes the CS0101 reporting.
+ (DeclSpace.RecordDecl): New method.
+
+ * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
+
+2003-09-02 Ravi Pratap <ravi@ximian.com>
+
+ * attribute.cs (CheckAttributeTarget): Ensure that we allow return
+ value attributes to be applied to ParameterBuilders.
+
+ * class.cs (MethodCore.LabelParameters): Make static and more
+ generic so that it can be used from other places - like interface
+ methods, for instance.
+
+ * interface.cs (Interface.Emit): Call LabelParameters before
+ emitting attributes on the InterfaceMethod.
+
+2003-08-26 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
+ resolving aliases; fixes #47927.
+
+2003-08-26 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Using.DoResolve): This is internally emitting a
+ try/finally clause, so we need to set ec.NeedExplicitReturn if we
+ do not always return. Fixes #47681.
+
+2003-08-26 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (MemberCore): Moved WarningNotHiding(),
+ Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
+ into MemberBase.
+ (AdditionResult): Make this nested in DeclSpace.
+ (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
+ argument; call NamespaceEntry.Define() unless we're nested in a
+ class or struct.
+
+ * namespace.cs (Namespace.DefineName): New public function. This
+ is called from DeclSpace's .ctor to add
+ (Namespace.Lookup): Include DeclSpaces in the lookup.
+
+ * class.cs (Operator): Derive from MemberBase, not MemberCore.
+
+ * const.cs (Const): Derive from MemberBase, not MemberCore.
+
+2003-08-25 Martin Baulig <martin@ximian.com>
+
+ * convert.cs (Convert.ExplicitReferenceConversion): When
+ converting from an interface type to a class, unbox if the target
+ type is a struct type. Fixes #47822.
+
+2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
+ #47854.
+
+2003-08-22 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeManager.DefineType): When defining a nested type,
+ call DefineType() on our parent; fixes #47801.
+
+2003-08-22 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodData.Define): While checking if a method is an
+ interface implementation, improve the test a bit more to fix #47654.
+
+2003-08-22 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Probe.DoResolve): Check whether `expr' resolved
+ correctly; fixes #47722.
+
+2003-08-22 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (UnaryMutator.ResolveVariable): If the target is a
+ LocalVariableReference, ensure it's not read-only. Fixes #47536.
+
+ * statement.cs (Fixed.DoResolve): Make all variables read-only.
+
+2003-08-22 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
+ can only be assigned in static constructors. Fixes #47161.
+
+2003-08-22 Martin Baulig <martin@ximian.com>
+
+ Rewrote and improved the flow analysis code.
+
+ * flowbranching.cs (FlowBranching): Make this class abstract.
+ (FlowBranching.CreateBranching): New static function to create a
+ new flow branching.
+ (FlowBranchingBlock, FlowBranchingException): New classes.
+ (FlowBranching.UsageVector.Type): New public readonly field.
+ (FlowBranching.UsageVector.Breaks): Removed the setter.
+ (FlowBranching.UsageVector.Returns): Removed the setter.
+ (FlowBranching.UsageVector): Added Break(), Return(),
+ NeverReachable() and Throw() methods to modify the reachability.
+ (FlowBranching.UsageVector.MergeChildren): Removed, this is now
+ done by FlowBranching.Merge().
+ (FlowBranching.UsageVector.MergeChild): New method; merges the
+ merge result into the current vector.
+ (FlowBranching.Merge): New abstract method to merge a branching.
+
+2003-08-12 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Indirection.CacheTemporaries): Create the
+ LocalTemporary with the pointer type, not its element type.
+
+2003-08-10 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
+ token was a keyword or not.
+
+ Add `error' options where an IDENTIFIER was expected; Provide
+ CheckToken and CheckIdentifierToken convenience error reporting
+ functions.
+
+ Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
+
+ * decl.cs: Rename `NamespaceEntry Namespace' public field into
+ NameSpaceEntry NameSpaceEntry.
+
+ (LookupInterfaceOrClass): Avoid creating a full qualified name
+ from namespace and name: avoid doing lookups when we know the
+ namespace is non-existant. Use new Tree.LookupByNamespace which
+ looks up DeclSpaces based on their namespace, name pair.
+
+ * driver.cs: Provide a new `parser verbose' to display the
+ exception thrown during parsing. This is turned off by default
+ now, so the output of a failure from mcs is more graceful.
+
+ * namespace.cs: Track all the namespaces defined in a hashtable
+ for quick lookup.
+
+ (IsNamespace): New method
+
+2003-08-09 Miguel de Icaza <miguel@ximian.com>
+
+ * namespace.cs: Remove redundant call; Avoid using MakeFQN when
+ we know that we need to concatenate (full typename can never be
+ null).
+
+ * class.cs: ditto.
+
+ * statement.cs: Use a bitfield; Do not initialize to null things
+ which are done by the constructor by default.
+
+ * cs-parser.jay: bug fix, parameter was 4, not 3.
+
+ * expression.cs: Just use the property;
+
+ * statement.cs: No need for GetVariableInfo method.
+
+2003-08-08 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowReturns): This is now nested in the
+ `FlowBranching' class.
+ (MyBitVector): Moved this here from statement.cs.
+ (FlowBranching.SiblingType): New enum type.
+ (FlowBranching.CreateSibling): Added `SiblingType' argument.
+
+2003-08-07 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs (FlowBranchingType): This is now nested in the
+ `FlowBranching' class and called `BranchingType'.
+
+2003-08-07 Martin Baulig <martin@ximian.com>
+
+ * flowanalysis.cs: Moved all the control flow analysis code into
+ its own file.
+
+2003-08-07 Martin Baulig <martin@ximian.com>
+
+ * assign.cs (Assign.DoResolve): `target' must either be an
+ IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
+ #37319.
+
+2003-08-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (BinaryMethod): This kind of expression is created by the
+ Binary class if it determines that the operator has to be handled
+ by a method.
+
+ (BinaryDelegate): This kind of expression is created if we are
+ dealing with a + or - operator on delegates.
+
+ (Binary): remove method, argumetns, and DelegateOperator: when
+ dealing with methods,
+
+ * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
+
+ * statement.cs (Block): use bitfields for the three extra booleans
+ we had in use. Remove unused topblock parameter.
+
+ * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
+
+ * assign.cs: Drop extra unneeded tests.
+
+2003-08-06 Miguel de Icaza <miguel@ximian.com>
+
+ * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
+
+ * statement.cs (Foreach): Use VariableStorage instead of
+ LocalBuilders.
+
+ * codegen.cs (VariableStorage): New class used by clients that
+ require a variable stored: locals or fields for variables that
+ need to live across yield.
+
+ Maybe provide a convenience api for EmitThis+EmitLoad?
+
+ (GetTemporaryLocal, FreeTemporaryLocal): Recycle
+ these bad boys.
+
+2003-08-05 Miguel de Icaza <miguel@ximian.com>
+
+ * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
+ RemapParameterLValue): New methods that are used to turn a
+ precomputed FieldInfo into an expression like this:
+
+ instance.FieldInfo
+
+ The idea is to use this instead of making LocalVariableReference
+ have more than one meaning.
+
+ * cs-parser.jay: Add error production to BASE.
+
+ * ecore.cs: Deal with TypeManager.GetField returning null, which
+ is now a valid return value.
+
+ (FieldExprNoAddress): New expression for Fields whose address can
+ not be taken.
+
+ * expression.cs (LocalVariableReference): During the resolve
+ phases, create new expressions if we are in a remapping context.
+ Remove code that dealt with remapping here.
+
+ (ParameterReference): same.
+
+ (ProxyInstance): New expression, like the `This' expression, but
+ it is born fully resolved. We know what we are doing, so remove
+ the errors that are targeted to user-provided uses of `this'.
+
+ * statement.cs (Foreach): our variable is now stored as an
+ Expression; During resolution, follow the protocol, dont just
+ assume it will return this.
+
+2003-08-06 Martin Baulig <martin@ximian.com>
+
+ * support.cs (SeekableStreamReader.cs): New public class.
+
+ * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
+ SeekableStreamReader instead of the normal StreamReader.
+
+2003-08-04 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
+ CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
+ deambiguate casts and delegate invocations.
+ (parenthesized_expression): Use the new tokens to ensure this is
+ not a cast of method invocation.
+
+ * cs-tokenizer.cs (is_punct): Return one of the new special tokens
+ when reading a `)' and Deambiguate_CloseParens () was previously
+ called.
+
+ * expression.cs (ParenthesizedExpression): New class. This is
+ just used for the CS0075 test.
+ (Binary.DoResolve): Check for CS0075.
+
+2003-07-29 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
+ Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
+ reference comparison.
+
+ (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
+ examine the ReturnType for equality - this is necessary in the
+ cases of implicit and explicit operators whose signature also
+ includes the return type.
+
+2003-07-26 Miguel de Icaza <miguel@ximian.com>
+
+ * namespace.cs: Cache the result of the namespace computation,
+ instead of computing it every time.
+
+2003-07-24 Miguel de Icaza <miguel@ximian.com>
+
+ * decl.cs: Use a global arraylist that we reuse over invocations
+ to avoid excesive memory consumption. Reduces memory usage on an
+ mcs compile by one meg (45 average).
+
+ * typemanager.cs (LookupTypeReflection): In .NET pointers are
+ private, work around that.
+
+2003-07-23 Miguel de Icaza <miguel@ximian.com>
+
+ * literal.cs (IntLiteral): Define Zero and One static literals.
+
+ * cs-parser.jay (integer_literal): use static literals to reduce
+ memory usage for the most used literals (0, 1 and -1). 211kb
+ reduced in memory usage.
+
+ Replace all calls to `new ArrayList' with `new
+ ArrayList(4)' which is a good average number for most allocations,
+ and also requires only 16 bytes of memory for its buffer by
+ default.
+
+ This reduced MCS memory usage in seven megabytes for the RSS after
+ bootstrapping.
+
+2003-07-28 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
+ handle params methods the correct way by forming only one
+ applicable set with params and normal methods in them. Earlier we
+ were looking at params methods only if we found no normal methods
+ which was not the correct thing to do.
+
+ (Invocation.BetterFunction): Take separate arguments indicating
+ when candidate and the best method are params methods in their
+ expanded form.
+
+ This fixes bugs #43367 and #46199.
+
+ * attribute.cs: Documentation updates.
+
+ (CheckAttribute): Rename to CheckAttributeTarget.
+ (GetValidPlaces): Rename to GetValidTargets.
+
+ * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
+ bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
+
+ Fixes bug #44468.
+
+2003-07-28 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.DefineMembers): Use the base type's full
+ name when looking up the base class of a nested class. Fixes #46977.
+
+2003-07-26 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Indexers.Indexer): New nested struct; contains
+ getter, setter and the indexer's type.
+ (Indexers.Properties): This is now an ArrayList of
+ Indexers.Indexer's.
+ (IndexerAccess.DoResolveLValue): Correctly set the type if the
+ indexer doesn't have any getters.
+
+ * assign.cs (Assign.DoResolve): Also do the implicit conversions
+ for embedded property and indexer assignments.
+
+2003-07-26 Martin Baulig <martin@ximian.com>
+
+ * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
+ preprocessor directive is not the first non-whitespace character
+ on a line.
+
+2003-07-26 Martin Baulig <martin@ximian.com>
+
+ * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
+ namespace parsing, follow the spec more closely.
+
+ * rootcontext.cs (RootContext.NamespaceLookup): Use the new
+ NamespaceEntry.Lookup().
+
+2003-07-25 Martin Baulig <martin@ximian.com>
+
+ * MethodCore.cs (OverridesSomething): New public field; it's set
+ from TypeContainer.DefineMembers if this method overrides
+ something (which doesn't need to be a method). Fix #39462.
+
+2003-07-25 Ravi Pratap <ravi@ximian.com>
+
+ * typemanager.cs (GetMembers): Ensure that the list of members is
+ reversed. This keeps things in sync.
+
+ * attribute.cs (Attribute.CheckAttribute): Break as soon as we
+ find an AttributeUsage attribute.
+
+ * expression.cs (Invocation.OverloadResolve): Perform the check
+ which disallows Invoke to be directly called on a Delegate.
+
+ (Error_InvokeOnDelegate): Report error cs1533.
+
+2003-07-25 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Indexers.GetIndexersForType): Only look in the
+ interface hierarchy if the requested type is already an
+ interface. Fixes #46788 while keeping #46502 fixed.
+
+2003-07-25 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.DefineMembers): Check whether all
+ readonly fields have been assigned and report warning CS0649 if
+ not.
+
+ * statement.cs (LocalInfo.IsFixed): Always return true if this is
+ a valuetype.
+
+2003-07-24 Ravi Pratap <ravi@ximian.com>
+
+ * decl.cs (MemberCache.AddMethods): Reverse the order of the array
+ returned from GetMethods to make things consistent with the
+ assumptions MCS makes about ordering of methods.
+
+ This should comprehensively fix bug #45127 and it does :-)
+
+ * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
+ ordering is actually reverse.
+
+ * Clean up some debug messages I left lying around.
+
+ * interface.cs (Populate*): Get rid of code which emits attributes
+ since the stage in which we emit attributes is the 'Emit' stage,
+ not the define stage.
+
+ (Emit): Move attribute emission for interface members here.
+
+2003-07-22 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation.OverloadResolve): Follow the spec more
+ closely: we eliminate methods in base types when we have an
+ applicable method in a top-level type.
+
+ Please see section 14.5.5.1 for an exact description of what goes
+ on.
+
+ This fixes bug #45127 and a host of other related to corlib compilation.
+
+ * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
+ array is the method corresponding to the top-level type (this is
+ because of the changes made to icall.c) so we change this
+ accordingly.
+
+ (MethodGroupExpr.Name): This too.
+
+ * typemanager.cs (GetElementType): New method which does the right
+ thing when compiling corlib.
+
+ * everywhere: Make use of the above in the relevant places.
+
+2003-07-22 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay (invocation_expression): Moved
+ `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
+ `cast_expression', but create a InvocationOrCast which later
+ resolves to either an Invocation or a Cast.
+
+ * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
+ method; call this before EmitStatement() to make sure that this
+ expression can be used as a statement.
+
+ * expression.cs (InvocationOrCast): New class; resolves to either
+ an Invocation or a Cast.
+
+ * statement.cs (StatementExpression): Call ResolveStatement() on
+ the ExpressionStatement before emitting it.
+
+2003-07-21 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
+ `ref' and `out' attributes match; fixes #46220.
+ (MemberAccess.ResolveMemberAccess): You can't reference a type
+ through an expression; fixes #33180.
+ (Indexers.GetIndexersForType): Don't return the indexers from
+ interfaces the class implements; fixes #46502.
+
+2003-07-21 Martin Baulig <martin@ximian.com>
+
+ * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
+ CS0661 checks; fixes bug #30442.
+
+2003-07-21 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (AdditionResult): Added `Error'.
+
+ * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
+
+ * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
+ makes cs0031.cs actually work.
+
+2003-07-20 Martin Baulig <martin@ximian.com>
+
+ * namespace.cs: Fixed that bug which caused a crash when compiling
+ the debugger's GUI.
+
+2003-07-20 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (LookupTypeReflection): Never expose types which
+ are NotPublic, NestedPrivate, NestedAssembly, or
+ NestedFamANDAssem. We used to return these, and later do a check
+ that would report a meaningful error, but the problem is that we
+ would not get the real match, if there was a name override.
+
+2003-07-18 Miguel de Icaza <miguel@ximian.com>
+
+ * namespace.cs (Namespace, Name): Do not compute the namespace
+ name dynamically, compute it in the constructor. This reduced
+ memory usage by 1697 KB.
+
+ * driver.cs: Use --pause to pause at the end.
+
+2003-07-17 Peter Williams <peter@newton.cx>
+
+ * Makefile: Change the name of the test target so that it doesn't
+ conflict with the recursive test target.
+
+2003-07-17 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (LocalVariableReference.Emit, EmitAssign,
+ AddressOf): Do not use EmitThis, that was wrong, use the actual
+ this pointer.
+
+2003-07-15 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (MethodData.Define): While checking if a method is an
+ interface implementation, improve the test: If we are not public
+ (use new test here: use the computed MethodAttributes directly,
+ instead of the parsed modifier flags) check if the `implementing'
+ method comes from an interface or not.
+
+ * pending.cs (VerifyPendingMethods): Slightly better error
+ message.
+
+ * makefile: add test target that does the mcs bootstrap.
+
+2003-07-16 Ravi Pratap <ravi@ximian.com>
+
+ * interface.cs (Define): Do nothing here since there are no
+ members to populate etc. Move the attribute emission out of here
+ since this was just totally the wrong place to put it. Attribute
+ application happens during the 'Emit' phase, not in the 'Define'
+ phase.
+
+ (Emit): Add this method and move the attribute emission here
+
+ * rootcontext.cs (EmitCode): Call the Emit method on interface
+ types too.
+
+2003-07-14 Ravi Pratap M <ravi@ximian.com>
+
+ * expression.cs (OverloadResolve): Report error only if Location
+ is not 'Null' which means that there was a probe going on.
+
+2003-07-14 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (ConditionalLogicalOperator): New public class to
+ implement user defined conditional logical operators.
+ This is section 14.11.2 in the spec and bug #40505.
+
+2003-07-14 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
+
+2003-07-14 Martin Baulig <martin@ximian.com>
+
+ * codegen.cs (EmitContext.InFixedInitializer): New public field.
+
+ * ecore.cs (IVariable.VerifyFixed): New interface method.
+
+ * expression.cs (Unary.ResolveOperator): When resolving the `&'
+ operator, check whether the variable is actually fixed. Fixes bug
+ #36055. Set a variable definitely assigned when taking its
+ address as required by the spec.
+
+ * statement.cs (LocalInfo.IsFixed): New field.
+ (LocalInfo.MakePinned): Set `IsFixed' to true.
+
+2003-07-14 Ravi Pratap M <ravi@ximian.com>
+
+ * attribute.cs (Attribute.Resolve): While doing a Member lookup
+ for .ctors, ensure that we only ask for members declared in the
+ attribute type (BindingFlags.DeclaredOnly).
+
+ Fixes bug #43632.
+
+ * expression.cs (Error_WrongNumArguments): Report error 1501
+ correctly the way CSC does.
+
+2003-07-13 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
+ lookup on the fully qualified name, to make things like "X.X" work
+ where "X.X" is a fully qualified type name, but we also have a
+ namespace "X" in the using list. Fixes #41975.
+
+2003-07-13 Martin Baulig <martin@ximian.com>
+
+ * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
+ function. If we're a CompoundAssign, we need to create an embedded
+ CompoundAssign, not an embedded Assign.
+ (Assign.DoResolve): Make this work for embedded CompoundAssign's.
+ Fixes #45854.
+
+2003-07-13 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
+ work to fix bug #46088.
+
+2003-07-13 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (Operator.Emit): Do not emit attributes here - it is
+ taken care of by the Method class that we delegate too. This takes
+ care of bug #45876.
+
+2003-07-10 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (TypeOfVoid): New class.
+ (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
+
+2003-07-10 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
+ bug #35957.
+
+2003-07-10 Martin Baulig <martin@ximian.com>
+
+ * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
+ not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
+
+ * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
+
+ * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
+
+2003-07-10 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (ArrayCreation): Don't use a byte blob for arrays
+ of decimal. Fixes #42850.
+
+ NOTE: I also fixed the created byte blob, but this doesn't work on
+ the MS runtime and csc never produces any byte blobs for decimal
+ arrays.
+
+2003-07-10 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
+ structs; fixes #32068.
+ (Block.AddChildVariableNames): Fixed #44302.
+
+2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
+
+2003-07-07 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs: And this test is onger needed.
+
+2003-07-08 Martin Baulig <martin@ximian.com>
+
+ * rootcontext.cs (RootContext.NamespaceLookup): Ignore
+ inaccessible types. Fixes #36313.
+
+ * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
+
+ * namespace.cs (NamespaceEntry): Create implicit entries for all
+ namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
+ implicit entries for N1.N2 and N1.
+
+2003-07-08 Martin Baulig <martin@ximian.com>
+
+ Rewrote the handling of namespaces to fix a lot of the issues
+ wrt. `using' aliases etc.
+
+ * namespace.cs (Namespace): Splitted this class into a
+ per-assembly `Namespace' and a per-file `NamespaceEntry'.
+
+ * typemanager.cs (TypeManager.IsNamespace): Removed.
+ (TypeManager.ComputeNamespaces): Only compute namespaces from
+ loaded assemblies here, not the namespaces from the assembly we're
+ currently compiling.
+
+2003-07-08 Martin Baulig <martin@ximian.com>
+
+ * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
+
+2003-07-07 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs: Reverted patch from Gonzalo, my previous patch
+ already fixed it.
+
+ I thought about the memory savings here, but LookupTypeReflection
+ is used under already very constrained scenarios. Compiling
+ corlib or mcs only exposes one hit, so it would not really reduce
+ any memory consumption.
+
+2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * typemanager.cs: fixes bug #45889 by only adding public types from
+ other assemblies to the list of known types.
+
+2003-07-07 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
+ on the type we resolved.
+
+2003-07-05 Martin Baulig <martin@ximian.com>
+
+ * pending.cs (PendingImplementation.ParentImplements): Don't
+ create the proxy if the parent is abstract.
+
+ * class.cs (TypeContainer.DefineIndexers): Process explicit
+ interface implementations first. Fixes #37714.
+
+2003-07-04 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): Events are
+ defined recursively; but since we modify the input parameters
+ (left is set to `this' temporarily), we reset this value if the
+ left_is_explicit is false, which gives the original semantics to
+ the code.
+
+ * literal.cs (NullPointer): new class used to represent a null
+ literal in a pointer context.
+
+ * convert.cs (Convert.ImplicitReferenceConversion): Is the target
+ type is a pointer, use a NullPointer object instead of a
+ NullLiteral. Closes 43687
+
+ (ExplicitConversion): Convert pointer values using
+ the conv opcode to the proper type.
+
+ * ecore.cs (New): change ValueTypeVariable property into a method,
+ that returns whether the valuetype is suitable for being used.
+
+ * expression.cs (Binary.DoNumericPromotions): Only return if we
+ the int constant was a valid uint, and we can return both left and
+ right as uints. If not, we continue processing, to trigger the
+ type conversion. This fixes 39018.
+
+ * statement.cs (Block.EmitMeta): During constant resolution, set
+ the CurrentBlock property on the emitcontext, so that we resolve
+ constants propertly.
+
+2003-07-02 Martin Baulig <martin@ximian.com>
+
+ * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
+ (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
+
+ * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
+ than emitting it here.
+
+ * statement.cs: Fixed some more flow analysis bugs.
+
+2003-07-02 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodData.Define): When implementing interface
+ methods, set Final unless we're Virtual.
+
+ * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
+ check work for interface methods.
+
+2003-07-01 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (EmitContext.This): Replaced this property with a
+ GetThis() method which takes a Location argument. This ensures
+ that we get the correct error location for a CS0188.
+
+2003-07-01 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs: (Convert.ConvertIntLiteral): Add test for
+ ImplicitStandardConversion.
+
+ * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
+
+2003-07-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * expression.cs (ResolveOperator): Fix Concat (string, string, string)
+ optimization.
+
+2003-06-30 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Constructor.Define): Turn off initlocals for unsafe
+ constructors.
+
+ (MethodData.Define): Turn off initlocals for unsafe methods.
+
+2003-06-29 Miguel de Icaza <miguel@ximian.com>
+
+ * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
+ complete; Fixes #37521.
+
+ * delegate.cs: Use Modifiers.TypeAttr to compute the
+ TypeAttributes, instead of rolling our own. This makes the flags
+ correct for the delegates.
+
+2003-06-28 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Constructor.Define): Set the private flag for static
+ constructors as well.
+
+ * cs-parser.jay (statement_expression): Set the return value to
+ null, to avoid a crash when we catch an error.
+
+2003-06-24 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Applied patch from Jackson that adds support for
+ extern and unsafe modifiers to destructor declarations.
+
+ * expression.cs: Report error 21 if the user is trying to index a
+ System.Array.
+
+ * driver.cs: Add an error message, suggested by the bug report.
+
+ * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
+ if we do not have a ": this ()" constructor initializer. Fixes 45149
+
+2003-06-14 Miguel de Icaza <miguel@ximian.com>
+
+ * namespace.cs: Add some information to reduce FAQs.
+
+2003-06-13 Miguel de Icaza <miguel@ximian.com>
+
+ * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
+ underlying enumeration types. Fixes #43915.
+
+ * expression.cs: Treat ushort/short as legal values to be used in
+ bitwise operations.
+
+Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * delegate.cs: transfer custom attributes for paramenters from
+ the delegate declaration to Invoke and BeginInvoke.
+
+Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * attribute.cs: handle custom marshalers and emit marshal info
+ for fields, too.
+
+2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
+
+ * makefile.gnu: Added anonymous.cs to the compiler sources.
+
+2003-05-28 Miguel de Icaza <miguel@ximian.com>
+
+ * iterators.cs: Change the name of the proxy class to include two
+ underscores.
+
+ * cs-parser.jay: Update grammar to include anonymous methods.
+
+ * anonymous.cs: new file.
+
+2003-05-27 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Field.Define): Add missing test for pointers and
+ safety.
+
+2003-05-27 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
+ we use the stobj opcode.
+
+ (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
+ since it wasn't the correct fix.
+
+ It still is puzzling that we are required to use stobj for IntPtr
+ which seems to be a ValueType.
+
+2003-05-26 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
+ during regular simple name resolution. Now, the trick is that
+ instead of returning for processing the simplename, we do a
+ TypeManager.LookupType (ie, a rooted lookup as opposed to a
+ contextual lookup type). If a match is found, return that, if
+ not, return for further composition.
+
+ This fixes long-standing 30485.
+
+ * expression.cs (ArrayCreation.EmitDynamicInitializers): When
+ using the address to initialize an object, do an Stobj instead of
+ using the regular Stelem.
+
+ (IndexerAccess.Emit, IndexerAccess.EmitAssign):
+ Pass `is_base_indexer' to Invocation.EmitCall instead of false.
+ Because if we are a BaseIndexerAccess that value will be true.
+ Fixes 43643.
+
+ * statement.cs (GotoCase.Resolve): Return after reporting an
+ error, do not attempt to continue.
+
+ * expression.cs (PointerArithmetic.Emit): If our operand is a
+ long, convert our constants to match the operand before
+ multiplying. Convert to I type before adding. Fixes 43670.
+
+2003-05-14 Ravi Pratap <ravi@ximian.com>
+
+ * enum.cs (ImplicitConversionExists) : Rename to
+ ImplicitEnumConversionExists to remove ambiguity.
+
+ * ecore.cs (NullCast): New type of cast expression class which
+ basically is very similar to EmptyCast with the difference being
+ it still is a constant since it is used only to cast a null to
+ something else
+ (eg. (string) null)
+
+ * convert.cs (ImplicitReferenceConversion): When casting a null
+ literal, we return a NullCast.
+
+ * literal.cs (NullLiteralTyped): Remove - I don't see why this
+ should be around anymore.
+
+ The renaming (reported was slightly wrong). Corrections:
+
+ ConvertImplicitStandard -> ImplicitConversionStandard
+ ConvertExplicitStandard -> ExplicitConversionStandard
+
+ * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
+ before passing them in !
+
+ * convert.cs (ImplicitConversionStandard): When comparing for
+ equal expr and target types, ensure that expr is not a
+ NullLiteral.
+
+ In general, we must not be checking (expr_type ==
+ target_type) in the top level conversion methods
+ (ImplicitConversion, ExplicitConversion etc). This checking is
+ done in the methods that they delegate to.
+
+2003-05-20 Miguel de Icaza <miguel@ximian.com>
+
+ * convert.cs: Move Error_CannotConvertType,
+ ImplicitReferenceConversion, ImplicitReferenceConversionExists,
+ ImplicitNumericConversion, ImplicitConversionExists,
+ ImplicitUserConversionExists, StandardConversionExists,
+ FindMostEncompassedType, FindMostSpecificSource,
+ FindMostSpecificTarget, ImplicitUserConversion,
+ ExplicitUserConversion, GetConversionOperators,
+ UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
+ TryImplicitIntConversion, Error_CannotConvertImplicit,
+ ConvertImplicitRequired, ConvertNumericExplicit,
+ ExplicitReferenceConversionExists, ConvertReferenceExplicit,
+ ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
+ its own file.
+
+ Perform the following renames:
+
+ StandardConversionExists -> ImplicitStandardConversionExists
+ ConvertImplicit -> ImplicitConversion
+ ConvertImplicitStandard -> ImplicitStandardConversion
+ TryImplicitIntConversion -> ImplicitIntConversion
+ ConvertImplicitRequired -> ImplicitConversionRequired
+ ConvertNumericExplicit -> ExplicitNumericConversion
+ ConvertReferenceExplicit -> ExplicitReferenceConversion
+ ConvertExplicit -> ExplicitConversion
+ ConvertExplicitStandard -> ExplicitStandardConversion
+
+2003-05-19 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (TypeInfo.StructInfo): Made this type protected.
+ (TypeInfo): Added support for structs having structs as fields.
+
+ * ecore.cs (FieldExpr): Implement IVariable.
+ (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
+ VariableInfo for the field.
+
+2003-05-18 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (This.DoResolve): Report a CS0027 if we're
+ emitting a field initializer.
+
+2003-05-18 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (This.ResolveBase): New public function.
+ (This.DoResolve): Check for CS0188.
+
+ * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
+ This.Resolve().
+
+ * ecore.cs (MethodGroupExpr.DoResolve): Set the
+ `instance_expression' to null if we don't have any non-static
+ methods.
+
+2003-05-18 Martin Baulig <martin@ximian.com>
+
+ Reworked the way how local variables and parameters are handled by
+ the flow analysis code.
+
+ * statement.cs (TypeInfo, VariableMap): New public classes.
+ (VariableInfo): New public class. This is now responsible for
+ checking whether a variable has been assigned. It is used for
+ parameters and local variables.
+ (Block.EmitMeta): Take the InternalParameters as argument; compute
+ the layout of the flow vectors here.
+ (Block.LocalMap, Block.ParameterMap): New public properties.
+ (FlowBranching): The .ctor doesn't get the InternalParameters
+ anymore since Block.EmitMeta() now computes the layout of the flow
+ vector.
+ (MyStructInfo): This class is now known as `StructInfo' and nested
+ in `TypeInfo'; we don't access this directly anymore.
+
+ * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
+ property and removed IsAssigned(), IsFieldAssigned(),
+ SetAssigned() and SetFieldAssigned(); we now call them on the
+ VariableInfo so we don't need to duplicate this code everywhere.
+
+ * expression.cs (ParameterReference): Added `Block block' argument
+ to the .ctor.
+ (LocalVariableReference, ParameterReference, This): The new
+ VariableInfo class is now responsible for all the definite
+ assignment stuff.
+
+ * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
+ IsParameterAssigned, SetParameterAssigned): Removed.
+
+2003-05-18 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs (InitCoreTypes): Try calling
+ SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
+ the 3-args-version. Corlib now also needs our `void_type'.
+ (GetMethod): Added overloaded version which takes an optional
+ `bool report_errors' to allow lookups of optional methods.
+
+2003-05-12 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (VariableInfo): Renamed to LocalInfo since it's
+ only used for locals and not for parameters.
+
+2003-05-12 Miguel de Icaza <miguel@ximian.com>
+
+ * support.cs (InternalParameters.ParameterType): Return the
+ ExternalType of the parameter.
+
+ * parameter.cs (Parameter.ExternalType): drop the two arguments,
+ they were unused.
+
+2003-05-11 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (MethodData.Define): Do not set the `newslot' on
+ interface members, if they are also flagged as "override".
+
+ * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
+ better code for ++i and i++. This only works for static fields
+ and local variables.
+
+ * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
+ want to pull the DeclSpace out of the builder_to_declspace instead
+ of the TypeBuilder (like in TypeContainer.FindMembers).
+
+ * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
+ instead of LookupTypeContainer. Fixes the crash on .NET for
+ looking up interface members.
+
+ * const.cs: Create our own emit context during the Definition
+ stage, so that constants are evaluated in the proper context, when
+ a recursive definition happens.
+
+2003-05-11 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Block.CreateSwitchBlock): New method. Creates a
+ new block for a switch section.
+ (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
+ the adding/lookup in the switch block. Fixes #39828.
+
+2003-05-09 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
+ functionality: I needed to convert the data after I had performed
+ the add/sub operation into the operands type size.
+
+ * ecore.cs (ImplicitReferenceConversion): When boxing an interface
+ pass the type for the box operation, otherwise the resulting
+ object would have been of type object.
+
+ (BoxedCast): Add constructor to specify the type to box as.
+
+2003-05-07 Miguel de Icaza <miguel@ximian.com>
+
+ * iterators.cs: I was reusing the `count' variable inadvertently,
+ take steps to not allow this to happen.
+
+2003-05-06 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs (Attribute.Resolve): Params attributes are encoded
+ by creating an array at the point where the params starts and
+ putting all those arguments there, then adjusting the size of the
+ array.
+
+2003-05-05 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (New.AddressOf): Implement interface
+ IMemoryLocation. This is used when the `new' operator is used in
+ the context of an invocation to a method on a value type.
+
+ See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
+ example.
+
+ * namespace.cs: Also check the using aliases here.
+
+ * driver.cs: Move the test for using validity after the types have
+ been entered, so we do a single pass that also includes the using
+ aliases.
+
+ * statement.cs (Try.Resolve): Avoid crashing if there is a failure
+ in the regular case. CreateSiblingForFinally is doing extra
+ error checking.
+
+ * attribute.cs (GetAttributeArgumentExpression): Store the result
+ on an out value, and use the return value to indicate failure
+ instead of using null (which is a valid return for Constant.GetValue).
+
+ * statement.cs: Perform the analysis flow for the increment
+ portion after the statement, because this will be the real flow of
+ execution. Fixes #42385
+
+ * codegen.cs (EmitContext.EmitArgument,
+ EmitContext.EmitStoreArgument): New helper functions when the
+ RemapToProxy flag is set.
+
+ * expression.cs (ParameterReference.EmitLdarg): Expose this useful
+ function.
+
+ Add support for remapping parameters.
+
+ * iterators.cs: Propagate parameter values; Store parameter
+ values in the proxy classes.
+
+2003-05-04 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
+ need a proxy reference; I do not know what I was thinking
+
+ * cs-parser.jay (constructor_initializer): catch another error,
+ and display nice message.
+
+ (field_declaration): catch void field declaration
+ to flag a better error.
+
+ * class.cs (MemberBase.CheckBase): Report an error instead of a
+ warning if a new protected member is declared in a struct.
+ (Field.Define): catch the error of readonly/volatile.
+
+ * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
+
+ (FieldExpr.AddressOf): ditto. Catch error where the address of a
+ volatile variable is taken
+
+2003-05-02 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Fixed.Resolve): Report an error if we are not in
+ an unsafe context.
+
+2003-05-01 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs: reuse the code that handles type clashes for
+ delegates and enumerations.
+
+ * class.cs (Report28): Always report.
+
+ * expression.cs (EncodeAsAttribute): Allow nulls here.
+
+2003-04-28 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
+ the functionality for testing whether an expression is valid for
+ an attribute here. Also handle the case of arrays of elements
+ being stored.
+
+ * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
+ encoding a linear array into an array of objects that are suitable
+ to be passed to an CustomAttributeBuilder.
+
+ * delegate.cs: Check unsafe types being used outside of an Unsafe context.
+
+ * ecore.cs: (FieldExpr): Handle field remapping here.
+
+ * iteratators.cs: Pass the instance variable (if the method is an
+ instance method) to the constructors, so we can access the field
+ variables on the class.
+
+ TODO: Test this with structs. I think the THIS variable on
+ structs might have to be a pointer, and not a refenrece
+
+2003-04-27 Miguel de Icaza <miguel@ximian.com>
+
+ * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
+ local variables to fields in a proxy class.
+
+ * iterators.cs (PopulateProxy): Rename our internal fields to
+ <XXX>.
+ Create a <THIS> field if we are an instance method, so we can
+ reference our parent container variables.
+ (MapVariable): Called back from the EmitContext code to enter a
+ new variable to field mapping into the proxy class (we just create
+ a FieldBuilder).
+
+ * expression.cs
+ (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
+ for using the remapped locals to fields.
+
+ I placed the code here, because that gives the same semantics to
+ local variables, and only changes the Emit code.
+
+ * statement.cs (Fixed.Resolve): it is not allowed to have fixed
+ statements inside iterators.
+ (VariableInfo): Add a FieldBuilder for the cases when we are
+ remapping local variables to fields in a proxy class
+
+ * ecore.cs (SimpleNameResolve): Avoid testing two times for
+ current_block != null.
+
+ * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
+ not cope with strings, as it has been moved to the
+ TableSwitchEmit. Fixed bug in switch generation.
+
+ * expression.cs (New.DoResolve): Provide more context for the user
+ when reporting an error.
+
+ * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
+ pointers.
+
+ * expression.cs (MemberAccess.DoResolve): When we get a type back,
+ check the permissions for it. Note than in a type-resolution
+ context the check was already present in DeclSpace.ResolveType,
+ but was missing from the MemberAccess.
+
+ (ArrayCreation.CheckIndices): warn if the user has
+ more nested levels of expressions, but there are no more
+ dimensions specified. Avoids crash on bug 41906.
+
+2003-04-26 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Block): replace Implicit bool, for a generic
+ flags.
+ New flag: `Unchecked'. This is used during the EmitMeta phase
+ (which is out-of-line with the regular Resolve/Emit process for a
+ statement, as this is done ahead of time, but still gets a chance
+ to call constant resolve).
+
+ (Block.Flags): new enum for adding a new flag.
+
+ (Block.EmitMeta): track the state of unchecked.
+
+ (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
+ to enable constant resolution to work there as well.
+
+2003-04-22 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (ienumerable_type): Also look up
+ System.Collections.IEnumerable.
+
+2003-04-21 Miguel de Icaza <miguel@ximian.com>
+
+ TODO: Test more than one conditional per method.
+
+ * class.cs (Indexer.Define): Report the location where the user is
+ referencing the unsupported feature.
+
+ (MethodData): Overload the use of `conditionals' to
+ minimize the creation of needless ArrayLists. This saves roughly
+ 212kb on my machine.
+
+ (Method): Implement the new IIteratorContainer interface.
+ (Method.SetYields): Implement the method by setting the ModFlags
+ to contain METHOD_YIELDS.
+
+ * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
+ which just got set to null.
+
+ * iterators.cs: New file.
+
+ (Yield, YieldBreak): New statements.
+
+ * statement.cs (Return.Resolve): Flag an error if we are used in
+ an iterator method.
+
+ * codegen.cs (InIterator): New flag set if the code is being
+ compiled in an iterator method.
+
+ * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
+ internal modifier, and we just use it to avoid adding extra
+ fields, as this is seldom used.
+
+ * cs-parser.jay: Add yield_statement (yield and yield break).
+
+ * driver.cs: New flag -v2 to turn on version 2 features.
+
+ * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
+ hashtable when v2 is enabled.
+
+2003-04-20 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (TypeManager.NamespaceClash): Use to check if
+ there is already a namespace defined with this name.
+
+ (TypeManager.InitCoreTypes): Remove the temporary workaround, as
+ people upgraded their corlibs.
+
+ (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
+ always use fully qualified types, no need to use the compiler
+ front end.
+
+ (TypeManager.IsNamespace): Use binarysearch.
+
+ * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
+ AddDelegate): I did not quite use the new IsValid API properly: I
+ have to pass the short-name and the fullname. I was passing only
+ the basename instead of the fullname sometimes.
+
+ (TypeContainer.DefineType): call NamespaceClash.
+
+ * interface.cs (Interface.DefineType): use NamespaceClash before
+ defining the type.
+
+ * delegate.cs (Delegate.DefineType): use NamespaceClash before
+ defining the type.
+
+ * enum.cs: (Enum.DefineType): use NamespaceClash before
+ defining the type.
+
+ * typemanager.cs (: 3-line patch that gives us some tasty 11%
+ speed increase. First, use the negative_hits cache when we get a
+ negative. Second, add the type with its full original name
+ instead of the new . and + encoded name (reflection uses + to
+ separate type from a nested type). Use LookupTypeReflection
+ directly which bypasses the type->name hashtable (that we already
+ know does not contain the type.
+
+ * decl.cs (DeclSpace.ResolveTypeExpr): track the
+ location/container type.
+
+ * driver.cs: When passing utf8, use directly the UTF8Encoding.
+
+2003-04-19 Miguel de Icaza <miguel@ximian.com>
+
+ * decl.cs (ResolveTypeExpr): Mirror check acess here too.
+
+ * delegate.cs (NewDelegate.Resolve): Test whether an instance
+ method is being referenced in the method group from a static
+ context, and report error 120 if so.
+
+ * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
+ Error118.
+
+ * typemanager.cs: Add intermediate namespaces (if a namespace A.B
+ is created, we create the A namespace).
+
+ * cs-parser.jay: A namespace also introduces a DeclarationFound.
+ Fixes #41591
+
+2003-04-18 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
+ invocation to ModuleBuilder.GetType with the same values will
+ return a new type instance, so we need to cache its return
+ values.
+
+ * expression.cs (Binary.ResolveOperator): Only allow the compare
+ operators on enums if they are of the same type.
+
+ * ecore.cs (Expression.ImplicitReferenceConversion): handle target
+ types of ValueType on their own case. Before we were giving them
+ the same treatment as objects.
+
+ * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
+ fullname. Short name is used to compare against container name.
+ Fullname is used to check against defined namespace names.
+
+ * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
+ AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
+
+ (Method.CheckBase): Call parent.
+ (MemberBase.CheckBase): Check for protected members on sealed
+ classes.
+ (PropertyBase.CheckBase): Call parent.
+ (Field.Define): Call parent.
+
+ * report.cs: Negative error codes are now mapped to 8000 - code,
+ so that the display is render more nicely.
+
+ * typemanager.cs: Do not use try/catch, instead report a regular
+ error.
+
+ (GetPointerType, GetReferenceType): These methods provide
+ mechanisms to obtain the T* and T& from a T. We had the code
+ previously scattered around the code base, and it also used
+ TypeManager.LookupType that would go through plenty of caches.
+ This one goes directly to the type source.
+
+ In some places we did the Type.GetType followed by
+ ModuleBuilder.GetType, but not in others, so this unifies the
+ processing as well.
+
+ * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
+ statements now that we have namespace information.
+
+ * typemanager.cs (IsNamespace): New method, returns whether the
+ string presented is a namespace or not.
+
+ (ComputeNamespaces): New public entry point, computes the list of
+ available namespaces, using the GetNamespaces API call in Mono, or
+ the slower version in MS.NET.
+
+ Now before we start the semantic analysis phase, we have a
+ complete list of namespaces including everything that the user has
+ provided.
+
+ Deleted old code to cache namespaces in .nsc files.
+
+2003-04-17 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
+ class/struct location definition Location for the implicit
+ constructor location.
+
+ (Operator.Define): Use the location of the operator for the
+ implicit Method definition.
+
+ (Constructor.Emit): use the constructor location for the implicit
+ base initializer constructor.
+
+ * ecore.cs: Remove ITypeExpression. This interface is now gone,
+ and the Expression class now contains two new methods:
+
+ ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
+ isolate type lookup from the rest of the resolution process.
+
+ Since we use Expressions to hold type definitions due to the way
+ we parse the input we have historically overloaded Resolve to
+ perform the Type lookups if a special flag is passed. Now this is
+ eliminated and two methods take their place.
+
+ The differences in the two methods between xStep and xTerminal is
+ that xStep is involved in our current lookup system that uses
+ SimpleNames to compose a name, while xTerminal is used just to
+ catch the case where the simplename lookup failed.
+
+2003-04-16 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (ResolveMemberAccess): Remove redundant code.
+ TypeExpr expressions are always born fully resolved.
+
+ * interface.cs (PopulateMethod): Do not lookup the types twice.
+ We were doing it once during SemanticAnalysis and once during
+ PopulateMethod.
+
+ * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
+ in local variable type definitions, were being returned as a
+ SimpleName (we decomposed everything into a string), that is
+ because primary_expression was being used instead of a type in the
+ grammar (reduce/reduce conflicts).
+
+ The part that was wrong is that we converted the expression into a
+ string (an oversimplification in one hand, compounded with primary
+ expressions doing string concatenation).
+
+ So things like:
+
+ A.B.C [] x;
+
+ Would return "A.B.C[]" as a SimpleName. This stopped things like
+ using clauses from working on this particular context. And a type
+ was being matched directly against "A.B.C[]".
+
+ We now use the correct approach, and allow for ComposedCast to be
+ part of the unary expression. So the "A.B.C []" become a composed
+ cast of "A.B.C" (as a nested group of MemberAccess with a
+ SimpleName at the end) plus the rank composition "[]".
+
+ Also fixes 35567
+
+2003-04-10 Miguel de Icaza <miguel@ximian.com>
+
+ * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
+ for the access level checking.
+
+ * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
+ `TypeContainer container', because I kept getting confused when I
+ was debugging this code.
+
+ * expression.cs (Indexers): Instead of tracking getters/setters,
+ we now track them in parallel. We create one arraylist less, but
+ most importantly it is possible now for the LValue code to find a
+ matching get for a set.
+
+ (IndexerAccess.DoResolveLValue): Update the code.
+ GetIndexersForType has been modified already to extract all the
+ indexers from a type. The code assumed it did not.
+
+ Also make the code set the correct return type for the indexer.
+ This was fixed a long time ago for properties, but was missing for
+ indexers. It used to be void_type.
+
+ (Binary.Emit): Test first for doubles instead of
+ floats, as they are more common.
+
+ (Binary.EmitBranchable): Use the .un version of the branch opcodes
+ when dealing with floats and the <=, >= operators. This fixes bug
+ #39314
+
+ * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
+ to load the array value by emitting a load on the foreach variable
+ type. This was incorrect.
+
+ We now emit the code to load an element using the the array
+ variable type, and then we emit the conversion operator.
+
+ Fixed #40176
+
+2003-04-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * attribute.cs: Avoid allocation of ArrayLists in the common case.
+
+2003-04-09 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (MethodSignature.InheritableMemberSignatureCompare):
+ test for protection before we test for signatures.
+
+ (MethodSignature.ToString): implement.
+
+ * expression.cs (Unary.TryReduceNegative): Add missing minus sign
+ to the case where we reduced into a LongConstant.
+
+ * decl.cs (CheckAccessLevel): If the type is an array, we can not
+ depend on whether the information is acurrate, because the
+ Microsoft runtime will always claim that the array type is public,
+ regardless of the real state.
+
+ If the type is a pointer, another problem happens: the type is
+ reported as non-public in Microsoft.
+
+ In both cases we have to call CheckAccessLevel recursively with
+ the underlying type as the argument to be tested.
+
+2003-04-08 Miguel de Icaza <miguel@ximian.com>
+
+ * assign.cs (Assign.Emit): If we are dealing with a compound
+ assignment expression, we should use the code path that stores the
+ intermediate result in a temporary value. This fixes #40903.
+
+ *expression.cs (Indirection.ToString): Provide ToString method for
+ debugging.
+
+2003-04-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.cs: Null out fields holding references to Block objects so
+ they can be garbage collected.
+
+ * expression.cs (OverloadResolve): Remove unused local.
+
+2003-04-07 Martin Baulig <martin@ximian.com>
+
+ * codegen.cs (EmitContext.CurrentFile): New public field.
+ (EmitContext.Mark): Use the CurrentFile to check whether the
+ location is in the correct file.
+ (EmitContext.EmitTopBlock): Initialize CurrentFile here.
+
+2003-04-07 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
+
+ * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
+ location. [FIXME: The location argument which gets passed to this
+ method is sometimes wrong!]
+
+2003-04-07 Nick Drochak <ndrochak@gol.com>
+
+ * codegen.cs: Be more verbose when we can't find the symbol writer dll.
+
+2003-04-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Indirection.EmitAssign): We were using the
+ temporary, but returning immediately instead of continuing the
+ EmitAssing flow.
+
+2003-04-06 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
+ if it's a nested child, but also deriving from the outer class.
+ See test 190.cs.
+
+ * typemanager.cs (IsNestedChildOf): Make this work if it's a
+ nested child, but also deriving from the outer class. See
+ test-190.cs.
+ (FilterWithClosure): We may access private members of the outer
+ class if we're a nested child and deriving from the outer class.
+ (RealMemberLookup): Only set `closure_private_ok' if the
+ `original_bf' contained BindingFlags.NonPublic.
+
+2003-04-05 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
+
+2003-04-02 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Event.Define): Do not allow abstract events to have
+ initializers.
+
+2003-04-01 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Add error productions for ADD/REMOVE missing a
+ block in event declarations.
+
+ * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
+ value type, get its address.
+
+ * expression.cs (Is.Emit): For action `LeaveOnStack' we were
+ leaving a class on the stack instead of a boolean value (int
+ 0/1). Change the code so we compare against null, and then the
+ result against zero.
+
+ * class.cs (TypeContainer.GetClassBases): We were checking for the
+ parent class being sealed too late.
+
+ * expression.cs (Binary.Emit): For <= and >= when dealing with
+ floating point values, use cgt.un and clt.un instead of cgt and
+ clt alone.
+
+2003-04-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * statement.cs: Apply the same optimization as MS: skip the
+ GetEnumerator returning an IEnumerator, and use the one returning a
+ CharEnumerator instead. This allows us to avoid the try-finally block
+ and the boxing.
+
+2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
+
+ * cs-parser.jay: Attributes cannot be applied to
+ namespaces. Fixes #40473
+
+2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * class.cs:
+ (Add*): check if the name is valid using the full name for constants,
+ fields, properties and events.
+
+2003-03-28 Miguel de Icaza <miguel@ximian.com>
+
+ * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
+ char constants to be part of the enumeration.
+
+ * expression.cs (Conditional.DoResolve): Add support for operator
+ true. Implements the missing functionality from 14.12
+
+ * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
+ operator true/false as required by the spec.
+
+ * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
+ implicit conversion to boolean.
+
+ * statement.cs (Statement.ResolveBoolean): A boolean expression is
+ also one where the type implements `operator true'.
+
+ * ecore.cs (Expression.GetOperatorTrue): New helper routine to
+ get an expression that will invoke operator true based on an
+ expression.
+
+ (GetConversionOperators): Removed the hack that called op_True
+ here.
+
+ (Expression.ResolveBoolean): Move this from Statement.
+
+2003-03-17 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (FieldExpr): do not allow initialization of initonly
+ fields on derived classes
+
+2003-03-13 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Block.Emit): Call ig.BeginScope() and
+ ig.EndScope() when compiling with debugging info; call
+ LocalBuilder.SetLocalSymInfo _after_ opening the scope.
+
+2003-03-08 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Indexers): Do not construct immediately, allow
+ for new members to be appended as we go. Fixes 38143
+
+2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * expression.cs: save/restore context when resolving an unchecked
+ expression.
+
+2003-03-05 Miguel de Icaza <miguel@ximian.com>
+
+ * cfold.cs: Catch division by zero in modulus operator during
+ constant folding.
+
+2003-03-03 Miguel de Icaza <miguel@ximian.com>
+
+ * interface.cs (Interface.DefineMembers): Avoid defining members
+ twice.
+
+2003-02-27 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: handle the +/- options for -noconfig
+
+ * statement.cs (Unckeched.Resolve): Also track the state of
+ unchecked in the Resolve phase.
+
+2003-02-27 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (Expression.MemberLookup): Don't create a
+ MethodGroupExpr for something which is not a method. Fixes #38291.
+
+2003-02-25 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (MemberBase.CheckParameters): Also check that the type
+ is unmanaged if it is a pointer.
+
+ * expression.cs (SizeOf.Resolve): Add location information.
+
+ * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
+ a managed type is declared.
+
+ * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
+ parameter modifiers as well. Fixes bug 38606
+
+ * class.cs: Very sad. Am backing out the speed up changes
+ introduced by the ArrayList -> Array in the TypeContainer, as they
+ were not actually that much faster, and introduced a bug (no error
+ reports on duplicated methods).
+
+ * assign.cs (CompoundAssign.DoLResolve): Resolve the original
+ source first, this will guarantee that we have a valid expression
+ before calling in lower levels functions that will require a
+ resolved object. Then use this original_source in the
+ target.ResolveLValue instead of the original source that was
+ passed to us.
+
+ Another change. Use target.Resolve instead of LValueResolve.
+ Although we are resolving for LValues, we will let the Assign code
+ take care of that (it will be called again from Resolve). This
+ basically allows code like this:
+
+ class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
+ class Y { void A (X x) { x [0] += o; }
+
+ The problem was that the indexer was trying to resolve for
+ set_Item (idx, object o) and never finding one. The real set_Item
+ was set_Item (idx, X). By delaying the process we get the right
+ semantics.
+
+ Fixes bug 36505
+
+2003-02-23 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
+ while calling DoEmit ().
+
+ * codegen.cs (EmitContext.Mark): Don't mark locations in other
+ source files; if you use the #line directive inside a method, the
+ compiler stops emitting line numbers for the debugger until it
+ reaches the end of the method or another #line directive which
+ restores the original file.
+
+2003-02-23 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
+
+2003-02-23 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (Block.AddChildVariableNames): We need to call this
+ recursively, not just for our immediate children.
+
+2003-02-23 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Event.Define): Always make the field private, like csc does.
+
+ * typemanager.cs (TypeManager.RealMemberLookup): Make events
+ actually work, fixes bug #37521.
+
+2003-02-23 Miguel de Icaza <miguel@ximian.com>
+
+ * delegate.cs: When creating the various temporary "Parameters"
+ classes, make sure that we call the ComputeAndDefineParameterTypes
+ on those new parameters (just like we do with the formal ones), to
+ allow them to be resolved in the context of the DeclSpace.
+
+ This fixes the bug that Dick observed in Bugzilla #38530.
+
+2003-02-22 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (ResolveMemberAccess): When resolving a constant,
+ do not attempt to pull a constant if the value was not able to
+ generate a valid constant.
+
+ * const.cs (LookupConstantValue): Do not report more errors than required.
+
+2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * expression.cs: fixes bug #38328.
+
+2003-02-18 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs: Changed all the various members that can be part of a
+ class from being an ArrayList to be an Array of the right type.
+ During the DefineType type_list, interface_list, delegate_list and
+ enum_list are turned into types, interfaces, delegates and enums
+ arrays.
+
+ And during the member population, indexer_list, event_list,
+ constant_list, field_list, instance_constructor_list, method_list,
+ operator_list and property_list are turned into their real arrays.
+
+ Although we could probably perform this operation earlier, for
+ good error reporting we need to keep the lists and remove the
+ lists for longer than required.
+
+ This optimization was triggered by Paolo profiling the compiler
+ speed on the output of `gen-sample-program.pl' perl script.
+
+ * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
+ not crash in methods like MemberLookupFailed that use this field.
+
+ This problem arises when the compiler fails to resolve a type
+ during interface type definition for example.
+
+2003-02-18 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Indexers.GetIndexersForType): Interfaces do not
+ inherit from System.Object, so we have to stop at null, not only
+ when reaching System.Object.
+
+2003-02-17 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
+ DeclaredOnly because the parent indexer might have had a different
+ name, but did not loop until the top of the hierarchy was reached.
+
+ The problem this one fixes is 35492: when a class implemented an
+ indexer from an interface, we were getting the interface method
+ (which was abstract) and we were flagging an error (can not invoke
+ abstract method).
+
+ This also keeps bug 33089 functioning, and test-148 functioning.
+
+ * typemanager.cs (IsSpecialMethod): The correct way of figuring
+ out if a method is special is to see if it is declared in a
+ property or event, or whether it is one of the predefined operator
+ names. This should fix correctly #36804.
+
+2003-02-15 Miguel de Icaza <miguel@ximian.com>
+
+ The goal here is to remove the dependency on EmptyCast.Peel ().
+ Killing it completely.
+
+ The problem is that currently in a number of places where
+ constants are expected, we have to "probe" for an EmptyCast, and
+ Peel, which is not the correct thing to do, as this will be
+ repetitive and will likely lead to errors.
+
+ The idea is to remove any EmptyCasts that are used in casts that
+ can be reduced to constants, so we only have to cope with
+ constants.
+
+ This bug hunt was triggered by Bug 37363 and the desire to remove
+ the duplicate pattern where we were "peeling" emptycasts to check
+ whether they were constants. Now constants will always be
+ constants.
+
+ * ecore.cs: Use an enumconstant here instead of wrapping with
+ EmptyCast.
+
+ * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
+ throwing me off. By handling this we can get rid of a few hacks.
+
+ * statement.cs (Switch): Removed Peel() code.
+
+2003-02-14 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs: Location information for error 508
+
+ * expression.cs (New.DoResolve): Add a guard against double
+ resolution of an expression.
+
+ The New DoResolve might be called twice when initializing field
+ expressions (see EmitFieldInitializers, the call to
+ GetInitializerExpression will perform a resolve on the expression,
+ and later the assign will trigger another resolution
+
+ This leads to bugs (#37014)
+
+ * delegate.cs: The signature for EndInvoke should contain any ref
+ or out parameters as well. We were not doing this in the past.
+
+ * class.cs (Field.Define): Do not overwrite the type definition
+ inside the `volatile' group. Turns out that volatile enumerations
+ were changing the type here to perform a validity test, which
+ broke conversions.
+
+2003-02-12 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (FieldExpr.AddressOf): In the particular case of This
+ and structs, we do not want to load the instance variable
+
+ (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
+ enum_type has to be handled like an object reference (implicit
+ conversions exists from this to object), but the regular IsClass
+ and IsValueType tests will never return true for this one.
+
+ Also we use TypeManager.IsValueType instead of type.IsValueType,
+ just for consistency with the rest of the code (this is only
+ needed if we ever use the construct exposed by test-180.cs inside
+ corlib, which we dont today).
+
+2003-02-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
+ just InternalCall.
+
+2003-02-09 Martin Baulig <martin@ximian.com>
+
+ * namespace.cs (Namespace..ctor): Added SourceFile argument.
+ (Namespace.DefineNamespaces): New static public method; this is
+ called when we're compiling with debugging to add all namespaces
+ to the symbol file.
+
+ * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
+ pass it to the Namespace's .ctor.
+
+ * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
+ and MethodBase arguments; pass the namespace ID to the symwriter;
+ pass the MethodBase instead of the token to the symwriter.
+ (SymbolWriter.DefineNamespace): New method to add a namespace to
+ the symbol file.
+
+2003-02-09 Martin Baulig <martin@ximian.com>
+
+ * symbolwriter.cs: New file. This is a wrapper around
+ ISymbolWriter with a cleaner API. We'll dynamically Invoke()
+ methods here in near future.
+
+2003-02-09 Martin Baulig <martin@ximian.com>
+
+ * codegen.cs (EmitContext.Mark): Just pass the arguments to
+ ILGenerator.MarkSequencePoint() which are actually used by the
+ symbol writer.
+
+2003-02-09 Martin Baulig <martin@ximian.com>
+
+ * location.cs (SourceFile): New public sealed class. This
+ contains the name and an index which is used in the location's token.
+ (Location): Reserve an appropriate number of bits in the token for
+ the source file instead of walking over that list, this gives us a
+ really huge performance improvement when compiling with debugging.
+
+ * driver.cs (Driver.parse, Driver.tokenize_file): Take a
+ `SourceFile' argument instead of a string.
+ (Driver.ProcessFile): Add all the files via Location.AddFile(),
+ but don't parse/tokenize here, we need to generate the list of all
+ source files before we do that.
+ (Driver.ProcessFiles): New static function. Parses/tokenizes all
+ the files.
+
+ * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
+ instead of a string.
+
+ * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
+ of a string.
+
+2003-02-09 Martin Baulig <martin@ximian.com>
+
+ * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
+ filename on `#line default'.
+
+Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * statement.cs: don't clear the pinned var when the fixed statement
+ returns from the method (fixes bug#37752).
+
+Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
+ to IsValueType.
+
+2003-02-07 Martin Baulig <martin@ximian.com>
+
+ * driver.cs: Removed the `--debug-args' command line argument.
+
+ * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
+ automatically by the AsssemblyBuilder.
+ (CodeGen.InitializeSymbolWriter): We don't need to call any
+ initialization function on the symbol writer anymore. This method
+ doesn't take any arguments.
+
+2003-02-03 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
+ from referenced assemblies as well.
+
+2003-02-02 Martin Baulig <martin@ximian.com>
+
+ * class.cs (MethodData.Emit): Generate debugging info for external methods.
+
+2003-02-02 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Constructor.Emit): Open the symbol writer before
+ emitting the constructor initializer.
+ (ConstructorInitializer.Emit): Call ec.Mark() to allow
+ single-stepping through constructor initializers.
+
+2003-01-30 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs: Handle error 549: do not allow virtual methods in
+ sealed classes.
+
+2003-02-01 Jackson Harper <jackson@latitudegeo.com>
+
+ * decl.cs: Check access levels when resolving types
+
+2003-01-31 Jackson Harper <jackson@latitudegeo.com>
+
+ * statement.cs: Add parameters and locals set in catch blocks that might
+ return to set vector
+
+2003-01-29 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Operator): Set the SpecialName flags for operators.
+
+ * expression.cs (Invocation.DoResolve): Only block calls to
+ accessors and operators on SpecialName methods.
+
+ (Cast.TryReduce): Handle conversions from char constants.
+
+
+Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * statement.cs: small memory and time optimization in FlowBranching.
+
+2003-01-28 Pedro Mart <yoros@wanadoo.es>
+
+ * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
+ problem that the last fix but in the other sid (Set).
+
+ * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
+ access when there is no indexer in the hierarchy.
+
+2003-01-27 Jackson Harper <jackson@latitudegeo.com>
+
+ * class.cs: Combine some if statements.
+
+2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * driver.cs: fixed bug #37187.
+
+2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
+
+ * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
+ any indexer, it's needed to build a list with all the indexers in the
+ hierarchy (AllGetters), else we have problems. Fixes #35653.
+
+2003-01-23 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (MethodData.Define): It is wrong for an interface
+ implementation to be static in both cases: explicit and implicit.
+ We were only handling this in one case.
+
+ Improve the if situation there to not have negations.
+
+ * class.cs (Field.Define): Turns out that we do not need to check
+ the unsafe bit on field definition, only on usage. Remove the test.
+
+2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * driver.cs: use assembly.Location instead of Codebase (the latest
+ patch made mcs fail when using MS assemblies).
+
+2003-01-21 Tim Haynes <thaynes@openlinksw.com>
+
+ * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
+ get the path to *corlib.dll.
+
+2003-01-21 Nick Drochak <ndrochak@gol.com>
+
+ * cs-tokenizer.cs:
+ * pending.cs:
+ * typemanager.cs: Remove compiler warnings
+
+2003-01-20 Duncan Mak <duncan@ximian.com>
+
+ * AssemblyInfo.cs: Bump the version number to 0.19.
+
+2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * cs-tokenizer.cs: little fixes to line numbering when #line is used.
+
+2003-01-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.cs (Constructor::Emit): Emit debugging info for constructors.
+
+2003-01-17 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Small fix: we were not comparing the constructor
+ name correctly. Thanks to Zoltan for the initial pointer.
+
+2003-01-16 Jackson Harper <jackson@latitudegeo.com>
+
+ * cs-tokenizer.cs: Set file name when specified with #line
+
+2003-01-15 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Only perform the constructor checks here if we
+ are named like the class; This will help provider a better
+ error. The constructor path is taken when a type definition is
+ not found, but most likely the user forgot to add the type, so
+ report that rather than the constructor error.
+
+Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
+ allocations.
+
+2003-01-13 Jackson Harper <jackson@latitudegeo.com>
+
+ * cs-parser.jay: Add cleanup call.
+
+2003-01-13 Duncan Mak <duncan@ximian.com>
+
+ * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
+ consistent with other methods.
+
+2003-01-13 Jackson Harper <jackson@latitudegeo.com>
+
+ * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
+
+Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * attribute.cs: only set GuidAttr to true when we have a
+ GuidAttribute.
+
+2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * ecore.cs:
+ * expression.cs:
+ * typemanager.cs: fixes to allow mcs compile corlib with the new
+ Type.IsSubclassOf fix.
+
+2003-01-08 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (LocalVariableReference.DoResolve): Classify a
+ constant as a value, not as a variable. Also, set the type for
+ the variable.
+
+ * cs-parser.jay (fixed_statement): take a type instead of a
+ pointer_type, so we can produce a better error message later.
+
+ * statement.cs (Fixed.Resolve): Flag types that are not pointers
+ as an error.
+
+ (For.DoEmit): Make inifinite loops have a
+ non-conditional branch back.
+
+ (Fixed.DoEmit): First populate the pinned variables, then emit the
+ statement, then clear the variables. Before I was emitting the
+ code once for each fixed piece.
+
+
+2003-01-08 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (FlowBranching.MergeChild): A break in a
+ SWITCH_SECTION does not leave a loop. Fixes #36155.
+
+2003-01-08 Martin Baulig <martin@ximian.com>
+
+ * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
+ lives in the same number space than `param_map'. Fixes #36154.
+
+2003-01-07 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay (constructor_declaration): Set the
+ Constructor.ModFlags before probing for it. This makes the
+ compiler report 514, 515 and 132 (the code was there, but got
+ broken).
+
+ * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
+ (GotoDefault.Resolve): Set `Returns' to ALWAYS.
+ (GotoCase.Resolve): Set `Returns' to ALWAYS.
+
+Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * enum.cs: create the enum static fields using the enum type.
+
+Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.cs: don't try to create the ParamBuilder for the return
+ type if it's not needed (and handle it breaking for the ms runtime
+ anyway).
+
+2003-01-06 Jackson Harper <jackson@latitudegeo.com>
+
+ * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
+
+2002-12-29 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
+ the command. This showed up while compiling the JANET source
+ code, which used \r as its only newline separator.
+
+2002-12-28 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Method.Define): If we are an operator (because it
+ reuses our code), then set the SpecialName and HideBySig. #36128
+
+2002-12-22 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
+ exception, report error 120 `object reference required'.
+
+ * driver.cs: Add --pause option, used during to measure the size
+ of the process as it goes with --timestamp.
+
+ * expression.cs (Invocation.DoResolve): Do not allow methods with
+ SpecialName to be invoked.
+
+2002-12-21 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs: Small fix to the parser: compute the ascii
+ number before adding it.
+
+2002-12-21 Ravi Pratap <ravi@ximian.com>
+
+ * ecore.cs (StandardImplicitConversion): When in an unsafe
+ context, we allow conversion between void * to any other pointer
+ type. This fixes bug #35973.
+
+2002-12-20 Jackson Harper <jackson@latitudegeo.com>
+
+ * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
+ is not thrown when extensionless outputs are used
+
+2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * rootcontext.cs: fixed compilation of corlib.
+
+2002-12-19 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs (Attributes.Contains): Add new method.
+
+ * class.cs (MethodCore.LabelParameters): if the parameter is an
+ `out' parameter, check that no attribute `[In]' has been passed.
+
+ * enum.cs: Handle the `value__' name in an enumeration.
+
+2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
+
+ * decl.cs: Added special case to allow overrides on "protected
+ internal" methods
+
+2002-12-18 Ravi Pratap <ravi@ximian.com>
+
+ * attribute.cs (Attributes.AddAttributeSection): Rename to this
+ since it makes much more sense.
+
+ (Attributes.ctor): Don't require a Location parameter.
+
+ * rootcontext.cs (AddGlobalAttributeSection): Rename again.
+
+ * attribute.cs (ApplyAttributes): Remove extra Location parameters
+ since we already have that information per attribute.
+
+ * everywhere : make appropriate changes.
+
+ * class.cs (LabelParameters): Write the code which actually
+ applies attributes to the return type. We can't do this on the MS
+ .NET runtime so we flag a warning in the case an exception is
+ thrown.
+
+2002-12-18 Miguel de Icaza <miguel@ximian.com>
+
+ * const.cs: Handle implicit null conversions here too.
+
+2002-12-17 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (MethodCore.LabelParameters): Remove the extra
+ Type [] parameter since it is completely unnecessary. Instead
+ pass in the method's attributes so that we can extract
+ the "return" attribute.
+
+2002-12-17 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay (parse): Use Report.Error to flag errors instead
+ of ignoring it and letting the compile continue.
+
+ * typemanager.cs (ChangeType): use an extra argument to return an
+ error condition instead of throwing an exception.
+
+2002-12-15 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Unary.TryReduce): mimic the code for the regular
+ code path. Perform an implicit cast in the cases where we can
+ implicitly convert to one of the integral types, and then reduce
+ based on that constant. This fixes bug #35483.
+
+2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
+
+2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * namespace.cs: fixed bug #35489.
+
+2002-12-12 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs: Remove some dead code.
+
+ * cs-parser.jay: Estimate the number of methods needed
+ (RootContext.MethodCount);
+
+ * cs-tokenizer.cs: Use char arrays for parsing identifiers and
+ numbers instead of StringBuilders.
+
+ * support.cs (PtrHashtable): Add constructor with initial size;
+ We can now reduce reallocations of the method table.
+
+2002-12-10 Ravi Pratap <ravi@ximian.com>
+
+ * attribute.cs (ApplyAttributes): Keep track of the emitted
+ attributes on a per-target basis. This fixes bug #35413.
+
+2002-12-10 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
+ default to the Windows 1252 encoding.
+
+ (UnixParseOption): Support version, thanks to Alp for the missing
+ pointer.
+
+ * AssemblyInfo.cs: Add nice assembly information.
+
+ * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
+ (bug 35169).
+
+ * cs-parser.jay: Allow a trailing comma before the close bracked
+ in the attribute_section production.
+
+ * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
+ address of the instance was being taken, I will take this out,
+ because we take the address of the object immediately here.
+
+2002-12-09 Ravi Pratap <ravi@ximian.com>
+
+ * typemanager.cs (AreMultipleAllowed): Take care of the most
+ obvious case where attribute type is not in the current assembly -
+ stupid me ;-)
+
+2002-12-08 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (SimpleName.DoResolve): First perform lookups on using
+ definitions, instead of doing that afterwards.
+
+ Also we use a nice little hack, depending on the constructor, we
+ know if we are a "composed" name or a simple name. Hence, we
+ avoid the IndexOf test, and we avoid
+
+ * codegen.cs: Add code to assist in a bug reporter to track down
+ the source of a compiler crash.
+
+2002-12-07 Ravi Pratap <ravi@ximian.com>
+
+ * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
+ types have been emitted for a given element and flag an error
+ if something which does not have AllowMultiple set is used more
+ than once.
+
+ * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
+ attribute types and their corresponding AllowMultiple properties
+
+ (AreMultipleAllowed): Check the property for a given type.
+
+ * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
+ property in the case we have a TypeContainer.
+
+ (Attributes.AddAttribute): Detect duplicates and just skip on
+ adding them. This trivial fix catches a pretty gross error in our
+ attribute emission - global attributes were being emitted twice!
+
+ Bugzilla bug #33187 is now fixed.
+
+2002-12-06 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
+ instead of pp_and).
+
+ * expression.cs (Binary.ResolveOperator): I can only use the
+ Concat (string, string, string) and Concat (string, string,
+ string, string) if the child is actually a concatenation of
+ strings.
+
+2002-12-04 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
+ context where we need a 2-character lookahead.
+
+ * pending.cs (PendingImplementation): Rework so we can keep track
+ of interface types all the time, and flag those which were
+ implemented by parents as optional.
+
+2002-12-03 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.ResolveOperator): Use
+ String.Concat(string,string,string) or
+ String.Concat(string,string,string,string) when possible.
+
+ * typemanager: More helper methods.
+
+
+Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * pending.cs: remove the bogus return from GetMissingInterfaces()
+ (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
+
+2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * namespace.cs: avoid duplicated 'using xxx' being added to
+ using_clauses. This prevents mcs from issuing and 'ambiguous type' error
+ when we get more than one 'using' statement for the same namespace.
+ Report a CS0105 warning for it.
+
+2002-11-30 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs (consume_identifier): use read directly, instead
+ of calling getChar/putback, uses internal knowledge of it.
+
+ (xtoken): Reorder tokenizer so most common patterns are checked
+ first. This reduces the compilation time in another 5% (from 8.11s
+ average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
+
+ The parsing time is 22% of the compilation in mcs, and from that
+ 64% is spent on the tokenization process.
+
+ I tried using a binary search for keywords, but this is slower
+ than the hashtable. Another option would be to do a couple of
+ things:
+
+ * Not use a StringBuilder, instead use an array of chars,
+ with a set value. Notice that this way we could catch
+ the 645 error without having to do it *afterwards*.
+
+ * We could write a hand-parser to avoid the hashtable
+ compares altogether.
+
+ The identifier consumption process takes 37% of the tokenization
+ time. Another 15% is spent on is_number. 56% of the time spent
+ on is_number is spent on Int64.Parse:
+
+ * We could probably choose based on the string length to
+ use Int32.Parse or Int64.Parse and avoid all the 64-bit
+ computations.
+
+ Another 3% is spend on wrapping `xtoken' in the `token' function.
+
+ Handle 0xa0 as whitespace (#34752)
+
+2002-11-26 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (IsCLRType): New routine to tell whether a type
+ is one of the builtin types.
+
+ Maybe it needs to use TypeCodes to be faster. Maybe we could use
+ typecode in more places instead of doing pointer comparissions.
+ We could leverage some knowledge about the way the typecodes are
+ laid out.
+
+ New code to cache namespaces in assemblies, it is currently not
+ invoked, to be used soon.
+
+ * decl.cs (DeclSpace.MakeFQN): Simple optimization.
+
+ * expression.cs (Binary.ResolveOperator): specially handle
+ strings, and do not perform user-defined operator overloading for
+ built-in types.
+
+2002-11-24 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
+ internalcall as it is a pretty simple operation; Avoid whenever
+ possible to call Char.IsLetter.
+
+ (consume_identifier): Cut by half the number of
+ hashtable calls by merging the is_keyword and GetKeyword behavior.
+
+ Do not short-circuit, because if we do, we
+ report errors (ie, #if false && true would produce an invalid
+ directive error);
+
+
+2002-11-24 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Cast.TryReduce): If we're in checked syntax,
+ check constant ranges and report a CS0221. Fixes #33186.
+
+2002-11-24 Martin Baulig <martin@ximian.com>
+
+ * cs-parser.jay: Make this work for uninitialized variable
+ declarations in the `for' initializer. Fixes #32416.
+
+2002-11-24 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (Expression.ConvertExplicit): Make casting from/to
+ System.Enum actually work. Fixes bug #32269, added verify-6.cs.
+
+2002-11-24 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
+ argument; if true, we also check for user-defined conversions.
+ This is only needed if both arguments are of a user-defined type.
+ Fixes #30443, added test-175.cs.
+ (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
+
+ * ecore.cs (Expression.ImplicitUserConversionExists): New method.
+
+2002-11-24 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (ArrayAccess.GetStoreOpcode): New public static
+ function to get the store opcode.
+ (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
+ only emit the Ldelema if the store opcode is Stobj. You must run
+ both test-34 and test-167 to test this. Fixes #34529.
+
+2002-11-23 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (Expression.MemberLookup): Added additional
+ `qualifier_type' argument which is used when we're being called
+ from MemberAccess.DoResolve() and null if we're called from a
+ SimpleName lookup.
+ (Expression.MemberLookupFailed): New method to report errors; this
+ does the CS1540 check and reports the correct error message.
+
+ * typemanager.cs (MemberLookup): Added additional `qualifier_type'
+ argument for the CS1540 check and redone the way how we're dealing
+ with private members. See the comment in the source code for details.
+ (FilterWithClosure): Reverted this back to revision 1.197; renamed
+ `closure_start_type' to `closure_qualifier_type' and check whether
+ it's not null. It was not this filter being broken, it was just
+ being called with the wrong arguments.
+
+ * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
+ and pass it the correct `qualifier_type'; this also does the error
+ handling for us.
+
+2002-11-22 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Invocation.EmitParams): If the we are dealing
+ with a non-built-in value type, load its address as well.
+
+ (ArrayCreation): Use a a pretty constant instead
+ of the hardcoded value 2. Use 6 instead of 2 for the number of
+ static initializers.
+
+ (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
+ because they are not really value types, just glorified integers.
+
+ * driver.cs: Do not append .exe, the CSC compiler does not do it.
+
+ * ecore.cs: Remove redundant code for enumerations, make them use
+ the same code path as everything else, fixes the casting issue
+ with enumerations in Windows.Forms.
+
+ * attribute.cs: Do only cast to string if it is a string, the
+ validation happens later.
+
+ * typemanager.cs: Temproary hack to avoid a bootstrap issue until
+ people upgrade their corlibs.
+
+ * ecore.cs: Oops, enumerations were not following the entire code path
+
+2002-11-21 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (FilterWithClosure): Commented out the test for
+ 1540 in typemanager.cs, as it has problems when accessing
+ protected methods from a parent class (see test-174.cs).
+
+ * attribute.cs (Attribute.ValidateGuid): new method.
+ (Attribute.Resolve): Use above.
+
+2002-11-19 Miguel de Icaza <miguel@ximian.com>
+
+ * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
+ handling for enumerations, as we only needed the TypeContainer
+ functionality to begin with (this is required for the fix below to
+ work for enums that reference constants in a container class for
+ example).
+
+ * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
+
+ * enum.cs (Enum.Define): Use `this' instead of parent, so we have
+ a valid TypeBuilder to perform lookups on.o
+
+ * class.cs (InheritableMemberSignatureCompare): Use true in the
+ call to GetGetMethod and GetSetMethod, because we are comparing
+ the signature, and we need to get the methods *even* if they are
+ private.
+
+ (PropertyBase.CheckBase): ditto.
+
+ * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
+ GotoCase.Resolve): Use Peel on EmpytCasts.
+
+ * ecore.cs (EmptyCast): drop child, add Peel method.
+
+2002-11-17 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (EmptyCast.Child): New public property.
+
+ * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
+ label resolved to an EmptyCast. Fixes #34162.
+ (GotoCase.Resolve): Likewise.
+ (Block.EmitMeta): Likewise.
+
+2002-11-17 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Invocation.BetterConversion): Prefer int over
+ uint; short over ushort; long over ulong for integer literals.
+ Use ImplicitConversionExists instead of StandardConversionExists
+ since we also need to check for user-defined implicit conversions.
+ Fixes #34165. Added test-173.cs.
+
+2002-11-16 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (Binary.EmitBranchable): Eliminate comparisions
+ with the `true' and `false' literals. Fixes #33151.
+
+2002-11-16 Martin Baulig <martin@ximian.com>
+
+ * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
+ October 22nd; don't do the cs1540 check for static members.
+
+ * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
+ now using our own filter here and doing the cs1540 check again.
+
+2002-11-16 Martin Baulig <martin@ximian.com>
+
+ * support.cs (InternalParameters): Don't crash if we don't have
+ any fixed parameters. Fixes #33532.
+
+2002-11-16 Martin Baulig <martin@ximian.com>
+
+ * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
+ when looking up static methods to make this work on Windows.
+ Fixes #33773.
+
+2002-11-16 Martin Baulig <martin@ximian.com>
+
+ * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
+ a setter rather than using PropertyInfo.CanWrite.
+
+2002-11-15 Nick Drochak <ndrochak@gol.com>
+
+ * class.cs: Allow acces to block member by subclasses. Fixes build
+ breaker.
+
+2002-11-14 Martin Baulig <martin@ximian.com>
+
+ * class.cs (Constructor.Emit): Added the extern/block check.
+ Fixes bug #33678.
+
+2002-11-14 Martin Baulig <martin@ximian.com>
+
+ * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
+ iteration while looking for indexers, this is needed because the
+ indexer may have a different name in our base classes. Fixed the
+ error reporting (no indexers at all, not get accessor, no
+ overloaded match). Fixes bug #33089.
+ (IndexerAccess.DoResolveLValue): Likewise.
+
+2002-11-14 Martin Baulig <martin@ximian.com>
+
+ * class.cs (PropertyBase.CheckBase): Make this work for multiple
+ indexers. Fixes the first part of bug #33089.
+ (MethodSignature.InheritableMemberSignatureCompare): Added support
+ for properties.
+
+2002-11-13 Ravi Pratap <ravi@ximian.com>
+
+ * attribute.cs (Attribute.Resolve): Catch the
+ NullReferenceException and report it since it isn't supposed to
+ happen.
+
+2002-11-12 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.EmitBranchable): Also handle the cases for
+ LogicalOr and LogicalAnd that can benefit from recursively
+ handling EmitBranchable. The code now should be nice for Paolo.
+
+2002-11-08 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (LookupType): Added a negative-hit hashtable for
+ the Type lookups, as we perform quite a number of lookups on
+ non-Types. This can be removed once we can deterministically tell
+ whether we have a type or a namespace in advance.
+
+ But this might require special hacks from our corlib.
+
+ * TODO: updated.
+
+ * ecore.cs (TryImplicitIntConversion): Handle conversions to float
+ and double which avoids a conversion from an integer to a double.
+
+ * expression.cs: tiny optimization, avoid calling IsConstant,
+ because it effectively performs the lookup twice.
+
+2002-11-06 Miguel de Icaza <miguel@ximian.com>
+
+ But a bogus return here to keep the semantics of the old code
+ until the Mono runtime is fixed.
+
+ * pending.cs (GetMissingInterfaces): New method used to remove all
+ the interfaces that are already implemented by our parent
+ classes from the list of pending methods.
+
+ * interface.cs: Add checks for calls after ResolveTypeExpr.
+
+2002-11-05 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Class.Emit): Report warning 67: event not used if the
+ warning level is beyond 3.
+
+ * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
+ being a NullLiteral.
+
+ * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
+ specifiers.
+
+ * class.cs (TypeContainer.GetClassBases): Cover a missing code
+ path that might fail if a type can not be resolved.
+
+ * expression.cs (Binary.Emit): Emit unsigned versions of the
+ operators.
+
+ * driver.cs: use error 5.
+
+2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
+
+ * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
+
+2002-11-01 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay (switch_section): A beautiful patch from Martin
+ Baulig that fixed 33094.
+
+2002-10-31 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
+ Check whether the base is abstract and report an error if so.
+
+ * expression.cs (IndexerAccess.DoResolveLValue,
+ IndexerAccess.DoResolve): ditto.
+
+ (Invocation.DoResolve): ditto.
+
+ (Invocation.FullMethodDesc): Improve the report string.
+
+ * statement.cs (Block): Eliminate IsVariableDefined as it is
+ basically just a wrapper for GetVariableInfo.
+
+ * ecore.cs (SimpleName): Use new
+
+ * support.cs (ReflectionParamter.ParameterType): We unwrap the
+ type, as we return the actual parameter ref/unref state on a
+ different call.
+
+2002-10-30 Miguel de Icaza <miguel@ximian.com>
+
+ * support.cs: Return proper flags REF/OUT fixing the previous
+ commit.
+
+ * expression.cs: Reverted last patch, that was wrong. Is_ref is
+ not used to mean `ref' but `ref or out' in ParameterReference
+
+ * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
+ full type signature instead of calling TypeManger.CSharpName
+ ourselves.
+
+ * support.cs (InternalParameters.ParameterDesc): Do not compare
+ directly to the modflags, because REF/OUT will actually be bitsets
+ if set.
+
+ * delegate.cs (VerifyMethod): Check also the modifiers.
+
+ * cs-tokenizer.cs: Fix bug where floating point values with an
+ exponent where a sign was missing was ignored.
+
+ * driver.cs: Allow multiple assemblies to be specified in a single
+ /r: argument
+
+2002-10-28 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
+ because identifiers after a parenthesis would end up in this kind
+ of production, and we needed to desamiguate it for having casts
+ like:
+
+ (UserDefinedType *) xxx
+
+2002-10-24 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (RealMemberLookup): when we deal with a subclass,
+ we should set on the Bindingflags.NonPublic, but not turn on
+ private_ok. private_ok controls whether a Private member is
+ returned (this is chekced on the filter routine), while the
+ BindingFlags.NonPublic just controls whether private/protected
+ will be allowed. This fixes the problem part of the problem of
+ private properties being allowed to be used in derived classes.
+
+ * expression.cs (BaseAccess): Provide an DoResolveLValue method,
+ so we can call the children DoResolveLValue method (this will
+ properly signal errors on lvalue assignments to base properties)
+
+ * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
+ getter are null, and we have a property info, we know that this
+ happened because the lookup failed, so we report an error 122 for
+ protection level violation.
+
+ We also silently return if setter and getter are null in the
+ resolve functions, this condition only happens if we have flagged
+ the error before. This is the other half of the problem.
+
+ (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
+ not have accessibility information, that is why we were returning
+ true in the filter function in typemanager.cs.
+
+ To properly report 122 (property is inaccessible because of its
+ protection level) correctly, we report this error in ResolveAccess
+ by failing if both the setter and the getter are lacking (ie, the
+ lookup failed).
+
+ DoResolve and DoLResolve have been modified to check for both
+ setter/getter being null and returning silently, the reason being
+ that I did not want to put the knowledge about this error in upper
+ layers, like:
+
+ int old = Report.Errors;
+ x = new PropertyExpr (...);
+ if (old != Report.Errors)
+ return null;
+ else
+ return x;
+
+ So the property expr is returned, but it is invalid, so the error
+ will be flagged during the resolve process.
+
+ * class.cs: Remove InheritablePropertySignatureCompare from the
+ class, as we no longer depend on the property signature to compute
+ whether it is possible to implement a method or not.
+
+ The reason is that calling PropertyInfo.GetGetMethod will return
+ null (in .NET, in Mono it works, and we should change this), in
+ cases where the Get Method does not exist in that particular
+ class.
+
+ So this code:
+
+ class X { public virtual int A { get { return 1; } } }
+ class Y : X { }
+ class Z : Y { public override int A { get { return 2; } } }
+
+ Would fail in Z because the parent (Y) would not have the property
+ defined. So we avoid this completely now (because the alternative
+ fix was ugly and slow), and we now depend exclusively on the
+ method names.
+
+ (PropertyBase.CheckBase): Use a method-base mechanism to find our
+ reference method, instead of using the property.
+
+ * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
+ routines are gone now.
+
+ * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
+ names, they were incorrectly named.
+
+ * cs-tokenizer.cs: Return are more gentle token on failure.
+
+ * pending.cs (PendingImplementation.InterfaceMethod): This routine
+ had an out-of-sync index variable, which caused it to remove from
+ the list of pending methods the wrong method sometimes.
+
+2002-10-22 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
+ CanWrite, because those refer to this particular instance of the
+ property, and do not take into account the fact that we can
+ override single members of a property.
+
+ Constructor requires an EmitContext. The resolution process does
+ not happen here, but we need to compute the accessors before,
+ because the resolution does not always happen for properties.
+
+ * typemanager.cs (RealMemberLookup): Set private_ok if we are a
+ subclass, before we did not update this flag, but we did update
+ bindingflags.
+
+ (GetAccessors): Drop this routine, as it did not work in the
+ presence of partially overwritten set/get methods.
+
+ Notice that this broke the cs1540 detection, but that will require
+ more thinking.
+
+2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * class.cs:
+ * codegen.cs:
+ * driver.cs: issue a warning instead of an error if we don't support
+ debugging for the platform. Also ignore a couple of errors that may
+ arise when trying to write the symbols. Undo my previous patch.
+
+2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * driver.cs: ignore /debug switch except for Unix platforms.
+
+2002-10-23 Nick Drochak <ndrochak@gol.com>
+
+ * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
+
+2002-10-21 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Do not make mcs-debug conditional, so we do not break
+ builds that use it.
+
+ * statement.cs (UsageVector.MergeChildren): I would like Martin to
+ review this patch. But basically after all the children variables
+ have been merged, the value of "Breaks" was not being set to
+ new_breaks for Switch blocks. I think that it should be set after
+ it has executed. Currently I set this to the value of new_breaks,
+ but only if new_breaks is FlowReturn.ALWAYS, which is a bit
+ conservative, but I do not understand this code very well.
+
+ I did not break anything in the build, so that is good ;-)
+
+ * cs-tokenizer.cs: Also allow \r in comments as a line separator.
+
+2002-10-20 Mark Crichton <crichton@gimp.org>
+
+ * cfold.cs: Fixed compile blocker. Really fixed it this time.
+
+2002-10-20 Nick Drochak <ndrochak@gol.com>
+
+ * cfold.cs: Fixed compile blocker.
+
+2002-10-20 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: I was chekcing the key, not the file.
+
+2002-10-19 Ravi Pratap <ravi@ximian.com>
+
+ * ecore.cs (UserDefinedConversion): Get rid of the bogus error
+ message that we were generating - we just need to silently return
+ a null.
+
+2002-10-19 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Event.Define): Change my previous commit, as this
+ breaks the debugger. This is a temporary hack, as it seems like
+ the compiler is generating events incorrectly to begin with.
+
+ * expression.cs (Binary.ResolveOperator): Added support for
+ "U operator - (E x, E y)"
+
+ * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
+ y)".
+
+ * ecore.cs (FieldExpr.AddressOf): We had a special code path for
+ init-only variables, but this path did not take into account that
+ there might be also instance readonly variables. Correct this
+ problem.
+
+ This fixes bug 32253
+
+ * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
+ delegates as well.
+
+ * driver.cs: Change the extension for modules to `netmodule'
+
+ * cs-parser.jay: Improved slightly the location tracking for
+ the debugger symbols.
+
+ * class.cs (Event.Define): Use Modifiers.FieldAttr on the
+ modifiers that were specified instead of the hardcoded value
+ (FamAndAssem). This was basically ignoring the static modifier,
+ and others. Fixes 32429.
+
+ * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
+ fixed a bug in the process (32476)
+
+ * expression.cs (ArrayAccess.EmitAssign): Patch from
+ hwang_rob@yahoo.ca that fixes bug 31834.3
+
+2002-10-18 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Make the module extension .netmodule.
+
+2002-10-16 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Report an error if the resource file is not found
+ instead of crashing.
+
+ * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
+ false, like Emit does.
+
+2002-10-16 Nick Drochak <ndrochak@gol.com>
+
+ * typemanager.cs: Remove unused private member. Also reported mcs
+ bug to report this as a warning like csc.
+
+2002-10-15 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Statement.Emit): Made this a virtual method; emits
+ the line number info and calls DoEmit().
+ (Statement.DoEmit): New protected abstract method, formerly knows
+ as Statement.Emit().
+
+ * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
+
+2002-10-11 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs: Following the comment from 2002-09-26 to AddMethod, I
+ have fixed a remaining problem: not every AddXXXX was adding a
+ fully qualified name.
+
+ Now everyone registers a fully qualified name in the DeclSpace as
+ being defined instead of the partial name.
+
+ Downsides: we are slower than we need to be due to the excess
+ copies and the names being registered this way.
+
+ The reason for this is that we currently depend (on the corlib
+ bootstrap for instance) that types are fully qualified, because
+ we dump all the types in the namespace, and we should really have
+ types inserted into the proper namespace, so we can only store the
+ basenames in the defined_names array.
+
+2002-10-10 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
+ from bug #31834, see the bug report for a testcase which is
+ miscompiled.
+
+2002-10-10 Martin Baulig <martin@gnome.org>
+
+ * codegen.cs (EmitContext.Breaks): Removed, we're now using the
+ flow analysis code for this.
+
+ * statement.cs (Do, While, For): Tell the flow analysis code about
+ infinite loops.
+ (FlowBranching.UsageVector): Added support for infinite loops.
+ (Block.Resolve): Moved the dead code elimination here and use flow
+ analysis to do it.
+
+2002-10-09 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Field.Define): Catch cycles on struct type
+ definitions.
+
+ * typemanager.cs (IsUnmanagedtype): Do not recursively check
+ fields if the fields are static. We only need to check instance
+ fields.
+
+ * expression.cs (As.DoResolve): Test for reference type.
+
+ * statement.cs (Using.ResolveExpression): Use
+ ConvertImplicitRequired, not ConvertImplicit which reports an
+ error on failture
+ (Using.ResolveLocalVariableDecls): ditto.
+
+ * expression.cs (Binary.ResolveOperator): Report errors in a few
+ places where we had to.
+
+ * typemanager.cs (IsUnmanagedtype): Finish implementation.
+
+2002-10-08 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs: Use StoreFromPtr instead of extracting the type
+ and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
+
+ * ecore.cs (ImplicitReferenceConversion): It is possible to assign
+ an enumeration value to a System.Enum, but System.Enum is not a
+ value type, but an class type, so we need to box.
+
+ (Expression.ConvertExplicit): One codepath could return
+ errors but not flag them. Fix this. Fixes #31853
+
+ * parameter.cs (Resolve): Do not allow void as a parameter type.
+
+2002-10-06 Martin Baulig <martin@gnome.org>
+
+ * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
+ if it's a class type and not a struct. Fixes #31815.
+
+2002-10-06 Martin Baulig <martin@gnome.org>
+
+ * statement.cs: Reworked the flow analysis code a bit to make it
+ usable for dead code elimination.
+
+2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * cs-parser.jay: allow empty source files. Fixes bug #31781.
+
+2002-10-04 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (ComposedCast.DoResolveType): A quick workaround
+ to fix the test 165, will investigate deeper.
+
+2002-10-04 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
+ finally blocks actually work.
+ (Try.Resolve): We don't need to create a sibling for `finally' if
+ there is no finally block.
+
+2002-10-04 Martin Baulig <martin@gnome.org>
+
+ * class.cs (Constructor.Define): The default accessibility for a
+ non-default constructor is private, not public.
+
+2002-10-04 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Constructor): Make AllowedModifiers public, add
+ EXTERN.
+
+ * cs-parser.jay: Perform the modifiers test here, as the
+ constructor for the Constructor class usually receives a zero
+ because of the way we create it (first we create, later we
+ customize, and we were never checking the modifiers).
+
+ * typemanager.cs (Typemanager.LookupTypeDirect): This new function
+ is a version of LookupTypeReflection that includes the type-name
+ cache. This can be used as a fast path for functions that know
+ the fully qualified name and are only calling into *.GetType() to
+ obtain a composed type.
+
+ This is also used by TypeManager.LookupType during its type
+ composition.
+
+ (LookupType): We now also track the real type name, as sometimes
+ we can get a quey for the real type name from things like
+ ComposedCast. This fixes bug 31422.
+
+ * expression.cs (ComposedCast.Resolve): Since we are obtaining a
+ complete type fullname, it does not have to go through the type
+ resolution system to obtain the composed version of the type (for
+ obtaining arrays or pointers).
+
+ (Conditional.Emit): Use the EmitBoolExpression to
+ generate nicer code, as requested by Paolo.
+
+ (ArrayCreation.CheckIndices): Use the patch from
+ hwang_rob@yahoo.ca to validate the array initializers.
+
+2002-10-03 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (ConstructorInitializer.Emit): simplify code by using
+ Invocation.EmitCall, and at the same time, fix the bugs in calling
+ parent constructors that took variable arguments.
+
+ * ecore.cs (Expression.ConvertNumericExplicit,
+ Expression.ImplicitNumericConversion): Remove the code that
+ manually wrapped decimal (InternalTypeConstructor call is now gone
+ as well).
+
+ * expression.cs (Cast.TryReduce): Also handle decimal types when
+ trying to perform a constant fold on the type.
+
+ * typemanager.cs (IsUnmanagedtype): Partially implemented.
+
+ * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
+ that only turned off an error report, and did nothing else.
+
+2002-10-02 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Handle and ignore /fullpaths
+
+2002-10-01 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.ResolveOperator): Catch the case where
+ DoNumericPromotions returns true,
+
+ (Binary.DoNumericPromotions): Simplify the code, and the tests.
+
+2002-09-27 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
+ report error 70.
+
+2002-09-26 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (ConvertNumericExplicit): It is not enough that the
+ conversion exists, but it is also required that the conversion be
+ performed. This manifested in "(Type64Enum) 2".
+
+ * class.cs (TypeManager.AddMethod): The fix is not to change
+ AddEnum, because that one was using a fully qualified name (every
+ DeclSpace derivative does), but to change the AddMethod routine
+ that was using an un-namespaced name. This now correctly reports
+ the duplicated name.
+
+ Revert patch until I can properly fix it. The issue
+ is that we have a shared Type space across all namespaces
+ currently, which is wrong.
+
+ Options include making the Namespace a DeclSpace, and merge
+ current_namespace/current_container in the parser.
+
+2002-09-25 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-parser.jay: Improve error reporting when we get a different
+ kind of expression in local_variable_type and
+ local_variable_pointer_type.
+
+ Propagate this to avoid missleading errors being reported.
+
+ * ecore.cs (ImplicitReferenceConversion): treat
+ TypeManager.value_type as a target just like object_type. As
+ code like this:
+
+ ValueType v = 1;
+
+ Is valid, and needs to result in the int 1 being boxed before it
+ is assigned to the value type v.
+
+ * class.cs (TypeContainer.AddEnum): Use the basename, not the name
+ to validate the enumeration name.
+
+ * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
+ EmitDynamicInitializers for the criteria to use Ldelema. Thanks
+ to hwang_rob@yahoo.ca for finding the bug and providing a patch.
+
+ * ecore.cs (TryImplicitIntConversion): When doing an
+ implicit-enumeration-conversion, check if the type is 64-bits and
+ perform a conversion before passing to EnumConstant.
+
+2002-09-23 Miguel de Icaza <miguel@ximian.com>
+
+ * decl.cs (Error_AmbiguousTypeReference); New routine used to
+ report ambiguous type references. Unlike the MS version, we
+ report what the ambiguity is. Innovation at work ;-)
+
+ (DeclSpace.FindType): Require a location argument to
+ display when we display an ambiguous error.
+
+ * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
+
+ * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
+
+ * expression.cs (EmitDynamicInitializers): Apply patch from
+ hwang_rob@yahoo.ca that fixes the order in which we emit our
+ initializers.
+
+2002-09-21 Martin Baulig <martin@gnome.org>
+
+ * delegate.cs (Delegate.VerifyApplicability): Make this work if the
+ delegate takes no arguments.
+
+2002-09-20 Miguel de Icaza <miguel@ximian.com>
+
+ * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
+ from integers.
+
+ * expression.cs: Extract the underlying type.
+
+ * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
+
+ * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
+
+2002-09-19 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (TypeContainer.DefineType): We can not use the nice
+ PackingSize with the size set to 1 DefineType method, because it
+ will not allow us to define the interfaces that the struct
+ implements.
+
+ This completes the fixing of bug 27287
+
+ * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
+ means also structs. This fixes part of the problem.
+ (Expresion.ImplicitReferenceConversionExists): ditto.
+
+ * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
+ error if there were no errors reported during the type lookup
+ process, to avoid duplicates or redundant errors. Without this
+ you would get an ambiguous errors plus a type not found. We have
+ beaten the user enough with the first error.
+
+ (DeclSparce.FindType): Emit a warning if we have an ambiguous
+ reference.
+
+ * ecore.cs (SimpleName.DoResolveType): If an error is emitted
+ during the resolution process, stop the lookup, this avoids
+ repeated error reports (same error twice).
+
+ * rootcontext.cs: Emit a warning if we have an ambiguous reference.
+
+ * typemanager.cs (LookupType): Redo the type lookup code to match
+ the needs of System.Reflection.
+
+ The issue is that System.Reflection requires references to nested
+ types to begin with a "+" sign instead of a dot. So toplevel
+ types look like: "NameSpace.TopLevelClass", and nested ones look
+ like "Namespace.TopLevelClass+Nested", with arbitrary nesting
+ levels.
+
+2002-09-19 Martin Baulig <martin@gnome.org>
+
+ * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
+ says that a method always returns or always throws an exception,
+ don't report the CS0161.
+
+ * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
+ set `Returns = new_returns'.
+
+2002-09-19 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
+ to an enum constant, check for a CS0176.
+
+2002-09-18 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (TypeContainer.CheckPairedOperators): Now we check
+ for operators that must be in pairs and report errors.
+
+ * ecore.cs (SimpleName.DoResolveType): During the initial type
+ resolution process, when we define types recursively, we must
+ check first for types in our current scope before we perform
+ lookups in the enclosing scopes.
+
+ * expression.cs (MakeByteBlob): Handle Decimal blobs.
+
+ (Invocation.VerifyArgumentsCompat): Call
+ TypeManager.TypeToCoreType on the parameter_type.GetElementType.
+ I thought we were supposed to always call this, but there are a
+ few places in the code where we dont do it.
+
+2002-09-17 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Add support in -linkres and -resource to specify the
+ name of the identifier.
+
+2002-09-16 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (StandardConversionExists): Sync with the conversion
+ code: allow anything-* to void* conversions.
+
+ (FindMostSpecificSource): Use an Expression argument
+ instead of a Type, because we might be handed over a Literal which
+ gets a few more implicit conversions that plain types do not. So
+ this information was being lost.
+
+ Also, we drop the temporary type-holder expression when not
+ required.
+
+2002-09-17 Martin Baulig <martin@gnome.org>
+
+ * class.cs (PropertyBase.CheckBase): Don't check the base class if
+ this is an explicit interface implementation.
+
+2002-09-17 Martin Baulig <martin@gnome.org>
+
+ * class.cs (PropertyBase.CheckBase): Make this work for indexers with
+ different `IndexerName' attributes.
+
+ * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
+ (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
+ virtual CommonResolve().
+
+2002-09-16 Miguel de Icaza <miguel@ximian.com>
+
+ * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
+ and convert that to the UnderlyingType.
+
+ * statement.cs (Foreach.Resolve): Indexers are just like variables
+ or PropertyAccesses.
+
+ * cs-tokenizer.cs (consume_string): Track line numbers and columns
+ inside quoted strings, we were not doing this before.
+
+2002-09-16 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
+ resolve it. This is needed for the definite assignment check of the
+ instance expression, fixes bug #29846.
+ (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
+
+2002-09-16 Nick Drochak <ndrochak@gol.com>
+
+ * parameter.cs: Fix compile error. Cannot reference static member
+ from an instance object. Is this an mcs bug?
+
+2002-09-14 Martin Baulig <martin@gnome.org>
+
+ * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
+ multiple times. Fixes bug #30295, added test-166.cs.
+
+2002-09-14 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Block.Emit): Don't emit unreachable code.
+ (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
+ `break' statements.
+ (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
+
+2002-09-14 Martin Baulig <martin@gnome.org>
+
+ * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
+ is set.
+
+2002-09-14 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
+ if `type == parent' since in this case `type.IsSubclassOf (parent)' will
+ be false on the ms runtime.
+
+2002-09-13 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
+ the CS0038 error message.
+
+2002-09-12 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
+ constant inside, return it.
+
+2002-09-12 Martin Baulig <martin@gnome.org>
+
+ * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
+ implicit conversion can be done between enum types.
+
+ * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
+ check whether an implicit conversion to the current enum's UnderlyingType
+ exists and report an error if not.
+
+ * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
+ without debugging support.
+
+ * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
+ Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
+
+2002-09-12 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.IsNestedChildOf): New method.
+
+ * ecore.cs (IMemberExpr.DeclaringType): New property.
+ (SimpleName.SimpleNameResolve): Check whether we're accessing a
+ nonstatic member of an outer type (CS0038).
+
+2002-09-11 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Activate the using-error detector at warning level
+ 4 (at least for MS-compatible APIs).
+
+ * namespace.cs (VerifyUsing): Small buglett fix.
+
+ * pending.cs (PendingImplementation): pass the container pointer.
+
+ * interface.cs (GetMethods): Allow for recursive definition. Long
+ term, I would like to move every type to support recursive
+ definitions, not the current ordering mechanism that we have right
+ now.
+
+ The situation is this: Attributes are handled before interfaces,
+ so we can apply attributes to interfaces. But some attributes
+ implement interfaces, we will now handle the simple cases
+ (recursive definitions will just get an error).
+
+ * parameter.cs: Only invalidate types at the end if we fail to
+ lookup all types.
+
+2002-09-09 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (PropertyExpr.Emit): Also check for
+ TypeManager.system_int_array_get_length so this'll also work when
+ compiling corlib. Fixes #30003.
+
+2002-09-09 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
+ and throw an exception if we can't get the type's size. Fixed #30040,
+ added test-165.cs.
+
+2002-09-09 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
+
+ * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
+ context. Fixes bug #30027.
+
+ * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
+ virtual functions. Fixes bug #30043, added test-164.cs.
+
+2002-09-08 Ravi Pratap <ravi@ximian.com>
+
+ * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
+
+2002-09-08 Nick Drochak <ndrochak@gol.com>
+
+ * driver.cs: Use an object to get the windows codepage since it's not a
+ static property.
+
+2002-09-08 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (For.Emit): for infinite loops (test == null)
+ return whether there is a break inside, not always "true".
+
+ * namespace.cs (UsingEntry): New struct to hold the name of the
+ using definition, the location where it is defined, and whether it
+ has been used in a successful type lookup.
+
+ * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
+ strings.
+
+ * decl.cs: ditto.
+
+2002-09-06 Ravi Pratap <ravi@ximian.com>
+
+ * attribute.cs : Fix incorrect code which relied on catching
+ a NullReferenceException to detect a null being passed in
+ where an object was expected.
+
+2002-09-06 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Try): flag the catch variable as assigned
+
+ * expression.cs (Cast): Simplified by using ResolveType instead of
+ manually resolving.
+
+ * statement.cs (Catch): Fix bug by using ResolveType.
+
+2002-09-06 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (BetterConversion): Special case for when we have
+ a NullLiteral as the argument and we have to choose between string
+ and object types - we choose string the way csc does.
+
+ * attribute.cs (Attribute.Resolve): Catch the
+ NullReferenceException and report error #182 since the Mono
+ runtime no more has the bug and having this exception raised means
+ we tried to select a constructor which takes an object and is
+ passed a null.
+
+2002-09-05 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation.OverloadResolve): Flag a nicer error
+ message (1502, 1503) when we can't locate a method after overload
+ resolution. This is much more informative and closes the bug
+ Miguel reported.
+
+ * interface.cs (PopulateMethod): Return if there are no argument
+ types. Fixes a NullReferenceException bug.
+
+ * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
+ expressions too. Previously we were checking only in one place for
+ positional arguments leaving out named arguments.
+
+ * ecore.cs (ImplicitNumericConversion): Conversion from underlying
+ type to the enum type is not allowed. Remove code corresponding to
+ that.
+
+ (ConvertNumericExplicit): Allow explicit conversions from
+ the underlying type to enum type. This precisely follows the spec
+ and closes a bug filed by Gonzalo.
+
+2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * compiler.csproj:
+ * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
+
+2002-09-03 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
+ it was important that we stored the right value after the
+ reduction in `converted'.
+
+2002-09-04 Martin Baulig <martin@gnome.org>
+
+ * location.cs (Location.SymbolDocument): Use full pathnames for the
+ source files.
+
+2002-08-30 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
+ of the expression resolve mechanism, because that will catch the
+ SimpleName error failures.
+
+ (Conditional): If we can not resolve the
+ expression, return, do not crash.
+
+2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * cs-tokenizer.cs:
+ (location): display token name instead of its number.
+
+2002-08-28 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Binary.ResolveOperator): Don't silently return
+ but return an error if an operator cannot be applied between two
+ enum types.
+
+2002-08-28 Martin Baulig <martin@gnome.org>
+
+ * class.cs (Constructor.Define): Set the permission attributes
+ correctly instead of making all constructors public.
+
+2002-08-28 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
+ for private members before reporting a CS0103; if we find anything,
+ it's a CS0122.
+
+2002-08-28 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
+ to check whether `closure_start_type == closure_invocation_type',
+ we also need to check whether `m.DeclaringType == closure_invocation_type'
+ before bypassing the permission checks. We might be accessing
+ protected/private members from the base class.
+ (TypeManager.RealMemberLookup): Only set private_ok if private
+ members were requested via BindingFlags.NonPublic.
+
+ * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): Set
+ MethodGroupExpr.IsExplicitImpl if appropriate.
+ (Invocation.DoResolve): Don't report the CS0120 for explicit
+ interface implementations.
+
+2002-08-27 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Invocation.DoResolve): If this is a static
+ method and we don't have an InstanceExpression, we must report
+ a CS0120.
+
+2002-08-25 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
+ `==' between a valuetype and an object.
+
+2002-08-25 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (TypeExpr): Provide a ToString method.
+
+2002-08-24 Martin Baulig <martin@gnome.org>
+
+ * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
+ now called proggie.dbg and it's a binary file.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * struct.cs (MyStructInfo.ctor): Make this work with empty
+ structs; it's not allowed to use foreach() on null.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
+ writer the full pathname of the generated assembly.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * statements.cs (FlowBranching.UsageVector.MergeChildren):
+ A `finally' block never returns or breaks; improved handling of
+ unreachable code.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Throw.Resolve): Allow `throw null'.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
+ EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
+ `ee.EventInfo.DeclaringType == ec.ContainerType'. The
+ MemberLookup would return a wrong event if this is an explicit
+ interface implementation and the class has an event with the same
+ name.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Block.AddChildVariableNames): New public method.
+ (Block.AddChildVariableName): Likewise.
+ (Block.IsVariableNameUsedInChildBlock): Likewise.
+ (Block.AddVariable): Check whether a variable name has already
+ been used in a child block.
+
+ * cs-parser.jay (declare_local_variables): Mark all variable names
+ from the current block as being used in a child block in the
+ implicit block.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
+ find the symbol writer.
+
+ * driver.cs: csc also allows the arguments to /define being
+ separated by commas, not only by semicolons.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * interface.cs (Interface.GetMembers): Added static check for events.
+
+2002-08-15 Martin Baulig <martin@gnome.org>
+
+ * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
+ call, use ec.ContainerType.BaseType as queried_type and invocation_type.
+
+ * ecore.cs (Expression.MemberLookup): Added documentation and explained
+ why the MethodData.EmitDestructor() change was necessary.
+
+2002-08-20 Martin Baulig <martin@gnome.org>
+
+ * class.cs (TypeContainer.FindMembers): Added static check for events.
+
+ * decl.cs (MemberCache.AddMembers): Handle events like normal members.
+
+ * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
+ use Type.GetEvents(), not Type.FindMembers().
+
+2002-08-20 Martin Baulig <martin@gnome.org>
+
+ * decl.cs (MemberCache): Added a special method cache which will
+ be used for method-only searched. This ensures that a method
+ search will return a MethodInfo with the correct ReflectedType for
+ inherited methods.
+
+2002-08-20 Martin Baulig <martin@gnome.org>
+
+ * decl.cs (DeclSpace.FindMembers): Made this public.
+
+2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * delegate.cs: fixed build on windows.
+ [FIXME: Filed as bug #29150: MCS must report these errors.]
+
+2002-08-19 Ravi Pratap <ravi@ximian.com>
+
+ * ecore.cs (StandardConversionExists): Return a false
+ if we are trying to convert the void type to anything else
+ since that is not allowed.
+
+ * delegate.cs (DelegateInvocation.DoResolve): Ensure that
+ we flag error 70 in the event an event is trying to be accessed
+ directly from outside the declaring type.
+
+2002-08-20 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
+ MemberCache from typemanager.cs to decl.cs.
+
+2002-08-19 Martin Baulig <martin@gnome.org>
+
+ * class.cs (TypeContainer): Implement IMemberContainer.
+ (TypeContainer.DefineMembers): Create the MemberCache.
+ (TypeContainer.FindMembers): Do better BindingFlags checking; only
+ return public members if BindingFlags.Public was given, check
+ whether members are static.
+
+2002-08-16 Martin Baulig <martin@gnome.org>
+
+ * decl.cs (DeclSpace.Define): Splitted this in Define and
+ DefineMembers. DefineMembers is called first and initializes the
+ MemberCache.
+
+ * rootcontext.cs (RootContext.DefineMembers): New function. Calls
+ DefineMembers() on all our DeclSpaces.
+
+ * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
+ but call DefineMembers() on all nested interfaces. We call their
+ Define() in our new Define() function.
+
+ * interface.cs (Interface): Implement IMemberContainer.
+ (Interface.Define): Moved all code except the attribute stuf to
+ DefineMembers().
+ (Interface.DefineMembers): Initialize the member cache.
+
+ * typemanager.cs (IMemberFinder): Removed this interface, we don't
+ need this anymore since we can use MemberCache.FindMembers directly.
+
+2002-08-19 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (MemberCache): When creating the cache for an
+ interface type, add all inherited members.
+ (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
+ to `out bool used_cache' and documented it.
+ (TypeManager.MemberLookup): If we already used the cache in the first
+ iteration, we don't need to do the interfaces check.
+
+2002-08-19 Martin Baulig <martin@gnome.org>
+
+ * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
+ here from IMemberFinder and don't implement this interface anymore.
+ (DeclSpace.MemberCache): Moved here from IMemberFinder.
+
+ * typemanager.cs (IMemberFinder): This interface is now only used by
+ classes which actually support the member cache.
+ (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
+ since we only put DeclSpaces into this Hashtable.
+ (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
+ a dynamic type and TypeHandle.GetTypeHandle() otherwise.
+
+2002-08-16 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (ICachingMemberFinder): Removed.
+ (IMemberFinder.MemberCache): New property.
+ (TypeManager.FindMembers): Merged this with RealFindMembers().
+ This function will never be called from TypeManager.MemberLookup()
+ so we can't use the cache here, just the IMemberFinder.
+ (TypeManager.MemberLookup_FindMembers): Check whether the
+ IMemberFinder has a MemberCache and call the cache's FindMembers
+ function.
+ (MemberCache): Rewrote larger parts of this yet another time and
+ cleaned it up a bit.
+
+2002-08-15 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs (LoadArgs): Support quoting.
+
+ (Usage): Show the CSC-like command line arguments.
+
+ Improved a few error messages.
+
+2002-08-15 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (IMemberContainer.Type): New property.
+ (IMemberContainer.IsInterface): New property.
+
+ The following changes are conditional to BROKEN_RUNTIME, which is
+ defined at the top of the file.
+
+ * typemanager.cs (MemberCache.MemberCache): Don't add the base
+ class'es members, but add all members from TypeHandle.ObjectType
+ if we're an interface.
+ (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
+ is the current type.
+ (MemberCache.CacheEntry.Container): Removed this field.
+ (TypeHandle.GetMembers): Include inherited members.
+
+2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * typemanager.cs: fixed compilation and added a comment on a field that
+ is never used.
+
+2002-08-15 Martin Baulig <martin@gnome.org>
+
+ * class.cs (ConstructorInitializer.Resolve): In the
+ Expression.MemberLookup call, use the queried_type as
+ invocation_type.
+
+ * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
+ declared' attribute, it's always true.
+ (IMemberContainer.Parent, IMemberContainer.Name): New properties.
+ (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
+ temporary wrapper for FindMembers which tells MemberLookup whether
+ members from the base classes are included in the return value.
+ This will go away soon.
+ (TypeManager.MemberLookup): Use this temporary hack here; once the
+ new MemberCache is completed, we don't need to do the DeclaredOnly
+ looping here anymore since the MemberCache will take care of this.
+ (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
+ (MemberCache): When creating the MemberCache for a class, get
+ members from the current class and all its base classes.
+ (MemberCache.CacheEntry.Container): New field. This is a
+ temporary hack until the Mono runtime is fixed to distinguish
+ between ReflectedType and DeclaringType. It allows us to use MCS
+ with both the MS runtime and the unfixed Mono runtime without
+ problems and without accecting performance.
+ (MemberCache.SearchMembers): The DeclaredOnly looping from
+ TypeManager.MemberLookup is now done here.
+
+2002-08-14 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (MyStructInfo.MyStructInfo): Don't call
+ Type.GetFields on dynamic types but get the fields from the
+ corresponding TypeContainer.
+ (MyStructInfo.GetStructInfo): Added check for enum types.
+
+ * typemanager.cs (MemberList.IsSynchronized): Implemented.
+ (MemberList.SyncRoot): Implemented.
+ (TypeManager.FilterWithClosure): No need to check permissions if
+ closure_start_type == closure_invocation_type, don't crash if
+ closure_invocation_type is null.
+
+2002-08-13 Martin Baulig <martin@gnome.org>
+
+ Rewrote TypeContainer.FindMembers to use a member cache. This
+ gives us a speed increase of about 35% for the self-hosting MCS
+ build and of about 15-20% for the class libs (both on GNU/Linux).
+
+ * report.cs (Timer): New class to get enhanced profiling. This
+ whole class is "TIMER" conditional since it remarkably slows down
+ compilation speed.
+
+ * class.cs (MemberList): New class. This is an IList wrapper
+ which we're now using instead of passing MemberInfo[]'s around to
+ avoid copying this array unnecessarily.
+ (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
+ (ICachingMemberFinder, IMemberContainer): New interface.
+ (TypeManager.FilterWithClosure): If `criteria' is null, the name
+ has already been checked, otherwise use it for the name comparision.
+ (TypeManager.FindMembers): Renamed to RealMemberFinder and
+ provided wrapper which tries to use ICachingMemberFinder.FindMembers
+ if possible. Returns a MemberList, not a MemberInfo [].
+ (TypeHandle): New class, implements IMemberContainer. We create
+ one instance of this class per type, it contains a MemberCache
+ which is used to do the member lookups.
+ (MemberCache): New class. Each instance of this class contains
+ all members of a type and a name-based hash table.
+ (MemberCache.FindMembers): This is our new member lookup
+ function. First, it looks up all members of the requested name in
+ the hash table. Then, it walks this list and sorts out all
+ applicable members and returns them.
+
+2002-08-13 Martin Baulig <martin@gnome.org>
+
+ In addition to a nice code cleanup, this gives us a performance
+ increase of about 1.4% on GNU/Linux - not much, but it's already
+ half a second for the self-hosting MCS compilation.
+
+ * typemanager.cs (IMemberFinder): New interface. It is used by
+ TypeManager.FindMembers to call FindMembers on a TypeContainer,
+ Enum, Delegate or Interface.
+ (TypeManager.finder_to_member_finder): New PtrHashtable.
+ (TypeManager.finder_to_container): Removed.
+ (TypeManager.finder_to_delegate): Removed.
+ (TypeManager.finder_to_interface): Removed.
+ (TypeManager.finder_to_enum): Removed.
+
+ * interface.cs (Interface): Implement IMemberFinder.
+
+ * delegate.cs (Delegate): Implement IMemberFinder.
+
+ * enum.cs (Enum): Implement IMemberFinder.
+
+ * class.cs (TypeContainer): Implement IMemberFinder.
+
+2002-08-12 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
+
+2002-08-12 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (ITypeExpression): New interface for expressions which
+ resolve to a type.
+ (TypeExpression): Renamed to TypeLookupExpression.
+ (Expression.DoResolve): If we're doing a types-only lookup, the
+ expression must implement the ITypeExpression interface and we
+ call DoResolveType() on it.
+ (SimpleName): Implement the new ITypeExpression interface.
+ (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
+ hack, the situation that we're only looking up types can't happen
+ anymore when this method is called. Moved the type lookup code to
+ DoResolveType() and call it.
+ (SimpleName.DoResolveType): This ITypeExpression interface method
+ is now doing the types-only lookup.
+ (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
+ (ResolveFlags): Added MaskExprClass.
+
+ * expression.cs (MemberAccess): Implement the ITypeExpression
+ interface.
+ (MemberAccess.DoResolve): Added support for a types-only lookup
+ when we're called via ITypeExpression.DoResolveType().
+ (ComposedCast): Implement the ITypeExpression interface.
+
+ * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
+ Expression.Resolve() with ResolveFlags.Type instead.
+
+2002-08-12 Martin Baulig <martin@gnome.org>
+
+ * interface.cs (Interface.Define): Apply attributes.
+
+ * attribute.cs (Attribute.ApplyAttributes): Added support for
+ interface attributes.
+
+2002-08-11 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Block.Emit): Only check the "this" variable if we
+ do not always throw an exception.
+
+ * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
+ whether the property has a set accessor.
+
+2002-08-11 Martin Baulig <martin@gnome.org>
+
+ Added control flow analysis support for structs.
+
+ * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
+ with control flow analysis turned off.
+ (IVariable): New interface.
+ (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
+ returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
+ (FieldExpr.DoResolve): Resolve the instance expression with flow
+ analysis turned off and do the definite assignment check after the
+ resolving when we know what the expression will resolve to.
+
+ * expression.cs (LocalVariableReference, ParameterReference):
+ Implement the new IVariable interface, only call the flow analysis
+ code if ec.DoFlowAnalysis is true.
+ (This): Added constructor which takes a Block argument. Implement
+ the new IVariable interface.
+ (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
+ DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
+ This does the definite assignment checks for struct members.
+
+ * class.cs (Constructor.Emit): If this is a non-static `struct'
+ constructor which doesn't have any initializer, call
+ Block.AddThisVariable() to tell the flow analysis code that all
+ struct elements must be initialized before control returns from
+ the constructor.
+
+ * statement.cs (MyStructInfo): New public class.
+ (UsageVector.this [VariableInfo vi]): Added `int field_idx'
+ argument to this indexer. If non-zero, check an individual struct
+ member, not the whole struct.
+ (FlowBranching.CheckOutParameters): Check struct members.
+ (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
+ overloaded versions of these methods which take an additional
+ `int field_idx' argument to check struct members.
+ (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
+ overloaded versions of these methods which take an additional
+ `string field_name' argument to check struct member.s
+ (VariableInfo): Implement the IVariable interface.
+ (VariableInfo.StructInfo): New public property. Returns the
+ MyStructInfo instance of the variable if it's a struct or null.
+ (Block.AddThisVariable): New public method. This is called from
+ Constructor.Emit() for non-static `struct' constructor which do
+ not have any initializer. It creates a special variable for the
+ "this" instance variable which will be checked by the flow
+ analysis code to ensure that all of the struct's fields are
+ initialized before control returns from the constructor.
+ (UsageVector): Added support for struct members. If a
+ variable/parameter is a struct with N members, we reserve a slot
+ in the usage vector for each member. A struct is considered fully
+ initialized if either the struct itself (slot 0) or all its
+ members are initialized.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * driver.cs (Driver.MainDriver): Only report an error CS5001
+ if there were no compilation errors.
+
+ * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
+ `UnsafeContext' property to determine whether the parent is in
+ unsafe context rather than checking the parent's ModFlags:
+ classes nested in an unsafe class are unsafe as well.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (UsageVector.MergeChildren): Distinguish between
+ `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
+ we return. Added test17() and test18() to test-154.cs.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.FilterWithClosure): If we have
+ Family access, make sure the invoking type isn't a subclass of the
+ queried type (that'd be a CS1540).
+
+ * ecore.cs (Expression.MemberLookup): Added overloaded version of
+ this method which takes an additional `Type invocation_type'.
+
+ * expression.cs (BaseAccess.DoResolve): Use the base type as
+ invocation and query type.
+ (MemberAccess.DoResolve): If the lookup failed and we're about to
+ report a CS0122, try a lookup with the ec.ContainerType - if this
+ succeeds, we must report a CS1540.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
+ (MethodGroupExpr): Implement the IMemberExpr interface.
+
+ * expression (MemberAccess.ResolveMemberAccess): No need to have
+ any special code for MethodGroupExprs anymore, they're now
+ IMemberExprs.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
+ Family, FamANDAssem and FamORAssem permissions.
+ (TypeManager.IsSubclassOrNestedChildOf): New public method.
+
+2002-08-08 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
+ (UsageVector.MergeChildren): `break' breaks unless we're in a switch
+ or loop block.
+
+Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * driver.cs: implemented /resource option to embed managed resources.
+
+2002-08-07 Martin Baulig <martin@gnome.org>
+
+ * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
+ (FieldBase.HasFieldInitializer): New public property.
+ (FieldBase.GetInitializerExpression): New public method. Resolves and
+ returns the field initializer and makes sure it is only resolved once.
+ (TypeContainer.EmitFieldInitializers): Call
+ FieldBase.GetInitializerExpression to get the initializer, this ensures
+ that it isn't resolved multiple times.
+
+ * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
+ the resolving process (SimpleName/MemberLookup) that we're currently
+ emitting a field initializer (which must not access any instance members,
+ this is an error CS0236).
+
+ * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
+ argument, if the `IsFieldInitializer' flag is set, we must report and
+ error CS0236 and not an error CS0120.
+
+2002-08-07 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (IMemberExpr): New public interface.
+ (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
+ (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
+ if the expression is an IMemberExpr.
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
+ to be null, implicitly default to `this' if we're non-static in
+ this case. Simplified the code a lot by using the new IMemberExpr
+ interface. Also fixed bug #28176 here.
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * cs-parser.jay (SimpleLookup): Removed. We need to create
+ ParameterReferences during semantic analysis so that we can do a
+ type-only search when resolving Cast, TypeOf and SizeOf.
+ (block): Pass the `current_local_parameters' to the Block's
+ constructor.
+
+ * class.cs (ConstructorInitializer): Added `Parameters parameters'
+ argument to the constructor.
+ (ConstructorInitializer.Resolve): Create a temporary implicit
+ block with the parameters.
+
+ * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
+ references here if we aren't doing a type-only search.
+
+ * statement.cs (Block): Added constructor which takes a
+ `Parameters parameters' argument.
+ (Block.Parameters): New public property.
+
+ * support.cs (InternalParameters.Parameters): Renamed `parameters'
+ to `Parameters' and made it public readonly.
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.Warning): Made this public as well.
+
+ * report.cs (Report.Debug): Print the contents of collections.
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
+ used to tell Resolve() which kinds of expressions it may return.
+ (Expression.Resolve): Added overloaded version of this method which
+ takes a `ResolveFlags flags' argument. This can be used to tell
+ Resolve() which kinds of expressions it may return. Reports a
+ CS0118 on error.
+ (Expression.ResolveWithSimpleName): Removed, use Resolve() with
+ ResolveFlags.SimpleName.
+ (Expression.Error118): Added overloaded version of this method which
+ takes a `ResolveFlags flags' argument. It uses the flags to determine
+ which kinds of expressions are allowed.
+
+ * expression.cs (Argument.ResolveMethodGroup): New public method.
+ Resolves an argument, but allows a MethodGroup to be returned.
+ This is used when invoking a delegate.
+
+ * TODO: Updated a bit.
+
+2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ Fixed compilation with csc.
+
+ * ecore.cs: Expression.Error made public. Is this correct? Should
+ Warning be made public too?
+
+ * expression.cs: use ea.Location instead of ea.loc.
+ [FIXME: Filed as bug #28607: MCS must report these errors.]
+
+2002-08-06 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.loc): Moved the location here instead of
+ duplicating it in all derived classes.
+ (Expression.Location): New public property.
+ (Expression.Error, Expression.Warning): Made them non-static and
+ removed the location argument.
+ (Expression.Warning): Added overloaded version which takes an
+ `int level' argument.
+ (Expression.Error118): Make this non-static and removed the
+ expression and location arguments.
+ (TypeExpr): Added location argument to the constructor.
+
+ * expression.cs (StaticCallExpr): Added location argument to
+ the constructor.
+ (Indirection, PointerArithmetic): Likewise.
+ (CheckedExpr, UnCheckedExpr): Likewise.
+ (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
+ (StringPtr): Likewise.
+
+
+2002-08-05 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (BaseAccess.DoResolve): Actually report errors.
+
+ * assign.cs (Assign.DoResolve): Check whether the source
+ expression is a value or variable.
+
+ * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
+ while resolving the corresponding blocks.
+
+ * interface.cs (Interface.GetInterfaceTypeByName): Actually report
+ an error, don't silently return null.
+
+ * statement.cs (Block.AddVariable): Do the error reporting here
+ and distinguish between CS0128 and CS0136.
+ (Block.DoResolve): Report all unused labels (warning CS0164).
+ (LabeledStatement): Pass the location to the constructor.
+ (LabeledStatement.HasBeenReferenced): New property.
+ (LabeledStatement.Resolve): Set it to true here.
+
+ * statement.cs (Return.Emit): Return success even after reporting
+ a type mismatch error (CS0126 or CS0127), this is what csc does and
+ it avoids confusing the users with any consecutive errors.
+
+2002-08-05 Martin Baulig <martin@gnome.org>
+
+ * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
+
+ * const.cs (Const.LookupConstantValue): Catch circular definitions.
+
+ * expression.cs (MemberAccess.DoResolve): Silently return if an
+ error has already been reported.
+
+ * ecore.cs (Expression.MemberLookupFinal): Silently return if an
+ error has already been reported.
+
+2002-08-05 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (UsageVector): Only initialize the `parameters'
+ vector if we actually have any "out" parameters.
+
+2002-08-05 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Binary.ResolveOperator): When combining delegates,
+ they must have the same type.
+
+2002-08-05 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
+ PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
+ work with the ms runtime and we also don't need it: if we're a
+ PropertyBuilder and not in the `indexer_arguments' hash, then we
+ are a property and not an indexer.
+
+ * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
+ Type.IsPointer and Type.IsByRef instead of Type.HasElementType
+ since the latter one doesn't work with the ms runtime.
+
+2002-08-03 Martin Baulig <martin@gnome.org>
+
+ Fixed bugs #27998 and #22735.
+
+ * class.cs (Method.IsOperator): New public field.
+ (Method.CheckBase): Report CS0111 if there's already a method
+ with the same parameters in the current class. Report CS0508 when
+ attempting to change the return type of an inherited method.
+ (MethodData.Emit): Report CS0179 if a method doesn't have a body
+ and it's not marked abstract or extern.
+ (PropertyBase): New abstract base class for Property and Indexer.
+ (PropertyBase.CheckBase): Moved here from Property and made it work
+ for indexers.
+ (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
+ the same so we can reuse it there.
+ (Property, Indexer): Derive from PropertyBase.
+ (MethodSignature.inheritable_property_signature_filter): New delegate
+ to find properties and indexers.
+
+ * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
+ argument and improved error reporting.
+
+ * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
+ EmptyReadOnlyParameters and made it a property.
+
+ * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
+ version of this method which takes a `PropertyInfo indexer'.
+ (TypeManager.RegisterIndexer): New method.
+
+ * class.cs: Added myself as author of this file :-)
+
+2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * class.cs: fixed compilation on windoze.
+
+2002-08-03 Martin Baulig <martin@gnome.org>
+
+ * interface.cs (Interface.GetInterfaceBases): Check whether all
+ base interfaces are at least as accessible than the current one.
+
+ * class.cs (TypeContainer.GetClassBases): Check whether base types
+ are at least as accessible than the current type.
+ (TypeContainer.AsAccessible): Implemented and made non-static.
+ (MemberBase.CheckParameters): Report errors if the accessibility
+ checks fail.
+
+ * delegate.cs (Delegate.Delegate): The default visibility is
+ internal for top-level types and private for nested types.
+ (Delegate.Define): Report errors if the accessibility checks fail.
+
+ * enum.cs (Enum.Enum): The default visibility is internal for
+ top-level types and private for nested types.
+ (Enum.DefineType): Compute the correct visibility.
+
+ * modifiers.cs (Modifiers.TypeAttr): Added a version of this
+ function which takes a `bool is_toplevel' instead of a TypeContainer.
+
+ * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
+ builtin type.
+
+2002-08-02 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (LocalVariableReferenc): Added constructor which
+ takes additional `VariableInfo vi' and `bool is_readonly' arguments.
+ (LocalVariableReference.IsReadOnly): New property.
+ (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
+ variable is readonly, use our own readonly flag to do this; you can
+ use the new constructor to get a writable reference to a read-only
+ variable.
+
+ * cs-parser.jay (foreach_statement, using_statement): Get a writable
+ reference to the local variable.
+
+2002-08-01 Miguel de Icaza <miguel@ximian.com>
+
+ * rootcontext.cs (ResolveCore): Also include System.Exception
+
+ * statement.cs (Block.Emit): Do not emit the dead-code warnings if
+ we reach an EmptyStatement.
+
+ (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
+ is also fine.
+
+ * expression.cs (Binary.ResolveOperator): Check error result in
+ two places.
+
+ use brtrue/brfalse directly and avoid compares to null.
+
+2002-08-02 Martin Baulig <martin@gnome.org>
+
+ * class.cs (TypeContainer.Define): Define all nested interfaces here.
+ Fixes bug #28407, added test-155.cs.
+
+2002-08-01 Martin Baulig <martin@gnome.org>
+
+ * class.cs (Event.EmitDefaultMethod): Make this work with static
+ events. Fixes #28311, added verify-3.cs.
+
+2002-08-01 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
+ `is_disposable' fields.
+ (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
+ `hm.is_disposable' if we're using the collection pattern.
+ (Foreach.EmitCollectionForeach): Use the correct type for the
+ enumerator's local variable, only emit the try/finally block if
+ necessary (fixes #27713).
+
+2002-08-01 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.report118): Renamed to Error118 and made
+ it public static.
+
+ * statement.cs (Throw.Resolve): Check whether the expression is of
+ the correct type (CS0118) and whether the type derives from
+ System.Exception (CS0155).
+ (Catch.Resolve): New method. Do the type lookup here and check
+ whether it derives from System.Exception (CS0155).
+ (Catch.CatchType, Catch.IsGeneral): New public properties.
+
+ * typemanager.cs (TypeManager.exception_type): Added.
+
+2002-07-31 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Updated About function.
+
+2002-07-31 Martin Baulig <martin@gnome.org>
+
+ Implemented Control Flow Analysis.
+
+ * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
+ (EmitContext.CurrentBranching): Added.
+ (EmitContext.StartFlowBranching): Added.
+ (EmitContext.EndFlowBranching): Added.
+ (EmitContext.KillFlowBranching): Added.
+ (EmitContext.IsVariableAssigned): Added.
+ (EmitContext.SetVariableAssigned): Added.
+ (EmitContext.IsParameterAssigned): Added.
+ (EmitContext.SetParameterAssigned): Added.
+ (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
+ Added control flow analysis stuff here.
+
+ * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
+ resolve the expression as lvalue.
+ (LocalVariableReference.DoResolve): Check whether the variable has
+ already been assigned.
+ (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
+ the parameter as assigned here.
+ (ParameterReference.DoResolve): Check whether the parameter has already
+ been assigned.
+ (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
+ expression as lvalue.
+
+ * statement.cs (FlowBranching): New class for the flow analysis code.
+ (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
+ (LabeledStatement.IsDefined): New public property.
+ (LabeledStatement.AddUsageVector): New public method to tell flow
+ analyis that the label may be reached via a forward jump.
+ (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
+ flow analysis.
+ (VariableInfo.Number): New public field. This is used by flow analysis
+ to number all locals of a block.
+ (Block.CountVariables): New public property. This is the number of
+ local variables in this block (including the locals from all parent
+ blocks).
+ (Block.EmitMeta): Number all the variables.
+
+ * statement.cs: Added flow analysis support to all classes.
+
+2002-07-31 Martin Baulig <martin@gnome.org>
+
+ * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
+ To get debugging messages, compile mcs with /define:MCS_DEBUG and
+ then use this argument.
+
+ * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
+
+ * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
+ use this to specify /define options.
+
+2002-07-29 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Fixed): Moved all code that does variable lookups
+ and resolvings from Emit to Resolve.
+
+ * statement.cs (For): Moved all code that does variable lookups
+ and resolvings from Emit to Resolve.
+
+ * statement.cs (Using): Moved all code that does variable lookups
+ and resolvings from Emit to Resolve.
+
+2002-07-29 Martin Baulig <martin@gnome.org>
+
+ * attribute.cs (Attribute.Resolve): Explicitly catch a
+ System.NullReferenceException when creating the
+ CustromAttributeBuilder and report a different warning message.
+
+2002-07-29 Martin Baulig <martin@gnome.org>
+
+ * support.cs (ParameterData.ParameterName): Added method to
+ get the name of a parameter.
+
+ * typemanager.cs (TypeManager.IsValueType): New public method.
+
+2002-07-29 Martin Baulig <martin@gnome.org>
+
+ * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
+ is a flag which specifies that it's either ref or out.
+ (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
+ the out parameter to `out Parameter.Modifier mod', also set the
+ Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
+
+ * support.cs (InternalParameters.ParameterModifier): Distinguish
+ between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
+ Parameter.Modifier.ISBYREF flag if it's either ref or out.
+
+ * expression.cs (Argument.GetParameterModifier): Distinguish
+ between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
+ Parameter.Modifier.ISBYREF flag if it's either ref or out.
+
+2002-07-29 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (ParameterReference.ParameterReference): Added
+ `Location loc' argument to the constructor.
+
+ * cs-parser.jay: Pass location to ParameterReference.
+
+2002-07-28 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Try): Initialize the location.
+
+ * cs-parser.jay: pass location to Try.
+
+ * expression.cs (Unary.Reduce): Change the prototype to return
+ whether a constant fold could be performed or not. The result is
+ returned in an out parameters. In the case of Indirection and
+ AddressOf, we want to perform the full tests.
+
+2002-07-26 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Statement.Emit): Flag dead code.
+
+2002-07-27 Andrew Birkett <andy@nobugs.org>
+
+ * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
+
+2002-07-27 Martin Baulig <martin@gnome.org>
+
+ * class.cs (MethodData.Define): Put back call to
+ TypeManager.AddMethod(), accidentally commented this out.
+
+ * report.cs (Debug): New public method to print debugging information,
+ this is `[Conditional ("DEBUG")]'.
+
+2002-07-26 Martin Baulig <martin@gnome.org>
+
+ * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
+ (switch_statement): Push the current_block to the switch_stack and
+ pop it again when we're done with the switch.
+ (switch_section): The new block is a child of the current_block.
+ Fixes bug #24007, added test-152.cs.
+
+2002-07-27 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Invocation.EmitArguments): When calling a varargs
+ function with only its fixed arguments, we need to pass an empty
+ array.
+
+2002-07-27 Martin Baulig <martin@gnome.org>
+
+ Mono 0.13 has been released.
+
+2002-07-25 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Rename --resource to --linkres, because that is what
+ we do currently, we dont support --resource yet.
+
+ * cs-tokenizer.cs: Fix test for reporting endif mismatches.
+
+2002-07-25 Martin Baulig <martin@gnome.org>
+
+ * class.cs (MethodData): New public class. This is a `method builder'
+ class for a method or one accessor of a Property/Indexer/Event.
+ (MethodData.GetMethodFlags): Moved here from MemberBase.
+ (MethodData.ApplyAttributes): Likewise.
+ (MethodData.ApplyObsoleteAttribute): Likewise.
+ (MethodData.ApplyConditionalAttribute): Likewise.
+ (MethodData.ApplyDllImportAttribute): Likewise.
+ (MethodData.CheckAbstractAndExternal): Likewise.
+ (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
+ (MethodData.Emit): Formerly known as Method.Emit().
+ (MemberBase): Moved everything which was specific to a single
+ accessor/method to MethodData.
+ (Method): Create a new MethodData and call Define() and Emit() on it.
+ (Property, Indexer, Event): Create a new MethodData objects for each
+ accessor and call Define() and Emit() on them.
+
+2002-07-25 Martin Baulig <martin@gnome.org>
+
+ Made MethodCore derive from MemberBase to reuse the code from there.
+ MemberBase now also checks for attributes.
+
+ * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
+ (MemberBase.GetMethodFlags): Moved here from class Method and marked
+ as virtual.
+ (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
+ `CallingConventions cc' and `Attributes opt_attrs' arguments.
+ (MemberBase.ApplyAttributes): New virtual method; applies the
+ attributes to a method or accessor.
+ (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
+ (MemberBase.ApplyConditionalAttribute): Likewise.
+ (MemberBase.ApplyDllImportAttribute): Likewise.
+ (MemberBase.CheckAbstractAndExternal): Likewise.
+ (MethodCore.ParameterTypes): This is now a property instead of a
+ method, it's initialized from DoDefineParameters().
+ (MethodCore.ParameterInfo): Removed the set accessor.
+ (MethodCore.DoDefineParameters): New protected virtual method to
+ initialize ParameterTypes and ParameterInfo.
+ (Method.GetReturnType): We can now simply return the MemberType.
+ (Method.GetMethodFlags): Override the MemberBase version and add
+ the conditional flags.
+ (Method.CheckBase): Moved some code from Define() here, call
+ DoDefineParameters() here.
+ (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
+ here to avoid some larger code duplication.
+ (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
+ ensure that abstract and external accessors don't declare a body.
+
+ * attribute.cs (Attribute.GetValidPieces): Make this actually work:
+ `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
+ lookup in the attribute's parent classes, so we need to abort as soon
+ as we found the first match.
+ (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
+ the attribute has no arguments.
+
+ * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
+ of a Method.
+
+2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * cs-parser.jay: reverted previous patch.
+
+2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * cs-parser.jay: fixed bug #22119.
+
+2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * attribute.cs: fixed compilation. The error was:
+ "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
+ be assigned to before control leaves the current method."
+ [FIXME: Filed as bug #28186: MCS must report this error.]
+
+2002-07-25 Martin Baulig <martin@gnome.org>
+
+ * attribute.cs (Attribute.Conditional_GetConditionName): New static
+ method to pull the condition name ouf of a Conditional attribute.
+ (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
+ the obsolete message and error flag out of an Obsolete attribute.
+
+ * class.cs (Method.GetMethodFlags): New public method to get the
+ TypeManager.MethodFlags for this method.
+ (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
+ private methods.
+ (Method.Define): Get and apply the Obsolete and Conditional attributes;
+ if we're overriding a virtual function, set the new private variable
+ `parent_method'; call the new TypeManager.AddMethod().
+
+ * typemanager.cs (TypeManager.AddMethod): New static method. Stores
+ the MethodBuilder and the Method in a PtrHashtable.
+ (TypeManager.builder_to_method): Added for this purpose.
+ (TypeManager.MethodFlags): Added IsObsoleteError.
+ (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
+ Obsolete and Conditional arguments in MethodBuilders. If we discover
+ an Obsolete attribute, emit an appropriate warning 618 / error 619 with
+ the message from the attribute.
+
+2002-07-24 Martin Baulig <martin@gnome.org>
+
+ * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
+ preprocessor directives, ensure that the argument to #define/#undef is
+ exactly one identifier and that it's actually an identifier.
+
+ Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
+ did not work ....
+
+2002-07-24 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
+ initialize it to TypeManager.object_type in the constructor.
+ (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
+ of the `hm.get_current' method if we're using the collection pattern.
+ (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
+ for the explicit conversion to make it work when we're using the collection
+ pattern and the `Current' property has a different return type than `object'.
+ Fixes #27713.
+
+2002-07-24 Martin Baulig <martin@gnome.org>
+
+ * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
+ does not match, but don't report any errors. This method is called in
+ order for all methods in a MethodGroupExpr until a matching method is
+ found, so we don't want to bail out if the first method doesn't match.
+ (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
+ matches, report the 123. Fixes #28070.
+
+2002-07-24 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
+ TypeManager.TypeToCoreType() to the top of the method so the
+ following equality checks will work. Fixes #28107.
+
+2002-07-24 Martin Baulig <martin@gnome.org>
+
+ * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
+ operand is of type uint, and the other operand is of type sbyte,
+ short or int, the operands are converted to type long." -
+ Actually do what this comment already told us. Fixes bug #28106,
+ added test-150.cs.
+
+2002-07-24 Martin Baulig <martin@gnome.org>
+
+ * class.cs (MethodBase): New abstract class. This is now a base
+ class for Property, Indexer and Event to avoid some code duplication
+ in their Define() and DefineMethods() methods.
+ (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
+ generic methods for Define() and DefineMethods().
+ (FieldBase): Derive from MemberBase, not MemberCore.
+ (Property): Derive from MemberBase, not MemberCore.
+ (Property.DefineMethod): Moved all the code from this method to the
+ new MethodBase.DefineAccessor(), just call it with appropriate
+ argumetnts.
+ (Property.Define): Call the new Property.DoDefine(), this does some
+ sanity checks and we don't need to duplicate the code everywhere.
+ (Event): Derive from MemberBase, not MemberCore.
+ (Event.Define): Use the new MethodBase.DefineAccessor() to define the
+ accessors, this will also make them work with interface events.
+ (Indexer): Derive from MemberBase, not MemberCore.
+ (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
+ (Indexer.Define): Use the new MethodBase functions.
+
+ * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
+ argument to the constructor.
+ (Interface.FindMembers): Added support for interface events.
+ (Interface.PopluateEvent): Implemented.
+
+ Added test-149.cs for this. This also fixes bugs #26067 and #24256.
+
+2002-07-22 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
+ but this is required to check for a method name being the same as
+ the containing class.
+
+ Handle this now.
+
+2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * interface.cs: initialize variable.
+
+2002-07-23 Martin Baulig <martin@gnome.org>
+
+ Implemented the IndexerName attribute in interfaces.
+
+ * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
+ name if this is an explicit interface implementation.
+ (Indexer.InterfaceIndexerName): New public variable. If we're
+ implementing an interface indexer, this is the IndexerName in that
+ interface. Otherwise, it's the IndexerName.
+ (Indexer.DefineMethod): If we're implementing interface indexer,
+ set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
+ and Pending.ImplementIndexer methods.
+ (Indexer.Define): Also define the PropertyBuilder if we're
+ implementing an interface indexer and this is neither an explicit
+ interface implementation nor do the IndexerName match the one in
+ the interface.
+
+ * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
+ If a method is defined here, then we always need to create a proxy
+ for it. This is used when implementing interface indexers.
+ (Pending.IsInterfaceIndexer): New public method.
+ (Pending.ImplementIndexer): New public method.
+ (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
+ This is used when implementing interface indexers to define a proxy
+ if necessary.
+ (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
+ define a proxy if necessary.
+
+ * interface.cs (Interface.IndexerName): New public variable.
+ (Interface.PopulateIndexer): Set the IndexerName.
+ (Interface.DefineIndexers): New private method. Populate all the
+ indexers and make sure their IndexerNames match.
+
+ * typemanager.cs (IndexerPropertyName): Added support for interface
+ indexers.
+
+2002-07-22 Martin Baulig <martin@gnome.org>
+
+ * codegen.cs (EmitContext.HasReturnLabel): New public variable.
+ (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
+ ret if HasReturnLabel.
+ (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
+ variables.
+
+ * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
+ and set the ec.LoopBeginTryCatchLevel.
+ (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
+ (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
+ the current ec.TryCatchLevel, the branch goes out of an exception
+ block. In this case, we need to use Leave and not Br.
+
+2002-07-22 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Try.Emit): Emit an explicit ret after the end of the
+ block unless the block does not always return or it is contained in
+ another try { ... } catch { ... } block. Fixes bug #26506.
+ Added verify-1.cs to the test suite.
+
+2002-07-22 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
+ then we do not always return. Fixes bug #24985.
+
+2002-07-22 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
+ lookup on a per-class level; ie. walk up the class hierarchy until we
+ found at least one applicable method, then choose the best among them.
+ Fixes bug #24463 and test-29.cs.
+
+2002-07-22 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
+ return types of the methods. The return type is not part of the
+ signature and we must not check it to make the `new' modifier work.
+ Fixes bug #27999, also added test-147.cs.
+ (TypeManager.TypeToCoreType): Added TypeManager.type_type.
+
+ * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
+ on the method's return type.
+
+2002-07-21 Martin Baulig <martin@gnome.org>
+
+ * assign.cs: Make this work if the rightmost source is a constant and
+ we need to do an implicit type conversion. Also adding a few more tests
+ to test-38.cs which should have caught this.
+
+ * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
+ target in the makefile for this. The makefile.gnu is primarily intended
+ for end-users who don't want to debug the compiler.
+
+2002-07-21 Martin Baulig <martin@gnome.org>
+
+ * assign.cs: Improved the Assign class so it can now handle embedded
+ assignments (X = Y = Z = something). As a side-effect this'll now also
+ consume less local variables. test-38.cs now passes with MCS, added
+ a few new test cases to that test.
+
+2002-07-20 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
+ instructions. Fixes bug #27977, also added test-146.cs.
+
+2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * cs-tokenizer.cs: fixed getHex ().
+
+2002-07-19 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
+ not Type.GetType() to lookup the array type. This is needed when
+ we're constructing an array of a user-defined type.
+ (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
+ single-dimensional arrays, but also for single-dimensial arrays of
+ type decimal.
+
+2002-07-19 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (New.DoEmit): Create a new LocalTemporary each time
+ this function is called, it's not allowed to share LocalBuilders
+ among ILGenerators.
+
+2002-07-19 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Argument.Resolve): Report an error 118 when trying
+ to pass a type as argument.
+
+2002-07-18 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
+ Conv_R_Un for the signed `long' type.
+
+2002-07-15 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (MemberAccess.DoResolve): Do not reuse the field
+ `expr' for the temporary result, as that will fail if we do
+ multiple resolves on the same expression.
+
+2002-07-05 Miguel de Icaza <miguel@ximian.com>
+
+ * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
+ ec.TypeContainer for looking up aliases.
+
+ * class.cs (TypeContainer): Remove LookupAlias from here.
+
+ * decl.cs (DeclSpace); Move here.
+
+2002-07-01 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (FindMembers): Only call filter if the constructor
+ bulider is not null.
+
+ Also handle delegates in `NestedTypes' now. Now we will perform
+ type lookups using the standard resolution process. This also
+ fixes a bug.
+
+ * decl.cs (DeclSpace.ResolveType): New type resolution routine.
+ This uses Expressions (the limited kind that can be parsed by the
+ tree) instead of strings.
+
+ * expression.cs (ComposedCast.ToString): Implement, used to flag
+ errors since now we have to render expressions.
+
+ (ArrayCreation): Kill FormElementType. Use ComposedCasts in
+ FormArrayType.
+
+ * ecore.cs (SimpleName.ToString): ditto.
+
+ * cs-parser.jay: Instead of using strings to assemble types, use
+ Expressions to assemble the type (using SimpleName, ComposedCast,
+ MemberAccess). This should fix the type lookups in declarations,
+ because we were using a different code path for this.
+
+ * statement.cs (Block.Resolve): Continue processing statements
+ even when there is an error.
+
+2002-07-17 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Event.Define): Also remove the `remove' method from
+ the list of pending items.
+
+ * expression.cs (ParameterReference): Use ldarg.N (0..3) to
+ generate more compact code.
+
+2002-07-17 Martin Baulig <martin@gnome.org>
+
+ * const.cs (Const.LookupConstantValue): Add support for constant
+ `unchecked' and `checked' expressions.
+ Also adding test case test-140.cs for this.
+
+2002-07-17 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
+ check whether mi.ReturnType implements the IEnumerator interface; the
+ `==' and the IsAssignableFrom() will fail in this situation.
+
+2002-07-16 Ravi Pratap <ravi@ximian.com>
+
+ * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
+ here too.
+
+2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * expression.cs: fixed bug #27811.
+
+2002-07-14 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (ParameterReference.AddressOf): Patch from Paolo
+ Molaro: when we are a ref, the value already contains a pointer
+ value, do not take the address of it.
+
+2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
+ * removed mb-parser.jay and mb-tokenizer.cs
+
+Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * expression.cs: check against the building corlib void type.
+
+Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * ecore.cs: fix for valuetype static readonly fields: when
+ initializing them, we need their address, not the address of a copy.
+
+Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * typemanager.cs: register also enum_type in corlib.
+
+Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.cs: allow calling this (but not base) initializers in structs.
+
+Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * ecore.cs: make sure we compare against the building base types
+ in GetTypeSize ().
+
+Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * typemanager.cs: fix TypeToCoreType() to handle void and object
+ (corlib gets no more typerefs after this change).
+
+2002-07-12 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (ArrayCreation.EmitArrayArguments): use
+ Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
+
+ (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
+ Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
+ array indexes, the runtime actually forbids them.
+
+ * ecore.cs (ExpressionToArrayArgument): Move the conversion code
+ for array arguments here.
+
+ * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
+ instead of the default for ValueTypes.
+
+ (New.DoEmit): Use IsValueType instead of
+ IsSubclassOf (value_type)
+ (New.DoResolve): ditto.
+ (Invocation.EmitCall): ditto.
+
+ * assign.cs (Assign): ditto.
+
+ * statement.cs (Unsafe): Ok, so I got the semantics wrong.
+ Statements *are* currently doing part of their resolution during
+ Emit.
+
+ Expressions do always resolve during resolve, but statements are
+ only required to propagate resolution to their children.
+
+2002-07-11 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
+
+ (LoadAssembly): Do not add the dll if it is already specified
+
+ (MainDriver): Add the System directory to the link path at the end,
+ after all the other -L arguments.
+
+ * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
+ wrong opcode for loading bytes and bools (ldelem.i1 instead of
+ ldelem.u1) and using the opposite for sbytes.
+
+ This fixes Digger, and we can finally run it.
+
+ * driver.cs (UnixParseOption): Move the option parsing here.
+ (CSCParseOption): Implement CSC-like parsing of options.
+
+ We now support both modes of operation, the old Unix way, and the
+ new CSC-like way. This should help those who wanted to make cross
+ platform makefiles.
+
+ The only thing broken is that /r:, /reference: and /lib: are not
+ implemented, because I want to make those have the same semantics
+ as the CSC compiler has, and kill once and for all the confussion
+ around this. Will be doing this tomorrow.
+
+ * statement.cs (Unsafe.Resolve): The state is checked during
+ resolve, not emit, so we have to set the flags for IsUnsfe here.
+
+2002-07-10 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
+ not catch the Error_ObjectRefRequired in SimpleName (as it is
+ possible to have a class/instance variable name that later gets
+ deambiguated), we have to check this here.
+
+2002-07-10 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
+ make static and put into Expression.
+
+ (Event.Define): Register the private field of the event with the
+ TypeManager so that GetFieldFromEvent can get at it.
+
+ (TypeManager.RegisterPrivateFieldOfEvent): Implement to
+ keep track of the private field associated with an event which
+ has no accessors.
+
+ (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
+ private field.
+
+ * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
+
+2002-07-10 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary.EmitBranchable): this routine emits the
+ Binary expression in a branchable context. This basically means:
+ we need to branch somewhere, not just get the value on the stack.
+
+ This works together with Statement.EmitBoolExpression.
+
+ * statement.cs (Statement.EmitBoolExpression): Use
+ EmitBranchable.
+
+2002-07-09 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (For): Reduce the number of jumps in loops.
+
+ (For): Implement loop inversion for the For statement.
+
+ (Break): We can be breaking out of a Try/Catch controlled section
+ (foreach might have an implicit try/catch clause), so we need to
+ use Leave instead of Br.
+
+ * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
+ now). If the instace expression supports IMemoryLocation, we use
+ the AddressOf method from the IMemoryLocation to extract the
+ address instead of emitting the instance.
+
+ This showed up with `This', as we were emitting the instance
+ always (Emit) instead of the Address of This. Particularly
+ interesting when This is a value type, as we dont want the Emit
+ effect (which was to load the object).
+
+2002-07-08 Miguel de Icaza <miguel@ximian.com>
+
+ * attribute.cs: Pass the entry point to the DefinePInvokeMethod
+
+ * statement.cs (Checked): Set the CheckedState during the resolve
+ process too, as the ConvCast operations track the checked state on
+ the resolve process, and not emit.
+
+ * cs-parser.jay (namespace_member_declaration): Flag that we have
+ found a declaration when we do. This is used to flag error 1529
+
+ * driver.cs: Report ok when we display the help only.
+
+2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
+
+ * cs-tokenizer.cs (xtoken): Improve handling of string literals.
+
+2002-07-04 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs (define): We also have to track locally the
+ defines. AllDefines is just used for the Conditional Attribute,
+ but we also need the local defines for the current source code.
+
+2002-07-03 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (While, For, Do): These loops can exit through a
+ Break statement, use this information to tell whether the
+ statement is the last piece of code.
+
+ (Break): Flag that we break.
+
+ * codegen.cs (EmitContexts): New `Breaks' state variable.
+
+2002-07-03 Martin Baulig <martin@gnome.org>
+
+ * class.cs (TypeContainer.MethodModifiersValid): Allow override
+ modifiers in method declarations in structs. Otherwise, you won't
+ be able to override things like Object.Equals().
+
+2002-07-02 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (Method, Property, Indexer): Do not allow the public
+ modifier to be used in explicit interface implementations.
+
+ (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
+ override modifiers in method declarations in structs
+
+2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
+
+ * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
+ integer or real overflow, report an error
+
+2002-07-02 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.InitCoreTypes): When compiling
+ corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
+ to tell the runtime about our newly created System.Object and
+ System.ValueType types.
+
+2002-07-02 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (This): Use Stobj/Ldobj when we are a member of a
+ struct instead of Ldarg/Starg.
+
+2002-07-02 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Indirection.Indirection): Call
+ TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
+
+2002-07-02 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
+ ValueType, call TypeManager.TypeToCoreType() on it.
+ (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
+ the OpCodes.Newarr argument.
+
+2002-07-02 Martin Baulig <martin@gnome.org>
+
+ * expression.cs (Invocation.EmitCall): When compiling corlib,
+ replace all calls to the system's System.Array type to calls to
+ the newly created one.
+
+ * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
+ System.Array methods.
+ (TypeManager.InitCoreTypes): When compiling corlib, get the methods
+ from the system's System.Array type which must be replaced.
+
+Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * typemanager.cs: load unverifiable_code_ctor so we can build
+ corlib using the correct type. Avoid using GetTypeCode() with
+ TypeBuilders.
+ * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
+ TypeManager.object_type to allow building corlib.
+
+Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * ecore.cs: handle System.Enum separately in LoadFromPtr().
+
+2002-07-01 Martin Baulig <martin@gnome.org>
+
+ * class.cs: Make the last change actually work, we need to check
+ whether `ifaces != null' to avoid a crash.
+
+Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.cs: when we build structs without fields that implement
+ interfaces, we need to add the interfaces separately, since there is
+ no API to both set the size and add the interfaces at type creation
+ time.
+
+Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * expression.cs: the dimension arguments to the array constructors
+ need to be converted if they are a long.
+
+Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.cs: don't emit ldarg.0 if there is no parent constructor
+ (fixes showstopper for corlib).
+
+2002-06-29 Martin Baulig <martin@gnome.org>
+
+ MCS now compiles corlib on GNU/Linux :-)
+
+ * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
+ ie. check for MethodImplOptions.InternalCall.
+
+ * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
+ and TypeManager.attribute_type are null, so we must explicitly check
+ whether parent is not null to find out whether it's an attribute type.
+ (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
+ and SetBuilder, not only if the property is neither abstract nor external.
+ This is necessary to set the MethodImplOptions on the accessor methods.
+ (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
+ SetBuilder, see Property.Emit().
+
+ * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
+ populate "System.Object", "System.ValueType" and "System.Attribute" since
+ they've already been populated from BootCorlib_PopulateCoreTypes().
+
+2002-06-29 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
+ is the NullLiteral, we also need to make sure that target_type is not
+ an enum type.
+
+2002-06-29 Martin Baulig <martin@gnome.org>
+
+ * rootcontext.cs (RootContext.ResolveCore): We must initialize
+ `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
+ before calling BootstrapCorlib_ResolveDelegate ().
+
+2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * statement.cs: fixed build-breaker. All tests passed ok.
+
+2002-06-27 Martin Baulig <martin@gnome.org>
+
+ * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
+ for System.Decimal when compiling corlib.
+
+2002-06-27 Martin Baulig <martin@gnome.org>
+
+ * statement.cs (Switch.TableSwitchEmit): Make this work with empty
+ switch blocks which contain nothing but a default clause.
+
+2002-06-26 Andrew <adb@tardis.ed.ac.uk>
+
+ * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
+
+2002-06-27 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (PropertyExpr.PropertyExpr): Call
+ TypeManager.TypeToCoreType() on the `pi.PropertyType'.
+
+ * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
+ is already a TypeBuilder.
+
+2002-06-27 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
+ `target_type == TypeManager.array_type', not IsAssignableFrom() in
+ the "from an array-type to System.Array" case. This makes it work
+ when compiling corlib.
+
+2002-06-27 Martin Baulig <martin@gnome.org>
+
+ * ecore.cs (Expression.SimpleNameResolve): If the expression is a
+ non-static PropertyExpr, set its InstanceExpression. This makes
+ the `ICollection.Count' property work in System/Array.cs.
+
2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
* driver.cs: Made error handling more consistent. Errors now
@@ -23,7 +10043,6 @@
* namespace.cs: Use Report.Error instead of GenericParser.error
-
2002-06-22 Miguel de Icaza <miguel@ximian.com>
* class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
@@ -47,7 +10066,7 @@
not explicitly implementing a property from an interface. Use the
correct name also for those properties (the same CSC uses,
although that is really not needed).
-
+
(Property.Emit): Do not emit attributes for explicitly implemented
properties, as there is no TypeBuilder.
@@ -80,12 +10099,12 @@ Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
the interfaces and work around the lame differences between
System.Type and System.Reflection.Emit.TypeBuilder in the results
result for GetInterfaces.
-
+
(ExpandInterfaces): Given an array of interface types, expand and
eliminate repeated ocurrences of an interface. This expands in
context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
be IA, IB, IC.
-
+
2002-06-21 Martin Baulig <martin@gnome.org>
* typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
@@ -165,7 +10184,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (Unary.ResolveOperator): Use TypeManager
to resolve the type.
-
+
2002-06-13 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (enum_member_declaration): Pass in the attributes
@@ -181,7 +10200,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
* typemanager.cs (TypeManager.VerifyUnManaged): Allow
address-of operator on both value types and pointers.
-
+
2002-06-10 Martin Baulig <martin@gnome.org>
* interface.cs (Interface.PopulateIndexer): Add the indexer's
@@ -221,7 +10240,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
to handle the Accessor kind :-)
* class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
-
+
2002-06-08 Martin Baulig <martin@gnome.org>
* expression.cs (Unary.TryReduceNegative): Added support for
@@ -335,7 +10354,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
(DefineMethod): Return whether we are doing an interface
implementation.
-
+
* typemanager.cs: Temporary hack until we get attributes in
interfaces (Ravi is working on that) and we get IndexerName
support in interfaces.
@@ -502,7 +10521,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
avoid having side effects
(Assign.Emit): Call CacheTemporaries in the IAssignMethod.
-
+
* ecore.cs (Expression.CacheTemporaries): Provide empty default
implementation.
@@ -514,7 +10533,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
(StoreFromPtr): Handle stobj as well.
* expression.cs (UnaryMutator): Share more code.
-
+
* typemanager.cs (FindMembers): Thanks to Paolo for tracking this
down: I was not tracking the Filter function as well, which
was affecting the results of the cache.
@@ -569,7 +10588,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
Do not allow instances of abstract classes or interfaces to be
created.
-
+
* class.cs: (MethodSignature.InheritableMemberSignatureCompare):
We have to compare the assembly property here when dealing with
FamANDAssem and Assembly access modifiers, because we might be
@@ -650,7 +10669,7 @@ Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (Invocation.MakeUnionSet): Optimization: Use two
nested foreach statements instead of for, and also break out of
the inner loop once a match is found.
-
+
(Invocation.OverloadResolve): Use foreach, simplify the code.
2002-05-08 Miguel de Icaza <miguel@ximian.com>
@@ -695,7 +10714,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
* parameter.cs (ParameterType): Make it a property for now although the
purpose really isn't anything immediate.
-
+
* expression.cs (Is*Applicable): Do better checking on the parameter type
of a ref/out parameter. The ones from the system assemblies are already
marked with the correct type so we don't need to do any correction.
@@ -720,7 +10739,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
(EmitCode): Apply attributes within an EmitContext that represents
the container they were declared on.
-
+
* cs-parser.jay: Track bases for structs. How did I get this wrong?
2002-05-06 Ravi Pratap <ravi@ximian.com>
@@ -787,7 +10806,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
* ecore.cs (FieldExpr): Remove un-needed tests for null, since now
events are always registered FieldBuilders.
-
+
* class.cs (FieldBase): New class shared by Fields
* delegate.cs: If we are a toplevel delegate, use our full name.
@@ -842,7 +10861,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
byte b |= 1 + 2
From the spec:
-
+
x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
to the type of x) if y is implicitly convertible to the type of x,
and the operator is a builtin operator and the return type of the
@@ -861,7 +10880,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
This code could go away when we move to a table driven model, but
i could not come up with a good plan last night.
-
+
2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
* typemanager.cs (CSharpName): reimplementation using regex.
@@ -879,7 +10898,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
not catching sem errors in there. The same process is needed
everywhere else.
(Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
-
+
(Statement.Warning_DeadCodeFound): Factorize code.
(While): Report dead code here too.
@@ -893,7 +10912,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
expression here.
(MakeBoolean): New utility function that resolve, implicitly
converts to boolean and tags the expression.
-
+
(If, Do): Implement dead code elimination.
(While): Implement loop inversion
@@ -921,7 +10940,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
* support.cs: InternalParameters.ParameterDesc variable tmp initialized
with String.Empty.
-
+
2002-04-26 Ravi Pratap <ravi@ximian.com>
* delegate.cs (Define): Fix extremely silly bug where I was
@@ -963,7 +10982,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
(TypeContainer.MemberLookup): Implement using the
TypeManager.MemberLookup now.
-
+
* typemanager.cs: Make MemberLookup a function of the TypeManager,
and return MemberInfos, so that these can be used without an
EmitContext (what we had before).
@@ -1003,7 +11022,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (Argument.Type): Ensure that we return the correct
type when we have out or ref parameters [in which case we
append a "&"].
-
+
2002-04-22 Miguel de Icaza <miguel@ximian.com>
* class.cs (Property, Indexer): Allow extern modifier in there.
@@ -1062,7 +11081,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
(TypeContainer.Targets): The default for attribute types is
AttributeTargets.All.
-
+
* attribute.cs (ApplyAttributes): Registering the attribute type
is done elsewhere, not when we discover we have a Usage attribute.
@@ -1072,7 +11091,7 @@ Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
and get rid of is_delegate parameter.
* everywhere : update.
-
+
2002-04-12 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (compilation_unit): Revamp completely to use
@@ -1205,7 +11224,7 @@ Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
* class.cs (Indexer.CheckBase): Only check if both parents are
non-null.
-
+
* cs-parser.jay (accessor_body): If empty, set to null.
* ecore.cs (SimpleName.SimpleNameResolve): We did not have the
@@ -1282,7 +11301,7 @@ Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
(FindType): Moved LookupInterfaceOrClass here. Moved the
LookupBaseClasses method that used to live in class.cs and
interface.cs here, and renamed to FindType.
-
+
* delegate.cs: Implement DefineType. Take advantage of the
refactored pattern for locating the parent builder without taking
the parent_builder argument (which we know does not work if we are
@@ -1325,8 +11344,8 @@ Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
implementing.DeclaringType.IsInterface)
flags |= MethodAttributes.Final;
- I do not know what I was smoking when I used that.
-
+ I do not know what I was smoking when I used that.
+
* cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
step into fixing the name resolution issues for delegates and
@@ -1555,7 +11574,7 @@ Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs (Invocation.EmitArguments): Fix to emit arguments for
empty param arrays.
-
+
* class.cs (Method.LabelParameters): Fix incorrect code path that
prevented the `ParamArrayAttribute' from being applied to the
params attribute.
@@ -1634,7 +11653,7 @@ Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
Nested interfaces need to be closed after their parents have been
created.
-
+
* interface.cs (InterfaceAttr): Put all the logic for computing
the interface attribute here.
@@ -1645,7 +11664,7 @@ Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-parser.jay: rework foreach statement to work with the new
changes to the policy on SimpleNames.
-
+
* report.cs: support Stacktrace on warnings as well.
* makefile: drop --unsafe and /unsafe from the compile.
@@ -1670,7 +11689,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
performing type lookups, instead of DoResolve, we could have a
ResolveType entry point, and only participating pieces of the
production (simplename, deref, array) would implement this.
-
+
* codegen.cs (EmitContext): New field OnlyLookupTypes used to
signal SimpleName to only resolve type names and not attempt to
resolve anything else.
@@ -1683,7 +11702,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-parser.jay: rework foreach statement to work with the new
changes to the policy on SimpleNames.
-
+
* report.cs: support Stacktrace on warnings as well.
* makefile: drop --unsafe and /unsafe from the compile.
@@ -1748,13 +11767,13 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
(Resolve): Handle the case when we are parsing the special MarshalAs
attribute [we need to store the unmanaged type to use later]
-
+
* typemanager.cs (marshal_as_attr_type): Built in type for the
MarshalAs Attribute.
* attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
on parameters and accordingly set the marshalling info.
-
+
2002-03-09 Miguel de Icaza <miguel@ximian.com>
* class.cs: Optimizing slightly by removing redundant code after
@@ -1771,7 +11790,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
Enums since those are types too.
* cs-parser.jay (enum_declaration): Record enums as we parse them.
-
+
* enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
thanks to a call during the lookup process.
@@ -1823,7 +11842,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
for interfaces
* report.cs: Allow for --fatal to be used with --probe.
-
+
* typemanager.cs (NoTypes): Move the definition for the empty Type
array here.
@@ -1852,14 +11871,14 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
2002-03-04 Miguel de Icaza <miguel@ximian.com>
Constant Folding has been implemented now.
-
+
* expression.cs (Unary.Reduce): Do not throw an exception, catch
the error instead on types that are not supported in one's
complement.
* constant.cs (Constant and all children): New set of functions to
perform implict and explicit conversions.
-
+
* ecore.cs (EnumConstant): Implement the new functions to perform
conversion by proxying to the child expression.
@@ -1881,7 +11900,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
2002-03-01 Miguel de Icaza <miguel@ximian.com>
* cfold.cs: New file, this file contains the constant folder.
-
+
* ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
argument to track whether we are using the resulting address to
load or store a value and provide better error messages.
@@ -2033,7 +12052,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
handling.
Catch DirectoryNotFoundException when calling GetFiles.
-
+
(SplitPathAndPattern): Used to split the input specification into
a path and a pattern that we can feed to Directory.GetFiles.
@@ -2059,12 +12078,12 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
(StackAlloc): Implement stackalloc keyword.
* cs-parser.jay: Add rule to parse stackalloc.
-
+
* driver.cs: Handle /h, /help, /?
* expression.cs (MakeByteBlob): Removed the hacks we had in place
before we supported unsafe code.
-
+
* makefile: add --unsafe to the self compilation of mcs.
2002-02-20 Miguel de Icaza <miguel@ximian.com>
@@ -2077,14 +12096,14 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
address of an array.
(ElementAccess): Implement array access for pointers
-
+
* statement.cs (Fixed): Implement fixed statement for arrays, we
are missing one more case before we are done.
* expression.cs (Indirection): Implement EmitAssign and set the
ExprClass to Variable. This allows pointer dereferences to be
treated as variables, and to have values assigned to them.
-
+
* ecore.cs (Expression.StoreFromPtr): New utility function to
store values dereferencing.
@@ -2306,7 +12325,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
the rules for the special rule on Type/instances. First check if
we have the same name, and if so, try that special static path
rather than the instance path.
-
+
2002-01-18 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Emit 642 (warning: possible empty statement) for
@@ -2416,7 +12435,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
the object type, so we take care of that.
* expression.cs (FullMethodDesc): Also include the return type in descriptions.
-
+
* support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
added to non-params parameters :-)
@@ -2508,7 +12527,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
default_member_type which already exists.
* interface.cs, attribute.cs : Update accordingly.
-
+
2002-01-08 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: Enable IndexerPropertyName again. It does not
@@ -2559,7 +12578,7 @@ Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs (Indexer): Implement explicit interface implementation
for indexers.
-
+
Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs: make the default instance constructor public and hidebysig.
@@ -2602,7 +12621,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
is_base, this is used to determine whether the `call' or
`callvirt' opcode should be used.
-
+
* delegate.cs: update EmitCall.
* class.cs (Method.Define): Set NewSlot for the cases where we are
@@ -2676,7 +12695,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
only.
(Goto): Finally implement this bad boy.
-
+
* cs-parser.jay: Update to reflect new mechanism to implement
labels.
@@ -2733,7 +12752,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
Although we do this check for methods later on in the semantic
analysis, catching repeated default constructors is so easy that
we catch these here.
-
+
* expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
promotions code.
@@ -2774,7 +12793,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* decl.cs: CloseType is now an virtual method, the default
implementation just closes this type.
-
+
2001-12-28 Ravi Pratap <ravi@ximian.com>
* attribute.cs (DefinePInvokeMethod): Set the implementation flags
@@ -2793,7 +12812,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
in overload resolution.
More spec conformance.
-
+
2001-12-27 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Add --timestamp, to see where the compiler spends
@@ -2823,7 +12842,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Binary.Resolve): If types are reference types, then do a cast to
object on operators != and == of both arguments.
-
+
* typemanager.cs (FindMembers): Extract instance and static
members if requested.
@@ -3013,7 +13032,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
* assign.cs : Get rid of EventIsLocal everywhere.
-
+
2001-12-23 Miguel de Icaza <miguel@ximian.com>
* ecore.cs (ConvertIntLiteral): finished the implementation.
@@ -3040,7 +13059,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
resolve the types. This is not really needed, but it helps debugging.
* statement.cs: report location.
-
+
* cs-parser.jay: pass location to throw statement.
* driver.cs: Small bug fix.
@@ -3103,23 +13122,23 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* statement.cs (SwitchLabel): define an ILLabel for each
SwitchLabel.
-
+
(Switch.CheckSwitch): If the value is a Literal, extract
the underlying literal.
-
+
Also in the unused hashtable we had, add the SwitchLabel so we can
quickly look this value up.
* constant.cs: Implement a bunch of new constants. Rewrite
Literal based on this. Made changes everywhere to adapt to this.
-
+
* expression.cs (Expression.MakeByteBlob): Optimize routine by
dereferencing array only once, and also copes with enumrations.
bytes are two bytes wide, not one.
(Cast): Perform constant conversions.
-
+
* ecore.cs (TryImplicitIntConversion): Return literals instead of
wrappers to the literals here.
@@ -3236,12 +13255,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Interface.SemanticAnalysis): Use `this' instead of our parent to
resolve names. Because we need to be resolve in our context, not
our parents.
-
+
* driver.cs: Implement response files.
* class.cs (TypeContainer.DefineType): If we are defined, do not
redefine ourselves.
-
+
(Event.Emit): Emit the code for add/remove handlers.
(Event.Define): Save the MethodBuilders for add/remove.
@@ -3249,10 +13268,10 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-parser.jay: Replaced use of DictionaryEntry for Pair because
DictionaryEntry requires the first argument to be non-null.
-
+
(enum_declaration): Compute full name for registering the
enumeration.
-
+
(delegate_declaration): Instead of using
formal_parameter_list, use opt_formal_parameter_list as the list
can be empty.
@@ -3312,7 +13331,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-tokenizer.cs: Add support for defines.
Add support for #if, #elif, #else, #endif
-
+
(eval_var): evaluates a variable.
(eval): stubbed for evaluating functions.
@@ -3331,7 +13350,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(MemberCore.Define): New abstract method, we will be using this in
the warning reporting engine in Populate.
-
+
(Operator.Define): Adjust to new MemberCore protocol.
* const.cs (Const): This does not derive from Expression, it is a
@@ -3354,7 +13373,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
argument.
* class.cs (Event.Define): The lookup can fail.
-
+
* cs-tokenizer.cs: Begin implementation of pre-procesor.
* expression.cs: Resolve the this instance before invoking the code.
@@ -3367,7 +13386,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
Note that this still does not handle the more complex rules of
casts.
-
+
* delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
@@ -3485,7 +13504,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
2001-12-13 Miguel de Icaza <miguel@ximian.com>
* class.cs (MakeKey): Kill routine.
-
+
* class.cs (TypeContainer.Define): Correctly define explicit
method implementations (they require the full interface name plus
the method name).
@@ -3522,7 +13541,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(TypeContainer.Define): Add support for explicit interface method
implementation.
-
+
2001-12-12 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs: Keep track of the parameters here instead of
@@ -3559,7 +13578,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
LocalBuilder to store the result of the function. ReturnLabel is
the target where we jump.
-
+
2001-12-09 Radek Doulik <rodo@ximian.com>
@@ -3598,7 +13617,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Parameter.ParameterType): The type of the parameter (base,
without ref/out applied).
-
+
(Parameter.Resolve): Perform resolution here.
(Parameter.ExternalType): The full type (with ref/out applied).
@@ -3653,7 +13672,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* attribute.cs (DefinePInvokeMethod): Implement as this is what is called
above to do the task of extracting information and defining the method.
-
+
2001-12-04 Ravi Pratap <ravi@ximian.com>
* expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
@@ -3680,12 +13699,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* statement.cs (GotoDefault), cs-parser.jay: Implement `goto
default'.
-
+
(Foreach.Emit): Foreach on arrays was not setting
up the loop variables (for break/continue).
(GotoCase): Semi-implented.
-
+
2001-12-03 Ravi Pratap <ravi@ximian.com>
* attribute.cs (CheckAttribute): Handle system attributes by using
@@ -3779,10 +13798,10 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* ecore.cs (FieldExpr.EmitAssign): Handle value types specially
(we need to load the address of the field here). This fixes
test-22.
-
+
(FieldExpr.DoResolveLValue): Call the DoResolve
function to initialize the Instance expression.
-
+
* statement.cs (Foreach.Emit): Fix the bug where we did not invoke
correctly the GetEnumerator operation on a value type.
@@ -3869,12 +13888,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* statement.cs (Switch, SwitchSection, SwithLabel): Started work
on Switch statement.
-
+
2001-11-23 Ravi Pratap <ravi@ximian.com>
* typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
the same.
-
+
* expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
parameter. Apparently, any expression is allowed.
@@ -3918,7 +13937,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
Use the grammar productions from Rhys to handle casts (this is
not complete like Rhys syntax yet, we fail to handle that corner
case that C# has regarding (-x), but we will get there.
-
+
2001-11-22 Ravi Pratap <ravi@ximian.com>
* class.cs (EmitFieldInitializer): Take care of the case when we have a
@@ -4094,7 +14113,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs (Property::Define): Register property using TypeManager.RegisterProperty
Test 33 now passes again.
-
+
2001-11-15 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
@@ -4150,7 +14169,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(NewDelegate.DoResolve): Update for Argument.Resolve.
* class.cs (ConstructorInitializer.DoResolve): ditto.
-
+
* attribute.cs (Attribute.Resolve): ditto.
2001-11-13 Miguel de Icaza <miguel@ximian.com>
@@ -4161,7 +14180,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
IAssignMethod instead.
(LocalVariableReference): ditto.
-
+
* ecore.cs (FieldExpr): Drop IStackStorage and implement
IAssignMethod instead.
@@ -4322,13 +14341,13 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Event.Emit): ditto.
Reworked to have less levels of indentation.
-
+
2001-11-08 Ravi Pratap <ravi@ximian.com>
* class.cs (Property): Emit attributes.
(Field): Ditto.
-
+
(Event): Ditto.
(Indexer): Ditto.
@@ -4354,7 +14373,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
2001-11-07 Ravi Pratap <ravi@ximian.com>
* expression.cs (EvalConstantExpression): Move into ecore.cs
-
+
* enum.cs (Enum): Rename some members and make them public and readonly
according to our convention.
@@ -4385,9 +14404,9 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
(Literalize): Revamp a bit to take two arguments.
-
+
(EnumLiteral): New class which derives from Literal to wrap enum literals.
-
+
2001-11-06 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
@@ -4446,7 +14465,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Expression.Reduce): New method used to perform constant folding
and CSE. This is needed to support constant-expressions.
-
+
* statement.cs (Statement.EmitBoolExpression): Pass true and false
targets, and optimize for !x.
@@ -4483,9 +14502,9 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(positional_argument_list, named_argument_list, named_argument): New rules
(attribute_arguments): Use the above so that we are more correct.
-
+
2001-11-02 Ravi Pratap <ravi@ximian.com>
-
+
* expression.cs (Invocation::IsParamsMethodApplicable): Implement
to perform all checks for a method with a params parameter.
@@ -4505,7 +14524,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
use the new class names.
-
+
2001-11-01 Ravi Pratap <ravi@ximian.com>
* class.cs (Method::Define): Complete definition for params types too
@@ -4530,7 +14549,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs : Clean out code which uses the above.
2001-10-31 Ravi Pratap <ravi@ximian.com>
-
+
* typemanager.cs (RegisterMethod): Check if we already have an existing key
and bale out if necessary by returning a false.
@@ -4687,7 +14706,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (New::DoResolve): Implement guts of array creation.
(New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
-
+
2001-10-27 Miguel de Icaza <miguel@ximian.com>
* expression.cs: Fix bug I introduced lsat night that broke
@@ -4695,9 +14714,9 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Expression.Resolve): Report a 246 error (can not resolve name)
if we find a SimpleName in the stream.
-
+
(Expression.ResolveLValue): Ditto.
-
+
(Expression.ResolveWithSimpleName): This function is a variant of
ResolveName, this one allows SimpleNames to be returned without a
warning. The only consumer of SimpleNames is MemberAccess
@@ -4718,7 +14737,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
Threading.Monitor.Exit
-
+
2001-10-23 Miguel de Icaza <miguel@ximian.com>
* expression.cs (IndexerAccess::DoResolveLValue): Set the
@@ -4734,7 +14753,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
and Properties for handling assignment.
(Assign::Emit): Simplify and reuse code.
-
+
* expression.cs (IndexerAccess, PropertyExpr): Implement
IAssignMethod, clean up old code.
@@ -4768,7 +14787,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs (Method::Define): For the case where we are implementing a method
inherited from an interface, we need to set the MethodAttributes.Final flag too.
Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
-
+
2001-10-21 Ravi Pratap <ravi@ximian.com>
* interface.cs (FindMembers): Implement to work around S.R.E
@@ -4795,12 +14814,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* assign.cs (Assign::Resolve): Resolve right hand side first, and
then pass this as a hint to ResolveLValue.
-
+
* expression.cs (FieldExpr): Add Location information
(FieldExpr::LValueResolve): Report assignment to readonly
variable.
-
+
(Expression::ExprClassFromMemberInfo): Pass location information.
(Expression::ResolveLValue): Add new method that resolves an
@@ -4817,12 +14836,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
now is part of Expression.
(ElementAccess): Depending on the element access type
-
+
* typemanager.cs: Add `indexer_name_type' as a Core type
(System.Runtime.CompilerServices.IndexerNameAttribute)
* statement.cs (Goto): Take a location.
-
+
2001-10-18 Ravi Pratap <ravi@ximian.com>
* delegate.cs (Delegate::VerifyDelegate): New method to verify
@@ -4910,7 +14929,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
(Foreach::Emit): Track old being/end loops; Set Begin loop, ack
end loop
-
+
* codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
properties that track the label for the current loop (begin of the
loop and end of the loop).
@@ -4954,7 +14973,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(ConvertReferenceExplicit): Implement array conversion.
(ExplicitReferenceConversionExists): New method to determine precisely that :-)
-
+
2001-10-12 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (delegate_declaration): Store the fully qualified
@@ -4971,7 +14990,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Emit): Emit any code, if necessary. I am not sure about this really, but let's
see.
-
+
(CloseDelegate): Finally creates the delegate.
* class.cs (TypeContainer::DefineType): Update to define delegates.
@@ -5013,7 +15032,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (LValue::LValueResolve): New method in the
interface, used to perform a second resolution pass for LValues.
-
+
(This::DoResolve): Catch the use of this in static methods.
(This::LValueResolve): Implement.
@@ -5034,7 +15053,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* codegen.cs (EmitContext::GetTemporaryStorage): Used to store
value types returned from functions when we need to invoke a
method on the sturcture.
-
+
2001-10-11 Ravi Pratap <ravi@ximian.com>
@@ -5076,14 +15095,14 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
the default constructor.
-
+
(TypeContainer::Populate): Fix minor bug which led to creating default constructors
twice.
(Constructor::IsDefault): Fix up logic to determine if it is the default constructor
* interface.cs (CloseType): Create the type here.
-
+
* rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
the hierarchy.
@@ -5117,12 +15136,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
TypeContainer.
Replaced `l' and `location' for `loc', for consistency.
-
+
(Error, Warning): Remove unneeded Tc argument.
* assign.cs, literal.cs, constant.cs: Update to new calling
convention.
-
+
* codegen.cs: EmitContext now contains a flag indicating whether
code is being generated in a static method or not.
@@ -5165,9 +15184,9 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
* expression.cs (ElementAccess): Implement the LValue interface too.
-
+
2001-10-06 Ravi Pratap <ravi@ximian.com>
-
+
* expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
except that user defined conversions are not included.
@@ -5189,7 +15208,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
corresponding code generation bits to the statement classes.
Added support for try/catch/finalize and throw.
-
+
* cs-parser.jay: Added support for try/catch/finalize.
* class.cs: Catch static methods having the flags override,
@@ -5318,7 +15337,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Unary::report23): Change name to error23 and make first argument a TypeContainer
as I was getting thoroughly confused between this and error19 :-)
-
+
* expression.cs (Expression::ImplicitUserConversion): Re-write fully
(::FindMostEncompassedType): Implement.
(::FindMostEncompassingType): Implement.
@@ -5394,10 +15413,10 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
2001-10-01 Ravi Pratap <ravi@ximian.com>
* expression.cs (Expression::ImplicitUserConversion): Use location
- even in the case when we are examining True operators.
+ even in the case when we are examining True operators.
- * class.cs (Operator::Define): Perform extensive checks to conform
- with the rules for operator overloading in the spec.
+ * class.cs (Operator::Define): Perform extensive checks to conform
+ with the rules for operator overloading in the spec.
* expression.cs (Expression::ImplicitReferenceConversion): Implement
some of the other conversions mentioned in the spec.
@@ -5457,7 +15476,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-parser.jay: Pass location information for various new
constructs.
-
+
* delegate.cs (Delegate): take a location argument.
* driver.cs: Do not call EmitCode if there were problesm in the
@@ -5472,7 +15491,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* rootcontext.cs: Provide better information about the location of
failure when CreateType fails.
-
+
2001-09-29 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs (RootContext::PopulateTypes): Populates structs
@@ -5550,12 +15569,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
convert from an Int to a Short use an OpcodeCast', not
`To convert from an Int to a Short use the OpcodeCast on
the variable 5' (which is what this patch was doing).
-
+
2001-09-28 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation::ConversionExists): Re-write to use
the conversion cache
-
+
(Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
cache all conversions done, not just user-defined ones.
@@ -5570,12 +15589,12 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (ConvertImplicit): Use a cache for conversions
already found. Check level of recursion and bail out if necessary.
-
+
2001-09-28 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (string_concat_string_string, string_concat_object_object):
Export standard methods that we expect for string operations.
-
+
* statement.cs (Block::UsageWarning): Track usage of variables and
report the errors for not used variables.
@@ -5610,7 +15629,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(UserImplicitCast::Resolve): Eliminate, objects of type
UserImplicitCast are born in a fully resolved state.
-
+
* typemanager.cs (InitCoreTypes): Init also value_type
(System.ValueType).
@@ -5644,10 +15663,10 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(ParameterReference::Emit, ::Store): same.
(FieldExpr::AddressOf): Implement.
-
+
* typemanager.cs: TypeManager: made public variable instead of
property.
-
+
* driver.cs: document --fatal.
* report.cs (ErrorMessage, WarningMessage): new names for the old
@@ -5687,7 +15706,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
we have to convert to bool types. Not complete yet.
-
+
2001-09-27 Miguel de Icaza <miguel@ximian.com>
* typemanager.cs (TypeManager::CSharpName): support ushort.
@@ -5702,7 +15721,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Invocation::Emit): If InstanceExpression is null, then it means
that we perform a call on this.
-
+
2001-09-26 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Unary::Emit): Remove some dead code.
@@ -5728,7 +15747,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs (Operator): Update the operator names to reflect the
ones that the spec expects (as we are just stringizing the
operator names).
-
+
* expression.cs (Unary::ResolveOperator): Fix bug: Use
MethodInfo's ReturnType instead of LookupMethodByBuilder as the
previous usage did only work for our methods.
@@ -5744,7 +15763,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Binary::ResolveOperator): ditto.
(Invocation::ConversionExists): ditto.
(UserImplicitCast::Resolve): ditto.
-
+
2001-09-26 Ravi Pratap <ravi@ximian.com>
* expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
@@ -5805,17 +15824,17 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
pass (Bytes) or the wrong argument will be selected.
* expression.cs (Unary::Emit): Emit code for -expr.
-
+
(Unary::ResolveOperator): Handle `Substract' for non-constants
(substract from zero from the non-constants).
Deal with Doubles as well.
-
+
(Expression::ConvertImplicitRequired): New routine that reports an
error if no implicit conversion exists.
(Invocation::OverloadResolve): Store the converted implicit
expressions if we make them
-
+
2001-09-24 Ravi Pratap <ravi@ximian.com>
* class.cs (ConstructorInitializer): Take a Location argument.
@@ -5852,7 +15871,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
a given method.
-
+
2001-09-21 Ravi Pratap <ravi@ximian.com>
* expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
@@ -5884,10 +15903,10 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Unary::ResolveOperator): Implement ++, !, ~,
(Invocation::Emit): Deal with new Emit convetion.
-
+
* All Expression derivatives: Updated their Emit method to return
whether they leave values on the stack or not.
-
+
* codegen.cs (CodeGen::EmitStatement): Pop values left on the
stack for expressions that are statements.
@@ -5897,7 +15916,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
LValue objects.
(LocalVariableReference, ParameterReference, FieldExpr): Implement
LValue interface.
-
+
* assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
interface for generating code, simplifies the code.
@@ -6057,7 +16076,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (Binary::Emit): Comment out code path to emit method
invocation stuff for the case when we have a user defined operator. I am
just not able to get it right !
-
+
2001-09-17 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Expression::OverloadResolve): Drop TypeContainer
@@ -6087,7 +16106,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
default constructors if none was provided.
(ConstructorInitializer): Add methods Resolve and Emit.
-
+
* expression.cs: Cast to ConstructorInfo instead of MethodInfo
2001-09-17 Ravi Pratap <ravi@ximian.com>
@@ -6123,7 +16142,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* expression.cs (Binary::Emit): Update to emit the appropriate code for
the case when we have a user-defined operator.
-
+
2001-09-17 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: Fix bug: tree.Namespaces might be null.
@@ -6179,7 +16198,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
FamORAssem, not FamANDAssem.
-
+
2001-09-14 Miguel de Icaza <miguel@ximian.com>
* driver.cs: Added --parse option that only parses its input files
@@ -6220,7 +16239,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
of top-level types as claimed.
-
+
2001-09-13 Miguel de Icaza <miguel@ximian.com>
* expression.cs (MemberLookup): Fruitless attempt to lookup
@@ -6332,7 +16351,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(OpcodeCast): New type for casts of types that are performed with
a sequence of bytecodes.
-
+
(BoxedCast): New type used for casting value types into reference
types. Emits a box opcode.
@@ -6342,7 +16361,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Binary::EmitBranchable): Optimization.
(Binary::Emit): Implement code emission for expressions.
-
+
* typemanager.cs (TypeManager): Added two new core types: sbyte
and byte.
@@ -6383,7 +16402,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Indexer::Define): Ditto.
(Event::Define): Ditto.
(Property::Define): Ditto.
-
+
2001-09-10 Ravi Pratap <ravi@ximian.com>
* class.cs (TypeContainer::Populate): Now define operators too.
@@ -6407,7 +16426,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
for the get and set accessors.
(Indexer::Define): Implement.
-
+
2001-09-09 Miguel de Icaza <miguel@ximian.com>
* expression.cs (Binary::Resolve): Beginning of it. I scratched
@@ -6464,7 +16483,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(BaseAccess): New class for expressions of the type 'base access.'
(CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
respectively.
-
+
* cs-parser.jay (element_access): Implement action.
(base_access): Implement actions.
(checked_expression, unchecked_expression): Implement.
@@ -6478,13 +16497,13 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
name and the specifiers.
* interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
-
+
* rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
making them all public ;-)
* cs-parser.jay (error): Remove entirely as we have an implementation in the base
class anyways.
-
+
2001-09-07 Miguel de Icaza <miguel@ximian.com>
* expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
@@ -6523,14 +16542,14 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(event_declaration): Ditto.
(enum_declaration): Ditto.
(indexer_declaration): Ditto.
-
+
* class.cs (Operator::Operator): Update constructor accordingly.
(Event::Event): Ditto.
* delegate.cs (Delegate::Delegate): Same here.
* enum.cs (Enum::Enum): Same here.
-
+
2001-09-05 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
@@ -6550,14 +16569,14 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(parameter_array): Ditto.
(property_declaration): Ditto.
(destructor_declaration): Ditto.
-
+
* class.cs (Struct::Struct): Update constructors accordingly.
(Class::Class): Ditto.
(Field::Field): Ditto.
(Method::Method): Ditto.
(Property::Property): Ditto.
(TypeContainer::OptAttribute): update property's return type.
-
+
* interface.cs (Interface.opt_attributes): New member.
(Interface::Interface): Update to take the extra Attributes argument.
@@ -6614,14 +16633,14 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
a Type.
(Invocation::Resolve): Begin implementing resolution of invocations.
-
+
* literal.cs (StringLiteral): Implement Emit.
2001-09-05 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (error): Add new modifier because we are hiding an inherited
member.
-
+
2001-09-04 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (attribute_arguments): Implement actions.
@@ -6641,7 +16660,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(attribute_section): Modify production to use 2 different rules to
achieve the same thing. 1 s/r conflict down !
Clean out commented, useless, non-reducing dimension_separator rules.
-
+
* class.cs (TypeContainer.attributes): New member to hold list
of attributes for a type.
(Struct::Struct): Modify to take one more argument, the attribute list.
@@ -6649,7 +16668,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Field::Field): Ditto.
(Method::Method): Ditto.
(Property::Property): Ditto.
-
+
* cs-parser.jay (struct_declaration): Update constructor call to
pass in the attributes too.
(class_declaration): Ditto.
@@ -6740,7 +16759,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
define all enumerations.
* enum.cs (Define): Implement.
-
+
2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
* cs-parser.jay (overloadable_operator): The semantic value is an
@@ -6782,7 +16801,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
Hooray, try and catch statements parse fine !
-
+
2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
* statement.cs (Block::GetVariableType): Fix logic to extract the type
@@ -6858,7 +16877,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-parser.jay (array_creation_expression): Implement to call
the overloaded New constructor.
-
+
2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
* class.cs (TypeContainer::Constructors): Return member
@@ -6878,14 +16897,14 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* codegen.cs, cs-parser.jay: Fixed the bug that stopped code
generation from working. Also add some temporary debugging
code.
-
+
2001-08-24 Miguel de Icaza <miguel@ximian.com>
* codegen.cs: Lots of code generation pieces. This is only the
beginning, will continue tomorrow with more touches of polish. We
handle the fundamentals of if, while, do, for, return. Others are
trickier and I need to start working on invocations soon.
-
+
* gen-treedump.cs: Bug fix, use s.Increment here instead of
s.InitStatement.
@@ -6933,7 +16952,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(TypeContainer::EmitMethod): New method. Emits methods.
* expression.cs: Removed MethodGroup class from here.
-
+
* parameter.cs (Parameters::GetCallingConvention): new method.
2001-08-21 Miguel de Icaza <miguel@ximian.com>
@@ -6944,7 +16963,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(Constructor::CallingConvention): Returns the calling convention.
(Constructor::ParameterTypes): Returns the constructor parameter
types.
-
+
(TypeContainer::AddConstructor): Keep track of default constructor
and the default static constructor.
@@ -6964,7 +16983,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(constructor_declarator): If there is no implicit `base' or
`this', then invoke the default parent constructor.
-
+
* modifiers.cs (MethodAttr): New static function maps a set of
modifiers flags into a MethodAttributes enum
(FieldAttr): renamed from `Map'. So now we have FieldAttr,
@@ -7022,16 +17041,16 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* rootcontext.cs (LookupType): New function. Used to locate types
-
+
2001-08-08 Miguel de Icaza <miguel@ximian.com>
* rootcontext.cs: OH MY! My trick works! It is amazing how nice
this System.Reflection code is. Kudos to Microsoft
-
+
* typemanager.cs: Implement a type cache and avoid loading all
types at boot time. Wrap in LookupType the internals. This made
the compiler so much faster. Wow. I rule!
-
+
* driver.cs: Make sure we always load mscorlib first (for
debugging purposes, nothing really important).
@@ -7075,7 +17094,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(ResolveTree): Encapsulated all the tree resolution here.
(CreateClass, GetClassBases, GetInterfaceOrClass): Create class
types.
-
+
* driver.cs: Add support for --nostdlib, to avoid loading the
default assemblies.
(Main): Do not put tree resolution here.
@@ -7090,7 +17109,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* rootcontext.cs (CreateInterface): Handle the case where there
are no parent interfaces.
-
+
(CloseTypes): Routine to flush types at the end.
(CreateInterface): Track types.
(GetInterfaces): Returns an array of Types from the list of
@@ -7099,7 +17118,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* typemanager.c (AddUserType): Mechanism to track user types (puts
the type on the global type hash, and allows us to close it at the
end).
-
+
2001-08-02 Miguel de Icaza <miguel@ximian.com>
* tree.cs: Removed RecordType, added RecordClass, RecordStruct and
@@ -7130,7 +17149,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
(enum_body): Put an opt_comma here instead of putting it on
enum_body or enum_member_declarations so we can handle trailing
commas on enumeration members. Gets rid of a shift/reduce.
-
+
(type_list): Need a COMMA in the middle.
(indexer_declaration): Tell tokenizer to recognize get/set
@@ -7143,7 +17162,7 @@ Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
* cs-parser.jay: Add precendence rules for a number of operators
ot reduce the number of shift/reduce conflicts in the grammar.
-
+
2001-07-17 Miguel de Icaza <miguel@ximian.com>
* tree.cs: moved IGenerator interface and renamed it to ITreeDump
diff --git a/mcs/mcs/CryptoConvert.cs b/mcs/mcs/CryptoConvert.cs
new file mode 100755
index 00000000000..058fe091730
--- /dev/null
+++ b/mcs/mcs/CryptoConvert.cs
@@ -0,0 +1,406 @@
+//
+// CryptoConvert.cs - Crypto Convertion Routines
+//
+// Author:
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2004 Novell (http://www.novell.com)
+//
+
+using System;
+using System.Globalization;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace Mono.Security.Cryptography {
+
+#if INSIDE_CORLIB
+ internal
+#else
+ public
+#endif
+ sealed class CryptoConvert {
+
+ private CryptoConvert ()
+ {
+ }
+
+ static private int ToInt32LE (byte [] bytes, int offset)
+ {
+ return (bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset];
+ }
+
+ static private uint ToUInt32LE (byte [] bytes, int offset)
+ {
+ return (uint)((bytes [offset+3] << 24) | (bytes [offset+2] << 16) | (bytes [offset+1] << 8) | bytes [offset]);
+ }
+
+ static private byte [] GetBytesLE (int val)
+ {
+ return new byte [] {
+ (byte) (val & 0xff),
+ (byte) ((val >> 8) & 0xff),
+ (byte) ((val >> 16) & 0xff),
+ (byte) ((val >> 24) & 0xff)
+ };
+ }
+
+ static private byte[] Trim (byte[] array)
+ {
+ for (int i=0; i < array.Length; i++) {
+ if (array [i] != 0x00) {
+ byte[] result = new byte [array.Length - i];
+ Buffer.BlockCopy (array, i, result, 0, result.Length);
+ return result;
+ }
+ }
+ return null;
+ }
+
+ // convert the key from PRIVATEKEYBLOB to RSA
+ // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/Security/private_key_blobs.asp
+ // e.g. SNK files, PVK files
+ static public RSA FromCapiPrivateKeyBlob (byte[] blob)
+ {
+ return FromCapiPrivateKeyBlob (blob, 0);
+ }
+
+ static public RSA FromCapiPrivateKeyBlob (byte[] blob, int offset)
+ {
+ if (blob == null)
+ throw new ArgumentNullException ("blob");
+ if (offset >= blob.Length)
+ throw new ArgumentException ("blob is too small.");
+
+ try {
+ if ((blob [offset] != 0x07) || // PRIVATEKEYBLOB (0x07)
+ (blob [offset+1] != 0x02) || // Version (0x02)
+ (blob [offset+2] != 0x00) || // Reserved (word)
+ (blob [offset+3] != 0x00) ||
+ (ToUInt32LE (blob, offset+8) != 0x32415352)) // DWORD magic = RSA2
+ throw new CryptographicException ("Invalid blob header");
+
+ // ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)
+ int algId = ToInt32LE (blob, offset+4);
+
+ // DWORD bitlen
+ int bitLen = ToInt32LE (blob, offset+12);
+
+ // DWORD public exponent
+ RSAParameters rsap = new RSAParameters ();
+ byte[] exp = new byte [4];
+ Buffer.BlockCopy (blob, offset+16, exp, 0, 4);
+ Array.Reverse (exp);
+ rsap.Exponent = Trim (exp);
+
+ int pos = offset+20;
+ // BYTE modulus[rsapubkey.bitlen/8];
+ int byteLen = (bitLen >> 3);
+ rsap.Modulus = new byte [byteLen];
+ Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);
+ Array.Reverse (rsap.Modulus);
+ pos += byteLen;
+
+ // BYTE prime1[rsapubkey.bitlen/16];
+ int byteHalfLen = (byteLen >> 1);
+ rsap.P = new byte [byteHalfLen];
+ Buffer.BlockCopy (blob, pos, rsap.P, 0, byteHalfLen);
+ Array.Reverse (rsap.P);
+ pos += byteHalfLen;
+
+ // BYTE prime2[rsapubkey.bitlen/16];
+ rsap.Q = new byte [byteHalfLen];
+ Buffer.BlockCopy (blob, pos, rsap.Q, 0, byteHalfLen);
+ Array.Reverse (rsap.Q);
+ pos += byteHalfLen;
+
+ // BYTE exponent1[rsapubkey.bitlen/16];
+ rsap.DP = new byte [byteHalfLen];
+ Buffer.BlockCopy (blob, pos, rsap.DP, 0, byteHalfLen);
+ Array.Reverse (rsap.DP);
+ pos += byteHalfLen;
+
+ // BYTE exponent2[rsapubkey.bitlen/16];
+ rsap.DQ = new byte [byteHalfLen];
+ Buffer.BlockCopy (blob, pos, rsap.DQ, 0, byteHalfLen);
+ Array.Reverse (rsap.DQ);
+ pos += byteHalfLen;
+
+ // BYTE coefficient[rsapubkey.bitlen/16];
+ rsap.InverseQ = new byte [byteHalfLen];
+ Buffer.BlockCopy (blob, pos, rsap.InverseQ, 0, byteHalfLen);
+ Array.Reverse (rsap.InverseQ);
+ pos += byteHalfLen;
+
+ // ok, this is hackish but CryptoAPI support it so...
+ // note: only works because CRT is used by default
+ // http://bugzilla.ximian.com/show_bug.cgi?id=57941
+ rsap.D = new byte [byteLen]; // must be allocated
+ if (pos + byteLen + offset <= blob.Length) {
+ // BYTE privateExponent[rsapubkey.bitlen/8];
+ Buffer.BlockCopy (blob, pos, rsap.D, 0, byteLen);
+ Array.Reverse (rsap.D);
+ }
+
+ RSA rsa = (RSA)RSA.Create ();
+ rsa.ImportParameters (rsap);
+ return rsa;
+ }
+ catch (Exception e) {
+ throw new CryptographicException ("Invalid blob.", e);
+ }
+ }
+
+ static public byte[] ToCapiPrivateKeyBlob (RSA rsa)
+ {
+ RSAParameters p = rsa.ExportParameters (true);
+ int keyLength = p.Modulus.Length; // in bytes
+ byte[] blob = new byte [20 + (keyLength << 2) + (keyLength >> 1)];
+
+ blob [0] = 0x07; // Type - PRIVATEKEYBLOB (0x07)
+ blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02)
+ // [2], [3] // RESERVED - Always 0
+ blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)
+ blob [8] = 0x52; // Magic - RSA2 (ASCII in hex)
+ blob [9] = 0x53;
+ blob [10] = 0x41;
+ blob [11] = 0x32;
+
+ byte[] bitlen = GetBytesLE (keyLength << 3);
+ blob [12] = bitlen [0]; // bitlen
+ blob [13] = bitlen [1];
+ blob [14] = bitlen [2];
+ blob [15] = bitlen [3];
+
+ // public exponent (DWORD)
+ int pos = 16;
+ int n = p.Exponent.Length;
+ while (n > 0)
+ blob [pos++] = p.Exponent [--n];
+ // modulus
+ pos = 20;
+ byte[] part = p.Modulus;
+ int len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+ pos += len;
+ // private key
+ part = p.P;
+ len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+ pos += len;
+
+ part = p.Q;
+ len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+ pos += len;
+
+ part = p.DP;
+ len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+ pos += len;
+
+ part = p.DQ;
+ len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+ pos += len;
+
+ part = p.InverseQ;
+ len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+ pos += len;
+
+ part = p.D;
+ len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+
+ return blob;
+ }
+
+ static public RSA FromCapiPublicKeyBlob (byte[] blob)
+ {
+ return FromCapiPublicKeyBlob (blob, 0);
+ }
+
+ static public RSA FromCapiPublicKeyBlob (byte[] blob, int offset)
+ {
+ if (blob == null)
+ throw new ArgumentNullException ("blob");
+ if (offset >= blob.Length)
+ throw new ArgumentException ("blob is too small.");
+
+ try {
+ if ((blob [offset] != 0x06) || // PUBLICKEYBLOB (0x06)
+ (blob [offset+1] != 0x02) || // Version (0x02)
+ (blob [offset+2] != 0x00) || // Reserved (word)
+ (blob [offset+3] != 0x00) ||
+ (ToUInt32LE (blob, offset+8) != 0x31415352)) // DWORD magic = RSA1
+ throw new CryptographicException ("Invalid blob header");
+
+ // ALGID (CALG_RSA_SIGN, CALG_RSA_KEYX, ...)
+ int algId = ToInt32LE (blob, offset+4);
+
+ // DWORD bitlen
+ int bitLen = ToInt32LE (blob, offset+12);
+
+ // DWORD public exponent
+ RSAParameters rsap = new RSAParameters ();
+ rsap.Exponent = new byte [3];
+ rsap.Exponent [0] = blob [offset+18];
+ rsap.Exponent [1] = blob [offset+17];
+ rsap.Exponent [2] = blob [offset+16];
+
+ int pos = offset+20;
+ // BYTE modulus[rsapubkey.bitlen/8];
+ int byteLen = (bitLen >> 3);
+ rsap.Modulus = new byte [byteLen];
+ Buffer.BlockCopy (blob, pos, rsap.Modulus, 0, byteLen);
+ Array.Reverse (rsap.Modulus);
+
+ RSA rsa = (RSA)RSA.Create ();
+ rsa.ImportParameters (rsap);
+ return rsa;
+ }
+ catch (Exception e) {
+ throw new CryptographicException ("Invalid blob.", e);
+ }
+ }
+
+ static public byte[] ToCapiPublicKeyBlob (RSA rsa)
+ {
+ RSAParameters p = rsa.ExportParameters (false);
+ int keyLength = p.Modulus.Length; // in bytes
+ byte[] blob = new byte [20 + keyLength];
+
+ blob [0] = 0x06; // Type - PUBLICKEYBLOB (0x06)
+ blob [1] = 0x02; // Version - Always CUR_BLOB_VERSION (0x02)
+ // [2], [3] // RESERVED - Always 0
+ blob [5] = 0x24; // ALGID - Always 00 24 00 00 (for CALG_RSA_SIGN)
+ blob [8] = 0x52; // Magic - RSA1 (ASCII in hex)
+ blob [9] = 0x53;
+ blob [10] = 0x41;
+ blob [11] = 0x31;
+
+ byte[] bitlen = GetBytesLE (keyLength << 3);
+ blob [12] = bitlen [0]; // bitlen
+ blob [13] = bitlen [1];
+ blob [14] = bitlen [2];
+ blob [15] = bitlen [3];
+
+ // public exponent (DWORD)
+ int pos = 16;
+ int n = p.Exponent.Length;
+ while (n > 0)
+ blob [pos++] = p.Exponent [--n];
+ // modulus
+ pos = 20;
+ byte[] part = p.Modulus;
+ int len = part.Length;
+ Array.Reverse (part, 0, len);
+ Buffer.BlockCopy (part, 0, blob, pos, len);
+ pos += len;
+ return blob;
+ }
+
+ // PRIVATEKEYBLOB
+ // PUBLICKEYBLOB
+ static public RSA FromCapiKeyBlob (byte[] blob)
+ {
+ return FromCapiKeyBlob (blob, 0);
+ }
+
+ static public RSA FromCapiKeyBlob (byte[] blob, int offset)
+ {
+ if (blob == null)
+ throw new ArgumentNullException ("blob");
+ if (offset >= blob.Length)
+ throw new ArgumentException ("blob is too small.");
+
+ switch (blob [offset]) {
+ case 0x00:
+ // this could be a public key inside an header
+ // like "sn -e" would produce
+ if (blob [offset + 12] == 0x06) {
+ return FromCapiPublicKeyBlob (blob, offset + 12);
+ }
+ break;
+ case 0x06:
+ return FromCapiPublicKeyBlob (blob, offset);
+ case 0x07:
+ return FromCapiPrivateKeyBlob (blob, offset);
+ }
+ throw new CryptographicException ("Unknown blob format.");
+ }
+
+ static public byte[] ToCapiKeyBlob (AsymmetricAlgorithm keypair, bool includePrivateKey)
+ {
+ if (keypair == null)
+ throw new ArgumentNullException ("keypair");
+
+ // check between RSA and DSA (and potentially others like DH)
+ if (keypair is RSA)
+ return ToCapiKeyBlob ((RSA)keypair, includePrivateKey);
+ else
+ return null; // TODO
+ }
+
+ static public byte[] ToCapiKeyBlob (RSA rsa, bool includePrivateKey)
+ {
+ if (rsa == null)
+ throw new ArgumentNullException ("rsa");
+
+ RSAParameters p = rsa.ExportParameters (includePrivateKey);
+ if (includePrivateKey)
+ return ToCapiPrivateKeyBlob (rsa);
+ else
+ return ToCapiPublicKeyBlob (rsa);
+ }
+
+ static public string ToHex (byte[] input)
+ {
+ if (input == null)
+ return null;
+
+ StringBuilder sb = new StringBuilder (input.Length * 2);
+ foreach (byte b in input) {
+ sb.Append (b.ToString ("X2", CultureInfo.InvariantCulture));
+ }
+ return sb.ToString ();
+ }
+
+ static private byte FromHexChar (char c)
+ {
+ if ((c >= 'a') && (c <= 'f'))
+ return (byte) (c - 'a' + 10);
+ if ((c >= 'A') && (c <= 'F'))
+ return (byte) (c - 'A' + 10);
+ if ((c >= '0') && (c <= '9'))
+ return (byte) (c - '0');
+ throw new ArgumentException ("invalid hex char");
+ }
+
+ static public byte[] FromHex (string hex)
+ {
+ if (hex == null)
+ return null;
+ if ((hex.Length & 0x1) == 0x1)
+ throw new ArgumentException ("Length must be a multiple of 2");
+
+ byte[] result = new byte [hex.Length >> 1];
+ int n = 0;
+ int i = 0;
+ while (n < result.Length) {
+ result [n] = (byte) (FromHexChar (hex [i++]) << 4);
+ result [n++] += FromHexChar (hex [i++]);
+ }
+ return result;
+ }
+ }
+}
diff --git a/mcs/mcs/Makefile b/mcs/mcs/Makefile
new file mode 100644
index 00000000000..45b0668c2b1
--- /dev/null
+++ b/mcs/mcs/Makefile
@@ -0,0 +1,71 @@
+thisdir := mcs
+SUBDIRS :=
+include ../build/rules.make
+
+BUILT_SOURCES = cs-parser.cs
+
+EXTRA_DISTFILES = \
+ compiler.csproj \
+ compiler.doc \
+ compiler.sln \
+ cs-parser.jay \
+ mcs.exe.config \
+ NOTES \
+ TODO
+
+PROGRAM = mcs.exe
+PROGRAM_COMPILE = $(BOOT_COMPILE)
+PROGRAM_INSTALL_DIR = $(prefix)/lib/mono/1.0
+
+CLEAN_FILES = y.output
+
+cs-parser.cs: cs-parser.jay $(topdir)/jay/skeleton.cs
+ $(topdir)/jay/jay -ctv < $(topdir)/jay/skeleton.cs $< > jay-tmp.out && mv jay-tmp.out $@
+
+include ../build/executable.make
+
+# Testing targets
+
+TIME = time
+
+# This used to be called test, but that conflicts with the global
+# recursive target.
+
+btest: mcs2.exe mcs3.exe
+ ls -l mcs2.exe mcs3.exe
+
+mcs2.exe: mcs.exe
+ $(TIME) $(RUNTIME) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
+
+mcs3.exe: mcs2.exe
+ $(TIME) $(RUNTIME) ./mcs2.exe $(USE_MCS_FLAGS) /target:exe /out:$@ $(BUILT_SOURCES) @$(response)
+
+wc:
+ wc -l $(BUILT_SOURCES) `cat $(sourcefile)`
+
+ctest:
+ rm -f mcs2.exe mcs3.exe
+ $(MAKE) USE_MCS_FLAGS= btest
+
+# we need this because bash tries to use its own crappy timer
+FRIENDLY_TIME = $(shell which time) -f'%U seconds'
+
+do-time : mcs.exe
+ @ echo -n "Run 1: "
+ @ rm -f mcs2.exe
+ @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs2.exe > /dev/null || (echo FAILED; exit 1)
+ @ echo -n "Run 2: "
+ @ rm -f mcs3.exe
+ @ $(MAKE) TIME="$(FRIENDLY_TIME)" mcs3.exe > /dev/null || (echo FAILED; exit 1)
+ @ $(MAKE) do-corlib
+
+do-corlib:
+ @ echo -n "corlib: "
+ @ rm -f ../class/lib/mscorlib.dll
+ @ cd ../class/corlib ; $(MAKE) BOOTSTRAP_MCS="$(FRIENDLY_TIME) mono ../../mcs/mcs.exe" > /dev/null || (echo FAILED; exit 1)
+
+PROFILER=default
+
+profile : mcs.exe
+ $(RUNTIME) --profile=$(PROFILER) ./mcs.exe $(USE_MCS_FLAGS) /target:exe /out:mcs2.exe $(BUILT_SOURCES) @$(response)
+
diff --git a/mcs/mcs/NOTES b/mcs/mcs/NOTES
new file mode 100644
index 00000000000..ccae274939a
--- /dev/null
+++ b/mcs/mcs/NOTES
@@ -0,0 +1,38 @@
+* Notes on improving error handling in MCS
+ (from Axel Schreiner <ats@cs.rit.edu>)
+
+
+I included the 'recover' example with C# as well. Currently the package
+is at <http://www.cs.rit.edu/~ats/projects/jay/>. I did change some
+names and the embedding that the user does somewhat, i.e., it is not
+directly compatible with what you did.
+
+Here is the important part about error recovery. To make the typical
+iterations bullet-proof, code them as follows:
+
+opt : // null
+ | opt WORD { yyErrorFlag = 0; }
+ | opt error
+
+seq : WORD
+ | seq WORD { yyErrorFlag = 0; }
+ | error
+ | seq error
+
+list : WORD
+ | list ',' WORD { yyErrorFlag = 0; }
+ | error
+ | list error
+ | list error WORD { yyErrorFlag = 0; }
+ | list ',' error
+
+i.e., throw in 'error' wherever a token can be. 'yyErrorFlag' need not
+be set to zero, but if it is done this way, second errors are caught
+earlier. This may introduce s/r conflicts, but they tend to be harmless.
+
+In your case -- the comment concerning error recovery at the beginning
+of your compiler jay file -- just adding 'error' to the different
+global things won't work. Your example will already have started to
+advance in one of the rules and 'error' is then not in the lookahead of
+wherever the parse then is. You need to put 'error' into the iteration
+above those global things. \ No newline at end of file
diff --git a/mcs/mcs/OTODO b/mcs/mcs/OTODO
new file mode 100644
index 00000000000..ee2cc56f831
--- /dev/null
+++ b/mcs/mcs/OTODO
@@ -0,0 +1,239 @@
+---- This is a list of old tasks, just here for historical value ----
+
+Open question:
+ Create a toplevel block for anonymous methods?
+
+Anonymous Methods
+-----------------
+
+ Plan:
+
+ * Resolve anonymous methods before.
+ * Each time a Local matches, if the mode is `InAnonymous', flag
+ the VariableInfo for `proxying'.
+ * During Resolve track the depth required for local variables.
+ * Before Emit, create proxy classes with proper depth.
+ * Emit.
+
+Notes on memory allocation
+--------------------------
+
+ Outdated:
+
+ A run of the AllocationProfile shows that the compiler allocates roughly
+ 30 megabytes of strings. From those, 20 megabytes come from
+ LookupType.
+
+ See the notes on current_container problems below on memory usage.
+
+LookupTypeReflection:
+---------------------
+
+ With something like `System.Object', LookupTypeReflection will be called
+ twice: once to find out that `System' is not a type and once
+ for System.Object.
+
+ This is required because System.Reflection requires that the type/nested types are
+ not separated by a dot but by a plus sign.
+
+ A nested class would be My+Class (My being the toplevel, Class the nested one).
+
+ It is interesting to look at the most called lookups when bootstrapping MCS:
+
+ 647 LTR: ArrayList
+ 713 LTR: System.Globalization
+ 822 LTR: System.Object+Expression
+ 904 LTR: Mono.CSharp.ArrayList
+ 976 LTR: System.Runtime.CompilerServices
+ 999 LTR: Type
+ 1118 LTR: System.Runtime
+ 1208 LTR: Mono.CSharp.Type
+ 1373 LTR: Mono.Languages
+ 1599 LTR: System.Diagnostics
+ 2036 LTR: System.Text
+ 2302 LTR: System.Reflection.Emit
+ 2515 LTR: System.Collections
+ 4527 LTR: System.Reflection
+ 22273 LTR: Mono.CSharp
+ 24245 LTR: System
+ 27005 LTR: Mono
+
+ Analysis:
+ The top 9 lookups are done for things which are not types.
+
+ Mono.CSharp.Type happens to be a common lookup: the class Type
+ used heavily in the compiler in the default namespace.
+
+ RED FLAG:
+
+ Then `Type' is looked up alone a lot of the time, this happens
+ in parameter declarations and am not entirely sure that this is
+ correct (FindType will pass to LookupInterfaceOrClass a the current_type.FullName,
+ which for some reason is null!). This seems to be a problem with a lost
+ piece of context during FindType.
+
+ System.Object is also used a lot as a toplevel class, and we assume it will
+ have children, we should just shortcut this.
+
+ A cache:
+
+ Adding a cache and adding a catch for `System.Object' to flag that it wont be the
+ root of a hierarchy reduced the MCS bootstrap time from 10.22 seconds to 8.90 seconds.
+
+ This cache is currently enabled with SIMPLE_SPEEDUP in typemanager.cs. Memory consumption
+ went down from 74 megs to 65 megs with this change.
+
+Major tasks:
+------------
+
+ Pinned and volatile require type modifiers that can not be encoded
+ with Reflection.Emit.
+
+* Revisit
+
+ Primary-expression, as it has now been split into
+ non-array-creation-expression and array-creation-expression.
+
+* Emit `pinned' for pinned local variables.
+
+ Both `modreq' and pinned will require special hacks in the compiler.
+
+* Make sure that we are pinning the right variable
+
+* local_variable_declaration
+
+ Not sure that this grammar is correct, we might have to
+ resolve this during semantic analysis.
+
+* Optimizations
+
+ In Indexers and Properties, probably support an EmitWithDup
+ That emits the code to call Get and then leaves a this pointer
+ in the stack, so that later a Store can be emitted using that
+ this pointer (consider Property++ or Indexer++)
+
+* Use of local temporary in UnaryMutator
+
+ We should get rid of the Localtemporary there for some cases
+
+ This turns out to be very complex, at least for the post-version,
+ because this case:
+
+ a = i++
+
+ To produce optimal code, it is necessary for UnaryMutator to know
+ that it is being assigned to a variable (the way the stack is laid
+ out using dup requires the store to happen inside UnaryMutator).
+
+* Interface indexers
+
+ I have not figured out why the Microsoft version puts an
+ `instance' attribute, and I am not generating this `instance' attribute.
+
+ Explanation: The reason for the `instance' attribute on
+ indexers is that indexers only apply to instances
+
+* Check for Final when overriding, if the parent is Final, then we cant
+ allow an override.
+
+ Implement base indexer access.
+
+current_container/current_namespace and the DeclSpace
+-----------------------------------------------------
+
+ We are storing fully qualified names in the DeclSpace instead of the node,
+ this is because `current_namespace' (Namepsace) is not a DeclSpace like
+ `current_container'.
+
+ The reason for storing the full names today is this:
+
+ namespace X {
+ class Y {
+ }
+ }
+
+ namespace A {
+ class Y {
+ }
+ }
+
+ The problem is that we only use the namespace stack to track the "prefix"
+ for typecontainers, but they are not typecontainers themselves, so we have
+ to use fully qualified names, because both A.X and A.Y would be entered
+ in the toplevel type container. If we use the short names, there would be
+ a name clash.
+
+ To fix this problem, we have to make namespaces DeclSpaces.
+
+ The full size, contrasted with the size that could be stored is:
+ corlib:
+ Size of strings held: 368901
+ Size of strings short: 147863
+
+ System:
+ Size of strings held: 212677
+ Size of strings short: 97521
+
+ System.XML:
+ Size of strings held: 128055
+ Size of strings short: 35782
+
+ System.Data:
+ Size of strings held: 117896
+ Size of strings short: 36153
+
+ System.Web:
+ Size of strings held: 194527
+ Size of strings short: 58064
+
+ System.Windows.Forms:
+ Size of strings held: 220495
+ Size of strings short: 64923
+
+
+The use of DottedName
+---------------------
+
+ We could probably use a different system to represent names, like this:
+
+ class Name {
+ string simplename;
+ Name parent;
+ }
+
+ So `System.ComponentModel' becomes:
+
+ x: (System, null)
+ y: (ComponentModel, x)
+
+ The problem is that we would still need to construct the name to pass to
+ GetType.
+
+ This has been now implemented, its called "QualifiedIdentifier"
+
+TODO:
+
+ 1. Create a "partial" emit context for each TypeContainer..
+
+ 2. EmitContext should be partially constructed. No IL Generator.
+
+ interface_type review.
+
+ parameter_array, line 952: `note: must be a single dimension array type'. Validate this
+
+Instance idea
+-------------
+
+ It would be nice to have things that can be "instances" to have an
+ EmitInstance method (this would default to nothing).
+
+ The idea is to be able to use efficiently the instance data on stack
+ manipulations, as opposed to the current scheme, where we basically have
+ a few special cases.
+
+ * `yield' is no longer a keyword, it only has special
+ meaning before a return or break keywords.
+
+ * Study side effects with assign
+ * Study TemporaryStorage/LocalStorage -> Merge/rename
+
diff --git a/mcs/mcs/PLAN b/mcs/mcs/PLAN
new file mode 100644
index 00000000000..53ee3c8ebdc
--- /dev/null
+++ b/mcs/mcs/PLAN
@@ -0,0 +1,165 @@
+Missing:
+
+ Support parameters.
+
+Removal:
+
+ Probably remove the parameter mapping as well for iterators,
+ and just embed the knowledge on the parameter class.
+
+Moving Iterators/Anonymous to a more comprehensive Field-based setup
+--------------------------------------------------------------------
+ IDEA:
+
+ Maybe turn LocalVariableReference into Field access?
+
+
+ One issue to consider if iterators/references in anon-methods
+ to a setup where we use a FieldExpr plus a "clever" instance
+ expression is that the LocalVariableReference will transform
+ itself into something else during Resolve, but the resulting
+ information must still be tracked in the LocalInfo
+
+ I believe this is because:
+
+ EmitMeta should not generate locals for things that have been
+ captured, so it is important to track this information.
+
+ Which means that we eliminate the knowledge about captured
+ information from LocalVariableReference/ParameterReference
+ during the Emit phase, but we still need it during the resolve
+ phase.
+
+Iterators:
+
+ In foreach, I do not like the if (.. InIterator) special
+ handling that we have there, it should be handled differently.
+
+Block.Parameters
+----------------
+
+ Maybe move this to Topblock? There is a fixme there.
+
+
+Clean Up
+--------
+
+ Move MapVariable from CodeGen into Block?
+
+Improve test:
+
+ Necesitamos que a-capture8.cs pruebe si la asignacion funciona o no.
+
+Audit:
+
+ Al emitir instancias de variables
+ (EmitCaptureVariableInstance) parece ser que el loop de iteracion:
+
+ while (si.ScopeBlock.ID != li.Block.ID)
+
+ está mas actulizado que el codigo similar para parámetros, es posible
+ que sea bitrot de parámetros o que en los parámetros usamos otra estrategia
+ (lo segundo es más razonable).
+
+Iteradores:
+
+ En algún lugar no pongo el `FieldBuilder' a un valor con los
+ iteradores, ver expression.cs: 3616, local_info.FieldBuilder es nulo.
+
+Parameters:
+
+ a-parameter4.cs falla por que no se liga el método anónimo
+ anidado con el padre.
+
+Cleanup:
+
+ CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
+ if (cc != this){
+ cc.EmitParameter (ec, name);
+ return;
+ }
+
+ That should be a static method, and call the instance method
+ in the right CaptureContext, instead of having the CaptureContext
+ compute that itself.
+
+Refactor:
+
+ The code that links ScopeInfos together, its replicated in 3 places.
+
+MakePinned is gone:
+
+ Need to audit the code now that use DeclareLocal, and that this uses
+ a differnent code path than the main mcs.
+
+Parameters:
+
+ We can optimize and make sure that we point to a separate class that
+ only holds the parameters.
+
+We need to nest anonymous method hosts as anonymous classes, currently
+they are all toplevel.
+
+Need to fix the order in which types are closed: currently we are not
+compatible with the MS requirement that the parent has to be created
+before the children are.
+
+Would be nice to name the anonymous methods after the method container name.
+
+Problems:
+
+ We cluster blocks at the scope level, not at the level the declaration
+ when its really needed:
+
+ ie:
+
+ int a = 0;
+ if (a == 1)
+ ;
+ int b = 0
+
+ We consider those:
+
+ int a;
+ {
+ int b;
+ }
+
+ So we cluster them on separate anonymous helper classes, which
+ means the resulting is not as efficient.
+
+Optimization from MS:
+
+ When creating an anonymous method that is static, cache its value.
+
+ I do not like the call to DoInit() in anonymous.cs, move it?
+
+ Parameter assignment seems too simple.
+
+Tests and pending features:
+
+ Support access to parameters of a delegate (see a11.cs)
+
+ How do parameters map to nested anonymous methods?
+
+ Helper classes should be nested classes of the original host class.
+ (permission: access private fields from another part)
+
+ Switch statement is broken (because it uses ILGenerator during
+ the Resolve phase, which with the `anonymous' branch is no longer
+ the case: so we have to delay the creation of labels until they
+ are needed, during the Emit phase).
+
+ Iteratorks are broken.
+
+Validation:
+
+ For testing, set ec.IG == null during resolve, restore value
+ for emit.
+
+ Currently it is commented out: there is a bug in the
+ statement.cs changes (see the old-statement.cs, the compiler
+ fails during bootstrap)
+
+ Need to set `S.R.CompilerServices.CompilerGeneratedAttribute'
+ on classes that the compiler generates.
diff --git a/mcs/mcs/README b/mcs/mcs/README
new file mode 100644
index 00000000000..6bab5b4d9f5
--- /dev/null
+++ b/mcs/mcs/README
@@ -0,0 +1,58 @@
+
+These are the sources to the Mono C# compiler
+---------------------------------------------
+
+ Read the mcs/docs/compiler.txt for an overview of the compiler.
+
+Testing the Compiler
+--------------------
+
+ You might want to use the `make btest' in this directory to
+ have the compiler bootstrap itself, this is the basic regression
+ test.
+
+ Before commiting changes to MCS, make sure that all the tests
+ in `mcs/tests' pass, and all the tests in 'mcs/errors' have the
+ expected result, type:
+
+ cd mcs # The top-level 'mcs' directory
+ make compiler-tests
+
+ If you want to test the installed compiler, you can run:
+
+ cd mcs # The top-level 'mcs' directory
+ make test-installed-compiler
+
+Full Bootstrap
+==============
+
+ To finally ensure the state of the compiler, it is ideal to do
+ a full bootstrap, to do this, do:
+
+ cd mcs
+ make clean;
+ make
+ make install
+
+ That installs the compiler and assemblies compiled by the new compiler.
+
+ Then, repeat that step again:
+
+ make clean
+ make
+
+ If things work, the compiler has not added a new regression
+ while building the mscorlib and the compiler itself.
+
+Tests
+=====
+
+ When bugs are fixed, new tests must be added to the
+ `mcs/tests' directory to excercise the problem and to guarantee
+ that we keep the compiler in a good state.
+
+ When an error is reported, it should be added to mcs/errors.
+
+ We try to make the errors numbers be the same as the ones in
+ Microsoft C#, if this is not possible, allocate a negative error
+ number, and list it in mcs/errors/errors.txt
diff --git a/mcs/mcs/TODO b/mcs/mcs/TODO
index dedf2c3812d..00f7d75ebf6 100644
--- a/mcs/mcs/TODO
+++ b/mcs/mcs/TODO
@@ -1,48 +1,145 @@
-Dead Code Elimination bugs:
+New
+---
+
+ It would be nice to optimize the case of:
+
+ Method (new ValueType ())
+
+ So that no temporary is created, and we only use a newobj call
+ that remains on the stack, as opposed to ldloca, initobj, ldloc
+ call.
+
+NEW NOTES:
+----------
+
+ ImplicitStandardConversionExists and ImplicitStandardConversion
+ should always be the same, but there are a few diverging lines that
+ must be studied:
+
+ if (expr_type == target_type && !(expr is NullLiteral))
+ return expr;
+
+ vs:
+
+ if (expr_type == target_type)
+ return true;
+
+
+Null Type
+---------
+
+ Need to introduce the NullType concept into the compiler, to address a
+ few small buglets and remove the hardcoded values for NullLiteral.
+
+ NullLiteral will be the only expression that has the NullType as its type.
+
+ This is what must be used to test for Null literals, instead of `is NullLiteral',
+ and this will introduce a couple of fixes to the rules.
+
+ Revert Martin's patch to Conditional expression that worked around this bug:
+
+ Reference r = xx ? null : null
+
+ The right fix is to introduce NullType
+
+****************************************************************************************
+*
+* The information on the rest of this file is mostly outdated, and its kept here for
+* historical reasons
+*
+****************************************************************************************
+
+Error Reporting:
+----------------
+
+ * Make yyerror show a nice syntax error, instead of the current mess.
+
+Iterators
+---------
+ * Reset should throw not implemented now.
+
+Optimization ideas
+------------------
+
+ Currently when we build a type cache, it contains private members,
+ internal members, and internal protected members; We should trim
+ these out, as it shows up on the profile.
+
+ We create too many Arraylists; When we know the size, we should create
+ an array;
+
+ During parsing we use arraylists to accumulate data, like this:
+
+ thing:
+
+ thing_list
+ : thing { $$ =new ArrayList (); $$.Add ($1); }
+ | thing_list thing { ArrayList a = $1; a.Add ($2); $$ = a; }
+
+ We probably could start using "Pairs" there:
+
+ thing_list
+ : thing { $$ = new Pair ($1, null); }
+ | thing_list thing { Pair p = $1; $$ = new Pair ($2, $1); }
+
+
+EmitContext.ResolveTypeTree
---------------------------
- I should also resolve all the children expressions in Switch, Fixed, Using.
+ We should investigate its usage. The problem is that by default
+ this will be set when calling FindType, that triggers a more expensive
+ lookup.
-Major tasks:
-------------
+ I believe we should pass the current EmitContext (which has this turned off
+ by default) to ResolveType/REsolveTypeExpr and then have the routines that
+ need ResolveType to pass null as the emit context.
- Pinned and volatile require type modifiers that can not be encoded
- with Reflection.Emit.
+DeclareLocal audit
+------------------
- Properties and 17.6.3: Finish it.
+ DeclareLocal is used in various statements. The audit should be done
+ in two steps:
- Implement base indexer access.
+ * Identify all the declare locals.
-readonly variables and ref/out
-
-BUGS
-----
+ * Identify its uses.
-* Explicit indexer implementation is missing.
+ * Find if we can make wrapper functions for all of them.
-* Check for Final when overriding, if the parent is Final, then we cant
- allow an override.
+ Then we can move DeclareLocal into a helper class.
-* Interface indexers
+ This is required to fix foreach in iterators.
- I have not figured out why the Microsoft version puts an
- `instance' attribute, and I am not generating this `instance' attribute.
+Large project:
+--------------
- Explanation: The reason for the `instance' attribute on
- indexers is that indexers only apply to instances
+ Drop FindMembers as our API and instead extract all the data
+ out of a type the first time into our own datastructures, and
+ use that to navigate and search the type instead of the
+ callback based FindMembers.
-* Indexer bugs:
+ Martin has some some of this work with his TypeHandle code
+ that we could use for this.
- the following wont work:
+Ideas:
+------
- x [0] = x [1] = N
+ Instead of the hack that *knows* about System.Object not having any children classes,
+ we should just make it simple for a probe to know that there is no need for it.
- if x has indexers, the value of x [N] set is set to void. This needs to be
- fixed.
+Dead Code Elimination bugs:
+---------------------------
+
+ I should also resolve all the children expressions in Switch, Fixed, Using.
-* Array declarations
+Major tasks:
+------------
+ Properties and 17.6.3: Finish it.
- Multi-dim arrays are declared as [,] instead of [0..,0..]
+readonly variables and ref/out
+
+BUGS
+----
* Break/Continue statements
@@ -61,14 +158,6 @@ BUGS
Method registration should only be used to register methodbuilders,
we need an alternate method of checking for duplicates.
-* We need to catch:
-
- extern string Property {
- get { }
- }
-
- The get there should only have a semicolon
-
*
> // CSC sets beforefieldinit
> class X {
@@ -81,25 +170,8 @@ BUGS
PENDING TASKS
-------------
-* IMprove error handling here:
-
- public static Process ()
-
- THat assumes that it is a constructor, check if its the same name
- as the class, if not report a different error than the one we use now.
-
* Merge test 89 and test-34
-* Revisit
-
- Primary-expression, as it has now been split into
- non-array-creation-expression and array-creation-expression.
-
-* Static flow analysis
-
- Required to warn about reachability of code and definite
- assignemt as well as missing returns on functions.
-
* Code cleanup
The information when registering a method in InternalParameters
@@ -109,25 +181,11 @@ PENDING TASKS
Handle modreq from public apis.
-* Emit `pinned' for pinned local variables.
-
- Both `modreq' and pinned will require special hacks in the compiler.
-
-* Make sure that we are pinning the right variable
-
-* Maybe track event usage? Currently I am not tracking these, although they
- are fields.
-
* Merge tree.cs, rootcontext.cs
OPTIMIZATIONS
-------------
-* Implement loop inversion for `For' as well.
-
-* There is too much unshared code between MemberAccess.Resolve and SimpleName
- resolve.
-
* User Defined Conversions is doing way too many calls to do union sets that are not needed
* Add test case for destructors
@@ -146,47 +204,11 @@ OPTIMIZATIONS
The only pending problem is that the code that implements Aliases
is on TypeContainer, and probably should go in DeclSpace.
-* Casts need to trigger a name resolution against types only.
-
- currently we use a secret hand shake, probably we should use
- a differen path, and only expressions (memberaccess, simplename)
- would participate in this protocol.
-
-* Use of local temporary in UnaryMutator
-
- We should get rid of the Localtemporary there for some cases
-
-* Emitcontext
-
- Do we really need to instanciate this variable all the time?
-
- It could be static for all we care, and just use it for making
- sure that there are no recursive invocations on it.
-
-* Use of EmitBranchable
-
- Currently I use brfalse/brtrue in the code for statements, instead of
- using the EmitBranchable function that lives in Binary
-
-* ConvertImplicit
-
- Currently ConvertImplicit will not catch things like:
-
- - IntLiteral in a float context to generate a -FloatLiteral.
- Instead it will perform an integer load followed by a conversion.
-
* Tests
Write tests for the various reference conversions. We have
test for all the numeric conversions.
-* Optimizations
-
- In Indexers and Properties, probably support an EmitWithDup
- That emits the code to call Get and then leaves a this pointer
- in the stack, so that later a Store can be emitted using that
- this pointer (consider Property++ or Indexer++)
-
* Optimizations: variable allocation.
When local variables of a type are required, we should request
@@ -195,19 +217,11 @@ OPTIMIZATIONS
* Add a cache for the various GetArrayMethod operations.
-* TypeManager.FindMembers:
-
- Instead of having hundreds of builder_to_blah hash table, have
- a single one that maps a TypeBuilder `t' to a set of classes
- that implement an interface that supports FindMembers.
-
* MakeUnionSet Callers
If the types are the same, there is no need to compute the unionset,
we can just use the list from one of the types.
-* Factor all the FindMembers in all the FindMembers providers.
-
* Factor the lookup code for class declarations an interfaces
(interface.cs:GetInterfaceByName)
@@ -233,26 +247,4 @@ RECOMMENDATIONS
Notice how numbering of the arguments changes as the
{ oob_stack.Push (lexer.Location) } takes a "slot" in the productions.
-* local_variable_declaration
-
- Not sure that this grammar is correct, we might have to
- resolve this during semantic analysis.
-
-* Idea
-
- MethodGroupExpr
-
- These guys should only appear as part of an Invocation, so we
- probably can afford to have a special callback:
-
- Expression.ResolveAllowMemberGroups
-
- This is only called by Invocation (or anyone that consumes
- MethodGroupExprs)
-
- And the regular DoResolve and DoResolveLValue do emit the error
- 654 `Method referenced without argument list'.
- Otherwise, a resolution will return a MethodGroupExpr which is
- not guaranteed to have set its `Expression.Type' to a non-null
- value.
diff --git a/mcs/mcs/anonymous.cs b/mcs/mcs/anonymous.cs
new file mode 100644
index 00000000000..1dc3671764e
--- /dev/null
+++ b/mcs/mcs/anonymous.cs
@@ -0,0 +1,1137 @@
+//
+// anonymous.cs: Support for anonymous methods
+//
+// Author:
+// Miguel de Icaza (miguel@ximain.com)
+//
+// (C) 2003, 2004 Novell, Inc.
+//
+// TODO: Ideally, we should have the helper classes emited as a hierarchy to map
+// their nesting, and have the visibility set to private, instead of NestedAssembly
+//
+//
+//
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+
+namespace Mono.CSharp {
+
+ public class AnonymousMethod : Expression {
+ // Used to generate unique method names.
+ static int anonymous_method_count;
+
+ // An array list of AnonymousMethodParameter or null
+ public Parameters Parameters;
+
+ //
+ // The block that makes up the body for the anonymous mehtod
+ //
+ public ToplevelBlock Block;
+
+ //
+ // The container block for this anonymous method.
+ //
+ public Block ContainingBlock;
+
+ //
+ // The implicit method we create
+ //
+ public Method method;
+
+ MethodInfo invoke_mb;
+
+ // The emit context for the anonymous method
+ public EmitContext aec;
+ public InternalParameters amp;
+ bool unreachable;
+
+ //
+ // The modifiers applied to the method, we aggregate them
+ //
+ int method_modifiers = Modifiers.INTERNAL;
+
+ //
+ // During the resolve stage of the anonymous method body,
+ // we discover the actual scope where we are hosted, or
+ // null to host the method in the same class
+ //
+ public ScopeInfo Scope;
+
+ //
+ // Points to our container anonymous method if its present
+ //
+ public AnonymousMethod ContainerAnonymousMethod;
+
+ public AnonymousMethod (Parameters parameters, ToplevelBlock container, ToplevelBlock block, Location l)
+ {
+ Parameters = parameters;
+ Block = block;
+ loc = l;
+
+ //
+ // The order is important: this setups the CaptureContext tree hierarchy.
+ //
+ container.SetHaveAnonymousMethods (l, this);
+ block.SetHaveAnonymousMethods (l, this);
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ //
+ // Set class type, set type
+ //
+
+ eclass = ExprClass.Value;
+
+ //
+ // This hack means `The type is not accessible
+ // anywhere', we depend on special conversion
+ // rules.
+ //
+ type = TypeManager.anonymous_method_type;
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ // nothing, as we only exist to not do anything.
+ }
+
+ //
+ // Creates the host for the anonymous method
+ //
+ bool CreateMethodHost (EmitContext ec, Type return_type)
+ {
+ //
+ // Crude hack follows: we replace the TypeBuilder during the
+ // definition to get the method hosted in the right class
+ //
+
+ TypeBuilder current_type = ec.TypeContainer.TypeBuilder;
+ TypeBuilder type_host = Scope == null ? current_type : Scope.ScopeTypeBuilder;
+
+ if (current_type == null)
+ throw new Exception ("The current_type is null");
+
+ if (type_host == null)
+ throw new Exception ("Type host is null");
+
+ if (current_type == type_host && ec.IsStatic){
+ if (ec.IsStatic)
+ method_modifiers |= Modifiers.STATIC;
+ current_type = null;
+ }
+
+ method = new Method (
+ (TypeContainer) ec.TypeContainer,
+ new TypeExpression (return_type, loc),
+ method_modifiers, false, new MemberName ("<#AnonymousMethod>" + anonymous_method_count++),
+ Parameters, null, loc);
+ method.Block = Block;
+
+
+ //
+ // Swap the TypeBuilder while we define the method, then restore
+ //
+ if (current_type != null)
+ ec.TypeContainer.TypeBuilder = type_host;
+ bool res = method.Define ();
+ if (current_type != null)
+ ec.TypeContainer.TypeBuilder = current_type;
+ return res;
+ }
+
+ void Error_ParameterMismatch (Type t)
+ {
+ Report.Error (1661, loc, "Anonymous method could not be converted to delegate `" +
+ "{0}' since there is a parameter mismatch", t);
+ }
+
+ //
+ // Returns true if this anonymous method can be implicitly
+ // converted to the delegate type `delegate_type'
+ //
+ public Expression Compatible (EmitContext ec, Type delegate_type, bool probe)
+ {
+ //
+ // At this point its the first time we know the return type that is
+ // needed for the anonymous method. We create the method here.
+ //
+
+ invoke_mb = (MethodInfo) Delegate.GetInvokeMethod (ec, delegate_type, loc);
+ ParameterData invoke_pd = Invocation.GetParameterData (invoke_mb);
+
+ //
+ // If implicit parameters are set, then we must check for out in the parameters
+ // and flag it accordingly.
+ //
+ bool out_invalid_check = false;
+
+ if (Parameters == null){
+ int i, j;
+ out_invalid_check = true;
+
+ //
+ // We provide a set of inaccessible parameters
+ //
+ int params_idx = -1;
+ for (i = 0; i < invoke_pd.Count; i++){
+ if (invoke_pd.ParameterModifier (i) == Parameter.Modifier.PARAMS)
+ params_idx = i;
+ }
+ int n = invoke_pd.Count - (params_idx != -1 ? 1 : 0);
+ Parameter [] fixedpars = new Parameter [n];
+
+ for (i = j = 0; i < invoke_pd.Count; i++){
+ if (invoke_pd.ParameterModifier (i) == Parameter.Modifier.PARAMS)
+ continue;
+ fixedpars [j] = new Parameter (
+ new TypeExpression (invoke_pd.ParameterType (i), loc),
+ "+" + j, invoke_pd.ParameterModifier (i), null);
+ j++;
+ }
+
+ Parameter variable = null;
+ if (params_idx != -1){
+ variable = new Parameter (
+ new TypeExpression (invoke_pd.ParameterType (params_idx), loc),
+ "+" + params_idx, invoke_pd.ParameterModifier (params_idx), null);
+ }
+
+ Parameters = new Parameters (fixedpars, variable, loc);
+ }
+
+ //
+ // First, parameter types of `delegate_type' must be compatible
+ // with the anonymous method.
+ //
+ amp = new InternalParameters (Parameters.GetParameterInfo (ec), Parameters);
+
+ if (amp.Count != invoke_pd.Count){
+ if (!probe){
+ Report.Error (1593, loc,
+ "Anonymous method has {0} parameters, while delegate requires {1}",
+ amp.Count, invoke_pd.Count);
+ Error_ParameterMismatch (delegate_type);
+ }
+ return null;
+ }
+
+ for (int i = 0; i < amp.Count; i++){
+ Parameter.Modifier amp_mod = amp.ParameterModifier (i);
+ if (amp_mod != invoke_pd.ParameterModifier (i)){
+ if (!probe){
+ Report.Error (1676, loc,
+ "Signature mismatch in parameter modifier for parameter #0", i + 1);
+ Error_ParameterMismatch (delegate_type);
+ }
+ return null;
+ }
+
+ if (amp.ParameterType (i) != invoke_pd.ParameterType (i)){
+ if (!probe){
+ Report.Error (1678, loc,
+ "Signature mismatch in parameter {0}: need `{1}' got `{2}'", i + 1,
+ TypeManager.CSharpName (invoke_pd.ParameterType (i)),
+ TypeManager.CSharpName (amp.ParameterType (i)));
+ Error_ParameterMismatch (delegate_type);
+ }
+ return null;
+ }
+
+ if (out_invalid_check && (invoke_pd.ParameterModifier (i) & Parameter.Modifier.OUT) != 0){
+ if (!probe){
+ Report.Error (1676, loc,"Parameter {0} must include the `out' modifier ", i+1);
+ Error_ParameterMismatch (delegate_type);
+ }
+ return null;
+ }
+ }
+
+ //
+ // If we are only probing, return ourselves
+ //
+ if (probe)
+ return this;
+
+ //
+ // Second: the return type of the delegate must be compatible with
+ // the anonymous type. Instead of doing a pass to examine the block
+ // we satisfy the rule by setting the return type on the EmitContext
+ // to be the delegate type return type.
+ //
+
+ //MethodBuilder builder = method_data.MethodBuilder;
+ //ILGenerator ig = builder.GetILGenerator ();
+
+
+ aec = new EmitContext (
+ ec.TypeContainer, ec.DeclSpace, loc, null,
+ invoke_mb.ReturnType,
+ /* REVIEW */ (ec.InIterator ? Modifiers.METHOD_YIELDS : 0) |
+ (ec.InUnsafe ? Modifiers.UNSAFE : 0),
+ /* No constructor */ false);
+
+ aec.CurrentAnonymousMethod = this;
+ ContainerAnonymousMethod = ec.CurrentAnonymousMethod;
+ ContainingBlock = ec.CurrentBlock;
+
+ if (aec.ResolveTopBlock (ec, Block, amp, loc, out unreachable))
+ return new AnonymousDelegate (this, delegate_type, loc).Resolve (ec);
+
+ return null;
+ }
+
+ public MethodBuilder GetMethodBuilder ()
+ {
+ return method.MethodData.MethodBuilder;
+ }
+
+ public void EmitMethod (EmitContext ec)
+ {
+ if (!CreateMethodHost (ec, invoke_mb.ReturnType))
+ return;
+
+ MethodBuilder builder = GetMethodBuilder ();
+ ILGenerator ig = builder.GetILGenerator ();
+ aec.ig = ig;
+
+ Parameters.LabelParameters (aec, builder, loc);
+
+ //
+ // Adjust based on the computed state of the
+ // method from CreateMethodHost
+
+ if ((method_modifiers & Modifiers.STATIC) != 0)
+ aec.IsStatic = true;
+
+ aec.EmitMeta (Block, amp);
+ aec.EmitResolvedTopBlock (Block, unreachable);
+ }
+ }
+
+ //
+ // This will emit the code for the delegate, as well delegate creation on the host
+ //
+ public class AnonymousDelegate : DelegateCreation {
+ AnonymousMethod am;
+
+ public AnonymousDelegate (AnonymousMethod am, Type target_type, Location l)
+ {
+ type = target_type;
+ loc = l;
+ this.am = am;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ eclass = ExprClass.Value;
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ am.EmitMethod (ec);
+
+ //
+ // Now emit the delegate creation.
+ //
+ if ((am.method.ModFlags & Modifiers.STATIC) == 0)
+ delegate_instance_expression = new AnonymousInstance (am);
+
+ Expression ml = Expression.MemberLookup (ec, type, ".ctor", loc);
+ constructor_method = ((MethodGroupExpr) ml).Methods [0];
+ delegate_method = am.GetMethodBuilder ();
+ base.Emit (ec);
+ }
+
+ class AnonymousInstance : Expression {
+ AnonymousMethod am;
+
+ public AnonymousInstance (AnonymousMethod am)
+ {
+ this.am = am;
+ eclass = ExprClass.Value;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ am.aec.EmitMethodHostInstance (ec, am);
+ }
+ }
+ }
+
+ class CapturedParameter {
+ public Type Type;
+ public FieldBuilder FieldBuilder;
+ public int Idx;
+
+ public CapturedParameter (Type type, int idx)
+ {
+ Type = type;
+ Idx = idx;
+ }
+ }
+
+ //
+ // Here we cluster all the variables captured on a given scope, we also
+ // keep some extra information that might be required on each scope.
+ //
+ public class ScopeInfo {
+ public CaptureContext CaptureContext;
+ public ScopeInfo ParentScope;
+ public Block ScopeBlock;
+ public bool NeedThis = false;
+ public bool HostsParameters = false;
+
+ // For tracking the number of scopes created.
+ public int id;
+ static int count;
+ bool inited = false;
+
+ ArrayList locals = new ArrayList ();
+ ArrayList children = new ArrayList ();
+
+ //
+ // The types and fields generated
+ //
+ public TypeBuilder ScopeTypeBuilder;
+ public ConstructorBuilder ScopeConstructor;
+ public FieldBuilder THIS;
+ public FieldBuilder ParentLink;
+
+ //
+ // Points to the object of type `ScopeTypeBuilder' that
+ // holds the data for the scope
+ //
+ public LocalBuilder ScopeInstance;
+
+
+ public ScopeInfo (CaptureContext cc, Block b)
+ {
+ CaptureContext = cc;
+ ScopeBlock = b;
+ id = count++;
+
+ cc.AddScope (this);
+ }
+
+ public void AddLocal (LocalInfo li)
+ {
+ if (locals.Contains (li))
+ return;
+
+ locals.Add (li);
+ }
+
+ public bool IsCaptured (LocalInfo li)
+ {
+ return locals.Contains (li);
+ }
+
+ public void AddChild (ScopeInfo si)
+ {
+ if (children.Contains (si))
+ return;
+ children.Add (si);
+ }
+
+ static int indent = 0;
+
+ void Pad ()
+ {
+ for (int i = 0; i < indent; i++)
+ Console.Write (" ");
+ }
+
+ void EmitDebug ()
+ {
+ //Console.WriteLine (Environment.StackTrace);
+ Pad ();
+ Console.WriteLine ("START");
+ indent++;
+ Pad ();
+ Console.WriteLine ("NeedThis=" + NeedThis);
+ foreach (LocalInfo li in locals){
+ Pad ();
+ Console.WriteLine ("var {0}", li.Name);
+ }
+
+ foreach (ScopeInfo si in children)
+ si.EmitDebug ();
+ indent--;
+ Pad ();
+ Console.WriteLine ("END");
+ }
+
+ public string MakeHelperName ()
+ {
+ return String.Format ("<>AnonHelp<{0}>", id);
+ }
+
+ public void EmitScopeConstructor ()
+ {
+ Type [] constructor_types = TypeManager.NoTypes;
+ Parameters constructor_parameters = Parameters.EmptyReadOnlyParameters;
+ ScopeConstructor = ScopeTypeBuilder.DefineConstructor (
+ MethodAttributes.Public | MethodAttributes.HideBySig |
+ MethodAttributes.SpecialName | MethodAttributes.RTSpecialName,
+ CallingConventions.HasThis, constructor_types);
+ InternalParameters parameter_info = new InternalParameters (constructor_types, constructor_parameters);
+ TypeManager.RegisterMethod (ScopeConstructor, parameter_info, constructor_types);
+
+ ILGenerator cig = ScopeConstructor.GetILGenerator ();
+ cig.Emit (OpCodes.Ldarg_0);
+ cig.Emit (OpCodes.Call, TypeManager.object_ctor);
+ cig.Emit (OpCodes.Ret);
+ }
+
+ public void EmitScopeType (EmitContext ec)
+ {
+ //EmitDebug ();
+
+ if (ScopeTypeBuilder != null)
+ return;
+
+ ILGenerator ig = ec.ig;
+ TypeBuilder container = ec.TypeContainer.TypeBuilder;
+
+ ScopeTypeBuilder = container.DefineNestedType (
+ MakeHelperName (), TypeAttributes.AutoLayout | TypeAttributes.Class | TypeAttributes.NestedAssembly,
+ TypeManager.object_type, null);
+
+ if (NeedThis)
+ THIS = ScopeTypeBuilder.DefineField ("<>THIS", container, FieldAttributes.Assembly);
+
+ if (ParentScope != null){
+ if (ParentScope.ScopeTypeBuilder == null){
+ throw new Exception (String.Format ("My parent has not been initialized {0} and {1}", ParentScope, this));
+ }
+
+ ParentLink = ScopeTypeBuilder.DefineField ("<>parent", ParentScope.ScopeTypeBuilder,
+ FieldAttributes.Assembly);
+ }
+
+ if (NeedThis && ParentScope != null)
+ throw new Exception ("I was not expecting THIS && having a parent");
+
+ foreach (LocalInfo info in locals){
+ info.FieldBuilder = ScopeTypeBuilder.DefineField (
+ info.Name, info.VariableType, FieldAttributes.Assembly);
+ }
+
+ if (HostsParameters){
+ Hashtable captured_parameters = CaptureContext.captured_parameters;
+
+ foreach (DictionaryEntry de in captured_parameters){
+ string name = (string) de.Key;
+ CapturedParameter cp = (CapturedParameter) de.Value;
+ FieldBuilder fb;
+
+ fb = ScopeTypeBuilder.DefineField ("<p:" + name + ">", cp.Type, FieldAttributes.Assembly);
+ cp.FieldBuilder = fb;
+ }
+ }
+
+ EmitScopeConstructor ();
+ foreach (ScopeInfo si in children){
+ si.EmitScopeType (ec);
+ }
+ }
+
+ public void CloseTypes ()
+ {
+ RootContext.RegisterHelperClass (ScopeTypeBuilder);
+ foreach (ScopeInfo si in children)
+ si.CloseTypes ();
+ }
+
+ //
+ // Emits the initialization code for the scope
+ //
+ public void EmitInitScope (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ if (inited)
+ return;
+
+ ig.Emit (OpCodes.Newobj, (ConstructorInfo) ScopeConstructor);
+ ScopeInstance = ig.DeclareLocal (ScopeTypeBuilder);
+ ig.Emit (OpCodes.Stloc, ScopeInstance);
+
+ if (THIS != null){
+ ig.Emit (OpCodes.Ldloc, ScopeInstance);
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Stfld, THIS);
+ }
+
+ //
+ // Copy the parameter values, if any
+ //
+ int extra = ec.IsStatic ? 0 : 1;
+ if (HostsParameters){
+ Hashtable captured_parameters = CaptureContext.captured_parameters;
+
+ foreach (DictionaryEntry de in captured_parameters){
+ string name = (string) de.Key;
+ CapturedParameter cp = (CapturedParameter) de.Value;
+
+ ig.Emit (OpCodes.Ldloc, ScopeInstance);
+ ParameterReference.EmitLdArg (ig, cp.Idx + extra);
+ ig.Emit (OpCodes.Stfld, cp.FieldBuilder);
+ }
+ }
+
+ if (ParentScope != null){
+ //
+ // Only emit initialization in our capturecontext world
+ //
+ if (ParentScope.CaptureContext == CaptureContext){
+ ig.Emit (OpCodes.Ldloc, ScopeInstance);
+ ig.Emit (OpCodes.Ldloc, ParentScope.ScopeInstance);
+ ig.Emit (OpCodes.Stfld, ParentLink);
+ } else {
+ ig.Emit (OpCodes.Ldloc, ScopeInstance);
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Stfld, ParentLink);
+ }
+ }
+ inited = true;
+ }
+
+ static void DoPath (StringBuilder sb, ScopeInfo start)
+ {
+ if (start.ParentScope != null){
+ DoPath (sb, start.ParentScope);
+ sb.Append (", ");
+ }
+ sb.Append ((start.id).ToString ());
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ();
+
+ sb.Append ("{");
+ if (CaptureContext != null){
+ sb.Append (CaptureContext.ToString ());
+ sb.Append (":");
+ }
+
+ DoPath (sb, this);
+ sb.Append ("}");
+
+ return sb.ToString ();
+ }
+ }
+
+ //
+ // CaptureContext objects are created on demand if a method has
+ // anonymous methods and kept on the ToplevelBlock.
+ //
+ // If they exist, all ToplevelBlocks in the containing block are
+ // linked together (children pointing to their parents).
+ //
+ public class CaptureContext {
+ public static int count;
+ public int cc_id;
+ Location loc;
+
+ //
+ // Points to the toplevel block that owns this CaptureContext
+ //
+ ToplevelBlock toplevel_owner;
+ Hashtable scopes = new Hashtable ();
+ bool have_captured_vars = false;
+ ScopeInfo topmost = null;
+
+ //
+ // Captured fields
+ //
+ Hashtable captured_fields = new Hashtable ();
+ Hashtable captured_variables = new Hashtable ();
+ public Hashtable captured_parameters = new Hashtable ();
+ public AnonymousMethod Host;
+
+ public CaptureContext (ToplevelBlock toplevel_owner, Location loc, AnonymousMethod host)
+ {
+ cc_id = count++;
+ this.toplevel_owner = toplevel_owner;
+ this.loc = loc;
+
+ if (host != null)
+ Host = host;
+ }
+
+ void DoPath (StringBuilder sb, CaptureContext cc)
+ {
+ if (cc.ParentCaptureContext != null){
+ DoPath (sb, cc.ParentCaptureContext);
+ sb.Append (".");
+ }
+ sb.Append (cc_id.ToString ());
+ }
+
+ public override string ToString ()
+ {
+ ToplevelBlock parent = ParentToplevel;
+ StringBuilder sb = new StringBuilder ();
+
+ sb.Append ("[");
+ DoPath (sb, this);
+ sb.Append ("]");
+ return sb.ToString ();
+ }
+
+ public ToplevelBlock ParentToplevel {
+ get {
+ return toplevel_owner.Container;
+ }
+ }
+
+ public CaptureContext ParentCaptureContext {
+ get {
+ ToplevelBlock parent = ParentToplevel;
+
+ return (parent == null) ? null : parent.CaptureContext;
+ }
+ }
+
+ // Returns the deepest of two scopes
+ public ScopeInfo Deepest (ScopeInfo a, ScopeInfo b)
+ {
+ ScopeInfo p;
+
+ if (a == null)
+ return b;
+ if (b == null)
+ return a;
+ if (a == b)
+ return a;
+
+ //
+ // If they Scopes are on the same CaptureContext, we do the double
+ // checks just so if there is an invariant change in the future,
+ // we get the exception at the end
+ //
+ for (p = a; p != null; p = p.ParentScope)
+ if (p == b)
+ return a;
+
+ for (p = b; p != null; p = p.ParentScope)
+ if (p == a)
+ return b;
+
+ CaptureContext ca = a.CaptureContext;
+ CaptureContext cb = b.CaptureContext;
+
+ for (CaptureContext c = ca; c != null; c = c.ParentCaptureContext)
+ if (c == cb)
+ return a;
+
+ for (CaptureContext c = cb; c != null; c = c.ParentCaptureContext)
+ if (c == ca)
+ return b;
+ throw new Exception ("Should never be reached");
+ }
+
+ void AdjustMethodScope (AnonymousMethod am, ScopeInfo scope)
+ {
+ am.Scope = Deepest (am.Scope, scope);
+ }
+
+ void LinkScope (ScopeInfo scope, int id)
+ {
+ ScopeInfo parent = (ScopeInfo) scopes [id];
+ scope.ParentScope = parent;
+ parent.AddChild (scope);
+
+ if (scope == topmost)
+ topmost = parent;
+ }
+
+ public void AddLocal (AnonymousMethod am, LocalInfo li)
+ {
+ if (li.Block.Toplevel != toplevel_owner){
+ ParentCaptureContext.AddLocal (am, li);
+ return;
+ }
+ int block_id = li.Block.ID;
+ ScopeInfo scope;
+ if (scopes [block_id] == null){
+ scope = new ScopeInfo (this, li.Block);
+ scopes [block_id] = scope;
+ } else
+ scope = (ScopeInfo) scopes [block_id];
+
+ if (topmost == null){
+ topmost = scope;
+ } else {
+ // Link to parent
+ for (Block b = scope.ScopeBlock.Parent; b != null; b = b.Parent){
+ if (scopes [b.ID] != null){
+ LinkScope (scope, b.ID);
+ break;
+ }
+ }
+
+ if (scope.ParentScope == null && ParentCaptureContext != null){
+ CaptureContext pcc = ParentCaptureContext;
+
+ for (Block b = am.ContainingBlock; b != null; b = b.Parent){
+ if (pcc.scopes [b.ID] != null){
+ pcc.LinkScope (scope, b.ID);
+ break;
+ }
+ }
+ }
+ }
+
+ //
+ // Adjust the owner
+ //
+ if (Host != null)
+ AdjustMethodScope (Host, topmost);
+
+ //
+ // Adjust the user
+ //
+ AdjustMethodScope (am, scope);
+
+ if (captured_variables [li] != null)
+ return;
+
+ have_captured_vars = true;
+ captured_variables [li] = li;
+ scope.AddLocal (li);
+ }
+
+ //
+ // Retursn the CaptureContext for the block that defines the parameter `name'
+ //
+ static CaptureContext _ContextForParameter (ToplevelBlock current, string name)
+ {
+ ToplevelBlock container = current.Container;
+ if (container != null){
+ CaptureContext cc = _ContextForParameter (container, name);
+ if (cc != null)
+ return cc;
+ }
+ if (current.IsParameterReference (name))
+ return current.ToplevelBlockCaptureContext;
+ return null;
+ }
+
+ static CaptureContext ContextForParameter (ToplevelBlock current, string name)
+ {
+ CaptureContext cc = _ContextForParameter (current, name);
+ if (cc == null)
+ throw new Exception (String.Format ("request for parameteter {0} failed: not found", name));
+ return cc;
+ }
+
+ //
+ // Records the captured parameter at the appropriate CaptureContext
+ //
+ public void AddParameter (EmitContext ec, AnonymousMethod am, string name, Type t, int idx)
+ {
+ CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
+
+ cc.AddParameterToContext (am, name, t, idx);
+ }
+
+ //
+ // Records the parameters in the context
+ //
+ void AddParameterToContext (AnonymousMethod am, string name, Type t, int idx)
+ {
+ if (captured_parameters == null)
+ captured_parameters = new Hashtable ();
+ if (captured_parameters [name] != null)
+ return;
+ captured_parameters [name] = new CapturedParameter (t, idx);
+
+ if (topmost == null){
+ //
+ // Create one ScopeInfo, if there are none.
+ //
+ topmost = new ScopeInfo (this, toplevel_owner);
+ scopes [toplevel_owner.ID] = topmost;
+ } else {
+ //
+ // If the topmost ScopeInfo is not at the topblock level, insert
+ // a new ScopeInfo there.
+ //
+ if (topmost.ScopeBlock != toplevel_owner){
+ ScopeInfo par_si = new ScopeInfo (this, toplevel_owner);
+ scopes [toplevel_owner.ID] = topmost;
+ topmost.ParentScope = par_si;
+ topmost = par_si;
+ }
+ }
+
+ topmost.HostsParameters = true;
+ AdjustMethodScope (am, topmost);
+ }
+
+ //
+ // Captured fields are only recorded on the topmost CaptureContext, because that
+ // one is the one linked to the owner of instance fields
+ //
+ public void AddField (FieldExpr fe)
+ {
+ if (fe.FieldInfo.IsStatic)
+ throw new Exception ("Attempt to register a static field as a captured field");
+
+ CaptureContext parent = ParentCaptureContext;
+ if (parent != null)
+ parent.AddField (fe);
+ else
+ captured_fields [fe] = fe;
+ }
+
+
+ public bool HaveCapturedVariables {
+ get {
+ return have_captured_vars;
+ }
+ }
+
+ public bool HaveCapturedFields {
+ get {
+ CaptureContext parent = ParentCaptureContext;
+ if (parent != null)
+ return parent.HaveCapturedFields;
+ return captured_fields.Count > 0;
+ }
+ }
+
+ public bool IsCaptured (LocalInfo local)
+ {
+ foreach (ScopeInfo si in scopes.Values){
+ if (si.IsCaptured (local))
+ return true;
+ }
+ return false;
+ }
+
+ //
+ // Returns whether the parameter is captured
+ //
+ public bool IsParameterCaptured (string name)
+ {
+ if (ParentCaptureContext != null && ParentCaptureContext.IsParameterCaptured (name))
+ return true;
+
+ if (captured_parameters != null)
+ return captured_parameters [name] != null;
+ return false;
+ }
+
+ public void EmitHelperClasses (EmitContext ec)
+ {
+ if (topmost != null){
+ topmost.NeedThis = HaveCapturedFields;
+ topmost.EmitScopeType (ec);
+ }
+ }
+
+ public void CloseHelperClasses ()
+ {
+ if (topmost != null)
+ topmost.CloseTypes ();
+ }
+
+ ScopeInfo GetScopeFromBlock (EmitContext ec, Block b)
+ {
+ ScopeInfo si;
+
+ si = (ScopeInfo) scopes [b.ID];
+ if (si == null)
+ throw new Exception ("Si is null for block " + b.ID);
+ si.EmitInitScope (ec);
+
+ return si;
+ }
+
+ //
+ // Emits the opcodes necessary to load the instance of the captured
+ // variable in `li'
+ //
+ public void EmitCapturedVariableInstance (EmitContext ec, LocalInfo li, AnonymousMethod am)
+ {
+ ILGenerator ig = ec.ig;
+ ScopeInfo si;
+
+ if (li.Block.Toplevel == toplevel_owner){
+ si = GetScopeFromBlock (ec, li.Block);
+ ig.Emit (OpCodes.Ldloc, si.ScopeInstance);
+ return;
+ }
+
+ si = am.Scope;
+ ig.Emit (OpCodes.Ldarg_0);
+ if (si != null){
+ while (si.ScopeBlock.ID != li.Block.ID){
+ if (si.ParentLink != null)
+ ig.Emit (OpCodes.Ldfld, si.ParentLink);
+ si = si.ParentScope;
+ if (si == null)
+ throw new Exception (
+ String.Format ("Never found block {0} starting at {1} while looking up {2}",
+ li.Block.ID, am.Scope.ScopeBlock.ID, li.Name));
+ }
+ }
+ }
+
+ //
+ // Internal routine that loads the instance to reach parameter `name'
+ //
+ void EmitParameterInstance (EmitContext ec, string name)
+ {
+ CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
+ if (cc != this){
+ cc.EmitParameterInstance (ec, name);
+ return;
+ }
+ Block invocation_block = ec.CurrentBlock;
+ CapturedParameter par_info = (CapturedParameter) captured_parameters [name];
+ ILGenerator ig = ec.ig;
+
+ ScopeInfo si;
+ if (ec.CurrentBlock == toplevel_owner){
+ si = GetScopeFromBlock (ec, toplevel_owner);
+ ig.Emit (OpCodes.Ldloc, si.ScopeInstance);
+ return;
+ }
+
+ si = ec.CurrentAnonymousMethod.Scope;
+ ig.Emit (OpCodes.Ldarg_0);
+ if (si != null){
+ while (si.ParentLink != null) {
+ ig.Emit (OpCodes.Ldfld, si.ParentLink);
+ si = si.ParentScope;
+ }
+ }
+ }
+
+ //
+ // Emits the code necessary to load the parameter named `name' within
+ // an anonymous method.
+ //
+ public void EmitParameter (EmitContext ec, string name)
+ {
+ CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
+ if (cc != this){
+ cc.EmitParameter (ec, name);
+ return;
+ }
+ EmitParameterInstance (ec, name);
+ CapturedParameter par_info = (CapturedParameter) captured_parameters [name];
+ ec.ig.Emit (OpCodes.Ldfld, par_info.FieldBuilder);
+ }
+
+ //
+ // Implements the assignment of `source' to the paramenter named `name' within
+ // an anonymous method.
+ //
+ public void EmitAssignParameter (EmitContext ec, string name, Expression source, bool leave_copy, bool prepare_for_load)
+ {
+ CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
+ if (cc != this){
+ cc.EmitAssignParameter (ec, name, source, leave_copy, prepare_for_load);
+ return;
+ }
+ ILGenerator ig = ec.ig;
+ CapturedParameter par_info = (CapturedParameter) captured_parameters [name];
+
+ EmitParameterInstance (ec, name);
+ source.Emit (ec);
+ if (leave_copy)
+ ig.Emit (OpCodes.Dup);
+ ig.Emit (OpCodes.Stfld, par_info.FieldBuilder);
+ }
+
+ //
+ // Emits the address for the parameter named `name' within
+ // an anonymous method.
+ //
+ public void EmitAddressOfParameter (EmitContext ec, string name)
+ {
+ CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
+ if (cc != this){
+ cc.EmitAddressOfParameter (ec, name);
+ return;
+ }
+ EmitParameterInstance (ec, name);
+ CapturedParameter par_info = (CapturedParameter) captured_parameters [name];
+ ec.ig.Emit (OpCodes.Ldflda, par_info.FieldBuilder);
+ }
+
+ //
+ // The following methods are only invoked on the host for the
+ // anonymous method.
+ //
+ public void EmitMethodHostInstance (EmitContext target, AnonymousMethod am)
+ {
+ ILGenerator ig = target.ig;
+ ScopeInfo si = am.Scope;
+
+ if (si == null){
+ ig.Emit (OpCodes.Ldarg_0);
+ return;
+ }
+
+ si.EmitInitScope (target);
+ ig.Emit (OpCodes.Ldloc, si.ScopeInstance);
+ }
+
+ ArrayList all_scopes = new ArrayList ();
+
+ public void AddScope (ScopeInfo si)
+ {
+ all_scopes.Add (si);
+ toplevel_owner.RegisterCaptureContext (this);
+ }
+
+ //
+ // Links any scopes that were not linked previously
+ //
+ public void AdjustScopes ()
+ {
+ foreach (ScopeInfo scope in all_scopes){
+ if (scope.ParentScope != null)
+ continue;
+
+ for (Block b = scope.ScopeBlock.Parent; b != null; b = b.Parent){
+ if (scopes [b.ID] != null){
+ LinkScope (scope, b.ID);
+ break;
+ }
+ }
+
+ if (scope.ParentScope == null && ParentCaptureContext != null){
+ CaptureContext pcc = ParentCaptureContext;
+
+ for (Block b = Host.ContainingBlock; b != null; b = b.Parent){
+ if (pcc.scopes [b.ID] != null){
+ pcc.LinkScope (scope, b.ID);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/mcs/mcs/assign.cs b/mcs/mcs/assign.cs
index aff163825fa..e4f657bad02 100755
--- a/mcs/mcs/assign.cs
+++ b/mcs/mcs/assign.cs
@@ -3,8 +3,9 @@
//
// Author:
// Miguel de Icaza (miguel@ximian.com)
+// Martin Baulig (martin@gnome.org)
//
-// (C) 2001, 2002 Ximian, Inc.
+// (C) 2001, 2002, 2003 Ximian, Inc.
//
using System;
using System.Reflection;
@@ -28,19 +29,125 @@ namespace Mono.CSharp {
/// </remarks>
public interface IAssignMethod {
//
- // This method will emit the code for the actual assignment
+ // This is an extra version of Emit. If leave_copy is `true'
+ // A copy of the expression will be left on the stack at the
+ // end of the code generated for EmitAssign
//
- void EmitAssign (EmitContext ec, Expression source);
-
- //
- // This method is invoked before any code generation takes
- // place, and it is a mechanism to inform that the expression
- // will be invoked more than once, and that the method should
- // use temporary values to avoid having side effects
+ void Emit (EmitContext ec, bool leave_copy);
+
//
- // Example: a [ g () ] ++
+ // This method does the assignment
+ // `source' will be stored into the location specified by `this'
+ // if `leave_copy' is true, a copy of `source' will be left on the stack
+ // if `prepare_for_load' is true, when `source' is emitted, there will
+ // be data on the stack that it can use to compuatate its value. This is
+ // for expressions like a [f ()] ++, where you can't call `f ()' twice.
//
- void CacheTemporaries (EmitContext ec);
+ void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load);
+
+ /*
+ For simple assignments, this interface is very simple, EmitAssign is called with source
+ as the source expression and leave_copy and prepare_for_load false.
+
+ For compound assignments it gets complicated.
+
+ EmitAssign will be called as before, however, prepare_for_load will be
+ true. The @source expression will contain an expression
+ which calls Emit. So, the calls look like:
+
+ this.EmitAssign (ec, source, false, true) ->
+ source.Emit (ec); ->
+ [...] ->
+ this.Emit (ec, false); ->
+ end this.Emit (ec, false); ->
+ end [...]
+ end source.Emit (ec);
+ end this.EmitAssign (ec, source, false, true)
+
+
+ When prepare_for_load is true, EmitAssign emits a `token' on the stack that
+ Emit will use for its state.
+
+ Let's take FieldExpr as an example. assume we are emitting f ().y += 1;
+
+ Here is the call tree again. This time, each call is annotated with the IL
+ it produces:
+
+ this.EmitAssign (ec, source, false, true)
+ call f
+ dup
+
+ Binary.Emit ()
+ this.Emit (ec, false);
+ ldfld y
+ end this.Emit (ec, false);
+
+ IntConstant.Emit ()
+ ldc.i4.1
+ end IntConstant.Emit
+
+ add
+ end Binary.Emit ()
+
+ stfld
+ end this.EmitAssign (ec, source, false, true)
+
+ Observe two things:
+ 1) EmitAssign left a token on the stack. It was the result of f ().
+ 2) This token was used by Emit
+
+ leave_copy (in both EmitAssign and Emit) tells the compiler to leave a copy
+ of the expression at that point in evaluation. This is used for pre/post inc/dec
+ and for a = x += y. Let's do the above example with leave_copy true in EmitAssign
+
+ this.EmitAssign (ec, source, true, true)
+ call f
+ dup
+
+ Binary.Emit ()
+ this.Emit (ec, false);
+ ldfld y
+ end this.Emit (ec, false);
+
+ IntConstant.Emit ()
+ ldc.i4.1
+ end IntConstant.Emit
+
+ add
+ end Binary.Emit ()
+
+ dup
+ stloc temp
+ stfld
+ ldloc temp
+ end this.EmitAssign (ec, source, true, true)
+
+ And with it true in Emit
+
+ this.EmitAssign (ec, source, false, true)
+ call f
+ dup
+
+ Binary.Emit ()
+ this.Emit (ec, true);
+ ldfld y
+ dup
+ stloc temp
+ end this.Emit (ec, true);
+
+ IntConstant.Emit ()
+ ldc.i4.1
+ end IntConstant.Emit
+
+ add
+ end Binary.Emit ()
+
+ stfld
+ ldloc temp
+ end this.EmitAssign (ec, source, false, true)
+
+ Note that these two examples are what happens for ++x and x++, respectively.
+ */
}
/// <summary>
@@ -54,29 +161,47 @@ namespace Mono.CSharp {
/// The local temporary is used to alter the normal flow of code generation
/// basically it creates a local variable, and its emit instruction generates
/// code to access this value, return its address or save its value.
+ ///
+ /// If `is_address' is true, then the value that we store is the address to the
+ /// real value, and not the value itself.
+ ///
+ /// This is needed for a value type, because otherwise you just end up making a
+ /// copy of the value on the stack and modifying it. You really need a pointer
+ /// to the origional value so that you can modify it in that location. This
+ /// Does not happen with a class because a class is a pointer -- so you always
+ /// get the indirection.
+ ///
+ /// The `is_address' stuff is really just a hack. We need to come up with a better
+ /// way to handle it.
/// </remarks>
public class LocalTemporary : Expression, IMemoryLocation {
LocalBuilder builder;
+ bool is_address;
- public LocalTemporary (EmitContext ec, Type t)
+ public LocalTemporary (EmitContext ec, Type t) : this (ec, t, false) {}
+
+ public LocalTemporary (EmitContext ec, Type t, bool is_address)
{
type = t;
eclass = ExprClass.Value;
- builder = ec.GetTemporaryStorage (t);
+ loc = Location.Null;
+ builder = ec.GetTemporaryLocal (is_address ? TypeManager.GetReferenceType (t): t);
+ this.is_address = is_address;
}
- public void Release (EmitContext ec)
- {
- ec.FreeTemporaryStorage (builder);
- builder = null;
- }
-
public LocalTemporary (LocalBuilder b, Type t)
{
type = t;
eclass = ExprClass.Value;
+ loc = Location.Null;
builder = b;
}
+
+ public void Release (EmitContext ec)
+ {
+ ec.FreeTemporaryLocal (builder, type);
+ builder = null;
+ }
public override Expression DoResolve (EmitContext ec)
{
@@ -85,17 +210,39 @@ namespace Mono.CSharp {
public override void Emit (EmitContext ec)
{
- ec.ig.Emit (OpCodes.Ldloc, builder);
+ ILGenerator ig = ec.ig;
+
+ ig.Emit (OpCodes.Ldloc, builder);
+ // we need to copy from the pointer
+ if (is_address)
+ LoadFromPtr (ig, type);
}
+ // NB: if you have `is_address' on the stack there must
+ // be a managed pointer. Otherwise, it is the type from
+ // the ctor.
public void Store (EmitContext ec)
{
- ec.ig.Emit (OpCodes.Stloc, builder);
+ ILGenerator ig = ec.ig;
+ ig.Emit (OpCodes.Stloc, builder);
}
public void AddressOf (EmitContext ec, AddressOp mode)
{
- ec.ig.Emit (OpCodes.Ldloca, builder);
+ // if is_address, than this is just the address anyways,
+ // so we just return this.
+ ILGenerator ig = ec.ig;
+
+ if (is_address)
+ ig.Emit (OpCodes.Ldloc, builder);
+ else
+ ig.Emit (OpCodes.Ldloca, builder);
+ }
+
+ public bool PointsToAddress {
+ get {
+ return is_address;
+ }
}
}
@@ -104,14 +251,28 @@ namespace Mono.CSharp {
/// the expression represented by target.
/// </summary>
public class Assign : ExpressionStatement {
- protected Expression target, source;
- public Location l;
+ protected Expression target, source, real_source;
+ protected LocalTemporary temp = null, real_temp = null;
+ protected Assign embedded = null;
+ protected bool is_embedded = false;
+ protected bool must_free_temp = false;
public Assign (Expression target, Expression source, Location l)
{
this.target = target;
- this.source = source;
- this.l = l;
+ this.source = this.real_source = source;
+ this.loc = l;
+ }
+
+ protected Assign (Assign embedded, Location l)
+ : this (embedded.target, embedded.source, l)
+ {
+ this.is_embedded = true;
+ }
+
+ protected virtual Assign GetEmbeddedAssign (Location loc)
+ {
+ return new Assign (this, loc);
}
public Expression Target {
@@ -146,99 +307,116 @@ namespace Mono.CSharp {
//
public override Expression DoResolve (EmitContext ec)
{
- source = source.Resolve (ec);
+ // Create an embedded assignment if our source is an assignment.
+ if (source is Assign)
+ source = embedded = ((Assign) source).GetEmbeddedAssign (loc);
+
+ real_source = source = source.Resolve (ec);
if (source == null)
return null;
+ //
+ // This is used in an embedded assignment.
+ // As an example, consider the statement "A = X = Y = Z".
+ //
+ if (is_embedded && !(source is Constant)) {
+ // If this is the innermost assignment (the "Y = Z" in our example),
+ // create a new temporary local, otherwise inherit that variable
+ // from our child (the "X = (Y = Z)" inherits the local from the
+ // "Y = Z" assignment).
+
+ if (embedded == null) {
+ if (this is CompoundAssign)
+ real_temp = temp = new LocalTemporary (ec, target.Type);
+ else
+ real_temp = temp = new LocalTemporary (ec, source.Type);
+ } else
+ temp = embedded.temp;
+
+ // Set the source to the new temporary variable.
+ // This means that the following target.ResolveLValue () will tell
+ // the target to read it's source value from that variable.
+ source = temp;
+ }
+
+ // If we have an embedded assignment, use the embedded assignment's temporary
+ // local variable as source.
+ if (embedded != null)
+ source = (embedded.temp != null) ? embedded.temp : embedded.source;
+
target = target.ResolveLValue (ec, source);
-
+
if (target == null)
return null;
Type target_type = target.Type;
- Type source_type = source.Type;
-
- type = target_type;
+ Type source_type = real_source.Type;
+
+ // If we're an embedded assignment, our parent will reuse our source as its
+ // source, it won't read from our target.
+ if (is_embedded)
+ type = source_type;
+ else
+ type = target_type;
eclass = ExprClass.Value;
- //
- // If we are doing a property assignment, then
- // set the `value' field on the property, and Resolve
- // it.
- //
- if (target is PropertyExpr){
- PropertyExpr property_assign = (PropertyExpr) target;
-
- if (source_type != target_type){
- source = ConvertImplicitRequired (ec, source, target_type, l);
- if (source == null)
- return null;
- }
-
- //
- // FIXME: Maybe handle this in the LValueResolve
- //
- if (!property_assign.VerifyAssignable ())
- return null;
-
- return this;
- }
-
- if (target is IndexerAccess)
- return this;
if (target is EventExpr) {
-
- Binary tmp;
EventInfo ei = ((EventExpr) target).EventInfo;
-
Expression ml = MemberLookup (
ec, ec.ContainerType, ei.Name,
- MemberTypes.Event, AllBindingFlags, l);
+ MemberTypes.Event, AllBindingFlags | BindingFlags.DeclaredOnly, loc);
if (ml == null) {
//
// If this is the case, then the Event does not belong
- // to this TypeContainer and so, according to the spec
+ // to this Type and so, according to the spec
// is allowed to only appear on the left hand of
// the += and -= operators
//
- // Note that if target will not appear as an EventExpr
+ // Note that target will not appear as an EventExpr
// in the case it is being referenced within the same type container;
// it will appear as a FieldExpr in that case.
//
- if (!(source is Binary)) {
- error70 (ei, l);
+ if (!(source is BinaryDelegate)) {
+ error70 (ei, loc);
return null;
- } else {
- tmp = ((Binary) source);
- if (tmp.Oper != Binary.Operator.Addition &&
- tmp.Oper != Binary.Operator.Subtraction) {
- error70 (ei, l);
- return null;
- }
- }
+ }
}
}
- if (source is New && target_type.IsSubclassOf (TypeManager.value_type)){
- New n = (New) source;
-
- n.ValueTypeVariable = target;
- return n;
- }
-
- if (target.eclass != ExprClass.Variable && target.eclass != ExprClass.EventAccess){
- Report.Error (131, l,
+ if (!(target is IAssignMethod) && (target.eclass != ExprClass.EventAccess)) {
+ Report.Error (131, loc,
"Left hand of an assignment must be a variable, " +
"a property or an indexer");
return null;
}
- if (target_type == source_type)
+ if ((source.eclass == ExprClass.Type) && (source is TypeExpr)) {
+ source.Error_UnexpectedKind ("variable or value", loc);
+ return null;
+ } else if ((RootContext.Version == LanguageVersion.ISO_1) &&
+ (source is MethodGroupExpr)){
+ ((MethodGroupExpr) source).ReportUsageError ();
+ return null;
+
+ }
+
+ if (target_type == source_type){
+ if (source is New && target_type.IsValueType &&
+ (target.eclass != ExprClass.IndexerAccess) && (target.eclass != ExprClass.PropertyAccess)){
+ New n = (New) source;
+
+ if (n.SetValueTypeVariable (target))
+ return n;
+ else
+ return null;
+ }
+
return this;
+ }
//
// If this assignemnt/operator was part of a compound binary
@@ -250,66 +428,124 @@ namespace Mono.CSharp {
CompoundAssign a = (CompoundAssign) this;
Binary b = source as Binary;
- if (b != null && b.IsBuiltinOperator){
+ if (b != null){
//
// 1. if the source is explicitly convertible to the
// target_type
//
- source = ConvertExplicit (ec, source, target_type, l);
+ source = Convert.ExplicitConversion (ec, source, target_type, loc);
if (source == null){
- Error_CannotConvertImplicit (l, source_type, target_type);
+ Convert.Error_CannotImplicitConversion (loc, source_type, target_type);
return null;
}
//
// 2. and the original right side is implicitly convertible to
- // the type of target_type.
+ // the type of target
+ //
+ if (Convert.ImplicitStandardConversionExists (ec, a.original_source, target_type))
+ return this;
+
+ //
+ // In the spec 2.4 they added: or if type of the target is int
+ // and the operator is a shift operator...
//
- if (StandardConversionExists (a.original_source, target_type))
+ if (source_type == TypeManager.int32_type &&
+ (b.Oper == Binary.Operator.LeftShift || b.Oper == Binary.Operator.RightShift))
return this;
- Error_CannotConvertImplicit (l, a.original_source.Type, target_type);
+ Convert.Error_CannotImplicitConversion (loc, a.original_source.Type, target_type);
return null;
}
}
-
- source = ConvertImplicitRequired (ec, source, target_type, l);
+
+ source = Convert.ImplicitConversionRequired (ec, source, target_type, loc);
if (source == null)
return null;
+ // If we're an embedded assignment, we need to create a new temporary variable
+ // for the converted value. Our parent will use this new variable as its source.
+ // The same applies when we have an embedded assignment - in this case, we need
+ // to convert our embedded assignment's temporary local variable to the correct
+ // type and store it in a new temporary local.
+ if (is_embedded || embedded != null) {
+ type = target_type;
+ temp = new LocalTemporary (ec, type);
+ must_free_temp = true;
+ }
+
return this;
}
+ Expression EmitEmbedded (EmitContext ec)
+ {
+ // Emit an embedded assignment.
+
+ if (real_temp != null) {
+ // If we're the innermost assignment, `real_source' is the right-hand
+ // expression which gets assigned to all the variables left of it.
+ // Emit this expression and store its result in real_temp.
+ real_source.Emit (ec);
+ real_temp.Store (ec);
+ }
+
+ if (embedded != null)
+ embedded.EmitEmbedded (ec);
+
+ // This happens when we've done a type conversion, in this case source will be
+ // the expression which does the type conversion from real_temp.
+ // So emit it and store the result in temp; this is the var which will be read
+ // by our parent.
+ if (temp != real_temp) {
+ source.Emit (ec);
+ temp.Store (ec);
+ }
+
+ Expression temp_source = (temp != null) ? temp : source;
+ ((IAssignMethod) target).EmitAssign (ec, temp_source, false, false);
+ return temp_source;
+ }
+
+ void ReleaseEmbedded (EmitContext ec)
+ {
+ if (embedded != null)
+ embedded.ReleaseEmbedded (ec);
+
+ if (real_temp != null)
+ real_temp.Release (ec);
+
+ if (must_free_temp)
+ temp.Release (ec);
+ }
+
void Emit (EmitContext ec, bool is_statement)
{
if (target is EventExpr) {
((EventExpr) target).EmitAddOrRemove (ec, source);
return;
}
-
- //
- // FIXME! We need a way to "probe" if the process can
- // just use `dup' to propagate the result
- //
+
IAssignMethod am = (IAssignMethod) target;
- if (this is CompoundAssign){
- am.CacheTemporaries (ec);
- }
-
- if (is_statement)
- am.EmitAssign (ec, source);
- else {
- LocalTemporary tempo;
-
- tempo = new LocalTemporary (ec, source.Type);
+ Expression temp_source;
+ if (embedded != null) {
+ temp_source = embedded.EmitEmbedded (ec);
+
+ if (temp != null) {
+ source.Emit (ec);
+ temp.Store (ec);
+ temp_source = temp;
+ }
+ } else
+ temp_source = source;
+
+ am.EmitAssign (ec, temp_source, !is_statement, this is CompoundAssign);
- source.Emit (ec);
- tempo.Store (ec);
- am.EmitAssign (ec, tempo);
- tempo.Emit (ec);
- tempo.Release (ec);
+ if (embedded != null) {
+ if (temp != null)
+ temp.Release (ec);
+ embedded.ReleaseEmbedded (ec);
}
}
@@ -339,6 +575,17 @@ namespace Mono.CSharp {
this.op = op;
}
+ protected CompoundAssign (CompoundAssign embedded, Location l)
+ : this (embedded.op, embedded.target, embedded.source, l)
+ {
+ this.is_embedded = true;
+ }
+
+ protected override Assign GetEmbeddedAssign (Location loc)
+ {
+ return new CompoundAssign (this, loc);
+ }
+
public Expression ResolveSource (EmitContext ec)
{
return original_source.Resolve (ec);
@@ -346,20 +593,20 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- target = target.ResolveLValue (ec, source);
- if (target == null)
- return null;
-
original_source = original_source.Resolve (ec);
if (original_source == null)
return null;
+ target = target.Resolve (ec);
+ if (target == null)
+ return null;
+
//
// Only now we can decouple the original source/target
// into a tree, to guarantee that we do not have side
// effects.
//
- source = new Binary (op, target, original_source, l);
+ source = new Binary (op, target, original_source, loc);
return base.DoResolve (ec);
}
}
diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs
index 5405e27481d..6abc589eb3c 100644
--- a/mcs/mcs/attribute.cs
+++ b/mcs/mcs/attribute.cs
@@ -1,794 +1,1579 @@
-//
-// attribute.cs: Attribute Handler
-//
-// Author: Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.InteropServices;
-using System.Runtime.CompilerServices;
-using System.Text;
-
-namespace Mono.CSharp {
-
- public class Attribute {
- public readonly string Name;
- public readonly ArrayList Arguments;
-
- Location Location;
-
- public Type Type;
-
- //
- // The following are only meaningful when the attribute
- // being emitted is one of the builtin ones
- //
- AttributeTargets Targets;
- bool AllowMultiple;
- bool Inherited;
-
- bool UsageAttr = false;
-
- MethodImplOptions ImplOptions;
- UnmanagedType UnmanagedType;
- CustomAttributeBuilder cb;
-
- public Attribute (string name, ArrayList args, Location loc)
- {
- Name = name;
- Arguments = args;
- Location = loc;
- }
-
- void Error_InvalidNamedArgument (string name)
- {
- Report.Error (617, Location, "'" + name + "' is not a valid named attribute " +
- "argument. Named attribute arguments must be fields which are not " +
- "readonly, static or const, or properties with a set accessor which "+
- "are not static.");
- }
-
- void Error_AttributeArgumentNotValid ()
- {
- Report.Error (182, Location,
- "An attribute argument must be a constant expression, typeof " +
- "expression or array creation expression");
- }
-
- static void Error_AttributeConstructorMismatch (Location loc)
- {
- Report.Error (
- -6, loc,
- "Could not find a constructor for this argument list.");
- }
-
- private Type CheckAttributeType (EmitContext ec) {
- Type t;
- bool isattributeclass = true;
-
- t = RootContext.LookupType (ec.DeclSpace, Name, true, Location);
- if (t != null) {
- isattributeclass = t.IsSubclassOf (TypeManager.attribute_type);
- if (isattributeclass)
- return t;
- }
- t = RootContext.LookupType (ec.DeclSpace, Name + "Attribute", true, Location);
- if (t != null) {
- if (t.IsSubclassOf (TypeManager.attribute_type))
- return t;
- }
- if (!isattributeclass) {
- Report.Error (616, Location, "'" + Name + "': is not an attribute class");
- return null;
- }
- if (t != null) {
- Report.Error (616, Location, "'" + Name + "Attribute': is not an attribute class");
- return null;
- }
- Report.Error (
- 246, Location, "Could not find attribute '" + Name + "' (are you" +
- " missing a using directive or an assembly reference ?)");
- return null;
- }
-
- public Type ResolveType (EmitContext ec)
- {
- Type = CheckAttributeType (ec);
- return Type;
- }
-
-
- public CustomAttributeBuilder Resolve (EmitContext ec)
- {
- if (Type == null)
- Type = CheckAttributeType (ec);
- if (Type == null)
- return null;
-
- bool MethodImplAttr = false;
- bool MarshalAsAttr = false;
-
- UsageAttr = false;
-
- if (Type == TypeManager.attribute_usage_type)
- UsageAttr = true;
- if (Type == TypeManager.methodimpl_attr_type)
- MethodImplAttr = true;
- if (Type == TypeManager.marshal_as_attr_type)
- MarshalAsAttr = true;
-
- // Now we extract the positional and named arguments
-
- ArrayList pos_args = new ArrayList ();
- ArrayList named_args = new ArrayList ();
- int pos_arg_count = 0;
-
- if (Arguments != null) {
- pos_args = (ArrayList) Arguments [0];
- if (pos_args != null)
- pos_arg_count = pos_args.Count;
- if (Arguments.Count > 1)
- named_args = (ArrayList) Arguments [1];
- }
-
- object [] pos_values = new object [pos_arg_count];
-
- //
- // First process positional arguments
- //
-
- int i;
- for (i = 0; i < pos_arg_count; i++) {
- Argument a = (Argument) pos_args [i];
- Expression e;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- e = a.Expr;
- if (e is Constant) {
- pos_values [i] = ((Constant) e).GetValue ();
- } else if (e is TypeOf) {
- pos_values [i] = ((TypeOf) e).TypeArg;
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- if (UsageAttr)
- this.Targets = (AttributeTargets) pos_values [0];
-
- if (MethodImplAttr)
- this.ImplOptions = (MethodImplOptions) pos_values [0];
-
- if (MarshalAsAttr)
- this.UnmanagedType =
- (System.Runtime.InteropServices.UnmanagedType) pos_values [0];
- }
-
- //
- // Now process named arguments
- //
-
- ArrayList field_infos = new ArrayList ();
- ArrayList prop_infos = new ArrayList ();
- ArrayList field_values = new ArrayList ();
- ArrayList prop_values = new ArrayList ();
-
- for (i = 0; i < named_args.Count; i++) {
- DictionaryEntry de = (DictionaryEntry) named_args [i];
- string member_name = (string) de.Key;
- Argument a = (Argument) de.Value;
- Expression e;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression member = Expression.MemberLookup (
- ec, Type, member_name,
- MemberTypes.Field | MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- Location);
-
- if (member == null || !(member is PropertyExpr || member is FieldExpr)) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- e = a.Expr;
- if (member is PropertyExpr) {
- PropertyExpr pe = (PropertyExpr) member;
- PropertyInfo pi = pe.PropertyInfo;
-
- if (!pi.CanWrite) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- if (e is Constant) {
- object o = ((Constant) e).GetValue ();
- prop_values.Add (o);
-
- if (UsageAttr) {
- if (member_name == "AllowMultiple")
- this.AllowMultiple = (bool) o;
- if (member_name == "Inherited")
- this.Inherited = (bool) o;
- }
-
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- prop_infos.Add (pi);
-
- } else if (member is FieldExpr) {
- FieldExpr fe = (FieldExpr) member;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.IsInitOnly) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- //
- // Handle charset here, and set the TypeAttributes
-
- if (e is Constant){
- object value = ((Constant) e).GetValue ();
-
- field_values.Add (value);
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- field_infos.Add (fi);
- }
- }
-
- Expression mg = Expression.MemberLookup (
- ec, Type, ".ctor", MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance, Location);
-
- if (mg == null) {
- Error_AttributeConstructorMismatch (Location);
- return null;
- }
-
- MethodBase constructor = Invocation.OverloadResolve (
- ec, (MethodGroupExpr) mg, pos_args, Location);
-
- if (constructor == null) {
- Error_AttributeConstructorMismatch (Location);
- return null;
- }
-
- PropertyInfo [] prop_info_arr = new PropertyInfo [prop_infos.Count];
- FieldInfo [] field_info_arr = new FieldInfo [field_infos.Count];
- object [] field_values_arr = new object [field_values.Count];
- object [] prop_values_arr = new object [prop_values.Count];
-
- field_infos.CopyTo (field_info_arr, 0);
- field_values.CopyTo (field_values_arr, 0);
-
- prop_values.CopyTo (prop_values_arr, 0);
- prop_infos.CopyTo (prop_info_arr, 0);
-
- try {
- cb = new CustomAttributeBuilder (
- (ConstructorInfo) constructor, pos_values,
- prop_info_arr, prop_values_arr,
- field_info_arr, field_values_arr);
- } catch {
- //
- // Sample:
- // using System.ComponentModel;
- // [DefaultValue (CollectionChangeAction.Add)]
- // class X { static void Main () {} }
- //
- Report.Warning (
- -23, Location,
- "The compiler can not encode this attribute in .NET due to\n" +
- "\ta bug in the .NET runtime. Try the Mono runtime");
- }
-
- return cb;
- }
-
- static string GetValidPlaces (Attribute attr)
- {
- StringBuilder sb = new StringBuilder ();
- AttributeTargets targets = 0;
-
- TypeContainer a = TypeManager.LookupAttr (attr.Type);
-
- if (a == null) {
-
- System.Attribute [] attrs = null;
-
- try {
- attrs = System.Attribute.GetCustomAttributes (attr.Type);
-
- } catch {
- Report.Error (-20, attr.Location, "Cannot find attribute type " + attr.Name +
- " (maybe you forgot to set the usage using the" +
- " AttributeUsage attribute ?).");
- return null;
- }
-
- foreach (System.Attribute tmp in attrs)
- if (tmp is AttributeUsageAttribute)
- targets = ((AttributeUsageAttribute) tmp).ValidOn;
- } else
- targets = a.Targets;
-
-
- if ((targets & AttributeTargets.Assembly) != 0)
- sb.Append ("'assembly' ");
-
- if ((targets & AttributeTargets.Class) != 0)
- sb.Append ("'class' ");
-
- if ((targets & AttributeTargets.Constructor) != 0)
- sb.Append ("'constructor' ");
-
- if ((targets & AttributeTargets.Delegate) != 0)
- sb.Append ("'delegate' ");
-
- if ((targets & AttributeTargets.Enum) != 0)
- sb.Append ("'enum' ");
-
- if ((targets & AttributeTargets.Event) != 0)
- sb.Append ("'event' ");
-
- if ((targets & AttributeTargets.Field) != 0)
- sb.Append ("'field' ");
-
- if ((targets & AttributeTargets.Interface) != 0)
- sb.Append ("'interface' ");
-
- if ((targets & AttributeTargets.Method) != 0)
- sb.Append ("'method' ");
-
- if ((targets & AttributeTargets.Module) != 0)
- sb.Append ("'module' ");
-
- if ((targets & AttributeTargets.Parameter) != 0)
- sb.Append ("'parameter' ");
-
- if ((targets & AttributeTargets.Property) != 0)
- sb.Append ("'property' ");
-
- if ((targets & AttributeTargets.ReturnValue) != 0)
- sb.Append ("'return value' ");
-
- if ((targets & AttributeTargets.Struct) != 0)
- sb.Append ("'struct' ");
-
- return sb.ToString ();
-
- }
-
- public static void Error_AttributeNotValidForElement (Attribute a, Location loc)
- {
- Report.Error (
- 592, loc, "Attribute '" + a.Name +
- "' is not valid on this declaration type. " +
- "It is valid on " + GetValidPlaces (a) + "declarations only.");
- }
-
- public static bool CheckAttribute (Attribute a, object element)
- {
- TypeContainer attr = TypeManager.LookupAttr (a.Type);
- AttributeTargets targets = 0;
-
-
- if (attr == null) {
-
- System.Attribute [] attrs = null;
-
- try {
- attrs = System.Attribute.GetCustomAttributes (a.Type);
-
- } catch {
- Report.Error (-20, a.Location, "Cannot find attribute type " + a.Name +
- " (maybe you forgot to set the usage using the" +
- " AttributeUsage attribute ?).");
- return false;
- }
-
- foreach (System.Attribute tmp in attrs)
- if (tmp is AttributeUsageAttribute)
- targets = ((AttributeUsageAttribute) tmp).ValidOn;
- } else
- targets = attr.Targets;
-
- if (element is Class) {
- if ((targets & AttributeTargets.Class) != 0)
- return true;
- else
- return false;
-
- } else if (element is Struct) {
- if ((targets & AttributeTargets.Struct) != 0)
- return true;
- else
- return false;
- } else if (element is Constructor) {
- if ((targets & AttributeTargets.Constructor) != 0)
- return true;
- else
- return false;
- } else if (element is Delegate) {
- if ((targets & AttributeTargets.Delegate) != 0)
- return true;
- else
- return false;
- } else if (element is Enum) {
- if ((targets & AttributeTargets.Enum) != 0)
- return true;
- else
- return false;
- } else if (element is Event || element is InterfaceEvent) {
- if ((targets & AttributeTargets.Event) != 0)
- return true;
- else
- return false;
- } else if (element is Field || element is FieldBuilder) {
- if ((targets & AttributeTargets.Field) != 0)
- return true;
- else
- return false;
- } else if (element is Interface) {
- if ((targets & AttributeTargets.Interface) != 0)
- return true;
- else
- return false;
- } else if (element is Method || element is Operator || element is InterfaceMethod || element is Accessor) {
- if ((targets & AttributeTargets.Method) != 0)
- return true;
- else
- return false;
- } else if (element is ParameterBuilder) {
- if ((targets & AttributeTargets.Parameter) != 0)
- return true;
- else
- return false;
- } else if (element is Property || element is Indexer ||
- element is InterfaceProperty || element is InterfaceIndexer) {
- if ((targets & AttributeTargets.Property) != 0)
- return true;
- else
- return false;
- } else if (element is AssemblyBuilder){
- if ((targets & AttributeTargets.Assembly) != 0)
- return true;
- else
- return false;
- }
-
- return false;
- }
-
- //
- // This method should be invoked to pull the IndexerName attribute from an
- // Indexer if it exists.
- //
- public static string ScanForIndexerName (EmitContext ec, Attributes opt_attrs)
- {
- if (opt_attrs == null)
- return null;
- if (opt_attrs.AttributeSections == null)
- return null;
-
- foreach (AttributeSection asec in opt_attrs.AttributeSections) {
- if (asec.Attributes == null)
- continue;
-
- foreach (Attribute a in asec.Attributes){
- if (a.ResolveType (ec) == null)
- return null;
-
- if (a.Type != TypeManager.indexer_name_type)
- continue;
-
- //
- // So we have found an IndexerName, pull the data out.
- //
- if (a.Arguments == null || a.Arguments [0] == null){
- Error_AttributeConstructorMismatch (a.Location);
- return null;
- }
- ArrayList pos_args = (ArrayList) a.Arguments [0];
- if (pos_args.Count == 0){
- Error_AttributeConstructorMismatch (a.Location);
- return null;
- }
-
- Argument arg = (Argument) pos_args [0];
- if (!arg.Resolve (ec, a.Location))
- return null;
-
- Expression e = arg.Expr;
- if (!(e is StringConstant)){
- Error_AttributeConstructorMismatch (a.Location);
- return null;
- }
-
- //
- // Remove the attribute from the list
- //
- asec.Attributes.Remove (a);
-
- return (((StringConstant) e).Value);
- }
- }
- return null;
- }
-
- //
- // Applies the attributes to the `builder'.
- //
- public static void ApplyAttributes (EmitContext ec, object builder, object kind,
- Attributes opt_attrs, Location loc)
- {
- if (opt_attrs == null)
- return;
- if (opt_attrs.AttributeSections == null)
- return;
-
- foreach (AttributeSection asec in opt_attrs.AttributeSections) {
- if (asec.Attributes == null)
- continue;
-
- if (asec.Target == "assembly" && !(builder is AssemblyBuilder))
- continue;
-
- foreach (Attribute a in asec.Attributes) {
- CustomAttributeBuilder cb = a.Resolve (ec);
-
- if (cb == null)
- continue;
-
- if (!(kind is TypeContainer))
- if (!CheckAttribute (a, kind)) {
- Error_AttributeNotValidForElement (a, loc);
- return;
- }
-
- if (kind is Method || kind is Operator || kind is InterfaceMethod) {
- if (a.Type == TypeManager.methodimpl_attr_type) {
- if (a.ImplOptions == MethodImplOptions.InternalCall)
- ((MethodBuilder) builder).
- SetImplementationFlags (
- MethodImplAttributes.InternalCall |
- MethodImplAttributes.Runtime);
- } else if (a.Type != TypeManager.dllimport_type){
- ((MethodBuilder) builder).SetCustomAttribute (cb);
- }
- } else if (kind is Constructor) {
- ((ConstructorBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Field) {
- ((FieldBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Property || kind is Indexer ||
- kind is InterfaceProperty || kind is InterfaceIndexer) {
- ((PropertyBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Event || kind is InterfaceEvent) {
- ((MyEventBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is ParameterBuilder) {
-
- if (a.Type == TypeManager.marshal_as_attr_type) {
- UnmanagedMarshal marshal =
- UnmanagedMarshal.DefineUnmanagedMarshal (a.UnmanagedType);
-
- ((ParameterBuilder) builder).SetMarshal (marshal);
- } else
- ((ParameterBuilder) builder).SetCustomAttribute (cb);
-
- } else if (kind is Enum) {
- ((TypeBuilder) builder).SetCustomAttribute (cb);
-
- } else if (kind is TypeContainer) {
- TypeContainer tc = (TypeContainer) kind;
-
- if (a.UsageAttr) {
- tc.Targets = a.Targets;
- tc.AllowMultiple = a.AllowMultiple;
- tc.Inherited = a.Inherited;
-
- } else if (a.Type == TypeManager.default_member_type) {
- if (tc.Indexers != null) {
- Report.Error (646, loc,
- "Cannot specify the DefaultMember attribute on" +
- " a type containing an indexer");
- return;
- }
-
- } else {
- if (!CheckAttribute (a, kind)) {
- Error_AttributeNotValidForElement (a, loc);
- return;
- }
- }
-
- try {
- ((TypeBuilder) builder).SetCustomAttribute (cb);
- } catch (System.ArgumentException) {
- Report.Warning (
- -21, loc,
- "The CharSet named property on StructLayout\n"+
- "\tdoes not work correctly on Microsoft.NET\n"+
- "\tYou might want to remove the CharSet declaration\n"+
- "\tor compile using the Mono runtime instead of the\n"+
- "\tMicrosoft .NET runtime");
- }
-
- } else if (kind is AssemblyBuilder){
- ((AssemblyBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is ModuleBuilder) {
- ((ModuleBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is FieldBuilder) {
- ((FieldBuilder) builder).SetCustomAttribute (cb);
- } else if (kind is Accessor) {
- ((MethodBuilder) builder).SetCustomAttribute (cb);
- } else
- throw new Exception ("Unknown kind: " + kind);
- }
- }
- }
-
- public MethodBuilder DefinePInvokeMethod (EmitContext ec, TypeBuilder builder, string name,
- MethodAttributes flags, Type ret_type, Type [] param_types)
- {
- //
- // We extract from the attribute the information we need
- //
-
- if (Arguments == null) {
- Console.WriteLine ("Internal error : this is not supposed to happen !");
- return null;
- }
-
- Type = CheckAttributeType (ec);
- if (Type == null)
- return null;
-
- ArrayList named_args = new ArrayList ();
-
- ArrayList pos_args = (ArrayList) Arguments [0];
- if (Arguments.Count > 1)
- named_args = (ArrayList) Arguments [1];
-
-
- string dll_name = null;
-
- Argument tmp = (Argument) pos_args [0];
-
- if (!tmp.Resolve (ec, Location))
- return null;
-
- if (tmp.Expr is Constant)
- dll_name = (string) ((Constant) tmp.Expr).GetValue ();
- else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- // Now we process the named arguments
- CallingConvention cc = CallingConvention.Winapi;
- CharSet charset = CharSet.Ansi;
- bool preserve_sig = true;
- bool exact_spelling = false;
- bool set_last_err = false;
- string entry_point = null;
-
- for (int i = 0; i < named_args.Count; i++) {
-
- DictionaryEntry de = (DictionaryEntry) named_args [i];
-
- string member_name = (string) de.Key;
- Argument a = (Argument) de.Value;
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression member = Expression.MemberLookup (
- ec, Type, member_name,
- MemberTypes.Field | MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance,
- Location);
-
- if (member == null || !(member is FieldExpr)) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- if (member is FieldExpr) {
- FieldExpr fe = (FieldExpr) member;
- FieldInfo fi = fe.FieldInfo;
-
- if (fi.IsInitOnly) {
- Error_InvalidNamedArgument (member_name);
- return null;
- }
-
- if (a.Expr is Constant) {
- Constant c = (Constant) a.Expr;
-
- if (member_name == "CallingConvention")
- cc = (CallingConvention) c.GetValue ();
- else if (member_name == "CharSet")
- charset = (CharSet) c.GetValue ();
- else if (member_name == "EntryPoint")
- entry_point = (string) c.GetValue ();
- else if (member_name == "SetLastError")
- set_last_err = (bool) c.GetValue ();
- else if (member_name == "ExactSpelling")
- exact_spelling = (bool) c.GetValue ();
- else if (member_name == "PreserveSig")
- preserve_sig = (bool) c.GetValue ();
- } else {
- Error_AttributeArgumentNotValid ();
- return null;
- }
-
- }
- }
-
- MethodBuilder mb = builder.DefinePInvokeMethod (
- name, dll_name, flags | MethodAttributes.HideBySig,
- CallingConventions.Standard,
- ret_type,
- param_types,
- cc,
- charset);
-
- if (preserve_sig)
- mb.SetImplementationFlags (MethodImplAttributes.PreserveSig);
-
- return mb;
- }
-
- }
-
- public class AttributeSection {
-
- public readonly string Target;
- public readonly ArrayList Attributes;
-
- public AttributeSection (string target, ArrayList attrs)
- {
- Target = target;
- Attributes = attrs;
- }
-
- }
-
- public class Attributes {
- public ArrayList AttributeSections;
- public Location Location;
-
- public Attributes (AttributeSection a, Location loc)
- {
- AttributeSections = new ArrayList ();
- AttributeSections.Add (a);
-
- }
-
- public void AddAttribute (AttributeSection a)
- {
- if (a != null)
- AttributeSections.Add (a);
- }
- }
-}
+//
+// attribute.cs: Attribute Handler
+//
+// Author: Ravi Pratap (ravi@ximian.com)
+// Marek Safar (marek.safar@seznam.cz)
+//
+// Licensed under the terms of the GNU GPL
+//
+// (C) 2001 Ximian, Inc (http://www.ximian.com)
+//
+//
+
+using System;
+using System.Diagnostics;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Security;
+using System.Security.Permissions;
+using System.Text;
+
+namespace Mono.CSharp {
+
+ /// <summary>
+ /// Base class for objects that can have Attributes applied to them.
+ /// </summary>
+ public abstract class Attributable {
+ /// <summary>
+ /// Attributes for this type
+ /// </summary>
+ Attributes attributes;
+
+ public Attributable(Attributes attrs)
+ {
+ attributes = attrs;
+ if (attributes != null)
+ attributes.CheckTargets (this);
+ }
+
+ public Attributes OptAttributes
+ {
+ get {
+ return attributes;
+ }
+ set {
+ attributes = value;
+ if (attributes != null)
+ attributes.CheckTargets (this);
+ }
+ }
+
+ /// <summary>
+ /// Use member-specific procedure to apply attribute @a in @cb to the entity being built in @builder
+ /// </summary>
+ public abstract void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb);
+
+ /// <summary>
+ /// Returns one AttributeTarget for this element.
+ /// </summary>
+ public abstract AttributeTargets AttributeTargets { get; }
+
+ public abstract bool IsClsCompliaceRequired (DeclSpace ds);
+
+ /// <summary>
+ /// Gets list of valid attribute targets for explicit target declaration.
+ /// The first array item is default target. Don't break this rule.
+ /// </summary>
+ public abstract string[] ValidAttributeTargets { get; }
+ };
+
+ public class Attribute {
+ public readonly string ExplicitTarget;
+ public AttributeTargets Target;
+
+ public readonly string Name;
+ public readonly ArrayList Arguments;
+
+ public readonly Location Location;
+
+ public Type Type;
+
+ // Is non-null if type is AttributeUsageAttribute
+ AttributeUsageAttribute usage_attribute;
+
+ public AttributeUsageAttribute UsageAttribute {
+ get {
+ return usage_attribute;
+ }
+ }
+
+ MethodImplOptions ImplOptions;
+ UnmanagedType UnmanagedType;
+ CustomAttributeBuilder cb;
+
+ // non-null if named args present after Resolve () is called
+ PropertyInfo [] prop_info_arr;
+ FieldInfo [] field_info_arr;
+ object [] field_values_arr;
+ object [] prop_values_arr;
+ object [] pos_values;
+
+ static PtrHashtable usage_attr_cache = new PtrHashtable ();
+
+ public Attribute (string target, string name, ArrayList args, Location loc)
+ {
+ Name = name;
+ Arguments = args;
+ Location = loc;
+ ExplicitTarget = target;
+ }
+
+ void Error_InvalidNamedArgument (string name)
+ {
+ Report.Error (617, Location, "'" + name + "' is not a valid named attribute " +
+ "argument. Named attribute arguments must be fields which are not " +
+ "readonly, static or const, or read-write properties which are not static.");
+ }
+
+ static void Error_AttributeArgumentNotValid (Location loc)
+ {
+ Report.Error (182, loc,
+ "An attribute argument must be a constant expression, typeof " +
+ "expression or array creation expression");
+ }
+
+ /// <summary>
+ /// This is rather hack. We report many emit attribute error with same error to be compatible with
+ /// csc. But because csc has to report them this way because error came from ilasm we needn't.
+ /// </summary>
+ public void Error_AttributeEmitError (string inner)
+ {
+ Report.Error (647, Location, "Error emitting '{0}' attribute because '{1}'", Name, inner);
+ }
+
+ public void Error_InvalidSecurityParent ()
+ {
+ Error_AttributeEmitError ("it is attached to invalid parent");
+ }
+
+ void Error_AttributeConstructorMismatch ()
+ {
+ Report.Error (-6, Location,
+ "Could not find a constructor for this argument list.");
+ }
+
+ /// <summary>
+ /// Tries to resolve the type of the attribute. Flags an error if it can't, and complain is true.
+ /// </summary>
+ protected virtual Type CheckAttributeType (EmitContext ec, bool complain)
+ {
+ Type t1 = RootContext.LookupType (ec.DeclSpace, Name, true, Location);
+
+ // FIXME: Shouldn't do this for quoted attributes: [@A]
+ Type t2 = RootContext.LookupType (ec.DeclSpace, Name + "Attribute", true, Location);
+
+ String err0616 = null;
+
+ if (t1 != null && ! t1.IsSubclassOf (TypeManager.attribute_type)) {
+ t1 = null;
+ err0616 = "'" + Name + "': is not an attribute class";
+ }
+ if (t2 != null && ! t2.IsSubclassOf (TypeManager.attribute_type)) {
+ t2 = null;
+ err0616 = (err0616 != null)
+ ? "Neither '" + Name + "' nor '" + Name + "Attribute' is an attribute class"
+ : "'" + Name + "Attribute': is not an attribute class";
+ }
+
+ if (t1 != null && t2 != null) {
+ Report.Error(1614, Location, "'" + Name + "': is ambiguous; "
+ + " use either '@" + Name + "' or '" + Name + "Attribute'");
+ return null;
+ }
+ if (t1 != null)
+ return t1;
+ if (t2 != null)
+ return t2;
+
+ if (err0616 != null) {
+ Report.Error (616, Location, err0616);
+ return null;
+ }
+
+ if (complain)
+ Report.Error (246, Location,
+ "Could not find attribute '" + Name
+ + "' (are you missing a using directive or an assembly reference ?)");
+ return null;
+ }
+
+ public Type ResolveType (EmitContext ec, bool complain)
+ {
+ if (Type == null)
+ Type = CheckAttributeType (ec, complain);
+ return Type;
+ }
+
+ /// <summary>
+ /// Validates the guid string
+ /// </summary>
+ bool ValidateGuid (string guid)
+ {
+ try {
+ new Guid (guid);
+ return true;
+ } catch {
+ Report.Error (647, Location, "Format of GUID is invalid: " + guid);
+ return false;
+ }
+ }
+
+ string GetFullMemberName (string member)
+ {
+ return Type.FullName + '.' + member;
+ }
+
+ //
+ // Given an expression, if the expression is a valid attribute-argument-expression
+ // returns an object that can be used to encode it, or null on failure.
+ //
+ public static bool GetAttributeArgumentExpression (Expression e, Location loc, Type arg_type, out object result)
+ {
+ if (e is EnumConstant) {
+ if (RootContext.StdLib)
+ result = ((EnumConstant)e).GetValueAsEnumType ();
+ else
+ result = ((EnumConstant)e).GetValue ();
+
+ return true;
+ }
+
+ Constant constant = e as Constant;
+ if (constant != null) {
+ if (e.Type != arg_type) {
+ constant = Const.ChangeType (loc, constant, arg_type);
+ if (constant == null) {
+ result = null;
+ Error_AttributeArgumentNotValid (loc);
+ return false;
+ }
+ }
+ result = constant.GetValue ();
+ return true;
+ } else if (e is TypeOf) {
+ result = ((TypeOf) e).TypeArg;
+ return true;
+ } else if (e is ArrayCreation){
+ result = ((ArrayCreation) e).EncodeAsAttribute ();
+ if (result != null)
+ return true;
+ } else if (e is EmptyCast) {
+ Expression child = ((EmptyCast)e).Child;
+ return GetAttributeArgumentExpression (child, loc, child.Type, out result);
+ }
+
+ result = null;
+ Error_AttributeArgumentNotValid (loc);
+ return false;
+ }
+
+ public CustomAttributeBuilder Resolve (EmitContext ec)
+ {
+ Type oldType = Type;
+
+ // Sanity check.
+ Type = CheckAttributeType (ec, true);
+
+ if (oldType == null && Type == null)
+ return null;
+ if (oldType != null && oldType != Type){
+ Report.Error (-27, Location,
+ "Attribute {0} resolved to different types at different times: {1} vs. {2}",
+ Name, oldType, Type);
+ return null;
+ }
+
+ if (Type.IsAbstract) {
+ Report.Error (653, Location, "Cannot apply attribute class '{0}' because it is abstract", Name);
+ return null;
+ }
+
+ bool MethodImplAttr = false;
+ bool MarshalAsAttr = false;
+ bool GuidAttr = false;
+ bool usage_attr = false;
+
+ bool DoCompares = true;
+
+ //
+ // If we are a certain special attribute, we
+ // set the information accordingly
+ //
+
+ if (Type == TypeManager.attribute_usage_type)
+ usage_attr = true;
+ else if (Type == TypeManager.methodimpl_attr_type)
+ MethodImplAttr = true;
+ else if (Type == TypeManager.marshal_as_attr_type)
+ MarshalAsAttr = true;
+ else if (Type == TypeManager.guid_attr_type)
+ GuidAttr = true;
+ else
+ DoCompares = false;
+
+ // Now we extract the positional and named arguments
+
+ ArrayList pos_args = new ArrayList ();
+ ArrayList named_args = new ArrayList ();
+ int pos_arg_count = 0;
+
+ if (Arguments != null) {
+ pos_args = (ArrayList) Arguments [0];
+ if (pos_args != null)
+ pos_arg_count = pos_args.Count;
+ if (Arguments.Count > 1)
+ named_args = (ArrayList) Arguments [1];
+ }
+
+ pos_values = new object [pos_arg_count];
+
+ //
+ // First process positional arguments
+ //
+
+ int i;
+ for (i = 0; i < pos_arg_count; i++) {
+ Argument a = (Argument) pos_args [i];
+ Expression e;
+
+ if (!a.Resolve (ec, Location))
+ return null;
+
+ e = a.Expr;
+
+ object val;
+ if (!GetAttributeArgumentExpression (e, Location, a.Type, out val))
+ return null;
+
+ pos_values [i] = val;
+
+ if (DoCompares){
+ if (usage_attr) {
+ usage_attribute = new AttributeUsageAttribute ((AttributeTargets)val);
+ } else if (MethodImplAttr) {
+ this.ImplOptions = (MethodImplOptions) val;
+ } else if (GuidAttr){
+ //
+ // we will later check the validity of the type
+ //
+ if (val is string){
+ if (!ValidateGuid ((string) val))
+ return null;
+ }
+
+ } else if (MarshalAsAttr)
+ this.UnmanagedType =
+ (System.Runtime.InteropServices.UnmanagedType) val;
+ }
+ }
+
+ //
+ // Now process named arguments
+ //
+
+ ArrayList field_infos = null;
+ ArrayList prop_infos = null;
+ ArrayList field_values = null;
+ ArrayList prop_values = null;
+
+ if (named_args.Count > 0) {
+ field_infos = new ArrayList ();
+ prop_infos = new ArrayList ();
+ field_values = new ArrayList ();
+ prop_values = new ArrayList ();
+ }
+
+ Hashtable seen_names = new Hashtable();
+
+ for (i = 0; i < named_args.Count; i++) {
+ DictionaryEntry de = (DictionaryEntry) named_args [i];
+ string member_name = (string) de.Key;
+ Argument a = (Argument) de.Value;
+ Expression e;
+
+ if (seen_names.Contains(member_name)) {
+ Report.Error(643, Location, "'" + member_name + "' duplicate named attribute argument");
+ return null;
+ }
+ seen_names.Add(member_name, 1);
+
+ if (!a.Resolve (ec, Location))
+ return null;
+
+ Expression member = Expression.MemberLookup (
+ ec, Type, member_name,
+ MemberTypes.Field | MemberTypes.Property,
+ BindingFlags.Public | BindingFlags.Instance,
+ Location);
+
+ if (member == null) {
+ member = Expression.MemberLookup (ec, Type, member_name,
+ MemberTypes.Field | MemberTypes.Property, BindingFlags.NonPublic | BindingFlags.Instance,
+ Location);
+
+ if (member != null) {
+ Report.Error (122, Location, "'{0}' is inaccessible due to its protection level", GetFullMemberName (member_name));
+ return null;
+ }
+ }
+
+ if (member == null || !(member is PropertyExpr || member is FieldExpr)) {
+ Error_InvalidNamedArgument (member_name);
+ return null;
+ }
+
+ e = a.Expr;
+ if (member is PropertyExpr) {
+ PropertyExpr pe = (PropertyExpr) member;
+ PropertyInfo pi = pe.PropertyInfo;
+
+ if (!pi.CanWrite || !pi.CanRead) {
+ Report.SymbolRelatedToPreviousError (pi);
+ Error_InvalidNamedArgument (member_name);
+ return null;
+ }
+
+ object value;
+ if (!GetAttributeArgumentExpression (e, Location, pi.PropertyType, out value))
+ return null;
+
+ if (usage_attribute != null) {
+ if (member_name == "AllowMultiple")
+ usage_attribute.AllowMultiple = (bool) value;
+ if (member_name == "Inherited")
+ usage_attribute.Inherited = (bool) value;
+ }
+
+ prop_values.Add (value);
+ prop_infos.Add (pi);
+
+ } else if (member is FieldExpr) {
+ FieldExpr fe = (FieldExpr) member;
+ FieldInfo fi = fe.FieldInfo;
+
+ if (fi.IsInitOnly) {
+ Error_InvalidNamedArgument (member_name);
+ return null;
+ }
+
+ object value;
+ if (!GetAttributeArgumentExpression (e, Location, fi.FieldType, out value))
+ return null;
+
+ field_values.Add (value);
+ field_infos.Add (fi);
+ }
+ }
+
+ Expression mg = Expression.MemberLookup (
+ ec, Type, ".ctor", MemberTypes.Constructor,
+ BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly,
+ Location);
+
+ if (mg == null) {
+ Error_AttributeConstructorMismatch ();
+ return null;
+ }
+
+ MethodBase constructor = Invocation.OverloadResolve (
+ ec, (MethodGroupExpr) mg, pos_args, false, Location);
+
+ if (constructor == null) {
+ return null;
+ }
+
+ //
+ // Now we perform some checks on the positional args as they
+ // cannot be null for a constructor which expects a parameter
+ // of type object
+ //
+
+ ParameterData pd = Invocation.GetParameterData (constructor);
+
+ int group_in_params_array = Int32.MaxValue;
+ int pc = pd.Count;
+ if (pc > 0 && pd.ParameterModifier (pc-1) == Parameter.Modifier.PARAMS)
+ group_in_params_array = pc-1;
+
+ for (int j = 0; j < pos_arg_count; ++j) {
+ Argument a = (Argument) pos_args [j];
+
+ if (a.Expr is NullLiteral && pd.ParameterType (j) == TypeManager.object_type) {
+ Error_AttributeArgumentNotValid (Location);
+ return null;
+ }
+
+ if (j < group_in_params_array)
+ continue;
+
+ if (j == group_in_params_array){
+ object v = pos_values [j];
+ int count = pos_arg_count - j;
+
+ object [] array = new object [count];
+ pos_values [j] = array;
+ array [0] = v;
+ } else {
+ object [] array = (object []) pos_values [group_in_params_array];
+
+ array [j - group_in_params_array] = pos_values [j];
+ }
+ }
+
+ //
+ // Adjust the size of the pos_values if it had params
+ //
+ if (group_in_params_array != Int32.MaxValue){
+ int argc = group_in_params_array+1;
+ object [] new_pos_values = new object [argc];
+
+ for (int p = 0; p < argc; p++)
+ new_pos_values [p] = pos_values [p];
+ pos_values = new_pos_values;
+ }
+
+ try {
+ if (named_args.Count > 0) {
+ prop_info_arr = new PropertyInfo [prop_infos.Count];
+ field_info_arr = new FieldInfo [field_infos.Count];
+ field_values_arr = new object [field_values.Count];
+ prop_values_arr = new object [prop_values.Count];
+
+ field_infos.CopyTo (field_info_arr, 0);
+ field_values.CopyTo (field_values_arr, 0);
+
+ prop_values.CopyTo (prop_values_arr, 0);
+ prop_infos.CopyTo (prop_info_arr, 0);
+
+ cb = new CustomAttributeBuilder (
+ (ConstructorInfo) constructor, pos_values,
+ prop_info_arr, prop_values_arr,
+ field_info_arr, field_values_arr);
+ }
+ else
+ cb = new CustomAttributeBuilder (
+ (ConstructorInfo) constructor, pos_values);
+ } catch (NullReferenceException) {
+ //
+ // Don't know what to do here
+ //
+ Report.Warning (
+ -101, Location, "NullReferenceException while trying to create attribute." +
+ "Something's wrong!");
+ } catch (Exception e) {
+ //
+ // Sample:
+ // using System.ComponentModel;
+ // [DefaultValue (CollectionChangeAction.Add)]
+ // class X { static void Main () {} }
+ //
+ Report.Warning (
+ -23, Location, "The compiler can not encode this attribute in .NET due to a bug in the .NET runtime. Try the Mono runtime. The exception was: " + e.Message);
+ }
+
+ return cb;
+ }
+
+ /// <summary>
+ /// Get a string containing a list of valid targets for the attribute 'attr'
+ /// </summary>
+ public string GetValidTargets ()
+ {
+ StringBuilder sb = new StringBuilder ();
+ AttributeTargets targets = GetAttributeUsage ().ValidOn;
+
+ if ((targets & AttributeTargets.Assembly) != 0)
+ sb.Append ("'assembly' ");
+
+ if ((targets & AttributeTargets.Class) != 0)
+ sb.Append ("'class' ");
+
+ if ((targets & AttributeTargets.Constructor) != 0)
+ sb.Append ("'constructor' ");
+
+ if ((targets & AttributeTargets.Delegate) != 0)
+ sb.Append ("'delegate' ");
+
+ if ((targets & AttributeTargets.Enum) != 0)
+ sb.Append ("'enum' ");
+
+ if ((targets & AttributeTargets.Event) != 0)
+ sb.Append ("'event' ");
+
+ if ((targets & AttributeTargets.Field) != 0)
+ sb.Append ("'field' ");
+
+ if ((targets & AttributeTargets.Interface) != 0)
+ sb.Append ("'interface' ");
+
+ if ((targets & AttributeTargets.Method) != 0)
+ sb.Append ("'method' ");
+
+ if ((targets & AttributeTargets.Module) != 0)
+ sb.Append ("'module' ");
+
+ if ((targets & AttributeTargets.Parameter) != 0)
+ sb.Append ("'parameter' ");
+
+ if ((targets & AttributeTargets.Property) != 0)
+ sb.Append ("'property' ");
+
+ if ((targets & AttributeTargets.ReturnValue) != 0)
+ sb.Append ("'return' ");
+
+ if ((targets & AttributeTargets.Struct) != 0)
+ sb.Append ("'struct' ");
+
+ return sb.ToString ();
+
+ }
+
+ /// <summary>
+ /// Returns AttributeUsage attribute for this type
+ /// </summary>
+ public AttributeUsageAttribute GetAttributeUsage ()
+ {
+ AttributeUsageAttribute ua = usage_attr_cache [Type] as AttributeUsageAttribute;
+ if (ua != null)
+ return ua;
+
+ Class attr_class = TypeManager.LookupClass (Type);
+
+ if (attr_class == null) {
+ object[] usage_attr = Type.GetCustomAttributes (TypeManager.attribute_usage_type, true);
+ ua = (AttributeUsageAttribute)usage_attr [0];
+ usage_attr_cache.Add (Type, ua);
+ return ua;
+ }
+
+ return attr_class.AttributeUsage;
+ }
+
+ /// <summary>
+ /// Returns custom name of indexer
+ /// </summary>
+ public string GetIndexerAttributeValue (EmitContext ec)
+ {
+ if (pos_values == null) {
+ // TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.
+ // But because a lot of attribute class code must be rewritten will be better to wait...
+ Resolve (ec);
+ }
+
+ return pos_values [0] as string;
+ }
+
+ /// <summary>
+ /// Returns condition of ConditionalAttribute
+ /// </summary>
+ public string GetConditionalAttributeValue (DeclSpace ds)
+ {
+ if (pos_values == null) {
+ EmitContext ec = new EmitContext (ds, ds, Location, null, null, 0, false);
+
+ // TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.
+ // But because a lot of attribute class code must be rewritten will be better to wait...
+ Resolve (ec);
+ }
+
+ // Some error occurred
+ if (pos_values [0] == null)
+ return null;
+
+ return (string)pos_values [0];
+ }
+
+ /// <summary>
+ /// Creates the instance of ObsoleteAttribute from this attribute instance
+ /// </summary>
+ public ObsoleteAttribute GetObsoleteAttribute (DeclSpace ds)
+ {
+ if (pos_values == null) {
+ EmitContext ec = new EmitContext (ds, ds, Location, null, null, 0, false);
+
+ // TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.
+ // But because a lot of attribute class code must be rewritten will be better to wait...
+ Resolve (ec);
+ }
+
+ // Some error occurred
+ if (pos_values == null)
+ return null;
+
+ if (pos_values.Length == 0)
+ return new ObsoleteAttribute ();
+
+ if (pos_values.Length == 1)
+ return new ObsoleteAttribute ((string)pos_values [0]);
+
+ return new ObsoleteAttribute ((string)pos_values [0], (bool)pos_values [1]);
+ }
+
+ /// <summary>
+ /// Returns value of CLSCompliantAttribute contructor parameter but because the method can be called
+ /// before ApplyAttribute. We need to resolve the arguments.
+ /// This situation occurs when class deps is differs from Emit order.
+ /// </summary>
+ public bool GetClsCompliantAttributeValue (DeclSpace ds)
+ {
+ if (pos_values == null) {
+ EmitContext ec = new EmitContext (ds, ds, Location, null, null, 0, false);
+
+ // TODO: It is not neccessary to call whole Resolve (ApplyAttribute does it now) we need only ctor args.
+ // But because a lot of attribute class code must be rewritten will be better to wait...
+ Resolve (ec);
+ }
+
+ // Some error occurred
+ if (pos_values [0] == null)
+ return false;
+
+ return (bool)pos_values [0];
+ }
+
+ /// <summary>
+ /// Tests permitted SecurityAction for assembly or other types
+ /// </summary>
+ public bool CheckSecurityActionValidity (bool for_assembly)
+ {
+ SecurityAction action = GetSecurityActionValue ();
+
+ if ((action == SecurityAction.RequestMinimum || action == SecurityAction.RequestOptional || action == SecurityAction.RequestRefuse) && for_assembly)
+ return true;
+
+ if (!for_assembly) {
+ if (action < SecurityAction.Demand || action > SecurityAction.InheritanceDemand) {
+ Error_AttributeEmitError ("SecurityAction is out of range");
+ return false;
+ }
+
+ if ((action != SecurityAction.RequestMinimum && action != SecurityAction.RequestOptional && action != SecurityAction.RequestRefuse) && !for_assembly)
+ return true;
+ }
+
+ Error_AttributeEmitError (String.Concat ("SecurityAction '", action, "' is not valid for this declaration"));
+ return false;
+ }
+
+ System.Security.Permissions.SecurityAction GetSecurityActionValue ()
+ {
+ return (SecurityAction)pos_values [0];
+ }
+
+ /// <summary>
+ /// Creates instance of SecurityAttribute class and add result of CreatePermission method to permission table.
+ /// </summary>
+ /// <returns></returns>
+ public void ExtractSecurityPermissionSet (ListDictionary permissions)
+ {
+ if (TypeManager.LookupDeclSpace (Type) != null && RootContext.StdLib) {
+ Error_AttributeEmitError ("security custom attributes can not be referenced from defining assembly");
+ return;
+ }
+
+ SecurityAttribute sa;
+ // For all assemblies except corlib we can avoid all hacks
+ if (RootContext.StdLib) {
+ sa = (SecurityAttribute) Activator.CreateInstance (Type, pos_values);
+
+ if (prop_info_arr != null) {
+ for (int i = 0; i < prop_info_arr.Length; ++i) {
+ PropertyInfo pi = prop_info_arr [i];
+ pi.SetValue (sa, prop_values_arr [i], null);
+ }
+ }
+ } else {
+ Type temp_type = Type.GetType (Type.FullName);
+ // HACK: All mscorlib attributes have same ctor syntax
+ sa = (SecurityAttribute) Activator.CreateInstance (temp_type, new object[] { GetSecurityActionValue () } );
+
+ // All types are from newly created corlib but for invocation with old we need to convert them
+ if (prop_info_arr != null) {
+ for (int i = 0; i < prop_info_arr.Length; ++i) {
+ PropertyInfo emited_pi = prop_info_arr [i];
+ PropertyInfo pi = temp_type.GetProperty (emited_pi.Name, emited_pi.PropertyType);
+
+ object old_instance = pi.PropertyType.IsEnum ?
+ System.Enum.ToObject (pi.PropertyType, prop_values_arr [i]) :
+ prop_values_arr [i];
+
+ pi.SetValue (sa, old_instance, null);
+ }
+ }
+ }
+
+ IPermission perm = sa.CreatePermission ();
+ SecurityAction action;
+
+ // IS is correct because for corlib we are using an instance from old corlib
+ if (perm is System.Security.CodeAccessPermission) {
+ action = GetSecurityActionValue ();
+ } else {
+ switch (GetSecurityActionValue ()) {
+ case SecurityAction.Demand:
+ action = (SecurityAction)13;
+ break;
+ case SecurityAction.LinkDemand:
+ action = (SecurityAction)14;
+ break;
+ case SecurityAction.InheritanceDemand:
+ action = (SecurityAction)15;
+ break;
+ default:
+ Error_AttributeEmitError ("Invalid SecurityAction for non-Code Access Security permission");
+ return;
+ }
+ }
+
+ PermissionSet ps = (PermissionSet)permissions [action];
+ if (ps == null) {
+ ps = new PermissionSet (PermissionState.None);
+ permissions.Add (action, ps);
+ }
+ ps.AddPermission (sa.CreatePermission ());
+ }
+
+ object GetValue (object value)
+ {
+ if (value is EnumConstant)
+ return ((EnumConstant) value).GetValue ();
+ else
+ return value;
+ }
+
+ public object GetPositionalValue (int i)
+ {
+ return (pos_values == null) ? null : pos_values[i];
+ }
+
+ object GetFieldValue (string name)
+ {
+ int i;
+ if (field_info_arr == null)
+ return null;
+ i = 0;
+ foreach (FieldInfo fi in field_info_arr) {
+ if (fi.Name == name)
+ return GetValue (field_values_arr [i]);
+ i++;
+ }
+ return null;
+ }
+
+ public UnmanagedMarshal GetMarshal (Attributable attr)
+ {
+ object value = GetFieldValue ("SizeParamIndex");
+ if (value != null && UnmanagedType != UnmanagedType.LPArray) {
+ Error_AttributeEmitError ("SizeParamIndex field is not valid for the specified unmanaged type");
+ return null;
+ }
+
+ object o = GetFieldValue ("ArraySubType");
+ UnmanagedType array_sub_type = o == null ? UnmanagedType.I4 : (UnmanagedType) o;
+
+ switch (UnmanagedType) {
+ case UnmanagedType.CustomMarshaler:
+ MethodInfo define_custom = typeof (UnmanagedMarshal).GetMethod ("DefineCustom",
+ BindingFlags.Static | BindingFlags.Public);
+ if (define_custom == null) {
+ Report.RuntimeMissingSupport (Location, "set marshal info");
+ return null;
+ }
+
+ object [] args = new object [4];
+ args [0] = GetFieldValue ("MarshalTypeRef");
+ args [1] = GetFieldValue ("MarshalCookie");
+ args [2] = GetFieldValue ("MarshalType");
+ args [3] = Guid.Empty;
+ return (UnmanagedMarshal) define_custom.Invoke (null, args);
+
+ case UnmanagedType.LPArray:
+ return UnmanagedMarshal.DefineLPArray (array_sub_type);
+
+ case UnmanagedType.SafeArray:
+ return UnmanagedMarshal.DefineSafeArray (array_sub_type);
+
+ case UnmanagedType.ByValArray:
+ FieldMember fm = attr as FieldMember;
+ if (fm == null) {
+ Error_AttributeEmitError ("Specified unmanaged type is only valid on fields");
+ return null;
+ }
+ return UnmanagedMarshal.DefineByValArray ((int) GetFieldValue ("SizeConst"));
+
+ case UnmanagedType.ByValTStr:
+ return UnmanagedMarshal.DefineByValTStr ((int) GetFieldValue ("SizeConst"));
+
+ default:
+ return UnmanagedMarshal.DefineUnmanagedMarshal (UnmanagedType);
+ }
+ }
+
+ public bool IsInternalCall
+ {
+ get { return ImplOptions == MethodImplOptions.InternalCall; }
+ }
+
+ /// <summary>
+ /// Emit attribute for Attributable symbol
+ /// </summary>
+ public void Emit (EmitContext ec, Attributable ias, ListDictionary emitted_attr)
+ {
+ CustomAttributeBuilder cb = Resolve (ec);
+ if (cb == null)
+ return;
+
+ AttributeUsageAttribute usage_attr = GetAttributeUsage ();
+ if ((usage_attr.ValidOn & Target) == 0) {
+ Report.Error (592, Location, "Attribute '{0}' is not valid on this declaration type. It is valid on {1} declarations only.", Name, GetValidTargets ());
+ return;
+ }
+
+ ias.ApplyAttributeBuilder (this, cb);
+
+ if (!usage_attr.AllowMultiple) {
+ ArrayList emitted_targets = (ArrayList)emitted_attr [Type];
+ if (emitted_targets == null) {
+ emitted_targets = new ArrayList ();
+ emitted_attr.Add (Type, emitted_targets);
+ } else if (emitted_targets.Contains (Target)) {
+ Report.Error (579, Location, "Duplicate '" + Name + "' attribute");
+ return;
+ }
+ emitted_targets.Add (Target);
+ }
+
+ if (!RootContext.VerifyClsCompliance)
+ return;
+
+ // Here we are testing attribute arguments for array usage (error 3016)
+ if (ias.IsClsCompliaceRequired (ec.DeclSpace)) {
+ if (Arguments == null)
+ return;
+
+ ArrayList pos_args = (ArrayList) Arguments [0];
+ if (pos_args != null) {
+ foreach (Argument arg in pos_args) {
+ // Type is undefined (was error 246)
+ if (arg.Type == null)
+ return;
+
+ if (arg.Type.IsArray) {
+ Report.Error (3016, Location, "Arrays as attribute arguments are not CLS-compliant");
+ return;
+ }
+ }
+ }
+
+ if (Arguments.Count < 2)
+ return;
+
+ ArrayList named_args = (ArrayList) Arguments [1];
+ foreach (DictionaryEntry de in named_args) {
+ Argument arg = (Argument) de.Value;
+
+ // Type is undefined (was error 246)
+ if (arg.Type == null)
+ return;
+
+ if (arg.Type.IsArray) {
+ Report.Error (3016, Location, "Arrays as attribute arguments are not CLS-compliant");
+ return;
+ }
+ }
+ }
+ }
+
+ public object GetValue (EmitContext ec, Constant c, Type target)
+ {
+ if (Convert.ImplicitConversionExists (ec, c, target))
+ return c.GetValue ();
+
+ Convert.Error_CannotImplicitConversion (Location, c.Type, target);
+ return null;
+ }
+
+ public MethodBuilder DefinePInvokeMethod (EmitContext ec, TypeBuilder builder, string name,
+ MethodAttributes flags, Type ret_type, Type [] param_types)
+ {
+ //
+ // We extract from the attribute the information we need
+ //
+
+ if (Arguments == null) {
+ Console.WriteLine ("Internal error : this is not supposed to happen !");
+ return null;
+ }
+
+ ResolveType (ec, true);
+ if (Type == null)
+ return null;
+
+ ArrayList named_args = new ArrayList ();
+
+ ArrayList pos_args = (ArrayList) Arguments [0];
+ if (Arguments.Count > 1)
+ named_args = (ArrayList) Arguments [1];
+
+
+ string dll_name = null;
+
+ Argument tmp = (Argument) pos_args [0];
+
+ if (!tmp.Resolve (ec, Location))
+ return null;
+
+ if (tmp.Expr is Constant)
+ dll_name = (string) ((Constant) tmp.Expr).GetValue ();
+ else {
+ Error_AttributeArgumentNotValid (Location);
+ return null;
+ }
+
+ // Now we process the named arguments
+ CallingConvention cc = CallingConvention.Winapi;
+ CharSet charset = CharSet.Ansi;
+ bool preserve_sig = true;
+#if FIXME
+ bool exact_spelling = false;
+#endif
+ bool set_last_err = false;
+ string entry_point = null;
+
+ for (int i = 0; i < named_args.Count; i++) {
+
+ DictionaryEntry de = (DictionaryEntry) named_args [i];
+
+ string member_name = (string) de.Key;
+ Argument a = (Argument) de.Value;
+
+ if (!a.Resolve (ec, Location))
+ return null;
+
+ Expression member = Expression.MemberLookup (
+ ec, Type, member_name,
+ MemberTypes.Field | MemberTypes.Property,
+ BindingFlags.Public | BindingFlags.Instance,
+ Location);
+
+ if (member == null || !(member is FieldExpr)) {
+ Error_InvalidNamedArgument (member_name);
+ return null;
+ }
+
+ if (member is FieldExpr) {
+ FieldExpr fe = (FieldExpr) member;
+ FieldInfo fi = fe.FieldInfo;
+
+ if (fi.IsInitOnly) {
+ Error_InvalidNamedArgument (member_name);
+ return null;
+ }
+
+ if (a.Expr is Constant) {
+ Constant c = (Constant) a.Expr;
+
+ try {
+ if (member_name == "CallingConvention"){
+ object val = GetValue (ec, c, typeof (CallingConvention));
+ if (val == null)
+ return null;
+ cc = (CallingConvention) val;
+ } else if (member_name == "CharSet"){
+ charset = (CharSet) c.GetValue ();
+ } else if (member_name == "EntryPoint")
+ entry_point = (string) c.GetValue ();
+ else if (member_name == "SetLastError")
+ set_last_err = (bool) c.GetValue ();
+#if FIXME
+ else if (member_name == "ExactSpelling")
+ exact_spelling = (bool) c.GetValue ();
+#endif
+ else if (member_name == "PreserveSig")
+ preserve_sig = (bool) c.GetValue ();
+ } catch (InvalidCastException){
+ Error_InvalidNamedArgument (member_name);
+ Error_AttributeArgumentNotValid (Location);
+ }
+ } else {
+ Error_AttributeArgumentNotValid (Location);
+ return null;
+ }
+
+ }
+ }
+
+ if (entry_point == null)
+ entry_point = name;
+ if (set_last_err)
+ charset = (CharSet)((int)charset | 0x40);
+
+ MethodBuilder mb = builder.DefinePInvokeMethod (
+ name, dll_name, entry_point, flags | MethodAttributes.HideBySig,
+ CallingConventions.Standard,
+ ret_type,
+ param_types,
+ cc,
+ charset);
+
+ if (preserve_sig)
+ mb.SetImplementationFlags (MethodImplAttributes.PreserveSig);
+
+ return mb;
+ }
+
+ private Expression GetValue ()
+ {
+ if ((Arguments == null) || (Arguments.Count < 1))
+ return null;
+ ArrayList al = (ArrayList) Arguments [0];
+ if ((al == null) || (al.Count < 1))
+ return null;
+ Argument arg = (Argument) al [0];
+ if ((arg == null) || (arg.Expr == null))
+ return null;
+ return arg.Expr;
+ }
+
+ public string GetString ()
+ {
+ Expression e = GetValue ();
+ if (e is StringLiteral)
+ return (e as StringLiteral).Value;
+ return null;
+ }
+
+ public bool GetBoolean ()
+ {
+ Expression e = GetValue ();
+ if (e is BoolLiteral)
+ return (e as BoolLiteral).Value;
+ return false;
+ }
+ }
+
+
+ /// <summary>
+ /// For global attributes (assembly, module) we need special handling.
+ /// Attributes can be located in the several files
+ /// </summary>
+ public class GlobalAttribute: Attribute
+ {
+ public readonly NamespaceEntry ns;
+
+ public GlobalAttribute (TypeContainer container, string target, string name, ArrayList args, Location loc):
+ base (target, name, args, loc)
+ {
+ ns = container.NamespaceEntry;
+ }
+
+ protected override Type CheckAttributeType (EmitContext ec, bool complain)
+ {
+ NamespaceEntry old = ec.DeclSpace.NamespaceEntry;
+ if (old == null || old.NS == null || old.NS == Namespace.Root)
+ ec.DeclSpace.NamespaceEntry = ns;
+ return base.CheckAttributeType (ec, complain);
+ }
+ }
+
+ public class Attributes {
+ public ArrayList Attrs;
+
+ public Attributes (Attribute a)
+ {
+ Attrs = new ArrayList ();
+ Attrs.Add (a);
+ }
+
+ public Attributes (ArrayList attrs)
+ {
+ Attrs = attrs;
+ }
+
+ public void AddAttributes (ArrayList attrs)
+ {
+ Attrs.AddRange (attrs);
+ }
+
+ /// <summary>
+ /// Checks whether attribute target is valid for the current element
+ /// </summary>
+ public void CheckTargets (Attributable member)
+ {
+ string[] valid_targets = member.ValidAttributeTargets;
+ foreach (Attribute a in Attrs) {
+ if (a.ExplicitTarget == null || a.ExplicitTarget == valid_targets [0]) {
+ a.Target = member.AttributeTargets;
+ continue;
+ }
+
+ // TODO: we can skip the first item
+ if (((IList) valid_targets).Contains (a.ExplicitTarget)) {
+ switch (a.ExplicitTarget) {
+ case "return": a.Target = AttributeTargets.ReturnValue; continue;
+ case "param": a.Target = AttributeTargets.Parameter; continue;
+ case "field": a.Target = AttributeTargets.Field; continue;
+ case "method": a.Target = AttributeTargets.Method; continue;
+ case "property": a.Target = AttributeTargets.Property; continue;
+ }
+ throw new InternalErrorException ("Unknown explicit target: " + a.ExplicitTarget);
+ }
+
+ StringBuilder sb = new StringBuilder ();
+ foreach (string s in valid_targets) {
+ sb.Append (s);
+ sb.Append (", ");
+ }
+ sb.Remove (sb.Length - 2, 2);
+ Report.Error (657, a.Location, "'{0}' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are '{1}'", a.Target, sb.ToString ());
+ }
+ }
+
+ private Attribute Search (Type t, EmitContext ec, bool complain)
+ {
+ foreach (Attribute a in Attrs) {
+ if (a.ResolveType (ec, complain) == t)
+ return a;
+ }
+ return null;
+ }
+
+ public Attribute Search (Type t, EmitContext ec)
+ {
+ return Search (t, ec, true);
+ }
+
+ /// <summary>
+ /// Returns all attributes of type 't'. Use it when attribute is AllowMultiple = true
+ /// </summary>
+ public Attribute[] SearchMulti (Type t, EmitContext ec)
+ {
+ ArrayList ar = null;
+
+ foreach (Attribute a in Attrs) {
+ if (a.ResolveType (ec, false) == t) {
+ if (ar == null)
+ ar = new ArrayList ();
+ ar.Add (a);
+ }
+ }
+
+ return ar == null ? null : ar.ToArray (typeof (Attribute)) as Attribute[];
+ }
+
+ public void Emit (EmitContext ec, Attributable ias)
+ {
+ ListDictionary ld = new ListDictionary ();
+
+ foreach (Attribute a in Attrs)
+ a.Emit (ec, ias, ld);
+ }
+
+ public bool Contains (Type t, EmitContext ec)
+ {
+ return Search (t, ec) != null;
+ }
+
+ public Attribute GetClsCompliantAttribute (EmitContext ec)
+ {
+ return Search (TypeManager.cls_compliant_attribute_type, ec, false);
+ }
+
+ /// <summary>
+ /// Pulls the IndexerName attribute from an Indexer if it exists.
+ /// </summary>
+ public Attribute GetIndexerNameAttribute (EmitContext ec)
+ {
+ Attribute a = Search (TypeManager.indexer_name_type, ec, false);
+ if (a == null)
+ return null;
+
+ // Remove the attribute from the list because it is not emitted
+ Attrs.Remove (a);
+ return a;
+ }
+
+ }
+
+ /// <summary>
+ /// Helper class for attribute verification routine.
+ /// </summary>
+ sealed class AttributeTester
+ {
+ static PtrHashtable analyzed_types = new PtrHashtable ();
+ static PtrHashtable analyzed_types_obsolete = new PtrHashtable ();
+ static PtrHashtable analyzed_member_obsolete = new PtrHashtable ();
+ static PtrHashtable analyzed_method_excluded = new PtrHashtable ();
+
+ private AttributeTester ()
+ {
+ }
+
+ /// <summary>
+ /// Returns true if parameters of two compared methods are CLS-Compliant.
+ /// It tests differing only in ref or out, or in array rank.
+ /// </summary>
+ public static bool AreOverloadedMethodParamsClsCompliant (Type[] types_a, Type[] types_b)
+ {
+ if (types_a == null || types_b == null)
+ return true;
+
+ if (types_a.Length != types_b.Length)
+ return true;
+
+ for (int i = 0; i < types_b.Length; ++i) {
+ Type aType = types_a [i];
+ Type bType = types_b [i];
+
+ if (aType.IsArray && bType.IsArray && aType.GetArrayRank () != bType.GetArrayRank () && aType.GetElementType () == bType.GetElementType ()) {
+ return false;
+ }
+
+ Type aBaseType = aType;
+ bool is_either_ref_or_out = false;
+
+ if (aType.IsByRef || aType.IsPointer) {
+ aBaseType = aType.GetElementType ();
+ is_either_ref_or_out = true;
+ }
+
+ Type bBaseType = bType;
+ if (bType.IsByRef || bType.IsPointer)
+ {
+ bBaseType = bType.GetElementType ();
+ is_either_ref_or_out = !is_either_ref_or_out;
+ }
+
+ if (aBaseType != bBaseType)
+ continue;
+
+ if (is_either_ref_or_out)
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Goes through all parameters and test if they are CLS-Compliant.
+ /// </summary>
+ public static bool AreParametersCompliant (Parameter[] fixedParameters, Location loc)
+ {
+ if (fixedParameters == null)
+ return true;
+
+ foreach (Parameter arg in fixedParameters) {
+ if (!AttributeTester.IsClsCompliant (arg.ParameterType)) {
+ Report.Error (3001, loc, "Argument type '{0}' is not CLS-compliant", arg.GetSignatureForError ());
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+ /// <summary>
+ /// This method tests the CLS compliance of external types. It doesn't test type visibility.
+ /// </summary>
+ public static bool IsClsCompliant (Type type)
+ {
+ if (type == null)
+ return true;
+
+ object type_compliance = analyzed_types[type];
+ if (type_compliance != null)
+ return type_compliance == TRUE;
+
+ if (type.IsPointer) {
+ analyzed_types.Add (type, null);
+ return false;
+ }
+
+ bool result;
+ if (type.IsArray || type.IsByRef) {
+ result = IsClsCompliant (TypeManager.GetElementType (type));
+ } else {
+ result = AnalyzeTypeCompliance (type);
+ }
+ analyzed_types.Add (type, result ? TRUE : FALSE);
+ return result;
+ }
+
+ static object TRUE = new object ();
+ static object FALSE = new object ();
+
+ public static void VerifyModulesClsCompliance ()
+ {
+ Module[] modules = TypeManager.Modules;
+ if (modules == null)
+ return;
+
+ // The first module is generated assembly
+ for (int i = 1; i < modules.Length; ++i) {
+ Module module = modules [i];
+ if (!IsClsCompliant (module)) {
+ Report.Error (3013, "Added modules must be marked with the CLSCompliant attribute to match the assembly", module.Name);
+ return;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Tests container name for CLS-Compliant name (differing only in case)
+ /// </summary>
+ public static void VerifyTopLevelNameClsCompliance ()
+ {
+ Hashtable locase_table = new Hashtable ();
+
+ // Convert imported type names to lower case and ignore not cls compliant
+ foreach (DictionaryEntry de in TypeManager.all_imported_types) {
+ Type t = (Type)de.Value;
+ if (!AttributeTester.IsClsCompliant (t))
+ continue;
+
+ locase_table.Add (((string)de.Key).ToLower (System.Globalization.CultureInfo.InvariantCulture), t);
+ }
+
+ foreach (DictionaryEntry de in RootContext.Tree.Decls) {
+ DeclSpace decl = (DeclSpace)de.Value;
+ if (!decl.IsClsCompliaceRequired (decl))
+ continue;
+
+ string lcase = decl.Name.ToLower (System.Globalization.CultureInfo.InvariantCulture);
+ if (!locase_table.Contains (lcase)) {
+ locase_table.Add (lcase, decl);
+ continue;
+ }
+
+ object conflict = locase_table [lcase];
+ if (conflict is Type)
+ Report.SymbolRelatedToPreviousError ((Type)conflict);
+ else
+ Report.SymbolRelatedToPreviousError ((MemberCore)conflict);
+
+ Report.Error (3005, decl.Location, "Identifier '{0}' differing only in case is not CLS-compliant", decl.GetSignatureForError ());
+ }
+ }
+
+ static bool IsClsCompliant (ICustomAttributeProvider attribute_provider)
+ {
+ object[] CompliantAttribute = attribute_provider.GetCustomAttributes (TypeManager.cls_compliant_attribute_type, false);
+ if (CompliantAttribute.Length == 0)
+ return false;
+
+ return ((CLSCompliantAttribute)CompliantAttribute[0]).IsCompliant;
+ }
+
+ static bool AnalyzeTypeCompliance (Type type)
+ {
+ DeclSpace ds = TypeManager.LookupDeclSpace (type);
+ if (ds != null) {
+ return ds.IsClsCompliaceRequired (ds.Parent);
+ }
+
+ object[] CompliantAttribute = type.GetCustomAttributes (TypeManager.cls_compliant_attribute_type, false);
+ if (CompliantAttribute.Length == 0)
+ return IsClsCompliant (type.Assembly);
+
+ return ((CLSCompliantAttribute)CompliantAttribute[0]).IsCompliant;
+ }
+
+ /// <summary>
+ /// Returns instance of ObsoleteAttribute when type is obsolete
+ /// </summary>
+ public static ObsoleteAttribute GetObsoleteAttribute (Type type)
+ {
+ object type_obsolete = analyzed_types_obsolete [type];
+ if (type_obsolete == FALSE)
+ return null;
+
+ if (type_obsolete != null)
+ return (ObsoleteAttribute)type_obsolete;
+
+ ObsoleteAttribute result = null;
+ if (type.IsByRef || type.IsArray || type.IsPointer) {
+ result = GetObsoleteAttribute (TypeManager.GetElementType (type));
+ } else {
+ DeclSpace type_ds = TypeManager.LookupDeclSpace (type);
+
+ // Type is external, we can get attribute directly
+ if (type_ds == null) {
+ object[] attribute = type.GetCustomAttributes (TypeManager.obsolete_attribute_type, false);
+ if (attribute.Length == 1)
+ result = (ObsoleteAttribute)attribute [0];
+ } else {
+ result = type_ds.GetObsoleteAttribute (type_ds);
+ }
+ }
+
+ analyzed_types_obsolete.Add (type, result == null ? FALSE : result);
+ return result;
+ }
+
+ /// <summary>
+ /// Returns instance of ObsoleteAttribute when method is obsolete
+ /// </summary>
+ public static ObsoleteAttribute GetMethodObsoleteAttribute (MethodBase mb)
+ {
+ IMethodData mc = TypeManager.GetMethod (mb);
+ if (mc != null)
+ return mc.GetObsoleteAttribute ();
+
+ // compiler generated methods are not registered by AddMethod
+ if (mb.DeclaringType is TypeBuilder)
+ return null;
+
+ return GetMemberObsoleteAttribute (mb);
+ }
+
+ /// <summary>
+ /// Returns instance of ObsoleteAttribute when member is obsolete
+ /// </summary>
+ public static ObsoleteAttribute GetMemberObsoleteAttribute (MemberInfo mi)
+ {
+ object type_obsolete = analyzed_member_obsolete [mi];
+ if (type_obsolete == FALSE)
+ return null;
+
+ if (type_obsolete != null)
+ return (ObsoleteAttribute)type_obsolete;
+
+ ObsoleteAttribute oa = System.Attribute.GetCustomAttribute (mi, TypeManager.obsolete_attribute_type, false) as ObsoleteAttribute;
+ analyzed_member_obsolete.Add (mi, oa == null ? FALSE : oa);
+ return oa;
+ }
+
+ /// <summary>
+ /// Common method for Obsolete error/warning reporting.
+ /// </summary>
+ public static void Report_ObsoleteMessage (ObsoleteAttribute oa, string member, Location loc)
+ {
+ if (oa.IsError) {
+ Report.Error (619, loc, "'{0}' is obsolete: '{1}'", member, oa.Message);
+ return;
+ }
+
+ if (oa.Message == null) {
+ Report.Warning (612, loc, "'{0}' is obsolete", member);
+ return;
+ }
+ if (RootContext.WarningLevel >= 2)
+ Report.Warning (618, loc, "'{0}' is obsolete: '{1}'", member, oa.Message);
+ }
+
+ public static bool IsConditionalMethodExcluded (MethodBase mb)
+ {
+ object excluded = analyzed_method_excluded [mb];
+ if (excluded != null)
+ return excluded == TRUE ? true : false;
+
+ ConditionalAttribute[] attrs = mb.GetCustomAttributes (TypeManager.conditional_attribute_type, true) as ConditionalAttribute[];
+ if (attrs.Length == 0) {
+ analyzed_method_excluded.Add (mb, FALSE);
+ return false;
+ }
+
+ foreach (ConditionalAttribute a in attrs) {
+ if (RootContext.AllDefines.Contains (a.ConditionString)) {
+ analyzed_method_excluded.Add (mb, FALSE);
+ return false;
+ }
+ }
+ analyzed_method_excluded.Add (mb, TRUE);
+ return true;
+ }
+ }
+}
diff --git a/mcs/mcs/cfold.cs b/mcs/mcs/cfold.cs
index 1c564ce3e4c..12999eccdd8 100755
--- a/mcs/mcs/cfold.cs
+++ b/mcs/mcs/cfold.cs
@@ -4,7 +4,7 @@
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
-// (C) 2002 Ximian, Inc.
+// (C) 2002, 2003 Ximian, Inc.
//
using System;
@@ -26,8 +26,10 @@ namespace Mono.CSharp {
// (long, long)
// (uint, uint)
// (int, int)
+ // (short, short) (Happens with enumerations with underlying short type)
+ // (ushort, ushort) (Happens with enumerations with underlying short type)
//
- static void DoConstantNumericPromotions (Binary.Operator oper,
+ static void DoConstantNumericPromotions (EmitContext ec, Binary.Operator oper,
ref Constant left, ref Constant right,
Location loc)
{
@@ -57,16 +59,22 @@ namespace Mono.CSharp {
// converted to type ulong. or an error ocurrs if the other
// operand is of type sbyte, short, int or long
//
+#if WRONG
Constant match, other;
+#endif
if (left is ULongConstant){
+#if WRONG
other = right;
match = left;
+#endif
if (!(right is ULongConstant))
right = right.ToULong (loc);
} else {
+#if WRONG
other = left;
match = right;
+#endif
left = left.ToULong (loc);
}
@@ -93,14 +101,72 @@ namespace Mono.CSharp {
} else if (left is UIntConstant || right is UIntConstant){
//
// If either operand is of type uint, and the other
- // operand is of type sbyte, short or int, othe operands are
+ // operand is of type sbyte, short or int, the operands are
// converted to type long.
//
- if (!(left is UIntConstant))
+ Constant other;
+ if (left is UIntConstant)
+ other = right;
+ else
+ other = left;
+
+ // Nothing to do.
+ if (other is UIntConstant)
+ return;
+
+ IntConstant ic = other as IntConstant;
+ if (ic != null){
+ if (ic.Value >= 0){
+ if (left == other)
+ left = new UIntConstant ((uint) ic.Value);
+ else
+ right = new UIntConstant ((uint) ic.Value);
+ return;
+ }
+ }
+
+ if (other is SByteConstant || other is ShortConstant || ic != null){
+ left = left.ToLong (loc);
+ right = right.ToLong (loc);
+ } else {
left = left.ToUInt (loc);
- else if (!(right is UIntConstant))
- right = right.ToUInt (loc);
+ right = left.ToUInt (loc);
+ }
+
return;
+ } else if (left is EnumConstant || right is EnumConstant){
+ //
+ // If either operand is an enum constant, the other one must
+ // be implicitly convertable to that enum's underlying type.
+ //
+ EnumConstant match;
+ Constant other;
+ if (left is EnumConstant){
+ other = right;
+ match = (EnumConstant) left;
+ } else {
+ other = left;
+ match = (EnumConstant) right;
+ }
+
+ bool need_check = (other is EnumConstant) ||
+ ((oper != Binary.Operator.Addition) &&
+ (oper != Binary.Operator.Subtraction));
+
+ if (need_check &&
+ !Convert.ImplicitConversionExists (ec, match, other.Type)) {
+ Convert.Error_CannotImplicitConversion (loc, match.Type, other.Type);
+ left = null;
+ right = null;
+ return;
+ }
+
+ if (left is EnumConstant)
+ left = ((EnumConstant) left).Child;
+ if (right is EnumConstant)
+ right = ((EnumConstant) right).Child;
+ return;
+
} else {
//
// Force conversions to int32
@@ -130,7 +196,7 @@ namespace Mono.CSharp {
Type rt = right.Type;
Type result_type = null;
bool bool_res;
-
+
//
// Enumerator folding
//
@@ -147,10 +213,12 @@ namespace Mono.CSharp {
if (right is EnumConstant)
right = ((EnumConstant) right).Child;
}
-
+
+ Type wrap_as;
+ Constant result = null;
switch (oper){
case Binary.Operator.BitwiseOr:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -191,11 +259,31 @@ namespace Mono.CSharp {
return v;
else
return new EnumConstant (v, result_type);
+ } else if (left is UShortConstant){
+ UShortConstant v;
+ ushort res = (ushort) (((UShortConstant)left).Value |
+ ((UShortConstant)right).Value);
+
+ v = new UShortConstant (res);
+ if (result_type == null)
+ return v;
+ else
+ return new EnumConstant (v, result_type);
+ } else if (left is ShortConstant){
+ ShortConstant v;
+ short res = (short) (((ShortConstant)left).Value |
+ ((ShortConstant)right).Value);
+
+ v = new ShortConstant (res);
+ if (result_type == null)
+ return v;
+ else
+ return new EnumConstant (v, result_type);
}
break;
case Binary.Operator.BitwiseAnd:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -236,11 +324,31 @@ namespace Mono.CSharp {
return v;
else
return new EnumConstant (v, result_type);
+ } else if (left is UShortConstant){
+ UShortConstant v;
+ ushort res = (ushort) (((UShortConstant)left).Value &
+ ((UShortConstant)right).Value);
+
+ v = new UShortConstant (res);
+ if (result_type == null)
+ return v;
+ else
+ return new EnumConstant (v, result_type);
+ } else if (left is ShortConstant){
+ ShortConstant v;
+ short res = (short) (((ShortConstant)left).Value &
+ ((ShortConstant)right).Value);
+
+ v = new ShortConstant (res);
+ if (result_type == null)
+ return v;
+ else
+ return new EnumConstant (v, result_type);
}
break;
case Binary.Operator.ExclusiveOr:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -281,11 +389,30 @@ namespace Mono.CSharp {
return v;
else
return new EnumConstant (v, result_type);
+ } else if (left is UShortConstant){
+ UShortConstant v;
+ ushort res = (ushort) (((UShortConstant)left).Value ^
+ ((UShortConstant)right).Value);
+
+ v = new UShortConstant (res);
+ if (result_type == null)
+ return v;
+ else
+ return new EnumConstant (v, result_type);
+ } else if (left is ShortConstant){
+ ShortConstant v;
+ short res = (short)(((ShortConstant)left).Value ^
+ ((ShortConstant)right).Value);
+
+ v = new ShortConstant (res);
+ if (result_type == null)
+ return v;
+ else
+ return new EnumConstant (v, result_type);
}
break;
case Binary.Operator.Addition:
- Constant result;
bool left_is_string = left is StringConstant;
bool right_is_string = right is StringConstant;
@@ -294,6 +421,7 @@ namespace Mono.CSharp {
// one is a string, and the other is not, then defer
// to runtime concatenation
//
+ wrap_as = null;
if (left_is_string || right_is_string){
if (left_is_string && right_is_string)
return new StringConstant (
@@ -309,7 +437,6 @@ namespace Mono.CSharp {
//
// note that E operator + (E x, E y) is invalid
//
- Type wrap_as = null;
if (left is EnumConstant){
if (right is EnumConstant){
return null;
@@ -325,7 +452,7 @@ namespace Mono.CSharp {
}
result = null;
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -409,7 +536,30 @@ namespace Mono.CSharp {
return result;
case Binary.Operator.Subtraction:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ //
+ // handle "E operator - (E x, U y)"
+ // handle "E operator - (Y y, E x)"
+ // handle "U operator - (E x, E y)"
+ //
+ wrap_as = null;
+ if (left is EnumConstant){
+ if (right is EnumConstant){
+ if (left.Type == right.Type)
+ wrap_as = TypeManager.EnumToUnderlying (left.Type);
+ else
+ return null;
+ }
+ if (((EnumConstant) left).Child.Type != right.Type)
+ return null;
+
+ wrap_as = left.Type;
+ } else if (right is EnumConstant){
+ if (((EnumConstant) right).Child.Type != left.Type)
+ return null;
+ wrap_as = right.Type;
+ }
+
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -424,7 +574,7 @@ namespace Mono.CSharp {
res = unchecked (((DoubleConstant) left).Value -
((DoubleConstant) right).Value);
- return new DoubleConstant (res);
+ result = new DoubleConstant (res);
} else if (left is FloatConstant){
float res;
@@ -435,7 +585,7 @@ namespace Mono.CSharp {
res = unchecked (((FloatConstant) left).Value -
((FloatConstant) right).Value);
- return new FloatConstant (res);
+ result = new FloatConstant (res);
} else if (left is ULongConstant){
ulong res;
@@ -446,7 +596,7 @@ namespace Mono.CSharp {
res = unchecked (((ULongConstant) left).Value -
((ULongConstant) right).Value);
- return new ULongConstant (res);
+ result = new ULongConstant (res);
} else if (left is LongConstant){
long res;
@@ -457,7 +607,7 @@ namespace Mono.CSharp {
res = unchecked (((LongConstant) left).Value -
((LongConstant) right).Value);
- return new LongConstant (res);
+ result = new LongConstant (res);
} else if (left is UIntConstant){
uint res;
@@ -468,7 +618,7 @@ namespace Mono.CSharp {
res = unchecked (((UIntConstant) left).Value -
((UIntConstant) right).Value);
- return new UIntConstant (res);
+ result = new UIntConstant (res);
} else if (left is IntConstant){
int res;
@@ -479,17 +629,20 @@ namespace Mono.CSharp {
res = unchecked (((IntConstant) left).Value -
((IntConstant) right).Value);
- return new IntConstant (res);
+ result = new IntConstant (res);
} else {
throw new Exception ( "Unexepected input: " + left);
}
} catch (OverflowException){
Error_CompileTimeOverflow (loc);
}
- break;
+ if (wrap_as != null)
+ return new EnumConstant (result, wrap_as);
+ else
+ return result;
case Binary.Operator.Multiply:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -569,7 +722,7 @@ namespace Mono.CSharp {
break;
case Binary.Operator.Division:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -653,7 +806,7 @@ namespace Mono.CSharp {
break;
case Binary.Operator.Modulus:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -727,6 +880,8 @@ namespace Mono.CSharp {
} else {
throw new Exception ( "Unexepected input: " + left);
}
+ } catch (DivideByZeroException){
+ Report.Error (020, loc, "Division by constant zero");
} catch (OverflowException){
Error_CompileTimeOverflow (loc);
}
@@ -815,14 +970,27 @@ namespace Mono.CSharp {
((BoolConstant) right).Value);
}
+ if (left is NullLiteral){
+ if (right is NullLiteral)
+ return new BoolConstant (true);
+ else if (right is StringConstant)
+ return new BoolConstant (
+ ((StringConstant) right).Value == null);
+ } else if (right is NullLiteral){
+ if (left is NullLiteral)
+ return new BoolConstant (true);
+ else if (left is StringConstant)
+ return new BoolConstant (
+ ((StringConstant) left).Value == null);
+ }
if (left is StringConstant && right is StringConstant){
return new BoolConstant (
((StringConstant) left).Value ==
((StringConstant) right).Value);
}
-
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -856,13 +1024,26 @@ namespace Mono.CSharp {
((BoolConstant) left).Value !=
((BoolConstant) right).Value);
}
+ if (left is NullLiteral){
+ if (right is NullLiteral)
+ return new BoolConstant (false);
+ else if (right is StringConstant)
+ return new BoolConstant (
+ ((StringConstant) right).Value != null);
+ } else if (right is NullLiteral){
+ if (left is NullLiteral)
+ return new BoolConstant (false);
+ else if (left is StringConstant)
+ return new BoolConstant (
+ ((StringConstant) left).Value != null);
+ }
if (left is StringConstant && right is StringConstant){
return new BoolConstant (
((StringConstant) left).Value !=
((StringConstant) right).Value);
}
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -891,7 +1072,7 @@ namespace Mono.CSharp {
return new BoolConstant (bool_res);
case Binary.Operator.LessThan:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -920,7 +1101,7 @@ namespace Mono.CSharp {
return new BoolConstant (bool_res);
case Binary.Operator.GreaterThan:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -949,7 +1130,7 @@ namespace Mono.CSharp {
return new BoolConstant (bool_res);
case Binary.Operator.GreaterThanOrEqual:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
@@ -978,7 +1159,7 @@ namespace Mono.CSharp {
return new BoolConstant (bool_res);
case Binary.Operator.LessThanOrEqual:
- DoConstantNumericPromotions (oper, ref left, ref right, loc);
+ DoConstantNumericPromotions (ec, oper, ref left, ref right, loc);
if (left == null || right == null)
return null;
diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs
index d7ed00c856f..f793c3d1f5b 100755
--- a/mcs/mcs/class.cs
+++ b/mcs/mcs/class.cs
@@ -1,85 +1,438 @@
//
// class.cs: Class and Struct handlers
//
-// Author: Miguel de Icaza (miguel@gnu.org)
+// Authors: Miguel de Icaza (miguel@gnu.org)
+// Martin Baulig (martin@gnome.org)
+// Marek Safar (marek.safar@seznam.cz)
//
// Licensed under the terms of the GNU GPL
//
-// (C) 2001, 2002 Ximian, Inc (http://www.ximian.com)
+// (C) 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)
//
//
-
+// 2002-10-11 Miguel de Icaza <miguel@ximian.com>
+//
+// * class.cs: Following the comment from 2002-09-26 to AddMethod, I
+// have fixed a remaining problem: not every AddXXXX was adding a
+// fully qualified name.
+//
+// Now everyone registers a fully qualified name in the DeclSpace as
+// being defined instead of the partial name.
+//
+// Downsides: we are slower than we need to be due to the excess
+// copies and the names being registered this way.
+//
+// The reason for this is that we currently depend (on the corlib
+// bootstrap for instance) that types are fully qualified, because
+// we dump all the types in the namespace, and we should really have
+// types inserted into the proper namespace, so we can only store the
+// basenames in the defined_names array.
+//
+//
+#define CACHE
using System;
using System.Collections;
+using System.Collections.Specialized;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
-using System.Diagnostics.SymbolStore;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.Permissions;
+using System.Text;
+
+using Mono.CompilerServices.SymbolWriter;
namespace Mono.CSharp {
+ public enum Kind {
+ Root,
+ Struct,
+ Class,
+ Interface
+ }
+
/// <summary>
/// This is the base class for structs and classes.
/// </summary>
- public class TypeContainer : DeclSpace {
+ public abstract class TypeContainer : DeclSpace, IMemberContainer {
+
+ public class MemberCoreArrayList: ArrayList
+ {
+ /// <summary>
+ /// Defines the MemberCore objects that are in this array
+ /// </summary>
+ public virtual void DefineContainerMembers ()
+ {
+ foreach (MemberCore mc in this) {
+ mc.Define ();
+ }
+ }
+
+ public virtual void Emit ()
+ {
+ foreach (MemberCore mc in this)
+ mc.Emit ();
+ }
+ }
+
+ public class MethodArrayList: MemberCoreArrayList
+ {
+ [Flags]
+ enum CachedMethods {
+ Equals = 1,
+ GetHashCode = 1 << 1
+ }
+
+ CachedMethods cached_method;
+ TypeContainer container;
+
+ public MethodArrayList (TypeContainer container)
+ {
+ this.container = container;
+ }
+
+ /// <summary>
+ /// Method container contains Equals method
+ /// </summary>
+ public bool HasEquals {
+ set {
+ cached_method |= CachedMethods.Equals;
+ }
+
+ get {
+ return (cached_method & CachedMethods.Equals) != 0;
+ }
+ }
+
+ /// <summary>
+ /// Method container contains GetHashCode method
+ /// </summary>
+ public bool HasGetHashCode {
+ set {
+ cached_method |= CachedMethods.GetHashCode;
+ }
+
+ get {
+ return (cached_method & CachedMethods.GetHashCode) != 0;
+ }
+ }
+
+ public override void DefineContainerMembers ()
+ {
+ base.DefineContainerMembers ();
+
+ if ((RootContext.WarningLevel >= 3) && HasEquals && !HasGetHashCode) {
+ Report.Warning (659, container.Location, "'{0}' overrides Object.Equals(object) but does not override Object.GetHashCode()", container.GetSignatureForError ());
+ }
+ }
+
+ }
+
+ public sealed class IndexerArrayList: MemberCoreArrayList
+ {
+ /// <summary>
+ /// The indexer name for this container
+ /// </summary>
+ public string IndexerName = DefaultIndexerName;
+
+ bool seen_normal_indexers = false;
+
+ TypeContainer container;
+
+ public IndexerArrayList (TypeContainer container)
+ {
+ this.container = container;
+ }
+
+ /// <summary>
+ /// Defines the indexers, and also verifies that the IndexerNameAttribute in the
+ /// class is consistent. Either it is `Item' or it is the name defined by all the
+ /// indexers with the `IndexerName' attribute.
+ ///
+ /// Turns out that the IndexerNameAttribute is applied to each indexer,
+ /// but it is never emitted, instead a DefaultMember attribute is attached
+ /// to the class.
+ /// </summary>
+ public override void DefineContainerMembers()
+ {
+ base.DefineContainerMembers ();
+
+ string class_indexer_name = null;
+
+ //
+ // If there's both an explicit and an implicit interface implementation, the
+ // explicit one actually implements the interface while the other one is just
+ // a normal indexer. See bug #37714.
+ //
+
+ // Invariant maintained by AddIndexer(): All explicit interface indexers precede normal indexers
+ foreach (Indexer i in this) {
+ if (i.InterfaceType != null) {
+ if (seen_normal_indexers)
+ throw new Exception ("Internal Error: 'Indexers' array not sorted properly.");
+ continue;
+ }
+
+ seen_normal_indexers = true;
+
+ if (class_indexer_name == null) {
+ class_indexer_name = i.ShortName;
+ continue;
+ }
+
+ if (i.ShortName != class_indexer_name)
+ Report.Error (668, i.Location, "Two indexers have different names; the IndexerName attribute must be used with the same name on every indexer within a type");
+ }
+
+ if (class_indexer_name != null)
+ IndexerName = class_indexer_name;
+ }
+
+ public override void Emit ()
+ {
+ base.Emit ();
+
+ if (!seen_normal_indexers)
+ return;
+
+ CustomAttributeBuilder cb = new CustomAttributeBuilder (TypeManager.default_member_ctor, new string [] { IndexerName });
+ container.TypeBuilder.SetCustomAttribute (cb);
+ }
+ }
+
+ public class OperatorArrayList: MemberCoreArrayList
+ {
+ TypeContainer container;
+
+ public OperatorArrayList (TypeContainer container)
+ {
+ this.container = container;
+ }
+
+ //
+ // Operator pair checking
+ //
+ class OperatorEntry
+ {
+ public int flags;
+ public Type ret_type;
+ public Type type1, type2;
+ public Operator op;
+ public Operator.OpType ot;
+
+ public OperatorEntry (int f, Operator o)
+ {
+ flags = f;
+
+ ret_type = o.OperatorMethod.ReturnType;
+ Type [] pt = o.OperatorMethod.ParameterTypes;
+ type1 = pt [0];
+ type2 = pt [1];
+ op = o;
+ ot = o.OperatorType;
+ }
+
+ public override int GetHashCode ()
+ {
+ return ret_type.GetHashCode ();
+ }
+
+ public override bool Equals (object o)
+ {
+ OperatorEntry other = (OperatorEntry) o;
+
+ if (other.ret_type != ret_type)
+ return false;
+ if (other.type1 != type1)
+ return false;
+ if (other.type2 != type2)
+ return false;
+ return true;
+ }
+ }
+
+ //
+ // Checks that some operators come in pairs:
+ // == and !=
+ // > and <
+ // >= and <=
+ // true and false
+ //
+ // They are matched based on the return type and the argument types
+ //
+ void CheckPairedOperators ()
+ {
+ Hashtable pairs = new Hashtable (null, null);
+ Operator true_op = null;
+ Operator false_op = null;
+ bool has_equality_or_inequality = false;
+
+ // Register all the operators we care about.
+ foreach (Operator op in this){
+ int reg = 0;
+
+ switch (op.OperatorType){
+ case Operator.OpType.Equality:
+ reg = 1;
+ has_equality_or_inequality = true;
+ break;
+ case Operator.OpType.Inequality:
+ reg = 2;
+ has_equality_or_inequality = true;
+ break;
+
+ case Operator.OpType.True:
+ true_op = op;
+ break;
+ case Operator.OpType.False:
+ false_op = op;
+ break;
+
+ case Operator.OpType.GreaterThan:
+ reg = 1; break;
+ case Operator.OpType.LessThan:
+ reg = 2; break;
+
+ case Operator.OpType.GreaterThanOrEqual:
+ reg = 1; break;
+ case Operator.OpType.LessThanOrEqual:
+ reg = 2; break;
+ }
+ if (reg == 0)
+ continue;
+
+ OperatorEntry oe = new OperatorEntry (reg, op);
+
+ object o = pairs [oe];
+ if (o == null)
+ pairs [oe] = oe;
+ else {
+ oe = (OperatorEntry) o;
+ oe.flags |= reg;
+ }
+ }
+
+ if (true_op != null){
+ if (false_op == null)
+ Report.Error (216, true_op.Location, "operator true requires a matching operator false");
+ } else if (false_op != null)
+ Report.Error (216, false_op.Location, "operator false requires a matching operator true");
+
+ //
+ // Look for the mistakes.
+ //
+ foreach (DictionaryEntry de in pairs){
+ OperatorEntry oe = (OperatorEntry) de.Key;
+
+ if (oe.flags == 3)
+ continue;
+
+ string s = "";
+ switch (oe.ot){
+ case Operator.OpType.Equality:
+ s = "!=";
+ break;
+ case Operator.OpType.Inequality:
+ s = "==";
+ break;
+ case Operator.OpType.GreaterThan:
+ s = "<";
+ break;
+ case Operator.OpType.LessThan:
+ s = ">";
+ break;
+ case Operator.OpType.GreaterThanOrEqual:
+ s = "<=";
+ break;
+ case Operator.OpType.LessThanOrEqual:
+ s = ">=";
+ break;
+ }
+ Report.Error (216, oe.op.Location,
+ "The operator `" + oe.op + "' requires a matching operator `" + s + "' to also be defined");
+ }
+
+ if (has_equality_or_inequality && (RootContext.WarningLevel > 2)) {
+ if (container.Methods == null || !container.Methods.HasEquals)
+ Report.Warning (660, container.Location, "'{0}' defines operator == or operator != but does not override Object.Equals(object o)", container.GetSignatureForError ());
+
+ if (container.Methods == null || !container.Methods.HasGetHashCode)
+ Report.Warning (661, container.Location, "'{0}' defines operator == or operator != but does not override Object.GetHashCode()", container.GetSignatureForError ());
+ }
+ }
+
+ public override void DefineContainerMembers ()
+ {
+ base.DefineContainerMembers ();
+ CheckPairedOperators ();
+ }
+ }
+
+
+ // Whether this is a struct, class or interface
+ public readonly Kind Kind;
+
// Holds a list of classes and structures
ArrayList types;
// Holds the list of properties
- ArrayList properties;
+ MemberCoreArrayList properties;
// Holds the list of enumerations
- ArrayList enums;
+ MemberCoreArrayList enums;
// Holds the list of delegates
- ArrayList delegates;
+ MemberCoreArrayList delegates;
// Holds the list of constructors
- ArrayList instance_constructors;
+ protected MemberCoreArrayList instance_constructors;
// Holds the list of fields
- ArrayList fields;
+ MemberCoreArrayList fields;
// Holds a list of fields that have initializers
- ArrayList initialized_fields;
+ protected ArrayList initialized_fields;
// Holds a list of static fields that have initializers
- ArrayList initialized_static_fields;
+ protected ArrayList initialized_static_fields;
// Holds the list of constants
- ArrayList constants;
+ MemberCoreArrayList constants;
// Holds the list of
- ArrayList interfaces;
+ MemberCoreArrayList interfaces;
- // Holds order in which interfaces must be closed
- ArrayList interface_order;
-
// Holds the methods.
- ArrayList methods;
+ MethodArrayList methods;
// Holds the events
- ArrayList events;
+ protected MemberCoreArrayList events;
// Holds the indexers
- ArrayList indexers;
+ IndexerArrayList indexers;
// Holds the operators
- ArrayList operators;
+ MemberCoreArrayList operators;
+
+ // Holds the iterators
+ ArrayList iterators;
+
+ // Holds the parts of a partial class;
+ ArrayList parts;
// The emit context for toplevel objects.
EmitContext ec;
-
- //
- // Pointers to the default constructor and the default static constructor
- //
- Constructor default_constructor;
- Constructor default_static_constructor;
+
+ public EmitContext EmitContext {
+ get { return ec; }
+ }
//
- // Whether we have seen a static constructor for this class or not
+ // Pointers to the default constructor and the default static constructor
//
- bool have_static_constructor = false;
+ protected Constructor default_constructor;
+ protected Constructor default_static_constructor;
//
// Whether we have at least one non-static field
@@ -91,307 +444,286 @@ namespace Mono.CSharp {
// from classes from the arraylist `type_bases'
//
string base_class_name;
+ public Type base_class_type;
ArrayList type_bases;
- // Attributes for this type
- protected Attributes attributes;
+ bool members_defined;
+ bool members_defined_ok;
- // Information in the case we are an attribute type
+ // The interfaces we implement.
+ TypeExpr [] ifaces;
+ protected Type[] base_inteface_types;
- public AttributeTargets Targets = AttributeTargets.All;
- public bool AllowMultiple = false;
- public bool Inherited;
+ // The parent member container and our member cache
+ IMemberContainer parent_container;
+ MemberCache member_cache;
- // The interfaces we implement.
- Type [] ifaces;
+ public const string DefaultIndexerName = "Item";
- //
- // The indexer name for this class
- //
- public string IndexerName;
-
- public TypeContainer (TypeContainer parent, string name, Location l)
- : base (parent, name, l)
+ public TypeContainer (NamespaceEntry ns, TypeContainer parent, MemberName name,
+ Attributes attrs, Kind kind, Location l)
+ : base (ns, parent, name, attrs, l)
{
- string n;
- types = new ArrayList ();
+ this.Kind = kind;
- if (parent == null)
- n = "";
- else
- n = parent.Name;
+ types = new ArrayList ();
base_class_name = null;
-
- //Console.WriteLine ("New class " + name + " inside " + n);
}
- public AdditionResult AddConstant (Const constant)
+ public bool AddToMemberContainer (MemberCore symbol, bool is_method)
{
- AdditionResult res;
- string name = constant.Name;
+ return AddToContainer (symbol, is_method, String.Concat (Name, '.', symbol.Name), symbol.Name);
+ }
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (constants == null)
- constants = new ArrayList ();
+ bool AddToTypeContainer (DeclSpace ds)
+ {
+ return AddToContainer (ds, false, ds.Name, ds.Basename);
+ }
- constants.Add (constant);
- DefineName (name, constant);
+ public void AddConstant (Const constant)
+ {
+ if (!AddToMemberContainer (constant, false))
+ return;
- return AdditionResult.Success;
+ if (constants == null)
+ constants = new MemberCoreArrayList ();
+
+ constants.Add (constant);
}
- public AdditionResult AddEnum (Mono.CSharp.Enum e)
+ public void AddEnum (Mono.CSharp.Enum e)
{
- AdditionResult res;
- string name = e.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
+ if (!AddToTypeContainer (e))
+ return;
if (enums == null)
- enums = new ArrayList ();
+ enums = new MemberCoreArrayList ();
enums.Add (e);
- DefineName (name, e);
-
- return AdditionResult.Success;
}
- public AdditionResult AddClass (Class c)
+ public void AddClassOrStruct (TypeContainer c)
{
- AdditionResult res;
- string name = c.Name;
-
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
+ if (!AddToTypeContainer (c))
+ return;
- DefineName (name, c);
types.Add (c);
-
- return AdditionResult.Success;
}
- public AdditionResult AddStruct (Struct s)
+ public void AddDelegate (Delegate d)
{
- AdditionResult res;
- string name = s.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- DefineName (name, s);
- types.Add (s);
-
- return AdditionResult.Success;
- }
-
- public AdditionResult AddDelegate (Delegate d)
- {
- AdditionResult res;
- string name = d.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
+ if (!AddToTypeContainer (d))
+ return;
if (delegates == null)
- delegates = new ArrayList ();
+ delegates = new MemberCoreArrayList ();
- DefineName (name, d);
delegates.Add (d);
-
- return AdditionResult.Success;
}
- public AdditionResult AddMethod (Method method)
+ public void AddMethod (Method method)
{
- string name = method.Name;
- Object value = defined_names [name];
-
- if (value != null && (!(value is Method)))
- return AdditionResult.NameExists;
+ if (!AddToMemberContainer (method, true))
+ return;
if (methods == null)
- methods = new ArrayList ();
-
- if (method.Name.IndexOf (".") != -1)
+ methods = new MethodArrayList (this);
+
+ if (method.Name.IndexOf ('.') != -1)
methods.Insert (0, method);
else
methods.Add (method);
-
- if (value != null)
- DefineName (name, method);
-
- return AdditionResult.Success;
}
- public AdditionResult AddConstructor (Constructor c)
+ public void AddConstructor (Constructor c)
{
- if (c.Name != Basename)
- return AdditionResult.NotAConstructor;
+ if (c.Name != Basename) {
+ Report.Error (1520, c.Location, "Class, struct, or interface method must have a return type");
+ }
bool is_static = (c.ModFlags & Modifiers.STATIC) != 0;
if (is_static){
- have_static_constructor = true;
- if (default_static_constructor != null){
- Console.WriteLine ("I have a static constructor already");
- Console.WriteLine (" " + default_static_constructor);
- return AdditionResult.MethodExists;
+ if (default_static_constructor != null) {
+ Report.SymbolRelatedToPreviousError (default_static_constructor);
+ Report.Error (111, c.Location, Error111, Name, c.Name);
+ return;
}
default_static_constructor = c;
} else {
if (c.IsDefault ()){
- if (default_constructor != null)
- return AdditionResult.MethodExists;
+ if (default_constructor != null) {
+ Report.SymbolRelatedToPreviousError (default_constructor);
+ Report.Error (111, c.Location, Error111, c.Location, Name, c.Name);
+ return;
+ }
default_constructor = c;
}
if (instance_constructors == null)
- instance_constructors = new ArrayList ();
+ instance_constructors = new MemberCoreArrayList ();
instance_constructors.Add (c);
}
-
- return AdditionResult.Success;
+ }
+
+ internal static string Error111 {
+ get {
+ return "Type '{0}' already defines a member called '{1}' with the same parameter types";
+ }
}
- public AdditionResult AddInterface (Interface iface)
+ public void AddInterface (TypeContainer iface)
{
- AdditionResult res;
- string name = iface.Name;
+ if (!AddToTypeContainer (iface))
+ return;
+
+ if (interfaces == null) {
+ interfaces = new MemberCoreArrayList ();
+ }
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
-
- if (interfaces == null)
- interfaces = new ArrayList ();
interfaces.Add (iface);
- DefineName (name, iface);
-
- return AdditionResult.Success;
}
- public AdditionResult AddField (Field field)
+ public void AddField (Field field)
{
- AdditionResult res;
- string name = field.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
+ if (!AddToMemberContainer (field, false))
+ return;
if (fields == null)
- fields = new ArrayList ();
-
- fields.Add (field);
+ fields = new MemberCoreArrayList ();
- if (field.Initializer != null){
+ fields.Add (field);
+
+ if (field.HasInitializer){
if ((field.ModFlags & Modifiers.STATIC) != 0){
if (initialized_static_fields == null)
initialized_static_fields = new ArrayList ();
-
+
initialized_static_fields.Add (field);
-
- //
- // We have not seen a static constructor,
- // but we will provide static initialization of fields
- //
- have_static_constructor = true;
} else {
if (initialized_fields == null)
initialized_fields = new ArrayList ();
-
+
initialized_fields.Add (field);
}
}
-
+
if ((field.ModFlags & Modifiers.STATIC) == 0)
have_nonstatic_fields = true;
-
- DefineName (name, field);
- return AdditionResult.Success;
}
- public AdditionResult AddProperty (Property prop)
+ public void AddProperty (Property prop)
{
- AdditionResult res;
- string name = prop.Name;
-
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
+ if (!AddToMemberContainer (prop, false) ||
+ !AddToMemberContainer (prop.Get, true) || !AddToMemberContainer (prop.Set, true))
+ return;
if (properties == null)
- properties = new ArrayList ();
+ properties = new MemberCoreArrayList ();
- if (prop.Name.IndexOf (".") != -1)
+ if (prop.Name.IndexOf ('.') != -1)
properties.Insert (0, prop);
else
properties.Add (prop);
- DefineName (name, prop);
-
- return AdditionResult.Success;
}
- public AdditionResult AddEvent (Event e)
+ public void AddEvent (Event e)
{
- AdditionResult res;
- string name = e.Name;
+ if (!AddToMemberContainer (e, false))
+ return;
- if ((res = IsValid (name)) != AdditionResult.Success)
- return res;
+ if (e is EventProperty) {
+ if (!AddToMemberContainer (e.Add, true))
+ return;
+
+ if (!AddToMemberContainer (e.Remove, true))
+ return;
+ }
if (events == null)
- events = new ArrayList ();
-
- events.Add (e);
- DefineName (name, e);
+ events = new MemberCoreArrayList ();
- return AdditionResult.Success;
+ events.Add (e);
}
- public AdditionResult AddIndexer (Indexer i)
+
+ /// <summary>
+ /// Indexer has special handling in constrast to other AddXXX because the name can be driven by IndexerNameAttribute
+ /// </summary>
+ public void AddIndexer (Indexer i)
{
if (indexers == null)
- indexers = new ArrayList ();
+ indexers = new IndexerArrayList (this);
- if (i.InterfaceType != null)
+ if (i.IsExplicitImpl)
indexers.Insert (0, i);
else
indexers.Add (i);
-
- return AdditionResult.Success;
}
- public AdditionResult AddOperator (Operator op)
+ public void AddOperator (Operator op)
{
+ if (!AddToMemberContainer (op, true))
+ return;
+
if (operators == null)
- operators = new ArrayList ();
+ operators = new OperatorArrayList (this);
operators.Add (op);
+ }
+
+ public void AddIterator (Iterator i)
+ {
+ if (iterators == null)
+ iterators = new ArrayList ();
+
+ iterators.Add (i);
+ }
- return AdditionResult.Success;
+ public void AddType (TypeContainer tc)
+ {
+ types.Add (tc);
}
- public void RegisterOrder (Interface iface)
+ public void AddPart (ClassPart part)
{
- if (interface_order == null)
- interface_order = new ArrayList ();
+ if (parts == null)
+ parts = new ArrayList ();
- interface_order.Add (iface);
+ parts.Add (part);
}
-
+
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type == TypeManager.default_member_type) {
+ if (Indexers != null) {
+ Report.Error (646, a.Location,
+ "Cannot specify the DefaultMember attribute on" +
+ " a type containing an indexer");
+ return;
+ }
+ }
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ throw new NotSupportedException ();
+ }
+ }
+
public ArrayList Types {
get {
return types;
}
}
- public ArrayList Methods {
+ public MethodArrayList Methods {
get {
return methods;
}
@@ -408,6 +740,12 @@ namespace Mono.CSharp {
return interfaces;
}
}
+
+ public ArrayList Iterators {
+ get {
+ return iterators;
+ }
+ }
public string Base {
get {
@@ -472,22 +810,22 @@ namespace Mono.CSharp {
return delegates;
}
}
-
- public Attributes OptAttributes {
+
+ public ArrayList Parts {
get {
- return attributes;
+ return parts;
}
}
-
- public bool HaveStaticConstructor {
+
+ public virtual TypeAttributes TypeAttr {
get {
- return have_static_constructor;
+ return Modifiers.TypeAttr (ModFlags, this);
}
}
-
- public virtual TypeAttributes TypeAttr {
+
+ public string IndexerName {
get {
- return Modifiers.TypeAttr (ModFlags, this);
+ return indexers == null ? DefaultIndexerName : indexers.IndexerName;
}
}
@@ -497,7 +835,6 @@ namespace Mono.CSharp {
public bool EmitFieldInitializers (EmitContext ec)
{
ArrayList fields;
- ILGenerator ig = ec.ig;
Expression instance_expr;
if (ec.IsStatic){
@@ -510,289 +847,390 @@ namespace Mono.CSharp {
if (fields == null)
return true;
-
- foreach (Field f in fields){
- Object init = f.Initializer;
- Expression e;
- if (init is Expression)
- e = (Expression) init;
- else {
- string base_type = f.Type.Substring (0, f.Type.IndexOf ("["));
- string rank = f.Type.Substring (f.Type.IndexOf ("["));
- e = new ArrayCreation (base_type, rank, (ArrayList)init, f.Location);
- }
+ foreach (Field f in fields){
+ Expression e = f.GetInitializerExpression (ec);
+ if (e == null)
+ return false;
Location l = f.Location;
FieldExpr fe = new FieldExpr (f.FieldBuilder, l);
fe.InstanceExpression = instance_expr;
- Expression a = new Assign (fe, e, l);
+ ExpressionStatement a = new Assign (fe, e, l);
- a = a.Resolve (ec);
+ a = a.ResolveStatement (ec);
if (a == null)
return false;
- if (a is ExpressionStatement)
- ((ExpressionStatement) a).EmitStatement (ec);
- else {
- throw new Exception ("Assign.Resolve returned a non ExpressionStatement");
- }
+ a.EmitStatement (ec);
}
-
+
return true;
}
//
// Defines the default constructors
//
- void DefineDefaultConstructor (bool is_static)
+ protected void DefineDefaultConstructor (bool is_static)
{
Constructor c;
- int mods = 0;
-
- c = new Constructor (Basename, Parameters.GetEmptyReadOnlyParameters (),
- new ConstructorBaseInitializer (null, new Location (-1)),
- new Location (-1));
-
- if (is_static)
- mods = Modifiers.STATIC;
- c.ModFlags = mods;
+ // The default constructor is public
+ // If the class is abstract, the default constructor is protected
+ // The default static constructor is private
- AddConstructor (c);
+ int mods = Modifiers.PUBLIC;
+ if (is_static)
+ mods = Modifiers.STATIC | Modifiers.PRIVATE;
+ else if ((ModFlags & Modifiers.ABSTRACT) != 0)
+ mods = Modifiers.PROTECTED;
+
+ c = new Constructor (this, Basename, mods, Parameters.EmptyReadOnlyParameters,
+ new ConstructorBaseInitializer (
+ null, Parameters.EmptyReadOnlyParameters,
+ Location),
+ Location);
- c.Block = new Block (null);
+ AddConstructor (c);
- }
-
- public void ReportStructInitializedInstanceError ()
- {
- string n = TypeBuilder.FullName;
+ c.Block = new ToplevelBlock (null, Location);
- foreach (Field f in initialized_fields){
- Report.Error (
- 573, Location,
- "`" + n + "." + f.Name + "': can not have " +
- "instance field initializers in structs");
- }
}
/// <remarks>
- /// The pending methods that need to be implemented (interfaces or abstract methods)
+ /// The pending methods that need to be implemented
+ // (interfaces or abstract methods)
/// </remarks>
public PendingImplementation Pending;
- /// <summary>
- /// This function computes the Base class and also the
- /// list of interfaces that the class or struct @c implements.
- ///
- /// The return value is an array (might be null) of
- /// interfaces implemented (as Types).
- ///
- /// The @parent argument is set to the parent object or null
- /// if this is `System.Object'.
- /// </summary>
- Type [] GetClassBases (bool is_class, out Type parent, out bool error)
+ public abstract void Register ();
+
+ public abstract PendingImplementation GetPendingImplementations ();
+
+ TypeExpr[] GetPartialBases (out TypeExpr parent, out bool error)
{
- ArrayList bases = Bases;
- int count;
- int start, j, i;
+ ArrayList ifaces = new ArrayList ();
- error = false;
+ parent = null;
+ Location parent_loc = Location.Null;
- if (is_class)
- parent = null;
- else
- parent = TypeManager.value_type;
+ foreach (ClassPart part in parts) {
+ TypeExpr new_parent;
+ TypeExpr[] new_ifaces;
- if (bases == null){
- if (is_class){
- if (RootContext.StdLib)
- parent = TypeManager.object_type;
- else if (Name != "System.Object")
- parent = TypeManager.object_type;
- } else {
- //
- // If we are compiling our runtime,
- // and we are defining ValueType, then our
- // parent is `System.Object'.
- //
- if (!RootContext.StdLib && Name == "System.ValueType")
- parent = TypeManager.object_type;
+ new_ifaces = part.GetClassBases (out new_parent, out error);
+ if (error)
+ return null;
+
+ if ((parent != null) && (new_parent != null) &&
+ !parent.Equals (new_parent)) {
+ Report.Error (263, part.Location,
+ "Partial declarations of `{0}' must " +
+ "not specify different base classes",
+ Name);
+
+ if (!Location.IsNull (parent_loc))
+ Report.LocationOfPreviousError (parent_loc);
+
+ error = true;
+ return null;
}
- return null;
+ if ((parent == null) && (new_parent != null)) {
+ parent = new_parent;
+ parent_loc = part.Location;
+ }
+
+ if (new_ifaces == null)
+ continue;
+
+ foreach (TypeExpr iface in new_ifaces) {
+ bool found = false;
+ foreach (TypeExpr old_iface in ifaces) {
+ if (old_iface.Equals (iface)) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ ifaces.Add (iface);
+ }
}
- //
- // Bases should be null if there are no bases at all
- //
- count = bases.Count;
+ error = false;
+
+ TypeExpr[] retval = new TypeExpr [ifaces.Count];
+ ifaces.CopyTo (retval, 0);
+ return retval;
+ }
+
+ TypeExpr[] GetNormalBases (out TypeExpr parent, out bool error)
+ {
+ parent = null;
+
+ int count = Bases.Count;
+ int start, i, j;
- if (is_class){
- string name = (string) bases [0];
- Type first = FindType (name);
+ if (Kind == Kind.Class){
+ TypeExpr name = ResolveTypeExpr (
+ (Expression) Bases [0], false, Location);
- if (first == null){
+ if (name == null){
error = true;
return null;
}
- if (first.IsClass){
- parent = first;
+ if (name.IsClass){
+ parent = name;
start = 1;
} else {
- parent = TypeManager.object_type;
start = 0;
}
-
} else {
start = 0;
}
- Type [] ifaces = new Type [count-start];
+ TypeExpr [] ifaces = new TypeExpr [count-start];
for (i = start, j = 0; i < count; i++, j++){
- string name = (string) bases [i];
- Type t = FindType (name);
-
- if (t == null){
+ Expression name = (Expression) Bases [i];
+ TypeExpr resolved = ResolveTypeExpr (name, false, Location);
+ if (resolved == null) {
error = true;
return null;
}
+
+ ifaces [j] = resolved;
+ }
- if (is_class == false && !t.IsInterface){
- Report.Error (527, "In Struct `" + Name + "', type `"+
- name +"' is not an interface");
+ error = false;
+ return ifaces;
+ }
+
+ /// <summary>
+ /// This function computes the Base class and also the
+ /// list of interfaces that the class or struct @c implements.
+ ///
+ /// The return value is an array (might be null) of
+ /// interfaces implemented (as Types).
+ ///
+ /// The @parent argument is set to the parent object or null
+ /// if this is `System.Object'.
+ /// </summary>
+ TypeExpr [] GetClassBases (out TypeExpr parent, out bool error)
+ {
+ int i;
+
+ error = false;
+
+ TypeExpr[] ifaces;
+
+ if (parts != null)
+ ifaces = GetPartialBases (out parent, out error);
+ else if (Bases == null){
+ parent = null;
+ return null;
+ } else
+ ifaces = GetNormalBases (out parent, out error);
+
+ if (error)
+ return null;
+
+ if ((parent != null) && (Kind == Kind.Class)){
+ if (parent.IsSealed){
error = true;
+ Report.SymbolRelatedToPreviousError (parent.Type);
+ if (parent.Type.IsAbstract) {
+ Report.Error (709, Location, "'{0}': Cannot derive from static class", GetSignatureForError ());
+ } else {
+ Report.Error (509, Location, "'{0}': Cannot derive from sealed class", GetSignatureForError ());
+ }
return null;
}
-
- if (t.IsSealed) {
- string detail = "";
-
- if (t.IsValueType)
- detail = " (a class can not inherit from a struct/enum)";
-
- Report.Error (509, "class `"+ Name +
- "': Cannot inherit from sealed class `"+
- bases [i]+"'"+detail);
+
+ if (!parent.CanInheritFrom ()){
+ Report.Error (644, Location,
+ "`{0}' cannot inherit from special class `{1}'",
+ Name, parent.Name);
error = true;
return null;
}
- if (t.IsClass) {
+ if (!parent.AsAccessible (this, ModFlags))
+ Report.Error (60, Location,
+ "Inconsistent accessibility: base class `" +
+ parent.Name + "' is less accessible than class `" +
+ Name + "'");
+ }
+
+ if (parent != null)
+ base_class_name = parent.Name;
+
+ if (ifaces == null)
+ return null;
+
+ int count = ifaces != null ? ifaces.Length : 0;
+
+ for (i = 0; i < count; i++) {
+ TypeExpr iface = (TypeExpr) ifaces [i];
+
+ if ((Kind != Kind.Class) && !iface.IsInterface){
+ string what = Kind == Kind.Struct ?
+ "Struct" : "Interface";
+
+ Report.Error (527, Location,
+ "In {0} `{1}', type `{2}' is not "+
+ "an interface", what, Name, iface.Name);
+ error = true;
+ return null;
+ }
+
+ if (iface.IsClass) {
if (parent != null){
- Report.Error (527, "In Class `" + Name + "', type `"+
- name+"' is not an interface");
+ Report.Error (527, Location,
+ "In Class `{0}', `{1}' is not " +
+ "an interface", Name, iface.Name);
error = true;
return null;
}
}
- for (int x = 0; x < j; x++) {
- if (t == ifaces [x]) {
- Report.Error (528, "`" + name + "' is already listed in interface list");
+ for (int x = 0; x < i; x++) {
+ if (iface.Equals (ifaces [x])) {
+ Report.Error (528, Location,
+ "`{0}' is already listed in " +
+ "interface list", iface.Name);
error = true;
return null;
}
}
-
- ifaces [j] = t;
+
+ if ((Kind == Kind.Interface) &&
+ !iface.AsAccessible (Parent, ModFlags))
+ Report.Error (61, Location,
+ "Inconsistent accessibility: base " +
+ "interface `{0}' is less accessible " +
+ "than interface `{1}'", iface.Name,
+ Name);
}
return TypeManager.ExpandInterfaces (ifaces);
}
+
+ bool error = false;
//
// Defines the type in the appropriate ModuleBuilder or TypeBuilder.
//
public override TypeBuilder DefineType ()
{
- Type parent;
- bool error;
- bool is_class;
+ TypeExpr parent;
if (TypeBuilder != null)
return TypeBuilder;
-
- if (InTransit)
+
+ if (error)
return null;
+
+ if (InTransit) {
+ Report.Error (146, Location, "Class definition is circular: `{0}'", Name);
+ error = true;
+ return null;
+ }
InTransit = true;
-
- if (this is Class)
- is_class = true;
- else
- is_class = false;
ec = new EmitContext (this, Mono.CSharp.Location.Null, null, null, ModFlags);
- ifaces = GetClassBases (is_class, out parent, out error);
-
+ ifaces = GetClassBases (out parent, out error);
if (error)
return null;
- if (is_class && parent != null){
- if (parent == TypeManager.enum_type ||
- (parent == TypeManager.value_type && RootContext.StdLib) ||
- parent == TypeManager.delegate_type ||
- parent == TypeManager.array_type){
- Report.Error (
- 644, Location, "`" + Name + "' cannot inherit from " +
- "special class `" + TypeManager.CSharpName (parent) + "'");
- return null;
+ if (parent == null) {
+ if (Kind == Kind.Class){
+ if (RootContext.StdLib)
+ parent = TypeManager.system_object_expr;
+ else if (Name != "System.Object")
+ parent = TypeManager.system_object_expr;
+ } else if (Kind == Kind.Struct) {
+ //
+ // If we are compiling our runtime,
+ // and we are defining ValueType, then our
+ // parent is `System.Object'.
+ //
+ if (!RootContext.StdLib && Name == "System.ValueType")
+ parent = TypeManager.system_object_expr;
+ else
+ parent = TypeManager.system_valuetype_expr;
}
}
- if (!is_class && TypeManager.value_type == null)
+ if ((Kind == Kind.Struct) && TypeManager.value_type == null)
throw new Exception ();
TypeAttributes type_attributes = TypeAttr;
- // if (parent_builder is ModuleBuilder) {
- if (IsTopLevel){
- ModuleBuilder builder = CodeGen.ModuleBuilder;
-
- //
- // Structs with no fields need to have a ".size 1"
- // appended
- //
+ if (parent != null) {
+ base_class_type = parent.ResolveType (ec);
+ if (base_class_type == null) {
+ error = true;
+ return null;
+ }
+ }
- if (!is_class && !have_nonstatic_fields)
- TypeBuilder = builder.DefineType (Name,
- type_attributes,
- parent,
- PackingSize.Unspecified, 1);
- else
- //
- // classes or structs with fields
- //
- TypeBuilder = builder.DefineType (Name,
- type_attributes,
- parent,
- ifaces);
- } else {
- TypeBuilder builder = Parent.TypeBuilder;
+ try {
+ if (IsTopLevel){
+ if (TypeManager.NamespaceClash (Name, Location)) {
+ error = true;
+ return null;
+ }
- //
- // Structs with no fields need to have a ".size 1"
- // appended
- //
- if (!is_class && !have_nonstatic_fields)
- TypeBuilder = builder.DefineNestedType (Basename,
- type_attributes,
- parent,
- PackingSize.Unspecified);
- else {
- //
- // classes or structs with fields
- //
- TypeBuilder = builder.DefineNestedType (Basename,
- type_attributes,
- parent,
- ifaces);
+ ModuleBuilder builder = CodeGen.Module.Builder;
+ TypeBuilder = builder.DefineType (
+ Name, type_attributes, base_class_type, null);
+
+ } else {
+ TypeBuilder builder = Parent.DefineType ();
+ if (builder == null)
+ return null;
+
+ TypeBuilder = builder.DefineNestedType (
+ Basename, type_attributes, base_class_type, null);
+ }
+ }
+ catch (ArgumentException) {
+ Report.RuntimeMissingSupport (Location, "static classes");
+ return null;
+ }
+
+ //
+ // Structs with no fields need to have at least one byte.
+ // The right thing would be to set the PackingSize in a DefineType
+ // but there are no functions that allow interfaces *and* the size to
+ // be specified.
+ //
+
+ if ((Kind == Kind.Struct) && !have_nonstatic_fields){
+ TypeBuilder.DefineField ("$PRIVATE$", TypeManager.byte_type,
+ FieldAttributes.Private);
+ }
+
+ // add interfaces that were not added at type creation
+ if (ifaces != null) {
+ base_inteface_types = new Type[ifaces.Length];
+ for (int i = 0; i < ifaces.Length; ++i) {
+ Type itype = ifaces [i].ResolveType (ec);
+ if (itype == null) {
+ error = true;
+ continue;
+ }
+ TypeBuilder.AddInterfaceImplementation (itype);
+ base_inteface_types [i] = itype;
}
+
+ if (error)
+ return null;
}
//
@@ -802,159 +1240,117 @@ namespace Mono.CSharp {
TypeManager.AddUserType (Name, TypeBuilder, this, ifaces);
- if (parent == TypeManager.attribute_type ||
- parent.IsSubclassOf (TypeManager.attribute_type)) {
+ if ((parent != null) && parent.IsAttribute) {
RootContext.RegisterAttribute (this);
- TypeManager.RegisterAttrType (TypeBuilder, this);
- } else
+ } else if (!(this is Iterator))
RootContext.RegisterOrder (this);
-
+
+ if (!DefineNestedTypes ()) {
+ error = true;
+ return null;
+ }
+
+ InTransit = false;
+ return TypeBuilder;
+ }
+
+ protected virtual bool DefineNestedTypes ()
+ {
if (Interfaces != null) {
- foreach (Interface iface in Interfaces)
- iface.DefineType ();
+ foreach (TypeContainer iface in Interfaces)
+ if (iface.DefineType () == null)
+ return false;
}
if (Types != null) {
foreach (TypeContainer tc in Types)
- tc.DefineType ();
+ if (tc.DefineType () == null)
+ return false;
}
if (Delegates != null) {
foreach (Delegate d in Delegates)
- d.DefineType ();
+ if (d.DefineType () == null)
+ return false;
}
if (Enums != null) {
foreach (Enum en in Enums)
- en.DefineType ();
+ if (en.DefineType () == null)
+ return false;
}
- InTransit = false;
- return TypeBuilder;
- }
-
-
- /// <summary>
- /// Defines the MemberCore objects that are in the `list' Arraylist
- ///
- /// The `defined_names' array contains a list of members defined in
- /// a base class
- /// </summary>
- static ArrayList remove_list = new ArrayList ();
- void DefineMembers (ArrayList list, MemberInfo [] defined_names)
- {
- int idx;
-
- remove_list.Clear ();
-
- foreach (MemberCore mc in list){
- if (!mc.Define (this)){
- remove_list.Add (mc);
- continue;
- }
-
- if (defined_names == null)
- continue;
-
- idx = Array.BinarySearch (defined_names, mc.Name, mif_compare);
- if (idx < 0){
- if (RootContext.WarningLevel >= 4){
- if ((mc.ModFlags & Modifiers.NEW) != 0)
- Warning_KewywordNewNotRequired (mc.Location, mc);
- }
- continue;
+ if (Parts != null) {
+ foreach (ClassPart part in Parts) {
+ part.TypeBuilder = TypeBuilder;
+ part.base_class_type = base_class_type;
+ part.ec = new EmitContext (part, Mono.CSharp.Location.Null, null, null, ModFlags);
}
-
- MemberInfo match = defined_names [idx];
-
- if (match is PropertyInfo && ((mc.ModFlags & Modifiers.OVERRIDE) != 0))
- continue;
-
- //
- // If we are both methods, let the method resolution emit warnings
- //
- if (match is MethodBase && mc is MethodCore)
- continue;
-
- if ((mc.ModFlags & Modifiers.NEW) == 0)
- Warning_KeywordNewRequired (mc.Location, defined_names [idx]);
}
-
- foreach (object o in remove_list)
- list.Remove (o);
-
- remove_list.Clear ();
+
+ return true;
}
- //
- // Defines the indexers, and also verifies that the IndexerNameAttribute in the
- // class is consisten. Either it is `Item' or it is the name defined by all the
- // indexers with the `IndexerName' attribute.
- //
- // Turns out that the IndexerNameAttribute is applied to each indexer,
- // but it is never emitted, instead a DefaultName attribute is attached
- // to the class.
- //
- void DefineIndexers ()
+ static void Error_KeywordNotAllowed (Location loc)
{
- string class_indexer_name = null;
-
- foreach (Indexer i in Indexers){
- string name;
-
- i.Define (this);
-
- name = i.IndexerName;
- if (class_indexer_name == null){
- class_indexer_name = name;
- continue;
- }
-
- if (name == class_indexer_name)
- continue;
-
- Report.Error (
- 668, "Two indexers have different names, " +
- " you should use the same name for all your indexers");
- }
- if (class_indexer_name == null)
- class_indexer_name = "Item";
- IndexerName = class_indexer_name;
+ Report.Error (1530, loc, "Keyword new not allowed for namespace elements");
}
-
+
/// <summary>
/// Populates our TypeBuilder with fields and methods
/// </summary>
- public override bool Define (TypeContainer parent)
+ public override bool DefineMembers (TypeContainer container)
{
- MemberInfo [] defined_names = null;
-
- if (RootContext.WarningLevel > 1){
- Type ptype;
-
- //
- // This code throws an exception in the comparer
- // I guess the string is not an object?
- //
- ptype = TypeBuilder.BaseType;
- if (ptype != null){
- defined_names = FindMembers (
- ptype, MemberTypes.All & ~MemberTypes.Constructor,
- BindingFlags.Public | BindingFlags.Instance |
- BindingFlags.Static, null, null);
+ if (members_defined)
+ return members_defined_ok;
- Array.Sort (defined_names, mif_compare);
- }
- }
-
- if (constants != null)
- DefineMembers (constants, defined_names);
+ members_defined_ok = DoDefineMembers ();
+ members_defined = true;
- if (fields != null)
- DefineMembers (fields, defined_names);
+ return members_defined_ok;
+ }
- if (this is Class){
- if (instance_constructors == null){
+ bool DoDefineMembers ()
+ {
+ //
+ // We need to be able to use the member cache while we are checking/defining
+ //
+ if (TypeBuilder.BaseType != null)
+ parent_container = TypeManager.LookupMemberContainer (TypeBuilder.BaseType);
+
+ if (TypeBuilder.IsInterface)
+ parent_container = TypeManager.LookupInterfaceContainer (base_inteface_types);
+
+ if (IsTopLevel) {
+ if ((ModFlags & Modifiers.NEW) != 0)
+ Error_KeywordNotAllowed (Location);
+ } else {
+ // HACK: missing implemenation
+ // This is not fully functional. Better way how to handle this is to have recursive definition of containers
+ // instead of flat as we have now.
+ // Now we are not able to check inner attribute class because its parent had not been defined.
+
+ // TODO: remove this if
+ if (Parent.MemberCache != null) {
+ MemberInfo conflict_symbol = Parent.MemberCache.FindMemberWithSameName (Basename, false, TypeBuilder);
+ if (conflict_symbol == null) {
+ if ((RootContext.WarningLevel >= 4) && ((ModFlags & Modifiers.NEW) != 0))
+ Report.Warning (109, Location, "The member '{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError ());
+ } else {
+ if ((ModFlags & Modifiers.NEW) == 0) {
+ Report.SymbolRelatedToPreviousError (conflict_symbol);
+ Report.Warning (108, Location, "The keyword new is required on '{0}' because it hides inherited member", GetSignatureForError ());
+ }
+ }
+ }
+ }
+
+ DefineContainerMembers (constants);
+ DefineContainerMembers (fields);
+
+ if ((Kind == Kind.Class) && !(this is ClassPart) && !(this is StaticClass)){
+ if ((instance_constructors == null) &&
+ !(this is StaticClass)) {
if (default_constructor == null)
DefineDefaultConstructor (false);
}
@@ -964,7 +1360,7 @@ namespace Mono.CSharp {
DefineDefaultConstructor (true);
}
- if (this is Struct){
+ if (Kind == Kind.Struct){
//
// Structs can not have initialized instance
// fields
@@ -977,54 +1373,91 @@ namespace Mono.CSharp {
ReportStructInitializedInstanceError ();
}
- Pending = PendingImplementation.GetPendingImplementations (this);
-
+ Pending = GetPendingImplementations ();
+
+ if (parts != null) {
+ foreach (ClassPart part in parts) {
+ if (!part.DefineMembers (this))
+ return false;
+ }
+ }
+
//
// Constructors are not in the defined_names array
//
- if (instance_constructors != null)
- DefineMembers (instance_constructors, null);
+ DefineContainerMembers (instance_constructors);
if (default_static_constructor != null)
- default_static_constructor.Define (this);
+ default_static_constructor.Define ();
- if (methods != null)
- DefineMembers (methods, defined_names);
-
- if (properties != null)
- DefineMembers (properties, defined_names);
+ DefineContainerMembers (properties);
+ DefineContainerMembers (events);
+ DefineContainerMembers (indexers);
+ DefineContainerMembers (methods);
+ DefineContainerMembers (operators);
+ DefineContainerMembers (enums);
+ DefineContainerMembers (delegates);
+
+#if CACHE
+ if (!(this is ClassPart))
+ member_cache = new MemberCache (this, false);
+#endif
+
+ if (parts != null) {
+ foreach (ClassPart part in parts)
+ part.member_cache = member_cache;
+ }
- if (events != null)
- DefineMembers (events, defined_names);
+ if (iterators != null) {
+ foreach (Iterator iterator in iterators) {
+ if (iterator.DefineType () == null)
+ return false;
+ }
- if (indexers != null) {
- DefineIndexers ();
- } else
- IndexerName = "Item";
+ foreach (Iterator iterator in iterators) {
+ if (!iterator.DefineMembers (this))
+ return false;
+ }
+ }
- if (operators != null)
- DefineMembers (operators, null);
+ return true;
+ }
- if (enums != null)
- DefineMembers (enums, defined_names);
+ void ReportStructInitializedInstanceError ()
+ {
+ string n = TypeBuilder.FullName;
- if (delegates != null)
- DefineMembers (delegates, defined_names);
+ foreach (Field f in initialized_fields){
+ Report.Error (
+ 573, Location,
+ "`" + n + "." + f.Name + "': can not have " +
+ "instance field initializers in structs");
+ }
+ }
+
+ protected virtual void DefineContainerMembers (MemberCoreArrayList mcal)
+ {
+ if (mcal != null)
+ mcal.DefineContainerMembers ();
+ }
+
+ public override bool Define ()
+ {
+ if (parts != null) {
+ foreach (ClassPart part in parts) {
+ if (!part.Define ())
+ return false;
+ }
+ }
return true;
}
- /// <summary>
- /// Looks up the alias for the name
- /// </summary>
- public string LookupAlias (string name)
+ public MemberInfo FindMemberWithSameName (string name, bool ignore_methods)
{
- if (Namespace != null)
- return Namespace.LookupAlias (name);
- else
- return null;
+ return ParentContainer.MemberCache.FindMemberWithSameName (name, ignore_methods, null);
}
-
+
/// <summary>
/// This function is based by a delegate to the FindMembers routine
/// </summary>
@@ -1040,15 +1473,81 @@ namespace Mono.CSharp {
static MemberFilter accepting_filter;
- /// <summary>
- /// A member comparission method based on name only
- /// </summary>
- static IComparer mif_compare;
-
static TypeContainer ()
{
accepting_filter = new MemberFilter (AlwaysAccept);
- mif_compare = new MemberInfoCompare ();
+ }
+
+ public MethodInfo[] GetMethods ()
+ {
+ ArrayList members = new ArrayList ();
+
+ DefineMembers (null);
+
+ if (methods != null) {
+ int len = methods.Count;
+ for (int i = 0; i < len; i++) {
+ Method m = (Method) methods [i];
+
+ members.Add (m.MethodBuilder);
+ }
+ }
+
+ if (operators != null) {
+ int len = operators.Count;
+ for (int i = 0; i < len; i++) {
+ Operator o = (Operator) operators [i];
+
+ members.Add (o.OperatorMethodBuilder);
+ }
+ }
+
+ if (properties != null) {
+ int len = properties.Count;
+ for (int i = 0; i < len; i++) {
+ Property p = (Property) properties [i];
+
+ if (p.GetBuilder != null)
+ members.Add (p.GetBuilder);
+ if (p.SetBuilder != null)
+ members.Add (p.SetBuilder);
+ }
+ }
+
+ if (indexers != null) {
+ int len = indexers.Count;
+ for (int i = 0; i < len; i++) {
+ Indexer ix = (Indexer) indexers [i];
+
+ if (ix.GetBuilder != null)
+ members.Add (ix.GetBuilder);
+ if (ix.SetBuilder != null)
+ members.Add (ix.SetBuilder);
+ }
+ }
+
+ if (events != null) {
+ int len = events.Count;
+ for (int i = 0; i < len; i++) {
+ Event e = (Event) events [i];
+
+ if (e.AddBuilder != null)
+ members.Add (e.AddBuilder);
+ if (e.RemoveBuilder != null)
+ members.Add (e.RemoveBuilder);
+ }
+ }
+
+ MethodInfo[] retMethods = new MethodInfo [members.Count];
+ members.CopyTo (retMethods, 0);
+ return retMethods;
+ }
+
+ // Indicated whether container has StructLayout attribute set Explicit
+ public virtual bool HasExplicitLayout {
+ get {
+ return false;
+ }
}
/// <summary>
@@ -1070,209 +1569,402 @@ namespace Mono.CSharp {
//
// Since the whole process is a no-op, it is fine to check for null here.
//
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
+ public override MemberList FindMembers (MemberTypes mt, BindingFlags bf,
+ MemberFilter filter, object criteria)
{
- ArrayList members = new ArrayList ();
- bool priv = (bf & BindingFlags.NonPublic) != 0;
+ ArrayList members = null;
+
+ int modflags = 0;
+ if ((bf & BindingFlags.Public) != 0)
+ modflags |= Modifiers.PUBLIC | Modifiers.PROTECTED |
+ Modifiers.INTERNAL;
+ if ((bf & BindingFlags.NonPublic) != 0)
+ modflags |= Modifiers.PRIVATE;
+
+ int static_mask = 0, static_flags = 0;
+ switch (bf & (BindingFlags.Static | BindingFlags.Instance)) {
+ case BindingFlags.Static:
+ static_mask = static_flags = Modifiers.STATIC;
+ break;
+
+ case BindingFlags.Instance:
+ static_mask = Modifiers.STATIC;
+ static_flags = 0;
+ break;
+
+ default:
+ static_mask = static_flags = 0;
+ break;
+ }
+
+ Timer.StartTimer (TimerType.TcFindMembers);
if (filter == null)
filter = accepting_filter;
-
+
if ((mt & MemberTypes.Field) != 0) {
if (fields != null) {
- foreach (Field f in fields) {
- if ((f.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ int len = fields.Count;
+ for (int i = 0; i < len; i++) {
+ Field f = (Field) fields [i];
+
+ if ((f.ModFlags & modflags) == 0)
+ continue;
+ if ((f.ModFlags & static_mask) != static_flags)
+ continue;
FieldBuilder fb = f.FieldBuilder;
- if (fb != null && filter (fb, criteria) == true)
+ if (fb != null && filter (fb, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (fb);
+ }
}
}
if (constants != null) {
- foreach (Const con in constants) {
- if ((con.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ int len = constants.Count;
+ for (int i = 0; i < len; i++) {
+ Const con = (Const) constants [i];
+ if ((con.ModFlags & modflags) == 0)
+ continue;
+ if ((con.ModFlags & static_mask) != static_flags)
+ continue;
+
FieldBuilder fb = con.FieldBuilder;
- if (fb != null && filter (fb, criteria) == true)
+ if (fb != null && filter (fb, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (fb);
+ }
}
}
}
if ((mt & MemberTypes.Method) != 0) {
if (methods != null) {
- foreach (Method m in methods) {
- if ((m.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ int len = methods.Count;
+ for (int i = 0; i < len; i++) {
+ Method m = (Method) methods [i];
+
+ if ((m.ModFlags & modflags) == 0)
+ continue;
+ if ((m.ModFlags & static_mask) != static_flags)
+ continue;
MethodBuilder mb = m.MethodBuilder;
- if (mb != null && filter (mb, criteria) == true)
- members.Add (mb);
+ if (mb != null && filter (mb, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (mb);
+ }
}
}
- if (operators != null){
- foreach (Operator o in operators) {
- if ((o.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ if (operators != null) {
+ int len = operators.Count;
+ for (int i = 0; i < len; i++) {
+ Operator o = (Operator) operators [i];
+
+ if ((o.ModFlags & modflags) == 0)
+ continue;
+ if ((o.ModFlags & static_mask) != static_flags)
+ continue;
MethodBuilder ob = o.OperatorMethodBuilder;
- if (ob != null && filter (ob, criteria) == true)
+ if (ob != null && filter (ob, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (ob);
+ }
}
}
- if (properties != null){
- foreach (Property p in properties){
- if ((p.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ if (properties != null) {
+ int len = properties.Count;
+ for (int i = 0; i < len; i++) {
+ Property p = (Property) properties [i];
+
+ if ((p.ModFlags & modflags) == 0)
+ continue;
+ if ((p.ModFlags & static_mask) != static_flags)
+ continue;
MethodBuilder b;
b = p.GetBuilder;
- if (b != null && filter (b, criteria) == true)
+ if (b != null && filter (b, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (b);
+ }
b = p.SetBuilder;
- if (b != null && filter (b, criteria) == true)
+ if (b != null && filter (b, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (b);
+ }
+ }
+ }
+
+ if (indexers != null) {
+ int len = indexers.Count;
+ for (int i = 0; i < len; i++) {
+ Indexer ix = (Indexer) indexers [i];
+
+ if ((ix.ModFlags & modflags) == 0)
+ continue;
+ if ((ix.ModFlags & static_mask) != static_flags)
+ continue;
+
+ MethodBuilder b;
+
+ b = ix.GetBuilder;
+ if (b != null && filter (b, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (b);
+ }
+
+ b = ix.SetBuilder;
+ if (b != null && filter (b, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (b);
+ }
}
}
}
if ((mt & MemberTypes.Event) != 0) {
- if (events != null)
- foreach (Event e in events) {
- if ((e.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ if (events != null) {
+ int len = events.Count;
+ for (int i = 0; i < len; i++) {
+ Event e = (Event) events [i];
+
+ if ((e.ModFlags & modflags) == 0)
+ continue;
+ if ((e.ModFlags & static_mask) != static_flags)
+ continue;
MemberInfo eb = e.EventBuilder;
- if (eb != null && filter (eb, criteria) == true)
+ if (eb != null && filter (eb, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (e.EventBuilder);
+ }
}
+ }
}
if ((mt & MemberTypes.Property) != 0){
- if (properties != null)
- foreach (Property p in properties) {
- if ((p.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ if (properties != null) {
+ int len = properties.Count;
+ for (int i = 0; i < len; i++) {
+ Property p = (Property) properties [i];
+
+ if ((p.ModFlags & modflags) == 0)
+ continue;
+ if ((p.ModFlags & static_mask) != static_flags)
+ continue;
MemberInfo pb = p.PropertyBuilder;
if (pb != null && filter (pb, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (p.PropertyBuilder);
}
}
+ }
- if (indexers != null)
- foreach (Indexer ix in indexers) {
- if ((ix.ModFlags & Modifiers.PRIVATE) != 0)
- if (!priv)
- continue;
+ if (indexers != null) {
+ int len = indexers.Count;
+ for (int i = 0; i < len; i++) {
+ Indexer ix = (Indexer) indexers [i];
+
+ if ((ix.ModFlags & modflags) == 0)
+ continue;
+ if ((ix.ModFlags & static_mask) != static_flags)
+ continue;
MemberInfo ib = ix.PropertyBuilder;
if (ib != null && filter (ib, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (ix.PropertyBuilder);
}
}
+ }
}
if ((mt & MemberTypes.NestedType) != 0) {
+ if (types != null) {
+ int len = types.Count;
+ for (int i = 0; i < len; i++) {
+ TypeContainer t = (TypeContainer) types [i];
+
+ if ((t.ModFlags & modflags) == 0)
+ continue;
- if (Types != null)
- foreach (TypeContainer t in Types)
- if (filter (t.TypeBuilder, criteria) == true)
- members.Add (t.TypeBuilder);
+ TypeBuilder tb = t.TypeBuilder;
+ if (tb != null && (filter (tb, criteria) == true)) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (tb);
+ }
+ }
+ }
+
+ if (enums != null) {
+ int len = enums.Count;
+ for (int i = 0; i < len; i++) {
+ Enum en = (Enum) enums [i];
+
+ if ((en.ModFlags & modflags) == 0)
+ continue;
- if (Enums != null)
- foreach (Enum en in Enums)
- if (filter (en.TypeBuilder, criteria) == true)
- members.Add (en.TypeBuilder);
+ TypeBuilder tb = en.TypeBuilder;
+ if (tb != null && (filter (tb, criteria) == true)) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (tb);
+ }
+ }
+ }
+ if (delegates != null) {
+ int len = delegates.Count;
+ for (int i = 0; i < len; i++) {
+ Delegate d = (Delegate) delegates [i];
+
+ if ((d.ModFlags & modflags) == 0)
+ continue;
+
+ TypeBuilder tb = d.TypeBuilder;
+ if (tb != null && (filter (tb, criteria) == true)) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (tb);
+ }
+ }
+ }
+
+ if (interfaces != null) {
+ int len = interfaces.Count;
+ for (int i = 0; i < len; i++) {
+ TypeContainer iface = (TypeContainer) interfaces [i];
+
+ if ((iface.ModFlags & modflags) == 0)
+ continue;
+
+ TypeBuilder tb = iface.TypeBuilder;
+ if (tb != null && (filter (tb, criteria) == true)) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (tb);
+ }
+ }
+ }
}
if ((mt & MemberTypes.Constructor) != 0){
- if (instance_constructors != null){
- foreach (Constructor c in instance_constructors){
+ if (((bf & BindingFlags.Instance) != 0) && (instance_constructors != null)){
+ int len = instance_constructors.Count;
+ for (int i = 0; i < len; i++) {
+ Constructor c = (Constructor) instance_constructors [i];
+
ConstructorBuilder cb = c.ConstructorBuilder;
-
- if (cb != null)
- if (filter (cb, criteria) == true)
- members.Add (cb);
+ if (cb != null && filter (cb, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.Add (cb);
+ }
}
}
- if (default_static_constructor != null){
+ if (((bf & BindingFlags.Static) != 0) && (default_static_constructor != null)){
ConstructorBuilder cb =
default_static_constructor.ConstructorBuilder;
- if (filter (cb, criteria) == true)
+ if (cb != null && filter (cb, criteria) == true) {
+ if (members == null)
+ members = new ArrayList ();
+
members.Add (cb);
+ }
}
}
//
// Lookup members in parent if requested.
//
- if (((bf & BindingFlags.DeclaredOnly) == 0) && (TypeBuilder.BaseType != null)) {
- MemberInfo [] mi;
-
- mi = FindMembers (TypeBuilder.BaseType, mt, bf, filter, criteria);
- if (mi != null)
- members.AddRange (mi);
- }
-
- int count = members.Count;
- if (count > 0){
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi);
- return mi;
+ if ((bf & BindingFlags.DeclaredOnly) == 0) {
+ if (TypeBuilder.BaseType != null) {
+ MemberList list = FindMembers (TypeBuilder.BaseType, mt, bf, filter, criteria);
+ if (list.Count > 0) {
+ if (members == null)
+ members = new ArrayList ();
+
+ members.AddRange (list);
+ }
+ }
+ if (base_inteface_types != null) {
+ foreach (Type base_type in base_inteface_types) {
+ MemberList list = TypeContainer.FindMembers (base_type, mt, bf, filter, criteria);
+
+ if (list.Count > 0) {
+ if (members == null)
+ members = new ArrayList ();
+ members.AddRange (list);
+ }
+ }
+ }
}
- return null;
- }
-
- public MemberInfo GetFieldFromEvent (EventExpr event_expr)
- {
- if (events == null)
- return null;
-
- EventInfo ei = event_expr.EventInfo;
+ Timer.StopTimer (TimerType.TcFindMembers);
- foreach (Event e in events) {
+ if (members == null)
+ return MemberList.Empty;
+ else
+ return new MemberList (members);
+ }
- if (e.FieldBuilder == null)
- continue;
-
- if (Type.FilterName (e.FieldBuilder, ei.Name))
- return e.FieldBuilder;
+ public override MemberCache MemberCache {
+ get {
+ return member_cache;
}
-
- return null;
}
- public static MemberInfo [] FindMembers (Type t, MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
+ public static MemberList FindMembers (Type t, MemberTypes mt, BindingFlags bf,
+ MemberFilter filter, object criteria)
{
- TypeContainer tc = TypeManager.LookupTypeContainer (t);
+ DeclSpace ds = TypeManager.LookupDeclSpace (t);
- if (tc != null)
- return tc.FindMembers (mt, bf, filter, criteria);
+ if (ds != null)
+ return ds.FindMembers (mt, bf, filter, criteria);
else
- return t.FindMembers (mt, bf, filter, criteria);
- }
+ return new MemberList (t.FindMembers (mt, bf, filter, criteria));
+
+ }
//
// FindMethods will look for methods not only in the type `t', but in
@@ -1291,102 +1983,142 @@ namespace Mono.CSharp {
{
if (constants != null)
foreach (Const con in constants)
- con.EmitConstant (this);
+ con.Emit ();
return;
}
+ protected virtual void VerifyMembers (EmitContext ec)
+ {
+ //
+ // Check for internal or private fields that were never assigned
+ //
+ if (RootContext.WarningLevel >= 3) {
+ if (fields != null){
+ foreach (Field f in fields) {
+ if ((f.ModFlags & Modifiers.Accessibility) != Modifiers.PRIVATE)
+ continue;
+
+ if ((f.status & Field.Status.USED) == 0){
+ Report.Warning (169, f.Location, "The private field '{0}' is never used", f.GetSignatureForError ());
+ continue;
+ }
+
+ //
+ // Only report 649 on level 4
+ //
+ if (RootContext.WarningLevel < 4)
+ continue;
+
+ if ((f.status & Field.Status.ASSIGNED) != 0)
+ continue;
+
+ Report.Warning (649, f.Location, "Field '{0}' is never assigned to, and will always have its default value '{1}'", f.GetSignatureForError (), "");
+ }
+ }
+ }
+ }
+
/// <summary>
/// Emits the code, this step is performed after all
/// the types, enumerations, constructors
/// </summary>
- public void Emit ()
+ public void EmitType ()
{
- if (instance_constructors != null)
- foreach (Constructor c in instance_constructors)
- c.Emit (this);
+ if (OptAttributes != null)
+ OptAttributes.Emit (ec, this);
+
+ Emit ();
+
+ if (instance_constructors != null) {
+ if (TypeBuilder.IsSubclassOf (TypeManager.attribute_type) && RootContext.VerifyClsCompliance && IsClsCompliaceRequired (this)) {
+ bool has_compliant_args = false;
+
+ foreach (Constructor c in instance_constructors) {
+ c.Emit ();
+
+ if (has_compliant_args)
+ continue;
+
+ has_compliant_args = c.HasCompliantArgs;
+ }
+ if (!has_compliant_args)
+ Report.Error (3015, Location, "'{0}' has no accessible constructors which use only CLS-compliant types", GetSignatureForError ());
+ } else {
+ foreach (Constructor c in instance_constructors)
+ c.Emit ();
+ }
+ }
+
+ EmitConstants ();
if (default_static_constructor != null)
- default_static_constructor.Emit (this);
+ default_static_constructor.Emit ();
if (methods != null)
foreach (Method m in methods)
- m.Emit (this);
+ m.Emit ();
if (operators != null)
foreach (Operator o in operators)
- o.Emit (this);
+ o.Emit ();
if (properties != null)
foreach (Property p in properties)
- p.Emit (this);
+ p.Emit ();
if (indexers != null){
- foreach (Indexer ix in indexers)
- ix.Emit (this);
-
- CustomAttributeBuilder cb = Interface.EmitDefaultMemberAttr (
- this, IndexerName, ModFlags, Location);
- TypeBuilder.SetCustomAttribute (cb);
+ indexers.Emit ();
}
if (fields != null)
foreach (Field f in fields)
- f.Emit (this);
+ f.Emit ();
if (events != null){
foreach (Event e in Events)
- e.Emit (this);
+ e.Emit ();
}
- if (Pending != null)
- if (Pending.VerifyPendingMethods ())
- return;
-
- Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes, Location);
+ if (delegates != null) {
+ foreach (Delegate d in Delegates) {
+ d.Emit ();
+ }
+ }
- //
- // Check for internal or private fields that were never assigned
- //
- if (fields != null && RootContext.WarningLevel >= 3) {
- foreach (Field f in fields) {
- if ((f.ModFlags & Modifiers.PUBLIC) != 0)
- continue;
+ if (enums != null) {
+ foreach (Enum e in enums) {
+ e.Emit ();
+ }
+ }
- if (f.status == 0){
- Report.Warning (
- 169, f.Location, "Private field " +
- MakeName (f.Name) + " is never used");
- continue;
- }
+ if (parts != null) {
+ foreach (ClassPart part in parts)
+ part.EmitType ();
+ }
- //
- // Only report 649 on level 4
- //
- if (RootContext.WarningLevel < 4)
- continue;
+ if ((Pending != null) && !(this is ClassPart))
+ if (Pending.VerifyPendingMethods ())
+ return;
- if ((f.status & Field.Status.ASSIGNED) != 0)
- continue;
+ VerifyMembers (ec);
- Report.Warning (
- 649, f.Location,
- "Field " + MakeName (f.Name) + " is never assigned " +
- " to and will always have its default value");
- }
- }
+ if (iterators != null)
+ foreach (Iterator iterator in iterators)
+ iterator.EmitType ();
// if (types != null)
// foreach (TypeContainer tc in types)
// tc.Emit ();
}
-
+
public override void CloseType ()
{
+ if ((caching_flags & Flags.CloseTypeCreated) != 0)
+ return;
+
try {
- if (!Created){
- Created = true;
- TypeBuilder.CreateType ();
- }
+ caching_flags |= Flags.CloseTypeCreated;
+ TypeBuilder.CreateType ();
} catch (TypeLoadException){
//
// This is fine, the code still created the type
@@ -1402,51 +2134,54 @@ namespace Mono.CSharp {
foreach (Enum en in Enums)
en.CloseType ();
- if (interface_order != null){
- foreach (Interface iface in interface_order)
- iface.CloseType ();
- }
-
if (Types != null){
foreach (TypeContainer tc in Types)
- if (tc is Struct)
+ if (tc.Kind == Kind.Struct)
tc.CloseType ();
foreach (TypeContainer tc in Types)
- if (!(tc is Struct))
+ if (tc.Kind != Kind.Struct)
tc.CloseType ();
}
if (Delegates != null)
foreach (Delegate d in Delegates)
- d.CloseDelegate ();
- }
-
+ d.CloseType ();
+
+ if (Iterators != null)
+ foreach (Iterator i in Iterators)
+ i.CloseType ();
+
+ types = null;
+ properties = null;
+ enums = null;
+ delegates = null;
+ fields = null;
+ initialized_fields = null;
+ initialized_static_fields = null;
+ constants = null;
+ interfaces = null;
+ methods = null;
+ events = null;
+ indexers = null;
+ operators = null;
+ iterators = null;
+ ec = null;
+ default_constructor = null;
+ default_static_constructor = null;
+ type_bases = null;
+ OptAttributes = null;
+ ifaces = null;
+ parent_container = null;
+ member_cache = null;
+ }
+
+ // TODO: make it obsolete and use GetSignatureForError
public string MakeName (string n)
{
return "`" + Name + "." + n + "'";
}
- public void Warning_KeywordNewRequired (Location l, MemberInfo mi)
- {
- Report.Warning (
- 108, l, "The keyword new is required on " +
- MakeName (mi.Name) + " because it hides `" +
- mi.ReflectedType.Name + "." + mi.Name + "'");
- }
-
- public void Warning_KewywordNewNotRequired (Location l, MemberCore mc)
- {
- Report.Warning (
- 109, l, "The member " + MakeName (mc.Name) + " does not hide an " +
- "inherited member, the keyword new is not required");
- }
-
- public static int CheckMember (string name, MemberInfo mi, int ModFlags)
- {
- return 0;
- }
-
//
// Performs the validation on a Method's modifiers (properties have
// the same properties).
@@ -1454,9 +2189,9 @@ namespace Mono.CSharp {
public bool MethodModifiersValid (int flags, string n, Location loc)
{
const int vao = (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE);
+ const int va = (Modifiers.VIRTUAL | Modifiers.ABSTRACT);
const int nv = (Modifiers.NEW | Modifiers.VIRTUAL);
bool ok = true;
- string name = MakeName (n);
//
// At most one of static, virtual or override
@@ -1464,15 +2199,22 @@ namespace Mono.CSharp {
if ((flags & Modifiers.STATIC) != 0){
if ((flags & vao) != 0){
Report.Error (
- 112, loc, "static method " + name + "can not be marked " +
+ 112, loc, "static method " + MakeName (n) + "can not be marked " +
"as virtual, abstract or override");
ok = false;
}
}
+ if (Kind == Kind.Struct){
+ if ((flags & va) != 0){
+ Modifiers.Error_InvalidModifier (loc, "virtual or abstract");
+ ok = false;
+ }
+ }
+
if ((flags & Modifiers.OVERRIDE) != 0 && (flags & nv) != 0){
Report.Error (
- 113, loc, name +
+ 113, loc, MakeName (n) +
" marked as override cannot be marked as new or virtual");
ok = false;
}
@@ -1484,19 +2226,19 @@ namespace Mono.CSharp {
if ((flags & Modifiers.ABSTRACT) != 0){
if ((flags & Modifiers.EXTERN) != 0){
Report.Error (
- 180, loc, name + " can not be both abstract and extern");
+ 180, loc, MakeName (n) + " can not be both abstract and extern");
ok = false;
}
if ((flags & Modifiers.VIRTUAL) != 0){
Report.Error (
- 503, loc, name + " can not be both abstract and virtual");
+ 503, loc, MakeName (n) + " can not be both abstract and virtual");
ok = false;
}
if ((ModFlags & Modifiers.ABSTRACT) == 0){
Report.Error (
- 513, loc, name +
+ 513, loc, MakeName (n) +
" is abstract but its container class is not");
ok = false;
@@ -1506,7 +2248,7 @@ namespace Mono.CSharp {
if ((flags & Modifiers.PRIVATE) != 0){
if ((flags & vao) != 0){
Report.Error (
- 621, loc, name +
+ 621, loc, MakeName (n) +
" virtual or abstract members can not be private");
ok = false;
}
@@ -1515,7 +2257,7 @@ namespace Mono.CSharp {
if ((flags & Modifiers.SEALED) != 0){
if ((flags & Modifiers.OVERRIDE) == 0){
Report.Error (
- 238, loc, name +
+ 238, loc, MakeName (n) +
" cannot be sealed because it is not an override");
ok = false;
}
@@ -1524,36 +2266,83 @@ namespace Mono.CSharp {
return ok;
}
- //
- // Returns true if `type' is as accessible as the flags `flags'
- // given for this member
- //
- static public bool AsAccessible (Type type, int flags)
+ public bool UserDefinedStaticConstructor {
+ get {
+ return default_static_constructor != null;
+ }
+ }
+
+ protected override bool VerifyClsCompliance (DeclSpace ds)
{
+ if (!base.VerifyClsCompliance (ds))
+ return false;
+
+ VerifyClsName ();
+
+ // parent_container is null for System.Object
+ if (parent_container != null && !AttributeTester.IsClsCompliant (parent_container.Type)) {
+ Report.Error (3009, Location, "'{0}': base type '{1}' is not CLS-compliant", GetSignatureForError (), TypeManager.CSharpName (parent_container.Type));
+ }
return true;
}
- Hashtable builder_and_args;
-
- public bool RegisterMethod (MethodBuilder mb, InternalParameters ip, Type [] args)
+
+ /// <summary>
+ /// Checks whether container name is CLS Compliant
+ /// </summary>
+ void VerifyClsName ()
{
- if (builder_and_args == null)
- builder_and_args = new Hashtable ();
- return true;
+ Hashtable parent_members = parent_container == null ?
+ new Hashtable () :
+ parent_container.MemberCache.GetPublicMembers ();
+ Hashtable this_members = new Hashtable ();
+
+ foreach (DictionaryEntry entry in defined_names) {
+ MemberCore mc = (MemberCore)entry.Value;
+ if (!mc.IsClsCompliaceRequired (this))
+ continue;
+
+ string name = (string)entry.Key;
+ string basename = name.Substring (name.LastIndexOf ('.') + 1);
+
+ string lcase = basename.ToLower (System.Globalization.CultureInfo.InvariantCulture);
+ object found = parent_members [lcase];
+ if (found == null) {
+ found = this_members [lcase];
+ if (found == null) {
+ this_members.Add (lcase, mc);
+ continue;
+ }
+ }
+
+ if ((mc.ModFlags & Modifiers.OVERRIDE) != 0)
+ continue;
+
+ if (found is MemberInfo) {
+ if (basename == ((MemberInfo)found).Name)
+ continue;
+ Report.SymbolRelatedToPreviousError ((MemberInfo)found);
+ } else {
+ Report.SymbolRelatedToPreviousError ((MemberCore) found);
+ }
+ Report.Error (3005, mc.Location, "Identifier '{0}' differing only in case is not CLS-compliant", mc.GetSignatureForError ());
+ }
}
+
/// <summary>
/// Performs checks for an explicit interface implementation. First it
/// checks whether the `interface_type' is a base inteface implementation.
/// Then it checks whether `name' exists in the interface type.
/// </summary>
- public bool VerifyImplements (Type interface_type, string full, string name, Location loc)
+ public virtual bool VerifyImplements (Type interface_type, string full,
+ string name, Location loc)
{
bool found = false;
if (ifaces != null){
- foreach (Type t in ifaces){
- if (t == interface_type){
+ foreach (TypeExpr t in ifaces){
+ if (t.Type == interface_type){
found = true;
break;
}
@@ -1568,13 +2357,378 @@ namespace Mono.CSharp {
return true;
}
- public static void Error_ExplicitInterfaceNotMemberInterface (Location loc, string name)
+ protected override void VerifyObsoleteAttribute()
+ {
+ CheckUsageOfObsoleteAttribute (base_class_type);
+
+ if (ifaces == null)
+ return;
+
+ foreach (TypeExpr expr in ifaces) {
+ CheckUsageOfObsoleteAttribute (expr.Type);
+ }
+ }
+
+
+ //
+ // IMemberContainer
+ //
+
+ string IMemberContainer.Name {
+ get {
+ return Name;
+ }
+ }
+
+ Type IMemberContainer.Type {
+ get {
+ return TypeBuilder;
+ }
+ }
+
+ MemberCache IMemberContainer.MemberCache {
+ get {
+ return member_cache;
+ }
+ }
+
+ bool IMemberContainer.IsInterface {
+ get {
+ return Kind == Kind.Interface;
+ }
+ }
+
+ MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf)
+ {
+ return FindMembers (mt, bf | BindingFlags.DeclaredOnly, null, null);
+ }
+
+ public virtual IMemberContainer ParentContainer {
+ get {
+ return parent_container;
+ }
+ }
+ }
+
+ public class PartialContainer : TypeContainer {
+
+ public readonly Namespace Namespace;
+ public readonly int OriginalModFlags;
+ public readonly int AllowedModifiers;
+ public readonly TypeAttributes DefaultTypeAttributes;
+
+ static PartialContainer Create (NamespaceEntry ns, TypeContainer parent,
+ MemberName name, int mod_flags, Kind kind,
+ Location loc)
+ {
+ PartialContainer pc;
+ string full_name = name.GetName (true);
+ DeclSpace ds = (DeclSpace) RootContext.Tree.Decls [full_name];
+ if (ds != null) {
+ pc = ds as PartialContainer;
+
+ if (pc == null) {
+ Report.Error (
+ 260, ds.Location, "Missing partial modifier " +
+ "on declaration of type `{0}'; another " +
+ "partial implementation of this type exists",
+ name);
+
+ Report.LocationOfPreviousError (loc);
+ return null;
+ }
+
+ if (pc.Kind != kind) {
+ Report.Error (
+ 261, loc, "Partial declarations of `{0}' " +
+ "must be all classes, all structs or " +
+ "all interfaces", name);
+ return null;
+ }
+
+ if (pc.OriginalModFlags != mod_flags) {
+ Report.Error (
+ 262, loc, "Partial declarations of `{0}' " +
+ "have conflicting accessibility modifiers",
+ name);
+ return null;
+ }
+
+ return pc;
+ }
+
+ pc = new PartialContainer (ns, parent, name, mod_flags, kind, loc);
+ RootContext.Tree.RecordDecl (full_name, pc);
+ parent.AddType (pc);
+ pc.Register ();
+ return pc;
+ }
+
+ public static ClassPart CreatePart (NamespaceEntry ns, TypeContainer parent,
+ MemberName name, int mod, Attributes attrs,
+ Kind kind, Location loc)
+ {
+ PartialContainer pc = Create (ns, parent, name, mod, kind, loc);
+ if (pc == null) {
+ // An error occured; create a dummy container, but don't
+ // register it.
+ pc = new PartialContainer (ns, parent, name, mod, kind, loc);
+ }
+
+ ClassPart part = new ClassPart (ns, pc, mod, attrs, kind, loc);
+ pc.AddPart (part);
+ return part;
+ }
+
+ protected PartialContainer (NamespaceEntry ns, TypeContainer parent,
+ MemberName name, int mod, Kind kind, Location l)
+ : base (ns, parent, name, null, kind, l)
+ {
+ this.Namespace = ns.NS;
+
+ switch (kind) {
+ case Kind.Class:
+ AllowedModifiers = Class.AllowedModifiers;
+ DefaultTypeAttributes = Class.DefaultTypeAttributes;
+ break;
+
+ case Kind.Struct:
+ AllowedModifiers = Struct.AllowedModifiers;
+ DefaultTypeAttributes = Struct.DefaultTypeAttributes;
+ break;
+
+ case Kind.Interface:
+ AllowedModifiers = Interface.AllowedModifiers;
+ DefaultTypeAttributes = Interface.DefaultTypeAttributes;
+ break;
+
+ default:
+ throw new InvalidOperationException ();
+ }
+
+ int accmods;
+ if (parent.Parent == null)
+ accmods = Modifiers.INTERNAL;
+ else
+ accmods = Modifiers.PRIVATE;
+
+ this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
+ this.OriginalModFlags = mod;
+ }
+
+ public override void Register ()
+ {
+ if (Kind == Kind.Interface)
+ Parent.AddInterface (this);
+ else if (Kind == Kind.Class || Kind == Kind.Struct)
+ Parent.AddClassOrStruct (this);
+ else
+ throw new InvalidOperationException ();
+ }
+
+ public override PendingImplementation GetPendingImplementations ()
+ {
+ return PendingImplementation.GetPendingImplementations (this);
+ }
+
+ public ClassPart AddPart (NamespaceEntry ns, int mod, Attributes attrs,
+ Location l)
+ {
+ ClassPart part = new ClassPart (ns, this, mod, attrs, Kind, l);
+ AddPart (part);
+ return part;
+ }
+
+ public override TypeAttributes TypeAttr {
+ get {
+ return base.TypeAttr | DefaultTypeAttributes;
+ }
+ }
+ }
+
+ public class ClassPart : TypeContainer, IMemberContainer {
+ public readonly PartialContainer PartialContainer;
+ public readonly bool IsPartial;
+
+ public ClassPart (NamespaceEntry ns, PartialContainer parent,
+ int mod, Attributes attrs, Kind kind, Location l)
+ : base (ns, parent.Parent, parent.MemberName, attrs, kind, l)
+ {
+ this.PartialContainer = parent;
+ this.IsPartial = true;
+
+ int accmods;
+ if (parent.Parent == null)
+ accmods = Modifiers.INTERNAL;
+ else
+ accmods = Modifiers.PRIVATE;
+
+ this.ModFlags = Modifiers.Check (
+ parent.AllowedModifiers, mod, accmods, l);
+ }
+
+ public override void Register ()
+ {
+ }
+
+ public override PendingImplementation GetPendingImplementations ()
+ {
+ return PartialContainer.Pending;
+ }
+
+ public override bool VerifyImplements (Type interface_type, string full,
+ string name, Location loc)
+ {
+ return PartialContainer.VerifyImplements (
+ interface_type, full, name, loc);
+ }
+
+ public override IMemberContainer ParentContainer {
+ get {
+ return PartialContainer.ParentContainer;
+ }
+ }
+ }
+
+ public abstract class ClassOrStruct : TypeContainer {
+ bool hasExplicitLayout = false;
+ ListDictionary declarative_security;
+
+ public ClassOrStruct (NamespaceEntry ns, TypeContainer parent,
+ MemberName name, Attributes attrs, Kind kind,
+ Location l)
+ : base (ns, parent, name, attrs, kind, l)
+ {
+ }
+
+ public override PendingImplementation GetPendingImplementations ()
+ {
+ return PendingImplementation.GetPendingImplementations (this);
+ }
+
+ public override bool HasExplicitLayout {
+ get {
+ return hasExplicitLayout;
+ }
+ }
+
+ protected override void VerifyMembers (EmitContext ec)
+ {
+ base.VerifyMembers (ec);
+
+ if ((events != null) && (RootContext.WarningLevel >= 3)) {
+ foreach (Event e in events){
+ if (e.status == 0)
+ Report.Warning (67, e.Location, "The event '{0}' is never used", e.GetSignatureForError ());
+ }
+ }
+ }
+
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (declarative_security == null)
+ declarative_security = new ListDictionary ();
+
+ a.ExtractSecurityPermissionSet (declarative_security);
+ return;
+ }
+
+ if (a.Type == TypeManager.struct_layout_attribute_type
+ && (LayoutKind) a.GetPositionalValue (0) == LayoutKind.Explicit)
+ hasExplicitLayout = true;
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+ public override void Emit()
+ {
+ base.Emit ();
+
+ if (declarative_security != null) {
+ foreach (DictionaryEntry de in declarative_security) {
+ TypeBuilder.AddDeclarativeSecurity ((SecurityAction)de.Key, (PermissionSet)de.Value);
+ }
+ }
+ }
+
+ public override void Register ()
+ {
+ Parent.AddClassOrStruct (this);
+ }
+ }
+
+ /// <summary>
+ /// Class handles static classes declaration
+ /// </summary>
+ public sealed class StaticClass: Class {
+ public StaticClass (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod,
+ Attributes attrs, Location l)
+ : base (ns, parent, name, mod & ~Modifiers.STATIC, attrs, l)
+ {
+ if (RootContext.Version == LanguageVersion.ISO_1) {
+ Report.FeatureIsNotStandardized (l, "static classes");
+ Environment.Exit (1);
+ }
+ }
+
+ protected override void DefineContainerMembers (MemberCoreArrayList list)
+ {
+ if (list == null)
+ return;
+
+ foreach (MemberCore m in list) {
+ if (m is Operator) {
+ Report.Error (715, m.Location, "'{0}': static classes cannot contain user-defined operators", m.GetSignatureForError (this));
+ continue;
+ }
+
+ if ((m.ModFlags & Modifiers.STATIC) != 0)
+ continue;
+
+ if (m is Constructor) {
+ Report.Error (710, m.Location, "'{0}': Static classes cannot have instance constructors", GetSignatureForError ());
+ continue;
+ }
+
+ if (m is Destructor) {
+ Report.Error (711, m.Location, "'{0}': Static class cannot contain destructor", GetSignatureForError ());
+ continue;
+ }
+
+ Report.Error (708, m.Location, "'{0}': cannot declare instance members in a static class", m.GetSignatureForError (this));
+ }
+
+ base.DefineContainerMembers (list);
+ }
+
+ public override TypeBuilder DefineType()
{
- Report.Error (539, loc, "Explicit implementation: `" + name + "' is not a member of the interface");
+ TypeBuilder tb = base.DefineType ();
+ if (tb == null)
+ return null;
+
+ if (base_class_type != TypeManager.object_type) {
+ Report.Error (713, Location, "Static class '{0}' cannot derive from type '{1}'. Static classes must derive from object", GetSignatureForError (), TypeManager.CSharpName (base_class_type));
+ return null;
+ }
+
+ if (base_inteface_types != null) {
+ foreach (Type t in base_inteface_types)
+ Report.SymbolRelatedToPreviousError (t);
+ Report.Error (714, Location, "'{0}': static classes cannot implement interfaces", GetSignatureForError ());
+ }
+ return tb;
+ }
+
+ public override TypeAttributes TypeAttr {
+ get {
+ return base.TypeAttr | TypeAttributes.Abstract | TypeAttributes.Sealed;
+ }
}
}
- public class Class : TypeContainer {
+ public class Class : ClassOrStruct {
// <summary>
// Modifiers allowed in a class declaration
// </summary>
@@ -1588,8 +2742,12 @@ namespace Mono.CSharp {
Modifiers.SEALED |
Modifiers.UNSAFE;
- public Class (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
+ // Information in the case we are an attribute type
+ AttributeUsageAttribute attribute_usage;
+
+ public Class (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod,
+ Attributes attrs, Location l)
+ : base (ns, parent, name, attrs, Kind.Class, l)
{
int accmods;
@@ -1599,21 +2757,53 @@ namespace Mono.CSharp {
accmods = Modifiers.PRIVATE;
this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
- this.attributes = attrs;
+ if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.SEALED)) == (Modifiers.ABSTRACT | Modifiers.SEALED)) {
+ Report.Error (502, Location, "'{0}' cannot be both abstract and sealed", GetSignatureForError ());
+ }
+
+ attribute_usage = new AttributeUsageAttribute (AttributeTargets.All);
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Class;
+ }
}
+ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.UsageAttribute != null) {
+ if (base_class_type != TypeManager.attribute_type && !base_class_type.IsSubclassOf (TypeManager.attribute_type) &&
+ TypeBuilder.FullName != "System.Attribute") {
+ Report.Error (641, a.Location, "Attribute '{0}' is only valid on classes derived from System.Attribute", a.Name);
+ }
+ attribute_usage = a.UsageAttribute;
+ }
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+ public AttributeUsageAttribute AttributeUsage {
+ get {
+ return attribute_usage;
+ }
+ }
+
+ public const TypeAttributes DefaultTypeAttributes =
+ TypeAttributes.AutoLayout | TypeAttributes.Class;
+
//
// FIXME: How do we deal with the user specifying a different
// layout?
//
public override TypeAttributes TypeAttr {
get {
- return base.TypeAttr | TypeAttributes.AutoLayout | TypeAttributes.Class;
+ return base.TypeAttr | DefaultTypeAttributes;
}
}
}
- public class Struct : TypeContainer {
+ public class Struct : ClassOrStruct {
// <summary>
// Modifiers allowed in a struct declaration
// </summary>
@@ -1625,8 +2815,9 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Struct (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
+ public Struct (NamespaceEntry ns, TypeContainer parent, MemberName name,
+ int mod, Attributes attrs, Location l)
+ : base (ns, parent, name, attrs, Kind.Struct, l)
{
int accmods;
@@ -1638,10 +2829,19 @@ namespace Mono.CSharp {
this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
this.ModFlags |= Modifiers.SEALED;
- this.attributes = attrs;
-
}
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Struct;
+ }
+ }
+
+ public const TypeAttributes DefaultTypeAttributes =
+ TypeAttributes.SequentialLayout |
+ TypeAttributes.Sealed |
+ TypeAttributes.BeforeFieldInit;
+
//
// FIXME: Allow the user to specify a different set of attributes
// in some cases (Sealed for example is mandatory for a class,
@@ -1649,43 +2849,105 @@ namespace Mono.CSharp {
//
public override TypeAttributes TypeAttr {
get {
- return base.TypeAttr |
- TypeAttributes.SequentialLayout |
- TypeAttributes.Sealed |
- TypeAttributes.BeforeFieldInit;
+ return base.TypeAttr | DefaultTypeAttributes;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Interfaces
+ /// </summary>
+ public class Interface : TypeContainer, IMemberContainer {
+ /// <summary>
+ /// Modifiers allowed in a class declaration
+ /// </summary>
+ public const int AllowedModifiers =
+ Modifiers.NEW |
+ Modifiers.PUBLIC |
+ Modifiers.PROTECTED |
+ Modifiers.INTERNAL |
+ Modifiers.UNSAFE |
+ Modifiers.PRIVATE;
+
+ public Interface (NamespaceEntry ns, TypeContainer parent, MemberName name, int mod,
+ Attributes attrs, Location l)
+ : base (ns, parent, name, attrs, Kind.Interface, l)
+ {
+ int accmods;
+
+ if (parent.Parent == null)
+ accmods = Modifiers.INTERNAL;
+ else
+ accmods = Modifiers.PRIVATE;
+
+ this.ModFlags = Modifiers.Check (AllowedModifiers, mod, accmods, l);
+ }
+
+ public override void Register ()
+ {
+ Parent.AddInterface (this);
+ }
+
+ public override PendingImplementation GetPendingImplementations ()
+ {
+ return null;
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Interface;
+ }
+ }
+
+ public const TypeAttributes DefaultTypeAttributes =
+ TypeAttributes.AutoLayout |
+ TypeAttributes.Abstract |
+ TypeAttributes.Interface;
+
+ public override TypeAttributes TypeAttr {
+ get {
+ return base.TypeAttr | DefaultTypeAttributes;
}
}
}
- public abstract class MethodCore : MemberCore {
+ public abstract class MethodCore : MemberBase {
public readonly Parameters Parameters;
- Block block;
+ protected ToplevelBlock block;
//
// Parameters, cached for semantic analysis.
//
- InternalParameters parameter_info;
-
- public MethodCore (string name, Parameters parameters, Location l)
- : base (name, l)
+ protected InternalParameters parameter_info;
+ protected Type [] parameter_types;
+
+ // Whether this is an operator method.
+ public bool IsOperator;
+
+ //
+ // The method we're overriding if this is an override method.
+ //
+ protected MethodInfo parent_method = null;
+
+ static string[] attribute_targets = new string [] { "method", "return" };
+
+ public MethodCore (TypeContainer parent, Expression type, int mod,
+ int allowed_mod, bool is_interface, MemberName name,
+ Attributes attrs, Parameters parameters, Location loc)
+ : base (parent, type, mod, allowed_mod, Modifiers.PRIVATE, name,
+ attrs, loc)
{
- Name = name;
Parameters = parameters;
+ IsInterface = is_interface;
}
//
// Returns the System.Type array for the parameters of this method
//
- Type [] parameter_types;
- public Type [] ParameterTypes (TypeContainer parent)
- {
- if (Parameters == null)
- return TypeManager.NoTypes;
-
- if (parameter_types == null)
- parameter_types = Parameters.GetParameterInfo (parent);
-
- return parameter_types;
+ public Type [] ParameterTypes {
+ get {
+ return parameter_types;
+ }
}
public InternalParameters ParameterInfo
@@ -1693,13 +2955,9 @@ namespace Mono.CSharp {
get {
return parameter_info;
}
-
- set {
- parameter_info = value;
- }
}
- public Block Block {
+ public ToplevelBlock Block {
get {
return block;
}
@@ -1709,82 +2967,428 @@ namespace Mono.CSharp {
}
}
- public CallingConventions GetCallingConvention (bool is_class)
+ protected override bool CheckBase ()
{
- CallingConventions cc = 0;
+ if (!base.CheckBase ())
+ return false;
- cc = Parameters.GetCallingConvention ();
+ // Check whether arguments were correct.
+ if (!DoDefineParameters ())
+ return false;
- if (is_class)
- if ((ModFlags & Modifiers.STATIC) == 0)
- cc |= CallingConventions.HasThis;
+ if ((caching_flags & Flags.TestMethodDuplication) != 0 && !CheckForDuplications ())
+ return false;
- // FIXME: How is `ExplicitThis' used in C#?
-
- return cc;
+ if (IsExplicitImpl)
+ return true;
+
+ // Is null for System.Object while compiling corlib and base interfaces
+ if (Parent.ParentContainer == null) {
+ if ((RootContext.WarningLevel >= 4) && ((ModFlags & Modifiers.NEW) != 0)) {
+ Report.Warning (109, Location, "The member '{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError (Parent));
+ }
+ return true;
+ }
+
+ Type parent_ret_type = null;
+ parent_method = FindOutParentMethod (Parent, ref parent_ret_type);
+
+ // method is override
+ if (parent_method != null) {
+
+ if (!CheckMethodAgainstBase ())
+ return false;
+
+ if ((ModFlags & Modifiers.NEW) == 0) {
+ if (MemberType != TypeManager.TypeToCoreType (parent_ret_type)) {
+ Report.SymbolRelatedToPreviousError (parent_method);
+ Report.Error (508, Location, GetSignatureForError (Parent) + ": cannot " +
+ "change return type when overriding inherited member");
+ return false;
+ }
+ } else {
+ if (parent_method.IsAbstract && !IsInterface) {
+ Report.SymbolRelatedToPreviousError (parent_method);
+ Report.Error (533, Location, "'{0}' hides inherited abstract member", GetSignatureForError (Parent));
+ return false;
+ }
+ }
+
+ if (parent_method.IsSpecialName && !(this is PropertyBase)) {
+ Report.Error (561, Location, "'{0}': cannot override '{1}' because it is a special compiler-generated method", GetSignatureForError (Parent), TypeManager.GetFullNameSignature (parent_method));
+ return false;
+ }
+
+ if (RootContext.WarningLevel > 2) {
+ if (Name == "Equals" && parameter_types.Length == 1 && parameter_types [0] == TypeManager.object_type)
+ Parent.Methods.HasEquals = true;
+ else if (Name == "GetHashCode" && parameter_types.Length == 0)
+ Parent.Methods.HasGetHashCode = true;
+ }
+
+ ObsoleteAttribute oa = AttributeTester.GetMethodObsoleteAttribute (parent_method);
+ if (oa != null) {
+ EmitContext ec = new EmitContext (this.Parent, this.Parent, Location, null, null, ModFlags, false);
+ if (OptAttributes == null || !OptAttributes.Contains (TypeManager.obsolete_attribute_type, ec)) {
+ Report.SymbolRelatedToPreviousError (parent_method);
+ Report.Warning (672, 1, Location, "Member '{0}' overrides obsolete member. Add the Obsolete attribute to '{0}'", GetSignatureForError (Parent));
+ }
+ }
+ return true;
+ }
+
+ MemberInfo conflict_symbol = Parent.FindMemberWithSameName (Name, !(this is Property));
+ if ((ModFlags & Modifiers.OVERRIDE) != 0) {
+ if (conflict_symbol != null) {
+ Report.SymbolRelatedToPreviousError (conflict_symbol);
+ if (this is PropertyBase)
+ Report.Error (544, Location, "'{0}': cannot override because '{1}' is not a property", GetSignatureForError (Parent), TypeManager.GetFullNameSignature (conflict_symbol));
+ else
+ Report.Error (505, Location, "'{0}': cannot override because '{1}' is not a method", GetSignatureForError (Parent), TypeManager.GetFullNameSignature (conflict_symbol));
+ } else
+ Report.Error (115, Location, "'{0}': no suitable methods found to override", GetSignatureForError (Parent));
+ return false;
+ }
+
+ if (conflict_symbol == null) {
+ if ((RootContext.WarningLevel >= 4) && ((ModFlags & Modifiers.NEW) != 0)) {
+ Report.Warning (109, Location, "The member '{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError (Parent));
+ }
+ return true;
+ }
+
+ if ((ModFlags & Modifiers.NEW) == 0) {
+ if (this is Method && conflict_symbol is MethodBase)
+ return true;
+
+ Report.SymbolRelatedToPreviousError (conflict_symbol);
+ Report.Warning (108, Location, "The keyword new is required on '{0}' because it hides inherited member", GetSignatureForError (Parent));
+ }
+
+ return true;
}
- public void LabelParameters (EmitContext ec, Type [] parameters, MethodBase builder)
+
+ //
+ // Performs various checks on the MethodInfo `mb' regarding the modifier flags
+ // that have been defined.
+ //
+ // `name' is the user visible name for reporting errors (this is used to
+ // provide the right name regarding method names and properties)
+ //
+ bool CheckMethodAgainstBase ()
+ {
+ bool ok = true;
+
+ // TODO: replace with GetSignatureForError
+ string name = parent_method.DeclaringType.Name + "." + parent_method.Name;
+
+ if ((ModFlags & Modifiers.OVERRIDE) != 0){
+ if (!(parent_method.IsAbstract || parent_method.IsVirtual)){
+ Report.Error (
+ 506, Location, Parent.MakeName (Name) +
+ ": cannot override inherited member `" +
+ name + "' because it is not " +
+ "virtual, abstract or override");
+ ok = false;
+ }
+
+ // Now we check that the overriden method is not final
+
+ if (parent_method.IsFinal) {
+ // This happens when implementing interface methods.
+ if (parent_method.IsHideBySig && parent_method.IsVirtual) {
+ Report.Error (
+ 506, Location, Parent.MakeName (Name) +
+ ": cannot override inherited member `" +
+ name + "' because it is not " +
+ "virtual, abstract or override");
+ } else
+ Report.Error (239, Location, Parent.MakeName (Name) + " : cannot " +
+ "override inherited member `" + name +
+ "' because it is sealed.");
+ ok = false;
+ }
+ //
+ // Check that the permissions are not being changed
+ //
+ MethodAttributes thisp = flags & MethodAttributes.MemberAccessMask;
+ MethodAttributes parentp = parent_method.Attributes & MethodAttributes.MemberAccessMask;
+
+ //
+ // special case for "protected internal"
+ //
+
+ if ((parentp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
+ //
+ // when overriding protected internal, the method can be declared
+ // protected internal only within the same assembly
+ //
+
+ if ((thisp & MethodAttributes.FamORAssem) == MethodAttributes.FamORAssem){
+ if (Parent.TypeBuilder.Assembly != parent_method.DeclaringType.Assembly){
+ //
+ // assemblies differ - report an error
+ //
+
+ Error_CannotChangeAccessModifiers (Parent, parent_method, name);
+ ok = false;
+ } else if (thisp != parentp) {
+ //
+ // same assembly, but other attributes differ - report an error
+ //
+
+ Error_CannotChangeAccessModifiers (Parent, parent_method, name);
+ ok = false;
+ };
+ } else if ((thisp & MethodAttributes.Family) != MethodAttributes.Family) {
+ //
+ // if it's not "protected internal", it must be "protected"
+ //
+
+ Error_CannotChangeAccessModifiers (Parent, parent_method, name);
+ ok = false;
+ } else if (Parent.TypeBuilder.Assembly == parent_method.DeclaringType.Assembly) {
+ //
+ // protected within the same assembly - an error
+ //
+ Error_CannotChangeAccessModifiers (Parent, parent_method, name);
+ ok = false;
+ } else if ((thisp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem)) !=
+ (parentp & ~(MethodAttributes.Family | MethodAttributes.FamORAssem))) {
+ //
+ // protected ok, but other attributes differ - report an error
+ //
+ Error_CannotChangeAccessModifiers (Parent, parent_method, name);
+ ok = false;
+ }
+ } else {
+ if (thisp != parentp){
+ Error_CannotChangeAccessModifiers (Parent, parent_method, name);
+ ok = false;
+ }
+ }
+ }
+
+ if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0 && Name != "Finalize") {
+ ModFlags |= Modifiers.NEW;
+ Report.SymbolRelatedToPreviousError (parent_method);
+ if (!IsInterface && (parent_method.IsVirtual || parent_method.IsAbstract)) {
+ if (RootContext.WarningLevel >= 2)
+ Report.Warning (114, Location, "'{0}' hides inherited member '{1}'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword", GetSignatureForError (Parent), TypeManager.CSharpSignature (parent_method));
+ } else
+ Report.Warning (108, Location, "The keyword new is required on '{0}' because it hides inherited member", GetSignatureForError (Parent));
+ }
+
+ return ok;
+ }
+
+ void Error_CannotChangeAccessModifiers (TypeContainer parent, MethodInfo parent_method, string name)
{
//
- // Define each type attribute (in/out/ref) and
- // the argument names.
+ // FIXME: report the old/new permissions?
//
- Parameter [] p = Parameters.FixedParameters;
- int i = 0;
-
- MethodBuilder mb = null;
- ConstructorBuilder cb = null;
+ Report.Error (
+ 507, Location, parent.MakeName (Name) +
+ ": can't change the access modifiers when overriding inherited " +
+ "member `" + name + "'");
+ }
- if (builder is MethodBuilder)
- mb = (MethodBuilder) builder;
- else
- cb = (ConstructorBuilder) builder;
+ protected static string Error722 {
+ get {
+ return "'{0}': static types cannot be used as return types";
+ }
+ }
- if (p != null){
- for (i = 0; i < p.Length; i++) {
- ParameterBuilder pb;
-
- if (mb == null)
- pb = cb.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
- else
- pb = mb.DefineParameter (
- i + 1, p [i].Attributes, p [i].Name);
-
- Attributes attr = p [i].OptAttributes;
- if (attr != null)
- Attribute.ApplyAttributes (ec, pb, pb, attr, Location);
+ /// <summary>
+ /// For custom member duplication search in a container
+ /// </summary>
+ protected abstract bool CheckForDuplications ();
+
+ /// <summary>
+ /// Gets parent method and its return type
+ /// </summary>
+ protected abstract MethodInfo FindOutParentMethod (TypeContainer container, ref Type parent_ret_type);
+
+ protected virtual bool DoDefineParameters ()
+ {
+ EmitContext ec = Parent.EmitContext;
+ if (ec == null)
+ throw new InternalErrorException ("DoDefineParameters invoked too early");
+
+ bool old_unsafe = ec.InUnsafe;
+ ec.InUnsafe = InUnsafe;
+ // Check if arguments were correct
+ parameter_types = Parameters.GetParameterInfo (ec);
+ ec.InUnsafe = old_unsafe;
+
+ if ((parameter_types == null) ||
+ !CheckParameters (Parent, parameter_types))
+ return false;
+
+ parameter_info = new InternalParameters (parameter_types, Parameters);
+
+ Parameter array_param = Parameters.ArrayParameter;
+ if ((array_param != null) &&
+ (!array_param.ParameterType.IsArray ||
+ (array_param.ParameterType.GetArrayRank () != 1))) {
+ Report.Error (225, Location, "params parameter has to be a single dimensional array");
+ return false;
+ }
+
+ return true;
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+
+ protected override bool VerifyClsCompliance (DeclSpace ds)
+ {
+ if (!base.VerifyClsCompliance (ds)) {
+ if ((ModFlags & Modifiers.ABSTRACT) != 0 && IsExposedFromAssembly (ds) && ds.IsClsCompliaceRequired (ds)) {
+ Report.Error (3011, Location, "'{0}': only CLS-compliant members can be abstract", GetSignatureForError ());
}
+ return false;
}
- if (Parameters.ArrayParameter != null){
- ParameterBuilder pb;
- Parameter array_param = Parameters.ArrayParameter;
-
- if (mb == null)
- pb = cb.DefineParameter (
- i + 1, array_param.Attributes,
- array_param.Name);
+ if (Parameters.HasArglist) {
+ Report.Error (3000, Location, "Methods with variable arguments are not CLS-compliant");
+ }
+
+ if (!AttributeTester.IsClsCompliant (MemberType)) {
+ Report.Error (3002, Location, "Return type of '{0}' is not CLS-compliant", GetSignatureForError ());
+ }
+
+ AttributeTester.AreParametersCompliant (Parameters.FixedParameters, Location);
+
+ return true;
+ }
+
+ protected bool IsDuplicateImplementation (MethodCore method)
+ {
+ if ((method == this) || (method.Name != Name))
+ return false;
+
+ Type[] param_types = method.ParameterTypes;
+ if (param_types == null)
+ return false;
+
+ if (param_types.Length != ParameterTypes.Length)
+ return false;
+
+ for (int i = 0; i < param_types.Length; i++)
+ if (param_types [i] != ParameterTypes [i])
+ return false;
+
+ // TODO: make operator compatible with MethodCore to avoid this
+ if (this is Operator && method is Operator) {
+ if (MemberType != method.MemberType)
+ return false;
+ }
+
+ //
+ // Try to report 663: method only differs on out/ref
+ //
+ ParameterData info = ParameterInfo;
+ ParameterData other_info = method.ParameterInfo;
+ for (int i = 0; i < info.Count; i++){
+ if (info.ParameterModifier (i) != other_info.ParameterModifier (i)){
+ Report.Error (663, Location, "Overload method only differs in parameter modifier");
+ return false;
+ }
+ }
+
+ Report.SymbolRelatedToPreviousError (method);
+ Report.Error (111, Location, TypeContainer.Error111, Parent.Name, Name);
+ return true;
+ }
+
+ protected override void VerifyObsoleteAttribute()
+ {
+ base.VerifyObsoleteAttribute ();
+
+ if (parameter_types == null)
+ return;
+
+ foreach (Type type in parameter_types) {
+ CheckUsageOfObsoleteAttribute (type);
+ }
+ }
+ }
+
+ public class SourceMethod : ISourceMethod
+ {
+ TypeContainer container;
+ MethodBase builder;
+
+ protected SourceMethod (TypeContainer container, MethodBase builder,
+ ISourceFile file, Location start, Location end)
+ {
+ this.container = container;
+ this.builder = builder;
+
+ CodeGen.SymbolWriter.OpenMethod (
+ file, this, start.Row, 0, end.Row, 0);
+ }
+
+ public string Name {
+ get { return builder.Name; }
+ }
+
+ public int NamespaceID {
+ get { return container.NamespaceEntry.SymbolFileID; }
+ }
+
+ public int Token {
+ get {
+ if (builder is MethodBuilder)
+ return ((MethodBuilder) builder).GetToken ().Token;
+ else if (builder is ConstructorBuilder)
+ return ((ConstructorBuilder) builder).GetToken ().Token;
else
- pb = mb.DefineParameter (
- i + 1, array_param.Attributes,
- array_param.Name);
-
- CustomAttributeBuilder a = new CustomAttributeBuilder (
- TypeManager.cons_param_array_attribute, new object [0]);
-
- pb.SetCustomAttribute (a);
+ throw new NotSupportedException ();
}
}
+
+ public void CloseMethod ()
+ {
+ if (CodeGen.SymbolWriter != null)
+ CodeGen.SymbolWriter.CloseMethod ();
+ }
+
+ public static SourceMethod Create (TypeContainer parent,
+ MethodBase builder, Block block)
+ {
+ if (CodeGen.SymbolWriter == null)
+ return null;
+ if (block == null)
+ return null;
+
+ Location start_loc = block.StartLocation;
+ if (Location.IsNull (start_loc))
+ return null;
+
+ Location end_loc = block.EndLocation;
+ if (Location.IsNull (end_loc))
+ return null;
+
+ ISourceFile file = start_loc.SourceFile;
+ if (file == null)
+ return null;
+
+ return new SourceMethod (
+ parent, builder, file, start_loc, end_loc);
+ }
}
-
- public class Method : MethodCore {
- public readonly string ReturnType;
- public MethodBuilder MethodBuilder;
- public readonly Attributes OptAttributes;
- MethodAttributes flags;
+ public class Method : MethodCore, IIteratorContainer, IMethodData {
+ public MethodBuilder MethodBuilder;
+ public MethodData MethodData;
+ ReturnParameter return_attributes;
+ ListDictionary declarative_security;
/// <summary>
/// Modifiers allowed in a class declaration
@@ -1801,34 +3405,60 @@ namespace Mono.CSharp {
Modifiers.OVERRIDE |
Modifiers.ABSTRACT |
Modifiers.UNSAFE |
+ Modifiers.METHOD_YIELDS |
Modifiers.EXTERN;
+ const int AllowedInterfaceModifiers =
+ Modifiers.NEW | Modifiers.UNSAFE;
+
//
// return_type can be "null" for VOID values.
//
- public Method (string return_type, int mod, string name, Parameters parameters,
- Attributes attrs, Location l)
- : base (name, parameters, l)
+ public Method (TypeContainer ds, Expression return_type, int mod, bool is_iface,
+ MemberName name, Parameters parameters, Attributes attrs,
+ Location l)
+ : base (ds, return_type, mod,
+ is_iface ? AllowedInterfaceModifiers : AllowedModifiers,
+ is_iface, name, attrs, parameters, l)
{
- ReturnType = return_type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
- OptAttributes = attrs;
}
- //
- // Returns the `System.Type' for the ReturnType of this
- // function. Provides a nice cache. (used between semantic analysis
- // and actual code generation
- //
- Type type_return_type;
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Method;
+ }
+ }
- public Type GetReturnType (TypeContainer parent)
+ public override string GetSignatureForError()
{
- if (type_return_type == null)
- type_return_type = RootContext.LookupType (
- parent, ReturnType, false, Location);
-
- return type_return_type;
+ if (MethodBuilder == null) {
+ return GetSignatureForError (Parent);
+ }
+ return TypeManager.CSharpSignature (MethodBuilder);
+ }
+
+ /// <summary>
+ /// Use this method when MethodBuilder is null
+ /// </summary>
+ public override string GetSignatureForError (TypeContainer tc)
+ {
+ // TODO: get params from somewhere
+ if (parameter_info == null)
+ return base.GetSignatureForError (tc);
+
+ // TODO: move to parameters
+ System.Text.StringBuilder args = new System.Text.StringBuilder ();
+ if (parameter_info.Parameters.FixedParameters != null) {
+ for (int i = 0; i < parameter_info.Parameters.FixedParameters.Length; ++i) {
+ Parameter p = parameter_info.Parameters.FixedParameters [i];
+ args.Append (p.GetSignatureForError ());
+
+ if (i < parameter_info.Parameters.FixedParameters.Length - 1)
+ args.Append (',');
+ }
+ }
+
+ return String.Concat (base.GetSignatureForError (tc), "(", args.ToString (), ")");
}
void DuplicateEntryPoint (MethodInfo b, Location location)
@@ -1840,17 +3470,6 @@ namespace Mono.CSharp {
TypeManager.CSharpSignature(b) + "'");
}
- void Report28 (MethodInfo b)
- {
- if (RootContext.WarningLevel < 4)
- return;
-
- Report.Warning (
- 28, Location,
- "`" + TypeManager.CSharpSignature(b) +
- "' has the wrong signature to be an entry point");
- }
-
public bool IsEntryPoint (MethodBuilder b, InternalParameters pinfo)
{
if (b.ReturnType != TypeManager.void_type &&
@@ -1866,261 +3485,165 @@ namespace Mono.CSharp {
Type t = pinfo.ParameterType(0);
if (t.IsArray &&
(t.GetArrayRank() == 1) &&
- (t.GetElementType() == TypeManager.string_type) &&
+ (TypeManager.GetElementType(t) == TypeManager.string_type) &&
(pinfo.ParameterModifier(0) == Parameter.Modifier.NONE))
return true;
else
return false;
- }
+ }
- //
- // Creates the type
- //
- public override bool Define (TypeContainer parent)
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
- Type ret_type = GetReturnType (parent);
- Type [] parameters = ParameterTypes (parent);
- bool error = false;
- MethodInfo implementing = null;
- Type iface_type = null;
- string iface = "", short_name;
- bool explicit_impl = false;
+ if (a.Target == AttributeTargets.ReturnValue) {
+ if (return_attributes == null)
+ return_attributes = new ReturnParameter (MethodBuilder, Location);
- // Check if the return type and arguments were correct
- if (ret_type == null || parameters == null)
- return false;
-
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
-
- flags = Modifiers.MethodAttr (ModFlags);
-
- //
- // verify accessibility
- //
- if (!TypeContainer.AsAccessible (ret_type, ModFlags))
- return false;
+ return_attributes.ApplyAttributeBuilder (a, cb);
+ return;
+ }
- if (ret_type.IsPointer && !UnsafeOK (parent))
- return false;
-
- foreach (Type partype in parameters){
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- error = true;
- if (partype.IsPointer && !UnsafeOK (parent))
- error = true;
+ if (a.Type == TypeManager.methodimpl_attr_type && a.IsInternalCall) {
+ MethodBuilder.SetImplementationFlags (MethodImplAttributes.InternalCall | MethodImplAttributes.Runtime);
}
- if (error)
- return false;
+ if (a.Type == TypeManager.dllimport_type) {
+ const int extern_static = Modifiers.EXTERN | Modifiers.STATIC;
+ if ((ModFlags & extern_static) != extern_static) {
+ Report.Error (601, a.Location, "The DllImport attribute must be specified on a method marked `static' and `extern'");
+ }
- //
- // Verify if the parent has a type with the same name, and then
- // check whether we have to create a new slot for it or not.
- //
- Type ptype = parent.TypeBuilder.BaseType;
-
- // ptype is only null for System.Object while compiling corlib.
- if (ptype != null){
- MethodSignature ms = new MethodSignature (Name, null, parameters);
- MemberInfo [] mi, mi_static, mi_instance;
-
- mi_static = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static,
- MethodSignature.inheritable_method_signature_filter, ms);
-
- mi_instance = TypeContainer.FindMembers (
- ptype, MemberTypes.Method,
- BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance,
- MethodSignature.inheritable_method_signature_filter,
- ms);
-
- if (mi_instance != null && mi_instance.Length > 0){
- mi = mi_instance;
- } else if (mi_static != null && mi_static.Length > 0)
- mi = mi_static;
- else
- mi = null;
+ return;
+ }
- if (mi != null && mi.Length > 0){
- if (!CheckMethodAgainstBase (parent, flags, (MethodInfo) mi [0])){
- return false;
- }
- } else {
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (declarative_security == null)
+ declarative_security = new ListDictionary ();
+ a.ExtractSecurityPermissionSet (declarative_security);
+ return;
+ }
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- Report.Error (115, Location,
- parent.MakeName (Name) +
- " no suitable methods found to override");
- }
+ if (a.Type == TypeManager.conditional_attribute_type) {
+ if (IsOperator || IsExplicitImpl) {
+ Report.Error (577, Location, "Conditional not valid on '{0}' because it is a destructor, operator, or explicit interface implementation", GetSignatureForError ());
+ return;
}
- } else if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- //
- // If we implement an interface, extract the interface name.
- //
- if (Name.IndexOf (".") != -1){
- int pos = Name.LastIndexOf (".");
- iface = Name.Substring (0, pos);
-
- iface_type = RootContext.LookupType (parent, iface, false, Location);
- short_name = Name.Substring (pos + 1);
- if (iface_type == null)
- return false;
+ if (ReturnType != TypeManager.void_type) {
+ Report.Error (578, Location, "Conditional not valid on '{0}' because its return new ErrorData ( type is not void", GetSignatureForError ());
+ return;
+ }
- // Compute the full name that we need to export
- Name = iface_type.FullName + "." + short_name;
+ if ((ModFlags & Modifiers.OVERRIDE) != 0) {
+ Report.Error (243, Location, "Conditional not valid on '{0}' because it is an override method", GetSignatureForError ());
+ return;
+ }
- if (!parent.VerifyImplements (iface_type, short_name, Name, Location))
- return false;
-
- explicit_impl = true;
- } else
- short_name = Name;
+ if (IsInterface) {
+ Report.Error (582, Location, "Conditional not valid on interface members");
+ return;
+ }
- //
- // Check if we are an implementation of an interface method or
- // a method
- //
- if (parent.Pending != null){
- implementing = parent.Pending.IsInterfaceMethod (
- iface_type, short_name, ret_type, parameters);
+ if (MethodData.IsImplementing) {
+ Report.Error (629, Location, "Conditional member '{0}' cannot implement interface member", GetSignatureForError ());
+ return;
+ }
- if (iface_type != null && implementing == null){
- TypeContainer.Error_ExplicitInterfaceNotMemberInterface (Location, short_name);
- return false;
+ for (int i = 0; i < parameter_info.Count; ++i) {
+ if ((parameter_info.ParameterModifier (i) & Parameter.Modifier.OUT) != 0) {
+ Report.Error (685, Location, "Conditional method '{0}' cannot have an out parameter", GetSignatureForError ());
+ return;
+ }
}
}
- //
- // For implicit implementations, make sure we are public, for
- // explicit implementations, make sure we are private.
- //
- if (implementing != null){
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (iface_type == null){
- //
- // We already catch different accessibility settings
- // so we just need to check that we are not private
- //
- if ((ModFlags & Modifiers.PRIVATE) != 0)
- implementing = null;
+ MethodBuilder.SetCustomAttribute (cb);
+ }
+
+ protected override bool CheckForDuplications ()
+ {
+ ArrayList ar = Parent.Methods;
+ if (ar != null) {
+ int arLen = ar.Count;
+
+ for (int i = 0; i < arLen; i++) {
+ Method m = (Method) ar [i];
+ if (IsDuplicateImplementation (m))
+ return false;
+ }
+ }
+
+ ar = Parent.Properties;
+ if (ar != null) {
+ for (int i = 0; i < ar.Count; ++i) {
+ PropertyBase pb = (PropertyBase) ar [i];
+ if (pb.AreAccessorsDuplicateImplementation (this))
+ return false;
+ }
+ }
- //
- // Static is not allowed
- //
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if ((ModFlags & (Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location, "`public' or `abstract' modifiers "+
- "are not allowed in explicit interface declarations"
- );
- implementing = null;
- }
+ ar = Parent.Indexers;
+ if (ar != null) {
+ for (int i = 0; i < ar.Count; ++i) {
+ PropertyBase pb = (PropertyBase) ar [i];
+ if (pb.AreAccessorsDuplicateImplementation (this))
+ return false;
}
}
-
- //
- // If implementing is still valid, set flags
- //
- if (implementing != null){
- // Console.WriteLine ("Implementing for:" + (iface_type != null ? iface_type.FullName : "<null>") + " " + short_name);
-
- if (implementing.DeclaringType.IsInterface)
- flags |= MethodAttributes.NewSlot;
-
- flags |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
- //
- // clear the pending implementation flag
- //
- parent.Pending.ImplementMethod (
- iface_type, short_name, ret_type, parameters, explicit_impl);
- }
-
- Attribute dllimport_attr = null;
- if (OptAttributes != null && OptAttributes.AttributeSections != null) {
- foreach (AttributeSection asec in OptAttributes.AttributeSections) {
- if (asec.Attributes == null)
- continue;
-
- foreach (Attribute a in asec.Attributes)
- if (a.Name.IndexOf ("DllImport") != -1) {
- flags |= MethodAttributes.PinvokeImpl;
- dllimport_attr = a;
- }
+ ar = Parent.Events;
+ if (ar != null) {
+ for (int i = 0; i < ar.Count; ++i) {
+ Event ev = (Event) ar [i];
+ if (ev.AreAccessorsDuplicateImplementation (this))
+ return false;
}
}
- //
- // Finally, define the method
- //
+ return true;
+ }
- if ((flags & MethodAttributes.PinvokeImpl) != 0) {
+ //
+ // Creates the type
+ //
+ public override bool Define ()
+ {
+ if (!DoDefine ())
+ return false;
- if ((ModFlags & Modifiers.STATIC) == 0) {
- Report.Error (601, Location, "The DllImport attribute must be specified on " +
- "a method marked 'static' and 'extern'.");
- return false;
- }
-
- EmitContext ec = new EmitContext (
- parent, Location, null, GetReturnType (parent), ModFlags);
-
- MethodBuilder = dllimport_attr.DefinePInvokeMethod (
- ec, parent.TypeBuilder,
- Name, flags, ret_type, parameters);
- } else {
- MethodBuilder = parent.TypeBuilder.DefineMethod (
- Name, flags,
- GetCallingConvention (parent is Class),
- ret_type, parameters);
+ if (!CheckBase ())
+ return false;
- if (implementing != null && explicit_impl)
- parent.TypeBuilder.DefineMethodOverride (
- MethodBuilder, implementing);
- }
+ if (IsOperator)
+ flags |= MethodAttributes.SpecialName | MethodAttributes.HideBySig;
+
+ MethodData = new MethodData (this, ParameterInfo, ModFlags, flags, this);
- if (MethodBuilder == null)
+ if (!MethodData.Define (Parent))
return false;
//
- // HACK because System.Reflection.Emit is lame
+ // Setup iterator if we are one
//
- ParameterInfo = new InternalParameters (parent, Parameters);
+ if ((ModFlags & Modifiers.METHOD_YIELDS) != 0){
+ Iterator iterator = new Iterator (
+ Parent, Name, MemberType, ParameterTypes,
+ ParameterInfo, ModFlags, block, Location);
- if (!TypeManager.RegisterMethod (MethodBuilder, ParameterInfo,
- parameters)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name + "' already contains a definition with " +
- " the same return value and parameter types for method `" +
- Name + "'");
- return false;
+ if (!iterator.DefineIterator ())
+ return false;
+
+ block = iterator.Block;
}
+
+ MethodBuilder = MethodData.MethodBuilder;
//
// This is used to track the Entry Point,
//
if (Name == "Main" &&
- ((ModFlags & Modifiers.STATIC) != 0) &&
+ ((ModFlags & Modifiers.STATIC) != 0) && RootContext.NeedsEntryPoint &&
(RootContext.MainClass == null ||
- RootContext.MainClass == parent.TypeBuilder.FullName)){
+ RootContext.MainClass == Parent.TypeBuilder.FullName)){
if (IsEntryPoint (MethodBuilder, ParameterInfo)) {
if (RootContext.EntryPoint == null) {
RootContext.EntryPoint = MethodBuilder;
@@ -2129,8 +3652,15 @@ namespace Mono.CSharp {
DuplicateEntryPoint (RootContext.EntryPoint, RootContext.EntryPointLocation);
DuplicateEntryPoint (MethodBuilder, Location);
}
- } else
- Report28(MethodBuilder);
+ } else {
+ if (RootContext.WarningLevel >= 4)
+ Report.Warning (28, Location, "'{0}' has the wrong signature to be an entry point", TypeManager.CSharpSignature(MethodBuilder));
+ }
+ }
+
+ if (MemberType.IsAbstract && MemberType.IsSealed) {
+ Report.Error (722, Location, Error722, TypeManager.CSharpName (MemberType));
+ return false;
}
return true;
@@ -2139,112 +3669,161 @@ namespace Mono.CSharp {
//
// Emits the code
//
- public void Emit (TypeContainer parent)
+ public override void Emit ()
{
- ILGenerator ig;
- EmitContext ec;
+ MethodData.Emit (Parent, this);
+ base.Emit ();
- if ((flags & MethodAttributes.PinvokeImpl) == 0)
- ig = MethodBuilder.GetILGenerator ();
- else
- ig = null;
+ if (declarative_security != null) {
+ foreach (DictionaryEntry de in declarative_security) {
+ MethodBuilder.AddDeclarativeSecurity ((SecurityAction)de.Key, (PermissionSet)de.Value);
+ }
+ }
- ec = new EmitContext (parent, Location, ig, GetReturnType (parent), ModFlags);
+ Block = null;
+ MethodData = null;
+ }
- if (OptAttributes != null)
- Attribute.ApplyAttributes (ec, MethodBuilder, this, OptAttributes, Location);
-
+ protected override MethodInfo FindOutParentMethod (TypeContainer container, ref Type parent_ret_type)
+ {
+ MethodInfo mi = (MethodInfo) container.ParentContainer.MemberCache.FindMemberToOverride (
+ container.TypeBuilder, Name, ParameterTypes, false);
+
+ if (mi == null)
+ return null;
+
+ parent_ret_type = mi.ReturnType;
+ return mi;
+ }
+
+ protected override bool VerifyClsCompliance(DeclSpace ds)
+ {
+ if (!base.VerifyClsCompliance (ds))
+ return false;
+
+ if (parameter_types.Length > 0) {
+ ArrayList al = (ArrayList)ds.MemberCache.Members [Name];
+ if (al.Count > 1)
+ ds.MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder);
+ }
+
+ return true;
+ }
- LabelParameters (ec, ParameterTypes (parent), MethodBuilder);
+
+ void IIteratorContainer.SetYields ()
+ {
+ ModFlags |= Modifiers.METHOD_YIELDS;
+ }
+
+ #region IMethodData Members
+
+ public CallingConventions CallingConventions {
+ get {
+ CallingConventions cc = Parameters.GetCallingConvention ();
+ if (Parameters.HasArglist)
+ block.HasVarargs = true;
+
+ if (!IsInterface)
+ if ((ModFlags & Modifiers.STATIC) == 0)
+ cc |= CallingConventions.HasThis;
+
+ // FIXME: How is `ExplicitThis' used in C#?
- //
- // abstract or extern methods have no bodies
- //
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0){
- if (Block != null){
- if ((ModFlags & Modifiers.ABSTRACT) != 0){
- Report.Error (
- 500, "Abstract method `" +
- TypeManager.CSharpSignature (MethodBuilder) +
- "' can not have a body");
- }
- }
- return;
+ return cc;
}
+ }
- //
- // Handle destructors specially
- //
- // FIXME: This code generates buggy code
- //
- if (Name == "Finalize" && type_return_type == TypeManager.void_type)
- EmitDestructor (ec);
- else {
- ISymbolWriter sw = CodeGen.SymbolWriter;
-
- if ((sw != null) && (!Location.IsNull (Location))) {
- MethodToken token = MethodBuilder.GetToken ();
- sw.OpenMethod (new SymbolToken (token.Token));
- sw.SetMethodSourceRange (Location.SymbolDocument,
- Location.Row, 0,
- Block.EndLocation.SymbolDocument,
- Block.EndLocation.Row, 0);
-
- ec.EmitTopBlock (Block, Location);
-
- sw.CloseMethod ();
- } else
- ec.EmitTopBlock (Block, Location);
+ public Type ReturnType {
+ get {
+ return MemberType;
}
}
- void EmitDestructor (EmitContext ec)
+ public MemberName MethodName {
+ get {
+ return MemberName;
+ }
+ }
+
+ public new Location Location {
+ get {
+ return base.Location;
+ }
+ }
+
+ public EmitContext CreateEmitContext (TypeContainer tc, ILGenerator ig)
{
- ILGenerator ig = ec.ig;
-
- Label finish = ig.DefineLabel ();
- bool old_in_try = ec.InTry;
-
- ig.BeginExceptionBlock ();
- ec.InTry = true;
- ec.ReturnLabel = finish;
- ec.EmitTopBlock (Block, Location);
- ec.InTry = old_in_try;
-
- ig.MarkLabel (finish);
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- ig.BeginFinallyBlock ();
-
- if (ec.ContainerType.BaseType != null) {
- Expression member_lookup = Expression.MemberLookup (
- ec, ec.ContainerType.BaseType, "Finalize",
- MemberTypes.Method, Expression.AllBindingFlags, Location);
+ return new EmitContext (
+ tc, Parent, Location, ig, ReturnType, ModFlags, false);
+ }
- if (member_lookup != null){
- MethodGroupExpr parent_destructor = ((MethodGroupExpr) member_lookup);
-
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Call, (MethodInfo) parent_destructor.Methods [0]);
+ public ObsoleteAttribute GetObsoleteAttribute ()
+ {
+ return GetObsoleteAttribute (Parent);
+ }
+
+ /// <summary>
+ /// Returns true if method has conditional attribute and the conditions is not defined (method is excluded).
+ /// </summary>
+ public bool IsExcluded (EmitContext ec)
+ {
+ if ((caching_flags & Flags.Excluded_Undetected) == 0)
+ return (caching_flags & Flags.Excluded) != 0;
+
+ caching_flags &= ~Flags.Excluded_Undetected;
+
+ if (parent_method == null) {
+ if (OptAttributes == null)
+ return false;
+
+ Attribute[] attrs = OptAttributes.SearchMulti (TypeManager.conditional_attribute_type, ec);
+
+ if (attrs == null)
+ return false;
+
+ foreach (Attribute a in attrs) {
+ string condition = a.GetConditionalAttributeValue (
+ Parent);
+ if (RootContext.AllDefines.Contains (condition))
+ return false;
}
+
+ caching_flags |= Flags.Excluded;
+ return true;
}
- ec.InFinally = old_in_finally;
-
- ig.EndExceptionBlock ();
- //ig.MarkLabel (ec.ReturnLabel);
- ig.Emit (OpCodes.Ret);
+
+ IMethodData md = TypeManager.GetMethod (parent_method);
+ if (md == null) {
+ if (AttributeTester.IsConditionalMethodExcluded (parent_method)) {
+ caching_flags |= Flags.Excluded;
+ return true;
+ }
+ return false;
+ }
+
+ if (md.IsExcluded (ec)) {
+ caching_flags |= Flags.Excluded;
+ return true;
+ }
+ return false;
}
+
+ #endregion
}
public abstract class ConstructorInitializer {
ArrayList argument_list;
- ConstructorInfo parent_constructor;
- Location location;
+ protected ConstructorInfo parent_constructor;
+ Parameters parameters;
+ Location loc;
- public ConstructorInitializer (ArrayList argument_list, Location location)
+ public ConstructorInitializer (ArrayList argument_list, Parameters parameters,
+ Location loc)
{
this.argument_list = argument_list;
- this.location = location;
+ this.parameters = parameters;
+ this.loc = loc;
}
public ArrayList Arguments {
@@ -2253,98 +3832,229 @@ namespace Mono.CSharp {
}
}
- public bool Resolve (EmitContext ec)
+ public bool Resolve (ConstructorBuilder caller_builder, EmitContext ec)
{
Expression parent_constructor_group;
Type t;
-
+
+ ec.CurrentBlock = new ToplevelBlock (Block.Flags.Implicit, parameters, loc);
+
if (argument_list != null){
foreach (Argument a in argument_list){
- if (!a.Resolve (ec, location))
+ if (!a.Resolve (ec, loc))
return false;
}
}
+ ec.CurrentBlock = null;
if (this is ConstructorBaseInitializer) {
if (ec.ContainerType.BaseType == null)
return true;
t = ec.ContainerType.BaseType;
+ if (ec.ContainerType.IsValueType) {
+ Report.Error (522, loc,
+ "structs cannot call base class constructors");
+ return false;
+ }
} else
t = ec.ContainerType;
-
+
parent_constructor_group = Expression.MemberLookup (
- ec, t, ".ctor",
- MemberTypes.Constructor,
+ ec, t, ".ctor", MemberTypes.Constructor,
BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly,
- location);
+ loc);
if (parent_constructor_group == null){
- Report.Error (1501, location,
- "Can not find a constructor for this argument list");
+ parent_constructor_group = Expression.MemberLookup (
+ ec, t, ".ctor", MemberTypes.Constructor,
+ BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly,
+ loc);
+
+ if (parent_constructor_group != null)
+ Report.Error (
+ 112, loc, "`{0}.{1}' is inaccessible due to " +
+ "its protection level", t.FullName, t.Name);
+ else
+ Report.Error (
+ 1501, loc, "Can not find a constructor for " +
+ "this argument list");
return false;
}
- parent_constructor = (ConstructorInfo) Invocation.OverloadResolve (ec,
- (MethodGroupExpr) parent_constructor_group, argument_list, location);
+ parent_constructor = (ConstructorInfo) Invocation.OverloadResolve (
+ ec, (MethodGroupExpr) parent_constructor_group, argument_list,
+ false, loc);
if (parent_constructor == null){
- Report.Error (1501, location,
+ Report.Error (1501, loc,
"Can not find a constructor for this argument list");
return false;
}
+
+ if (parent_constructor == caller_builder){
+ Report.Error (516, String.Format ("Constructor `{0}' can not call itself", TypeManager.CSharpSignature (caller_builder)));
+ return false;
+ }
return true;
}
public void Emit (EmitContext ec)
{
- ec.ig.Emit (OpCodes.Ldarg_0);
- if (argument_list != null)
- Invocation.EmitArguments (ec, null, argument_list);
- if (parent_constructor != null)
- ec.ig.Emit (OpCodes.Call, parent_constructor);
+ if (parent_constructor != null){
+ ec.Mark (loc, false);
+ if (ec.IsStatic)
+ Invocation.EmitCall (ec, true, true, null, parent_constructor, argument_list, loc);
+ else
+ Invocation.EmitCall (ec, true, false, ec.GetThis (loc), parent_constructor, argument_list, loc);
+ }
+ }
+
+ /// <summary>
+ /// Method search for base ctor. (We do not cache it).
+ /// </summary>
+ Constructor GetOverloadedConstructor (TypeContainer tc)
+ {
+ if (tc.InstanceConstructors == null)
+ return null;
+
+ foreach (Constructor c in tc.InstanceConstructors) {
+ if (Arguments == null) {
+ if (c.ParameterTypes.Length == 0)
+ return c;
+
+ continue;
+ }
+
+ bool ok = true;
+
+ int count = c.ParameterInfo.Count;
+ if ((count > 0) &&
+ c.ParameterInfo.ParameterModifier (count - 1) == Parameter.Modifier.PARAMS) {
+ for (int i = 0; i < count-1; i++)
+ if (c.ParameterTypes [i] != ((Argument)Arguments [i]).Type) {
+ ok = false;
+ break;
+ }
+ } else {
+ if (c.ParameterTypes.Length != Arguments.Count)
+ continue;
+
+ for (int i = 0; i < Arguments.Count; ++i)
+ if (c.ParameterTypes [i] != ((Argument)Arguments [i]).Type) {
+ ok = false;
+ break;
+ }
+ }
+
+ if (!ok)
+ continue;
+
+ return c;
+ }
+
+ return null;
+ }
+
+ //TODO: implement caching when it will be necessary
+ public virtual void CheckObsoleteAttribute (TypeContainer tc, Location loc)
+ {
+ Constructor ctor = GetOverloadedConstructor (tc);
+ if (ctor == null)
+ return;
+
+ ObsoleteAttribute oa = ctor.GetObsoleteAttribute (tc);
+ if (oa == null)
+ return;
+
+ AttributeTester.Report_ObsoleteMessage (oa, ctor.GetSignatureForError (), loc);
}
}
public class ConstructorBaseInitializer : ConstructorInitializer {
- public ConstructorBaseInitializer (ArrayList argument_list, Location l) : base (argument_list, l)
+ public ConstructorBaseInitializer (ArrayList argument_list, Parameters pars, Location l) :
+ base (argument_list, pars, l)
{
}
+
+ public override void CheckObsoleteAttribute(TypeContainer tc, Location loc) {
+ if (parent_constructor == null)
+ return;
+
+ TypeContainer type_ds = TypeManager.LookupTypeContainer (tc.base_class_type);
+ if (type_ds == null) {
+ ObsoleteAttribute oa = AttributeTester.GetMemberObsoleteAttribute (parent_constructor);
+
+ if (oa != null)
+ AttributeTester.Report_ObsoleteMessage (oa, TypeManager.CSharpSignature (parent_constructor), loc);
+
+ return;
+ }
+
+ base.CheckObsoleteAttribute (type_ds, loc);
+ }
+
}
public class ConstructorThisInitializer : ConstructorInitializer {
- public ConstructorThisInitializer (ArrayList argument_list, Location l) : base (argument_list, l)
+ public ConstructorThisInitializer (ArrayList argument_list, Parameters pars, Location l) :
+ base (argument_list, pars, l)
{
}
}
- public class Constructor : MethodCore {
+ public class Constructor : MethodCore, IMethodData {
public ConstructorBuilder ConstructorBuilder;
public ConstructorInitializer Initializer;
- public Attributes OptAttributes;
+ ListDictionary declarative_security;
// <summary>
// Modifiers allowed for a constructor.
// </summary>
- const int AllowedModifiers =
+ public const int AllowedModifiers =
Modifiers.PUBLIC |
Modifiers.PROTECTED |
Modifiers.INTERNAL |
Modifiers.STATIC |
Modifiers.UNSAFE |
+ Modifiers.EXTERN |
Modifiers.PRIVATE;
+ bool has_compliant_args = false;
//
// The spec claims that static is not permitted, but
// my very own code has static constructors.
//
- public Constructor (string name, Parameters args, ConstructorInitializer init, Location l)
- : base (name, args, l)
+ public Constructor (TypeContainer ds, string name, int mod, Parameters args,
+ ConstructorInitializer init, Location l)
+ : base (ds, null, mod, AllowedModifiers, false, new MemberName (name),
+ null, args, l)
{
Initializer = init;
}
+ public override string GetSignatureForError()
+ {
+ if (ConstructorBuilder == null)
+ return GetSignatureForError (Parent);
+
+ return TypeManager.CSharpSignature (ConstructorBuilder);
+ }
+
+ public bool HasCompliantArgs {
+ get {
+ return has_compliant_args;
+ }
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Constructor;
+ }
+ }
+
+
//
// Returns true if this is a default constructor
//
@@ -2361,52 +4071,113 @@ namespace Mono.CSharp {
(Initializer.Arguments == null);
}
- //
- // Creates the ConstructorBuilder
- //
- public override bool Define (TypeContainer parent)
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
- MethodAttributes ca = (MethodAttributes.RTSpecialName |
- MethodAttributes.SpecialName);
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (declarative_security == null) {
+ declarative_security = new ListDictionary ();
+ }
+ a.ExtractSecurityPermissionSet (declarative_security);
+ return;
+ }
- Type [] parameters = ParameterTypes (parent);
+ ConstructorBuilder.SetCustomAttribute (cb);
+ }
+
+ protected override bool CheckForDuplications ()
+ {
+ ArrayList ar = Parent.InstanceConstructors;
+ if (ar != null) {
+ int arLen = ar.Count;
+
+ for (int i = 0; i < arLen; i++) {
+ Constructor m = (Constructor) ar [i];
+ if (IsDuplicateImplementation (m))
+ return false;
+ }
+ }
+ return true;
+ }
- if (parameters == null)
+ protected override bool CheckBase ()
+ {
+ // Check whether arguments were correct.
+ if (!DoDefineParameters ())
return false;
-
+
+ // TODO: skip the rest for generated ctor
if ((ModFlags & Modifiers.STATIC) != 0)
- ca |= MethodAttributes.Static;
- else {
- if (parent is Struct && parameters.Length == 0){
- Report.Error (
- 568, Location,
+ return true;
+
+ if (!CheckForDuplications ())
+ return false;
+
+ if (Parent.Kind == Kind.Struct) {
+ if (ParameterTypes.Length == 0) {
+ Report.Error (568, Location,
"Structs can not contain explicit parameterless " +
"constructors");
return false;
}
- ca |= MethodAttributes.Public | MethodAttributes.HideBySig;
- }
- foreach (Type partype in parameters)
- if (!TypeContainer.AsAccessible (partype, ModFlags))
+ if ((ModFlags & Modifiers.PROTECTED) != 0) {
+ Report.Error (666, Location, "Protected member in struct declaration");
return false;
+ }
+ }
- ConstructorBuilder = parent.TypeBuilder.DefineConstructor (
- ca, GetCallingConvention (parent is Class), parameters);
+ if ((RootContext.WarningLevel >= 4) && ((Parent.ModFlags & Modifiers.SEALED) != 0 && (ModFlags & Modifiers.PROTECTED) != 0)) {
+ Report.Warning (628, Location, "'{0}': new protected member declared in sealed class", GetSignatureForError (Parent));
+ }
+
+ return true;
+ }
+
+ //
+ // Creates the ConstructorBuilder
+ //
+ public override bool Define ()
+ {
+ MethodAttributes ca = (MethodAttributes.RTSpecialName |
+ MethodAttributes.SpecialName);
+
+ if ((ModFlags & Modifiers.STATIC) != 0) {
+ ca |= MethodAttributes.Static | MethodAttributes.Private;
+ } else {
+ ca |= MethodAttributes.HideBySig;
+
+ if ((ModFlags & Modifiers.PUBLIC) != 0)
+ ca |= MethodAttributes.Public;
+ else if ((ModFlags & Modifiers.PROTECTED) != 0){
+ if ((ModFlags & Modifiers.INTERNAL) != 0)
+ ca |= MethodAttributes.FamORAssem;
+ else
+ ca |= MethodAttributes.Family;
+ } else if ((ModFlags & Modifiers.INTERNAL) != 0)
+ ca |= MethodAttributes.Assembly;
+ else if (IsDefault ())
+ ca |= MethodAttributes.Public;
+ else
+ ca |= MethodAttributes.Private;
+ }
+
+ // Check if arguments were correct.
+ if (!CheckBase ())
+ return false;
+
+ ConstructorBuilder = Parent.TypeBuilder.DefineConstructor (
+ ca, CallingConventions,
+ ParameterTypes);
+
+ if ((ModFlags & Modifiers.UNSAFE) != 0)
+ ConstructorBuilder.InitLocals = false;
+
+ TypeManager.AddMethod (ConstructorBuilder, this);
//
// HACK because System.Reflection.Emit is lame
//
- ParameterInfo = new InternalParameters (parent, Parameters);
-
- if (!TypeManager.RegisterMethod (ConstructorBuilder, ParameterInfo, parameters)) {
- Report.Error (
- 111, Location,
- "Class `" +parent.Name+ "' already contains a definition with the " +
- "same return value and parameter types for constructor `" + Name
- + "'");
- return false;
- }
+ TypeManager.RegisterMethod (ConstructorBuilder, ParameterInfo, ParameterTypes);
return true;
}
@@ -2414,14 +4185,33 @@ namespace Mono.CSharp {
//
// Emits the code
//
- public void Emit (TypeContainer parent)
+ public override void Emit ()
{
- ILGenerator ig = ConstructorBuilder.GetILGenerator ();
- EmitContext ec = new EmitContext (parent, Location, ig, null, ModFlags, true);
+ EmitContext ec = CreateEmitContext (null, null);
- if (parent is Class && ((ModFlags & Modifiers.STATIC) == 0)){
- if (Initializer == null)
- Initializer = new ConstructorBaseInitializer (null, parent.Location);
+ //
+ // extern methods have no bodies
+ //
+ if ((ModFlags & Modifiers.EXTERN) != 0) {
+ if ((block != null) && ((ModFlags & Modifiers.EXTERN) != 0)) {
+ Report.Error (
+ 179, Location, "External constructor `" +
+ TypeManager.CSharpSignature (ConstructorBuilder) +
+ "' can not have a body");
+ return;
+ }
+ } else if (block == null) {
+ Report.Error (
+ 501, Location, "Constructor `" +
+ TypeManager.CSharpSignature (ConstructorBuilder) +
+ "' must declare a body since it is not marked extern");
+ return;
+ }
+
+ if ((ModFlags & Modifiers.STATIC) == 0){
+ if (Parent.Kind == Kind.Class && Initializer == null)
+ Initializer = new ConstructorBaseInitializer (
+ null, Parameters.EmptyReadOnlyParameters, Location);
//
@@ -2429,30 +4219,774 @@ namespace Mono.CSharp {
// `this' access
//
ec.IsStatic = true;
- if (!Initializer.Resolve (ec))
+ if (Initializer != null && !Initializer.Resolve (ConstructorBuilder, ec))
return;
ec.IsStatic = false;
}
- LabelParameters (ec, ParameterTypes (parent), ConstructorBuilder);
+ Parameters.LabelParameters (ec, ConstructorBuilder, Location);
+ SourceMethod source = SourceMethod.Create (
+ Parent, ConstructorBuilder, block);
+
//
// Classes can have base initializers and instance field initializers.
//
- if (parent is Class){
+ if (Parent.Kind == Kind.Class){
if ((ModFlags & Modifiers.STATIC) == 0){
- parent.EmitFieldInitializers (ec);
- Initializer.Emit (ec);
+ //
+ // If we use a "this (...)" constructor initializer, then
+ // do not emit field initializers, they are initialized in the other constructor
+ //
+ if (!(Initializer != null && Initializer is ConstructorThisInitializer))
+ Parent.EmitFieldInitializers (ec);
}
}
+ if (Initializer != null) {
+ if (GetObsoleteAttribute (Parent) == null && Parent.GetObsoleteAttribute (Parent.Parent) == null)
+ Initializer.CheckObsoleteAttribute (Parent, Location);
+ else
+ ec.TestObsoleteMethodUsage = false;
+ Initializer.Emit (ec);
+ }
if ((ModFlags & Modifiers.STATIC) != 0)
- parent.EmitFieldInitializers (ec);
+ Parent.EmitFieldInitializers (ec);
+
+ if (OptAttributes != null)
+ OptAttributes.Emit (ec, this);
+
+ // If this is a non-static `struct' constructor and doesn't have any
+ // initializer, it must initialize all of the struct's fields.
+ if ((Parent.Kind == Kind.Struct) &&
+ ((ModFlags & Modifiers.STATIC) == 0) && (Initializer == null))
+ Block.AddThisVariable (Parent, Location);
+
+ ec.EmitTopBlock (block, ParameterInfo, Location);
+
+ if (source != null)
+ source.CloseMethod ();
- Attribute.ApplyAttributes (ec, ConstructorBuilder, this, OptAttributes, Location);
+ base.Emit ();
- ec.EmitTopBlock (Block, Location);
+ if (declarative_security != null) {
+ foreach (DictionaryEntry de in declarative_security) {
+ ConstructorBuilder.AddDeclarativeSecurity ((SecurityAction)de.Key, (PermissionSet)de.Value);
+ }
+ }
+
+ block = null;
+ }
+
+ // Is never override
+ protected override MethodInfo FindOutParentMethod (TypeContainer container, ref Type parent_ret_type)
+ {
+ return null;
+ }
+
+ protected override bool VerifyClsCompliance (DeclSpace ds)
+ {
+ if (!base.VerifyClsCompliance (ds) || !IsExposedFromAssembly (ds)) {
+ return false;
+ }
+
+ if (parameter_types.Length > 0) {
+ ArrayList al = (ArrayList)ds.MemberCache.Members [".ctor"];
+ if (al.Count > 3)
+ ds.MemberCache.VerifyClsParameterConflict (al, this, ConstructorBuilder);
+
+ if (ds.TypeBuilder.IsSubclassOf (TypeManager.attribute_type)) {
+ foreach (Type param in parameter_types) {
+ if (param.IsArray) {
+ return true;
+ }
+ }
+ }
+ }
+ has_compliant_args = true;
+ return true;
+ }
+
+ #region IMethodData Members
+
+ public System.Reflection.CallingConventions CallingConventions {
+ get {
+ CallingConventions cc = Parameters.GetCallingConvention ();
+
+ if (Parent.Kind == Kind.Class)
+ if ((ModFlags & Modifiers.STATIC) == 0)
+ cc |= CallingConventions.HasThis;
+
+ // FIXME: How is `ExplicitThis' used in C#?
+
+ return cc;
+ }
+ }
+
+ public new Location Location {
+ get {
+ return base.Location;
+ }
+ }
+
+ public MemberName MethodName {
+ get {
+ return MemberName;
+ }
+ }
+
+ public Type ReturnType {
+ get {
+ return MemberType;
+ }
+ }
+
+ public EmitContext CreateEmitContext (TypeContainer tc, ILGenerator ig)
+ {
+ ILGenerator ig_ = ConstructorBuilder.GetILGenerator ();
+ return new EmitContext (Parent, Location, ig_, null, ModFlags, true);
+ }
+
+ public ObsoleteAttribute GetObsoleteAttribute ()
+ {
+ return null;
+ }
+
+ public bool IsExcluded(EmitContext ec)
+ {
+ return false;
+ }
+
+ #endregion
+ }
+
+ /// <summary>
+ /// Interface for MethodData class. Holds links to parent members to avoid member duplication.
+ /// </summary>
+ public interface IMethodData
+ {
+ CallingConventions CallingConventions { get; }
+ Location Location { get; }
+ MemberName MethodName { get; }
+ Type[] ParameterTypes { get; }
+ Type ReturnType { get; }
+
+ Attributes OptAttributes { get; }
+ ToplevelBlock Block { get; }
+
+ EmitContext CreateEmitContext (TypeContainer tc, ILGenerator ig);
+ ObsoleteAttribute GetObsoleteAttribute ();
+ string GetSignatureForError (TypeContainer tc);
+ bool IsExcluded (EmitContext ec);
+ bool IsClsCompliaceRequired (DeclSpace ds);
+ }
+
+ //
+ // Encapsulates most of the Method's state
+ //
+ public class MethodData {
+
+ readonly IMethodData method;
+
+ //
+ // The return type of this method
+ //
+ public readonly InternalParameters ParameterInfo;
+
+ //
+ // Are we implementing an interface ?
+ //
+ public bool IsImplementing = false;
+
+ //
+ // Protected data.
+ //
+ protected MemberBase member;
+ protected int modifiers;
+ protected MethodAttributes flags;
+
+ MethodBuilder builder = null;
+ public MethodBuilder MethodBuilder {
+ get {
+ return builder;
+ }
+ }
+
+ public MethodData (MemberBase member, InternalParameters parameters,
+ int modifiers, MethodAttributes flags, IMethodData method)
+ {
+ this.member = member;
+ this.ParameterInfo = parameters;
+ this.modifiers = modifiers;
+ this.flags = flags;
+
+ this.method = method;
+ }
+
+ public bool Define (TypeContainer container)
+ {
+ MethodInfo implementing = null;
+
+ string name = method.MethodName.Name;
+ string method_name = name;
+
+ Type[] ParameterTypes = method.ParameterTypes;
+
+ if (container.Pending != null){
+ if (member is Indexer)
+ implementing = container.Pending.IsInterfaceIndexer (
+ member.InterfaceType, method.ReturnType, ParameterTypes);
+ else
+ implementing = container.Pending.IsInterfaceMethod (
+ member.InterfaceType, name, method.ReturnType, ParameterTypes);
+
+ if (member.InterfaceType != null){
+ if (implementing == null){
+ Report.Error (539, method.Location,
+ "'{0}' in explicit interface declaration is not an interface", method_name);
+ return false;
+ }
+ method_name = member.InterfaceType.FullName + "." + name;
+ }
+ }
+
+ //
+ // For implicit implementations, make sure we are public, for
+ // explicit implementations, make sure we are private.
+ //
+ if (implementing != null){
+ //
+ // Setting null inside this block will trigger a more
+ // verbose error reporting for missing interface implementations
+ //
+ // The "candidate" function has been flagged already
+ // but it wont get cleared
+ //
+ if (member.IsExplicitImpl){
+ if ((modifiers & (Modifiers.PUBLIC | Modifiers.ABSTRACT | Modifiers.VIRTUAL)) != 0){
+ Modifiers.Error_InvalidModifier (method.Location, "public, virtual or abstract");
+ implementing = null;
+ }
+ } else if ((flags & MethodAttributes.MemberAccessMask) != MethodAttributes.Public){
+ if (TypeManager.IsInterfaceType (implementing.DeclaringType)){
+ //
+ // If this is an interface method implementation,
+ // check for public accessibility
+ //
+ implementing = null;
+ } else if ((flags & MethodAttributes.MemberAccessMask) == MethodAttributes.Private){
+ // We may never be private.
+ implementing = null;
+ } else if ((modifiers & Modifiers.OVERRIDE) == 0){
+ //
+ // We may be protected if we're overriding something.
+ //
+ implementing = null;
+ }
+ }
+
+ //
+ // Static is not allowed
+ //
+ if ((modifiers & Modifiers.STATIC) != 0){
+ implementing = null;
+ Modifiers.Error_InvalidModifier (method.Location, "static");
+ }
+ }
+
+ //
+ // If implementing is still valid, set flags
+ //
+ if (implementing != null){
+ //
+ // When implementing interface methods, set NewSlot
+ // unless, we are overwriting a method.
+ //
+ if (implementing.DeclaringType.IsInterface){
+ if ((modifiers & Modifiers.OVERRIDE) == 0)
+ flags |= MethodAttributes.NewSlot;
+ }
+ flags |=
+ MethodAttributes.Virtual |
+ MethodAttributes.HideBySig;
+
+ // Set Final unless we're virtual, abstract or already overriding a method.
+ if ((modifiers & (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE)) == 0)
+ flags |= MethodAttributes.Final;
+
+ IsImplementing = true;
+ }
+
+ EmitContext ec = method.CreateEmitContext (container, null);
+
+ DefineMethodBuilder (ec, container, method_name, ParameterTypes);
+
+ if (builder == null)
+ return false;
+
+ if ((modifiers & Modifiers.UNSAFE) != 0)
+ builder.InitLocals = false;
+
+ if (IsImplementing){
+ //
+ // clear the pending implemntation flag
+ //
+ if (member is Indexer) {
+ container.Pending.ImplementIndexer (
+ member.InterfaceType, builder, method.ReturnType,
+ ParameterTypes, member.IsExplicitImpl);
+ } else
+ container.Pending.ImplementMethod (
+ member.InterfaceType, name, method.ReturnType,
+ ParameterTypes, member.IsExplicitImpl);
+
+ if (member.IsExplicitImpl)
+ container.TypeBuilder.DefineMethodOverride (
+ builder, implementing);
+
+ }
+
+ TypeManager.RegisterMethod (builder, ParameterInfo, ParameterTypes);
+ TypeManager.AddMethod (builder, method);
+
+ return true;
+ }
+
+
+ /// <summary>
+ /// Create the MethodBuilder for the method
+ /// </summary>
+ void DefineMethodBuilder (EmitContext ec, TypeContainer container, string method_name, Type[] ParameterTypes)
+ {
+ const int extern_static = Modifiers.EXTERN | Modifiers.STATIC;
+
+ if ((modifiers & extern_static) == extern_static) {
+
+ if (method.OptAttributes != null) {
+ Attribute dllimport_attribute = method.OptAttributes.Search (TypeManager.dllimport_type, ec);
+ if (dllimport_attribute != null) {
+ flags |= MethodAttributes.PinvokeImpl;
+ builder = dllimport_attribute.DefinePInvokeMethod (
+ ec, container.TypeBuilder, method_name, flags,
+ method.ReturnType, ParameterTypes);
+
+ return;
+ }
+ }
+
+ // for extern static method must be specified either DllImport attribute or MethodImplAttribute.
+ // We are more strict than Microsoft and report CS0626 like error
+ if (method.OptAttributes == null ||
+ !method.OptAttributes.Contains (TypeManager.methodimpl_attr_type, ec)) {
+ Report.Error (626, method.Location, "Method, operator, or accessor '{0}' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation", method.GetSignatureForError (container));
+ return;
+ }
+ }
+
+ builder = container.TypeBuilder.DefineMethod (
+ method_name, flags, method.CallingConventions,
+ method.ReturnType, ParameterTypes);
+ }
+
+ //
+ // Emits the code
+ //
+ public void Emit (TypeContainer container, Attributable kind)
+ {
+ EmitContext ec;
+ if ((flags & MethodAttributes.PinvokeImpl) == 0)
+ ec = method.CreateEmitContext (container, builder.GetILGenerator ());
+ else
+ ec = method.CreateEmitContext (container, null);
+
+ if (method.GetObsoleteAttribute () != null || container.GetObsoleteAttribute (container.Parent) != null)
+ ec.TestObsoleteMethodUsage = false;
+
+ Location loc = method.Location;
+ Attributes OptAttributes = method.OptAttributes;
+
+ if (OptAttributes != null)
+ OptAttributes.Emit (ec, kind);
+
+ if (member is MethodCore)
+ ((MethodCore) member).Parameters.LabelParameters (ec, MethodBuilder, loc);
+
+ SymbolWriter sw = CodeGen.SymbolWriter;
+ ToplevelBlock block = method.Block;
+
+ //
+ // abstract or extern methods have no bodies
+ //
+ if ((modifiers & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0){
+ if (block == null)
+ return;
+
+ //
+ // abstract or extern methods have no bodies.
+ //
+ if ((modifiers & Modifiers.ABSTRACT) != 0)
+ Report.Error (
+ 500, method.Location, "Abstract method `" +
+ TypeManager.CSharpSignature (builder) +
+ "' can not have a body");
+
+ if ((modifiers & Modifiers.EXTERN) != 0)
+ Report.Error (
+ 179, method.Location, "External method `" +
+ TypeManager.CSharpSignature (builder) +
+ "' can not have a body");
+
+ return;
+ }
+
+ //
+ // Methods must have a body unless they're extern or abstract
+ //
+ if (block == null) {
+ Report.Error (
+ 501, method.Location, "Method `" +
+ TypeManager.CSharpSignature (builder) +
+ "' must declare a body since it is not marked " +
+ "abstract or extern");
+ return;
+ }
+
+ SourceMethod source = SourceMethod.Create (
+ container, MethodBuilder, method.Block);
+
+ //
+ // Handle destructors specially
+ //
+ // FIXME: This code generates buggy code
+ //
+ if (member is Destructor)
+ EmitDestructor (ec, block);
+ else
+ ec.EmitTopBlock (block, ParameterInfo, loc);
+
+ if (source != null)
+ source.CloseMethod ();
+ }
+
+ void EmitDestructor (EmitContext ec, ToplevelBlock block)
+ {
+ ILGenerator ig = ec.ig;
+
+ Label finish = ig.DefineLabel ();
+
+ block.SetDestructor ();
+
+ ig.BeginExceptionBlock ();
+ ec.ReturnLabel = finish;
+ ec.HasReturnLabel = true;
+ ec.EmitTopBlock (block, null, method.Location);
+
+ // ig.MarkLabel (finish);
+ ig.BeginFinallyBlock ();
+
+ if (ec.ContainerType.BaseType != null) {
+ Expression member_lookup = Expression.MemberLookup (
+ ec, ec.ContainerType.BaseType, null, ec.ContainerType.BaseType,
+ "Finalize", MemberTypes.Method, Expression.AllBindingFlags, method.Location);
+
+ if (member_lookup != null){
+ MethodGroupExpr parent_destructor = ((MethodGroupExpr) member_lookup);
+
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Call, (MethodInfo) parent_destructor.Methods [0]);
+ }
+ }
+
+ ig.EndExceptionBlock ();
+ //ig.MarkLabel (ec.ReturnLabel);
+ ig.Emit (OpCodes.Ret);
+ }
+ }
+
+ public class Destructor : Method {
+
+ public Destructor (TypeContainer ds, Expression return_type, int mod,
+ string name, Parameters parameters, Attributes attrs,
+ Location l)
+ : base (ds, return_type, mod, false, new MemberName (name),
+ parameters, attrs, l)
+ { }
+
+ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type == TypeManager.conditional_attribute_type) {
+ Report.Error (577, Location, "Conditional not valid on '{0}' because it is a destructor, operator, or explicit interface implementation", GetSignatureForError ());
+ return;
+ }
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+ }
+
+ abstract public class MemberBase : MemberCore {
+ public Expression Type;
+
+ public MethodAttributes flags;
+
+ protected readonly int explicit_mod_flags;
+
+ //
+ // The "short" name of this property / indexer / event. This is the
+ // name without the explicit interface.
+ //
+ public string ShortName;
+
+ //
+ // The type of this property / indexer / event
+ //
+ public Type MemberType;
+
+ //
+ // If true, this is an explicit interface implementation
+ //
+ public bool IsExplicitImpl = false;
+
+ //
+ // The name of the interface we are explicitly implementing
+ //
+ public MemberName ExplicitInterfaceName = null;
+
+ //
+ // Whether this is an interface member.
+ //
+ public bool IsInterface;
+
+ //
+ // If true, the interface type we are explicitly implementing
+ //
+ public Type InterfaceType = null;
+
+ //
+ // The constructor is only exposed to our children
+ //
+ protected MemberBase (TypeContainer parent, Expression type, int mod,
+ int allowed_mod, int def_mod, MemberName name,
+ Attributes attrs, Location loc)
+ : base (parent, name, attrs, loc)
+ {
+ explicit_mod_flags = mod;
+ Type = type;
+ ModFlags = Modifiers.Check (allowed_mod, mod, def_mod, loc);
+
+ // Check for explicit interface implementation
+ if (MemberName.Left != null) {
+ ExplicitInterfaceName = MemberName.Left;
+ ShortName = MemberName.Name;
+ IsExplicitImpl = true;
+ } else
+ ShortName = Name;
+ }
+
+ protected virtual bool CheckBase ()
+ {
+ if ((ModFlags & Modifiers.PROTECTED) != 0 && Parent.Kind == Kind.Struct) {
+ Report.Error (666, Location, "Protected member in struct declaration");
+ return false;
+ }
+
+ if ((RootContext.WarningLevel >= 4) &&
+ ((Parent.ModFlags & Modifiers.SEALED) != 0) &&
+ ((ModFlags & Modifiers.PROTECTED) != 0) &&
+ ((ModFlags & Modifiers.OVERRIDE) == 0) && (Name != "Finalize")) {
+ Report.Warning (628, Location, "'{0}': new protected member declared in sealed class", GetSignatureForError (Parent));
+ }
+ return true;
+ }
+
+ protected virtual bool CheckParameters (DeclSpace ds, Type [] parameters)
+ {
+ bool error = false;
+
+ foreach (Type partype in parameters){
+ if (partype == TypeManager.void_type) {
+ Report.Error (
+ 1547, Location, "Keyword 'void' cannot " +
+ "be used in this context");
+ return false;
+ }
+
+ if (partype.IsPointer){
+ if (!UnsafeOK (ds))
+ error = true;
+ if (!TypeManager.VerifyUnManaged (TypeManager.GetElementType (partype), Location))
+ error = true;
+ }
+
+ if (ds.AsAccessible (partype, ModFlags))
+ continue;
+
+ if (this is Indexer)
+ Report.Error (55, Location,
+ "Inconsistent accessibility: parameter type `" +
+ TypeManager.CSharpName (partype) + "' is less " +
+ "accessible than indexer `" + Name + "'");
+ else if ((this is Method) && ((Method) this).IsOperator)
+ Report.Error (57, Location,
+ "Inconsistent accessibility: parameter type `" +
+ TypeManager.CSharpName (partype) + "' is less " +
+ "accessible than operator `" + Name + "'");
+ else
+ Report.Error (51, Location,
+ "Inconsistent accessibility: parameter type `" +
+ TypeManager.CSharpName (partype) + "' is less " +
+ "accessible than method `" + Name + "'");
+ error = true;
+ }
+
+ return !error;
+ }
+
+ protected virtual bool DoDefine ()
+ {
+ EmitContext ec = Parent.EmitContext;
+ if (ec == null)
+ throw new InternalErrorException ("MemberBase.DoDefine called too early");
+
+ if (Name == null)
+ throw new InternalErrorException ();
+
+ if (IsInterface) {
+ ModFlags = Modifiers.PUBLIC |
+ Modifiers.ABSTRACT |
+ Modifiers.VIRTUAL | (ModFlags & Modifiers.UNSAFE) | (ModFlags & Modifiers.NEW);
+
+ flags = MethodAttributes.Public |
+ MethodAttributes.Abstract |
+ MethodAttributes.HideBySig |
+ MethodAttributes.NewSlot |
+ MethodAttributes.Virtual;
+ } else {
+ if (!Parent.MethodModifiersValid (ModFlags, Name, Location))
+ return false;
+
+ flags = Modifiers.MethodAttr (ModFlags);
+ }
+
+ // Lookup Type, verify validity
+ bool old_unsafe = ec.InUnsafe;
+ ec.InUnsafe = InUnsafe;
+ Type = Type.ResolveAsTypeTerminal (ec, false);
+ ec.InUnsafe = old_unsafe;
+
+ if (Type == null)
+ return false;
+
+ MemberType = Type.Type;
+
+ if ((Parent.ModFlags & Modifiers.SEALED) != 0){
+ if ((ModFlags & (Modifiers.VIRTUAL|Modifiers.ABSTRACT)) != 0){
+ Report.Error (549, Location, "Virtual method can not be contained in sealed class");
+ return false;
+ }
+ }
+
+ // verify accessibility
+ if (!Parent.AsAccessible (MemberType, ModFlags)) {
+ if (this is Property)
+ Report.Error (53, Location,
+ "Inconsistent accessibility: property type `" +
+ TypeManager.CSharpName (MemberType) + "' is less " +
+ "accessible than property `" + Name + "'");
+ else if (this is Indexer)
+ Report.Error (54, Location,
+ "Inconsistent accessibility: indexer return type `" +
+ TypeManager.CSharpName (MemberType) + "' is less " +
+ "accessible than indexer `" + Name + "'");
+ else if (this is Method) {
+ if (((Method) this).IsOperator)
+ Report.Error (56, Location,
+ "Inconsistent accessibility: return type `" +
+ TypeManager.CSharpName (MemberType) + "' is less " +
+ "accessible than operator `" + Name + "'");
+ else
+ Report.Error (50, Location,
+ "Inconsistent accessibility: return type `" +
+ TypeManager.CSharpName (MemberType) + "' is less " +
+ "accessible than method `" + Name + "'");
+ } else
+ Report.Error (52, Location,
+ "Inconsistent accessibility: field type `" +
+ TypeManager.CSharpName (MemberType) + "' is less " +
+ "accessible than field `" + Name + "'");
+ return false;
+ }
+
+ if (MemberType.IsPointer && !UnsafeOK (Parent))
+ return false;
+
+ if (IsExplicitImpl) {
+ Expression expr = ExplicitInterfaceName.GetTypeExpression (Location);
+ TypeExpr texpr = expr.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
+ return false;
+
+ InterfaceType = texpr.ResolveType (ec);
+
+ if (InterfaceType.IsClass) {
+ Report.Error (538, Location, "'{0}' in explicit interface declaration is not an interface", ExplicitInterfaceName);
+ return false;
+ }
+
+#if FIXME
+ // Compute the full name that we need to export.
+ if (InterfaceType.FullName != ExplicitInterfaceName) {
+ ExplicitInterfaceName = InterfaceType.FullName;
+ UpdateMemberName ();
+ }
+#endif
+
+ if (!Parent.VerifyImplements (InterfaceType, ShortName, Name, Location))
+ return false;
+
+ Modifiers.Check (Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location);
+
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// The name of the member can be changed during definition (see IndexerName attribute)
+ /// </summary>
+ protected virtual void UpdateMemberName ()
+ {
+ MemberName.Name = ShortName;
+ }
+
+ public override string GetSignatureForError (TypeContainer tc)
+ {
+ return String.Concat (tc.Name, '.', base.GetSignatureForError (tc));
+ }
+
+ protected bool IsTypePermitted ()
+ {
+ if (MemberType == TypeManager.arg_iterator_type || MemberType == TypeManager.typed_reference_type) {
+ Report.Error (610, Location, "Field or property cannot be of type '{0}'", TypeManager.CSharpName (MemberType));
+ return false;
+ }
+ return true;
+ }
+
+ protected override bool VerifyClsCompliance(DeclSpace ds)
+ {
+ if (base.VerifyClsCompliance (ds)) {
+ return true;
+ }
+
+ if (IsInterface && HasClsCompliantAttribute && ds.IsClsCompliaceRequired (ds)) {
+ Report.Error (3010, Location, "'{0}': CLS-compliant interfaces must have only CLS-compliant members", GetSignatureForError ());
+ }
+ return false;
+ }
+
+ protected override void VerifyObsoleteAttribute()
+ {
+ CheckUsageOfObsoleteAttribute (MemberType);
}
}
@@ -2460,34 +4994,251 @@ namespace Mono.CSharp {
// Fields and Events both generate FieldBuilders, we use this to share
// their common bits. This is also used to flag usage of the field
//
- abstract public class FieldBase : MemberCore {
- public readonly string Type;
- public readonly Object Initializer;
- public readonly Attributes OptAttributes;
+ abstract public class FieldBase : MemberBase {
public FieldBuilder FieldBuilder;
public Status status;
[Flags]
- public enum Status : byte { ASSIGNED = 1, USED = 2 }
+ public enum Status : byte {
+ ASSIGNED = 1,
+ USED = 2
+ }
+
+ static string[] attribute_targets = new string [] { "field" };
+
+ /// <summary>
+ /// Symbol with same name in parent class/struct
+ /// </summary>
+ public MemberInfo conflict_symbol;
//
// The constructor is only exposed to our children
//
- protected FieldBase (string type, int mod, int allowed_mod, string name,
- object init, Attributes attrs, Location loc)
- : base (name, loc)
+ protected FieldBase (TypeContainer parent, Expression type, int mod,
+ int allowed_mod, MemberName name, object init,
+ Attributes attrs, Location loc)
+ : base (parent, type, mod, allowed_mod, Modifiers.PRIVATE,
+ name, attrs, loc)
{
- Type = type;
- ModFlags = Modifiers.Check (allowed_mod, mod, Modifiers.PRIVATE, loc);
- Initializer = init;
- OptAttributes = attrs;
+ this.init = init;
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Field;
+ }
+ }
+
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type == TypeManager.marshal_as_attr_type) {
+ UnmanagedMarshal marshal = a.GetMarshal (this);
+ if (marshal != null) {
+ FieldBuilder.SetMarshal (marshal);
+ }
+ return;
+ }
+
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
+ a.Error_InvalidSecurityParent ();
+ return;
+ }
+
+ FieldBuilder.SetCustomAttribute (cb);
+ }
+
+ //
+ // Whether this field has an initializer.
+ //
+ public bool HasInitializer {
+ get {
+ return init != null;
+ }
+ }
+
+ protected readonly Object init;
+
+ // Private.
+ Expression init_expr;
+ bool init_expr_initialized = false;
+
+ //
+ // Resolves and returns the field initializer.
+ //
+ public Expression GetInitializerExpression (EmitContext ec)
+ {
+ if (init_expr_initialized)
+ return init_expr;
+
+ Expression e;
+ if (init is Expression)
+ e = (Expression) init;
+ else
+ e = new ArrayCreation (Type, "", (ArrayList)init, Location);
+
+ ec.IsFieldInitializer = true;
+ e = e.DoResolve (ec);
+ ec.IsFieldInitializer = false;
+
+ init_expr = e;
+ init_expr_initialized = true;
+
+ return init_expr;
+ }
+
+ protected override bool CheckBase ()
+ {
+ if (!base.CheckBase ())
+ return false;
+
+ // TODO: Implement
+ if (IsInterface)
+ return true;
+
+ conflict_symbol = Parent.FindMemberWithSameName (Name, false);
+ if (conflict_symbol == null) {
+ if ((RootContext.WarningLevel >= 4) && ((ModFlags & Modifiers.NEW) != 0)) {
+ Report.Warning (109, Location, "The member '{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError (Parent));
+ }
+ return true;
+ }
+
+ if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0) {
+ Report.SymbolRelatedToPreviousError (conflict_symbol);
+ Report.Warning (108, Location, "The keyword new is required on '{0}' because it hides inherited member", GetSignatureForError (Parent));
+ }
+
+ return true;
+ }
+
+ protected override bool DoDefine ()
+ {
+ if (!base.DoDefine ())
+ return false;
+
+ if (MemberType == TypeManager.void_type) {
+ Report.Error (1547, Location,
+ "Keyword 'void' cannot be used in this context");
+ return false;
+ }
+ return true;
+ }
+
+ public override string GetSignatureForError ()
+ {
+ if (FieldBuilder == null) {
+ return base.GetSignatureForError (Parent);
+ }
+ return TypeManager.GetFullNameSignature (FieldBuilder);
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+
+ protected override bool VerifyClsCompliance (DeclSpace ds)
+ {
+ if (!base.VerifyClsCompliance (ds))
+ return false;
+
+ if (FieldBuilder == null) {
+ return true;
+ }
+
+ if (!AttributeTester.IsClsCompliant (FieldBuilder.FieldType)) {
+ Report.Error (3003, Location, "Type of '{0}' is not CLS-compliant", GetSignatureForError ());
+ }
+ return true;
+ }
+
+
+ public void SetAssigned ()
+ {
+ status |= Status.ASSIGNED;
+ }
+ }
+
+ public abstract class FieldMember: FieldBase
+ {
+ bool has_field_offset = false;
+
+ protected FieldMember (TypeContainer parent, Expression type, int mod,
+ int allowed_mod, MemberName name, object init, Attributes attrs, Location loc)
+ : base (parent, type, mod, allowed_mod, name, init, attrs, loc)
+ {
+ }
+
+ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type == TypeManager.field_offset_attribute_type)
+ {
+ has_field_offset = true;
+
+ if (!Parent.HasExplicitLayout) {
+ Report.Error (636, Location, "The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit)");
+ return;
+ }
+
+ if ((ModFlags & Modifiers.STATIC) != 0 || this is Const) {
+ Report.Error (637, Location, "The FieldOffset attribute is not allowed on static or const fields");
+ return;
+ }
+ }
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+
+ public override bool Define()
+ {
+ EmitContext ec = Parent.EmitContext;
+ if (ec == null)
+ throw new InternalErrorException ("FieldMember.Define called too early");
+
+ bool old_unsafe = ec.InUnsafe;
+ ec.InUnsafe = InUnsafe;
+ TypeExpr texpr = Type.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
+ return false;
+
+ MemberType = texpr.ResolveType (ec);
+ ec.InUnsafe = old_unsafe;
+
+ if (!CheckBase ())
+ return false;
+
+ if (!Parent.AsAccessible (MemberType, ModFlags)) {
+ Report.Error (52, Location,
+ "Inconsistent accessibility: field type `" +
+ TypeManager.CSharpName (MemberType) + "' is less " +
+ "accessible than field `" + Name + "'");
+ return false;
+ }
+
+ if (!IsTypePermitted ())
+ return false;
+
+ if (MemberType.IsPointer && !UnsafeOK (Parent))
+ return false;
+
+ return true;
+ }
+
+ public override void Emit ()
+ {
+ if (Parent.HasExplicitLayout && !has_field_offset && (ModFlags & Modifiers.STATIC) == 0) {
+ Report.Error (625, Location, "'{0}': Instance field types marked with StructLayout(LayoutKind.Explicit) must have a FieldOffset attribute.", GetSignatureForError ());
+ }
+
+ base.Emit ();
}
}
//
// The Field class is used to represents class/struct fields during parsing.
//
- public class Field : FieldBase {
+ public class Field : FieldMember {
// <summary>
// Modifiers allowed in a class declaration
// </summary>
@@ -2502,33 +5253,24 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.READONLY;
- public Field (string type, int mod, string name, Object expr_or_array_init,
- Attributes attrs, Location loc)
- : base (type, mod, AllowedModifiers, name, expr_or_array_init, attrs, loc)
+ public Field (TypeContainer parent, Expression type, int mod, string name,
+ Object expr_or_array_init, Attributes attrs, Location loc)
+ : base (parent, type, mod, AllowedModifiers, new MemberName (name),
+ expr_or_array_init, attrs, loc)
{
}
- public override bool Define (TypeContainer parent)
+ public override bool Define ()
{
- Type t = RootContext.LookupType (parent, Type, false, Location);
-
- if (t == null)
+ if (!base.Define ())
return false;
- if (!TypeContainer.AsAccessible (t, ModFlags))
- return false;
-
- if (t.IsPointer && !UnsafeOK (parent))
- return false;
-
if (RootContext.WarningLevel > 1){
- Type ptype = parent.TypeBuilder.BaseType;
+ Type ptype = Parent.TypeBuilder.BaseType;
// ptype is only null for System.Object while compiling corlib.
if (ptype != null){
- MemberInfo [] mi;
-
- mi = TypeContainer.FindMembers (
+ TypeContainer.FindMembers (
ptype, MemberTypes.Method,
BindingFlags.Public |
BindingFlags.Static | BindingFlags.Instance,
@@ -2537,41 +5279,73 @@ namespace Mono.CSharp {
}
if ((ModFlags & Modifiers.VOLATILE) != 0){
- if (!t.IsClass){
- if (TypeManager.IsEnumType (t))
- t = TypeManager.EnumToUnderlying (t);
-
- if (!((t == TypeManager.bool_type) ||
- (t == TypeManager.sbyte_type) ||
- (t == TypeManager.byte_type) ||
- (t == TypeManager.short_type) ||
- (t == TypeManager.ushort_type) ||
- (t == TypeManager.int32_type) ||
- (t == TypeManager.uint32_type) ||
- (t == TypeManager.char_type) ||
- (t == TypeManager.float_type))){
+ if (!MemberType.IsClass){
+ Type vt = MemberType;
+
+ if (TypeManager.IsEnumType (vt))
+ vt = TypeManager.EnumToUnderlying (MemberType);
+
+ if (!((vt == TypeManager.bool_type) ||
+ (vt == TypeManager.sbyte_type) ||
+ (vt == TypeManager.byte_type) ||
+ (vt == TypeManager.short_type) ||
+ (vt == TypeManager.ushort_type) ||
+ (vt == TypeManager.int32_type) ||
+ (vt == TypeManager.uint32_type) ||
+ (vt == TypeManager.char_type) ||
+ (vt == TypeManager.float_type) ||
+ (!vt.IsValueType))){
Report.Error (
- 677, Location, parent.MakeName (Name) +
+ 677, Location, Parent.MakeName (Name) +
" A volatile field can not be of type `" +
- TypeManager.CSharpName (t) + "'");
+ TypeManager.CSharpName (vt) + "'");
return false;
}
}
+
+ if ((ModFlags & Modifiers.READONLY) != 0){
+ Report.Error (
+ 678, Location,
+ "A field can not be both volatile and readonly");
+ return false;
+ }
+ }
+
+ FieldAttributes fa = Modifiers.FieldAttr (ModFlags);
+
+ if (Parent.Kind == Kind.Struct &&
+ ((fa & FieldAttributes.Static) == 0) &&
+ MemberType == Parent.TypeBuilder &&
+ !TypeManager.IsBuiltinType (MemberType)){
+ Report.Error (523, Location, "Struct member `" + Parent.Name + "." + Name +
+ "' causes a cycle in the structure layout");
+ return false;
+ }
+
+ try {
+ FieldBuilder = Parent.TypeBuilder.DefineField (
+ Name, MemberType, Modifiers.FieldAttr (ModFlags));
+
+ TypeManager.RegisterFieldBase (FieldBuilder, this);
+ }
+ catch (ArgumentException) {
+ Report.Warning (-24, Location, "The Microsoft runtime is unable to use [void|void*] as a field type, try using the Mono runtime.");
+ return false;
}
-
- FieldBuilder = parent.TypeBuilder.DefineField (
- Name, t, Modifiers.FieldAttr (ModFlags));
- TypeManager.RegisterFieldBase (FieldBuilder, this);
return true;
}
- public void Emit (TypeContainer tc)
+ public override void Emit ()
{
- EmitContext ec = new EmitContext (tc, Location, null,
- FieldBuilder.FieldType, ModFlags);
+ if (OptAttributes != null) {
+ EmitContext ec = new EmitContext (
+ Parent, Location, null, FieldBuilder.FieldType,
+ ModFlags);
+ OptAttributes.Emit (ec, this);
+ }
- Attribute.ApplyAttributes (ec, FieldBuilder, this, OptAttributes, Location);
+ base.Emit ();
}
}
@@ -2582,409 +5356,747 @@ namespace Mono.CSharp {
//
// Null if the accessor is empty, or a Block if not
//
- public Block Block;
- public Attributes OptAttributes;
+ public const int AllowedModifiers =
+ Modifiers.PUBLIC |
+ Modifiers.PROTECTED |
+ Modifiers.INTERNAL |
+ Modifiers.PRIVATE;
+
+ public ToplevelBlock Block;
+ public Attributes Attributes;
+ public Location Location;
+ public int ModFlags;
- public Accessor (Block b, Attributes attrs)
+ public Accessor (ToplevelBlock b, int mod, Attributes attrs, Location loc)
{
Block = b;
- OptAttributes = attrs;
+ Attributes = attrs;
+ Location = loc;
+ ModFlags = Modifiers.Check (AllowedModifiers, mod, 0, loc);
}
}
-
- public class Property : MemberCore {
- public readonly string Type;
- public Accessor Get, Set;
- public PropertyBuilder PropertyBuilder;
- public Attributes OptAttributes;
- public MethodBuilder GetBuilder, SetBuilder;
- //
- // The type, once we compute it.
- Type PropertyType;
- bool explicit_impl;
+ // Ooouh Martin, templates are missing here.
+ // When it will be possible move here a lot of child code and template method type.
+ public abstract class AbstractPropertyEventMethod: MemberCore, IMethodData {
+ protected MethodData method_data;
+ protected ToplevelBlock block;
+ protected ListDictionary declarative_security;
- //
- // If true, the interface type we are explicitly implementing
- //
- Type explicit_iface_type = null;
+ // The accessor are created event if they are not wanted.
+ // But we need them because their names are reserved.
+ // Field says whether accessor will be emited or not
+ public readonly bool IsDummy;
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.ABSTRACT |
- Modifiers.UNSAFE |
- Modifiers.EXTERN |
- Modifiers.VIRTUAL;
+ protected readonly string prefix;
- public Property (string type, string name, int mod_flags,
- Accessor get_block, Accessor set_block,
- Attributes attrs, Location loc)
- : base (name, loc)
+ ReturnParameter return_attributes;
+
+ public AbstractPropertyEventMethod (MemberBase member, string prefix)
+ : base (null, SetupName (prefix, member), null, member.Location)
{
- Type = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
- Get = get_block;
- Set = set_block;
- OptAttributes = attrs;
+ this.prefix = prefix;
+ IsDummy = true;
}
- //
- // Checks our base implementation if any
- //
- bool CheckBase (MethodAttributes flags, TypeContainer parent)
+ public AbstractPropertyEventMethod (MemberBase member, Accessor accessor,
+ string prefix)
+ : base (null, SetupName (prefix, member),
+ accessor.Attributes, accessor.Location)
{
- //
- // Find properties with the same name on the base class
- //
+ this.prefix = prefix;
+ this.block = accessor.Block;
+ }
- MemberInfo [] props;
- MemberInfo [] props_static = TypeManager.MemberLookup (
- parent.TypeBuilder,
- parent.TypeBuilder.BaseType,
- MemberTypes.Property, BindingFlags.Public | BindingFlags.Static,
- Name);
+ static MemberName SetupName (string prefix, MemberBase member)
+ {
+ MemberName name = member.MemberName.Clone ();
+ name.Name = prefix + member.ShortName;
+ return name;
+ }
- MemberInfo [] props_instance = TypeManager.MemberLookup (
- parent.TypeBuilder,
- parent.TypeBuilder.BaseType,
- MemberTypes.Property, BindingFlags.Public | BindingFlags.Instance,
- Name);
+ public void UpdateName (MemberBase member)
+ {
+ MemberName.Name = prefix + member.ShortName;
+ }
- //
- // Find if we have anything
- //
- if (props_static != null && props_static.Length > 0)
- props = props_static;
- else if (props_instance != null && props_instance.Length > 0)
- props = props_instance;
- else
- props = null;
+ #region IMethodData Members
- //
- // If we have something on the base.
- if (props != null && props.Length > 0){
- if (props.Length > 1)
- throw new Exception ("Should not happen");
-
- PropertyInfo pi = (PropertyInfo) props [0];
+ public ToplevelBlock Block {
+ get {
+ return block;
+ }
- MethodInfo inherited_get = TypeManager.GetPropertyGetter (pi);
- MethodInfo inherited_set = TypeManager.GetPropertySetter (pi);
+ set {
+ block = value;
+ }
+ }
- MethodInfo reference = inherited_get == null ?
- inherited_set : inherited_get;
-
- if (reference != null)
- if (!CheckMethodAgainstBase (parent, flags, reference))
- return false;
-
- } else {
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- Report.Error (115, Location,
- parent.MakeName (Name) +
- " no suitable properties found to override");
- return false;
+ public CallingConventions CallingConventions {
+ get {
+ return CallingConventions.Standard;
+ }
+ }
+
+ public bool IsExcluded (EmitContext ec)
+ {
+ return false;
+ }
+
+ public MemberName MethodName {
+ get {
+ return MemberName;
+ }
+ }
+
+ public abstract ObsoleteAttribute GetObsoleteAttribute ();
+ public abstract Type[] ParameterTypes { get; }
+ public abstract Type ReturnType { get; }
+ public abstract EmitContext CreateEmitContext(TypeContainer tc, ILGenerator ig);
+
+ #endregion
+
+ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type == TypeManager.cls_compliant_attribute_type || a.Type == TypeManager.obsolete_attribute_type ||
+ a.Type == TypeManager.conditional_attribute_type) {
+ Report.Error (1667, a.Location, "'{0}' is not valid on property or event accessors. It is valid on '{1}' declarations only", TypeManager.CSharpName (a.Type), a.GetValidTargets ());
+ return;
+ }
+
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type) && a.CheckSecurityActionValidity (false)) {
+ if (declarative_security == null)
+ declarative_security = new ListDictionary ();
+ a.ExtractSecurityPermissionSet (declarative_security);
+ return;
+ }
+
+ if (a.Target == AttributeTargets.Method) {
+ method_data.MethodBuilder.SetCustomAttribute (cb);
+ return;
+ }
+
+ if (a.Target == AttributeTargets.ReturnValue) {
+ if (return_attributes == null)
+ return_attributes = new ReturnParameter (method_data.MethodBuilder, Location);
+
+ return_attributes.ApplyAttributeBuilder (a, cb);
+ return;
+ }
+
+ ApplyToExtraTarget (a, cb);
+ }
+
+ virtual protected void ApplyToExtraTarget (Attribute a, CustomAttributeBuilder cb)
+ {
+ System.Diagnostics.Debug.Fail ("You forgot to define special attribute target handling");
+ }
+
+ public override bool Define()
+ {
+ return false;
+ }
+
+ public virtual void Emit (TypeContainer container)
+ {
+ method_data.Emit (container, this);
+
+ if (declarative_security != null) {
+ foreach (DictionaryEntry de in declarative_security) {
+ method_data.MethodBuilder.AddDeclarativeSecurity ((SecurityAction)de.Key, (PermissionSet)de.Value);
}
}
+
+ block = null;
+ }
+
+ public override bool IsClsCompliaceRequired(DeclSpace ds)
+ {
+ return false;
+ }
+
+ public bool IsDuplicateImplementation (MethodCore method)
+ {
+ if (Name != method.Name)
+ return false;
+
+ Type[] param_types = method.ParameterTypes;
+
+ if (param_types.Length != ParameterTypes.Length)
+ return false;
+
+ for (int i = 0; i < param_types.Length; i++)
+ if (param_types [i] != ParameterTypes [i])
+ return false;
+
+ Report.SymbolRelatedToPreviousError (method);
+ Report.Error (111, Location, TypeContainer.Error111, method.Parent.GetSignatureForError (), Name);
return true;
}
- bool DefineMethod (TypeContainer parent, string short_name,
- MethodAttributes flags, bool is_get, ref bool is_implementing)
+ public new Location Location {
+ get {
+ return base.Location;
+ }
+ }
+
+ protected override void VerifyObsoleteAttribute()
{
- Type [] parameters = TypeManager.NoTypes;
- MethodInfo implementing = null;
- Type fn_type;
- string name, prefix;
+ }
- if (explicit_impl)
- prefix = explicit_iface_type.FullName + ".";
- else
- prefix = "";
+ }
+
+ //
+ // Properties and Indexers both generate PropertyBuilders, we use this to share
+ // their common bits.
+ //
+ abstract public class PropertyBase : MethodCore {
+
+ public class GetMethod: PropertyMethod
+ {
+ static string[] attribute_targets = new string [] { "method", "return" };
+
+ public GetMethod (MethodCore method):
+ base (method, "get_")
+ {
+ }
+
+ public GetMethod (MethodCore method, Accessor accessor):
+ base (method, accessor, "get_")
+ {
+ }
+
+ public override MethodBuilder Define(TypeContainer container)
+ {
+ base.Define (container);
- if (is_get){
- fn_type = PropertyType;
- name = "get_" + short_name;
- } else {
- name = "set_" + short_name;
- parameters = new Type [1];
- parameters [0] = PropertyType;
- fn_type = TypeManager.void_type;
+ method_data = new MethodData (method, method.ParameterInfo, ModFlags, flags, this);
+
+ if (!method_data.Define (container))
+ return null;
+
+ return method_data.MethodBuilder;
}
- if (parent.Pending != null){
- implementing = parent.Pending.IsInterfaceMethod (
- explicit_iface_type, name, fn_type, parameters);
+ public override string GetSignatureForError (TypeContainer tc)
+ {
+ return String.Concat (base.GetSignatureForError (tc), ".get");
+ }
- if (explicit_iface_type != null && implementing == null){
- TypeContainer.Error_ExplicitInterfaceNotMemberInterface (Location, name);
- return false;
+ public override Type ReturnType {
+ get {
+ return method.MemberType;
}
}
-
- //
- // For implicit implementations, make sure we are public, for
- // explicit implementations, make sure we are private.
- //
- if (implementing != null){
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (explicit_iface_type == null){
- //
- // We already catch different accessibility settings
- // so we just need to check that we are not private
- //
- if ((ModFlags & Modifiers.PRIVATE) != 0)
- implementing = null;
-
- //
- // Static is not allowed
- //
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if ((ModFlags & (Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location, "`public' or `abstract' modifiers "+
- "are not allowed in explicit interface declarations"
- );
- implementing = null;
- }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
}
}
-
- //
- // If implementing is still valid, set flags
- //
- if (implementing != null){
- //
- // When implementing interface methods, set NewSlot.
- //
- if (implementing.DeclaringType.IsInterface)
- flags |= MethodAttributes.NewSlot;
-
- flags |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
+ }
- //
- // clear the pending implemntation flag
- //
- parent.Pending.ImplementMethod (
- explicit_iface_type, name, fn_type, parameters, explicit_impl);
+ public class SetMethod: PropertyMethod {
+
+ static string[] attribute_targets = new string [] { "method", "param", "return" };
+ ImplicitParameter param_attr;
- is_implementing = true;
+ public SetMethod (MethodCore method):
+ base (method, "set_")
+ {
}
- //
- // If this is not an explicit interface implementation,
- // clear implementing, as it is only used for explicit
- // interface implementation
- //
- if (Name.IndexOf (".") == -1)
- implementing = null;
-
- if (is_get){
- GetBuilder = parent.TypeBuilder.DefineMethod (
- prefix + name, flags, PropertyType, null);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- GetBuilder, implementing);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- InternalParameters ip = new InternalParameters (
- parent, Parameters.GetEmptyReadOnlyParameters ());
-
- if (!TypeManager.RegisterMethod (GetBuilder, ip, null)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types as the " +
- "'get' method of property `" + Name + "'");
- return false;
+ public SetMethod (MethodCore method, Accessor accessor):
+ base (method, accessor, "set_")
+ {
+ }
+
+ protected override void ApplyToExtraTarget(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Target == AttributeTargets.Parameter) {
+ if (param_attr == null)
+ param_attr = new ImplicitParameter (method_data.MethodBuilder);
+
+ param_attr.ApplyAttributeBuilder (a, cb);
+ return;
}
- } else {
- SetBuilder = parent.TypeBuilder.DefineMethod (
- prefix + name, flags, null, parameters);
-
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- SetBuilder, implementing);
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+ protected virtual InternalParameters GetParameterInfo (EmitContext ec)
+ {
+ Parameter [] parms = new Parameter [1];
+ parms [0] = new Parameter (method.Type, "value", Parameter.Modifier.NONE, null);
+ Parameters parameters = new Parameters (parms, null, method.Location);
+ Type [] types = parameters.GetParameterInfo (ec);
+ return new InternalParameters (types, parameters);
+ }
+
+ public override MethodBuilder Define(TypeContainer container)
+ {
+ if (container.EmitContext == null)
+ throw new InternalErrorException ("SetMethod.Define called too early");
+
+ base.Define (container);
- SetBuilder.DefineParameter (1, ParameterAttributes.None, "value");
+ method_data = new MethodData (method, GetParameterInfo (container.EmitContext), ModFlags, flags, this);
+
+ if (!method_data.Define (container))
+ return null;
+
+ return method_data.MethodBuilder;
+ }
+
+ public override string GetSignatureForError (TypeContainer tc)
+ {
+ return String.Concat (base.GetSignatureForError (tc), ".set");
+ }
+
+ public override Type[] ParameterTypes {
+ get {
+ return new Type[] { method.MemberType };
+ }
+ }
+
+ public override Type ReturnType {
+ get {
+ return TypeManager.void_type;
+ }
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+ }
+
+ static string[] attribute_targets = new string [] { "property" };
+
+ public abstract class PropertyMethod: AbstractPropertyEventMethod
+ {
+ protected readonly MethodCore method;
+ protected MethodAttributes flags;
+
+ public PropertyMethod (MethodCore method, string prefix)
+ : base (method, prefix)
+ {
+ this.method = method;
+ }
+ public PropertyMethod (MethodCore method, Accessor accessor,
+ string prefix)
+ : base (method, accessor, prefix)
+ {
+ this.method = method;
+ this.ModFlags = accessor.ModFlags;
+
+ if (accessor.ModFlags != 0 && RootContext.Version == LanguageVersion.ISO_1) {
+ Report.FeatureIsNotStandardized (Location, "accessor modifiers");
+ Environment.Exit (1);
+ }
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Method;
+ }
+ }
+
+ public override bool IsClsCompliaceRequired(DeclSpace ds)
+ {
+ return method.IsClsCompliaceRequired (ds);
+ }
+
+ public InternalParameters ParameterInfo
+ {
+ get {
+ return method_data.ParameterInfo;
+ }
+ }
+
+ public virtual MethodBuilder Define (TypeContainer container)
+ {
//
- // HACK because System.Reflection.Emit is lame
+ // Check for custom access modifier
//
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ip = new InternalParameters (
- parent, new Parameters (parms, null, Location));
+ if (ModFlags == 0) {
+ ModFlags = method.ModFlags;
+ flags = method.flags;
+ } else {
+ CheckModifiers (container, ModFlags);
+ ModFlags |= (method.ModFlags & (~Modifiers.Accessibility));
+ flags = Modifiers.MethodAttr (ModFlags);
+ flags |= (method.flags & (~MethodAttributes.MemberAccessMask));
+ }
- if (!TypeManager.RegisterMethod (SetBuilder, ip, parameters)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types as the " +
- "'set' method of property `" + Name + "'");
- return false;
+ return null;
+
+ }
+
+ public override Type[] ParameterTypes {
+ get {
+ return TypeManager.NoTypes;
}
}
- return true;
+ public override EmitContext CreateEmitContext (TypeContainer tc,
+ ILGenerator ig)
+ {
+ return new EmitContext (
+ tc, method.Parent, method.Location, ig, ReturnType,
+ method.ModFlags, false);
+ }
+
+ public override ObsoleteAttribute GetObsoleteAttribute ()
+ {
+ return method.GetObsoleteAttribute (method.Parent);
+ }
+
+ public override string GetSignatureForError (TypeContainer tc)
+ {
+ return String.Concat (tc.Name, '.', method.Name);
+ }
+
+ void CheckModifiers (TypeContainer container, int modflags)
+ {
+ int flags = 0;
+ int mflags = method.ModFlags & Modifiers.Accessibility;
+
+ if ((mflags & Modifiers.PUBLIC) != 0) {
+ flags |= Modifiers.PROTECTED | Modifiers.INTERNAL | Modifiers.PRIVATE;
+ }
+ else if ((mflags & Modifiers.PROTECTED) != 0) {
+ if ((mflags & Modifiers.INTERNAL) != 0)
+ flags |= Modifiers.PROTECTED | Modifiers.INTERNAL;
+
+ flags |= Modifiers.PRIVATE;
+ }
+ else if ((mflags & Modifiers.INTERNAL) != 0)
+ flags |= Modifiers.PRIVATE;
+
+ if ((mflags == modflags) || (modflags & (~flags)) != 0)
+ Report.Error (273, Location, "{0}: accessibility modifier must be more restrictive than the property or indexer",
+ GetSignatureForError (container));
+ }
+
}
- public override bool Define (TypeContainer parent)
+
+ public PropertyMethod Get, Set;
+ public PropertyBuilder PropertyBuilder;
+ public MethodBuilder GetBuilder, SetBuilder;
+
+ protected EmitContext ec;
+
+ public PropertyBase (TypeContainer ds, Expression type, int mod_flags,
+ int allowed_mod, bool is_iface, MemberName name,
+ Parameters parameters, Attributes attrs,
+ Location loc)
+ : base (ds, type, mod_flags, allowed_mod, is_iface, name,
+ attrs, parameters, loc)
{
- string short_name;
-
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
+ }
- MethodAttributes flags = Modifiers.MethodAttr (ModFlags);
-
- flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
+ a.Error_InvalidSecurityParent ();
+ return;
+ }
- // Lookup Type, verify validity
- PropertyType = RootContext.LookupType (parent, Type, false, Location);
- if (PropertyType == null)
- return false;
+ PropertyBuilder.SetCustomAttribute (cb);
+ }
- // verify accessibility
- if (!TypeContainer.AsAccessible (PropertyType, ModFlags))
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Property;
+ }
+ }
+
+ public override bool Define ()
+ {
+ if (!DoDefine ())
return false;
- if (PropertyType.IsPointer && !UnsafeOK (parent))
+ if (!IsTypePermitted ())
return false;
-
- if (!CheckBase (flags, parent))
+
+ return true;
+ }
+
+ protected override bool DoDefine ()
+ {
+ if (!base.DoDefine ())
return false;
//
- // Check for explicit interface implementation
+ // Accessors modifiers check
//
- if (Name.IndexOf (".") != -1){
- int pos = Name.LastIndexOf (".");
- string iface = Name.Substring (0, pos);
-
- explicit_iface_type = RootContext.LookupType (parent, iface, false, Location);
- if (explicit_iface_type == null)
- return false;
+ if (Get.ModFlags != 0 && Set.ModFlags != 0) {
+ Report.Error (274, Location, "'{0}': cannot specify accessibility modifiers for both accessors of the property or indexer.",
+ GetSignatureForError ());
+ return false;
+ }
- short_name = Name.Substring (pos + 1);
+ if ((Get.IsDummy || Set.IsDummy)
+ && (Get.ModFlags != 0 || Set.ModFlags != 0) && (ModFlags & Modifiers.OVERRIDE) == 0) {
+ Report.Error (276, Location,
+ "'{0}': accessibility modifiers on accessors may only be used if the property or indexer has both a get and a set accessor.",
+ GetSignatureForError ());
+ return false;
+ }
- // Compute the full name that we need to export.
- Name = explicit_iface_type.FullName + "." + short_name;
-
- if (!parent.VerifyImplements (explicit_iface_type, short_name, Name, Location))
- return false;
-
- explicit_impl = true;
- } else {
- explicit_impl = false;
- short_name = Name;
+ if (MemberType.IsAbstract && MemberType.IsSealed) {
+ Report.Error (722, Location, Error722, TypeManager.CSharpName (MemberType));
+ return false;
}
- bool is_implementing = false;
- if (Get != null)
- if (!DefineMethod (parent, short_name, flags, true, ref is_implementing))
- return false;
-
- if (Set != null)
- if (!DefineMethod (parent, short_name, flags, false, ref is_implementing))
- return false;
+ ec = new EmitContext (Parent, Location, null, MemberType, ModFlags);
+ return true;
+ }
- // FIXME - PropertyAttributes.HasDefault ?
-
- PropertyAttributes prop_attr =
- PropertyAttributes.RTSpecialName |
- PropertyAttributes.SpecialName;
+ public override string GetSignatureForError()
+ {
+ if (PropertyBuilder == null)
+ return GetSignatureForError (Parent);
- if (!explicit_impl){
- PropertyBuilder = parent.TypeBuilder.DefineProperty (
- Name, prop_attr, PropertyType, null);
-
- if (Get != null)
- PropertyBuilder.SetGetMethod (GetBuilder);
-
- if (Set != null)
- PropertyBuilder.SetSetMethod (SetBuilder);
+ return TypeManager.CSharpSignature (PropertyBuilder, false);
+ }
- //
- // HACK for the reasons exposed above
- //
- if (!TypeManager.RegisterProperty (PropertyBuilder, GetBuilder, SetBuilder)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name +
- "' already contains a definition for the property `" +
- Name + "'");
- return false;
+
+ protected override bool CheckForDuplications ()
+ {
+ ArrayList ar = Parent.Indexers;
+ if (ar != null) {
+ int arLen = ar.Count;
+
+ for (int i = 0; i < arLen; i++) {
+ Indexer m = (Indexer) ar [i];
+ if (IsDuplicateImplementation (m))
+ return false;
+ }
+ }
+
+ ar = Parent.Properties;
+ if (ar != null) {
+ int arLen = ar.Count;
+
+ for (int i = 0; i < arLen; i++) {
+ Property m = (Property) ar [i];
+ if (IsDuplicateImplementation (m))
+ return false;
}
}
+
return true;
}
-
- public void Emit (TypeContainer tc)
- {
- ILGenerator ig;
- EmitContext ec;
- ec = new EmitContext (tc, Location, null, PropertyType, ModFlags);
+ // TODO: rename to Resolve......
+ protected override MethodInfo FindOutParentMethod (TypeContainer container, ref Type parent_ret_type)
+ {
+ PropertyInfo parent_property = container.ParentContainer.MemberCache.FindMemberToOverride (
+ container.TypeBuilder, Name, ParameterTypes, true) as PropertyInfo;
+
+ if (parent_property == null)
+ return null;
+
+ parent_ret_type = parent_property.PropertyType;
+ MethodInfo get_accessor = parent_property.GetGetMethod (true);
+ MethodInfo set_accessor = parent_property.GetSetMethod (true);
+ MethodAttributes get_accessor_access, set_accessor_access;
+
+ if ((ModFlags & Modifiers.OVERRIDE) != 0) {
+ if (Get != null && !Get.IsDummy && get_accessor == null) {
+ Report.SymbolRelatedToPreviousError (parent_property);
+ Report.Error (545, Location, "'{0}': cannot override because '{1}' does not have an overridable get accessor", GetSignatureForError (), TypeManager.GetFullNameSignature (parent_property));
+ }
+
+ if (Set != null && !Set.IsDummy && set_accessor == null) {
+ Report.SymbolRelatedToPreviousError (parent_property);
+ Report.Error (546, Location, "'{0}': cannot override because '{1}' does not have an overridable set accessor", GetSignatureForError (), TypeManager.GetFullNameSignature (parent_property));
+ }
+ }
+
+ //
+ // Check parent accessors access
+ //
+ get_accessor_access = set_accessor_access = 0;
+ if ((ModFlags & Modifiers.NEW) == 0) {
+ if (get_accessor != null) {
+ MethodAttributes get_flags = Modifiers.MethodAttr (Get.ModFlags != 0 ? Get.ModFlags : ModFlags);
+ get_accessor_access = (get_accessor.Attributes & MethodAttributes.MemberAccessMask);
+
+ if (!Get.IsDummy && (get_accessor_access) !=
+ (get_flags & MethodAttributes.MemberAccessMask))
+ Report.Error (507, Location, "'{0}' can't change the access modifiers when overriding inherited member '{1}'",
+ GetSignatureForError (), TypeManager.GetFullNameSignature (parent_property));
+ }
+
+ if (set_accessor != null) {
+ MethodAttributes set_flags = Modifiers.MethodAttr (Set.ModFlags != 0 ? Set.ModFlags : ModFlags);
+ set_accessor_access = (set_accessor.Attributes & MethodAttributes.MemberAccessMask);
+
+ if (!Set.IsDummy & (set_accessor_access) !=
+ (set_flags & MethodAttributes.MemberAccessMask))
+ Report.Error (507, Location, "'{0}' can't change the access modifiers when overriding inherited member '{1}'",
+ GetSignatureForError (container), TypeManager.GetFullNameSignature (parent_property));
+ }
+ }
+
+ //
+ // Get the less restrictive access
+ //
+ return get_accessor_access > set_accessor_access ? get_accessor : set_accessor;
+ }
+ public override void Emit ()
+ {
//
// The PropertyBuilder can be null for explicit implementations, in that
// case, we do not actually emit the ".property", so there is nowhere to
// put the attribute
//
- if (PropertyBuilder != null)
- Attribute.ApplyAttributes (ec, PropertyBuilder, this, OptAttributes, Location);
+ if (PropertyBuilder != null && OptAttributes != null)
+ OptAttributes.Emit (ec, this);
+
+ if (!Get.IsDummy)
+ Get.Emit (Parent);
+
+ if (!Set.IsDummy)
+ Set.Emit (Parent);
+
+ base.Emit ();
+ }
+
+ /// <summary>
+ /// Tests whether accessors are not in collision with some method (CS0111)
+ /// </summary>
+ public bool AreAccessorsDuplicateImplementation (MethodCore mc)
+ {
+ return Get.IsDuplicateImplementation (mc) || Set.IsDuplicateImplementation (mc);
+ }
+
+ protected override void UpdateMemberName ()
+ {
+ base.UpdateMemberName ();
+
+ Get.UpdateName (this);
+ Set.UpdateName (this);
+ }
+
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+ }
+ public class Property : PropertyBase, IIteratorContainer {
+ const int AllowedModifiers =
+ Modifiers.NEW |
+ Modifiers.PUBLIC |
+ Modifiers.PROTECTED |
+ Modifiers.INTERNAL |
+ Modifiers.PRIVATE |
+ Modifiers.STATIC |
+ Modifiers.SEALED |
+ Modifiers.OVERRIDE |
+ Modifiers.ABSTRACT |
+ Modifiers.UNSAFE |
+ Modifiers.EXTERN |
+ Modifiers.METHOD_YIELDS |
+ Modifiers.VIRTUAL;
- //
- // abstract or extern properties have no bodies
- //
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
- return;
+ const int AllowedInterfaceModifiers =
+ Modifiers.NEW;
+
+ public Property (TypeContainer ds, Expression type, int mod, bool is_iface,
+ MemberName name, Attributes attrs, Accessor get_block,
+ Accessor set_block, Location loc)
+ : base (ds, type, mod,
+ is_iface ? AllowedInterfaceModifiers : AllowedModifiers,
+ is_iface, name, Parameters.EmptyReadOnlyParameters, attrs,
+ loc)
+ {
+ if (get_block == null)
+ Get = new GetMethod (this);
+ else
+ Get = new GetMethod (this, get_block);
+
+ if (set_block == null)
+ Set = new SetMethod (this);
+ else
+ Set = new SetMethod (this, set_block);
+ }
+
+ public override bool Define ()
+ {
+ if (!base.Define ())
+ return false;
- if (Get != null){
- ig = GetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, PropertyType, ModFlags);
+ if (!CheckBase ())
+ return false;
- Attribute.ApplyAttributes (ec, GetBuilder, Get, Get.OptAttributes, Location);
- ec.EmitTopBlock (Get.Block, Location);
+ flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;
+
+ if (!Get.IsDummy) {
+
+ GetBuilder = Get.Define (Parent);
+ if (GetBuilder == null)
+ return false;
+
+ //
+ // Setup iterator if we are one
+ //
+ if ((ModFlags & Modifiers.METHOD_YIELDS) != 0){
+ Iterator iterator = new Iterator (
+ Parent, "get", MemberType,
+ TypeManager.NoTypes, Get.ParameterInfo,
+ ModFlags, Get.Block, Location);
+
+ if (!iterator.DefineIterator ())
+ return false;
+ Get.Block = iterator.Block;
+ }
}
- if (Set != null){
- ig = SetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, null, ModFlags);
+ if (!Set.IsDummy) {
+ SetBuilder = Set.Define (Parent);
+ if (SetBuilder == null)
+ return false;
- Attribute.ApplyAttributes (ec, SetBuilder, Set, Set.OptAttributes, Location);
- ec.EmitTopBlock (Set.Block, Location);
+ SetBuilder.DefineParameter (1, ParameterAttributes.None, "value");
}
+
+ // FIXME - PropertyAttributes.HasDefault ?
+
+ PropertyAttributes prop_attr = PropertyAttributes.None;
+ if (!IsInterface)
+ prop_attr |= PropertyAttributes.RTSpecialName |
+ PropertyAttributes.SpecialName;
+
+ PropertyBuilder = Parent.TypeBuilder.DefineProperty (
+ Name, prop_attr, MemberType, null);
+
+ if (!Get.IsDummy)
+ PropertyBuilder.SetGetMethod (GetBuilder);
+
+ if (!Set.IsDummy)
+ PropertyBuilder.SetSetMethod (SetBuilder);
+
+ TypeManager.RegisterProperty (PropertyBuilder, GetBuilder, SetBuilder);
+ return true;
}
- }
+ public void SetYields ()
+ {
+ ModFlags |= Modifiers.METHOD_YIELDS;
+ }
+ }
/// </summary>
/// Gigantic workaround for lameness in SRE follows :
@@ -3009,7 +6121,9 @@ namespace Mono.CSharp {
Type declaring_type, reflected_type, event_type;
string name;
- public MyEventBuilder (TypeBuilder type_builder, string name, EventAttributes event_attr, Type event_type)
+ Event my_event;
+
+ public MyEventBuilder (Event ev, TypeBuilder type_builder, string name, EventAttributes event_attr, Type event_type)
{
MyBuilder = type_builder.DefineEvent (name, event_attr, event_type);
@@ -3021,6 +6135,7 @@ namespace Mono.CSharp {
attributes = event_attr;
this.name = name;
+ my_event = ev;
this.event_type = event_type;
}
@@ -3119,196 +6234,246 @@ namespace Mono.CSharp {
return event_type;
}
}
+
+ public void SetUsed ()
+ {
+ if (my_event != null)
+ my_event.status = (FieldBase.Status.ASSIGNED | FieldBase.Status.USED);
+ }
}
- public class Event : FieldBase {
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.PRIVATE |
- Modifiers.STATIC |
- Modifiers.VIRTUAL |
- Modifiers.SEALED |
- Modifiers.OVERRIDE |
- Modifiers.UNSAFE |
- Modifiers.ABSTRACT;
+ /// <summary>
+ /// For case when event is declared like property (with add and remove accessors).
+ /// </summary>
+ public class EventProperty: Event {
- public readonly Accessor Add;
- public readonly Accessor Remove;
- public MyEventBuilder EventBuilder;
+ static string[] attribute_targets = new string [] { "event", "property" };
- Type EventType;
- MethodBuilder AddBuilder, RemoveBuilder;
-
- public Event (string type, string name, Object init, int mod, Accessor add,
- Accessor remove, Attributes attrs, Location loc)
- : base (type, mod, AllowedModifiers, name, init, attrs, loc)
+ public EventProperty (TypeContainer parent, Expression type, int mod_flags,
+ bool is_iface, MemberName name, Object init,
+ Attributes attrs, Accessor add, Accessor remove,
+ Location loc)
+ : base (parent, type, mod_flags, is_iface, name, init, attrs, loc)
{
- Add = add;
- Remove = remove;
+ Add = new AddDelegateMethod (this, add);
+ Remove = new RemoveDelegateMethod (this, remove);
}
- public override bool Define (TypeContainer parent)
- {
- if (!parent.MethodModifiersValid (ModFlags, Name, Location))
- return false;
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+ }
- MethodAttributes m_attr = Modifiers.MethodAttr (ModFlags);
- EventAttributes e_attr = EventAttributes.RTSpecialName | EventAttributes.SpecialName;
+ /// <summary>
+ /// Event is declared like field.
+ /// </summary>
+ public class EventField: Event {
- EventType = RootContext.LookupType (parent, Type, false, Location);
- if (EventType == null)
- return false;
+ static string[] attribute_targets = new string [] { "event", "field", "method" };
- if (!TypeContainer.AsAccessible (EventType, ModFlags))
- return false;
+ public EventField (TypeContainer parent, Expression type, int mod_flags,
+ bool is_iface, MemberName name, Object init,
+ Attributes attrs, Location loc)
+ : base (parent, type, mod_flags, is_iface, name, init, attrs, loc)
+ {
+ Add = new AddDelegateMethod (this);
+ Remove = new RemoveDelegateMethod (this);
+ }
- if (EventType.IsPointer && !UnsafeOK (parent))
- return false;
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Target == AttributeTargets.Field) {
+ FieldBuilder.SetCustomAttribute (cb);
+ return;
+ }
- if (!EventType.IsSubclassOf (TypeManager.delegate_type)) {
- Report.Error (66, Location, "'" + parent.Name + "." + Name +
- "' : event must be of a delegate type");
- return false;
+ if (a.Target == AttributeTargets.Method) {
+ AddBuilder.SetCustomAttribute (cb);
+ RemoveBuilder.SetCustomAttribute (cb);
+ return;
}
-
- Type [] parameters = new Type [1];
- parameters [0] = EventType;
- EventBuilder = new MyEventBuilder (parent.TypeBuilder, Name, e_attr, EventType);
+ base.ApplyAttributeBuilder (a, cb);
+ }
- if (Add == null && Remove == null){
- FieldBuilder = parent.TypeBuilder.DefineField (
- Name, EventType, FieldAttributes.Private);
- TypeManager.RegisterFieldBase (FieldBuilder, this);
- }
-
- //
- // Now define the accessors
- //
- string add_name = "add_" + Name;
-
- AddBuilder = parent.TypeBuilder.DefineMethod (
- add_name, m_attr, null, parameters);
- AddBuilder.DefineParameter (1, ParameterAttributes.None, "value");
- EventBuilder.SetAddOnMethod (AddBuilder);
- if (parent.Pending != null)
- parent.Pending.ImplementMethod (null, add_name, null, parameters, false);
-
- //
- // HACK because System.Reflection.Emit is lame
- //
- Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (Type, "value", Parameter.Modifier.NONE, null);
- InternalParameters ip = new InternalParameters (
- parent, new Parameters (parms, null, Location));
-
- if (!TypeManager.RegisterMethod (AddBuilder, ip, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name + "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'add' method of event `" + Name + "'");
- return false;
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
}
+ }
+ }
- string remove_name = "remove_" + Name;
- RemoveBuilder = parent.TypeBuilder.DefineMethod (
- remove_name, m_attr, null, parameters);
- RemoveBuilder.DefineParameter (1, ParameterAttributes.None, "value");
- EventBuilder.SetRemoveOnMethod (RemoveBuilder);
+ public abstract class Event : FieldBase {
- //
- // This looks like dead code
- //
- //if (parent.Pending != null)
- // parent.Pending.IsInterfaceMethod (null, remove_name, null, parameters, false);
+ protected sealed class AddDelegateMethod: DelegateMethod
+ {
- //
- // HACK because System.Reflection.Emit is lame
- //
+ public AddDelegateMethod (Event method):
+ base (method, "add_")
+ {
+ }
- if (!TypeManager.RegisterMethod (RemoveBuilder, ip, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name + "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'remove' method of event `" + Name + "'");
- return false;
+ public AddDelegateMethod (Event method, Accessor accessor):
+ base (method, accessor, "add_")
+ {
}
-
- if (!TypeManager.RegisterEvent (EventBuilder, AddBuilder, RemoveBuilder)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition for the event `" +
- Name + "'");
- return false;
+
+ protected override MethodInfo DelegateMethodInfo {
+ get {
+ return TypeManager.delegate_combine_delegate_delegate;
+ }
}
-
- return true;
+
}
- void EmitDefaultMethod (EmitContext ec, bool is_add)
+ protected sealed class RemoveDelegateMethod: DelegateMethod
{
- ILGenerator ig = ec.ig;
- MethodInfo method = null;
-
- if (is_add)
- method = TypeManager.delegate_combine_delegate_delegate;
- else
- method = TypeManager.delegate_remove_delegate_delegate;
-
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldarg_0);
- ig.Emit (OpCodes.Ldfld, (FieldInfo) FieldBuilder);
- ig.Emit (OpCodes.Ldarg_1);
- ig.Emit (OpCodes.Call, method);
- ig.Emit (OpCodes.Castclass, EventType);
- ig.Emit (OpCodes.Stfld, (FieldInfo) FieldBuilder);
- ig.Emit (OpCodes.Ret);
+ public RemoveDelegateMethod (Event method):
+ base (method, "remove_")
+ {
+ }
+
+ public RemoveDelegateMethod (Event method, Accessor accessor):
+ base (method, accessor, "remove_")
+ {
+ }
+
+ protected override MethodInfo DelegateMethodInfo {
+ get {
+ return TypeManager.delegate_remove_delegate_delegate;
+ }
+ }
+
}
- public void Emit (TypeContainer tc)
+ public abstract class DelegateMethod: AbstractPropertyEventMethod
{
- EmitContext ec;
- ILGenerator ig;
+ protected readonly Event method;
+ ImplicitParameter param_attr;
- ig = AddBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, TypeManager.void_type, ModFlags);
+ static string[] attribute_targets = new string [] { "method", "param", "return" };
- if (Add != null) {
- Attribute.ApplyAttributes (ec, AddBuilder, Add, Add.OptAttributes, Location);
- ec.EmitTopBlock (Add.Block, Location);
- } else
- EmitDefaultMethod (ec, true);
+ public DelegateMethod (Event method, string prefix)
+ : base (method, prefix)
+ {
+ this.method = method;
+ }
- ig = RemoveBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, TypeManager.void_type, ModFlags);
-
- if (Remove != null) {
- Attribute.ApplyAttributes (ec, RemoveBuilder, Remove, Remove.OptAttributes, Location);
- ec.EmitTopBlock (Remove.Block, Location);
- } else
- EmitDefaultMethod (ec, false);
+ public DelegateMethod (Event method, Accessor accessor, string prefix)
+ : base (method, accessor, prefix)
+ {
+ this.method = method;
+ }
- ec = new EmitContext (tc, Location, null, EventType, ModFlags);
- Attribute.ApplyAttributes (ec, EventBuilder, this, OptAttributes, Location);
-
+ protected override void ApplyToExtraTarget(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Target == AttributeTargets.Parameter) {
+ if (param_attr == null)
+ param_attr = new ImplicitParameter (method_data.MethodBuilder);
+
+ param_attr.ApplyAttributeBuilder (a, cb);
+ return;
+ }
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Method;
+ }
+ }
+
+ public override bool IsClsCompliaceRequired(DeclSpace ds)
+ {
+ return method.IsClsCompliaceRequired (ds);
+ }
+
+ public MethodBuilder Define (TypeContainer container, InternalParameters ip)
+ {
+ method_data = new MethodData (method, ip, method.ModFlags,
+ method.flags | MethodAttributes.HideBySig | MethodAttributes.SpecialName, this);
+
+ if (!method_data.Define (container))
+ return null;
+
+ MethodBuilder mb = method_data.MethodBuilder;
+ mb.DefineParameter (1, ParameterAttributes.None, "value");
+ return mb;
+ }
+
+
+ public override void Emit (TypeContainer tc)
+ {
+ if (block != null) {
+ base.Emit (tc);
+ return;
+ }
+
+ ILGenerator ig = method_data.MethodBuilder.GetILGenerator ();
+ EmitContext ec = CreateEmitContext (tc, ig);
+ FieldInfo field_info = (FieldInfo)method.FieldBuilder;
+
+ method_data.MethodBuilder.SetImplementationFlags (MethodImplAttributes.Synchronized);
+ if ((method.ModFlags & Modifiers.STATIC) != 0) {
+ ig.Emit (OpCodes.Ldsfld, field_info);
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Call, DelegateMethodInfo);
+ ig.Emit (OpCodes.Castclass, method.MemberType);
+ ig.Emit (OpCodes.Stsfld, field_info);
+ } else {
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Ldfld, field_info);
+ ig.Emit (OpCodes.Ldarg_1);
+ ig.Emit (OpCodes.Call, DelegateMethodInfo);
+ ig.Emit (OpCodes.Castclass, method.MemberType);
+ ig.Emit (OpCodes.Stfld, field_info);
+ }
+ ig.Emit (OpCodes.Ret);
+ }
+
+ protected abstract MethodInfo DelegateMethodInfo { get; }
+
+ public override Type[] ParameterTypes {
+ get {
+ return new Type[] { method.MemberType };
+ }
+ }
+
+ public override Type ReturnType {
+ get {
+ return TypeManager.void_type;
+ }
+ }
+
+ public override EmitContext CreateEmitContext (TypeContainer tc,
+ ILGenerator ig)
+ {
+ return new EmitContext (
+ tc, method.Parent, Location, ig, ReturnType,
+ method.ModFlags, false);
+ }
+
+ public override string GetSignatureForError (TypeContainer tc)
+ {
+ return String.Concat (tc.Name, '.', method.Name);
+ }
+
+ public override ObsoleteAttribute GetObsoleteAttribute ()
+ {
+ return method.GetObsoleteAttribute (method.Parent);
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
}
-
- }
- //
- // FIXME: This does not handle:
- //
- // int INTERFACENAME [ args ]
- // Does not
- //
- // Only:
- //
- // int this [ args ]
-
- public class Indexer : MemberCore {
const int AllowedModifiers =
Modifiers.NEW |
@@ -3316,228 +6481,212 @@ namespace Mono.CSharp {
Modifiers.PROTECTED |
Modifiers.INTERNAL |
Modifiers.PRIVATE |
+ Modifiers.STATIC |
Modifiers.VIRTUAL |
Modifiers.SEALED |
Modifiers.OVERRIDE |
Modifiers.UNSAFE |
- Modifiers.EXTERN |
Modifiers.ABSTRACT;
- public readonly string Type;
- public readonly string InterfaceType;
- public readonly Parameters FormalParameters;
- public readonly Accessor Get, Set;
- public Attributes OptAttributes;
- public MethodBuilder GetBuilder;
- public MethodBuilder SetBuilder;
- public PropertyBuilder PropertyBuilder;
- public Type IndexerType;
- public string IndexerName;
-
- EmitContext ec;
-
- public Indexer (string type, string int_type, int flags, Parameters parms,
- Accessor get_block, Accessor set_block, Attributes attrs, Location loc)
- : base ("", loc)
- {
+ const int AllowedInterfaceModifiers =
+ Modifiers.NEW;
- Type = type;
- InterfaceType = int_type;
- ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PRIVATE, loc);
- FormalParameters = parms;
- Get = get_block;
- Set = set_block;
- OptAttributes = attrs;
+ public DelegateMethod Add, Remove;
+ public MyEventBuilder EventBuilder;
+ public MethodBuilder AddBuilder, RemoveBuilder;
+
+ public Event (TypeContainer parent, Expression type, int mod_flags,
+ bool is_iface, MemberName name, Object init, Attributes attrs,
+ Location loc)
+ : base (parent, type, mod_flags,
+ is_iface ? AllowedInterfaceModifiers : AllowedModifiers,
+ name, init, attrs, loc)
+ {
+ IsInterface = is_iface;
}
- bool DefineMethod (TypeContainer parent, Type explicit_iface_type,
- Type ret_type, string name,
- Type [] parameters, MethodAttributes attr, bool is_get)
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
- MethodInfo implementing = null;
- bool is_implementation;
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
+ a.Error_InvalidSecurityParent ();
+ return;
+ }
+
+ EventBuilder.SetCustomAttribute (cb);
+ }
- if (parent.Pending != null){
- implementing = parent.Pending.IsInterfaceMethod (
- explicit_iface_type, name, ret_type, parameters);
+ public bool AreAccessorsDuplicateImplementation (MethodCore mc)
+ {
+ return Add.IsDuplicateImplementation (mc) || Remove.IsDuplicateImplementation (mc);
+ }
- if (explicit_iface_type != null && implementing == null){
- TypeContainer.Error_ExplicitInterfaceNotMemberInterface (Location, "this");
- return false;
- }
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Event;
}
+ }
+
+ public override bool Define ()
+ {
+ EventAttributes e_attr;
+ e_attr = EventAttributes.None;
- is_implementation = implementing != null;
+ if (!DoDefine ())
+ return false;
+
+ if (init != null && ((ModFlags & Modifiers.ABSTRACT) != 0)){
+ Report.Error (74, Location, "'" + Parent.Name + "." + Name +
+ "': abstract event can not have an initializer");
+ return false;
+ }
- //
- // Setting null inside this block will trigger a more
- // verbose error reporting for missing interface implementations
- //
- // The "candidate" function has been flagged already
- // but it wont get cleared
- //
- if (implementing != null){
- if (explicit_iface_type == null){
- //
- // We already catch different accessibility settings
- // so we just need to check that we are not private
- //
- if ((ModFlags & Modifiers.PRIVATE) != 0)
- implementing = null;
-
- //
- // Static is not allowed
- //
- if ((ModFlags & Modifiers.STATIC) != 0)
- implementing = null;
- } else {
- if((ModFlags&(Modifiers.PUBLIC | Modifiers.ABSTRACT)) != 0){
- Report.Error (
- 106, Location,
- "`public' or `abstract' modifiers are not "+
- "allowed in explicit interface declarations"
- );
- implementing = null;
- }
- }
+ if (!MemberType.IsSubclassOf (TypeManager.delegate_type)) {
+ Report.Error (66, Location, "'" + Parent.Name + "." + Name +
+ "' : event must be of a delegate type");
+ return false;
}
- if (implementing != null){
- //
- // When implementing interface methods, set NewSlot.
- //
- if (implementing.DeclaringType.IsInterface)
- attr |= MethodAttributes.NewSlot;
-
- attr |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
- //
- // clear the pending implementing flag
- //
- parent.Pending.ImplementMethod (
- explicit_iface_type, name, ret_type, parameters, true);
- }
+ EmitContext ec = Parent.EmitContext;
+ if (ec == null)
+ throw new InternalErrorException ("Event.Define called too early?");
+ bool old_unsafe = ec.InUnsafe;
+ ec.InUnsafe = InUnsafe;
+
+ Parameter [] parms = new Parameter [1];
+ parms [0] = new Parameter (Type, "value", Parameter.Modifier.NONE, null);
+ Parameters parameters = new Parameters (parms, null, Location);
+ Type [] types = parameters.GetParameterInfo (ec);
+ InternalParameters ip = new InternalParameters (types, parameters);
+
+ ec.InUnsafe = old_unsafe;
+
+ if (!CheckBase ())
+ return false;
//
- // If this is not an explicit interface implementation,
- // clear implementing, as it is only used for explicit
- // interface implementation
+ // Now define the accessors
//
- if (InterfaceType == null)
- implementing = null;
- string prefix;
- if (explicit_iface_type == null)
- prefix = "";
- else
- prefix = explicit_iface_type.FullName + ".";
-
- if (is_get){
- string meth_name = prefix + "get_" + IndexerName;
-
- GetBuilder = parent.TypeBuilder.DefineMethod (
- meth_name, attr, IndexerType, parameters);
+ AddBuilder = Add.Define (Parent, ip);
+ if (AddBuilder == null)
+ return false;
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- GetBuilder, implementing);
- } else {
- string meth_name = prefix + "set_" + IndexerName;
+ RemoveBuilder = Remove.Define (Parent, ip);
+ if (RemoveBuilder == null)
+ return false;
- SetBuilder = parent.TypeBuilder.DefineMethod (
- meth_name, attr, null, parameters);
- if (implementing != null)
- parent.TypeBuilder.DefineMethodOverride (
- SetBuilder, implementing);
+ EventBuilder = new MyEventBuilder (this, Parent.TypeBuilder, Name, e_attr, MemberType);
+
+ if (Add.Block == null && Remove.Block == null && !IsInterface) {
+ FieldBuilder = Parent.TypeBuilder.DefineField (
+ Name, MemberType,
+ FieldAttributes.Private | ((ModFlags & Modifiers.STATIC) != 0 ? FieldAttributes.Static : 0));
+ TypeManager.RegisterPrivateFieldOfEvent (
+ (EventInfo) EventBuilder, FieldBuilder);
+ TypeManager.RegisterFieldBase (FieldBuilder, this);
}
+
+ EventBuilder.SetAddOnMethod (AddBuilder);
+ EventBuilder.SetRemoveOnMethod (RemoveBuilder);
- return is_implementation;
+ TypeManager.RegisterEvent (EventBuilder, AddBuilder, RemoveBuilder);
+ return true;
}
-
- public override bool Define (TypeContainer parent)
+
+ protected override bool CheckBase ()
+ {
+ if (!base.CheckBase ())
+ return false;
+
+ if (conflict_symbol != null && (ModFlags & Modifiers.NEW) == 0) {
+ if (!(conflict_symbol is EventInfo)) {
+ Report.SymbolRelatedToPreviousError (conflict_symbol);
+ Report.Error (72, Location, "Event '{0}' can override only event", GetSignatureForError (Parent));
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public override void Emit ()
{
- PropertyAttributes prop_attr =
- PropertyAttributes.RTSpecialName |
- PropertyAttributes.SpecialName;
- bool error = false;
-
- IndexerType = RootContext.LookupType (parent, Type, false, Location);
- Type [] parameters = FormalParameters.GetParameterInfo (parent);
+ if (OptAttributes != null) {
+ EmitContext ec = new EmitContext (
+ Parent, Location, null, MemberType, ModFlags);
+ OptAttributes.Emit (ec, this);
+ }
- // Check if the return type and arguments were correct
- if (IndexerType == null || parameters == null)
- return false;
+ if (!IsInterface) {
+ Add.Emit (Parent);
+ Remove.Emit (Parent);
+ }
- if (!parent.MethodModifiersValid (ModFlags, InterfaceType == null ?
- "this" : InterfaceType, Location))
- return false;
+ base.Emit ();
+ }
- //
- // verify accessibility and unsafe pointers
- //
- if (!TypeContainer.AsAccessible (IndexerType, ModFlags))
- return false;
+ public override string GetSignatureForError ()
+ {
+ if (EventBuilder == null)
+ return base.GetSignatureForError (Parent);
- if (IndexerType.IsPointer && !UnsafeOK (parent))
- return false;
+ return TypeManager.GetFullNameSignature (EventBuilder);
+ }
+ }
- foreach (Type partype in parameters){
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- error = true;
- if (partype.IsPointer && !UnsafeOK (parent))
- error = true;
+
+ public class Indexer : PropertyBase {
+
+ class GetIndexerMethod: GetMethod
+ {
+ public GetIndexerMethod (MethodCore method):
+ base (method)
+ {
}
- if (error)
- return false;
-
- Type explicit_iface_type = null;
+ public GetIndexerMethod (MethodCore method, Accessor accessor):
+ base (method, accessor)
+ {
+ }
- if (InterfaceType != null){
- explicit_iface_type = RootContext.LookupType (parent, InterfaceType, false, Location);
- if (explicit_iface_type == null)
- return false;
+ public override Type[] ParameterTypes {
+ get {
+ return method.ParameterTypes;
+ }
+ }
+ }
- if (!parent.VerifyImplements (explicit_iface_type, "this", "this", Location))
- return false;
- }
+ class SetIndexerMethod: SetMethod
+ {
+ readonly Parameters parameters;
- ec = new EmitContext (parent, Location, null, IndexerType, ModFlags);
+ public SetIndexerMethod (MethodCore method):
+ base (method)
+ {
+ }
- IndexerName = Attribute.ScanForIndexerName (ec, OptAttributes);
- if (IndexerName == null)
- IndexerName = "Item";
-
- MethodAttributes attr = Modifiers.MethodAttr (ModFlags);
+ public SetIndexerMethod (MethodCore method, Parameters parameters, Accessor accessor):
+ base (method, accessor)
+ {
+ this.parameters = parameters;
+ }
- bool is_implementing = false;
-
- if (Get != null){
- is_implementing = DefineMethod (
- parent, explicit_iface_type, IndexerType, "get_" + IndexerName,
- parameters, attr, true);
- InternalParameters pi = new InternalParameters (parent, FormalParameters);
- if (!TypeManager.RegisterMethod (GetBuilder, pi, parameters)) {
- Report.Error (111, Location,
- "Class `" + parent.Name +
- "' already contains a definition with the " +
- "same return value and parameter types for the " +
- "'get' indexer");
- return false;
+ public override Type[] ParameterTypes {
+ get {
+ int top = method.ParameterTypes.Length;
+ Type [] set_pars = new Type [top + 1];
+ method.ParameterTypes.CopyTo (set_pars, 0);
+ set_pars [top] = method.MemberType;
+ return set_pars;
}
}
-
- if (Set != null){
- int top = parameters.Length;
- Type [] set_pars = new Type [top + 1];
- parameters.CopyTo (set_pars, 0);
- set_pars [top] = IndexerType;
- Parameter [] fixed_parms = FormalParameters.FixedParameters;
+ protected override InternalParameters GetParameterInfo (EmitContext ec)
+ {
+ Parameter [] fixed_parms = parameters.FixedParameters;
if (fixed_parms == null){
- throw new Exception ("We currently do not support only array arguments in an indexer");
+ throw new Exception ("We currently do not support only array arguments in an indexer at: " + method.Location);
// BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG
// BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG
//
@@ -3554,112 +6703,180 @@ namespace Mono.CSharp {
Parameter [] tmp = new Parameter [fixed_parms.Length + 1];
-
fixed_parms.CopyTo (tmp, 0);
tmp [fixed_parms.Length] = new Parameter (
- Type, "value", Parameter.Modifier.NONE, null);
+ method.Type, "value", Parameter.Modifier.NONE, null);
- Parameters set_formal_params = new Parameters (tmp, null, Location);
+ Parameters set_formal_params = new Parameters (tmp, null, method.Location);
+ Type [] types = set_formal_params.GetParameterInfo (ec);
- is_implementing = DefineMethod (
- parent, explicit_iface_type, TypeManager.void_type,
- "set_" + IndexerName, set_pars, attr, false);
+ return new InternalParameters (types, set_formal_params);
+ }
+ }
- InternalParameters ip = new InternalParameters (parent, set_formal_params);
-
- if (!TypeManager.RegisterMethod (SetBuilder, ip, set_pars)) {
- Report.Error (
- 111, Location,
- "Class `" + parent.Name + "' already contains a " +
- "definition with the " +
- "same return value and parameter types for the " +
- "'set' indexer");
- return false;
+
+ const int AllowedModifiers =
+ Modifiers.NEW |
+ Modifiers.PUBLIC |
+ Modifiers.PROTECTED |
+ Modifiers.INTERNAL |
+ Modifiers.PRIVATE |
+ Modifiers.VIRTUAL |
+ Modifiers.SEALED |
+ Modifiers.OVERRIDE |
+ Modifiers.UNSAFE |
+ Modifiers.EXTERN |
+ Modifiers.ABSTRACT;
+
+ const int AllowedInterfaceModifiers =
+ Modifiers.NEW;
+
+
+ public Indexer (TypeContainer ds, Expression type, MemberName name, int mod,
+ bool is_iface, Parameters parameters, Attributes attrs,
+ Accessor get_block, Accessor set_block, Location loc)
+ : base (ds, type, mod,
+ is_iface ? AllowedInterfaceModifiers : AllowedModifiers,
+ is_iface, name, parameters, attrs, loc)
+ {
+ if (get_block == null)
+ Get = new GetIndexerMethod (this);
+ else
+ Get = new GetIndexerMethod (this, get_block);
+
+ if (set_block == null)
+ Set = new SetIndexerMethod (this);
+ else
+ Set = new SetIndexerMethod (this, parameters, set_block);
+ }
+
+ public override bool Define ()
+ {
+ PropertyAttributes prop_attr =
+ PropertyAttributes.RTSpecialName |
+ PropertyAttributes.SpecialName;
+
+ if (!base.Define ())
+ return false;
+
+ if (OptAttributes != null) {
+ Attribute indexer_attr = OptAttributes.GetIndexerNameAttribute (ec);
+ if (indexer_attr != null) {
+ ShortName = indexer_attr.GetIndexerAttributeValue (ec);
+
+ if (IsExplicitImpl) {
+ Report.Error (415, indexer_attr.Location,
+ "The 'IndexerName' attribute is valid only on an" +
+ "indexer that is not an explicit interface member declaration");
+ return false;
+ }
+
+ if ((ModFlags & Modifiers.OVERRIDE) != 0) {
+ Report.Error (609, indexer_attr.Location,
+ "Cannot set the 'IndexerName' attribute on an indexer marked override");
+ return false;
+ }
+
+ if (!Tokenizer.IsValidIdentifier (ShortName)) {
+ Report.Error (633, indexer_attr.Location,
+ "The argument to the 'IndexerName' attribute must be a valid identifier");
+ return false;
+ }
+
+ UpdateMemberName ();
}
}
+ if (InterfaceType != null) {
+ string parent_IndexerName = TypeManager.IndexerPropertyName (InterfaceType);
+ if (parent_IndexerName != Name)
+ ShortName = parent_IndexerName;
+ UpdateMemberName ();
+ }
+
+ if (!Parent.AddToMemberContainer (this, true) ||
+ !Parent.AddToMemberContainer (Get, true) || !Parent.AddToMemberContainer (Set, true))
+ return false;
+
+ if (!CheckBase ())
+ return false;
+
+ flags |= MethodAttributes.HideBySig | MethodAttributes.SpecialName;
+ if (!Get.IsDummy){
+ GetBuilder = Get.Define (Parent);
+ if (GetBuilder == null)
+ return false;
+ }
+
+ if (!Set.IsDummy){
+ SetBuilder = Set.Define (Parent);
+ if (SetBuilder == null)
+ return false;
+ }
+
//
// Now name the parameters
//
- Parameter [] p = FormalParameters.FixedParameters;
+ Parameter [] p = Parameters.FixedParameters;
if (p != null) {
+ if ((p [0].ModFlags & Parameter.Modifier.ISBYREF) != 0) {
+ Report.Error (631, Location, "ref and out are not valid in this context");
+ return false;
+ }
+
int i;
for (i = 0; i < p.Length; ++i) {
- if (Get != null)
+ if (!Get.IsDummy)
GetBuilder.DefineParameter (
i + 1, p [i].Attributes, p [i].Name);
- if (Set != null)
+ if (!Set.IsDummy)
SetBuilder.DefineParameter (
i + 1, p [i].Attributes, p [i].Name);
}
- if (Set != null)
+ if (!Set.IsDummy)
SetBuilder.DefineParameter (
i + 1, ParameterAttributes.None, "value");
- if (i != parameters.Length) {
- Parameter array_param = FormalParameters.ArrayParameter;
- SetBuilder.DefineParameter (i + 1, array_param.Attributes,
- array_param.Name);
+ if (i != ParameterTypes.Length) {
+ Parameter array_param = Parameters.ArrayParameter;
+
+ SetBuilder.DefineParameter (
+ i + 1, array_param.Attributes, array_param.Name);
}
}
+ PropertyBuilder = Parent.TypeBuilder.DefineProperty (
+ Name, prop_attr, MemberType, ParameterTypes);
+
+ if (!Get.IsDummy)
+ PropertyBuilder.SetGetMethod (GetBuilder);
- //
- // Only define the PropertyBuilder if we are not implementing
- // an interface property.
- //
- if (!is_implementing){
- PropertyBuilder = parent.TypeBuilder.DefineProperty (
- IndexerName, prop_attr, IndexerType, parameters);
-
- if (GetBuilder != null)
- PropertyBuilder.SetGetMethod (GetBuilder);
-
- if (SetBuilder != null)
- PropertyBuilder.SetSetMethod (SetBuilder);
+ if (!Set.IsDummy)
+ PropertyBuilder.SetSetMethod (SetBuilder);
- TypeManager.RegisterProperty (PropertyBuilder, GetBuilder, SetBuilder);
- }
+ TypeManager.RegisterIndexer (PropertyBuilder, GetBuilder, SetBuilder, ParameterTypes);
return true;
}
- public void Emit (TypeContainer tc)
+ public override string GetSignatureForError ()
{
- ILGenerator ig;
-
- //
- // The PropertyBuilder can be null for explicit implementations, in that
- // case, we do not actually emit the ".property", so there is nowhere to
- // put the attribute
- //
- if (PropertyBuilder != null)
- Attribute.ApplyAttributes (
- ec, PropertyBuilder, this, OptAttributes, Location);
+ if (PropertyBuilder == null)
+ return GetSignatureForError (Parent);
- if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
- return;
-
- if (Get != null){
- ig = GetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, IndexerType, ModFlags);
-
- ec.EmitTopBlock (Get.Block, Location);
- }
+ return TypeManager.CSharpSignature (PropertyBuilder, true);
+ }
- if (Set != null){
- ig = SetBuilder.GetILGenerator ();
- ec = new EmitContext (tc, Location, ig, null, ModFlags);
-
- ec.EmitTopBlock (Set.Block, Location);
- }
+ public override string GetSignatureForError(TypeContainer tc)
+ {
+ return String.Concat (tc.Name, ".this[", Parameters.FixedParameters [0].TypeName.ToString (), ']');
}
}
- public class Operator : MemberCore {
+ public class Operator : MethodCore, IIteratorContainer {
const int AllowedModifiers =
Modifiers.PUBLIC |
@@ -3667,10 +6884,6 @@ namespace Mono.CSharp {
Modifiers.EXTERN |
Modifiers.STATIC;
- const int RequiredModifiers =
- Modifiers.PUBLIC |
- Modifiers.STATIC;
-
public enum OpType : byte {
// Unary operators
@@ -3710,79 +6923,93 @@ namespace Mono.CSharp {
};
public readonly OpType OperatorType;
- public readonly string ReturnType;
- public readonly string FirstArgType;
- public readonly string FirstArgName;
- public readonly string SecondArgType;
- public readonly string SecondArgName;
- public readonly Block Block;
- public Attributes OptAttributes;
public MethodBuilder OperatorMethodBuilder;
- public string MethodName;
public Method OperatorMethod;
- public Operator (OpType type, string ret_type, int flags, string arg1type, string arg1name,
- string arg2type, string arg2name, Block block, Attributes attrs, Location loc)
- : base ("", loc)
+ static string[] attribute_targets = new string [] { "method", "return" };
+
+ public Operator (TypeContainer parent, OpType type, Expression ret_type,
+ int mod_flags, Parameters parameters,
+ ToplevelBlock block, Attributes attrs, Location loc)
+ : base (parent, ret_type, mod_flags, AllowedModifiers, false,
+ new MemberName ("op_" + type), attrs, parameters, loc)
{
OperatorType = type;
- ReturnType = ret_type;
- ModFlags = Modifiers.Check (AllowedModifiers, flags, Modifiers.PUBLIC, loc);
- FirstArgType = arg1type;
- FirstArgName = arg1name;
- SecondArgType = arg2type;
- SecondArgName = arg2name;
Block = block;
- OptAttributes = attrs;
}
- string Prototype (TypeContainer parent)
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
- return parent.Name + ".operator " + OperatorType + " (" + FirstArgType + "," +
- SecondArgType + ")";
+ OperatorMethod.ApplyAttributeBuilder (a, cb);
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Method;
+ }
}
- public override bool Define (TypeContainer parent)
+ protected override bool CheckForDuplications()
{
- int length = 1;
- MethodName = "op_" + OperatorType;
-
- if (SecondArgType != null)
- length = 2;
-
- Parameter [] param_list = new Parameter [length];
+ ArrayList ar = Parent.Operators;
+ if (ar != null) {
+ int arLen = ar.Count;
+
+ for (int i = 0; i < arLen; i++) {
+ Operator o = (Operator) ar [i];
+ if (IsDuplicateImplementation (o))
+ return false;
+ }
+ }
+ ar = Parent.Methods;
+ if (ar != null) {
+ int arLen = ar.Count;
+
+ for (int i = 0; i < arLen; i++) {
+ Method m = (Method) ar [i];
+ if (IsDuplicateImplementation (m))
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public override bool Define ()
+ {
+
+ const int RequiredModifiers = Modifiers.PUBLIC | Modifiers.STATIC;
if ((ModFlags & RequiredModifiers) != RequiredModifiers){
- Report.Error (
- 558, Location,
- "User defined operators `" +
- Prototype (parent) +
- "' must be declared static and public");
+ Report.Error (558, Location, "User defined operators '{0}' must be declared static and public", GetSignatureForError (Parent));
return false;
}
- param_list[0] = new Parameter (FirstArgType, FirstArgName,
- Parameter.Modifier.NONE, null);
- if (SecondArgType != null)
- param_list[1] = new Parameter (SecondArgType, SecondArgName,
- Parameter.Modifier.NONE, null);
-
- OperatorMethod = new Method (ReturnType, ModFlags, MethodName,
- new Parameters (param_list, null, Location),
- OptAttributes, Mono.CSharp.Location.Null);
-
- OperatorMethod.Define (parent);
+ if (!DoDefine ())
+ return false;
+
+ OperatorMethod = new Method (
+ Parent, Type, ModFlags, false, MemberName,
+ Parameters, OptAttributes, Location);
+
+ OperatorMethod.Block = Block;
+ OperatorMethod.IsOperator = true;
+ OperatorMethod.flags |= MethodAttributes.SpecialName | MethodAttributes.HideBySig;
+ OperatorMethod.Define ();
if (OperatorMethod.MethodBuilder == null)
return false;
-
+
OperatorMethodBuilder = OperatorMethod.MethodBuilder;
- Type [] param_types = OperatorMethod.ParameterTypes (parent);
+ parameter_types = OperatorMethod.ParameterTypes;
Type declaring_type = OperatorMethodBuilder.DeclaringType;
- Type return_type = OperatorMethod.GetReturnType (parent);
- Type first_arg_type = param_types [0];
+ Type return_type = OperatorMethod.ReturnType;
+ Type first_arg_type = parameter_types [0];
+
+ if (!CheckBase ())
+ return false;
// Rules for conversion operators
@@ -3805,7 +7032,7 @@ namespace Mono.CSharp {
}
if (first_arg_type == TypeManager.object_type ||
- return_type == TypeManager.object_type){
+ return_type == TypeManager.object_type){
Report.Error (
-8, Location,
"User-defined conversion cannot convert to or from " +
@@ -3821,16 +7048,35 @@ namespace Mono.CSharp {
return false;
}
- if (first_arg_type.IsSubclassOf (return_type) ||
- return_type.IsSubclassOf (first_arg_type)){
- Report.Error (
- -10, Location,
- "User-defined conversion cannot convert between types " +
- "that derive from each other");
+ if (first_arg_type.IsSubclassOf (return_type)
+ || return_type.IsSubclassOf (first_arg_type)){
+ if (declaring_type.IsSubclassOf (return_type)) {
+ Report.Error (553, Location, "'{0}' : user defined conversion to/from base class", GetSignatureForError ());
+ return false;
+ }
+ Report.Error (554, Location, "'{0}' : user defined conversion to/from derived class", GetSignatureForError ());
return false;
}
- } else if (SecondArgType == null) {
+ } else if (OperatorType == OpType.LeftShift || OperatorType == OpType.RightShift) {
+ if (first_arg_type != declaring_type || parameter_types [1] != TypeManager.int32_type) {
+ Report.Error (564, Location, "Overloaded shift operator must have the type of the first operand be the containing type, and the type of the second operand must be int");
+ return false;
+ }
+ } else if (Parameters.FixedParameters.Length == 1) {
// Checks for Unary operators
+
+ if (OperatorType == OpType.Increment || OperatorType == OpType.Decrement) {
+ if (return_type != declaring_type && !return_type.IsSubclassOf (declaring_type)) {
+ Report.Error (448, Location,
+ "The return type for ++ or -- operator must be the containing type or derived from the containing type");
+ return false;
+ }
+ if (first_arg_type != declaring_type) {
+ Report.Error (
+ 559, Location, "The parameter type for ++ or -- operator must be the containing type");
+ return false;
+ }
+ }
if (first_arg_type != declaring_type){
Report.Error (
@@ -3840,17 +7086,6 @@ namespace Mono.CSharp {
return false;
}
- if (OperatorType == OpType.Increment || OperatorType == OpType.Decrement) {
- if (return_type != declaring_type){
- Report.Error (
- 559, Location,
- "The parameter and return type for ++ and -- " +
- "must be the containing type");
- return false;
- }
-
- }
-
if (OperatorType == OpType.True || OperatorType == OpType.False) {
if (return_type != TypeManager.bool_type){
Report.Error (
@@ -3865,7 +7100,7 @@ namespace Mono.CSharp {
// Checks for Binary operators
if (first_arg_type != declaring_type &&
- param_types [1] != declaring_type){
+ parameter_types [1] != declaring_type){
Report.Error (
563, Location,
"One of the parameters of a binary operator must " +
@@ -3877,19 +7112,133 @@ namespace Mono.CSharp {
return true;
}
- public void Emit (TypeContainer parent)
+ public override void Emit ()
{
- EmitContext ec = new EmitContext (parent, Location, null, null, ModFlags);
- Attribute.ApplyAttributes (ec, OperatorMethodBuilder, this, OptAttributes, Location);
-
//
// abstract or extern methods have no bodies
//
if ((ModFlags & (Modifiers.ABSTRACT | Modifiers.EXTERN)) != 0)
return;
- OperatorMethod.Block = Block;
- OperatorMethod.Emit (parent);
+ OperatorMethod.Emit ();
+ Block = null;
+ }
+
+ // Operator cannot be override
+ protected override MethodInfo FindOutParentMethod (TypeContainer container, ref Type parent_ret_type)
+ {
+ return null;
+ }
+
+ public static string GetName (OpType ot)
+ {
+ switch (ot){
+ case OpType.LogicalNot:
+ return "!";
+ case OpType.OnesComplement:
+ return "~";
+ case OpType.Increment:
+ return "++";
+ case OpType.Decrement:
+ return "--";
+ case OpType.True:
+ return "true";
+ case OpType.False:
+ return "false";
+ case OpType.Addition:
+ return "+";
+ case OpType.Subtraction:
+ return "-";
+ case OpType.UnaryPlus:
+ return "+";
+ case OpType.UnaryNegation:
+ return "-";
+ case OpType.Multiply:
+ return "*";
+ case OpType.Division:
+ return "/";
+ case OpType.Modulus:
+ return "%";
+ case OpType.BitwiseAnd:
+ return "&";
+ case OpType.BitwiseOr:
+ return "|";
+ case OpType.ExclusiveOr:
+ return "^";
+ case OpType.LeftShift:
+ return "<<";
+ case OpType.RightShift:
+ return ">>";
+ case OpType.Equality:
+ return "==";
+ case OpType.Inequality:
+ return "!=";
+ case OpType.GreaterThan:
+ return ">";
+ case OpType.LessThan:
+ return "<";
+ case OpType.GreaterThanOrEqual:
+ return ">=";
+ case OpType.LessThanOrEqual:
+ return "<=";
+ case OpType.Implicit:
+ return "implicit";
+ case OpType.Explicit:
+ return "explicit";
+ default: return "";
+ }
+ }
+
+ public override string GetSignatureForError (TypeContainer tc)
+ {
+ StringBuilder sb = new StringBuilder ();
+ sb.AppendFormat ("{0}.operator {1} {2}({3}", tc.Name, GetName (OperatorType), Type.Type == null ? Type.ToString () : TypeManager.CSharpName (Type.Type),
+ Parameters.FixedParameters [0].GetSignatureForError ());
+
+ if (Parameters.FixedParameters.Length > 1) {
+ sb.Append (",");
+ sb.Append (Parameters.FixedParameters [1].GetSignatureForError ());
+ }
+ sb.Append (")");
+ return sb.ToString ();
+ }
+
+ public override string GetSignatureForError ()
+ {
+ return ToString ();
+ }
+
+ public override string ToString ()
+ {
+ if (OperatorMethod == null)
+ return Name;
+
+ Type return_type = OperatorMethod.ReturnType;
+ Type [] param_types = OperatorMethod.ParameterTypes;
+
+ if (Parameters.FixedParameters.Length == 1)
+ return String.Format (
+ "{0} operator {1}({2})",
+ TypeManager.CSharpName (return_type),
+ GetName (OperatorType),
+ param_types [0]);
+ else
+ return String.Format (
+ "{0} operator {1}({2}, {3})",
+ TypeManager.CSharpName (return_type),
+ GetName (OperatorType),
+ param_types [0], param_types [1]);
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+
+ public void SetYields ()
+ {
+ ModFlags |= Modifiers.METHOD_YIELDS;
}
}
@@ -3905,22 +7254,7 @@ namespace Mono.CSharp {
/// This delegate is used to extract methods which have the
/// same signature as the argument
/// </summary>
- public static MemberFilter method_signature_filter;
-
- /// <summary>
- /// This delegate is used to extract inheritable methods which
- /// have the same signature as the argument. By inheritable,
- /// this means that we have permissions to override the method
- /// from the current assembly and class
- /// </summary>
- public static MemberFilter inheritable_method_signature_filter;
-
- static MethodSignature ()
- {
- method_signature_filter = new MemberFilter (MemberSignatureCompare);
- inheritable_method_signature_filter = new MemberFilter (
- InheritableMemberSignatureCompare);
- }
+ public static MemberFilter method_signature_filter = new MemberFilter (MemberSignatureCompare);
public MethodSignature (string name, Type ret_type, Type [] parameters)
{
@@ -3932,6 +7266,22 @@ namespace Mono.CSharp {
else
Parameters = parameters;
}
+
+ public override string ToString ()
+ {
+ string pars = "";
+ if (Parameters.Length != 0){
+ System.Text.StringBuilder sb = new System.Text.StringBuilder ();
+ for (int i = 0; i < Parameters.Length; i++){
+ sb.Append (Parameters [i]);
+ if (i+1 < Parameters.Length)
+ sb.Append (", ");
+ }
+ pars = sb.ToString ();
+ }
+
+ return String.Format ("{0} {1} ({2})", RetType, Name, pars);
+ }
public override int GetHashCode ()
{
@@ -3970,27 +7320,35 @@ namespace Mono.CSharp {
static bool MemberSignatureCompare (MemberInfo m, object filter_criteria)
{
- MethodInfo mi;
+ MethodSignature sig = (MethodSignature) filter_criteria;
- if (! (m is MethodInfo))
+ if (m.Name != sig.Name)
return false;
- MethodSignature sig = (MethodSignature) filter_criteria;
+ Type ReturnType;
+ MethodInfo mi = m as MethodInfo;
+ PropertyInfo pi = m as PropertyInfo;
- if (m.Name != sig.Name)
+ if (mi != null)
+ ReturnType = mi.ReturnType;
+ else if (pi != null)
+ ReturnType = pi.PropertyType;
+ else
return false;
- mi = (MethodInfo) m;
-
//
// we use sig.RetType == null to mean `do not check the
// method return value.
//
if (sig.RetType != null)
- if (mi.ReturnType != sig.RetType)
+ if (ReturnType != sig.RetType)
return false;
- Type [] args = TypeManager.GetArgumentTypes (mi);
+ Type [] args;
+ if (mi != null)
+ args = TypeManager.GetArgumentTypes (mi);
+ else
+ args = TypeManager.GetArgumentTypes (pi);
Type [] sigp = sig.Parameters;
if (args.Length != sigp.Length)
@@ -4003,40 +7361,5 @@ namespace Mono.CSharp {
}
return true;
}
-
- //
- // This filter should be used when we are requesting methods that
- // we want to override.
- //
- // This makes a number of assumptions, for example
- // that the methods being extracted are of a parent
- // class (this means we know implicitly that we are
- // being called to find out about members by a derived
- // class).
- //
- static bool InheritableMemberSignatureCompare (MemberInfo m, object filter_criteria)
- {
- if (MemberSignatureCompare (m, filter_criteria)){
- MethodInfo mi = (MethodInfo) m;
- MethodAttributes prot = mi.Attributes & MethodAttributes.MemberAccessMask;
-
- // If only accessible to the current class.
- if (prot == MethodAttributes.Private)
- return false;
-
- // If only accessible to the defining assembly or
- if (prot == MethodAttributes.FamANDAssem ||
- prot == MethodAttributes.Assembly){
- if (m.DeclaringType.Assembly == CodeGen.AssemblyBuilder)
- return true;
- else
- return false;
- }
-
- // Anything else (FamOrAssembly and Public) is fine
- return true;
- }
- return false;
- }
- }
+ }
}
diff --git a/mcs/mcs/codegen.cs b/mcs/mcs/codegen.cs
index 819acf29363..4ccda28f545 100755
--- a/mcs/mcs/codegen.cs
+++ b/mcs/mcs/codegen.cs
@@ -4,14 +4,22 @@
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
-// (C) 2001 Ximian, Inc.
+// (C) 2001, 2002, 2003 Ximian, Inc.
+// (C) 2004 Novell, Inc.
//
-
+//#define PRODUCTION
using System;
+using System.IO;
using System.Collections;
+using System.Collections.Specialized;
using System.Reflection;
using System.Reflection.Emit;
-using System.Diagnostics.SymbolStore;
+using System.Runtime.InteropServices;
+using System.Security;
+using System.Security.Cryptography;
+using System.Security.Permissions;
+
+using Mono.Security.Cryptography;
namespace Mono.CSharp {
@@ -20,19 +28,25 @@ namespace Mono.CSharp {
/// </summary>
public class CodeGen {
static AppDomain current_domain;
- public static AssemblyBuilder AssemblyBuilder;
- public static ModuleBuilder ModuleBuilder;
+ static public SymbolWriter SymbolWriter;
- static public ISymbolWriter SymbolWriter;
+ public static AssemblyClass Assembly;
+ public static ModuleClass Module;
+
+ static CodeGen ()
+ {
+ Assembly = new AssemblyClass ();
+ Module = new ModuleClass (RootContext.Unsafe);
+ }
public static string Basename (string name)
{
- int pos = name.LastIndexOf ("/");
+ int pos = name.LastIndexOf ('/');
if (pos != -1)
return name.Substring (pos + 1);
- pos = name.LastIndexOf ("\\");
+ pos = name.LastIndexOf ('\\');
if (pos != -1)
return name.Substring (pos + 1);
@@ -41,12 +55,12 @@ namespace Mono.CSharp {
public static string Dirname (string name)
{
- int pos = name.LastIndexOf ("/");
+ int pos = name.LastIndexOf ('/');
if (pos != -1)
return name.Substring (0, pos);
- pos = name.LastIndexOf ("\\");
+ pos = name.LastIndexOf ('\\');
if (pos != -1)
return name.Substring (0, pos);
@@ -55,7 +69,7 @@ namespace Mono.CSharp {
static string TrimExt (string name)
{
- int pos = name.LastIndexOf (".");
+ int pos = name.LastIndexOf ('.');
return name.Substring (0, pos);
}
@@ -63,82 +77,68 @@ namespace Mono.CSharp {
static public string FileName;
//
- // This routine initializes the Mono runtime SymbolWriter.
- //
- static void InitMonoSymbolWriter (string basename, string[] debug_args)
- {
- string symbol_output = basename + "-debug.s";
-
- Type itype = SymbolWriter.GetType ();
- if (itype == null)
- return;
-
- Type[] arg_types = new Type [2];
- arg_types [0] = typeof (string);
- arg_types [1] = typeof (string[]);
-
- MethodInfo initialize = itype.GetMethod ("Initialize", arg_types);
- if (initialize == null)
- return;
-
- object[] args = new object [2];
- args [0] = symbol_output;
- args [1] = debug_args;
-
- initialize.Invoke (SymbolWriter, args);
- }
-
- //
// Initializes the symbol writer
//
- static void InitializeSymbolWriter (string basename, string[] args)
+ static void InitializeSymbolWriter (string filename)
{
- SymbolWriter = ModuleBuilder.GetSymWriter ();
+ SymbolWriter = SymbolWriter.GetSymbolWriter (Module.Builder, filename);
//
// If we got an ISymbolWriter instance, initialize it.
//
- if (SymbolWriter == null)
+ if (SymbolWriter == null) {
+ Report.Warning (
+ -18, "Could not find the symbol writer assembly (Mono.CSharp.Debugger.dll). This is normally an installation problem. Please make sure to compile and install the mcs/class/Mono.CSharp.Debugger directory.");
return;
-
- //
- // Due to lacking documentation about the first argument of the
- // Initialize method, we cannot use Microsoft's default symbol
- // writer yet.
- //
- // If we're using the mono symbol writer, the SymbolWriter object
- // is of type MonoSymbolWriter - but that's defined in a dynamically
- // loaded DLL - that's why we're doing a comparision based on the type
- // name here instead of using `SymbolWriter is MonoSymbolWriter'.
- //
- Type sym_type = ((object) SymbolWriter).GetType ();
-
- switch (sym_type.Name){
- case "MonoSymbolWriter":
- InitMonoSymbolWriter (basename, args);
- break;
-
- default:
- Report.Error (
- -18, "Cannot generate debugging information on this platform");
- break;
}
}
//
// Initializes the code generator variables
//
- static public void Init (string name, string output, bool want_debugging_support,
- string[] debug_args)
+ static public void Init (string name, string output, bool want_debugging_support)
{
- AssemblyName an;
-
FileName = output;
- an = new AssemblyName ();
- an.Name = TrimExt (Basename (name));
+ AssemblyName an = Assembly.GetAssemblyName (name, output);
+
+ if (an.KeyPair != null) {
+ // If we are going to strong name our assembly make
+ // sure all its refs are strong named
+ foreach (Assembly a in TypeManager.GetAssemblies ()) {
+ AssemblyName ref_name = a.GetName ();
+ byte [] b = ref_name.GetPublicKeyToken ();
+ if (b == null || b.Length == 0) {
+ Report.Warning (1577, "Assembly generation failed " +
+ "-- Referenced assembly '" +
+ ref_name.Name +
+ "' does not have a strong name.");
+ //Environment.Exit (1);
+ }
+ }
+ }
+
current_domain = AppDomain.CurrentDomain;
- AssemblyBuilder = current_domain.DefineDynamicAssembly (
- an, AssemblyBuilderAccess.RunAndSave, Dirname (name));
+
+ try {
+ Assembly.Builder = current_domain.DefineDynamicAssembly (an,
+ AssemblyBuilderAccess.Save, Dirname (name));
+ }
+ catch (ArgumentException) {
+ // specified key may not be exportable outside it's container
+ if (RootContext.StrongNameKeyContainer != null) {
+ Report.Error (1548, "Could not access the key inside the container `" +
+ RootContext.StrongNameKeyContainer + "'.");
+ Environment.Exit (1);
+ }
+ throw;
+ }
+ catch (CryptographicException) {
+ if ((RootContext.StrongNameKeyContainer != null) || (RootContext.StrongNameKeyFile != null)) {
+ Report.Error (1548, "Could not use the specified key to strongname the assembly.");
+ Environment.Exit (1);
+ }
+ throw;
+ }
//
// Pass a path-less name to DefineDynamicModule. Wonder how
@@ -148,33 +148,112 @@ namespace Mono.CSharp {
// If the third argument is true, the ModuleBuilder will dynamically
// load the default symbol writer.
//
- ModuleBuilder = AssemblyBuilder.DefineDynamicModule (
- Basename (name), Basename (output), want_debugging_support);
+ Module.Builder = Assembly.Builder.DefineDynamicModule (
+ Basename (name), Basename (output), false);
if (want_debugging_support)
- InitializeSymbolWriter (an.Name, debug_args);
+ InitializeSymbolWriter (output);
}
static public void Save (string name)
{
try {
- AssemblyBuilder.Save (Basename (name));
- } catch (System.IO.IOException io){
- Report.Error (16, "Coult not write to file `"+name+"', cause: " + io.Message);
+ Assembly.Builder.Save (Basename (name));
}
+ catch (COMException) {
+ if ((RootContext.StrongNameKeyFile == null) || (!RootContext.StrongNameDelaySign))
+ throw;
+
+ // FIXME: it seems Microsoft AssemblyBuilder doesn't like to delay sign assemblies
+ Report.Error (1548, "Couldn't delay-sign the assembly with the '" +
+ RootContext.StrongNameKeyFile +
+ "', Use MCS with the Mono runtime or CSC to compile this assembly.");
+ }
+ catch (System.IO.IOException io) {
+ Report.Error (16, "Could not write to file `"+name+"', cause: " + io.Message);
+ }
+
+ if (SymbolWriter != null)
+ SymbolWriter.WriteSymbolFile ();
}
+ }
- static public void SaveSymbols ()
+ //
+ // Provides "local" store across code that can yield: locals
+ // or fields, notice that this should not be used by anonymous
+ // methods to create local storage, those only require
+ // variable mapping.
+ //
+ public class VariableStorage {
+ FieldBuilder fb;
+ LocalBuilder local;
+
+ static int count;
+
+ public VariableStorage (EmitContext ec, Type t)
{
- if (SymbolWriter != null) {
- // If we have a symbol writer, call its Close() method to write
- // the symbol file to disk.
- //
- // When using Mono's default symbol writer, the Close() method must
- // be called after the assembly has already been written to disk since
- // it opens the assembly and reads its metadata.
- SymbolWriter.Close ();
+ count++;
+ if (ec.InIterator)
+ fb = ec.CurrentIterator.MapVariable ("s_", count.ToString (), t);
+ else
+ local = ec.ig.DeclareLocal (t);
+ }
+
+ public void EmitThis (ILGenerator ig)
+ {
+ if (fb != null)
+ ig.Emit (OpCodes.Ldarg_0);
+ }
+
+ public void EmitStore (ILGenerator ig)
+ {
+ if (fb == null)
+ ig.Emit (OpCodes.Stloc, local);
+ else
+ ig.Emit (OpCodes.Stfld, fb);
+ }
+
+ public void EmitLoad (ILGenerator ig)
+ {
+ if (fb == null)
+ ig.Emit (OpCodes.Ldloc, local);
+ else
+ ig.Emit (OpCodes.Ldfld, fb);
+ }
+
+ public void EmitLoadAddress (ILGenerator ig)
+ {
+ if (fb == null)
+ ig.Emit (OpCodes.Ldloca, local);
+ else
+ ig.Emit (OpCodes.Ldflda, fb);
+ }
+
+ public void EmitCall (ILGenerator ig, MethodInfo mi)
+ {
+ // FIXME : we should handle a call like tostring
+ // here, where boxing is needed. However, we will
+ // never encounter that with the current usage.
+
+ bool value_type_call;
+ EmitThis (ig);
+ if (fb == null) {
+ value_type_call = local.LocalType.IsValueType;
+
+ if (value_type_call)
+ ig.Emit (OpCodes.Ldloca, local);
+ else
+ ig.Emit (OpCodes.Ldloc, local);
+ } else {
+ value_type_call = fb.FieldType.IsValueType;
+
+ if (value_type_call)
+ ig.Emit (OpCodes.Ldflda, fb);
+ else
+ ig.Emit (OpCodes.Ldfld, fb);
}
+
+ ig.Emit (value_type_call ? OpCodes.Call : OpCodes.Callvirt, mi);
}
}
@@ -184,7 +263,7 @@ namespace Mono.CSharp {
/// </summary>
public class EmitContext {
public DeclSpace DeclSpace;
- public TypeContainer TypeContainer;
+ public DeclSpace TypeContainer;
public ILGenerator ig;
/// <summary>
@@ -213,6 +292,11 @@ namespace Mono.CSharp {
public bool IsStatic;
/// <summary>
+ /// Whether we are emitting a field initializer
+ /// </summary>
+ public bool IsFieldInitializer;
+
+ /// <summary>
/// The value that is allowed to be returned or NULL if there is no
/// return type.
/// </summary>
@@ -228,6 +312,11 @@ namespace Mono.CSharp {
/// Whether this is generating code for a constructor
/// </summary>
public bool IsConstructor;
+
+ /// <summary>
+ /// Whether we're control flow analysis enabled
+ /// </summary>
+ public bool DoFlowAnalysis;
/// <summary>
/// Keeps track of the Type to LocalBuilder temporary storage created
@@ -238,6 +327,8 @@ namespace Mono.CSharp {
public Block CurrentBlock;
+ public int CurrentFile;
+
/// <summary>
/// The location where we store the return value.
/// </summary>
@@ -250,24 +341,37 @@ namespace Mono.CSharp {
public Label ReturnLabel;
/// <summary>
- /// Whether we are in a Finally block
+ /// If we already defined the ReturnLabel
/// </summary>
- public bool InFinally;
+ public bool HasReturnLabel;
/// <summary>
- /// Whether we are in a Try block
+ /// Whether we are inside an iterator block.
/// </summary>
- public bool InTry;
+ public bool InIterator;
+
+ public bool IsLastStatement;
/// <summary>
- /// Whether we are in a Catch block
+ /// Whether remapping of locals, parameters and fields is turned on.
+ /// Used by iterators and anonymous methods.
/// </summary>
- public bool InCatch;
+ public bool RemapToProxy;
/// <summary>
/// Whether we are inside an unsafe block
/// </summary>
public bool InUnsafe;
+
+ /// <summary>
+ /// Whether we are in a `fixed' initialization
+ /// </summary>
+ public bool InFixedInitializer;
+
+ /// <summary>
+ /// Whether we are inside an anonymous method.
+ /// </summary>
+ public AnonymousMethod CurrentAnonymousMethod;
/// <summary>
/// Location for this EmitContext
@@ -275,12 +379,12 @@ namespace Mono.CSharp {
public Location loc;
/// <summary>
- /// Used to "flag" the resolution process to only lookup types,
- /// and nothing else. This is an out-of-band communication
- /// path to SimpleName from the cast operation.
+ /// Used to flag that it is ok to define types recursively, as the
+ /// expressions are being evaluated as part of the type lookup
+ /// during the type resolution process
/// </summary>
- public bool OnlyLookupTypes;
-
+ public bool ResolvingTypeTree;
+
/// <summary>
/// Inside an enum definition, we do not resolve enumeration values
/// to their enumerations, but rather to the underlying type/value
@@ -290,8 +394,39 @@ namespace Mono.CSharp {
/// we relax the rules
/// </summary>
public bool InEnumContext;
+
+ /// <summary>
+ /// Anonymous methods can capture local variables and fields,
+ /// this object tracks it. It is copied from the TopLevelBlock
+ /// field.
+ /// </summary>
+ public CaptureContext capture_context;
+
+ /// <summary>
+ /// Trace when method is called and is obsolete then this member suppress message
+ /// when call is inside next [Obsolete] method or type.
+ /// </summary>
+ public bool TestObsoleteMethodUsage = true;
+
+ /// <summary>
+ /// The current iterator
+ /// </summary>
+ public Iterator CurrentIterator;
+
+ /// <summary>
+ /// Whether we are in the resolving stage or not
+ /// </summary>
+ enum Phase {
+ Created,
+ Resolving,
+ Emitting
+ }
+
+ Phase current_phase;
- public EmitContext (TypeContainer parent, DeclSpace ds, Location l, ILGenerator ig,
+ FlowBranching current_flow_branching;
+
+ public EmitContext (DeclSpace parent, DeclSpace ds, Location l, ILGenerator ig,
Type return_type, int code_flags, bool is_constructor)
{
this.ig = ig;
@@ -300,16 +435,26 @@ namespace Mono.CSharp {
DeclSpace = ds;
CheckState = RootContext.Checked;
ConstantCheckState = true;
-
+
IsStatic = (code_flags & Modifiers.STATIC) != 0;
+ InIterator = (code_flags & Modifiers.METHOD_YIELDS) != 0;
+ RemapToProxy = InIterator;
ReturnType = return_type;
IsConstructor = is_constructor;
CurrentBlock = null;
- ContainerType = parent.TypeBuilder;
- InUnsafe = ((parent.ModFlags | code_flags) & Modifiers.UNSAFE) != 0;
- OnlyLookupTypes = false;
- loc = l;
+ CurrentFile = 0;
+ current_phase = Phase.Created;
+ if (parent != null){
+ // Can only be null for the ResolveType contexts.
+ ContainerType = parent.TypeBuilder;
+ if (parent.UnsafeContext)
+ InUnsafe = true;
+ else
+ InUnsafe = (code_flags & Modifiers.UNSAFE) != 0;
+ }
+ loc = l;
+
if (ReturnType == TypeManager.void_type)
ReturnType = null;
}
@@ -326,91 +471,384 @@ namespace Mono.CSharp {
{
}
- public void EmitTopBlock (Block block, Location loc)
+ public FlowBranching CurrentBranching {
+ get {
+ return current_flow_branching;
+ }
+ }
+
+ public bool HaveCaptureInfo {
+ get {
+ return capture_context != null;
+ }
+ }
+
+ // <summary>
+ // Starts a new code branching. This inherits the state of all local
+ // variables and parameters from the current branching.
+ // </summary>
+ public FlowBranching StartFlowBranching (FlowBranching.BranchingType type, Location loc)
+ {
+ current_flow_branching = FlowBranching.CreateBranching (CurrentBranching, type, null, loc);
+ return current_flow_branching;
+ }
+
+ // <summary>
+ // Starts a new code branching for block `block'.
+ // </summary>
+ public FlowBranching StartFlowBranching (Block block)
+ {
+ FlowBranching.BranchingType type;
+
+ if (CurrentBranching.Type == FlowBranching.BranchingType.Switch)
+ type = FlowBranching.BranchingType.SwitchSection;
+ else
+ type = FlowBranching.BranchingType.Block;
+
+ current_flow_branching = FlowBranching.CreateBranching (CurrentBranching, type, block, block.StartLocation);
+ return current_flow_branching;
+ }
+
+ public FlowBranchingException StartFlowBranching (ExceptionStatement stmt)
+ {
+ FlowBranchingException branching = new FlowBranchingException (
+ CurrentBranching, stmt);
+ current_flow_branching = branching;
+ return branching;
+ }
+
+ // <summary>
+ // Ends a code branching. Merges the state of locals and parameters
+ // from all the children of the ending branching.
+ // </summary>
+ public FlowBranching.UsageVector DoEndFlowBranching ()
+ {
+ FlowBranching old = current_flow_branching;
+ current_flow_branching = current_flow_branching.Parent;
+
+ return current_flow_branching.MergeChild (old);
+ }
+
+ // <summary>
+ // Ends a code branching. Merges the state of locals and parameters
+ // from all the children of the ending branching.
+ // </summary>
+ public FlowBranching.Reachability EndFlowBranching ()
+ {
+ FlowBranching.UsageVector vector = DoEndFlowBranching ();
+
+ return vector.Reachability;
+ }
+
+ // <summary>
+ // Kills the current code branching. This throws away any changed state
+ // information and should only be used in case of an error.
+ // </summary>
+ public void KillFlowBranching ()
+ {
+ current_flow_branching = current_flow_branching.Parent;
+ }
+
+ public void CaptureVariable (LocalInfo li)
{
- bool has_ret = false;
+ capture_context.AddLocal (CurrentAnonymousMethod, li);
+ li.IsCaptured = true;
+ }
-// Console.WriteLine ("Emitting: " + loc);
+ public void CaptureParameter (string name, Type t, int idx)
+ {
+
+ capture_context.AddParameter (this, CurrentAnonymousMethod, name, t, idx);
+ }
+
+ //
+ // Use to register a field as captured
+ //
+ public void CaptureField (FieldExpr fe)
+ {
+ capture_context.AddField (fe);
+ }
- if (CodeGen.SymbolWriter != null)
- Mark (loc);
+ //
+ // Whether anonymous methods have captured variables
+ //
+ public bool HaveCapturedVariables ()
+ {
+ if (capture_context != null)
+ return capture_context.HaveCapturedVariables;
+ return false;
+ }
+
+ //
+ // Whether anonymous methods have captured fields or this.
+ //
+ public bool HaveCapturedFields ()
+ {
+ if (capture_context != null)
+ return capture_context.HaveCapturedFields;
+ return false;
+ }
+
+ //
+ // Emits the instance pointer for the host method
+ //
+ public void EmitMethodHostInstance (EmitContext target, AnonymousMethod am)
+ {
+ if (capture_context != null)
+ capture_context.EmitMethodHostInstance (target, am);
+ else if (IsStatic)
+ target.ig.Emit (OpCodes.Ldnull);
+ else
+ target.ig.Emit (OpCodes.Ldarg_0);
+ }
- if (block != null){
+ //
+ // Returns whether the `local' variable has been captured by an anonymous
+ // method
+ //
+ public bool IsCaptured (LocalInfo local)
+ {
+ return capture_context.IsCaptured (local);
+ }
+
+ public bool IsParameterCaptured (string name)
+ {
+ if (capture_context != null)
+ return capture_context.IsParameterCaptured (name);
+ return false;
+ }
+
+ public void EmitMeta (ToplevelBlock b, InternalParameters ip)
+ {
+ if (capture_context != null)
+ capture_context.EmitHelperClasses (this);
+ b.EmitMeta (this);
+
+ if (HasReturnLabel)
+ ReturnLabel = ig.DefineLabel ();
+ }
+
+ //
+ // Here until we can fix the problem with Mono.CSharp.Switch, which
+ // currently can not cope with ig == null during resolve (which must
+ // be fixed for switch statements to work on anonymous methods).
+ //
+ public void EmitTopBlock (ToplevelBlock block, InternalParameters ip, Location loc)
+ {
+ if (block == null)
+ return;
+
+ bool unreachable;
+
+ if (ResolveTopBlock (null, block, ip, loc, out unreachable)){
+ EmitMeta (block, ip);
+
+ current_phase = Phase.Emitting;
+ EmitResolvedTopBlock (block, unreachable);
+ }
+ }
+
+ public bool ResolveTopBlock (EmitContext anonymous_method_host, ToplevelBlock block,
+ InternalParameters ip, Location loc, out bool unreachable)
+ {
+ current_phase = Phase.Resolving;
+
+ unreachable = false;
+
+ capture_context = block.CaptureContext;
+
+ if (!Location.IsNull (loc))
+ CurrentFile = loc.File;
+
+#if PRODUCTION
+ try {
+#endif
int errors = Report.Errors;
- block.EmitMeta (this, block);
+ block.ResolveMeta (block, this, ip);
+
if (Report.Errors == errors){
- if (!block.Resolve (this))
- return;
+ bool old_do_flow_analysis = DoFlowAnalysis;
+ DoFlowAnalysis = true;
+
+ if (anonymous_method_host != null)
+ current_flow_branching = FlowBranching.CreateBranching (
+ anonymous_method_host.CurrentBranching, FlowBranching.BranchingType.Block,
+ block, loc);
+ else
+ current_flow_branching = FlowBranching.CreateBranching (
+ null, FlowBranching.BranchingType.Block, block, loc);
+
+ if (!block.Resolve (this)) {
+ current_flow_branching = null;
+ DoFlowAnalysis = old_do_flow_analysis;
+ return false;
+ }
+
+ FlowBranching.Reachability reachability = current_flow_branching.MergeTopBlock ();
+ current_flow_branching = null;
- has_ret = block.Emit (this);
+ DoFlowAnalysis = old_do_flow_analysis;
- if (Report.Errors == errors){
- if (RootContext.WarningLevel >= 3)
- block.UsageWarning ();
- }
+ if (reachability.AlwaysReturns ||
+ reachability.AlwaysThrows ||
+ reachability.IsUnreachable)
+ unreachable = true;
}
+#if PRODUCTION
+ } catch (Exception e) {
+ Console.WriteLine ("Exception caught by the compiler while compiling:");
+ Console.WriteLine (" Block that caused the problem begin at: " + loc);
+
+ if (CurrentBlock != null){
+ Console.WriteLine (" Block being compiled: [{0},{1}]",
+ CurrentBlock.StartLocation, CurrentBlock.EndLocation);
+ }
+ Console.WriteLine (e.GetType ().FullName + ": " + e.Message);
+ throw;
}
-
- if (ReturnType != null && !has_ret){
- //
- // FIXME: we need full flow analysis to implement this
- // correctly and emit an error instead of a warning.
- //
- //
- Report.Error (161, loc, "Not all code paths return a value");
- return;
+#endif
+
+ if (ReturnType != null && !unreachable){
+ if (!InIterator){
+ if (CurrentAnonymousMethod != null){
+ Report.Error (1643, loc, "Not all code paths return a value in anonymous method of type `{0}'",
+ CurrentAnonymousMethod.Type);
+ } else {
+ Report.Error (161, loc, "Not all code paths return a value");
+ }
+
+ return false;
+ }
}
+ block.CompleteContexts ();
+
+ return true;
+ }
- if (return_value != null){
+ public void EmitResolvedTopBlock (ToplevelBlock block, bool unreachable)
+ {
+ if (block != null)
+ block.Emit (this);
+
+ if (HasReturnLabel)
ig.MarkLabel (ReturnLabel);
+
+ if (return_value != null){
ig.Emit (OpCodes.Ldloc, return_value);
ig.Emit (OpCodes.Ret);
} else {
- if (!has_ret){
- if (!InTry)
- ig.Emit (OpCodes.Ret);
+ //
+ // If `HasReturnLabel' is set, then we already emitted a
+ // jump to the end of the method, so we must emit a `ret'
+ // there.
+ //
+ // Unfortunately, System.Reflection.Emit automatically emits
+ // a leave to the end of a finally block. This is a problem
+ // if no code is following the try/finally block since we may
+ // jump to a point after the end of the method.
+ // As a workaround, we're always creating a return label in
+ // this case.
+ //
+
+ if ((block != null) && block.IsDestructor) {
+ // Nothing to do; S.R.E automatically emits a leave.
+ } else if (HasReturnLabel || (!unreachable && !InIterator)) {
+ if (ReturnType != null)
+ ig.Emit (OpCodes.Ldloc, TemporaryReturn ());
+ ig.Emit (OpCodes.Ret);
}
}
+
+ //
+ // Close pending helper classes if we are the toplevel
+ //
+ if (capture_context != null && capture_context.ParentToplevel == null)
+ capture_context.CloseHelperClasses ();
}
/// <summary>
/// This is called immediately before emitting an IL opcode to tell the symbol
/// writer to which source line this opcode belongs.
/// </summary>
- public void Mark (Location loc)
+ public void Mark (Location loc, bool check_file)
{
- if (!Location.IsNull (loc)) {
- ISymbolDocumentWriter doc = loc.SymbolDocument;
+ if ((CodeGen.SymbolWriter == null) || Location.IsNull (loc))
+ return;
- if (doc != null)
- ig.MarkSequencePoint (doc, loc.Row, 0, loc.Row, 0);
- } }
+ if (check_file && (CurrentFile != loc.File))
+ return;
+ CodeGen.SymbolWriter.MarkSequencePoint (ig, loc.Row, 0);
+ }
+
+ public void DefineLocalVariable (string name, LocalBuilder builder)
+ {
+ if (CodeGen.SymbolWriter == null)
+ return;
+
+ CodeGen.SymbolWriter.DefineLocalVariable (name, builder);
+ }
/// <summary>
/// Returns a temporary storage for a variable of type t as
/// a local variable in the current body.
/// </summary>
- public LocalBuilder GetTemporaryStorage (Type t)
+ public LocalBuilder GetTemporaryLocal (Type t)
{
- LocalBuilder location;
+ LocalBuilder location = null;
if (temporary_storage != null){
- location = (LocalBuilder) temporary_storage [t];
- if (location != null)
- return location;
+ object o = temporary_storage [t];
+ if (o != null){
+ if (o is ArrayList){
+ ArrayList al = (ArrayList) o;
+
+ for (int i = 0; i < al.Count; i++){
+ if (al [i] != null){
+ location = (LocalBuilder) al [i];
+ al [i] = null;
+ break;
+ }
+ }
+ } else
+ location = (LocalBuilder) o;
+ if (location != null)
+ return location;
+ }
}
- location = ig.DeclareLocal (t);
-
- return location;
+ return ig.DeclareLocal (t);
}
- public void FreeTemporaryStorage (LocalBuilder b)
+ public void FreeTemporaryLocal (LocalBuilder b, Type t)
{
- // Empty for now.
+ if (temporary_storage == null){
+ temporary_storage = new Hashtable ();
+ temporary_storage [t] = b;
+ return;
+ }
+ object o = temporary_storage [t];
+ if (o == null){
+ temporary_storage [t] = b;
+ return;
+ }
+ if (o is ArrayList){
+ ArrayList al = (ArrayList) o;
+ for (int i = 0; i < al.Count; i++){
+ if (al [i] == null){
+ al [i] = b;
+ return;
+ }
+ }
+ al.Add (b);
+ return;
+ }
+ ArrayList replacement = new ArrayList ();
+ replacement.Add (o);
+ temporary_storage.Remove (t);
+ temporary_storage [t] = replacement;
}
/// <summary>
@@ -419,11 +857,6 @@ namespace Mono.CSharp {
public Label LoopBegin, LoopEnd;
/// <summary>
- /// Whether we are inside a loop and break/continue are possible.
- /// </summary>
- public bool InLoop;
-
- /// <summary>
/// Default target in a switch statement. Only valid if
/// InSwitch is true
/// </summary>
@@ -439,28 +872,468 @@ namespace Mono.CSharp {
/// return value from the function. By default this is not
/// used. This is only required when returns are found inside
/// Try or Catch statements.
+ ///
+ /// This method is typically invoked from the Emit phase, so
+ /// we allow the creation of a return label if it was not
+ /// requested during the resolution phase. Could be cleaned
+ /// up, but it would replicate a lot of logic in the Emit phase
+ /// of the code that uses it.
/// </summary>
public LocalBuilder TemporaryReturn ()
{
if (return_value == null){
return_value = ig.DeclareLocal (ReturnType);
- ReturnLabel = ig.DefineLabel ();
+ if (!HasReturnLabel){
+ ReturnLabel = ig.DefineLabel ();
+ HasReturnLabel = true;
+ }
}
return return_value;
}
/// <summary>
- /// A dynamic This that is shared by all variables in a emitcontext.
- /// Created on demand.
+ /// This method is used during the Resolution phase to flag the
+ /// need to define the ReturnLabel
/// </summary>
- public Expression my_this;
- public Expression This {
+ public void NeedReturnLabel ()
+ {
+ if (current_phase != Phase.Resolving){
+ //
+ // The reason is that the `ReturnLabel' is declared between
+ // resolution and emission
+ //
+ throw new Exception ("NeedReturnLabel called from Emit phase, should only be called during Resolve");
+ }
+
+ if (!InIterator && !HasReturnLabel)
+ HasReturnLabel = true;
+ }
+
+ //
+ // Creates a field `name' with the type `t' on the proxy class
+ //
+ public FieldBuilder MapVariable (string name, Type t)
+ {
+ if (InIterator)
+ return CurrentIterator.MapVariable ("v_", name, t);
+
+ throw new Exception ("MapVariable for an unknown state");
+ }
+
+ public Expression RemapParameter (int idx)
+ {
+ FieldExpr fe = new FieldExprNoAddress (CurrentIterator.parameter_fields [idx].FieldBuilder, loc);
+ fe.InstanceExpression = new ProxyInstance ();
+ return fe.DoResolve (this);
+ }
+
+ public Expression RemapParameterLValue (int idx, Expression right_side)
+ {
+ FieldExpr fe = new FieldExprNoAddress (CurrentIterator.parameter_fields [idx].FieldBuilder, loc);
+ fe.InstanceExpression = new ProxyInstance ();
+ return fe.DoResolveLValue (this, right_side);
+ }
+
+ //
+ // Emits the proper object to address fields on a remapped
+ // variable/parameter to field in anonymous-method/iterator proxy classes.
+ //
+ public void EmitThis ()
+ {
+ ig.Emit (OpCodes.Ldarg_0);
+ if (InIterator){
+ if (!IsStatic){
+ FieldBuilder this_field = CurrentIterator.this_field.FieldBuilder;
+ if (TypeManager.IsValueType (this_field.FieldType))
+ ig.Emit (OpCodes.Ldflda, this_field);
+ else
+ ig.Emit (OpCodes.Ldfld, this_field);
+ }
+ } else if (capture_context != null && CurrentAnonymousMethod != null){
+ ScopeInfo si = CurrentAnonymousMethod.Scope;
+ while (si != null){
+ if (si.ParentLink != null)
+ ig.Emit (OpCodes.Ldfld, si.ParentLink);
+ if (si.THIS != null){
+ ig.Emit (OpCodes.Ldfld, si.THIS);
+ break;
+ }
+ si = si.ParentScope;
+ }
+ }
+ }
+
+ //
+ // Emits the code necessary to load the instance required
+ // to access the captured LocalInfo
+ //
+ public void EmitCapturedVariableInstance (LocalInfo li)
+ {
+ if (RemapToProxy){
+ ig.Emit (OpCodes.Ldarg_0);
+ return;
+ }
+
+ if (capture_context == null)
+ throw new Exception ("Calling EmitCapturedContext when there is no capture_context");
+
+ capture_context.EmitCapturedVariableInstance (this, li, CurrentAnonymousMethod);
+ }
+
+ public void EmitParameter (string name)
+ {
+ capture_context.EmitParameter (this, name);
+ }
+
+ public void EmitAssignParameter (string name, Expression source, bool leave_copy, bool prepare_for_load)
+ {
+ capture_context.EmitAssignParameter (this, name, source, leave_copy, prepare_for_load);
+ }
+
+ public void EmitAddressOfParameter (string name)
+ {
+ capture_context.EmitAddressOfParameter (this, name);
+ }
+
+ public Expression GetThis (Location loc)
+ {
+ This my_this;
+ if (CurrentBlock != null)
+ my_this = new This (CurrentBlock, loc);
+ else
+ my_this = new This (loc);
+
+ if (!my_this.ResolveBase (this))
+ my_this = null;
+
+ return my_this;
+ }
+ }
+
+
+ public abstract class CommonAssemblyModulClass: Attributable {
+ protected CommonAssemblyModulClass ():
+ base (null)
+ {
+ }
+
+ public void AddAttributes (ArrayList attrs)
+ {
+ if (OptAttributes == null) {
+ OptAttributes = new Attributes (attrs);
+ return;
+ }
+ OptAttributes.AddAttributes (attrs);
+ OptAttributes.CheckTargets (this);
+ }
+
+ public virtual void Emit (TypeContainer tc)
+ {
+ if (OptAttributes == null)
+ return;
+
+ EmitContext ec = new EmitContext (tc, Mono.CSharp.Location.Null, null, null, 0, false);
+ OptAttributes.Emit (ec, this);
+ }
+
+ protected Attribute GetClsCompliantAttribute ()
+ {
+ if (OptAttributes == null)
+ return null;
+
+ EmitContext temp_ec = new EmitContext (new RootTypes (), Mono.CSharp.Location.Null, null, null, 0, false);
+ Attribute a = OptAttributes.Search (TypeManager.cls_compliant_attribute_type, temp_ec);
+ if (a != null) {
+ a.Resolve (temp_ec);
+ }
+ return a;
+ }
+ }
+
+ public class AssemblyClass: CommonAssemblyModulClass {
+ // TODO: make it private and move all builder based methods here
+ public AssemblyBuilder Builder;
+ bool is_cls_compliant;
+
+ ListDictionary declarative_security;
+
+ static string[] attribute_targets = new string [] { "assembly" };
+
+ public AssemblyClass (): base ()
+ {
+ is_cls_compliant = false;
+ }
+
+ public bool IsClsCompliant {
get {
- if (my_this == null)
- my_this = new This (loc).Resolve (this);
+ return is_cls_compliant;
+ }
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Assembly;
+ }
+ }
+
+ public override bool IsClsCompliaceRequired(DeclSpace ds)
+ {
+ return is_cls_compliant;
+ }
+
+ public void ResolveClsCompliance ()
+ {
+ Attribute a = GetClsCompliantAttribute ();
+ if (a == null)
+ return;
+
+ is_cls_compliant = a.GetClsCompliantAttributeValue (null);
+ }
+
+ // fix bug #56621
+ private void SetPublicKey (AssemblyName an, byte[] strongNameBlob)
+ {
+ try {
+ // check for possible ECMA key
+ if (strongNameBlob.Length == 16) {
+ // will be rejected if not "the" ECMA key
+ an.SetPublicKey (strongNameBlob);
+ }
+ else {
+ // take it, with or without, a private key
+ RSA rsa = CryptoConvert.FromCapiKeyBlob (strongNameBlob);
+ // and make sure we only feed the public part to Sys.Ref
+ byte[] publickey = CryptoConvert.ToCapiPublicKeyBlob (rsa);
+
+ // AssemblyName.SetPublicKey requires an additional header
+ byte[] publicKeyHeader = new byte [12] { 0x00, 0x24, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00 };
- return my_this;
+ byte[] encodedPublicKey = new byte [12 + publickey.Length];
+ Buffer.BlockCopy (publicKeyHeader, 0, encodedPublicKey, 0, 12);
+ Buffer.BlockCopy (publickey, 0, encodedPublicKey, 12, publickey.Length);
+ an.SetPublicKey (encodedPublicKey);
+ }
+ }
+ catch (Exception) {
+ Report.Error (1548, "Could not strongname the assembly. File `" +
+ RootContext.StrongNameKeyFile + "' incorrectly encoded.");
+ Environment.Exit (1);
+ }
+ }
+
+ public AssemblyName GetAssemblyName (string name, string output)
+ {
+ if (OptAttributes != null) {
+ foreach (Attribute a in OptAttributes.Attrs) {
+ if (a.Target != AttributeTargets.Assembly)
+ continue;
+ // TODO: This code is buggy: comparing Attribute name without resolving it is wrong.
+ // However, this is invoked by CodeGen.Init, at which time none of the namespaces
+ // are loaded yet.
+ switch (a.Name) {
+ case "AssemblyKeyFile":
+ case "AssemblyKeyFileAttribute":
+ case "System.Reflection.AssemblyKeyFileAttribute":
+ if (RootContext.StrongNameKeyFile != null) {
+ Report.SymbolRelatedToPreviousError (a.Location, a.Name);
+ Report.Warning (1616, "Compiler option '{0}' overrides '{1}' given in source", "keyfile", "System.Reflection.AssemblyKeyFileAttribute");
+ }
+ else {
+ string value = a.GetString ();
+ if (value != String.Empty)
+ RootContext.StrongNameKeyFile = value;
+ }
+ break;
+ case "AssemblyKeyName":
+ case "AssemblyKeyNameAttribute":
+ case "System.Reflection.AssemblyKeyNameAttribute":
+ if (RootContext.StrongNameKeyContainer != null) {
+ Report.SymbolRelatedToPreviousError (a.Location, a.Name);
+ Report.Warning (1616, "keycontainer", "Compiler option '{0}' overrides '{1}' given in source", "System.Reflection.AssemblyKeyNameAttribute");
+ }
+ else {
+ string value = a.GetString ();
+ if (value != String.Empty)
+ RootContext.StrongNameKeyContainer = value;
+ }
+ break;
+ case "AssemblyDelaySign":
+ case "AssemblyDelaySignAttribute":
+ case "System.Reflection.AssemblyDelaySignAttribute":
+ RootContext.StrongNameDelaySign = a.GetBoolean ();
+ break;
+ }
+ }
+ }
+
+ AssemblyName an = new AssemblyName ();
+ an.Name = Path.GetFileNameWithoutExtension (name);
+
+ // note: delay doesn't apply when using a key container
+ if (RootContext.StrongNameKeyContainer != null) {
+ an.KeyPair = new StrongNameKeyPair (RootContext.StrongNameKeyContainer);
+ return an;
+ }
+
+ // strongname is optional
+ if (RootContext.StrongNameKeyFile == null)
+ return an;
+
+ string AssemblyDir = Path.GetDirectoryName (output);
+
+ // the StrongName key file may be relative to (a) the compiled
+ // file or (b) to the output assembly. See bugzilla #55320
+ // http://bugzilla.ximian.com/show_bug.cgi?id=55320
+
+ // (a) relative to the compiled file
+ string filename = Path.GetFullPath (RootContext.StrongNameKeyFile);
+ bool exist = File.Exists (filename);
+ if ((!exist) && (AssemblyDir != null) && (AssemblyDir != String.Empty)) {
+ // (b) relative to the outputed assembly
+ filename = Path.GetFullPath (Path.Combine (AssemblyDir, RootContext.StrongNameKeyFile));
+ exist = File.Exists (filename);
+ }
+
+ if (exist) {
+ using (FileStream fs = new FileStream (filename, FileMode.Open, FileAccess.Read)) {
+ byte[] snkeypair = new byte [fs.Length];
+ fs.Read (snkeypair, 0, snkeypair.Length);
+
+ if (RootContext.StrongNameDelaySign) {
+ // delayed signing - DO NOT include private key
+ SetPublicKey (an, snkeypair);
+ }
+ else {
+ // no delay so we make sure we have the private key
+ try {
+ CryptoConvert.FromCapiPrivateKeyBlob (snkeypair);
+ an.KeyPair = new StrongNameKeyPair (snkeypair);
+ }
+ catch (CryptographicException) {
+ if (snkeypair.Length == 16) {
+ // error # is different for ECMA key
+ Report.Error (1606, "Could not strongname the assembly. " +
+ "ECMA key can only be used to delay-sign assemblies");
+ }
+ else {
+ Report.Error (1548, "Could not strongname the assembly. File `" +
+ RootContext.StrongNameKeyFile +
+ "' doesn't have a private key.");
+ }
+ Environment.Exit (1);
+ }
+ }
+ }
+ }
+ else {
+ Report.Error (1548, "Could not strongname the assembly. File `" +
+ RootContext.StrongNameKeyFile + "' not found.");
+ Environment.Exit (1);
+ }
+ return an;
+ }
+
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder customBuilder)
+ {
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type) && a.CheckSecurityActionValidity (true)) {
+ if (declarative_security == null)
+ declarative_security = new ListDictionary ();
+
+ a.ExtractSecurityPermissionSet (declarative_security);
+ return;
+ }
+
+ Builder.SetCustomAttribute (customBuilder);
+ }
+
+ public override void Emit (TypeContainer tc)
+ {
+ base.Emit (tc);
+
+ if (declarative_security != null) {
+
+ MethodInfo add_permission = typeof (AssemblyBuilder).GetMethod ("AddPermissionRequests", BindingFlags.Instance | BindingFlags.NonPublic);
+ object builder_instance = Builder;
+
+ try {
+ // Microsoft runtime hacking
+ if (add_permission == null) {
+ Type assembly_builder = typeof (AssemblyBuilder).Assembly.GetType ("System.Reflection.Emit.AssemblyBuilderData");
+ add_permission = assembly_builder.GetMethod ("AddPermissionRequests", BindingFlags.Instance | BindingFlags.NonPublic);
+
+ FieldInfo fi = typeof (AssemblyBuilder).GetField ("m_assemblyData", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField);
+ builder_instance = fi.GetValue (Builder);
+ }
+
+ object[] args = new object [] { declarative_security [SecurityAction.RequestMinimum],
+ declarative_security [SecurityAction.RequestOptional],
+ declarative_security [SecurityAction.RequestRefuse] };
+ add_permission.Invoke (builder_instance, args);
+ }
+ catch {
+ Report.RuntimeMissingSupport (Location.Null, "assembly permission setting");
+ }
+ }
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+ }
+
+ public class ModuleClass: CommonAssemblyModulClass {
+ // TODO: make it private and move all builder based methods here
+ public ModuleBuilder Builder;
+ bool m_module_is_unsafe;
+
+ static string[] attribute_targets = new string [] { "module" };
+
+ public ModuleClass (bool is_unsafe)
+ {
+ m_module_is_unsafe = is_unsafe;
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Module;
+ }
+ }
+
+ public override bool IsClsCompliaceRequired(DeclSpace ds)
+ {
+ return CodeGen.Assembly.IsClsCompliant;
+ }
+
+ public override void Emit (TypeContainer tc)
+ {
+ base.Emit (tc);
+
+ if (!m_module_is_unsafe)
+ return;
+
+ if (TypeManager.unverifiable_code_ctor == null) {
+ Console.WriteLine ("Internal error ! Cannot set unverifiable code attribute.");
+ return;
+ }
+
+ ApplyAttributeBuilder (null, new CustomAttributeBuilder (TypeManager.unverifiable_code_ctor, new object [0]));
+ }
+
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder customBuilder)
+ {
+ if (a != null && a.Type == TypeManager.cls_compliant_attribute_type) {
+ Report.Warning (3012, a.Location, "You must specify the CLSCompliant attribute on the assembly, not the module, to enable CLS compliance checking");
+ }
+
+ Builder.SetCustomAttribute (customBuilder);
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
}
}
}
diff --git a/mcs/mcs/compiler.csproj b/mcs/mcs/compiler.csproj
index 2d7b4b800b1..8ae08f84b13 100755
--- a/mcs/mcs/compiler.csproj
+++ b/mcs/mcs/compiler.csproj
@@ -1,22 +1,25 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
ProjectGuid = "{896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
- AssemblyName = "compiler"
+ AssemblyName = "mcs"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
RootNamespace = "CIR"
+ RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
@@ -29,9 +32,11 @@
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
- IncrementalBuild = "true"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
Optimize = "false"
- OutputPath = "bin\Debug\"
+ OutputPath = ".\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
@@ -48,6 +53,8 @@
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "true"
+ NoStdLib = "false"
+ NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
@@ -61,23 +68,21 @@
Name = "System"
AssemblyName = "System"
/>
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- />
- <Reference
- Name = "System.Web.Services"
- AssemblyName = "System.Web.Services"
- />
</References>
</Build>
<Files>
<Include>
<File
+ RelPath = "anonymous.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "assign.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -113,14 +118,20 @@
BuildAction = "Compile"
/>
<File
- RelPath = "cs-parser.cs"
+ RelPath = "convert.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "CryptoConvert.cs"
+ Link = "..\class\corlib\Mono.Security.Cryptography\CryptoConvert.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
- RelPath = "cs-parser.jay"
+ RelPath = "cs-parser.cs"
SubType = "Code"
- BuildAction = "None"
+ BuildAction = "Compile"
/>
<File
RelPath = "cs-tokenizer.cs"
@@ -158,12 +169,12 @@
BuildAction = "Compile"
/>
<File
- RelPath = "genericparser.cs"
+ RelPath = "flowanalysis.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
- RelPath = "interface.cs"
+ RelPath = "iterators.cs"
SubType = "Code"
BuildAction = "Compile"
/>
@@ -183,6 +194,24 @@
BuildAction = "Compile"
/>
<File
+ RelPath = "MonoSymbolFile.cs"
+ Link = "..\class\Mono.CSharp.Debugger\MonoSymbolFile.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "MonoSymbolTable.cs"
+ Link = "..\class\Mono.CSharp.Debugger\MonoSymbolTable.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "MonoSymbolWriter.cs"
+ Link = "..\class\Mono.CSharp.Debugger\MonoSymbolWriter.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "namespace.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -193,7 +222,7 @@
BuildAction = "Compile"
/>
<File
- RelPath = "parameterCollection.cs"
+ RelPath = "pending.cs"
SubType = "Code"
BuildAction = "Compile"
/>
@@ -213,12 +242,12 @@
BuildAction = "Compile"
/>
<File
- RelPath = "statementCollection.cs"
+ RelPath = "support.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
- RelPath = "support.cs"
+ RelPath = "symbolwriter.cs"
SubType = "Code"
BuildAction = "Compile"
/>
diff --git a/mcs/mcs/compiler.csproj.user b/mcs/mcs/compiler.csproj.user
index 5e4ef0f27d8..493a81b9d19 100755
--- a/mcs/mcs/compiler.csproj.user
+++ b/mcs/mcs/compiler.csproj.user
@@ -40,7 +40,7 @@
CopyProjectDestinationFolder = ""
CopyProjectUncPath = ""
CopyProjectOption = "0"
- ProjectView = "ProjectFiles"
+ ProjectView = "ShowAllFiles"
ProjectTrust = "0"
/>
</CSHARP>
diff --git a/mcs/mcs/compiler.sln b/mcs/mcs/compiler.sln
index 3b94d64a492..31b62e14bf5 100755
--- a/mcs/mcs/compiler.sln
+++ b/mcs/mcs/compiler.sln
@@ -1,21 +1,21 @@
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "compiler", "compiler.csproj", "{896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Debug.ActiveCfg = Debug|.NET
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Debug.Build.0 = Debug|.NET
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Release.ActiveCfg = Release|.NET
- {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "compiler", "compiler.csproj", "{896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Debug.ActiveCfg = Debug|.NET
+ {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Debug.Build.0 = Debug|.NET
+ {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Release.ActiveCfg = Release|.NET
+ {896D1461-B76B-41C0-ABE6-ACA2BB4F7B5A}.Release.Build.0 = Release|.NET
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/mcs/mcs/const.cs b/mcs/mcs/const.cs
index aba1d6b531b..fbab41568ec 100755
--- a/mcs/mcs/const.cs
+++ b/mcs/mcs/const.cs
@@ -24,14 +24,14 @@ namespace Mono.CSharp {
using System.Reflection.Emit;
using System.Collections;
- public class Const : MemberCore {
- public readonly string ConstantType;
+ public class Const : FieldMember {
public Expression Expr;
- public Attributes OptAttributes;
- public FieldBuilder FieldBuilder;
+ EmitContext const_ec;
+ bool resolved = false;
object ConstantValue = null;
- Type type;
+
+ bool in_transit = false;
public const int AllowedModifiers =
Modifiers.NEW |
@@ -40,15 +40,13 @@ namespace Mono.CSharp {
Modifiers.INTERNAL |
Modifiers.PRIVATE;
- public Const (string constant_type, string name, Expression expr, int mod_flags,
- Attributes attrs, Location loc)
- : base (name, loc)
+ public Const (TypeContainer parent, Expression constant_type, string name,
+ Expression expr, int mod_flags, Attributes attrs, Location loc)
+ : base (parent, constant_type, mod_flags, AllowedModifiers,
+ new MemberName (name), null, attrs, loc)
{
- ConstantType = constant_type;
- Name = name;
Expr = expr;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PRIVATE, loc);
- OptAttributes = attrs;
+ ModFlags |= Modifiers.STATIC;
}
public FieldAttributes FieldAttr {
@@ -73,108 +71,180 @@ namespace Mono.CSharp {
/// <summary>
/// Defines the constant in the @parent
/// </summary>
- public override bool Define (TypeContainer parent)
+ public override bool Define ()
{
- type = RootContext.LookupType (parent, ConstantType, true, Location);
-
- if (type == null)
+ if (!base.Define ())
return false;
- if (!TypeManager.IsBuiltinType (type) &&
- (!type.IsSubclassOf (TypeManager.enum_type))) {
+ const_ec = new EmitContext (Parent, Location, null, MemberType, ModFlags);
+
+ Type ttype = MemberType;
+ while (ttype.IsArray)
+ ttype = TypeManager.GetElementType (ttype);
+
+ if (!TypeManager.IsBuiltinType (ttype) && (!ttype.IsSubclassOf (TypeManager.enum_type)) && !(Expr is NullLiteral)) {
Report.Error (
-3, Location,
"Constant type is not valid (only system types are allowed)");
return false;
}
- Type ptype = parent.TypeBuilder.BaseType;
-
- if (ptype != null) {
- MemberInfo [] mi = TypeContainer.FindMembers (
- ptype, MemberTypes.Field, BindingFlags.Public,
- Type.FilterName, Name);
-
- if (mi == null || mi.Length == 0)
- if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- } else if ((ModFlags & Modifiers.NEW) != 0)
- WarningNotHiding (parent);
-
- FieldBuilder = parent.TypeBuilder.DefineField (Name, type, FieldAttr);
+ FieldBuilder = Parent.TypeBuilder.DefineField (Name, MemberType, FieldAttr);
TypeManager.RegisterConstant (FieldBuilder, this);
return true;
}
+ //
+ // Changes the type of the constant expression `expr' to the Type `type'
+ // Returns null on failure.
+ //
+ public static Constant ChangeType (Location loc, Constant expr, Type type)
+ {
+ if (type == TypeManager.object_type)
+ return expr;
+
+ bool fail;
+
+ // from the null type to any reference-type.
+ if (expr is NullLiteral && !type.IsValueType && !TypeManager.IsEnumType (type))
+ return NullLiteral.Null;
+
+ if (!Convert.ImplicitStandardConversionExists (Convert.ConstantEC, expr, type)){
+ Convert.Error_CannotImplicitConversion (loc, expr.Type, type);
+ return null;
+ }
+
+ object constant_value = TypeManager.ChangeType (expr.GetValue (), type, out fail);
+ if (fail){
+ Convert.Error_CannotImplicitConversion (loc, expr.Type, type);
+
+ //
+ // We should always catch the error before this is ever
+ // reached, by calling Convert.ImplicitStandardConversionExists
+ //
+ throw new Exception (
+ String.Format ("LookupConstantValue: This should never be reached {0} {1}", expr.Type, type));
+ }
+
+ Constant retval;
+ if (type == TypeManager.int32_type)
+ retval = new IntConstant ((int) constant_value);
+ else if (type == TypeManager.uint32_type)
+ retval = new UIntConstant ((uint) constant_value);
+ else if (type == TypeManager.int64_type)
+ retval = new LongConstant ((long) constant_value);
+ else if (type == TypeManager.uint64_type)
+ retval = new ULongConstant ((ulong) constant_value);
+ else if (type == TypeManager.float_type)
+ retval = new FloatConstant ((float) constant_value);
+ else if (type == TypeManager.double_type)
+ retval = new DoubleConstant ((double) constant_value);
+ else if (type == TypeManager.string_type)
+ retval = new StringConstant ((string) constant_value);
+ else if (type == TypeManager.short_type)
+ retval = new ShortConstant ((short) constant_value);
+ else if (type == TypeManager.ushort_type)
+ retval = new UShortConstant ((ushort) constant_value);
+ else if (type == TypeManager.sbyte_type)
+ retval = new SByteConstant ((sbyte) constant_value);
+ else if (type == TypeManager.byte_type)
+ retval = new ByteConstant ((byte) constant_value);
+ else if (type == TypeManager.char_type)
+ retval = new CharConstant ((char) constant_value);
+ else if (type == TypeManager.bool_type)
+ retval = new BoolConstant ((bool) constant_value);
+ else
+ throw new Exception ("LookupConstantValue: Unhandled constant type: " + type);
+
+ return retval;
+ }
+
/// <summary>
/// Looks up the value of a constant field. Defines it if it hasn't
/// already been. Similar to LookupEnumValue in spirit.
/// </summary>
- public object LookupConstantValue (EmitContext ec)
+ public bool LookupConstantValue (out object value)
{
- if (ConstantValue != null)
- return ConstantValue;
+ if (resolved) {
+ value = ConstantValue;
+ return true;
+ }
+
+ if (in_transit) {
+ Report.Error (110, Location,
+ "The evaluation of the constant value for `" +
+ Name + "' involves a circular definition.");
+ value = null;
+ return false;
+ }
- Expr = Expr.Resolve (ec);
+ in_transit = true;
+ int errors = Report.Errors;
- if (Expr == null) {
- Report.Error (150, Location, "A constant value is expected");
- return null;
+ //
+ // We might have cleared Expr ourselves in a recursive definition
+ //
+ if (Expr == null){
+ value = null;
+ return false;
}
- if (!(Expr is Constant)) {
- Report.Error (150, Location, "A constant value is expected");
- return null;
+ Expr = Expr.Resolve (const_ec);
+
+ in_transit = false;
+
+ if (Expr == null) {
+ if (errors == Report.Errors)
+ Report.Error (150, Location, "A constant value is expected");
+ value = null;
+ return false;
}
- ConstantValue = ((Constant) Expr).GetValue ();
+ Expression real_expr = Expr;
- if (type != Expr.Type) {
- try {
- ConstantValue = TypeManager.ChangeType (ConstantValue, type);
- } catch {
- Expression.Error_CannotConvertImplicit (Location, Expr.Type, type);
- return null;
+ Constant ce = Expr as Constant;
+ if (ce == null){
+ UnCheckedExpr un_expr = Expr as UnCheckedExpr;
+ CheckedExpr ch_expr = Expr as CheckedExpr;
+ EmptyCast ec_expr = Expr as EmptyCast;
+
+ if ((un_expr != null) && (un_expr.Expr is Constant))
+ Expr = un_expr.Expr;
+ else if ((ch_expr != null) && (ch_expr.Expr is Constant))
+ Expr = ch_expr.Expr;
+ else if ((ec_expr != null) && (ec_expr.Child is Constant))
+ Expr = ec_expr.Child;
+ else if (Expr is ArrayCreation){
+ Report.Error (133, Location, "Arrays can not be constant");
+ } else {
+ if (errors == Report.Errors)
+ Report.Error (150, Location, "A constant value is expected");
+ value = null;
+ return false;
}
- if (type == TypeManager.int32_type)
- Expr = new IntConstant ((int) ConstantValue);
- else if (type == TypeManager.uint32_type)
- Expr = new UIntConstant ((uint) ConstantValue);
- else if (type == TypeManager.int64_type)
- Expr = new LongConstant ((long) ConstantValue);
- else if (type == TypeManager.uint64_type)
- Expr = new ULongConstant ((ulong) ConstantValue);
- else if (type == TypeManager.float_type)
- Expr = new FloatConstant ((float) ConstantValue);
- else if (type == TypeManager.double_type)
- Expr = new DoubleConstant ((double) ConstantValue);
- else if (type == TypeManager.string_type)
- Expr = new StringConstant ((string) ConstantValue);
- else if (type == TypeManager.short_type)
- Expr = new ShortConstant ((short) ConstantValue);
- else if (type == TypeManager.ushort_type)
- Expr = new UShortConstant ((ushort) ConstantValue);
- else if (type == TypeManager.sbyte_type)
- Expr = new SByteConstant ((sbyte) ConstantValue);
- else if (type == TypeManager.byte_type)
- Expr = new ByteConstant ((byte) ConstantValue);
- else if (type == TypeManager.char_type)
- Expr = new CharConstant ((char) ConstantValue);
- else if (type == TypeManager.bool_type)
- Expr = new BoolConstant ((bool) ConstantValue);
+ ce = Expr as Constant;
+ }
+
+ if (MemberType != real_expr.Type) {
+ ce = ChangeType (Location, ce, MemberType);
+ if (ce == null){
+ value = null;
+ return false;
+ }
+ Expr = ce;
}
+ ConstantValue = ce.GetValue ();
- if (type.IsEnum){
+ if (MemberType.IsEnum){
//
// This sadly does not work for our user-defined enumerations types ;-(
//
try {
ConstantValue = System.Enum.ToObject (
- type, ConstantValue);
+ MemberType, ConstantValue);
} catch (ArgumentException){
Report.Error (
-16, Location,
@@ -186,21 +256,27 @@ namespace Mono.CSharp {
FieldBuilder.SetConstant (ConstantValue);
if (!TypeManager.RegisterFieldValue (FieldBuilder, ConstantValue))
- return null;
+ throw new Exception ("Cannot register const value");
- return ConstantValue;
+ value = ConstantValue;
+ resolved = true;
+ return true;
}
/// <summary>
/// Emits the field value by evaluating the expression
/// </summary>
- public void EmitConstant (TypeContainer parent)
+ public override void Emit ()
{
- EmitContext ec = new EmitContext (parent, Location, null, type, ModFlags);
- LookupConstantValue (ec);
-
- return;
+ object value;
+ LookupConstantValue (out value);
+
+ if (OptAttributes != null) {
+ OptAttributes.Emit (const_ec, this);
+ }
+
+ base.Emit ();
}
}
}
diff --git a/mcs/mcs/constant.cs b/mcs/mcs/constant.cs
index 2bfdfc031f5..103572b1d54 100755
--- a/mcs/mcs/constant.cs
+++ b/mcs/mcs/constant.cs
@@ -62,7 +62,7 @@ namespace Mono.CSharp {
DoubleConstant c = ConvertToDouble ();
if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.double_type);
+ Convert.Error_CannotImplicitConversion (loc, Type, TypeManager.double_type);
return c;
}
@@ -72,7 +72,7 @@ namespace Mono.CSharp {
FloatConstant c = ConvertToFloat ();
if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.float_type);
+ Convert.Error_CannotImplicitConversion (loc, Type, TypeManager.float_type);
return c;
}
@@ -82,7 +82,7 @@ namespace Mono.CSharp {
ULongConstant c = ConvertToULong ();
if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.uint64_type);
+ Convert.Error_CannotImplicitConversion (loc, Type, TypeManager.uint64_type);
return c;
}
@@ -92,7 +92,7 @@ namespace Mono.CSharp {
LongConstant c = ConvertToLong ();
if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.int64_type);
+ Convert.Error_CannotImplicitConversion (loc, Type, TypeManager.int64_type);
return c;
}
@@ -102,7 +102,7 @@ namespace Mono.CSharp {
UIntConstant c = ConvertToUInt ();
if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.uint32_type);
+ Convert.Error_CannotImplicitConversion (loc, Type, TypeManager.uint32_type);
return c;
}
@@ -112,7 +112,7 @@ namespace Mono.CSharp {
IntConstant c = ConvertToInt ();
if (c == null)
- Error_CannotConvertImplicit (loc, Type, TypeManager.int32_type);
+ Convert.Error_CannotImplicitConversion (loc, Type, TypeManager.int32_type);
return c;
}
@@ -146,6 +146,18 @@ namespace Mono.CSharp {
{
return null;
}
+
+ public abstract bool IsNegative {
+ get;
+ }
+
+ //
+ // Returns true iff 1) the stack type of this is one of Object,
+ // int32, int64 and 2) this == 0 or this == null.
+ //
+ public virtual bool IsZeroInteger {
+ get { return false; }
+ }
}
public class BoolConstant : Constant {
@@ -177,6 +189,16 @@ namespace Mono.CSharp {
else
ec.ig.Emit (OpCodes.Ldc_I4_0);
}
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == false; }
+ }
}
public class ByteConstant : Constant {
@@ -233,6 +255,16 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
}
public class CharConstant : Constant {
@@ -318,6 +350,16 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == '\0'; }
+ }
}
public class SByteConstant : Constant {
@@ -377,6 +419,16 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
+
+ public override bool IsNegative {
+ get {
+ return Value < 0;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
}
public class ShortConstant : Constant {
@@ -433,6 +485,16 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
+
+ public override bool IsNegative {
+ get {
+ return Value < 0;
+ }
+ }
}
public class UShortConstant : Constant {
@@ -489,6 +551,16 @@ namespace Mono.CSharp {
{
return new IntConstant (Value);
}
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
}
public class IntConstant : Constant {
@@ -603,6 +675,16 @@ namespace Mono.CSharp {
{
return this;
}
+
+ public override bool IsNegative {
+ get {
+ return Value < 0;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
}
public class UIntConstant : Constant {
@@ -659,6 +741,16 @@ namespace Mono.CSharp {
{
return null;
}
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
}
public class LongConstant : Constant {
@@ -680,7 +772,12 @@ namespace Mono.CSharp {
static public void EmitLong (ILGenerator ig, long l)
{
- ig.Emit (OpCodes.Ldc_I8, l);
+ if ((l >> 32) == 0){
+ IntLiteral.EmitInt (ig, unchecked ((int) l));
+ ig.Emit (OpCodes.Conv_U8);
+ } else {
+ ig.Emit (OpCodes.Ldc_I8, l);
+ }
}
public override string AsString ()
@@ -725,6 +822,16 @@ namespace Mono.CSharp {
{
return null;
}
+
+ public override bool IsNegative {
+ get {
+ return Value < 0;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
}
public class ULongConstant : Constant {
@@ -783,6 +890,16 @@ namespace Mono.CSharp {
{
return null;
}
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return Value == 0; }
+ }
}
public class FloatConstant : Constant {
@@ -834,6 +951,12 @@ namespace Mono.CSharp {
{
return null;
}
+
+ public override bool IsNegative {
+ get {
+ return Value < 0;
+ }
+ }
}
public class DoubleConstant : Constant {
@@ -890,6 +1013,12 @@ namespace Mono.CSharp {
{
return null;
}
+
+ public override bool IsNegative {
+ get {
+ return Value < 0;
+ }
+ }
}
public class DecimalConstant : Constant {
@@ -935,6 +1064,12 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Newobj, TypeManager.void_decimal_ctor_five_args);
}
+
+ public override bool IsNegative {
+ get {
+ return Value < 0;
+ }
+ }
}
public class StringConstant : Constant {
@@ -960,7 +1095,16 @@ namespace Mono.CSharp {
public override void Emit (EmitContext ec)
{
- ec.ig.Emit (OpCodes.Ldstr, Value);
+ if (Value == null)
+ ec.ig.Emit (OpCodes.Ldnull);
+ else
+ ec.ig.Emit (OpCodes.Ldstr, Value);
+ }
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
}
}
diff --git a/mcs/mcs/convert.cs b/mcs/mcs/convert.cs
new file mode 100644
index 00000000000..6630affc432
--- /dev/null
+++ b/mcs/mcs/convert.cs
@@ -0,0 +1,1828 @@
+//
+// conversion.cs: various routines for implementing conversions.
+//
+// Authors:
+// Miguel de Icaza (miguel@ximian.com)
+// Ravi Pratap (ravi@ximian.com)
+//
+// (C) 2001, 2002, 2003 Ximian, Inc.
+//
+
+namespace Mono.CSharp {
+ using System;
+ using System.Collections;
+ using System.Diagnostics;
+ using System.Reflection;
+ using System.Reflection.Emit;
+
+ //
+ // A container class for all the conversion operations
+ //
+ public class Convert {
+ //
+ // This is used to prettify the code: a null argument is allowed
+ // for ImplicitStandardConversion as long as it is known that
+ // no anonymous method will play a role.
+ //
+ // FIXME: renamed from `const' to `static' to allow bootstraping from older
+ // versions of the compiler that could not cope with this construct.
+ //
+ public static EmitContext ConstantEC = null;
+
+ static public void Error_CannotConvertType (Location loc, Type source, Type target)
+ {
+ Report.Error (30, loc, "Cannot convert type '" +
+ TypeManager.CSharpName (source) + "' to '" +
+ TypeManager.CSharpName (target) + "'");
+ }
+
+ static EmptyExpression MyEmptyExpr;
+ static public Expression ImplicitReferenceConversion (Expression expr, Type target_type)
+ {
+ Type expr_type = expr.Type;
+
+ if (expr_type == null && expr.eclass == ExprClass.MethodGroup){
+ // if we are a method group, emit a warning
+
+ expr.Emit (null);
+ }
+
+ if (expr_type == TypeManager.void_type)
+ return null;
+
+ //
+ // notice that it is possible to write "ValueType v = 1", the ValueType here
+ // is an abstract class, and not really a value type, so we apply the same rules.
+ //
+ if (target_type == TypeManager.object_type) {
+ //
+ // A pointer type cannot be converted to object
+ //
+ if (expr_type.IsPointer)
+ return null;
+
+ if (expr_type.IsValueType)
+ return new BoxedCast (expr);
+ if (expr_type.IsClass || expr_type.IsInterface || expr_type == TypeManager.enum_type){
+ if (target_type == TypeManager.anonymous_method_type)
+ return null;
+ return new EmptyCast (expr, target_type);
+ }
+
+ return null;
+ } else if (target_type == TypeManager.value_type) {
+ if (expr_type.IsValueType)
+ return new BoxedCast (expr);
+ if (expr is NullLiteral)
+ return new NullCast (expr, target_type);
+
+ return null;
+ } else if (expr_type.IsSubclassOf (target_type)) {
+ //
+ // Special case: enumeration to System.Enum.
+ // System.Enum is not a value type, it is a class, so we need
+ // a boxing conversion
+ //
+ if (expr_type.IsEnum)
+ return new BoxedCast (expr);
+
+ return new EmptyCast (expr, target_type);
+ }
+
+ // This code is kind of mirrored inside ImplicitStandardConversionExists
+ // with the small distinction that we only probe there
+ //
+ // Always ensure that the code here and there is in sync
+
+ // from the null type to any reference-type.
+ if (expr is NullLiteral){
+ if (target_type.IsPointer)
+ return NullPointer.Null;
+
+ if (!target_type.IsValueType)
+ return new NullCast (expr, target_type);
+ }
+
+ // from any class-type S to any interface-type T.
+ if (target_type.IsInterface) {
+ if (target_type != TypeManager.iconvertible_type &&
+ expr_type.IsValueType && (expr is Constant) &&
+ !(expr is IntLiteral || expr is BoolLiteral ||
+ expr is FloatLiteral || expr is DoubleLiteral ||
+ expr is LongLiteral || expr is CharLiteral ||
+ expr is StringLiteral || expr is DecimalLiteral ||
+ expr is UIntLiteral || expr is ULongLiteral)) {
+ return null;
+ }
+
+ if (TypeManager.ImplementsInterface (expr_type, target_type)){
+ if (expr_type.IsClass)
+ return new EmptyCast (expr, target_type);
+ else if (expr_type.IsValueType)
+ return new BoxedCast (expr, target_type);
+ else
+ return new EmptyCast (expr, target_type);
+ }
+ }
+
+ // from any interface type S to interface-type T.
+ if (expr_type.IsInterface && target_type.IsInterface) {
+ if (TypeManager.ImplementsInterface (expr_type, target_type))
+ return new EmptyCast (expr, target_type);
+ else
+ return null;
+ }
+
+ // from an array-type S to an array-type of type T
+ if (expr_type.IsArray && target_type.IsArray) {
+ if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
+
+ Type expr_element_type = TypeManager.GetElementType (expr_type);
+
+ if (MyEmptyExpr == null)
+ MyEmptyExpr = new EmptyExpression ();
+
+ MyEmptyExpr.SetType (expr_element_type);
+ Type target_element_type = TypeManager.GetElementType (target_type);
+
+ if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
+ if (ImplicitStandardConversionExists (ConstantEC, MyEmptyExpr,
+ target_element_type))
+ return new EmptyCast (expr, target_type);
+ }
+ }
+
+ // from an array-type to System.Array
+ if (expr_type.IsArray && target_type == TypeManager.array_type)
+ return new EmptyCast (expr, target_type);
+
+ // from any delegate type to System.Delegate
+ if ((expr_type == TypeManager.delegate_type ||
+ expr_type.IsSubclassOf (TypeManager.delegate_type)) &&
+ target_type == TypeManager.delegate_type)
+ return new EmptyCast (expr, target_type);
+
+ // from any array-type or delegate type into System.ICloneable.
+ if (expr_type.IsArray ||
+ expr_type == TypeManager.delegate_type ||
+ expr_type.IsSubclassOf (TypeManager.delegate_type))
+ if (target_type == TypeManager.icloneable_type)
+ return new EmptyCast (expr, target_type);
+
+ return null;
+ }
+
+ //
+ // Tests whether an implicit reference conversion exists between expr_type
+ // and target_type
+ //
+ public static bool ImplicitReferenceConversionExists (Expression expr, Type target_type)
+ {
+ Type expr_type = expr.Type;
+
+ //
+ // This is the boxed case.
+ //
+ if (target_type == TypeManager.object_type) {
+ if (expr_type.IsClass || expr_type.IsValueType ||
+ expr_type.IsInterface || expr_type == TypeManager.enum_type)
+ if (target_type != TypeManager.anonymous_method_type)
+ return true;
+
+ return false;
+ } else if (expr_type.IsSubclassOf (target_type))
+ return true;
+
+ // Please remember that all code below actually comes
+ // from ImplicitReferenceConversion so make sure code remains in sync
+
+ // from any class-type S to any interface-type T.
+ if (target_type.IsInterface) {
+ if (TypeManager.ImplementsInterface (expr_type, target_type))
+ return true;
+ }
+
+ // from any interface type S to interface-type T.
+ if (expr_type.IsInterface && target_type.IsInterface)
+ if (TypeManager.ImplementsInterface (expr_type, target_type))
+ return true;
+
+ // from an array-type S to an array-type of type T
+ if (expr_type.IsArray && target_type.IsArray) {
+ if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
+
+ Type expr_element_type = expr_type.GetElementType ();
+
+ if (MyEmptyExpr == null)
+ MyEmptyExpr = new EmptyExpression ();
+
+ MyEmptyExpr.SetType (expr_element_type);
+ Type target_element_type = TypeManager.GetElementType (target_type);
+
+ if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
+ if (ImplicitStandardConversionExists (ConstantEC, MyEmptyExpr,
+ target_element_type))
+ return true;
+ }
+ }
+
+ // from an array-type to System.Array
+ if (expr_type.IsArray && (target_type == TypeManager.array_type))
+ return true;
+
+ // from any delegate type to System.Delegate
+ if ((expr_type == TypeManager.delegate_type ||
+ expr_type.IsSubclassOf (TypeManager.delegate_type)) &&
+ target_type == TypeManager.delegate_type)
+ if (target_type.IsAssignableFrom (expr_type))
+ return true;
+
+ // from any array-type or delegate type into System.ICloneable.
+ if (expr_type.IsArray ||
+ expr_type == TypeManager.delegate_type ||
+ expr_type.IsSubclassOf (TypeManager.delegate_type))
+ if (target_type == TypeManager.icloneable_type)
+ return true;
+
+ // from the null type to any reference-type.
+ if (expr is NullLiteral && !target_type.IsValueType && !TypeManager.IsEnumType (target_type))
+ return true;
+
+ return false;
+ }
+
+ /// <summary>
+ /// Implicit Numeric Conversions.
+ ///
+ /// expr is the expression to convert, returns a new expression of type
+ /// target_type or null if an implicit conversion is not possible.
+ /// </summary>
+ static public Expression ImplicitNumericConversion (EmitContext ec, Expression expr,
+ Type target_type, Location loc)
+ {
+ Type expr_type = expr.Type;
+
+ //
+ // Attempt to do the implicit constant expression conversions
+
+ if (expr is Constant){
+ if (expr is IntConstant){
+ Expression e;
+
+ e = TryImplicitIntConversion (target_type, (IntConstant) expr);
+
+ if (e != null)
+ return e;
+ } else if (expr is LongConstant && target_type == TypeManager.uint64_type){
+ //
+ // Try the implicit constant expression conversion
+ // from long to ulong, instead of a nice routine,
+ // we just inline it
+ //
+ long v = ((LongConstant) expr).Value;
+ if (v >= 0)
+ return new ULongConstant ((ulong) v);
+ }
+ }
+
+ Type real_target_type = target_type;
+
+ if (expr_type == TypeManager.sbyte_type){
+ //
+ // From sbyte to short, int, long, float, double.
+ //
+ if (real_target_type == TypeManager.int32_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
+ if (real_target_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+ if (real_target_type == TypeManager.short_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I2);
+ } else if (expr_type == TypeManager.byte_type){
+ //
+ // From byte to short, ushort, int, uint, long, ulong, float, double
+ //
+ if ((real_target_type == TypeManager.short_type) ||
+ (real_target_type == TypeManager.ushort_type) ||
+ (real_target_type == TypeManager.int32_type) ||
+ (real_target_type == TypeManager.uint32_type))
+ return new EmptyCast (expr, target_type);
+
+ if (real_target_type == TypeManager.uint64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
+ if (real_target_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ } else if (expr_type == TypeManager.short_type){
+ //
+ // From short to int, long, float, double
+ //
+ if (real_target_type == TypeManager.int32_type)
+ return new EmptyCast (expr, target_type);
+ if (real_target_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+ } else if (expr_type == TypeManager.ushort_type){
+ //
+ // From ushort to int, uint, long, ulong, float, double
+ //
+ if (real_target_type == TypeManager.uint32_type)
+ return new EmptyCast (expr, target_type);
+
+ if (real_target_type == TypeManager.uint64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
+ if (real_target_type == TypeManager.int32_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
+ if (real_target_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+ } else if (expr_type == TypeManager.int32_type){
+ //
+ // From int to long, float, double
+ //
+ if (real_target_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+ } else if (expr_type == TypeManager.uint32_type){
+ //
+ // From uint to long, ulong, float, double
+ //
+ if (real_target_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
+ if (real_target_type == TypeManager.uint64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
+ OpCodes.Conv_R8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
+ OpCodes.Conv_R4);
+ } else if (expr_type == TypeManager.int64_type){
+ //
+ // From long/ulong to float, double
+ //
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+ } else if (expr_type == TypeManager.uint64_type){
+ //
+ // From ulong to float, double
+ //
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
+ OpCodes.Conv_R8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
+ OpCodes.Conv_R4);
+ } else if (expr_type == TypeManager.char_type){
+ //
+ // From char to ushort, int, uint, long, ulong, float, double
+ //
+ if ((real_target_type == TypeManager.ushort_type) ||
+ (real_target_type == TypeManager.int32_type) ||
+ (real_target_type == TypeManager.uint32_type))
+ return new EmptyCast (expr, target_type);
+ if (real_target_type == TypeManager.uint64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
+ if (real_target_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
+ if (real_target_type == TypeManager.float_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ } else if (expr_type == TypeManager.float_type){
+ //
+ // float to double
+ //
+ if (real_target_type == TypeManager.double_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+ }
+
+ return null;
+ }
+
+
+ /// <summary>
+ /// Same as ImplicitStandardConversionExists except that it also looks at
+ /// implicit user defined conversions - needed for overload resolution
+ /// </summary>
+ public static bool ImplicitConversionExists (EmitContext ec, Expression expr, Type target_type)
+ {
+ if (ImplicitStandardConversionExists (ec, expr, target_type))
+ return true;
+
+ Expression dummy = ImplicitUserConversion (ec, expr, target_type, Location.Null);
+
+ if (dummy != null)
+ return true;
+
+ return false;
+ }
+
+ public static bool ImplicitUserConversionExists (EmitContext ec, Type source, Type target)
+ {
+ Expression dummy = ImplicitUserConversion (
+ ec, new EmptyExpression (source), target, Location.Null);
+ return dummy != null;
+ }
+
+ /// <summary>
+ /// Determines if a standard implicit conversion exists from
+ /// expr_type to target_type
+ ///
+ /// ec should point to a real EmitContext if expr.Type is TypeManager.anonymous_method_type.
+ /// </summary>
+ public static bool ImplicitStandardConversionExists (EmitContext ec, Expression expr, Type target_type)
+ {
+ Type expr_type = expr.Type;
+
+ if (expr_type == TypeManager.void_type)
+ return false;
+
+ if (expr_type == target_type)
+ return true;
+
+ // First numeric conversions
+
+ if (expr_type == TypeManager.sbyte_type){
+ //
+ // From sbyte to short, int, long, float, double.
+ //
+ if ((target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.short_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.byte_type){
+ //
+ // From byte to short, ushort, int, uint, long, ulong, float, double
+ //
+ if ((target_type == TypeManager.short_type) ||
+ (target_type == TypeManager.ushort_type) ||
+ (target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.uint32_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.short_type){
+ //
+ // From short to int, long, float, double
+ //
+ if ((target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.ushort_type){
+ //
+ // From ushort to int, uint, long, ulong, float, double
+ //
+ if ((target_type == TypeManager.uint32_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.int32_type){
+ //
+ // From int to long, float, double
+ //
+ if ((target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.uint32_type){
+ //
+ // From uint to long, ulong, float, double
+ //
+ if ((target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if ((expr_type == TypeManager.uint64_type) ||
+ (expr_type == TypeManager.int64_type)) {
+ //
+ // From long/ulong to float, double
+ //
+ if ((target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.char_type){
+ //
+ // From char to ushort, int, uint, long, ulong, float, double
+ //
+ if ((target_type == TypeManager.ushort_type) ||
+ (target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.uint32_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.float_type){
+ //
+ // float to double
+ //
+ if (target_type == TypeManager.double_type)
+ return true;
+ }
+
+ if (ImplicitReferenceConversionExists (expr, target_type))
+ return true;
+
+ //
+ // Implicit Constant Expression Conversions
+ //
+ if (expr is IntConstant){
+ int value = ((IntConstant) expr).Value;
+
+ if (target_type == TypeManager.sbyte_type){
+ if (value >= SByte.MinValue && value <= SByte.MaxValue)
+ return true;
+ } else if (target_type == TypeManager.byte_type){
+ if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
+ return true;
+ } else if (target_type == TypeManager.short_type){
+ if (value >= Int16.MinValue && value <= Int16.MaxValue)
+ return true;
+ } else if (target_type == TypeManager.ushort_type){
+ if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
+ return true;
+ } else if (target_type == TypeManager.uint32_type){
+ if (value >= 0)
+ return true;
+ } else if (target_type == TypeManager.uint64_type){
+ //
+ // we can optimize this case: a positive int32
+ // always fits on a uint64. But we need an opcode
+ // to do it.
+ //
+ if (value >= 0)
+ return true;
+ }
+
+ if (value == 0 && expr is IntLiteral && TypeManager.IsEnumType (target_type))
+ return true;
+ }
+
+ if (expr is LongConstant && target_type == TypeManager.uint64_type){
+ //
+ // Try the implicit constant expression conversion
+ // from long to ulong, instead of a nice routine,
+ // we just inline it
+ //
+ long v = ((LongConstant) expr).Value;
+ if (v > 0)
+ return true;
+ }
+
+ if ((target_type == TypeManager.enum_type ||
+ target_type.IsSubclassOf (TypeManager.enum_type)) &&
+ expr is IntLiteral){
+ IntLiteral i = (IntLiteral) expr;
+
+ if (i.Value == 0)
+ return true;
+ }
+
+ if (target_type == TypeManager.void_ptr_type && expr_type.IsPointer)
+ return true;
+
+ if (expr_type == TypeManager.anonymous_method_type){
+ if (!TypeManager.IsDelegateType (target_type))
+ return false;
+
+ AnonymousMethod am = (AnonymousMethod) expr;
+ int errors = Report.Errors;
+
+ Expression conv = am.Compatible (ec, target_type, true);
+ if (conv != null)
+ return true;
+ }
+
+ return false;
+ }
+
+ //
+ // Used internally by FindMostEncompassedType, this is used
+ // to avoid creating lots of objects in the tight loop inside
+ // FindMostEncompassedType
+ //
+ static EmptyExpression priv_fmet_param;
+
+ /// <summary>
+ /// Finds "most encompassed type" according to the spec (13.4.2)
+ /// amongst the methods in the MethodGroupExpr
+ /// </summary>
+ static Type FindMostEncompassedType (EmitContext ec, ArrayList types)
+ {
+ Type best = null;
+
+ if (priv_fmet_param == null)
+ priv_fmet_param = new EmptyExpression ();
+
+ foreach (Type t in types){
+ priv_fmet_param.SetType (t);
+
+ if (best == null) {
+ best = t;
+ continue;
+ }
+
+ if (ImplicitStandardConversionExists (ec, priv_fmet_param, best))
+ best = t;
+ }
+
+ return best;
+ }
+
+ //
+ // Used internally by FindMostEncompassingType, this is used
+ // to avoid creating lots of objects in the tight loop inside
+ // FindMostEncompassingType
+ //
+ static EmptyExpression priv_fmee_ret;
+
+ /// <summary>
+ /// Finds "most encompassing type" according to the spec (13.4.2)
+ /// amongst the types in the given set
+ /// </summary>
+ static Type FindMostEncompassingType (EmitContext ec, ArrayList types)
+ {
+ Type best = null;
+
+ if (priv_fmee_ret == null)
+ priv_fmee_ret = new EmptyExpression ();
+
+ foreach (Type t in types){
+ priv_fmee_ret.SetType (best);
+
+ if (best == null) {
+ best = t;
+ continue;
+ }
+
+ if (ImplicitStandardConversionExists (ec, priv_fmee_ret, t))
+ best = t;
+ }
+
+ return best;
+ }
+
+ //
+ // Used to avoid creating too many objects
+ //
+ static EmptyExpression priv_fms_expr;
+
+ /// <summary>
+ /// Finds the most specific source Sx according to the rules of the spec (13.4.4)
+ /// by making use of FindMostEncomp* methods. Applies the correct rules separately
+ /// for explicit and implicit conversion operators.
+ /// </summary>
+ static public Type FindMostSpecificSource (EmitContext ec, MethodGroupExpr me,
+ Expression source, bool apply_explicit_conv_rules,
+ Location loc)
+ {
+ ArrayList src_types_set = new ArrayList ();
+
+ if (priv_fms_expr == null)
+ priv_fms_expr = new EmptyExpression ();
+
+ //
+ // If any operator converts from S then Sx = S
+ //
+ Type source_type = source.Type;
+ foreach (MethodBase mb in me.Methods){
+ ParameterData pd = Invocation.GetParameterData (mb);
+ Type param_type = pd.ParameterType (0);
+
+ if (param_type == source_type)
+ return param_type;
+
+ if (apply_explicit_conv_rules) {
+ //
+ // From the spec :
+ // Find the set of applicable user-defined conversion operators, U. This set
+ // consists of the
+ // user-defined implicit or explicit conversion operators declared by
+ // the classes or structs in D that convert from a type encompassing
+ // or encompassed by S to a type encompassing or encompassed by T
+ //
+ priv_fms_expr.SetType (param_type);
+ if (ImplicitStandardConversionExists (ec, priv_fms_expr, source_type))
+ src_types_set.Add (param_type);
+ else {
+ if (ImplicitStandardConversionExists (ec, source, param_type))
+ src_types_set.Add (param_type);
+ }
+ } else {
+ //
+ // Only if S is encompassed by param_type
+ //
+ if (ImplicitStandardConversionExists (ec, source, param_type))
+ src_types_set.Add (param_type);
+ }
+ }
+
+ //
+ // Explicit Conv rules
+ //
+ if (apply_explicit_conv_rules) {
+ ArrayList candidate_set = new ArrayList ();
+
+ foreach (Type param_type in src_types_set){
+ if (ImplicitStandardConversionExists (ec, source, param_type))
+ candidate_set.Add (param_type);
+ }
+
+ if (candidate_set.Count != 0)
+ return FindMostEncompassedType (ec, candidate_set);
+ }
+
+ //
+ // Final case
+ //
+ if (apply_explicit_conv_rules)
+ return FindMostEncompassingType (ec, src_types_set);
+ else
+ return FindMostEncompassedType (ec, src_types_set);
+ }
+
+ //
+ // Useful in avoiding proliferation of objects
+ //
+ static EmptyExpression priv_fmt_expr;
+
+ /// <summary>
+ /// Finds the most specific target Tx according to section 13.4.4
+ /// </summary>
+ static public Type FindMostSpecificTarget (EmitContext ec, MethodGroupExpr me,
+ Type target, bool apply_explicit_conv_rules,
+ Location loc)
+ {
+ ArrayList tgt_types_set = new ArrayList ();
+
+ if (priv_fmt_expr == null)
+ priv_fmt_expr = new EmptyExpression ();
+
+ //
+ // If any operator converts to T then Tx = T
+ //
+ foreach (MethodInfo mi in me.Methods){
+ Type ret_type = mi.ReturnType;
+
+ if (ret_type == target)
+ return ret_type;
+
+ if (apply_explicit_conv_rules) {
+ //
+ // From the spec :
+ // Find the set of applicable user-defined conversion operators, U.
+ //
+ // This set consists of the
+ // user-defined implicit or explicit conversion operators declared by
+ // the classes or structs in D that convert from a type encompassing
+ // or encompassed by S to a type encompassing or encompassed by T
+ //
+ priv_fms_expr.SetType (ret_type);
+ if (ImplicitStandardConversionExists (ec, priv_fms_expr, target))
+ tgt_types_set.Add (ret_type);
+ else {
+ priv_fms_expr.SetType (target);
+ if (ImplicitStandardConversionExists (ec, priv_fms_expr, ret_type))
+ tgt_types_set.Add (ret_type);
+ }
+ } else {
+ //
+ // Only if T is encompassed by param_type
+ //
+ priv_fms_expr.SetType (ret_type);
+ if (ImplicitStandardConversionExists (ec, priv_fms_expr, target))
+ tgt_types_set.Add (ret_type);
+ }
+ }
+
+ //
+ // Explicit conv rules
+ //
+ if (apply_explicit_conv_rules) {
+ ArrayList candidate_set = new ArrayList ();
+
+ foreach (Type ret_type in tgt_types_set){
+ priv_fmt_expr.SetType (ret_type);
+
+ if (ImplicitStandardConversionExists (ec, priv_fmt_expr, target))
+ candidate_set.Add (ret_type);
+ }
+
+ if (candidate_set.Count != 0)
+ return FindMostEncompassingType (ec, candidate_set);
+ }
+
+ //
+ // Okay, final case !
+ //
+ if (apply_explicit_conv_rules)
+ return FindMostEncompassedType (ec, tgt_types_set);
+ else
+ return FindMostEncompassingType (ec, tgt_types_set);
+ }
+
+ /// <summary>
+ /// User-defined Implicit conversions
+ /// </summary>
+ static public Expression ImplicitUserConversion (EmitContext ec, Expression source,
+ Type target, Location loc)
+ {
+ return UserDefinedConversion (ec, source, target, loc, false);
+ }
+
+ /// <summary>
+ /// User-defined Explicit conversions
+ /// </summary>
+ static public Expression ExplicitUserConversion (EmitContext ec, Expression source,
+ Type target, Location loc)
+ {
+ return UserDefinedConversion (ec, source, target, loc, true);
+ }
+
+ static DoubleHash explicit_conv = new DoubleHash (100);
+ static DoubleHash implicit_conv = new DoubleHash (100);
+ /// <summary>
+ /// Computes the MethodGroup for the user-defined conversion
+ /// operators from source_type to target_type. `look_for_explicit'
+ /// controls whether we should also include the list of explicit
+ /// operators
+ /// </summary>
+ static MethodGroupExpr GetConversionOperators (EmitContext ec,
+ Type source_type, Type target_type,
+ Location loc, bool look_for_explicit)
+ {
+ Expression mg1 = null, mg2 = null;
+ Expression mg5 = null, mg6 = null, mg7 = null, mg8 = null;
+ string op_name;
+
+ op_name = "op_Implicit";
+
+ MethodGroupExpr union3;
+ object r;
+ if ((look_for_explicit ? explicit_conv : implicit_conv).Lookup (source_type, target_type, out r))
+ return (MethodGroupExpr) r;
+
+ mg1 = Expression.MethodLookup (ec, source_type, op_name, loc);
+ if (source_type.BaseType != null)
+ mg2 = Expression.MethodLookup (ec, source_type.BaseType, op_name, loc);
+
+ if (mg1 == null)
+ union3 = (MethodGroupExpr) mg2;
+ else if (mg2 == null)
+ union3 = (MethodGroupExpr) mg1;
+ else
+ union3 = Invocation.MakeUnionSet (mg1, mg2, loc);
+
+ mg1 = Expression.MethodLookup (ec, target_type, op_name, loc);
+ if (mg1 != null){
+ if (union3 != null)
+ union3 = Invocation.MakeUnionSet (union3, mg1, loc);
+ else
+ union3 = (MethodGroupExpr) mg1;
+ }
+
+ if (target_type.BaseType != null)
+ mg1 = Expression.MethodLookup (ec, target_type.BaseType, op_name, loc);
+
+ if (mg1 != null){
+ if (union3 != null)
+ union3 = Invocation.MakeUnionSet (union3, mg1, loc);
+ else
+ union3 = (MethodGroupExpr) mg1;
+ }
+
+ MethodGroupExpr union4 = null;
+
+ if (look_for_explicit) {
+ op_name = "op_Explicit";
+
+ mg5 = Expression.MemberLookup (ec, source_type, op_name, loc);
+ if (source_type.BaseType != null)
+ mg6 = Expression.MethodLookup (ec, source_type.BaseType, op_name, loc);
+
+ mg7 = Expression.MemberLookup (ec, target_type, op_name, loc);
+ if (target_type.BaseType != null)
+ mg8 = Expression.MethodLookup (ec, target_type.BaseType, op_name, loc);
+
+ MethodGroupExpr union5 = Invocation.MakeUnionSet (mg5, mg6, loc);
+ MethodGroupExpr union6 = Invocation.MakeUnionSet (mg7, mg8, loc);
+
+ union4 = Invocation.MakeUnionSet (union5, union6, loc);
+ }
+
+ MethodGroupExpr ret = Invocation.MakeUnionSet (union3, union4, loc);
+ (look_for_explicit ? explicit_conv : implicit_conv).Insert (source_type, target_type, ret);
+ return ret;
+ }
+
+ /// <summary>
+ /// User-defined conversions
+ /// </summary>
+ static public Expression UserDefinedConversion (EmitContext ec, Expression source,
+ Type target, Location loc,
+ bool look_for_explicit)
+ {
+ MethodGroupExpr union;
+ Type source_type = source.Type;
+ MethodBase method = null;
+
+ union = GetConversionOperators (ec, source_type, target, loc, look_for_explicit);
+ if (union == null)
+ return null;
+
+ Type most_specific_source, most_specific_target;
+
+ most_specific_source = FindMostSpecificSource (ec, union, source, look_for_explicit, loc);
+ if (most_specific_source == null)
+ return null;
+
+ most_specific_target = FindMostSpecificTarget (ec, union, target, look_for_explicit, loc);
+ if (most_specific_target == null)
+ return null;
+
+ int count = 0;
+
+
+ foreach (MethodBase mb in union.Methods){
+ ParameterData pd = Invocation.GetParameterData (mb);
+ MethodInfo mi = (MethodInfo) mb;
+
+ if (pd.ParameterType (0) == most_specific_source &&
+ mi.ReturnType == most_specific_target) {
+ method = mb;
+ count++;
+ }
+ }
+
+ if (method == null || count > 1)
+ return null;
+
+
+ //
+ // This will do the conversion to the best match that we
+ // found. Now we need to perform an implict standard conversion
+ // if the best match was not the type that we were requested
+ // by target.
+ //
+ if (look_for_explicit)
+ source = ExplicitConversionStandard (ec, source, most_specific_source, loc);
+ else
+ source = ImplicitConversionStandard (ec, source, most_specific_source, loc);
+
+ if (source == null)
+ return null;
+
+ Expression e;
+ e = new UserCast ((MethodInfo) method, source, loc);
+ if (e.Type != target){
+ if (!look_for_explicit)
+ e = ImplicitConversionStandard (ec, e, target, loc);
+ else
+ e = ExplicitConversionStandard (ec, e, target, loc);
+ }
+
+ return e;
+ }
+
+ /// <summary>
+ /// Converts implicitly the resolved expression `expr' into the
+ /// `target_type'. It returns a new expression that can be used
+ /// in a context that expects a `target_type'.
+ /// </summary>
+ static public Expression ImplicitConversion (EmitContext ec, Expression expr,
+ Type target_type, Location loc)
+ {
+ Expression e;
+
+ if (target_type == null)
+ throw new Exception ("Target type is null");
+
+ e = ImplicitConversionStandard (ec, expr, target_type, loc);
+ if (e != null)
+ return e;
+
+ e = ImplicitUserConversion (ec, expr, target_type, loc);
+ if (e != null)
+ return e;
+
+ return null;
+ }
+
+
+ /// <summary>
+ /// Attempts to apply the `Standard Implicit
+ /// Conversion' rules to the expression `expr' into
+ /// the `target_type'. It returns a new expression
+ /// that can be used in a context that expects a
+ /// `target_type'.
+ ///
+ /// This is different from `ImplicitConversion' in that the
+ /// user defined implicit conversions are excluded.
+ /// </summary>
+ static public Expression ImplicitConversionStandard (EmitContext ec, Expression expr,
+ Type target_type, Location loc)
+ {
+ Type expr_type = expr.Type;
+ Expression e;
+
+ if (expr.eclass == ExprClass.MethodGroup){
+ if (!TypeManager.IsDelegateType (target_type)){
+ return null;
+ }
+
+ //
+ // Only allow anonymous method conversions on post ISO_1
+ //
+ if (RootContext.Version != LanguageVersion.ISO_1){
+ MethodGroupExpr mg = expr as MethodGroupExpr;
+ if (mg != null)
+ return ImplicitDelegateCreation.Create (ec, mg, target_type, loc);
+ }
+ }
+
+ if (expr_type == target_type && !(expr is NullLiteral))
+ return expr;
+
+ e = ImplicitNumericConversion (ec, expr, target_type, loc);
+ if (e != null)
+ return e;
+
+ e = ImplicitReferenceConversion (expr, target_type);
+ if (e != null)
+ return e;
+
+ if ((target_type == TypeManager.enum_type ||
+ target_type.IsSubclassOf (TypeManager.enum_type)) &&
+ expr is IntLiteral){
+ IntLiteral i = (IntLiteral) expr;
+
+ if (i.Value == 0)
+ return new EnumConstant ((Constant) expr, target_type);
+ }
+
+ if (ec.InUnsafe) {
+ if (expr_type.IsPointer){
+ if (target_type == TypeManager.void_ptr_type)
+ return new EmptyCast (expr, target_type);
+
+ //
+ // yep, comparing pointer types cant be done with
+ // t1 == t2, we have to compare their element types.
+ //
+ if (target_type.IsPointer){
+ if (TypeManager.GetElementType(target_type) == TypeManager.GetElementType(expr_type))
+ return expr;
+ }
+ }
+
+ if (target_type.IsPointer) {
+ if (expr is NullLiteral)
+ return new EmptyCast (expr, target_type);
+
+ if (expr_type == TypeManager.void_ptr_type)
+ return new EmptyCast (expr, target_type);
+ }
+ }
+
+ if (expr_type == TypeManager.anonymous_method_type){
+ if (!TypeManager.IsDelegateType (target_type)){
+ Report.Error (1660, loc,
+ "Cannot convert anonymous method to `{0}', since it is not a delegate",
+ TypeManager.CSharpName (target_type));
+ return null;
+ }
+
+ AnonymousMethod am = (AnonymousMethod) expr;
+ int errors = Report.Errors;
+
+ Expression conv = am.Compatible (ec, target_type, false);
+ if (conv != null)
+ return conv;
+
+ //
+ // We return something instead of null, to avoid
+ // the duplicate error, since am.Compatible would have
+ // reported that already
+ //
+ if (errors != Report.Errors)
+ return new EmptyCast (expr, target_type);
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Attemps to perform an implict constant conversion of the IntConstant
+ /// into a different data type using casts (See Implicit Constant
+ /// Expression Conversions)
+ /// </summary>
+ static public Expression TryImplicitIntConversion (Type target_type, IntConstant ic)
+ {
+ int value = ic.Value;
+
+ if (target_type == TypeManager.sbyte_type){
+ if (value >= SByte.MinValue && value <= SByte.MaxValue)
+ return new SByteConstant ((sbyte) value);
+ } else if (target_type == TypeManager.byte_type){
+ if (value >= Byte.MinValue && value <= Byte.MaxValue)
+ return new ByteConstant ((byte) value);
+ } else if (target_type == TypeManager.short_type){
+ if (value >= Int16.MinValue && value <= Int16.MaxValue)
+ return new ShortConstant ((short) value);
+ } else if (target_type == TypeManager.ushort_type){
+ if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
+ return new UShortConstant ((ushort) value);
+ } else if (target_type == TypeManager.uint32_type){
+ if (value >= 0)
+ return new UIntConstant ((uint) value);
+ } else if (target_type == TypeManager.uint64_type){
+ //
+ // we can optimize this case: a positive int32
+ // always fits on a uint64. But we need an opcode
+ // to do it.
+ //
+ if (value >= 0)
+ return new ULongConstant ((ulong) value);
+ } else if (target_type == TypeManager.double_type)
+ return new DoubleConstant ((double) value);
+ else if (target_type == TypeManager.float_type)
+ return new FloatConstant ((float) value);
+
+ if (value == 0 && ic is IntLiteral && TypeManager.IsEnumType (target_type)){
+ Type underlying = TypeManager.EnumToUnderlying (target_type);
+ Constant e = (Constant) ic;
+
+ //
+ // Possibly, we need to create a different 0 literal before passing
+ // to EnumConstant
+ //n
+ if (underlying == TypeManager.int64_type)
+ e = new LongLiteral (0);
+ else if (underlying == TypeManager.uint64_type)
+ e = new ULongLiteral (0);
+
+ return new EnumConstant (e, target_type);
+ }
+ return null;
+ }
+
+ static public void Error_CannotImplicitConversion (Location loc, Type source, Type target)
+ {
+ Report.Error (29, loc, "Cannot convert implicitly from {0} to `{1}'",
+ source == TypeManager.anonymous_method_type ?
+ "anonymous method" : "`" + TypeManager.CSharpName (source) + "'",
+ TypeManager.CSharpName (target));
+ }
+
+ /// <summary>
+ /// Attemptes to implicityly convert `target' into `type', using
+ /// ImplicitConversion. If there is no implicit conversion, then
+ /// an error is signaled
+ /// </summary>
+ static public Expression ImplicitConversionRequired (EmitContext ec, Expression source,
+ Type target_type, Location loc)
+ {
+ Expression e;
+
+ e = ImplicitConversion (ec, source, target_type, loc);
+ if (e != null)
+ return e;
+
+ if (source is DoubleLiteral && target_type == TypeManager.float_type){
+ Report.Error (664, loc,
+ "Double literal cannot be implicitly converted to " +
+ "float type, use F suffix to create a float literal");
+ }
+
+ if (source is Constant){
+ Constant c = (Constant) source;
+
+ Expression.Error_ConstantValueCannotBeConverted (loc, c.AsString (), target_type);
+ return null;
+ }
+
+ Error_CannotImplicitConversion (loc, source.Type, target_type);
+
+ return null;
+ }
+
+ /// <summary>
+ /// Performs the explicit numeric conversions
+ /// </summary>
+ static Expression ExplicitNumericConversion (EmitContext ec, Expression expr, Type target_type, Location loc)
+ {
+ Type expr_type = expr.Type;
+
+ //
+ // If we have an enumeration, extract the underlying type,
+ // use this during the comparison, but wrap around the original
+ // target_type
+ //
+ Type real_target_type = target_type;
+
+ if (TypeManager.IsEnumType (real_target_type))
+ real_target_type = TypeManager.EnumToUnderlying (real_target_type);
+
+ if (ImplicitStandardConversionExists (ec, expr, real_target_type)){
+ Expression ce = ImplicitConversionStandard (ec, expr, real_target_type, loc);
+
+ if (real_target_type != target_type)
+ return new EmptyCast (ce, target_type);
+ return ce;
+ }
+
+ if (expr_type == TypeManager.sbyte_type){
+ //
+ // From sbyte to byte, ushort, uint, ulong, char
+ //
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U1);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U2);
+ if (real_target_type == TypeManager.uint32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U4);
+ if (real_target_type == TypeManager.uint64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U8);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_CH);
+ } else if (expr_type == TypeManager.byte_type){
+ //
+ // From byte to sbyte and char
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U1_I1);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U1_CH);
+ } else if (expr_type == TypeManager.short_type){
+ //
+ // From short to sbyte, byte, ushort, uint, ulong, char
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U1);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U2);
+ if (real_target_type == TypeManager.uint32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U4);
+ if (real_target_type == TypeManager.uint64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U8);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_CH);
+ } else if (expr_type == TypeManager.ushort_type){
+ //
+ // From ushort to sbyte, byte, short, char
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_I2);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_CH);
+ } else if (expr_type == TypeManager.int32_type){
+ //
+ // From int to sbyte, byte, short, ushort, uint, ulong, char
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_I2);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U2);
+ if (real_target_type == TypeManager.uint32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U4);
+ if (real_target_type == TypeManager.uint64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U8);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_CH);
+ } else if (expr_type == TypeManager.uint32_type){
+ //
+ // From uint to sbyte, byte, short, ushort, int, char
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I2);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_U2);
+ if (real_target_type == TypeManager.int32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I4);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_CH);
+ } else if (expr_type == TypeManager.int64_type){
+ //
+ // From long to sbyte, byte, short, ushort, int, uint, ulong, char
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I2);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U2);
+ if (real_target_type == TypeManager.int32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I4);
+ if (real_target_type == TypeManager.uint32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U4);
+ if (real_target_type == TypeManager.uint64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U8);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_CH);
+ } else if (expr_type == TypeManager.uint64_type){
+ //
+ // From ulong to sbyte, byte, short, ushort, int, uint, long, char
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I2);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U2);
+ if (real_target_type == TypeManager.int32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I4);
+ if (real_target_type == TypeManager.uint32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U4);
+ if (real_target_type == TypeManager.int64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I8);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_CH);
+ } else if (expr_type == TypeManager.char_type){
+ //
+ // From char to sbyte, byte, short
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_I2);
+ } else if (expr_type == TypeManager.float_type){
+ //
+ // From float to sbyte, byte, short,
+ // ushort, int, uint, long, ulong, char
+ // or decimal
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I2);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U2);
+ if (real_target_type == TypeManager.int32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I4);
+ if (real_target_type == TypeManager.uint32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U4);
+ if (real_target_type == TypeManager.int64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I8);
+ if (real_target_type == TypeManager.uint64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U8);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_CH);
+ } else if (expr_type == TypeManager.double_type){
+ //
+ // From double to byte, byte, short,
+ // ushort, int, uint, long, ulong,
+ // char, float or decimal
+ //
+ if (real_target_type == TypeManager.sbyte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I1);
+ if (real_target_type == TypeManager.byte_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U1);
+ if (real_target_type == TypeManager.short_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I2);
+ if (real_target_type == TypeManager.ushort_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U2);
+ if (real_target_type == TypeManager.int32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I4);
+ if (real_target_type == TypeManager.uint32_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U4);
+ if (real_target_type == TypeManager.int64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I8);
+ if (real_target_type == TypeManager.uint64_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U8);
+ if (real_target_type == TypeManager.char_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_CH);
+ if (real_target_type == TypeManager.float_type)
+ return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_R4);
+ }
+
+ // decimal is taken care of by the op_Explicit methods.
+
+ return null;
+ }
+
+ /// <summary>
+ /// Returns whether an explicit reference conversion can be performed
+ /// from source_type to target_type
+ /// </summary>
+ public static bool ExplicitReferenceConversionExists (Type source_type, Type target_type)
+ {
+ bool target_is_value_type = target_type.IsValueType;
+
+ if (source_type == target_type)
+ return true;
+
+ //
+ // From object to any reference type
+ //
+ if (source_type == TypeManager.object_type && !target_is_value_type)
+ return true;
+
+ //
+ // From any class S to any class-type T, provided S is a base class of T
+ //
+ if (target_type.IsSubclassOf (source_type))
+ return true;
+
+ //
+ // From any interface type S to any interface T provided S is not derived from T
+ //
+ if (source_type.IsInterface && target_type.IsInterface){
+ if (!target_type.IsSubclassOf (source_type))
+ return true;
+ }
+
+ //
+ // From any class type S to any interface T, provided S is not sealed
+ // and provided S does not implement T.
+ //
+ if (target_type.IsInterface && !source_type.IsSealed &&
+ !TypeManager.ImplementsInterface (source_type, target_type))
+ return true;
+
+ //
+ // From any interface-type S to to any class type T, provided T is not
+ // sealed, or provided T implements S.
+ //
+ if (source_type.IsInterface &&
+ (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type)))
+ return true;
+
+
+ // From an array type S with an element type Se to an array type T with an
+ // element type Te provided all the following are true:
+ // * S and T differe only in element type, in other words, S and T
+ // have the same number of dimensions.
+ // * Both Se and Te are reference types
+ // * An explicit referenc conversions exist from Se to Te
+ //
+ if (source_type.IsArray && target_type.IsArray) {
+ if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
+
+ Type source_element_type = TypeManager.GetElementType (source_type);
+ Type target_element_type = TypeManager.GetElementType (target_type);
+
+ if (!source_element_type.IsValueType && !target_element_type.IsValueType)
+ if (ExplicitReferenceConversionExists (source_element_type,
+ target_element_type))
+ return true;
+ }
+ }
+
+
+ // From System.Array to any array-type
+ if (source_type == TypeManager.array_type &&
+ target_type.IsArray){
+ return true;
+ }
+
+ //
+ // From System delegate to any delegate-type
+ //
+ if (source_type == TypeManager.delegate_type &&
+ target_type.IsSubclassOf (TypeManager.delegate_type))
+ return true;
+
+ //
+ // From ICloneable to Array or Delegate types
+ //
+ if (source_type == TypeManager.icloneable_type &&
+ (target_type == TypeManager.array_type ||
+ target_type == TypeManager.delegate_type))
+ return true;
+
+ return false;
+ }
+
+ /// <summary>
+ /// Implements Explicit Reference conversions
+ /// </summary>
+ static Expression ExplicitReferenceConversion (Expression source, Type target_type)
+ {
+ Type source_type = source.Type;
+ bool target_is_value_type = target_type.IsValueType;
+
+ //
+ // From object to any reference type
+ //
+ if (source_type == TypeManager.object_type && !target_is_value_type)
+ return new ClassCast (source, target_type);
+
+ //
+ // Unboxing conversion.
+ //
+ if (((source_type == TypeManager.enum_type &&
+ !(source is EmptyCast)) ||
+ source_type == TypeManager.value_type) && target_is_value_type)
+ return new UnboxCast (source, target_type);
+
+ //
+ // From any class S to any class-type T, provided S is a base class of T
+ //
+ if (target_type.IsSubclassOf (source_type))
+ return new ClassCast (source, target_type);
+
+ //
+ // From any interface type S to any interface T provided S is not derived from T
+ //
+ if (source_type.IsInterface && target_type.IsInterface){
+ if (TypeManager.ImplementsInterface (source_type, target_type))
+ return null;
+ else
+ return new ClassCast (source, target_type);
+ }
+
+ //
+ // From any class type S to any interface T, provides S is not sealed
+ // and provided S does not implement T.
+ //
+ if (target_type.IsInterface && !source_type.IsSealed) {
+ if (TypeManager.ImplementsInterface (source_type, target_type))
+ return null;
+ else
+ return new ClassCast (source, target_type);
+
+ }
+
+ //
+ // From any interface-type S to to any class type T, provided T is not
+ // sealed, or provided T implements S.
+ //
+ if (source_type.IsInterface) {
+ if (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type)) {
+ if (target_type.IsClass)
+ return new ClassCast (source, target_type);
+ else
+ return new UnboxCast (source, target_type);
+ }
+
+ return null;
+ }
+
+ // From an array type S with an element type Se to an array type T with an
+ // element type Te provided all the following are true:
+ // * S and T differe only in element type, in other words, S and T
+ // have the same number of dimensions.
+ // * Both Se and Te are reference types
+ // * An explicit referenc conversions exist from Se to Te
+ //
+ if (source_type.IsArray && target_type.IsArray) {
+ if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
+
+ Type source_element_type = TypeManager.GetElementType (source_type);
+ Type target_element_type = TypeManager.GetElementType (target_type);
+
+ if (!source_element_type.IsValueType && !target_element_type.IsValueType)
+ if (ExplicitReferenceConversionExists (source_element_type,
+ target_element_type))
+ return new ClassCast (source, target_type);
+ }
+ }
+
+
+ // From System.Array to any array-type
+ if (source_type == TypeManager.array_type &&
+ target_type.IsArray) {
+ return new ClassCast (source, target_type);
+ }
+
+ //
+ // From System delegate to any delegate-type
+ //
+ if (source_type == TypeManager.delegate_type &&
+ target_type.IsSubclassOf (TypeManager.delegate_type))
+ return new ClassCast (source, target_type);
+
+ //
+ // From ICloneable to Array or Delegate types
+ //
+ if (source_type == TypeManager.icloneable_type &&
+ (target_type == TypeManager.array_type ||
+ target_type == TypeManager.delegate_type))
+ return new ClassCast (source, target_type);
+
+ return null;
+ }
+
+ /// <summary>
+ /// Performs an explicit conversion of the expression `expr' whose
+ /// type is expr.Type to `target_type'.
+ /// </summary>
+ static public Expression ExplicitConversion (EmitContext ec, Expression expr,
+ Type target_type, Location loc)
+ {
+ Type expr_type = expr.Type;
+ Type original_expr_type = expr_type;
+
+ if (expr_type.IsSubclassOf (TypeManager.enum_type)){
+ if (target_type == TypeManager.enum_type ||
+ target_type == TypeManager.object_type) {
+ if (expr is EnumConstant)
+ expr = ((EnumConstant) expr).Child;
+ // We really need all these casts here .... :-(
+ expr = new BoxedCast (new EmptyCast (expr, expr_type));
+ return new EmptyCast (expr, target_type);
+ } else if ((expr_type == TypeManager.enum_type) && target_type.IsValueType &&
+ target_type.IsSubclassOf (TypeManager.enum_type))
+ return new UnboxCast (expr, target_type);
+
+ //
+ // Notice that we have kept the expr_type unmodified, which is only
+ // used later on to
+ if (expr is EnumConstant)
+ expr = ((EnumConstant) expr).Child;
+ else
+ expr = new EmptyCast (expr, TypeManager.EnumToUnderlying (expr_type));
+ expr_type = expr.Type;
+ }
+
+ Expression ne = ImplicitConversionStandard (ec, expr, target_type, loc);
+
+ if (ne != null)
+ return ne;
+
+ ne = ExplicitNumericConversion (ec, expr, target_type, loc);
+ if (ne != null)
+ return ne;
+
+ //
+ // Unboxing conversion.
+ //
+ if (expr_type == TypeManager.object_type && target_type.IsValueType){
+ if (expr is NullLiteral){
+ //
+ // Skip the ExplicitReferenceConversion because we can not convert
+ // from Null to a ValueType, and ExplicitReference wont check against
+ // null literal explicitly
+ //
+ goto skip_explicit;
+ }
+ return new UnboxCast (expr, target_type);
+
+ }
+
+ ne = ExplicitReferenceConversion (expr, target_type);
+ if (ne != null)
+ return ne;
+
+ skip_explicit:
+ if (ec.InUnsafe){
+ if (target_type.IsPointer){
+ if (expr_type.IsPointer)
+ return new EmptyCast (expr, target_type);
+
+ if (expr_type == TypeManager.sbyte_type ||
+ expr_type == TypeManager.byte_type ||
+ expr_type == TypeManager.short_type ||
+ expr_type == TypeManager.ushort_type ||
+ expr_type == TypeManager.int32_type ||
+ expr_type == TypeManager.uint32_type ||
+ expr_type == TypeManager.uint64_type ||
+ expr_type == TypeManager.int64_type)
+ return new OpcodeCast (expr, target_type, OpCodes.Conv_U);
+ }
+ if (expr_type.IsPointer){
+ Expression e = null;
+
+ if (target_type == TypeManager.sbyte_type)
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_I1);
+ else if (target_type == TypeManager.byte_type)
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_U1);
+ else if (target_type == TypeManager.short_type)
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_I2);
+ else if (target_type == TypeManager.ushort_type)
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_U2);
+ else if (target_type == TypeManager.int32_type)
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
+ else if (target_type == TypeManager.uint32_type)
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_U4);
+ else if (target_type == TypeManager.uint64_type)
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
+ else if (target_type == TypeManager.int64_type){
+ e = new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
+ }
+
+ if (e != null){
+ Expression ci, ce;
+
+ ci = ImplicitConversionStandard (ec, e, target_type, loc);
+
+ if (ci != null)
+ return ci;
+
+ ce = ExplicitNumericConversion (ec, e, target_type, loc);
+ if (ce != null)
+ return ce;
+ //
+ // We should always be able to go from an uint32
+ // implicitly or explicitly to the other integral
+ // types
+ //
+ throw new Exception ("Internal compiler error");
+ }
+ }
+ }
+
+ ne = ExplicitUserConversion (ec, expr, target_type, loc);
+ if (ne != null)
+ return ne;
+
+ if (expr is NullLiteral){
+ Report.Error (37, loc, "Cannot convert null to value type `" +
+ TypeManager.CSharpName (target_type) + "'");
+ return null;
+ }
+
+ Error_CannotConvertType (loc, original_expr_type, target_type);
+ return null;
+ }
+
+ /// <summary>
+ /// Same as ExplicitConversion, only it doesn't include user defined conversions
+ /// </summary>
+ static public Expression ExplicitConversionStandard (EmitContext ec, Expression expr,
+ Type target_type, Location l)
+ {
+ Expression ne = ImplicitConversionStandard (ec, expr, target_type, l);
+
+ if (ne != null)
+ return ne;
+
+ ne = ExplicitNumericConversion (ec, expr, target_type, l);
+ if (ne != null)
+ return ne;
+
+ ne = ExplicitReferenceConversion (expr, target_type);
+ if (ne != null)
+ return ne;
+
+ Error_CannotConvertType (l, expr.Type, target_type);
+ return null;
+ }
+ }
+}
diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay
index ec40bd8c38b..4b9e3d0d889 100755
--- a/mcs/mcs/cs-parser.jay
+++ b/mcs/mcs/cs-parser.jay
@@ -1,87 +1,93 @@
%{
//
-// OPTIMIZATION:
-// This loop is pointless:
-// while (current_block != prev_block)
-// current_block = current_block.Parent;
-//
// cs-parser.jay: The Parser for the C# compiler
//
-// Author: Miguel de Icaza (miguel@gnu.org)
-// Ravi Pratap (ravi@ximian.com)
+// Authors: Miguel de Icaza (miguel@gnu.org)
+// Ravi Pratap (ravi@ximian.com)
//
// Licensed under the terms of the GNU GPL
//
// (C) 2001 Ximian, Inc (http://www.ximian.com)
//
// TODO:
-// (1) Get rid of the *Collections.cs, that is an idea I took from System.CodeDOM
-// And come to think of it, it is not that great, it duplicates a lot of code
-// for something which is not really needed. We still have piles of typecasts
-// anwyays (due to the nature of the stack being a collection of Objects).
-//
-// (2) Figure out why error productions dont work. `type-declaration' is a
+// (1) Figure out why error productions dont work. `type-declaration' is a
// great spot to put an `error' because you can reproduce it with this input:
// "public X { }"
//
-// (3) Move Modifier checking from each object into the parser itself, that will
-// get rid of the global "error" symbol that we use now to report errors.
-// We still need to pass a pointer to the tree.ErrorHandler, but that is a
-// separate problem
+// Possible optimization:
+// Run memory profiler with parsing only, and consider dropping
+// arraylists where not needed. Some pieces can use linked lists.
//
using System.Text;
+using System.IO;
using System;
namespace Mono.CSharp
{
using System.Collections;
- using Mono.Languages;
/// <summary>
/// The C# Parser
/// </summary>
- public class CSharpParser : GenericParser {
- Namespace current_namespace;
- TypeContainer current_container;
+ public class CSharpParser {
+ NamespaceEntry current_namespace;
+ TypeContainer current_container;
+ TypeContainer current_class;
- // <summary>
- // Current block is used to add statements as we find
- // them.
- // </summary>
-
- Block current_block;
-
- // <summary>
- // Current interface is used by the various declaration
- // productions in the interface declaration to "add"
- // the interfaces as we find them.
- // </summary>
- Interface current_interface;
-
- // <summary>
- // This is used by the unary_expression code to resolve
- // a name against a parameter.
- // </summary>
+ IIteratorContainer iterator_container;
+
+ /// <summary>
+ /// Current block is used to add statements as we find
+ /// them.
+ /// </summary>
+ Block current_block, top_current_block;
+
+ /// <summary>
+ /// This is used by the unary_expression code to resolve
+ /// a name against a parameter.
+ /// </summary>
Parameters current_local_parameters;
- // <summary>
- // Using during property parsing to describe the implicit
- // value parameter that is passed to the "set" and "get"accesor
- // methods (properties and indexers).
- // </summary>
- string implicit_value_parameter_type;
+ /// <summary>
+ /// Using during property parsing to describe the implicit
+ /// value parameter that is passed to the "set" and "get"accesor
+ /// methods (properties and indexers).
+ /// </summary>
+ Expression implicit_value_parameter_type;
Parameters indexer_parameters;
- // <summary>
- // Used to determine if we are parsing the get/set pair
- // of an indexer or a property
- // </summmary>
+ /// <summary>
+ /// Used to determine if we are parsing the get/set pair
+ /// of an indexer or a property
+ /// </summmary>
bool parsing_indexer;
- //
- // An out-of-band stack.
- //
+ ///
+ /// An out-of-band stack.
+ ///
Stack oob_stack;
+
+ ///
+ /// Switch stack.
+ ///
+ Stack switch_stack;
+
+ public bool yacc_verbose_flag;
+
+ // Name of the file we are parsing
+ public string name;
+
+ ///
+ /// The current file.
+ ///
+ SourceFile file;
+
+
+ /// Current attribute target
+ string current_attr_target;
+
+ /// assembly and module attribute definition is enabled
+ bool global_attrs_enabled = true;
%}
%token EOF
@@ -92,6 +98,7 @@ namespace Mono.CSharp
/*
*These are the C# keywords
*/
+%token FIRST_KEYWORD
%token ABSTRACT
%token AS
%token ADD
@@ -172,11 +179,15 @@ namespace Mono.CSharp
%token VOID
%token VOLATILE
%token WHILE
+%token ARGLIST
+%token PARTIAL
/* C# keywords which are not really keywords */
%token GET "get"
%token SET "set"
+%left LAST_KEYWORD
+
/* C# single character operators/punctuation. */
%token OPEN_BRACE "{"
%token CLOSE_BRACE "}"
@@ -236,6 +247,10 @@ namespace Mono.CSharp
%token LITERAL_STRING "string literal"
%token IDENTIFIER
+%token CLOSE_PARENS_CAST
+%token CLOSE_PARENS_NO_CAST
+%token CLOSE_PARENS_OPEN_PARENS
+%token CLOSE_PARENS_MINUS
/* Add precedence rules to solve dangling else s/r conflict */
%nonassoc LOWPREC
@@ -261,8 +276,9 @@ namespace Mono.CSharp
compilation_unit
: outer_declarations opt_EOF
- | outer_declarations attribute_sections opt_EOF
- | attribute_sections opt_EOF
+ | outer_declarations global_attributes opt_EOF
+ | global_attributes opt_EOF
+ | opt_EOF /* allow empty files */
;
opt_EOF
@@ -294,14 +310,17 @@ using_alias_directive
: USING IDENTIFIER ASSIGN
namespace_or_type_name SEMICOLON
{
- current_namespace.UsingAlias ((string) $2, (string) $4, lexer.Location);
+ current_namespace.UsingAlias ((string) $2, (MemberName) $4, lexer.Location);
+ }
+ | USING error {
+ CheckIdentifierToken (yyToken);
}
;
using_namespace_directive
: USING namespace_name SEMICOLON
{
- current_namespace.Using ((string) $2);
+ current_namespace.Using ((string) $2, lexer.Location);
}
;
@@ -311,19 +330,24 @@ using_namespace_directive
// detach them
//
namespace_declaration
- : opt_attributes NAMESPACE qualified_identifier
+ : opt_attributes NAMESPACE namespace_or_type_name
{
- Attributes attrs = (Attributes) $1;
+ if ($1 != null) {
+ Report.Error(1518, Lexer.Location, "Attributes cannot be applied to namespaces."
+ + " Expected class, delegate, enum, interface, or struct");
+ }
+
+ MemberName name = (MemberName) $3;
- if (attrs != null) {
- foreach (AttributeSection asec in attrs.AttributeSections)
- if (asec.Target == "assembly")
- RootContext.AddGlobalAttribute (
- current_container, asec, lexer.Location);
+ if ((current_namespace.Parent != null) && (name.Left != null)) {
+ Report.Error (134, lexer.Location,
+ "Cannot use qualified namespace names in nested " +
+ "namespace declarations");
}
- current_namespace = RootContext.Tree.RecordNamespace (current_namespace, name, (string) $3);
- }
+ current_namespace = new NamespaceEntry (
+ current_namespace, file, name.GetName (), lexer.Location);
+ }
namespace_body opt_semicolon
{
current_namespace = current_namespace.Parent;
@@ -340,15 +364,12 @@ opt_comma
| COMMA
;
-qualified_identifier
- : IDENTIFIER
- | qualified_identifier DOT IDENTIFIER {
- $$ = (($1).ToString ()) + "." + ($3.ToString ()); }
- ;
-
-
namespace_name
- : namespace_or_type_name
+ : namespace_or_type_name {
+ MemberName name = (MemberName) $1;
+
+ $$ = name.GetName ();
+ }
;
namespace_body
@@ -398,8 +419,18 @@ namespace_member_declaration
"Namespace elements cant be explicitly " +
"declared private or protected in `" + name + "'");
}
+ current_namespace.DeclarationFound = true;
+ }
+ | namespace_declaration {
+ current_namespace.DeclarationFound = true;
+ }
+
+ | field_declaration {
+ Report.Error (116, lexer.Location, "A namespace can only contain types and namespace declarations");
+ }
+ | method_declaration {
+ Report.Error (116, lexer.Location, "A namespace can only contain types and namespace declarations");
}
- | namespace_declaration
;
type_declaration
@@ -412,6 +443,7 @@ type_declaration
// Enable this when we have handled all errors, because this acts as a generic fallback
//
// | error {
+// Console.WriteLine ("Token=" + yyToken);
// Report.Error (1518, lexer.Location, "Expected class, struct, interface, enum or delegate");
// }
;
@@ -420,57 +452,93 @@ type_declaration
// Attributes 17.2
//
+global_attributes
+ : attribute_sections
+{
+ if ($1 != null)
+ CodeGen.Assembly.AddAttributes (((Attributes)$1).Attrs);
+
+ $$ = $1;
+}
+
opt_attributes
- : /* empty */
- | attribute_sections { $$ = $1; }
- ;
+ : /* empty */
+ {
+ global_attrs_enabled = false;
+ $$ = null;
+ }
+ | attribute_sections
+ {
+ global_attrs_enabled = false;
+ $$ = $1;
+ }
+ ;
+
attribute_sections
: attribute_section
- {
- AttributeSection sect = (AttributeSection) $1;
-
- if (sect.Target == "assembly")
- RootContext.AddGlobalAttribute (current_container, sect, lexer.Location);
-
- $$ = new Attributes ((AttributeSection) $1, lexer.Location);
- }
+ {
+ ArrayList sect = (ArrayList) $1;
+
+ if (global_attrs_enabled) {
+ if (current_attr_target == "module") {
+ CodeGen.Module.AddAttributes (sect);
+ $$ = null;
+ } else if (current_attr_target == "assembly") {
+ CodeGen.Assembly.AddAttributes (sect);
+ $$ = null;
+ } else {
+ $$ = new Attributes (sect);
+ }
+ } else {
+ $$ = new Attributes (sect);
+ }
+ current_attr_target = null;
+ }
| attribute_sections attribute_section
{
- Attributes attrs = null;
- AttributeSection sect = (AttributeSection) $2;
-
- if (sect.Target == "assembly")
- RootContext.AddGlobalAttribute (current_container, sect, lexer.Location);
-
- if ($1 != null) {
- attrs = (Attributes) $1;
- attrs.AddAttribute (sect);
- }
-
+ Attributes attrs = $1 as Attributes;
+ ArrayList sect = (ArrayList) $2;
+
+ if (global_attrs_enabled) {
+ if (current_attr_target == "module") {
+ CodeGen.Module.AddAttributes (sect);
+ $$ = null;
+ } else if (current_attr_target == "assembly") {
+ CodeGen.Assembly.AddAttributes (sect);
+ $$ = null;
+ } else {
+ if (attrs == null)
+ attrs = new Attributes (sect);
+ else
+ attrs.AddAttributes (sect);
+ }
+ } else {
+ if (attrs == null)
+ attrs = new Attributes (sect);
+ else
+ attrs.AddAttributes (sect);
+ }
$$ = attrs;
+ current_attr_target = null;
}
;
attribute_section
- : OPEN_BRACKET attribute_target_specifier attribute_list CLOSE_BRACKET
+ : OPEN_BRACKET attribute_target_specifier attribute_list opt_comma CLOSE_BRACKET
{
- string target = null;
-
- if ($2 != null)
- target = (string) $2;
-
- $$ = new AttributeSection (target, (ArrayList) $3);
+ $$ = $3;
}
- | OPEN_BRACKET attribute_list CLOSE_BRACKET
+ | OPEN_BRACKET attribute_list opt_comma CLOSE_BRACKET
{
- $$ = new AttributeSection (null, (ArrayList) $2);
+ $$ = $2;
}
;
attribute_target_specifier
: attribute_target COLON
{
+ current_attr_target = (string)$1;
$$ = $1;
}
;
@@ -488,7 +556,7 @@ attribute_target
attribute_list
: attribute
{
- ArrayList attrs = new ArrayList ();
+ ArrayList attrs = new ArrayList (4);
attrs.Add ($1);
$$ = attrs;
@@ -510,12 +578,19 @@ attribute
}
opt_attribute_arguments
{
- $$ = new Attribute ((string) $1, (ArrayList) $3, (Location) $2);
+ MemberName mname = (MemberName) $1;
+ string name = mname.GetName ();
+ if (current_attr_target == "assembly" || current_attr_target == "module")
+ $$ = new GlobalAttribute (current_container, current_attr_target,
+ name, (ArrayList) $3, (Location) $2);
+ else
+ $$ = new Attribute (current_attr_target, name, (ArrayList) $3,
+ (Location) $2);
}
;
attribute_name
- : type_name { /* reserved attribute name or identifier: 17.4 */ }
+ : namespace_or_type_name { /* reserved attribute name or identifier: 17.4 */ }
;
opt_attribute_arguments
@@ -533,7 +608,7 @@ attribute_arguments
if ($1 == null)
$$ = null;
else {
- ArrayList args = new ArrayList ();
+ ArrayList args = new ArrayList (4);
args.Add ($1);
$$ = args;
@@ -541,7 +616,7 @@ attribute_arguments
}
| positional_argument_list COMMA named_argument_list
{
- ArrayList args = new ArrayList ();
+ ArrayList args = new ArrayList (4);
args.Add ($1);
args.Add ($3);
@@ -549,7 +624,7 @@ attribute_arguments
}
| named_argument_list
{
- ArrayList args = new ArrayList ();
+ ArrayList args = new ArrayList (4);
args.Add (null);
args.Add ($1);
@@ -566,7 +641,7 @@ opt_positional_argument_list
positional_argument_list
: expression
{
- ArrayList args = new ArrayList ();
+ ArrayList args = new ArrayList (4);
args.Add (new Argument ((Expression) $1, Argument.AType.Expression));
$$ = args;
@@ -583,7 +658,7 @@ positional_argument_list
named_argument_list
: named_argument
{
- ArrayList args = new ArrayList ();
+ ArrayList args = new ArrayList (4);
args.Add ($1);
$$ = args;
@@ -595,6 +670,11 @@ named_argument_list
$$ = args;
}
+ | named_argument_list COMMA expression
+ {
+ Report.Error (1016, lexer.Location, "Named attribute argument expected");
+ $$ = null;
+ }
;
named_argument
@@ -638,29 +718,45 @@ class_member_declaration
struct_declaration
: opt_attributes
opt_modifiers
- STRUCT IDENTIFIER
+ opt_partial
+ STRUCT member_name
{
- Struct new_struct;
- string full_struct_name = MakeName ((string) $4);
+ MemberName name = MakeName ((MemberName) $5);
+ bool partial = (bool) $3;
+
+ if (partial) {
+ ClassPart part = PartialContainer.CreatePart (
+ current_namespace, current_container, name, (int) $2,
+ (Attributes) $1, Kind.Struct, lexer.Location);
+
+ current_container = part.PartialContainer;
+ current_class = part;
+ } else {
+ current_class = new Struct (
+ current_namespace, current_container, name, (int) $2,
+ (Attributes) $1, lexer.Location);
- new_struct = new Struct (current_container, full_struct_name, (int) $2,
- (Attributes) $1, lexer.Location);
- current_container = new_struct;
- current_container.Namespace = current_namespace;
- RootContext.Tree.RecordDecl (full_struct_name, new_struct);
+ current_container = current_class;
+ RootContext.Tree.RecordDecl (name.GetName (true), current_class);
+ }
}
opt_class_base
+ {
+ if ($7 != null)
+ current_class.Bases = (ArrayList) $7;
+
+ current_class.Register ();
+ }
struct_body
opt_semicolon
{
- Struct new_struct = (Struct) current_container;
-
- if ($6 != null)
- new_struct.Bases = (ArrayList) $6;
+ $$ = current_class;
current_container = current_container.Parent;
- CheckDef (current_container.AddStruct (new_struct), new_struct.Name, new_struct.Location);
- $$ = new_struct;
+ current_class = current_container;
+ }
+ | opt_attributes opt_modifiers opt_partial STRUCT error {
+ CheckIdentifierToken (yyToken);
}
;
@@ -704,15 +800,20 @@ constant_declaration
constant_declarators
SEMICOLON
{
+ int modflags = (int) $2;
foreach (VariableDeclaration constant in (ArrayList) $5){
Location l = constant.Location;
+ if ((modflags & Modifiers.STATIC) != 0) {
+ Report.Error (504, l, "The constant '{0}' cannot be marked static", current_container.GetSignatureForError () + '.' + (string) constant.identifier);
+ continue;
+ }
Const c = new Const (
- (string) $4, (string) constant.identifier,
- (Expression) constant.expression_or_array_initializer, (int) $2,
+ current_class, (Expression) $4, (string) constant.identifier,
+ (Expression) constant.expression_or_array_initializer, modflags,
(Attributes) $1, l);
- CheckDef (current_container.AddConstant (c), c.Name, l);
+ current_container.AddConstant (c);
}
}
;
@@ -720,15 +821,17 @@ constant_declaration
constant_declarators
: constant_declarator
{
- ArrayList constants = new ArrayList ();
- constants.Add ($1);
+ ArrayList constants = new ArrayList (4);
+ if ($1 != null)
+ constants.Add ($1);
$$ = constants;
}
| constant_declarators COMMA constant_declarator
{
- ArrayList constants = (ArrayList) $1;
-
- constants.Add ($3);
+ if ($3 != null) {
+ ArrayList constants = (ArrayList) $1;
+ constants.Add ($3);
+ }
}
;
@@ -737,6 +840,12 @@ constant_declarator
{
$$ = new VariableDeclaration ((string) $1, $3, lexer.Location);
}
+ | IDENTIFIER
+ {
+ // A const field requires a value to be provided
+ Report.Error (145, lexer.Location, "A const field requires a value to be provided");
+ $$ = null;
+ }
;
field_declaration
@@ -746,25 +855,32 @@ field_declaration
variable_declarators
SEMICOLON
{
- string type = (string) $3;
+ Expression type = (Expression) $3;
int mod = (int) $2;
foreach (VariableDeclaration var in (ArrayList) $4){
Location l = var.Location;
- Field field = new Field (type, mod, var.identifier,
+ Field field = new Field (current_class, type, mod, var.identifier,
var.expression_or_array_initializer,
(Attributes) $1, l);
- CheckDef (current_container.AddField (field), field.Name, l);
+ current_container.AddField (field);
}
}
+ | opt_attributes
+ opt_modifiers
+ VOID
+ variable_declarators
+ SEMICOLON {
+ Report.Error (670, lexer.Location, "void type is not allowed for fields");
+ }
;
variable_declarators
: variable_declarator
{
- ArrayList decl = new ArrayList ();
+ ArrayList decl = new ArrayList (4);
decl.Add ($1);
$$ = decl;
}
@@ -798,16 +914,23 @@ variable_initializer
}
| STACKALLOC type OPEN_BRACKET expression CLOSE_BRACKET
{
- $$ = new StackAlloc ((string) $2, (Expression) $4, lexer.Location);
+ $$ = new StackAlloc ((Expression) $2, (Expression) $4, lexer.Location);
+ }
+ | STACKALLOC type
+ {
+ Report.Error (1575, lexer.Location, "A stackalloc expression requires [] after type");
+ $$ = null;
}
;
method_declaration
- : method_header
+ : method_header {
+ iterator_container = (IIteratorContainer) $1;
+ }
method_body
{
Method method = (Method) $1;
- Block b = (Block) $2;
+ Block b = (Block) $3;
const int extern_abstract = (Modifiers.EXTERN | Modifiers.ABSTRACT);
if (b == null){
@@ -824,10 +947,11 @@ method_declaration
}
}
- method.Block = (Block) $2;
- CheckDef (current_container.AddMethod (method), method.Name, method.Location);
+ method.Block = (ToplevelBlock) $3;
+ current_container.AddMethod (method);
current_local_parameters = null;
+ iterator_container = null;
}
;
@@ -853,12 +977,14 @@ opt_error_modifier
method_header
: opt_attributes
opt_modifiers
- type
- member_name
+ type namespace_or_type_name
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
{
- Method method = new Method ((string) $3, (int) $2, (string) $4,
- (Parameters) $6, (Attributes) $1, lexer.Location);
+ MemberName name = (MemberName) $4;
+
+ Method method = new Method (current_class, (Expression) $3, (int) $2,
+ false, name, (Parameters) $6, (Attributes) $1,
+ lexer.Location);
current_local_parameters = (Parameters) $6;
@@ -866,16 +992,35 @@ method_header
}
| opt_attributes
opt_modifiers
- VOID
- member_name
+ VOID namespace_or_type_name
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
{
- Method method = new Method ("System.Void", (int) $2, (string) $4,
- (Parameters) $6, (Attributes) $1, lexer.Location);
+ MemberName name = (MemberName) $4;
+
+ Method method = new Method (current_class, TypeManager.system_void_expr,
+ (int) $2, false, name, (Parameters) $6,
+ (Attributes) $1, lexer.Location);
current_local_parameters = (Parameters) $6;
$$ = method;
}
+ | opt_attributes
+ opt_modifiers
+ type
+ modifiers namespace_or_type_name OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
+ {
+ Report.Error (1585, lexer.Location,
+ String.Format ("Modifier {0} should appear before type",
+ Modifiers.Name ((int) $4)));
+ MemberName name = (MemberName) $4;
+
+ Method method = new Method (current_class, TypeManager.system_void_expr,
+ 0, false, name, (Parameters) $7, (Attributes) $1,
+ lexer.Location);
+
+ current_local_parameters = (Parameters) $7;
+ $$ = method;
+ }
;
method_body
@@ -884,7 +1029,7 @@ method_body
;
opt_formal_parameter_list
- : /* empty */ { $$ = Parameters.GetEmptyReadOnlyParameters (); }
+ : /* empty */ { $$ = Parameters.EmptyReadOnlyParameters; }
| formal_parameter_list
;
@@ -907,16 +1052,39 @@ formal_parameter_list
$$ = new Parameters (pars, (Parameter) $3, lexer.Location);
}
+ | fixed_parameters COMMA ARGLIST
+ {
+ ArrayList pars_list = (ArrayList) $1;
+
+ Parameter [] pars = new Parameter [pars_list.Count];
+ pars_list.CopyTo (pars);
+
+ $$ = new Parameters (pars, true, lexer.Location);
+ }
+ | parameter_array COMMA fixed_parameters
+ {
+ Report.Error (231, lexer.Location, "A params parameter must be the last parameter in a formal parameter list");
+ $$ = null;
+ }
+ | ARGLIST COMMA fixed_parameters
+ {
+ Report.Error (257, lexer.Location, "An __arglist parameter must be the last parameter in a formal parameter list");
+ $$ = null;
+ }
| parameter_array
{
$$ = new Parameters (null, (Parameter) $1, lexer.Location);
}
+ | ARGLIST
+ {
+ $$ = new Parameters (null, true, lexer.Location);
+ }
;
fixed_parameters
: fixed_parameter
{
- ArrayList pars = new ArrayList ();
+ ArrayList pars = new ArrayList (4);
pars.Add ($1);
$$ = pars;
@@ -936,8 +1104,32 @@ fixed_parameter
type
IDENTIFIER
{
- $$ = new Parameter ((string) $3, (string) $4, (Parameter.Modifier) $2, (Attributes) $1);
+ $$ = new Parameter ((Expression) $3, (string) $4, (Parameter.Modifier) $2, (Attributes) $1);
+ }
+ | opt_attributes
+ opt_parameter_modifier
+ type
+ {
+ Report.Error (1001, lexer.Location, "Identifier expected");
+ $$ = null;
+ }
+ | opt_attributes
+ opt_parameter_modifier
+ type
+ error {
+ CheckIdentifierToken (yyToken);
+ $$ = null;
}
+ | opt_attributes
+ opt_parameter_modifier
+ type
+ IDENTIFIER
+ ASSIGN
+ constant_expression
+ {
+ Report.Error (241, lexer.Location, "Default parameter specifiers are not permitted");
+ $$ = null;
+ }
;
opt_parameter_modifier
@@ -946,33 +1138,40 @@ opt_parameter_modifier
;
parameter_modifier
- : REF { $$ = Parameter.Modifier.REF; }
- | OUT { $$ = Parameter.Modifier.OUT; }
+ : REF { $$ = Parameter.Modifier.REF | Parameter.Modifier.ISBYREF; }
+ | OUT { $$ = Parameter.Modifier.OUT | Parameter.Modifier.ISBYREF; }
;
parameter_array
: opt_attributes PARAMS type IDENTIFIER
{
- $$ = new Parameter ((string) $3, (string) $4, Parameter.Modifier.PARAMS, (Attributes) $1);
+ $$ = new Parameter ((Expression) $3, (string) $4, Parameter.Modifier.PARAMS, (Attributes) $1);
note ("type must be a single-dimension array type");
}
- ;
-
-member_name
- : qualified_identifier
+ | opt_attributes PARAMS parameter_modifier type IDENTIFIER
+ {
+ Report.Error (1611, lexer.Location, "The params parameter cannot be declared as ref or out");
+ $$ = null;
+ }
+ | opt_attributes PARAMS type error {
+ CheckIdentifierToken (yyToken);
+ $$ = null;
+ }
;
property_declaration
: opt_attributes
opt_modifiers
- type member_name
+ type namespace_or_type_name
OPEN_BRACE
{
- implicit_value_parameter_type = (string) $3;
+ implicit_value_parameter_type = (Expression) $3;
lexer.PropertyParsing = true;
$$ = lexer.Location;
+
+ iterator_container = SimpleIteratorContainer.GetSimple ();
}
accessor_declarations
{
@@ -986,11 +1185,16 @@ property_declaration
Accessor set_block = (Accessor) pair.Second;
Location loc = (Location) $6;
- prop = new Property ((string) $3, (string) $4, (int) $2, get_block, set_block,
- (Attributes) $1, loc);
+ MemberName name = (MemberName) $4;
+
+ prop = new Property (current_class, (Expression) $3, (int) $2, false,
+ name, (Attributes) $1, get_block, set_block, loc);
+ if (SimpleIteratorContainer.Simple.Yields)
+ prop.SetYields ();
- CheckDef (current_container.AddProperty (prop), prop.Name, loc);
+ current_container.AddProperty (prop);
implicit_value_parameter_type = null;
+ iterator_container = null;
}
;
@@ -1016,7 +1220,7 @@ opt_set_accessor_declaration
;
get_accessor_declaration
- : opt_attributes GET
+ : opt_attributes opt_modifiers GET
{
// If this is not the case, then current_local_parameters has already
// been set in indexer_declaration
@@ -1028,14 +1232,14 @@ get_accessor_declaration
}
accessor_body
{
- $$ = new Accessor ((Block) $4, (Attributes) $1);
+ $$ = new Accessor ((ToplevelBlock) $5, (int) $2, (Attributes) $1, lexer.Location);
current_local_parameters = null;
lexer.PropertyParsing = true;
}
;
set_accessor_declaration
- : opt_attributes SET
+ : opt_attributes opt_modifiers SET
{
Parameter [] args;
Parameter implicit_value_parameter = new Parameter (
@@ -1065,7 +1269,7 @@ set_accessor_declaration
}
accessor_body
{
- $$ = new Accessor ((Block) $4, (Attributes) $1);
+ $$ = new Accessor ((ToplevelBlock) $5, (int) $2, (Attributes) $1, lexer.Location);
current_local_parameters = null;
lexer.PropertyParsing = true;
}
@@ -1079,57 +1283,44 @@ accessor_body
interface_declaration
: opt_attributes
opt_modifiers
- INTERFACE IDENTIFIER
+ opt_partial
+ INTERFACE member_name
{
- Interface new_interface;
- string full_interface_name = MakeName ((string) $4);
+ MemberName name = MakeName ((MemberName) $5);
+ bool partial = (bool) $3;
- new_interface = new Interface (current_container, full_interface_name, (int) $2,
- (Attributes) $1, lexer.Location);
- if (current_interface != null) {
- Location l = lexer.Location;
- Report.Error (-2, l, "Internal compiler error: interface inside interface");
- }
- current_interface = new_interface;
- new_interface.Namespace = current_namespace;
- RootContext.Tree.RecordDecl (full_interface_name, new_interface);
- }
- opt_interface_base
- interface_body opt_semicolon
- {
- Interface new_interface = (Interface) current_interface;
+ if (partial) {
+ ClassPart part = PartialContainer.CreatePart (
+ current_namespace, current_container, name, (int) $2,
+ (Attributes) $1, Kind.Interface, lexer.Location);
- if ($6 != null)
- new_interface.Bases = (ArrayList) $6;
+ current_container = part.PartialContainer;
+ current_class = part;
+ } else {
+ current_class = new Interface (
+ current_namespace, current_container, name, (int) $2,
+ (Attributes) $1, lexer.Location);
- current_interface = null;
- CheckDef (current_container.AddInterface (new_interface),
- new_interface.Name, new_interface.Location);
+ current_container = current_class;
+ RootContext.Tree.RecordDecl (name.GetName (true), current_class);
+ }
}
- ;
-
-opt_interface_base
- : /* empty */ { $$ = null; }
- | interface_base
- ;
-
-interface_base
- : COLON interface_type_list { $$ = $2; }
- ;
-
-interface_type_list
- : interface_type
+ opt_class_base
{
- ArrayList interfaces = new ArrayList ();
+ current_class.Bases = (ArrayList) $7;
- interfaces.Add ($1);
- $$ = interfaces;
+ current_class.Register ();
}
- | interface_type_list COMMA interface_type
+ interface_body
+ opt_semicolon
{
- ArrayList interfaces = (ArrayList) $1;
- interfaces.Add ($3);
- $$ = interfaces;
+ $$ = current_class;
+
+ current_container = current_container.Parent;
+ current_class = current_container;
+ }
+ | opt_attributes opt_modifiers opt_partial INTERFACE error {
+ CheckIdentifierToken (yyToken);
}
;
@@ -1152,49 +1343,58 @@ interface_member_declarations
interface_member_declaration
: interface_method_declaration
{
- InterfaceMethod m = (InterfaceMethod) $1;
+ Method m = (Method) $1;
- CheckDef (current_interface.AddMethod (m), m.Name, m.Location);
+ current_container.AddMethod (m);
}
| interface_property_declaration
{
- InterfaceProperty p = (InterfaceProperty) $1;
+ Property p = (Property) $1;
- CheckDef (current_interface.AddProperty (p), p.Name, p.Location);
- }
+ current_container.AddProperty (p);
+ }
| interface_event_declaration
{
- InterfaceEvent e = (InterfaceEvent) $1;
-
- CheckDef (current_interface.AddEvent (e), e.Name, lexer.Location);
+ if ($1 != null){
+ Event e = (Event) $1;
+ current_container.AddEvent (e);
+ }
}
| interface_indexer_declaration
{
- InterfaceIndexer i = (InterfaceIndexer) $1;
+ Indexer i = (Indexer) $1;
- CheckDef (current_interface.AddIndexer (i), "indexer", i.Location);
+ current_container.AddIndexer (i);
}
;
opt_new
- : /* empty */ { $$ = false; }
- | NEW { $$ = true; }
+ : opt_modifiers
+ {
+ int val = (int) $1;
+ val = Modifiers.Check (Modifiers.NEW | Modifiers.UNSAFE, val, 0, lexer.Location);
+ $$ = val;
+ }
;
interface_method_declaration
- : opt_attributes opt_new type IDENTIFIER
+ : opt_attributes opt_new type namespace_or_type_name
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
SEMICOLON
{
- $$ = new InterfaceMethod ((string) $3, (string) $4, (bool) $2,
- (Parameters) $6, (Attributes) $1, lexer.Location);
+ MemberName name = (MemberName) $4;
+
+ $$ = new Method (current_class, (Expression) $3, (int) $2, true,
+ name, (Parameters) $6, (Attributes) $1, lexer.Location);
}
- | opt_attributes opt_new VOID IDENTIFIER
+ | opt_attributes opt_new VOID namespace_or_type_name
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
SEMICOLON
{
- $$ = new InterfaceMethod ("System.Void", (string) $4, (bool) $2, (Parameters) $6,
- (Attributes) $1, lexer.Location);
+ MemberName name = (MemberName) $4;
+
+ $$ = new Method (current_class, TypeManager.system_void_expr, (int) $2,
+ true, name, (Parameters) $6, (Attributes) $1, lexer.Location);
}
;
@@ -1204,32 +1404,52 @@ interface_property_declaration
type IDENTIFIER
OPEN_BRACE
{ lexer.PropertyParsing = true; }
- interface_accesors
+ interface_accessors
{ lexer.PropertyParsing = false; }
CLOSE_BRACE
{
- int gs = (int) $7;
+ InterfaceAccessorInfo pinfo = (InterfaceAccessorInfo) $7;
- $$ = new InterfaceProperty ((string) $3, (string) $4, (bool) $2,
- (gs & 1) == 1, (gs & 2) == 2, (Attributes) $1,
- lexer.Location);
+ $$ = new Property (current_class, (Expression) $3, (int) $2, true,
+ new MemberName ((string) $4), (Attributes) $1,
+ pinfo.Get, pinfo.Set, lexer.Location);
+ }
+ | opt_attributes
+ opt_new
+ type error {
+ CheckIdentifierToken (yyToken);
+ $$ = null;
}
;
-interface_accesors
- : opt_attributes GET SEMICOLON { $$ = 1; }
- | opt_attributes SET SEMICOLON { $$ = 2; }
+interface_accessors
+ : opt_attributes GET SEMICOLON { $$ = new InterfaceAccessorInfo (true, false, (Attributes) $1, null, lexer.Location, lexer.Location); }
+ | opt_attributes SET SEMICOLON { $$ = new InterfaceAccessorInfo (false, true, null, (Attributes) $1, lexer.Location, lexer.Location); }
| opt_attributes GET SEMICOLON opt_attributes SET SEMICOLON
- { $$ = 3; }
+ { $$ = new InterfaceAccessorInfo (true, true, (Attributes) $1, (Attributes) $3, lexer.Location, lexer.Location); }
| opt_attributes SET SEMICOLON opt_attributes GET SEMICOLON
- { $$ = 3; }
+ { $$ = new InterfaceAccessorInfo (true, true, (Attributes) $3, (Attributes) $1, lexer.Location, lexer.Location); }
;
interface_event_declaration
: opt_attributes opt_new EVENT type IDENTIFIER SEMICOLON
{
- $$ = new InterfaceEvent ((string) $4, (string) $5, (bool) $2, (Attributes) $1);
+ $$ = new EventField (current_class, (Expression) $4, (int) $2, true,
+ new MemberName ((string) $5), null,
+ (Attributes) $1, lexer.Location);
}
+ | opt_attributes opt_new EVENT type error {
+ CheckIdentifierToken (yyToken);
+ $$ = null;
+ }
+ | opt_attributes opt_new EVENT type IDENTIFIER ASSIGN {
+ Report.Error (68, lexer.Location, "Event declarations on interfaces can not be initialized.");
+ $$ = null;
+ }
+ | opt_attributes opt_new EVENT type IDENTIFIER OPEN_BRACE event_accessor_declarations CLOSE_BRACE {
+ Report.Error (69, lexer.Location, "Event accessors not valid on interfaces");
+ $$ = null;
+ }
;
interface_indexer_declaration
@@ -1237,32 +1457,47 @@ interface_indexer_declaration
OPEN_BRACKET formal_parameter_list CLOSE_BRACKET
OPEN_BRACE
{ lexer.PropertyParsing = true; }
- interface_accesors
+ interface_accessors
{ lexer.PropertyParsing = false; }
CLOSE_BRACE
{
- int a_flags = (int) $10;
-
- bool do_get = (a_flags & 1) == 1;
- bool do_set = (a_flags & 2) == 2;
+ InterfaceAccessorInfo info = (InterfaceAccessorInfo) $10;
- $$ = new InterfaceIndexer ((string) $3, (Parameters) $6, do_get, do_set,
- (bool) $2, (Attributes) $1, lexer.Location);
+ $$ = new Indexer (current_class, (Expression) $3,
+ new MemberName (TypeContainer.DefaultIndexerName),
+ (int) $2, true, (Parameters) $6, (Attributes) $1,
+ info.Get, info.Set, lexer.Location);
}
;
operator_declaration
- : opt_attributes opt_modifiers operator_declarator operator_body
+ : opt_attributes opt_modifiers operator_declarator
+ {
+ iterator_container = SimpleIteratorContainer.GetSimple ();
+ }
+ operator_body
{
OperatorDeclaration decl = (OperatorDeclaration) $3;
- Operator op = new Operator (decl.optype, decl.ret_type, (int) $2, decl.arg1type, decl.arg1name,
- decl.arg2type, decl.arg2name, (Block) $4, (Attributes) $1, decl.location);
+ Parameter [] param_list = new Parameter [decl.arg2type != null ? 2 : 1];
+
+ param_list[0] = new Parameter (decl.arg1type, decl.arg1name, Parameter.Modifier.NONE, null);
+ if (decl.arg2type != null)
+ param_list[1] = new Parameter (decl.arg2type, decl.arg2name, Parameter.Modifier.NONE, null);
+
+ Operator op = new Operator (
+ current_class, decl.optype, decl.ret_type, (int) $2,
+ new Parameters (param_list, null, decl.location),
+ (ToplevelBlock) $5, (Attributes) $1, decl.location);
+
+ if (SimpleIteratorContainer.Simple.Yields)
+ op.SetYields ();
// Note again, checking is done in semantic analysis
current_container.AddOperator (op);
current_local_parameters = null;
+ iterator_container = null;
}
;
@@ -1285,11 +1520,11 @@ operator_declarator
Parameter [] pars = new Parameter [1];
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
+ pars [0] = new Parameter ((Expression) $5, (string) $6, Parameter.Modifier.NONE, null);
current_local_parameters = new Parameters (pars, null, lexer.Location);
- $$ = new OperatorDeclaration (op, (string) $1, (string) $5, (string) $6,
+ $$ = new OperatorDeclaration (op, (Expression) $1, (Expression) $5, (string) $6,
null, null, lexer.Location);
}
| type OPERATOR overloadable_operator
@@ -1302,13 +1537,14 @@ operator_declarator
Parameter [] pars = new Parameter [2];
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
- pars [1] = new Parameter ((string) $8, (string) $9, Parameter.Modifier.NONE, null);
+ pars [0] = new Parameter ((Expression) $5, (string) $6, Parameter.Modifier.NONE, null);
+ pars [1] = new Parameter ((Expression) $8, (string) $9, Parameter.Modifier.NONE, null);
current_local_parameters = new Parameters (pars, null, lexer.Location);
- $$ = new OperatorDeclaration ((Operator.OpType) $3, (string) $1, (string) $5, (string) $6,
- (string) $8, (string) $9, lexer.Location);
+ $$ = new OperatorDeclaration ((Operator.OpType) $3, (Expression) $1,
+ (Expression) $5, (string) $6,
+ (Expression) $8, (string) $9, lexer.Location);
}
| conversion_operator_declarator
;
@@ -1346,22 +1582,22 @@ conversion_operator_declarator
{
Parameter [] pars = new Parameter [1];
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
+ pars [0] = new Parameter ((Expression) $5, (string) $6, Parameter.Modifier.NONE, null);
current_local_parameters = new Parameters (pars, null, lexer.Location);
- $$ = new OperatorDeclaration (Operator.OpType.Implicit, (string) $3, (string) $5, (string) $6,
+ $$ = new OperatorDeclaration (Operator.OpType.Implicit, (Expression) $3, (Expression) $5, (string) $6,
null, null, lexer.Location);
}
| EXPLICIT OPERATOR type OPEN_PARENS type IDENTIFIER CLOSE_PARENS
{
Parameter [] pars = new Parameter [1];
- pars [0] = new Parameter ((string) $5, (string) $6, Parameter.Modifier.NONE, null);
+ pars [0] = new Parameter ((Expression) $5, (string) $6, Parameter.Modifier.NONE, null);
current_local_parameters = new Parameters (pars, null, lexer.Location);
- $$ = new OperatorDeclaration (Operator.OpType.Explicit, (string) $3, (string) $5, (string) $6,
+ $$ = new OperatorDeclaration (Operator.OpType.Explicit, (Expression) $3, (Expression) $5, (string) $6,
null, null, lexer.Location);
}
| IMPLICIT error
@@ -1381,31 +1617,41 @@ constructor_declaration
constructor_body
{
Constructor c = (Constructor) $3;
- c.Block = (Block) $4;
- c.ModFlags = (int) $2;
+ c.Block = (ToplevelBlock) $4;
c.OptAttributes = (Attributes) $1;
-
- if ((c.ModFlags & Modifiers.STATIC) != 0){
- if ((c.ModFlags & Modifiers.Accessibility) != 0) {
- Report.Error (
- 515, c.Location,
- "Access modifiers are not allowed on static constructors");
- }
-
- if (c.Initializer != null){
- Report.Error (
- 514, c.Location,
- "Static constructors can not have an explicit this or base " +
- "constructor invocations");
+ c.ModFlags = (int) $2;
+
+ if (c.Name == current_container.Basename){
+ if ((c.ModFlags & Modifiers.STATIC) != 0){
+ if ((c.ModFlags & Modifiers.Accessibility) != 0){
+ Report.Error (
+ 515, c.Location, String.Format (
+ "`{0}.{1}': static constructor can not have access modifiers",
+ c.Name, current_container.Name));
+ }
+
+ c.ModFlags = Modifiers.Check (Constructor.AllowedModifiers, (int) $2, Modifiers.PRIVATE, c.Location);
+
+ if (c.Initializer != null){
+ Report.Error (
+ 514, c.Location,
+ "Static constructors can not have an explicit this or base " +
+ "constructor invocations");
+ }
+
+ if (!c.Parameters.Empty){
+ Report.Error (
+ 132, c.Location, "Static constructors should not have parameters");
+ }
+ } else {
+ c.ModFlags = Modifiers.Check (Constructor.AllowedModifiers, (int) $2, Modifiers.PRIVATE, c.Location);
}
+ } else {
+ // We let another layer check the validity of the constructor.
+ //Console.WriteLine ("{0} and {1}", c.Name, current_container.Basename);
+ }
- if (!c.Parameters.Empty){
- Report.Error (
- 132, c.Location, "Static constructors should not have parameters");
- }
- }
-
- CheckDef (current_container.AddConstructor (c), c.Name, c.Location);
+ current_container.AddConstructor (c);
current_local_parameters = null;
}
@@ -1422,7 +1668,8 @@ constructor_declarator
opt_constructor_initializer
{
Location l = (Location) oob_stack.Pop ();
- $$ = new Constructor ((string) $1, (Parameters) $3, (ConstructorInitializer) $6, l);
+ $$ = new Constructor (current_class, (string) $1, 0, (Parameters) $3,
+ (ConstructorInitializer) $6, l);
}
;
@@ -1439,36 +1686,54 @@ opt_constructor_initializer
constructor_initializer
: COLON BASE OPEN_PARENS opt_argument_list CLOSE_PARENS
{
- $$ = new ConstructorBaseInitializer ((ArrayList) $4, lexer.Location);
+ $$ = new ConstructorBaseInitializer ((ArrayList) $4, current_local_parameters, lexer.Location);
}
| COLON THIS OPEN_PARENS opt_argument_list CLOSE_PARENS
{
- $$ = new ConstructorThisInitializer ((ArrayList) $4, lexer.Location);
+ $$ = new ConstructorThisInitializer ((ArrayList) $4, current_local_parameters, lexer.Location);
+ }
+ | COLON error {
+ Report.Error (1018, lexer.Location, "Keyword this or base expected");
+ $$ = null;
}
;
+opt_finalizer
+ : /* EMPTY */ { $$ = 0; }
+ | UNSAFE { $$ = Modifiers.UNSAFE; }
+ | EXTERN { $$ = Modifiers.EXTERN; }
+ ;
+
destructor_declaration
- : opt_attributes TILDE IDENTIFIER OPEN_PARENS CLOSE_PARENS block
+ : opt_attributes opt_finalizer TILDE IDENTIFIER OPEN_PARENS CLOSE_PARENS block
{
- if ((string) $3 != current_container.Basename){
+ if ((string) $4 != current_container.Basename){
Report.Error (574, lexer.Location, "Name of destructor must match name of class");
} else if (!(current_container is Class)){
Report.Error (575, lexer.Location, "Destructors are only allowed in class types");
} else {
Location l = lexer.Location;
- int m;
+ int m = (int) $2;
if (!RootContext.StdLib && current_container.Name == "System.Object")
- m = Modifiers.PROTECTED | Modifiers.VIRTUAL;
+ m |= Modifiers.PROTECTED | Modifiers.VIRTUAL;
else
- m = Modifiers.PROTECTED | Modifiers.OVERRIDE;
-
- Method d = new Method (
- "System.Void", m, "Finalize",
+ m |= Modifiers.PROTECTED | Modifiers.OVERRIDE;
+
+ if ((m & Modifiers.UNSAFE) != 0){
+ if (!RootContext.Unsafe){
+ Report.Error (227, l,
+ "Unsafe code requires the -unsafe command " +
+ "line option to be specified");
+ }
+ }
+
+ Method d = new Destructor (
+ current_class, TypeManager.system_void_expr, m, "Finalize",
new Parameters (null, null, l), (Attributes) $1, l);
- d.Block = (Block) $6;
- CheckDef (current_container.AddMethod (d), d.Name, d.Location);
+ d.Block = (ToplevelBlock) $7;
+ current_container.AddMethod (d);
}
}
;
@@ -1480,20 +1745,23 @@ event_declaration
{
foreach (VariableDeclaration var in (ArrayList) $5) {
- Event e = new Event ((string) $4, var.identifier,
- var.expression_or_array_initializer,
- (int) $2, null, null, (Attributes) $1, lexer.Location);
+ MemberName name = new MemberName (var.identifier);
- CheckDef (current_container.AddEvent (e), e.Name, e.Location);
+ Event e = new EventField (
+ current_class, (Expression) $4, (int) $2, false, name,
+ var.expression_or_array_initializer, (Attributes) $1,
+ lexer.Location);
+
+ current_container.AddEvent (e);
}
}
| opt_attributes
opt_modifiers
- EVENT type member_name
+ EVENT type namespace_or_type_name
OPEN_BRACE
{
- implicit_value_parameter_type = (string) $4;
+ implicit_value_parameter_type = (Expression) $4;
lexer.EventParsing = true;
oob_stack.Push (lexer.Location);
}
@@ -1505,20 +1773,30 @@ event_declaration
{
Location loc = (Location) oob_stack.Pop ();
- Pair pair = (Pair) $8;
- Accessor add_accessor = null;
- Accessor rem_accessor = null;
+ if ($8 == null){
+ Report.Error (65, lexer.Location, "Event must have both add and remove accesors");
+ $$ = null;
+ } else {
+ Pair pair = (Pair) $8;
+
+ MemberName name = (MemberName) $5;
- if (pair.First != null)
- add_accessor = (Accessor) pair.First;
- if (pair.Second != null)
- rem_accessor = (Accessor) pair.Second;
-
- Event e = new Event ((string) $4, (string) $5, null, (int) $2, add_accessor, rem_accessor,
- (Attributes) $1, loc);
-
- CheckDef (current_container.AddEvent (e), e.Name, loc);
- implicit_value_parameter_type = null;
+ Event e = new EventProperty (
+ current_class, (Expression) $4, (int) $2, false, name, null,
+ (Attributes) $1, (Accessor) pair.First, (Accessor) pair.Second,
+ loc);
+
+ current_container.AddEvent (e);
+ implicit_value_parameter_type = null;
+ }
+ }
+ | opt_attributes opt_modifiers EVENT type namespace_or_type_name OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS block {
+ MemberName mn = (MemberName) $5;
+
+ if (mn.Left != null)
+ Report.Error (71, lexer.Location, "Explicit implementation of events requires property syntax");
+ else
+ Report.Error (71, lexer.Location, "Event declaration should use property syntax");
}
;
@@ -1531,6 +1809,14 @@ event_accessor_declarations
{
$$ = new Pair ($2, $1);
}
+ | add_accessor_declaration { $$ = null; }
+ | remove_accessor_declaration { $$ = null; }
+ | error
+ {
+ Report.Error (1055, lexer.Location, "An add or remove accessor expected");
+ $$ = null;
+ }
+ | { $$ = null; }
;
add_accessor_declaration
@@ -1548,9 +1834,13 @@ add_accessor_declaration
}
block
{
- $$ = new Accessor ((Block) $4, (Attributes) $1);
+ $$ = new Accessor ((ToplevelBlock) $4, 0, (Attributes) $1, lexer.Location);
lexer.EventParsing = true;
}
+ | opt_attributes ADD error {
+ Report.Error (73, lexer.Location, "Add or remove accessor must have a body");
+ $$ = null;
+ }
;
remove_accessor_declaration
@@ -1568,9 +1858,13 @@ remove_accessor_declaration
}
block
{
- $$ = new Accessor ((Block) $4, (Attributes) $1);
+ $$ = new Accessor ((ToplevelBlock) $4, 0, (Attributes) $1, lexer.Location);
lexer.EventParsing = true;
}
+ | opt_attributes REMOVE error {
+ Report.Error (73, lexer.Location, "Add or remove accessor must have a body");
+ $$ = null;
+ }
;
indexer_declaration
@@ -1603,12 +1897,17 @@ indexer_declaration
Accessor get_block = (Accessor) pair.First;
Accessor set_block = (Accessor) pair.Second;
- indexer = new Indexer (decl.type, decl.interface_type, (int) $2, decl.param_list,
- get_block, set_block, (Attributes) $1, loc);
+ MemberName name;
+ if (decl.interface_type != null)
+ name = new MemberName (decl.interface_type,
+ TypeContainer.DefaultIndexerName);
+ else
+ name = new MemberName (TypeContainer.DefaultIndexerName);
+
+ indexer = new Indexer (current_class, decl.type, name,
+ (int) $2, false, decl.param_list, (Attributes) $1,
+ get_block, set_block, loc);
- // Note that there is no equivalent of CheckDef for this case
- // We shall handle this in semantic analysis
-
current_container.AddIndexer (indexer);
current_local_parameters = null;
@@ -1621,21 +1920,27 @@ indexer_declarator
: type THIS OPEN_BRACKET opt_formal_parameter_list CLOSE_BRACKET
{
Parameters pars = (Parameters) $4;
-
- if (pars.FixedParameters == null && pars.ArrayParameter == null){
+ if (pars.HasArglist) {
+ // "__arglist is not valid in this context"
+ Report.Error (1669, lexer.Location, "__arglist is not valid in this context");
+ } else if (pars.FixedParameters == null && pars.ArrayParameter == null){
Report.Error (1551, lexer.Location, "Indexers must have at least one parameter");
}
- $$ = new IndexerDeclaration ((string) $1, null, pars);
+ $$ = new IndexerDeclaration ((Expression) $1, null, pars);
}
- | type qualified_identifier DOT THIS OPEN_BRACKET opt_formal_parameter_list CLOSE_BRACKET
+ | type namespace_or_type_name DOT THIS OPEN_BRACKET opt_formal_parameter_list CLOSE_BRACKET
{
Parameters pars = (Parameters) $6;
- if (pars.FixedParameters == null && pars.ArrayParameter == null){
+ if (pars.HasArglist) {
+ // "__arglist is not valid in this context"
+ Report.Error (1669, lexer.Location, "__arglist is not valid in this context");
+ } else if (pars.FixedParameters == null && pars.ArrayParameter == null){
Report.Error (1551, lexer.Location, "Indexers must have at least one parameter");
}
- $$ = new IndexerDeclaration ((string) $1, (string) $2, pars);
+ MemberName name = (MemberName) $2;
+ $$ = new IndexerDeclaration ((Expression) $1, name, pars);
}
;
@@ -1649,29 +1954,25 @@ enum_declaration
{
Location enum_location = lexer.Location;
- string full_name = MakeName ((string) $4);
- Enum e = new Enum (current_container, (string) $5, (int) $2, full_name,
- (Attributes) $1, enum_location);
+ MemberName full_name = MakeName (new MemberName ((string) $4));
+ Enum e = new Enum (current_namespace, current_container, (Expression) $5, (int) $2,
+ full_name, (Attributes) $1, enum_location);
foreach (VariableDeclaration ev in (ArrayList) $6) {
- Location loc = (Location) ev.Location;
-
- CheckDef (e.AddEnumMember (ev.identifier,
- (Expression) ev.expression_or_array_initializer,
- loc, ev.OptAttributes),
- ev.identifier, loc);
+ e.AddEnumMember (ev.identifier,
+ (Expression) ev.expression_or_array_initializer,
+ ev.Location, ev.OptAttributes);
}
- e.Namespace = current_namespace;
-
- CheckDef (current_container.AddEnum (e), full_name, enum_location);
- RootContext.Tree.RecordDecl (full_name, e);
+ string name = full_name.GetName ();
+ current_container.AddEnum (e);
+ RootContext.Tree.RecordDecl (name, e);
}
;
opt_enum_base
- : /* empty */ { $$ = "System.Int32"; }
+ : /* empty */ { $$ = TypeManager.system_int32_expr; }
| COLON type { $$ = $2; }
;
@@ -1683,14 +1984,14 @@ enum_body
;
opt_enum_member_declarations
- : /* empty */ { $$ = new ArrayList (); }
+ : /* empty */ { $$ = new ArrayList (4); }
| enum_member_declarations opt_comma { $$ = $1; }
;
enum_member_declarations
: enum_member_declaration
{
- ArrayList l = new ArrayList ();
+ ArrayList l = new ArrayList (4);
l.Add ($1);
$$ = l;
@@ -1723,45 +2024,47 @@ enum_member_declaration
delegate_declaration
: opt_attributes
opt_modifiers
- DELEGATE type
- IDENTIFIER OPEN_PARENS
- opt_formal_parameter_list
- CLOSE_PARENS
+ DELEGATE type member_name
+ OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
SEMICOLON
{
Location l = lexer.Location;
- Delegate del = new Delegate (current_container, (string) $4, (int) $2,
- MakeName ((string) $5), (Parameters) $7,
- (Attributes) $1, l);
-
- del.Namespace = current_namespace;
- CheckDef (current_container.AddDelegate (del), del.Name, l);
+ MemberName name = MakeName ((MemberName) $5);
+ Delegate del = new Delegate (current_namespace, current_container, (Expression) $4,
+ (int) $2, name, (Parameters) $7, (Attributes) $1, l);
+
+ current_container.AddDelegate (del);
+ RootContext.Tree.RecordDecl (name.GetName (true), del);
}
| opt_attributes
opt_modifiers
- DELEGATE VOID
- IDENTIFIER OPEN_PARENS
- opt_formal_parameter_list
- CLOSE_PARENS
+ DELEGATE VOID member_name
+ OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
SEMICOLON
{
Location l = lexer.Location;
+ MemberName name = MakeName ((MemberName) $5);
Delegate del = new Delegate (
- current_container,
- "System.Void", (int) $2, MakeName ((string) $5), (Parameters) $7,
- (Attributes) $1, l);
+ current_namespace, current_container,
+ TypeManager.system_void_expr, (int) $2, name,
+ (Parameters) $7, (Attributes) $1, l);
- del.Namespace = current_namespace;
- CheckDef (current_container.AddDelegate (del), del.Name, l);
+ current_container.AddDelegate (del);
+ RootContext.Tree.RecordDecl (name.GetName (true), del);
}
;
-type_name
- : namespace_or_type_name
+namespace_or_type_name
+ : member_name
+ | namespace_or_type_name DOT IDENTIFIER {
+ $$ = new MemberName ((MemberName) $1, (string) $3);
+ }
;
-namespace_or_type_name
- : qualified_identifier
+member_name
+ : IDENTIFIER {
+ $$ = new MemberName ((string) $1);
+ }
;
/*
@@ -1771,12 +2074,9 @@ namespace_or_type_name
* gets rid of a shift/reduce couple
*/
type
- : type_name { /* class_type */
- /*
- This does interfaces, delegates, struct_types, class_types,
- parent classes, and more! 4.2
- */
- $$ = $1;
+ : namespace_or_type_name
+ {
+ $$ = ((MemberName) $1).GetTypeExpression (lexer.Location);
}
| builtin_types
| array_type
@@ -1792,19 +2092,16 @@ pointer_type
// can't perform checks during this phase - we do it during
// semantic analysis.
//
- $$ = (string) $1 + "*";
+ $$ = new ComposedCast ((Expression) $1, "*", lexer.Location);
}
| VOID STAR
{
- $$ = "System.Void*";
+ $$ = new ComposedCast (TypeManager.system_void_expr, "*", lexer.Location);
}
;
non_expression_type
: builtin_types
- {
- $$ = new SimpleName ((string) $1, lexer.Location);
- }
| non_expression_type rank_specifier
{
$$ = new ComposedCast ((Expression) $1, (string) $2, lexer.Location);
@@ -1821,12 +2118,21 @@ non_expression_type
{
$$ = new ComposedCast ((Expression) $1, "*", lexer.Location);
}
+
+ //
+ // We need this because the parser will happily go and reduce IDENTIFIER STAR
+ // through this different path
+ //
+ | multiplicative_expression STAR
+ {
+ $$ = new ComposedCast ((Expression) $1, "*", lexer.Location);
+ }
;
type_list
: type
{
- ArrayList types = new ArrayList ();
+ ArrayList types = new ArrayList (4);
types.Add ($1);
$$ = types;
@@ -1845,36 +2151,32 @@ type_list
* simple types, but we need this to reuse it easily in local_variable_type
*/
builtin_types
- : OBJECT { $$ = "System.Object"; }
- | STRING { $$ = "System.String"; }
- | BOOL { $$ = "System.Boolean"; }
- | DECIMAL { $$ = "System.Decimal"; }
- | FLOAT { $$ = "System.Single"; }
- | DOUBLE { $$ = "System.Double"; }
+ : OBJECT { $$ = TypeManager.system_object_expr; }
+ | STRING { $$ = TypeManager.system_string_expr; }
+ | BOOL { $$ = TypeManager.system_boolean_expr; }
+ | DECIMAL { $$ = TypeManager.system_decimal_expr; }
+ | FLOAT { $$ = TypeManager.system_single_expr; }
+ | DOUBLE { $$ = TypeManager.system_double_expr; }
| integral_type
;
integral_type
- : SBYTE { $$ = "System.SByte"; }
- | BYTE { $$ = "System.Byte"; }
- | SHORT { $$ = "System.Int16"; }
- | USHORT { $$ = "System.UInt16"; }
- | INT { $$ = "System.Int32"; }
- | UINT { $$ = "System.UInt32"; }
- | LONG { $$ = "System.Int64"; }
- | ULONG { $$ = "System.UInt64"; }
- | CHAR { $$ = "System.Char"; }
- | VOID { $$ = "System.Void"; }
- ;
-
-interface_type
- : type_name
+ : SBYTE { $$ = TypeManager.system_sbyte_expr; }
+ | BYTE { $$ = TypeManager.system_byte_expr; }
+ | SHORT { $$ = TypeManager.system_int16_expr; }
+ | USHORT { $$ = TypeManager.system_uint16_expr; }
+ | INT { $$ = TypeManager.system_int32_expr; }
+ | UINT { $$ = TypeManager.system_uint32_expr; }
+ | LONG { $$ = TypeManager.system_int64_expr; }
+ | ULONG { $$ = TypeManager.system_uint64_expr; }
+ | CHAR { $$ = TypeManager.system_char_expr; }
+ | VOID { $$ = TypeManager.system_void_expr; }
;
array_type
: type rank_specifiers
{
- $$ = (string) $1 + (string) $2;
+ $$ = new ComposedCast ((Expression) $1, (string) $2, lexer.Location);
}
;
@@ -1887,12 +2189,9 @@ primary_expression
// 7.5.1: Literals
}
- | qualified_identifier
+ | member_name
{
- string name = (string) $1;
-
- $$ = null;
- $$ = DecomposeQI (name, lexer.Location);
+ $$ = ((MemberName) $1).GetTypeExpression (lexer.Location);
}
| parenthesized_expression
| member_access
@@ -1908,8 +2207,7 @@ primary_expression
| checked_expression
| unchecked_expression
| pointer_member_access
- // TODO: pointer_element_access
- // TODO: sizeof-expression
+ | anonymous_method_expression
;
literal
@@ -1931,13 +2229,16 @@ integer_literal
: LITERAL_INTEGER {
object v = lexer.Value;
- //
- // FIXME: Possible optimization would be to
- // compute the *Literal objects directly in the scanner
- //
- if (v is int)
- $$ = new IntLiteral ((Int32) v);
- else if (v is uint)
+ if (v is int){
+ int i = (int) v;
+
+ if (i == 0)
+ $$ = IntLiteral.Zero;
+ else if (i == 1)
+ $$ = IntLiteral.One;
+ else
+ $$ = new IntLiteral (i);
+ } else if (v is uint)
$$ = new UIntLiteral ((UInt32) v);
else if (v is long)
$$ = new LongLiteral ((Int64) v);
@@ -1953,11 +2254,31 @@ boolean_literal
| FALSE { $$ = new BoolLiteral (false); }
;
-parenthesized_expression
+parenthesized_expression_0
: OPEN_PARENS expression CLOSE_PARENS
- { $$ = $2; }
+ {
+ $$ = $2;
+ lexer.Deambiguate_CloseParens ();
+ // After this, the next token returned is one of
+ // CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST, CLOSE_PARENS_OPEN_PARENS
+ // or CLOSE_PARENS_MINUS.
+ }
;
+parenthesized_expression
+ : parenthesized_expression_0 CLOSE_PARENS_NO_CAST
+ {
+ $$ = $1;
+ }
+ | parenthesized_expression_0 CLOSE_PARENS_MINUS
+ {
+ // If a parenthesized expression is followed by a minus, we need to wrap
+ // the expression inside a ParenthesizedExpression for the CS0075 check
+ // in Binary.DoResolve().
+ $$ = new ParenthesizedExpression ((Expression) $1, lexer.Location);
+ }
+ ;;
+
member_access
: primary_expression DOT IDENTIFIER
{
@@ -1965,7 +2286,7 @@ member_access
}
| predefined_type DOT IDENTIFIER
{
- $$ = new MemberAccess (new SimpleName ((string) $1, lexer.Location), (string) $3, lexer.Location);
+ $$ = new MemberAccess ((Expression) $1, (string) $3, lexer.Location);
}
;
@@ -1978,11 +2299,19 @@ invocation_expression
{
if ($1 == null) {
Location l = lexer.Location;
- Report.Error (1, l, "THIS IS CRAZY");
+ Report.Error (1, l, "Parse error");
}
$$ = new Invocation ((Expression) $1, (ArrayList) $3, lexer.Location);
}
- ;
+ | parenthesized_expression_0 CLOSE_PARENS_OPEN_PARENS OPEN_PARENS CLOSE_PARENS
+ {
+ $$ = new Invocation ((Expression) $1, new ArrayList (), lexer.Location);
+ }
+ | parenthesized_expression_0 CLOSE_PARENS_OPEN_PARENS primary_expression
+ {
+ $$ = new InvocationOrCast ((Expression) $1, (Expression) $3, lexer.Location);
+ }
+ ;
opt_argument_list
: /* empty */ { $$ = null; }
@@ -1990,9 +2319,9 @@ opt_argument_list
;
argument_list
- : argument
+ : argument
{
- ArrayList list = new ArrayList ();
+ ArrayList list = new ArrayList (4);
list.Add ($1);
$$ = list;
}
@@ -2002,6 +2331,9 @@ argument_list
list.Add ($3);
$$ = list;
}
+ | argument_list error {
+ CheckToken (1026, yyToken, ", or ) expected");
+ }
;
argument
@@ -2017,6 +2349,19 @@ argument
{
$$ = new Argument ((Expression) $2, Argument.AType.Out);
}
+ | ARGLIST OPEN_PARENS argument_list CLOSE_PARENS
+ {
+ ArrayList list = (ArrayList) $3;
+ Argument[] args = new Argument [list.Count];
+ list.CopyTo (args, 0);
+
+ Expression expr = new Arglist (args, lexer.Location);
+ $$ = new Argument (expr, Argument.AType.Expression);
+ }
+ | ARGLIST
+ {
+ $$ = new Argument (new ArglistAccess (lexer.Location), Argument.AType.ArgList);
+ }
;
variable_reference
@@ -2038,24 +2383,25 @@ element_access
// Blah i;
Expression expr = (Expression) $1;
- if (!(expr is SimpleName || expr is MemberAccess)) {
- Location l = lexer.Location;
- Report.Error (-1, l, "Invalid Type definition");
- $$ = "System.Object";
+ if (expr is ComposedCast){
+ $$ = new ComposedCast (expr, (string) $2, lexer.Location);
+ } else if (!(expr is SimpleName || expr is MemberAccess)){
+ Error_ExpectingTypeName (lexer.Location, expr);
+ $$ = TypeManager.system_object_expr;
+ } else {
+ //
+ // So we extract the string corresponding to the SimpleName
+ // or MemberAccess
+ //
+ $$ = new ComposedCast (expr, (string) $2, lexer.Location);
}
-
- //
- // So we extract the string corresponding to the SimpleName
- // or MemberAccess
- //
- $$ = new SimpleName (GetQualifiedIdentifier (expr) + (string) $2, lexer.Location);
}
;
expression_list
: expression
{
- ArrayList list = new ArrayList ();
+ ArrayList list = new ArrayList (4);
list.Add ($1);
$$ = list;
}
@@ -2070,7 +2416,7 @@ expression_list
this_access
: THIS
{
- $$ = new This (lexer.Location);
+ $$ = new This (current_block, lexer.Location);
}
;
@@ -2083,6 +2429,10 @@ base_access
{
$$ = new BaseIndexerAccess ((ArrayList) $3, lexer.Location);
}
+ | BASE error {
+ Report.Error (175, lexer.Location, "Use of keyword `base' is not valid in this context");
+ $$ = null;
+ }
;
post_increment_expression
@@ -2109,7 +2459,7 @@ new_expression
object_or_delegate_creation_expression
: NEW type OPEN_PARENS opt_argument_list CLOSE_PARENS
{
- $$ = new New ((string) $2, (ArrayList) $4, lexer.Location);
+ $$ = new New ((Expression) $2, (ArrayList) $4, lexer.Location);
}
;
@@ -2118,12 +2468,17 @@ array_creation_expression
opt_rank_specifier
opt_array_initializer
{
- $$ = new ArrayCreation ((string) $2, (ArrayList) $4, (string) $6, (ArrayList) $7, lexer.Location);
+ $$ = new ArrayCreation ((Expression) $2, (ArrayList) $4, (string) $6, (ArrayList) $7, lexer.Location);
}
| NEW type rank_specifiers array_initializer
{
- $$ = new ArrayCreation ((string) $2, (string) $3, (ArrayList) $4, lexer.Location);
+ $$ = new ArrayCreation ((Expression) $2, (string) $3, (ArrayList) $4, lexer.Location);
}
+ | NEW error
+ {
+ Report.Error (1031, lexer.Location, "Type expected");
+ $$ = null;
+ }
| NEW type error
{
Report.Error (1526, lexer.Location, "new expression requires () or [] after type");
@@ -2142,14 +2497,10 @@ opt_rank_specifier
;
rank_specifiers
- : rank_specifier
- {
- $$ = $1;
- }
- | rank_specifiers rank_specifier
+ : rank_specifier opt_rank_specifier
{
$$ = (string) $2 + (string) $1;
- }
+ }
;
rank_specifier
@@ -2195,7 +2546,7 @@ opt_array_initializer
array_initializer
: OPEN_BRACE CLOSE_BRACE
{
- ArrayList list = new ArrayList ();
+ ArrayList list = new ArrayList (4);
$$ = list;
}
| OPEN_BRACE variable_initializer_list opt_comma CLOSE_BRACE
@@ -2207,7 +2558,7 @@ array_initializer
variable_initializer_list
: variable_initializer
{
- ArrayList list = new ArrayList ();
+ ArrayList list = new ArrayList (4);
list.Add ($1);
$$ = list;
}
@@ -2220,32 +2571,33 @@ variable_initializer_list
;
typeof_expression
- : TYPEOF OPEN_PARENS type CLOSE_PARENS
+ : TYPEOF OPEN_PARENS VOID CLOSE_PARENS
+ {
+ $$ = new TypeOfVoid (lexer.Location);
+ }
+ | TYPEOF OPEN_PARENS type CLOSE_PARENS
{
- $$ = new TypeOf ((string) $3, lexer.Location);
+ $$ = new TypeOf ((Expression) $3, lexer.Location);
}
;
sizeof_expression
: SIZEOF OPEN_PARENS type CLOSE_PARENS {
- $$ = new SizeOf ((string) $3, lexer.Location);
-
- note ("Verify type is unmanaged");
- note ("if (5.8) builtin, yield constant expression");
+ $$ = new SizeOf ((Expression) $3, lexer.Location);
}
;
checked_expression
: CHECKED OPEN_PARENS expression CLOSE_PARENS
{
- $$ = new CheckedExpr ((Expression) $3);
+ $$ = new CheckedExpr ((Expression) $3, lexer.Location);
}
;
unchecked_expression
: UNCHECKED OPEN_PARENS expression CLOSE_PARENS
{
- $$ = new UnCheckedExpr ((Expression) $3);
+ $$ = new UnCheckedExpr ((Expression) $3, lexer.Location);
}
;
@@ -2257,6 +2609,84 @@ pointer_member_access
deref = new Unary (Unary.Operator.Indirection, (Expression) $1, lexer.Location);
$$ = new MemberAccess (deref, (string) $3, lexer.Location);
}
+ ;
+
+anonymous_method_expression
+ : DELEGATE opt_anonymous_method_signature {
+ oob_stack.Push (current_local_parameters);
+ current_local_parameters = (Parameters)$2;
+
+ // Force the next block to be created as a ToplevelBlock
+ oob_stack.Push (current_block);
+ oob_stack.Push (top_current_block);
+ oob_stack.Push (lexer.Location);
+ current_block = null;
+ } block {
+ Location loc = (Location) oob_stack.Pop ();
+ top_current_block = (Block) oob_stack.Pop ();
+ current_block = (Block) oob_stack.Pop ();
+ if (RootContext.Version == LanguageVersion.ISO_1){
+ Report.FeatureIsNotStandardized (lexer.Location, "anonymous methods");
+ $$ = null;
+ } else {
+ ToplevelBlock anon_block = (ToplevelBlock) $4;
+
+ anon_block.Parent = current_block;
+ $$ = new AnonymousMethod ((Parameters) $2, (ToplevelBlock) top_current_block,
+ anon_block, loc);
+ }
+ current_local_parameters = (Parameters) oob_stack.Pop ();
+ }
+ ;
+
+opt_anonymous_method_signature
+ : /* empty */ { $$ = null; }
+ | anonymous_method_signature
+ ;
+
+anonymous_method_signature
+ : OPEN_PARENS opt_anonymous_method_parameter_list CLOSE_PARENS
+ {
+ if ($2 == null)
+ $$ = Parameters.EmptyReadOnlyParameters;
+ else {
+ ArrayList par_list = (ArrayList) $2;
+ Parameter [] pars = new Parameter [par_list.Count];
+ par_list.CopyTo (pars);
+ $$ = new Parameters (pars, null, lexer.Location);
+ }
+ }
+ ;
+
+opt_anonymous_method_parameter_list
+ : /* empty */ { $$ = null; }
+ | anonymous_method_parameter_list { $$ = $1; }
+ ;
+
+anonymous_method_parameter_list
+ : anonymous_method_parameter
+ {
+ ArrayList a = new ArrayList (4);
+ a.Add ($1);
+ $$ = a;
+ }
+ | anonymous_method_parameter_list COMMA anonymous_method_parameter
+ {
+ ArrayList a = (ArrayList) $1;
+ a.Add ($3);
+ $$ = a;
+ }
+ ;
+
+anonymous_method_parameter
+ : opt_parameter_modifier type IDENTIFIER {
+ $$ = new Parameter ((Expression) $2, (string) $3, (Parameter.Modifier) $1, null);
+ }
+ | PARAMS type IDENTIFIER {
+ Report.Error (-221, lexer.Location, "params modifier not allowed in anonymous method declaration");
+ $$ = null;
+ }
+ ;
unary_expression
: primary_expression
@@ -2268,13 +2698,25 @@ unary_expression
{
$$ = new Unary (Unary.Operator.OnesComplement, (Expression) $2, lexer.Location);
}
- | OPEN_PARENS expression CLOSE_PARENS unary_expression
+ | cast_expression
+ ;
+
+cast_list
+ : parenthesized_expression_0 CLOSE_PARENS_CAST unary_expression
{
- $$ = new Cast ((Expression) $2, (Expression) $4, lexer.Location);
+ $$ = new Cast ((Expression) $1, (Expression) $3, lexer.Location);
}
- | OPEN_PARENS non_expression_type CLOSE_PARENS prefixed_unary_expression
+ | parenthesized_expression_0 CLOSE_PARENS_OPEN_PARENS cast_expression
+ {
+ $$ = new Cast ((Expression) $1, (Expression) $3, lexer.Location);
+ }
+ ;
+
+cast_expression
+ : cast_list
+ | OPEN_PARENS non_expression_type CLOSE_PARENS prefixed_unary_expression
{
- $$ = new Cast ((Expression) $2, (Expression) $4, lexer.Location);
+ $$ = new Cast ((Expression) $2, (Expression) $4, lexer.Location);
}
;
@@ -2399,11 +2841,11 @@ relational_expression
}
| relational_expression IS type
{
- $$ = new Is ((Expression) $1, (string) $3, lexer.Location);
+ $$ = new Is ((Expression) $1, (Expression) $3, lexer.Location);
}
| relational_expression AS type
{
- $$ = new As ((Expression) $1, (string) $3, lexer.Location);
+ $$ = new As ((Expression) $1, (Expression) $3, lexer.Location);
}
;
@@ -2570,35 +3012,65 @@ boolean_expression
class_declaration
: opt_attributes
opt_modifiers
- CLASS IDENTIFIER
+ opt_partial
+ CLASS member_name
{
- Class new_class;
- string name;
+ MemberName name = MakeName ((MemberName) $5);
+ bool partial = (bool) $3;
+ int mod_flags = (int) $2;
- name = MakeName ((string) $4);
+ if (partial) {
+ ClassPart part = PartialContainer.CreatePart (
+ current_namespace, current_container, name, mod_flags,
+ (Attributes) $1, Kind.Class, lexer.Location);
- new_class = new Class (current_container, name, (int) $2,
- (Attributes) $1, lexer.Location);
- current_container = new_class;
- current_container.Namespace = current_namespace;
- RootContext.Tree.RecordDecl (name, new_class);
+ current_container = part.PartialContainer;
+ current_class = part;
+ } else {
+ if ((mod_flags & Modifiers.STATIC) != 0) {
+ current_class = new StaticClass (
+ current_namespace, current_container, name,
+ mod_flags, (Attributes) $1, lexer.Location);
+ } else {
+ current_class = new Class (
+ current_namespace, current_container, name,
+ mod_flags, (Attributes) $1, lexer.Location);
+ }
+
+ current_container = current_class;
+ RootContext.Tree.RecordDecl (name.GetName (true), current_class);
+ }
}
opt_class_base
+ {
+ if ($7 != null) {
+ if (current_class.Name == "System.Object") {
+ Report.Error (537, current_class.Location,
+ "The class System.Object cannot have a base " +
+ "class or implement an interface.");
+ }
+ current_class.Bases = (ArrayList) $7;
+ }
+
+ current_class.Register ();
+ }
class_body
opt_semicolon
{
- Class new_class = (Class) current_container;
-
- if ($6 != null)
- new_class.Bases = (ArrayList) $6;
+ $$ = current_class;
current_container = current_container.Parent;
- CheckDef (current_container.AddClass (new_class), new_class.Name, new_class.Location);
-
- $$ = new_class;
+ current_class = current_container;
}
;
+opt_partial
+ : /* empty */
+ { $$ = (bool) false; }
+ | PARTIAL
+ { $$ = (bool) true; }
+ ;
+
opt_modifiers
: /* empty */ { $$ = (int) 0; }
| modifiers
@@ -2661,7 +3133,13 @@ class_base
block
: OPEN_BRACE
{
- current_block = new Block (current_block, lexer.Location, Location.Null);
+ if (current_block == null){
+ current_block = new ToplevelBlock ((ToplevelBlock) top_current_block, current_local_parameters, lexer.Location);
+ top_current_block = current_block;
+ } else {
+ current_block = new Block (current_block, current_local_parameters,
+ lexer.Location, Location.Null);
+ }
}
opt_statement_list CLOSE_BRACE
{
@@ -2670,6 +3148,8 @@ block
$$ = current_block;
current_block.SetEndLocation (lexer.Location);
current_block = current_block.Parent;
+ if (current_block == null)
+ top_current_block = null;
}
;
@@ -2686,22 +3166,19 @@ statement_list
statement
: declaration_statement
{
- if ((Block) $1 != current_block){
+ if ($1 != null && (Block) $1 != current_block){
current_block.AddStatement ((Statement) $1);
current_block = (Block) $1;
}
}
- | embedded_statement
+ | valid_declaration_statement
{
- Statement s = (Statement) $1;
-
-
current_block.AddStatement ((Statement) $1);
}
| labeled_statement
;
-embedded_statement
+valid_declaration_statement
: block
| empty_statement
| expression_statement
@@ -2717,23 +3194,34 @@ embedded_statement
| fixed_statement
;
+embedded_statement
+ : valid_declaration_statement
+ | declaration_statement
+ {
+ Report.Error (1023, lexer.Location, "An embedded statement may not be a declaration.");
+ $$ = null;
+ }
+ | labeled_statement
+ {
+ Report.Error (1023, lexer.Location, "An embedded statement may not be a labeled statement.");
+ $$ = null;
+ }
+ ;
+
empty_statement
: SEMICOLON
{
- $$ = new EmptyStatement ();
+ $$ = EmptyStatement.Value;
}
;
labeled_statement
: IDENTIFIER COLON
{
- LabeledStatement labeled = new LabeledStatement ((string) $1);
+ LabeledStatement labeled = new LabeledStatement ((string) $1, lexer.Location);
- if (!current_block.AddLabel ((string) $1, labeled)){
- Location l = lexer.Location;
- Report.Error (140, l, "The label '" + ((string) $1) + "' is a duplicate");
- }
- current_block.AddStatement (labeled);
+ if (current_block.AddLabel ((string) $1, labeled, lexer.Location))
+ current_block.AddStatement (labeled);
}
statement
;
@@ -2741,16 +3229,20 @@ labeled_statement
declaration_statement
: local_variable_declaration SEMICOLON
{
- DictionaryEntry de = (DictionaryEntry) $1;
+ if ($1 != null){
+ DictionaryEntry de = (DictionaryEntry) $1;
- $$ = declare_local_variables ((string) de.Key, (ArrayList) de.Value, lexer.Location);
+ $$ = declare_local_variables ((Expression) de.Key, (ArrayList) de.Value, lexer.Location);
+ }
}
| local_constant_declaration SEMICOLON
{
- DictionaryEntry de = (DictionaryEntry) $1;
+ if ($1 != null){
+ DictionaryEntry de = (DictionaryEntry) $1;
- $$ = declare_local_constant ((string) de.Key, (VariableDeclaration) de.Value);
+ $$ = declare_local_constants ((Expression) de.Key, (ArrayList) de.Value);
+ }
}
;
@@ -2768,7 +3260,7 @@ local_variable_type
// Ok, the above "primary_expression" is there to get rid of
// both reduce/reduce and shift/reduces in the grammar, it should
// really just be "type_name". If you use type_name, a reduce/reduce
- // creeps up. If you use qualified_identifier (which is all we need
+ // creeps up. If you use namespace_or_type_name (which is all we need
// really) two shift/reduces appear.
//
@@ -2780,21 +3272,27 @@ local_variable_type
// Blah i;
Expression expr = (Expression) $1;
- if (!(expr is SimpleName || expr is MemberAccess)) {
- Location l = lexer.Location;
- Report.Error (-1, l, "Invalid Type definition");
- $$ = "System.Object";
+ if (!(expr is SimpleName || expr is MemberAccess || expr is ComposedCast)) {
+ Error_ExpectingTypeName (lexer.Location, expr);
+ $$ = null;
+ } else {
+ //
+ // So we extract the string corresponding to the SimpleName
+ // or MemberAccess
+ //
+
+ if ((string) $2 == "")
+ $$ = $1;
+ else
+ $$ = new ComposedCast ((Expression) $1, (string) $2, lexer.Location);
}
-
- //
- // So we extract the string corresponding to the SimpleName
- // or MemberAccess
- //
- $$ = GetQualifiedIdentifier (expr) + (string) $2;
}
| builtin_types opt_rank_specifier
{
- $$ = (string) $1 + (string) $2;
+ if ((string) $2 == "")
+ $$ = $1;
+ else
+ $$ = new ComposedCast ((Expression) $1, (string) $2, lexer.Location);
}
;
@@ -2802,43 +3300,59 @@ local_variable_pointer_type
: primary_expression STAR
{
Expression expr = (Expression) $1;
- if (!(expr is SimpleName || expr is MemberAccess)) {
- Location l = lexer.Location;
- Report.Error (-1, l, "Invalid Type definition");
- $$ = "System.Object";
- }
-
- $$ = GetQualifiedIdentifier (expr) + "*";
+ Location l = lexer.Location;
+
+ if (!(expr is SimpleName || expr is MemberAccess || expr is ComposedCast)) {
+ Error_ExpectingTypeName (l, expr);
+
+ $$ = null;
+ } else
+ $$ = new ComposedCast ((Expression) $1, "*", l);
}
| builtin_types STAR
{
- $$ = (string) $1 + "*";
+ $$ = new ComposedCast ((Expression) $1, "*", lexer.Location);;
}
| VOID STAR
{
- $$ = "System.Void*";
+ $$ = new ComposedCast (TypeManager.system_void_expr, "*", lexer.Location);;
}
| local_variable_pointer_type STAR
{
- $$ = (string) $1 + "*";
+ $$ = new ComposedCast ((Expression) $1, "*", lexer.Location);
}
;
local_variable_declaration
: local_variable_type variable_declarators
{
- $$ = new DictionaryEntry ($1, $2);
+ if ($1 != null)
+ $$ = new DictionaryEntry ($1, $2);
+ else
+ $$ = null;
}
| local_variable_pointer_type opt_rank_specifier variable_declarators
{
- $$ = new DictionaryEntry ((string) $1 + (string) $2, $3);
+ if ($1 != null){
+ Expression t;
+
+ if ((string) $2 == "")
+ t = (Expression) $1;
+ else
+ t = new ComposedCast ((Expression) $1, (string) $2, lexer.Location);
+ $$ = new DictionaryEntry (t, $3);
+ } else
+ $$ = null;
}
;
local_constant_declaration
- : CONST local_variable_type constant_declarator
+ : CONST local_variable_type constant_declarators
{
- $$ = new DictionaryEntry ($2, $3);
+ if ($2 != null)
+ $$ = new DictionaryEntry ($2, $3);
+ else
+ $$ = null;
}
;
@@ -2863,6 +3377,7 @@ statement_expression
| pre_decrement_expression { $$ = new StatementExpression ((ExpressionStatement) $1, lexer.Location); }
| error {
Report.Error (1002, lexer.Location, "Expecting `;'");
+ $$ = null;
}
;
@@ -2899,8 +3414,8 @@ if_statement_rest
$$ = new If ((Expression) $1, (Statement) $3, l);
if (RootContext.WarningLevel >= 3){
- if ($3 is EmptyStatement)
- Report.Warning (642, lexer.Location, "Possibly mistaken empty statement");
+ if ($3 == EmptyStatement.Value)
+ Report.Warning (642, lexer.Location, "Possible mistaken empty statement");
}
}
@@ -2917,11 +3432,13 @@ switch_statement
: SWITCH OPEN_PARENS
{
oob_stack.Push (lexer.Location);
+ switch_stack.Push (current_block);
}
expression CLOSE_PARENS
switch_block
{
$$ = new Switch ((Expression) $4, (ArrayList) $6, (Location) oob_stack.Pop ());
+ current_block = (Block) switch_stack.Pop ();
}
;
@@ -2945,7 +3462,7 @@ opt_switch_sections
switch_sections
: switch_section
{
- ArrayList sections = new ArrayList ();
+ ArrayList sections = new ArrayList (4);
sections.Add ($1);
$$ = sections;
@@ -2962,21 +3479,22 @@ switch_sections
switch_section
: switch_labels
{
- current_block = new Block (current_block);
+ current_block = current_block.CreateSwitchBlock (lexer.Location);
}
statement_list
{
- while (current_block.Implicit)
- current_block = current_block.Parent;
- $$ = new SwitchSection ((ArrayList) $1, current_block);
- current_block = current_block.Parent;
+ Block topmost = current_block;
+
+ while (topmost.Implicit)
+ topmost = topmost.Parent;
+ $$ = new SwitchSection ((ArrayList) $1, topmost);
}
;
switch_labels
: switch_label
{
- ArrayList labels = new ArrayList ();
+ ArrayList labels = new ArrayList (4);
labels.Add ($1);
$$ = labels;
@@ -3018,17 +3536,22 @@ while_statement
$$ = new While ((Expression) $4, (Statement) $6, l);
if (RootContext.WarningLevel >= 3){
- if ($6 is EmptyStatement)
- Report.Warning (642, lexer.Location, "Possibly mistaken empty statement");
+ if ($6 == EmptyStatement.Value)
+ Report.Warning (642, lexer.Location, "Possible mistaken empty statement");
}
}
;
do_statement
: DO embedded_statement
- WHILE OPEN_PARENS boolean_expression CLOSE_PARENS SEMICOLON
+ WHILE OPEN_PARENS {
+ oob_stack.Push (lexer.Location);
+ }
+ boolean_expression CLOSE_PARENS SEMICOLON
{
- $$ = new Do ((Statement) $2, (Expression) $5, lexer.Location);
+ Location l = (Location) oob_stack.Pop ();
+
+ $$ = new Do ((Statement) $2, (Expression) $6, l);
}
;
@@ -3042,39 +3565,33 @@ for_statement
if ($3 is DictionaryEntry){
DictionaryEntry de = (DictionaryEntry) $3;
- string type = (string) de.Key;
+ Expression type = (Expression) de.Key;
ArrayList var_declarators = (ArrayList) de.Value;
foreach (VariableDeclaration decl in var_declarators){
- VariableInfo vi;
+ LocalInfo vi;
vi = current_block.AddVariable (
type, decl.identifier, current_local_parameters, decl.Location);
- if (vi == null){
- Report.Error (128, decl.Location,
- "A local variable `" + decl.identifier +
- "' is already defined in this scope");
+ if (vi == null)
+ continue;
+
+ Location l = lexer.Location;
+ Expression expr;
+ if (decl.expression_or_array_initializer is Expression){
+ expr = (Expression) decl.expression_or_array_initializer;
+ } else if (decl.expression_or_array_initializer == null) {
+ expr = null;
} else {
- Location l = lexer.Location;
- Expression expr;
- if (decl.expression_or_array_initializer is Expression){
- expr = (Expression) decl.expression_or_array_initializer;
-
- } else {
-
- ArrayList init = (ArrayList) decl.expression_or_array_initializer;
-
- string base_type = type.Substring (0, type.IndexOf ("["));
- string rank = type.Substring (type.IndexOf ("["));
-
- expr = new ArrayCreation (base_type, rank, init, decl.Location);
- }
-
- LocalVariableReference var;
- var = new LocalVariableReference (
- assign_block, decl.identifier, l);
+ ArrayList init = (ArrayList) decl.expression_or_array_initializer;
+ expr = new ArrayCreation (type, "", init, decl.Location);
+ }
+ LocalVariableReference var;
+ var = new LocalVariableReference (assign_block, decl.identifier, l);
+
+ if (expr != null) {
Assign a = new Assign (var, expr, decl.Location);
assign_block.AddStatement (new StatementExpression (a, lexer.Location));
@@ -3094,8 +3611,8 @@ for_statement
For f = new For ((Statement) $3, (Expression) $6, (Statement) $8, (Statement) $10, l);
if (RootContext.WarningLevel >= 3){
- if ($10 is EmptyStatement)
- Report.Warning (642, lexer.Location, "Possibly mistaken empty statement");
+ if ($10 == EmptyStatement.Value)
+ Report.Warning (642, lexer.Location, "Possible mistaken empty statement");
}
current_block.AddStatement (f);
@@ -3107,7 +3624,7 @@ for_statement
;
opt_for_initializer
- : /* empty */ { $$ = new EmptyStatement (); }
+ : /* empty */ { $$ = EmptyStatement.Value; }
| for_initializer
;
@@ -3122,7 +3639,7 @@ opt_for_condition
;
opt_for_iterator
- : /* empty */ { $$ = new EmptyStatement (); }
+ : /* empty */ { $$ = EmptyStatement.Value; }
| for_iterator
;
@@ -3134,7 +3651,7 @@ statement_expression_list
: statement_expression
{
// CHANGE: was `null'
- Block b = new Block (current_block, true);
+ Block b = new Block (current_block, Block.Flags.Implicit);
b.AddStatement ((Statement) $1);
$$ = b;
@@ -3149,7 +3666,12 @@ statement_expression_list
;
foreach_statement
- : FOREACH OPEN_PARENS type IDENTIFIER IN
+ : FOREACH OPEN_PARENS type IN expression CLOSE_PARENS
+ {
+ Report.Error (230, lexer.Location, "Type and identifier are both required in a foreach statement");
+ $$ = null;
+ }
+ | FOREACH OPEN_PARENS type IDENTIFIER IN
{
oob_stack.Push (lexer.Location);
}
@@ -3157,20 +3679,18 @@ foreach_statement
{
oob_stack.Push (current_block);
- Block foreach_block = new Block (current_block, true);
- LocalVariableReference v;
+ Block foreach_block = new Block (current_block);
+ LocalVariableReference v = null;
Location l = lexer.Location;
- VariableInfo vi;
+ LocalInfo vi;
- vi = foreach_block.AddVariable ((string) $3, (string) $4, current_local_parameters, l);
- vi.ReadOnly = true;
- if (vi == null){
- Report.Error (
- 128, l, "A local variable `" + (string) $4 + "' is already "+
- "defined in this scope");
- }
+ vi = foreach_block.AddVariable ((Expression) $3, (string) $4, current_local_parameters, l);
+ if (vi != null) {
+ vi.ReadOnly = true;
- v = new LocalVariableReference (foreach_block, (string) $4, l);
+ // Get a writable reference to this read-only variable.
+ v = new LocalVariableReference (foreach_block, (string) $4, l, vi, false);
+ }
current_block = foreach_block;
oob_stack.Push (v);
@@ -3185,8 +3705,10 @@ foreach_statement
current_block = prev_block;
- Foreach f = new Foreach ((string) $3, v, (Expression) $7, (Statement) $10, l);
- foreach_block.AddStatement (f);
+ if (v != null) {
+ Foreach f = new Foreach ((Expression) $3, v, (Expression) $7, (Statement) $10, l);
+ foreach_block.AddStatement (f);
+ }
$$ = foreach_block;
}
@@ -3198,6 +3720,7 @@ jump_statement
| goto_statement
| return_statement
| throw_statement
+ | yield_statement
;
break_statement
@@ -3243,6 +3766,47 @@ throw_statement
}
;
+yield_statement
+ : IDENTIFIER RETURN expression SEMICOLON
+ {
+ string s = (string) $1;
+ if (s != "yield"){
+ Report.Error (1003, lexer.Location, "; expected");
+ $$ = null;
+ }
+ if (RootContext.Version == LanguageVersion.ISO_1){
+ Report.FeatureIsNotStandardized (lexer.Location, "yield statement");
+ $$ = null;
+ }
+ if (iterator_container == null){
+ Report.Error (204, lexer.Location, "yield statement can only be used within a method, operator or property");
+ $$ = null;
+ } else {
+ iterator_container.SetYields ();
+ $$ = new Yield ((Expression) $3, lexer.Location);
+ }
+ }
+ | IDENTIFIER BREAK SEMICOLON
+ {
+ string s = (string) $1;
+ if (s != "yield"){
+ Report.Error (1003, lexer.Location, "; expected");
+ $$ = null;
+ }
+ if (RootContext.Version == LanguageVersion.ISO_1){
+ Report.FeatureIsNotStandardized (lexer.Location, "yield statement");
+ $$ = null;
+ }
+ if (iterator_container == null){
+ Report.Error (204, lexer.Location, "yield statement can only be used within a method, operator or property");
+ $$ = null;
+ } else {
+ iterator_container.SetYields ();
+ $$ = new YieldBreak (lexer.Location);
+ }
+ }
+ ;
+
opt_expression
: /* empty */
| expression
@@ -3252,36 +3816,40 @@ try_statement
: TRY block catch_clauses
{
Catch g = null;
- ArrayList s = new ArrayList ();
- foreach (Catch cc in (ArrayList) $3) {
- if (cc.Type == null)
+ ArrayList c = (ArrayList)$3;
+ for (int i = 0; i < c.Count; ++i) {
+ Catch cc = (Catch) c [i];
+ if (cc.IsGeneral) {
+ if (i != c.Count - 1)
+ Report.Error (1017, cc.loc, "Empty catch block must be the last in a series of catch blocks");
g = cc;
- else
- s.Add (cc);
+ c.RemoveAt (i);
+ i--;
+ }
}
// Now s contains the list of specific catch clauses
// and g contains the general one.
- $$ = new Try ((Block) $2, s, g, null);
+ $$ = new Try ((Block) $2, c, g, null, ((Block) $2).loc);
}
| TRY block opt_catch_clauses FINALLY block
{
Catch g = null;
- ArrayList s = new ArrayList ();
+ ArrayList s = new ArrayList (4);
ArrayList catch_list = (ArrayList) $3;
if (catch_list != null){
foreach (Catch cc in catch_list) {
- if (cc.Type == null)
+ if (cc.IsGeneral)
g = cc;
else
s.Add (cc);
}
}
- $$ = new Try ((Block) $2, s, g, (Block) $5);
+ $$ = new Try ((Block) $2, s, g, (Block) $5, ((Block) $2).loc);
}
| TRY block error
{
@@ -3297,7 +3865,7 @@ opt_catch_clauses
catch_clauses
: catch_clause
{
- ArrayList l = new ArrayList ();
+ ArrayList l = new ArrayList (4);
l.Add ($1);
$$ = l;
@@ -3319,15 +3887,16 @@ opt_identifier
catch_clause
: CATCH opt_catch_args
{
- string type = null, id = null;
+ Expression type = null;
+ string id = null;
if ($2 != null) {
DictionaryEntry cc = (DictionaryEntry) $2;
- type = (string) cc.Key;
+ type = (Expression) cc.Key;
id = (string) cc.Value;
if (id != null){
- ArrayList one = new ArrayList ();
+ ArrayList one = new ArrayList (4);
Location loc = lexer.Location;
one.Add (new VariableDeclaration (id, null, loc));
@@ -3336,26 +3905,28 @@ catch_clause
current_block = new Block (current_block);
Block b = declare_local_variables (type, one, loc);
current_block = b;
-
-
}
}
} block {
- string type = null, id = null;
+ Expression type = null;
+ string id = null;
if ($2 != null){
DictionaryEntry cc = (DictionaryEntry) $2;
- type = (string) cc.Key;
+ type = (Expression) cc.Key;
id = (string) cc.Value;
if ($1 != null){
+ //
+ // FIXME: I can change this for an assignment.
+ //
while (current_block != (Block) $1)
current_block = current_block.Parent;
}
}
- $$ = new Catch (type, id , (Block) $4, lexer.Location);
+ $$ = new Catch (type, id , (Block) $4, ((Block) $4).loc);
}
;
@@ -3399,56 +3970,64 @@ unsafe_statement
fixed_statement
: FIXED OPEN_PARENS
- pointer_type fixed_pointer_declarators
+ type fixed_pointer_declarators
CLOSE_PARENS
{
- Block assign_block = new Block (current_block, true);
ArrayList list = (ArrayList) $4;
- string type = (string) $3;
+ Expression type = (Expression) $3;
Location l = lexer.Location;
int top = list.Count;
+ Block assign_block = new Block (current_block);
+ current_block = assign_block;
+
for (int i = 0; i < top; i++){
Pair p = (Pair) list [i];
- VariableInfo v;
+ LocalInfo v;
v = current_block.AddVariable (type, (string) p.First,current_local_parameters, l);
- if (v == null){
- Report.Error (
- 128, l, "A local variable `" + (string) p.First + "' is already "+
- "defined in this scope");
- }
+ if (v == null)
+ continue;
+
v.ReadOnly = true;
+ v.Pinned = true;
p.First = v;
list [i] = p;
}
- current_block.AddStatement (assign_block);
- current_block = assign_block;
- oob_stack.Push (assign_block);
+
oob_stack.Push (l);
}
embedded_statement
{
Location l = (Location) oob_stack.Pop ();
- Block assign_block = (Block) oob_stack.Pop ();
- ArrayList list = (ArrayList) $4;
- int top = list.Count;
+ Fixed f = new Fixed ((Expression) $3, (ArrayList) $4, (Statement) $7, l);
- $$ = new Fixed ((string) $3, (ArrayList) $4, (Statement) $7, l);
+ if (RootContext.WarningLevel >= 3){
+ if ($7 == EmptyStatement.Value)
+ Report.Warning (642, lexer.Location, "Possible mistaken empty statement");
+ }
+
+ current_block.AddStatement (f);
+ while (current_block.Implicit)
+ current_block = current_block.Parent;
+ $$ = current_block;
+ current_block = current_block.Parent;
}
;
fixed_pointer_declarators
: fixed_pointer_declarator {
- ArrayList declarators = new ArrayList ();
- declarators.Add ($1);
+ ArrayList declarators = new ArrayList (4);
+ if ($1 != null)
+ declarators.Add ($1);
$$ = declarators;
}
| fixed_pointer_declarators COMMA fixed_pointer_declarator
{
ArrayList declarators = (ArrayList) $1;
- declarators.Add ($3);
+ if ($3 != null)
+ declarators.Add ($3);
$$ = declarators;
}
;
@@ -3458,6 +4037,11 @@ fixed_pointer_declarator
{
$$ = new Pair ($1, $3);
}
+ | IDENTIFIER
+ {
+ Report.Error (210, lexer.Location, "You must provide an initializer in a fixed or using statement declaration");
+ $$ = null;
+ }
;
lock_statement
@@ -3483,43 +4067,36 @@ using_statement
DictionaryEntry de = (DictionaryEntry) $3;
Location l = lexer.Location;
- string type = (string) de.Key;
+ Expression type = (Expression) de.Key;
ArrayList var_declarators = (ArrayList) de.Value;
- foreach (VariableDeclaration decl in var_declarators){
- if (current_block.AddVariable (
- type, decl.identifier,
- current_local_parameters, decl.Location) == null){
- Report.Error (128, decl.Location,
- "A local variable `" + decl.identifier + "' is already" +
- "defined in this scope");
- }
- }
-
- ArrayList vars = new ArrayList ();
+ ArrayList vars = new ArrayList (4);
foreach (VariableDeclaration decl in var_declarators){
+ LocalInfo vi = current_block.AddVariable (
+ type, decl.identifier,
+ current_local_parameters, decl.Location);
+ if (vi == null)
+ continue;
+ vi.ReadOnly = true;
+
Expression expr;
if (decl.expression_or_array_initializer is Expression){
expr = (Expression) decl.expression_or_array_initializer;
-
} else {
-
ArrayList init = (ArrayList) decl.expression_or_array_initializer;
+ if (init == null) {
+ Report.Error (210, l, "You must provide an initializer in a fixed or using statement declaration");
+ }
- string base_type = type.Substring (0, type.IndexOf ("["));
- string rank = type.Substring (type.IndexOf ("["));
-
- expr = new ArrayCreation (base_type, rank, init, decl.Location);
+ expr = new ArrayCreation (type, "", init, decl.Location);
}
LocalVariableReference var;
- VariableInfo vi;
- var = new LocalVariableReference (assign_block, decl.identifier, l);
- vi = var.VariableInfo;
- vi.ReadOnly = true;
+ // Get a writable reference to this read-only variable.
+ var = new LocalVariableReference (assign_block, decl.identifier, l, vi, false);
// This is so that it is not a warning on using variables
vi.Used = true;
@@ -3572,16 +4149,34 @@ public class VariableDeclaration {
}
}
+/// <summary>
+/// Used to pass around interface property information
+/// </summary>
+public class InterfaceAccessorInfo {
+
+ public readonly Accessor Get, Set;
+
+ public InterfaceAccessorInfo (bool has_get, bool has_set,
+ Attributes get_attrs, Attributes set_attrs, Location get_loc, Location set_loc)
+ {
+ if (has_get)
+ Get = new Accessor (null, 0, get_attrs, get_loc);
+ if (has_set)
+ Set = new Accessor (null, 0, set_attrs, set_loc);
+ }
+}
+
+
// <summary>
// A class used to hold info about an indexer declarator
// </summary>
-
public class IndexerDeclaration {
- public string type;
- public string interface_type;
+ public Expression type;
+ public MemberName interface_type;
public Parameters param_list;
- public IndexerDeclaration (string type, string interface_type, Parameters param_list)
+ public IndexerDeclaration (Expression type, MemberName interface_type,
+ Parameters param_list)
{
this.type = type;
this.interface_type = interface_type;
@@ -3589,21 +4184,37 @@ public class IndexerDeclaration {
}
}
+//
+// We use this when we do not have an object in advance that is an IIteratorContainer
+//
+public class SimpleIteratorContainer : IIteratorContainer {
+ public bool Yields;
+
+ public static SimpleIteratorContainer Simple = new SimpleIteratorContainer ();
+
+ //
+ // Reset and return
+ //
+ public static SimpleIteratorContainer GetSimple () {
+ Simple.Yields = false;
+ return Simple;
+ }
+
+ public void SetYields () { Yields = true; }
+}
+
// <summary>
// A class used to hold info about an operator declarator
// </summary>
-
public class OperatorDeclaration {
public Operator.OpType optype;
- public string ret_type;
- public string arg1type;
- public string arg1name;
- public string arg2type;
- public string arg2name;
+ public Expression ret_type, arg1type, arg2type;
+ public string arg1name, arg2name;
public Location location;
- public OperatorDeclaration (Operator.OpType op, string ret_type, string arg1type, string arg1name,
- string arg2type, string arg2name, Location location)
+ public OperatorDeclaration (Operator.OpType op, Expression ret_type,
+ Expression arg1type, string arg1name,
+ Expression arg2type, string arg2name, Location location)
{
optype = op;
this.ret_type = ret_type;
@@ -3616,133 +4227,35 @@ public class OperatorDeclaration {
}
+void Error_ExpectingTypeName (Location l, Expression expr)
+{
+ if (expr is Invocation){
+ Report.Error (1002, l, "; expected");
+ } else {
+ Report.Error (-1, l, "Invalid Type definition");
+ }
+}
+
// <summary>
// Given the @class_name name, it creates a fully qualified name
// based on the containing declaration space
// </summary>
-string
-MakeName (string class_name)
+MemberName
+MakeName (MemberName class_name)
{
- string ns = current_namespace.Name;
- string container_name = current_container.Name;
+ string ns = current_namespace.FullName;
- if (container_name == ""){
+ if (current_container.Name == ""){
if (ns != "")
- return ns + "." + class_name;
+ return new MemberName (new MemberName (ns), class_name);
else
return class_name;
- } else
- return container_name + "." + class_name;
-}
-
-// <summary>
-// Used to report back to the user the result of a declaration
-// in the current declaration space
-// </summary>
-void
-CheckDef (AdditionResult result, string name, Location l)
-{
- if (result == AdditionResult.Success)
- return;
-
- switch (result){
- case AdditionResult.NameExists:
- Report.Error (102, l, "The container `" + current_container.Name +
- "' already contains a definition for `"+
- name + "'");
- break;
-
-
- //
- // This is handled only for static Constructors, because
- // in reality we handle these by the semantic analysis later
- //
- case AdditionResult.MethodExists:
- Report.Error (
- 111, l, "Class `"+current_container.Name+
- "' already defines a member called '" +
- name + "' with the same parameter types (more than one default constructor)");
- break;
-
- case AdditionResult.EnclosingClash:
- Report.Error (542, l, "Member names cannot be the same as their enclosing type");
- break;
-
- case AdditionResult.NotAConstructor:
- Report.Error (1520, l, "Class, struct, or interface method must have a return type");
- break;
- }
-}
-
-void
-CheckDef (bool result, string name, Location l)
-{
- if (result)
- return;
- CheckDef (AdditionResult.NameExists, name, l);
-}
-
-//
-// This routine should be removed soon. I am in the process of making
-// changes to never keep anything but SimpleNames during parsing, as
-// that breaks some kinds of code (documented in the ChangeLog).
-//
-Expression
-SimpleLookup (string name, Location loc)
-{
- //
- // we need to check against current_block not being null
- // as `expression' is allowed in argument_lists, which
- // do not exist inside a block.
- //
-
- if (current_local_parameters != null){
- int idx;
- Parameter par = current_local_parameters.GetParameterByName (name, out idx);
- if (par != null)
- return new ParameterReference (current_local_parameters, idx, name);
- }
-
- return null;
-}
-
-Expression DecomposeQI (string name, Location loc)
-{
- Expression o;
-
- if (name.IndexOf ('.') == -1){
- o = SimpleLookup (name, loc);
- if (o == null)
- return new SimpleName (name, loc);
- return o;
} else {
- int pos = name.LastIndexOf (".");
- string left = name.Substring (0, pos);
- string right = name.Substring (pos + 1);
-
- o = DecomposeQI (left, loc);
- return new MemberAccess (o, right, loc);
+ return new MemberName (current_container.MemberName, class_name);
}
}
-// <summary>
-// This method is used to get at the complete string representation of
-// a fully-qualified type name, hiding inside a MemberAccess ;-)
-// This is necessary because local_variable_type admits primary_expression
-// as the type of the variable. So we do some extra checking
-// </summary>
-string GetQualifiedIdentifier (Expression expr)
-{
- if (expr is SimpleName)
- return ((SimpleName)expr).Name;
- else if (expr is MemberAccess)
- return GetQualifiedIdentifier (((MemberAccess)expr).Expr) + "." + ((MemberAccess) expr).Identifier;
- else
- throw new Exception ("Expr has to be either SimpleName or MemberAccess! (" + expr + ")");
-
-}
-
-Block declare_local_variables (string type, ArrayList variable_declarators, Location loc)
+Block declare_local_variables (Expression type, ArrayList variable_declarators, Location loc)
{
Block implicit_block;
ArrayList inits = null;
@@ -3763,7 +4276,7 @@ Block declare_local_variables (string type, ArrayList variable_declarators, Loca
// int j = 1; int k = j + 1;
//
if (current_block.Used)
- implicit_block = new Block (current_block, true, loc, Location.Null);
+ implicit_block = new Block (current_block, Block.Flags.Implicit, loc, Location.Null);
else
implicit_block = current_block;
@@ -3772,12 +4285,9 @@ Block declare_local_variables (string type, ArrayList variable_declarators, Loca
if (implicit_block.AddVariable (type, decl.identifier, current_local_parameters, decl.Location) != null) {
if (decl.expression_or_array_initializer != null){
if (inits == null)
- inits = new ArrayList ();
+ inits = new ArrayList (4);
inits.Add (decl);
}
- } else {
- Report.Error (128, decl.Location, "A local variable `" + decl.identifier +
- "' is already defined in this scope");
}
}
@@ -3794,11 +4304,7 @@ Block declare_local_variables (string type, ArrayList variable_declarators, Loca
} else {
ArrayList init = (ArrayList) decl.expression_or_array_initializer;
- string base_type = type.Substring (0, type.IndexOf ("["));
- string rank = type.Substring (type.IndexOf ("["));
-
- expr = new ArrayCreation (base_type, rank, init, decl.Location);
-
+ expr = new ArrayCreation (type, "", init, decl.Location);
}
LocalVariableReference var;
@@ -3812,19 +4318,18 @@ Block declare_local_variables (string type, ArrayList variable_declarators, Loca
return implicit_block;
}
-Block declare_local_constant (string type, VariableDeclaration decl)
+Block declare_local_constants (Expression type, ArrayList declarators)
{
Block implicit_block;
if (current_block.Used)
- implicit_block = new Block (current_block, true);
+ implicit_block = new Block (current_block, Block.Flags.Implicit);
else
implicit_block = current_block;
- if (!(implicit_block.AddConstant (type, decl.identifier, (Expression) decl.expression_or_array_initializer,
- current_local_parameters, decl.Location))){
- Report.Error (128, decl.Location, "A local variable `" + decl.identifier +
- "' is already defined in this scope");
+ foreach (VariableDeclaration decl in declarators){
+ implicit_block.AddConstant (type, decl.identifier, (Expression) decl.expression_or_array_initializer,
+ current_local_parameters, decl.Location);
}
return implicit_block;
@@ -3834,7 +4339,7 @@ void CheckAttributeTarget (string a)
{
switch (a) {
- case "assembly" : case "field" : case "method" : case "param" : case "property" : case "type" :
+ case "assembly" : case "module" : case "field" : case "method" : case "param" : case "property" : case "type" :
return;
default :
@@ -3921,33 +4426,52 @@ public Tokenizer Lexer {
}
}
-public CSharpParser (string name, System.IO.Stream input, ArrayList defines)
+public CSharpParser (SeekableStreamReader reader, SourceFile file, ArrayList defines)
{
- current_namespace = new Namespace (null, "");
- this.name = name;
- this.input = input;
+ current_namespace = new NamespaceEntry (null, file, null, Location.Null);
+ this.name = file.Name;
+ this.file = file;
current_container = RootContext.Tree.Types;
- current_container.Namespace = current_namespace;
+ current_container.NamespaceEntry = current_namespace;
oob_stack = new Stack ();
+ switch_stack = new Stack ();
- lexer = new Tokenizer (input, name, defines);
+ lexer = new Tokenizer (reader, file, defines);
}
-public override void parse ()
+public void parse ()
{
try {
if (yacc_verbose_flag)
yyparse (lexer, new yydebug.yyDebugSimple ());
else
yyparse (lexer);
+ Tokenizer tokenizer = lexer as Tokenizer;
+ tokenizer.cleanup ();
} catch (Exception e){
- // Please do not remove this, it is used during debugging
- // of the grammar
+ //
+ // Removed for production use, use parser verbose to get the output.
//
- Console.WriteLine (lexer.location + " : Parsing error ");
- Console.WriteLine (e);
+ // Console.WriteLine (e);
+ Report.Error (-25, lexer.Location, "Parsing error");
+ if (Driver.parser_verbose)
+ Console.WriteLine (e);
}
}
+void CheckToken (int error, int yyToken, string msg)
+{
+ if (yyToken >= Token.FIRST_KEYWORD && yyToken <= Token.LAST_KEYWORD){
+ Report.Error (error, lexer.Location, String.Format ("{0}: `{1}' is a keyword", msg, yyNames [yyToken].ToLower ()));
+ return;
+ }
+ Report.Error (error, lexer.Location, msg);
+}
+
+void CheckIdentifierToken (int yyToken)
+{
+ CheckToken (1041, yyToken, "Identifier expected");
+}
+
/* end end end */
}
diff --git a/mcs/mcs/cs-tokenizer.cs b/mcs/mcs/cs-tokenizer.cs
index 1bdf9150e38..7c0ae198036 100755
--- a/mcs/mcs/cs-tokenizer.cs
+++ b/mcs/mcs/cs-tokenizer.cs
@@ -1,1547 +1,2052 @@
-//
-// cs-tokenizer.cs: The Tokenizer for the C# compiler
-// This also implements the preprocessor
-//
-// Author: Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-
-/*
- * TODO:
- * Make sure we accept the proper Unicode ranges, per the spec.
- * Report error 1032
-*/
-
-using System;
-using System.Text;
-using System.Collections;
-using System.IO;
-using System.Globalization;
-
-namespace Mono.CSharp
-{
- /// <summary>
- /// Tokenizer for C# source code.
- /// </summary>
-
- public class Tokenizer : yyParser.yyInput
- {
- StreamReader reader;
- public string ref_name;
- public int ref_line = 1;
- public int line = 1;
- public int col = 1;
- public int current_token;
- bool handle_get_set = false;
- bool handle_remove_add = false;
- bool handle_assembly = false;
-
- //
- // Whether tokens have been seen on this line
- //
- bool tokens_seen = false;
-
- //
- // Whether a token has been seen on the file
- // This is needed because `define' is not allowed to be used
- // after a token has been seen.
- //
- bool any_token_seen = false;
-
- //
- // Returns a verbose representation of the current location
- //
- public string location {
- get {
- string det;
-
- if (current_token == Token.ERROR)
- det = "detail: " + error_details;
- else
- det = "";
-
- // return "Line: "+line+" Col: "+col + "\n" +
- // "VirtLine: "+ref_line +
- // " Token: "+current_token + " " + det;
-
- return ref_name + " " + "(" + line + "," + col + "), Token:" + current_token + " " + det;
- }
- }
-
- public bool PropertyParsing {
- get {
- return handle_get_set;
- }
-
- set {
- handle_get_set = value;
- }
- }
-
- public bool AssemblyTargetParsing {
- get {
- return handle_assembly;
- }
-
- set {
- handle_assembly = value;
- }
- }
-
- public bool EventParsing {
- get {
- return handle_remove_add;
- }
-
- set {
- handle_remove_add = value;
- }
- }
-
- //
- // Class variables
- //
- static Hashtable keywords;
- static NumberStyles styles;
- static NumberFormatInfo csharp_format_info;
-
- //
- // Values for the associated token returned
- //
- int putback_char;
- Object val;
-
- //
- // Pre-processor
- //
- Hashtable defines;
-
- const int TAKING = 1;
- const int TAKEN_BEFORE = 2;
- const int ELSE_SEEN = 4;
- const int PARENT_TAKING = 8;
-
- //
- // pre-processor if stack state:
- //
- Stack ifstack;
-
- static System.Text.StringBuilder id_builder;
- static System.Text.StringBuilder string_builder;
- static System.Text.StringBuilder number_builder;
-
- //
- // Details about the error encoutered by the tokenizer
- //
- string error_details;
-
- public string error {
- get {
- return error_details;
- }
- }
-
- public int Line {
- get {
- return line;
- }
- }
-
- public int Col {
- get {
- return col;
- }
- }
-
- static void InitTokens ()
- {
- keywords = new Hashtable ();
-
- keywords.Add ("abstract", Token.ABSTRACT);
- keywords.Add ("as", Token.AS);
- keywords.Add ("add", Token.ADD);
- keywords.Add ("assembly", Token.ASSEMBLY);
- keywords.Add ("base", Token.BASE);
- keywords.Add ("bool", Token.BOOL);
- keywords.Add ("break", Token.BREAK);
- keywords.Add ("byte", Token.BYTE);
- keywords.Add ("case", Token.CASE);
- keywords.Add ("catch", Token.CATCH);
- keywords.Add ("char", Token.CHAR);
- keywords.Add ("checked", Token.CHECKED);
- keywords.Add ("class", Token.CLASS);
- keywords.Add ("const", Token.CONST);
- keywords.Add ("continue", Token.CONTINUE);
- keywords.Add ("decimal", Token.DECIMAL);
- keywords.Add ("default", Token.DEFAULT);
- keywords.Add ("delegate", Token.DELEGATE);
- keywords.Add ("do", Token.DO);
- keywords.Add ("double", Token.DOUBLE);
- keywords.Add ("else", Token.ELSE);
- keywords.Add ("enum", Token.ENUM);
- keywords.Add ("event", Token.EVENT);
- keywords.Add ("explicit", Token.EXPLICIT);
- keywords.Add ("extern", Token.EXTERN);
- keywords.Add ("false", Token.FALSE);
- keywords.Add ("finally", Token.FINALLY);
- keywords.Add ("fixed", Token.FIXED);
- keywords.Add ("float", Token.FLOAT);
- keywords.Add ("for", Token.FOR);
- keywords.Add ("foreach", Token.FOREACH);
- keywords.Add ("goto", Token.GOTO);
- keywords.Add ("get", Token.GET);
- keywords.Add ("if", Token.IF);
- keywords.Add ("implicit", Token.IMPLICIT);
- keywords.Add ("in", Token.IN);
- keywords.Add ("int", Token.INT);
- keywords.Add ("interface", Token.INTERFACE);
- keywords.Add ("internal", Token.INTERNAL);
- keywords.Add ("is", Token.IS);
- keywords.Add ("lock", Token.LOCK);
- keywords.Add ("long", Token.LONG);
- keywords.Add ("namespace", Token.NAMESPACE);
- keywords.Add ("new", Token.NEW);
- keywords.Add ("null", Token.NULL);
- keywords.Add ("object", Token.OBJECT);
- keywords.Add ("operator", Token.OPERATOR);
- keywords.Add ("out", Token.OUT);
- keywords.Add ("override", Token.OVERRIDE);
- keywords.Add ("params", Token.PARAMS);
- keywords.Add ("private", Token.PRIVATE);
- keywords.Add ("protected", Token.PROTECTED);
- keywords.Add ("public", Token.PUBLIC);
- keywords.Add ("readonly", Token.READONLY);
- keywords.Add ("ref", Token.REF);
- keywords.Add ("remove", Token.REMOVE);
- keywords.Add ("return", Token.RETURN);
- keywords.Add ("sbyte", Token.SBYTE);
- keywords.Add ("sealed", Token.SEALED);
- keywords.Add ("set", Token.SET);
- keywords.Add ("short", Token.SHORT);
- keywords.Add ("sizeof", Token.SIZEOF);
- keywords.Add ("stackalloc", Token.STACKALLOC);
- keywords.Add ("static", Token.STATIC);
- keywords.Add ("string", Token.STRING);
- keywords.Add ("struct", Token.STRUCT);
- keywords.Add ("switch", Token.SWITCH);
- keywords.Add ("this", Token.THIS);
- keywords.Add ("throw", Token.THROW);
- keywords.Add ("true", Token.TRUE);
- keywords.Add ("try", Token.TRY);
- keywords.Add ("typeof", Token.TYPEOF);
- keywords.Add ("uint", Token.UINT);
- keywords.Add ("ulong", Token.ULONG);
- keywords.Add ("unchecked", Token.UNCHECKED);
- keywords.Add ("unsafe", Token.UNSAFE);
- keywords.Add ("ushort", Token.USHORT);
- keywords.Add ("using", Token.USING);
- keywords.Add ("virtual", Token.VIRTUAL);
- keywords.Add ("void", Token.VOID);
- keywords.Add ("volatile", Token.VOLATILE);
- keywords.Add ("while", Token.WHILE);
- }
-
- //
- // Class initializer
- //
- static Tokenizer ()
- {
- InitTokens ();
- csharp_format_info = NumberFormatInfo.InvariantInfo;
- styles = NumberStyles.Float;
-
- id_builder = new System.Text.StringBuilder ();
- string_builder = new System.Text.StringBuilder ();
- number_builder = new System.Text.StringBuilder ();
- }
-
- bool is_keyword (string name)
- {
- bool res;
-
- res = keywords.Contains (name);
- if (handle_get_set == false && (name == "get" || name == "set"))
- return false;
- if (handle_remove_add == false && (name == "remove" || name == "add"))
- return false;
- if (handle_assembly == false && (name == "assembly"))
- return false;
- return res;
- }
-
- int GetKeyword (string name)
- {
- return (int) (keywords [name]);
- }
-
- public Location Location {
- get {
- return new Location (ref_line);
- }
- }
-
- void define (string def)
- {
- if (RootContext.AllDefines.Contains (def))
- return;
- RootContext.AllDefines [def] = true;
- }
-
- public Tokenizer (System.IO.Stream input, string fname, ArrayList defs)
- {
- this.ref_name = fname;
- reader = new System.IO.StreamReader (input);
- putback_char = -1;
-
- if (defs != null){
- defines = new Hashtable ();
- foreach (string def in defs)
- define (def);
- }
-
- //
- // FIXME: This could be `Location.Push' but we have to
- // find out why the MS compiler allows this
- //
- Mono.CSharp.Location.Push (fname);
- }
-
- bool is_identifier_start_character (char c)
- {
- return Char.IsLetter (c) || c == '_' ;
- }
-
- bool is_identifier_part_character (char c)
- {
- return (Char.IsLetter (c) || Char.IsDigit (c) || c == '_');
- }
-
- int is_punct (char c, ref bool doread)
- {
- int d;
- int t;
-
- doread = false;
-
- switch (c){
- case '{':
- return Token.OPEN_BRACE;
- case '}':
- return Token.CLOSE_BRACE;
- case '[':
- return Token.OPEN_BRACKET;
- case ']':
- return Token.CLOSE_BRACKET;
- case '(':
- return Token.OPEN_PARENS;
- case ')':
- return Token.CLOSE_PARENS;
- case ',':
- return Token.COMMA;
- case ':':
- return Token.COLON;
- case ';':
- return Token.SEMICOLON;
- case '~':
- return Token.TILDE;
- case '?':
- return Token.INTERR;
- }
-
- d = peekChar ();
- if (c == '+'){
-
- if (d == '+')
- t = Token.OP_INC;
- else if (d == '=')
- t = Token.OP_ADD_ASSIGN;
- else
- return Token.PLUS;
- doread = true;
- return t;
- }
- if (c == '-'){
- if (d == '-')
- t = Token.OP_DEC;
- else if (d == '=')
- t = Token.OP_SUB_ASSIGN;
- else if (d == '>')
- t = Token.OP_PTR;
- else
- return Token.MINUS;
- doread = true;
- return t;
- }
-
- if (c == '!'){
- if (d == '='){
- doread = true;
- return Token.OP_NE;
- }
- return Token.BANG;
- }
-
- if (c == '='){
- if (d == '='){
- doread = true;
- return Token.OP_EQ;
- }
- return Token.ASSIGN;
- }
-
- if (c == '&'){
- if (d == '&'){
- doread = true;
- return Token.OP_AND;
- } else if (d == '='){
- doread = true;
- return Token.OP_AND_ASSIGN;
- }
- return Token.BITWISE_AND;
- }
-
- if (c == '|'){
- if (d == '|'){
- doread = true;
- return Token.OP_OR;
- } else if (d == '='){
- doread = true;
- return Token.OP_OR_ASSIGN;
- }
- return Token.BITWISE_OR;
- }
-
- if (c == '*'){
- if (d == '='){
- doread = true;
- return Token.OP_MULT_ASSIGN;
- }
- return Token.STAR;
- }
-
- if (c == '/'){
- if (d == '='){
- doread = true;
- return Token.OP_DIV_ASSIGN;
- }
- return Token.DIV;
- }
-
- if (c == '%'){
- if (d == '='){
- doread = true;
- return Token.OP_MOD_ASSIGN;
- }
- return Token.PERCENT;
- }
-
- if (c == '^'){
- if (d == '='){
- doread = true;
- return Token.OP_XOR_ASSIGN;
- }
- return Token.CARRET;
- }
-
- if (c == '<'){
- if (d == '<'){
- getChar ();
- d = peekChar ();
-
- if (d == '='){
- doread = true;
- return Token.OP_SHIFT_LEFT_ASSIGN;
- }
- return Token.OP_SHIFT_LEFT;
- } else if (d == '='){
- doread = true;
- return Token.OP_LE;
- }
- return Token.OP_LT;
- }
-
- if (c == '>'){
- if (d == '>'){
- getChar ();
- d = peekChar ();
-
- if (d == '='){
- doread = true;
- return Token.OP_SHIFT_RIGHT_ASSIGN;
- }
- return Token.OP_SHIFT_RIGHT;
- } else if (d == '='){
- doread = true;
- return Token.OP_GE;
- }
- return Token.OP_GT;
- }
- return Token.ERROR;
- }
-
- bool decimal_digits (int c)
- {
- int d;
- bool seen_digits = false;
-
- if (c != -1)
- number_builder.Append ((char) c);
-
- while ((d = peekChar ()) != -1){
- if (Char.IsDigit ((char)d)){
- number_builder.Append ((char) d);
- getChar ();
- seen_digits = true;
- } else
- break;
- }
-
- return seen_digits;
- }
-
- bool is_hex (char e)
- {
- return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
- }
-
- void hex_digits (int c)
- {
- int d;
-
- if (c != -1)
- number_builder.Append ((char) c);
- while ((d = peekChar ()) != -1){
- char e = Char.ToUpper ((char) d);
-
- if (is_hex (e)){
- number_builder.Append ((char) e);
- getChar ();
- } else
- break;
- }
- }
-
- int real_type_suffix (int c)
- {
- int t;
-
- switch (c){
- case 'F': case 'f':
- t = Token.LITERAL_FLOAT;
- break;
- case 'D': case 'd':
- t = Token.LITERAL_DOUBLE;
- break;
- case 'M': case 'm':
- t= Token.LITERAL_DECIMAL;
- break;
- default:
- return Token.NONE;
- }
- return t;
- }
-
- int integer_type_suffix (ulong ul, int c)
- {
- bool is_unsigned = false;
- bool is_long = false;
-
- if (c != -1){
- bool scanning = true;
- do {
- switch (c){
- case 'U': case 'u':
- if (is_unsigned)
- scanning = false;
- is_unsigned = true;
- getChar ();
- break;
-
- case 'l':
- if (!is_unsigned){
- //
- // if we have not seen anything in between
- // report this error
- //
- Report.Warning (
- 78, Location,
- "the 'l' suffix is easily confused with digit `1'," +
- " use 'L' for clarity");
- }
- goto case 'L';
-
- case 'L':
- if (is_long)
- scanning = false;
- is_long = true;
- getChar ();
- break;
-
- default:
- scanning = false;
- break;
- }
- c = peekChar ();
- } while (scanning);
- }
-
- if (is_long && is_unsigned){
- val = ul;
- return Token.LITERAL_INTEGER;
- } else if (is_unsigned){
- // uint if possible, or ulong else.
-
- if ((ul & 0xffffffff00000000) == 0)
- val = (uint) ul;
- else
- val = ul;
- } else if (is_long){
- // long if possible, ulong otherwise
- if ((ul & 0x8000000000000000) != 0)
- val = ul;
- else
- val = (long) ul;
- } else {
- // int, uint, long or ulong in that order
- if ((ul & 0xffffffff00000000) == 0){
- uint ui = (uint) ul;
-
- if ((ui & 0x80000000) != 0)
- val = ui;
- else
- val = (int) ui;
- } else {
- if ((ul & 0x8000000000000000) != 0)
- val = ul;
- else
- val = (long) ul;
- }
- }
- return Token.LITERAL_INTEGER;
- }
-
- //
- // given `c' as the next char in the input decide whether
- // we need to convert to a special type, and then choose
- // the best representation for the integer
- //
- int adjust_int (int c)
- {
- ulong ul = System.UInt64.Parse (number_builder.ToString ());
- return integer_type_suffix (ul, c);
- }
-
- int adjust_real (int t)
- {
- string s = number_builder.ToString ();
-
- switch (t){
- case Token.LITERAL_DECIMAL:
- val = new System.Decimal ();
- val = System.Decimal.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_FLOAT:
- val = new System.Double ();
- val = (float) System.Double.Parse (
- s, styles, csharp_format_info);
- break;
-
- case Token.LITERAL_DOUBLE:
- case Token.NONE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- t = Token.LITERAL_DOUBLE;
- break;
- }
- return t;
- }
-
- //
- // Invoked if we know we have .digits or digits
- //
- int is_number (int c)
- {
- bool is_real = false;
- int type;
-
- number_builder.Length = 0;
-
- if (Char.IsDigit ((char)c)){
- if (c == '0' && peekChar () == 'x' || peekChar () == 'X'){
- ulong ul;
- getChar ();
- hex_digits (-1);
-
- string s = number_builder.ToString ();
-
- ul = System.UInt64.Parse (s, NumberStyles.HexNumber);
- return integer_type_suffix (ul, peekChar ());
- }
- decimal_digits (c);
- c = getChar ();
- }
-
- //
- // We need to handle the case of
- // "1.1" vs "1.string" (LITERAL_FLOAT vs NUMBER DOT IDENTIFIER)
- //
- if (c == '.'){
- if (decimal_digits ('.')){
- is_real = true;
- c = getChar ();
- } else {
- putback ('.');
- number_builder.Length -= 1;
- return adjust_int (-1);
- }
- }
-
- if (c == 'e' || c == 'E'){
- is_real = true;
- number_builder.Append ("e");
- c = getChar ();
-
- if (c == '+')
- number_builder.Append ((char) c);
- else if (c == '-')
- number_builder.Append ((char) c);
- decimal_digits (-1);
- c = getChar ();
- }
-
- type = real_type_suffix (c);
- if (type == Token.NONE && !is_real){
- putback (c);
- return adjust_int (c);
- } else
- is_real = true;
-
- if (type == Token.NONE){
- putback (c);
- }
-
- if (is_real)
- return adjust_real (type);
-
- Console.WriteLine ("This should not be reached");
- throw new Exception ("Is Number should never reach this point");
- }
-
- //
- // Accepts exactly count (4 or 8) hex, no more no less
- //
- int getHex (int count, out bool error)
- {
- int [] buffer = new int [8];
- int i;
- int total = 0;
- int c;
- char e;
- int top = count != -1 ? count : 4;
-
- getChar ();
- error = false;
- for (i = 0; i < top; i++){
- c = getChar ();
- e = Char.ToUpper ((char) c);
-
- if (!is_hex (e)){
- error = true;
- return 0;
- }
- if (Char.IsDigit (e))
- c = (int) e - (int) '0';
- else
- c = (int) e - (int) 'A';
- total = (total * 16) + c;
- if (count == -1){
- int p = peekChar ();
- if (p == -1)
- break;
- if (!is_hex ((char)p))
- break;
- }
- }
- return total;
- }
-
- int escape (int c)
- {
- bool error;
- int d;
- int v;
-
- d = peekChar ();
- if (c != '\\')
- return c;
-
- switch (d){
- case 'a':
- v = '\a'; break;
- case 'b':
- v = '\b'; break;
- case 'n':
- v = '\n'; break;
- case 't':
- v = '\t'; break;
- case 'v':
- v = '\v'; break;
- case 'r':
- v = '\r'; break;
- case '\\':
- v = '\\'; break;
- case 'f':
- v = '\f'; break;
- case '0':
- v = 0; break;
- case '"':
- v = '"'; break;
- case '\'':
- v = '\''; break;
- case 'x':
- v = getHex (-1, out error);
- if (error)
- goto default;
- return v;
- case 'u':
- v = getHex (4, out error);
- if (error)
- goto default;
- return v;
- case 'U':
- v = getHex (8, out error);
- if (error)
- goto default;
- return v;
- default:
- Report.Error (1009, Location, "Unrecognized escape sequence in " + (char)d);
- return -1;
- }
- getChar ();
- return v;
- }
-
- int getChar ()
- {
- if (putback_char != -1){
- int x = putback_char;
- putback_char = -1;
-
- return x;
- }
- return reader.Read ();
- }
-
- int peekChar ()
- {
- if (putback_char != -1)
- return putback_char;
- return reader.Peek ();
- }
-
- void putback (int c)
- {
- if (putback_char != -1)
- throw new Exception ("This should not happen putback on putback");
- putback_char = c;
- }
-
- public bool advance ()
- {
- return peekChar () != -1;
- }
-
- public Object Value {
- get {
- return val;
- }
- }
-
- public Object value ()
- {
- return val;
- }
-
- public int token ()
- {
- current_token = xtoken ();
- return current_token;
- }
-
- static StringBuilder static_cmd_arg = new System.Text.StringBuilder ();
-
- void get_cmd_arg (out string cmd, out string arg)
- {
- int c;
-
- tokens_seen = false;
- arg = "";
- static_cmd_arg.Length = 0;
-
- while ((c = getChar ()) != -1 && (c != '\n') && (c != ' ') && (c != '\t')){
- if (c == '\r')
- continue;
- static_cmd_arg.Append ((char) c);
- }
-
- cmd = static_cmd_arg.ToString ();
-
- if (c == '\n'){
- line++;
- ref_line++;
- return;
- }
-
- // skip over white space
- while ((c = getChar ()) != -1 && (c != '\n') && ((c == ' ') || (c == '\t')))
- ;
-
- if (c == '\n'){
- line++;
- ref_line++;
- return;
- }
-
- static_cmd_arg.Length = 0;
- static_cmd_arg.Append ((char) c);
-
- while ((c = getChar ()) != -1 && (c != '\n')){
- if (c == '\r')
- continue;
- static_cmd_arg.Append ((char) c);
- }
-
- if (c == '\n'){
- line++;
- ref_line++;
- }
- arg = static_cmd_arg.ToString ().Trim ();
- }
-
- //
- // Handles the #line directive
- //
- bool PreProcessLine (string arg)
- {
- if (arg == "")
- return false;
-
- if (arg == "default"){
- line = ref_line = line;
- return false;
- }
-
- try {
- int pos;
-
- if ((pos = arg.IndexOf (' ')) != -1 && pos != 0){
- ref_line = System.Int32.Parse (arg.Substring (0, pos));
- pos++;
-
- char [] quotes = { '\"' };
-
- ref_name = arg.Substring (pos). Trim(quotes);
- } else {
- ref_line = System.Int32.Parse (arg);
- }
- } catch {
- return false;
- }
-
- return true;
- }
-
- //
- // Handles #define and #undef
- //
- void PreProcessDefinition (bool is_define, string arg)
- {
- if (arg == "" || arg == "true" || arg == "false"){
- Report.Error(1001, Location, "Missing identifer to pre-processor directive");
- return;
- }
-
- if (is_define){
- if (defines == null)
- defines = new Hashtable ();
- define (arg);
- } else {
- if (defines == null)
- return;
- if (defines.Contains (arg))
- defines.Remove (arg);
- }
- }
-
- bool eval_val (string s)
- {
- if (s == "true")
- return true;
- if (s == "false")
- return false;
-
- if (defines == null)
- return false;
- if (defines.Contains (s))
- return true;
-
- return false;
- }
-
- bool pp_primary (ref string s)
- {
- s = s.Trim ();
- int len = s.Length;
-
- if (len > 0){
- char c = s [0];
-
- if (c == '('){
- s = s.Substring (1);
- bool val = pp_expr (ref s);
- if (s.Length > 0 && s [0] == ')'){
- s = s.Substring (1);
- return val;
- }
- Error_InvalidDirective ();
- return false;
- }
-
- if (Char.IsLetter (c) || c == '_'){
- int j = 1;
-
- while (j < len){
- c = s [j];
-
- if (Char.IsLetter (c) || Char.IsDigit (c) || c == '_'){
- j++;
- continue;
- }
- bool v = eval_val (s.Substring (0, j));
- s = s.Substring (j);
- return v;
- }
- bool vv = eval_val (s);
- s = "";
- return vv;
- }
- }
- Error_InvalidDirective ();
- return false;
- }
-
- bool pp_unary (ref string s)
- {
- s = s.Trim ();
- int len = s.Length;
-
- if (len > 0){
- if (s [0] == '!'){
- if (len > 1 && s [1] == '='){
- Error_InvalidDirective ();
- return false;
- }
- s = s.Substring (1);
- return ! pp_primary (ref s);
- } else
- return pp_primary (ref s);
- } else {
- Error_InvalidDirective ();
- return false;
- }
- }
-
- bool pp_eq (ref string s)
- {
- bool va = pp_unary (ref s);
-
- s = s.Trim ();
- int len = s.Length;
- if (len > 0){
- if (s [0] == '='){
- if (len > 2 && s [1] == '='){
- s = s.Substring (2);
- return va == pp_unary (ref s);
- } else {
- Error_InvalidDirective ();
- return false;
- }
- } else if (s [0] == '!' && len > 1 && s [1] == '='){
- s = s.Substring (2);
-
- return va != pp_unary (ref s);
-
- }
- }
-
- return va;
-
- }
-
- bool pp_and (ref string s)
- {
- bool va = pp_eq (ref s);
-
- s = s.Trim ();
- int len = s.Length;
- if (len > 0){
- if (s [0] == '&'){
- if (len > 2 && s [1] == '&'){
- s = s.Substring (2);
- return va && pp_eq (ref s);
- } else {
- Error_InvalidDirective ();
- return false;
- }
- }
- }
- return va;
- }
-
- //
- // Evaluates an expression for `#if' or `#elif'
- //
- bool pp_expr (ref string s)
- {
- bool va = pp_and (ref s);
-
- s = s.Trim ();
- int len = s.Length;
- if (len > 0){
- char c = s [0];
-
- if (c == '|'){
- if (len > 2 && s [1] == '|'){
- s = s.Substring (2);
- return va || pp_and (ref s);
- } else {
- Error_InvalidDirective ();
- return false;
- }
- }
- }
-
- return va;
- }
-
- bool eval (string s)
- {
- bool v = pp_expr (ref s);
- s = s.Trim ();
- if (s.Length != 0){
- Error_InvalidDirective ();
- return false;
- }
-
- return v;
- }
-
- void Error_InvalidDirective ()
- {
- Report.Error (1517, Location, "Invalid pre-processor directive");
- }
-
- void Error_UnexpectedDirective (string extra)
- {
- Report.Error (
- 1028, Location,
- "Unexpected processor directive (" + extra + ")");
- }
-
- void Error_TokensSeen ()
- {
- Report.Error (
- 1032, Location,
- "Cannot define or undefine pre-processor symbols after a token in the file");
- }
-
- //
- // if true, then the code continues processing the code
- // if false, the code stays in a loop until another directive is
- // reached.
- //
- bool handle_preprocessing_directive (bool caller_is_taking)
- {
- char [] blank = { ' ', '\t' };
- string cmd, arg;
-
- get_cmd_arg (out cmd, out arg);
-
- //
- // The first group of pre-processing instructions is always processed
- //
- switch (cmd){
- case "line":
- if (!PreProcessLine (arg))
- Report.Error (
- 1576, Location,
- "Argument to #line directive is missing or invalid");
- return true;
-
- case "region":
- arg = "true";
- goto case "if";
-
- case "endregion":
- goto case "endif";
-
- case "if":
- if (arg == ""){
- Error_InvalidDirective ();
- return true;
- }
- bool taking = false;
- if (ifstack == null)
- ifstack = new Stack ();
-
- if (ifstack.Count == 0){
- taking = true;
- } else {
- int state = (int) ifstack.Peek ();
- if ((state & TAKING) != 0)
- taking = true;
- }
-
- if (eval (arg) && taking){
- ifstack.Push (TAKING | TAKEN_BEFORE | PARENT_TAKING);
- return true;
- } else {
- ifstack.Push (taking ? PARENT_TAKING : 0);
- return false;
- }
-
- case "endif":
- if (ifstack == null || ifstack.Count == 0){
- Error_UnexpectedDirective ("no #if for this #endif");
- return true;
- } else {
- ifstack.Pop ();
- if (ifstack.Count == 0)
- return true;
- else {
- int state = (int) ifstack.Peek ();
-
- if ((state & TAKING) != 0)
- return true;
- else
- return false;
- }
- }
-
- case "elif":
- if (ifstack == null || ifstack.Count == 0){
- Error_UnexpectedDirective ("no #if for this #elif");
- return true;
- } else {
- int state = (int) ifstack.Peek ();
-
- if ((state & ELSE_SEEN) != 0){
- Error_UnexpectedDirective ("#elif not valid after #else");
- return true;
- }
-
- if ((state & (TAKEN_BEFORE | TAKING)) != 0)
- return false;
-
- if (eval (arg) && ((state & PARENT_TAKING) != 0)){
- state = (int) ifstack.Pop ();
- ifstack.Push (state | TAKING | TAKEN_BEFORE);
- return true;
- } else
- return false;
- }
-
- case "else":
- if (ifstack == null || ifstack.Count == 0){
- Report.Error (
- 1028, Location,
- "Unexpected processor directive (no #if for this #else)");
- return true;
- } else {
- int state = (int) ifstack.Peek ();
-
- if ((state & ELSE_SEEN) != 0){
- Error_UnexpectedDirective ("#else within #else");
- return true;
- }
-
- ifstack.Pop ();
- ifstack.Push (state | ELSE_SEEN);
-
- if ((state & TAKEN_BEFORE) == 0){
- if ((state & PARENT_TAKING) != 0)
- return true;
- else
- return false;
- }
- return false;
- }
- }
-
- //
- // These are only processed if we are in a `taking' block
- //
- if (!caller_is_taking)
- return false;
-
- switch (cmd){
- case "define":
- if (any_token_seen){
- Error_TokensSeen ();
- return true;
- }
- PreProcessDefinition (true, arg);
- return true;
-
- case "undef":
- if (any_token_seen){
- Error_TokensSeen ();
- return true;
- }
- PreProcessDefinition (false, arg);
- return true;
-
- case "error":
- Report.Error (1029, Location, "#error: '" + arg + "'");
- return true;
-
- case "warning":
- Report.Warning (1030, Location, "#warning: '" + arg + "'");
- return true;
- }
-
- Report.Error (1024, Location, "Preprocessor directive expected (got: " + cmd + ")");
- return true;
- }
-
- public int xtoken ()
- {
- int t;
- bool allow_keyword_as_ident = false;
- bool doread = false;
- int c;
-
- val = null;
- // optimization: eliminate col and implement #directive semantic correctly.
- for (;(c = getChar ()) != -1; col++) {
- if (Char.IsLetter ((char)c) || c == '_'){
- string ids;
-
- id_builder.Length = 0;
- tokens_seen = true;
- id_builder.Append ((char) c);
-
- while ((c = peekChar ()) != -1) {
- if (is_identifier_part_character ((char) c)){
- id_builder.Append ((char)getChar ());
- col++;
- } else
- break;
- }
-
- ids = id_builder.ToString ();
-
- if (!is_keyword (ids) || allow_keyword_as_ident) {
- val = ids;
- if (ids.Length > 512){
- Report.Error (
- 645, Location,
- "Identifier too long (limit is 512 chars)");
- }
- allow_keyword_as_ident = false;
- return Token.IDENTIFIER;
- }
-
- // true, false and null are in the hash anyway.
- return GetKeyword (ids);
-
- }
-
- if (c == '.'){
- tokens_seen = true;
- if (Char.IsDigit ((char) peekChar ()))
- return is_number (c);
- return Token.DOT;
- }
-
- if (Char.IsDigit ((char) c)){
- tokens_seen = true;
- return is_number (c);
- }
-
- // Handle double-slash comments.
- if (c == '/'){
- int d = peekChar ();
-
- if (d == '/'){
- getChar ();
- while ((d = getChar ()) != -1 && (d != '\n'))
- col++;
- line++;
- ref_line++;
- col = 0;
- any_token_seen |= tokens_seen;
- tokens_seen = false;
- continue;
- } else if (d == '*'){
- getChar ();
-
- while ((d = getChar ()) != -1){
- if (d == '*' && peekChar () == '/'){
- getChar ();
- col++;
- break;
- }
- if (d == '\n'){
- line++;
- ref_line++;
- col = 0;
- any_token_seen |= tokens_seen;
- tokens_seen = false;
- }
- }
- continue;
- }
- }
-
- /* For now, ignore pre-processor commands */
- // FIXME: In C# the '#' is not limited to appear
- // on the first column.
- if (c == '#' && !tokens_seen){
- bool cont = true;
-
- start_again:
-
- cont = handle_preprocessing_directive (cont);
-
- if (cont){
- col = 0;
- continue;
- }
- col = 1;
-
- bool skipping = false;
- for (;(c = getChar ()) != -1; col++){
- if (c == '\n'){
- col = 0;
- line++;
- ref_line++;
- skipping = false;
- } else if (c == ' ' || c == '\t' || c == '\v' || c == '\r')
- continue;
- else if (c != '#')
- skipping = true;
- if (c == '#' && !skipping)
- goto start_again;
- }
- any_token_seen |= tokens_seen;
- tokens_seen = false;
- if (c == -1)
- Report.Error (1027, Location, "#endif expected");
- continue;
- }
-
- if ((t = is_punct ((char)c, ref doread)) != Token.ERROR){
- tokens_seen = true;
- if (doread){
- getChar ();
- col++;
- }
- return t;
- }
-
- if (c == '"'){
- string_builder.Length = 0;
-
- tokens_seen = true;
-
- while ((c = getChar ()) != -1){
- if (c == '"'){
- if (allow_keyword_as_ident && peekChar () == '"'){
- string_builder.Append ((char) c);
- getChar ();
- continue;
- }
- allow_keyword_as_ident = false;
- val = string_builder.ToString ();
- return Token.LITERAL_STRING;
- }
-
- if (!allow_keyword_as_ident){
- c = escape (c);
- if (c == -1)
- return Token.ERROR;
- }
- string_builder.Append ((char) c);
- }
- }
-
- if (c == '\''){
- c = getChar ();
- tokens_seen = true;
- if (c == '\''){
- error_details = "Empty character literal";
- Report.Error (1011, Location, error_details);
- return Token.ERROR;
- }
- c = escape (c);
- if (c == -1)
- return Token.ERROR;
- val = new System.Char ();
- val = (char) c;
- c = getChar ();
-
- if (c != '\''){
- error_details = "Too many characters in character literal";
- Report.Error (1012, Location, error_details);
-
- // Try to recover, read until newline or next "'"
- while ((c = getChar ()) != -1){
- if (c == '\n' || c == '\'')
- break;
-
- }
- return Token.ERROR;
- }
- return Token.LITERAL_CHARACTER;
- }
-
- // white space
- if (c == '\n'){
- line++;
- ref_line++;
- col = 0;
- any_token_seen |= tokens_seen;
- tokens_seen = false;
- continue;
- }
-
- if (c == ' ' || c == '\t' || c == '\f' || c == '\v' || c == '\r'){
- if (c == '\t')
- col = (((col + 8) / 8) * 8) - 1;
- continue;
- }
-
- if (c == '@'){
- tokens_seen = true;
- allow_keyword_as_ident = true;
- continue;
- }
-
- error_details = ((char)c).ToString ();
-
- return Token.ERROR;
- }
-
- if (ifstack != null && ifstack.Count > 1)
- Report.Error (1027, Location, "#endif expected");
- return Token.EOF;
- }
- }
-}
-
+//
+// cs-tokenizer.cs: The Tokenizer for the C# compiler
+// This also implements the preprocessor
+//
+// Author: Miguel de Icaza (miguel@gnu.org)
+//
+// Licensed under the terms of the GNU GPL
+//
+// (C) 2001, 2002 Ximian, Inc (http://www.ximian.com)
+//
+
+/*
+ * TODO:
+ * Make sure we accept the proper Unicode ranges, per the spec.
+ * Report error 1032
+*/
+
+using System;
+using System.Text;
+using System.Collections;
+using System.IO;
+using System.Globalization;
+using System.Reflection;
+
+namespace Mono.CSharp
+{
+ /// <summary>
+ /// Tokenizer for C# source code.
+ /// </summary>
+
+ public class Tokenizer : yyParser.yyInput
+ {
+ SeekableStreamReader reader;
+ public SourceFile ref_name;
+ public SourceFile file_name;
+ public int ref_line = 1;
+ public int line = 1;
+ public int col = 1;
+ public int current_token;
+ bool handle_get_set = false;
+ bool handle_remove_add = false;
+ bool handle_assembly = false;
+
+ //
+ // Whether tokens have been seen on this line
+ //
+ bool tokens_seen = false;
+
+ //
+ // Whether a token has been seen on the file
+ // This is needed because `define' is not allowed to be used
+ // after a token has been seen.
+ //
+ bool any_token_seen = false;
+ static Hashtable tokenValues;
+
+ private static Hashtable TokenValueName
+ {
+ get {
+ if (tokenValues == null)
+ tokenValues = GetTokenValueNameHash ();
+
+ return tokenValues;
+ }
+ }
+
+ private static Hashtable GetTokenValueNameHash ()
+ {
+ Type t = typeof (Token);
+ FieldInfo [] fields = t.GetFields ();
+ Hashtable hash = new Hashtable ();
+ foreach (FieldInfo field in fields) {
+ if (field.IsLiteral && field.IsStatic && field.FieldType == typeof (int))
+ hash.Add (field.GetValue (null), field.Name);
+ }
+ return hash;
+ }
+
+ //
+ // Returns a verbose representation of the current location
+ //
+ public string location {
+ get {
+ string det;
+
+ if (current_token == Token.ERROR)
+ det = "detail: " + error_details;
+ else
+ det = "";
+
+ // return "Line: "+line+" Col: "+col + "\n" +
+ // "VirtLine: "+ref_line +
+ // " Token: "+current_token + " " + det;
+ string current_token_name = TokenValueName [current_token] as string;
+ if (current_token_name == null)
+ current_token_name = current_token.ToString ();
+
+ return String.Format ("{0} ({1},{2}), Token: {3} {4}", ref_name.Name,
+ ref_line,
+ col,
+ current_token_name,
+ det);
+ }
+ }
+
+ public bool PropertyParsing {
+ get {
+ return handle_get_set;
+ }
+
+ set {
+ handle_get_set = value;
+ }
+ }
+
+ public bool AssemblyTargetParsing {
+ get {
+ return handle_assembly;
+ }
+
+ set {
+ handle_assembly = value;
+ }
+ }
+
+ public bool EventParsing {
+ get {
+ return handle_remove_add;
+ }
+
+ set {
+ handle_remove_add = value;
+ }
+ }
+
+ //
+ // Class variables
+ //
+ static CharArrayHashtable[] keywords;
+ static NumberStyles styles;
+ static NumberFormatInfo csharp_format_info;
+
+ //
+ // Values for the associated token returned
+ //
+ int putback_char;
+ Object val;
+
+ //
+ // Pre-processor
+ //
+ Hashtable defines;
+
+ const int TAKING = 1;
+ const int TAKEN_BEFORE = 2;
+ const int ELSE_SEEN = 4;
+ const int PARENT_TAKING = 8;
+ const int REGION = 16;
+
+ //
+ // pre-processor if stack state:
+ //
+ Stack ifstack;
+
+ static System.Text.StringBuilder string_builder;
+
+ const int max_id_size = 512;
+ static char [] id_builder = new char [max_id_size];
+
+ static CharArrayHashtable [] identifiers = new CharArrayHashtable [max_id_size + 1];
+
+ const int max_number_size = 128;
+ static char [] number_builder = new char [max_number_size];
+ static int number_pos;
+
+ //
+ // Details about the error encoutered by the tokenizer
+ //
+ string error_details;
+
+ public string error {
+ get {
+ return error_details;
+ }
+ }
+
+ public int Line {
+ get {
+ return ref_line;
+ }
+ }
+
+ public int Col {
+ get {
+ return col;
+ }
+ }
+
+ static void AddKeyword (string kw, int token) {
+ if (keywords [kw.Length] == null) {
+ keywords [kw.Length] = new CharArrayHashtable (kw.Length);
+ }
+ keywords [kw.Length] [kw.ToCharArray ()] = token;
+ }
+
+ static void InitTokens ()
+ {
+ keywords = new CharArrayHashtable [64];
+
+ AddKeyword ("__arglist", Token.ARGLIST);
+ AddKeyword ("abstract", Token.ABSTRACT);
+ AddKeyword ("as", Token.AS);
+ AddKeyword ("add", Token.ADD);
+ AddKeyword ("assembly", Token.ASSEMBLY);
+ AddKeyword ("base", Token.BASE);
+ AddKeyword ("bool", Token.BOOL);
+ AddKeyword ("break", Token.BREAK);
+ AddKeyword ("byte", Token.BYTE);
+ AddKeyword ("case", Token.CASE);
+ AddKeyword ("catch", Token.CATCH);
+ AddKeyword ("char", Token.CHAR);
+ AddKeyword ("checked", Token.CHECKED);
+ AddKeyword ("class", Token.CLASS);
+ AddKeyword ("const", Token.CONST);
+ AddKeyword ("continue", Token.CONTINUE);
+ AddKeyword ("decimal", Token.DECIMAL);
+ AddKeyword ("default", Token.DEFAULT);
+ AddKeyword ("delegate", Token.DELEGATE);
+ AddKeyword ("do", Token.DO);
+ AddKeyword ("double", Token.DOUBLE);
+ AddKeyword ("else", Token.ELSE);
+ AddKeyword ("enum", Token.ENUM);
+ AddKeyword ("event", Token.EVENT);
+ AddKeyword ("explicit", Token.EXPLICIT);
+ AddKeyword ("extern", Token.EXTERN);
+ AddKeyword ("false", Token.FALSE);
+ AddKeyword ("finally", Token.FINALLY);
+ AddKeyword ("fixed", Token.FIXED);
+ AddKeyword ("float", Token.FLOAT);
+ AddKeyword ("for", Token.FOR);
+ AddKeyword ("foreach", Token.FOREACH);
+ AddKeyword ("goto", Token.GOTO);
+ AddKeyword ("get", Token.GET);
+ AddKeyword ("if", Token.IF);
+ AddKeyword ("implicit", Token.IMPLICIT);
+ AddKeyword ("in", Token.IN);
+ AddKeyword ("int", Token.INT);
+ AddKeyword ("interface", Token.INTERFACE);
+ AddKeyword ("internal", Token.INTERNAL);
+ AddKeyword ("is", Token.IS);
+ AddKeyword ("lock", Token.LOCK);
+ AddKeyword ("long", Token.LONG);
+ AddKeyword ("namespace", Token.NAMESPACE);
+ AddKeyword ("new", Token.NEW);
+ AddKeyword ("null", Token.NULL);
+ AddKeyword ("object", Token.OBJECT);
+ AddKeyword ("operator", Token.OPERATOR);
+ AddKeyword ("out", Token.OUT);
+ AddKeyword ("override", Token.OVERRIDE);
+ AddKeyword ("params", Token.PARAMS);
+ AddKeyword ("private", Token.PRIVATE);
+ AddKeyword ("protected", Token.PROTECTED);
+ AddKeyword ("public", Token.PUBLIC);
+ AddKeyword ("readonly", Token.READONLY);
+ AddKeyword ("ref", Token.REF);
+ AddKeyword ("remove", Token.REMOVE);
+ AddKeyword ("return", Token.RETURN);
+ AddKeyword ("sbyte", Token.SBYTE);
+ AddKeyword ("sealed", Token.SEALED);
+ AddKeyword ("set", Token.SET);
+ AddKeyword ("short", Token.SHORT);
+ AddKeyword ("sizeof", Token.SIZEOF);
+ AddKeyword ("stackalloc", Token.STACKALLOC);
+ AddKeyword ("static", Token.STATIC);
+ AddKeyword ("string", Token.STRING);
+ AddKeyword ("struct", Token.STRUCT);
+ AddKeyword ("switch", Token.SWITCH);
+ AddKeyword ("this", Token.THIS);
+ AddKeyword ("throw", Token.THROW);
+ AddKeyword ("true", Token.TRUE);
+ AddKeyword ("try", Token.TRY);
+ AddKeyword ("typeof", Token.TYPEOF);
+ AddKeyword ("uint", Token.UINT);
+ AddKeyword ("ulong", Token.ULONG);
+ AddKeyword ("unchecked", Token.UNCHECKED);
+ AddKeyword ("unsafe", Token.UNSAFE);
+ AddKeyword ("ushort", Token.USHORT);
+ AddKeyword ("using", Token.USING);
+ AddKeyword ("virtual", Token.VIRTUAL);
+ AddKeyword ("void", Token.VOID);
+ AddKeyword ("volatile", Token.VOLATILE);
+ AddKeyword ("while", Token.WHILE);
+ AddKeyword ("partial", Token.PARTIAL);
+ }
+
+ //
+ // Class initializer
+ //
+ static Tokenizer ()
+ {
+ InitTokens ();
+ csharp_format_info = NumberFormatInfo.InvariantInfo;
+ styles = NumberStyles.Float;
+
+ string_builder = new System.Text.StringBuilder ();
+ }
+
+ int GetKeyword (char[] id, int id_len)
+ {
+ /*
+ * Keywords are stored in an array of hashtables grouped by their
+ * length.
+ */
+
+ if ((id_len >= keywords.Length) || (keywords [id_len] == null))
+ return -1;
+ object o = keywords [id_len] [id];
+
+ if (o == null)
+ return -1;
+
+ int res = (int) o;
+
+ if (handle_get_set == false && (res == Token.GET || res == Token.SET))
+ return -1;
+ if (handle_remove_add == false && (res == Token.REMOVE || res == Token.ADD))
+ return -1;
+ if (handle_assembly == false && res == Token.ASSEMBLY)
+ return -1;
+
+ return res;
+
+ }
+
+ public Location Location {
+ get {
+ return new Location (ref_line);
+ }
+ }
+
+ void define (string def)
+ {
+ if (!RootContext.AllDefines.Contains (def)){
+ RootContext.AllDefines [def] = true;
+ }
+ if (defines.Contains (def))
+ return;
+ defines [def] = true;
+ }
+
+ public Tokenizer (SeekableStreamReader input, SourceFile file, ArrayList defs)
+ {
+ this.ref_name = file;
+ this.file_name = file;
+ reader = input;
+
+ putback_char = -1;
+
+ if (defs != null){
+ defines = new Hashtable ();
+ foreach (string def in defs)
+ define (def);
+ }
+
+ //
+ // FIXME: This could be `Location.Push' but we have to
+ // find out why the MS compiler allows this
+ //
+ Mono.CSharp.Location.Push (file);
+ }
+
+ public static void Cleanup () {
+ identifiers = null;
+ }
+
+ static bool is_identifier_start_character (char c)
+ {
+ return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_' || Char.IsLetter (c);
+ }
+
+ static bool is_identifier_part_character (char c)
+ {
+ return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || (c >= '0' && c <= '9') || Char.IsLetter (c);
+ }
+
+ public static bool IsValidIdentifier (string s)
+ {
+ if (s == null || s.Length == 0)
+ return false;
+
+ if (!is_identifier_start_character (s [0]))
+ return false;
+
+ for (int i = 1; i < s.Length; i ++)
+ if (! is_identifier_part_character (s [i]))
+ return false;
+
+ return true;
+ }
+
+ int is_punct (char c, ref bool doread)
+ {
+ int d;
+ int t;
+
+ doread = false;
+
+ switch (c){
+ case '{':
+ return Token.OPEN_BRACE;
+ case '}':
+ return Token.CLOSE_BRACE;
+ case '[':
+ return Token.OPEN_BRACKET;
+ case ']':
+ return Token.CLOSE_BRACKET;
+ case '(':
+ return Token.OPEN_PARENS;
+ case ')': {
+ if (deambiguate_close_parens == 0)
+ return Token.CLOSE_PARENS;
+
+ --deambiguate_close_parens;
+
+ // Save current position and parse next token.
+ int old = reader.Position;
+ int new_token = token ();
+ reader.Position = old;
+ putback_char = -1;
+
+ if (new_token == Token.OPEN_PARENS)
+ return Token.CLOSE_PARENS_OPEN_PARENS;
+ else if (new_token == Token.MINUS)
+ return Token.CLOSE_PARENS_MINUS;
+ else if (IsCastToken (new_token))
+ return Token.CLOSE_PARENS_CAST;
+ else
+ return Token.CLOSE_PARENS_NO_CAST;
+ }
+
+ case ',':
+ return Token.COMMA;
+ case ':':
+ return Token.COLON;
+ case ';':
+ return Token.SEMICOLON;
+ case '~':
+ return Token.TILDE;
+ case '?':
+ return Token.INTERR;
+ }
+
+ d = peekChar ();
+ if (c == '+'){
+
+ if (d == '+')
+ t = Token.OP_INC;
+ else if (d == '=')
+ t = Token.OP_ADD_ASSIGN;
+ else
+ return Token.PLUS;
+ doread = true;
+ return t;
+ }
+ if (c == '-'){
+ if (d == '-')
+ t = Token.OP_DEC;
+ else if (d == '=')
+ t = Token.OP_SUB_ASSIGN;
+ else if (d == '>')
+ t = Token.OP_PTR;
+ else
+ return Token.MINUS;
+ doread = true;
+ return t;
+ }
+
+ if (c == '!'){
+ if (d == '='){
+ doread = true;
+ return Token.OP_NE;
+ }
+ return Token.BANG;
+ }
+
+ if (c == '='){
+ if (d == '='){
+ doread = true;
+ return Token.OP_EQ;
+ }
+ return Token.ASSIGN;
+ }
+
+ if (c == '&'){
+ if (d == '&'){
+ doread = true;
+ return Token.OP_AND;
+ } else if (d == '='){
+ doread = true;
+ return Token.OP_AND_ASSIGN;
+ }
+ return Token.BITWISE_AND;
+ }
+
+ if (c == '|'){
+ if (d == '|'){
+ doread = true;
+ return Token.OP_OR;
+ } else if (d == '='){
+ doread = true;
+ return Token.OP_OR_ASSIGN;
+ }
+ return Token.BITWISE_OR;
+ }
+
+ if (c == '*'){
+ if (d == '='){
+ doread = true;
+ return Token.OP_MULT_ASSIGN;
+ }
+ return Token.STAR;
+ }
+
+ if (c == '/'){
+ if (d == '='){
+ doread = true;
+ return Token.OP_DIV_ASSIGN;
+ }
+ return Token.DIV;
+ }
+
+ if (c == '%'){
+ if (d == '='){
+ doread = true;
+ return Token.OP_MOD_ASSIGN;
+ }
+ return Token.PERCENT;
+ }
+
+ if (c == '^'){
+ if (d == '='){
+ doread = true;
+ return Token.OP_XOR_ASSIGN;
+ }
+ return Token.CARRET;
+ }
+
+ if (c == '<'){
+ if (d == '<'){
+ getChar ();
+ d = peekChar ();
+
+ if (d == '='){
+ doread = true;
+ return Token.OP_SHIFT_LEFT_ASSIGN;
+ }
+ return Token.OP_SHIFT_LEFT;
+ } else if (d == '='){
+ doread = true;
+ return Token.OP_LE;
+ }
+ return Token.OP_LT;
+ }
+
+ if (c == '>'){
+ if (d == '>'){
+ getChar ();
+ d = peekChar ();
+
+ if (d == '='){
+ doread = true;
+ return Token.OP_SHIFT_RIGHT_ASSIGN;
+ }
+ return Token.OP_SHIFT_RIGHT;
+ } else if (d == '='){
+ doread = true;
+ return Token.OP_GE;
+ }
+ return Token.OP_GT;
+ }
+ return Token.ERROR;
+ }
+
+ int deambiguate_close_parens = 0;
+
+ public void Deambiguate_CloseParens ()
+ {
+ putback (')');
+ deambiguate_close_parens++;
+ }
+
+ void Error_NumericConstantTooLong ()
+ {
+ Report.Error (1021, Location, "Numeric constant too long");
+ }
+
+ bool decimal_digits (int c)
+ {
+ int d;
+ bool seen_digits = false;
+
+ if (c != -1){
+ if (number_pos == max_number_size)
+ Error_NumericConstantTooLong ();
+ number_builder [number_pos++] = (char) c;
+ }
+
+ //
+ // We use peekChar2, because decimal_digits needs to do a
+ // 2-character look-ahead (5.ToString for example).
+ //
+ while ((d = peekChar2 ()) != -1){
+ if (d >= '0' && d <= '9'){
+ if (number_pos == max_number_size)
+ Error_NumericConstantTooLong ();
+ number_builder [number_pos++] = (char) d;
+ getChar ();
+ seen_digits = true;
+ } else
+ break;
+ }
+
+ return seen_digits;
+ }
+
+ bool is_hex (int e)
+ {
+ return (e >= '0' && e <= '9') || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
+ }
+
+ void hex_digits (int c)
+ {
+ if (c != -1)
+ number_builder [number_pos++] = (char) c;
+
+ }
+
+ int real_type_suffix (int c)
+ {
+ int t;
+
+ switch (c){
+ case 'F': case 'f':
+ t = Token.LITERAL_FLOAT;
+ break;
+ case 'D': case 'd':
+ t = Token.LITERAL_DOUBLE;
+ break;
+ case 'M': case 'm':
+ t= Token.LITERAL_DECIMAL;
+ break;
+ default:
+ return Token.NONE;
+ }
+ return t;
+ }
+
+ int integer_type_suffix (ulong ul, int c)
+ {
+ bool is_unsigned = false;
+ bool is_long = false;
+
+ if (c != -1){
+ bool scanning = true;
+ do {
+ switch (c){
+ case 'U': case 'u':
+ if (is_unsigned)
+ scanning = false;
+ is_unsigned = true;
+ getChar ();
+ break;
+
+ case 'l':
+ if (!is_unsigned && (RootContext.WarningLevel >= 4)){
+ //
+ // if we have not seen anything in between
+ // report this error
+ //
+ Report.Warning (78, Location, "The 'l' suffix is easily confused with the digit '1' (use 'L' for clarity)");
+ }
+ goto case 'L';
+
+ case 'L':
+ if (is_long)
+ scanning = false;
+ is_long = true;
+ getChar ();
+ break;
+
+ default:
+ scanning = false;
+ break;
+ }
+ c = peekChar ();
+ } while (scanning);
+ }
+
+ if (is_long && is_unsigned){
+ val = ul;
+ return Token.LITERAL_INTEGER;
+ } else if (is_unsigned){
+ // uint if possible, or ulong else.
+
+ if ((ul & 0xffffffff00000000) == 0)
+ val = (uint) ul;
+ else
+ val = ul;
+ } else if (is_long){
+ // long if possible, ulong otherwise
+ if ((ul & 0x8000000000000000) != 0)
+ val = ul;
+ else
+ val = (long) ul;
+ } else {
+ // int, uint, long or ulong in that order
+ if ((ul & 0xffffffff00000000) == 0){
+ uint ui = (uint) ul;
+
+ if ((ui & 0x80000000) != 0)
+ val = ui;
+ else
+ val = (int) ui;
+ } else {
+ if ((ul & 0x8000000000000000) != 0)
+ val = ul;
+ else
+ val = (long) ul;
+ }
+ }
+ return Token.LITERAL_INTEGER;
+ }
+
+ //
+ // given `c' as the next char in the input decide whether
+ // we need to convert to a special type, and then choose
+ // the best representation for the integer
+ //
+ int adjust_int (int c)
+ {
+ try {
+ if (number_pos > 9){
+ ulong ul = (uint) (number_builder [0] - '0');
+
+ for (int i = 1; i < number_pos; i++){
+ ul = checked ((ul * 10) + ((uint)(number_builder [i] - '0')));
+ }
+ return integer_type_suffix (ul, c);
+ } else {
+ uint ui = (uint) (number_builder [0] - '0');
+
+ for (int i = 1; i < number_pos; i++){
+ ui = checked ((ui * 10) + ((uint)(number_builder [i] - '0')));
+ }
+ return integer_type_suffix (ui, c);
+ }
+ } catch (OverflowException) {
+ error_details = "Integral constant is too large";
+ Report.Error (1021, Location, error_details);
+ val = 0ul;
+ return Token.LITERAL_INTEGER;
+ }
+ }
+
+ int adjust_real (int t)
+ {
+ string s = new String (number_builder, 0, number_pos);
+
+ switch (t){
+ case Token.LITERAL_DECIMAL:
+ try {
+ val = System.Decimal.Parse (s, styles, csharp_format_info);
+ } catch (OverflowException) {
+ val = 0m;
+ error_details = "Floating-point constant is outside the range of the type 'decimal'";
+ Report.Error (594, Location, error_details);
+ }
+ break;
+ case Token.LITERAL_FLOAT:
+ try {
+ val = (float) System.Double.Parse (s, styles, csharp_format_info);
+ } catch (OverflowException) {
+ val = 0.0f;
+ error_details = "Floating-point constant is outside the range of the type 'float'";
+ Report.Error (594, Location, error_details);
+ }
+ break;
+
+ case Token.LITERAL_DOUBLE:
+ case Token.NONE:
+ t = Token.LITERAL_DOUBLE;
+ try {
+ val = System.Double.Parse (s, styles, csharp_format_info);
+ } catch (OverflowException) {
+ val = 0.0;
+ error_details = "Floating-point constant is outside the range of the type 'double'";
+ Report.Error (594, Location, error_details);
+ }
+ break;
+ }
+ return t;
+ }
+
+ int handle_hex ()
+ {
+ int d;
+ ulong ul;
+
+ getChar ();
+ while ((d = peekChar ()) != -1){
+ if (is_hex (d)){
+ number_builder [number_pos++] = (char) d;
+ getChar ();
+ } else
+ break;
+ }
+
+ string s = new String (number_builder, 0, number_pos);
+ try {
+ if (number_pos <= 8)
+ ul = System.UInt32.Parse (s, NumberStyles.HexNumber);
+ else
+ ul = System.UInt64.Parse (s, NumberStyles.HexNumber);
+ } catch (OverflowException){
+ error_details = "Integral constant is too large";
+ Report.Error (1021, Location, error_details);
+ val = 0ul;
+ return Token.LITERAL_INTEGER;
+ }
+ catch (FormatException) {
+ Report.Error (1013, Location, "Invalid number");
+ val = 0ul;
+ return Token.LITERAL_INTEGER;
+ }
+
+ return integer_type_suffix (ul, peekChar ());
+ }
+
+ //
+ // Invoked if we know we have .digits or digits
+ //
+ int is_number (int c)
+ {
+ bool is_real = false;
+ int type;
+
+ number_pos = 0;
+
+ if (c >= '0' && c <= '9'){
+ if (c == '0'){
+ int peek = peekChar ();
+
+ if (peek == 'x' || peek == 'X')
+ return handle_hex ();
+ }
+ decimal_digits (c);
+ c = getChar ();
+ }
+
+ //
+ // We need to handle the case of
+ // "1.1" vs "1.string" (LITERAL_FLOAT vs NUMBER DOT IDENTIFIER)
+ //
+ if (c == '.'){
+ if (decimal_digits ('.')){
+ is_real = true;
+ c = getChar ();
+ } else {
+ putback ('.');
+ number_pos--;
+ return adjust_int (-1);
+ }
+ }
+
+ if (c == 'e' || c == 'E'){
+ is_real = true;
+ if (number_pos == max_number_size)
+ Error_NumericConstantTooLong ();
+ number_builder [number_pos++] = 'e';
+ c = getChar ();
+
+ if (c == '+'){
+ if (number_pos == max_number_size)
+ Error_NumericConstantTooLong ();
+ number_builder [number_pos++] = '+';
+ c = -1;
+ } else if (c == '-') {
+ if (number_pos == max_number_size)
+ Error_NumericConstantTooLong ();
+ number_builder [number_pos++] = '-';
+ c = -1;
+ } else {
+ if (number_pos == max_number_size)
+ Error_NumericConstantTooLong ();
+ number_builder [number_pos++] = '+';
+ }
+
+ decimal_digits (c);
+ c = getChar ();
+ }
+
+ type = real_type_suffix (c);
+ if (type == Token.NONE && !is_real){
+ putback (c);
+ return adjust_int (c);
+ } else
+ is_real = true;
+
+ if (type == Token.NONE){
+ putback (c);
+ }
+
+ if (is_real)
+ return adjust_real (type);
+
+ Console.WriteLine ("This should not be reached");
+ throw new Exception ("Is Number should never reach this point");
+ }
+
+ //
+ // Accepts exactly count (4 or 8) hex, no more no less
+ //
+ int getHex (int count, out bool error)
+ {
+ int i;
+ int total = 0;
+ int c;
+ int top = count != -1 ? count : 4;
+
+ getChar ();
+ error = false;
+ for (i = 0; i < top; i++){
+ c = getChar ();
+
+ if (c >= '0' && c <= '9')
+ c = (int) c - (int) '0';
+ else if (c >= 'A' && c <= 'F')
+ c = (int) c - (int) 'A' + 10;
+ else if (c >= 'a' && c <= 'f')
+ c = (int) c - (int) 'a' + 10;
+ else {
+ error = true;
+ return 0;
+ }
+
+ total = (total * 16) + c;
+ if (count == -1){
+ int p = peekChar ();
+ if (p == -1)
+ break;
+ if (!is_hex ((char)p))
+ break;
+ }
+ }
+ return total;
+ }
+
+ int escape (int c)
+ {
+ bool error;
+ int d;
+ int v;
+
+ d = peekChar ();
+ if (c != '\\')
+ return c;
+
+ switch (d){
+ case 'a':
+ v = '\a'; break;
+ case 'b':
+ v = '\b'; break;
+ case 'n':
+ v = '\n'; break;
+ case 't':
+ v = '\t'; break;
+ case 'v':
+ v = '\v'; break;
+ case 'r':
+ v = '\r'; break;
+ case '\\':
+ v = '\\'; break;
+ case 'f':
+ v = '\f'; break;
+ case '0':
+ v = 0; break;
+ case '"':
+ v = '"'; break;
+ case '\'':
+ v = '\''; break;
+ case 'x':
+ v = getHex (-1, out error);
+ if (error)
+ goto default;
+ return v;
+ case 'u':
+ v = getHex (4, out error);
+ if (error)
+ goto default;
+ return v;
+ case 'U':
+ v = getHex (8, out error);
+ if (error)
+ goto default;
+ return v;
+ default:
+ Report.Error (1009, Location, "Unrecognized escape sequence in " + (char)d);
+ return d;
+ }
+ getChar ();
+ return v;
+ }
+
+ int getChar ()
+ {
+ if (putback_char != -1){
+ int x = putback_char;
+ putback_char = -1;
+
+ return x;
+ }
+ return reader.Read ();
+ }
+
+ int peekChar ()
+ {
+ if (putback_char != -1)
+ return putback_char;
+ putback_char = reader.Read ();
+ return putback_char;
+ }
+
+ int peekChar2 ()
+ {
+ if (putback_char != -1)
+ return putback_char;
+ return reader.Peek ();
+ }
+
+ void putback (int c)
+ {
+ if (putback_char != -1){
+ Console.WriteLine ("Col: " + col);
+ Console.WriteLine ("Row: " + line);
+ Console.WriteLine ("Name: " + ref_name.Name);
+ Console.WriteLine ("Current [{0}] putting back [{1}] ", putback_char, c);
+ throw new Exception ("This should not happen putback on putback");
+ }
+ putback_char = c;
+ }
+
+ public bool advance ()
+ {
+ return peekChar () != -1;
+ }
+
+ public Object Value {
+ get {
+ return val;
+ }
+ }
+
+ public Object value ()
+ {
+ return val;
+ }
+
+ bool IsCastToken (int token)
+ {
+ switch (token) {
+ case Token.BANG:
+ case Token.TILDE:
+ case Token.IDENTIFIER:
+ case Token.LITERAL_INTEGER:
+ case Token.LITERAL_FLOAT:
+ case Token.LITERAL_DOUBLE:
+ case Token.LITERAL_DECIMAL:
+ case Token.LITERAL_CHARACTER:
+ case Token.LITERAL_STRING:
+ case Token.BASE:
+ case Token.CHECKED:
+ case Token.FALSE:
+ case Token.FIXED:
+ case Token.NEW:
+ case Token.NULL:
+ case Token.SIZEOF:
+ case Token.THIS:
+ case Token.THROW:
+ case Token.TRUE:
+ case Token.TYPEOF:
+ case Token.UNCHECKED:
+ case Token.UNSAFE:
+
+ //
+ // These can be part of a member access
+ //
+ case Token.INT:
+ case Token.UINT:
+ case Token.SHORT:
+ case Token.USHORT:
+ case Token.LONG:
+ case Token.ULONG:
+ case Token.DOUBLE:
+ case Token.FLOAT:
+ case Token.CHAR:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ public int token ()
+ {
+ current_token = xtoken ();
+ return current_token;
+ }
+
+ static StringBuilder static_cmd_arg = new System.Text.StringBuilder ();
+
+ void get_cmd_arg (out string cmd, out string arg)
+ {
+ int c;
+
+ tokens_seen = false;
+ arg = "";
+ static_cmd_arg.Length = 0;
+
+ // skip over white space
+ while ((c = getChar ()) != -1 && (c != '\n') && ((c == '\r') || (c == ' ') || (c == '\t')))
+ ;
+
+
+ while ((c != -1) && (c != '\n') && (c != ' ') && (c != '\t') && (c != '\r')){
+ if (is_identifier_part_character ((char) c)){
+ static_cmd_arg.Append ((char) c);
+ c = getChar ();
+ } else {
+ putback (c);
+ break;
+ }
+ }
+
+ cmd = static_cmd_arg.ToString ();
+
+ if (c == '\n'){
+ line++;
+ ref_line++;
+ return;
+ } else if (c == '\r')
+ col = 0;
+
+ // skip over white space
+ while ((c = getChar ()) != -1 && (c != '\n') && ((c == '\r') || (c == ' ') || (c == '\t')))
+ ;
+
+ if (c == '\n'){
+ line++;
+ ref_line++;
+ return;
+ } else if (c == '\r'){
+ col = 0;
+ return;
+ }
+
+ static_cmd_arg.Length = 0;
+ static_cmd_arg.Append ((char) c);
+
+ while ((c = getChar ()) != -1 && (c != '\n') && (c != '\r')){
+ static_cmd_arg.Append ((char) c);
+ }
+
+ if (c == '\n'){
+ line++;
+ ref_line++;
+ } else if (c == '\r')
+ col = 0;
+ arg = static_cmd_arg.ToString ().Trim ();
+ }
+
+ //
+ // Handles the #line directive
+ //
+ bool PreProcessLine (string arg)
+ {
+ if (arg == "")
+ return false;
+
+ if (arg == "default"){
+ ref_line = line;
+ ref_name = file_name;
+ Location.Push (ref_name);
+ return true;
+ } else if (arg == "hidden"){
+ //
+ // We ignore #line hidden
+ //
+ return true;
+ }
+
+ try {
+ int pos;
+
+ if ((pos = arg.IndexOf (' ')) != -1 && pos != 0){
+ ref_line = System.Int32.Parse (arg.Substring (0, pos));
+ pos++;
+
+ char [] quotes = { '\"' };
+
+ string name = arg.Substring (pos). Trim (quotes);
+ ref_name = Location.LookupFile (name);
+ file_name.HasLineDirective = true;
+ ref_name.HasLineDirective = true;
+ Location.Push (ref_name);
+ } else {
+ ref_line = System.Int32.Parse (arg);
+ }
+ } catch {
+ return false;
+ }
+
+ return true;
+ }
+
+ //
+ // Handles #define and #undef
+ //
+ void PreProcessDefinition (bool is_define, string arg)
+ {
+ if (arg == "" || arg == "true" || arg == "false"){
+ Report.Error (1001, Location, "Missing identifer to pre-processor directive");
+ return;
+ }
+
+ char[] whitespace = { ' ', '\t' };
+ if (arg.IndexOfAny (whitespace) != -1){
+ Report.Error (1025, Location, "Single-line comment or end-of-line expected");
+ return;
+ }
+
+ if (!is_identifier_start_character (arg [0]))
+ Report.Error (1001, Location, "Identifier expected: " + arg);
+
+ foreach (char c in arg.Substring (1)){
+ if (!is_identifier_part_character (c)){
+ Report.Error (1001, Location, "Identifier expected: " + arg);
+ return;
+ }
+ }
+
+ if (is_define){
+ if (defines == null)
+ defines = new Hashtable ();
+ define (arg);
+ } else {
+ if (defines == null)
+ return;
+ if (defines.Contains (arg))
+ defines.Remove (arg);
+ }
+ }
+
+ /// <summary>
+ /// Handles #pragma directive
+ /// </summary>
+ void PreProcessPragma (string arg)
+ {
+ const string disable = "warning disable";
+ const string restore = "warning restore";
+
+ if (arg == disable) {
+ Report.RegisterWarningRegion (Location).WarningDisable (line);
+ return;
+ }
+
+ if (arg == restore) {
+ Report.RegisterWarningRegion (Location).WarningEnable (line);
+ return;
+ }
+
+ if (arg.StartsWith (disable)) {
+ int[] codes = ParseNumbers (arg.Substring (disable.Length));
+ foreach (int code in codes) {
+ if (code != 0)
+ Report.RegisterWarningRegion (Location).WarningDisable (Location, code);
+ }
+ return;
+ }
+
+ if (arg.StartsWith (restore)) {
+ int[] codes = ParseNumbers (arg.Substring (restore.Length));
+ foreach (int code in codes) {
+ Report.RegisterWarningRegion (Location).WarningEnable (Location, code);
+ }
+ return;
+ }
+
+ return;
+ }
+
+ int[] ParseNumbers (string text)
+ {
+ string[] string_array = text.Split (',');
+ int[] values = new int [string_array.Length];
+ int index = 0;
+ foreach (string string_code in string_array) {
+ try {
+ values[index++] = int.Parse (string_code, System.Globalization.CultureInfo.InvariantCulture);
+ }
+ catch (FormatException) {
+ Report.Warning (1692, Location, "Invalid number");
+ }
+ }
+ return values;
+ }
+
+ bool eval_val (string s)
+ {
+ if (s == "true")
+ return true;
+ if (s == "false")
+ return false;
+
+ if (defines == null)
+ return false;
+ if (defines.Contains (s))
+ return true;
+
+ return false;
+ }
+
+ bool pp_primary (ref string s)
+ {
+ s = s.Trim ();
+ int len = s.Length;
+
+ if (len > 0){
+ char c = s [0];
+
+ if (c == '('){
+ s = s.Substring (1);
+ bool val = pp_expr (ref s);
+ if (s.Length > 0 && s [0] == ')'){
+ s = s.Substring (1);
+ return val;
+ }
+ Error_InvalidDirective ();
+ return false;
+ }
+
+ if (is_identifier_start_character (c)){
+ int j = 1;
+
+ while (j < len){
+ c = s [j];
+
+ if (is_identifier_part_character (c)){
+ j++;
+ continue;
+ }
+ bool v = eval_val (s.Substring (0, j));
+ s = s.Substring (j);
+ return v;
+ }
+ bool vv = eval_val (s);
+ s = "";
+ return vv;
+ }
+ }
+ Error_InvalidDirective ();
+ return false;
+ }
+
+ bool pp_unary (ref string s)
+ {
+ s = s.Trim ();
+ int len = s.Length;
+
+ if (len > 0){
+ if (s [0] == '!'){
+ if (len > 1 && s [1] == '='){
+ Error_InvalidDirective ();
+ return false;
+ }
+ s = s.Substring (1);
+ return ! pp_primary (ref s);
+ } else
+ return pp_primary (ref s);
+ } else {
+ Error_InvalidDirective ();
+ return false;
+ }
+ }
+
+ bool pp_eq (ref string s)
+ {
+ bool va = pp_unary (ref s);
+
+ s = s.Trim ();
+ int len = s.Length;
+ if (len > 0){
+ if (s [0] == '='){
+ if (len > 2 && s [1] == '='){
+ s = s.Substring (2);
+ return va == pp_unary (ref s);
+ } else {
+ Error_InvalidDirective ();
+ return false;
+ }
+ } else if (s [0] == '!' && len > 1 && s [1] == '='){
+ s = s.Substring (2);
+
+ return va != pp_unary (ref s);
+
+ }
+ }
+
+ return va;
+
+ }
+
+ bool pp_and (ref string s)
+ {
+ bool va = pp_eq (ref s);
+
+ s = s.Trim ();
+ int len = s.Length;
+ if (len > 0){
+ if (s [0] == '&'){
+ if (len > 2 && s [1] == '&'){
+ s = s.Substring (2);
+ return (va & pp_eq (ref s));
+ } else {
+ Error_InvalidDirective ();
+ return false;
+ }
+ }
+ }
+ return va;
+ }
+
+ //
+ // Evaluates an expression for `#if' or `#elif'
+ //
+ bool pp_expr (ref string s)
+ {
+ bool va = pp_and (ref s);
+ s = s.Trim ();
+ int len = s.Length;
+ if (len > 0){
+ char c = s [0];
+
+ if (c == '|'){
+ if (len > 2 && s [1] == '|'){
+ s = s.Substring (2);
+ return va | pp_expr (ref s);
+ } else {
+ Error_InvalidDirective ();
+ return false;
+ }
+ }
+ }
+
+ return va;
+ }
+
+ bool eval (string s)
+ {
+ bool v = pp_expr (ref s);
+ s = s.Trim ();
+ if (s.Length != 0){
+ Error_InvalidDirective ();
+ return false;
+ }
+
+ return v;
+ }
+
+ void Error_InvalidDirective ()
+ {
+ Report.Error (1517, Location, "Invalid pre-processor directive");
+ }
+
+ void Error_UnexpectedDirective (string extra)
+ {
+ Report.Error (
+ 1028, Location,
+ "Unexpected processor directive (" + extra + ")");
+ }
+
+ void Error_TokensSeen ()
+ {
+ Report.Error (
+ 1032, Location,
+ "Cannot define or undefine pre-processor symbols after a token in the file");
+ }
+
+ //
+ // if true, then the code continues processing the code
+ // if false, the code stays in a loop until another directive is
+ // reached.
+ //
+ bool handle_preprocessing_directive (bool caller_is_taking)
+ {
+ string cmd, arg;
+ bool region_directive = false;
+
+ get_cmd_arg (out cmd, out arg);
+
+ // Eat any trailing whitespaces and single-line comments
+ if (arg.IndexOf ("//") != -1)
+ arg = arg.Substring (0, arg.IndexOf ("//"));
+ arg = arg.TrimEnd (' ', '\t');
+
+ //
+ // The first group of pre-processing instructions is always processed
+ //
+ switch (cmd){
+ case "pragma":
+ if (RootContext.Version == LanguageVersion.ISO_1) {
+ Report.FeatureIsNotStandardized (Location, "#pragma");
+ return caller_is_taking;
+ }
+
+ PreProcessPragma (arg);
+ return caller_is_taking;
+
+ case "line":
+ if (!PreProcessLine (arg))
+ Report.Error (
+ 1576, Location,
+ "Argument to #line directive is missing or invalid");
+ return caller_is_taking;
+
+ case "region":
+ region_directive = true;
+ arg = "true";
+ goto case "if";
+
+ case "endregion":
+ region_directive = true;
+ goto case "endif";
+
+ case "if":
+ if (arg == ""){
+ Error_InvalidDirective ();
+ return true;
+ }
+ bool taking = false;
+ if (ifstack == null)
+ ifstack = new Stack ();
+
+ if (ifstack.Count == 0){
+ taking = true;
+ } else {
+ int state = (int) ifstack.Peek ();
+ if ((state & TAKING) != 0)
+ taking = true;
+ }
+
+ if (eval (arg) && taking){
+ int push = TAKING | TAKEN_BEFORE | PARENT_TAKING;
+ if (region_directive)
+ push |= REGION;
+ ifstack.Push (push);
+ return true;
+ } else {
+ int push = (taking ? PARENT_TAKING : 0);
+ if (region_directive)
+ push |= REGION;
+ ifstack.Push (push);
+ return false;
+ }
+
+ case "endif":
+ if (ifstack == null || ifstack.Count == 0){
+ Error_UnexpectedDirective ("no #if for this #endif");
+ return true;
+ } else {
+ int pop = (int) ifstack.Pop ();
+
+ if (region_directive && ((pop & REGION) == 0))
+ Report.Error (1027, Location, "#endif directive expected");
+ else if (!region_directive && ((pop & REGION) != 0))
+ Report.Error (1038, Location, "#endregion directive expected");
+
+ if (ifstack.Count == 0)
+ return true;
+ else {
+ int state = (int) ifstack.Peek ();
+
+ if ((state & TAKING) != 0)
+ return true;
+ else
+ return false;
+ }
+ }
+
+ case "elif":
+ if (ifstack == null || ifstack.Count == 0){
+ Error_UnexpectedDirective ("no #if for this #elif");
+ return true;
+ } else {
+ int state = (int) ifstack.Peek ();
+
+ if ((state & REGION) != 0) {
+ Report.Error (1038, Location, "#endregion directive expected");
+ return true;
+ }
+
+ if ((state & ELSE_SEEN) != 0){
+ Error_UnexpectedDirective ("#elif not valid after #else");
+ return true;
+ }
+
+ if ((state & (TAKEN_BEFORE | TAKING)) != 0)
+ return false;
+
+ if (eval (arg) && ((state & PARENT_TAKING) != 0)){
+ state = (int) ifstack.Pop ();
+ ifstack.Push (state | TAKING | TAKEN_BEFORE);
+ return true;
+ } else
+ return false;
+ }
+
+ case "else":
+ if (ifstack == null || ifstack.Count == 0){
+ Report.Error (
+ 1028, Location,
+ "Unexpected processor directive (no #if for this #else)");
+ return true;
+ } else {
+ int state = (int) ifstack.Peek ();
+
+ if ((state & REGION) != 0) {
+ Report.Error (1038, Location, "#endregion directive expected");
+ return true;
+ }
+
+ if ((state & ELSE_SEEN) != 0){
+ Error_UnexpectedDirective ("#else within #else");
+ return true;
+ }
+
+ ifstack.Pop ();
+
+ bool ret;
+ if ((state & TAKEN_BEFORE) == 0){
+ ret = ((state & PARENT_TAKING) != 0);
+ } else
+ ret = false;
+
+ if (ret)
+ state |= TAKING;
+ else
+ state &= ~TAKING;
+
+ ifstack.Push (state | ELSE_SEEN);
+
+ return ret;
+ }
+ }
+
+ //
+ // These are only processed if we are in a `taking' block
+ //
+ if (!caller_is_taking)
+ return false;
+
+ switch (cmd){
+ case "define":
+ if (any_token_seen){
+ Error_TokensSeen ();
+ return true;
+ }
+ PreProcessDefinition (true, arg);
+ return true;
+
+ case "undef":
+ if (any_token_seen){
+ Error_TokensSeen ();
+ return true;
+ }
+ PreProcessDefinition (false, arg);
+ return true;
+
+ case "error":
+ Report.Error (1029, Location, "#error: '" + arg + "'");
+ return true;
+
+ case "warning":
+ Report.Warning (1030, Location, "#warning: '{0}'", arg);
+ return true;
+ }
+
+ Report.Error (1024, Location, "Preprocessor directive expected (got: " + cmd + ")");
+ return true;
+
+ }
+
+ private int consume_string (bool quoted)
+ {
+ int c;
+ string_builder.Length = 0;
+
+ while ((c = getChar ()) != -1){
+ if (c == '"'){
+ if (quoted && peekChar () == '"'){
+ string_builder.Append ((char) c);
+ getChar ();
+ continue;
+ } else {
+ val = string_builder.ToString ();
+ return Token.LITERAL_STRING;
+ }
+ }
+
+ if (c == '\n'){
+ if (!quoted)
+ Report.Error (1010, Location, "Newline in constant");
+ line++;
+ ref_line++;
+ col = 0;
+ } else
+ col++;
+
+ if (!quoted){
+ c = escape (c);
+ if (c == -1)
+ return Token.ERROR;
+ }
+ string_builder.Append ((char) c);
+ }
+
+ Report.Error (1039, Location, "Unterminated string literal");
+ return Token.EOF;
+ }
+
+ private int consume_identifier (int s)
+ {
+ int res = consume_identifier (s, false);
+
+ if (res == Token.PARTIAL) {
+ // Save current position and parse next token.
+ int old = reader.Position;
+ int old_putback = putback_char;
+
+ putback_char = -1;
+
+ int next_token = token ();
+ bool ok = (next_token == Token.CLASS) ||
+ (next_token == Token.STRUCT) ||
+ (next_token == Token.INTERFACE);
+
+ reader.Position = old;
+ putback_char = old_putback;
+
+ if (ok)
+ return res;
+ else {
+ val = "partial";
+ return Token.IDENTIFIER;
+ }
+ }
+
+ return res;
+ }
+
+ private int consume_identifier (int s, bool quoted)
+ {
+ int pos = 1;
+ int c;
+
+ id_builder [0] = (char) s;
+
+ while ((c = reader.Read ()) != -1) {
+ if (is_identifier_part_character ((char) c)){
+ if (pos == max_id_size){
+ Report.Error (645, Location, "Identifier too long (limit is 512 chars)");
+ return Token.ERROR;
+ }
+
+ id_builder [pos++] = (char) c;
+ putback_char = -1;
+ col++;
+ } else {
+ putback_char = c;
+ break;
+ }
+ }
+
+ //
+ // Optimization: avoids doing the keyword lookup
+ // on uppercase letters and _
+ //
+ if (!quoted && (s >= 'a' || s == '_')){
+ int keyword = GetKeyword (id_builder, pos);
+ if (keyword != -1)
+ return keyword;
+ }
+
+ //
+ // Keep identifiers in an array of hashtables to avoid needless
+ // allocations
+ //
+
+ if (identifiers [pos] != null) {
+ val = identifiers [pos][id_builder];
+ if (val != null) {
+ return Token.IDENTIFIER;
+ }
+ }
+ else
+ identifiers [pos] = new CharArrayHashtable (pos);
+
+ val = new String (id_builder, 0, pos);
+
+ char [] chars = new char [pos];
+ Array.Copy (id_builder, chars, pos);
+
+ identifiers [pos] [chars] = val;
+
+ return Token.IDENTIFIER;
+ }
+
+ public int xtoken ()
+ {
+ int t;
+ bool doread = false;
+ int c;
+
+ val = null;
+ // optimization: eliminate col and implement #directive semantic correctly.
+ for (;(c = getChar ()) != -1; col++) {
+ if (c == ' ')
+ continue;
+
+ if (c == '\t') {
+ col = (((col + 8) / 8) * 8) - 1;
+ continue;
+ }
+
+ if (c == ' ' || c == '\f' || c == '\v' || c == 0xa0)
+ continue;
+
+ if (c == '\r') {
+ if (peekChar () == '\n')
+ getChar ();
+
+ line++;
+ ref_line++;
+ col = 0;
+ any_token_seen |= tokens_seen;
+ tokens_seen = false;
+ continue;
+ }
+
+ // Handle double-slash comments.
+ if (c == '/'){
+ int d = peekChar ();
+
+ if (d == '/'){
+ getChar ();
+ while ((d = getChar ()) != -1 && (d != '\n') && d != '\r')
+ col++;
+ if (d == '\n'){
+ line++;
+ ref_line++;
+ col = 0;
+ }
+ any_token_seen |= tokens_seen;
+ tokens_seen = false;
+ continue;
+ } else if (d == '*'){
+ getChar ();
+
+ while ((d = getChar ()) != -1){
+ if (d == '*' && peekChar () == '/'){
+ getChar ();
+ col++;
+ break;
+ }
+ if (d == '\n'){
+ line++;
+ ref_line++;
+ col = 0;
+ any_token_seen |= tokens_seen;
+ tokens_seen = false;
+ }
+ }
+ continue;
+ }
+ goto is_punct_label;
+ }
+
+
+ if (is_identifier_start_character ((char)c)){
+ tokens_seen = true;
+ return consume_identifier (c);
+ }
+
+ is_punct_label:
+ if ((t = is_punct ((char)c, ref doread)) != Token.ERROR){
+ tokens_seen = true;
+ if (doread){
+ getChar ();
+ col++;
+ }
+ return t;
+ }
+
+ // white space
+ if (c == '\n'){
+ line++;
+ ref_line++;
+ col = 0;
+ any_token_seen |= tokens_seen;
+ tokens_seen = false;
+ continue;
+ }
+
+ if (c >= '0' && c <= '9'){
+ tokens_seen = true;
+ return is_number (c);
+ }
+
+ if (c == '.'){
+ tokens_seen = true;
+ int peek = peekChar ();
+ if (peek >= '0' && peek <= '9')
+ return is_number (c);
+ return Token.DOT;
+ }
+
+ /* For now, ignore pre-processor commands */
+ // FIXME: In C# the '#' is not limited to appear
+ // on the first column.
+ if (c == '#' && !tokens_seen){
+ bool cont = true;
+
+ start_again:
+
+ cont = handle_preprocessing_directive (cont);
+
+ if (cont){
+ col = 0;
+ continue;
+ }
+ col = 1;
+
+ bool skipping = false;
+ for (;(c = getChar ()) != -1; col++){
+ if (c == '\n'){
+ col = 0;
+ line++;
+ ref_line++;
+ skipping = false;
+ } else if (c == ' ' || c == '\t' || c == '\v' || c == '\r' || c == 0xa0)
+ continue;
+ else if (c != '#')
+ skipping = true;
+ if (c == '#' && !skipping)
+ goto start_again;
+ }
+ any_token_seen |= tokens_seen;
+ tokens_seen = false;
+ if (c == -1)
+ Report.Error (1027, Location, "#endif/#endregion expected");
+ continue;
+ }
+
+ if (c == '"')
+ return consume_string (false);
+
+ if (c == '\''){
+ c = getChar ();
+ tokens_seen = true;
+ if (c == '\''){
+ error_details = "Empty character literal";
+ Report.Error (1011, Location, error_details);
+ return Token.ERROR;
+ }
+ c = escape (c);
+ if (c == -1)
+ return Token.ERROR;
+ val = new System.Char ();
+ val = (char) c;
+ c = getChar ();
+
+ if (c != '\''){
+ error_details = "Too many characters in character literal";
+ Report.Error (1012, Location, error_details);
+
+ // Try to recover, read until newline or next "'"
+ while ((c = getChar ()) != -1){
+ if (c == '\n' || c == '\''){
+ line++;
+ ref_line++;
+ col = 0;
+ break;
+ } else
+ col++;
+
+ }
+ return Token.ERROR;
+ }
+ return Token.LITERAL_CHARACTER;
+ }
+
+ if (c == '@') {
+ c = getChar ();
+ if (c == '"') {
+ tokens_seen = true;
+ return consume_string (true);
+ } else if (is_identifier_start_character ((char) c)){
+ return consume_identifier (c, true);
+ } else {
+ Report.Error (1033, Location, "'@' must be followed by string constant or identifier");
+ }
+ }
+
+ if (c == '#') {
+ error_details = "Preprocessor directives must appear as the first non-whitespace " +
+ "character on a line.";
+
+ Report.Error (1040, Location, error_details);
+
+ return Token.ERROR;
+ }
+
+ error_details = ((char)c).ToString ();
+
+ return Token.ERROR;
+ }
+
+ return Token.EOF;
+ }
+
+ public void cleanup ()
+ {
+ if (ifstack != null && ifstack.Count >= 1) {
+ int state = (int) ifstack.Pop ();
+ if ((state & REGION) != 0)
+ Report.Error (1038, Location, "#endregion directive expected");
+ else
+ Report.Error (1027, "#endif directive expected");
+ }
+
+ }
+ }
+}
diff --git a/mcs/mcs/decl.cs b/mcs/mcs/decl.cs
index 8e3377acb45..87b12ad6069 100755
--- a/mcs/mcs/decl.cs
+++ b/mcs/mcs/decl.cs
@@ -2,6 +2,7 @@
// decl.cs: Declaration base class for structs, classes, enums and interfaces.
//
// Author: Miguel de Icaza (miguel@gnu.org)
+// Marek Safar (marek.safar@seznam.cz)
//
// Licensed under the terms of the GNU GPL
//
@@ -12,123 +13,214 @@
using System;
using System.Collections;
+using System.Globalization;
using System.Reflection.Emit;
using System.Reflection;
namespace Mono.CSharp {
+ public class MemberName {
+ public string Name;
+ public readonly MemberName Left;
+
+ public static readonly MemberName Null = new MemberName ("");
+
+ public MemberName (string name)
+ {
+ this.Name = name;
+ }
+
+ public MemberName (MemberName left, string name)
+ : this (name)
+ {
+ this.Left = left;
+ }
+
+ public MemberName (MemberName left, MemberName right)
+ : this (left, right.Name)
+ {
+ }
+
+ public string GetName ()
+ {
+ return GetName (false);
+ }
+
+ public string GetName (bool is_generic)
+ {
+ string name = is_generic ? Basename : Name;
+ if (Left != null)
+ return Left.GetName (is_generic) + "." + name;
+ else
+ return name;
+ }
+
+ ///
+ /// This returns exclusively the name as seen on the source code
+ /// it is not the fully qualifed type after resolution
+ ///
+ public string GetPartialName ()
+ {
+ if (Left != null)
+ return Left.GetPartialName () + "." + Name;
+ else
+ return Name;
+ }
+
+ public string GetTypeName ()
+ {
+ if (Left != null)
+ return Left.GetTypeName () + "." + Name;
+ else
+ return Name;
+ }
+
+ public Expression GetTypeExpression (Location loc)
+ {
+ if (Left != null) {
+ Expression lexpr = Left.GetTypeExpression (loc);
+
+ return new MemberAccess (lexpr, Name, loc);
+ } else {
+ return new SimpleName (Name, loc);
+ }
+ }
+
+ public MemberName Clone ()
+ {
+ if (Left != null)
+ return new MemberName (Left.Clone (), Name);
+ else
+ return new MemberName (Name);
+ }
+
+ public string Basename {
+ get {
+ return Name;
+ }
+ }
+
+ public override string ToString ()
+ {
+ throw new Exception ("This exception is thrown because someone is miss-using\n" +
+ "MemberName.ToString in the compiler. Please report this bug");
+
+ }
+ }
+
/// <summary>
- /// Base representation for members. This is only used to keep track
- /// of Name, Location and Modifier flags.
+ /// Base representation for members. This is used to keep track
+ /// of Name, Location and Modifier flags, and handling Attributes.
/// </summary>
- public abstract class MemberCore {
+ public abstract class MemberCore : Attributable {
/// <summary>
/// Public name
/// </summary>
- public string Name;
+ public string Name {
+ get {
+ // !(this is GenericMethod) && !(this is Method)
+ return MemberName.GetName (false);
+ }
+ }
+
+ public readonly MemberName MemberName;
/// <summary>
/// Modifier flags that the user specified in the source code
/// </summary>
public int ModFlags;
+ public readonly TypeContainer Parent;
+
/// <summary>
/// Location where this declaration happens
/// </summary>
public readonly Location Location;
- public MemberCore (string name, Location loc)
+ [Flags]
+ public enum Flags {
+ Obsolete_Undetected = 1, // Obsolete attribute has not been detected yet
+ Obsolete = 1 << 1, // Type has obsolete attribute
+ ClsCompliance_Undetected = 1 << 2, // CLS Compliance has not been detected yet
+ ClsCompliant = 1 << 3, // Type is CLS Compliant
+ CloseTypeCreated = 1 << 4, // Tracks whether we have Closed the type
+ HasCompliantAttribute_Undetected = 1 << 5, // Presence of CLSCompliantAttribute has not been detected
+ HasClsCompliantAttribute = 1 << 6, // Type has CLSCompliantAttribute
+ ClsCompliantAttributeTrue = 1 << 7, // Type has CLSCompliant (true)
+ Excluded_Undetected = 1 << 8, // Conditional attribute has not been detected yet
+ Excluded = 1 << 9, // Method is conditional
+ TestMethodDuplication = 1 << 10 // Test for duplication must be performed
+ }
+
+ /// <summary>
+ /// MemberCore flags at first detected then cached
+ /// </summary>
+ internal Flags caching_flags;
+
+ public MemberCore (TypeContainer parent, MemberName name, Attributes attrs,
+ Location loc)
+ : base (attrs)
{
- Name = name;
+ Parent = parent;
+ MemberName = name;
Location = loc;
+ caching_flags = Flags.Obsolete_Undetected | Flags.ClsCompliance_Undetected | Flags.HasCompliantAttribute_Undetected | Flags.Excluded_Undetected;
}
- protected void WarningNotHiding (TypeContainer parent)
+ /// <summary>
+ /// Tests presence of ObsoleteAttribute and report proper error
+ /// </summary>
+ protected void CheckUsageOfObsoleteAttribute (Type type)
{
- Report.Warning (
- 109, Location,
- "The member `" + parent.Name + "." + Name + "' does not hide an " +
- "inherited member. The keyword new is not required");
-
+ if (type == null)
+ return;
+
+ ObsoleteAttribute obsolete_attr = AttributeTester.GetObsoleteAttribute (type);
+ if (obsolete_attr == null)
+ return;
+
+ AttributeTester.Report_ObsoleteMessage (obsolete_attr, type.FullName, Location);
}
- static string MethodBaseName (MethodBase mb)
+ public abstract bool Define ();
+
+ //
+ // Returns full member name for error message
+ //
+ public virtual string GetSignatureForError ()
{
- return "`" + mb.ReflectedType.Name + "." + mb.Name + "'";
+ return Name;
}
- void Error_CannotChangeAccessModifiers (TypeContainer parent, MethodInfo parent_method)
+ /// <summary>
+ /// Use this method when MethodBuilder is null
+ /// </summary>
+ public virtual string GetSignatureForError (TypeContainer tc)
{
- //
- // FIXME: report the old/new permissions?
- //
- Report.Error (
- 507, "`" + parent_method + "." + Name +
- ": can't change the access modifiers from `" +
- parent_method.DeclaringType.Name + "." + parent_method.Name + "'");
+ return Name;
}
-
- //
- // Performs various checks on the MethodInfo `mb' regarding the modifier flags
- // that have been defined.
- //
- // `name' is the user visible name for reporting errors (this is used to
- // provide the right name regarding method names and properties)
- //
- protected bool CheckMethodAgainstBase (TypeContainer parent,
- MethodAttributes my_attrs, MethodInfo mb)
+
+ /// <summary>
+ /// Base Emit method. This is also entry point for CLS-Compliant verification.
+ /// </summary>
+ public virtual void Emit ()
{
- bool ok = true;
-
- if ((ModFlags & Modifiers.OVERRIDE) != 0){
- if (!(mb.IsAbstract || mb.IsVirtual)){
- Report.Error (
- 506, Location, parent.MakeName (Name) +
- ": cannot override inherited member " +
- MethodBaseName (mb) + " because it is not " +
- "virtual, abstract or override");
- ok = false;
- }
-
- // Now we check that the overriden method is not final
-
- if (mb.IsFinal) {
- Report.Error (239, Location, parent.MakeName (Name) + " : cannot " +
- "override inherited member " + MethodBaseName (mb) +
- " because it is sealed.");
- ok = false;
- }
+ // Hack with Parent == null is for EnumMember
+ if (Parent == null || (GetObsoleteAttribute (Parent) == null && Parent.GetObsoleteAttribute (Parent) == null))
+ VerifyObsoleteAttribute ();
- //
- // Check that the permissions are not being changed
- //
- MethodAttributes thisp = my_attrs & MethodAttributes.MemberAccessMask;
- MethodAttributes parentp = mb.Attributes & MethodAttributes.MemberAccessMask;
+ if (!RootContext.VerifyClsCompliance)
+ return;
- if (thisp != parentp){
- Error_CannotChangeAccessModifiers (parent, mb);
- ok = false;
- }
- }
+ VerifyClsCompliance (Parent);
+ }
- if (mb.IsVirtual || mb.IsAbstract){
- if ((ModFlags & (Modifiers.NEW | Modifiers.OVERRIDE)) == 0){
- if (Name != "Finalize" && (RootContext.WarningLevel >= 2)){
- Report.Warning (
- 114, Location, parent.MakeName (Name) +
- " hides inherited member " + MethodBaseName (mb) +
- ". To make the current member override that " +
- "implementation, add the override keyword, " +
- "otherwise use the new keyword");
- }
- }
+ public bool InUnsafe {
+ get {
+ return ((ModFlags & Modifiers.UNSAFE) != 0) || Parent.UnsafeContext;
}
-
- return ok;
}
- public abstract bool Define (TypeContainer parent);
-
//
// Whehter is it ok to use an unsafe pointer in this type container
//
@@ -146,53 +238,133 @@ namespace Mono.CSharp {
Expression.UnsafeError (Location);
return false;
}
- }
- //
- // FIXME: This is temporary outside DeclSpace, because I have to fix a bug
- // in MCS that makes it fail the lookup for the enum
- //
-
- /// <summary>
- /// The result value from adding an declaration into
- /// a struct or a class
- /// </summary>
- public enum AdditionResult {
- /// <summary>
- /// The declaration has been successfully
- /// added to the declation space.
- /// </summary>
- Success,
-
- /// <summary>
- /// The symbol has already been defined.
- /// </summary>
- NameExists,
-
- /// <summary>
- /// Returned if the declation being added to the
- /// name space clashes with its container name.
- ///
- /// The only exceptions for this are constructors
- /// and static constructors
- /// </summary>
- EnclosingClash,
-
- /// <summary>
- /// Returned if a constructor was created (because syntactically
- /// it looked like a constructor) but was not (because the name
- /// of the method is not the same as the container class
- /// </summary>
- NotAConstructor,
-
- /// <summary>
- /// This is only used by static constructors to emit the
- /// error 111, but this error for other things really
- /// happens at another level for other functions.
- /// </summary>
- MethodExists
+ /// <summary>
+ /// Returns instance of ObsoleteAttribute for this MemberCore
+ /// </summary>
+ public ObsoleteAttribute GetObsoleteAttribute (DeclSpace ds)
+ {
+ // ((flags & (Flags.Obsolete_Undetected | Flags.Obsolete)) == 0) is slower, but why ?
+ if ((caching_flags & Flags.Obsolete_Undetected) == 0 && (caching_flags & Flags.Obsolete) == 0) {
+ return null;
+ }
+
+ caching_flags &= ~Flags.Obsolete_Undetected;
+
+ if (OptAttributes == null)
+ return null;
+
+ // TODO: remove this allocation
+ EmitContext ec = new EmitContext (ds.Parent, ds, ds.Location,
+ null, null, ds.ModFlags, false);
+
+ Attribute obsolete_attr = OptAttributes.Search (TypeManager.obsolete_attribute_type, ec);
+ if (obsolete_attr == null)
+ return null;
+
+ ObsoleteAttribute obsolete = obsolete_attr.GetObsoleteAttribute (ds);
+ if (obsolete == null)
+ return null;
+
+ caching_flags |= Flags.Obsolete;
+ return obsolete;
}
+ /// <summary>
+ /// Analyze whether CLS-Compliant verification must be execute for this MemberCore.
+ /// </summary>
+ public override bool IsClsCompliaceRequired (DeclSpace container)
+ {
+ if ((caching_flags & Flags.ClsCompliance_Undetected) == 0)
+ return (caching_flags & Flags.ClsCompliant) != 0;
+
+ if (GetClsCompliantAttributeValue (container) && IsExposedFromAssembly (container)) {
+ caching_flags &= ~Flags.ClsCompliance_Undetected;
+ caching_flags |= Flags.ClsCompliant;
+ return true;
+ }
+
+ caching_flags &= ~Flags.ClsCompliance_Undetected;
+ return false;
+ }
+
+ /// <summary>
+ /// Returns true when MemberCore is exposed from assembly.
+ /// </summary>
+ protected bool IsExposedFromAssembly (DeclSpace ds)
+ {
+ if ((ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)
+ return false;
+
+ DeclSpace parentContainer = ds;
+ while (parentContainer != null && parentContainer.ModFlags != 0) {
+ if ((parentContainer.ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)
+ return false;
+ parentContainer = parentContainer.Parent;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// Resolve CLSCompliantAttribute value or gets cached value.
+ /// </summary>
+ bool GetClsCompliantAttributeValue (DeclSpace ds)
+ {
+ if (OptAttributes != null) {
+ EmitContext ec = new EmitContext (ds.Parent, ds, ds.Location,
+ null, null, ds.ModFlags, false);
+ Attribute cls_attribute = OptAttributes.GetClsCompliantAttribute (ec);
+ if (cls_attribute != null) {
+ caching_flags |= Flags.HasClsCompliantAttribute;
+ return cls_attribute.GetClsCompliantAttributeValue (ds);
+ }
+ }
+ return ds.GetClsCompliantAttributeValue ();
+ }
+
+ /// <summary>
+ /// Returns true if MemberCore is explicitly marked with CLSCompliantAttribute
+ /// </summary>
+ protected bool HasClsCompliantAttribute {
+ get {
+ return (caching_flags & Flags.HasClsCompliantAttribute) != 0;
+ }
+ }
+
+
+ /// <summary>
+ /// The main virtual method for CLS-Compliant verifications.
+ /// The method returns true if member is CLS-Compliant and false if member is not
+ /// CLS-Compliant which means that CLS-Compliant tests are not necessary. A descendants override it
+ /// and add their extra verifications.
+ /// </summary>
+ protected virtual bool VerifyClsCompliance (DeclSpace ds)
+ {
+ if (!IsClsCompliaceRequired (ds)) {
+ if ((RootContext.WarningLevel >= 2) && HasClsCompliantAttribute && !IsExposedFromAssembly (ds)) {
+ Report.Warning (3019, Location, "CLS compliance checking will not be performed on '{0}' because it is private or internal", GetSignatureForError ());
+ }
+ return false;
+ }
+
+ if (!CodeGen.Assembly.IsClsCompliant) {
+ if (HasClsCompliantAttribute) {
+ Report.Error (3014, Location, "'{0}' cannot be marked as CLS-compliant because the assembly does not have a CLSCompliant attribute", GetSignatureForError ());
+ }
+ return false;
+ }
+
+ int index = Name.LastIndexOf ('.');
+ if (Name [index > 0 ? index + 1 : 0] == '_') {
+ Report.Error (3008, Location, "Identifier '{0}' is not CLS-compliant", GetSignatureForError () );
+ }
+ return true;
+ }
+
+ protected abstract void VerifyObsoleteAttribute ();
+
+ }
+
/// <summary>
/// Base class for structs, classes, enumerations and interfaces.
/// </summary>
@@ -208,68 +380,72 @@ namespace Mono.CSharp {
/// </summary>
public TypeBuilder TypeBuilder;
- /// <summary>
- /// This variable tracks whether we have Closed the type
- /// </summary>
- public bool Created = false;
-
//
// This is the namespace in which this typecontainer
// was declared. We use this to resolve names.
//
- public Namespace Namespace;
+ public NamespaceEntry NamespaceEntry;
public Hashtable Cache = new Hashtable ();
public string Basename;
- /// <summary>
- /// defined_names is used for toplevel objects
- /// </summary>
protected Hashtable defined_names;
- TypeContainer parent;
+ static string[] attribute_targets = new string [] { "type" };
- public DeclSpace (TypeContainer parent, string name, Location l)
- : base (name, l)
+ public DeclSpace (NamespaceEntry ns, TypeContainer parent, MemberName name,
+ Attributes attrs, Location l)
+ : base (parent, name, attrs, l)
{
- Basename = name.Substring (1 + name.LastIndexOf ('.'));
+ NamespaceEntry = ns;
+ Basename = name.Name;
defined_names = new Hashtable ();
- this.parent = parent;
}
/// <summary>
- /// Returns a status code based purely on the name
- /// of the member being added
+ /// Adds the member to defined_names table. It tests for duplications and enclosing name conflicts
/// </summary>
- protected AdditionResult IsValid (string name)
+ protected bool AddToContainer (MemberCore symbol, bool is_method, string fullname, string basename)
{
- if (name == Basename)
- return AdditionResult.EnclosingClash;
+ if (basename == Basename && !(this is Interface)) {
+ Report.SymbolRelatedToPreviousError (this);
+ Report.Error (542, "'{0}': member names cannot be the same as their enclosing type", symbol.Location, symbol.GetSignatureForError ());
+ return false;
+ }
- if (defined_names.Contains (name))
- return AdditionResult.NameExists;
+ MemberCore mc = (MemberCore)defined_names [fullname];
- return AdditionResult.Success;
+ if (is_method && (mc is MethodCore || mc is IMethodData)) {
+ symbol.caching_flags |= Flags.TestMethodDuplication;
+ mc.caching_flags |= Flags.TestMethodDuplication;
+ return true;
+ }
+
+ if (mc != null) {
+ Report.SymbolRelatedToPreviousError (mc);
+ Report.Error (102, symbol.Location, "The type '{0}' already contains a definition for '{1}'", GetSignatureForError (), basename);
+ return false;
+ }
+
+ defined_names.Add (fullname, symbol);
+ return true;
}
- /// <summary>
- /// Introduce @name into this declaration space and
- /// associates it with the object @o. Note that for
- /// methods this will just point to the first method. o
- /// </summary>
- protected void DefineName (string name, object o)
+ public void RecordDecl ()
{
- defined_names.Add (name, o);
+ if ((NamespaceEntry != null) && (Parent == RootContext.Tree.Types))
+ NamespaceEntry.DefineName (MemberName.Basename, this);
}
/// <summary>
- /// Returns the object associated with a given name in the declaration
- /// space. This is the inverse operation of `DefineName'
+ /// Returns the MemberCore associated with a given name in the declaration
+ /// space. It doesn't return method based symbols !!
/// </summary>
- public object GetDefinition (string name)
+ ///
+ public MemberCore GetDefinition (string name)
{
- return defined_names [name];
+ return (MemberCore)defined_names [name];
}
bool in_transit = false;
@@ -288,12 +464,17 @@ namespace Mono.CSharp {
}
}
- public TypeContainer Parent {
- get {
- return parent;
- }
+ /// <summary>
+ /// Looks up the alias for the name
+ /// </summary>
+ public string LookupAlias (string name)
+ {
+ if (NamespaceEntry != null)
+ return NamespaceEntry.LookupAlias (name);
+ else
+ return null;
}
-
+
//
// root_types contains all the types. All TopLevel types
// hence have a parent that points to `root_types', that is
@@ -301,8 +482,8 @@ namespace Mono.CSharp {
//
public bool IsTopLevel {
get {
- if (parent != null){
- if (parent.parent == null)
+ if (Parent != null){
+ if (Parent.Parent == null)
return true;
}
return false;
@@ -311,7 +492,7 @@ namespace Mono.CSharp {
public virtual void CloseType ()
{
- if (!Created){
+ if ((caching_flags & Flags.CloseTypeCreated) == 0){
try {
TypeBuilder.CreateType ();
} catch {
@@ -326,15 +507,21 @@ namespace Mono.CSharp {
// Note that this still creates the type and
// it is possible to save it
}
- Created = true;
+ caching_flags |= Flags.CloseTypeCreated;
}
}
/// <remarks>
/// Should be overriten by the appropriate declaration space
- /// <remarks>
+ /// </remarks>
public abstract TypeBuilder DefineType ();
+ /// <summary>
+ /// Define all members, but don't apply any attributes or do anything which may
+ /// access not-yet-defined classes. This method also creates the MemberCache.
+ /// </summary>
+ public abstract bool DefineMembers (TypeContainer parent);
+
//
// Whether this is an `unsafe context'
//
@@ -342,44 +529,317 @@ namespace Mono.CSharp {
get {
if ((ModFlags & Modifiers.UNSAFE) != 0)
return true;
- if (parent != null)
- return parent.UnsafeContext;
+ if (Parent != null)
+ return Parent.UnsafeContext;
return false;
}
}
public static string MakeFQN (string nsn, string name)
{
- string prefix = (nsn == "" ? "" : nsn + ".");
+ if (nsn == "")
+ return name;
+ return String.Concat (nsn, ".", name);
+ }
+
+ EmitContext type_resolve_ec;
+ EmitContext GetTypeResolveEmitContext (TypeContainer parent, Location loc)
+ {
+ type_resolve_ec = new EmitContext (parent, this, loc, null, null, ModFlags, false);
+ type_resolve_ec.ResolvingTypeTree = true;
+
+ return type_resolve_ec;
+ }
+
+ // <summary>
+ // Looks up the type, as parsed into the expression `e'.
+ // </summary>
+ //[Obsolete ("This method is going away soon")]
+ public Type ResolveType (Expression e, bool silent, Location loc)
+ {
+ TypeExpr d = ResolveTypeExpr (e, silent, loc);
+ return d == null ? null : d.Type;
+ }
+
+ // <summary>
+ // Resolves the expression `e' for a type, and will recursively define
+ // types. This should only be used for resolving base types.
+ // </summary>
+ public TypeExpr ResolveTypeExpr (Expression e, bool silent, Location loc)
+ {
+ if (type_resolve_ec == null)
+ type_resolve_ec = GetTypeResolveEmitContext (Parent, loc);
+ type_resolve_ec.loc = loc;
+ type_resolve_ec.ContainerType = TypeBuilder;
+
+ return e.ResolveAsTypeTerminal (type_resolve_ec, silent);
+ }
+
+ public bool CheckAccessLevel (Type check_type)
+ {
+ if (check_type == TypeBuilder)
+ return true;
+
+ TypeAttributes check_attr = check_type.Attributes & TypeAttributes.VisibilityMask;
+
+ //
+ // Broken Microsoft runtime, return public for arrays, no matter what
+ // the accessibility is for their underlying class, and they return
+ // NonPublic visibility for pointers
+ //
+ if (check_type.IsArray || check_type.IsPointer)
+ return CheckAccessLevel (TypeManager.GetElementType (check_type));
+
+ if (TypeBuilder == null)
+ // FIXME: TypeBuilder will be null when invoked by Class.GetNormalBases().
+ // However, this is invoked again later -- so safe to return true.
+ // May also be null when resolving top-level attributes.
+ return true;
+
+ switch (check_attr){
+ case TypeAttributes.Public:
+ return true;
+
+ case TypeAttributes.NotPublic:
+ //
+ // This test should probably use the declaringtype.
+ //
+ return check_type.Assembly == TypeBuilder.Assembly;
+
+ case TypeAttributes.NestedPublic:
+ return true;
+
+ case TypeAttributes.NestedPrivate:
+ return NestedAccessible (check_type);
+
+ case TypeAttributes.NestedFamily:
+ return FamilyAccessible (check_type);
+
+ case TypeAttributes.NestedFamANDAssem:
+ return (check_type.Assembly == TypeBuilder.Assembly) &&
+ FamilyAccessible (check_type);
+
+ case TypeAttributes.NestedFamORAssem:
+ return (check_type.Assembly == TypeBuilder.Assembly) ||
+ FamilyAccessible (check_type);
+
+ case TypeAttributes.NestedAssembly:
+ return check_type.Assembly == TypeBuilder.Assembly;
+ }
- return prefix + name;
+ Console.WriteLine ("HERE: " + check_attr);
+ return false;
+
+ }
+
+ protected bool NestedAccessible (Type check_type)
+ {
+ string check_type_name = check_type.FullName;
+
+ // At this point, we already know check_type is a nested class.
+ int cio = check_type_name.LastIndexOf ('+');
+
+ // Ensure that the string 'container' has a '+' in it to avoid false matches
+ string container = check_type_name.Substring (0, cio + 1);
+
+ // Ensure that type_name ends with a '+' so that it can match 'container', if necessary
+ string type_name = TypeBuilder.FullName + "+";
+
+ // If the current class is nested inside the container of check_type,
+ // we can access check_type even if it is private or protected.
+ return type_name.StartsWith (container);
+ }
+
+ protected bool FamilyAccessible (Type check_type)
+ {
+ Type declaring = check_type.DeclaringType;
+ if (TypeBuilder == declaring ||
+ TypeBuilder.IsSubclassOf (declaring))
+ return true;
+
+ return NestedAccessible (check_type);
+ }
+
+ // Access level of a type.
+ const int X = 1;
+ enum AccessLevel { // Each column represents `is this scope larger or equal to Blah scope'
+ // Public Assembly Protected
+ Protected = (0 << 0) | (0 << 1) | (X << 2),
+ Public = (X << 0) | (X << 1) | (X << 2),
+ Private = (0 << 0) | (0 << 1) | (0 << 2),
+ Internal = (0 << 0) | (X << 1) | (0 << 2),
+ ProtectedOrInternal = (0 << 0) | (X << 1) | (X << 2),
+ }
+
+ static AccessLevel GetAccessLevelFromModifiers (int flags)
+ {
+ if ((flags & Modifiers.INTERNAL) != 0) {
+
+ if ((flags & Modifiers.PROTECTED) != 0)
+ return AccessLevel.ProtectedOrInternal;
+ else
+ return AccessLevel.Internal;
+
+ } else if ((flags & Modifiers.PROTECTED) != 0)
+ return AccessLevel.Protected;
+
+ else if ((flags & Modifiers.PRIVATE) != 0)
+ return AccessLevel.Private;
+
+ else
+ return AccessLevel.Public;
+ }
+
+ // What is the effective access level of this?
+ // TODO: Cache this?
+ AccessLevel EffectiveAccessLevel {
+ get {
+ AccessLevel myAccess = GetAccessLevelFromModifiers (ModFlags);
+ if (!IsTopLevel && (Parent != null))
+ return myAccess & Parent.EffectiveAccessLevel;
+ else
+ return myAccess;
+ }
+ }
+
+ // Return the access level for type `t'
+ static AccessLevel TypeEffectiveAccessLevel (Type t)
+ {
+ if (t.IsPublic)
+ return AccessLevel.Public;
+ if (t.IsNestedPrivate)
+ return AccessLevel.Private;
+ if (t.IsNotPublic)
+ return AccessLevel.Internal;
+
+ // By now, it must be nested
+ AccessLevel parentLevel = TypeEffectiveAccessLevel (t.DeclaringType);
+
+ if (t.IsNestedPublic)
+ return parentLevel;
+ if (t.IsNestedAssembly)
+ return parentLevel & AccessLevel.Internal;
+ if (t.IsNestedFamily)
+ return parentLevel & AccessLevel.Protected;
+ if (t.IsNestedFamORAssem)
+ return parentLevel & AccessLevel.ProtectedOrInternal;
+ if (t.IsNestedFamANDAssem)
+ throw new NotImplementedException ("NestedFamANDAssem not implemented, cant make this kind of type from c# anyways");
+
+ // nested private is taken care of
+
+ throw new Exception ("I give up, what are you?");
+ }
+
+ //
+ // This answers `is the type P, as accessible as a member M which has the
+ // accessability @flags which is declared as a nested member of the type T, this declspace'
+ //
+ public bool AsAccessible (Type p, int flags)
+ {
+ //
+ // 1) if M is private, its accessability is the same as this declspace.
+ // we already know that P is accessible to T before this method, so we
+ // may return true.
+ //
+
+ if ((flags & Modifiers.PRIVATE) != 0)
+ return true;
+
+ while (p.IsArray || p.IsPointer || p.IsByRef)
+ p = TypeManager.GetElementType (p);
+
+ AccessLevel pAccess = TypeEffectiveAccessLevel (p);
+ AccessLevel mAccess = this.EffectiveAccessLevel &
+ GetAccessLevelFromModifiers (flags);
+
+ // for every place from which we can access M, we must
+ // be able to access P as well. So, we want
+ // For every bit in M and P, M_i -> P_1 == true
+ // or, ~ (M -> P) == 0 <-> ~ ( ~M | P) == 0
+
+ return ~ (~ mAccess | pAccess) == 0;
}
+
+ static DoubleHash dh = new DoubleHash (1000);
+ Type DefineTypeAndParents (DeclSpace tc)
+ {
+ DeclSpace container = tc.Parent;
+
+ if (container.TypeBuilder == null && container.Name != "")
+ DefineTypeAndParents (container);
+
+ return tc.DefineType ();
+ }
+
Type LookupInterfaceOrClass (string ns, string name, out bool error)
{
DeclSpace parent;
Type t;
-
+ object r;
+
error = false;
- name = MakeFQN (ns, name);
+ int p = name.LastIndexOf ('.');
+
+ if (dh.Lookup (ns, name, out r))
+ return (Type) r;
+ else {
+ //
+ // If the type is not a nested type, we do not need `LookupType's processing.
+ // If the @name does not have a `.' in it, this cant be a nested type.
+ //
+ if (ns != ""){
+ if (Namespace.IsNamespace (ns)) {
+ if (p != -1)
+ t = TypeManager.LookupType (ns + "." + name);
+ else
+ t = TypeManager.LookupTypeDirect (ns + "." + name);
+ } else
+ t = null;
+ } else if (p != -1)
+ t = TypeManager.LookupType (name);
+ else
+ t = TypeManager.LookupTypeDirect (name);
+ }
- t = TypeManager.LookupType (name);
- if (t != null)
+ if (t != null) {
+ dh.Insert (ns, name, t);
return t;
+ }
- parent = (DeclSpace) RootContext.Tree.Decls [name];
- if (parent == null)
- return null;
+ //
+ // In case we are fed a composite name, normalize it.
+ //
+
+ if (p != -1){
+ ns = MakeFQN (ns, name.Substring (0, p));
+ name = name.Substring (p+1);
+ }
- t = parent.DefineType ();
+ parent = RootContext.Tree.LookupByNamespace (ns, name);
+ if (parent == null) {
+ dh.Insert (ns, name, null);
+ return null;
+ }
+
+ t = DefineTypeAndParents (parent);
if (t == null){
- Report.Error (146, "Class definition is circular: `"+name+"'");
error = true;
return null;
}
+
+ dh.Insert (ns, name, t);
return t;
}
-
+
+ public static void Error_AmbiguousTypeReference (Location loc, string name, Type t1, Type t2)
+ {
+ Report.Error (104, loc,
+ String.Format ("`{0}' is an ambiguous reference ({1} or {2}) ", name,
+ t1.FullName, t2.FullName));
+ }
+
/// <summary>
/// GetType is used to resolve type names at the DeclSpace level.
/// Use this to lookup class/struct bases, interface bases or
@@ -392,7 +852,7 @@ namespace Mono.CSharp {
/// during the tree resolution process and potentially define
/// recursively the type
/// </remarks>
- public Type FindType (string name)
+ public Type FindType (Location loc, string name)
{
Type t;
bool error;
@@ -404,29 +864,29 @@ namespace Mono.CSharp {
DeclSpace containing_ds = this;
while (containing_ds != null){
- Type current_type = containing_ds.TypeBuilder;
+ Type container_type = containing_ds.TypeBuilder;
+ Type current_type = container_type;
- while (current_type != null) {
+ while (current_type != null && current_type != TypeManager.object_type) {
string pre = current_type.FullName;
-
+
t = LookupInterfaceOrClass (pre, name, out error);
if (error)
return null;
- if (t != null)
+ if ((t != null) && containing_ds.CheckAccessLevel (t))
return t;
current_type = current_type.BaseType;
}
containing_ds = containing_ds.Parent;
}
-
+
//
// Attempt to lookup the class on our namespace and all it's implicit parents
//
- for (string ns = Namespace.Name; ns != null; ns = RootContext.ImplicitParent (ns)) {
-
- t = LookupInterfaceOrClass (ns, name, out error);
+ for (NamespaceEntry ns = NamespaceEntry; ns != null; ns = ns.ImplicitParent) {
+ t = LookupInterfaceOrClass (ns.FullName, name, out error);
if (error)
return null;
@@ -449,36 +909,1095 @@ namespace Mono.CSharp {
// namespaces
//
- for (Namespace ns = Namespace; ns != null; ns = ns.Parent){
+ for (NamespaceEntry ns = NamespaceEntry; ns != null; ns = ns.Parent){
- t = LookupInterfaceOrClass (ns.Name, name, out error);
+ t = LookupInterfaceOrClass (ns.FullName, name, out error);
if (error)
return null;
if (t != null)
return t;
- //
- // Now check the using clause list
- //
- ArrayList using_list = ns.UsingTable;
-
- if (using_list == null)
+ if (name.IndexOf ('.') > 0)
continue;
- foreach (string n in using_list){
- t = LookupInterfaceOrClass (n, name, out error);
+ string alias_value = ns.LookupAlias (name);
+ if (alias_value != null) {
+ t = LookupInterfaceOrClass ("", alias_value, out error);
if (error)
return null;
if (t != null)
return t;
}
+
+ //
+ // Now check the using clause list
+ //
+ Type match = null;
+ foreach (Namespace using_ns in ns.GetUsingTable ()) {
+ match = LookupInterfaceOrClass (using_ns.Name, name, out error);
+ if (error)
+ return null;
+
+ if (match != null){
+ if (t != null){
+ if (CheckAccessLevel (match)) {
+ Error_AmbiguousTypeReference (loc, name, t, match);
+ return null;
+ }
+ continue;
+ }
+
+ t = match;
+ }
+ }
+ if (t != null)
+ return t;
+ }
+
+ //Report.Error (246, Location, "Can not find type `"+name+"'");
+ return null;
+ }
+
+ /// <remarks>
+ /// This function is broken and not what you're looking for. It should only
+ /// be used while the type is still being created since it doesn't use the cache
+ /// and relies on the filter doing the member name check.
+ /// </remarks>
+ public abstract MemberList FindMembers (MemberTypes mt, BindingFlags bf,
+ MemberFilter filter, object criteria);
+
+ /// <remarks>
+ /// If we have a MemberCache, return it. This property may return null if the
+ /// class doesn't have a member cache or while it's still being created.
+ /// </remarks>
+ public abstract MemberCache MemberCache {
+ get;
+ }
+
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
+ {
+ try {
+ TypeBuilder.SetCustomAttribute (cb);
+ } catch (System.ArgumentException e) {
+ Report.Warning (-21, a.Location,
+ "The CharSet named property on StructLayout\n"+
+ "\tdoes not work correctly on Microsoft.NET\n"+
+ "\tYou might want to remove the CharSet declaration\n"+
+ "\tor compile using the Mono runtime instead of the\n"+
+ "\tMicrosoft .NET runtime\n"+
+ "\tThe runtime gave the error: " + e);
+ }
+ }
+
+ /// <summary>
+ /// Goes through class hierarchy and get value of first CLSCompliantAttribute that found.
+ /// If no is attribute exists then return assembly CLSCompliantAttribute.
+ /// </summary>
+ public bool GetClsCompliantAttributeValue ()
+ {
+ if ((caching_flags & Flags.HasCompliantAttribute_Undetected) == 0)
+ return (caching_flags & Flags.ClsCompliantAttributeTrue) != 0;
+
+ caching_flags &= ~Flags.HasCompliantAttribute_Undetected;
+
+ if (OptAttributes != null) {
+ EmitContext ec = new EmitContext (Parent, this, Location,
+ null, null, ModFlags, false);
+ Attribute cls_attribute = OptAttributes.GetClsCompliantAttribute (ec);
+ if (cls_attribute != null) {
+ caching_flags |= Flags.HasClsCompliantAttribute;
+ if (cls_attribute.GetClsCompliantAttributeValue (this)) {
+ caching_flags |= Flags.ClsCompliantAttributeTrue;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ if (Parent == null) {
+ if (CodeGen.Assembly.IsClsCompliant) {
+ caching_flags |= Flags.ClsCompliantAttributeTrue;
+ return true;
+ }
+ return false;
+ }
+
+ if (Parent.GetClsCompliantAttributeValue ()) {
+ caching_flags |= Flags.ClsCompliantAttributeTrue;
+ return true;
+ }
+ return false;
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+ }
+
+ /// <summary>
+ /// This is a readonly list of MemberInfo's.
+ /// </summary>
+ public class MemberList : IList {
+ public readonly IList List;
+ int count;
+
+ /// <summary>
+ /// Create a new MemberList from the given IList.
+ /// </summary>
+ public MemberList (IList list)
+ {
+ if (list != null)
+ this.List = list;
+ else
+ this.List = new ArrayList ();
+ count = List.Count;
+ }
+
+ /// <summary>
+ /// Concatenate the ILists `first' and `second' to a new MemberList.
+ /// </summary>
+ public MemberList (IList first, IList second)
+ {
+ ArrayList list = new ArrayList ();
+ list.AddRange (first);
+ list.AddRange (second);
+ count = list.Count;
+ List = list;
+ }
+
+ public static readonly MemberList Empty = new MemberList (new ArrayList ());
+
+ /// <summary>
+ /// Cast the MemberList into a MemberInfo[] array.
+ /// </summary>
+ /// <remarks>
+ /// This is an expensive operation, only use it if it's really necessary.
+ /// </remarks>
+ public static explicit operator MemberInfo [] (MemberList list)
+ {
+ Timer.StartTimer (TimerType.MiscTimer);
+ MemberInfo [] result = new MemberInfo [list.Count];
+ list.CopyTo (result, 0);
+ Timer.StopTimer (TimerType.MiscTimer);
+ return result;
+ }
+
+ // ICollection
+
+ public int Count {
+ get {
+ return count;
+ }
+ }
+
+ public bool IsSynchronized {
+ get {
+ return List.IsSynchronized;
+ }
+ }
+
+ public object SyncRoot {
+ get {
+ return List.SyncRoot;
+ }
+ }
+
+ public void CopyTo (Array array, int index)
+ {
+ List.CopyTo (array, index);
+ }
+
+ // IEnumerable
+
+ public IEnumerator GetEnumerator ()
+ {
+ return List.GetEnumerator ();
+ }
+
+ // IList
+
+ public bool IsFixedSize {
+ get {
+ return true;
+ }
+ }
+
+ public bool IsReadOnly {
+ get {
+ return true;
+ }
+ }
+
+ object IList.this [int index] {
+ get {
+ return List [index];
+ }
+
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+
+ // FIXME: try to find out whether we can avoid the cast in this indexer.
+ public MemberInfo this [int index] {
+ get {
+ return (MemberInfo) List [index];
+ }
+ }
+
+ public int Add (object value)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public void Clear ()
+ {
+ throw new NotSupportedException ();
+ }
+
+ public bool Contains (object value)
+ {
+ return List.Contains (value);
+ }
+
+ public int IndexOf (object value)
+ {
+ return List.IndexOf (value);
+ }
+
+ public void Insert (int index, object value)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public void Remove (object value)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public void RemoveAt (int index)
+ {
+ throw new NotSupportedException ();
+ }
+ }
+
+ /// <summary>
+ /// This interface is used to get all members of a class when creating the
+ /// member cache. It must be implemented by all DeclSpace derivatives which
+ /// want to support the member cache and by TypeHandle to get caching of
+ /// non-dynamic types.
+ /// </summary>
+ public interface IMemberContainer {
+ /// <summary>
+ /// The name of the IMemberContainer. This is only used for
+ /// debugging purposes.
+ /// </summary>
+ string Name {
+ get;
+ }
+
+ /// <summary>
+ /// The type of this IMemberContainer.
+ /// </summary>
+ Type Type {
+ get;
+ }
+
+ /// <summary>
+ /// Returns the IMemberContainer of the parent class or null if this
+ /// is an interface or TypeManger.object_type.
+ /// This is used when creating the member cache for a class to get all
+ /// members from the parent class.
+ /// </summary>
+ IMemberContainer ParentContainer {
+ get;
+ }
+
+ /// <summary>
+ /// Whether this is an interface.
+ /// </summary>
+ bool IsInterface {
+ get;
+ }
+
+ /// <summary>
+ /// Returns all members of this class with the corresponding MemberTypes
+ /// and BindingFlags.
+ /// </summary>
+ /// <remarks>
+ /// When implementing this method, make sure not to return any inherited
+ /// members and check the MemberTypes and BindingFlags properly.
+ /// Unfortunately, System.Reflection is lame and doesn't provide a way to
+ /// get the BindingFlags (static/non-static,public/non-public) in the
+ /// MemberInfo class, but the cache needs this information. That's why
+ /// this method is called multiple times with different BindingFlags.
+ /// </remarks>
+ MemberList GetMembers (MemberTypes mt, BindingFlags bf);
+
+ /// <summary>
+ /// Return the container's member cache.
+ /// </summary>
+ MemberCache MemberCache {
+ get;
+ }
+ }
+
+ /// <summary>
+ /// The MemberCache is used by dynamic and non-dynamic types to speed up
+ /// member lookups. It has a member name based hash table; it maps each member
+ /// name to a list of CacheEntry objects. Each CacheEntry contains a MemberInfo
+ /// and the BindingFlags that were initially used to get it. The cache contains
+ /// all members of the current class and all inherited members. If this cache is
+ /// for an interface types, it also contains all inherited members.
+ ///
+ /// There are two ways to get a MemberCache:
+ /// * if this is a dynamic type, lookup the corresponding DeclSpace and then
+ /// use the DeclSpace.MemberCache property.
+ /// * if this not a dynamic type, call TypeHandle.GetTypeHandle() to get a
+ /// TypeHandle instance for the type and then use TypeHandle.MemberCache.
+ /// </summary>
+ public class MemberCache {
+ public readonly IMemberContainer Container;
+ protected Hashtable member_hash;
+ protected Hashtable method_hash;
+
+ /// <summary>
+ /// Create a new MemberCache for the given IMemberContainer `container'.
+ /// </summary>
+ public MemberCache (IMemberContainer container, bool setup_inherited_interfaces)
+ {
+ this.Container = container;
+
+ Timer.IncrementCounter (CounterType.MemberCache);
+ Timer.StartTimer (TimerType.CacheInit);
+
+
+
+ // If we have a parent class (we have a parent class unless we're
+ // TypeManager.object_type), we deep-copy its MemberCache here.
+ if (Container.IsInterface) {
+ MemberCache parent;
+ if (Container.ParentContainer != null)
+ parent = Container.ParentContainer.MemberCache;
+ else
+ parent = null;
+ member_hash = SetupCacheForInterface (parent, setup_inherited_interfaces);
+ } else if (Container.ParentContainer != null)
+ member_hash = SetupCache (Container.ParentContainer.MemberCache);
+ else
+ member_hash = new Hashtable ();
+
+ // If this is neither a dynamic type nor an interface, create a special
+ // method cache with all declared and inherited methods.
+ Type type = container.Type;
+ if (!(type is TypeBuilder) && !type.IsInterface) {
+ method_hash = new Hashtable ();
+ AddMethods (type);
+ }
+
+ // Add all members from the current class.
+ AddMembers (Container);
+
+ Timer.StopTimer (TimerType.CacheInit);
+ }
+
+ /// <summary>
+ /// Bootstrap this member cache by doing a deep-copy of our parent.
+ /// </summary>
+ Hashtable SetupCache (MemberCache parent)
+ {
+ Hashtable hash = new Hashtable ();
+ if (parent == null)
+ return hash;
+
+ IDictionaryEnumerator it = parent.member_hash.GetEnumerator ();
+ while (it.MoveNext ()) {
+ hash [it.Key] = ((ArrayList) it.Value).Clone ();
+ }
+
+ return hash;
+ }
+
+
+ /// <summary>
+ /// Add the contents of `new_hash' to `hash'.
+ /// </summary>
+ void AddHashtable (Hashtable hash, MemberCache cache)
+ {
+ Hashtable new_hash = cache.member_hash;
+ IDictionaryEnumerator it = new_hash.GetEnumerator ();
+ while (it.MoveNext ()) {
+ ArrayList list = (ArrayList) hash [it.Key];
+ if (list == null)
+ hash [it.Key] = list = new ArrayList ();
+
+ foreach (CacheEntry entry in (ArrayList) it.Value) {
+ if (entry.Container != cache.Container)
+ break;
+ list.Add (entry);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Bootstrap the member cache for an interface type.
+ /// Type.GetMembers() won't return any inherited members for interface types,
+ /// so we need to do this manually. Interfaces also inherit from System.Object.
+ /// </summary>
+ Hashtable SetupCacheForInterface (MemberCache parent, bool deep_setup)
+ {
+ Hashtable hash = SetupCache (parent);
+
+ if (!deep_setup)
+ return hash;
+
+ TypeExpr [] ifaces = TypeManager.GetInterfaces (Container.Type);
+
+ foreach (TypeExpr iface in ifaces) {
+ Type itype = iface.Type;
+
+ IMemberContainer iface_container =
+ TypeManager.LookupMemberContainer (itype);
+
+ MemberCache iface_cache = iface_container.MemberCache;
+
+ AddHashtable (hash, iface_cache);
+ }
+
+ return hash;
+ }
+
+ /// <summary>
+ /// Add all members from class `container' to the cache.
+ /// </summary>
+ void AddMembers (IMemberContainer container)
+ {
+ // We need to call AddMembers() with a single member type at a time
+ // to get the member type part of CacheEntry.EntryType right.
+ if (!container.IsInterface) {
+ AddMembers (MemberTypes.Constructor, container);
+ AddMembers (MemberTypes.Field, container);
+ }
+ AddMembers (MemberTypes.Method, container);
+ AddMembers (MemberTypes.Property, container);
+ AddMembers (MemberTypes.Event, container);
+ // Nested types are returned by both Static and Instance searches.
+ AddMembers (MemberTypes.NestedType,
+ BindingFlags.Static | BindingFlags.Public, container);
+ AddMembers (MemberTypes.NestedType,
+ BindingFlags.Static | BindingFlags.NonPublic, container);
+ }
+
+ void AddMembers (MemberTypes mt, IMemberContainer container)
+ {
+ AddMembers (mt, BindingFlags.Static | BindingFlags.Public, container);
+ AddMembers (mt, BindingFlags.Static | BindingFlags.NonPublic, container);
+ AddMembers (mt, BindingFlags.Instance | BindingFlags.Public, container);
+ AddMembers (mt, BindingFlags.Instance | BindingFlags.NonPublic, container);
+ }
+
+ /// <summary>
+ /// Add all members from class `container' with the requested MemberTypes and
+ /// BindingFlags to the cache. This method is called multiple times with different
+ /// MemberTypes and BindingFlags.
+ /// </summary>
+ void AddMembers (MemberTypes mt, BindingFlags bf, IMemberContainer container)
+ {
+ MemberList members = container.GetMembers (mt, bf);
+
+ foreach (MemberInfo member in members) {
+ string name = member.Name;
+
+ // We use a name-based hash table of ArrayList's.
+ ArrayList list = (ArrayList) member_hash [name];
+ if (list == null) {
+ list = new ArrayList ();
+ member_hash.Add (name, list);
+ }
+
+ // When this method is called for the current class, the list will
+ // already contain all inherited members from our parent classes.
+ // We cannot add new members in front of the list since this'd be an
+ // expensive operation, that's why the list is sorted in reverse order
+ // (ie. members from the current class are coming last).
+ list.Add (new CacheEntry (container, member, mt, bf));
+ }
+ }
+
+ /// <summary>
+ /// Add all declared and inherited methods from class `type' to the method cache.
+ /// </summary>
+ void AddMethods (Type type)
+ {
+ AddMethods (BindingFlags.Static | BindingFlags.Public |
+ BindingFlags.FlattenHierarchy, type);
+ AddMethods (BindingFlags.Static | BindingFlags.NonPublic |
+ BindingFlags.FlattenHierarchy, type);
+ AddMethods (BindingFlags.Instance | BindingFlags.Public, type);
+ AddMethods (BindingFlags.Instance | BindingFlags.NonPublic, type);
+ }
+
+ void AddMethods (BindingFlags bf, Type type)
+ {
+ MemberInfo [] members = type.GetMethods (bf);
+
+ Array.Reverse (members);
+
+ foreach (MethodBase member in members) {
+ string name = member.Name;
+
+ // We use a name-based hash table of ArrayList's.
+ ArrayList list = (ArrayList) method_hash [name];
+ if (list == null) {
+ list = new ArrayList ();
+ method_hash.Add (name, list);
+ }
+
+ // Unfortunately, the elements returned by Type.GetMethods() aren't
+ // sorted so we need to do this check for every member.
+ BindingFlags new_bf = bf;
+ if (member.DeclaringType == type)
+ new_bf |= BindingFlags.DeclaredOnly;
+
+ list.Add (new CacheEntry (Container, member, MemberTypes.Method, new_bf));
+ }
+
+
+ }
+
+ /// <summary>
+ /// Compute and return a appropriate `EntryType' magic number for the given
+ /// MemberTypes and BindingFlags.
+ /// </summary>
+ protected static EntryType GetEntryType (MemberTypes mt, BindingFlags bf)
+ {
+ EntryType type = EntryType.None;
+
+ if ((mt & MemberTypes.Constructor) != 0)
+ type |= EntryType.Constructor;
+ if ((mt & MemberTypes.Event) != 0)
+ type |= EntryType.Event;
+ if ((mt & MemberTypes.Field) != 0)
+ type |= EntryType.Field;
+ if ((mt & MemberTypes.Method) != 0)
+ type |= EntryType.Method;
+ if ((mt & MemberTypes.Property) != 0)
+ type |= EntryType.Property;
+ // Nested types are returned by static and instance searches.
+ if ((mt & MemberTypes.NestedType) != 0)
+ type |= EntryType.NestedType | EntryType.Static | EntryType.Instance;
+
+ if ((bf & BindingFlags.Instance) != 0)
+ type |= EntryType.Instance;
+ if ((bf & BindingFlags.Static) != 0)
+ type |= EntryType.Static;
+ if ((bf & BindingFlags.Public) != 0)
+ type |= EntryType.Public;
+ if ((bf & BindingFlags.NonPublic) != 0)
+ type |= EntryType.NonPublic;
+ if ((bf & BindingFlags.DeclaredOnly) != 0)
+ type |= EntryType.Declared;
+
+ return type;
+ }
+
+ /// <summary>
+ /// The `MemberTypes' enumeration type is a [Flags] type which means that it may
+ /// denote multiple member types. Returns true if the given flags value denotes a
+ /// single member types.
+ /// </summary>
+ public static bool IsSingleMemberType (MemberTypes mt)
+ {
+ switch (mt) {
+ case MemberTypes.Constructor:
+ case MemberTypes.Event:
+ case MemberTypes.Field:
+ case MemberTypes.Method:
+ case MemberTypes.Property:
+ case MemberTypes.NestedType:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// We encode the MemberTypes and BindingFlags of each members in a "magic"
+ /// number to speed up the searching process.
+ /// </summary>
+ [Flags]
+ protected internal enum EntryType {
+ None = 0x000,
+
+ Instance = 0x001,
+ Static = 0x002,
+ MaskStatic = Instance|Static,
+
+ Public = 0x004,
+ NonPublic = 0x008,
+ MaskProtection = Public|NonPublic,
+
+ Declared = 0x010,
+
+ Constructor = 0x020,
+ Event = 0x040,
+ Field = 0x080,
+ Method = 0x100,
+ Property = 0x200,
+ NestedType = 0x400,
+
+ MaskType = Constructor|Event|Field|Method|Property|NestedType
+ }
+
+ protected internal struct CacheEntry {
+ public readonly IMemberContainer Container;
+ public readonly EntryType EntryType;
+ public readonly MemberInfo Member;
+
+ public CacheEntry (IMemberContainer container, MemberInfo member,
+ MemberTypes mt, BindingFlags bf)
+ {
+ this.Container = container;
+ this.Member = member;
+ this.EntryType = GetEntryType (mt, bf);
+ }
+ }
+
+ /// <summary>
+ /// This is called each time we're walking up one level in the class hierarchy
+ /// and checks whether we can abort the search since we've already found what
+ /// we were looking for.
+ /// </summary>
+ protected bool DoneSearching (ArrayList list)
+ {
+ //
+ // We've found exactly one member in the current class and it's not
+ // a method or constructor.
+ //
+ if (list.Count == 1 && !(list [0] is MethodBase))
+ return true;
+
+ //
+ // Multiple properties: we query those just to find out the indexer
+ // name
+ //
+ if ((list.Count > 0) && (list [0] is PropertyInfo))
+ return true;
+
+ return false;
+ }
+
+ /// <summary>
+ /// Looks up members with name `name'. If you provide an optional
+ /// filter function, it'll only be called with members matching the
+ /// requested member name.
+ ///
+ /// This method will try to use the cache to do the lookup if possible.
+ ///
+ /// Unlike other FindMembers implementations, this method will always
+ /// check all inherited members - even when called on an interface type.
+ ///
+ /// If you know that you're only looking for methods, you should use
+ /// MemberTypes.Method alone since this speeds up the lookup a bit.
+ /// When doing a method-only search, it'll try to use a special method
+ /// cache (unless it's a dynamic type or an interface) and the returned
+ /// MemberInfo's will have the correct ReflectedType for inherited methods.
+ /// The lookup process will automatically restart itself in method-only
+ /// search mode if it discovers that it's about to return methods.
+ /// </summary>
+ ArrayList global = new ArrayList ();
+ bool using_global = false;
+
+ static MemberInfo [] emptyMemberInfo = new MemberInfo [0];
+
+ public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf, string name,
+ MemberFilter filter, object criteria)
+ {
+ if (using_global)
+ throw new Exception ();
+
+ bool declared_only = (bf & BindingFlags.DeclaredOnly) != 0;
+ bool method_search = mt == MemberTypes.Method;
+ // If we have a method cache and we aren't already doing a method-only search,
+ // then we restart a method search if the first match is a method.
+ bool do_method_search = !method_search && (method_hash != null);
+
+ ArrayList applicable;
+
+ // If this is a method-only search, we try to use the method cache if
+ // possible; a lookup in the method cache will return a MemberInfo with
+ // the correct ReflectedType for inherited methods.
+
+ if (method_search && (method_hash != null))
+ applicable = (ArrayList) method_hash [name];
+ else
+ applicable = (ArrayList) member_hash [name];
+
+ if (applicable == null)
+ return emptyMemberInfo;
+
+ //
+ // 32 slots gives 53 rss/54 size
+ // 2/4 slots gives 55 rss
+ //
+ // Strange: from 25,000 calls, only 1,800
+ // are above 2. Why does this impact it?
+ //
+ global.Clear ();
+ using_global = true;
+
+ Timer.StartTimer (TimerType.CachedLookup);
+
+ EntryType type = GetEntryType (mt, bf);
+
+ IMemberContainer current = Container;
+
+
+ // `applicable' is a list of all members with the given member name `name'
+ // in the current class and all its parent classes. The list is sorted in
+ // reverse order due to the way how the cache is initialy created (to speed
+ // things up, we're doing a deep-copy of our parent).
+
+ for (int i = applicable.Count-1; i >= 0; i--) {
+ CacheEntry entry = (CacheEntry) applicable [i];
+
+ // This happens each time we're walking one level up in the class
+ // hierarchy. If we're doing a DeclaredOnly search, we must abort
+ // the first time this happens (this may already happen in the first
+ // iteration of this loop if there are no members with the name we're
+ // looking for in the current class).
+ if (entry.Container != current) {
+ if (declared_only || DoneSearching (global))
+ break;
+
+ current = entry.Container;
+ }
+
+ // Is the member of the correct type ?
+ if ((entry.EntryType & type & EntryType.MaskType) == 0)
+ continue;
+
+ // Is the member static/non-static ?
+ if ((entry.EntryType & type & EntryType.MaskStatic) == 0)
+ continue;
+
+ // Apply the filter to it.
+ if (filter (entry.Member, criteria)) {
+ if ((entry.EntryType & EntryType.MaskType) != EntryType.Method)
+ do_method_search = false;
+ global.Add (entry.Member);
+ }
}
- Report.Error (246, Location, "Can not find type `"+name+"'");
+ Timer.StopTimer (TimerType.CachedLookup);
+
+ // If we have a method cache and we aren't already doing a method-only
+ // search, we restart in method-only search mode if the first match is
+ // a method. This ensures that we return a MemberInfo with the correct
+ // ReflectedType for inherited methods.
+ if (do_method_search && (global.Count > 0)){
+ using_global = false;
+
+ return FindMembers (MemberTypes.Method, bf, name, filter, criteria);
+ }
+
+ using_global = false;
+ MemberInfo [] copy = new MemberInfo [global.Count];
+ global.CopyTo (copy);
+ return copy;
+ }
+
+ // find the nested type @name in @this.
+ public Type FindNestedType (string name)
+ {
+ ArrayList applicable = (ArrayList) member_hash [name];
+ if (applicable == null)
+ return null;
+
+ for (int i = applicable.Count-1; i >= 0; i--) {
+ CacheEntry entry = (CacheEntry) applicable [i];
+ if ((entry.EntryType & EntryType.NestedType & EntryType.MaskType) != 0)
+ return (Type) entry.Member;
+ }
+
return null;
}
+
+ //
+ // This finds the method or property for us to override. invocationType is the type where
+ // the override is going to be declared, name is the name of the method/property, and
+ // paramTypes is the parameters, if any to the method or property
+ //
+ // Because the MemberCache holds members from this class and all the base classes,
+ // we can avoid tons of reflection stuff.
+ //
+ public MemberInfo FindMemberToOverride (Type invocationType, string name, Type [] paramTypes, bool is_property)
+ {
+ ArrayList applicable;
+ if (method_hash != null && !is_property)
+ applicable = (ArrayList) method_hash [name];
+ else
+ applicable = (ArrayList) member_hash [name];
+
+ if (applicable == null)
+ return null;
+ //
+ // Walk the chain of methods, starting from the top.
+ //
+ for (int i = applicable.Count - 1; i >= 0; i--) {
+ CacheEntry entry = (CacheEntry) applicable [i];
+
+ if ((entry.EntryType & (is_property ? (EntryType.Property | EntryType.Field) : EntryType.Method)) == 0)
+ continue;
+
+ PropertyInfo pi = null;
+ MethodInfo mi = null;
+ FieldInfo fi = null;
+ Type [] cmpAttrs = null;
+
+ if (is_property) {
+ if ((entry.EntryType & EntryType.Field) != 0) {
+ fi = (FieldInfo)entry.Member;
+
+ // TODO: For this case we ignore member type
+ //fb = TypeManager.GetField (fi);
+ //cmpAttrs = new Type[] { fb.MemberType };
+ } else {
+ pi = (PropertyInfo) entry.Member;
+ cmpAttrs = TypeManager.GetArgumentTypes (pi);
+ }
+ } else {
+ mi = (MethodInfo) entry.Member;
+ cmpAttrs = TypeManager.GetArgumentTypes (mi);
+ }
+
+ if (fi != null) {
+ // TODO: Almost duplicate !
+ // Check visibility
+ switch (fi.Attributes & FieldAttributes.FieldAccessMask) {
+ case FieldAttributes.Private:
+ //
+ // A private method is Ok if we are a nested subtype.
+ // The spec actually is not very clear about this, see bug 52458.
+ //
+ if (invocationType != entry.Container.Type &
+ TypeManager.IsNestedChildOf (invocationType, entry.Container.Type))
+ continue;
+
+ break;
+ case FieldAttributes.FamANDAssem:
+ case FieldAttributes.Assembly:
+ //
+ // Check for assembly methods
+ //
+ if (mi.DeclaringType.Assembly != CodeGen.Assembly.Builder)
+ continue;
+ break;
+ }
+ return entry.Member;
+ }
+
+ //
+ // Check the arguments
+ //
+ if (cmpAttrs.Length != paramTypes.Length)
+ continue;
+
+ for (int j = cmpAttrs.Length - 1; j >= 0; j --)
+ if (paramTypes [j] != cmpAttrs [j])
+ goto next;
+
+ //
+ // get one of the methods because this has the visibility info.
+ //
+ if (is_property) {
+ mi = pi.GetGetMethod (true);
+ if (mi == null)
+ mi = pi.GetSetMethod (true);
+ }
+
+ //
+ // Check visibility
+ //
+ switch (mi.Attributes & MethodAttributes.MemberAccessMask) {
+ case MethodAttributes.Private:
+ //
+ // A private method is Ok if we are a nested subtype.
+ // The spec actually is not very clear about this, see bug 52458.
+ //
+ if (invocationType == entry.Container.Type ||
+ TypeManager.IsNestedChildOf (invocationType, entry.Container.Type))
+ return entry.Member;
+
+ break;
+ case MethodAttributes.FamANDAssem:
+ case MethodAttributes.Assembly:
+ //
+ // Check for assembly methods
+ //
+ if (mi.DeclaringType.Assembly == CodeGen.Assembly.Builder)
+ return entry.Member;
+
+ break;
+ default:
+ //
+ // A protected method is ok, because we are overriding.
+ // public is always ok.
+ //
+ return entry.Member;
+ }
+ next:
+ ;
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// The method is looking for conflict with inherited symbols (errors CS0108, CS0109).
+ /// We handle two cases. The first is for types without parameters (events, field, properties).
+ /// The second are methods, indexers and this is why ignore_complex_types is here.
+ /// The latest param is temporary hack. See DoDefineMembers method for more info.
+ /// </summary>
+ public MemberInfo FindMemberWithSameName (string name, bool ignore_complex_types, MemberInfo ignore_member)
+ {
+ ArrayList applicable = null;
+
+ if (method_hash != null)
+ applicable = (ArrayList) method_hash [name];
+
+ if (applicable != null) {
+ for (int i = applicable.Count - 1; i >= 0; i--) {
+ CacheEntry entry = (CacheEntry) applicable [i];
+ if ((entry.EntryType & EntryType.Public) != 0)
+ return entry.Member;
+ }
+ }
+
+ if (member_hash == null)
+ return null;
+ applicable = (ArrayList) member_hash [name];
+
+ if (applicable != null) {
+ for (int i = applicable.Count - 1; i >= 0; i--) {
+ CacheEntry entry = (CacheEntry) applicable [i];
+ if ((entry.EntryType & EntryType.Public) != 0 & entry.Member != ignore_member) {
+ if (ignore_complex_types) {
+ if ((entry.EntryType & EntryType.Method) != 0)
+ continue;
+
+ // Does exist easier way how to detect indexer ?
+ if ((entry.EntryType & EntryType.Property) != 0) {
+ Type[] arg_types = TypeManager.GetArgumentTypes ((PropertyInfo)entry.Member);
+ if (arg_types.Length > 0)
+ continue;
+ }
+ }
+ return entry.Member;
+ }
+ }
+ }
+ return null;
+ }
+
+ Hashtable locase_table;
+
+ /// <summary>
+ /// Builds low-case table for CLS Compliance test
+ /// </summary>
+ public Hashtable GetPublicMembers ()
+ {
+ if (locase_table != null)
+ return locase_table;
+
+ locase_table = new Hashtable ();
+ foreach (DictionaryEntry entry in member_hash) {
+ ArrayList members = (ArrayList)entry.Value;
+ for (int ii = 0; ii < members.Count; ++ii) {
+ CacheEntry member_entry = (CacheEntry) members [ii];
+
+ if ((member_entry.EntryType & EntryType.Public) == 0)
+ continue;
+
+ // TODO: Does anyone know easier way how to detect that member is internal ?
+ switch (member_entry.EntryType & EntryType.MaskType) {
+ case EntryType.Constructor:
+ continue;
+
+ case EntryType.Field:
+ if ((((FieldInfo)member_entry.Member).Attributes & (FieldAttributes.Assembly | FieldAttributes.Public)) == FieldAttributes.Assembly)
+ continue;
+ break;
+
+ case EntryType.Method:
+ if ((((MethodInfo)member_entry.Member).Attributes & (MethodAttributes.Assembly | MethodAttributes.Public)) == MethodAttributes.Assembly)
+ continue;
+ break;
+
+ case EntryType.Property:
+ PropertyInfo pi = (PropertyInfo)member_entry.Member;
+ if (pi.GetSetMethod () == null && pi.GetGetMethod () == null)
+ continue;
+ break;
+
+ case EntryType.Event:
+ EventInfo ei = (EventInfo)member_entry.Member;
+ MethodInfo mi = ei.GetAddMethod ();
+ if ((mi.Attributes & (MethodAttributes.Assembly | MethodAttributes.Public)) == MethodAttributes.Assembly)
+ continue;
+ break;
+ }
+ string lcase = ((string)entry.Key).ToLower (System.Globalization.CultureInfo.InvariantCulture);
+ locase_table [lcase] = member_entry.Member;
+ break;
+ }
+ }
+ return locase_table;
+ }
+
+ public Hashtable Members {
+ get {
+ return member_hash;
+ }
+ }
+
+ /// <summary>
+ /// Cls compliance check whether methods or constructors parameters differing only in ref or out, or in array rank
+ /// </summary>
+ public void VerifyClsParameterConflict (ArrayList al, MethodCore method, MemberInfo this_builder)
+ {
+ EntryType tested_type = (method is Constructor ? EntryType.Constructor : EntryType.Method) | EntryType.Public;
+
+ for (int i = 0; i < al.Count; ++i) {
+ MemberCache.CacheEntry entry = (MemberCache.CacheEntry) al [i];
+
+ // skip itself
+ if (entry.Member == this_builder)
+ continue;
+
+ if ((entry.EntryType & tested_type) != tested_type)
+ continue;
+
+ MethodBase method_to_compare = (MethodBase)entry.Member;
+ if (AttributeTester.AreOverloadedMethodParamsClsCompliant (method.ParameterTypes, TypeManager.GetArgumentTypes (method_to_compare)))
+ continue;
+
+ IMethodData md = TypeManager.GetMethod (method_to_compare);
+
+ // TODO: now we are ignoring CLSCompliance(false) on method from other assembly which is buggy.
+ // However it is exactly what csc does.
+ if (md != null && !md.IsClsCompliaceRequired (method.Parent))
+ continue;
+
+ Report.SymbolRelatedToPreviousError (entry.Member);
+ Report.Error (3006, method.Location, "Overloaded method '{0}' differing only in ref or out, or in array rank, is not CLS-compliant", method.GetSignatureForError ());
+ }
+ }
}
}
diff --git a/mcs/mcs/delegate.cs b/mcs/mcs/delegate.cs
index a2903a4849e..ce1ef17f17b 100644
--- a/mcs/mcs/delegate.cs
+++ b/mcs/mcs/delegate.cs
@@ -1,717 +1,965 @@
-//
-// delegate.cs: Delegate Handler
-//
-// Author: Ravi Pratap (ravi@ximian.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
-//
-//
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Text;
-
-namespace Mono.CSharp {
-
- /// <summary>
- /// Holds Delegates
- /// </summary>
- public class Delegate : DeclSpace {
- public readonly string ReturnType;
- public Parameters Parameters;
- public Attributes OptAttributes;
-
- public ConstructorBuilder ConstructorBuilder;
- public MethodBuilder InvokeBuilder;
- public MethodBuilder BeginInvokeBuilder;
- public MethodBuilder EndInvokeBuilder;
-
- Type [] param_types;
- Type ret_type;
-
- Expression instance_expr;
- MethodBase delegate_method;
-
- const int AllowedModifiers =
- Modifiers.NEW |
- Modifiers.PUBLIC |
- Modifiers.PROTECTED |
- Modifiers.INTERNAL |
- Modifiers.UNSAFE |
- Modifiers.PRIVATE;
-
- public Delegate (TypeContainer parent, string type, int mod_flags,
- string name, Parameters param_list,
- Attributes attrs, Location l)
- : base (parent, name, l)
- {
- this.ReturnType = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC, l);
- Parameters = param_list;
- OptAttributes = attrs;
- }
-
- public override TypeBuilder DefineType ()
- {
- TypeAttributes attr;
-
- if (TypeBuilder != null)
- return TypeBuilder;
-
- if (IsTopLevel) {
- ModuleBuilder builder = CodeGen.ModuleBuilder;
- attr = TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.Sealed;
-
- TypeBuilder = builder.DefineType (
- Name, attr, TypeManager.multicast_delegate_type);
- } else {
- TypeBuilder builder = Parent.TypeBuilder;
- attr = TypeAttributes.NestedPublic | TypeAttributes.Class |
- TypeAttributes.Sealed;
-
- string name = Name.Substring (1 + Name.LastIndexOf ('.'));
- TypeBuilder = builder.DefineNestedType (
- name, attr, TypeManager.multicast_delegate_type);
- }
-
- TypeManager.AddDelegateType (Name, TypeBuilder, this);
-
- return TypeBuilder;
- }
-
- public override bool Define (TypeContainer parent)
- {
- MethodAttributes mattr;
- int i;
-
- // FIXME: POSSIBLY make this static, as it is always constant
- //
- Type [] const_arg_types = new Type [2];
- const_arg_types [0] = TypeManager.object_type;
- const_arg_types [1] = TypeManager.intptr_type;
-
- mattr = MethodAttributes.RTSpecialName | MethodAttributes.SpecialName |
- MethodAttributes.HideBySig | MethodAttributes.Public;
-
- ConstructorBuilder = TypeBuilder.DefineConstructor (mattr,
- CallingConventions.Standard,
- const_arg_types);
-
- ConstructorBuilder.DefineParameter (1, ParameterAttributes.None, "object");
- ConstructorBuilder.DefineParameter (2, ParameterAttributes.None, "method");
- //
- // HACK because System.Reflection.Emit is lame
- //
- //
- // FIXME: POSSIBLY make these static, as they are always the same
- Parameter [] fixed_pars = new Parameter [2];
- fixed_pars [0] = new Parameter (null, null, Parameter.Modifier.NONE, null);
- fixed_pars [1] = new Parameter (null, null, Parameter.Modifier.NONE, null);
- Parameters const_parameters = new Parameters (fixed_pars, null, Location);
-
- TypeManager.RegisterMethod (
- ConstructorBuilder,
- new InternalParameters (const_arg_types, const_parameters),
- const_arg_types);
-
-
- ConstructorBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- //
- // Here the various methods like Invoke, BeginInvoke etc are defined
- //
- // First, call the `out of band' special method for
- // defining recursively any types we need:
-
- if (!Parameters.ComputeAndDefineParameterTypes (this))
- return false;
-
- param_types = Parameters.GetParameterInfo (this);
- if (param_types == null)
- return false;
-
- //
- // Invoke method
- //
-
- // Check accessibility
- foreach (Type partype in param_types)
- if (!TypeContainer.AsAccessible (partype, ModFlags))
- return false;
-
- ret_type = FindType (ReturnType);
- if (ret_type == null)
- return false;
-
- if (!TypeContainer.AsAccessible (ret_type, ModFlags))
- return false;
-
- //
- // We don't have to check any others because they are all
- // guaranteed to be accessible - they are standard types.
- //
-
- CallingConventions cc = Parameters.GetCallingConvention ();
-
- mattr = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual;
-
- InvokeBuilder = TypeBuilder.DefineMethod ("Invoke",
- mattr,
- cc,
- ret_type,
- param_types);
-
- i = 0;
- if (Parameters.FixedParameters != null){
- int top = Parameters.FixedParameters.Length;
- Parameter p;
-
- for (; i < top; i++) {
- p = Parameters.FixedParameters [i];
-
- InvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- }
- }
- if (Parameters.ArrayParameter != null){
- Parameter p = Parameters.ArrayParameter;
-
- InvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- }
-
- InvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- TypeManager.RegisterMethod (InvokeBuilder,
- new InternalParameters (parent, Parameters),
- param_types);
-
- //
- // BeginInvoke
- //
- int params_num = param_types.Length;
- Type [] async_param_types = new Type [params_num + 2];
-
- param_types.CopyTo (async_param_types, 0);
-
- async_param_types [params_num] = TypeManager.asynccallback_type;
- async_param_types [params_num + 1] = TypeManager.object_type;
-
- mattr = MethodAttributes.Public | MethodAttributes.HideBySig |
- MethodAttributes.Virtual | MethodAttributes.NewSlot;
-
- BeginInvokeBuilder = TypeBuilder.DefineMethod ("BeginInvoke",
- mattr,
- cc,
- TypeManager.iasyncresult_type,
- async_param_types);
-
- i = 0;
- if (Parameters.FixedParameters != null){
- int top = Parameters.FixedParameters.Length;
- Parameter p;
-
- for (i = 0 ; i < top; i++) {
- p = Parameters.FixedParameters [i];
-
- BeginInvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- }
- }
- if (Parameters.ArrayParameter != null){
- Parameter p = Parameters.ArrayParameter;
-
- BeginInvokeBuilder.DefineParameter (
- i+1, p.Attributes, p.Name);
- i++;
- }
-
- BeginInvokeBuilder.DefineParameter (i + 1, ParameterAttributes.None, "callback");
- BeginInvokeBuilder.DefineParameter (i + 2, ParameterAttributes.None, "object");
-
- BeginInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- Parameter [] async_params = new Parameter [params_num + 2];
- int n = 0;
- if (Parameters.FixedParameters != null){
- Parameters.FixedParameters.CopyTo (async_params, 0);
- n = Parameters.FixedParameters.Length;
- }
- if (Parameters.ArrayParameter != null)
- async_params [n] = Parameters.ArrayParameter;
-
- async_params [params_num] = new Parameter ("System.AsyncCallback", "callback",
- Parameter.Modifier.NONE, null);
- async_params [params_num + 1] = new Parameter ("System.Object", "object",
- Parameter.Modifier.NONE, null);
-
- Parameters async_parameters = new Parameters (async_params, null, Location);
-
- async_parameters.ComputeAndDefineParameterTypes (this);
- TypeManager.RegisterMethod (BeginInvokeBuilder,
- new InternalParameters (parent, async_parameters),
- async_param_types);
-
- //
- // EndInvoke
- //
- Type [] end_param_types = new Type [1];
- end_param_types [0] = TypeManager.iasyncresult_type;
-
- EndInvokeBuilder = TypeBuilder.DefineMethod ("EndInvoke",
- mattr,
- cc,
- ret_type,
- end_param_types);
- EndInvokeBuilder.DefineParameter (1, ParameterAttributes.None, "result");
-
- EndInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
-
- Parameter [] end_params = new Parameter [1];
- end_params [0] = new Parameter ("System.IAsyncResult", "result",
- Parameter.Modifier.NONE, null);
-
- TypeManager.RegisterMethod (EndInvokeBuilder,
- new InternalParameters (
- parent,
- new Parameters (end_params, null, Location)),
- end_param_types);
-
- return true;
- }
-
- /// <summary>
- /// Verifies whether the method in question is compatible with the delegate
- /// Returns the method itself if okay and null if not.
- /// </summary>
- public static MethodBase VerifyMethod (EmitContext ec, Type delegate_type, MethodBase mb,
- Location loc)
- {
- ParameterData pd = Invocation.GetParameterData (mb);
-
- int pd_count = pd.Count;
-
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return null;
- }
-
- MethodBase invoke_mb = ((MethodGroupExpr) ml).Methods [0];
-
- ParameterData invoke_pd = Invocation.GetParameterData (invoke_mb);
-
- if (invoke_pd.Count != pd_count)
- return null;
-
- bool mismatch = false;
- for (int i = pd_count; i > 0; ) {
- i--;
-
- if (invoke_pd.ParameterType (i) == pd.ParameterType (i))
- continue;
- else {
- mismatch = true;
- break;
- }
- }
-
- if (mismatch) {
- Report.Error (
- 123, loc, "Method '" + Invocation.FullMethodDesc (mb) +
- "' does not match delegate '" +
- FullDelegateDesc (delegate_type, invoke_mb, invoke_pd) + "'");
- return null;
- }
-
- if (((MethodInfo) invoke_mb).ReturnType == ((MethodInfo) mb).ReturnType)
- return mb;
- else
- mismatch = true;
-
- if (mismatch) {
- Report.Error (123, loc, "Method '" + Invocation.FullMethodDesc (mb) +
- "' does not match delegate '" +
- FullDelegateDesc (delegate_type, invoke_mb, invoke_pd) + "'");
- return null;
- }
-
- return null;
- }
-
- // <summary>
- // Verifies whether the invocation arguments are compatible with the
- // delegate's target method
- // </summary>
- public static bool VerifyApplicability (EmitContext ec,
- Type delegate_type,
- ArrayList args,
- Location loc)
- {
- int arg_count;
-
- if (args == null)
- arg_count = 0;
- else
- arg_count = args.Count;
-
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
- ParameterData pd = Invocation.GetParameterData (mb);
-
- int pd_count = pd.Count;
-
- bool not_params_method = (pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS);
-
- if (not_params_method && pd_count != arg_count) {
- Report.Error (1593, loc,
- "Delegate '" + delegate_type.ToString ()
- + "' does not take '" + arg_count + "' arguments");
- return false;
- }
-
- return Invocation.VerifyArgumentsCompat (ec, args, arg_count, mb, !not_params_method,
- delegate_type, loc);
- }
-
- /// <summary>
- /// Verifies whether the delegate in question is compatible with this one in
- /// order to determine if instantiation from the same is possible.
- /// </summary>
- public static bool VerifyDelegate (EmitContext ec, Type delegate_type, Type probe_type, Location loc)
- {
- Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
- ParameterData pd = Invocation.GetParameterData (mb);
-
- Expression probe_ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
-
- if (!(probe_ml is MethodGroupExpr)) {
- Report.Error (-100, loc, "Internal error : could not find Invoke method!");
- return false;
- }
-
- MethodBase probe_mb = ((MethodGroupExpr) probe_ml).Methods [0];
- ParameterData probe_pd = Invocation.GetParameterData (probe_mb);
-
- if (((MethodInfo) mb).ReturnType != ((MethodInfo) probe_mb).ReturnType)
- return false;
-
- if (pd.Count != probe_pd.Count)
- return false;
-
- for (int i = pd.Count; i > 0; ) {
- i--;
-
- if (pd.ParameterType (i) != probe_pd.ParameterType (i) ||
- pd.ParameterModifier (i) != probe_pd.ParameterModifier (i))
- return false;
- }
-
- return true;
- }
-
- public static string FullDelegateDesc (Type del_type, MethodBase mb, ParameterData pd)
- {
- StringBuilder sb = new StringBuilder (TypeManager.CSharpName (((MethodInfo) mb).ReturnType));
-
- sb.Append (" " + del_type.ToString ());
- sb.Append (" (");
-
- int length = pd.Count;
-
- for (int i = length; i > 0; ) {
- i--;
-
- sb.Append (TypeManager.CSharpName (pd.ParameterType (length - i - 1)));
- if (i != 0)
- sb.Append (", ");
- }
-
- sb.Append (")");
- return sb.ToString ();
-
- }
-
- // Hack around System.Reflection as found everywhere else
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf, MemberFilter filter, object criteria)
- {
- ArrayList members = new ArrayList ();
-
- if ((mt & MemberTypes.Method) != 0) {
- if (filter (ConstructorBuilder, criteria))
- members.Add (ConstructorBuilder);
-
- if (filter (InvokeBuilder, criteria))
- members.Add (InvokeBuilder);
-
- if (filter (BeginInvokeBuilder, criteria))
- members.Add (BeginInvokeBuilder);
-
- if (filter (EndInvokeBuilder, criteria))
- members.Add (EndInvokeBuilder);
- }
-
- int count = members.Count;
-
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
- }
-
- return null;
- }
-
- public void CloseDelegate ()
- {
- TypeBuilder.CreateType ();
- }
-
- public Expression InstanceExpression {
- get {
- return instance_expr;
- }
- set {
- instance_expr = value;
- }
- }
-
- public MethodBase TargetMethod {
- get {
- return delegate_method;
- }
- set {
- delegate_method = value;
- }
- }
-
- public Type TargetReturnType {
- get {
- return ret_type;
- }
- }
-
- public Type [] ParameterTypes {
- get {
- return param_types;
- }
- }
-
- }
-
- public class NewDelegate : Expression {
-
- public ArrayList Arguments;
-
- MethodBase constructor_method;
- MethodBase delegate_method;
- Expression delegate_instance_expr;
-
- Location Location;
-
- public NewDelegate (Type type, ArrayList Arguments, Location loc)
- {
- this.type = type;
- this.Arguments = Arguments;
- this.Location = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- if (Arguments == null) {
- Report.Error (-11, Location,
- "Delegate creation expression takes only one argument");
- return null;
- }
-
- if (Arguments.Count != 1) {
- Report.Error (-11, Location,
- "Delegate creation expression takes only one argument");
- return null;
- }
-
- Expression ml = Expression.MemberLookup (
- ec, type, ".ctor", Location);
-
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, Location, "Internal error : Could not find delegate constructor!");
- return null;
- }
-
- constructor_method = ((MethodGroupExpr) ml).Methods [0];
- Argument a = (Argument) Arguments [0];
-
- if (!a.Resolve (ec, Location))
- return null;
-
- Expression e = a.Expr;
-
- if (e is MethodGroupExpr) {
- MethodGroupExpr mg = (MethodGroupExpr) e;
-
- foreach (MethodInfo mi in mg.Methods){
- delegate_method = Delegate.VerifyMethod (ec, type, mi, Location);
-
- if (delegate_method != null)
- break;
- }
-
- if (delegate_method == null) {
- Report.Error (-14, Location, "Ambiguous method reference in delegate creation");
- return null;
- }
-
- if (mg.InstanceExpression != null)
- delegate_instance_expr = mg.InstanceExpression.Resolve (ec);
- else {
- if (!ec.IsStatic)
- delegate_instance_expr = ec.This;
- else
- delegate_instance_expr = null;
- }
-
- if (delegate_instance_expr != null)
- if (delegate_instance_expr.Type.IsValueType)
- delegate_instance_expr = new BoxedCast (delegate_instance_expr);
-
- eclass = ExprClass.Value;
- return this;
- }
-
- Type e_type = e.Type;
-
- if (!TypeManager.IsDelegateType (e_type)) {
- Report.Error (-12, Location, "Cannot create a delegate from something " +
- "not a delegate or a method.");
- return null;
- }
-
- // This is what MS' compiler reports. We could always choose
- // to be more verbose and actually give delegate-level specifics
-
- if (!Delegate.VerifyDelegate (ec, type, e_type, Location)) {
- Report.Error (29, Location, "Cannot implicitly convert type '" + e_type + "' " +
- "to type '" + type + "'");
- return null;
- }
-
- Expression invoke_method = Expression.MemberLookup (
- ec, e_type, "Invoke", MemberTypes.Method,
- Expression.AllBindingFlags, Location);
-
- if (invoke_method == null) {
- Report.Error (-200, Location, "Internal error ! COuld not find Invoke method!");
- return null;
- }
-
- delegate_instance_expr = e;
- delegate_method = ((MethodGroupExpr) invoke_method).Methods [0];
-
- eclass = ExprClass.Value;
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- if (delegate_instance_expr == null ||
- delegate_method.IsStatic)
- ec.ig.Emit (OpCodes.Ldnull);
- else
- delegate_instance_expr.Emit (ec);
-
- ec.ig.Emit (OpCodes.Ldftn, (MethodInfo) delegate_method);
- ec.ig.Emit (OpCodes.Newobj, (ConstructorInfo) constructor_method);
- }
- }
-
- public class DelegateInvocation : ExpressionStatement {
-
- public Expression InstanceExpr;
- public ArrayList Arguments;
- public Location Location;
-
- MethodBase method;
-
- public DelegateInvocation (Expression instance_expr, ArrayList args, Location loc)
- {
- this.InstanceExpr = instance_expr;
- this.Arguments = args;
- this.Location = loc;
- }
-
- public override Expression DoResolve (EmitContext ec)
- {
- Type del_type = InstanceExpr.Type;
- if (del_type == null)
- return null;
-
- if (Arguments != null){
- foreach (Argument a in Arguments){
- if (!a.Resolve (ec, Location))
- return null;
- }
- }
-
- if (!Delegate.VerifyApplicability (ec, del_type, Arguments, Location))
- return null;
-
- Expression ml = Expression.MemberLookup (ec, del_type, "Invoke", Location);
- if (!(ml is MethodGroupExpr)) {
- Report.Error (-100, Location, "Internal error : could not find Invoke method!");
- return null;
- }
-
- method = ((MethodGroupExpr) ml).Methods [0];
- type = ((MethodInfo) method).ReturnType;
- eclass = ExprClass.Value;
-
- return this;
- }
-
- public override void Emit (EmitContext ec)
- {
- Delegate del = TypeManager.LookupDelegate (InstanceExpr.Type);
-
- //
- // Invocation on delegates call the virtual Invoke member
- // so we are always `instance' calls
- //
- Invocation.EmitCall (ec, false, false, InstanceExpr, method, Arguments, Location);
- }
-
- public override void EmitStatement (EmitContext ec)
- {
- Emit (ec);
- //
- // Pop the return value if there is one
- //
- if (method is MethodInfo){
- if (((MethodInfo) method).ReturnType != TypeManager.void_type)
- ec.ig.Emit (OpCodes.Pop);
- }
- }
-
- }
-}
+//
+// delegate.cs: Delegate Handler
+//
+// Authors:
+// Ravi Pratap (ravi@ximian.com)
+// Miguel de Icaza (miguel@ximian.com)
+//
+// Licensed under the terms of the GNU GPL
+//
+// (C) 2001 Ximian, Inc (http://www.ximian.com)
+//
+//
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Text;
+
+namespace Mono.CSharp {
+
+ /// <summary>
+ /// Holds Delegates
+ /// </summary>
+ public class Delegate : DeclSpace {
+ public Expression ReturnType;
+ public Parameters Parameters;
+
+ public ConstructorBuilder ConstructorBuilder;
+ public MethodBuilder InvokeBuilder;
+ public MethodBuilder BeginInvokeBuilder;
+ public MethodBuilder EndInvokeBuilder;
+
+ Type [] param_types;
+ Type ret_type;
+
+ static string[] attribute_targets = new string [] { "type", "return" };
+
+ Expression instance_expr;
+ MethodBase delegate_method;
+ ReturnParameter return_attributes;
+
+ const int AllowedModifiers =
+ Modifiers.NEW |
+ Modifiers.PUBLIC |
+ Modifiers.PROTECTED |
+ Modifiers.INTERNAL |
+ Modifiers.UNSAFE |
+ Modifiers.PRIVATE;
+
+ public Delegate (NamespaceEntry ns, TypeContainer parent, Expression type,
+ int mod_flags, MemberName name, Parameters param_list,
+ Attributes attrs, Location l)
+ : base (ns, parent, name, attrs, l)
+
+ {
+ this.ReturnType = type;
+ ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
+ IsTopLevel ? Modifiers.INTERNAL :
+ Modifiers.PRIVATE, l);
+ Parameters = param_list;
+ }
+
+ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Target == AttributeTargets.ReturnValue) {
+ if (return_attributes == null)
+ return_attributes = new ReturnParameter (InvokeBuilder, Location);
+
+ return_attributes.ApplyAttributeBuilder (a, cb);
+ return;
+ }
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+ public override TypeBuilder DefineType ()
+ {
+ if (TypeBuilder != null)
+ return TypeBuilder;
+
+ TypeAttributes attr = Modifiers.TypeAttr (ModFlags, IsTopLevel) |
+ TypeAttributes.Class | TypeAttributes.Sealed;
+
+ if (IsTopLevel) {
+ if (TypeManager.NamespaceClash (Name, Location))
+ return null;
+
+ ModuleBuilder builder = CodeGen.Module.Builder;
+
+ TypeBuilder = builder.DefineType (
+ Name, attr, TypeManager.multicast_delegate_type);
+ } else {
+ TypeBuilder builder = Parent.TypeBuilder;
+
+ string name = Name.Substring (1 + Name.LastIndexOf ('.'));
+ TypeBuilder = builder.DefineNestedType (
+ name, attr, TypeManager.multicast_delegate_type);
+ }
+
+ TypeManager.AddDelegateType (Name, TypeBuilder, this);
+
+ return TypeBuilder;
+ }
+
+ public override bool DefineMembers (TypeContainer container)
+ {
+ return true;
+ }
+
+ public override bool Define ()
+ {
+ MethodAttributes mattr;
+ int i;
+ EmitContext ec = new EmitContext (this, this, Location, null,
+ null, ModFlags, false);
+
+ // FIXME: POSSIBLY make this static, as it is always constant
+ //
+ Type [] const_arg_types = new Type [2];
+ const_arg_types [0] = TypeManager.object_type;
+ const_arg_types [1] = TypeManager.intptr_type;
+
+ mattr = MethodAttributes.RTSpecialName | MethodAttributes.SpecialName |
+ MethodAttributes.HideBySig | MethodAttributes.Public;
+
+ ConstructorBuilder = TypeBuilder.DefineConstructor (mattr,
+ CallingConventions.Standard,
+ const_arg_types);
+
+ ConstructorBuilder.DefineParameter (1, ParameterAttributes.None, "object");
+ ConstructorBuilder.DefineParameter (2, ParameterAttributes.None, "method");
+ //
+ // HACK because System.Reflection.Emit is lame
+ //
+ //
+ // FIXME: POSSIBLY make these static, as they are always the same
+ Parameter [] fixed_pars = new Parameter [2];
+ fixed_pars [0] = new Parameter (TypeManager.system_object_expr, "object",
+ Parameter.Modifier.NONE, null);
+ fixed_pars [1] = new Parameter (TypeManager.system_intptr_expr, "method",
+ Parameter.Modifier.NONE, null);
+ Parameters const_parameters = new Parameters (fixed_pars, null, Location);
+
+ TypeManager.RegisterMethod (
+ ConstructorBuilder,
+ new InternalParameters (const_arg_types, const_parameters),
+ const_arg_types);
+
+
+ ConstructorBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
+
+ //
+ // Here the various methods like Invoke, BeginInvoke etc are defined
+ //
+ // First, call the `out of band' special method for
+ // defining recursively any types we need:
+
+ if (!Parameters.ComputeAndDefineParameterTypes (ec))
+ return false;
+
+ param_types = Parameters.GetParameterInfo (ec);
+ if (param_types == null)
+ return false;
+
+ //
+ // Invoke method
+ //
+
+ // Check accessibility
+ foreach (Type partype in param_types){
+ if (!Parent.AsAccessible (partype, ModFlags)) {
+ Report.Error (59, Location,
+ "Inconsistent accessibility: parameter type `" +
+ TypeManager.CSharpName (partype) + "` is less " +
+ "accessible than delegate `" + Name + "'");
+ return false;
+ }
+ if (partype.IsPointer && !UnsafeOK (Parent))
+ return false;
+ }
+
+ ReturnType = ReturnType.ResolveAsTypeTerminal (ec, false);
+ if (ReturnType == null)
+ return false;
+
+ ret_type = ReturnType.Type;
+ if (ret_type == null)
+ return false;
+
+ if (!Parent.AsAccessible (ret_type, ModFlags)) {
+ Report.Error (58, Location,
+ "Inconsistent accessibility: return type `" +
+ TypeManager.CSharpName (ret_type) + "` is less " +
+ "accessible than delegate `" + Name + "'");
+ return false;
+ }
+
+ if (ret_type.IsPointer && !UnsafeOK (Parent))
+ return false;
+
+ //
+ // We don't have to check any others because they are all
+ // guaranteed to be accessible - they are standard types.
+ //
+
+ CallingConventions cc = Parameters.GetCallingConvention ();
+
+ mattr = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.Virtual;
+
+ InvokeBuilder = TypeBuilder.DefineMethod ("Invoke",
+ mattr,
+ cc,
+ ret_type,
+ param_types);
+
+ //
+ // Define parameters, and count out/ref parameters
+ //
+ int out_params = 0;
+ i = 0;
+ if (Parameters.FixedParameters != null){
+ int top = Parameters.FixedParameters.Length;
+ Parameter p;
+
+ for (; i < top; i++) {
+ p = Parameters.FixedParameters [i];
+ p.DefineParameter (ec, InvokeBuilder, null, i + 1, Location);
+
+ if ((p.ModFlags & Parameter.Modifier.ISBYREF) != 0)
+ out_params++;
+ }
+ }
+ if (Parameters.ArrayParameter != null){
+ Parameter p = Parameters.ArrayParameter;
+ p.DefineParameter (ec, InvokeBuilder, null, i + 1, Location);
+ }
+
+ InvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
+
+ TypeManager.RegisterMethod (InvokeBuilder,
+ new InternalParameters (param_types, Parameters),
+ param_types);
+
+ //
+ // BeginInvoke
+ //
+ int params_num = param_types.Length;
+ Type [] async_param_types = new Type [params_num + 2];
+
+ param_types.CopyTo (async_param_types, 0);
+
+ async_param_types [params_num] = TypeManager.asynccallback_type;
+ async_param_types [params_num + 1] = TypeManager.object_type;
+
+ mattr = MethodAttributes.Public | MethodAttributes.HideBySig |
+ MethodAttributes.Virtual | MethodAttributes.NewSlot;
+
+ BeginInvokeBuilder = TypeBuilder.DefineMethod ("BeginInvoke",
+ mattr,
+ cc,
+ TypeManager.iasyncresult_type,
+ async_param_types);
+
+ i = 0;
+ if (Parameters.FixedParameters != null){
+ int top = Parameters.FixedParameters.Length;
+ Parameter p;
+
+ for (i = 0 ; i < top; i++) {
+ p = Parameters.FixedParameters [i];
+
+ p.DefineParameter (ec, BeginInvokeBuilder, null, i + 1, Location);
+ }
+ }
+ if (Parameters.ArrayParameter != null){
+ Parameter p = Parameters.ArrayParameter;
+ p.DefineParameter (ec, BeginInvokeBuilder, null, i + 1, Location);
+
+ i++;
+ }
+
+ BeginInvokeBuilder.DefineParameter (i + 1, ParameterAttributes.None, "callback");
+ BeginInvokeBuilder.DefineParameter (i + 2, ParameterAttributes.None, "object");
+
+ BeginInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
+
+ Parameter [] async_params = new Parameter [params_num + 2];
+ int n = 0;
+ if (Parameters.FixedParameters != null){
+ Parameters.FixedParameters.CopyTo (async_params, 0);
+ n = Parameters.FixedParameters.Length;
+ }
+ if (Parameters.ArrayParameter != null)
+ async_params [n] = Parameters.ArrayParameter;
+
+ async_params [params_num] = new Parameter (
+ TypeManager.system_asynccallback_expr, "callback",
+ Parameter.Modifier.NONE, null);
+ async_params [params_num + 1] = new Parameter (
+ TypeManager.system_object_expr, "object",
+ Parameter.Modifier.NONE, null);
+
+ Parameters async_parameters = new Parameters (async_params, null, Location);
+ async_parameters.ComputeAndDefineParameterTypes (ec);
+
+ TypeManager.RegisterMethod (BeginInvokeBuilder,
+ new InternalParameters (async_param_types, async_parameters),
+ async_param_types);
+
+ //
+ // EndInvoke is a bit more interesting, all the parameters labeled as
+ // out or ref have to be duplicated here.
+ //
+
+ Type [] end_param_types = new Type [out_params + 1];
+ Parameter [] end_params = new Parameter [out_params + 1];
+ int param = 0;
+ if (out_params > 0){
+ int top = Parameters.FixedParameters.Length;
+ for (i = 0; i < top; i++){
+ Parameter p = Parameters.FixedParameters [i];
+ if ((p.ModFlags & Parameter.Modifier.ISBYREF) == 0)
+ continue;
+
+ end_param_types [param] = param_types [i];
+ end_params [param] = p;
+ param++;
+ }
+ }
+ end_param_types [out_params] = TypeManager.iasyncresult_type;
+ end_params [out_params] = new Parameter (TypeManager.system_iasyncresult_expr, "result", Parameter.Modifier.NONE, null);
+
+ //
+ // Create method, define parameters, register parameters with type system
+ //
+ EndInvokeBuilder = TypeBuilder.DefineMethod ("EndInvoke", mattr, cc, ret_type, end_param_types);
+ EndInvokeBuilder.SetImplementationFlags (MethodImplAttributes.Runtime);
+
+ //
+ // EndInvoke: Label the parameters
+ //
+ EndInvokeBuilder.DefineParameter (out_params + 1, ParameterAttributes.None, "result");
+ for (i = 0; i < end_params.Length-1; i++){
+ EndInvokeBuilder.DefineParameter (i + 1, end_params [i].Attributes, end_params [i].Name);
+ }
+
+ Parameters end_parameters = new Parameters (end_params, null, Location);
+ end_parameters.ComputeAndDefineParameterTypes (ec);
+
+ TypeManager.RegisterMethod (
+ EndInvokeBuilder,
+ new InternalParameters (end_param_types, end_parameters),
+ end_param_types);
+
+ return true;
+ }
+
+ public override void Emit ()
+ {
+ if (OptAttributes != null) {
+ EmitContext ec = new EmitContext (
+ Parent, this, Location, null, null, ModFlags, false);
+ Parameters.LabelParameters (ec, InvokeBuilder, Location);
+ OptAttributes.Emit (ec, this);
+ }
+
+ base.Emit ();
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+
+ //TODO: duplicate
+ protected override bool VerifyClsCompliance (DeclSpace ds)
+ {
+ if (!base.VerifyClsCompliance (ds)) {
+ return false;
+ }
+
+ AttributeTester.AreParametersCompliant (Parameters.FixedParameters, Location);
+
+ if (!AttributeTester.IsClsCompliant (ReturnType.Type)) {
+ Report.Error (3002, Location, "Return type of '{0}' is not CLS-compliant", GetSignatureForError ());
+ }
+ return true;
+ }
+
+ //
+ // Returns the MethodBase for "Invoke" from a delegate type, this is used
+ // to extract the signature of a delegate.
+ //
+ public static MethodInfo GetInvokeMethod (EmitContext ec, Type delegate_type, Location loc)
+ {
+ Expression ml = Expression.MemberLookup (
+ ec, delegate_type, "Invoke", loc);
+
+ if (!(ml is MethodGroupExpr)) {
+ Report.Error (-100, loc, "Internal error: could not find Invoke method!");
+ return null;
+ }
+
+ return (MethodInfo) (((MethodGroupExpr) ml).Methods [0]);
+ }
+
+ /// <summary>
+ /// Verifies whether the method in question is compatible with the delegate
+ /// Returns the method itself if okay and null if not.
+ /// </summary>
+ public static MethodBase VerifyMethod (EmitContext ec, Type delegate_type, MethodBase mb,
+ Location loc)
+ {
+ ParameterData pd = Invocation.GetParameterData (mb);
+
+ int pd_count = pd.Count;
+
+ MethodBase invoke_mb = GetInvokeMethod (ec, delegate_type, loc);
+ if (invoke_mb == null)
+ return null;
+
+ ParameterData invoke_pd = Invocation.GetParameterData (invoke_mb);
+
+ if (invoke_pd.Count != pd_count)
+ return null;
+
+ for (int i = pd_count; i > 0; ) {
+ i--;
+
+ if (invoke_pd.ParameterType (i) == pd.ParameterType (i) &&
+ invoke_pd.ParameterModifier (i) == pd.ParameterModifier (i))
+ continue;
+ else {
+ return null;
+ }
+ }
+
+ if (((MethodInfo) invoke_mb).ReturnType == ((MethodInfo) mb).ReturnType)
+ return mb;
+ else
+ return null;
+ }
+
+ // <summary>
+ // Verifies whether the invocation arguments are compatible with the
+ // delegate's target method
+ // </summary>
+ public static bool VerifyApplicability (EmitContext ec, Type delegate_type,
+ ArrayList args, Location loc)
+ {
+ int arg_count;
+
+ if (args == null)
+ arg_count = 0;
+ else
+ arg_count = args.Count;
+
+ Expression ml = Expression.MemberLookup (
+ ec, delegate_type, "Invoke", loc);
+
+ if (!(ml is MethodGroupExpr)) {
+ Report.Error (-100, loc, "Internal error: could not find Invoke method!" + delegate_type);
+ return false;
+ }
+
+ MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
+ ParameterData pd = Invocation.GetParameterData (mb);
+
+ int pd_count = pd.Count;
+
+ bool params_method = (pd_count != 0) &&
+ (pd.ParameterModifier (pd_count - 1) == Parameter.Modifier.PARAMS);
+
+ if (!params_method && pd_count != arg_count) {
+ Report.Error (1593, loc,
+ "Delegate '{0}' does not take {1} arguments",
+ delegate_type.ToString (), arg_count);
+ return false;
+ }
+
+ //
+ // Consider the case:
+ // delegate void FOO(param object[] args);
+ // FOO f = new FOO(...);
+ // f(new object[] {1, 2, 3});
+ //
+ // This should be treated like f(1,2,3). This is done by ignoring the
+ // 'param' modifier for that invocation. If that fails, then the
+ // 'param' modifier is considered.
+ //
+ // One issue is that 'VerifyArgumentsCompat' modifies the elements of
+ // the 'args' array. However, the modifications appear idempotent.
+ // Normal 'Invocation's also have the same behaviour, implicitly.
+ //
+
+ bool ans = false;
+ if (arg_count == pd_count)
+ ans = Invocation.VerifyArgumentsCompat (
+ ec, args, arg_count, mb, false,
+ delegate_type, false, loc);
+ if (!ans && params_method)
+ ans = Invocation.VerifyArgumentsCompat (
+ ec, args, arg_count, mb, true,
+ delegate_type, false, loc);
+ return ans;
+ }
+
+ /// <summary>
+ /// Verifies whether the delegate in question is compatible with this one in
+ /// order to determine if instantiation from the same is possible.
+ /// </summary>
+ public static bool VerifyDelegate (EmitContext ec, Type delegate_type, Type probe_type, Location loc)
+ {
+ Expression ml = Expression.MemberLookup (
+ ec, delegate_type, "Invoke", loc);
+
+ if (!(ml is MethodGroupExpr)) {
+ Report.Error (-100, loc, "Internal error: could not find Invoke method!");
+ return false;
+ }
+
+ MethodBase mb = ((MethodGroupExpr) ml).Methods [0];
+ ParameterData pd = Invocation.GetParameterData (mb);
+
+ Expression probe_ml = Expression.MemberLookup (
+ ec, delegate_type, "Invoke", loc);
+
+ if (!(probe_ml is MethodGroupExpr)) {
+ Report.Error (-100, loc, "Internal error: could not find Invoke method!");
+ return false;
+ }
+
+ MethodBase probe_mb = ((MethodGroupExpr) probe_ml).Methods [0];
+ ParameterData probe_pd = Invocation.GetParameterData (probe_mb);
+
+ if (((MethodInfo) mb).ReturnType != ((MethodInfo) probe_mb).ReturnType)
+ return false;
+
+ if (pd.Count != probe_pd.Count)
+ return false;
+
+ for (int i = pd.Count; i > 0; ) {
+ i--;
+
+ if (pd.ParameterType (i) != probe_pd.ParameterType (i) ||
+ pd.ParameterModifier (i) != probe_pd.ParameterModifier (i))
+ return false;
+ }
+
+ return true;
+ }
+
+ public static string FullDelegateDesc (Type del_type, MethodBase mb, ParameterData pd)
+ {
+ StringBuilder sb = new StringBuilder (TypeManager.CSharpName (((MethodInfo) mb).ReturnType));
+
+ sb.Append (" " + del_type.ToString ());
+ sb.Append (" (");
+
+ int length = pd.Count;
+
+ for (int i = length; i > 0; ) {
+ i--;
+
+ sb.Append (pd.ParameterDesc (length - i - 1));
+ if (i != 0)
+ sb.Append (", ");
+ }
+
+ sb.Append (")");
+ return sb.ToString ();
+
+ }
+
+ // Hack around System.Reflection as found everywhere else
+ public override MemberList FindMembers (MemberTypes mt, BindingFlags bf,
+ MemberFilter filter, object criteria)
+ {
+ ArrayList members = new ArrayList ();
+
+ if ((mt & MemberTypes.Method) != 0) {
+ if (ConstructorBuilder != null)
+ if (filter (ConstructorBuilder, criteria))
+ members.Add (ConstructorBuilder);
+
+ if (InvokeBuilder != null)
+ if (filter (InvokeBuilder, criteria))
+ members.Add (InvokeBuilder);
+
+ if (BeginInvokeBuilder != null)
+ if (filter (BeginInvokeBuilder, criteria))
+ members.Add (BeginInvokeBuilder);
+
+ if (EndInvokeBuilder != null)
+ if (filter (EndInvokeBuilder, criteria))
+ members.Add (EndInvokeBuilder);
+ }
+
+ return new MemberList (members);
+ }
+
+ public override MemberCache MemberCache {
+ get {
+ return null;
+ }
+ }
+
+ public Expression InstanceExpression {
+ get {
+ return instance_expr;
+ }
+ set {
+ instance_expr = value;
+ }
+ }
+
+ public MethodBase TargetMethod {
+ get {
+ return delegate_method;
+ }
+ set {
+ delegate_method = value;
+ }
+ }
+
+ public Type TargetReturnType {
+ get {
+ return ret_type;
+ }
+ }
+
+ public Type [] ParameterTypes {
+ get {
+ return param_types;
+ }
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Delegate;
+ }
+ }
+
+ protected override void VerifyObsoleteAttribute()
+ {
+ CheckUsageOfObsoleteAttribute (ret_type);
+
+ foreach (Type type in param_types) {
+ CheckUsageOfObsoleteAttribute (type);
+ }
+ }
+ }
+
+ //
+ // Base class for `NewDelegate' and `ImplicitDelegateCreation'
+ //
+ public abstract class DelegateCreation : Expression {
+ protected MethodBase constructor_method;
+ protected MethodBase delegate_method;
+ protected MethodGroupExpr method_group;
+ protected Expression delegate_instance_expression;
+
+ public DelegateCreation () {}
+
+ public static void Error_NoMatchingMethodForDelegate (EmitContext ec, MethodGroupExpr mg, Type type, Location loc)
+ {
+ string method_desc;
+
+ if (mg.Methods.Length > 1)
+ method_desc = mg.Methods [0].Name;
+ else
+ method_desc = Invocation.FullMethodDesc (mg.Methods [0]);
+
+ Expression invoke_method = Expression.MemberLookup (
+ ec, type, "Invoke", MemberTypes.Method,
+ Expression.AllBindingFlags, loc);
+ MethodBase method = ((MethodGroupExpr) invoke_method).Methods [0];
+ ParameterData param = Invocation.GetParameterData (method);
+ string delegate_desc = Delegate.FullDelegateDesc (type, method, param);
+
+ Report.Error (123, loc, "Method '" + method_desc + "' does not " +
+ "match delegate '" + delegate_desc + "'");
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ if (delegate_instance_expression == null || delegate_method.IsStatic)
+ ec.ig.Emit (OpCodes.Ldnull);
+ else
+ delegate_instance_expression.Emit (ec);
+
+ if (delegate_method.IsVirtual && !method_group.IsBase) {
+ ec.ig.Emit (OpCodes.Dup);
+ ec.ig.Emit (OpCodes.Ldvirtftn, (MethodInfo) delegate_method);
+ } else
+ ec.ig.Emit (OpCodes.Ldftn, (MethodInfo) delegate_method);
+ ec.ig.Emit (OpCodes.Newobj, (ConstructorInfo) constructor_method);
+ }
+
+ protected bool ResolveConstructorMethod (EmitContext ec)
+ {
+ Expression ml = Expression.MemberLookup (
+ ec, type, ".ctor", loc);
+
+ if (!(ml is MethodGroupExpr)) {
+ Report.Error (-100, loc, "Internal error: Could not find delegate constructor!");
+ return false;
+ }
+
+ constructor_method = ((MethodGroupExpr) ml).Methods [0];
+ return true;
+ }
+
+ protected Expression ResolveMethodGroupExpr (EmitContext ec, MethodGroupExpr mg)
+ {
+ foreach (MethodInfo mi in mg.Methods){
+ delegate_method = Delegate.VerifyMethod (ec, type, mi, loc);
+
+ if (delegate_method != null)
+ break;
+ }
+
+ if (delegate_method == null) {
+ Error_NoMatchingMethodForDelegate (ec, mg, type, loc);
+ return null;
+ }
+
+ //
+ // Check safe/unsafe of the delegate
+ //
+ if (!ec.InUnsafe){
+ ParameterData param = Invocation.GetParameterData (delegate_method);
+ int count = param.Count;
+
+ for (int i = 0; i < count; i++){
+ if (param.ParameterType (i).IsPointer){
+ Expression.UnsafeError (loc);
+ return null;
+ }
+ }
+ }
+
+ //TODO: implement caching when performance will be low
+ IMethodData md = TypeManager.GetMethod (delegate_method);
+ if (md == null) {
+ if (System.Attribute.GetCustomAttribute (delegate_method, TypeManager.conditional_attribute_type) != null) {
+ Report.Error (1618, loc, "Cannot create delegate with '{0}' because it has a Conditional attribute", TypeManager.CSharpSignature (delegate_method));
+ }
+ } else {
+ if (md.OptAttributes != null && md.OptAttributes.Search (TypeManager.conditional_attribute_type, ec) != null) {
+ Report.Error (1618, loc, "Cannot create delegate with '{0}' because it has a Conditional attribute", TypeManager.CSharpSignature (delegate_method));
+ }
+ }
+
+ if (mg.InstanceExpression != null)
+ delegate_instance_expression = mg.InstanceExpression.Resolve (ec);
+ else if (ec.IsStatic) {
+ if (!delegate_method.IsStatic) {
+ Report.Error (120, loc,
+ "An object reference is required for the non-static method " +
+ delegate_method.Name);
+ return null;
+ }
+ delegate_instance_expression = null;
+ } else
+ delegate_instance_expression = ec.GetThis (loc);
+
+ if (delegate_instance_expression != null && delegate_instance_expression.Type.IsValueType)
+ delegate_instance_expression = new BoxedCast (mg.InstanceExpression);
+
+ method_group = mg;
+ eclass = ExprClass.Value;
+ return this;
+ }
+ }
+
+ //
+ // Created from the conversion code
+ //
+ public class ImplicitDelegateCreation : DelegateCreation {
+
+ ImplicitDelegateCreation (Type t, Location l)
+ {
+ type = t;
+ loc = l;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return this;
+ }
+
+ static public Expression Create (EmitContext ec, MethodGroupExpr mge, Type target_type, Location loc)
+ {
+ ImplicitDelegateCreation d = new ImplicitDelegateCreation (target_type, loc);
+ if (d.ResolveConstructorMethod (ec))
+ return d.ResolveMethodGroupExpr (ec, mge);
+ else
+ return null;
+ }
+ }
+
+ //
+ // A delegate-creation-expression, invoked from the `New' class
+ //
+ public class NewDelegate : DelegateCreation {
+ public ArrayList Arguments;
+
+ //
+ // This constructor is invoked from the `New' expression
+ //
+ public NewDelegate (Type type, ArrayList Arguments, Location loc)
+ {
+ this.type = type;
+ this.Arguments = Arguments;
+ this.loc = loc;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ if (Arguments == null || Arguments.Count != 1) {
+ Report.Error (149, loc,
+ "Method name expected");
+ return null;
+ }
+
+ if (!ResolveConstructorMethod (ec))
+ return null;
+
+ Argument a = (Argument) Arguments [0];
+
+ if (!a.ResolveMethodGroup (ec, loc))
+ return null;
+
+ Expression e = a.Expr;
+
+ MethodGroupExpr mg = e as MethodGroupExpr;
+ if (mg != null)
+ return ResolveMethodGroupExpr (ec, mg);
+
+ Type e_type = e.Type;
+
+ if (!TypeManager.IsDelegateType (e_type)) {
+ e.Error_UnexpectedKind ("method", loc);
+ return null;
+ }
+
+ method_group = Expression.MemberLookup (
+ ec, type, "Invoke", MemberTypes.Method,
+ Expression.AllBindingFlags, loc) as MethodGroupExpr;
+
+ if (method_group == null) {
+ Report.Error (-200, loc, "Internal error ! Could not find Invoke method!");
+ return null;
+ }
+
+ // This is what MS' compiler reports. We could always choose
+ // to be more verbose and actually give delegate-level specifics
+ if (!Delegate.VerifyDelegate (ec, type, e_type, loc)) {
+ Report.Error (29, loc, "Cannot implicitly convert type '" + e_type + "' " +
+ "to type '" + type + "'");
+ return null;
+ }
+
+ delegate_instance_expression = e;
+ delegate_method = method_group.Methods [0];
+
+ eclass = ExprClass.Value;
+ return this;
+ }
+ }
+
+ public class DelegateInvocation : ExpressionStatement {
+
+ public Expression InstanceExpr;
+ public ArrayList Arguments;
+
+ MethodBase method;
+
+ public DelegateInvocation (Expression instance_expr, ArrayList args, Location loc)
+ {
+ this.InstanceExpr = instance_expr;
+ this.Arguments = args;
+ this.loc = loc;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ if (InstanceExpr is EventExpr) {
+
+ EventInfo ei = ((EventExpr) InstanceExpr).EventInfo;
+
+ Expression ml = MemberLookup (
+ ec, ec.ContainerType, ei.Name,
+ MemberTypes.Event, AllBindingFlags | BindingFlags.DeclaredOnly, loc);
+
+ if (ml == null) {
+ //
+ // If this is the case, then the Event does not belong
+ // to this Type and so, according to the spec
+ // cannot be accessed directly
+ //
+ // Note that target will not appear as an EventExpr
+ // in the case it is being referenced within the same type container;
+ // it will appear as a FieldExpr in that case.
+ //
+
+ Assign.error70 (ei, loc);
+ return null;
+ }
+ }
+
+
+ Type del_type = InstanceExpr.Type;
+ if (del_type == null)
+ return null;
+
+ if (Arguments != null){
+ foreach (Argument a in Arguments){
+ if (!a.Resolve (ec, loc))
+ return null;
+ }
+ }
+
+ if (!Delegate.VerifyApplicability (ec, del_type, Arguments, loc))
+ return null;
+
+ Expression lookup = Expression.MemberLookup (ec, del_type, "Invoke", loc);
+ if (!(lookup is MethodGroupExpr)) {
+ Report.Error (-100, loc, "Internal error: could not find Invoke method!");
+ return null;
+ }
+
+ method = ((MethodGroupExpr) lookup).Methods [0];
+ type = ((MethodInfo) method).ReturnType;
+ eclass = ExprClass.Value;
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ //
+ // Invocation on delegates call the virtual Invoke member
+ // so we are always `instance' calls
+ //
+ Invocation.EmitCall (ec, false, false, InstanceExpr, method, Arguments, loc);
+ }
+
+ public override void EmitStatement (EmitContext ec)
+ {
+ Emit (ec);
+ //
+ // Pop the return value if there is one
+ //
+ if (method is MethodInfo){
+ if (((MethodInfo) method).ReturnType != TypeManager.void_type)
+ ec.ig.Emit (OpCodes.Pop);
+ }
+ }
+
+ }
+}
diff --git a/mcs/mcs/driver.cs b/mcs/mcs/driver.cs
index 272094935de..29850d83cb7 100755
--- a/mcs/mcs/driver.cs
+++ b/mcs/mcs/driver.cs
@@ -5,7 +5,7 @@
//
// Licensed under the terms of the GNU GPL
//
-// (C) 2001 Ximian, Inc (http://www.ximian.com)
+// (C) 2001, 2002, 2003 Ximian, Inc (http://www.ximian.com)
//
namespace Mono.CSharp
@@ -15,10 +15,11 @@ namespace Mono.CSharp
using System.Reflection.Emit;
using System.Collections;
using System.IO;
+ using System.Text;
using System.Globalization;
- using Mono.Languages;
+ using System.Diagnostics;
- enum Target {
+ public enum Target {
Library, Exe, Module, WinExe
};
@@ -40,6 +41,11 @@ namespace Mono.CSharp
//
static ArrayList soft_references;
+ //
+ // Modules to be linked
+ //
+ static ArrayList modules;
+
// Lookup paths
static ArrayList link_paths;
@@ -51,39 +57,59 @@ namespace Mono.CSharp
static string first_source;
- static Target target = Target.Exe;
- static string target_ext = ".exe";
-
static bool want_debugging_support = false;
- static ArrayList debug_arglist = new ArrayList ();
static bool parse_only = false;
static bool timestamps = false;
-
+ static bool pause = false;
+ static bool show_counters = false;
+ public static bool parser_verbose = false;
+
//
// Whether to load the initial config file (what CSC.RSP has by default)
//
static bool load_default_config = true;
static Hashtable response_file_list;
- static Hashtable source_files = new Hashtable ();
//
// A list of resource files
//
static ArrayList resources;
-
+ static ArrayList embedded_resources;
+ static string win32ResourceFile;
+ static string win32IconFile;
+
//
// An array of the defines from the command line
//
static ArrayList defines;
//
+ // Output file
+ //
+ static string output_file = null;
+
+ //
// Last time we took the time
//
- static DateTime last_time;
- static void ShowTime (string msg)
+ static DateTime last_time, first_time;
+
+ //
+ // Encoding: ISO-Latin1 is 28591
+ //
+ static Encoding encoding;
+
+ //
+ // Whether the user has specified a different encoder manually
+ //
+ static bool using_default_encoder = true;
+
+ public static void ShowTime (string msg)
{
+ if (!timestamps)
+ return;
+
DateTime now = DateTime.Now;
TimeSpan span = now - last_time;
last_time = now;
@@ -92,24 +118,38 @@ namespace Mono.CSharp
"[{0:00}:{1:000}] {2}",
(int) span.TotalSeconds, span.Milliseconds, msg);
}
+
+ public static void ShowTotalTime (string msg)
+ {
+ if (!timestamps)
+ return;
+
+ DateTime now = DateTime.Now;
+ TimeSpan span = now - first_time;
+ last_time = now;
+
+ Console.WriteLine (
+ "[{0:00}:{1:000}] {2}",
+ (int) span.TotalSeconds, span.Milliseconds, msg);
+ }
- static void tokenize_file (string input_file)
+ static void tokenize_file (SourceFile file)
{
Stream input;
try {
- input = File.OpenRead (input_file);
+ input = File.OpenRead (file.Name);
} catch {
- Report.Error (2001, "Source file '" + input_file + "' could not be opened");
+ Report.Error (2001, "Source file '" + file.Name + "' could not be opened");
return;
}
using (input){
- Tokenizer lexer = new Tokenizer (input, input_file, defines);
+ SeekableStreamReader reader = new SeekableStreamReader (input, encoding, using_default_encoder);
+ Tokenizer lexer = new Tokenizer (reader, file, defines);
int token, tokens = 0, errors = 0;
while ((token = lexer.token ()) != Token.EOF){
- Location l = lexer.Location;
tokens++;
if (token == Token.ERROR)
errors++;
@@ -121,20 +161,22 @@ namespace Mono.CSharp
}
// MonoTODO("Change error code for aborted compilation to something reasonable")]
- static void parse (string input_file)
+ static void parse (SourceFile file)
{
CSharpParser parser;
Stream input;
try {
- input = File.OpenRead (input_file);
+ input = File.OpenRead (file.Name);
} catch {
- Report.Error (2001, "Source file '" + input_file + "' could not be opened");
+ Report.Error (2001, "Source file '" + file.Name + "' could not be opened");
return;
}
- parser = new CSharpParser (input_file, input, defines);
- parser.yacc_verbose = yacc_verbose;
+ SeekableStreamReader reader = new SeekableStreamReader (input, encoding, using_default_encoder);
+
+ parser = new CSharpParser (reader, file, defines);
+ parser.yacc_verbose_flag = yacc_verbose;
try {
parser.parse ();
} catch (Exception ex) {
@@ -143,53 +185,84 @@ namespace Mono.CSharp
input.Close ();
}
}
+
+ static void OtherFlags ()
+ {
+ Console.WriteLine (
+ "Other flags in the compiler\n" +
+ " --fatal Makes errors fatal\n" +
+ " --parse Only parses the source file\n" +
+ " --stacktrace Shows stack trace at error location\n" +
+ " --timestamp Displays time stamps of various compiler events\n" +
+ " -2 Enables experimental C# features\n" +
+ " -v Verbose parsing (for debugging the parser)\n" +
+ " --mcs-debug X Sets MCS debugging level to X\n");
+ }
static void Usage ()
{
Console.WriteLine (
- "Mono C# compiler, (C) 2001 Ximian, Inc.\n" +
+ "Mono C# compiler, (C) 2001 - 2003 Ximian, Inc.\n" +
"mcs [options] source-files\n" +
- " --about About the Mono C# compiler\n" +
- " --checked Set default context to checked\n" +
- " --define SYM Defines the symbol SYM\n" +
- " --debug Generate debugging information\n" +
- " -g Generate debugging information\n" +
- " --debug-args X Specify additional arguments for the\n" +
- " symbol writer.\n" +
- " --fatal Makes errors fatal\n" +
- " -L PATH Adds PATH to the assembly link path\n" +
- " --noconfig Disables implicit references to assemblies\n" +
- " --nostdlib Does not load core libraries\n" +
- " --nowarn XXX Ignores warning number XXX\n" +
- " -o FNAME Specifies output file\n" +
- " -g, --debug Write symbolic debugging information to FILE-debug.s\n" +
- " --parse Only parses the source file\n" +
- " --expect-error X Expect that error X will be encountered\n" +
- " --recurse SPEC Recursively compiles the files in SPEC ([dir]/file)\n" +
- " --resource FILE Addds FILE as a resource\n" +
- " --stacktrace Shows stack trace at error location\n" +
- " --target KIND Specifies the target (KIND is one of: exe, winexe, " +
- "library, module)\n" +
- " --timestamp Displays time stamps of various compiler events\n" +
- " --unsafe Allows unsafe code\n" +
- " --werror Treat warnings as errors\n" +
- " --wlevel LEVEL Sets warning level (the highest is 4, the default)\n" +
- " -r References an assembly\n" +
- " -v Verbose parsing (for debugging the parser)\n" +
- " @file Read response file for more options");
+ " --about About the Mono C# compiler\n" +
+ " -addmodule:MODULE Adds the module to the generated assembly\n" +
+ " -checked[+|-] Set default context to checked\n" +
+ " -codepage:ID Sets code page to the one in ID\n" +
+ " (number, `utf8' or `reset')\n" +
+ " -clscheck[+|-] Disables CLS Compliance verifications" + Environment.NewLine +
+ " -define:S1[;S2] Defines one or more symbols (short: /d:)\n" +
+ " -debug[+|-] Generate debugging information\n" +
+ " -delaysign[+|-] Only insert the public key into the assembly (no signing)\n" +
+ " -doc:FILE XML Documentation file to generate\n" +
+ " -g Generate debugging information\n" +
+ " -keycontainer:NAME The key pair container used to strongname the assembly\n" +
+ " -keyfile:FILE The strongname key file used to strongname the assembly\n" +
+ " -langversion:TEXT Specifies language version modes: ISO-1 or Default" + Environment.NewLine +
+ " -lib:PATH1,PATH2 Adds the paths to the assembly link path\n" +
+ " -main:class Specified the class that contains the entry point\n" +
+ " -noconfig[+|-] Disables implicit references to assemblies\n" +
+ " -nostdlib[+|-] Does not load core libraries\n" +
+ " -nowarn:W1[,W2] Disables one or more warnings\n" +
+ " -out:FNAME Specifies output file\n" +
+ " -pkg:P1[,Pn] References packages P1..Pn\n" +
+ " --expect-error X Expect that error X will be encountered\n" +
+ " -recurse:SPEC Recursively compiles the files in SPEC ([dir]/file)\n" +
+ " -reference:ASS References the specified assembly (-r:ASS)\n" +
+ " -target:KIND Specifies the target (KIND is one of: exe, winexe,\n" +
+ " library, module), (short: /t:)\n" +
+ " -unsafe[+|-] Allows unsafe code\n" +
+ " -warnaserror[+|-] Treat warnings as errors\n" +
+ " -warn:LEVEL Sets warning level (the highest is 4, the default is 2)\n" +
+ " -help2 Show other help flags\n" +
+ "\n" +
+ "Resources:\n" +
+ " -linkresource:FILE[,ID] Links FILE as a resource\n" +
+ " -resource:FILE[,ID] Embed FILE as a resource\n" +
+ " -win32res:FILE Specifies Win32 resource file (.res)\n" +
+ " -win32icon:FILE Use this icon for the output\n" +
+ " @file Read response file for more options\n\n" +
+ "Options can be of the form -option or /option");
}
+ static void TargetUsage ()
+ {
+ Report.Error (2019, "Valid options for -target: are exe, winexe, library or module");
+ }
+
static void About ()
{
Console.WriteLine (
- "The Mono C# compiler is (C) 2001 Ximian, Inc.\n\n" +
+ "The Mono C# compiler is (C) 2001, 2002, 2003 Ximian, Inc.\n\n" +
"The compiler source code is released under the terms of the GNU GPL\n\n" +
"For more information on Mono, visit the project Web site\n" +
" http://www.go-mono.com\n\n" +
- "The compiler was written by Miguel de Icaza and Ravi Pratap");
+ "The compiler was written by Miguel de Icaza, Ravi Pratap, Martin Baulig and Marek Safar");
+ Environment.Exit (0);
}
+
+ public static int counter1, counter2;
public static int Main (string[] args)
{
@@ -199,8 +272,14 @@ namespace Mono.CSharp
Console.Write("Compilation succeeded");
if (Report.Warnings > 0) {
Console.Write(" - {0} warning(s)", Report.Warnings);
- }
+ }
Console.WriteLine();
+ if (show_counters){
+ Console.WriteLine ("Counter1: " + counter1);
+ Console.WriteLine ("Counter2: " + counter2);
+ }
+ if (pause)
+ Console.ReadLine ();
return 0;
} else {
Console.WriteLine("Compilation failed: {0} error(s), {1} warnings",
@@ -215,18 +294,23 @@ namespace Mono.CSharp
string total_log = "";
try {
- char[] path_chars = { '/', '\\', '.' };
+ char[] path_chars = { '/', '\\' };
if (assembly.IndexOfAny (path_chars) != -1) {
a = Assembly.LoadFrom (assembly);
} else {
- a = Assembly.Load (assembly);
+ string ass = assembly;
+ if (ass.EndsWith (".dll"))
+ ass = assembly.Substring (0, assembly.Length - 4);
+ a = Assembly.Load (ass);
}
TypeManager.AddAssembly (a);
} catch (FileNotFoundException){
foreach (string dir in link_paths){
- string full_path = dir + "/" + assembly + ".dll";
+ string full_path = Path.Combine (dir, assembly);
+ if (!assembly.EndsWith (".dll"))
+ full_path += ".dll";
try {
a = Assembly.LoadFrom (full_path);
@@ -250,6 +334,52 @@ namespace Mono.CSharp
}
}
+ static public void LoadModule (MethodInfo adder_method, string module)
+ {
+ Module m;
+ string total_log = "";
+
+ try {
+ try {
+ m = (Module)adder_method.Invoke (CodeGen.Assembly.Builder, new object [] { module });
+ }
+ catch (TargetInvocationException ex) {
+ throw ex.InnerException;
+ }
+ TypeManager.AddModule (m);
+
+ }
+ catch (FileNotFoundException){
+ foreach (string dir in link_paths){
+ string full_path = Path.Combine (dir, module);
+ if (!module.EndsWith (".netmodule"))
+ full_path += ".netmodule";
+
+ try {
+ try {
+ m = (Module)adder_method.Invoke (CodeGen.Assembly.Builder, new object [] { full_path });
+ }
+ catch (TargetInvocationException ex) {
+ throw ex.InnerException;
+ }
+ TypeManager.AddModule (m);
+ return;
+ } catch (FileNotFoundException ff) {
+ total_log += ff.FusionLog;
+ continue;
+ }
+ }
+ Report.Error (6, "Cannot find module `" + module + "'" );
+ Console.WriteLine ("Log: \n" + total_log);
+ } catch (BadImageFormatException f) {
+ Report.Error(6, "Cannot load module (bad file format)" + f.FusionLog);
+ } catch (FileLoadException f){
+ Report.Error(6, "Cannot load module " + f.FusionLog);
+ } catch (ArgumentNullException){
+ Report.Error(6, "Cannot load module (null argument)");
+ }
+ }
+
/// <summary>
/// Loads all assemblies referenced on the command line
/// </summary>
@@ -281,11 +411,36 @@ namespace Mono.CSharp
return null;
}
+ StringBuilder sb = new StringBuilder ();
+
while ((line = f.ReadLine ()) != null){
- string [] line_args = line.Split (new char [] { ' ' });
+ int t = line.Length;
+
+ for (int i = 0; i < t; i++){
+ char c = line [i];
+
+ if (c == '"' || c == '\''){
+ char end = c;
+
+ for (i++; i < t; i++){
+ c = line [i];
- foreach (string arg in line_args)
- args.Add (arg);
+ if (c == end)
+ break;
+ sb.Append (c);
+ }
+ } else if (c == ' '){
+ if (sb.Length > 0){
+ args.Add (sb.ToString ());
+ sb.Length = 0;
+ }
+ } else
+ sb.Append (c);
+ }
+ if (sb.Length > 0){
+ args.Add (sb.ToString ());
+ sb.Length = 0;
+ }
}
string [] ret_value = new string [args.Count];
@@ -302,9 +457,10 @@ namespace Mono.CSharp
Assembly [] assemblies = AppDomain.CurrentDomain.GetAssemblies ();
foreach (Assembly a in assemblies){
- string codebase = a.CodeBase;
- if (codebase.EndsWith ("corlib.dll")){
- return codebase.Substring (0, codebase.LastIndexOf ("/"));
+ string codebase = a.Location;
+ string fn = System.IO.Path.GetFileName (codebase);
+ if (fn == "corlib.dll" || fn == "mscorlib.dll"){
+ return codebase.Substring (0, codebase.LastIndexOf (System.IO.Path.DirectorySeparatorChar));
}
}
@@ -317,7 +473,7 @@ namespace Mono.CSharp
//
static void SplitPathAndPattern (string spec, out string path, out string pattern)
{
- int p = spec.LastIndexOf ("/");
+ int p = spec.LastIndexOf ('/');
if (p != -1){
//
// Windows does not like /file.cs, switch that to:
@@ -333,7 +489,7 @@ namespace Mono.CSharp
return;
}
- p = spec.LastIndexOf ("\\");
+ p = spec.LastIndexOf ('\\');
if (p != -1){
path = spec.Substring (0, p);
pattern = spec.Substring (p + 1);
@@ -349,18 +505,19 @@ namespace Mono.CSharp
if (first_source == null)
first_source = f;
- if (source_files.Contains (f)){
- Report.Error (
- 1516,
- "Source file `" + f + "' specified multiple times");
- Environment.Exit (1);
- } else
- source_files.Add (f, f);
-
- if (tokenize) {
- tokenize_file (f);
- } else {
- parse (f);
+ Location.AddFile (f);
+ }
+
+ static void ProcessFiles ()
+ {
+ Location.Initialize ();
+
+ foreach (SourceFile file in Location.SourceFiles) {
+ if (tokenize) {
+ tokenize_file (file);
+ } else {
+ parse (file);
+ }
}
}
@@ -369,7 +526,7 @@ namespace Mono.CSharp
string path, pattern;
SplitPathAndPattern (spec, out path, out pattern);
- if (pattern.IndexOf ("*") == -1){
+ if (pattern.IndexOf ('*') == -1){
ProcessFile (spec);
return;
}
@@ -444,6 +601,731 @@ namespace Mono.CSharp
foreach (string def in default_config)
soft_references.Insert (p++, def);
}
+
+ static void SetOutputFile (string name)
+ {
+ output_file = name;
+ }
+
+ static void SetWarningLevel (string s)
+ {
+ int level = 0;
+
+ try {
+ level = Int32.Parse (s);
+ } catch {
+ Report.Error (
+ 1900,
+ "--wlevel requires a value from 0 to 4");
+ Environment.Exit (1);
+ }
+ if (level < 0 || level > 4){
+ Report.Error (1900, "Warning level must be 0 to 4");
+ Environment.Exit (1);
+ }
+ RootContext.WarningLevel = level;
+ TestWarningConflict ();
+ }
+
+ static void TestWarningConflict ()
+ {
+ if (RootContext.WarningLevel == 0 && Report.WarningsAreErrors) {
+ Report.Error (1901, "Conflicting options specified: Warning level 0; Treat warnings as errors");
+ Environment.Exit (1);
+ }
+ }
+
+ static void SetupV2 ()
+ {
+ RootContext.Version = LanguageVersion.Default;
+ defines.Add ("__V2__");
+ }
+
+ static void Version ()
+ {
+ string version = Assembly.GetExecutingAssembly ().GetName ().Version.ToString ();
+ Console.WriteLine ("Mono C# compiler version {0}", version);
+ Environment.Exit (0);
+ }
+
+ //
+ // Currently handles the Unix-like command line options, but will be
+ // deprecated in favor of the CSCParseOption, which will also handle the
+ // options that start with a dash in the future.
+ //
+ static bool UnixParseOption (string arg, ref string [] args, ref int i)
+ {
+ switch (arg){
+ case "-vv":
+ parser_verbose = true;
+ return true;
+
+ case "-v":
+ yacc_verbose = true;
+ return true;
+
+ case "--version":
+ Version ();
+ return true;
+
+ case "--parse":
+ parse_only = true;
+ return true;
+
+ case "--main": case "-m":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Environment.Exit (1);
+ }
+ RootContext.MainClass = args [++i];
+ return true;
+
+ case "--unsafe":
+ RootContext.Unsafe = true;
+ return true;
+
+ case "/?": case "/h": case "/help":
+ case "--help":
+ Usage ();
+ Environment.Exit (0);
+ return true;
+
+ case "--define":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Environment.Exit (1);
+ }
+ defines.Add (args [++i]);
+ return true;
+
+ case "--show-counters":
+ show_counters = true;
+ return true;
+
+ case "--expect-error": {
+ int code = 0;
+
+ try {
+ code = Int32.Parse (
+ args [++i], NumberStyles.AllowLeadingSign);
+ Report.ExpectedError = code;
+ } catch {
+ Report.Error (-14, "Invalid number specified");
+ }
+ return true;
+ }
+
+ case "--tokenize":
+ tokenize = true;
+ return true;
+
+ case "-o":
+ case "--output":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Environment.Exit (1);
+ }
+ SetOutputFile (args [++i]);
+ return true;
+
+ case "--checked":
+ RootContext.Checked = true;
+ return true;
+
+ case "--stacktrace":
+ Report.Stacktrace = true;
+ return true;
+
+ case "--linkresource":
+ case "--linkres":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Report.Error (5, "Missing argument to --linkres");
+ Environment.Exit (1);
+ }
+ if (resources == null)
+ resources = new ArrayList ();
+
+ resources.Add (args [++i]);
+ return true;
+
+ case "--resource":
+ case "--res":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Report.Error (5, "Missing argument to --resource");
+ Environment.Exit (1);
+ }
+ if (embedded_resources == null)
+ embedded_resources = new ArrayList ();
+
+ embedded_resources.Add (args [++i]);
+ return true;
+
+ case "--target":
+ if ((i + 1) >= args.Length){
+ Environment.Exit (1);
+ return true;
+ }
+
+ string type = args [++i];
+ switch (type){
+ case "library":
+ RootContext.Target = Target.Library;
+ RootContext.TargetExt = ".dll";
+ break;
+
+ case "exe":
+ RootContext.Target = Target.Exe;
+ break;
+
+ case "winexe":
+ RootContext.Target = Target.WinExe;
+ break;
+
+ case "module":
+ RootContext.Target = Target.Module;
+ RootContext.TargetExt = ".dll";
+ break;
+ default:
+ TargetUsage ();
+ Environment.Exit (1);
+ break;
+ }
+ return true;
+
+ case "-r":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Environment.Exit (1);
+ }
+
+ references.Add (args [++i]);
+ return true;
+
+ case "-L":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Environment.Exit (1);
+ }
+ link_paths.Add (args [++i]);
+ return true;
+
+ case "--nostdlib":
+ RootContext.StdLib = false;
+ return true;
+
+ case "--fatal":
+ Report.Fatal = true;
+ return true;
+
+ case "--werror":
+ Report.WarningsAreErrors = true;
+ TestWarningConflict();
+ return true;
+
+ case "--nowarn":
+ if ((i + 1) >= args.Length){
+ Usage ();
+ Environment.Exit (1);
+ }
+ int warn = 0;
+
+ try {
+ warn = Int32.Parse (args [++i]);
+ } catch {
+ Usage ();
+ Environment.Exit (1);
+ }
+ Report.SetIgnoreWarning (warn);
+ return true;
+
+ case "--wlevel":
+ if ((i + 1) >= args.Length){
+ Report.Error (
+ 1900,
+ "--wlevel requires a value from 0 to 4");
+ Environment.Exit (1);
+ }
+
+ SetWarningLevel (args [++i]);
+ return true;
+
+ case "--mcs-debug":
+ if ((i + 1) >= args.Length){
+ Report.Error (5, "--mcs-debug requires an argument");
+ Environment.Exit (1);
+ }
+
+ try {
+ Report.DebugFlags = Int32.Parse (args [++i]);
+ } catch {
+ Report.Error (5, "Invalid argument to --mcs-debug");
+ Environment.Exit (1);
+ }
+ return true;
+
+ case "--about":
+ About ();
+ return true;
+
+ case "--recurse":
+ if ((i + 1) >= args.Length){
+ Report.Error (5, "--recurse requires an argument");
+ Environment.Exit (1);
+ }
+ CompileFiles (args [++i], true);
+ return true;
+
+ case "--timestamp":
+ timestamps = true;
+ last_time = first_time = DateTime.Now;
+ return true;
+
+ case "--pause":
+ pause = true;
+ return true;
+
+ case "--debug": case "-g":
+ want_debugging_support = true;
+ return true;
+
+ case "--noconfig":
+ load_default_config = false;
+ return true;
+ }
+
+ return false;
+ }
+
+ //
+ // Currently it is very basic option parsing, but eventually, this will
+ // be the complete option parser
+ //
+ static bool CSCParseOption (string option, ref string [] args, ref int i)
+ {
+ int idx = option.IndexOf (':');
+ string arg, value;
+
+ if (idx == -1){
+ arg = option;
+ value = "";
+ } else {
+ arg = option.Substring (0, idx);
+
+ value = option.Substring (idx + 1);
+ }
+
+ switch (arg){
+ case "/nologo":
+ return true;
+
+ case "/t":
+ case "/target":
+ switch (value){
+ case "exe":
+ RootContext.Target = Target.Exe;
+ break;
+
+ case "winexe":
+ RootContext.Target = Target.WinExe;
+ break;
+
+ case "library":
+ RootContext.Target = Target.Library;
+ RootContext.TargetExt = ".dll";
+ break;
+
+ case "module":
+ RootContext.Target = Target.Module;
+ RootContext.TargetExt = ".netmodule";
+ break;
+
+ default:
+ TargetUsage ();
+ Environment.Exit (1);
+ break;
+ }
+ return true;
+
+ case "/out":
+ if (value == ""){
+ Usage ();
+ Environment.Exit (1);
+ }
+ SetOutputFile (value);
+ return true;
+
+ case "/optimize":
+ case "/optimize+":
+ case "/optimize-":
+ case "/incremental":
+ case "/incremental+":
+ case "/incremental-":
+ // nothing.
+ return true;
+
+ case "/d":
+ case "/define": {
+ string [] defs;
+
+ if (value == ""){
+ Usage ();
+ Environment.Exit (1);
+ }
+
+ defs = value.Split (new Char [] {';', ','});
+ foreach (string d in defs){
+ defines.Add (d);
+ }
+ return true;
+ }
+
+ case "/linkres":
+ case "/linkresource":
+ if (value == ""){
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+ if (resources == null)
+ resources = new ArrayList ();
+
+ resources.Add (value);
+ return true;
+
+ case "/pkg": {
+ string packages;
+
+ if (value == ""){
+ Usage ();
+ Environment.Exit (1);
+ }
+ packages = String.Join (" ", value.Split (new Char [] { ';', ',', '\n', '\r'}));
+
+ ProcessStartInfo pi = new ProcessStartInfo ();
+ pi.FileName = "pkg-config";
+ pi.RedirectStandardOutput = true;
+ pi.UseShellExecute = false;
+ pi.Arguments = "--libs " + packages;
+ Process p = null;
+ try {
+ p = Process.Start (pi);
+ } catch (Exception e) {
+ Report.Error (-27, "Couldn't run pkg-config: " + e.Message);
+ Environment.Exit (1);
+ }
+
+ if (p.StandardOutput == null){
+ Report.Warning (-27, "Specified package did not return any information");
+ return true;
+ }
+ string pkgout = p.StandardOutput.ReadToEnd ();
+ p.WaitForExit ();
+ if (p.ExitCode != 0) {
+ Report.Error (-27, "Error running pkg-config. Check the above output.");
+ Environment.Exit (1);
+ }
+
+ if (pkgout != null){
+ string [] xargs = pkgout.Trim (new Char [] {' ', '\n', '\r', '\t'}).
+ Split (new Char [] { ' ', '\t'});
+ args = AddArgs (args, xargs);
+ }
+
+ p.Close ();
+ return true;
+ }
+
+ case "/res":
+ case "/resource":
+ if (value == ""){
+ Report.Error (5, "-resource requires an argument");
+ Environment.Exit (1);
+ }
+ if (embedded_resources == null)
+ embedded_resources = new ArrayList ();
+
+ if (embedded_resources.Contains (value)) {
+ Report.Error (1508, String.Format ("The resource identifier '{0}' has already been used in this assembly.", value));
+ }
+ else if (value.IndexOf (',') != -1 && embedded_resources.Contains (value.Split (',')[1])) {
+ Report.Error (1508, String.Format ("The resource identifier '{0}' has already been used in this assembly.", value));
+ }
+ else {
+ embedded_resources.Add (value);
+ }
+ return true;
+
+ case "/recurse":
+ if (value == ""){
+ Report.Error (5, "-recurse requires an argument");
+ Environment.Exit (1);
+ }
+ CompileFiles (value, true);
+ return true;
+
+ case "/r":
+ case "/reference": {
+ if (value == ""){
+ Report.Error (5, "-reference requires an argument");
+ Environment.Exit (1);
+ }
+
+ string [] refs = value.Split (new char [] { ';', ',' });
+ foreach (string r in refs){
+ references.Add (r);
+ }
+ return true;
+ }
+ case "/addmodule": {
+ if (value == ""){
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+
+ string [] refs = value.Split (new char [] { ';', ',' });
+ foreach (string r in refs){
+ modules.Add (r);
+ }
+ return true;
+ }
+ case "/win32res": {
+ if (value == "") {
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+
+ win32ResourceFile = value;
+ return true;
+ }
+ case "/win32icon": {
+ if (value == "") {
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+
+ win32IconFile = value;
+ return true;
+ }
+ case "/doc": {
+ if (value == ""){
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+ // TODO handle the /doc argument to generate xml doc
+ return true;
+ }
+ case "/lib": {
+ string [] libdirs;
+
+ if (value == ""){
+ Report.Error (5, "/lib requires an argument");
+ Environment.Exit (1);
+ }
+
+ libdirs = value.Split (new Char [] { ',' });
+ foreach (string dir in libdirs)
+ link_paths.Add (dir);
+ return true;
+ }
+
+ case "/debug-":
+ want_debugging_support = false;
+ return true;
+
+ case "/debug":
+ case "/debug+":
+ want_debugging_support = true;
+ return true;
+
+ case "/checked":
+ case "/checked+":
+ RootContext.Checked = true;
+ return true;
+
+ case "/checked-":
+ RootContext.Checked = false;
+ return true;
+
+ case "/clscheck":
+ case "/clscheck+":
+ return true;
+
+ case "/clscheck-":
+ RootContext.VerifyClsCompliance = false;
+ return true;
+
+ case "/unsafe":
+ case "/unsafe+":
+ RootContext.Unsafe = true;
+ return true;
+
+ case "/unsafe-":
+ RootContext.Unsafe = false;
+ return true;
+
+ case "/warnaserror":
+ case "/warnaserror+":
+ Report.WarningsAreErrors = true;
+ TestWarningConflict();
+ return true;
+
+ case "/warnaserror-":
+ Report.WarningsAreErrors = false;
+ return true;
+
+ case "/warn":
+ SetWarningLevel (value);
+ return true;
+
+ case "/nowarn": {
+ string [] warns;
+
+ if (value == ""){
+ Report.Error (5, "/nowarn requires an argument");
+ Environment.Exit (1);
+ }
+
+ warns = value.Split (new Char [] {','});
+ foreach (string wc in warns){
+ try {
+ int warn = Int32.Parse (wc);
+ if (warn < 1) {
+ throw new ArgumentOutOfRangeException("warn");
+ }
+ Report.SetIgnoreWarning (warn);
+ } catch {
+ Report.Error (1904, String.Format("'{0}' is not a valid warning number", wc));
+ Environment.Exit (1);
+ }
+ }
+ return true;
+ }
+
+ case "/noconfig-":
+ load_default_config = true;
+ return true;
+
+ case "/noconfig":
+ case "/noconfig+":
+ load_default_config = false;
+ return true;
+
+ case "/help2":
+ OtherFlags ();
+ Environment.Exit(0);
+ return true;
+
+ case "/help":
+ case "/?":
+ Usage ();
+ Environment.Exit (0);
+ return true;
+
+ case "/main":
+ case "/m":
+ if (value == ""){
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+ RootContext.MainClass = value;
+ return true;
+
+ case "/nostdlib":
+ case "/nostdlib+":
+ RootContext.StdLib = false;
+ return true;
+
+ case "/nostdlib-":
+ RootContext.StdLib = true;
+ return true;
+
+ case "/fullpaths":
+ return true;
+
+ case "/keyfile":
+ if (value == String.Empty) {
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+ RootContext.StrongNameKeyFile = value;
+ return true;
+ case "/keycontainer":
+ if (value == String.Empty) {
+ Report.Error (5, arg + " requires an argument");
+ Environment.Exit (1);
+ }
+ RootContext.StrongNameKeyContainer = value;
+ return true;
+ case "/delaysign+":
+ RootContext.StrongNameDelaySign = true;
+ return true;
+ case "/delaysign-":
+ RootContext.StrongNameDelaySign = false;
+ return true;
+
+ case "/v2":
+ case "/2":
+ Console.WriteLine ("The compiler option -2 is obsolete. Please use /langversion instead");
+ SetupV2 ();
+ return true;
+
+ case "/langversion":
+ switch (value.ToLower (CultureInfo.InvariantCulture)) {
+ case "iso-1":
+ RootContext.Version = LanguageVersion.ISO_1;
+ return true;
+
+ case "default":
+ SetupV2 ();
+ return true;
+ }
+ Report.Error (1617, "Invalid option '{0}' for /langversion; must be ISO-1 or Default", value);
+ Environment.Exit (1);
+ return false;
+
+ case "/codepage":
+ int cp = -1;
+
+ if (value == "utf8"){
+ encoding = new UTF8Encoding();
+ using_default_encoder = false;
+ return true;
+ }
+ if (value == "reset"){
+ //
+ // 28591 is the code page for ISO-8859-1 encoding.
+ //
+ cp = 28591;
+ using_default_encoder = true;
+ }
+
+ try {
+ cp = Int32.Parse (value);
+ encoding = Encoding.GetEncoding (cp);
+ using_default_encoder = false;
+ } catch {
+ Report.Error (2016, String.Format("Code page '{0}' is invalid or not installed", cp));
+ Environment.Exit (1);
+ }
+ return true;
+ }
+
+ //Report.Error (2007, String.Format ("Unrecognized command-line option: '{0}'", option));
+ //Environment.Exit (1);
+ return false;
+ }
+
+ static string [] AddArgs (string [] args, string [] extra_args)
+ {
+ string [] new_args;
+
+ new_args = new string [extra_args.Length + args.Length];
+ args.CopyTo (new_args, 0);
+ extra_args.CopyTo (new_args, args.Length);
+
+ return new_args;
+ }
/// <summary>
/// Parses the arguments, and drives the compilation
@@ -455,14 +1337,21 @@ namespace Mono.CSharp
/// now, needs to be turned into a real driver soon.
/// </remarks>
// [MonoTODO("Change error code for unknown argument to something reasonable")]
- static bool MainDriver (string [] args)
+ internal static bool MainDriver (string [] args)
{
int i;
- string output_file = null;
bool parsing_options = true;
+
+ try {
+ encoding = Encoding.GetEncoding (28591);
+ } catch {
+ Console.WriteLine ("Error: could not load encoding 28591, trying 1252");
+ encoding = Encoding.GetEncoding (1252);
+ }
references = new ArrayList ();
soft_references = new ArrayList ();
+ modules = new ArrayList ();
link_paths = new ArrayList ();
SetupDefaultDefines ();
@@ -473,14 +1362,14 @@ namespace Mono.CSharp
// This is not required because Assembly.Load knows about this
// path.
//
- link_paths.Add (GetSystemDir ());
- int argc = args.Length;
- for (i = 0; i < argc; i++){
+ for (i = 0; i < args.Length; i++){
string arg = args [i];
-
+ if (arg == "")
+ continue;
+
if (arg.StartsWith ("@")){
- string [] new_args, extra_args;
+ string [] extra_args;
string response_file = arg.Substring (1);
if (response_file_list == null)
@@ -502,255 +1391,55 @@ namespace Mono.CSharp
return false;
}
- new_args = new string [extra_args.Length + argc];
- args.CopyTo (new_args, 0);
- extra_args.CopyTo (new_args, argc);
- args = new_args;
- argc = new_args.Length;
+ args = AddArgs (args, extra_args);
continue;
}
- //
- // Prepare to recurse
- //
-
- if (parsing_options && (arg.StartsWith ("-"))){
- switch (arg){
- case "-v":
- yacc_verbose = true;
- continue;
-
- case "--":
+ if (parsing_options){
+ if (arg == "--"){
parsing_options = false;
continue;
-
- case "--parse":
- parse_only = true;
- continue;
-
- case "--main": case "-m":
- if ((i + 1) >= argc){
- Usage ();
- return false;
- }
- RootContext.MainClass = args [++i];
- continue;
-
- case "--unsafe":
- RootContext.Unsafe = true;
- continue;
-
- case "/?": case "/h": case "/help":
- case "--help":
- Usage ();
- return false;
-
- case "--define":
- if ((i + 1) >= argc){
- Usage ();
- return false;
- }
- defines.Add (args [++i]);
- continue;
-
- case "--expect-error": {
- int code = 0;
-
- try {
- code = Int32.Parse (
- args [++i], NumberStyles.AllowLeadingSign);
- Report.ExpectedError = code;
- } catch {
- Report.Error (-14, "Invalid number specified");
- }
- continue;
- }
-
- case "--tokenize": {
- tokenize = true;
- continue;
}
- case "-o":
- case "--output":
- if ((i + 1) >= argc){
- Usage ();
- return false;
- }
- output_file = args [++i];
- string bname = CodeGen.Basename (output_file);
- if (bname.IndexOf (".") == -1)
- output_file += ".exe";
- continue;
-
- case "--checked":
- RootContext.Checked = true;
- continue;
-
- case "--stacktrace":
- Report.Stacktrace = true;
- continue;
-
- case "--resource":
- if ((i + 1) >= argc){
- Usage ();
- Console.WriteLine("Missing argument to --resource");
- return false;
- }
- if (resources == null)
- resources = new ArrayList ();
-
- resources.Add (args [++i]);
- continue;
-
- case "--target":
- if ((i + 1) >= argc){
- Usage ();
- return false;
- }
-
- string type = args [++i];
- switch (type){
- case "library":
- target = Target.Library;
- target_ext = ".dll";
- break;
-
- case "exe":
- target = Target.Exe;
- break;
-
- case "winexe":
- target = Target.WinExe;
- break;
-
- case "module":
- target = Target.Module;
- target_ext = ".dll";
- break;
- default:
- Usage ();
- return false;
- }
- continue;
-
- case "-r":
- if ((i + 1) >= argc){
- Usage ();
- return false;
+ if (arg.StartsWith ("-")){
+ if (UnixParseOption (arg, ref args, ref i))
+ continue;
+
+ // Try a -CSCOPTION
+ string csc_opt = "/" + arg.Substring (1);
+ if (CSCParseOption (csc_opt, ref args, ref i))
+ continue;
+ } else {
+ if (arg.StartsWith ("/")){
+ if (CSCParseOption (arg, ref args, ref i))
+ continue;
}
-
- references.Add (args [++i]);
- continue;
-
- case "-L":
- if ((i + 1) >= argc){
- Usage ();
- return false;
- }
- link_paths.Add (args [++i]);
- continue;
-
- case "--nostdlib":
- RootContext.StdLib = false;
- continue;
-
- case "--fatal":
- Report.Fatal = true;
- continue;
-
- case "--werror":
- Report.WarningsAreErrors = true;
- continue;
-
- case "--nowarn":
- if ((i + 1) >= argc){
- Usage ();
- return false;
- }
- int warn;
-
- try {
- warn = Int32.Parse (args [++i]);
- } catch {
- Usage ();
- return false;
- }
- Report.SetIgnoreWarning (warn);
- continue;
-
- case "--wlevel":
- if ((i + 1) >= argc){
- Report.Error (
- 1900,
- "--wlevel requires an value from 0 to 4");
- return false;
- }
- int level;
-
- try {
- level = Int32.Parse (args [++i]);
- } catch {
- Report.Error (
- 1900,
- "--wlevel requires an value from 0 to 4");
- return false;
- }
- if (level < 0 || level > 4){
- Report.Error (1900, "Warning level must be 0 to 4");
- return false;
- } else
- RootContext.WarningLevel = level;
- continue;
-
- case "--about":
- About ();
- return true;
-
- case "--recurse":
- if ((i + 1) >= argc){
- Console.WriteLine ("--recurse requires an argument");
- return false;
- }
- CompileFiles (args [++i], true);
- continue;
-
- case "--timestamp":
- timestamps = true;
- last_time = DateTime.Now;
- debug_arglist.Add ("timestamp");
- continue;
-
- case "--debug": case "-g":
- want_debugging_support = true;
- continue;
-
- case "--debug-args":
- if ((i + 1) >= argc){
- Console.WriteLine ("--debug-args requires an argument");
- return false;
- }
- char[] sep = { ',' };
- debug_arglist.AddRange (args [++i].Split (sep));
- continue;
-
- case "--noconfig":
- load_default_config = false;
- continue;
-
- default:
- Report.Warning(666, "Unknown option: " + arg);
- continue;
}
}
CompileFiles (arg, false);
}
+ ProcessFiles ();
+
if (tokenize)
return true;
-
- if (first_source == null){
+
+ //
+ // If we are an exe, require a source file for the entry point
+ //
+ if (RootContext.Target == Target.Exe || RootContext.Target == Target.WinExe){
+ if (first_source == null){
+ Report.Error (2008, "No files to compile were specified");
+ return false;
+ }
+
+ }
+
+ //
+ // If there is nothing to put in the assembly, and we are not a library
+ //
+ if (first_source == null && embedded_resources == null && resources == null){
Report.Error (2008, "No files to compile were specified");
return false;
}
@@ -760,6 +1449,8 @@ namespace Mono.CSharp
if (parse_only)
return true;
+
+ Tokenizer.Cleanup ();
//
// Load Core Library for default compilation
@@ -779,6 +1470,8 @@ namespace Mono.CSharp
//
if (timestamps)
ShowTime ("Loading references");
+ link_paths.Add (GetSystemDir ());
+ link_paths.Add (Directory.GetCurrentDirectory ());
LoadReferences ();
if (timestamps)
@@ -792,20 +1485,42 @@ namespace Mono.CSharp
// Quick hack
//
if (output_file == null){
- int pos = first_source.LastIndexOf (".");
+ int pos = first_source.LastIndexOf ('.');
if (pos > 0)
- output_file = first_source.Substring (0, pos) + target_ext;
+ output_file = first_source.Substring (0, pos) + RootContext.TargetExt;
else
- output_file = first_source + target_ext;
+ output_file = first_source + RootContext.TargetExt;
}
- string[] debug_args = new string [debug_arglist.Count];
- debug_arglist.CopyTo (debug_args);
- CodeGen.Init (output_file, output_file, want_debugging_support, debug_args);
+ CodeGen.Init (output_file, output_file, want_debugging_support);
- TypeManager.AddModule (CodeGen.ModuleBuilder);
+ if (RootContext.Target == Target.Module) {
+ PropertyInfo module_only = typeof (AssemblyBuilder).GetProperty ("IsModuleOnly", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic);
+ if (module_only == null) {
+ Report.Error (0, new Location (-1), "Cannot use /target:module on this runtime: try the Mono runtime instead.");
+ Environment.Exit (1);
+ }
+
+ MethodInfo set_method = module_only.GetSetMethod (true);
+ set_method.Invoke (CodeGen.Assembly.Builder, BindingFlags.Default, null, new object[]{true}, null);
+ }
+
+ TypeManager.AddModule (CodeGen.Module.Builder);
+
+ if (modules.Count > 0) {
+ MethodInfo adder_method = typeof (AssemblyBuilder).GetMethod ("AddModule", BindingFlags.Instance|BindingFlags.NonPublic);
+ if (adder_method == null) {
+ Report.Error (0, new Location (-1), "Cannot use /addmodule on this runtime: Try the Mono runtime instead.");
+ Environment.Exit (1);
+ }
+
+ foreach (string module in modules)
+ LoadModule (adder_method, module);
+ }
+ TypeManager.ComputeNamespaces ();
+
//
// Before emitting, we need to get the core
// types emitted from the user defined types
@@ -829,23 +1544,42 @@ namespace Mono.CSharp
if (timestamps)
ShowTime ("Resolving tree");
RootContext.ResolveTree ();
+ if (Report.Errors > 0)
+ return false;
if (timestamps)
ShowTime ("Populate tree");
if (!RootContext.StdLib)
RootContext.BootCorlib_PopulateCoreTypes ();
+
RootContext.PopulateTypes ();
+ RootContext.DefineTypes ();
TypeManager.InitCodeHelpers ();
-
+
+ //
+ // Verify using aliases now
+ //
+ Namespace.VerifyUsing ();
+
if (Report.Errors > 0){
return false;
}
+ if (RootContext.VerifyClsCompliance) {
+ CodeGen.Assembly.ResolveClsCompliance ();
+ if (CodeGen.Assembly.IsClsCompliant) {
+ AttributeTester.VerifyModulesClsCompliance ();
+ TypeManager.LoadAllImportedTypes ();
+ AttributeTester.VerifyTopLevelNameClsCompliance ();
+ }
+ }
+
//
// The code generator
//
if (timestamps)
ShowTime ("Emitting code");
+ ShowTotalTime ("Total so far");
RootContext.EmitCode ();
if (timestamps)
ShowTime (" done");
@@ -856,56 +1590,178 @@ namespace Mono.CSharp
if (timestamps)
ShowTime ("Closing types");
-
+
RootContext.CloseTypes ();
PEFileKinds k = PEFileKinds.ConsoleApplication;
-
- if (target == Target.Library || target == Target.Module)
- k = PEFileKinds.Dll;
- else if (target == Target.Exe)
- k = PEFileKinds.ConsoleApplication;
- else if (target == Target.WinExe)
- k = PEFileKinds.WindowApplication;
+
+ switch (RootContext.Target) {
+ case Target.Library:
+ case Target.Module:
+ k = PEFileKinds.Dll; break;
+ case Target.Exe:
+ k = PEFileKinds.ConsoleApplication; break;
+ case Target.WinExe:
+ k = PEFileKinds.WindowApplication; break;
+ }
- if (target == Target.Exe || target == Target.WinExe){
+ if (RootContext.NeedsEntryPoint) {
MethodInfo ep = RootContext.EntryPoint;
- if (ep == null){
- Report.Error (5001, "Program " + output_file +
+ if (ep == null) {
+ if (RootContext.MainClass != null) {
+ object main_cont = RootContext.Tree.Decls [RootContext.MainClass];
+ if (main_cont == null) {
+ Report.Error (1555, output_file, "Could not find '{0}' specified for Main method", RootContext.MainClass);
+ return false;
+ }
+
+ if (!(main_cont is ClassOrStruct)) {
+ Report.Error (1556, output_file, "'{0}' specified for Main method must be a valid class or struct", RootContext.MainClass);
+ return false;
+ }
+ }
+
+ if (Report.Errors == 0)
+ Report.Error (5001, "Program " + output_file +
" does not have an entry point defined");
return false;
}
-
- CodeGen.AssemblyBuilder.SetEntryPoint (ep, k);
+
+ CodeGen.Assembly.Builder.SetEntryPoint (ep, k);
+ } else if (RootContext.MainClass != null) {
+ Report.Error (2017, "Can not specify -main: when building module or library");
}
//
// Add the resources
//
if (resources != null){
- foreach (string file in resources)
- CodeGen.AssemblyBuilder.AddResourceFile (file, file);
+ foreach (string spec in resources){
+ string file, res;
+ int cp;
+
+ cp = spec.IndexOf (',');
+ if (cp != -1){
+ file = spec.Substring (0, cp);
+ res = spec.Substring (cp + 1);
+ } else
+ file = res = spec;
+
+ CodeGen.Assembly.Builder.AddResourceFile (res, file);
+ }
+ }
+
+ if (embedded_resources != null){
+ object[] margs = new object [2];
+ Type[] argst = new Type [2];
+ argst [0] = argst [1] = typeof (string);
+
+ MethodInfo embed_res = typeof (AssemblyBuilder).GetMethod (
+ "EmbedResourceFile", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic,
+ null, CallingConventions.Any, argst, null);
+
+ if (embed_res == null) {
+ Report.Warning (0, new Location (-1),
+ "Cannot embed resources on this runtime: try the Mono runtime instead.");
+ } else {
+ foreach (string spec in embedded_resources) {
+ int cp;
+
+ cp = spec.IndexOf (',');
+ if (cp != -1){
+ margs [0] = spec.Substring (cp + 1);
+ margs [1] = spec.Substring (0, cp);
+ } else {
+ margs [1] = spec;
+ margs [0] = Path.GetFileName (spec);
+ }
+
+ if (File.Exists ((string) margs [1]))
+ embed_res.Invoke (CodeGen.Assembly.Builder, margs);
+ else {
+ Report.Error (1566, "Can not find the resource " + margs [1]);
+ }
+ }
+ }
+ }
+
+ //
+ // Add Win32 resources
+ //
+
+ CodeGen.Assembly.Builder.DefineVersionInfoResource ();
+
+ if (win32ResourceFile != null) {
+ try {
+ CodeGen.Assembly.Builder.DefineUnmanagedResource (win32ResourceFile);
+ }
+ catch (ArgumentException) {
+ Report.Warning (0, new Location (-1), "Cannot embed win32 resources on this runtime: try the Mono runtime instead.");
+ }
}
+
+ if (win32IconFile != null) {
+ MethodInfo define_icon = typeof (AssemblyBuilder).GetMethod ("DefineIconResource", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic);
+ if (define_icon == null) {
+ Report.Warning (0, new Location (-1), "Cannot embed icon resource on this runtime: try the Mono runtime instead.");
+ }
+ define_icon.Invoke (CodeGen.Assembly.Builder, new object [] { win32IconFile });
+ }
+
+ if (Report.Errors > 0)
+ return false;
CodeGen.Save (output_file);
- if (timestamps)
+ if (timestamps) {
ShowTime ("Saved output");
-
- if (want_debugging_support) {
- CodeGen.SaveSymbols ();
- if (timestamps)
- ShowTime ("Saved symbols");
+ ShowTotalTime ("Total");
}
- if (Report.ExpectedError != 0){
- Console.WriteLine("Failed to report expected error " + Report.ExpectedError);
- Environment.Exit (1);
+ Timer.ShowTimers ();
+
+ if (Report.ExpectedError != 0) {
+ if (Report.Errors == 0) {
+ Console.WriteLine ("Failed to report expected error " + Report.ExpectedError + ".\n" +
+ "No other errors reported.");
+
+ Environment.Exit (2);
+ } else {
+ Console.WriteLine ("Failed to report expected error " + Report.ExpectedError + ".\n" +
+ "However, other errors were reported.");
+
+ Environment.Exit (1);
+ }
+
+
return false;
}
+#if DEBUGME
+ Console.WriteLine ("Size of strings held: " + DeclSpace.length);
+ Console.WriteLine ("Size of strings short: " + DeclSpace.small);
+#endif
return (Report.Errors == 0);
}
}
+
+ //
+ // This is the only public entry point
+ //
+ public class CompilerCallableEntryPoint : MarshalByRefObject {
+ static bool used = false;
+
+ public bool InvokeCompiler (string [] args)
+ {
+ if (used)
+ Reset ();
+ bool ok = Driver.MainDriver (args);
+ return ok && Report.Errors == 0;
+ }
+
+ public void Reset ()
+ {
+ }
+ }
}
diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs
index 335a7767550..e77457aef8e 100755
--- a/mcs/mcs/ecore.cs
+++ b/mcs/mcs/ecore.cs
@@ -4,7 +4,7 @@
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
-// (C) 2001 Ximian, Inc.
+// (C) 2001, 2002, 2003 Ximian, Inc.
//
//
@@ -36,6 +36,37 @@ namespace Mono.CSharp {
Nothing,
}
+ /// <remarks>
+ /// This is used to tell Resolve in which types of expressions we're
+ /// interested.
+ /// </remarks>
+ [Flags]
+ public enum ResolveFlags {
+ // Returns Value, Variable, PropertyAccess, EventAccess or IndexerAccess.
+ VariableOrValue = 1,
+
+ // Returns a type expression.
+ Type = 2,
+
+ // Returns a method group.
+ MethodGroup = 4,
+
+ // Allows SimpleNames to be returned.
+ // This is used by MemberAccess to construct long names that can not be
+ // partially resolved (namespace-qualified names for example).
+ SimpleName = 8,
+
+ // Mask of all the expression class flags.
+ MaskExprClass = 15,
+
+ // Disable control flow analysis while resolving the expression.
+ // This is used when resolving the instance expression of a field expression.
+ DisableFlowAnalysis = 16,
+
+ // Set if this is resolving the first part of a MemberAccess.
+ Intermediate = 32
+ }
+
//
// This is just as a hint to AddressOf of what will be done with the
// address.
@@ -64,12 +95,67 @@ namespace Mono.CSharp {
void AddressOf (EmitContext ec, AddressOp mode);
}
+ /// <summary>
+ /// This interface is implemented by variables
+ /// </summary>
+ public interface IVariable {
+ VariableInfo VariableInfo {
+ get;
+ }
+
+ bool VerifyFixed (bool is_expression);
+ }
+
+ /// <summary>
+ /// This interface denotes an expression which evaluates to a member
+ /// of a struct or a class.
+ /// </summary>
+ public interface IMemberExpr
+ {
+ /// <summary>
+ /// The name of this member.
+ /// </summary>
+ string Name {
+ get;
+ }
+
+ /// <summary>
+ /// Whether this is an instance member.
+ /// </summary>
+ bool IsInstance {
+ get;
+ }
+
+ /// <summary>
+ /// Whether this is a static member.
+ /// </summary>
+ bool IsStatic {
+ get;
+ }
+
+ /// <summary>
+ /// The type which declares this member.
+ /// </summary>
+ Type DeclaringType {
+ get;
+ }
+
+ /// <summary>
+ /// The instance expression associated with this member, if it's a
+ /// non-static member.
+ /// </summary>
+ Expression InstanceExpression {
+ get; set;
+ }
+ }
+
/// <remarks>
/// Base class for expressions
/// </remarks>
public abstract class Expression {
public ExprClass eclass;
- protected Type type;
+ protected Type type;
+ protected Location loc;
public Type Type {
get {
@@ -81,32 +167,41 @@ namespace Mono.CSharp {
}
}
+ public Location Location {
+ get {
+ return loc;
+ }
+ }
+
/// <summary>
/// Utility wrapper routine for Error, just to beautify the code
/// </summary>
- static protected void Error (int error, string s)
+ public void Error (int error, string s)
{
- Report.Error (error, s);
+ if (!Location.IsNull (loc))
+ Report.Error (error, loc, s);
+ else
+ Report.Error (error, s);
}
- static protected void Error (int error, Location loc, string s)
- {
- Report.Error (error, loc, s);
- }
-
/// <summary>
/// Utility wrapper routine for Warning, just to beautify the code
/// </summary>
- static protected void Warning (int warning, string s)
+ public void Warning (int code, string format, params object[] args)
{
- Report.Warning (warning, s);
+ Report.Warning (code, loc, format, args);
}
- static public void Error_CannotConvertType (Location loc, Type source, Type target)
+ /// <summary>
+ /// Tests presence of ObsoleteAttribute and report proper error
+ /// </summary>
+ protected void CheckObsoleteAttribute (Type type)
{
- Report.Error (30, loc, "Cannot convert type '" +
- TypeManager.CSharpName (source) + "' to '" +
- TypeManager.CSharpName (target) + "'");
+ ObsoleteAttribute obsolete_attr = AttributeTester.GetObsoleteAttribute (type);
+ if (obsolete_attr == null)
+ return;
+
+ AttributeTester.Report_ObsoleteMessage (obsolete_attr, type.FullName, loc);
}
/// <summary>
@@ -142,7 +237,42 @@ namespace Mono.CSharp {
{
return DoResolve (ec);
}
-
+
+ //
+ // This is used if the expression should be resolved as a type.
+ // the default implementation fails. Use this method in
+ // those participants in the SimpleName chain system.
+ //
+ public virtual Expression ResolveAsTypeStep (EmitContext ec)
+ {
+ return null;
+ }
+
+ //
+ // This is used to resolve the expression as a type, a null
+ // value will be returned if the expression is not a type
+ // reference
+ //
+ public TypeExpr ResolveAsTypeTerminal (EmitContext ec, bool silent)
+ {
+ int errors = Report.Errors;
+
+ TypeExpr te = ResolveAsTypeStep (ec) as TypeExpr;
+
+ if (te == null || te.eclass != ExprClass.Type) {
+ if (!silent && errors == Report.Errors)
+ Report.Error (246, Location, "Cannot find type '{0}'", ToString ());
+ return null;
+ }
+
+ if (!te.CheckAccessLevel (ec.DeclSpace)) {
+ Report.Error (122, Location, "'{0}' is inaccessible due to its protection level", te.Name);
+ return null;
+ }
+
+ return te;
+ }
+
/// <summary>
/// Resolves an expression and performs semantic analysis on it.
/// </summary>
@@ -151,72 +281,104 @@ namespace Mono.CSharp {
/// Currently Resolve wraps DoResolve to perform sanity
/// checking and assertion checking on what we expect from Resolve.
/// </remarks>
- public Expression Resolve (EmitContext ec)
+ public Expression Resolve (EmitContext ec, ResolveFlags flags)
{
- Expression e = DoResolve (ec);
+ if ((flags & ResolveFlags.MaskExprClass) == ResolveFlags.Type)
+ return ResolveAsTypeStep (ec);
- if (e != null){
+ bool old_do_flow_analysis = ec.DoFlowAnalysis;
+ if ((flags & ResolveFlags.DisableFlowAnalysis) != 0)
+ ec.DoFlowAnalysis = false;
- if (e is SimpleName){
- SimpleName s = (SimpleName) e;
+ Expression e;
+ bool intermediate = (flags & ResolveFlags.Intermediate) == ResolveFlags.Intermediate;
+ if (this is SimpleName)
+ e = ((SimpleName) this).DoResolveAllowStatic (ec, intermediate);
- Report.Error (
- 103, s.Location,
- "The name `" + s.Name + "' could not be found in `" +
- ec.DeclSpace.Name + "'");
+ else
+ e = DoResolve (ec);
+
+ ec.DoFlowAnalysis = old_do_flow_analysis;
+
+ if (e == null)
+ return null;
+
+ if (e is SimpleName){
+ SimpleName s = (SimpleName) e;
+
+ if ((flags & ResolveFlags.SimpleName) == 0) {
+ MemberLookupFailed (ec, null, ec.ContainerType, s.Name,
+ ec.DeclSpace.Name, loc);
return null;
}
-
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e.GetType () +
- " ExprClass is Invalid after resolve");
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception (
- "Expression " + e.GetType () +
- " did not set its type after Resolve\n" +
- "called from: " + this.GetType ());
+ return s;
}
- return e;
- }
+ if ((e is TypeExpr) || (e is ComposedCast)) {
+ if ((flags & ResolveFlags.Type) == 0) {
+ e.Error_UnexpectedKind (flags, loc);
+ return null;
+ }
- /// <summary>
- /// Performs expression resolution and semantic analysis, but
- /// allows SimpleNames to be returned.
- /// </summary>
- ///
- /// <remarks>
- /// This is used by MemberAccess to construct long names that can not be
- /// partially resolved (namespace-qualified names for example).
- /// </remarks>
- public Expression ResolveWithSimpleName (EmitContext ec)
- {
- Expression e;
+ return e;
+ }
- if (this is SimpleName)
- e = ((SimpleName) this).DoResolveAllowStatic (ec);
- else
- e = DoResolve (ec);
+ switch (e.eclass) {
+ case ExprClass.Type:
+ if ((flags & ResolveFlags.VariableOrValue) == 0) {
+ e.Error_UnexpectedKind (flags, loc);
+ return null;
+ }
+ break;
- if (e != null){
- if (e is SimpleName)
- return e;
+ case ExprClass.MethodGroup:
+ if (RootContext.Version == LanguageVersion.ISO_1){
+ if ((flags & ResolveFlags.MethodGroup) == 0) {
+ ((MethodGroupExpr) e).ReportUsageError ();
+ return null;
+ }
+ }
+ break;
- if (e.eclass == ExprClass.Invalid)
- throw new Exception ("Expression " + e +
- " ExprClass is Invalid after resolve");
+ case ExprClass.Value:
+ case ExprClass.Variable:
+ case ExprClass.PropertyAccess:
+ case ExprClass.EventAccess:
+ case ExprClass.IndexerAccess:
+ if ((flags & ResolveFlags.VariableOrValue) == 0) {
+ Console.WriteLine ("I got: {0} and {1}", e.GetType (), e);
+ Console.WriteLine ("I am {0} and {1}", this.GetType (), this);
+ FieldInfo fi = ((FieldExpr) e).FieldInfo;
+
+ Console.WriteLine ("{0} and {1}", fi.DeclaringType, fi.Name);
+ e.Error_UnexpectedKind (flags, loc);
+ return null;
+ }
+ break;
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception ("Expression " + e +
- " did not set its type after Resolve");
+ default:
+ throw new Exception ("Expression " + e.GetType () +
+ " ExprClass is Invalid after resolve");
}
+ if (e.type == null)
+ throw new Exception (
+ "Expression " + e.GetType () +
+ " did not set its type after Resolve\n" +
+ "called from: " + this.GetType ());
+
return e;
}
-
+
+ /// <summary>
+ /// Resolves an expression and performs semantic analysis on it.
+ /// </summary>
+ public Expression Resolve (EmitContext ec)
+ {
+ return Resolve (ec, ResolveFlags.VariableOrValue);
+ }
+
/// <summary>
/// Resolves an expression for LValue assignment
/// </summary>
@@ -232,11 +394,8 @@ namespace Mono.CSharp {
if (e != null){
if (e is SimpleName){
SimpleName s = (SimpleName) e;
-
- Report.Error (
- 103, s.Location,
- "The name `" + s.Name + "' could not be found in `" +
- ec.DeclSpace.Name + "'");
+ MemberLookupFailed (ec, null, ec.ContainerType, s.Name,
+ ec.DeclSpace.Name, loc);
return null;
}
@@ -244,10 +403,14 @@ namespace Mono.CSharp {
throw new Exception ("Expression " + e +
" ExprClass is Invalid after resolve");
- if (e.eclass != ExprClass.MethodGroup)
- if (e.type == null)
- throw new Exception ("Expression " + e +
- " did not set its type after Resolve");
+ if (e.eclass == ExprClass.MethodGroup) {
+ ((MethodGroupExpr) e).ReportUsageError ();
+ return null;
+ }
+
+ if (e.type == null)
+ throw new Exception ("Expression " + e +
+ " did not set its type after Resolve");
}
return e;
@@ -263,6 +426,12 @@ namespace Mono.CSharp {
/// </remarks>
public abstract void Emit (EmitContext ec);
+ public virtual void EmitBranchable (EmitContext ec, Label target, bool onTrue)
+ {
+ Emit (ec);
+ ec.ig.Emit (onTrue ? OpCodes.Brtrue : OpCodes.Brfalse, target);
+ }
+
/// <summary>
/// Protected constructor. Only derivate types should
/// be able to be created
@@ -316,10 +485,16 @@ namespace Mono.CSharp {
else if (t == TypeManager.bool_type)
return new BoolConstant ((bool) v);
else if (TypeManager.IsEnumType (t)){
- Constant e = Constantify (v, TypeManager.TypeToCoreType (v.GetType ()));
+ Type real_type = TypeManager.TypeToCoreType (v.GetType ());
+ if (real_type == t)
+ real_type = System.Enum.GetUnderlyingType (real_type);
+
+ Constant e = Constantify (v, real_type);
return new EnumConstant (e, t);
- } else
+ } else if (v == null && !TypeManager.IsValueType (t))
+ return NullLiteral.Null;
+ else
throw new Exception ("Unknown type for constant (" + t +
"), details: " + v);
}
@@ -334,14 +509,17 @@ namespace Mono.CSharp {
else if (mi is FieldInfo)
return new FieldExpr ((FieldInfo) mi, loc);
else if (mi is PropertyInfo)
- return new PropertyExpr ((PropertyInfo) mi, loc);
+ return new PropertyExpr (ec, (PropertyInfo) mi, loc);
else if (mi is Type){
- return new TypeExpr ((System.Type) mi);
+ return new TypeExpression ((System.Type) mi, loc);
}
return null;
}
+
+ private static ArrayList almostMatchedMembers = new ArrayList (4);
+
//
// FIXME: Probably implement a cache for (t,name,current_access_set)?
//
@@ -370,22 +548,38 @@ namespace Mono.CSharp {
// FIXME: Potential optimization, have a static ArrayList
//
- public static Expression MemberLookup (EmitContext ec, Type t, string name,
+ public static Expression MemberLookup (EmitContext ec, Type queried_type, string name,
MemberTypes mt, BindingFlags bf, Location loc)
{
- MemberInfo [] mi = TypeManager.MemberLookup (ec.ContainerType, t, mt, bf, name);
+ return MemberLookup (ec, ec.ContainerType, null, queried_type, name, mt, bf, loc);
+ }
+
+ //
+ // Lookup type `queried_type' for code in class `container_type' with a qualifier of
+ // `qualifier_type' or null to lookup members in the current class.
+ //
+
+ public static Expression MemberLookup (EmitContext ec, Type container_type,
+ Type qualifier_type, Type queried_type,
+ string name, MemberTypes mt,
+ BindingFlags bf, Location loc)
+ {
+ almostMatchedMembers.Clear ();
+
+ MemberInfo [] mi = TypeManager.MemberLookup (container_type, qualifier_type,
+ queried_type, mt, bf, name, almostMatchedMembers);
if (mi == null)
return null;
int count = mi.Length;
- if (count > 1)
- return new MethodGroupExpr (mi, loc);
-
if (mi [0] is MethodBase)
return new MethodGroupExpr (mi, loc);
+ if (count > 1)
+ return null;
+
return ExprClassFromMemberInfo (ec, mi [0], loc);
}
@@ -402,14 +596,25 @@ namespace Mono.CSharp {
BindingFlags.Static |
BindingFlags.Instance;
- public static Expression MemberLookup (EmitContext ec, Type t, string name, Location loc)
+ public static Expression MemberLookup (EmitContext ec, Type queried_type,
+ string name, Location loc)
{
- return MemberLookup (ec, t, name, AllMemberTypes, AllBindingFlags, loc);
+ return MemberLookup (ec, ec.ContainerType, null, queried_type, name,
+ AllMemberTypes, AllBindingFlags, loc);
}
- public static Expression MethodLookup (EmitContext ec, Type t, string name, Location loc)
+ public static Expression MemberLookup (EmitContext ec, Type qualifier_type,
+ Type queried_type, string name, Location loc)
{
- return MemberLookup (ec, t, name, MemberTypes.Method, AllBindingFlags, loc);
+ return MemberLookup (ec, ec.ContainerType, qualifier_type, queried_type,
+ name, AllMemberTypes, AllBindingFlags, loc);
+ }
+
+ public static Expression MethodLookup (EmitContext ec, Type queried_type,
+ string name, Location loc)
+ {
+ return MemberLookup (ec, ec.ContainerType, null, queried_type, name,
+ MemberTypes.Method, AllBindingFlags, loc);
}
/// <summary>
@@ -418,1690 +623,164 @@ namespace Mono.CSharp {
/// look for private members and display a useful debugging message if we
/// find it.
/// </summary>
- public static Expression MemberLookupFinal (EmitContext ec, Type t, string name,
- Location loc)
+ public static Expression MemberLookupFinal (EmitContext ec, Type qualifier_type,
+ Type queried_type, string name, Location loc)
{
- return MemberLookupFinal (ec, t, name, MemberTypes.Method, AllBindingFlags, loc);
+ return MemberLookupFinal (ec, qualifier_type, queried_type, name,
+ AllMemberTypes, AllBindingFlags, loc);
}
- public static Expression MemberLookupFinal (EmitContext ec, Type t, string name,
- MemberTypes mt, BindingFlags bf, Location loc)
+ public static Expression MemberLookupFinal (EmitContext ec, Type qualifier_type,
+ Type queried_type, string name,
+ MemberTypes mt, BindingFlags bf,
+ Location loc)
{
Expression e;
- e = MemberLookup (ec, t, name, mt, bf, loc);
+ int errors = Report.Errors;
- if (e != null)
- return e;
-
- e = MemberLookup (ec, t, name, AllMemberTypes,
- AllBindingFlags | BindingFlags.NonPublic, loc);
- if (e == null){
- Report.Error (
- 117, loc, "`" + t + "' does not contain a definition " +
- "for `" + name + "'");
- } else {
- Report.Error (
- 122, loc, "`" + t + "." + name +
- "' is inaccessible due to its protection level");
- }
-
- return null;
- }
-
- static EmptyExpression MyEmptyExpr;
- static public Expression ImplicitReferenceConversion (Expression expr, Type target_type)
- {
- Type expr_type = expr.Type;
+ e = MemberLookup (ec, ec.ContainerType, qualifier_type, queried_type, name, mt, bf, loc);
- if (expr_type == null && expr.eclass == ExprClass.MethodGroup){
- // if we are a method group, emit a warning
+ if (e == null && errors == Report.Errors)
+ // No errors were reported by MemberLookup, but there was an error.
+ MemberLookupFailed (ec, qualifier_type, queried_type, name, null, loc);
- expr.Emit (null);
- }
-
- if (target_type == TypeManager.object_type) {
- //
- // A pointer type cannot be converted to object
- //
- if (expr_type.IsPointer)
- return null;
-
- if (expr_type.IsValueType)
- return new BoxedCast (expr);
- if (expr_type.IsClass || expr_type.IsInterface)
- return new EmptyCast (expr, target_type);
- } else if (expr_type.IsSubclassOf (target_type)) {
- return new EmptyCast (expr, target_type);
- } else {
-
- // This code is kind of mirrored inside StandardConversionExists
- // with the small distinction that we only probe there
- //
- // Always ensure that the code here and there is in sync
-
- // from the null type to any reference-type.
- if (expr is NullLiteral && !target_type.IsValueType)
- return new EmptyCast (expr, target_type);
-
- // from any class-type S to any interface-type T.
- if (expr_type.IsClass && target_type.IsInterface) {
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return new EmptyCast (expr, target_type);
- else
- return null;
- }
-
- // from any interface type S to interface-type T.
- if (expr_type.IsInterface && target_type.IsInterface) {
-
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return new EmptyCast (expr, target_type);
- else
- return null;
- }
-
- // from an array-type S to an array-type of type T
- if (expr_type.IsArray && target_type.IsArray) {
- if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type expr_element_type = expr_type.GetElementType ();
-
- if (MyEmptyExpr == null)
- MyEmptyExpr = new EmptyExpression ();
-
- MyEmptyExpr.SetType (expr_element_type);
- Type target_element_type = target_type.GetElementType ();
-
- if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
- if (StandardConversionExists (MyEmptyExpr,
- target_element_type))
- return new EmptyCast (expr, target_type);
- }
- }
-
-
- // from an array-type to System.Array
- if (expr_type.IsArray && target_type == TypeManager.array_type)
- return new EmptyCast (expr, target_type);
-
- // from any delegate type to System.Delegate
- if (expr_type.IsSubclassOf (TypeManager.delegate_type) &&
- target_type == TypeManager.delegate_type)
- return new EmptyCast (expr, target_type);
-
- // from any array-type or delegate type into System.ICloneable.
- if (expr_type.IsArray || expr_type.IsSubclassOf (TypeManager.delegate_type))
- if (target_type == TypeManager.icloneable_type)
- return new EmptyCast (expr, target_type);
-
- return null;
-
- }
-
- return null;
- }
-
- /// <summary>
- /// Handles expressions like this: decimal d; d = 1;
- /// and changes them into: decimal d; d = new System.Decimal (1);
- /// </summary>
- static Expression InternalTypeConstructor (EmitContext ec, Expression expr, Type target)
- {
- ArrayList args = new ArrayList ();
-
- args.Add (new Argument (expr, Argument.AType.Expression));
-
- Expression ne = new New (target.FullName, args,
- new Location (-1));
-
- return ne.Resolve (ec);
- }
-
- /// <summary>
- /// Implicit Numeric Conversions.
- ///
- /// expr is the expression to convert, returns a new expression of type
- /// target_type or null if an implicit conversion is not possible.
- /// </summary>
- static public Expression ImplicitNumericConversion (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
-
- //
- // Attempt to do the implicit constant expression conversions
-
- if (expr is IntConstant){
- Expression e;
-
- e = TryImplicitIntConversion (target_type, (IntConstant) expr);
-
- if (e != null)
- return e;
- } else if (expr is LongConstant && target_type == TypeManager.uint64_type){
- //
- // Try the implicit constant expression conversion
- // from long to ulong, instead of a nice routine,
- // we just inline it
- //
- long v = ((LongConstant) expr).Value;
- if (v > 0)
- return new ULongConstant ((ulong) v);
- }
-
- //
- // If we have an enumeration, extract the underlying type,
- // use this during the comparission, but wrap around the original
- // target_type
- //
- Type real_target_type = target_type;
-
- if (TypeManager.IsEnumType (real_target_type))
- real_target_type = TypeManager.EnumToUnderlying (real_target_type);
-
- if (expr_type == real_target_type)
- return new EmptyCast (expr, target_type);
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to short, int, long, float, double.
- //
- if (real_target_type == TypeManager.int32_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.short_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I2);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to short, ushort, int, uint, long, ulong, float, double
- //
- if ((real_target_type == TypeManager.short_type) ||
- (real_target_type == TypeManager.ushort_type) ||
- (real_target_type == TypeManager.int32_type) ||
- (real_target_type == TypeManager.uint32_type))
- return new EmptyCast (expr, target_type);
-
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to int, long, float, double
- //
- if (real_target_type == TypeManager.int32_type)
- return new EmptyCast (expr, target_type);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to int, uint, long, ulong, float, double
- //
- if (real_target_type == TypeManager.uint32_type)
- return new EmptyCast (expr, target_type);
-
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int32_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I4);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to long, float, double
- //
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to long, ulong, float, double
- //
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if ((expr_type == TypeManager.uint64_type) ||
- (expr_type == TypeManager.int64_type)){
- //
- // From long/ulong to float, double
- //
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R_Un,
- OpCodes.Conv_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to ushort, int, uint, long, ulong, float, double
- //
- if ((real_target_type == TypeManager.ushort_type) ||
- (real_target_type == TypeManager.int32_type) ||
- (real_target_type == TypeManager.uint32_type))
- return new EmptyCast (expr, target_type);
- if (real_target_type == TypeManager.uint64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U8);
- if (real_target_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_I8);
- if (real_target_type == TypeManager.float_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.float_type){
- //
- // float to double
- //
- if (real_target_type == TypeManager.double_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
- }
-
- return null;
- }
-
- //
- // Tests whether an implicit reference conversion exists between expr_type
- // and target_type
- //
- public static bool ImplicitReferenceConversionExists (Expression expr, Type target_type)
- {
- Type expr_type = expr.Type;
-
- //
- // This is the boxed case.
- //
- if (target_type == TypeManager.object_type) {
- if ((expr_type.IsClass) ||
- (expr_type.IsValueType) ||
- (expr_type.IsInterface))
- return true;
-
- } else if (expr_type.IsSubclassOf (target_type)) {
- return true;
-
- } else {
- // Please remember that all code below actually comes
- // from ImplicitReferenceConversion so make sure code remains in sync
-
- // from any class-type S to any interface-type T.
- if (expr_type.IsClass && target_type.IsInterface) {
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return true;
- }
-
- // from any interface type S to interface-type T.
- if (expr_type.IsInterface && target_type.IsInterface)
- if (TypeManager.ImplementsInterface (expr_type, target_type))
- return true;
-
- // from an array-type S to an array-type of type T
- if (expr_type.IsArray && target_type.IsArray) {
- if (expr_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type expr_element_type = expr_type.GetElementType ();
-
- if (MyEmptyExpr == null)
- MyEmptyExpr = new EmptyExpression ();
-
- MyEmptyExpr.SetType (expr_element_type);
- Type target_element_type = target_type.GetElementType ();
-
- if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
- if (StandardConversionExists (MyEmptyExpr,
- target_element_type))
- return true;
- }
- }
-
- // from an array-type to System.Array
- if (expr_type.IsArray && target_type.IsAssignableFrom (expr_type))
- return true;
-
- // from any delegate type to System.Delegate
- if (expr_type.IsSubclassOf (TypeManager.delegate_type) &&
- target_type == TypeManager.delegate_type)
- if (target_type.IsAssignableFrom (expr_type))
- return true;
-
- // from any array-type or delegate type into System.ICloneable.
- if (expr_type.IsArray || expr_type.IsSubclassOf (TypeManager.delegate_type))
- if (target_type == TypeManager.icloneable_type)
- return true;
-
- // from the null type to any reference-type.
- if (expr is NullLiteral && !target_type.IsValueType)
- return true;
-
- }
-
- return false;
- }
-
- /// <summary>
- /// Same as StandardConversionExists except that it also looks at
- /// implicit user defined conversions - needed for overload resolution
- /// </summary>
- public static bool ImplicitConversionExists (EmitContext ec, Expression expr, Type target_type)
- {
- if (StandardConversionExists (expr, target_type) == true)
- return true;
-
- Expression dummy = ImplicitUserConversion (ec, expr, target_type, Location.Null);
-
- if (dummy != null)
- return true;
-
- return false;
- }
-
- /// <summary>
- /// Determines if a standard implicit conversion exists from
- /// expr_type to target_type
- /// </summary>
- public static bool StandardConversionExists (Expression expr, Type target_type)
- {
- Type expr_type = expr.Type;
-
- if (expr_type == target_type)
- return true;
-
- // First numeric conversions
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to short, int, long, float, double.
- //
- if ((target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.short_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to short, ushort, int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.short_type) ||
- (target_type == TypeManager.ushort_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to int, long, float, double
- //
- if ((target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to long, float, double
- //
- if ((target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to long, ulong, float, double
- //
- if ((target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if ((expr_type == TypeManager.uint64_type) ||
- (expr_type == TypeManager.int64_type)) {
- //
- // From long/ulong to float, double
- //
- if ((target_type == TypeManager.double_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to ushort, int, uint, long, ulong, float, double
- //
- if ((target_type == TypeManager.ushort_type) ||
- (target_type == TypeManager.int32_type) ||
- (target_type == TypeManager.uint32_type) ||
- (target_type == TypeManager.uint64_type) ||
- (target_type == TypeManager.int64_type) ||
- (target_type == TypeManager.float_type) ||
- (target_type == TypeManager.double_type) ||
- (target_type == TypeManager.decimal_type))
- return true;
-
- } else if (expr_type == TypeManager.float_type){
- //
- // float to double
- //
- if (target_type == TypeManager.double_type)
- return true;
- }
-
- if (ImplicitReferenceConversionExists (expr, target_type))
- return true;
-
- if (expr is IntConstant){
- int value = ((IntConstant) expr).Value;
-
- if (target_type == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return true;
- } else if (target_type == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return true;
- } else if (target_type == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return true;
- } else if (target_type == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return true;
- } else if (target_type == TypeManager.uint32_type){
- if (value >= 0)
- return true;
- } else if (target_type == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64. But we need an opcode
- // to do it.
- //
- if (value >= 0)
- return true;
- }
-
- if (value == 0 && expr is IntLiteral && TypeManager.IsEnumType (target_type))
- return true;
- }
-
- if (expr is LongConstant && target_type == TypeManager.uint64_type){
- //
- // Try the implicit constant expression conversion
- // from long to ulong, instead of a nice routine,
- // we just inline it
- //
- long v = ((LongConstant) expr).Value;
- if (v > 0)
- return true;
- }
-
- if (target_type.IsSubclassOf (TypeManager.enum_type) && expr is IntLiteral){
- IntLiteral i = (IntLiteral) expr;
-
- if (i.Value == 0)
- return true;
- }
- return false;
+ return e;
}
- //
- // Used internally by FindMostEncompassedType, this is used
- // to avoid creating lots of objects in the tight loop inside
- // FindMostEncompassedType
- //
- static EmptyExpression priv_fmet_param;
-
- /// <summary>
- /// Finds "most encompassed type" according to the spec (13.4.2)
- /// amongst the methods in the MethodGroupExpr
- /// </summary>
- static Type FindMostEncompassedType (ArrayList types)
+ public static void MemberLookupFailed (EmitContext ec, Type qualifier_type,
+ Type queried_type, string name,
+ string class_name, Location loc)
{
- Type best = null;
-
- if (priv_fmet_param == null)
- priv_fmet_param = new EmptyExpression ();
-
- foreach (Type t in types){
- priv_fmet_param.SetType (t);
-
- if (best == null) {
- best = t;
- continue;
+ if (almostMatchedMembers.Count != 0) {
+ if (qualifier_type == null) {
+ foreach (MemberInfo m in almostMatchedMembers)
+ Report.Error (38, loc,
+ "Cannot access non-static member `{0}' via nested type `{1}'",
+ TypeManager.GetFullNameSignature (m),
+ TypeManager.CSharpName (ec.ContainerType));
+ return;
}
-
- if (StandardConversionExists (priv_fmet_param, best))
- best = t;
- }
-
- return best;
- }
-
- //
- // Used internally by FindMostEncompassingType, this is used
- // to avoid creating lots of objects in the tight loop inside
- // FindMostEncompassingType
- //
- static EmptyExpression priv_fmee_ret;
-
- /// <summary>
- /// Finds "most encompassing type" according to the spec (13.4.2)
- /// amongst the types in the given set
- /// </summary>
- static Type FindMostEncompassingType (ArrayList types)
- {
- Type best = null;
-
- if (priv_fmee_ret == null)
- priv_fmee_ret = new EmptyExpression ();
- foreach (Type t in types){
- priv_fmee_ret.SetType (best);
-
- if (best == null) {
- best = t;
- continue;
+ if (qualifier_type != ec.ContainerType) {
+ // Although a derived class can access protected members of
+ // its base class it cannot do so through an instance of the
+ // base class (CS1540). If the qualifier_type is a parent of the
+ // ec.ContainerType and the lookup succeeds with the latter one,
+ // then we are in this situation.
+ foreach (MemberInfo m in almostMatchedMembers)
+ Report.Error (1540, loc,
+ "Cannot access protected member `{0}' via a qualifier of type `{1}';"
+ + " the qualifier must be of type `{2}' (or derived from it)",
+ TypeManager.GetFullNameSignature (m),
+ TypeManager.CSharpName (qualifier_type),
+ TypeManager.CSharpName (ec.ContainerType));
+ return;
}
-
- if (StandardConversionExists (priv_fmee_ret, t))
- best = t;
+ almostMatchedMembers.Clear ();
}
-
- return best;
- }
-
- //
- // Used to avoid creating too many objects
- //
- static EmptyExpression priv_fms_expr;
-
- /// <summary>
- /// Finds the most specific source Sx according to the rules of the spec (13.4.4)
- /// by making use of FindMostEncomp* methods. Applies the correct rules separately
- /// for explicit and implicit conversion operators.
- /// </summary>
- static public Type FindMostSpecificSource (MethodGroupExpr me, Type source_type,
- bool apply_explicit_conv_rules,
- Location loc)
- {
- ArrayList src_types_set = new ArrayList ();
-
- if (priv_fms_expr == null)
- priv_fms_expr = new EmptyExpression ();
-
- //
- // If any operator converts from S then Sx = S
- //
- foreach (MethodBase mb in me.Methods){
- ParameterData pd = Invocation.GetParameterData (mb);
- Type param_type = pd.ParameterType (0);
- if (param_type == source_type)
- return param_type;
+ object lookup = TypeManager.MemberLookup (queried_type, null, queried_type,
+ AllMemberTypes, AllBindingFlags |
+ BindingFlags.NonPublic, name, null);
- if (apply_explicit_conv_rules) {
- //
- // From the spec :
- // Find the set of applicable user-defined conversion operators, U. This set
- // consists of the
- // user-defined implicit or explicit conversion operators declared by
- // the classes or structs in D that convert from a type encompassing
- // or encompassed by S to a type encompassing or encompassed by T
- //
- priv_fms_expr.SetType (param_type);
- if (StandardConversionExists (priv_fms_expr, source_type))
- src_types_set.Add (param_type);
- else {
- priv_fms_expr.SetType (source_type);
- if (StandardConversionExists (priv_fms_expr, param_type))
- src_types_set.Add (param_type);
- }
- } else {
- //
- // Only if S is encompassed by param_type
- //
- priv_fms_expr.SetType (source_type);
- if (StandardConversionExists (priv_fms_expr, param_type))
- src_types_set.Add (param_type);
- }
+ if (lookup == null) {
+ if (class_name != null)
+ Report.Error (103, loc, "The name `" + name + "' could not be " +
+ "found in `" + class_name + "'");
+ else
+ Report.Error (
+ 117, loc, "`" + queried_type + "' does not contain a " +
+ "definition for `" + name + "'");
+ return;
}
-
- //
- // Explicit Conv rules
- //
- if (apply_explicit_conv_rules) {
- ArrayList candidate_set = new ArrayList ();
-
- foreach (Type param_type in src_types_set){
- priv_fms_expr.SetType (source_type);
-
- if (StandardConversionExists (priv_fms_expr, param_type))
- candidate_set.Add (param_type);
- }
- if (candidate_set.Count != 0)
- return FindMostEncompassedType (candidate_set);
+ if (qualifier_type != null)
+ Report.Error (122, loc, "'{0}' is inaccessible due to its protection level", TypeManager.CSharpName (qualifier_type) + "." + name);
+ else if (name == ".ctor") {
+ Report.Error (143, loc, String.Format ("The type {0} has no constructors defined",
+ TypeManager.CSharpName (queried_type)));
+ } else {
+ Report.Error (122, loc, "'{0}' is inaccessible due to its protection level", name);
}
-
- //
- // Final case
- //
- if (apply_explicit_conv_rules)
- return FindMostEncompassingType (src_types_set);
- else
- return FindMostEncompassedType (src_types_set);
}
- //
- // Useful in avoiding proliferation of objects
- //
- static EmptyExpression priv_fmt_expr;
-
- /// <summary>
- /// Finds the most specific target Tx according to section 13.4.4
- /// </summary>
- static public Type FindMostSpecificTarget (MethodGroupExpr me, Type target,
- bool apply_explicit_conv_rules,
- Location loc)
+ static public MemberInfo GetFieldFromEvent (EventExpr event_expr)
{
- ArrayList tgt_types_set = new ArrayList ();
-
- if (priv_fmt_expr == null)
- priv_fmt_expr = new EmptyExpression ();
-
- //
- // If any operator converts to T then Tx = T
- //
- foreach (MethodInfo mi in me.Methods){
- Type ret_type = mi.ReturnType;
-
- if (ret_type == target)
- return ret_type;
-
- if (apply_explicit_conv_rules) {
- //
- // From the spec :
- // Find the set of applicable user-defined conversion operators, U.
- //
- // This set consists of the
- // user-defined implicit or explicit conversion operators declared by
- // the classes or structs in D that convert from a type encompassing
- // or encompassed by S to a type encompassing or encompassed by T
- //
- priv_fms_expr.SetType (ret_type);
- if (StandardConversionExists (priv_fms_expr, target))
- tgt_types_set.Add (ret_type);
- else {
- priv_fms_expr.SetType (target);
- if (StandardConversionExists (priv_fms_expr, ret_type))
- tgt_types_set.Add (ret_type);
- }
- } else {
- //
- // Only if T is encompassed by param_type
- //
- priv_fms_expr.SetType (ret_type);
- if (StandardConversionExists (priv_fms_expr, target))
- tgt_types_set.Add (ret_type);
- }
- }
+ EventInfo ei = event_expr.EventInfo;
- //
- // Explicit conv rules
- //
- if (apply_explicit_conv_rules) {
- ArrayList candidate_set = new ArrayList ();
-
- foreach (Type ret_type in tgt_types_set){
- priv_fmt_expr.SetType (ret_type);
-
- if (StandardConversionExists (priv_fmt_expr, target))
- candidate_set.Add (ret_type);
- }
-
- if (candidate_set.Count != 0)
- return FindMostEncompassingType (candidate_set);
- }
-
- //
- // Okay, final case !
- //
- if (apply_explicit_conv_rules)
- return FindMostEncompassedType (tgt_types_set);
- else
- return FindMostEncompassingType (tgt_types_set);
+ return TypeManager.GetPrivateFieldOfEvent (ei);
}
/// <summary>
- /// User-defined Implicit conversions
+ /// Returns an expression that can be used to invoke operator true
+ /// on the expression if it exists.
/// </summary>
- static public Expression ImplicitUserConversion (EmitContext ec, Expression source,
- Type target, Location loc)
+ static public StaticCallExpr GetOperatorTrue (EmitContext ec, Expression e, Location loc)
{
- return UserDefinedConversion (ec, source, target, loc, false);
+ return GetOperatorTrueOrFalse (ec, e, true, loc);
}
/// <summary>
- /// User-defined Explicit conversions
+ /// Returns an expression that can be used to invoke operator false
+ /// on the expression if it exists.
/// </summary>
- static public Expression ExplicitUserConversion (EmitContext ec, Expression source,
- Type target, Location loc)
+ static public StaticCallExpr GetOperatorFalse (EmitContext ec, Expression e, Location loc)
{
- return UserDefinedConversion (ec, source, target, loc, true);
+ return GetOperatorTrueOrFalse (ec, e, false, loc);
}
- /// <summary>
- /// Computes the MethodGroup for the user-defined conversion
- /// operators from source_type to target_type. `look_for_explicit'
- /// controls whether we should also include the list of explicit
- /// operators
- /// </summary>
- static MethodGroupExpr GetConversionOperators (EmitContext ec,
- Type source_type, Type target_type,
- Location loc, bool look_for_explicit)
+ static StaticCallExpr GetOperatorTrueOrFalse (EmitContext ec, Expression e, bool is_true, Location loc)
{
- Expression mg1 = null, mg2 = null;
- Expression mg5 = null, mg6 = null, mg7 = null, mg8 = null;
- string op_name;
-
- //
- // FIXME : How does the False operator come into the picture ?
- // This doesn't look complete and very correct !
- //
- if (target_type == TypeManager.bool_type && !look_for_explicit)
- op_name = "op_True";
- else
- op_name = "op_Implicit";
-
- MethodGroupExpr union3;
-
- mg1 = MethodLookup (ec, source_type, op_name, loc);
- if (source_type.BaseType != null)
- mg2 = MethodLookup (ec, source_type.BaseType, op_name, loc);
-
- if (mg1 == null)
- union3 = (MethodGroupExpr) mg2;
- else if (mg2 == null)
- union3 = (MethodGroupExpr) mg1;
- else
- union3 = Invocation.MakeUnionSet (mg1, mg2, loc);
-
- mg1 = MethodLookup (ec, target_type, op_name, loc);
- if (mg1 != null){
- if (union3 != null)
- union3 = Invocation.MakeUnionSet (union3, mg1, loc);
- else
- union3 = (MethodGroupExpr) mg1;
- }
-
- if (target_type.BaseType != null)
- mg1 = MethodLookup (ec, target_type.BaseType, op_name, loc);
-
- if (mg1 != null){
- if (union3 != null)
- union3 = Invocation.MakeUnionSet (union3, mg1, loc);
- else
- union3 = (MethodGroupExpr) mg1;
- }
+ MethodBase method;
+ Expression operator_group;
- MethodGroupExpr union4 = null;
-
- if (look_for_explicit) {
- op_name = "op_Explicit";
-
- mg5 = MemberLookup (ec, source_type, op_name, loc);
- if (source_type.BaseType != null)
- mg6 = MethodLookup (ec, source_type.BaseType, op_name, loc);
-
- mg7 = MemberLookup (ec, target_type, op_name, loc);
- if (target_type.BaseType != null)
- mg8 = MethodLookup (ec, target_type.BaseType, op_name, loc);
-
- MethodGroupExpr union5 = Invocation.MakeUnionSet (mg5, mg6, loc);
- MethodGroupExpr union6 = Invocation.MakeUnionSet (mg7, mg8, loc);
-
- union4 = Invocation.MakeUnionSet (union5, union6, loc);
- }
-
- return Invocation.MakeUnionSet (union3, union4, loc);
- }
-
- /// <summary>
- /// User-defined conversions
- /// </summary>
- static public Expression UserDefinedConversion (EmitContext ec, Expression source,
- Type target, Location loc,
- bool look_for_explicit)
- {
- MethodGroupExpr union;
- Type source_type = source.Type;
- MethodBase method = null;
-
- union = GetConversionOperators (ec, source_type, target, loc, look_for_explicit);
- if (union == null)
+ operator_group = MethodLookup (ec, e.Type, is_true ? "op_True" : "op_False", loc);
+ if (operator_group == null)
return null;
-
- Type most_specific_source, most_specific_target;
-#if BLAH
- foreach (MethodBase m in union.Methods){
- Console.WriteLine ("Name: " + m.Name);
- Console.WriteLine (" : " + ((MethodInfo)m).ReturnType);
- }
-#endif
-
- most_specific_source = FindMostSpecificSource (union, source_type, look_for_explicit, loc);
- if (most_specific_source == null)
- return null;
-
- most_specific_target = FindMostSpecificTarget (union, target, look_for_explicit, loc);
- if (most_specific_target == null)
- return null;
-
- int count = 0;
-
- foreach (MethodBase mb in union.Methods){
- ParameterData pd = Invocation.GetParameterData (mb);
- MethodInfo mi = (MethodInfo) mb;
-
- if (pd.ParameterType (0) == most_specific_source &&
- mi.ReturnType == most_specific_target) {
- method = mb;
- count++;
- }
- }
-
- if (method == null || count > 1) {
- Report.Error (-11, loc, "Ambiguous user defined conversion");
- return null;
- }
-
- //
- // This will do the conversion to the best match that we
- // found. Now we need to perform an implict standard conversion
- // if the best match was not the type that we were requested
- // by target.
- //
- if (look_for_explicit)
- source = ConvertExplicitStandard (ec, source, most_specific_source, loc);
- else
- source = ConvertImplicitStandard (ec, source, most_specific_source, loc);
+ ArrayList arguments = new ArrayList ();
+ arguments.Add (new Argument (e, Argument.AType.Expression));
+ method = Invocation.OverloadResolve (
+ ec, (MethodGroupExpr) operator_group, arguments, false, loc);
- if (source == null)
+ if (method == null)
return null;
- Expression e;
- e = new UserCast ((MethodInfo) method, source);
- if (e.Type != target){
- if (!look_for_explicit)
- e = ConvertImplicitStandard (ec, e, target, loc);
- else
- e = ConvertExplicitStandard (ec, e, target, loc);
- }
- return e;
- }
-
- /// <summary>
- /// Converts implicitly the resolved expression `expr' into the
- /// `target_type'. It returns a new expression that can be used
- /// in a context that expects a `target_type'.
- /// </summary>
- static public Expression ConvertImplicit (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression e;
-
- if (expr_type == target_type)
- return expr;
-
- if (target_type == null)
- throw new Exception ("Target type is null");
-
- e = ConvertImplicitStandard (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- e = ImplicitUserConversion (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- return null;
- }
-
-
- /// <summary>
- /// Attempts to apply the `Standard Implicit
- /// Conversion' rules to the expression `expr' into
- /// the `target_type'. It returns a new expression
- /// that can be used in a context that expects a
- /// `target_type'.
- ///
- /// This is different from `ConvertImplicit' in that the
- /// user defined implicit conversions are excluded.
- /// </summary>
- static public Expression ConvertImplicitStandard (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression e;
-
- if (expr_type == target_type)
- return expr;
-
- e = ImplicitNumericConversion (ec, expr, target_type, loc);
- if (e != null)
- return e;
-
- e = ImplicitReferenceConversion (expr, target_type);
- if (e != null)
- return e;
-
- if (target_type.IsSubclassOf (TypeManager.enum_type) && expr is IntLiteral){
- IntLiteral i = (IntLiteral) expr;
-
- if (i.Value == 0)
- return new EmptyCast (expr, target_type);
- }
-
- if (ec.InUnsafe) {
- if (expr_type.IsPointer){
- if (target_type == TypeManager.void_ptr_type)
- return new EmptyCast (expr, target_type);
-
- //
- // yep, comparing pointer types cant be done with
- // t1 == t2, we have to compare their element types.
- //
- if (target_type.IsPointer){
- if (target_type.GetElementType()==expr_type.GetElementType())
- return expr;
- }
- }
-
- if (target_type.IsPointer){
- if (expr is NullLiteral)
- return new EmptyCast (expr, target_type);
- }
- }
-
- return null;
- }
-
- /// <summary>
- /// Attemps to perform an implict constant conversion of the IntConstant
- /// into a different data type using casts (See Implicit Constant
- /// Expression Conversions)
- /// </summary>
- static protected Expression TryImplicitIntConversion (Type target_type, IntConstant ic)
- {
- int value = ic.Value;
-
- //
- // FIXME: This could return constants instead of EmptyCasts
- //
- if (target_type == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return new SByteConstant ((sbyte) value);
- } else if (target_type == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return new ByteConstant ((byte) value);
- } else if (target_type == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return new ShortConstant ((short) value);
- } else if (target_type == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return new UShortConstant ((ushort) value);
- } else if (target_type == TypeManager.uint32_type){
- if (value >= 0)
- return new UIntConstant ((uint) value);
- } else if (target_type == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64. But we need an opcode
- // to do it.
- //
- if (value >= 0)
- return new ULongConstant ((ulong) value);
- }
-
- if (value == 0 && ic is IntLiteral && TypeManager.IsEnumType (target_type))
- return new EnumConstant (ic, target_type);
-
- return null;
- }
-
- static public void Error_CannotConvertImplicit (Location loc, Type source, Type target)
- {
- string msg = "Cannot convert implicitly from `"+
- TypeManager.CSharpName (source) + "' to `" +
- TypeManager.CSharpName (target) + "'";
-
- Error (29, loc, msg);
+ return new StaticCallExpr ((MethodInfo) method, arguments, loc);
}
/// <summary>
- /// Attemptes to implicityly convert `target' into `type', using
- /// ConvertImplicit. If there is no implicit conversion, then
- /// an error is signaled
+ /// Resolves the expression `e' into a boolean expression: either through
+ /// an implicit conversion, or through an `operator true' invocation
/// </summary>
- static public Expression ConvertImplicitRequired (EmitContext ec, Expression source,
- Type target_type, Location loc)
+ public static Expression ResolveBoolean (EmitContext ec, Expression e, Location loc)
{
- Expression e;
-
- e = ConvertImplicit (ec, source, target_type, loc);
- if (e != null)
- return e;
-
- if (source is DoubleLiteral && target_type == TypeManager.float_type){
- Error (664, loc,
- "Double literal cannot be implicitly converted to " +
- "float type, use F suffix to create a float literal");
- }
-
- Error_CannotConvertImplicit (loc, source.Type, target_type);
-
- return null;
- }
-
- /// <summary>
- /// Performs the explicit numeric conversions
- /// </summary>
- static Expression ConvertNumericExplicit (EmitContext ec, Expression expr,
- Type target_type)
- {
- Type expr_type = expr.Type;
-
- //
- // If we have an enumeration, extract the underlying type,
- // use this during the comparission, but wrap around the original
- // target_type
- //
- Type real_target_type = target_type;
-
- if (TypeManager.IsEnumType (real_target_type))
- real_target_type = TypeManager.EnumToUnderlying (real_target_type);
-
- if (expr_type == TypeManager.sbyte_type){
- //
- // From sbyte to byte, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U1);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I1_CH);
- } else if (expr_type == TypeManager.byte_type){
- //
- // From byte to sbyte and char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U1_I1);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U1_CH);
- } else if (expr_type == TypeManager.short_type){
- //
- // From short to sbyte, byte, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U1);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I2_CH);
- } else if (expr_type == TypeManager.ushort_type){
- //
- // From ushort to sbyte, byte, short, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_I2);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U2_CH);
- } else if (expr_type == TypeManager.int32_type){
- //
- // From int to sbyte, byte, short, ushort, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U2);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I4_CH);
- } else if (expr_type == TypeManager.uint32_type){
- //
- // From uint to sbyte, byte, short, ushort, int, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_I4);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U4_CH);
- } else if (expr_type == TypeManager.int64_type){
- //
- // From long to sbyte, byte, short, ushort, int, uint, ulong, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U4);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.I8_CH);
- } else if (expr_type == TypeManager.uint64_type){
- //
- // From ulong to sbyte, byte, short, ushort, int, uint, long, char
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_I8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.U8_CH);
- } else if (expr_type == TypeManager.char_type){
- //
- // From char to sbyte, byte, short
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.CH_I2);
- } else if (expr_type == TypeManager.float_type){
- //
- // From float to sbyte, byte, short,
- // ushort, int, uint, long, ulong, char
- // or decimal
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_I8);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R4_CH);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- } else if (expr_type == TypeManager.double_type){
- //
- // From double to byte, byte, short,
- // ushort, int, uint, long, ulong,
- // char, float or decimal
- //
- if (real_target_type == TypeManager.sbyte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I1);
- if (real_target_type == TypeManager.byte_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U1);
- if (real_target_type == TypeManager.short_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I2);
- if (real_target_type == TypeManager.ushort_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U2);
- if (real_target_type == TypeManager.int32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I4);
- if (real_target_type == TypeManager.uint32_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U4);
- if (real_target_type == TypeManager.int64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_I8);
- if (real_target_type == TypeManager.uint64_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_U8);
- if (real_target_type == TypeManager.char_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_CH);
- if (real_target_type == TypeManager.float_type)
- return new ConvCast (ec, expr, target_type, ConvCast.Mode.R8_R4);
- if (real_target_type == TypeManager.decimal_type)
- return InternalTypeConstructor (ec, expr, target_type);
- }
-
- // decimal is taken care of by the op_Explicit methods.
-
- return null;
- }
-
- /// <summary>
- /// Returns whether an explicit reference conversion can be performed
- /// from source_type to target_type
- /// </summary>
- public static bool ExplicitReferenceConversionExists (Type source_type, Type target_type)
- {
- bool target_is_value_type = target_type.IsValueType;
-
- if (source_type == target_type)
- return true;
-
- //
- // From object to any reference type
- //
- if (source_type == TypeManager.object_type && !target_is_value_type)
- return true;
-
- //
- // From any class S to any class-type T, provided S is a base class of T
- //
- if (target_type.IsSubclassOf (source_type))
- return true;
-
- //
- // From any interface type S to any interface T provided S is not derived from T
- //
- if (source_type.IsInterface && target_type.IsInterface){
- if (!target_type.IsSubclassOf (source_type))
- return true;
- }
-
- //
- // From any class type S to any interface T, provided S is not sealed
- // and provided S does not implement T.
- //
- if (target_type.IsInterface && !source_type.IsSealed &&
- !TypeManager.ImplementsInterface (source_type, target_type))
- return true;
-
- //
- // From any interface-type S to to any class type T, provided T is not
- // sealed, or provided T implements S.
- //
- if (source_type.IsInterface &&
- (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type)))
- return true;
-
-
- // From an array type S with an element type Se to an array type T with an
- // element type Te provided all the following are true:
- // * S and T differe only in element type, in other words, S and T
- // have the same number of dimensions.
- // * Both Se and Te are reference types
- // * An explicit referenc conversions exist from Se to Te
- //
- if (source_type.IsArray && target_type.IsArray) {
- if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type source_element_type = source_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!source_element_type.IsValueType && !target_element_type.IsValueType)
- if (ExplicitReferenceConversionExists (source_element_type,
- target_element_type))
- return true;
- }
- }
-
-
- // From System.Array to any array-type
- if (source_type == TypeManager.array_type &&
- target_type.IsArray){
- return true;
- }
-
- //
- // From System delegate to any delegate-type
- //
- if (source_type == TypeManager.delegate_type &&
- target_type.IsSubclassOf (TypeManager.delegate_type))
- return true;
-
- //
- // From ICloneable to Array or Delegate types
- //
- if (source_type == TypeManager.icloneable_type &&
- (target_type == TypeManager.array_type ||
- target_type == TypeManager.delegate_type))
- return true;
-
- return false;
- }
-
- /// <summary>
- /// Implements Explicit Reference conversions
- /// </summary>
- static Expression ConvertReferenceExplicit (Expression source, Type target_type)
- {
- Type source_type = source.Type;
- bool target_is_value_type = target_type.IsValueType;
-
- //
- // From object to any reference type
- //
- if (source_type == TypeManager.object_type && !target_is_value_type)
- return new ClassCast (source, target_type);
-
-
- //
- // From any class S to any class-type T, provided S is a base class of T
- //
- if (target_type.IsSubclassOf (source_type))
- return new ClassCast (source, target_type);
+ e = e.Resolve (ec);
+ if (e == null)
+ return null;
- //
- // From any interface type S to any interface T provided S is not derived from T
- //
- if (source_type.IsInterface && target_type.IsInterface){
- if (TypeManager.ImplementsInterface (source_type, target_type))
- return null;
- else
- return new ClassCast (source, target_type);
- }
-
- //
- // From any class type S to any interface T, provides S is not sealed
- // and provided S does not implement T.
- //
- if (target_type.IsInterface && !source_type.IsSealed) {
- if (TypeManager.ImplementsInterface (source_type, target_type))
- return null;
- else
- return new ClassCast (source, target_type);
-
- }
+ Expression converted = e;
+ if (e.Type != TypeManager.bool_type)
+ converted = Convert.ImplicitConversion (ec, e, TypeManager.bool_type, new Location (-1));
//
- // From any interface-type S to to any class type T, provided T is not
- // sealed, or provided T implements S.
+ // If no implicit conversion to bool exists, try using `operator true'
//
- if (source_type.IsInterface) {
- if (!target_type.IsSealed || TypeManager.ImplementsInterface (target_type, source_type))
- return new ClassCast (source, target_type);
- else
+ if (converted == null){
+ Expression operator_true = Expression.GetOperatorTrue (ec, e, loc);
+ if (operator_true == null){
+ Report.Error (
+ 31, loc, "Can not convert the expression to a boolean");
return null;
- }
-
- // From an array type S with an element type Se to an array type T with an
- // element type Te provided all the following are true:
- // * S and T differe only in element type, in other words, S and T
- // have the same number of dimensions.
- // * Both Se and Te are reference types
- // * An explicit referenc conversions exist from Se to Te
- //
- if (source_type.IsArray && target_type.IsArray) {
- if (source_type.GetArrayRank () == target_type.GetArrayRank ()) {
-
- Type source_element_type = source_type.GetElementType ();
- Type target_element_type = target_type.GetElementType ();
-
- if (!source_element_type.IsValueType && !target_element_type.IsValueType)
- if (ExplicitReferenceConversionExists (source_element_type,
- target_element_type))
- return new ClassCast (source, target_type);
}
- }
-
-
- // From System.Array to any array-type
- if (source_type == TypeManager.array_type &&
- target_type.IsArray) {
- return new ClassCast (source, target_type);
- }
-
- //
- // From System delegate to any delegate-type
- //
- if (source_type == TypeManager.delegate_type &&
- target_type.IsSubclassOf (TypeManager.delegate_type))
- return new ClassCast (source, target_type);
+ e = operator_true;
+ } else
+ e = converted;
- //
- // From ICloneable to Array or Delegate types
- //
- if (source_type == TypeManager.icloneable_type &&
- (target_type == TypeManager.array_type ||
- target_type == TypeManager.delegate_type))
- return new ClassCast (source, target_type);
-
- return null;
+ return e;
}
- /// <summary>
- /// Performs an explicit conversion of the expression `expr' whose
- /// type is expr.Type to `target_type'.
- /// </summary>
- static public Expression ConvertExplicit (EmitContext ec, Expression expr,
- Type target_type, Location loc)
- {
- Type expr_type = expr.Type;
- Expression ne = ConvertImplicitStandard (ec, expr, target_type, loc);
-
- if (ne != null)
- return ne;
-
- ne = ConvertNumericExplicit (ec, expr, target_type);
- if (ne != null)
- return ne;
-
- //
- // Unboxing conversion.
- //
- if (expr_type == TypeManager.object_type && target_type.IsValueType)
- return new UnboxCast (expr, target_type);
-
- //
- // Enum types
- //
- if (expr_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression e;
-
- //
- // FIXME: Is there any reason we should have EnumConstant
- // dealt with here instead of just using always the
- // UnderlyingSystemType to wrap the type?
- //
- if (expr is EnumConstant)
- e = ((EnumConstant) expr).Child;
- else {
- e = new EmptyCast (expr, TypeManager.EnumToUnderlying (expr_type));
- }
-
- Expression t = ConvertImplicit (ec, e, target_type, loc);
- if (t != null)
- return t;
-
- return ConvertNumericExplicit (ec, e, target_type);
- }
-
- ne = ConvertReferenceExplicit (expr, target_type);
- if (ne != null)
- return ne;
-
- if (ec.InUnsafe){
- if (target_type.IsPointer){
- if (expr_type.IsPointer)
- return new EmptyCast (expr, target_type);
-
- if (expr_type == TypeManager.sbyte_type ||
- expr_type == TypeManager.byte_type ||
- expr_type == TypeManager.short_type ||
- expr_type == TypeManager.ushort_type ||
- expr_type == TypeManager.int32_type ||
- expr_type == TypeManager.uint32_type ||
- expr_type == TypeManager.uint64_type ||
- expr_type == TypeManager.int64_type)
- return new OpcodeCast (expr, target_type, OpCodes.Conv_U);
- }
- if (expr_type.IsPointer){
- if (target_type == TypeManager.sbyte_type ||
- target_type == TypeManager.byte_type ||
- target_type == TypeManager.short_type ||
- target_type == TypeManager.ushort_type ||
- target_type == TypeManager.int32_type ||
- target_type == TypeManager.uint32_type ||
- target_type == TypeManager.uint64_type ||
- target_type == TypeManager.int64_type){
- Expression e = new EmptyCast (expr, TypeManager.uint32_type);
- Expression ci, ce;
-
- ci = ConvertImplicitStandard (ec, e, target_type, loc);
-
- if (ci != null)
- return ci;
-
- ce = ConvertNumericExplicit (ec, e, target_type);
- if (ce != null)
- return ce;
- //
- // We should always be able to go from an uint32
- // implicitly or explicitly to the other integral
- // types
- //
- throw new Exception ("Internal compiler error");
- }
- }
- }
-
- ne = ExplicitUserConversion (ec, expr, target_type, loc);
- if (ne != null)
- return ne;
-
- Error_CannotConvertType (loc, expr_type, target_type);
- return null;
- }
-
- /// <summary>
- /// Same as ConvertExplicit, only it doesn't include user defined conversions
- /// </summary>
- static public Expression ConvertExplicitStandard (EmitContext ec, Expression expr,
- Type target_type, Location l)
- {
- Expression ne = ConvertImplicitStandard (ec, expr, target_type, l);
-
- if (ne != null)
- return ne;
-
- ne = ConvertNumericExplicit (ec, expr, target_type);
- if (ne != null)
- return ne;
-
- ne = ConvertReferenceExplicit (expr, target_type);
- if (ne != null)
- return ne;
-
- Error_CannotConvertType (l, expr.Type, target_type);
- return null;
- }
-
static string ExprClassName (ExprClass c)
{
switch (c){
@@ -2132,18 +811,53 @@ namespace Mono.CSharp {
/// <summary>
/// Reports that we were expecting `expr' to be of class `expected'
/// </summary>
- protected void report118 (Location loc, Expression expr, string expected)
+ public void Error_UnexpectedKind (string expected, Location loc)
{
string kind = "Unknown";
- if (expr != null)
- kind = ExprClassName (expr.eclass);
+ kind = ExprClassName (eclass);
- Error (118, loc, "Expression denotes a `" + kind +
+ Report.Error (118, loc, "Expression denotes a `" + kind +
"' where a `" + expected + "' was expected");
}
- static void Error_ConstantValueCannotBeConverted (Location l, string val, Type t)
+ public void Error_UnexpectedKind (ResolveFlags flags, Location loc)
+ {
+ ArrayList valid = new ArrayList (10);
+
+ if ((flags & ResolveFlags.VariableOrValue) != 0) {
+ valid.Add ("variable");
+ valid.Add ("value");
+ }
+
+ if ((flags & ResolveFlags.Type) != 0)
+ valid.Add ("type");
+
+ if ((flags & ResolveFlags.MethodGroup) != 0)
+ valid.Add ("method group");
+
+ if ((flags & ResolveFlags.SimpleName) != 0)
+ valid.Add ("simple name");
+
+ if (valid.Count == 0)
+ valid.Add ("unknown");
+
+ StringBuilder sb = new StringBuilder ();
+ for (int i = 0; i < valid.Count; i++) {
+ if (i > 0)
+ sb.Append (", ");
+ else if (i == valid.Count)
+ sb.Append (" or ");
+ sb.Append (valid [i]);
+ }
+
+ string kind = ExprClassName (eclass);
+
+ Error (119, "Expression denotes a `" + kind + "' where " +
+ "a `" + sb.ToString () + "' was expected");
+ }
+
+ static public void Error_ConstantValueCannotBeConverted (Location l, string val, Type t)
{
Report.Error (31, l, "Constant value `" + val + "' cannot be converted to " +
TypeManager.CSharpName (t));
@@ -2171,6 +885,11 @@ namespace Mono.CSharp {
/// </summary>
public static object ConvertIntLiteral (Constant c, Type target_type, Location loc)
{
+ if (!Convert.ImplicitStandardConversionExists (Convert.ConstantEC, c, target_type)){
+ Convert.Error_CannotImplicitConversion (loc, c.Type, target_type);
+ return null;
+ }
+
string s = "";
if (c.Type == target_type)
@@ -2454,11 +1173,16 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Ldind_I1);
else if (t == TypeManager.intptr_type)
ig.Emit (OpCodes.Ldind_I);
- else if (TypeManager.IsEnumType (t))
- LoadFromPtr (ig, TypeManager.EnumToUnderlying (t));
- else if (t.IsValueType)
+ else if (TypeManager.IsEnumType (t)) {
+ if (t == TypeManager.enum_type)
+ ig.Emit (OpCodes.Ldind_Ref);
+ else
+ LoadFromPtr (ig, TypeManager.EnumToUnderlying (t));
+ } else if (t.IsValueType)
ig.Emit (OpCodes.Ldobj, t);
- else
+ else if (t.IsPointer)
+ ig.Emit (OpCodes.Ldind_I);
+ else
ig.Emit (OpCodes.Ldind_Ref);
}
@@ -2467,7 +1191,7 @@ namespace Mono.CSharp {
//
public static void StoreFromPtr (ILGenerator ig, Type type)
{
- if (type.IsEnum)
+ if (TypeManager.IsEnumType (type))
type = TypeManager.EnumToUnderlying (type);
if (type == TypeManager.int32_type || type == TypeManager.uint32_type)
ig.Emit (OpCodes.Stind_I4);
@@ -2496,6 +1220,7 @@ namespace Mono.CSharp {
//
public static int GetTypeSize (Type t)
{
+ t = TypeManager.TypeToCoreType (t);
if (t == TypeManager.int32_type ||
t == TypeManager.uint32_type ||
t == TypeManager.float_type)
@@ -2512,16 +1237,64 @@ namespace Mono.CSharp {
t == TypeManager.char_type ||
t == TypeManager.ushort_type)
return 2;
+ else if (t == TypeManager.decimal_type)
+ return 16;
else
return 0;
}
+ public static void Error_NegativeArrayIndex (Location loc)
+ {
+ Report.Error (248, loc, "Cannot create an array with a negative size");
+ }
+
//
- // Default implementation of IAssignMethod.CacheTemporaries
+ // Converts `source' to an int, uint, long or ulong.
//
- public void CacheTemporaries (EmitContext ec)
- {
+ public Expression ExpressionToArrayArgument (EmitContext ec, Expression source, Location loc)
+ {
+ Expression target;
+
+ bool old_checked = ec.CheckState;
+ ec.CheckState = true;
+
+ target = Convert.ImplicitConversion (ec, source, TypeManager.int32_type, loc);
+ if (target == null){
+ target = Convert.ImplicitConversion (ec, source, TypeManager.uint32_type, loc);
+ if (target == null){
+ target = Convert.ImplicitConversion (ec, source, TypeManager.int64_type, loc);
+ if (target == null){
+ target = Convert.ImplicitConversion (ec, source, TypeManager.uint64_type, loc);
+ if (target == null)
+ Convert.Error_CannotImplicitConversion (loc, source.Type, TypeManager.int32_type);
+ }
+ }
+ }
+ ec.CheckState = old_checked;
+
+ //
+ // Only positive constants are allowed at compile time
+ //
+ if (target is Constant){
+ if (target is IntConstant){
+ if (((IntConstant) target).Value < 0){
+ Error_NegativeArrayIndex (loc);
+ return null;
+ }
+ }
+
+ if (target is LongConstant){
+ if (((LongConstant) target).Value < 0){
+ Error_NegativeArrayIndex (loc);
+ return null;
+ }
+ }
+
+ }
+
+ return target;
}
+
}
/// <summary>
@@ -2533,6 +1306,20 @@ namespace Mono.CSharp {
/// </summary>
public abstract class ExpressionStatement : Expression {
+ public virtual ExpressionStatement ResolveStatement (EmitContext ec)
+ {
+ Expression e = Resolve (ec);
+ if (e == null)
+ return null;
+
+ ExpressionStatement es = e as ExpressionStatement;
+ if (es == null)
+ Error (201, "Only assignment, call, increment, decrement and new object " +
+ "expressions can be used as a statement");
+
+ return es;
+ }
+
/// <summary>
/// Requests the expression to be emitted in a `statement'
/// context. This means that no new value is left on the
@@ -2557,6 +1344,12 @@ namespace Mono.CSharp {
public class EmptyCast : Expression {
protected Expression child;
+ public Expression Child {
+ get {
+ return child;
+ }
+ }
+
public EmptyCast (Expression child, Type return_type)
{
eclass = child.eclass;
@@ -2578,6 +1371,51 @@ namespace Mono.CSharp {
}
}
+ //
+ // We need to special case this since an empty cast of
+ // a NullLiteral is still a Constant
+ //
+ public class NullCast : Constant {
+ protected Expression child;
+
+ public NullCast (Expression child, Type return_type)
+ {
+ eclass = child.eclass;
+ type = return_type;
+ this.child = child;
+ }
+
+ override public string AsString ()
+ {
+ return "null";
+ }
+
+ public override object GetValue ()
+ {
+ return null;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ // This should never be invoked, we are born in fully
+ // initialized state.
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ child.Emit (ec);
+ }
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+ }
+
+
/// <summary>
/// This class is used to wrap literals which belong inside Enums
/// </summary>
@@ -2609,6 +1447,11 @@ namespace Mono.CSharp {
return Child.GetValue ();
}
+ public object GetValueAsEnumType ()
+ {
+ return System.Enum.ToObject (type, Child.GetValue ());
+ }
+
//
// Converts from one of the valid underlying types for an enumeration
// (int32, uint32, int64, uint64, short, ushort, byte, sbyte) to
@@ -2701,6 +1544,16 @@ namespace Mono.CSharp {
{
return Child.ConvertToInt ();
}
+
+ public override bool IsZeroInteger {
+ get { return Child.IsZeroInteger; }
+ }
+
+ public override bool IsNegative {
+ get {
+ return Child.IsNegative;
+ }
+ }
}
/// <summary>
@@ -2712,10 +1565,17 @@ namespace Mono.CSharp {
public class BoxedCast : EmptyCast {
public BoxedCast (Expression expr)
- : base (expr, TypeManager.object_type)
+ : base (expr, TypeManager.object_type)
{
+ eclass = ExprClass.Value;
}
+ public BoxedCast (Expression expr, Type target_type)
+ : base (expr, target_type)
+ {
+ eclass = ExprClass.Value;
+ }
+
public override Expression DoResolve (EmitContext ec)
{
// This should never be invoked, we are born in fully
@@ -2786,8 +1646,8 @@ namespace Mono.CSharp {
public ConvCast (EmitContext ec, Expression child, Type return_type, Mode m)
: base (child, return_type)
{
- mode = m;
checked_state = ec.CheckState;
+ mode = m;
}
public override Expression DoResolve (EmitContext ec)
@@ -2798,6 +1658,11 @@ namespace Mono.CSharp {
return this;
}
+ public override string ToString ()
+ {
+ return String.Format ("ConvCast ({0}, {1})", mode, child);
+ }
+
public override void Emit (EmitContext ec)
{
ILGenerator ig = ec.ig;
@@ -3066,52 +1931,52 @@ namespace Mono.CSharp {
/// times with this scheme.
/// </remarks>
public class SimpleName : Expression {
- public readonly string Name;
- public readonly Location Location;
+ public string Name;
+
+ //
+ // If true, then we are a simple name, not composed with a ".
+ //
+ bool is_base;
+
+ public SimpleName (string a, string b, Location l)
+ {
+ Name = String.Concat (a, ".", b);
+ loc = l;
+ is_base = false;
+ }
public SimpleName (string name, Location l)
{
Name = name;
- Location = l;
+ loc = l;
+ is_base = true;
}
- public static void Error120 (Location l, string name)
+ public static void Error_ObjectRefRequired (EmitContext ec, Location l, string name)
{
- Report.Error (
- 120, l,
- "An object reference is required " +
- "for the non-static field `"+name+"'");
+ if (ec.IsFieldInitializer)
+ Report.Error (
+ 236, l,
+ "A field initializer cannot reference the non-static field, " +
+ "method or property `"+name+"'");
+ else
+ Report.Error (
+ 120, l,
+ "An object reference is required " +
+ "for the non-static field `"+name+"'");
}
//
// Checks whether we are trying to access an instance
// property, method or field from a static body.
//
- Expression MemberStaticCheck (Expression e)
+ Expression MemberStaticCheck (EmitContext ec, Expression e)
{
- if (e is FieldExpr){
- FieldInfo fi = ((FieldExpr) e).FieldInfo;
+ if (e is IMemberExpr){
+ IMemberExpr member = (IMemberExpr) e;
- if (!fi.IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else if (e is MethodGroupExpr){
- MethodGroupExpr mg = (MethodGroupExpr) e;
-
- if (!mg.RemoveInstanceMethods ()){
- Error120 (Location, mg.Methods [0].Name);
- return null;
- }
- return e;
- } else if (e is PropertyExpr){
- if (!((PropertyExpr) e).IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else if (e is EventExpr) {
- if (!((EventExpr) e).IsStatic) {
- Error120 (Location, Name);
+ if (!member.IsStatic){
+ Error_ObjectRefRequired (ec, loc, Name);
return null;
}
}
@@ -3121,18 +1986,88 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- return SimpleNameResolve (ec, null, false);
+ return SimpleNameResolve (ec, null, false, false);
}
public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
{
- return SimpleNameResolve (ec, right_side, false);
+ return SimpleNameResolve (ec, right_side, false, false);
}
- public Expression DoResolveAllowStatic (EmitContext ec)
+ public Expression DoResolveAllowStatic (EmitContext ec, bool intermediate)
{
- return SimpleNameResolve (ec, null, true);
+ return SimpleNameResolve (ec, null, true, intermediate);
+ }
+
+ public override Expression ResolveAsTypeStep (EmitContext ec)
+ {
+ DeclSpace ds = ec.DeclSpace;
+ NamespaceEntry ns = ds.NamespaceEntry;
+ Type t;
+ string alias_value;
+
+ //
+ // Since we are cheating: we only do the Alias lookup for
+ // namespaces if the name does not include any dots in it
+ //
+ if (ns != null && is_base)
+ alias_value = ns.LookupAlias (Name);
+ else
+ alias_value = null;
+
+ if (ec.ResolvingTypeTree){
+ int errors = Report.Errors;
+ Type dt = ds.FindType (loc, Name);
+
+ if (Report.Errors != errors)
+ return null;
+
+ if (dt != null)
+ return new TypeExpression (dt, loc);
+
+ if (alias_value != null){
+ if ((t = RootContext.LookupType (ds, alias_value, true, loc)) != null)
+ return new TypeExpression (t, loc);
+ }
+ }
+
+ if ((t = RootContext.LookupType (ds, Name, true, loc)) != null)
+ return new TypeExpression (t, loc);
+
+ if (alias_value != null) {
+ if ((t = RootContext.LookupType (ds, alias_value, true, loc)) != null)
+ return new TypeExpression (t, loc);
+
+ // we have alias value, but it isn't Type, so try if it's namespace
+ return new SimpleName (alias_value, loc);
+ }
+
+ // No match, maybe our parent can compose us
+ // into something meaningful.
+ return this;
+ }
+
+ Expression SimpleNameResolve (EmitContext ec, Expression right_side,
+ bool allow_static, bool intermediate)
+ {
+ Expression e = DoSimpleNameResolve (ec, right_side, allow_static, intermediate);
+ if (e == null)
+ return null;
+
+ Block current_block = ec.CurrentBlock;
+ if (current_block != null){
+ //LocalInfo vi = current_block.GetLocalInfo (Name);
+ if (is_base &&
+ current_block.IsVariableNameUsedInChildBlock(Name)) {
+ Report.Error (135, Location,
+ "'{0}' has a different meaning in a " +
+ "child block", Name);
+ return null;
+ }
+ }
+
+ return e;
}
/// <remarks>
@@ -3152,221 +2087,124 @@ namespace Mono.CSharp {
/// Type is both an instance variable and a Type; Type.GetType
/// is the static method not an instance method of type.
/// </remarks>
- Expression SimpleNameResolve (EmitContext ec, Expression right_side, bool allow_static)
+ Expression DoSimpleNameResolve (EmitContext ec, Expression right_side, bool allow_static, bool intermediate)
{
Expression e = null;
//
// Stage 1: Performed by the parser (binding to locals or parameters).
//
- if (!ec.OnlyLookupTypes){
- Block current_block = ec.CurrentBlock;
- if (current_block != null && current_block.IsVariableDefined (Name)){
- LocalVariableReference var;
+ Block current_block = ec.CurrentBlock;
+ if (current_block != null){
+ LocalInfo vi = current_block.GetLocalInfo (Name);
+ if (vi != null){
+ Expression var;
+
+ var = new LocalVariableReference (ec.CurrentBlock, Name, loc);
- var = new LocalVariableReference (ec.CurrentBlock, Name, Location);
-
if (right_side != null)
return var.ResolveLValue (ec, right_side);
else
return var.Resolve (ec);
}
-
- //
- // Stage 2: Lookup members
- //
-
- //
- // For enums, the TypeBuilder is not ec.DeclSpace.TypeBuilder
- // Hence we have two different cases
- //
-
- DeclSpace lookup_ds = ec.DeclSpace;
- do {
- if (lookup_ds.TypeBuilder == null)
- break;
-
- e = MemberLookup (ec, lookup_ds.TypeBuilder, Name, Location);
- if (e != null)
- break;
- //
- // Classes/structs keep looking, enums break
- //
- if (lookup_ds is TypeContainer)
- lookup_ds = ((TypeContainer) lookup_ds).Parent;
+ ParameterReference pref = current_block.GetParameterReference (Name, loc);
+ if (pref != null) {
+ if (right_side != null)
+ return pref.ResolveLValue (ec, right_side);
else
- break;
- } while (lookup_ds != null);
-
- if (e == null && ec.ContainerType != null)
- e = MemberLookup (ec, ec.ContainerType, Name, Location);
- }
-
- // Continuation of stage 2
- if (e == null){
- //
- // Stage 3: Lookup symbol in the various namespaces.
- //
- DeclSpace ds = ec.DeclSpace;
- Type t;
- string alias_value;
-
- if ((t = RootContext.LookupType (ds, Name, true, Location)) != null)
- return new TypeExpr (t);
-
- //
- // Stage 2 part b: Lookup up if we are an alias to a type
- // or a namespace.
- //
- // Since we are cheating: we only do the Alias lookup for
- // namespaces if the name does not include any dots in it
- //
-
- if (Name.IndexOf ('.') == -1 && (alias_value = ec.TypeContainer.LookupAlias (Name)) != null) {
- // System.Console.WriteLine (Name + " --> " + alias_value);
- if ((t = RootContext.LookupType (ds, alias_value, true, Location))
- != null)
- return new TypeExpr (t);
-
- // we have alias value, but it isn't Type, so try if it's namespace
- return new SimpleName (alias_value, Location);
+ return pref.Resolve (ec);
}
-
- // No match, maybe our parent can compose us
- // into something meaningful.
- return this;
}
//
- // Stage 2 continues here.
- //
- if (e is TypeExpr)
- return e;
+ // Stage 2: Lookup members
+ //
- if (ec.OnlyLookupTypes)
- return null;
-
- if (e is FieldExpr){
- FieldExpr fe = (FieldExpr) e;
- FieldInfo fi = fe.FieldInfo;
+ DeclSpace lookup_ds = ec.DeclSpace;
+ do {
+ if (lookup_ds.TypeBuilder == null)
+ break;
- if (fi.FieldType.IsPointer && !ec.InUnsafe){
- UnsafeError (Location);
- }
+ e = MemberLookup (ec, lookup_ds.TypeBuilder, Name, loc);
+ if (e != null)
+ break;
+
+ lookup_ds =lookup_ds.Parent;
+ } while (lookup_ds != null);
- if (ec.IsStatic){
- if (!allow_static && !fi.IsStatic){
- Error120 (Location, Name);
- return null;
- }
- } else {
- // If we are not in static code and this
- // field is not static, set the instance to `this'.
+ if (e == null && ec.ContainerType != null)
+ e = MemberLookup (ec, ec.ContainerType, Name, loc);
- if (!fi.IsStatic)
- fe.InstanceExpression = ec.This;
- }
+ if (e == null) {
+ //
+ // Since we are cheating (is_base is our hint
+ // that we are the beginning of the name): we
+ // only do the Alias lookup for namespaces if
+ // the name does not include any dots in it
+ //
+ NamespaceEntry ns = ec.DeclSpace.NamespaceEntry;
+ if (is_base && ns != null){
+ string alias_value = ns.LookupAlias (Name);
+ if (alias_value != null){
+ Name = alias_value;
+ Type t;
-
- if (fi is FieldBuilder) {
- Const c = TypeManager.LookupConstant ((FieldBuilder) fi);
+ if ((t = TypeManager.LookupType (Name)) != null)
+ return new TypeExpression (t, loc);
- if (c != null) {
- object o = c.LookupConstantValue (ec);
- object real_value = ((Constant)c.Expr).GetValue ();
- return Constantify (real_value, fi.FieldType);
+ // No match, maybe our parent can compose us
+ // into something meaningful.
+ return this;
}
}
- if (fi.IsLiteral) {
- Type t = fi.FieldType;
- Type decl_type = fi.DeclaringType;
- object o;
+ return ResolveAsTypeStep (ec);
+ }
- if (fi is FieldBuilder)
- o = TypeManager.GetValue ((FieldBuilder) fi);
- else
- o = fi.GetValue (fi);
-
- if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
- Expression enum_member = MemberLookup (
- ec, decl_type, "value__", MemberTypes.Field,
- AllBindingFlags, Location);
-
- Enum en = TypeManager.LookupEnum (decl_type);
-
- Constant c;
- if (en != null)
- c = Constantify (o, en.UnderlyingType);
- else
- c = Constantify (o, enum_member.Type);
-
- return new EnumConstant (c, decl_type);
- }
-
- Expression exp = Constantify (o, t);
- }
-
+ if (e is TypeExpr)
return e;
- }
- if (e is EventExpr) {
- //
- // If the event is local to this class, we transform ourselves into
- // a FieldExpr
- //
- EventExpr ee = (EventExpr) e;
-
- Expression ml = MemberLookup (
- ec, ec.DeclSpace.TypeBuilder, ee.EventInfo.Name,
- MemberTypes.Event, AllBindingFlags, Location);
-
- if (ml != null) {
- MemberInfo mi = ec.TypeContainer.GetFieldFromEvent ((EventExpr) ml);
-
- if (mi == null) {
- //
- // If this happens, then we have an event with its own
- // accessors and private field etc so there's no need
- // to transform ourselves : we should instead flag an error
- //
- Assign.error70 (ee.EventInfo, Location);
- return null;
- }
+ if (e is IMemberExpr) {
+ e = MemberAccess.ResolveMemberAccess (ec, e, null, loc, this);
+ if (e == null)
+ return null;
- ml = ExprClassFromMemberInfo (ec, mi, Location);
-
- if (ml == null) {
- Report.Error (-200, Location, "Internal error!!");
- return null;
- }
+ IMemberExpr me = e as IMemberExpr;
+ if (me == null)
+ return e;
- Expression instance_expr;
-
- FieldInfo fi = ((FieldExpr) ml).FieldInfo;
-
- if (fi.IsStatic)
- instance_expr = null;
- else {
- instance_expr = ec.This;
- instance_expr = instance_expr.Resolve (ec);
- }
-
- return MemberAccess.ResolveMemberAccess (ec, ml, instance_expr, Location, null);
+ // This fails if ResolveMemberAccess() was unable to decide whether
+ // it's a field or a type of the same name.
+
+ if (!me.IsStatic && (me.InstanceExpression == null))
+ return e;
+
+ if (!me.IsStatic &&
+ TypeManager.IsSubclassOrNestedChildOf (me.InstanceExpression.Type, me.DeclaringType) &&
+ me.InstanceExpression.Type != me.DeclaringType &&
+ !me.InstanceExpression.Type.IsSubclassOf (me.DeclaringType) &&
+ (!intermediate || !MemberAccess.IdenticalNameAndTypeName (ec, this, e, loc))) {
+ Error (38, "Cannot access nonstatic member `" + me.Name + "' of " +
+ "outer type `" + me.DeclaringType + "' via nested type `" +
+ me.InstanceExpression.Type + "'");
+ return null;
}
+
+ return (right_side != null)
+ ? e.DoResolveLValue (ec, right_side)
+ : e.DoResolve (ec);
}
-
-
- if (ec.IsStatic){
+
+ if (ec.IsStatic || ec.IsFieldInitializer){
if (allow_static)
return e;
- return MemberStaticCheck (e);
+ return MemberStaticCheck (ec, e);
} else
return e;
}
-
+
public override void Emit (EmitContext ec)
{
//
@@ -3374,30 +2212,170 @@ namespace Mono.CSharp {
// find the name as a namespace
//
- Error (103, Location, "The name `" + Name +
+ Error (103, "The name `" + Name +
"' does not exist in the class `" +
ec.DeclSpace.Name + "'");
}
+
+ public override string ToString ()
+ {
+ return Name;
+ }
}
/// <summary>
/// Fully resolved expression that evaluates to a type
/// </summary>
- public class TypeExpr : Expression {
- public TypeExpr (Type t)
+ public abstract class TypeExpr : Expression {
+ override public Expression ResolveAsTypeStep (EmitContext ec)
{
- Type = t;
+ TypeExpr t = DoResolveAsTypeStep (ec);
+ if (t == null)
+ return null;
+
eclass = ExprClass.Type;
+ return t;
}
override public Expression DoResolve (EmitContext ec)
{
- return this;
+ return ResolveAsTypeTerminal (ec, false);
}
override public void Emit (EmitContext ec)
{
- throw new Exception ("Implement me");
+ throw new Exception ("Should never be called");
+ }
+
+ public virtual bool CheckAccessLevel (DeclSpace ds)
+ {
+ return ds.CheckAccessLevel (Type);
+ }
+
+ public virtual bool AsAccessible (DeclSpace ds, int flags)
+ {
+ return ds.AsAccessible (Type, flags);
+ }
+
+ public virtual bool IsClass {
+ get { return Type.IsClass; }
+ }
+
+ public virtual bool IsValueType {
+ get { return Type.IsValueType; }
+ }
+
+ public virtual bool IsInterface {
+ get { return Type.IsInterface; }
+ }
+
+ public virtual bool IsSealed {
+ get { return Type.IsSealed; }
+ }
+
+ public virtual bool CanInheritFrom ()
+ {
+ if (Type == TypeManager.enum_type ||
+ (Type == TypeManager.value_type && RootContext.StdLib) ||
+ Type == TypeManager.multicast_delegate_type ||
+ Type == TypeManager.delegate_type ||
+ Type == TypeManager.array_type)
+ return false;
+
+ return true;
+ }
+
+ public virtual bool IsAttribute {
+ get {
+ return Type == TypeManager.attribute_type ||
+ Type.IsSubclassOf (TypeManager.attribute_type);
+ }
+ }
+
+ public virtual TypeExpr[] GetInterfaces ()
+ {
+ return TypeManager.GetInterfaces (Type);
+ }
+
+ public abstract TypeExpr DoResolveAsTypeStep (EmitContext ec);
+
+ public virtual Type ResolveType (EmitContext ec)
+ {
+ TypeExpr t = ResolveAsTypeTerminal (ec, false);
+ if (t == null)
+ return null;
+
+ return t.Type;
+ }
+
+ public abstract string Name {
+ get;
+ }
+
+ public override bool Equals (object obj)
+ {
+ TypeExpr tobj = obj as TypeExpr;
+ if (tobj == null)
+ return false;
+
+ return Type == tobj.Type;
+ }
+
+ public override int GetHashCode ()
+ {
+ return Type.GetHashCode ();
+ }
+
+ public override string ToString ()
+ {
+ return Name;
+ }
+ }
+
+ public class TypeExpression : TypeExpr {
+ public TypeExpression (Type t, Location l)
+ {
+ Type = t;
+ eclass = ExprClass.Type;
+ loc = l;
+ }
+
+ public override TypeExpr DoResolveAsTypeStep (EmitContext ec)
+ {
+ return this;
+ }
+
+ public override string Name {
+ get {
+ return Type.ToString ();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Used to create types from a fully qualified name. These are just used
+ /// by the parser to setup the core types. A TypeLookupExpression is always
+ /// classified as a type.
+ /// </summary>
+ public class TypeLookupExpression : TypeExpr {
+ string name;
+
+ public TypeLookupExpression (string name)
+ {
+ this.name = name;
+ }
+
+ public override TypeExpr DoResolveAsTypeStep (EmitContext ec)
+ {
+ if (type == null)
+ type = RootContext.LookupType (ec.DeclSpace, name, false, Location.Null);
+ return this;
+ }
+
+ public override string Name {
+ get {
+ return name;
+ }
}
}
@@ -3406,10 +2384,12 @@ namespace Mono.CSharp {
///
/// This is a fully resolved expression that evaluates to a type
/// </summary>
- public class MethodGroupExpr : Expression {
+ public class MethodGroupExpr : Expression, IMemberExpr {
public MethodBase [] Methods;
- Location loc;
Expression instance_expression = null;
+ bool is_explicit_impl = false;
+ bool identical_type_name = false;
+ bool is_base;
public MethodGroupExpr (MemberInfo [] mi, Location l)
{
@@ -3435,10 +2415,21 @@ namespace Mono.CSharp {
}
throw;
}
+
loc = l;
eclass = ExprClass.MethodGroup;
type = TypeManager.object_type;
}
+
+ public Type DeclaringType {
+ get {
+ //
+ // The methods are arranged in this order:
+ // derived type -> base type
+ //
+ return Methods [0].DeclaringType;
+ }
+ }
//
// `A method group may have associated an instance expression'
@@ -3452,16 +2443,80 @@ namespace Mono.CSharp {
instance_expression = value;
}
}
+
+ public bool IsExplicitImpl {
+ get {
+ return is_explicit_impl;
+ }
+
+ set {
+ is_explicit_impl = value;
+ }
+ }
+
+ public bool IdenticalTypeName {
+ get {
+ return identical_type_name;
+ }
+
+ set {
+ identical_type_name = value;
+ }
+ }
+
+ public bool IsBase {
+ get {
+ return is_base;
+ }
+ set {
+ is_base = value;
+ }
+ }
+
+ public string Name {
+ get {
+ return Methods [0].Name;
+ }
+ }
+
+ public bool IsInstance {
+ get {
+ foreach (MethodBase mb in Methods)
+ if (!mb.IsStatic)
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsStatic {
+ get {
+ foreach (MethodBase mb in Methods)
+ if (mb.IsStatic)
+ return true;
+
+ return false;
+ }
+ }
override public Expression DoResolve (EmitContext ec)
{
+ if (!IsInstance)
+ instance_expression = null;
+
+ if (instance_expression != null) {
+ instance_expression = instance_expression.DoResolve (ec);
+ if (instance_expression == null)
+ return null;
+ }
+
return this;
}
public void ReportUsageError ()
{
- Report.Error (654, loc, "Method `" + Methods [0].DeclaringType + "." +
- Methods [0].Name + "()' is referenced without parentheses");
+ Report.Error (654, loc, "Method `" + DeclaringType + "." +
+ Name + "()' is referenced without parentheses");
}
override public void Emit (EmitContext ec)
@@ -3509,10 +2564,13 @@ namespace Mono.CSharp {
/// <summary>
/// Fully resolved expression that evaluates to a Field
/// </summary>
- public class FieldExpr : Expression, IAssignMethod, IMemoryLocation {
+ public class FieldExpr : Expression, IAssignMethod, IMemoryLocation, IMemberExpr, IVariable {
public readonly FieldInfo FieldInfo;
- public Expression InstanceExpression;
- Location loc;
+ Expression instance_expr;
+ VariableInfo variable_info;
+
+ LocalTemporary temp;
+ bool prepared;
public FieldExpr (FieldInfo fi, Location l)
{
@@ -3522,20 +2580,101 @@ namespace Mono.CSharp {
loc = l;
}
+ public string Name {
+ get {
+ return FieldInfo.Name;
+ }
+ }
+
+ public bool IsInstance {
+ get {
+ return !FieldInfo.IsStatic;
+ }
+ }
+
+ public bool IsStatic {
+ get {
+ return FieldInfo.IsStatic;
+ }
+ }
+
+ public Type DeclaringType {
+ get {
+ return FieldInfo.DeclaringType;
+ }
+ }
+
+ public Expression InstanceExpression {
+ get {
+ return instance_expr;
+ }
+
+ set {
+ instance_expr = value;
+ }
+ }
+
+ public VariableInfo VariableInfo {
+ get {
+ return variable_info;
+ }
+ }
+
override public Expression DoResolve (EmitContext ec)
{
if (!FieldInfo.IsStatic){
- if (InstanceExpression == null){
- throw new Exception ("non-static FieldExpr without instance var\n" +
- "You have to assign the Instance variable\n" +
- "Of the FieldExpr to set this\n");
+ if (instance_expr == null){
+ //
+ // This can happen when referencing an instance field using
+ // a fully qualified type expression: TypeName.InstanceField = xxx
+ //
+ SimpleName.Error_ObjectRefRequired (ec, loc, FieldInfo.Name);
+ return null;
}
- InstanceExpression = InstanceExpression.Resolve (ec);
- if (InstanceExpression == null)
+ // Resolve the field's instance expression while flow analysis is turned
+ // off: when accessing a field "a.b", we must check whether the field
+ // "a.b" is initialized, not whether the whole struct "a" is initialized.
+ instance_expr = instance_expr.Resolve (ec, ResolveFlags.VariableOrValue |
+ ResolveFlags.DisableFlowAnalysis);
+ if (instance_expr == null)
return null;
}
+ ObsoleteAttribute oa;
+ FieldBase f = TypeManager.GetField (FieldInfo);
+ if (f != null) {
+ oa = f.GetObsoleteAttribute (f.Parent);
+ if (oa != null)
+ AttributeTester.Report_ObsoleteMessage (oa, f.GetSignatureForError (), loc);
+
+ // To be sure that type is external because we do not register generated fields
+ } else if (!(FieldInfo.DeclaringType is TypeBuilder)) {
+ oa = AttributeTester.GetMemberObsoleteAttribute (FieldInfo);
+ if (oa != null)
+ AttributeTester.Report_ObsoleteMessage (oa, TypeManager.GetFullNameSignature (FieldInfo), loc);
+ }
+
+ if (ec.CurrentAnonymousMethod != null){
+ if (!FieldInfo.IsStatic){
+ if (ec.TypeContainer is Struct){
+ Report.Error (1673, loc, "Can not reference instance variables in anonymous methods hosted in structs");
+ return null;
+ }
+ ec.CaptureField (this);
+ }
+ }
+
+ // If the instance expression is a local variable or parameter.
+ IVariable var = instance_expr as IVariable;
+ if ((var == null) || (var.VariableInfo == null))
+ return this;
+
+ VariableInfo vi = var.VariableInfo;
+ if (!vi.IsFieldAssigned (ec, FieldInfo.Name, loc))
+ return null;
+
+ variable_info = vi.GetSubStruct (FieldInfo.Name);
return this;
}
@@ -3555,39 +2694,68 @@ namespace Mono.CSharp {
override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
{
+ IVariable var = instance_expr as IVariable;
+ if ((var != null) && (var.VariableInfo != null))
+ var.VariableInfo.SetFieldAssigned (ec, FieldInfo.Name);
+
Expression e = DoResolve (ec);
if (e == null)
return null;
-
+
+ if (!FieldInfo.IsStatic && (instance_expr.Type.IsValueType && !(instance_expr is IMemoryLocation))) {
+ // FIXME: Provide better error reporting.
+ Error (1612, "Cannot modify expression because it is not a variable.");
+ return null;
+ }
+
if (!FieldInfo.IsInitOnly)
return this;
+ FieldBase fb = TypeManager.GetField (FieldInfo);
+ if (fb != null)
+ fb.SetAssigned ();
+
//
// InitOnly fields can only be assigned in constructors
//
- if (ec.IsConstructor)
- return this;
+ if (ec.IsConstructor){
+ if (IsStatic && !ec.IsStatic)
+ Report_AssignToReadonly (false);
- Report_AssignToReadonly (true);
+ if (ec.ContainerType == FieldInfo.DeclaringType)
+ return this;
+ }
+
+ Report_AssignToReadonly (!IsStatic);
return null;
}
- override public void Emit (EmitContext ec)
+ public bool VerifyFixed (bool is_expression)
+ {
+ IVariable variable = instance_expr as IVariable;
+ if ((variable == null) || !variable.VerifyFixed (true))
+ return false;
+
+ return true;
+ }
+
+ public void Emit (EmitContext ec, bool leave_copy)
{
ILGenerator ig = ec.ig;
bool is_volatile = false;
-
+
if (FieldInfo is FieldBuilder){
FieldBase f = TypeManager.GetField (FieldInfo);
-
- if ((f.ModFlags & Modifiers.VOLATILE) != 0)
- is_volatile = true;
-
- f.status |= Field.Status.USED;
- }
+ if (f != null){
+ if ((f.ModFlags & Modifiers.VOLATILE) != 0)
+ is_volatile = true;
+
+ f.status |= Field.Status.USED;
+ }
+ }
if (FieldInfo.IsStatic){
if (is_volatile)
@@ -3595,78 +2763,89 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Ldsfld, FieldInfo);
} else {
- if (InstanceExpression.Type.IsValueType){
- IMemoryLocation ml;
- LocalTemporary tempo = null;
-
- if (!(InstanceExpression is IMemoryLocation)){
- tempo = new LocalTemporary (
- ec, InstanceExpression.Type);
-
- InstanceExpression.Emit (ec);
- tempo.Store (ec);
- ml = tempo;
- } else
- ml = (IMemoryLocation) InstanceExpression;
-
- ml.AddressOf (ec, AddressOp.Load);
- } else
- InstanceExpression.Emit (ec);
-
+ if (!prepared)
+ EmitInstance (ec);
+
if (is_volatile)
ig.Emit (OpCodes.Volatile);
ig.Emit (OpCodes.Ldfld, FieldInfo);
}
- }
- public void EmitAssign (EmitContext ec, Expression source)
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ if (!FieldInfo.IsStatic) {
+ temp = new LocalTemporary (ec, this.Type);
+ temp.Store (ec);
+ }
+ }
+ }
+
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
FieldAttributes fa = FieldInfo.Attributes;
bool is_static = (fa & FieldAttributes.Static) != 0;
bool is_readonly = (fa & FieldAttributes.InitOnly) != 0;
ILGenerator ig = ec.ig;
+ prepared = prepare_for_load;
if (is_readonly && !ec.IsConstructor){
Report_AssignToReadonly (!is_static);
return;
}
-
- if (!is_static){
- Expression instance = InstanceExpression;
-
- if (instance.Type.IsValueType){
- if (instance is IMemoryLocation){
- IMemoryLocation ml = (IMemoryLocation) instance;
- ml.AddressOf (ec, AddressOp.Store);
- } else
- throw new Exception ("The " + instance + " of type " +
- instance.Type +
- " represents a ValueType and does " +
- "not implement IMemoryLocation");
- } else
- instance.Emit (ec);
+ if (!is_static) {
+ EmitInstance (ec);
+ if (prepare_for_load)
+ ig.Emit (OpCodes.Dup);
}
+
source.Emit (ec);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ if (!FieldInfo.IsStatic) {
+ temp = new LocalTemporary (ec, this.Type);
+ temp.Store (ec);
+ }
+ }
if (FieldInfo is FieldBuilder){
FieldBase f = TypeManager.GetField (FieldInfo);
-
- if ((f.ModFlags & Modifiers.VOLATILE) != 0)
- ig.Emit (OpCodes.Volatile);
- }
-
+ if (f != null){
+ if ((f.ModFlags & Modifiers.VOLATILE) != 0)
+ ig.Emit (OpCodes.Volatile);
+
+ f.status |= Field.Status.ASSIGNED;
+ }
+ }
+
if (is_static)
ig.Emit (OpCodes.Stsfld, FieldInfo);
else
ig.Emit (OpCodes.Stfld, FieldInfo);
+
+ if (temp != null)
+ temp.Emit (ec);
+ }
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
+ void EmitInstance (EmitContext ec)
+ {
+ if (instance_expr.Type.IsValueType) {
+ if (instance_expr is IMemoryLocation) {
+ ((IMemoryLocation) instance_expr).AddressOf (ec, AddressOp.LoadStore);
+ } else {
+ LocalTemporary t = new LocalTemporary (ec, instance_expr.Type);
+ instance_expr.Emit (ec);
+ t.Store (ec);
+ t.AddressOf (ec, AddressOp.Store);
+ }
+ } else
+ instance_expr.Emit (ec);
+ }
- f.status |= Field.Status.ASSIGNED;
- }
+ public override void Emit (EmitContext ec)
+ {
+ Emit (ec, false);
}
public void AddressOf (EmitContext ec, AddressOp mode)
@@ -3675,41 +2854,68 @@ namespace Mono.CSharp {
if (FieldInfo is FieldBuilder){
FieldBase f = TypeManager.GetField (FieldInfo);
- if ((f.ModFlags & Modifiers.VOLATILE) != 0)
- ig.Emit (OpCodes.Volatile);
- }
-
- if (FieldInfo is FieldBuilder){
- FieldBase f = TypeManager.GetField (FieldInfo);
-
- if ((mode & AddressOp.Store) != 0)
- f.status |= Field.Status.ASSIGNED;
- if ((mode & AddressOp.Load) != 0)
- f.status |= Field.Status.USED;
- }
+ if (f != null){
+ if ((f.ModFlags & Modifiers.VOLATILE) != 0){
+ Error (676, "volatile variable: can not take its address, or pass as ref/out parameter");
+ return;
+ }
+
+ if ((mode & AddressOp.Store) != 0)
+ f.status |= Field.Status.ASSIGNED;
+ if ((mode & AddressOp.Load) != 0)
+ f.status |= Field.Status.USED;
+ }
+ }
//
// Handle initonly fields specially: make a copy and then
// get the address of the copy.
//
+ bool need_copy;
if (FieldInfo.IsInitOnly){
+ need_copy = true;
+ if (ec.IsConstructor){
+ if (FieldInfo.IsStatic){
+ if (ec.IsStatic)
+ need_copy = false;
+ } else
+ need_copy = false;
+ }
+ } else
+ need_copy = false;
+
+ if (need_copy){
LocalBuilder local;
-
Emit (ec);
local = ig.DeclareLocal (type);
ig.Emit (OpCodes.Stloc, local);
ig.Emit (OpCodes.Ldloca, local);
return;
- }
+ }
- if (FieldInfo.IsStatic)
+
+ if (FieldInfo.IsStatic){
ig.Emit (OpCodes.Ldsflda, FieldInfo);
- else {
- InstanceExpression.Emit (ec);
+ } else {
+ EmitInstance (ec);
ig.Emit (OpCodes.Ldflda, FieldInfo);
}
}
}
+
+ //
+ // A FieldExpr whose address can not be taken
+ //
+ public class FieldExprNoAddress : FieldExpr, IMemoryLocation {
+ public FieldExprNoAddress (FieldInfo fi, Location loc) : base (fi, loc)
+ {
+ }
+
+ public new void AddressOf (EmitContext ec, AddressOp mode)
+ {
+ Report.Error (-215, "Report this: Taking the address of a remapped parameter not supported");
+ }
+ }
/// <summary>
/// Expression that evaluates to a Property. The Assign class
@@ -3718,33 +2924,55 @@ namespace Mono.CSharp {
/// This is not an LValue because we need to re-write the expression, we
/// can not take data from the stack and store it.
/// </summary>
- public class PropertyExpr : ExpressionStatement, IAssignMethod {
+ public class PropertyExpr : ExpressionStatement, IAssignMethod, IMemberExpr {
public readonly PropertyInfo PropertyInfo;
- public readonly bool IsStatic;
+
+ //
+ // This is set externally by the `BaseAccess' class
+ //
public bool IsBase;
- MethodInfo [] Accessors;
- Location loc;
+ MethodInfo getter, setter;
+ bool is_static;
+ bool must_do_cs1540_check;
Expression instance_expr;
-
- public PropertyExpr (PropertyInfo pi, Location l)
+ LocalTemporary temp;
+ bool prepared;
+
+ public PropertyExpr (EmitContext ec, PropertyInfo pi, Location l)
{
PropertyInfo = pi;
eclass = ExprClass.PropertyAccess;
- IsStatic = false;
+ is_static = false;
loc = l;
- Accessors = TypeManager.GetAccessors (pi);
- if (Accessors != null)
- foreach (MethodInfo mi in Accessors){
- if (mi != null)
- if (mi.IsStatic)
- IsStatic = true;
- }
- else
- Accessors = new MethodInfo [2];
-
- type = pi.PropertyType;
+ type = TypeManager.TypeToCoreType (pi.PropertyType);
+
+ ResolveAccessors (ec);
+ }
+
+ public string Name {
+ get {
+ return PropertyInfo.Name;
+ }
+ }
+
+ public bool IsInstance {
+ get {
+ return !is_static;
+ }
+ }
+
+ public bool IsStatic {
+ get {
+ return is_static;
+ }
+ }
+
+ public Type DeclaringType {
+ get {
+ return PropertyInfo.DeclaringType;
+ }
}
//
@@ -3762,7 +2990,7 @@ namespace Mono.CSharp {
public bool VerifyAssignable ()
{
- if (!PropertyInfo.CanWrite){
+ if (setter == null) {
Report.Error (200, loc,
"The property `" + PropertyInfo.Name +
"' can not be assigned to, as it has not set accessor");
@@ -3772,56 +3000,322 @@ namespace Mono.CSharp {
return true;
}
+ void FindAccessors (Type invocation_type)
+ {
+ BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic |
+ BindingFlags.Static | BindingFlags.Instance |
+ BindingFlags.DeclaredOnly;
+
+ Type current = PropertyInfo.DeclaringType;
+ for (; current != null; current = current.BaseType) {
+ MemberInfo[] group = TypeManager.MemberLookup (
+ invocation_type, invocation_type, current,
+ MemberTypes.Property, flags, PropertyInfo.Name, null);
+
+ if (group == null)
+ continue;
+
+ if (group.Length != 1)
+ // Oooops, can this ever happen ?
+ return;
+
+ PropertyInfo pi = (PropertyInfo) group [0];
+
+ if (getter == null)
+ getter = pi.GetGetMethod (true);;
+
+ if (setter == null)
+ setter = pi.GetSetMethod (true);;
+
+ MethodInfo accessor = getter != null ? getter : setter;
+
+ if (!accessor.IsVirtual)
+ return;
+ }
+ }
+
+ bool IsAccessorAccessible (Type invocation_type, MethodInfo mi)
+ {
+ MethodAttributes ma = mi.Attributes & MethodAttributes.MemberAccessMask;
+
+ //
+ // If only accessible to the current class or children
+ //
+ if (ma == MethodAttributes.Private) {
+ Type declaring_type = mi.DeclaringType;
+
+ if (invocation_type != declaring_type)
+ return TypeManager.IsSubclassOrNestedChildOf (invocation_type, declaring_type);
+
+ return true;
+ }
+ //
+ // FamAndAssem requires that we not only derivate, but we are on the
+ // same assembly.
+ //
+ if (ma == MethodAttributes.FamANDAssem){
+ return (mi.DeclaringType.Assembly != invocation_type.Assembly);
+ }
+
+ // Assembly and FamORAssem succeed if we're in the same assembly.
+ if ((ma == MethodAttributes.Assembly) || (ma == MethodAttributes.FamORAssem)){
+ if (mi.DeclaringType.Assembly == invocation_type.Assembly)
+ return true;
+ }
+
+ // We already know that we aren't in the same assembly.
+ if (ma == MethodAttributes.Assembly)
+ return false;
+
+ // Family and FamANDAssem require that we derive.
+ if ((ma == MethodAttributes.Family) || (ma == MethodAttributes.FamANDAssem) || (ma == MethodAttributes.FamORAssem)){
+ if (!TypeManager.IsSubclassOrNestedChildOf (invocation_type, mi.DeclaringType))
+ return false;
+
+ if (!TypeManager.IsNestedChildOf (invocation_type, mi.DeclaringType))
+ must_do_cs1540_check = true;
+
+ return true;
+ }
+
+ return true;
+ }
+
+ //
+ // We also perform the permission checking here, as the PropertyInfo does not
+ // hold the information for the accessibility of its setter/getter
+ //
+ void ResolveAccessors (EmitContext ec)
+ {
+ FindAccessors (ec.ContainerType);
+
+ is_static = getter != null ? getter.IsStatic : setter.IsStatic;
+ }
+
+ bool InstanceResolve (EmitContext ec)
+ {
+ if ((instance_expr == null) && ec.IsStatic && !is_static) {
+ SimpleName.Error_ObjectRefRequired (ec, loc, PropertyInfo.Name);
+ return false;
+ }
+
+ if (instance_expr != null) {
+ instance_expr = instance_expr.DoResolve (ec);
+ if (instance_expr == null)
+ return false;
+ }
+
+ if (must_do_cs1540_check && (instance_expr != null)) {
+ if ((instance_expr.Type != ec.ContainerType) &&
+ ec.ContainerType.IsSubclassOf (instance_expr.Type)) {
+ Report.Error (1540, loc, "Cannot access protected member `" +
+ PropertyInfo.DeclaringType + "." + PropertyInfo.Name +
+ "' via a qualifier of type `" +
+ TypeManager.CSharpName (instance_expr.Type) +
+ "'; the qualifier must be of type `" +
+ TypeManager.CSharpName (ec.ContainerType) +
+ "' (or derived from it)");
+ return false;
+ }
+ }
+
+ return true;
+ }
+
override public Expression DoResolve (EmitContext ec)
{
- if (!PropertyInfo.CanRead){
+ if (getter != null){
+ if (TypeManager.GetArgumentTypes (getter).Length != 0){
+ Report.Error (
+ 117, loc, "`{0}' does not contain a " +
+ "definition for `{1}'.", getter.DeclaringType,
+ Name);
+ return null;
+ }
+ }
+
+ if (getter == null){
+ //
+ // The following condition happens if the PropertyExpr was
+ // created, but is invalid (ie, the property is inaccessible),
+ // and we did not want to embed the knowledge about this in
+ // the caller routine. This only avoids double error reporting.
+ //
+ if (setter == null)
+ return null;
+
Report.Error (154, loc,
"The property `" + PropertyInfo.Name +
"' can not be used in " +
"this context because it lacks a get accessor");
return null;
+ }
+
+ if (!IsAccessorAccessible (ec.ContainerType, getter)) {
+ Report.Error (122, loc, "'{0}.get' is inaccessible due to its protection level", PropertyInfo.Name);
+ return null;
}
+
+ if (!InstanceResolve (ec))
+ return null;
- type = PropertyInfo.PropertyType;
+ //
+ // Only base will allow this invocation to happen.
+ //
+ if (IsBase && getter.IsAbstract){
+ Report.Error (205, loc, "Cannot call an abstract base property: " +
+ PropertyInfo.DeclaringType + "." +PropertyInfo.Name);
+ return null;
+ }
return this;
}
- override public void Emit (EmitContext ec)
+ override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
{
- MethodInfo method = Accessors [0];
+ if (setter == null){
+ //
+ // The following condition happens if the PropertyExpr was
+ // created, but is invalid (ie, the property is inaccessible),
+ // and we did not want to embed the knowledge about this in
+ // the caller routine. This only avoids double error reporting.
+ //
+ if (getter == null)
+ return null;
+
+ Report.Error (154, loc,
+ "The property `" + PropertyInfo.Name +
+ "' can not be used in " +
+ "this context because it lacks a set accessor");
+ return null;
+ }
+ if (TypeManager.GetArgumentTypes (setter).Length != 1){
+ Report.Error (
+ 117, loc, "`{0}' does not contain a " +
+ "definition for `{1}'.", getter.DeclaringType,
+ Name);
+ return null;
+ }
+
+ if (!IsAccessorAccessible (ec.ContainerType, setter)) {
+ Report.Error (122, loc, "'{0}.set' is inaccessible due to its protection level", PropertyInfo.Name);
+ return null;
+ }
+
+ if (!InstanceResolve (ec))
+ return null;
+
//
- // Special case: length of single dimension array is turned into ldlen
+ // Only base will allow this invocation to happen.
//
- if (method == TypeManager.int_array_get_length){
+ if (IsBase && setter.IsAbstract){
+ Report.Error (205, loc, "Cannot call an abstract base property: " +
+ PropertyInfo.DeclaringType + "." +PropertyInfo.Name);
+ return null;
+ }
+
+ //
+ // Check that we are not making changes to a temporary memory location
+ //
+ if (instance_expr != null && instance_expr.Type.IsValueType && !(instance_expr is IMemoryLocation)) {
+ // FIXME: Provide better error reporting.
+ Error (1612, "Cannot modify expression because it is not a variable.");
+ return null;
+ }
+
+ return this;
+ }
+
+
+
+ public override void Emit (EmitContext ec)
+ {
+ Emit (ec, false);
+ }
+
+ void EmitInstance (EmitContext ec)
+ {
+ if (is_static)
+ return;
+
+ if (instance_expr.Type.IsValueType) {
+ if (instance_expr is IMemoryLocation) {
+ ((IMemoryLocation) instance_expr).AddressOf (ec, AddressOp.LoadStore);
+ } else {
+ LocalTemporary t = new LocalTemporary (ec, instance_expr.Type);
+ instance_expr.Emit (ec);
+ t.Store (ec);
+ t.AddressOf (ec, AddressOp.Store);
+ }
+ } else
+ instance_expr.Emit (ec);
+
+ if (prepared)
+ ec.ig.Emit (OpCodes.Dup);
+ }
+
+
+ public void Emit (EmitContext ec, bool leave_copy)
+ {
+ if (!prepared)
+ EmitInstance (ec);
+
+ //
+ // Special case: length of single dimension array property is turned into ldlen
+ //
+ if ((getter == TypeManager.system_int_array_get_length) ||
+ (getter == TypeManager.int_array_get_length)){
Type iet = instance_expr.Type;
//
// System.Array.Length can be called, but the Type does not
// support invoking GetArrayRank, so test for that case first
//
- if (iet != TypeManager.array_type && (iet.GetArrayRank () == 1)){
- instance_expr.Emit (ec);
+ if (iet != TypeManager.array_type && (iet.GetArrayRank () == 1)) {
ec.ig.Emit (OpCodes.Ldlen);
+ ec.ig.Emit (OpCodes.Conv_I4);
return;
}
}
- Invocation.EmitCall (ec, IsBase, IsStatic, instance_expr, method, null, loc);
+ Invocation.EmitCall (ec, IsBase, IsStatic, new EmptyAddressOf (), getter, null, loc);
+ if (!leave_copy)
+ return;
+
+ ec.ig.Emit (OpCodes.Dup);
+ if (!is_static) {
+ temp = new LocalTemporary (ec, this.Type);
+ temp.Store (ec);
+ }
}
//
// Implements the IAssignMethod interface for assignments
//
- public void EmitAssign (EmitContext ec, Expression source)
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
- Argument arg = new Argument (source, Argument.AType.Expression);
- ArrayList args = new ArrayList ();
+ prepared = prepare_for_load;
+
+ EmitInstance (ec);
- args.Add (arg);
- Invocation.EmitCall (ec, false, IsStatic, instance_expr, Accessors [1], args, loc);
+ source.Emit (ec);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ if (!is_static) {
+ temp = new LocalTemporary (ec, this.Type);
+ temp.Store (ec);
+ }
+ }
+
+ ArrayList args = new ArrayList (1);
+ args.Add (new Argument (new EmptyAddressOf (), Argument.AType.Expression));
+
+ Invocation.EmitCall (ec, IsBase, IsStatic, new EmptyAddressOf (), setter, args, loc);
+
+ if (temp != null)
+ temp.Emit (ec);
}
override public void EmitStatement (EmitContext ec)
@@ -3834,13 +3328,11 @@ namespace Mono.CSharp {
/// <summary>
/// Fully resolved expression that evaluates to an Event
/// </summary>
- public class EventExpr : Expression {
+ public class EventExpr : Expression, IMemberExpr {
public readonly EventInfo EventInfo;
- Location loc;
- public Expression InstanceExpression;
-
- public readonly bool IsStatic;
+ Expression instance_expr;
+ bool is_static;
MethodInfo add_accessor, remove_accessor;
public EventExpr (EventInfo ei, Location loc)
@@ -3853,40 +3345,83 @@ namespace Mono.CSharp {
remove_accessor = TypeManager.GetRemoveMethod (ei);
if (add_accessor.IsStatic || remove_accessor.IsStatic)
- IsStatic = true;
+ is_static = true;
- if (EventInfo is MyEventBuilder)
- type = ((MyEventBuilder) EventInfo).EventType;
- else
+ if (EventInfo is MyEventBuilder){
+ MyEventBuilder eb = (MyEventBuilder) EventInfo;
+ type = eb.EventType;
+ eb.SetUsed ();
+ } else
type = EventInfo.EventHandlerType;
}
- override public Expression DoResolve (EmitContext ec)
+ public string Name {
+ get {
+ return EventInfo.Name;
+ }
+ }
+
+ public bool IsInstance {
+ get {
+ return !is_static;
+ }
+ }
+
+ public bool IsStatic {
+ get {
+ return is_static;
+ }
+ }
+
+ public Type DeclaringType {
+ get {
+ return EventInfo.DeclaringType;
+ }
+ }
+
+ public Expression InstanceExpression {
+ get {
+ return instance_expr;
+ }
+
+ set {
+ instance_expr = value;
+ }
+ }
+
+ public override Expression DoResolve (EmitContext ec)
{
- // We are born fully resolved
+ if (instance_expr != null) {
+ instance_expr = instance_expr.DoResolve (ec);
+ if (instance_expr == null)
+ return null;
+ }
+
+
return this;
}
- override public void Emit (EmitContext ec)
+ public override void Emit (EmitContext ec)
{
- throw new Exception ("Should not happen I think");
+ Report.Error (70, loc, "The event `" + Name + "' can only appear on the left hand side of += or -= (except on the defining type)");
}
public void EmitAddOrRemove (EmitContext ec, Expression source)
{
- Expression handler = ((Binary) source).Right;
+ BinaryDelegate source_del = (BinaryDelegate) source;
+ Expression handler = source_del.Right;
Argument arg = new Argument (handler, Argument.AType.Expression);
ArrayList args = new ArrayList ();
args.Add (arg);
- if (((Binary) source).Oper == Binary.Operator.Addition)
+ if (source_del.IsAddition)
Invocation.EmitCall (
- ec, false, IsStatic, InstanceExpression, add_accessor, args, loc);
+ ec, false, IsStatic, instance_expr, add_accessor, args, loc);
else
Invocation.EmitCall (
- ec, false, IsStatic, InstanceExpression, remove_accessor, args, loc);
+ ec, false, IsStatic, instance_expr, remove_accessor, args, loc);
}
}
}
diff --git a/mcs/mcs/enum.cs b/mcs/mcs/enum.cs
index fc2bae1b297..dc400402a4f 100755
--- a/mcs/mcs/enum.cs
+++ b/mcs/mcs/enum.cs
@@ -13,27 +13,116 @@ using System;
using System.Collections;
using System.Reflection;
using System.Reflection.Emit;
+using System.Globalization;
namespace Mono.CSharp {
+ class EnumMember: MemberCore {
+ static string[] attribute_targets = new string [] { "field" };
+
+ Enum parent_enum;
+ public FieldBuilder builder;
+ internal readonly Expression Type;
+
+ public EnumMember (Enum parent_enum, Expression expr, string name,
+ Location loc, Attributes attrs):
+ base (null, new MemberName (name), attrs, loc)
+ {
+ this.parent_enum = parent_enum;
+ this.ModFlags = parent_enum.ModFlags;
+ this.Type = expr;
+ }
+
+ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type == TypeManager.marshal_as_attr_type) {
+ UnmanagedMarshal marshal = a.GetMarshal (this);
+ if (marshal != null) {
+ builder.SetMarshal (marshal);
+ }
+ return;
+ }
+
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
+ a.Error_InvalidSecurityParent ();
+ return;
+ }
+
+ builder.SetCustomAttribute (cb);
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Field;
+ }
+ }
+
+ public void DefineMember (TypeBuilder tb)
+ {
+ FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
+ | FieldAttributes.Literal;
+
+ builder = tb.DefineField (Name, tb, attr);
+ }
+
+ public override bool Define ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Emit (EmitContext ec)
+ {
+ if (OptAttributes != null)
+ OptAttributes.Emit (ec, this);
+
+ Emit ();
+ }
+
+ public override string GetSignatureForError()
+ {
+ return String.Concat (parent_enum.GetSignatureForError (), '.', base.GetSignatureForError ());
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
+ }
+
+ protected override bool VerifyClsCompliance(DeclSpace ds)
+ {
+ // Because parent is TypeContainer and we have only DeclSpace parent.
+ // Parameter replacing is required
+ return base.VerifyClsCompliance (parent_enum);
+ }
+
+ // There is no base type
+ protected override void VerifyObsoleteAttribute()
+ {
+ }
+ }
+
/// <summary>
/// Enumeration container
/// </summary>
public class Enum : DeclSpace {
-
ArrayList ordered_enums;
- public readonly string BaseType;
- public Attributes OptAttributes;
+
+ public Expression BaseType;
public Type UnderlyingType;
Hashtable member_to_location;
- Hashtable member_to_attributes;
//
// This is for members that have been defined
//
Hashtable member_to_value;
+
+ //
+ // This is used to mark members we're currently defining
+ //
+ Hashtable in_transit;
ArrayList field_builders;
@@ -44,16 +133,18 @@ namespace Mono.CSharp {
Modifiers.INTERNAL |
Modifiers.PRIVATE;
- public Enum (TypeContainer parent, string type, int mod_flags, string name, Attributes attrs, Location l)
- : base (parent, name, l)
+ public Enum (NamespaceEntry ns, TypeContainer parent, Expression type,
+ int mod_flags, MemberName name, Attributes attrs, Location l)
+ : base (ns, parent, name, attrs, l)
{
this.BaseType = type;
- ModFlags = Modifiers.Check (AllowedModifiers, mod_flags, Modifiers.PUBLIC, l);
- OptAttributes = attrs;
+ ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
+ IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE, l);
ordered_enums = new ArrayList ();
member_to_location = new Hashtable ();
member_to_value = new Hashtable ();
+ in_transit = new Hashtable ();
field_builders = new ArrayList ();
}
@@ -61,23 +152,21 @@ namespace Mono.CSharp {
/// Adds @name to the enumeration space, with @expr
/// being its definition.
/// </summary>
- public AdditionResult AddEnumMember (string name, Expression expr, Location loc,
- Attributes opt_attrs)
+ public void AddEnumMember (string name, Expression expr, Location loc, Attributes opt_attrs)
{
- if (defined_names.Contains (name))
- return AdditionResult.NameExists;
+ if (name == "value__") {
+ Report.Error (76, loc, "An item in an enumeration can't have an identifier `value__'");
+ return;
+ }
+
+ EnumMember em = new EnumMember (this, expr, name, loc, opt_attrs);
+ if (!AddToContainer (em, false, name, ""))
+ return;
- DefineName (name, expr);
+ // TODO: can be almost deleted
ordered_enums.Add (name);
member_to_location.Add (name, loc);
-
- if (member_to_attributes == null)
- member_to_attributes = new Hashtable ();
-
- member_to_attributes.Add (name, opt_attrs);
-
- return AdditionResult.Success;
}
//
@@ -117,9 +206,18 @@ namespace Mono.CSharp {
if (TypeBuilder != null)
return TypeBuilder;
- TypeAttributes attr = TypeAttributes.Class | TypeAttributes.Sealed;
+ TypeAttributes attr = Modifiers.TypeAttr (ModFlags, IsTopLevel);
+
+ attr |= TypeAttributes.Class | TypeAttributes.Sealed;
- UnderlyingType = TypeManager.LookupType (BaseType);
+ if (!(BaseType is TypeLookupExpression)) {
+ Report.Error (1008, Location,
+ "Type byte, sbyte, short, ushort, int, uint, " +
+ "long, or ulong expected (got: `{0}')", BaseType);
+ return null;
+ }
+
+ UnderlyingType = ResolveType (BaseType, false, Location);
if (UnderlyingType != TypeManager.int32_type &&
UnderlyingType != TypeManager.uint32_type &&
@@ -137,23 +235,15 @@ namespace Mono.CSharp {
}
if (IsTopLevel) {
- ModuleBuilder builder = CodeGen.ModuleBuilder;
-
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- attr |= TypeAttributes.Public;
- else
- attr |= TypeAttributes.NotPublic;
+ if (TypeManager.NamespaceClash (Name, Location))
+ return null;
+ ModuleBuilder builder = CodeGen.Module.Builder;
+
TypeBuilder = builder.DefineType (Name, attr, TypeManager.enum_type);
} else {
TypeBuilder builder = Parent.TypeBuilder;
- if ((ModFlags & Modifiers.PUBLIC) != 0)
- attr |= TypeAttributes.NestedPublic;
- else
- attr |= TypeAttributes.NestedPrivate;
-
-
TypeBuilder = builder.DefineNestedType (
Basename, attr, TypeManager.enum_type);
}
@@ -177,7 +267,8 @@ namespace Mono.CSharp {
if (e is IntConstant || e is UIntConstant || e is LongConstant ||
e is ByteConstant || e is SByteConstant || e is ShortConstant ||
- e is UShortConstant || e is ULongConstant || e is EnumConstant)
+ e is UShortConstant || e is ULongConstant || e is EnumConstant ||
+ e is CharConstant)
return true;
else
return false;
@@ -260,11 +351,142 @@ namespace Mono.CSharp {
}
/// <summary>
+ /// Determines if a standard implicit conversion exists from
+ /// expr_type to target_type
+ /// </summary>
+ public static bool ImplicitConversionExists (Type expr_type, Type target_type)
+ {
+ expr_type = TypeManager.TypeToCoreType (expr_type);
+
+ if (expr_type == TypeManager.void_type)
+ return false;
+
+ if (expr_type == target_type)
+ return true;
+
+ // First numeric conversions
+
+ if (expr_type == TypeManager.sbyte_type){
+ //
+ // From sbyte to short, int, long, float, double.
+ //
+ if ((target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.short_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.byte_type){
+ //
+ // From byte to short, ushort, int, uint, long, ulong, float, double
+ //
+ if ((target_type == TypeManager.short_type) ||
+ (target_type == TypeManager.ushort_type) ||
+ (target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.uint32_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.short_type){
+ //
+ // From short to int, long, float, double
+ //
+ if ((target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.ushort_type){
+ //
+ // From ushort to int, uint, long, ulong, float, double
+ //
+ if ((target_type == TypeManager.uint32_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.int32_type){
+ //
+ // From int to long, float, double
+ //
+ if ((target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.uint32_type){
+ //
+ // From uint to long, ulong, float, double
+ //
+ if ((target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if ((expr_type == TypeManager.uint64_type) ||
+ (expr_type == TypeManager.int64_type)) {
+ //
+ // From long/ulong to float, double
+ //
+ if ((target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.char_type){
+ //
+ // From char to ushort, int, uint, long, ulong, float, double
+ //
+ if ((target_type == TypeManager.ushort_type) ||
+ (target_type == TypeManager.int32_type) ||
+ (target_type == TypeManager.uint32_type) ||
+ (target_type == TypeManager.uint64_type) ||
+ (target_type == TypeManager.int64_type) ||
+ (target_type == TypeManager.float_type) ||
+ (target_type == TypeManager.double_type) ||
+ (target_type == TypeManager.decimal_type))
+ return true;
+
+ } else if (expr_type == TypeManager.float_type){
+ //
+ // float to double
+ //
+ if (target_type == TypeManager.double_type)
+ return true;
+ }
+
+ return false;
+ }
+
+ //
+ // Horrible, horrible. But there is no other way we can pass the EmitContext
+ // to the recursive definition triggered by the evaluation of a forward
+ // expression
+ //
+ static EmitContext current_ec = null;
+
+ /// <summary>
/// This is used to lookup the value of an enum member. If the member is undefined,
/// it attempts to define it and return its value
/// </summary>
public object LookupEnumValue (EmitContext ec, string name, Location loc)
{
+
object default_value = null;
Constant c = null;
@@ -280,6 +502,12 @@ namespace Mono.CSharp {
if (!defined_names.Contains (name))
return null;
+ if (in_transit.Contains (name)) {
+ Report.Error (110, loc, "The evaluation of the constant value for `" +
+ Name + "." + name + "' involves a circular definition.");
+ return null;
+ }
+
//
// So if the above doesn't happen, we have a member that is undefined
// We now proceed to define it
@@ -297,7 +525,18 @@ namespace Mono.CSharp {
string n = (string) ordered_enums [i];
Location m_loc = (Mono.CSharp.Location)
member_to_location [n];
+ in_transit.Add (name, true);
+
+ EmitContext old_ec = current_ec;
+ current_ec = ec;
+
default_value = LookupEnumValue (ec, n, m_loc);
+
+ current_ec = old_ec;
+
+ in_transit.Remove (name);
+ if (default_value == null)
+ return null;
}
default_value = GetNextDefaultValue (default_value);
@@ -306,76 +545,86 @@ namespace Mono.CSharp {
} else {
bool old = ec.InEnumContext;
ec.InEnumContext = true;
+ in_transit.Add (name, true);
+
+ EmitContext old_ec = current_ec;
+ current_ec = ec;
val = val.Resolve (ec);
- ec.InEnumContext = old;
+ current_ec = old_ec;
- if (val == null) {
- Report.Error (-12, loc, "Definition is circular.");
+ in_transit.Remove (name);
+ ec.InEnumContext = old;
+
+ if (val == null)
return null;
- }
- if (IsValidEnumConstant (val)) {
- c = (Constant) val;
- default_value = c.GetValue ();
-
- if (default_value == null) {
- Error_ConstantValueCannotBeConverted (c, loc);
- return null;
- }
-
- } else {
+ if (!IsValidEnumConstant (val)) {
Report.Error (
1008, loc,
"Type byte, sbyte, short, ushort, int, uint, long, or " +
"ulong expected (have: " + val + ")");
return null;
}
+
+ c = (Constant) val;
+ default_value = c.GetValue ();
+
+ if (default_value == null) {
+ Error_ConstantValueCannotBeConverted (c, loc);
+ return null;
+ }
+
+ if (val is EnumConstant){
+ Type etype = TypeManager.EnumToUnderlying (c.Type);
+
+ if (!ImplicitConversionExists (etype, UnderlyingType)){
+ Convert.Error_CannotImplicitConversion (
+ loc, c.Type, UnderlyingType);
+ return null;
+ }
+ }
}
- FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
- | FieldAttributes.Literal;
-
- FieldBuilder fb = TypeBuilder.DefineField (name, UnderlyingType, attr);
+ EnumMember em = (EnumMember) defined_names [name];
+ em.DefineMember (TypeBuilder);
- try {
- default_value = TypeManager.ChangeType (default_value, UnderlyingType);
- } catch {
+ bool fail;
+ default_value = TypeManager.ChangeType (default_value, UnderlyingType, out fail);
+ if (fail){
Error_ConstantValueCannotBeConverted (c, loc);
return null;
}
- fb.SetConstant (default_value);
- field_builders.Add (fb);
+ em.builder.SetConstant (default_value);
+ field_builders.Add (em.builder);
member_to_value [name] = default_value;
- if (!TypeManager.RegisterFieldValue (fb, default_value))
+ if (!TypeManager.RegisterFieldValue (em.builder, default_value))
return null;
- //
- // Now apply attributes
- //
- Attribute.ApplyAttributes (ec, fb, fb, (Attributes) member_to_attributes [name], loc);
-
return default_value;
}
+
+ public override bool DefineMembers (TypeContainer parent)
+ {
+ return true;
+ }
- public override bool Define (TypeContainer parent)
+ public override bool Define ()
{
//
// If there was an error during DefineEnum, return
//
if (TypeBuilder == null)
return false;
-
- EmitContext ec = new EmitContext (parent, this, Location, null,
+
+ EmitContext ec = new EmitContext (this, this, Location, null,
UnderlyingType, ModFlags, false);
+
object default_value = 0;
- FieldAttributes attr = FieldAttributes.Public | FieldAttributes.Static
- | FieldAttributes.Literal;
-
-
+
foreach (string name in ordered_enums) {
//
// Have we already been defined, thanks to some cross-referencing ?
@@ -390,20 +639,26 @@ namespace Mono.CSharp {
if (default_value == null)
return true;
-
} else {
- FieldBuilder fb = TypeBuilder.DefineField (
- name, UnderlyingType, attr);
+ if (name == "value__"){
+ Report.Error (76, loc, "The name `value__' is reserved for enumerations");
+ return false;
+ }
+
+ EnumMember em = (EnumMember) defined_names [name];
+
+ em.DefineMember (TypeBuilder);
+ FieldBuilder fb = em.builder;
if (default_value == null) {
Report.Error (543, loc, "Enumerator value for '" + name + "' is too large to " +
"fit in its type");
return false;
}
-
- try {
- default_value = TypeManager.ChangeType (default_value, UnderlyingType);
- } catch {
+
+ bool fail;
+ default_value = TypeManager.ChangeType (default_value, UnderlyingType, out fail);
+ if (fail){
Error_ConstantValueCannotBeConverted (default_value, loc);
return false;
}
@@ -414,44 +669,96 @@ namespace Mono.CSharp {
if (!TypeManager.RegisterFieldValue (fb, default_value))
return false;
-
- //
- // Apply attributes on the enum member
- //
- Attribute.ApplyAttributes (ec, fb, fb, (Attributes) member_to_attributes [name], loc);
}
default_value = GetNextDefaultValue (default_value);
}
-
- Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes, Location);
+
+ return true;
+ }
+
+ public override void Emit ()
+ {
+ EmitContext ec = new EmitContext (
+ Parent, this, Location, null, null, ModFlags, false);
+
+ if (OptAttributes != null) {
+ OptAttributes.Emit (ec, this);
+ }
+
+ foreach (EnumMember em in defined_names.Values) {
+ em.Emit (ec);
+ }
+
+ base.Emit ();
+ }
+
+ void VerifyClsName ()
+ {
+ Hashtable ht = new Hashtable ();
+ foreach (string name in ordered_enums) {
+ string locase = name.ToLower (System.Globalization.CultureInfo.InvariantCulture);
+ if (!ht.Contains (locase)) {
+ ht.Add (locase, defined_names [name]);
+ continue;
+ }
+
+ MemberCore conflict = (MemberCore)ht [locase];
+ Report.SymbolRelatedToPreviousError (conflict);
+ conflict = GetDefinition (name);
+ Report.Error (3005, conflict.Location, "Identifier '{0}' differing only in case is not CLS-compliant", conflict.GetSignatureForError ());
+ }
+ }
+
+ protected override bool VerifyClsCompliance (DeclSpace ds)
+ {
+ if (!base.VerifyClsCompliance (ds))
+ return false;
+
+ VerifyClsName ();
+
+ if (!AttributeTester.IsClsCompliant (UnderlyingType)) {
+ Report.Error (3009, Location, "'{0}': base type '{1}' is not CLS-compliant", GetSignatureForError (), TypeManager.CSharpName (UnderlyingType));
+ }
return true;
}
+ /// <summary>
+ /// Returns full enum name.
+ /// </summary>
+ string GetEnumeratorName (string valueName)
+ {
+ return String.Concat (Name, ".", valueName);
+ }
+
//
- // Hack around System.Reflection as found everywhere else
+ // IMemberFinder
//
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
+ public override MemberList FindMembers (MemberTypes mt, BindingFlags bf,
+ MemberFilter filter, object criteria)
{
ArrayList members = new ArrayList ();
if ((mt & MemberTypes.Field) != 0) {
+ if (criteria is string){
+ if (member_to_value [criteria] == null && current_ec != null){
+ LookupEnumValue (current_ec, (string) criteria, Location.Null);
+ }
+ }
+
foreach (FieldBuilder fb in field_builders)
if (filter (fb, criteria) == true)
members.Add (fb);
}
- int count = members.Count;
+ return new MemberList (members);
+ }
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
+ public override MemberCache MemberCache {
+ get {
+ return null;
}
-
- return null;
}
public ArrayList ValueNames {
@@ -463,8 +770,19 @@ namespace Mono.CSharp {
// indexer
public Expression this [string name] {
get {
- return (Expression) defined_names [name];
+ return ((EnumMember) defined_names [name]).Type;
+ }
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Enum;
}
}
+
+ protected override void VerifyObsoleteAttribute()
+ {
+ // UnderlyingType is never obsolete
+ }
}
}
diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs
index b30dcd28bac..c04d1e34e1b 100755
--- a/mcs/mcs/expression.cs
+++ b/mcs/mcs/expression.cs
@@ -4,8 +4,8 @@
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
-// (C) 2001 Ximian, Inc.
-//
+// (C) 2001, 2002, 2003 Ximian, Inc.
+// (C) 2003, 2004 Novell, Inc.
//
#define USE_OLD
@@ -25,13 +25,14 @@ namespace Mono.CSharp {
ArrayList args;
MethodInfo mi;
- StaticCallExpr (MethodInfo m, ArrayList a)
+ public StaticCallExpr (MethodInfo m, ArrayList a, Location l)
{
mi = m;
args = a;
type = m.ReturnType;
eclass = ExprClass.Value;
+ loc = l;
}
public override Expression DoResolve (EmitContext ec)
@@ -45,34 +46,67 @@ namespace Mono.CSharp {
public override void Emit (EmitContext ec)
{
if (args != null)
- Invocation.EmitArguments (ec, mi, args);
+ Invocation.EmitArguments (ec, mi, args, false, null);
ec.ig.Emit (OpCodes.Call, mi);
return;
}
- static public Expression MakeSimpleCall (EmitContext ec, MethodGroupExpr mg,
+ static public StaticCallExpr MakeSimpleCall (EmitContext ec, MethodGroupExpr mg,
Expression e, Location loc)
{
ArrayList args;
MethodBase method;
args = new ArrayList (1);
- args.Add (new Argument (e, Argument.AType.Expression));
- method = Invocation.OverloadResolve (ec, (MethodGroupExpr) mg, args, loc);
+ Argument a = new Argument (e, Argument.AType.Expression);
+
+ // We need to resolve the arguments before sending them in !
+ if (!a.Resolve (ec, loc))
+ return null;
+
+ args.Add (a);
+ method = Invocation.OverloadResolve (
+ ec, (MethodGroupExpr) mg, args, false, loc);
if (method == null)
return null;
- return new StaticCallExpr ((MethodInfo) method, args);
+ return new StaticCallExpr ((MethodInfo) method, args, loc);
}
public override void EmitStatement (EmitContext ec)
{
Emit (ec);
- if (type != TypeManager.void_type)
+ if (TypeManager.TypeToCoreType (type) != TypeManager.void_type)
ec.ig.Emit (OpCodes.Pop);
}
+
+ public MethodInfo Method {
+ get { return mi; }
+ }
+ }
+
+ public class ParenthesizedExpression : Expression
+ {
+ public Expression Expr;
+
+ public ParenthesizedExpression (Expression expr, Location loc)
+ {
+ this.Expr = expr;
+ this.loc = loc;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ Expr = Expr.Resolve (ec);
+ return Expr;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ throw new Exception ("Should not happen");
+ }
}
/// <summary>
@@ -92,7 +126,6 @@ namespace Mono.CSharp {
public Operator Oper;
public Expression Expr;
- Location loc;
public Unary (Operator op, Expression expr, Location loc)
{
@@ -124,7 +157,7 @@ namespace Mono.CSharp {
return oper.ToString ();
}
- static string [] oper_names;
+ public static readonly string [] oper_names;
static Unary ()
{
@@ -140,8 +173,8 @@ namespace Mono.CSharp {
void Error23 (Type t)
{
- Report.Error (
- 23, loc, "Operator " + OperName (Oper) +
+ Error (
+ 23, "Operator " + OperName (Oper) +
" cannot be applied to operand of type `" +
TypeManager.CSharpName (t) + "'");
}
@@ -152,10 +185,10 @@ namespace Mono.CSharp {
/// FIXME: a minus constant -128 sbyte cant be turned into a
/// constant byte.
/// </remarks>
- static Expression TryReduceNegative (Expression expr)
+ static Expression TryReduceNegative (Constant expr)
{
Expression e = null;
-
+
if (expr is IntConstant)
e = new IntConstant (-((IntConstant) expr).Value);
else if (expr is UIntConstant){
@@ -164,7 +197,7 @@ namespace Mono.CSharp {
if (value < 2147483649)
return new IntConstant (-(int)value);
else
- e = new LongConstant (value);
+ e = new LongConstant (-value);
}
else if (expr is LongConstant)
e = new LongConstant (-((LongConstant) expr).Value);
@@ -186,26 +219,36 @@ namespace Mono.CSharp {
e = new IntConstant (-((UShortConstant) expr).Value);
return e;
}
-
- Expression Reduce (EmitContext ec, Expression e)
+
+ // <summary>
+ // This routine will attempt to simplify the unary expression when the
+ // argument is a constant. The result is returned in `result' and the
+ // function returns true or false depending on whether a reduction
+ // was performed or not
+ // </summary>
+ bool Reduce (EmitContext ec, Constant e, out Expression result)
{
Type expr_type = e.Type;
switch (Oper){
case Operator.UnaryPlus:
- return e;
+ result = e;
+ return true;
case Operator.UnaryNegation:
- return TryReduceNegative (e);
+ result = TryReduceNegative (e);
+ return true;
case Operator.LogicalNot:
if (expr_type != TypeManager.bool_type) {
+ result = null;
Error23 (expr_type);
- return null;
+ return false;
}
BoolConstant b = (BoolConstant) e;
- return new BoolConstant (!(b.Value));
+ result = new BoolConstant (!(b.Value));
+ return true;
case Operator.OnesComplement:
if (!((expr_type == TypeManager.int32_type) ||
@@ -213,31 +256,69 @@ namespace Mono.CSharp {
(expr_type == TypeManager.int64_type) ||
(expr_type == TypeManager.uint64_type) ||
(expr_type.IsSubclassOf (TypeManager.enum_type)))){
- Error23 (expr_type);
- return null;
+
+ result = null;
+ if (Convert.ImplicitConversionExists (ec, e, TypeManager.int32_type)){
+ result = new Cast (new TypeExpression (TypeManager.int32_type, loc), e, loc);
+ result = result.Resolve (ec);
+ } else if (Convert.ImplicitConversionExists (ec, e, TypeManager.uint32_type)){
+ result = new Cast (new TypeExpression (TypeManager.uint32_type, loc), e, loc);
+ result = result.Resolve (ec);
+ } else if (Convert.ImplicitConversionExists (ec, e, TypeManager.int64_type)){
+ result = new Cast (new TypeExpression (TypeManager.int64_type, loc), e, loc);
+ result = result.Resolve (ec);
+ } else if (Convert.ImplicitConversionExists (ec, e, TypeManager.uint64_type)){
+ result = new Cast (new TypeExpression (TypeManager.uint64_type, loc), e, loc);
+ result = result.Resolve (ec);
+ }
+
+ if (result == null || !(result is Constant)){
+ result = null;
+ Error23 (expr_type);
+ return false;
+ }
+
+ expr_type = result.Type;
+ e = (Constant) result;
}
if (e is EnumConstant){
EnumConstant enum_constant = (EnumConstant) e;
+ Expression reduced;
- Expression reduced = Reduce (ec, enum_constant.Child);
+ if (Reduce (ec, enum_constant.Child, out reduced)){
+ result = new EnumConstant ((Constant) reduced, enum_constant.Type);
+ return true;
+ } else {
+ result = null;
+ return false;
+ }
+ }
- return new EnumConstant ((Constant) reduced, enum_constant.Type);
+ if (expr_type == TypeManager.int32_type){
+ result = new IntConstant (~ ((IntConstant) e).Value);
+ } else if (expr_type == TypeManager.uint32_type){
+ result = new UIntConstant (~ ((UIntConstant) e).Value);
+ } else if (expr_type == TypeManager.int64_type){
+ result = new LongConstant (~ ((LongConstant) e).Value);
+ } else if (expr_type == TypeManager.uint64_type){
+ result = new ULongConstant (~ ((ULongConstant) e).Value);
+ } else {
+ result = null;
+ Error23 (expr_type);
+ return false;
}
+ return true;
- if (expr_type == TypeManager.int32_type)
- return new IntConstant (~ ((IntConstant) e).Value);
- if (expr_type == TypeManager.uint32_type)
- return new UIntConstant (~ ((UIntConstant) e).Value);
- if (expr_type == TypeManager.int64_type)
- return new LongConstant (~ ((LongConstant) e).Value);
- if (expr_type == TypeManager.uint64_type)
- return new ULongConstant (~ ((ULongConstant) e).Value);
+ case Operator.AddressOf:
+ result = this;
+ return false;
- Error23 (expr_type);
- return null;
+ case Operator.Indirection:
+ result = this;
+ return false;
}
- throw new Exception ("Can not constant fold");
+ throw new Exception ("Can not constant fold: " + Oper.ToString());
}
Expression ResolveOperator (EmitContext ec)
@@ -275,20 +356,29 @@ namespace Mono.CSharp {
//
// Step 2: Default operations on CLI native types.
//
- if (Expr is Constant)
- return Reduce (ec, Expr);
- if (Oper == Operator.LogicalNot){
+ // Attempt to use a constant folding operation.
+ if (Expr is Constant){
+ Expression result;
+
+ if (Reduce (ec, (Constant) Expr, out result))
+ return result;
+ }
+
+ switch (Oper){
+ case Operator.LogicalNot:
if (expr_type != TypeManager.bool_type) {
- Error23 (Expr.Type);
- return null;
+ Expr = ResolveBoolean (ec, Expr, loc);
+ if (Expr == null){
+ Error23 (expr_type);
+ return null;
+ }
}
type = TypeManager.bool_type;
return this;
- }
- if (Oper == Operator.OnesComplement) {
+ case Operator.OnesComplement:
if (!((expr_type == TypeManager.int32_type) ||
(expr_type == TypeManager.uint32_type) ||
(expr_type == TypeManager.int64_type) ||
@@ -296,22 +386,22 @@ namespace Mono.CSharp {
(expr_type.IsSubclassOf (TypeManager.enum_type)))){
Expression e;
- e = ConvertImplicit (ec, Expr, TypeManager.int32_type, loc);
+ e = Convert.ImplicitConversion (ec, Expr, TypeManager.int32_type, loc);
if (e != null){
type = TypeManager.int32_type;
return this;
}
- e = ConvertImplicit (ec, Expr, TypeManager.uint32_type, loc);
+ e = Convert.ImplicitConversion (ec, Expr, TypeManager.uint32_type, loc);
if (e != null){
type = TypeManager.uint32_type;
return this;
}
- e = ConvertImplicit (ec, Expr, TypeManager.int64_type, loc);
+ e = Convert.ImplicitConversion (ec, Expr, TypeManager.int64_type, loc);
if (e != null){
type = TypeManager.int64_type;
return this;
}
- e = ConvertImplicit (ec, Expr, TypeManager.uint64_type, loc);
+ e = Convert.ImplicitConversion (ec, Expr, TypeManager.uint64_type, loc);
if (e != null){
type = TypeManager.uint64_type;
return this;
@@ -321,32 +411,82 @@ namespace Mono.CSharp {
}
type = expr_type;
return this;
- }
- if (Oper == Operator.UnaryPlus) {
+ case Operator.AddressOf:
+ if (Expr.eclass != ExprClass.Variable){
+ Error (211, "Cannot take the address of non-variables");
+ return null;
+ }
+
+ if (!ec.InUnsafe) {
+ UnsafeError (loc);
+ return null;
+ }
+
+ if (!TypeManager.VerifyUnManaged (Expr.Type, loc)){
+ return null;
+ }
+
+ IVariable variable = Expr as IVariable;
+ if (!ec.InFixedInitializer && ((variable == null) || !variable.VerifyFixed (false))) {
+ Error (212, "You can only take the address of an unfixed expression inside " +
+ "of a fixed statement initializer");
+ return null;
+ }
+
+ if (ec.InFixedInitializer && ((variable != null) && variable.VerifyFixed (false))) {
+ Error (213, "You can not fix an already fixed expression");
+ return null;
+ }
+
+ // According to the specs, a variable is considered definitely assigned if you take
+ // its address.
+ if ((variable != null) && (variable.VariableInfo != null))
+ variable.VariableInfo.SetAssigned (ec);
+
+ type = TypeManager.GetPointerType (Expr.Type);
+ return this;
+
+ case Operator.Indirection:
+ if (!ec.InUnsafe){
+ UnsafeError (loc);
+ return null;
+ }
+
+ if (!expr_type.IsPointer){
+ Error (193, "The * or -> operator can only be applied to pointers");
+ return null;
+ }
+
+ //
+ // We create an Indirection expression, because
+ // it can implement the IMemoryLocation.
+ //
+ return new Indirection (Expr, loc);
+
+ case Operator.UnaryPlus:
//
// A plus in front of something is just a no-op, so return the child.
//
return Expr;
- }
- //
- // Deals with -literals
- // int operator- (int x)
- // long operator- (long x)
- // float operator- (float f)
- // double operator- (double d)
- // decimal operator- (decimal d)
- //
- if (Oper == Operator.UnaryNegation){
- Expression e = null;
+ case Operator.UnaryNegation:
+ //
+ // Deals with -literals
+ // int operator- (int x)
+ // long operator- (long x)
+ // float operator- (float f)
+ // double operator- (double d)
+ // decimal operator- (decimal d)
+ //
+ Expression expr = null;
//
// transform - - expr into expr
//
if (Expr is Unary){
Unary unary = (Unary) Expr;
-
+
if (unary.Oper == Operator.UnaryNegation)
return unary.Expr;
}
@@ -357,7 +497,7 @@ namespace Mono.CSharp {
//
//
// The following is inneficient, because we call
- // ConvertImplicit too many times.
+ // ImplicitConversion too many times.
//
// It is also not clear if we should convert to Float
// or Double initially.
@@ -369,7 +509,7 @@ namespace Mono.CSharp {
// bt wrote as a decimal interger literal
//
type = TypeManager.int64_type;
- Expr = ConvertImplicit (ec, Expr, type, loc);
+ Expr = Convert.ImplicitConversion (ec, Expr, type, loc);
return this;
}
@@ -388,80 +528,42 @@ namespace Mono.CSharp {
return this;
}
- e = ConvertImplicit (ec, Expr, TypeManager.int32_type, loc);
- if (e != null){
- Expr = e;
- type = e.Type;
+ expr = Convert.ImplicitConversion (ec, Expr, TypeManager.int32_type, loc);
+ if (expr != null){
+ Expr = expr;
+ type = expr.Type;
return this;
}
- e = ConvertImplicit (ec, Expr, TypeManager.int64_type, loc);
- if (e != null){
- Expr = e;
- type = e.Type;
+ expr = Convert.ImplicitConversion (ec, Expr, TypeManager.int64_type, loc);
+ if (expr != null){
+ Expr = expr;
+ type = expr.Type;
return this;
}
- e = ConvertImplicit (ec, Expr, TypeManager.double_type, loc);
- if (e != null){
- Expr = e;
- type = e.Type;
+ expr = Convert.ImplicitConversion (ec, Expr, TypeManager.double_type, loc);
+ if (expr != null){
+ Expr = expr;
+ type = expr.Type;
return this;
}
-
+
Error23 (expr_type);
return null;
}
- if (Oper == Operator.AddressOf){
- if (Expr.eclass != ExprClass.Variable){
- Error (211, loc, "Cannot take the address of non-variables");
- return null;
- }
-
- if (!ec.InUnsafe) {
- UnsafeError (loc);
- return null;
- }
-
- if (!TypeManager.VerifyUnManaged (Expr.Type, loc)){
- return null;
- }
-
- string ptr_type_name = Expr.Type.FullName + "*";
- type = TypeManager.LookupType (ptr_type_name);
-
- return this;
- }
-
- if (Oper == Operator.Indirection){
- if (!ec.InUnsafe){
- UnsafeError (loc);
- return null;
- }
-
- if (!expr_type.IsPointer){
- Report.Error (
- 193, loc,
- "The * or -> operator can only be applied to pointers");
- return null;
- }
-
- //
- // We create an Indirection expression, because
- // it can implement the IMemoryLocation.
- //
- return new Indirection (Expr);
- }
-
- Error (187, loc, "No such operator '" + OperName (Oper) + "' defined for type '" +
+ Error (187, "No such operator '" + OperName (Oper) + "' defined for type '" +
TypeManager.CSharpName (expr_type) + "'");
return null;
}
public override Expression DoResolve (EmitContext ec)
{
- Expr = Expr.Resolve (ec);
+ if (Oper == Operator.AddressOf)
+ Expr = Expr.ResolveLValue (ec, new EmptyExpression ());
+ else
+ Expr = Expr.Resolve (ec);
if (Expr == null)
return null;
@@ -470,18 +572,36 @@ namespace Mono.CSharp {
return ResolveOperator (ec);
}
+ public override Expression DoResolveLValue (EmitContext ec, Expression right)
+ {
+ if (Oper == Operator.Indirection)
+ return base.DoResolveLValue (ec, right);
+
+ Error (131, "The left-hand side of an assignment must be a " +
+ "variable, property or indexer");
+ return null;
+ }
+
public override void Emit (EmitContext ec)
{
ILGenerator ig = ec.ig;
- Type expr_type = Expr.Type;
switch (Oper) {
case Operator.UnaryPlus:
throw new Exception ("This should be caught by Resolve");
case Operator.UnaryNegation:
- Expr.Emit (ec);
- ig.Emit (OpCodes.Neg);
+ if (ec.CheckState) {
+ ig.Emit (OpCodes.Ldc_I4_0);
+ if (type == TypeManager.int64_type)
+ ig.Emit (OpCodes.Conv_U8);
+ Expr.Emit (ec);
+ ig.Emit (OpCodes.Sub_Ovf);
+ } else {
+ Expr.Emit (ec);
+ ig.Emit (OpCodes.Neg);
+ }
+
break;
case Operator.LogicalNot:
@@ -505,16 +625,12 @@ namespace Mono.CSharp {
}
}
- /// <summary>
- /// This will emit the child expression for `ec' avoiding the logical
- /// not. The parent will take care of changing brfalse/brtrue
- /// </summary>
- public void EmitLogicalNot (EmitContext ec)
+ public override void EmitBranchable (EmitContext ec, Label target, bool onTrue)
{
- if (Oper != Operator.LogicalNot)
- throw new Exception ("EmitLogicalNot can only be called with !expr");
-
- Expr.Emit (ec);
+ if (Oper == Operator.LogicalNot)
+ Expr.EmitBranchable (ec, target, !onTrue);
+ else
+ base.EmitBranchable (ec, target, onTrue);
}
public override string ToString ()
@@ -532,13 +648,14 @@ namespace Mono.CSharp {
public class Indirection : Expression, IMemoryLocation, IAssignMethod {
Expression expr;
LocalTemporary temporary;
- bool have_temporary;
+ bool prepared;
- public Indirection (Expression expr)
+ public Indirection (Expression expr, Location l)
{
this.expr = expr;
- this.type = expr.Type.GetElementType ();
+ this.type = TypeManager.GetElementType (expr.Type);
eclass = ExprClass.Variable;
+ loc = l;
}
void LoadExprValue (EmitContext ec)
@@ -547,54 +664,47 @@ namespace Mono.CSharp {
public override void Emit (EmitContext ec)
{
- ILGenerator ig = ec.ig;
-
- if (temporary != null){
- if (have_temporary){
- temporary.Emit (ec);
- return;
- }
- expr.Emit (ec);
- ec.ig.Emit (OpCodes.Dup);
- temporary.Store (ec);
- have_temporary = true;
- } else
+ if (!prepared)
expr.Emit (ec);
- LoadFromPtr (ig, Type);
+ LoadFromPtr (ec.ig, Type);
}
- public void EmitAssign (EmitContext ec, Expression source)
+ public void Emit (EmitContext ec, bool leave_copy)
{
- if (temporary != null){
- if (have_temporary){
- temporary.Emit (ec);
- return;
- }
- expr.Emit (ec);
+ Emit (ec);
+ if (leave_copy) {
ec.ig.Emit (OpCodes.Dup);
+ temporary = new LocalTemporary (ec, expr.Type);
temporary.Store (ec);
- have_temporary = true;
- } else
- expr.Emit (ec);
+ }
+ }
+
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
+ {
+ prepared = prepare_for_load;
+
+ expr.Emit (ec);
+ if (prepare_for_load)
+ ec.ig.Emit (OpCodes.Dup);
+
source.Emit (ec);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ temporary = new LocalTemporary (ec, expr.Type);
+ temporary.Store (ec);
+ }
+
StoreFromPtr (ec.ig, type);
+
+ if (temporary != null)
+ temporary.Emit (ec);
}
public void AddressOf (EmitContext ec, AddressOp Mode)
{
- if (temporary != null){
- if (have_temporary){
- temporary.Emit (ec);
- return;
- }
- expr.Emit (ec);
- ec.ig.Emit (OpCodes.Dup);
- temporary.Store (ec);
- have_temporary = true;
- } else
- expr.Emit (ec);
+ expr.Emit (ec);
}
public override Expression DoResolve (EmitContext ec)
@@ -604,10 +714,10 @@ namespace Mono.CSharp {
//
return this;
}
-
- public new void CacheTemporaries (EmitContext ec)
+
+ public override string ToString ()
{
- temporary = new LocalTemporary (ec, type);
+ return "*(" + expr + ")";
}
}
@@ -624,23 +734,31 @@ namespace Mono.CSharp {
/// for the common case, and one with the extra fields for more complex
/// classes (indexers require temporary access; overloaded require method)
///
- /// Maybe we should have classes PreIncrement, PostIncrement, PreDecrement,
- /// PostDecrement, that way we could save the `Mode' byte as well.
/// </remarks>
public class UnaryMutator : ExpressionStatement {
+ [Flags]
public enum Mode : byte {
- PreIncrement, PreDecrement, PostIncrement, PostDecrement
+ IsIncrement = 0,
+ IsDecrement = 1,
+ IsPre = 0,
+ IsPost = 2,
+
+ PreIncrement = 0,
+ PreDecrement = IsDecrement,
+ PostIncrement = IsPost,
+ PostDecrement = IsPost | IsDecrement
}
Mode mode;
- Location loc;
+ bool is_expr = false;
+ bool recurse = false;
+
Expression expr;
- LocalTemporary temp_storage;
//
// This is expensive for the simplest case.
//
- Expression method;
+ StaticCallExpr method;
public UnaryMutator (Mode m, Expression e, Location l)
{
@@ -657,8 +775,8 @@ namespace Mono.CSharp {
void Error23 (Type t)
{
- Report.Error (
- 23, loc, "Operator " + OperName (mode) +
+ Error (
+ 23, "Operator " + OperName (mode) +
" cannot be applied to operand of type `" +
TypeManager.CSharpName (t) + "'");
}
@@ -722,6 +840,9 @@ namespace Mono.CSharp {
//
type = expr_type;
if (expr.eclass == ExprClass.Variable){
+ LocalVariableReference var = expr as LocalVariableReference;
+ if ((var != null) && var.IsReadOnly)
+ Error (1604, "cannot assign to `" + var.Name + "' because it is readonly");
if (IsIncrementableNumber (expr_type) ||
expr_type == TypeManager.decimal_type){
return this;
@@ -729,9 +850,7 @@ namespace Mono.CSharp {
} else if (expr.eclass == ExprClass.IndexerAccess){
IndexerAccess ia = (IndexerAccess) expr;
- temp_storage = new LocalTemporary (ec, expr.Type);
-
- expr = ia.ResolveLValue (ec, temp_storage);
+ expr = ia.ResolveLValue (ec, this);
if (expr == null)
return null;
@@ -744,11 +863,11 @@ namespace Mono.CSharp {
return null;
} else {
- report118 (loc, expr, "variable, indexer or property access");
+ expr.Error_UnexpectedKind ("variable, indexer or property access", loc);
return null;
}
- Error (187, loc, "No such operator '" + OperName (mode) + "' defined for type '" +
+ Error (187, "No such operator '" + OperName (mode) + "' defined for type '" +
TypeManager.CSharpName (expr_type) + "'");
return null;
}
@@ -766,16 +885,23 @@ namespace Mono.CSharp {
static int PtrTypeSize (Type t)
{
- return GetTypeSize (t.GetElementType ());
+ return GetTypeSize (TypeManager.GetElementType (t));
}
//
- // Loads the proper "1" into the stack based on the type
+ // Loads the proper "1" into the stack based on the type, then it emits the
+ // opcode for the operation requested
//
- static void LoadOne (ILGenerator ig, Type t)
+ void LoadOneAndEmitOp (EmitContext ec, Type t)
{
+ //
+ // Measure if getting the typecode and using that is more/less efficient
+ // that comparing types. t.GetTypeCode() is an internal call.
+ //
+ ILGenerator ig = ec.ig;
+
if (t == TypeManager.uint64_type || t == TypeManager.int64_type)
- ig.Emit (OpCodes.Ldc_I8, 1L);
+ LongConstant.EmitLong (ig, 1);
else if (t == TypeManager.double_type)
ig.Emit (OpCodes.Ldc_R8, 1.0);
else if (t == TypeManager.float_type)
@@ -789,130 +915,92 @@ namespace Mono.CSharp {
IntConstant.EmitInt (ig, n);
} else
ig.Emit (OpCodes.Ldc_I4_1);
- }
-
-
- //
- // FIXME: We need some way of avoiding the use of temp_storage
- // for some types of storage (parameters, local variables,
- // static fields) and single-dimension array access.
- //
- void EmitCode (EmitContext ec, bool is_expr)
- {
- ILGenerator ig = ec.ig;
- IAssignMethod ia = (IAssignMethod) expr;
- Type expr_type = expr.Type;
-
- if (temp_storage == null)
- temp_storage = new LocalTemporary (ec, expr_type);
- ia.CacheTemporaries (ec);
- ig.Emit (OpCodes.Nop);
- switch (mode){
- case Mode.PreIncrement:
- case Mode.PreDecrement:
- if (method == null){
- expr.Emit (ec);
-
- LoadOne (ig, expr_type);
-
- //
- // Select the opcode based on the check state (then the type)
- // and the actual operation
- //
- if (ec.CheckState){
- if (expr_type == TypeManager.int32_type ||
- expr_type == TypeManager.int64_type){
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- } else if (expr_type == TypeManager.uint32_type ||
- expr_type == TypeManager.uint64_type){
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub_Ovf_Un);
- else
- ig.Emit (OpCodes.Add_Ovf_Un);
- } else {
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- }
- } else {
- if (mode == Mode.PreDecrement)
- ig.Emit (OpCodes.Sub);
- else
- ig.Emit (OpCodes.Add);
- }
- } else
- method.Emit (ec);
-
- temp_storage.Store (ec);
- ia.EmitAssign (ec, temp_storage);
- if (is_expr)
- temp_storage.Emit (ec);
- break;
-
- case Mode.PostIncrement:
- case Mode.PostDecrement:
- if (is_expr)
- expr.Emit (ec);
-
- if (method == null){
- if (!is_expr)
- expr.Emit (ec);
+ //
+ // Now emit the operation
+ //
+ if (ec.CheckState){
+ if (t == TypeManager.int32_type ||
+ t == TypeManager.int64_type){
+ if ((mode & Mode.IsDecrement) != 0)
+ ig.Emit (OpCodes.Sub_Ovf);
else
- ig.Emit (OpCodes.Dup);
-
- LoadOne (ig, expr_type);
-
- if (ec.CheckState){
- if (expr_type == TypeManager.int32_type ||
- expr_type == TypeManager.int64_type){
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- } else if (expr_type == TypeManager.uint32_type ||
- expr_type == TypeManager.uint64_type){
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub_Ovf_Un);
- else
- ig.Emit (OpCodes.Add_Ovf_Un);
- } else {
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub_Ovf);
- else
- ig.Emit (OpCodes.Add_Ovf);
- }
- } else {
- if (mode == Mode.PostDecrement)
- ig.Emit (OpCodes.Sub);
- else
- ig.Emit (OpCodes.Add);
- }
+ ig.Emit (OpCodes.Add_Ovf);
+ } else if (t == TypeManager.uint32_type ||
+ t == TypeManager.uint64_type){
+ if ((mode & Mode.IsDecrement) != 0)
+ ig.Emit (OpCodes.Sub_Ovf_Un);
+ else
+ ig.Emit (OpCodes.Add_Ovf_Un);
} else {
- method.Emit (ec);
+ if ((mode & Mode.IsDecrement) != 0)
+ ig.Emit (OpCodes.Sub_Ovf);
+ else
+ ig.Emit (OpCodes.Add_Ovf);
}
-
- temp_storage.Store (ec);
- ia.EmitAssign (ec, temp_storage);
- break;
+ } else {
+ if ((mode & Mode.IsDecrement) != 0)
+ ig.Emit (OpCodes.Sub);
+ else
+ ig.Emit (OpCodes.Add);
}
+
+ if (t == TypeManager.sbyte_type){
+ if (ec.CheckState)
+ ig.Emit (OpCodes.Conv_Ovf_I1);
+ else
+ ig.Emit (OpCodes.Conv_I1);
+ } else if (t == TypeManager.byte_type){
+ if (ec.CheckState)
+ ig.Emit (OpCodes.Conv_Ovf_U1);
+ else
+ ig.Emit (OpCodes.Conv_U1);
+ } else if (t == TypeManager.short_type){
+ if (ec.CheckState)
+ ig.Emit (OpCodes.Conv_Ovf_I2);
+ else
+ ig.Emit (OpCodes.Conv_I2);
+ } else if (t == TypeManager.ushort_type || t == TypeManager.char_type){
+ if (ec.CheckState)
+ ig.Emit (OpCodes.Conv_Ovf_U2);
+ else
+ ig.Emit (OpCodes.Conv_U2);
+ }
+
+ }
+
+ void EmitCode (EmitContext ec, bool is_expr)
+ {
+ recurse = true;
+ this.is_expr = is_expr;
+ ((IAssignMethod) expr).EmitAssign (ec, this, is_expr && (mode == Mode.PreIncrement || mode == Mode.PreDecrement), true);
}
+
public override void Emit (EmitContext ec)
{
- EmitCode (ec, true);
+ //
+ // We use recurse to allow ourselfs to be the source
+ // of an assignment. This little hack prevents us from
+ // having to allocate another expression
+ //
+ if (recurse) {
+ ((IAssignMethod) expr).Emit (ec, is_expr && (mode == Mode.PostIncrement || mode == Mode.PostDecrement));
+ if (method == null)
+ LoadOneAndEmitOp (ec, expr.Type);
+ else
+ ec.ig.Emit (OpCodes.Call, method.Method);
+ recurse = false;
+ return;
+ }
+ EmitCode (ec, true);
}
public override void EmitStatement (EmitContext ec)
{
EmitCode (ec, false);
}
-
}
/// <summary>
@@ -924,12 +1012,11 @@ namespace Mono.CSharp {
/// size.
/// </remarks>
public abstract class Probe : Expression {
- public readonly string ProbeType;
+ public Expression ProbeType;
protected Expression expr;
protected Type probe_type;
- protected Location loc;
- public Probe (Expression expr, string probe_type, Location l)
+ public Probe (Expression expr, Expression probe_type, Location l)
{
ProbeType = probe_type;
loc = l;
@@ -944,13 +1031,21 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- probe_type = RootContext.LookupType (ec.DeclSpace, ProbeType, false, loc);
-
- if (probe_type == null)
+ TypeExpr texpr = ProbeType.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
return null;
+ probe_type = texpr.ResolveType (ec);
+
+ CheckObsoleteAttribute (probe_type);
expr = expr.Resolve (ec);
+ if (expr == null)
+ return null;
+ if (expr.Type.IsPointer) {
+ Report.Error (244, loc, "\"is\" or \"as\" are not valid on pointer types");
+ return null;
+ }
return this;
}
}
@@ -959,7 +1054,7 @@ namespace Mono.CSharp {
/// Implementation of the `is' operator.
/// </summary>
public class Is : Probe {
- public Is (Expression expr, string probe_type, Location l)
+ public Is (Expression expr, Expression probe_type, Location l)
: base (expr, probe_type, l)
{
}
@@ -983,11 +1078,14 @@ namespace Mono.CSharp {
return;
case Action.AlwaysTrue:
ig.Emit (OpCodes.Pop);
- ig.Emit (OpCodes.Nop);
IntConstant.EmitInt (ig, 1);
return;
case Action.LeaveOnStack:
// the `e != null' rule.
+ ig.Emit (OpCodes.Ldnull);
+ ig.Emit (OpCodes.Ceq);
+ ig.Emit (OpCodes.Ldc_I4_0);
+ ig.Emit (OpCodes.Ceq);
return;
case Action.Probe:
ig.Emit (OpCodes.Isinst, probe_type);
@@ -997,12 +1095,41 @@ namespace Mono.CSharp {
}
throw new Exception ("never reached");
}
+
+ public override void EmitBranchable (EmitContext ec, Label target, bool onTrue)
+ {
+ ILGenerator ig = ec.ig;
+
+ switch (action){
+ case Action.AlwaysFalse:
+ if (! onTrue)
+ ig.Emit (OpCodes.Br, target);
+
+ return;
+ case Action.AlwaysTrue:
+ if (onTrue)
+ ig.Emit (OpCodes.Br, target);
+
+ return;
+ case Action.LeaveOnStack:
+ // the `e != null' rule.
+ expr.Emit (ec);
+ ig.Emit (onTrue ? OpCodes.Brtrue : OpCodes.Brfalse, target);
+ return;
+ case Action.Probe:
+ expr.Emit (ec);
+ ig.Emit (OpCodes.Isinst, probe_type);
+ ig.Emit (onTrue ? OpCodes.Brtrue : OpCodes.Brfalse, target);
+ return;
+ }
+ throw new Exception ("never reached");
+ }
public override Expression DoResolve (EmitContext ec)
{
Expression e = base.DoResolve (ec);
- if (e == null)
+ if ((e == null) || (expr == null))
return null;
Type etype = expr.Type;
@@ -1016,7 +1143,7 @@ namespace Mono.CSharp {
// First case, if at compile time, there is an implicit conversion
// then e != null (objects) or true (value types)
//
- e = ConvertImplicitStandard (ec, expr, probe_type, loc);
+ e = Convert.ImplicitConversionStandard (ec, expr, probe_type, loc);
if (e != null){
expr = e;
if (etype.IsValueType)
@@ -1025,7 +1152,7 @@ namespace Mono.CSharp {
action = Action.LeaveOnStack;
warning_always_matches = true;
- } else if (ExplicitReferenceConversionExists (etype, probe_type)){
+ } else if (Convert.ExplicitReferenceConversionExists (etype, probe_type)){
//
// Second case: explicit reference convresion
//
@@ -1038,19 +1165,11 @@ namespace Mono.CSharp {
warning_never_matches = true;
}
- if (RootContext.WarningLevel >= 1){
- if (warning_always_matches)
- Report.Warning (
- 183, loc,
- "The expression is always of type `" +
- TypeManager.CSharpName (probe_type) + "'");
- else if (warning_never_matches){
- if (!(probe_type.IsInterface || expr.Type.IsInterface))
- Report.Warning (
- 184, loc,
- "The expression is never of type `" +
- TypeManager.CSharpName (probe_type) + "'");
- }
+ if (warning_always_matches)
+ Warning (183, "The given expression is always of the provided ('{0}') type", TypeManager.CSharpName (probe_type));
+ else if (warning_never_matches){
+ if (!(probe_type.IsInterface || expr.Type.IsInterface))
+ Warning (184, "The given expression is never of the provided ('{0}') type", TypeManager.CSharpName (probe_type));
}
return this;
@@ -1061,7 +1180,7 @@ namespace Mono.CSharp {
/// Implementation of the `as' operator.
/// </summary>
public class As : Probe {
- public As (Expression expr, string probe_type, Location l)
+ public As (Expression expr, Expression probe_type, Location l)
: base (expr, probe_type, l)
{
}
@@ -1096,15 +1215,22 @@ namespace Mono.CSharp {
type = probe_type;
eclass = ExprClass.Value;
Type etype = expr.Type;
+
+ if (TypeManager.IsValueType (probe_type)){
+ Report.Error (77, loc, "The as operator should be used with a reference type only (" +
+ TypeManager.CSharpName (probe_type) + " is a value type)");
+ return null;
- e = ConvertImplicit (ec, expr, probe_type, loc);
+ }
+
+ e = Convert.ImplicitConversion (ec, expr, probe_type, loc);
if (e != null){
expr = e;
do_isinst = false;
return this;
}
- if (ExplicitReferenceConversionExists (etype, probe_type)){
+ if (Convert.ExplicitReferenceConversionExists (etype, probe_type)){
do_isinst = true;
return this;
}
@@ -1123,7 +1249,6 @@ namespace Mono.CSharp {
public class Cast : Expression {
Expression target_type;
Expression expr;
- Location loc;
public Cast (Expression cast_type, Expression expr, Location loc)
{
@@ -1147,16 +1272,68 @@ namespace Mono.CSharp {
}
}
+ bool CheckRange (EmitContext ec, long value, Type type, long min, long max)
+ {
+ if (!ec.ConstantCheckState)
+ return true;
+
+ if ((value < min) || (value > max)) {
+ Error (221, "Constant value `" + value + "' cannot be converted " +
+ "to a `" + TypeManager.CSharpName (type) + "' (use `unchecked' " +
+ "syntax to override)");
+ return false;
+ }
+
+ return true;
+ }
+
+ bool CheckRange (EmitContext ec, ulong value, Type type, ulong max)
+ {
+ if (!ec.ConstantCheckState)
+ return true;
+
+ if (value > max) {
+ Error (221, "Constant value `" + value + "' cannot be converted " +
+ "to a `" + TypeManager.CSharpName (type) + "' (use `unchecked' " +
+ "syntax to override)");
+ return false;
+ }
+
+ return true;
+ }
+
+ bool CheckUnsigned (EmitContext ec, long value, Type type)
+ {
+ if (!ec.ConstantCheckState)
+ return true;
+
+ if (value < 0) {
+ Error (221, "Constant value `" + value + "' cannot be converted " +
+ "to a `" + TypeManager.CSharpName (type) + "' (use `unchecked' " +
+ "syntax to override)");
+ return false;
+ }
+
+ return true;
+ }
+
/// <summary>
/// Attempts to do a compile-time folding of a constant cast.
/// </summary>
Expression TryReduce (EmitContext ec, Type target_type)
{
- if (expr is ByteConstant){
- byte v = ((ByteConstant) expr).Value;
+ Expression real_expr = expr;
+ if (real_expr is EnumConstant)
+ real_expr = ((EnumConstant) real_expr).Child;
+
+ if (real_expr is ByteConstant){
+ byte v = ((ByteConstant) real_expr).Value;
- if (target_type == TypeManager.sbyte_type)
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, SByte.MinValue, SByte.MaxValue))
+ return null;
return new SByteConstant ((sbyte) v);
+ }
if (target_type == TypeManager.short_type)
return new ShortConstant ((short) v);
if (target_type == TypeManager.ushort_type)
@@ -1175,64 +1352,110 @@ namespace Mono.CSharp {
return new DoubleConstant ((double) v);
if (target_type == TypeManager.char_type)
return new CharConstant ((char) v);
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is SByteConstant){
- sbyte v = ((SByteConstant) expr).Value;
+ if (real_expr is SByteConstant){
+ sbyte v = ((SByteConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new ByteConstant ((byte) v);
+ }
if (target_type == TypeManager.short_type)
return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
+ if (target_type == TypeManager.ushort_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
+ } if (target_type == TypeManager.int32_type)
return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
+ if (target_type == TypeManager.uint32_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
+ } if (target_type == TypeManager.int64_type)
return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
+ if (target_type == TypeManager.uint64_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new ULongConstant ((ulong) v);
+ }
if (target_type == TypeManager.float_type)
return new FloatConstant ((float) v);
if (target_type == TypeManager.double_type)
return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
+ if (target_type == TypeManager.char_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is ShortConstant){
- short v = ((ShortConstant) expr).Value;
+ if (real_expr is ShortConstant){
+ short v = ((ShortConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckRange (ec, v, target_type, Byte.MinValue, Byte.MaxValue))
+ return null;
return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
+ }
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, SByte.MinValue, SByte.MaxValue))
+ return null;
return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.ushort_type)
+ }
+ if (target_type == TypeManager.ushort_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new UShortConstant ((ushort) v);
+ }
if (target_type == TypeManager.int32_type)
return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
+ if (target_type == TypeManager.uint32_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new UIntConstant ((uint) v);
+ }
if (target_type == TypeManager.int64_type)
return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
+ if (target_type == TypeManager.uint64_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new ULongConstant ((ulong) v);
+ }
if (target_type == TypeManager.float_type)
return new FloatConstant ((float) v);
if (target_type == TypeManager.double_type)
return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
+ if (target_type == TypeManager.char_type) {
+ if (!CheckRange (ec, v, target_type, Char.MinValue, Char.MaxValue))
+ return null;
return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is UShortConstant){
- ushort v = ((UShortConstant) expr).Value;
+ if (real_expr is UShortConstant){
+ ushort v = ((UShortConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckRange (ec, v, target_type, Byte.MinValue, Byte.MaxValue))
+ return null;
return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
+ }
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, SByte.MinValue, SByte.MaxValue))
+ return null;
return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
+ }
+ if (target_type == TypeManager.short_type) {
+ if (!CheckRange (ec, v, target_type, Int16.MinValue, Int16.MaxValue))
+ return null;
return new ShortConstant ((short) v);
+ }
if (target_type == TypeManager.int32_type)
return new IntConstant ((int) v);
if (target_type == TypeManager.uint32_type)
@@ -1245,46 +1468,89 @@ namespace Mono.CSharp {
return new FloatConstant ((float) v);
if (target_type == TypeManager.double_type)
return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
+ if (target_type == TypeManager.char_type) {
+ if (!CheckRange (ec, v, target_type, Char.MinValue, Char.MaxValue))
+ return null;
return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is IntConstant){
- int v = ((IntConstant) expr).Value;
+ if (real_expr is IntConstant){
+ int v = ((IntConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckRange (ec, v, target_type, Byte.MinValue, Byte.MaxValue))
+ return null;
return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
+ }
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, SByte.MinValue, SByte.MaxValue))
+ return null;
return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
+ }
+ if (target_type == TypeManager.short_type) {
+ if (!CheckRange (ec, v, target_type, Int16.MinValue, Int16.MaxValue))
+ return null;
return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
+ }
+ if (target_type == TypeManager.ushort_type) {
+ if (!CheckRange (ec, v, target_type, UInt16.MinValue, UInt16.MaxValue))
+ return null;
return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.uint32_type)
+ }
+ if (target_type == TypeManager.uint32_type) {
+ if (!CheckRange (ec, v, target_type, Int32.MinValue, Int32.MaxValue))
+ return null;
return new UIntConstant ((uint) v);
+ }
if (target_type == TypeManager.int64_type)
return new LongConstant ((long) v);
- if (target_type == TypeManager.uint64_type)
+ if (target_type == TypeManager.uint64_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new ULongConstant ((ulong) v);
+ }
if (target_type == TypeManager.float_type)
return new FloatConstant ((float) v);
if (target_type == TypeManager.double_type)
return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
+ if (target_type == TypeManager.char_type) {
+ if (!CheckRange (ec, v, target_type, Char.MinValue, Char.MaxValue))
+ return null;
return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is UIntConstant){
- uint v = ((UIntConstant) expr).Value;
+ if (real_expr is UIntConstant){
+ uint v = ((UIntConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckRange (ec, v, target_type, Char.MinValue, Char.MaxValue))
+ return null;
return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
+ }
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, SByte.MinValue, SByte.MaxValue))
+ return null;
return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
+ }
+ if (target_type == TypeManager.short_type) {
+ if (!CheckRange (ec, v, target_type, Int16.MinValue, Int16.MaxValue))
+ return null;
return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
+ }
+ if (target_type == TypeManager.ushort_type) {
+ if (!CheckRange (ec, v, target_type, UInt16.MinValue, UInt16.MaxValue))
+ return null;
return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
+ }
+ if (target_type == TypeManager.int32_type) {
+ if (!CheckRange (ec, v, target_type, Int32.MinValue, Int32.MaxValue))
+ return null;
return new IntConstant ((int) v);
+ }
if (target_type == TypeManager.int64_type)
return new LongConstant ((long) v);
if (target_type == TypeManager.uint64_type)
@@ -1293,59 +1559,116 @@ namespace Mono.CSharp {
return new FloatConstant ((float) v);
if (target_type == TypeManager.double_type)
return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
+ if (target_type == TypeManager.char_type) {
+ if (!CheckRange (ec, v, target_type, Char.MinValue, Char.MaxValue))
+ return null;
return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is LongConstant){
- long v = ((LongConstant) expr).Value;
+ if (real_expr is LongConstant){
+ long v = ((LongConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckRange (ec, v, target_type, Byte.MinValue, Byte.MaxValue))
+ return null;
return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
+ }
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, SByte.MinValue, SByte.MaxValue))
+ return null;
return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
+ }
+ if (target_type == TypeManager.short_type) {
+ if (!CheckRange (ec, v, target_type, Int16.MinValue, Int16.MaxValue))
+ return null;
return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
+ }
+ if (target_type == TypeManager.ushort_type) {
+ if (!CheckRange (ec, v, target_type, UInt16.MinValue, UInt16.MaxValue))
+ return null;
return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
+ }
+ if (target_type == TypeManager.int32_type) {
+ if (!CheckRange (ec, v, target_type, Int32.MinValue, Int32.MaxValue))
+ return null;
return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
+ }
+ if (target_type == TypeManager.uint32_type) {
+ if (!CheckRange (ec, v, target_type, UInt32.MinValue, UInt32.MaxValue))
+ return null;
return new UIntConstant ((uint) v);
- if (target_type == TypeManager.uint64_type)
+ }
+ if (target_type == TypeManager.uint64_type) {
+ if (!CheckUnsigned (ec, v, target_type))
+ return null;
return new ULongConstant ((ulong) v);
+ }
if (target_type == TypeManager.float_type)
return new FloatConstant ((float) v);
if (target_type == TypeManager.double_type)
return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
+ if (target_type == TypeManager.char_type) {
+ if (!CheckRange (ec, v, target_type, Char.MinValue, Char.MaxValue))
+ return null;
return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is ULongConstant){
- ulong v = ((ULongConstant) expr).Value;
+ if (real_expr is ULongConstant){
+ ulong v = ((ULongConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckRange (ec, v, target_type, Byte.MaxValue))
+ return null;
return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
+ }
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, (ulong) SByte.MaxValue))
+ return null;
return new SByteConstant ((sbyte) v);
- if (target_type == TypeManager.short_type)
+ }
+ if (target_type == TypeManager.short_type) {
+ if (!CheckRange (ec, v, target_type, (ulong) Int16.MaxValue))
+ return null;
return new ShortConstant ((short) v);
- if (target_type == TypeManager.ushort_type)
+ }
+ if (target_type == TypeManager.ushort_type) {
+ if (!CheckRange (ec, v, target_type, UInt16.MaxValue))
+ return null;
return new UShortConstant ((ushort) v);
- if (target_type == TypeManager.int32_type)
+ }
+ if (target_type == TypeManager.int32_type) {
+ if (!CheckRange (ec, v, target_type, Int32.MaxValue))
+ return null;
return new IntConstant ((int) v);
- if (target_type == TypeManager.uint32_type)
+ }
+ if (target_type == TypeManager.uint32_type) {
+ if (!CheckRange (ec, v, target_type, UInt32.MaxValue))
+ return null;
return new UIntConstant ((uint) v);
- if (target_type == TypeManager.int64_type)
+ }
+ if (target_type == TypeManager.int64_type) {
+ if (!CheckRange (ec, v, target_type, (ulong) Int64.MaxValue))
+ return null;
return new LongConstant ((long) v);
+ }
if (target_type == TypeManager.float_type)
return new FloatConstant ((float) v);
if (target_type == TypeManager.double_type)
return new DoubleConstant ((double) v);
- if (target_type == TypeManager.char_type)
+ if (target_type == TypeManager.char_type) {
+ if (!CheckRange (ec, v, target_type, Char.MaxValue))
+ return null;
return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is FloatConstant){
- float v = ((FloatConstant) expr).Value;
+ if (real_expr is FloatConstant){
+ float v = ((FloatConstant) real_expr).Value;
if (target_type == TypeManager.byte_type)
return new ByteConstant ((byte) v);
@@ -1367,13 +1690,15 @@ namespace Mono.CSharp {
return new DoubleConstant ((double) v);
if (target_type == TypeManager.char_type)
return new CharConstant ((char) v);
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
- if (expr is DoubleConstant){
- double v = ((DoubleConstant) expr).Value;
+ if (real_expr is DoubleConstant){
+ double v = ((DoubleConstant) real_expr).Value;
- if (target_type == TypeManager.byte_type)
+ if (target_type == TypeManager.byte_type){
return new ByteConstant ((byte) v);
- if (target_type == TypeManager.sbyte_type)
+ } if (target_type == TypeManager.sbyte_type)
return new SByteConstant ((sbyte) v);
if (target_type == TypeManager.short_type)
return new ShortConstant ((short) v);
@@ -1391,6 +1716,47 @@ namespace Mono.CSharp {
return new FloatConstant ((float) v);
if (target_type == TypeManager.char_type)
return new CharConstant ((char) v);
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
+ }
+
+ if (real_expr is CharConstant){
+ char v = ((CharConstant) real_expr).Value;
+
+ if (target_type == TypeManager.byte_type) {
+ if (!CheckRange (ec, v, target_type, Byte.MinValue, Byte.MaxValue))
+ return null;
+ return new ByteConstant ((byte) v);
+ }
+ if (target_type == TypeManager.sbyte_type) {
+ if (!CheckRange (ec, v, target_type, SByte.MinValue, SByte.MaxValue))
+ return null;
+ return new SByteConstant ((sbyte) v);
+ }
+ if (target_type == TypeManager.short_type) {
+ if (!CheckRange (ec, v, target_type, Int16.MinValue, Int16.MaxValue))
+ return null;
+ return new ShortConstant ((short) v);
+ }
+ if (target_type == TypeManager.int32_type)
+ return new IntConstant ((int) v);
+ if (target_type == TypeManager.uint32_type)
+ return new UIntConstant ((uint) v);
+ if (target_type == TypeManager.int64_type)
+ return new LongConstant ((long) v);
+ if (target_type == TypeManager.uint64_type)
+ return new ULongConstant ((ulong) v);
+ if (target_type == TypeManager.float_type)
+ return new FloatConstant ((float) v);
+ if (target_type == TypeManager.double_type)
+ return new DoubleConstant ((double) v);
+ if (target_type == TypeManager.char_type) {
+ if (!CheckRange (ec, v, target_type, Char.MinValue, Char.MaxValue))
+ return null;
+ return new CharConstant ((char) v);
+ }
+ if (target_type == TypeManager.decimal_type)
+ return new DecimalConstant ((decimal) v);
}
return null;
@@ -1402,26 +1768,20 @@ namespace Mono.CSharp {
if (expr == null)
return null;
- bool old_state = ec.OnlyLookupTypes;
- ec.OnlyLookupTypes = true;
- target_type = target_type.Resolve (ec);
- ec.OnlyLookupTypes = old_state;
-
- if (target_type == null){
- Report.Error (-10, loc, "Can not resolve type");
+ TypeExpr target = target_type.ResolveAsTypeTerminal (ec, false);
+ if (target == null)
return null;
- }
- if (target_type.eclass != ExprClass.Type){
- report118 (loc, target_type, "class");
+ type = target.ResolveType (ec);
+
+ CheckObsoleteAttribute (type);
+
+ if (type.IsAbstract && type.IsSealed) {
+ Report.Error (716, loc, "Cannot convert to static type '{0}'", TypeManager.CSharpName (type));
return null;
}
-
- type = target_type.Type;
+
eclass = ExprClass.Value;
-
- if (type == null)
- return null;
if (expr is Constant){
Expression e = TryReduce (ec, type);
@@ -1429,8 +1789,12 @@ namespace Mono.CSharp {
if (e != null)
return e;
}
-
- expr = ConvertExplicit (ec, expr, type, loc);
+
+ if (type.IsPointer && !ec.InUnsafe) {
+ UnsafeError (loc);
+ return null;
+ }
+ expr = Convert.ExplicitConversion (ec, expr, type, loc);
return expr;
}
@@ -1464,20 +1828,9 @@ namespace Mono.CSharp {
Operator oper;
Expression left, right;
- //
- // After resolution, method might contain the operator overload
- // method.
- //
- protected MethodBase method;
- ArrayList Arguments;
-
- Location loc;
-
- bool DelegateOperation;
-
// This must be kept in sync with Operator!!!
- static string [] oper_names;
-
+ public static readonly string [] oper_names;
+
static Binary ()
{
oper_names = new string [(int) Operator.TOP];
@@ -1596,7 +1949,7 @@ namespace Mono.CSharp {
if (expr.Type == target_type)
return expr;
- return ConvertImplicit (ec, expr, target_type, new Location (-1));
+ return Convert.ImplicitConversion (ec, expr, target_type, loc);
}
public static void Error_OperatorAmbiguous (Location loc, Operator oper, Type l, Type r)
@@ -1609,34 +1962,55 @@ namespace Mono.CSharp {
+ "'");
}
+ bool IsOfType (EmitContext ec, Type l, Type r, Type t, bool check_user_conversions)
+ {
+ if ((l == t) || (r == t))
+ return true;
+
+ if (!check_user_conversions)
+ return false;
+
+ if (Convert.ImplicitUserConversionExists (ec, l, t))
+ return true;
+ else if (Convert.ImplicitUserConversionExists (ec, r, t))
+ return true;
+ else
+ return false;
+ }
+
//
// Note that handling the case l == Decimal || r == Decimal
// is taken care of by the Step 1 Operator Overload resolution.
//
- bool DoNumericPromotions (EmitContext ec, Type l, Type r)
- {
- if (l == TypeManager.double_type || r == TypeManager.double_type){
+ // If `check_user_conv' is true, we also check whether a user-defined conversion
+ // exists. Note that we only need to do this if both arguments are of a user-defined
+ // type, otherwise ConvertImplict() already finds the user-defined conversion for us,
+ // so we don't explicitly check for performance reasons.
+ //
+ bool DoNumericPromotions (EmitContext ec, Type l, Type r, bool check_user_conv)
+ {
+ if (IsOfType (ec, l, r, TypeManager.double_type, check_user_conv)){
//
// If either operand is of type double, the other operand is
// conveted to type double.
//
if (r != TypeManager.double_type)
- right = ConvertImplicit (ec, right, TypeManager.double_type, loc);
+ right = Convert.ImplicitConversion (ec, right, TypeManager.double_type, loc);
if (l != TypeManager.double_type)
- left = ConvertImplicit (ec, left, TypeManager.double_type, loc);
+ left = Convert.ImplicitConversion (ec, left, TypeManager.double_type, loc);
type = TypeManager.double_type;
- } else if (l == TypeManager.float_type || r == TypeManager.float_type){
+ } else if (IsOfType (ec, l, r, TypeManager.float_type, check_user_conv)){
//
// if either operand is of type float, the other operand is
// converted to type float.
//
if (r != TypeManager.double_type)
- right = ConvertImplicit (ec, right, TypeManager.float_type, loc);
+ right = Convert.ImplicitConversion (ec, right, TypeManager.float_type, loc);
if (l != TypeManager.double_type)
- left = ConvertImplicit (ec, left, TypeManager.float_type, loc);
+ left = Convert.ImplicitConversion (ec, left, TypeManager.float_type, loc);
type = TypeManager.float_type;
- } else if (l == TypeManager.uint64_type || r == TypeManager.uint64_type){
+ } else if (IsOfType (ec, l, r, TypeManager.uint64_type, check_user_conv)){
Expression e;
Type other;
//
@@ -1649,16 +2023,16 @@ namespace Mono.CSharp {
if (right is IntConstant){
IntConstant ic = (IntConstant) right;
- e = TryImplicitIntConversion (l, ic);
+ e = Convert.TryImplicitIntConversion (l, ic);
if (e != null)
right = e;
} else if (right is LongConstant){
long ll = ((LongConstant) right).Value;
- if (ll > 0)
+ if (ll >= 0)
right = new ULongConstant ((ulong) ll);
} else {
- e = ImplicitNumericConversion (ec, right, l, loc);
+ e = Convert.ImplicitNumericConversion (ec, right, l, loc);
if (e != null)
right = e;
}
@@ -1666,7 +2040,7 @@ namespace Mono.CSharp {
other = right.Type;
} else {
if (left is IntConstant){
- e = TryImplicitIntConversion (r, (IntConstant) left);
+ e = Convert.TryImplicitIntConversion (r, (IntConstant) left);
if (e != null)
left = e;
} else if (left is LongConstant){
@@ -1675,7 +2049,7 @@ namespace Mono.CSharp {
if (ll > 0)
left = new ULongConstant ((ulong) ll);
} else {
- e = ImplicitNumericConversion (ec, left, r, loc);
+ e = Convert.ImplicitNumericConversion (ec, left, r, loc);
if (e != null)
left = e;
}
@@ -1687,23 +2061,27 @@ namespace Mono.CSharp {
(other == TypeManager.int32_type) ||
(other == TypeManager.int64_type))
Error_OperatorAmbiguous (loc, oper, l, r);
+ else {
+ left = ForceConversion (ec, left, TypeManager.uint64_type);
+ right = ForceConversion (ec, right, TypeManager.uint64_type);
+ }
type = TypeManager.uint64_type;
- } else if (l == TypeManager.int64_type || r == TypeManager.int64_type){
+ } else if (IsOfType (ec, l, r, TypeManager.int64_type, check_user_conv)){
//
// If either operand is of type long, the other operand is converted
// to type long.
//
if (l != TypeManager.int64_type)
- left = ConvertImplicit (ec, left, TypeManager.int64_type, loc);
+ left = Convert.ImplicitConversion (ec, left, TypeManager.int64_type, loc);
if (r != TypeManager.int64_type)
- right = ConvertImplicit (ec, right, TypeManager.int64_type, loc);
-
+ right = Convert.ImplicitConversion (ec, right, TypeManager.int64_type, loc);
+
type = TypeManager.int64_type;
- } else if (l == TypeManager.uint32_type || r == TypeManager.uint32_type){
+ } else if (IsOfType (ec, l, r, TypeManager.uint32_type, check_user_conv)){
//
// If either operand is of type uint, and the other
// operand is of type sbyte, short or int, othe operands are
- // converted to type long.
+ // converted to type long (unless we have an int constant).
//
Type other = null;
@@ -1712,24 +2090,24 @@ namespace Mono.CSharp {
IntConstant ic = (IntConstant) right;
int val = ic.Value;
- if (val >= 0)
+ if (val >= 0){
right = new UIntConstant ((uint) val);
-
- type = l;
- return true;
+ type = l;
+
+ return true;
+ }
}
other = r;
- }
- else if (r == TypeManager.uint32_type){
+ } else if (r == TypeManager.uint32_type){
if (left is IntConstant){
IntConstant ic = (IntConstant) left;
int val = ic.Value;
- if (val >= 0)
+ if (val >= 0){
left = new UIntConstant ((uint) val);
-
- type = r;
- return true;
+ type = r;
+ return true;
+ }
}
other = l;
@@ -1752,34 +2130,24 @@ namespace Mono.CSharp {
}
} else if (l == TypeManager.decimal_type || r == TypeManager.decimal_type){
if (l != TypeManager.decimal_type)
- left = ConvertImplicit (ec, left, TypeManager.decimal_type, loc);
- if (r != TypeManager.decimal_type)
- right = ConvertImplicit (ec, right, TypeManager.decimal_type, loc);
+ left = Convert.ImplicitConversion (ec, left, TypeManager.decimal_type, loc);
+ if (r != TypeManager.decimal_type)
+ right = Convert.ImplicitConversion (ec, right, TypeManager.decimal_type, loc);
type = TypeManager.decimal_type;
} else {
- Expression l_tmp, r_tmp;
+ left = ForceConversion (ec, left, TypeManager.int32_type);
+ right = ForceConversion (ec, right, TypeManager.int32_type);
- l_tmp = ForceConversion (ec, left, TypeManager.int32_type);
- if (l_tmp == null)
- return false;
-
- r_tmp = ForceConversion (ec, right, TypeManager.int32_type);
- if (r_tmp == null)
- return false;
-
- left = l_tmp;
- right = r_tmp;
-
type = TypeManager.int32_type;
}
- return true;
+ return (left != null) && (right != null);
}
static public void Error_OperatorCannotBeApplied (Location loc, string name, Type l, Type r)
{
- Error (19, loc,
+ Report.Error (19, loc,
"Operator " + name + " cannot be applied to operands of type `" +
TypeManager.CSharpName (l) + "' and `" +
TypeManager.CSharpName (r) + "'");
@@ -1790,17 +2158,46 @@ namespace Mono.CSharp {
Error_OperatorCannotBeApplied (loc, OperName (oper), left.Type, right.Type);
}
- static bool is_32_or_64 (Type t)
+ static bool is_unsigned (Type t)
{
- return (t == TypeManager.int32_type || t == TypeManager.uint32_type ||
- t == TypeManager.int64_type || t == TypeManager.uint64_type);
+ return (t == TypeManager.uint32_type || t == TypeManager.uint64_type ||
+ t == TypeManager.short_type || t == TypeManager.byte_type);
+ }
+
+ static bool is_user_defined (Type t)
+ {
+ if (t.IsSubclassOf (TypeManager.value_type) &&
+ (!TypeManager.IsBuiltinType (t) || t == TypeManager.decimal_type))
+ return true;
+ else
+ return false;
+ }
+
+ Expression Make32or64 (EmitContext ec, Expression e)
+ {
+ Type t= e.Type;
+
+ if (t == TypeManager.int32_type || t == TypeManager.uint32_type ||
+ t == TypeManager.int64_type || t == TypeManager.uint64_type)
+ return e;
+ Expression ee = Convert.ImplicitConversion (ec, e, TypeManager.int32_type, loc);
+ if (ee != null)
+ return ee;
+ ee = Convert.ImplicitConversion (ec, e, TypeManager.uint32_type, loc);
+ if (ee != null)
+ return ee;
+ ee = Convert.ImplicitConversion (ec, e, TypeManager.int64_type, loc);
+ if (ee != null)
+ return ee;
+ ee = Convert.ImplicitConversion (ec, e, TypeManager.uint64_type, loc);
+ if (ee != null)
+ return ee;
+ return null;
}
Expression CheckShiftArguments (EmitContext ec)
{
Expression e;
- Type l = left.Type;
- Type r = right.Type;
e = ForceConversion (ec, right, TypeManager.int32_type);
if (e == null){
@@ -1809,13 +2206,21 @@ namespace Mono.CSharp {
}
right = e;
- if (((e = ConvertImplicit (ec, left, TypeManager.int32_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.uint32_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.int64_type, loc)) != null) ||
- ((e = ConvertImplicit (ec, left, TypeManager.uint64_type, loc)) != null)){
+ if (((e = Convert.ImplicitConversion (ec, left, TypeManager.int32_type, loc)) != null) ||
+ ((e = Convert.ImplicitConversion (ec, left, TypeManager.uint32_type, loc)) != null) ||
+ ((e = Convert.ImplicitConversion (ec, left, TypeManager.int64_type, loc)) != null) ||
+ ((e = Convert.ImplicitConversion (ec, left, TypeManager.uint64_type, loc)) != null)){
left = e;
type = e.Type;
+ if (type == TypeManager.int32_type || type == TypeManager.uint32_type){
+ right = new Binary (Binary.Operator.BitwiseAnd, right, new IntLiteral (31), loc);
+ right = right.DoResolve (ec);
+ } else {
+ right = new Binary (Binary.Operator.BitwiseAnd, right, new IntLiteral (63), loc);
+ right = right.DoResolve (ec);
+ }
+
return this;
}
Error_OperatorCannotBeApplied ();
@@ -1827,44 +2232,62 @@ namespace Mono.CSharp {
Type l = left.Type;
Type r = right.Type;
- bool overload_failed = false;
-
//
- // Step 1: Perform Operator Overload location
+ // Special cases: string comapred to null
//
- Expression left_expr, right_expr;
-
- string op = oper_names [(int) oper];
-
- MethodGroupExpr union;
- left_expr = MemberLookup (ec, l, op, MemberTypes.Method, AllBindingFlags, loc);
- if (r != l){
- right_expr = MemberLookup (
- ec, r, op, MemberTypes.Method, AllBindingFlags, loc);
- union = Invocation.MakeUnionSet (left_expr, right_expr, loc);
- } else
- union = (MethodGroupExpr) left_expr;
-
- if (union != null) {
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
+ if (oper == Operator.Equality || oper == Operator.Inequality){
+ if ((!TypeManager.IsValueType (l) && (right is NullLiteral)) ||
+ (!TypeManager.IsValueType (r) && (left is NullLiteral))) {
+ Type = TypeManager.bool_type;
+
+ return this;
+ }
- method = Invocation.OverloadResolve (ec, union, Arguments, Location.Null);
- if (method != null) {
- MethodInfo mi = (MethodInfo) method;
+ // IntPtr equality
+ if (l == TypeManager.intptr_type && r == TypeManager.intptr_type) {
+ Type = TypeManager.bool_type;
- type = mi.ReturnType;
return this;
- } else {
- overload_failed = true;
}
- }
-
+ }
+
//
- // Step 2: Default operations on CLI native types.
+ // Do not perform operator overload resolution when both sides are
+ // built-in types
//
+ if (!(TypeManager.IsCLRType (l) && TypeManager.IsCLRType (r))){
+ //
+ // Step 1: Perform Operator Overload location
+ //
+ Expression left_expr, right_expr;
+
+ string op = oper_names [(int) oper];
+
+ MethodGroupExpr union;
+ left_expr = MemberLookup (ec, l, op, MemberTypes.Method, AllBindingFlags, loc);
+ if (r != l){
+ right_expr = MemberLookup (
+ ec, r, op, MemberTypes.Method, AllBindingFlags, loc);
+ union = Invocation.MakeUnionSet (left_expr, right_expr, loc);
+ } else
+ union = (MethodGroupExpr) left_expr;
+
+ if (union != null) {
+ ArrayList args = new ArrayList (2);
+ args.Add (new Argument (left, Argument.AType.Expression));
+ args.Add (new Argument (right, Argument.AType.Expression));
+
+ MethodBase method = Invocation.OverloadResolve (
+ ec, union, args, true, Location.Null);
+ if (method != null) {
+ MethodInfo mi = (MethodInfo) method;
+
+ return new BinaryMethod (mi.ReturnType, method, args);
+ }
+ }
+ }
+
//
// Step 0: String concatenation (because overloading will get this wrong)
//
@@ -1873,55 +2296,35 @@ namespace Mono.CSharp {
// If any of the arguments is a string, cast to string
//
- if (l == TypeManager.string_type){
-
- if (r == TypeManager.void_type) {
+ // Simple constant folding
+ if (left is StringConstant && right is StringConstant)
+ return new StringConstant (((StringConstant) left).Value + ((StringConstant) right).Value);
+
+ if (l == TypeManager.string_type || r == TypeManager.string_type) {
+
+ if (r == TypeManager.void_type || l == TypeManager.void_type) {
Error_OperatorCannotBeApplied ();
return null;
}
- if (r == TypeManager.string_type){
- if (left is Constant && right is Constant){
- StringConstant ls = (StringConstant) left;
- StringConstant rs = (StringConstant) right;
-
- return new StringConstant (
- ls.Value + rs.Value);
- }
-
- // string + string
- method = TypeManager.string_concat_string_string;
- } else {
- // string + object
- method = TypeManager.string_concat_object_object;
- right = ConvertImplicit (ec, right,
- TypeManager.object_type, loc);
- }
- type = TypeManager.string_type;
-
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- return this;
-
- } else if (r == TypeManager.string_type){
- // object + string
+ // try to fold it in on the left
+ if (left is StringConcat) {
- if (l == TypeManager.void_type) {
- Error_OperatorCannotBeApplied ();
- return null;
+ //
+ // We have to test here for not-null, since we can be doubly-resolved
+ // take care of not appending twice
+ //
+ if (type == null){
+ type = TypeManager.string_type;
+ ((StringConcat) left).Append (ec, right);
+ return left.Resolve (ec);
+ } else {
+ return left;
+ }
}
- method = TypeManager.string_concat_object_object;
- left = ConvertImplicit (ec, left, TypeManager.object_type, loc);
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- type = TypeManager.string_type;
-
- return this;
+ // Otherwise, start a new concat expression
+ return new StringConcat (ec, loc, left, right).Resolve (ec);
}
//
@@ -1971,8 +2374,8 @@ namespace Mono.CSharp {
//
// Also, a standard conversion must exist from either one
//
- if (!(StandardConversionExists (left, r) ||
- StandardConversionExists (right, l))){
+ if (!(Convert.ImplicitStandardConversionExists (ec, left, r) ||
+ Convert.ImplicitStandardConversionExists (ec, right, l))){
Error_OperatorCannotBeApplied ();
return null;
}
@@ -1989,29 +2392,54 @@ namespace Mono.CSharp {
//
return this;
}
+
+ //
+ // One of them is a valuetype, but the other one is not.
+ //
+ if (!l.IsValueType || !r.IsValueType) {
+ Error_OperatorCannotBeApplied ();
+ return null;
+ }
}
// Only perform numeric promotions on:
// +, -, *, /, %, &, |, ^, ==, !=, <, >, <=, >=
//
if (oper == Operator.Addition || oper == Operator.Subtraction) {
- if (l.IsSubclassOf (TypeManager.delegate_type) &&
- r.IsSubclassOf (TypeManager.delegate_type)) {
-
- Arguments = new ArrayList ();
- Arguments.Add (new Argument (left, Argument.AType.Expression));
- Arguments.Add (new Argument (right, Argument.AType.Expression));
-
- if (oper == Operator.Addition)
- method = TypeManager.delegate_combine_delegate_delegate;
- else
- method = TypeManager.delegate_remove_delegate_delegate;
+ if (l.IsSubclassOf (TypeManager.delegate_type)){
+ if (((right.eclass == ExprClass.MethodGroup) ||
+ (r == TypeManager.anonymous_method_type))){
+ if ((RootContext.Version != LanguageVersion.ISO_1)){
+ Expression tmp = Convert.ImplicitConversionRequired (ec, right, l, loc);
+ if (tmp == null)
+ return null;
+ right = tmp;
+ r = right.Type;
+ }
+ }
- DelegateOperation = true;
- type = l;
- return this;
+ if (r.IsSubclassOf (TypeManager.delegate_type)){
+ MethodInfo method;
+ ArrayList args = new ArrayList (2);
+
+ args = new ArrayList (2);
+ args.Add (new Argument (left, Argument.AType.Expression));
+ args.Add (new Argument (right, Argument.AType.Expression));
+
+ if (oper == Operator.Addition)
+ method = TypeManager.delegate_combine_delegate_delegate;
+ else
+ method = TypeManager.delegate_remove_delegate_delegate;
+
+ if (l != r) {
+ Error_OperatorCannotBeApplied ();
+ return null;
+ }
+
+ return new BinaryDelegate (l, method, args);
+ }
}
-
+
//
// Pointer arithmetic:
//
@@ -2036,13 +2464,18 @@ namespace Mono.CSharp {
if (r.IsPointer && oper == Operator.Subtraction){
if (r == l)
return new PointerArithmetic (
- false, left, right, TypeManager.int64_type);
- } else if (is_32_or_64 (r))
- return new PointerArithmetic (
- oper == Operator.Addition, left, right, l);
- } else if (r.IsPointer && is_32_or_64 (l) && oper == Operator.Addition)
- return new PointerArithmetic (
- true, right, left, r);
+ false, left, right, TypeManager.int64_type,
+ loc).Resolve (ec);
+ } else {
+ Expression t = Make32or64 (ec, right);
+ if (t != null)
+ return new PointerArithmetic (oper == Operator.Addition, left, t, l, loc).Resolve (ec);
+ }
+ } else if (r.IsPointer && oper == Operator.Addition){
+ Expression t = Make32or64 (ec, left);
+ if (t != null)
+ return new PointerArithmetic (true, right, t, r, loc).Resolve (ec);
+ }
}
//
@@ -2053,21 +2486,38 @@ namespace Mono.CSharp {
if (lie || rie){
Expression temp;
- //
- // operator + (E e, U x)
- //
- if (oper == Operator.Addition){
- if (lie && rie){
+ // U operator - (E e, E f)
+ if (lie && rie){
+ if (oper == Operator.Subtraction){
+ if (l == r){
+ type = TypeManager.EnumToUnderlying (l);
+ return this;
+ }
Error_OperatorCannotBeApplied ();
return null;
}
-
+ }
+
+ //
+ // operator + (E e, U x)
+ // operator - (E e, U x)
+ //
+ if (oper == Operator.Addition || oper == Operator.Subtraction){
Type enum_type = lie ? l : r;
Type other_type = lie ? r : l;
Type underlying_type = TypeManager.EnumToUnderlying (enum_type);
-;
if (underlying_type != other_type){
+ temp = Convert.ImplicitConversion (ec, lie ? right : left, underlying_type, loc);
+ if (temp != null){
+ if (lie)
+ right = temp;
+ else
+ left = temp;
+ type = enum_type;
+ return this;
+ }
+
Error_OperatorCannotBeApplied ();
return null;
}
@@ -2077,20 +2527,31 @@ namespace Mono.CSharp {
}
if (!rie){
- temp = ConvertImplicit (ec, right, l, loc);
+ temp = Convert.ImplicitConversion (ec, right, l, loc);
if (temp != null)
right = temp;
+ else {
+ Error_OperatorCannotBeApplied ();
+ return null;
+ }
} if (!lie){
- temp = ConvertImplicit (ec, left, r, loc);
+ temp = Convert.ImplicitConversion (ec, left, r, loc);
if (temp != null){
left = temp;
l = r;
+ } else {
+ Error_OperatorCannotBeApplied ();
+ return null;
}
}
-
+
if (oper == Operator.Equality || oper == Operator.Inequality ||
oper == Operator.LessThanOrEqual || oper == Operator.LessThan ||
oper == Operator.GreaterThanOrEqual || oper == Operator.GreaterThan){
+ if (left.Type != right.Type){
+ Error_OperatorCannotBeApplied ();
+ return null;
+ }
type = TypeManager.bool_type;
return this;
}
@@ -2101,6 +2562,7 @@ namespace Mono.CSharp {
type = l;
return this;
}
+ Error_OperatorCannotBeApplied ();
return null;
}
@@ -2108,13 +2570,19 @@ namespace Mono.CSharp {
return CheckShiftArguments (ec);
if (oper == Operator.LogicalOr || oper == Operator.LogicalAnd){
- if (l != TypeManager.bool_type || r != TypeManager.bool_type){
+ if (l == TypeManager.bool_type && r == TypeManager.bool_type) {
+ type = TypeManager.bool_type;
+ return this;
+ }
+
+ if (l != r) {
Error_OperatorCannotBeApplied ();
return null;
}
- type = TypeManager.bool_type;
- return this;
+ Expression e = new ConditionalLogicalOperator (
+ oper == Operator.LogicalAnd, left, right, l, loc);
+ return e.Resolve (ec);
}
//
@@ -2144,21 +2612,15 @@ namespace Mono.CSharp {
}
//
- // We are dealing with numbers
+ // This will leave left or right set to null if there is an error
//
- if (overload_failed){
- Error_OperatorCannotBeApplied ();
+ bool check_user_conv = is_user_defined (l) && is_user_defined (r);
+ DoNumericPromotions (ec, l, r, check_user_conv);
+ if (left == null || right == null){
+ Error_OperatorCannotBeApplied (loc, OperName (oper), l, r);
return null;
}
- if (!DoNumericPromotions (ec, l, r)){
- Error_OperatorCannotBeApplied ();
- return null;
- }
-
- if (left == null || right == null)
- return null;
-
//
// reload our cached types if required
//
@@ -2169,11 +2631,17 @@ namespace Mono.CSharp {
oper == Operator.BitwiseOr ||
oper == Operator.ExclusiveOr){
if (l == r){
- if (!((l == TypeManager.int32_type) ||
- (l == TypeManager.uint32_type) ||
- (l == TypeManager.int64_type) ||
- (l == TypeManager.uint64_type)))
+ if (((l == TypeManager.int32_type) ||
+ (l == TypeManager.uint32_type) ||
+ (l == TypeManager.short_type) ||
+ (l == TypeManager.ushort_type) ||
+ (l == TypeManager.int64_type) ||
+ (l == TypeManager.uint64_type))){
type = l;
+ } else {
+ Error_OperatorCannotBeApplied ();
+ return null;
+ }
} else {
Error_OperatorCannotBeApplied ();
return null;
@@ -2194,198 +2662,248 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- left = left.Resolve (ec);
+ if ((oper == Operator.Subtraction) && (left is ParenthesizedExpression)) {
+ left = ((ParenthesizedExpression) left).Expr;
+ left = left.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.Type);
+ if (left == null)
+ return null;
+
+ if (left.eclass == ExprClass.Type) {
+ Error (75, "Casting a negative value needs to have the value in parentheses.");
+ return null;
+ }
+ } else
+ left = left.Resolve (ec);
right = right.Resolve (ec);
if (left == null || right == null)
return null;
- if (left.Type == null)
- throw new Exception (
- "Resolve returned non null, but did not set the type! (" +
- left + ") at Line: " + loc.Row);
- if (right.Type == null)
- throw new Exception (
- "Resolve returned non null, but did not set the type! (" +
- right + ") at Line: "+ loc.Row);
-
eclass = ExprClass.Value;
- if (left is Constant && right is Constant){
+ Constant rc = right as Constant;
+ Constant lc = left as Constant;
+
+ if (rc != null & lc != null){
Expression e = ConstantFold.BinaryFold (
- ec, oper, (Constant) left, (Constant) right, loc);
- if (e != null)
- return e;
+ ec, oper, lc, rc, loc);
+ if (e != null)
+ return e;
}
return ResolveOperator (ec);
}
- public bool IsBranchable ()
- {
- if (oper == Operator.Equality ||
- oper == Operator.Inequality ||
- oper == Operator.LessThan ||
- oper == Operator.GreaterThan ||
- oper == Operator.LessThanOrEqual ||
- oper == Operator.GreaterThanOrEqual){
- return true;
- } else
- return false;
- }
-
- /// <summary>
- /// This entry point is used by routines that might want
- /// to emit a brfalse/brtrue after an expression, and instead
- /// they could use a more compact notation.
- ///
- /// Typically the code would generate l.emit/r.emit, followed
- /// by the comparission and then a brtrue/brfalse. The comparissions
- /// are sometimes inneficient (there are not as complete as the branches
- /// look for the hacks in Emit using double ceqs).
+ /// <remarks>
+ /// EmitBranchable is called from Statement.EmitBoolExpression in the
+ /// context of a conditional bool expression. This function will return
+ /// false if it is was possible to use EmitBranchable, or true if it was.
///
- /// So for those cases we provide EmitBranchable that can emit the
- /// branch with the test
- /// </summary>
- public void EmitBranchable (EmitContext ec, int target)
+ /// The expression's code is generated, and we will generate a branch to `target'
+ /// if the resulting expression value is equal to isTrue
+ /// </remarks>
+ public override void EmitBranchable (EmitContext ec, Label target, bool onTrue)
{
- OpCode opcode;
- bool close_target = false;
ILGenerator ig = ec.ig;
-
+
//
- // short-circuit operators
+ // This is more complicated than it looks, but its just to avoid
+ // duplicated tests: basically, we allow ==, !=, >, <, >= and <=
+ // but on top of that we want for == and != to use a special path
+ // if we are comparing against null
//
- if (oper == Operator.LogicalAnd){
- left.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- right.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
+ if ((oper == Operator.Equality || oper == Operator.Inequality) && (left is Constant || right is Constant)) {
+ bool my_on_true = oper == Operator.Inequality ? onTrue : !onTrue;
+
+ //
+ // put the constant on the rhs, for simplicity
+ //
+ if (left is Constant) {
+ Expression swap = right;
+ right = left;
+ left = swap;
+ }
+
+ if (((Constant) right).IsZeroInteger) {
+ left.Emit (ec);
+ if (my_on_true)
+ ig.Emit (OpCodes.Brtrue, target);
+ else
+ ig.Emit (OpCodes.Brfalse, target);
+
+ return;
+ } else if (right is BoolConstant) {
+ left.Emit (ec);
+ if (my_on_true != ((BoolConstant) right).Value)
+ ig.Emit (OpCodes.Brtrue, target);
+ else
+ ig.Emit (OpCodes.Brfalse, target);
+
+ return;
+ }
+
+ } else if (oper == Operator.LogicalAnd) {
+
+ if (onTrue) {
+ Label tests_end = ig.DefineLabel ();
+
+ left.EmitBranchable (ec, tests_end, false);
+ right.EmitBranchable (ec, target, true);
+ ig.MarkLabel (tests_end);
+ } else {
+ left.EmitBranchable (ec, target, false);
+ right.EmitBranchable (ec, target, false);
+ }
+
+ return;
+
} else if (oper == Operator.LogicalOr){
- left.Emit (ec);
- ig.Emit (OpCodes.Brtrue, target);
- right.Emit (ec);
- ig.Emit (OpCodes.Brfalse, target);
- }
+ if (onTrue) {
+ left.EmitBranchable (ec, target, true);
+ right.EmitBranchable (ec, target, true);
+
+ } else {
+ Label tests_end = ig.DefineLabel ();
+ left.EmitBranchable (ec, tests_end, true);
+ right.EmitBranchable (ec, target, false);
+ ig.MarkLabel (tests_end);
+ }
+
+ return;
+ } else if (!(oper == Operator.LessThan || oper == Operator.GreaterThan ||
+ oper == Operator.LessThanOrEqual || oper == Operator.GreaterThanOrEqual ||
+ oper == Operator.Equality || oper == Operator.Inequality)) {
+ base.EmitBranchable (ec, target, onTrue);
+ return;
+ }
+
left.Emit (ec);
right.Emit (ec);
+
+ Type t = left.Type;
+ bool isUnsigned = is_unsigned (t) || t == TypeManager.double_type || t == TypeManager.float_type;
switch (oper){
case Operator.Equality:
- if (close_target)
- opcode = OpCodes.Beq_S;
+ if (onTrue)
+ ig.Emit (OpCodes.Beq, target);
else
- opcode = OpCodes.Beq;
+ ig.Emit (OpCodes.Bne_Un, target);
break;
case Operator.Inequality:
- if (close_target)
- opcode = OpCodes.Bne_Un_S;
+ if (onTrue)
+ ig.Emit (OpCodes.Bne_Un, target);
else
- opcode = OpCodes.Bne_Un;
+ ig.Emit (OpCodes.Beq, target);
break;
case Operator.LessThan:
- if (close_target)
- opcode = OpCodes.Blt_S;
+ if (onTrue)
+ if (isUnsigned)
+ ig.Emit (OpCodes.Blt_Un, target);
+ else
+ ig.Emit (OpCodes.Blt, target);
else
- opcode = OpCodes.Blt;
+ if (isUnsigned)
+ ig.Emit (OpCodes.Bge_Un, target);
+ else
+ ig.Emit (OpCodes.Bge, target);
break;
case Operator.GreaterThan:
- if (close_target)
- opcode = OpCodes.Bgt_S;
+ if (onTrue)
+ if (isUnsigned)
+ ig.Emit (OpCodes.Bgt_Un, target);
+ else
+ ig.Emit (OpCodes.Bgt, target);
else
- opcode = OpCodes.Bgt;
+ if (isUnsigned)
+ ig.Emit (OpCodes.Ble_Un, target);
+ else
+ ig.Emit (OpCodes.Ble, target);
break;
case Operator.LessThanOrEqual:
- if (close_target)
- opcode = OpCodes.Ble_S;
+ if (onTrue)
+ if (isUnsigned)
+ ig.Emit (OpCodes.Ble_Un, target);
+ else
+ ig.Emit (OpCodes.Ble, target);
else
- opcode = OpCodes.Ble;
+ if (isUnsigned)
+ ig.Emit (OpCodes.Bgt_Un, target);
+ else
+ ig.Emit (OpCodes.Bgt, target);
break;
+
case Operator.GreaterThanOrEqual:
- if (close_target)
- opcode = OpCodes.Bge_S;
+ if (onTrue)
+ if (isUnsigned)
+ ig.Emit (OpCodes.Bge_Un, target);
+ else
+ ig.Emit (OpCodes.Bge, target);
else
- opcode = OpCodes.Ble;
+ if (isUnsigned)
+ ig.Emit (OpCodes.Blt_Un, target);
+ else
+ ig.Emit (OpCodes.Blt, target);
break;
-
default:
- throw new Exception ("EmitBranchable called on non-EmitBranchable operator: "
- + oper.ToString ());
+ Console.WriteLine (oper);
+ throw new Exception ("what is THAT");
}
-
- ig.Emit (opcode, target);
}
public override void Emit (EmitContext ec)
{
ILGenerator ig = ec.ig;
Type l = left.Type;
- Type r = right.Type;
OpCode opcode;
- if (method != null) {
-
- // Note that operators are static anyway
-
- if (Arguments != null)
- Invocation.EmitArguments (ec, method, Arguments);
-
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
-
- if (DelegateOperation)
- ig.Emit (OpCodes.Castclass, type);
-
- return;
- }
-
//
// Handle short-circuit operators differently
// than the rest
//
- if (oper == Operator.LogicalAnd){
+ if (oper == Operator.LogicalAnd) {
Label load_zero = ig.DefineLabel ();
Label end = ig.DefineLabel ();
-
- left.Emit (ec);
- ig.Emit (OpCodes.Brfalse, load_zero);
+
+ left.EmitBranchable (ec, load_zero, false);
right.Emit (ec);
ig.Emit (OpCodes.Br, end);
+
ig.MarkLabel (load_zero);
ig.Emit (OpCodes.Ldc_I4_0);
ig.MarkLabel (end);
return;
- } else if (oper == Operator.LogicalOr){
+ } else if (oper == Operator.LogicalOr) {
Label load_one = ig.DefineLabel ();
Label end = ig.DefineLabel ();
-
- left.Emit (ec);
- ig.Emit (OpCodes.Brtrue, load_one);
+
+ left.EmitBranchable (ec, load_one, true);
right.Emit (ec);
ig.Emit (OpCodes.Br, end);
+
ig.MarkLabel (load_one);
ig.Emit (OpCodes.Ldc_I4_1);
ig.MarkLabel (end);
return;
}
-
+
left.Emit (ec);
right.Emit (ec);
+ bool isUnsigned = is_unsigned (left.Type);
+
switch (oper){
case Operator.Multiply:
if (ec.CheckState){
if (l == TypeManager.int32_type || l == TypeManager.int64_type)
opcode = OpCodes.Mul_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
+ else if (isUnsigned)
opcode = OpCodes.Mul_Ovf_Un;
else
opcode = OpCodes.Mul;
@@ -2395,14 +2913,14 @@ namespace Mono.CSharp {
break;
case Operator.Division:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
+ if (isUnsigned)
opcode = OpCodes.Div_Un;
else
opcode = OpCodes.Div;
break;
case Operator.Modulus:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
+ if (isUnsigned)
opcode = OpCodes.Rem_Un;
else
opcode = OpCodes.Rem;
@@ -2412,7 +2930,7 @@ namespace Mono.CSharp {
if (ec.CheckState){
if (l == TypeManager.int32_type || l == TypeManager.int64_type)
opcode = OpCodes.Add_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
+ else if (isUnsigned)
opcode = OpCodes.Add_Ovf_Un;
else
opcode = OpCodes.Add;
@@ -2424,7 +2942,7 @@ namespace Mono.CSharp {
if (ec.CheckState){
if (l == TypeManager.int32_type || l == TypeManager.int64_type)
opcode = OpCodes.Sub_Ovf;
- else if (l==TypeManager.uint32_type || l==TypeManager.uint64_type)
+ else if (isUnsigned)
opcode = OpCodes.Sub_Ovf_Un;
else
opcode = OpCodes.Sub;
@@ -2433,7 +2951,7 @@ namespace Mono.CSharp {
break;
case Operator.RightShift:
- if (l == TypeManager.uint32_type || l == TypeManager.uint64_type)
+ if (isUnsigned)
opcode = OpCodes.Shr_Un;
else
opcode = OpCodes.Shr;
@@ -2448,32 +2966,49 @@ namespace Mono.CSharp {
break;
case Operator.Inequality:
- ec.ig.Emit (OpCodes.Ceq);
- ec.ig.Emit (OpCodes.Ldc_I4_0);
+ ig.Emit (OpCodes.Ceq);
+ ig.Emit (OpCodes.Ldc_I4_0);
opcode = OpCodes.Ceq;
break;
case Operator.LessThan:
- opcode = OpCodes.Clt;
+ if (isUnsigned)
+ opcode = OpCodes.Clt_Un;
+ else
+ opcode = OpCodes.Clt;
break;
case Operator.GreaterThan:
- opcode = OpCodes.Cgt;
+ if (isUnsigned)
+ opcode = OpCodes.Cgt_Un;
+ else
+ opcode = OpCodes.Cgt;
break;
case Operator.LessThanOrEqual:
- ec.ig.Emit (OpCodes.Cgt);
- ec.ig.Emit (OpCodes.Ldc_I4_0);
+ Type lt = left.Type;
+
+ if (isUnsigned || (lt == TypeManager.double_type || lt == TypeManager.float_type))
+ ig.Emit (OpCodes.Cgt_Un);
+ else
+ ig.Emit (OpCodes.Cgt);
+ ig.Emit (OpCodes.Ldc_I4_0);
opcode = OpCodes.Ceq;
break;
case Operator.GreaterThanOrEqual:
- ec.ig.Emit (OpCodes.Clt);
- ec.ig.Emit (OpCodes.Ldc_I4_1);
+ Type le = left.Type;
+
+ if (isUnsigned || (le == TypeManager.double_type || le == TypeManager.float_type))
+ ig.Emit (OpCodes.Clt_Un);
+ else
+ ig.Emit (OpCodes.Clt);
- opcode = OpCodes.Sub;
+ ig.Emit (OpCodes.Ldc_I4_0);
+
+ opcode = OpCodes.Ceq;
break;
case Operator.BitwiseOr:
@@ -2495,11 +3030,303 @@ namespace Mono.CSharp {
ig.Emit (opcode);
}
+ }
+
+ //
+ // Object created by Binary when the binary operator uses an method instead of being
+ // a binary operation that maps to a CIL binary operation.
+ //
+ public class BinaryMethod : Expression {
+ public MethodBase method;
+ public ArrayList Arguments;
+
+ public BinaryMethod (Type t, MethodBase m, ArrayList args)
+ {
+ method = m;
+ Arguments = args;
+ type = t;
+ eclass = ExprClass.Value;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ if (Arguments != null)
+ Invocation.EmitArguments (ec, method, Arguments, false, null);
+
+ if (method is MethodInfo)
+ ig.Emit (OpCodes.Call, (MethodInfo) method);
+ else
+ ig.Emit (OpCodes.Call, (ConstructorInfo) method);
+ }
+ }
+
+ //
+ // Represents the operation a + b [+ c [+ d [+ ...]]], where a is a string
+ // b, c, d... may be strings or objects.
+ //
+ public class StringConcat : Expression {
+ ArrayList operands;
+ bool invalid = false;
+ bool emit_conv_done = false;
+ //
+ // Are we also concating objects?
+ //
+ bool is_strings_only = true;
+
+ public StringConcat (EmitContext ec, Location loc, Expression left, Expression right)
+ {
+ this.loc = loc;
+ type = TypeManager.string_type;
+ eclass = ExprClass.Value;
+
+ operands = new ArrayList (2);
+ Append (ec, left);
+ Append (ec, right);
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ if (invalid)
+ return null;
+
+ return this;
+ }
+
+ public void Append (EmitContext ec, Expression operand)
+ {
+ //
+ // Constant folding
+ //
+ if (operand is StringConstant && operands.Count != 0) {
+ StringConstant last_operand = operands [operands.Count - 1] as StringConstant;
+ if (last_operand != null) {
+ operands [operands.Count - 1] = new StringConstant (last_operand.Value + ((StringConstant) operand).Value);
+ return;
+ }
+ }
+
+ //
+ // Conversion to object
+ //
+ if (operand.Type != TypeManager.string_type) {
+ Expression no = Convert.ImplicitConversion (ec, operand, TypeManager.object_type, loc);
+
+ if (no == null) {
+ Binary.Error_OperatorCannotBeApplied (loc, "+", TypeManager.string_type, operand.Type);
+ invalid = true;
+ }
+ operand = no;
+ }
+
+ operands.Add (operand);
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ MethodInfo concat_method = null;
+
+ //
+ // Do conversion to arguments; check for strings only
+ //
+
+ // This can get called multiple times, so we have to deal with that.
+ if (!emit_conv_done) {
+ emit_conv_done = true;
+ for (int i = 0; i < operands.Count; i ++) {
+ Expression e = (Expression) operands [i];
+ is_strings_only &= e.Type == TypeManager.string_type;
+ }
+
+ for (int i = 0; i < operands.Count; i ++) {
+ Expression e = (Expression) operands [i];
+
+ if (! is_strings_only && e.Type == TypeManager.string_type) {
+ // need to make sure this is an object, because the EmitParams
+ // method might look at the type of this expression, see it is a
+ // string and emit a string [] when we want an object [];
+
+ e = new EmptyCast (e, TypeManager.object_type);
+ }
+ operands [i] = new Argument (e, Argument.AType.Expression);
+ }
+ }
+
+ //
+ // Find the right method
+ //
+ switch (operands.Count) {
+ case 1:
+ //
+ // This should not be possible, because simple constant folding
+ // is taken care of in the Binary code.
+ //
+ throw new Exception ("how did you get here?");
+
+ case 2:
+ concat_method = is_strings_only ?
+ TypeManager.string_concat_string_string :
+ TypeManager.string_concat_object_object ;
+ break;
+ case 3:
+ concat_method = is_strings_only ?
+ TypeManager.string_concat_string_string_string :
+ TypeManager.string_concat_object_object_object ;
+ break;
+ case 4:
+ //
+ // There is not a 4 param overlaod for object (the one that there is
+ // is actually a varargs methods, and is only in corlib because it was
+ // introduced there before.).
+ //
+ if (!is_strings_only)
+ goto default;
+
+ concat_method = TypeManager.string_concat_string_string_string_string;
+ break;
+ default:
+ concat_method = is_strings_only ?
+ TypeManager.string_concat_string_dot_dot_dot :
+ TypeManager.string_concat_object_dot_dot_dot ;
+ break;
+ }
+
+ Invocation.EmitArguments (ec, concat_method, operands, false, null);
+ ec.ig.Emit (OpCodes.Call, concat_method);
+ }
+ }
+
+ //
+ // Object created with +/= on delegates
+ //
+ public class BinaryDelegate : Expression {
+ MethodInfo method;
+ ArrayList args;
+
+ public BinaryDelegate (Type t, MethodInfo mi, ArrayList args)
+ {
+ method = mi;
+ this.args = args;
+ type = t;
+ eclass = ExprClass.Value;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ Invocation.EmitArguments (ec, method, args, false, null);
+
+ ig.Emit (OpCodes.Call, (MethodInfo) method);
+ ig.Emit (OpCodes.Castclass, type);
+ }
+
+ public Expression Right {
+ get {
+ Argument arg = (Argument) args [1];
+ return arg.Expr;
+ }
+ }
- public bool IsBuiltinOperator {
+ public bool IsAddition {
get {
- return method == null;
+ return method == TypeManager.delegate_combine_delegate_delegate;
+ }
+ }
+ }
+
+ //
+ // User-defined conditional logical operator
+ public class ConditionalLogicalOperator : Expression {
+ Expression left, right;
+ bool is_and;
+
+ public ConditionalLogicalOperator (bool is_and, Expression left, Expression right, Type t, Location loc)
+ {
+ type = t;
+ eclass = ExprClass.Value;
+ this.loc = loc;
+ this.left = left;
+ this.right = right;
+ this.is_and = is_and;
+ }
+
+ protected void Error19 ()
+ {
+ Binary.Error_OperatorCannotBeApplied (loc, is_and ? "&&" : "||", type, type);
+ }
+
+ protected void Error218 ()
+ {
+ Error (218, "The type ('" + TypeManager.CSharpName (type) + "') must contain " +
+ "declarations of operator true and operator false");
+ }
+
+ Expression op_true, op_false, op;
+ LocalTemporary left_temp;
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ MethodInfo method;
+ Expression operator_group;
+
+ operator_group = MethodLookup (ec, type, is_and ? "op_BitwiseAnd" : "op_BitwiseOr", loc);
+ if (operator_group == null) {
+ Error19 ();
+ return null;
+ }
+
+ left_temp = new LocalTemporary (ec, type);
+
+ ArrayList arguments = new ArrayList ();
+ arguments.Add (new Argument (left_temp, Argument.AType.Expression));
+ arguments.Add (new Argument (right, Argument.AType.Expression));
+ method = Invocation.OverloadResolve (
+ ec, (MethodGroupExpr) operator_group, arguments, false, loc)
+ as MethodInfo;
+ if ((method == null) || (method.ReturnType != type)) {
+ Error19 ();
+ return null;
+ }
+
+ op = new StaticCallExpr (method, arguments, loc);
+
+ op_true = GetOperatorTrue (ec, left_temp, loc);
+ op_false = GetOperatorFalse (ec, left_temp, loc);
+ if ((op_true == null) || (op_false == null)) {
+ Error218 ();
+ return null;
}
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+ Label false_target = ig.DefineLabel ();
+ Label end_target = ig.DefineLabel ();
+
+ left.Emit (ec);
+ left_temp.Store (ec);
+
+ (is_and ? op_false : op_true).EmitBranchable (ec, false_target, false);
+ left_temp.Emit (ec);
+ ig.Emit (OpCodes.Br, end_target);
+ ig.MarkLabel (false_target);
+ op.Emit (ec);
+ ig.MarkLabel (end_target);
}
}
@@ -2510,10 +3337,10 @@ namespace Mono.CSharp {
//
// We assume that `l' is always a pointer
//
- public PointerArithmetic (bool is_addition, Expression l, Expression r, Type t)
+ public PointerArithmetic (bool is_addition, Expression l, Expression r, Type t, Location loc)
{
type = t;
- eclass = ExprClass.Variable;
+ this.loc = loc;
left = l;
right = r;
is_add = is_addition;
@@ -2521,9 +3348,13 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- //
- // We are born fully resolved
- //
+ eclass = ExprClass.Variable;
+
+ if (left.Type == TypeManager.void_ptr_type) {
+ Error (242, "The operation in question is undefined on void pointers");
+ return null;
+ }
+
return this;
}
@@ -2531,9 +3362,11 @@ namespace Mono.CSharp {
{
Type op_type = left.Type;
ILGenerator ig = ec.ig;
- int size = GetTypeSize (op_type.GetElementType ());
+ Type element = TypeManager.GetElementType (op_type);
+ int size = GetTypeSize (element);
+ Type rtype = right.Type;
- if (right.Type.IsPointer){
+ if (rtype.IsPointer){
//
// handle (pointer - pointer)
//
@@ -2543,7 +3376,7 @@ namespace Mono.CSharp {
if (size != 1){
if (size == 0)
- ig.Emit (OpCodes.Sizeof, op_type);
+ ig.Emit (OpCodes.Sizeof, element);
else
IntLiteral.EmitInt (ig, size);
ig.Emit (OpCodes.Div);
@@ -2558,11 +3391,19 @@ namespace Mono.CSharp {
right.Emit (ec);
if (size != 1){
if (size == 0)
- ig.Emit (OpCodes.Sizeof, op_type);
+ ig.Emit (OpCodes.Sizeof, element);
else
IntLiteral.EmitInt (ig, size);
+ if (rtype == TypeManager.int64_type)
+ ig.Emit (OpCodes.Conv_I8);
+ else if (rtype == TypeManager.uint64_type)
+ ig.Emit (OpCodes.Conv_U8);
ig.Emit (OpCodes.Mul);
}
+
+ if (rtype == TypeManager.int64_type || rtype == TypeManager.uint64_type)
+ ig.Emit (OpCodes.Conv_I);
+
if (is_add)
ig.Emit (OpCodes.Add);
else
@@ -2572,11 +3413,10 @@ namespace Mono.CSharp {
}
/// <summary>
- /// Implements the ternary conditiona operator (?:)
+ /// Implements the ternary conditional operator (?:)
/// </summary>
public class Conditional : Expression {
Expression expr, trueExpr, falseExpr;
- Location loc;
public Conditional (Expression expr, Expression trueExpr, Expression falseExpr, Location l)
{
@@ -2608,16 +3448,26 @@ namespace Mono.CSharp {
{
expr = expr.Resolve (ec);
- if (expr.Type != TypeManager.bool_type)
- expr = Expression.ConvertImplicitRequired (
- ec, expr, TypeManager.bool_type, loc);
+ if (expr == null)
+ return null;
+
+ if (expr.Type != TypeManager.bool_type){
+ expr = Expression.ResolveBoolean (
+ ec, expr, loc);
+
+ if (expr == null)
+ return null;
+ }
trueExpr = trueExpr.Resolve (ec);
falseExpr = falseExpr.Resolve (ec);
- if (expr == null || trueExpr == null || falseExpr == null)
+ if (trueExpr == null || falseExpr == null)
return null;
+ if ((trueExpr is NullLiteral) && (falseExpr is NullLiteral))
+ return trueExpr;
+
eclass = ExprClass.Value;
if (trueExpr.Type == falseExpr.Type)
type = trueExpr.Type;
@@ -2626,39 +3476,30 @@ namespace Mono.CSharp {
Type true_type = trueExpr.Type;
Type false_type = falseExpr.Type;
- if (trueExpr is NullLiteral){
- type = false_type;
- return this;
- } else if (falseExpr is NullLiteral){
- type = true_type;
- return this;
- }
-
//
// First, if an implicit conversion exists from trueExpr
// to falseExpr, then the result type is of type falseExpr.Type
//
- conv = ConvertImplicit (ec, trueExpr, false_type, loc);
+ conv = Convert.ImplicitConversion (ec, trueExpr, false_type, loc);
if (conv != null){
//
// Check if both can convert implicitl to each other's type
//
- if (ConvertImplicit (ec, falseExpr, true_type, loc) != null){
- Report.Error (
- 172, loc,
- "Can not compute type of conditional expression " +
- "as `" + TypeManager.CSharpName (trueExpr.Type) +
- "' and `" + TypeManager.CSharpName (falseExpr.Type) +
- "' convert implicitly to each other");
+ if (Convert.ImplicitConversion (ec, falseExpr, true_type, loc) != null){
+ Error (172,
+ "Can not compute type of conditional expression " +
+ "as `" + TypeManager.CSharpName (trueExpr.Type) +
+ "' and `" + TypeManager.CSharpName (falseExpr.Type) +
+ "' convert implicitly to each other");
return null;
}
type = false_type;
trueExpr = conv;
- } else if ((conv = ConvertImplicit(ec, falseExpr, true_type,loc))!= null){
+ } else if ((conv = Convert.ImplicitConversion(ec, falseExpr, true_type,loc))!= null){
type = true_type;
falseExpr = conv;
} else {
- Error (173, loc, "The type of the conditional expression can " +
+ Error (173, "The type of the conditional expression can " +
"not be computed because there is no implicit conversion" +
" from `" + TypeManager.CSharpName (trueExpr.Type) + "'" +
" and `" + TypeManager.CSharpName (falseExpr.Type) + "'");
@@ -2684,8 +3525,7 @@ namespace Mono.CSharp {
Label false_target = ig.DefineLabel ();
Label end_target = ig.DefineLabel ();
- expr.Emit (ec);
- ig.Emit (OpCodes.Brfalse, false_target);
+ expr.EmitBranchable (ec, false_target, false);
trueExpr.Emit (ec);
ig.Emit (OpCodes.Br, end_target);
ig.MarkLabel (false_target);
@@ -2698,11 +3538,13 @@ namespace Mono.CSharp {
/// <summary>
/// Local variables
/// </summary>
- public class LocalVariableReference : Expression, IAssignMethod, IMemoryLocation {
+ public class LocalVariableReference : Expression, IAssignMethod, IMemoryLocation, IVariable {
public readonly string Name;
public readonly Block Block;
- Location loc;
- VariableInfo variable_info;
+ public LocalInfo local_info;
+ bool is_readonly;
+ bool prepared;
+ LocalTemporary temp;
public LocalVariableReference (Block block, string name, Location l)
{
@@ -2712,84 +3554,185 @@ namespace Mono.CSharp {
eclass = ExprClass.Variable;
}
+ //
+ // Setting `is_readonly' to false will allow you to create a writable
+ // reference to a read-only variable. This is used by foreach and using.
+ //
+ public LocalVariableReference (Block block, string name, Location l,
+ LocalInfo local_info, bool is_readonly)
+ : this (block, name, l)
+ {
+ this.local_info = local_info;
+ this.is_readonly = is_readonly;
+ }
+
public VariableInfo VariableInfo {
get {
- if (variable_info == null)
- variable_info = Block.GetVariableInfo (Name);
- return variable_info;
+ return local_info.VariableInfo;
}
}
-
- public override Expression DoResolve (EmitContext ec)
- {
- VariableInfo vi = VariableInfo;
-
- if (Block.IsConstant (Name)) {
- Expression e = Block.GetConstantExpression (Name);
- vi.Used = true;
- return e;
+ public bool IsReadOnly {
+ get {
+ return is_readonly;
}
-
- type = vi.VariableType;
- return this;
}
- override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
+ protected Expression DoResolveBase (EmitContext ec, Expression lvalue_right_side)
{
- Expression e = DoResolve (ec);
+ if (local_info == null) {
+ local_info = Block.GetLocalInfo (Name);
+ is_readonly = local_info.ReadOnly;
+ }
- if (e == null)
- return null;
+ type = local_info.VariableType;
- VariableInfo vi = VariableInfo;
+ VariableInfo variable_info = local_info.VariableInfo;
+ if (lvalue_right_side != null){
+ if (is_readonly){
+ Error (1604, "cannot assign to `" + Name + "' because it is readonly");
+ return null;
+ }
+
+ if (variable_info != null)
+ variable_info.SetAssigned (ec);
+ }
+
+ Expression e = Block.GetConstantExpression (Name);
+ if (e != null) {
+ local_info.Used = true;
+ eclass = ExprClass.Value;
+ return e.Resolve (ec);
+ }
-#if BROKEN
- //
- // Sigh: this breaks `using' and `fixed'. Need to review that
- //
- if (vi.ReadOnly){
- Report.Error (
- 1604, loc,
- "cannot assign to `" + Name + "' because it is readonly");
+ if ((variable_info != null) && !variable_info.IsAssigned (ec, loc))
return null;
+
+ if (lvalue_right_side == null)
+ local_info.Used = true;
+
+ if (ec.CurrentAnonymousMethod != null){
+ //
+ // If we are referencing a variable from the external block
+ // flag it for capturing
+ //
+ if (local_info.Block.Toplevel != ec.CurrentBlock.Toplevel){
+ ec.CaptureVariable (local_info);
+ //Console.WriteLine ("Capturing at " + loc);
+ }
}
-#endif
-
+
return this;
}
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return DoResolveBase (ec, null);
+ }
+
+ override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
+ {
+ Expression ret = DoResolveBase (ec, right_side);
+ if (ret != null)
+ CheckObsoleteAttribute (ret.Type);
+
+ return ret;
+ }
+
+ public bool VerifyFixed (bool is_expression)
+ {
+ return !is_expression || local_info.IsFixed;
+ }
public override void Emit (EmitContext ec)
{
- VariableInfo vi = VariableInfo;
ILGenerator ig = ec.ig;
- ig.Emit (OpCodes.Ldloc, vi.LocalBuilder);
- vi.Used = true;
+ if (local_info.FieldBuilder == null){
+ //
+ // A local variable on the local CLR stack
+ //
+ ig.Emit (OpCodes.Ldloc, local_info.LocalBuilder);
+ } else {
+ //
+ // A local variable captured by anonymous methods.
+ //
+ if (!prepared)
+ ec.EmitCapturedVariableInstance (local_info);
+
+ ig.Emit (OpCodes.Ldfld, local_info.FieldBuilder);
+ }
}
- public void EmitAssign (EmitContext ec, Expression source)
+ public void Emit (EmitContext ec, bool leave_copy)
+ {
+ Emit (ec);
+ if (leave_copy){
+ ec.ig.Emit (OpCodes.Dup);
+ if (local_info.FieldBuilder != null){
+ temp = new LocalTemporary (ec, Type);
+ temp.Store (ec);
+ }
+ }
+ }
+
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
ILGenerator ig = ec.ig;
- VariableInfo vi = VariableInfo;
+ prepared = prepare_for_load;
- vi.Assigned = true;
+ if (local_info.FieldBuilder == null){
+ //
+ // A local variable on the local CLR stack
+ //
+ if (local_info.LocalBuilder == null)
+ throw new Exception ("This should not happen: both Field and Local are null");
+
+ source.Emit (ec);
+ if (leave_copy)
+ ec.ig.Emit (OpCodes.Dup);
+ ig.Emit (OpCodes.Stloc, local_info.LocalBuilder);
+ } else {
+ //
+ // A local variable captured by anonymous methods or itereators.
+ //
+ ec.EmitCapturedVariableInstance (local_info);
- source.Emit (ec);
-
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
+ if (prepare_for_load)
+ ig.Emit (OpCodes.Dup);
+ source.Emit (ec);
+ if (leave_copy){
+ ig.Emit (OpCodes.Dup);
+ temp = new LocalTemporary (ec, Type);
+ temp.Store (ec);
+ }
+ ig.Emit (OpCodes.Stfld, local_info.FieldBuilder);
+ if (temp != null)
+ temp.Emit (ec);
+ }
}
public void AddressOf (EmitContext ec, AddressOp mode)
{
- VariableInfo vi = VariableInfo;
+ ILGenerator ig = ec.ig;
- if ((mode & AddressOp.Load) != 0)
- vi.Used = true;
- if ((mode & AddressOp.Store) != 0)
- vi.Assigned = true;
+ if (local_info.FieldBuilder == null){
+ //
+ // A local variable on the local CLR stack
+ //
+ ig.Emit (OpCodes.Ldloca, local_info.LocalBuilder);
+ } else {
+ //
+ // A local variable captured by anonymous methods or iterators
+ //
+ ec.EmitCapturedVariableInstance (local_info);
+ ig.Emit (OpCodes.Ldflda, local_info.FieldBuilder);
+ }
+ }
- ec.ig.Emit (OpCodes.Ldloca, vi.LocalBuilder);
+ public override string ToString ()
+ {
+ return String.Format ("{0} ({1}:{2})", GetType (), Name, loc);
}
}
@@ -2797,20 +3740,108 @@ namespace Mono.CSharp {
/// This represents a reference to a parameter in the intermediate
/// representation.
/// </summary>
- public class ParameterReference : Expression, IAssignMethod, IMemoryLocation {
+ public class ParameterReference : Expression, IAssignMethod, IMemoryLocation, IVariable {
Parameters pars;
String name;
int idx;
- public bool is_ref;
+ Block block;
+ VariableInfo vi;
+ public Parameter.Modifier mod;
+ public bool is_ref, is_out, prepared;
+
+ public bool IsOut {
+ get {
+ return is_out;
+ }
+ }
+
+ public bool IsRef {
+ get {
+ return is_ref;
+ }
+ }
+
+ LocalTemporary temp;
- public ParameterReference (Parameters pars, int idx, string name)
+ public ParameterReference (Parameters pars, Block block, int idx, string name, Location loc)
{
this.pars = pars;
+ this.block = block;
this.idx = idx;
this.name = name;
+ this.loc = loc;
eclass = ExprClass.Variable;
}
+ public VariableInfo VariableInfo {
+ get { return vi; }
+ }
+
+ public bool VerifyFixed (bool is_expression)
+ {
+ return !is_expression || TypeManager.IsValueType (type);
+ }
+
+ public bool IsAssigned (EmitContext ec, Location loc)
+ {
+ if (!ec.DoFlowAnalysis || !is_out || ec.CurrentBranching.IsAssigned (vi))
+ return true;
+
+ Report.Error (165, loc,
+ "Use of unassigned parameter `" + name + "'");
+ return false;
+ }
+
+ public bool IsFieldAssigned (EmitContext ec, string field_name, Location loc)
+ {
+ if (!ec.DoFlowAnalysis || !is_out || ec.CurrentBranching.IsFieldAssigned (vi, field_name))
+ return true;
+
+ Report.Error (170, loc,
+ "Use of possibly unassigned field `" + field_name + "'");
+ return false;
+ }
+
+ public void SetAssigned (EmitContext ec)
+ {
+ if (is_out && ec.DoFlowAnalysis)
+ ec.CurrentBranching.SetAssigned (vi);
+ }
+
+ public void SetFieldAssigned (EmitContext ec, string field_name)
+ {
+ if (is_out && ec.DoFlowAnalysis)
+ ec.CurrentBranching.SetFieldAssigned (vi, field_name);
+ }
+
+ protected void DoResolveBase (EmitContext ec)
+ {
+ type = pars.GetParameterInfo (ec, idx, out mod);
+ is_ref = (mod & Parameter.Modifier.ISBYREF) != 0;
+ is_out = (mod & Parameter.Modifier.OUT) != 0;
+ eclass = ExprClass.Variable;
+
+ if (is_out)
+ vi = block.ParameterMap [idx];
+
+ if (ec.CurrentAnonymousMethod != null){
+ if (is_ref){
+ Report.Error (1628, Location,
+ "Can not reference a ref or out parameter in an anonymous method");
+ return;
+ }
+
+ //
+ // If we are referencing the parameter from the external block
+ // flag it for capturing
+ //
+ //Console.WriteLine ("Is parameter `{0}' local? {1}", name, block.IsLocalParameter (name));
+ if (!block.IsLocalParameter (name)){
+ ec.CaptureParameter (name, type, idx);
+ }
+ }
+ }
+
//
// Notice that for ref/out parameters, the type exposed is not the
// same type exposed externally.
@@ -2825,12 +3856,43 @@ namespace Mono.CSharp {
//
public override Expression DoResolve (EmitContext ec)
{
- type = pars.GetParameterInfo (ec.DeclSpace, idx, out is_ref);
- eclass = ExprClass.Variable;
+ DoResolveBase (ec);
+ if (is_out && ec.DoFlowAnalysis && !IsAssigned (ec, loc))
+ return null;
+
+ if (ec.RemapToProxy)
+ return ec.RemapParameter (idx);
+
return this;
}
+ override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
+ {
+ DoResolveBase (ec);
+
+ SetAssigned (ec);
+
+ if (ec.RemapToProxy)
+ return ec.RemapParameterLValue (idx, right_side);
+
+ return this;
+ }
+
+ static public void EmitLdArg (ILGenerator ig, int x)
+ {
+ if (x <= 255){
+ switch (x){
+ case 0: ig.Emit (OpCodes.Ldarg_0); break;
+ case 1: ig.Emit (OpCodes.Ldarg_1); break;
+ case 2: ig.Emit (OpCodes.Ldarg_2); break;
+ case 3: ig.Emit (OpCodes.Ldarg_3); break;
+ default: ig.Emit (OpCodes.Ldarg_S, (byte) x); break;
+ }
+ } else
+ ig.Emit (OpCodes.Ldarg, x);
+ }
+
//
// This method is used by parameters that are references, that are
// being passed as references: we only want to pass the pointer (that
@@ -2844,77 +3906,121 @@ namespace Mono.CSharp {
if (!ec.IsStatic)
arg_idx++;
-
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
+
+ EmitLdArg (ig, arg_idx);
+
+ //
+ // FIXME: Review for anonymous methods
+ //
}
public override void Emit (EmitContext ec)
{
+ if (ec.HaveCaptureInfo && ec.IsParameterCaptured (name)){
+ ec.EmitParameter (name);
+ return;
+ }
+
+ Emit (ec, false);
+ }
+
+ public void Emit (EmitContext ec, bool leave_copy)
+ {
ILGenerator ig = ec.ig;
int arg_idx = idx;
if (!ec.IsStatic)
arg_idx++;
-
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
- if (!is_ref)
- return;
+ EmitLdArg (ig, arg_idx);
- //
- // If we are a reference, we loaded on the stack a pointer
- // Now lets load the real value
- //
- LoadFromPtr (ig, type);
+ if (is_ref) {
+ if (prepared)
+ ec.ig.Emit (OpCodes.Dup);
+
+ //
+ // If we are a reference, we loaded on the stack a pointer
+ // Now lets load the real value
+ //
+ LoadFromPtr (ig, type);
+ }
+
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+
+ if (is_ref) {
+ temp = new LocalTemporary (ec, type);
+ temp.Store (ec);
+ }
+ }
}
-
- public void EmitAssign (EmitContext ec, Expression source)
+
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
+ if (ec.HaveCaptureInfo && ec.IsParameterCaptured (name)){
+ ec.EmitAssignParameter (name, source, leave_copy, prepare_for_load);
+ return;
+ }
+
ILGenerator ig = ec.ig;
int arg_idx = idx;
-
+
+ prepared = prepare_for_load;
+
if (!ec.IsStatic)
arg_idx++;
- if (is_ref){
- // Load the pointer
- if (arg_idx <= 255)
- ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
- else
- ig.Emit (OpCodes.Ldarg, arg_idx);
- }
+ if (is_ref && !prepared)
+ EmitLdArg (ig, arg_idx);
source.Emit (ec);
- if (is_ref)
+ if (leave_copy)
+ ec.ig.Emit (OpCodes.Dup);
+
+ if (is_ref) {
+ if (leave_copy) {
+ temp = new LocalTemporary (ec, type);
+ temp.Store (ec);
+ }
+
StoreFromPtr (ig, type);
- else {
+
+ if (temp != null)
+ temp.Emit (ec);
+ } else {
if (arg_idx <= 255)
ig.Emit (OpCodes.Starg_S, (byte) arg_idx);
else
ig.Emit (OpCodes.Starg, arg_idx);
}
-
}
public void AddressOf (EmitContext ec, AddressOp mode)
{
+ if (ec.HaveCaptureInfo && ec.IsParameterCaptured (name)){
+ ec.EmitAddressOfParameter (name);
+ return;
+ }
+
int arg_idx = idx;
if (!ec.IsStatic)
arg_idx++;
- if (arg_idx <= 255)
- ec.ig.Emit (OpCodes.Ldarga_S, (byte) arg_idx);
- else
- ec.ig.Emit (OpCodes.Ldarga, arg_idx);
+ if (is_ref){
+ if (arg_idx <= 255)
+ ec.ig.Emit (OpCodes.Ldarg_S, (byte) arg_idx);
+ else
+ ec.ig.Emit (OpCodes.Ldarg, arg_idx);
+ } else {
+ if (arg_idx <= 255)
+ ec.ig.Emit (OpCodes.Ldarga_S, (byte) arg_idx);
+ else
+ ec.ig.Emit (OpCodes.Ldarga, arg_idx);
+ }
}
+
}
/// <summary>
@@ -2924,65 +4030,122 @@ namespace Mono.CSharp {
public enum AType : byte {
Expression,
Ref,
- Out
+ Out,
+ ArgList
};
public readonly AType ArgType;
- public Expression expr;
+ public Expression Expr;
public Argument (Expression expr, AType type)
{
- this.expr = expr;
+ this.Expr = expr;
this.ArgType = type;
}
- public Expression Expr {
- get {
- return expr;
- }
-
- set {
- expr = value;
- }
+ public Argument (Expression expr)
+ {
+ this.Expr = expr;
+ this.ArgType = AType.Expression;
}
public Type Type {
get {
if (ArgType == AType.Ref || ArgType == AType.Out)
- return TypeManager.LookupType (expr.Type.ToString () + "&");
+ return TypeManager.GetReferenceType (Expr.Type);
else
- return expr.Type;
+ return Expr.Type;
}
}
public Parameter.Modifier GetParameterModifier ()
{
- if (ArgType == AType.Ref || ArgType == AType.Out)
- return Parameter.Modifier.OUT;
+ switch (ArgType) {
+ case AType.Out:
+ return Parameter.Modifier.OUT | Parameter.Modifier.ISBYREF;
- return Parameter.Modifier.NONE;
+ case AType.Ref:
+ return Parameter.Modifier.REF | Parameter.Modifier.ISBYREF;
+
+ default:
+ return Parameter.Modifier.NONE;
+ }
}
public static string FullDesc (Argument a)
{
+ if (a.ArgType == AType.ArgList)
+ return "__arglist";
+
return (a.ArgType == AType.Ref ? "ref " :
(a.ArgType == AType.Out ? "out " : "")) +
TypeManager.CSharpName (a.Expr.Type);
}
+
+ public bool ResolveMethodGroup (EmitContext ec, Location loc)
+ {
+ // FIXME: csc doesn't report any error if you try to use `ref' or
+ // `out' in a delegate creation expression.
+ Expr = Expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);
+ if (Expr == null)
+ return false;
+
+ return true;
+ }
public bool Resolve (EmitContext ec, Location loc)
{
- expr = expr.Resolve (ec);
+ if (ArgType == AType.Ref) {
+ Expr = Expr.Resolve (ec);
+ if (Expr == null)
+ return false;
+
+ if (!ec.IsConstructor) {
+ FieldExpr fe = Expr as FieldExpr;
+ if (fe != null && fe.FieldInfo.IsInitOnly) {
+ if (fe.FieldInfo.IsStatic)
+ Report.Error (199, loc, "A static readonly field cannot be passed ref or out (except in a static constructor)");
+ else
+ Report.Error (192, loc, "A readonly field cannot be passed ref or out (except in a constructor)");
+ return false;
+ }
+ }
+ Expr = Expr.ResolveLValue (ec, Expr);
+ } else if (ArgType == AType.Out)
+ Expr = Expr.ResolveLValue (ec, EmptyExpression.Null);
+ else
+ Expr = Expr.Resolve (ec);
+
+ if (Expr == null)
+ return false;
if (ArgType == AType.Expression)
- return expr != null;
+ return true;
+ else {
+ //
+ // Catch errors where fields of a MarshalByRefObject are passed as ref or out
+ // This is only allowed for `this'
+ //
+ FieldExpr fe = Expr as FieldExpr;
+ if (fe != null && !fe.IsStatic){
+ Expression instance = fe.InstanceExpression;
+
+ if (instance.GetType () != typeof (This)){
+ if (fe.InstanceExpression.Type.IsSubclassOf (TypeManager.mbr_type)){
+ Report.Error (197, loc,
+ "Can not pass a type that derives from MarshalByRefObject with out or ref");
+ return false;
+ }
+ }
+ }
+ }
- if (expr.eclass != ExprClass.Variable){
+ if (Expr.eclass != ExprClass.Variable){
//
// We just probe to match the CSC output
//
- if (expr.eclass == ExprClass.PropertyAccess ||
- expr.eclass == ExprClass.IndexerAccess){
+ if (Expr.eclass == ExprClass.PropertyAccess ||
+ Expr.eclass == ExprClass.IndexerAccess){
Report.Error (
206, loc,
"A property or indexer can not be passed as an out or ref " +
@@ -2995,7 +4158,7 @@ namespace Mono.CSharp {
return false;
}
- return expr != null;
+ return true;
}
public void Emit (EmitContext ec)
@@ -3012,19 +4175,20 @@ namespace Mono.CSharp {
if (ArgType == AType.Ref)
mode |= AddressOp.Load;
- if (expr is ParameterReference){
- ParameterReference pr = (ParameterReference) expr;
+ if (Expr is ParameterReference){
+ ParameterReference pr = (ParameterReference) Expr;
- if (pr.is_ref)
+ if (pr.IsRef)
pr.EmitLoad (ec);
else {
pr.AddressOf (ec, mode);
}
- } else
- ((IMemoryLocation)expr).AddressOf (ec, mode);
+ } else {
+ ((IMemoryLocation)Expr).AddressOf (ec, mode);
+ }
} else
- expr.Emit (ec);
+ Expr.Emit (ec);
}
}
@@ -3033,11 +4197,9 @@ namespace Mono.CSharp {
/// </summary>
public class Invocation : ExpressionStatement {
public readonly ArrayList Arguments;
- Location loc;
Expression expr;
MethodBase method = null;
- bool is_base;
static Hashtable method_parameter_cache;
@@ -3085,8 +4247,7 @@ namespace Mono.CSharp {
return (ParameterData) ip;
} else {
- ParameterInfo [] pi = mb.GetParameters ();
- ReflectionParameters rp = new ReflectionParameters (pi);
+ ReflectionParameters rp = new ReflectionParameters (mb);
method_parameter_cache [mb] = rp;
return (ParameterData) rp;
@@ -3094,225 +4255,206 @@ namespace Mono.CSharp {
}
/// <summary>
- /// Determines "better conversion" as specified in 7.4.2.3
- /// Returns : 1 if a->p is better
- /// 0 if a->q or neither is better
+ /// Determines "better conversion" as specified in 7.4.2.3
+ ///
+ /// Returns : p if a->p is better,
+ /// q if a->q is better,
+ /// null if neither is better
/// </summary>
- static int BetterConversion (EmitContext ec, Argument a, Type p, Type q, Location loc)
+ static Type BetterConversion (EmitContext ec, Argument a, Type p, Type q, Location loc)
{
Type argument_type = a.Type;
Expression argument_expr = a.Expr;
if (argument_type == null)
- throw new Exception ("Expression of type " + a.Expr + " does not resolve its type");
+ throw new Exception ("Expression of type " + a.Expr +
+ " does not resolve its type");
+
+ if (p == null || q == null)
+ throw new InternalErrorException ("BetterConversion Got a null conversion");
if (p == q)
- return 0;
-
+ return null;
+
+ if (argument_expr is NullLiteral) {
+ //
+ // If the argument is null and one of the types to compare is 'object' and
+ // the other is a reference type, we prefer the other.
+ //
+ // This follows from the usual rules:
+ // * There is an implicit conversion from 'null' to type 'object'
+ // * There is an implicit conversion from 'null' to any reference type
+ // * There is an implicit conversion from any reference type to type 'object'
+ // * There is no implicit conversion from type 'object' to other reference types
+ // => Conversion of 'null' to a reference type is better than conversion to 'object'
+ //
+ // FIXME: This probably isn't necessary, since the type of a NullLiteral is 'System.Null'.
+ // I think it used to be 'object' and thus needed a special case to avoid the
+ // immediately following two checks.
+ //
+ if (!p.IsValueType && q == TypeManager.object_type)
+ return p;
+ if (!q.IsValueType && p == TypeManager.object_type)
+ return q;
+ }
+
if (argument_type == p)
- return 1;
+ return p;
if (argument_type == q)
- return 0;
+ return q;
- //
- // Now probe whether an implicit constant expression conversion
- // can be used.
- //
- // An implicit constant expression conversion permits the following
- // conversions:
- //
- // * A constant-expression of type `int' can be converted to type
- // sbyte, byute, short, ushort, uint, ulong provided the value of
- // of the expression is withing the range of the destination type.
- //
- // * A constant-expression of type long can be converted to type
- // ulong, provided the value of the constant expression is not negative
- //
- // FIXME: Note that this assumes that constant folding has
- // taken place. We dont do constant folding yet.
- //
+ Expression p_tmp = new EmptyExpression (p);
+ Expression q_tmp = new EmptyExpression (q);
- if (argument_expr is IntConstant){
- IntConstant ei = (IntConstant) argument_expr;
- int value = ei.Value;
-
- if (p == TypeManager.sbyte_type){
- if (value >= SByte.MinValue && value <= SByte.MaxValue)
- return 1;
- } else if (p == TypeManager.byte_type){
- if (Byte.MinValue >= 0 && value <= Byte.MaxValue)
- return 1;
- } else if (p == TypeManager.short_type){
- if (value >= Int16.MinValue && value <= Int16.MaxValue)
- return 1;
- } else if (p == TypeManager.ushort_type){
- if (value >= UInt16.MinValue && value <= UInt16.MaxValue)
- return 1;
- } else if (p == TypeManager.uint32_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint32
- //
- if (value >= 0)
- return 1;
- } else if (p == TypeManager.uint64_type){
- //
- // we can optimize this case: a positive int32
- // always fits on a uint64
- //
- if (value >= 0)
- return 1;
- }
- } else if (argument_type == TypeManager.int64_type && argument_expr is LongConstant){
- LongConstant lc = (LongConstant) argument_expr;
-
- if (p == TypeManager.uint64_type){
- if (lc.Value > 0)
- return 1;
- }
- }
+ bool p_to_q = Convert.ImplicitConversionExists (ec, p_tmp, q);
+ bool q_to_p = Convert.ImplicitConversionExists (ec, q_tmp, p);
- if (q == null) {
- Expression tmp = ConvertImplicit (ec, argument_expr, p, loc);
-
- if (tmp != null)
- return 1;
- else
- return 0;
- }
+ if (p_to_q && !q_to_p)
+ return p;
- Expression p_tmp = new EmptyExpression (p);
- Expression q_tmp = new EmptyExpression (q);
-
- if (StandardConversionExists (p_tmp, q) == true &&
- StandardConversionExists (q_tmp, p) == false)
- return 1;
+ if (q_to_p && !p_to_q)
+ return q;
if (p == TypeManager.sbyte_type)
if (q == TypeManager.byte_type || q == TypeManager.ushort_type ||
q == TypeManager.uint32_type || q == TypeManager.uint64_type)
- return 1;
+ return p;
+ if (q == TypeManager.sbyte_type)
+ if (p == TypeManager.byte_type || p == TypeManager.ushort_type ||
+ p == TypeManager.uint32_type || p == TypeManager.uint64_type)
+ return q;
if (p == TypeManager.short_type)
if (q == TypeManager.ushort_type || q == TypeManager.uint32_type ||
q == TypeManager.uint64_type)
- return 1;
+ return p;
+ if (q == TypeManager.short_type)
+ if (p == TypeManager.ushort_type || p == TypeManager.uint32_type ||
+ p == TypeManager.uint64_type)
+ return q;
if (p == TypeManager.int32_type)
if (q == TypeManager.uint32_type || q == TypeManager.uint64_type)
- return 1;
+ return p;
+ if (q == TypeManager.int32_type)
+ if (p == TypeManager.uint32_type || p == TypeManager.uint64_type)
+ return q;
if (p == TypeManager.int64_type)
if (q == TypeManager.uint64_type)
- return 1;
+ return p;
+ if (q == TypeManager.int64_type)
+ if (p == TypeManager.uint64_type)
+ return q;
- return 0;
+ return null;
}
/// <summary>
- /// Determines "Better function"
+ /// Determines "Better function" between candidate
+ /// and the current best match
/// </summary>
/// <remarks>
- /// and returns an integer indicating :
- /// 0 if candidate ain't better
- /// 1 if candidate is better than the current best match
+ /// Returns an integer indicating :
+ /// false if candidate ain't better
+ /// true if candidate is better than the current best match
/// </remarks>
- static int BetterFunction (EmitContext ec, ArrayList args,
- MethodBase candidate, MethodBase best,
- bool expanded_form, Location loc)
+ static bool BetterFunction (EmitContext ec, ArrayList args, int argument_count,
+ MethodBase candidate, bool candidate_params,
+ MethodBase best, bool best_params, Location loc)
{
ParameterData candidate_pd = GetParameterData (candidate);
- ParameterData best_pd;
- int argument_count;
+ ParameterData best_pd = GetParameterData (best);
- if (args == null)
- argument_count = 0;
- else
- argument_count = args.Count;
-
int cand_count = candidate_pd.Count;
-
+
+ //
+ // If there is no best method, than this one
+ // is better, however, if we already found a
+ // best method, we cant tell. This happens
+ // if we have:
+ //
+ // interface IFoo {
+ // void DoIt ();
+ // }
+ //
+ // interface IBar {
+ // void DoIt ();
+ // }
+ //
+ // interface IFooBar : IFoo, IBar {}
+ //
+ // We cant tell if IFoo.DoIt is better than IBar.DoIt
+ //
+ // However, we have to consider that
+ // Trim (); is better than Trim (params char[] chars);
+ //
if (cand_count == 0 && argument_count == 0)
- return 1;
+ return !candidate_params && best_params;
- if (candidate_pd.ParameterModifier (cand_count - 1) != Parameter.Modifier.PARAMS)
+ if ((candidate_pd.ParameterModifier (cand_count - 1) != Parameter.Modifier.PARAMS) &&
+ (candidate_pd.ParameterModifier (cand_count - 1) != Parameter.Modifier.ARGLIST))
if (cand_count != argument_count)
- return 0;
-
- if (best == null) {
- int x = 0;
-
- if (argument_count == 0 && cand_count == 1 &&
- candidate_pd.ParameterModifier (cand_count - 1) == Parameter.Modifier.PARAMS)
- return 1;
-
- for (int j = argument_count; j > 0;) {
- j--;
-
- Argument a = (Argument) args [j];
- Type t = candidate_pd.ParameterType (j);
-
- if (candidate_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- t = t.GetElementType ();
-
- x = BetterConversion (ec, a, t, null, loc);
-
- if (x <= 0)
- break;
- }
-
- if (x > 0)
- return 1;
- else
- return 0;
- }
-
- best_pd = GetParameterData (best);
+ return false;
- int rating1 = 0, rating2 = 0;
-
+ bool better_at_least_one = false;
for (int j = 0; j < argument_count; ++j) {
- int x, y;
-
Argument a = (Argument) args [j];
- Type ct = candidate_pd.ParameterType (j);
- Type bt = best_pd.ParameterType (j);
+ Type ct = TypeManager.TypeToCoreType (candidate_pd.ParameterType (j));
+ Type bt = TypeManager.TypeToCoreType (best_pd.ParameterType (j));
if (candidate_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- ct = ct.GetElementType ();
+ if (candidate_params)
+ ct = TypeManager.GetElementType (ct);
if (best_pd.ParameterModifier (j) == Parameter.Modifier.PARAMS)
- if (expanded_form)
- bt = bt.GetElementType ();
-
- x = BetterConversion (ec, a, ct, bt, loc);
- y = BetterConversion (ec, a, bt, ct, loc);
+ if (best_params)
+ bt = TypeManager.GetElementType (bt);
- if (x < y)
- return 0;
-
- rating1 += x;
- rating2 += y;
+ Type better = BetterConversion (ec, a, ct, bt, loc);
+
+ // for each argument, the conversion to 'ct' should be no worse than
+ // the conversion to 'bt'.
+ if (better == bt)
+ return false;
+
+ // for at least one argument, the conversion to 'ct' should be better than
+ // the conversion to 'bt'.
+ if (better == ct)
+ better_at_least_one = true;
}
- if (rating1 > rating2)
- return 1;
- else
- return 0;
+ //
+ // If a method (in the normal form) with the
+ // same signature as the expanded form of the
+ // current best params method already exists,
+ // the expanded form is not applicable so we
+ // force it to select the candidate
+ //
+ if (!candidate_params && best_params && cand_count == argument_count)
+ return true;
+
+ return better_at_least_one;
}
public static string FullMethodDesc (MethodBase mb)
{
string ret_type = "";
+ if (mb == null)
+ return "";
+
if (mb is MethodInfo)
ret_type = TypeManager.CSharpName (((MethodInfo) mb).ReturnType);
- StringBuilder sb = new StringBuilder (ret_type + " " + mb.Name);
+ StringBuilder sb = new StringBuilder (ret_type);
+ sb.Append (" ");
+ sb.Append (mb.ReflectedType.ToString ());
+ sb.Append (".");
+ sb.Append (mb.Name);
+
ParameterData pd = GetParameterData (mb);
int count = pd.Count;
@@ -3335,7 +4477,7 @@ namespace Mono.CSharp {
MemberInfo [] miset;
MethodGroupExpr union;
- if (mg1 == null){
+ if (mg1 == null) {
if (mg2 == null)
return null;
return (MethodGroupExpr) mg2;
@@ -3355,82 +4497,104 @@ namespace Mono.CSharp {
ArrayList common = new ArrayList ();
- foreach (MethodBase l in left_set.Methods){
- foreach (MethodBase r in right_set.Methods){
- if (l != r)
- continue;
+ foreach (MethodBase r in right_set.Methods){
+ if (TypeManager.ArrayContainsMethod (left_set.Methods, r))
common.Add (r);
- break;
- }
}
-
+
miset = new MemberInfo [length1 + length2 - common.Count];
left_set.Methods.CopyTo (miset, 0);
int k = length1;
- foreach (MemberInfo mi in right_set.Methods){
- if (!common.Contains (mi))
- miset [k++] = mi;
+ foreach (MethodBase r in right_set.Methods) {
+ if (!common.Contains (r))
+ miset [k++] = r;
}
-
+
union = new MethodGroupExpr (miset, loc);
return union;
}
+ static bool IsParamsMethodApplicable (EmitContext ec, MethodGroupExpr me,
+ ArrayList arguments, int arg_count,
+ ref MethodBase candidate)
+ {
+ return IsParamsMethodApplicable (
+ ec, me, arguments, arg_count, false, ref candidate) ||
+ IsParamsMethodApplicable (
+ ec, me, arguments, arg_count, true, ref candidate);
+
+
+ }
+
+ static bool IsParamsMethodApplicable (EmitContext ec, MethodGroupExpr me,
+ ArrayList arguments, int arg_count,
+ bool do_varargs, ref MethodBase candidate)
+ {
+ return IsParamsMethodApplicable (
+ ec, arguments, arg_count, candidate, do_varargs);
+ }
+
/// <summary>
- /// Determines is the candidate method, if a params method, is applicable
- /// in its expanded form to the given set of arguments
+ /// Determines if the candidate method, if a params method, is applicable
+ /// in its expanded form to the given set of arguments
/// </summary>
- static bool IsParamsMethodApplicable (EmitContext ec, ArrayList arguments, MethodBase candidate)
+ static bool IsParamsMethodApplicable (EmitContext ec, ArrayList arguments,
+ int arg_count, MethodBase candidate,
+ bool do_varargs)
{
- int arg_count;
-
- if (arguments == null)
- arg_count = 0;
- else
- arg_count = arguments.Count;
-
ParameterData pd = GetParameterData (candidate);
-
- int pd_count = pd.Count;
+ int pd_count = pd.Count;
if (pd_count == 0)
return false;
+
+ int count = pd_count - 1;
+ if (do_varargs) {
+ if (pd.ParameterModifier (count) != Parameter.Modifier.ARGLIST)
+ return false;
+ if (pd_count != arg_count)
+ return false;
+ } else {
+ if (pd.ParameterModifier (count) != Parameter.Modifier.PARAMS)
+ return false;
+ }
- if (pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS)
- return false;
-
- if (pd_count - 1 > arg_count)
+ if (count > arg_count)
return false;
if (pd_count == 1 && arg_count == 0)
return true;
//
- // If we have come this far, the case which remains is when the number of parameters
- // is less than or equal to the argument count.
+ // If we have come this far, the case which
+ // remains is when the number of parameters is
+ // less than or equal to the argument count.
//
- for (int i = 0; i < pd_count - 1; ++i) {
+ for (int i = 0; i < count; ++i) {
Argument a = (Argument) arguments [i];
- Parameter.Modifier a_mod = a.GetParameterModifier ();
- Parameter.Modifier p_mod = pd.ParameterModifier (i);
+ Parameter.Modifier a_mod = a.GetParameterModifier () &
+ (unchecked (~(Parameter.Modifier.OUT | Parameter.Modifier.REF)));
+ Parameter.Modifier p_mod = pd.ParameterModifier (i) &
+ (unchecked (~(Parameter.Modifier.OUT | Parameter.Modifier.REF)));
if (a_mod == p_mod) {
if (a_mod == Parameter.Modifier.NONE)
- if (!ImplicitConversionExists (ec, a.Expr, pd.ParameterType (i)))
+ if (!Convert.ImplicitConversionExists (ec,
+ a.Expr,
+ pd.ParameterType (i)))
return false;
- if (a_mod == Parameter.Modifier.REF ||
- a_mod == Parameter.Modifier.OUT) {
+ if ((a_mod & Parameter.Modifier.ISBYREF) != 0) {
Type pt = pd.ParameterType (i);
if (!pt.IsByRef)
- pt = TypeManager.LookupType (pt.FullName + "&");
+ pt = TypeManager.GetReferenceType (pt);
if (pt != a.Type)
return false;
@@ -3440,59 +4604,71 @@ namespace Mono.CSharp {
}
- Type element_type = pd.ParameterType (pd_count - 1).GetElementType ();
+ if (do_varargs) {
+ Argument a = (Argument) arguments [count];
+ if (!(a.Expr is Arglist))
+ return false;
+
+ return true;
+ }
+
+ Type element_type = TypeManager.GetElementType (pd.ParameterType (pd_count - 1));
for (int i = pd_count - 1; i < arg_count; i++) {
Argument a = (Argument) arguments [i];
-
- if (!StandardConversionExists (a.Expr, element_type))
+
+ if (!Convert.ImplicitConversionExists (ec, a.Expr, element_type))
return false;
}
return true;
}
+ static bool IsApplicable (EmitContext ec, MethodGroupExpr me,
+ ArrayList arguments, int arg_count,
+ ref MethodBase candidate)
+ {
+ return IsApplicable (ec, arguments, arg_count, candidate);
+ }
+
/// <summary>
- /// Determines if the candidate method is applicable (section 14.4.2.1)
- /// to the given set of arguments
+ /// Determines if the candidate method is applicable (section 14.4.2.1)
+ /// to the given set of arguments
/// </summary>
- static bool IsApplicable (EmitContext ec, ArrayList arguments, MethodBase candidate)
+ static bool IsApplicable (EmitContext ec, ArrayList arguments, int arg_count,
+ MethodBase candidate)
{
- int arg_count;
-
- if (arguments == null)
- arg_count = 0;
- else
- arg_count = arguments.Count;
-
ParameterData pd = GetParameterData (candidate);
- int pd_count = pd.Count;
-
if (arg_count != pd.Count)
return false;
-
+
for (int i = arg_count; i > 0; ) {
i--;
Argument a = (Argument) arguments [i];
- Parameter.Modifier a_mod = a.GetParameterModifier ();
- Parameter.Modifier p_mod = pd.ParameterModifier (i);
+ Parameter.Modifier a_mod = a.GetParameterModifier () &
+ unchecked (~(Parameter.Modifier.OUT | Parameter.Modifier.REF));
+ Parameter.Modifier p_mod = pd.ParameterModifier (i) &
+ unchecked (~(Parameter.Modifier.OUT | Parameter.Modifier.REF));
+
if (a_mod == p_mod ||
(a_mod == Parameter.Modifier.NONE && p_mod == Parameter.Modifier.PARAMS)) {
- if (a_mod == Parameter.Modifier.NONE)
- if (!ImplicitConversionExists (ec, a.Expr, pd.ParameterType (i)))
+ if (a_mod == Parameter.Modifier.NONE) {
+ if (!Convert.ImplicitConversionExists (ec,
+ a.Expr,
+ pd.ParameterType (i)))
return false;
+ }
- if (a_mod == Parameter.Modifier.REF ||
- a_mod == Parameter.Modifier.OUT) {
+ if ((a_mod & Parameter.Modifier.ISBYREF) != 0) {
Type pt = pd.ParameterType (i);
if (!pt.IsByRef)
- pt = TypeManager.LookupType (pt.FullName + "&");
-
+ pt = TypeManager.GetReferenceType (pt);
+
if (pt != a.Type)
return false;
}
@@ -3502,9 +4678,14 @@ namespace Mono.CSharp {
return true;
}
-
-
+ static private bool IsAncestralType (Type first_type, Type second_type)
+ {
+ return first_type != second_type &&
+ (second_type.IsSubclassOf (first_type) ||
+ TypeManager.ImplementsInterface (second_type, first_type));
+ }
+
/// <summary>
/// Find the Applicable Function Members (7.4.2.1)
///
@@ -3522,144 +4703,307 @@ namespace Mono.CSharp {
///
/// </summary>
public static MethodBase OverloadResolve (EmitContext ec, MethodGroupExpr me,
- ArrayList Arguments, Location loc)
+ ArrayList Arguments, bool may_fail,
+ Location loc)
{
- ArrayList afm = new ArrayList ();
MethodBase method = null;
- int argument_count;
+ bool method_params = false;
+ Type applicable_type = null;
+ int arg_count = 0;
ArrayList candidates = new ArrayList ();
-
- foreach (MethodBase candidate in me.Methods){
- int x;
+ //
+ // Used to keep a map between the candidate
+ // and whether it is being considered in its
+ // normal or expanded form
+ //
+ // false is normal form, true is expanded form
+ //
+ Hashtable candidate_to_form = null;
+
+ if (Arguments != null)
+ arg_count = Arguments.Count;
+
+ if ((me.Name == "Invoke") &&
+ TypeManager.IsDelegateType (me.DeclaringType)) {
+ Error_InvokeOnDelegate (loc);
+ return null;
+ }
+
+ MethodBase[] methods = me.Methods;
+
+ //
+ // First we construct the set of applicable methods
+ //
+ bool is_sorted = true;
+ for (int i = 0; i < methods.Length; i++){
+ Type decl_type = methods [i].DeclaringType;
+
+ //
+ // If we have already found an applicable method
+ // we eliminate all base types (Section 14.5.5.1)
+ //
+ if ((applicable_type != null) &&
+ IsAncestralType (decl_type, applicable_type))
+ continue;
+ //
// Check if candidate is applicable (section 14.4.2.1)
- if (!IsApplicable (ec, Arguments, candidate))
- continue;
+ // Is candidate applicable in normal form?
+ //
+ bool is_applicable = IsApplicable (
+ ec, me, Arguments, arg_count, ref methods [i]);
+
+ if (!is_applicable &&
+ (IsParamsMethodApplicable (
+ ec, me, Arguments, arg_count, ref methods [i]))) {
+ MethodBase candidate = methods [i];
+ if (candidate_to_form == null)
+ candidate_to_form = new PtrHashtable ();
+ candidate_to_form [candidate] = candidate;
+ // Candidate is applicable in expanded form
+ is_applicable = true;
+ }
- candidates.Add (candidate);
- x = BetterFunction (ec, Arguments, candidate, method, false, loc);
-
- if (x == 0)
+ if (!is_applicable)
continue;
- method = candidate;
+ candidates.Add (methods [i]);
+
+ if (applicable_type == null)
+ applicable_type = decl_type;
+ else if (applicable_type != decl_type) {
+ is_sorted = false;
+ if (IsAncestralType (applicable_type, decl_type))
+ applicable_type = decl_type;
+ }
}
- if (Arguments == null)
- argument_count = 0;
- else
- argument_count = Arguments.Count;
-
- //
- // Now we see if we can find params functions, applicable in their expanded form
- // since if they were applicable in their normal form, they would have been selected
- // above anyways
- //
- bool chose_params_expanded = false;
-
- if (method == null) {
- candidates = new ArrayList ();
- foreach (MethodBase candidate in me.Methods){
- if (!IsParamsMethodApplicable (ec, Arguments, candidate))
- continue;
+ int candidate_top = candidates.Count;
- candidates.Add (candidate);
+ if (candidate_top == 0) {
+ //
+ // Okay so we have failed to find anything so we
+ // return by providing info about the closest match
+ //
+ for (int i = 0; i < methods.Length; ++i) {
+ MethodBase c = (MethodBase) methods [i];
+ ParameterData pd = GetParameterData (c);
- int x = BetterFunction (ec, Arguments, candidate, method, true, loc);
- if (x == 0)
+ if (pd.Count != arg_count)
continue;
- method = candidate;
- chose_params_expanded = true;
+ VerifyArgumentsCompat (ec, Arguments, arg_count,
+ c, false, null, may_fail, loc);
+ break;
}
- }
- if (method == null)
+ if (!may_fail) {
+ string report_name = me.Name;
+ if (report_name == ".ctor")
+ report_name = me.DeclaringType.ToString ();
+
+ Error_WrongNumArguments (
+ loc, report_name, arg_count);
+ return null;
+ }
+
return null;
+ }
+
+ if (!is_sorted) {
+ //
+ // At this point, applicable_type is _one_ of the most derived types
+ // in the set of types containing the methods in this MethodGroup.
+ // Filter the candidates so that they only contain methods from the
+ // most derived types.
+ //
+
+ int finalized = 0; // Number of finalized candidates
+
+ do {
+ // Invariant: applicable_type is a most derived type
+
+ // We'll try to complete Section 14.5.5.1 for 'applicable_type' by
+ // eliminating all it's base types. At the same time, we'll also move
+ // every unrelated type to the end of the array, and pick the next
+ // 'applicable_type'.
+
+ Type next_applicable_type = null;
+ int j = finalized; // where to put the next finalized candidate
+ int k = finalized; // where to put the next undiscarded candidate
+ for (int i = finalized; i < candidate_top; ++i) {
+ Type decl_type = ((MethodBase) candidates[i]).DeclaringType;
+
+ if (decl_type == applicable_type) {
+ candidates[k++] = candidates[j];
+ candidates[j++] = candidates[i];
+ continue;
+ }
+
+ if (IsAncestralType (decl_type, applicable_type))
+ continue;
+
+ if (next_applicable_type != null &&
+ IsAncestralType (decl_type, next_applicable_type))
+ continue;
+
+ candidates[k++] = candidates[i];
+
+ if (next_applicable_type == null ||
+ IsAncestralType (next_applicable_type, decl_type))
+ next_applicable_type = decl_type;
+ }
+
+ applicable_type = next_applicable_type;
+ finalized = j;
+ candidate_top = k;
+ } while (applicable_type != null);
+ }
+
+ //
+ // Now we actually find the best method
+ //
+
+ method = (MethodBase) candidates[0];
+ method_params = candidate_to_form != null && candidate_to_form.Contains (method);
+ for (int ix = 1; ix < candidate_top; ix++){
+ MethodBase candidate = (MethodBase) candidates [ix];
+ bool cand_params = candidate_to_form != null && candidate_to_form.Contains (candidate);
+
+ if (BetterFunction (ec, Arguments, arg_count,
+ candidate, cand_params,
+ method, method_params, loc)) {
+ method = candidate;
+ method_params = cand_params;
+ }
+ }
//
// Now check that there are no ambiguities i.e the selected method
// should be better than all the others
//
+ bool ambiguous = false;
+ for (int ix = 0; ix < candidate_top; ix++){
+ MethodBase candidate = (MethodBase) candidates [ix];
+
+ if (candidate == method)
+ continue;
+
+ bool cand_params = candidate_to_form != null && candidate_to_form.Contains (candidate);
+ if (!BetterFunction (ec, Arguments, arg_count,
+ method, method_params,
+ candidate, cand_params,
+ loc)) {
+ Report.SymbolRelatedToPreviousError (candidate);
+ ambiguous = true;
+ }
+ }
- foreach (MethodBase candidate in candidates){
- if (candidate == method)
- continue;
-
- //
- // If a normal method is applicable in the sense that it has the same
- // number of arguments, then the expanded params method is never applicable
- // so we debar the params method.
- //
- if (IsParamsMethodApplicable (ec, Arguments, candidate) &&
- IsApplicable (ec, Arguments, method))
- continue;
-
- int x = BetterFunction (ec, Arguments, method, candidate,
- chose_params_expanded, loc);
-
- if (x != 1) {
- Report.Error (
- 121, loc,
- "Ambiguous call when selecting function due to implicit casts");
- return null;
- }
+ if (ambiguous) {
+ Report.SymbolRelatedToPreviousError (method);
+ Report.Error (121, loc, "Ambiguous call when selecting function due to implicit casts");
+ return null;
}
+
//
- // And now check if the arguments are all compatible, perform conversions
- // if necessary etc. and return if everything is all right
+ // And now check if the arguments are all
+ // compatible, perform conversions if
+ // necessary etc. and return if everything is
+ // all right
//
-
- if (VerifyArgumentsCompat (ec, Arguments, argument_count, method,
- chose_params_expanded, null, loc))
- return method;
- else
+ if (!VerifyArgumentsCompat (ec, Arguments, arg_count, method,
+ method_params, null, may_fail, loc))
return null;
+
+ return method;
}
+ static void Error_WrongNumArguments (Location loc, String name, int arg_count)
+ {
+ Report.Error (1501, loc,
+ "No overload for method `" + name + "' takes `" +
+ arg_count + "' arguments");
+ }
+
+ static void Error_InvokeOnDelegate (Location loc)
+ {
+ Report.Error (1533, loc,
+ "Invoke cannot be called directly on a delegate");
+ }
+
+ static void Error_InvalidArguments (Location loc, int idx, MethodBase method,
+ Type delegate_type, string arg_sig, string par_desc)
+ {
+ if (delegate_type == null)
+ Report.Error (1502, loc,
+ "The best overloaded match for method '" +
+ FullMethodDesc (method) +
+ "' has some invalid arguments");
+ else
+ Report.Error (1594, loc,
+ "Delegate '" + delegate_type.ToString () +
+ "' has some invalid arguments.");
+ Report.Error (1503, loc,
+ String.Format ("Argument {0}: Cannot convert from '{1}' to '{2}'",
+ idx, arg_sig, par_desc));
+ }
+
public static bool VerifyArgumentsCompat (EmitContext ec, ArrayList Arguments,
- int argument_count,
- MethodBase method,
+ int arg_count, MethodBase method,
bool chose_params_expanded,
- Type delegate_type,
+ Type delegate_type, bool may_fail,
Location loc)
{
ParameterData pd = GetParameterData (method);
int pd_count = pd.Count;
-
- for (int j = 0; j < argument_count; j++) {
+
+ for (int j = 0; j < arg_count; j++) {
Argument a = (Argument) Arguments [j];
Expression a_expr = a.Expr;
Type parameter_type = pd.ParameterType (j);
+ Parameter.Modifier pm = pd.ParameterModifier (j);
+
+ if (pm == Parameter.Modifier.PARAMS){
+ if ((pm & ~Parameter.Modifier.PARAMS) != a.GetParameterModifier ()) {
+ if (!may_fail)
+ Error_InvalidArguments (
+ loc, j, method, delegate_type,
+ Argument.FullDesc (a), pd.ParameterDesc (j));
+ return false;
+ }
- if (pd.ParameterModifier (j) == Parameter.Modifier.PARAMS &&
- chose_params_expanded)
- parameter_type = parameter_type.GetElementType ();
+ if (chose_params_expanded)
+ parameter_type = TypeManager.GetElementType (parameter_type);
+ } else if (pm == Parameter.Modifier.ARGLIST){
+ continue;
+ } else {
+ //
+ // Check modifiers
+ //
+ if (pd.ParameterModifier (j) != a.GetParameterModifier ()){
+ if (!may_fail)
+ Error_InvalidArguments (
+ loc, j, method, delegate_type,
+ Argument.FullDesc (a), pd.ParameterDesc (j));
+ return false;
+ }
+ }
- if (a.Type != parameter_type){
+ //
+ // Check Type
+ //
+ if (!a.Type.Equals (parameter_type)){
Expression conv;
- conv = ConvertImplicit (ec, a_expr, parameter_type, loc);
+ conv = Convert.ImplicitConversion (ec, a_expr, parameter_type, loc);
if (conv == null) {
- if (!Location.IsNull (loc)) {
- if (delegate_type == null)
- Error (1502, loc,
- "The best overloaded match for method '" +
- FullMethodDesc (method) +
- "' has some invalid arguments");
- else
- Report.Error (1594, loc,
- "Delegate '" + delegate_type.ToString () +
- "' has some invalid arguments.");
- Error (1503, loc,
- "Argument " + (j+1) +
- ": Cannot convert from '" + Argument.FullDesc (a)
- + "' to '" + pd.ParameterDesc (j) + "'");
- }
-
+ if (!may_fail)
+ Error_InvalidArguments (
+ loc, j, method, delegate_type,
+ Argument.FullDesc (a), pd.ParameterDesc (j));
return false;
}
@@ -3669,17 +5013,26 @@ namespace Mono.CSharp {
if (a_expr != conv)
a.Expr = conv;
}
+
+ if (parameter_type.IsPointer){
+ if (!ec.InUnsafe){
+ UnsafeError (loc);
+ return false;
+ }
+ }
+
+ Parameter.Modifier a_mod = a.GetParameterModifier () &
+ unchecked (~(Parameter.Modifier.OUT | Parameter.Modifier.REF));
+ Parameter.Modifier p_mod = pd.ParameterModifier (j) &
+ unchecked (~(Parameter.Modifier.OUT | Parameter.Modifier.REF));
- if (a.GetParameterModifier () != pd.ParameterModifier (j) &&
+ if (a_mod != p_mod &&
pd.ParameterModifier (pd_count - 1) != Parameter.Modifier.PARAMS) {
- if (!Location.IsNull (loc)) {
- Console.WriteLine ("A:P: " + a.GetParameterModifier ());
- Console.WriteLine ("PP:: " + pd.ParameterModifier (j));
- Console.WriteLine ("PT: " + parameter_type.IsByRef);
- Error (1502, loc,
+ if (!may_fail) {
+ Report.Error (1502, loc,
"The best overloaded match for method '" + FullMethodDesc (method)+
"' has some invalid arguments");
- Error (1503, loc,
+ Report.Error (1503, loc,
"Argument " + (j+1) +
": Cannot convert from '" + Argument.FullDesc (a)
+ "' to '" + pd.ParameterDesc (j) + "'");
@@ -3691,17 +5044,14 @@ namespace Mono.CSharp {
return true;
}
-
+
public override Expression DoResolve (EmitContext ec)
{
//
// First, resolve the expression that is used to
// trigger the invocation
//
- if (expr is BaseAccess)
- is_base = true;
-
- expr = expr.Resolve (ec);
+ expr = expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);
if (expr == null)
return null;
@@ -3717,7 +5067,7 @@ namespace Mono.CSharp {
}
if (!(expr is MethodGroupExpr)){
- report118 (loc, this.expr, "method group");
+ expr.Error_UnexpectedKind (ResolveFlags.MethodGroup, loc);
return null;
}
@@ -3731,16 +5081,30 @@ namespace Mono.CSharp {
}
}
- method = OverloadResolve (ec, (MethodGroupExpr) this.expr, Arguments, loc);
+ MethodGroupExpr mg = (MethodGroupExpr) expr;
+ method = OverloadResolve (ec, mg, Arguments, false, loc);
- if (method == null){
- Error (-6, loc,
- "Could not find any applicable function for this argument list");
+ if (method == null)
return null;
- }
- if (method is MethodInfo)
- type = ((MethodInfo)method).ReturnType;
+ MethodInfo mi = method as MethodInfo;
+ if (mi != null) {
+ type = TypeManager.TypeToCoreType (mi.ReturnType);
+ if (!mi.IsStatic && !mg.IsExplicitImpl && (mg.InstanceExpression == null)) {
+ SimpleName.Error_ObjectRefRequired (ec, loc, mi.Name);
+ return null;
+ }
+
+ Expression iexpr = mg.InstanceExpression;
+ if (mi.IsStatic && (iexpr != null) && !(iexpr is This)) {
+ if (mg.IdenticalTypeName)
+ mg.InstanceExpression = null;
+ else {
+ MemberAccess.error176 (loc, mi.Name);
+ return null;
+ }
+ }
+ }
if (type.IsPointer){
if (!ec.InUnsafe){
@@ -3749,6 +5113,30 @@ namespace Mono.CSharp {
}
}
+ //
+ // Only base will allow this invocation to happen.
+ //
+ if (mg.IsBase && method.IsAbstract){
+ Report.Error (205, loc, "Cannot call an abstract base member: " +
+ FullMethodDesc (method));
+ return null;
+ }
+
+ if (method.Name == "Finalize" && Arguments == null) {
+ if (mg.IsBase)
+ Report.Error (250, loc, "Do not directly call your base class Finalize method. It is called automatically from your destructor");
+ else
+ Report.Error (245, loc, "Destructors and object.Finalize cannot be called directly. Consider calling IDisposable.Dispose if available");
+ return null;
+ }
+
+ if ((method.Attributes & MethodAttributes.SpecialName) != 0) {
+ if (TypeManager.LookupDeclSpace (method.DeclaringType) != null || TypeManager.IsSpecialMethod (method)) {
+ Report.Error (571, loc, TypeManager.CSharpSignature (method) + ": can not call operator or accessor");
+ return null;
+ }
+ }
+
eclass = ExprClass.Value;
return this;
}
@@ -3761,26 +5149,30 @@ namespace Mono.CSharp {
ILGenerator ig = ec.ig;
int count = arguments.Count - idx;
Argument a = (Argument) arguments [idx];
- Type t = a.expr.Type;
- string array_type = t.FullName + "[]";
- LocalBuilder array;
-
- array = ig.DeclareLocal (Type.GetType (array_type));
+ Type t = a.Expr.Type;
+
IntConstant.EmitInt (ig, count);
- ig.Emit (OpCodes.Newarr, t);
- ig.Emit (OpCodes.Stloc, array);
+ ig.Emit (OpCodes.Newarr, TypeManager.TypeToCoreType (t));
int top = arguments.Count;
for (int j = idx; j < top; j++){
a = (Argument) arguments [j];
- ig.Emit (OpCodes.Ldloc, array);
+ ig.Emit (OpCodes.Dup);
IntConstant.EmitInt (ig, j - idx);
+
+ bool is_stobj;
+ OpCode op = ArrayAccess.GetStoreOpcode (t, out is_stobj);
+ if (is_stobj)
+ ig.Emit (OpCodes.Ldelema, t);
+
a.Emit (ec);
-
- ArrayAccess.EmitStoreOpcode (ig, t);
+
+ if (is_stobj)
+ ig.Emit (OpCodes.Stobj, t);
+ else
+ ig.Emit (op);
}
- ig.Emit (OpCodes.Ldloc, array);
}
/// <summary>
@@ -3790,15 +5182,25 @@ namespace Mono.CSharp {
/// The MethodBase argument might be null if the
/// emission of the arguments is known not to contain
/// a `params' field (for example in constructors or other routines
- /// that keep their arguments in this structure
+ /// that keep their arguments in this structure)
+ ///
+ /// if `dup_args' is true, a copy of the arguments will be left
+ /// on the stack. If `dup_args' is true, you can specify `this_arg'
+ /// which will be duplicated before any other args. Only EmitCall
+ /// should be using this interface.
/// </summary>
- public static void EmitArguments (EmitContext ec, MethodBase mb, ArrayList arguments)
+ public static void EmitArguments (EmitContext ec, MethodBase mb, ArrayList arguments, bool dup_args, LocalTemporary this_arg)
{
ParameterData pd;
if (mb != null)
pd = GetParameterData (mb);
else
pd = null;
+
+ LocalTemporary [] temps = null;
+
+ if (dup_args)
+ temps = new LocalTemporary [arguments.Count];
//
// If we are calling a params method with no arguments, special case it
@@ -3809,7 +5211,7 @@ namespace Mono.CSharp {
ILGenerator ig = ec.ig;
IntConstant.EmitInt (ig, 0);
- ig.Emit (OpCodes.Newarr, pd.ParameterType (0).GetElementType ());
+ ig.Emit (OpCodes.Newarr, TypeManager.GetElementType (pd.ParameterType (0)));
}
return;
@@ -3835,7 +5237,61 @@ namespace Mono.CSharp {
}
a.Emit (ec);
+ if (dup_args) {
+ ec.ig.Emit (OpCodes.Dup);
+ (temps [i] = new LocalTemporary (ec, a.Type)).Store (ec);
+ }
}
+
+ if (dup_args) {
+ if (this_arg != null)
+ this_arg.Emit (ec);
+
+ for (int i = 0; i < top; i ++)
+ temps [i].Emit (ec);
+ }
+
+ if (pd != null && pd.Count > top &&
+ pd.ParameterModifier (top) == Parameter.Modifier.PARAMS){
+ ILGenerator ig = ec.ig;
+
+ IntConstant.EmitInt (ig, 0);
+ ig.Emit (OpCodes.Newarr, TypeManager.GetElementType (pd.ParameterType (top)));
+ }
+ }
+
+ static Type[] GetVarargsTypes (EmitContext ec, MethodBase mb,
+ ArrayList arguments)
+ {
+ ParameterData pd = GetParameterData (mb);
+
+ if (arguments == null)
+ return new Type [0];
+
+ Argument a = (Argument) arguments [pd.Count - 1];
+ Arglist list = (Arglist) a.Expr;
+
+ return list.ArgumentTypes;
+ }
+
+ /// <summary>
+ /// This checks the ConditionalAttribute on the method
+ /// </summary>
+ static bool IsMethodExcluded (MethodBase method, EmitContext ec)
+ {
+ if (method.IsConstructor)
+ return false;
+
+ IMethodData md = TypeManager.GetMethod (method);
+ if (md != null)
+ return md.IsExcluded (ec);
+
+ // For some methods (generated by delegate class) GetMethod returns null
+ // because they are not included in builder_to_method table
+ if (method.DeclaringType is TypeBuilder)
+ return false;
+
+ return AttributeTester.IsConditionalMethodExcluded (method);
}
/// <remarks>
@@ -3857,44 +5313,87 @@ namespace Mono.CSharp {
bool is_static, Expression instance_expr,
MethodBase method, ArrayList Arguments, Location loc)
{
+ EmitCall (ec, is_base, is_static, instance_expr, method, Arguments, loc, false, false);
+ }
+
+ // `dup_args' leaves an extra copy of the arguments on the stack
+ // `omit_args' does not leave any arguments at all.
+ // So, basically, you could make one call with `dup_args' set to true,
+ // and then another with `omit_args' set to true, and the two calls
+ // would have the same set of arguments. However, each argument would
+ // only have been evaluated once.
+ public static void EmitCall (EmitContext ec, bool is_base,
+ bool is_static, Expression instance_expr,
+ MethodBase method, ArrayList Arguments, Location loc,
+ bool dup_args, bool omit_args)
+ {
ILGenerator ig = ec.ig;
bool struct_call = false;
+ bool this_call = false;
+ LocalTemporary this_arg = null;
Type decl_type = method.DeclaringType;
- //
- // This checks the `ConditionalAttribute' on the method, and the
- // ObsoleteAttribute
- //
- TypeManager.MethodFlags flags = TypeManager.GetMethodFlags (method);
- if ((flags & TypeManager.MethodFlags.IsObsolete) != 0){
- Report.Warning (
- 612, loc, "`" + TypeManager.CSharpSignature (method)+
- "' is obsolete");
+ if (!RootContext.StdLib) {
+ // Replace any calls to the system's System.Array type with calls to
+ // the newly created one.
+ if (method == TypeManager.system_int_array_get_length)
+ method = TypeManager.int_array_get_length;
+ else if (method == TypeManager.system_int_array_get_rank)
+ method = TypeManager.int_array_get_rank;
+ else if (method == TypeManager.system_object_array_clone)
+ method = TypeManager.object_array_clone;
+ else if (method == TypeManager.system_int_array_get_length_int)
+ method = TypeManager.int_array_get_length_int;
+ else if (method == TypeManager.system_int_array_get_lower_bound_int)
+ method = TypeManager.int_array_get_lower_bound_int;
+ else if (method == TypeManager.system_int_array_get_upper_bound_int)
+ method = TypeManager.int_array_get_upper_bound_int;
+ else if (method == TypeManager.system_void_array_copyto_array_int)
+ method = TypeManager.void_array_copyto_array_int;
+ }
+
+ if (ec.TestObsoleteMethodUsage) {
+ //
+ // This checks ObsoleteAttribute on the method and on the declaring type
+ //
+ ObsoleteAttribute oa = AttributeTester.GetMethodObsoleteAttribute (method);
+ if (oa != null)
+ AttributeTester.Report_ObsoleteMessage (oa, TypeManager.CSharpSignature (method), loc);
+
+
+ oa = AttributeTester.GetObsoleteAttribute (method.DeclaringType);
+ if (oa != null) {
+ AttributeTester.Report_ObsoleteMessage (oa, method.DeclaringType.FullName, loc);
+ }
}
- if ((flags & TypeManager.MethodFlags.ShouldIgnore) != 0)
- return;
+
+ if (IsMethodExcluded (method, ec))
+ return;
if (!is_static){
- if (decl_type.IsValueType)
+ this_call = instance_expr == null;
+ if (decl_type.IsValueType || (!this_call && instance_expr.Type.IsValueType))
struct_call = true;
+
//
// If this is ourselves, push "this"
//
- if (instance_expr == null){
+ if (!omit_args) {
+ Type t = null;
+ if (this_call) {
ig.Emit (OpCodes.Ldarg_0);
+ t = decl_type;
} else {
//
// Push the instance expression
//
- if (instance_expr.Type.IsSubclassOf (TypeManager.value_type)){
+ if (instance_expr.Type.IsValueType) {
//
// Special case: calls to a function declared in a
// reference-type with a value-type argument need
- // to have their value boxed.
-
- struct_call = true;
- if (decl_type.IsValueType){
+ // to have their value boxed.
+ if (decl_type.IsValueType) {
//
// If the expression implements IMemoryLocation, then
// we can optimize and use AddressOf on the
@@ -3902,48 +5401,70 @@ namespace Mono.CSharp {
//
// If not we have to use some temporary storage for
// it.
- if (instance_expr is IMemoryLocation){
+ if (instance_expr is IMemoryLocation) {
((IMemoryLocation)instance_expr).
AddressOf (ec, AddressOp.LoadStore);
- }
- else {
- Type t = instance_expr.Type;
-
+ } else {
+ LocalTemporary temp = new LocalTemporary (ec, instance_expr.Type);
instance_expr.Emit (ec);
- LocalBuilder temp = ig.DeclareLocal (t);
- ig.Emit (OpCodes.Stloc, temp);
- ig.Emit (OpCodes.Ldloca, temp);
+ temp.Store (ec);
+ temp.AddressOf (ec, AddressOp.Load);
}
+
+ // avoid the overhead of doing this all the time.
+ if (dup_args)
+ t = TypeManager.GetReferenceType (instance_expr.Type);
} else {
instance_expr.Emit (ec);
ig.Emit (OpCodes.Box, instance_expr.Type);
+ t = TypeManager.object_type;
}
- } else
+ } else {
instance_expr.Emit (ec);
+ t = instance_expr.Type;
+ }
+ }
+
+ if (dup_args) {
+ this_arg = new LocalTemporary (ec, t);
+ ig.Emit (OpCodes.Dup);
+ this_arg.Store (ec);
+ }
}
}
- EmitArguments (ec, method, Arguments);
+ if (!omit_args)
+ EmitArguments (ec, method, Arguments, dup_args, this_arg);
- if (is_static || struct_call || is_base){
- if (method is MethodInfo)
- ig.Emit (OpCodes.Call, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Call, (ConstructorInfo) method);
- } else {
- if (method is MethodInfo)
- ig.Emit (OpCodes.Callvirt, (MethodInfo) method);
- else
- ig.Emit (OpCodes.Callvirt, (ConstructorInfo) method);
+ OpCode call_op;
+ if (is_static || struct_call || is_base || (this_call && !method.IsVirtual))
+ call_op = OpCodes.Call;
+ else
+ call_op = OpCodes.Callvirt;
+
+ if ((method.CallingConvention & CallingConventions.VarArgs) != 0) {
+ Type[] varargs_types = GetVarargsTypes (ec, method, Arguments);
+ ig.EmitCall (call_op, (MethodInfo) method, varargs_types);
+ return;
}
+
+ //
+ // If you have:
+ // this.DoFoo ();
+ // and DoFoo is not virtual, you can omit the callvirt,
+ // because you don't need the null checking behavior.
+ //
+ if (method is MethodInfo)
+ ig.Emit (call_op, (MethodInfo) method);
+ else
+ ig.Emit (call_op, (ConstructorInfo) method);
}
public override void Emit (EmitContext ec)
{
MethodGroupExpr mg = (MethodGroupExpr) this.expr;
- EmitCall (
- ec, is_base, method.IsStatic, mg.InstanceExpression, method, Arguments, loc);
+ EmitCall (ec, mg.IsBase, method.IsStatic, mg.InstanceExpression, method, Arguments, loc);
}
public override void EmitStatement (EmitContext ec)
@@ -3954,12 +5475,118 @@ namespace Mono.CSharp {
// Pop the return value if there is one
//
if (method is MethodInfo){
- if (((MethodInfo)method).ReturnType != TypeManager.void_type)
+ Type ret = ((MethodInfo)method).ReturnType;
+ if (TypeManager.TypeToCoreType (ret) != TypeManager.void_type)
ec.ig.Emit (OpCodes.Pop);
}
}
}
+ public class InvocationOrCast : ExpressionStatement
+ {
+ Expression expr;
+ Expression argument;
+
+ public InvocationOrCast (Expression expr, Expression argument, Location loc)
+ {
+ this.expr = expr;
+ this.argument = argument;
+ this.loc = loc;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ //
+ // First try to resolve it as a cast.
+ //
+ TypeExpr te = expr.ResolveAsTypeTerminal (ec, true);
+ if (te != null) {
+ Cast cast = new Cast (te, argument, loc);
+ return cast.Resolve (ec);
+ }
+
+ //
+ // This can either be a type or a delegate invocation.
+ // Let's just resolve it and see what we'll get.
+ //
+ expr = expr.Resolve (ec, ResolveFlags.Type | ResolveFlags.VariableOrValue);
+ if (expr == null)
+ return null;
+
+ //
+ // Ok, so it's a Cast.
+ //
+ if (expr.eclass == ExprClass.Type) {
+ Cast cast = new Cast (new TypeExpression (expr.Type, loc), argument, loc);
+ return cast.Resolve (ec);
+ }
+
+ //
+ // It's a delegate invocation.
+ //
+ if (!TypeManager.IsDelegateType (expr.Type)) {
+ Error (149, "Method name expected");
+ return null;
+ }
+
+ ArrayList args = new ArrayList ();
+ args.Add (new Argument (argument, Argument.AType.Expression));
+ DelegateInvocation invocation = new DelegateInvocation (expr, args, loc);
+ return invocation.Resolve (ec);
+ }
+
+ void error201 ()
+ {
+ Error (201, "Only assignment, call, increment, decrement and new object " +
+ "expressions can be used as a statement");
+ }
+
+ public override ExpressionStatement ResolveStatement (EmitContext ec)
+ {
+ //
+ // First try to resolve it as a cast.
+ //
+ TypeExpr te = expr.ResolveAsTypeTerminal (ec, true);
+ if (te != null) {
+ error201 ();
+ return null;
+ }
+
+ //
+ // This can either be a type or a delegate invocation.
+ // Let's just resolve it and see what we'll get.
+ //
+ expr = expr.Resolve (ec, ResolveFlags.Type | ResolveFlags.VariableOrValue);
+ if ((expr == null) || (expr.eclass == ExprClass.Type)) {
+ error201 ();
+ return null;
+ }
+
+ //
+ // It's a delegate invocation.
+ //
+ if (!TypeManager.IsDelegateType (expr.Type)) {
+ Error (149, "Method name expected");
+ return null;
+ }
+
+ ArrayList args = new ArrayList ();
+ args.Add (new Argument (argument, Argument.AType.Expression));
+ DelegateInvocation invocation = new DelegateInvocation (expr, args, loc);
+ return invocation.ResolveStatement (ec);
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ throw new Exception ("Cannot happen");
+ }
+
+ public override void EmitStatement (EmitContext ec)
+ {
+ throw new Exception ("Cannot happen");
+ }
+ }
+
//
// This class is used to "disable" the code generation for the
// temporary variable when initializing value types.
@@ -3974,11 +5601,16 @@ namespace Mono.CSharp {
/// <summary>
/// Implements the new expression
/// </summary>
- public class New : ExpressionStatement {
+ public class New : ExpressionStatement, IMemoryLocation {
public readonly ArrayList Arguments;
- public readonly string RequestedType;
- Location loc;
+ //
+ // During bootstrap, it contains the RequestedType,
+ // but if `type' is not null, it *might* contain a NewDelegate
+ // (because of field multi-initialization)
+ //
+ public Expression RequestedType;
+
MethodBase method = null;
//
@@ -3986,22 +5618,24 @@ namespace Mono.CSharp {
// we will not leave anything on the stack.
//
Expression value_target;
+ bool value_target_set = false;
- public New (string requested_type, ArrayList arguments, Location l)
+ public New (Expression requested_type, ArrayList arguments, Location l)
{
RequestedType = requested_type;
Arguments = arguments;
loc = l;
}
- public Expression ValueTypeVariable {
- get {
- return value_target;
- }
-
- set {
- value_target = value;
+ public bool SetValueTypeVariable (Expression value)
+ {
+ value_target = value;
+ value_target_set = true;
+ if (!(value_target is IMemoryLocation)){
+ Error_UnexpectedKind ("variable", loc);
+ return false;
}
+ return true;
}
//
@@ -4030,28 +5664,52 @@ namespace Mono.CSharp {
// instead of Call + Push-temp on value types.
// value_target = MyEmptyExpression;
}
-
+
public override Expression DoResolve (EmitContext ec)
{
- type = RootContext.LookupType (ec.DeclSpace, RequestedType, false, loc);
+ //
+ // The New DoResolve might be called twice when initializing field
+ // expressions (see EmitFieldInitializers, the call to
+ // GetInitializerExpression will perform a resolve on the expression,
+ // and later the assign will trigger another resolution
+ //
+ // This leads to bugs (#37014)
+ //
+ if (type != null){
+ if (RequestedType is NewDelegate)
+ return RequestedType;
+ return this;
+ }
- if (type == null)
+ TypeExpr texpr = RequestedType.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
return null;
+
+ type = texpr.ResolveType (ec);
+ CheckObsoleteAttribute (type);
+
bool IsDelegate = TypeManager.IsDelegateType (type);
- if (IsDelegate)
- return (new NewDelegate (type, Arguments, loc)).Resolve (ec);
+ if (IsDelegate){
+ RequestedType = (new NewDelegate (type, Arguments, loc)).Resolve (ec);
+ if (RequestedType != null)
+ if (!(RequestedType is NewDelegate))
+ throw new Exception ("NewDelegate.Resolve returned a non NewDelegate: " + RequestedType.GetType ());
+ return RequestedType;
+ }
+
+ if (type.IsAbstract && type.IsSealed) {
+ Report.Error (712, loc, "Cannot create an instance of the static class '{0}'", TypeManager.CSharpName (type));
+ return null;
+ }
if (type.IsInterface || type.IsAbstract){
- Report.Error (
- 144, loc, "It is not possible to create instances of interfaces " +
- "or abstract classes");
+ Error (144, "It is not possible to create instances of interfaces or abstract classes");
return null;
}
- bool is_struct = false;
- is_struct = type.IsSubclassOf (TypeManager.value_type);
+ bool is_struct = type.IsValueType;
eclass = ExprClass.Value;
//
@@ -4062,7 +5720,8 @@ namespace Mono.CSharp {
return this;
Expression ml;
- ml = MemberLookupFinal (ec, type, ".ctor",
+ // For member-lookup, treat 'new Foo (bar)' as call to 'foo.ctor (bar)', where 'foo' is of type 'Foo'.
+ ml = MemberLookupFinal (ec, type, type, ".ctor",
MemberTypes.Constructor,
AllBindingFlags | BindingFlags.DeclaredOnly, loc);
@@ -4071,7 +5730,7 @@ namespace Mono.CSharp {
if (! (ml is MethodGroupExpr)){
if (!is_struct){
- report118 (loc, ml, "method group");
+ ml.Error_UnexpectedKind ("method group", loc);
return null;
}
}
@@ -4084,17 +5743,20 @@ namespace Mono.CSharp {
}
}
- method = Invocation.OverloadResolve (ec, (MethodGroupExpr) ml,
- Arguments, loc);
+ method = Invocation.OverloadResolve (
+ ec, (MethodGroupExpr) ml, Arguments, false, loc);
}
-
- if (method == null && !is_struct) {
- Error (1501, loc,
- "New invocation: Can not find a constructor for " +
- "this argument list");
- return null;
+
+ if (method == null) {
+ if (!is_struct || Arguments.Count > 0) {
+ Error (1501, String.Format (
+ "New invocation: Can not find a constructor in `{0}' for this argument list",
+ TypeManager.CSharpName (type)));
+ return null;
+ }
}
+
return this;
}
@@ -4124,21 +5786,24 @@ namespace Mono.CSharp {
//
bool DoEmit (EmitContext ec, bool need_value_on_stack)
{
- bool is_value_type = type.IsSubclassOf (TypeManager.value_type);
+ bool is_value_type = type.IsValueType;
ILGenerator ig = ec.ig;
if (is_value_type){
IMemoryLocation ml;
- if (value_target == null)
+ // Allow DoEmit() to be called multiple times.
+ // We need to create a new LocalTemporary each time since
+ // you can't share LocalBuilders among ILGeneators.
+ if (!value_target_set)
value_target = new LocalTemporary (ec, type);
-
+
ml = (IMemoryLocation) value_target;
ml.AddressOf (ec, AddressOp.Store);
}
if (method != null)
- Invocation.EmitArguments (ec, method, Arguments);
+ Invocation.EmitArguments (ec, method, Arguments, false, null);
if (is_value_type){
if (method == null)
@@ -4166,6 +5831,34 @@ namespace Mono.CSharp {
if (DoEmit (ec, false))
ec.ig.Emit (OpCodes.Pop);
}
+
+ public void AddressOf (EmitContext ec, AddressOp Mode)
+ {
+ if (!type.IsValueType){
+ //
+ // We throw an exception. So far, I believe we only need to support
+ // value types:
+ // foreach (int j in new StructType ())
+ // see bug 42390
+ //
+ throw new Exception ("AddressOf should not be used for classes");
+ }
+
+ if (!value_target_set)
+ value_target = new LocalTemporary (ec, type);
+
+ IMemoryLocation ml = (IMemoryLocation) value_target;
+ ml.AddressOf (ec, AddressOp.Store);
+ if (method != null)
+ Invocation.EmitArguments (ec, method, Arguments, false, null);
+
+ if (method == null)
+ ec.ig.Emit (OpCodes.Initobj, type);
+ else
+ ec.ig.Emit (OpCodes.Call, (ConstructorInfo) method);
+
+ ((IMemoryLocation) value_target).AddressOf (ec, Mode);
+ }
}
/// <summary>
@@ -4178,10 +5871,9 @@ namespace Mono.CSharp {
/// initialization data and the other which does not need dimensions
/// specified but where initialization data is mandatory.
/// </remarks>
- public class ArrayCreation : ExpressionStatement {
- string requested_type, rank;
+ public class ArrayCreation : Expression {
+ Expression requested_base_type;
ArrayList initializers;
- Location loc;
//
// The list of Argument types.
@@ -4199,7 +5891,9 @@ namespace Mono.CSharp {
bool is_one_dimensional = false;
bool is_builtin_type = false;
bool expect_initializers = false;
+ int num_arguments = 0;
int dimensions = 0;
+ string rank;
ArrayList array_data;
@@ -4210,69 +5904,55 @@ namespace Mono.CSharp {
// via the InitializeArray method - through EmitStaticInitializers
//
int num_automatic_initializers;
+
+ const int max_automatic_initializers = 6;
- public ArrayCreation (string requested_type, ArrayList exprs, string rank, ArrayList initializers, Location l)
+ public ArrayCreation (Expression requested_base_type, ArrayList exprs, string rank, ArrayList initializers, Location l)
{
- this.requested_type = requested_type;
+ this.requested_base_type = requested_base_type;
this.initializers = initializers;
this.rank = rank;
loc = l;
arguments = new ArrayList ();
- foreach (Expression e in exprs)
+ foreach (Expression e in exprs) {
arguments.Add (new Argument (e, Argument.AType.Expression));
+ num_arguments++;
+ }
}
- public ArrayCreation (string requested_type, string rank, ArrayList initializers, Location l)
+ public ArrayCreation (Expression requested_base_type, string rank, ArrayList initializers, Location l)
{
- this.requested_type = requested_type;
+ this.requested_base_type = requested_base_type;
this.initializers = initializers;
+ this.rank = rank;
loc = l;
- this.rank = rank.Substring (0, rank.LastIndexOf ("["));
-
- string tmp = rank.Substring (rank.LastIndexOf ("["));
-
- dimensions = tmp.Length - 1;
+ //this.rank = rank.Substring (0, rank.LastIndexOf ('['));
+ //
+ //string tmp = rank.Substring (rank.LastIndexOf ('['));
+ //
+ //dimensions = tmp.Length - 1;
expect_initializers = true;
}
- public static string FormArrayType (string base_type, int idx_count, string rank)
- {
- StringBuilder sb = new StringBuilder (base_type);
-
- sb.Append (rank);
-
- sb.Append ("[");
- for (int i = 1; i < idx_count; i++)
- sb.Append (",");
-
- sb.Append ("]");
-
- return sb.ToString ();
- }
-
- public static string FormElementType (string base_type, int idx_count, string rank)
+ public Expression FormArrayType (Expression base_type, int idx_count, string rank)
{
- StringBuilder sb = new StringBuilder (base_type);
+ StringBuilder sb = new StringBuilder (rank);
sb.Append ("[");
for (int i = 1; i < idx_count; i++)
sb.Append (",");
sb.Append ("]");
-
- sb.Append (rank);
- string val = sb.ToString ();
-
- return val.Substring (0, val.LastIndexOf ("["));
+ return new ComposedCast (base_type, sb.ToString (), loc);
}
- void error178 ()
+ void Error_IncorrectArrayInitializer ()
{
- Report.Error (178, loc, "Incorrectly structured array initializer");
+ Error (178, "Incorrectly structured array initializer");
}
public bool CheckIndices (EmitContext ec, ArrayList probe, int idx, bool specified_dims)
@@ -4284,43 +5964,68 @@ namespace Mono.CSharp {
return false;
if (!(a.Expr is Constant)) {
- Report.Error (150, loc, "A constant value is expected");
+ Error (150, "A constant value is expected");
return false;
}
int value = (int) ((Constant) a.Expr).GetValue ();
if (value != probe.Count) {
- error178 ();
+ Error_IncorrectArrayInitializer ();
return false;
}
bounds [idx] = value;
}
-
+
+ int child_bounds = -1;
foreach (object o in probe) {
if (o is ArrayList) {
+ int current_bounds = ((ArrayList) o).Count;
+
+ if (child_bounds == -1)
+ child_bounds = current_bounds;
+
+ else if (child_bounds != current_bounds){
+ Error_IncorrectArrayInitializer ();
+ return false;
+ }
+ if (specified_dims && (idx + 1 >= arguments.Count)){
+ Error (623, "Array initializers can only be used in a variable or field initializer, try using the new expression");
+ return false;
+ }
+
bool ret = CheckIndices (ec, (ArrayList) o, idx + 1, specified_dims);
if (!ret)
return false;
} else {
+ if (child_bounds != -1){
+ Error_IncorrectArrayInitializer ();
+ return false;
+ }
+
Expression tmp = (Expression) o;
tmp = tmp.Resolve (ec);
if (tmp == null)
- continue;
+ return false;
// Console.WriteLine ("I got: " + tmp);
// Handle initialization from vars, fields etc.
- Expression conv = ConvertImplicitRequired (
+ Expression conv = Convert.ImplicitConversionRequired (
ec, tmp, underlying_type, loc);
if (conv == null)
return false;
-
- if (conv is StringConstant)
+
+ if (conv is StringConstant || conv is DecimalConstant || conv is NullCast) {
+ // These are subclasses of Constant that can appear as elements of an
+ // array that cannot be statically initialized (with num_automatic_initializers
+ // > max_automatic_initializers), so num_automatic_initializers should be left as zero.
array_data.Add (conv);
- else if (conv is Constant) {
+ } else if (conv is Constant) {
+ // These are the types of Constant that can appear in arrays that can be
+ // statically allocated.
array_data.Add (conv);
num_automatic_initializers++;
} else
@@ -4354,7 +6059,7 @@ namespace Mono.CSharp {
}
- public bool ValidateInitializers (EmitContext ec)
+ public bool ValidateInitializers (EmitContext ec, Type array_type)
{
if (initializers == null) {
if (expect_initializers)
@@ -4363,9 +6068,6 @@ namespace Mono.CSharp {
return true;
}
- underlying_type = RootContext.LookupType (
- ec.DeclSpace, requested_type, false, loc);
-
if (underlying_type == null)
return false;
@@ -4392,7 +6094,7 @@ namespace Mono.CSharp {
UpdateIndices (ec);
if (arguments.Count != dimensions) {
- error178 ();
+ Error_IncorrectArrayInitializer ();
return false;
}
@@ -4400,11 +6102,6 @@ namespace Mono.CSharp {
}
}
- void Error_NegativeArrayIndex ()
- {
- Report.Error (284, loc, "Can not create array with a negative size");
- }
-
//
// Converts `source' to an int, uint, long or ulong.
//
@@ -4415,15 +6112,15 @@ namespace Mono.CSharp {
bool old_checked = ec.CheckState;
ec.CheckState = true;
- target = ConvertImplicit (ec, source, TypeManager.int32_type, loc);
+ target = Convert.ImplicitConversion (ec, source, TypeManager.int32_type, loc);
if (target == null){
- target = ConvertImplicit (ec, source, TypeManager.uint32_type, loc);
+ target = Convert.ImplicitConversion (ec, source, TypeManager.uint32_type, loc);
if (target == null){
- target = ConvertImplicit (ec, source, TypeManager.int64_type, loc);
+ target = Convert.ImplicitConversion (ec, source, TypeManager.int64_type, loc);
if (target == null){
- target = ConvertImplicit (ec, source, TypeManager.uint64_type, loc);
+ target = Convert.ImplicitConversion (ec, source, TypeManager.uint64_type, loc);
if (target == null)
- Expression.Error_CannotConvertImplicit (loc, source.Type, TypeManager.int32_type);
+ Convert.Error_CannotImplicitConversion (loc, source.Type, TypeManager.int32_type);
}
}
}
@@ -4435,14 +6132,14 @@ namespace Mono.CSharp {
if (target is Constant){
if (target is IntConstant){
if (((IntConstant) target).Value < 0){
- Error_NegativeArrayIndex ();
+ Expression.Error_NegativeArrayIndex (loc);
return null;
}
}
if (target is LongConstant){
if (((LongConstant) target).Value < 0){
- Error_NegativeArrayIndex ();
+ Expression.Error_NegativeArrayIndex (loc);
return null;
}
}
@@ -4451,16 +6148,58 @@ namespace Mono.CSharp {
return target;
}
+
+ //
+ // Creates the type of the array
+ //
+ bool LookupType (EmitContext ec)
+ {
+ StringBuilder array_qualifier = new StringBuilder (rank);
+
+ //
+ // `In the first form allocates an array instace of the type that results
+ // from deleting each of the individual expression from the expression list'
+ //
+ if (num_arguments > 0) {
+ array_qualifier.Append ("[");
+ for (int i = num_arguments-1; i > 0; i--)
+ array_qualifier.Append (",");
+ array_qualifier.Append ("]");
+ }
+
+ //
+ // Lookup the type
+ //
+ TypeExpr array_type_expr;
+ array_type_expr = new ComposedCast (requested_base_type, array_qualifier.ToString (), loc);
+ array_type_expr = array_type_expr.ResolveAsTypeTerminal (ec, false);
+ if (array_type_expr == null)
+ return false;
+
+ type = array_type_expr.ResolveType (ec);
+
+ if (!type.IsArray) {
+ Error (622, "Can only use array initializer expressions to assign to array types. Try using a new expression instead.");
+ return false;
+ }
+ underlying_type = TypeManager.GetElementType (type);
+ dimensions = type.GetArrayRank ();
+
+ return true;
+ }
public override Expression DoResolve (EmitContext ec)
{
int arg_count;
+ if (!LookupType (ec))
+ return null;
+
//
// First step is to validate the initializers and fill
// in any missing bits
//
- if (!ValidateInitializers (ec))
+ if (!ValidateInitializers (ec, type))
return null;
if (arguments == null)
@@ -4471,25 +6210,21 @@ namespace Mono.CSharp {
if (!a.Resolve (ec, loc))
return null;
- Expression real_arg = ExpressionToArrayArgument (ec, a.expr);
+ Expression real_arg = ExpressionToArrayArgument (ec, a.Expr, loc);
if (real_arg == null)
return null;
- a.expr = real_arg;
+ a.Expr = real_arg;
}
}
- string array_type = FormArrayType (requested_type, arg_count, rank);
- string element_type = FormElementType (requested_type, arg_count, rank);
+ array_element_type = TypeManager.GetElementType (type);
- type = RootContext.LookupType (ec.DeclSpace, array_type, false, loc);
-
- array_element_type = RootContext.LookupType (
- ec.DeclSpace, element_type, false, loc);
-
- if (type == null)
+ if (array_element_type.IsAbstract && array_element_type.IsSealed) {
+ Report.Error (719, loc, "'{0}': array elements cannot be of static type", TypeManager.CSharpName (array_element_type));
return null;
-
+ }
+
if (arg_count == 1) {
is_one_dimensional = true;
eclass = ExprClass.Value;
@@ -4497,7 +6232,7 @@ namespace Mono.CSharp {
}
is_builtin_type = TypeManager.IsBuiltinType (type);
-
+
if (is_builtin_type) {
Expression ml;
@@ -4505,20 +6240,21 @@ namespace Mono.CSharp {
AllBindingFlags, loc);
if (!(ml is MethodGroupExpr)) {
- report118 (loc, ml, "method group");
+ ml.Error_UnexpectedKind ("method group", loc);
return null;
}
if (ml == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
+ Error (-6, "New invocation: Can not find a constructor for " +
"this argument list");
return null;
}
- new_method = Invocation.OverloadResolve (ec, (MethodGroupExpr) ml, arguments, loc);
+ new_method = Invocation.OverloadResolve (
+ ec, (MethodGroupExpr) ml, arguments, false, loc);
if (new_method == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
+ Error (-6, "New invocation: Can not find a constructor for " +
"this argument list");
return null;
}
@@ -4526,7 +6262,7 @@ namespace Mono.CSharp {
eclass = ExprClass.Value;
return this;
} else {
- ModuleBuilder mb = CodeGen.ModuleBuilder;
+ ModuleBuilder mb = CodeGen.Module.Builder;
ArrayList args = new ArrayList ();
if (arguments != null) {
@@ -4545,7 +6281,7 @@ namespace Mono.CSharp {
arg_types);
if (new_method == null) {
- Report.Error (-6, loc, "New invocation: Can not find a constructor for " +
+ Error (-6, "New invocation: Can not find a constructor for " +
"this argument list");
return null;
}
@@ -4562,9 +6298,12 @@ namespace Mono.CSharp {
byte [] element;
int count = array_data.Count;
+ if (underlying_type.IsEnum)
+ underlying_type = TypeManager.EnumToUnderlying (underlying_type);
+
factor = GetTypeSize (underlying_type);
if (factor == 0)
- return null;
+ throw new Exception ("unrecognized type in MakeByteBlob: " + underlying_type);
data = new byte [(count * factor + 4) & ~3];
int idx = 0;
@@ -4668,8 +6407,27 @@ namespace Mono.CSharp {
bool val = (bool) v;
data [idx] = (byte) (val ? 1 : 0);
}
+ } else if (underlying_type == TypeManager.decimal_type){
+ if (!(v is Expression)){
+ int [] bits = Decimal.GetBits ((decimal) v);
+ int p = idx;
+
+ // FIXME: For some reason, this doesn't work on the MS runtime.
+ int [] nbits = new int [4];
+ nbits [0] = bits [3];
+ nbits [1] = bits [2];
+ nbits [2] = bits [0];
+ nbits [3] = bits [1];
+
+ for (int j = 0; j < 4; j++){
+ data [p++] = (byte) (nbits [j] & 0xff);
+ data [p++] = (byte) ((nbits [j] >> 8) & 0xff);
+ data [p++] = (byte) ((nbits [j] >> 16) & 0xff);
+ data [p++] = (byte) (nbits [j] >> 24);
+ }
+ }
} else
- throw new Exception ("Unrecognized type in MakeByteBlob");
+ throw new Exception ("Unrecognized type in MakeByteBlob: " + underlying_type);
idx += factor;
}
@@ -4680,7 +6438,7 @@ namespace Mono.CSharp {
//
// Emits the initializers for the array
//
- void EmitStaticInitializers (EmitContext ec, bool is_expression)
+ void EmitStaticInitializers (EmitContext ec)
{
//
// First, the static data
@@ -4689,40 +6447,34 @@ namespace Mono.CSharp {
ILGenerator ig = ec.ig;
byte [] data = MakeByteBlob (array_data, underlying_type, loc);
-
- if (data != null) {
- fb = RootContext.MakeStaticData (data);
- if (is_expression)
- ig.Emit (OpCodes.Dup);
- ig.Emit (OpCodes.Ldtoken, fb);
- ig.Emit (OpCodes.Call,
- TypeManager.void_initializearray_array_fieldhandle);
- }
+ fb = RootContext.MakeStaticData (data);
+
+ ig.Emit (OpCodes.Dup);
+ ig.Emit (OpCodes.Ldtoken, fb);
+ ig.Emit (OpCodes.Call,
+ TypeManager.void_initializearray_array_fieldhandle);
}
-
+
//
// Emits pieces of the array that can not be computed at compile
// time (variables and string locations).
//
// This always expect the top value on the stack to be the array
//
- void EmitDynamicInitializers (EmitContext ec, bool is_expression)
+ void EmitDynamicInitializers (EmitContext ec)
{
ILGenerator ig = ec.ig;
int dims = bounds.Count;
int [] current_pos = new int [dims];
int top = array_data.Count;
- LocalBuilder temp = ig.DeclareLocal (type);
-
- ig.Emit (OpCodes.Stloc, temp);
MethodInfo set = null;
if (dims != 1){
Type [] args;
ModuleBuilder mb = null;
- mb = CodeGen.ModuleBuilder;
+ mb = CodeGen.Module.Builder;
args = new Type [dims + 1];
int j;
@@ -4749,23 +6501,27 @@ namespace Mono.CSharp {
// Basically we do this for string literals and
// other non-literal expressions
//
- if (e is StringConstant || !(e is Constant) ||
- num_automatic_initializers <= 2) {
+ if (e is EnumConstant){
+ e = ((EnumConstant) e).Child;
+ }
+
+ if (e is StringConstant || e is DecimalConstant || !(e is Constant) ||
+ num_automatic_initializers <= max_automatic_initializers) {
Type etype = e.Type;
- ig.Emit (OpCodes.Ldloc, temp);
+ ig.Emit (OpCodes.Dup);
- for (int idx = dims; idx > 0; ) {
- idx--;
+ for (int idx = 0; idx < dims; idx++)
IntConstant.EmitInt (ig, current_pos [idx]);
- }
//
// If we are dealing with a struct, get the
// address of it, so we can store it.
//
- if (etype.IsSubclassOf (TypeManager.value_type) &&
- !TypeManager.IsBuiltinType (etype)){
+ if ((dims == 1) &&
+ etype.IsSubclassOf (TypeManager.value_type) &&
+ (!TypeManager.IsBuiltinOrEnum (etype) ||
+ etype == TypeManager.decimal_type)) {
if (e is New){
New n = (New) e;
@@ -4775,41 +6531,53 @@ namespace Mono.CSharp {
//
n.DisableTemporaryValueType ();
}
-
+
ig.Emit (OpCodes.Ldelema, etype);
}
-
+
e.Emit (ec);
-
- if (dims == 1)
- ArrayAccess.EmitStoreOpcode (ig, array_element_type);
- else
+
+ if (dims == 1) {
+ bool is_stobj;
+ OpCode op = ArrayAccess.GetStoreOpcode (etype, out is_stobj);
+ if (is_stobj)
+ ig.Emit (OpCodes.Stobj, etype);
+ else
+ ig.Emit (op);
+ } else
ig.Emit (OpCodes.Call, set);
+
}
}
//
// Advance counter
//
- for (int j = 0; j < dims; j++){
+ for (int j = dims - 1; j >= 0; j--){
current_pos [j]++;
if (current_pos [j] < (int) bounds [j])
break;
current_pos [j] = 0;
}
}
-
- if (is_expression)
- ig.Emit (OpCodes.Ldloc, temp);
}
void EmitArrayArguments (EmitContext ec)
{
- foreach (Argument a in arguments)
+ ILGenerator ig = ec.ig;
+
+ foreach (Argument a in arguments) {
+ Type atype = a.Type;
a.Emit (ec);
+
+ if (atype == TypeManager.uint64_type)
+ ig.Emit (OpCodes.Conv_Ovf_U4);
+ else if (atype == TypeManager.int64_type)
+ ig.Emit (OpCodes.Conv_Ovf_I4);
+ }
}
- void DoEmit (EmitContext ec, bool is_statement)
+ public override void Emit (EmitContext ec)
{
ILGenerator ig = ec.ig;
@@ -4829,80 +6597,164 @@ namespace Mono.CSharp {
//
bool dynamic_initializers = true;
- if (underlying_type != TypeManager.string_type &&
- underlying_type != TypeManager.object_type) {
- if (num_automatic_initializers > 2)
- EmitStaticInitializers (ec, dynamic_initializers || !is_statement);
- }
+ // This will never be true for array types that cannot be statically
+ // initialized. num_automatic_initializers will always be zero. See
+ // CheckIndices.
+ if (num_automatic_initializers > max_automatic_initializers)
+ EmitStaticInitializers (ec);
if (dynamic_initializers)
- EmitDynamicInitializers (ec, !is_statement);
+ EmitDynamicInitializers (ec);
}
}
-
- public override void Emit (EmitContext ec)
- {
- DoEmit (ec, false);
- }
- public override void EmitStatement (EmitContext ec)
+ public object EncodeAsAttribute ()
{
- DoEmit (ec, true);
+ if (!is_one_dimensional){
+ Report.Error (-211, Location, "attribute can not encode multi-dimensional arrays");
+ return null;
+ }
+
+ if (array_data == null){
+ Report.Error (-212, Location, "array should be initialized when passing it to an attribute");
+ return null;
+ }
+
+ object [] ret = new object [array_data.Count];
+ int i = 0;
+ foreach (Expression e in array_data){
+ object v;
+
+ if (e is NullLiteral)
+ v = null;
+ else {
+ if (!Attribute.GetAttributeArgumentExpression (e, Location, array_element_type, out v))
+ return null;
+ }
+ ret [i++] = v;
+ }
+ return ret;
}
-
}
/// <summary>
/// Represents the `this' construct
/// </summary>
- public class This : Expression, IAssignMethod, IMemoryLocation {
- Location loc;
+ public class This : Expression, IAssignMethod, IMemoryLocation, IVariable {
+
+ Block block;
+ VariableInfo variable_info;
+ public This (Block block, Location loc)
+ {
+ this.loc = loc;
+ this.block = block;
+ }
+
public This (Location loc)
{
this.loc = loc;
}
- public override Expression DoResolve (EmitContext ec)
+ public VariableInfo VariableInfo {
+ get { return variable_info; }
+ }
+
+ public bool VerifyFixed (bool is_expression)
+ {
+ if ((variable_info == null) || (variable_info.LocalInfo == null))
+ return false;
+ else
+ return variable_info.LocalInfo.IsFixed;
+ }
+
+ public bool ResolveBase (EmitContext ec)
{
eclass = ExprClass.Variable;
type = ec.ContainerType;
- if (ec.IsStatic){
- Report.Error (26, loc,
- "Keyword this not valid in static code");
+ if (ec.IsStatic) {
+ Error (26, "Keyword this not valid in static code");
+ return false;
+ }
+
+ if ((block != null) && (block.ThisVariable != null))
+ variable_info = block.ThisVariable.VariableInfo;
+
+ return true;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ if (!ResolveBase (ec))
return null;
+
+ if ((variable_info != null) && !variable_info.IsAssigned (ec)) {
+ Error (188, "The this object cannot be used before all " +
+ "of its fields are assigned to");
+ variable_info.SetAssigned (ec);
+ return this;
}
-
+
+ if (ec.IsFieldInitializer) {
+ Error (27, "Keyword `this' can't be used outside a constructor, " +
+ "a method or a property.");
+ return null;
+ }
+
return this;
}
override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
{
- DoResolve (ec);
+ if (!ResolveBase (ec))
+ return null;
+
+ if (variable_info != null)
+ variable_info.SetAssigned (ec);
if (ec.TypeContainer is Class){
- Report.Error (1604, loc, "Cannot assign to `this'");
+ Error (1604, "Cannot assign to `this'");
return null;
}
return this;
}
- public override void Emit (EmitContext ec)
+ public void Emit (EmitContext ec, bool leave_copy)
{
- ec.ig.Emit (OpCodes.Ldarg_0);
+ Emit (ec);
+ if (leave_copy)
+ ec.ig.Emit (OpCodes.Dup);
}
-
- public void EmitAssign (EmitContext ec, Expression source)
+
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
- source.Emit (ec);
- ec.ig.Emit (OpCodes.Starg, 0);
+ ILGenerator ig = ec.ig;
+
+ if (ec.TypeContainer is Struct){
+ ec.EmitThis ();
+ source.Emit (ec);
+ if (leave_copy)
+ ec.ig.Emit (OpCodes.Dup);
+ ig.Emit (OpCodes.Stobj, type);
+ } else {
+ throw new Exception ("how did you get here");
+ }
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ ec.EmitThis ();
+ if (ec.TypeContainer is Struct)
+ ig.Emit (OpCodes.Ldobj, type);
}
public void AddressOf (EmitContext ec, AddressOp mode)
{
- ec.ig.Emit (OpCodes.Ldarg_0);
+ ec.EmitThis ();
// FIMXE
// FIGURE OUT WHY LDARG_S does not work
@@ -4916,14 +6768,115 @@ namespace Mono.CSharp {
}
/// <summary>
+ /// Represents the `__arglist' construct
+ /// </summary>
+ public class ArglistAccess : Expression
+ {
+ public ArglistAccess (Location loc)
+ {
+ this.loc = loc;
+ }
+
+ public bool ResolveBase (EmitContext ec)
+ {
+ eclass = ExprClass.Variable;
+ type = TypeManager.runtime_argument_handle_type;
+ return true;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ if (!ResolveBase (ec))
+ return null;
+
+ if (ec.IsFieldInitializer || !ec.CurrentBlock.HasVarargs) {
+ Error (190, "The __arglist construct is valid only within " +
+ "a variable argument method.");
+ return null;
+ }
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ec.ig.Emit (OpCodes.Arglist);
+ }
+ }
+
+ /// <summary>
+ /// Represents the `__arglist (....)' construct
+ /// </summary>
+ public class Arglist : Expression
+ {
+ public readonly Argument[] Arguments;
+
+ public Arglist (Argument[] args, Location l)
+ {
+ Arguments = args;
+ loc = l;
+ }
+
+ public Type[] ArgumentTypes {
+ get {
+ Type[] retval = new Type [Arguments.Length];
+ for (int i = 0; i < Arguments.Length; i++)
+ retval [i] = Arguments [i].Type;
+ return retval;
+ }
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ eclass = ExprClass.Variable;
+ type = TypeManager.runtime_argument_handle_type;
+
+ foreach (Argument arg in Arguments) {
+ if (!arg.Resolve (ec, loc))
+ return null;
+ }
+
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ foreach (Argument arg in Arguments)
+ arg.Emit (ec);
+ }
+ }
+
+ //
+ // This produces the value that renders an instance, used by the iterators code
+ //
+ public class ProxyInstance : Expression, IMemoryLocation {
+ public override Expression DoResolve (EmitContext ec)
+ {
+ eclass = ExprClass.Variable;
+ type = ec.ContainerType;
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ec.ig.Emit (OpCodes.Ldarg_0);
+
+ }
+
+ public void AddressOf (EmitContext ec, AddressOp mode)
+ {
+ ec.ig.Emit (OpCodes.Ldarg_0);
+ }
+ }
+
+ /// <summary>
/// Implements the typeof operator
/// </summary>
public class TypeOf : Expression {
- public readonly string QueriedType;
- Type typearg;
- Location loc;
+ public Expression QueriedType;
+ protected Type typearg;
- public TypeOf (string queried_type, Location l)
+ public TypeOf (Expression queried_type, Location l)
{
QueriedType = queried_type;
loc = l;
@@ -4931,11 +6884,23 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- typearg = RootContext.LookupType (
- ec.DeclSpace, QueriedType, false, loc);
+ TypeExpr texpr = QueriedType.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
+ return null;
- if (typearg == null)
+ typearg = texpr.ResolveType (ec);
+
+ if (typearg == TypeManager.void_type) {
+ Error (673, "System.Void cannot be used from C# - " +
+ "use typeof (void) to get the void type object");
return null;
+ }
+
+ if (typearg.IsPointer && !ec.InUnsafe){
+ UnsafeError (loc);
+ return null;
+ }
+ CheckObsoleteAttribute (typearg);
type = TypeManager.type_type;
eclass = ExprClass.Type;
@@ -4954,14 +6919,31 @@ namespace Mono.CSharp {
}
/// <summary>
+ /// Implements the `typeof (void)' operator
+ /// </summary>
+ public class TypeOfVoid : TypeOf {
+ public TypeOfVoid (Location l) : base (null, l)
+ {
+ loc = l;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ type = TypeManager.type_type;
+ typearg = TypeManager.void_type;
+ eclass = ExprClass.Type;
+ return this;
+ }
+ }
+
+ /// <summary>
/// Implements the sizeof expression
/// </summary>
public class SizeOf : Expression {
- public readonly string QueriedType;
+ public Expression QueriedType;
Type type_queried;
- Location loc;
- public SizeOf (string queried_type, Location l)
+ public SizeOf (Expression queried_type, Location l)
{
this.QueriedType = queried_type;
loc = l;
@@ -4969,11 +6951,26 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- type_queried = RootContext.LookupType (
- ec.DeclSpace, QueriedType, false, loc);
- if (type_queried == null)
+ if (!ec.InUnsafe) {
+ Report.Error (
+ 233, loc, "Sizeof may only be used in an unsafe context " +
+ "(consider using System.Runtime.InteropServices.Marshal.SizeOf");
+ return null;
+ }
+
+ TypeExpr texpr = QueriedType.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
return null;
+ type_queried = texpr.ResolveType (ec);
+
+ CheckObsoleteAttribute (type_queried);
+
+ if (!TypeManager.IsUnmanagedType (type_queried)){
+ Report.Error (208, loc, "Cannot take the size of an unmanaged type (" + TypeManager.CSharpName (type_queried) + ")");
+ return null;
+ }
+
type = TypeManager.int32_type;
eclass = ExprClass.Value;
return this;
@@ -4996,8 +6993,6 @@ namespace Mono.CSharp {
public class MemberAccess : Expression {
public readonly string Identifier;
Expression expr;
- Expression member_lookup;
- Location loc;
public MemberAccess (Expression expr, string id, Location l)
{
@@ -5012,7 +7007,7 @@ namespace Mono.CSharp {
}
}
- static void error176 (Location loc, string name)
+ public static void error176 (Location loc, string name)
{
Report.Error (176, loc, "Static member `" +
name + "' cannot be accessed " +
@@ -5020,90 +7015,48 @@ namespace Mono.CSharp {
"type name instead");
}
- static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Location loc)
+ public static bool IdenticalNameAndTypeName (EmitContext ec, Expression left_original, Expression left, Location loc)
{
- if (left_original == null)
- return false;
-
- if (!(left_original is SimpleName))
+ SimpleName sn = left_original as SimpleName;
+ if (sn == null || left == null || left.Type.Name != sn.Name)
return false;
- SimpleName sn = (SimpleName) left_original;
-
- Type t = RootContext.LookupType (ec.DeclSpace, sn.Name, true, loc);
- if (t != null)
- return true;
-
- return false;
+ return RootContext.LookupType (ec.DeclSpace, sn.Name, true, loc) != null;
}
public static Expression ResolveMemberAccess (EmitContext ec, Expression member_lookup,
Expression left, Location loc,
Expression left_original)
{
- //
- // Method Groups
- //
- if (member_lookup is MethodGroupExpr){
- MethodGroupExpr mg = (MethodGroupExpr) member_lookup;
+ bool left_is_type, left_is_explicit;
- //
- // Type.MethodGroup
- //
- if (left is TypeExpr){
- if (!mg.RemoveInstanceMethods ()){
- SimpleName.Error120 (loc, mg.Methods [0].Name);
- return null;
- }
+ // If `left' is null, then we're called from SimpleNameResolve and this is
+ // a member in the currently defining class.
+ if (left == null) {
+ left_is_type = ec.IsStatic || ec.IsFieldInitializer;
+ left_is_explicit = false;
- return member_lookup;
- }
-
- //
- // Instance.MethodGroup
- //
- if (IdenticalNameAndTypeName (ec, left_original, loc)){
- if (mg.RemoveInstanceMethods ())
- return member_lookup;
- }
-
- if (!mg.RemoveStaticMethods ()){
- error176 (loc, mg.Methods [0].Name);
- return null;
- }
-
- mg.InstanceExpression = left;
- return member_lookup;
-#if ORIGINAL
- if (!mg.RemoveStaticMethods ()){
- if (IdenticalNameAndTypeName (ec, left_original, loc)){
- if (!mg.RemoveInstanceMethods ()){
- SimpleName.Error120 (loc, mg.Methods [0].Name);
- return null;
- }
- return member_lookup;
- }
-
- error176 (loc, mg.Methods [0].Name);
- return null;
- }
-
- mg.InstanceExpression = left;
-
- return member_lookup;
-#endif
+ // Implicitly default to `this' unless we're static.
+ if (!ec.IsStatic && !ec.IsFieldInitializer && !ec.InEnumContext)
+ left = ec.GetThis (loc);
+ } else {
+ left_is_type = left is TypeExpr;
+ left_is_explicit = true;
}
if (member_lookup is FieldExpr){
FieldExpr fe = (FieldExpr) member_lookup;
FieldInfo fi = fe.FieldInfo;
Type decl_type = fi.DeclaringType;
-
+
if (fi is FieldBuilder) {
Const c = TypeManager.LookupConstant ((FieldBuilder) fi);
if (c != null) {
- object o = c.LookupConstantValue (ec);
+ object o;
+ if (!c.LookupConstantValue (out o))
+ return null;
+
object real_value = ((Constant) c.Expr).GetValue ();
return Constantify (real_value, fi.FieldType);
@@ -5121,6 +7074,12 @@ namespace Mono.CSharp {
o = fi.GetValue (fi);
if (decl_type.IsSubclassOf (TypeManager.enum_type)) {
+ if (left_is_explicit && !left_is_type &&
+ !IdenticalNameAndTypeName (ec, left_original, member_lookup, loc)) {
+ error176 (loc, fe.FieldInfo.Name);
+ return null;
+ }
+
Expression enum_member = MemberLookup (
ec, decl_type, "value__", MemberTypes.Field,
AllBindingFlags, loc);
@@ -5138,7 +7097,7 @@ namespace Mono.CSharp {
Expression exp = Constantify (o, t);
- if (!(left is TypeExpr)) {
+ if (left_is_explicit && !left_is_type) {
error176 (loc, fe.FieldInfo.Name);
return null;
}
@@ -5150,52 +7109,9 @@ namespace Mono.CSharp {
UnsafeError (loc);
return null;
}
-
- if (left is TypeExpr){
- // and refers to a type name or an
- if (!fe.FieldInfo.IsStatic){
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
- return member_lookup;
- } else {
- if (fe.FieldInfo.IsStatic){
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return member_lookup;
-
- error176 (loc, fe.FieldInfo.Name);
- return null;
- }
- fe.InstanceExpression = left;
-
- return fe;
- }
- }
-
- if (member_lookup is PropertyExpr){
- PropertyExpr pe = (PropertyExpr) member_lookup;
-
- if (left is TypeExpr){
- if (!pe.IsStatic){
- SimpleName.Error120 (loc, pe.PropertyInfo.Name);
- return null;
- }
- return pe;
- } else {
- if (pe.IsStatic){
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return member_lookup;
- error176 (loc, pe.PropertyInfo.Name);
- return null;
- }
- pe.InstanceExpression = left;
-
- return pe;
- }
}
if (member_lookup is EventExpr) {
-
EventExpr ee = (EventExpr) member_lookup;
//
@@ -5203,84 +7119,123 @@ namespace Mono.CSharp {
// a FieldExpr
//
- Expression ml = MemberLookup (
- ec, ec.ContainerType,
- ee.EventInfo.Name, MemberTypes.Event, AllBindingFlags, loc);
-
- if (ml != null) {
- MemberInfo mi = ec.TypeContainer.GetFieldFromEvent ((EventExpr) ml);
+ if (ee.EventInfo.DeclaringType == ec.ContainerType ||
+ TypeManager.IsNestedChildOf(ec.ContainerType, ee.EventInfo.DeclaringType)) {
+ MemberInfo mi = GetFieldFromEvent (ee);
if (mi == null) {
//
// If this happens, then we have an event with its own
// accessors and private field etc so there's no need
- // to transform ourselves : we should instead flag an error
+ // to transform ourselves.
//
- Assign.error70 (ee.EventInfo, loc);
- return null;
+ ee.InstanceExpression = left;
+ return ee;
}
- ml = ExprClassFromMemberInfo (ec, mi, loc);
+ Expression ml = ExprClassFromMemberInfo (ec, mi, loc);
if (ml == null) {
Report.Error (-200, loc, "Internal error!!");
return null;
}
+
+ if (!left_is_explicit)
+ left = null;
+
+ ee.InstanceExpression = left;
+
return ResolveMemberAccess (ec, ml, left, loc, left_original);
}
+ }
- if (left is TypeExpr) {
- if (!ee.IsStatic) {
- SimpleName.Error120 (loc, ee.EventInfo.Name);
+ if (member_lookup is IMemberExpr) {
+ IMemberExpr me = (IMemberExpr) member_lookup;
+ MethodGroupExpr mg = me as MethodGroupExpr;
+
+ if (left_is_type){
+ if ((mg != null) && left_is_explicit && left.Type.IsInterface)
+ mg.IsExplicitImpl = left_is_explicit;
+
+ if (!me.IsStatic){
+ if ((ec.IsFieldInitializer || ec.IsStatic) &&
+ IdenticalNameAndTypeName (ec, left_original, member_lookup, loc))
+ return member_lookup;
+
+ SimpleName.Error_ObjectRefRequired (ec, loc, me.Name);
return null;
}
- return ee;
-
} else {
- if (ee.IsStatic) {
- if (IdenticalNameAndTypeName (ec, left_original, loc))
- return ee;
-
- error176 (loc, ee.EventInfo.Name);
- return null;
+ if (!me.IsInstance) {
+ if (IdenticalNameAndTypeName (ec, left_original, left, loc))
+ return member_lookup;
+
+ if (left_is_explicit) {
+ error176 (loc, me.Name);
+ return null;
+ }
+ }
+
+ //
+ // Since we can not check for instance objects in SimpleName,
+ // becaue of the rule that allows types and variables to share
+ // the name (as long as they can be de-ambiguated later, see
+ // IdenticalNameAndTypeName), we have to check whether left
+ // is an instance variable in a static context
+ //
+ // However, if the left-hand value is explicitly given, then
+ // it is already our instance expression, so we aren't in
+ // static context.
+ //
+
+ if (ec.IsStatic && !left_is_explicit && left is IMemberExpr){
+ IMemberExpr mexp = (IMemberExpr) left;
+
+ if (!mexp.IsStatic){
+ SimpleName.Error_ObjectRefRequired (ec, loc, mexp.Name);
+ return null;
+ }
}
- ee.InstanceExpression = left;
+ if ((mg != null) && IdenticalNameAndTypeName (ec, left_original, left, loc))
+ mg.IdenticalTypeName = true;
- return ee;
+ me.InstanceExpression = left;
}
- }
- if (member_lookup is TypeExpr){
- member_lookup.Resolve (ec);
return member_lookup;
}
-
+
Console.WriteLine ("Left is: " + left);
Report.Error (-100, loc, "Support for [" + member_lookup + "] is not present yet");
- Environment.Exit (0);
+ Environment.Exit (1);
return null;
}
- public override Expression DoResolve (EmitContext ec)
+ public Expression DoResolve (EmitContext ec, Expression right_side, ResolveFlags flags)
{
+ if (type != null)
+ throw new Exception ();
+
//
- // We are the sole users of ResolveWithSimpleName (ie, the only
- // ones that can cope with it
+ // Resolve the expression with flow analysis turned off, we'll do the definite
+ // assignment checks later. This is because we don't know yet what the expression
+ // will resolve to - it may resolve to a FieldExpr and in this case we must do the
+ // definite assignment check on the actual field and not on the whole struct.
//
- Expression original = expr;
- expr = expr.ResolveWithSimpleName (ec);
+ Expression original = expr;
+ expr = expr.Resolve (ec, flags | ResolveFlags.Intermediate | ResolveFlags.DisableFlowAnalysis);
if (expr == null)
return null;
if (expr is SimpleName){
SimpleName child_expr = (SimpleName) expr;
-
- expr = new SimpleName (child_expr.Name + "." + Identifier, loc);
- return expr.ResolveWithSimpleName (ec);
+ Expression new_expr = new SimpleName (child_expr.Name, Identifier, loc);
+
+ return new_expr.Resolve (ec, flags);
}
//
@@ -5293,53 +7248,156 @@ namespace Mono.CSharp {
//
Type expr_type = expr.Type;
- if ((expr is TypeExpr) && (expr_type.IsSubclassOf (TypeManager.enum_type))){
-
- Enum en = TypeManager.LookupEnum (expr_type);
-
- if (en != null) {
- object value = en.LookupEnumValue (ec, Identifier, loc);
+ if (expr is TypeExpr){
+ if (!ec.DeclSpace.CheckAccessLevel (expr_type)){
+ Report.Error (122, loc, "'{0}' is inaccessible due to its protection level", expr_type);
+ return null;
+ }
+
+ if (expr_type == TypeManager.enum_type || expr_type.IsSubclassOf (TypeManager.enum_type)){
+ Enum en = TypeManager.LookupEnum (expr_type);
+
+ if (en != null) {
+ object value = en.LookupEnumValue (ec, Identifier, loc);
+
+ if (value != null){
+ MemberCore mc = en.GetDefinition (Identifier);
+ ObsoleteAttribute oa = mc.GetObsoleteAttribute (en);
+ if (oa != null) {
+ AttributeTester.Report_ObsoleteMessage (oa, mc.GetSignatureForError (), Location);
+ }
+ oa = en.GetObsoleteAttribute (en);
+ if (oa != null) {
+ AttributeTester.Report_ObsoleteMessage (oa, en.GetSignatureForError (), Location);
+ }
- if (value != null){
- Constant c = Constantify (value, en.UnderlyingType);
- return new EnumConstant (c, expr_type);
+ Constant c = Constantify (value, en.UnderlyingType);
+ return new EnumConstant (c, expr_type);
+ }
+ } else {
+ CheckObsoleteAttribute (expr_type);
+
+ FieldInfo fi = expr_type.GetField (Identifier);
+ if (fi != null) {
+ ObsoleteAttribute oa = AttributeTester.GetMemberObsoleteAttribute (fi);
+ if (oa != null)
+ AttributeTester.Report_ObsoleteMessage (oa, TypeManager.GetFullNameSignature (fi), Location);
+ }
}
}
}
-
+
if (expr_type.IsPointer){
- Report.Error (23, loc,
- "The `.' operator can not be applied to pointer operands (" +
- TypeManager.CSharpName (expr_type) + ")");
+ Error (23, "The `.' operator can not be applied to pointer operands (" +
+ TypeManager.CSharpName (expr_type) + ")");
return null;
}
+
+ Expression member_lookup;
+ member_lookup = MemberLookupFinal (ec, expr_type, expr_type, Identifier, loc);
+ if (member_lookup == null)
+ return null;
+
+ if (member_lookup is TypeExpr) {
+ if (!(expr is TypeExpr) && !(expr is SimpleName)) {
+ Error (572, "Can't reference type `" + Identifier + "' through an expression; try `" +
+ member_lookup.Type + "' instead");
+ return null;
+ }
+
+ return member_lookup;
+ }
- member_lookup = MemberLookup (ec, expr_type, Identifier, loc);
+ member_lookup = ResolveMemberAccess (ec, member_lookup, expr, loc, original);
+ if (member_lookup == null)
+ return null;
- if (member_lookup == null){
- //
- // Try looking the member up from the same type, if we find
- // it, we know that the error was due to limited visibility
- //
- object lookup = TypeManager.MemberLookup (
- expr_type, expr_type, AllMemberTypes, AllBindingFlags, Identifier);
- if (lookup == null)
- Report.Error (117, loc, "`" + expr_type + "' does not contain a " +
- "definition for `" + Identifier + "'");
+ // The following DoResolve/DoResolveLValue will do the definite assignment
+ // check.
+
+ if (right_side != null)
+ member_lookup = member_lookup.DoResolveLValue (ec, right_side);
+ else
+ member_lookup = member_lookup.DoResolve (ec);
+
+ return member_lookup;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return DoResolve (ec, null, ResolveFlags.VariableOrValue |
+ ResolveFlags.SimpleName | ResolveFlags.Type);
+ }
+
+ public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
+ {
+ return DoResolve (ec, right_side, ResolveFlags.VariableOrValue |
+ ResolveFlags.SimpleName | ResolveFlags.Type);
+ }
+
+ public override Expression ResolveAsTypeStep (EmitContext ec)
+ {
+ string fname = null;
+ MemberAccess full_expr = this;
+ while (full_expr != null) {
+ if (fname != null)
+ fname = String.Concat (full_expr.Identifier, ".", fname);
else
- Report.Error (122, loc, "`" + expr_type + "." + Identifier + "' " +
- "is inaccessible because of its protection level");
-
+ fname = full_expr.Identifier;
+
+ if (full_expr.Expr is SimpleName) {
+ string full_name = String.Concat (((SimpleName) full_expr.Expr).Name, ".", fname);
+ Type fully_qualified = ec.DeclSpace.FindType (loc, full_name);
+ if (fully_qualified != null)
+ return new TypeExpression (fully_qualified, loc);
+ }
+
+ full_expr = full_expr.Expr as MemberAccess;
+ }
+
+ Expression new_expr = expr.ResolveAsTypeStep (ec);
+
+ if (new_expr == null)
+ return null;
+
+ if (new_expr is SimpleName){
+ SimpleName child_expr = (SimpleName) new_expr;
+
+ new_expr = new SimpleName (child_expr.Name, Identifier, loc);
+
+ return new_expr.ResolveAsTypeStep (ec);
+ }
+
+ Type expr_type = new_expr.Type;
+
+ if (expr_type.IsPointer){
+ Error (23, "The `.' operator can not be applied to pointer operands (" +
+ TypeManager.CSharpName (expr_type) + ")");
return null;
}
+
+ Expression member_lookup;
+ member_lookup = MemberLookupFinal (ec, expr_type, expr_type, Identifier, loc);
+ if (member_lookup == null)
+ return null;
- return ResolveMemberAccess (ec, member_lookup, expr, loc, original);
+ if (member_lookup is TypeExpr){
+ member_lookup.Resolve (ec, ResolveFlags.Type);
+ return member_lookup;
+ }
+
+ return null;
}
public override void Emit (EmitContext ec)
{
throw new Exception ("Should not happen");
}
+
+ public override string ToString ()
+ {
+ return expr + "." + Identifier;
+ }
}
/// <summary>
@@ -5349,22 +7407,29 @@ namespace Mono.CSharp {
public Expression Expr;
- public CheckedExpr (Expression e)
+ public CheckedExpr (Expression e, Location l)
{
Expr = e;
+ loc = l;
}
public override Expression DoResolve (EmitContext ec)
{
+ bool last_check = ec.CheckState;
bool last_const_check = ec.ConstantCheckState;
+ ec.CheckState = true;
ec.ConstantCheckState = true;
Expr = Expr.Resolve (ec);
+ ec.CheckState = last_check;
ec.ConstantCheckState = last_const_check;
if (Expr == null)
return null;
+ if (Expr is Constant)
+ return Expr;
+
eclass = Expr.eclass;
type = Expr.Type;
return this;
@@ -5391,22 +7456,29 @@ namespace Mono.CSharp {
public Expression Expr;
- public UnCheckedExpr (Expression e)
+ public UnCheckedExpr (Expression e, Location l)
{
Expr = e;
+ loc = l;
}
public override Expression DoResolve (EmitContext ec)
{
+ bool last_check = ec.CheckState;
bool last_const_check = ec.ConstantCheckState;
+ ec.CheckState = false;
ec.ConstantCheckState = false;
Expr = Expr.Resolve (ec);
+ ec.CheckState = last_check;
ec.ConstantCheckState = last_const_check;
if (Expr == null)
return null;
+ if (Expr is Constant)
+ return Expr;
+
eclass = Expr.eclass;
type = Expr.Type;
return this;
@@ -5430,12 +7502,11 @@ namespace Mono.CSharp {
/// An Element Access expression.
///
/// During semantic analysis these are transformed into
- /// IndexerAccess or ArrayAccess
+ /// IndexerAccess, ArrayAccess or a PointerArithmetic.
/// </summary>
public class ElementAccess : Expression {
public ArrayList Arguments;
public Expression Expr;
- public Location loc;
public ElementAccess (Expression e, ArrayList e_list, Location l)
{
@@ -5470,24 +7541,24 @@ namespace Mono.CSharp {
return true;
}
- Expression MakePointerAccess ()
+ Expression MakePointerAccess (EmitContext ec)
{
Type t = Expr.Type;
if (t == TypeManager.void_ptr_type){
- Report.Error (
- 242, loc,
- "The array index operation is not valid for void pointers");
+ Error (242, "The array index operation is not valid for void pointers");
return null;
}
if (Arguments.Count != 1){
- Report.Error (
- 196, loc,
- "A pointer must be indexed by a single value");
+ Error (196, "A pointer must be indexed by a single value");
return null;
}
- Expression p = new PointerArithmetic (true, Expr, ((Argument)Arguments [0]).Expr, t);
- return new Indirection (p);
+ Expression p;
+
+ p = new PointerArithmetic (true, Expr, ((Argument)Arguments [0]).Expr, t, loc).Resolve (ec);
+ if (p == null)
+ return null;
+ return new Indirection (p, loc).Resolve (ec);
}
public override Expression DoResolve (EmitContext ec)
@@ -5503,12 +7574,17 @@ namespace Mono.CSharp {
//
Type t = Expr.Type;
+ if (t == TypeManager.array_type){
+ Report.Error (21, loc, "Cannot use indexer on System.Array");
+ return null;
+ }
+
if (t.IsArray)
- return (new ArrayAccess (this)).Resolve (ec);
+ return (new ArrayAccess (this, loc)).Resolve (ec);
else if (t.IsPointer)
- return MakePointerAccess ();
+ return MakePointerAccess (ec);
else
- return (new IndexerAccess (this)).Resolve (ec);
+ return (new IndexerAccess (this, loc)).Resolve (ec);
}
public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
@@ -5518,11 +7594,11 @@ namespace Mono.CSharp {
Type t = Expr.Type;
if (t.IsArray)
- return (new ArrayAccess (this)).ResolveLValue (ec, right_side);
+ return (new ArrayAccess (this, loc)).ResolveLValue (ec, right_side);
else if (t.IsPointer)
- return MakePointerAccess ();
+ return MakePointerAccess (ec);
else
- return (new IndexerAccess (this)).ResolveLValue (ec, right_side);
+ return (new IndexerAccess (this, loc)).ResolveLValue (ec, right_side);
}
public override void Emit (EmitContext ec)
@@ -5540,40 +7616,68 @@ namespace Mono.CSharp {
//
ElementAccess ea;
- LocalTemporary [] cached_locations;
+ LocalTemporary temp;
+ bool prepared;
- public ArrayAccess (ElementAccess ea_data)
+ public ArrayAccess (ElementAccess ea_data, Location l)
{
ea = ea_data;
eclass = ExprClass.Variable;
+ loc = l;
}
public override Expression DoResolve (EmitContext ec)
{
+#if false
ExprClass eclass = ea.Expr.eclass;
-#if false
// As long as the type is valid
if (!(eclass == ExprClass.Variable || eclass == ExprClass.PropertyAccess ||
eclass == ExprClass.Value)) {
- report118 (ea.loc, ea.Expr, "variable or value");
+ ea.Expr.Error_UnexpectedKind ("variable or value");
return null;
}
#endif
Type t = ea.Expr.Type;
if (t.GetArrayRank () != ea.Arguments.Count){
- Report.Error (22, ea.loc,
- "Incorrect number of indexes for array " +
- " expected: " + t.GetArrayRank () + " got: " +
- ea.Arguments.Count);
+ ea.Error (22,
+ "Incorrect number of indexes for array " +
+ " expected: " + t.GetArrayRank () + " got: " +
+ ea.Arguments.Count);
return null;
}
- type = TypeManager.TypeToCoreType (t.GetElementType ());
- if (type.IsPointer && !ec.InUnsafe){
- UnsafeError (ea.loc);
+
+ type = TypeManager.GetElementType (t);
+ if (type.IsPointer && !ec.InUnsafe){
+ UnsafeError (ea.Location);
return null;
}
+
+ foreach (Argument a in ea.Arguments){
+ Type argtype = a.Type;
+
+ if (argtype == TypeManager.int32_type ||
+ argtype == TypeManager.uint32_type ||
+ argtype == TypeManager.int64_type ||
+ argtype == TypeManager.uint64_type) {
+ Constant c = a.Expr as Constant;
+ if (c != null && c.IsNegative) {
+ Report.Warning (251, 2, a.Expr.Location, "Indexing an array with a negative index (array indices always start at zero)");
+ }
+ continue;
+ }
+
+ //
+ // Mhm. This is strage, because the Argument.Type is not the same as
+ // Argument.Expr.Type: the value changes depending on the ref/out setting.
+ //
+ // Wonder if I will run into trouble for this.
+ //
+ a.Expr = ExpressionToArrayArgument (ec, a.Expr, ea.Location);
+ if (a.Expr == null)
+ return null;
+ }
eclass = ExprClass.Variable;
@@ -5587,12 +7691,12 @@ namespace Mono.CSharp {
static public void EmitLoadOpcode (ILGenerator ig, Type type)
{
if (type == TypeManager.byte_type || type == TypeManager.bool_type)
- ig.Emit (OpCodes.Ldelem_I1);
- else if (type == TypeManager.sbyte_type)
ig.Emit (OpCodes.Ldelem_U1);
+ else if (type == TypeManager.sbyte_type)
+ ig.Emit (OpCodes.Ldelem_I1);
else if (type == TypeManager.short_type)
ig.Emit (OpCodes.Ldelem_I2);
- else if (type == TypeManager.ushort_type)
+ else if (type == TypeManager.ushort_type || type == TypeManager.char_type)
ig.Emit (OpCodes.Ldelem_U2);
else if (type == TypeManager.int32_type)
ig.Emit (OpCodes.Ldelem_I4);
@@ -5608,7 +7712,9 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Ldelem_R8);
else if (type == TypeManager.intptr_type)
ig.Emit (OpCodes.Ldelem_I);
- else if (type.IsValueType){
+ else if (TypeManager.IsEnumType (type)){
+ EmitLoadOpcode (ig, TypeManager.EnumToUnderlying (type));
+ } else if (type.IsValueType){
ig.Emit (OpCodes.Ldelema, type);
ig.Emit (OpCodes.Ldobj, type);
} else
@@ -5616,35 +7722,43 @@ namespace Mono.CSharp {
}
/// <summary>
- /// Emits the right opcode to store an object of Type `t'
+ /// Returns the right opcode to store an object of Type `t'
/// from an array of T.
/// </summary>
- static public void EmitStoreOpcode (ILGenerator ig, Type t)
+ static public OpCode GetStoreOpcode (Type t, out bool is_stobj)
{
+ //Console.WriteLine (new System.Diagnostics.StackTrace ());
+ is_stobj = false;
+ t = TypeManager.TypeToCoreType (t);
+ if (TypeManager.IsEnumType (t))
+ t = TypeManager.EnumToUnderlying (t);
if (t == TypeManager.byte_type || t == TypeManager.sbyte_type ||
t == TypeManager.bool_type)
- ig.Emit (OpCodes.Stelem_I1);
- else if (t == TypeManager.short_type || t == TypeManager.ushort_type || t == TypeManager.char_type)
- ig.Emit (OpCodes.Stelem_I2);
+ return OpCodes.Stelem_I1;
+ else if (t == TypeManager.short_type || t == TypeManager.ushort_type ||
+ t == TypeManager.char_type)
+ return OpCodes.Stelem_I2;
else if (t == TypeManager.int32_type || t == TypeManager.uint32_type)
- ig.Emit (OpCodes.Stelem_I4);
+ return OpCodes.Stelem_I4;
else if (t == TypeManager.int64_type || t == TypeManager.uint64_type)
- ig.Emit (OpCodes.Stelem_I8);
+ return OpCodes.Stelem_I8;
else if (t == TypeManager.float_type)
- ig.Emit (OpCodes.Stelem_R4);
+ return OpCodes.Stelem_R4;
else if (t == TypeManager.double_type)
- ig.Emit (OpCodes.Stelem_R8);
- else if (t == TypeManager.intptr_type)
- ig.Emit (OpCodes.Stelem_I);
- else if (t.IsValueType)
- ig.Emit (OpCodes.Stobj, t);
- else
- ig.Emit (OpCodes.Stelem_Ref);
+ return OpCodes.Stelem_R8;
+ else if (t == TypeManager.intptr_type) {
+ is_stobj = true;
+ return OpCodes.Stobj;
+ } else if (t.IsValueType) {
+ is_stobj = true;
+ return OpCodes.Stobj;
+ } else
+ return OpCodes.Stelem_Ref;
}
MethodInfo FetchGetMethod ()
{
- ModuleBuilder mb = CodeGen.ModuleBuilder;
+ ModuleBuilder mb = CodeGen.Module.Builder;
int arg_count = ea.Arguments.Count;
Type [] args = new Type [arg_count];
MethodInfo get;
@@ -5665,23 +7779,14 @@ namespace Mono.CSharp {
MethodInfo FetchAddressMethod ()
{
- ModuleBuilder mb = CodeGen.ModuleBuilder;
+ ModuleBuilder mb = CodeGen.Module.Builder;
int arg_count = ea.Arguments.Count;
Type [] args = new Type [arg_count];
MethodInfo address;
- string ptr_type_name;
Type ret_type;
- ptr_type_name = type.FullName + "&";
- ret_type = Type.GetType (ptr_type_name);
+ ret_type = TypeManager.GetReferenceType (type);
- //
- // It is a type defined by the source code we are compiling
- //
- if (ret_type == null){
- ret_type = mb.GetType (ptr_type_name);
- }
-
for (int i = 0; i < arg_count; i++){
//args [i++] = a.Type;
args [i] = TypeManager.int32_type;
@@ -5705,87 +7810,113 @@ namespace Mono.CSharp {
//
void LoadArrayAndArguments (EmitContext ec)
{
- if (cached_locations == null){
- ea.Expr.Emit (ec);
- foreach (Argument a in ea.Arguments)
- a.Expr.Emit (ec);
- return;
- }
-
ILGenerator ig = ec.ig;
- if (cached_locations [0] == null){
- cached_locations [0] = new LocalTemporary (ec, ea.Expr.Type);
- ea.Expr.Emit (ec);
- ig.Emit (OpCodes.Dup);
- cached_locations [0].Store (ec);
+ ea.Expr.Emit (ec);
+ foreach (Argument a in ea.Arguments){
+ Type argtype = a.Expr.Type;
- int j = 1;
+ a.Expr.Emit (ec);
- foreach (Argument a in ea.Arguments){
- cached_locations [j] = new LocalTemporary (ec, a.Expr.Type);
- a.Expr.Emit (ec);
- ig.Emit (OpCodes.Dup);
- cached_locations [j].Store (ec);
- j++;
- }
- return;
+ if (argtype == TypeManager.int64_type)
+ ig.Emit (OpCodes.Conv_Ovf_I);
+ else if (argtype == TypeManager.uint64_type)
+ ig.Emit (OpCodes.Conv_Ovf_I_Un);
}
-
- foreach (LocalTemporary lt in cached_locations)
- lt.Emit (ec);
}
- public new void CacheTemporaries (EmitContext ec)
- {
- cached_locations = new LocalTemporary [ea.Arguments.Count + 1];
- }
-
- public override void Emit (EmitContext ec)
+ public void Emit (EmitContext ec, bool leave_copy)
{
int rank = ea.Expr.Type.GetArrayRank ();
ILGenerator ig = ec.ig;
- LoadArrayAndArguments (ec);
-
- if (rank == 1)
- EmitLoadOpcode (ig, type);
- else {
- MethodInfo method;
+ if (!prepared) {
+ LoadArrayAndArguments (ec);
- method = FetchGetMethod ();
- ig.Emit (OpCodes.Call, method);
+ if (rank == 1)
+ EmitLoadOpcode (ig, type);
+ else {
+ MethodInfo method;
+
+ method = FetchGetMethod ();
+ ig.Emit (OpCodes.Call, method);
+ }
+ } else
+ LoadFromPtr (ec.ig, this.type);
+
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ temp = new LocalTemporary (ec, this.type);
+ temp.Store (ec);
}
}
+
+ public override void Emit (EmitContext ec)
+ {
+ Emit (ec, false);
+ }
- public void EmitAssign (EmitContext ec, Expression source)
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
int rank = ea.Expr.Type.GetArrayRank ();
ILGenerator ig = ec.ig;
Type t = source.Type;
+ prepared = prepare_for_load;
- LoadArrayAndArguments (ec);
-
- //
- // The stobj opcode used by value types will need
- // an address on the stack, not really an array/array
- // pair
- //
- if (rank == 1){
- if (t.IsValueType && !TypeManager.IsBuiltinType (t))
- ig.Emit (OpCodes.Ldelema, t);
+ if (prepare_for_load) {
+ AddressOf (ec, AddressOp.LoadStore);
+ ec.ig.Emit (OpCodes.Dup);
+ source.Emit (ec);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ temp = new LocalTemporary (ec, this.type);
+ temp.Store (ec);
+ }
+ StoreFromPtr (ec.ig, t);
+
+ if (temp != null)
+ temp.Emit (ec);
+
+ return;
}
- source.Emit (ec);
+ LoadArrayAndArguments (ec);
- if (rank == 1)
- EmitStoreOpcode (ig, t);
- else {
- ModuleBuilder mb = CodeGen.ModuleBuilder;
+ if (rank == 1) {
+ bool is_stobj;
+ OpCode op = GetStoreOpcode (t, out is_stobj);
+ //
+ // The stobj opcode used by value types will need
+ // an address on the stack, not really an array/array
+ // pair
+ //
+ if (is_stobj)
+ ig.Emit (OpCodes.Ldelema, t);
+
+ source.Emit (ec);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ temp = new LocalTemporary (ec, this.type);
+ temp.Store (ec);
+ }
+
+ if (is_stobj)
+ ig.Emit (OpCodes.Stobj, t);
+ else
+ ig.Emit (op);
+ } else {
+ ModuleBuilder mb = CodeGen.Module.Builder;
int arg_count = ea.Arguments.Count;
Type [] args = new Type [arg_count + 1];
MethodInfo set;
+ source.Emit (ec);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ temp = new LocalTemporary (ec, this.type);
+ temp.Store (ec);
+ }
+
for (int i = 0; i < arg_count; i++){
//args [i++] = a.Type;
args [i] = TypeManager.int32_type;
@@ -5801,6 +7932,9 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Call, set);
}
+
+ if (temp != null)
+ temp.Emit (ec);
}
public void AddressOf (EmitContext ec, AddressOp mode)
@@ -5821,82 +7955,96 @@ namespace Mono.CSharp {
class Indexers {
- public ArrayList getters, setters;
+ public ArrayList Properties;
static Hashtable map;
+ public struct Indexer {
+ public readonly Type Type;
+ public readonly MethodInfo Getter, Setter;
+
+ public Indexer (Type type, MethodInfo get, MethodInfo set)
+ {
+ this.Type = type;
+ this.Getter = get;
+ this.Setter = set;
+ }
+ }
+
static Indexers ()
{
map = new Hashtable ();
}
- Indexers (MemberInfo [] mi)
+ Indexers ()
+ {
+ Properties = new ArrayList ();
+ }
+
+ void Append (MemberInfo [] mi)
{
foreach (PropertyInfo property in mi){
MethodInfo get, set;
get = property.GetGetMethod (true);
- if (get != null){
- if (getters == null)
- getters = new ArrayList ();
-
- getters.Add (get);
- }
-
set = property.GetSetMethod (true);
- if (set != null){
- if (setters == null)
- setters = new ArrayList ();
- setters.Add (set);
- }
+ Properties.Add (new Indexer (property.PropertyType, get, set));
}
}
- static private Indexers GetIndexersForTypeOrInterface (Type caller_type, Type lookup_type)
+ static private MemberInfo [] GetIndexersForTypeOrInterface (Type caller_type, Type lookup_type)
{
- Indexers ix = (Indexers) map [lookup_type];
-
- if (ix != null)
- return ix;
-
string p_name = TypeManager.IndexerPropertyName (lookup_type);
MemberInfo [] mi = TypeManager.MemberLookup (
- caller_type, lookup_type, MemberTypes.Property,
- BindingFlags.Public | BindingFlags.Instance, p_name);
+ caller_type, caller_type, lookup_type, MemberTypes.Property,
+ BindingFlags.Public | BindingFlags.Instance |
+ BindingFlags.DeclaredOnly, p_name, null);
if (mi == null || mi.Length == 0)
return null;
- ix = new Indexers (mi);
- map [lookup_type] = ix;
-
- return ix;
+ return mi;
}
static public Indexers GetIndexersForType (Type caller_type, Type lookup_type, Location loc)
{
Indexers ix = (Indexers) map [lookup_type];
-
+
if (ix != null)
return ix;
- ix = GetIndexersForTypeOrInterface (caller_type, lookup_type);
- if (ix != null)
+ Type copy = lookup_type;
+ while (copy != TypeManager.object_type && copy != null){
+ MemberInfo [] mi = GetIndexersForTypeOrInterface (caller_type, copy);
+
+ if (mi != null){
+ if (ix == null)
+ ix = new Indexers ();
+
+ ix.Append (mi);
+ }
+
+ copy = copy.BaseType;
+ }
+
+ if (!lookup_type.IsInterface)
return ix;
- Type [] ifaces = TypeManager.GetInterfaces (lookup_type);
+ TypeExpr [] ifaces = TypeManager.GetInterfaces (lookup_type);
if (ifaces != null) {
- foreach (Type itype in ifaces) {
- ix = GetIndexersForTypeOrInterface (caller_type, itype);
- if (ix != null)
- return ix;
+ foreach (TypeExpr iface in ifaces) {
+ Type itype = iface.Type;
+ MemberInfo [] mi = GetIndexersForTypeOrInterface (caller_type, itype);
+ if (mi != null){
+ if (ix == null)
+ ix = new Indexers ();
+
+ ix.Append (mi);
+ }
}
}
- Report.Error (21, loc,
- "Type `" + TypeManager.CSharpName (lookup_type) +
- "' does not have any indexers defined");
- return null;
+ return ix;
}
}
@@ -5907,52 +8055,102 @@ namespace Mono.CSharp {
//
// Points to our "data" repository
//
- ElementAccess ea;
MethodInfo get, set;
- Indexers ilist;
ArrayList set_arguments;
+ bool is_base_indexer;
+
+ protected Type indexer_type;
+ protected Type current_type;
+ protected Expression instance_expr;
+ protected ArrayList arguments;
- public IndexerAccess (ElementAccess ea_data)
+ public IndexerAccess (ElementAccess ea, Location loc)
+ : this (ea.Expr, false, loc)
{
- ea = ea_data;
- eclass = ExprClass.Value;
+ this.arguments = ea.Arguments;
+ }
+
+ protected IndexerAccess (Expression instance_expr, bool is_base_indexer,
+ Location loc)
+ {
+ this.instance_expr = instance_expr;
+ this.is_base_indexer = is_base_indexer;
+ this.eclass = ExprClass.Value;
+ this.loc = loc;
+ }
+
+ protected virtual bool CommonResolve (EmitContext ec)
+ {
+ indexer_type = instance_expr.Type;
+ current_type = ec.ContainerType;
+
+ return true;
}
public override Expression DoResolve (EmitContext ec)
{
- Type indexer_type = ea.Expr.Type;
-
+ ArrayList AllGetters = new ArrayList();
+ if (!CommonResolve (ec))
+ return null;
+
//
// Step 1: Query for all `Item' *properties*. Notice
// that the actual methods are pointed from here.
//
// This is a group of properties, piles of them.
- if (ilist == null)
- ilist = Indexers.GetIndexersForType (
- ec.ContainerType, indexer_type, ea.loc);
-
+ bool found_any = false, found_any_getters = false;
+ Type lookup_type = indexer_type;
+
+ Indexers ilist;
+ ilist = Indexers.GetIndexersForType (current_type, lookup_type, loc);
+ if (ilist != null) {
+ found_any = true;
+ if (ilist.Properties != null) {
+ foreach (Indexers.Indexer ix in ilist.Properties) {
+ if (ix.Getter != null)
+ AllGetters.Add(ix.Getter);
+ }
+ }
+ }
- //
- // Step 2: find the proper match
- //
- if (ilist != null && ilist.getters != null && ilist.getters.Count > 0){
- Location loc = ea.loc;
-
+ if (AllGetters.Count > 0) {
+ found_any_getters = true;
get = (MethodInfo) Invocation.OverloadResolve (
- ec, new MethodGroupExpr (ilist.getters, loc), ea.Arguments, loc);
+ ec, new MethodGroupExpr (AllGetters, loc),
+ arguments, false, loc);
+ }
+
+ if (!found_any) {
+ Report.Error (21, loc,
+ "Type `" + TypeManager.CSharpName (indexer_type) +
+ "' does not have any indexers defined");
+ return null;
+ }
+
+ if (!found_any_getters) {
+ Error (154, "indexer can not be used in this context, because " +
+ "it lacks a `get' accessor");
+ return null;
}
- if (get == null){
- Report.Error (154, ea.loc,
- "indexer can not be used in this context, because " +
- "it lacks a `get' accessor");
+ if (get == null) {
+ Error (1501, "No Overload for method `this' takes `" +
+ arguments.Count + "' arguments");
+ return null;
+ }
+
+ //
+ // Only base will allow this invocation to happen.
+ //
+ if (get.IsAbstract && this is BaseIndexerAccess){
+ Report.Error (205, loc, "Cannot call an abstract base indexer: " + Invocation.FullMethodDesc (get));
return null;
}
type = get.ReturnType;
if (type.IsPointer && !ec.InUnsafe){
- UnsafeError (ea.loc);
+ UnsafeError (loc);
return null;
}
@@ -5962,48 +8160,120 @@ namespace Mono.CSharp {
public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
{
- Type indexer_type = ea.Expr.Type;
- Type right_type = right_side.Type;
+ ArrayList AllSetters = new ArrayList();
+ if (!CommonResolve (ec))
+ return null;
- if (ilist == null)
- ilist = Indexers.GetIndexersForType (
- ec.ContainerType, indexer_type, ea.loc);
+ bool found_any = false, found_any_setters = false;
- if (ilist != null && ilist.setters != null && ilist.setters.Count > 0){
- Location loc = ea.loc;
-
- set_arguments = (ArrayList) ea.Arguments.Clone ();
+ Indexers ilist = Indexers.GetIndexersForType (current_type, indexer_type, loc);
+ if (ilist != null) {
+ found_any = true;
+ if (ilist.Properties != null) {
+ foreach (Indexers.Indexer ix in ilist.Properties) {
+ if (ix.Setter != null)
+ AllSetters.Add(ix.Setter);
+ }
+ }
+ }
+ if (AllSetters.Count > 0) {
+ found_any_setters = true;
+ set_arguments = (ArrayList) arguments.Clone ();
set_arguments.Add (new Argument (right_side, Argument.AType.Expression));
-
set = (MethodInfo) Invocation.OverloadResolve (
- ec, new MethodGroupExpr (ilist.setters, loc), set_arguments, loc);
+ ec, new MethodGroupExpr (AllSetters, loc),
+ set_arguments, false, loc);
}
-
- if (set == null){
- Report.Error (200, ea.loc,
- "indexer X.this [" + TypeManager.CSharpName (right_type) +
- "] lacks a `set' accessor");
- return null;
+
+ if (!found_any) {
+ Report.Error (21, loc,
+ "Type `" + TypeManager.CSharpName (indexer_type) +
+ "' does not have any indexers defined");
+ return null;
+ }
+
+ if (!found_any_setters) {
+ Error (154, "indexer can not be used in this context, because " +
+ "it lacks a `set' accessor");
+ return null;
+ }
+
+ if (set == null) {
+ Error (1501, "No Overload for method `this' takes `" +
+ arguments.Count + "' arguments");
+ return null;
+ }
+
+ //
+ // Only base will allow this invocation to happen.
+ //
+ if (set.IsAbstract && this is BaseIndexerAccess){
+ Report.Error (205, loc, "Cannot call an abstract base indexer: " + Invocation.FullMethodDesc (set));
+ return null;
}
- type = TypeManager.void_type;
+ //
+ // Now look for the actual match in the list of indexers to set our "return" type
+ //
+ type = TypeManager.void_type; // default value
+ foreach (Indexers.Indexer ix in ilist.Properties){
+ if (ix.Setter == set){
+ type = ix.Type;
+ break;
+ }
+ }
+
eclass = ExprClass.IndexerAccess;
return this;
}
- public override void Emit (EmitContext ec)
+ bool prepared = false;
+ LocalTemporary temp;
+
+ public void Emit (EmitContext ec, bool leave_copy)
{
- Invocation.EmitCall (ec, false, false, ea.Expr, get, ea.Arguments, ea.loc);
+ Invocation.EmitCall (ec, is_base_indexer, false, instance_expr, get, arguments, loc, prepared, false);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ temp = new LocalTemporary (ec, Type);
+ temp.Store (ec);
+ }
}
-
+
//
// source is ignored, because we already have a copy of it from the
// LValue resolution and we have already constructed a pre-cached
// version of the arguments (ea.set_arguments);
//
- public void EmitAssign (EmitContext ec, Expression source)
+ public void EmitAssign (EmitContext ec, Expression source, bool leave_copy, bool prepare_for_load)
{
- Invocation.EmitCall (ec, false, false, ea.Expr, set, set_arguments, ea.loc);
+ prepared = prepare_for_load;
+ Argument a = (Argument) set_arguments [set_arguments.Count - 1];
+
+ if (prepared) {
+ source.Emit (ec);
+ if (leave_copy) {
+ ec.ig.Emit (OpCodes.Dup);
+ temp = new LocalTemporary (ec, Type);
+ temp.Store (ec);
+ }
+ } else if (leave_copy) {
+ temp = new LocalTemporary (ec, Type);
+ source.Emit (ec);
+ temp.Store (ec);
+ a.Expr = temp;
+ }
+
+ Invocation.EmitCall (ec, is_base_indexer, false, instance_expr, set, set_arguments, loc, false, prepared);
+
+ if (temp != null)
+ temp.Emit (ec);
+ }
+
+
+ public override void Emit (EmitContext ec)
+ {
+ Emit (ec, false);
}
}
@@ -6012,7 +8282,6 @@ namespace Mono.CSharp {
/// </summary>
public class BaseAccess : Expression {
string member;
- Location loc;
public BaseAccess (string member, Location l)
{
@@ -6022,34 +8291,76 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
+ Expression c = CommonResolve (ec);
+
+ if (c == null)
+ return null;
+
+ //
+ // MethodGroups use this opportunity to flag an error on lacking ()
+ //
+ if (!(c is MethodGroupExpr))
+ return c.Resolve (ec);
+ return c;
+ }
+
+ public override Expression DoResolveLValue (EmitContext ec, Expression right_side)
+ {
+ Expression c = CommonResolve (ec);
+
+ if (c == null)
+ return null;
+
+ //
+ // MethodGroups use this opportunity to flag an error on lacking ()
+ //
+ if (! (c is MethodGroupExpr))
+ return c.DoResolveLValue (ec, right_side);
+
+ return c;
+ }
+
+ Expression CommonResolve (EmitContext ec)
+ {
Expression member_lookup;
Type current_type = ec.ContainerType;
Type base_type = current_type.BaseType;
Expression e;
if (ec.IsStatic){
- Report.Error (1511, loc,
- "Keyword base is not allowed in static method");
+ Error (1511, "Keyword base is not allowed in static method");
+ return null;
+ }
+
+ if (ec.IsFieldInitializer){
+ Error (1512, "Keyword base is not available in the current context");
return null;
}
- member_lookup = MemberLookup (ec, base_type, member, loc);
- if (member_lookup == null)
+ member_lookup = MemberLookup (ec, ec.ContainerType, null, base_type, member,
+ AllMemberTypes, AllBindingFlags, loc);
+ if (member_lookup == null) {
+ MemberLookupFailed (ec, base_type, base_type, member, null, loc);
return null;
+ }
Expression left;
if (ec.IsStatic)
- left = new TypeExpr (base_type);
+ left = new TypeExpression (base_type, loc);
else
- left = ec.This;
+ left = ec.GetThis (loc);
e = MemberAccess.ResolveMemberAccess (ec, member_lookup, left, loc, null);
+
if (e is PropertyExpr){
PropertyExpr pe = (PropertyExpr) e;
pe.IsBase = true;
}
+
+ if (e is MethodGroupExpr)
+ ((MethodGroupExpr) e).IsBase = true;
return e;
}
@@ -6063,38 +8374,28 @@ namespace Mono.CSharp {
/// <summary>
/// The base indexer operator
/// </summary>
- public class BaseIndexerAccess : Expression {
- ArrayList Arguments;
- Location loc;
-
- public BaseIndexerAccess (ArrayList args, Location l)
+ public class BaseIndexerAccess : IndexerAccess {
+ public BaseIndexerAccess (ArrayList args, Location loc)
+ : base (null, true, loc)
{
- Arguments = args;
- loc = l;
+ arguments = new ArrayList ();
+ foreach (Expression tmp in args)
+ arguments.Add (new Argument (tmp, Argument.AType.Expression));
}
- public override Expression DoResolve (EmitContext ec)
+ protected override bool CommonResolve (EmitContext ec)
{
- Type current_type = ec.ContainerType;
- Type base_type = current_type.BaseType;
- Expression member_lookup;
+ instance_expr = ec.GetThis (loc);
- if (ec.IsStatic){
- Report.Error (1511, loc,
- "Keyword base is not allowed in static method");
- return null;
- }
-
- member_lookup = MemberLookup (ec, base_type, "get_Item", MemberTypes.Method, AllBindingFlags, loc);
- if (member_lookup == null)
- return null;
+ current_type = ec.ContainerType.BaseType;
+ indexer_type = current_type;
- return MemberAccess.ResolveMemberAccess (ec, member_lookup, ec.This, loc, null);
- }
+ foreach (Argument a in arguments){
+ if (!a.Resolve (ec, loc))
+ return false;
+ }
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("Should never be called");
+ return true;
}
}
@@ -6109,16 +8410,21 @@ namespace Mono.CSharp {
/// is needed (the `New' class).
/// </summary>
public class EmptyExpression : Expression {
+ public static readonly EmptyExpression Null = new EmptyExpression ();
+
+ // TODO: should be protected
public EmptyExpression ()
{
type = TypeManager.object_type;
eclass = ExprClass.Value;
+ loc = Location.Null;
}
public EmptyExpression (Type t)
{
type = t;
eclass = ExprClass.Value;
+ loc = Location.Null;
}
public override Expression DoResolve (EmitContext ec)
@@ -6134,7 +8440,7 @@ namespace Mono.CSharp {
//
// This is just because we might want to reuse this bad boy
// instead of creating gazillions of EmptyExpressions.
- // (CanConvertImplicit uses it)
+ // (CanImplicitConversion uses it)
//
public void SetType (Type t)
{
@@ -6146,12 +8452,13 @@ namespace Mono.CSharp {
MethodBase method;
Expression source;
- public UserCast (MethodInfo method, Expression source)
+ public UserCast (MethodInfo method, Expression source, Location l)
{
this.method = method;
this.source = source;
type = method.ReturnType;
eclass = ExprClass.Value;
+ loc = l;
}
public override Expression DoResolve (EmitContext ec)
@@ -6182,10 +8489,9 @@ namespace Mono.CSharp {
// the type specification, we just use this to construct the type
// one bit at a time.
// </summary>
- public class ComposedCast : Expression {
+ public class ComposedCast : TypeExpr {
Expression left;
string dim;
- Location loc;
public ComposedCast (Expression left, string dim, Location l)
{
@@ -6194,21 +8500,39 @@ namespace Mono.CSharp {
loc = l;
}
- public override Expression DoResolve (EmitContext ec)
+ public override TypeExpr DoResolveAsTypeStep (EmitContext ec)
{
- left = left.Resolve (ec);
- if (left == null)
+ TypeExpr lexpr = left.ResolveAsTypeTerminal (ec, false);
+ if (lexpr == null)
return null;
- if (left.eclass != ExprClass.Type){
- report118 (loc, left, "type");
+ Type ltype = lexpr.ResolveType (ec);
+
+ if ((ltype == TypeManager.void_type) && (dim != "*")) {
+ Report.Error (1547, Location,
+ "Keyword 'void' cannot be used in this context");
return null;
}
-
- type = RootContext.LookupType (
- ec.DeclSpace, left.Type.FullName + dim, false, loc);
- if (type == null)
- return null;
+
+ //
+ // ltype.Fullname is already fully qualified, so we can skip
+ // a lot of probes, and go directly to TypeManager.LookupType
+ //
+ string cname = ltype.FullName + dim;
+ type = TypeManager.LookupTypeDirect (cname);
+ if (type == null){
+ //
+ // For arrays of enumerations we are having a problem
+ // with the direct lookup. Need to investigate.
+ //
+ // For now, fall back to the full lookup in that case.
+ //
+ type = RootContext.LookupType (
+ ec.DeclSpace, cname, false, loc);
+
+ if (type == null)
+ return null;
+ }
if (!ec.InUnsafe && type.IsPointer){
UnsafeError (loc);
@@ -6219,9 +8543,10 @@ namespace Mono.CSharp {
return this;
}
- public override void Emit (EmitContext ec)
- {
- throw new Exception ("This should never be called");
+ public override string Name {
+ get {
+ return left + dim;
+ }
}
}
@@ -6232,22 +8557,15 @@ namespace Mono.CSharp {
public class ArrayPtr : Expression {
Expression array;
- public ArrayPtr (Expression array)
+ public ArrayPtr (Expression array, Location l)
{
- Type array_type = array.Type.GetElementType ();
+ Type array_type = TypeManager.GetElementType (array.Type);
this.array = array;
-
- string array_ptr_type_name = array_type.FullName + "*";
-
- type = Type.GetType (array_ptr_type_name);
- if (type == null){
- ModuleBuilder mb = CodeGen.ModuleBuilder;
-
- type = mb.GetType (array_ptr_type_name);
- }
+ type = TypeManager.GetPointerType (array_type);
eclass = ExprClass.Value;
+ loc = l;
}
public override void Emit (EmitContext ec)
@@ -6256,7 +8574,7 @@ namespace Mono.CSharp {
array.Emit (ec);
IntLiteral.EmitInt (ig, 0);
- ig.Emit (OpCodes.Ldelema, array.Type.GetElementType ());
+ ig.Emit (OpCodes.Ldelema, TypeManager.GetElementType (array.Type));
}
public override Expression DoResolve (EmitContext ec)
@@ -6274,11 +8592,12 @@ namespace Mono.CSharp {
public class StringPtr : Expression {
LocalBuilder b;
- public StringPtr (LocalBuilder b)
+ public StringPtr (LocalBuilder b, Location l)
{
this.b = b;
eclass = ExprClass.Value;
type = TypeManager.char_ptr_type;
+ loc = l;
}
public override Expression DoResolve (EmitContext ec)
@@ -6305,11 +8624,10 @@ namespace Mono.CSharp {
//
public class StackAlloc : Expression {
Type otype;
- string t;
+ Expression t;
Expression count;
- Location loc;
- public StackAlloc (string type, Expression count, Location l)
+ public StackAlloc (Expression type, Expression count, Location l)
{
t = type;
this.count = count;
@@ -6323,32 +8641,34 @@ namespace Mono.CSharp {
return null;
if (count.Type != TypeManager.int32_type){
- count = ConvertImplicitRequired (ec, count, TypeManager.int32_type, loc);
+ count = Convert.ImplicitConversionRequired (ec, count, TypeManager.int32_type, loc);
if (count == null)
return null;
}
- if (ec.InCatch || ec.InFinally){
- Report.Error (255, loc,
- "stackalloc can not be used in a catch or finally block");
+ Constant c = count as Constant;
+ if (c != null && c.IsNegative) {
+ Report.Error (247, loc, "Cannot use a negative size with stackalloc");
+ return null;
+ }
+
+ if (ec.CurrentBranching.InCatch () ||
+ ec.CurrentBranching.InFinally (true)) {
+ Error (255,
+ "stackalloc can not be used in a catch or finally block");
return null;
}
-
- otype = RootContext.LookupType (ec.DeclSpace, t, false, loc);
- if (otype == null)
+ TypeExpr texpr = t.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
return null;
+ otype = texpr.ResolveType (ec);
+
if (!TypeManager.VerifyUnManaged (otype, loc))
return null;
- string ptr_name = otype.FullName + "*";
- type = Type.GetType (ptr_name);
- if (type == null){
- ModuleBuilder mb = CodeGen.ModuleBuilder;
-
- type = mb.GetType (ptr_name);
- }
+ type = TypeManager.GetPointerType (otype);
eclass = ExprClass.Value;
return this;
diff --git a/mcs/mcs/flowanalysis.cs b/mcs/mcs/flowanalysis.cs
new file mode 100644
index 00000000000..a87c717e18d
--- /dev/null
+++ b/mcs/mcs/flowanalysis.cs
@@ -0,0 +1,2306 @@
+//
+// flowanalyis.cs: The control flow analysis code
+//
+// Author:
+// Martin Baulig (martin@ximian.com)
+//
+// (C) 2001, 2002, 2003 Ximian, Inc.
+//
+
+using System;
+using System.Text;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Diagnostics;
+
+namespace Mono.CSharp
+{
+ // <summary>
+ // A new instance of this class is created every time a new block is resolved
+ // and if there's branching in the block's control flow.
+ // </summary>
+ public abstract class FlowBranching
+ {
+ // <summary>
+ // The type of a FlowBranching.
+ // </summary>
+ public enum BranchingType : byte {
+ // Normal (conditional or toplevel) block.
+ Block,
+
+ // Conditional.
+ Conditional,
+
+ // A loop block.
+ Loop,
+
+ // Try/Catch block.
+ Exception,
+
+ // Switch block.
+ Switch,
+
+ // Switch section.
+ SwitchSection
+ }
+
+ // <summary>
+ // The type of one sibling of a branching.
+ // </summary>
+ public enum SiblingType : byte {
+ Block,
+ Conditional,
+ SwitchSection,
+ Try,
+ Catch,
+ Finally
+ }
+
+ // <summary>
+ // This is used in the control flow analysis code to specify whether the
+ // current code block may return to its enclosing block before reaching
+ // its end.
+ // </summary>
+ public enum FlowReturns : byte {
+ Undefined = 0,
+
+ // It can never return.
+ Never,
+
+ // This means that the block contains a conditional return statement
+ // somewhere.
+ Sometimes,
+
+ // The code always returns, ie. there's an unconditional return / break
+ // statement in it.
+ Always
+ }
+
+ public sealed class Reachability
+ {
+ FlowReturns returns, breaks, throws, barrier;
+
+ public FlowReturns Returns {
+ get { return returns; }
+ }
+ public FlowReturns Breaks {
+ get { return breaks; }
+ }
+ public FlowReturns Throws {
+ get { return throws; }
+ }
+ public FlowReturns Barrier {
+ get { return barrier; }
+ }
+ public Reachability (FlowReturns returns, FlowReturns breaks,
+ FlowReturns throws, FlowReturns barrier)
+ {
+ this.returns = returns;
+ this.breaks = breaks;
+ this.throws = throws;
+ this.barrier = barrier;
+ }
+
+ public Reachability Clone ()
+ {
+ return new Reachability (returns, breaks, throws, barrier);
+ }
+
+ // <summary>
+ // Performs an `And' operation on the FlowReturns status
+ // (for instance, a block only returns Always if all its siblings
+ // always return).
+ // </summary>
+ public static FlowReturns AndFlowReturns (FlowReturns a, FlowReturns b)
+ {
+ if (a == FlowReturns.Undefined)
+ return b;
+
+ switch (a) {
+ case FlowReturns.Never:
+ if (b == FlowReturns.Never)
+ return FlowReturns.Never;
+ else
+ return FlowReturns.Sometimes;
+
+ case FlowReturns.Sometimes:
+ return FlowReturns.Sometimes;
+
+ case FlowReturns.Always:
+ if (b == FlowReturns.Always)
+ return FlowReturns.Always;
+ else
+ return FlowReturns.Sometimes;
+
+ default:
+ throw new ArgumentException ();
+ }
+ }
+
+ public static FlowReturns OrFlowReturns (FlowReturns a, FlowReturns b)
+ {
+ if (a == FlowReturns.Undefined)
+ return b;
+
+ switch (a) {
+ case FlowReturns.Never:
+ return b;
+
+ case FlowReturns.Sometimes:
+ if (b == FlowReturns.Always)
+ return FlowReturns.Always;
+ else
+ return FlowReturns.Sometimes;
+
+ case FlowReturns.Always:
+ return FlowReturns.Always;
+
+ default:
+ throw new ArgumentException ();
+ }
+ }
+
+ public static void And (ref Reachability a, Reachability b, bool do_break)
+ {
+ if (a == null) {
+ a = b.Clone ();
+ return;
+ }
+
+ //
+ // `break' does not "break" in a Switch or a LoopBlock
+ //
+ bool a_breaks = do_break && a.AlwaysBreaks;
+ bool b_breaks = do_break && b.AlwaysBreaks;
+
+ bool a_has_barrier, b_has_barrier;
+ if (do_break) {
+ //
+ // This is the normal case: the code following a barrier
+ // cannot be reached.
+ //
+ a_has_barrier = a.AlwaysHasBarrier;
+ b_has_barrier = b.AlwaysHasBarrier;
+ } else {
+ //
+ // Special case for Switch and LoopBlocks: we can reach the
+ // code after the barrier via the `break'.
+ //
+ a_has_barrier = !a.AlwaysBreaks && a.AlwaysHasBarrier;
+ b_has_barrier = !b.AlwaysBreaks && b.AlwaysHasBarrier;
+ }
+
+ bool a_unreachable = a_breaks || a.AlwaysThrows || a_has_barrier;
+ bool b_unreachable = b_breaks || b.AlwaysThrows || b_has_barrier;
+
+ //
+ // Do all code paths always return ?
+ //
+ if (a.AlwaysReturns) {
+ if (b.AlwaysReturns || b_unreachable)
+ a.returns = FlowReturns.Always;
+ else
+ a.returns = FlowReturns.Sometimes;
+ } else if (b.AlwaysReturns) {
+ if (a.AlwaysReturns || a_unreachable)
+ a.returns = FlowReturns.Always;
+ else
+ a.returns = FlowReturns.Sometimes;
+ } else if (!a.MayReturn) {
+ if (b.MayReturn)
+ a.returns = FlowReturns.Sometimes;
+ else
+ a.returns = FlowReturns.Never;
+ } else if (!b.MayReturn) {
+ if (a.MayReturn)
+ a.returns = FlowReturns.Sometimes;
+ else
+ a.returns = FlowReturns.Never;
+ }
+
+ a.breaks = AndFlowReturns (a.breaks, b.breaks);
+ a.throws = AndFlowReturns (a.throws, b.throws);
+ a.barrier = AndFlowReturns (a.barrier, b.barrier);
+
+ if (a_unreachable && b_unreachable)
+ a.barrier = FlowReturns.Always;
+ else if (a_unreachable || b_unreachable)
+ a.barrier = FlowReturns.Sometimes;
+ else
+ a.barrier = FlowReturns.Never;
+ }
+
+ public void Or (Reachability b)
+ {
+ returns = OrFlowReturns (returns, b.returns);
+ breaks = OrFlowReturns (breaks, b.breaks);
+ throws = OrFlowReturns (throws, b.throws);
+ barrier = OrFlowReturns (barrier, b.barrier);
+ }
+
+ public static Reachability Never ()
+ {
+ return new Reachability (
+ FlowReturns.Never, FlowReturns.Never,
+ FlowReturns.Never, FlowReturns.Never);
+ }
+
+ public FlowReturns Reachable {
+ get {
+ if ((returns == FlowReturns.Always) ||
+ (breaks == FlowReturns.Always) ||
+ (throws == FlowReturns.Always) ||
+ (barrier == FlowReturns.Always))
+ return FlowReturns.Never;
+ else if ((returns == FlowReturns.Never) &&
+ (breaks == FlowReturns.Never) &&
+ (throws == FlowReturns.Never) &&
+ (barrier == FlowReturns.Never))
+ return FlowReturns.Always;
+ else
+ return FlowReturns.Sometimes;
+ }
+ }
+
+ public bool AlwaysBreaks {
+ get { return breaks == FlowReturns.Always; }
+ }
+
+ public bool MayBreak {
+ get { return breaks != FlowReturns.Never; }
+ }
+
+ public bool AlwaysReturns {
+ get { return returns == FlowReturns.Always; }
+ }
+
+ public bool MayReturn {
+ get { return returns != FlowReturns.Never; }
+ }
+
+ public bool AlwaysThrows {
+ get { return throws == FlowReturns.Always; }
+ }
+
+ public bool MayThrow {
+ get { return throws != FlowReturns.Never; }
+ }
+
+ public bool AlwaysHasBarrier {
+ get { return barrier == FlowReturns.Always; }
+ }
+
+ public bool MayHaveBarrier {
+ get { return barrier != FlowReturns.Never; }
+ }
+
+ public bool IsUnreachable {
+ get { return Reachable == FlowReturns.Never; }
+ }
+
+ public void SetReturns ()
+ {
+ returns = FlowReturns.Always;
+ }
+
+ public void SetReturnsSometimes ()
+ {
+ returns = FlowReturns.Sometimes;
+ }
+
+ public void SetBreaks ()
+ {
+ breaks = FlowReturns.Always;
+ }
+
+ public void ResetBreaks ()
+ {
+ breaks = FlowReturns.Never;
+ }
+
+ public void SetThrows ()
+ {
+ throws = FlowReturns.Always;
+ }
+
+ public void SetThrowsSometimes ()
+ {
+ throws = FlowReturns.Sometimes;
+ }
+
+ public void SetBarrier ()
+ {
+ barrier = FlowReturns.Always;
+ }
+
+ public void ResetBarrier ()
+ {
+ barrier = FlowReturns.Never;
+ }
+
+ static string ShortName (FlowReturns returns)
+ {
+ switch (returns) {
+ case FlowReturns.Never:
+ return "N";
+ case FlowReturns.Sometimes:
+ return "S";
+ default:
+ return "A";
+ }
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("[{0}:{1}:{2}:{3}:{4}]",
+ ShortName (returns), ShortName (breaks),
+ ShortName (throws), ShortName (barrier),
+ ShortName (Reachable));
+ }
+ }
+
+ public static FlowBranching CreateBranching (FlowBranching parent, BranchingType type, Block block, Location loc)
+ {
+ switch (type) {
+ case BranchingType.Exception:
+ throw new InvalidOperationException ();
+
+ case BranchingType.Switch:
+ return new FlowBranchingBlock (parent, type, SiblingType.SwitchSection, block, loc);
+
+ case BranchingType.SwitchSection:
+ return new FlowBranchingBlock (parent, type, SiblingType.Block, block, loc);
+
+ case BranchingType.Block:
+ return new FlowBranchingBlock (parent, type, SiblingType.Block, block, loc);
+
+ case BranchingType.Loop:
+ return new FlowBranchingLoop (parent, block, loc);
+
+ default:
+ return new FlowBranchingBlock (parent, type, SiblingType.Conditional, block, loc);
+ }
+ }
+
+ // <summary>
+ // The type of this flow branching.
+ // </summary>
+ public readonly BranchingType Type;
+
+ // <summary>
+ // The block this branching is contained in. This may be null if it's not
+ // a top-level block and it doesn't declare any local variables.
+ // </summary>
+ public readonly Block Block;
+
+ // <summary>
+ // The parent of this branching or null if this is the top-block.
+ // </summary>
+ public readonly FlowBranching Parent;
+
+ // <summary>
+ // Start-Location of this flow branching.
+ // </summary>
+ public readonly Location Location;
+
+ // <summary>
+ // If this is an infinite loop.
+ // </summary>
+ public bool Infinite;
+
+ //
+ // Private
+ //
+ VariableMap param_map, local_map;
+
+ static int next_id = 0;
+ int id;
+
+ // <summary>
+ // The vector contains a BitArray with information about which local variables
+ // and parameters are already initialized at the current code position.
+ // </summary>
+ public class UsageVector {
+ // <summary>
+ // The type of this branching.
+ // </summary>
+ public readonly SiblingType Type;
+
+ // <summary>
+ // Start location of this branching.
+ // </summary>
+ public readonly Location Location;
+
+ // <summary>
+ // This is only valid for SwitchSection, Try, Catch and Finally.
+ // </summary>
+ public readonly Block Block;
+
+ // <summary>
+ // If this is true, then the usage vector has been modified and must be
+ // merged when we're done with this branching.
+ // </summary>
+ public bool IsDirty;
+
+ // <summary>
+ // The number of parameters in this block.
+ // </summary>
+ public readonly int CountParameters;
+
+ // <summary>
+ // The number of locals in this block.
+ // </summary>
+ public readonly int CountLocals;
+
+ // <summary>
+ // If not null, then we inherit our state from this vector and do a
+ // copy-on-write. If null, then we're the first sibling in a top-level
+ // block and inherit from the empty vector.
+ // </summary>
+ public readonly UsageVector InheritsFrom;
+
+ // <summary>
+ // This is used to construct a list of UsageVector's.
+ // </summary>
+ public UsageVector Next;
+
+ //
+ // Private.
+ //
+ MyBitVector locals, parameters;
+ Reachability reachability;
+
+ static int next_id = 0;
+ int id;
+
+ //
+ // Normally, you should not use any of these constructors.
+ //
+ public UsageVector (SiblingType type, UsageVector parent,
+ Block block, Location loc,
+ int num_params, int num_locals)
+ {
+ this.Type = type;
+ this.Block = block;
+ this.Location = loc;
+ this.InheritsFrom = parent;
+ this.CountParameters = num_params;
+ this.CountLocals = num_locals;
+
+ if (parent != null) {
+ if (num_locals > 0)
+ locals = new MyBitVector (parent.locals, CountLocals);
+
+ if (num_params > 0)
+ parameters = new MyBitVector (parent.parameters, num_params);
+
+ reachability = parent.Reachability.Clone ();
+ } else {
+ if (num_locals > 0)
+ locals = new MyBitVector (null, CountLocals);
+
+ if (num_params > 0)
+ parameters = new MyBitVector (null, num_params);
+
+ reachability = Reachability.Never ();
+ }
+
+ id = ++next_id;
+ }
+
+ public UsageVector (SiblingType type, UsageVector parent,
+ Block block, Location loc)
+ : this (type, parent, block, loc,
+ parent.CountParameters, parent.CountLocals)
+ { }
+
+ public UsageVector (MyBitVector parameters, MyBitVector locals,
+ Reachability reachability, Block block,
+ Location loc)
+ {
+ this.Type = SiblingType.Block;
+ this.Location = loc;
+ this.Block = block;
+
+ this.reachability = reachability;
+ this.parameters = parameters;
+ this.locals = locals;
+
+ id = ++next_id;
+ }
+
+ // <summary>
+ // This does a deep copy of the usage vector.
+ // </summary>
+ public UsageVector Clone ()
+ {
+ UsageVector retval = new UsageVector (
+ Type, null, Block, Location,
+ CountParameters, CountLocals);
+
+ if (retval.locals != null)
+ retval.locals = locals.Clone ();
+
+ if (parameters != null)
+ retval.parameters = parameters.Clone ();
+
+ retval.reachability = reachability.Clone ();
+
+ return retval;
+ }
+
+ public bool IsAssigned (VariableInfo var)
+ {
+ if (!var.IsParameter && Reachability.IsUnreachable)
+ return true;
+
+ return var.IsAssigned (var.IsParameter ? parameters : locals);
+ }
+
+ public void SetAssigned (VariableInfo var)
+ {
+ if (!var.IsParameter && Reachability.IsUnreachable)
+ return;
+
+ IsDirty = true;
+ var.SetAssigned (var.IsParameter ? parameters : locals);
+ }
+
+ public bool IsFieldAssigned (VariableInfo var, string name)
+ {
+ if (!var.IsParameter && Reachability.IsUnreachable)
+ return true;
+
+ return var.IsFieldAssigned (var.IsParameter ? parameters : locals, name);
+ }
+
+ public void SetFieldAssigned (VariableInfo var, string name)
+ {
+ if (!var.IsParameter && Reachability.IsUnreachable)
+ return;
+
+ IsDirty = true;
+ var.SetFieldAssigned (var.IsParameter ? parameters : locals, name);
+ }
+
+ public Reachability Reachability {
+ get {
+ return reachability;
+ }
+ }
+
+ public void Return ()
+ {
+ if (!reachability.IsUnreachable) {
+ IsDirty = true;
+ reachability.SetReturns ();
+ }
+ }
+
+ public void Break ()
+ {
+ if (!reachability.IsUnreachable) {
+ IsDirty = true;
+ reachability.SetBreaks ();
+ }
+ }
+
+ public void Throw ()
+ {
+ if (!reachability.IsUnreachable) {
+ IsDirty = true;
+ reachability.SetThrows ();
+ }
+ }
+
+ public void Goto ()
+ {
+ if (!reachability.IsUnreachable) {
+ IsDirty = true;
+ reachability.SetBarrier ();
+ }
+ }
+
+ // <summary>
+ // Merges a child branching.
+ // </summary>
+ public UsageVector MergeChild (FlowBranching branching)
+ {
+ UsageVector result = branching.Merge ();
+
+ Report.Debug (2, " MERGING CHILD", this, branching, IsDirty,
+ result.ParameterVector, result.LocalVector,
+ result.Reachability, reachability, Type);
+
+ Reachability new_r = result.Reachability;
+
+ if (branching.Type == BranchingType.Loop) {
+ bool may_leave_loop = new_r.MayBreak;
+ new_r.ResetBreaks ();
+
+ if (branching.Infinite && !may_leave_loop) {
+ if (new_r.Returns == FlowReturns.Sometimes) {
+ // If we're an infinite loop and do not break,
+ // the code after the loop can never be reached.
+ // However, if we may return from the loop,
+ // then we do always return (or stay in the
+ // loop forever).
+ new_r.SetReturns ();
+ }
+
+ new_r.SetBarrier ();
+ } else {
+ if (new_r.Returns == FlowReturns.Always) {
+ // We're either finite or we may leave the loop.
+ new_r.SetReturnsSometimes ();
+ }
+ if (new_r.Throws == FlowReturns.Always) {
+ // We're either finite or we may leave the loop.
+ new_r.SetThrowsSometimes ();
+ }
+
+ if (!new_r.MayReturn && !new_r.MayThrow)
+ new_r.ResetBarrier ();
+ }
+ } else if (branching.Type == BranchingType.Switch) {
+ if (new_r.MayBreak || new_r.MayReturn)
+ new_r.ResetBarrier ();
+
+ new_r.ResetBreaks ();
+ }
+
+ //
+ // We've now either reached the point after the branching or we will
+ // never get there since we always return or always throw an exception.
+ //
+ // If we can reach the point after the branching, mark all locals and
+ // parameters as initialized which have been initialized in all branches
+ // we need to look at (see above).
+ //
+
+ if ((Type == SiblingType.SwitchSection) && !new_r.IsUnreachable) {
+ Report.Error (163, Location,
+ "Control cannot fall through from one " +
+ "case label to another");
+ return result;
+ }
+
+ if (locals != null && result.LocalVector != null)
+ locals.Or (result.LocalVector);
+
+ if (result.ParameterVector != null)
+ parameters.Or (result.ParameterVector);
+
+ reachability.Or (new_r);
+
+ Report.Debug (2, " MERGING CHILD DONE", this, result,
+ new_r, reachability);
+
+ IsDirty = true;
+
+ return result;
+ }
+
+ protected void MergeFinally (FlowBranching branching, UsageVector f_origins,
+ MyBitVector f_params)
+ {
+ for (UsageVector vector = f_origins; vector != null; vector = vector.Next) {
+ MyBitVector temp_params = f_params.Clone ();
+ temp_params.Or (vector.Parameters);
+ }
+ }
+
+ public void MergeFinally (FlowBranching branching, UsageVector f_vector,
+ UsageVector f_origins)
+ {
+ if (parameters != null) {
+ if (f_vector != null) {
+ MergeFinally (branching, f_origins, f_vector.Parameters);
+ MyBitVector.Or (ref parameters, f_vector.ParameterVector);
+ } else
+ MergeFinally (branching, f_origins, parameters);
+ }
+
+ if (f_vector != null && f_vector.LocalVector != null)
+ MyBitVector.Or (ref locals, f_vector.LocalVector);
+ }
+
+ // <summary>
+ // Tells control flow analysis that the current code position may be reached with
+ // a forward jump from any of the origins listed in `origin_vectors' which is a
+ // list of UsageVectors.
+ //
+ // This is used when resolving forward gotos - in the following example, the
+ // variable `a' is uninitialized in line 8 becase this line may be reached via
+ // the goto in line 4:
+ //
+ // 1 int a;
+ //
+ // 3 if (something)
+ // 4 goto World;
+ //
+ // 6 a = 5;
+ //
+ // 7 World:
+ // 8 Console.WriteLine (a);
+ //
+ // </summary>
+ public void MergeJumpOrigins (UsageVector o_vectors)
+ {
+ Report.Debug (1, " MERGING JUMP ORIGINS", this);
+
+ reachability = Reachability.Never ();
+
+ if (o_vectors == null) {
+ reachability.SetBarrier ();
+ return;
+ }
+
+ bool first = true;
+
+ for (UsageVector vector = o_vectors; vector != null;
+ vector = vector.Next) {
+ Report.Debug (1, " MERGING JUMP ORIGIN", vector);
+
+ if (first) {
+ if (locals != null && vector.Locals != null)
+ locals.Or (vector.locals);
+
+ if (parameters != null)
+ parameters.Or (vector.parameters);
+ first = false;
+ } else {
+ if (locals != null && vector.Locals != null)
+ locals.And (vector.locals);
+ if (parameters != null)
+ parameters.And (vector.parameters);
+ }
+
+ Reachability.And (ref reachability, vector.Reachability, true);
+ }
+
+ Report.Debug (1, " MERGING JUMP ORIGINS DONE", this);
+ }
+
+ // <summary>
+ // This is used at the beginning of a finally block if there were
+ // any return statements in the try block or one of the catch blocks.
+ // </summary>
+ public void MergeFinallyOrigins (UsageVector f_origins)
+ {
+ Report.Debug (1, " MERGING FINALLY ORIGIN", this);
+
+ reachability = Reachability.Never ();
+
+ for (UsageVector vector = f_origins; vector != null; vector = vector.Next) {
+ Report.Debug (1, " MERGING FINALLY ORIGIN", vector);
+
+ if (parameters != null)
+ parameters.And (vector.parameters);
+
+ Reachability.And (ref reachability, vector.Reachability, true);
+ }
+
+ Report.Debug (1, " MERGING FINALLY ORIGIN DONE", this);
+ }
+
+ public void MergeBreakOrigins (UsageVector o_vectors)
+ {
+ Report.Debug (1, " MERGING BREAK ORIGINS", this);
+
+ if (o_vectors == null)
+ return;
+
+ bool first = true;
+
+ for (UsageVector vector = o_vectors; vector != null;
+ vector = vector.Next) {
+ Report.Debug (1, " MERGING BREAK ORIGIN", vector);
+
+ if (first) {
+ if (locals != null && vector.Locals != null)
+ locals.Or (vector.locals);
+
+ if (parameters != null)
+ parameters.Or (vector.parameters);
+ first = false;
+ } else {
+ if (locals != null && vector.Locals != null)
+ locals.And (vector.locals);
+ if (parameters != null)
+ parameters.And (vector.parameters);
+ }
+ }
+
+ Report.Debug (1, " MERGING BREAK ORIGINS DONE", this);
+ }
+
+ public void CheckOutParameters (FlowBranching branching)
+ {
+ if (parameters != null)
+ branching.CheckOutParameters (parameters, branching.Location);
+ }
+
+ // <summary>
+ // Performs an `or' operation on the locals and the parameters.
+ // </summary>
+ public void Or (UsageVector new_vector)
+ {
+ IsDirty = true;
+ locals.Or (new_vector.locals);
+ if (parameters != null)
+ parameters.Or (new_vector.parameters);
+ }
+
+ // <summary>
+ // Performs an `and' operation on the locals.
+ // </summary>
+ public void AndLocals (UsageVector new_vector)
+ {
+ IsDirty = true;
+ locals.And (new_vector.locals);
+ }
+
+ public bool HasParameters {
+ get {
+ return parameters != null;
+ }
+ }
+
+ public bool HasLocals {
+ get {
+ return locals != null;
+ }
+ }
+
+ // <summary>
+ // Returns a deep copy of the parameters.
+ // </summary>
+ public MyBitVector Parameters {
+ get {
+ if (parameters != null)
+ return parameters.Clone ();
+ else
+ return null;
+ }
+ }
+
+ // <summary>
+ // Returns a deep copy of the locals.
+ // </summary>
+ public MyBitVector Locals {
+ get {
+ if (locals != null)
+ return locals.Clone ();
+ else
+ return null;
+ }
+ }
+
+ public MyBitVector ParameterVector {
+ get {
+ return parameters;
+ }
+ }
+
+ public MyBitVector LocalVector {
+ get {
+ return locals;
+ }
+ }
+
+ //
+ // Debugging stuff.
+ //
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ();
+
+ sb.Append ("Vector (");
+ sb.Append (Type);
+ sb.Append (",");
+ sb.Append (id);
+ sb.Append (",");
+ sb.Append (IsDirty);
+ sb.Append (",");
+ sb.Append (reachability);
+ if (parameters != null) {
+ sb.Append (" - ");
+ sb.Append (parameters);
+ }
+ sb.Append (" - ");
+ sb.Append (locals);
+ sb.Append (")");
+
+ return sb.ToString ();
+ }
+ }
+
+ // <summary>
+ // Creates a new flow branching which is contained in `parent'.
+ // You should only pass non-null for the `block' argument if this block
+ // introduces any new variables - in this case, we need to create a new
+ // usage vector with a different size than our parent's one.
+ // </summary>
+ protected FlowBranching (FlowBranching parent, BranchingType type, SiblingType stype,
+ Block block, Location loc)
+ {
+ Parent = parent;
+ Block = block;
+ Location = loc;
+ Type = type;
+ id = ++next_id;
+
+ UsageVector vector;
+ if (Block != null) {
+ param_map = Block.ParameterMap;
+ local_map = Block.LocalMap;
+
+ UsageVector parent_vector = parent != null ? parent.CurrentUsageVector : null;
+ vector = new UsageVector (
+ stype, parent_vector, Block, loc,
+ param_map.Length, local_map.Length);
+ } else {
+ param_map = Parent.param_map;
+ local_map = Parent.local_map;
+ vector = new UsageVector (
+ stype, Parent.CurrentUsageVector, null, loc);
+ }
+
+ AddSibling (vector);
+ }
+
+ public abstract UsageVector CurrentUsageVector {
+ get;
+ }
+
+ // <summary>
+ // Creates a sibling of the current usage vector.
+ // </summary>
+ public virtual void CreateSibling (Block block, SiblingType type)
+ {
+ UsageVector vector = new UsageVector (
+ type, Parent.CurrentUsageVector, block, Location);
+ AddSibling (vector);
+
+ Report.Debug (1, " CREATED SIBLING", CurrentUsageVector);
+ }
+
+ public void CreateSibling ()
+ {
+ CreateSibling (null, SiblingType.Conditional);
+ }
+
+ protected abstract void AddSibling (UsageVector uv);
+
+ public virtual LabeledStatement LookupLabel (string name, Location loc)
+ {
+ if (Parent != null)
+ return Parent.LookupLabel (name, loc);
+
+ Report.Error (
+ 159, loc,
+ "No such label `" + name + "' in this scope");
+ return null;
+ }
+
+ public abstract void Label (UsageVector origin_vectors);
+
+ // <summary>
+ // Check whether all `out' parameters have been assigned.
+ // </summary>
+ public void CheckOutParameters (MyBitVector parameters, Location loc)
+ {
+ for (int i = 0; i < param_map.Count; i++) {
+ VariableInfo var = param_map [i];
+
+ if (var == null)
+ continue;
+
+ if (var.IsAssigned (parameters))
+ continue;
+
+ Report.Error (177, loc, "The out parameter `" +
+ var.Name + "' must be " +
+ "assigned before control leaves the current method.");
+ }
+ }
+
+ protected UsageVector Merge (UsageVector sibling_list)
+ {
+ if (sibling_list.Next == null)
+ return sibling_list;
+
+ MyBitVector locals = null;
+ MyBitVector parameters = null;
+
+ Reachability reachability = null;
+
+ Report.Debug (2, " MERGING SIBLINGS", this, Name);
+
+ for (UsageVector child = sibling_list; child != null; child = child.Next) {
+ bool do_break = (Type != BranchingType.Switch) &&
+ (Type != BranchingType.Loop);
+
+ Report.Debug (2, " MERGING SIBLING ", child,
+ child.ParameterVector, child.LocalVector,
+ reachability, child.Reachability, do_break);
+
+ Reachability.And (ref reachability, child.Reachability, do_break);
+
+ // A local variable is initialized after a flow branching if it
+ // has been initialized in all its branches which do neither
+ // always return or always throw an exception.
+ //
+ // If a branch may return, but does not always return, then we
+ // can treat it like a never-returning branch here: control will
+ // only reach the code position after the branching if we did not
+ // return here.
+ //
+ // It's important to distinguish between always and sometimes
+ // returning branches here:
+ //
+ // 1 int a;
+ // 2 if (something) {
+ // 3 return;
+ // 4 a = 5;
+ // 5 }
+ // 6 Console.WriteLine (a);
+ //
+ // The if block in lines 3-4 always returns, so we must not look
+ // at the initialization of `a' in line 4 - thus it'll still be
+ // uninitialized in line 6.
+ //
+ // On the other hand, the following is allowed:
+ //
+ // 1 int a;
+ // 2 if (something)
+ // 3 a = 5;
+ // 4 else
+ // 5 return;
+ // 6 Console.WriteLine (a);
+ //
+ // Here, `a' is initialized in line 3 and we must not look at
+ // line 5 since it always returns.
+ //
+ bool do_break_2 = (child.Type != SiblingType.Block) &&
+ (child.Type != SiblingType.SwitchSection);
+ bool always_throws = (child.Type != SiblingType.Try) &&
+ child.Reachability.AlwaysThrows;
+ bool unreachable = always_throws ||
+ (do_break_2 && child.Reachability.AlwaysBreaks) ||
+ child.Reachability.AlwaysReturns ||
+ child.Reachability.AlwaysHasBarrier;
+
+ Report.Debug (2, " MERGING SIBLING #1", reachability,
+ Type, child.Type, child.Reachability.IsUnreachable,
+ do_break_2, always_throws, unreachable);
+
+ if (!unreachable && (child.LocalVector != null))
+ MyBitVector.And (ref locals, child.LocalVector);
+
+ // An `out' parameter must be assigned in all branches which do
+ // not always throw an exception.
+ if ((child.ParameterVector != null) && !child.Reachability.AlwaysThrows)
+ MyBitVector.And (ref parameters, child.ParameterVector);
+
+ Report.Debug (2, " MERGING SIBLING #2", parameters, locals);
+ }
+
+ if (reachability == null)
+ reachability = Reachability.Never ();
+
+ Report.Debug (2, " MERGING SIBLINGS DONE", parameters, locals,
+ reachability, Infinite);
+
+ return new UsageVector (
+ parameters, locals, reachability, null, Location);
+ }
+
+ protected abstract UsageVector Merge ();
+
+ // <summary>
+ // Merge a child branching.
+ // </summary>
+ public UsageVector MergeChild (FlowBranching child)
+ {
+ return CurrentUsageVector.MergeChild (child);
+ }
+
+ // <summary>
+ // Does the toplevel merging.
+ // </summary>
+ public Reachability MergeTopBlock ()
+ {
+ if ((Type != BranchingType.Block) || (Block == null))
+ throw new NotSupportedException ();
+
+ UsageVector vector = new UsageVector (
+ SiblingType.Conditional, null, Block, Location,
+ param_map.Length, local_map.Length);
+
+ UsageVector result = vector.MergeChild (this);
+
+ Report.Debug (4, "MERGE TOP BLOCK", Location, vector, result.Reachability);
+
+ if ((vector.Reachability.Throws != FlowReturns.Always) &&
+ (vector.Reachability.Barrier != FlowReturns.Always))
+ CheckOutParameters (vector.Parameters, Location);
+
+ return result.Reachability;
+ }
+
+ //
+ // Checks whether we're in a `try' block.
+ //
+ public virtual bool InTryOrCatch (bool is_return)
+ {
+ if ((Block != null) && Block.IsDestructor)
+ return true;
+ else if (!is_return &&
+ ((Type == BranchingType.Loop) || (Type == BranchingType.Switch)))
+ return false;
+ else if (Parent != null)
+ return Parent.InTryOrCatch (is_return);
+ else
+ return false;
+ }
+
+ //
+ // Checks whether we're in a `catch' block.
+ //
+ public virtual bool InCatch ()
+ {
+ if (Parent != null)
+ return Parent.InCatch ();
+ else
+ return false;
+ }
+
+ //
+ // Checks whether we're in a `finally' block.
+ //
+ public virtual bool InFinally (bool is_return)
+ {
+ if (!is_return &&
+ ((Type == BranchingType.Loop) || (Type == BranchingType.Switch)))
+ return false;
+ else if (Parent != null)
+ return Parent.InFinally (is_return);
+ else
+ return false;
+ }
+
+ public virtual bool InLoop ()
+ {
+ if (Type == BranchingType.Loop)
+ return true;
+ else if (Parent != null)
+ return Parent.InLoop ();
+ else
+ return false;
+ }
+
+ public virtual bool InSwitch ()
+ {
+ if (Type == BranchingType.Switch)
+ return true;
+ else if (Parent != null)
+ return Parent.InSwitch ();
+ else
+ return false;
+ }
+
+ public virtual bool BreakCrossesTryCatchBoundary ()
+ {
+ if ((Type == BranchingType.Loop) || (Type == BranchingType.Switch))
+ return false;
+ else if (Parent != null)
+ return Parent.BreakCrossesTryCatchBoundary ();
+ else
+ return false;
+ }
+
+ public virtual void AddFinallyVector (UsageVector vector)
+ {
+ if (Parent != null)
+ Parent.AddFinallyVector (vector);
+ else if ((Block == null) || !Block.IsDestructor)
+ throw new NotSupportedException ();
+ }
+
+ public virtual void AddBreakVector (UsageVector vector)
+ {
+ if (Parent != null)
+ Parent.AddBreakVector (vector);
+ else if ((Block == null) || !Block.IsDestructor)
+ throw new NotSupportedException ();
+ }
+
+ public virtual void StealFinallyClauses (ref ArrayList list)
+ {
+ if (Parent != null)
+ Parent.StealFinallyClauses (ref list);
+ }
+
+ public bool IsAssigned (VariableInfo vi)
+ {
+ return CurrentUsageVector.IsAssigned (vi);
+ }
+
+ public bool IsFieldAssigned (VariableInfo vi, string field_name)
+ {
+ if (CurrentUsageVector.IsAssigned (vi))
+ return true;
+
+ return CurrentUsageVector.IsFieldAssigned (vi, field_name);
+ }
+
+ public void SetAssigned (VariableInfo vi)
+ {
+ CurrentUsageVector.SetAssigned (vi);
+ }
+
+ public void SetFieldAssigned (VariableInfo vi, string name)
+ {
+ CurrentUsageVector.SetFieldAssigned (vi, name);
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ();
+ sb.Append (GetType ());
+ sb.Append (" (");
+
+ sb.Append (id);
+ sb.Append (",");
+ sb.Append (Type);
+ if (Block != null) {
+ sb.Append (" - ");
+ sb.Append (Block.ID);
+ sb.Append (" - ");
+ sb.Append (Block.StartLocation);
+ }
+ sb.Append (" - ");
+ // sb.Append (Siblings.Length);
+ // sb.Append (" - ");
+ sb.Append (CurrentUsageVector);
+ sb.Append (")");
+ return sb.ToString ();
+ }
+
+ public string Name {
+ get {
+ return String.Format ("{0} ({1}:{2}:{3})",
+ GetType (), id, Type, Location);
+ }
+ }
+ }
+
+ public class FlowBranchingBlock : FlowBranching
+ {
+ UsageVector sibling_list = null;
+
+ public FlowBranchingBlock (FlowBranching parent, BranchingType type,
+ SiblingType stype, Block block, Location loc)
+ : base (parent, type, stype, block, loc)
+ { }
+
+ public override UsageVector CurrentUsageVector {
+ get { return sibling_list; }
+ }
+
+ protected override void AddSibling (UsageVector sibling)
+ {
+ sibling.Next = sibling_list;
+ sibling_list = sibling;
+ }
+
+ public override LabeledStatement LookupLabel (string name, Location loc)
+ {
+ if (Block == null)
+ return base.LookupLabel (name, loc);
+
+ LabeledStatement s = Block.LookupLabel (name);
+ if (s != null)
+ return s;
+
+ return base.LookupLabel (name, loc);
+ }
+
+ public override void Label (UsageVector origin_vectors)
+ {
+ if (!CurrentUsageVector.Reachability.IsUnreachable) {
+ UsageVector vector = CurrentUsageVector.Clone ();
+ vector.Next = origin_vectors;
+ origin_vectors = vector;
+ }
+
+ CurrentUsageVector.MergeJumpOrigins (origin_vectors);
+ }
+
+ protected override UsageVector Merge ()
+ {
+ return Merge (sibling_list);
+ }
+ }
+
+ public class FlowBranchingLoop : FlowBranchingBlock
+ {
+ UsageVector break_origins;
+
+ public FlowBranchingLoop (FlowBranching parent, Block block, Location loc)
+ : base (parent, BranchingType.Loop, SiblingType.Conditional, block, loc)
+ { }
+
+ public override void AddBreakVector (UsageVector vector)
+ {
+ vector = vector.Clone ();
+ vector.Next = break_origins;
+ break_origins = vector;
+ }
+
+ protected override UsageVector Merge ()
+ {
+ UsageVector vector = base.Merge ();
+
+ vector.MergeBreakOrigins (break_origins);
+
+ return vector;
+ }
+ }
+
+ public class FlowBranchingException : FlowBranching
+ {
+ ExceptionStatement stmt;
+ UsageVector current_vector;
+ UsageVector catch_vectors;
+ UsageVector finally_vector;
+ UsageVector finally_origins;
+ bool emit_finally;
+ bool in_try;
+
+ public FlowBranchingException (FlowBranching parent,
+ ExceptionStatement stmt)
+ : base (parent, BranchingType.Exception, SiblingType.Try,
+ null, stmt.loc)
+ {
+ this.stmt = stmt;
+ this.emit_finally = true;
+ }
+
+ protected override void AddSibling (UsageVector sibling)
+ {
+ if (sibling.Type == SiblingType.Try) {
+ sibling.Next = catch_vectors;
+ catch_vectors = sibling;
+ in_try = true;
+ } else if (sibling.Type == SiblingType.Catch) {
+ sibling.Next = catch_vectors;
+ catch_vectors = sibling;
+ in_try = false;
+ } else if (sibling.Type == SiblingType.Finally) {
+ sibling.MergeFinallyOrigins (finally_origins);
+ finally_vector = sibling;
+ in_try = false;
+ } else
+ throw new InvalidOperationException ();
+
+ current_vector = sibling;
+ }
+
+ public override UsageVector CurrentUsageVector {
+ get { return current_vector; }
+ }
+
+ public override bool InTryOrCatch (bool is_return)
+ {
+ return finally_vector == null;
+ }
+
+ public override bool InCatch ()
+ {
+ return !in_try && (finally_vector == null);
+ }
+
+ public override bool InFinally (bool is_return)
+ {
+ return finally_vector != null;
+ }
+
+ public override bool BreakCrossesTryCatchBoundary ()
+ {
+ return true;
+ }
+
+ public override void AddFinallyVector (UsageVector vector)
+ {
+ vector = vector.Clone ();
+ vector.Next = finally_origins;
+ finally_origins = vector;
+ }
+
+ public override void StealFinallyClauses (ref ArrayList list)
+ {
+ if (list == null)
+ list = new ArrayList ();
+ list.Add (stmt);
+ emit_finally = false;
+ base.StealFinallyClauses (ref list);
+ }
+
+ public bool EmitFinally {
+ get { return emit_finally; }
+ }
+
+ public override LabeledStatement LookupLabel (string name, Location loc)
+ {
+ if (current_vector.Block == null)
+ return base.LookupLabel (name, loc);
+
+ LabeledStatement s = current_vector.Block.LookupLabel (name);
+ if (s != null)
+ return s;
+
+ if (finally_vector != null) {
+ Report.Error (
+ 157, loc, "Control can not leave the body " +
+ "of the finally block");
+ return null;
+ }
+
+ return base.LookupLabel (name, loc);
+ }
+
+ public override void Label (UsageVector origin_vectors)
+ {
+ CurrentUsageVector.MergeJumpOrigins (origin_vectors);
+ }
+
+ protected override UsageVector Merge ()
+ {
+ UsageVector vector = Merge (catch_vectors);
+
+ vector.MergeFinally (this, finally_vector, finally_origins);
+
+ return vector;
+ }
+ }
+
+ // <summary>
+ // This is used by the flow analysis code to keep track of the type of local variables
+ // and variables.
+ //
+ // The flow code uses a BitVector to keep track of whether a variable has been assigned
+ // or not. This is easy for fundamental types (int, char etc.) or reference types since
+ // you can only assign the whole variable as such.
+ //
+ // For structs, we also need to keep track of all its fields. To do this, we allocate one
+ // bit for the struct itself (it's used if you assign/access the whole struct) followed by
+ // one bit for each of its fields.
+ //
+ // This class computes this `layout' for each type.
+ // </summary>
+ public class TypeInfo
+ {
+ public readonly Type Type;
+
+ // <summary>
+ // Total number of bits a variable of this type consumes in the flow vector.
+ // </summary>
+ public readonly int TotalLength;
+
+ // <summary>
+ // Number of bits the simple fields of a variable of this type consume
+ // in the flow vector.
+ // </summary>
+ public readonly int Length;
+
+ // <summary>
+ // This is only used by sub-structs.
+ // </summary>
+ public readonly int Offset;
+
+ // <summary>
+ // If this is a struct.
+ // </summary>
+ public readonly bool IsStruct;
+
+ // <summary>
+ // If this is a struct, all fields which are structs theirselves.
+ // </summary>
+ public TypeInfo[] SubStructInfo;
+
+ protected readonly StructInfo struct_info;
+ private static Hashtable type_hash = new Hashtable ();
+
+ public static TypeInfo GetTypeInfo (Type type)
+ {
+ TypeInfo info = (TypeInfo) type_hash [type];
+ if (info != null)
+ return info;
+
+ info = new TypeInfo (type);
+ type_hash.Add (type, info);
+ return info;
+ }
+
+ public static TypeInfo GetTypeInfo (TypeContainer tc)
+ {
+ TypeInfo info = (TypeInfo) type_hash [tc.TypeBuilder];
+ if (info != null)
+ return info;
+
+ info = new TypeInfo (tc);
+ type_hash.Add (tc.TypeBuilder, info);
+ return info;
+ }
+
+ private TypeInfo (Type type)
+ {
+ this.Type = type;
+
+ struct_info = StructInfo.GetStructInfo (type);
+ if (struct_info != null) {
+ Length = struct_info.Length;
+ TotalLength = struct_info.TotalLength;
+ SubStructInfo = struct_info.StructFields;
+ IsStruct = true;
+ } else {
+ Length = 0;
+ TotalLength = 1;
+ IsStruct = false;
+ }
+ }
+
+ private TypeInfo (TypeContainer tc)
+ {
+ this.Type = tc.TypeBuilder;
+
+ struct_info = StructInfo.GetStructInfo (tc);
+ if (struct_info != null) {
+ Length = struct_info.Length;
+ TotalLength = struct_info.TotalLength;
+ SubStructInfo = struct_info.StructFields;
+ IsStruct = true;
+ } else {
+ Length = 0;
+ TotalLength = 1;
+ IsStruct = false;
+ }
+ }
+
+ protected TypeInfo (StructInfo struct_info, int offset)
+ {
+ this.struct_info = struct_info;
+ this.Offset = offset;
+ this.Length = struct_info.Length;
+ this.TotalLength = struct_info.TotalLength;
+ this.SubStructInfo = struct_info.StructFields;
+ this.Type = struct_info.Type;
+ this.IsStruct = true;
+ }
+
+ public int GetFieldIndex (string name)
+ {
+ if (struct_info == null)
+ return 0;
+
+ return struct_info [name];
+ }
+
+ public TypeInfo GetSubStruct (string name)
+ {
+ if (struct_info == null)
+ return null;
+
+ return struct_info.GetStructField (name);
+ }
+
+ // <summary>
+ // A struct's constructor must always assign all fields.
+ // This method checks whether it actually does so.
+ // </summary>
+ public bool IsFullyInitialized (FlowBranching branching, VariableInfo vi, Location loc)
+ {
+ if (struct_info == null)
+ return true;
+
+ bool ok = true;
+ for (int i = 0; i < struct_info.Count; i++) {
+ FieldInfo field = struct_info.Fields [i];
+
+ if (!branching.IsFieldAssigned (vi, field.Name)) {
+ Report.Error (171, loc,
+ "Field `" + TypeManager.CSharpName (Type) +
+ "." + field.Name + "' must be fully initialized " +
+ "before control leaves the constructor");
+ ok = false;
+ }
+ }
+
+ return ok;
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("TypeInfo ({0}:{1}:{2}:{3})",
+ Type, Offset, Length, TotalLength);
+ }
+
+ protected class StructInfo {
+ public readonly Type Type;
+ public readonly FieldInfo[] Fields;
+ public readonly TypeInfo[] StructFields;
+ public readonly int Count;
+ public readonly int CountPublic;
+ public readonly int CountNonPublic;
+ public readonly int Length;
+ public readonly int TotalLength;
+ public readonly bool HasStructFields;
+
+ private static Hashtable field_type_hash = new Hashtable ();
+ private Hashtable struct_field_hash;
+ private Hashtable field_hash;
+
+ protected bool InTransit = false;
+
+ // Private constructor. To save memory usage, we only need to create one instance
+ // of this class per struct type.
+ private StructInfo (Type type)
+ {
+ this.Type = type;
+
+ field_type_hash.Add (type, this);
+
+ if (type is TypeBuilder) {
+ TypeContainer tc = TypeManager.LookupTypeContainer (type);
+
+ ArrayList fields = tc.Fields;
+
+ ArrayList public_fields = new ArrayList ();
+ ArrayList non_public_fields = new ArrayList ();
+
+ if (fields != null) {
+ foreach (Field field in fields) {
+ if ((field.ModFlags & Modifiers.STATIC) != 0)
+ continue;
+ if ((field.ModFlags & Modifiers.PUBLIC) != 0)
+ public_fields.Add (field.FieldBuilder);
+ else
+ non_public_fields.Add (field.FieldBuilder);
+ }
+ }
+
+ CountPublic = public_fields.Count;
+ CountNonPublic = non_public_fields.Count;
+ Count = CountPublic + CountNonPublic;
+
+ Fields = new FieldInfo [Count];
+ public_fields.CopyTo (Fields, 0);
+ non_public_fields.CopyTo (Fields, CountPublic);
+ } else {
+ FieldInfo[] public_fields = type.GetFields (
+ BindingFlags.Instance|BindingFlags.Public);
+ FieldInfo[] non_public_fields = type.GetFields (
+ BindingFlags.Instance|BindingFlags.NonPublic);
+
+ CountPublic = public_fields.Length;
+ CountNonPublic = non_public_fields.Length;
+ Count = CountPublic + CountNonPublic;
+
+ Fields = new FieldInfo [Count];
+ public_fields.CopyTo (Fields, 0);
+ non_public_fields.CopyTo (Fields, CountPublic);
+ }
+
+ struct_field_hash = new Hashtable ();
+ field_hash = new Hashtable ();
+
+ Length = 0;
+ StructFields = new TypeInfo [Count];
+ StructInfo[] sinfo = new StructInfo [Count];
+
+ InTransit = true;
+
+ for (int i = 0; i < Count; i++) {
+ FieldInfo field = (FieldInfo) Fields [i];
+
+ sinfo [i] = GetStructInfo (field.FieldType);
+ if (sinfo [i] == null)
+ field_hash.Add (field.Name, ++Length);
+ else if (sinfo [i].InTransit) {
+ Report.Error (523, String.Format (
+ "Struct member '{0}.{1}' of type '{2}' causes " +
+ "a cycle in the structure layout",
+ type, field.Name, sinfo [i].Type));
+ sinfo [i] = null;
+ return;
+ }
+ }
+
+ InTransit = false;
+
+ TotalLength = Length + 1;
+ for (int i = 0; i < Count; i++) {
+ FieldInfo field = (FieldInfo) Fields [i];
+
+ if (sinfo [i] == null)
+ continue;
+
+ field_hash.Add (field.Name, TotalLength);
+
+ HasStructFields = true;
+ StructFields [i] = new TypeInfo (sinfo [i], TotalLength);
+ struct_field_hash.Add (field.Name, StructFields [i]);
+ TotalLength += sinfo [i].TotalLength;
+ }
+ }
+
+ public int this [string name] {
+ get {
+ if (field_hash.Contains (name))
+ return (int) field_hash [name];
+ else
+ return 0;
+ }
+ }
+
+ public TypeInfo GetStructField (string name)
+ {
+ return (TypeInfo) struct_field_hash [name];
+ }
+
+ public static StructInfo GetStructInfo (Type type)
+ {
+ if (!TypeManager.IsValueType (type) || TypeManager.IsEnumType (type) ||
+ TypeManager.IsBuiltinType (type))
+ return null;
+
+ StructInfo info = (StructInfo) field_type_hash [type];
+ if (info != null)
+ return info;
+
+ return new StructInfo (type);
+ }
+
+ public static StructInfo GetStructInfo (TypeContainer tc)
+ {
+ StructInfo info = (StructInfo) field_type_hash [tc.TypeBuilder];
+ if (info != null)
+ return info;
+
+ return new StructInfo (tc.TypeBuilder);
+ }
+ }
+ }
+
+ // <summary>
+ // This is used by the flow analysis code to store information about a single local variable
+ // or parameter. Depending on the variable's type, we need to allocate one or more elements
+ // in the BitVector - if it's a fundamental or reference type, we just need to know whether
+ // it has been assigned or not, but for structs, we need this information for each of its fields.
+ // </summary>
+ public class VariableInfo {
+ public readonly string Name;
+ public readonly TypeInfo TypeInfo;
+
+ // <summary>
+ // The bit offset of this variable in the flow vector.
+ // </summary>
+ public readonly int Offset;
+
+ // <summary>
+ // The number of bits this variable needs in the flow vector.
+ // The first bit always specifies whether the variable as such has been assigned while
+ // the remaining bits contain this information for each of a struct's fields.
+ // </summary>
+ public readonly int Length;
+
+ // <summary>
+ // If this is a parameter of local variable.
+ // </summary>
+ public readonly bool IsParameter;
+
+ public readonly LocalInfo LocalInfo;
+ public readonly int ParameterIndex;
+
+ readonly VariableInfo Parent;
+ VariableInfo[] sub_info;
+
+ protected VariableInfo (string name, Type type, int offset)
+ {
+ this.Name = name;
+ this.Offset = offset;
+ this.TypeInfo = TypeInfo.GetTypeInfo (type);
+
+ Length = TypeInfo.TotalLength;
+
+ Initialize ();
+ }
+
+ protected VariableInfo (VariableInfo parent, TypeInfo type)
+ {
+ this.Name = parent.Name;
+ this.TypeInfo = type;
+ this.Offset = parent.Offset + type.Offset;
+ this.Parent = parent;
+ this.Length = type.TotalLength;
+
+ this.IsParameter = parent.IsParameter;
+ this.LocalInfo = parent.LocalInfo;
+ this.ParameterIndex = parent.ParameterIndex;
+
+ Initialize ();
+ }
+
+ protected void Initialize ()
+ {
+ TypeInfo[] sub_fields = TypeInfo.SubStructInfo;
+ if (sub_fields != null) {
+ sub_info = new VariableInfo [sub_fields.Length];
+ for (int i = 0; i < sub_fields.Length; i++) {
+ if (sub_fields [i] != null)
+ sub_info [i] = new VariableInfo (this, sub_fields [i]);
+ }
+ } else
+ sub_info = new VariableInfo [0];
+ }
+
+ public VariableInfo (LocalInfo local_info, int offset)
+ : this (local_info.Name, local_info.VariableType, offset)
+ {
+ this.LocalInfo = local_info;
+ this.IsParameter = false;
+ }
+
+ public VariableInfo (string name, Type type, int param_idx, int offset)
+ : this (name, type, offset)
+ {
+ this.ParameterIndex = param_idx;
+ this.IsParameter = true;
+ }
+
+ public bool IsAssigned (EmitContext ec)
+ {
+ return !ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (this);
+ }
+
+ public bool IsAssigned (EmitContext ec, Location loc)
+ {
+ if (IsAssigned (ec))
+ return true;
+
+ Report.Error (165, loc,
+ "Use of unassigned local variable `" + Name + "'");
+ ec.CurrentBranching.SetAssigned (this);
+ return false;
+ }
+
+ public bool IsAssigned (MyBitVector vector)
+ {
+ if (vector [Offset])
+ return true;
+
+ for (VariableInfo parent = Parent; parent != null; parent = parent.Parent)
+ if (vector [parent.Offset])
+ return true;
+
+ // Return unless this is a struct.
+ if (!TypeInfo.IsStruct)
+ return false;
+
+ // Ok, so each field must be assigned.
+ for (int i = 0; i < TypeInfo.Length; i++) {
+ if (!vector [Offset + i + 1])
+ return false;
+ }
+
+ // Ok, now check all fields which are structs.
+ for (int i = 0; i < sub_info.Length; i++) {
+ VariableInfo sinfo = sub_info [i];
+ if (sinfo == null)
+ continue;
+
+ if (!sinfo.IsAssigned (vector))
+ return false;
+ }
+
+ vector [Offset] = true;
+ return true;
+ }
+
+ public void SetAssigned (EmitContext ec)
+ {
+ if (ec.DoFlowAnalysis)
+ ec.CurrentBranching.SetAssigned (this);
+ }
+
+ public void SetAssigned (MyBitVector vector)
+ {
+ vector [Offset] = true;
+ }
+
+ public bool IsFieldAssigned (EmitContext ec, string name, Location loc)
+ {
+ if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsFieldAssigned (this, name))
+ return true;
+
+ Report.Error (170, loc,
+ "Use of possibly unassigned field `" + name + "'");
+ ec.CurrentBranching.SetFieldAssigned (this, name);
+ return false;
+ }
+
+ public bool IsFieldAssigned (MyBitVector vector, string field_name)
+ {
+ int field_idx = TypeInfo.GetFieldIndex (field_name);
+
+ if (field_idx == 0)
+ return true;
+
+ return vector [Offset + field_idx];
+ }
+
+ public void SetFieldAssigned (EmitContext ec, string name)
+ {
+ if (ec.DoFlowAnalysis)
+ ec.CurrentBranching.SetFieldAssigned (this, name);
+ }
+
+ public void SetFieldAssigned (MyBitVector vector, string field_name)
+ {
+ int field_idx = TypeInfo.GetFieldIndex (field_name);
+
+ if (field_idx == 0)
+ return;
+
+ vector [Offset + field_idx] = true;
+ }
+
+ public VariableInfo GetSubStruct (string name)
+ {
+ TypeInfo type = TypeInfo.GetSubStruct (name);
+
+ if (type == null)
+ return null;
+
+ return new VariableInfo (this, type);
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("VariableInfo ({0}:{1}:{2}:{3}:{4})",
+ Name, TypeInfo, Offset, Length, IsParameter);
+ }
+ }
+
+ // <summary>
+ // This is used by the flow code to hold the `layout' of the flow vector for
+ // all locals and all parameters (ie. we create one instance of this class for the
+ // locals and another one for the params).
+ // </summary>
+ public class VariableMap {
+ // <summary>
+ // The number of variables in the map.
+ // </summary>
+ public readonly int Count;
+
+ // <summary>
+ // Total length of the flow vector for this map.
+ // <summary>
+ public readonly int Length;
+
+ VariableInfo[] map;
+
+ public VariableMap (InternalParameters ip)
+ {
+ Count = ip != null ? ip.Count : 0;
+
+ // Dont bother allocating anything!
+ if (Count == 0)
+ return;
+
+ Length = 0;
+
+ for (int i = 0; i < Count; i++) {
+ Parameter.Modifier mod = ip.ParameterModifier (i);
+
+ if ((mod & Parameter.Modifier.OUT) == 0)
+ continue;
+
+ // Dont allocate till we find an out var.
+ if (map == null)
+ map = new VariableInfo [Count];
+
+ map [i] = new VariableInfo (ip.ParameterName (i),
+ TypeManager.GetElementType (ip.ParameterType (i)), i, Length);
+
+ Length += map [i].Length;
+ }
+ }
+
+ public VariableMap (LocalInfo[] locals)
+ : this (null, locals)
+ { }
+
+ public VariableMap (VariableMap parent, LocalInfo[] locals)
+ {
+ int offset = 0, start = 0;
+ if (parent != null && parent.map != null) {
+ offset = parent.Length;
+ start = parent.Count;
+ }
+
+ Count = locals.Length + start;
+
+ if (Count == 0)
+ return;
+
+ map = new VariableInfo [Count];
+ Length = offset;
+
+ if (parent != null && parent.map != null) {
+ parent.map.CopyTo (map, 0);
+ }
+
+ for (int i = start; i < Count; i++) {
+ LocalInfo li = locals [i-start];
+
+ if (li.VariableType == null)
+ continue;
+
+ map [i] = li.VariableInfo = new VariableInfo (li, Length);
+ Length += map [i].Length;
+ }
+ }
+
+ // <summary>
+ // Returns the VariableInfo for variable @index or null if we don't need to
+ // compute assignment info for this variable.
+ // </summary>
+ public VariableInfo this [int index] {
+ get {
+ if (map == null)
+ return null;
+
+ return map [index];
+ }
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("VariableMap ({0}:{1})", Count, Length);
+ }
+ }
+
+ // <summary>
+ // This is a special bit vector which can inherit from another bit vector doing a
+ // copy-on-write strategy. The inherited vector may have a smaller size than the
+ // current one.
+ // </summary>
+ public class MyBitVector {
+ public readonly int Count;
+ public readonly MyBitVector InheritsFrom;
+
+ bool is_dirty;
+ BitArray vector;
+
+ public MyBitVector (int Count)
+ : this (null, Count)
+ { }
+
+ public MyBitVector (MyBitVector InheritsFrom, int Count)
+ {
+ this.InheritsFrom = InheritsFrom;
+ this.Count = Count;
+ }
+
+ // <summary>
+ // Checks whether this bit vector has been modified. After setting this to true,
+ // we won't use the inherited vector anymore, but our own copy of it.
+ // </summary>
+ public bool IsDirty {
+ get {
+ return is_dirty;
+ }
+
+ set {
+ if (!is_dirty)
+ initialize_vector ();
+ }
+ }
+
+ // <summary>
+ // Get/set bit `index' in the bit vector.
+ // </summary>
+ public bool this [int index]
+ {
+ get {
+ if (index > Count)
+ throw new ArgumentOutOfRangeException ();
+
+ // We're doing a "copy-on-write" strategy here; as long
+ // as nobody writes to the array, we can use our parent's
+ // copy instead of duplicating the vector.
+
+ if (vector != null)
+ return vector [index];
+ else if (InheritsFrom != null) {
+ BitArray inherited = InheritsFrom.Vector;
+
+ if (index < inherited.Count)
+ return inherited [index];
+ else
+ return false;
+ } else
+ return false;
+ }
+
+ set {
+ if (index > Count)
+ throw new ArgumentOutOfRangeException ();
+
+ // Only copy the vector if we're actually modifying it.
+
+ if (this [index] != value) {
+ initialize_vector ();
+
+ vector [index] = value;
+ }
+ }
+ }
+
+ // <summary>
+ // If you explicitly convert the MyBitVector to a BitArray, you will get a deep
+ // copy of the bit vector.
+ // </summary>
+ public static explicit operator BitArray (MyBitVector vector)
+ {
+ vector.initialize_vector ();
+ return vector.Vector;
+ }
+
+ // <summary>
+ // Performs an `or' operation on the bit vector. The `new_vector' may have a
+ // different size than the current one.
+ // </summary>
+ public void Or (MyBitVector new_vector)
+ {
+ BitArray new_array = new_vector.Vector;
+
+ initialize_vector ();
+
+ int upper;
+ if (vector.Count < new_array.Count)
+ upper = vector.Count;
+ else
+ upper = new_array.Count;
+
+ for (int i = 0; i < upper; i++)
+ vector [i] = vector [i] | new_array [i];
+ }
+
+ // <summary>
+ // Perfonrms an `and' operation on the bit vector. The `new_vector' may have
+ // a different size than the current one.
+ // </summary>
+ public void And (MyBitVector new_vector)
+ {
+ BitArray new_array = new_vector.Vector;
+
+ initialize_vector ();
+
+ int lower, upper;
+ if (vector.Count < new_array.Count)
+ lower = upper = vector.Count;
+ else {
+ lower = new_array.Count;
+ upper = vector.Count;
+ }
+
+ for (int i = 0; i < lower; i++)
+ vector [i] = vector [i] & new_array [i];
+
+ for (int i = lower; i < upper; i++)
+ vector [i] = false;
+ }
+
+ public static void And (ref MyBitVector target, MyBitVector vector)
+ {
+ if (target != null)
+ target.And (vector);
+ else
+ target = vector.Clone ();
+ }
+
+ public static void Or (ref MyBitVector target, MyBitVector vector)
+ {
+ if (target != null)
+ target.Or (vector);
+ else
+ target = vector.Clone ();
+ }
+
+ // <summary>
+ // This does a deep copy of the bit vector.
+ // </summary>
+ public MyBitVector Clone ()
+ {
+ MyBitVector retval = new MyBitVector (Count);
+
+ retval.Vector = Vector;
+
+ return retval;
+ }
+
+ BitArray Vector {
+ get {
+ if (vector != null)
+ return vector;
+ else if (!is_dirty && (InheritsFrom != null))
+ return InheritsFrom.Vector;
+
+ initialize_vector ();
+
+ return vector;
+ }
+
+ set {
+ initialize_vector ();
+
+ for (int i = 0; i < System.Math.Min (vector.Count, value.Count); i++)
+ vector [i] = value [i];
+ }
+ }
+
+ void initialize_vector ()
+ {
+ if (vector != null)
+ return;
+
+ vector = new BitArray (Count, false);
+ if (InheritsFrom != null)
+ Vector = InheritsFrom.Vector;
+
+ is_dirty = true;
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder sb = new StringBuilder ("{");
+
+ BitArray vector = Vector;
+ if (!IsDirty)
+ sb.Append ("=");
+ for (int i = 0; i < vector.Count; i++) {
+ sb.Append (vector [i] ? "1" : "0");
+ }
+
+ sb.Append ("}");
+ return sb.ToString ();
+ }
+ }
+}
diff --git a/mcs/mcs/gen-treedump.cs b/mcs/mcs/gen-treedump.cs
index 8ad20e812d7..a4dbf328ae9 100755
--- a/mcs/mcs/gen-treedump.cs
+++ b/mcs/mcs/gen-treedump.cs
@@ -448,12 +448,12 @@ namespace Generator {
void GenerateFor (For s)
{
output ("for (");
- if (! (s.InitStatement is EmptyStatement))
+ if (! (s.InitStatement == EmptyStatement.Value))
GenerateStatement (s.InitStatement, true, true, true);
output ("; ");
output (GetExpression (s.Test, 0));
output ("; ");
- if (! (s.Increment is EmptyStatement))
+ if (! (s.Increment == EmptyStatement.Value))
GenerateStatement (s.Increment, true, true, true);
output (") ");
GenerateStatement (s.Statement, true, true, false);
@@ -589,7 +589,7 @@ namespace Generator {
output_newline ("break;");
else if (s is Continue)
output_newline ("continue;");
- else if (s is EmptyStatement)
+ else if (s == EmptyStatement.Value)
output_newline ("/* empty statement */;");
else if (s is Block)
GenerateBlock ((Block) s, doPlacement, embedded);
@@ -898,7 +898,7 @@ namespace Generator {
string ClassName (string name)
{
return name;
- //return name.Substring (1 + name.LastIndexOf ("."));
+ //return name.Substring (1 + name.LastIndexOf ('.'));
}
string GenBases (ArrayList bases)
diff --git a/mcs/mcs/generic.cs b/mcs/mcs/generic.cs
new file mode 100644
index 00000000000..4e66eb6cc66
--- /dev/null
+++ b/mcs/mcs/generic.cs
@@ -0,0 +1,56 @@
+//
+// generic.cs: Support classes for generics
+//
+// Author:
+// Miguel de Icaza (miguel@ximian.com)
+//
+// (C) 2003 Ximian, Inc.
+//
+using System;
+using System.Collections;
+
+namespace Mono.CSharp {
+
+ //
+ // Tracks the constraints for a type parameter
+ //
+ class Constraints {
+ string type_parameter;
+ ArrayList constraints;
+
+ //
+ // type_parameter is the identifier, constraints is an arraylist of
+ // Expressions (with types) or `true' for the constructor constraint.
+ //
+ public Constraints (string type_parameter, ArrayList constraints)
+ {
+ this.type_parameter = type_parameter;
+ this.constraints = constraints;
+ }
+ }
+
+ //
+ // This type represents a generic type parameter reference.
+ //
+ // These expressions are born in a fully resolved state.
+ //
+ public class TypeParameterExpr : TypeExpr {
+ string type_parameter;
+
+ public TypeParameterExpr (string type_parameter, Location l)
+ : base (typeof (object), l)
+ {
+ this.type_parameter = type_parameter;
+ }
+
+ public override string ToString ()
+ {
+ return "TypeParameter[" + type_parameter + "]";
+ }
+
+ public void Error_CannotUseAsUnmanagedType (Location loc)
+ {
+ Report.Error (-203, loc, "Can not use type parameter as unamanged type");
+ }
+ }
+}
diff --git a/mcs/mcs/interface.cs b/mcs/mcs/interface.cs
index 873e6af9d73..0777935f99b 100755
--- a/mcs/mcs/interface.cs
+++ b/mcs/mcs/interface.cs
@@ -7,7 +7,7 @@
//
// (C) 2001 Ximian, Inc (http://www.ximian.com)
//
-
+#define CACHE
using System.Collections;
using System;
using System.IO;
@@ -19,7 +19,7 @@ namespace Mono.CSharp {
/// <summary>
/// Interfaces
/// </summary>
- public class Interface : DeclSpace {
+ public class Interface : DeclSpace, IMemberContainer {
const MethodAttributes interface_method_attributes =
MethodAttributes.Public |
MethodAttributes.Abstract |
@@ -36,6 +36,7 @@ namespace Mono.CSharp {
MethodAttributes.Virtual;
ArrayList bases;
+ Type[] baseTypes;
ArrayList defined_method;
ArrayList defined_indexer;
@@ -44,8 +45,15 @@ namespace Mono.CSharp {
ArrayList method_builders;
ArrayList property_builders;
+ ArrayList event_builders;
- Attributes OptAttributes;
+
+ public string IndexerName;
+
+ IMemberContainer parent_container;
+ MemberCache member_cache;
+
+ bool members_defined;
// These will happen after the semantic analysis
@@ -63,14 +71,15 @@ namespace Mono.CSharp {
Modifiers.UNSAFE |
Modifiers.PRIVATE;
- public Interface (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
- : base (parent, name, l)
+ public Interface (NamespaceEntry ns, TypeContainer parent, string name, int mod,
+ Attributes attrs, Location l)
+ : base (ns, parent, name, attrs, l)
{
ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
- OptAttributes = attrs;
method_builders = new ArrayList ();
property_builders = new ArrayList ();
+ event_builders = new ArrayList ();
}
public AdditionResult AddMethod (InterfaceMethod imethod)
@@ -98,7 +107,7 @@ namespace Mono.CSharp {
AdditionResult res;
string name = iprop.Name;
- if ((res = IsValid (name)) != AdditionResult.Success)
+ if ((res = IsValid (name, name)) != AdditionResult.Success)
return res;
DefineName (name, iprop);
@@ -115,7 +124,7 @@ namespace Mono.CSharp {
string name = ievent.Name;
AdditionResult res;
- if ((res = IsValid (name)) != AdditionResult.Success)
+ if ((res = IsValid (name, name)) != AdditionResult.Success)
return res;
DefineName (name, ievent);
@@ -221,9 +230,22 @@ namespace Mono.CSharp {
return true;
}
- public MethodInfo [] GetMethods ()
+ //
+ // This might trigger a definition of the methods. This happens only
+ // with Attributes, as Attribute classes are processed before interfaces.
+ // Ideally, we should make everything just define recursively in terms
+ // of its dependencies.
+ //
+ public MethodInfo [] GetMethods (TypeContainer container)
{
- int n = method_builders.Count;
+ int n = 0;
+
+ if (!members_defined){
+ if (DefineMembers (container))
+ n = method_builders.Count;
+ } else
+ n = method_builders.Count;
+
MethodInfo [] mi = new MethodInfo [n];
method_builders.CopyTo (mi, 0);
@@ -232,7 +254,8 @@ namespace Mono.CSharp {
}
// Hack around System.Reflection as found everywhere else
- public MemberInfo [] FindMembers (MemberTypes mt, BindingFlags bf, MemberFilter filter, object criteria)
+ public override MemberList FindMembers (MemberTypes mt, BindingFlags bf,
+ MemberFilter filter, object criteria)
{
ArrayList members = new ArrayList ();
@@ -248,27 +271,25 @@ namespace Mono.CSharp {
members.Add (pb);
}
- if (((bf & BindingFlags.DeclaredOnly) == 0) && (TypeBuilder.BaseType != null)) {
- MemberInfo [] parent_mi;
-
- parent_mi = TypeContainer.FindMembers (
- TypeBuilder.BaseType, mt, bf, filter, criteria);
+ if ((mt & MemberTypes.Event) != 0) {
+ foreach (MyEventBuilder eb in event_builders)
+ if (filter (eb, criteria))
+ members.Add (eb);
+ }
- if (parent_mi != null)
- members.AddRange (parent_mi);
+ if (((bf & BindingFlags.DeclaredOnly) == 0) && (baseTypes != null)) {
+ foreach (Type baseType in baseTypes) {
+ members.AddRange (TypeContainer.FindMembers (baseType, mt, bf, filter, criteria));
+ }
}
-
- // The rest of the cases, if any, are unhandled at present.
- int count = members.Count;
+ return new MemberList (members);
+ }
- if (count > 0) {
- MemberInfo [] mi = new MemberInfo [count];
- members.CopyTo (mi, 0);
- return mi;
+ public override MemberCache MemberCache {
+ get {
+ return member_cache;
}
-
- return null;
}
//
@@ -276,16 +297,23 @@ namespace Mono.CSharp {
//
void PopulateMethod (TypeContainer parent, DeclSpace decl_space, InterfaceMethod im)
{
- Type return_type = RootContext.LookupType (this, im.ReturnType, false, im.Location);
+ if (im.ReturnType == null)
+ return;
+
+ Type return_type = im.ReturnType.Type;
+ if (return_type == null)
+ return_type = this.ResolveType (im.ReturnType, false, im.Location);
+
Type [] arg_types = im.ParameterTypes (this);
MethodBuilder mb;
- Parameter [] p;
- int i;
if (return_type == null)
return;
- if (return_type.IsPointer && !UnsafeOK (this))
+ if (return_type.IsPointer && !im.UnsafeOK (this))
+ return;
+
+ if (arg_types == null)
return;
foreach (Type t in arg_types){
@@ -293,7 +321,7 @@ namespace Mono.CSharp {
if (t == null)
return;
- if (t.IsPointer && !UnsafeOK (this))
+ if (t.IsPointer && !im.UnsafeOK (this))
return;
}
@@ -305,31 +333,22 @@ namespace Mono.CSharp {
return_type, arg_types);
InternalParameters ip = new InternalParameters (arg_types, im.Parameters);
-
+
if (!RegisterMethod (mb, ip, arg_types)) {
Error111 (im);
return;
}
- //
- // Define each type attribute (in/out/ref) and
- // the argument names.
- //
- p = im.Parameters.FixedParameters;
- if (p != null){
- for (i = 0; i < p.Length; i++)
- mb.DefineParameter (i + 1, p [i].Attributes, p [i].Name);
-
- if (i != arg_types.Length)
- Console.WriteLine ("Implement the type definition for params");
- }
-
- EmitContext ec = new EmitContext (parent, decl_space, Location, null,
- return_type, ModFlags, false);
-
- if (im.OptAttributes != null)
- Attribute.ApplyAttributes (ec, mb, im, im.OptAttributes, Location);
- }
+ //
+ // Labelling of parameters is taken care of
+ // during the Emit phase via
+ // MethodCore.LabelParameters method so I am
+ // removing the old code here.
+ //
+
+ im.SetBuilder (mb);
+
+ }
//
// Populates the properties in the interface
@@ -337,14 +356,18 @@ namespace Mono.CSharp {
void PopulateProperty (TypeContainer parent, DeclSpace decl_space, InterfaceProperty ip)
{
PropertyBuilder pb;
- MethodBuilder get = null, set = null;
- Type prop_type = RootContext.LookupType (this, ip.Type, false, ip.Location);
+
+ ip.ReturnType = this.ResolveTypeExpr (ip.ReturnType, false, ip.Location);
+ if (ip.ReturnType == null)
+ return;
+
+ Type prop_type = ip.ReturnType.Type;
Type [] setter_args = new Type [1];
if (prop_type == null)
return;
- if (prop_type.IsPointer && !UnsafeOK (this))
+ if (prop_type.IsPointer && !ip.UnsafeOK (this))
return;
setter_args [0] = prop_type;
@@ -357,6 +380,8 @@ namespace Mono.CSharp {
ip.Name, PropertyAttributes.None,
prop_type, null);
+ MethodBuilder get = null, set = null;
+
if (ip.HasGet){
get = TypeBuilder.DefineMethod (
"get_" + ip.Name, property_attributes ,
@@ -367,7 +392,7 @@ namespace Mono.CSharp {
//
Type [] null_types = null;
InternalParameters inp = new InternalParameters
- (null_types, Parameters.GetEmptyReadOnlyParameters ());
+ (null_types, Parameters.EmptyReadOnlyParameters);
if (!RegisterMethod (get, inp, null)) {
Error111 (ip);
@@ -391,7 +416,7 @@ namespace Mono.CSharp {
// HACK because System.Reflection.Emit is lame
//
Parameter [] parms = new Parameter [1];
- parms [0] = new Parameter (ip.Type, "value", Parameter.Modifier.NONE, null);
+ parms [0] = new Parameter (ip.ReturnType, "value", Parameter.Modifier.NONE, null);
InternalParameters ipp = new InternalParameters (
this, new Parameters (parms, null, Location.Null));
@@ -401,14 +426,9 @@ namespace Mono.CSharp {
}
}
- EmitContext ec = new EmitContext (parent, decl_space, Location, null,
- null, ModFlags, false);
-
- if (ip.OptAttributes != null)
- Attribute.ApplyAttributes (ec, pb, ip, ip.OptAttributes, Location);
-
TypeManager.RegisterProperty (pb, get, set);
property_builders.Add (pb);
+ ip.SetBuilders (pb, get, set);
}
//
@@ -420,6 +440,61 @@ namespace Mono.CSharp {
// FIXME: We need to do this after delegates have been
// declared or we declare them recursively.
//
+ MyEventBuilder eb;
+ MethodBuilder add = null, remove = null;
+ ie.ReturnType = this.ResolveTypeExpr (ie.ReturnType, false, ie.Location);
+ if (ie.ReturnType == null)
+ return;
+
+ Type event_type = ie.ReturnType.Type;
+
+ if (event_type == null)
+ return;
+
+ if (event_type.IsPointer && !ie.UnsafeOK (this))
+ return;
+
+ Type [] parameters = new Type [1];
+ parameters [0] = event_type;
+
+ eb = new MyEventBuilder (null, TypeBuilder, ie.Name,
+ EventAttributes.None, event_type);
+
+ //
+ // Now define the accessors
+ //
+ string add_name = "add_" + ie.Name;
+
+ add = TypeBuilder.DefineMethod (
+ add_name, property_attributes, null, parameters);
+ add.DefineParameter (1, ParameterAttributes.None, "value");
+ eb.SetAddOnMethod (add);
+
+ string remove_name = "remove_" + ie.Name;
+ remove = TypeBuilder.DefineMethod (
+ remove_name, property_attributes, null, parameters);
+ remove.DefineParameter (1, ParameterAttributes.None, "value");
+ eb.SetRemoveOnMethod (remove);
+
+ Parameter [] parms = new Parameter [1];
+ parms [0] = new Parameter (ie.ReturnType, "value", Parameter.Modifier.NONE, null);
+ InternalParameters ip = new InternalParameters (
+ this, new Parameters (parms, null, Location.Null));
+
+ if (!RegisterMethod (add, ip, parameters)) {
+ Error111 (ie);
+ return;
+ }
+
+ if (!RegisterMethod (remove, ip, parameters)) {
+ Error111 (ie);
+ return;
+ }
+
+ TypeManager.RegisterEvent (eb, add, remove);
+ event_builders.Add (eb);
+
+ ie.SetBuilder (eb);
}
//
@@ -428,14 +503,18 @@ namespace Mono.CSharp {
void PopulateIndexer (TypeContainer parent, DeclSpace decl_space, InterfaceIndexer ii)
{
PropertyBuilder pb;
- Type prop_type = RootContext.LookupType (this, ii.Type, false, ii.Location);
+ ii.ReturnType = this.ResolveTypeExpr (ii.ReturnType, false, ii.Location);
+ if (ii ==null || ii.ReturnType == null)
+ return;
+
+ Type prop_type = ii.ReturnType.Type;
Type [] arg_types = ii.ParameterTypes (this);
Type [] value_arg_types;
if (prop_type == null)
return;
- if (prop_type.IsPointer && !UnsafeOK (this))
+ if (prop_type.IsPointer && !ii.UnsafeOK (this))
return;
//
@@ -449,7 +528,7 @@ namespace Mono.CSharp {
value_arg_types [count] = prop_type;
foreach (Type t in arg_types){
- if (t.IsPointer && !UnsafeOK (this))
+ if (t.IsPointer && !ii.UnsafeOK (this))
return;
}
} else {
@@ -458,8 +537,15 @@ namespace Mono.CSharp {
value_arg_types [1] = prop_type;
}
+ EmitContext ec = new EmitContext (parent, decl_space, Location, null,
+ null, ModFlags, false);
+
+ IndexerName = Attribute.ScanForIndexerName (ec, ii.OptAttributes);
+ if (IndexerName == null)
+ IndexerName = "Item";
+
pb = TypeBuilder.DefineProperty (
- "Item", PropertyAttributes.None,
+ IndexerName, PropertyAttributes.None,
prop_type, arg_types);
MethodBuilder set_item = null, get_item = null;
@@ -467,7 +553,8 @@ namespace Mono.CSharp {
Parameter [] p = ii.Parameters.FixedParameters;
get_item = TypeBuilder.DefineMethod (
- "get_Item", property_attributes, prop_type, arg_types);
+ "get_" + IndexerName, property_attributes,
+ prop_type, arg_types);
pb.SetGetMethod (get_item);
//
// HACK because System.Reflection.Emit is lame
@@ -495,12 +582,12 @@ namespace Mono.CSharp {
pv = new Parameter [p.Length + 1];
p.CopyTo (pv, 0);
- pv [p.Length] = new Parameter (ii.Type, "value", Parameter.Modifier.NONE, null);
+ pv [p.Length] = new Parameter (ii.ReturnType, "value", Parameter.Modifier.NONE, null);
Parameters value_params = new Parameters (pv, null, Location.Null);
value_params.GetParameterInfo (decl_space);
set_item = TypeBuilder.DefineMethod (
- "set_Item", property_attributes,
+ "set_" + IndexerName, property_attributes,
TypeManager.void_type, value_arg_types);
pb.SetSetMethod (set_item);
//
@@ -523,13 +610,9 @@ namespace Mono.CSharp {
set_item.DefineParameter (i + 1, ParameterAttributes.None, "value");
}
- EmitContext ec = new EmitContext (parent, decl_space, Location, null,
- null, ModFlags, false);
-
- if (ii.OptAttributes != null)
- Attribute.ApplyAttributes (ec, pb, ii, ii.OptAttributes, Location);
-
property_builders.Add (pb);
+
+ ii.SetBuilders (pb, get_item, set_item);
}
/// <summary>
@@ -564,15 +647,18 @@ namespace Mono.CSharp {
return true;
}
- Type GetInterfaceTypeByName (string name)
+ TypeExpr GetInterfaceTypeByName (string name)
{
- Type t = FindType (name);
+ Type t = FindType (Location, name);
- if (t == null)
+ if (t == null) {
+ Report.Error (246, Location, "The type or namespace `" + name +
+ "' could not be found");
return null;
+ }
if (t.IsInterface)
- return t;
+ return new TypeExpression (t, Location);
string cause;
@@ -595,27 +681,33 @@ namespace Mono.CSharp {
//
// Sets the error boolean accoringly.
//
- Type [] GetInterfaceBases (out bool error)
+ TypeExpr [] GetInterfaceBases (out bool error)
{
- Type [] tbases;
+ TypeExpr [] tbases;
int i;
error = false;
if (Bases == null)
return null;
- tbases = new Type [Bases.Count];
+ tbases = new TypeExpr [Bases.Count];
i = 0;
foreach (string name in Bases){
- Type t;
+ TypeExpr t;
t = GetInterfaceTypeByName (name);
if (t == null){
error = true;
return null;
}
-
+
+ if (!t.AsAccessible (Parent, ModFlags))
+ Report.Error (61, Location,
+ "Inconsistent accessibility: base interface `" +
+ t.Name + "' is less accessible than interface `" +
+ Name + "'");
+
tbases [i++] = t;
}
@@ -634,7 +726,7 @@ namespace Mono.CSharp {
public override TypeBuilder DefineType ()
{
- Type [] ifaces;
+ TypeExpr [] ifaces;
bool error;
if (TypeBuilder != null)
@@ -645,19 +737,25 @@ namespace Mono.CSharp {
InTransit = true;
+ EmitContext ec = new EmitContext (this, this, Location, null, null,
+ ModFlags, false);
+
ifaces = GetInterfaceBases (out error);
if (error)
return null;
if (IsTopLevel) {
- ModuleBuilder builder = CodeGen.ModuleBuilder;
+ if (TypeManager.NamespaceClash (Name, Location))
+ return null;
+
+ ModuleBuilder builder = CodeGen.Module.Builder;
TypeBuilder = builder.DefineType (
Name,
InterfaceAttr,
(Type)null, // Parent Type
- ifaces);
+ null);
RootContext.RegisterOrder (this);
} else {
TypeBuilder builder = Parent.TypeBuilder;
@@ -666,26 +764,73 @@ namespace Mono.CSharp {
Basename,
InterfaceAttr,
(Type) null, //parent type
- ifaces);
+ null);
TypeContainer tc = TypeManager.LookupTypeContainer (builder);
tc.RegisterOrder (this);
}
+ if (ifaces != null) {
+ baseTypes = new Type[ifaces.Length];
+ for (int i = 0; i < ifaces.Length; ++i) {
+ Type itype = ifaces [i].ResolveType (ec);
+ TypeBuilder.AddInterfaceImplementation (itype);
+ baseTypes [i] = itype;
+ }
+ }
+
TypeManager.AddUserInterface (Name, TypeBuilder, this, ifaces);
InTransit = false;
-
+
return TypeBuilder;
}
+
+ //
+ // Defines the indexers, and also verifies that the IndexerNameAttribute in the
+ // interface is consistent. Either it is `Item' or it is the name defined by all the
+ // indexers with the `IndexerName' attribute.
+ //
+ // Turns out that the IndexerNameAttribute is applied to each indexer,
+ // but it is never emitted, instead a DefaultName attribute is attached
+ // to the interface
+ //
+ void DefineIndexers (TypeContainer parent)
+ {
+ string interface_indexer_name = null;
+
+ foreach (InterfaceIndexer ii in defined_indexer){
+
+ PopulateIndexer (parent, this, ii);
+
+ if (interface_indexer_name == null){
+ interface_indexer_name = IndexerName;
+ continue;
+ }
+
+ if (IndexerName == interface_indexer_name)
+ continue;
+
+ Report.Error (
+ 668, "Two indexers have different names, " +
+ " you should use the same name for all your indexers");
+ }
+ if (interface_indexer_name == null)
+ interface_indexer_name = "Item";
+ IndexerName = interface_indexer_name;
+ }
/// <summary>
/// Performs semantic analysis, and then generates the IL interfaces
/// </summary>
- public override bool Define (TypeContainer parent)
+ public override bool DefineMembers (TypeContainer parent)
{
+ if (members_defined)
+ return true;
+
if (!SemanticAnalysis ())
return false;
+
if (defined_method != null){
foreach (InterfaceMethod im in defined_method)
PopulateMethod (parent, this, im);
@@ -700,22 +845,60 @@ namespace Mono.CSharp {
foreach (InterfaceEvent ie in defined_events)
PopulateEvent (parent, this, ie);
- //
- // FIXME: Pull the right indexer name out of the `IndexerName' attribute
- //
if (defined_indexer != null) {
- foreach (InterfaceIndexer ii in defined_indexer)
- PopulateIndexer (parent, this, ii);
+ DefineIndexers (parent);
CustomAttributeBuilder cb = EmitDefaultMemberAttr (
- parent, "Item", ModFlags, Location);
+ parent, IndexerName, ModFlags, Location);
if (cb != null)
TypeBuilder.SetCustomAttribute (cb);
}
-
+
+#if CACHE
+ if (TypeBuilder.BaseType != null)
+ parent_container = TypeManager.LookupMemberContainer (TypeBuilder.BaseType);
+
+ member_cache = new MemberCache (this);
+#endif
+ members_defined = true;
+ return true;
+ }
+
+
+ //
+ // In the case of Interfaces, there is nothing to do here
+ //
+ public override bool Define (TypeContainer parent)
+ {
return true;
}
+ /// <summary>
+ /// Applies all the attributes.
+ /// </summary>
+ public void Emit (TypeContainer tc) {
+ if (OptAttributes != null) {
+ EmitContext ec = new EmitContext (tc, this, Location, null, null, ModFlags, false);
+ Attribute.ApplyAttributes (ec, TypeBuilder, this, OptAttributes);
+ }
+
+ EmitSubType (tc, defined_method);
+ EmitSubType (tc, defined_properties);
+ EmitSubType (tc, defined_indexer);
+ EmitSubType (tc, defined_events);
+ }
+
+ void EmitSubType (TypeContainer tc, ArrayList subType) {
+ if (subType == null)
+ return;
+
+ foreach (InterfaceMemberBase imb in subType) {
+ //TODO: set it somewhere earlier
+ imb.ModFlags = ModFlags;
+ imb.Emit (tc, this);
+ }
+ }
+
public static CustomAttributeBuilder EmitDefaultMemberAttr (TypeContainer parent,
string name,
int flags,
@@ -728,11 +911,6 @@ namespace Mono.CSharp {
BindingFlags.Public | BindingFlags.Instance,
Location.Null);
- if (!(ml is MethodGroupExpr)) {
- Console.WriteLine ("Internal error !!!!");
- return null;
- }
-
MethodGroupExpr mg = (MethodGroupExpr) ml;
MethodBase constructor = mg.Methods [0];
@@ -749,62 +927,204 @@ namespace Mono.CSharp {
return cb;
}
- }
+ //
+ // IMemberContainer
+ //
- public class InterfaceMemberBase {
- public readonly string Name;
- public readonly bool IsNew;
- public Attributes OptAttributes;
-
- public InterfaceMemberBase (string name, bool is_new, Attributes attrs)
+ string IMemberContainer.Name {
+ get {
+ return Name;
+ }
+ }
+
+ Type IMemberContainer.Type {
+ get {
+ return TypeBuilder;
+ }
+ }
+
+ IMemberContainer IMemberContainer.Parent {
+ get {
+ return parent_container;
+ }
+ }
+
+ MemberCache IMemberContainer.MemberCache {
+ get {
+ return member_cache;
+ }
+ }
+
+ bool IMemberContainer.IsInterface {
+ get {
+ return true;
+ }
+ }
+
+ MemberList IMemberContainer.GetMembers (MemberTypes mt, BindingFlags bf)
{
- Name = name;
- IsNew = is_new;
- OptAttributes = attrs;
+ // Interfaces only contain instance members.
+ if ((bf & BindingFlags.Instance) == 0)
+ return MemberList.Empty;
+ if ((bf & BindingFlags.Public) == 0)
+ return MemberList.Empty;
+
+ ArrayList members = new ArrayList ();
+
+ if ((mt & MemberTypes.Method) != 0)
+ members.AddRange (method_builders);
+
+ if ((mt & MemberTypes.Property) != 0)
+ members.AddRange (property_builders);
+
+ if ((mt & MemberTypes.Event) != 0)
+ members.AddRange (event_builders);
+
+ return new MemberList (members);
}
}
+
+ public abstract class InterfaceMemberBase: MemberCore, IAttributeSupport {
+ // Why is not readonly
+ public Expression ReturnType;
+
+ public InterfaceMemberBase (Expression type, string name, int mod_flags, Attributes attrs, Location loc):
+ base (name, attrs, loc)
+ {
+ ReturnType = type;
+ ModFlags = mod_flags;
+ }
+
+ public virtual EmitContext Emit (TypeContainer tc, DeclSpace ds) {
+ EmitContext ec = null;
+ if (OptAttributes != null) {
+ ec = new EmitContext (tc, ds, Location, null, null, ModFlags, false);
+
+ Attribute.ApplyAttributes (ec, null, this, OptAttributes);
+ }
+
+ return ec;
+ }
+
+ #region IAttributeSupport Members
+ public abstract void SetCustomAttribute (CustomAttributeBuilder customBuilder);
+ #endregion
- public class InterfaceProperty : InterfaceMemberBase {
+ public override bool Define (TypeContainer parent) {
+ throw new NotImplementedException ();
+ }
+ }
+
+ abstract public class InterfaceSetGetBase: InterfaceMemberBase
+ {
+ internal sealed class PropertyAccessor: IAttributeSupport
+ {
+ Attributes m_attrs;
+ MethodBuilder m_builder;
+
+ public PropertyAccessor (Attributes attrs) {
+ m_attrs = attrs;
+ }
+
+ public MethodBuilder Builder {
+ set {
+ m_builder = value;
+ }
+ }
+
+ public void Emit (EmitContext ec) {
+ if (m_attrs != null) {
+ Attribute.ApplyAttributes (ec, this, this, m_attrs);
+ }
+ }
+
+ public void SetCustomAttribute (CustomAttributeBuilder customAttribute) {
+ m_builder.SetCustomAttribute (customAttribute);
+ }
+ }
+
+
+ PropertyAccessor m_get;
+ PropertyAccessor m_set;
+ protected PropertyBuilder Builder;
+
public readonly bool HasSet;
public readonly bool HasGet;
- public readonly string Type;
- public readonly string type;
- public readonly Location Location;
- public InterfaceProperty (string type, string name,
- bool is_new, bool has_get, bool has_set,
- Attributes attrs, Location loc)
- : base (name, is_new, attrs)
+ public InterfaceSetGetBase (Expression type, string name, int modflags,
+ bool has_get, bool has_set, Attributes prop_attrs, Attributes get_attrs,
+ Attributes set_attrs, Location loc)
+ :base (type, name, modflags, prop_attrs, loc)
{
- Type = type;
HasGet = has_get;
HasSet = has_set;
- Location = loc;
+ m_get = new PropertyAccessor (get_attrs);
+ m_set = new PropertyAccessor (set_attrs);
+ }
+
+ public override EmitContext Emit (TypeContainer tc, DeclSpace ds) {
+ EmitContext ec = base.Emit (tc, ds);
+ if (ec == null)
+ ec = new EmitContext (tc, ds, Location, null, null, ModFlags, false);
+
+ m_get.Emit (ec);
+ m_set.Emit (ec);
+ return ec;
}
+
+ // TODO: It would be nice to have this method private
+ public void SetBuilders (PropertyBuilder pb, MethodBuilder gb, MethodBuilder sb) {
+ Builder = pb;
+ m_get.Builder = gb;
+ m_set.Builder = sb;
+ }
+
+ public override void SetCustomAttribute (CustomAttributeBuilder customBuilder) {
+ Builder.SetCustomAttribute (customBuilder);
+ }
+
}
public class InterfaceEvent : InterfaceMemberBase {
- public readonly string Type;
-
- public InterfaceEvent (string type, string name, bool is_new, Attributes attrs)
- : base (name, is_new, attrs)
+ MyEventBuilder Builder;
+
+ public InterfaceEvent (Expression type, string name, int mod_flags, Attributes attrs,
+ Location loc)
+ : base (type, name, mod_flags, attrs, loc)
{
- Type = type;
+ }
+
+ public override string GetSignatureForError () {
+ return TypeManager.GetFullNameSignature (Builder);
+ }
+
+ public void SetBuilder (MyEventBuilder eb) {
+ Builder = eb;
+ }
+
+ public override void SetCustomAttribute (CustomAttributeBuilder customBuilder) {
+ Builder.SetCustomAttribute (customBuilder);
}
}
public class InterfaceMethod : InterfaceMemberBase {
- public readonly string ReturnType;
public readonly Parameters Parameters;
- public readonly Location Location;
-
- public InterfaceMethod (string return_type, string name, bool is_new, Parameters args,
+ MethodBuilder Builder;
+
+ public InterfaceMethod (Expression return_type, string name, int mod_flags, Parameters args,
Attributes attrs, Location l)
- : base (name, is_new, attrs)
+ : base (return_type, name, mod_flags, attrs, l)
{
- this.ReturnType = return_type;
this.Parameters = args;
- Location = l;
+ }
+
+ public override EmitContext Emit(TypeContainer tc, DeclSpace ds) {
+ EmitContext ec = base.Emit(tc, ds);
+ if (ec == null)
+ ec = new EmitContext (tc, ds, Location, null, null, ModFlags, false);
+
+ MethodCore.LabelParameters (ec, Builder, Parameters, OptAttributes, Location);
+ return ec;
}
/// <summary>
@@ -812,40 +1132,69 @@ namespace Mono.CSharp {
/// </summary>
public string GetSignature (DeclSpace ds)
{
- Type ret = RootContext.LookupType (ds, ReturnType, false, Location);
+ ReturnType = ds.ResolveTypeExpr (ReturnType, false, Location);
+ if (ReturnType == null)
+ return null;
+
+ Type ret = ReturnType.Type;
string args = Parameters.GetSignature (ds);
if ((ret == null) || (args == null))
return null;
- return (IsNew ? "new-" : "") + ret.FullName + "(" + args + ")";
+ return ModFlags + ret.FullName + "(" + args + ")";
+ }
+
+ public override string GetSignatureForError ()
+ {
+ return TypeManager.CSharpSignature (Builder);
}
public Type [] ParameterTypes (DeclSpace ds)
{
return Parameters.GetParameterInfo (ds);
}
+
+ public void SetBuilder (MethodBuilder mb) {
+ Builder = mb;
+ }
+
+ public override void SetCustomAttribute(CustomAttributeBuilder customBuilder) {
+ Builder.SetCustomAttribute (customBuilder);
+ }
}
- public class InterfaceIndexer : InterfaceMemberBase {
- public readonly bool HasGet, HasSet;
+ public class InterfaceProperty : InterfaceSetGetBase
+ {
+ public InterfaceProperty (Expression type, string name,
+ int mod_flags, bool has_get, bool has_set,
+ Attributes prop_attrs, Attributes get_attrs,
+ Attributes set_attrs, Location loc)
+ : base (type, name, mod_flags, has_get, has_set, prop_attrs, get_attrs, set_attrs, loc)
+ {
+ }
+
+ public override string GetSignatureForError () {
+ return TypeManager.CSharpSignature (Builder, false);
+ }
+ }
+
+ public class InterfaceIndexer : InterfaceSetGetBase {
public readonly Parameters Parameters;
- public readonly string Type;
- public readonly Location Location;
-
- public InterfaceIndexer (string type, Parameters args, bool do_get, bool do_set,
- bool is_new, Attributes attrs, Location loc)
- : base ("", is_new, attrs)
+
+ public InterfaceIndexer (Expression type, Parameters args, bool do_get, bool do_set,
+ int mod_flags, Attributes attrs, Attributes get_attrs, Attributes set_attrs,
+ Location loc)
+ : base (type, "Item", mod_flags, do_get, do_set, attrs, get_attrs, set_attrs, loc)
{
- Type = type;
Parameters = args;
- HasGet = do_get;
- HasSet = do_set;
- Location = loc;
}
- public Type [] ParameterTypes (DeclSpace ds)
- {
+ public override string GetSignatureForError() {
+ return TypeManager.CSharpSignature (Builder, true);
+ }
+
+ public Type [] ParameterTypes (DeclSpace ds) {
return Parameters.GetParameterInfo (ds);
}
}
diff --git a/mcs/mcs/iterators.cs b/mcs/mcs/iterators.cs
new file mode 100644
index 00000000000..06c92a90c71
--- /dev/null
+++ b/mcs/mcs/iterators.cs
@@ -0,0 +1,906 @@
+//
+// iterators.cs: Support for implementing iterators
+//
+// Author:
+// Miguel de Icaza (miguel@ximian.com)
+//
+// (C) 2003 Ximian, Inc.
+//
+// TODO:
+// Flow analysis for Yield.
+// Emit calls to parent object constructor.
+//
+// Generics note:
+// Current should be defined to return T, and IEnumerator.Current returns object
+//
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+
+namespace Mono.CSharp {
+
+ public interface IIteratorContainer {
+
+ //
+ // Invoked if a yield statement is found in the body
+ //
+ void SetYields ();
+ }
+
+ public class Yield : Statement {
+ public Expression expr;
+ ArrayList finally_blocks;
+
+ public Yield (Expression expr, Location l)
+ {
+ this.expr = expr;
+ loc = l;
+ }
+
+ public static bool CheckContext (EmitContext ec, Location loc)
+ {
+ if (ec.CurrentBranching.InFinally (true)){
+ Report.Error (1625, loc, "Cannot yield in the body of a " +
+ "finally clause");
+ return false;
+ }
+ if (ec.CurrentBranching.InCatch ()){
+ Report.Error (1631, loc, "Cannot yield in the body of a " +
+ "catch clause");
+ return false;
+ }
+ if (ec.CurrentAnonymousMethod != null){
+ Report.Error (1621, loc, "yield statement can not appear inside an anonymoud method");
+ return false;
+ }
+
+ //
+ // FIXME: Missing check for Yield inside try block that contains catch clauses
+ //
+ return true;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ expr = expr.Resolve (ec);
+ if (expr == null)
+ return false;
+ if (!CheckContext (ec, loc))
+ return false;
+
+ Iterator iterator = ec.CurrentIterator;
+ if (expr.Type != iterator.IteratorType){
+ expr = Convert.ImplicitConversionRequired (
+ ec, expr, iterator.IteratorType, loc);
+ if (expr == null)
+ return false;
+ }
+
+ ec.CurrentBranching.StealFinallyClauses (ref finally_blocks);
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ ec.CurrentIterator.MarkYield (ec, expr, finally_blocks);
+ }
+ }
+
+ public class YieldBreak : Statement {
+
+ public YieldBreak (Location l)
+ {
+ loc = l;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ if (!Yield.CheckContext (ec, loc))
+ return false;
+
+ ec.CurrentBranching.CurrentUsageVector.Goto ();
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ ec.CurrentIterator.EmitYieldBreak (ec.ig);
+ }
+ }
+
+ public class Iterator : Class {
+ ToplevelBlock original_block;
+ ToplevelBlock block;
+ string original_name;
+
+ Type iterator_type;
+ TypeExpr iterator_type_expr;
+ bool is_enumerable;
+ bool is_static;
+
+ Hashtable fields;
+
+ //
+ // The state as we generate the iterator
+ //
+ Label move_next_ok, move_next_error;
+ ArrayList resume_points = new ArrayList ();
+ int pc;
+
+ //
+ // Context from the original method
+ //
+ TypeContainer container;
+ Type return_type;
+ Type [] param_types;
+ InternalParameters parameters;
+
+ protected enum State {
+ Uninitialized = -2,
+ After,
+ Running
+ }
+
+ static int proxy_count;
+
+ public void EmitYieldBreak (ILGenerator ig)
+ {
+ ig.Emit (OpCodes.Ldarg_0);
+ IntConstant.EmitInt (ig, (int) State.After);
+ ig.Emit (OpCodes.Stfld, pc_field.FieldBuilder);
+ ig.Emit (OpCodes.Br, move_next_error);
+ }
+
+ public void EmitMoveNext (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ move_next_ok = ig.DefineLabel ();
+ move_next_error = ig.DefineLabel ();
+
+ LocalBuilder retval = ec.GetTemporaryLocal (TypeManager.int32_type);
+
+ ig.BeginExceptionBlock ();
+
+ Label dispatcher = ig.DefineLabel ();
+ ig.Emit (OpCodes.Br, dispatcher);
+
+ ResumePoint entry_point = new ResumePoint (null);
+ resume_points.Add (entry_point);
+ entry_point.Define (ig);
+
+ ec.EmitTopBlock (original_block, parameters, Location);
+ EmitYieldBreak (ig);
+
+ ig.MarkLabel (dispatcher);
+
+ Label [] labels = new Label [resume_points.Count];
+ for (int i = 0; i < labels.Length; i++)
+ labels [i] = ((ResumePoint) resume_points [i]).Label;
+
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Ldfld, pc_field.FieldBuilder);
+ ig.Emit (OpCodes.Switch, labels);
+
+ Label end = ig.DefineLabel ();
+
+ ig.MarkLabel (move_next_error);
+ ig.Emit (OpCodes.Ldc_I4_0);
+ ig.Emit (OpCodes.Stloc, retval);
+ ig.Emit (OpCodes.Leave, end);
+
+ ig.MarkLabel (move_next_ok);
+ ig.Emit (OpCodes.Ldc_I4_1);
+ ig.Emit (OpCodes.Stloc, retval);
+ ig.Emit (OpCodes.Leave, end);
+
+ ig.BeginFaultBlock ();
+
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Callvirt, dispose.MethodBuilder);
+
+ ig.EndExceptionBlock ();
+
+ ig.MarkLabel (end);
+ ig.Emit (OpCodes.Ldloc, retval);
+ ig.Emit (OpCodes.Ret);
+ }
+
+ public void EmitDispose (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ Label end = ig.DefineLabel ();
+ Label dispatcher = ig.DefineLabel ();
+ ig.Emit (OpCodes.Br, dispatcher);
+
+ ec.RemapToProxy = true;
+ Label [] labels = new Label [resume_points.Count];
+ for (int i = 0; i < labels.Length; i++) {
+ ResumePoint point = (ResumePoint) resume_points [i];
+
+ if (point.FinallyBlocks == null) {
+ labels [i] = end;
+ continue;
+ }
+
+ labels [i] = ig.DefineLabel ();
+ ig.MarkLabel (labels [i]);
+
+ ig.BeginExceptionBlock ();
+ ig.BeginFinallyBlock ();
+
+ foreach (ExceptionStatement stmt in point.FinallyBlocks) {
+ if (stmt != null)
+ stmt.EmitFinally (ec);
+ }
+
+ ig.EndExceptionBlock ();
+ ig.Emit (OpCodes.Br, end);
+ }
+ ec.RemapToProxy = false;
+
+ ig.MarkLabel (dispatcher);
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Ldfld, pc_field.FieldBuilder);
+ ig.Emit (OpCodes.Switch, labels);
+
+ ig.Emit (OpCodes.Ldarg_0);
+ IntConstant.EmitInt (ig, (int) State.After);
+ ig.Emit (OpCodes.Stfld, pc_field.FieldBuilder);
+
+ ig.MarkLabel (end);
+ }
+
+ protected class ResumePoint
+ {
+ public Label Label;
+ public readonly ExceptionStatement[] FinallyBlocks;
+
+ public ResumePoint (ArrayList list)
+ {
+ if (list != null) {
+ FinallyBlocks = new ExceptionStatement [list.Count];
+ list.CopyTo (FinallyBlocks, 0);
+ }
+ }
+
+ public void Define (ILGenerator ig)
+ {
+ Label = ig.DefineLabel ();
+ ig.MarkLabel (Label);
+ }
+ }
+
+ //
+ // Invoked when a local variable declaration needs to be mapped to
+ // a field in our proxy class
+ //
+ // Prefixes registered:
+ // v_ for EmitContext.MapVariable
+ // s_ for Storage
+ //
+ public FieldBuilder MapVariable (string pfx, string name, Type t)
+ {
+ string full_name = pfx + name;
+ FieldBuilder fb = (FieldBuilder) fields [full_name];
+ if (fb != null)
+ return fb;
+
+ fb = TypeBuilder.DefineField (full_name, t, FieldAttributes.Private);
+ fields.Add (full_name, fb);
+ return fb;
+ }
+
+ //
+ // Called back from Yield
+ //
+ public void MarkYield (EmitContext ec, Expression expr,
+ ArrayList finally_blocks)
+ {
+ ILGenerator ig = ec.ig;
+
+ // Store the new current
+ ig.Emit (OpCodes.Ldarg_0);
+ expr.Emit (ec);
+ ig.Emit (OpCodes.Stfld, current_field.FieldBuilder);
+
+ // increment pc
+ pc++;
+ ig.Emit (OpCodes.Ldarg_0);
+ IntConstant.EmitInt (ig, pc);
+ ig.Emit (OpCodes.Stfld, pc_field.FieldBuilder);
+
+ // Return ok
+ ig.Emit (OpCodes.Br, move_next_ok);
+
+ ResumePoint point = new ResumePoint (finally_blocks);
+ resume_points.Add (point);
+ point.Define (ig);
+ }
+
+ public void MarkFinally (EmitContext ec, ArrayList finally_blocks)
+ {
+ ILGenerator ig = ec.ig;
+
+ // increment pc
+ pc++;
+ ig.Emit (OpCodes.Ldarg_0);
+ IntConstant.EmitInt (ig, pc);
+ ig.Emit (OpCodes.Stfld, pc_field.FieldBuilder);
+
+ ResumePoint point = new ResumePoint (finally_blocks);
+ resume_points.Add (point);
+ point.Define (ig);
+ }
+
+ private static MemberName MakeProxyName (string name)
+ {
+ int pos = name.LastIndexOf ('.');
+ if (pos > 0)
+ name = name.Substring (pos + 1);
+
+ return new MemberName ("<" + name + ">__" + (proxy_count++));
+ }
+
+ //
+ // Our constructor
+ //
+ public Iterator (TypeContainer container, string name, Type return_type,
+ Type [] param_types, InternalParameters parameters,
+ int modifiers, ToplevelBlock block, Location loc)
+ : base (container.NamespaceEntry, container, MakeProxyName (name),
+ Modifiers.PRIVATE, null, loc)
+ {
+ this.container = container;
+ this.return_type = return_type;
+ this.param_types = param_types;
+ this.parameters = parameters;
+ this.original_name = name;
+ this.original_block = block;
+ this.block = new ToplevelBlock (loc);
+
+ fields = new Hashtable ();
+
+ is_static = (modifiers & Modifiers.STATIC) != 0;
+ }
+
+ public bool DefineIterator ()
+ {
+ if (!CheckType (return_type)) {
+ Report.Error (
+ 1624, Location,
+ "The body of `{0}' cannot be an iterator block " +
+ "because '{1}' is not an iterator interface type",
+ original_name, TypeManager.CSharpName (return_type));
+ return false;
+ }
+
+ for (int i = 0; i < parameters.Count; i++){
+ Parameter.Modifier mod = parameters.ParameterModifier (i);
+ if ((mod & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0){
+ Report.Error (
+ 1623, Location,
+ "Iterators cannot have ref or out parameters");
+ return false;
+ }
+ }
+
+ ArrayList list = new ArrayList ();
+ if (is_enumerable)
+ list.Add (new TypeExpression (
+ TypeManager.ienumerable_type, Location));
+ list.Add (new TypeExpression (TypeManager.ienumerator_type, Location));
+ list.Add (new TypeExpression (TypeManager.idisposable_type, Location));
+
+ iterator_type_expr = new TypeExpression (iterator_type, Location);
+
+ container.AddIterator (this);
+
+ Bases = list;
+ return true;
+ }
+
+ //
+ // Returns the new block for the method, or null on failure
+ //
+ protected override bool DefineNestedTypes ()
+ {
+ Define_Fields ();
+ Define_Constructor ();
+ Define_Current ();
+ Define_MoveNext ();
+ Define_Reset ();
+ Define_Dispose ();
+
+ if (is_enumerable)
+ Define_GetEnumerator ();
+
+ Create_Block ();
+
+ return base.DefineNestedTypes ();
+ }
+
+
+ Field pc_field;
+ Field current_field;
+ Method dispose;
+
+ public Field this_field;
+ public Field[] parameter_fields;
+
+ void Create_Block ()
+ {
+ int first = is_static ? 0 : 1;
+
+ ArrayList args = new ArrayList ();
+ if (!is_static) {
+ Type t = container.TypeBuilder;
+ args.Add (new Argument (
+ new ThisParameterReference (t, 0, Location)));
+ }
+
+ args.Add (new Argument (new BoolLiteral (false)));
+
+ for (int i = 0; i < parameters.Count; i++) {
+ Type t = parameters.ParameterType (i);
+ args.Add (new Argument (
+ new SimpleParameterReference (t, first + i, Location)));
+ }
+
+ Expression new_expr = new New (
+ new TypeExpression (TypeBuilder, Location), args, Location);
+
+ block.AddStatement (new NoCheckReturn (new_expr, Location));
+ }
+
+ void Define_Fields ()
+ {
+ Location loc = Location.Null;
+
+ pc_field = new Field (
+ this, TypeManager.system_int32_expr, Modifiers.PRIVATE, "PC",
+ null, null, loc);
+ AddField (pc_field);
+
+ current_field = new Field (
+ this, iterator_type_expr, Modifiers.PRIVATE, "current",
+ null, null, loc);
+ AddField (current_field);
+
+ if (!is_static) {
+ this_field = new Field (
+ this,
+ new TypeExpression (container.TypeBuilder, Location),
+ Modifiers.PRIVATE, "this", null, null, loc);
+ AddField (this_field);
+ }
+
+ parameter_fields = new Field [parameters.Count];
+ for (int i = 0; i < parameters.Count; i++) {
+ string fname = String.Format (
+ "field{0}_{1}", i, parameters.ParameterName (i));
+
+ parameter_fields [i] = new Field (
+ this,
+ new TypeExpression (parameters.ParameterType (i), loc),
+ Modifiers.PRIVATE, fname, null, null, loc);
+ AddField (parameter_fields [i]);
+ }
+ }
+
+ void Define_Constructor ()
+ {
+ Parameters ctor_params;
+
+ ArrayList list = new ArrayList ();
+
+ if (!is_static)
+ list.Add (new Parameter (
+ new TypeExpression (container.TypeBuilder, Location),
+ "this", Parameter.Modifier.NONE, null));
+ list.Add (new Parameter (
+ TypeManager.system_boolean_expr, "initialized",
+ Parameter.Modifier.NONE, null));
+
+ Parameter[] old_fixed = parameters.Parameters.FixedParameters;
+ if (old_fixed != null)
+ list.AddRange (old_fixed);
+
+ Parameter[] fixed_params = new Parameter [list.Count];
+ list.CopyTo (fixed_params);
+
+ ctor_params = new Parameters (
+ fixed_params, parameters.Parameters.ArrayParameter,
+ Location);
+
+ Constructor ctor = new Constructor (
+ this, Name, Modifiers.PUBLIC, ctor_params,
+ new ConstructorBaseInitializer (
+ null, Parameters.EmptyReadOnlyParameters, Location),
+ Location);
+ AddConstructor (ctor);
+
+ ToplevelBlock block = ctor.Block = new ToplevelBlock (Location);
+
+ if (!is_static) {
+ Type t = container.TypeBuilder;
+
+ Assign assign = new Assign (
+ new FieldExpression (this_field),
+ new SimpleParameterReference (t, 1, Location),
+ Location);
+
+ block.AddStatement (new StatementExpression (assign, Location));
+ }
+
+ int first = is_static ? 2 : 3;
+
+ for (int i = 0; i < parameters.Count; i++) {
+ Type t = parameters.ParameterType (i);
+
+ Assign assign = new Assign (
+ new FieldExpression (parameter_fields [i]),
+ new SimpleParameterReference (t, first + i, Location),
+ Location);
+
+ block.AddStatement (new StatementExpression (assign, Location));
+ }
+
+ State initial = is_enumerable ? State.Uninitialized : State.Running;
+ block.AddStatement (new SetState (this, initial, Location));
+
+ block.AddStatement (new If (
+ new SimpleParameterReference (
+ TypeManager.bool_type, first - 1, Location),
+ new SetState (this, State.Running, Location),
+ Location));
+ }
+
+ Statement Create_ThrowInvalidOperation ()
+ {
+ TypeExpr ex_type = new TypeExpression (
+ TypeManager.invalid_operation_exception_type, Location);
+
+ return new Throw (new New (ex_type, null, Location), Location);
+ }
+
+ Statement Create_ThrowNotSupported ()
+ {
+ TypeExpr ex_type = new TypeExpression (
+ TypeManager.not_supported_exception_type, Location);
+
+ return new Throw (new New (ex_type, null, Location), Location);
+ }
+
+ void Define_Current ()
+ {
+ ToplevelBlock get_block = new ToplevelBlock (Location);
+ MemberName left = new MemberName ("System.Collections.IEnumerator");
+ MemberName name = new MemberName (left, "Current");
+
+ get_block.AddStatement (new If (
+ new Binary (
+ Binary.Operator.LessThanOrEqual,
+ new FieldExpression (pc_field),
+ new IntLiteral ((int) State.Running), Location),
+ Create_ThrowInvalidOperation (),
+ new Return (
+ new FieldExpression (current_field), Location),
+ Location));
+
+ Accessor getter = new Accessor (get_block, 0, null, Location);
+
+ Property current = new Property (
+ this, iterator_type_expr, 0,
+ false, name, null, getter, null, Location);
+ AddProperty (current);
+ }
+
+ void Define_MoveNext ()
+ {
+ Method move_next = new Method (
+ this, TypeManager.system_boolean_expr,
+ Modifiers.PUBLIC, false, new MemberName ("MoveNext"),
+ Parameters.EmptyReadOnlyParameters, null,
+ Location.Null);
+ AddMethod (move_next);
+
+ ToplevelBlock block = move_next.Block = new ToplevelBlock (Location);
+
+ MoveNextMethod inline = new MoveNextMethod (this, Location);
+ block.AddStatement (inline);
+ }
+
+ void Define_GetEnumerator ()
+ {
+ MemberName left = new MemberName ("System.Collections.IEnumerable");
+ MemberName name = new MemberName (left, "GetEnumerator");
+
+ Method get_enumerator = new Method (
+ this,
+ new TypeExpression (TypeManager.ienumerator_type, Location),
+ 0, false, name,
+ Parameters.EmptyReadOnlyParameters, null,
+ Location.Null);
+ AddMethod (get_enumerator);
+
+ get_enumerator.Block = new ToplevelBlock (Location);
+
+ Expression ce = new MemberAccess (
+ new SimpleName ("System.Threading.Interlocked", Location),
+ "CompareExchange", Location);
+
+ Expression pc = new FieldExpression (pc_field);
+ Expression before = new IntLiteral ((int) State.Running);
+ Expression uninitialized = new IntLiteral ((int) State.Uninitialized);
+
+ ArrayList args = new ArrayList ();
+ args.Add (new Argument (pc, Argument.AType.Ref));
+ args.Add (new Argument (before, Argument.AType.Expression));
+ args.Add (new Argument (uninitialized, Argument.AType.Expression));
+
+ get_enumerator.Block.AddStatement (new If (
+ new Binary (
+ Binary.Operator.Equality,
+ new Invocation (ce, args, Location),
+ uninitialized, Location),
+ new Return (new This (block, Location), Location),
+ Location));
+
+ args = new ArrayList ();
+ if (!is_static)
+ args.Add (new Argument (new FieldExpression (this_field)));
+
+ args.Add (new Argument (new BoolLiteral (true)));
+
+ for (int i = 0; i < parameters.Count; i++)
+ args.Add (new Argument (
+ new FieldExpression (parameter_fields [i])));
+
+ Expression new_expr = new New (
+ new TypeExpression (TypeBuilder, Location), args, Location);
+ get_enumerator.Block.AddStatement (new Return (new_expr, Location));
+ }
+
+ protected class SimpleParameterReference : Expression
+ {
+ int idx;
+
+ public SimpleParameterReference (Type type, int idx, Location loc)
+ {
+ this.idx = idx;
+ this.loc = loc;
+ this.type = type;
+ eclass = ExprClass.Variable;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ return this;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ DoEmit (ec);
+ }
+
+ protected virtual void DoEmit (EmitContext ec)
+ {
+ ParameterReference.EmitLdArg (ec.ig, idx);
+ }
+ }
+
+ protected class ThisParameterReference : SimpleParameterReference
+ {
+ public ThisParameterReference (Type type, int idx, Location loc)
+ : base (type, idx, loc)
+ { }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ base.DoEmit (ec);
+ if (ec.TypeContainer is Struct)
+ ec.ig.Emit (OpCodes.Ldobj, type);
+ }
+ }
+
+ protected class FieldExpression : Expression
+ {
+ Field field;
+
+ public FieldExpression (Field field)
+ {
+ this.field = field;
+ }
+
+ public override Expression DoResolve (EmitContext ec)
+ {
+ FieldExpr fexpr = new FieldExpr (field.FieldBuilder, loc);
+ fexpr.InstanceExpression = ec.GetThis (loc);
+ return fexpr.Resolve (ec);
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ throw new InvalidOperationException ();
+ }
+ }
+
+ protected class MoveNextMethod : Statement {
+ Iterator iterator;
+
+ public MoveNextMethod (Iterator iterator, Location loc)
+ {
+ this.loc = loc;
+ this.iterator = iterator;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ ec.CurrentBranching.CurrentUsageVector.Return ();
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ int code_flags = Modifiers.METHOD_YIELDS;
+ if (iterator.is_static)
+ code_flags |= Modifiers.STATIC;
+
+ EmitContext new_ec = new EmitContext (
+ iterator.container, loc, ec.ig,
+ TypeManager.int32_type, code_flags);
+
+ new_ec.CurrentIterator = iterator;
+
+ iterator.EmitMoveNext (new_ec);
+ }
+ }
+
+ protected class DisposeMethod : Statement {
+ Iterator iterator;
+
+ public DisposeMethod (Iterator iterator, Location loc)
+ {
+ this.loc = loc;
+ this.iterator = iterator;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ iterator.EmitDispose (ec);
+ }
+ }
+
+ protected class StatementList : Statement {
+ ArrayList statements;
+
+ public StatementList (Location loc)
+ {
+ this.loc = loc;
+ statements = new ArrayList ();
+ }
+
+ public void Add (Statement statement)
+ {
+ statements.Add (statement);
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ foreach (Statement stmt in statements) {
+ if (!stmt.Resolve (ec))
+ return false;
+ }
+
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ foreach (Statement stmt in statements)
+ stmt.Emit (ec);
+ }
+ }
+
+ protected class SetState : Statement
+ {
+ Iterator iterator;
+ State state;
+
+ public SetState (Iterator iterator, State state, Location loc)
+ {
+ this.iterator = iterator;
+ this.state = state;
+ this.loc = loc;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ ec.ig.Emit (OpCodes.Ldarg_0);
+ IntConstant.EmitInt (ec.ig, (int) state);
+ ec.ig.Emit (OpCodes.Stfld, iterator.pc_field.FieldBuilder);
+ }
+ }
+
+ void Define_Reset ()
+ {
+ Method reset = new Method (
+ this, TypeManager.system_void_expr, Modifiers.PUBLIC,
+ false, new MemberName ("Reset"),
+ Parameters.EmptyReadOnlyParameters, null, Location);
+ AddMethod (reset);
+
+ reset.Block = new ToplevelBlock (Location);
+ reset.Block.AddStatement (Create_ThrowNotSupported ());
+ }
+
+ void Define_Dispose ()
+ {
+ dispose = new Method (
+ this, TypeManager.system_void_expr, Modifiers.PUBLIC,
+ false, new MemberName ("Dispose"),
+ Parameters.EmptyReadOnlyParameters, null, Location);
+ AddMethod (dispose);
+
+ dispose.Block = new ToplevelBlock (Location);
+ dispose.Block.AddStatement (new DisposeMethod (this, Location));
+ }
+
+ public ToplevelBlock Block {
+ get { return block; }
+ }
+
+ public Type IteratorType {
+ get { return iterator_type; }
+ }
+
+ //
+ // This return statement tricks return into not flagging an error for being
+ // used in a Yields method
+ //
+ class NoCheckReturn : Return {
+ public NoCheckReturn (Expression expr, Location loc) : base (expr, loc)
+ {
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ ec.InIterator = false;
+ bool ret_val = base.Resolve (ec);
+ ec.InIterator = true;
+
+ return ret_val;
+ }
+ }
+
+ bool CheckType (Type t)
+ {
+ if (t == TypeManager.ienumerable_type) {
+ iterator_type = TypeManager.object_type;
+ is_enumerable = true;
+ return true;
+ } else if (t == TypeManager.ienumerator_type) {
+ iterator_type = TypeManager.object_type;
+ is_enumerable = false;
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
+
diff --git a/mcs/mcs/literal.cs b/mcs/mcs/literal.cs
index a307030db6a..ac8a49eeb85 100755
--- a/mcs/mcs/literal.cs
+++ b/mcs/mcs/literal.cs
@@ -22,11 +22,23 @@ using System;
using System.Reflection;
using System.Reflection.Emit;
+//
+// I put System.Null just so we do not have to special case it on
+// TypeManager.CSharpName
+//
+namespace System {
+ //
+ // Represents the Null Type, just used as a placeholder for the type in NullLiteral
+ //
+ public class Null {
+ }
+}
+
namespace Mono.CSharp {
public class NullLiteral : Constant {
public static readonly NullLiteral Null;
-
+
static NullLiteral ()
{
Null = new NullLiteral ();
@@ -34,8 +46,6 @@ namespace Mono.CSharp {
public NullLiteral ()
{
- if (Null != null)
- throw new Exception ("More than one null has been created!");
eclass = ExprClass.Value;
}
@@ -51,7 +61,7 @@ namespace Mono.CSharp {
public override Expression DoResolve (EmitContext ec)
{
- type = TypeManager.object_type;
+ type = typeof (System.Null);
return this;
}
@@ -59,6 +69,41 @@ namespace Mono.CSharp {
{
ec.ig.Emit (OpCodes.Ldnull);
}
+
+ public override bool IsNegative {
+ get {
+ return false;
+ }
+ }
+
+ public override bool IsZeroInteger {
+ get { return true; }
+ }
+ }
+
+ //
+ // A null literal in a pointer context
+ //
+ public class NullPointer : NullLiteral {
+ public new static readonly NullLiteral Null;
+
+ static NullPointer ()
+ {
+ Null = new NullPointer ();
+ }
+
+ private NullPointer ()
+ {
+ type = TypeManager.object_type;
+ }
+
+ public override void Emit (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ ig.Emit (OpCodes.Ldc_I4_0);
+ ig.Emit (OpCodes.Conv_U);
+ }
}
public class BoolLiteral : BoolConstant {
@@ -86,6 +131,14 @@ namespace Mono.CSharp {
}
public class IntLiteral : IntConstant {
+ public static IntLiteral One, Zero;
+
+ static IntLiteral ()
+ {
+ Zero = new IntLiteral (0);
+ One = new IntLiteral (1);
+ }
+
public IntLiteral (int l) : base (l)
{
}
diff --git a/mcs/mcs/location.cs b/mcs/mcs/location.cs
index 1b32f32de6e..035de4841e5 100644
--- a/mcs/mcs/location.cs
+++ b/mcs/mcs/location.cs
@@ -8,11 +8,44 @@
//
using System;
+using System.IO;
using System.Collections;
-using System.Diagnostics.SymbolStore;
+using Mono.CompilerServices.SymbolWriter;
namespace Mono.CSharp {
/// <summary>
+ /// This is one single source file.
+ /// </summary>
+ /// <remarks>
+ /// This is intentionally a class and not a struct since we need
+ /// to pass this by reference.
+ /// </remarks>
+ public sealed class SourceFile : ISourceFile {
+ public readonly string Name;
+ public readonly string Path;
+ public readonly int Index;
+ public SourceFileEntry SourceFileEntry;
+ public bool HasLineDirective;
+
+ public SourceFile (string name, string path, int index)
+ {
+ this.Index = index;
+ this.Name = name;
+ this.Path = path;
+ }
+
+ SourceFileEntry ISourceFile.Entry {
+ get { return SourceFileEntry; }
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("SourceFile ({0}:{1}:{2}:{3})",
+ Name, Path, Index, SourceFileEntry);
+ }
+ }
+
+ /// <summary>
/// Keeps track of the location in the program
/// </summary>
///
@@ -26,41 +59,114 @@ namespace Mono.CSharp {
public struct Location {
public int token;
- static Hashtable map;
- static Hashtable sym_docs;
- static ArrayList list;
- static int global_count;
- static int module_base;
+ static ArrayList source_list;
+ static Hashtable source_files;
+ static int source_bits;
+ static int source_mask;
+ static int source_count;
+ static int current_source;
public readonly static Location Null;
static Location ()
{
- map = new Hashtable ();
- list = new ArrayList ();
- sym_docs = new Hashtable ();
- global_count = 0;
- module_base = 0;
- Null.token = -1;
+ source_files = new Hashtable ();
+ source_list = new ArrayList ();
+ current_source = 0;
+ Null.token = 0;
+ }
+
+ // <summary>
+ // This must be called before parsing/tokenizing any files.
+ // </summary>
+ static public void AddFile (string name)
+ {
+ string path = Path.GetFullPath (name);
+
+ if (source_files.Contains (path)){
+ Report.Warning (2002, name, "Source file '{0}' specified multiple times");
+ return;
+ }
+
+ source_files.Add (path, ++source_count);
+ source_list.Add (new SourceFile (name, path, source_count));
+ }
+
+ static public SourceFile[] SourceFiles {
+ get {
+ SourceFile[] retval = new SourceFile [source_list.Count];
+ source_list.CopyTo (retval, 0);
+ return retval;
+ }
+ }
+
+ static int log2 (int number)
+ {
+ int bits = 0;
+ while (number > 0) {
+ bits++;
+ number /= 2;
+ }
+
+ return bits;
+ }
+
+ // <summary>
+ // After adding all source files we want to compile with AddFile(), this method
+ // must be called to `reserve' an appropriate number of bits in the token for the
+ // source file. We reserve some extra space for files we encounter via #line
+ // directives while parsing.
+ // </summary>
+ static public void Initialize ()
+ {
+ source_bits = log2 (source_list.Count) + 2;
+ source_mask = (1 << source_bits) - 1;
+ }
+
+ // <remarks>
+ // This is used when we encounter a #line preprocessing directive.
+ // </remarks>
+ static public SourceFile LookupFile (string name)
+ {
+ string path = name == "" ? "" : Path.GetFullPath (name);
+
+ if (!source_files.Contains (path)) {
+ if (source_count >= (1 << source_bits))
+ return new SourceFile (name, path, 0);
+
+ source_files.Add (path, ++source_count);
+ SourceFile retval = new SourceFile (name, path, source_count);
+ source_list.Add (retval);
+ return retval;
+ }
+
+ int index = (int) source_files [path];
+ return (SourceFile) source_list [index - 1];
}
- static public void Push (string name)
+ static public void Push (SourceFile file)
{
- map.Remove (global_count);
- map.Add (global_count, name);
- list.Add (global_count);
- module_base = global_count;
+ current_source = file.Index;
+ }
+
+ // <remarks>
+ // If we're compiling with debugging support, this is called between parsing
+ // and code generation to register all the source files with the
+ // symbol writer.
+ // </remarks>
+ static public void DefineSymbolDocuments (SymbolWriter symwriter)
+ {
+ foreach (SourceFile file in source_list) {
+ file.SourceFileEntry = symwriter.DefineDocument (file.Path);
+ }
}
public Location (int row)
{
if (row < 0)
- token = -1;
- else {
- token = module_base + row;
- if (global_count < token)
- global_count = token;
- }
+ token = 0;
+ else
+ token = current_source + (row << source_bits);
}
public override string ToString ()
@@ -73,36 +179,32 @@ namespace Mono.CSharp {
/// </summary>
static public bool IsNull (Location l)
{
- return l.token == -1;
+ return l.token == 0;
}
public string Name {
get {
- int best = 0;
-
- if (token < 0)
+ int index = token & source_mask;
+ if ((token == 0) || (index == 0))
return "Internal";
- foreach (int b in list){
- if (token > b)
- best = b;
- }
- return (string) map [best];
+ SourceFile file = (SourceFile) source_list [index - 1];
+ return file.Name;
}
}
public int Row {
get {
- int best = 0;
-
- if (token < 0)
+ if (token == 0)
return 1;
-
- foreach (int b in list){
- if (token > b)
- best = b;
- }
- return token - best;
+
+ return token >> source_bits;
+ }
+ }
+
+ public int File {
+ get {
+ return token & source_mask;
}
}
@@ -118,33 +220,12 @@ namespace Mono.CSharp {
// to the location's source file.
//
// If we don't have a symbol writer, this property is always null.
- public ISymbolDocumentWriter SymbolDocument {
+ public SourceFile SourceFile {
get {
- ISymbolWriter sw = CodeGen.SymbolWriter;
- ISymbolDocumentWriter doc;
-
- if (token < 0)
+ int index = token & source_mask;
+ if (index == 0)
return null;
-
- // If we don't have a symbol writer, return null.
- if (sw == null)
- return null;
-
- if (sym_docs.Contains (Name))
- // If we already created an ISymbolDocumentWriter
- // instance for this document, return it.
- doc = (ISymbolDocumentWriter) sym_docs [Name];
- else {
- // Create a new ISymbolDocumentWriter instance and
- // store it in the hash table.
- doc = sw.DefineDocument (Name, SymLanguageType.CSharp,
- SymLanguageVendor.Microsoft,
- SymDocumentType.Text);
-
- sym_docs.Add (Name, doc);
- }
-
- return doc;
+ return (SourceFile) source_list [index - 1];
}
}
}
diff --git a/mcs/mcs/makefile b/mcs/mcs/makefile
deleted file mode 100755
index f36448baae0..00000000000
--- a/mcs/mcs/makefile
+++ /dev/null
@@ -1,99 +0,0 @@
-CSC=csc.exe
-CSCFLAGS=/nologo /debug+ /debug:full /optimize
-
-VERSION=0.13
-
-COMMON_SOURCES = cs-parser.cs cs-tokenizer.cs tree.cs location.cs
-
-COMPILER_SOURCES = \
- assign.cs \
- attribute.cs \
- driver.cs $(COMMON_SOURCES) \
- cfold.cs \
- class.cs \
- codegen.cs \
- const.cs \
- constant.cs \
- decl.cs \
- delegate.cs \
- enum.cs \
- ecore.cs \
- expression.cs \
- genericparser.cs \
- interface.cs \
- literal.cs \
- modifiers.cs \
- namespace.cs \
- parameter.cs \
- pending.cs \
- report.cs \
- rootcontext.cs \
- statement.cs \
- support.cs \
- typemanager.cs
-
-TEST_TOKENIZER_SOURCES = test-token.cs $(COMMON_SOURCES)
-
-all: mcs.exe
-
-mcs.exe: cs-parser.cs $(COMPILER_SOURCES)
- $(CSC) $(CSCFLAGS) /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
-
-res:
- echo --target exe -o mcs2.exe $(COMPILER_SOURCES) > response
-
-dum: cs-parser.cs
- $(TIME) ./mcs --fatal --target exe -o mcs2.exe $(COMPILER_SOURCES)
-
-mcs2.exe: mcs.exe
- $(TIME) ./mcs $(XFLAGS) --target exe -o mcs2.exe $(COMPILER_SOURCES)
-
-mcs3.exe: mcs2.exe
- $(TIME) ./mcs2 --target exe -o mcs3.exe $(COMPILER_SOURCES)
-
-mcs-mono.exe: cs-parser.cs $(COMPILER_SOURCES)
- mono mcs.exe --timestamp -o mcs-mono.exe $(COMPILER_SOURCES)
-mm:
- mint $(MINTFLAGS) ./mcs.exe $(MCSFLAGS) --target exe -o mcs4.exe $(COMPILER_SOURCES)
-
-mcs-mono2.exe: cs-parser.cs $(COMPILER_SOURCES)
- mono mcs.exe --timestamp -o mcs-mono2.exe -g $(COMPILER_SOURCES)
-
-monomcs: cs-parser.cs
- mcs $(MCSFLAGS) --target exe -o mcs4.exe $(COMPILER_SOURCES)
-
-test: mcs3.exe
- ls -l mcs2.exe mcs3.exe
-
-docs: cs-parser.cs
- $(CSC) $(CSCFLAGS) /doc:docs.xml /nowarn:1591 /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
-
-windows: all
-
-linux: all
-
-opt:
- $(CSC) /optimize+ /target:exe /r:System.dll /out:mcs.exe $(COMPILER_SOURCES)
-
-old: test-tokenizer.exe
-test-tokenizer.exe: $(TEST_TOKENIZER_SOURCES)
- $(CSC) /target:exe /out:test-tokenizer.exe $(TEST_TOKENIZER_SOURCES)
-
-bison:
- perl -pe 's/\015//' < cs-parser.jay > x.y
- bison --debug --verbose x.y
-
-cs-parser.cs: cs-parser.jay
- ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay > cs-parser.cs
-
-pn:
- ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay | grep -v '#line' > cs-parser.cs
-
-#statementCollection.cs: X-Collection.cs
-# sed -e "s/@CONTAINEE@/Statement/g" -e "s/@arrayname@/statements/g" < X-Collection.cs > statementCollection.cs
-
-#parameterCollection.cs: X-Collection.cs
-# sed -e "s/@CONTAINEE@/Parameter/g" -e "s/@arrayname@/parameters/g" < X-Collection.cs > parameterCollection.cs
-
-clean:
- rm -f mcs.exe cs-parser.cs y.output mcs.pdb *~ .*~ mcs.log response
diff --git a/mcs/mcs/mb-parser.jay b/mcs/mcs/mb-parser.jay
deleted file mode 100644
index 1ac5fb23622..00000000000
--- a/mcs/mcs/mb-parser.jay
+++ /dev/null
@@ -1,476 +0,0 @@
-%{
-//
-// MonoBASIC.Parser.cs (from .jay): The Parser for the MonoBASIC compiler
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 A Rafael D Teixeira
-//
-// TODO:
-// Nearly everything
-//
-
-namespace Mono.Languages.MonoBASIC
-{
- using System.Text;
- using System;
- using System.Collections;
-
- using CIR;
- using Mono.Languages;
- using Mono.Languages.MonoBASIC; // To get the tokenizer
-
- /// <summary>
- /// The MonoBASIC Parser
- /// </summary>
- public class Parser : GenericParser {
- Namespace current_namespace;
- TypeContainer current_container;
-
-/*
- /// <summary>
- /// Current block is used to add statements as we find
- /// them.
- /// </summary>
- Block current_block;
-
- /// <summary>
- /// Current interface is used by the various declaration
- /// productions in the interface declaration to "add"
- /// the interfaces as we find them.
- /// </summary>
- Interface current_interface;
-
- /// <summary>
- /// This is used by the unary_expression code to resolve
- /// a name against a parameter.
- /// </summary>
- Parameters current_local_parameters;
-
- /// <summary>
- /// Using during property parsing to describe the implicit
- /// value parameter that is passed to the "set" accessor
- /// method
- /// </summary>
- Parameter [] implicit_value_parameters;
-
-*/
- /// <summary>
- /// Used to record all types defined
- /// </summary>
- Tree tree;
-
- bool UseExtendedSyntax; // for ".mbs" files
-
- public override string[] GetExtensions()
- {
- string [] list = { ".vb", ".mbs" };
- return list;
- }
-
-%}
-
-%token EOF
-%token NONE /* This token is never returned by our lexer */
-%token ERROR // This is used not by the parser, but by the tokenizer.
- // do not remove.
-
-/*
- *These are the MonoBASIC keywords
- */
-%token ADDHANDLER
-%token ADDRESSOF
-%token ALIAS
-%token AND
-%token ANDALSO
-%token ANSI
-%token AS
-%token ASSEMBLY
-%token AUTO
-%token BOOLEAN
-%token BYREF
-%token BYTE
-%token BYVAL
-%token CALL
-%token CASE
-%token CATCH
-%token CBOOL
-%token CBYTE
-%token CCHAR
-%token CDATE
-%token CDEC
-%token CDBL
-%token CHAR
-%token CINT
-%token CLASS
-%token CLNG
-%token COBJ
-//%token COMPARE
-%token CONST
-%token CSHORT
-%token CSNG
-%token CSTR
-%token CTYPE
-%token DATE
-%token DECIMAL
-%token DECLARE
-%token DEFAULT
-%token DELEGATE
-%token DIM
-%token DO
-%token DOUBLE
-%token EACH
-%token ELSE
-%token ELSEIF
-%token END
-%token ENUM
-%token EOL
-%token ERASE
-%token ERROR
-%token EVENT
-%token EXIT
-//%token EXPLICIT
-%token FALSE
-%token FINALLY
-%token FOR
-%token FRIEND
-%token FUNCTION
-%token GET
-%token GETTYPE
-%token GOTO
-%token HANDLES
-%token IF
-%token IMPLEMENTS
-%token IMPORTS
-%token IN
-%token INHERITS
-%token INTEGER
-%token INTERFACE
-%token IS
-%token LET
-%token LIB
-%token LIKE
-%token LONG
-%token LOOP
-%token ME
-%token MOD
-%token MODULE
-%token MUSTINHERIT
-%token MUSTOVERRIDE
-%token MYBASE
-%token MYCLASS
-%token NAMESPACE
-%token NEW
-%token NEXT
-%token NOT
-%token NOTHING
-%token NOTINHERITABLE
-%token NOTOVERRIDABLE
-%token OBJECT
-%token ON
-%token OPTION
-%token OPTIONAL
-%token OR
-%token ORELSE
-%token OVERLOADS
-%token OVERRIDABLE
-%token OVERRIDES
-%token PARAM_ARRAY
-%token PRESERVE
-%token PRIVATE
-%token PROPERTY
-%token PROTECTED
-%token PUBLIC
-%token RAISEEVENT
-%token READONLY
-%token REDIM
-%token REM
-%token REMOVEHANDLER
-%token RESUME
-%token RETURN
-%token SELECT
-%token SET
-%token SHADOWS
-%token SHARED
-%token SHORT
-%token SINGLE
-%token SIZEOF
-%token STATIC
-%token STEP
-%token STOP
-%token STRING
-%token STRUCTURE
-%token SUB
-%token SYNCLOCK
-%token THEN
-%token THROW
-%token TO
-%token TRUE
-%token TRY
-%token TYPEOF
-%token UNICODE
-%token UNTIL
-%token VARIANT
-%token WHEN
-%token WHILE
-%token WITH
-%token WITHEVENTS
-%token WRITEONLY
-%token XOR
-
-/* MonoBASIC single character operators/punctuation. */
-%token OPEN_BRACKET "["
-%token CLOSE_BRACKET "]"
-%token OPEN_PARENS "("
-%token CLOSE_PARENS ")"
-%token DOT "."
-%token COMMA ","
-%token COLON ":"
-
-%token PLUS "+"
-%token MINUS "-"
-%token ASSIGN "="
-%token OP_LT "<"
-%token OP_GT ">"
-%token STAR "*"
-%token PERCENT "%"
-%token DIV "/"
-%token OP_EXP "^"
-%token INTERR "?"
-%token OP_IDIV "\\"
-%token OP_CONCAT "&"
-
-/* MonoBASIC multi-character operators. */
-%token OP_LE "<="
-%token OP_GE ">="
-%token OP_EQ "=="
-%token OP_NE "<>"
-%token OP_AND //"and"
-%token OP_OR //"or"
-%token OP_XOR //"xor"
-%token OP_MODULUS //"mod"
-%token OP_MULT_ASSIGN "*="
-%token OP_DIV_ASSIGN "/="
-%token OP_IDIV_ASSIGN "\\="
-%token OP_ADD_ASSIGN "+="
-%token OP_SUB_ASSIGN "-="
-%token OP_CONCAT_ASSIGN "&="
-%token OP_EXP_ASSIGN "^="
-
-/* Numbers */
-%token LITERAL_INTEGER "int literal"
-%token LITERAL_SINGLE "float literal"
-%token LITERAL_DOUBLE "double literal"
-%token LITERAL_DECIMAL "decimal literal"
-%token LITERAL_CHARACTER "character literal"
-%token LITERAL_STRING "string literal"
-
-%token IDENTIFIER
-
-/* Add precedence rules to solve dangling else s/r conflict */
-%nonassoc LOWPREC
-%nonassoc IF
-%nonassoc ELSE
-%right ASSIGN
-%left OP_OR
-%left OP_AND
-%left BITWISE_OR
-%left BITWISE_AND
-%left OP_SHIFT_LEFT OP_SHIFT_RIGHT
-%left PLUS MINUS
-%left STAR DIV PERCENT
-%right BITWISE_NOT CARRET UMINUS
-%nonassoc OP_INC OP_DEC
-%left OPEN_PARENS
-%left OPEN_BRACKET OPEN_BRACE
-%left DOT
-%nonassoc HIGHPREC
-
-%start compilation_unit
-%%
-
-compilation_unit
- : opt_imports_directives
- /* opt_attributes */
- opt_namespace_member_declarations
- EOF
- {
- $$ = $3;
- }
- ;
-
-qualified_identifier
- : IDENTIFIER
- | qualified_identifier DOT IDENTIFIER
- {
- $$ = (($1).ToString ()) + "." + ($3.ToString ());
- }
- ;
-
-opt_imports_directives
- : /* empty */
- | imports_directives
- ;
-
-imports_directives
- : imports_directive
- | imports_directives imports_directive
- ;
-
-imports_directive
- : /* imports_alias_directive
- | */ imports_namespace_directive
- ;
-
-imports_namespace_directive
- : IMPORTS namespace_name EOL
- {
- current_namespace.Using ((string) $2);
- }
- ;
-
-opt_attributes
- : /* empty */
- ;
-
-namespace_declaration
- : NAMESPACE qualified_identifier EOL
- {
- current_namespace = new Namespace (current_namespace, (string) $2);
- }
- opt_imports_directives
- opt_namespace_member_declarations
- END NAMESPACE EOL
- {
- current_namespace = current_namespace.Parent;
- }
- ;
-
-namespace_name
- : qualified_identifier
- ;
-
-
-
-opt_namespace_member_declarations
- : /* empty */
- | namespace_member_declarations
- ;
-
-namespace_member_declarations
- : namespace_member_declaration
- | namespace_member_declarations namespace_member_declaration
- ;
-
-namespace_member_declaration
- : namespace_declaration
- | type_declaration
- {
- int mod_flags = 0;
- string name = "";
-
- if ($1 is Class){
- Class c = (Class) $1;
- mod_flags = c.ModFlags;
- name = c.Name;
- } else if ($1 is Struct){
- Struct s = (Struct) $1;
- mod_flags = s.ModFlags;
- name = s.Name;
- } else
- break;
-
- }
- ;
-
-
-type_declaration
- : class_declaration
- ;
-
-
-class_declaration
- : /* opt_attributes opt_modifiers */
- CLASS IDENTIFIER /* opt_class_interfaces */ EOL
- {
- }
- opt_class_member_declarations
- END CLASS EOL
- {
- }
- ;
-
-opt_class_member_declarations
- : /* empty */
- | class_member_declarations
- ;
-
-class_member_declarations
- : class_member_declaration
- | class_member_declarations class_member_declaration
- ;
-
-class_member_declaration
- : type_declaration
- | sub_declaration
- ;
-
-sub_declaration
- : SUB qualified_identifier OPEN_PARENS opt_formal_parameters CLOSE_PARENS EOL
- opt_statements
- END SUB EOL
- ;
-
-opt_statements
- : /* empty */
- | qualified_identifier OPEN_PARENS opt_actual_parameters CLOSE_PARENS EOL
- ;
-
-opt_formal_parameters
- : /* empty */
- | qualified_identifier AS qualified_identifier
- ;
-
-opt_actual_parameters
- : /* empty */
- | qualified_identifier
- | LITERAL_STRING
- ;
-
-%%
-
-
-Tokenizer lexer;
-
-public override void parse ()
-{
- current_namespace = new Namespace (null, "");
- this.tree = rc.Tree;
- current_container = tree.Types;
- current_container.Namespace = current_namespace;
-
- UseExtendedSyntax = name.EndsWith(".mbs");
-
- lexer = new Tokenizer (input, name);
- StringBuilder value = new StringBuilder ();
-
- try
- {
- if (yacc_verbose_flag)
- yyparse (lexer, new yydebug.yyDebugSimple ());
- else
- yyparse (lexer);
- }
- catch (Exception e)
- {
- Console.WriteLine (lexer.location + " : Parsing error ");
- Console.WriteLine (e);
- }
-}
-
-/* end end end */
-}
-
-
diff --git a/mcs/mcs/mb-tokenizer.cs b/mcs/mcs/mb-tokenizer.cs
deleted file mode 100644
index e6252742edb..00000000000
--- a/mcs/mcs/mb-tokenizer.cs
+++ /dev/null
@@ -1,824 +0,0 @@
-//
-// MonoBASIC.Tokenizer.cs: The Tokenizer for the MonoBASIC compiler
-//
-// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
-//
-// Based on cs-tokenizer.cs by Miguel de Icaza (miguel@gnu.org)
-//
-// Licensed under the terms of the GNU GPL
-//
-// Copyright (C) 2001 A Rafael D Teixeira
-//
-
-/*
- Todo:
-
- EVERYTHING
-
-*/
-
-
-namespace Mono.Languages.MonoBASIC
-{
- using System;
- using System.Text;
- using System.Collections;
- using System.IO;
- using System.Globalization;
- using Mono.Languages.MonoBASIC;
- using Mono.CSharp;
-
- /// <summary>
- /// Tokenizer for MonoBASIC source code.
- /// </summary>
-
- public class Tokenizer : yyParser.yyInput
- {
- TextReader reader;
- public string ref_name;
- public int ref_line = 1;
- public int line = 1;
- public int col = 1;
- public int current_token;
- bool handle_get_set = false;
-
- public string location {
- get {
- string det;
-
- if (current_token == Token.ERROR)
- det = "detail: " + error_details;
- else
- det = "";
-
- return "Line: "+line+" Col: "+col + "\n" +
- "VirtLine: "+ref_line +
- " Token: "+current_token + " " + det;
- }
- }
-
- public bool properties {
- get {
- return handle_get_set;
- }
-
- set {
- handle_get_set = value;
- }
- }
-
- //
- // Class variables
- //
- static Hashtable keywords;
- static NumberStyles styles;
- static NumberFormatInfo csharp_format_info;
-
- //
- // Values for the associated token returned
- //
- System.Text.StringBuilder number;
- int putback_char;
- Object val;
-
- //
- // Details about the error encoutered by the tokenizer
- //
- string error_details;
-
- public string error {
- get {
- return error_details;
- }
- }
-
- public int Line {
- get {
- return line;
- }
- }
-
- public int Col {
- get {
- return col;
- }
- }
-
- static void initTokens ()
- {
- keywords = new Hashtable ();
-
- keywords.Add ("addhandler", Token.ADDHANDLER);
- keywords.Add ("addressof", Token.ADDRESSOF);
- keywords.Add ("alias", Token.ALIAS);
- keywords.Add ("and", Token.AND);
- keywords.Add ("andalso", Token.ANDALSO);
- keywords.Add ("ansi", Token.ANSI);
- keywords.Add ("as", Token.AS);
- keywords.Add ("assembly", Token.ASSEMBLY);
- keywords.Add ("auto", Token.AUTO);
- keywords.Add ("boolean", Token.BOOLEAN);
- keywords.Add ("byref", Token.BYREF);
- keywords.Add ("byte", Token.BYTE);
- keywords.Add ("byval", Token.BYVAL);
- keywords.Add ("call", Token.CALL);
- keywords.Add ("case", Token.CASE);
- keywords.Add ("catch", Token.CATCH);
- keywords.Add ("cbool", Token.CBOOL);
- keywords.Add ("cbyte", Token.CBYTE);
- keywords.Add ("cchar", Token.CCHAR);
- keywords.Add ("cdate", Token.CDATE);
- keywords.Add ("cdec", Token.CDEC);
- keywords.Add ("cdbl", Token.CDBL);
- keywords.Add ("char", Token.CHAR);
- keywords.Add ("cint", Token.CINT);
- keywords.Add ("class", Token.CLASS);
- keywords.Add ("clng", Token.CLNG);
- keywords.Add ("cobj", Token.COBJ);
- //keywords.Add ("compare", Token.COMPARE);
- keywords.Add ("const", Token.CONST);
- keywords.Add ("cshort", Token.CSHORT);
- keywords.Add ("csng", Token.CSNG);
- keywords.Add ("cstr", Token.CSTR);
- keywords.Add ("ctype", Token.CTYPE);
- keywords.Add ("date", Token.DATE);
- keywords.Add ("decimal", Token.DECIMAL);
- keywords.Add ("declare", Token.DECLARE);
- keywords.Add ("default", Token.DEFAULT);
- keywords.Add ("delegate", Token.DELEGATE);
- keywords.Add ("dim", Token.DIM);
- keywords.Add ("do", Token.DO);
- keywords.Add ("double", Token.DOUBLE);
- keywords.Add ("each", Token.EACH);
- keywords.Add ("else", Token.ELSE);
- keywords.Add ("elseif", Token.ELSEIF);
- keywords.Add ("end", Token.END);
- keywords.Add ("enum", Token.ENUM);
- keywords.Add ("erase", Token.ERASE);
- keywords.Add ("error", Token.ERROR);
- keywords.Add ("event", Token.EVENT);
- keywords.Add ("exit", Token.EXIT);
- //keywords.Add ("explicit", Token.EXPLICIT);
- keywords.Add ("false", Token.FALSE);
- keywords.Add ("finally", Token.FINALLY);
- keywords.Add ("for", Token.FOR);
- keywords.Add ("friend", Token.FRIEND);
- keywords.Add ("function", Token.FUNCTION);
- keywords.Add ("get", Token.GET);
- keywords.Add ("gettype", Token.GETTYPE);
- keywords.Add ("goto", Token.GOTO);
- keywords.Add ("handles", Token.HANDLES);
- keywords.Add ("if", Token.IF);
- keywords.Add ("implements", Token.IMPLEMENTS);
- keywords.Add ("imports", Token.IMPORTS);
- keywords.Add ("in", Token.IN);
- keywords.Add ("inherits", Token.INHERITS);
- keywords.Add ("integer", Token.INTEGER);
- keywords.Add ("interface", Token.INTERFACE);
- keywords.Add ("is", Token.IS);
- keywords.Add ("let ", Token.LET );
- keywords.Add ("lib ", Token.LIB );
- keywords.Add ("like ", Token.LIKE );
- keywords.Add ("long", Token.LONG);
- keywords.Add ("loop", Token.LOOP);
- keywords.Add ("me", Token.ME);
- keywords.Add ("mod", Token.MOD);
- keywords.Add ("module", Token.MODULE);
- keywords.Add ("mustinherit", Token.MUSTINHERIT);
- keywords.Add ("mustoverride", Token.MUSTOVERRIDE);
- keywords.Add ("mybase", Token.MYBASE);
- keywords.Add ("myclass", Token.MYCLASS);
- keywords.Add ("namespace", Token.NAMESPACE);
- keywords.Add ("new", Token.NEW);
- keywords.Add ("next", Token.NEXT);
- keywords.Add ("not", Token.NOT);
- keywords.Add ("nothing", Token.NOTHING);
- keywords.Add ("notinheritable", Token.NOTINHERITABLE);
- keywords.Add ("notoverridable", Token.NOTOVERRIDABLE);
- keywords.Add ("object", Token.OBJECT);
- keywords.Add ("on", Token.ON);
- keywords.Add ("option", Token.OPTION);
- keywords.Add ("optional", Token.OPTIONAL);
- keywords.Add ("or", Token.OR);
- keywords.Add ("orelse", Token.ORELSE);
- keywords.Add ("overloads", Token.OVERLOADS);
- keywords.Add ("overridable", Token.OVERRIDABLE);
- keywords.Add ("overrides", Token.OVERRIDES);
- keywords.Add ("paramarray", Token.PARAM_ARRAY);
- keywords.Add ("preserve", Token.PRESERVE);
- keywords.Add ("private", Token.PRIVATE);
- keywords.Add ("property", Token.PROPERTY);
- keywords.Add ("protected", Token.PROTECTED);
- keywords.Add ("public", Token.PUBLIC);
- keywords.Add ("raiseevent", Token.RAISEEVENT);
- keywords.Add ("readonly", Token.READONLY);
- keywords.Add ("redim", Token.REDIM);
- keywords.Add ("rem", Token.REM);
- keywords.Add ("removehandler", Token.REMOVEHANDLER);
- keywords.Add ("resume", Token.RESUME);
- keywords.Add ("return", Token.RETURN);
- keywords.Add ("select", Token.SELECT);
- keywords.Add ("set", Token.SET);
- keywords.Add ("shadows", Token.SHADOWS);
- keywords.Add ("shared", Token.SHARED);
- keywords.Add ("short", Token.SHORT);
- keywords.Add ("single", Token.SINGLE);
- keywords.Add ("sizeof", Token.SIZEOF);
- keywords.Add ("static", Token.STATIC);
- keywords.Add ("step", Token.STEP);
- keywords.Add ("stop", Token.STOP);
- keywords.Add ("string", Token.STRING);
- keywords.Add ("structure", Token.STRUCTURE);
- keywords.Add ("sub", Token.SUB);
- keywords.Add ("synclock", Token.SYNCLOCK);
- keywords.Add ("then", Token.THEN);
- keywords.Add ("throw", Token.THROW);
- keywords.Add ("to", Token.TO);
- keywords.Add ("true", Token.TRUE);
- keywords.Add ("try", Token.TRY);
- keywords.Add ("typeof", Token.TYPEOF);
- keywords.Add ("unicode", Token.UNICODE);
- keywords.Add ("until", Token.UNTIL);
- keywords.Add ("variant", Token.VARIANT);
- keywords.Add ("when", Token.WHEN);
- keywords.Add ("while", Token.WHILE);
- keywords.Add ("with", Token.WITH);
- keywords.Add ("withevents", Token.WITHEVENTS);
- keywords.Add ("writeonly", Token.WRITEONLY);
- keywords.Add ("xor", Token.XOR);
- }
-
- //
- // Class initializer
- //
- static Tokenizer ()
- {
- initTokens ();
- csharp_format_info = new NumberFormatInfo ();
- csharp_format_info.CurrencyDecimalSeparator = ".";
- styles = NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint;
- }
-
- bool is_keyword (string name)
- {
- bool res;
-
- res = keywords.Contains(name.ToLower());
- if ((name == "get" || name == "set") && handle_get_set == false)
- return false;
- return res;
- }
-
- int getKeyword (string name)
- {
- return (int) (keywords [name.ToLower()]);
- }
-
- public Location Location {
- get {
- return new Location (ref_line);
- }
- }
-
- public Tokenizer (System.IO.TextReader input, string fname)
- {
- this.ref_name = fname;
- reader = input;
- putback_char = -1;
-
- Location.Push (fname);
- }
-
- bool is_identifier_start_character (char c)
- {
- return Char.IsLetter (c) || c == '_' ;
- }
-
- bool is_identifier_part_character (char c)
- {
- return (Char.IsLetter (c) || Char.IsDigit (c) || c == '_');
- }
-
- int is_punct (char c, ref bool doread)
- {
- int idx = "{}[](),:;~+-*/%&|^!=<>?".IndexOf (c);
- int d;
- int t;
-
- doread = false;
-
- switch (c){
- case '[':
- return Token.OPEN_BRACKET;
- case ']':
- return Token.CLOSE_BRACKET;
- case '(':
- return Token.OPEN_PARENS;
- case ')':
- return Token.CLOSE_PARENS;
- case ',':
- return Token.COMMA;
- case ':':
- return Token.COLON;
- case '?':
- return Token.INTERR;
- }
-
- d = peekChar ();
- if (c == '+'){
-
- if (d == '+')
- t = Token.OP_INC;
- else if (d == '=')
- t = Token.OP_ADD_ASSIGN;
- else
- return Token.PLUS;
- doread = true;
- return t;
- }
- if (c == '-'){
- if (d == '=')
- t = Token.OP_SUB_ASSIGN;
- else
- return Token.MINUS;
- doread = true;
- return t;
- }
-
- if (c == '='){
- /*if (d == '='){
- doread = true;
- return Token.OP_EQ;
- }*/
- return Token.ASSIGN;
- }
-
- if (c == '*'){
- if (d == '='){
- doread = true;
- return Token.OP_MULT_ASSIGN;
- }
- return Token.STAR;
- }
-
- if (c == '/'){
- if (d == '='){
- doread = true;
- return Token.OP_DIV_ASSIGN;
- }
- return Token.DIV;
- }
-
- if (c == '\\'){
- if (d == '='){
- doread = true;
- return Token.OP_IDIV_ASSIGN;
- }
- return Token.OP_IDIV;
- }
-
- if (c == '^'){
- if (d == '='){
- doread = true;
- return Token.OP_EXP_ASSIGN;
- }
- return Token.OP_EXP;
- }
-
- if (c == '<'){
- if (d == '>')
- {
- doread = true;
- return Token.OP_NE;
- }
- if (d == '='){
- doread = true;
- return Token.OP_LE;
- }
- return Token.OP_LT;
- }
-
- if (c == '>'){
- if (d == '='){
- doread = true;
- return Token.OP_GE;
- }
- return Token.OP_GT;
- }
- return Token.ERROR;
- }
-
- bool decimal_digits (int c)
- {
- int d;
- bool seen_digits = false;
-
- if (c != -1)
- number.Append ((char) c);
-
- while ((d = peekChar ()) != -1){
- if (Char.IsDigit ((char)d)){
- number.Append ((char) d);
- getChar ();
- seen_digits = true;
- } else
- break;
- }
- return seen_digits;
- }
-
- void hex_digits (int c)
- {
- int d;
-
- if (c != -1)
- number.Append ((char) c);
- while ((d = peekChar ()) != -1){
- char e = Char.ToUpper ((char) d);
-
- if (Char.IsDigit (e) ||
- (e >= 'A' && e <= 'F')){
- number.Append ((char) e);
- getChar ();
- } else
- break;
- }
- }
-
- int real_type_suffix (int c)
- {
- int t;
-
- switch (c){
- case 'F': case 'f':
- t = Token.LITERAL_SINGLE;
- break;
- case 'D': case 'd':
- t = Token.LITERAL_DOUBLE;
- break;
- case 'M': case 'm':
- t= Token.LITERAL_DECIMAL;
- break;
- default:
- return Token.NONE;
- }
- getChar ();
- return t;
- }
-
- int integer_type_suffix (int c)
- {
- // FIXME: Handle U and L suffixes.
- // We also need to see in which kind of
- // Int the thing fits better according to the spec.
- return Token.LITERAL_INTEGER;
- }
-
- void adjust_int (int t)
- {
- val = new System.Int32();
- val = System.Int32.Parse (number.ToString (), 0);
- }
-
- int adjust_real (int t)
- {
- string s = number.ToString ();
-
- Console.WriteLine (s);
- switch (t){
- case Token.LITERAL_DECIMAL:
- val = new System.Decimal ();
- val = System.Decimal.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_DOUBLE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- break;
- case Token.LITERAL_SINGLE:
- val = new System.Double ();
- val = (float) System.Double.Parse (
- s, styles, csharp_format_info);
- break;
-
- case Token.NONE:
- val = new System.Double ();
- val = System.Double.Parse (
- s, styles, csharp_format_info);
- t = Token.LITERAL_DOUBLE;
- break;
- }
- return t;
- }
-
- //
- // Invoked if we know we have .digits or digits
- //
- int is_number (int c)
- {
- bool is_real = false;
- number = new System.Text.StringBuilder ();
- int type;
-
- number.Length = 0;
-
- if (Char.IsDigit ((char)c)){
- if (c == '0' && peekChar () == 'x' || peekChar () == 'X'){
- getChar ();
- hex_digits (-1);
- val = new System.Int32 ();
- val = System.Int32.Parse (number.ToString (), NumberStyles.HexNumber);
- return integer_type_suffix (peekChar ());
- }
- decimal_digits (c);
- c = getChar ();
- }
-
- //
- // We need to handle the case of
- // "1.1" vs "1.string" (LITERAL_SINGLE vs NUMBER DOT IDENTIFIER)
- //
- if (c == '.'){
- if (decimal_digits ('.')){
- is_real = true;
- c = peekChar ();
- } else {
- putback ('.');
- number.Length -= 1;
- adjust_int (Token.LITERAL_INTEGER);
- return Token.LITERAL_INTEGER;
- }
- }
-
- if (c == 'e' || c == 'E'){
- is_real = true;
- number.Append ("e");
- getChar ();
-
- c = peekChar ();
- if (c == '+'){
- number.Append ((char) c);
- getChar ();
- c = peekChar ();
- } else if (c == '-'){
- number.Append ((char) c);
- getChar ();
- c = peekChar ();
- }
- decimal_digits (-1);
- c = peekChar ();
- }
-
- type = real_type_suffix (c);
- if (type == Token.NONE && !is_real){
- type = integer_type_suffix (c);
- adjust_int (type);
- putback (c);
- return type;
- } else
- is_real = true;
-
- if (is_real)
- return adjust_real (type);
-
- Console.WriteLine ("This should not be reached");
- throw new Exception ("Is Number should never reach this point");
- }
-
- int escape (int c)
- {
- int d;
- int v;
-
- d = peekChar ();
- if (c != '\\')
- return c;
-
- switch (d){
- case 'a':
- v = '\a'; break;
- case 'b':
- v = '\b'; break;
- case 'n':
- v = '\n'; break;
- case 't':
- v = '\t'; break;
- case 'v':
- v = '\v'; break;
- case 'r':
- v = 'c'; break;
- case '\\':
- v = '\\'; break;
- case 'f':
- v = '\f'; break;
- case '0':
- v = 0; break;
- case '"':
- v = '"'; break;
- case '\'':
- v = '\''; break;
- default:
- error_details = "cs1009: Unrecognized escape sequence " + (char)d;
- return -1;
- }
- getChar ();
- return v;
- }
-
- int getChar ()
- {
- if (putback_char != -1){
- int x = putback_char;
- putback_char = -1;
-
- return x;
- }
- return reader.Read ();
- }
-
- int peekChar ()
- {
- if (putback_char != -1)
- return putback_char;
- return reader.Peek ();
- }
-
- void putback (int c)
- {
- if (putback_char != -1)
- throw new Exception ("This should not happen putback on putback");
- putback_char = c;
- }
-
- public bool advance ()
- {
- return current_token != Token.EOF ;
- }
-
- public Object Value {
- get {
- return val;
- }
- }
-
- public Object value ()
- {
- return val;
- }
-
- public int token ()
- {
- current_token = xtoken ();
- if (current_token == 0)
- return Token.EOF;
- return current_token;
- }
-
- public int xtoken ()
- {
- int t;
- bool allow_keyword_as_ident = false;
- bool doread = false;
- int c;
-
- val = null;
- for (;(c = getChar ()) != -1; col++) {
-
- // Handle line comments.
- if (c == '\''){
- int d = getChar ();
- while ((d = getChar ()) != -1 && (d != '\n'))
- col++;
- line++;
- ref_line++;
- col = 0;
- if (current_token == Token.EOL) // if last token was also EOL keep skipping
- continue;
- return Token.EOL;
- }
-
- // Handle EOL.
- if (c == '\n')
- {
- line++;
- ref_line++;
- col = 0;
- if (current_token == Token.EOL) // if last token was also EOL keep skipping
- continue;
- return Token.EOL;
- }
-
- // Handle identifiers
- if (is_identifier_start_character ((char) c)){
- System.Text.StringBuilder id = new System.Text.StringBuilder ();
- string ids;
-
- id.Append ((char) c);
-
- while ((c = peekChar ()) != -1) {
- if (is_identifier_part_character ((char) c)){
- id.Append ((char)getChar ());
- col++;
- } else
- break;
- }
-
- ids = id.ToString ();
-
- if (!is_keyword (ids) || allow_keyword_as_ident) {
- val = ids;
- return Token.IDENTIFIER;
- }
-
- // true, false and null are in the hash anyway.
- return getKeyword (ids);
-
- }
-
- if (c == '.'){
- if (Char.IsDigit ((char) peekChar ()))
- return is_number (c);
- return Token.DOT;
- }
-
- if (Char.IsDigit ((char) c))
- return is_number (c);
-
- /* For now, ignore pre-processor commands */
- if (col == 1 && c == '#'){
- System.Text.StringBuilder s = new System.Text.StringBuilder ();
-
- while ((c = getChar ()) != -1 && (c != '\n')){
- s.Append ((char) c);
- }
- if (String.Compare (s.ToString (), 0, "line", 0, 4) == 0){
- string arg = s.ToString ().Substring (5);
- int pos;
-
- if ((pos = arg.IndexOf (' ')) != -1 && pos != 0){
- ref_line = System.Int32.Parse (arg.Substring (0, pos));
- pos++;
-
- char [] quotes = { '\"' };
-
- ref_name = arg.Substring (pos);
- ref_name.TrimStart (quotes);
- ref_name.TrimEnd (quotes);
- } else
- ref_line = System.Int32.Parse (arg);
- }
- line++;
- ref_line++;
- continue;
- }
-
- if ((t = is_punct ((char)c, ref doread)) != Token.ERROR){
- if (doread){
- getChar ();
- col++;
- }
- return t;
- }
-
- if (c == '"'){
- System.Text.StringBuilder s = new System.Text.StringBuilder ();
-
- while ((c = getChar ()) != -1){
- if (c == '"'){
- val = s.ToString ();
- return Token.LITERAL_STRING;
- }
-
- c = escape (c);
- if (c == -1)
- return Token.ERROR;
- s.Append ((char) c);
- }
- }
-
- // white space
- if (c == ' ' || c == '\t' || c == '\f' || c == '\v' || c == '\r'){
- if (c == '\t')
- col = (((col + 8) / 8) * 8) - 1;
-
- continue;
- }
-
- if (c == '@'){
- allow_keyword_as_ident = true;
- continue;
- }
-
- error_details = ((char)c).ToString ();
-
- return Token.ERROR;
- }
-
- if (current_token != Token.EOL) // if last token wasn´t EOL send it before EOF
- return Token.EOL;
-
- return Token.EOF;
- }
- }
-}
diff --git a/mcs/mcs/mcs.exe.config b/mcs/mcs/mcs.exe.config
index cf61d4baa0b..922daaf05fd 100644
--- a/mcs/mcs/mcs.exe.config
+++ b/mcs/mcs/mcs.exe.config
@@ -1,4 +1,7 @@
<configuration>
+ <startup>
+ <supportedRuntime version="v1.1.4322"/>
+ </startup>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
diff --git a/mcs/mcs/mcs.exe.sources b/mcs/mcs/mcs.exe.sources
new file mode 100644
index 00000000000..c9880149f0d
--- /dev/null
+++ b/mcs/mcs/mcs.exe.sources
@@ -0,0 +1,36 @@
+AssemblyInfo.cs
+anonymous.cs
+assign.cs
+attribute.cs
+driver.cs
+cs-tokenizer.cs
+cfold.cs
+class.cs
+codegen.cs
+const.cs
+constant.cs
+convert.cs
+decl.cs
+delegate.cs
+enum.cs
+ecore.cs
+expression.cs
+flowanalysis.cs
+iterators.cs
+literal.cs
+location.cs
+modifiers.cs
+namespace.cs
+parameter.cs
+pending.cs
+report.cs
+rootcontext.cs
+statement.cs
+support.cs
+typemanager.cs
+symbolwriter.cs
+tree.cs
+../class/Mono.CSharp.Debugger/MonoSymbolFile.cs
+../class/Mono.CSharp.Debugger/MonoSymbolTable.cs
+../class/Mono.CSharp.Debugger/MonoSymbolWriter.cs
+../class/corlib/Mono.Security.Cryptography/CryptoConvert.cs
diff --git a/mcs/mcs/modifiers.cs b/mcs/mcs/modifiers.cs
index 4c114035836..922d67dab48 100755
--- a/mcs/mcs/modifiers.cs
+++ b/mcs/mcs/modifiers.cs
@@ -27,8 +27,15 @@ namespace Mono.CSharp {
public const int UNSAFE = 0x2000;
public const int TOP = 0x2000;
+ //
+ // We use this internally to flag that the method contains an iterator
+ //
+ public const int METHOD_YIELDS = 0x8000;
+
public const int Accessibility =
PUBLIC | PROTECTED | INTERNAL | PRIVATE;
+ public const int AllowedExplicitImplFlags =
+ UNSAFE | EXTERN;
static public string Name (int i)
{
@@ -61,17 +68,18 @@ namespace Mono.CSharp {
s = "extern"; break;
case Modifiers.VOLATILE:
s = "volatile"; break;
+ case Modifiers.UNSAFE:
+ s = "unsafe"; break;
}
return s;
}
- public static TypeAttributes TypeAttr (int mod_flags, TypeContainer caller)
+ public static TypeAttributes TypeAttr (int mod_flags, bool is_toplevel)
{
TypeAttributes t = 0;
- bool top_level = caller.IsTopLevel;
- if (top_level){
+ if (is_toplevel){
if ((mod_flags & PUBLIC) != 0)
t |= TypeAttributes.Public;
if ((mod_flags & PRIVATE) != 0)
@@ -94,9 +102,17 @@ namespace Mono.CSharp {
if ((mod_flags & ABSTRACT) != 0)
t |= TypeAttributes.Abstract;
+ return t;
+ }
+
+ public static TypeAttributes TypeAttr (int mod_flags, TypeContainer caller)
+ {
+ TypeAttributes t = TypeAttr (mod_flags, caller.IsTopLevel);
+
// If we do not have static constructors, static methods
// can be invoked without initializing the type.
- if (!caller.HaveStaticConstructor)
+ if (!caller.UserDefinedStaticConstructor &&
+ (caller.Kind != Kind.Interface))
t |= TypeAttributes.BeforeFieldInit;
return t;
@@ -130,7 +146,7 @@ namespace Mono.CSharp {
public static MethodAttributes MethodAttr (int mod_flags)
{
- MethodAttributes ma = 0;
+ MethodAttributes ma = MethodAttributes.HideBySig;
if ((mod_flags & PUBLIC) != 0)
ma |= MethodAttributes.Public;
@@ -149,8 +165,7 @@ namespace Mono.CSharp {
if ((mod_flags & STATIC) != 0)
ma |= MethodAttributes.Static;
if ((mod_flags & ABSTRACT) != 0){
- ma |= MethodAttributes.Abstract | MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
+ ma |= MethodAttributes.Abstract | MethodAttributes.Virtual;
}
if ((mod_flags & SEALED) != 0)
ma |= MethodAttributes.Final;
@@ -159,15 +174,12 @@ namespace Mono.CSharp {
ma |= MethodAttributes.Virtual;
if ((mod_flags & OVERRIDE) != 0)
- ma |= MethodAttributes.Virtual | MethodAttributes.HideBySig;
+ ma |= MethodAttributes.Virtual;
else {
if ((ma & MethodAttributes.Virtual) != 0)
ma |= MethodAttributes.NewSlot;
}
- if ((mod_flags & NEW) != 0)
- ma |= MethodAttributes.HideBySig;
-
return ma;
}
@@ -187,7 +199,7 @@ namespace Mono.CSharp {
if ((mod & Modifiers.UNSAFE) != 0){
if (!RootContext.Unsafe){
Report.Error (227, l,
- "Unsafe code requires the --unsafe command " +
+ "Unsafe code requires the -unsafe command " +
"line option to be specified");
}
}
@@ -217,15 +229,19 @@ namespace Mono.CSharp {
return mod;
}
- for (i = 1; i < TOP; i <<= 1){
+ for (i = 1; i <= TOP; i <<= 1){
if ((i & invalid_flags) == 0)
continue;
- Report.Error (106, l, "the modifier `" + Name (i) +
- "' is not valid for this item");
+ Error_InvalidModifier (l, Name (i));
}
return allowed & mod;
}
+
+ public static void Error_InvalidModifier (Location l, string name)
+ {
+ Report.Error (106, l, "the modifier " + name + " is not valid for this item");
+ }
}
}
diff --git a/mcs/mcs/namespace.cs b/mcs/mcs/namespace.cs
index 215a07e6270..e73f8f89319 100755
--- a/mcs/mcs/namespace.cs
+++ b/mcs/mcs/namespace.cs
@@ -8,7 +8,6 @@
//
using System;
using System.Collections;
-using Mono.Languages;
namespace Mono.CSharp {
@@ -16,12 +15,15 @@ namespace Mono.CSharp {
/// Keeps track of the namespaces defined in the C# code.
/// </summary>
public class Namespace {
- Namespace parent;
- string name;
- ArrayList using_clauses;
- Hashtable aliases;
- bool decl_found = false;
+ static ArrayList all_namespaces = new ArrayList ();
+ static Hashtable namespaces_map = new Hashtable ();
+ Namespace parent;
+ string fullname;
+ ArrayList entries;
+ Hashtable namespaces;
+ Hashtable defined_names;
+
/// <summary>
/// Constructor Takes the current namespace and the
/// name. This is bootstrapped with parent == null
@@ -29,8 +31,106 @@ namespace Mono.CSharp {
/// </summary>
public Namespace (Namespace parent, string name)
{
- this.name = name;
this.parent = parent;
+
+ string pname = parent != null ? parent.Name : "";
+
+ if (pname == "")
+ fullname = name;
+ else
+ fullname = parent.Name + "." + name;
+
+ entries = new ArrayList ();
+ namespaces = new Hashtable ();
+ defined_names = new Hashtable ();
+
+ all_namespaces.Add (this);
+ if (namespaces_map.Contains (fullname))
+ return;
+ namespaces_map [fullname] = true;
+ }
+
+ public static bool IsNamespace (string name)
+ {
+ return namespaces_map [name] != null;
+ }
+
+ public static Namespace Root = new Namespace (null, "");
+
+ public Namespace GetNamespace (string name, bool create)
+ {
+ int pos = name.IndexOf ('.');
+
+ Namespace ns;
+ string first;
+ if (pos >= 0)
+ first = name.Substring (0, pos);
+ else
+ first = name;
+
+ ns = (Namespace) namespaces [first];
+ if (ns == null) {
+ if (!create)
+ return null;
+
+ ns = new Namespace (this, first);
+ namespaces.Add (first, ns);
+ }
+
+ if (pos >= 0)
+ ns = ns.GetNamespace (name.Substring (pos + 1), create);
+
+ return ns;
+ }
+
+ public static Namespace LookupNamespace (string name, bool create)
+ {
+ return Root.GetNamespace (name, create);
+ }
+
+ public object Lookup (DeclSpace ds, string name)
+ {
+ object o = Lookup (name);
+
+ Type t;
+ DeclSpace tdecl = o as DeclSpace;
+ if (tdecl != null) {
+ t = tdecl.DefineType ();
+
+ if ((ds == null) || ds.CheckAccessLevel (t))
+ return t;
+ }
+
+ Namespace ns = GetNamespace (name, false);
+ if (ns != null)
+ return ns;
+
+ t = TypeManager.LookupType (DeclSpace.MakeFQN (fullname, name));
+ if ((t == null) || ((ds != null) && !ds.CheckAccessLevel (t)))
+ return null;
+
+ return t;
+ }
+
+ public void AddNamespaceEntry (NamespaceEntry entry)
+ {
+ entries.Add (entry);
+ }
+
+ public void DefineName (string name, object o)
+ {
+ defined_names.Add (name, o);
+ }
+
+ public object Lookup (string name)
+ {
+ return defined_names [name];
+ }
+
+ static public ArrayList UserDefinedNamespaces {
+ get {
+ return all_namespaces;
+ }
}
/// <summary>
@@ -38,12 +138,7 @@ namespace Mono.CSharp {
/// </summary>
public string Name {
get {
- string pname = parent != null ? parent.Name : "";
-
- if (pname == "")
- return name;
- else
- return parent.Name + "." + name;
+ return fullname;
}
}
@@ -57,83 +152,461 @@ namespace Mono.CSharp {
}
}
+ public static void DefineNamespaces (SymbolWriter symwriter)
+ {
+ foreach (Namespace ns in all_namespaces) {
+ foreach (NamespaceEntry entry in ns.entries)
+ entry.DefineNamespace (symwriter);
+ }
+ }
+
/// <summary>
- /// When a declaration is found in a namespace,
- /// we call this function, to emit an error if the
- /// program attempts to use a using clause afterwards
+ /// Used to validate that all the using clauses are correct
+ /// after we are finished parsing all the files.
/// </summary>
- public void DeclarationFound ()
+ public static void VerifyUsing ()
+ {
+ foreach (Namespace ns in all_namespaces) {
+ foreach (NamespaceEntry entry in ns.entries)
+ entry.VerifyUsing ();
+ }
+ }
+
+ public override string ToString ()
+ {
+ if (this == Root)
+ return "Namespace (<root>)";
+ else
+ return String.Format ("Namespace ({0})", Name);
+ }
+ }
+
+ public class NamespaceEntry
+ {
+ Namespace ns;
+ NamespaceEntry parent, implicit_parent;
+ SourceFile file;
+ int symfile_id;
+ Hashtable aliases;
+ ArrayList using_clauses;
+ public bool DeclarationFound = false;
+
+ //
+ // This class holds the location where a using definition is
+ // done, and whether it has been used by the program or not.
+ //
+ // We use this to flag using clauses for namespaces that do not
+ // exist.
+ //
+ public class UsingEntry {
+ public readonly string Name;
+ public readonly NamespaceEntry NamespaceEntry;
+ public readonly Location Location;
+
+ public UsingEntry (NamespaceEntry entry, string name, Location loc)
+ {
+ Name = name;
+ NamespaceEntry = entry;
+ Location = loc;
+ }
+
+ Namespace resolved_ns;
+
+ public Namespace Resolve ()
+ {
+ if (resolved_ns != null)
+ return resolved_ns;
+
+ Namespace curr_ns = NamespaceEntry.NS;
+ while ((curr_ns != null) && (resolved_ns == null)) {
+ resolved_ns = curr_ns.GetNamespace (Name, false);
+
+ if (resolved_ns == null)
+ curr_ns = curr_ns.Parent;
+ }
+
+ return resolved_ns;
+ }
+ }
+
+ public class AliasEntry {
+ public readonly string Name;
+ public readonly MemberName Alias;
+ public readonly NamespaceEntry NamespaceEntry;
+ public readonly Location Location;
+
+ public AliasEntry (NamespaceEntry entry, string name, MemberName alias, Location loc)
+ {
+ Name = name;
+ Alias = alias;
+ NamespaceEntry = entry;
+ Location = loc;
+ }
+
+ object resolved;
+
+ public object Resolve ()
+ {
+ if (resolved != null)
+ return resolved;
+
+ string alias = Alias.GetPartialName ();
+
+ // According to section 16.3.1, the namespace-or-type-name is resolved
+ // as if the immediately containing namespace body has no using-directives.
+ resolved = NamespaceEntry.Lookup (null, alias, true, Location);
+
+ NamespaceEntry curr_ns = NamespaceEntry.Parent;
+
+ while ((curr_ns != null) && (resolved == null)) {
+ resolved = curr_ns.Lookup (null, alias, false, Location);
+
+ if (resolved == null)
+ curr_ns = curr_ns.Parent;
+ }
+
+ return resolved;
+ }
+ }
+
+ public NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, Location loc)
+ : this (parent, file, name, false, loc)
+ { }
+
+ protected NamespaceEntry (NamespaceEntry parent, SourceFile file, string name, bool is_implicit, Location loc)
+ {
+ this.parent = parent;
+ this.file = file;
+ this.IsImplicit = is_implicit;
+ this.ID = ++next_id;
+
+ if (!is_implicit && (parent != null))
+ ns = parent.NS.GetNamespace (name, true);
+ else if (name != null)
+ ns = Namespace.LookupNamespace (name, true);
+ else
+ ns = Namespace.Root;
+ ns.AddNamespaceEntry (this);
+
+ if ((parent != null) && (parent.NS != ns.Parent))
+ implicit_parent = new NamespaceEntry (parent, file, ns.Parent.Name, true, loc);
+ else
+ implicit_parent = parent;
+
+ this.FullName = ns.Name;
+ }
+
+ static int next_id = 0;
+ public readonly string FullName;
+ public readonly int ID;
+ public readonly bool IsImplicit;
+
+ public Namespace NS {
+ get {
+ return ns;
+ }
+ }
+
+ public NamespaceEntry Parent {
+ get {
+ return parent;
+ }
+ }
+
+ public NamespaceEntry ImplicitParent {
+ get {
+ return implicit_parent;
+ }
+ }
+
+ public void DefineName (string name, object o)
{
- decl_found = true;
+ ns.DefineName (name, o);
}
/// <summary>
/// Records a new namespace for resolving name references
/// </summary>
- public void Using (string ns)
+ public void Using (string ns, Location loc)
{
- if (decl_found){
- Report.Error (1529, "A using clause must precede all other namespace elements");
+ if (DeclarationFound){
+ Report.Error (1529, loc, "A using clause must precede all other namespace elements");
return;
}
+ if (ns == FullName)
+ return;
+
if (using_clauses == null)
using_clauses = new ArrayList ();
- using_clauses.Add (ns);
- }
-
- public ArrayList UsingTable {
- get {
- return using_clauses;
+ foreach (UsingEntry old_entry in using_clauses) {
+ if (old_entry.Name == ns) {
+ if (RootContext.WarningLevel >= 3)
+ Report.Warning (105, loc, "The using directive for '{0}' appeared previously in this namespace", ns);
+ return;
+ }
}
+
+ UsingEntry ue = new UsingEntry (this, ns, loc);
+ using_clauses.Add (ue);
}
- public void UsingAlias (string alias, string namespace_or_type, Location loc)
+ public void UsingAlias (string name, MemberName alias, Location loc)
{
+ if (DeclarationFound){
+ Report.Error (1529, loc, "A using clause must precede all other namespace elements");
+ return;
+ }
+
if (aliases == null)
aliases = new Hashtable ();
- if (aliases.Contains (alias)){
- Report.Error (1537, loc, "The using alias `" + alias +
+ if (aliases.Contains (name)){
+ Report.Error (1537, loc, "The using alias `" + name +
"' appeared previously in this namespace");
return;
}
-
- aliases [alias] = namespace_or_type;
+
+ aliases [name] = new AliasEntry (this, name, alias, loc);
+ }
+
+ protected AliasEntry GetAliasEntry (string alias)
+ {
+ AliasEntry entry = null;
+
+ if (aliases != null)
+ entry = (AliasEntry) aliases [alias];
+ if (entry == null && Parent != null)
+ entry = Parent.GetAliasEntry (alias);
+
+ return entry;
}
public string LookupAlias (string alias)
{
- string value = null;
+ AliasEntry entry = GetAliasEntry (alias);
- // System.Console.WriteLine ("Lookup " + alias + " in " + name);
+ if (entry == null)
+ return null;
- if (aliases != null)
- value = (string) (aliases [alias]);
- if (value == null && Parent != null)
- value = Parent.LookupAlias (alias);
+ object resolved = entry.Resolve ();
+ if (resolved == null)
+ return null;
+ else if (resolved is Namespace)
+ return ((Namespace) resolved).Name;
+ else
+ return ((Type) resolved).FullName;
+ }
+
+ public object Lookup (DeclSpace ds, string name, bool ignore_using, Location loc)
+ {
+ object o;
+ Namespace ns;
+
+ //
+ // If name is of the form `N.I', first lookup `N', then search a member `I' in it.
+ //
+ int pos = name.IndexOf ('.');
+ if (pos >= 0) {
+ string first = name.Substring (0, pos);
+ string last = name.Substring (pos + 1);
+
+ o = Lookup (ds, first, ignore_using, loc);
+ if (o == null)
+ return null;
+
+ ns = o as Namespace;
+ if (ns != null)
+ return ns.Lookup (ds, last);
+
+ Type nested = TypeManager.LookupType ((((Type) o).Name + "." + last));
+ if ((nested == null) || ((ds != null) && !ds.CheckAccessLevel (nested)))
+ return null;
+
+ return nested;
+ }
+
+ //
+ // Check whether it's a namespace.
+ //
+ o = NS.Lookup (ds, name);
+ if (o != null)
+ return o;
+
+ if (ignore_using)
+ return null;
+
+ //
+ // Check aliases.
+ //
+ AliasEntry entry = GetAliasEntry (name);
+ if (entry != null) {
+ o = entry.Resolve ();
+ if (o != null)
+ return o;
+ }
+
+ if (name.IndexOf ('.') > 0)
+ return null;
- return value;
+ //
+ // Check using entries.
+ //
+ Type t = null, match = null;
+ foreach (Namespace using_ns in GetUsingTable ()) {
+ match = using_ns.Lookup (ds, name) as Type;
+ if (match != null){
+ if (t != null) {
+ DeclSpace.Error_AmbiguousTypeReference (loc, name, t, match);
+ return null;
+ } else {
+ t = match;
+ }
+ }
+ }
+
+ return t;
+ }
+
+ // Our cached computation.
+ Namespace [] namespace_using_table;
+ public Namespace[] GetUsingTable ()
+ {
+ if (namespace_using_table != null)
+ return namespace_using_table;
+
+ if (using_clauses == null)
+ return new Namespace [0];
+
+ ArrayList list = new ArrayList (using_clauses.Count);
+
+ foreach (UsingEntry ue in using_clauses) {
+ Namespace using_ns = ue.Resolve ();
+ if (using_ns == null)
+ continue;
+
+ list.Add (using_ns);
+ }
+
+ namespace_using_table = new Namespace [list.Count];
+ list.CopyTo (namespace_using_table, 0);
+ return namespace_using_table;
+ }
+
+ public void DefineNamespace (SymbolWriter symwriter)
+ {
+ if (symfile_id != 0)
+ return;
+ if (parent != null)
+ parent.DefineNamespace (symwriter);
+
+ string[] using_list;
+ if (using_clauses != null) {
+ using_list = new string [using_clauses.Count];
+ for (int i = 0; i < using_clauses.Count; i++)
+ using_list [i] = ((UsingEntry) using_clauses [i]).Name;
+ } else {
+ using_list = new string [0];
+ }
+
+ int parent_id = parent != null ? parent.symfile_id : 0;
+ if (file.SourceFileEntry == null)
+ return;
+
+ symfile_id = symwriter.DefineNamespace (
+ ns.Name, file.SourceFileEntry, using_list, parent_id);
+ }
+
+ public int SymbolFileID {
+ get {
+ return symfile_id;
+ }
+ }
+
+ static void Msgtry (string s)
+ {
+ Console.WriteLine (" Try using -r:" + s);
+ }
+
+ protected void error246 (Location loc, string name)
+ {
+ if (TypeManager.LookupType (name) != null)
+ Report.Error (138, loc, "The using keyword only lets you specify a namespace, " +
+ "`" + name + "' is a class not a namespace.");
+ else {
+ Report.Error (246, loc, "The namespace `" + name +
+ "' can not be found (missing assembly reference?)");
+
+ switch (name){
+ case "Gtk": case "GtkSharp":
+ Msgtry ("gtk-sharp");
+ break;
+
+ case "Gdk": case "GdkSharp":
+ Msgtry ("gdk-sharp");
+ break;
+
+ case "Glade": case "GladeSharp":
+ Msgtry ("glade-sharp");
+ break;
+
+ case "System.Drawing":
+ Msgtry ("System.Drawing");
+ break;
+
+ case "System.Web.Services":
+ Msgtry ("System.Web.Services");
+ break;
+
+ case "System.Web":
+ Msgtry ("System.Web");
+ break;
+
+ case "System.Data":
+ Msgtry ("System.Data");
+ break;
+
+ case "System.Windows.Forms":
+ Msgtry ("System.Windows.Forms");
+ break;
+ }
+ }
}
/// <summary>
/// Used to validate that all the using clauses are correct
- /// after we are finished parsing all the files
+ /// after we are finished parsing all the files.
/// </summary>
public void VerifyUsing ()
{
- foreach (DictionaryEntry de in using_clauses){
- if (de.Value == null){
- string name = (string) de.Key;
-
- Report.Error (234, "The type or namespace `" +
- name + "' does not exist in the " +
- "class or namespace `" + name + "'");
+ if (using_clauses != null){
+ foreach (UsingEntry ue in using_clauses){
+ if (ue.Resolve () != null)
+ continue;
+
+ error246 (ue.Location, ue.Name);
+ }
+ }
+
+ if (aliases != null){
+ foreach (DictionaryEntry de in aliases){
+ AliasEntry alias = (AliasEntry) de.Value;
+
+ if (alias.Resolve () != null)
+ continue;
+
+ error246 (alias.Location, alias.Alias.GetPartialName ());
}
}
}
+ public override string ToString ()
+ {
+ if (NS == Namespace.Root)
+ return "NamespaceEntry (<root>)";
+ else
+ return String.Format ("NamespaceEntry ({0},{1},{2})", FullName, IsImplicit, ID);
+ }
}
}
-
diff --git a/mcs/mcs/old-code.cs b/mcs/mcs/old-code.cs
index 271ffa2a7f5..cb7c31a0e26 100755
--- a/mcs/mcs/old-code.cs
+++ b/mcs/mcs/old-code.cs
@@ -149,6 +149,7 @@
error176 (loc, pe.PropertyInfo.Name);
return null;
}
+ Console.WriteLine ("HERE *************");
pe.InstanceExpression = left;
return pe;
diff --git a/mcs/mcs/parameter.cs b/mcs/mcs/parameter.cs
index 9ad2daa7b6d..209cd0a2d44 100755
--- a/mcs/mcs/parameter.cs
+++ b/mcs/mcs/parameter.cs
@@ -16,62 +16,188 @@ using System.Collections;
namespace Mono.CSharp {
+ /// <summary>
+ /// Abstract Base class for parameters of a method.
+ /// </summary>
+ public abstract class ParameterBase : Attributable {
+
+ protected ParameterBuilder builder;
+
+ public ParameterBase (Attributes attrs)
+ : base (attrs)
+ {
+ }
+
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
+ {
+ if (a.Type == TypeManager.marshal_as_attr_type) {
+ UnmanagedMarshal marshal = a.GetMarshal (this);
+ if (marshal != null) {
+ builder.SetMarshal (marshal);
+ }
+ return;
+ }
+
+ if (a.Type.IsSubclassOf (TypeManager.security_attr_type)) {
+ a.Error_InvalidSecurityParent ();
+ return;
+ }
+
+ builder.SetCustomAttribute (cb);
+ }
+
+ public override bool IsClsCompliaceRequired(DeclSpace ds)
+ {
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// Class for applying custom attributes on the return type
+ /// </summary>
+ public class ReturnParameter: ParameterBase {
+ public ReturnParameter (MethodBuilder mb, Location location):
+ base (null)
+ {
+ try {
+ builder = mb.DefineParameter (0, ParameterAttributes.None, "");
+ }
+ catch (ArgumentOutOfRangeException) {
+ Report.Warning (-28, location, "The Microsoft .NET Runtime 1.x does not permit setting custom attributes on the return type");
+ }
+ }
+
+ public override void ApplyAttributeBuilder(Attribute a, CustomAttributeBuilder cb)
+ {
+ // This occurs after Warning -28
+ if (builder == null)
+ return;
+
+ base.ApplyAttributeBuilder (a, cb);
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.ReturnValue;
+ }
+ }
+
+ /// <summary>
+ /// Is never called
+ /// </summary>
+ public override string[] ValidAttributeTargets {
+ get {
+ return null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Class for applying custom attributes on the implicit parameter type
+ /// of the 'set' method in properties, and the 'add' and 'remove' methods in events.
+ /// </summary>
+ public class ImplicitParameter: ParameterBase {
+ public ImplicitParameter (MethodBuilder mb):
+ base (null)
+ {
+ builder = mb.DefineParameter (1, ParameterAttributes.None, "");
+ }
+
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Parameter;
+ }
+ }
+
+ /// <summary>
+ /// Is never called
+ /// </summary>
+ public override string[] ValidAttributeTargets {
+ get {
+ return null;
+ }
+ }
+ }
/// <summary>
/// Represents a single method parameter
/// </summary>
- public class Parameter {
+
+ //TODO: Add location member to this or base class for better error location and all methods simplification.
+ public class Parameter : ParameterBase {
[Flags]
public enum Modifier : byte {
- NONE = 0,
- REF = 1,
- OUT = 2,
- PARAMS = 4,
+ NONE = 0,
+ REF = 1,
+ OUT = 2,
+ PARAMS = 4,
+ // This is a flag which says that it's either REF or OUT.
+ ISBYREF = 8,
+ ARGLIST = 16
}
- public readonly string TypeName;
- public readonly string Name;
+ static string[] attribute_targets = new string [] { "param" };
+
+ public Expression TypeName;
public readonly Modifier ModFlags;
- public Attributes OptAttributes;
- public Type parameter_type;
+ public readonly string Name;
+ Type parameter_type;
- public Parameter (string type, string name, Modifier mod, Attributes attrs)
+ public Parameter (Expression type, string name, Modifier mod, Attributes attrs)
+ : base (attrs)
{
Name = name;
ModFlags = mod;
TypeName = type;
- OptAttributes = attrs;
}
- // <summary>
- // Resolve is used in method definitions
- // </summary>
- public bool Resolve (DeclSpace ds, Location l)
+ public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
- parameter_type = RootContext.LookupType (ds, TypeName, false, l);
- return parameter_type != null;
+ if (a.Type == TypeManager.param_array_type) {
+ Report.Error (674, a.Location, "Do not use 'System.ParamArrayAttribute'. Use the 'params' keyword instead");
+ return;
+ }
+ base.ApplyAttributeBuilder (a, cb);
}
// <summary>
- // ResolveAndDefine is used by delegate declarations, because
- // they happen during the initial tree resolution process
+ // Resolve is used in method definitions
// </summary>
- public bool ResolveAndDefine (DeclSpace ds)
- {
- parameter_type = ds.FindType (TypeName);
- return parameter_type != null;
- }
-
- public Type ExternalType (DeclSpace ds, Location l)
+ public bool Resolve (EmitContext ec, Location l)
{
- if ((ModFlags & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0){
- string n = parameter_type.FullName + "&";
+ TypeExpr texpr = TypeName.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
+ return false;
+
+ parameter_type = texpr.ResolveType (ec);
+
+ if (parameter_type.IsAbstract && parameter_type.IsSealed) {
+ Report.Error (721, l, "'{0}': static types cannot be used as parameters", GetSignatureForError ());
+ return false;
+ }
- Type t = RootContext.LookupType (ds, n, false, l);
+ if (parameter_type == TypeManager.void_type){
+ Report.Error (1536, l, "`void' parameter is not permitted");
+ return false;
+ }
- return t;
+ if ((ModFlags & Parameter.Modifier.ISBYREF) != 0){
+ if (parameter_type == TypeManager.typed_reference_type ||
+ parameter_type == TypeManager.arg_iterator_type){
+ Report.Error (1601, l,
+ "out or ref parameter can not be of type TypedReference or ArgIterator");
+ return false;
+ }
}
+ return parameter_type != null;
+ }
+
+ public Type ExternalType ()
+ {
+ if ((ModFlags & Parameter.Modifier.ISBYREF) != 0)
+ return TypeManager.GetReferenceType (parameter_type);
+
return parameter_type;
}
@@ -83,7 +209,8 @@ namespace Mono.CSharp {
public ParameterAttributes Attributes {
get {
- switch (ModFlags){
+ int flags = ((int) ModFlags) & ~((int) Parameter.Modifier.ISBYREF);
+ switch ((Modifier) flags) {
case Modifier.NONE:
return ParameterAttributes.None;
case Modifier.REF:
@@ -98,18 +225,70 @@ namespace Mono.CSharp {
}
}
+ public override AttributeTargets AttributeTargets {
+ get {
+ return AttributeTargets.Parameter;
+ }
+ }
+
/// <summary>
/// Returns the signature for this parameter evaluating it on the
/// @tc context
/// </summary>
- public string GetSignature (DeclSpace ds, Location loc)
+ public string GetSignature (EmitContext ec, Location loc)
{
if (parameter_type == null){
- if (!Resolve (ds, loc))
+ if (!Resolve (ec, loc))
return null;
}
- return ExternalType (ds, loc).FullName;
+ return ExternalType ().FullName;
+ }
+
+ public string GetSignatureForError ()
+ {
+ string typeName;
+ if (parameter_type != null)
+ typeName = TypeManager.CSharpName (parameter_type);
+ else if (TypeName.Type != null)
+ typeName = TypeManager.CSharpName (TypeName.Type);
+ else
+ typeName = TypeName.ToString ();
+
+ switch (ModFlags & unchecked (~Modifier.ISBYREF)) {
+ case Modifier.OUT:
+ return "out " + typeName;
+ case Modifier.PARAMS:
+ return "params " + typeName;
+ case Modifier.REF:
+ return "ref " + typeName;
+ }
+ return typeName;
+ }
+
+ public void DefineParameter (EmitContext ec, MethodBuilder mb, ConstructorBuilder cb, int index, Location loc)
+ {
+ ParameterAttributes par_attr = Attributes;
+
+ if (mb == null)
+ builder = cb.DefineParameter (index, par_attr, Name);
+ else
+ builder = mb.DefineParameter (index, par_attr, Name);
+
+ if (OptAttributes != null) {
+ OptAttributes.Emit (ec, this);
+
+ if (par_attr == ParameterAttributes.Out){
+ if (OptAttributes.Contains (TypeManager.in_attribute_type, ec))
+ Report.Error (36, loc, "Can not use [In] attribute on out parameter");
+ }
+ }
+ }
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return attribute_targets;
+ }
}
}
@@ -119,6 +298,7 @@ namespace Mono.CSharp {
public class Parameters {
public Parameter [] FixedParameters;
public readonly Parameter ArrayParameter;
+ public readonly bool HasArglist;
string signature;
Type [] types;
Location loc;
@@ -132,16 +312,24 @@ namespace Mono.CSharp {
loc = l;
}
+ public Parameters (Parameter [] fixed_parameters, bool has_arglist, Location l)
+ {
+ FixedParameters = fixed_parameters;
+ HasArglist = has_arglist;
+ loc = l;
+ }
+
/// <summary>
/// This is used to reuse a set of empty parameters, because they
/// are common
/// </summary>
- public static Parameters GetEmptyReadOnlyParameters ()
- {
- if (empty_parameters == null)
- empty_parameters = new Parameters (null, null, Location.Null);
+ public static Parameters EmptyReadOnlyParameters {
+ get {
+ if (empty_parameters == null)
+ empty_parameters = new Parameters (null, null, Location.Null);
- return empty_parameters;
+ return empty_parameters;
+ }
}
public bool Empty {
@@ -150,14 +338,14 @@ namespace Mono.CSharp {
}
}
- public void ComputeSignature (DeclSpace ds)
+ public void ComputeSignature (EmitContext ec)
{
signature = "";
if (FixedParameters != null){
for (int i = 0; i < FixedParameters.Length; i++){
Parameter par = FixedParameters [i];
- signature += par.GetSignature (ds, loc);
+ signature += par.GetSignature (ec, loc);
}
}
//
@@ -166,10 +354,10 @@ namespace Mono.CSharp {
//
}
- static void error100 (string name)
+ void Error_DuplicateParameterName (string name)
{
Report.Error (
- 100, "The parameter name `" + name + "' is a duplicate");
+ 100, loc, "The parameter name `" + name + "' is a duplicate");
}
public bool VerifyArgs ()
@@ -182,18 +370,18 @@ namespace Mono.CSharp {
count = FixedParameters.Length;
string array_par_name = ArrayParameter != null ? ArrayParameter.Name : null;
+
for (i = 0; i < count; i++){
string base_name = FixedParameters [i].Name;
-
for (j = i + 1; j < count; j++){
if (base_name != FixedParameters [j].Name)
continue;
- error100 (base_name);
+ Error_DuplicateParameterName (base_name);
return false;
}
if (base_name == array_par_name){
- error100 (base_name);
+ Error_DuplicateParameterName (base_name);
return false;
}
}
@@ -202,13 +390,13 @@ namespace Mono.CSharp {
/// <summary>
/// Returns the signature of the Parameters evaluated in
- /// the @tc environment
+ /// the @ec EmitContext
/// </summary>
- public string GetSignature (DeclSpace ds)
+ public string GetSignature (EmitContext ec)
{
if (signature == null){
VerifyArgs ();
- ComputeSignature (ds);
+ ComputeSignature (ec);
}
return signature;
@@ -242,7 +430,14 @@ namespace Mono.CSharp {
return null;
}
- bool ComputeParameterTypes (DeclSpace ds)
+ public Parameter GetParameterByName (string name)
+ {
+ int idx;
+
+ return GetParameterByName (name, out idx);
+ }
+
+ bool ComputeParameterTypes (EmitContext ec)
{
int extra = (ArrayParameter != null) ? 1 : 0;
int i = 0;
@@ -265,24 +460,26 @@ namespace Mono.CSharp {
foreach (Parameter p in FixedParameters){
Type t = null;
- if (p.Resolve (ds, loc))
- t = p.ExternalType (ds, loc);
+ if (p.Resolve (ec, loc))
+ t = p.ExternalType ();
else
failed = true;
-
+
types [i] = t;
i++;
}
}
- if (failed)
- types = null;
-
if (extra > 0){
- if (ArrayParameter.Resolve (ds, loc))
- types [i] = ArrayParameter.ExternalType (ds, loc);
- else
- return false;
+ if (ArrayParameter.Resolve (ec, loc))
+ types [i] = ArrayParameter.ExternalType ();
+ else
+ failed = true;
+ }
+
+ if (failed){
+ types = null;
+ return false;
}
return true;
@@ -292,55 +489,13 @@ namespace Mono.CSharp {
// This variant is used by Delegates, because they need to
// resolve/define names, instead of the plain LookupType
//
- public bool ComputeAndDefineParameterTypes (DeclSpace ds)
+ public bool ComputeAndDefineParameterTypes (EmitContext ec)
{
- int extra = (ArrayParameter != null) ? 1 : 0;
- int i = 0;
- int pc;
-
- if (FixedParameters == null)
- pc = extra;
- else
- pc = extra + FixedParameters.Length;
-
- types = new Type [pc];
-
- if (!VerifyArgs ()){
- FixedParameters = null;
- return false;
- }
-
- bool ok_flag = true;
-
- if (FixedParameters != null){
- foreach (Parameter p in FixedParameters){
- Type t = null;
-
- if (p.ResolveAndDefine (ds))
- t = p.ExternalType (ds, loc);
- else
- ok_flag = false;
-
- types [i] = t;
- i++;
- }
- }
-
- if (extra > 0){
- if (ArrayParameter.ResolveAndDefine (ds))
- types [i] = ArrayParameter.ExternalType (ds, loc);
- else
- ok_flag = false;
- }
-
- //
- // invalidate the cached types
- //
- if (!ok_flag){
- types = null;
- }
-
- return ok_flag;
+ bool old_type_resolving = ec.ResolvingTypeTree;
+ ec.ResolvingTypeTree = true;
+ bool retval = ComputeParameterTypes (ec);
+ ec.ResolvingTypeTree = old_type_resolving;
+ return retval;
}
/// <summary>
@@ -348,7 +503,7 @@ namespace Mono.CSharp {
/// </summary>
static Type [] no_types = new Type [0];
- public Type [] GetParameterInfo (DeclSpace ds)
+ public Type [] GetParameterInfo (EmitContext ec)
{
if (types != null)
return types;
@@ -356,7 +511,7 @@ namespace Mono.CSharp {
if (FixedParameters == null && ArrayParameter == null)
return no_types;
- if (ComputeParameterTypes (ds) == false){
+ if (ComputeParameterTypes (ec) == false){
types = null;
return null;
}
@@ -371,9 +526,9 @@ namespace Mono.CSharp {
/// Note that the returned type will not contain any dereference in this
/// case (ie, you get "int" for a ref int instead of "int&"
/// </summary>
- public Type GetParameterInfo (DeclSpace ds, int idx, out bool is_out)
+ public Type GetParameterInfo (EmitContext ec, int idx, out Parameter.Modifier mod)
{
- is_out = false;
+ mod = Parameter.Modifier.NONE;
if (!VerifyArgs ()){
FixedParameters = null;
@@ -384,36 +539,76 @@ namespace Mono.CSharp {
return null;
if (types == null)
- if (ComputeParameterTypes (ds) == false){
- is_out = false;
+ if (ComputeParameterTypes (ec) == false)
return null;
- }
//
// If this is a request for the variable lenght arg.
//
int array_idx = (FixedParameters != null ? FixedParameters.Length : 0);
- if (idx == array_idx){
- is_out = false;
+ if (idx == array_idx)
return types [idx];
- }
//
// Otherwise, it is a fixed parameter
//
Parameter p = FixedParameters [idx];
- is_out = ((p.ModFlags & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0);
+ mod = p.ModFlags;
+
+ if ((mod & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0)
+ mod |= Parameter.Modifier.ISBYREF;
return p.ParameterType;
}
public CallingConventions GetCallingConvention ()
{
- // For now this is the only correc thing to do
- return CallingConventions.Standard;
+ if (HasArglist)
+ return CallingConventions.VarArgs;
+ else
+ return CallingConventions.Standard;
+ }
+
+ //
+ // The method's attributes are passed in because we need to extract
+ // the "return:" attribute from there to apply on the return type
+ //
+ public void LabelParameters (EmitContext ec,
+ MethodBase builder,
+ Location loc) {
+ //
+ // Define each type attribute (in/out/ref) and
+ // the argument names.
+ //
+ int i = 0;
+
+ MethodBuilder mb = builder as MethodBuilder;
+ ConstructorBuilder cb = builder as ConstructorBuilder;
+
+ if (FixedParameters != null) {
+ for (i = 0; i < FixedParameters.Length; i++) {
+ FixedParameters [i].DefineParameter (ec, mb, cb, i + 1, loc);
+ }
+ }
+
+ if (ArrayParameter != null){
+ ParameterBuilder pb;
+ Parameter array_param = ArrayParameter;
+
+ if (mb == null)
+ pb = cb.DefineParameter (
+ i + 1, array_param.Attributes,
+ array_param.Name);
+ else
+ pb = mb.DefineParameter (
+ i + 1, array_param.Attributes,
+ array_param.Name);
+
+ CustomAttributeBuilder a = new CustomAttributeBuilder (
+ TypeManager.cons_param_array_attribute, new object [0]);
+
+ pb.SetCustomAttribute (a);
+ }
}
}
}
-
-
-
diff --git a/mcs/mcs/pending.cs b/mcs/mcs/pending.cs
index 68b0cf8c7a2..5c3394f02fe 100755
--- a/mcs/mcs/pending.cs
+++ b/mcs/mcs/pending.cs
@@ -20,16 +20,38 @@ namespace Mono.CSharp {
struct TypeAndMethods {
public Type type;
public MethodInfo [] methods;
+
+ //
+ // Whether it is optional, this is used to allow the explicit/implicit
+ // implementation when a parent class already implements an interface.
+ //
+ // For example:
+ //
+ // class X : IA { } class Y : X, IA { IA.Explicit (); }
+ //
+ public bool optional;
// Far from ideal, but we want to avoid creating a copy
// of methods above.
public Type [][] args;
-
+
//
// This flag on the method says `We found a match, but
// because it was private, we could not use the match
//
public bool [] found;
+
+ // If a method is defined here, then we always need to
+ // create a proxy for it. This is used when implementing
+ // an interface's indexer with a different IndexerName.
+ public MethodInfo [] need_proxy;
+
+ //
+ // The name of the indexer (if it exists), precompute set/get, because
+ // they would be recomputed many times inside a loop later on.
+ //
+ public string set_indexer_name;
+ public string get_indexer_name;
}
public class PendingImplementation {
@@ -52,10 +74,8 @@ namespace Mono.CSharp {
static bool IsVirtualFilter (MemberInfo m, object filterCriteria)
{
- if (!(m is MethodInfo))
- return false;
-
- return ((MethodInfo) m).IsVirtual;
+ MethodInfo mi = m as MethodInfo;
+ return (mi == null) ? false : mi.IsVirtual;
}
/// <summary>
@@ -78,7 +98,7 @@ namespace Mono.CSharp {
Type current_type = t;
do {
- MemberInfo [] mi;
+ MemberList mi;
mi = TypeContainer.FindMembers (
current_type, MemberTypes.Method,
@@ -94,14 +114,10 @@ namespace Mono.CSharp {
searching = false;
}
- if (mi == null)
- continue;
-
- int count = mi.Length;
- if (count == 0)
+ if (mi.Count == 0)
continue;
- if (count == 1 && !(mi [0] is MethodBase))
+ if (mi.Count == 1 && !(mi [0] is MethodBase))
searching = false;
else
list = TypeManager.CopyNewMethods (list, mi);
@@ -121,7 +137,7 @@ namespace Mono.CSharp {
return list;
}
- PendingImplementation (TypeContainer container, Type [] ifaces, ArrayList abstract_methods, int total)
+ PendingImplementation (TypeContainer container, MissingInterfacesInfo [] missing_ifaces, ArrayList abstract_methods, int total)
{
TypeBuilder type_builder = container.TypeBuilder;
@@ -129,44 +145,54 @@ namespace Mono.CSharp {
pending_implementations = new TypeAndMethods [total];
int i = 0;
- if (ifaces != null){
- foreach (Type t in ifaces){
- MethodInfo [] mi;
+ foreach (MissingInterfacesInfo missing in missing_ifaces){
+ MethodInfo [] mi;
+ Type t = missing.Type;
- if (t is TypeBuilder){
- Interface iface;
+ if (t is TypeBuilder){
+ TypeContainer iface;
- iface = TypeManager.LookupInterface (t);
-
- mi = iface.GetMethods ();
- } else
- mi = t.GetMethods ();
-
- int count = mi.Length;
- pending_implementations [i].type = t;
- pending_implementations [i].methods = mi;
- pending_implementations [i].args = new Type [count][];
- pending_implementations [i].found = new bool [count];
-
- int j = 0;
- foreach (MethodInfo m in mi){
- Type [] types = TypeManager.GetArgumentTypes (m);
-
- pending_implementations [i].args [j] = types;
- j++;
- }
- i++;
+ iface = TypeManager.LookupInterface (t);
+
+ mi = iface.GetMethods ();
+ } else
+ mi = t.GetMethods ();
+
+ int count = mi.Length;
+ pending_implementations [i].type = t;
+ pending_implementations [i].optional = missing.Optional;
+ pending_implementations [i].methods = mi;
+ pending_implementations [i].args = new Type [count][];
+ pending_implementations [i].found = new bool [count];
+ pending_implementations [i].need_proxy = new MethodInfo [count];
+ string indexer_name = TypeManager.IndexerPropertyName (t);
+
+ pending_implementations [i].set_indexer_name = "set_" + indexer_name;
+ pending_implementations [i].get_indexer_name = "get_" + indexer_name;
+
+ int j = 0;
+ foreach (MethodInfo m in mi){
+ Type [] types = TypeManager.GetArgumentTypes (m);
+
+ pending_implementations [i].args [j] = types;
+ j++;
}
+ i++;
}
if (abstract_methods != null){
int count = abstract_methods.Count;
pending_implementations [i].methods = new MethodInfo [count];
+ pending_implementations [i].need_proxy = new MethodInfo [count];
abstract_methods.CopyTo (pending_implementations [i].methods, 0);
pending_implementations [i].found = new bool [count];
pending_implementations [i].args = new Type [count][];
pending_implementations [i].type = type_builder;
+
+ string indexer_name = TypeManager.IndexerPropertyName (type_builder);
+ pending_implementations [i].set_indexer_name = "set_" + indexer_name;
+ pending_implementations [i].get_indexer_name = "get_" + indexer_name;
int j = 0;
foreach (MemberInfo m in abstract_methods){
@@ -179,6 +205,60 @@ namespace Mono.CSharp {
}
}
}
+
+ struct MissingInterfacesInfo {
+ public Type Type;
+ public bool Optional;
+
+ public MissingInterfacesInfo (Type t)
+ {
+ Type = t;
+ Optional = false;
+ }
+ }
+
+ static MissingInterfacesInfo [] EmptyMissingInterfacesInfo = new MissingInterfacesInfo [0];
+
+ static MissingInterfacesInfo [] GetMissingInterfaces (TypeBuilder type_builder)
+ {
+ //
+ // Notice that TypeBuilders will only return the interfaces that the Type
+ // is supposed to implement, not all the interfaces that the type implements.
+ //
+ // Even better -- on MS it returns an empty array, no matter what.
+ //
+ // Completely broken. So we do it ourselves!
+ //
+ TypeExpr [] impl = TypeManager.GetExplicitInterfaces (type_builder);
+
+ if (impl == null || impl.Length == 0)
+ return EmptyMissingInterfacesInfo;
+
+ MissingInterfacesInfo [] ret = new MissingInterfacesInfo [impl.Length];
+
+ for (int i = 0; i < impl.Length; i++)
+ ret [i] = new MissingInterfacesInfo (impl [i].Type);
+
+ // we really should not get here because Object doesnt implement any
+ // interfaces. But it could implement something internal, so we have
+ // to handle that case.
+ if (type_builder.BaseType == null)
+ return ret;
+
+ TypeExpr [] parent_impls = TypeManager.GetInterfaces (type_builder.BaseType);
+
+ foreach (TypeExpr te in parent_impls) {
+ Type t = te.Type;
+
+ for (int i = 0; i < ret.Length; i ++) {
+ if (t == ret [i].Type) {
+ ret [i].Optional = true;
+ break;
+ }
+ }
+ }
+ return ret;
+ }
//
// Factory method: if there are pending implementation methods, we return a PendingImplementation
@@ -190,36 +270,10 @@ namespace Mono.CSharp {
static public PendingImplementation GetPendingImplementations (TypeContainer container)
{
TypeBuilder type_builder = container.TypeBuilder;
- Type [] ifaces;
+ MissingInterfacesInfo [] missing_interfaces;
Type b = type_builder.BaseType;
- int icount = 0;
- //
- // Notice that TypeBuilders will only return the interfaces that the Type
- // is supposed to implement, not all the interfaces that the type implements.
- //
- // Completely broken. Anyways, we take advantage of this, so we only register
- // the implementations that we need, as they are those that are listed by the
- // TypeBuilder.
- //
- ifaces = type_builder.GetInterfaces ();
-#if DEBUG
- {
- Type x = type_builder;
-
- while (x != null){
- Type [] iff = x.GetInterfaces ();
- Console.WriteLine ("Type: " + x.Name);
-
- foreach (Type tt in iff){
- Console.WriteLine (" Iface: " + tt.Name);
- }
- x = x.BaseType;
- }
- }
-#endif
-
- icount = ifaces.Length;
+ missing_interfaces = GetMissingInterfaces (type_builder);
//
// If we are implementing an abstract class, and we are not
@@ -239,11 +293,11 @@ namespace Mono.CSharp {
implementing_abstract = false;
}
- int total = icount + (implementing_abstract ? 1 : 0);
+ int total = missing_interfaces.Length + (implementing_abstract ? 1 : 0);
if (total == 0)
return null;
- return new PendingImplementation (container, ifaces, abstract_methods, total);
+ return new PendingImplementation (container, missing_interfaces, abstract_methods, total);
}
public enum Operation {
@@ -253,18 +307,30 @@ namespace Mono.CSharp {
//
Lookup, ClearOne, ClearAll
}
-
+
/// <summary>
/// Whether the specified method is an interface method implementation
/// </summary>
public MethodInfo IsInterfaceMethod (Type t, string name, Type ret_type, Type [] args)
{
- return InterfaceMethod (t, name, ret_type, args, Operation.Lookup);
+ return InterfaceMethod (t, name, ret_type, args, Operation.Lookup, null);
+ }
+
+ public MethodInfo IsInterfaceIndexer (Type t, Type ret_type, Type [] args)
+ {
+ return InterfaceMethod (t, null, ret_type, args, Operation.Lookup, null);
}
public void ImplementMethod (Type t, string name, Type ret_type, Type [] args, bool clear_one)
{
- InterfaceMethod (t, name, ret_type, args, clear_one ? Operation.ClearOne : Operation.ClearAll);
+ InterfaceMethod (t, name, ret_type, args,
+ clear_one ? Operation.ClearOne : Operation.ClearAll, null);
+ }
+
+ public void ImplementIndexer (Type t, MethodInfo mi, Type ret_type, Type [] args, bool clear_one)
+ {
+ InterfaceMethod (t, null, ret_type, args,
+ clear_one ? Operation.ClearOne : Operation.ClearAll, mi);
}
/// <remarks>
@@ -273,10 +339,19 @@ namespace Mono.CSharp {
/// arguments `args' implements an interface, this method will
/// return the MethodInfo that this method implements.
///
+ /// If `name' is null, we operate solely on the method's signature. This is for
+ /// instance used when implementing indexers.
+ ///
/// The `Operation op' controls whether to lookup, clear the pending bit, or clear
/// all the methods with the given signature.
+ ///
+ /// The `MethodInfo need_proxy' is used when we're implementing an interface's
+ /// indexer in a class. If the new indexer's IndexerName does not match the one
+ /// that was used in the interface, then we always need to create a proxy for it.
+ ///
/// </remarks>
- public MethodInfo InterfaceMethod (Type t, string name, Type ret_type, Type [] args, Operation op)
+ public MethodInfo InterfaceMethod (Type t, string name, Type ret_type, Type [] args,
+ Operation op, MethodInfo need_proxy)
{
int arg_len = args.Length;
@@ -287,34 +362,39 @@ namespace Mono.CSharp {
if (!(t == null || tm.type == t))
continue;
- int i = 0;
- foreach (MethodInfo m in tm.methods){
- if (m == null){
- i++;
+ int method_count = tm.methods.Length;
+ MethodInfo m;
+ for (int i = 0; i < method_count; i++){
+ m = tm.methods [i];
+
+ if (m == null)
continue;
- }
- if (name != m.Name){
- i++;
+ //
+ // `need_proxy' is not null when we're implementing an
+ // interface indexer and this is Clear(One/All) operation.
+ //
+ // If `name' is null, then we do a match solely based on the
+ // signature and not on the name (this is done in the Lookup
+ // for an interface indexer).
+ //
+ if (name == null){
+ if (m.Name != tm.get_indexer_name && m.Name != tm.set_indexer_name)
+ continue;
+ } else if ((need_proxy == null) && (name != m.Name))
continue;
- }
if (ret_type != m.ReturnType){
if (!((ret_type == null && m.ReturnType == TypeManager.void_type) ||
(m.ReturnType == null && ret_type == TypeManager.void_type)))
- {
- i++;
continue;
- }
}
//
// Check if we have the same parameters
//
- if (tm.args [i].Length != arg_len){
- i++;
+ if (tm.args [i].Length != arg_len)
continue;
- }
int j, top = args.Length;
bool fail = false;
@@ -325,13 +405,25 @@ namespace Mono.CSharp {
break;
}
}
- if (fail){
- i++;
+ if (fail)
continue;
- }
- if (op != Operation.Lookup)
- tm.methods [i] = null;
+ if (op != Operation.Lookup){
+ // If `t != null', then this is an explicitly interface
+ // implementation and we can always clear the method.
+ // `need_proxy' is not null if we're implementing an
+ // interface indexer. In this case, we need to create
+ // a proxy if the implementation's IndexerName doesn't
+ // match the IndexerName in the interface.
+ bool name_matches = false;
+ if (name == m.Name || m.Name == tm.get_indexer_name || m.Name == tm.set_indexer_name)
+ name_matches = true;
+
+ if ((t == null) && (need_proxy != null) && !name_matches)
+ tm.need_proxy [i] = need_proxy;
+ else
+ tm.methods [i] = null;
+ }
tm.found [i] = true;
//
@@ -405,18 +497,20 @@ namespace Mono.CSharp {
Type [] args = TypeManager.GetArgumentTypes (mi);
ms = new MethodSignature (mi.Name, mi.ReturnType, args);
- MemberInfo [] list = TypeContainer.FindMembers (
+ MemberList list = TypeContainer.FindMembers (
container.TypeBuilder.BaseType, MemberTypes.Method | MemberTypes.Property,
BindingFlags.Public | BindingFlags.Instance,
MethodSignature.method_signature_filter, ms);
- if (list == null || list.Length == 0)
+ if (list.Count == 0)
return false;
-
- DefineProxy (iface_type, (MethodInfo) list [0], mi, args);
+
+ MethodInfo parent = (MethodInfo) list [0];
+ if (!parent.IsAbstract)
+ DefineProxy (iface_type, parent, mi, args);
return true;
}
-
+
/// <summary>
/// Verifies that any pending abstract methods or interface methods
/// were implemented.
@@ -436,24 +530,33 @@ namespace Mono.CSharp {
continue;
if (type.IsInterface){
+ MethodInfo need_proxy =
+ pending_implementations [i].need_proxy [j];
+
+ if (need_proxy != null) {
+ Type [] args = TypeManager.GetArgumentTypes (mi);
+ DefineProxy (type, need_proxy, mi, args);
+ continue;
+ }
+
if (ParentImplements (type, mi))
continue;
-
- string extra = "";
+
+ if (pending_implementations [i].optional)
+ continue;
- if (pending_implementations [i].found [j])
- extra = ". (method might be private or static)";
- Report.Error (
- 536, container.Location,
- "`" + container.Name + "' does not implement " +
- "interface member `" +
- type.FullName + "." + mi.Name + "'" + extra);
+ if (pending_implementations [i].found [j]) {
+ string[] methodLabel = TypeManager.CSharpSignature (mi).Split ('.');
+ Report.Error (536, container.Location, "'{0}' does not implement interface member '{1}'. '{2}.{3}' is either static, not public, or has the wrong return type",
+ container.Name, TypeManager.CSharpSignature (mi), container.Name, methodLabel[methodLabel.Length - 1]);
+ }
+ else {
+ Report.Error (535, container.Location, "'{0}' does not implement interface member '{1}'",
+ container.Name, TypeManager.CSharpSignature (mi));
+ }
} else {
- Report.Error (
- 534, container.Location,
- "`" + container.Name + "' does not implement " +
- "inherited abstract member `" +
- type.FullName + "." + mi.Name + "'");
+ Report.Error (534, container.Location, "'{0}' does not implement inherited abstract member '{1}'",
+ container.Name, TypeManager.CSharpSignature (mi));
}
errors = true;
j++;
diff --git a/mcs/mcs/report.cs b/mcs/mcs/report.cs
index 73a41fcdf2b..b4faf83fcd4 100644
--- a/mcs/mcs/report.cs
+++ b/mcs/mcs/report.cs
@@ -10,8 +10,11 @@
// FIXME: currently our class library does not support custom number format strings
//
using System;
+using System.Text;
using System.Collections;
+using System.Collections.Specialized;
using System.Diagnostics;
+using System.Reflection;
namespace Mono.CSharp {
@@ -56,87 +59,312 @@ namespace Mono.CSharp {
// Keeps track of the warnings that we are ignoring
//
static Hashtable warning_ignore_table;
+
+ static Hashtable warning_regions_table;
+
+ /// <summary>
+ /// List of symbols related to reported error/warning. You have to fill it before error/warning is reported.
+ /// </summary>
+ static StringCollection related_symbols = new StringCollection ();
+
+ abstract class AbstractMessage {
+
+ static void Check (int code)
+ {
+ if (code == expected_error) {
+ Environment.Exit (0);
+ }
+ }
+
+ public abstract bool IsWarning { get; }
+
+ public abstract string MessageType { get; }
+
+ public virtual void Print (int code, string location, string text)
+ {
+ if (code < 0)
+ code = 8000-code;
+
+ StringBuilder msg = new StringBuilder ();
+ if (location.Length != 0) {
+ msg.Append (location);
+ msg.Append (' ');
+ }
+ msg.AppendFormat ("{0} CS{1:0000}: {2}", MessageType, code, text);
+ Console.WriteLine (msg.ToString ());
+
+ foreach (string s in related_symbols) {
+ Console.WriteLine (String.Concat (s, MessageType, ')'));
+ }
+ related_symbols.Clear ();
+
+ if (Stacktrace)
+ Console.WriteLine (FriendlyStackTrace (new StackTrace (true)));
+
+ if (Fatal) {
+ if (!IsWarning || WarningsAreErrors)
+ throw new Exception (text);
+ }
+
+ Check (code);
+ }
+
+ public virtual void Print (int code, Location location, string text)
+ {
+ if (location.Equals (Location.Null)) {
+ Print (code, "", text);
+ return;
+ }
+ Print (code, String.Format ("{0}({1})", location.Name, location.Row), text);
+ }
+ }
+
+ sealed class WarningMessage: AbstractMessage {
+ Location loc = Location.Null;
+ readonly int Level;
+
+ public WarningMessage ():
+ this (-1) {}
+
+ public WarningMessage (int level)
+ {
+ Level = level;
+ }
+
+ public override bool IsWarning {
+ get { return true; }
+ }
+
+ bool IsEnabled (int code)
+ {
+ if (RootContext.WarningLevel < Level)
+ return false;
+
+ if (warning_ignore_table != null) {
+ if (warning_ignore_table.Contains (code)) {
+ return false;
+ }
+ }
+
+ if (warning_regions_table == null || loc.Equals (Location.Null))
+ return true;
+
+ WarningRegions regions = (WarningRegions)warning_regions_table [loc.Name];
+ return regions.IsWarningEnabled (code, loc.Row);
+ }
+
+ public override void Print(int code, string location, string text)
+ {
+ if (!IsEnabled (code)) {
+ related_symbols.Clear ();
+ return;
+ }
+
+ if (WarningsAreErrors) {
+ new ErrorMessage ().Print (code, location, text);
+ return;
+ }
+
+ Warnings++;
+ base.Print (code, location, text);
+ }
+
+ public override void Print(int code, Location location, string text)
+ {
+ loc = location;
+ base.Print (code, location, text);
+ }
+
+ public override string MessageType {
+ get {
+ return "warning";
+ }
+ }
+ }
+
+ sealed class ErrorMessage: AbstractMessage {
+
+ public override void Print(int code, string location, string text)
+ {
+ Errors++;
+ base.Print (code, location, text);
+ }
+
+ public override bool IsWarning {
+ get { return false; }
+ }
+
+ public override string MessageType {
+ get {
+ return "error";
+ }
+ }
+
+ }
+
+ public static void FeatureIsNotStandardized (Location loc, string feature)
+ {
+ Report.Error (1644, loc, "Feature '{0}' cannot be used because it is not part of the standardized ISO C# language specification", feature);
+ }
- static void Check (int code)
+ public static string FriendlyStackTrace (Exception e)
{
- if (code == expected_error){
- if (Fatal)
- throw new Exception ();
+ return FriendlyStackTrace (new StackTrace (e, true));
+ }
+
+ static string FriendlyStackTrace (StackTrace t)
+ {
+ StringBuilder sb = new StringBuilder ();
+
+ bool foundUserCode = false;
+
+ for (int i = 0; i < t.FrameCount; i++) {
+ StackFrame f = t.GetFrame (i);
+ MethodBase mb = f.GetMethod ();
- Environment.Exit (0);
+ if (!foundUserCode && mb.ReflectedType == typeof (Report))
+ continue;
+
+ foundUserCode = true;
+
+ sb.Append ("\tin ");
+
+ if (f.GetFileLineNumber () > 0)
+ sb.AppendFormat ("(at {0}:{1}) ", f.GetFileName (), f.GetFileLineNumber ());
+
+ sb.AppendFormat ("{0}.{1} (", mb.ReflectedType.Name, mb.Name);
+
+ bool first = true;
+ foreach (ParameterInfo pi in mb.GetParameters ()) {
+ if (!first)
+ sb.Append (", ");
+ first = false;
+
+ sb.Append (TypeManager.CSharpName (pi.ParameterType));
+ }
+ sb.Append (")\n");
}
+
+ return sb.ToString ();
+ }
+
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ // IF YOU ADD A NEW WARNING YOU HAVE TO DUPLICATE ITS ID HERE
+ public static bool IsValidWarning (int code)
+ {
+ int[] all_warnings = new int[] { 28, 67, 78, 105, 108, 109, 114, 192, 168, 169, 183, 184, 219, 251, 612, 618, 626, 628, 642, 649,
+ 659, 660, 661, 672, 1030, 1522, 1616, 1691, 1692, 1901, 2002, 2023, 3012, 3019, 8024, 8028
+ };
+ foreach (int i in all_warnings) {
+ if (i == code)
+ return true;
+ }
+ return false;
}
- static public void RealError (string msg)
+ static public void LocationOfPreviousError (Location loc)
{
- Errors++;
- Console.WriteLine (msg);
-
- if (Stacktrace)
- Console.WriteLine (new StackTrace ().ToString ());
- if (Fatal)
- throw new Exception (msg);
+ Console.WriteLine (String.Format ("{0}({1}) (Location of symbol related to previous error)", loc.Name, loc.Row));
+ }
+
+ static public void RuntimeMissingSupport (Location loc, string feature)
+ {
+ Report.Error (-88, loc, "Your .NET Runtime does not support '{0}'. Please use the latest Mono runtime instead.", feature);
}
- static public void Error (int code, Location l, string text)
+ /// <summary>
+ /// In most error cases is very useful to have information about symbol that caused the error.
+ /// Call this method before you call Report.Error when it makes sense.
+ /// </summary>
+ static public void SymbolRelatedToPreviousError (Location loc, string symbol)
{
- string msg = String.Format (
- "{0}({1}) error CS{2:0000}: {3}", l.Name, l.Row, code, text);
-// "{0}({1}) error CS{2}: {3}", l.Name, l.Row, code, text);
-
- RealError (msg);
- Check (code);
+ SymbolRelatedToPreviousError (String.Format ("{0}({1})", loc.Name, loc.Row), symbol);
}
- static public void Warning (int code, Location l, string text)
+ static public void SymbolRelatedToPreviousError (MemberInfo mi)
{
- if (warning_ignore_table != null){
- if (warning_ignore_table.Contains (code))
+ TypeContainer temp_ds = TypeManager.LookupTypeContainer (mi.DeclaringType);
+ if (temp_ds == null) {
+ SymbolRelatedToPreviousError (mi.DeclaringType.Assembly.Location, TypeManager.GetFullNameSignature (mi));
+ } else {
+ if (mi is MethodBase) {
+ IMethodData md = TypeManager.GetMethod ((MethodBase)mi);
+ SymbolRelatedToPreviousError (md.Location, md.GetSignatureForError (temp_ds));
return;
+ }
+
+ string name = String.Concat (temp_ds.Name, ".", mi.Name);
+ MemberCore mc = temp_ds.GetDefinition (name);
+ SymbolRelatedToPreviousError (mc);
}
-
- if (WarningsAreErrors)
- Error (code, l, text);
- else {
- string row;
-
- if (Location.IsNull (l))
- row = "";
- else
- row = l.Row.ToString ();
-
- Console.WriteLine (String.Format (
- "{0}({1}) warning CS{2:0000}: {3}",
-// "{0}({1}) warning CS{2}: {3}",
- l.Name, row, code, text));
- Warnings++;
- Check (code);
+ }
- if (Stacktrace)
- Console.WriteLine (new StackTrace ().ToString ());
+ static public void SymbolRelatedToPreviousError (MemberCore mc)
+ {
+ SymbolRelatedToPreviousError (mc.Location, mc.GetSignatureForError ());
+ }
+
+ static public void SymbolRelatedToPreviousError (Type type)
+ {
+ DeclSpace temp_ds = TypeManager.LookupDeclSpace (type);
+ if (temp_ds == null)
+ SymbolRelatedToPreviousError (type.Assembly.Location, TypeManager.CSharpName (type));
+ else
+ SymbolRelatedToPreviousError (temp_ds.Location, TypeManager.CSharpName (type));
+ }
+
+ static void SymbolRelatedToPreviousError (string loc, string symbol)
+ {
+ related_symbols.Add (String.Format ("{0}: '{1}' (name of symbol related to previous ", loc, symbol));
+ }
+
+ public static WarningRegions RegisterWarningRegion (Location location)
+ {
+ if (warning_regions_table == null)
+ warning_regions_table = new Hashtable ();
+
+ WarningRegions regions = (WarningRegions)warning_regions_table [location.Name];
+ if (regions == null) {
+ regions = new WarningRegions ();
+ warning_regions_table.Add (location.Name, regions);
}
+ return regions;
}
-
+
+ static public void Warning (int code, int level, Location loc, string format, params object[] args)
+ {
+ WarningMessage w = new WarningMessage (level);
+ w.Print (code, loc, String.Format (format, args));
+ }
+
+ static public void Warning (int code, Location loc, string format, params object[] args)
+ {
+ WarningMessage w = new WarningMessage ();
+ w.Print (code, loc, String.Format (format, args));
+ }
+
+ static public void Warning (int code, string format, params object[] args)
+ {
+ Warning (code, Location.Null, String.Format (format, args));
+ }
+
+ /// <summary>
+ /// Did you test your WarningLevel, that you use this method
+ /// </summary>
static public void Warning (int code, string text)
{
Warning (code, Location.Null, text);
}
- static public void Error (int code, string text)
+ static public void Error (int code, string format, params object[] args)
{
- string msg = String.Format ("error CS{0:0000}: {1}", code, text);
-// string msg = String.Format ("error CS{0}: {1}", code, text);
-
- RealError (msg);
- Check (code);
+ Error (code, Location.Null, String.Format (format, args));
}
- static public void Message (Message m)
+ static public void Error (int code, Location loc, string format, params object[] args)
{
- if (m is ErrorMessage)
- Error (m.code, m.text);
- else
- Warning (m.code, m.text);
+ ErrorMessage e = new ErrorMessage ();
+ e.Print (code, loc, String.Format (format, args));
}
static public void SetIgnoreWarning (int code)
@@ -147,47 +375,284 @@ namespace Mono.CSharp {
warning_ignore_table [code] = true;
}
- static public int ExpectedError {
- set {
- expected_error = value;
- }
- get {
- return expected_error;
- }
- }
- }
+ static public int ExpectedError {
+ set {
+ expected_error = value;
+ }
+ get {
+ return expected_error;
+ }
+ }
- public class Message {
- public int code;
- public string text;
-
- public Message (int code, string text)
+ public static int DebugFlags = 0;
+
+ [Conditional ("MCS_DEBUG")]
+ static public void Debug (string message, params object[] args)
+ {
+ Debug (4, message, args);
+ }
+
+ [Conditional ("MCS_DEBUG")]
+ static public void Debug (int category, string message, params object[] args)
{
- this.code = code;
- this.text = text;
+ if ((category & DebugFlags) == 0)
+ return;
+
+ StringBuilder sb = new StringBuilder (message);
+
+ if ((args != null) && (args.Length > 0)) {
+ sb.Append (": ");
+
+ bool first = true;
+ foreach (object arg in args) {
+ if (first)
+ first = false;
+ else
+ sb.Append (", ");
+ if (arg == null)
+ sb.Append ("null");
+ else if (arg is ICollection)
+ sb.Append (PrintCollection ((ICollection) arg));
+ else
+ sb.Append (arg);
+ }
+ }
+
+ Console.WriteLine (sb.ToString ());
}
+
+ static public string PrintCollection (ICollection collection)
+ {
+ StringBuilder sb = new StringBuilder ();
+
+ sb.Append (collection.GetType ());
+ sb.Append ("(");
+
+ bool first = true;
+ foreach (object o in collection) {
+ if (first)
+ first = false;
+ else
+ sb.Append (", ");
+ sb.Append (o);
+ }
+
+ sb.Append (")");
+ return sb.ToString ();
+ }
+ }
+
+ public enum TimerType {
+ FindMembers = 0,
+ TcFindMembers = 1,
+ MemberLookup = 2,
+ CachedLookup = 3,
+ CacheInit = 4,
+ MiscTimer = 5,
+ CountTimers = 6
}
- public class WarningMessage : Message {
- public WarningMessage (int code, string text) : base (code, text)
+ public enum CounterType {
+ FindMembers = 0,
+ MemberCache = 1,
+ MiscCounter = 2,
+ CountCounters = 3
+ }
+
+ public class Timer
+ {
+ static DateTime[] timer_start;
+ static TimeSpan[] timers;
+ static long[] timer_counters;
+ static long[] counters;
+
+ static Timer ()
{
+ timer_start = new DateTime [(int) TimerType.CountTimers];
+ timers = new TimeSpan [(int) TimerType.CountTimers];
+ timer_counters = new long [(int) TimerType.CountTimers];
+ counters = new long [(int) CounterType.CountCounters];
+
+ for (int i = 0; i < (int) TimerType.CountTimers; i++) {
+ timer_start [i] = DateTime.Now;
+ timers [i] = TimeSpan.Zero;
+ }
+ }
+
+ [Conditional("TIMER")]
+ static public void IncrementCounter (CounterType which)
+ {
+ ++counters [(int) which];
+ }
+
+ [Conditional("TIMER")]
+ static public void StartTimer (TimerType which)
+ {
+ timer_start [(int) which] = DateTime.Now;
+ }
+
+ [Conditional("TIMER")]
+ static public void StopTimer (TimerType which)
+ {
+ timers [(int) which] += DateTime.Now - timer_start [(int) which];
+ ++timer_counters [(int) which];
+ }
+
+ [Conditional("TIMER")]
+ static public void ShowTimers ()
+ {
+ ShowTimer (TimerType.FindMembers, "- FindMembers timer");
+ ShowTimer (TimerType.TcFindMembers, "- TypeContainer.FindMembers timer");
+ ShowTimer (TimerType.MemberLookup, "- MemberLookup timer");
+ ShowTimer (TimerType.CachedLookup, "- CachedLookup timer");
+ ShowTimer (TimerType.CacheInit, "- Cache init");
+ ShowTimer (TimerType.MiscTimer, "- Misc timer");
+
+ ShowCounter (CounterType.FindMembers, "- Find members");
+ ShowCounter (CounterType.MemberCache, "- Member cache");
+ ShowCounter (CounterType.MiscCounter, "- Misc counter");
+ }
+
+ static public void ShowCounter (CounterType which, string msg)
+ {
+ Console.WriteLine ("{0} {1}", counters [(int) which], msg);
+ }
+
+ static public void ShowTimer (TimerType which, string msg)
+ {
+ Console.WriteLine (
+ "[{0:00}:{1:000}] {2} (used {3} times)",
+ (int) timers [(int) which].TotalSeconds,
+ timers [(int) which].Milliseconds, msg,
+ timer_counters [(int) which]);
}
}
- public class ErrorMessage : Message {
- public ErrorMessage (int code, string text) : base (code, text)
+ public class InternalErrorException : Exception {
+ public InternalErrorException ()
+ : base ("Internal error")
{
}
- //
- // For compatibility reasons with old code.
- //
- public static void report_error (string error)
+ public InternalErrorException (string message)
+ : base (message)
{
- Console.Write ("ERROR: ");
- Console.WriteLine (error);
}
}
-}
+ /// <summary>
+ /// Handles #pragma warning
+ /// </summary>
+ public class WarningRegions {
+ abstract class PragmaCmd
+ {
+ public int Line;
+
+ protected PragmaCmd (int line)
+ {
+ Line = line;
+ }
+
+ public abstract bool IsEnabled (int code, bool previous);
+ }
+
+ class Disable: PragmaCmd
+ {
+ int code;
+ public Disable (int line, int code)
+ : base (line)
+ {
+ this.code = code;
+ }
+
+ public override bool IsEnabled (int code, bool previous)
+ {
+ return this.code == code ? false : previous;
+ }
+ }
+
+ class DisableAll: PragmaCmd
+ {
+ public DisableAll (int line)
+ : base (line) {}
+
+ public override bool IsEnabled(int code, bool previous)
+ {
+ return false;
+ }
+ }
+
+ class Enable: PragmaCmd
+ {
+ int code;
+ public Enable (int line, int code)
+ : base (line)
+ {
+ this.code = code;
+ }
+
+ public override bool IsEnabled(int code, bool previous)
+ {
+ return this.code == code ? true : previous;
+ }
+ }
+
+ class EnableAll: PragmaCmd
+ {
+ public EnableAll (int line)
+ : base (line) {}
+
+ public override bool IsEnabled(int code, bool previous)
+ {
+ return true;
+ }
+ }
+
+
+ ArrayList regions = new ArrayList ();
+
+ public void WarningDisable (int line)
+ {
+ regions.Add (new DisableAll (line));
+ }
+
+ public void WarningDisable (Location location, int code)
+ {
+ if (CheckWarningCode (code, location))
+ regions.Add (new Disable (location.Row, code));
+ }
+
+ public void WarningEnable (int line)
+ {
+ regions.Add (new EnableAll (line));
+ }
+
+ public void WarningEnable (Location location, int code)
+ {
+ if (CheckWarningCode (code, location))
+ regions.Add (new Enable (location.Row, code));
+ }
+
+ public bool IsWarningEnabled (int code, int src_line)
+ {
+ bool result = true;
+ foreach (PragmaCmd pragma in regions) {
+ if (src_line < pragma.Line)
+ break;
+
+ result = pragma.IsEnabled (code, result);
+ }
+ return result;
+ }
+
+ bool CheckWarningCode (int code, Location loc)
+ {
+ if (Report.IsValidWarning (code))
+ return true;
+
+ Report.Warning (1691, 1, loc, "'{0}' is not a valid warning number", code);
+ return false;
+ }
+ }
+}
diff --git a/mcs/mcs/rootcontext.cs b/mcs/mcs/rootcontext.cs
index a705cc9e9d8..1ec28f0d1e2 100755
--- a/mcs/mcs/rootcontext.cs
+++ b/mcs/mcs/rootcontext.cs
@@ -16,6 +16,12 @@ using System.Diagnostics;
namespace Mono.CSharp {
+ public enum LanguageVersion
+ {
+ Default = 0,
+ ISO_1 = 1
+ }
+
public class RootContext {
//
@@ -30,11 +36,6 @@ namespace Mono.CSharp {
public static Hashtable AllDefines = new Hashtable ();
//
- // The list of global attributes (those that target the assembly)
- //
- static Hashtable global_attributes = new Hashtable ();
-
- //
// Whether we are being linked against the standard libraries.
// This is only used to tell whether `System.Object' should
// have a parent or not.
@@ -51,26 +52,47 @@ namespace Mono.CSharp {
// override).
//
static ArrayList type_container_resolve_order;
- static ArrayList interface_resolve_order;
static ArrayList attribute_types;
//
// Holds a reference to the Private Implementation Details
// class.
//
+ static ArrayList helper_classes;
+
static TypeBuilder impl_details_class;
public static int WarningLevel = 2;
+ public static Target Target = Target.Exe;
+ public static string TargetExt = ".exe";
+
+ public static bool VerifyClsCompliance = true;
+
+ public static LanguageVersion Version = LanguageVersion.Default;
+
+ //
+ // We keep strongname related info here because
+ // it's also used as complier options from CSC 8.x
+ //
+ public static string StrongNameKeyFile;
+ public static string StrongNameKeyContainer;
+ public static bool StrongNameDelaySign = false;
+
//
// Constructor
//
static RootContext ()
{
tree = new Tree ();
- interface_resolve_order = new ArrayList ();
type_container_resolve_order = new ArrayList ();
}
+
+ public static bool NeedsEntryPoint {
+ get {
+ return RootContext.Target == Target.Exe || RootContext.Target == Target.WinExe;
+ }
+ }
static public Tree Tree {
get {
@@ -80,11 +102,6 @@ namespace Mono.CSharp {
static public string MainClass;
- public static void RegisterOrder (Interface iface)
- {
- interface_resolve_order.Add (iface);
- }
-
public static void RegisterOrder (TypeContainer tc)
{
type_container_resolve_order.Add (tc);
@@ -110,11 +127,11 @@ namespace Mono.CSharp {
static string MakeFQN (string nsn, string name)
{
- string prefix = (nsn == "" ? "" : nsn + ".");
-
- return prefix + name;
+ if (nsn == "")
+ return name;
+ return String.Concat (nsn, ".", name);
}
-
+
// <remarks>
// This function is used to resolve the hierarchy tree.
// It processes interfaces, structs and classes in that order.
@@ -145,8 +162,7 @@ namespace Mono.CSharp {
i.DefineType ();
}
-
- foreach (TypeContainer tc in root.Types)
+ foreach (TypeContainer tc in root.Types)
tc.DefineType ();
if (root.Delegates != null)
@@ -156,7 +172,6 @@ namespace Mono.CSharp {
if (root.Enums != null)
foreach (Enum e in root.Enums)
e.DefineType ();
-
}
static void Error_TypeConflict (string name, Location loc)
@@ -254,7 +269,7 @@ namespace Mono.CSharp {
object o = root.GetDefinition (name);
if (o == null){
Report.Error (518, "The predefined type `" + name + "' is not defined");
- Environment.Exit (0);
+ Environment.Exit (1);
}
if (!(o is Delegate)){
@@ -321,8 +336,11 @@ namespace Mono.CSharp {
"System.Char", "System.Boolean",
"System.Decimal", "System.Void",
"System.RuntimeFieldHandle",
+ "System.RuntimeArgumentHandle",
"System.RuntimeTypeHandle",
- "System.IntPtr"
+ "System.IntPtr",
+ "System.TypedReference",
+ "System.ArgIterator"
};
foreach (string cname in structs_second_stage)
@@ -332,12 +350,9 @@ namespace Mono.CSharp {
// These are classes that depends on the core interfaces
//
string [] classes_second_stage = {
- "System.String", "System.Enum",
- "System.Array", "System.MulticastDelegate",
- "System.Delegate",
-
"System.Reflection.MemberInfo",
"System.Type",
+ "System.Exception",
//
// These are not really important in the order, but they
@@ -354,9 +369,25 @@ namespace Mono.CSharp {
"System.Diagnostics.ConditionalAttribute",
"System.ObsoleteAttribute",
"System.ParamArrayAttribute",
+ "System.CLSCompliantAttribute",
"System.Security.UnverifiableCodeAttribute",
+ "System.Security.Permissions.SecurityAttribute",
"System.Runtime.CompilerServices.IndexerNameAttribute",
+ "System.Runtime.InteropServices.InAttribute",
+ "System.Runtime.InteropServices.StructLayoutAttribute",
+ "System.Runtime.InteropServices.FieldOffsetAttribute",
+ "System.InvalidOperationException",
+ "System.NotSupportedException",
+ "System.MarshalByRefObject",
+ "System.Security.CodeAccessPermission"
};
+
+ // We must store them here before calling BootstrapCorlib_ResolveDelegate.
+ TypeManager.string_type = BootstrapCorlib_ResolveClass (root, "System.String");
+ TypeManager.enum_type = BootstrapCorlib_ResolveClass (root, "System.Enum");
+ TypeManager.array_type = BootstrapCorlib_ResolveClass (root, "System.Array");
+ TypeManager.multicast_delegate_type = BootstrapCorlib_ResolveClass (root, "System.MulticastDelegate");
+ TypeManager.delegate_type = BootstrapCorlib_ResolveClass (root, "System.Delegate");
foreach (string cname in classes_second_stage)
BootstrapCorlib_ResolveClass (root, cname);
@@ -378,8 +409,6 @@ namespace Mono.CSharp {
{
TypeContainer root = Tree.Types;
- ArrayList ifaces = root.Interfaces;
-
if (root.Enums != null)
foreach (Enum en in root.Enums)
en.CloseType ();
@@ -388,9 +417,6 @@ namespace Mono.CSharp {
foreach (TypeContainer tc in attribute_types)
tc.CloseType ();
- foreach (Interface iface in interface_resolve_order)
- iface.CloseType ();
-
//
// We do this in two passes, first we close the structs,
// then the classes, because it seems the code needs it this
@@ -398,29 +424,47 @@ namespace Mono.CSharp {
// make sure that we define the structs in order as well.
//
foreach (TypeContainer tc in type_container_resolve_order){
- if (tc is Struct && tc.Parent == tree.Types){
+ if (tc.Kind == Kind.Struct && tc.Parent == tree.Types){
tc.CloseType ();
}
}
foreach (TypeContainer tc in type_container_resolve_order){
- if (!(tc is Struct && tc.Parent == tree.Types))
+ if (!(tc.Kind == Kind.Struct && tc.Parent == tree.Types))
tc.CloseType ();
}
if (root.Delegates != null)
foreach (Delegate d in root.Delegates)
- d.CloseDelegate ();
+ d.CloseType ();
//
// If we have a <PrivateImplementationDetails> class, close it
//
- if (impl_details_class != null){
- impl_details_class.CreateType ();
+ if (helper_classes != null){
+ foreach (TypeBuilder type_builder in helper_classes)
+ type_builder.CreateType ();
}
+
+ attribute_types = null;
+ type_container_resolve_order = null;
+ helper_classes = null;
+ //tree = null;
+ TypeManager.CleanUp ();
}
+ /// <summary>
+ /// Used to register classes that need to be closed after all the
+ /// user defined classes
+ /// </summary>
+ public static void RegisterHelperClass (TypeBuilder helper_class)
+ {
+ if (helper_classes == null)
+ helper_classes = new ArrayList ();
+ helper_classes.Add (helper_class);
+ }
+
//
// This idea is from Felix Arrese-Igor
//
@@ -429,84 +473,27 @@ namespace Mono.CSharp {
//
static public string ImplicitParent (string ns)
{
- int i = ns.LastIndexOf (".");
+ int i = ns.LastIndexOf ('.');
if (i < 0)
return null;
return ns.Substring (0, i);
}
- static Type NamespaceLookup (Namespace curr_ns, string name)
+ static Type NamespaceLookup (DeclSpace ds, string name, Location loc)
{
- Type t;
-
//
// Try in the current namespace and all its implicit parents
//
- for (string ns = curr_ns.Name; ns != null; ns = ImplicitParent (ns)) {
- t = TypeManager.LookupType (MakeFQN (ns, name));
- if (t != null)
- return t;
- }
-
- //
- // It's possible that name already is fully qualified. So we do
- // a simple direct lookup without adding any namespace names
- //
- t = TypeManager.LookupType (name);
- if (t != null)
- return t;
-
- //
- // Try the aliases in the current namespace
- //
- string alias = curr_ns.LookupAlias (name);
-
- if (alias != null) {
- t = TypeManager.LookupType (alias);
- if (t != null)
- return t;
-
- t = TypeManager.LookupType (MakeFQN (alias, name));
- if (t != null)
- return t;
- }
-
- for (Namespace ns = curr_ns; ns != null; ns = ns.Parent) {
- //
- // Look in the namespace ns
- //
- t = TypeManager.LookupType (MakeFQN (ns.Name, name));
- if (t != null)
- return t;
-
- //
- // Then try with the using clauses
- //
- ArrayList using_list = ns.UsingTable;
-
- if (using_list == null)
+ for (NamespaceEntry ns = ds.NamespaceEntry; ns != null; ns = ns.ImplicitParent) {
+ object result = ns.Lookup (ds, name, false, loc);
+ if (result == null)
continue;
- foreach (string n in using_list) {
- t = TypeManager.LookupType (MakeFQN (n, name));
- if (t != null)
- return t;
- }
-
- //
- // Try with aliases
- //
- string a = ns.LookupAlias (name);
- if (a != null) {
- t = TypeManager.LookupType (a);
- if (t != null)
- return t;
+ if (result is Type)
+ return (Type) result;
- t = TypeManager.LookupType (MakeFQN (a, name));
- if (t != null)
- return t;
- }
+ return null;
}
return null;
@@ -524,10 +511,8 @@ namespace Mono.CSharp {
{
Type t;
- if (ds.Cache.Contains (name)){
+ if (ds.Cache.Contains (name)) {
t = (Type) ds.Cache [name];
- if (t != null)
- return t;
} else {
//
// For the case the type we are looking for is nested within this one
@@ -535,13 +520,29 @@ namespace Mono.CSharp {
//
DeclSpace containing_ds = ds;
while (containing_ds != null){
+
+ // if the member cache has been created, lets use it.
+ // the member cache is MUCH faster.
+ if (containing_ds.MemberCache != null) {
+ t = containing_ds.MemberCache.FindNestedType (name);
+ if (t == null) {
+ containing_ds = containing_ds.Parent;
+ continue;
+ }
+
+ ds.Cache [name] = t;
+ return t;
+ }
+
+ // no member cache. Do it the hard way -- reflection
Type current_type = containing_ds.TypeBuilder;
- while (current_type != null) {
+ while (current_type != null &&
+ current_type != TypeManager.object_type) {
//
// nested class
//
- t = TypeManager.LookupType (current_type.FullName + "+" + name);
+ t = TypeManager.LookupType (current_type.FullName + "." + name);
if (t != null){
ds.Cache [name] = t;
return t;
@@ -553,17 +554,15 @@ namespace Mono.CSharp {
containing_ds = containing_ds.Parent;
}
- t = NamespaceLookup (ds.Namespace, name);
- if (t != null){
+ t = NamespaceLookup (ds, name, loc);
+ if (!silent)
ds.Cache [name] = t;
- return t;
- }
}
- if (!silent)
+ if (t == null && !silent)
Report.Error (246, loc, "Cannot find type `"+name+"'");
- return null;
+ return t;
}
// <summary>
@@ -575,20 +574,6 @@ namespace Mono.CSharp {
return LookupType (tc, name, true, loc);
}
- static public bool IsNamespace (string name)
- {
- Namespace ns;
-
- if (tree.Namespaces != null){
- ns = (Namespace) tree.Namespaces [name];
-
- if (ns != null)
- return true;
- }
-
- return false;
- }
-
static void Report1530 (Location loc)
{
Report.Error (1530, loc, "Keyword new not allowed for namespace elements");
@@ -598,7 +583,8 @@ namespace Mono.CSharp {
{
DeclSpace ds = (DeclSpace) root.GetDefinition (name);
- ds.Define (root);
+ ds.DefineMembers (root);
+ ds.Define ();
}
static public void BootCorlib_PopulateCoreTypes ()
@@ -622,30 +608,31 @@ namespace Mono.CSharp {
if (attribute_types != null)
foreach (TypeContainer tc in attribute_types)
- tc.Define (root);
+ tc.DefineMembers (root);
- if (interface_resolve_order != null){
- foreach (Interface iface in interface_resolve_order)
- if ((iface.ModFlags & Modifiers.NEW) == 0)
- iface.Define (root);
- else
- Report1530 (iface.Location);
- }
-
-
if (type_container_resolve_order != null){
- foreach (TypeContainer tc in type_container_resolve_order)
- if ((tc.ModFlags & Modifiers.NEW) == 0)
- tc.Define (root);
- else
- Report1530 (tc.Location);
+ if (RootContext.StdLib){
+ foreach (TypeContainer tc in type_container_resolve_order)
+ tc.DefineMembers (root);
+ } else {
+ foreach (TypeContainer tc in type_container_resolve_order) {
+ // When compiling corlib, these types have already been
+ // populated from BootCorlib_PopulateCoreTypes ().
+ if (((tc.Name == "System.Object") ||
+ (tc.Name == "System.Attribute") ||
+ (tc.Name == "System.ValueType")))
+ continue;
+
+ tc.DefineMembers (root);
+ }
+ }
}
ArrayList delegates = root.Delegates;
if (delegates != null){
foreach (Delegate d in delegates)
if ((d.ModFlags & Modifiers.NEW) == 0)
- d.Define (root);
+ d.DefineMembers (root);
else
Report1530 (d.Location);
}
@@ -654,56 +641,102 @@ namespace Mono.CSharp {
if (enums != null){
foreach (Enum en in enums)
if ((en.ModFlags & Modifiers.NEW) == 0)
- en.Define (root);
+ en.DefineMembers (root);
else
Report1530 (en.Location);
}
- }
- static public void EmitCode ()
- {
//
- // Because of the strange way in which we do things, global
- // attributes must be processed first.
+ // Check for cycles in the struct layout
//
- if (global_attributes.Count > 0){
- AssemblyBuilder ab = CodeGen.AssemblyBuilder;
- TypeContainer dummy = new TypeContainer (null, "", new Location (-1));
- EmitContext temp_ec = new EmitContext (
- dummy, Mono.CSharp.Location.Null, null, null, 0, false);
+ if (type_container_resolve_order != null){
+ Hashtable seen = new Hashtable ();
+ foreach (TypeContainer tc in type_container_resolve_order)
+ TypeManager.CheckStructCycles (tc, seen);
+ }
+ }
+
+ //
+ // A generic hook delegate
+ //
+ public delegate void Hook ();
+
+ //
+ // A hook invoked when the code has been generated.
+ //
+ public static event Hook EmitCodeHook;
+
+ //
+ // DefineTypes is used to fill in the members of each type.
+ //
+ static public void DefineTypes ()
+ {
+ TypeContainer root = Tree.Types;
+
+ if (attribute_types != null)
+ foreach (TypeContainer tc in attribute_types)
+ tc.Define ();
- foreach (DictionaryEntry de in global_attributes){
- Namespace ns = (Namespace) de.Key;
- Attributes attrs = (Attributes) de.Value;
-
- dummy.Namespace = ns;
- Attribute.ApplyAttributes (temp_ec, ab, ab, attrs, attrs.Location);
+ if (type_container_resolve_order != null){
+ foreach (TypeContainer tc in type_container_resolve_order) {
+ // When compiling corlib, these types have already been
+ // populated from BootCorlib_PopulateCoreTypes ().
+ if (!RootContext.StdLib &&
+ ((tc.Name == "System.Object") ||
+ (tc.Name == "System.Attribute") ||
+ (tc.Name == "System.ValueType")))
+ continue;
+
+ if ((tc.ModFlags & Modifiers.NEW) == 0)
+ tc.Define ();
}
}
-
+
+ ArrayList delegates = root.Delegates;
+ if (delegates != null){
+ foreach (Delegate d in delegates)
+ if ((d.ModFlags & Modifiers.NEW) == 0)
+ d.Define ();
+ }
+
+ ArrayList enums = root.Enums;
+ if (enums != null){
+ foreach (Enum en in enums)
+ if ((en.ModFlags & Modifiers.NEW) == 0)
+ en.Define ();
+ }
+ }
+
+ static public void EmitCode ()
+ {
if (attribute_types != null)
foreach (TypeContainer tc in attribute_types)
- tc.Emit ();
-
+ tc.EmitType ();
+
+ CodeGen.Assembly.Emit (Tree.Types);
+ CodeGen.Module.Emit (Tree.Types);
+
+ if (Tree.Types.Enums != null) {
+ foreach (Enum e in Tree.Types.Enums)
+ e.Emit ();
+ }
+
if (type_container_resolve_order != null) {
foreach (TypeContainer tc in type_container_resolve_order)
- tc.EmitConstants ();
-
- foreach (TypeContainer tc in type_container_resolve_order)
- tc.Emit ();
+ tc.EmitType ();
}
- if (Unsafe) {
- ConstructorInfo ci = TypeManager.unverifiable_code_type.GetConstructor (new Type [0]);
-
- if (ci == null) {
- Console.WriteLine ("Internal error !");
- return;
- }
-
- CustomAttributeBuilder cb = new CustomAttributeBuilder (ci, new object [0]);
- CodeGen.ModuleBuilder.SetCustomAttribute (cb);
- }
+ if (Tree.Types.Delegates != null) {
+ foreach (Delegate d in Tree.Types.Delegates)
+ d.Emit ();
+ }
+ //
+ // Run any hooks after all the types have been defined.
+ // This is used to create nested auxiliary classes for example
+ //
+
+ if (EmitCodeHook != null)
+ EmitCodeHook ();
}
//
@@ -739,11 +772,15 @@ namespace Mono.CSharp {
static public FieldBuilder MakeStaticData (byte [] data)
{
FieldBuilder fb;
- int size = data.Length;
- if (impl_details_class == null)
- impl_details_class = CodeGen.ModuleBuilder.DefineType (
- "<PrivateImplementationDetails>", TypeAttributes.NotPublic);
+ if (impl_details_class == null){
+ impl_details_class = CodeGen.Module.Builder.DefineType (
+ "<PrivateImplementationDetails>",
+ TypeAttributes.NotPublic,
+ TypeManager.object_type);
+
+ RegisterHelperClass (impl_details_class);
+ }
fb = impl_details_class.DefineInitializedData (
"$$field-" + (field_count++), data,
@@ -751,22 +788,6 @@ namespace Mono.CSharp {
return fb;
}
-
- //
- // Adds a global attribute that was declared in `container',
- // the attribute is in `attr', and it was defined at `loc'
- //
- static public void AddGlobalAttribute (TypeContainer container,
- AttributeSection attr, Location loc)
- {
- Namespace ns = container.Namespace;
- Attributes a = (Attributes) global_attributes [ns];
-
- if (a == null)
- global_attributes [ns] = new Attributes (attr, loc);
- else
- a.AddAttribute (attr);
- }
}
}
diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs
index f0a9ea71e9a..a64924ed645 100755
--- a/mcs/mcs/statement.cs
+++ b/mcs/mcs/statement.cs
@@ -3,11 +3,14 @@
//
// Author:
// Miguel de Icaza (miguel@ximian.com)
+// Martin Baulig (martin@gnome.org)
//
-// (C) 2001, 2002 Ximian, Inc.
+// (C) 2001, 2002, 2003 Ximian, Inc.
+// (C) 2003, 2004 Novell, Inc.
//
using System;
+using System.Text;
using System.Reflection;
using System.Reflection.Emit;
using System.Diagnostics;
@@ -19,92 +22,95 @@ namespace Mono.CSharp {
public abstract class Statement {
public Location loc;
- ///
- /// Resolves the statement, true means that all sub-statements
- /// did resolve ok.
- //
+ /// <summary>
+ /// Resolves the statement, true means that all sub-statements
+ /// did resolve ok.
+ // </summary>
public virtual bool Resolve (EmitContext ec)
{
return true;
}
-
+
/// <summary>
- /// Return value indicates whether all code paths emitted return.
+ /// We already know that the statement is unreachable, but we still
+ /// need to resolve it to catch errors.
/// </summary>
- public abstract bool Emit (EmitContext ec);
-
- public static Expression ResolveBoolean (EmitContext ec, Expression e, Location loc)
+ public virtual bool ResolveUnreachable (EmitContext ec, bool warn)
{
- e = e.Resolve (ec);
- if (e == null)
- return null;
-
- if (e.Type != TypeManager.bool_type){
- e = Expression.ConvertImplicit (ec, e, TypeManager.bool_type,
- new Location (-1));
- }
+ //
+ // This conflicts with csc's way of doing this, but IMHO it's
+ // the right thing to do.
+ //
+ // If something is unreachable, we still check whether it's
+ // correct. This means that you cannot use unassigned variables
+ // in unreachable code, for instance.
+ //
- if (e == null){
- Report.Error (
- 31, loc, "Can not convert the expression to a boolean");
- }
+ ec.StartFlowBranching (FlowBranching.BranchingType.Block, loc);
+ bool ok = Resolve (ec);
+ ec.KillFlowBranching ();
- if (CodeGen.SymbolWriter != null)
- ec.Mark (loc);
+ if (!ok)
+ return false;
- return e;
+ if (warn && (RootContext.WarningLevel >= 2))
+ Report.Warning (162, loc, "Unreachable code detected");
+ return true;
}
- /// <remarks>
- /// Emits a bool expression.
- /// </remarks>
- public static void EmitBoolExpression (EmitContext ec, Expression bool_expr,
- Label target, bool isTrue)
+ protected void CheckObsolete (Type type)
{
- ILGenerator ig = ec.ig;
-
- bool invert = false;
- if (bool_expr is Unary){
- Unary u = (Unary) bool_expr;
-
- if (u.Oper == Unary.Operator.LogicalNot){
- invert = true;
-
- u.EmitLogicalNot (ec);
- }
- }
+ ObsoleteAttribute obsolete_attr = AttributeTester.GetObsoleteAttribute (type);
+ if (obsolete_attr == null)
+ return;
- if (!invert)
- bool_expr.Emit (ec);
+ AttributeTester.Report_ObsoleteMessage (obsolete_attr, type.FullName, loc);
+ }
+
+ /// <summary>
+ /// Return value indicates whether all code paths emitted return.
+ /// </summary>
+ protected abstract void DoEmit (EmitContext ec);
- if (isTrue){
- if (invert)
- ig.Emit (OpCodes.Brfalse, target);
- else
- ig.Emit (OpCodes.Brtrue, target);
- } else {
- if (invert)
- ig.Emit (OpCodes.Brtrue, target);
- else
- ig.Emit (OpCodes.Brfalse, target);
- }
+ /// <summary>
+ /// Utility wrapper routine for Error, just to beautify the code
+ /// </summary>
+ public void Error (int error, string format, params object[] args)
+ {
+ Error (error, String.Format (format, args));
}
- public static void Warning_DeadCodeFound (Location loc)
+ public void Error (int error, string s)
{
- Report.Warning (162, loc, "Unreachable code detected");
+ if (!Location.IsNull (loc))
+ Report.Error (error, loc, s);
+ else
+ Report.Error (error, s);
}
+
+ /// <summary>
+ /// Return value indicates whether all code paths emitted return.
+ /// </summary>
+ public virtual void Emit (EmitContext ec)
+ {
+ ec.Mark (loc, true);
+ DoEmit (ec);
+ }
}
- public class EmptyStatement : Statement {
+ public sealed class EmptyStatement : Statement {
+
+ private EmptyStatement () {}
+
+ public static readonly EmptyStatement Value = new EmptyStatement ();
+
public override bool Resolve (EmitContext ec)
{
return true;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
- return false;
}
}
@@ -112,6 +118,8 @@ namespace Mono.CSharp {
Expression expr;
public Statement TrueStatement;
public Statement FalseStatement;
+
+ bool is_true_ret;
public If (Expression expr, Statement trueStatement, Location l)
{
@@ -133,52 +141,82 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- expr = ResolveBoolean (ec, expr, loc);
+ Report.Debug (1, "START IF BLOCK", loc);
+
+ expr = Expression.ResolveBoolean (ec, expr, loc);
if (expr == null){
return false;
}
-
- if (TrueStatement.Resolve (ec)){
- if (FalseStatement != null){
- if (FalseStatement.Resolve (ec))
- return true;
-
- return false;
+
+ //
+ // Dead code elimination
+ //
+ if (expr is BoolConstant){
+ bool take = ((BoolConstant) expr).Value;
+
+ if (take){
+ if (!TrueStatement.Resolve (ec))
+ return false;
+
+ if ((FalseStatement != null) &&
+ !FalseStatement.ResolveUnreachable (ec, true))
+ return false;
+ FalseStatement = null;
+ } else {
+ if (!TrueStatement.ResolveUnreachable (ec, true))
+ return false;
+ TrueStatement = null;
+
+ if ((FalseStatement != null) &&
+ !FalseStatement.Resolve (ec))
+ return false;
}
+
return true;
}
- return false;
+
+ ec.StartFlowBranching (FlowBranching.BranchingType.Conditional, loc);
+
+ bool ok = TrueStatement.Resolve (ec);
+
+ is_true_ret = ec.CurrentBranching.CurrentUsageVector.Reachability.IsUnreachable;
+
+ ec.CurrentBranching.CreateSibling ();
+
+ if ((FalseStatement != null) && !FalseStatement.Resolve (ec))
+ ok = false;
+
+ ec.EndFlowBranching ();
+
+ Report.Debug (1, "END IF BLOCK", loc);
+
+ return ok;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
ILGenerator ig = ec.ig;
Label false_target = ig.DefineLabel ();
Label end;
- bool is_true_ret, is_false_ret;
//
- // Dead code elimination
+ // If we're a boolean expression, Resolve() already
+ // eliminated dead code for us.
//
if (expr is BoolConstant){
bool take = ((BoolConstant) expr).Value;
- if (take){
- if (FalseStatement != null){
- Warning_DeadCodeFound (FalseStatement.loc);
- }
- return TrueStatement.Emit (ec);
- } else {
- Warning_DeadCodeFound (TrueStatement.loc);
- if (FalseStatement != null)
- return FalseStatement.Emit (ec);
- }
+ if (take)
+ TrueStatement.Emit (ec);
+ else if (FalseStatement != null)
+ FalseStatement.Emit (ec);
+
+ return;
}
- EmitBoolExpression (ec, expr, false_target, false);
+ expr.EmitBranchable (ec, false_target, false);
- is_true_ret = TrueStatement.Emit (ec);
- is_false_ret = is_true_ret;
+ TrueStatement.Emit (ec);
if (FalseStatement != null){
bool branch_emitted = false;
@@ -188,24 +226,22 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Br, end);
branch_emitted = true;
}
-
+
ig.MarkLabel (false_target);
- is_false_ret = FalseStatement.Emit (ec);
+ FalseStatement.Emit (ec);
if (branch_emitted)
ig.MarkLabel (end);
} else {
ig.MarkLabel (false_target);
- is_false_ret = false;
}
-
- return is_true_ret && is_false_ret;
}
}
public class Do : Statement {
public Expression expr;
public readonly Statement EmbeddedStatement;
+ bool infinite;
public Do (Statement statement, Expression boolExpr, Location l)
{
@@ -216,24 +252,38 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- expr = ResolveBoolean (ec, expr, loc);
+ bool ok = true;
+
+ ec.StartFlowBranching (FlowBranching.BranchingType.Loop, loc);
+
+ if (!EmbeddedStatement.Resolve (ec))
+ ok = false;
+
+ expr = Expression.ResolveBoolean (ec, expr, loc);
if (expr == null)
- return false;
-
- return EmbeddedStatement.Resolve (ec);
+ ok = false;
+ else if (expr is BoolConstant){
+ bool res = ((BoolConstant) expr).Value;
+
+ if (res)
+ infinite = true;
+ }
+
+ ec.CurrentBranching.Infinite = infinite;
+ ec.EndFlowBranching ();
+
+ return ok;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
ILGenerator ig = ec.ig;
Label loop = ig.DefineLabel ();
Label old_begin = ec.LoopBegin;
Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
ec.LoopBegin = ig.DefineLabel ();
ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
ig.MarkLabel (loop);
EmbeddedStatement.Emit (ec);
@@ -248,31 +298,19 @@ namespace Mono.CSharp {
if (res)
ec.ig.Emit (OpCodes.Br, loop);
} else
- EmitBoolExpression (ec, expr, loop, true);
+ expr.EmitBranchable (ec, loop, true);
ig.MarkLabel (ec.LoopEnd);
ec.LoopBegin = old_begin;
ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- //
- // Inform whether we are infinite or not
- //
- if (expr is BoolConstant){
- BoolConstant bc = (BoolConstant) expr;
-
- if (bc.Value == true)
- return true;
- }
-
- return false;
}
}
public class While : Statement {
public Expression expr;
public readonly Statement Statement;
+ bool infinite, empty;
public While (Expression boolExpr, Statement statement, Location l)
{
@@ -283,65 +321,80 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- expr = ResolveBoolean (ec, expr, loc);
+ bool ok = true;
+
+ expr = Expression.ResolveBoolean (ec, expr, loc);
if (expr == null)
return false;
-
- return Statement.Resolve (ec);
+
+ //
+ // Inform whether we are infinite or not
+ //
+ if (expr is BoolConstant){
+ BoolConstant bc = (BoolConstant) expr;
+
+ if (bc.Value == false){
+ if (!Statement.ResolveUnreachable (ec, true))
+ return false;
+ empty = true;
+ return true;
+ } else
+ infinite = true;
+ }
+
+ ec.StartFlowBranching (FlowBranching.BranchingType.Loop, loc);
+
+ if (!Statement.Resolve (ec))
+ ok = false;
+
+ ec.CurrentBranching.Infinite = infinite;
+ ec.EndFlowBranching ();
+
+ return ok;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
+ if (empty)
+ return;
+
ILGenerator ig = ec.ig;
Label old_begin = ec.LoopBegin;
Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
- Label while_loop = ig.DefineLabel ();
- bool ret;
ec.LoopBegin = ig.DefineLabel ();
ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
-
- ig.Emit (OpCodes.Br, ec.LoopBegin);
- ig.MarkLabel (while_loop);
//
// Inform whether we are infinite or not
//
if (expr is BoolConstant){
- BoolConstant bc = (BoolConstant) expr;
-
ig.MarkLabel (ec.LoopBegin);
- if (bc.Value == false){
- Warning_DeadCodeFound (Statement.loc);
- ret = false;
- } else {
- Statement.Emit (ec);
- ig.Emit (OpCodes.Br, ec.LoopBegin);
+ Statement.Emit (ec);
+ ig.Emit (OpCodes.Br, ec.LoopBegin);
- //
- // Inform that we are infinite (ie, `we return')
- //
- ret = true;
- }
+ //
+ // Inform that we are infinite (ie, `we return'), only
+ // if we do not `break' inside the code.
+ //
ig.MarkLabel (ec.LoopEnd);
} else {
+ Label while_loop = ig.DefineLabel ();
+
+ ig.Emit (OpCodes.Br, ec.LoopBegin);
+ ig.MarkLabel (while_loop);
+
Statement.Emit (ec);
ig.MarkLabel (ec.LoopBegin);
- EmitBoolExpression (ec, expr, while_loop, true);
+ expr.EmitBranchable (ec, while_loop, true);
+
ig.MarkLabel (ec.LoopEnd);
-
- ret = false;
}
ec.LoopBegin = old_begin;
ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- return ret;
}
}
@@ -350,6 +403,7 @@ namespace Mono.CSharp {
readonly Statement InitStatement;
readonly Statement Increment;
readonly Statement Statement;
+ bool infinite, empty;
public For (Statement initStatement,
Expression test,
@@ -368,79 +422,102 @@ namespace Mono.CSharp {
{
bool ok = true;
- if (Test != null){
- Test = ResolveBoolean (ec, Test, loc);
- if (Test == null)
- ok = false;
- }
-
if (InitStatement != null){
if (!InitStatement.Resolve (ec))
ok = false;
}
+ if (Test != null){
+ Test = Expression.ResolveBoolean (ec, Test, loc);
+ if (Test == null)
+ ok = false;
+ else if (Test is BoolConstant){
+ BoolConstant bc = (BoolConstant) Test;
+
+ if (bc.Value == false){
+ if (!Statement.ResolveUnreachable (ec, true))
+ return false;
+ if ((Increment != null) &&
+ !Increment.ResolveUnreachable (ec, false))
+ return false;
+ empty = true;
+ return true;
+ } else
+ infinite = true;
+ }
+ } else
+ infinite = true;
+
+ ec.StartFlowBranching (FlowBranching.BranchingType.Loop, loc);
+ if (!infinite)
+ ec.CurrentBranching.CreateSibling ();
+
+ if (!Statement.Resolve (ec))
+ ok = false;
+
if (Increment != null){
if (!Increment.Resolve (ec))
ok = false;
}
-
- return Statement.Resolve (ec) && ok;
+
+ ec.CurrentBranching.Infinite = infinite;
+ ec.EndFlowBranching ();
+
+ return ok;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
+ if (empty)
+ return;
+
ILGenerator ig = ec.ig;
Label old_begin = ec.LoopBegin;
Label old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
Label loop = ig.DefineLabel ();
-
- if (InitStatement != null)
- if (! (InitStatement is EmptyStatement))
- InitStatement.Emit (ec);
+ Label test = ig.DefineLabel ();
+
+ if (InitStatement != null && InitStatement != EmptyStatement.Value)
+ InitStatement.Emit (ec);
ec.LoopBegin = ig.DefineLabel ();
ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
+ ig.Emit (OpCodes.Br, test);
ig.MarkLabel (loop);
+ Statement.Emit (ec);
+
+ ig.MarkLabel (ec.LoopBegin);
+ if (Increment != EmptyStatement.Value)
+ Increment.Emit (ec);
+ ig.MarkLabel (test);
//
// If test is null, there is no test, and we are just
// an infinite loop
//
- if (Test != null)
- EmitBoolExpression (ec, Test, ec.LoopEnd, false);
-
- Statement.Emit (ec);
- ig.MarkLabel (ec.LoopBegin);
- if (!(Increment is EmptyStatement))
- Increment.Emit (ec);
- ig.Emit (OpCodes.Br, loop);
+ if (Test != null){
+ //
+ // The Resolve code already catches the case for
+ // Test == BoolConstant (false) so we know that
+ // this is true
+ //
+ if (Test is BoolConstant)
+ ig.Emit (OpCodes.Br, loop);
+ else
+ Test.EmitBranchable (ec, loop, true);
+
+ } else
+ ig.Emit (OpCodes.Br, loop);
ig.MarkLabel (ec.LoopEnd);
ec.LoopBegin = old_begin;
ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- //
- // Inform whether we are infinite or not
- //
- if (Test != null){
- if (Test is BoolConstant){
- BoolConstant bc = (BoolConstant) Test;
-
- if (bc.Value)
- return true;
- }
- return false;
- } else
- return true;
}
}
public class StatementExpression : Statement {
- Expression expr;
+ ExpressionStatement expr;
public StatementExpression (ExpressionStatement expr, Location l)
{
@@ -450,22 +527,13 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- expr = (Expression) expr.Resolve (ec);
+ expr = expr.ResolveStatement (ec);
return expr != null;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
- ILGenerator ig = ec.ig;
-
- if (expr is ExpressionStatement)
- ((ExpressionStatement) expr).EmitStatement (ec);
- else {
- expr.Emit (ec);
- ig.Emit (OpCodes.Pop);
- }
-
- return false;
+ expr.EmitStatement (ec);
}
public override string ToString ()
@@ -486,64 +554,96 @@ namespace Mono.CSharp {
loc = l;
}
+ bool in_exc;
+
public override bool Resolve (EmitContext ec)
{
- if (Expr != null){
- Expr = Expr.Resolve (ec);
- if (Expr == null)
- return false;
- }
- return true;
- }
-
- public override bool Emit (EmitContext ec)
- {
- if (ec.InFinally){
- Report.Error (157,loc,"Control can not leave the body of the finally block");
- return false;
- }
-
if (ec.ReturnType == null){
if (Expr != null){
- Report.Error (127, loc, "Return with a value not allowed here");
+ if (ec.CurrentAnonymousMethod != null){
+ Report.Error (1662, loc, String.Format (
+ "Anonymous method could not be converted to delegate " +
+ "since the return value does not match the delegate value"));
+ }
+ Error (127, "Return with a value not allowed here");
return false;
}
} else {
if (Expr == null){
- Report.Error (126, loc, "An object of type `" +
- TypeManager.CSharpName (ec.ReturnType) + "' is " +
- "expected for the return statement");
+ Error (126, "An object of type `{0}' is expected " +
+ "for the return statement",
+ TypeManager.CSharpName (ec.ReturnType));
return false;
}
- if (Expr.Type != ec.ReturnType)
- Expr = Expression.ConvertImplicitRequired (
- ec, Expr, ec.ReturnType, loc);
-
+ Expr = Expr.Resolve (ec);
if (Expr == null)
return false;
+ if (Expr.Type != ec.ReturnType) {
+ Expr = Convert.ImplicitConversionRequired (
+ ec, Expr, ec.ReturnType, loc);
+ if (Expr == null)
+ return false;
+ }
+ }
+
+ if (ec.InIterator){
+ Error (-206, "Return statement not allowed inside iterators");
+ return false;
+ }
+
+ FlowBranching.UsageVector vector = ec.CurrentBranching.CurrentUsageVector;
+
+ if (ec.CurrentBranching.InTryOrCatch (true)) {
+ ec.CurrentBranching.AddFinallyVector (vector);
+ in_exc = true;
+ } else if (ec.CurrentBranching.InFinally (true)) {
+ Error (157, "Control can not leave the body of the finally block");
+ return false;
+ } else
+ vector.CheckOutParameters (ec.CurrentBranching);
+
+ if (in_exc)
+ ec.NeedReturnLabel ();
+
+ ec.CurrentBranching.CurrentUsageVector.Return ();
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ if (Expr != null) {
Expr.Emit (ec);
- if (ec.InTry || ec.InCatch)
+ if (in_exc)
ec.ig.Emit (OpCodes.Stloc, ec.TemporaryReturn ());
}
- if (ec.InTry || ec.InCatch)
+ if (in_exc)
ec.ig.Emit (OpCodes.Leave, ec.ReturnLabel);
else
ec.ig.Emit (OpCodes.Ret);
-
- return true;
}
}
public class Goto : Statement {
string target;
Block block;
+ LabeledStatement label;
public override bool Resolve (EmitContext ec)
{
+ label = ec.CurrentBranching.LookupLabel (target, loc);
+ if (label == null)
+ return false;
+
+ // If this is a forward goto.
+ if (!label.IsDefined)
+ label.AddUsageVector (ec.CurrentBranching.CurrentUsageVector);
+
+ ec.CurrentBranching.CurrentUsageVector.Goto ();
+
return true;
}
@@ -560,34 +660,24 @@ namespace Mono.CSharp {
}
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
- LabeledStatement label = block.LookupLabel (target);
-
- if (label == null){
- //
- // Maybe we should catch this before?
- //
- Report.Error (
- 159, loc,
- "No such label `" + target + "' in this scope");
- return false;
- }
Label l = label.LabelTarget (ec);
ec.ig.Emit (OpCodes.Br, l);
-
- return false;
}
}
public class LabeledStatement : Statement {
- string label_name;
+ public readonly Location Location;
bool defined;
+ bool referenced;
Label label;
+
+ FlowBranching.UsageVector vectors;
- public LabeledStatement (string label_name)
+ public LabeledStatement (string label_name, Location l)
{
- this.label_name = label_name;
+ this.Location = l;
}
public Label LabelTarget (EmitContext ec)
@@ -600,12 +690,38 @@ namespace Mono.CSharp {
return label;
}
- public override bool Emit (EmitContext ec)
+ public bool IsDefined {
+ get {
+ return defined;
+ }
+ }
+
+ public bool HasBeenReferenced {
+ get {
+ return referenced;
+ }
+ }
+
+ public void AddUsageVector (FlowBranching.UsageVector vector)
+ {
+ vector = vector.Clone ();
+ vector.Next = vectors;
+ vectors = vector;
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ ec.CurrentBranching.Label (vectors);
+
+ referenced = true;
+
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
{
LabelTarget (ec);
ec.ig.MarkLabel (label);
-
- return false;
}
}
@@ -620,19 +736,24 @@ namespace Mono.CSharp {
loc = l;
}
- public override bool Emit (EmitContext ec)
+ public override bool Resolve (EmitContext ec)
+ {
+ ec.CurrentBranching.CurrentUsageVector.Goto ();
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
{
if (ec.Switch == null){
Report.Error (153, loc, "goto default is only valid in a switch statement");
- return false;
+ return;
}
if (!ec.Switch.GotDefault){
Report.Error (159, loc, "No default target on switch statement");
- return false;
+ return;
}
ec.ig.Emit (OpCodes.Br, ec.Switch.DefaultTarget);
- return false;
}
}
@@ -641,6 +762,7 @@ namespace Mono.CSharp {
/// </summary>
public class GotoCase : Statement {
Expression expr;
+ SwitchLabel sl;
public GotoCase (Expression e, Location l)
{
@@ -648,7 +770,7 @@ namespace Mono.CSharp {
loc = l;
}
- public override bool Emit (EmitContext ec)
+ public override bool Resolve (EmitContext ec)
{
if (ec.Switch == null){
Report.Error (153, loc, "goto case is only valid in a switch statement");
@@ -670,17 +792,23 @@ namespace Mono.CSharp {
if (val == null)
return false;
- SwitchLabel sl = (SwitchLabel) ec.Switch.Elements [val];
+ sl = (SwitchLabel) ec.Switch.Elements [val];
if (sl == null){
Report.Error (
159, loc,
"No such label 'case " + val + "': for the goto case");
+ return false;
}
- ec.ig.Emit (OpCodes.Br, sl.ILLabelCode);
+ ec.CurrentBranching.CurrentUsageVector.Goto ();
return true;
}
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ ec.ig.Emit (OpCodes.Br, sl.GetILLabelCode (ec));
+ }
}
public class Throw : Statement {
@@ -694,33 +822,51 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
+ bool in_catch = ec.CurrentBranching.InCatch ();
+ ec.CurrentBranching.CurrentUsageVector.Throw ();
+
if (expr != null){
expr = expr.Resolve (ec);
if (expr == null)
return false;
+
+ ExprClass eclass = expr.eclass;
+
+ if (!(eclass == ExprClass.Variable || eclass == ExprClass.PropertyAccess ||
+ eclass == ExprClass.Value || eclass == ExprClass.IndexerAccess)) {
+ expr.Error_UnexpectedKind ("value, variable, property or indexer access ", loc);
+ return false;
+ }
+
+ Type t = expr.Type;
+
+ if ((t != TypeManager.exception_type) &&
+ !t.IsSubclassOf (TypeManager.exception_type) &&
+ !(expr is NullLiteral)) {
+ Error (155,
+ "The type caught or thrown must be derived " +
+ "from System.Exception");
+ return false;
+ }
+ } else if (!in_catch) {
+ Error (156,
+ "A throw statement with no argument is only " +
+ "allowed in a catch clause");
+ return false;
}
+
return true;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
- if (expr == null){
- if (ec.InCatch)
- ec.ig.Emit (OpCodes.Rethrow);
- else {
- Report.Error (
- 156, loc,
- "A throw statement with no argument is only " +
- "allowed in a catch clause");
- }
- return false;
- }
-
- expr.Emit (ec);
-
- ec.ig.Emit (OpCodes.Throw);
+ if (expr == null)
+ ec.ig.Emit (OpCodes.Rethrow);
+ else {
+ expr.Emit (ec);
- return true;
+ ec.ig.Emit (OpCodes.Throw);
+ }
}
}
@@ -731,18 +877,41 @@ namespace Mono.CSharp {
loc = l;
}
- public override bool Emit (EmitContext ec)
+ bool crossing_exc;
+
+ public override bool Resolve (EmitContext ec)
+ {
+ if (!ec.CurrentBranching.InLoop () && !ec.CurrentBranching.InSwitch ()){
+ Error (139, "No enclosing loop or switch to continue to");
+ return false;
+ } else if (ec.CurrentBranching.InFinally (false)) {
+ Error (157, "Control can not leave the body of the finally block");
+ return false;
+ } else if (ec.CurrentBranching.InTryOrCatch (false))
+ ec.CurrentBranching.AddFinallyVector (
+ ec.CurrentBranching.CurrentUsageVector);
+ else if (ec.CurrentBranching.InLoop ())
+ ec.CurrentBranching.AddBreakVector (
+ ec.CurrentBranching.CurrentUsageVector);
+
+ crossing_exc = ec.CurrentBranching.BreakCrossesTryCatchBoundary ();
+
+ if (!crossing_exc)
+ ec.NeedReturnLabel ();
+
+ ec.CurrentBranching.CurrentUsageVector.Break ();
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
{
ILGenerator ig = ec.ig;
- if (ec.InLoop == false && ec.Switch == null){
- Report.Error (139, loc, "No enclosing loop or switch to continue to");
- return false;
+ if (crossing_exc)
+ ig.Emit (OpCodes.Leave, ec.LoopEnd);
+ else {
+ ig.Emit (OpCodes.Br, ec.LoopEnd);
}
-
- ig.Emit (OpCodes.Br, ec.LoopEnd);
-
- return false;
}
}
@@ -753,52 +922,198 @@ namespace Mono.CSharp {
loc = l;
}
- public override bool Emit (EmitContext ec)
+ bool crossing_exc;
+
+ public override bool Resolve (EmitContext ec)
{
- Label begin = ec.LoopBegin;
-
- if (!ec.InLoop){
- Report.Error (139, loc, "No enclosing loop to continue to");
+ if (!ec.CurrentBranching.InLoop () && !ec.CurrentBranching.InSwitch ()){
+ Error (139, "No enclosing loop to continue to");
return false;
- }
+ } else if (ec.CurrentBranching.InFinally (false)) {
+ Error (157, "Control can not leave the body of the finally block");
+ return false;
+ } else if (ec.CurrentBranching.InTryOrCatch (false))
+ ec.CurrentBranching.AddFinallyVector (ec.CurrentBranching.CurrentUsageVector);
- //
- // UGH: Non trivial. This Br might cross a try/catch boundary
- // How can we tell?
- //
- // while () {
- // try { ... } catch { continue; }
- // }
- //
- // From:
- // try {} catch { while () { continue; }}
- //
- ec.ig.Emit (OpCodes.Br, begin);
- return false;
+ crossing_exc = ec.CurrentBranching.BreakCrossesTryCatchBoundary ();
+
+ ec.CurrentBranching.CurrentUsageVector.Goto ();
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ Label begin = ec.LoopBegin;
+
+ if (crossing_exc)
+ ec.ig.Emit (OpCodes.Leave, begin);
+ else
+ ec.ig.Emit (OpCodes.Br, begin);
}
}
-
- public class VariableInfo {
- public readonly string Type;
+
+ //
+ // The information about a user-perceived local variable
+ //
+ public class LocalInfo {
+ public Expression Type;
+
+ //
+ // Most of the time a variable will be stored in a LocalBuilder
+ //
+ // But sometimes, it will be stored in a field (variables that have been
+ // hoisted by iterators or by anonymous methods). The context of the field will
+ // be stored in the EmitContext
+ //
+ //
public LocalBuilder LocalBuilder;
+ public FieldBuilder FieldBuilder;
+
public Type VariableType;
+ public readonly string Name;
public readonly Location Location;
+ public readonly Block Block;
+
+ public VariableInfo VariableInfo;
+
+ enum Flags : byte {
+ Used = 1,
+ ReadOnly = 2,
+ Pinned = 4,
+ IsThis = 8,
+ Captured = 16
+ }
+
+ Flags flags;
- public bool Used;
- public bool Assigned;
- public bool ReadOnly;
-
- public VariableInfo (string type, Location l)
+ public LocalInfo (Expression type, string name, Block block, Location l)
{
Type = type;
- LocalBuilder = null;
+ Name = name;
+ Block = block;
Location = l;
}
- public void MakePinned ()
+ public LocalInfo (TypeContainer tc, Block block, Location l)
{
- TypeManager.MakePinned (LocalBuilder);
- }
+ VariableType = tc.TypeBuilder;
+ Block = block;
+ Location = l;
+ }
+
+ public bool IsThisAssigned (EmitContext ec, Location loc)
+ {
+ if (VariableInfo == null)
+ throw new Exception ();
+
+ if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (VariableInfo))
+ return true;
+
+ return VariableInfo.TypeInfo.IsFullyInitialized (ec.CurrentBranching, VariableInfo, loc);
+ }
+
+ public bool IsAssigned (EmitContext ec)
+ {
+ if (VariableInfo == null)
+ throw new Exception ();
+
+ return !ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (VariableInfo);
+ }
+
+ public bool Resolve (EmitContext ec)
+ {
+ if (VariableType == null) {
+ TypeExpr texpr = Type.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
+ return false;
+
+ VariableType = texpr.ResolveType (ec);
+ }
+
+ if (VariableType == TypeManager.void_type) {
+ Report.Error (1547, Location,
+ "Keyword 'void' cannot be used in this context");
+ return false;
+ }
+
+ if (VariableType.IsAbstract && VariableType.IsSealed) {
+ Report.Error (723, Location, "Cannot declare variable of static type '{0}'", TypeManager.CSharpName (VariableType));
+ return false;
+ }
+// TODO: breaks the build
+// if (VariableType.IsPointer && !ec.InUnsafe)
+// Expression.UnsafeError (Location);
+
+ return true;
+ }
+
+ //
+ // Whether the variable is Fixed (because its Pinned or its a value type)
+ //
+ public bool IsFixed {
+ get {
+ if (((flags & Flags.Pinned) != 0) || TypeManager.IsValueType (VariableType))
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsCaptured {
+ get {
+ return (flags & Flags.Captured) != 0;
+ }
+
+ set {
+ flags |= Flags.Captured;
+ }
+ }
+
+ public override string ToString ()
+ {
+ return String.Format ("LocalInfo ({0},{1},{2},{3})",
+ Name, Type, VariableInfo, Location);
+ }
+
+ public bool Used {
+ get {
+ return (flags & Flags.Used) != 0;
+ }
+ set {
+ flags = value ? (flags | Flags.Used) : (unchecked (flags & ~Flags.Used));
+ }
+ }
+
+ public bool ReadOnly {
+ get {
+ return (flags & Flags.ReadOnly) != 0;
+ }
+ set {
+ flags = value ? (flags | Flags.ReadOnly) : (unchecked (flags & ~Flags.ReadOnly));
+ }
+ }
+
+ //
+ // Whether the variable is pinned, if Pinned the variable has been
+ // allocated in a pinned slot with DeclareLocal.
+ //
+ public bool Pinned {
+ get {
+ return (flags & Flags.Pinned) != 0;
+ }
+ set {
+ flags = value ? (flags | Flags.Pinned) : (flags & ~Flags.Pinned);
+ }
+ }
+
+ public bool IsThis {
+ get {
+ return (flags & Flags.IsThis) != 0;
+ }
+ set {
+ flags = value ? (flags | Flags.IsThis) : (flags & ~Flags.IsThis);
+ }
+ }
}
/// <summary>
@@ -811,17 +1126,70 @@ namespace Mono.CSharp {
///
/// Implicit blocks are used as labels or to introduce variable
/// declarations.
+ ///
+ /// Top-level blocks derive from Block, and they are called ToplevelBlock
+ /// they contain extra information that is not necessary on normal blocks.
/// </remarks>
public class Block : Statement {
- public readonly Block Parent;
- public readonly bool Implicit;
+ public Block Parent;
public readonly Location StartLocation;
- public Location EndLocation;
+ public Location EndLocation = Location.Null;
+
+ [Flags]
+ public enum Flags {
+ Implicit = 1,
+ Unchecked = 2,
+ BlockUsed = 4,
+ VariablesInitialized = 8,
+ HasRet = 16,
+ IsDestructor = 32,
+ HasVarargs = 64,
+ IsToplevel = 128,
+ Unsafe = 256
+ }
+ Flags flags;
+
+ public bool Implicit {
+ get {
+ return (flags & Flags.Implicit) != 0;
+ }
+ }
+
+ public bool Unchecked {
+ get {
+ return (flags & Flags.Unchecked) != 0;
+ }
+ set {
+ flags |= Flags.Unchecked;
+ }
+ }
+
+ public bool Unsafe {
+ get {
+ return (flags & Flags.Unsafe) != 0;
+ }
+ set {
+ flags |= Flags.Unsafe;
+ }
+ }
+
+ public bool HasVarargs {
+ get {
+ if (Parent != null)
+ return Parent.HasVarargs;
+ else
+ return (flags & Flags.HasVarargs) != 0;
+ }
+ set {
+ flags |= Flags.HasVarargs;
+ }
+ }
//
// The statements in this block
//
ArrayList statements;
+ int num_statements;
//
// An array of Blocks. We keep track of children just
@@ -847,40 +1215,72 @@ namespace Mono.CSharp {
Hashtable constants;
//
- // Maps variable names to ILGenerator.LocalBuilders
+ // The parameters for the block, this is only needed on the toplevel block really
+ // TODO: move `parameters' into ToplevelBlock
+ Parameters parameters;
+
//
- Hashtable local_builders;
-
- bool used = false;
+ // If this is a switch section, the enclosing switch block.
+ //
+ Block switch_block;
- static int id;
+ protected static int id;
int this_id;
public Block (Block parent)
- : this (parent, false, Location.Null, Location.Null)
+ : this (parent, (Flags) 0, Location.Null, Location.Null)
{ }
- public Block (Block parent, bool implicit_block)
- : this (parent, implicit_block, Location.Null, Location.Null)
+ public Block (Block parent, Flags flags)
+ : this (parent, flags, Location.Null, Location.Null)
+ { }
+
+ public Block (Block parent, Flags flags, Parameters parameters)
+ : this (parent, flags, parameters, Location.Null, Location.Null)
{ }
public Block (Block parent, Location start, Location end)
- : this (parent, false, start, end)
+ : this (parent, (Flags) 0, start, end)
+ { }
+
+ public Block (Block parent, Parameters parameters, Location start, Location end)
+ : this (parent, (Flags) 0, parameters, start, end)
+ { }
+
+ public Block (Block parent, Flags flags, Location start, Location end)
+ : this (parent, flags, Parameters.EmptyReadOnlyParameters, start, end)
{ }
- public Block (Block parent, bool implicit_block, Location start, Location end)
+ public Block (Block parent, Flags flags, Parameters parameters,
+ Location start, Location end)
{
if (parent != null)
parent.AddChild (this);
this.Parent = parent;
- this.Implicit = implicit_block;
+ this.flags = flags;
+ this.parameters = parameters;
this.StartLocation = start;
this.EndLocation = end;
this.loc = start;
this_id = id++;
statements = new ArrayList ();
+
+ if (parent != null && Implicit) {
+ if (parent.child_variable_names == null)
+ parent.child_variable_names = new Hashtable();
+ // share with parent
+ child_variable_names = parent.child_variable_names;
+ }
+
+ }
+
+ public Block CreateSwitchBlock (Location start)
+ {
+ Block new_block = new Block (this, start, start);
+ new_block.switch_block = this;
+ return new_block;
}
public int ID {
@@ -888,7 +1288,7 @@ namespace Mono.CSharp {
return this_id;
}
}
-
+
void AddChild (Block b)
{
if (children == null)
@@ -911,54 +1311,225 @@ namespace Mono.CSharp {
/// otherwise.
/// </returns>
///
- public bool AddLabel (string name, LabeledStatement target)
+ public bool AddLabel (string name, LabeledStatement target, Location loc)
{
+ if (switch_block != null)
+ return switch_block.AddLabel (name, target, loc);
+
+ Block cur = this;
+ while (cur != null) {
+ if (cur.DoLookupLabel (name) != null) {
+ Report.Error (
+ 140, loc, "The label '{0}' is a duplicate",
+ name);
+ return false;
+ }
+
+ if (!Implicit)
+ break;
+
+ cur = cur.Parent;
+ }
+
+ while (cur != null) {
+ if (cur.DoLookupLabel (name) != null) {
+ Report.Error (
+ 158, loc,
+ "The label '{0}' shadows another label " +
+ "by the same name in a containing scope.",
+ name);
+ return false;
+ }
+
+ if (children != null) {
+ foreach (Block b in children) {
+ LabeledStatement s = b.DoLookupLabel (name);
+ if (s == null)
+ continue;
+
+ Report.Error (
+ 158, s.Location,
+ "The label '{0}' shadows another " +
+ "label by the same name in a " +
+ "containing scope.",
+ name);
+ return false;
+ }
+ }
+
+
+ cur = cur.Parent;
+ }
+
if (labels == null)
labels = new Hashtable ();
- if (labels.Contains (name))
- return false;
-
+
labels.Add (name, target);
return true;
}
public LabeledStatement LookupLabel (string name)
{
- if (labels != null){
+ LabeledStatement s = DoLookupLabel (name);
+ if (s != null)
+ return s;
+
+ if (children == null)
+ return null;
+
+ foreach (Block child in children) {
+ if (!child.Implicit)
+ continue;
+
+ s = child.LookupLabel (name);
+ if (s != null)
+ return s;
+ }
+
+ return null;
+ }
+
+ LabeledStatement DoLookupLabel (string name)
+ {
+ if (switch_block != null)
+ return switch_block.LookupLabel (name);
+
+ if (labels != null)
if (labels.Contains (name))
return ((LabeledStatement) labels [name]);
+
+ return null;
+ }
+
+ LocalInfo this_variable = null;
+
+ // <summary>
+ // Returns the "this" instance variable of this block.
+ // See AddThisVariable() for more information.
+ // </summary>
+ public LocalInfo ThisVariable {
+ get {
+ if (this_variable != null)
+ return this_variable;
+ else if (Parent != null)
+ return Parent.ThisVariable;
+ else
+ return null;
}
+ }
- if (Parent != null)
- return Parent.LookupLabel (name);
+ Hashtable child_variable_names;
- return null;
+ // <summary>
+ // Marks a variable with name @name as being used in a child block.
+ // If a variable name has been used in a child block, it's illegal to
+ // declare a variable with the same name in the current block.
+ // </summary>
+ public void AddChildVariableName (string name)
+ {
+ if (child_variable_names == null)
+ child_variable_names = new Hashtable ();
+
+ if (!child_variable_names.Contains (name))
+ child_variable_names.Add (name, true);
+ }
+
+ // <summary>
+ // Checks whether a variable name has already been used in a child block.
+ // </summary>
+ public bool IsVariableNameUsedInChildBlock (string name)
+ {
+ if (child_variable_names == null)
+ return false;
+
+ return child_variable_names.Contains (name);
}
- public VariableInfo AddVariable (string type, string name, Parameters pars, Location l)
+ // <summary>
+ // This is used by non-static `struct' constructors which do not have an
+ // initializer - in this case, the constructor must initialize all of the
+ // struct's fields. To do this, we add a "this" variable and use the flow
+ // analysis code to ensure that it's been fully initialized before control
+ // leaves the constructor.
+ // </summary>
+ public LocalInfo AddThisVariable (TypeContainer tc, Location l)
{
+ if (this_variable != null)
+ return this_variable;
+
if (variables == null)
variables = new Hashtable ();
- if (GetVariableType (name) != null)
+ this_variable = new LocalInfo (tc, this, l);
+ this_variable.Used = true;
+ this_variable.IsThis = true;
+
+ variables.Add ("this", this_variable);
+
+ return this_variable;
+ }
+
+ public LocalInfo AddVariable (Expression type, string name, Parameters pars, Location l)
+ {
+ if (variables == null)
+ variables = new Hashtable ();
+
+ LocalInfo vi = GetLocalInfo (name);
+ if (vi != null) {
+ if (vi.Block != this)
+ Report.Error (136, l, "A local variable named `" + name + "' " +
+ "cannot be declared in this scope since it would " +
+ "give a different meaning to `" + name + "', which " +
+ "is already used in a `parent or current' scope to " +
+ "denote something else");
+ else
+ Report.Error (128, l, "A local variable `" + name + "' is already " +
+ "defined in this scope");
+ return null;
+ }
+
+ if (IsVariableNameUsedInChildBlock (name)) {
+ Report.Error (136, l, "A local variable named `" + name + "' " +
+ "cannot be declared in this scope since it would " +
+ "give a different meaning to `" + name + "', which " +
+ "is already used in a `child' scope to denote something " +
+ "else");
return null;
+ }
if (pars != null) {
- int idx = 0;
+ int idx;
Parameter p = pars.GetParameterByName (name, out idx);
- if (p != null)
+ if (p != null) {
+ Report.Error (136, l, "A local variable named `" + name + "' " +
+ "cannot be declared in this scope since it would " +
+ "give a different meaning to `" + name + "', which " +
+ "is already used in a `parent or current' scope to " +
+ "denote something else");
return null;
+ }
}
-
- VariableInfo vi = new VariableInfo (type, l);
+
+ vi = new LocalInfo (type, name, this, l);
variables.Add (name, vi);
+ // Mark 'name' as "used by a child block" in every surrounding block
+ Block cur = this;
+ while (cur != null && cur.Implicit)
+ cur = cur.Parent;
+ if (cur != null)
+ for (Block par = cur.Parent; par != null; par = par.Parent)
+ par.AddChildVariableName (name);
+
+ if ((flags & Flags.VariablesInitialized) != 0)
+ throw new Exception ();
+
// Console.WriteLine ("Adding {0} to {1}", name, ID);
return vi;
}
- public bool AddConstant (string type, string name, Expression value, Parameters pars, Location l)
+ public bool AddConstant (Expression type, string name, Expression value, Parameters pars, Location l)
{
if (AddVariable (type, name, pars, l) == null)
return false;
@@ -976,26 +1547,21 @@ namespace Mono.CSharp {
}
}
- public VariableInfo GetVariableInfo (string name)
+ public LocalInfo GetLocalInfo (string name)
{
- if (variables != null) {
- object temp;
- temp = variables [name];
-
- if (temp != null){
- return (VariableInfo) temp;
+ for (Block b = this; b != null; b = b.Parent) {
+ if (b.variables != null) {
+ LocalInfo ret = b.variables [name] as LocalInfo;
+ if (ret != null)
+ return ret;
}
}
-
- if (Parent != null)
- return Parent.GetVariableInfo (name);
-
return null;
}
-
- public string GetVariableType (string name)
+
+ public Expression GetVariableType (string name)
{
- VariableInfo vi = GetVariableInfo (name);
+ LocalInfo vi = GetLocalInfo (name);
if (vi != null)
return vi.Type;
@@ -1005,39 +1571,17 @@ namespace Mono.CSharp {
public Expression GetConstantExpression (string name)
{
- if (constants != null) {
- object temp;
- temp = constants [name];
-
- if (temp != null)
- return (Expression) temp;
+ for (Block b = this; b != null; b = b.Parent) {
+ if (b.constants != null) {
+ Expression ret = b.constants [name] as Expression;
+ if (ret != null)
+ return ret;
+ }
}
-
- if (Parent != null)
- return Parent.GetConstantExpression (name);
-
return null;
}
/// <summary>
- /// True if the variable named @name has been defined
- /// in this block
- /// </summary>
- public bool IsVariableDefined (string name)
- {
- // Console.WriteLine ("Looking up {0} in {1}", name, ID);
- if (variables != null) {
- if (variables.Contains (name))
- return true;
- }
-
- if (Parent != null)
- return Parent.IsVariableDefined (name);
-
- return false;
- }
-
- /// <summary>
/// True if the variable named @name is a constant
/// </summary>
public bool IsConstant (string name)
@@ -1048,16 +1592,79 @@ namespace Mono.CSharp {
return e != null;
}
-
- /// <summary>
- /// Use to fetch the statement associated with this label
- /// </summary>
- public Statement this [string name] {
- get {
- return (Statement) labels [name];
- }
+
+ //
+ // Returns a `ParameterReference' for the given name, or null if there
+ // is no such parameter
+ //
+ public ParameterReference GetParameterReference (string name, Location loc)
+ {
+ Block b = this;
+
+ do {
+ Parameters pars = b.parameters;
+
+ if (pars != null){
+ Parameter par;
+ int idx;
+
+ par = pars.GetParameterByName (name, out idx);
+ if (par != null){
+ ParameterReference pr;
+
+ pr = new ParameterReference (pars, this, idx, name, loc);
+ return pr;
+ }
+ }
+ b = b.Parent;
+ } while (b != null);
+ return null;
+ }
+
+ //
+ // Whether the parameter named `name' is local to this block,
+ // or false, if the parameter belongs to an encompassing block.
+ //
+ public bool IsLocalParameter (string name)
+ {
+ Block b = this;
+ int toplevel_count = 0;
+
+ do {
+ if (this is ToplevelBlock)
+ toplevel_count++;
+
+ Parameters pars = b.parameters;
+ if (pars != null){
+ if (pars.GetParameterByName (name) != null)
+ return true;
+ return false;
+ }
+ if (toplevel_count > 0)
+ return false;
+ b = b.Parent;
+ } while (b != null);
+ return false;
}
+
+ //
+ // Whether the `name' is a parameter reference
+ //
+ public bool IsParameterReference (string name)
+ {
+ Block b = this;
+ do {
+ Parameters pars = b.parameters;
+
+ if (pars != null)
+ if (pars.GetParameterByName (name) != null)
+ return true;
+ b = b.Parent;
+ } while (b != null);
+ return false;
+ }
+
/// <returns>
/// A list of labels that were not used within this block
/// </returns>
@@ -1070,54 +1677,138 @@ namespace Mono.CSharp {
public void AddStatement (Statement s)
{
statements.Add (s);
- used = true;
+ flags |= Flags.BlockUsed;
}
public bool Used {
get {
- return used;
+ return (flags & Flags.BlockUsed) != 0;
}
}
public void Use ()
{
- used = true;
+ flags |= Flags.BlockUsed;
}
-
+
+ public bool HasRet {
+ get {
+ return (flags & Flags.HasRet) != 0;
+ }
+ }
+
+ public bool IsDestructor {
+ get {
+ return (flags & Flags.IsDestructor) != 0;
+ }
+ }
+
+ public void SetDestructor ()
+ {
+ flags |= Flags.IsDestructor;
+ }
+
+ VariableMap param_map, local_map;
+
+ public VariableMap ParameterMap {
+ get {
+ if ((flags & Flags.VariablesInitialized) == 0)
+ throw new Exception ("Variables have not been initialized yet");
+
+ return param_map;
+ }
+ }
+
+ public VariableMap LocalMap {
+ get {
+ if ((flags & Flags.VariablesInitialized) == 0)
+ throw new Exception ("Variables have not been initialized yet");
+
+ return local_map;
+ }
+ }
+
/// <summary>
/// Emits the variable declarations and labels.
/// </summary>
/// <remarks>
/// tc: is our typecontainer (to resolve type references)
/// ig: is the code generator:
- /// toplevel: the toplevel block. This is used for checking
- /// that no two labels with the same name are used.
/// </remarks>
- public void EmitMeta (EmitContext ec, Block toplevel)
+ public void ResolveMeta (ToplevelBlock toplevel, EmitContext ec, InternalParameters ip)
{
- DeclSpace ds = ec.DeclSpace;
ILGenerator ig = ec.ig;
-
+
+ bool old_unsafe = ec.InUnsafe;
+
+ // If some parent block was unsafe, we remain unsafe even if this block
+ // isn't explicitly marked as such.
+ ec.InUnsafe |= Unsafe;
+
+ //
+ // Compute the VariableMap's.
+ //
+ // Unfortunately, we don't know the type when adding variables with
+ // AddVariable(), so we need to compute this info here.
+ //
+
+ LocalInfo[] locals;
+ if (variables != null) {
+ foreach (LocalInfo li in variables.Values)
+ li.Resolve (ec);
+
+ locals = new LocalInfo [variables.Count];
+ variables.Values.CopyTo (locals, 0);
+ } else
+ locals = new LocalInfo [0];
+
+ if (Parent != null)
+ local_map = new VariableMap (Parent.LocalMap, locals);
+ else
+ local_map = new VariableMap (locals);
+
+ param_map = new VariableMap (ip);
+ flags |= Flags.VariablesInitialized;
+
+ bool old_check_state = ec.ConstantCheckState;
+ ec.ConstantCheckState = (flags & Flags.Unchecked) == 0;
+
//
// Process this block variables
//
if (variables != null){
- local_builders = new Hashtable ();
-
foreach (DictionaryEntry de in variables){
string name = (string) de.Key;
- VariableInfo vi = (VariableInfo) de.Value;
- Type t;
-
- t = RootContext.LookupType (ds, vi.Type, false, vi.Location);
- if (t == null)
+ LocalInfo vi = (LocalInfo) de.Value;
+
+ if (vi.VariableType == null)
continue;
- vi.VariableType = t;
- vi.LocalBuilder = ig.DeclareLocal (t);
+ Type variable_type = vi.VariableType;
- if (CodeGen.SymbolWriter != null)
- vi.LocalBuilder.SetLocalSymInfo (name);
+ if (variable_type.IsPointer){
+ //
+ // Am not really convinced that this test is required (Microsoft does it)
+ // but the fact is that you would not be able to use the pointer variable
+ // *anyways*
+ //
+ if (!TypeManager.VerifyUnManaged (TypeManager.GetElementType (variable_type),
+ vi.Location))
+ continue;
+ }
+
+#if false
+ if (remap_locals)
+ vi.FieldBuilder = ec.MapVariable (name, vi.VariableType);
+ else if (vi.Pinned)
+ //
+ // This is needed to compile on both .NET 1.x and .NET 2.x
+ // the later introduced `DeclareLocal (Type t, bool pinned)'
+ //
+ vi.LocalBuilder = TypeManager.DeclareLocalPinned (ig, vi.VariableType);
+ else if (!vi.IsThis)
+ vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
+#endif
if (constants == null)
continue;
@@ -1126,112 +1817,369 @@ namespace Mono.CSharp {
if (cv == null)
continue;
+ ec.CurrentBlock = this;
Expression e = cv.Resolve (ec);
if (e == null)
continue;
- if (!(e is Constant)){
+ Constant ce = e as Constant;
+ if (ce == null){
Report.Error (133, vi.Location,
"The expression being assigned to `" +
name + "' must be constant (" + e + ")");
continue;
}
+ if (e.Type != variable_type){
+ e = Const.ChangeType (vi.Location, ce, variable_type);
+ if (e == null)
+ continue;
+ }
+
constants.Remove (name);
constants.Add (name, e);
}
}
+ ec.ConstantCheckState = old_check_state;
//
// Now, handle the children
//
if (children != null){
foreach (Block b in children)
- b.EmitMeta (ec, toplevel);
+ b.ResolveMeta (toplevel, ec, ip);
}
+ ec.InUnsafe = old_unsafe;
}
- public void UsageWarning ()
+ //
+ // Emits the local variable declarations for a block
+ //
+ public void EmitMeta (EmitContext ec)
{
- string name;
+ ILGenerator ig = ec.ig;
if (variables != null){
+ bool have_captured_vars = ec.HaveCapturedVariables ();
+ bool remap_locals = ec.RemapToProxy;
+
+ foreach (DictionaryEntry de in variables){
+ LocalInfo vi = (LocalInfo) de.Value;
+
+ if (have_captured_vars && ec.IsCaptured (vi))
+ continue;
+
+ if (remap_locals){
+ vi.FieldBuilder = ec.MapVariable (vi.Name, vi.VariableType);
+ } else {
+ if (vi.Pinned)
+ //
+ // This is needed to compile on both .NET 1.x and .NET 2.x
+ // the later introduced `DeclareLocal (Type t, bool pinned)'
+ //
+ vi.LocalBuilder = TypeManager.DeclareLocalPinned (ig, vi.VariableType);
+ else if (!vi.IsThis)
+ vi.LocalBuilder = ig.DeclareLocal (vi.VariableType);
+ }
+ }
+ }
+
+ if (children != null){
+ foreach (Block b in children)
+ b.EmitMeta (ec);
+ }
+ }
+
+ void UsageWarning (FlowBranching.UsageVector vector)
+ {
+ string name;
+
+ if ((variables != null) && (RootContext.WarningLevel >= 3)) {
foreach (DictionaryEntry de in variables){
- VariableInfo vi = (VariableInfo) de.Value;
+ LocalInfo vi = (LocalInfo) de.Value;
if (vi.Used)
continue;
name = (string) de.Key;
-
- if (vi.Assigned){
- Report.Warning (
- 219, vi.Location, "The variable `" + name +
- "' is assigned but its value is never used");
+
+ if (vector.IsAssigned (vi.VariableInfo)){
+ Report.Warning (219, vi.Location, "The variable '{0}' is assigned but its value is never used", name);
} else {
- Report.Warning (
- 168, vi.Location, "The variable `" +
- name +
- "' is declared but never used");
- }
+ Report.Warning (168, vi.Location, "The variable '{0}' is declared but never used", name);
+ }
}
}
-
- if (children != null)
- foreach (Block b in children)
- b.UsageWarning ();
}
+ bool unreachable_shown;
+
public override bool Resolve (EmitContext ec)
{
Block prev_block = ec.CurrentBlock;
+ bool ok = true;
+
+ int errors = Report.Errors;
ec.CurrentBlock = this;
- foreach (Statement s in statements){
- if (s.Resolve (ec) == false){
- ec.CurrentBlock = prev_block;
- return false;
+ ec.StartFlowBranching (this);
+
+ Report.Debug (4, "RESOLVE BLOCK", StartLocation, ec.CurrentBranching);
+
+ bool unreachable = false;
+
+ int statement_count = statements.Count;
+ for (int ix = 0; ix < statement_count; ix++){
+ Statement s = (Statement) statements [ix];
+
+ if (unreachable && !(s is LabeledStatement)) {
+ if (s == EmptyStatement.Value)
+ s.loc = EndLocation;
+
+ if (!s.ResolveUnreachable (ec, !unreachable_shown))
+ ok = false;
+
+ if (s != EmptyStatement.Value)
+ unreachable_shown = true;
+ else
+ s.loc = Location.Null;
+
+ statements [ix] = EmptyStatement.Value;
+ continue;
}
+
+ if (s.Resolve (ec) == false) {
+ ok = false;
+ statements [ix] = EmptyStatement.Value;
+ continue;
+ }
+
+ num_statements = ix + 1;
+
+ if (s is LabeledStatement)
+ unreachable = false;
+ else
+ unreachable = ec.CurrentBranching.CurrentUsageVector.Reachability.IsUnreachable;
}
+ Report.Debug (4, "RESOLVE BLOCK DONE", StartLocation,
+ ec.CurrentBranching, statement_count, num_statements);
+
+
+ FlowBranching.UsageVector vector = ec.DoEndFlowBranching ();
+
ec.CurrentBlock = prev_block;
- return true;
+
+ // If we're a non-static `struct' constructor which doesn't have an
+ // initializer, then we must initialize all of the struct's fields.
+ if ((this_variable != null) &&
+ (vector.Reachability.Throws != FlowBranching.FlowReturns.Always) &&
+ !this_variable.IsThisAssigned (ec, loc))
+ ok = false;
+
+ if ((labels != null) && (RootContext.WarningLevel >= 2)) {
+ foreach (LabeledStatement label in labels.Values)
+ if (!label.HasBeenReferenced)
+ Report.Warning (164, label.Location,
+ "This label has not been referenced");
+ }
+
+ Report.Debug (4, "RESOLVE BLOCK DONE #2", StartLocation, vector);
+
+ if ((vector.Reachability.Returns == FlowBranching.FlowReturns.Always) ||
+ (vector.Reachability.Throws == FlowBranching.FlowReturns.Always) ||
+ (vector.Reachability.Reachable == FlowBranching.FlowReturns.Never))
+ flags |= Flags.HasRet;
+
+ if (ok && (errors == Report.Errors)) {
+ if (RootContext.WarningLevel >= 3)
+ UsageWarning (vector);
+ }
+
+ return ok;
+ }
+
+ public override bool ResolveUnreachable (EmitContext ec, bool warn)
+ {
+ unreachable_shown = true;
+ return base.ResolveUnreachable (ec, warn);
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
+ {
+ for (int ix = 0; ix < num_statements; ix++){
+ Statement s = (Statement) statements [ix];
+
+ // Check whether we are the last statement in a
+ // top-level block.
+
+ if ((Parent == null) && (ix+1 == num_statements))
+ ec.IsLastStatement = true;
+ else
+ ec.IsLastStatement = false;
+
+ s.Emit (ec);
+ }
+ }
+
+ public override void Emit (EmitContext ec)
{
- bool is_ret = false;
Block prev_block = ec.CurrentBlock;
-
+
ec.CurrentBlock = this;
- if (CodeGen.SymbolWriter != null) {
- ec.Mark (StartLocation);
-
- foreach (Statement s in statements) {
- ec.Mark (s.loc);
-
- is_ret = s.Emit (ec);
+ bool emit_debug_info = (CodeGen.SymbolWriter != null);
+ bool is_lexical_block = !Implicit && (Parent != null);
+
+ if (emit_debug_info) {
+ if (is_lexical_block)
+ ec.ig.BeginScope ();
+
+ if (variables != null) {
+ foreach (DictionaryEntry de in variables) {
+ string name = (string) de.Key;
+ LocalInfo vi = (LocalInfo) de.Value;
+
+ if (vi.LocalBuilder == null)
+ continue;
+
+ ec.DefineLocalVariable (name, vi.LocalBuilder);
+ }
}
+ }
- ec.Mark (EndLocation);
- } else {
- foreach (Statement s in statements)
- is_ret = s.Emit (ec);
+ ec.Mark (StartLocation, true);
+ DoEmit (ec);
+ ec.Mark (EndLocation, true);
+
+ if (emit_debug_info && is_lexical_block)
+ ec.ig.EndScope ();
+
+ ec.CurrentBlock = prev_block;
+ }
+
+ public ToplevelBlock Toplevel {
+ get {
+ Block b = this;
+ while (b.Parent != null){
+ if ((b.flags & Flags.IsToplevel) != 0)
+ break;
+ b = b.Parent;
+ }
+
+ return (ToplevelBlock) b;
}
+ }
+
+ //
+ // Returns true if we ar ea child of `b'.
+ //
+ public bool IsChildOf (Block b)
+ {
+ Block current = this;
- ec.CurrentBlock = prev_block;
- return is_ret;
+ do {
+ if (current.Parent == b)
+ return true;
+ current = current.Parent;
+ } while (current != null);
+ return false;
}
}
+ //
+ // A toplevel block contains extra information, the split is done
+ // only to separate information that would otherwise bloat the more
+ // lightweight Block.
+ //
+ // In particular, this was introduced when the support for Anonymous
+ // Methods was implemented.
+ //
+ public class ToplevelBlock : Block {
+ //
+ // Pointer to the host of this anonymous method, or null
+ // if we are the topmost block
+ //
+ public ToplevelBlock Container;
+ CaptureContext capture_context;
+
+ Hashtable capture_contexts;
+
+ static int did = 0;
+
+ int my_id = did++;
+
+
+ public void RegisterCaptureContext (CaptureContext cc)
+ {
+ if (capture_contexts == null)
+ capture_contexts = new Hashtable ();
+ capture_contexts [cc] = cc;
+ }
+
+ public void CompleteContexts ()
+ {
+ if (capture_contexts == null)
+ return;
+
+ foreach (CaptureContext cc in capture_contexts.Keys){
+ cc.AdjustScopes ();
+ }
+ }
+
+ public CaptureContext ToplevelBlockCaptureContext {
+ get {
+ return capture_context;
+ }
+ }
+
+ //
+ // Parent is only used by anonymous blocks to link back to their
+ // parents
+ //
+ public ToplevelBlock (ToplevelBlock container, Parameters parameters, Location start) :
+ base (null, Flags.IsToplevel, parameters, start, Location.Null)
+ {
+ Container = container;
+ }
+
+ public ToplevelBlock (Parameters parameters, Location start) :
+ base (null, Flags.IsToplevel, parameters, start, Location.Null)
+ {
+ }
+
+ public ToplevelBlock (Flags flags, Parameters parameters, Location start) :
+ base (null, flags | Flags.IsToplevel, parameters, start, Location.Null)
+ {
+ }
+
+ public ToplevelBlock (Location loc) : base (null, Flags.IsToplevel, loc, loc)
+ {
+ }
+
+ public void SetHaveAnonymousMethods (Location loc, AnonymousMethod host)
+ {
+ if (capture_context == null)
+ capture_context = new CaptureContext (this, loc, host);
+ }
+
+ public CaptureContext CaptureContext {
+ get {
+ return capture_context;
+ }
+ }
+ }
+
public class SwitchLabel {
Expression label;
object converted;
public Location loc;
- public Label ILLabel;
- public Label ILLabelCode;
-
+
+ Label il_label;
+ bool il_label_set;
+ Label il_label_code;
+ bool il_label_code_set;
+
//
// if expr == null, then it is the default case.
//
@@ -1252,6 +2200,24 @@ namespace Mono.CSharp {
return converted;
}
}
+
+ public Label GetILLabel (EmitContext ec)
+ {
+ if (!il_label_set){
+ il_label = ec.ig.DefineLabel ();
+ il_label_set = true;
+ }
+ return il_label;
+ }
+
+ public Label GetILLabelCode (EmitContext ec)
+ {
+ if (!il_label_code_set){
+ il_label_code = ec.ig.DefineLabel ();
+ il_label_code_set = true;
+ }
+ return il_label_code;
+ }
//
// Resolves the expression, reduces it to a literal if possible
@@ -1259,9 +2225,6 @@ namespace Mono.CSharp {
//
public bool ResolveAndReduce (EmitContext ec, Type required_type)
{
- ILLabel = ec.ig.DefineLabel ();
- ILLabelCode = ec.ig.DefineLabel ();
-
if (label == null)
return true;
@@ -1271,15 +2234,13 @@ namespace Mono.CSharp {
return false;
if (!(e is Constant)){
- Console.WriteLine ("Value is: " + label);
- Report.Error (150, loc, "A constant value is expected");
+ Report.Error (150, loc, "A constant value is expected, got: " + e);
return false;
}
if (e is StringConstant || e is NullLiteral){
if (required_type == TypeManager.string_type){
- converted = label;
- ILLabel = ec.ig.DefineLabel ();
+ converted = e;
return true;
}
}
@@ -1323,7 +2284,10 @@ namespace Mono.CSharp {
//
bool got_default;
Label default_target;
-
+ Expression new_expr;
+ bool is_constant;
+ SwitchSection constant_section;
+
//
// The types allowed to be implicitly cast from
// on the governing type
@@ -1397,7 +2361,7 @@ namespace Mono.CSharp {
foreach (Type tt in allowed_types){
Expression e;
- e = Expression.ImplicitUserConversion (ec, Expr, tt, loc);
+ e = Convert.ImplicitUserConversion (ec, Expr, tt, loc);
if (e == null)
continue;
@@ -1412,11 +2376,10 @@ namespace Mono.CSharp {
return converted;
}
- void error152 (string n)
- {
- Report.Error (
- 152, "The label `" + n + ":' " +
- "is already present on this switch statement");
+ static string Error152 {
+ get {
+ return "The label '{0}:' already occurs in this switch statement";
+ }
}
//
@@ -1448,7 +2411,7 @@ namespace Mono.CSharp {
if (sl.Label == null){
if (got_default){
- error152 ("default");
+ Report.Error (152, sl.loc, Error152, "default");
error = true;
}
got_default = true;
@@ -1555,15 +2518,15 @@ namespace Mono.CSharp {
SwitchType + " " + compare_type);
}
- if (lname != null){
- error152 ("case + " + lname);
+ if (lname != null) {
+ Report.Error (152, sl.loc, Error152, "case " + lname);
error = true;
}
}
}
if (error)
return false;
-
+
return true;
}
@@ -1624,6 +2587,8 @@ namespace Mono.CSharp {
public long nFirst;
public long nLast;
public ArrayList rgKeys = null;
+ // how many items are in the bucket
+ public int Size = 1;
public int Length
{
get { return (int) (nLast - nFirst + 1); }
@@ -1653,7 +2618,7 @@ namespace Mono.CSharp {
/// <param name="ec"></param>
/// <param name="val"></param>
/// <returns></returns>
- bool TableSwitchEmit (EmitContext ec, LocalBuilder val)
+ void TableSwitchEmit (EmitContext ec, LocalBuilder val)
{
int cElements = Elements.Count;
object [] rgKeys = new object [cElements];
@@ -1663,7 +2628,7 @@ namespace Mono.CSharp {
// initialize the block list with one element per key
ArrayList rgKeyBlocks = new ArrayList ();
foreach (object key in rgKeys)
- rgKeyBlocks.Add (new KeyBlock (Convert.ToInt64 (key)));
+ rgKeyBlocks.Add (new KeyBlock (System.Convert.ToInt64 (key)));
KeyBlock kbCurr;
// iteratively merge the blocks while they are at least half full
@@ -1675,10 +2640,11 @@ namespace Mono.CSharp {
for (int ikb = 1; ikb < rgKeyBlocks.Count; ikb++)
{
KeyBlock kb = (KeyBlock) rgKeyBlocks [ikb];
- if ((kbCurr.Length + kb.Length) * 2 >= KeyBlock.TotalLength (kbCurr, kb))
+ if ((kbCurr.Size + kb.Size) * 2 >= KeyBlock.TotalLength (kbCurr, kb))
{
// merge blocks
kbCurr.nLast = kb.nLast;
+ kbCurr.Size += kb.Size;
}
else
{
@@ -1699,13 +2665,16 @@ namespace Mono.CSharp {
// fill the key lists
int iBlockCurr = 0;
- kbCurr = (KeyBlock) rgKeyBlocks [0];
- foreach (object key in rgKeys)
- {
- bool fNextBlock = (key is UInt64) ? (ulong) key > (ulong) kbCurr.nLast : Convert.ToInt64 (key) > kbCurr.nLast;
- if (fNextBlock)
- kbCurr = (KeyBlock) rgKeyBlocks [++iBlockCurr];
- kbCurr.rgKeys.Add (key);
+ if (rgKeyBlocks.Count > 0) {
+ kbCurr = (KeyBlock) rgKeyBlocks [0];
+ foreach (object key in rgKeys)
+ {
+ bool fNextBlock = (key is UInt64) ? (ulong) key > (ulong) kbCurr.nLast :
+ System.Convert.ToInt64 (key) > kbCurr.nLast;
+ if (fNextBlock)
+ kbCurr = (KeyBlock) rgKeyBlocks [++iBlockCurr];
+ kbCurr.rgKeys.Add (key);
+ }
}
// sort the blocks so we can tackle the largest ones first
@@ -1714,9 +2683,19 @@ namespace Mono.CSharp {
// okay now we can start...
ILGenerator ig = ec.ig;
Label lblEnd = ig.DefineLabel (); // at the end ;-)
- Label lblDefault = new Label ();
- Type typeKeys = rgKeys [0].GetType (); // used for conversions
+ Label lblDefault = ig.DefineLabel ();
+
+ Type typeKeys = null;
+ if (rgKeys.Length > 0)
+ typeKeys = rgKeys [0].GetType (); // used for conversions
+ Type compare_type;
+
+ if (TypeManager.IsEnumType (SwitchType))
+ compare_type = TypeManager.EnumToUnderlying (SwitchType);
+ else
+ compare_type = SwitchType;
+
for (int iBlock = rgKeyBlocks.Count - 1; iBlock >= 0; --iBlock)
{
KeyBlock kb = ((KeyBlock) rgKeyBlocks [iBlock]);
@@ -1728,31 +2707,31 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Ldloc, val);
EmitObjectInteger (ig, key);
SwitchLabel sl = (SwitchLabel) Elements [key];
- ig.Emit (OpCodes.Beq, sl.ILLabel);
+ ig.Emit (OpCodes.Beq, sl.GetILLabel (ec));
}
}
else
{
// TODO: if all the keys in the block are the same and there are
// no gaps/defaults then just use a range-check.
- if (SwitchType == TypeManager.int64_type ||
- SwitchType == TypeManager.uint64_type)
+ if (compare_type == TypeManager.int64_type ||
+ compare_type == TypeManager.uint64_type)
{
// TODO: optimize constant/I4 cases
// check block range (could be > 2^31)
ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, Convert.ChangeType (kb.nFirst, typeKeys));
+ EmitObjectInteger (ig, System.Convert.ChangeType (kb.nFirst, typeKeys));
ig.Emit (OpCodes.Blt, lblDefault);
ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, Convert.ChangeType (kb.nFirst, typeKeys));
+ EmitObjectInteger (ig, System.Convert.ChangeType (kb.nLast, typeKeys));
ig.Emit (OpCodes.Bgt, lblDefault);
// normalize range
ig.Emit (OpCodes.Ldloc, val);
if (kb.nFirst != 0)
{
- EmitObjectInteger (ig, Convert.ChangeType (kb.nFirst, typeKeys));
+ EmitObjectInteger (ig, System.Convert.ChangeType (kb.nFirst, typeKeys));
ig.Emit (OpCodes.Sub);
}
ig.Emit (OpCodes.Conv_I4); // assumes < 2^31 labels!
@@ -1781,10 +2760,10 @@ namespace Mono.CSharp {
for (int iJump = 0; iJump < cJumps; iJump++)
{
object key = kb.rgKeys [iKey];
- if (Convert.ToInt64 (key) == kb.nFirst + iJump)
+ if (System.Convert.ToInt64 (key) == kb.nFirst + iJump)
{
SwitchLabel sl = (SwitchLabel) Elements [key];
- rgLabels [iJump] = sl.ILLabel;
+ rgLabels [iJump] = sl.GetILLabel (ec);
iKey++;
}
else
@@ -1808,28 +2787,26 @@ namespace Mono.CSharp {
// now emit the code for the sections
bool fFoundDefault = false;
- bool fAllReturn = true;
foreach (SwitchSection ss in Sections)
{
foreach (SwitchLabel sl in ss.Labels)
{
- ig.MarkLabel (sl.ILLabel);
- ig.MarkLabel (sl.ILLabelCode);
+ ig.MarkLabel (sl.GetILLabel (ec));
+ ig.MarkLabel (sl.GetILLabelCode (ec));
if (sl.Label == null)
{
ig.MarkLabel (lblDefault);
fFoundDefault = true;
}
}
- fAllReturn &= ss.Block.Emit (ec);
+ ss.Block.Emit (ec);
//ig.Emit (OpCodes.Br, lblEnd);
}
- if (!fFoundDefault)
+ if (!fFoundDefault) {
ig.MarkLabel (lblDefault);
+ }
ig.MarkLabel (lblEnd);
-
- return fAllReturn;
}
//
// This simple emit switch works, but does not take advantage of the
@@ -1837,7 +2814,7 @@ namespace Mono.CSharp {
// TODO: remove non-string logic from here
// TODO: binary search strings?
//
- bool SimpleSwitchEmit (EmitContext ec, LocalBuilder val)
+ void SimpleSwitchEmit (EmitContext ec, LocalBuilder val)
{
ILGenerator ig = ec.ig;
Label end_of_switch = ig.DefineLabel ();
@@ -1846,41 +2823,34 @@ namespace Mono.CSharp {
bool default_found = false;
bool first_test = true;
bool pending_goto_end = false;
- bool all_return = true;
- bool is_string = false;
bool null_found;
+ bool default_at_end = false;
- //
- // Special processing for strings: we cant compare
- // against null.
- //
- if (SwitchType == TypeManager.string_type){
- ig.Emit (OpCodes.Ldloc, val);
- is_string = true;
-
- if (Elements.Contains (NullLiteral.Null)){
- ig.Emit (OpCodes.Brfalse, null_target);
- } else
- ig.Emit (OpCodes.Brfalse, default_target);
-
- ig.Emit (OpCodes.Ldloc, val);
- ig.Emit (OpCodes.Call, TypeManager.string_isinterneted_string);
- ig.Emit (OpCodes.Stloc, val);
- }
-
- SwitchSection last_section;
- last_section = (SwitchSection) Sections [Sections.Count-1];
+ ig.Emit (OpCodes.Ldloc, val);
- foreach (SwitchSection ss in Sections){
+ if (Elements.Contains (NullLiteral.Null)){
+ ig.Emit (OpCodes.Brfalse, null_target);
+ } else
+ ig.Emit (OpCodes.Brfalse, default_target);
+
+ ig.Emit (OpCodes.Ldloc, val);
+ ig.Emit (OpCodes.Call, TypeManager.string_isinterneted_string);
+ ig.Emit (OpCodes.Stloc, val);
+
+ int section_count = Sections.Count;
+ for (int section = 0; section < section_count; section++){
+ SwitchSection ss = (SwitchSection) Sections [section];
Label sec_begin = ig.DefineLabel ();
if (pending_goto_end)
ig.Emit (OpCodes.Br, end_of_switch);
int label_count = ss.Labels.Count;
+ bool mark_default = false;
null_found = false;
- foreach (SwitchLabel sl in ss.Labels){
- ig.MarkLabel (sl.ILLabel);
+ for (int label = 0; label < label_count; label++){
+ SwitchLabel sl = (SwitchLabel) ss.Labels [label];
+ ig.MarkLabel (sl.GetILLabel (ec));
if (!first_test){
ig.MarkLabel (next_test);
@@ -1890,7 +2860,9 @@ namespace Mono.CSharp {
// If we are the default target
//
if (sl.Label == null){
- ig.MarkLabel (default_target);
+ if (label+1 == label_count)
+ default_at_end = true;
+ mark_default = true;
default_found = true;
} else {
object lit = sl.Converted;
@@ -1902,69 +2874,78 @@ namespace Mono.CSharp {
continue;
}
- if (is_string){
- StringConstant str = (StringConstant) lit;
-
- ig.Emit (OpCodes.Ldloc, val);
- ig.Emit (OpCodes.Ldstr, str.Value);
- if (label_count == 1)
+ StringConstant str = (StringConstant) lit;
+
+ ig.Emit (OpCodes.Ldloc, val);
+ ig.Emit (OpCodes.Ldstr, str.Value);
+ if (label_count == 1)
+ ig.Emit (OpCodes.Bne_Un, next_test);
+ else {
+ if (label+1 == label_count)
ig.Emit (OpCodes.Bne_Un, next_test);
else
ig.Emit (OpCodes.Beq, sec_begin);
- } else {
- ig.Emit (OpCodes.Ldloc, val);
- EmitObjectInteger (ig, lit);
- ig.Emit (OpCodes.Ceq);
- if (label_count == 1)
- ig.Emit (OpCodes.Brfalse, next_test);
- else
- ig.Emit (OpCodes.Brtrue, sec_begin);
}
}
}
- if (label_count != 1 && ss != last_section)
- ig.Emit (OpCodes.Br, next_test);
-
if (null_found)
ig.MarkLabel (null_target);
ig.MarkLabel (sec_begin);
- foreach (SwitchLabel sl in ss.Labels)
- ig.MarkLabel (sl.ILLabelCode);
- if (ss.Block.Emit (ec))
- pending_goto_end = false;
- else {
- all_return = false;
- pending_goto_end = true;
- }
+ foreach (SwitchLabel sl in ss.Labels)
+ ig.MarkLabel (sl.GetILLabelCode (ec));
+
+ if (mark_default)
+ ig.MarkLabel (default_target);
+ ss.Block.Emit (ec);
+ pending_goto_end = !ss.Block.HasRet;
first_test = false;
}
- if (!default_found){
- ig.MarkLabel (default_target);
- all_return = false;
- }
ig.MarkLabel (next_test);
+ if (default_found){
+ if (!default_at_end)
+ ig.Emit (OpCodes.Br, default_target);
+ } else
+ ig.MarkLabel (default_target);
ig.MarkLabel (end_of_switch);
-
- return all_return;
}
- public override bool Resolve (EmitContext ec)
+ SwitchSection FindSection (SwitchLabel label)
{
foreach (SwitchSection ss in Sections){
- if (ss.Block.Resolve (ec) != true)
- return false;
+ foreach (SwitchLabel sl in ss.Labels){
+ if (label == sl)
+ return ss;
+ }
}
+ return null;
+ }
+
+ bool ResolveConstantSwitch (EmitContext ec)
+ {
+ object key = ((Constant) new_expr).GetValue ();
+ SwitchLabel label = (SwitchLabel) Elements [key];
+
+ if (label == null)
+ return true;
+
+ constant_section = FindSection (label);
+ if (constant_section == null)
+ return true;
+
+ if (constant_section.Block.Resolve (ec) != true)
+ return false;
+
return true;
}
-
- public override bool Emit (EmitContext ec)
+
+ public override bool Resolve (EmitContext ec)
{
Expr = Expr.Resolve (ec);
if (Expr == null)
return false;
- Expression new_expr = SwitchGoverningType (ec, Expr.Type);
+ new_expr = SwitchGoverningType (ec, Expr.Type);
if (new_expr == null){
Report.Error (151, loc, "An integer type or string was expected for switch");
return false;
@@ -1976,13 +2957,68 @@ namespace Mono.CSharp {
if (!CheckSwitch (ec))
return false;
- // Store variable for comparission purposes
- LocalBuilder value = ec.ig.DeclareLocal (SwitchType);
- new_expr.Emit (ec);
- ec.ig.Emit (OpCodes.Stloc, value);
+ Switch old_switch = ec.Switch;
+ ec.Switch = this;
+ ec.Switch.SwitchType = SwitchType;
+
+ Report.Debug (1, "START OF SWITCH BLOCK", loc, ec.CurrentBranching);
+ ec.StartFlowBranching (FlowBranching.BranchingType.Switch, loc);
+ is_constant = new_expr is Constant;
+ if (is_constant) {
+ object key = ((Constant) new_expr).GetValue ();
+ SwitchLabel label = (SwitchLabel) Elements [key];
+
+ constant_section = FindSection (label);
+ }
+
+ bool first = true;
+ foreach (SwitchSection ss in Sections){
+ if (!first)
+ ec.CurrentBranching.CreateSibling (
+ null, FlowBranching.SiblingType.SwitchSection);
+ else
+ first = false;
+
+ if (is_constant && (ss != constant_section)) {
+ // If we're a constant switch, we're only emitting
+ // one single section - mark all the others as
+ // unreachable.
+ ec.CurrentBranching.CurrentUsageVector.Goto ();
+ if (!ss.Block.ResolveUnreachable (ec, true))
+ return false;
+ } else {
+ if (!ss.Block.Resolve (ec))
+ return false;
+ }
+ }
+
+ if (!got_default)
+ ec.CurrentBranching.CreateSibling (
+ null, FlowBranching.SiblingType.SwitchSection);
+
+ FlowBranching.Reachability reachability = ec.EndFlowBranching ();
+ ec.Switch = old_switch;
+
+ Report.Debug (1, "END OF SWITCH BLOCK", loc, ec.CurrentBranching,
+ reachability);
+
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
ILGenerator ig = ec.ig;
+ // Store variable for comparission purposes
+ LocalBuilder value;
+ if (!is_constant) {
+ value = ig.DeclareLocal (SwitchType);
+ new_expr.Emit (ec);
+ ig.Emit (OpCodes.Stloc, value);
+ } else
+ value = null;
+
default_target = ig.DefineLabel ();
//
@@ -1995,11 +3031,13 @@ namespace Mono.CSharp {
ec.Switch = this;
// Emit Code.
- bool all_return;
- if (SwitchType == TypeManager.string_type)
- all_return = SimpleSwitchEmit (ec, value);
+ if (is_constant) {
+ if (constant_section != null)
+ constant_section.Block.Emit (ec);
+ } else if (SwitchType == TypeManager.string_type)
+ SimpleSwitchEmit (ec, value);
else
- all_return = TableSwitchEmit (ec, value);
+ TableSwitchEmit (ec, value);
// Restore context state.
ig.MarkLabel (ec.LoopEnd);
@@ -2009,14 +3047,37 @@ namespace Mono.CSharp {
//
ec.LoopEnd = old_end;
ec.Switch = old_switch;
-
- return all_return;
}
}
- public class Lock : Statement {
+ public abstract class ExceptionStatement : Statement
+ {
+ public abstract void EmitFinally (EmitContext ec);
+
+ protected bool emit_finally = true;
+ ArrayList parent_vectors;
+
+ protected void DoEmitFinally (EmitContext ec)
+ {
+ if (emit_finally)
+ ec.ig.BeginFinallyBlock ();
+ else
+ ec.CurrentIterator.MarkFinally (ec, parent_vectors);
+ EmitFinally (ec);
+ }
+
+ protected void ResolveFinally (FlowBranchingException branching)
+ {
+ emit_finally = branching.EmitFinally;
+ if (!emit_finally)
+ branching.Parent.StealFinallyClauses (ref parent_vectors);
+ }
+ }
+
+ public class Lock : ExceptionStatement {
Expression expr;
Statement Statement;
+ LocalBuilder temp;
public Lock (Expression expr, Statement stmt, Location l)
{
@@ -2028,23 +3089,44 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
expr = expr.Resolve (ec);
- return Statement.Resolve (ec) && expr != null;
+ if (expr == null)
+ return false;
+
+ if (expr.Type.IsValueType){
+ Error (185, "lock statement requires the expression to be " +
+ " a reference type (type is: `{0}'",
+ TypeManager.CSharpName (expr.Type));
+ return false;
+ }
+
+ FlowBranchingException branching = ec.StartFlowBranching (this);
+ bool ok = Statement.Resolve (ec);
+ if (!ok) {
+ ec.KillFlowBranching ();
+ return false;
+ }
+
+ ResolveFinally (branching);
+
+ FlowBranching.Reachability reachability = ec.EndFlowBranching ();
+ if (reachability.Returns != FlowBranching.FlowReturns.Always) {
+ // Unfortunately, System.Reflection.Emit automatically emits
+ // a leave to the end of the finally block.
+ // This is a problem if `returns' is true since we may jump
+ // to a point after the end of the method.
+ // As a workaround, emit an explicit ret here.
+ ec.NeedReturnLabel ();
+ }
+
+ return true;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
Type type = expr.Type;
- bool val;
- if (type.IsValueType){
- Report.Error (185, loc, "lock statement requires the expression to be " +
- " a reference type (type is: `" +
- TypeManager.CSharpName (type) + "'");
- return false;
- }
-
ILGenerator ig = ec.ig;
- LocalBuilder temp = ig.DeclareLocal (type);
+ temp = ig.DeclareLocal (type);
expr.Emit (ec);
ig.Emit (OpCodes.Dup);
@@ -2052,23 +3134,21 @@ namespace Mono.CSharp {
ig.Emit (OpCodes.Call, TypeManager.void_monitor_enter_object);
// try
- Label end = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- Label finish = ig.DefineLabel ();
- val = Statement.Emit (ec);
- ec.InTry = old_in_try;
- // ig.Emit (OpCodes.Leave, finish);
-
- ig.MarkLabel (finish);
+ if (emit_finally)
+ ig.BeginExceptionBlock ();
+ Statement.Emit (ec);
// finally
- ig.BeginFinallyBlock ();
+ DoEmitFinally (ec);
+ if (emit_finally)
+ ig.EndExceptionBlock ();
+ }
+
+ public override void EmitFinally (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
ig.Emit (OpCodes.Ldloc, temp);
ig.Emit (OpCodes.Call, TypeManager.void_monitor_exit_object);
- ig.EndExceptionBlock ();
-
- return val;
}
}
@@ -2078,26 +3158,33 @@ namespace Mono.CSharp {
public Unchecked (Block b)
{
Block = b;
+ b.Unchecked = true;
}
public override bool Resolve (EmitContext ec)
{
- return Block.Resolve (ec);
+ bool previous_state = ec.CheckState;
+ bool previous_state_const = ec.ConstantCheckState;
+
+ ec.CheckState = false;
+ ec.ConstantCheckState = false;
+ bool ret = Block.Resolve (ec);
+ ec.CheckState = previous_state;
+ ec.ConstantCheckState = previous_state_const;
+
+ return ret;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
bool previous_state = ec.CheckState;
bool previous_state_const = ec.ConstantCheckState;
- bool val;
ec.CheckState = false;
ec.ConstantCheckState = false;
- val = Block.Emit (ec);
+ Block.Emit (ec);
ec.CheckState = previous_state;
ec.ConstantCheckState = previous_state_const;
-
- return val;
}
}
@@ -2107,26 +3194,33 @@ namespace Mono.CSharp {
public Checked (Block b)
{
Block = b;
+ b.Unchecked = false;
}
public override bool Resolve (EmitContext ec)
{
- return Block.Resolve (ec);
+ bool previous_state = ec.CheckState;
+ bool previous_state_const = ec.ConstantCheckState;
+
+ ec.CheckState = true;
+ ec.ConstantCheckState = true;
+ bool ret = Block.Resolve (ec);
+ ec.CheckState = previous_state;
+ ec.ConstantCheckState = previous_state_const;
+
+ return ret;
}
-
- public override bool Emit (EmitContext ec)
+
+ protected override void DoEmit (EmitContext ec)
{
bool previous_state = ec.CheckState;
bool previous_state_const = ec.ConstantCheckState;
- bool val;
ec.CheckState = true;
ec.ConstantCheckState = true;
- val = Block.Emit (ec);
+ Block.Emit (ec);
ec.CheckState = previous_state;
ec.ConstantCheckState = previous_state_const;
-
- return val;
}
}
@@ -2136,35 +3230,50 @@ namespace Mono.CSharp {
public Unsafe (Block b)
{
Block = b;
+ Block.Unsafe = true;
}
public override bool Resolve (EmitContext ec)
{
- return Block.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
bool previous_state = ec.InUnsafe;
bool val;
ec.InUnsafe = true;
- val = Block.Emit (ec);
+ val = Block.Resolve (ec);
ec.InUnsafe = previous_state;
return val;
}
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ bool previous_state = ec.InUnsafe;
+
+ ec.InUnsafe = true;
+ Block.Emit (ec);
+ ec.InUnsafe = previous_state;
+ }
}
//
// Fixed statement
//
public class Fixed : Statement {
- string type;
+ Expression type;
ArrayList declarators;
Statement statement;
-
- public Fixed (string type, ArrayList decls, Statement stmt, Location l)
+ Type expr_type;
+ FixedData[] data;
+ bool has_ret;
+
+ struct FixedData {
+ public bool is_object;
+ public LocalInfo vi;
+ public Expression expr;
+ public Expression converted;
+ }
+
+ public Fixed (Expression type, ArrayList decls, Statement stmt, Location l)
{
this.type = type;
declarators = decls;
@@ -2174,24 +3283,39 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
- return statement.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
- ILGenerator ig = ec.ig;
- Type t;
+ if (!ec.InUnsafe){
+ Expression.UnsafeError (loc);
+ return false;
+ }
- t = RootContext.LookupType (ec.DeclSpace, type, false, loc);
- if (t == null)
+ TypeExpr texpr = type.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
return false;
- bool is_ret = false;
+ expr_type = texpr.ResolveType (ec);
+
+ CheckObsolete (expr_type);
+ if (ec.RemapToProxy){
+ Report.Error (-210, loc, "Fixed statement not allowed in iterators");
+ return false;
+ }
+
+ data = new FixedData [declarators.Count];
+
+ if (!expr_type.IsPointer){
+ Report.Error (209, loc, "Variables in a fixed statement must be pointers");
+ return false;
+ }
+
+ int i = 0;
foreach (Pair p in declarators){
- VariableInfo vi = (VariableInfo) p.First;
+ LocalInfo vi = (LocalInfo) p.First;
Expression e = (Expression) p.Second;
+ vi.VariableInfo.SetAssigned (ec);
+ vi.ReadOnly = true;
+
//
// The rules for the possible declarators are pretty wise,
// but the production on the grammar is more concise.
@@ -2203,104 +3327,171 @@ namespace Mono.CSharp {
// is present, so we need to test for this particular case.
//
+ if (e is Cast){
+ Report.Error (254, loc, "Cast expression not allowed as right hand expression in fixed statement");
+ return false;
+ }
+
//
// Case 1: & object.
//
if (e is Unary && ((Unary) e).Oper == Unary.Operator.AddressOf){
Expression child = ((Unary) e).Expr;
- vi.MakePinned ();
if (child is ParameterReference || child is LocalVariableReference){
Report.Error (
213, loc,
"No need to use fixed statement for parameters or " +
"local variable declarations (address is already " +
"fixed)");
- continue;
+ return false;
}
-
+
+ ec.InFixedInitializer = true;
e = e.Resolve (ec);
+ ec.InFixedInitializer = false;
if (e == null)
- continue;
+ return false;
child = ((Unary) e).Expr;
if (!TypeManager.VerifyUnManaged (child.Type, loc))
- continue;
-
- //
- // Store pointer in pinned location
- //
- e.Emit (ec);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- is_ret = statement.Emit (ec);
+ return false;
- // Clear the pinned variable.
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Conv_U);
- ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
+ data [i].is_object = true;
+ data [i].expr = e;
+ data [i].converted = null;
+ data [i].vi = vi;
+ i++;
continue;
}
+ ec.InFixedInitializer = true;
e = e.Resolve (ec);
+ ec.InFixedInitializer = false;
if (e == null)
- continue;
+ return false;
//
// Case 2: Array
//
if (e.Type.IsArray){
- Type array_type = e.Type.GetElementType ();
+ Type array_type = TypeManager.GetElementType (e.Type);
- vi.MakePinned ();
//
// Provided that array_type is unmanaged,
//
if (!TypeManager.VerifyUnManaged (array_type, loc))
- continue;
+ return false;
//
// and T* is implicitly convertible to the
// pointer type given in the fixed statement.
//
- ArrayPtr array_ptr = new ArrayPtr (e);
+ ArrayPtr array_ptr = new ArrayPtr (e, loc);
- Expression converted = Expression.ConvertImplicitRequired (
+ Expression converted = Convert.ImplicitConversionRequired (
ec, array_ptr, vi.VariableType, loc);
if (converted == null)
- continue;
+ return false;
+
+ data [i].is_object = false;
+ data [i].expr = e;
+ data [i].converted = converted;
+ data [i].vi = vi;
+ i++;
+
+ continue;
+ }
+ //
+ // Case 3: string
+ //
+ if (e.Type == TypeManager.string_type){
+ data [i].is_object = false;
+ data [i].expr = e;
+ data [i].converted = null;
+ data [i].vi = vi;
+ i++;
+ continue;
+ }
+
+ //
+ // For other cases, flag a `this is already fixed expression'
+ //
+ if (e is LocalVariableReference || e is ParameterReference ||
+ Convert.ImplicitConversionExists (ec, e, vi.VariableType)){
+
+ Report.Error (245, loc, "right hand expression is already fixed, no need to use fixed statement ");
+ return false;
+ }
+
+ Report.Error (245, loc, "Fixed statement only allowed on strings, arrays or address-of expressions");
+ return false;
+ }
+
+ ec.StartFlowBranching (FlowBranching.BranchingType.Conditional, loc);
+
+ if (!statement.Resolve (ec)) {
+ ec.KillFlowBranching ();
+ return false;
+ }
+
+ FlowBranching.Reachability reachability = ec.EndFlowBranching ();
+ has_ret = reachability.IsUnreachable;
+
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ LocalBuilder [] clear_list = new LocalBuilder [data.Length];
+
+ for (int i = 0; i < data.Length; i++) {
+ LocalInfo vi = data [i].vi;
+
+ //
+ // Case 1: & object.
+ //
+ if (data [i].is_object) {
//
// Store pointer in pinned location
//
- converted.Emit (ec);
-
+ data [i].expr.Emit (ec);
ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
+ clear_list [i] = vi.LocalBuilder;
+ continue;
+ }
- is_ret = statement.Emit (ec);
+ //
+ // Case 2: Array
+ //
+ if (data [i].expr.Type.IsArray){
+ //
+ // Store pointer in pinned location
+ //
+ data [i].converted.Emit (ec);
- // Clear the pinned variable.
- ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Conv_U);
ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
+ clear_list [i] = vi.LocalBuilder;
continue;
}
//
// Case 3: string
//
- if (e.Type == TypeManager.string_type){
- LocalBuilder pinned_string = ig.DeclareLocal (TypeManager.string_type);
- TypeManager.MakePinned (pinned_string);
+ if (data [i].expr.Type == TypeManager.string_type){
+ LocalBuilder pinned_string = TypeManager.DeclareLocalPinned (ig, TypeManager.string_type);
+ clear_list [i] = pinned_string;
- e.Emit (ec);
+ data [i].expr.Emit (ec);
ig.Emit (OpCodes.Stloc, pinned_string);
- Expression sptr = new StringPtr (pinned_string);
- Expression converted = Expression.ConvertImplicitRequired (
+ Expression sptr = new StringPtr (pinned_string, loc);
+ Expression converted = Convert.ImplicitConversionRequired (
ec, sptr, vi.VariableType, loc);
if (converted == null)
@@ -2308,43 +3499,94 @@ namespace Mono.CSharp {
converted.Emit (ec);
ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
-
- is_ret = statement.Emit (ec);
+ }
+ }
+
+ statement.Emit (ec);
- // Clear the pinned variable
+ if (has_ret)
+ return;
+
+ //
+ // Clear the pinned variable
+ //
+ for (int i = 0; i < data.Length; i++) {
+ if (data [i].is_object || data [i].expr.Type.IsArray) {
+ ig.Emit (OpCodes.Ldc_I4_0);
+ ig.Emit (OpCodes.Conv_U);
+ ig.Emit (OpCodes.Stloc, clear_list [i]);
+ } else if (data [i].expr.Type == TypeManager.string_type){
ig.Emit (OpCodes.Ldnull);
- ig.Emit (OpCodes.Stloc, pinned_string);
+ ig.Emit (OpCodes.Stloc, clear_list [i]);
}
}
-
- return is_ret;
}
}
- public class Catch {
- public readonly string Type;
+ public class Catch: Statement {
public readonly string Name;
public readonly Block Block;
- public readonly Location Location;
+
+ Expression type_expr;
+ Type type;
- public Catch (string type, string name, Block block, Location l)
+ public Catch (Expression type, string name, Block block, Location l)
{
- Type = type;
+ type_expr = type;
Name = name;
Block = block;
- Location = l;
+ loc = l;
+ }
+
+ public Type CatchType {
+ get {
+ return type;
+ }
+ }
+
+ public bool IsGeneral {
+ get {
+ return type_expr == null;
+ }
+ }
+
+ protected override void DoEmit(EmitContext ec)
+ {
+ }
+
+ public override bool Resolve (EmitContext ec)
+ {
+ if (type_expr != null) {
+ TypeExpr te = type_expr.ResolveAsTypeTerminal (ec, false);
+ if (te == null)
+ return false;
+
+ type = te.ResolveType (ec);
+
+ CheckObsolete (type);
+
+ if (type != TypeManager.exception_type && !type.IsSubclassOf (TypeManager.exception_type)){
+ Error (155, "The type caught or thrown must be derived from System.Exception");
+ return false;
+ }
+ } else
+ type = null;
+
+ return Block.Resolve (ec);
}
}
- public class Try : Statement {
+ public class Try : ExceptionStatement {
public readonly Block Fini, Block;
public readonly ArrayList Specific;
public readonly Catch General;
+
+ bool need_exc_block;
//
// specific, general and fini might all be null.
//
- public Try (Block block, ArrayList specific, Catch general, Block fini)
+ public Try (Block block, ArrayList specific, Catch general, Block fini, Location l)
{
if (specific == null && general == null){
Console.WriteLine ("CIR.Try: Either specific or general have to be non-null");
@@ -2354,111 +3596,158 @@ namespace Mono.CSharp {
this.Specific = specific;
this.General = general;
this.Fini = fini;
+ loc = l;
}
public override bool Resolve (EmitContext ec)
{
bool ok = true;
- if (General != null)
- if (!General.Block.Resolve (ec))
- ok = false;
+ FlowBranchingException branching = ec.StartFlowBranching (this);
+
+ Report.Debug (1, "START OF TRY BLOCK", Block.StartLocation);
+
+ if (!Block.Resolve (ec))
+ ok = false;
+
+ FlowBranching.UsageVector vector = ec.CurrentBranching.CurrentUsageVector;
+ Report.Debug (1, "START OF CATCH BLOCKS", vector);
+
+ Type[] prevCatches = new Type [Specific.Count];
+ int last_index = 0;
foreach (Catch c in Specific){
- if (!c.Block.Resolve (ec))
+ ec.CurrentBranching.CreateSibling (
+ c.Block, FlowBranching.SiblingType.Catch);
+
+ Report.Debug (1, "STARTED SIBLING FOR CATCH", ec.CurrentBranching);
+
+ if (c.Name != null) {
+ LocalInfo vi = c.Block.GetLocalInfo (c.Name);
+ if (vi == null)
+ throw new Exception ();
+
+ vi.VariableInfo = null;
+ }
+
+ if (!c.Resolve (ec))
+ return false;
+
+ Type resolvedType = c.CatchType;
+ for (int ii = 0; ii < last_index; ++ii) {
+ if (resolvedType == prevCatches [ii] || resolvedType.IsSubclassOf (prevCatches [ii])) {
+ Report.Error (160, c.loc, "A previous catch clause already catches all exceptions of this or a super type '{0}'", prevCatches [ii].FullName);
+ return false;
+ }
+ }
+
+ prevCatches [last_index++] = resolvedType;
+ need_exc_block = true;
+ }
+
+ Report.Debug (1, "END OF CATCH BLOCKS", ec.CurrentBranching);
+
+ if (General != null){
+ ec.CurrentBranching.CreateSibling (
+ General.Block, FlowBranching.SiblingType.Catch);
+
+ Report.Debug (1, "STARTED SIBLING FOR GENERAL", ec.CurrentBranching);
+
+ if (!General.Resolve (ec))
ok = false;
+
+ need_exc_block = true;
}
- if (!Block.Resolve (ec))
- ok = false;
+ Report.Debug (1, "END OF GENERAL CATCH BLOCKS", ec.CurrentBranching);
+
+ if (Fini != null) {
+ if (ok)
+ ec.CurrentBranching.CreateSibling (
+ Fini, FlowBranching.SiblingType.Finally);
+
+ Report.Debug (1, "STARTED SIBLING FOR FINALLY", ec.CurrentBranching, vector);
- if (Fini != null)
if (!Fini.Resolve (ec))
ok = false;
-
+ }
+
+ ResolveFinally (branching);
+ need_exc_block |= emit_finally;
+
+ FlowBranching.Reachability reachability = ec.EndFlowBranching ();
+
+ FlowBranching.UsageVector f_vector = ec.CurrentBranching.CurrentUsageVector;
+
+ Report.Debug (1, "END OF TRY", ec.CurrentBranching, reachability, vector, f_vector);
+
+ if (reachability.Returns != FlowBranching.FlowReturns.Always) {
+ // Unfortunately, System.Reflection.Emit automatically emits
+ // a leave to the end of the finally block. This is a problem
+ // if `returns' is true since we may jump to a point after the
+ // end of the method.
+ // As a workaround, emit an explicit ret here.
+ ec.NeedReturnLabel ();
+ }
+
return ok;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
ILGenerator ig = ec.ig;
- Label end;
- Label finish = ig.DefineLabel ();;
- bool returns;
-
- end = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- returns = Block.Emit (ec);
- ec.InTry = old_in_try;
-
- //
- // System.Reflection.Emit provides this automatically:
- // ig.Emit (OpCodes.Leave, finish);
- bool old_in_catch = ec.InCatch;
- ec.InCatch = true;
- DeclSpace ds = ec.DeclSpace;
+ if (need_exc_block)
+ ig.BeginExceptionBlock ();
+ Block.Emit (ec);
foreach (Catch c in Specific){
- Type catch_type = RootContext.LookupType (ds, c.Type, false, c.Location);
- VariableInfo vi;
+ LocalInfo vi;
- if (catch_type == null)
- return false;
-
- ig.BeginCatchBlock (catch_type);
+ ig.BeginCatchBlock (c.CatchType);
if (c.Name != null){
- vi = c.Block.GetVariableInfo (c.Name);
- if (vi == null){
- Console.WriteLine ("This should not happen! variable does not exist in this block");
- Environment.Exit (0);
- }
-
+ vi = c.Block.GetLocalInfo (c.Name);
+ if (vi == null)
+ throw new Exception ("Variable does not exist in this block");
+
ig.Emit (OpCodes.Stloc, vi.LocalBuilder);
} else
ig.Emit (OpCodes.Pop);
- if (!c.Block.Emit (ec))
- returns = false;
+ c.Block.Emit (ec);
}
if (General != null){
ig.BeginCatchBlock (TypeManager.object_type);
ig.Emit (OpCodes.Pop);
- if (!General.Block.Emit (ec))
- returns = false;
+ General.Block.Emit (ec);
}
- ec.InCatch = old_in_catch;
- ig.MarkLabel (finish);
+ DoEmitFinally (ec);
+ if (need_exc_block)
+ ig.EndExceptionBlock ();
+ }
+
+ public override void EmitFinally (EmitContext ec)
+ {
if (Fini != null){
- ig.BeginFinallyBlock ();
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
Fini.Emit (ec);
- ec.InFinally = old_in_finally;
}
-
- ig.EndExceptionBlock ();
-
- //
- // FIXME: Is this correct?
- // Replace with `returns' and check test-18, maybe we can
- // perform an optimization here.
- //
- return returns;
}
}
- //
- // FIXME: We still do not support the expression variant of the using
- // statement.
- //
- public class Using : Statement {
+ public class Using : ExceptionStatement {
object expression_or_block;
Statement Statement;
+ ArrayList var_list;
+ Expression expr;
+ Type expr_type;
+ Expression conv;
+ Expression [] resolved_vars;
+ Expression [] converted_vars;
+ ExpressionStatement [] assign;
+ LocalBuilder local_copy;
public Using (object expression_or_block, Statement stmt, Location l)
{
@@ -2468,171 +3757,269 @@ namespace Mono.CSharp {
}
//
- // Emits the code for the case of using using a local variable declaration.
+ // Resolves for the case of using using a local variable declaration.
//
- bool EmitLocalVariableDecls (EmitContext ec, string type_name, ArrayList var_list)
+ bool ResolveLocalVariableDecls (EmitContext ec)
{
- ILGenerator ig = ec.ig;
- Expression [] converted_vars;
- bool need_conv = false;
- Type type = RootContext.LookupType (ec.DeclSpace, type_name, false, loc);
int i = 0;
- if (type == null)
+ TypeExpr texpr = expr.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
return false;
-
+
+ expr_type = texpr.ResolveType (ec);
+
//
// The type must be an IDisposable or an implicit conversion
// must exist.
//
converted_vars = new Expression [var_list.Count];
- if (!TypeManager.ImplementsInterface (type, TypeManager.idisposable_type)){
- foreach (DictionaryEntry e in var_list){
- Expression var = (Expression) e.Key;
+ resolved_vars = new Expression [var_list.Count];
+ assign = new ExpressionStatement [var_list.Count];
- var = var.Resolve (ec);
- if (var == null)
- return false;
-
- converted_vars [i] = Expression.ConvertImplicit (
- ec, var, TypeManager.idisposable_type, loc);
+ bool need_conv = !TypeManager.ImplementsInterface (
+ expr_type, TypeManager.idisposable_type);
- if (converted_vars [i] == null)
- return false;
+ foreach (DictionaryEntry e in var_list){
+ Expression var = (Expression) e.Key;
+
+ var = var.ResolveLValue (ec, new EmptyExpression ());
+ if (var == null)
+ return false;
+
+ resolved_vars [i] = var;
+
+ if (!need_conv) {
i++;
+ continue;
}
- need_conv = true;
+
+ converted_vars [i] = Convert.ImplicitConversionRequired (
+ ec, var, TypeManager.idisposable_type, loc);
+
+ if (converted_vars [i] == null)
+ return false;
+
+ i++;
}
-
+
i = 0;
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- bool error = false;
foreach (DictionaryEntry e in var_list){
- LocalVariableReference var = (LocalVariableReference) e.Key;
- Expression expr = (Expression) e.Value;
+ Expression var = resolved_vars [i];
+ Expression new_expr = (Expression) e.Value;
Expression a;
- a = new Assign (var, expr, loc);
+ a = new Assign (var, new_expr, loc);
a = a.Resolve (ec);
+ if (a == null)
+ return false;
+
if (!need_conv)
converted_vars [i] = var;
+ assign [i] = (ExpressionStatement) a;
i++;
- if (a == null){
- error = true;
- continue;
- }
- ((ExpressionStatement) a).EmitStatement (ec);
-
- ig.BeginExceptionBlock ();
-
- }
- if (error)
- return false;
- Statement.Emit (ec);
- ec.InTry = old_in_try;
-
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- var_list.Reverse ();
- foreach (DictionaryEntry e in var_list){
- LocalVariableReference var = (LocalVariableReference) e.Key;
- Label skip = ig.DefineLabel ();
- i--;
-
- ig.BeginFinallyBlock ();
-
- var.Emit (ec);
- ig.Emit (OpCodes.Brfalse, skip);
- converted_vars [i].Emit (ec);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (skip);
- ig.EndExceptionBlock ();
}
- ec.InFinally = old_in_finally;
- return false;
+ return true;
}
- bool EmitExpression (EmitContext ec, Expression expr)
+ bool ResolveExpression (EmitContext ec)
{
- Type expr_type = expr.Type;
- Expression conv = null;
-
if (!TypeManager.ImplementsInterface (expr_type, TypeManager.idisposable_type)){
- conv = Expression.ConvertImplicit (
+ conv = Convert.ImplicitConversionRequired (
ec, expr, TypeManager.idisposable_type, loc);
if (conv == null)
return false;
}
+ return true;
+ }
+
+ //
+ // Emits the code for the case of using using a local variable declaration.
+ //
+ void EmitLocalVariableDecls (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+ int i = 0;
+
+ for (i = 0; i < assign.Length; i++) {
+ assign [i].EmitStatement (ec);
+
+ if (emit_finally)
+ ig.BeginExceptionBlock ();
+ }
+ Statement.Emit (ec);
+ var_list.Reverse ();
+
+ DoEmitFinally (ec);
+ }
+
+ void EmitLocalVariableDeclFinally (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ int i = assign.Length;
+ foreach (DictionaryEntry e in var_list){
+ Expression var = resolved_vars [--i];
+ Label skip = ig.DefineLabel ();
+
+ if (!var.Type.IsValueType) {
+ var.Emit (ec);
+ ig.Emit (OpCodes.Brfalse, skip);
+ converted_vars [i].Emit (ec);
+ ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
+ } else {
+ Expression ml = Expression.MemberLookup(ec, TypeManager.idisposable_type, var.Type, "Dispose", Mono.CSharp.Location.Null);
+
+ if (!(ml is MethodGroupExpr)) {
+ var.Emit (ec);
+ ig.Emit (OpCodes.Box, var.Type);
+ ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
+ } else {
+ MethodInfo mi = null;
+
+ foreach (MethodInfo mk in ((MethodGroupExpr) ml).Methods) {
+ if (TypeManager.GetArgumentTypes (mk).Length == 0) {
+ mi = mk;
+ break;
+ }
+ }
+
+ if (mi == null) {
+ Report.Error(-100, Mono.CSharp.Location.Null, "Internal error: No Dispose method which takes 0 parameters.");
+ return;
+ }
+
+ IMemoryLocation mloc = (IMemoryLocation) var;
+
+ mloc.AddressOf (ec, AddressOp.Load);
+ ig.Emit (OpCodes.Call, mi);
+ }
+ }
+
+ ig.MarkLabel (skip);
+
+ if (emit_finally) {
+ ig.EndExceptionBlock ();
+ if (i > 0)
+ ig.BeginFinallyBlock ();
+ }
+ }
+ }
+
+ void EmitExpression (EmitContext ec)
+ {
//
// Make a copy of the expression and operate on that.
//
ILGenerator ig = ec.ig;
- LocalBuilder local_copy = ig.DeclareLocal (expr_type);
+ local_copy = ig.DeclareLocal (expr_type);
if (conv != null)
conv.Emit (ec);
else
expr.Emit (ec);
ig.Emit (OpCodes.Stloc, local_copy);
- bool old_in_try = ec.InTry;
- ec.InTry = true;
- ig.BeginExceptionBlock ();
+ if (emit_finally)
+ ig.BeginExceptionBlock ();
+
Statement.Emit (ec);
- ec.InTry = old_in_try;
+ DoEmitFinally (ec);
+ if (emit_finally)
+ ig.EndExceptionBlock ();
+ }
+
+ void EmitExpressionFinally (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
Label skip = ig.DefineLabel ();
- bool old_in_finally = ec.InFinally;
- ig.BeginFinallyBlock ();
ig.Emit (OpCodes.Ldloc, local_copy);
ig.Emit (OpCodes.Brfalse, skip);
ig.Emit (OpCodes.Ldloc, local_copy);
ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
ig.MarkLabel (skip);
- ec.InFinally = old_in_finally;
- ig.EndExceptionBlock ();
-
- return false;
}
public override bool Resolve (EmitContext ec)
{
- return Statement.Resolve (ec);
- }
-
- public override bool Emit (EmitContext ec)
- {
if (expression_or_block is DictionaryEntry){
- string t = (string) ((DictionaryEntry) expression_or_block).Key;
- ArrayList var_list = (ArrayList)((DictionaryEntry)expression_or_block).Value;
+ expr = (Expression) ((DictionaryEntry) expression_or_block).Key;
+ var_list = (ArrayList)((DictionaryEntry)expression_or_block).Value;
- return EmitLocalVariableDecls (ec, t, var_list);
- } if (expression_or_block is Expression){
- Expression e = (Expression) expression_or_block;
+ if (!ResolveLocalVariableDecls (ec))
+ return false;
- e = e.Resolve (ec);
- if (e == null)
+ } else if (expression_or_block is Expression){
+ expr = (Expression) expression_or_block;
+
+ expr = expr.Resolve (ec);
+ if (expr == null)
return false;
- return EmitExpression (ec, e);
+ expr_type = expr.Type;
+
+ if (!ResolveExpression (ec))
+ return false;
}
- return false;
+
+ FlowBranchingException branching = ec.StartFlowBranching (this);
+
+ bool ok = Statement.Resolve (ec);
+
+ if (!ok) {
+ ec.KillFlowBranching ();
+ return false;
+ }
+
+ ResolveFinally (branching);
+ FlowBranching.Reachability reachability = ec.EndFlowBranching ();
+
+ if (reachability.Returns != FlowBranching.FlowReturns.Always) {
+ // Unfortunately, System.Reflection.Emit automatically emits a leave
+ // to the end of the finally block. This is a problem if `returns'
+ // is true since we may jump to a point after the end of the method.
+ // As a workaround, emit an explicit ret here.
+ ec.NeedReturnLabel ();
+ }
+
+ return true;
+ }
+
+ protected override void DoEmit (EmitContext ec)
+ {
+ if (expression_or_block is DictionaryEntry)
+ EmitLocalVariableDecls (ec);
+ else if (expression_or_block is Expression)
+ EmitExpression (ec);
+ }
+
+ public override void EmitFinally (EmitContext ec)
+ {
+ if (expression_or_block is DictionaryEntry)
+ EmitLocalVariableDeclFinally (ec);
+ else if (expression_or_block is Expression)
+ EmitExpressionFinally (ec);
}
}
/// <summary>
/// Implementation of the foreach C# statement
/// </summary>
- public class Foreach : Statement {
- string type;
- LocalVariableReference variable;
+ public class Foreach : ExceptionStatement {
+ Expression type;
+ Expression variable;
Expression expr;
Statement statement;
+ ForeachHelperMethods hm;
+ Expression empty, conv;
+ Type array_type, element_type;
+ Type var_type;
+ VariableStorage enumerator;
- public Foreach (string type, LocalVariableReference var, Expression expr,
+ public Foreach (Expression type, LocalVariableReference var, Expression expr,
Statement stmt, Location l)
{
this.type = type;
@@ -2645,7 +4032,84 @@ namespace Mono.CSharp {
public override bool Resolve (EmitContext ec)
{
expr = expr.Resolve (ec);
- return statement.Resolve (ec) && expr != null;
+ if (expr == null)
+ return false;
+
+ TypeExpr texpr = type.ResolveAsTypeTerminal (ec, false);
+ if (texpr == null)
+ return false;
+
+ var_type = texpr.ResolveType (ec);
+
+ //
+ // We need an instance variable. Not sure this is the best
+ // way of doing this.
+ //
+ // FIXME: When we implement propertyaccess, will those turn
+ // out to return values in ExprClass? I think they should.
+ //
+ if (!(expr.eclass == ExprClass.Variable || expr.eclass == ExprClass.Value ||
+ expr.eclass == ExprClass.PropertyAccess || expr.eclass == ExprClass.IndexerAccess)){
+ error1579 (expr.Type);
+ return false;
+ }
+
+ if (expr.Type.IsArray) {
+ array_type = expr.Type;
+ element_type = TypeManager.GetElementType (array_type);
+
+ empty = new EmptyExpression (element_type);
+ } else {
+ hm = ProbeCollectionType (ec, expr.Type);
+ if (hm == null){
+ error1579 (expr.Type);
+ return false;
+ }
+
+ array_type = expr.Type;
+ element_type = hm.element_type;
+
+ empty = new EmptyExpression (hm.element_type);
+ }
+
+ bool ok = true;
+
+ ec.StartFlowBranching (FlowBranching.BranchingType.Loop, loc);
+ ec.CurrentBranching.CreateSibling ();
+
+ //
+ //
+ // FIXME: maybe we can apply the same trick we do in the
+ // array handling to avoid creating empty and conv in some cases.
+ //
+ // Although it is not as important in this case, as the type
+ // will not likely be object (what the enumerator will return).
+ //
+ conv = Convert.ExplicitConversion (ec, empty, var_type, loc);
+ if (conv == null)
+ ok = false;
+
+ variable = variable.ResolveLValue (ec, empty);
+ if (variable == null)
+ ok = false;
+
+ bool disposable = (hm != null) && hm.is_disposable;
+ FlowBranchingException branching = null;
+ if (disposable)
+ branching = ec.StartFlowBranching (this);
+
+ if (!statement.Resolve (ec))
+ ok = false;
+
+ if (disposable) {
+ ResolveFinally (branching);
+ ec.EndFlowBranching ();
+ } else
+ emit_finally = true;
+
+ ec.EndFlowBranching ();
+
+ return ok;
}
//
@@ -2653,13 +4117,13 @@ namespace Mono.CSharp {
//
static MethodInfo FetchMethodMoveNext (Type t)
{
- MemberInfo [] move_next_list;
+ MemberList move_next_list;
move_next_list = TypeContainer.FindMembers (
t, MemberTypes.Method,
BindingFlags.Public | BindingFlags.Instance,
Type.FilterName, "MoveNext");
- if (move_next_list == null || move_next_list.Length == 0)
+ if (move_next_list.Count == 0)
return null;
foreach (MemberInfo m in move_next_list){
@@ -2680,19 +4144,19 @@ namespace Mono.CSharp {
//
static MethodInfo FetchMethodGetCurrent (Type t)
{
- MemberInfo [] move_next_list;
-
- move_next_list = TypeContainer.FindMembers (
+ MemberList get_current_list;
+
+ get_current_list = TypeContainer.FindMembers (
t, MemberTypes.Method,
BindingFlags.Public | BindingFlags.Instance,
Type.FilterName, "get_Current");
- if (move_next_list == null || move_next_list.Length == 0)
+ if (get_current_list.Count == 0)
return null;
- foreach (MemberInfo m in move_next_list){
+ foreach (MemberInfo m in get_current_list){
MethodInfo mi = (MethodInfo) m;
Type [] args;
-
+
args = TypeManager.GetArgumentTypes (mi);
if (args != null && args.Length == 0)
return mi;
@@ -2700,6 +4164,33 @@ namespace Mono.CSharp {
return null;
}
+ //
+ // Retrieves a `public void Dispose ()' method from the Type `t'
+ //
+ static MethodInfo FetchMethodDispose (Type t)
+ {
+ MemberList dispose_list;
+
+ dispose_list = TypeContainer.FindMembers (
+ t, MemberTypes.Method,
+ BindingFlags.Public | BindingFlags.Instance,
+ Type.FilterName, "Dispose");
+ if (dispose_list.Count == 0)
+ return null;
+
+ foreach (MemberInfo m in dispose_list){
+ MethodInfo mi = (MethodInfo) m;
+ Type [] args;
+
+ args = TypeManager.GetArgumentTypes (mi);
+ if (args != null && args.Length == 0){
+ if (mi.ReturnType == TypeManager.void_type)
+ return mi;
+ }
+ }
+ return null;
+ }
+
//
// This struct records the helper methods used by the Foreach construct
//
@@ -2708,10 +4199,16 @@ namespace Mono.CSharp {
public MethodInfo get_enumerator;
public MethodInfo move_next;
public MethodInfo get_current;
+ public Type element_type;
+ public Type enumerator_type;
+ public bool is_disposable;
public ForeachHelperMethods (EmitContext ec)
{
this.ec = ec;
+ this.element_type = TypeManager.object_type;
+ this.enumerator_type = TypeManager.ienumerator_type;
+ this.is_disposable = true;
}
}
@@ -2734,61 +4231,74 @@ namespace Mono.CSharp {
}
ForeachHelperMethods hm = (ForeachHelperMethods) criteria;
EmitContext ec = hm.ec;
-
- //
- // Check whether GetEnumerator is accessible to us
- //
- MethodAttributes prot = mi.Attributes & MethodAttributes.MemberAccessMask;
- Type declaring = mi.DeclaringType;
- if (prot == MethodAttributes.Private){
- if (declaring != ec.ContainerType)
- return false;
- } else if (prot == MethodAttributes.FamANDAssem){
- // If from a different assembly, false
- if (!(mi is MethodBuilder))
- return false;
+ // Check whether GetEnumerator is public
+ if ((mi.Attributes & MethodAttributes.Public) != MethodAttributes.Public)
+ return false;
+
+ if ((mi.ReturnType == TypeManager.ienumerator_type) && (mi.DeclaringType == TypeManager.string_type))
//
- // Are we being invoked from the same class, or from a derived method?
+ // Apply the same optimization as MS: skip the GetEnumerator
+ // returning an IEnumerator, and use the one returning a
+ // CharEnumerator instead. This allows us to avoid the
+ // try-finally block and the boxing.
//
- if (ec.ContainerType != declaring){
- if (!ec.ContainerType.IsSubclassOf (declaring))
- return false;
- }
- } else if (prot == MethodAttributes.FamORAssem){
- if (!(mi is MethodBuilder ||
- ec.ContainerType == declaring ||
- ec.ContainerType.IsSubclassOf (declaring)))
- return false;
- } if (prot == MethodAttributes.Family){
- if (!(ec.ContainerType == declaring ||
- ec.ContainerType.IsSubclassOf (declaring)))
- return false;
- }
+ return false;
//
// Ok, we can access it, now make sure that we can do something
// with this `GetEnumerator'
//
- if (mi.ReturnType == TypeManager.ienumerator_type ||
- TypeManager.ienumerator_type.IsAssignableFrom (mi.ReturnType)){
- hm.move_next = TypeManager.bool_movenext_void;
- hm.get_current = TypeManager.object_getcurrent_void;
- return true;
- }
-
- //
- // Ok, so they dont return an IEnumerable, we will have to
- // find if they support the GetEnumerator pattern.
- //
+
Type return_type = mi.ReturnType;
+ if (mi.ReturnType == TypeManager.ienumerator_type ||
+ TypeManager.ienumerator_type.IsAssignableFrom (return_type) ||
+ (!RootContext.StdLib && TypeManager.ImplementsInterface (return_type, TypeManager.ienumerator_type))) {
+
+ //
+ // If it is not an interface, lets try to find the methods ourselves.
+ // For example, if we have:
+ // public class Foo : IEnumerator { public bool MoveNext () {} public int Current { get {}}}
+ // We can avoid the iface call. This is a runtime perf boost.
+ // even bigger if we have a ValueType, because we avoid the cost
+ // of boxing.
+ //
+ // We have to make sure that both methods exist for us to take
+ // this path. If one of the methods does not exist, we will just
+ // use the interface. Sadly, this complex if statement is the only
+ // way I could do this without a goto
+ //
+
+ if (return_type.IsInterface ||
+ (hm.move_next = FetchMethodMoveNext (return_type)) == null ||
+ (hm.get_current = FetchMethodGetCurrent (return_type)) == null) {
+
+ hm.move_next = TypeManager.bool_movenext_void;
+ hm.get_current = TypeManager.object_getcurrent_void;
+ return true;
+ }
- hm.move_next = FetchMethodMoveNext (return_type);
- if (hm.move_next == null)
- return false;
- hm.get_current = FetchMethodGetCurrent (return_type);
- if (hm.get_current == null)
- return false;
+ } else {
+
+ //
+ // Ok, so they dont return an IEnumerable, we will have to
+ // find if they support the GetEnumerator pattern.
+ //
+
+ hm.move_next = FetchMethodMoveNext (return_type);
+ if (hm.move_next == null)
+ return false;
+
+ hm.get_current = FetchMethodGetCurrent (return_type);
+ if (hm.get_current == null)
+ return false;
+ }
+
+ hm.element_type = hm.get_current.ReturnType;
+ hm.enumerator_type = return_type;
+ hm.is_disposable = !hm.enumerator_type.IsSealed ||
+ TypeManager.ImplementsInterface (
+ hm.enumerator_type, TypeManager.idisposable_type);
return true;
}
@@ -2814,14 +4324,14 @@ namespace Mono.CSharp {
static bool TryType (Type t, ForeachHelperMethods hm)
{
- MemberInfo [] mi;
+ MemberList mi;
mi = TypeContainer.FindMembers (t, MemberTypes.Method,
BindingFlags.Public | BindingFlags.NonPublic |
- BindingFlags.Instance,
+ BindingFlags.Instance | BindingFlags.DeclaredOnly,
FilterEnumerator, hm);
- if (mi == null || mi.Length == 0)
+ if (mi.Count == 0)
return false;
hm.get_enumerator = (MethodInfo) mi [0];
@@ -2836,8 +4346,11 @@ namespace Mono.CSharp {
{
ForeachHelperMethods hm = new ForeachHelperMethods (ec);
- if (TryType (t, hm))
- return hm;
+ for (Type tt = t; tt != null && tt != TypeManager.object_type;){
+ if (TryType (tt, hm))
+ return hm;
+ tt = tt.BaseType;
+ }
//
// Now try to find the method in the interfaces
@@ -2869,187 +4382,234 @@ namespace Mono.CSharp {
// FIXME: possible optimization.
// We might be able to avoid creating `empty' if the type is the sam
//
- bool EmitCollectionForeach (EmitContext ec, Type var_type, ForeachHelperMethods hm)
+ bool EmitCollectionForeach (EmitContext ec)
{
ILGenerator ig = ec.ig;
- LocalBuilder enumerator, disposable;
- Expression empty = new EmptyExpression ();
- Expression conv;
- //
- // FIXME: maybe we can apply the same trick we do in the
- // array handling to avoid creating empty and conv in some cases.
- //
- // Although it is not as important in this case, as the type
- // will not likely be object (what the enumerator will return).
- //
- conv = Expression.ConvertExplicit (ec, empty, var_type, loc);
- if (conv == null)
- return false;
-
- enumerator = ig.DeclareLocal (TypeManager.ienumerator_type);
- disposable = ig.DeclareLocal (TypeManager.idisposable_type);
-
+ enumerator = new VariableStorage (ec, hm.enumerator_type);
+ enumerator.EmitThis (ig);
//
// Instantiate the enumerator
//
- if (expr.Type.IsValueType){
- if (expr is IMemoryLocation){
- IMemoryLocation ml = (IMemoryLocation) expr;
-
+ if (expr.Type.IsValueType) {
+ IMemoryLocation ml = expr as IMemoryLocation;
+ // Load the address of the value type.
+ if (ml == null) {
+ // This happens if, for example, you have a property
+ // returning a struct which is IEnumerable
+ LocalBuilder t = ec.GetTemporaryLocal (expr.Type);
+ expr.Emit (ec);
+ ig.Emit (OpCodes.Stloc, t);
+ ig.Emit (OpCodes.Ldloca, t);
+ ec.FreeTemporaryLocal (t, expr.Type);
+ } else {
ml.AddressOf (ec, AddressOp.Load);
- } else
- throw new Exception ("Expr " + expr + " of type " + expr.Type +
- " does not implement IMemoryLocation");
- ig.Emit (OpCodes.Call, hm.get_enumerator);
+ }
+
+ // Emit the call.
+ if (hm.get_enumerator.DeclaringType.IsValueType) {
+ // the method is declared on the value type
+ ig.Emit (OpCodes.Call, hm.get_enumerator);
+ } else {
+ // it is an interface method, so we must box
+ ig.Emit (OpCodes.Box, expr.Type);
+ ig.Emit (OpCodes.Callvirt, hm.get_enumerator);
+ }
} else {
expr.Emit (ec);
ig.Emit (OpCodes.Callvirt, hm.get_enumerator);
}
- ig.Emit (OpCodes.Stloc, enumerator);
+ enumerator.EmitStore (ig);
//
// Protect the code in a try/finalize block, so that
// if the beast implement IDisposable, we get rid of it
//
- Label l = ig.BeginExceptionBlock ();
- bool old_in_try = ec.InTry;
- ec.InTry = true;
+ if (hm.is_disposable && emit_finally)
+ ig.BeginExceptionBlock ();
Label end_try = ig.DefineLabel ();
ig.MarkLabel (ec.LoopBegin);
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Callvirt, hm.move_next);
+
+ enumerator.EmitCall (ig, hm.move_next);
+
ig.Emit (OpCodes.Brfalse, end_try);
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Callvirt, hm.get_current);
- variable.EmitAssign (ec, conv);
+
+ if (ec.InIterator)
+ enumerator.EmitThis (ig);
+ enumerator.EmitCall (ig, hm.get_current);
+
+ if (ec.InIterator){
+ conv.Emit (ec);
+ ig.Emit (OpCodes.Stfld, ((LocalVariableReference) variable).local_info.FieldBuilder);
+ } else
+ ((IAssignMethod)variable).EmitAssign (ec, conv, false, false);
+
statement.Emit (ec);
ig.Emit (OpCodes.Br, ec.LoopBegin);
ig.MarkLabel (end_try);
- ec.InTry = old_in_try;
- // The runtime provides this for us.
- // ig.Emit (OpCodes.Leave, end);
-
//
// Now the finally block
//
- Label end_finally = ig.DefineLabel ();
- bool old_in_finally = ec.InFinally;
- ec.InFinally = true;
- ig.BeginFinallyBlock ();
-
- ig.Emit (OpCodes.Ldloc, enumerator);
- ig.Emit (OpCodes.Isinst, TypeManager.idisposable_type);
- ig.Emit (OpCodes.Stloc, disposable);
- ig.Emit (OpCodes.Ldloc, disposable);
- ig.Emit (OpCodes.Brfalse, end_finally);
- ig.Emit (OpCodes.Ldloc, disposable);
- ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
- ig.MarkLabel (end_finally);
- ec.InFinally = old_in_finally;
-
- // The runtime generates this anyways.
- // ig.Emit (OpCodes.Endfinally);
-
- ig.EndExceptionBlock ();
+ if (hm.is_disposable) {
+ DoEmitFinally (ec);
+ if (emit_finally)
+ ig.EndExceptionBlock ();
+ }
ig.MarkLabel (ec.LoopEnd);
return false;
}
+ public override void EmitFinally (EmitContext ec)
+ {
+ ILGenerator ig = ec.ig;
+
+ if (hm.enumerator_type.IsValueType) {
+ enumerator.EmitThis (ig);
+
+ MethodInfo mi = FetchMethodDispose (hm.enumerator_type);
+ if (mi != null) {
+ enumerator.EmitLoadAddress (ig);
+ ig.Emit (OpCodes.Call, mi);
+ } else {
+ enumerator.EmitLoad (ig);
+ ig.Emit (OpCodes.Box, hm.enumerator_type);
+ ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
+ }
+ } else {
+ Label call_dispose = ig.DefineLabel ();
+
+ enumerator.EmitThis (ig);
+ enumerator.EmitLoad (ig);
+ ig.Emit (OpCodes.Isinst, TypeManager.idisposable_type);
+ ig.Emit (OpCodes.Dup);
+ ig.Emit (OpCodes.Brtrue_S, call_dispose);
+ ig.Emit (OpCodes.Pop);
+
+ Label end_finally = ig.DefineLabel ();
+ ig.Emit (OpCodes.Br, end_finally);
+
+ ig.MarkLabel (call_dispose);
+ ig.Emit (OpCodes.Callvirt, TypeManager.void_dispose_void);
+ ig.MarkLabel (end_finally);
+
+ if (emit_finally)
+ ig.Emit (OpCodes.Endfinally);
+ }
+ }
+
//
// FIXME: possible optimization.
// We might be able to avoid creating `empty' if the type is the sam
//
- bool EmitArrayForeach (EmitContext ec, Type var_type)
+ bool EmitArrayForeach (EmitContext ec)
{
- Type array_type = expr.Type;
- Type element_type = array_type.GetElementType ();
- Expression conv = null;
- Expression empty = new EmptyExpression (element_type);
-
- conv = Expression.ConvertExplicit (ec, empty, var_type, loc);
- if (conv == null)
- return false;
-
int rank = array_type.GetArrayRank ();
ILGenerator ig = ec.ig;
- LocalBuilder copy = ig.DeclareLocal (array_type);
+ VariableStorage copy = new VariableStorage (ec, array_type);
//
// Make our copy of the array
//
+ copy.EmitThis (ig);
expr.Emit (ec);
- ig.Emit (OpCodes.Stloc, copy);
+ copy.EmitStore (ig);
if (rank == 1){
- LocalBuilder counter = ig.DeclareLocal (TypeManager.int32_type);
+ VariableStorage counter = new VariableStorage (ec,TypeManager.int32_type);
Label loop, test;
-
+
+ counter.EmitThis (ig);
ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Stloc, counter);
+ counter.EmitStore (ig);
test = ig.DefineLabel ();
ig.Emit (OpCodes.Br, test);
loop = ig.DefineLabel ();
ig.MarkLabel (loop);
- ig.Emit (OpCodes.Ldloc, copy);
- ig.Emit (OpCodes.Ldloc, counter);
- ArrayAccess.EmitLoadOpcode (ig, var_type);
+ if (ec.InIterator)
+ ec.EmitThis ();
+
+ copy.EmitThis (ig);
+ copy.EmitLoad (ig);
+ counter.EmitThis (ig);
+ counter.EmitLoad (ig);
- variable.EmitAssign (ec, conv);
+ //
+ // Load the value, we load the value using the underlying type,
+ // then we use the variable.EmitAssign to load using the proper cast.
+ //
+ ArrayAccess.EmitLoadOpcode (ig, element_type);
+ if (ec.InIterator){
+ conv.Emit (ec);
+ ig.Emit (OpCodes.Stfld, ((LocalVariableReference) variable).local_info.FieldBuilder);
+ } else
+ ((IAssignMethod)variable).EmitAssign (ec, conv, false, false);
statement.Emit (ec);
ig.MarkLabel (ec.LoopBegin);
- ig.Emit (OpCodes.Ldloc, counter);
+ counter.EmitThis (ig);
+ counter.EmitThis (ig);
+ counter.EmitLoad (ig);
ig.Emit (OpCodes.Ldc_I4_1);
ig.Emit (OpCodes.Add);
- ig.Emit (OpCodes.Stloc, counter);
+ counter.EmitStore (ig);
ig.MarkLabel (test);
- ig.Emit (OpCodes.Ldloc, counter);
- ig.Emit (OpCodes.Ldloc, copy);
+ counter.EmitThis (ig);
+ counter.EmitLoad (ig);
+ copy.EmitThis (ig);
+ copy.EmitLoad (ig);
ig.Emit (OpCodes.Ldlen);
ig.Emit (OpCodes.Conv_I4);
ig.Emit (OpCodes.Blt, loop);
} else {
- LocalBuilder [] dim_len = new LocalBuilder [rank];
- LocalBuilder [] dim_count = new LocalBuilder [rank];
+ VariableStorage [] dim_len = new VariableStorage [rank];
+ VariableStorage [] dim_count = new VariableStorage [rank];
Label [] loop = new Label [rank];
Label [] test = new Label [rank];
int dim;
for (dim = 0; dim < rank; dim++){
- dim_len [dim] = ig.DeclareLocal (TypeManager.int32_type);
- dim_count [dim] = ig.DeclareLocal (TypeManager.int32_type);
+ dim_len [dim] = new VariableStorage (ec, TypeManager.int32_type);
+ dim_count [dim] = new VariableStorage (ec, TypeManager.int32_type);
test [dim] = ig.DefineLabel ();
loop [dim] = ig.DefineLabel ();
}
for (dim = 0; dim < rank; dim++){
- ig.Emit (OpCodes.Ldloc, copy);
+ dim_len [dim].EmitThis (ig);
+ copy.EmitThis (ig);
+ copy.EmitLoad (ig);
IntLiteral.EmitInt (ig, dim);
ig.Emit (OpCodes.Callvirt, TypeManager.int_getlength_int);
- ig.Emit (OpCodes.Stloc, dim_len [dim]);
+ dim_len [dim].EmitStore (ig);
+
}
for (dim = 0; dim < rank; dim++){
+ dim_count [dim].EmitThis (ig);
ig.Emit (OpCodes.Ldc_I4_0);
- ig.Emit (OpCodes.Stloc, dim_count [dim]);
+ dim_count [dim].EmitStore (ig);
ig.Emit (OpCodes.Br, test [dim]);
ig.MarkLabel (loop [dim]);
}
- ig.Emit (OpCodes.Ldloc, copy);
- for (dim = 0; dim < rank; dim++)
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
+ if (ec.InIterator)
+ ec.EmitThis ();
+ copy.EmitThis (ig);
+ copy.EmitLoad (ig);
+ for (dim = 0; dim < rank; dim++){
+ dim_count [dim].EmitThis (ig);
+ dim_count [dim].EmitLoad (ig);
+ }
//
// FIXME: Maybe we can cache the computation of `get'?
@@ -3060,24 +4620,32 @@ namespace Mono.CSharp {
for (int i = 0; i < rank; i++)
args [i] = TypeManager.int32_type;
- ModuleBuilder mb = CodeGen.ModuleBuilder;
+ ModuleBuilder mb = CodeGen.Module.Builder;
get = mb.GetArrayMethod (
array_type, "Get",
CallingConventions.HasThis| CallingConventions.Standard,
var_type, args);
ig.Emit (OpCodes.Call, get);
- variable.EmitAssign (ec, conv);
+ if (ec.InIterator){
+ conv.Emit (ec);
+ ig.Emit (OpCodes.Stfld, ((LocalVariableReference) variable).local_info.FieldBuilder);
+ } else
+ ((IAssignMethod)variable).EmitAssign (ec, conv, false, false);
statement.Emit (ec);
ig.MarkLabel (ec.LoopBegin);
for (dim = rank - 1; dim >= 0; dim--){
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
+ dim_count [dim].EmitThis (ig);
+ dim_count [dim].EmitThis (ig);
+ dim_count [dim].EmitLoad (ig);
ig.Emit (OpCodes.Ldc_I4_1);
ig.Emit (OpCodes.Add);
- ig.Emit (OpCodes.Stloc, dim_count [dim]);
+ dim_count [dim].EmitStore (ig);
ig.MarkLabel (test [dim]);
- ig.Emit (OpCodes.Ldloc, dim_count [dim]);
- ig.Emit (OpCodes.Ldloc, dim_len [dim]);
+ dim_count [dim].EmitThis (ig);
+ dim_count [dim].EmitLoad (ig);
+ dim_len [dim].EmitThis (ig);
+ dim_len [dim].EmitLoad (ig);
ig.Emit (OpCodes.Blt, loop [dim]);
}
}
@@ -3086,56 +4654,21 @@ namespace Mono.CSharp {
return false;
}
- public override bool Emit (EmitContext ec)
+ protected override void DoEmit (EmitContext ec)
{
- Type var_type;
- bool ret_val;
-
- var_type = RootContext.LookupType (ec.DeclSpace, type, false, loc);
- if (var_type == null)
- return false;
-
- //
- // We need an instance variable. Not sure this is the best
- // way of doing this.
- //
- // FIXME: When we implement propertyaccess, will those turn
- // out to return values in ExprClass? I think they should.
- //
- if (!(expr.eclass == ExprClass.Variable || expr.eclass == ExprClass.Value ||
- expr.eclass == ExprClass.PropertyAccess)){
- error1579 (expr.Type);
- return false;
- }
-
ILGenerator ig = ec.ig;
-
+
Label old_begin = ec.LoopBegin, old_end = ec.LoopEnd;
- bool old_inloop = ec.InLoop;
ec.LoopBegin = ig.DefineLabel ();
ec.LoopEnd = ig.DefineLabel ();
- ec.InLoop = true;
- if (expr.Type.IsArray)
- ret_val = EmitArrayForeach (ec, var_type);
- else {
- ForeachHelperMethods hm;
-
- hm = ProbeCollectionType (ec, expr.Type);
- if (hm == null){
- error1579 (expr.Type);
- return false;
- }
-
- ret_val = EmitCollectionForeach (ec, var_type, hm);
- }
+ if (hm != null)
+ EmitCollectionForeach (ec);
+ else
+ EmitArrayForeach (ec);
ec.LoopBegin = old_begin;
ec.LoopEnd = old_end;
- ec.InLoop = old_inloop;
-
- return ret_val;
}
}
}
-
diff --git a/mcs/mcs/support.cs b/mcs/mcs/support.cs
index b62aabd16f8..c040ebe328c 100755
--- a/mcs/mcs/support.cs
+++ b/mcs/mcs/support.cs
@@ -9,6 +9,7 @@
//
using System;
+using System.IO;
using System.Text;
using System.Reflection;
using System.Collections;
@@ -20,6 +21,7 @@ namespace Mono.CSharp {
public interface ParameterData {
Type ParameterType (int pos);
int Count { get; }
+ string ParameterName (int pos);
string ParameterDesc (int pos);
Parameter.Modifier ParameterModifier (int pos);
}
@@ -27,13 +29,16 @@ namespace Mono.CSharp {
public class ReflectionParameters : ParameterData {
ParameterInfo [] pi;
bool last_arg_is_params = false;
+ bool is_varargs = false;
- public ReflectionParameters (ParameterInfo [] pi)
+ public ReflectionParameters (MethodBase mb)
{
object [] attrs;
+
+ ParameterInfo [] pi = mb.GetParameters ();
+ is_varargs = (mb.CallingConvention & CallingConventions.VarArgs) != 0;
this.pi = pi;
-
int count = pi.Length-1;
if (count >= 0) {
@@ -53,24 +58,48 @@ namespace Mono.CSharp {
{
if (last_arg_is_params && pos >= pi.Length - 1)
return pi [pi.Length - 1].ParameterType;
+ else if (is_varargs && pos >= pi.Length)
+ return TypeManager.runtime_argument_handle_type;
+ else {
+ Type t = pi [pos].ParameterType;
+
+ return t;
+ }
+ }
+
+ public string ParameterName (int pos)
+ {
+ if (last_arg_is_params && pos >= pi.Length - 1)
+ return pi [pi.Length - 1].Name;
+ else if (is_varargs && pos >= pi.Length)
+ return "__arglist";
else
- return pi [pos].ParameterType;
+ return pi [pos].Name;
}
public string ParameterDesc (int pos)
{
- StringBuilder sb = new StringBuilder ();
+ if (is_varargs && pos >= pi.Length)
+ return "";
- if (pi [pos].IsOut)
- sb.Append ("out ");
+ StringBuilder sb = new StringBuilder ();
if (pi [pos].IsIn)
sb.Append ("in ");
+ Type partype = ParameterType (pos);
+ if (partype.IsByRef){
+ partype = TypeManager.GetElementType (partype);
+ if (pi [pos].IsOut)
+ sb.Append ("out ");
+ else
+ sb.Append ("ref ");
+ }
+
if (pos >= pi.Length - 1 && last_arg_is_params)
sb.Append ("params ");
- sb.Append (TypeManager.CSharpName (ParameterType (pos)));
+ sb.Append (TypeManager.CSharpName (partype));
return sb.ToString ();
@@ -79,21 +108,26 @@ namespace Mono.CSharp {
public Parameter.Modifier ParameterModifier (int pos)
{
int len = pi.Length;
-
- if (pos >= len - 1)
- if (last_arg_is_params)
- return Parameter.Modifier.PARAMS;
+
+ if (last_arg_is_params && pos >= pi.Length - 1)
+ return Parameter.Modifier.PARAMS;
+ else if (is_varargs && pos >= pi.Length)
+ return Parameter.Modifier.ARGLIST;
Type t = pi [pos].ParameterType;
- if (t.IsByRef)
- return Parameter.Modifier.OUT;
+ if (t.IsByRef){
+ if ((pi [pos].Attributes & ParameterAttributes.Out) != 0)
+ return Parameter.Modifier.ISBYREF | Parameter.Modifier.OUT;
+ else
+ return Parameter.Modifier.ISBYREF | Parameter.Modifier.REF;
+ }
return Parameter.Modifier.NONE;
}
public int Count {
get {
- return pi.Length;
+ return is_varargs ? pi.Length + 1 : pi.Length;
}
}
@@ -101,58 +135,77 @@ namespace Mono.CSharp {
public class InternalParameters : ParameterData {
Type [] param_types;
+ bool has_varargs;
+ int count;
- Parameters parameters;
+ public readonly Parameters Parameters;
public InternalParameters (Type [] param_types, Parameters parameters)
{
this.param_types = param_types;
- this.parameters = parameters;
- }
+ this.Parameters = parameters;
- public InternalParameters (DeclSpace ds, Parameters parameters)
- : this (parameters.GetParameterInfo (ds), parameters)
- {
+ has_varargs = parameters.HasArglist;
+
+ if (param_types == null)
+ count = 0;
+ else
+ count = param_types.Length;
}
public int Count {
get {
- if (param_types == null)
- return 0;
+ return has_varargs ? count + 1 : count;
+ }
+ }
- return param_types.Length;
+ Parameter GetParameter (int pos)
+ {
+ Parameter [] fixed_pars = Parameters.FixedParameters;
+ if (fixed_pars != null){
+ int len = fixed_pars.Length;
+ if (pos < len)
+ return Parameters.FixedParameters [pos];
}
+
+ return Parameters.ArrayParameter;
}
public Type ParameterType (int pos)
{
+ if (has_varargs && pos >= count)
+ return TypeManager.runtime_argument_handle_type;
+
if (param_types == null)
return null;
- Parameter [] fixed_pars = parameters.FixedParameters;
- if (fixed_pars != null){
- int len = fixed_pars.Length;
- if (pos < len)
- return parameters.FixedParameters [pos].ParameterType;
- else
- return parameters.ArrayParameter.ParameterType;
- } else
- return parameters.ArrayParameter.ParameterType;
+ return GetParameter (pos).ExternalType ();
+ }
+
+
+ public string ParameterName (int pos)
+ {
+ if (has_varargs && pos >= count)
+ return "__arglist";
+
+ return GetParameter (pos).Name;
}
public string ParameterDesc (int pos)
{
+ if (has_varargs && pos >= count)
+ return "__arglist";
+
string tmp = String.Empty;
- Parameter p;
+ Parameter p = GetParameter (pos);
- if (pos >= parameters.FixedParameters.Length)
- p = parameters.ArrayParameter;
- else
- p = parameters.FixedParameters [pos];
-
- if (p.ModFlags == Parameter.Modifier.REF)
+ //
+ // We need to and for REF/OUT, because if either is set the
+ // extra flag ISBYREF will be set as well
+ //
+ if ((p.ModFlags & Parameter.Modifier.REF) != 0)
tmp = "ref ";
- else if (p.ModFlags == Parameter.Modifier.OUT)
+ else if ((p.ModFlags & Parameter.Modifier.OUT) != 0)
tmp = "out ";
else if (p.ModFlags == Parameter.Modifier.PARAMS)
tmp = "params ";
@@ -164,33 +217,25 @@ namespace Mono.CSharp {
public Parameter.Modifier ParameterModifier (int pos)
{
- if (parameters.FixedParameters == null) {
- if (parameters.ArrayParameter != null)
- return parameters.ArrayParameter.ModFlags;
- else
- return Parameter.Modifier.NONE;
- }
-
- if (pos >= parameters.FixedParameters.Length)
- return parameters.ArrayParameter.ModFlags;
- else {
- Parameter.Modifier m = parameters.FixedParameters [pos].ModFlags;
-
- //
- // We use a return value of "OUT" for "reference" parameters.
- // both out and ref flags in the source map to reference parameters.
- //
- if (m == Parameter.Modifier.OUT || m == Parameter.Modifier.REF)
- return Parameter.Modifier.OUT;
-
- return Parameter.Modifier.NONE;
- }
+ if (has_varargs && pos >= count)
+ return Parameter.Modifier.ARGLIST;
+
+ Parameter.Modifier mod = GetParameter (pos).ModFlags;
+
+ if ((mod & (Parameter.Modifier.REF | Parameter.Modifier.OUT)) != 0)
+ mod |= Parameter.Modifier.ISBYREF;
+
+ return mod;
}
}
class PtrHashtable : Hashtable {
- class PtrComparer : IComparer {
+ sealed class PtrComparer : IComparer {
+ private PtrComparer () {}
+
+ public static PtrComparer Instance = new PtrComparer ();
+
public int Compare (object x, object y)
{
if (x == y)
@@ -202,32 +247,52 @@ namespace Mono.CSharp {
public PtrHashtable ()
{
- comparer = new PtrComparer ();
+ comparer = PtrComparer.Instance;
}
}
- //
- // Compares member infos based on their name and
- // also allows one argument to be a string
- //
- class MemberInfoCompare : IComparer {
+ /*
+ * Hashtable whose keys are character arrays with the same length
+ */
+ class CharArrayHashtable : Hashtable {
+ sealed class ArrComparer : IComparer {
+ private int len;
- public int Compare (object a, object b)
- {
- if (a == null || b == null){
- Console.WriteLine ("Invalid information passed");
- throw new Exception ();
+ public ArrComparer (int len) {
+ this.len = len;
}
-
- if (a is string)
- return String.Compare ((string) a, ((MemberInfo)b).Name);
- if (b is string)
- return String.Compare (((MemberInfo)a).Name, (string) b);
+ public int Compare (object x, object y)
+ {
+ char[] a = (char[])x;
+ char[] b = (char[])y;
+
+ for (int i = 0; i < len; ++i)
+ if (a [i] != b [i])
+ return 1;
+ return 0;
+ }
+ }
+
+ private int len;
+
+ protected override int GetHash (Object key)
+ {
+ char[] arr = (char[])key;
+ int h = 0;
+
+ for (int i = 0; i < len; ++i)
+ h = (h << 5) - h + arr [i];
- return String.Compare (((MemberInfo)a).Name, ((MemberInfo)b).Name);
+ return h;
}
- }
+
+ public CharArrayHashtable (int len)
+ {
+ this.len = len;
+ comparer = new ArrComparer (len);
+ }
+ }
struct Pair {
public object First;
@@ -239,4 +304,206 @@ namespace Mono.CSharp {
Second = s;
}
}
+
+ /// <summary>
+ /// This is a wrapper around StreamReader which is seekable.
+ /// </summary>
+ public class SeekableStreamReader
+ {
+ public SeekableStreamReader (StreamReader reader)
+ {
+ this.reader = reader;
+ this.buffer = new char [DefaultCacheSize];
+
+ // Compute the preamble size
+
+ // Let the StreamWriter autodetect the encoder
+ reader.Peek ();
+
+ reader.BaseStream.Position = 0;
+ Encoding enc = reader.CurrentEncoding;
+ // First of all, get at least a char
+
+ byte[] auxb = new byte [50];
+ int num_bytes = 0;
+ int num_chars = 0;
+ int br = 0;
+ do {
+ br = reader.BaseStream.Read (auxb, num_bytes, auxb.Length - num_bytes);
+ num_bytes += br;
+ num_chars = enc.GetCharCount (auxb, 0, num_bytes);
+ }
+ while (num_chars == 0 && br > 0);
+
+ if (num_chars != 0)
+ {
+ // Now, check which bytes at the beginning have no effect in the
+ // char count
+
+ int p = 0;
+ while (enc.GetCharCount (auxb, p, num_bytes-p) >= num_chars)
+ p++;
+
+ preamble_size = p - 1;
+ reader.BaseStream.Position = 0;
+ reader.DiscardBufferedData ();
+
+ buffer_start = preamble_size;
+ }
+ }
+
+ public SeekableStreamReader (Stream stream, Encoding encoding, bool detect_encoding_from_bytemarks)
+ : this (new StreamReader (stream, encoding, detect_encoding_from_bytemarks))
+ { }
+
+ StreamReader reader;
+
+ private const int DefaultCacheSize = 1024;
+
+ char[] buffer;
+ int buffer_start; // in bytes
+ int buffer_size; // in bytes
+ int char_count; // count buffer[] valid characters
+ int pos; // index into buffer[]
+ int preamble_size;
+
+ /// <remarks>
+ /// The difference to the StreamReader's BaseStream.Position is that this one is reliable; ie. it
+ // always reports the correct position and if it's modified, it also takes care of the buffered data.
+ /// </remarks>
+ public int Position {
+ get {
+ return buffer_start + reader.CurrentEncoding.GetByteCount (buffer, 0, pos);
+ }
+
+ set {
+ // This one is easy: we're modifying the position within our current
+ // buffer.
+ if ((value >= buffer_start) && (value < buffer_start + buffer_size)) {
+ int byte_offset = value - buffer_start;
+ pos = byte_offset;
+ // encoded characters can take more than 1 byte length
+ while (reader.CurrentEncoding.GetByteCount (buffer, 0, pos) > byte_offset)
+ pos--;
+
+ return;
+ }
+
+ if (value == 0) // Skip preamble
+ value = preamble_size;
+
+ // Ok, now we need to seek.
+ reader.DiscardBufferedData ();
+ reader.BaseStream.Position = buffer_start = value;
+ char_count = buffer_size = pos = 0;
+ }
+ }
+
+ private bool ReadBuffer ()
+ {
+ pos = 0;
+ buffer_start += buffer_size;
+ char_count = reader.Read (buffer, 0, buffer.Length);
+ buffer_size = reader.CurrentEncoding.GetByteCount (buffer, 0, char_count);
+ return buffer_size > 0;
+ }
+
+ public int Peek ()
+ {
+ if ((pos >= char_count) && !ReadBuffer ())
+ return -1;
+
+ return buffer [pos];
+ }
+
+ public int Read ()
+ {
+ if ((pos >= char_count) && !ReadBuffer ())
+ return -1;
+
+ return buffer [pos++];
+ }
+ }
+
+ public class DoubleHash {
+ const int DEFAULT_INITIAL_BUCKETS = 100;
+
+ public DoubleHash () : this (DEFAULT_INITIAL_BUCKETS) {}
+
+ public DoubleHash (int size)
+ {
+ count = size;
+ buckets = new Entry [size];
+ }
+
+ int count;
+ Entry [] buckets;
+ int size = 0;
+
+ class Entry {
+ public object key1;
+ public object key2;
+ public int hash;
+ public object value;
+ public Entry next;
+
+ public Entry (object key1, object key2, int hash, object value, Entry next)
+ {
+ this.key1 = key1;
+ this.key2 = key2;
+ this.hash = hash;
+ this.next = next;
+ this.value = value;
+ }
+ }
+
+ public bool Lookup (object a, object b, out object res)
+ {
+ int h = (a.GetHashCode () ^ b.GetHashCode ()) & 0x7FFFFFFF;
+
+ for (Entry e = buckets [h % count]; e != null; e = e.next) {
+ if (e.hash == h && e.key1.Equals (a) && e.key2.Equals (b)) {
+ res = e.value;
+ return true;
+ }
+ }
+ res = null;
+ return false;
+ }
+
+ public void Insert (object a, object b, object value)
+ {
+ // Is it an existing one?
+
+ int h = (a.GetHashCode () ^ b.GetHashCode ()) & 0x7FFFFFFF;
+
+ for (Entry e = buckets [h % count]; e != null; e = e.next) {
+ if (e.hash == h && e.key1.Equals (a) && e.key2.Equals (b))
+ e.value = value;
+ }
+
+ int bucket = h % count;
+ buckets [bucket] = new Entry (a, b, h, value, buckets [bucket]);
+
+ // Grow whenever we double in size
+ if (size++ == count) {
+ count <<= 1;
+ count ++;
+
+ Entry [] newBuckets = new Entry [count];
+ foreach (Entry root in buckets) {
+ Entry e = root;
+ while (e != null) {
+ int newLoc = e.hash % count;
+ Entry n = e.next;
+ e.next = newBuckets [newLoc];
+ newBuckets [newLoc] = e;
+ e = n;
+ }
+ }
+
+ buckets = newBuckets;
+ }
+ }
+ }
}
diff --git a/mcs/mcs/symbolwriter.cs b/mcs/mcs/symbolwriter.cs
new file mode 100644
index 00000000000..cebbe401570
--- /dev/null
+++ b/mcs/mcs/symbolwriter.cs
@@ -0,0 +1,91 @@
+//
+// symbolwriter.cs: The symbol writer
+//
+// Author:
+// Martin Baulig (martin@ximian.com)
+//
+// (C) 2003 Ximian, Inc.
+//
+
+using System;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+
+using Mono.CompilerServices.SymbolWriter;
+
+namespace Mono.CSharp {
+ public class SymbolWriter : MonoSymbolWriter {
+ delegate int GetILOffsetFunc (ILGenerator ig);
+ delegate Guid GetGuidFunc (ModuleBuilder mb);
+
+ GetILOffsetFunc get_il_offset_func;
+ GetGuidFunc get_guid_func;
+
+ ModuleBuilder module_builder;
+
+ protected SymbolWriter (ModuleBuilder module_builder, string filename)
+ : base (filename)
+ {
+ this.module_builder = module_builder;
+ }
+
+ bool Initialize ()
+ {
+ MethodInfo mi = typeof (ILGenerator).GetMethod (
+ "Mono_GetCurrentOffset",
+ BindingFlags.Static | BindingFlags.NonPublic);
+ if (mi == null)
+ return false;
+
+ get_il_offset_func = (GetILOffsetFunc) System.Delegate.CreateDelegate (
+ typeof (GetILOffsetFunc), mi);
+
+ mi = typeof (ModuleBuilder).GetMethod (
+ "Mono_GetGuid",
+ BindingFlags.Static | BindingFlags.NonPublic);
+ if (mi == null)
+ return false;
+
+ get_guid_func = (GetGuidFunc) System.Delegate.CreateDelegate (
+ typeof (GetGuidFunc), mi);
+
+ Location.DefineSymbolDocuments (this);
+ Namespace.DefineNamespaces (this);
+
+ return true;
+ }
+
+ public void DefineLocalVariable (string name, LocalBuilder builder)
+ {
+ SignatureHelper sighelper = SignatureHelper.GetLocalVarSigHelper (
+ module_builder);
+ sighelper.AddArgument (builder.LocalType);
+ byte[] signature = sighelper.GetSignature ();
+
+ DefineLocalVariable (name, signature);
+ }
+
+ public void MarkSequencePoint (ILGenerator ig, int row, int column)
+ {
+ int offset = get_il_offset_func (ig);
+ MarkSequencePoint (offset, row, column);
+ }
+
+ public void WriteSymbolFile ()
+ {
+ Guid guid = get_guid_func (module_builder);
+ WriteSymbolFile (guid);
+ }
+
+ public static SymbolWriter GetSymbolWriter (ModuleBuilder module,
+ string filename)
+ {
+ SymbolWriter writer = new SymbolWriter (module, filename);
+ if (!writer.Initialize ())
+ return null;
+
+ return writer;
+ }
+ }
+}
diff --git a/mcs/mcs/tree.cs b/mcs/mcs/tree.cs
index 2cf5be8ca5c..c873e706fe3 100755
--- a/mcs/mcs/tree.cs
+++ b/mcs/mcs/tree.cs
@@ -34,57 +34,64 @@ namespace Mono.CSharp
TypeContainer root_types;
// <summary>
- // Keeps track of namespaces defined in the source code
- // </summary>
- Hashtable namespaces;
-
- // <summary>
// Keeps track of all the types definied (classes, structs, ifaces, enums)
// </summary>
Hashtable decls;
public Tree ()
{
- root_types = new TypeContainer (null, "", new Location (-1));
+ root_types = new RootTypes ();
decls = new Hashtable ();
- namespaces = new Hashtable ();
}
+ DoubleHash decl_ns_name = new DoubleHash ();
+
public void RecordDecl (string name, DeclSpace ds)
{
- if (decls.Contains (name)){
+ DeclSpace other = (DeclSpace) decls [name];
+ if (other != null){
+ PartialContainer other_pc = other as PartialContainer;
+ if ((ds is TypeContainer) && (other_pc != null)) {
+ Report.Error (
+ 260, ds.Location, "Missing partial modifier " +
+ "on declaration of type `{0}'; another " +
+ "partial implementation of this type exists",
+ name);
+
+ Report.LocationOfPreviousError (other.Location);
+ return;
+ }
+
+ Report.SymbolRelatedToPreviousError (
+ other.Location, other.GetSignatureForError ());
+
Report.Error (
101, ds.Location,
"There is already a definition for `" + name + "'");
- DeclSpace other = (DeclSpace) decls [name];
- Report.Error (0,
- other.Location, "(Location of symbol related to previous error)");
return;
}
- decls.Add (name, ds);
- }
-
- public Namespace RecordNamespace (Namespace parent, string file, string name)
- {
- Namespace ns = new Namespace (parent, name);
-
- if (namespaces.Contains (file)){
- Hashtable ns_ns = (Hashtable) namespaces [file];
- if (ns_ns.Contains (ns.Name))
- return (Namespace) ns_ns [ns.Name];
- ns_ns.Add (ns.Name, ns);
- } else {
- Hashtable new_table = new Hashtable ();
- namespaces [file] = new_table;
+ ds.RecordDecl ();
- new_table.Add (ns.Name, ns);
+ int p = name.LastIndexOf ('.');
+ if (p == -1)
+ decl_ns_name.Insert ("", name, ds);
+ else {
+ decl_ns_name.Insert (name.Substring (0, p), name.Substring (p+1), ds);
}
- return ns;
+ decls.Add (name, ds);
}
+ public DeclSpace LookupByNamespace (string ns, string name)
+ {
+ object res;
+
+ decl_ns_name.Lookup (ns, name, out res);
+ return (DeclSpace) res;
+ }
+
//
// FIXME: Why are we using Types?
//
@@ -99,11 +106,23 @@ namespace Mono.CSharp
return decls;
}
}
+ }
- public Hashtable Namespaces {
- get {
- return namespaces;
- }
+ public class RootTypes : TypeContainer
+ {
+ public RootTypes ()
+ : base (null, null, MemberName.Null, null, Kind.Root,
+ new Location (-1))
+ { }
+
+ public override void Register ()
+ {
+ throw new InvalidOperationException ();
+ }
+
+ public override PendingImplementation GetPendingImplementations ()
+ {
+ throw new InvalidOperationException ();
}
}
}
diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs
index 3702757da07..91f50fd0771 100755
--- a/mcs/mcs/typemanager.cs
+++ b/mcs/mcs/typemanager.cs
@@ -9,13 +9,21 @@
// (C) 2001 Ximian, Inc (http://www.ximian.com)
//
//
-#define CACHE
+
+//
+// We will eventually remove the SIMPLE_SPEEDUP, and should never change
+// the behavior of the compilation. This can be removed if we rework
+// the code to get a list of namespaces available.
+//
+#define SIMPLE_SPEEDUP
using System;
+using System.IO;
using System.Globalization;
using System.Collections;
using System.Reflection;
using System.Reflection.Emit;
+using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.CompilerServices;
using System.Diagnostics;
@@ -53,13 +61,16 @@ public class TypeManager {
static public Type icloneable_type;
static public Type type_type;
static public Type ienumerator_type;
+ static public Type ienumerable_type;
static public Type idisposable_type;
+ static public Type iconvertible_type;
static public Type default_member_type;
static public Type iasyncresult_type;
static public Type asynccallback_type;
static public Type intptr_type;
static public Type monitor_type;
static public Type runtime_field_handle_type;
+ static public Type runtime_argument_handle_type;
static public Type attribute_type;
static public Type attribute_usage_type;
static public Type dllimport_type;
@@ -67,12 +78,62 @@ public class TypeManager {
static public Type methodimpl_attr_type;
static public Type marshal_as_attr_type;
static public Type param_array_type;
+ static public Type guid_attr_type;
static public Type void_ptr_type;
static public Type indexer_name_type;
- static public object obsolete_attribute_type;
- static public object conditional_attribute_type;
+ static public Type exception_type;
+ static public Type invalid_operation_exception_type;
+ static public Type not_supported_exception_type;
+ static public Type obsolete_attribute_type;
+ static public Type conditional_attribute_type;
+ static public Type in_attribute_type;
+ static public Type anonymous_method_type;
+ static public Type cls_compliant_attribute_type;
+ static public Type typed_reference_type;
+ static public Type arg_iterator_type;
+ static public Type mbr_type;
+ static public Type struct_layout_attribute_type;
+ static public Type field_offset_attribute_type;
+ static public Type security_attr_type;
+ //
+ // An empty array of types
+ //
static public Type [] NoTypes;
+ static public TypeExpr [] NoTypeExprs;
+
+
+ //
+ // Expressions representing the internal types. Used during declaration
+ // definition.
+ //
+ static public TypeExpr system_object_expr, system_string_expr;
+ static public TypeExpr system_boolean_expr, system_decimal_expr;
+ static public TypeExpr system_single_expr, system_double_expr;
+ static public TypeExpr system_sbyte_expr, system_byte_expr;
+ static public TypeExpr system_int16_expr, system_uint16_expr;
+ static public TypeExpr system_int32_expr, system_uint32_expr;
+ static public TypeExpr system_int64_expr, system_uint64_expr;
+ static public TypeExpr system_char_expr, system_void_expr;
+ static public TypeExpr system_asynccallback_expr;
+ static public TypeExpr system_iasyncresult_expr;
+ static public TypeExpr system_valuetype_expr;
+ static public TypeExpr system_intptr_expr;
+
+ //
+ // This is only used when compiling corlib
+ //
+ static public Type system_int32_type;
+ static public Type system_array_type;
+ static public Type system_type_type;
+ static public Type system_assemblybuilder_type;
+ static public MethodInfo system_int_array_get_length;
+ static public MethodInfo system_int_array_get_rank;
+ static public MethodInfo system_object_array_clone;
+ static public MethodInfo system_int_array_get_length_int;
+ static public MethodInfo system_int_array_get_lower_bound_int;
+ static public MethodInfo system_int_array_get_upper_bound_int;
+ static public MethodInfo system_void_array_copyto_array_int;
//
@@ -84,11 +145,18 @@ public class TypeManager {
// These methods are called by code generated by the compiler
//
static public MethodInfo string_concat_string_string;
+ static public MethodInfo string_concat_string_string_string;
+ static public MethodInfo string_concat_string_string_string_string;
+ static public MethodInfo string_concat_string_dot_dot_dot;
static public MethodInfo string_concat_object_object;
+ static public MethodInfo string_concat_object_object_object;
+ static public MethodInfo string_concat_object_dot_dot_dot;
static public MethodInfo string_isinterneted_string;
static public MethodInfo system_type_get_type_from_handle;
static public MethodInfo object_getcurrent_void;
static public MethodInfo bool_movenext_void;
+ static public MethodInfo ienumerable_getenumerator_void;
+ static public MethodInfo void_reset_void;
static public MethodInfo void_dispose_void;
static public MethodInfo void_monitor_enter_object;
static public MethodInfo void_monitor_exit_object;
@@ -98,12 +166,22 @@ public class TypeManager {
static public MethodInfo delegate_remove_delegate_delegate;
static public MethodInfo int_get_offset_to_string_data;
static public MethodInfo int_array_get_length;
+ static public MethodInfo int_array_get_rank;
+ static public MethodInfo object_array_clone;
+ static public MethodInfo int_array_get_length_int;
+ static public MethodInfo int_array_get_lower_bound_int;
+ static public MethodInfo int_array_get_upper_bound_int;
+ static public MethodInfo void_array_copyto_array_int;
//
// The attribute constructors.
//
+ static public ConstructorInfo object_ctor;
static public ConstructorInfo cons_param_array_attribute;
static public ConstructorInfo void_decimal_ctor_five_args;
+ static public ConstructorInfo unverifiable_code_ctor;
+ static public ConstructorInfo invalid_operation_ctor;
+ static public ConstructorInfo default_member_ctor;
// <remarks>
// Holds the Array of Assemblies that have been loaded
@@ -113,10 +191,10 @@ public class TypeManager {
static Assembly [] assemblies;
// <remarks>
- // Keeps a list of module builders. We used this to do lookups
- // on the modulebuilder using GetType -- needed for arrays
+ // Keeps a list of modules. We used this to do lookups
+ // on the module using GetType -- needed for arrays
// </remarks>
- static ModuleBuilder [] modules;
+ static Module [] modules;
// <remarks>
// This is the type_cache from the assemblies to avoid
@@ -136,10 +214,7 @@ public class TypeManager {
// </remarks>
static ArrayList user_types;
- // <remarks>
- // Keeps a mapping between TypeBuilders and their TypeContainers
- // </remarks>
- static PtrHashtable builder_to_container;
+ static PtrHashtable builder_to_declspace;
// <remarks>
// Tracks the interfaces implemented by typebuilders. We only
@@ -154,35 +229,60 @@ public class TypeManager {
static Hashtable method_arguments;
// <remarks>
+ // Maps PropertyBuilder to a Type array that contains
+ // the arguments to the indexer
+ // </remarks>
+ static Hashtable indexer_arguments;
+
+ // <remarks>
// Maybe `method_arguments' should be replaced and only
// method_internal_params should be kept?
// <remarks>
static Hashtable method_internal_params;
- static PtrHashtable builder_to_interface;
-
- // <remarks>
- // Keeps track of delegate types
- // </remarks>
-
- static Hashtable builder_to_delegate;
-
// <remarks>
- // Keeps track of enum types
+ // Keeps track of methods
// </remarks>
- static Hashtable builder_to_enum;
+ static Hashtable builder_to_method;
// <remarks>
- // Keeps track of attribute types
+ // Contains all public types from referenced assemblies.
+ // This member is used only if CLS Compliance verification is required.
// </remarks>
-
- static Hashtable builder_to_attr;
+ public static Hashtable all_imported_types;
struct Signature {
public string name;
public Type [] args;
}
+
+ public static void CleanUp ()
+ {
+ // Lets get everything clean so that we can collect before generating code
+ assemblies = null;
+ modules = null;
+ types = null;
+ typecontainers = null;
+ user_types = null;
+ builder_to_declspace = null;
+ builder_to_ifaces = null;
+ method_arguments = null;
+ indexer_arguments = null;
+ method_internal_params = null;
+ builder_to_method = null;
+
+ fields = null;
+ references = null;
+ negative_hits = null;
+ builder_to_constant = null;
+ fieldbuilders_to_fields = null;
+ events = null;
+ priv_fields_events = null;
+ properties = null;
+
+ TypeHandle.CleanUp ();
+ }
/// <summary>
/// A filter for Findmembers that uses the Signature object to
@@ -227,6 +327,34 @@ public class TypeManager {
// A delegate that points to the filter above.
static MemberFilter signature_filter;
+ //
+ // These are expressions that represent some of the internal data types, used
+ // elsewhere
+ //
+ static void InitExpressionTypes ()
+ {
+ system_object_expr = new TypeLookupExpression ("System.Object");
+ system_string_expr = new TypeLookupExpression ("System.String");
+ system_boolean_expr = new TypeLookupExpression ("System.Boolean");
+ system_decimal_expr = new TypeLookupExpression ("System.Decimal");
+ system_single_expr = new TypeLookupExpression ("System.Single");
+ system_double_expr = new TypeLookupExpression ("System.Double");
+ system_sbyte_expr = new TypeLookupExpression ("System.SByte");
+ system_byte_expr = new TypeLookupExpression ("System.Byte");
+ system_int16_expr = new TypeLookupExpression ("System.Int16");
+ system_uint16_expr = new TypeLookupExpression ("System.UInt16");
+ system_int32_expr = new TypeLookupExpression ("System.Int32");
+ system_uint32_expr = new TypeLookupExpression ("System.UInt32");
+ system_int64_expr = new TypeLookupExpression ("System.Int64");
+ system_uint64_expr = new TypeLookupExpression ("System.UInt64");
+ system_char_expr = new TypeLookupExpression ("System.Char");
+ system_void_expr = new TypeLookupExpression ("System.Void");
+ system_asynccallback_expr = new TypeLookupExpression ("System.AsyncCallback");
+ system_iasyncresult_expr = new TypeLookupExpression ("System.IAsyncResult");
+ system_valuetype_expr = new TypeLookupExpression ("System.ValueType");
+ system_intptr_expr = new TypeLookupExpression ("System.IntPtr");
+ }
+
static TypeManager ()
{
assemblies = new Assembly [0];
@@ -236,45 +364,55 @@ public class TypeManager {
types = new Hashtable ();
typecontainers = new Hashtable ();
- builder_to_interface = new PtrHashtable ();
- builder_to_delegate = new PtrHashtable ();
- builder_to_enum = new PtrHashtable ();
- builder_to_attr = new PtrHashtable ();
+ builder_to_declspace = new PtrHashtable ();
+ builder_to_method = new PtrHashtable ();
method_arguments = new PtrHashtable ();
method_internal_params = new PtrHashtable ();
- builder_to_container = new PtrHashtable ();
+ indexer_arguments = new PtrHashtable ();
builder_to_ifaces = new PtrHashtable ();
NoTypes = new Type [0];
+ NoTypeExprs = new TypeExpr [0];
signature_filter = new MemberFilter (SignatureFilter);
+ InitExpressionTypes ();
}
- public static void AddUserType (string name, TypeBuilder t, Type [] ifaces)
+ public static void HandleDuplicate (string name, Type t)
+ {
+ Type prev = (Type) types [name];
+ TypeContainer tc = builder_to_declspace [prev] as TypeContainer;
+
+ if (tc != null){
+ //
+ // This probably never happens, as we catch this before
+ //
+ Report.Error (-17, "The type `" + name + "' has already been defined.");
+ return;
+ }
+
+ tc = builder_to_declspace [t] as TypeContainer;
+ if (tc != null){
+ Report.Warning (
+ 1595, "The type `" + name + "' is defined in an existing assembly;"+
+ " Using the new definition from: " + tc.Location);
+ } else {
+ Report.Warning (
+ 1595, "The type `" + name + "' is defined in an existing assembly;");
+ }
+
+ Report.Warning (1595, "Previously defined in: " + prev.Assembly.FullName);
+
+ types.Remove (name);
+ types.Add (name, t);
+ }
+
+ public static void AddUserType (string name, TypeBuilder t, TypeExpr[] ifaces)
{
try {
types.Add (name, t);
} catch {
- Type prev = (Type) types [name];
- TypeContainer tc = (TypeContainer) builder_to_container [prev];
-
- if (tc != null){
- //
- // This probably never happens, as we catch this before
- //
- Report.Error (-17, "The type `" + name + "' has already been defined.");
- return;
- }
-
- tc = (TypeContainer) builder_to_container [t];
-
- Report.Warning (
- 1595, "The type `" + name + "' is defined in an existing assembly;"+
- " Using the new definition from: " + tc.Location);
- Report.Warning (1595, "Previously defined in: " + prev.Assembly.FullName);
-
- types.Remove (name);
- types.Add (name, t);
+ HandleDuplicate (name, t);
}
user_types.Add (t);
@@ -285,69 +423,156 @@ public class TypeManager {
//
// This entry point is used by types that we define under the covers
//
- public static void RegisterBuilder (TypeBuilder tb, Type [] ifaces)
+ public static void RegisterBuilder (TypeBuilder tb, TypeExpr [] ifaces)
{
if (ifaces != null)
builder_to_ifaces [tb] = ifaces;
}
- public static void AddUserType (string name, TypeBuilder t, TypeContainer tc, Type [] ifaces)
+ public static void AddUserType (string name, TypeBuilder t, TypeContainer tc, TypeExpr [] ifaces)
{
- builder_to_container.Add (t, tc);
+ builder_to_declspace.Add (t, tc);
typecontainers.Add (name, tc);
AddUserType (name, t, ifaces);
}
public static void AddDelegateType (string name, TypeBuilder t, Delegate del)
{
- types.Add (name, t);
- builder_to_delegate.Add (t, del);
+ try {
+ types.Add (name, t);
+ } catch {
+ HandleDuplicate (name, t);
+ }
+
+ builder_to_declspace.Add (t, del);
}
public static void AddEnumType (string name, TypeBuilder t, Enum en)
{
- types.Add (name, t);
- builder_to_enum.Add (t, en);
+ try {
+ types.Add (name, t);
+ } catch {
+ HandleDuplicate (name, t);
+ }
+ builder_to_declspace.Add (t, en);
}
- public static void AddUserInterface (string name, TypeBuilder t, Interface i, Type [] ifaces)
+ public static void AddUserInterface (string name, TypeBuilder t, Interface i, TypeExpr [] ifaces)
{
AddUserType (name, t, ifaces);
- builder_to_interface.Add (t, i);
+ builder_to_declspace.Add (t, i);
}
- public static void RegisterAttrType (Type t, TypeContainer tc)
+
+ public static void AddMethod (MethodBase builder, IMethodData method)
{
- builder_to_attr.Add (t, tc);
+ builder_to_method.Add (builder, method);
}
-
+
+ public static IMethodData GetMethod (MethodBase builder)
+ {
+ return (IMethodData) builder_to_method [builder];
+ }
+
+ /// <summary>
+ /// Returns the DeclSpace whose Type is `t' or null if there is no
+ /// DeclSpace for `t' (ie, the Type comes from a library)
+ /// </summary>
+ public static DeclSpace LookupDeclSpace (Type t)
+ {
+ return builder_to_declspace [t] as DeclSpace;
+ }
+
/// <summary>
/// Returns the TypeContainer whose Type is `t' or null if there is no
/// TypeContainer for `t' (ie, the Type comes from a library)
/// </summary>
public static TypeContainer LookupTypeContainer (Type t)
{
- return (TypeContainer) builder_to_container [t];
+ return builder_to_declspace [t] as TypeContainer;
+ }
+
+ /// <summary>
+ /// Fills member container from base interfaces
+ /// </summary>
+ public static IMemberContainer LookupInterfaceContainer (Type[] types)
+ {
+ if (types == null)
+ return null;
+
+ IMemberContainer complete = null;
+ foreach (Type t in types) {
+ IMemberContainer one_type_cont = null;
+ if (t is TypeBuilder) {
+ one_type_cont = builder_to_declspace [t] as IMemberContainer;
+ } else
+ one_type_cont = TypeHandle.GetTypeHandle (t);
+
+ if (complete == null) {
+ complete = one_type_cont;
+ continue;
+ }
+
+ // We need to avoid including same member more than once
+ foreach (DictionaryEntry de in one_type_cont.MemberCache.Members) {
+ object o = complete.MemberCache.Members [de.Key];
+ if (o == null) {
+ complete.MemberCache.Members.Add (de.Key, de.Value);
+ continue;
+ }
+
+ ArrayList al_old = (ArrayList)o;
+ ArrayList al_new = (ArrayList)de.Value;
+
+ foreach (MemberCache.CacheEntry ce in al_new) {
+ bool exist = false;
+ foreach (MemberCache.CacheEntry ce_old in al_old) {
+ if (ce.Member == ce_old.Member) {
+ exist = true;
+ break;
+ }
+ }
+ if (!exist)
+ al_old.Add (ce);
+ }
+ }
+ }
+ return complete;
+ }
+
+ public static IMemberContainer LookupMemberContainer (Type t)
+ {
+ if (t is TypeBuilder) {
+ IMemberContainer container = builder_to_declspace [t] as IMemberContainer;
+ if (container != null)
+ return container;
+ }
+
+ return TypeHandle.GetTypeHandle (t);
}
- public static Interface LookupInterface (Type t)
+ public static TypeContainer LookupInterface (Type t)
{
- return (Interface) builder_to_interface [t];
+ TypeContainer tc = (TypeContainer) builder_to_declspace [t];
+ if ((tc == null) || (tc.Kind != Kind.Interface))
+ return null;
+
+ return tc;
}
public static Delegate LookupDelegate (Type t)
{
- return (Delegate) builder_to_delegate [t];
+ return builder_to_declspace [t] as Delegate;
}
public static Enum LookupEnum (Type t)
{
- return (Enum) builder_to_enum [t];
+ return builder_to_declspace [t] as Enum;
}
-
- public static TypeContainer LookupAttr (Type t)
+
+ public static Class LookupClass (Type t)
{
- return (TypeContainer) builder_to_attr [t];
+ return (Class) builder_to_declspace [t];
}
/// <summary>
@@ -355,6 +580,11 @@ public class TypeManager {
/// </summary>
public static void AddAssembly (Assembly a)
{
+ foreach (Assembly assembly in assemblies) {
+ if (a == assembly)
+ return;
+ }
+
int top = assemblies.Length;
Assembly [] n = new Assembly [top + 1];
@@ -364,13 +594,18 @@ public class TypeManager {
assemblies = n;
}
+ public static Assembly [] GetAssemblies ()
+ {
+ return assemblies;
+ }
+
/// <summary>
/// Registers a module builder to lookup types from
/// </summary>
- public static void AddModule (ModuleBuilder mb)
+ public static void AddModule (Module mb)
{
int top = modules != null ? modules.Length : 0;
- ModuleBuilder [] n = new ModuleBuilder [top + 1];
+ Module [] n = new Module [top + 1];
if (modules != null)
modules.CopyTo (n, 0);
@@ -378,8 +613,141 @@ public class TypeManager {
modules = n;
}
+ public static Module[] Modules {
+ get {
+ return modules;
+ }
+ }
+
+ static Hashtable references = new Hashtable ();
+
+ //
+ // Gets the reference to T version of the Type (T&)
+ //
+ public static Type GetReferenceType (Type t)
+ {
+ string tname = t.FullName + "&";
+
+ Type ret = t.Assembly.GetType (tname);
+
+ //
+ // If the type comes from the assembly we are building
+ // We need the Hashtable, because .NET 1.1 will return different instance types
+ // every time we call ModuleBuilder.GetType.
+ //
+ if (ret == null){
+ if (references [t] == null)
+ references [t] = CodeGen.Module.Builder.GetType (tname);
+ ret = (Type) references [t];
+ }
+
+ return ret;
+ }
+
+ static Hashtable pointers = new Hashtable ();
+
+ //
+ // Gets the pointer to T version of the Type (T*)
+ //
+ public static Type GetPointerType (Type t)
+ {
+ string tname = t.FullName + "*";
+
+ Type ret = t.Assembly.GetType (tname);
+
+ //
+ // If the type comes from the assembly we are building
+ // We need the Hashtable, because .NET 1.1 will return different instance types
+ // every time we call ModuleBuilder.GetType.
+ //
+ if (ret == null){
+ if (pointers [t] == null)
+ pointers [t] = CodeGen.Module.Builder.GetType (tname);
+
+ ret = (Type) pointers [t];
+ }
+
+ return ret;
+ }
+
+ //
+ // Low-level lookup, cache-less
+ //
+ static Type LookupTypeReflection (string name)
+ {
+ Type t;
+
+ foreach (Assembly a in assemblies){
+ t = a.GetType (name);
+ if (t == null)
+ continue;
+
+ do {
+ TypeAttributes ta = t.Attributes & TypeAttributes.VisibilityMask;
+ if (ta == TypeAttributes.NotPublic ||
+ ta == TypeAttributes.NestedPrivate ||
+ ta == TypeAttributes.NestedAssembly ||
+ ta == TypeAttributes.NestedFamANDAssem){
+
+ //
+ // In .NET pointers turn out to be private, even if their
+ // element type is not
+ //
+ if (t.IsPointer){
+ t = t.GetElementType ();
+ continue;
+ } else
+ t = null;
+ } else {
+ return t;
+ }
+ } while (t != null);
+ }
+
+ foreach (Module mb in modules) {
+ t = mb.GetType (name);
+ if (t != null)
+ return t;
+ }
+
+ return null;
+ }
+
+ static Hashtable negative_hits = new Hashtable ();
+
+ //
+ // This function is used when you want to avoid the lookups, and want to go
+ // directly to the source. This will use the cache.
+ //
+ // Notice that bypassing the cache is bad, because on Microsoft.NET runtime
+ // GetType ("DynamicType[]") != GetType ("DynamicType[]"), and there is no
+ // way to test things other than doing a fullname compare
+ //
+ public static Type LookupTypeDirect (string name)
+ {
+ Type t = (Type) types [name];
+ if (t != null)
+ return t;
+
+ if (negative_hits.Contains (name))
+ return null;
+
+ t = LookupTypeReflection (name);
+
+ if (t == null)
+ negative_hits [name] = null;
+ else
+ types [name] = t;
+
+ return t;
+ }
+
+ static readonly char [] dot_array = { '.' };
+
/// <summary>
- /// Returns the Type associated with @name
+ /// Returns the Type associated with @name, takes care of the fact that
+ /// reflection expects nested types to be separated from the main type
+ /// with a "+" instead of a "."
/// </summary>
public static Type LookupType (string name)
{
@@ -393,24 +761,114 @@ public class TypeManager {
if (t != null)
return t;
- foreach (Assembly a in assemblies){
- t = a.GetType (name);
- if (t != null){
- types [name] = t;
+ // Two thirds of the failures are caught here.
+ if (negative_hits.Contains (name))
+ return null;
+
+ // Sadly, split takes a param array, so this ends up allocating *EVERY TIME*
+ string [] elements = name.Split (dot_array);
+ int count = elements.Length;
+ for (int n = 1; n <= count; n++){
+ string top_level_type = String.Join (".", elements, 0, n);
+
+ // One third of the failures are caught here.
+ if (negative_hits.Contains (top_level_type))
+ continue;
+
+ t = (Type) types [top_level_type];
+ if (t == null){
+ t = LookupTypeReflection (top_level_type);
+ if (t == null){
+ negative_hits [top_level_type] = null;
+ continue;
+ }
+ }
+
+ if (count == n){
+ types [name] = t;
return t;
+ }
+
+ //
+ // We know that System.Object does not have children, and since its the parent of
+ // all the objects, it always gets probbed for inner classes.
+ //
+ if (top_level_type == "System.Object")
+ return null;
+
+ string newt = top_level_type + "+" + String.Join ("+", elements, n, count - n);
+ //Console.WriteLine ("Looking up: " + newt + " " + name);
+ t = LookupTypeReflection (newt);
+ if (t == null)
+ negative_hits [name] = null;
+ else
+ types [name] = t;
+ return t;
+ }
+ negative_hits [name] = null;
+ return null;
+ }
+
+ /// <summary>
+ /// Computes the namespaces that we import from the assemblies we reference.
+ /// </summary>
+ public static void ComputeNamespaces ()
+ {
+ MethodInfo assembly_get_namespaces = typeof (Assembly).GetMethod ("GetNamespaces", BindingFlags.Instance|BindingFlags.NonPublic);
+
+ //
+ // First add the assembly namespaces
+ //
+ if (assembly_get_namespaces != null){
+ int count = assemblies.Length;
+
+ for (int i = 0; i < count; i++){
+ Assembly a = assemblies [i];
+ string [] namespaces = (string []) assembly_get_namespaces.Invoke (a, null);
+ foreach (string ns in namespaces){
+ if (ns == "")
+ continue;
+ Namespace.LookupNamespace (ns, true);
+ }
+ }
+ } else {
+ Hashtable cache = new Hashtable ();
+ cache.Add ("", null);
+ foreach (Assembly a in assemblies) {
+ foreach (Type t in a.GetExportedTypes ()) {
+ string ns = t.Namespace;
+ if (ns == null || cache.Contains (ns))
+ continue;
+
+ Namespace.LookupNamespace (ns, true);
+ cache.Add (ns, null);
+ }
}
}
+ }
- foreach (ModuleBuilder mb in modules) {
- t = mb.GetType (name);
- if (t != null) {
- types [name] = t;
- return t;
+ /// <summary>
+ /// Fills static table with exported types from all referenced assemblies.
+ /// This information is required for CLS Compliance tests.
+ /// </summary>
+ public static void LoadAllImportedTypes ()
+ {
+ all_imported_types = new Hashtable ();
+ foreach (Assembly a in assemblies) {
+ foreach (Type t in a.GetExportedTypes ()) {
+ all_imported_types [t.FullName] = t;
}
}
-
- return null;
+ }
+
+ public static bool NamespaceClash (string name, Location loc)
+ {
+ if (Namespace.LookupNamespace (name, false) == null)
+ return false;
+
+ Report.Error (519, loc, String.Format ("`{0}' clashes with a predefined namespace", name));
+ return true;
}
/// <summary>
@@ -420,9 +878,9 @@ public class TypeManager {
{
return Regex.Replace (t.FullName,
@"^System\." +
- @"(Int32|UInt32|Int16|Uint16|Int64|UInt64|" +
+ @"(Int32|UInt32|Int16|UInt16|Int64|UInt64|" +
@"Single|Double|Char|Decimal|Byte|SByte|Object|" +
- @"Boolean|String|Void)" +
+ @"Boolean|String|Void|Null)" +
@"(\W+|\b)",
new MatchEvaluator (CSharpNameMatch));
}
@@ -443,33 +901,82 @@ public class TypeManager {
}
/// <summary>
- /// Returns the signature of the method
- /// </summary>
- static public string CSharpSignature (MethodBase mb)
- {
- string sig = "(";
+ /// Returns the signature of the method with full namespace classification
+ /// </summary>
+ static public string GetFullNameSignature (MemberInfo mi)
+ {
+ return mi.DeclaringType.FullName.Replace ('+', '.') + '.' + mi.Name;
+ }
+
+ static public string GetFullNameSignature (MethodBase mb)
+ {
+ string name = mb.Name;
+ if (name == ".ctor")
+ name = mb.DeclaringType.Name;
+
+ if (mb.IsSpecialName) {
+ if (name.StartsWith ("get_") || name.StartsWith ("set_")) {
+ name = name.Remove (0, 4);
+ }
+
+ if (name == "Item")
+ name = "this";
+ }
+
+ return mb.DeclaringType.FullName.Replace ('+', '.') + '.' + name;
+ }
+
+ /// <summary>
+ /// Returns the signature of the property and indexer
+ /// </summary>
+ static public string CSharpSignature (PropertyBuilder pb, bool is_indexer)
+ {
+ if (!is_indexer) {
+ return GetFullNameSignature (pb);
+ }
+
+ MethodBase mb = pb.GetSetMethod (true) != null ? pb.GetSetMethod (true) : pb.GetGetMethod (true);
+ string signature = GetFullNameSignature (mb);
+ string arg = TypeManager.LookupParametersByBuilder (mb).ParameterDesc (0);
+ return String.Format ("{0}.this[{1}]", signature.Substring (0, signature.LastIndexOf ('.')), arg);
+ }
+
+ /// <summary>
+ /// Returns the signature of the method
+ /// </summary>
+ static public string CSharpSignature (MethodBase mb)
+ {
+ StringBuilder sig = new StringBuilder ("(");
//
// FIXME: We should really have a single function to do
// everything instead of the following 5 line pattern
//
- ParameterData iparams = LookupParametersByBuilder (mb);
+ ParameterData iparams = LookupParametersByBuilder (mb);
- if (iparams == null){
- ParameterInfo [] pi = mb.GetParameters ();
- iparams = new ReflectionParameters (pi);
- }
+ if (iparams == null)
+ iparams = new ReflectionParameters (mb);
+
+ // Is property
+ if (mb.IsSpecialName && iparams.Count == 0 && !mb.IsConstructor)
+ return GetFullNameSignature (mb);
- for (int i = 0; i < iparams.Count; i++) {
- if (i > 0) {
- sig += ", ";
- }
- sig += iparams.ParameterDesc(i);
- }
- sig += ")";
-
- return mb.DeclaringType.Name + "." + mb.Name + sig;
- }
+ for (int i = 0; i < iparams.Count; i++) {
+ if (i > 0) {
+ sig.Append (", ");
+ }
+ sig.Append (iparams.ParameterDesc (i));
+ }
+ sig.Append (")");
+
+ // Is indexer
+ if (mb.IsSpecialName && iparams.Count == 1 && !mb.IsConstructor) {
+ sig.Replace ('(', '[');
+ sig.Replace (')', ']');
+ }
+
+ return GetFullNameSignature (mb) + sig.ToString ();
+ }
/// <summary>
/// Looks up a type, and aborts if it is not found. This is used
@@ -477,11 +984,11 @@ public class TypeManager {
/// </summary>
static Type CoreLookupType (string name)
{
- Type t = LookupType (name);
+ Type t = LookupTypeDirect (name);
if (t == null){
Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
- Environment.Exit (0);
+ Environment.Exit (1);
}
return t;
@@ -491,44 +998,72 @@ public class TypeManager {
/// Returns the MethodInfo for a method named `name' defined
/// in type `t' which takes arguments of types `args'
/// </summary>
- static MethodInfo GetMethod (Type t, string name, Type [] args)
+ static MethodInfo GetMethod (Type t, string name, Type [] args, bool is_private, bool report_errors)
{
- MemberInfo [] mi;
+ MemberList list;
Signature sig;
+ BindingFlags flags = instance_and_static | BindingFlags.Public;
sig.name = name;
sig.args = args;
-
- mi = FindMembers (
- t, MemberTypes.Method,
- instance_and_static | BindingFlags.Public, signature_filter, sig);
- if (mi == null || mi.Length == 0 || !(mi [0] is MethodInfo)){
- Report.Error (-19, "Can not find the core function `" + name + "'");
+
+ if (is_private)
+ flags |= BindingFlags.NonPublic;
+
+ list = FindMembers (t, MemberTypes.Method, flags, signature_filter, sig);
+ if (list.Count == 0) {
+ if (report_errors)
+ Report.Error (-19, "Can not find the core function `" + name + "'");
+ return null;
+ }
+
+ MethodInfo mi = list [0] as MethodInfo;
+ if (mi == null) {
+ if (report_errors)
+ Report.Error (-19, "Can not find the core function `" + name + "'");
return null;
}
- return (MethodInfo) mi [0];
+ return mi;
}
+ static MethodInfo GetMethod (Type t, string name, Type [] args, bool report_errors)
+ {
+ return GetMethod (t, name, args, false, report_errors);
+ }
+
+ static MethodInfo GetMethod (Type t, string name, Type [] args)
+ {
+ return GetMethod (t, name, args, true);
+ }
+
+
/// <summary>
/// Returns the ConstructorInfo for "args"
/// </summary>
static ConstructorInfo GetConstructor (Type t, Type [] args)
{
- MemberInfo [] mi;
+ MemberList list;
Signature sig;
sig.name = ".ctor";
sig.args = args;
- mi = FindMembers (t, MemberTypes.Constructor,
- instance_and_static | BindingFlags.Public | BindingFlags.DeclaredOnly, signature_filter, sig);
- if (mi == null || mi.Length == 0 || !(mi [0] is ConstructorInfo)){
+ list = FindMembers (t, MemberTypes.Constructor,
+ instance_and_static | BindingFlags.Public | BindingFlags.DeclaredOnly,
+ signature_filter, sig);
+ if (list.Count == 0){
Report.Error (-19, "Can not find the core constructor for type `" + t.Name + "'");
return null;
}
- return (ConstructorInfo) mi [0];
+ ConstructorInfo ci = list [0] as ConstructorInfo;
+ if (ci == null){
+ Report.Error (-19, "Can not find the core constructor for type `" + t.Name + "'");
+ return null;
+ }
+
+ return ci;
}
public static void InitEnumUnderlyingTypes ()
@@ -573,14 +1108,17 @@ public class TypeManager {
type_type = CoreLookupType ("System.Type");
runtime_field_handle_type = CoreLookupType ("System.RuntimeFieldHandle");
+ runtime_argument_handle_type = CoreLookupType ("System.RuntimeArgumentHandle");
runtime_helpers_type = CoreLookupType ("System.Runtime.CompilerServices.RuntimeHelpers");
default_member_type = CoreLookupType ("System.Reflection.DefaultMemberAttribute");
runtime_handle_type = CoreLookupType ("System.RuntimeTypeHandle");
asynccallback_type = CoreLookupType ("System.AsyncCallback");
iasyncresult_type = CoreLookupType ("System.IAsyncResult");
ienumerator_type = CoreLookupType ("System.Collections.IEnumerator");
+ ienumerable_type = CoreLookupType ("System.Collections.IEnumerable");
idisposable_type = CoreLookupType ("System.IDisposable");
icloneable_type = CoreLookupType ("System.ICloneable");
+ iconvertible_type = CoreLookupType ("System.IConvertible");
monitor_type = CoreLookupType ("System.Threading.Monitor");
intptr_type = CoreLookupType ("System.IntPtr");
@@ -588,8 +1126,18 @@ public class TypeManager {
attribute_usage_type = CoreLookupType ("System.AttributeUsageAttribute");
dllimport_type = CoreLookupType ("System.Runtime.InteropServices.DllImportAttribute");
methodimpl_attr_type = CoreLookupType ("System.Runtime.CompilerServices.MethodImplAttribute");
- marshal_as_attr_type = CoreLookupType ("System.Runtime.InteropServices.MarshalAsAttribute");
- param_array_type = CoreLookupType ("System.ParamArrayAttribute");
+ marshal_as_attr_type = CoreLookupType ("System.Runtime.InteropServices.MarshalAsAttribute");
+ param_array_type = CoreLookupType ("System.ParamArrayAttribute");
+ in_attribute_type = CoreLookupType ("System.Runtime.InteropServices.InAttribute");
+ typed_reference_type = CoreLookupType ("System.TypedReference");
+ arg_iterator_type = CoreLookupType ("System.ArgIterator");
+ mbr_type = CoreLookupType ("System.MarshalByRefObject");
+
+ //
+ // Sigh. Remove this before the release. Wonder what versions of Mono
+ // people are running.
+ //
+ guid_attr_type = LookupType ("System.Runtime.InteropServices.GuidAttribute");
unverifiable_code_type= CoreLookupType ("System.Security.UnverifiableCodeAttribute");
@@ -597,11 +1145,110 @@ public class TypeManager {
indexer_name_type = CoreLookupType ("System.Runtime.CompilerServices.IndexerNameAttribute");
+ exception_type = CoreLookupType ("System.Exception");
+ invalid_operation_exception_type = CoreLookupType ("System.InvalidOperationException");
+ not_supported_exception_type = CoreLookupType ("System.NotSupportedException");
+
//
// Attribute types
//
obsolete_attribute_type = CoreLookupType ("System.ObsoleteAttribute");
conditional_attribute_type = CoreLookupType ("System.Diagnostics.ConditionalAttribute");
+ cls_compliant_attribute_type = CoreLookupType ("System.CLSCompliantAttribute");
+ struct_layout_attribute_type = CoreLookupType ("System.Runtime.InteropServices.StructLayoutAttribute");
+ field_offset_attribute_type = CoreLookupType ("System.Runtime.InteropServices.FieldOffsetAttribute");
+ security_attr_type = CoreLookupType ("System.Security.Permissions.SecurityAttribute");
+
+ //
+ // When compiling corlib, store the "real" types here.
+ //
+ if (!RootContext.StdLib) {
+ system_int32_type = typeof (System.Int32);
+ system_array_type = typeof (System.Array);
+ system_type_type = typeof (System.Type);
+ system_assemblybuilder_type = typeof (System.Reflection.Emit.AssemblyBuilder);
+
+ Type [] void_arg = { };
+ system_int_array_get_length = GetMethod (
+ system_array_type, "get_Length", void_arg);
+ system_int_array_get_rank = GetMethod (
+ system_array_type, "get_Rank", void_arg);
+ system_object_array_clone = GetMethod (
+ system_array_type, "Clone", void_arg);
+
+ Type [] system_int_arg = { system_int32_type };
+ system_int_array_get_length_int = GetMethod (
+ system_array_type, "GetLength", system_int_arg);
+ system_int_array_get_upper_bound_int = GetMethod (
+ system_array_type, "GetUpperBound", system_int_arg);
+ system_int_array_get_lower_bound_int = GetMethod (
+ system_array_type, "GetLowerBound", system_int_arg);
+
+ Type [] system_array_int_arg = { system_array_type, system_int32_type };
+ system_void_array_copyto_array_int = GetMethod (
+ system_array_type, "CopyTo", system_array_int_arg);
+
+ Type [] system_3_type_arg = {
+ system_type_type, system_type_type, system_type_type };
+ Type [] system_4_type_arg = {
+ system_type_type, system_type_type, system_type_type, system_type_type };
+
+ MethodInfo set_corlib_type_builders = GetMethod (
+ system_assemblybuilder_type, "SetCorlibTypeBuilders",
+ system_4_type_arg, true, false);
+
+ if (set_corlib_type_builders != null) {
+ object[] args = new object [4];
+ args [0] = object_type;
+ args [1] = value_type;
+ args [2] = enum_type;
+ args [3] = void_type;
+
+ set_corlib_type_builders.Invoke (CodeGen.Assembly.Builder, args);
+ } else {
+ // Compatibility for an older version of the class libs.
+ set_corlib_type_builders = GetMethod (
+ system_assemblybuilder_type, "SetCorlibTypeBuilders",
+ system_3_type_arg, true, true);
+
+ if (set_corlib_type_builders == null) {
+ Report.Error (-26, "Corlib compilation is not supported in Microsoft.NET due to bugs in it");
+ return;
+ }
+
+ object[] args = new object [3];
+ args [0] = object_type;
+ args [1] = value_type;
+ args [2] = enum_type;
+
+ set_corlib_type_builders.Invoke (CodeGen.Assembly.Builder, args);
+ }
+ }
+
+ system_object_expr.Type = object_type;
+ system_string_expr.Type = string_type;
+ system_boolean_expr.Type = bool_type;
+ system_decimal_expr.Type = decimal_type;
+ system_single_expr.Type = float_type;
+ system_double_expr.Type = double_type;
+ system_sbyte_expr.Type = sbyte_type;
+ system_byte_expr.Type = byte_type;
+ system_int16_expr.Type = short_type;
+ system_uint16_expr.Type = ushort_type;
+ system_int32_expr.Type = int32_type;
+ system_uint32_expr.Type = uint32_type;
+ system_int64_expr.Type = int64_type;
+ system_uint64_expr.Type = uint64_type;
+ system_char_expr.Type = char_type;
+ system_void_expr.Type = void_type;
+ system_asynccallback_expr.Type = asynccallback_type;
+ system_iasyncresult_expr.Type = iasyncresult_type;
+ system_valuetype_expr.Type = value_type;
+
+ //
+ // These are only used for compare purposes
+ //
+ anonymous_method_type = typeof (AnonymousMethod);
}
//
@@ -615,10 +1262,25 @@ public class TypeManager {
Type [] string_string = { string_type, string_type };
string_concat_string_string = GetMethod (
string_type, "Concat", string_string);
+ Type [] string_string_string = { string_type, string_type, string_type };
+ string_concat_string_string_string = GetMethod (
+ string_type, "Concat", string_string_string);
+ Type [] string_string_string_string = { string_type, string_type, string_type, string_type };
+ string_concat_string_string_string_string = GetMethod (
+ string_type, "Concat", string_string_string_string);
+ Type[] params_string = { TypeManager.LookupType ("System.String[]") };
+ string_concat_string_dot_dot_dot = GetMethod (
+ string_type, "Concat", params_string);
Type [] object_object = { object_type, object_type };
string_concat_object_object = GetMethod (
string_type, "Concat", object_object);
+ Type [] object_object_object = { object_type, object_type, object_type };
+ string_concat_object_object_object = GetMethod (
+ string_type, "Concat", object_object_object);
+ Type[] params_object = { TypeManager.LookupType ("System.Object[]") };
+ string_concat_object_dot_dot_dot = GetMethod (
+ string_type, "Concat", params_object);
Type [] string_ = { string_type };
string_isinterneted_string = GetMethod (
@@ -643,12 +1305,38 @@ public class TypeManager {
ienumerator_type, "get_Current", void_arg);
bool_movenext_void = GetMethod (
ienumerator_type, "MoveNext", void_arg);
+ void_reset_void = GetMethod (
+ ienumerator_type, "Reset", void_arg);
void_dispose_void = GetMethod (
idisposable_type, "Dispose", void_arg);
int_get_offset_to_string_data = GetMethod (
runtime_helpers_type, "get_OffsetToStringData", void_arg);
int_array_get_length = GetMethod (
array_type, "get_Length", void_arg);
+ int_array_get_rank = GetMethod (
+ array_type, "get_Rank", void_arg);
+ ienumerable_getenumerator_void = GetMethod (
+ ienumerable_type, "GetEnumerator", void_arg);
+
+ //
+ // Int32 arguments
+ //
+ Type [] int_arg = { int32_type };
+ int_array_get_length_int = GetMethod (
+ array_type, "GetLength", int_arg);
+ int_array_get_upper_bound_int = GetMethod (
+ array_type, "GetUpperBound", int_arg);
+ int_array_get_lower_bound_int = GetMethod (
+ array_type, "GetLowerBound", int_arg);
+
+ //
+ // System.Array methods
+ //
+ object_array_clone = GetMethod (
+ array_type, "Clone", void_arg);
+ Type [] array_int_arg = { array_type, int32_type };
+ void_array_copyto_array_int = GetMethod (
+ array_type, "CopyTo", array_int_arg);
//
// object arguments
@@ -667,7 +1355,6 @@ public class TypeManager {
//
// Array functions
//
- Type [] int_arg = { int32_type };
int_getlength_int = GetMethod (
array_type, "GetLength", int_arg);
@@ -683,92 +1370,152 @@ public class TypeManager {
//
cons_param_array_attribute = GetConstructor (
param_array_type, void_arg);
-
+
+ unverifiable_code_ctor = GetConstructor (
+ unverifiable_code_type, void_arg);
+
+ default_member_ctor = GetConstructor (default_member_type, string_);
+
+ //
+ // InvalidOperationException
+ //
+ invalid_operation_ctor = GetConstructor (
+ invalid_operation_exception_type, void_arg);
+
+
+ // Object
+ object_ctor = GetConstructor (object_type, void_arg);
+
}
const BindingFlags instance_and_static = BindingFlags.Static | BindingFlags.Instance;
- //
- // FIXME: This can be optimized easily. speedup by having a single builder mapping
- //
- public static MemberInfo [] FindMembers (Type t, MemberTypes mt, BindingFlags bf,
- MemberFilter filter, object criteria)
+ /// <remarks>
+ /// This is the "old", non-cache based FindMembers() function. We cannot use
+ /// the cache here because there is no member name argument.
+ /// </remarks>
+ public static MemberList FindMembers (Type t, MemberTypes mt, BindingFlags bf,
+ MemberFilter filter, object criteria)
{
+ DeclSpace decl = (DeclSpace) builder_to_declspace [t];
+
+ //
+ // `builder_to_declspace' contains all dynamic types.
+ //
+ if (decl != null) {
+ MemberList list;
+ Timer.StartTimer (TimerType.FindMembers);
+ list = decl.FindMembers (mt, bf, filter, criteria);
+ Timer.StopTimer (TimerType.FindMembers);
+ return list;
+ }
+
//
// We have to take care of arrays specially, because GetType on
// a TypeBuilder array will return a Type, not a TypeBuilder,
// and we can not call FindMembers on this type.
//
if (t.IsSubclassOf (TypeManager.array_type))
- return TypeManager.array_type.FindMembers (mt, bf, filter, criteria);
-
- if (!(t is TypeBuilder)){
- //
- // Since FindMembers will not lookup both static and instance
- // members, we emulate this behaviour here.
- //
- if ((bf & instance_and_static) == instance_and_static){
- MemberInfo [] i_members = t.FindMembers (
- mt, bf & ~BindingFlags.Static, filter, criteria);
-
- int i_len = i_members.Length;
- if (i_len == 1){
- MemberInfo one = i_members [0];
+ return new MemberList (TypeManager.array_type.FindMembers (mt, bf, filter, criteria));
- //
- // If any of these are present, we are done!
- //
- if ((one is Type) || (one is EventInfo) || (one is FieldInfo))
- return i_members;
- }
-
- MemberInfo [] s_members = t.FindMembers (
- mt, bf & ~BindingFlags.Instance, filter, criteria);
+ //
+ // Since FindMembers will not lookup both static and instance
+ // members, we emulate this behaviour here.
+ //
+ if ((bf & instance_and_static) == instance_and_static){
+ MemberInfo [] i_members = t.FindMembers (
+ mt, bf & ~BindingFlags.Static, filter, criteria);
- int s_len = s_members.Length;
- if (i_len > 0 || s_len > 0){
- MemberInfo [] both = new MemberInfo [i_len + s_len];
+ int i_len = i_members.Length;
+ if (i_len == 1){
+ MemberInfo one = i_members [0];
- i_members.CopyTo (both, 0);
- s_members.CopyTo (both, i_len);
+ //
+ // If any of these are present, we are done!
+ //
+ if ((one is Type) || (one is EventInfo) || (one is FieldInfo))
+ return new MemberList (i_members);
+ }
+
+ MemberInfo [] s_members = t.FindMembers (
+ mt, bf & ~BindingFlags.Instance, filter, criteria);
- return both;
- } else {
- if (i_len > 0)
- return i_members;
- else
- return s_members;
- }
+ int s_len = s_members.Length;
+ if (i_len > 0 || s_len > 0)
+ return new MemberList (i_members, s_members);
+ else {
+ if (i_len > 0)
+ return new MemberList (i_members);
+ else
+ return new MemberList (s_members);
}
- return t.FindMembers (mt, bf, filter, criteria);
}
+ return new MemberList (t.FindMembers (mt, bf, filter, criteria));
+ }
+
+
+ /// <summary>
+ /// This method is only called from within MemberLookup. It tries to use the member
+ /// cache if possible and falls back to the normal FindMembers if not. The `used_cache'
+ /// flag tells the caller whether we used the cache or not. If we used the cache, then
+ /// our return value will already contain all inherited members and the caller don't need
+ /// to check base classes and interfaces anymore.
+ /// </summary>
+ private static MemberInfo [] MemberLookup_FindMembers (Type t, MemberTypes mt, BindingFlags bf,
+ string name, out bool used_cache)
+ {
//
- // FIXME: We should not have builder_to_blah everywhere,
- // we should just have a builder_to_findmemberizable
- // and have them implement a new ICanFindMembers interface
+ // We have to take care of arrays specially, because GetType on
+ // a TypeBuilder array will return a Type, not a TypeBuilder,
+ // and we can not call FindMembers on this type.
//
- Enum e = (Enum) builder_to_enum [t];
+ if (t == TypeManager.array_type || t.IsSubclassOf (TypeManager.array_type)) {
+ used_cache = true;
+ return TypeHandle.ArrayType.MemberCache.FindMembers (
+ mt, bf, name, FilterWithClosure_delegate, null);
+ }
- if (e != null)
- return e.FindMembers (mt, bf, filter, criteria);
-
- Delegate del = (Delegate) builder_to_delegate [t];
+ //
+ // If this is a dynamic type, it's always in the `builder_to_declspace' hash table
+ // and we can ask the DeclSpace for the MemberCache.
+ //
+ if (t is TypeBuilder) {
+ DeclSpace decl = (DeclSpace) builder_to_declspace [t];
+ MemberCache cache = decl.MemberCache;
- if (del != null)
- return del.FindMembers (mt, bf, filter, criteria);
+ //
+ // If this DeclSpace has a MemberCache, use it.
+ //
- Interface iface = (Interface) builder_to_interface [t];
+ if (cache != null) {
+ used_cache = true;
+ return cache.FindMembers (
+ mt, bf, name, FilterWithClosure_delegate, null);
+ }
- if (iface != null)
- return iface.FindMembers (mt, bf, filter, criteria);
-
- TypeContainer tc = (TypeContainer) builder_to_container [t];
+ // If there is no MemberCache, we need to use the "normal" FindMembers.
+ // Note, this is a VERY uncommon route!
+
+ MemberList list;
+ Timer.StartTimer (TimerType.FindMembers);
+ list = decl.FindMembers (mt, bf | BindingFlags.DeclaredOnly,
+ FilterWithClosure_delegate, name);
+ Timer.StopTimer (TimerType.FindMembers);
+ used_cache = false;
+
+ return (MemberInfo []) list;
+ }
- if (tc != null)
- return tc.FindMembers (mt, bf, filter, criteria);
+ //
+ // This call will always succeed. There is exactly one TypeHandle instance per
+ // type, TypeHandle.GetTypeHandle() will either return it or create a new one
+ // if it didn't already exist.
+ //
+ TypeHandle handle = TypeHandle.GetTypeHandle (t);
- return null;
+ used_cache = true;
+ return handle.MemberCache.FindMembers (mt, bf, name, FilterWithClosure_delegate, null);
}
public static bool IsBuiltinType (Type t)
@@ -776,6 +1523,26 @@ public class TypeManager {
if (t == object_type || t == string_type || t == int32_type || t == uint32_type ||
t == int64_type || t == uint64_type || t == float_type || t == double_type ||
t == char_type || t == short_type || t == decimal_type || t == bool_type ||
+ t == sbyte_type || t == byte_type || t == ushort_type || t == void_type)
+ return true;
+ else
+ return false;
+ }
+
+ public static bool IsBuiltinType (TypeContainer tc)
+ {
+ return IsBuiltinType (tc.TypeBuilder);
+ }
+
+ //
+ // This is like IsBuiltinType, but lacks decimal_type, we should also clean up
+ // the pieces in the code where we use IsBuiltinType and special case decimal_type.
+ //
+ public static bool IsCLRType (Type t)
+ {
+ if (t == object_type || t == int32_type || t == uint32_type ||
+ t == int64_type || t == uint64_type || t == float_type || t == double_type ||
+ t == char_type || t == short_type || t == bool_type ||
t == sbyte_type || t == byte_type || t == ushort_type)
return true;
else
@@ -797,16 +1564,123 @@ public class TypeManager {
else
return false;
}
-
- public static bool IsInterfaceType (Type t)
+ public static bool IsBuiltinOrEnum (Type t)
+ {
+ if (IsBuiltinType (t))
+ return true;
+
+ if (IsEnumType (t))
+ return true;
+
+ return false;
+ }
+
+ //
+ // Whether a type is unmanaged. This is used by the unsafe code (25.2)
+ //
+ public static bool IsUnmanagedType (Type t)
{
- Interface iface = (Interface) builder_to_interface [t];
+ if (IsBuiltinType (t) && t != TypeManager.string_type)
+ return true;
- if (iface != null)
+ if (IsEnumType (t))
+ return true;
+
+ if (t.IsPointer)
+ return true;
+
+ if (IsValueType (t)){
+ if (t is TypeBuilder){
+ TypeContainer tc = LookupTypeContainer (t);
+
+ if (tc.Fields != null){
+ foreach (Field f in tc.Fields){
+ if (f.FieldBuilder.IsStatic)
+ continue;
+ if (!IsUnmanagedType (f.FieldBuilder.FieldType))
+ return false;
+ }
+ } else
+ return true;
+ } else {
+ FieldInfo [] fields = t.GetFields ();
+
+ foreach (FieldInfo f in fields){
+ if (f.IsStatic)
+ continue;
+ if (!IsUnmanagedType (f.FieldType))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsValueType (Type t)
+ {
+ if (t.IsSubclassOf (TypeManager.value_type) && (t != TypeManager.enum_type))
return true;
else
return false;
}
+
+ public static bool IsInterfaceType (Type t)
+ {
+ TypeContainer tc = (TypeContainer) builder_to_declspace [t];
+ if (tc == null)
+ return false;
+
+ return tc.Kind == Kind.Interface;
+ }
+
+ //
+ // Checks whether `type' is a subclass or nested child of `parent'.
+ //
+ public static bool IsSubclassOrNestedChildOf (Type type, Type parent)
+ {
+ do {
+ if ((type == parent) || type.IsSubclassOf (parent))
+ return true;
+
+ // Handle nested types.
+ type = type.DeclaringType;
+ } while (type != null);
+
+ return false;
+ }
+
+ //
+ // Checks whether `type' is a nested child of `parent'.
+ //
+ public static bool IsNestedChildOf (Type type, Type parent)
+ {
+ if (type == parent)
+ return false;
+
+ type = type.DeclaringType;
+ while (type != null) {
+ if (type == parent)
+ return true;
+
+ type = type.DeclaringType;
+ }
+
+ return false;
+ }
+
+ //
+ // Do the right thing when returning the element type of an
+ // array type based on whether we are compiling corlib or not
+ //
+ public static Type GetElementType (Type t)
+ {
+ if (RootContext.StdLib)
+ return t.GetElementType ();
+ else
+ return TypeToCoreType (t.GetElementType ());
+ }
/// <summary>
/// Returns the User Defined Types
@@ -853,15 +1727,13 @@ public class TypeManager {
/// for anything which is dynamic, and we need this in a number of places,
/// we register this information here, and use it afterwards.
/// </remarks>
- static public bool RegisterMethod (MethodBase mb, InternalParameters ip, Type [] args)
+ static public void RegisterMethod (MethodBase mb, InternalParameters ip, Type [] args)
{
if (args == null)
args = NoTypes;
method_arguments.Add (mb, args);
method_internal_params.Add (mb, ip);
-
- return true;
}
static public InternalParameters LookupParametersByBuilder (MethodBase mb)
@@ -884,17 +1756,53 @@ public class TypeManager {
/// </summary>
static public Type [] GetArgumentTypes (MethodBase mb)
{
- if (method_arguments.Contains (mb))
- return (Type []) method_arguments [mb];
+ object t = method_arguments [mb];
+ if (t != null)
+ return (Type []) t;
+
+ ParameterInfo [] pi = mb.GetParameters ();
+ int c = pi.Length;
+ Type [] types;
+
+ if (c == 0) {
+ types = NoTypes;
+ } else {
+ types = new Type [c];
+ for (int i = 0; i < c; i++)
+ types [i] = pi [i].ParameterType;
+ }
+ method_arguments.Add (mb, types);
+ return types;
+ }
+
+ /// <summary>
+ /// Returns the argument types for an indexer based on its PropertyInfo
+ ///
+ /// For dynamic indexers, we use the compiler provided types, for
+ /// indexers from existing assemblies we load them from GetParameters,
+ /// and insert them into the cache
+ /// </summary>
+ static public Type [] GetArgumentTypes (PropertyInfo indexer)
+ {
+ if (indexer_arguments.Contains (indexer))
+ return (Type []) indexer_arguments [indexer];
+ else if (indexer is PropertyBuilder)
+ // If we're a PropertyBuilder and not in the
+ // `indexer_arguments' hash, then we're a property and
+ // not an indexer.
+ return NoTypes;
else {
- ParameterInfo [] pi = mb.GetParameters ();
+ ParameterInfo [] pi = indexer.GetIndexParameters ();
+ // Property, not an indexer.
+ if (pi == null)
+ return NoTypes;
int c = pi.Length;
Type [] types = new Type [c];
for (int i = 0; i < c; i++)
types [i] = pi [i].ParameterType;
- method_arguments.Add (mb, types);
+ indexer_arguments.Add (indexer, types);
return types;
}
}
@@ -929,6 +1837,11 @@ public class TypeManager {
return true;
}
+ //
+ // The return value can be null; This will be the case for
+ // auxiliary FieldBuilders created by the compiler that have no
+ // real field being declared on the source code
+ //
static public FieldBase GetField (FieldInfo fb)
{
return (FieldBase) fieldbuilders_to_fields [fb];
@@ -936,17 +1849,14 @@ public class TypeManager {
static Hashtable events;
- static public bool RegisterEvent (MyEventBuilder eb, MethodBase add, MethodBase remove)
+ static public void RegisterEvent (MyEventBuilder eb, MethodBase add, MethodBase remove)
{
if (events == null)
events = new Hashtable ();
- if (events.Contains (eb))
- return false;
-
- events.Add (eb, new Pair (add, remove));
-
- return true;
+ if (!events.Contains (eb)) {
+ events.Add (eb, new Pair (add, remove));
+ }
}
static public MethodInfo GetAddMethod (EventInfo ei)
@@ -955,8 +1865,8 @@ public class TypeManager {
Pair pair = (Pair) events [ei];
return (MethodInfo) pair.First;
- } else
- return ei.GetAddMethod ();
+ }
+ return ei.GetAddMethod (true);
}
static public MethodInfo GetRemoveMethod (EventInfo ei)
@@ -965,10 +1875,33 @@ public class TypeManager {
Pair pair = (Pair) events [ei];
return (MethodInfo) pair.Second;
- } else
- return ei.GetAddMethod ();
+ }
+ return ei.GetRemoveMethod (true);
}
+ static Hashtable priv_fields_events;
+
+ static public bool RegisterPrivateFieldOfEvent (EventInfo einfo, FieldBuilder builder)
+ {
+ if (priv_fields_events == null)
+ priv_fields_events = new Hashtable ();
+
+ if (priv_fields_events.Contains (einfo))
+ return false;
+
+ priv_fields_events.Add (einfo, builder);
+
+ return true;
+ }
+
+ static public MemberInfo GetPrivateFieldOfEvent (EventInfo ei)
+ {
+ if (priv_fields_events == null)
+ return null;
+ else
+ return (MemberInfo) priv_fields_events [ei];
+ }
+
static Hashtable properties;
static public bool RegisterProperty (PropertyBuilder pb, MethodBase get, MethodBase set)
@@ -983,56 +1916,74 @@ public class TypeManager {
return true;
}
-
- //
- // FIXME: we need to return the accessors depending on whether
- // they are visible or not.
- //
- static public MethodInfo [] GetAccessors (PropertyInfo pi)
+
+ static public bool RegisterIndexer (PropertyBuilder pb, MethodBase get,
+ MethodBase set, Type[] args)
{
- MethodInfo [] ret;
+ if (!RegisterProperty (pb, get,set))
+ return false;
- if (pi is PropertyBuilder){
- Pair pair = (Pair) properties [pi];
+ indexer_arguments.Add (pb, args);
- ret = new MethodInfo [2];
- ret [0] = (MethodInfo) pair.First;
- ret [1] = (MethodInfo) pair.Second;
+ return true;
+ }
- return ret;
- } else {
- MethodInfo [] mi = new MethodInfo [2];
+ public static bool CheckStructCycles (TypeContainer tc, Hashtable seen)
+ {
+ Hashtable hash = new Hashtable ();
+ return CheckStructCycles (tc, seen, hash);
+ }
+
+ public static bool CheckStructCycles (TypeContainer tc, Hashtable seen,
+ Hashtable hash)
+ {
+ if ((tc.Kind != Kind.Struct) || IsBuiltinType (tc))
+ return true;
+
+ //
+ // `seen' contains all types we've already visited.
+ //
+ if (seen.Contains (tc))
+ return true;
+ seen.Add (tc, null);
+
+ if (tc.Fields == null)
+ return true;
+
+ foreach (Field field in tc.Fields) {
+ if (field.FieldBuilder.IsStatic)
+ continue;
+
+ Type ftype = field.FieldBuilder.FieldType;
+ TypeContainer ftc = LookupTypeContainer (ftype);
+ if (ftc == null)
+ continue;
+
+ if (hash.Contains (ftc)) {
+ Report.Error (523, tc.Location,
+ "Struct member `{0}.{1}' of type `{2}' " +
+ "causes a cycle in the struct layout",
+ tc.Name, field.Name, ftc.Name);
+ return false;
+ }
//
- // Why this and not pi.GetAccessors?
- // Because sometimes index 0 is the getter
- // sometimes it is 1
+ // `hash' contains all types in the current path.
//
- mi [0] = pi.GetGetMethod (true);
- mi [1] = pi.GetSetMethod (true);
+ hash.Add (tc, null);
- return mi;
- }
- }
+ bool ok = CheckStructCycles (ftc, seen, hash);
- static public MethodInfo GetPropertyGetter (PropertyInfo pi)
- {
- if (pi is PropertyBuilder){
- Pair de = (Pair) properties [pi];
+ hash.Remove (tc);
- return (MethodInfo) de.Second;
- } else
- return pi.GetSetMethod ();
- }
+ if (!ok)
+ return false;
- static public MethodInfo GetPropertySetter (PropertyInfo pi)
- {
- if (pi is PropertyBuilder){
- Pair de = (Pair) properties [pi];
+ if (!seen.Contains (ftc))
+ seen.Add (ftc, null);
+ }
- return (MethodInfo) de.First;
- } else
- return pi.GetGetMethod ();
+ return true;
}
/// <summary>
@@ -1044,32 +1995,39 @@ public class TypeManager {
/// This expands in context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
/// be IA, IB, IC.
/// </remarks>
- public static Type [] ExpandInterfaces (Type [] base_interfaces)
+ public static TypeExpr[] ExpandInterfaces (TypeExpr [] base_interfaces)
{
ArrayList new_ifaces = new ArrayList ();
- foreach (Type iface in base_interfaces){
+ foreach (TypeExpr iface in base_interfaces){
if (!new_ifaces.Contains (iface))
new_ifaces.Add (iface);
- Type [] implementing = TypeManager.GetInterfaces (iface);
+ TypeExpr [] implementing = iface.GetInterfaces ();
- foreach (Type imp in implementing){
+ foreach (TypeExpr imp in implementing){
if (!new_ifaces.Contains (imp))
new_ifaces.Add (imp);
}
}
- Type [] ret = new Type [new_ifaces.Count];
+ TypeExpr [] ret = new TypeExpr [new_ifaces.Count];
new_ifaces.CopyTo (ret, 0);
return ret;
}
+
+ static PtrHashtable iface_cache = new PtrHashtable ();
/// <summary>
/// This function returns the interfaces in the type `t'. Works with
/// both types and TypeBuilders.
/// </summary>
- public static Type [] GetInterfaces (Type t)
+ public static TypeExpr [] GetInterfaces (Type t)
{
+
+ TypeExpr [] cached = iface_cache [t] as TypeExpr [];
+ if (cached != null)
+ return cached;
+
//
// The reason for catching the Array case is that Reflection.Emit
// will not return a TypeBuilder for Array types of TypeBuilder types,
@@ -1084,24 +2042,43 @@ public class TypeManager {
t = TypeManager.array_type;
if (t is TypeBuilder){
- Type [] parent_ifaces;
+ TypeExpr [] parent_ifaces;
if (t.BaseType == null)
- parent_ifaces = NoTypes;
+ parent_ifaces = NoTypeExprs;
else
parent_ifaces = GetInterfaces (t.BaseType);
- Type [] type_ifaces = (Type []) builder_to_ifaces [t];
+ TypeExpr [] type_ifaces = (TypeExpr []) builder_to_ifaces [t];
if (type_ifaces == null)
- type_ifaces = NoTypes;
+ type_ifaces = NoTypeExprs;
int parent_count = parent_ifaces.Length;
- Type [] result = new Type [parent_count + type_ifaces.Length];
+ TypeExpr [] result = new TypeExpr [parent_count + type_ifaces.Length];
parent_ifaces.CopyTo (result, 0);
type_ifaces.CopyTo (result, parent_count);
+ iface_cache [t] = result;
+ return result;
+ } else {
+ Type [] ifaces = t.GetInterfaces ();
+ if (ifaces.Length == 0)
+ return NoTypeExprs;
+
+ TypeExpr [] result = new TypeExpr [ifaces.Length];
+ for (int i = 0; i < ifaces.Length; i++)
+ result [i] = new TypeExpression (ifaces [i], Location.Null);
+
+ iface_cache [t] = result;
return result;
- } else
- return t.GetInterfaces ();
+ }
+ }
+
+ //
+ // gets the interfaces that are declared explicitly on t
+ //
+ public static TypeExpr [] GetExplicitInterfaces (TypeBuilder t)
+ {
+ return (TypeExpr []) builder_to_ifaces [t];
}
/// <remarks>
@@ -1110,7 +2087,7 @@ public class TypeManager {
/// </remarks>
public static bool ImplementsInterface (Type t, Type iface)
{
- Type [] interfaces;
+ TypeExpr [] interfaces;
//
// FIXME OPTIMIZATION:
@@ -1123,8 +2100,8 @@ public class TypeManager {
interfaces = GetInterfaces (t);
if (interfaces != null){
- foreach (Type i in interfaces){
- if (i == iface)
+ foreach (TypeExpr i in interfaces){
+ if (i.Type == iface)
return true;
}
}
@@ -1135,57 +2112,65 @@ public class TypeManager {
return false;
}
+ static NumberFormatInfo nf_provider = CultureInfo.CurrentCulture.NumberFormat;
+
// This is a custom version of Convert.ChangeType() which works
// with the TypeBuilder defined types when compiling corlib.
- public static object ChangeType (object value, Type conversionType)
+ public static object ChangeType (object value, Type conversionType, out bool error)
{
- if (!(value is IConvertible))
- throw new ArgumentException ();
-
- IConvertible convertValue = (IConvertible) value;
- CultureInfo ci = CultureInfo.CurrentCulture;
- NumberFormatInfo provider = ci.NumberFormat;
-
+ IConvertible convert_value = value as IConvertible;
+
+ if (convert_value == null){
+ error = true;
+ return null;
+ }
+
//
// We must use Type.Equals() here since `conversionType' is
// the TypeBuilder created version of a system type and not
// the system type itself. You cannot use Type.GetTypeCode()
// on such a type - it'd always return TypeCode.Object.
//
- if (conversionType.Equals (typeof (Boolean)))
- return (object)(convertValue.ToBoolean (provider));
- else if (conversionType.Equals (typeof (Byte)))
- return (object)(convertValue.ToByte (provider));
- else if (conversionType.Equals (typeof (Char)))
- return (object)(convertValue.ToChar (provider));
- else if (conversionType.Equals (typeof (DateTime)))
- return (object)(convertValue.ToDateTime (provider));
- else if (conversionType.Equals (typeof (Decimal)))
- return (object)(convertValue.ToDecimal (provider));
- else if (conversionType.Equals (typeof (Double)))
- return (object)(convertValue.ToDouble (provider));
- else if (conversionType.Equals (typeof (Int16)))
- return (object)(convertValue.ToInt16 (provider));
- else if (conversionType.Equals (typeof (Int32)))
- return (object)(convertValue.ToInt32 (provider));
- else if (conversionType.Equals (typeof (Int64)))
- return (object)(convertValue.ToInt64 (provider));
- else if (conversionType.Equals (typeof (SByte)))
- return (object)(convertValue.ToSByte (provider));
- else if (conversionType.Equals (typeof (Single)))
- return (object)(convertValue.ToSingle (provider));
- else if (conversionType.Equals (typeof (String)))
- return (object)(convertValue.ToString (provider));
- else if (conversionType.Equals (typeof (UInt16)))
- return (object)(convertValue.ToUInt16 (provider));
- else if (conversionType.Equals (typeof (UInt32)))
- return (object)(convertValue.ToUInt32 (provider));
- else if (conversionType.Equals (typeof (UInt64)))
- return (object)(convertValue.ToUInt64 (provider));
- else if (conversionType.Equals (typeof (Object)))
- return (object)(value);
- else
- throw new InvalidCastException ();
+ error = false;
+ try {
+ if (conversionType.Equals (typeof (Boolean)))
+ return (object)(convert_value.ToBoolean (nf_provider));
+ else if (conversionType.Equals (typeof (Byte)))
+ return (object)(convert_value.ToByte (nf_provider));
+ else if (conversionType.Equals (typeof (Char)))
+ return (object)(convert_value.ToChar (nf_provider));
+ else if (conversionType.Equals (typeof (DateTime)))
+ return (object)(convert_value.ToDateTime (nf_provider));
+ else if (conversionType.Equals (typeof (Decimal)))
+ return (object)(convert_value.ToDecimal (nf_provider));
+ else if (conversionType.Equals (typeof (Double)))
+ return (object)(convert_value.ToDouble (nf_provider));
+ else if (conversionType.Equals (typeof (Int16)))
+ return (object)(convert_value.ToInt16 (nf_provider));
+ else if (conversionType.Equals (typeof (Int32)))
+ return (object)(convert_value.ToInt32 (nf_provider));
+ else if (conversionType.Equals (typeof (Int64)))
+ return (object)(convert_value.ToInt64 (nf_provider));
+ else if (conversionType.Equals (typeof (SByte)))
+ return (object)(convert_value.ToSByte (nf_provider));
+ else if (conversionType.Equals (typeof (Single)))
+ return (object)(convert_value.ToSingle (nf_provider));
+ else if (conversionType.Equals (typeof (String)))
+ return (object)(convert_value.ToString (nf_provider));
+ else if (conversionType.Equals (typeof (UInt16)))
+ return (object)(convert_value.ToUInt16 (nf_provider));
+ else if (conversionType.Equals (typeof (UInt32)))
+ return (object)(convert_value.ToUInt32 (nf_provider));
+ else if (conversionType.Equals (typeof (UInt64)))
+ return (object)(convert_value.ToUInt64 (nf_provider));
+ else if (conversionType.Equals (typeof (Object)))
+ return (object)(value);
+ else
+ error = true;
+ } catch {
+ error = true;
+ }
+ return null;
}
//
@@ -1201,7 +2186,22 @@ public class TypeManager {
t = t.UnderlyingSystemType;
if (!TypeManager.IsEnumType (t))
return t;
-
+
+ if (t is TypeBuilder) {
+ // slow path needed to compile corlib
+ if (t == TypeManager.bool_type ||
+ t == TypeManager.byte_type ||
+ t == TypeManager.sbyte_type ||
+ t == TypeManager.char_type ||
+ t == TypeManager.short_type ||
+ t == TypeManager.ushort_type ||
+ t == TypeManager.int32_type ||
+ t == TypeManager.uint32_type ||
+ t == TypeManager.int64_type ||
+ t == TypeManager.uint64_type)
+ return t;
+ throw new Exception ("Unhandled typecode in enum " + " from " + t.AssemblyQualifiedName);
+ }
TypeCode tc = Type.GetTypeCode (t);
switch (tc){
@@ -1226,7 +2226,7 @@ public class TypeManager {
case TypeCode.UInt64:
return TypeManager.uint64_type;
}
- throw new Exception ("Unhandled typecode in enum" + tc);
+ throw new Exception ("Unhandled typecode in enum " + tc + " from " + t.AssemblyQualifiedName);
}
//
@@ -1235,7 +2235,7 @@ public class TypeManager {
//
public static Type TypeToCoreType (Type t)
{
- if (RootContext.StdLib)
+ if (RootContext.StdLib || (t is TypeBuilder))
return t;
TypeCode tc = Type.GetTypeCode (t);
@@ -1261,9 +2261,21 @@ public class TypeManager {
return TypeManager.int64_type;
case TypeCode.UInt64:
return TypeManager.uint64_type;
+ case TypeCode.Single:
+ return TypeManager.float_type;
+ case TypeCode.Double:
+ return TypeManager.double_type;
case TypeCode.String:
return TypeManager.string_type;
default:
+ if (t == typeof (void))
+ return TypeManager.void_type;
+ if (t == typeof (object))
+ return TypeManager.object_type;
+ if (t == typeof (System.Type))
+ return TypeManager.type_type;
+ if (t == typeof (System.IntPtr))
+ return TypeManager.intptr_type;
return t;
}
}
@@ -1283,6 +2295,11 @@ public class TypeManager {
return true;
}
+ if (!RootContext.StdLib && (t == TypeManager.decimal_type))
+ // We need this explicit check here to make it work when
+ // compiling corlib.
+ return true;
+
Report.Error (
208, loc,
"Cannot take the address or size of a variable of a managed type ('" +
@@ -1295,25 +2312,14 @@ public class TypeManager {
/// </summary>
/// <remarks>
/// The default is not always `Item'. The user can change this behaviour by
- /// using the DefaultMemberAttribute in the class.
- ///
+ /// using the IndexerNameAttribute in the container.
/// For example, the String class indexer is named `Chars' not `Item'
/// </remarks>
public static string IndexerPropertyName (Type t)
{
-
if (t is TypeBuilder) {
- TypeContainer tc = (TypeContainer) builder_to_container [t];
-
- //
- // FIXME: Temporary hack, until we deploy the IndexerName
- // property code (and attributes) in the interface code.
- //
- if (tc == null){
- return "Item";
- }
-
- return tc.IndexerName;
+ TypeContainer tc = t.IsInterface ? LookupInterface (t) : LookupTypeContainer (t);
+ return tc == null ? TypeContainer.DefaultIndexerName : tc.IndexerName;
}
System.Attribute attr = System.Attribute.GetCustomAttribute (
@@ -1323,29 +2329,46 @@ public class TypeManager {
return dma.MemberName;
}
- return "Item";
+ return TypeContainer.DefaultIndexerName;
}
- public static void MakePinned (LocalBuilder builder)
+ static MethodInfo declare_local_method = null;
+
+ public static LocalBuilder DeclareLocalPinned (ILGenerator ig, Type t)
{
- //
- // FIXME: Flag the "LocalBuilder" type as being
- // pinned. Figure out API.
- //
+ if (declare_local_method == null){
+ declare_local_method = typeof (ILGenerator).GetMethod (
+ "DeclareLocal",
+ BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
+ null,
+ new Type [] { typeof (Type), typeof (bool)},
+ null);
+ if (declare_local_method == null){
+ Report.Warning (-24, new Location (-1),
+ "This version of the runtime does not support making pinned local variables. " +
+ "This code may cause errors on a runtime with a moving GC");
+ return ig.DeclareLocal (t);
+ }
+ }
+ return (LocalBuilder) declare_local_method.Invoke (ig, new object [] { t, true });
}
-
-
+
//
// Returns whether the array of memberinfos contains the given method
//
- static bool ArrayContainsMethod (MemberInfo [] array, MethodBase new_method)
+ public static bool ArrayContainsMethod (MemberInfo [] array, MethodBase new_method)
{
Type [] new_args = TypeManager.GetArgumentTypes (new_method);
- foreach (MethodBase method in array){
+ foreach (MethodBase method in array) {
if (method.Name != new_method.Name)
continue;
-
+
+ if (method is MethodInfo && new_method is MethodInfo)
+ if (((MethodInfo) method).ReturnType != ((MethodInfo) new_method).ReturnType)
+ continue;
+
+
Type [] old_args = TypeManager.GetArgumentTypes (method);
int old_count = old_args.Length;
int i;
@@ -1359,13 +2382,10 @@ public class TypeManager {
}
if (i != old_count)
continue;
-
- if (!(method is MethodInfo && new_method is MethodInfo))
- return true;
-
- if (((MethodInfo) method).ReturnType == ((MethodInfo) new_method).ReturnType)
- return true;
+
+ return true;
}
+
return false;
}
@@ -1375,7 +2395,7 @@ public class TypeManager {
//
// The name is assumed to be the same.
//
- public static ArrayList CopyNewMethods (ArrayList target_list, MemberInfo [] new_members)
+ public static ArrayList CopyNewMethods (ArrayList target_list, IList new_members)
{
if (target_list == null){
target_list = new ArrayList ();
@@ -1399,162 +2419,206 @@ public class TypeManager {
return target_list;
}
- [Flags]
- public enum MethodFlags {
- IsObsolete = 1,
- ShouldIgnore = 2
- }
-
- static public MethodFlags GetMethodFlags (MethodBase mb)
- {
- MethodFlags flags = 0;
-
- if (mb.DeclaringType is TypeBuilder){
- //
- // FIXME: Support lookups of Obsolete and ConditionalAttribute
- // on MethodBuilders.
- //
- return 0;
- }
-
- object [] attrs = mb.GetCustomAttributes (false);
- foreach (object ta in attrs){
- if (!(ta is System.Attribute)){
- Console.WriteLine ("Unknown type in GetMethodFlags: " + ta);
- continue;
- }
- System.Attribute a = (System.Attribute) ta;
- if (a.TypeId == TypeManager.obsolete_attribute_type){
- flags |= MethodFlags.IsObsolete;
- continue;
- }
-
- //
- // Skip over conditional code.
- //
- if (a.TypeId == TypeManager.conditional_attribute_type){
- ConditionalAttribute ca = (ConditionalAttribute) a;
-
- if (RootContext.AllDefines [ca.ConditionString] == null)
- flags |= MethodFlags.ShouldIgnore;
- }
- }
- return flags;
- }
-
#region MemberLookup implementation
//
- // Name of the member
- //
- static string closure_name;
-
- //
// Whether we allow private members in the result (since FindMembers
// uses NonPublic for both protected and private), we need to distinguish.
//
- static bool closure_private_ok;
- //
- // Who is invoking us and which type is being queried currently.
- //
- static Type closure_invocation_type;
- static Type closure_queried_type;
+ static internal bool FilterNone (MemberInfo m, object filter_criteria)
+ {
+ return true;
+ }
- //
- // The assembly that defines the type is that is calling us
- //
- static Assembly closure_invocation_assembly;
+ internal class Closure {
+ internal bool private_ok;
- //
- // This filter filters by name + whether it is ok to include private
- // members in the search
- //
- static internal bool FilterWithClosure (MemberInfo m, object filter_criteria)
- {
- //
- // Hack: we know that the filter criteria will always be in the `closure'
- // fields.
- //
+ // Who is invoking us and which type is being queried currently.
+ internal Type invocation_type;
+ internal Type qualifier_type;
- if (m.Name != closure_name)
- return false;
+ // The assembly that defines the type is that is calling us
+ internal Assembly invocation_assembly;
+ internal IList almost_match;
- //
- // Ugly: we need to find out the type of `m', and depending
- // on this, tell whether we accept or not
- //
- if (m is MethodBase){
- MethodBase mb = (MethodBase) m;
- MethodAttributes ma = mb.Attributes & MethodAttributes.MemberAccessMask;
+ private bool CheckValidFamilyAccess (bool is_static, MemberInfo m)
+ {
+ if (invocation_type == null)
+ return false;
- if (ma == MethodAttributes.Private)
- return closure_private_ok;
+ Debug.Assert (IsSubclassOrNestedChildOf (invocation_type, m.DeclaringType));
- //
- // FamAndAssem requires that we not only derivate, but we are on the
- // same assembly.
- //
- if (ma == MethodAttributes.FamANDAssem){
- if (closure_invocation_assembly != mb.DeclaringType.Assembly)
- return false;
+ if (is_static)
+ return true;
+
+ // A nested class has access to all the protected members visible to its parent.
+ if (qualifier_type != null
+ && TypeManager.IsNestedChildOf (invocation_type, qualifier_type))
+ return true;
+
+ if (invocation_type == m.DeclaringType
+ || invocation_type.IsSubclassOf (m.DeclaringType)) {
+ // Although a derived class can access protected members of its base class
+ // it cannot do so through an instance of the base class (CS1540).
+ // => Ancestry should be: declaring_type ->* invocation_type ->* qualified_type
+ if (qualifier_type == null
+ || qualifier_type == invocation_type
+ || qualifier_type.IsSubclassOf (invocation_type))
+ return true;
}
- // FamORAssem, Family and Public:
- return true;
+ if (almost_match != null)
+ almost_match.Add (m);
+ return false;
}
+
+ //
+ // This filter filters by name + whether it is ok to include private
+ // members in the search
+ //
+ internal bool Filter (MemberInfo m, object filter_criteria)
+ {
+ //
+ // Hack: we know that the filter criteria will always be in the `closure'
+ // fields.
+ //
- if (m is FieldInfo){
- FieldInfo fi = (FieldInfo) m;
- FieldAttributes fa = fi.Attributes & FieldAttributes.FieldAccessMask;
-
- if (fa == FieldAttributes.Private)
- return closure_private_ok;
-
+ if ((filter_criteria != null) && (m.Name != (string) filter_criteria))
+ return false;
+
+ if (((qualifier_type == null) || (qualifier_type == invocation_type)) &&
+ (m.DeclaringType == invocation_type))
+ return true;
+
//
- // FamAndAssem requires that we not only derivate, but we are on the
- // same assembly.
+ // Ugly: we need to find out the type of `m', and depending
+ // on this, tell whether we accept or not
//
- if (fa == FieldAttributes.FamANDAssem){
- if (closure_invocation_assembly != fi.DeclaringType.Assembly)
- return false;
+ if (m is MethodBase){
+ MethodBase mb = (MethodBase) m;
+ MethodAttributes ma = mb.Attributes & MethodAttributes.MemberAccessMask;
+
+ if (ma == MethodAttributes.Private)
+ return private_ok || (invocation_type == m.DeclaringType) ||
+ IsNestedChildOf (invocation_type, m.DeclaringType);
+
+ // Assembly succeeds if we're in the same assembly.
+ if (ma == MethodAttributes.Assembly)
+ return (invocation_assembly == mb.DeclaringType.Assembly);
+
+ // FamAndAssem requires that we not only derive, but we are on the same assembly.
+ if (ma == MethodAttributes.FamANDAssem){
+ if (invocation_assembly != mb.DeclaringType.Assembly)
+ return false;
+ }
+
+ // Family and FamANDAssem require that we derive.
+ if ((ma == MethodAttributes.Family) || (ma == MethodAttributes.FamANDAssem))
+ return CheckValidFamilyAccess (mb.IsStatic, m);
+
+ // Public.
+ return true;
+ }
+
+ if (m is FieldInfo){
+ FieldInfo fi = (FieldInfo) m;
+ FieldAttributes fa = fi.Attributes & FieldAttributes.FieldAccessMask;
+
+ if (fa == FieldAttributes.Private)
+ return private_ok || (invocation_type == m.DeclaringType) ||
+ IsNestedChildOf (invocation_type, m.DeclaringType);
+
+ // Assembly succeeds if we're in the same assembly.
+ if (fa == FieldAttributes.Assembly)
+ return (invocation_assembly == fi.DeclaringType.Assembly);
+
+ // FamAndAssem requires that we not only derive, but we are on the same assembly.
+ if (fa == FieldAttributes.FamANDAssem){
+ if (invocation_assembly != fi.DeclaringType.Assembly)
+ return false;
+ }
+
+ // Family and FamANDAssem require that we derive.
+ if ((fa == FieldAttributes.Family) || (fa == FieldAttributes.FamANDAssem))
+ return CheckValidFamilyAccess (fi.IsStatic, m);
+
+ // Public.
+ return true;
}
- // FamORAssem, Family and Public:
+
+ //
+ // EventInfos and PropertyInfos, return true because they lack permission
+ // information, so we need to check later on the methods.
+ //
return true;
}
-
- //
- // EventInfos and PropertyInfos, return true
- //
- return true;
}
- static MemberFilter FilterWithClosure_delegate = new MemberFilter (FilterWithClosure);
-
+ static Closure closure = new Closure ();
+ static MemberFilter FilterWithClosure_delegate = new MemberFilter (closure.Filter);
+
//
// Looks up a member called `name' in the `queried_type'. This lookup
- // is done by code that is contained in the definition for `invocation_type'.
+ // is done by code that is contained in the definition for `invocation_type'
+ // through a qualifier of type `qualifier_type' (or null if there is no qualifier).
+ //
+ // `invocation_type' is used to check whether we're allowed to access the requested
+ // member wrt its protection level.
+ //
+ // When called from MemberAccess, `qualifier_type' is the type which is used to access
+ // the requested member (`class B { A a = new A (); a.foo = 5; }'; here invocation_type
+ // is B and qualifier_type is A). This is used to do the CS1540 check.
+ //
+ // When resolving a SimpleName, `qualifier_type' is null.
+ //
+ // The `qualifier_type' is used for the CS1540 check; it's normally either null or
+ // the same than `queried_type' - except when we're being called from BaseAccess;
+ // in this case, `invocation_type' is the current type and `queried_type' the base
+ // type, so this'd normally trigger a CS1540.
//
// The binding flags are `bf' and the kind of members being looked up are `mt'
//
+ // The return value always includes private members which code in `invocation_type'
+ // is allowed to access (using the specified `qualifier_type' if given); only use
+ // BindingFlags.NonPublic to bypass the permission check.
+ //
+ // The 'almost_match' argument is used for reporting error CS1540.
+ //
// Returns an array of a single element for everything but Methods/Constructors
// that might return multiple matches.
//
- public static MemberInfo [] MemberLookup (Type invocation_type, Type queried_type,
- MemberTypes mt, BindingFlags original_bf, string name)
+ public static MemberInfo [] MemberLookup (Type invocation_type, Type qualifier_type,
+ Type queried_type, MemberTypes mt,
+ BindingFlags original_bf, string name, IList almost_match)
+ {
+ Timer.StartTimer (TimerType.MemberLookup);
+
+ MemberInfo[] retval = RealMemberLookup (invocation_type, qualifier_type,
+ queried_type, mt, original_bf, name, almost_match);
+
+ Timer.StopTimer (TimerType.MemberLookup);
+
+ return retval;
+ }
+
+ static MemberInfo [] RealMemberLookup (Type invocation_type, Type qualifier_type,
+ Type queried_type, MemberTypes mt,
+ BindingFlags original_bf, string name, IList almost_match)
{
BindingFlags bf = original_bf;
ArrayList method_list = null;
Type current_type = queried_type;
bool searching = (original_bf & BindingFlags.DeclaredOnly) == 0;
- bool private_ok;
+ bool skip_iface_check = true, used_cache = false;
bool always_ok_flag = false;
- closure_name = name;
- closure_invocation_type = invocation_type;
- closure_invocation_assembly = invocation_type != null ? invocation_type.Assembly : null;
+ closure.invocation_type = invocation_type;
+ closure.invocation_assembly = invocation_type != null ? invocation_type.Assembly : null;
+ closure.qualifier_type = qualifier_type;
+ closure.almost_match = almost_match;
//
// If we are a nested class, we always have access to our container
@@ -1565,7 +2629,7 @@ public class TypeManager {
if (invocation_name.IndexOf ('+') != -1){
string container = queried_type.FullName + "+";
int container_length = container.Length;
-
+
if (invocation_name.Length > container_length){
string shared = invocation_name.Substring (0, container_length);
@@ -1575,8 +2639,14 @@ public class TypeManager {
}
}
+ // This is from the first time we find a method
+ // in most cases, we do not actually find a method in the base class
+ // so we can just ignore it, and save the arraylist allocation
+ MemberInfo [] first_members_list = null;
+ bool use_first_members_list = false;
+
do {
- MemberInfo [] mi;
+ MemberInfo [] list;
//
// `NonPublic' is lame, because it includes both protected and
@@ -1587,26 +2657,36 @@ public class TypeManager {
// public, private and protected (internal does not come into the
// equation)
//
- if (invocation_type != null){
- if (invocation_type == current_type){
- private_ok = true;
- } else
- private_ok = always_ok_flag;
-
- if (private_ok || invocation_type.IsSubclassOf (current_type))
- bf = original_bf | BindingFlags.NonPublic;
- } else {
- private_ok = false;
- bf = original_bf & ~BindingFlags.NonPublic;
- }
+ if ((invocation_type != null) &&
+ ((invocation_type == current_type) ||
+ IsNestedChildOf (invocation_type, current_type)) ||
+ always_ok_flag)
+ bf = original_bf | BindingFlags.NonPublic;
+ else
+ bf = original_bf;
+
+ closure.private_ok = (original_bf & BindingFlags.NonPublic) != 0;
+
+ Timer.StopTimer (TimerType.MemberLookup);
+
+ list = MemberLookup_FindMembers (current_type, mt, bf, name, out used_cache);
+
+ Timer.StartTimer (TimerType.MemberLookup);
+
+ //
+ // When queried for an interface type, the cache will automatically check all
+ // inherited members, so we don't need to do this here. However, this only
+ // works if we already used the cache in the first iteration of this loop.
+ //
+ // If we used the cache in any further iteration, we can still terminate the
+ // loop since the cache always looks in all parent classes.
+ //
+
+ if (used_cache)
+ searching = false;
+ else
+ skip_iface_check = false;
- closure_private_ok = private_ok;
- closure_queried_type = current_type;
-
- mi = TypeManager.FindMembers (
- current_type, mt, bf | BindingFlags.DeclaredOnly,
- FilterWithClosure_delegate, name);
-
if (current_type == TypeManager.object_type)
searching = false;
else {
@@ -1616,46 +2696,82 @@ public class TypeManager {
// This happens with interfaces, they have a null
// basetype. Look members up in the Object class.
//
- if (current_type == null)
+ if (current_type == null) {
current_type = TypeManager.object_type;
+ searching = true;
+ }
}
- if (mi == null)
- continue;
-
- int count = mi.Length;
-
- if (count == 0)
+ if (list.Length == 0)
continue;
-
+
//
// Events and types are returned by both `static' and `instance'
// searches, which means that our above FindMembers will
// return two copies of the same.
//
- if (count == 1 && !(mi [0] is MethodBase)){
- return mi;
+ if (list.Length == 1 && !(list [0] is MethodBase)){
+ return list;
}
//
// Multiple properties: we query those just to find out the indexer
// name
//
- if (mi [0] is PropertyInfo)
- return mi;
-
+ if (list [0] is PropertyInfo)
+ return list;
+
+ //
+ // We found an event: the cache lookup returns both the event and
+ // its private field.
+ //
+ if (list [0] is EventInfo) {
+ if ((list.Length == 2) && (list [1] is FieldInfo))
+ return new MemberInfo [] { list [0] };
+
+ // Oooops
+ return null;
+ }
+
//
// We found methods, turn the search into "method scan"
// mode.
//
-
- method_list = CopyNewMethods (method_list, mi);
- mt &= (MemberTypes.Method | MemberTypes.Constructor);
+
+ if (first_members_list != null) {
+ if (use_first_members_list) {
+ method_list = CopyNewMethods (method_list, first_members_list);
+ use_first_members_list = false;
+ }
+
+ method_list = CopyNewMethods (method_list, list);
+ } else {
+ first_members_list = list;
+ use_first_members_list = true;
+ mt &= (MemberTypes.Method | MemberTypes.Constructor);
+ }
} while (searching);
+
+ if (use_first_members_list) {
+ foreach (MemberInfo mi in first_members_list) {
+ if (! (mi is MethodBase)) {
+ method_list = CopyNewMethods (method_list, first_members_list);
+ return (MemberInfo []) method_list.ToArray (typeof (MemberInfo));
+ }
+ }
+ return (MemberInfo []) first_members_list;
+ }
if (method_list != null && method_list.Count > 0)
- return (MemberInfo []) method_list.ToArray (typeof (MemberInfo));
-
+ return (MemberInfo []) method_list.ToArray (typeof (MemberInfo));
+
+ //
+ // This happens if we already used the cache in the first iteration, in this case
+ // the cache already looked in all interfaces.
+ //
+ if (skip_iface_check)
+ return null;
+
//
// Interfaces do not list members they inherit, so we have to
// scan those.
@@ -1666,22 +2782,188 @@ public class TypeManager {
if (queried_type.IsArray)
queried_type = TypeManager.array_type;
- Type [] ifaces = GetInterfaces (queried_type);
+ TypeExpr [] ifaces = GetInterfaces (queried_type);
if (ifaces == null)
return null;
- foreach (Type itype in ifaces){
+ foreach (TypeExpr itype in ifaces){
MemberInfo [] x;
- x = MemberLookup (null, itype, mt, bf, name);
+ x = MemberLookup (null, null, itype.Type, mt, bf, name, null);
if (x != null)
return x;
}
return null;
}
+
+ // Tests whether external method is really special
+ public static bool IsSpecialMethod (MethodBase mb)
+ {
+ string name = mb.Name;
+ if (name.StartsWith ("get_") || name.StartsWith ("set_"))
+ return mb.DeclaringType.GetProperty (name.Substring (4)) != null;
+
+ if (name.StartsWith ("add_"))
+ return mb.DeclaringType.GetEvent (name.Substring (4)) != null;
+
+ if (name.StartsWith ("remove_"))
+ return mb.DeclaringType.GetEvent (name.Substring (7)) != null;
+
+ if (name.StartsWith ("op_")){
+ foreach (string oname in Unary.oper_names) {
+ if (oname == name)
+ return true;
+ }
+
+ foreach (string oname in Binary.oper_names) {
+ if (oname == name)
+ return true;
+ }
+ }
+ return false;
+ }
+
#endregion
}
+/// <summary>
+/// There is exactly one instance of this class per type.
+/// </summary>
+public sealed class TypeHandle : IMemberContainer {
+ public readonly TypeHandle BaseType;
+
+ readonly int id = ++next_id;
+ static int next_id = 0;
+
+ /// <summary>
+ /// Lookup a TypeHandle instance for the given type. If the type doesn't have
+ /// a TypeHandle yet, a new instance of it is created. This static method
+ /// ensures that we'll only have one TypeHandle instance per type.
+ /// </summary>
+ public static TypeHandle GetTypeHandle (Type t)
+ {
+ TypeHandle handle = (TypeHandle) type_hash [t];
+ if (handle != null)
+ return handle;
+
+ handle = new TypeHandle (t);
+ type_hash.Add (t, handle);
+ return handle;
+ }
+
+ public static void CleanUp ()
+ {
+ type_hash = null;
+ }
+
+ /// <summary>
+ /// Returns the TypeHandle for TypeManager.object_type.
+ /// </summary>
+ public static IMemberContainer ObjectType {
+ get {
+ if (object_type != null)
+ return object_type;
+
+ object_type = GetTypeHandle (TypeManager.object_type);
+
+ return object_type;
+ }
+ }
+
+ /// <summary>
+ /// Returns the TypeHandle for TypeManager.array_type.
+ /// </summary>
+ public static IMemberContainer ArrayType {
+ get {
+ if (array_type != null)
+ return array_type;
+
+ array_type = GetTypeHandle (TypeManager.array_type);
+
+ return array_type;
+ }
+ }
+
+ private static PtrHashtable type_hash = new PtrHashtable ();
+
+ private static TypeHandle object_type = null;
+ private static TypeHandle array_type = null;
+
+ private Type type;
+ private bool is_interface;
+ private MemberCache member_cache;
+
+ private TypeHandle (Type type)
+ {
+ this.type = type;
+ if (type.BaseType != null)
+ BaseType = GetTypeHandle (type.BaseType);
+ this.is_interface = type.IsInterface;
+ this.member_cache = new MemberCache (this, true);
+ }
+
+ // IMemberContainer methods
+
+ public string Name {
+ get {
+ return type.FullName;
+ }
+ }
+
+ public Type Type {
+ get {
+ return type;
+ }
+ }
+
+ public IMemberContainer ParentContainer {
+ get {
+ return BaseType;
+ }
+ }
+
+ public bool IsInterface {
+ get {
+ return is_interface;
+ }
+ }
+
+ public MemberList GetMembers (MemberTypes mt, BindingFlags bf)
+ {
+ MemberInfo [] members;
+ if (mt == MemberTypes.Event)
+ members = type.GetEvents (bf | BindingFlags.DeclaredOnly);
+ else
+ members = type.FindMembers (mt, bf | BindingFlags.DeclaredOnly,
+ null, null);
+ Array.Reverse (members);
+
+ return new MemberList (members);
+ }
+
+ // IMemberFinder methods
+
+ public MemberList FindMembers (MemberTypes mt, BindingFlags bf, string name,
+ MemberFilter filter, object criteria)
+ {
+ return new MemberList (member_cache.FindMembers (mt, bf, name, filter, criteria));
+ }
+
+ public MemberCache MemberCache {
+ get {
+ return member_cache;
+ }
+ }
+
+ public override string ToString ()
+ {
+ if (BaseType != null)
+ return "TypeHandle (" + id + "," + Name + " : " + BaseType + ")";
+ else
+ return "TypeHandle (" + id + "," + Name + ")";
+ }
+}
+
}
diff --git a/mcs/nant/.cvsignore b/mcs/nant/.cvsignore
deleted file mode 100755
index 6e95567187d..00000000000
--- a/mcs/nant/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-NAnt.exe
-nant.exe
diff --git a/mcs/nant/ChangeLog b/mcs/nant/ChangeLog
deleted file mode 100644
index b8cf5a0b451..00000000000
--- a/mcs/nant/ChangeLog
+++ /dev/null
@@ -1,17 +0,0 @@
-2002-04-28 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Make NAnt.exe dependant on all the *.cs in src and each sub
- dir. Since we don't remove it on a 'make clean' it doesn't get rebuilt
- when a new file is added or an existing one changed.
-
-2002-03-17 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Do not remove the NAnt.exe on a 'make clean'. This would
- prevent other cleans from happening that need nant.
-
-2002/03/15 Nick Drochak <ndrochak@gol.com>
-
- * makefile: Compile a version of NAnt with Mono's libs. It only does
- this if you 'make NAnt_mono.exe'. Of course, right now the resulting
- exe probably is not going to work yet becuase of the immature class
- libs.
diff --git a/mcs/nant/README-nant.txt b/mcs/nant/README-nant.txt
deleted file mode 100755
index 66c04bef116..00000000000
--- a/mcs/nant/README-nant.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-NAnt
-
-What is it?
------------
-NAnt is a .NET based build tool. In theory it is kind of like make without
-make's wrinkles. In practice it's a lot like Ant.
-
-If you are not familiar with Jakarta Ant you can get more information at the
-Jakarta project web site.
-http://jakarta.apache.org/
-
-
-Why NAnt?
----------
-Because Ant was too Java specific.
-Because Ant needed the Java runtime. NAnt only needs the .NET runtime.
-
-
-The Latest Version
-------------------
-Details of the latest version can be found on the NAnt project web site
-http://nant.sourceforge.net/
-
-
-Documentation
--------------
-Documentation is available in HTML format, in the doc/ directory.
-
-
-License
--------
-Copyright (C) 2001 Gerry Shaw
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program 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 General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-In addition, as a special exception, Gerry Shaw gives permission to link the
-code of this program with the Microsoft .NET library (or with modified versions
-of Microsoft .NET library that use the same license as the Microsoft .NET
-library), and distribute linked combinations including the two. You must obey
-the GNU General Public License in all respects for all of the code used other
-than the Microsoft .NET library. If you modify this file, you may extend this
-exception to your version of the file, but you are not obligated to do so. If
-you do not wish to do so, delete this exception statement from your version.
-
-A copy of the GNU General Public License is available in the COPYING.txt file
-included with all NAnt distributions.
-
-For more licensing information refer to the GNU General Public License on the
-GNU Project web site.
-http://www.gnu.org/copyleft/gpl.html
diff --git a/mcs/nant/doc/arrow.gif b/mcs/nant/doc/arrow.gif
deleted file mode 100755
index d5e5f8e771d..00000000000
--- a/mcs/nant/doc/arrow.gif
+++ /dev/null
Binary files differ
diff --git a/mcs/nant/doc/authors.html b/mcs/nant/doc/authors.html
deleted file mode 100755
index 3b8ce57e47b..00000000000
--- a/mcs/nant/doc/authors.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt Authors</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> Authors</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> Authors</h1>
-
- <h3>Lead Developer</h3>
- <ul>
- <li>Gerry Shaw (gerry_shaw@yahoo.com)</li>
- </ul>
-
- <h3>Developers</h3>
- <ul>
- <li>Ian MacLean (ian_maclean@another.com)</li>
- </ul>
-
- <h3>Code Contributions (sorted by name)</h3>
- <ul>
- <li>Mike Krueger (mike@icsharpcode.net)</li>
- <li>Sergey Chaban (serge@wildwestsoftware.com)</li>
- </ul>
-
- <h3><a></a>Special Thanks To</h3>
- <ul>
- <li>The <a href="http://jakarta.apache.org/ant/">Ant</a> team on the Jakarta project.</li>
- <li><a href="http://www.hazware.com/">Hazware</a> for the original XBuild source.</li>
- <li><a href="http://nunit.sourceforge.net/">Philip Craig</a> for NUnit.</li>
- <li><a href="http://msdn.microsoft.com/net/">Microsoft</a> for making .NET and C#.</li>
- <li>Ximian for working on the <a href="http://www.go-mono.com">Mono</a> project ot make .NET a true open standard.</li>
- </ul>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/changelog.html b/mcs/nant/doc/changelog.html
deleted file mode 100755
index a5f3ac7e182..00000000000
--- a/mcs/nant/doc/changelog.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt Change Log</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> Change Log</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> Change Log</h1>
-
- <h3>0.6.0 September 18, 2001</h3>
- <ul>
- <li>report build file xml errors in a useful way</li>
- <li>report error location when tasks are missing required attributes</li>
- <li>copy task updated - thanks to Ian MacLean</li>
- <li>**/*.cs type pattern matching now available in file sets via DirectoryScanner class</li>
- <li>Ian MacLean added as a project developer</li>
- <li>added all the environment variables to properites, ie, &lt;echo message="path=${nant.env.PATH}"/&gt;</li>
- <li>move task updated - thanks to Ian MacLean</li>
- <li>sleep task added - thanks to Ian MacLean</li>
- <li>DirectoryScanner and FileSet's scan for files AND directories now</li>
- <li>FileSet's cache scan results, use Scan() to rescan</li>
- <li>FileSet's auto initialize to their containing Task, this helps clean up the code</li>
- <li>copy task can now copy full directory trees</li>
- <li>added verbose attribute to copy task, default off, message gives number of files processed</li>
- <li>fixed bug with any ExternalBase tasks hanging - thanks to Sergey Chaban for reporting</li>
- <li>include task added</li>
- <li>call task added</li>
- <li>-verbose command line option added</li>
- <li>build file can now build complete distribution, try 'nant dist'</li>
- </ul>
-
- <h3>0.5.0 August 22, 2001</h3>
- <ul>
- <li>complete overhaul of the web site and doc folder (all html files)</li>
- <li>made src a parent folder to be able to hold multiple assemblies in anticipation of the NAnt.Tests.dll assembly</li>
- <li>licensed changed to GNU General Public License</li>
- <li>source code placed under CVS</li>
- <li>tasks can now have attributes in base classes, see CompilerBase as an example - thanks to Mike Krueger</li>
- <li>coding conventions posted on SourceForge in the document manager</li>
- <li>task manager in SourceForge is now being used to track currently active tasks</li>
- <li>namespace changed to SourceForge.NAnt</li>
- <li>added basic command line parsing</li>
- <li>added version resource</li>
- <li>support for multiple build targets (try 'nant clean test')</li>
- <li>BuildException added to report text position in the build file where errors occur - thanks to Ian MacLean</li>
- <li>style task (xslt processing) added - thanks to Serge</li>
- <li>executable is now signed with the NAnt.key</li>
- <li>converted all public/protected fields to properties</li>
- <li>added support for user define properties</li>
- <li>added -set option (try 'nant -set:debug=true clean build')</li>
- <li>changed verions number to 0.5 to reflect the number of changes in the code base</li>
- </ul>
-
- <h3>0.1.5 July 22, 2001</h3>
- <ul>
- <li>only compiles program if source file last write time > output last write time</li>
- <li>refactored compiler code into common CompilerBase class</li>
- <li>refactored compiler and exec task into common ExternalProgramBase class</li>
- <li>added &lt;arg value="/win32res:filename"/&gt; element to all external program tasks</li>
- <li>added Int32ValidatorAttribute and BooleanValidatorAttribute classes to perform error checking on task attributes after macro expansion but before task execution. Search for BooleanValidator or Int32Validator in Tasks for examples.</li>
- <li>changed Task attribute names to TaskAttributeAttribute and FileSetAttribute</li>
- <li>removed default value for task attributes (set with initial value)</li>
- <li>changes to Project class on how to initialize a project and run it</li>
- <li>right aligned task prefixes to clean up output</li>
- <li>added or enhanced these tasks
- <ul>
- <li>vbc, jsc, csc</li>
- <li>move</li>
- <li>nant</li>
- <li>taskdef</li>
- <li>tstamp</li>
- <li>exec (failonerror attribute)</li>
- </ul>
- </li>
- </ul>
-
- <h3>0.1.4 July 19, 2001</h3>
- <ul>
- <li>added or enhanced these tasks
- <ul>
- <li>echo</li>
- <li>fail</li>
- <li>property</li>
- <li>copy (respects basedir)</li>
- <li>delete (respects basedir)</li>
- <li>mkdir (respects basedir)</li>
- <li>exec</li>
- </ul>
- </li>
- </ul>
-
- <h3>0.1.3 July 18, 2001</h3>
- <ul>
- <li>dependices working via depends attribute on targets</li>
- <li>changed name from NBuild to NAnt</li>
- <li>using the name "Parameter" to refer to the xml attributes in tasks because it was conflicting badly with .NET Attributes</li>
- <li>added FileSetParameterAttribute so that fileset parameters would autoinit</li>
- <li>renamed TaskAttributeAttribute to StringParameterAttribute</li>
- <li>broke into seperate source files (one per class)</li>
- <li>changed default build file from Project.xml to the first file with a .build extension</li>
- </ul>
-
- <h3>0.1.2 July 16, 2001</h3>
- <ul>
- <li>basic functionality to have NAnt build itself (csc task)</li>
- </ul>
-
- <h3>0.1.1 July 5, 2001</h3>
- <ul>
- <li>initial test version</li>
- </ul>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/index.html b/mcs/nant/doc/index.html
deleted file mode 100755
index 635c2ca1233..00000000000
--- a/mcs/nant/doc/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt - A .NET Build Tool</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><b>NAnt</b> : A .NET Build Tool</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> Home Page</h1>
-
- <p>September 18, 2001 Gerry Shaw -- <a title="Send email to Gerry Shaw" href="mailto:gerry_shaw@yahoo.com">gerry_shaw@yahoo.com</a></p>
- <p>NAnt is a .NET based build tool. In theory it is kind of like make without make's wrinkles. In practice it's a lot like <a title="Ant home page" href="http://jakarta.apache.org/ant/">Ant</a>. NAnt has only been tested with Beta 2 .NET SDK, build 2914.</p>
- <p>The idea for NAnt came from <a title="Hazware home page" href="http://www.hazware.com/xbHome.htm"> Hazware's XBuild</a> project. After emailing the author for a beta 2 version of the tool and getting no response I decided to port the code to .NET beta 2. Due to the number of changes from .NET beta 1 to beta 2 the result was a total rewrite.</p>
- <ul>
- <li><a title="NAnt files page on SourceForge" href="http://sourceforge.net/project/showfiles.php?group_id=31650"><b>Download latest version</b></a> from SourceForge</li>
- <li><a title="NAnt web site on SourceForge" href="http://nant.sourceforge.net">Home page</a> on SourceForge</li>
- <li><a title="NAnt project summary on SourceForge" href="http://sourceforge.net/projects/nant/">Project summary</a> on SourceForge</li>
- <li><a title="Version history of NAnt" href="changelog.html">Changes</a></li>
- <li><a title="Tasks still being worked on" href="todo.html">To do</a></li>
- <li><a title="Project credits" href="authors.html">Authors</a></li>
- <li><a title="Software license agreement" href="license.html">License</a></li>
- </ul>
-
- <h2>Getting Started</h2>
- <p>Since the software is still in heavy development you are going to be on your own. You can see NAnt build itself by doing the following:</p>
- <ol>
- <li>Download the latest released version.</li>
- <li>Unzip the distribution into a new folder.</li>
- <li>Using a command prompt (so you can see the build output) cd into the
- folder where NAnt was unzipped.</li>
- <li>Type <code>bin\nant</code> at the command prompt to build NAnt.</li>
- </ol>
-
- <p><a href="http://sourceforge.net"><img valign="middle" src="http://sourceforge.net/sflogo.php?group_id=31650" width="88" height="31" border="0" alt="SourceForge logo (link to home page)"></a></p>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/license.html b/mcs/nant/doc/license.html
deleted file mode 100755
index 86d993bb13d..00000000000
--- a/mcs/nant/doc/license.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt License</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->"/> License</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> License</h1>
- <p>Copyright &copy 2001 Gerry Shaw</p>
- <p>
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- </p>
- <p>
- This program 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 General Public License for more details.
- </p>
- <p>
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- </p>
- <p>
- <b>In addition, as a special exception</b>, Gerry Shaw gives permission to link the
- code of this program with the Microsoft .NET library (or with modified versions
- of Microsoft .NET library that use the same license as the Microsoft .NET
- library), and distribute linked combinations including the two. You must obey
- the GNU General Public License in all respects for all of the code used other
- than the Microsoft .NET library. If you modify this file, you may extend this
- exception to your version of the file, but you are not obligated to do so. If
- you do not wish to do so, delete this exception statement from your version.
- </p>
- <p>A copy of the GNU General Public License is available in the COPYING.txt file included with all NAnt distributions.</p>
- <p>The <a title="GNU home page" href="http://www.gnu.org/">GNU Project</a> has more information on the <a title="Full text of the GNU Public License" href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.</p>
-</body>
-
-</html>
diff --git a/mcs/nant/doc/style.css b/mcs/nant/doc/style.css
deleted file mode 100755
index 32613372a4c..00000000000
--- a/mcs/nant/doc/style.css
+++ /dev/null
@@ -1,71 +0,0 @@
-body {
- font-family: Georgia, "Times New Roman", Times, "New York", serif;
- background: white;
- color: black
-}
-
-h1, h2, h3, h4, h5, h6 {
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif
-}
-
-h1.LinkHeader, h2.LinkHeader, h3.LinkHeader { margin-bottom: -18 }
-
-h4 {
- margin-bottom: 0.5em
-}
-
-h5 {
- margin-bottom: -.8em;
-}
-
-
-hr {
- color: gray
-}
-
-input {
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;
-}
-
-a:link { color: #0000cc; }
-a:visited { color: purple }
-a:active { color: #cc0000 }
-a:hover { color: #cc0000; }
-
-/*
-
-Because HTML 4.0 strict does not include the border attribute for images we turn it off with a style
-but this totally messes up Navigator 4.7 so we can't use it.
-
-a:link img, a:visited img, a:active img {
- border: none
-}
-*/
-
-/* have list items flush left against lists in a side bar use this style */
-ul.FlushLeft {
- margin-left: 1.25em;
- list-style-position: outside
-}
-
-.NavBar {
- background-color: #dfff80;
- border-color: #999966;
- border-style: none none solid none;
- border-width: 2px;
-}
-
-.NavBar-Cell {
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;
- font-size: 79%;
-}
-
-.SideBar {
- font-size: 80%;
- font-family: Verdana, Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;
- padding: 8px;
-}
-
-/* color scheme */
-.N { color: #99cc00; }
-.Ant { color: #ff9900; }
diff --git a/mcs/nant/doc/todo.html b/mcs/nant/doc/todo.html
deleted file mode 100755
index 20cd3ba16ac..00000000000
--- a/mcs/nant/doc/todo.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Language" content="en-ca">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title>NAnt To Do</title>
-</head>
-
-<body>
- <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar">
- <tr><td class="NavBar-Cell" width="100%"><a title="NAnt home page" href="index.html"><b>NAnt</b></a> <img src="arrow.gif" alt="->" width="13" height="9"/> To Do</td></tr>
- </table>
-
- <h1><span class="N">N</span><span class="Ant">Ant</span> To Do</h1>
- <p>The following is a rough guide to what features are being worked on and when they will be worked on in the future.</p>
- <p>For a list of what is actively being worked refer to the <a title="SourceForge task manager for NAnt" href="https://sourceforge.net/pm/?group_id=31650">NAnt Task Manager</a> on SourceForge.</p>
-
- <h3>0.7</h3>
- <ul>
- <li>command line parsing using clippy (another tool I'm working on that will be posted soon)</li>
- <li>clippy task (for command line parsing)</li>
- <li>nunit tests</li>
- <li>nunit task</li>
- <li>validate build file for valid xml and against a schema before starting build</li>
- <li>code xml docs for all non private members</li>
- <li>developer docs (code conventions, high level design)</li>
- <li>post newsgroup announcment</li>
- <li>request code review and project help</li>
- </ul>
-
- <h3>0.8</h3>
- <ul>
- <li>task documentation for users</li>
- <li>zip task</li>
- <li>ftp task</li>
- <li>standard input support for tasks that require input (ie, passwords when copying files via scp to SourceForge)</li>
- </ul>
-
- <h3>1.0</h3>
- <ul>
- <li>official release</li>
- <li>general cleanup</li>
- <li>xml documentation</li>
- <li>user documentation</li>
- <li>post newsgroup announcment</li>
- </ul>
-
- <h3>1.1</h3>
- <ul>
- <li>additional optional but useful tasks (sql, touch, email, grep)</li>
- </ul>
-</body>
-
-</html> \ No newline at end of file
diff --git a/mcs/nant/makefile b/mcs/nant/makefile
deleted file mode 100755
index f0cced7a91c..00000000000
--- a/mcs/nant/makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-all: nant.exe
-linux: nant.exe
-windows: nant.exe
-
-nant.exe: NAnt.exe
- -cp NAnt.exe nant.exe
-
-NAnt.exe: makefile src/*.cs src/Attributes/*.cs src/Tasks/*.cs src/Util/*.cs
- csc /out:NAnt.exe /recurse:*.cs
-
-NAnt_mono.exe: makefile
- csc /out:NAnt_mono.exe /nostdlib /noconfig /recurse:*.cs /lib:../class/lib /r:corlib.dll /r:System.Xml.dll /r:System.dll /nowarn:1595
-
-clean:
- rm -f NAnt_mono.exe \ No newline at end of file
diff --git a/mcs/nant/readme.txt b/mcs/nant/readme.txt
deleted file mode 100755
index 816b000c2e5..00000000000
--- a/mcs/nant/readme.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is an import of the Nant sources version 0.6.0 into the
-tree. We are doing this because the binaries were not compatible
-across versions of .NET.
-
diff --git a/mcs/nant/src/AssemblyInfo.cs b/mcs/nant/src/AssemblyInfo.cs
deleted file mode 100755
index 1bd25d5d050..00000000000
--- a/mcs/nant/src/AssemblyInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyTitle("NAnt")]
-[assembly: AssemblyDescription("A .NET Build Tool")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("http://nant.sourceforge.net/")]
-[assembly: AssemblyProduct("NAnt")]
-[assembly: AssemblyCopyright("Copyright (C) 2001 Gerry Shaw")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("0.6.0.*")]
-
-// This will not compile with Visual Studio. If you want to build a signed
-// executable use the NAnt build file. To build under Visual Studio just
-// exclude this file from the build.
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyName("")]
diff --git a/mcs/nant/src/AssemblyInfo.cs~ b/mcs/nant/src/AssemblyInfo.cs~
deleted file mode 100755
index a59c887180d..00000000000
--- a/mcs/nant/src/AssemblyInfo.cs~
+++ /dev/null
@@ -1,38 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-[assembly: AssemblyTitle("NAnt")]
-[assembly: AssemblyDescription("A .NET Build Tool")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("http://nant.sourceforge.net/")]
-[assembly: AssemblyProduct("NAnt")]
-[assembly: AssemblyCopyright("Copyright (C) 2001 Gerry Shaw")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("0.6.0.*")]
-
-// This will not compile with Visual Studio. If you want to build a signed
-// executable use the NAnt build file. To build under Visual Studio just
-// exclude this file from the build.
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile(@"..\NAnt.key")]
-[assembly: AssemblyKeyName("")]
diff --git a/mcs/nant/src/Attributes/BooleanValidatorAttribute.cs b/mcs/nant/src/Attributes/BooleanValidatorAttribute.cs
deleted file mode 100755
index 932b027d44d..00000000000
--- a/mcs/nant/src/Attributes/BooleanValidatorAttribute.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be able to be converted into a Boolean.</summary>
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class BooleanValidatorAttribute : ValidatorAttribute {
-
- public BooleanValidatorAttribute() {
- }
-
- public override string Validate(object value) {
- string errorMessage = null;
- try {
- Convert.ToBoolean(value);
- } catch (Exception) {
- errorMessage = String.Format("Cannot resolve to '{0}' to Boolean value.", value.ToString());
- }
- return errorMessage;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/Int32ValidatorAttribute.cs b/mcs/nant/src/Attributes/Int32ValidatorAttribute.cs
deleted file mode 100755
index 51d967d7520..00000000000
--- a/mcs/nant/src/Attributes/Int32ValidatorAttribute.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be able to be converted into a Int32 within the given range.</summary>
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class Int32ValidatorAttribute : ValidatorAttribute {
-
- int _minValue = Int32.MinValue;
- int _maxValue = Int32.MaxValue;
-
- public Int32ValidatorAttribute() {
- }
-
- public Int32ValidatorAttribute(int minValue, int maxValue) {
- MinValue = minValue;
- MaxValue = maxValue;
- }
-
- public int MinValue {
- get { return _minValue; }
- set { _minValue = value; }
- }
-
- public int MaxValue {
- get { return _maxValue; }
- set { _maxValue = value; }
- }
-
- public override string Validate(object value) {
- string errorMessage = null;
- try {
- Int32 intValue = Convert.ToInt32(value);
- if (intValue < MinValue || intValue > MaxValue) {
- errorMessage = String.Format("Cannot resolve '{0}' to integer between '{1}' and '{2}'.", value.ToString(), MinValue, MaxValue);
- }
- } catch (Exception) {
- errorMessage = String.Format("Cannot resolve '{0}' to integer value.", value.ToString());
- }
- return errorMessage;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/TaskAttributeAttribute.cs b/mcs/nant/src/Attributes/TaskAttributeAttribute.cs
deleted file mode 100755
index 060e25c3a31..00000000000
--- a/mcs/nant/src/Attributes/TaskAttributeAttribute.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be treated as a xml attribute for the task.</summary>
- /// <example>
- /// Examples of how to specify task attributes
- /// <code>
- /// // task XmlType default is string
- /// [TaskAttribute("out", Required=true)]
- /// string _out = null; // assign default value here
- ///
- /// [TaskAttribute("optimize")]
- /// [BooleanValidator()]
- /// // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)
- /// string _optimize = Boolean.FalseString;
- ///
- /// [TaskAttribute("warnlevel")]
- /// [Int32Validator(0,4)] // limit values to 0-4
- /// // during ExecuteTask you can safely use Convert.ToInt32(_optimize)
- /// string _warnlevel = "0";
- ///
- /// [TaskFileSet("sources")]
- /// FileSet _sources = new FileSet();
- /// </code>
- /// NOTE: Attribute values must be of type of string if you want
- /// to be able to have macros. The field stores the exact value during
- /// InitializeTask. Just before ExecuteTask is called NAnt will expand
- /// all the macros with the current values.
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class TaskAttributeAttribute : Attribute {
-
- string _name;
- bool _required;
- bool _expandText;
-
- public TaskAttributeAttribute(string name) {
- Name = name;
- Required = false;
- ExpandText = true;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
-
- public bool Required {
- get { return _required; }
- set { _required = value; }
- }
-
- public bool ExpandText {
- get { return _expandText; }
- set { _expandText = value; }
- }
- }
-}
diff --git a/mcs/nant/src/Attributes/TaskFileSetAttribute.cs b/mcs/nant/src/Attributes/TaskFileSetAttribute.cs
deleted file mode 100755
index 607f59fc4c5..00000000000
--- a/mcs/nant/src/Attributes/TaskFileSetAttribute.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that field should be treated as a xml file set for the task.</summary>
- [AttributeUsage(AttributeTargets.Field, Inherited=true)]
- public class TaskFileSetAttribute : Attribute {
-
- string _name;
-
- public TaskFileSetAttribute(string name) {
- Name = name;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/TaskNameAttribute.cs b/mcs/nant/src/Attributes/TaskNameAttribute.cs
deleted file mode 100755
index bc7ffde1d2a..00000000000
--- a/mcs/nant/src/Attributes/TaskNameAttribute.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- /// <summary>Indicates that class should be treated as a task.</summary>
- /// <remarks>
- /// Attach this attribute to a subclass of Task to have NAnt be able
- /// to reconize it. The name should be short but must not confict
- /// with any other task already in use.
- /// </remarks>
- [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
- public class TaskNameAttribute : Attribute {
-
- string _name;
-
- public TaskNameAttribute(string name) {
- _name = name;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Attributes/ValidatorAttribute.cs b/mcs/nant/src/Attributes/ValidatorAttribute.cs
deleted file mode 100755
index 053089cc497..00000000000
--- a/mcs/nant/src/Attributes/ValidatorAttribute.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- public abstract class ValidatorAttribute : Attribute {
- public abstract string Validate(object value);
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/BuildException.cs b/mcs/nant/src/BuildException.cs
deleted file mode 100755
index 7940496d330..00000000000
--- a/mcs/nant/src/BuildException.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- /// <summary>
- /// Thrown whenever an error occurs during the build.
- /// </summary>
- public class BuildException : ApplicationException {
-
- private Location _location = Location.UnknownLocation;
-
- /// <summary>
- /// Constructs a build exception with no descriptive information.
- /// </summary>
- public BuildException() : base() {
- }
-
- /// <summary>
- /// Constructs an exception with a descriptive message.
- /// </summary>
- public BuildException(String message) : base(message) {
- }
-
- /// <summary>
- /// Constructs an exception with a descriptive message and an
- /// instance of the Exception that is the cause of the current Exception.
- /// </summary>
- public BuildException(String message, Exception e) : base(message, e) {
- }
-
- /// <summary>
- /// Constructs an exception with a descriptive message and location
- /// in the build file that caused the exception.
- /// </summary>
- /// <param name="location">Location in the build file where the exception occured.</param>
- public BuildException(String message, Location location) : base(message) {
- _location = location;
- }
-
- /// <summary>
- /// Constructs an exception with the given descriptive message, the
- /// location in the build file and an instance of the Exception that
- /// is the cause of the current Exception.
- /// </summary>
- /// <param name="message">The error message that explains the reason for the exception.</param>
- /// <param name="location">Location in the build file where the exception occured.</param>
- /// <param name="e">An instance of Exception that is the cause of the current Exception.</param>
- public BuildException(String message, Location location, Exception e) : base(message, e) {
- _location = location;
- }
-
- public override string Message {
- get {
- string message = base.Message;
-
- // only include location string if not empty
- string locationString = _location.ToString();
- if (locationString != String.Empty) {
- message = locationString + " " + message;
- }
- return message;
- }
- }
- }
-}
diff --git a/mcs/nant/src/DirectoryScanner.cs b/mcs/nant/src/DirectoryScanner.cs
deleted file mode 100755
index a2baa303d38..00000000000
--- a/mcs/nant/src/DirectoryScanner.cs
+++ /dev/null
@@ -1,226 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-/*
-Examples:
-"**\*.class" matches all .class files/dirs in a directory tree.
-
-"test\a??.java" matches all files/dirs which start with an 'a', then two
-more characters and then ".java", in a directory called test.
-
-"**" matches everything in a directory tree.
-
-"**\test\**\XYZ*" matches all files/dirs that start with "XYZ" and where
-there is a parent directory called test (e.g. "abc\test\def\ghi\XYZ123").
-
-Example of usage:
-
-DirectoryScanner scanner = DirectoryScanner();
-scanner.Includes.Add("**\\*.class");
-scanner.Exlucdes.Add("modules\\*\\**");
-scanner.BaseDirectory = "test";
-scanner.Scan();
-foreach (string filename in GetIncludedFiles()) {
- Console.WriteLine(filename);
-}
-*/
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.IO;
- using System.Text;
- using System.Text.RegularExpressions;
-
- public class DirectoryScanner {
-
- string _baseDirectory = Environment.CurrentDirectory;
-
- // holds the nant patterns
- StringCollection _includes = new StringCollection();
- StringCollection _excludes = new StringCollection();
-
- // holds the nant patterns converted to regular expression patterns
- StringCollection _includePatterns = null;
- StringCollection _excludePatterns = null;
-
- // holds the result from a scan
- StringCollection _fileNames = null;
- StringCollection _directoryNames = null;
-
- public StringCollection Includes {
- get { return _includes; }
- }
-
- public StringCollection Excludes {
- get { return _excludes; }
- }
-
- public string BaseDirectory {
- get { return _baseDirectory; }
- set { _baseDirectory = value; }
- }
-
- public StringCollection FileNames {
- get {
- if (_fileNames == null) {
- Scan();
- }
- return _fileNames;
- }
- }
-
- public StringCollection DirectoryNames {
- get {
- if (_directoryNames == null) {
- Scan();
- }
- return _directoryNames;
- }
- }
-
- public void Scan() {
- _includePatterns = new StringCollection();
- foreach (string pattern in Includes) {
- _includePatterns.Add(ToRegexPattern(pattern));
- }
-
- _excludePatterns = new StringCollection();
- foreach (string pattern in Excludes) {
- _excludePatterns.Add(ToRegexPattern(pattern));
- }
-
- _fileNames = new StringCollection();
- _directoryNames = new StringCollection();
-
- ScanDirectory(Path.GetFullPath(BaseDirectory));
- }
-
- void ScanDirectory(string path) {
- // get info for the current directory
- DirectoryInfo currentDirectoryInfo = new DirectoryInfo(path);
-
- // scan subfolders
- foreach (DirectoryInfo directoryInfo in currentDirectoryInfo.GetDirectories()) {
- ScanDirectory(directoryInfo.FullName);
- }
-
- // scan files
- foreach (FileInfo fileInfo in currentDirectoryInfo.GetFiles()) {
- string filename = Path.Combine(path, fileInfo.Name);
- if (IsPathIncluded(filename)) {
- _fileNames.Add(filename);
- }
- }
-
- // Check current path last so that delete task will correctly
- // delete empty directories. This may *seem* like a special case
- // but it is more like formalizing something in a way that makes
- // writing the delete task easier :)
- if (IsPathIncluded(path)) {
- _directoryNames.Add(path);
- }
- }
-
- bool IsPathIncluded(string path) {
- bool included = false;
-
- // check path against includes
- foreach (string pattern in _includePatterns) {
- Match m = Regex.Match(path, pattern);
- if (m.Success) {
- included = true;
- break;
- }
- }
-
- // check path against excludes
- if (included) {
- foreach (string pattern in _excludePatterns) {
- Match m = Regex.Match(path, pattern);
- if (m.Success) {
- included = false;
- break;
- }
- }
- }
-
- return included;
- }
-
- string ToRegexPattern(string nantPattern) {
-
- StringBuilder pattern = new StringBuilder(nantPattern);
-
- // NAnt patterns can use either / \ as a directory seperator.
- // We must replace both of these characters with Path.DirectorySeperatorChar
- pattern.Replace('/', Path.DirectorySeparatorChar);
- pattern.Replace('\\', Path.DirectorySeparatorChar);
-
- // Patterns MUST be full paths.
- if (!Path.IsPathRooted(pattern.ToString())) {
- pattern = new StringBuilder(Path.Combine(BaseDirectory, pattern.ToString()));
- }
-
- // The '\' character is a special character in regular expressions
- // and must be escaped before doing anything else.
- pattern.Replace(@"\", @"\\");
-
- // Escape the rest of the regular expression special characters.
- // NOTE: Characters other than . $ ^ { [ ( | ) * + ? \ match themselves.
- // TODO: Decide if ] and } are missing from this list, the above
- // list of characters was taking from the .NET SDK docs.
- pattern.Replace(".", @"\.");
- pattern.Replace("$", @"\$");
- pattern.Replace("^", @"\^");
- pattern.Replace("{", @"\{");
- pattern.Replace("[", @"\[");
- pattern.Replace("(", @"\(");
- pattern.Replace(")", @"\)");
- pattern.Replace("+", @"\+");
-
- // Special case directory seperator string under Windows.
- string seperator = Path.DirectorySeparatorChar.ToString();
- if (seperator == @"\") {
- seperator = @"\\";
- }
-
- // Convert NAnt pattern characters to regular expression patterns.
-
- // SPECIAL CASE: to match subdirectory OR current directory. If
- // we don't do this then we can write something like 'src/**/*.cs'
- // to match all the files ending in .cs in the src directory OR
- // subdirectories of src.
- pattern.Replace(seperator + "**", "(" + seperator + ".|)|");
-
- // | is a place holder for * to prevent it from being replaced in next line
- pattern.Replace("**", ".|");
- pattern.Replace("*", "[^" + seperator + "]*");
- pattern.Replace("?", "[^" + seperator + "]?");
- pattern.Replace('|', '*'); // replace place holder string
-
- // Help speed up the search
- pattern.Insert(0, '^'); // start of line
- pattern.Append('$'); // end of line
-
- return pattern.ToString();
- }
- }
-}
diff --git a/mcs/nant/src/FileSet.cs b/mcs/nant/src/FileSet.cs
deleted file mode 100755
index 4e934fc82d2..00000000000
--- a/mcs/nant/src/FileSet.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.IO;
-
- public class FileSet {
-
- /// <summary>
- /// Used to determine if a file has a more recent last write time then the specified write time.
- /// </summary>
- /// <param name="fileNames">A collection of filenames to check last write times against.</param>
- /// <param name="targetLastWriteTime">The datetime to compare against.</param>
- /// <returns><c>True</c> if at least one file in <c>fileNames</c> has a last write time greater than <c>targetLastWriteTime</c>.</returns>
- public static bool MoreRecentLastWriteTime(StringCollection fileNames, DateTime targetLastWriteTime) {
- foreach (string fileName in fileNames) {
- FileInfo fileInfo = new FileInfo(fileName);
- if (!fileInfo.Exists) {
- return true;
- }
- if (fileInfo.LastWriteTime > targetLastWriteTime) {
- return true;
- }
- }
- return false;
- }
-
- // We can't just use the DirectoryScanner's includes/excludes collections
- // because when we do a Scan() we need to first expand any macros.
-
- StringCollection _includes = new StringCollection();
- StringCollection _excludes = new StringCollection();
- DirectoryScanner _scanner = null;
- string _baseDirectory;
- bool _includeAllByDefault;
- Task _task = null;
-
- public FileSet(bool includeAllByDefault) {
- IncludeAllByDefault = includeAllByDefault;
- Excludes.Add("**/CVS/*");
- Excludes.Add("**/.cvsignore");
- }
-
- /// <remarks>
- /// Will be automagically set in Task.AutoInitializeAttributes() if
- /// file set has TaskFileSetAttribute set on it.
- /// </remarks>
- // TODO: change this to IMacroExpander
- public Task Task {
- get { return _task; }
- set { _task = value; }
- }
-
- public string BaseDirectory {
- get { return _baseDirectory; }
- set { _baseDirectory = value; }
- }
-
- /// <summary>Determines if scan should produce everything or nothing
- /// if there are no Includes set. Default false.</summary>
- public bool IncludeAllByDefault {
- get { return _includeAllByDefault; }
- set { _includeAllByDefault = value; }
- }
-
- public StringCollection Includes {
- get { return _includes; }
- }
-
- public StringCollection Excludes {
- get { return _excludes; }
- }
-
- public void Scan() {
- // get project (only for expanding macros)
- Project expander = Task.Project;
-
- _scanner = new DirectoryScanner();
- _scanner.BaseDirectory = expander.GetFullPath(BaseDirectory);;
-
- foreach (string path in Includes) {
- _scanner.Includes.Add(expander.ExpandText(path));
- }
- if (Includes.Count <= 0 && IncludeAllByDefault) {
- _scanner.Includes.Add("**");
- }
-
- foreach (string path in Excludes) {
- _scanner.Excludes.Add(expander.ExpandText(path));
- }
-
- _scanner.Scan();
- }
-
- public StringCollection DirectoryNames {
- get {
- if (_scanner == null) {
- Scan();
- }
- return _scanner.DirectoryNames;
- }
- }
-
- public StringCollection FileNames {
- get {
- if (_scanner == null) {
- Scan();
- }
- return _scanner.FileNames;
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Location.cs b/mcs/nant/src/Location.cs
deleted file mode 100755
index 3a51279d371..00000000000
--- a/mcs/nant/src/Location.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Ian MacLean (ian_maclean@another.com)
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
- using System;
- using System.IO;
-
- /// <summary>
- /// Stores the file name and line number in a file.
- /// </summary>
- public class Location {
- string _fileName;
- int _lineNumber;
- int _columnNumber;
-
- public static readonly Location UnknownLocation = new Location();
-
- /// <summary>
- /// Creates a location consisting of a file name and line number.
- ///</summary>
- public Location(string fileName, int lineNumber, int columnNumber) {
- Uri uri = new Uri(fileName);
- string strfileName = uri.LocalPath; // convert from URI syntax to local path
- Init(strfileName, lineNumber, columnNumber);
- }
-
- /// <summary>
- /// Creates a location consisting of a file name but no line number.
- ///</summary>
- public Location(string fileName) {
- Init(fileName, 0, 0);
- }
-
- /// <summary>
- /// Creates an "unknown" location.
- ///</summary>
- private Location() {
- Init(null, 0, 0);
- }
-
- /// <summary>
- /// Private Init function.
- ///</summary>
- private void Init(string fileName, int lineNumber, int columnNumber) {
- _fileName = fileName;
- _lineNumber = lineNumber;
- _columnNumber = columnNumber;
- }
-
- /// <summary>
- /// Returns the file name, line number and a trailing space. An error
- /// message can be appended easily. For unknown locations, returns
- /// an empty string.
- ///</summary>
- public override string ToString() {
- string message = "";
-
- if (_fileName != null) {
- message += _fileName;
-
- if (_lineNumber != 0) {
- message += ":";
- message += _lineNumber.ToString();
- }
-
- message += ":";
- }
-
- return message;
- }
- }
-}
diff --git a/mcs/nant/src/NAnt.cs b/mcs/nant/src/NAnt.cs
deleted file mode 100755
index 7a192036f98..00000000000
--- a/mcs/nant/src/NAnt.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Diagnostics;
- using System.IO;
- using System.Text.RegularExpressions;
-
- public class NAnt {
- public static int Main(string[] args) {
- int returnCode = 0;
-
- Log.IndentSize = 12;
-
- Project project = new Project();
-
- const string buildfileOption = "-buildfile:";
- const string basedirOption = "-basedir:";
- const string setOption = "-set:";
- const string helpOption = "-h"; // allow -h and -help
- const string verboseOption = "-verbose";
-
- bool showHelp = false;
-
- foreach (string arg in args) {
- if (arg.StartsWith(buildfileOption)) {
- project.BuildFileName = arg.Substring(buildfileOption.Length);
- } else if (arg.StartsWith(basedirOption)) {
- project.BaseDirectory = arg.Substring(basedirOption.Length);
- } else if (arg.StartsWith(basedirOption)) {
- project.BaseDirectory = arg.Substring(basedirOption.Length);
- } else if (arg.StartsWith(setOption)) {
- // TODO: implement user defined properties
- // user defined properties from command line or file should be
- // marked so that they cannot be overwritten by the build file
- // ie, once set they are set for the rest of the build.
- Match match = Regex.Match(arg, @"-set:(\w+)=(\w*)");
- if (match.Success) {
- string name = match.Groups[1].Value;
- string value = match.Groups[2].Value;
- project.Properties.AddReadOnly(name, value);
- }
- } else if (arg.StartsWith(helpOption)) {
- showHelp = true;
- } else if (arg.StartsWith(verboseOption)) {
- project.Verbose = true;
- } else if (arg.Length > 0) {
- // must be a target (or mistake ;)
- project.BuildTargets.Add(arg);
- }
- }
-
- // Get version information directly from assembly. This takes more
- // work but prevents the version numbers from getting out of sync.
- ProcessModule module = Process.GetCurrentProcess().MainModule;
- FileVersionInfo info = FileVersionInfo.GetVersionInfo(module.FileName);
- string programName = Path.GetFileNameWithoutExtension(info.FileName); // in case the user has renamed the program
-
- if (showHelp) {
- const int optionPadding = 23;
-
- Console.WriteLine("NAnt Version {0} Copyright (C) 2001 Gerry Shaw", info.FileMajorPart + "." + info.FileMinorPart + "." + info.FileBuildPart);
- Console.WriteLine("http://nant.sourceforge.net/");
- Console.WriteLine();
- Console.WriteLine("NAnt comes with ABSOLUTELY NO WARRANTY.");
- Console.WriteLine("This is free software, and you are welcome to redistribute it under certain");
- Console.WriteLine("conditions set out by the GNU General Public License. A copy of the license");
- Console.WriteLine("is available in the distribution package and from the NAnt web site.");
- Console.WriteLine();
- Console.WriteLine("usage: {0} [options] [target]", programName);
- Console.WriteLine();
- Console.WriteLine("options:");
- Console.WriteLine(" {0} use given buildfile", (buildfileOption + "<file>").PadRight(optionPadding));
- Console.WriteLine(" {0} set project base directory", (basedirOption + "<dir>").PadRight(optionPadding));
- Console.WriteLine(" {0} use value for given property", (setOption + "<property>=<value>").PadRight(optionPadding));
- Console.WriteLine(" {0} print this message", helpOption.PadRight(optionPadding));
- Console.WriteLine();
- Console.WriteLine("If no buildfile is specified the first file ending in .build will be used.");
- } else {
- if (!project.Run()) {
- Console.WriteLine("Try `{0} -help' for more information.", programName);
- returnCode = 1; // set return code to indicate an error occurred
- }
- }
- Log.Close();
- return returnCode;
- }
- }
-}
diff --git a/mcs/nant/src/NAnt.exe b/mcs/nant/src/NAnt.exe
deleted file mode 100755
index a7a82b71366..00000000000
--- a/mcs/nant/src/NAnt.exe
+++ /dev/null
Binary files differ
diff --git a/mcs/nant/src/Project.cs b/mcs/nant/src/Project.cs
deleted file mode 100755
index 9746dadcfdc..00000000000
--- a/mcs/nant/src/Project.cs
+++ /dev/null
@@ -1,332 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Reflection;
- using System.Text.RegularExpressions;
- using System.Xml;
- using System.Xml.XPath;
- using System.Collections;
- using System.Collections.Specialized;
-
- /// <summary>
- /// Central representation of an NAnt project.
- /// </summary>
- public class Project {
-
- public static readonly string BuildFilePattern = "*.build";
-
- /// <summary>
- /// Finds the file name for the build file in the specified directory.
- /// </summary>
- /// <param name="directory">The directory to look for a build file. When in doubt use Environment.CurrentDirectory for directory.</param>
- /// <returns>The path to the build file or <c>null</c> if no build file could be found.</returns>
- public static string FindBuildFileName(string directory) {
- string buildFileName = null;
-
- // find first file ending in .build
- DirectoryInfo directoryInfo = new DirectoryInfo(directory);
- FileInfo[] files = directoryInfo.GetFiles(BuildFilePattern);
- if (files.Length > 0) {
- buildFileName = Path.Combine(directory, files[0].Name);
- }
- return buildFileName;
- }
-
- string _name;
- string _defaultTargetName;
- string _baseDirectory;
- string _buildFileName;
- bool _verbose = false;
-
- StringCollection _buildTargets = new StringCollection();
- TaskCollection _tasks = new TaskCollection();
- TargetCollection _targets = new TargetCollection();
- XPathTextPositionMap _positionMap; // created when Xml document is loaded
- TaskFactory _taskFactory; // created in constructor
- PropertyDictionary _properties = new PropertyDictionary();
-
- public Project() {
- _taskFactory = new TaskFactory(this);
- }
-
- /// <summary>
- /// The name of the project.
- /// </summary>
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
-
- public string BaseDirectory {
- get { return _baseDirectory; }
- set { _baseDirectory = value; }
- }
-
- public string BuildFileName {
- get { return _buildFileName; }
- set { _buildFileName = value; }
- }
-
- /// <summary>
- /// When true tasks should output more output.
- /// </summary>
- public bool Verbose {
- get { return _verbose; }
- set { _verbose = value; }
- }
-
- /// <summary>
- /// The list of targets to built.
- /// </summary>
- /// <remarks>
- /// Targets are built in the order they appear in the collection. If
- /// the collection is empty the default target will be built.
- /// </remarks>
- public StringCollection BuildTargets {
- get { return _buildTargets; }
- }
-
- /// <summary>
- /// The list of tasks to perform before any targets executed.
- /// </summary>
- /// <remarks>
- /// Tasks are executed in the order they appear in the collection.
- /// </remarks>
- public TaskCollection Tasks {
- get { return _tasks; }
- }
-
- public PropertyDictionary Properties {
- get { return _properties; }
- }
-
- public TargetCollection Targets {
- get { return _targets; }
- }
-
- public bool Run() {
- bool buildResult = false;
- try {
- DateTime startTime = DateTime.Now;
-
- if (BaseDirectory == null) {
- BaseDirectory = Environment.CurrentDirectory;
- }
- BaseDirectory = Path.GetFullPath(BaseDirectory);
-
- if (BuildFileName == null || BuildFileName == String.Empty) {
- BuildFileName = FindBuildFileName(BaseDirectory);
- if (BuildFileName == null) {
- throw new BuildException(String.Format("Could not find a '{0}' file in '{1}'", BuildFilePattern, BaseDirectory));
- }
- }
-
- Log.WriteLine("Buildfile: {0}", BuildFileName);
- if (Verbose) {
- Log.WriteLine("Base Directory: {0}", BaseDirectory);
- }
-
- XmlDocument doc = new XmlDocument();
- try {
- doc.Load(BuildFileName);
- // TODO: validate against xsd schema
- } catch (XmlException e) {
- throw new BuildException(String.Format("Could not load '{0}'", BuildFileName), e);
- }
-
- Initialize(doc);
- Properties.Add("nant.buildfile", BuildFileName);
-
- Execute();
-
- Log.WriteLine();
- Log.WriteLine("BUILD SUCCEEDED");
-
- TimeSpan buildTime = DateTime.Now - startTime;
- Log.WriteLine();
- Log.WriteLine("Total time: {0} seconds", (int) buildTime.TotalSeconds);
-
- buildResult = true;
- } catch (BuildException e) {
- Log.WriteLine();
- Log.WriteLine("BUILD FAILED");
- Log.WriteLine(e.Message);
- if (e.InnerException != null) {
- Log.WriteLine(e.InnerException.Message);
- }
- } catch (Exception e) {
- // all other exceptions should have been caught
- Log.WriteLine();
- Log.WriteLine("INTERNAL ERROR");
- Log.WriteLine(e.ToString());
- }
- return buildResult;
- }
-
- public int AddTasks(string assemblyPath) {
-
- Assembly assembly;
- if (assemblyPath == null) {
- assembly = Assembly.GetExecutingAssembly();
- } else {
- assembly = Assembly.LoadFrom(assemblyPath);
- }
-
- int taskCount = 0;
- foreach(Type type in assembly.GetTypes()) {
- if (type.IsSubclassOf(typeof(Task)) && !type.IsAbstract) {
- if (_taskFactory.Builders.Add(new TaskBuilder(type.FullName, assemblyPath))) {
- taskCount++;
- }
- }
- }
- return taskCount;
- }
-
- public void Initialize(XmlDocument doc) {
-
- Name = doc.SelectSingleNode("project/@name").Value;
-
- // make it possible for user to override this value
- if (BaseDirectory == null) {
- BaseDirectory = doc.SelectSingleNode("project/@basedir").Value;
- }
-
- // used only if BuildTargets collection is empty
- _defaultTargetName = doc.SelectSingleNode("project/@default").Value;
-
- // initialize builtin tasks
- AddTasks(null);
-
- // init static built in properties
- Properties.Add("nant.project.name", Name);
- Properties.Add("nant.base.dir", BaseDirectory);
- Properties.Add("nant.default.name", _defaultTargetName);
-
- // add all environment variables
- IDictionary variables = Environment.GetEnvironmentVariables();
- foreach (string name in variables.Keys) {
- string value = (string) variables[name];
- Properties.Add("nant.env." + name, value);
- }
-
- // Load line Xpath to linenumber array
- _positionMap = new XPathTextPositionMap(doc.BaseURI);
-
- // process all the non-target nodes (these are global tasks for the project)
- XmlNodeList taskList = doc.SelectNodes("project/*[name() != 'target']");
- foreach (XmlNode taskNode in taskList) {
-
- // TODO: do somethiing like Project.CreateTask(taskNode) and have the project set the location
- TextPosition textPosition = _positionMap.GetTextPosition(taskNode);
-
- Task task = CreateTask(taskNode);
- if (task != null) {
- Tasks.Add(task);
- }
- }
-
- // execute global tasks now - before anything else
- // this lets us include tasks that do things like add more tasks
- foreach (Task task in Tasks) {
- task.Execute();
- }
-
- // process all the targets
- XmlNodeList targetList = doc.SelectNodes("project/target");
- foreach (XmlNode targetNode in targetList) {
- Target target = new Target(this);
- target.Initialize(targetNode);
- Targets.Add(target);
- }
- }
-
- public void Execute() {
- if (BuildTargets.Count == 0) {
- BuildTargets.Add(_defaultTargetName);
- }
-
- foreach(string targetName in BuildTargets) {
- Execute(targetName);
- }
- }
-
- public void Execute(string targetName) {
- Target target = Targets.Find(targetName);
- if (target == null) {
- throw new BuildException(String.Format("unknown target '{0}'", targetName));
- }
- target.Execute();
- }
-
- public Task CreateTask(XmlNode taskNode) {
- return CreateTask(taskNode, null);
- }
-
- public Task CreateTask(XmlNode taskNode, Target target) {
- Task task = _taskFactory.CreateTask(taskNode, target);
- if (task != null) {
- // save task location in case of error
- TextPosition pos = _positionMap.GetTextPosition(taskNode);
-
- // initialize the task
- task.Initialize(taskNode, new Location(taskNode.BaseURI, pos.Line, pos.Column));
- }
- return task;
- }
-
- public string ExpandText(string input) {
- string output = input;
- if (input != null) {
- const string pattern = @"\$\{([^\}]*)\}";
- foreach (Match m in Regex.Matches(input, pattern)) {
- if (m.Length > 0) {
-
- string token = m.ToString();
- string propertyName = m.Groups[1].Captures[0].Value;
- string propertyValue = Properties[propertyName];
-
- if (propertyValue != null) {
- output = output.Replace(token, propertyValue);
- }
- }
- }
- }
- return output;
- }
-
- public string GetFullPath(string path) {
- string baseDir = ExpandText(BaseDirectory);
-
- if (path != null) {
- if (!Path.IsPathRooted(path)) {
- path = Path.Combine(baseDir, path);
- }
- } else {
- path = baseDir;
- }
- return Path.GetFullPath(path);
- }
- }
-}
diff --git a/mcs/nant/src/PropertyDictionary.cs b/mcs/nant/src/PropertyDictionary.cs
deleted file mode 100755
index 072ba46c0d2..00000000000
--- a/mcs/nant/src/PropertyDictionary.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System.Collections;
- using System.Collections.Specialized;
-
- public class PropertyDictionary : DictionaryBase {
-
- /// <summary>
- /// Maintains a list of the property names that are readonly.
- /// </summary>
- StringCollection _readOnlyProperties = new StringCollection();
-
- /// <summary>
- /// Adds a property that cannot be changed.
- /// </summary>
- /// <remarks>
- /// Properties added with this method can never be changed. Note that
- /// they are removed if the <c>Clear</c> method is called.
- /// </remarks>
- /// <param name="name">Name of property</param>
- /// <param name="value">Value of property</param>
- public void AddReadOnly(string name, string value) {
- if (!_readOnlyProperties.Contains(name)) {
- _readOnlyProperties.Add(name);
- Dictionary.Add(name, value);
- }
- }
-
- /// <summary>
- /// Adds a property to the collection.
- /// </summary>
- /// <param name="name">Name of property</param>
- /// <param name="value">Value of property</param>
- public void Add(string name, string value) {
- if (!_readOnlyProperties.Contains(name)) {
- Dictionary.Add(name, value);
- }
- }
-
- public string this[string name] {
- get { return (string) Dictionary[(object) name]; }
- set {
- if (!_readOnlyProperties.Contains(name)) {
- Dictionary[name] = value;
- }
- }
- }
-
- protected override void OnClear() {
- _readOnlyProperties.Clear();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Target.cs b/mcs/nant/src/Target.cs
deleted file mode 100755
index 3e0de022c23..00000000000
--- a/mcs/nant/src/Target.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Xml;
-
- public class Target {
-
- string _name;
- Project _project;
- bool _hasExecuted = false;
- TaskCollection _tasks = new TaskCollection();
- StringCollection _dependencies = new StringCollection();
-
- public Target(Project project) {
- Project = project;
- }
-
- public string Name {
- get { return _name; }
- set { _name = value; }
- }
-
- public Project Project {
- get { return _project; }
- set { _project = value; }
- }
-
- public bool HasExecuted {
- get { return _hasExecuted; }
- }
-
- public TaskCollection Tasks {
- get { return _tasks; }
- }
-
- public StringCollection Dependencies {
- get { return _dependencies; }
- }
-
- public void Initialize(XmlNode targetNode) {
- // get target name
- XmlNode nameNode = targetNode.SelectSingleNode("@name");
- if (nameNode == null) {
- // TODO: add Location to exception
- throw new BuildException("target must have a name attribute");
- }
- Name = nameNode.Value;
-
- // add dependicies
- XmlNode dependsNode = targetNode.SelectSingleNode("@depends");
- if (dependsNode != null) {
- string depends = dependsNode.Value;
- foreach (string str in depends.Split(new char[]{','})) {
- string dependency = str.Trim();
- if (dependency.Length > 0) {
- Dependencies.Add(dependency);
- }
- }
- }
-
- // select all the non-target nodes (these are global tasks for the project)
- XmlNodeList taskList = targetNode.SelectNodes("*");
- foreach (XmlNode taskNode in taskList) {
- Task task = Project.CreateTask(taskNode, this);
- if (task != null) {
- Tasks.Add(task);
- }
- }
- }
-
- public void Execute() {
- if (!HasExecuted) {
- try {
- foreach (string targetName in Dependencies) {
- Target target = Project.Targets.Find(targetName);
- if (target == null) {
- // TODO: add Location to exception
- throw new BuildException(String.Format("unknown dependent target '{0}' of target '{1}'", targetName, Name));
- }
- target.Execute();
- }
-
- Log.WriteLine();
- Log.WriteLine("{0}:", Name);
- foreach (Task task in Tasks) {
- task.Execute();
- }
- } finally {
- _hasExecuted = true;
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/TargetCollection.cs b/mcs/nant/src/TargetCollection.cs
deleted file mode 100755
index c4f486b1302..00000000000
--- a/mcs/nant/src/TargetCollection.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections;
-
- public class TargetCollection : ArrayList {
-
- public Target Find(string targetName) {
- foreach(Target target in this) {
- if (target.Name == targetName)
- return target;
- }
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Task.cs b/mcs/nant/src/Task.cs
deleted file mode 100755
index 2a4eafaebd1..00000000000
--- a/mcs/nant/src/Task.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
- using System.Xml;
-
- public abstract class Task {
-
- /// <summary>Gets and sets how much spacing log prefix names will be padded.</summary>
- /// <remarks>
- /// Includes characters for a space after the name and the [ ] brackets. Default is 12.
- /// </remarks>
- public static int LogPrefixPadding = Log.IndentSize;
-
- Location _location = Location.UnknownLocation;
- Target _target = null;
- Project _project = null;
-
- /// <summary>
- /// Location in build file where task is defined.
- /// </summary>
- protected Location Location {
- get { return _location; }
- set { _location = value; }
- }
-
- public string Name {
- get {
- string name = null;
- TaskNameAttribute taskName = (TaskNameAttribute) Attribute.GetCustomAttribute(GetType(), typeof(TaskNameAttribute));
- if (taskName != null) {
- name = taskName.Name;
- }
- return name;
- }
- }
-
- public string LogPrefix {
- get {
- string prefix = "[" + Name + "] ";
- return prefix.PadLeft(LogPrefixPadding);
- }
- }
-
- public Target Target {
- get { return _target; }
- set { _target = value; }
- }
-
- public Project Project {
- get { return _project; }
- set { _project = value; }
- }
-
- protected void AutoInitializeAttributes(XmlNode taskNode) {
-
- // TODO: BooleanValidatorAttribute and Int32ValidatorAttribute implementation in Task
-
- // Go down the inheritance tree to find the private fields in the object.
- // We are looking for task attributes to initialize.
- Type currentType = GetType();
- while (currentType != typeof(object)) {
- FieldInfo[] fieldInfoArray = currentType.GetFields(BindingFlags.NonPublic|BindingFlags.Instance);
- foreach (FieldInfo fieldInfo in fieldInfoArray) {
-
- // process TaskAttribute attributes
- TaskAttributeAttribute taskAttribute = (TaskAttributeAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskAttributeAttribute));
- if (taskAttribute != null) {
-
- // get value from xml file
- XmlNode node = taskNode.SelectSingleNode("@" + taskAttribute.Name);
-
- // check if its required
- if (node == null && taskAttribute.Required) {
- // TODO: add Location to exception
- throw new BuildException(String.Format("{0} is a required attribute.", taskAttribute.Name), Location);
- }
-
- if (node != null) {
- fieldInfo.SetValue(this, Convert.ChangeType(node.Value, fieldInfo.FieldType));
- }
- }
-
- // process TaskFileSet attributes
- TaskFileSetAttribute fileSetAttribute = (TaskFileSetAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskFileSetAttribute));
- if (fileSetAttribute != null) {
- // have file set initialize itself
- FileSet fileSet = (FileSet) fieldInfo.GetValue(this);
-
- // set task fileset belongs to
- fileSet.Task = this;
-
- // load values from build file
- XmlNode fileSetNode = taskNode.SelectSingleNode(fileSetAttribute.Name);
- if (fileSetNode != null) {
-
- XmlNode baseDirectoryNode = fileSetNode.SelectSingleNode("@basedir");
- if (baseDirectoryNode != null) {
- fileSet.BaseDirectory = baseDirectoryNode.Value;
- }
-
- foreach (XmlNode node in fileSetNode.SelectNodes("includes")) {
- string pathname = node.SelectSingleNode("@name").Value;
- fileSet.Includes.Add(pathname);
- }
-
- foreach (XmlNode node in fileSetNode.SelectNodes("excludes")) {
- fileSet.Excludes.Add(node.SelectSingleNode("@name").Value);
- }
- }
- }
- }
- currentType = currentType.BaseType;
- }
- }
-
- protected void AutoExpandAttributes() {
-
- // Go down the inheritance tree to find the private fields in the object.
- // We are looking for task attributes to initialize.
- Type currentType = GetType();
- while (currentType != typeof(object)) {
- FieldInfo[] fieldInfoArray = currentType.GetFields(BindingFlags.NonPublic|BindingFlags.Instance);
- foreach (FieldInfo fieldInfo in fieldInfoArray) {
-
- // proces string parameters
- TaskAttributeAttribute taskAttribute = (TaskAttributeAttribute) Attribute.GetCustomAttribute(fieldInfo, typeof(TaskAttributeAttribute));
- if (taskAttribute != null) {
- if (taskAttribute.ExpandText) {
- string value = (string) fieldInfo.GetValue(this);
- value = Project.ExpandText(value);
- fieldInfo.SetValue(this, value);
- }
-
- // if a field also has a validator attribute then ensure that value is correct
- ValidatorAttribute[] validators = (ValidatorAttribute[]) Attribute.GetCustomAttributes(fieldInfo, typeof(ValidatorAttribute));
- foreach (ValidatorAttribute validator in validators) {
- string errorMessage = validator.Validate(fieldInfo.GetValue(this));
- if (errorMessage != null) {
- throw new BuildException(String.Format("Error processing '{0}' attribute in <{1}> task: {2}", taskAttribute.Name, Name, errorMessage), Location);
- }
- }
- }
- }
- currentType = currentType.BaseType;
- }
- }
-
- public void Initialize(XmlNode taskNode) {
- Initialize(taskNode, null);
- }
-
- public void Initialize(XmlNode taskNode, Location location) {
- if (location != null) {
- _location = location;
- }
- AutoInitializeAttributes(taskNode);
- InitializeTask(taskNode);
- }
-
- public void Execute() {
- AutoExpandAttributes();
- ExecuteTask();
- }
-
- protected virtual void InitializeTask(XmlNode taskNode) {
- }
-
- protected abstract void ExecuteTask();
- }
-}
diff --git a/mcs/nant/src/TaskBuilder.cs b/mcs/nant/src/TaskBuilder.cs
deleted file mode 100755
index 97b602b4828..00000000000
--- a/mcs/nant/src/TaskBuilder.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Reflection;
-
- public class TaskBuilder {
-
- string _className;
- string _assemblyFileName;
- string _taskName;
-
- public TaskBuilder(string className)
- : this(className, null) {
- }
-
- public TaskBuilder(string className, string assemblyFileName) {
- _className = className;
- _assemblyFileName = assemblyFileName;
-
- // get task name from attribute
- Assembly assembly = GetAssembly();
- TaskNameAttribute taskNameAttribute = (TaskNameAttribute) Attribute.GetCustomAttribute(assembly.GetType(ClassName), typeof(TaskNameAttribute));
- _taskName = taskNameAttribute.Name;
- }
-
- public string ClassName {
- get { return _className; }
- }
-
- public string AssemblyFileName {
- get { return _assemblyFileName; }
- }
-
- public string TaskName {
- get { return _taskName; }
- }
-
- private Assembly GetAssembly() {
- Assembly assembly;
- if (AssemblyFileName == null) {
- assembly = Assembly.GetExecutingAssembly();
- } else {
- assembly = Assembly.LoadFrom(AssemblyFileName);
- }
- return assembly;
- }
-
- public Task CreateTask(Project project, Target target) {
- Task task;
- try {
- Assembly assembly = GetAssembly();
-
- // create instance (ignore case)
- task = (Task) assembly.CreateInstance(ClassName, true);
-
- // set default values
- task.Project = project;
- task.Target = target;
- } catch (Exception) {
- task = null;
- }
- return task;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/TaskBuilderCollection.cs b/mcs/nant/src/TaskBuilderCollection.cs
deleted file mode 100755
index bb61c3171a3..00000000000
--- a/mcs/nant/src/TaskBuilderCollection.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections;
-
- public class TaskBuilderCollection : ArrayList {
-
- public bool Add(TaskBuilder builder) {
- // prevent adding duplicate builders with the name task name
- bool taskAdded = false;
- if (GetBuilderForTask(builder.TaskName) == null) {
- base.Add(builder);
- taskAdded = true;
- }
- return taskAdded;
- }
-
- public TaskBuilder GetBuilderForTask(string taskName) {
- foreach (TaskBuilder builder in this) {
- if (builder.TaskName == taskName) {
- return builder;
- }
- }
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/TaskCollection.cs b/mcs/nant/src/TaskCollection.cs
deleted file mode 100755
index 94d7afc4202..00000000000
--- a/mcs/nant/src/TaskCollection.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System.Collections;
-
- public class TaskCollection : ArrayList {
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/TaskFactory.cs b/mcs/nant/src/TaskFactory.cs
deleted file mode 100755
index f1e4f7f718a..00000000000
--- a/mcs/nant/src/TaskFactory.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Xml;
-
- internal class TaskFactory {
-
- TaskBuilderCollection _builders = new TaskBuilderCollection();
- Project _project;
-
- public TaskFactory(Project project) {
- Project = project;
- }
-
- public TaskBuilderCollection Builders {
- get { return _builders; }
- }
-
- public Project Project {
- get { return _project; }
- set { _project = value; }
- }
-
- public Task CreateTask(XmlNode taskNode, Target target) {
- string taskName = taskNode.Name;
- Task task = null;
-
- TaskBuilder builder = Builders.GetBuilderForTask(taskName);
- if (builder != null) {
- task = builder.CreateTask(Project, target);
- } else {
- throw new BuildException(String.Format("unknown task <{0}> in target <{1}>", taskName, target.Name));
- }
-
- return task;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/CallTask.cs b/mcs/nant/src/Tasks/CallTask.cs
deleted file mode 100755
index 08e24711746..00000000000
--- a/mcs/nant/src/Tasks/CallTask.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
- using System.Xml;
-
- [TaskName("call")]
- public class CallTask : Task {
-
- [TaskAttribute("target", Required=true)]
- string _target = null;
-
- // Attribute properties
- public string TargetName { get { return _target; } }
-
- protected override void ExecuteTask() {
- Project.Execute(TargetName);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/ChangeLog b/mcs/nant/src/Tasks/ChangeLog
deleted file mode 100644
index 68de36bb94a..00000000000
--- a/mcs/nant/src/Tasks/ChangeLog
+++ /dev/null
@@ -1,13 +0,0 @@
-2002-04-26 Martin Baulig <martin@gnome.org>
-
- * CompilerBase.cs (WriteOption): New virtual method. The default
- implementation writes CSC-style command line options, but it can
- be overridden in derived class to write mcs-style command line
- arguments.
- (ExecuteTask): Use the new virtual `WriteOption' method to write
- options.
-
- * CscTask.cs (WriteOptions): Use the new `WriteOption' method.
-
- * McsTask.cs: New file.
-
diff --git a/mcs/nant/src/Tasks/CompilerBase.cs b/mcs/nant/src/Tasks/CompilerBase.cs
deleted file mode 100755
index 39ffb2970af..00000000000
--- a/mcs/nant/src/Tasks/CompilerBase.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
-
- public abstract class CompilerBase : ExternalProgramBase {
-
- string _responseFileName;
-
- // Microsoft common compiler options
- [TaskAttribute("output", Required=true)]
- string _output = null;
-
- [TaskAttribute("target", Required=true)]
- string _target = null;
-
- [TaskAttribute("debug")]
- [BooleanValidator()]
- string _debug = Boolean.FalseString;
-
- [TaskAttribute("define")]
- string _define = null;
-
- [TaskAttribute("win32icon")]
- string _win32icon = null;
-
- [TaskFileSet("references")]
- FileSet _references = new FileSet(false);
-
- [TaskFileSet("resources")]
- FileSet _resources = new FileSet(false);
-
- [TaskFileSet("modules")]
- FileSet _modules = new FileSet(false);
-
- [TaskFileSet("sources")]
- FileSet _sources = new FileSet(true); // include all by default
-
- public string Output { get { return _output; } }
- public string OutputTarget { get { return _target; } }
- public bool Debug { get { return Convert.ToBoolean(_debug); } }
- public string Define { get { return _define; } }
- public string Win32Icon { get { return _win32icon; } }
- public FileSet References { get { return _references; } }
- public FileSet Resources { get { return _resources; } }
- public FileSet Modules { get { return _modules; } }
- public FileSet Sources { get { return _sources; } }
-
- public override string ProgramFileName { get { return Name; } }
- public override string ProgramArguments { get { return "@" + _responseFileName; } }
-
- protected virtual void WriteOptions(TextWriter writer) {
- }
-
- protected virtual void WriteOption(TextWriter writer, string name) {
- writer.WriteLine("/{0}", name);
- }
-
- protected virtual void WriteOption(TextWriter writer, string name, string arg) {
- writer.WriteLine("/{0}:{1}", name, arg);
- }
-
- protected string GetOutputPath() {
- return Path.GetFullPath(Path.Combine(BaseDirectory, Project.ExpandText(Output)));
- }
-
- protected virtual bool NeedsCompiling() {
- // return true as soon as we know we need to compile
-
- FileInfo outputFileInfo = new FileInfo(GetOutputPath());
- if (!outputFileInfo.Exists) {
- return true;
- }
-
- if (FileSet.MoreRecentLastWriteTime(Sources.FileNames, outputFileInfo.LastWriteTime)) {
- return true;
- }
- if (FileSet.MoreRecentLastWriteTime(References.FileNames, outputFileInfo.LastWriteTime)) {
- return true;
- }
- if (FileSet.MoreRecentLastWriteTime(Modules.FileNames, outputFileInfo.LastWriteTime)) {
- return true;
- }
-
- // if we made it here then we don't have to recompile
- return false;
- }
-
- protected override void ExecuteTask() {
- if (NeedsCompiling()) {
- // create temp response file to hold compiler options
- _responseFileName = Path.GetTempFileName();
- StreamWriter writer = new StreamWriter(_responseFileName);
-
- try {
- if (References.BaseDirectory == null) {
- References.BaseDirectory = BaseDirectory;
- }
- if (Modules.BaseDirectory == null) {
- Modules.BaseDirectory = BaseDirectory;
- }
- if (Sources.BaseDirectory == null) {
- Sources.BaseDirectory = BaseDirectory;
- }
-
- Log.WriteLine(LogPrefix + "Compiling {0} files to {1}", Sources.FileNames.Count, GetOutputPath());
-
- // specific compiler options
- WriteOptions(writer);
-
- // Microsoft common compiler options
- WriteOption(writer, "nologo");
- WriteOption(writer, "target", OutputTarget);
- WriteOption(writer, "out", GetOutputPath());
- if (Debug) {
- WriteOption(writer, "debug");
- WriteOption(writer, "define", "DEBUG");
- WriteOption(writer, "define", "TRACE");
- }
- if (Define != null) {
- WriteOption(writer, "define", Define);
- }
- if (Win32Icon != null) {
- WriteOption(writer, "win32icon", Win32Icon);
- }
- foreach (string fileName in References.FileNames) {
- WriteOption(writer, "reference", fileName);
- }
- foreach (string fileName in Modules.FileNames) {
- WriteOption(writer, "addmodule", fileName);
- }
- foreach (string fileName in Resources.FileNames) {
- WriteOption(writer, "resource", fileName);
- }
- foreach (string fileName in Sources.FileNames) {
- writer.WriteLine(fileName);
- }
- // Make sure to close the response file otherwise contents
- // will not be written to disc and EXecuteTask() will fail.
- writer.Close();
-
- if (Verbose) {
- // display response file contents
- Log.WriteLine(LogPrefix + "Contents of " + _responseFileName);
- /*
- StreamReader reader = File.OpenText(_responseFileName);
- string line = reader.ReadLine();
- while (line != null) {
- Log.WriteLine(LogPrefix + " " + line);
- line = reader.ReadLine();
- }
- reader.Close();
- */
-
- StreamReader reader = File.OpenText(_responseFileName);
- Log.WriteLine(reader.ReadToEnd());
- reader.Close();
-
- }
-
- // call base class to do the work
- base.ExecuteTask();
-
- } finally {
- // make sure we delete response file even if an exception is thrown
- writer.Close(); // make sure stream is closed or file cannot be deleted
- File.Delete(_responseFileName);
- _responseFileName = null;
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/CopyTask.cs b/mcs/nant/src/Tasks/CopyTask.cs
deleted file mode 100755
index 849eb023f9e..00000000000
--- a/mcs/nant/src/Tasks/CopyTask.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Xml;
- using System.Text;
- using System.Collections;
- using System.Collections.Specialized;
-
- [TaskName("copy")]
- public class CopyTask : Task {
-
- [TaskAttribute("file")]
- string _sourceFile = null;
-
- [TaskAttribute("tofile")]
- string _toFile = null;
-
- [TaskAttribute("todir")]
- string _toDirectory = null;
-
- [TaskAttribute("filtering")]
- [BooleanValidator()]
- string _filtering = Boolean.FalseString;
-
- [TaskAttribute("flatten")]
- [BooleanValidator()]
- string _flatten = Boolean.FalseString;
-
- [TaskAttribute("includeEmptyDirs")]
- [BooleanValidator()]
- string _includeEmptyDirs = Boolean.FalseString;
-
- [TaskFileSet("fileset")]
- FileSet _fileset = new FileSet(true); // include all by default
-
- [TaskAttribute("overwrite")]
- [BooleanValidator()]
- string _overwrite = Boolean.FalseString;
-
- [TaskAttribute("verbose")]
- [BooleanValidator()]
- string _verbose = Boolean.FalseString;
-
- [TaskAttribute("preserveLastModified")]
- [BooleanValidator()]
- string _preserveLastModified = Boolean.FalseString;
-
- Hashtable _fileCopyMap = new Hashtable();
-
- public string SourceFile { get { return _sourceFile; } }
- public string ToFile { get { return _toFile; } }
- public string ToDirectory { get { return _toDirectory; } }
- public bool Filtering { get { return Convert.ToBoolean(_filtering); } }
- public bool Flatten { get { return Convert.ToBoolean(_flatten); } }
- public bool IncludeEmptyDirs { get { return Convert.ToBoolean(_includeEmptyDirs); } }
- public bool Overwrite { get { return Convert.ToBoolean(_overwrite); } }
- public bool PreserveLastModified{ get { return Convert.ToBoolean(_preserveLastModified); } }
- public FileSet CopyFileSet { get { return _fileset; } }
-
- public bool Verbose {
- get {
- return (Project.Verbose || Convert.ToBoolean(_verbose));
- }
- }
-
- protected Hashtable FileCopyMap {
- get { return _fileCopyMap; }
- }
-
- /// <summary>
- /// Actually does the file (and possibly empty directory) copies.
- /// </summary>
- protected virtual void DoFileOperations() {
- int fileCount = FileCopyMap.Keys.Count;
- if (fileCount > 0) {
- if (ToDirectory != null) {
- Log.WriteLine(LogPrefix + "Copying {0} files to {1}", fileCount, Project.GetFullPath(ToDirectory));
- } else {
- Log.WriteLine(LogPrefix + "Copying {0} files", fileCount);
- }
-
- // loop thru our file list
- foreach (string sourcePath in FileCopyMap.Keys) {
- string dstPath = (string)FileCopyMap[sourcePath];
- if (sourcePath == dstPath) {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Skipping self-copy of {0}" + sourcePath);
- }
- continue;
- }
-
- try {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Copying {0} to {1}", sourcePath, dstPath);
- }
-
- // create directory if not present
- string dstDirectory = Path.GetDirectoryName(dstPath);
- if (!Directory.Exists(dstDirectory)) {
- Directory.CreateDirectory(dstDirectory);
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Created directory {0}", dstDirectory);
- }
- }
-
- File.Copy(sourcePath, dstPath, true);
- } catch (IOException ioe) {
- string msg = String.Format("Cannot copy {0} to {1}", sourcePath, dstPath);
- throw new BuildException(msg, Location, ioe);
- }
- }
- }
-
- // TODO: handle empty directories in the fileset, refer to includeEmptyDirs attribute at
- // http://jakarta.apache.org/ant/manual/CoreTasks/copy.html
- }
-
- protected override void ExecuteTask() {
-
- string dstDirectoryPath = Project.GetFullPath(ToDirectory);
- string srcFilePath = Project.GetFullPath(SourceFile);
- FileInfo srcInfo = new FileInfo(srcFilePath);
-
- string dstFilePath;
- if (ToFile == null) {
- dstFilePath = dstDirectoryPath + Path.DirectorySeparatorChar + srcInfo.Name;
- } else {
- dstFilePath = Project.GetFullPath(ToFile);
- }
-
- FileInfo dstInfo = new FileInfo(dstFilePath);
- if (SourceFile != null) {
- if (srcInfo.Exists) {
- // do the outdated check
- bool outdated = (!dstInfo.Exists) || (srcInfo.LastWriteTime > dstInfo.LastWriteTime);
-
- if (Overwrite || outdated) {
- // add to a copy map of absolute verified paths
- FileCopyMap.Add(srcFilePath, dstFilePath);
- }
- } else {
- Log.WriteLine(LogPrefix + "Could not find file {0} to copy.", srcFilePath);
- }
- } else {
- // get the complete path of the base directory of the fileset, ie, c:\work\nant\src
- string srcBasePath = Project.GetFullPath(CopyFileSet.BaseDirectory);
- string dstBasePath = Project.GetFullPath(ToDirectory);
-
- // if source file not specified use fileset
- foreach (string pathname in CopyFileSet.FileNames) {
- // replace the fileset path with the destination path
- // NOTE: big problems could occur if the file set base dir is rooted on a different drive
- string dstPath = pathname.Replace(srcBasePath, dstBasePath);
-
- srcInfo = new FileInfo(pathname);
- dstInfo = new FileInfo(dstPath);
-
- if (srcInfo.Exists) {
- // do the outdated check
- bool outdated = (!dstInfo.Exists) || (srcInfo.LastWriteTime > dstInfo.LastWriteTime);
-
- if (Overwrite || outdated) {
- FileCopyMap.Add(pathname, dstPath);
- }
- } else {
- Log.WriteLine(LogPrefix + "Could not find file {0} to copy.", srcFilePath);
- }
- }
- }
-
- // do all the actual copy operations now...
- DoFileOperations();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/CscTask.cs b/mcs/nant/src/Tasks/CscTask.cs
deleted file mode 100755
index 202082bcd8d..00000000000
--- a/mcs/nant/src/Tasks/CscTask.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("csc")]
- public class CscTask : CompilerBase {
-
- // C# specific compiler options
- [TaskAttribute("doc")]
- string _doc = null;
-
- protected override void WriteOptions(TextWriter writer) {
- WriteOption(writer, "fullpaths");
- if (_doc != null) {
- WriteOption(writer, "doc", _doc);
- }
- }
-
- protected override bool NeedsCompiling() {
- // TODO: add checks for any referenced files OR return false to always compile
- return base.NeedsCompiling();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/DeleteTask.cs b/mcs/nant/src/Tasks/DeleteTask.cs
deleted file mode 100755
index 4d4abf25149..00000000000
--- a/mcs/nant/src/Tasks/DeleteTask.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-
-// TODO: move this into the task documentation (once we figure out how tasks
-// should be documented - xml??
-/*
-
-verbose: Show name of each deleted file ("true"/"false"). Default is "false"
-when omitted.
-
-quiet: If the file does not exist, do not display a diagnostic message or
-modify the exit status to reflect an error (unless Ant has been invoked with
-the -verbose or -debug switches). This means that if a file or directory cannot
-be deleted, then no error is reported. This setting emulates the -f option to
-the Unix "rm" command. ("true"/"false"). Default is "false" meaning things are
-"noisy". Setting this to true, implies setting failonerror to false.
-
-failonerror: This flag (which is only of relevance if 'quiet' is false),
-controls whether an error -such as a failure to delete a file- stops the build
-task, or is merely reported to the screen. The default is "true"
-
-*/
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("delete")]
- public class DeleteTask : Task {
-
- [TaskAttribute("file")]
- string _file = null;
-
- [TaskAttribute("dir")]
- string _dir = null;
-
- [TaskAttribute("verbose")]
- [BooleanValidator()]
- string _verbose = Boolean.FalseString;
-
- [TaskAttribute("failonerror")]
- [BooleanValidator()]
- string _failOnError = Boolean.TrueString;
-
- /// <summary>If true then delete empty directories when using filesets.</summary>
- [TaskAttribute("includeEmptyDirs")]
- [BooleanValidator()]
- string _includeEmptyDirs = Boolean.FalseString;
-
- [TaskFileSet("fileset")]
- FileSet _fileset = new FileSet(false);
-
- public string FileName { get { return _file; } }
- public string DirectoryName { get { return _dir; } }
- public bool FailOnError { get { return Convert.ToBoolean(_failOnError); } }
- public bool IncludeEmptyDirectories { get { return Convert.ToBoolean(_includeEmptyDirs); } }
- public FileSet DeleteFileSet { get { return _fileset; } }
-
- public bool Verbose {
- get {
- return (Project.Verbose || Convert.ToBoolean(_verbose));
- }
- }
-
- protected override void ExecuteTask() {
-
- // limit task to deleting either a file or a directory or a file set
- if (FileName != null && DirectoryName != null) {
- throw new BuildException("Cannot specify 'file' and 'dir' in the same delete task", Location);
- }
-
- // try to delete specified file
- if (FileName != null) {
- string path = null;
- try {
- path = Project.GetFullPath(FileName);
- } catch (Exception e) {
- string msg = String.Format("Could not determine path from {0}", FileName);
- throw new BuildException(msg, Location, e);
- }
- DeleteFile(path);
-
- // try to delete specified directory
- } else if (DirectoryName != null) {
- string path = null;
- try {
- path = Project.GetFullPath(DirectoryName);
- } catch (Exception e) {
- string msg = String.Format("Could not determine path from {0}", DirectoryName);
- throw new BuildException(msg, Location, e);
- }
- DeleteDirectory(path);
-
- // delete files/directories in fileset
- } else {
- // only use the file set if file and dir attributes have NOT been set
- foreach (string path in DeleteFileSet.FileNames) {
- DeleteFile(path);
- }
-
- if (IncludeEmptyDirectories) {
- foreach (string path in DeleteFileSet.DirectoryNames) {
- // only delete EMPTY directories (no files, no directories)
- DirectoryInfo dirInfo = new DirectoryInfo(path);
-
- if ((dirInfo.GetFiles().Length == 0) && (dirInfo.GetDirectories().Length == 0)) {
- DeleteDirectory(path);
- }
- }
- }
- }
- }
-
- void DeleteDirectory(string path) {
- try {
- if (Directory.Exists(path)) {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Deleting directory {0}", path);
- }
- if (path.Length > 10) {
- Directory.Delete(path, true);
- } else {
- // TODO: remove this once this task is fully tested and NAnt is at 1.0
- Console.WriteLine(LogPrefix + "Path {0} is too close to root to delete this early in development", path);
- }
- } else {
- throw new DirectoryNotFoundException();
- }
- } catch (Exception e) {
- if (FailOnError) {
- string msg = String.Format("Cannot delete directory {0}", path);
- throw new BuildException(msg, Location, e);
- }
- }
- }
-
- void DeleteFile(string path) {
- try {
- if (File.Exists(path)) {
- if (Verbose) {
- Log.WriteLine(LogPrefix + "Deleting file {0}", path);
- }
- File.Delete(path);
- } else {
- throw new FileNotFoundException();
- }
- } catch (Exception e) {
- if (FailOnError) {
- string msg = String.Format("Cannot delete file {0}", path);
- throw new BuildException(msg, Location, e);
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/EchoTask.cs b/mcs/nant/src/Tasks/EchoTask.cs
deleted file mode 100755
index 871a4385b10..00000000000
--- a/mcs/nant/src/Tasks/EchoTask.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- [TaskName("echo")]
- public class EchoTask : Task {
-
- [TaskAttribute("message", Required=true)]
- string _message = null;
-
- protected override void ExecuteTask() {
- Log.WriteLine(LogPrefix + _message);
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/ExecTask.cs b/mcs/nant/src/Tasks/ExecTask.cs
deleted file mode 100755
index 747c8ab5f46..00000000000
--- a/mcs/nant/src/Tasks/ExecTask.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("exec")]
- public class ExecTask : ExternalProgramBase {
-
- [TaskAttribute("program", Required=true)]
- string _program = null;
-
- [TaskAttribute("commandline")]
- string _commandline = null;
-
- [TaskAttribute("basedir")]
- string _baseDirectory = null;
-
- // Stop the buildprocess if the command exits with a returncode other than 0.
- [TaskAttribute("failonerror")]
- [BooleanValidator()]
- string _failonerror = Boolean.TrueString;
-
- // TODO: change this to Int32Parameter to ensure value is a valid Int32 type after text expansion
- [TaskAttribute("timeout")]
- [Int32Validator()]
- string _timeout = Int32.MaxValue.ToString();
-
- public override string ProgramFileName { get { return Project.GetFullPath(_program); } }
- public override string ProgramArguments { get { return _commandline; } }
- public override string BaseDirectory { get { return Project.GetFullPath(_baseDirectory); } }
- public override int TimeOut { get { return Convert.ToInt32(_timeout); } }
- public override bool FailOnError { get { return Convert.ToBoolean(_failonerror); } }
-
- protected override void ExecuteTask() {
- Log.WriteLine(LogPrefix + "{0} {1}", Path.GetFileName(ProgramFileName), GetCommandLine());
- base.ExecuteTask();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/ExternalProgramBase.cs b/mcs/nant/src/Tasks/ExternalProgramBase.cs
deleted file mode 100755
index 0bc938177a2..00000000000
--- a/mcs/nant/src/Tasks/ExternalProgramBase.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
- using System.Text;
- using System.Xml;
-
- public abstract class ExternalProgramBase : Task {
-
- [TaskAttribute("verbose")]
- [BooleanValidator()]
- string _verbose = Boolean.FalseString;
-
- public abstract string ProgramFileName { get; }
- public abstract string ProgramArguments { get; }
-
- public virtual string BaseDirectory {
- get {
- if (Project != null) {
- return Project.BaseDirectory;
- } else {
- return null;
- }
- }
- }
-
- public virtual int TimeOut {
- get { return Int32.MaxValue; }
- }
-
- public virtual bool FailOnError {
- get { return true; }
- }
-
- public bool Verbose {
- get {
- return (Project.Verbose || Convert.ToBoolean(_verbose));
- }
- }
-
- StringCollection _args = new StringCollection();
-
- protected override void InitializeTask(XmlNode taskNode) {
- // initialize the _args collection
- foreach (XmlNode optionNode in taskNode.SelectNodes("arg")) {
-
- // TODO: decide if we should enforce arg elements not being able
- // to accept a file and value attribute on the same element.
- // Ideally this would be down via schema and since it doesn't
- // really hurt for now I'll leave it in.
-
- XmlNode valueNode = optionNode.SelectSingleNode("@value");
- if (valueNode != null) {
- _args.Add(Project.ExpandText(valueNode.Value));
- }
-
- XmlNode fileNode = optionNode.SelectSingleNode("@file");
- if (fileNode != null) {
- _args.Add(Project.GetFullPath(Project.ExpandText(fileNode.Value)));
- }
- }
- }
-
- public string GetCommandLine() {
- // append any nested <arg> arguments to command line
- StringBuilder arguments = new StringBuilder(ProgramArguments);
- foreach (string arg in _args) {
- arguments = arguments.Append(' ');
- arguments = arguments.Append(arg);
- }
- return arguments.ToString();
- }
-
- protected override void ExecuteTask() {
- try {
- // create process to launch compiler (redirect standard output to temp buffer)
- Process process = new Process();
- process.StartInfo.FileName = ProgramFileName;
- process.StartInfo.Arguments = GetCommandLine();
- process.StartInfo.RedirectStandardOutput = true;
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.WorkingDirectory = BaseDirectory;
- if (Verbose) {
- Log.WriteLine(LogPrefix + "{0}>{1} {2}", process.StartInfo.WorkingDirectory, process.StartInfo.FileName, process.StartInfo.Arguments);
- }
- process.Start();
-
- // display standard output
- StreamReader reader = process.StandardOutput;
- string output = reader.ReadToEnd();
- if (output.Length > 0) {
- int indentLevel = Log.IndentLevel;
- Log.IndentLevel = 0;
- Log.WriteLine(output);
- Log.IndentLevel = indentLevel;
- }
-
- // wait for program to exit
- process.WaitForExit(TimeOut);
-
- if (FailOnError && process.ExitCode != 0) {
- throw new BuildException("Program error, see build log for details.");
- }
- } catch (Exception e) {
- throw new BuildException(e.Message, Location, e);
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/FailTask.cs b/mcs/nant/src/Tasks/FailTask.cs
deleted file mode 100755
index 2e6b7161fb5..00000000000
--- a/mcs/nant/src/Tasks/FailTask.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- [TaskName("fail")]
- public class FailTask : Task {
-
- [TaskAttribute("message")]
- string _message = null;
-
- protected override void ExecuteTask() {
- string message = _message;
- if (message == null) {
- message = "No message";
- }
- throw new BuildException(message);
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/IncludeTask.cs b/mcs/nant/src/Tasks/IncludeTask.cs
deleted file mode 100755
index 637c3dabb5e..00000000000
--- a/mcs/nant/src/Tasks/IncludeTask.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Ian MacLean (ian_maclean@another.com)
-
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Xml;
- using System.Collections;
- using System.Collections.Specialized;
-
- /// <summary>
- /// Summary description for IncludeTask.
- /// </summary>
-
- [TaskName("include")] // TODO make into ant:include
- public class IncludeTask : Task {
-
- /// <summary>hours to to add to the sleep time</summary>
- [TaskAttribute("href", Required=true)]
- string _href = null;
-
- // Attribute properties
- public string Href { get { return _href; } }
-
- XPathTextPositionMap _positionMap; // created when Xml document is loaded
- TaskCollection _tasks = new TaskCollection();
-
- // static members
- static System.Collections.Stack _includesStack = new Stack();
- static bool IsIncluded( string href ) {
- bool result = false;
- IEnumerator stackenum = _includesStack.GetEnumerator();
- while ( stackenum.MoveNext()) {
- if ( href == (string)stackenum.Current ) {
- result = true; break;
- }
- }
- return result;
- }
-
- protected void InitializeIncludedDocument(XmlDocument doc) {
-
- // Load line Xpath to linenumber array
- _positionMap = new XPathTextPositionMap(doc.BaseURI);
-
- // process all the non-target nodes (these are global tasks for the project)
- XmlNodeList taskList = doc.SelectNodes("project/*[name() != 'target']");
- foreach (XmlNode taskNode in taskList) {
-
- // TODO: do somethiing like Project.CreateTask(taskNode) and have the project set the location
- TextPosition textPosition = _positionMap.GetTextPosition(taskNode);
-
- Task task = Project.CreateTask(taskNode);
- if (task != null) {
- // Store a local copy also so we can execute only those
- _tasks.Add(task);
- }
- }
-
- // execute global tasks now - before anything else
- // this lets us include tasks that do things like add more tasks
- // Here is where we should check for recursive dependencies
- //
- foreach (Task task in _tasks ) {
- task.Execute();
- }
-
- // process all the targets
- XmlNodeList targetList = doc.SelectNodes("project/target");
- foreach (XmlNode targetNode in targetList) {
- Target target = new Target(Project);
- target.Initialize(targetNode);
- Project.Targets.Add(target);
- }
- }
-
- /// <summary>
- /// verify parameters
- ///</summary>
- ///<param name="taskNode"> taskNode used to define this task instance </param>
- protected override void InitializeTask(XmlNode taskNode) {
-
- //TODO check where we are in document - if not at top level then bail out on error ...
- // basic recursion check
- if (IsIncluded( Project.GetFullPath(Href) )) {
- throw new BuildException("Recursive includes are not allowed", Location);
- }
- }
-
- protected override void ExecuteTask() {
-
- string fullpath = Project.GetFullPath(Href);
- // push ourselves onto the stack
- _includesStack.Push(fullpath);
- try {
-
- XmlDocument doc = new XmlDocument();
-
- // Handle local file case
- doc.Load(fullpath);
-
- InitializeIncludedDocument(doc);
- }
- // Handling the case where a nested include causes an exception during initialization
- catch ( BuildException ) {
- throw;
- }
- catch ( Exception e) {
- throw new BuildException(e.Message, Location, e);
- }
- finally {
- // Pop off the stack
- _includesStack.Pop();
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/JscTask.cs b/mcs/nant/src/Tasks/JscTask.cs
deleted file mode 100755
index e2944122aa7..00000000000
--- a/mcs/nant/src/Tasks/JscTask.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("jsc")]
- public class JscTask : CompilerBase {
-
- // TODO: add JScript.NET specific compiler options here (see CscTask)
-
- protected override void WriteOptions(TextWriter writer) {
- // TODO: add support for compiler specific options
- }
-
- protected override bool NeedsCompiling() {
- // TODO: add checks for any referenced files OR return false to always compile
- return base.NeedsCompiling();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/McsTask.cs b/mcs/nant/src/Tasks/McsTask.cs
deleted file mode 100644
index 3c5a0ee3f08..00000000000
--- a/mcs/nant/src/Tasks/McsTask.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2002 Ximian, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Martin Baulig (martin@gnome.org)
-
-using System;
-using System.IO;
-
-namespace SourceForge.NAnt
-{
-
- [TaskName("mcs")]
- public class McsTask : CompilerBase
- {
- protected override void WriteOption(TextWriter writer, string name) {
- if (name.Equals("nologo")) {
- return;
- } else {
- writer.WriteLine("--{0}", name);
- }
- }
-
- protected override void WriteOption(TextWriter writer, string name, string arg) {
- if (name.Equals("out")) {
- writer.WriteLine("-o {0}", arg);
- } else if (name.Equals("reference")) {
- writer.WriteLine("-r {0}", arg);
- } else {
- writer.WriteLine("--{0} {1}", name, arg);
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/MkDirTask.cs b/mcs/nant/src/Tasks/MkDirTask.cs
deleted file mode 100755
index fca374b3408..00000000000
--- a/mcs/nant/src/Tasks/MkDirTask.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- /// <summary>Creates a directory and any non-existent parent directories when necessary.</summary>
- [TaskName("mkdir")]
- public class MkDirTask : Task {
-
- [TaskAttribute("dir", Required=true)]
- string _dir = null; // the directory to create
-
- protected override void ExecuteTask() {
- try {
- string directory = Project.GetFullPath(_dir);
- if (!Directory.Exists(directory)) {
- Log.WriteLine(LogPrefix + "Creating directory {0}", directory);
- DirectoryInfo result = Directory.CreateDirectory(directory);
- if (result == null) {
- string msg = String.Format("Unknown error creating directory '{0}'", directory);
- throw new BuildException(msg, Location);
- }
- }
- } catch (Exception e) {
- throw new BuildException(e.Message, Location, e);
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/MoveTask.cs b/mcs/nant/src/Tasks/MoveTask.cs
deleted file mode 100755
index 2b63014ef0b..00000000000
--- a/mcs/nant/src/Tasks/MoveTask.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("move")]
- public class MoveTask : CopyTask {
-
- /// <summary>
- /// Actually does the file (and possibly empty directory) copies.
- /// </summary>
- protected override void DoFileOperations() {
- if (FileCopyMap.Count > 0) {
-
- // loop thru our file list
- foreach (string sourcePath in FileCopyMap.Keys) {
- string destinationPath = (string)FileCopyMap[sourcePath];
- if (sourcePath == destinationPath) {
- Log.WriteLine(LogPrefix + "Skipping self-move of {0}" + sourcePath);
- continue;
- }
-
- try {
- // check if directory exists
- if (Directory.Exists(sourcePath)) {
- Log.WriteLine(LogPrefix + "moving directory {0} to {1}", sourcePath, destinationPath);
- Directory.Move(sourcePath, destinationPath);
- }
- else {
-
- DirectoryInfo todir = new DirectoryInfo(destinationPath);
- if ( !todir.Exists ) {
- Directory.CreateDirectory( Path.GetDirectoryName(destinationPath) );
- }
-
- Log.WriteLine(LogPrefix + "Moving {0} to {1}", sourcePath, destinationPath);
- // IM look into how Ant does this for directories
- File.Move(sourcePath, destinationPath);
- }
-
- } catch (IOException ioe) {
- string msg = String.Format("Failed to move {0} to {1}\n{2}", sourcePath, destinationPath, ioe.Message);
- throw new BuildException(msg, Location);
- }
- }
- }
- }
- }
-}
-
-
diff --git a/mcs/nant/src/Tasks/NantTask.cs b/mcs/nant/src/Tasks/NantTask.cs
deleted file mode 100755
index 1462ae97097..00000000000
--- a/mcs/nant/src/Tasks/NantTask.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections.Specialized;
- using System.Diagnostics;
- using System.IO;
- using System.Xml;
-
- [TaskName("nant")]
- public class NantTask : Task {
-
- [TaskAttribute("buildfile")]
- string _buildFileName = null;
-
- [TaskAttribute("basedir")]
- string _baseDirectory = null;
-
- // TODO: add support for multiple targets
- [TaskAttribute("target")]
- string _target = null;
-
- protected override void ExecuteTask() {
- string directory = Project.GetFullPath(_baseDirectory);
- string buildFileName = _buildFileName;
- if (buildFileName == null) {
- buildFileName = Project.FindBuildFileName(directory);
- }
-
- try {
- Log.WriteLine(LogPrefix + "{0} {1}", buildFileName, _target);
- Log.Indent();
- Project project = new Project();
- project.BaseDirectory = directory;
- project.BuildFileName = buildFileName;
- if (_target != null) {
- project.BuildTargets.Add(_target);
- }
- if (!project.Run()) {
- throw new BuildException("Nested build failed - refer to build log for exact reason.");
- }
- } finally {
- Log.Unindent();
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/PropertyTask.cs b/mcs/nant/src/Tasks/PropertyTask.cs
deleted file mode 100755
index 90933ca78ac..00000000000
--- a/mcs/nant/src/Tasks/PropertyTask.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
-
- [TaskName("property")]
- public class PropertyTask : Task {
-
- [TaskAttribute("name", Required=true)]
- string _name = null;
-
- [TaskAttribute("value", Required=true)]
- string _value = String.Empty;
-
- protected override void ExecuteTask() {
- Project.Properties[_name] = _value;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Tasks/SleepTask.cs b/mcs/nant/src/Tasks/SleepTask.cs
deleted file mode 100755
index d6c69cc90b1..00000000000
--- a/mcs/nant/src/Tasks/SleepTask.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Ian MacLean (ian_maclean@another.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Xml;
- using System.Threading;
-
- /// <summary>
- /// A task for sleeping a short period of time, useful when a build or deployment process
- /// requires an interval between tasks.
- /// </summary>
-
- [TaskName("sleep")]
- public class SleepTask : Task {
-
- /// <summary>hours to to add to the sleep time</summary>
- [TaskAttribute("hours")]
- string _hours = null;
-
- /// <summary>minutes to add to the sleep time</summary>
- [TaskAttribute("minutes")]
- string _minutes = 0.ToString();
-
- /// <summary>seconds to add to the sleep time</summary>
- [TaskAttribute("seconds")]
- string _seconds = 0.ToString();
-
- /// <summary>milliseconds to add to the sleep time</summary>
- [TaskAttribute("milliseconds")]
- string _milliseconds = 0.ToString();
-
- /// <summary>flag controlling whether to break the build on an error</summary>
- [TaskAttribute("failonerror")]
- [BooleanValidator()]
- string _failonerror = Boolean.FalseString;
-
- // Attribute properties
- public int Hours { get { return Convert.ToInt32(_hours); } }
- public int Minutes { get { return Convert.ToInt32(_minutes); } }
- public int Seconds { get { return Convert.ToInt32(_seconds); } }
- public int Milliseconds { get { return Convert.ToInt32(_milliseconds); } }
- public bool FailOnError { get { return Convert.ToBoolean(_failonerror); } }
-
- ///return time to sleep
- private int GetSleepTime() {
- return ((((int) Hours * 60) + Minutes) * 60 + Seconds) * 1000 + Milliseconds;
- }
-
- ///<summary> return time to sleep </summary>
- ///<param name="millis"> </param>
- private void DoSleep(int millis ) {
- Thread.Sleep(millis);
- }
-
- /// <summary>
- /// verify parameters
- ///</summary>
- ///<param name="taskNode"> taskNode used to define this task instance </param>
- protected override void InitializeTask(XmlNode taskNode) {
- if (GetSleepTime() < 0) {
- throw new BuildException("Negative sleep periods are not supported", Location);
- }
- }
-
- protected override void ExecuteTask() {
- int sleepTime = GetSleepTime();
- Log.WriteLine(LogPrefix + "sleeping for {0} milliseconds", sleepTime);
- DoSleep(sleepTime);
- }
- }
-}
-
-
diff --git a/mcs/nant/src/Tasks/StyleTask.cs b/mcs/nant/src/Tasks/StyleTask.cs
deleted file mode 100755
index 05117217d0b..00000000000
--- a/mcs/nant/src/Tasks/StyleTask.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Serge (serge@wildwestsoftware.com)
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Xml;
- using System.Xml.Xsl;
- using System.Xml.XPath;
- using System.Text.RegularExpressions;
-
- [TaskName("style")]
- public class StyleTask : Task {
-
- // TODO: consider prefixing private fields with _ to stay consistent (gs)
-
- [TaskAttribute("basedir", Required=false)]
- string baseDir = null;
-
- [TaskAttribute("destdir", Required=false)]
- string destDir = null;
-
- [TaskAttribute("extension", Required=false)]
- string extension = "html";
-
- [TaskAttribute("style", Required=true)]
- string xsltFile = null;
-
- [TaskAttribute("in", Required=true)]
- string srcFile = null;
-
- [TaskAttribute("out", Required=false)]
- string destFile = null;
-
- private static string GetPath(string dir, string file) {
- // TODO: remove platform dependencies by using System.IO.Path (gs)
- string d = (dir == null)
- ? ""
- : Regex.Replace(dir, "/", "\\");
-
- return (d==null || d=="")
- ? (file==null || file=="") ? "" : file
- : d.EndsWith("\\")
- ? d +file : d + "\\" + file;
- }
-
- private XmlReader CreateXmlReader(string dir, string file) {
- string xmlPath = GetPath(dir, file);
- XmlTextReader xmlReader = null;
-
- try {
- xmlReader = new XmlTextReader(new FileStream(xmlPath, FileMode.Open));
- } catch (Exception) {
- xmlReader = null;
- }
-
- return xmlReader;
- }
-
- private XmlWriter CreateXmlWriter(string dir, string file) {
- string xmlPath = GetPath(dir, file);
-
- XmlWriter xmlWriter = null;
-
- string targetDir = Path.GetDirectoryName(Path.GetFullPath(xmlPath));
- if (targetDir != null && targetDir != "" && !Directory.Exists(targetDir)) {
- Directory.CreateDirectory(targetDir);
- }
-
- try {
- // UTF-8 encoding will be used
- xmlWriter = new XmlTextWriter(xmlPath, null);
- } catch (Exception) {
- xmlWriter = null;
- }
-
- return xmlWriter;
- }
-
- protected override void ExecuteTask() {
- string destFile = this.destFile;
-
- if (destFile == null || destFile == "") {
- // TODO: use System.IO.Path (gs)
- string ext = extension[0]=='.'
- ? extension
- : "." + extension;
-
- int extPos = srcFile.LastIndexOf('.');
-
- if (extPos == -1) {
- destFile = srcFile + ext;
- } else {
- destFile = srcFile.Substring(0, extPos) + ext;
- }
- }
-
- string srcPath = GetPath(baseDir, srcFile);
- string destPath = GetPath(destDir, destFile);
- string xsltPath = GetPath(baseDir, xsltFile);
-
- FileInfo srcInfo = new FileInfo(srcPath);
- FileInfo destInfo = new FileInfo(destPath);
- FileInfo xsltInfo = new FileInfo(xsltPath);
-
- if (!srcInfo.Exists) {
- throw new BuildException("Unable to find source xml file.");
- }
- if (!xsltInfo.Exists) {
- throw new BuildException("Unable to find stylesheet file.");
- }
-
- bool destOutdated = !destInfo.Exists
- || srcInfo.LastWriteTime > destInfo.LastWriteTime
- || xsltInfo.LastWriteTime > destInfo.LastWriteTime;
-
- if (destOutdated) {
- XmlReader xmlReader = CreateXmlReader(baseDir, srcFile);
- XmlReader xslReader = CreateXmlReader(baseDir, xsltFile);
- XmlWriter xmlWriter = CreateXmlWriter(destDir, destFile);
-
- Log.WriteLine(LogPrefix + "Transforming into " + Path.GetFullPath(destDir));
-
- // TODO: remove assignments from conditional statement (gs)
- if (xmlReader != null && xslReader != null && xmlWriter != null) {
- XslTransform xslt = new XslTransform();
- XPathDocument xml = new XPathDocument(xmlReader);
-
- Log.WriteLine(LogPrefix + "Loading stylesheet " + Path.GetFullPath(xsltPath));
- try {
- xslt.Load(xslReader);
- } catch (XsltCompileException xce) {
- throw new BuildException(xce.Message, xce);
- } catch (Exception e) {
- throw new BuildException(e.Message, e);
- }
-
- Log.WriteLine(LogPrefix + "Processing " + Path.GetFullPath(srcPath) + " to " + Path.GetFullPath(destPath));
- try {
- xslt.Transform(xml, null, xmlWriter);
- } catch (Exception e) {
- throw new BuildException(e.Message, e);
- }
- } else {
- // not sure how to deal with this...
- // TODO: remove this statement or do something useful (gs)
- // Can this condition occur? I would have thought
- // that an exception would be thrown. (gs)
- }
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/TStampTask.cs b/mcs/nant/src/Tasks/TStampTask.cs
deleted file mode 100755
index 1806a3040c4..00000000000
--- a/mcs/nant/src/Tasks/TStampTask.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- /// <remarks>
- /// Sets the following properties:
- /// <ul>
- /// <li>nant.dateStamp to yyyyMMdd</li>
- /// <li>nant.timeStamp to HHmm</li>
- /// <li>nant.today using default DataTime.ToString() method</li>
- /// </ul>
- /// </remarks>
- [TaskName("tstamp")]
- public class TStampTask : Task {
- protected override void ExecuteTask() {
- DateTime now = DateTime.Now;
- Log.WriteLine(LogPrefix + now.ToString());
- Project.Properties["nant.dstamp"] = now.ToString("yyyyMMdd");
- Project.Properties["nant.tstamp"] = now.ToString("HHmm");
- Project.Properties["nant.today"] = now.ToString();
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/TaskDefTask.cs b/mcs/nant/src/Tasks/TaskDefTask.cs
deleted file mode 100755
index 4c7eca7be4f..00000000000
--- a/mcs/nant/src/Tasks/TaskDefTask.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("taskdef")]
- public class TaskDefTask : Task {
-
- [TaskAttribute("assembly", Required=true)]
- string _assemblyFileName = null;
-
- protected override void ExecuteTask() {
- string assemblyFileName = Project.GetFullPath(_assemblyFileName);
- try {
- int taskCount = Project.AddTasks(assemblyFileName);
- Log.WriteLine(LogPrefix + "Added {0} tasks from {1}", taskCount, assemblyFileName);
- } catch (Exception e) {
- Log.WriteLine(LogPrefix + "Adding tasks from {0}", assemblyFileName);
- throw new BuildException(e.Message, Location, e);
- }
- }
- }
-}
diff --git a/mcs/nant/src/Tasks/VbcTask.cs b/mcs/nant/src/Tasks/VbcTask.cs
deleted file mode 100755
index 4f93787eed8..00000000000
--- a/mcs/nant/src/Tasks/VbcTask.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-// Mike Krueger (mike@icsharpcode.net)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
-
- [TaskName("vbc")]
- public class VbcTask : CompilerBase {
-
- // TODO: add JScript.NET specific compiler options here (see CscTask)
-
- protected override void WriteOptions(TextWriter writer) {
- // TODO: add support for compiler specific options
- }
-
- protected override bool NeedsCompiling() {
- // TODO: add checks for any referenced files OR return false to always compile
- return base.NeedsCompiling();
- }
- }
-}
diff --git a/mcs/nant/src/Util/Log.cs b/mcs/nant/src/Util/Log.cs
deleted file mode 100755
index b875663069d..00000000000
--- a/mcs/nant/src/Util/Log.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.Collections;
- using System.IO;
- using System.Text;
-
- public class TextWriterCollection : ArrayList {
- }
-
- public class Log {
-
- static bool _autoFlush = false;
- static int _indentLevel = 0;
- static int _indentSize = 4;
-
- static TextWriterCollection _listeners;
-
- protected Log() {
- }
-
- ~Log() {
- // make sure we release any open file handles
- Close();
- }
-
- public static bool AutoFlush {
- get { return _autoFlush; }
- set { _autoFlush = value; }
- }
-
- public static int IndentLevel {
- get { return _indentLevel; }
- set { _indentLevel = value; }
- }
-
- public static int IndentSize {
- get { return _indentSize; }
- set { _indentSize = value; }
- }
-
- public static TextWriterCollection Listeners {
- get {
- if (_listeners == null) {
- _listeners = new TextWriterCollection();
- _listeners.Add(Console.Out);
- }
- return _listeners;
- }
- }
-
- public static void Close() {
- foreach (TextWriter writer in Listeners) {
- // never close the Console.Out writer
- if (writer != Console.Out) {
- writer.Close();
- }
- }
- }
-
- public static void Flush() {
- foreach (TextWriter writer in Listeners) {
- writer.Flush();
- }
- }
-
- public static void Indent() {
- IndentLevel++;
- }
-
- public static void Unindent() {
- if (IndentLevel <= 0) {
- throw new InvalidOperationException("IndentLevel must be greater than zero before calling Unindent()");
- }
- IndentLevel--;
- }
-
- /// <summary>
- /// Flag to indicate next string will start on a new line so that it can be indented.
- /// </summary>
- private static bool _newline = true;
-
- private static void PreprocessValue(ref string value) {
- // if we are starting a new line then first indent the string
- if (_newline) {
- if (IndentLevel > 0) {
- StringBuilder sb = new StringBuilder(value);
- sb.Insert(0, " ", IndentLevel * IndentSize);
- value = sb.ToString();
- }
- _newline = false;
- }
- }
-
- public static void Write(string value) {
- PreprocessValue(ref value);
- foreach (TextWriter writer in Listeners) {
- writer.Write(value);
- }
-
- if (AutoFlush) {
- foreach (TextWriter writer in Listeners) {
- writer.Flush();
- }
- }
- }
-
- public static void WriteLine() {
- WriteLine(String.Empty);
- }
-
- public static void WriteLine(string value) {
- PreprocessValue(ref value);
- foreach (TextWriter writer in Listeners) {
- writer.WriteLine(value);
- }
-
- if (AutoFlush) {
- foreach (TextWriter writer in Listeners) {
- writer.Flush();
- }
- }
-
- // make sure we indent the next line
- _newline = true;
- }
-
- public static void Write(string format, params object[] arg) {
- Write(String.Format(format, arg));
- }
-
- public static void WriteLine(string format, params object[] arg) {
- WriteLine(String.Format(format, arg));
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nant/src/Util/XmlNodeTextPositionMap.cs b/mcs/nant/src/Util/XmlNodeTextPositionMap.cs
deleted file mode 100755
index fd10caafd4f..00000000000
--- a/mcs/nant/src/Util/XmlNodeTextPositionMap.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-// NAnt - A .NET build tool
-// Copyright (C) 2001 Gerry Shaw
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// Gerry Shaw (gerry_shaw@yahoo.com)
-
-namespace SourceForge.NAnt {
-
- using System;
- using System.IO;
- using System.Text.RegularExpressions;
- using System.Xml;
- using System.Xml.XPath;
- using System.Collections;
-
- public struct TextPosition {
- public static readonly TextPosition InvalidPosition = new TextPosition(-1,-1);
-
- public TextPosition(int line, int column) {
- Line = line;
- Column = column;
- }
-
- public int Line;
- public int Column;
- }
-
- /// <summary>
- /// Maps XML nodes to the text positions from their original source.
- /// </summary>
- public class XPathTextPositionMap {
-
- Hashtable _map = new Hashtable();
-
- public XPathTextPositionMap(string url) {
- string parentXPath = "/"; // default to root
- string previousXPath = "";
- int previousDepth = 0;
-
- // Load text reader
- XmlTextReader reader = new XmlTextReader(url);
- ArrayList indexAtDepth = new ArrayList();
-
- // Explicitly load document XPath
- _map.Add((object) "/", (object) new TextPosition(1, 1));
-
- // loop thru all nodes in the document
- while (reader.Read()) {
- // reader to Node ...
- if ( (reader.NodeType.ToString() != "Whitespace") // Ignore those we aren't interested in
- && (reader.NodeType.ToString() != "EndElement")
- && (reader.NodeType.ToString() != "ProcessingInstruction")
- && (reader.NodeType.ToString() != "XmlDeclaration")
- ) {
- int level = reader.Depth;
- string currentXPath = "";
-
- // If we arr higher than before
- if (reader.Depth < previousDepth) {
- // Clear vars for new depth
- string[] list = parentXPath.Split('/');
- string newXPath = ""; // once appended to / will be root node ...
-
- for (int j = 1; j < level+1; j++) {
- newXPath += "/" + list[j];
- }
-
- // higher than before so trim xpath\
- parentXPath = newXPath; // one up from before
-
- // clear indexes for depth greater than ours
- indexAtDepth.RemoveRange(level+1, indexAtDepth.Count - (level+1));
-
- } else if (reader.Depth > previousDepth) {
- // we are lower
- parentXPath = previousXPath;
- }
-
- // End depth setup
- // Setup up index array
- // add any needed extra items ( usually only 1 )
- // would have uses array but not sure what maximum depth will be beforehand
- for (int index = indexAtDepth.Count; index < level+1; index++) {
- indexAtDepth.Add(0);
- }
- // Set child index
- if ((int) indexAtDepth[level] == 0) {
- // first time thru
- indexAtDepth[level] = 1;
- } else {
- indexAtDepth[level] = (int) indexAtDepth[level] + 1; // lower so append to xpath
- }
-
- // Do actual XPath generation
- if (parentXPath.EndsWith("/")) {
- currentXPath = parentXPath;
- } else {
- currentXPath = parentXPath + "/"; // add seperator
- }
-
- // Set the final XPath
- currentXPath += "child::node()[" + indexAtDepth[level] + "]";
-
- // Add to our hash structures
- _map.Add((object) currentXPath, (object) new TextPosition(reader.LineNumber, reader.LinePosition));
-
- // setup up loop vars for next iteration
- previousXPath = currentXPath;
- previousDepth = reader.Depth;
- }
- }
- }
-
- public TextPosition GetTextPosition(XmlNode node) {
- string xpath = GetXPathFromNode(node);
- return GetTextPosition(xpath);
- }
-
- public TextPosition GetTextPosition(string xpath) {
- TextPosition pos;
- if (_map.ContainsKey(xpath)) {
- pos = (TextPosition) _map[xpath];
- } else {
- pos = TextPosition.InvalidPosition;
- }
- return pos;
- }
-
- private string GetXPathFromNode(XmlNode node) {
- XPathNavigator nav = node.CreateNavigator();
-
- string xpath = "";
- int index = 0;
-
- while (nav.NodeType.ToString() != "Root") {
- // loop thru children until we find ourselves
- XPathNavigator navParent = nav.Clone();
- navParent.MoveToParent();
- int parentIndex = 0;
- navParent.MoveToFirstChild();
- if (navParent.IsSamePosition(nav)) {
- index = parentIndex;
- }
- while (navParent.MoveToNext()) {
- parentIndex++;
- if (navParent.IsSamePosition(nav)) {
- index = parentIndex;
- }
- }
-
- nav.MoveToParent(); // do loop condiditon here
-
- // if we are at doc and index = 0 then there is no xml proc instruction
- if ((nav.NodeType.ToString()) != "Root" || (index == 0)) {
- index = index + 1; // special case at root to avoid processing instruction ..
- }
-
- string thisNode = "child::node()[" + index + "]";
-
- if (xpath == "") {
- xpath = thisNode;
- } else {
- // build xpath string
- xpath = thisNode + "/" + xpath;
- }
- }
-
- // prepend slash to ...
- xpath = "/" + xpath;
-
- return xpath;
- }
- }
-}
diff --git a/mcs/nunit/.cvsignore b/mcs/nunit/.cvsignore
deleted file mode 100644
index 335c71fd7fa..00000000000
--- a/mcs/nunit/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.dll
-*.pdb
diff --git a/mcs/nunit/ChangeLog b/mcs/nunit/ChangeLog
deleted file mode 100644
index e7f9936f64d..00000000000
--- a/mcs/nunit/ChangeLog
+++ /dev/null
@@ -1,32 +0,0 @@
-2002-03-08 Nick Drochak <ndrochak@gol.com>
-
- * nunit.build: exclude all the obsolete stuff, and prevent csc from
- linking any ms stuff to the dll and exe we are testing on Linux.
-
-2002-03-07 Nick Drochak <ndrochak@gol.com>
-
- * .cvsignore: ignore *.pdb files
- * nunit.build: Build a version of NUnitCore.dll and NUnitConsole.exe
- using mono's corlib. Use this to test on Linux under mint and mono.
-
-2002-03-06 Nick Drochak <ndrochak@gol.com>
-
- * nunit.build: Exclude obsolete class from build. Probably should
- remove from cvs.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- Imported NUnit 1.11.
-
- * nunit.build: Added NAnt build file for NUnit. In addition to
- NUnitConsole.exe and NUnitCore.dll, we also create a small
- NUnitBase.dll which just contains the source files which are needed
- to run the tests on Linux.
-
- * RunTests.cs: This is a simple test runner which is used when we
- run the tests on Linux. It is linked into UNitBase.dll.
-
- * makefile: Just call NAnt here.
-
- * NUnitGUI.exe, NUnitTests.dll: Removed binaries.
-
diff --git a/mcs/nunit/RunTests.cs b/mcs/nunit/RunTests.cs
deleted file mode 100755
index e5369546900..00000000000
--- a/mcs/nunit/RunTests.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;
-using System.IO;
-using System.Threading;
-using System.Globalization;
-
-using NUnit.Framework;
-
-namespace MonoTests {
-
-public class MyTestRunner {
-
- static TextWriter fWriter = Console.Out;
-
- protected static TextWriter Writer {
- get { return fWriter; }
- }
-
- public static void Print(TestResult result) {
- PrintErrors(result);
- PrintFailures(result);
- PrintHeader(result);
- }
-
- /// <summary>Prints the errors to the standard output.</summary>
- public static void PrintErrors(TestResult result) {
- if (result.ErrorCount != 0) {
- if (result.ErrorCount == 1)
- Writer.WriteLine("There was "+result.ErrorCount+" error:");
- else
- Writer.WriteLine("There were "+result.ErrorCount+" errors:");
-
- int i= 1;
- foreach (TestFailure failure in result.Errors) {
- Writer.WriteLine(i++ + ") "+failure+"("+failure.ThrownException.GetType().ToString()+")");
- Writer.Write(failure.ThrownException);
- }
- }
- }
-
- /// <summary>Prints failures to the standard output.</summary>
- public static void PrintFailures(TestResult result) {
- if (result.FailureCount != 0) {
- if (result.FailureCount == 1)
- Writer.WriteLine("There was " + result.FailureCount + " failure:");
- else
- Writer.WriteLine("There were " + result.FailureCount + " failures:");
- int i = 1;
- foreach (TestFailure failure in result.Failures) {
- Writer.Write(i++ + ") " + failure.FailedTest);
- Exception t= failure.ThrownException;
- if (t.Message != "")
- Writer.WriteLine(" \"" + t.Message + "\"");
- else {
- Writer.WriteLine();
- Writer.Write(failure.ThrownException);
- }
- }
- }
- }
-
- /// <summary>Prints the header of the report.</summary>
- public static void PrintHeader(TestResult result) {
- if (result.WasSuccessful) {
- Writer.WriteLine();
- Writer.Write("OK");
- Writer.WriteLine (" (" + result.RunCount + " tests)");
-
- } else {
- Writer.WriteLine();
- Writer.WriteLine("FAILURES!!!");
- Writer.WriteLine("Tests Run: "+result.RunCount+
- ", Failures: "+result.FailureCount+
- ", Errors: "+result.ErrorCount);
- }
- }
-
-}
-
-}
diff --git a/mcs/nunit/makefile b/mcs/nunit/makefile
deleted file mode 100644
index 7e3b8cbb8b2..00000000000
--- a/mcs/nunit/makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-all: build
-
-linux: build
-
-windows: build
-
-build:
- ../nant/NAnt.exe build
-
-clean:
- ../nant/NAnt.exe clean
-
diff --git a/mcs/nunit/nunit.build b/mcs/nunit/nunit.build
deleted file mode 100755
index ab085a314e7..00000000000
--- a/mcs/nunit/nunit.build
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<!-- NAnt build file for NUnit -->
-
-<project name="NUnit" default="build">
- <property name="debug" value="true"/>
-
- <target name="build">
- <csc target="library" output="NUnitCore.dll" debug="${debug}">
- <sources basedir="src/NUnitCore">
- <includes name="*.cs"/>
- <excludes name="SimpleTestCollector.cs"/>
- <excludes name="ClassPathTestCollector.cs"/>
- <excludes name="ReflectionUtils.cs"/>
- <excludes name="ITestSuiteLoader.cs"/>
- <excludes name="LoadingTestCollector.cs"/>
- <excludes name="ReloadingTestSuiteLoader.cs"/>
- <excludes name="StandardTestSuiteLoader.cs"/>
- <excludes name="TestCaseClassLoader.cs"/>
- </sources>
- </csc>
-
- <csc target="library" output="NUnitCore_mono.dll" debug="${debug}">
- <sources basedir="src/NUnitCore">
- <includes name="*.cs"/>
- <excludes name="SimpleTestCollector.cs"/>
- <excludes name="ClassPathTestCollector.cs"/>
- <excludes name="ReflectionUtils.cs"/>
- <excludes name="ITestSuiteLoader.cs"/>
- <excludes name="LoadingTestCollector.cs"/>
- <excludes name="ReloadingTestSuiteLoader.cs"/>
- <excludes name="StandardTestSuiteLoader.cs"/>
- <excludes name="TestCaseClassLoader.cs"/>
- </sources>
- <arg value="/r:..\class\lib\corlib.dll"/>
- <arg value="/r:..\class\lib\System.dll"/>
- <arg value="/nostdlib"/> <!-- don't reference mscorlib -->
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
- </csc>
-
- <csc target="library" output="NUnitBase.dll" debug="${debug}">
- <sources>
- <includes name="src/NUnitCore/*.cs"/>
- <includes name="RunTests.cs"/>
- <excludes name="src/NUnitCore/IFailureDetailView.cs"/>
- <excludes name="src/NUnitCore/SimpleTestCollector.cs"/>
- </sources>
- </csc>
-
- <csc target="exe" output="NUnitConsole.exe" debug="${debug}">
- <sources basedir="src\NUnitConsole">
- <includes name="*.cs"/>
- </sources>
- <references>
- <includes name="NUnitCore.dll"/>
- </references>
- </csc>
-
- <csc target="exe" output="NUnitConsole_mono.exe" debug="${debug}">
- <sources basedir="src\NUnitConsole">
- <includes name="*.cs"/>
- </sources>
- <references>
- <includes name="NUnitCore_mono.dll"/>
- </references>
- <arg value="/nostdlib"/> <!-- don't reference mscorlib -->
- <arg value="/noconfig"/> <!-- don't reference ms assemblies -->
- <arg value="/r:..\class\lib\corlib.dll"/>
- </csc>
- </target>
-
- <target name="clean">
- <delete file="NUnitCore.dll" failonerror="false"/>
- <delete file="NUnitCore_mono.dll" failonerror="false"/>
- <delete file="NUnitBase.dll" failonerror="false"/>
- <delete file="NUnitConsole.exe" failonerror="false"/>
- <delete file="NUnitConsole_mono.exe" failonerror="false"/>
- <delete file="NUnitCore.pdb" failonerror="false"/>
- <delete file="NUnitCore_mono.pdb" failonerror="false"/>
- <delete file="NUnitBase.pdb" failonerror="false"/>
- <delete file="NUnitConsole.pdb" failonerror="false"/>
- <delete file="NUnitConsole_mono.pdb" failonerror="false"/>
- </target>
-
-</project>
diff --git a/mcs/nunit/src/NUnitConsole/AssemblyInfo.cs b/mcs/nunit/src/NUnitConsole/AssemblyInfo.cs
deleted file mode 100644
index 184c24203a1..00000000000
--- a/mcs/nunit/src/NUnitConsole/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Mark the framework assembly as CLS compliant
-[assembly:CLSCompliant(true)]
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly:AssemblyTitle("NUnit Testing Framework")]
-[assembly:AssemblyDescription("A unit testing framework for the .Net platform, ported from junit by Kent Beck and Erich Gamma.")]
-[assembly:AssemblyConfiguration("")]
-[assembly:AssemblyCompany("")]
-[assembly:AssemblyProduct("NUnit")]
-[assembly:AssemblyCopyright("")]
-[assembly:AssemblyTrademark("")]
-[assembly:AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Revision
-// Build Number
-//
-// You can specify all the value or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly:AssemblyVersion("1.11.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified - the assembly cannot be signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine.
-// (*) If the key file and a key name attributes are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP - that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the file is installed into the CSP and used.
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile(@"..\..\..\..\NUnit.key")]
-//[assembly: AssemblyKeyName("")]
diff --git a/mcs/nunit/src/NUnitConsole/NUnitConsole.csproj b/mcs/nunit/src/NUnitConsole/NUnitConsole.csproj
deleted file mode 100755
index c7376873b47..00000000000
--- a/mcs/nunit/src/NUnitConsole/NUnitConsole.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9254"
- SchemaVersion = "1.0"
- >
- <Build>
- <Settings
- ApplicationIcon = "Logo.ico"
- AssemblyKeyContainerName = ""
- AssemblyName = "NUnitConsole"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Flow"
- DefaultTargetSchema = "IE32Nav30"
- DelaySign = "false"
- NoStandardLibraries = "false"
- OutputType = "Exe"
- RootNamespace = "NUnitConsole"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "0"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = "NUnitConsole.xml"
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "0"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "NUnitCore"
- Project = "{434945C6-B4F0-416B-AC43-2631EA091AAA}"
- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
- Private = "True"
- />
- <Reference
- Name = "System"
- AssemblyName = "System"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "AssemblyInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "NUnitConsoleMain.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestRunner.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/nunit/src/NUnitConsole/NUnitConsole.xml b/mcs/nunit/src/NUnitConsole/NUnitConsole.xml
deleted file mode 100644
index 7aaf89815df..00000000000
--- a/mcs/nunit/src/NUnitConsole/NUnitConsole.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<doc>
- <assembly>
- <name>NUnitConsole</name>
- </assembly>
- <members>
- <member name="T:NUnit.Top">
- <summary>
-
- </summary>
- </member>
- <member name="M:NUnit.Top.Main(System.String[])">
- <summary>
-
- </summary>
- <param name="args"></param>
- </member>
- <member name="T:NUnit.TextUI.TestRunner">
- <summary>A command line based tool to run tests.</summary><remarks>
- <code>
- C:\NUnitConsole.exe /t [/wait] TestCaseClass
- </code>
- TestRunner expects the name of a TestCase class as argument.
- If this class defines a static <c>Suite</c> property it
- will be invoked and the returned test is run. Otherwise all
- the methods starting with "Test" having no arguments are run.
-
- When the wait command line argument is given TestRunner
- waits until the users types RETURN.
-
- TestRunner prints a trace as the tests are executed followed by a
- summary at the end.</remarks>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.#ctor">
- <summary>
- Constructs a TestRunner.
- </summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.#ctor(System.IO.TextWriter)">
- <summary>
- Constructs a TestRunner using the given stream for all the output
- </summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.AddError(NUnit.Framework.ITest,System.Exception)">
- <summary>
-
- </summary>
- <param name="test"></param>
- <param name="t"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.AddFailure(NUnit.Framework.ITest,NUnit.Framework.AssertionFailedError)">
- <summary>
-
- </summary>
- <param name="test"></param>
- <param name="t"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.CreateTestResult">
- <summary>Creates the TestResult to be used for the test run.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.DoRun(NUnit.Framework.ITest,System.Boolean)">
- <summary>
-
- </summary>
- <param name="suite"></param>
- <param name="wait"></param>
- <returns></returns>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.EndTest(NUnit.Framework.ITest)">
- <summary>
-
- </summary>
- <param name="test"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.GetLoader">
- <summary>
-
- </summary>
- <returns></returns>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Print(NUnit.Framework.TestResult)">
- <summary>
-
- </summary>
- <param name="result"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.PrintErrors(NUnit.Framework.TestResult)">
- <summary>Prints the errors to the standard output.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.PrintFailures(NUnit.Framework.TestResult)">
- <summary>Prints failures to the standard output.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.PrintHeader(NUnit.Framework.TestResult)">
- <summary>Prints the header of the report.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Run(System.Type)">
- <summary>Runs a Suite extracted from a TestCase subclass.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Run(NUnit.Framework.ITest)">
- <summary>
-
- </summary>
- <param name="suite"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.RunAndWait(NUnit.Framework.ITest)">
- <summary>Runs a single test and waits until the user
- types RETURN.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.RunFailed(System.String)">
- <summary>
-
- </summary>
- <param name="message"></param>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.Start(System.String[])">
- <summary>Starts a test run. Analyzes the command line arguments
- and runs the given test suite.</summary>
- </member>
- <member name="M:NUnit.TextUI.TestRunner.StartTest(NUnit.Framework.ITest)">
- <summary>
-
- </summary>
- <param name="test"></param>
- </member>
- <member name="P:NUnit.TextUI.TestRunner.Writer">
- <summary>
-
- </summary>
- </member>
- <member name="M:System.Collections.Hashtable.Synchronized(System.Collections.Hashtable)">
- <summary>
- Returns a synchronized (thread-safe)
- wrapper for the Hashtable.
- </summary>
- </member>
- <member name="M:System.Collections.Hashtable.GetHash(System.Object)">
- <summary>Returns the hash code for the specified key.</summary>
- </member>
- <member name="M:System.Collections.Hashtable.KeyEquals(System.Object,System.Object)">
- <summary>
- Compares a specific Object with a specific key
- in the Hashtable.
- </summary>
- </member>
- </members>
-</doc>
diff --git a/mcs/nunit/src/NUnitConsole/NUnitConsoleMain.cs b/mcs/nunit/src/NUnitConsole/NUnitConsoleMain.cs
deleted file mode 100644
index cf6091319d3..00000000000
--- a/mcs/nunit/src/NUnitConsole/NUnitConsoleMain.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-namespace NUnit
-{
- using System;
- using System.Collections;
- using NUnit.Framework;
- using NUnit.Runner;
- using NUnit.TextUI;
-
- /// <summary>
- ///
- /// </summary>
- public class Top
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="args"></param>
- public static void Main(string[] args)
- {
- TestRunner aTestRunner = new NUnit.TextUI.TestRunner();
- try
- {
- TestResult r = aTestRunner.Start(args);
- if (!r.WasSuccessful)
- Environment.Exit(1);
- Environment.Exit(0);
- }
- catch(Exception e)
- {
- Console.Error.WriteLine(e.Message);
- Environment.Exit(2);
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitConsole/TestRunner.cs b/mcs/nunit/src/NUnitConsole/TestRunner.cs
deleted file mode 100644
index 77493e48866..00000000000
--- a/mcs/nunit/src/NUnitConsole/TestRunner.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-namespace NUnit.TextUI
-{
- using System;
- using System.IO;
- using System.Reflection;
- using NUnit.Framework;
- using NUnit.Runner;
-
- /// <summary>A command line based tool to run tests.</summary><remarks>
- /// <code>
- /// C:\NUnitConsole.exe /t [/wait] TestCaseClass
- /// </code>
- /// TestRunner expects the name of a TestCase class as argument.
- /// If this class defines a static <c>Suite</c> property it
- /// will be invoked and the returned test is run. Otherwise all
- /// the methods starting with "Test" having no arguments are run.
- ///
- /// When the wait command line argument is given TestRunner
- /// waits until the users types RETURN.
- ///
- /// TestRunner prints a trace as the tests are executed followed by a
- /// summary at the end.</remarks>
- public class TestRunner : BaseTestRunner
- {
- int fColumn = 0;
- TextWriter fWriter = Console.Out;
-
- /// <summary>
- /// Constructs a TestRunner.
- /// </summary>
- public TestRunner() {}
-
- /// <summary>
- /// Constructs a TestRunner using the given stream for all the output
- /// </summary>
- public TestRunner(TextWriter writer) : this()
- {
- if (writer != null)
- {
- fWriter= writer;
- }
- else
- {
- throw new ArgumentNullException("writer");
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="t"></param>
- public override void AddError(ITest test, Exception t)
- {
- lock(this)
- this.Writer.Write("E");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="t"></param>
- public override void AddFailure(ITest test, AssertionFailedError t)
- {
- lock (this)
- this.Writer.Write("F");
- }
-
- /// <summary>Creates the TestResult to be used for the test run.</summary>
- protected TestResult CreateTestResult()
- {
- return new TestResult();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="suite"></param>
- /// <param name="wait"></param>
- /// <returns></returns>
- protected TestResult DoRun(ITest suite, bool wait)
- {
- TestResult result= CreateTestResult();
- result.AddListener(this);
- long startTime= System.DateTime.Now.Ticks;
- suite.Run(result);
- long endTime= System.DateTime.Now.Ticks;
- long runTime= (endTime-startTime) / 10000;
- Writer.WriteLine();
- Writer.WriteLine("Time: "+ElapsedTimeAsString(runTime));
- Print(result);
-
- Writer.WriteLine();
-
- if (wait)
- {
- Writer.WriteLine("<RETURN> to continue");
- try
- {
- Console.ReadLine();
- }
- catch(Exception)
- {
- }
- }
- return result;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
-
- public override void EndTest(ITest test)
- {
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public override ITestLoader GetLoader()
- {
- return new StandardLoader();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="result"></param>
- public void Print(TestResult result)
- {
- lock(this)
- {
- PrintErrors(result);
- PrintFailures(result);
- PrintHeader(result);
- }
- }
-
- /// <summary>Prints the errors to the standard output.</summary>
- public void PrintErrors(TestResult result)
- {
- if (result.ErrorCount != 0)
- {
- if (result.ErrorCount == 1)
- Writer.WriteLine("There was "+result.ErrorCount+" error:");
- else
- Writer.WriteLine("There were "+result.ErrorCount+" errors:");
-
- int i= 1;
- foreach (TestFailure failure in result.Errors)
- {
- Writer.WriteLine(i++ + ") "+failure+"("+failure.ThrownException.GetType().ToString()+")");
- Writer.Write(GetFilteredTrace(failure.ThrownException));
- }
- }
- }
-
- /// <summary>Prints failures to the standard output.</summary>
- public void PrintFailures(TestResult result)
- {
- if (result.FailureCount != 0)
- {
- if (result.FailureCount == 1)
- Writer.WriteLine("There was " + result.FailureCount + " failure:");
- else
- Writer.WriteLine("There were " + result.FailureCount + " failures:");
- int i = 1;
- foreach (TestFailure failure in result.Failures)
- {
- Writer.Write(i++ + ") " + failure.FailedTest);
- Exception t= failure.ThrownException;
- if (t.Message != "")
- Writer.WriteLine(" \"" + Truncate(t.Message) + "\"");
- else
- {
- Writer.WriteLine();
- Writer.Write(GetFilteredTrace(failure.ThrownException));
- }
- }
- }
- }
-
- /// <summary>Prints the header of the report.</summary>
- public void PrintHeader(TestResult result)
- {
- if (result.WasSuccessful)
- {
- Writer.WriteLine();
- Writer.Write("OK");
- Writer.WriteLine (" (" + result.RunCount + " tests)");
-
- }
- else
- {
- Writer.WriteLine();
- Writer.WriteLine("FAILURES!!!");
- Writer.WriteLine("Tests Run: "+result.RunCount+
- ", Failures: "+result.FailureCount+
- ", Errors: "+result.ErrorCount);
- }
- }
-
- /// <summary>Runs a Suite extracted from a TestCase subclass.</summary>
- static public void Run(Type testClass)
- {
- Run(new TestSuite(testClass));
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="suite"></param>
- static public void Run(ITest suite)
- {
- TestRunner aTestRunner= new TestRunner();
- aTestRunner.DoRun(suite, false);
- }
-
- /// <summary>Runs a single test and waits until the user
- /// types RETURN.</summary>
- static public void RunAndWait(ITest suite)
- {
- TestRunner aTestRunner= new TestRunner();
- aTestRunner.DoRun(suite, true);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="message"></param>
- protected override void RunFailed(string message)
- {
- Console.Error.WriteLine(message);
- Environment.ExitCode = 1;
- throw new ApplicationException(message);
- }
-
- /// <summary>Starts a test run. Analyzes the command line arguments
- /// and runs the given test suite.</summary>
- public TestResult Start(string[] args)
- {
- bool wait = false;
- string testCase = ProcessArguments(args, ref wait);
- if (testCase.Equals(""))
- throw new ApplicationException("Usage: NUnitConsole.exe [/wait] testCaseName, where\n"
- + "name is the name of the TestCase class");
-
- try
- {
- ITest suite = GetTest(testCase);
- return DoRun(suite, wait);
- }
- catch (Exception e)
- {
- throw new ApplicationException("Could not create and run test suite.", e);
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- public override void StartTest(ITest test)
- {
- lock (this)
- {
- Writer.Write(".");
- if (fColumn++ >= 40)
- {
- Writer.WriteLine();
- fColumn = 0;
- }
- }
- }
- /// <summary>
- ///
- /// </summary>
- protected TextWriter Writer
- {
- get { return fWriter; }
- }
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/ActiveTestSuite.cs b/mcs/nunit/src/NUnitCore/ActiveTestSuite.cs
deleted file mode 100644
index cdba3b0ed9b..00000000000
--- a/mcs/nunit/src/NUnitCore/ActiveTestSuite.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-namespace NUnit.Extensions
-{
- using System;
- using System.Threading;
- using NUnit.Framework;
-
- /// <summary>
- /// A TestSuite for active Tests. It runs each test in a
- /// separate thread and until all threads have terminated.
- /// -- Aarhus Radisson Scandinavian Center 11th floor
- /// </summary>
- public class ActiveTestSuite: TestSuite
- {
- private int fActiveTestDeathCount;
- /// <summary>
- ///
- /// </summary>
- /// <param name="result"></param>
- public override void Run(TestResult result)
- {
- fActiveTestDeathCount= 0;
- base.Run(result);
- WaitUntilFinished();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="result"></param>
- public void BaseRunTest(ITest test, TestResult result)
- {
- base.RunTest(test, result);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="result"></param>
- public override void RunTest(ITest test, TestResult result)
- {
- ThreadLittleHelper tlh = new ThreadLittleHelper(test, result, this);
- Thread t = new Thread(new ThreadStart(tlh.Run));
- t.Start();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- public void RunFinished(ITest test)
- {
- lock(this)
- {
- fActiveTestDeathCount++;
- Monitor.PulseAll(this);
- }
- }
- private void WaitUntilFinished()
- {
- lock(this)
- {
- while (fActiveTestDeathCount < TestCount)
- {
- try
- {
- Monitor.Wait(this);
- }
- catch (ThreadInterruptedException)
- {
- return; // TBD
- }
- }
- }
- }
- #region Nested Classes
- /// <summary>
- ///
- /// </summary>
- public class ThreadLittleHelper
- {
- private ITest fTest;
- private TestResult fResult;
- private ActiveTestSuite fSuite;
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="result"></param>
- /// <param name="suite"></param>
- public ThreadLittleHelper(ITest test, TestResult result,
- ActiveTestSuite suite)
- {
- fSuite = suite;
- fTest = test;
- fResult = result;
- }
- /// <summary>
- ///
- /// </summary>
- public void Run()
- {
- try
- {
- fSuite.BaseRunTest(fTest, fResult);
- }
- finally
- {
- fSuite.RunFinished(fTest);
- }
- }
- }
- #endregion
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/AssemblyInfo.cs b/mcs/nunit/src/NUnitCore/AssemblyInfo.cs
deleted file mode 100644
index bd0c7b8eee4..00000000000
--- a/mcs/nunit/src/NUnitCore/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Mark the framework assembly as CLS compliant
-[assembly:CLSCompliant(true)]
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly:AssemblyTitle("NUnit Testing Framework")]
-[assembly:AssemblyDescription("A unit testing framework for the .Net platform, ported from junit by Kent Beck and Erich Gamma.")]
-[assembly:AssemblyConfiguration("")]
-[assembly:AssemblyCompany("")]
-[assembly:AssemblyProduct("NUnit")]
-[assembly:AssemblyCopyright("")]
-[assembly:AssemblyTrademark("")]
-[assembly:AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Revision
-// Build Number
-//
-// You can specify all the value or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly:AssemblyVersion("1.11.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified - the assembly cannot be signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine.
-// (*) If the key file and a key name attributes are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP - that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the file is installed into the CSP and used.
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile(@"..\..\..\..\NUnit.key")]
-//[assembly: AssemblyKeyName("")]
diff --git a/mcs/nunit/src/NUnitCore/AssemblyTestCollector.cs b/mcs/nunit/src/NUnitCore/AssemblyTestCollector.cs
deleted file mode 100755
index 9c707c43e33..00000000000
--- a/mcs/nunit/src/NUnitCore/AssemblyTestCollector.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using System;
-using NUnit.Framework;
-
-namespace NUnit.Runner
-{
- /// <summary>
- /// Collects the names of all classes in an assembly that are tests.
- /// </summary>
- public sealed class AssemblyTestCollector : MarshalByRefObject, ITestCollector
- {
- #region Instance Variables
- private string fAssemblyName;
- private StandardLoader fLoader;
- #endregion
-
- #region Constructors
- /// <summary>
- /// Create a new AssemblyTestCollector for the specified
- /// assembly, and uses the supplied loader to load the tests
- /// from the assembly.
- /// </summary>
- /// <param name="assemblyName">The file name of the assembly
- /// from which to load classes</param>
- /// <param name="loader">An instance if the standard loader to
- /// use for loading tests from the assembly.</param>
- public AssemblyTestCollector(string assemblyName,
- StandardLoader loader)
- {
- if(loader!=null)
- fLoader = loader;
- else
- throw new ArgumentNullException("loader");
-
- if(assemblyName != null)
- {
- fAssemblyName = assemblyName;
- }
- else
- throw new ArgumentNullException("assemblyName");
-
- }
- /// <summary>
- /// Create a new AssemblyTestCollector for the specified
- /// assembly.
- /// </summary>
- /// <param name="assemblyName">The file name of the assembly
- /// from which to load classes.</param>
- public AssemblyTestCollector(string assemblyName)
- : this(assemblyName,new StandardLoader()){}
- /// <summary>
- /// returns a System.String[] of FullNames for all test classes
- /// contained within the assembly.
- /// Implements ITestCollector.CollectTestsClassNames()
- /// </summary>
- #endregion
-
- #region ITestCollector Methods
- public string[] CollectTestsClassNames()
- {
- Type[] tests = fLoader.GetTestTypes(fAssemblyName);
- string[] ret = new string[tests.Length];
- int i=0;
- foreach (Type testType in tests)
- {
- ret[i] = testType.FullName;
- i++;
- }
- return ret;
- }
- #endregion
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/Assertion.cs b/mcs/nunit/src/NUnitCore/Assertion.cs
deleted file mode 100644
index f9dbff90457..00000000000
--- a/mcs/nunit/src/NUnitCore/Assertion.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
-
- /// <summary>A set of Assert methods.</summary>
- public class Assertion : MarshalByRefObject
- {
-
- /// <summary>
- /// Protect constructor since it is a static only class
- /// </summary>
- protected Assertion():base(){}
- /// <summary>
- /// Asserts that a condition is true. If it isn't it throws
- /// an <see cref="AssertionFailedError"/>.
- /// </summary>
- /// <param name="message">The message to display is the condition
- /// is false</param>
- /// <param name="condition">The evaluated condition</param>
- static public void Assert(string message, bool condition)
- {
- if (!condition)
- Assertion.Fail(message);
- }
-
- /// <summary>
- /// Asserts that a condition is true. If it isn't it throws
- /// an <see cref="AssertionFailedError"/>.
- /// </summary>
- /// <param name="condition">The evaluated condition</param>
- static public void Assert(bool condition)
- {
- Assertion.Assert(string.Empty, condition);
- }
- /// <summary>
- /// /// Asserts that two doubles are equal concerning a delta. If the
- /// expected value is infinity then the delta value is ignored.
- /// </summary>
- /// <param name="expected">The expected value</param>
- /// <param name="actual">The actual value</param>
- /// <param name="delta">The maximum acceptable difference between the
- /// the expected and the actual</param>
- static public void AssertEquals(double expected, double actual, double delta)
- {
- Assertion.AssertEquals(string.Empty, expected, actual, delta);
- }
- /// <summary>
- /// /// Asserts that two singles are equal concerning a delta. If the
- /// expected value is infinity then the delta value is ignored.
- /// </summary>
- /// <param name="expected">The expected value</param>
- /// <param name="actual">The actual value</param>
- /// <param name="delta">The maximum acceptable difference between the
- /// the expected and the actual</param>
- static public void AssertEquals(float expected, float actual, float delta)
- {
- Assertion.AssertEquals(string.Empty, expected, actual, delta);
- }
-
- /// <summary>Asserts that two objects are equal. If they are not
- /// an <see cref="AssertionFailedError"/> is thrown.</summary>
- static public void AssertEquals(Object expected, Object actual)
- {
- Assertion.AssertEquals(string.Empty, expected, actual);
- }
-
- /// <summary>Asserts that two doubles are equal concerning a delta.
- /// If the expected value is infinity then the delta value is ignored.
- /// </summary>
- static public void AssertEquals(string message, double expected,
- double actual, double delta)
- {
- // handle infinity specially since subtracting two infinite values gives
- // NaN and the following test fails
- if (double.IsInfinity(expected))
- {
- if (!(expected == actual))
- Assertion.FailNotEquals(message, expected, actual);
- }
- else if (!(Math.Abs(expected-actual) <= delta))
- Assertion.FailNotEquals(message, expected, actual);
- }
-
- /// <summary>Asserts that two floats are equal concerning a delta.
- /// If the expected value is infinity then the delta value is ignored.
- /// </summary>
- static public void AssertEquals(string message, float expected,
- float actual, float delta)
- {
- // handle infinity specially since subtracting two infinite values gives
- // NaN and the following test fails
- if (float.IsInfinity(expected))
- {
- if (!(expected == actual))
- Assertion.FailNotEquals(message, expected, actual);
- }
- else if (!(Math.Abs(expected-actual) <= delta))
- Assertion.FailNotEquals(message, expected, actual);
- }
-
- /// <summary>Asserts that two objects are equal. If they are not
- /// an <see cref="AssertionFailedError"/> is thrown.</summary>
- static public void AssertEquals(string message, Object expected, Object actual)
- {
- if (expected == null && actual == null)
- return;
- if (expected != null && expected.Equals(actual))
- return;
- Assertion.FailNotEquals(message, expected, actual);
- }
-
- /// <summary>Asserts that an object isn't null.</summary>
- static public void AssertNotNull(Object anObject)
- {
- Assertion.AssertNotNull(string.Empty, anObject);
- }
-
- /// <summary>Asserts that an object isn't null.</summary>
- static public void AssertNotNull(string message, Object anObject)
- {
- Assertion.Assert(string.Empty, anObject != null);
- }
-
- /// <summary>Asserts that an object is null.</summary>
- static public void AssertNull(Object anObject)
- {
- Assertion.AssertNull(string.Empty, anObject);
- }
-
- /// <summary>Asserts that an object is null.</summary>
- static public void AssertNull(string message, Object anObject)
- {
- Assertion.Assert(message, anObject == null);
- }
-
- /// <summary>Asserts that two objects refer to the same object. If they
- /// are not the same an <see cref="AssertionFailedError"/> is thrown.
- /// </summary>
- static public void AssertSame(Object expected, Object actual)
- {
- Assertion.AssertSame(string.Empty, expected, actual);
- }
-
- /// <summary>Asserts that two objects refer to the same object.
- /// If they are not an <see cref="AssertionFailedError"/> is thrown.
- /// </summary>
- static public void AssertSame(string message, Object expected, Object actual)
- {
- if (expected == actual)
- return;
- Assertion.FailNotSame(message, expected, actual);
- }
-
- /// <summary>Fails a test with no message.</summary>
- static public void Fail()
- {
- Assertion.Fail(string.Empty);
- }
-
- /// <summary>Fails a test with the given message.</summary>
- static public void Fail(string message)
- {
- if (message == null)
- message = string.Empty;
- throw new AssertionFailedError(message);
- }
-
- static private void FailNotEquals(string message, Object expected, Object actual)
- {
- string formatted=string.Empty;
- if (message != null)
- formatted= message+" ";
- Assertion.Fail(formatted+"expected:<"+expected+"> but was:<"+actual+">");
- }
-
- static private void FailNotSame(string message, Object expected, Object actual)
- {
- string formatted=string.Empty;
- if (message != null)
- formatted= message+" ";
- Assertion.Fail(formatted+"expected same");
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/AssertionFailedError.cs b/mcs/nunit/src/NUnitCore/AssertionFailedError.cs
deleted file mode 100644
index 9afebde079c..00000000000
--- a/mcs/nunit/src/NUnitCore/AssertionFailedError.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
- using System.Runtime.Serialization;
-
- /// <summary>
- /// Thrown when an assertion failed.
- /// </summary>
- [Serializable]
- public class AssertionFailedError : ApplicationException//NUnitException
- {
- /// <summary>
- /// Serialization Constructor
- /// </summary>
- protected AssertionFailedError(SerializationInfo info,
- StreamingContext context) : base(info,context){}
- /// <summary>
- ///
- /// </summary>
- /// <param name="message"></param>
- public AssertionFailedError (string message) : base(message) {}
-// public override bool IsAssertionFailure
-// {
-// get{return true;}
-// }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/BaseTestRunner.cs b/mcs/nunit/src/NUnitCore/BaseTestRunner.cs
deleted file mode 100644
index 7f3adfc6733..00000000000
--- a/mcs/nunit/src/NUnitCore/BaseTestRunner.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
- using System.Collections;
- using System.Collections.Specialized;
- using System.IO;
- using System.IO.IsolatedStorage;
- using System.Reflection;
- using NUnit.Framework;
-
- /// <summary>
- /// Base class for all test runners.
- /// </summary>
- /// <remarks>
- ///
- /// </remarks>
- public abstract class BaseTestRunner: MarshalByRefObject, ITestListener
- {
- /// <summary>
- ///
- /// </summary>
- [Obsolete("Shoud be handled by a loader")]
- public static string SUITE_PROPERTYNAME="Suite";
-
- private static NameValueCollection fPreferences = new NameValueCollection();
- private static int fgMaxMessageLength = 500;
- private static bool fgFilterStack = true;
-
- private bool fLoading = true;
- /// <summary>
- ///
- /// </summary>
- public BaseTestRunner()
- {
- fPreferences = new NameValueCollection();
- fPreferences.Add("loading", "true");
- fPreferences.Add("filterstack", "true");
- ReadPreferences();
- fgMaxMessageLength = GetPreference("maxmessage", fgMaxMessageLength);
- }
-
- #region ITestListener Methods
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="t"></param>
- public abstract void AddError(ITest test, Exception t);
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="t"></param>
- public abstract void AddFailure(ITest test, AssertionFailedError t);
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- public abstract void EndTest(ITest test);
- #endregion
-
-#if false
- /// <summary>
- /// Clears the status message.
- /// </summary>
- protected virtual void ClearStatus()
- {
- // Belongs in the GUI TestRunner class.
- }
-#endif
- /// <summary>
- /// Returns the formatted string of the elapsed time.
- /// </summary>
- public static string ElapsedTimeAsString(long runTime)
- {
- return ((double)runTime/1000).ToString();
- }
- /// <summary>
- /// Extract the class name from a string in VA/Java style
- /// </summary>
- public static string ExtractClassName(string className)
- {
- if(className.StartsWith("Default package for"))
- return className.Substring(className.LastIndexOf(".")+1);
- return className;
- }
-
- static bool FilterLine(string line)
- {
- string[] patterns = new string[]
- {
- "NUnit.Framework.TestCase",
- "NUnit.Framework.TestResult",
- "NUnit.Framework.TestSuite",
- "NUnit.Framework.Assertion." // don't filter AssertionFailure
- };
- for (int i = 0; i < patterns.Length; i++)
- {
- if (line.IndexOf(patterns[i]) > 0)
- return true;
- }
- return false;
- }
-
- /// <summary>
- /// Filters stack frames from internal NUnit classes
- /// </summary>
- public static string FilterStack(string stack)
- {
- string pref = GetPreference("filterstack");
- if (((pref != null) && !GetPreference("filterstack").Equals("true"))
- || fgFilterStack == false)
- return stack;
-
- StringWriter sw = new StringWriter();
- StringReader sr = new StringReader(stack);
-
- try
- {
- string line;
- while ((line = sr.ReadLine()) != null)
- {
- if (!FilterLine(line))
- sw.WriteLine(line);
- }
- }
- catch (Exception)
- {
- return stack; // return the stack unfiltered
- }
- return sw.ToString();
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="t"></param>
- /// <returns></returns>
- public static string GetFilteredTrace(Exception t)
- {
- return BaseTestRunner.FilterStack(t.StackTrace);
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="key"></param>
- /// <returns></returns>
- public static string GetPreference(string key)
- {
- return fPreferences.Get(key);
- }
-
- private static int GetPreference(String key, int dflt)
- {
- String value= GetPreference(key);
- int intValue= dflt;
- if (value != null)
- {
- try
- {
- intValue= int.Parse(value);
- }
- catch (FormatException) {}
- }
- return intValue;
- }
-
- private static FileStream GetPreferencesFile()
- {
- return new IsolatedStorageFileStream("NUnit.Prefs", FileMode.OpenOrCreate);
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public virtual ITestLoader GetLoader()
- {
- if (UseReloadingTestSuiteLoader())
- return new UnloadingLoader();
- return new StandardLoader();
- }
-
- /// <summary>
- /// Returns the ITest corresponding to the given suite. This is
- /// a template method, subclasses override RunFailed(), ClearStatus().
- /// </summary>
- public ITest GetTest(string suiteClassName)
- {
- ITest test = null;
- try
- {
- test = LoadSuiteClass(suiteClassName);
- }
- catch (TypeLoadException e)
- {
- RunFailed(e.Message);
- return null;
- }
- catch (Exception e)
- {
- RunFailed("Error: " + e.ToString());
- return null;
- }
- //ClearStatus();
- return test;
- }
-
- /// <summary>
- /// Returns the loaded Class for a suite name.
- /// </summary>
- protected ITest LoadSuiteClass(string suiteClassName)
- {
- return GetLoader().LoadTest(suiteClassName);
- }
-
- private static void ReadPreferences()
- {
- FileStream fs= null;
- try
- {
- fs= GetPreferencesFile();
- fPreferences= new NameValueCollection(fPreferences);
- ReadPrefsFromFile(ref fPreferences, fs);
- }
- catch (IOException)
- {
- try
- {
- if (fs != null)
- fs.Close();
- }
- catch (IOException)
- {
- }
- }
- }
-
- /// <summary>
- /// Real method reads name/value pairs, populates, or maybe just
- /// deserializes...
- /// </summary>
- /// <param name="prefs"></param>
- /// <param name="fs"></param>
- private static void ReadPrefsFromFile(ref NameValueCollection prefs, FileStream fs)
- {
- }
-
- /// <summary>
- /// Override to define how to handle a failed loading of a test suite.
- /// </summary>
- protected abstract void RunFailed(string message);
-
- /// <summary>
- /// Truncates a String to the maximum length.
- /// </summary>
- /// <param name="message"></param>
- /// <returns></returns>
- public static string Truncate(string message)
- {
- if (fgMaxMessageLength != -1 && message.Length > fgMaxMessageLength)
- message = message.Substring(0, fgMaxMessageLength)+"...";
- return message;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- public abstract void StartTest(ITest test);
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="args"></param>
- /// <param name="wait"></param>
- /// <returns></returns>
- protected string ProcessArguments(string[] args, ref bool wait)
- {
- string suiteName="";
- wait = false;
- foreach (string arg in args)
- {
- if (arg.Equals("/noloading"))
- SetLoading(false);
- else if (arg.Equals("/nofilterstack"))
- fgFilterStack = false;
- else if (arg.Equals("/wait"))
- wait = true;
- else if (arg.Equals("/c"))
- suiteName= ExtractClassName(arg);
- else if (arg.Equals("/v"))
- {
- Console.Error.WriteLine("NUnit "+NUnit.Runner.Version.id()
- + " by Philip Craig");
- Console.Error.WriteLine("ported from JUnit 3.6 by Kent Beck"
- + " and Erich Gamma");
- }
- else
- suiteName = arg;
- }
- return suiteName;
- }
-
- /// <summary>
- /// Sets the loading behaviour of the test runner
- /// </summary>
- protected void SetLoading(bool enable)
- {
- fLoading = enable;
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- protected bool UseReloadingTestSuiteLoader()
- {
- return bool.TrueString.Equals( GetPreference("loading")) && fLoading;
- }
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs b/mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs
deleted file mode 100644
index 0669a285c07..00000000000
--- a/mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
- using System.Collections;
- using System.Collections.Specialized;
- using System.IO;
-
- /// <summary>
- /// A TestCollector that consults the
- /// class path. It considers all classes on the class path
- /// excluding classes in JARs. It leaves it up to subclasses
- /// to decide whether a class is a runnable Test.
- /// <see cref="ITestCollector"/>
- /// </summary>
- [Obsolete("Use StandardLoader or UnloadingLoader")]
- public abstract class ClassPathTestCollector : ITestCollector
- {
- /// <summary>
- ///
- /// </summary>
- public ClassPathTestCollector() {}
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public string[] CollectTestsClassNames()
- {
- string classPath = Environment.GetEnvironmentVariable("Path");
- char separator= Path.PathSeparator;
- ArrayList result = new ArrayList();
- CollectFilesInRoots(classPath.Split(separator), result);
- string[] retVal = new string[result.Count];
- result.CopyTo(retVal);
- return retVal;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="classFileName"></param>
- /// <returns></returns>
- protected string ClassNameFromFile(string classFileName)
- {
- return classFileName;
- }
-
- private void CollectFilesInRoots(string[] roots, IList result)
- {
- foreach (string directory in roots)
- {
- DirectoryInfo dirInfo=new DirectoryInfo(directory);
- if (dirInfo.Exists)
- {
- string[] files=Directory.GetFiles(dirInfo.FullName);
- foreach (string file in files)
- {
- if (IsTestClass(file))
- {
- string className=ClassNameFromFile(file);
- result.Add(className);
- }
- }
- }
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="classFileName"></param>
- /// <returns></returns>
- protected virtual bool IsTestClass(string classFileName)
- {
- return
- ( classFileName.EndsWith(".dll")
- || classFileName.EndsWith(".exe"))
- && classFileName.IndexOf("Test") > 0;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/ExceptionTestCase.cs b/mcs/nunit/src/NUnitCore/ExceptionTestCase.cs
deleted file mode 100644
index a5ae174fd61..00000000000
--- a/mcs/nunit/src/NUnitCore/ExceptionTestCase.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-namespace NUnit.Extensions
-{
- using System;
- using NUnit.Framework;
-
- /// <summary>A TestCase that expects an Exception of class fExpected
- /// to be thrown.</summary>
- /// <remarks> The other way to check that an expected exception is thrown is:
- /// <code>
- /// try {
- /// ShouldThrow();
- /// }catch (SpecialException) {
- /// return;
- /// }
- /// Assertion.Fail("Expected SpecialException");
- /// </code>
- ///
- /// To use ExceptionTestCase, create a TestCase like:
- /// <code>
- /// new ExceptionTestCase("TestShouldThrow", typeof(SpecialException));
- /// </code></remarks>
- public class ExceptionTestCase: TestCase
- {
- private readonly Type fExpected;
- /// <summary>
- ///
- /// </summary>
- /// <param name="name"></param>
- /// <param name="exception"></param>
- public ExceptionTestCase(string name, Type exception) : base(name)
- {
- fExpected= exception;
- }
-
- /// <summary>Execute the test method expecting that an Exception of
- /// class fExpected or one of its subclasses will be thrown.</summary>
- protected override void RunTest()
- {
- try
- {
- base.RunTest();
- }
- catch (Exception e)
- {
- if (fExpected.IsAssignableFrom(e.InnerException.GetType()))
- return;
- else
- throw e.InnerException;
- }
- Assertion.Fail("Expected exception " + fExpected);
- }
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/ExpectExceptionAttribute.cs b/mcs/nunit/src/NUnitCore/ExpectExceptionAttribute.cs
deleted file mode 100644
index 401049da416..00000000000
--- a/mcs/nunit/src/NUnitCore/ExpectExceptionAttribute.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-namespace NUnit.Framework {
- using System;
-
- /// <summary>
- /// The given exception should be thrown by the annotated method.
- /// </summary>
- /// <remarks>
- /// To use this attribute, attach it to a method in a
- /// <see cref="TestCase"/> subclass.
- /// <example>Here is an example:
- /// <code>
- /// public class FooTest : TestCase {
- /// public ExpectExceptionTest(string name) : base(name) {}
- /// [ExpectException(typeof(ArgumentException))]
- /// [ExpectException(typeof(IndexOutOfRangeException))]
- /// public void TestBar() {
- /// throw new ArgumentException("bad argument");
- /// }
- /// }
- /// </code>
- /// </example>
- /// </remarks>
- [AttributeUsage(AttributeTargets.Method, AllowMultiple=true)]
- public class ExpectExceptionAttribute : Attribute {
- private Type expected;
- /// <summary>
- ///
- /// </summary>
- /// <param name="exceptionExpected"></param>
- public ExpectExceptionAttribute(Type exceptionExpected) {
- this.expected = exceptionExpected;
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public override string ToString() {
- return expected.ToString();
- }
- /// <summary>
- ///
- /// </summary>
- public Type ExceptionExpected {
- get { return expected; }
- }
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/IFailureDetailView.cs b/mcs/nunit/src/NUnitCore/IFailureDetailView.cs
deleted file mode 100644
index 55553b505ad..00000000000
--- a/mcs/nunit/src/NUnitCore/IFailureDetailView.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace NUnit.Runner {
-
- using System;
-
- using NUnit.Framework;
-
- /// <summary>
- /// A view to show details about a failure
- /// </summary>
- public interface IFailureDetailView {
- /// <summary>
- /// Clears the view
- /// </summary>
- void Clear();
-
- /// <summary>
- /// Shows details of a TestFailure
- /// </summary>
- void ShowFailure(TestFailure failure);
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/IProtectable.cs b/mcs/nunit/src/NUnitCore/IProtectable.cs
deleted file mode 100644
index ad86136602f..00000000000
--- a/mcs/nunit/src/NUnitCore/IProtectable.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace NUnit.Framework
-{
- /// <summary>
- /// An <c>IProtectable</c> can be run and can throw an Exception.
- /// </summary>
- /// <seealso cref="TestResult"/>
- public interface IProtectable
- {
- /// <summary>Run the the following method protected.</summary>
- void Protect();
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/ITest.cs b/mcs/nunit/src/NUnitCore/ITest.cs
deleted file mode 100644
index 098f4c0f23f..00000000000
--- a/mcs/nunit/src/NUnitCore/ITest.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace NUnit.Framework
-{
- /// <summary>An <c>ITest</c> can be run and collect its results.</summary>
- /// <seealso cref="TestResult"/>
- public interface ITest
- {
- /// <summary>
- /// Counts the number of test cases that will be run by this test.
- /// </summary>
- int CountTestCases { get; }
- /// <summary>
- /// Runs a test and collects its result in a
- /// <see cref="TestResult"/> instance.
- /// </summary>
- /// <param name="result"></param>
- void Run(TestResult result);
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/ITestCollector.cs b/mcs/nunit/src/NUnitCore/ITestCollector.cs
deleted file mode 100644
index 40bf089be83..00000000000
--- a/mcs/nunit/src/NUnitCore/ITestCollector.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
-
- /// <summary>
- /// Collects Test classes to be presented by the TestSelector.
- /// <see foocref="TestSelector"/>
- /// </summary>
- public interface ITestCollector
- {
- /// <summary>
- /// Returns an array of FullNames for classes that are tests.
- /// </summary>
- string[] CollectTestsClassNames();
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/ITestListener.cs b/mcs/nunit/src/NUnitCore/ITestListener.cs
deleted file mode 100644
index 87726ea95d4..00000000000
--- a/mcs/nunit/src/NUnitCore/ITestListener.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
-
- /// <summary>A Listener for test progress</summary>
- public interface ITestListener
- {
- /// <summary>An error occurred.</summary>
- void AddError(ITest test, Exception ex);
-
- /// <summary>A failure occurred.</summary>
- void AddFailure(ITest test, AssertionFailedError ex);
-
- /// <summary>A test ended.</summary>
- void EndTest(ITest test);
-
- /// <summary>A test started.</summary>
- void StartTest(ITest test);
- }
-#if false
- public class TestEventArgs : System.EventArgs
- {
- private readonly ITest fTest;
- public TestEventArgs(ITest test) : base()
- {
- fTest = test;
- }
- public ITest Test
- {
- get { return fTest;}
- }
- }
- public class TestErrorArgs : TestEventArgs
- {
- private readonly Exception fThrownException;
-
- public TestErrorArgs(ITest test, Exception thrownException) : base(test)
- {
- fThrownException = thrownException;
- }
-
- public TestErrorArgs(TestFailure error)
- : this(error.FailedTest,error.ThrownException){}
-
- public Exception ThrownException
- {
- get { return fThrownException;}
-
- }
- }
-
- public delegate void TestErrorHandler(TestFailure failure);
- public delegate void TestEventHandler(ITest test);
-
- public interface ITestEvents
- {
- event TestErrorHandler TestErred;
- event TestErrorHandler TestFailed;
- event TestEventHandler TestStarted;
- event TestEventHandler TestEnded;
- event TestEventHandler RunStarted;
- event TestEventHandler RunEnded;
- }
-#endif
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/ITestLoader.cs b/mcs/nunit/src/NUnitCore/ITestLoader.cs
deleted file mode 100755
index ed0a08ed73c..00000000000
--- a/mcs/nunit/src/NUnitCore/ITestLoader.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
- using NUnit.Framework;
- using System.Runtime.Serialization;
-
- /// <summary>
- /// Basic contract governing loading of tests
- /// </summary>
- public interface ITestLoader
- {
- /// <summary>
- /// Loads an instance of the test class specified by the name.
- /// Loadable in most cases will be an assembly qualified name.
- ///
- /// Other loaders could dynamically construct a test case from
- /// an XML file or a database record.
- /// </summary>
- ITest LoadTest(string loadableName);
-
- /// <summary>
- /// Return the name used by the loader to load an instance
- /// of the supplied test
- /// </summary>
- /// <param name="test"></param>
- /// <returns></returns>
- string GetLoadName(ITest test);
- }
-
- /// <summary>
- /// Error thrown during assembly and class loading problems
- /// </summary>
- [Serializable]
- public class LoaderException : NUnitException
- {
- /// <summary>
- /// Serialization Constructor
- /// </summary>
- protected LoaderException(SerializationInfo info,
- StreamingContext context) : base(info,context){}
- /// <summary>
- /// Standard constructor
- /// </summary>
- /// <param name="message">The error message that explains
- /// the reason for the exception</param>
- /// <param name="innerException">The exception that caused the
- /// current exception</param>
- public LoaderException(string message, Exception innerException) :
- base(message, innerException) {}
- /// <summary>
- /// Standard constructor
- /// </summary>
- /// <param name="message">The error message that explains
- /// the reason for the exception</param>
- public LoaderException(string message) :
- base(message) {}
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/ITestSuiteLoader.cs b/mcs/nunit/src/NUnitCore/ITestSuiteLoader.cs
deleted file mode 100644
index 71f7da29f6e..00000000000
--- a/mcs/nunit/src/NUnitCore/ITestSuiteLoader.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
-
- /// <summary>
- /// An interface to define how a test suite should be loaded.
- /// </summary>
- [Obsolete("Use ILoader")]
- public interface ITestSuiteLoader
- {
- /// <summary>
- ///
- /// </summary>
- Type Load(string suiteClassName);
- //Type Reload(Type aType);
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/LoadingTestCollector.cs b/mcs/nunit/src/NUnitCore/LoadingTestCollector.cs
deleted file mode 100644
index 4938ee952e9..00000000000
--- a/mcs/nunit/src/NUnitCore/LoadingTestCollector.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
- using System.Reflection;
- using NUnit.Framework;
-
- /// <summary>
- /// An implementation of a TestCollector that loads
- /// all classes on the class path and tests whether
- /// it is assignable from ITest or provides a static Suite property.
- /// <see cref="ITestCollector"/>
- /// </summary>
- [Obsolete("Use StandardLoader or UnloadingLoader")]
- public class LoadingClassPathTestCollector: ClassPathTestCollector
- {
-
- TestCaseClassLoader fLoader;
- /// <summary>
- ///
- /// </summary>
- public LoadingClassPathTestCollector()
- {
- fLoader= new TestCaseClassLoader();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="classFileName"></param>
- /// <returns></returns>
- protected override bool IsTestClass(string classFileName)
- {
- try
- {
- if (classFileName.EndsWith(".dll") || classFileName.EndsWith(".exe"))
- {
- Type testClass= ClassFromFile(classFileName);
- return (testClass != null); //HACK: && TestCase.IsTest(testClass);
- }
- }
- catch (TypeLoadException)
- {
- }
- return false;
- }
-
- private Type ClassFromFile(string classFileName)
- {
- string className = base.ClassNameFromFile(classFileName);
- if (!fLoader.IsExcluded(className))
- return fLoader.LoadClass(className, false);
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/NUnitCore.csproj b/mcs/nunit/src/NUnitCore/NUnitCore.csproj
deleted file mode 100755
index e53d5db8fff..00000000000
--- a/mcs/nunit/src/NUnitCore/NUnitCore.csproj
+++ /dev/null
@@ -1,238 +0,0 @@
-<VisualStudioProject>
- <CSHARP
- ProjectType = "Local"
- ProductVersion = "7.0.9466"
- SchemaVersion = "1.0"
- >
- <Build>
- <Settings
- ApplicationIcon = ""
- AssemblyKeyContainerName = ""
- AssemblyName = "NUnitCore"
- AssemblyOriginatorKeyFile = ""
- DefaultClientScript = "JScript"
- DefaultHTMLPageLayout = "Flow"
- DefaultTargetSchema = "IE32Nav30"
- DelaySign = "false"
- OutputType = "Library"
- RootNamespace = "NUnitCore"
- StartupObject = ""
- >
- <Config
- Name = "Debug"
- AllowUnsafeBlocks = "false"
- BaseAddress = "0"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "DEBUG;TRACE"
- DocumentationFile = "NUnitCore.xml"
- DebugSymbols = "true"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "false"
- OutputPath = "bin\Debug\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- <Config
- Name = "Release"
- AllowUnsafeBlocks = "false"
- BaseAddress = "0"
- CheckForOverflowUnderflow = "false"
- ConfigurationOverrideFile = ""
- DefineConstants = "TRACE"
- DocumentationFile = ""
- DebugSymbols = "false"
- FileAlignment = "4096"
- IncrementalBuild = "false"
- Optimize = "true"
- OutputPath = "bin\Release\"
- RegisterForComInterop = "false"
- RemoveIntegerChecks = "false"
- TreatWarningsAsErrors = "false"
- WarningLevel = "4"
- />
- </Settings>
- <References>
- <Reference
- Name = "System"
- AssemblyName = "System"
- />
- <Reference
- Name = "SYSTEM.WINDOWS.FORMS"
- AssemblyName = "System.Windows.Forms"
- />
- <Reference
- Name = "System.Data"
- AssemblyName = "System.Data"
- />
- <Reference
- Name = "System.XML"
- AssemblyName = "System.Xml"
- />
- </References>
- </Build>
- <Files>
- <Include>
- <File
- RelPath = "ActiveTestSuite.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AssemblyInfo.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AssemblyTestCollector.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "Assertion.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "AssertionFailedError.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "BaseTestRunner.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ClassPathTestCollector.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ExceptionTestCase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ExpectExceptionAttribute.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "IFailureDetailView.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "IProtectable.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ITest.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ITestCollector.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ITestListener.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ITestLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ITestSuiteLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "LoadingTestCollector.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "NUnitException.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ReflectionUtils.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "ReloadingTestSuiteLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "RepeatedTest.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "StandardLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "StandardTestSuiteLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestCase.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestCaseClassLoader.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestDecorator.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestFailure.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestResult.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestSetup.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "TestSuite.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
- RelPath = "Version.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- </Include>
- </Files>
- </CSHARP>
-</VisualStudioProject>
-
diff --git a/mcs/nunit/src/NUnitCore/NUnitException.cs b/mcs/nunit/src/NUnitCore/NUnitException.cs
deleted file mode 100644
index f0273ef791f..00000000000
--- a/mcs/nunit/src/NUnitCore/NUnitException.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
- using System.Diagnostics;
- using System.Runtime.Serialization;
-
- /// <summary>
- /// Thrown when an assertion failed. Here to preserve the inner
- /// exception and hence its stack trace.
- /// </summary>
- [Serializable]
- public class NUnitException : ApplicationException
- {
- /// <summary>
- /// Serialization Constructor
- /// </summary>
- protected NUnitException(SerializationInfo info,
- StreamingContext context) : base(info,context){}
- /// <summary>
- /// Standard constructor
- /// </summary>
- /// <param name="message">The error message that explains
- /// the reason for the exception</param>
- public NUnitException(string message) : base (message){}
- /// <summary>
- /// Standard constructor
- /// </summary>
- /// <param name="message">The error message that explains
- /// the reason for the exception</param>
- /// <param name="inner">The exception that caused the
- /// current exception</param>
- public NUnitException(string message, Exception inner) :
- base(message, inner) {}
-
- /// <summary>
- /// Indicates that this exception wraps an AssertionFailedError
- /// exception
- /// </summary>
- public virtual bool IsAssertionFailure
- {
- get
- {
- AssertionFailedError inner = this.InnerException
- as AssertionFailedError;
- if(inner != null)
- return true;
- return false;
- }
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/ReflectionUtils.cs b/mcs/nunit/src/NUnitCore/ReflectionUtils.cs
deleted file mode 100644
index 491e0e7ec91..00000000000
--- a/mcs/nunit/src/NUnitCore/ReflectionUtils.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-namespace NUnit.Runner
-{
-
- using System;
- using System.Collections;
- using System.Collections.Specialized;
- using System.IO;
- using System.Reflection;
-
- using NUnit.Framework;
- /// <summary>
- ///
- /// </summary>
- [Obsolete("Use Standar Loader")]
- public class ReflectionUtils
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="testClass"></param>
- /// <returns></returns>
- [Obsolete("Use Standar Loader")]
- public static bool HasTests(Type testClass)
- {
-
- PropertyInfo suiteProperty= null;
- suiteProperty = testClass.GetProperty("Suite", new Type[0]);
- if (suiteProperty == null )
- {
- // try to extract a test suite automatically
- TestSuite dummy = new TestSuite(testClass, true);
- return (dummy.CountTestCases > 0);
- }
- ITest test= null;
- try
- {
- // static property
- test= (ITest)suiteProperty.GetValue(null, new Type[0]);
- if (test == null)
- return false;
- }
- catch(Exception)
- {
- return false;
- }
- return true;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="assemblyName"></param>
- /// <returns></returns>
- [Obsolete("Use Standar Loader")]
- public static StringCollection GetAssemblyClasses(string assemblyName)
- {
- StringCollection classNames = new StringCollection ();
- try
- {
- Assembly testAssembly = Assembly.LoadFrom(assemblyName);
-
- foreach(Type testType in testAssembly.GetExportedTypes())
- {
- if(testType.IsClass && HasTests(testType))
- {
- classNames.Add(testType.FullName);
- }
- }
- }
- catch(ReflectionTypeLoadException rcle)
- {
-
- Type[] loadedTypes = rcle.Types;
- Exception[] exceptions = rcle.LoaderExceptions;
-
- int exceptionCount = 0;
-
- for ( int i =0; i < loadedTypes.Length; i++ )
- {
- Console.Error.WriteLine("Unable to load a type because {0}", exceptions[exceptionCount] );
- exceptionCount++;
- }
- }
- catch(FileNotFoundException fnfe)
- {
- Console.Error.WriteLine(fnfe.Message);
- }
- catch(Exception e)
- {
- Console.Error.WriteLine("Error reading file {0}: {1}", assemblyName, e.Message);
- }
- return classNames;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/ReloadingTestSuiteLoader.cs b/mcs/nunit/src/NUnitCore/ReloadingTestSuiteLoader.cs
deleted file mode 100644
index de222ed9d77..00000000000
--- a/mcs/nunit/src/NUnitCore/ReloadingTestSuiteLoader.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-namespace NUnit.Runner
-{
-
- using System;
-
- /// <summary>A TestSuite loader that can reload classes.</summary>
- [Obsolete("Use StandardLoader or UnloadingLoader")]
- public class ReloadingTestSuiteLoader: ITestSuiteLoader
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="suiteClassName"></param>
- /// <returns></returns>
- public Type Load(string suiteClassName)
- {
- // TestCaseClassLoader loader= new TestCaseClassLoader();
- // return loader.LoadClass(suiteClassName, true);
- return Type.GetType(suiteClassName, true);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="aClass"></param>
- /// <returns></returns>
- public Type Reload(Type aClass)
- {
- // TestCaseClassLoader loader= new TestCaseClassLoader();
- // return loader.LoadClass(aClass.ToString(), true);
- return aClass;
- }
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/RepeatedTest.cs b/mcs/nunit/src/NUnitCore/RepeatedTest.cs
deleted file mode 100644
index 546bed56d6e..00000000000
--- a/mcs/nunit/src/NUnitCore/RepeatedTest.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace NUnit.Extensions {
-
- using System;
-
- using NUnit.Framework;
- /// <summary>A Decorator that runs a test repeatedly.</summary>
- public class RepeatedTest: TestDecorator {
- private readonly int fTimesRepeat;
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="repeat"></param>
- public RepeatedTest(ITest test, int repeat) : base(test) {
- if (repeat < 0) {
- throw new ArgumentOutOfRangeException("repeat", "Repetition count must be > 0");
- }
- fTimesRepeat= repeat;
- }
- /// <summary>
- ///
- /// </summary>
- public override int CountTestCases {
- get { return base.CountTestCases * fTimesRepeat; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="result"></param>
- public override void Run(TestResult result) {
- for (int i= 0; i < fTimesRepeat; i++) {
- if (result.ShouldStop)
- break;
- base.Run(result);
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public override string ToString() {
- return base.ToString()+"(repeated)";
- }
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/SimpleTestCollector.cs b/mcs/nunit/src/NUnitCore/SimpleTestCollector.cs
deleted file mode 100644
index e1f73ea959a..00000000000
--- a/mcs/nunit/src/NUnitCore/SimpleTestCollector.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace NUnit.Runner {
-
- using System;
-
- /// <summary>
- /// An implementation of a TestCollector that considers
- /// a class to be a test class when it contains the
- /// pattern "Test" in its name
- /// <see cref="ITestCollector"/>
- /// </summary>
- public class SimpleTestCollector: ClassPathTestCollector {
- /// <summary>
- ///
- /// </summary>
- public SimpleTestCollector() {
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="classFileName"></param>
- /// <returns></returns>
- protected override bool IsTestClass(string classFileName) {
- return
- (classFileName.EndsWith(".dll") || classFileName.EndsWith(".exe")) &&
- classFileName.IndexOf("Test") > 0;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/StandardLoader.cs b/mcs/nunit/src/NUnitCore/StandardLoader.cs
deleted file mode 100755
index 5666c56aac3..00000000000
--- a/mcs/nunit/src/NUnitCore/StandardLoader.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
- using System.Collections;
- using System.Reflection;
- using NUnit.Framework;
-
- /// <summary>
- /// Same as StandardLoader.
- /// TODO: Clean up "Unloading" concepts in framework
- /// </summary>
- public class UnloadingLoader : StandardLoader{}
-
- /// <summary>
- /// TestLoader that
- /// </summary>
- public class StandardLoader : ITestLoader
- {
- #region Overidable loader implementatioons
- /// <summary>
- /// Attempts by all means possible to return a test for the given type.
- /// Check in the following order:
- /// 1. For a static Suite property, that implments ITest.
- /// 2. Tries to dynamically create a suite for the type.
- /// </summary>
- /// <param name="testClass"></param>
- /// <returns></returns>
- protected virtual ITest CoerceTestFrom(Type testClass)
- {
- try
- {
- ITest test = GetStaticSuiteProperty(testClass);
- if (test == null )
- {
- // try to extract a test suite automatically
- test = new TestSuite(testClass);
- }
- return test;
- }
- catch (Exception e)
- {
- throw new NUnitException("Error building test for class: "
- + testClass.FullName,e);
- }
- }
-
- /// <summary>
- /// Searches for the type specified by the testClassName in the
- /// specified assembly, and if found, attempts to coerce a test
- /// from the type.
- /// </summary>
- /// <param name="testClassName"></param>
- /// <param name="assemblyFileName"></param>
- /// <returns></returns>
- public virtual ITest LoadTest(string testClassName,
- string assemblyFileName)
- {
- try
- {
- return this.CoerceTestFrom(
- getAssembly(assemblyFileName).GetType(testClassName));
- }
- catch (Exception e)
- {
- throw new LoaderException("Error loading test class: "
- + testClassName + "," + assemblyFileName, e);
- }
- }
- /// <summary>
- /// Determines if a Type is a test.
- /// </summary>
- /// <param name="typeToCheck"></param>
- protected virtual bool IsTestClass(Type typeToCheck)
- {
- if(typeToCheck!=null)
- {
- if( typeToCheck.IsClass
- && typeToCheck.IsPublic
- && !typeToCheck.IsAbstract)
- {
- try
- {
- if( (typeof(ITest).IsAssignableFrom(typeToCheck)
- // Has public single string constructor
- && (typeToCheck.GetConstructor(new Type[]{typeof(string)})!=null))
- || GetStaticSuiteProperty(typeToCheck)!= null)
- {
- return true;
- }
- }
- catch(System.Security.SecurityException)
- {
- // eat security exceptions, since shouldn't
- // have errors on classes we can't access
- }
- }
- return false;
- }
- else
- {
- throw new ArgumentNullException("typeToCheck");
- }
- }
- /// <summary>
- /// Uses reflection to obtain the suite property for the Type
- /// </summary>
- /// <param name="testClass"></param>
- /// <returns>The Suite property of the Type, or null if the property
- /// does not exist</returns>
- protected virtual TestSuite GetStaticSuiteProperty(Type testClass)
- {
- if(testClass!=null)
- {
- TestSuite test = null;
- PropertyInfo suiteProperty = testClass.GetProperty("Suite"
- ,BindingFlags.Static|BindingFlags.Public
- ,Type.DefaultBinder // unknown
- ,typeof(ITest) // Itest return type
- ,Type.EmptyTypes // no parameters
- ,new ParameterModifier[0] // unknown
- );
- if (suiteProperty != null )
- {
- test = (TestSuite)suiteProperty.GetValue(null, new Object[0]);
- }
- return test;
- }
- else
- {
- throw new ArgumentNullException ("testClass");
- }
- }
- private Assembly getAssembly(string assemblyFileName)
- {
- try
- {
- return Assembly.LoadFrom(assemblyFileName);
- }
- catch(ArgumentNullException)
- {
- throw new ArgumentNullException("assemblyFileName");
- }
- }
- #endregion
-
- #region ILoader Methods
- /// <summary>
- /// Implements ILoader.GetLoadName().
- /// </summary>
- /// <param name="test"></param>
- /// <returns></returns>
- public virtual string GetLoadName(ITest test)
- {
- Type testType = test.GetType();
- if(testType.Equals(typeof(TestSuite)))
- {
- string tname = test.ToString();
- testType = Type.GetType(tname);
- }
- if(testType != null)
- return testType.FullName+","+testType.Assembly.CodeBase;
- else
- return string.Empty;
- }
- /// <summary>
- /// Implements ILoader.LoadTest().
- /// Loads an instance of the test class specified by the
- /// AssemblyQualifiedName. The assembly qualified name
- /// contains the Full Clas Name, followed by the CodeBase
- /// (file or url) of the assembly. If the class is found,
- /// the loader will attempt to return a TestSuite for the
- /// class. Trying first the static Suite property, followed
- /// by trying to dynamically create a suite for the class.
- /// </summary>
- /// <param name="assemblyQualifiedName">The qualified name
- /// for the class taking the form
- /// "Namespace.ClassName,AssemblyFileName" without the quotes.
- /// Assembly file name can be a fulied qualified path name, or
- /// a URL.</param>
- /// <returns></returns>
- public virtual ITest LoadTest(string assemblyQualifiedName)
- {
- if(assemblyQualifiedName==null)
- throw new ArgumentNullException("assemblyQualifiedName");
-
- string[] nameParts = assemblyQualifiedName.Split(new Char[]{','});
- if(nameParts.Length >= 1)
- {
- return this.LoadTest(nameParts[0].Trim(),nameParts[1].Trim());
- }
- else
- {
- throw new ArgumentException("Expected an Assembly Qualified Class"
- + " Name, containing the file name of the assembly",
- "assemblyQualifiedName");
- }
- }
- #endregion
-
- /// <summary>
- /// Examies all types in the specified assembly and returns a list of those
- /// types that can be coerced into tests.
- /// </summary>
- /// <param name="assemblyFileName"></param>
- /// <returns></returns>
- public virtual Type[] GetTestTypes(string assemblyFileName)
- {
- Assembly assembly = getAssembly(assemblyFileName);
- ArrayList Tests = new ArrayList(assembly.GetExportedTypes().Length);
- foreach(Type typeToCheck in assembly.GetExportedTypes())
- {
- if(this.IsTestClass(typeToCheck))
- {
- Tests.Add(typeToCheck);
- }
- }
- Type[] ret = new Type[Tests.Count];
- Tests.CopyTo(ret);
- return ret;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/StandardTestSuiteLoader.cs b/mcs/nunit/src/NUnitCore/StandardTestSuiteLoader.cs
deleted file mode 100644
index ebdd9565760..00000000000
--- a/mcs/nunit/src/NUnitCore/StandardTestSuiteLoader.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
- using System.Reflection;
- using System.IO;
- using System.Security;
-
- /// <summary>
- /// The standard test suite loader. It can only load the same
- /// class once.
- /// </summary>
- [Obsolete("Use StandardLoader or UnloadingLoader")]
- public class StandardTestSuiteLoader: ITestSuiteLoader
- {
- /// <summary>
- /// Loads
- /// </summary>
- /// <param name="testClassName"></param>
- /// <returns></returns>
- public Type Load(string testClassName)
- {
- Type testClass;
- string[] classSpec=testClassName.Split(',');
- if (classSpec.Length > 1)
- {
- FileInfo dll=new FileInfo(classSpec[1]);
- if (!dll.Exists)
- throw new FileNotFoundException("File " + dll.FullName + " not found", dll.FullName);
- Assembly a = Assembly.LoadFrom(dll.FullName);
- testClass=a.GetType(classSpec[0], true);
- }
- else
- testClass = Type.GetType(testClassName, true);
- return testClass;
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="aClass"></param>
- /// <returns></returns>
- public Type Reload(Type aClass)
- {
- return aClass;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/TestCase.cs b/mcs/nunit/src/NUnitCore/TestCase.cs
deleted file mode 100644
index e2e746394bf..00000000000
--- a/mcs/nunit/src/NUnitCore/TestCase.cs
+++ /dev/null
@@ -1,241 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
- using System.Reflection;
-
- /// <summary>A test case defines the fixture to run multiple Tests.</summary>
- /// <remarks> To define a test case
- /// <list type="number">
- /// <item><description>implement a subclass of TestCase</description></item>
- /// <item><description>define instance variables that store the state
- /// of the fixture</description></item>
- /// <item><description>initialize the fixture state by overriding
- /// <c>SetUp</c></description></item>
- /// <item><description>clean-up after a test by overriding
- /// <c>TearDown</c></description></item>
- /// </list>
- /// Each test runs in its own fixture so there can be no side effects
- /// among test runs.
- /// <example>Here is an example:
- /// <code>
- /// public class MathTest: TestCase {
- /// protected double fValue1;
- /// protected double fValue2;
- ///
- /// public MathTest(string name) : base(name) {}
- ///
- /// protected override void SetUp() {
- /// fValue1= 2.0;
- /// fValue2= 3.0;
- /// }
- /// }</code>
- /// </example>
- ///
- /// For each test implement a method which interacts with the fixture.
- /// Verify the expected results with Assertions specified by calling
- /// <c>Assert</c> with a bool.
- /// <code>
- /// protected void TestAdd() {
- /// double result= fValue1 + fValue2;
- /// Assert(result == 5.0);
- /// }
- /// </code>
- /// Once the methods are defined you can run them. The framework supports
- /// both a static type safe and more dynamic way to run a test.
- /// In the static way you override the runTest method and define the method
- /// to be invoked.
- /// <code>
- /// protected class AddMathTest: TestCase {
- /// public void AddMathTest(string name) : base(name) {}
- /// protected override void RunTest() { TestAdd(); }
- /// }
- ///
- /// test test= new AddMathTest("Add");
- /// test.Run();
- /// </code>
- /// The dynamic way uses reflection to implement <c>RunTest</c>. It
- /// dynamically finds and invokes a method. In this case the name of the
- /// test case has to correspond to the test method to be run.
- /// <code>
- /// test= new MathTest("TestAdd");
- /// test.Run();
- /// </code>
- /// The Tests to be run can be collected into a <see cref="TestSuite"/>.
- /// NUnit provides different test runners which can run a test suite
- /// and collect the results.
- /// A test runner either expects a static property <c>Suite</c> as the entry
- /// point to get a test to run or it will extract the suite automatically.
- /// <code>
- /// public static ITest Suite {
- /// get {
- /// suite.AddTest(new MathTest("TestAdd"));
- /// suite.AddTest(new MathTest("TestDivideByZero"));
- /// return suite;
- /// }
- /// }
- /// </code></remarks>
- /// <seealso cref="TestResult"/>
- /// <seealso cref="TestSuite"/>
- public abstract class TestCase: Assertion, ITest
- {
- #region Instance Variables
- /// <summary>the name of the test case.</summary>
- private readonly string fName;
- #endregion
-
- #region Constructors
- /// <summary>Constructs a test case with no name.</summary>
- public TestCase() : this(String.Empty){}
-
- /// <summary>Constructs a test case with the given name.</summary>
- public TestCase(string testName)
- {
- this.fName = testName;
- }
- #endregion
-
- #region Properties
- /// <value>Counts the number of test cases executed by
- /// Run(TestResult result).</value>
- public int CountTestCases
- {
- get { return 1; }
- }
-
- /// <value>The name of the test case.</value>
- public string Name
- {
- get { return this.fName; }
- }
- #endregion
-
- #region Utility Methods
- /// <summary>Creates a default <see cref="TestResult"/> object.</summary>
- protected TestResult CreateResult()
- {
- return new TestResult();
- }
- #endregion
-
- #region Run Methods
- /// <summary>A convenience method to run this test, collecting the
- /// results with a default <see cref="TestResult"/> object.</summary>
- public TestResult Run()
- {
- TestResult result = this.CreateResult();
- this.Run(result);
- return result;
- }
-
- /// <summary>Runs the test case and collects the results in
- /// TestResult.</summary>
- public void Run(TestResult result)
- {
- result.Run(this);
- }
-
- /// <summary>Runs the bare test sequence.</summary>
- public void RunBare()
- {
- this.SetUp();
- try
- {
- this.RunTest();
- }
- finally
- {
- this.TearDown();
- }
- }
-
- /// <summary>Override to run the test and Assert its state.</summary>
- protected virtual void RunTest()
- {
- MethodInfo runMethod = GetType().GetMethod(this.Name, new Type[0]);
- if (runMethod == null)
- Assertion.Fail("Method \""+this.Name+"\" not found");
-
- if (runMethod != null && !runMethod.IsPublic)
- {
- Assertion.Fail("Method \""+this.Name+"\" should be public");
- }
-
- object[] exa =
- runMethod.GetCustomAttributes(typeof(ExpectExceptionAttribute),true);
-
- try
- {
- runMethod.Invoke(this, null);
- }
- catch (AssertionFailedError e)
- {
- throw new NUnitException("Run Error: ", e);
- }
- catch (TargetInvocationException e)
- {
- Exception inner = e.InnerException;
- if (inner is AssertionFailedError)
- {
- throw new NUnitException("Run Error: ", inner);
- }
- if (exa.Length>0)
- {
- foreach (ExpectExceptionAttribute ex in exa)
- {
- if (ex.ExceptionExpected.IsAssignableFrom(inner.GetType()))
- return;
- }
- Assertion.Fail("Unexpected Exception thrown: " + inner);
- }
- else
- {
- throw new NUnitException("Run Error: ", inner);
- }
- }
- catch (MemberAccessException e)
- {
- throw new NUnitException("", e);
- }
-
- if (exa.Length > 0)
- {
- System.Text.StringBuilder sb =
- new System.Text.StringBuilder
- ("One of these exceptions should have been thrown: ");
- bool first = true;
- foreach (ExpectExceptionAttribute ex in exa)
- {
- if(first)
- first = false;
- else
- sb.Append(", ");
- sb.Append(ex);
- }
- Assertion.Fail(sb.ToString());
- }
- }
-
- /// <summary>
- /// Sets up the fixture, for example, open a network connection.
- /// This method is called before a test is executed.
- /// </summary>
- protected virtual void SetUp() {}
- /// <summary>
- /// Tears down the fixture, for example, close a network
- /// connection. This method is called after a test is executed.
- /// </summary>
- protected virtual void TearDown() {}
- #endregion
-
- #region Overrides
- /// <summary>
- /// Returns a string representation of the test case.
- /// </summary>
- public override string ToString()
- {
- return this.Name+"("+this.GetType().ToString()+")";
- }
- #endregion
-
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/TestCaseClassLoader.cs b/mcs/nunit/src/NUnitCore/TestCaseClassLoader.cs
deleted file mode 100644
index 80fc7e89100..00000000000
--- a/mcs/nunit/src/NUnitCore/TestCaseClassLoader.cs
+++ /dev/null
@@ -1,208 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
-
- /// <summary>
- ///
- /// </summary>
- [Obsolete("Use StandardLoader or UnloadingLoader")]
- public class TestCaseClassLoader : StandardTestSuiteLoader
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="name"></param>
- /// <param name="resolve"></param>
- /// <returns></returns>
- public Type LoadClass(string name, bool resolve)
- {
- return Load(name);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="name"></param>
- /// <returns></returns>
- public bool IsExcluded(string name)
- {
- return false;
- }
- }
-}
-
-
-#if false
-// commented out till figure out .net class reloading
-
-namespace NUnit.Runner {
-
- /**
- * A custom class loader which enables the reloading
- * of classes for each test run. The class loader
- * can be configured with a list of package paths that
- * should be excluded from loading. The loading
- * of these packages is delegated to the system class
- * loader. They will be shared across test runs.
- * <p>
- * The list of excluded package paths is specified in
- * a properties file "excluded.properties" that is located in
- * the same place as the TestCaseClassLoader class.
- * <p>
- * <b>Known limitation:</b> the TestCaseClassLoader cannot load classes
- * from jar files.
- */
-
-
- public class TestCaseClassLoader: ClassLoader {
- /** scanned class path */
- private string[] fPathItems;
- /** excluded paths */
- private string[] fExcluded= { "com.sun.", "sun."};
- /** name of excluded properties file */
- static final string EXCLUDED_FILE= "excluded.properties";
- /**
- * Constructs a TestCaseLoader. It scans the class path
- * and the excluded package paths
- */
- public TestCaseClassLoader() {
- super();
- string classPath= System.getProperty("java.class.path");
- string separator= System.getProperty("path.separator");
-
- // first pass: count elements
- StringTokenizer st= new StringTokenizer(classPath, separator);
- int i= 0;
- while (st.hasMoreTokens()) {
- st.nextToken();
- i++;
- }
- // second pass: split
- fPathItems= new string[i];
- st= new StringTokenizer(classPath, separator);
- i= 0;
- while (st.hasMoreTokens()) {
- fPathItems[i++]= st.nextToken();
- }
-
- string[] excluded= ReadExcludedPackages();
- if (excluded != null)
- fExcluded= excluded;
- }
- public java.net.URL GetResource(string name) {
- return ClassLoader.getSystemResource(name);
- }
- public InputStream GetResourceAsStream(string name) {
- return ClassLoader.getSystemResourceAsStream(name);
- }
- protected boolean IsExcluded(string name) {
- // exclude the "java" and "junit" packages.
- // They always need to be excluded so that they are loaded by the system class loader
- if (name.startsWith("java.") ||
- name.startsWith("junit.framework") ||
- name.startsWith("junit.extensions") ||
- name.startsWith("junit.util") ||
- name.startsWith("junit.ui"))
- return true;
-
- // exclude the user defined package paths
- for (int i= 0; i < fExcluded.length; i++) {
- if (name.startsWith(fExcluded[i])) {
- return true;
- }
- }
- return false;
- }
- public synchronized Class LoadClass(string name, boolean resolve)
- throws ClassNotFoundException {
-
- Class c= FindLoadedClass(name);
- if (c != null)
- return c;
- //
- // Delegate the loading of excluded classes to the
- // standard class loader.
- //
- if (IsExcluded(name)) {
- try {
- c= findSystemClass(name);
- return c;
- } catch (ClassNotFoundException e) {
- // keep searching
- }
- }
- if (c == null) {
- File file= Locate(name);
- if (file == null)
- throw new ClassNotFoundException();
- byte data[]= LoadClassData(file);
- c= defineClass(name, data, 0, data.length);
- }
- if (resolve)
- resolveClass(c);
- return c;
- }
- private byte[] LoadClassData(File f) throws ClassNotFoundException {
- try {
- //System.out.println("loading: "+f.getPath());
- FileInputStream stream= new FileInputStream(f);
-
- try {
- byte[] b= new byte[stream.available()];
- stream.read(b);
- stream.close();
- return b;
- }
- catch (IOException e) {
- throw new ClassNotFoundException();
- }
- }
- catch (FileNotFoundException e) {
- throw new ClassNotFoundException();
- }
- }
- /**
- * Locate the given file.
- * @return Returns null if file couldn't be found.
- */
- private File Locate(string fileName) {
- fileName= fileName.replace('.', '/')+".class";
- File path= null;
-
- if (fileName != null) {
- for (int i= 0; i < fPathItems.length; i++) {
- path= new File(fPathItems[i], fileName);
- if (path.exists())
- return path;
- }
- }
- return null;
- }
- private string[] ReadExcludedPackages() {
- InputStream is= getClass().GetResourceAsStream(EXCLUDED_FILE);
- if (is == null)
- return null;
- Properties p= new Properties();
- try {
- p.Load(is);
- }
- catch (IOException e) {
- return null;
- }
- Vector v= new Vector(10);
- for (Enumeration e= p.propertyNames(); e.hasMoreElements(); ) {
- string key= (string)e.nextElement();
- if (key.startsWith("excluded.")) {
- string path= p.getProperty(key);
- if (path.endsWith("*"))
- path= path.substring(0, path.length()-1);
- if (path.length() > 0)
- v.addElement(path);
- }
- }
- string[] excluded= new string[v.size()];
- for (int i= 0; i < v.size(); i++)
- excluded[i]= (string)v.elementAt(i);
- return excluded;
- }
- }
-#endif
diff --git a/mcs/nunit/src/NUnitCore/TestDecorator.cs b/mcs/nunit/src/NUnitCore/TestDecorator.cs
deleted file mode 100644
index eded1c24ba5..00000000000
--- a/mcs/nunit/src/NUnitCore/TestDecorator.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-namespace NUnit.Extensions
-{
- using System;
- using NUnit.Framework;
-
- /// <summary>A Decorator for Tests.</summary>
- /// <remarks>Use TestDecorator as the base class
- /// for defining new test decorators. TestDecorator subclasses
- /// can be introduced to add behaviour before or after a test
- /// is run.</remarks>
- public class TestDecorator: Assertion, ITest
- {
- /// <summary>
- /// A reference to the test that is being decorated
- /// </summary>
- protected readonly ITest fTest;
- /// <summary>
- /// Creates a decorator for the supplied test
- /// </summary>
- /// <param name="test">The test to be decorated</param>
- public TestDecorator(ITest test)
- {
- if(test!= null)
- {
- this.fTest= test;
- }
- else
- throw new ArgumentNullException("test");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="result"></param>
- public virtual void Run(TestResult result)
- {
- this.BasicRun(result);
- }
- /// <summary>The basic run behaviour.</summary>
- public void BasicRun(TestResult result)
- {
- this.fTest.Run(result);
- }
- /// <summary>
- ///
- /// </summary>
- public virtual int CountTestCases
- {
- get { return fTest.CountTestCases; }
- }
- /// <summary>
- ///
- /// </summary>
- public ITest GetTest
- {
- get { return fTest; }
- }
- //public string Name
- //{
- // get{return fTest.Name;}
- //}
-
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return fTest.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/TestFailure.cs b/mcs/nunit/src/NUnitCore/TestFailure.cs
deleted file mode 100644
index 4dad5bd02bd..00000000000
--- a/mcs/nunit/src/NUnitCore/TestFailure.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
- using System.Diagnostics;
- using System.IO;
- using System.Text;
-
- /// <summary>
- /// A <c>TestFailure</c> collects a failed test together with
- /// the caught exception.
- /// </summary>
- /// <seealso cref="TestResult"/>
- public class TestFailure : MarshalByRefObject
- {
- private readonly ITest fFailedTest;
- private readonly Exception fThrownException;
-
- /// <summary>
- /// Constructs a TestFailure with the given test and exception.
- /// </summary>
- public TestFailure(ITest theFailedTest, Exception theThrownException)
- {
- if(theFailedTest==null)
- throw new ArgumentNullException("theFailedTest");
- if(theThrownException==null)
- throw new ArgumentNullException("theThrownException");
- this.fFailedTest = theFailedTest;
- this.fThrownException = theThrownException;
- }
-
- /// <value>Gets the failed test.</value>
- public ITest FailedTest
- {
- get { return this.fFailedTest; }
- }
-
- /// <value>True if it's a failure, false if error.</value>
- public bool IsFailure
- {
- get { return this.fThrownException is AssertionFailedError; }
- }
-
- /// <value>Gets the thrown exception.</value>
- public Exception ThrownException
- {
- get { return this.fThrownException; }
- }
-
- /// <summary>Returns a short description of the failure.</summary>
- public override string ToString()
- {
- return this.fFailedTest + ": " + this.fThrownException.Message;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/TestResult.cs b/mcs/nunit/src/NUnitCore/TestResult.cs
deleted file mode 100644
index ff274a8c4ff..00000000000
--- a/mcs/nunit/src/NUnitCore/TestResult.cs
+++ /dev/null
@@ -1,249 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
- using System.Collections;
- using System.Threading;
-
- /// <summary>A <c>TestResult</c> collects the results of executing
- /// a test case. It is an instance of the Collecting Parameter pattern.
- /// </summary><remarks>
- /// The test framework distinguishes between failures and errors.
- /// A failure is anticipated and checked for with assertions. Errors are
- /// unanticipated problems like an <c>ArgumentOutOfRangeException</c>.
- /// </remarks><seealso cref="ITest"/>
- public class TestResult : MarshalByRefObject
- {
- #region Instance Variables
- private ArrayList fFailures;
- private ArrayList fErrors;
- private ArrayList fListeners;
- private int fRunTests;
- private bool fStop;
- #endregion
-
- #region Constructors
- /// <summary>
- ///
- /// </summary>
- public TestResult()
- {
- fFailures= new ArrayList();
- fErrors= new ArrayList();
- fListeners= new ArrayList();
- }
- #endregion
-
- #region Collection Methods
- /// <summary>
- /// Adds an error to the list of errors. The passed in exception
- /// caused the error.
- /// </summary>
- public void AddError(ITest test, Exception error)
- {
- lock(this)
- {
- this.fErrors.Add(new TestFailure(test, error));
- foreach (ITestListener listner in CloneListeners())
- {
- listner.AddError(test, error);
- }
- }
- }
- /// <summary>
- /// Adds a failure to the list of failures. The passed in
- /// exception caused the failure.
- /// </summary>
- public void AddFailure(ITest test, AssertionFailedError failure)
- {
- lock(this)
- {
- fFailures.Add(new TestFailure(test, failure));
- foreach (ITestListener listner in CloneListeners())
- {
- listner.AddFailure(test, failure);
- }
- }
- }
- #endregion
-
- #region Events
- /// <summary>Registers a TestListener.</summary>
- public void AddListener(ITestListener listener)
- {
- lock(this)
- this.fListeners.Add(listener);
- }
- /// <summary>Unregisters a TestListener</summary>
- public void RemoveListener(ITestListener listener)
- {
- lock(this)
- {
- fListeners.Remove(listener);
- }
- }
- /// <summary>Returns a copy of the listeners.</summary>
- private ArrayList CloneListeners()
- {
- lock(this)
- {
- return (ArrayList)fListeners.Clone();
- }
- }
- /// <summary>Informs the result that a test was completed.</summary>
- public void EndTest(ITest test)
- {
- foreach (ITestListener listner in CloneListeners())
- {
- listner.EndTest(test);
- }
- }
- /// <summary>Informs the result that a test will be started.</summary>
- public void StartTest(ITest test)
- {
- lock(this)
- {
- this.fRunTests += test.CountTestCases;
- }
- foreach (ITestListener listner in CloneListeners())
- {
- listner.StartTest(test);
- }
- }
- #endregion
-
- #region Properties
- /// <value>Gets the number of run tests.</value>
- public int RunCount
- {
- get {lock(this)return this.fRunTests; }
- }
- /// <value>Gets the number of detected errors.</value>
- public int ErrorCount
- {
- get {lock(this)return this.fErrors.Count; }
- }
- /// <value>Gets the number of detected failures.</value>
- public int FailureCount
- {
- get {lock(this)return this.fFailures.Count; }
- }
- /// <summary>Checks whether the test run should stop.</summary>
- public bool ShouldStop
- {
- get {lock(this)return this.fStop; }
- }
- /// <value>Returns whether the entire test was successful or not.</value>
- public bool WasSuccessful
- {
- get
- {
- lock(this)
- {
- return (this.FailureCount == 0)
- && (this.ErrorCount == 0);
- }
- }
- }
- /// <value>Returns a TestFailure[] for the errors.</value>
- public TestFailure[] Errors
- {
- get
- {
- lock(this)
- {
- TestFailure[] retVal = new TestFailure[this.fErrors.Count];
- this.fErrors.CopyTo(retVal);
- return retVal;
- }
- }
- }
- /// <value>Returns a TestFauiler[] for the failures.</value>
- public TestFailure[] Failures
- {
- get
- {
- lock(this)
- {
- TestFailure[] retVal = new TestFailure[this.fFailures.Count];
- this.fFailures.CopyTo(retVal);
- return retVal;
- }
- }
- }
- #endregion
-
- #region Nested Classes
- /// <summary>Runs a TestCase.</summary>
- protected class ProtectedProtect: IProtectable
- {
- private TestCase fTest;
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- public ProtectedProtect(TestCase test)
- {
- if(test != null)
- {
- this.fTest = test;
- }
- else
- {
- throw new ArgumentNullException("test");
- }
- }
- /// <summary>
- ///
- /// </summary>
- public void Protect()
- {
- this.fTest.RunBare();
- }
- }
- #endregion
-
- #region Run Methods
- /// <summary>Runs a TestCase.</summary>
- internal void Run(TestCase test)
- {
- StartTest(test);
- IProtectable p = new ProtectedProtect(test);
- RunProtected(test, p);
- EndTest(test);
- }
-
- /// <summary>Runs a TestCase.</summary>
- public void RunProtected(ITest test, IProtectable p)
- {
- try
- {
- p.Protect();
- }
- catch (AssertionFailedError e)
- {
- AddFailure(test, e);
- }
- catch (NUnitException e)
- {
- if (e.IsAssertionFailure)
- AddFailure(test, (AssertionFailedError)e.InnerException);
- else
- AddError(test, e.InnerException);
- }
- catch (ThreadAbortException e)
- { // don't catch by accident
- throw e;
- }
- catch (System.Exception e)
- {
- AddError(test, e);
- }
- }
- /// <summary>Marks that the test run should stop.</summary>
- public void Stop()
- {
- fStop= true;
- }
- #endregion
- }
-} \ No newline at end of file
diff --git a/mcs/nunit/src/NUnitCore/TestSetup.cs b/mcs/nunit/src/NUnitCore/TestSetup.cs
deleted file mode 100644
index 95823504015..00000000000
--- a/mcs/nunit/src/NUnitCore/TestSetup.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-namespace NUnit.Extensions
-{
- using System;
- using NUnit.Framework;
-
- /// <summary>A Decorator to set up and tear down additional fixture state.
- /// </summary><remarks>
- /// Subclass TestSetup and insert it into your tests when you want
- /// to set up additional state once before the tests are run.</remarks>
- public class TestSetup: TestDecorator
- {
- #region Constructors
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- public TestSetup(ITest test) : base(test) {}
- #endregion
-
- #region Nested Classes
- /// <summary>
- ///
- /// </summary>
- protected class ProtectedProtect: IProtectable
- {
- private readonly TestSetup fTestSetup;
- private readonly TestResult fTestResult;
- /// <summary>
- ///
- /// </summary>
- /// <param name="testSetup"></param>
- /// <param name="testResult"></param>
- public ProtectedProtect(TestSetup testSetup, TestResult testResult)
- {
- if(testSetup == null)
- throw new ArgumentNullException("testSetup");
- if(testResult == null)
- throw new ArgumentNullException("testResult");
- this.fTestSetup = testSetup;
- this.fTestResult = testResult;
- }
- /// <summary>
- ///
- /// </summary>
- void IProtectable.Protect()
- {
- this.fTestSetup.SetUp();
- this.fTestSetup.BasicRun(fTestResult);
- this.fTestSetup.TearDown();
- }
- }
- #endregion
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="result"></param>
- public override void Run(TestResult result)
- {
- IProtectable p = new ProtectedProtect(this, result);
- result.RunProtected(this, p);
- }
- /// <summary>Sets up the fixture. Override to set up additional fixture
- /// state.</summary>
- protected virtual void SetUp() {}
- /// <summary>Tears down the fixture. Override to tear down the additional
- /// fixture state.</summary>
- protected virtual void TearDown() {}
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/TestSuite.cs b/mcs/nunit/src/NUnitCore/TestSuite.cs
deleted file mode 100644
index 7febc1150f5..00000000000
--- a/mcs/nunit/src/NUnitCore/TestSuite.cs
+++ /dev/null
@@ -1,293 +0,0 @@
-namespace NUnit.Framework
-{
- using System;
- using System.Collections;
- using System.Collections.Specialized;
- using System.Reflection;
-
- /// <summary>A <c>TestSuite</c> is a <c>Composite</c> of Tests.</summary>
- /// <remarks>It runs a collection of test cases. Here is an example using
- /// the dynamic test definition.
- /// <code>
- /// TestSuite suite= new TestSuite();
- /// suite.AddTest(new MathTest("TestAdd"));
- /// suite.AddTest(new MathTest("TestDivideByZero"));
- /// </code>
- /// Alternatively, a TestSuite can extract the Tests to be run automatically.
- /// To do so you pass the class of your TestCase class to the
- /// TestSuite constructor.
- /// <code>
- /// TestSuite suite= new TestSuite(typeof(MathTest));
- /// </code>
- /// This constructor creates a suite with all the methods
- /// starting with "Test" that take no arguments.</remarks>
- /// <seealso cref="ITest"/>
- public class TestSuite: MarshalByRefObject, ITest
- {
- #region Instance Variables
- private ArrayList fTests= new ArrayList(10);
- private string fName;
- private bool fSupressWarnings = false;
- private string fDynamicConstructionQualifiedName= string.Empty;
-
- #endregion
-
- #region Constructors
- /// <summary>Constructs an empty TestSuite with a name.</summary>
- public TestSuite(string name)
- {
- if(name==null)
- this.fName=String.Empty;
- this.fName = name;
- }
-
- /// <summary>Constructs an empty TestSuite with no name.</summary>
- public TestSuite() : this(String.Empty){}
-
- /// <summary>Constructs a TestSuite from the given class.</summary>
- /// <remarks>Adds all the methods starting with "Test" as test cases
- /// to the suite. Parts of this method was written at 2337 meters in
- /// the Hüffihütte, Kanton Uri</remarks>
- /// <param name="theClass"></param>
- /// <param name="supressWarnings"></param>
- public TestSuite(Type theClass, bool supressWarnings) :
- this(theClass.FullName)
- {
- this.fSupressWarnings = supressWarnings;
- //REFACTOR: these checks are also found in AssemblyTestCollector
- if( theClass.IsClass
- && (theClass.IsPublic || theClass.IsNestedPublic)
- && !theClass.IsAbstract
- && typeof(ITest).IsAssignableFrom(theClass)
- )
- {
- ConstructorInfo FixtureConstructor = GetConstructor(theClass);
- if(FixtureConstructor != null)
- {
- {
- MethodInfo[] methods = theClass.GetMethods(
- BindingFlags.Public
- |BindingFlags.NonPublic
- |BindingFlags.Instance
- );
- foreach (MethodInfo method in methods)
- {
- AddTestMethod(method, FixtureConstructor);
- }
- if (this.fTests.Count == 0)
- AddWarning("No Tests found in "+theClass.ToString());
- }
- }
- else
- {
- AddWarning("Class "+theClass.Name
- +" has no public constructor TestCase(String name)");
- }
- }
- else
- {
- AddWarning("Type '" + theClass.Name
- +"' must be a public, not abstract class that"
- +" implements ITest.");
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="theClass"></param>
- public TestSuite(Type theClass) : this(theClass,false){}
- #endregion
-
- #region Collection Methods
- /// <summary>Adds a test to the suite.</summary>
- public void AddTest(ITest test)
- {
- fTests.Add(test);
- }
-
- /// <summary>Adds the tests from the given class to the suite</summary>
- public void AddTestSuite(Type testClass)
- {
- AddTest(new TestSuite(testClass));
- }
- #endregion
-
- #region Dynamic Test Case Creation
- //private void AddTestMethod(MethodInfo m, StringCollection names,
- private void AddTestMethod(MethodInfo m,
- ConstructorInfo constructor)
- {
- string name = m.Name;
- if (IsPublicTestMethod(m))
- {
- Object[] args= new Object[]{name};
- try
- {
- AddTest((ITest)constructor.Invoke(args));
- }
- catch (TypeLoadException e)
- {
- AddWarning("Cannot instantiate test case: "+name + "( " + e.ToString() + ")");
- }
- catch (TargetInvocationException e)
- {
- AddWarning("Exception in constructor: "+name + "( " + e.ToString() + ")");
- }
- catch (MemberAccessException e)
- {
- AddWarning("Cannot access test case: "+name + "( " + e.ToString() + ")");
- }
- }
- else
- { // almost a test method
- if (IsTestMethod(m))
- AddWarning("test method isn't public: "+m.Name);
- }
- }
-
- /// <summary>Gets a constructor which takes a single string as
- /// its argument.</summary>
- private ConstructorInfo GetConstructor(Type theClass)
- {
- //REFACTOR: these checks are also found in AssemblyTestCollector
- return theClass.GetConstructor(new Type[]{typeof(string)});
- }
-
- private bool IsPublicTestMethod(MethodInfo methodToCheck)
- {
- return methodToCheck.IsPublic
- && IsTestMethod(methodToCheck);
- }
-
- private bool IsTestMethod(MethodInfo methodToCheck)
- {
- return
- !methodToCheck.IsAbstract
- && methodToCheck.GetParameters().Length == 0
- && methodToCheck.ReturnType.Equals(typeof(void))
- && methodToCheck.Name.ToLower().StartsWith("test")
- ;
- }
- #endregion
-
- #region Properties
- /// <summary>
- /// Returns the name of the suite. Not all test suites have a name
- /// and this method can return null.
- /// </summary>
- public string Name
- {
- get { return this.fName; }
- }
-
- /// <summary>
- /// The number of test cases that will be run by this test.
- /// </summary>
- public int CountTestCases
- {
- get
- {
- int count= 0;
- foreach (ITest test in this.Tests)
- {
- count += test.CountTestCases;
- }
- return count;
- }
- }
-
- /// <value>The number of Tests in this suite.</value>
- public int TestCount
- {
- get {return this.fTests.Count; }
- }
-
- /// <value>The test at the given index.</value>
- /// <remarks>Formerly TestAt(int).</remarks>
- public ITest this[int index]
- {
- get {return (ITest)this.fTests[index]; }
- }
-
- /// <value>The Tests as a Test[].</value>
- public ITest[] Tests
- {
- get {
- ITest[] ret = new ITest[this.fTests.Count];
- this.fTests.CopyTo(ret);
- return ret;
- }
- }
- #endregion
-
- #region Utility Methods
- private void AddWarning(string message)
- {
- if(!this.fSupressWarnings)
- AddTest(new WarningFail(message));
- }
- #endregion
-
- #region Run Methods
- /// <summary>Runs the Tests and collects their result in a
- /// TestResult.</summary>
- public virtual void Run(TestResult result)
- {
- foreach (ITest test in Tests)
- {
- if (result.ShouldStop )
- break;
- RunTest(test, result);
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="test"></param>
- /// <param name="result"></param>
- public virtual void RunTest(ITest test, TestResult result)
- {
- test.Run(result);
- }
-
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- #endregion
-
- #region Overrides
- public override string ToString()
- {
- return this.Name;
- }
- #endregion
-
- #region Nested Classes
- /// <summary>A test which will fail and log a warning
- /// message.</summary>
- public class WarningFail : TestCase
- {
- private string fMessage;
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="message"></param>
- public WarningFail(string message): base("warning")
- {
- this.fMessage = message;
- }
-
- /// <summary>
- ///
- /// </summary>
- protected override void RunTest()
- {
- Assertion.Fail(fMessage);
- }
- }
- #endregion
- }
-}
diff --git a/mcs/nunit/src/NUnitCore/Version.cs b/mcs/nunit/src/NUnitCore/Version.cs
deleted file mode 100644
index bc7770df126..00000000000
--- a/mcs/nunit/src/NUnitCore/Version.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace NUnit.Runner
-{
- using System.Reflection;
- /// <summary>
- /// This class defines the current version of NUnit
- /// </summary>
- public class Version
- {
- private Version()
- {
- // don't instantiate
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public static string id()
- {
- return Assembly.GetExecutingAssembly().GetName().Version.ToString();
- //return "1.10";
- }
- }
-}
diff --git a/mcs/tests/ChangeLog b/mcs/tests/ChangeLog
deleted file mode 100755
index 2cda7167c38..00000000000
--- a/mcs/tests/ChangeLog
+++ /dev/null
@@ -1,415 +0,0 @@
-2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
-
- * makefile: The following tests fail under linux and have been
- moved to TEST_NOPASS: 40, 45, 52, 53, 91, 106, 107, 122, 132, 133
-
- Windows-specific tests have been extracted, and are now run by the
- test-windows rule (it'll be run under linux but fail)
-
- The output format has been made less noisy, and is basically the
- same as the tests in mcs/errors - like "Running test-1 ... OK".
-
-2002-06-13 Ravi Pratap <ravi@ximian.com>
-
- * test-131.cs : Add to test enum member attribute application.
-
-2002-06-10 Rachel Hestilow <hestilow@ximian.com>
-
- * unsafe-3.cs: New test for address-of-pointer.
-
-2002-06-09 Martin Baulig <martin@gnome.org>
-
- * test-130.cs: New test for constants and casts.
-
-2002-06-09 Martin Baulig <martin@gnome.org>
-
- * test-129.cs: New test for unary minus.
-
-2002-06-08 Ravi Pratap <ravi@ximian.com>
-
- * test-128.cs : Add. This ensures we apply attributes to accessors
- of events and properties.
-
-2002-06-08 Martin Baulig <martin@gnome.org>
-
- * test-127.cs: New test for Enum.IsDefined().
-
-2002-05-24 Ravi Pratap <ravi@ximian.com>
-
- * test-124.cs, test-125.cs : Add.
-
- * makefile : update.
-
-2002-05-11 Miguel de Icaza <miguel@ximian.com>
-
- * test-49.cs: Improve test.
-
-Wed May 8 16:48:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
-
- * test-118.cs: test alternate type lookup for attributes.
-
-2002-05-07 Ravi Pratap <ravi@ximian.com>
-
- * test-117.cs : Add.
-
-2002-05-05 Miguel de Icaza <miguel@ximian.com>
-
- * test-28.cs: Improved test: before we were failing on abstract
- indexers invoked in the same class (as the accessor would have no
- body).
-
-2002-05-02 Ravi Pratap <ravi@ximian.com>
-
- * test-113.cs : Another test for overload resolution ;-)
-
- * test-114.cs : Add.
-
-2002-04-28 Miguel de Icaza <miguel@ximian.com>
-
- * test-108.cs: Improve test
-
-2002-04-26 Ravi Pratap <ravi@ximian.com>
-
- * test-105.cs, test-106.cs, test-107.cs : Add.
-
-2002-04-22 Ravi Pratap <ravi@ximian.com>
-
- * test-104.cs : Another overload resolution test !
-
-2002-04-05 Ravi Pratap <ravi@ximian.com>
-
- * test-101.cs : Add test from Paolo.
-
- * test-102.cs : Another test for attribute emission.
-
-2002-04-05 Ravi Pratap <ravi@ximian.com>
-
- * test-90.cs : Fix bug where we had no class !
-
- * test-96.cs : Here too !
-
- * test-98.cs : Supply a missing Main.
-
-2002-03-27 Miguel de Icaza <miguel@ximian.com>
-
- * test-18.cs: Augment test with the multi-flow try/catch.
-
-2002-03-21 Miguel de Icaza <miguel@ximian.com>
-
- * test-49.cs: Improved test to excerise the coverage.
-
-2002-03-13 Ravi Pratap <ravi@ximian.com>
-
- * test-86.cs : Add. This is to check for correct overload resolution
- with a null literal.
-
-2002-03-07 Ravi Pratap <ravi@ximian.com>
-
- * test-82.cs : Add.
-
-2002-03-07 Miguel de Icaza <miguel@ximian.com>
-
- * test-52.cs: Expanded test to cover more cases of foreach.
-
-2002-03-05 Ravi Pratap <ravi@ximian.com>
-
- * test-81.cs : Add.
-
- * makefile : Update accordingly as this test passes.
-
-2002-02-20 Miguel de Icaza <miguel@ximian.com>
-
- * unsafe-1.cs: Extend test.
-
-2002-01-18 Miguel de Icaza <miguel@ximian.com>
-
- * test-7.cs: Fix test (i.i wsa invalid)
-
-2002-01-18 Nick Drochak <ndrochak@gol.com>
-
- * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
-
-2002-01-13 Ravi Pratap <ravi@ximian.com>
-
- * test-58.cs : Since it was a duplicate, replace with unsafe
- code testing.
-
-2002-01-08 Miguel de Icaza <miguel@ximian.com>
-
- * test-34.cs: Improve this test to check ref/ref cases.
-
-2002-01-02 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Augment to exercise support for array initialization
- for various other types.
-
-2001-12-30 Miguel de Icaza <miguel@ximian.com>
-
- * test-67.cs: Improve this test.
-
-2001-12-29 Ravi Pratap <ravi@ximian.com>
-
- * test-69.cs : Add. This tests support for methods which are
- internal calls.
-
-2001-12-28 Ravi Pratap <ravi@ximian.com>
-
- * test-34.cs : Update to exercise the new overload resolution
- code.
-
-2001-12-26 Ravi Pratap <ravi@ximian.com>
-
- * test-67.cs : Add. These are tests for explicit layout
- of structs and classes.
-
- * makefile : Update accordingly.
-
-2001-12-25 Ravi Pratap <ravi@ximian.com>
-
- * test-57.cs : Update to exercise more of the code base for
- events.
-
-2001-12-24 Ravi Pratap <ravi@ximian.com>
-
- * test-19.cs : Augment to exercise tests on delegates
- defined in mscorlib.
-
- * test-57.cs : Update to exercise the -= operator
- as well.
-
-2001-12-23 Ravi Pratap <ravi@ximian.com>
-
- * test-57.cs : Update.
-
- * makefile : Update to include the above as it passes nicely.
-
-2001-12-21 Ravi Pratap <ravi@ximian.com>
-
- * test-19.cs : Augment to exercise code which fixed the bug
- where we were not generating a This for the delegate's
- instance expression - for the non-static methods ie.
-
-2001-12-15 Miguel de Icaza <miguel@ximian.com>
-
- * test-45.cs: Make test also use variables as arguments to new;
- We used to have a bug in the compiler that did not resolve some of
- the arguments.
-
-2001-12-15 Ravi Pratap <ravi@ximian.com>
-
- * makefile : Include test-52.cs in the suite, it works fine!
-
- (NO_PASS): It's test-51 which doesn't seem to pass.
-
- * test-50.cs : Augment some more to set named arguments on
- the DllImport attribute.
-
- * test-57.cs : Add. This tests support for Events and does not
- pass yet.
-
-2001-12-14 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Update for float and double initialization.
-
-2001-12-13 Miguel de Icaza <miguel@ximian.com>
-
- * makefile (test-30): Another test moved to the `pass' section.
- This is explicit interface implementation.
-
- (test-54): returning from catch exceptions has been working for
- some time now.
-
-2001-12-09 Radek Doulik <rodo@ximian.com>
-
- * makefile (TEST_SOURCES): added test-55 for using alias directive
-
-2001-12-06 Dietmar Maurer <dietmar@ximian.com>
-
- * makefile: added new target test-jit
-
-2001-12-04 Ravi Pratap <ravi@ximian.com>
-
- * makefile : Update to include test 50 as it now passes.
-
-2001-12-04 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Update for string initialization tests.
-
-2001-12-03 Miguel de Icaza <miguel@ximian.com>
-
- * test-49.cs: Updated to test `goto default'
-
- * test-43.cs: Test break and continue here.
-
- * gen-cast-test.cs: Improved cast test generator.
-
-2001-12-03 Ravi Pratap <ravi@ximian.com>
-
- * test-50.cs : Add. This does not pass yet.
-
-2001-12-02 Ravi Pratap <ravi@ximian.com>
-
- * test-40.cs : Update to now test recursive definitions with
- constants hooked up.
-
-2001-12-01 Ravi Pratap <ravi@ximian.com>
-
- * test-40.cs : Update to do recursive enumeration definition.
-
-2001-11-28 Ravi Pratap <ravi@ximian.com>
-
- * test-48.cs : Add for constant emission tests.
-
- * makefile : Update for the above as it passes nicely :-)
-
-2001-11-22 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Augment some more to test shorthand declaration
- of variables/fields that are array types.
-
-2001-11-20 Ravi Pratap <ravi@ximian.com>
-
- * test-45.cs : Add for array initialization testing.
-
-2001-11-16 Miguel de Icaza <miguel@ximian.com>
-
- * test-34.cs: Improve this test to check if we are actually
- walking over the arguments in foreach.
-
-2001-11-15 Ravi Pratap <ravi@ximian.com>
-
- * makefile : Update to include test-33 again. All tests
- pass again !
-
-2001-11-13 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Re-write to make the tests more robust.
-
-2001-11-12 Ravi Pratap <ravi@ximian.com>
-
- * test-39.cs : Update to test named arguments too.
-
-2001-11-11 Ravi Pratap <ravi@ximian.com>
-
- * test-40.cs : Update to be a little more useful.
-
-2001-11-08 Ravi Pratap <ravi@ximian.com>
-
- * test-39.cs : Add
-
- * test-40.cs : Add
-
- * makefile : Modify to include the above as they pass all tests.
-
-2001-10-31 Ravi Pratap <ravi@ximian.com>
-
- * test-34.cs : Add
-
-2001-10-28 Ravi Pratap <ravi@ximian.com>
-
- * test-32.cs : Added to test array definition and creation.
-
- * makefile : Updated accordingly.
-
-2001-10-22 Ravi Pratap <ravi@ximian.com>
-
- * makefile : New target 'verify' which uses the verifier to check
- that executables produced by us are identical to the MSC produced ones.
-
- * test-7.cs : Update to exercise more overloadable operators.
-
-2001-10-21 Ravi Pratap <ravi@ximian.com>
-
- * test-27.cs : Add to do various implicit and explicit
- reference conversions.
-
- * makefile : Update accordingly.
-
-2001-10-18 Ravi Pratap <ravi@ximian.com>
-
- * test-26.cs : Update to test delegate creation from another
- delegate.
-
-2001-10-17 Ravi Pratap <ravi@ximian.com>
-
- * test-26.cs : Added to demonstrate delegate support.
-
-2001-10-16 Miguel de Icaza <miguel@ximian.com>
-
- * test-25.cs: Added new test to excercise break/continue on
- various loop constructs.
-
- * test-24.cs: Test property use in expression and statement
- contexts.
-
-2001-10-14 Miguel de Icaza <miguel@ximian.com>
-
- * test-23.cs: Added new test for properties.
-
-2001-10-12 Ravi Pratap <ravi@ximian.com>
-
- * test-21.cs : Update to actually do some checking and return
- an appropriate value.
-
-2001-10-11 Ravi Pratap <ravi@ximian.com>
-
- * test-21.cs : Add. This is a test for testing our support
- for nested types
-
-2001-10-05 Ravi Pratap <ravi@ximian.com>
-
- * test-16.cs : Update to exercise the code which selects the best
- conversion operator based on "most encompassing/encompassed type"
-
- * test-7.cs : Update here too.
-
-2001-10-05 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Update to do explicit conversion tests.
-
- * makefile : small fix.
-
-2001-10-03 Ravi Pratap <ravi@ximian.com>
-
- * test-16.cs : Update to make the test more correct.
-
-2001-10-03 Ravi Pratap <ravi@ximian.com>
-
- * test-16.cs : Add.
-
- * makefile : update accordingly.
-
-2001-10-02 Miguel de Icaza <miguel@ximian.com>
-
- * makefile (test-compiler): Add rm *.exe before launching tests.
-
-2001-10-02 Ravi Pratap <ravi@ximian.com>
-
- * test-13.cs : Added.
-
- * makefile : update accordingly.
-
-2001-09-27 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Revamp and add more operator tests. Still in progress.
-
- * test-9,10.cs : Added by Miguel earlier.
-
-2001-09-26 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Update to return an exit code
-
- * test-8.cs : Added by Miguel.
-
-2001-09-25 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Update to include implicit conversion tests.
-
-2001-09-21 Ravi Pratap <ravi@ximian.com>
-
- * test-7.cs : Add.
-
-2001-09-21 Miguel de Icaza <miguel@ximian.com>
-
- * makefile (test-compiler): Abort tests on failure.
-
diff --git a/mcs/tests/c1.cs b/mcs/tests/c1.cs
deleted file mode 100755
index 8b81c046864..00000000000
--- a/mcs/tests/c1.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-// cs0146.cs: circular class definition
-// Line: 6
-class A : B {
-}
-
-class B : A {
-}
diff --git a/mcs/tests/c2.cs b/mcs/tests/c2.cs
deleted file mode 100755
index eeeb6f19e74..00000000000
--- a/mcs/tests/c2.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-class X {
-}
diff --git a/mcs/tests/casts.cs b/mcs/tests/casts.cs
deleted file mode 100755
index 8934e4eee7e..00000000000
--- a/mcs/tests/casts.cs
+++ /dev/null
@@ -1,566 +0,0 @@
-using System;
-class Test {
-
- static void receive_int (int a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_uint (uint a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_short (short a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_ushort (ushort a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_long (long a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_ulong (ulong a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_sbyte (sbyte a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_byte (byte a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void receive_char (char a)
- {
- Console.Write (" ");
- Console.WriteLine (a);
- }
-
- static void probe_int()
- {
- int zero = (int) 0;
- int min = (int) int.MinValue;
- int max = (int) int.MaxValue;
-
- Console.WriteLine ("Testing: int");
-
- Console.WriteLine (" arg: int (int)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (int)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (int)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (int)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (int)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (int)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (int)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (int)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (int)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_uint()
- {
- uint zero = (uint) 0;
- uint min = (uint) uint.MinValue;
- uint max = (uint) uint.MaxValue;
-
- Console.WriteLine ("Testing: uint");
-
- Console.WriteLine (" arg: int (uint)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (uint)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (uint)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (uint)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (uint)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (uint)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (uint)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (uint)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (uint)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_short()
- {
- short zero = (short) 0;
- short min = (short) short.MinValue;
- short max = (short) short.MaxValue;
-
- Console.WriteLine ("Testing: short");
-
- Console.WriteLine (" arg: int (short)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (short)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (short)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (short)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (short)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (short)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (short)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (short)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (short)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_ushort()
- {
- ushort zero = (ushort) 0;
- ushort min = (ushort) ushort.MinValue;
- ushort max = (ushort) ushort.MaxValue;
-
- Console.WriteLine ("Testing: ushort");
-
- Console.WriteLine (" arg: int (ushort)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (ushort)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (ushort)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (ushort)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (ushort)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (ushort)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (ushort)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (ushort)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (ushort)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_long()
- {
- long zero = (long) 0;
- long min = (long) long.MinValue;
- long max = (long) long.MaxValue;
-
- Console.WriteLine ("Testing: long");
-
- Console.WriteLine (" arg: int (long)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (long)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (long)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (long)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (long)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (long)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (long)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (long)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (long)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_ulong()
- {
- ulong zero = (ulong) 0;
- ulong min = (ulong) ulong.MinValue;
- ulong max = (ulong) ulong.MaxValue;
-
- Console.WriteLine ("Testing: ulong");
-
- Console.WriteLine (" arg: int (ulong)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (ulong)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (ulong)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (ulong)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (ulong)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (ulong)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (ulong)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (ulong)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (ulong)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_sbyte()
- {
- sbyte zero = (sbyte) 0;
- sbyte min = (sbyte) sbyte.MinValue;
- sbyte max = (sbyte) sbyte.MaxValue;
-
- Console.WriteLine ("Testing: sbyte");
-
- Console.WriteLine (" arg: int (sbyte)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (sbyte)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (sbyte)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (sbyte)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (sbyte)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (sbyte)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (sbyte)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (sbyte)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (sbyte)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_byte()
- {
- byte zero = (byte) 0;
- byte min = (byte) byte.MinValue;
- byte max = (byte) byte.MaxValue;
-
- Console.WriteLine ("Testing: byte");
-
- Console.WriteLine (" arg: int (byte)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (byte)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (byte)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (byte)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (byte)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (byte)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (byte)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (byte)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (byte)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void probe_char()
- {
- char zero = (char) 0;
- char min = (char) char.MinValue;
- char max = (char) char.MaxValue;
-
- Console.WriteLine ("Testing: char");
-
- Console.WriteLine (" arg: int (char)");
-
- receive_int (unchecked ((int) zero));
- receive_int (unchecked ((int) min));
- receive_int (unchecked ((int) max));
- Console.WriteLine (" arg: uint (char)");
-
- receive_uint (unchecked ((uint) zero));
- receive_uint (unchecked ((uint) min));
- receive_uint (unchecked ((uint) max));
- Console.WriteLine (" arg: short (char)");
-
- receive_short (unchecked ((short) zero));
- receive_short (unchecked ((short) min));
- receive_short (unchecked ((short) max));
- Console.WriteLine (" arg: ushort (char)");
-
- receive_ushort (unchecked ((ushort) zero));
- receive_ushort (unchecked ((ushort) min));
- receive_ushort (unchecked ((ushort) max));
- Console.WriteLine (" arg: long (char)");
-
- receive_long (unchecked ((long) zero));
- receive_long (unchecked ((long) min));
- receive_long (unchecked ((long) max));
- Console.WriteLine (" arg: ulong (char)");
-
- receive_ulong (unchecked ((ulong) zero));
- receive_ulong (unchecked ((ulong) min));
- receive_ulong (unchecked ((ulong) max));
- Console.WriteLine (" arg: sbyte (char)");
-
- receive_sbyte (unchecked ((sbyte) zero));
- receive_sbyte (unchecked ((sbyte) min));
- receive_sbyte (unchecked ((sbyte) max));
- Console.WriteLine (" arg: byte (char)");
-
- receive_byte (unchecked ((byte) zero));
- receive_byte (unchecked ((byte) min));
- receive_byte (unchecked ((byte) max));
- Console.WriteLine (" arg: char (char)");
-
- receive_char (unchecked ((char) zero));
- receive_char (unchecked ((char) min));
- receive_char (unchecked ((char) max));
- }
-
- static void Main ()
- {
- probe_int ();
- probe_uint ();
- probe_short ();
- probe_ushort ();
- probe_long ();
- probe_ulong ();
- probe_sbyte ();
- probe_byte ();
- probe_char ();
- }
-}
-
diff --git a/mcs/tests/co1.cs b/mcs/tests/co1.cs
deleted file mode 100755
index da1bdaab246..00000000000
--- a/mcs/tests/co1.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-class X {
- const int x = 1;
- const string s = "Hello";
-}
diff --git a/mcs/tests/cs1.cs b/mcs/tests/cs1.cs
deleted file mode 100755
index bfb3c74b3c8..00000000000
--- a/mcs/tests/cs1.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-class X {
-}
-
-struct Y {
-}
diff --git a/mcs/tests/csc-casts.out b/mcs/tests/csc-casts.out
deleted file mode 100755
index 70ce7135da8..00000000000
--- a/mcs/tests/csc-casts.out
+++ /dev/null
Binary files differ
diff --git a/mcs/tests/gen-cast-test.cs b/mcs/tests/gen-cast-test.cs
deleted file mode 100755
index d1f9531d2f1..00000000000
--- a/mcs/tests/gen-cast-test.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using System;
-
-class Stress {
-
- static string mode = "unchecked";
-
- static string [] types = {
- "int", "uint",
- "short", "ushort",
- "long", "ulong",
- "sbyte", "byte", "char"
- };
-
-
- static void w (string s)
- {
- Console.Write (s);
- }
-
- static void wl (string s)
- {
- Console.WriteLine (s);
- }
-
- static void generate_receptors ()
- {
- foreach (string t in types){
- w ("\tstatic void receive_" + t + " (" + t + " a)\n\t{\n");
- w ("\t\tConsole.Write (\" \");\n");
- w ("\t\tConsole.WriteLine (a);\n");
- w ("\t}\n\n");
- }
-
- }
-
- static void var (string type, string name, string init)
- {
- w ("\t\t" + type + " " + name + " = (" + type + ") " + init + ";\n");
- }
-
- static void call (string type, string name)
- {
- w ("\t\treceive_" + type + " (" + mode + "((" + type + ") " + name + "));\n");
- }
-
- static void generate_emision ()
- {
- foreach (string type in types){
- w ("\tstatic void probe_" + type + "()\n\t{\n");
- var (type, "zero", "0");
- var (type, "min", type + ".MinValue");
- var (type, "max", type + ".MaxValue");
- wl ("");
-
- wl ("\t\tConsole.WriteLine (\"Testing: " + type + "\");\n");
- foreach (string t in types){
- wl ("\t\tConsole.WriteLine (\" arg: " + t + " (" + type + ")\");\n");
- call (t, "zero");
- call (t, "min");
- call (t, "max");
- }
-
- w ("\t}\n\n");
- }
- }
-
- static void generate_main ()
- {
- wl ("\tstatic void Main ()\n\t{");
-
- foreach (string t in types){
- w ("\t\tprobe_" + t + " ();\n");
- }
- wl ("\t}");
- }
-
- static void Main (string [] args)
- {
- foreach (string arg in args){
- if (arg == "-h" || arg == "--help"){
- Console.WriteLine ("-h, --help Shows help");
- Console.WriteLine ("-c, --checked Generate checked contexts");
- return;
- }
- if (arg == "--checked" || arg == "-c"){
- mode = "checked";
- continue;
- }
- }
- wl ("using System;\nclass Test {\n");
-
- generate_receptors ();
- generate_emision ();
-
- generate_main ();
-
- wl ("}\n");
- }
-}
diff --git a/mcs/tests/gen-check.cs b/mcs/tests/gen-check.cs
deleted file mode 100755
index 9077b141a74..00000000000
--- a/mcs/tests/gen-check.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-
-class Stress {
-
- static string [] types = {
- "int", "uint",
- "short", "ushort",
- "long", "ulong",
- "sbyte", "byte", "char"
- };
-
-
- static void w (string s)
- {
- Console.Write (s);
- }
-
- static void wl (string s)
- {
- Console.WriteLine (s);
- }
-
- static void generate_receptors ()
- {
- foreach (string t in types){
- w ("\tstatic void receive_" + t + " (" + t + " a)\n\t{\n");
- w ("\t\tConsole.Write (\" \");\n");
- w ("\t\tConsole.WriteLine (a);\n");
- w ("\t}\n\n");
- }
-
- }
-
- static void call (string type, string name)
- {
- w ("\t\treceive_" + type + " (checked ((" + type + ") var ));\n");
- }
-
- static void generate_emision ()
- {
- foreach (string type in types){
- w ("\tstatic void probe_" + type + "()\n\t{\n");
- if (type == "char")
- w ("\t\t" + type + " var = (char) 0;");
- else
- w ("\t\t" + type + " var = 0;");
-
- wl ("");
-
- foreach (string t in types)
- call (t, "var");
-
- w ("\t}\n\n");
- }
- }
-
- static void generate_main ()
- {
- wl ("\tstatic void Main ()\n\t{");
-
- foreach (string t in types){
- w ("\t\tprobe_" + t + " ();\n");
- }
- wl ("\t}");
- }
-
- static void Main (string [] args)
- {
- wl ("using System;\nclass Test {\n");
-
- generate_receptors ();
- generate_emision ();
-
- generate_main ();
-
- wl ("}\n");
- }
-}
diff --git a/mcs/tests/i-recursive.cs b/mcs/tests/i-recursive.cs
deleted file mode 100644
index 9c22e5876cc..00000000000
--- a/mcs/tests/i-recursive.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-interface A : B {
-}
-
-interface B : A {
-}
diff --git a/mcs/tests/i-three.cs b/mcs/tests/i-three.cs
deleted file mode 100755
index 7c473f21657..00000000000
--- a/mcs/tests/i-three.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-interface A {
-}
-
-interface B : A{
-}
-
-interface C : A {
-}
-
-interface D : C {
-}
diff --git a/mcs/tests/i-undefined.cs b/mcs/tests/i-undefined.cs
deleted file mode 100644
index 496795cd6db..00000000000
--- a/mcs/tests/i-undefined.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-interface A : B {
-}
diff --git a/mcs/tests/i1.cs b/mcs/tests/i1.cs
deleted file mode 100755
index 00141820820..00000000000
--- a/mcs/tests/i1.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-interface A {
-}
diff --git a/mcs/tests/i2.cs b/mcs/tests/i2.cs
deleted file mode 100755
index 9c22e5876cc..00000000000
--- a/mcs/tests/i2.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-interface A : B {
-}
-
-interface B : A {
-}
diff --git a/mcs/tests/i3.cs b/mcs/tests/i3.cs
deleted file mode 100755
index dff6c54db9d..00000000000
--- a/mcs/tests/i3.cs
+++ /dev/null
@@ -1,5 +0,0 @@
-class X {
-}
-
-interface A : X {
-}
diff --git a/mcs/tests/i4.cs b/mcs/tests/i4.cs
deleted file mode 100755
index f89988f2cb3..00000000000
--- a/mcs/tests/i4.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// cs0509.cs: base class is sealed
-// Line: 7
-struct V {
- int v;
-}
-
-class X : V {
-}
diff --git a/mcs/tests/i5.cs b/mcs/tests/i5.cs
deleted file mode 100755
index e312377061b..00000000000
--- a/mcs/tests/i5.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-class A1 {
-}
-
-class A2 {
-}
-
-class B : A1, A2 {
-}
diff --git a/mcs/tests/i6.cs b/mcs/tests/i6.cs
deleted file mode 100755
index fa20da0ada8..00000000000
--- a/mcs/tests/i6.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-// cs0246.cs: can not find type `B'
-// Line: 4
-class X : D {
-}
diff --git a/mcs/tests/interfaces.cs b/mcs/tests/interfaces.cs
deleted file mode 100755
index 6fcd9ec3061..00000000000
--- a/mcs/tests/interfaces.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-interface X {
-
- // Methods
- new int IntegerMethod (int a, int b);
- new int IntegerMethod (int a, string c);
- new int StringMethod ();
- int A (string b);
-
- // Properties
- new string TheString { get; set; }
- int TheInt { get; }
- int TheInt2 { set; }
- int TheInt3 { set; get; }
-
- // Events
- new event int MyEvent;
- event string MyEvent2;
-
- // Indexers
-}
-
-
diff --git a/mcs/tests/ix1.cs b/mcs/tests/ix1.cs
deleted file mode 100755
index 984391d2fda..00000000000
--- a/mcs/tests/ix1.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-interface INTERFACE {
- string PROPERTY { get; set; }
-}
diff --git a/mcs/tests/ix2.cs b/mcs/tests/ix2.cs
deleted file mode 100755
index c36b52ea2ac..00000000000
--- a/mcs/tests/ix2.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-interface Blah {
- string this [ int INDEX ] { get; set; }
- string Item (int index);
-}
-
-public class Foo {
-
- public static void Main ()
- {
- Console.WriteLine ("foo");
- }
-}
-
diff --git a/mcs/tests/makefile b/mcs/tests/makefile
deleted file mode 100755
index d722b4546bc..00000000000
--- a/mcs/tests/makefile
+++ /dev/null
@@ -1,133 +0,0 @@
-CSC=csc.exe
-
-MCS=../mcs/mcs.exe
-VERIFY=../tools/verifier.exe
-
-TEST_SOURCES = \
- test-1 test-2 test-3 test-4 test-5 test-6 test-7 test-8 test-9 test-10 \
- test-11 test-12 test-13 test-14 test-15 test-16 test-17 test-18 test-19 test-20 \
- test-21 test-22 test-23 test-24 test-25 test-26 test-27 test-28 test-30 \
- test-31 test-32 test-33 test-34 test-35 test-36 test-37 test-39 \
- test-41 test-42 test-43 test-44 test-46 test-47 test-48 test-49 \
- test-51 test-54 test-55 test-56 test-57 test-59 test-60 \
- test-61 test-62 test-63 test-64 test-65 test-66 test-68 test-69 test-70 \
- test-71 test-72 test-73 test-74 test-75 test-76 test-77 test-78 test-79 test-80 \
- test-81 test-82 test-83 test-84 test-85 test-86 test-87 test-88 test-89 test-90 \
- test-92 test-93 test-94 test-95 test-96 test-97 test-98 test-99 test-100\
- test-101 test-102 test-103 test-104 test-105 test-108 test-109 test-110\
- test-111 test-112 test-113 test-114 test-115 test-116 test-117 test-118 test-119 \
- test-121 test-123 test-125 test-126 test-127 test-128 test-129 test-130 \
- test-131 test-134 test-135
-
-UNSAFE_SOURCES = \
- unsafe-1 unsafe-2 unsafe-3
-
-WINDOWS_SOURCES = \
- test-50 test-67
-
-# A test is a 'no pass' if it fails on either windows or linux
-# Test 120 does not pass because the MS.NET runtime is buggy.
-TEST_NOPASS = \
- test-29 test-38 test-40 test-45 test-52 test-53 test-91 test-106 test-107 \
- test-120 test-122 test-132 test-133
-
-all: test-compiler test-unsafe test-windows
-
-
-# Compile with mono, run with MS jit
-test-compiler:
- @rm -f *.exe; \
- for i in $(TEST_SOURCES); do \
- echo -n "Running $$i ... "; \
- if $(MCS) $$i.cs > /dev/null; then \
- if ./$$i.exe > /dev/null; then \
- echo OK; \
- else \
- echo FAILED; exit 1; \
- fi; \
- else \
- echo FAILED TO COMPILE; exit 1; \
- fi \
- done
-
-# Compile with mono, run with MS jit
-test-unsafe:
- @for i in $(UNSAFE_SOURCES); do \
- echo -n "Running (unsafe) $$i ... "; \
- if $(MCS) --unsafe $$i.cs > /dev/null; then \
- if ./$$i.exe > /dev/null; then \
- echo OK; \
- else \
- echo FAILED; exit 1; \
- fi; \
- else \
- echo FAILED WHILE COMPILING; exit 1; \
- fi \
- done
-
-# Compiled (previously) with mono, run with mono jit
-test-jit:
- @for i in $(TEST_SOURCES:.cs=.exe); do \
- echo -n "Running jit $$i ... "; \
- if mono ./$$i.exe > /dev/null; then \
- echo OK; \
- else \
- echo FAILED; exit 1; \
- fi \
- done
-
-# Compiled with mono, run with MS jit
-test-windows:
- @echo Running windows-only tests - these will fail on linux; \
- for i in $(WINDOWS_SOURCES); do \
- echo -n "Running $$i ... "; \
- if $(MCS) $$i.cs > /dev/null; then \
- if ./$$i.exe > /dev/null; then \
- echo OK; \
- else \
- echo FAILED; exit 1; \
- fi; \
- else \
- echo FAILED TO COMPILE; exit 1; \
- fi \
- done
-
-verify:
- @for i in $(TEST_SOURCES); do \
- if $(MCS) -o mcs-gen-code.exe $$i.cs > /dev/null; then \
- if $(CSC) /out:csc-gen-code.exe $$i.cs > /dev/null; then \
- if $(VERIFY) mcs-gen-code.exe csc-gen-code.exe > /dev/null; then \
- echo $$i: identical assemblies; \
- else \
- echo $$i: unidentical assemblies; exit; \
- fi; \
- fi \
- fi \
- done; \
- echo Verification passed
-
-
-casts.cs: gen-cast-test.cs
- $(CSC) /out:csc-cast.exe gen-cast-test.cs
- ./csc-cast > casts.cs
-
-casts-csc.exe: casts.cs
- $(CSC) /out:casts-csc.exe casts.cs
-
-casts.exe: casts.cs
- $(MCS) casts.cs
-
-csc-casts.out: casts-csc.exe
- ./casts-csc.exe > csc-casts.out
-
-msc-casts.out: casts.exe
- ./casts.exe > msc-casts.out
-
-test-casts: csc-casts.out msc-casts.out
- cmp csc-casts.out msc-casts.out
-
-clean:
- rm *.exe
- rm *.out
- rm casts.cs
-
diff --git a/mcs/tests/n1.cs b/mcs/tests/n1.cs
deleted file mode 100755
index b47fd24b2ca..00000000000
--- a/mcs/tests/n1.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace A {
- class X {
- void Y () {}
- }
-}
-
-namespace A {
- class XX : X {
- void YY () {}
- }
-}
diff --git a/mcs/tests/n2.cs b/mcs/tests/n2.cs
deleted file mode 100755
index 34c210e1fe7..00000000000
--- a/mcs/tests/n2.cs
+++ /dev/null
@@ -1,4 +0,0 @@
-using System.Collections;
-
-class X : Queue {
-}
diff --git a/mcs/tests/s1.cs b/mcs/tests/s1.cs
deleted file mode 100755
index 6c1191a86a0..00000000000
--- a/mcs/tests/s1.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-struct A {
- int x;
-}
-
-struct B : A {
- int y;
-}
diff --git a/mcs/tests/test-1.cs b/mcs/tests/test-1.cs
deleted file mode 100755
index adb1dd88a92..00000000000
--- a/mcs/tests/test-1.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-class X {
- static int Main (string [] args)
- {
- Console.WriteLine ("Hello, World!");
- return 0;
- }
-}
diff --git a/mcs/tests/test-10.cs b/mcs/tests/test-10.cs
deleted file mode 100644
index 20e1cc6ee81..00000000000
--- a/mcs/tests/test-10.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Test explicit numeric conversions.
- */
-
-using System;
-
-class X {
-
- void asbyte (byte a, ushort b, uint c, ulong d, char e)
- {
- }
-
- void bsbyte ()
- {
- sbyte s = 0;
-
- asbyte ((byte) s, (ushort) s, (uint) s, (ulong) s, (char) s);
- asbyte (checked ((byte) s), checked ((ushort) s), checked ((uint) s), checked ((ulong) s), checked ((char) s));
- }
-
- void abyte (sbyte a, char b)
- {
- }
-
- void bbyte ()
- {
- byte b = 0;
-
- abyte ((sbyte) b, (char) b);
- abyte (checked ((sbyte) b), checked ((char) b));
- }
-
- void ashort (sbyte a, byte b, ushort c, uint d, ulong e, char f)
- {
- }
-
- void bshort ()
- {
- short a = 1;
-
- ashort ((sbyte) a, (byte) a, (ushort) a, (uint) a, (ulong) a, (char) a);
- ashort (checked ((sbyte) a), checked ((byte) a), checked ((ushort) a), checked ((uint) a), checked ((ulong) a), checked ((char) a));
- }
-
- void aushort (sbyte a, byte b, short c, char d)
- {
- }
-
- void bushort ()
- {
- ushort a = 1;
- aushort ((sbyte) a, (byte) a, (short) a, (char) a);
- aushort (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((char) a));
- }
-
- void aint (sbyte a, byte b, short c, ushort d, uint e, ulong f, char g)
- {
- }
-
- void bint ()
- {
- int a = 1;
-
- aint ((sbyte) a, (byte) a, (short) a, (ushort) a, (uint) a, (ulong) a, (char) a);
- aint (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((uint) a), checked ((ulong) a), checked ((char) a));
- }
-
- void auint (sbyte a, byte b, short c, ushort d, int e, char f)
- {
- }
-
- void buint ()
- {
- uint a = 1;
-
- auint ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (char) a);
- auint (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((char) a));
- }
-
- void along (sbyte a, byte b, short c, ushort d, int e, uint f, ulong g, char h)
- {
- }
-
- void blong ()
- {
- long a = 1;
-
- along ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (ulong) a, (char) a);
- along (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((ulong) a), checked ((char) a));
- }
-
- void aulong (sbyte a, byte b, short c, ushort d, int e, uint f, long g, char h)
- {
- }
-
- void bulong ()
- {
- ulong a = 1;
-
- aulong ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (long) a, (char) a);
- aulong (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((long) a), checked ((char) a));
- }
-
- void achar (sbyte a, byte b, short c)
- {
-
- }
-
- void bchar ()
- {
- char a = (char) 1;
-
- achar ((sbyte) a, (byte) a, (short) a);
- achar (checked ((sbyte) a), checked ((byte) a), checked ((short) a));
- }
-
- void afloat (sbyte a, byte b, short c, ushort d, int e, uint f, long ll, ulong g, char h, decimal dd)
- {
- }
-
- void bfloat ()
- {
- float a = 1;
-
- afloat ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (long) a,
- (ulong) a, (char) a, (decimal) a);
- afloat (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((long) a),
-checked ( (ulong) a), checked ((char) a), checked ((decimal) a));
- }
-
- void adouble (sbyte a, byte b, short c, ushort d, int e, uint f, long ll, ulong g, char h,
- float ff, decimal dd)
- {
- }
-
- void bdouble ()
- {
- double a = 1;
-
- adouble ((sbyte) a, (byte) a, (short) a, (ushort) a, (int) a, (uint) a, (long) a,
- (ulong) a, (char) a, (float) a, (decimal) a);
- adouble (checked ((sbyte) a), checked ((byte) a), checked ((short) a), checked ((ushort) a), checked ((int) a), checked ((uint) a), checked ((long) a),
-checked ( (ulong) a), checked ((char) a), checked ((float) a), (decimal) a);
- }
-
- static void Main ()
- {
-
- }
-}
diff --git a/mcs/tests/test-100.cs b/mcs/tests/test-100.cs
deleted file mode 100755
index da77cf3cdda..00000000000
--- a/mcs/tests/test-100.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-namespace GLib {
-
- using System;
- using System.Runtime.InteropServices;
-
- public class Object {
- int v;
-
- protected int Raw {
- get {
- return 1;
- }
- set {
- v = value;
- }
- }
-
- [DllImport("bah", CallingConvention=CallingConvention.Cdecl)]
- static extern void g_object_get (int obj);
-
- public void GetProperty ()
- {
- g_object_get (Raw);
- }
-
- static int Main ()
- {
- return 0;
- }
- }
-}
diff --git a/mcs/tests/test-101.cs b/mcs/tests/test-101.cs
deleted file mode 100644
index c0256030fc0..00000000000
--- a/mcs/tests/test-101.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace Test {
-
- public class MyAttribute: Attribute {
- public string val;
- public MyAttribute (string stuff) {
- System.Console.WriteLine (stuff);
- val = stuff;
- }
- }
-
- public class My2Attribute: MyAttribute {
- public int ival;
- public My2Attribute (string stuff, int blah) : base (stuff) {
- System.Console.WriteLine ("ctor with int val"+stuff);
- ival = blah;
- }
- }
-
- [My("testclass")]
- [My2("testclass", 22)]
- public class Test {
- static public int Main() {
- System.Reflection.MemberInfo info = typeof (Test);
- object[] attributes = info.GetCustomAttributes (false);
- for (int i = 0; i < attributes.Length; i ++) {
- System.Console.WriteLine(attributes[i]);
- }
- if (attributes.Length != 2)
- return 1;
- MyAttribute attr = (MyAttribute) attributes [0];
- if (attr.val != "testclass")
- return 2;
- return 0;
- }
- }
-}
diff --git a/mcs/tests/test-102.cs b/mcs/tests/test-102.cs
deleted file mode 100644
index 39f018c1378..00000000000
--- a/mcs/tests/test-102.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Reflection;
-
-[assembly: AssemblyTitle ("Foo")]
-[assembly: AssemblyVersion ("1.0.2")]
-
-namespace N1 {
-
- [AttributeUsage (AttributeTargets.All)]
- public class MineAttribute : Attribute {
-
- string name;
-
- public MineAttribute (string s)
- {
- name = s;
- }
- }
-
- interface A {
- [Mine ("hello")]
- void Hello ();
- }
-
- public class Foo {
-
- int i;
-
- [Mine ("Foo")]
- public static int Main ()
- {
- return 0;
- }
- }
-}
diff --git a/mcs/tests/test-103.cs b/mcs/tests/test-103.cs
deleted file mode 100755
index 09974f4cc29..00000000000
--- a/mcs/tests/test-103.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// We should also allow overrides to work on protected methods.
-// Only private is not considered part of the override process.
-//
-abstract class A {
- protected abstract int Foo ();
-}
-
-class B : A {
- protected override int Foo ()
- {
- return 0;
- }
-
- public int M ()
- {
- return Foo ();
- }
-}
-
-class Test {
- public static int Main ()
- {
- return new B ().M ();
- }
-}
-
-
diff --git a/mcs/tests/test-104.cs b/mcs/tests/test-104.cs
deleted file mode 100644
index 82fcfac57fd..00000000000
--- a/mcs/tests/test-104.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// Test to ensure we do correct overload resolution
-//
-using System;
-
-class Test {
- public static int Main(String[] args) {
- int iTest = 1;
-
- System.Threading.Interlocked.Increment(ref iTest);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-105.cs b/mcs/tests/test-105.cs
deleted file mode 100644
index ddfc2dbc05b..00000000000
--- a/mcs/tests/test-105.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using System.Threading;
-using System.Runtime.InteropServices;
-
-class Test {
- delegate int SimpleDelegate (int a);
-
- static int F (int a) {
- Console.WriteLine ("Test.F from delegate: " + a);
- Thread.Sleep (200);
- return a;
- }
-
- static void async_callback (IAsyncResult ar)
- {
- Console.WriteLine ("Async Callback " + ar.AsyncState);
- }
-
- static int Main () {
- SimpleDelegate d = new SimpleDelegate (F);
- AsyncCallback ac = new AsyncCallback (async_callback);
- string state1 = "STATE1";
- string state2 = "STATE2";
- string state3 = "STATE3";
- string state4 = "STATE4";
- int fin = 0;
-
- IAsyncResult ar1 = d.BeginInvoke (1, ac, state1);
- IAsyncResult ar2 = d.BeginInvoke (2, ac, state2);
- IAsyncResult ar3 = d.BeginInvoke (3, ac, state3);
- IAsyncResult ar4 = d.BeginInvoke (4, ac, state4);
-
- int res = d.EndInvoke (ar1);
-
- Console.WriteLine ("Result = " + res);
-
- try {
- d.EndInvoke (ar1);
- } catch (InvalidOperationException) {
- Console.WriteLine ("cant execute EndInvoke twice ... OK");
- }
-
- ar1.AsyncWaitHandle.WaitOne ();
- if (ar1.IsCompleted) fin++;
- Console.WriteLine ("completed1: " + ar1.IsCompleted);
- ar2.AsyncWaitHandle.WaitOne ();
- if (ar2.IsCompleted) fin++;
- Console.WriteLine ("completed2: " + ar2.IsCompleted);
- ar3.AsyncWaitHandle.WaitOne ();
- if (ar3.IsCompleted) fin++;
- Console.WriteLine ("completed3: " + ar3.IsCompleted);
- ar4.AsyncWaitHandle.WaitOne ();
- if (ar4.IsCompleted) fin++;
- Console.WriteLine ("completed4: " + ar4.IsCompleted);
-
- if (fin != 4)
- return 1;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-106.cs b/mcs/tests/test-106.cs
deleted file mode 100644
index 52b5f61d9f1..00000000000
--- a/mcs/tests/test-106.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Threading;
-using System.Runtime.InteropServices;
-
-class Test {
- delegate int SimpleDelegate (int a);
-
- static int cb_state = 0;
-
- static int F (int a) {
- Console.WriteLine ("Test.F from delegate: " + a);
- throw new NotImplementedException ();
- }
-
- static void async_callback (IAsyncResult ar)
- {
- Console.WriteLine ("Async Callback " + ar.AsyncState);
- cb_state = 1;
- throw new NotImplementedException ();
- }
-
- static int Main () {
- SimpleDelegate d = new SimpleDelegate (F);
- AsyncCallback ac = new AsyncCallback (async_callback);
- string state1 = "STATE1";
- int res = 0;
-
- IAsyncResult ar1 = d.BeginInvoke (1, ac, state1);
-
- ar1.AsyncWaitHandle.WaitOne ();
-
- try {
- res = d.EndInvoke (ar1);
- } catch (NotImplementedException) {
- res = 1;
- Console.WriteLine ("received exception ... OK");
- }
-
- while (cb_state == 0)
- Thread.Sleep (0);
-
- if (cb_state != 1)
- return 1;
-
- if (res != 1)
- return 2;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-107.cs b/mcs/tests/test-107.cs
deleted file mode 100644
index a5639efa8f0..00000000000
--- a/mcs/tests/test-107.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-using System.Threading;
-using System.Runtime.InteropServices;
-using System.Runtime.Remoting.Messaging;
-
-class Test {
- delegate int SimpleDelegate (int a);
-
- static int cb_state = 0;
-
- static int F (int a) {
- Console.WriteLine ("Test.F from delegate: " + a);
- throw new NotImplementedException ();
- }
-
- static void async_callback (IAsyncResult ar)
- {
- AsyncResult ares = (AsyncResult)ar;
- AsyncCallback ac = new AsyncCallback (async_callback);
-
- Console.WriteLine ("Async Callback " + ar.AsyncState);
- cb_state++;
- SimpleDelegate d = (SimpleDelegate)ares.AsyncDelegate;
-
- if (cb_state < 5)
- d.BeginInvoke (cb_state, ac, cb_state);
-
- //throw new NotImplementedException ();
- }
-
- static int Main () {
- SimpleDelegate d = new SimpleDelegate (F);
- AsyncCallback ac = new AsyncCallback (async_callback);
-
- IAsyncResult ar1 = d.BeginInvoke (cb_state, ac, cb_state);
-
- ar1.AsyncWaitHandle.WaitOne ();
-
-
- while (cb_state < 5)
- Thread.Sleep (200);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-108.cs b/mcs/tests/test-108.cs
deleted file mode 100755
index 2edc56d9457..00000000000
--- a/mcs/tests/test-108.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-class X {
-
- static int Main ()
- {
- int i = 0;
-
- if (false){
- i = 1;
- return 1;
- }
-
- if (true)
- i = 2;
- else
- i = 3;
-
- if (i != 2)
- return 5;
-
- while (true){
- i++;
- if (i == 10)
- break;
- }
-
- while (false){
- i--;
- return 3;
- }
-
- if (i != 10)
- return 2;
-
- do {
- if (i++ == 20)
- break;
- } while (true);
-
- if (i != 21)
- return 4;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-109.cs b/mcs/tests/test-109.cs
deleted file mode 100755
index 740155886cd..00000000000
--- a/mcs/tests/test-109.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-class T {
- static int Main ()
- {
- //
- // Just a test to compile the following:
- //
- string a = "Time is: " + DateTime.Now;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-11.cs b/mcs/tests/test-11.cs
deleted file mode 100644
index c122201d472..00000000000
--- a/mcs/tests/test-11.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.IO;
-
-public class Test {
-
- public static int boxtest ()
- {
- int i = 123;
- object o = i;
-// int j = (int) o;
-
-// if (i != j)
-// return 1;
-
- return 0;
- }
-
- public static int Main () {
- if (boxtest () != 0)
- return 1;
-
-
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/test-110.cs b/mcs/tests/test-110.cs
deleted file mode 100755
index b8900991ed3..00000000000
--- a/mcs/tests/test-110.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// Special test case for the Compound Assignment for the
-// second case (not the obvious one, but the one with
-// implicit casts)
-
-using System;
-
-namespace test
-{
- public class test
- {
- static int test_method(int vv)
- {
- byte b = 45;
-
- // The cast below will force the expression into being
- // a byte, and we basically make an explicit cast from
- // the return of "<<" from int to byte (the right-side type
- // of the compound assignemtn)
- b |= (byte)(vv << 1);
-
- return b;
- }
-
- public static int Main ()
- {
- if (test_method (1) != 47)
- return 1;
- return 0;
- }
- }
-}
diff --git a/mcs/tests/test-111.cs b/mcs/tests/test-111.cs
deleted file mode 100755
index 4af5997bef9..00000000000
--- a/mcs/tests/test-111.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-class T {
- static object get_obj() {
- return new object ();
- }
- static int Main() {
- object o = get_obj ();
- if (o == "string")
- return 1;
- return 0;
- }
-}
diff --git a/mcs/tests/test-112.cs b/mcs/tests/test-112.cs
deleted file mode 100755
index c1c28547991..00000000000
--- a/mcs/tests/test-112.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// This tests the use of an array indexer on value exprclasses
-// and not only variables
-//
-class X {
- static int [] g ()
- {
- int [] x = new int [5];
- x [1] = 10;
- return x;
- }
-
- static int Main ()
- {
- if (g () [1] == 10)
- return 0;
- return 1;
- }
-}
diff --git a/mcs/tests/test-113.cs b/mcs/tests/test-113.cs
deleted file mode 100644
index 67399cf2f27..00000000000
--- a/mcs/tests/test-113.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-
-class X {
-
- IntPtr Raw;
-
- void g_object_get (IntPtr obj, string name, out string val, IntPtr term)
- {
- }
-
- public void GetProperty (String name, out String val)
- {
- g_object_get (Raw, name, out val, new IntPtr (0));
- }
-
- void g_object_get (IntPtr obj, string name, out bool val, IntPtr term)
- {
- }
-
- public void GetProperty (String name, out bool val)
- {
- g_object_get (Raw, name, out val, new IntPtr (0));
- }
-
- public static int Main ()
- {
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-114.cs b/mcs/tests/test-114.cs
deleted file mode 100644
index 36925d310be..00000000000
--- a/mcs/tests/test-114.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-class MyClass {
-
- delegate bool IsAnything (Char c);
-
- public static int Main () {
- IsAnything validDigit;
- validDigit = new IsAnything (Char.IsDigit);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-115.cs b/mcs/tests/test-115.cs
deleted file mode 100755
index 02b630e0225..00000000000
--- a/mcs/tests/test-115.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// This is a compile test, submitted by Joe. We really need
-// a more thorough set of tests for the user defined explicit
-// conversions
-//
-using System;
-
-class A {
- public static explicit operator X (A foo)
- {
- X myX = new X();
-
- return myX;
- }
-}
-
-class X {
-}
-
-class Y : X {
-}
-
-class blah {
- public static int Main ()
- {
- A testA = new A();
-
- X testX = (X) testA;
-
- try {
- Y testY = (Y) testA;
- } catch (InvalidCastException){
- return 0;
- }
-
- //
- // We should have thrown the exception above
- //
- return 1;
- }
-}
-
diff --git a/mcs/tests/test-116.cs b/mcs/tests/test-116.cs
deleted file mode 100755
index c5690ba62f1..00000000000
--- a/mcs/tests/test-116.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// Parsing tests
-//
-
-class X {
- static int Main ()
- {
- double d = 1.4e-4;
- // add more ;-)
- return 0;
- }
-}
diff --git a/mcs/tests/test-117.cs b/mcs/tests/test-117.cs
deleted file mode 100644
index d6745124677..00000000000
--- a/mcs/tests/test-117.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Collections;
-
-public interface IFoo {
-
-}
-
-public class Blah : IFoo {
-
- Hashtable table;
-
- public Blah ()
- {
- table = new Hashtable ();
- }
-
- public static int Main ()
- {
- Blah b = new Blah ();
-
- b.table.Add ("Ravi", (IFoo) b);
-
- return 0;
- }
-
-
-
-}
diff --git a/mcs/tests/test-118.cs b/mcs/tests/test-118.cs
deleted file mode 100755
index 7e814876687..00000000000
--- a/mcs/tests/test-118.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Security.Policy;
-using System.Threading;
-
-class Container {
-
- // LoaderOptimization exists as an enum
- // and LoaderOptimization is also the abbreviation for
- // LoaderOptimizationAttribute
- [LoaderOptimization (LoaderOptimization.SingleDomain)]
- static int Main (string[] args) {
- return 0;
- }
-}
diff --git a/mcs/tests/test-119.cs b/mcs/tests/test-119.cs
deleted file mode 100644
index be7d7695a22..00000000000
--- a/mcs/tests/test-119.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-class Value {
- public static explicit operator int (Value val)
- {
- return 1;
- }
-
- public static explicit operator MyObject (Value val)
- {
- return new MyObject (1);
- }
-
- public static explicit operator uint (Value val)
- {
- return 1;
- }
-}
-
-class MyObject {
- public MyObject (int i) {}
-}
-
-class Derived : MyObject {
- public Derived (int i) : base (i) { }
-
- Derived Blah ()
- {
- Value val = new Value ();
-
- return (Derived) val;
- }
-}
-
-class Test {
- static int Main ()
- {
- Value v = new Value ();
-
- v = null;
-
- try {
- // This will throw an exception.
- // This test is more of a compile test, we need a real
- // good test that does not require this lame catch.
- Derived d = (Derived) v;
- } catch {
- }
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-12.cs b/mcs/tests/test-12.cs
deleted file mode 100644
index b788eb89dd1..00000000000
--- a/mcs/tests/test-12.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Tests the ?: operator and the string concatenation
- */
-
-using System;
-class X {
- static int Main (string [] args)
- {
- string a = "hello";
- string b = "1";
- string c = a + b;
- string d = a + 1;
- string y;
-
- if (c != d)
- return 1;
- if (d != (a + b))
- return 2;
- if (d != x (a, b))
- return 3;
- if (d != x (a, 1))
- return 4;
-
- y = c == d ? "equal" : "not-equal";
- if (y != "equal")
- return 5;
- y = b == a ? "oops" : "nice";
- if (y != "nice")
- return 6;
-
- Console.WriteLine (c);
- return 0;
- }
-
- static string s (string a, int o)
- {
- return a + o;
- }
- static string x (string s, object o)
- {
- return s + o;
- }
-
-}
diff --git a/mcs/tests/test-120.cs b/mcs/tests/test-120.cs
deleted file mode 100755
index 5d4f5180a34..00000000000
--- a/mcs/tests/test-120.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// This tests checks that the compiler catches the special attributes
-// for in a struct for CharSet, and turns the right bit on the TypeAttribute
-//
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Unicode)]
-struct MyUnicode
-{
- [FieldOffset(0)] public float fh_float;
- [FieldOffset(0)] public int fh_int;
-}
-
-[StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Ansi)]
-struct MyAnsi
-{
- [FieldOffset(0)] public float fh_float;
- [FieldOffset(0)] public int fh_int;
-}
-[StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Auto)]
-struct MyAuto
-{
- [FieldOffset(0)] public float fh_float;
- [FieldOffset(0)] public int fh_int;
-}
-
-class test
-{
-
- static int Main ()
- {
- Type t = typeof (MyUnicode);
-
- if ((t.Attributes & TypeAttributes.UnicodeClass) != TypeAttributes.UnicodeClass){
- Console.WriteLine ("Class MyUnicode does not have Unicode bit set");
- return 1;
- }
-
- t = typeof (MyAuto);
- if ((t.Attributes & TypeAttributes.AutoClass) != TypeAttributes.AutoClass){
- Console.WriteLine ("Class MyAuto does not have Auto bit set");
- return 2;
- }
-
- t = typeof (MyAnsi);
-
- if ((t.Attributes & TypeAttributes.AnsiClass) != TypeAttributes.AnsiClass){
- Console.WriteLine ("Class MyUnicode does not have Ansi bit set");
- return 3;
- }
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-121.cs b/mcs/tests/test-121.cs
deleted file mode 100755
index 21e96bc967f..00000000000
--- a/mcs/tests/test-121.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// This test excercises the fact that array evaluation in UnaryMutator and
-// CompoundAssign expressions should never mutate data more than once
-//
-class X {
- static int g_calls;
-
- static int g ()
- {
- g_calls++;
- return 0;
- }
-
-
- static int Main ()
- {
- int [] a = new int [10];
- int i = 0;
-
- a [0] = 1;
-
- a [i++] += 3;
-
- if (i != 1)
- return 1;
- if (a [0] != 4)
- return 2;
-
- a [g ()]++ ;
-
- if (g_calls != 1)
- return 3;
- return 0;
- }
-}
diff --git a/mcs/tests/test-122.cs b/mcs/tests/test-122.cs
deleted file mode 100755
index 27a08e8adde..00000000000
--- a/mcs/tests/test-122.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Tests that a nested class has full access to its container members
-//
-// A compile-only test.
-//
-
-class A {
- private static int X = 0;
-
- class B {
- void Foo ()
- {
- ++ X;
- }
- }
-
- public static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-123.cs b/mcs/tests/test-123.cs
deleted file mode 100755
index 87f7dbbfe01..00000000000
--- a/mcs/tests/test-123.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-class X {
-
- static object get_non_null ()
- {
- return new X ();
- }
-
- static object get_null ()
- {
- return null;
- }
-
- static int Main ()
- {
- int a = 5;
- object o;
- decimal d = 0M;
-
- //
- // compile time
- //
- if (!(get_non_null () is object))
- return 1;
-
- if (get_null () is object)
- return 2;
-
- if (!(a is object))
- return 3;
-
- //
- // explicit reference
- //
- if (null is object)
- return 4;
-
- o = a;
- if (!(o is int))
- return 5;
-
- if (d is int)
- return 6;
-
- System.Console.WriteLine ("Is tests pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-124.cs b/mcs/tests/test-124.cs
deleted file mode 100644
index c28d9899d65..00000000000
--- a/mcs/tests/test-124.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Drawing;
-
-namespace N1
-{
- public class D
- {
- public static int Main ()
- {
- Rectangle rect = new Rectangle ();
- N (rect);
-
- return 0;
- }
-
- public static bool N (RectangleF rect)
- {
- if (rect.X > rect.Y)
- return true;
-
- return false;
- }
- }
-}
-
diff --git a/mcs/tests/test-125.cs b/mcs/tests/test-125.cs
deleted file mode 100644
index 51217ef2697..00000000000
--- a/mcs/tests/test-125.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using System;
-
-public class Fraction {
-
- public Fraction(int numerator, int denominator) {
- Console.WriteLine("In Fraction Constructor(int, int)");
- this.numerator = numerator;
- this.denominator = denominator;
- }
-
- public Fraction(int wholeNumber) {
- Console.WriteLine("In Fraction Constructor(int)");
- numerator = wholeNumber;
- denominator = 1;
- }
-
- // this function is not recognised by mcs further down
- public static implicit operator Fraction(int theInt) {
- Console.WriteLine("In implicit conversion to Fraction");
- return new Fraction(theInt);
- }
-
- public static explicit operator int(Fraction theFraction) {
- Console.WriteLine("In explicit conversion to int");
- return theFraction.numerator /
- theFraction.denominator;
- }
-
- public static bool operator==(Fraction lhs, Fraction rhs) {
- Console.WriteLine("In operator ==");
- if (lhs.denominator == rhs.denominator &&
- lhs.numerator == rhs.numerator) {
- return true;
- }
- // code here to handle unlike fraction
- return false;
- }
-
- public static bool operator!=(Fraction lhs, Fraction rhs) {
- Console.WriteLine("In operator !=");
- return !(lhs == rhs);
- }
-
- public override bool Equals(object o) {
- Console.WriteLine("In method Equals");
- if (! (o is Fraction)) {
- return false;
- }
- return this == (Fraction) o;
- }
-
- public static Fraction operator+(Fraction lhs, Fraction rhs) {
- Console.WriteLine("In operator +");
- if (lhs.denominator == rhs.denominator) {
- return new Fraction(lhs.numerator + rhs.numerator,
- lhs.denominator);
- }
-
- // simplistic solution for unlike fractions
- // 1/2 + 3/4 == (1*4) + (3*2) / (2*4) == 10/8
- int firstProduct = lhs.numerator * rhs.denominator;
- int secondProduct = lhs.denominator * rhs.numerator;
- return new Fraction(
- firstProduct + secondProduct,
- lhs.denominator * rhs.denominator);
- }
-
- public override string ToString() {
- String s = numerator.ToString() + "/" +
- denominator.ToString();
- return s;
- }
-
- private int numerator;
- private int denominator;
-}
-
-public class Tester {
- public static int Main() {
-
- Fraction f1 = new Fraction(3,4);
- Console.WriteLine("f1: {0}", f1.ToString());
-
- Fraction f2 = new Fraction(2,4);
- Console.WriteLine("f2: {0}", f2.ToString());
-
- Fraction f3 = f1 + f2;
- Console.WriteLine("f1 + f2 = f3: {0}", f3.ToString());
-
- Fraction f4 = f3 + 5;
- Console.WriteLine("f3 + 5 = f4: {0}", f4.ToString());
-
- Fraction f5 = new Fraction(2, 4);
- if (f5 == f2)
- Console.WriteLine("f5: {0} == f2: {1}", f5.ToString(), f2.ToString());
-
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-126.cs b/mcs/tests/test-126.cs
deleted file mode 100755
index 26ed4190a20..00000000000
--- a/mcs/tests/test-126.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// It is possible to invoke object methods in an interface.
-//
-using System;
-
-interface Iface {
- void Method ();
-}
-
-class X : Iface {
-
- void Iface.Method () {}
-
- static int Main ()
- {
- X x = new X ();
- Iface f = x;
-
- if (f.ToString () != "X")
- return 1;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-127.cs b/mcs/tests/test-127.cs
deleted file mode 100755
index 1ca2bed7449..00000000000
--- a/mcs/tests/test-127.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// It is possible to invoke Enum methods on an enum type.
-//
-using System;
-
-enum Test {
- A,
- B,
- C
-}
-
-class X {
-
- static int Main ()
- {
- Test test = Test.A;
-
- if (!Test.IsDefined (typeof (Test), test))
- return 1;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-128.cs b/mcs/tests/test-128.cs
deleted file mode 100644
index 21e5ec7b05b..00000000000
--- a/mcs/tests/test-128.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-
-public class SimpleAttribute : Attribute {
-
- string n;
-
- public SimpleAttribute (string name)
- {
- n = name;
- }
-}
-
-public class Blah {
-
- int i;
-
- public int Value {
-
- [Simple ("Foo!")]
- get {
- return i;
- }
-
- [Simple ("Bar !")]
- set {
- i = value;
- }
-
- }
-
- public static int Main ()
- {
- //
- // We need a better test which does reflection to check if the
- // attributes have actually been applied etc.
- //
-
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-129.cs b/mcs/tests/test-129.cs
deleted file mode 100755
index 11cf4b70e2c..00000000000
--- a/mcs/tests/test-129.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Check unary minus.
-//
-using System;
-
-class X {
-
- static int Main ()
- {
- short a = -32768;
- int b = -2147483648;
- long c = -9223372036854775808;
- sbyte d = -128;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-13.cs b/mcs/tests/test-13.cs
deleted file mode 100644
index f921ae55728..00000000000
--- a/mcs/tests/test-13.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-
-class Foo {
-
- public bool MyMethod ()
- {
- Console.WriteLine ("Base class method !");
- return true;
- }
-}
-
-class Blah : Foo {
-
- public static int Main ()
- {
- Blah k = new Blah ();
-
- Foo i = k;
-
- if (i.MyMethod ())
- return 0;
- else
- return 1;
-
-
- }
-
-}
-
-
-
diff --git a/mcs/tests/test-130.cs b/mcs/tests/test-130.cs
deleted file mode 100755
index be7b70df86c..00000000000
--- a/mcs/tests/test-130.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// Check casts.
-//
-using System;
-
-class X {
-
- public const short a = 128;
- public const int b = 0xffff;
- public const double c = 123.4;
-
- public const long d = 5;
- // public const int e = 2147483648;
-
- public const byte f = 127;
-
- public const char c1 = (char) 0xffff;
- public const char c2 = (char) 123.4;
- public const char c3 = (char) a;
- public const char c4 = (char) b;
- public const char c5 = (char) c;
-
- public const short s1 = (short) b;
- public const short s2 = (short) c;
-
- static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-131.cs b/mcs/tests/test-131.cs
deleted file mode 100644
index 568576c96fa..00000000000
--- a/mcs/tests/test-131.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-
-public class SimpleAttribute : Attribute {
-
- string n;
-
- public SimpleAttribute (string name)
- {
- n = name;
- }
-}
-
-public class Blah {
-
- public enum Foo {
-
- A,
-
- [Simple ("second")]
- B,
-
- C
- }
-
- public static int Main ()
- {
- //
- // We need a better test which does reflection to check if the
- // attributes have actually been applied etc.
- //
-
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-132.cs b/mcs/tests/test-132.cs
deleted file mode 100755
index 0ac9a986ce4..00000000000
--- a/mcs/tests/test-132.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Reflection;
-
-class T {
- protected internal string s;
- static int Main() {
- FieldInfo f = typeof(T).GetField ("s", BindingFlags.NonPublic|BindingFlags.Instance);
- if (f == null)
- return 2;
- FieldAttributes attrs = f.Attributes;
- if ((attrs & FieldAttributes.FieldAccessMask) != FieldAttributes.FamORAssem)
- return 1;
- return 0;
- }
-}
diff --git a/mcs/tests/test-133.cs b/mcs/tests/test-133.cs
deleted file mode 100755
index 1e27fc40631..00000000000
--- a/mcs/tests/test-133.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-
-public struct S {
- public int a, b;
-}
-
-class T {
- enum OpCode : ushort { False }
- enum OpFlags : ushort { None }
- static void DecodeOp (ushort word, out OpCode op, out OpFlags flags) {
- op = (OpCode)(word & 0x00ff);
- flags = (OpFlags)(word & 0xff00);
- }
- static void get_struct (out S s) {
- S ss;
- ss.a = 1;
- ss.b = 2;
- s = ss;
- }
- static int Main() {
- OpCode op;
- OpFlags flags;
- S s;
- DecodeOp ((ushort)0x0203, out op, out flags);
- if (op != (OpCode)0x3)
- return 1;
- if (flags != (OpFlags)0x200)
- return 2;
- get_struct (out s);
- if (s.a != 1)
- return 3;
- if (s.b != 2)
- return 4;
- return 0;
- }
-}
diff --git a/mcs/tests/test-134.cs b/mcs/tests/test-134.cs
deleted file mode 100755
index 35cb5c0c15b..00000000000
--- a/mcs/tests/test-134.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// This test checks if we implement all the interfaces inherited
-//
-
-interface IA {
- void A ();
-}
-
-interface IB : IA {
- void B ();
-}
-
-interface IC : IA, IB {
- void C ();
-}
-
-interface ID : IC {
-}
-
-class AA : IC {
- bool a, b, c;
- public void A () { a = true; }
- public void B () { b = true; }
- public void C () { c = true; }
-
- public bool OK {
- get {
- return a && b && c;
- }
- }
-}
-
-class BB : ID{
- bool a, b, c;
- public void A () { a = true; System.Console.WriteLine ("A"); }
- public void B () { b = true; }
- public void C () { c = true; }
-
- public bool OK {
- get {
- return a && b && c;
- }
- }
-}
-
-class T: IB {
- public void A () {}
- public void B () {}
-
- static int Main() {
-
- BB bb = new BB ();
- bb.A ();
- bb.B ();
- bb.C ();
-
- if (!bb.OK)
- return 1;
-
- AA aa = new AA ();
- aa.A ();
- aa.B ();
- aa.C ();
- if (!aa.OK)
- return 2;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-135.cs b/mcs/tests/test-135.cs
deleted file mode 100755
index c7372e1755b..00000000000
--- a/mcs/tests/test-135.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Reflection;
-// test bug bug#26264
-
-interface IA {
- void doh();
-}
-interface IB {
-
- IA Prop {get;}
-}
-class A : IA {
- public void doh() {}
-}
-class T : IB {
- IA IB.Prop {
- get { return new A(); }
- }
- public A Prop {
- get { return new A(); }
- }
- static int Main() {
- PropertyInfo[] p = typeof (T).GetProperties (BindingFlags.Public| BindingFlags.NonPublic|BindingFlags.Instance);
- if (p == null || p.Length != 1)
- return 1;
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-136.cs b/mcs/tests/test-136.cs
deleted file mode 100755
index 562cdbee956..00000000000
--- a/mcs/tests/test-136.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Tests that explicit and normal implementations of methods are handled
-// properly. Before we used to have the normal method implementation
-// "implement" the classes, so that it would go into an infinite loop.
-// (bug #26334)
-//
-// Now explicit implementations are defined first.
-//
-using System;
-
-public interface IDiagnostic
-{
- void Stop();
-}
-public interface IAutomobile
-{
- void Stop();
-}
-
-public class MyCar: IAutomobile, IDiagnostic {
- public bool diag_stop, car_stop, auto_stop;
-
- void IDiagnostic.Stop() {
- diag_stop = true;
- }
-
- public void Stop() {
- car_stop = true;
- IAutomobile self = (IAutomobile)this; // cast this
- self.Stop(); // forwarding call
- }
-
- void IAutomobile.Stop()
- {
- auto_stop = true;
- }
-}
-
-class TestConflict {
- static int Main ()
- {
- MyCar car1 = new MyCar();
- car1.Stop(); // calls the IAutomobile.Stop implementation
-
- IDiagnostic car2 = new MyCar();
- car2.Stop();
-
- IAutomobile car3 = new MyCar();
- car3.Stop();
-
- if (!car1.car_stop)
- return 1;
-
- if (car1.diag_stop)
- return 2;
-
- Console.WriteLine ("ok");
- return 0;
- }
-}
diff --git a/mcs/tests/test-137.cs b/mcs/tests/test-137.cs
deleted file mode 100755
index ba11bb7fc39..00000000000
--- a/mcs/tests/test-137.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Explicitly implement all the interface methods pending with the same name.
-//
-using System;
-
-interface A {
- void X ();
-}
-
-interface B {
- void X ();
-}
-
-class C : A, B {
- int var;
-
- public void X ()
- {
- var++;
- }
-
- static int Main ()
- {
- C c = new C ();
-
- A a = c;
- B b = c;
-
- if (c.var != 0)
- return 1;
-
- a.X ();
- if (c.var != 1)
- return 2;
- b.X ();
- if (c.var != 2)
- return 3;
- c.X ();
- if (c.var != 3)
- return 4;
-
- Console.WriteLine ("Test passes");
- return 0;
- }
-}
diff --git a/mcs/tests/test-14.cs b/mcs/tests/test-14.cs
deleted file mode 100644
index dac824b6028..00000000000
--- a/mcs/tests/test-14.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-
-namespace Obj {
- interface Bah {
- int H ();
- }
- class A : Bah {
- public int F () {return 1;}
- public virtual int G () {return 2;}
- public int H () {return 10;}
- }
- class B : A {
- public new int F () {return 3;}
- public override int G () {return 4;}
- public new int H () {return 11;}
- }
- class Test {
- static public int Main () {
- int result = 0;
- B b = new B ();
- A a = b;
- if (a.F () != 1)
- result |= 1 << 0;
- if (b.F () != 3)
- result |= 1 << 1;
- if (b.G () != 4)
- result |= 1 << 2;
- if (a.G () != 4){
- Console.WriteLine ("oops: " + a.G ());
- result |= 1 << 3;
- }
- if (a.H () != 10)
- result |= 1 << 4;
- if (b.H () != 11)
- result |= 1 << 5;
- if (((A)b).H () != 10)
- result |= 1 << 6;
- if (((B)a).H () != 11)
- result |= 1 << 7;
- return result;
- }
- };
-};
diff --git a/mcs/tests/test-15.cs b/mcs/tests/test-15.cs
deleted file mode 100755
index c199bc13bcb..00000000000
--- a/mcs/tests/test-15.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-
-interface Iface {
- void A ();
-}
-
-class Implementor : Iface {
- public void A () {}
-}
-
-class Run {
-
- static int Main ()
- {
- Iface iface;
- Implementor i = new Implementor ();
-
- iface = i;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-16.cs b/mcs/tests/test-16.cs
deleted file mode 100644
index 3c59e917e19..00000000000
--- a/mcs/tests/test-16.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-
-namespace Mine {
-
- public class Blah {
-
- public static int operator + (Blah i, Blah j)
- {
- Console.WriteLine ("Base class binary + operator");
- return 2;
- }
-
- public static implicit operator int (Blah i)
- {
- Console.WriteLine ("Blah->int");
- return 3;
- }
-
- public static implicit operator byte (Blah i)
- {
- Console.WriteLine ("Blah->byte");
- return 0;
- }
-
- public static implicit operator short (Blah i)
- {
- Console.WriteLine ("Blah->short");
- return 1;
- }
-
- }
-
- public class Foo : Blah {
-
- public static int Main ()
- {
- int number = new Foo () + new Foo () ;
- Console.WriteLine (number);
-
- Foo tmp = new Foo ();
-
- int k = tmp;
-
- Console.WriteLine ("Convert from Foo to float");
- float f = tmp;
- Console.WriteLine ("Converted");
-
- // The following will not work till we fix our UserCast::Emit
- // to convert the return value on the stack.
- if (f == 3)
- Console.WriteLine ("Best implicit conversion selected correctly.");
-
- Console.WriteLine ("F is {0}", f);
-
- if (number == 2 && k == 3)
- return 0;
- else
- return 1;
- }
- }
-}
diff --git a/mcs/tests/test-17.cs b/mcs/tests/test-17.cs
deleted file mode 100755
index c6e2a95745c..00000000000
--- a/mcs/tests/test-17.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// This test excercises user defined conversions and an implicit
-// conversion to a type afterwards.
-//
-//
-using System;
-
-class Blah {
-
- public static int Main ()
- {
- Blah k = new Blah ();
-
- float f = k;
-
- if (f == 2){
- Console.WriteLine ("Best implicit operator selected correctly");
- return 0;
- }
- return 1;
-
- }
-
- public static implicit operator byte (Blah i)
- {
- Console.WriteLine ("Blah->byte");
- return 0;
- }
-
-
- public static implicit operator short (Blah i)
- {
- Console.WriteLine ("Blah->short");
- return 1;
- }
-
- public static implicit operator int (Blah i)
- {
- Console.WriteLine ("Blah->int");
- return 2;
- }
-
-
-}
-
diff --git a/mcs/tests/test-18.cs b/mcs/tests/test-18.cs
deleted file mode 100644
index eb2a02c0033..00000000000
--- a/mcs/tests/test-18.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-
-class X {
- static int i;
- static int j;
-
- static void m ()
- {
- i = 0;
- j = 0;
-
- try {
- throw new ArgumentException ("Blah");
- } catch (ArgumentException){
- i = 1;
- } catch (Exception){
- i = 2;
- } finally {
- j = 1;
- }
- }
-
- static int ret (int a)
- {
- try {
- if (a == 1)
- throw new Exception ();
-
- return 1;
- } catch {
- return 2;
- }
- }
-
- static int Main ()
- {
- m ();
- if (i != 1)
- return 1;
- if (j != 1)
- return 2;
-
- if (ret (1) != 2)
- return 3;
-
- if (ret (10) != 1)
- return 4;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-19.cs b/mcs/tests/test-19.cs
deleted file mode 100755
index f63dff52958..00000000000
--- a/mcs/tests/test-19.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-using System;
-using System.Threading;
-using System.Reflection;
-
-class I {
-
- public delegate string GetTextFn (string a);
-
- static public GetTextFn GetText;
-
- static string fn (string s)
- {
- return "(" + s + ")";
- }
-
- static I ()
- {
- GetText = new GetTextFn (fn);
- }
-}
-
-class X {
-
- public delegate int Foo (int i, int j);
-
- private void Thread_func () {
- Console.WriteLine ("Inside the thread !");
- }
-
- public int Func (int i, int j)
- {
- return i+j;
- }
-
- public void Bar ()
- {
- Foo my_func = new Foo (Func);
-
- int result = my_func (2, 4);
-
- Console.WriteLine ("Answer is : " + result);
- }
-
- static bool MyFilter (MemberInfo mi, object criteria)
- {
- Console.WriteLine ("You passed in : " + criteria);
- return true;
- }
-
- public static int Main ()
- {
- I.GetTextFn _ = I.GetText;
-
- Console.WriteLine ("Value: " + I.GetText);
- X x = new X ();
-
- Thread thr = new Thread (new ThreadStart (x.Thread_func));
-
- thr.Start ();
- Console.WriteLine ("Inside main ");
- thr.Join ();
-
- Console.WriteLine (_("Hello"));
-
- x.Bar ();
-
- MemberFilter filter = new MemberFilter (MyFilter);
-
- Type t = x.GetType ();
-
- MemberInfo [] mi = t.FindMembers (MemberTypes.Method, BindingFlags.Static | BindingFlags.NonPublic,
- Type.FilterName, "MyFilter");
-
- Console.WriteLine ("FindMembers called, mi = " + mi);
- Console.WriteLine (" Count: " + mi.Length);
- if (!filter (mi [0], "MyFilter"))
- return 1;
-
- //
- // This test is used to call into a delegate defined in a separate
- // namespace, but which is still not a nested delegate inside a class
- //
- NameSpace.TestDelegate td = new NameSpace.TestDelegate (multiply_by_three);
-
- if (td (8) != 24)
- return 30;
-
- //
- // Check the names that were used to define the delegates
- //
- if (td.GetType ().FullName != "NameSpace.TestDelegate")
- return 31;
-
- if (_.GetType ().FullName != "I+GetTextFn")
- return 32;
-
- Console.WriteLine ("Test passes");
-
- return 0;
- }
-
- static int multiply_by_three (int v)
- {
- return v * 3;
- }
-
-}
-
-namespace NameSpace {
-
- public delegate int TestDelegate (int a);
-
-}
-
diff --git a/mcs/tests/test-2.cs b/mcs/tests/test-2.cs
deleted file mode 100755
index 0a18d50767b..00000000000
--- a/mcs/tests/test-2.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-class X {
- static int Main (string [] args)
- {
- System.Console.WriteLine ("Hello, World");
- return 0;
- }
-}
diff --git a/mcs/tests/test-20.cs b/mcs/tests/test-20.cs
deleted file mode 100755
index 006bd45075e..00000000000
--- a/mcs/tests/test-20.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// This generates a warning
-//
-using System;
-
-class A {
- public int a;
-
- public void X ()
- {
- a = 1;
- }
-}
-
-class B : A {
- void X ()
- {
- a = 2;
- }
-
- public void TestB ()
- {
- X ();
- }
-}
-
-class Ax {
- public int a;
-
- public virtual void A ()
- {
- a = 1;
- }
-
- public virtual void B ()
- {
- a = 3;
- }
-}
-
-class Bx : Ax {
- public override void A ()
- {
- a = 2;
- }
- public new void B ()
- {
- a = 4;
- }
-}
-class Test {
- static int Main ()
- {
- B b = new B ();
-
- b.TestB ();
- if (b.a != 2)
- return 1;
-
- Bx bx = new Bx ();
- bx.A ();
- if (b.a != 2)
- return 2;
- bx.B ();
- Console.WriteLine ("a="+bx.a);
- if (bx.a != 4)
- return 3;
- return 0;
- }
-}
diff --git a/mcs/tests/test-21.cs b/mcs/tests/test-21.cs
deleted file mode 100644
index cd125497bbb..00000000000
--- a/mcs/tests/test-21.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-
-public class Blah {
-
- public class Foo {
-
- public Foo ()
- {
- Console.WriteLine ("Inside the Foo constructor now");
- }
-
- public int Bar (int i, int j)
- {
- Console.WriteLine ("The Bar method");
- return i+j;
- }
-
-
- }
-
- public static int Main ()
- {
- Foo f = new Foo ();
-
- int j = f.Bar (2, 3);
- Console.WriteLine ("Blah.Foo.Bar returned " + j);
-
- if (j == 5)
- return 0;
- else
- return 1;
-
- }
-
-}
diff --git a/mcs/tests/test-22.cs b/mcs/tests/test-22.cs
deleted file mode 100644
index 2e662494ddd..00000000000
--- a/mcs/tests/test-22.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// This test excercises invocations of methods in structures.
-//
-// Unlike classes, we can not just leave the result of a computed
-// structure in the IL stack as a result. The reason is that the
-// result is the whole structure, not a pointer to it.
-//
-// This program excercises invocations to methods on structures
-//
-
-struct T {
- public int a, b;
-}
-
-struct S {
- T t;
-
- public T GetT ()
- {
- return t;
- }
-
- public void Init ()
- {
- t.a = 1;
- t.b = 2;
- }
-}
-
-class M {
- static int Main ()
- {
- S s = new S ();
-
- s.Init ();
-
- if (s.GetT ().a != 1)
- return 1;
-
- if (s.GetT ().b != 2)
- return 2;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-23.cs b/mcs/tests/test-23.cs
deleted file mode 100644
index 0723c667d95..00000000000
--- a/mcs/tests/test-23.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// Tests properties
-//
-using System;
-
-class X {
- static int v;
-
- static X ()
- {
- v = 10;
- }
-
- public static int Value {
- get {
- return v;
- }
-
- set {
- v = value;
- }
- }
-
- static int Main ()
- {
- if (Value != 10)
- return 1;
-
- Value = 4;
-
- if (Value != 4)
- return 2;
-
- Y y = new Y ("hello");
-
- if (y.Value != "hello")
- return 3;
-
- y.Value = "goodbye";
- if (y.Value != "goodbye")
- return 4;
-
- Z z = new Z ();
-
- if (Z.IVal != 4)
- return 5;
- Z.IVal = 10;
- if (Z.IVal != 10)
- return 6;
-
- z.XVal = 23;
- if (z.XVal != 23)
- return 7;
-
- return 0;
- }
-}
-
-class Y {
- string init;
-
- public Y (string s)
- {
- init = s;
- }
-
- public string Value {
- get {
- return init;
- }
-
- set {
- init = value;
- }
- }
-}
-
-struct Z {
- static int val;
- int xval;
-
- static Z ()
- {
- val = 4;
- }
-
- static public int IVal {
- get {
- return val;
- }
-
- set {
- val= value;
- }
- }
-
- public int XVal {
- get {
- return xval;
- }
-
- set {
- xval = value;
- }
- }
-}
diff --git a/mcs/tests/test-24.cs b/mcs/tests/test-24.cs
deleted file mode 100644
index e69a844c93d..00000000000
--- a/mcs/tests/test-24.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// Properties intermixed in assignments
-//
-
-using System;
-
-class X {
-
- static string v;
-
- static string S {
- get {
- return v;
- }
- set {
- v = value;
- }
- }
-
- static string x, b;
-
- static int Main ()
- {
-
- x = S = b = "hlo";
- if (x != "hlo")
- return 1;
- if (S != "hlo")
- return 2;
- if (b != "hlo")
- return 3;
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-25.cs b/mcs/tests/test-25.cs
deleted file mode 100644
index a01a8daa4f1..00000000000
--- a/mcs/tests/test-25.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// Test the various iteration constructs, breaks and continues
-//
-// FIXME: Add foreach and more tests.
-//
-using System;
-
-class X {
-
- static int Main ()
- {
- int i, j, t, k;
-
- for (i = 0; i < 10; i++){
- if (i == 5)
- break;
- }
-
- if (i != 5)
- return 1;
-
- t = 0;
- k = 0;
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++){
- if (j > 3)
- break;
- t++;
-
- if (j >= 1)
- continue;
-
- k++;
- }
- }
-
- if (t != 40)
- return 2;
- if (k != 10)
- return 3;
-
-
- t = 0;
- do {
- if (k == 5)
- continue;
- t++;
- } while (--k > 0);
-
- if (t != 9)
- return 4;
-
- t = 0;
- do {
- t++;
- if (t == 5)
- break;
- } while (k++ < 10);
-
- if (t != 5)
- return 5;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-26.cs b/mcs/tests/test-26.cs
deleted file mode 100644
index 38b173ca3bd..00000000000
--- a/mcs/tests/test-26.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using System;
-
-public class Blah {
-
- public delegate int MyDelegate (int i, int j);
-
- public int Foo (int i, int j)
- {
- return i+j;
- }
-
- public static int Test1 ()
- {
- Blah f = new Blah ();
-
- MyDelegate del = new MyDelegate (f.Foo);
-
- MyDelegate another = new MyDelegate (del);
-
- int number = del (2, 3);
-
- int i = another (4, 6);
-
- Console.WriteLine ("Delegate invocation of one returned : " + number);
-
- Console.WriteLine ("Delegate invocation of the other returned : " + i);
-
- if (number == 5 && i == 10)
- return 0;
- else
- return 1;
- }
-
- public delegate int List (params int [] args);
-
- public static int Adder (params int [] args)
- {
- int total = 0;
-
- foreach (int i in args)
- total += i;
-
- return total;
- }
-
- public static int Test2 ()
- {
- List my_adder = new List (Adder);
-
- if (my_adder (1, 2, 3) != 6)
- return 2;
-
- return 0;
- }
-
- public static int Main ()
- {
- int v;
-
- v = Test1 ();
- if (v != 0)
- return v;
-
- v = Test2 ();
- if (v != 0)
- return v;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-27.cs b/mcs/tests/test-27.cs
deleted file mode 100644
index f1bd59b102a..00000000000
--- a/mcs/tests/test-27.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using System;
-
-public interface Hello {
-
- bool MyMethod (int i);
-}
-
-public interface Another : Hello {
-
- int AnotherMethod (int i);
-}
-
-public class Foo : Hello, Another {
-
- public bool MyMethod (int i)
- {
- if (i == 22)
- return true;
- else
- return false;
- }
-
- public int AnotherMethod (int i)
- {
- return i * 10;
- }
-
-}
-
-public interface ITest {
-
- bool TestMethod (int i, float j);
-}
-
-public class Blah : Foo {
-
- public delegate void MyDelegate (int i, int j);
-
- void Bar (int i, int j)
- {
- Console.WriteLine (i+j);
- }
-
- public static int Main ()
- {
- Blah k = new Blah ();
-
- Foo f = k;
-
- object o = k;
-
- if (f is Foo)
- Console.WriteLine ("I am a Foo!");
-
- Hello ihello = f;
-
- Another ianother = f;
-
- ihello = ianother;
-
- bool b = f.MyMethod (22);
-
- MyDelegate del = new MyDelegate (k.Bar);
-
- del (2, 3);
-
- Delegate tmp = del;
-
- // Explicit reference conversions
-
- MyDelegate adel = (MyDelegate) tmp;
-
- adel (4, 7);
-
- Blah l = (Blah) o;
-
- l.Bar (20, 30);
-
- l = (Blah) f;
-
- l.Bar (2, 5);
-
- f = (Foo) ihello;
-
- // The following cause exceptions even though they are supposed to work
- // according to the spec
-
- // This one sounds ridiculous !
- // ITest t = (ITest) l;
-
- // ITest u = (ITest) ihello;
-
- return 0;
-
- }
-}
-
diff --git a/mcs/tests/test-28.cs b/mcs/tests/test-28.cs
deleted file mode 100644
index 50f7dbb02bf..00000000000
--- a/mcs/tests/test-28.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-abstract class A {
- protected abstract int this [int a] { get; }
-
- public int EmulateIndexer (int a)
- {
- return this [a];
- }
-}
-
-class B : A {
- protected override int this [int a] { get { return a;} }
-
- public int M ()
- {
- return this [0];
- }
-
-}
-class X {
- int v1, v2;
-
- int this [int a] {
- get {
- if (a == 0)
- return v1;
- else
- return v2;
- }
-
- set {
- if (a == 0)
- v1 = value;
- else
- v2 = value;
- }
- }
-
- static int Main ()
- {
- X x = new X ();
-
- x [0] = 1;
- if (x.v1 != 1)
- return 1;
-
- if (x [0] != 1)
- return 2;
-
- B bb = new B ();
-
- if (bb.EmulateIndexer (10) != 10)
- return 3;
-
- return new B ().M ();
- }
-}
diff --git a/mcs/tests/test-29.cs b/mcs/tests/test-29.cs
deleted file mode 100644
index 6183126d277..00000000000
--- a/mcs/tests/test-29.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// Versioning, should choose Derived.Add (1)
-//
-using System;
-
-class Base {
- public int val;
-
- public void Add (int x)
- {
- Console.WriteLine ("Incorrect method called");
-
- val = 1;
- }
-}
-
-class Derived : Base {
- public void Add (double x)
- {
- Console.WriteLine ("Calling the derived class with double! Excellent!");
- val = 2;
- }
-}
-
-class Demo {
-
- static int Main ()
- {
- Derived d = new Derived ();
-
- d.Add (1);
- if (d.val == 1)
- return 1;
-
- if (d.val == 2)
- return 0;
- return 2;
-
- }
-}
diff --git a/mcs/tests/test-3.cs b/mcs/tests/test-3.cs
deleted file mode 100755
index 5e7d4e1fab2..00000000000
--- a/mcs/tests/test-3.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-
-public class TestIntOps {
-
- public static sbyte sbyte_add (sbyte a, sbyte b) {
- return (sbyte)(a+b);
- }
-
- public static short short_add (short a, short b) {
- return (short)(a+b);
- }
-
- public static double double_add (double a, double b) {
- return a+b;
- }
-
- public static int int_add (int a, int b) {
- return a+b;
- }
-
- public static int int_sub (int a, int b) {
- return a-b;
- }
-
- public static int int_mul (int a, int b) {
- return a*b;
- }
-
- public static int Main() {
- int num = 1;
-
- if (int_add (1, 1) != 2) return num;
- num++;
-
- if (int_add (31, -1) != 30) return num;
- num++;
-
- if (int_sub (31, -1) != 32) return num;
- num++;
-
- if (int_mul (12, 12) != 144) return num;
- num++;
-
- if (sbyte_add (1, 1) != 2) return num;
- num++;
-
- if (sbyte_add (31, -1) != 30) return num;
- num++;
-
- if (short_add (1, 1) != 2) return num;
- num++;
-
- if (short_add (31, -1) != 30) return num;
- num++;
-
- if (double_add (1.5, 1.5) != 3) return num;
- num++;
-
- // add more meaningful tests
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-30.cs b/mcs/tests/test-30.cs
deleted file mode 100644
index 56c8308c02b..00000000000
--- a/mcs/tests/test-30.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Tests whether we implement the correct methods from interfaces
-//
-
-using System;
-
-interface IA {
- void Draw ();
-}
-
-interface IB {
- void Draw ();
-}
-
-class X : IA, IB {
- public bool ia_called;
- public bool ib_called;
-
- void IA.Draw ()
- {
- ia_called = true;
- }
-
- void IB.Draw ()
- {
- ib_called = true;
- }
-}
-
-class test {
-
- static int Main ()
- {
- X x = new X ();
-
- ((IA) x).Draw ();
- Console.WriteLine ("IA: " + x.ia_called);
- Console.WriteLine ("IB: " + x.ib_called);
-
- if (x.ib_called)
- return 1;
- if (!x.ia_called)
- return 2;
-
- X y = new X ();
- ((IB) y).Draw ();
- Console.WriteLine ("IA: " + x.ia_called);
- Console.WriteLine ("IB: " + x.ib_called);
-
- if (!y.ib_called)
- return 3;
- if (y.ia_called)
- return 4;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/test-31.cs b/mcs/tests/test-31.cs
deleted file mode 100644
index c7c31fed25e..00000000000
--- a/mcs/tests/test-31.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Versioning test: make sure that we output a warning, but still call the derived
-// method
-//
-using System;
-
-class Base {
- public int which;
-
- public virtual void A ()
- {
- which = 1;
- }
-}
-
-class Derived :Base {
- public virtual void A ()
- {
- which = 2;
- }
-}
-
-class Test {
- static int Main ()
- {
- Derived d = new Derived ();
-
- //
- // This should call Derived.A and output a warning.
- //
- d.A ();
-
-
- if (d.which == 1)
- return 1;
-
- Console.WriteLine ("Test passes");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-32.cs b/mcs/tests/test-32.cs
deleted file mode 100644
index 94399b230e2..00000000000
--- a/mcs/tests/test-32.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-public class Blah {
-
- public static int Main ()
- {
- int [][] i = new int [2][];
-
- int [,][] j = new int [3,6][];
-
- Blah [] k = new Blah [2];
-
- Blah [,][] l = new Blah [3,4][];
-
- Uri [] uri = new Uri [4];
-
- Console.WriteLine ("All arrays successfully created");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-33.cs b/mcs/tests/test-33.cs
deleted file mode 100644
index 3e908b2ef35..00000000000
--- a/mcs/tests/test-33.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-
-namespace FirstOuter
-{
- namespace FirstInner
- {
- public class First
- {
- public string MyIdentity {
- get {
- return this.GetType().FullName;
- }
- }
- }
- }
-
- public class Second : FirstInner.First {}
-
- namespace SecondInner
- {
- public class Third : FirstOuter.FirstInner.First {}
- }
-
- namespace FirstInner // purposefully again
- {
- public class Fourth : First {} // must understand First in the nom qualified form
- }
-}
-
-public class Fifth : FirstOuter.FirstInner.First {}
-
-class Application
-{
- static int Main(string[] args)
- {
- FirstOuter.FirstInner.First V1 = new FirstOuter.FirstInner.First();
- FirstOuter.Second V2 = new FirstOuter.Second();
- FirstOuter.SecondInner.Third V3 = new FirstOuter.SecondInner.Third();
- FirstOuter.FirstInner.Fourth V4 = new FirstOuter.FirstInner.Fourth();
- Fifth V5 = new Fifth();
-
- Console.WriteLine("V1 is " + V1.MyIdentity);
- Console.WriteLine("V2 is " + V2.MyIdentity);
- Console.WriteLine("V3 is " + V3.MyIdentity);
- Console.WriteLine("V4 is " + V4.MyIdentity);
- Console.WriteLine("V5 is " + V5.MyIdentity);
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-34.cs b/mcs/tests/test-34.cs
deleted file mode 100644
index 44a9fca10ca..00000000000
--- a/mcs/tests/test-34.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// This test tests both how arguments are selected in the presence
-// of ref/out modifiers and the params arguments.
-//
-using System;
-
-public class Blah {
- static int got;
-
- public static void Foo (ref int i, ref int j)
- {
- got = 1;
- }
-
- public static int Bar (int j, params int [] args)
- {
- got = 2;
- int total = 0;
-
- foreach (int i in args){
- Console.WriteLine ("My argument: " + i);
- total += i;
- }
-
- return total;
- }
-
- public static void Foo (int i, int j)
- {
- got = 3;
- }
-
- static void In (ref int a)
- {
- a++;
- }
-
- static void Out (ref int a)
- {
- In (ref a);
- }
-
- static int AddArray (params int [] valores)
- {
- int total = 0;
-
- for (int i = 0; i < valores.Length; i++)
- total += valores [i];
-
- return total;
- }
-
- public static int Main ()
- {
- int i = 1;
- int j = 2;
-
- int [] arr = new int [2] { 0, 1 };
-
- Foo (i, j);
- if (got != 3)
- return 1;
-
- Foo (ref i, ref j);
- if (got != 1)
- return 2;
-
- if (Bar (i, j, 5, 4, 3, 3, 2) != 19)
- return 4;
-
- //if (Bar (1, arr) != 1)
- // return 5;
-
- if (got != 2)
- return 3;
-
- int k = 10;
-
- Out (ref k);
- if (k != 11)
- return 10;
-
- int [] arr2 = new int [2] {1, 2};
-
- if (AddArray (arr2) != 3)
- return 11;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-35.cs b/mcs/tests/test-35.cs
deleted file mode 100755
index d9bc1d8338e..00000000000
--- a/mcs/tests/test-35.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// This test checks the !x optimization for if/while/for/do
-//
-class X {
-
- static bool t = true;
- static bool f = false;
- static int j = 0;
-
- static void a ()
- {
- if (!t)
- j = 1;
- }
-
- static void w (int x)
- {
- System.Console.WriteLine (" " + x);
- }
-
- static int Main ()
- {
- int ok = 0, error = 0;
-
- if (!f)
- ok = 1;
- else
- error++;
-
- w (1);
- if (f)
- error++;
- else
- ok |= 2;
-
- w(2);
- if (t)
- ok |= 4;
- else
- error++;
-
- if (!t)
- error++;
- else
- ok |= 8;
-
- if (!(t && f == false))
- error++;
- else
- ok |= 16;
-
- int i = 0;
- w(3);
- do {
- i++;
- } while (!(i > 5));
- if (i != 6)
- error ++;
- else
- ok |= 32;
-
- w(100);
- System.Console.WriteLine ("Value: " + t);
- do {
- i++;
- } while (!t);
-
- System.Console.WriteLine ("Ok=" + ok + " Errors=" + error);
- return ((ok == 63) && (error == 0)) ? 0 : 1;
- }
-}
diff --git a/mcs/tests/test-36.cs b/mcs/tests/test-36.cs
deleted file mode 100755
index 9f4897a82f4..00000000000
--- a/mcs/tests/test-36.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// This program excercises invoking foreach on structures
-// that implement GetEnumerator
-//
-
-using System;
-using System.Collections;
-struct X {
- int [] a;
-
- public IEnumerator GetEnumerator ()
- {
- a = new int [3] { 1, 2, 3};
- return a.GetEnumerator ();
- }
- }
-
-class Y {
- static X x;
-
- static int Main ()
- {
- int total = 0;
- x = new X ();
-
- foreach (object a in x){
- total += (int) a;
- }
-
- if (total != 6)
- return 1;
-
- total = 0;
-
- //
- // implicit block
- //
- foreach (object a in x)
- total += (int) a;
- if (total != 6)
- return 2;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-37.cs b/mcs/tests/test-37.cs
deleted file mode 100755
index 91f54f4d9a0..00000000000
--- a/mcs/tests/test-37.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// This test excercises array access on single dimension, multi-dimension
-// and jagged arrays.
-//
-using System;
-
-class X {
- static void m (int [] a)
- {
- a [0] = 0xdead;
- }
-
- static int test_int_single_dim ()
- {
- int [] a = new int [10];
- int i;
-
- for (i = 0; i < 10; i++)
- a [i] = i;
-
- m (a);
-
- if (a [0] != 0xdead)
- return 1;
-
- a [0] = 0;
- for (i = 9; i >= 0; i--){
- if (a [i] != i)
- return 2;
- }
- return 0;
- }
-
- static int simple_test_double_dim ()
- {
- int [,] b = new int [10, 10];
-
- b [0, 0] = 1;
- b [4, 4] = 1;
-
- if (b [0, 0] != b [4, 4])
- return 20;
- if (b [1, 1] != b [5, 5])
- return 21;
-
- return 0;
- }
-
-// static void dd (int [,] b)
-// {
-// int i, j;
-//
-// for (i = 0; i < 10; i++)
-// for (j = 0; j < 10; j++)
-// b [i, j] = b [i, j] + 1;
-// }
-//
-// static int test_int_double_dim ()
-// {
-// int [,] b = new int [10,10];
-// int i, j;
-//
-// for (i = 0; i < 10; i++)
-// for (j = 0; j < 10; j++)
-// b [i,j] = i * 10 + j;
-//
-// dd (b);
-//
-// for (i = 0; i < 10; i++)
-// for (j = 0; j < 10; j++)
-// if (b [i,j] != i *10 + j + 1){
-// Console.WriteLine ("Expecting " + (i * 10 + j + 1) + "got: " + b [i,j]);
-// return 10;
-// }
-//
-// return 0;
-// }
-
-// static int test_jagged ()
-// {
-// int [][] a = new int [10][];
-// int i;
-//
-// for (i = 0; i < 10; i++){
-// if (a [i] != null)
-// return 20;
-//
-// a [i] = new int [10];
-//
-// for (int j = 0; j < 10; j++){
-// int q;
-// a [i][j] = j * 10;
-// q = a [i][j] = j * 10;
-//
-// a [i][j]++;
-//
-// if (a [i][j] != q + 1)
-// return 21;
-// }
-// }
-//
-// return 0;
-// }
-
- static int Main ()
- {
- int v;
-
- Console.WriteLine ("hello");
- return 0;
-
- v = test_int_single_dim ();
-
- if (v != 0)
- return v;
-
- // v = test_int_double_dim ();
- // if (v != 0)
- // return v;
- //
- // v = test_jagged ();
-
- v = simple_test_double_dim ();
- if (v != 0)
- return v;
-
- int [] a = new int [10];
- int i;
- for (i = 0; i < 10; i++){
- a [i] = i;
- // a [i]++;
- // Console.WriteLine ("Should be: " + (i + 1) + " it is = " + a [i]);
- }
- return 0;
- }
-}
diff --git a/mcs/tests/test-38.cs b/mcs/tests/test-38.cs
deleted file mode 100755
index 69dbbc3f936..00000000000
--- a/mcs/tests/test-38.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-class X {
- int v1, v2;
-
- int this [int a] {
- get {
- if (a == 0)
- return v1;
- else
- return v2;
- }
-
- set {
- if (a == 0)
- v1 = value;
- else
- v2 = value;
- }
- }
-
- static int Main ()
- {
- X x = new X ();
- int b;
-
- x [0] = x [1] = 1;
- x [0] = 1;
- if (x.v1 != 1)
- return 1;
-
- if (x [0] != 1)
- return 2;
-
- return 0;
-
- }
-}
diff --git a/mcs/tests/test-39.cs b/mcs/tests/test-39.cs
deleted file mode 100644
index 7366b1c0ce2..00000000000
--- a/mcs/tests/test-39.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-[AttributeUsage (AttributeTargets.Class, AllowMultiple = true)]
- public class SimpleAttribute : Attribute {
-
- string name = null;
-
- public string MyNamedArg;
-
- private string secret;
-
- public SimpleAttribute (string name)
- {
- this.name = name;
- }
-
- public string AnotherArg {
- get {
- return secret;
- }
- set {
- secret = value;
- }
- }
-
- }
-
-[Simple ("Dummy", MyNamedArg = "Dude!")]
-[Simple ("Vids", MyNamedArg = "Raj", AnotherArg = "Foo")]
- public class Blah {
-
- public static int Main ()
- {
- Console.WriteLine ("A dummy app which tests attribute emission");
- return 0;
- }
- }
-
-
diff --git a/mcs/tests/test-4.cs b/mcs/tests/test-4.cs
deleted file mode 100755
index 3023f6e9d1b..00000000000
--- a/mcs/tests/test-4.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-class X {
- bool sbyte_selected;
- bool int_selected;
-
- void test (sbyte s)
- {
- sbyte_selected = true;
- }
-
- void test (int i)
- {
- int_selected = true;
- }
-
- static int Main ()
- {
- X x = new X ();
-
- x.test (1);
- if (x.sbyte_selected){
- Console.WriteLine ("FAILED: Sbyte selected on constant int argument");
- return 1;
- } else {
- Console.WriteLine ("OK: int selected for constant int");
- }
-
- X y = new X ();
- sbyte s = 10;
-
- y.test (s);
- if (y.sbyte_selected){
- Console.WriteLine ("OK: sbyte selected for sbyte argument");
- } else {
- Console.WriteLine ("FAILED: sbyte not selected for sbyte argument");
- return 1;
- }
- return 0;
- }
-}
diff --git a/mcs/tests/test-40.cs b/mcs/tests/test-40.cs
deleted file mode 100644
index 1fa88aba072..00000000000
--- a/mcs/tests/test-40.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;
-
-public class Blah {
-
- enum Bar {
- a = MyEnum.Foo,
- b = A.c,
- c = MyEnum.Bar,
- d = myconstant
- }
-
- public enum MyEnum : byte {
- Foo = 254,
- Bar = B.y
- }
-
- enum A {
- a, b, c
- }
-
- enum B {
- x, y, z
- }
-
- enum AA : byte { a, b }
- enum BB : ulong { x, y }
-
- const int myconstant = 30;
-
- enum Compute { two = AA.b + BB.y }
-
- public static int Main ()
- {
- byte b = (byte) MyEnum.Foo;
-
- Console.WriteLine ("Foo has a value of " + b);
-
- if (b != 254)
- return 1;
-
- int i = (int) A.a;
- int j = (int) B.x;
- int k = (int) A.c;
- int l = (int) AA.b + 1;
-
- if (Compute.two != 2)
- return 10;
- if (i != j)
- return 1;
-
- if (k != l)
- return 1;
-
- A var = A.b;
-
- i = (int) Bar.a;
-
- if (i != 254)
- return 1;
-
- i = (int) Bar.b;
-
- if (i != 2)
- return 1;
-
- j = (int) Bar.c;
-
- if (j != 1)
- return 1;
-
- j = (int) Bar.d;
-
- if (j != 30)
- return 1;
-
- Console.WriteLine ("Enum emission test okay");
- return 0;
- }
-}
diff --git a/mcs/tests/test-41.cs b/mcs/tests/test-41.cs
deleted file mode 100644
index cdf1fd45f89..00000000000
--- a/mcs/tests/test-41.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// This tests the ref access to parameters
-//
-using System;
-
-class X {
-
- static void A (ref int a, ref uint b, ref sbyte c, ref byte d, ref long e, ref ulong f,
- ref short g, ref ushort h, ref char i, ref X x, ref float j, ref double k)
- {
- if (a == 1)
- a = 2;
-
- if (b == 1)
- b = 2;
-
- if (c == 1)
- c = 2;
-
- if (d == 1)
- d = 2;
-
- if (e == 1)
- e = 2;
-
- if (f == 1)
- f = 2;
-
- if (g == 1)
- g = 2;
-
- if (h == 1)
- h = 2;
-
- if (i == 'a')
- i = 'b';
-
- if (x == null)
- x = new X ();
-
- if (j == 1.0)
- j = 2.0F;
- if (k == 1.0)
- k = 2.0;
- }
-
- static int Main ()
- {
- int a = 1;
- uint b = 1;
- sbyte c = 1;
- byte d = 1;
- long e = 1;
- ulong f = 1;
- short g = 1;
- ushort h = 1;
- char i = 'a';
- float j = 1.0F;
- double k = 1.0;
- X x = null;
-
- A (ref a, ref b, ref c, ref d, ref e, ref f, ref g, ref h, ref i, ref x, ref j, ref k);
-
- if (a != 2)
- return 1;
- if (b != 2)
- return 2;
- if (c != 2)
- return 3;
- if (d != 2)
- return 4;
- if (e != 2)
- return 5;
- if (f != 2)
- return 6;
- if (g != 2)
- return 7;
- if (h != 2)
- return 8;
- if (i != 'b')
- return 9;
- if (j != 2.0)
- return 10;
- if (k != 2.0)
- return 11;
- if (x == null)
- return 12;
-
- Console.WriteLine ("Test passed");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-42.cs b/mcs/tests/test-42.cs
deleted file mode 100755
index 684324b8f93..00000000000
--- a/mcs/tests/test-42.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-//
-// This test exercises the various ways in which mutator operators can be
-// used in C# and the various different scenarios that the compiler would
-// have to deal with
-//
-// variables, linear arrays, multi-dimensional arrays, jagged arrays,
-// properties, indexers and overloaded ++ and --
-//
-
-class X {
-
- public int v, p;
- public int idx;
-
- public int this [int n] {
- get {
- idx = n;
- return v;
- }
- set {
- idx = n;
- v = value;
- }
- }
-
- public int P {
- get {
- return p;
- }
-
- set {
- p = value;
- }
- }
-
-}
-
-class Z {
- int v;
-
- public Z P {
- get {
- return null;
- }
-
- set {
- }
- }
-
- static public Z operator ++ (Z v)
- {
- v.v++;
- return v;
- }
-}
-
-class Y {
-
- static int p_pre_increment (X x)
- {
- return ++x.P;
- }
-
- static int p_post_increment (X x)
- {
- return x.P++;
- }
-
- static int i_pre_increment (X x)
- {
- return ++x [100];
- }
-
- static int i_post_increment (X x)
- {
- return x [14]++;
- }
-
- static Z overload_increment (Z z)
- {
- return z++;
- }
-
- static Z overload_pre_increment (Z z)
- {
- return ++z;
- }
-
- static Z ugly (Z z)
- {
- return z.P++;
- }
-
- //
- // Tests the ++ and -- operators on integers
- //
- static int simple (int i)
- {
- if (++i != 11)
- return 1;
- if (--i != 10)
- return 2;
- if (i++ != 10)
- return 3;
- if (i-- != 11)
- return 4;
- return 0;
- }
-
- static int arrays ()
- {
- int [] a = new int [10];
- int i, j;
-
- for (i = 0; i < 10; i++)
- a [i]++;
-
- for (i = 0; i < 10; i++)
- if (a [i] != 1)
- return 100;
-
- int [,] b = new int [10,10];
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++){
- b [i,j] = i * 10 + j;
- if (i < 5)
- b [i,j]++;
- else
- ++b [i,j];
- }
- }
-
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++){
- if (b [i,j] != i * 10 + (j + 1))
- return 101;
- }
- }
-
- return 0;
- }
-
- static int Main ()
- {
- X x = new X ();
- int c;
-
- if ((c = simple (10)) != 0)
- return c;
-
- if (i_pre_increment (x) != 1)
- return 5;
-
- if (x.idx != 100)
- return 6;
-
- if (i_post_increment (x) != 1)
- return 7;
-
- if (x.idx != 14)
- return 8;
-
- if (p_pre_increment (x) != 1)
- return 9;
-
- if (x.p != 1)
- return 10;
-
- if (p_post_increment (x) != 1)
- return 10;
-
- if (x.p != 2)
- return 11;
-
- Z z = new Z();
-
- overload_increment (z);
-
- arrays ();
-
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-43.cs b/mcs/tests/test-43.cs
deleted file mode 100755
index 7d8deffe812..00000000000
--- a/mcs/tests/test-43.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// This test is used for testing the foreach array support
-//
-using System;
-
-class X {
-
- static int test_single (int [] a)
- {
- int total = 0;
-
- foreach (int i in a)
- total += i;
-
- return total;
- }
-
- static int test_continue (int [] a)
- {
- int total = 0;
- int j = 0;
-
- foreach (int i in a){
- j++;
- if (j == 5)
- continue;
- total += i;
- }
-
- return total;
- }
-
- static int test_break (int [] a)
- {
- int total = 0;
- int j = 0;
-
- foreach (int i in a){
- j++;
- if (j == 5)
- break;
- total += i;
- }
-
- return total;
- }
-
- static int Main ()
- {
- int [] a = new int [10];
- int [] b = new int [2];
-
- for (int i = 0; i < 10; i++)
- a [i] = 10 + i;
-
- for (int j = 0; j < 2; j++)
- b [j] = 50 + j;
-
- if (test_single (a) != 145)
- return 1;
-
- if (test_single (b) != 101)
- return 2;
-
- if (test_continue (a) != 131){
- Console.WriteLine ("Expecting: 131, got " + test_continue (a));
- return 3;
- }
-
- if (test_break (a) != 46){
- Console.WriteLine ("Expecting: 46, got " + test_break (a));
- return 4;
- }
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-44.cs b/mcs/tests/test-44.cs
deleted file mode 100755
index c1b896a5814..00000000000
--- a/mcs/tests/test-44.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// This test shows that the current way in which we handle blocks
-// and statements is broken. The b [q,w] code is only executed 10
-// times instead of a 100
-//
-using System;
-
-class X {
-
- static int dob (int [,]b)
- {
- int total = 0;
-
- foreach (int i in b)
- total += i;
-
- return total;
- }
-
- //
- // This tests typecasting from an object to an array of ints
- // and then doing foreach
- //
- static int count (object o)
- {
- int total = 0;
-
- foreach (int i in (int []) o)
- total += i;
-
- return total;
- }
-
- static int Main ()
- {
- int [,] b = new int [10,10];
-
- for (int q = 0; q < 10; q++)
- for (int w = 0; w < 10; w++)
- b [q,w] = q * 10 + w;
-
- if (dob (b) != 4950)
- return 1;
-
- int [] a = new int [10];
- for (int i = 0; i < 10; i++)
- a [i] = 2;
-
- if (count (a) != 20)
- return 2;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-45.cs b/mcs/tests/test-45.cs
deleted file mode 100644
index 9d50a9c9420..00000000000
--- a/mcs/tests/test-45.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-
-public class Blah {
-
- private static int[] array = {0, 1, 2, 3};
-
- private static int [,] bar = { {0,1}, {4,5}, {10,20} };
-
- static string [] names = {
- "Miguel", "Paolo", "Dietmar", "Dick", "Ravi"
- };
-
- public static int Main ()
- {
- int [] i = new int [4] { 0, 1, 2, 3 };
-
- short [,] j = new short [4,2] { {0,1}, {2,3}, {4,5}, {6,7} };
-
- ushort [] a = { 4, 5, 6, 7 };
-
- long [,,] m = new long [2,3,2] {{{0,1}, {2,3}, {4,5}}, {{6,7}, {8,9}, {10,11}}};
-
- int foo = 1;
- int [] k = new int [] { foo, foo+1, foo+4 };
-
- int [,] boo = new int [,] {{foo, foo+10}, {foo+3, foo+10}};
-
- float [] f_array = new float [] { 1.23F, 4.5F, 6.24F };
-
- double [] double_arr = new double [] { 34.4567, 90.1226, 54.9823 };
-
- char [] c_arr = { 'A', 'B', 'C', 'M', 'R' };
-
- byte [] b_arr = { 0, 3, 8, 10, 21 };
-
- sbyte [] s_arr = { 10, 15, 30, 123 };
-
- if (a [2] != 6)
- return 1;
-
- if (s_arr [3] != 123)
- return 2;
-
- if (i [2] != 2)
- return 1;
-
- if (j [1,1] != 3)
- return 1;
-
- for (int t = 0; t < 4; ++t) {
- if (array [t] != t)
- return 1;
-
- if (a [t] != (t + 4))
- return 1;
- }
-
- if (bar [2,1] != 20)
- return 1;
-
- if (k [2] != 5)
- return 1;
-
- if (m [1,1,1] != 9)
- return 1;
-
- if (boo [0,1] != 11)
- return 1;
-
- if (f_array [0] != 1.23F)
- return 1;
-
- if (double_arr [1] != 90.1226)
- return 1;
-
- foreach (string s in names)
- Console.WriteLine ("Hello, " + s);
-
- if (names [0] != "Miguel")
- return 1;
-
- if (c_arr [4] != 'R')
- return 2;
-
- int count = 10;
-
- int [] x = new int [count];
-
- for (int idx = 0; idx < count; idx++)
- x [idx] = idx + 1;
-
- for (int idx = count; idx > 0; ){
- idx--;
- if (x [idx] != idx + 1)
- return 12;
- }
- Console.WriteLine ("Array initialization test okay.");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-46.cs b/mcs/tests/test-46.cs
deleted file mode 100755
index 6a4aa000a0b..00000000000
--- a/mcs/tests/test-46.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// This test probes the various explicit unboxing casts
-//
-using System;
-
-class X {
- static int cast_int (object o) { return (int) o; }
- static uint cast_uint (object o) { return (uint) o; }
- static short cast_short (object o) { return (short) o; }
- static char cast_char (object o) { return (char) o; }
- static ushort cast_ushort (object o) { return (ushort) o; }
- static byte cast_byte (object o) { return (byte) o; }
- static sbyte cast_sbyte (object o) { return (sbyte) o; }
- static long cast_long (object o) { return (long) o; }
- static ulong cast_ulong (object o) { return (ulong) o; }
- static float cast_float (object o) { return (float) o; }
- static double cast_double (object o) { return (double) o; }
- static bool cast_bool (object o) { return (bool) o; }
-
- static int Main ()
- {
- if (cast_int ((object) -1) != -1)
- return 1;
- if (cast_int ((object) 1) != 1)
- return 2;
- if (cast_int ((object) Int32.MaxValue) != Int32.MaxValue)
- return 1;
- if (cast_int ((object) Int32.MinValue) != Int32.MinValue)
- return 2;
- if (cast_int ((object) 0) != 0)
- return 3;
-
- if (cast_uint ((object) (uint)0) != 0)
- return 4;
- if (cast_uint ((object) (uint) 1) != 1)
- return 5;
- if (cast_uint ((object) (uint) UInt32.MaxValue) != UInt32.MaxValue)
- return 6;
- if (cast_uint ((object) (uint) UInt32.MinValue) != UInt32.MinValue)
- return 7;
-
- if (cast_ushort ((object) (ushort) 1) != 1)
- return 8;
- if (cast_ushort ((object) (ushort) UInt16.MaxValue) != UInt16.MaxValue)
- return 9;
- if (cast_ushort ((object) (ushort) UInt16.MinValue) != UInt16.MinValue)
- return 10;
- if (cast_ushort ((object) (ushort) 0) != 0)
- return 11;
-
- if (cast_short ((object) (short)-1) != -1)
- return 12;
- if (cast_short ((object) (short) 1) != 1)
- return 13;
- if (cast_short ((object) (short) Int16.MaxValue) != Int16.MaxValue)
- return 14;
- if (cast_short ((object) (short) Int16.MinValue) != Int16.MinValue)
- return 15;
- if (cast_short ((object) (short) 0) != 0)
- return 16;
-
- if (cast_byte ((object) (byte)1) != 1)
- return 17;
- if (cast_byte ((object) (byte) Byte.MaxValue) != Byte.MaxValue)
- return 18;
- if (cast_byte ((object) (byte) Byte.MinValue) != Byte.MinValue)
- return 19;
- if (cast_byte ((object) (byte) 0) != 0)
- return 20;
-
- if (cast_sbyte ((object) (sbyte) -1) != -1)
- return 21;
- if (cast_sbyte ((object) (sbyte) 1) != 1)
- return 22;
- if (cast_sbyte ((object) (sbyte) SByte.MaxValue) != SByte.MaxValue)
- return 23;
- if (cast_sbyte ((object) (sbyte)SByte.MinValue) != SByte.MinValue)
- return 24;
- if (cast_sbyte ((object) (sbyte) 0) != 0)
- return 25;
-
-
- if (cast_long ((object) (long) -1) != -1)
- return 26;
- if (cast_long ((object) (long) 1) != 1)
- return 27;
- if (cast_long ((object) (long) Int64.MaxValue) != Int64.MaxValue)
- return 28;
- if (cast_long ((object) (long) Int64.MinValue) != Int64.MinValue)
- return 29;
- if (cast_long ((object) (long) 0) != 0)
- return 30;
-
- if (cast_ulong ((object) (ulong) 0) != 0)
- return 31;
- if (cast_ulong ((object) (ulong) 1) != 1)
- return 32;
- if (cast_ulong ((object) (ulong) UInt64.MaxValue) != UInt64.MaxValue)
- return 33;
- if (cast_ulong ((object) (ulong) UInt64.MinValue) != UInt64.MinValue)
- return 34;
-
- if (cast_double ((object) (double) -1) != -1)
- return 35;
- if (cast_double ((object) (double) 1) != 1)
- return 36;
- if (cast_double ((object) (double) Double.MaxValue) != Double.MaxValue)
- return 37;
- if (cast_double ((object) (double) Double.MinValue) != Double.MinValue)
- return 38;
- if (cast_double ((object) (double) 0) != 0)
- return 39;
-
- if (cast_float ((object) (float) -1) != -1)
- return 40;
- if (cast_float ((object) (float) 1) != 1)
- return 41;
- if (cast_float ((object) (float)Single.MaxValue) != Single.MaxValue)
- return 42;
- if (cast_float ((object) (float) Single.MinValue) != Single.MinValue)
- return 43;
- if (cast_float ((object) (float) 0) != 0)
- return 44;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-47.cs b/mcs/tests/test-47.cs
deleted file mode 100755
index c269d0b6c71..00000000000
--- a/mcs/tests/test-47.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// Short-circuit evaluation tests
-//
-using System;
-
-class X {
-
- static int t_count = 0;
- static int f_count = 0;
-
- static bool f ()
- {
- Console.WriteLine ("f");
- f_count++;
- return false;
- }
-
- static bool t ()
- {
- Console.WriteLine ("t");
- t_count++;
- return true;
- }
-
- static int Main ()
- {
- if (t () && t ()){
- f_count--;
- }
-
- if (t_count != 2)
- return 1;
-
- if (f_count != -1)
- return 3;
-
- f_count = 0;
-
- if (t () && f ())
- if (t_count != 3 && f_count == 1)
- return 2;
-
- if (f () && f ())
- return 3;
-
- if (f_count != 2)
- return 4;
-
- if (f () && t ())
- return 5;
-
- if (f_count != 3)
- return 6;
-
- if (t_count != 3)
- return 7;
-
- //
- // reset
- //
- Console.WriteLine ("or");
-
- t_count = f_count = 0;
-
- if (t () || t ()){
- if (t_count != 1)
- return 8;
- } else
- return 9;
-
- if (t () || f ()){
- if (f_count != 0)
- return 10;
- if (t_count != 2)
- return 16;
- } else
- return 11;
-
- if (f () || f ()){
- return 12;
- } else
- if (f_count != 2)
- return 13;
-
- if (f () || t ()){
- if (f_count != 3)
- return 15;
- if (t_count != 3)
- return 17;
- } else
- return 14;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-48.cs b/mcs/tests/test-48.cs
deleted file mode 100644
index 21b6857ba6c..00000000000
--- a/mcs/tests/test-48.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-
-public class Blah {
-
- public const int i = 5;
-
- public static int Main ()
- {
- const int foo = 10;
-
- int j = Blah.i;
-
- if (j != 5)
- return 1;
-
- if (foo != 10)
- return 1;
-
- for (int i = 0; i < 5; ++i){
- const int bar = 15;
-
- Console.WriteLine (bar);
- Console.WriteLine (foo);
- }
-
- Console.WriteLine ("Constant emission test okay");
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-49.cs b/mcs/tests/test-49.cs
deleted file mode 100755
index 24d8b6b4799..00000000000
--- a/mcs/tests/test-49.cs
+++ /dev/null
@@ -1,503 +0,0 @@
-//
-// This tests excercises a number of switch things:
-//
-// Code to test for multiple-labels is different that
-// code for a single label.
-//
-// Code for switching on strings is different from the integer
-// code.
-//
-// nulls (for strings) need to be handled specially since ceq will
-// throw an exception if there.
-//
-// null as a case statement needs to be caught specially
-//
-using System;
-
-class X {
- enum A {
- a = 23333,
- }
-
- static int s (byte b)
- {
- switch (b){
- case 0: return 255-0;
- case 1: return 255-1;
- case 2: return 255-2;
- case 3: return 255-3;
- case 4: return 255-4;
- case 5: return 255-5;
- case 6: return 255-6;
- case 7: return 255-7;
- case 8: return 255-8;
- case 9: return 255-9;
- case 10: return 255-10;
- case 11: return 255-11;
- case 12: return 255-12;
- case 13: return 255-13;
- case 14: return 255-14;
- case 15: return 255-15;
- case 16: return 255-16;
- case 17: return 255-17;
- case 18: return 255-18;
- case 19: return 255-19;
- case 20: return 255-20;
- case 21: return 255-21;
- case 22: return 255-22;
- case 23: return 255-23;
- case 24: return 255-24;
- case 25: return 255-25;
- case 26: return 255-26;
- case 27: return 255-27;
- case 28: return 255-28;
- case 29: return 255-29;
- case 30: return 255-30;
- case 31: return 255-31;
- case 32: return 255-32;
- case 33: return 255-33;
- case 34: return 255-34;
- case 35: return 255-35;
- case 36: return 255-36;
- case 37: return 255-37;
- case 38: return 255-38;
- case 39: return 255-39;
- case 40: return 255-40;
- case 41: return 255-41;
- case 42: return 255-42;
- case 43: return 255-43;
- case 44: return 255-44;
- case 45: return 255-45;
- case 46: return 255-46;
- case 47: return 255-47;
- case 48: return 255-48;
- case 49: return 255-49;
- case 50: return 255-50;
- case 51: return 255-51;
- case 52: return 255-52;
- case 53: return 255-53;
- case 54: return 255-54;
- case 55: return 255-55;
- case 56: return 255-56;
- case 57: return 255-57;
- case 58: return 255-58;
- case 59: return 255-59;
- case 60: return 255-60;
- case 61: return 255-61;
- case 62: return 255-62;
- case 63: return 255-63;
- case 64: return 255-64;
- case 65: return 255-65;
- case 66: return 255-66;
- case 67: return 255-67;
- case 68: return 255-68;
- case 69: return 255-69;
- case 70: return 255-70;
- case 71: return 255-71;
- case 72: return 255-72;
- case 73: return 255-73;
- case 74: return 255-74;
- case 75: return 255-75;
- case 76: return 255-76;
- case 77: return 255-77;
- case 78: return 255-78;
- case 79: return 255-79;
- case 80: return 255-80;
- case 81: return 255-81;
- case 82: return 255-82;
- case 83: return 255-83;
- case 84: return 255-84;
- case 85: return 255-85;
- case 86: return 255-86;
- case 87: return 255-87;
- case 88: return 255-88;
- case 89: return 255-89;
- case 90: return 255-90;
- case 91: return 255-91;
- case 92: return 255-92;
- case 93: return 255-93;
- case 94: return 255-94;
- case 95: return 255-95;
- case 96: return 255-96;
- case 97: return 255-97;
- case 98: return 255-98;
- case 99: return 255-99;
- case 100: return 255-100;
- case 101: return 255-101;
- case 102: return 255-102;
- case 103: return 255-103;
- case 104: return 255-104;
- case 105: return 255-105;
- case 106: return 255-106;
- case 107: return 255-107;
- case 108: return 255-108;
- case 109: return 255-109;
- case 110: return 255-110;
- case 111: return 255-111;
- case 112: return 255-112;
- case 113: return 255-113;
- case 114: return 255-114;
- case 115: return 255-115;
- case 116: return 255-116;
- case 117: return 255-117;
- case 118: return 255-118;
- case 119: return 255-119;
- case 120: return 255-120;
- case 121: return 255-121;
- case 122: return 255-122;
- case 123: return 255-123;
- case 124: return 255-124;
- case 125: return 255-125;
- case 126: return 255-126;
- case 127: return 255-127;
- case 128: return 255-128;
- case 129: return 255-129;
- case 130: return 255-130;
- case 131: return 255-131;
- case 132: return 255-132;
- case 133: return 255-133;
- case 134: return 255-134;
- case 135: return 255-135;
- case 136: return 255-136;
- case 137: return 255-137;
- case 138: return 255-138;
- case 139: return 255-139;
- case 140: return 255-140;
- case 141: return 255-141;
- case 142: return 255-142;
- case 143: return 255-143;
- case 144: return 255-144;
- case 145: return 255-145;
- case 146: return 255-146;
- case 147: return 255-147;
- case 148: return 255-148;
- case 149: return 255-149;
- case 150: return 255-150;
- case 151: return 255-151;
- case 152: return 255-152;
- case 153: return 255-153;
- case 154: return 255-154;
- case 155: return 255-155;
- case 156: return 255-156;
- case 157: return 255-157;
- case 158: return 255-158;
- case 159: return 255-159;
- case 160: return 255-160;
- case 161: return 255-161;
- case 162: return 255-162;
- case 163: return 255-163;
- case 164: return 255-164;
- case 165: return 255-165;
- case 166: return 255-166;
- case 167: return 255-167;
- case 168: return 255-168;
- case 169: return 255-169;
- case 170: return 255-170;
- case 171: return 255-171;
- case 172: return 255-172;
- case 173: return 255-173;
- case 174: return 255-174;
- case 175: return 255-175;
- case 176: return 255-176;
- case 177: return 255-177;
- case 178: return 255-178;
- case 179: return 255-179;
- case 180: return 255-180;
- case 181: return 255-181;
- case 182: return 255-182;
- case 183: return 255-183;
- case 184: return 255-184;
- case 185: return 255-185;
- case 186: return 255-186;
- case 187: return 255-187;
- case 188: return 255-188;
- case 189: return 255-189;
- case 190: return 255-190;
- case 191: return 255-191;
- case 192: return 255-192;
- case 193: return 255-193;
- case 194: return 255-194;
- case 195: return 255-195;
- case 196: return 255-196;
- case 197: return 255-197;
- case 198: return 255-198;
- case 199: return 255-199;
- case 200: return 255-200;
- case 201: return 255-201;
- case 202: return 255-202;
- case 203: return 255-203;
- case 204: return 255-204;
- case 205: return 255-205;
- case 206: return 255-206;
- case 207: return 255-207;
- case 208: return 255-208;
- case 209: return 255-209;
- case 210: return 255-210;
- case 211: return 255-211;
- case 212: return 255-212;
- case 213: return 255-213;
- case 214: return 255-214;
- case 215: return 255-215;
- case 216: return 255-216;
- case 217: return 255-217;
- case 218: return 255-218;
- case 219: return 255-219;
- case 220: return 255-220;
- case 221: return 255-221;
- case 222: return 255-222;
- case 223: return 255-223;
- case 224: return 255-224;
- case 225: return 255-225;
- case 226: return 255-226;
- case 227: return 255-227;
- case 228: return 255-228;
- case 229: return 255-229;
- case 230: return 255-230;
- case 231: return 255-231;
- case 232: return 255-232;
- case 233: return 255-233;
- case 234: return 255-234;
- case 235: return 255-235;
- case 236: return 255-236;
- case 237: return 255-237;
- case 238: return 255-238;
- case 239: return 255-239;
- case 240: return 255-240;
- case 241: return 255-241;
- case 242: return 255-242;
- case 243: return 255-243;
- case 244: return 255-244;
- case 245: return 255-245;
- case 246: return 255-246;
- case 247: return 255-247;
- case 248: return 255-248;
- case 249: return 255-249;
- case 250: return 255-250;
- case 251: return 255-251;
- case 252: return 255-252;
- case 253: return 255-253;
- case 254: return 255-254;
- case 255: return 255-255;
- }
-
- return -1;
- }
-
- static int test (int v)
- {
- Console.WriteLine ("value: " + v);
- switch (v){
- case 1:
- case 2:
- return 1;
-
- case 3:
- return 3;
-
- case 4:
- return 5;
-
- default:
- Console.WriteLine ("default");
- return 6;
- }
-
- return 7;
- }
-
- static int tests (string s)
- {
- switch (s){
- case "one":
- case "two":
- return 1;
- case "three":
- return 3;
- case "four":
- return 5;
- case null:
- return 9;
- default:
- return 6;
- }
-
- return 1;
- }
-
- static int testn (string s)
- {
- switch (s){
- case "one":
- return 1;
-
- default:
- return 0;
- }
- return -1;
- }
-
- static int testm (string s)
- {
- switch (s){
- case "one":
- return 1;
- }
- return 100;
- }
-
- static int testo (string s)
- {
- switch (s){
- case "one":
- return 1;
- case null:
- return 100;
- }
- return 2;
- }
-
- static int testp (string s)
- {
- switch (s){
- case "one":
- case null:
- case "two":
- return 1;
- case "three":
- return 3;
- }
- return 4;
- }
-
- static int test_def (string s)
- {
- switch (s){
- case "one":
- goto default;
- case "two":
- return 1;
- case "three":
- return 2;
- default:
- return 3;
- }
- return 4;
- }
-
- static int test_coverage (int x)
- {
- switch (x){
- case 0:
- return 1;
- default:
- return 10;
- }
- }
-
- static int test_goto (int a)
- {
- switch (a){
- case 0:
- goto case 2;
- case 1:
- return 10;
- case 2:
- return 20;
- default:
- return 100;
- }
- }
-
- static int Main ()
- {
- byte b;
-
- for (b = 0; b < 255; b++){
- if (s (b) != 255 - b){
- Console.WriteLine ("Failed with: " + b + " [" + s (b) + "]");
- return 1;
- }
- }
-
- Console.WriteLine ("Batch 2");
- if (test (1) != 1)
- return 1;
- if (test (2) != 1)
- return 2;
- if (test (3) != 3)
- return 3;
- if (test (4) != 5)
- return 4;
- if (test (100) != 6)
- return 5;
-
- if (tests ("one") != 1)
- return 6;
- if (tests ("two") != 1)
- return 7;
- if (tests ("three") != 3)
- return 8;
- if (tests ("four") != 5)
- return 9;
- if (tests (null) != 9)
- return 10;
- if (tests ("blah") != 6)
- return 11;
-
- if (testn ("one") != 1)
- return 12;
- if (testn ("hello") != 0)
- return 13;
- if (testn (null) != 0)
- return 14;
-
- if (testm ("one") != 1)
- return 15;
- if (testm ("two") != 100)
- return 16;
- if (testm (null) != 100)
- return 17;
-
- if (testo ("one") != 1)
- return 18;
- if (testo ("two") != 2)
- return 19;
- if (testo (null) != 100)
- return 20;
-
- if (testp ("one") != 1)
- return 21;
- if (testp (null) != 1)
- return 22;
- if (testp ("two") != 1)
- return 23;
- if (testp ("three") != 3)
- return 24;
- if (testp ("blah") != 4)
- return 25;
-
- if (test_def ("one") != 3)
- return 26;
- if (test_def ("two") != 1)
- return 27;
- if (test_def ("three") != 2)
- return 28;
- if (test_def (null) != 3)
- return 29;
-
- if (test_coverage (100) != 10)
- return 30;
-
- if (test_goto (0) != 20)
- return 31;
- if (test_goto (1) != 10)
- return 32;
- if (test_goto (2) != 20)
- return 33;
- if (test_goto (200) != 100)
- return 34;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-5.cs b/mcs/tests/test-5.cs
deleted file mode 100755
index 7b3bdbc7924..00000000000
--- a/mcs/tests/test-5.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-class X {
-
- static int Main ()
- {
- Console.WriteLine ("From 0 to 9");
-
- for (int i = 0; i < 10; i++)
- Console.WriteLine (i);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-50.cs b/mcs/tests/test-50.cs
deleted file mode 100644
index 84636e887ff..00000000000
--- a/mcs/tests/test-50.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-
-public class Blah {
-
- [DllImport ("user32", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Auto)]
- public static extern int MessageBox (int hWnd, string pText, string pCaption, int uType);
-
- public static int Main ()
- {
- MessageBox (0, "Hello from Mono !", "PInvoke Test", 0);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-51.cs b/mcs/tests/test-51.cs
deleted file mode 100755
index 3a6257747b6..00000000000
--- a/mcs/tests/test-51.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// This test is used to test the `base' implementation
-//
-using System;
-
-class Base {
- public int b_int_field;
- public string b_string_field;
-
- public const int b_const_three = 3;
-
- public int b_int_property {
- get {
- return b_int_field;
- }
-
- set {
- b_int_field = value;
- }
- }
-
- public string b_get_id ()
- {
- return "Base";
- }
-
- public Base ()
- {
- b_int_field = 1;
- b_string_field = "base";
- }
-}
-
-class Derived : Base {
- new int b_int_field;
- new string b_string_field;
- new const int b_const_three = 4;
-
- new int b_int_property {
- get {
- return b_int_field;
- }
-
-
- set {
- b_int_field = value;
- }
-
- }
-
- public Derived ()
- {
- b_int_field = 10;
- b_string_field = "derived";
- }
-
- public int Test ()
- {
- if (b_int_field != 10)
- return 1;
- if (base.b_int_field != 1)
- return 2;
- if (base.b_string_field != "base")
- return 3;
- if (b_string_field != "derived")
- return 4;
- base.b_int_property = 4;
- if (b_int_property != 10)
- return 5;
- if (b_int_property != 10)
- return 6;
- if (base.b_int_property != 4)
- return 7;
- if (b_const_three != 4)
- return 8;
- if (Base.b_const_three != 3)
- return 9;
- System.Console.WriteLine ("All tests pass");
- return 0;
- }
-}
-
-class boot {
- static int Main ()
- {
- Derived d = new Derived ();
- return d.Test ();
- }
-}
diff --git a/mcs/tests/test-52.cs b/mcs/tests/test-52.cs
deleted file mode 100755
index f16e6264696..00000000000
--- a/mcs/tests/test-52.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// Tests the foreach on strings, and tests the implicit use of foreach
-// to pull the enumerator from the class and identify the pattern to be called
-//
-using System;
-using System.Collections;
-
-class Y {
- int count = 0;
-
- public bool MoveNext ()
- {
- count++;
- return count != 10;
- }
-
- public object Current {
- get {
- return count;
- }
- }
-}
-
-class X {
-
- static string [] a = {
- "one", "two", "three"
- };
-
- public Y GetEnumerator ()
- {
- return new Y ();
- }
-
- static int Main ()
- {
- //
- // String test
- //
- string total = "";
-
- foreach (string s in a){
- total = total + s;
- }
- if (total != "onetwothree")
- return 1;
-
- //
- // Pattern test
- //
- X x = new X ();
-
- int t = 0;
- foreach (object o in x){
- t += (int) o;
- }
- if (t != 45)
- return 2;
-
- //
- // Looking for GetEnumerator on interfaces test
- //
- Hashtable xx = new Hashtable ();
- xx.Add ("A", 10);
- xx.Add ("B", 20);
-
- IDictionary vars = xx;
- string total2 = "";
- foreach (string name in vars.Keys){
- total2 = total2 + name;
- }
-
- if (total2 != "AB")
- return 3;
-
- Console.WriteLine ("test passes");
- return 0;
- }
-}
diff --git a/mcs/tests/test-53.cs b/mcs/tests/test-53.cs
deleted file mode 100755
index 34cdd0c2f94..00000000000
--- a/mcs/tests/test-53.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-// Tests the using statement implementation
-//
-using System;
-using System.IO;
-
-class MyDispose : IDisposable {
- public bool disposed;
-
- public void Dispose ()
- {
- disposed = true;
- }
-}
-
-//
-// This class does not implement IDiposable, but has an implicit conversion
-// defined
-//
-class NoIDispose {
- static public MyDispose x;
-
- public NoIDispose ()
- {
- }
-
- static NoIDispose ()
- {
- x = new MyDispose ();
- }
-
- public static implicit operator MyDispose (NoIDispose a)
- {
- return x;
- }
-}
-
-class Y {
- static void B ()
- {
- using (NoIDispose a = new NoIDispose ()){
- }
- }
-
-}
-
-class X {
- static int Main ()
- {
- MyDispose copy_a, copy_b, copy_c;
-
- //
- // Test whether the two `a' and `b' get disposed
- //
- using (MyDispose a = new MyDispose (), b = new MyDispose ()){
- copy_a = a;
- copy_b = b;
- }
-
- if (!copy_a.disposed)
- return 1;
- if (!copy_b.disposed)
- return 2;
-
- Console.WriteLine ("Nested using clause disposed");
-
- //
- // See if the variable `b' is disposed if there is
- // an error thrown inside the using block.
- //
- copy_c = null;
- try {
- using (MyDispose c = new MyDispose ()){
- copy_c = c;
- throw new Exception ();
- }
- } catch {}
-
- if (!copy_c.disposed)
- return 3;
- else
- Console.WriteLine ("Disposal on finally block works");
-
- //
- // This should test if `a' is non-null before calling dispose
- // implicitly
- //
- using (MyDispose d = null){
- }
-
- Console.WriteLine ("Null test passed");
-
- //
- // This tests that a variable is permitted here if there is
- // an implicit conversion to a type that implement IDisposable
- //
- using (NoIDispose a = new NoIDispose ()){
- }
-
- //
- // See if we dispose the object that can be implicitly converted
- // to IDisposable
- if (NoIDispose.x.disposed != true)
- return 4;
- else
- Console.WriteLine ("Implicit conversion from type to IDisposable pass");
-
- MyDispose bb = new MyDispose ();
- using (bb){
-
- }
- if (bb.disposed == false)
- return 6;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-54.cs b/mcs/tests/test-54.cs
deleted file mode 100755
index 0eb5b692204..00000000000
--- a/mcs/tests/test-54.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// This test does not pass peverify because we dont return properly
-// from catch blocks
-//
-using System;
-
-class X {
-
- bool v ()
- {
- try {
- throw new Exception ();
- } catch {
- return false;
- }
- return true;
- }
-
- static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-55.cs b/mcs/tests/test-55.cs
deleted file mode 100755
index 6058ee2a1ba..00000000000
--- a/mcs/tests/test-55.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using c = System.Console;
-using s = System;
-
-namespace A {
- namespace B {
- class C {
- public static void Hola () {
- c.WriteLine ("Hola!");
- }
- }
- }
-}
-
-namespace X {
- namespace Y {
- namespace Z {
- class W {
- public static void Ahoj () {
- s.Console.WriteLine ("Ahoj!");
- }
- }
- }
- }
-}
-
-class App {
- public static int Main () {
- A.B.C.Hola ();
- X.Y.Z.W.Ahoj ();
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-56.cs b/mcs/tests/test-56.cs
deleted file mode 100755
index 286cb10dacd..00000000000
--- a/mcs/tests/test-56.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// Stress test properties and the various modes of
-// declarations (virtual, overrides, abstract, new)
-//
-using System;
-
-interface I {
- int P {
- get; set;
- }
-}
-
-abstract class A : I {
- public int p;
- public int q;
-
- public int P {
- get { return p; }
- set { p = value; }
- }
-
- public abstract int Q { get; set; }
-
- public int r;
- public virtual int R { get { return r; } set { r = value; } }
-}
-
-class B : A {
- public int bp;
-
- public new int P
- {
- get { return bp; }
- set { bp = value; }
- }
-
- public override int Q {
- get { return q; }
- set { q = value; }
- }
-}
-
-class C : A {
- public override int Q {
- get { return q; }
- set { q = value; }
- }
-
- public int rr;
- public override int R { get { return rr; } set { rr = value; } }
-}
-
-class M {
-
- static int Main ()
- {
- B b = new B ();
-
- b.P = 1;
- b.R = 10;
- b.Q = 20;
-
- if (b.P != 1)
- return 1;
- if (b.bp != 1)
- return 2;
-
- if (b.R != 10)
- return 3;
- if (b.r != 10)
- return 4;
-
- if (b.Q != 20)
- return 5;
- if (b.q != 20)
- return 6;
-
- C c = new C ();
-
- c.R = 10;
- c.Q = 20;
- c.P = 30;
- if (c.R != 10)
- return 7;
- if (c.rr != 10)
- return 8;
- if (c.P != 30)
- return 9;
- if (c.p != 30)
- return 10;
-
- Console.WriteLine ("Test passes");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-57.cs b/mcs/tests/test-57.cs
deleted file mode 100644
index 2d23bdedb13..00000000000
--- a/mcs/tests/test-57.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-
-public delegate void EventHandler (int i, int j);
-
-public class Button {
-
- private EventHandler click;
-
- public event EventHandler Click {
- add { click += value; }
- remove { click -= value; }
- }
-
- public void OnClick (int i, int j)
- {
- if (click == null) {
- Console.WriteLine ("Nothing to click!");
- return;
- }
-
- click (i, j);
- }
-
- public void Reset ()
- {
- click = null;
- }
-}
-
-public class Blah {
-
- Button Button1 = new Button ();
-
- public void Connect ()
- {
- Button1.Click += new EventHandler (Button1_Click);
- Button1.Click += new EventHandler (Foo_Click);
- }
-
- public void Button1_Click (int i, int j)
- {
- Console.WriteLine ("Button1 was clicked !");
- Console.WriteLine ("Answer : " + (i+j));
- }
-
- public void Foo_Click (int i, int j)
- {
- Console.WriteLine ("Foo was clicked !");
- Console.WriteLine ("Answer : " + (i+j));
- }
-
- public void Disconnect ()
- {
- Console.WriteLine ("Disconnecting Button1's handler ...");
- Button1.Click -= new EventHandler (Button1_Click);
- }
-
- public static int Main ()
- {
- Blah b = new Blah ();
-
- b.Connect ();
-
- b.Button1.OnClick (2, 3);
-
- b.Disconnect ();
-
- Console.WriteLine ("Now calling OnClick again");
- b.Button1.OnClick (3, 7);
-
- Console.WriteLine ("Events test passes");
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-58.cs b/mcs/tests/test-58.cs
deleted file mode 100755
index d7230ee45df..00000000000
--- a/mcs/tests/test-58.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Reflection;
-
-public class Blah {
-
- public static int Main ()
- {
- unsafe {
- int* i;
- int foo = 10;
-
- void* bar;
-
- i = &foo;
-
- bar = i;
-
- Console.WriteLine ("Address : {0}", (int) i);
- }
-
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/test-59.cs b/mcs/tests/test-59.cs
deleted file mode 100755
index f857ed84d12..00000000000
--- a/mcs/tests/test-59.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// Tests the varios type conversions.
-//
-using System;
-
-class X {
-
- static int test_explicit ()
- {
- object x_int = 1;
- object x_uint_1 = 1u;
- object x_uint_2 = 1U;
- object x_long_1 = 1l;
- object x_long_2 = 1L;
- object x_ulong_1 = 1ul;
- object x_ulong_2 = 1UL;
- object x_ulong_3 = 1lu;
- object x_ulong_4 = 1Lu;
- object x_ulong_5 = 1LU;
-
- if (!(x_int is int))
- return 1;
-
- if (!(x_uint_1 is uint))
- return 2;
-
- if (!(x_uint_2 is uint))
- return 3;
-
- if (!(x_long_1 is long))
- return 5;
-
- if (!(x_long_2 is long))
- return 6;
-
- if (!(x_ulong_1 is ulong))
- return 7;
-
- if (!(x_ulong_2 is ulong))
- return 8;
-
- if (!(x_ulong_3 is ulong))
- return 9;
-
- if (!(x_ulong_4 is ulong))
- return 10;
-
- if (!(x_ulong_5 is ulong))
- return 11;
-
- return 0;
-
- }
-
- static int test_implicit ()
- {
- object i_int = 1;
- object i_uint = 0x80000000;
- object i_long = 0x100000000;
- object i_ulong = 0x8000000000000000;
-
- if (!(i_int is int))
- return 1;
- if (!(i_uint is uint))
- return 2;
- if (!(i_long is long))
- return 3;
- if (!(i_ulong is ulong))
- return 4;
-
- return 0;
- }
-
- static int Main ()
- {
- int v;
- v = test_explicit ();
-
- if (v != 0)
- return v;
-
- v = test_implicit ();
- if (v != 0)
- return 20 + v;
-
- Console.WriteLine ("Tests pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-6.cs b/mcs/tests/test-6.cs
deleted file mode 100755
index b95d891b7c4..00000000000
--- a/mcs/tests/test-6.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-class X {
-
- static int Main ()
- {
- Console.WriteLine ("From 0 to 9");
- int i;
-
- for (i = 0; i < 10; i++)
- Console.WriteLine (i);
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-60.cs b/mcs/tests/test-60.cs
deleted file mode 100755
index 04161d53448..00000000000
--- a/mcs/tests/test-60.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Really lame test, but it should be fine for now
-//
-#if (X)
-#endif
-
-#if YY
-#errro this should not be printed
-#if X
-#elif Y
-#else
-#endif
-#else
-class X {
- static int Main ()
- {
- return 0;
- }
-}
-#endif
diff --git a/mcs/tests/test-61.cs b/mcs/tests/test-61.cs
deleted file mode 100755
index 9d8c8532b0f..00000000000
--- a/mcs/tests/test-61.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// This tests checks that we allow the `get' and `set' keywords inside
-// the get and set blocks. It does the same for Events special remove
-// and add keywords.
-//
-class X {
- int Property {
- get {
- int get;
- get = 1;
- return get;
- }
- set {
- int set;
- set = value;
- }
- }
-
- int P2 {
- get { return 0; }
- }
-
- int P3 {
- set { }
- }
-
- public delegate void MyEvent ();
-
- public event MyEvent XX {
- add { int add = 1; }
- remove { int remove = 1; }
- }
-
- static int Main ()
- {
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-62.cs b/mcs/tests/test-62.cs
deleted file mode 100755
index 550956009e0..00000000000
--- a/mcs/tests/test-62.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// This test just makes sure that we can typecast to
-// array types, as this was introduced later into the
-// grammar.
-//
-
-class X {
-
- X [] GetX ()
- {
- return (X []) null;
- }
-
- int [] getInt ()
- {
- return (int []) null;
- }
-
- int [,,] getMoreInt ()
- {
- return (int [,,]) null;
- }
-
- static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-63.cs b/mcs/tests/test-63.cs
deleted file mode 100755
index 268c607f783..00000000000
--- a/mcs/tests/test-63.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// Tests rethrowing an exception
-//
-using System;
-
-class X {
- static int Main ()
- {
- bool one = false, two = false;
-
- try {
- try {
- throw new Exception ();
- } catch (Exception e) {
- one = true;
- Console.WriteLine ("Caught");
- throw;
- }
- } catch {
- two = true;
- Console.WriteLine ("Again");
- }
-
- if (one && two){
- Console.WriteLine ("Ok");
- return 0;
- } else
- Console.WriteLine ("Failed");
- return 1;
- }
-}
diff --git a/mcs/tests/test-64.cs b/mcs/tests/test-64.cs
deleted file mode 100755
index 43c31d7559e..00000000000
--- a/mcs/tests/test-64.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// This just test that we can compile this code.
-//
-// The challenge here is that LookupType needs to first look
-// in classes defined in its class or parent classes before resorting
-// to lookups in the namespace.
-//
-
-class Operator {
-}
-
-class Blah {
-
- public enum Operator { A, B };
-
- public Blah (Operator x)
- {
- }
-}
-
-class T {
- static int Main ()
- {
- Blah b = new Blah (Blah.Operator.A);
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-65.cs b/mcs/tests/test-65.cs
deleted file mode 100755
index b117ae309a4..00000000000
--- a/mcs/tests/test-65.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// This exercises the various ways in which the new operator works
-// with value types.
-//
-
-using System;
-
-struct S {
- int v;
-}
-
-class X {
- static bool receive, create, create_and_box;
-
- static void receiver (S x)
- {
- receive = true;
- }
-
- static object BoxS ()
- {
- create_and_box = true;
- return new S ();
- }
-
- static S Plain ()
- {
- create = true;
- return new S ();
- }
-
- static int Main ()
- {
- object a = new S ();
- receiver (new S ());
- S s = Plain ();
- object o = BoxS ();
-
- if (a == null)
- return 1;
- if (receive == false)
- return 2;
- if (create == false)
- return 3;
- if (create_and_box == false)
- return 4;
-
- Console.WriteLine ("Test pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-66.cs b/mcs/tests/test-66.cs
deleted file mode 100755
index 7691f6e7334..00000000000
--- a/mcs/tests/test-66.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-//
-// This tests checks out field access to arrays
-//
-using System;
-
-struct A {
- public int a;
-}
-
-class Y {
- public object a;
-}
-
-class X {
- static A [] a_single = new A [10];
- static A [,] a_double = new A [10,10];
- static Y [] o_single = new Y [10];
- static Y [,] o_double = new Y [10,10];
-
- static void FillOne ()
- {
- a_single [0].a = 1;
- }
-
- static void FillSingle ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- a_single [i].a = i + 1;
- }
- }
-
- static void FillDouble ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++)
- for (j = 0; j < 10; j++)
- a_double [i,j].a = i * j;
- }
-
- static void FillObject ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- o_single [i] = new Y ();
- o_single [i].a = (i + 1);
- }
- }
-
- static void FillDoubleObject ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++)
- for (j = 0; j < 10; j++){
- o_double [i,j] = new Y ();
- o_double [i,j].a = i * j;
- }
- }
-
- static int TestSingle ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- if (a_single [i].a != i + 1)
- return 1;
- }
- return 0;
- }
-
- static int TestDouble ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++)
- if (a_double [i,j].a != (i *j))
- return 2;
- }
-
- return 0;
- }
-
- static int TestObjectSingle ()
- {
- int i;
-
- for (i = 0; i < 10; i++){
- if ((int)(o_single [i].a) != i + 1)
- return 1;
- }
- return 0;
- }
-
- static int TestObjectDouble ()
- {
- int i, j;
-
- for (i = 0; i < 10; i++){
- for (j = 0; j < 10; j++)
- if (((int)o_double [i,j].a) != (i *j))
- return 2;
- }
-
- return 0;
- }
-
- static int Main ()
- {
- FillSingle ();
- FillDouble ();
- FillObject ();
- FillDoubleObject ();
-
- if (TestSingle () != 0)
- return 1;
-
- if (TestDouble () != 0)
- return 2;
-
- if (TestObjectSingle () != 0)
- return 3;
-
- if (TestObjectDouble () != 0)
- return 4;
-
- Console.WriteLine ("test passes");
- return 0;
- }
-}
diff --git a/mcs/tests/test-67.cs b/mcs/tests/test-67.cs
deleted file mode 100644
index 7eb792ae690..00000000000
--- a/mcs/tests/test-67.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-
-[StructLayout (LayoutKind.Sequential)]
-public class MySystemTime {
- public ushort Year;
- public ushort Month;
- public ushort DayOfWeek;
- public ushort Day;
- public ushort Hour;
- public ushort Minute;
- public ushort Second;
- public ushort Milliseconds;
-}
-
-[StructLayout (LayoutKind.Sequential)]
-public struct Point {
- public int x;
- public int y;
-}
-
-[StructLayout (LayoutKind.Explicit)]
-public struct Rect {
- [FieldOffset (0)] public int left;
- [FieldOffset (4)] public int top;
- [FieldOffset (8)] public int right;
- [FieldOffset (12)] public int bottom;
-}
-
-[StructLayout (LayoutKind.Explicit)]
-struct A {
- [FieldOffset (0)]
- public int a;
- [FieldOffset (0)]
- public byte b1;
- [FieldOffset (1)]
- public byte b2;
- [FieldOffset (2)]
- public byte b3;
- [FieldOffset (3)]
- public byte b4;
-}
-
-public class Blah {
-
- [DllImport ("Kernel32.dll")]
- public static extern void GetSystemTime (MySystemTime st);
-
- [DllImport ("User32.dll")]
- public static extern bool PtInRect (ref Rect r, Point p);
-
- public static int Main () {
-
- MySystemTime st = new MySystemTime ();
-
- GetSystemTime (st);
-
- Console.WriteLine ("Today's date is : {0:0000}-{1:00}-{2:00}", st.Year, st.Month, st.Day);
- Console.WriteLine ("The time now is : {0:00}:{1:00}:{2:00}", st.Hour, st.Minute, st.Second);
-
- Rect r = new Rect ();
-
- r.left = 10;
- r.top = 12;
- r.right = 30;
- r.bottom = 30;
-
- Point p = new Point ();
-
- p.x = 15;
- p.y = 20;
-
- if (!PtInRect (ref r, p))
- return 1;
-
- A a = new A ();
-
- a.a = 0x12345678;
-
- if (a.b1 != 0x78)
- return 2;
- if (a.b2 != 0x56)
- return 3;
- if (a.b3 != 0x34)
- return 4;
- if (a.b4 != 0x12)
- return 5;
-
- Console.WriteLine ("Point lies inside rect");
- Console.WriteLine ("Test passes");
- return 0;
- }
-}
diff --git a/mcs/tests/test-68.cs b/mcs/tests/test-68.cs
deleted file mode 100755
index df49dbc8786..00000000000
--- a/mcs/tests/test-68.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// Tests invocation of reference type functions with value type arguments
-//
-using System;
-enum A {
- Hello
-}
-
-class X {
-
- static int Main ()
- {
- if ("Hello" != A.Hello.ToString ())
- return 1;
-
- Console.WriteLine ("value is: " + (5.ToString ()));
- if (5.ToString () != "5")
- return 2;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-69.cs b/mcs/tests/test-69.cs
deleted file mode 100644
index be58166c258..00000000000
--- a/mcs/tests/test-69.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-
-public class Blah {
-
- [MethodImpl (MethodImplOptions.InternalCall)]
- private extern void Start_internal(IntPtr handle);
-
- public static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-7.cs b/mcs/tests/test-7.cs
deleted file mode 100644
index d3a9a9f34b1..00000000000
--- a/mcs/tests/test-7.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-using System;
-
-namespace Mine {
-
- public class Blah {
-
- public int i;
-
- public static int Main ()
- {
- Blah k, l;
-
- k = new Blah (2) + new Blah (3);
- if (k.i != 5)
- return 1;
-
- k = ~ new Blah (5);
- if (k.i != -6)
- return 1;
-
-
- k = + new Blah (4);
- if (k.i != 4)
- return 1;
-
- k = - new Blah (21);
- if (k.i != -21)
- return 1;
-
- k = new Blah (22) - new Blah (21);
- if (k.i != 1)
- return 1;
-
- if (!k)
- Console.WriteLine ("! returned true");
-
- int number = k;
- if (number != 1)
- return 1;
-
- k++;
- ++k;
-
- if (k)
- Console.WriteLine ("k is definitely true");
-
- k = new Blah (30);
-
- double f = (double) k;
-
- if (f != 30.0)
- return 1;
-
- int i = new Blah (5) * new Blah (10);
-
- if (i != 50)
- return 1;
-
- k = new Blah (50);
- l = new Blah (10);
-
- i = k / l;
-
- if (i != 5)
- return 1;
-
- i = k % l;
-
- if (i != 0)
- return 1;
-
- return 0;
- }
-
- public Blah (int v)
- {
- i = v;
- }
-
- public static Blah operator + (Blah i, Blah j)
- {
- Blah b = new Blah (i.i + j.i);
- Console.WriteLine ("Overload binary + operator");
- return b;
- }
-
- public static Blah operator + (Blah i)
- {
- Console.WriteLine ("Overload unary + operator");
- return new Blah (i.i);
- }
-
- public static Blah operator - (Blah i)
- {
- Console.WriteLine ("Overloaded unary - operator");
- return new Blah (- i.i);
- }
-
- public static Blah operator - (Blah i, Blah j)
- {
- Blah b = new Blah (i.i - j.i);
- Console.WriteLine ("Overloaded binary - operator");
- return b;
- }
-
- public static int operator * (Blah i, Blah j)
- {
- Console.WriteLine ("Overloaded binary * operator");
- return i.i * j.i;
- }
-
- public static int operator / (Blah i, Blah j)
- {
- Console.WriteLine ("Overloaded binary / operator");
- return i.i / j.i;
- }
-
- public static int operator % (Blah i, Blah j)
- {
- Console.WriteLine ("Overloaded binary % operator");
- return i.i % j.i;
- }
-
- public static Blah operator ~ (Blah i)
- {
- Console.WriteLine ("Overloaded ~ operator");
- return new Blah (~i.i);
- }
-
- public static bool operator ! (Blah i)
- {
- Console.WriteLine ("Overloaded ! operator");
- return (i.i == 1);
- }
-
- public static Blah operator ++ (Blah i)
- {
- Blah b = new Blah (i.i + 1);
- Console.WriteLine ("Incrementing i");
- return b;
- }
-
- public static Blah operator -- (Blah i)
- {
- Blah b = new Blah (i.i - 1);
- Console.WriteLine ("Decrementing i");
- return b;
- }
-
- public static bool operator true (Blah i)
- {
- Console.WriteLine ("Overloaded true operator");
- return (i.i == 3);
- }
-
- public static bool operator false (Blah i)
- {
- Console.WriteLine ("Overloaded false operator");
- return (i.i != 1);
- }
-
- public static implicit operator int (Blah i)
- {
- Console.WriteLine ("Converting implicitly from Blah->int");
- return i.i;
- }
-
- public static explicit operator double (Blah i)
- {
- Console.WriteLine ("Converting explicitly from Blah->double");
- return (double) i.i;
- }
-
- }
-
-}
diff --git a/mcs/tests/test-70.cs b/mcs/tests/test-70.cs
deleted file mode 100755
index 6fe8da995e8..00000000000
--- a/mcs/tests/test-70.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Tests the right settings for overrides
-//
-
-class X {
-
- public virtual int A {
- get {
- return 1;
- }
- }
-
- public virtual int B ()
- {
- return 1;
- }
-}
-
-class Y : X {
- public override int A {
- get {
- return base.A + 2;
- }
- }
-
- public override int B ()
- {
- return base.B () + 1;
- }
-}
-
-class Z {
- static int Main ()
- {
- Y y = new Y ();
- X x = new X ();
-
- if (y.B () != 2)
- return 1;
- if (y.A != 3)
- return 2;
- if (x.A != 1)
- return 3;
- if (x.B () != 1)
- return 4;
- return 0;
- }
-}
diff --git a/mcs/tests/test-71.cs b/mcs/tests/test-71.cs
deleted file mode 100755
index e7bd956c5f6..00000000000
--- a/mcs/tests/test-71.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// struct with a constructor
-//
-using System;
-
-class X {
-
- static void Main ()
- {
- MethodSignature ms = new MethodSignature ("hello", null, null);
-
- Console.WriteLine ("About to look for: " + ms.Name);
- }
-}
-
- struct MethodSignature {
- public string Name;
- public Type RetType;
- public Type [] Parameters;
-
- public MethodSignature (string name, Type ret_type, Type [] parameters)
- {
- Name = name;
- RetType = ret_type;
- Parameters = parameters;
- }
- }
-
diff --git a/mcs/tests/test-72.cs b/mcs/tests/test-72.cs
deleted file mode 100755
index 06d1cee18f9..00000000000
--- a/mcs/tests/test-72.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Compile test for referencing types on nested types
-//
-
-using System;
-
-public class outer {
- public class inner {
- public void meth(Object o) {
- inner inst = (inner)o;
- }
- }
-
- static int Main ()
- {
- // We only test that this compiles.
-
- return 0;
- }
- }
-
diff --git a/mcs/tests/test-73.cs b/mcs/tests/test-73.cs
deleted file mode 100755
index 2acf9806895..00000000000
--- a/mcs/tests/test-73.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// This test is used to test that we do not use the .override
-// command on abstract method implementations.
-//
-
-public abstract class Abstract {
- public abstract int A ();
-}
-
-public class Concrete : Abstract {
- public override int A () {
- return 1;
- }
-}
-
-class Test {
-
- static int Main ()
- {
- Concrete c = new Concrete ();
-
- if (c.A () != 1)
- return 1;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-74.cs b/mcs/tests/test-74.cs
deleted file mode 100755
index ede9e38b577..00000000000
--- a/mcs/tests/test-74.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// This test excercises #pre-processor directives in non-1 column
-// as well as the literal strings
-//
-class X {
- #if Blah
- #else
- static int Main ()
- {
- #endif
- string s = @"Hola\";
- string d = "Hola\\";
- string e = @"Co""a";
- string f = "Co\"a";
-
- if (s != d)
- return 1;
- if (e != f)
- return 2;
- return 0;
- }
-}
diff --git a/mcs/tests/test-75.cs b/mcs/tests/test-75.cs
deleted file mode 100755
index a16816cbbf0..00000000000
--- a/mcs/tests/test-75.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// This test probes using an operator overloaded in a parents' parent
-//
-
-class X {
- public static bool called = false;
-
- static public X operator + (X a, X b)
- {
- called = true;
- return null;
- }
-}
-
-class Y : X {
-}
-
-class Z : Y {
-}
-
-class driver {
-
- static int Main ()
- {
- Z a = new Z ();
- Z b = new Z ();
- X c = a + b;
-
- if (X.called)
- return 0;
-
- return 1;
- }
-
-}
-
diff --git a/mcs/tests/test-76.cs b/mcs/tests/test-76.cs
deleted file mode 100755
index 91377cee80a..00000000000
--- a/mcs/tests/test-76.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// This test is used to verify that we handle functions that have
-// only an array parameter
-//
-
-using System;
-using System.Text;
-
-class foo {
-
- static string strcat (params string [] values)
- {
- StringBuilder s = new StringBuilder ();
-
- foreach (string val in values) {
- s.Append (val);
- }
-
- return s.ToString ();
- }
-
- public static int Main ()
- {
- if (strcat ("Hello", "World") != "HelloWorld")
- return 1;
-
- if (strcat () != "")
- return 2;
-
- if (strcat ("a", "b", "c", "d", "e") != "abcde")
- return 3;
-
- return 0;
- }
-};
diff --git a/mcs/tests/test-77.cs b/mcs/tests/test-77.cs
deleted file mode 100755
index aca2001a39e..00000000000
--- a/mcs/tests/test-77.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// Tests the various string implicit conversions
-//
-
-class XX {
-
- enum X {
- A = 1
- }
-
- static int Main ()
- {
- int one = 1;
- int two = 2;
-
- if (("a" + "b") != "ab")
- return 1;
-
- if (("one" + one) != "one1")
- return 2;
-
- if ((one + "one") != "1one")
- return 3;
-
- if ((one + "two" + two) != "1two2")
- return 4;
-
- if ((X.A + "a") != "Aa")
- return 5;
-
- if (((int)X.A) + "a" != "1a")
- return 6;
-
- System.Console.WriteLine ("test ok");
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-78.cs b/mcs/tests/test-78.cs
deleted file mode 100755
index 3787fe6b9e2..00000000000
--- a/mcs/tests/test-78.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// This test exhibits an old bug where we did not
-// go into the underlying type for an enumeration, and
-// hence implicit and explicit casts were not working when
-// they were going from a type to an enum
-//
-
-namespace N1
-{
- public enum A
- {
- A_1, A_2, A_3
- }
-
- public class B
- {
- static bool ShortCasting ()
- {
- short i = 0;
- N1.A a = N1.A.A_1;
-
- i = (short) a; //<- crash
- a = (N1.A)i;//<- used to fail, can't convert
-
- if (a != N1.A.A_1)
- return false;
- return true;
- }
-
- static bool IntCasting ()
- {
- int i = 0;
- N1.A a = N1.A.A_1;
-
- i = (int) a;//<- works fine
- a = (N1.A)i;//<- used to fail, can't convert
-
- if (a != N1.A.A_1)
- return false;
- return true;
- }
-
- static int Main ()
- {
- if (!IntCasting ())
- return 1;
- if (!ShortCasting ())
- return 2;
- return 0;
- }
-
- }
-}
-
-
-
-
-
-
diff --git a/mcs/tests/test-79.cs b/mcs/tests/test-79.cs
deleted file mode 100755
index 8a4012db8ad..00000000000
--- a/mcs/tests/test-79.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// This test excercises the compiler being able to compute
-// correctly the return type in the presence of null (as null
-// will be implicitly convertible to anything
-//
-class X {
-
- static int Main ()
- {
- object o = null;
-
- string s = o == null ? "string" : null;
- string d = o == null ? null : "string";
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-8.cs b/mcs/tests/test-8.cs
deleted file mode 100644
index 5de9804f341..00000000000
--- a/mcs/tests/test-8.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-class X {
- static public int Main (string [] args)
- {
- int a, b, c, d;
-
- a = b = 10;
- c = d = 14;
-
- if ((a + b) != 20)
- return 1;
- if ((a + d) != 24)
- return 2;
- if ((c + d) != 28)
- return 3;
- if ((b + c) != 24)
- return 4;
-
- if (a++ != 10)
- return 5;
- if (++a != 12)
- return 6;
- if (b-- != 10)
- return 7;
- if (--b != 8)
- return 8;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-80.cs b/mcs/tests/test-80.cs
deleted file mode 100755
index ec2270b1c40..00000000000
--- a/mcs/tests/test-80.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// This test is used to check that we can actually use implementations
-// provided in our parent to interfaces declared afterwards.
-//
-
-using System;
-
-public interface A {
- int Add (int a, int b);
-}
-
-public class X {
- public int Add (int a, int b)
- {
- return a + b;
- }
-}
-
-class Y : X, A {
-
- static int Main ()
- {
- Y y = new Y ();
-
- if (y.Add (1, 1) != 2)
- return 1;
-
- Console.WriteLine ("parent interface implementation test passes");
- return 0;
- }
-
-}
diff --git a/mcs/tests/test-81.cs b/mcs/tests/test-81.cs
deleted file mode 100644
index 005708bfc86..00000000000
--- a/mcs/tests/test-81.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// Tests if we can invoke static members using the short
-// names
-//
-using System;
-
-namespace N1
-{
- public class A
- {
- int x;
- string s;
-
- void Bar ()
- {
- x = int.Parse ("0");
- s = string.Format("{0}", x);
- }
-
- public static int Main ()
- {
- A a = new A ();
-
- a.Bar ();
-
- if (a.x != 0)
- return 1;
-
- if (a.s != "0")
- return 1;
-
- Console.WriteLine ("Bar set s to " + a.s);
-
- return 0;
- }
- }
-}
diff --git a/mcs/tests/test-82.cs b/mcs/tests/test-82.cs
deleted file mode 100644
index 9ff4032897b..00000000000
--- a/mcs/tests/test-82.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// Test to ensure that we correctly perform type lookups - thanks to Felix A.I
-//
-namespace N1
-{
- public enum A
- {
- A_1, A_2, A_3
- }
-
- namespace N2
- {
- public class B
- {
- A member;
-
- void Method (ref A a)
- {
- }
-
- public static int Main ()
- {
- return 0;
- }
- }
-
- }
-}
-
-namespace N1.N3
-{
- public class B
- {
- A member;
-
- void Method (ref A a)
- {
- }
- }
-}
diff --git a/mcs/tests/test-83.cs b/mcs/tests/test-83.cs
deleted file mode 100755
index f416ddb4a6d..00000000000
--- a/mcs/tests/test-83.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// This test probes that we treat events differently than fields
-// This used to cause a compiler crash.
-//
-using System;
-
-delegate void PersonArrivedHandler (object source, PersonArrivedArgs args);
-
-class PersonArrivedArgs /*: EventArgs*/ {
- public string name;
- public PersonArrivedArgs (string name) {
- this.name = name;
- }
-}
-
-class Greeter {
- string greeting;
-
- public Greeter (string greeting) {
- this.greeting = greeting;
- }
-
- public void HandlePersonArrived (object source, PersonArrivedArgs args) {
- Console.WriteLine(greeting, args.name);
- }
-}
-
-class Room {
- public event PersonArrivedHandler PersonArrived;
-
- public Room () {
- // Assign a value to it, this also used to crash the compiler.
- PersonArrived = null;
- }
-
- public void AddPerson (string name) {
- PersonArrived(this, null); //(this, PersonArrivedArgs(name));
- }
-}
-
-class DelegateTest {
- static int Main () {
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/test-84.cs b/mcs/tests/test-84.cs
deleted file mode 100755
index e6b3d4e3f0d..00000000000
--- a/mcs/tests/test-84.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// This test shows how a variable can be created with the
-// same name as the class, and then the class referenced again
-//
-// This was a bug exposed by Digger, as we incorrectly tried to
-// do some work ahead of time during the resolution process
-// (ie, we created LocalVariableReferences for the int variable `Ghost',
-// which stopped `Ghost' from being useful as a type afterwards
-//
-
-class Ghost {
-
- static int Main ()
- {
- int Ghost = 0;
-
- if (true){
- Ghost g = null;
- }
- return 0;
- }
-}
diff --git a/mcs/tests/test-85.cs b/mcs/tests/test-85.cs
deleted file mode 100755
index a50379568f3..00000000000
--- a/mcs/tests/test-85.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// This test declares a field variable called `UnmanagedType' of type
-// UnmanagedType.
-//
-// The test is used to test the cast of 0 to UnmanagedType, as before
-// that would have been resolved to a variable instead of a type.
-//
-using System.Runtime.InteropServices;
-
-class X {
- static UnmanagedType UnmanagedType;
-
- static int Main ()
- {
- UnmanagedType = (UnmanagedType) 0;
-
- if (UnmanagedType != 0)
- return 1;
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-86.cs b/mcs/tests/test-86.cs
deleted file mode 100644
index faf1ae20a18..00000000000
--- a/mcs/tests/test-86.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-
-namespace T {
- public class T {
-
- static int method1 (Type t, int val)
- {
- Console.WriteLine ("You passed in " + val);
- return 1;
- }
-
- static int method1 (Type t, Type[] types)
- {
- Console.WriteLine ("Wrong method called !");
- return 2;
- }
-
- static int method2 (Type t, int val)
- {
- Console.WriteLine ("MEthod2 : " + val);
- return 3;
- }
-
- static int method2 (Type t, Type [] types)
- {
- Console.WriteLine ("Correct one this time!");
- return 4;
- }
-
- public static int Main()
- {
- int i = method1 (null, 1);
-
- if (i != 1)
- return 1;
-
- i = method2 (null, null);
-
- if (i != 4)
- return 1;
-
- return 0;
- }
- }
-}
diff --git a/mcs/tests/test-87.cs b/mcs/tests/test-87.cs
deleted file mode 100755
index 56c53c9c7ce..00000000000
--- a/mcs/tests/test-87.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Tests the lookup of names on nested classes.
-//
-// Tests nested interfaces
-//
-class Top {
-
- class X {
-
- }
-
- class Y : X {
- }
-
- interface A {
- int get_one ();
- }
-
- interface B : A {
- int get_two ();
- }
-
- class XA : A {
- public int get_one () { return 1; }
- }
-
- class XB : B {
- public int get_one () { return 1; }
- public int get_two () { return 2; }
- }
-
- static int Main ()
- {
- XA x = new XA ();
-
- if (x.get_one () != 1)
- return 1;
-
- XB b = new XB ();
- if (x.get_one () != 1)
- return 2;
- if (b.get_two () != 2)
- return 3;
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-88.cs b/mcs/tests/test-88.cs
deleted file mode 100755
index a45aafe7e5b..00000000000
--- a/mcs/tests/test-88.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-class X {
-
-static void f (string s)
-{
-s. Split ('a');
-}
-
- static int Main ()
- {
- string s = "";
-
- s.Split ('a');
- s.Split ();
- s.Split ('a', 'b', 'c');
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-89.cs b/mcs/tests/test-89.cs
deleted file mode 100755
index 3f1b86ed6b2..00000000000
--- a/mcs/tests/test-89.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-//
-// This test is used to make sure that we correctly create value
-// types in the presence of arrays. Check bug 21801 for a history
-// of the bug
-//
-using System;
-
-struct X {
- int value;
-
- X (int a)
- {
- value = a;
- }
-
- static X F (int a)
- {
- return new X (a);
- }
-
- static int Main ()
- {
- X [] x = { new X (40), F (10) };
-
- if (x [0].value != 40)
- return 1;
-
- if (x [1].value != 10)
- return 2;
-
- Console.WriteLine ("test ok");
- return 0;
- }
-}
diff --git a/mcs/tests/test-9.cs b/mcs/tests/test-9.cs
deleted file mode 100755
index 4fd35e3714b..00000000000
--- a/mcs/tests/test-9.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-class X {
- static public int Main (string [] args)
- {
- decimal a, b, c, d;
-
- a = 0;
- b = 1;
- c = d = 3;
-
- if (b + b + b != c)
- return 1;
-
- if (a != (b - 1))
- return 2;
-
- if (c != d)
- return 3;
-
- if (!(c == d))
- return 4;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-90.cs b/mcs/tests/test-90.cs
deleted file mode 100755
index 8d7c147ec3f..00000000000
--- a/mcs/tests/test-90.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// This test just makes sure that we can compile C.A, there used to be
-// a bug in the compiler that was doing the lookups in the wrong namespace
-//
-//
-namespace N1
-{
- public enum A
- {
- A_1, A_2, A_3
- }
-
- public interface B
- {
- N1.A myProp
- {
- get;
- set; // <-- This always worked.
- }
- }
-
- public interface C
- {
- A myProp
- {
- get;
- set; // <-- This used to fail.
- }
- }
-
- public class Blah {
- static int Main ()
- {
- return 0;
- }
- }
-}
diff --git a/mcs/tests/test-91.cs b/mcs/tests/test-91.cs
deleted file mode 100755
index 11dddc6b45c..00000000000
--- a/mcs/tests/test-91.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Reflection;
-
-class Test {
-
- static protected internal void MyProtectedInternal () { }
- static internal void MyInternal() { }
- static public void MyPublic () { }
- static void MyPrivate () {}
-
- static int Main ()
- {
- Type myself = typeof (Test);
- BindingFlags bf = BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public;
- MethodAttributes mpia;
- MethodInfo mpi;
-
- //
- // protected internal
- //
- mpi = myself.GetMethod ("MyProtectedInternal", bf);
- mpia = mpi.Attributes & MethodAttributes.MemberAccessMask;
- if (mpia != MethodAttributes.FamORAssem)
- return 1;
-
- //
- // internal
- //
- mpi = myself.GetMethod ("MyInternal", bf);
- mpia = mpi.Attributes & MethodAttributes.MemberAccessMask;
- if (mpia != MethodAttributes.Assembly)
- return 2;
-
- //
- // public
- //
- mpi = myself.GetMethod ("MyPublic", bf);
- mpia = mpi.Attributes & MethodAttributes.MemberAccessMask;
- if (mpia != MethodAttributes.Public)
- return 3;
-
- //
- // private
- //
- mpi = myself.GetMethod ("MyPrivate", bf);
- mpia = mpi.Attributes & MethodAttributes.MemberAccessMask;
- if (mpia != MethodAttributes.Private)
- return 4;
-
- Console.WriteLine ("All tests pass");
- return 0;
- }
-}
diff --git a/mcs/tests/test-92.cs b/mcs/tests/test-92.cs
deleted file mode 100755
index 1de5aa71a7d..00000000000
--- a/mcs/tests/test-92.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// This test exposed a bug that Dan found:
-//
-// The InnerBase used to be the `builder' that was passed to InnerBase,
-// so even if InnerBase was a toplevel, it would be defined in the context
-// of being nested. Buggy.
-//
-class Outer {
- class Inner : InnerBase {
- }
-}
-
-abstract class InnerBase {
-}
-
-class MainClass {
- public static int Main () {
- return 0;
- }
-}
diff --git a/mcs/tests/test-93.cs b/mcs/tests/test-93.cs
deleted file mode 100755
index 0ce693979d6..00000000000
--- a/mcs/tests/test-93.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// This tests member lookups on inherited interfaces.
-//
-// The bug was exposed because FindMembers in MemberLookup
-// would not return all the members on interfaces, but only
-// the members from the most close type.
-//
-
-using System;
-using System.Collections;
-
-namespace N1
-{
- interface A
- {
- void method1 ();
- }
-
- interface B:A
- {
- void method2 ();
- }
-
- public class C
- {
- void method (ref B p)
- {
- p.method2();//<- works declared in 'B'
- p.method1();//<- fails declared in 'A'
- }
- }
-}
-
-
-class Test {
- public static int Main () {
- IList list = new ArrayList ();
- int n = list.Count;
-
- return 0;
- }
-}
-
-
-
-
-
diff --git a/mcs/tests/test-94.cs b/mcs/tests/test-94.cs
deleted file mode 100755
index a8c5fea996f..00000000000
--- a/mcs/tests/test-94.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-
-public interface IVehicle {
- int Start ();
- int Stop ();
- int Turn ();
-}
-
-public class Base : IVehicle {
- int IVehicle.Start () { return 1; }
- public int Stop () { return 2; }
- public virtual int Turn () { return 3; }
-}
-
-public class Derived1 : Base {
- // replaces Base.Turn + IVehice.Turn
- public override int Turn () { return 4; }
-}
-
-public class Derived2 : Base, IVehicle {
- // legal - we redeclared IVehicle support
- public new int Stop () { return 6; }
- // legal - we redeclared IVehicle support
- int IVehicle.Start () { return 5; }
- // replaces IVehicle.Turn
- int IVehicle.Turn () { return 7; }
- // replaces Base.Turn
- public override int Turn () { return 8; }
-}
-
-public class Test {
-
- static int Main () {
- Derived1 d1 = new Derived1 ();
- Derived2 d2 = new Derived2 ();
- Base b1 = d1;
- Base b2 = d2;
-
- if (d1.Turn () != 4)
- return 1;
-
- if (((IVehicle)d1).Turn () != 4)
- return 2;
-
- if (((IVehicle)d2).Turn () != 7)
- return 3;
-
- if (b2.Turn () != 8)
- return 4;
-
- if (((IVehicle)b2).Turn () != 7)
- return 5;
-
- //Console.WriteLine ("TEST {0}", ((IVehicle)b2).Turn ());
-
- return 0;
- }
-}
-
diff --git a/mcs/tests/test-95.cs b/mcs/tests/test-95.cs
deleted file mode 100755
index 69f3684a43b..00000000000
--- a/mcs/tests/test-95.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-class X {
-
- double d = 0;
-
- void X ()
- {
- }
-
- static int Main ()
- {
- X x = new X ();
-
- if (x.d != 0)
- return 1;
-
- return 0;
- }
-}
diff --git a/mcs/tests/test-96.cs b/mcs/tests/test-96.cs
deleted file mode 100755
index 718a95f1749..00000000000
--- a/mcs/tests/test-96.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Compilation test
-//
-// This used to be a bug in the name lookups in delegate declarations
-//
-namespace N1
-{
- public class A
- {
- static int Main ()
- {
- return 0;
- }
- }
-
- //
- // A used to not be resolved
- //
- public delegate void C(object sender, A a);
-}
diff --git a/mcs/tests/test-97.cs b/mcs/tests/test-97.cs
deleted file mode 100755
index 612185cf1aa..00000000000
--- a/mcs/tests/test-97.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// This test excercises the simple name lookups on
-// unfinished enumerations.
-//
-
-public enum FL {
- EMPTY = 0,
- USHIFT = 11,
- USER0 = (1<<(USHIFT+0)),
-}
-
-class X {
-
- static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-98.cs b/mcs/tests/test-98.cs
deleted file mode 100755
index 17842abe407..00000000000
--- a/mcs/tests/test-98.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-class X {
- int a;
- Y x;
-
- void b ()
- {
- if (x.a == 1)
- return;
- }
-}
-
-class Y : X {
-
- public static int Main ()
- {
- return 0;
- }
-}
diff --git a/mcs/tests/test-99.cs b/mcs/tests/test-99.cs
deleted file mode 100755
index 385330dfa55..00000000000
--- a/mcs/tests/test-99.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-class X {
- enum A : int {
- a = 1, b, c
- }
-
- static int Main ()
- {
- int v = 1;
- object foo = (v + A.a);
- object foo2 = (1 + A.a);
-
- if (foo.GetType ().ToString () != "X+A"){
- Console.WriteLine ("Expression evaluator bug in E operator + (U x, E y)");
- return 1;
- }
-
- if (foo2.GetType ().ToString () != "X+A"){
- Console.WriteLine ("Constant folder bug in E operator + (U x, E y)");
- return 2;
- }
-
- return 0;
- }
-}
diff --git a/mcs/tests/try.cs b/mcs/tests/try.cs
deleted file mode 100755
index 5bc1d408d0c..00000000000
--- a/mcs/tests/try.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-class t {
-
- void a ()
- {
- int b;
-
- try {
- b = 1;
- } catch {
- b = 2;
- }
- }
-
- void b ()
- {
- int a;
-
- try {
- a = 1;
- } catch (Exception) {
- a = 2;
- }
- }
-
- void c ()
- {
- int a;
-
- try {
- a = 2;
- } catch (Exception e) {
- a = 0x3;
- } catch {
- a = 0x1;
- }
- }
-
- void d ()
- {
- int a;
-
- try {
- a = 2;
- } catch (Exception e) {
- a = 0x3;
- } catch {
- a = 0x1;
- } finally {
- a = 111;
- }
- }
-}
-
diff --git a/mcs/tests/unsafe-1.cs b/mcs/tests/unsafe-1.cs
deleted file mode 100755
index b49bc0fe277..00000000000
--- a/mcs/tests/unsafe-1.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// Tests unsafe operators. address-of, dereference, member access
-//
-using System;
-
-unsafe struct Y {
- public int a;
- public int s;
-}
-
-unsafe class X {
- static int TestDereference ()
- {
- Y y;
- Y *z;
- Y a;
-
- z = &y;
- y.a = 1;
- y.s = 2;
-
- a.a = z->a;
- a.s = z->s;
-
- if (a.a != y.a)
- return 1;
- if (a.s != y.s)
- return 2;
-
- return 0;
- }
-
- static int TestPtrAdd ()
- {
- int [] a = new int [10];
- int i;
-
- for (i = 0; i < 10; i++)
- a [i] = i;
-
- i = 0;
- fixed (int *b = &a [0]){
- int *p = b;
-
- for (i = 0; i < 10; i++){
- if (*p != a [i])
- return 10+i;
- p++;
- }
- }
- return 0;
- }
-
- static int i = 1;
- static char c = 'a';
- static long l = 123;
- static double d = 1.2;
- static float f = 1.3F;
- static short s = 4;
-
- static int TestPtrAssign ()
- {
-
- fixed (int *ii = &i){
- *ii = 10;
- }
-
- fixed (char *cc = &c){
- *cc = 'b';
- }
-
- fixed (long *ll = &l){
- *ll = 100;
- }
-
- fixed (double *dd = &d){
- *dd = 3.0;
- }
-
- fixed (float *ff = &f){
- *ff = 1.2F;
- }
-
- fixed (short *ss = &s){
- *ss = 102;
- }
-
- if (i != 10)
- return 100;
- if (c != 'b')
- return 101;
- if (l != 100)
- return 102;
- if (d != 3.0)
- return 103;
- if (f != 1.2F)
- return 104;
- if (s != 102)
- return 105;
- return 0;
- }
-
- static int TestPtrArithmetic ()
- {
- char [] array = new char [10];
- char *pb;
-
- array [5] = 'j';
- fixed (char *pa = array){
- pb = pa + 1;
-
-
- //
- // This one tests pointer element access
- //
- if (pa [5] != 'j')
- return 199;
-
- Console.WriteLine ("V: " + (pb - pa));
- if ((pb - pa) != 1)
- return 200;
-
- pb++;
-
- if (pb == pa)
- return 201;
- if (pb < pa)
- return 202;
- if (pa > pb)
- return 203;
- if (pa >= pb)
- return 204;
- if (pb <= pa)
- return 205;
- pb = pb - 2;
- if (pb != pa){
- Console.WriteLine ("VV: " + (pb - pa));
- return 206;
- }
- }
-
- return 0;
- }
-
- static int Main ()
- {
- int v;
-
- if ((v = TestDereference ()) != 0)
- return v;
-
- if ((v = TestPtrAdd ()) != 0)
- return v;
-
- if ((v = TestPtrAssign ()) != 0)
- return v;
-
- if ((v = TestPtrArithmetic ()) != 0)
- return v;
- Console.WriteLine ("Ok");
- return 0;
- }
-}
diff --git a/mcs/tests/unsafe-2.cs b/mcs/tests/unsafe-2.cs
deleted file mode 100755
index adedee29633..00000000000
--- a/mcs/tests/unsafe-2.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// This test excercises stackalloc, some pointer arithmetic,
-// and dereferences
-//
-using System;
-unsafe class X {
- static int Main ()
- {
- char *ptr = stackalloc char [10];
- int i;
-
- for (i = 0; i < 10; i++)
- ptr [i] = (char) (i + 10);
-
- for (i = 0; i < 10; i++){
- if (*ptr != (char) (i + 10))
- return 200 + i;
- ptr++;
- }
- Console.WriteLine ("Ok");
- return 0;
- }
-}
-
-
diff --git a/mcs/tests/unsafe-3.cs b/mcs/tests/unsafe-3.cs
deleted file mode 100644
index 371b5bcdac2..00000000000
--- a/mcs/tests/unsafe-3.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// this tests making a pointer to a pointer
-
-using System;
-
-unsafe class Foo
-{
- public static int Main ()
- {
- int a;
- int *b;
- int **c;
-
- a = 42;
- b = &a;
- c = &b;
-
- Console.WriteLine ("*c == b : {0}", *c == b);
- Console.WriteLine ("**c == a : {0}", **c == a);
-
- if (*c == b && **c == a)
- {
- Console.WriteLine ("Test passed");
- return 0;
- }
- else
- {
- Console.WriteLine ("Test failed");
- return 1;
- }
- }
-}
diff --git a/mcs/tests/unsafe-4.cs b/mcs/tests/unsafe-4.cs
deleted file mode 100755
index 730bb4915a1..00000000000
--- a/mcs/tests/unsafe-4.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-unsafe class X {
- static int v;
- static int v_calls;
-
- static int* get_v ()
- {
- v_calls++;
- return &v;
- }
-
- static int Main ()
- {
- if ((*get_v ())++ != 0)
- return 1;
- if (v != 1)
- return 2;
- if (v_calls != 1)
- return 3;
- return 0;
- }
-}
diff --git a/mcs/tools/.cvsignore b/mcs/tools/.cvsignore
deleted file mode 100644
index 7d47302f00a..00000000000
--- a/mcs/tools/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.pdb
-*.exe
-*.dll
-cormissing.xml
diff --git a/mcs/tools/ChangeLog b/mcs/tools/ChangeLog
deleted file mode 100644
index da21df1c32e..00000000000
--- a/mcs/tools/ChangeLog
+++ /dev/null
@@ -1,124 +0,0 @@
-2002-03-09 Martin Baulig <martin@gnome.org>
-
- * DumpCultureInfo.cs: New tool to dump culture info. Incomplete,
- we need to get unicode support working before we can use this.
-
-2002-03-05 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * GenerateDelegate.cs: Generates delegates (EventHandler) as
- specified. The output is quite simple, a delegate that has
- the prototype as -->
- public delegate void <given-name>EventHandler(object sender,
- <given-name>EventArgs e)
-
-2002-03-01 Martin Baulig <martin@gnome.org>
-
- * scan-tests.pl: Catch exceptions when running the tests so that we
- always run all the tests in a test suite even if some of them fail.
-
-2002-02-27 Martin Baulig <martin@gnome.org>
-
- * scan-tests.pl: Moved this script here from ../class/corlib/Test.
-
-2002-02-22 Nick Drochak <ndrochak@gol.com>
-
- * makefile: move corcompare to it's own directory to hold multiple
- class files. still makes old corcompare for now. will remove that
- soon.
-
-2002-02-18 Duncan Mak <duncan@ximian.com>
-
- * serialize.cs: When appropriate, changed Type.GetType calls to
- the faster typeof operator.
-
-2002-02-19 Nick Drochak <ndrochak@gol.com>
-
- * corcompare.cs: Reorganized into collaberating classes to analyze
- and generate reports. Still needs to find the MonoTODO's, and
- has a little more prototype code in there, but it's almost done.
-
- * makefile: output XML file in the tools directory for now.
-
-2002-02-15 Nick Drochak <ndrochak@gol.com>
-
- * corcompare.cs: Adding stuff to collect all the missing and todo
- information need to generate nice looking HTML pages. Not quite
- done and needs some re-org, but Duncan can take a look.
-
- * sample.xml: an example of how the XML will look that corcompare
- will generate. Can be used to start working on the XSLT.
-
-2002-02-13 Nick Drochak <ndrochak@gol.com>
-
- * makefile: 'clean' target now removes file generated by CorCompare
-
-2002-02-03 Duncan Mak <duncan@ximian.com>
-
- * serialize.cs: Added namespace block.
-
-2002-02-01 Duncan Mak <duncan@ximian.com>
-
- * serialize.cs: Added a new tool for serializing objects. It
- can create new types dynamically, but can only handle
- arguments that are of primitive types.
-
-2002-01-26 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * EnumCheckAssemblyCollection.cs,
- * assemblies.xml: Files related to EnumCheck checked-in. Now EnumCheck does
- not have any path hardcoded. It takes the assemblies to
- search from a xml files, which by default is assemblies.xml
-
-2002-01-25 Nick Drochak <ndrochak@gol.com>
-
- * .cvsignore: ignore .dll files now since we build NUnitCore.dll ourselves
-
-2002-01-18 Duncan Mak <duncan@ximian.com>
-
- * EnumCheck.cs: A checkin for Miguel to make EnumCheck not hardcode
- path to corlib.dll.
-
-2002-01-19 Nick Drochak <ndrochak@gol.com>
-
- * makefile: corcompare works again now, so make xml of missing types
- * CorCompare.cs: use exception that .NET v1 throws to get types in mono corlib
-
-2002-01-18 Nick Drochak <ndrochak@gol.com>
-
- * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
- don't generate xml from corcompare for now. it throws an error on v1.0 of .NET
-
-2002-01-17 Nick Drochak <ndrochak@gol.com>
-
- * IFaceDisco.cs, XMLUtil.cs: Added new files for interface discovery tool.
- * makefile: added target for IFaceDisco.exe and added to clean target for same
-
-2002-01-08 John Barnette <jbarn@httcb.net>
-
- * Removed todo.cs and related makefile data.
-
-
-
-2002-01-07 John Barnette <jbarn@httcb.net>
-
-
-
- * makefile: added todo target, fixed EnumCheck target, simplified clean
-
-
- * todo.cs: new file. generates todo list XML and compares assemblies
-
-
-
-2002-01-07 Gaurav Vaish <gvaish@iitk.ac.in>
-
- * EnumCheck.cs: Get the numerical values of an enumeration.
-
-2002-01-06 Nick Drochak <ndrochak@gol.com>
-
- * corcompare.cs: Catch the FileNotFoundException and handle it nicely.
-
-2002-01-05 Nick Drochak <ndrochak@gol.com>
-
- * makefile: build corcompare
- * corcompare.cs: add new file. compares an assembly with mscorlib
diff --git a/mcs/tools/DumpCultureInfo.cs b/mcs/tools/DumpCultureInfo.cs
deleted file mode 100755
index a3c93fafa03..00000000000
--- a/mcs/tools/DumpCultureInfo.cs
+++ /dev/null
@@ -1,176 +0,0 @@
-using System;
-using System.Threading;
-using System.Globalization;
-
-namespace Mono.Tools {
-
- public class DumpCultureInfo {
-
- internal static string ToUnicode (string input)
- {
- string output = "";
- for (int i = 0; i < input.Length; i++) {
- int chr = input [i];
- output += "\\x" + chr.ToString ("x4");
- }
-
- return output;
- }
-
- public static void DumpNumberFormatInfo (CultureInfo culture)
- {
- NumberFormatInfo nfi = culture.NumberFormat;
-
- string currency_group_sizes = "";
- {
- int[] group_sizes = nfi.CurrencyGroupSizes;
-
- currency_group_sizes = "new int[" + group_sizes.Length + "] { ";
- for (int i = 0; i < group_sizes.Length; i++) {
- if (i > 0) currency_group_sizes += ", ";
- currency_group_sizes += group_sizes[i] + " ";
- }
- currency_group_sizes += "}";
- }
-
- string number_group_sizes = "";
- {
- int[] group_sizes = nfi.NumberGroupSizes;
-
- number_group_sizes = "new int[" + group_sizes.Length + "] { ";
- for (int i = 0; i < group_sizes.Length; i++) {
- if (i > 0) number_group_sizes += ", ";
- number_group_sizes += group_sizes[i] + " ";
- }
- number_group_sizes += "}";
- }
-
- string percent_group_sizes = "";
- {
- int[] group_sizes = nfi.PercentGroupSizes;
-
- percent_group_sizes = "new int[" + group_sizes.Length + "] { ";
- for (int i = 0; i < group_sizes.Length; i++) {
- if (i > 0) percent_group_sizes += ", ";
- percent_group_sizes += group_sizes[i] + " ";
- }
- percent_group_sizes += "}";
- }
-
-
- Object[] data = { "\t\t\t\t",
- nfi.CurrencyDecimalDigits,
- ToUnicode (nfi.CurrencyDecimalSeparator),
- ToUnicode (nfi.CurrencyGroupSeparator),
- currency_group_sizes,
- nfi.CurrencyNegativePattern,
- nfi.CurrencyPositivePattern,
- ToUnicode (nfi.CurrencySymbol),
- ToUnicode (nfi.NaNSymbol),
- ToUnicode (nfi.NegativeInfinitySymbol),
- ToUnicode (nfi.NegativeSign),
- nfi.NumberDecimalDigits,
- ToUnicode (nfi.NumberDecimalSeparator),
- ToUnicode (nfi.NumberGroupSeparator),
- number_group_sizes,
- nfi.NumberNegativePattern,
- nfi.PercentDecimalDigits,
- ToUnicode (nfi.PercentDecimalSeparator),
- ToUnicode (nfi.PercentGroupSeparator),
- percent_group_sizes,
- nfi.PercentNegativePattern,
- nfi.PercentPositivePattern,
- ToUnicode (nfi.PercentSymbol),
- ToUnicode (nfi.PerMilleSymbol),
- ToUnicode (nfi.PositiveInfinitySymbol),
- ToUnicode (nfi.PositiveSign)
- };
-
- string format = "{0}currencyDecimalDigits\t\t= {1};\n"
- + "{0}currencyDecimalSeparator\t= \"{2}\";\n"
- + "{0}currencyGroupSeparator\t\t= \"{3}\";\n"
- + "{0}currencyGroupSizes\t\t= {4};\n"
- + "{0}currencyNegativePattern\t\t= {5};\n"
- + "{0}currencyPositivePattern\t\t= {6};\n"
- + "{0}currencySymbol\t\t\t= \"{7}\";\n\n"
- + "{0}naNSymbol\t\t\t= \"{8}\";\n"
- + "{0}negativeInfinitySymbol\t\t= \"{9}\";\n"
- + "{0}negativeSign\t\t\t= \"{10}\";\n\n"
- + "{0}numberDecimalDigits\t\t= {11};\n"
- + "{0}numberDecimalSeparator\t\t= \"{12}\";\n"
- + "{0}numberGroupSeparator\t\t= \"{13}\";\n"
- + "{0}numberGroupSizes\t\t= {14};\n"
- + "{0}numberNegativePattern\t\t= {15};\n"
- + "{0}percentDecimalDigits\t\t= {16};\n"
- + "{0}percentDecimalSeparator\t\t= \"{17}\";\n"
- + "{0}percentGroupSeparator\t\t= \"{18}\";\n"
- + "{0}percentGroupSizes\t\t= {19};\n"
- + "{0}percentNegativePattern\t\t= {20};\n"
- + "{0}percentPositivePattern\t\t= {21};\n"
- + "{0}percentSymbol\t\t\t= \"{22}\";\n\n"
- + "{0}perMilleSymbol\t\t\t= \"{23}\";\n"
- + "{0}positiveInfinitySymbol\t\t= \"{24}\";\n"
- + "{0}positiveSign\t\t\t= \"{25}\";\n";
-
- string output = String.Format (format, data);
-
- Object[] data2 = { "\t\t\t\t", "\t\t\t", culture.EnglishName,
- culture.LCID.ToString ("x4"), output };
-
- string format2 = "{0}// {2}\n{1}case 0x{3}:\n{0}readOnly = false;\n\n"
- + "{4}\n{0}break;\n\n";
-
- Console.WriteLine (String.Format (format2, data2));
- }
-
- public static int[] AllCultures = {
- 0x007F, 0x0001, 0x0401, 0x0801, 0x0C01, 0x1001, 0x1401, 0x1801,
- 0x1C01, 0x2001, 0x2401, 0x2801, 0x2C01, 0x3001, 0x3401, 0x3801,
- 0x3C01, 0x4001, 0x0002, 0x0402, 0x0003, 0x0403, 0x0004, 0x0404,
- 0x0804, 0x0C04, 0x1004, 0x1404, 0x7C04, 0x0005, 0x0405, 0x0006,
- 0x0406, 0x0007, 0x0407, 0x0807, 0x0C07, 0x1007, 0x1407, 0x0008,
- 0x0408, 0x0009, 0x0409, 0x0809, 0x0C09, 0x1009, 0x1409, 0x1809,
- 0x1C09, 0x2009, 0x2409, 0x2809, 0x2C09, 0x3009, 0x3409, 0x000A,
- 0x080A, 0x0C0A, 0x100A, 0x140A, 0x180A, 0x1C0A, 0x200A, 0x240A,
- 0x280A, 0x2C0A, 0x300A, 0x340A, 0x380A, 0x3C0A, 0x400A, 0x440A,
- 0x480A, 0x4C0A, 0x500A, 0x000B, 0x040B, 0x000C, 0x040C, 0x080C,
- 0x0C0C, 0x100C, 0x140C, 0x180C, 0x000D, 0x040D, 0x000E, 0x040E,
- 0x000F, 0x040F, 0x0010, 0x0410, 0x0810, 0x0011, 0x0411, 0x0012,
- 0x0412, 0x0013, 0x0413, 0x0813, 0x0014, 0x0414, 0x0814, 0x0015,
- 0x0415, 0x0016, 0x0416, 0x0816, 0x0018, 0x0418, 0x0019, 0x0419,
- 0x001A, 0x041A, 0x081A, 0x0C1A, 0x001B, 0x041B, 0x001C, 0x041C,
- 0x001D, 0x041D, 0x081D, 0x001E, 0x041E, 0x001F, 0x041F, 0x0020,
- 0x0420, 0x0021, 0x0421, 0x0022, 0x0422, 0x0023, 0x0423, 0x0024,
- 0x0424, 0x0025, 0x0425, 0x0026, 0x0426, 0x0027, 0x0427, 0x0029,
- 0x0429, 0x002A, 0x042A, 0x002B, 0x042B, 0x002C, 0x042C, 0x082C,
- 0x002D, 0x042D, 0x002F, 0x042F, 0x0036, 0x0436, 0x0037, 0x0437,
- 0x0038, 0x0438, 0x0039, 0x0439, 0x003E, 0x043E, 0x083E, 0x003F,
- 0x043F, 0x0040, 0x0440, 0x0041, 0x0441, 0x0043, 0x0443, 0x0843,
- 0x0044, 0x0444, 0x0046, 0x0446, 0x0047, 0x0447, 0x0049, 0x0449,
- 0x004A, 0x044A, 0x004B, 0x044B, 0x004E, 0x044E, 0x004F, 0x044F,
- 0x0050, 0x0450, 0x0056, 0x0456, 0x0057, 0x0457, 0x005A, 0x045A,
- 0x0065, 0x0465
- };
-
- public static int[] Cultures = {
- // Invariant culture
- 0x007f,
- // English
- 0x0409, 0x0809, 0x0c09, 0x1009,
- // German
- 0x0407, 0x0807, 0x0c07, 0x1007, 0x1407
- };
-
- public static void Main ()
- {
- for (int i = 0; i < AllCultures.Length; i++) {
- CultureInfo culture = new CultureInfo (AllCultures [i], false);
-
- if (culture.IsNeutralCulture)
- continue;
-
- DumpNumberFormatInfo (culture);
- }
- }
- }
-}
diff --git a/mcs/tools/EnumCheck.cs b/mcs/tools/EnumCheck.cs
deleted file mode 100644
index 8c564cc7956..00000000000
--- a/mcs/tools/EnumCheck.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: EnumCheck
- *
- * Author: Gaurav Vaish
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.Xml;
-using System.Collections;
-using System.Reflection;
-
-namespace Mono.Enumerations
-{
- public class EnumCheck
- {
- private string className;
- private Type type;
- private EnumCheckAssemblyCollection ecac = new EnumCheckAssemblyCollection();
-
- public static string confFile = "assemblies.xml";
-
- public EnumCheck(string className)
- {
- this.className = className;
- ecac.Parse();
- }
-
- public void Display()
- {
- ecac.ConfigFile = confFile;
- LoadType();
- if(type == null || !type.IsEnum)
- {
- System.Console.Write("-->Failed to load the enumeration: " + className);
- return;
- }
- Array ar = Enum.GetValues(type);
- System.Console.WriteLine("-->Enumeration: {0}", type.ToString());
- for(int i=0; i < ar.Length; i++)
- {
- Enum b = (Enum)ar.GetValue(i);
- System.Console.Write(" {0}", Enum.Format(type, b, "G"));
- System.Console.WriteLine(" ({0}) ", Enum.Format(type, b, "D"));
- }
- }
-
- private void LoadType()
- {
- type = null;
- foreach(string url in ecac)
- {
- try
- {
- Assembly assembly = Assembly.LoadFrom(url);
- foreach(Type t in assembly.GetTypes())
- {
- if(!t.IsEnum)
- continue;
- if(className == t.ToString())
- {
- type = t;
- break;
- }
- }
- } catch(BadImageFormatException)
- {
- } catch(ReflectionTypeLoadException)
- {
- } catch(ArgumentException)
- {
- }
- if(type != null)
- return;
- }
- }
-
- public static void PrintUsage()
- {
- System.Console.WriteLine("Usage:");
- System.Console.WriteLine("EnumCheck [<enum> [<enum> [... ] ] ]");
- System.Console.WriteLine("");
- System.Console.WriteLine("enum := <namespace>[.<subnamespace>[...]].enum_name");
- System.Console.WriteLine("");
- }
-
- public static void Main(string[] args)
- {
- if(args.Length > 0 && (args[0] == "--help" || args[0] == "-h"))
- {
- PrintUsage();
- return;
- }
- EnumCheck check = null;
- string bdir;
- System.Console.Write("Enter assembly configuration file [{0}]:", confFile);
- //System.Console.Write("[{0}]: ", confFile);
- bdir = System.Console.ReadLine();
- while(bdir.EndsWith("/") || bdir.EndsWith("\\"))
- {
- bdir = bdir.Substring(0, bdir.Length - 1);
- }
- if(bdir != "")
- {
- confFile = bdir;
- }
- if(args.Length != 0)
- {
- foreach(string clName in args)
- {
- check = new EnumCheck(clName);
- check.Display();
- System.Console.WriteLine("\n");
- }
- }
- while(true)
- {
- System.Console.Write("Enter the name of the Enumeration (end to stop): ");
- string clName = System.Console.ReadLine();
- if(clName == "stop" || clName == "end" || clName.Length == 0)
- break;
- check = new EnumCheck(clName);
- check.Display();
- System.Console.WriteLine("\n");
- }
- }
- }
-}
diff --git a/mcs/tools/EnumCheckAssemblyCollection.cs b/mcs/tools/EnumCheckAssemblyCollection.cs
deleted file mode 100644
index 470492c25b5..00000000000
--- a/mcs/tools/EnumCheckAssemblyCollection.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Namespace: System.Web
- * Class: EnumCheckAssembly
- *
- * Author: Gaurav Vaish
- * Contact: <gvaish@iitk.ac.in>
- * Status: 100%
- *
- * (C) Gaurav Vaish (2002)
- */
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Collections;
-using System.Reflection;
-
-namespace Mono.Enumerations
-{
- public class EnumCheckAssemblyCollection: IEnumerable
- {
- public string ConfigFile = "assemblies.xml";
-
- private ArrayList assemblyList = new ArrayList();
-
- public EnumCheckAssemblyCollection()
- {
- }
-
- public void Parse()
- {
- Stream fStream;
- XmlReader reader;
- XmlDocument document;
- string url;
-
- fStream = new FileStream(ConfigFile, FileMode.Open, FileAccess.Read, FileShare.Read);
- reader = new XmlTextReader(fStream);
- document = new XmlDocument();
- document.Load(reader);
- if(document.DocumentElement != null)
- {
- if(document.DocumentElement.LocalName == "assemblies")
- {
- foreach(XmlNode pathNode in document.DocumentElement)
- {
- if(pathNode.NodeType == XmlNodeType.Element && pathNode.LocalName=="path")
- {
- url = pathNode.Attributes["url"].Value;
- while(url.EndsWith("\\") || url.EndsWith("/"))
- {
- url = url.Substring(0, url.Length - 1);
- }
- if(url == null || url.Length == 0)
- {
- continue;
- }
- foreach(XmlNode assemblyNode in pathNode.ChildNodes)
- {
- if(assemblyNode.LocalName == "assembly")
- {
- assemblyList.Add(url + "\\" + assemblyNode.Attributes["file"].Value);
- }
- }
- }
- }
- }
- }
- fStream.Close();
- }
-
- public IEnumerator GetEnumerator()
- {
- return assemblyList.GetEnumerator();
- }
- }
-}
diff --git a/mcs/tools/GenerateDelegate.cs b/mcs/tools/GenerateDelegate.cs
deleted file mode 100644
index 0ba8e78c0a0..00000000000
--- a/mcs/tools/GenerateDelegate.cs
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * Namespace: com.mastergaurav.utils
- * Class: GenerateDelegate
- *
- * Author: Gaurav Vaish
- * Maintainer: gvaish@iitk.ac.in
- * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
- * Implementation: yes
- * Status: 100%
- *
- * (C) Gaurav Vaish (2001)
- */
-
-using System;
-using System.IO;
-
-namespace com.mastergaurav.Utils
-{
- public class GenerateDelegate
- {
- public static string TargetDirectory = String.Empty;
- public static string NamespaceName = String.Empty;
-
- public static readonly string PROLOGUE = "/**\n * Namespace: ";
- public static readonly string DETAILS = " *\n * Author: Gaurav Vaish\n" +
- " * Maintainer: gvaish@iitk.ac.in\n" +
- " * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>\n" +
- " * Implementation: yes\n" +
- " * Status: 100%\n" +
- " *\n" +
- " * (C) Gaurav Vaish (2002)\n" +
- " */\n\n";
- public static readonly string USING = "using System;\n" +
- "using System.Web;\n" +
- "using System.Web.UI;\n\n";
-
- public static readonly string NAMESPACE = "namespace ";
-
- public static string AskForNamespace()
- {
- string nm = String.Empty;
- System.Console.Write("Enter the name of the namespace: ");
- nm = System.Console.ReadLine();
- return nm;
- }
-
- public static string AskForMore()
- {
- string del = String.Empty;
- System.Console.Write("Enter the name of the delegate (end to stop): ");
- del = System.Console.ReadLine();
- if(del == String.Empty || del == "end")
- return String.Empty;
- return del;
- }
-
- public static void Generate(string delName)
- {
- string fileName = TargetDirectory + "\\" + delName + "EventHandler.cs";
- System.Console.Write("File: ");//, fileName);
- System.Console.Write(fileName);
- System.Console.Write("\tGenerating");
-
- StreamWriter writer;
- try
- {
- Stream stream = new FileStream(fileName, FileMode.Truncate, FileAccess.Write);
- writer = new StreamWriter(stream);
- } catch(FileNotFoundException)
- {
- writer = File.CreateText(fileName);
- }
- if(writer == null)
- {
- System.Console.WriteLine("Null writer...\n");
- return;
- }
- writer.Write(PROLOGUE);
- writer.Write(NamespaceName + "\n");
- writer.Write(DETAILS);
- writer.Write(NAMESPACE);
- writer.Write(NamespaceName + "\n");
- writer.Write("{\n");
- writer.Write("\tpublic delegate void ");
- writer.Write(delName);
- writer.Write("EventHandler(object sender, ");
- writer.Write(delName);
- writer.Write("EventArgs e);\n");
- writer.Write("}");
-
- writer.Flush();
- writer.Close();
-
- System.Console.WriteLine("\tGenerated\n");
- }
-
- public static string GetTargetDir()
- {
- System.Console.Write("Enter target directory: ");
- return System.Console.ReadLine();
- }
-
- public static void Usage(bool wrong)
- {
- if(wrong)
- {
- System.Console.WriteLine("Wrong # arguments.");
- }
- System.Console.WriteLine("Usage: GenerateDelegate [target-dir] [namespace] [delegate1 [delegate2 [...]]]");
- }
-
- public static bool IsHelp(string arg)
- {
- return (arg == "-h" || arg == "--help");
- }
-
- public static bool IsDirectory(string dirName)
- {
- FileAttributes attrs;
- try
- {
- attrs = File.GetAttributes(dirName);
- if( (attrs & FileAttributes.Directory) != FileAttributes.Directory)
- {
- Usage(true);
- return false;
- }
- }catch(Exception e)
- {
- System.Console.WriteLine("Exception: {0}", e.ToString());
- return false;
- }
- return true;
- }
-
- public static void Main(string[] args)
- {
- if(args.Length == 1 && IsHelp(args[0]))
- {
- Usage(false);
- return;
- }
-
- if(args.Length == 0)
- {
- TargetDirectory = GetTargetDir();
- while(TargetDirectory.EndsWith("\\"))
- {
- TargetDirectory = TargetDirectory.Substring(0, TargetDirectory.Length - 1);
- }
- } else
- {
- while(args[0].EndsWith("\\"))
- {
- args[0] = args[0].Substring(0, args[0].Length - 1);
- }
- TargetDirectory = args[0];
- }
-
- if(!IsDirectory(TargetDirectory))
- return;
-
- if(args.Length > 1)
- {
- NamespaceName = args[1];
- } else
- {
- NamespaceName = AskForNamespace();
- }
-
- if(args.Length > 2)
- {
- int i=0;
- foreach(string currArg in args)
- {
- if(i != 0)
- {
- Generate(currArg);
- }
- i++;
- }
- }
- string delegateName = String.Empty;
- while((delegateName = AskForMore()) != String.Empty)
- {
- Generate(delegateName);
- }
- }
- }
-}
diff --git a/mcs/tools/IFaceDisco.cs b/mcs/tools/IFaceDisco.cs
deleted file mode 100644
index 0f8a06225e9..00000000000
--- a/mcs/tools/IFaceDisco.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-// IFaceDisco.cs
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.IO;
-
-namespace Mono.Util
-{
- class IFaceDisco {
- public static void Main(string[] args) {
- Assembly asm;
- Type[] asmTypes;
- InterfaceMapping map;
- Type[] interfaces;
- ArrayList TypesList = new ArrayList();
- ArrayList implementingTypes = new ArrayList();
- string asmFullPath = null;
- string ifaceToDiscover = null;
-
- if (args.Length < 1 || args.Length > 3) {
- Usage();
- return;
- }
-
- for (int i = 0; i < args.Length; i++) {
- string arg = args[i];
-
- if (arg.StartsWith("-") && ((i + 1) < args.Length)) {
- if (arg == "--asm") {
- asmFullPath = args[++i];
- } else {
- Usage();
- return;
- }
- } else {
- // allow only one interface to discover
- if (ifaceToDiscover != null){
- Usage();
- return;
- }
- ifaceToDiscover = arg;
- }
- }
-
- // find the assembly
- if (null == asmFullPath){
- asm = Assembly.GetAssembly(typeof (System.Object));
- }
- else {
- try{
- asm = Assembly.LoadFrom(asmFullPath);
- }
- catch(Exception e){
- Console.WriteLine("Could not open assembly '{0}' for discovery. Error is: "+e.Message, asmFullPath);
- return;
- }
- }
- asmTypes = asm.GetTypes();
-
- // examine all the public types
- foreach(Type t in asmTypes) {
- if (t.IsPublic) {
- // find out which, if any, interfaces are "in" the type
- interfaces= t.GetInterfaces();
- if (null != interfaces){
- // look for the interface we want to discover
- foreach (Type iface in interfaces) {
- // this area seems to throw an exception sometimes, just ignore it
- try{
- if (iface.FullName.ToLower() == args[0].ToLower()) {
- // find out if this type is the one which "declares" the interface
- map = t.GetInterfaceMap(iface);
- if (map.TargetMethods[0].DeclaringType.FullName == t.FullName){
- // if so, then we found a class to report
- implementingTypes.Add(t.FullName);
- } // if
- } // if
- }catch{}
- } // foreach
- } // if
- } // if
- } // foreach
-
- // sort the list to make it easier to find what you are looking for
- implementingTypes.Sort();
- Console.WriteLine(XMLUtil.ToXML(implementingTypes, "Type", "ImplementingTypes"));
- } // Main()
-
- private static void Usage() {
- Console.WriteLine (
- "Mono Interface Discovery Tool\n" +
- "usage: ifacedisco [--asm assembly] interface\n\n" +
- " The full path to 'assembly' should be specified when using --asm.\n" +
- " If 'assembly' is not specified, the assembly that contains System.Object will be used.\n" +
- " Use the fully qualified form for 'interface', e.g. System.Runtime.Serialization.ISerializable\n"
- );
- } // Usage()
-
- } // class IFaceDisco
-} // namespace Mono.Util
diff --git a/mcs/tools/SqlSharp/SqlSharpCli.cs b/mcs/tools/SqlSharp/SqlSharpCli.cs
deleted file mode 100644
index c29cb730847..00000000000
--- a/mcs/tools/SqlSharp/SqlSharpCli.cs
+++ /dev/null
@@ -1,624 +0,0 @@
-//
-// SqlSharpCli.cs - main driver for SqlSharp
-//
-// Currently, only working on a command line interface for SqlSharp
-//
-// However, once GTK# and System.Windows.Forms are good-to-go,
-// I would like to create a SqlSharpGui using this.
-//
-// It would be nice if this is included as part of Mono
-// extra goodies under Mono.Data.SqlSharp.
-//
-// Also, this makes a good Test program for Mono System.Data.
-// For more information about Mono::,
-// visit http://www.go-mono.com/
-//
-// To build SqlSharpCli.cs:
-// $ mcs SqlSharpCli.cs -r System.Data.dll -r Mono.Data.MySql.dll
-//
-// To run with mono:
-// $ mono SqlSharpCli.exe
-//
-// To run with mint:
-// $ mint SqlSharpCli.exe
-//
-// To run batch commands and get the output, do something like:
-// $ cat commands.txt | mono SqlSharpCli.exe > results.txt
-//
-// Author:
-// Daniel Morgan <danmorg@sc.rr.com>
-//
-// (C)Copyright 2002 Daniel Morgan
-//
-
-using Mono.Data.MySql;
-using System;
-using System.Data;
-using System.Data.Common;
-using System.Data.SqlClient;
-using System.IO;
-using System.Text;
-
-namespace Mono.Data.SqlSharp {
-
- // SQL Sharp - Command Line Interface
- public class SqlSharpCli {
-
- private IDbConnection conn = null;
- private string provider = "POSTGRESCLIENT";
- private StringBuilder build = null; // SQL string to build
- private string connectionString =
- "host=localhost;dbname=test;user=postgres";
- private string inputFilename = "";
- private string outputFilename = "";
- private bool silent = false;
-
- // DisplayResult - used to Read() display a result set
- // called by DisplayData()
- public void DisplayResult(IDataReader reader, DataTable schemaTable) {
-
- StringBuilder line = null;
- StringBuilder hdrUnderline = null;
-
- int spacing = 0;
- int columnSize = 0;
- int c;
-
- char spacingChar = ' '; // a space
- char underlineChar = '='; // an equal sign
-
- string dataType; // .NET Type
- string dataTypeName; // native Database type
- DataRow row; // schema row
-
- line = new StringBuilder();
- hdrUnderline = new StringBuilder();
-
- Console.WriteLine("Fields in Query Result: " +
- reader.FieldCount);
- Console.WriteLine();
-
- for(c = 0; c < schemaTable.Rows.Count; c++) {
-
- DataRow schemaRow = schemaTable.Rows[c];
- string columnHeader = (string) schemaRow["ColumnName"];
- int columnHeaderSize = columnHeader.Length;
-
- line.Append(columnHeader);
- hdrUnderline.Append(underlineChar, columnHeaderSize);
-
- // spacing
- columnSize = (int) schemaRow["ColumnSize"];
- dataType = (string) schemaRow["DataType"];
- dataTypeName = reader.GetDataTypeName(c);
-
- // columnSize correction based on data type
- if(dataType.Equals("System.Boolean")) {
- columnSize = 5;
- }
- if(provider.Equals("POSTGRESCLIENT"))
- if(dataTypeName.Equals("text"))
- columnSize = 32; // text will be truncated to 32
-
- if(columnHeaderSize < columnSize) {
- spacing = columnSize - columnHeaderSize;
- line.Append(spacingChar, spacing);
- hdrUnderline.Append(underlineChar, spacing);
- }
- line.Append(" ");
- hdrUnderline.Append(" ");
- }
- Console.WriteLine(line.ToString());
- line = null;
-
- Console.WriteLine(hdrUnderline);
- Console.WriteLine();
- hdrUnderline = null;
-
- // DEBUG - need to know the columnSize
- /*
- line = new StringBuilder();
- foreach(DataRow schemaRow in schemaTable.Rows) {
- columnSize = (int) schemaRow["ColumnSize"];
- line.Append(columnSize.ToString());
- line.Append(" ");
- }
- Console.WriteLine(line.ToString());
- Console.WriteLine();
- line = null;
- */
-
- int rows = 0;
-
- // column data
- while(reader.Read()) {
- rows++;
-
- line = new StringBuilder();
- for(c = 0; c < reader.FieldCount; c++) {
- int dataLen = 0;
- string dataValue;
-
- row = schemaTable.Rows[c];
- string colhdr = (string) row["ColumnName"];
- columnSize = (int) row["ColumnSize"];
- dataType = (string) row["DataType"];
- dataTypeName = reader.GetDataTypeName(c);
-
- // certain types need to have the
- // columnSize adjusted for display
- // so the column will line up for each
- // row and match the column header size
- if(dataType.Equals("System.Boolean")) {
- columnSize = 5;
- }
- if(provider.Equals("POSTGRESCLIENT"))
- if(dataTypeName.Equals("text"))
- columnSize = 32; // text will be truncated to 32
-
- if(reader.IsDBNull(c)) {
- dataValue = "";
- dataLen = 0;
- }
- else {
- object obj = reader.GetValue(c);
-
- dataValue = obj.ToString();
- dataLen = dataValue.Length;
- line.Append(dataValue);
- }
- line.Append(" ");
-
- // spacing
- spacingChar = ' ';
- if(dataLen < columnSize) {
- spacing = columnSize - dataLen;
- line.Append(spacingChar, spacing);
- }
- spacingChar = ' ';
- if(columnSize < colhdr.Length) {
- spacing = colhdr.Length - columnSize;
- line.Append(spacingChar, spacing);
- }
-
- }
- Console.WriteLine(line.ToString());
- line = null;
- }
- Console.WriteLine("\nRows retrieved: " + rows);
- }
-
- // DisplayData - used to display any Result Sets
- // from execution of SQL SELECT Query or Queries
- // called by DisplayData.
- // ExecuteSql() only calls this function
- // for a Query, it does not get
- // for a Command.
- public void DisplayData(IDataReader reader) {
-
- DataTable schemaTable = null;
- int ResultSet = 0;
-
- Console.WriteLine("Display any result sets...");
-
- do {
- // by Default, SqlDataReader has the
- // first Result set if any
-
- ResultSet++;
- Console.WriteLine("Display the result set " + ResultSet);
-
- schemaTable = reader.GetSchemaTable();
-
- if(reader.RecordsAffected >= 0) {
- // SQL Command (INSERT, UPDATE, or DELETE)
- // RecordsAffected >= 0
- Console.WriteLine("SQL Command Records Affected: " + reader.RecordsAffected);
- }
- else if(schemaTable == null) {
- // SQL Command (not INSERT, UPDATE, nor DELETE)
- // RecordsAffected -1 and DataTable has a null reference
- Console.WriteLine("SQL Command Executed.");
- }
- else {
- // SQL Query (SELECT)
- // RecordsAffected -1 and DataTable has a reference
- DisplayResult(reader, schemaTable);
- }
-
- // get next result set (if anymore is left)
- } while(reader.NextResult());
- }
-
- // ExecuteSql - Execute the SQL Command(s) and/or Query(ies)
- public void ExecuteSql(string sql) {
-
- Console.WriteLine("Execute SQL: " + sql);
-
- IDbCommand cmd = null;
- IDataReader reader = null;
-
- // create a Command object based on the provider
- switch(provider) {
- //case "OLEDB":
- // cmd = new OleDbCommand();
- // break;
- case "MYSQL":
- cmd = new MySqlCommand();
- break;
- case "POSTGRESCLIENT":
- cmd = new SqlCommand();
- break;
- default:
- Console.WriteLine("Error: PostgreSQL is only supported, and it through SqlClient.");
- return;
- }
-
- // set command properties
- cmd.CommandType = CommandType.Text;
- cmd.CommandText = sql;
- cmd.Connection = conn;
-
- try {
- reader = cmd.ExecuteReader();
- DisplayData(reader);
- reader.Close();
- //reader = null;
- //cmd.Dispose();
- //cmd = null;
- }
- catch(Exception e) {
- Console.WriteLine("Exception Caught Executing SQL: " + e);
- //if(reader != null) {
- // if(reader.IsClosed == false)
- // reader.Close();
- // reader = null;
- //}
- // cmd.Dispose();
- //cmd = null;
- }
- }
-
- // like ShowHelp - but only show at the beginning
- // only the most important commands are shown
- // like help and quit
- public void StartupHelp() {
- Console.WriteLine(@"Type: \Q to quit");
- Console.WriteLine(@" \ConnectionString to set the ConnectionString");
- Console.WriteLine(@" \Provider to set the Provider:");
- Console.WriteLine(@" {OleDb,SqlClient,MySql,Odbc,");
- Console.WriteLine(@" OracleClient,PostgresClient}");
- Console.WriteLine(@" \Open to open the connection");
- Console.WriteLine(@" \Close to close the connection");
- Console.WriteLine(@" \Execute to execute SQL command(s)/queries(s)");
- Console.WriteLine(@" \h to show this help.");
- Console.WriteLine(@" \defaults to show default variables.");
- Console.WriteLine();
- }
-
- // ShowHelp - show the help - command a user can enter
- public void ShowHelp() {
- Console.WriteLine("");
- Console.WriteLine(@"Type: \Q to quit");
- Console.WriteLine(@" \ConnectionString to set the ConnectionString");
- Console.WriteLine(@" \Provider to set the Provider:");
- Console.WriteLine(@" {OleDb,SqlClient,MySql,Odbc,");
- Console.WriteLine(@" OracleClient,PostgresClient}");
- Console.WriteLine(@" \Open to open the connection");
- Console.WriteLine(@" \Close to close the connection");
- Console.WriteLine(@" \Execute to execute SQL command(s)/queries(s)");
- Console.WriteLine(@" \f FILENAME to read a batch of commands from");
- Console.WriteLine(@" \o FILENAME to read a batch of commands from");
- Console.WriteLine(@" \h to show this help.");
- Console.WriteLine(@" \defaults to show default variables.");
- Console.WriteLine(@" \s {TRUE, FALSE} to silent messages.");
- Console.WriteLine();
- }
-
- // ShowDefaults - show defaults for connection variables
- public void ShowDefaults() {
- Console.WriteLine();
- Console.WriteLine("The default Provider is " + provider);
- Console.WriteLine();
- Console.WriteLine("The default ConnectionString is: ");
- Console.WriteLine(" \"" + connectionString + "\"");
- Console.WriteLine();
- }
-
- // OpenDataSource - open connection to the data source
- public void OpenDataSource() {
-
- Console.WriteLine("Attempt to Open...");
-
- switch(provider) {
- //case "OLEDB":
- // conn = new OleDbConnection();
- // break;
- case "MYSQL":
- conn = new MySqlConnection();
- break;
- case "POSTGRESCLIENT":
- conn = new SqlConnection();
- break;
- default:
- Console.WriteLine("Error: Bad argument or provider not supported.");
- break;
- }
-
- conn.ConnectionString = connectionString;
-
- try {
- conn.Open();
- if(conn.State == ConnectionState.Open)
- Console.WriteLine("Open was successfully.");
- }
- catch(Exception e) {
- Console.WriteLine("Exception Caught Opening. " + e);
- conn = null;
- }
- }
-
- // CloseDataSource - close the connection to the data source
- public void CloseDataSource() {
- Console.WriteLine("Attempt to Close...");
-
- try {
- conn.Close();
- Console.WriteLine("Close was successfull.");
- }
- catch(Exception e) {
- Console.WriteLine("Exeception Caught Closing. " + e);
- }
- conn = null;
- }
-
- // ChangeProvider - change the provider string variable
- public void ChangeProvider(string[] parms) {
-
- if(parms.Length == 2) {
- string parm = parms[1].ToUpper();
- switch(parm) {
- case "ORACLECLIENT":
- case "ODBC":
- case "GDA":
- Console.WriteLine("Error: Provider not currently supported.");
- break;
- case "SQLCLIENT":
- provider = "POSTGRESCLIENT";
- Console.WriteLine("Warning: Currently, the SqlClient provider is the PostgreSQL provider.");
- break;
- //case "OLEDB":
- case "MYSQL":
- case "POSTGRESCLIENT":
- provider = parm;
- break;
- default:
- Console.WriteLine("Error: " + "Bad argument or Provider not supported.");
- break;
- }
- Console.WriteLine("Provider: " + provider);
- }
- else
- Console.WriteLine("Error: provider only has one parameter.");
- }
-
- // ChangeConnectionString - change the connection string variable
- public void ChangeConnectionString(string entry) {
-
- if(entry.Length > 18)
- connectionString = entry.Substring(18, entry.Length - 18);
- else
- connectionString = "";
- }
-
- public void SetupInputFile(string[] parms) {
- if(parms.Length >= 2) {
- Console.WriteLine("Error: wrong number of parameters");
- return;
- }
- inputFilename = parms[1];
- // TODO:
- // open input file
- // while each line, do the SqlSharpCli command or SQL
- // close input file
- }
-
- public void SetupOutputFile(string[] parms) {
- if(parms.Length == 1) {
- outputFilename = "";
- // TODO: close the output file
- }
- else if(parms.Length > 2) {
- Console.WriteLine("Error: wrong number of parameters");
- }
- else {
- outputFilename = parms[1];
- // TODO: open the output file
- }
- }
-
- public void SetupSilentMode(string[] parms) {
- if(parms.Length != 2) {
- Console.WriteLine("Error: wrong number of parameters");
- return;
- }
- string parm = parms[1].ToUpper();
- if(parm.Equals("TRUE"))
- silent = true;
- else if(parm.Equals("FALSE"))
- silent = false;
- else
- Console.WriteLine("Error: invalid parameter.");
- }
-
- public void OutputLine(string line) {
- if(silent == false)
- Console.WriteLine(line);
- }
-
- public void ExecuteBatch() {
- // TODO:
- Console.WriteLine("Error: Execution of Batch Commands not implemented yet");
- }
-
- // HandleCommand - handle SqlSharpCli commands entered
- public void HandleCommand(string entry) {
-
- string[] parms;
-
- // maybe a SQL# Command was found
- parms = entry.Split(new char[1] {' '});
- string userCmd = parms[0].ToUpper();
-
- switch(userCmd) {
- case "\\PROVIDER":
- ChangeProvider(parms);
- break;
- case "\\CONNECTIONSTRING":
- ChangeConnectionString(entry);
- break;
- case "\\OPEN":
- OpenDataSource();
- break;
- case "\\CLOSE":
- CloseDataSource();
- break;
- case "\\S":
- SetupSilentMode(parms);
- break;
- case "\\E":
- case "\\EXECUTE":
- // Execute SQL Commands or Queries
- if(conn == null)
- Console.WriteLine("Error: connection is not Open.");
- else if(conn.State == ConnectionState.Closed)
- Console.WriteLine("Error: connection is not Open.");
- else {
- if(build == null)
- Console.WriteLine("Error: SQL Buffer is empty.");
- else {
- ExecuteSql(build.ToString());
- }
- build = null;
- }
- break;
- case "\\F":
- // Batch Input File: \f FILENAME
- SetupInputFile(parms);
- ExecuteBatch();
- break;
- case "\\O":
- // Batch Output File: \o FILENAME
- SetupOutputFile(parms);
- break;
- case "\\H":
- case "\\HELP":
- // Help
- ShowHelp();
- break;
- case "\\DEFAULTS":
- ShowDefaults();
- break;
- case "\\Q":
- case "\\QUIT":
- // Quit
- break;
- default:
- // Error
- Console.WriteLine("Error: Unknown user command.");
- break;
- }
- }
-
- public void DealWithArgs(string[] args) {
- for(int a = 0; a < args.Length; a++) {
- if(args[a].Substring(0,1).Equals("-")) {
- string arg = args[a].ToUpper().Substring(1, args[a].Length - 1);
- switch(arg) {
- case "S":
- silent = true;
- break;
- case "F":
- if(a + 1 >= args.Length)
- Console.WriteLine("Error: Missing FILENAME for -f switch");
- else {
- inputFilename = args[a + 1];
- ExecuteBatch();
- }
- break;
- case "O":
- if(a + 1 >= args.Length)
- Console.WriteLine("Error: Missing FILENAME for -o switch");
- else
- outputFilename = args[a + 1];
- break;
- default:
- Console.WriteLine("Error: Unknow switch: " + args[a]);
- break;
- }
- }
- }
- }
-
- public void Run(string[] args) {
-
- DealWithArgs(args);
-
- string entry = "";
- build = null;
-
- if(silent == false) {
- Console.WriteLine("Welcome to SQL#. The interactive SQL command-line client ");
- Console.WriteLine("for Mono.Data. See http://www.go-mono.com/ for more details.\n");
-
- StartupHelp();
- ShowDefaults();
- }
-
- while(entry.ToUpper().Equals("\\Q") == false &&
- entry.ToUpper().Equals("\\QUIT") == false) {
-
- Console.Write("\nSQL# ");
- entry = Console.ReadLine();
-
- Console.WriteLine("Entered: " + entry);
-
- if(entry.Substring(0,1).Equals("\\")) {
- HandleCommand(entry);
- }
- else if(entry.IndexOf(";") >= 0) {
- // most likely the end of SQL Command or Query found
- // execute the SQL
- if(conn == null)
- Console.WriteLine("Error: connection is not Open.");
- else if(conn.State == ConnectionState.Closed)
- Console.WriteLine("Error: connection is not Open.");
- else {
- if(build == null) {
- build = new StringBuilder();
- }
- build.Append(entry);
- ExecuteSql(build.ToString());
- build = null;
- }
- }
- else {
- // most likely a part of a SQL Command or Query found
- // append this part of the SQL
- if(build == null) {
- build = new StringBuilder();
- }
- build.Append(entry + " ");
- }
- }
- }
- }
-
- public class SqlSharpDriver {
-
- public static void Main(string[] args) {
- SqlSharpCli sqlCommandLineEngine = new SqlSharpCli();
- sqlCommandLineEngine.Run(args);
- }
- }
-}
diff --git a/mcs/tools/XMLUtil.cs b/mcs/tools/XMLUtil.cs
deleted file mode 100644
index 0643472ad28..00000000000
--- a/mcs/tools/XMLUtil.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// IFaceDisco.cs
-//
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001 Nick Drochak
-
-using System;
-using System.Text;
-using System.Collections;
-
-namespace Mono.Util
-{
- class XMLUtil{
- public static string ToXML(
- ArrayList list,
- string itemWrap,
- string listWrap)
- {
- if (null == itemWrap){
- throw new ArgumentNullException("itemWrap");
- }
- if (null == listWrap){
- throw new ArgumentNullException("listWrap");
- }
- StringBuilder output = new StringBuilder();
- output.Append("<"+listWrap+">");
- foreach(object o in list){
- output.Append("\n<"+itemWrap+">");
- output.Append(o.ToString());
- output.Append("</"+itemWrap+">");
- }
- output.Append("\n</"+listWrap+">");
- return output.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/mcs/tools/assemblies.xml b/mcs/tools/assemblies.xml
deleted file mode 100644
index 1bf42d8c266..00000000000
--- a/mcs/tools/assemblies.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<assemblies>
- <path url="C:\WINNT\Microsoft.NET\Framework\v1.0.3705">
- <assembly file="mscorlib.dll"/>
- <assembly file="System.Web.dll"/>
- <assembly file="System.dll"/>
- <assembly file="System.Drawing.dll"/>
- <assembly file="System.Security.dll"/>
- <assembly file="System.Windows.Forms.dll"/>
- <assembly file="System.Xml.dll"/>
- <assembly file="System.Data.dll"/>
- <assembly file="System.Design.dll"/>
- <assembly file="System.EnterpriseServices.dll"/>
- <assembly file="System.Management.dll"/>
- <assembly file="System.Messaging.dll"/>
- <assembly file="System.Runtime.Remoting.dll"/>
- <assembly file="System.ServiceProcess.dll"/>
- <assembly file="System.Web.RegularExpressions.dll"/>
- <assembly file="System.Web.Services.dll"/>
- </path>
-</assemblies>
diff --git a/mcs/tools/corcompare/.cvsignore b/mcs/tools/corcompare/.cvsignore
deleted file mode 100644
index ee381230de1..00000000000
--- a/mcs/tools/corcompare/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.pdb
-*.exe
diff --git a/mcs/tools/corcompare/ChangeLog b/mcs/tools/corcompare/ChangeLog
deleted file mode 100644
index 4e100611a23..00000000000
--- a/mcs/tools/corcompare/ChangeLog
+++ /dev/null
@@ -1,6 +0,0 @@
-2002-02-25 Nick Drochak <ndrochak@gol.com>
-
- * ToDoAssembly.cs: remove unused code
- * ToDoNamespace.cs: using BindingFlags for GetMembers
- * ToDoType.cs: throw exception if we encounter a member type
- that we didn't expect. Also remove unused property. \ No newline at end of file
diff --git a/mcs/tools/corcompare/CompletionInfo.cs b/mcs/tools/corcompare/CompletionInfo.cs
deleted file mode 100644
index ab497f31eb4..00000000000
--- a/mcs/tools/corcompare/CompletionInfo.cs
+++ /dev/null
@@ -1,573 +0,0 @@
-// Mono.Util.CorCompare.CompletionInfo
-//
-// Author(s):
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2001-2002 Piers Haken
-
-using System;
-using System.Reflection;
-using System.Xml;
-using System.Collections;
-
-namespace Mono.Util.CorCompare
-{
- #region
- public struct CompletionType
- {
- private enum CompletionTypes
- {
- Present,
- Missing,
- Extra
- }
- private const int MASK_TYPE = 0x0f;
- private const int MASK_TODO = 0x10;
- //private const int MASK_ERROR = 0x20;
- private int m_type;
-
- private CompletionType (CompletionTypes type, bool fTodo)
- {
- m_type = (int) type;
-
- if (fTodo)
- m_type |= MASK_TODO;
- }
-
- public bool IsPresent
- {
- get { return Type == CompletionTypes.Present; }
- }
- public bool IsMissing
- {
- get { return Type == CompletionTypes.Missing; }
- }
- public bool IsExtra
- {
- get { return Type == CompletionTypes.Extra; }
- }
- public bool IsTodo
- {
- get { return (m_type & MASK_TODO) != 0; }
- }
- private CompletionTypes Type
- {
- get { return (CompletionTypes) (m_type & MASK_TYPE); }
- }
-
- public override string ToString ()
- {
- switch (Type)
- {
- case CompletionTypes.Missing:
- return "missing";
- case CompletionTypes.Extra:
- return "extra";
- case CompletionTypes.Present:
- return "present";
- default:
- throw new Exception ("Invalid CompletionType: "+Type);
- }
- }
-
- public static CompletionType Present
- {
- get { return new CompletionType (CompletionTypes.Present, false); }
- }
- public static CompletionType Missing
- {
- get { return new CompletionType (CompletionTypes.Missing, false); }
- }
- public static CompletionType Extra
- {
- get { return new CompletionType (CompletionTypes.Extra, false); }
- }
- public static CompletionType Compare (Object oMono, Object oMS)
- {
- if (oMono == null)
- return Missing;
- else if (oMS == null)
- return Extra;
- else
- return Present;
- }
- }
-
- /// <summary>
- /// Represents the amount of work done on a node
- /// </summary>
- /// <remarks>
- /// created by - Piersh
- /// created on - 3/2/2002 1:12:00 AM
- /// </remarks>
-
- public struct CompletionInfo
- {
- public int cPresent;
- public int cExtra;
- public int cMissing;
- public int cTodo;
-
- /// <summary>
- /// converts a CompletionTypes into a CompletionInfo
- /// sets the corresponding field to '1'
- /// </summary>
- /// <param name="ct">the CompletionTypes to convert</param>
- public CompletionInfo (CompletionType ct)
- {
- cPresent = cTodo = cMissing = cExtra = 0;
- if (ct.IsPresent)
- cPresent = 1;
- else if (ct.IsMissing)
- cMissing = 1;
- else if (ct.IsExtra)
- cExtra = 1;
-
- if (ct.IsTodo)
- cTodo = 1;
- }
-
- /// <summary>
- /// counts the total number of elements represented by this info
- /// </summary>
- public int cTotal
- {
- get
- {
- return cPresent + cTodo + cMissing;
- }
- }
-
- /// <summary>
- /// adds two CompletionInfos together
- /// </summary>
- /// <param name="m_nodeStatus"></param>
- public void Add (CompletionInfo m_nodeStatus)
- {
- cPresent += m_nodeStatus.cPresent;
- cTodo += m_nodeStatus.cTodo;
- cMissing += m_nodeStatus.cMissing;
- cExtra += m_nodeStatus.cExtra;
- }
-
- /// <summary>
- /// subtracts two CompletionInfos
- /// </summary>
- /// <param name="m_nodeStatus"></param>
- public void Sub (CompletionInfo m_nodeStatus)
- {
- cPresent -= m_nodeStatus.cPresent;
- cTodo -= m_nodeStatus.cTodo;
- cMissing -= m_nodeStatus.cMissing;
- cExtra -= m_nodeStatus.cExtra;
- if (cPresent < 0 || cTodo < 0 || cMissing < 0 || cExtra < 0)
- throw new Exception ("Completion underflow on subtract");
- }
-
- /// <summary>
- /// increments the corresponding field
- /// </summary>
- /// <param name="ct"></param>
- public void Add (CompletionType ct)
- {
- Add (new CompletionInfo (ct));
- }
- /// <summary>
- /// decrements the corresponding field
- /// </summary>
- /// <param name="ct"></param>
- public void Sub (CompletionType ct)
- {
- Sub (new CompletionInfo (ct));
- }
-
- /// <summary>
- /// adds appropriate 'missing', 'todo' & 'complete' attributes to an XmlElement
- /// </summary>
- /// <param name="elt"></param>
- public void SetAttributes (XmlElement elt)
- {
- elt.SetAttribute ("present", cPresent.ToString ());
- elt.SetAttribute ("missing", cMissing.ToString ());
- elt.SetAttribute ("extra", cExtra.ToString ());
- elt.SetAttribute ("todo", cTodo.ToString ());
-
- //int percentComplete = (cTotal == 0) ? 100 : (100 - 100 * (cMissing + cExtra) / cTotal);
- //elt.SetAttribute ("complete", percentComplete.ToString ());
- }
- }
-
- #endregion
-
- public enum PresenceTypes
- {
-// UNINITIALIZED = 0,
- Missing = 0,
- Present,
- Extra
- }
-
- public enum ErrorTypes
- {
- // TODO: order is important here... (see Status.SetError ())
-// UNINITIALIZED = 0,
- OK = 0,
- Todo,
- Warning,
- Error
- }
-
- public struct PresenceCounts
- {
- public int cMissing;
- public int cPresent;
- public int cExtra;
-
- public PresenceCounts (PresenceTypes type)
- {
- cMissing = cPresent = cExtra = 0;
- if (type == PresenceTypes.Missing)
- cMissing = 1;
- else if (type == PresenceTypes.Present)
- cPresent = 1;
- else if (type == PresenceTypes.Extra)
- cExtra = 1;
- else throw new Exception ("Invalid PresenceType");
- }
- public int Total
- {
- get { return cMissing + cPresent + cExtra; }
- }
- public void Add (PresenceCounts counts)
- {
- cMissing += counts.cMissing;
- cPresent += counts.cPresent;
- cExtra += counts.cExtra;
- }
- public void Sub (PresenceCounts counts)
- {
- cMissing -= counts.cMissing;
- cPresent -= counts.cPresent;
- cExtra -= counts.cExtra;
-
- if (cMissing < 0 || cPresent < 0 || cExtra < 0)
- throw new Exception ("Underflow");
- }
- public void Add (PresenceTypes type)
- {
- Add (new PresenceCounts (type));
- }
- public void Sub (PresenceTypes type)
- {
- Sub (new PresenceCounts (type));
- }
- public void SetAttributes (XmlElement elt, string strSuffix)
- {
- if (cMissing != 0)
- elt.SetAttribute ("missing"+strSuffix, cMissing.ToString ());
- if (cPresent != 0)
- elt.SetAttribute ("present"+strSuffix, cPresent.ToString ());
- if (cExtra != 0)
- elt.SetAttribute ("extra"+strSuffix, cExtra.ToString ());
- }
- }
-
- public struct ErrorCounts
- {
- public int cOK;
- public int cTodo;
- public int cWarning;
- public int cError;
-
- public ErrorCounts (ErrorTypes type)
- {
- cOK = cTodo = cWarning = cError = 0;
- if (type == ErrorTypes.OK)
- cOK = 1;
- else if (type == ErrorTypes.Todo)
- cTodo = 1;
- else if (type == ErrorTypes.Warning)
- cWarning = 1;
- else if (type == ErrorTypes.Error)
- cError = 1;
- else throw new Exception ("Invalid ErrorType");
- }
- public int Total
- {
- get { return cOK + cTodo + cWarning + cError; }
- }
- public void Add (ErrorCounts counts)
- {
- cOK += counts.cOK;
- cTodo += counts.cTodo;
- cWarning += counts.cWarning;
- cError += counts.cError;
- }
- public void Sub (ErrorCounts counts)
- {
- cOK -= counts.cOK;
- cTodo -= counts.cTodo;
- cWarning -= counts.cWarning;
- cError -= counts.cError;
- if (cOK < 0 || cTodo < 0 || cWarning < 0 || cError < 0)
- throw new Exception ("Underflow");
- }
- public void Add (ErrorTypes type)
- {
- Add (new ErrorCounts (type));
- }
- public void Sub (ErrorTypes type)
- {
- Sub (new ErrorCounts (type));
- }
- public void SetAttributes (XmlElement elt, string strSuffix)
- {
- if (cOK != 0)
- elt.SetAttribute ("ok"+strSuffix, cOK.ToString ());
- if (cTodo != 0)
- elt.SetAttribute ("todo"+strSuffix, cTodo.ToString ());
- if (cWarning != 0)
- elt.SetAttribute ("warning"+strSuffix, cWarning.ToString ());
- if (cError != 0)
- elt.SetAttribute ("error"+strSuffix, cError.ToString ());
- }
- }
-
- public struct Status
- {
- public PresenceTypes presence;
- public ErrorTypes error;
-
- public string PresenceName
- {
- get
- {
- if (presence == PresenceTypes.Missing)
- return "missing";
- else if (presence == PresenceTypes.Present)
- return "present";
- else if (presence == PresenceTypes.Extra)
- return "extra";
- else throw new Exception ("Invalid PresenceType");
- }
- }
- public string ErrorName
- {
- get
- {
- if (error == ErrorTypes.OK)
- return "OK";
- else if (error == ErrorTypes.Todo)
- return "todo";
- else if (error == ErrorTypes.Warning)
- return "warning";
- else if (error == ErrorTypes.Error)
- return "error";
- else throw new Exception ("Invalid ErrorType");
- }
- }
- public void SetAttributes (XmlElement elt)
- {
- if (presence != PresenceTypes.Present)
- elt.SetAttribute ("presence", PresenceName);
- if (error != ErrorTypes.OK)
- elt.SetAttribute ("error", ErrorName);
- }
- }
-
- public struct StatusCounts
- {
- public PresenceCounts presenceCounts;
- public ErrorCounts errorCounts;
-
- public void Add (StatusCounts statusCounts)
- {
- presenceCounts.Add (statusCounts.presenceCounts);
- errorCounts.Add (statusCounts.errorCounts);
- if (presenceCounts.Total != errorCounts.Total)
- throw new Exception ("invalid status counts");
- }
- public void Sub (StatusCounts statusCounts)
- {
- presenceCounts.Sub (statusCounts.presenceCounts);
- errorCounts.Sub (statusCounts.errorCounts);
- if (presenceCounts.Total != errorCounts.Total)
- throw new Exception ("invalid status counts");
- }
- public void Add (Status status)
- {
- presenceCounts.Add (status.presence);
- errorCounts.Add (status.error);
- if (presenceCounts.Total != errorCounts.Total)
- throw new Exception ("invalid status counts");
- }
- public void Sub (Status status)
- {
- presenceCounts.Sub (status.presence);
- errorCounts.Sub (status.error);
- if (presenceCounts.Total != errorCounts.Total)
- throw new Exception ("invalid status counts");
- }
- public void SetAttributes (XmlElement elt, string strSuffix)
- {
- presenceCounts.SetAttributes (elt, strSuffix);
- errorCounts.SetAttributes (elt, strSuffix);
-
- int cTotal = presenceCounts.cMissing + presenceCounts.cPresent;
- int cIncomplete =
- presenceCounts.cMissing +
- errorCounts.cTodo +
- errorCounts.cWarning +
- errorCounts.cError;
-
- if (presenceCounts.Total != errorCounts.Total)
- throw new Exception ("invalid status counts");
-
- if (cTotal != 0)
- {
- int percentComplete = 100 * (cTotal - cIncomplete) / cTotal;
- elt.SetAttribute ("complete" + strSuffix, percentComplete.ToString ());
- }
- }
- }
-
- public class NodeMessage
- {
- protected string msg;
-
- public NodeMessage (string _msg)
- {
- msg = _msg;
- }
-
- public string Message
- {
- get { return msg; }
- }
- }
-
- public class NodeStatus
- {
- public Status status;
- protected StatusCounts statusCountsChildren;
- protected StatusCounts statusCountsTotal;
- protected IList lstWarnings;
-
- public NodeStatus ()
- {
- status.error = ErrorTypes.OK;
- }
-
- /// <summary>
- /// Constructs a NodeStatus by comparing the presence of two objects
- /// it only sets the status.presence field
- /// </summary>
- /// <param name="objMono"></param>
- /// <param name="objMS"></param>
- public NodeStatus (Object objMono, Object objMS)
- {
- status.error = ErrorTypes.OK;
- statusCountsChildren = statusCountsTotal = new StatusCounts ();
- if (objMono == null)
- status.presence = PresenceTypes.Missing;
- else if (objMS == null)
- status.presence = PresenceTypes.Extra;
- else
- status.presence = PresenceTypes.Present;
- }
- public void Add (NodeStatus statusChild)
- {
- if ((int) statusChild.status.error > (int) status.error)
- status.error = statusChild.status.error;
- statusCountsTotal.Add (statusChild.statusCountsTotal);
- statusCountsChildren.Add (statusChild.statusCountsChildren);
- }
- public void AddChildren (NodeStatus statusChild)
- {
- statusCountsTotal.Add (statusChild.statusCountsTotal);
- statusCountsTotal.Add (statusChild.status);
- statusCountsChildren.Add (statusChild.status);
- }
-
- public void SubChildren (NodeStatus statusChild)
- {
- statusCountsTotal.Sub (statusChild.statusCountsTotal);
- statusCountsTotal.Sub (statusChild.status);
- statusCountsChildren.Sub (statusChild.status);
- }
-
- public void Add (StatusCounts statusCounts)
- {
- statusCountsChildren.Add (statusCounts);
- statusCountsTotal.Add (statusCounts);
- }
-
- public void Sub (StatusCounts statusCounts)
- {
- statusCountsChildren.Sub (statusCounts);
- statusCountsTotal.Sub (statusCounts);
- }
-
- public void Add (Status status)
- {
- statusCountsChildren.Add (status);
- statusCountsTotal.Add (status);
- }
-
- public void Sub (Status status)
- {
- statusCountsChildren.Sub (status);
- statusCountsTotal.Sub (status);
- }
-
-
- public bool IsMissing
- {
- get { return status.presence == PresenceTypes.Missing; }
- }
- public bool IsPresent
- {
- get { return status.presence == PresenceTypes.Present; }
- }
- public bool IsExtra
- {
- get { return status.presence == PresenceTypes.Extra; }
- }
-
- public void SetAttributes (XmlElement elt)
- {
- status.SetAttributes (elt);
- statusCountsChildren.SetAttributes (elt, "");
- statusCountsTotal.SetAttributes (elt, "_total");
-
- // add any warning messages
- if (lstWarnings != null)
- {
- XmlElement eltWarnings = elt.OwnerDocument.CreateElement ("warnings");
- elt.AppendChild (eltWarnings);
- foreach (NodeMessage msg in lstWarnings)
- {
- XmlElement eltWarning = elt.OwnerDocument.CreateElement ("warning");
- eltWarnings.AppendChild (eltWarning);
- eltWarning.SetAttribute ("text", msg.Message);
- }
- }
-
- //int percentComplete = (cTotal == 0) ? 100 : (100 - 100 * (cMissing + cExtra) / cTotal);
- //elt.SetAttribute ("complete", percentComplete.ToString ());
- }
- public void SetError (ErrorTypes errorNew)
- {
- // TODO: assumes order of error values
- if ((int) errorNew > (int) status.error)
- status.error = errorNew;
- }
- public void AddWarning (string strWarning)
- {
- if (lstWarnings == null)
- lstWarnings = new ArrayList ();
- lstWarnings.Add (new NodeMessage (strWarning));
- SetError (ErrorTypes.Warning);
- }
- }
-} \ No newline at end of file
diff --git a/mcs/tools/corcompare/CorCompare.cs b/mcs/tools/corcompare/CorCompare.cs
deleted file mode 100644
index bb956979fe3..00000000000
--- a/mcs/tools/corcompare/CorCompare.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// Mono.Util.CorCompare.CorCompareDriver
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.IO;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Handles command line arguments, and generates appropriate report(s)
- /// based on those arguments
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class CorCompareDriver
- {
- public static void Main(string[] args) {
- // make sure we were called with the proper usage
- if (args.Length < 1) {
- Console.WriteLine("Usage: CorCompare [-t][-n][-x outfile][-ms assembly][-f friendly_name] assembly_to_compare");
- return;
- }
-
- bool fList = false;
- string strXML = null;
- string strMono = args [args.Length - 1];
- string strMS = null;
- string strFriendly = null;
-
- for (int i = 0; i < args.Length-1; i++) {
- if (args [i] == "-t") {
- fList = true;
- }
- if (args [i] == "-n") {
- }
- if (args [i] == "-x") {
- strXML = args [++i];
- }
- if (args [i] == "-ms") {
- strMS = args [++i];
- }
- if (args [i] == "-f") {
- strFriendly = args [++i];
- }
- }
-
- if (strMS == null)
- strMS = Path.GetFileNameWithoutExtension (strMono);
-
- if (strFriendly == null)
- strFriendly = strMS;
-
- if (strXML == null)
- strXML = strFriendly + ".xml";
-
- ToDoAssembly td = ToDoAssembly.Load (strMono, strFriendly, strMS);
-
- if (fList)
- Console.WriteLine(td.CreateClassListReport());
-
- if (strXML != null)
- td.CreateXMLReport(strXML);
-
- }
- }
-}
diff --git a/mcs/tools/corcompare/Makefile b/mcs/tools/corcompare/Makefile
deleted file mode 100644
index 253e4e8b791..00000000000
--- a/mcs/tools/corcompare/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-all: linux
-
-windows: linux
-
-linux: CorCompare.exe
-
-CorCompare.exe: *.cs
- ../../nant/NAnt.exe linux
-
-clean:
- rm -f *.exe *.pdb *.dll
diff --git a/mcs/tools/corcompare/MissingAttribute.cs b/mcs/tools/corcompare/MissingAttribute.cs
deleted file mode 100644
index f155a8764bd..00000000000
--- a/mcs/tools/corcompare/MissingAttribute.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-// Mono.Util.CorCompare.MissingAttribute
-//
-// Author(s):
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2001-2002 Piers Haken
-using System;
-using System.Xml;
-using System.Reflection;
-using System.Collections;
-
-namespace Mono.Util.CorCompare
-{
-
- /// <summary>
- /// Represents an Attribute that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Piersh
- /// created on - 3/2/2002 9:47:00 pm
- /// </remarks>
- class MissingAttribute : MissingBase
- {
- // e.g. <attribute name="Equals" status="missing"/>
- Object attributeMono;
- Object attributeMS;
- static Hashtable htIgnore;
-
- static MissingAttribute ()
- {
- htIgnore = new Hashtable ();
- htIgnore.Add ("System.Runtime.InteropServices.ClassInterfaceAttribute", null);
- htIgnore.Add ("System.Diagnostics.DebuggerHiddenAttribute", null);
- htIgnore.Add ("System.Diagnostics.DebuggerStepThroughAttribute", null);
- htIgnore.Add ("System.Runtime.InteropServices.GuidAttribute", null);
- htIgnore.Add ("System.Runtime.InteropServices.InterfaceTypeAttribute", null);
- htIgnore.Add ("System.Runtime.InteropServices.ComVisibleAttribute", null);
- }
-
- public MissingAttribute (Object _attributeMono, Object _attributeMS)
- {
- attributeMono = _attributeMono;
- attributeMS = _attributeMS;
- m_nodeStatus = new NodeStatus (attributeMono, attributeMS);
- }
-
- public override string Name
- {
- get { return Attribute.ToString (); }
- }
-
- public override string Type
- {
- get { return "attribute"; }
- }
-
- public override NodeStatus Analyze ()
- {
- return m_nodeStatus;
- }
-
-
- public Object Attribute
- {
- get { return (attributeMono != null) ? attributeMono : attributeMS; }
- }
-
- /// <summary>
- /// creates a map from a list of attributes
- /// the hashtable maps from name to attribute
- /// </summary>
- /// <param name="rgAttributes">the list of attributes</param>
- /// <returns>a map</returns>
- public static Hashtable GetAttributeMap (Object [] rgAttributes)
- {
- Hashtable map = new Hashtable ();
- foreach (Object attribute in rgAttributes)
- {
- if (attribute != null)
- {
- string strName = attribute.ToString ();
- if (!map.Contains (strName) && !htIgnore.Contains (strName))
- map.Add (strName, attribute);
- }
- }
- return map;
- }
-
- /// <summary>
- /// analyzes two sets of reflected attributes, generates a list
- /// of MissingAttributes according to the completion of the first set wrt the second.
- /// </summary>
- /// <param name="rgAttributesMono">mono attributes</param>
- /// <param name="rgAttributesMS">microsoft attributes</param>
- /// <param name="rgAttributes">where the results are put</param>
- /// <returns>completion info for the whole set</returns>
- public static NodeStatus AnalyzeAttributes (Object [] rgAttributesMono, Object [] rgAttributesMS, ArrayList rgAttributes)
- {
- NodeStatus nodeStatus = new NodeStatus ();
-
- Hashtable mapAttributesMono = (rgAttributesMono == null) ? new Hashtable () : MissingAttribute.GetAttributeMap (rgAttributesMono);
- Hashtable mapAttributesMS = (rgAttributesMS == null) ? new Hashtable () : MissingAttribute.GetAttributeMap (rgAttributesMS);
-
- foreach (Object attribute in mapAttributesMS.Values)
- {
- string strAttribute = attribute.ToString ();
- Object attributeMono = mapAttributesMono [strAttribute];
- MissingAttribute ma = new MissingAttribute (attributeMono, attribute);
- rgAttributes.Add (ma);
- NodeStatus nsAttribute = ma.Analyze ();
- nodeStatus.AddChildren (nsAttribute);
-
- if (attributeMono != null)
- mapAttributesMono.Remove (strAttribute);
- }
- foreach (Object attribute in mapAttributesMono.Values)
- {
- if (attribute.ToString ().EndsWith ("MonoTODOAttribute"))
- {
- nodeStatus.SetError (ErrorTypes.Todo);
- //nodeStatus.statusCountsChildren.errorCounts.Add (ErrorTypes.Todo);
- //nodeStatus.statusCountsTotal.errorCounts.Add (ErrorTypes.Todo);
- //nodeStatus.cTodo ++; // this is where ALL the 'todo's come from
- }
- else
- {
- MissingAttribute ma = new MissingAttribute (attribute, null);
- rgAttributes.Add (ma);
- NodeStatus nsAttribute = ma.Analyze ();
- nodeStatus.AddChildren (nsAttribute);
- }
- }
- return nodeStatus;
- }
- }
-} \ No newline at end of file
diff --git a/mcs/tools/corcompare/MissingBase.cs b/mcs/tools/corcompare/MissingBase.cs
deleted file mode 100644
index ec62043a32a..00000000000
--- a/mcs/tools/corcompare/MissingBase.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-// Mono.Util.CorCompare.MissingBase
-//
-// Author(s):
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2001-2002 Piers Haken
-using System;
-using System.Xml;
-using System.Reflection;
-using System.Collections;
-
-namespace Mono.Util.CorCompare
-{
- /// <summary>
- /// Base class for all comparison items
- /// </summary>
- /// <remarks>
- /// created by - Piersh
- /// created on - 3/3/2002 10:23:24 AM
- /// </remarks>
- public abstract class MissingBase
- {
- protected NodeStatus m_nodeStatus;
- protected ArrayList rgAttributes;
- protected NodeStatus nsAttributes;
-
- public enum Accessibility
- {
- Public,
- Assembly,
- FamilyOrAssembly,
- Family,
- FamilyAndAssembly,
- Private,
- }
-
- /// <summary>
- /// The name of the element (eg "System.Xml")
- /// </summary>
- public abstract string Name { get ; }
-
- /// <summary>
- /// The type of the element (eg "namespace")
- /// </summary>
- public abstract string Type { get; }
-
- /// <summary>
- /// Generates an XmlElement describint this element
- /// </summary>
- /// <param name="doc">The document in which to create the element</param>
- /// <returns></returns>
- public virtual XmlElement CreateXML (XmlDocument doc)
- {
- XmlElement eltMissing = doc.CreateElement (Type);
- eltMissing.SetAttribute ("name", Name);
- //Status.status.SetAttributes (eltMissing);
- Status.SetAttributes (eltMissing);
-
- XmlElement eltAttributes = MissingBase.CreateMemberCollectionElement ("attributes", rgAttributes, nsAttributes, doc);
- if (eltAttributes != null)
- eltMissing.AppendChild (eltAttributes);
-
- return eltMissing;
- }
-
- public virtual NodeStatus Status
- {
- get { return m_nodeStatus; }
- }
-
- public abstract NodeStatus Analyze ();
-
- /// <summary>
- /// Creates an XmlElement grouping together a set of sub-elements
- /// </summary>
- /// <param name="name">the name of the element to create</param>
- /// <param name="rgMembers">a list of sub-elements</param>
- /// <param name="doc">the document in which to create the element</param>
- /// <returns></returns>
- public static XmlElement CreateMemberCollectionElement (string name, ArrayList rgMembers, NodeStatus ns, XmlDocument doc)
- {
- XmlElement element = null;
- if (rgMembers != null && rgMembers.Count > 0)
- {
- element = doc.CreateElement(name);
- foreach (MissingBase mm in rgMembers)
- element.AppendChild (mm.CreateXML (doc));
-
- //ns.SetAttributes (element);
- }
- return element;
- }
- protected void AddFakeAttribute (bool fMono, bool fMS, string strName)
- {
- if (fMono || fMS)
- {
- MissingAttribute ma = new MissingAttribute (
- (fMono) ? strName : null,
- (fMS) ? strName : null);
- ma.Analyze ();
- rgAttributes.Add (ma);
- nsAttributes.AddChildren (ma.Status);
- }
- }
-
- protected void AddFlagWarning (bool fMono, bool fMS, string strName)
- {
- if (!fMono && fMS)
- m_nodeStatus.AddWarning ("Should be " + strName);
- else if (fMono && !fMS)
- m_nodeStatus.AddWarning ("Should not be " + strName);
- }
-
- protected string AccessibilityToString (Accessibility ac)
- {
- switch (ac)
- {
- case Accessibility.Public:
- return "public";
- case Accessibility.Assembly:
- return "internal";
- case Accessibility.FamilyOrAssembly:
- return "protected internal";
- case Accessibility.Family:
- return "protected";
- case Accessibility.FamilyAndAssembly:
- return "protected"; // TODO:
- case Accessibility.Private:
- return "private";
- }
- throw new Exception ("Invalid accessibility: "+ac.ToString ());
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingConstructor.cs b/mcs/tools/corcompare/MissingConstructor.cs
deleted file mode 100644
index eda6f52b23a..00000000000
--- a/mcs/tools/corcompare/MissingConstructor.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Mono.Util.CorCompare.MissingConstructor
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingConstructor : MissingMethod {
- // e.g. <method name="Equals" status="missing"/>
- public MissingConstructor (MemberInfo infoMono, MemberInfo infoMS) : base (infoMono, infoMS) {}
-
- public override string Type {
- get {
- return "constructor";
- }
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingEvent.cs b/mcs/tools/corcompare/MissingEvent.cs
deleted file mode 100644
index fb037c2319b..00000000000
--- a/mcs/tools/corcompare/MissingEvent.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-// Mono.Util.CorCompare.MissingEvent
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Xml;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingEvent : MissingMember {
- // e.g. <method name="Equals" status="missing"/>
- public MissingEvent (MemberInfo infoMono, MemberInfo infoMS) : base (infoMono, infoMS) {}
- MissingMethod mmAdd;
- MissingMethod mmRemove;
- MissingMethod mmRaise;
-
- public override string Type {
- get {
- return "event";
- }
- }
-
- public override NodeStatus Analyze ()
- {
- m_nodeStatus = base.Analyze ();
-
- EventInfo eiMono = (EventInfo) mInfoMono;
- EventInfo eiMS = (EventInfo) mInfoMS;
-
- MemberInfo miAddMono, miRemoveMono, miRaiseMono;
- if (eiMono == null)
- miAddMono = miRemoveMono = miRaiseMono = null;
- else
- {
- miAddMono = eiMono.GetAddMethod ();
- miRemoveMono = eiMono.GetRemoveMethod ();
- miRaiseMono = eiMono.GetRaiseMethod ();
- }
-
- MemberInfo miAddMS, miRemoveMS, miRaiseMS;
- if (eiMS == null)
- miAddMS = miRemoveMS = miRaiseMS = null;
- else
- {
- miAddMS = eiMS.GetAddMethod ();
- miRemoveMS = eiMS.GetRemoveMethod ();
- miRaiseMS = eiMS.GetRaiseMethod ();
- }
-
- if (miAddMono != null || miAddMS != null)
- {
- mmAdd = new MissingMethod (miAddMono, miAddMS);
- m_nodeStatus.AddChildren (mmAdd.Analyze ());
- }
- if (miRemoveMono != null || miRemoveMS != null)
- {
- mmRemove = new MissingMethod (miRemoveMono, miRemoveMS);
- m_nodeStatus.AddChildren (mmRemove.Analyze ());
- }
- if (miRaiseMono != null || miRaiseMS != null)
- {
- mmRaise = new MissingMethod (miRemoveMono, miRemoveMS);
- m_nodeStatus.AddChildren (mmRaise.Analyze ());
- }
- return m_nodeStatus;
- }
-
- public override XmlElement CreateXML (XmlDocument doc)
- {
- XmlElement eltMember = base.CreateXML (doc);
-
- if (mInfoMono != null && mmRaise != null)
- {
- XmlElement eltAccessors = (XmlElement) eltMember.SelectSingleNode ("accessors");
- if (eltAccessors == null)
- {
- eltAccessors = doc.CreateElement ("accessors");
- eltMember.AppendChild (eltAccessors);
- }
- if (mmAdd != null)
- {
- XmlElement eltAdd = mmAdd.CreateXML (doc);
- eltAccessors.AppendChild (eltAdd);
- }
- if (mmRemove != null)
- {
- XmlElement eltRemove = mmRemove.CreateXML (doc);
- eltAccessors.AppendChild (eltRemove);
- }
- if (mmRaise != null)
- {
- XmlElement eltRaise = mmRaise.CreateXML (doc);
- eltAccessors.AppendChild (eltRaise);
- }
- }
- return eltMember;
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingField.cs b/mcs/tools/corcompare/MissingField.cs
deleted file mode 100644
index 12e598a2180..00000000000
--- a/mcs/tools/corcompare/MissingField.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-// Mono.Util.CorCompare.MissingField
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingField : MissingMember {
- // e.g. <method name="Equals" status="missing"/>
- public MissingField (MemberInfo infoMono, MemberInfo infoMS) : base (infoMono, infoMS) {}
-
- public override string Type {
- get {
- return "field";
- }
- }
-
- public override NodeStatus Analyze ()
- {
- base.Analyze ();
-
- if (mInfoMono != null && mInfoMS != null)
- {
- FieldInfo fiMono = (FieldInfo) mInfoMono;
- FieldInfo fiMS = (FieldInfo) mInfoMS;
-
- AddFakeAttribute (fiMono.IsNotSerialized, fiMS.IsNotSerialized, "System.NonSerializedAttribute");
- AddFakeAttribute (fiMono.IsPinvokeImpl, fiMS.IsPinvokeImpl, "System.PInvokeImplAttribute");
-
- AddFlagWarning (fiMono.IsStatic, fiMS.IsStatic, "static");
- AddFlagWarning (fiMono.IsLiteral, fiMS.IsLiteral, "const");
- AddFlagWarning (fiMono.IsInitOnly, fiMS.IsInitOnly, "readonly");
-
- string strTypeMono = fiMono.FieldType.FullName;
- string strTypeMS = fiMS.FieldType.FullName;
- if (strTypeMono != strTypeMS)
- {
- Status.AddWarning ("Invalid type: is '"+strTypeMono+"', should be '"+strTypeMS+"'");
- }
-
- try
- {
- if (fiMono.IsStatic && fiMS.IsStatic &&
- fiMono.IsLiteral && fiMS.IsLiteral)
- {
- object objMono = fiMono.GetValue (null);
- object objMS = fiMS.GetValue (null);
- long lMono = Convert.ToInt64 (objMono);
- long lMS = Convert.ToInt64 (objMS);
-
- if (lMono != lMS)
- {
- string strValMono = ((lMono < 0) ? "-0x" : "0x") + lMono.ToString ("x");
- string strValMS = ((lMS < 0) ? "-0x" : "0x") + lMS.ToString ("x");
- Status.AddWarning ("Invalid value: is '"+strValMono+"', should be '"+strValMS+"'");
- }
- }
- }
- catch (Exception) {}
- }
- return m_nodeStatus;
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingInterface.cs b/mcs/tools/corcompare/MissingInterface.cs
deleted file mode 100644
index d4c274b61e6..00000000000
--- a/mcs/tools/corcompare/MissingInterface.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Mono.Util.CorCompare.MissingField
-//
-// Author(s):
-// Piers Haken (piersh@friskit.com)
-//
-// (C) 2002 Piers Haken
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare
-{
-
- /// <summary>
- /// Represents an interface implemented on a class
- /// </summary>
- /// <remarks>
- /// created by - Piers
- /// created on - 10:34 AM 3/12/2002
- /// </remarks>
- class MissingInterface : MissingBase
- {
- protected Type ifaceMono;
- protected Type ifaceMS;
-
- // e.g. <method name="Equals" status="missing"/>
- public MissingInterface (Type _ifaceMono, Type _ifaceMS)
- {
- ifaceMono = _ifaceMono;
- ifaceMS = _ifaceMS;
- m_nodeStatus = new NodeStatus (ifaceMono, ifaceMS);
- }
-
- public override string Type
- {
- get { return "interface"; }
- }
- public override string Name
- {
- get { return Interface.FullName; }
- }
- protected Type Interface
- {
- get { return (ifaceMono != null) ? ifaceMono : ifaceMS; }
- }
- public override NodeStatus Analyze ()
- {
- return m_nodeStatus;
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingMember.cs b/mcs/tools/corcompare/MissingMember.cs
deleted file mode 100644
index 2341c532b03..00000000000
--- a/mcs/tools/corcompare/MissingMember.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-using System;
-using System.Xml;
-using System.Reflection;
-using System.Collections;
-
-namespace Mono.Util.CorCompare
-{
-
- /// <summary>
- /// Represents a generic member that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Piersh
- /// created on - 3/1/2002 3:37:00 am
- /// </remarks>
- abstract class MissingMember : MissingBase
- {
- // e.g. <method name="Equals" status="missing"/>
- protected MemberInfo mInfoMono;
- protected MemberInfo mInfoMS;
-
- public MissingMember (MemberInfo infoMono, MemberInfo infoMS)
- {
- mInfoMono = infoMono;
- mInfoMS = infoMS;
- m_nodeStatus = new NodeStatus (infoMono, infoMS);
- }
-
- public override string Name
- {
- get { return Info.Name; }
- }
-
- public override NodeStatus Analyze ()
- {
- if (!Status.IsMissing)
- {
- rgAttributes = new ArrayList ();
- nsAttributes = MissingAttribute.AnalyzeAttributes (
- (mInfoMono == null) ? null : mInfoMono.GetCustomAttributes (false),
- (mInfoMS == null) ? null : mInfoMS.GetCustomAttributes (false),
- rgAttributes);
-
- if (mInfoMono != null && mInfoMS != null)
- {
- Accessibility acMono = GetAccessibility (mInfoMono);
- Accessibility acMS = GetAccessibility (mInfoMS);
- if (acMono != acMS)
- Status.AddWarning ("Should be "+AccessibilityToString (acMS));
- }
-
- m_nodeStatus.Add (nsAttributes);
- }
- return m_nodeStatus;
- }
-
- /// <summary>
- /// returns the MemberInfo for this member.
- /// if it's a missing member then the microsoft MemberInfo is returned instead
- /// </summary>
- public MemberInfo Info
- {
- get { return (mInfoMono != null) ? mInfoMono : mInfoMS; }
- }
-
- /// <summary>
- /// returns the 'best' info for this member. the 'best' info is the microsoft info, if it's available, otherwise the mono info.
- /// </summary>
- public MemberInfo BestInfo
- {
- get { return (mInfoMS != null) ? mInfoMS : mInfoMono; }
- }
-
- public static string GetUniqueName (MemberInfo mi)
- {
- return (mi.MemberType).ToString () + mi.ToString ();
- }
-
- public static Accessibility GetAccessibility (MemberInfo mi)
- {
- switch (mi.MemberType)
- {
- case MemberTypes.Constructor:
- case MemberTypes.Method:
- MethodBase mb = (MethodBase) mi;
- if (mb.IsPublic)
- return Accessibility.Public;
- else if (mb.IsAssembly)
- return Accessibility.Assembly;
- else if (mb.IsFamilyOrAssembly)
- return Accessibility.FamilyOrAssembly;
- else if (mb.IsFamily)
- return Accessibility.Family;
- else if (mb.IsFamilyAndAssembly)
- return Accessibility.FamilyAndAssembly;
- else if (mb.IsPrivate)
- return Accessibility.Private;
- break;
- case MemberTypes.Field:
- FieldInfo fi = (FieldInfo) mi;
- if (fi.IsPublic)
- return Accessibility.Public;
- else if (fi.IsAssembly)
- return Accessibility.Assembly;
- else if (fi.IsFamilyOrAssembly)
- return Accessibility.FamilyOrAssembly;
- else if (fi.IsFamily)
- return Accessibility.Family;
- else if (fi.IsFamilyAndAssembly)
- return Accessibility.FamilyAndAssembly;
- else if (fi.IsPrivate)
- return Accessibility.Private;
- break;
- case MemberTypes.NestedType:
- Type ti = (Type) mi;
- if (ti.IsNestedPublic)
- return Accessibility.Public;
- if (ti.IsNestedAssembly)
- return Accessibility.Assembly;
- else if (ti.IsNestedFamORAssem)
- return Accessibility.FamilyOrAssembly;
- else if (ti.IsNestedFamily)
- return Accessibility.Family;
- else if (ti.IsNestedFamANDAssem)
- return Accessibility.FamilyAndAssembly;
- else if (ti.IsNestedPrivate)
- return Accessibility.Private;
- break;
- case MemberTypes.Event:
- case MemberTypes.Property:
- return Accessibility.Public;
- default:
- throw new Exception ("Missing handler for MemberType: "+mi.MemberType.ToString ());
- }
- throw new Exception ("Invalid accessibility: "+mi.ToString ());
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingMethod.cs b/mcs/tools/corcompare/MissingMethod.cs
deleted file mode 100644
index 306bbb66e81..00000000000
--- a/mcs/tools/corcompare/MissingMethod.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Mono.Util.CorCompare.MissingMethod
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Text;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class method that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class MissingMethod : MissingMember
- {
- // e.g. <method name="Equals" status="missing"/>
- public MissingMethod (MemberInfo infoMono, MemberInfo infoMS) : base (infoMono, infoMS) {}
-
- public override string Name {
- get {
- string s = Info.ToString();
- int index = s.IndexOf(' ');
- return s.Substring(index + 1);
- }
- }
-
- public override string Type {
- get {
- return "method";
- }
- }
-
- public override NodeStatus Analyze ()
- {
- m_nodeStatus = base.Analyze ();
-
- if (mInfoMono != null && mInfoMS != null)
- {
- MethodBase miMono = (MethodBase) mInfoMono;
- MethodBase miMS = (MethodBase) mInfoMS;
-
- AddFlagWarning (miMono.IsAbstract, miMS.IsAbstract, "abstract");
- AddFlagWarning (miMono.IsStatic, miMS.IsStatic, "static");
- AddFlagWarning (miMono.IsVirtual && !miMono.IsFinal, miMS.IsVirtual && !miMS.IsFinal, "virtual");
- AddFlagWarning (miMono.IsConstructor, miMS.IsConstructor, "a constructor");
- //AddFlagWarning (miMono.IsFinal, miMS.IsFinal, "sealed");
- }
- return m_nodeStatus;
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingNameSpace.cs b/mcs/tools/corcompare/MissingNameSpace.cs
deleted file mode 100644
index b63168e0672..00000000000
--- a/mcs/tools/corcompare/MissingNameSpace.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-// Mono.Util.CorCompare.MissingNameSpace
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Collections;
-using System.Reflection;
-using System.Xml;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a namespace that has missing and/or MonoTODO classes.
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class MissingNameSpace : MissingBase
- {
- // e.g. <namespace name="System" missing="267" todo="453" complete="21">
- protected ArrayList rgTypesMono, rgTypesMS;
- string strNamespace;
- ArrayList rgTypes = new ArrayList ();
- protected static Hashtable htGhostTypes;
- static string[] rgstrGhostTypes = {"System.Object", "System.ValueType", "System.Delegate", "System.Enum"};
-
-
- static MissingNameSpace ()
- {
- htGhostTypes = new Hashtable ();
-
- foreach (string strGhostType in rgstrGhostTypes)
- {
- htGhostTypes.Add (strGhostType, null);
- }
- }
-
- public MissingNameSpace(string nameSpace, ArrayList _rgTypesMono, ArrayList _rgTypesMS)
- {
- strNamespace = nameSpace;
- rgTypesMono = _rgTypesMono;
- rgTypesMS = _rgTypesMS;
- m_nodeStatus = new NodeStatus (_rgTypesMono, _rgTypesMS);
- }
-
- public virtual string [] MissingTypeNames (bool f)
- {
- return null;
- }
-
- public virtual ArrayList ToDoTypeNames
- {
- get { return null; }
- }
-
- public override string Name
- {
- get { return strNamespace; }
- }
- public override string Type
- {
- get { return "namespace"; }
- }
-
-
- /// <summary>
- /// first we go through all the microsoft types adding any mono types that match, or missing types otherwise
- /// then we go through the unmatched mono types adding those
- /// uses a hashtable to speed up lookups
- /// </summary>
- /// <returns></returns>
- public override NodeStatus Analyze ()
- {
- Hashtable htMono = new Hashtable ();
- if (rgTypesMono != null)
- {
- foreach (Type t in rgTypesMono)
- {
- htMono.Add (t.FullName, t);
- }
- }
- if (rgTypesMS != null)
- {
- foreach (Type t in rgTypesMS)
- {
- Type tMono = (Type) htMono [t.FullName];
- MissingType mt = null;
- if (tMono == null)
- {
- if (t.IsPublic && !htGhostTypes.Contains (t.FullName))
- mt = new MissingType (null, t);
- }
- else
- {
- htMono.Remove (t.FullName);
- mt = new MissingType (tMono, t);
- }
- if (mt != null)
- {
- NodeStatus nsType = mt.Analyze ();
- m_nodeStatus.AddChildren (nsType);
- rgTypes.Add (mt);
- }
- }
- }
- // do any mono types that aren't in microsoft's namespace
- foreach (Type tMono in htMono.Values)
- {
- if (tMono.IsPublic)
- {
- MissingType tdt = new MissingType (tMono, null);
- NodeStatus nsType = tdt.Analyze ();
- m_nodeStatus.AddChildren (nsType);
- rgTypes.Add (tdt);
- }
- }
- return m_nodeStatus;
- }
-
- public override XmlElement CreateXML (XmlDocument doc)
- {
- XmlElement eltNameSpace = base.CreateXML (doc);
-
- // TODO: include complete namespaces?
-// if (m_nodeStatus.statusCountsTotal.cMissing > 0 || m_nodeStatus.statusCountsTotal.cTodo > 0)
- {
- XmlElement eltClasses = doc.CreateElement("classes");
- eltNameSpace.AppendChild (eltClasses);
-
- foreach (MissingType type in rgTypes)
- {
- XmlElement eltClass = type.CreateXML (doc);
- if (eltClass != null)
- eltClasses.AppendChild (eltClass);
- }
- }
- return eltNameSpace;
- }
-
-
- public static ArrayList GetNamespaces(Type[] types)
- {
- ArrayList nsList = new ArrayList();
- foreach (Type t in types)
- {
- if (!nsList.Contains(t.Namespace))
- {
- nsList.Add(t.Namespace);
- }
- }
- return nsList;
- }
- }
-}
-
diff --git a/mcs/tools/corcompare/MissingNestedType.cs b/mcs/tools/corcompare/MissingNestedType.cs
deleted file mode 100644
index a2bc3417005..00000000000
--- a/mcs/tools/corcompare/MissingNestedType.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-// Mono.Util.CorCompare.MissingNestedType
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a class event that is completely missing
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/24/2002 10:43:57 PM
- /// </remarks>
- class MissingNestedType : MissingMember {
- // e.g. <method name="Equals" status="missing"/>
- public MissingNestedType (MemberInfo infoMono, MemberInfo infoMS) : base (infoMono, infoMS) {}
-
- public override string Type {
- get {
- return "nestedType";
- }
- }
-
- public override string Name
- {
- get { return Info.DeclaringType.Name + "+" + Info.Name; }
- }
-
- }
-}
diff --git a/mcs/tools/corcompare/MissingProperty.cs b/mcs/tools/corcompare/MissingProperty.cs
deleted file mode 100644
index d3eb711d4fb..00000000000
--- a/mcs/tools/corcompare/MissingProperty.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-// Mono.Util.CorCompare.MissingProperty
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents a missing property from a class
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class MissingProperty : MissingMember
- {
- // e.g. <property name="Length" status="missing"/>
- public MissingProperty (MemberInfo infoMono, MemberInfo infoMS) : base (infoMono, infoMS) {}
-
- public override string Type
- {
- get { return "property"; }
- }
-
- protected MissingMethod mmGet;
- protected MissingMethod mmSet;
-
- public override NodeStatus Analyze ()
- {
- m_nodeStatus = base.Analyze ();
-
- PropertyInfo piMono = (PropertyInfo) mInfoMono;
- PropertyInfo piMS = (PropertyInfo) mInfoMS;
-
- MemberInfo miGetMono, miSetMono;
- if (piMono == null)
- miGetMono = miSetMono = null;
- else
- {
- miGetMono = piMono.GetGetMethod ();
- miSetMono = piMono.GetSetMethod ();
- }
-
- MemberInfo miGetMS, miSetMS;
- if (piMS == null)
- miGetMS = miSetMS = null;
- else
- {
- miGetMS = piMS.GetGetMethod ();
- miSetMS = piMS.GetSetMethod ();
- }
-
- if (miGetMono != null || miGetMS != null)
- {
- mmGet = new MissingMethod (miGetMono, miGetMS);
- m_nodeStatus.AddChildren (mmGet.Analyze ());
- }
- if (miSetMono != null || miSetMS != null)
- {
- mmSet = new MissingMethod (miSetMono, miSetMS);
- m_nodeStatus.AddChildren (mmSet.Analyze ());
- }
-
- if (piMono != null && piMS != null)
- {
- string strTypeMono = piMono.PropertyType.FullName;
- string strTypeMS = piMS.PropertyType.FullName;
- if (strTypeMono != strTypeMS)
- Status.AddWarning ("Invalid type: is '"+strTypeMono+"', should be '"+strTypeMS+"'");
- }
-
- return m_nodeStatus;
- }
-
- public override XmlElement CreateXML (XmlDocument doc)
- {
- XmlElement eltMember = base.CreateXML (doc);
-
- if (mInfoMono != null) // missing
- {
- if (mmGet != null || mmSet != null)
- {
- XmlElement eltAccessors = doc.CreateElement ("accessors");
- eltMember.AppendChild (eltAccessors);
-
- if (mmGet != null)
- {
- XmlElement eltGet = mmGet.CreateXML (doc);
- eltAccessors.AppendChild (eltGet);
- }
- if (mmSet != null)
- {
- XmlElement eltSet = mmSet.CreateXML (doc);
- eltAccessors.AppendChild (eltSet);
- }
- }
- }
- return eltMember;
- }
- }
-}
diff --git a/mcs/tools/corcompare/MissingType.cs b/mcs/tools/corcompare/MissingType.cs
deleted file mode 100644
index 013ec5503d3..00000000000
--- a/mcs/tools/corcompare/MissingType.cs
+++ /dev/null
@@ -1,493 +0,0 @@
-// Mono.Util.CorCompare.MissingType
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Xml;
-using System.Reflection;
-using System.Collections;
-
-namespace Mono.Util.CorCompare
-{
-
- /// <summary>
- /// Represents a class method that missing.
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class MissingType : MissingBase
- {
- // e.g. <class name="System.Byte" status="missing"/>
- // e.g. <class name="System.Array" status="todo" missing="5" todo="6" complete="45">
- Type typeMono, typeMS;
-// ArrayList rgAttributes = new ArrayList ();
- ArrayList rgMethods = new ArrayList ();
- ArrayList rgProperties = new ArrayList ();
- ArrayList rgEvents = new ArrayList ();
- ArrayList rgFields = new ArrayList ();
- ArrayList rgConstructors = new ArrayList ();
- ArrayList rgNestedTypes = new ArrayList ();
- ArrayList rgInterfaces = new ArrayList ();
-// NodeStatus nsAttributes = new NodeStatus ();
- NodeStatus nsMethods = new NodeStatus ();
- NodeStatus nsProperties = new NodeStatus ();
- NodeStatus nsEvents = new NodeStatus ();
- NodeStatus nsFields = new NodeStatus ();
- NodeStatus nsConstructors = new NodeStatus ();
- NodeStatus nsNestedTypes = new NodeStatus ();
- NodeStatus nsInterfaces = new NodeStatus ();
-
- public MissingType (Type _typeMono, Type _typeMS)
- {
- typeMono = _typeMono;
- typeMS = _typeMS;
- m_nodeStatus = new NodeStatus (_typeMono, _typeMS);
- }
-
- public override string Name
- {
- get
- {
- Type type = TypeInfoBest;
- if (type.DeclaringType != null)
- return type.DeclaringType.Name + "+" + type.Name;
- return type.Name;
- }
- }
-
- public override string Type
- {
- get
- {
- Type type = TypeInfo;
- if (type.IsEnum)
- return "enum";
- else if (type.IsInterface)
- return "interface";
- else if (type.IsValueType)
- return "struct";
- else if (IsDelegate)
- return "delegate";
- else
- return "class";
- }
- }
-
- public Type TypeInfo
- {
- get { return (typeMono != null) ? typeMono : typeMS; }
- }
-
- public Type TypeInfoBest
- {
- get { return (typeMS == null) ? typeMono : typeMS; }
- }
-
- public bool IsDelegate
- {
- get
- {
- Type typeBest = TypeInfoBest;
- if (typeBest.IsEnum || typeBest.IsInterface || typeBest.IsValueType)
- return false;
- Type type = typeBest.BaseType;
- while (type != null)
- {
- if (type.FullName == "System.Delegate")
- return true;
- type = type.BaseType;
- }
- return false;
- }
- }
-
- public MissingMember CreateMember (MemberInfo infoMono, MemberInfo infoMS)
- {
- MemberTypes mt = (infoMono != null) ? infoMono.MemberType : infoMS.MemberType;
- MissingMember mm;
- switch (mt)
- {
- case MemberTypes.Method:
- mm = new MissingMethod (infoMono, infoMS);
- break;
- case MemberTypes.Property:
- mm = new MissingProperty (infoMono, infoMS);
- break;
- case MemberTypes.Event:
- mm = new MissingEvent (infoMono, infoMS);
- break;
- case MemberTypes.Field:
- mm = new MissingField (infoMono, infoMS);
- break;
- case MemberTypes.Constructor:
- mm = new MissingConstructor (infoMono, infoMS);
- break;
- case MemberTypes.NestedType:
- mm = new MissingNestedType (infoMono, infoMS);
- break;
- default:
- throw new Exception ("Unexpected MemberType: " + mt.ToString());
- }
- mm.Analyze ();
- return mm;
- }
-
-
- public void AddMember (MissingMember mm)
- {
- switch (mm.Info.MemberType)
- {
- case MemberTypes.Method:
- nsMethods.AddChildren (mm.Status);
- rgMethods.Add (mm);
- break;
- case MemberTypes.Property:
- nsProperties.AddChildren (mm.Status);
- rgProperties.Add (mm);
- break;
- case MemberTypes.Event:
- nsEvents.AddChildren (mm.Status);
- rgEvents.Add (mm);
- break;
- case MemberTypes.Field:
- nsFields.AddChildren (mm.Status);
- rgFields.Add (mm);
- break;
- case MemberTypes.Constructor:
- nsConstructors.AddChildren (mm.Status);
- rgConstructors.Add (mm);
- break;
- case MemberTypes.NestedType:
- nsNestedTypes.AddChildren (mm.Status);
- rgNestedTypes.Add (mm);
- break;
- default:
- throw new Exception ("Unexpected MemberType: " + mm.Info.ToString());
- }
- }
-
- public void AddMember (MemberInfo infoMono, MemberInfo infoMS)
- {
- AddMember (CreateMember (infoMono, infoMS));
- }
-
- public override XmlElement CreateXML (XmlDocument doc)
- {
- XmlElement eltClass = base.CreateXML (doc);
- XmlElement eltMember;
-
- eltMember = MissingBase.CreateMemberCollectionElement ("methods", rgMethods, nsMethods, doc);
- if (eltMember != null)
- eltClass.AppendChild (eltMember);
-
- eltMember = MissingBase.CreateMemberCollectionElement ("properties", rgProperties, nsProperties, doc);
- if (eltMember != null)
- eltClass.AppendChild (eltMember);
-
- eltMember = MissingBase.CreateMemberCollectionElement ("events", rgEvents, nsEvents, doc);
- if (eltMember != null)
- eltClass.AppendChild (eltMember);
-
- eltMember = MissingBase.CreateMemberCollectionElement ("fields", rgFields, nsFields, doc);
- if (eltMember != null)
- eltClass.AppendChild (eltMember);
-
- eltMember = MissingBase.CreateMemberCollectionElement ("constructors", rgConstructors, nsConstructors, doc);
- if (eltMember != null)
- eltClass.AppendChild (eltMember);
-
- eltMember = MissingBase.CreateMemberCollectionElement ("nestedTypes", rgNestedTypes, nsNestedTypes, doc);
- if (eltMember != null)
- eltClass.AppendChild (eltMember);
-
- eltMember = MissingBase.CreateMemberCollectionElement ("interfaces", rgInterfaces, nsInterfaces, doc);
- if (eltMember != null)
- eltClass.AppendChild (eltMember);
-
- return eltClass;
- }
-
- public override NodeStatus Analyze ()
- {
- Hashtable htMono = new Hashtable ();
- if (typeMono != null)
- {
- ArrayList rgIgnoreMono = new ArrayList ();
- foreach (MemberInfo miMono in typeMono.GetMembers (BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
- {
- if (typeMono == miMono.DeclaringType)
- {
- string strName = MissingMember.GetUniqueName (miMono);
- htMono.Add (strName, miMono);
-
- // ignore any property/event accessors
- if (miMono.MemberType == MemberTypes.Property)
- {
- PropertyInfo pi = (PropertyInfo) miMono;
- MemberInfo miGet = pi.GetGetMethod ();
- if (miGet != null)
- rgIgnoreMono.Add (miGet);
- MemberInfo miSet = pi.GetSetMethod ();
- if (miSet != null)
- rgIgnoreMono.Add (miSet);
- }
- else if (miMono.MemberType == MemberTypes.Event)
- {
- EventInfo ei = (EventInfo) miMono;
- MemberInfo miAdd = ei.GetAddMethod ();
- if (miAdd != null)
- rgIgnoreMono.Add (miAdd);
- MemberInfo miRemove = ei.GetRemoveMethod ();
- if (miRemove != null)
- rgIgnoreMono.Add (miRemove);
- MemberInfo miRaise = ei.GetRaiseMethod ();
- if (miRaise != null)
- rgIgnoreMono.Add (miRaise);
- }
- }
- }
- foreach (MemberInfo miIgnore in rgIgnoreMono)
- htMono.Remove (MissingMember.GetUniqueName (miIgnore));
- }
- Hashtable htMethodsMS = new Hashtable ();
- if (typeMS != null)
- {
- ICollection colMembersMS = typeMS.GetMembers (BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
- Hashtable htIgnoreMS = new Hashtable ();
- foreach (MemberInfo miMS in colMembersMS)
- {
- // ignore any property/event accessors
- if (miMS.MemberType == MemberTypes.Property)
- {
- PropertyInfo pi = (PropertyInfo) miMS;
- MemberInfo miGet = pi.GetGetMethod ();
- if (miGet != null)
- htIgnoreMS.Add (miGet, miMS);
- MemberInfo miSet = pi.GetSetMethod ();
- if (miSet != null)
- htIgnoreMS.Add (miSet, miMS);
- }
- else if (miMS.MemberType == MemberTypes.Event)
- {
- EventInfo ei = (EventInfo) miMS;
- MemberInfo miAdd = ei.GetAddMethod ();
- if (miAdd != null)
- htIgnoreMS.Add (miAdd, miMS);
- MemberInfo miRemove = ei.GetRemoveMethod ();
- if (miRemove != null)
- htIgnoreMS.Add (miRemove, miMS);
- MemberInfo miRaise = ei.GetRaiseMethod ();
- if (miRaise != null)
- htIgnoreMS.Add (miRaise, miMS);
- }
- }
- foreach (MemberInfo miMS in colMembersMS)
- {
- if (miMS != null && miMS.DeclaringType == typeMS && !htIgnoreMS.Contains (miMS))
- {
- string strNameUnique = MissingMember.GetUniqueName (miMS);
- MemberInfo miMono = (MemberInfo) htMono [strNameUnique];
-
- MissingMember mm = CreateMember (miMono, miMS);
-
- bool fVisibleMS = IsVisible (miMS);
- if (miMono == null)
- {
- if (fVisibleMS)
- AddMember (mm);
- }
- else
- {
- if (miMono.MemberType != miMS.MemberType)
- {
- //AddMember (null, miMS);
- //MissingMember mm2 = CreateMember (miMono, null);
- //mm2.Status.AddWarning ("MemberType mismatch, is: '" + miMono.MemberType.ToString () + "' [should be: '" + miMS.MemberType.ToString ()+"']");
- //AddMember (mm2);
- mm.Status.AddWarning ("MemberType mismatch, is: '" + miMono.MemberType.ToString () + "' [should be: '" + miMS.MemberType.ToString ()+"']");
- AddMember (mm);
- }
- else if (fVisibleMS || IsVisible (miMono))
- {
- AddMember (mm);
- }
-
- htMono.Remove (strNameUnique);
- }
-
- switch (miMS.MemberType)
- {
- case MemberTypes.Method:
- {
- string strNameMSFull = miMS.ToString ();
- int ichMS = strNameMSFull.IndexOf (' ');
- string strNameMS = strNameMSFull.Substring (ichMS + 1);
- if (!htMethodsMS.Contains (strNameMS))
- htMethodsMS.Add (strNameMSFull.Substring (ichMS + 1), miMS);
- break;
- }
- }
- }
- }
- }
- foreach (MemberInfo miMono in htMono.Values)
- {
- if (IsVisible (miMono))
- {
- MissingMember mm = CreateMember (miMono, null);
- switch (miMono.MemberType)
- {
- case MemberTypes.Method:
- {
- string strNameMonoFull = miMono.ToString ();
- int ichMono = strNameMonoFull.IndexOf (' ');
- string strNameMono = strNameMonoFull.Substring (ichMono + 1);
- MemberInfo miMS = (MemberInfo) htMethodsMS [strNameMono];
- if (miMS != null)
- {
- string strNameMSFull = miMS.ToString ();
- int ichMS = strNameMSFull.IndexOf (' ');
- string strReturnTypeMS = strNameMSFull.Substring (0, ichMS);
- string strReturnTypeMono = strNameMonoFull.Substring (0, ichMono);
- mm.Status.AddWarning ("Return type mismatch, is: '"+strReturnTypeMono+"' [should be: '"+strReturnTypeMS+"']");
- //Console.WriteLine ("WARNING: Return type mismatch on "+miMS.DeclaringType.FullName+"."+strNameMono+", is: '"+strReturnTypeMono+"' [should be: '"+strReturnTypeMS+"']");
- }
- break;
- }
- }
- AddMember (mm);
- }
- }
-
- // compare the attributes
- rgAttributes = new ArrayList ();
- nsAttributes = MissingAttribute.AnalyzeAttributes (
- (typeMono == null) ? null : typeMono.GetCustomAttributes (false),
- ( typeMS == null) ? null : typeMS.GetCustomAttributes (false),
- rgAttributes);
-
- rgInterfaces = new ArrayList ();
- if (typeMono != null && typeMS != null)
- {
- // compare base types
- string strBaseMono = (typeMono.BaseType == null) ? null : typeMono.BaseType.FullName;
- string strBaseMS = ( typeMS.BaseType == null) ? null : typeMS.BaseType.FullName;
- if (strBaseMono != strBaseMS)
- {
- m_nodeStatus.AddWarning ("Base class mismatch, is '"+strBaseMono+"' [should be: '"+strBaseMS+"']");
- //Console.WriteLine ("WARNING: Base class mismatch on "+typeMono.FullName+", is: '"+strBaseMono+"' [should be: '"+strBaseMS+"']");
- }
-
- // compare the interfaces
- Hashtable htInterfacesMono = new Hashtable ();
- Type [] rgInterfacesMono = typeMono.GetInterfaces ();
- foreach (Type ifaceMono in rgInterfacesMono)
- {
- if (ifaceMono != null)
- {
- string strName = ifaceMono.FullName;
- htInterfacesMono.Add (strName, ifaceMono);
- }
- }
- Type [] rgInterfacesMS = typeMS.GetInterfaces ();
- foreach (Type ifaceMS in rgInterfacesMS)
- {
- if (ifaceMS != null)
- {
- string strName = ifaceMS.FullName;
- Type ifaceMono = (Type) htInterfacesMono [strName];
- MissingInterface mi = new MissingInterface (ifaceMono, ifaceMS);
- mi.Analyze ();
- rgInterfaces.Add (mi);
- if (ifaceMono != null)
- htInterfacesMono.Remove (strName);
- nsInterfaces.AddChildren (mi.Status);
- }
- }
- foreach (Type ifaceMono in htInterfacesMono.Values)
- {
- MissingInterface mi = new MissingInterface (ifaceMono, null);
- mi.Analyze ();
- rgInterfaces.Add (mi);
- //Console.WriteLine ("WARNING: additional interface on "+typeMono.FullName+": '"+ifaceMono.FullName+"'");
- nsInterfaces.AddChildren (mi.Status);
- }
-
- // serializable attribute
- AddFakeAttribute (typeMono.IsSerializable, typeMS.IsSerializable, "System.SerializableAttribute");
- AddFakeAttribute (typeMono.IsAutoLayout, typeMS.IsAutoLayout, "System.AutoLayoutAttribute");
- AddFakeAttribute (typeMono.IsExplicitLayout, typeMS.IsExplicitLayout, "System.ExplicitLayoutAttribute");
- AddFakeAttribute (typeMono.IsLayoutSequential, typeMS.IsLayoutSequential, "System.SequentialLayoutAttribute");
-
- Accessibility accessibilityMono = GetAccessibility (typeMono);
- Accessibility accessibilityMS = GetAccessibility (typeMS);
- if (accessibilityMono != accessibilityMS)
- m_nodeStatus.AddWarning ("Should be "+AccessibilityToString (accessibilityMono));
-
- AddFlagWarning (typeMono.IsSealed, typeMS.IsSealed, "sealed");
- AddFlagWarning (typeMono.IsAbstract, typeMS.IsAbstract, "abstract");
- }
-
- // sum up the sub-sections
- m_nodeStatus.Add (nsAttributes);
- m_nodeStatus.Add (nsMethods);
- m_nodeStatus.Add (nsProperties);
- m_nodeStatus.Add (nsEvents);
- m_nodeStatus.Add (nsFields);
- m_nodeStatus.Add (nsConstructors);
- m_nodeStatus.Add (nsNestedTypes);
- m_nodeStatus.Add (nsInterfaces);
-
- return m_nodeStatus;
- }
-
- static bool IsVisible (MemberInfo mi)
- {
- // this is just embarrasing, couldn't they have virtualized this?
- switch (mi.MemberType)
- {
- case MemberTypes.Constructor:
- case MemberTypes.Method:
- return !((MethodBase) mi).IsPrivate && !((MethodBase) mi).IsFamilyAndAssembly && !((MethodBase) mi).IsAssembly;
- case MemberTypes.Field:
- return !((FieldInfo) mi).IsPrivate && !((FieldInfo) mi).IsFamilyAndAssembly && !((FieldInfo) mi).IsAssembly;
- case MemberTypes.NestedType:
- return !((Type) mi).IsNestedPrivate;
- case MemberTypes.Property: // great, now we have to look at the methods
- PropertyInfo pi = (PropertyInfo) mi;
- MethodInfo miAccessor = pi.GetGetMethod ();
- if (miAccessor == null)
- miAccessor = pi.GetSetMethod ();
- if (miAccessor == null)
- return false;
- return IsVisible (miAccessor);
- case MemberTypes.Event: // ditto
- EventInfo ei = (EventInfo) mi;
- MethodInfo eiAccessor = ei.GetAddMethod ();
- if (eiAccessor == null)
- eiAccessor = ei.GetRemoveMethod ();
- if (eiAccessor == null)
- eiAccessor = ei.GetRaiseMethod ();
- if (eiAccessor == null)
- return false;
- return IsVisible (eiAccessor);
- default:
- throw new Exception ("Missing handler for MemberType: "+mi.MemberType.ToString ());
- }
- }
-
- static Accessibility GetAccessibility (Type type)
- {
- if (type.IsPublic)
- return Accessibility.Public;
- else if (type.IsNotPublic)
- return Accessibility.Private;
- return MissingMember.GetAccessibility (type);
- }
- }
-}
diff --git a/mcs/tools/corcompare/TODO b/mcs/tools/corcompare/TODO
deleted file mode 100644
index 355c8351eab..00000000000
--- a/mcs/tools/corcompare/TODO
+++ /dev/null
@@ -1,16 +0,0 @@
-TODO
-for CorCompare - 2002/02/25
-
- * The "methods" for a property's set and get are listed in the methods
- element. It would be cool to take them out of there and show that
- info in the property element, like "SomeProp{ get; set; } if it's missing
- both.
-
- * The constructors are just listed as ".ctor" which is not very verbose.
- What we really need here is the parameter list too, but I couldn't find
- a way to get the parameters for constructors, only methods.
-
- * Missing attributes on classes and members are not included at all.
-
- * Compare other assemblies besides corlib (then change name of
- the utility of course :) \ No newline at end of file
diff --git a/mcs/tools/corcompare/ToDoAssembly.cs b/mcs/tools/corcompare/ToDoAssembly.cs
deleted file mode 100644
index d95c0a42783..00000000000
--- a/mcs/tools/corcompare/ToDoAssembly.cs
+++ /dev/null
@@ -1,199 +0,0 @@
-// Mono.Util.CorCompare.ToDoAssembly
-//
-// Author(s):
-// Nick Drochak (ndrochak@gol.com)
-//
-// (C) 2001-2002 Nick Drochak
-
-using System;
-using System.Reflection;
-using System.Collections;
-using System.IO;
-using System.Text;
-using System.Xml;
-
-namespace Mono.Util.CorCompare {
-
- /// <summary>
- /// Represents an assembly that has missing or MonoTODO classes
- /// </summary>
- /// <remarks>
- /// created by - Nick
- /// created on - 2/20/2002 10:43:57 PM
- /// </remarks>
- class ToDoAssembly : MissingBase
- {
- // these types are in mono corlib, but not in the dll we are going to examine.
- ArrayList MissingTypes = new ArrayList();
- ArrayList rgNamespaces = new ArrayList();
- string strName;
- Assembly assMono;
- Assembly assMS;
- Type [] rgTypesMono;
- Type [] rgTypesMS;
-
- protected static Hashtable htGhostTypes;
- private static string[] rgstrGhostTypes = {"System.Object", "System.ValueType", "System.Delegate", "System.Enum"};
-
-
- static ToDoAssembly ()
- {
- htGhostTypes = new Hashtable ();
-
- foreach (string strGhostType in rgstrGhostTypes)
- {
- htGhostTypes.Add (strGhostType, null);
- }
- }
-
- public static ToDoAssembly Load (string strFileMono, string strName, string strNameMS)
- {
- Assembly assemblyMono = Assembly.LoadFrom (strFileMono);
- Assembly assemblyMS = Assembly.LoadWithPartialName (strNameMS);
-
- return new ToDoAssembly (strName, assemblyMono, assemblyMS);
- }
-
- public ToDoAssembly (string _strName, Assembly _assMono, Assembly _assMS)
- {
- strName = _strName;
- assMono = _assMono;
- assMS = _assMS;
-
- rgTypesMono = assMono.GetTypes ();
- rgTypesMS = assMS.GetTypes ();
- m_nodeStatus = new NodeStatus (_assMono, _assMS);
- }
-
- public override string Name {
- get {
- return strName;
- }
- }
-
- public override string Type
- {
- get { return "assembly"; }
- }
-
- private Hashtable GetNamespaceMap (Type [] rgTypes)
- {
- Hashtable mapTypes = new Hashtable ();
- foreach (Type t in rgTypes)
- {
- if (t != null)
- {
- string strName = t.FullName;
- string strNamespace = t.Namespace;
- if (strNamespace != null && strNamespace.Length > 0 &&
- strName != null && strName.Length > 0 &&
- !strNamespace.StartsWith ("Microsoft.") &&
- !htGhostTypes.Contains (strName))
- {
- ArrayList rgContainedTypes = (ArrayList) mapTypes [strNamespace];
- if (rgContainedTypes == null)
- {
- rgContainedTypes = new ArrayList ();
- mapTypes [strNamespace] = rgContainedTypes;
- }
- rgContainedTypes.Add (t);
- }
- }
- }
- return mapTypes;
- }
-
- public override NodeStatus Analyze ()
- {
- Hashtable mapTypesMono = GetNamespaceMap (rgTypesMono);
- Hashtable mapTypesMS = GetNamespaceMap (rgTypesMS);
-
- foreach (string strNamespaceMS in mapTypesMS.Keys)
- {
- if (strNamespaceMS != null)
- {
- ArrayList rgContainedTypesMS = (ArrayList) mapTypesMS [strNamespaceMS];
- ArrayList rgContainedTypesMono = (ArrayList) mapTypesMono [strNamespaceMS];
- MissingNameSpace mns = new MissingNameSpace (strNamespaceMS, rgContainedTypesMono, rgContainedTypesMS);
- NodeStatus nsNamespace = mns.Analyze ();
- m_nodeStatus.AddChildren (nsNamespace);
- if (rgTypesMono != null)
- mapTypesMono.Remove (strNamespaceMS);
- rgNamespaces.Add (mns);
- }
- }
- foreach (string strNamespaceMono in mapTypesMono.Keys)
- {
- if (strNamespaceMono != null)
- {
- ArrayList rgContainedTypesMono = (ArrayList) mapTypesMono [strNamespaceMono];
- MissingNameSpace mns = new MissingNameSpace (strNamespaceMono, rgContainedTypesMono, null);
- NodeStatus nsNamespace = mns.Analyze ();
- m_nodeStatus.AddChildren (nsNamespace);
- rgNamespaces.Add (mns);
- }
- }
-
- rgAttributes = new ArrayList ();
- NodeStatus nsAttributes = MissingAttribute.AnalyzeAttributes (
- assMono.GetCustomAttributes (true),
- assMS.GetCustomAttributes (true),
- rgAttributes);
- m_nodeStatus.Add (nsAttributes);
-
- return m_nodeStatus;
- }
-
-
- public string CreateClassListReport() {
- Analyze ();
- if (rgNamespaces.Count == 0) return "";
-
- StringBuilder output = new StringBuilder();
- foreach (MissingNameSpace ns in rgNamespaces)
- {
- string[] missingTypes = ns.MissingTypeNames(true);
- if (missingTypes != null && missingTypes.Length > 0) {
- string joinedNames = String.Join("\n", missingTypes);
- output.Append(joinedNames + "\n");
- }
- }
- return output.ToString();
- }
-
- public override XmlElement CreateXML (XmlDocument doc)
- {
- XmlElement assemblyElem = base.CreateXML (doc);
-
- if (rgNamespaces.Count > 0)
- {
- XmlElement eltNamespaces = doc.CreateElement ("namespaces");
- assemblyElem.AppendChild (eltNamespaces);
-
- foreach (MissingNameSpace ns in rgNamespaces)
- {
- XmlElement eltNameSpace = ns.CreateXML (doc);
- if (eltNameSpace != null)
- eltNamespaces.AppendChild (eltNameSpace);
- }
- }
- return assemblyElem;
- }
-
- public void CreateXMLReport(string filename) {
- Analyze();
-
- XmlDocument outDoc;
- outDoc = new XmlDocument();
- outDoc.AppendChild(outDoc.CreateXmlDeclaration("1.0", null, null));
-
- XmlElement assembliesElem = outDoc.CreateElement("assemblies");
- outDoc.AppendChild(assembliesElem);
-
- XmlElement assemblyElem = CreateXML (outDoc);
- assembliesElem.AppendChild(assemblyElem);
-
- outDoc.Save(filename);
- }
- }
-}
diff --git a/mcs/tools/corcompare/corcompare.build b/mcs/tools/corcompare/corcompare.build
deleted file mode 100644
index 111cd018363..00000000000
--- a/mcs/tools/corcompare/corcompare.build
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<project name="CorCompare" default="linux">
- <target name="linux">
- <csc target="exe" output="./CorCompare.exe" debug="true">
- <sources>
- <includes name="*.cs" />
- </sources>
- </csc>
- </target>
-
-</project>
diff --git a/mcs/tools/corcompare/cormissing.xsl b/mcs/tools/corcompare/cormissing.xsl
deleted file mode 100644
index a87c396354c..00000000000
--- a/mcs/tools/corcompare/cormissing.xsl
+++ /dev/null
@@ -1,424 +0,0 @@
-<?xml version="1.0" ?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
- <xsl:output method="html" indent="no"/>
- <!-- <xsl:output method="xml"/>-->
- <xsl:strip-space elements="*"/>
-
- <xsl:template match="/">
-<!--
- <HTML>
- <HEAD>
- <TITLE>
- Mono Class Library Status
- </TITLE>
- <SCRIPT src="cormissing.js"></SCRIPT>
- <LINK rel="stylesheet" type="text/css" href="cormissing.css"></LINK>
- </HEAD>
- <BODY onLoad="onLoad();">
- <P>
- <H1>Mono Class Library Status</H1>
- </P>
--->
- <P>
- <TABLE>
- <TR>
- <TD> <INPUT type="checkbox" ID="todo" onClick="selectTodo();" checked="1"/> </TD>
- <TD> <IMG src="cm/st.gif"/> </TD>
- <TD> TODO </TD>
- <TD width="20"/>
- <TD> <INPUT type="checkbox" ID="missing" onClick="selectMissing();" checked="1"/> </TD>
- <TD> <IMG src="cm/sm.gif"/> </TD>
- <TD> Missing </TD>
- </TR>
- <TR>
- <TD> <INPUT type="checkbox" ID="extra" onClick="selectExtra();" checked="1"/> </TD>
- <TD> <IMG src="cm/sx.gif"/> </TD>
- <TD> Extra </TD>
- <TD width="20"/>
- <TD> <INPUT type="checkbox" ID="errors" onClick="selectErrors();" checked="1"/> </TD>
- <TD> <IMG src="cm/se.gif"/> </TD>
- <TD> Errors </TD>
- </TR>
- <TR>
- <TD> </TD>
- <TD> <IMG src="cm/sc.gif"/> </TD>
- <TD> Completed </TD>
- </TR>
- </TABLE>
- </P>
- <DIV ID="ROOT">
- <xsl:apply-templates/>
- </DIV>
-<!--
- </BODY>
- </HTML>
--->
- </xsl:template>
-
-
-
- <!-- assembly -->
- <xsl:template match="/assemblies">
- <xsl:apply-templates select="assembly">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="assemblies/assembly[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">y</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- namespace -->
- <xsl:template match="assembly/namespaces">
- <xsl:apply-templates select="namespace">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="namespaces/namespace[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">n</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <xsl:template match="namespace/classes">
- <xsl:apply-templates select="interface">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="class">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="struct">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="delegate">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="enum">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <!-- class -->
- <xsl:template match="classes/class[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">c</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates select="attributes"/>
- <xsl:apply-templates select="interfaces"/>
- <xsl:apply-templates select="constructors"/>
- <xsl:apply-templates select="./*[local-name() != 'attributes' and local-name() != 'constructors' and local-name() != 'interfaces']"/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- struct -->
- <xsl:template match="classes/struct[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">s</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
-
- <!-- interface -->
- <xsl:template match="interfaces">
- <xsl:apply-templates select="interface">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="interface[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">i</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- delegate -->
- <xsl:template match="classes/delegate[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">d</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- enumeration -->
- <xsl:template match="classes/enum[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">en</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- method -->
- <xsl:template match="methods">
- <xsl:apply-templates select="method">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="methods/method[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">m</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- property -->
- <xsl:template match="properties">
- <xsl:apply-templates select="property">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="properties/property[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">p</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- event -->
- <xsl:template match="events">
- <xsl:apply-templates select="event">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="events/event[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">e</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- constructor -->
- <xsl:template match="constructors">
- <xsl:apply-templates select="constructor">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="constructors/constructor[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">x</xsl:with-param>
- <xsl:with-param name="image">m</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- field -->
- <xsl:template match="fields">
- <xsl:apply-templates select="field">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="fields/field[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">f</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
- <!-- accessor -->
- <xsl:template match="property/accessors">
- <xsl:apply-templates select="method">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="property[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]/accessors/method[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">o</xsl:with-param>
- <xsl:with-param name="image">m</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
- <!-- attribute -->
- <xsl:template match="attributes">
- <xsl:apply-templates select="attribute">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="attributes/attribute[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <DIV>
- <xsl:call-template name="ELEMENT">
- <xsl:with-param name="class">r</xsl:with-param>
- </xsl:call-template>
- <xsl:if test="not(@presence)">
- <xsl:apply-templates/>
- </xsl:if>
- </DIV>
- </xsl:template>
-
-
-
- <!-- support templates -->
-
- <xsl:template name="ELEMENT">
- <xsl:param name="class"/>
- <xsl:param name="image"/>
- <xsl:attribute name="class">
- <xsl:value-of select="$class"/>
- <xsl:if test="./node() and local-name() != 'assembly'">_</xsl:if>
- </xsl:attribute>
- <xsl:call-template name="toggle"/>
- <xsl:choose>
- <xsl:when test="@error != 'todo'">
- <xsl:element name="img">
- <xsl:attribute name="src">cm/se.gif</xsl:attribute>
- <xsl:attribute name="class">t</xsl:attribute>
- <xsl:attribute name="title"><xsl:apply-templates select="warnings/warning" mode="hover"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@error = 'todo'">
- <img src="cm/st.gif" class="t"/>
- </xsl:when>
- <xsl:when test="@presence = 'missing'">
- <img src="cm/sm.gif" class="t"/>
- </xsl:when>
- <xsl:when test="@presence = 'extra'">
- <img src="cm/sx.gif" class="t"/>
- </xsl:when>
- <xsl:otherwise>
- <img src="cm/sc.gif" class="t"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$image">
- <img src="cm/{$image}.gif" class="t"/>
- </xsl:when>
- <xsl:otherwise>
- <img src="cm/{$class}.gif" class="t"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="name"/>
- <xsl:if test="not(@presence)">
- <xsl:call-template name="status"/>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="status">
- <xsl:if test="@complete and @complete != 0">
- <SPAN class="st">
- <img src="cm/sc.gif"/>: <xsl:value-of select="@complete"/>%
- </SPAN>
- </xsl:if>
- <xsl:if test="@todo_total">
- <SPAN class="st">
- <img src="cm/st.gif"/>: <xsl:value-of select="@todo_total"/>
- </SPAN>
- </xsl:if>
- <xsl:if test="@missing_total">
- <SPAN class="st">
- <img src="cm/sm.gif"/>: <xsl:value-of select="@missing_total"/>
- </SPAN>
- </xsl:if>
- <xsl:if test="@extra_total">
- <SPAN class="st">
- <img src="cm/sx.gif"/>: <xsl:value-of select="@extra_total"/>
- </SPAN>
- </xsl:if>
- <xsl:if test="@warning_total">
- <SPAN class="st">
- <img src="cm/se.gif"/>: <xsl:value-of select="@warning_total"/>
- </SPAN>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="toggle">
- <xsl:choose>
- <xsl:when test="not(@presence) and .//*[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence] and local-name() != 'assembly'">
- <IMG src="cm/tp.gif" class="t"/>
- </xsl:when>
- <xsl:when test="not(@presence) and .//*[@missing_total or @todo_total or @extra_total or @warning_total or @error or @presence]">
- <IMG src="cm/tm.gif" class="t"/>
- </xsl:when>
- <xsl:otherwise>
- <IMG src="cm/tb.gif"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="name">
- <xsl:if test="@name">
- <SPAN class="l"><xsl:value-of select="@name"/></SPAN>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="warnings/warning" mode="hover"> WARNING: <xsl:value-of select="@text"/>
- </xsl:template>
-
-</xsl:stylesheet>
diff --git a/mcs/tools/corcompare/transform.js b/mcs/tools/corcompare/transform.js
deleted file mode 100644
index 9b23b3f6dea..00000000000
--- a/mcs/tools/corcompare/transform.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var xml = WScript.CreateObject ("MSXML2.DOMDocument");
-var xsl = WScript.CreateObject ("MSXML2.DOMDocument");
-
-xml.async = false;
-xsl.async = false;
-
-xml.load (WScript.Arguments (0));
-xsl.load (WScript.Arguments (1));
-
-WScript.Echo (xml.transformNode (xsl));
-
diff --git a/mcs/tools/ictool/Makefile b/mcs/tools/ictool/Makefile
deleted file mode 100644
index 27fae41ae61..00000000000
--- a/mcs/tools/ictool/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-CSC=csc.exe
-CSCFLAGS=/nologo /debug+ /debug:full
-
-all: ictool.exe
-
-ictool.exe: ictool.cs depgraph.cs peer.cs
- $(CSC) $(CSCFLAGS) /out:ictool.exe ictool.cs depgraph.cs peer.cs
-
-clean:
- rm -f *.exe *.pdb *.dll
diff --git a/mcs/tools/ictool/depgraph.cs b/mcs/tools/ictool/depgraph.cs
deleted file mode 100644
index 57e96ff3e9c..00000000000
--- a/mcs/tools/ictool/depgraph.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// file: depgraph.cs
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (C) 2002
-//
-
-using System;
-using System.Collections;
-
-class DependencyGraph {
- public DependencyGraph () {
- nodes = new Hashtable ();
- }
-
- public void AddNode (object o) {
- if (!nodes.Contains (o))
- nodes.Add (o, new Node (o));
- }
-
- public void AddEdge (object from, object to) {
- if (!nodes.Contains (from))
- AddNode (from);
- if (!nodes.Contains (to))
- AddNode (from);
-
- Node from_node = (Node)nodes[from];
- Node to_node = (Node)nodes[to];
-
- from_node.edges.Add (to_node);
- }
-
- public IList TopologicalSort () {
- foreach (Node node in nodes.Values)
- node.marked = false;
-
- IList list = new ArrayList ();
- foreach (Node node in nodes.Values) {
- if (!node.marked)
- Visit (node, list);
- }
-
- return list;
- }
-
- // private
-
- private void Visit (Node node, IList list) {
- node.marked = true;
- foreach (Node adj in node.edges) {
- if (!adj.marked)
- Visit (adj, list);
- }
-
- list.Insert (0, node.value);
- }
-
- private class Node {
- public Node (object o) {
- this.value = o;
- this.edges = new ArrayList ();
- }
-
- public object value;
- public ArrayList edges;
- public bool marked;
- }
-
- private Hashtable nodes;
-}
diff --git a/mcs/tools/ictool/ictool-config.xml b/mcs/tools/ictool/ictool-config.xml
deleted file mode 100644
index 9716dc6ee04..00000000000
--- a/mcs/tools/ictool/ictool-config.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<config>
- <!-- assembly inputs -->
-
- <assemblypath path="..\..\class\lib"/>
-
- <assembly file="corlib_cmp.dll"/>
- <assembly file="System.dll"/>
-
- <!-- output files -->
-
- <outputpath path="."/>
-
- <outputfile name="types" file="icall_types.h">
- <include><![CDATA[#include "icall.h"]]></include>
- </outputfile>
-
- <outputfile name="methods" file="icall_methods.h"/>
- <outputfile name="map" file="icall_map.c"/>
-
- <!-- typemap -->
-
- <typemap>
- <!-- base types -->
-
- <namespace name="System">
-
- <!-- default types are taken from the running assembly -->
-
- <type name="Object" peer="MonoObject" opaque="true" default="true"/>
-
- <type name="Void" peer="void" opaque="true" default="true"/>
- <type name="Boolean" peer="MonoBoolean" opaque="true" default="true"/>
- <type name="Int64" peer="gint64" opaque="true" default="true"/>
- <type name="Int32" peer="gint32" opaque="true" default="true"/>
- <type name="Int16" peer="gint16" opaque="true" default="true"/>
- <type name="Byte" peer="gint8" opaque="true" default="true"/>
- <type name="UInt64" peer="guint64" opaque="true" default="true"/>
- <type name="UInt32" peer="guint32" opaque="true" default="true"/>
- <type name="UInt16" peer="guint16" opaque="true" default="true"/>
- <type name="SByte" peer="guint8" opaque="true" default="true"/>
- <type name="IntPtr" peer="gpointer" opaque="true" default="true"/>
- <type name="UIntPtr" peer="gpointer" opaque="true" default="true"/>
- <type name="Single" peer="gfloat" opaque="true" default="true"/>
- <type name="Double" peer="gdouble" opaque="true" default="true"/>
- <type name="Char" peer="gunichar2" opaque="true" default="true"/>
- <type name="Array" peer="MonoArray" opaque="true" default="true"/>
-
- <!-- non-defaulting system types -->
-
- <type name="Decimal" peer="decimal_repr" opaque="true"/>
- <type name="String" peer="MonoString" opaque="true"/>
-
- </namespace>
-
- <!-- reflection types -->
-
- <namespace name="System">
- <type name="RuntimeTypeHandle" peer="MonoType *" opaque="true"/>
- <type name="RuntimeMethodHandle" peer="MonoMethod *" opaque="true"/>
- <type name="RuntimeFieldHandle" peer="MonoClassField *" opaque="true"/>
-
- <type name="Type" peer="MonoReflectionType"/>
- <type name="MonoTypeInfo" peer="MonoTypeInfo"/>
- <type name="MonoEnumInfo" peer="MonoEnumInfo"/>
- </namespace>
-
- <namespace name="System.Reflection">
- <type name="MonoMethod" peer="MonoReflectionMethod"/>
- <type name="MonoField" peer="MonoReflectionField"/>
- <type name="MonoFieldInfo" peer="MonoFieldInfo"/>
- <type name="MonoProperty" peer="MonoReflectionProperty"/>
- <type name="ParameterInfo" peer="MonoParameterInfo"/>
- <type name="MonoMethodInfo" peer="MonoMethodInfo"/>
- <type name="MonoPropertyInfo" peer="MonoPropertyInfo"/>
- <type name="Assembly" peer="MonoReflectionAssembly"/>
- <type name="Module" peer="MonoReflectionModule"/>
- <type name="AssemblyName" peer="MonoReflectionAssemblyName"/>
- </namespace>
-
- <namespace name="System.Reflection.Emit">
- <type name="ILGenerator" peer="MonoReflectionILGen"/>
- <type name="ILExceptionInfo" peer="MonoILExceptionInfo"/>
- <type name="ILExceptionBlock" peer="MonoILExceptionBlock"/>
- <type name="LocalBuilder" peer="MonoReflectionLocalBuilder"/>
- <type name="ParameterBuilder" peer="MonoReflectionParamBuilder"/>
- <type name="ConstructorBuilder" peer="MonoReflectionCtorBuilder"/>
- <type name="MethodBuilder" peer="MonoReflectionMethodBuilder"/>
- <type name="FieldBuilder" peer="MonoReflectionFieldBuilder"/>
- <type name="PropertyBuilder" peer="MonoReflectionPropertyBuilder"/>
- <type name="ModuleBuilder" peer="MonoReflectionModuleBuilder"/>
- <type name="TypeBuilder" peer="MonoReflectionTypeBuilder"/>
- <type name="Label" peer="MonoReflectionLabel"/>
- </namespace>
-
- <!-- enumerations -->
-
- <namespace name="System.Net.Sockets">
- <type name="SocketType" peer="MonoSocketType"/>
- <type name="AddressFamily" peer="MonoAddressFamily"/>
- <type name="ProtocolType" peer="MonoProtocolType"/>
- <type name="SocketOptionLevel" peer="MonoSocketOptionLevel"/>
- <type name="SocketOptionName" peer="MonoSocketOptionName"/>
- </namespace>
- </typemap>
-</config>
diff --git a/mcs/tools/ictool/ictool.cs b/mcs/tools/ictool/ictool.cs
deleted file mode 100644
index 9b4e0dd4472..00000000000
--- a/mcs/tools/ictool/ictool.cs
+++ /dev/null
@@ -1,428 +0,0 @@
-//
-// file: ictool.cs
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (C) 2002
-//
-// description:
-//
-// Tool for generating C prototypes and structures suitable for use by the runtime
-// from a list of supplied assemblies. See ictool-config.xml for configuration details.
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Reflection;
-using System.Collections;
-
-public class ICTool {
- public static void Main (string[] args) {
- string filename = "ictool-config.xml";
- if (args.Length == 1) {
- filename = args[0];
- }
- else if (args.Length > 1) {
- Console.Error.WriteLine ("Usage: ictool.exe [config.xml]");
- Environment.Exit (-1);
- }
-
- try {
- Stream config = File.OpenRead (filename);
- Configure (config);
- }
- catch (Exception e) {
- Console.Error.WriteLine ("Error: could not read configuration file.");
- Console.Error.WriteLine (e);
- Environment.Exit (-1);
- }
-
- EmitPrototypes ();
- EmitStructures ();
- }
-
- // private
-
- private static void EmitPrototypes () {
- StreamWriter methods_file = GetOutputFile ("methods");
- StreamWriter map_file = GetOutputFile ("map");
-
- // includes
-
- methods_file.WriteLine ("#include \"{0}\"\n", output_files["types"]);
- map_file.WriteLine ("#include \"{0}\"\n", output_files["methods"]);
-
- map_file.Write (
- "static gpointer icall_map [] = {\n\t"
- );
-
- ArrayList map_lines = new ArrayList ();
-
- BindingFlags binding =
- BindingFlags.DeclaredOnly |
- BindingFlags.Instance |
- BindingFlags.Static |
- BindingFlags.Public |
- BindingFlags.NonPublic;
-
- foreach (Type type in types.Values) {
- bool has_icall = false;
- MethodInfo[] methods = type.GetMethods (binding);
-
- foreach (MethodInfo method in methods) {
- if (IsInternalCall (method)) {
- has_icall = true;
- break;
- }
- }
-
- if (!has_icall)
- continue;
-
- methods_file.WriteLine ("\n/* {0} */\n", type.FullName);
- //map_lines.Add (String.Format ("\n/* {0} */\n", type.FullName));
-
- foreach (MethodInfo method in methods) {
- if (!IsInternalCall (method))
- continue;
-
- // function name
-
- string func_name = String.Format ("ves_icall_{0}_{1}",
-
- type.FullName,
- method.Name
- );
-
- func_name = func_name.Replace ('.', '_');
-
- // map file
-
- map_lines.Add (String.Format (
- "\"{0}::{1}\", {2}",
-
- type.FullName.Replace ('.', '_'),
- method.Name,
- func_name
- ));
-
- // methods file
-
- ArrayList args = new ArrayList ();
-
- // FIXME: return types that are structs need to be inserted
- // into the argument list as a destination pointer
-
- // object/value instance pointer
-
- if (IsInstanceMethod (method)) {
- args.Add (String.Format (
- "{0}{1}",
-
- peer_map.GetPeer (method.DeclaringType).GetTypedef (1),
- "this"
- ));
- }
-
- // arguments
-
- foreach (ParameterInfo param in method.GetParameters ()) {
- Type arg_type = param.ParameterType;
-
- int refs = 0;
- if (arg_type.IsByRef) {
- arg_type = arg_type.GetElementType ();
- ++ refs;
- }
-
- Peer arg_peer = peer_map.GetPeer (arg_type);
- if (!arg_peer.IsValueType)
- ++ refs;
-
- args.Add (String.Format ("{0}{1}", arg_peer.GetTypedef (refs), param.Name));
- }
-
- Peer ret = peer_map.GetPeer (method.ReturnType);
- methods_file.WriteLine ("static {0}", ret.GetTypedef (ret.IsValueType ? 0 : 1));
- methods_file.WriteLine ("{0} ({1});",
-
- func_name,
- Join (", ", args)
- );
- methods_file.WriteLine ();
- }
-
- }
-
- methods_file.Close ();
-
- // write map file and close it
-
- map_file.Write (
- "{0}\n}};\n", Join (",\n\t", map_lines)
- );
-
- map_file.Close ();
- }
-
- private static bool IsInternalCall (MethodInfo meth) {
- return (meth.GetMethodImplementationFlags () & MethodImplAttributes.InternalCall) != 0;
- }
-
- private static bool IsInstanceMethod (MethodInfo meth) {
- return (meth.CallingConvention & CallingConventions.HasThis) != 0;
- }
-
- private static void EmitStructures () {
- StreamWriter file = GetOutputFile ("types");
-
- // build dependency graph
-
- DependencyGraph dg = new DependencyGraph ();
- foreach (Peer peer in peer_map.Peers) {
- dg.AddNode (peer);
-
- // peer depends on nearest base
-
- if (peer.NearestBase != null)
- dg.AddEdge (peer.NearestBase, peer);
-
- // peer depends on any value types used for fields
-
- foreach (PeerField field in peer.Fields) {
- if (field.Peer.IsValueType)
- dg.AddEdge (field.Peer, peer);
- }
- }
-
- // write structures in order
-
- foreach (Peer peer in dg.TopologicalSort ()) {
- if (peer.IsOpaque)
- continue;
-
- if (peer.IsEnum) {
- file.WriteLine ("typedef {0} {1};", peer.UnderlyingPeer.Name, peer.Name);
- file.WriteLine ("enum _{0} {{", peer.Name);
-
- ArrayList enum_lines = new ArrayList ();
- foreach (string name in peer.EnumConstants.Keys) {
- enum_lines.Add (String.Format ("\t{0}_{1} = {2}",
- peer.Name,
- name,
- peer.EnumConstants[name]
- ));
- }
-
- file.WriteLine ("{0}\n}};\n", Join (",\n", enum_lines));
- }
- else {
- file.WriteLine ("typedef struct _{0} {{", peer.Name);
-
- // base type
-
- if (peer.NearestBase != null) {
- file.WriteLine ("\t{0} __base;", peer.NearestBase.Name);
- file.WriteLine ();
- }
-
- // fields
-
- foreach (PeerField field in peer.Fields) {
- bool use_struct = true;
- if (field.Peer.IsValueType || field.Peer.IsOpaque)
- use_struct = false;
-
- file.WriteLine ("\t{0}{1}{2};",
- use_struct ? "struct _" : "",
- field.Peer.GetTypedef (field.Peer.IsValueType ? 0 : 1),
- field.Name
- );
- }
-
- file.WriteLine ("}} {0};\n", peer.Name);
- }
- }
- }
-
- private static void LoadAssemblies () {
- types = new Hashtable ();
-
- foreach (string filename in assemblies) {
- Assembly assembly;
-
- // find assembly
-
- FileInfo info = null;
- foreach (string path in assembly_paths) {
- info = new FileInfo (Path.Combine (path, filename));
- if (info.Exists)
- break;
- }
-
- if (!info.Exists) {
- Console.Error.WriteLine ("Error: assembly {0} not found.", filename);
- Environment.Exit (-1);
- }
-
- // load assembly
-
- assembly = Assembly.LoadFrom (info.FullName);
-
- // load types
-
- ArrayList loaded_types;
-
- try {
- loaded_types = new ArrayList (assembly.GetTypes ());
- }
- catch (ReflectionTypeLoadException e) {
- loaded_types = new ArrayList ();
- foreach (Type type in e.Types) {
- if (type != null)
- loaded_types.Add (type);
- }
-
- foreach (Exception f in e.LoaderExceptions) {
- if (f is TypeLoadException) {
- Console.Error.WriteLine ("Warning: {0} could not be loaded from assembly {1}.",
- ((TypeLoadException)f).TypeName,
- filename
- );
- }
- else
- Console.Error.WriteLine (f);
- }
- }
-
- // add to type dictionary
-
- foreach (Type type in loaded_types) {
- if (!types.Contains (type.FullName))
- types.Add (type.FullName, type);
- }
- }
- }
-
- private static void Configure (Stream input) {
- XmlDocument doc = new XmlDocument ();
- doc.Load (input);
-
- // assemblies
-
- assembly_paths = new ArrayList ();
- assembly_paths.Add (".");
-
- foreach (XmlNode node in doc.SelectNodes ("config/assemblypath")) {
- assembly_paths.Add (node.Attributes["path"].Value);
- }
-
- assemblies = new ArrayList ();
- foreach (XmlNode node in doc.SelectNodes ("config/assembly")) {
- assemblies.Add (node.Attributes["file"].Value);
- }
-
- LoadAssemblies ();
-
- // outputfiles
-
- output_path = ".";
- XmlNode path_node = doc.SelectSingleNode ("config/outputpath");
- if (path_node != null)
- output_path = path_node.Attributes["path"].Value;
-
- output_files = new Hashtable ();
- output_includes = new Hashtable ();
- foreach (XmlNode node in doc.SelectNodes ("config/outputfile")) {
- string name = node.Attributes["name"].Value;
- output_files.Add (name, node.Attributes["file"].Value);
-
- foreach (XmlNode child in node.ChildNodes) {
- if (child.Name == "include")
- output_includes[name] = child.InnerText;
- }
- }
-
- // typemap
-
- peer_map = new PeerMap ();
- foreach (XmlNode node in doc.SelectNodes ("config/typemap/namespace")) {
- string ns = node.Attributes["name"].Value;
-
- foreach (XmlNode child in node.ChildNodes) {
- if (child.Name == "type") {
- string name = child.Attributes["name"].Value;
- string peer_name = child.Attributes["peer"].Value;
-
- bool opaque = false;
- if (child.Attributes["opaque"] != null && child.Attributes["opaque"].Value == "true")
- opaque = true;
-
- String fullname = String.Format ("{0}.{1}", ns, name);
-
- Type type;
- if (child.Attributes["default"] != null && child.Attributes["default"].Value == "true")
- type = Type.GetType (fullname);
- else
- type = (Type)types [fullname];
-
- if (type != null)
- peer_map.Add (new Peer (type, peer_name, opaque));
- }
- }
- }
-
- peer_map.ResolvePeers ();
- }
-
- private static StreamWriter GetOutputFile (string name) {
- string filename = Path.Combine (output_path, (string)output_files[name]);
- StreamWriter file = File.CreateText (filename);
- file.AutoFlush = true;
-
- file.Write (
-
-// (verbatim string)
-
-@"/**
- * {0}
- *
- * This file was automatically generated on {1} by ictool.exe from
- * the following assemblies:
- * {2}
- */
-
-",
-
- output_files[name],
- DateTime.Now.ToString ("d"),
- Join (", ", assemblies)
- );
-
- if (output_includes.Contains (name)) {
- file.WriteLine (output_includes [name]);
- file.WriteLine ();
- }
-
- return file;
- }
-
- private static string Join (string separator, ICollection values) {
- // note to microsoft: please implement this in String :)
-
- string[] strs = new string[values.Count];
-
- int i = 0;
- foreach (object value in values)
- strs[i ++] = value.ToString ();
-
- return String.Join (separator, strs);
- }
-
- private static ArrayList assembly_paths;
- private static ArrayList assemblies;
- private static string output_path;
- private static Hashtable output_files;
- private static Hashtable output_includes;
- private static PeerMap peer_map;
- private static Hashtable types;
-}
diff --git a/mcs/tools/ictool/peer.cs b/mcs/tools/ictool/peer.cs
deleted file mode 100644
index 6c3e0998f41..00000000000
--- a/mcs/tools/ictool/peer.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-//
-// file: peer.cs
-// author: Dan Lewis (dihlewis@yahoo.co.uk)
-// (C) 2002
-//
-
-using System;
-using System.Reflection;
-using System.Collections;
-
-class Peer {
- public Peer (Type clr_type, string name, bool is_opaque) {
- this.clr_type = clr_type;
- this.name = name;
- this.is_opaque = is_opaque;
-
- this.nearest_base = null; // resolve later
- this.underlying = null;
- this.enum_constants = null;
- this.fields = new PeerFieldCollection ();
-
- this.is_enum = CLRIsEnum (clr_type);
- this.is_value_type = CLRIsValueType (clr_type);
- }
-
- public string Name {
- get { return name; }
- }
-
- public Type CLRType {
- get { return clr_type; }
- }
-
- public bool IsOpaque {
- get { return is_opaque; }
- }
-
- public bool IsValueType {
- get { return is_value_type; }
- }
-
- public bool IsEnum {
- get { return is_enum; }
- }
-
- public Peer NearestBase {
- get { return nearest_base; }
- set { nearest_base = value; }
- }
-
- public Peer UnderlyingPeer {
- get { return underlying; }
- set { underlying = value; }
- }
-
- public IDictionary EnumConstants {
- get { return enum_constants; }
- set { enum_constants = value; }
- }
-
- public PeerFieldCollection Fields {
- get { return fields; }
- }
-
- public string GetTypedef (int refs) {
- if (refs == 0)
- return String.Format ("{0} ", name);
-
- return String.Format ("{0} {1}", name, new string ('*', refs));
- }
-
- // internal
-
- internal static bool CLRIsValueType (Type clr_type) {
- return clr_type.IsValueType;
- /*
- if (clr_type.BaseType == null)
- return false;
-
- return
- clr_type.BaseType.FullName == "System.ValueType" ||
- clr_type.BaseType.FullName == "System.Enum";
- */
- }
-
- internal static bool CLRIsEnum (Type clr_type) {
- return clr_type.IsEnum;
- /*
- if (clr_type.BaseType == null)
- return false;
-
- return clr_type.BaseType.FullName == "System.Enum";
- */
- }
-
- internal static Type CLRUnderlyingType (Type clr_type) {
- return Enum.GetUnderlyingType (clr_type);
- /*
- Type ebase = type.BaseType;
-
- return (Type)ebase.InvokeMember ("GetUnderlyingType",
- BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.Static,
- null, null,
- new object[] { type }
- );
- */
- }
-
- // private
-
- private Type clr_type;
- private bool is_opaque;
- private bool is_value_type;
- private bool is_enum;
-
- private string name;
- private Peer nearest_base;
- private Peer underlying;
- private IDictionary enum_constants;
- private PeerFieldCollection fields;
-}
-
-class PeerField {
- public PeerField (Peer peer, string name) {
- this.peer = peer;
- this.name = name;
- }
-
- public Peer Peer {
- get { return peer; }
- }
-
- public string Name {
- get { return name; }
- }
-
- private Peer peer;
- private string name;
-}
-
-class PeerFieldCollection : CollectionBase {
- public void Add (PeerField f) {
- List.Add (f);
- }
-
- public PeerField this[int i] {
- get { return (PeerField)List[i]; }
- }
-}
-
-class PeerMap {
- public PeerMap () {
- peers = new Hashtable ();
- }
-
- public void Add (Peer peer) {
- Add (peer.CLRType, peer);
- }
-
- public void Add (Type clr_type, Peer peer) {
- peers.Add (clr_type, peer);
- }
-
- public ICollection Peers {
- get { return peers.Values; }
- }
-
- public Peer this[Type clr_type] {
- get {
- if (peers.Contains (clr_type))
- return (Peer)peers[clr_type];
-
- return null;
- }
- }
-
- public Peer GetPeer (Type clr_type) {
- Peer peer;
-
- if (Peer.CLRIsValueType (clr_type)) {
- peer = this[clr_type];
- if (peer != null)
- return peer;
-
- if (Peer.CLRIsEnum (clr_type)) {
- peer = this[Peer.CLRUnderlyingType (clr_type)];
- if (peer != null)
- return peer;
-
- throw new ArgumentException ("Could not find peer or underlying peer for enum " + clr_type);
- }
- else
- throw new ArgumentException ("Could not find peer for value type " + clr_type);
- }
- else {
- Type type = clr_type;
- while (type != null) {
- peer = this[type];
- if (peer != null)
- return peer;
-
- type = type.BaseType;
- }
-
- throw new ArgumentException ("Could not find peer for class " + clr_type);
- }
- }
-
- public void ResolvePeers () {
- BindingFlags binding =
- BindingFlags.DeclaredOnly |
- BindingFlags.Instance |
- BindingFlags.NonPublic |
- BindingFlags.Public;
-
- // base type
-
- foreach (Peer peer in Peers) {
- if (peer.IsOpaque || peer.IsValueType || peer.CLRType.BaseType == null)
- continue;
-
- peer.NearestBase = GetPeer (peer.CLRType.BaseType);
- if (peer.NearestBase == null) {
- Console.Error.WriteLine ("Error: cannot find an internal base type for {0}.", peer.Name);
- Environment.Exit (-1);
- }
- }
-
- // fields
-
- foreach (Peer peer in Peers) {
- if (peer.IsOpaque || peer.IsEnum)
- continue;
-
- Type clr_base = null;
- if (peer.NearestBase != null)
- clr_base = peer.NearestBase.CLRType;
-
- Stack declared = new Stack ();
- Type type = peer.CLRType;
-
- while (type != clr_base) {
- declared.Push (type);
- type = type.BaseType;
- }
-
- // build declared field list
-
- while (declared.Count > 0) {
- type = (Type)declared.Pop ();
- foreach (FieldInfo info in type.GetFields (binding)) {
- PeerField field = new PeerField (
- GetPeer (info.FieldType),
- info.Name
- );
-
- peer.Fields.Add (field);
- }
- }
- }
-
- // enums
-
- foreach (Peer peer in Peers) {
- if (peer.IsOpaque || !peer.IsEnum)
- continue;
-
- Type clr_type = peer.CLRType;
-
- // constants
-
- Hashtable constants = new Hashtable ();
- foreach (string name in Enum.GetNames (clr_type))
- constants.Add (name, (int)Enum.Parse (clr_type, name));
-
- peer.UnderlyingPeer = GetPeer (Enum.GetUnderlyingType (clr_type));
- peer.EnumConstants = constants;
- }
- }
-
- // private
-
- private Hashtable peers;
-}
diff --git a/mcs/tools/makefile b/mcs/tools/makefile
deleted file mode 100644
index 79791c49c0a..00000000000
--- a/mcs/tools/makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-CSC=csc.exe
-CSCRIPT=$(WINDIR)/system32/cscript.exe
-CSCFLAGS=/nologo /debug+ /debug:full
-
-windows: linux
-
-linux: monostyle.exe verifier.exe GenerateDelegate.exe EnumCheck.exe IFaceDisco.exe ./corcompare/CorCompare.exe
-#linux: verifier.exe GenerateDelegate.exe EnumCheck.exe IFaceDisco.exe ./corcompare/CorCompare.exe update
-
-monostyle.exe: monostyle.cs
- $(CSC) $(CSCFLAGS) monostyle.cs
-
-GenerateDelegate.exe: GenerateDelegate.cs
- $(CSC) $(CSCFLAGS) /out:$@ $<
-
-verifier.exe: verifier.cs
- $(CSC) $(CSCFLAGS) verifier.cs
-
-./corcompare/CorCompare.exe: dummy
- (cd corcompare; make CorCompare.exe)
-
-update: ../../mono/doc/pending-classes
-
-cormissing.xml: ./corcompare/CorCompare.exe ../class/lib/corlib_cmp.dll
- ./corcompare/CorCompare.exe -x cormissing.xml -f corlib -ms mscorlib ../class/lib/corlib_cmp.dll
-
-../../mono/doc/pending-classes: ./corcompare/cormissing.xsl cormissing.xml
- $(CSCRIPT) /nologo ./corcompare/transform.js cormissing.xml ./corcompare/cormissing.xsl > ../../mono/doc/pending-classes
-
-
-EnumCheck: EnumCheck.exe
-
-EnumCheck.exe: EnumCheck.cs EnumCheckAssemblyCollection.cs
- $(CSC) $(CSCFLAGS) /out:EnumCheck.exe EnumCheck.cs EnumCheckAssemblyCollection.cs
-
-IFaceDisco.exe: IFaceDisco.cs XMLUtil.cs
- $(CSC) $(CSCFLAGS) /out:IFaceDisco.exe IFaceDisco.cs XMLUtil.cs
-
-clean:
- (cd corcompare; make clean)
- rm -f *.exe *.pdb *.dll
- rm -f cormissing.xml
- rm -f ../../mono/doc/pending-classes.in
-
-dummy:
diff --git a/mcs/tools/monostyle.cs b/mcs/tools/monostyle.cs
deleted file mode 100644
index 930700b130e..00000000000
--- a/mcs/tools/monostyle.cs
+++ /dev/null
@@ -1,366 +0,0 @@
-// monostyle.cs
-//
-// Adam Treat (manyoso@yahoo.com)
-// (C) 2002 Adam Treat
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-
-using System;
-using System.IO;
-using System.Text.RegularExpressions;
-using System.Collections.Specialized;
-
-namespace Mono.Util {
-
- class MonoStyle {
-
- string file;
- StringCollection filebuffer;
- bool linespace = true;
-
- void Usage()
- {
- Console.Write (
- "monostyle -f file.cs -l <true|false> > output.cs\n\n" +
- " -f || /-f || --file file.cs The csharp source file to parse.\n\n" +
- " -l || /-l || --line <true|false> Specifies wether to use line spacing.\n\n");
- }
-
- public static void Main (string[] args)
- {
- MonoStyle style = new MonoStyle(args);
- }
-
- public MonoStyle (string[] args)
- {
- int argc = args.Length;
- for(int i = 0; i < argc; i++) {
- string arg = args[i];
- // The "/" switch is there for wine users, like me ;-)
- if(arg.StartsWith("-") || arg.StartsWith("/")) {
- switch(arg) {
- case "-l": case "/-l": case "--line":
- if((i + 1) >= argc) {
- Usage();
- return;
- }
- if (args[i++] == "false") {
- linespace = false;
- }
- continue;
- case "-f": case "/-f": case "--file":
- if((i + 1) >= argc) {
- Usage();
- return;
- }
- file = args[++i];
- continue;
- default:
- Usage();
- return;
- }
- }
- }
- if(file == null) {
- Usage();
- return;
- }
- filebuffer = new StringCollection();
- StreamReader sr = new StreamReader(file);
- FillBuffer(sr);
- FixMonoStyle();
- PrintToConsole();
- }
-
- public void FillBuffer(StreamReader sr)
- {
- sr.BaseStream.Seek(0, SeekOrigin.Begin);
- while (sr.Peek() > -1) {
- filebuffer.Add(sr.ReadLine());
- }
- sr.Close();
- }
-
- public void FixMonoStyle()
- {
- for (int i=0; i < filebuffer.Count; i++) {
- IsBadMonoStyle(filebuffer[i]);
- }
- }
-
- public void PrintToConsole()
- {
- for (int i=0; i < filebuffer.Count; i++) {
- Console.WriteLine(filebuffer[i]);
- }
- }
-
- public void IsBadMonoStyle(String str)
- {
- if (IsBadMonoType(str)) {
- FixHangingBrace(str);
- } else if(IsBadMonoFlow(str)) {
- FixHangingBrace(str);
- } else if(IsBadMonoFunction(str)) {
- FixEndBrace(str);
- } else if(IsBadMonoProperty(str)) {
- FixHangingBrace(str);
- } else {
- }
- }
-
- public void FixHangingBrace(String str)
- {
- int strloc = filebuffer.IndexOf(str);
- int brcloc = FindHangingBrace(strloc);
- int diff = brcloc - strloc;
- if (brcloc > 0) {
- for (int i = 0; i < diff+1; i++) {
- filebuffer.RemoveAt(strloc);
- }
- filebuffer.Insert(strloc, str + " {");
- if (linespace) {
- filebuffer.Insert(strloc+1, "");
- }
- } else {}
- }
-
- public int FindHangingBrace(int strloc)
- {
- strloc++;
- bool found = false;
- while (!found) {
- try {
- string str = filebuffer[strloc++];
- found = IsHangingBrace(str);
- if (!found && !IsBlankLine(str)) {
- return -1;
- }
- } catch (Exception) {
- return -1;
- }
- }
- return strloc -1;
- }
-
- public void FixEndBrace(String str)
- {
- int strloc = filebuffer.IndexOf(str);
- filebuffer.RemoveAt(strloc);
- filebuffer.Insert(strloc, RemoveEndBrace(str));
- filebuffer.Insert(strloc+1, AddHangingBrace(str));
- }
-
- public static bool IsBadMonoType(String str)
- {
- if ( IsType(str) && !EndWithBrace(str)) {
- return true;
- } else {
- return false;
- }
- }
-
- public static bool IsBadMonoFlow(String str)
- {
- if (IsFlow(str) && !EndWithBrace(str)) {
- return true;
- } else {
- return false;
- }
- }
-
- public static bool IsBadMonoFunction(String str)
- {
- if (IsFunction(str) && EndWithBrace(str)) {
- return true;
- } else {
- return false;
- }
- }
-
- public static bool IsBadMonoProperty(String str)
- {
- if (IsProperty(str) && !EndWithBrace(str)) {
- return true;
- } else {
- return false;
- }
- }
-
- public static bool IsType(String str)
- {
- if ( !IsComment(str) && (
- IsNameSpace(str) ||
- IsClass(str) ||
- IsStruct(str) ||
- IsEnum(str) )) {
- return true;
- } else {
- return false;
- }
- }
-
- public static bool IsFlow(String str)
- {
- if ( !IsComment(str) && (
- IsIf(str) ||
- IsElse(str) ||
- IsElseIf(str) ||
- IsTry(str) ||
- IsCatch(str) ||
- IsFinally(str) ||
- IsFor(str) ||
- IsForEach(str) ||
- IsWhile(str) ||
- IsSwitch(str) ||
- IsCase(str) )) {
- return true;
- } else {
- return false;
- }
- }
-
- public static bool IsFunction(String str)
- {
- if ( Regex.IsMatch(str, @"^\s*(\w+)\s+(\w+).*\(+") &&
- !IsDeclaration(str) &&
- !IsComment(str) &&
- !IsType(str) &&
- !IsFlow(str) ) {
- return true;
- } else {
- return false;
- }
- }
-
- public static bool IsProperty(String str)
- {
- if ( Regex.IsMatch(str, @"^\s*(\w+)\s+(\w+).*") &&
- !IsDeclaration(str) &&
- !IsComment(str) &&
- !IsType(str) &&
- !IsFlow(str) &&
- !IsFunction(str) ) {
- return true;
- } else {
- return false;
- }
- }
-
- public static string RemoveEndBrace(String str)
- {
- Regex rg = new Regex(@"\{\s*$");
- return rg.Replace(str, "");
- }
-
- public static string AddHangingBrace(String str)
- {
- Regex rg = new Regex(@"\S+\s*");
- string blank = rg.Replace(str,"");
- return blank + "{";
- }
-
- public static bool IsDeclaration(String str)
- {
- return Regex.IsMatch(str, @"\;\s*$");
- }
-
- public static bool IsComment(String str)
- {
- return Regex.IsMatch(str, @"^(\s*\/+|\s*\*+|\s*\#+)");
- }
-
- public static bool EndWithBrace(String str)
- {
- return Regex.IsMatch(str, @"\{\s*$");
- }
-
- public static bool IsHangingBrace(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+)\{");
- }
-
- public static bool IsBlankLine(String str)
- {
- return Regex.IsMatch(str, @"^\s*$");
- }
-
- public static bool IsNameSpace(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+)namespace\s+");
- }
-
- public static bool IsClass(String str)
- {
- return Regex.IsMatch(str, @"\s+class\s+");
- }
-
- public static bool IsStruct(String str)
- {
- return Regex.IsMatch(str, @"\s+struct\s+");
- }
-
- public static bool IsEnum(String str)
- {
- return Regex.IsMatch(str, @"\s+enum\s+");
- }
-
- public static bool IsIf(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)if(\s+|\(+|$)");
- }
-
- public static bool IsElse(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)else(\s+|\{+|$)");
- }
-
- public static bool IsElseIf(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)else if(\s+|\(+|$)");
- }
-
- public static bool IsTry(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)try(\s+|\(+|$)");
- }
-
- public static bool IsCatch(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)catch(\s+|\(+|$)");
- }
-
- public static bool IsFinally(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)finally(\s+|\{+|$)");
- }
-
- public static bool IsFor(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)for(\s+|\(+|$)");
- }
-
- public static bool IsForEach(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)foreach(\s+|\(+|$)");
- }
-
- public static bool IsWhile(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)while(\s+|\(+|$)");
- }
-
- public static bool IsSwitch(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)switch(\s+|\(+|$)");
- }
-
- public static bool IsCase(String str)
- {
- return Regex.IsMatch(str, @"(^|\s+|\}+)case(\s+|\(+|$)");
- }
- }
-}
diff --git a/mcs/tools/sample_cast_const.cs b/mcs/tools/sample_cast_const.cs
deleted file mode 100755
index 04969312cde..00000000000
--- a/mcs/tools/sample_cast_const.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-
-class X {
- static void w (string s)
- {
- Console.WriteLine ("\t" + s);
- }
-
- static void Main ()
- {
- object [,] names =
- { { "Byte", "byte" },
- { "SByte", "sbyte" },
- { "Short", "short" },
- { "UShort", "ushort" },
- { "Int", "int32" },
- { "UInt", "uint32" },
- { "Long", "int64" },
- { "ULong", "uint64" },
- { "Float", "float" },
- { "Double", "double" },
- { null, null }
- };
-
- for (int i = 0; names [i,0] != null; i++){
- string big = names [i, 0] + "Constant";
- string small = "TypeManager." + names [i, 1] + "_type";
- string nat = ((string) names [i,0]).ToLower ();
-
- w ("\t\tif (expr is " + big + "){");
- w ("\t\t\t" + nat + " v = ((" + big + ") expr).Value;");
- w ("");
-
- for (int j = 0; names [j,0] != null; j++){
- string b = names [j, 0] + "Constant";
- string s = "TypeManager." + names [j, 1] + "_type";
- string n = ((string) names [j,0]).ToLower ();
-
- if (i == j)
- continue;
-
- w ("\t\t\tif (target_type == " + s + ")");
- w ("\t\t\t\treturn new " + b + " ((" + n + ") v);");
- }
- w ("\t\t}");
- }
- }
-}
-
diff --git a/mcs/tools/scan-tests.pl b/mcs/tools/scan-tests.pl
deleted file mode 100755
index 5cb0f8625f5..00000000000
--- a/mcs/tools/scan-tests.pl
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use Carp;
-
-my @allfiles;
-
-my @badsuites = qw[System\.Collections/HashtableTest System\.Collections/StackTest System\.Collections\.Specialized\.BasicOperationsTest];
-my @badtests = qw[PathTest:TestGetTempFileName XmlTextReaderTests:TestIsNameChar XmlTextReaderTests:TestIsFirstNameChar ByteTest:TestParse];
-my @mapfiles = ('s,^MonoTests\.(.*)/,$1/,',
- 's,^Ximian\.Mono\.Tests(.*)/,,',
- 's,^System\.Net/,,',
- 's,^Collections\.Specialized\.,,',
- 's,^Text\.RegularExpressions\.,,'
- );
-my @maptests = ();
-my @mapnamespace = ();
-
-die "Usage: $0 input output" unless $#ARGV == 1;
-
-my $namespace = 'MonoTests';
-
-sub parse_test {
- my ($filename, $namespace, $testname, $suite) = @_;
-
- foreach (@badsuites) {
- return if $filename =~ /$_/;
- }
-
- my $map;
- foreach $map (@mapfiles) {
- eval "\$filename =~ $map";
- }
-
- foreach (@allfiles) {
- return if $filename eq $_->[0];
- }
-
- # print STDERR "PARSE: |$filename|\n";
-
- push @allfiles, [$filename,$namespace,$testname,$suite,[]];
-
- my $INPUT;
- open $INPUT, $filename or croak "open ($filename): $!";
- while (defined ($_ = <$INPUT>)) {
- if (/^\s*namespace\s*([\w\.]+?)\s*$/) {
- $namespace = $1;
- next;
- }
- if (/^\s*suite\.AddTest\s*\((.*)\.(.*?)\.Suite\)/) {
- my $filename = (defined $namespace) ? qq[$namespace.$1/$2.cs] : qq[$1/$2.cs];
- my $nsprefix = (defined $namespace) ? qq[$namespace.$1] : qq[MonoTests.$1];
- parse_test ($filename, $nsprefix, $1, $2);
- next;
- }
- if (/^\s*suite\.AddTest\s*\((.*?)\.Suite\)/) {
- my $filename = (defined $namespace) ? qq[$namespace/$1.cs] : qq[$1.cs];
- parse_test ($filename, $namespace, '', $1);
- next;
- }
- if (/^\s*suite\.AddTest\s*\(\s*new\s+TestSuite\s*\(\s*typeof\(\s*(.*)\s*\)\s*\)\s*\);/) {
- my $filename = (defined $namespace) ? qq[$namespace/$1.cs] : qq[$1.cs];
- parse_test ($filename, $namespace, '', $1);
- next;
- }
- }
- close $INPUT;
-}
-
-parse_test ($ARGV[0], undef, '', '');
-
-my $file;
-foreach $file (@allfiles) {
- my ($filename,$namespace,$testname,$suite) = @$file;
-
- open SUITE, $filename or croak "open ($filename): $!";
- while (defined ($_ = <SUITE>)) {
- next unless /^\s*public\s+void\s+(Test.*?)\s*\(\s*\)/;
- push @{$file->[4]}, $1;
- }
- close SUITE;
-}
-
-open OUTPUT, "> $ARGV[1]" or croak "open (> $ARGV[1]): $!";
-select OUTPUT;
-
-print qq[using NUnit.Framework;\n];
-print qq[using System;\n];
-print qq[using System.Threading;\n];
-print qq[using System.Globalization;\n\n];
-
-
-my $alltest;
-foreach $alltest (@allfiles) {
-
- my ($filename,$namespace,$testname,$suite,$tests) = @$alltest;
- my @tests = @$tests;
-
- next unless defined $namespace;
- next unless $#tests >= 0;
-
- # print STDERR "DOING TEST: |$testname|$filename|\n";
-
- $namespace .= ".$testname" unless $testname eq '';
-
- print qq[namespace $namespace\n\{\n];
- print qq[\tpublic class Run$suite : $suite\n\t\{\n];
- print qq[\t\tprotected override void RunTest ()\n\t\t\{\n];
-# print qq[\t\t\tbool errorThrown = false;\n\n];
- my $test;
- testloop:
- foreach $test (@tests) {
- my $badtest;
- $filename =~ s/\.cs$//;
- my $fullname = qq[$filename:$test];
- # print STDERR "TEST: |$fullname|\n";
- foreach $badtest (@badtests) {
- next testloop if $fullname =~ /$badtest/;
- }
-# print qq[\t\t\ttry \{\n\t\t\t\t$test ();\n\t\t\t\} catch \{\n];
-# print qq[\t\t\t\tConsole.WriteLine ("$namespace:$suite:$test failed");\n];
-# print qq[\t\t\t\terrorThrown = true;\n];
-# print qq[\t\t\t\}\n];
- print qq[\t\t\t$test ();\n];
-# print qq[\t\t\tConsole.WriteLine ("$namespace:$suite:$test DONE");\n];
- }
- print qq[\n];
-# print qq[\t\t\tif (errorThrown)\n\t\t\t\tthrow new ArgumentException ();\n];
- print qq[\t\t\}\n\t\}\n];
- print qq[\}\n\n];
-}
-
-print qq[namespace $namespace\n\{\n];
-print qq[\tpublic class RunAllTests\n\t\{\n];
-print qq[\t\tpublic static void AddAllTests (TestSuite suite)\n];
-print qq[\t\t\{\n];
-
-foreach $alltest (@allfiles) {
- my ($filename,$namespace,$testname,$suite,$tests) = @$alltest;
- my @tests = @$tests;
-
- next unless defined $namespace;
- next unless $#tests >= 0;
-
- $namespace .= ".$testname" unless $testname eq '';
-
- print qq[\t\t\tsuite.AddTest (new $namespace.Run$suite ());\n];
-}
-
-print qq[\t\t\}\n\t\}\n\}\n\n];
-
-print qq[class MainApp\n\{\n];
-print qq[\tpublic static void Main()\n\t\{\n];
-print qq[\t\tThread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");\n\n];
-print qq[\t\tTestResult result = new TestResult ();\n];
-print qq[\t\tTestSuite suite = new TestSuite ();\n];
-print qq[\t\t$namespace.RunAllTests.AddAllTests (suite);\n];
-print qq[\t\tsuite.Run (result);\n];
-print qq[\t\tMonoTests.MyTestRunner.Print (result);\n];
-print qq[\t\}\n\}\n\n];
-
-close OUTPUT;
-
diff --git a/mcs/tools/serialize.cs b/mcs/tools/serialize.cs
deleted file mode 100755
index 01b83f83b87..00000000000
--- a/mcs/tools/serialize.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-//
-// Serialize.cs
-//
-// This program creates a SerializationInfo and requests an object
-// to serialize itself.
-//
-// We serialize because we need to know the *exact* names that are
-// used for the values being serialized.
-//
-// Author: Miguel de Icaza
-// Duncan Mak
-//
-// (C) Ximian, Inc.
-//
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Formatters.Soap;
-using System.IO;
-
-namespace Mono.Serialize {
- class Driver {
- static object StaticCreateObject ()
- {
- //
- // Change the object type here.
- //
- return null;
- }
-
- static object LiveCreateObject (Type obj, Type[] types, string[] values)
- {
- if (types.Length != values.Length)
- throw new ArgumentException ();
-
- object[] a = new object [types.Length];
-
- for (int i = 0; i < a.Length; i++)
- a [i] = Convert.ChangeType (values [i], types [i]);
-
- return Activator.CreateInstance (obj, a);
- }
-
- static void Main (string[] args)
- {
- object x = null;
- string strTypes = null;
- string argValues = null;
-
- if (args.Length == 1) {
- Type t = Type.GetType (args[0]);
- Console.WriteLine ("\nPlease enter the arguments to the constructor for type {0}", t.ToString());
- strTypes = Console.ReadLine ();
- Console.WriteLine ("\nPlease enter the values");
- argValues = Console.ReadLine ();
- Type[] types = ToTypeArray (strTypes.Split (','));
- string[] param = argValues.Split (',');
-
- x = LiveCreateObject (t, types, param);
- } else {
- x = StaticCreateObject ();
- }
-
- string fileName = x.GetType().FullName + ".xml";
- Stream output = new FileStream (fileName, FileMode.Create,
- FileAccess.Write, FileShare.None);
- IFormatter formatter = new SoapFormatter ();
-
- formatter.Serialize ((Stream) output, x);
- output.Close ();
- }
-
- public static Type[] ToTypeArray (string[] strTypes)
- {
- Type[] t = new Type [strTypes.Length];
-
- for (int i = 0; i < strTypes.Length; i++)
- t [i] = StringToType (strTypes [i]);
- return t;
- }
-
- public static Type StringToType (string s)
- {
- switch (s) {
- case "bool":
- return typeof (System.Boolean);
- break;
- case "byte":
- return typeof (System.Byte);
- break;
- case "sbyte":
- return typeof (System.SByte);
- break;
- case "char":
- return typeof (System.Char);
- break;
- case "decimal":
- return typeof (System.Decimal);
- break;
- case "double":
- return typeof (System.Double);
- break;
- case "float":
- return typeof (System.Single);
- break;
- case "int":
- return typeof (System.Int32);
- break;
- case "uint":
- return typeof (System.UInt32);
- break;
- case "long":
- return typeof (System.Int64);
- break;
- case "ulong":
- return typeof (System.UInt64);
- break;
- case "object":
- return typeof (System.Object);
- break;
- case "short":
- return typeof (System.Int16);
- break;
- case "ushort":
- return typeof (System.UInt16);
- break;
- case "string":
- return typeof (System.String);
- break;
- default:
- return Type.GetType (s);
- break;
- }
- }
- }
-}
diff --git a/mcs/tools/verifier.cs b/mcs/tools/verifier.cs
deleted file mode 100644
index 25268147b26..00000000000
--- a/mcs/tools/verifier.cs
+++ /dev/null
@@ -1,1587 +0,0 @@
-//
-// verifier.cs: compares two assemblies and reports differences.
-//
-// Author:
-// Sergey Chaban (serge@wildwestsoftware.com)
-//
-// (C) Sergey Chaban (serge@wildwestsoftware.com)
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Reflection;
-
-namespace Mono.Verifier {
-
-
-
- ////////////////////////////////
- // Collections
- ////////////////////////////////
-
- public abstract class MemberCollection : IEnumerable {
-
- public delegate MemberInfo [] InfoQuery (Type type, BindingFlags bindings);
- public delegate bool MemberComparer (MemberInfo mi1, MemberInfo mi2);
-
- protected SortedList list;
- protected MemberComparer comparer;
-
- protected BindingFlags bindings;
-
- protected MemberCollection (Type type, InfoQuery query, MemberComparer comparer, BindingFlags bindings)
- {
- if (query == null)
- throw new NullReferenceException ("Invalid query delegate.");
-
- if (comparer == null)
- throw new NullReferenceException ("Invalid comparer.");
-
- this.comparer = comparer;
- this.bindings = bindings;
-
- this.list = new SortedList ();
-
- MemberInfo [] data = query (type, bindings);
- foreach (MemberInfo info in data) {
- this.list [info.Name] = info;
- }
- }
-
-
-
- public MemberInfo this [string name] {
- get {
- return list [name] as MemberInfo;
- }
- }
-
-
- public override int GetHashCode ()
- {
- return list.GetHashCode ();
- }
-
-
- public override bool Equals (object o)
- {
- bool res = (o is MemberCollection);
- if (res) {
- MemberCollection another = o as MemberCollection;
- IEnumerator it = GetEnumerator ();
- while (it.MoveNext () && res) {
- MemberInfo inf1 = it.Current as MemberInfo;
- MemberInfo inf2 = another [inf1.Name];
- res &= comparer (inf1, inf2);
- }
- }
- return res;
- }
-
-
-
- public static bool operator == (MemberCollection c1, MemberCollection c2)
- {
- return c1.Equals (c2);
- }
-
- public static bool operator != (MemberCollection c1, MemberCollection c2)
- {
- return !(c1 == c2);
- }
-
-
-
- public IEnumerator GetEnumerator()
- {
- return new Iterator (this);
- }
-
-
- internal class Iterator : IEnumerator {
- private MemberCollection host;
- private int pos;
-
- internal Iterator (MemberCollection host)
- {
- this.host=host;
- this.Reset ();
- }
-
- /// <summary></summary>
- public object Current
- {
- get {
- if (host != null && pos >=0 && pos < host.list.Count) {
- return host.list.GetByIndex (pos);
- } else {
- return null;
- }
- }
- }
-
- /// <summary></summary>
- public bool MoveNext ()
- {
- if (host!=null) {
- return (++pos) < host.list.Count;
- } else {
- return false;
- }
- }
-
- /// <summary></summary>
- public void Reset ()
- {
- this.pos = -1;
- }
- }
-
- }
-
-
-
-
- //--- Method collections
-
- /// <summary>
- /// Abstract collection of class' methods.
- /// </summary>
- public abstract class MethodCollectionBase : MemberCollection {
-
-
- protected MethodCollectionBase (Type type, BindingFlags bindings)
- : base (type, new InfoQuery (Query), new MemberComparer (Comparer), bindings)
- {
- }
-
-
- private static MemberInfo [] Query (Type type, BindingFlags bindings)
- {
- // returns MethodInfo []
- return type.GetMethods (bindings);
- }
-
- private static bool Comparer (MemberInfo mi1, MemberInfo mi2)
- {
- bool res = false;
- if (mi1 is MethodInfo && (mi2 == null || mi2 is MethodInfo)) {
- MethodInfo inf1 = mi1 as MethodInfo;
- MethodInfo inf2 = mi2 as MethodInfo;
- res = Compare.Methods (inf1, inf2);
- } else {
- Verifier.log.Write ("internal-error", "Wrong comparer arguments.", ImportanceLevel.HIGH);
- }
- return res;
- }
- }
-
-
-
- /// <summary>
- /// Collection of public instance methods of a class.
- /// </summary>
- public class PublicMethods : MethodCollectionBase {
-
- public PublicMethods (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Instance)
- {
- }
- }
-
- /// <summary>
- /// Collection of public static methods of a class.
- /// </summary>
- public class PublicStaticMethods : MethodCollectionBase {
-
- public PublicStaticMethods (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Static)
- {
- }
- }
-
- /// <summary>
- /// Collection of non-public instance methods of a class.
- /// </summary>
- public class NonPublicMethods : MethodCollectionBase {
-
- public NonPublicMethods (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Instance)
- {
- }
- }
-
- /// <summary>
- /// Collection of non-public static methods of a class.
- /// </summary>
- public class NonPublicStaticMethods : MethodCollectionBase {
-
- public NonPublicStaticMethods (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Static)
- {
- }
- }
-
-
-
-
-
- //--- Field collections
-
- public abstract class FieldCollectionBase : MemberCollection {
-
-
- protected FieldCollectionBase (Type type, BindingFlags bindings)
- : base (type, new InfoQuery (Query), new MemberComparer (Comparer), bindings)
- {
- }
-
-
- private static MemberInfo [] Query (Type type, BindingFlags bindings)
- {
- // returns FieldInfo []
- return type.GetFields (bindings);
- }
-
- private static bool Comparer (MemberInfo mi1, MemberInfo mi2)
- {
- bool res = false;
- if (mi1 is FieldInfo && (mi2 == null || mi2 is FieldInfo)) {
- FieldInfo inf1 = mi1 as FieldInfo;
- FieldInfo inf2 = mi2 as FieldInfo;
- res = Compare.Fields (inf1, inf2);
- } else {
- Verifier.log.Write ("internal-error", "Wrong comparer arguments.", ImportanceLevel.HIGH);
- }
- return res;
- }
- }
-
-
- public class PublicFields : FieldCollectionBase {
-
- public PublicFields (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Instance)
- {
- }
- }
-
- public class PublicStaticFields : FieldCollectionBase {
-
- public PublicStaticFields (Type type)
- : base (type, BindingFlags.Public | BindingFlags.Static)
- {
- }
- }
-
- public class NonPublicFields : FieldCollectionBase {
-
- public NonPublicFields (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Instance)
- {
- }
- }
-
- public class NonPublicStaticFields : FieldCollectionBase {
-
- public NonPublicStaticFields (Type type)
- : base (type, BindingFlags.NonPublic | BindingFlags.Static)
- {
- }
- }
-
-
-
-
-
- public abstract class AbstractTypeStuff {
- public readonly Type type;
-
- public AbstractTypeStuff (Type type)
- {
- if (type == null)
- throw new NullReferenceException ("Invalid type.");
-
- this.type = type;
- }
-
- public override int GetHashCode ()
- {
- return type.GetHashCode ();
- }
-
- public static bool operator == (AbstractTypeStuff t1, AbstractTypeStuff t2)
- {
- if ((t1 as object) == null) {
- if ((t2 as object) == null) return true;
- return false;
- }
- return t1.Equals (t2);
- }
-
- public static bool operator != (AbstractTypeStuff t1, AbstractTypeStuff t2)
- {
- return !(t1 == t2);
- }
-
- public override bool Equals (object o)
- {
- return (o is AbstractTypeStuff && CompareTypes (o as AbstractTypeStuff));
- }
-
- protected virtual bool CompareTypes (AbstractTypeStuff that)
- {
- Verifier.Log.Write ("info", "Comparing types.", ImportanceLevel.LOW);
- bool res;
-
- res = Compare.Types (this.type, that.type);
-
- return res;
- }
-
- }
-
-
-
-
- /// <summary>
- /// Represents a class.
- /// </summary>
- public class ClassStuff : AbstractTypeStuff {
-
- public PublicMethods publicMethods;
- public PublicStaticMethods publicStaticMethods;
- public NonPublicMethods nonpublicMethods;
- public NonPublicStaticMethods nonpublicStaticMethods;
-
- public PublicFields publicFields;
- public PublicStaticFields publicStaticFields;
- public NonPublicFields nonpublicFields;
- public NonPublicStaticFields nonpublicStaticFields;
-
- public ClassStuff (Type type) : base (type)
- {
- publicMethods = new PublicMethods (type);
- publicStaticMethods = new PublicStaticMethods (type);
- nonpublicMethods = new NonPublicMethods (type);
- nonpublicStaticMethods = new NonPublicStaticMethods (type);
-
- publicFields = new PublicFields (type);
- publicStaticFields = new PublicStaticFields (type);
- nonpublicFields = new NonPublicFields (type);
- nonpublicStaticFields = new NonPublicStaticFields (type);
- }
-
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- private bool CompareMethods (ClassStuff that)
- {
- bool res = true;
- bool ok;
-
- Verifier.Log.Write ("info", "Comparing public instance methods.", ImportanceLevel.LOW);
- ok = (this.publicMethods == that.publicMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing public static methods.", ImportanceLevel.LOW);
- ok = (this.publicStaticMethods == that.publicStaticMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public instance methods.", ImportanceLevel.LOW);
- ok = (this.nonpublicMethods == that.nonpublicMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public static methods.", ImportanceLevel.LOW);
- ok = (this.nonpublicStaticMethods == that.nonpublicStaticMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- return res;
- }
-
-
- private bool CompareFields (ClassStuff that)
- {
- bool res = true;
- bool ok;
-
- Verifier.Log.Write ("info", "Comparing public instance fields.", ImportanceLevel.LOW);
- ok = (this.publicFields == that.publicFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing public static fields.", ImportanceLevel.LOW);
- ok = (this.publicStaticFields == that.publicStaticFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public instance fields.", ImportanceLevel.LOW);
- ok = (this.nonpublicFields == that.nonpublicFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing non-public static fields.", ImportanceLevel.LOW);
- ok = (this.nonpublicStaticFields == that.nonpublicStaticFields);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- return res;
- }
-
-
- public override bool Equals (object o)
- {
- bool res = (o is ClassStuff);
- if (res) {
- ClassStuff that = o as ClassStuff;
-
- res &= this.CompareTypes (that);
- if (!res && Verifier.stopOnError) return res;
-
- res &= this.CompareMethods (that);
- if (!res && Verifier.stopOnError) return res;
-
- res &= this.CompareFields (that);
- if (!res && Verifier.stopOnError) return res;
-
- }
- return res;
- }
-
- }
-
-
-
- /// <summary>
- /// Represents an interface.
- /// </summary>
- public class InterfaceStuff : AbstractTypeStuff {
-
- public PublicMethods publicMethods;
-
- public InterfaceStuff (Type type) : base (type)
- {
- publicMethods = new PublicMethods (type);
- }
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- public override bool Equals (object o)
- {
- bool res = (o is InterfaceStuff);
- if (res) {
- bool ok;
- InterfaceStuff that = o as InterfaceStuff;
-
- res = this.CompareTypes (that);
- if (!res && Verifier.stopOnError) return res;
-
- Verifier.Log.Write ("info", "Comparing interface methods.", ImportanceLevel.LOW);
- ok = (this.publicMethods == that.publicMethods);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
- }
- return res;
- }
-
- }
-
-
-
- /// <summary>
- /// Represents an enumeration.
- /// </summary>
- public class EnumStuff : AbstractTypeStuff {
-
- //public FieldInfo [] members;
-
- public string baseType;
- public Hashtable enumTable;
- public bool isFlags;
-
- public EnumStuff (Type type) : base (type)
- {
- //members = type.GetFields (BindingFlags.Public | BindingFlags.Static);
-
- Array values = Enum.GetValues (type);
- Array names = Enum.GetNames (type);
-
- baseType = Enum.GetUnderlyingType (type).Name;
-
- enumTable = new Hashtable ();
-
- object [] attrs = type.GetCustomAttributes (false);
- isFlags = (attrs != null && attrs.Length > 0);
- if (isFlags) {
- foreach (object attr in attrs) {
- isFlags |= (attr is FlagsAttribute);
- }
- }
-
- int indx = 0;
- foreach (string id in names) {
- enumTable [id] = Convert.ToInt64(values.GetValue(indx) as Enum);
- ++indx;
- }
- }
-
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-
- public override bool Equals (object o)
- {
- bool res = (o is EnumStuff);
- bool ok;
-
- if (res) {
- EnumStuff that = o as EnumStuff;
- ok = this.CompareTypes (that);
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
- ok = (this.baseType == that.baseType);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error",
- String.Format ("Underlying types mismatch [{0}, {1}].", this.baseType, that.baseType),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- Verifier.Log.Write ("info", "Comparing [Flags] attribute.");
- ok = !(this.isFlags ^ that.isFlags);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error",
- String.Format ("[Flags] attribute mismatch ({0} : {1}).", this.isFlags ? "Yes" : "No", that.isFlags ? "Yes" : "No"),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- Verifier.Log.Write ("info", "Comparing enum values.");
-
- ICollection names = enumTable.Keys;
- foreach (string id in names) {
- ok = that.enumTable.ContainsKey (id);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error", String.Format("{0} absent in enumeration.", id),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- if (ok) {
- long val1 = (long) this.enumTable [id];
- long val2 = (long) that.enumTable [id];
- ok = (val1 == val2);
- res &= ok;
- if (!ok) {
- Verifier.log.Write ("error",
- String.Format ("Enum values mismatch [{0}: {1} != {2}].", id, val1, val2),
- ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
- }
- }
- }
- return res;
- }
- }
-
-
-
- public sealed class TypeArray {
- public static readonly TypeArray empty = new TypeArray (Type.EmptyTypes);
-
- public Type [] types;
-
- public TypeArray (Type [] types)
- {
- this.types = new Type [types.Length];
- for (int i = 0; i < types.Length; i++) {
- this.types.SetValue (types.GetValue (i), i);
- }
- }
- }
-
-
-
- public class AssemblyLoader {
- public delegate void Hook (TypeArray assemblyTypes);
-
- private static Hashtable cache;
-
- private Hook hook;
-
- static AssemblyLoader ()
- {
- cache = new Hashtable (11);
- }
-
- public AssemblyLoader (Hook hook)
- {
- if (hook == null)
- throw new NullReferenceException ("Invalid loader hook.");
-
- this.hook = hook;
- }
-
-
- public bool LoadFrom (string assemblyName)
- {
- bool res = false;
- try {
- TypeArray types = TypeArray.empty;
-
- lock (cache) {
- if (cache.Contains (assemblyName)) {
- types = (cache [assemblyName] as TypeArray);
- if (types == null) types = TypeArray.empty;
- } else {
- Assembly asm = Assembly.LoadFrom (assemblyName);
- Type [] allTypes = asm.GetTypes ();
- if (allTypes == null) allTypes = Type.EmptyTypes;
- types = new TypeArray (allTypes);
- cache [assemblyName] = types;
- }
- }
- hook (types);
- res = true;
- } catch (ReflectionTypeLoadException rtle) {
- // FIXME: Should we try to recover? Use loaded portion of types.
- Type [] loaded = rtle.Types;
- for (int i = 0, xCnt = 0; i < loaded.Length; i++) {
- if (loaded [i] == null) {
- Verifier.log.Write ("fatal error",
- String.Format ("Unable to load {0}, reason - {1}", loaded [i], rtle.LoaderExceptions [xCnt++]),
- ImportanceLevel.LOW);
- }
- }
- } catch (FileNotFoundException fnfe) {
- Verifier.log.Write ("fatal error", fnfe.ToString (), ImportanceLevel.LOW);
- } catch (Exception x) {
- Verifier.log.Write ("fatal error", x.ToString (), ImportanceLevel.LOW);
- }
-
- return res;
- }
-
- }
-
-
-
-
- public abstract class AbstractTypeCollection : SortedList {
-
- private AssemblyLoader loader;
-
- public AbstractTypeCollection ()
- {
- loader = new AssemblyLoader (new AssemblyLoader.Hook (LoaderHook));
- }
-
- public AbstractTypeCollection (string assemblyName) : this ()
- {
- LoadFrom (assemblyName);
- }
-
- public abstract void LoaderHook (TypeArray types);
-
-
- public bool LoadFrom (string assemblyName)
- {
- return loader.LoadFrom (assemblyName);
- }
-
- }
-
-
-
- public class ClassCollection : AbstractTypeCollection {
-
- public ClassCollection () : base ()
- {
- }
-
- public ClassCollection (string assemblyName)
- : base (assemblyName)
- {
- }
-
-
- public override void LoaderHook (TypeArray types)
- {
- foreach (Type type in types.types) {
- if (type.IsClass) {
- this [type.FullName] = new ClassStuff (type);
- }
- }
- }
-
- }
-
-
- public class InterfaceCollection : AbstractTypeCollection {
-
- public InterfaceCollection () : base ()
- {
- }
-
- public InterfaceCollection (string assemblyName)
- : base (assemblyName)
- {
- }
-
-
- public override void LoaderHook (TypeArray types)
- {
- foreach (Type type in types.types) {
- if (type.IsInterface) {
- this [type.FullName] = new InterfaceStuff (type);
- }
- }
- }
-
- }
-
-
-
- public class EnumCollection : AbstractTypeCollection {
-
- public EnumCollection () : base ()
- {
- }
-
- public EnumCollection (string assemblyName)
- : base (assemblyName)
- {
- }
-
- public override void LoaderHook (TypeArray types)
- {
- foreach (Type type in types.types) {
- if (type.IsEnum) {
- this [type.FullName] = new EnumStuff (type);
- }
- }
- }
- }
-
-
-
- public class AssemblyStuff {
-
- public string name;
- public bool valid;
-
- public ClassCollection classes;
- public InterfaceCollection interfaces;
- public EnumCollection enums;
-
-
- protected delegate bool Comparer (AssemblyStuff asm1, AssemblyStuff asm2);
- private static ArrayList comparers;
-
- static AssemblyStuff ()
- {
- comparers = new ArrayList ();
- comparers.Add (new Comparer (CompareNumClasses));
- comparers.Add (new Comparer (CompareNumInterfaces));
- comparers.Add (new Comparer (CompareClasses));
- comparers.Add (new Comparer (CompareInterfaces));
- comparers.Add (new Comparer (CompareEnums));
- }
-
- protected static bool CompareNumClasses (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = (asm1.classes.Count == asm2.classes.Count);
- if (!res) Verifier.Log.Write ("error", "Number of classes mismatch.", ImportanceLevel.MEDIUM);
- return res;
- }
-
- protected static bool CompareNumInterfaces (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = (asm1.interfaces.Count == asm2.interfaces.Count);
- if (!res) Verifier.Log.Write ("error", "Number of interfaces mismatch.", ImportanceLevel.MEDIUM);
- return res;
- }
-
-
- protected static bool CompareClasses (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = true;
- Verifier.Log.Write ("info", "Comparing classes.");
-
- foreach (DictionaryEntry c in asm1.classes) {
- string className = c.Key as string;
-
- if (Verifier.Excluded.Contains (className)) {
- Verifier.Log.Write ("info", String.Format ("Ignoring class {0}.", className), ImportanceLevel.MEDIUM);
- continue;
- }
-
- Verifier.Log.Write ("class", className);
-
- ClassStuff class1 = c.Value as ClassStuff;
- ClassStuff class2 = asm2.classes [className] as ClassStuff;
-
- if (class2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such class in {0}", asm2.name));
- res = false;
- if (Verifier.stopOnError || !Verifier.ignoreMissingTypes) return res;
- continue;
- }
-
- res &= (class1 == class2);
- if (!res && Verifier.stopOnError) return res;
- }
-
- return res;
- }
-
-
- protected static bool CompareInterfaces (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = true;
- Verifier.Log.Write ("info", "Comparing interfaces.");
-
- foreach (DictionaryEntry ifc in asm1.interfaces) {
- string ifcName = ifc.Key as string;
- Verifier.Log.Write ("interface", ifcName);
-
- InterfaceStuff ifc1 = ifc.Value as InterfaceStuff;
- InterfaceStuff ifc2 = asm2.interfaces [ifcName] as InterfaceStuff;
-
- if (ifc2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such interface in {0}", asm2.name));
- res = false;
- if (Verifier.stopOnError || !Verifier.ignoreMissingTypes) return res;
- continue;
- }
-
- res &= (ifc1 == ifc2);
- if (!res && Verifier.stopOnError) return res;
-
- }
-
- return res;
- }
-
-
- protected static bool CompareEnums (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- bool res = true;
- Verifier.Log.Write ("info", "Comparing enums.");
-
- foreach (DictionaryEntry e in asm1.enums) {
- string enumName = e.Key as string;
- Verifier.Log.Write ("enum", enumName);
-
- EnumStuff e1 = e.Value as EnumStuff;
- EnumStuff e2 = asm2.enums [enumName] as EnumStuff;
-
- if (e2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such enum in {0}", asm2.name));
- res = false;
- if (Verifier.stopOnError || !Verifier.ignoreMissingTypes) return res;
- continue;
- }
- res &= (e1 == e2);
- if (!res && Verifier.stopOnError) return res;
- }
-
- return res;
- }
-
-
-
- public AssemblyStuff (string assemblyName)
- {
- this.name = assemblyName;
- valid = false;
- }
-
- public bool Load ()
- {
- bool res = true;
- bool ok;
-
- classes = new ClassCollection ();
- ok = classes.LoadFrom (name);
- res &= ok;
- if (!ok) Verifier.log.Write ("error", String.Format ("Unable to load classes from {0}.", name), ImportanceLevel.HIGH);
-
- interfaces = new InterfaceCollection ();
- ok = interfaces.LoadFrom (name);
- res &= ok;
- if (!ok) Verifier.log.Write ("error", String.Format ("Unable to load interfaces from {0}.", name), ImportanceLevel.HIGH);
-
- enums = new EnumCollection ();
- ok = enums.LoadFrom (name);
- res &= ok;
- if (!ok) Verifier.log.Write ("error", String.Format ("Unable to load enums from {0}.", name), ImportanceLevel.HIGH);
-
- valid = res;
- return res;
- }
-
-
- public override bool Equals (object o)
- {
- bool res = (o is AssemblyStuff);
- if (res) {
- AssemblyStuff that = o as AssemblyStuff;
- IEnumerator it = comparers.GetEnumerator ();
- while ((res || !Verifier.stopOnError) && it.MoveNext ()) {
- Comparer compare = it.Current as Comparer;
- res &= compare (this, that);
- }
- }
- return res;
- }
-
-
- public static bool operator == (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- return asm1.Equals (asm2);
- }
-
- public static bool operator != (AssemblyStuff asm1, AssemblyStuff asm2)
- {
- return !(asm1 == asm2);
- }
-
- public override int GetHashCode ()
- {
- return classes.GetHashCode () ^ interfaces.GetHashCode ();
- }
-
-
- public override string ToString ()
- {
- string res;
- if (valid) {
- res = String.Format ("Asssembly {0}, valid, {1} classes, {2} interfaces, {3} enums.",
- name, classes.Count, interfaces.Count, enums.Count);
- } else {
- res = String.Format ("Asssembly {0}, invalid.", name);
- }
- return res;
- }
-
- }
-
-
-
-
- ////////////////////////////////
- // Compare
- ////////////////////////////////
-
- public sealed class Compare {
-
- private Compare ()
- {
- }
-
-
- public static bool Parameters (ParameterInfo[] params1, ParameterInfo[] params2)
- {
- bool res = true;
- if (params1.Length != params2.Length) {
- Verifier.Log.Write ("Parameter count mismatch.");
- return false;
- }
-
- int count = params1.Length;
-
- for (int i = 0; i < count && res; i++) {
- if (params1 [i].Name != params2 [i].Name) {
- Verifier.Log.Write ("error", String.Format ("Parameters names mismatch {0}, {1}.", params1 [i].Name, params2 [i].Name));
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- Verifier.Log.Write ("parameter", params1 [i].Name);
-
- if (!Compare.Types (params1 [i].ParameterType, params2 [i].ParameterType)) {
- Verifier.Log.Write ("error", String.Format ("Parameters types mismatch {0}, {1}.", params1 [i].ParameterType, params2 [i].ParameterType));
- res = false;
- if (Verifier.stopOnError) break;
- }
-
-
- if (Verifier.checkOptionalFlags) {
- if (params1 [i].IsIn != params2 [i].IsIn) {
- Verifier.Log.Write ("error", "[in] mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- if (params1 [i].IsOut != params2 [i].IsOut) {
- Verifier.Log.Write ("error", "[out] mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- if (params1 [i].IsRetval != params2 [i].IsRetval) {
- Verifier.Log.Write ("error", "[ref] mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- if (params1 [i].IsOptional != params2 [i].IsOptional) {
- Verifier.Log.Write ("error", "Optional flag mismatch.");
- res = false;
- if (Verifier.stopOnError) break;
- }
-
- } // checkOptionalFlags
-
-
- }
-
- return res;
- }
-
-
-
- public static bool Methods (MethodInfo mi1, MethodInfo mi2)
- {
-
- if (mi2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such method {0}.", mi1.Name), ImportanceLevel.MEDIUM);
- return false;
- }
-
-
- Verifier.Log.Flush ();
- Verifier.Log.Write ("method", String.Format ("{0}.", mi1.Name));
- bool res = true;
- bool ok;
- string expected;
-
- ok = Compare.Types (mi1.ReturnType, mi2.ReturnType);
- res &= ok;
- if (!ok) {
- Verifier.Log.Write ("error", "Return types mismatch.", ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
-
- ok = (mi1.IsAbstract == mi2.IsAbstract);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsAbstract) ? "abstract" : "non-abstract";
- Verifier.Log.Write ("error", String.Format ("Expected to be {0}.", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (mi1.IsVirtual == mi2.IsVirtual);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsVirtual) ? "virtual" : "non-virtual";
- Verifier.Log.Write ("error", String.Format ("Expected to be {0}.", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (mi1.IsFinal == mi2.IsFinal);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsFinal) ? "final" : "overridable";
- Verifier.Log.Write ("error", String.Format ("Expected to be {0}.", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
- // compare access modifiers
-
- ok = (mi1.IsPrivate == mi2.IsPrivate);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsPublic) ? "public" : "private";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
- ok = (mi1.IsFamily == mi2.IsFamily);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsFamily) ? "protected" : "!protected";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (mi1.IsAssembly == mi2.IsAssembly);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsAssembly) ? "internal" : "!internal";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
- ok = (mi1.IsStatic == mi2.IsStatic);
- res &= ok;
- if (!ok) {
- expected = (mi1.IsStatic) ? "static" : "instance";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
- // parameters
-
- ok = Compare.Parameters (mi1.GetParameters (), mi2.GetParameters ());
- res &= ok;
- if (!ok && Verifier.stopOnError) return res;
-
-
- ok = (mi1.CallingConvention == mi2.CallingConvention);
- res &= ok;
- if (!ok) {
- Verifier.Log.Write ("error", "Calling conventions mismatch.", ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
-
-
-
- return res;
- }
-
-
- public static bool Fields (FieldInfo fi1, FieldInfo fi2)
- {
- if (fi2 == null) {
- Verifier.Log.Write ("error", String.Format ("There is no such field {0}.", fi1.Name), ImportanceLevel.MEDIUM);
- return false;
- }
-
- bool res = true;
- bool ok;
- string expected;
-
- Verifier.Log.Write ("field", String.Format ("{0}.", fi1.Name));
-
- ok = (fi1.IsPrivate == fi2.IsPrivate);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsPublic) ? "public" : "private";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsFamily == fi2.IsFamily);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsFamily) ? "protected" : "!protected";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsAssembly == fi2.IsAssembly);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsAssembly) ? "internal" : "!internal";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsInitOnly == fi2.IsInitOnly);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsInitOnly) ? "readonly" : "!readonly";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- ok = (fi1.IsStatic == fi2.IsStatic);
- res &= ok;
- if (!ok) {
- expected = (fi1.IsStatic) ? "static" : "instance";
- Verifier.Log.Write ("error", String.Format ("Accessibility levels mismatch (expected [{0}]).", expected), ImportanceLevel.MEDIUM);
- if (Verifier.stopOnError) return res;
- }
-
- return res;
- }
-
-
-
- public static bool Types (Type type1, Type type2)
- {
- // NOTE:
- // simply calling type1.Equals (type2) won't work,
- // types are in different assemblies hence they have
- // different (fully-qualified) names.
- int eqFlags = 0;
- eqFlags |= (type1.IsAbstract == type2.IsAbstract) ? 0 : 0x001;
- eqFlags |= (type1.IsClass == type2.IsClass) ? 0 : 0x002;
- eqFlags |= (type1.IsValueType == type2.IsValueType) ? 0 : 0x004;
- eqFlags |= (type1.IsPublic == type2.IsPublic) ? 0 : 0x008;
- eqFlags |= (type1.IsSealed == type2.IsSealed) ? 0 : 0x010;
- eqFlags |= (type1.IsEnum == type2.IsEnum) ? 0 : 0x020;
- eqFlags |= (type1.IsPointer == type2.IsPointer) ? 0 : 0x040;
- eqFlags |= (type1.IsPrimitive == type2.IsPrimitive) ? 0 : 0x080;
- bool res = (eqFlags == 0);
-
- if (!res) {
- // TODO: convert flags into descriptive message.
- Verifier.Log.Write ("error", "Types mismatch (0x" + eqFlags.ToString("X") + ").", ImportanceLevel.HIGH);
- }
-
-
- bool ok;
-
- ok = (type1.Attributes & TypeAttributes.BeforeFieldInit) ==
- (type2.Attributes & TypeAttributes.BeforeFieldInit);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: BeforeFieldInit.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- ok = (type1.Attributes & TypeAttributes.ExplicitLayout) ==
- (type2.Attributes & TypeAttributes.ExplicitLayout);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: ExplicitLayout.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- ok = (type1.Attributes & TypeAttributes.SequentialLayout) ==
- (type2.Attributes & TypeAttributes.SequentialLayout);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: SequentialLayout.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- ok = (type1.Attributes & TypeAttributes.Serializable) ==
- (type2.Attributes & TypeAttributes.Serializable);
- if (!ok) {
- Verifier.Log.Write ("error", "Types attributes mismatch: Serializable.", ImportanceLevel.HIGH);
- }
- res &= ok;
-
- return res;
- }
-
- }
-
-
-
-
- ////////////////////////////////
- // Log
- ////////////////////////////////
-
- public enum ImportanceLevel : int {
- LOW = 0, MEDIUM, HIGH
- }
-
-
- public interface ILogger {
-
- void Write (string tag, string msg, ImportanceLevel importance);
- void Write (string msg, ImportanceLevel level);
- void Write (string tag, string msg);
- void Write (string msg);
- ImportanceLevel DefaultImportance {get; set;}
- void Flush ();
- void Close ();
- }
-
-
- public abstract class AbstractLogger : ILogger {
- private ImportanceLevel defImportance = ImportanceLevel.MEDIUM;
-
- public abstract void Write (string tag, string msg, ImportanceLevel importance);
- public abstract void Write (string msg, ImportanceLevel level);
-
- public virtual void Write (string tag, string msg)
- {
- Write (tag, msg, DefaultImportance);
- }
-
- public virtual void Write (string msg)
- {
- Write (msg, DefaultImportance);
- }
-
- public virtual ImportanceLevel DefaultImportance {
- get {
- return defImportance;
- }
- set {
- defImportance = value < ImportanceLevel.LOW
- ? ImportanceLevel.LOW
- : value > ImportanceLevel.HIGH
- ? ImportanceLevel.HIGH
- : value;
- }
- }
-
- public abstract void Flush ();
- public abstract void Close ();
-
- }
-
-
-
- public class TextLogger : AbstractLogger {
-
- private TextWriter writer;
-
- public TextLogger (TextWriter writer)
- {
- if (writer == null)
- throw new NullReferenceException ();
-
- this.writer = writer;
- }
-
- private void DoWrite (string tag, string msg)
- {
- if (tag != null && tag.Length > 0) {
- writer.WriteLine ("[{0}]\t{1}", tag, msg);
- } else {
- writer.WriteLine ("\t\t" + msg);
- }
- }
-
- public override void Write (string tag, string msg, ImportanceLevel importance)
- {
- int v = Log.VerboseLevel;
- switch (v) {
- case 0 :
- break;
- case 1 :
- if (importance >= ImportanceLevel.HIGH) {
- DoWrite (tag, msg);
- }
- break;
- case 2 :
- if (importance >= ImportanceLevel.MEDIUM) {
- DoWrite (tag, msg);
- }
- break;
- case 3 :
- DoWrite (tag, msg);
- break;
- default:
- break;
- }
- }
-
- public override void Write (string msg, ImportanceLevel importance)
- {
- Write (null, msg, importance);
- }
-
- public override void Flush ()
- {
- Console.Out.Flush ();
- }
-
- public override void Close ()
- {
- if (writer != Console.Out && writer != Console.Error) {
- writer.Close ();
- }
- }
- }
-
-
-
- public sealed class Log {
-
- private static int verbose = 3;
-
- private ArrayList consumers;
-
- public Log (bool useDefault)
- {
- consumers = new ArrayList ();
- if (useDefault) AddConsumer (new TextLogger (Console.Out));
- }
-
- public Log () : this (true)
- {
- }
-
-
- public static int VerboseLevel {
- get {
- return verbose;
- }
- set {
- verbose = (value < 0)
- ? 0
- : (value > 3)
- ? 3 : value;
- }
- }
-
- public void AddConsumer (ILogger consumer)
- {
- consumers.Add (consumer);
- }
-
-
- public void Write (string tag, string msg, ImportanceLevel importance)
- {
- foreach (ILogger logger in consumers) {
- if (tag == null || tag == "") {
- logger.Write (msg, importance);
- } else {
- logger.Write (tag, msg, importance);
- }
- }
- }
-
- public void Write (string msg, ImportanceLevel importance)
- {
- Write (null, msg, importance);
- }
-
-
- public void Write (string tag, string msg)
- {
- foreach (ILogger logger in consumers) {
- if (tag == null || tag == "") {
- logger.Write (msg);
- } else {
- logger.Write (tag, msg);
- }
- }
- }
-
- public void Write (string msg)
- {
- Write (null, msg);
- }
-
-
- public void Flush ()
- {
- foreach (ILogger logger in consumers) {
- logger.Flush ();
- }
- }
-
-
- public void Close ()
- {
- foreach (ILogger logger in consumers) {
- logger.Flush ();
- logger.Close ();
- }
- }
-
- }
-
-
-
-
-
-
- ////////////////////////////////
- // Main
- ////////////////////////////////
-
- public class Verifier {
-
- public static readonly Log log = new Log ();
- public static bool stopOnError = false;
- public static bool ignoreMissingTypes = true;
- public static bool checkOptionalFlags = true;
-
- private static readonly IList excluded;
-
- static Verifier ()
- {
- excluded = new ArrayList ();
- excluded.Add ("<PrivateImplementationDetails>");
- }
-
-
- private Verifier ()
- {
- }
-
- public static Log Log {
- get {
- return log;
- }
- }
-
- public static IList Excluded {
- get {
- return excluded;
- }
- }
-
-
-
- public static void Main (String [] args)
- {
- if (args.Length < 2) {
- Console.WriteLine ("Usage: verifier assembly1 assembly2");
- } else {
- string name1 = args [0];
- string name2 = args [1];
-
- bool ok = false;
-
- AssemblyStuff asm1 = new AssemblyStuff (name1);
- AssemblyStuff asm2 = new AssemblyStuff (name2);
- ok = asm1.Load ();
- if (!ok) {
- Console.WriteLine ("Unable to load assembly {0}.", name1);
- Environment.Exit (-1);
- }
-
- ok = asm2.Load ();
- if (!ok) {
- Console.WriteLine ("Unable to load assembly {0}.", name2);
- Environment.Exit (-1);
- }
-
-
- try {
- ok = (asm1 == asm2);
- } catch {
- ok = false;
- } finally {
- Log.Close ();
- }
-
- if (!ok) {
- Console.WriteLine ("--- not equal");
- Environment.Exit (-1);
- }
- }
- }
-
- }
-
-
-}
-
diff --git a/mint.pc.in b/mint.pc.in
new file mode 100644
index 00000000000..004bb0f7162
--- /dev/null
+++ b/mint.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+
+Name: Mono Interpreter
+Description: Mono Interpreter Runtime
+Version: @VERSION@
+Requires: glib-2.0 gmodule-2.0 gthread-2.0
+Libs: -L${libdir} -lmint @libmono_ldflags@ @ICU_LIBS@ -lm
+Cflags: -I${includedir} @libmono_cflags@
diff --git a/mono-win32-setup-light.bmp b/mono-win32-setup-light.bmp
new file mode 100755
index 00000000000..df4aec16971
--- /dev/null
+++ b/mono-win32-setup-light.bmp
Binary files differ
diff --git a/mono.pc.in b/mono.pc.in
new file mode 100644
index 00000000000..b837aa6d784
--- /dev/null
+++ b/mono.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+
+Name: Mono
+Description: Mono Runtime
+Version: @VERSION@
+Requires: glib-2.0 gmodule-2.0 gthread-2.0
+Libs: -L${libdir} -lmono @libmono_ldflags@ -lm
+Cflags: -I${includedir} @libmono_cflags@
diff --git a/mono.spec.in b/mono.spec.in
new file mode 100644
index 00000000000..f880545bc1d
--- /dev/null
+++ b/mono.spec.in
@@ -0,0 +1,79 @@
+Summary: The mono CIL runtime, suitable for running .NET code
+Name: mono
+Version: @VERSION@
+Release: 1
+License: LGPL
+Group: System Environment/Base
+# the original file is in .gz format but I want to save a few bytes
+Source0: http://go-mono.com/archive/mono-@VERSION@.tar.gz
+URL: http://go-mono.com/
+BuildRoot: %{_tmppath}/%{name}-root
+Requires: /sbin/ldconfig, libxml2, libxslt
+BuildRequires: libgc-devel
+BuildRequires: bison
+Packager: Miguel de Icaza <miguel@ximian.com>
+Requires: mono-classes
+
+%description
+The Mono runtime implements a JIT engine for the ECMA CLI virtual machine (as
+well as a byte code interpreter, the class loader, the garbage collector, threading system and
+metadata access libraries.
+
+%package devel
+Summary: Files and programs needed for mono development
+Group: Development/Tools
+PreReq: %{name} = %{version}-%{release}
+
+%description devel
+Header files, programs and documentation needed to develop programs with
+the Mono .NET implementation
+
+%prep
+%setup -q
+
+%build
+./configure
+make
+
+%install
+rm -rf %{buildroot}
+%makeinstall
+
+%clean
+rm -rf %{buildroot}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-, root, root)
+%doc AUTHORS COPYING.LIB ChangeLog NEWS README
+%{_bindir}/mono
+%{_bindir}/mint
+%{_libdir}/*.so.*
+%{_mandir}/man1/mono.*
+%{_mandir}/man1/mint.*
+%{_mandir}/man5/*
+
+%files devel
+%defattr(-, root, root)
+%{_bindir}/monodis
+%{_bindir}/monograph
+%{_libdir}/*.a
+%{_libdir}/*.la
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*
+%{_includedir}/*
+%{_mandir}/man1/monodis.*
+%{_mandir}/man1/monostyle.*
+%{_mandir}/man1/monoburg.*
+%{_mandir}/man1/mcs.*
+%{_datadir}/%{name}/*
+
+%changelog
+* Wed Aug 21 2002 Miguel de Icaza <miguel@ximian.com>
+Few touches, check into cvs
+
+* Mon Aug 19 2002 Daniel Resare <noa@resare.com>
+- Initial RPM release.
diff --git a/mono/Makefile.am b/mono/Makefile.am
index ca0f9817dcb..17162963cd1 100644
--- a/mono/Makefile.am
+++ b/mono/Makefile.am
@@ -1,9 +1,8 @@
# the handles dir doesn't apply to windows
if PLATFORM_WIN32
-SUBDIRS = utils io-layer monoburg metadata cil dis \
- arch monograph os interpreter jit tests benchmark
+SUBDIRS = utils io-layer monoburg os metadata cil dis \
+ arch monograph interpreter mini tests benchmark profiler
else
-SUBDIRS = utils io-layer monoburg metadata cil dis \
- arch monograph os interpreter jit tests benchmark handles
+SUBDIRS = utils io-layer monoburg os metadata cil dis \
+ arch monograph interpreter mini tests benchmark handles profiler
endif
-
diff --git a/mono/arch/ChangeLog b/mono/arch/ChangeLog
index 4f98ea1a164..aaf42f41c78 100644
--- a/mono/arch/ChangeLog
+++ b/mono/arch/ChangeLog
@@ -1,3 +1,253 @@
+2004-08-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h (amd64_imul_reg_membase_size): Fix REX
+ generation.
+
+2004-08-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h: More SSE work.
+
+ * amd64/amd64-codegen.h: Add SSE2 instructions.
+
+2004-08-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h (X86_IS_BYTE_REG): Redefine X86_IS_BYTE_REG
+ since under amd64, all 16 registers have a low part.
+
+2004-08-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * x86/x86-codegen.h: Add macros for accessing the mod/rm byte.
+
+2004-07-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h: Ongoing JIT work.
+
+2004-07-29 Ben Maurer <bmaurer@ximian.com>
+
+ * x86/x86-codegen.h: Add opcodes for cmp BYTE PTR [eax], imm
+
+2004-07-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h: Ongoing JIT work.
+
+2004-07-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h: Ongoing JIT work.
+
+2004-07-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h: Ongoing JIT work.
+
+2004-07-23 zovarga <vargaz@freemail.hu>
+
+ * amd64/amd64-codegen.h: Ongoing JIT work.
+
+2004-06-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * sparc/sparc-codegen.h: Add SPARC64 support.
+
+2004-05-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * ppc/ppc-codegen.h: remove GCC-ism in ppc_emit32
+
+2004-04-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * ppc/tramp.c: use sizeof (stackval), fix
+ delegate tramp frame layout for Apple
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * unknown.c: modify to have content for defined platforms (to
+ avoid ISO C warning)
+
+2004-03-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * amd64/tramp.c:
+ * arm/tramp.c:
+ * hppa/tramp.c:
+ * ppc/tramp.c:
+ * s390/tramp.c:
+ * sparc/tramp.c:
+ * x86/tramp.c:
+ remove child from MonoInvocation as it isn't used.
+
+ * hppa/hppa-codegen.h:
+ fix displacements in FP instrs
+
+2004-03-23 Bernie Solomon <bernard@ugsolutions.com>
+
+ * hppa/hppa-codegen.h: created
+
+ * hppa/tramp.c: changed style to be more like
+ other platforms.
+
+ * hppa/Makefile.am: add hppa-codegen.h
+
+2004-03-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * sparc/sparc-codegen.h: Add v9 branches with prediction.
+
+2004-03-15 Bernie Solomon <bernard@ugsolutions.com>
+
+ * sparc/sparc-codegen.h: tweak sparc_mov_reg_reg
+ so Sun's dis command recognizes it.
+
+2004-03-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * sparc/sparc-codegen.h: Add some v9 instructions.
+
+2004-03-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * sparc/sparc-codegen.h: Ongoing sparc work.
+
+2004-03-07 Duncan Mak <duncan@ximian.com>
+
+ * Makefile.am: Removed the reference to 'x86-64'. This was the cause
+ of the missing Mono daily tarballs, 'make dist' wasn't working.
+
+ We do have an 'amd64' directory, but it doesn't make it in 'make
+ dist'.
+
+2004-02-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * sparc/sparc-codegen.h: Fix lots of opcodes + add new ones.
+
+ * sparc/tramp.c: Fix alignment of structures containing doubles.
+
+2004-02-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * sparc/tramp.c: Implement all floating point argument passing conventions in
+ Sparc V8. Also fix structure passing in V8.
+
+Thu Nov 13 16:24:29 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * ppc/ppc-codegen.h: fixed most of the incorrect macros from ct.
+
+2003-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * */tramp.c (mono_create_method_pointer): Rename to
+ mono_arch_create_method_pointer, move common code to a new function in
+ interp.c.
+
+ * */tramp.c (mono_create_trampoline): Rename to
+ mono_arch_create_trampoline for consistency.
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * x86/tramp.c: restore EDX after memcpy call
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * Makefile.am: add hppa subdir
+
+ * hppa/tramp.c: add initial implementation - this is 64 bit only
+ hppa/Makefile.am hppa/.cvsignore: added
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * sparc/sparc-codegen.h sparc/tramp.c: add initial implementation
+ for V9 (64 bit), cover more 32 bit cases as well.
+
+2003-09-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * x86/tramp.c: Fixes from Bernie Solomon (bernard@ugsolutions.com).
+
+2003-08-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * x86/tramp.c: Fixes from Bernie Solomon (bernard@ugsolutions.com).
+
+Tue Jul 1 13:03:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * alpha/tramp.c: update from Laramie Leavitt (lar@leavitt.us).
+
+2003-05-20 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86/x86-codegen.h (x86_set_reg): add an assertion - it does
+ not work for all registers.
+
+Sat Feb 1 10:59:31 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * alpha/*: update from Laramie.
+
+Mon Jan 27 12:49:10 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * alpha/*: start of the port to the alpha architecture by
+ Laramie Leavitt (<lar@leavitt.us>).
+
+Tue Jan 21 17:29:53 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * ppc/ppc-codegen.h: completed ppc native code generation by
+ Taylor Christopher P <ct@cs.clemson.edu>.
+
+Fri Jan 17 21:14:18 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * ppc/tramp.c: adapted to work for MacOSX (from a patch by
+ John Duncan).
+
+2002-11-11 Mark Crichton <crichton@gimp.org>
+
+ * sparc/tramp.c: Added some disassembly bits for debugging.
+
+2002-10-02 Mark Crichton <crichton@gimp.org>
+
+ * sparc/tramp.c: More cleanup of the trampoline code. Still some
+ problems with it w.r.t. delegates.
+
+2002-09-25 Mark Crichton <crichton@gimp.org>
+
+ * sparc/tramp.c: Off by one error. Whoops. Trampoline code should
+ now work properly.
+
+2002-09-24 Mark Crichton <crichton@gimp.org>
+
+ * sparc/tramp.c: Works as well as the old code did. Cleanup is
+ finished. The framework now for adding more type support is in,
+ and should be a *lot* cleaner.
+
+2002-09-22 Mark Crichton <crichton@gimp.org>
+
+ * sparc/tramp.c: Completely broke trampolining on SPARC processors.
+ The code needed a nasty cleanup, so most of it is rewritten.
+ It will be fixed.
+
+2002-08-20 Mark Crichton <crichton@gimp.org>
+
+ * sparc/tramp.c (mono_create_trampoline): Now works on Sparc. Tested
+ on an Ultra 2 running Linux.
+
+Mon Aug 5 19:21:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * x86/tramp.c: fix random memory read in mono_create_method_pointer.
+
+2002-08-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86/tramp.c (mono_create_trampoline): fixed stack_size bug
+
+2002-08-01 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86/tramp.c (mono_create_method_pointer): allocate space for
+ value types.
+ (mono_create_trampoline): also push the value type pointer for
+ methods returning value types.
+ (mono_create_method_pointer): support valuetype returns.
+
+2002-07-31 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86/tramp.c: remove code to handle PInvoke because this is no
+ longer needed.
+ (mono_create_method_pointer): return method->addr for pinvoke methods
+
+Fri Jul 19 14:18:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * x86/tramp.c: fix float loads. Simple delegate marshaling fix.
+
+2002-07-08 Radek Doulik <rodo@ximian.com>
+
+ * ppc/tramp.c: marshaling for SZARRAY
+
+2002-07-05 Radek Doulik <rodo@ximian.com>
+
+ * ppc/tramp.c: removed magic hack
Tue Jun 18 10:21:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
diff --git a/mono/arch/Makefile.am b/mono/arch/Makefile.am
index 5f14ee96d90..9eb9ee82f94 100644
--- a/mono/arch/Makefile.am
+++ b/mono/arch/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS = $(arch_target)
-DIST_SUBDIRS = x86 ppc sparc arm
+DIST_SUBDIRS = x86 ppc sparc arm s390 s390x alpha hppa amd64
INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/alpha/.cvsignore b/mono/arch/alpha/.cvsignore
new file mode 100644
index 00000000000..6358454922b
--- /dev/null
+++ b/mono/arch/alpha/.cvsignore
@@ -0,0 +1,4 @@
+Makefile.in
+Makefile
+.deps
+.cvsignore
diff --git a/mono/arch/alpha/Makefile.am b/mono/arch/alpha/Makefile.am
new file mode 100644
index 00000000000..8e0accf9665
--- /dev/null
+++ b/mono/arch/alpha/Makefile.am
@@ -0,0 +1,8 @@
+
+INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmonoarch-alpha.la
+
+libmonoarch_alpha_la_SOURCES = tramp.c alpha-codegen.h
+
+noinst_PROGRAMS = test
diff --git a/mono/arch/alpha/alpha-codegen.h b/mono/arch/alpha/alpha-codegen.h
new file mode 100644
index 00000000000..26dc591a210
--- /dev/null
+++ b/mono/arch/alpha/alpha-codegen.h
@@ -0,0 +1,516 @@
+#ifndef __ALPHA_CODEGEN_H__
+#define __ALPHA_CODEGEN_H__
+
+/*
+ http://ftp.digital.com/pub/Digital/info/semiconductor/literature/alphaahb.pdf
+*/
+
+typedef enum {
+ alpha_r0 = 0,
+ alpha_r1 = 1,
+ alpha_r2 = 2,
+ alpha_r3 = 3,
+ alpha_r4 = 4,
+ alpha_r5 = 5,
+ alpha_r6 = 6,
+ alpha_r7 = 7,
+ alpha_r8 = 8,
+ alpha_r9 = 9,
+ alpha_r10 = 10,
+ alpha_r11 = 11,
+ alpha_r12 = 12,
+ alpha_r13 = 13,
+ alpha_r14 = 14,
+ alpha_r15 = 15,
+ alpha_r16 = 16,
+ alpha_r17 = 17,
+ alpha_r18 = 18,
+ alpha_r19 = 19,
+ alpha_r20 = 20,
+ alpha_r21 = 21,
+ alpha_r22 = 22,
+ alpha_r23 = 23,
+ alpha_r24 = 24,
+ alpha_r25 = 25,
+ alpha_r26 = 26,
+ alpha_r27 = 27,
+ alpha_r28 = 28,
+ alpha_r29 = 29,
+ alpha_r30 = 30,
+ alpha_r31 = 31, alpha_zero = 31,
+ /* aliases */
+ alpha_v0 = 0, /* return value */
+
+ alpha_t0 = 1, /* temporaries */
+ alpha_t1 = 2,
+ alpha_t2 = 3,
+ alpha_t3 = 4,
+ alpha_t4 = 5,
+ alpha_t5 = 6,
+ alpha_t6 = 7,
+ alpha_t7 = 8,
+
+ alpha_s0 = 9, /* saved registers */
+ alpha_s1 = 10,
+ alpha_s2 = 11,
+ alpha_s3 = 12,
+ alpha_s4 = 13,
+ alpha_s5 = 14,
+ alpha_s6 = 15,
+
+ alpha_fp = 15, /* frame pointer */
+
+ alpha_a0 = 16, /* argument registers */
+ alpha_a1 = 17,
+ alpha_a2 = 18,
+ alpha_a3 = 19,
+ alpha_a4 = 20,
+ alpha_a5 = 21,
+
+ alpha_t8 = 22, /* temporaries */
+ alpha_t9 = 23,
+ alpha_t10 = 24,
+ alpha_t11 = 25,
+
+ alpha_ra = 26, /* Return Address */
+
+ alpha_pv = 27, /* pv current procedure */
+ alpha_t12 = 27, /* temp 12 */
+
+ alpha_altreg = 28,
+ alpha_at = 28,
+
+ alpha_gp = 29, /* Global Pointer */
+ alpha_sp = 30, /* Stack Pointer */
+} AlphaRegister;
+
+typedef enum {
+ /* floating point registers */
+ alpha_f0 = 0,
+ alpha_f1 = 1,
+ alpha_f2 = 2,
+ alpha_f3 = 3,
+ alpha_f4 = 4,
+ alpha_f5 = 5,
+ alpha_f6 = 6,
+ alpha_f7 = 7,
+ alpha_f8 = 8,
+ alpha_f9 = 9,
+ alpha_f10 = 10,
+ alpha_f11 = 11,
+ alpha_f12 = 12,
+ alpha_f13 = 13,
+ alpha_f14 = 14,
+ alpha_f15 = 15,
+ alpha_f16 = 16,
+ alpha_f17 = 17,
+ alpha_f18 = 18,
+ alpha_f19 = 19,
+ alpha_f20 = 20,
+ alpha_f21 = 21,
+ alpha_f22 = 22,
+ alpha_f23 = 23,
+ alpha_f24 = 24,
+ alpha_f25 = 25,
+ alpha_f26 = 26,
+ alpha_f27 = 27,
+ alpha_f28 = 28,
+ alpha_f29 = 29,
+ alpha_f30 = 30,
+ alpha_f31 = 31, alpha_fzero = 31,
+ /* aliases */
+ alpha_fv0 = 0, /* return value */
+ alpha_fv1 = 1,
+
+ alpha_fs0 = 2, /* saved registers */
+ alpha_fs1 = 3,
+ alpha_fs2 = 4,
+ alpha_fs3 = 5,
+ alpha_fs4 = 6,
+ alpha_fs5 = 7,
+ alpha_fs6 = 8,
+ alpha_fs7 = 9,
+
+ alpha_ft0 = 10, /* temporary */
+ alpha_ft1 = 11,
+ alpha_ft2 = 12,
+ alpha_ft3 = 13,
+ alpha_ft4 = 14,
+ alpha_ft5 = 15,
+
+ alpha_fa0 = 16, /* args */
+ alpha_fa1 = 17,
+ alpha_fa2 = 18,
+ alpha_fa3 = 19,
+ alpha_fa4 = 20,
+ alpha_fa5 = 21,
+
+ alpha_ft6 = 22,
+ alpha_ft7 = 23,
+ alpha_ft8 = 24,
+ alpha_ft9 = 25,
+ alpha_ft10 = 26,
+ alpha_ft11 = 27,
+ alpha_ft12 = 28,
+ alpha_ft13 = 29,
+ alpha_ft14 = 30
+} AlphaFPRegister;
+
+/***************************************/
+
+#define __alpha_int_32 unsigned int
+
+
+/***************************************/
+#define AXP_OFF26_MASK 0x03ffffff
+#define AXP_OFF21_MASK 0x01fffff
+#define AXP_OFF16_MASK 0x0ffff
+#define AXP_OFF14_MASK 0x03fff
+#define AXP_OFF13_MASK 0x01fff
+#define AXP_OFF11_MASK 0x07ff
+#define AXP_OFF8_MASK 0x0ff
+#define AXP_OFF7_MASK 0x07f
+#define AXP_OFF6_MASK 0x03f
+#define AXP_OFF5_MASK 0x01f
+#define AXP_OFF4_MASK 0x0f
+#define AXP_OFF2_MASK 0x03
+#define AXP_OFF1_MASK 0x01
+
+
+#define AXP_REG_MASK AXP_OFF5_MASK
+#define AXP_REGSIZE 5
+
+#define AXP_OP_SHIFT 26
+#define AXP_REG1_SHIFT 21
+#define AXP_REG2_SHIFT 16
+#define AXP_MEM_BR_SHIFT 14
+#define AXP_LIT_SHIFT 13
+
+/* encode registers */
+#define alpha_opcode( op ) \
+ ((op&AXP_OFF6_MASK) << AXP_OP_SHIFT)
+
+/* encode registers */
+#define alpha_reg_a( reg ) \
+ ((reg & AXP_REG_MASK) << AXP_REG1_SHIFT)
+
+#define alpha_reg_b( reg ) \
+ ((reg & AXP_REG_MASK) << AXP_REG2_SHIFT)
+
+#define alpha_reg_c( reg ) \
+ (reg & AXP_REG_MASK)
+
+
+
+/* encode function codes */
+#define alpha_fp_func( func ) \
+ ((func & AXP_OFF11_MASK) << AXP_REGSIZE)
+
+#define alpha_op_func( func ) \
+ ((func & AXP_OFF7_MASK) << AXP_REGSIZE)
+
+#define alpha_op_literal( lit ) \
+ ((lit & AXP_OFF7_MASK) << AXP_LIT_SHIFT)
+
+#define alpha_mem_br_func( func, hint ) \
+ (((func & AXP_OFF2_MASK ) << AXP_MEM_BR_SHIFT ) | (hint&AXP_OFF14_MASK))
+
+#define alpha_mem_fc_func( func ) \
+ (func && AXP_OFF16_MASK)
+
+
+#define alpha_encode_hw4_mem( op, func ) \
+ (alpha_opcode( op ) | (( func & 0x0f ) << 12))
+
+#define alpha_encode_hw5_mem( op, func ) \
+ (alpha_opcode( op ) | (( func & 0x3f ) << 10))
+
+#define alpha_encode_hw6mem( op, func ) \
+ (alpha_opcode( op ) | (( func & 0x0f ) << 12))
+
+#define alpha_encode_hw6mem_br( op, func ) \
+ (alpha_opcode( op ) | (( func & 0x07 ) << 13))
+
+
+/*****************************************/
+
+
+#define alpha_encode_palcall( ins, op, func ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | ( func & AXP_OFF26_MASK ))
+
+#define alpha_encode_mem( ins, op, Rdest, Rsrc, offset ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | alpha_reg_a( Rdest ) | \
+ alpha_reg_b( Rsrc ) | (offset & AXP_OFF16_MASK ))
+
+#define alpha_encode_mem_fc( ins, op, func, Rdest, Rsrc, offset ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | alpha_reg_a( Rdest ) | \
+ alpha_reg_b( Rsrc ) | alpha_mem_fc_func( func ))
+
+#define alpha_encode_mem_br( ins, op, func, Rdest, Rsrc, hint ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | alpha_reg_a( Rdest ) | \
+ alpha_reg_b( Rsrc ) | alpha_mem_br_func( func, hint ) )
+
+#define alpha_encode_branch( ins, op, Reg, offset ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | alpha_reg_a( Reg ) | \
+ (offset & AXP_OFF21_MASK ))
+
+#define alpha_encode_op( ins, op, func, Rsrc1, Rsrc2, Rdest ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | alpha_reg_a( Rsrc1 ) | \
+ alpha_reg_b( Rsrc2 ) | alpha_op_func( func ) | \
+ alpha_reg_c( Rdest ))
+
+
+#define alpha_encode_opl( ins, op, func, Rsrc, lit, Rdest ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | alpha_reg_a( Rsrc1 ) | \
+ alpha_op_literal(lit) | ( 1 << 12 ) | \
+ alpha_op_func( func ) | alpha_reg_c( Rdest ) )
+
+
+#define alpha_encode_fpop( ins, op, func, Rsrc1, Rsrc2, Rdest ) \
+ *((__alpha_int_32*)(ins))++ = ( 0 |\
+ alpha_opcode( op ) | alpha_reg_a( Rsrc1 ) | \
+ alpha_reg_b( Rsrc2 ) | alpha_fp_func( func ) | \
+ alpha_reg_c( Rdest ))
+
+
+/***************************************/
+
+/* pal calls */
+/* #define alpha_halt( ins ) alpha_encode_palcall( ins, 0, 0 ) */
+
+#define alpha_call_pal( ins, func ) alpha_encode_palcall( ins, 0, x )
+
+/*memory*/
+#define alpha_lda( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x08, Rdest, Rsrc, offset )
+#define alpha_ldah( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x09, Rdest, Rsrc, offset )
+#define alpha_ldbu( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0a, Rdest, Rsrc, offset )
+#define alpha_ldq_u( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0b, Rdest, Rsrc, offset )
+#define alpha_ldwu( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0c, Rdest, Rsrc, offset )
+#define alpha_stw( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0d, Rdest, Rsrc, offset )
+#define alpha_stb( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0e, Rdest, Rsrc, offset )
+#define alpha_stq_u( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x0f, Rdest, Rsrc, offset )
+
+#ifdef __VAX__
+#define alpha_ldf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x20, Rdest, Rsrc, offset )
+#define alpha_ldg( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x21, Rdest, Rsrc, offset )
+#define alpha_stf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x24, Rdest, Rsrc, offset )
+#define alpha_stg( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x25, Rdest, Rsrc, offset )
+#endif
+
+#define alpha_lds( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x22, Rdest, Rsrc, offset )
+#define alpha_ldt( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x23, Rdest, Rsrc, offset )
+#define alpha_ldqf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x23, Rdest, Rsrc, offset )
+
+#define alpha_sts( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x26, Rdest, Rsrc, offset )
+#define alpha_stt( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x27, Rdest, Rsrc, offset )
+#define alpha_stqf( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x27, Rdest, Rsrc, offset )
+
+
+#define alpha_ldl( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x28, Rdest, Rsrc, offset )
+#define alpha_ldq( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x29, Rdest, Rsrc, offset )
+#define alpha_ldl_l( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2A, Rdest, Rsrc, offset )
+#define alpha_ldq_l( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2B, Rdest, Rsrc, offset )
+#define alpha_stl( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2C, Rdest, Rsrc, offset )
+#define alpha_stq( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2D, Rdest, Rsrc, offset )
+#define alpha_stl_c( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2E, Rdest, Rsrc, offset )
+#define alpha_stq_c( ins, Rdest, Rsrc, offset ) alpha_encode_mem( ins, 0x2F, Rdest, Rsrc, offset )
+
+
+/* branch*/
+#define alpha_jmp( ins, Rdest, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x0, Rdest, Rsrc, hint )
+#define alpha_jsr( ins, Rdest, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x1, Rdest, Rsrc, hint )
+#define alpha_ret( ins, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x2, alpha_zero, Rsrc, hint )
+#define alpha_jsrco( ins, Rdest, Rsrc, hint ) alpha_encode_mem_br( ins, 0x1A, 0x3, Rdest, Rsrc, hint )
+
+#define alpha_br( ins, Reg, offset ) alpha_encode_branch( ins, 0x30, Reg, offset )
+#define alpha_fbeq( ins, Reg, offset ) alpha_encode_branch( ins, 0x31, Reg, offset )
+#define alpha_fblt( ins, Reg, offset ) alpha_encode_branch( ins, 0x32, Reg, offset )
+#define alpha_fble( ins, Reg, offset ) alpha_encode_branch( ins, 0x33, Reg, offset )
+#define alpha_bsr( ins, Reg, offset ) alpha_encode_branch( ins, 0x34, Reg, offset )
+#define alpha_fbne( ins, Reg, offset ) alpha_encode_branch( ins, 0x35, Reg, offset )
+#define alpha_fbge( ins, Reg, offset ) alpha_encode_branch( ins, 0x36, Reg, offset )
+#define alpha_fbgt( ins, Reg, offset ) alpha_encode_branch( ins, 0x37, Reg, offset )
+#define alpha_blbc( ins, Reg, offset ) alpha_encode_branch( ins, 0x38, Reg, offset )
+#define alpha_beq( ins, Reg, offset ) alpha_encode_branch( ins, 0x39, Reg, offset )
+#define alpha_blt( ins, Reg, offset ) alpha_encode_branch( ins, 0x3A, Reg, offset )
+#define alpha_ble( ins, Reg, offset ) alpha_encode_branch( ins, 0x3B, Reg, offset )
+#define alpha_blbs( ins, Reg, offset ) alpha_encode_branch( ins, 0x3C, Reg, offset )
+#define alpha_bne( ins, Reg, offset ) alpha_encode_branch( ins, 0x3D, Reg, offset )
+#define alpha_bge( ins, Reg, offset ) alpha_encode_branch( ins, 0x3E, Reg, offset )
+#define alpha_bgt( ins, Reg, offset ) alpha_encode_branch( ins, 0x3F, Reg, offset )
+
+
+/* integer */
+/*//#define alpha_sextl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x00, Rsrc1, Rsrc2, Rdest )
+//#define alpha_sextl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x00, Rsrc1, lit, Rdest )
+*/
+#define alpha_addl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x00, Rsrc1, Rsrc2, Rdest )
+#define alpha_addl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x00, Rsrc1, lit, Rdest )
+#define alpha_s4addl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x02, Rsrc1, Rsrc2, Rdest )
+#define alpha_s4addl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x02, Rsrc1, lit, Rdest )
+//#define alpha_negl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x09, Rsrc1, Rsrc2, Rdest )
+//#define alpha_negl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x09, Rsrc1, lit, Rdest )
+#define alpha_subl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x09, Rsrc1, Rsrc2, Rdest )
+#define alpha_subl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x09, Rsrc1, lit, Rdest )
+#define alpha_s4subl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x0B, Rsrc1, Rsrc2, Rdest )
+#define alpha_s4subl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x0B, Rsrc1, lit, Rdest )
+#define alpha_cmpbge( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x0F, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmpbge_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x0F, Rsrc1, lit, Rdest )
+#define alpha_s8addl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x12, Rsrc1, Rsrc2, Rdest )
+#define alpha_s8addl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x12, Rsrc1, lit, Rdest )
+#define alpha_s8subl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x1B, Rsrc1, Rsrc2, Rdest )
+#define alpha_s8subl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x1B, Rsrc1, lit, Rdest )
+#define alpha_cmpult( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x1d, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmpult_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x1d, Rsrc1, lit, Rdest )
+#define alpha_addq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x20, Rsrc1, Rsrc2, Rdest )
+#define alpha_addq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x20, Rsrc1, lit, Rdest )
+#define alpha_s4addq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x22, Rsrc1, Rsrc2, Rdest )
+#define alpha_s4addq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x22, Rsrc1, lit, Rdest )
+//#define alpha_negq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x29, Rsrc1, Rsrc2, Rdest )
+//#define alpha_negq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x29, Rsrc1, lit, Rdest )
+#define alpha_subq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x29, Rsrc1, Rsrc2, Rdest )
+#define alpha_subq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x29, Rsrc1, lit, Rdest )
+#define alpha_s4subq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x2B, Rsrc1, Rsrc2, Rdest )
+#define alpha_s4subq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x2B, Rsrc1, lit, Rdest )
+#define alpha_cmpeq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x2D, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmpeq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x2D, Rsrc1, lit, Rdest )
+#define alpha_s8addq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x32, Rsrc1, Rsrc2, Rdest )
+#define alpha_s8addq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x32, Rsrc1, lit, Rdest )
+#define alpha_s8subq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x3B, Rsrc1, Rsrc2, Rdest )
+#define alpha_s8subq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x3B, Rsrc1, lit, Rdest )
+#define alpha_cmpule( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x3D, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmpule_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x3D, Rsrc1, lit, Rdest )
+#define alpha_addlv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x40, Rsrc1, Rsrc2, Rdest )
+#define alpha_addlv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x40, Rsrc1, lit, Rdest )
+//#define alpha_neglv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x49, Rsrc1, Rsrc2, Rdest )
+//#define alpha_neglv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x49, Rsrc1, lit, Rdest )
+#define alpha_sublv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x49, Rsrc1, Rsrc2, Rdest )
+#define alpha_sublv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x49, Rsrc1, lit, Rdest )
+#define alpha_cmplt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x4D, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmplt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x4D, Rsrc1, lit, Rdest )
+#define alpha_addqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x60, Rsrc1, Rsrc2, Rdest )
+#define alpha_addqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x60, Rsrc1, lit, Rdest )
+//#define alpha_negqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x69, Rsrc1, Rsrc2, Rdest )
+//#define alpha_negqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x69, Rsrc1, lit, Rdest )
+#define alpha_subqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x69, Rsrc1, Rsrc2, Rdest )
+#define alpha_subqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x69, Rsrc1, lit, Rdest )
+#define alpha_cmple( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x10, 0x6D, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmple_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x10, 0x6D, Rsrc1, lit, Rdest )
+
+#define alpha_and( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x00, Rsrc1, Rsrc2, Rdest )
+#define alpha_and_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x00, Rsrc1, lit, Rdest )
+//#define alpha_andnot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x08, Rsrc1, Rsrc2, Rdest )
+//#define alpha_andnot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x08, Rsrc1, lit, Rdest )
+#define alpha_bic( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x08, Rsrc1, Rsrc2, Rdest )
+#define alpha_bic_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x08, Rsrc1, lit, Rdest )
+#define alpha_cmovlbs( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x14, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovlbs_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x14, Rsrc1, lit, Rdest )
+#define alpha_cmovlbc( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x16, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovlbc_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x16, Rsrc1, lit, Rdest )
+#define alpha_nop( ins ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, alpha_zero, alpha_zero )
+#define alpha_clr( ins, Rdest ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, alpha_zero, Rdest )
+#define alpha_mov1( ins, Rsrc, Rdest ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, Rsrc, Rdest )
+#define alpha_mov2( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x20, Rsrc1, Rsrc2, Rdest )
+#define alpha_mov_( ins, lit, Rdest ) alpha_encode_op( ins, 0x11, 0x20, alpha_zero, lit, Rdest )
+//#define alpha_or( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x20, Rsrc1, Rsrc2, Rdest )
+//#define alpha_or_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x20, Rsrc1, lit, Rdest )
+#define alpha_bis( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x20, Rsrc1, Rsrc2, Rdest )
+#define alpha_bis_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x20, Rsrc1, lit, Rdest )
+#define alpha_cmoveq( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x24, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmoveq_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x24, Rsrc1, lit, Rdest )
+#define alpha_cmovne( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x26, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovne_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x26, Rsrc1, lit, Rdest )
+#define alpha_not( ins, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x28, alpha_zero, Rsrc2, Rdest )
+#define alpha_not_( ins, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x28, alpha_zero, lit, Rdest )
+#define alpha_ornot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x28, Rsrc1, Rsrc2, Rdest )
+#define alpha_ornot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x28, Rsrc1, lit, Rdest )
+#define alpha_xor( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x40, Rsrc1, Rsrc2, Rdest )
+#define alpha_xor_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x40, Rsrc1, lit, Rdest )
+#define alpha_cmovlt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x44, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovlt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x44, Rsrc1, lit, Rdest )
+#define alpha_cmovge( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x46, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovge_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x46, Rsrc1, lit, Rdest )
+#define alpha_eqv( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x48, Rsrc1, Rsrc2, Rdest )
+#define alpha_eqv_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x48, Rsrc1, lit, Rdest )
+//#define alpha_xornot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x48, Rsrc1, Rsrc2, Rdest )
+//#define alpha_xornot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x48, Rsrc1, lit, Rdest )
+#define alpha_ev56b_amask( ins, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x61, alpha_zero, Rsrc2, Rdest )
+#define alpha_ev56b_amask_( ins, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x61, alpha_zero, lit, Rdest )
+#define alpha_cmovle( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x64, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovle_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x64, Rsrc1, lit, Rdest )
+#define alpha_cmovgt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x66, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovgt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x66, Rsrc1, lit, Rdest )
+//#define alpha_implver_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x6C, Rsrc1, lit, Rdest )
+#define alpha_cmovgt( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x11, 0x66, Rsrc1, Rsrc2, Rdest )
+#define alpha_cmovgt_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x11, 0x66, Rsrc1, lit, Rdest )
+
+#define alpha_mskbl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x02, Rsrc1, Rsrc2, Rdest )
+#define alpha_mskbl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x02, Rsrc1, lit, Rdest )
+#define alpha_extbl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x06, Rsrc1, Rsrc2, Rdest )
+#define alpha_extbl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x06, Rsrc1, lit, Rdest )
+#define alpha_insbl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x0B, Rsrc1, Rsrc2, Rdest )
+#define alpha_insbl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x0B, Rsrc1, lit, Rdest )
+#define alpha_mskwl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x12, Rsrc1, Rsrc2, Rdest )
+#define alpha_mskwl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x12, Rsrc1, lit, Rdest )
+#define alpha_extwl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x16, Rsrc1, Rsrc2, Rdest )
+#define alpha_extwl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x16, Rsrc1, lit, Rdest )
+#define alpha_inswl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x1b, Rsrc1, Rsrc2, Rdest )
+#define alpha_inswl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x1b, Rsrc1, lit, Rdest )
+#define alpha_mskll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x22, Rsrc1, Rsrc2, Rdest )
+#define alpha_mskll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x22, Rsrc1, lit, Rdest )
+#define alpha_extll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x26, Rsrc1, Rsrc2, Rdest )
+#define alpha_extll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x26, Rsrc1, lit, Rdest )
+#define alpha_insll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x2b, Rsrc1, Rsrc2, Rdest )
+#define alpha_insll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x2b, Rsrc1, lit, Rdest )
+#define alpha_zap( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x30, Rsrc1, Rsrc2, Rdest )
+#define alpha_zap_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x30, Rsrc1, lit, Rdest )
+#define alpha_zapnot( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x31, Rsrc1, Rsrc2, Rdest )
+#define alpha_zapnot_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x31, Rsrc1, lit, Rdest )
+#define alpha_mskql( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x32, Rsrc1, Rsrc2, Rdest )
+#define alpha_mskql_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x32, Rsrc1, lit, Rdest )
+#define alpha_srl( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x34, Rsrc1, Rsrc2, Rdest )
+#define alpha_srl_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x34, Rsrc1, lit, Rdest )
+#define alpha_extql( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x36, Rsrc1, Rsrc2, Rdest )
+#define alpha_extql_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x36, Rsrc1, lit, Rdest )
+#define alpha_sll( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x39, Rsrc1, Rsrc2, Rdest )
+#define alpha_sll_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x39, Rsrc1, lit, Rdest )
+#define alpha_insql( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x3b, Rsrc1, Rsrc2, Rdest )
+#define alpha_insql_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x3b, Rsrc1, lit, Rdest )
+#define alpha_sra( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x3c, Rsrc1, Rsrc2, Rdest )
+#define alpha_sra_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x3c, Rsrc1, lit, Rdest )
+#define alpha_mskwh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x52, Rsrc1, Rsrc2, Rdest )
+#define alpha_mskwh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x52, Rsrc1, lit, Rdest )
+#define alpha_inswh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x57, Rsrc1, Rsrc2, Rdest )
+#define alpha_inswh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x57, Rsrc1, lit, Rdest )
+#define alpha_extwh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x5a, Rsrc1, Rsrc2, Rdest )
+#define alpha_extwh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x5a, Rsrc1, lit, Rdest )
+#define alpha_msklh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x62, Rsrc1, Rsrc2, Rdest )
+#define alpha_msklh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x62, Rsrc1, lit, Rdest )
+#define alpha_inslh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x67, Rsrc1, Rsrc2, Rdest )
+#define alpha_inslh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x67, Rsrc1, lit, Rdest )
+#define alpha_extlh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x6a, Rsrc1, Rsrc2, Rdest )
+#define alpha_extlh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x6a, Rsrc1, lit, Rdest )
+#define alpha_mskqh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x72, Rsrc1, Rsrc2, Rdest )
+#define alpha_mskqh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x72, Rsrc1, lit, Rdest )
+#define alpha_insqh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x77, Rsrc1, Rsrc2, Rdest )
+#define alpha_insqh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x77, Rsrc1, lit, Rdest )
+#define alpha_extqh( ins, Rsrc1, Rsrc2, Rdest ) alpha_encode_op( ins, 0x12, 0x7a, Rsrc1, Rsrc2, Rdest )
+#define alpha_extqh_( ins, Rsrc1, lit, Rdest ) alpha_encode_opl( ins, 0x12, 0x7a, Rsrc1, lit, Rdest )
+
+#define alpha_ftois( ins, RFsrc, Rdest ) alpha_encode_fpop( ins, 0x1c, 0x078, RFsrc, alpha_zero, Rdest )
+#define alpha_ftoit( ins, RFsrc, Rdest ) alpha_encode_fpop( ins, 0x1c, 0x070, RFsrc, alpha_zero, Rdest )
+#define alpha_ftoi_qf( ins, RFsrc, Rdest ) alpha_encode_fpop( ins, 0x1c, 0x070, RFsrc, alpha_zero, Rdest )
+
+#define alpha_itofs( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x004, Rsrc, alpha_zero, RFdest )
+#define alpha_itoff( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x014, Rsrc, alpha_zero, RFdest )
+#define alpha_itoft( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x024, Rsrc, alpha_zero, RFdest )
+#define alpha_itof_qf( ins, Rsrc, RFdest ) alpha_encode_fpop( ins, 0x14, 0x024, Rsrc, alpha_zero, RFdest )
+
+#endif \ No newline at end of file
diff --git a/mono/arch/alpha/test.c b/mono/arch/alpha/test.c
new file mode 100644
index 00000000000..27db190efdb
--- /dev/null
+++ b/mono/arch/alpha/test.c
@@ -0,0 +1,152 @@
+#include "alpha-codegen.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* A typical Alpha stack frame looks like this */
+/*
+fun: // called from outside the module.
+ ldgp gp,0(pv) // load the global pointer
+fun..ng: // called from inside the module.
+ lda sp, -SIZE( sp ) // grow the stack downwards.
+
+ stq ra, 0(sp) // save the return address.
+
+ stq s0, 8(sp) // callee-saved registers.
+ stq s1, 16(sp) // ...
+
+ // Move the arguments to the argument registers...
+
+ mov addr, pv // Load the callee address
+ jsr ra, (pv) // call the method.
+ ldgp gp, 0(ra) // restore gp
+
+ // return value is in v0
+
+ ldq ra, 0(sp) // free stack frame
+ ldq s0, 8(sp) // restore callee-saved registers.
+ ldq s1, 16(sp)
+ ldq sp, 32(sp) // restore stack pointer
+
+ ret zero, (ra), 1 // return.
+*/
+
+
+
+//
+// Simple function which returns 10.
+//
+int testfunc()
+{
+ return 10;
+}
+
+// Write it using the known asm bytecodes.
+char * write_testfunc_1( char * p )
+{
+//
+// ldah gp, 0(pv)
+// lda gp, 0(gp)
+//00000001200004d0 <testfunc>:
+// 1200004d0: f0 ff de 23 lda sp,-16(sp)
+// 1200004d4: 00 00 5e b7 stq ra,0(sp)
+// 1200004d8: 08 00 fe b5 stq fp,8(sp)
+// 1200004dc: 0f 04 fe 47 mov sp,fp
+// 1200004e0: 0a 00 3f 20 lda t0,10
+// 1200004e4: 00 04 e1 47 mov t0,v0
+// 1200004e8: 1e 04 ef 47 mov fp,sp
+// 1200004ec: 00 00 5e a7 ldq ra,0(sp)
+// 1200004f0: 08 00 fe a5 ldq fp,8(sp)
+// 1200004f4: 10 00 de 23 lda sp,16(sp)
+// 1200004f8: 01 80 fa 6b ret
+
+int _func_code[] = {
+ 0x23defff0,
+ 0xb75e0000,
+ 0xb5fe0008,
+ 0x47fe040f,
+ 0x203f000a,
+ 0x47e10400,
+ 0x47ef041e,
+ 0xa75e0000,
+ 0xa5fe0008,
+ 0x23de0010,
+ 0x6bfa8001 };
+
+ memcpy( p , _func_code, 4 * 11 );
+ return p + ( 4 * 11 );
+}
+
+// The same function encoded with alpha-codegen.h
+char * write_testfunc_2( char * p )
+{
+ alpha_ldah( p, alpha_gp, alpha_pv, 0 ); // start the gp load
+ alpha_lda( p, alpha_sp, alpha_sp, -16 ); // allocate the stack
+ alpha_lda( p, alpha_gp, alpha_gp, 0 ); // finish the gp load
+ alpha_stq( p, alpha_ra, alpha_sp, 0 ); // start param save.
+ alpha_stq( p, alpha_fp, alpha_sp, 8 );
+ alpha_mov1( p, alpha_sp, alpha_fp );
+ alpha_lda( p, alpha_t0, alpha_zero, 10 );
+ alpha_mov1( p, alpha_t0, alpha_v0 );
+ alpha_mov1( p, alpha_fp, alpha_sp );
+ alpha_ldq( p, alpha_ra, alpha_sp, 0 );
+ alpha_ldq( p, alpha_fp, alpha_sp, 8 );
+ alpha_lda( p, alpha_sp, alpha_sp, 16 );
+
+ alpha_ret( p, alpha_ra, 1 );
+
+ return p;
+}
+
+
+void output( char * p, int len )
+{
+ char * maxp = p + len;
+ char * cp = p;
+
+ printf (".text\n.align 4\n.globl main\n.type main,@function\nmain:\n");
+ for ( ; cp < maxp; cp++ )
+ {
+ printf (".byte 0x%0.2x\n", (*cp&0x00ff) );
+ }
+
+ int fd = open( "bad.out", O_CREAT | O_TRUNC );
+ write( fd, p, len );
+ close( fd );
+}
+
+int main( int argc, char ** argv ) {
+ char code [16000];
+ char *p = code;
+ char * cp;
+
+ int (*x)() = 0;
+ int y = 0;
+ int z = 10;
+
+ // so, `test blah` gets you the byte-encoded function.
+ // and `test` gets you the alpha-codegen.h encoded function.
+
+ if( argc > 1 )
+ {
+ p = write_testfunc_1( p );
+ }
+ else
+ {
+ p = write_testfunc_2( p );
+ }
+
+ // output( code, p-code );
+
+ // call the procedure.
+ x = (int(*)())code;
+
+ while( z-- > 0 )
+ y = x();
+
+ return 0;
+}
+
diff --git a/mono/arch/alpha/tramp.c b/mono/arch/alpha/tramp.c
new file mode 100644
index 00000000000..ee5e94c2897
--- /dev/null
+++ b/mono/arch/alpha/tramp.c
@@ -0,0 +1,359 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Create trampolines to invoke arbitrary functions.
+ *
+ * Copyright (C) Ximian Inc.
+ *
+ * Authors: Laramie Leavitt (lar@leavitt.us)
+ *
+ *
+ */
+
+/* A typical Alpha stack frame looks like this */
+/*
+fun: // called from outside the module.
+ ldgp gp,0(pv) // load the global pointer
+fun..ng: // called from inside the module.
+ lda sp, -SIZE( sp ) // grow the stack downwards.
+
+ stq ra, 0(sp) // save the return address.
+
+ stq s0, 8(sp) // callee-saved registers.
+ stq s1, 16(sp) // ...
+
+ // Move the arguments to the argument registers...
+
+ mov addr, pv // Load the callee address
+ jsr ra, (pv) // call the method.
+ ldgp gp, 0(ra) // restore gp
+
+ // return value is in v0
+
+ ldq ra, 0(sp) // free stack frame
+ ldq s0, 8(sp) // restore callee-saved registers.
+ ldq s1, 16(sp)
+ ldq sp, 32(sp) // restore stack pointer
+
+ ret zero, (ra), 1 // return.
+
+// min SIZE = 48
+// our call must look like this.
+
+call_func:
+ ldgp gp, 0(pv)
+call_func..ng:
+ .prologue
+ lda sp, -SIZE(sp) // grow stack SIZE bytes.
+ stq ra, SIZE-48(sp) // store ra
+ stq fp, SIZE-40(sp) // store fp (frame pointer)
+ stq a0, SIZE-32(sp) // store args. a0 = func
+ stq a1, SIZE-24(sp) // a1 = retval
+ stq a2, SIZE-16(sp) // a2 = this
+ stq a3, SIZE-8(sp) // a3 = args
+ mov sp, fp // set frame pointer
+ mov pv, a0 // func
+
+ .calling_arg_this
+ mov a1, a2
+
+ .calling_arg_6plus
+ ldq t0, POS(a3)
+ stq t0, 0(sp)
+ ldq t1, POS(a3)
+ stq t1, 8(sp)
+ ... SIZE-56 ...
+
+ mov zero,a1
+ mov zero,a2
+ mov zero,a3
+ mov zero,a4
+ mov zero,a5
+
+ .do_call
+ jsr ra, (pv) // call func
+ ldgp gp, 0(ra) // restore gp.
+ mov v0, t1 // move return value into t1
+
+ .do_store_retval
+ ldq t0, SIZE-24(fp) // load retval into t2
+ stl t1, 0(t0) // store value.
+
+ .finished
+ mov fp,sp
+ ldq ra,SIZE-48(sp)
+ ldq fp,SIZE-40(sp)
+ lda sp,SIZE(sp)
+ ret zero,(ra),1
+
+
+*/
+/*****************************************************/
+
+#include "config.h"
+#include <stdlib.h>
+#include <string.h>
+
+#include "alpha-codegen.h"
+
+#include "mono/metadata/class.h"
+#include "mono/metadata/tabledefs.h"
+#include "mono/interpreter/interp.h"
+#include "mono/metadata/appdomain.h"
+#include "mono/metadata/debug-helpers.h"
+
+#define AXP_GENERAL_REGS 6
+#define AXP_MIN_STACK_SIZE 24
+#define ARG_SIZE sizeof(stackval)
+#define ARG_LOC(x) (x * sizeof( stackval ) )
+
+/*****************************************************/
+
+/* */
+/* void func (void (*callme)(), void *retval, */
+/* void *this_obj, stackval *arguments); */
+static inline guint8 *
+emit_prolog (guint8 *p, const gint SIZE, int hasthis )
+{
+ // 9 instructions.
+ alpha_ldah( p, alpha_gp, alpha_pv, 0 );
+ alpha_lda( p, alpha_sp, alpha_sp, -SIZE ); // grow stack down SIZE
+ alpha_lda( p, alpha_gp, alpha_gp, 0 ); // ldgp gp, 0(pv)
+
+ /* TODO: we really don't need to store everything.
+ alpha_a1: We have to store this in order to return the retval.
+
+ alpha_a0: func pointer can be moved directly to alpha_pv
+ alpha_a3: don't need args after we are finished.
+ alpha_a2: will be moved into alpha_a0... if hasthis is true.
+ */
+ /* store parameters on stack.*/
+ alpha_stq( p, alpha_ra, alpha_sp, SIZE-24 ); // ra
+ alpha_stq( p, alpha_fp, alpha_sp, SIZE-16 ); // fp
+ alpha_stq( p, alpha_a1, alpha_sp, SIZE-8 ); // retval
+
+ /* set the frame pointer */
+ alpha_mov1( p, alpha_sp, alpha_fp );
+
+ /* move the args into t0, pv */
+ alpha_mov1( p, alpha_a0, alpha_pv );
+ alpha_mov1( p, alpha_a3, alpha_t0 );
+
+ // Move the this pointer into a0.
+ if( hasthis )
+ alpha_mov1( p, alpha_a2, alpha_a0 );
+ return p;
+}
+
+static inline guint8 *
+emit_call( guint8 *p , const gint SIZE )
+{
+ // 3 instructions
+ /* call func */
+ alpha_jsr( p, alpha_ra, alpha_pv, 0 ); // jsr ra, 0(pv)
+
+ /* reload the gp */
+ alpha_ldah( p, alpha_gp, alpha_ra, 0 );
+ alpha_lda( p, alpha_gp, alpha_gp, 0 ); // ldgp gp, 0(ra)
+
+ return p;
+}
+
+static inline guint8 *
+emit_store_return_default(guint8 *p, const gint SIZE )
+{
+ // 2 instructions.
+
+ /* TODO: This probably do different stuff based on the value.
+ you know, like stq/l/w. and s/f.
+ */
+ alpha_ldq( p, alpha_t0, alpha_fp, SIZE-8 ); // load void * retval
+ alpha_stq( p, alpha_v0, alpha_t0, 0 ); // store the result to *retval.
+ return p;
+}
+
+
+static inline guint8 *
+emit_epilog (guint8 *p, const gint SIZE )
+{
+ // 5 instructions.
+ alpha_mov1( p, alpha_fp, alpha_sp );
+
+ /* restore fp, ra, sp */
+ alpha_ldq( p, alpha_ra, alpha_sp, SIZE-24 );
+ alpha_ldq( p, alpha_fp, alpha_sp, SIZE-16 );
+ alpha_lda( p, alpha_sp, alpha_sp, SIZE );
+
+ /* return */
+ alpha_ret( p, alpha_ra, 1 );
+ return p;
+}
+
+static void calculate_size(MonoMethodSignature *sig, int * INSTRUCTIONS, int * STACK )
+{
+ int alpharegs;
+
+ alpharegs = AXP_GENERAL_REGS - (sig->hasthis?1:0);
+
+ *STACK = AXP_MIN_STACK_SIZE;
+ *INSTRUCTIONS = 20; // Base: 20 instructions.
+
+ if( sig->param_count - alpharegs > 0 )
+ {
+ *STACK += ARG_SIZE * (sig->param_count - alpharegs );
+ // plus 3 (potential) for each stack parameter.
+ *INSTRUCTIONS += ( sig->param_count - alpharegs ) * 3;
+ // plus 2 (potential) for each register parameter.
+ *INSTRUCTIONS += ( alpharegs * 2 );
+ }
+ else
+ {
+ // plus 2 (potential) for each register parameter.
+ *INSTRUCTIONS += ( sig->param_count * 2 );
+ }
+}
+
+MonoPIFunc
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+{
+ unsigned char *p;
+ unsigned char *buffer;
+ MonoType* param;
+
+ int i, pos;
+ int alpharegs;
+ int hasthis;
+ int STACK_SIZE;
+ int BUFFER_SIZE;
+ int simple_type;
+ int regbase;
+
+ // Set up basic stuff. like has this.
+ hasthis = !!sig->hasthis;
+ alpharegs = AXP_GENERAL_REGS - hasthis;
+ regbase = hasthis?alpha_a1:alpha_a0 ;
+
+ // Make a ballpark estimate for now.
+ calculate_size( sig, &BUFFER_SIZE, &STACK_SIZE );
+
+ // convert to the correct number of bytes.
+ BUFFER_SIZE = BUFFER_SIZE * 4;
+
+
+ // allocate.
+ buffer = p = malloc(BUFFER_SIZE);
+ memset( buffer, 0, BUFFER_SIZE );
+ pos = 0;
+
+ // Ok, start creating this thing.
+ p = emit_prolog( p, STACK_SIZE, hasthis );
+
+ // copy everything into the correct register/stack space
+ for (i = sig->param_count; --i >= 0; )
+ {
+ param = sig->params [i];
+
+ if( param->byref )
+ {
+ if( i > alpharegs )
+ {
+ // load into temp register, then store on the stack
+ alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC( i ));
+ alpha_stl( p, alpha_t1, alpha_sp, pos );
+ pos += 8;
+
+ if( pos > 128 )
+ g_error( "Too large." );
+ }
+ else
+ {
+ // load into register
+ alpha_ldq( p, regbase + i, alpha_t0, ARG_LOC( i ) );
+ }
+ }
+ else
+ {
+ simple_type = param->type;
+ if( simple_type == MONO_TYPE_VALUETYPE )
+ {
+ if (sig->ret->data.klass->enumtype)
+ simple_type = sig->ret->data.klass->enum_basetype->type;
+ }
+
+ switch (simple_type)
+ {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_I8:
+ // 8 bytes
+ if( i > alpharegs )
+ {
+ // load into temp register, then store on the stack
+ alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC( i ) );
+ alpha_stq( p, alpha_t1, alpha_sp, pos );
+ pos += 8;
+ }
+ else
+ {
+ // load into register
+ alpha_ldq( p, regbase + i, alpha_t0, ARG_LOC(i) );
+ }
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ /*
+ // floating point... Maybe this does the correct thing.
+ if( i > alpharegs )
+ {
+ alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC( i ) );
+ alpha_cpys( p, alpha_ft1, alpha_ft1, alpha_ft2 );
+ alpha_stt( p, alpha_ft2, alpha_sp, pos );
+ pos += 8;
+ }
+ else
+ {
+ alpha_ldq( p, alpha_t1, alpha_t0, ARG_LOC(i) );
+ alpha_cpys( p, alpha_ft1, alpha_ft1, alpha_fa0 + i + hasthis );
+ }
+ break;
+ */
+ case MONO_TYPE_VALUETYPE:
+ g_error ("Not implemented: ValueType as parameter to delegate." );
+ break;
+ default:
+ g_error( "Not implemented." );
+ break;
+ }
+ }
+ }
+
+ // Now call the function and store the return parameter.
+ p = emit_call( p, STACK_SIZE );
+ p = emit_store_return_default( p, STACK_SIZE );
+ p = emit_epilog( p, STACK_SIZE );
+
+ if( p > buffer + BUFFER_SIZE )
+ g_error( "Buffer overflow." );
+
+ return (MonoPIFunc)buffer;
+}
+
+void *
+mono_arch_create_method_pointer (MonoMethod *method)
+{
+ g_error ("Unsupported arch");
+ return NULL;
+}
diff --git a/mono/arch/amd64/.cvsignore b/mono/arch/amd64/.cvsignore
new file mode 100644
index 00000000000..e440fafdac7
--- /dev/null
+++ b/mono/arch/amd64/.cvsignore
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.deps
diff --git a/mono/arch/amd64/Makefile.am b/mono/arch/amd64/Makefile.am
new file mode 100644
index 00000000000..54499b5caf2
--- /dev/null
+++ b/mono/arch/amd64/Makefile.am
@@ -0,0 +1,7 @@
+
+INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmonoarch-amd64.la
+
+libmonoarch_amd64_la_SOURCES = tramp.c amd64-codegen.h
+
diff --git a/mono/arch/amd64/amd64-codegen.h b/mono/arch/amd64/amd64-codegen.h
new file mode 100644
index 00000000000..489795b44c5
--- /dev/null
+++ b/mono/arch/amd64/amd64-codegen.h
@@ -0,0 +1,937 @@
+/*
+ * amd64-codegen.h: Macros for generating amd64 code
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ * Intel Corporation (ORP Project)
+ * Sergey Chaban (serge@wildwestsoftware.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
+ * Zalman Stern
+ *
+ * Copyright (C) 2000 Intel Corporation. All rights reserved.
+ * Copyright (C) 2001, 2002 Ximian, Inc.
+ */
+
+#ifndef AMD64_H
+#define AMD64_H
+
+typedef enum {
+ AMD64_RAX = 0,
+ AMD64_RCX = 1,
+ AMD64_RDX = 2,
+ AMD64_RBX = 3,
+ AMD64_RSP = 4,
+ AMD64_RBP = 5,
+ AMD64_RSI = 6,
+ AMD64_RDI = 7,
+ AMD64_R8 = 8,
+ AMD64_R9 = 9,
+ AMD64_R10 = 10,
+ AMD64_R11 = 11,
+ AMD64_R12 = 12,
+ AMD64_R13 = 13,
+ AMD64_R14 = 14,
+ AMD64_R15 = 15,
+ AMD64_RIP = 16,
+ AMD64_NREG
+} AMD64_Reg_No;
+
+typedef enum {
+ AMD64_XMM0 = 0,
+ AMD64_XMM1 = 1,
+ AMD64_XMM2 = 2,
+ AMD64_XMM3 = 3,
+ AMD64_XMM4 = 4,
+ AMD64_XMM5 = 5,
+ AMD64_XMM6 = 6,
+ AMD64_XMM8 = 8,
+ AMD64_XMM9 = 9,
+ AMD64_XMM10 = 10,
+ AMD64_XMM11 = 11,
+ AMD64_XMM12 = 12,
+ AMD64_XMM13 = 13,
+ AMD64_XMM14 = 14,
+ AMD64_XMM15 = 15,
+ AMD64_XMM_NREG = 16,
+} AMD64_XMM_Reg_No;
+
+typedef enum
+{
+ AMD64_REX_B = 1, /* The register in r/m field, base register in SIB byte, or reg in opcode is 8-15 rather than 0-7 */
+ AMD64_REX_X = 2, /* The index register in SIB byte is 8-15 rather than 0-7 */
+ AMD64_REX_R = 4, /* The reg field of ModRM byte is 8-15 rather than 0-7 */
+ AMD64_REX_W = 8 /* Opeartion is 64-bits instead of 32 (default) or 16 (with 0x66 prefix) */
+} AMD64_REX_Bits;
+
+#define AMD64_CALLEE_REGS ((1<<AMD64_RAX) | (1<<AMD64_RCX) | (1<<AMD64_RDX) | (1<<AMD64_RSI) | (1<<AMD64_RDI) | (1<<AMD64_R8) | (1<<AMD64_R9) | (1<<AMD64_R10))
+#define AMD64_IS_CALLEE_REG(reg) (AMD64_CALLEE_REGS & (1 << (reg)))
+
+#define AMD64_ARGUMENT_REGS ((1<<AMD64_RDI) | (1<<AMD64_RSI) | (1<<AMD64_RDX) | (1<<AMD64_RCX) | (1<<AMD64_R8) | (1<<AMD64_R9))
+#define AMD64_IS_ARGUMENT_REG(reg) (AMD64_ARGUMENT_REGS & (1 << (reg)))
+
+#define AMD64_CALLEE_SAVED_REGS ((1<<AMD64_RBX) | (1<<AMD64_R12) | (1<<AMD64_R13) | (1<<AMD64_R14) | (1<<AMD64_R15))
+#define AMD64_IS_CALLEE_SAVED_REG(reg) (AMD64_CALLEE_SAVED_REGS & (1 << (reg)))
+
+#define AMD64_REX(bits) ((unsigned char)(0x40 | (bits)))
+#define amd64_emit_rex(inst, width, reg_modrm, reg_index, reg_rm_base_opcode) do \
+ { \
+ unsigned char _amd64_rex_bits = \
+ (((width) > 4) ? AMD64_REX_W : 0) | \
+ (((reg_modrm) > 7) ? AMD64_REX_R : 0) | \
+ (((reg_index) > 7) ? AMD64_REX_X : 0) | \
+ (((reg_rm_base_opcode) > 7) ? AMD64_REX_B : 0); \
+ if (_amd64_rex_bits != 0) *(inst)++ = AMD64_REX(_amd64_rex_bits); \
+ } while (0)
+
+typedef union {
+ long val;
+ unsigned char b [8];
+} amd64_imm_buf;
+
+#include "../x86/x86-codegen.h"
+
+#undef X86_IS_BYTE_REG
+#define X86_IS_BYTE_REG(reg) 1
+
+/* Need to fill this info in for amd64. */
+
+#if 0
+/*
+// bitvector mask for callee-saved registers
+*/
+#define X86_ESI_MASK (1<<X86_ESI)
+#define X86_EDI_MASK (1<<X86_EDI)
+#define X86_EBX_MASK (1<<X86_EBX)
+#define X86_EBP_MASK (1<<X86_EBP)
+
+#define X86_CALLEE_REGS ((1<<X86_EAX) | (1<<X86_ECX) | (1<<X86_EDX))
+#define X86_CALLER_REGS ((1<<X86_EBX) | (1<<X86_EBP) | (1<<X86_ESI) | (1<<X86_EDI))
+#define X86_BYTE_REGS ((1<<X86_EAX) | (1<<X86_ECX) | (1<<X86_EDX) | (1<<X86_EBX))
+
+#define X86_IS_SCRATCH(reg) (X86_CALLER_REGS & (1 << (reg))) /* X86_EAX, X86_ECX, or X86_EDX */
+#define X86_IS_CALLEE(reg) (X86_CALLEE_REGS & (1 << (reg))) /* X86_ESI, X86_EDI, X86_EBX, or X86_EBP */
+
+#define X86_IS_BYTE_REG(reg) ((reg) < 4)
+
+/*
+// Frame structure:
+//
+// +--------------------------------+
+// | in_arg[0] = var[0] |
+// | in_arg[1] = var[1] |
+// | . . . |
+// | in_arg[n_arg-1] = var[n_arg-1] |
+// +--------------------------------+
+// | return IP |
+// +--------------------------------+
+// | saved EBP | <-- frame pointer (EBP)
+// +--------------------------------+
+// | ... | n_extra
+// +--------------------------------+
+// | var[n_arg] |
+// | var[n_arg+1] | local variables area
+// | . . . |
+// | var[n_var-1] |
+// +--------------------------------+
+// | |
+// | |
+// | spill area | area for spilling mimic stack
+// | |
+// +--------------------------------|
+// | ebx |
+// | ebp [ESP_Frame only] |
+// | esi | 0..3 callee-saved regs
+// | edi | <-- stack pointer (ESP)
+// +--------------------------------+
+// | stk0 |
+// | stk1 | operand stack area/
+// | . . . | out args
+// | stkn-1 |
+// +--------------------------------|
+//
+//
+*/
+#endif
+
+#define amd64_modrm_mod(modrm) ((modrm) >> 6)
+#define amd64_modrm_reg(modrm) (((modrm) >> 3) & 0x7)
+#define amd64_modrm_rm(modrm) ((modrm) & 0x7)
+
+#define amd64_rex_r(rex) ((((rex) >> 2) & 0x1) << 3)
+#define amd64_rex_x(rex) ((((rex) >> 1) & 0x1) << 3)
+#define amd64_rex_b(rex) ((((rex) >> 0) & 0x1) << 3)
+
+#define amd64_is_imm32(val) ((glong)val >= -((glong)1<<31) && (glong)val <= (((glong)1<<31)-1))
+
+#define x86_imm_emit64(inst,imm) \
+ do { \
+ amd64_imm_buf imb; imb.val = (long) (imm); \
+ *(inst)++ = imb.b [0]; \
+ *(inst)++ = imb.b [1]; \
+ *(inst)++ = imb.b [2]; \
+ *(inst)++ = imb.b [3]; \
+ *(inst)++ = imb.b [4]; \
+ *(inst)++ = imb.b [5]; \
+ *(inst)++ = imb.b [6]; \
+ *(inst)++ = imb.b [7]; \
+ } while (0)
+
+#define amd64_alu_reg_imm_size(inst,opc,reg,imm,size) \
+ do { \
+ if ((reg) == X86_EAX) { \
+ amd64_emit_rex(inst, size, 0, 0, 0); \
+ *(inst)++ = (((unsigned char)(opc)) << 3) + 5; \
+ x86_imm_emit32 ((inst), (imm)); \
+ break; \
+ } \
+ if (x86_is_imm8((imm))) { \
+ amd64_emit_rex(inst, size, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x83; \
+ x86_reg_emit ((inst), (opc), (reg)); \
+ x86_imm_emit8 ((inst), (imm)); \
+ } else { \
+ amd64_emit_rex(inst, size, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x81; \
+ x86_reg_emit ((inst), (opc), (reg)); \
+ x86_imm_emit32 ((inst), (imm)); \
+ } \
+ } while (0)
+
+#define amd64_alu_reg_imm(inst,opc,reg,imm) amd64_alu_reg_imm_size((inst),(opc),(reg),(imm),8)
+
+#define amd64_alu_reg_reg_size(inst,opc,dreg,reg,size) \
+ do { \
+ amd64_emit_rex(inst, size, (dreg), 0, (reg)); \
+ *(inst)++ = (((unsigned char)(opc)) << 3) + 3; \
+ x86_reg_emit ((inst), (dreg), (reg)); \
+ } while (0)
+
+#define amd64_alu_reg_reg(inst,opc,dreg,reg) amd64_alu_reg_reg_size ((inst),(opc),(dreg),(reg),8)
+
+#define amd64_mov_regp_reg(inst,regp,reg,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, (regp)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x88; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x89; break; \
+ default: assert (0); \
+ } \
+ x86_regp_emit ((inst), (reg), (regp)); \
+ } while (0)
+
+#define amd64_mov_membase_reg(inst,basereg,disp,reg,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, (basereg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x88; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x89; break; \
+ default: assert (0); \
+ } \
+ x86_membase_emit ((inst), ((reg)&0x7), ((basereg)&0x7), (disp)); \
+ } while (0)
+
+
+#define amd64_mov_reg_reg(inst,dreg,reg,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (dreg), 0, (reg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x8a; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_reg_emit ((inst), (dreg), (reg)); \
+ } while (0)
+
+#define amd64_mov_reg_mem(inst,reg,mem,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, 0); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x8a; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_address_byte ((inst), 0, (reg), 4); \
+ x86_address_byte ((inst), 0, 4, 5); \
+ x86_imm_emit32 ((inst), (mem)); \
+ } while (0)
+
+#define amd64_mov_reg_membase(inst,reg,basereg,disp,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, (basereg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x8a; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_membase_emit ((inst), ((reg)&0x7), ((basereg)&0x7), (disp)); \
+ } while (0)
+
+#define amd64_movzx_reg_membase(inst,reg,basereg,disp,size) \
+ do { \
+ amd64_emit_rex(inst, (size), (reg), 0, (basereg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x0f; *(inst)++ = (unsigned char)0xb6; break; \
+ case 2: *(inst)++ = (unsigned char)0x0f; *(inst)++ = (unsigned char)0xb7; break; \
+ case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_membase_emit ((inst), ((reg)&0x7), ((basereg)&0x7), (disp)); \
+ } while (0)
+
+#define amd64_movsxd_reg_membase(inst,reg,basereg,disp) \
+ do { \
+ amd64_emit_rex(inst,8,(reg),0,(basereg)); \
+ *(inst)++ = (unsigned char)0x63; \
+ x86_membase_emit ((inst), ((reg)&0x7), ((basereg)&0x7), (disp)); \
+ } while (0)
+
+#define amd64_movsxd_reg_reg(inst,dreg,reg) \
+ do { \
+ amd64_emit_rex(inst,8,(dreg),0,(reg)); \
+ *(inst)++ = (unsigned char)0x63; \
+ x86_reg_emit ((inst), (dreg), (reg)); \
+ } while (0)
+
+/* Pretty much the only instruction that supports a 64-bit immediate. Optimize for common case of
+ * 32-bit immediate. Pepper with casts to avoid warnings.
+ */
+#define amd64_mov_reg_imm_size(inst,reg,imm,size) \
+ do { \
+ amd64_emit_rex(inst, (size), 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0xb8 + ((reg) & 0x7); \
+ if ((size) == 8) \
+ x86_imm_emit64 ((inst), (long)(imm)); \
+ else \
+ x86_imm_emit32 ((inst), (int)(long)(imm)); \
+ } while (0)
+
+#define amd64_mov_reg_imm(inst,reg,imm) \
+ do { \
+ int _amd64_width_temp = ((long)(imm) == (long)(int)(long)(imm)); \
+ amd64_mov_reg_imm_size ((inst), (reg), (imm), (_amd64_width_temp ? 4 : 8)); \
+ } while (0)
+
+#define amd64_set_reg_template(inst,reg) amd64_mov_reg_imm_size ((inst),(reg), 0, 8)
+
+#define amd64_set_template(inst,reg) amd64_set_reg_template((inst),(reg))
+
+#define amd64_mov_membase_imm(inst,basereg,disp,imm,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), 0, 0, (basereg)); \
+ if ((size) == 1) { \
+ *(inst)++ = (unsigned char)0xc6; \
+ x86_membase_emit ((inst), 0, (basereg) & 0x7, (disp)); \
+ x86_imm_emit8 ((inst), (imm)); \
+ } else if ((size) == 2) { \
+ *(inst)++ = (unsigned char)0xc7; \
+ x86_membase_emit ((inst), 0, (basereg) & 0x7, (disp)); \
+ x86_imm_emit16 ((inst), (imm)); \
+ } else { \
+ *(inst)++ = (unsigned char)0xc7; \
+ x86_membase_emit ((inst), 0, (basereg) & 0x7, (disp)); \
+ x86_imm_emit32 ((inst), (imm)); \
+ } \
+ } while (0)
+
+#define amd64_membase_emit(inst,reg,basereg,disp) do { \
+ if ((basereg) == AMD64_RIP) { \
+ x86_address_byte ((inst), 0, (reg)&0x7, 5); \
+ x86_imm_emit32 ((inst), (disp)); \
+ } \
+ else \
+ x86_membase_emit ((inst),(reg)&0x7, (basereg)&0x7, (disp)); \
+} while (0)
+
+#define amd64_lea_membase(inst,reg,basereg,disp) \
+ do { \
+ amd64_emit_rex(inst, 8, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x8d; \
+ amd64_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+/* Instruction are implicitly 64-bits so don't generate REX for just the size. */
+#define amd64_push_reg(inst,reg) \
+ do { \
+ amd64_emit_rex(inst, 0, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x50 + ((reg) & 0x7); \
+ } while (0)
+
+/* Instruction is implicitly 64-bits so don't generate REX for just the size. */
+#define amd64_push_membase(inst,basereg,disp) \
+ do { \
+ amd64_emit_rex(inst, 0, 0, 0, (basereg)); \
+ *(inst)++ = (unsigned char)0xff; \
+ x86_membase_emit ((inst), 6, (basereg) & 0x7, (disp)); \
+ } while (0)
+
+#define amd64_pop_reg(inst,reg) \
+ do { \
+ amd64_emit_rex(inst, 0, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x58 + ((reg) & 0x7); \
+ } while (0)
+
+#define amd64_call_reg(inst,reg) \
+ do { \
+ amd64_emit_rex(inst, 8, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0xff; \
+ x86_reg_emit ((inst), 2, ((reg) & 0x7)); \
+ } while (0)
+
+#define amd64_ret(inst) do { *(inst)++ = (unsigned char)0xc3; } while (0)
+#define amd64_leave(inst) do { *(inst)++ = (unsigned char)0xc9; } while (0)
+#define amd64_movsd_reg_regp(inst,reg,regp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_regp_emit ((inst), (reg) & 0x7, (regp) & 0x7); \
+ } while (0)
+
+#define amd64_movsd_regp_reg(inst,regp,reg) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_regp_emit ((inst), (reg) & 0x7, (regp) & 0x7); \
+ } while (0)
+
+#define amd64_movss_reg_regp(inst,reg,regp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_regp_emit ((inst), (reg) & 0x7, (regp) & 0x7); \
+ } while (0)
+
+#define amd64_movss_regp_reg(inst,regp,reg) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_regp_emit ((inst), (reg) & 0x7, (regp) & 0x7); \
+ } while (0)
+
+#define amd64_movsd_reg_membase(inst,reg,basereg,disp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_membase_emit ((inst), (reg) & 0x7, (basereg) & 0x7, (disp)); \
+ } while (0)
+
+#define amd64_movss_reg_membase(inst,reg,basereg,disp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_membase_emit ((inst), (reg) & 0x7, (basereg) & 0x7, (disp)); \
+ } while (0)
+
+#define amd64_movsd_membase_reg(inst,basereg,disp,reg) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_membase_emit ((inst), (reg) & 0x7, (basereg) & 0x7, (disp)); \
+ } while (0)
+
+#define amd64_movss_membase_reg(inst,basereg,disp,reg) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_membase_emit ((inst), (reg) & 0x7, (basereg) & 0x7, (disp)); \
+ } while (0)
+
+/* The original inc_reg opcode is used as the REX prefix */
+#define amd64_inc_reg_size(inst,reg,size) \
+ do { \
+ amd64_emit_rex ((inst),(size),0,0,(reg)); \
+ *(inst)++ = (unsigned char)0xff; \
+ x86_reg_emit ((inst),0,(reg) & 0x7); \
+ } while (0)
+
+#define amd64_dec_reg_size(inst,reg,size) \
+ do { \
+ amd64_emit_rex ((inst),(size),0,0,(reg)); \
+ *(inst)++ = (unsigned char)0xff; \
+ x86_reg_emit ((inst),1,(reg) & 0x7); \
+ } while (0)
+
+#define amd64_padding_size(inst,size) \
+ do { if (size == 1) x86_padding ((inst),(size)); else { amd64_emit_rex ((inst),8,0,0,0); x86_padding((inst),(size) - 1); } } while (0)
+
+#define amd64_fld_membase_size(inst,basereg,disp,is_double,size) do { \
+ amd64_emit_rex ((inst),0,0,0,(basereg)); \
+ *(inst)++ = (is_double) ? (unsigned char)0xdd : (unsigned char)0xd9; \
+ amd64_membase_emit ((inst), 0, (basereg), (disp)); \
+} while (0)
+
+/*
+ * SSE
+ */
+
+#define emit_opcode3(inst,op1,op2,op3) do { \
+ *(inst)++ = (unsigned char)(op1); \
+ *(inst)++ = (unsigned char)(op2); \
+ *(inst)++ = (unsigned char)(op3); \
+} while (0)
+
+#define emit_sse_reg_reg_size(inst,dreg,reg,op1,op2,op3,size) do { \
+ *(inst)++ = (unsigned char)(op1); \
+ amd64_emit_rex ((inst), size, (dreg), 0, (reg)); \
+ *(inst)++ = (unsigned char)(op2); \
+ *(inst)++ = (unsigned char)(op3); \
+ x86_reg_emit ((inst), (dreg), (reg)); \
+} while (0)
+
+#define emit_sse_reg_reg(inst,dreg,reg,op1,op2,op3) emit_sse_reg_reg_size ((inst), (dreg), (reg), (op1), (op2), (op3), 0)
+
+#define emit_sse_membase_reg(inst,basereg,disp,reg,op1,op2,op3) do { \
+ *(inst)++ = (unsigned char)(op1); \
+ amd64_emit_rex ((inst), 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)(op2); \
+ *(inst)++ = (unsigned char)(op3); \
+ amd64_membase_emit ((inst), (reg), (basereg), (disp)); \
+} while (0)
+
+#define emit_sse_reg_membase(inst,dreg,basereg,disp,op1,op2,op3) do { \
+ *(inst)++ = (unsigned char)(op1); \
+ amd64_emit_rex ((inst), 0, (dreg), 0, (basereg) == AMD64_RIP ? 0 : (basereg)); \
+ *(inst)++ = (unsigned char)(op2); \
+ *(inst)++ = (unsigned char)(op3); \
+ amd64_membase_emit ((inst), (dreg), (basereg), (disp)); \
+} while (0)
+
+#define amd64_sse_xorpd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst),(dreg),(reg), 0x66, 0x0f, 0x57)
+
+#define amd64_sse_xorpd_reg_membase(inst,dreg,basereg,disp) emit_sse_reg_membase ((inst),(dreg),(basereg), (disp), 0x66, 0x0f, 0x57)
+
+#define amd64_sse_movsd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf2, 0x0f, 0x10)
+
+#define amd64_sse_movsd_reg_membase(inst,dreg,basereg,disp) emit_sse_reg_membase ((inst), (dreg), (basereg), (disp), 0xf2, 0x0f, 0x10)
+
+#define amd64_sse_movsd_membase_reg(inst,basereg,disp,reg) emit_sse_membase_reg ((inst), (basereg), (disp), (reg), 0xf2, 0x0f, 0x11)
+
+#define amd64_sse_movss_membase_reg(inst,basereg,disp,reg) emit_sse_membase_reg ((inst), (basereg), (disp), (reg), 0xf3, 0x0f, 0x11)
+
+#define amd64_sse_movss_reg_membase(inst,dreg,basereg,disp) emit_sse_reg_membase ((inst), (dreg), (basereg), (disp), 0xf3, 0x0f, 0x10)
+
+#define amd64_sse_comisd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst),(dreg),(reg),0x66,0x0f,0x2f)
+
+#define amd64_sse_cvtsd2si_reg_reg(inst,dreg,reg) emit_sse_reg_reg_size ((inst), (dreg), (reg), 0xf2, 0x0f, 0x2d, 0)
+
+#define amd64_sse_cvtsi2sd_reg_reg(inst,dreg,reg) emit_sse_reg_reg_size ((inst), (dreg), (reg), 0xf2, 0x0f, 0x2a, 8)
+
+#define amd64_sse_cvtsd2ss_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf2, 0x0f, 0x5a)
+
+#define amd64_sse_cvtss2sd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf3, 0x0f, 0x5a)
+
+#define amd64_sse_addsd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf2, 0x0f, 0x58)
+
+#define amd64_sse_subsd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf2, 0x0f, 0x5c)
+
+#define amd64_sse_mulsd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf2, 0x0f, 0x59)
+
+#define amd64_sse_divsd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf2, 0x0f, 0x5e)
+
+/* Generated from x86-codegen.h */
+
+#define amd64_breakpoint_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_breakpoint(inst); } while (0)
+#define amd64_cld_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_cld(inst); } while (0)
+#define amd64_stosb_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_stosb(inst); } while (0)
+#define amd64_stosl_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_stosl(inst); } while (0)
+#define amd64_stosd_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_stosd(inst); } while (0)
+#define amd64_movsb_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_movsb(inst); } while (0)
+#define amd64_movsl_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_movsl(inst); } while (0)
+#define amd64_movsd_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_movsd(inst); } while (0)
+#define amd64_prefix_size(inst,p,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_prefix((inst), p); } while (0)
+#define amd64_rdtsc_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_rdtsc(inst); } while (0)
+#define amd64_cmpxchg_reg_reg_size(inst,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_cmpxchg_reg_reg((inst),((dreg)&0x7),((reg)&0x7)); } while (0)
+#define amd64_cmpxchg_mem_reg_size(inst,mem,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_cmpxchg_mem_reg((inst),(mem),((reg)&0x7)); } while (0)
+#define amd64_cmpxchg_membase_reg_size(inst,basereg,disp,reg,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_cmpxchg_membase_reg((inst),((basereg)&0x7),(disp),((reg)&0x7)); } while (0)
+#define amd64_xchg_reg_reg_size(inst,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_xchg_reg_reg((inst),((dreg)&0x7),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_xchg_mem_reg_size(inst,mem,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_xchg_mem_reg((inst),(mem),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_xchg_membase_reg_size(inst,basereg,disp,reg,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg))); x86_xchg_membase_reg((inst),((basereg)&0x7),(disp),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_inc_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_inc_mem((inst),(mem)); } while (0)
+#define amd64_inc_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_inc_membase((inst),((basereg)&0x7),(disp)); } while (0)
+//#define amd64_inc_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_inc_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_dec_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_dec_mem((inst),(mem)); } while (0)
+#define amd64_dec_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_dec_membase((inst),((basereg)&0x7),(disp)); } while (0)
+//#define amd64_dec_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_dec_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_not_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_not_mem((inst),(mem)); } while (0)
+#define amd64_not_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_not_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_not_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_not_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_neg_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_neg_mem((inst),(mem)); } while (0)
+#define amd64_neg_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_neg_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_neg_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_neg_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_nop_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_nop(inst); } while (0)
+//#define amd64_alu_reg_imm_size(inst,opc,reg,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_alu_reg_imm((inst),(opc),((reg)&0x7),(imm)); } while (0)
+#define amd64_alu_mem_imm_size(inst,opc,mem,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_alu_mem_imm((inst),(opc),(mem),(imm)); } while (0)
+#define amd64_alu_membase_imm_size(inst,opc,basereg,disp,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_alu_membase_imm((inst),(opc),((basereg)&0x7),(disp),(imm)); } while (0)
+#define amd64_alu_mem_reg_size(inst,opc,mem,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_alu_mem_reg((inst),(opc),(mem),((reg)&0x7)); } while (0)
+#define amd64_alu_membase_reg_size(inst,opc,basereg,disp,reg,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_alu_membase_reg((inst),(opc),((basereg)&0x7),(disp),((reg)&0x7)); } while (0)
+//#define amd64_alu_reg_reg_size(inst,opc,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_alu_reg_reg((inst),(opc),((dreg)&0x7),((reg)&0x7)); } while (0)
+#define amd64_alu_reg8_reg8_size(inst,opc,dreg,reg,is_dreg_h,is_reg_h,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_alu_reg8_reg8((inst),(opc),((dreg)&0x7),((reg)&0x7),(is_dreg_h),(is_reg_h)); } while (0)
+#define amd64_alu_reg_mem_size(inst,opc,reg,mem,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_alu_reg_mem((inst),(opc),((reg)&0x7),(mem)); } while (0)
+#define amd64_alu_reg_membase_size(inst,opc,reg,basereg,disp,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_alu_reg_membase((inst),(opc),((reg)&0x7),((basereg)&0x7),(disp)); } while (0)
+#define amd64_test_reg_imm_size(inst,reg,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_test_reg_imm((inst),((reg)&0x7),(imm)); } while (0)
+#define amd64_test_mem_imm_size(inst,mem,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_test_mem_imm((inst),(mem),(imm)); } while (0)
+#define amd64_test_membase_imm_size(inst,basereg,disp,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_test_membase_imm((inst),((basereg)&0x7),(disp),(imm)); } while (0)
+#define amd64_test_reg_reg_size(inst,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_test_reg_reg((inst),((dreg)&0x7),((reg)&0x7)); } while (0)
+#define amd64_test_mem_reg_size(inst,mem,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_test_mem_reg((inst),(mem),((reg)&0x7)); } while (0)
+#define amd64_test_membase_reg_size(inst,basereg,disp,reg,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_test_membase_reg((inst),((basereg)&0x7),(disp),((reg)&0x7)); } while (0)
+#define amd64_shift_reg_imm_size(inst,opc,reg,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_shift_reg_imm((inst),(opc),((reg)&0x7),(imm)); } while (0)
+#define amd64_shift_mem_imm_size(inst,opc,mem,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_shift_mem_imm((inst),(opc),(mem),(imm)); } while (0)
+#define amd64_shift_membase_imm_size(inst,opc,basereg,disp,imm,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_shift_membase_imm((inst),(opc),((basereg)&0x7),(disp),(imm)); } while (0)
+#define amd64_shift_reg_size(inst,opc,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_shift_reg((inst),(opc),((reg)&0x7)); } while (0)
+#define amd64_shift_mem_size(inst,opc,mem,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_shift_mem((inst),(opc),(mem)); } while (0)
+#define amd64_shift_membase_size(inst,opc,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_shift_membase((inst),(opc),((basereg)&0x7),(disp)); } while (0)
+#define amd64_shrd_reg_size(inst,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_shrd_reg((inst),((dreg)&0x7),((reg)&0x7)); } while (0)
+#define amd64_shrd_reg_imm_size(inst,dreg,reg,shamt,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_shrd_reg_imm((inst),((dreg)&0x7),((reg)&0x7),(shamt)); } while (0)
+#define amd64_shld_reg_size(inst,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_shld_reg((inst),((dreg)&0x7),((reg)&0x7)); } while (0)
+#define amd64_shld_reg_imm_size(inst,dreg,reg,shamt,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_shld_reg_imm((inst),((dreg)&0x7),((reg)&0x7),(shamt)); } while (0)
+#define amd64_mul_reg_size(inst,reg,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_mul_reg((inst),((reg)&0x7),(is_signed)); } while (0)
+#define amd64_mul_mem_size(inst,mem,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_mul_mem((inst),(mem),(is_signed)); } while (0)
+#define amd64_mul_membase_size(inst,basereg,disp,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_mul_membase((inst),((basereg)&0x7),(disp),(is_signed)); } while (0)
+#define amd64_imul_reg_reg_size(inst,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_imul_reg_reg((inst),((dreg)&0x7),((reg)&0x7)); } while (0)
+#define amd64_imul_reg_mem_size(inst,reg,mem,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_imul_reg_mem((inst),((reg)&0x7),(mem)); } while (0)
+#define amd64_imul_reg_membase_size(inst,reg,basereg,disp,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_imul_reg_membase((inst),((reg)&0x7),((basereg)&0x7),(disp)); } while (0)
+#define amd64_imul_reg_reg_imm_size(inst,dreg,reg,imm,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_imul_reg_reg_imm((inst),((dreg)&0x7),((reg)&0x7),(imm)); } while (0)
+#define amd64_imul_reg_mem_imm_size(inst,reg,mem,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_imul_reg_mem_imm((inst),((reg)&0x7),(mem),(imm)); } while (0)
+#define amd64_imul_reg_membase_imm_size(inst,reg,basereg,disp,imm,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_imul_reg_membase_imm((inst),((reg)&0x7),((basereg)&0x7),(disp),(imm)); } while (0)
+#define amd64_div_reg_size(inst,reg,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_div_reg((inst),((reg)&0x7),(is_signed)); } while (0)
+#define amd64_div_mem_size(inst,mem,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_div_mem((inst),(mem),(is_signed)); } while (0)
+#define amd64_div_membase_size(inst,basereg,disp,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_div_membase((inst),((basereg)&0x7),(disp),(is_signed)); } while (0)
+#define amd64_mov_mem_reg_size(inst,mem,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_mov_mem_reg((inst),(mem),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+//#define amd64_mov_regp_reg_size(inst,regp,reg,size) do { amd64_emit_rex ((inst),(size),(regp),0,(reg)); x86_mov_regp_reg((inst),(regp),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+//#define amd64_mov_membase_reg_size(inst,basereg,disp,reg,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_mov_membase_reg((inst),((basereg)&0x7),(disp),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_mov_memindex_reg_size(inst,basereg,disp,indexreg,shift,reg,size) do { amd64_emit_rex ((inst),(size),(reg),(indexreg),(basereg)); x86_mov_memindex_reg((inst),((basereg)&0x7),(disp),((indexreg)&0x7),(shift),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_mov_reg_reg_size(inst,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_mov_reg_reg((inst),((dreg)&0x7),((reg)&0x7),(size) == 8 ? 4 : (size)); } while (0)
+//#define amd64_mov_reg_mem_size(inst,reg,mem,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_mov_reg_mem((inst),((reg)&0x7),(mem),(size) == 8 ? 4 : (size)); } while (0)
+//#define amd64_mov_reg_membase_size(inst,reg,basereg,disp,size) do { amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_mov_reg_membase((inst),((reg)&0x7),((basereg)&0x7),(disp),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_mov_reg_memindex_size(inst,reg,basereg,disp,indexreg,shift,size) do { amd64_emit_rex ((inst),(size),(reg),(indexreg),(basereg)); x86_mov_reg_memindex((inst),((reg)&0x7),((basereg)&0x7),(disp),((indexreg)&0x7),(shift),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_clear_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_clear_reg((inst),((reg)&0x7)); } while (0)
+//#define amd64_mov_reg_imm_size(inst,reg,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_mov_reg_imm((inst),((reg)&0x7),(imm)); } while (0)
+#define amd64_mov_mem_imm_size(inst,mem,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_mov_mem_imm((inst),(mem),(imm),(size) == 8 ? 4 : (size)); } while (0)
+//#define amd64_mov_membase_imm_size(inst,basereg,disp,imm,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_mov_membase_imm((inst),((basereg)&0x7),(disp),(imm),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_mov_memindex_imm_size(inst,basereg,disp,indexreg,shift,imm,size) do { amd64_emit_rex ((inst),(size),0,(indexreg),(basereg)); x86_mov_memindex_imm((inst),((basereg)&0x7),(disp),((indexreg)&0x7),(shift),(imm),(size) == 8 ? 4 : (size)); } while (0)
+#define amd64_lea_mem_size(inst,reg,mem,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_lea_mem((inst),((reg)&0x7),(mem)); } while (0)
+//#define amd64_lea_membase_size(inst,reg,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_lea_membase((inst),((reg)&0x7),((basereg)&0x7),(disp)); } while (0)
+#define amd64_lea_memindex_size(inst,reg,basereg,disp,indexreg,shift,size) do { amd64_emit_rex ((inst),(size),(reg),(indexreg),(basereg)); x86_lea_memindex((inst),((reg)&0x7),((basereg)&0x7),(disp),((indexreg)&0x7),(shift)); } while (0)
+#define amd64_widen_reg_size(inst,dreg,reg,is_signed,is_half,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_widen_reg((inst),((dreg)&0x7),((reg)&0x7),(is_signed),(is_half)); } while (0)
+#define amd64_widen_mem_size(inst,dreg,mem,is_signed,is_half,size) do { amd64_emit_rex ((inst),(size),(dreg),0,0); x86_widen_mem((inst),((dreg)&0x7),(mem),(is_signed),(is_half)); } while (0)
+#define amd64_widen_membase_size(inst,dreg,basereg,disp,is_signed,is_half,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(basereg)); x86_widen_membase((inst),((dreg)&0x7),((basereg)&0x7),(disp),(is_signed),(is_half)); } while (0)
+#define amd64_widen_memindex_size(inst,dreg,basereg,disp,indexreg,shift,is_signed,is_half,size) do { amd64_emit_rex ((inst),(size),(dreg),(indexreg),(basereg)); x86_widen_memindex((inst),((dreg)&0x7),((basereg)&0x7),(disp),((indexreg)&0x7),(shift),(is_signed),(is_half)); } while (0)
+#define amd64_cdq_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_cdq(inst); } while (0)
+#define amd64_wait_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_wait(inst); } while (0)
+#define amd64_fp_op_mem_size(inst,opc,mem,is_double,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fp_op_mem((inst),(opc),(mem),(is_double)); } while (0)
+#define amd64_fp_op_membase_size(inst,opc,basereg,disp,is_double,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fp_op_membase((inst),(opc),((basereg)&0x7),(disp),(is_double)); } while (0)
+#define amd64_fp_op_size(inst,opc,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fp_op((inst),(opc),(index)); } while (0)
+#define amd64_fp_op_reg_size(inst,opc,index,pop_stack,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fp_op_reg((inst),(opc),(index),(pop_stack)); } while (0)
+#define amd64_fp_int_op_membase_size(inst,opc,basereg,disp,is_int,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fp_int_op_membase((inst),(opc),((basereg)&0x7),(disp),(is_int)); } while (0)
+#define amd64_fstp_size(inst,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fstp((inst),(index)); } while (0)
+#define amd64_fcompp_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fcompp(inst); } while (0)
+#define amd64_fucompp_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fucompp(inst); } while (0)
+#define amd64_fnstsw_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fnstsw(inst); } while (0)
+#define amd64_fnstcw_size(inst,mem,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fnstcw((inst),(mem)); } while (0)
+#define amd64_fnstcw_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_fnstcw_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_fldcw_size(inst,mem,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fldcw((inst),(mem)); } while (0)
+#define amd64_fldcw_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fldcw_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_fchs_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fchs(inst); } while (0)
+#define amd64_frem_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_frem(inst); } while (0)
+#define amd64_fxch_size(inst,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fxch((inst),(index)); } while (0)
+#define amd64_fcomi_size(inst,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fcomi((inst),(index)); } while (0)
+#define amd64_fcomip_size(inst,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fcomip((inst),(index)); } while (0)
+#define amd64_fucomi_size(inst,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fucomi((inst),(index)); } while (0)
+#define amd64_fucomip_size(inst,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fucomip((inst),(index)); } while (0)
+#define amd64_fld_size(inst,mem,is_double,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fld((inst),(mem),(is_double)); } while (0)
+//#define amd64_fld_membase_size(inst,basereg,disp,is_double,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fld_membase((inst),((basereg)&0x7),(disp),(is_double)); } while (0)
+#define amd64_fld80_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fld80_mem((inst),(mem)); } while (0)
+#define amd64_fld80_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_fld80_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_fild_size(inst,mem,is_long,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fild((inst),(mem),(is_long)); } while (0)
+#define amd64_fild_membase_size(inst,basereg,disp,is_long,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fild_membase((inst),((basereg)&0x7),(disp),(is_long)); } while (0)
+#define amd64_fld_reg_size(inst,index,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fld_reg((inst),(index)); } while (0)
+#define amd64_fldz_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fldz(inst); } while (0)
+#define amd64_fld1_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fld1(inst); } while (0)
+#define amd64_fldpi_size(inst,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fldpi(inst); } while (0)
+#define amd64_fst_size(inst,mem,is_double,pop_stack,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fst((inst),(mem),(is_double),(pop_stack)); } while (0)
+#define amd64_fst_membase_size(inst,basereg,disp,is_double,pop_stack,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fst_membase((inst),((basereg)&0x7),(disp),(is_double),(pop_stack)); } while (0)
+#define amd64_fst80_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fst80_mem((inst),(mem)); } while (0)
+#define amd64_fst80_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fst80_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_fist_pop_size(inst,mem,is_long,size) do { amd64_emit_rex ((inst),0,0,0,0); x86_fist_pop((inst),(mem),(is_long)); } while (0)
+#define amd64_fist_pop_membase_size(inst,basereg,disp,is_long,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fist_pop_membase((inst),((basereg)&0x7),(disp),(is_long)); } while (0)
+#define amd64_fstsw_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fstsw(inst); } while (0)
+#define amd64_fist_membase_size(inst,basereg,disp,is_int,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_fist_membase((inst),((basereg)&0x7),(disp),(is_int)); } while (0)
+//#define amd64_push_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_push_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_push_regp_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_push_regp((inst),((reg)&0x7)); } while (0)
+#define amd64_push_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_push_mem((inst),(mem)); } while (0)
+//#define amd64_push_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_push_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_push_memindex_size(inst,basereg,disp,indexreg,shift,size) do { amd64_emit_rex ((inst),(size),0,(indexreg),(basereg)); x86_push_memindex((inst),((basereg)&0x7),(disp),((indexreg)&0x7),(shift)); } while (0)
+#define amd64_push_imm_size(inst,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_push_imm((inst),(imm)); } while (0)
+//#define amd64_pop_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_pop_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_pop_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_pop_mem((inst),(mem)); } while (0)
+#define amd64_pop_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_pop_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_pushad_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_pushad(inst); } while (0)
+#define amd64_pushfd_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_pushfd(inst); } while (0)
+#define amd64_popad_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_popad(inst); } while (0)
+#define amd64_popfd_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_popfd(inst); } while (0)
+#define amd64_loop_size(inst,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_loop((inst),(imm)); } while (0)
+#define amd64_loope_size(inst,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_loope((inst),(imm)); } while (0)
+#define amd64_loopne_size(inst,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_loopne((inst),(imm)); } while (0)
+#define amd64_jump32_size(inst,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_jump32((inst),(imm)); } while (0)
+#define amd64_jump8_size(inst,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_jump8((inst),(imm)); } while (0)
+#define amd64_jump_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_jump_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_jump_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_jump_mem((inst),(mem)); } while (0)
+#define amd64_jump_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_jump_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_jump_code_size(inst,target,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_jump_code((inst),(target)); } while (0)
+#define amd64_jump_disp_size(inst,disp,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_jump_disp((inst),(disp)); } while (0)
+#define amd64_branch8_size(inst,cond,imm,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_branch8((inst),(cond),(imm),(is_signed)); } while (0)
+#define amd64_branch32_size(inst,cond,imm,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_branch32((inst),(cond),(imm),(is_signed)); } while (0)
+#define amd64_branch_size(inst,cond,target,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_branch((inst),(cond),(target),(is_signed)); } while (0)
+#define amd64_branch_disp_size(inst,cond,disp,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_branch_disp((inst),(cond),(disp),(is_signed)); } while (0)
+#define amd64_set_reg_size(inst,cond,reg,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_set_reg((inst),(cond),((reg)&0x7),(is_signed)); } while (0)
+#define amd64_set_mem_size(inst,cond,mem,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_set_mem((inst),(cond),(mem),(is_signed)); } while (0)
+#define amd64_set_membase_size(inst,cond,basereg,disp,is_signed,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_set_membase((inst),(cond),((basereg)&0x7),(disp),(is_signed)); } while (0)
+#define amd64_call_imm_size(inst,disp,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_call_imm((inst),(disp)); } while (0)
+//#define amd64_call_reg_size(inst,reg,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_call_reg((inst),((reg)&0x7)); } while (0)
+#define amd64_call_mem_size(inst,mem,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_call_mem((inst),(mem)); } while (0)
+#define amd64_call_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); x86_call_membase((inst),((basereg)&0x7),(disp)); } while (0)
+#define amd64_call_code_size(inst,target,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_call_code((inst),(target)); } while (0)
+//#define amd64_ret_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_ret(inst); } while (0)
+#define amd64_ret_imm_size(inst,imm,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_ret_imm((inst),(imm)); } while (0)
+#define amd64_cmov_reg_size(inst,cond,is_signed,dreg,reg,size) do { amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_cmov_reg((inst),(cond),(is_signed),((dreg)&0x7),((reg)&0x7)); } while (0)
+#define amd64_cmov_mem_size(inst,cond,is_signed,reg,mem,size) do { amd64_emit_rex ((inst),(size),0,0,(reg)); x86_cmov_mem((inst),(cond),(is_signed),((reg)&0x7),(mem)); } while (0)
+#define amd64_cmov_membase_size(inst,cond,is_signed,reg,basereg,disp,size) do { amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_cmov_membase((inst),(cond),(is_signed),((reg)&0x7),((basereg)&0x7),(disp)); } while (0)
+#define amd64_enter_size(inst,framesize) do { amd64_emit_rex ((inst),(size),0,0,0); x86_enter((inst),(framesize)); } while (0)
+//#define amd64_leave_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_leave(inst); } while (0)
+#define amd64_sahf_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_sahf(inst); } while (0)
+#define amd64_fsin_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fsin(inst); } while (0)
+#define amd64_fcos_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fcos(inst); } while (0)
+#define amd64_fabs_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fabs(inst); } while (0)
+#define amd64_ftst_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_ftst(inst); } while (0)
+#define amd64_fxam_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fxam(inst); } while (0)
+#define amd64_fpatan_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fpatan(inst); } while (0)
+#define amd64_fprem_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fprem(inst); } while (0)
+#define amd64_fprem1_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fprem1(inst); } while (0)
+#define amd64_frndint_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_frndint(inst); } while (0)
+#define amd64_fsqrt_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fsqrt(inst); } while (0)
+#define amd64_fptan_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_fptan(inst); } while (0)
+//#define amd64_padding_size(inst,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_padding((inst),(size)); } while (0)
+#define amd64_prolog_size(inst,frame_size,reg_mask,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_prolog((inst),(frame_size),(reg_mask)); } while (0)
+#define amd64_epilog_size(inst,reg_mask,size) do { amd64_emit_rex ((inst),(size),0,0,0); x86_epilog((inst),(reg_mask)); } while (0)
+
+
+
+
+
+
+
+
+
+#define amd64_breakpoint(inst) amd64_breakpoint_size(inst,8)
+#define amd64_cld(inst) amd64_cld_size(inst,8)
+#define amd64_stosb(inst) amd64_stosb_size(inst,8)
+#define amd64_stosl(inst) amd64_stosl_size(inst,8)
+#define amd64_stosd(inst) amd64_stosd_size(inst,8)
+#define amd64_movsb(inst) amd64_movsb_size(inst,8)
+#define amd64_movsl(inst) amd64_movsl_size(inst,8)
+#define amd64_movsd(inst) amd64_movsd_size(inst,8)
+#define amd64_prefix(inst,p) amd64_prefix_size(inst,p,8)
+#define amd64_rdtsc(inst) amd64_rdtsc_size(inst,8)
+#define amd64_cmpxchg_reg_reg(inst,dreg,reg) amd64_cmpxchg_reg_reg_size(inst,dreg,reg,8)
+#define amd64_cmpxchg_mem_reg(inst,mem,reg) amd64_cmpxchg_mem_reg_size(inst,mem,reg,8)
+#define amd64_cmpxchg_membase_reg(inst,basereg,disp,reg) amd64_cmpxchg_membase_reg_size(inst,basereg,disp,reg,8)
+#define amd64_xchg_reg_reg(inst,dreg,reg,size) amd64_xchg_reg_reg_size(inst,dreg,reg,size)
+#define amd64_xchg_mem_reg(inst,mem,reg,size) amd64_xchg_mem_reg_size(inst,mem,reg,size)
+#define amd64_xchg_membase_reg(inst,basereg,disp,reg,size) amd64_xchg_membase_reg_size(inst,basereg,disp,reg,size)
+#define amd64_inc_mem(inst,mem) amd64_inc_mem_size(inst,mem,8)
+#define amd64_inc_membase(inst,basereg,disp) amd64_inc_membase_size(inst,basereg,disp,8)
+#define amd64_inc_reg(inst,reg) amd64_inc_reg_size(inst,reg,8)
+#define amd64_dec_mem(inst,mem) amd64_dec_mem_size(inst,mem,8)
+#define amd64_dec_membase(inst,basereg,disp) amd64_dec_membase_size(inst,basereg,disp,8)
+#define amd64_dec_reg(inst,reg) amd64_dec_reg_size(inst,reg,8)
+#define amd64_not_mem(inst,mem) amd64_not_mem_size(inst,mem,8)
+#define amd64_not_membase(inst,basereg,disp) amd64_not_membase_size(inst,basereg,disp,8)
+#define amd64_not_reg(inst,reg) amd64_not_reg_size(inst,reg,8)
+#define amd64_neg_mem(inst,mem) amd64_neg_mem_size(inst,mem,8)
+#define amd64_neg_membase(inst,basereg,disp) amd64_neg_membase_size(inst,basereg,disp,8)
+#define amd64_neg_reg(inst,reg) amd64_neg_reg_size(inst,reg,8)
+#define amd64_nop(inst) amd64_nop_size(inst,8)
+//#define amd64_alu_reg_imm(inst,opc,reg,imm) amd64_alu_reg_imm_size(inst,opc,reg,imm,8)
+#define amd64_alu_mem_imm(inst,opc,mem,imm) amd64_alu_mem_imm_size(inst,opc,mem,imm,8)
+#define amd64_alu_membase_imm(inst,opc,basereg,disp,imm) amd64_alu_membase_imm_size(inst,opc,basereg,disp,imm,8)
+#define amd64_alu_mem_reg(inst,opc,mem,reg) amd64_alu_mem_reg_size(inst,opc,mem,reg,8)
+#define amd64_alu_membase_reg(inst,opc,basereg,disp,reg) amd64_alu_membase_reg_size(inst,opc,basereg,disp,reg,8)
+//#define amd64_alu_reg_reg(inst,opc,dreg,reg) amd64_alu_reg_reg_size(inst,opc,dreg,reg,8)
+#define amd64_alu_reg8_reg8(inst,opc,dreg,reg,is_dreg_h,is_reg_h) amd64_alu_reg8_reg8_size(inst,opc,dreg,reg,is_dreg_h,is_reg_h,8)
+#define amd64_alu_reg_mem(inst,opc,reg,mem) amd64_alu_reg_mem_size(inst,opc,reg,mem,8)
+#define amd64_alu_reg_membase(inst,opc,reg,basereg,disp) amd64_alu_reg_membase_size(inst,opc,reg,basereg,disp,8)
+#define amd64_test_reg_imm(inst,reg,imm) amd64_test_reg_imm_size(inst,reg,imm,8)
+#define amd64_test_mem_imm(inst,mem,imm) amd64_test_mem_imm_size(inst,mem,imm,8)
+#define amd64_test_membase_imm(inst,basereg,disp,imm) amd64_test_membase_imm_size(inst,basereg,disp,imm,8)
+#define amd64_test_reg_reg(inst,dreg,reg) amd64_test_reg_reg_size(inst,dreg,reg,8)
+#define amd64_test_mem_reg(inst,mem,reg) amd64_test_mem_reg_size(inst,mem,reg,8)
+#define amd64_test_membase_reg(inst,basereg,disp,reg) amd64_test_membase_reg_size(inst,basereg,disp,reg,8)
+#define amd64_shift_reg_imm(inst,opc,reg,imm) amd64_shift_reg_imm_size(inst,opc,reg,imm,8)
+#define amd64_shift_mem_imm(inst,opc,mem,imm) amd64_shift_mem_imm_size(inst,opc,mem,imm,8)
+#define amd64_shift_membase_imm(inst,opc,basereg,disp,imm) amd64_shift_membase_imm_size(inst,opc,basereg,disp,imm,8)
+#define amd64_shift_reg(inst,opc,reg) amd64_shift_reg_size(inst,opc,reg,8)
+#define amd64_shift_mem(inst,opc,mem) amd64_shift_mem_size(inst,opc,mem,8)
+#define amd64_shift_membase(inst,opc,basereg,disp) amd64_shift_membase_size(inst,opc,basereg,disp,8)
+#define amd64_shrd_reg(inst,dreg,reg) amd64_shrd_reg_size(inst,dreg,reg,8)
+#define amd64_shrd_reg_imm(inst,dreg,reg,shamt) amd64_shrd_reg_imm_size(inst,dreg,reg,shamt,8)
+#define amd64_shld_reg(inst,dreg,reg) amd64_shld_reg_size(inst,dreg,reg,8)
+#define amd64_shld_reg_imm(inst,dreg,reg,shamt) amd64_shld_reg_imm_size(inst,dreg,reg,shamt,8)
+#define amd64_mul_reg(inst,reg,is_signed) amd64_mul_reg_size(inst,reg,is_signed,8)
+#define amd64_mul_mem(inst,mem,is_signed) amd64_mul_mem_size(inst,mem,is_signed,8)
+#define amd64_mul_membase(inst,basereg,disp,is_signed) amd64_mul_membase_size(inst,basereg,disp,is_signed,8)
+#define amd64_imul_reg_reg(inst,dreg,reg) amd64_imul_reg_reg_size(inst,dreg,reg,8)
+#define amd64_imul_reg_mem(inst,reg,mem) amd64_imul_reg_mem_size(inst,reg,mem,8)
+#define amd64_imul_reg_membase(inst,reg,basereg,disp) amd64_imul_reg_membase_size(inst,reg,basereg,disp,8)
+#define amd64_imul_reg_reg_imm(inst,dreg,reg,imm) amd64_imul_reg_reg_imm_size(inst,dreg,reg,imm,8)
+#define amd64_imul_reg_mem_imm(inst,reg,mem,imm) amd64_imul_reg_mem_imm_size(inst,reg,mem,imm,8)
+#define amd64_imul_reg_membase_imm(inst,reg,basereg,disp,imm) amd64_imul_reg_membase_imm_size(inst,reg,basereg,disp,imm,8)
+#define amd64_div_reg(inst,reg,is_signed) amd64_div_reg_size(inst,reg,is_signed,8)
+#define amd64_div_mem(inst,mem,is_signed) amd64_div_mem_size(inst,mem,is_signed,8)
+#define amd64_div_membase(inst,basereg,disp,is_signed) amd64_div_membase_size(inst,basereg,disp,is_signed,8)
+#define amd64_mov_mem_reg(inst,mem,reg,size) amd64_mov_mem_reg_size(inst,mem,reg,size)
+//#define amd64_mov_regp_reg(inst,regp,reg,size) amd64_mov_regp_reg_size(inst,regp,reg,size)
+//#define amd64_mov_membase_reg(inst,basereg,disp,reg,size) amd64_mov_membase_reg_size(inst,basereg,disp,reg,size)
+#define amd64_mov_memindex_reg(inst,basereg,disp,indexreg,shift,reg,size) amd64_mov_memindex_reg_size(inst,basereg,disp,indexreg,shift,reg,size)
+//#define amd64_mov_reg_reg(inst,dreg,reg,size) amd64_mov_reg_reg_size(inst,dreg,reg,size)
+//#define amd64_mov_reg_mem(inst,reg,mem,size) amd64_mov_reg_mem_size(inst,reg,mem,size)
+//#define amd64_mov_reg_membase(inst,reg,basereg,disp,size) amd64_mov_reg_membase_size(inst,reg,basereg,disp,size)
+#define amd64_mov_reg_memindex(inst,reg,basereg,disp,indexreg,shift,size) amd64_mov_reg_memindex_size(inst,reg,basereg,disp,indexreg,shift,size)
+#define amd64_clear_reg(inst,reg) amd64_clear_reg_size(inst,reg,8)
+//#define amd64_mov_reg_imm(inst,reg,imm) amd64_mov_reg_imm_size(inst,reg,imm,8)
+#define amd64_mov_mem_imm(inst,mem,imm,size) amd64_mov_mem_imm_size(inst,mem,imm,size)
+//#define amd64_mov_membase_imm(inst,basereg,disp,imm,size) amd64_mov_membase_imm_size(inst,basereg,disp,imm,size)
+#define amd64_mov_memindex_imm(inst,basereg,disp,indexreg,shift,imm,size) amd64_mov_memindex_imm_size(inst,basereg,disp,indexreg,shift,imm,size)
+#define amd64_lea_mem(inst,reg,mem) amd64_lea_mem_size(inst,reg,mem,8)
+//#define amd64_lea_membase(inst,reg,basereg,disp) amd64_lea_membase_size(inst,reg,basereg,disp,8)
+#define amd64_lea_memindex(inst,reg,basereg,disp,indexreg,shift) amd64_lea_memindex_size(inst,reg,basereg,disp,indexreg,shift,8)
+#define amd64_widen_reg(inst,dreg,reg,is_signed,is_half) amd64_widen_reg_size(inst,dreg,reg,is_signed,is_half,8)
+#define amd64_widen_mem(inst,dreg,mem,is_signed,is_half) amd64_widen_mem_size(inst,dreg,mem,is_signed,is_half,8)
+#define amd64_widen_membase(inst,dreg,basereg,disp,is_signed,is_half) amd64_widen_membase_size(inst,dreg,basereg,disp,is_signed,is_half,8)
+#define amd64_widen_memindex(inst,dreg,basereg,disp,indexreg,shift,is_signed,is_half) amd64_widen_memindex_size(inst,dreg,basereg,disp,indexreg,shift,is_signed,is_half,8)
+#define amd64_cdq(inst) amd64_cdq_size(inst,8)
+#define amd64_wait(inst) amd64_wait_size(inst,8)
+#define amd64_fp_op_mem(inst,opc,mem,is_double) amd64_fp_op_mem_size(inst,opc,mem,is_double,8)
+#define amd64_fp_op_membase(inst,opc,basereg,disp,is_double) amd64_fp_op_membase_size(inst,opc,basereg,disp,is_double,8)
+#define amd64_fp_op(inst,opc,index) amd64_fp_op_size(inst,opc,index,8)
+#define amd64_fp_op_reg(inst,opc,index,pop_stack) amd64_fp_op_reg_size(inst,opc,index,pop_stack,8)
+#define amd64_fp_int_op_membase(inst,opc,basereg,disp,is_int) amd64_fp_int_op_membase_size(inst,opc,basereg,disp,is_int,8)
+#define amd64_fstp(inst,index) amd64_fstp_size(inst,index,8)
+#define amd64_fcompp(inst) amd64_fcompp_size(inst,8)
+#define amd64_fucompp(inst) amd64_fucompp_size(inst,8)
+#define amd64_fnstsw(inst) amd64_fnstsw_size(inst,8)
+#define amd64_fnstcw(inst,mem) amd64_fnstcw_size(inst,mem,8)
+#define amd64_fnstcw_membase(inst,basereg,disp) amd64_fnstcw_membase_size(inst,basereg,disp,8)
+#define amd64_fldcw(inst,mem) amd64_fldcw_size(inst,mem,8)
+#define amd64_fldcw_membase(inst,basereg,disp) amd64_fldcw_membase_size(inst,basereg,disp,8)
+#define amd64_fchs(inst) amd64_fchs_size(inst,8)
+#define amd64_frem(inst) amd64_frem_size(inst,8)
+#define amd64_fxch(inst,index) amd64_fxch_size(inst,index,8)
+#define amd64_fcomi(inst,index) amd64_fcomi_size(inst,index,8)
+#define amd64_fcomip(inst,index) amd64_fcomip_size(inst,index,8)
+#define amd64_fucomi(inst,index) amd64_fucomi_size(inst,index,8)
+#define amd64_fucomip(inst,index) amd64_fucomip_size(inst,index,8)
+#define amd64_fld(inst,mem,is_double) amd64_fld_size(inst,mem,is_double,8)
+#define amd64_fld_membase(inst,basereg,disp,is_double) amd64_fld_membase_size(inst,basereg,disp,is_double,8)
+#define amd64_fld80_mem(inst,mem) amd64_fld80_mem_size(inst,mem,8)
+#define amd64_fld80_membase(inst,basereg,disp) amd64_fld80_membase_size(inst,basereg,disp,8)
+#define amd64_fild(inst,mem,is_long) amd64_fild_size(inst,mem,is_long,8)
+#define amd64_fild_membase(inst,basereg,disp,is_long) amd64_fild_membase_size(inst,basereg,disp,is_long,8)
+#define amd64_fld_reg(inst,index) amd64_fld_reg_size(inst,index,8)
+#define amd64_fldz(inst) amd64_fldz_size(inst,8)
+#define amd64_fld1(inst) amd64_fld1_size(inst,8)
+#define amd64_fldpi(inst) amd64_fldpi_size(inst,8)
+#define amd64_fst(inst,mem,is_double,pop_stack) amd64_fst_size(inst,mem,is_double,pop_stack,8)
+#define amd64_fst_membase(inst,basereg,disp,is_double,pop_stack) amd64_fst_membase_size(inst,basereg,disp,is_double,pop_stack,8)
+#define amd64_fst80_mem(inst,mem) amd64_fst80_mem_size(inst,mem,8)
+#define amd64_fst80_membase(inst,basereg,disp) amd64_fst80_membase_size(inst,basereg,disp,8)
+#define amd64_fist_pop(inst,mem,is_long) amd64_fist_pop_size(inst,mem,is_long,8)
+#define amd64_fist_pop_membase(inst,basereg,disp,is_long) amd64_fist_pop_membase_size(inst,basereg,disp,is_long,8)
+#define amd64_fstsw(inst) amd64_fstsw_size(inst,8)
+#define amd64_fist_membase(inst,basereg,disp,is_int) amd64_fist_membase_size(inst,basereg,disp,is_int,8)
+//#define amd64_push_reg(inst,reg) amd64_push_reg_size(inst,reg,8)
+#define amd64_push_regp(inst,reg) amd64_push_regp_size(inst,reg,8)
+#define amd64_push_mem(inst,mem) amd64_push_mem_size(inst,mem,8)
+//#define amd64_push_membase(inst,basereg,disp) amd64_push_membase_size(inst,basereg,disp,8)
+#define amd64_push_memindex(inst,basereg,disp,indexreg,shift) amd64_push_memindex_size(inst,basereg,disp,indexreg,shift,8)
+#define amd64_push_imm(inst,imm) amd64_push_imm_size(inst,imm,8)
+//#define amd64_pop_reg(inst,reg) amd64_pop_reg_size(inst,reg,8)
+#define amd64_pop_mem(inst,mem) amd64_pop_mem_size(inst,mem,8)
+#define amd64_pop_membase(inst,basereg,disp) amd64_pop_membase_size(inst,basereg,disp,8)
+#define amd64_pushad(inst) amd64_pushad_size(inst,8)
+#define amd64_pushfd(inst) amd64_pushfd_size(inst,8)
+#define amd64_popad(inst) amd64_popad_size(inst,8)
+#define amd64_popfd(inst) amd64_popfd_size(inst,8)
+#define amd64_loop(inst,imm) amd64_loop_size(inst,imm,8)
+#define amd64_loope(inst,imm) amd64_loope_size(inst,imm,8)
+#define amd64_loopne(inst,imm) amd64_loopne_size(inst,imm,8)
+#define amd64_jump32(inst,imm) amd64_jump32_size(inst,imm,8)
+#define amd64_jump8(inst,imm) amd64_jump8_size(inst,imm,8)
+#define amd64_jump_reg(inst,reg) amd64_jump_reg_size(inst,reg,8)
+#define amd64_jump_mem(inst,mem) amd64_jump_mem_size(inst,mem,8)
+#define amd64_jump_membase(inst,basereg,disp) amd64_jump_membase_size(inst,basereg,disp,8)
+#define amd64_jump_code(inst,target) amd64_jump_code_size(inst,target,8)
+#define amd64_jump_disp(inst,disp) amd64_jump_disp_size(inst,disp,8)
+#define amd64_branch8(inst,cond,imm,is_signed) amd64_branch8_size(inst,cond,imm,is_signed,8)
+#define amd64_branch32(inst,cond,imm,is_signed) amd64_branch32_size(inst,cond,imm,is_signed,8)
+#define amd64_branch(inst,cond,target,is_signed) amd64_branch_size(inst,cond,target,is_signed,8)
+#define amd64_branch_disp(inst,cond,disp,is_signed) amd64_branch_disp_size(inst,cond,disp,is_signed,8)
+#define amd64_set_reg(inst,cond,reg,is_signed) amd64_set_reg_size(inst,cond,reg,is_signed,8)
+#define amd64_set_mem(inst,cond,mem,is_signed) amd64_set_mem_size(inst,cond,mem,is_signed,8)
+#define amd64_set_membase(inst,cond,basereg,disp,is_signed) amd64_set_membase_size(inst,cond,basereg,disp,is_signed,8)
+#define amd64_call_imm(inst,disp) amd64_call_imm_size(inst,disp,8)
+//#define amd64_call_reg(inst,reg) amd64_call_reg_size(inst,reg,8)
+#define amd64_call_mem(inst,mem) amd64_call_mem_size(inst,mem,8)
+#define amd64_call_membase(inst,basereg,disp) amd64_call_membase_size(inst,basereg,disp,8)
+#define amd64_call_code(inst,target) amd64_call_code_size(inst,target,8)
+//#define amd64_ret(inst) amd64_ret_size(inst,8)
+#define amd64_ret_imm(inst,imm) amd64_ret_imm_size(inst,imm,8)
+#define amd64_cmov_reg(inst,cond,is_signed,dreg,reg) amd64_cmov_reg_size(inst,cond,is_signed,dreg,reg,8)
+#define amd64_cmov_mem(inst,cond,is_signed,reg,mem) amd64_cmov_mem_size(inst,cond,is_signed,reg,mem,8)
+#define amd64_cmov_membase(inst,cond,is_signed,reg,basereg,disp) amd64_cmov_membase_size(inst,cond,is_signed,reg,basereg,disp,8)
+#define amd64_enter(inst,framesize) amd64_enter_size(inst,framesize)
+//#define amd64_leave(inst) amd64_leave_size(inst,8)
+#define amd64_sahf(inst) amd64_sahf_size(inst,8)
+#define amd64_fsin(inst) amd64_fsin_size(inst,8)
+#define amd64_fcos(inst) amd64_fcos_size(inst,8)
+#define amd64_fabs(inst) amd64_fabs_size(inst,8)
+#define amd64_ftst(inst) amd64_ftst_size(inst,8)
+#define amd64_fxam(inst) amd64_fxam_size(inst,8)
+#define amd64_fpatan(inst) amd64_fpatan_size(inst,8)
+#define amd64_fprem(inst) amd64_fprem_size(inst,8)
+#define amd64_fprem1(inst) amd64_fprem1_size(inst,8)
+#define amd64_frndint(inst) amd64_frndint_size(inst,8)
+#define amd64_fsqrt(inst) amd64_fsqrt_size(inst,8)
+#define amd64_fptan(inst) amd64_fptan_size(inst,8)
+#define amd64_padding(inst,size) amd64_padding_size(inst,size)
+#define amd64_prolog(inst,frame,reg_mask) amd64_prolog_size(inst,frame,reg_mask,8)
+#define amd64_epilog(inst,reg_mask) amd64_epilog_size(inst,reg_mask,8)
+
+#endif // AMD64_H
diff --git a/mono/arch/amd64/tramp.c b/mono/arch/amd64/tramp.c
new file mode 100644
index 00000000000..5a4f9a9ed2b
--- /dev/null
+++ b/mono/arch/amd64/tramp.c
@@ -0,0 +1,1054 @@
+/*
+ * Create trampolines to invoke arbitrary functions.
+ *
+ * Copyright (C) Ximian Inc.
+ *
+ * Author:
+ * Zalman Stern
+ * Based on code by:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * To understand this code, one will want to the calling convention section of the ABI sepc at:
+ * http://x86-64.org/abi.pdf
+ * and the AMD64 architecture docs found at amd.com .
+ */
+
+#include "config.h"
+#include <stdlib.h>
+#include <string.h>
+#include "amd64-codegen.h"
+#include "mono/metadata/class.h"
+#include "mono/metadata/tabledefs.h"
+#include "mono/interpreter/interp.h"
+#include "mono/metadata/appdomain.h"
+#include "mono/metadata/marshal.h"
+
+/*
+ * The resulting function takes the form:
+ * void func (void (*callme)(), void *retval, void *this_obj, stackval *arguments);
+ */
+#define FUNC_ADDR_POS 8
+#define RETVAL_POS 12
+#define THIS_POS 16
+#define ARGP_POS 20
+#define LOC_POS -4
+
+#define ARG_SIZE sizeof (stackval)
+
+#define MAX_INT_ARG_REGS 6
+#define MAX_FLOAT_ARG_REGS 8
+
+// TODO get these right. They are upper bounds anyway, so it doesn't much matter.
+#define PUSH_INT_STACK_ARG_SIZE 16
+#define MOVE_INT_REG_ARG_SIZE 16
+#define PUSH_FLOAT_STACK_ARG_SIZE 16
+#define MOVE_FLOAT_REG_ARG_SIZE 16
+#define COPY_STRUCT_STACK_ARG_SIZE 16
+
+/* Maps an argument number (starting at 0) to the register it is passed in (if it fits).
+ * E.g. int foo(int bar, int quux) has the foo arg in RDI and the quux arg in RSI
+ * There is no such map for floating point args as they go in XMM0-XMM7 in order and thus the
+ * index is the register number.
+ */
+static int int_arg_regs[] = { AMD64_RDI, AMD64_RSI, AMD64_RDX, AMD64_RCX, AMD64_R8, AMD64_R9 };
+
+/* This next block of code resolves the ABI rules for passing structures in the argument registers.
+ * These basically amount to "Use up to two registers if they are all integer or all floating point.
+ * If the structure is bigger than two registers or would be in one integer register and one floating point,
+ * it is passed in memory instead.
+ *
+ * It is possible this code needs to be recursive to be correct in the case when one of the structure members
+ * is itself a structure.
+ *
+ * The 80-bit floating point stuff is ignored.
+ */
+typedef enum {
+ ARG_IN_MEMORY,
+ ARG_IN_INT_REGS,
+ ARG_IN_FLOAT_REGS
+} struct_arg_type;
+
+static struct_arg_type compute_arg_type(MonoType *type)
+{
+ guint32 simpletype = type->type;
+
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_I8:
+ return ARG_IN_INT_REGS;
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ if (type->data.klass->enumtype)
+ return ARG_IN_INT_REGS;
+ return ARG_IN_MEMORY;
+ break;
+ }
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ return ARG_IN_FLOAT_REGS;
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", type->type);
+ }
+
+ return ARG_IN_MEMORY;
+}
+
+static struct_arg_type value_type_info(MonoClass *klass, int *native_size, int *regs_used, int *offset1, int *size1, int *offset2, int *size2)
+{
+ MonoMarshalType *info = mono_marshal_load_type_info (klass);
+
+ *native_size = info->native_size;
+
+ if (info->native_size > 8 || info->num_fields > 2)
+ {
+ *regs_used = 0;
+ *offset1 = -1;
+ *offset2 = -1;
+ return ARG_IN_MEMORY;
+ }
+
+ if (info->num_fields == 1)
+ {
+ struct_arg_type result = compute_arg_type(info->fields[0].field->type);
+ if (result != ARG_IN_MEMORY)
+ {
+ *regs_used = 1;
+ *offset1 = info->fields[0].offset;
+ *size1 = mono_marshal_type_size (info->fields[0].field->type, info->fields[0].mspec, NULL, 1, 1);
+ }
+ else
+ {
+ *regs_used = 0;
+ *offset1 = -1;
+ }
+
+ *offset2 = -1;
+ return result;
+ }
+
+ struct_arg_type result1 = compute_arg_type(info->fields[0].field->type);
+ struct_arg_type result2 = compute_arg_type(info->fields[0].field->type);
+
+ if (result1 == result2 && result1 != ARG_IN_MEMORY)
+ {
+ *regs_used = 2;
+ *offset1 = info->fields[0].offset;
+ *size1 = mono_marshal_type_size (info->fields[0].field->type, info->fields[0].mspec, NULL, 1, 1);
+ *offset2 = info->fields[1].offset;
+ *size2 = mono_marshal_type_size (info->fields[1].field->type, info->fields[1].mspec, NULL, 1, 1);
+ return result1;
+ }
+
+ return ARG_IN_MEMORY;
+}
+
+MonoPIFunc
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+{
+ unsigned char *p, *code_buffer;
+ guint32 stack_size = 0, code_size = 50;
+ guint32 arg_pos, simpletype;
+ int i;
+ static GHashTable *cache = NULL;
+ MonoPIFunc res;
+
+ guint32 int_arg_regs_used = 0;
+ guint32 float_arg_regs_used = 0;
+ guint32 next_int_arg_reg = 0;
+ guint32 next_float_arg_reg = 0;
+ /* Indicates that the return value is filled in inside the called function. */
+ int retval_implicit = 0;
+ char *arg_in_reg_bitvector; /* A set index by argument number saying if it is in a register
+ (integer or floating point according to type) */
+
+ if (!cache)
+ cache = g_hash_table_new ((GHashFunc)mono_signature_hash,
+ (GCompareFunc)mono_metadata_signature_equal);
+
+ if ((res = (MonoPIFunc)g_hash_table_lookup (cache, sig)))
+ return res;
+
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype) {
+ int_arg_regs_used++;
+ code_size += MOVE_INT_REG_ARG_SIZE;
+ }
+
+ if (sig->hasthis) {
+ int_arg_regs_used++;
+ code_size += MOVE_INT_REG_ARG_SIZE;
+ }
+
+ /* Run through stuff to calculate code size and argument bytes that will be pushed on stack (stack_size). */
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref)
+ simpletype = MONO_TYPE_PTR;
+ else
+ simpletype = sig->params [i]->type;
+enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_I8:
+ if (int_arg_regs_used++ > MAX_INT_ARG_REGS) {
+ stack_size += 8;
+ code_size += PUSH_INT_STACK_ARG_SIZE;
+ }
+ else
+ code_size += MOVE_INT_REG_ARG_SIZE;
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ int size;
+ int arg_type;
+ int regs_used;
+ int offset1;
+ int size1;
+ int offset2;
+ int size2;
+
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+
+ arg_type = value_type_info(sig->params [i]->data.klass, &size, &regs_used, &offset1, &size1, &offset2, &size2);
+ if (arg_type == ARG_IN_INT_REGS &&
+ (int_arg_regs_used + regs_used) <= MAX_INT_ARG_REGS)
+ {
+ code_size += MOVE_INT_REG_ARG_SIZE;
+ int_arg_regs_used += regs_used;
+ break;
+ }
+
+ if (arg_type == ARG_IN_FLOAT_REGS &&
+ (float_arg_regs_used + regs_used) <= MAX_FLOAT_ARG_REGS)
+ {
+ code_size += MOVE_FLOAT_REG_ARG_SIZE;
+ float_arg_regs_used += regs_used;
+ break;
+ }
+
+ /* Else item is in memory. */
+
+ stack_size += size + 7;
+ stack_size &= ~7;
+ code_size += COPY_STRUCT_STACK_ARG_SIZE;
+
+ break;
+ }
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ if (float_arg_regs_used++ > MAX_FLOAT_ARG_REGS) {
+ stack_size += 8;
+ code_size += PUSH_FLOAT_STACK_ARG_SIZE;
+ }
+ else
+ code_size += MOVE_FLOAT_REG_ARG_SIZE;
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+ /*
+ * FIXME: take into account large return values.
+ * (Comment carried over from IA32 code. Not sure what it means :-)
+ */
+
+ code_buffer = p = alloca (code_size);
+
+ /*
+ * Standard function prolog.
+ */
+ amd64_push_reg (p, AMD64_RBP);
+ amd64_mov_reg_reg (p, AMD64_RBP, AMD64_RSP, 8);
+ /*
+ * and align to 16 byte boundary...
+ */
+
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ retval_implicit = 1;
+ }
+ }
+
+ if (sig->ret->byref || string_ctor || !(retval_implicit || sig->ret->type == MONO_TYPE_VOID)) {
+ /* Push the retval register so it is saved across the call. It will be addressed via RBP later. */
+ amd64_push_reg (p, AMD64_RSI);
+ stack_size += 8;
+ }
+
+ /* Ensure stack is 16 byte aligned when entering called function as required by calling convention.
+ * Getting this wrong results in a general protection fault on an SSE load or store somewhere in the
+ * code called under the trampoline.
+ */
+ if ((stack_size & 15) != 0)
+ amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, 16 - (stack_size & 15));
+
+ /*
+ * On entry to generated function:
+ * RDI has target function address
+ * RSI has return value location address
+ * RDX has this pointer address
+ * RCX has the pointer to the args array.
+ *
+ * Inside the stub function:
+ * R10 holds the pointer to the args
+ * R11 holds the target function address.
+ * The return value address is pushed on the stack.
+ * The this pointer is moved into the first arg register at the start.
+ *
+ * Optimization note: we could keep the args pointer in RCX and then
+ * load over itself at the end. Ditto the callee addres could be left in RDI in some cases.
+ */
+
+ /* Move args pointer to temp register. */
+ amd64_mov_reg_reg (p, AMD64_R10, AMD64_RCX, 8);
+ amd64_mov_reg_reg (p, AMD64_R11, AMD64_RDI, 8);
+
+ /* First args register gets return value pointer, if need be.
+ * Note that "byref" equal true means the called function returns a pointer.
+ */
+ if (retval_implicit) {
+ amd64_mov_reg_reg (p, int_arg_regs[next_int_arg_reg], AMD64_RSI, 8);
+ next_int_arg_reg++;
+ }
+
+ /* this pointer goes in next args register. */
+ if (sig->hasthis) {
+ amd64_mov_reg_reg (p, int_arg_regs[next_int_arg_reg], AMD64_RDX, 8);
+ next_int_arg_reg++;
+ }
+
+ /*
+ * Generate code to handle arguments in registers. Stack arguments will happen in a loop after this.
+ */
+ arg_in_reg_bitvector = (char *)alloca((sig->param_count + 7) / 8);
+ memset(arg_in_reg_bitvector, 0, (sig->param_count + 7) / 8);
+
+ /* First, load all the arguments that are passed in registers into the appropriate registers.
+ * Below there is another loop to handle arguments passed on the stack.
+ */
+ for (i = 0; i < sig->param_count; i++) {
+ arg_pos = ARG_SIZE * i;
+
+ if (sig->params [i]->byref)
+ simpletype = MONO_TYPE_PTR;
+ else
+ simpletype = sig->params [i]->type;
+enum_marshal:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_CLASS:
+ if (next_int_arg_reg < MAX_INT_ARG_REGS) {
+ amd64_mov_reg_membase (p, int_arg_regs[next_int_arg_reg], AMD64_R10, arg_pos, 8);
+ next_int_arg_reg++;
+ arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
+ }
+ break;
+ case MONO_TYPE_R4:
+ if (next_float_arg_reg < MAX_FLOAT_ARG_REGS) {
+ amd64_movss_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos);
+ next_float_arg_reg++;
+ arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
+ }
+ break;
+ case MONO_TYPE_R8:
+ if (next_float_arg_reg < MAX_FLOAT_ARG_REGS) {
+ amd64_movsd_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos);
+ next_float_arg_reg++;
+ arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
+ }
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ if (!sig->params [i]->data.klass->enumtype) {
+ int size;
+ int arg_type;
+ int regs_used;
+ int offset1;
+ int size1;
+ int offset2;
+ int size2;
+
+ arg_type = value_type_info(sig->params [i]->data.klass, &size, &regs_used, &offset1, &size1, &offset2, &size2);
+
+ if (arg_type == ARG_IN_INT_REGS &&
+ (next_int_arg_reg + regs_used) <= MAX_INT_ARG_REGS)
+ {
+ amd64_mov_reg_membase (p, int_arg_regs[next_int_arg_reg], AMD64_R10, arg_pos + offset1, size1);
+ next_int_arg_reg++;
+ if (regs_used > 1)
+ {
+ amd64_mov_reg_membase (p, int_arg_regs[next_int_arg_reg], AMD64_R10, arg_pos + offset2, size2);
+ next_int_arg_reg++;
+ }
+ arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
+ break;
+ }
+
+ if (arg_type == ARG_IN_FLOAT_REGS &&
+ (next_float_arg_reg + regs_used) <= MAX_FLOAT_ARG_REGS)
+ {
+ if (size1 == 4)
+ amd64_movss_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset1);
+ else
+ amd64_movsd_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset1);
+ next_float_arg_reg++;
+
+ if (regs_used > 1)
+ {
+ if (size2 == 4)
+ amd64_movss_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset2);
+ else
+ amd64_movsd_reg_membase (p, next_float_arg_reg, AMD64_R10, arg_pos + offset2);
+ next_float_arg_reg++;
+ }
+ arg_in_reg_bitvector[i >> 3] |= (1 << (i & 7));
+ break;
+ }
+
+ /* Structs in memory are handled in the next loop. */
+ } else {
+ /* it's an enum value */
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_marshal;
+ }
+ break;
+ }
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+ /* Handle stack arguments, pushing the rightmost argument first. */
+ for (i = sig->param_count; i > 0; --i) {
+ arg_pos = ARG_SIZE * (i - 1);
+ if (sig->params [i - 1]->byref)
+ simpletype = MONO_TYPE_PTR;
+ else
+ simpletype = sig->params [i - 1]->type;
+enum_marshal2:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_CLASS:
+ if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0) {
+ amd64_push_membase (p, AMD64_R10, arg_pos);
+ }
+ break;
+ case MONO_TYPE_R4:
+ if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0) {
+ amd64_push_membase (p, AMD64_R10, arg_pos);
+ }
+ break;
+ case MONO_TYPE_R8:
+ if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0) {
+ amd64_push_membase (p, AMD64_R10, arg_pos);
+ }
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (!sig->params [i - 1]->data.klass->enumtype) {
+ if ((arg_in_reg_bitvector[(i - 1) >> 3] & (1 << ((i - 1) & 7))) == 0)
+ {
+ int ss = mono_class_native_size (sig->params [i - 1]->data.klass, NULL);
+ ss += 7;
+ ss &= ~7;
+
+ amd64_alu_reg_imm(p, X86_SUB, AMD64_RSP, ss);
+ /* Count register */
+ amd64_mov_reg_imm(p, AMD64_RCX, ss);
+ /* Source register */
+ amd64_lea_membase(p, AMD64_RSI, AMD64_R10, arg_pos);
+ /* Dest register */
+ amd64_mov_reg_reg(p, AMD64_RDI, AMD64_RSP, 8);
+
+ /* AMD64 calling convention guarantees direction flag is clear at call boundary. */
+ x86_prefix(p, AMD64_REX(AMD64_REX_W));
+ x86_prefix(p, X86_REP_PREFIX);
+ x86_movsb(p);
+ }
+ } else {
+ /* it's an enum value */
+ simpletype = sig->params [i - 1]->data.klass->enum_basetype->type;
+ goto enum_marshal2;
+ }
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i - 1]->type);
+ }
+ }
+
+ /* TODO: Set RAL to number of XMM registers used in case this is a varags function? */
+
+ /*
+ * Insert call to function
+ */
+ amd64_call_reg (p, AMD64_R11);
+
+ if (sig->ret->byref || string_ctor || !(retval_implicit || sig->ret->type == MONO_TYPE_VOID)) {
+ amd64_mov_reg_membase(p, AMD64_RSI, AMD64_RBP, -8, 8);
+ }
+ /*
+ * Handle retval.
+ * Small integer and pointer values are in EAX.
+ * Long integers are in EAX:EDX.
+ * FP values are on the FP stack.
+ */
+
+ if (sig->ret->byref || string_ctor) {
+ simpletype = MONO_TYPE_PTR;
+ } else {
+ simpletype = sig->ret->type;
+ }
+ enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 1);
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 2);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_PTR:
+ amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 8);
+ break;
+ case MONO_TYPE_R4:
+ amd64_movss_regp_reg (p, AMD64_RSI, AMD64_XMM0);
+ break;
+ case MONO_TYPE_R8:
+ amd64_movsd_regp_reg (p, AMD64_RSI, AMD64_XMM0);
+ break;
+ case MONO_TYPE_I8:
+ amd64_mov_regp_reg (p, AMD64_RSI, X86_EAX, 8);
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ int size;
+ int arg_type;
+ int regs_used;
+ int offset1;
+ int size1;
+ int offset2;
+ int size2;
+
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+
+ arg_type = value_type_info(sig->params [i]->data.klass, &size, &regs_used, &offset1, &size1, &offset2, &size2);
+
+ if (arg_type == ARG_IN_INT_REGS)
+ {
+ amd64_mov_membase_reg (p, AMD64_RSI, offset1, AMD64_RAX, size1);
+ if (regs_used > 1)
+ amd64_mov_membase_reg (p, AMD64_RSI, offset2, AMD64_RDX, size2);
+ break;
+ }
+
+ if (arg_type == ARG_IN_FLOAT_REGS)
+ {
+ if (size1 == 4)
+ amd64_movss_membase_reg (p, AMD64_RSI, offset1, AMD64_XMM0);
+ else
+ amd64_movsd_membase_reg (p, AMD64_RSI, offset1, AMD64_XMM0);
+
+ if (regs_used > 1)
+ {
+ if (size2 == 4)
+ amd64_movss_membase_reg (p, AMD64_RSI, offset2, AMD64_XMM1);
+ else
+ amd64_movsd_membase_reg (p, AMD64_RSI, offset2, AMD64_XMM1);
+ }
+ break;
+ }
+
+ /* Else result should have been stored in place already. */
+ break;
+ }
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+
+ /*
+ * Standard epilog.
+ */
+ amd64_leave (p);
+ amd64_ret (p);
+
+ g_assert (p - code_buffer < code_size);
+ res = (MonoPIFunc)g_memdup (code_buffer, p - code_buffer);
+
+ g_hash_table_insert (cache, sig, res);
+
+ return res;
+}
+
+/*
+ * Returns a pointer to a native function that can be used to
+ * call the specified method.
+ * The function created will receive the arguments according
+ * to the call convention specified in the method.
+ * This function works by creating a MonoInvocation structure,
+ * filling the fields in and calling ves_exec_method on it.
+ * Still need to figure out how to handle the exception stuff
+ * across the managed/unmanaged boundary.
+ */
+void *
+mono_arch_create_method_pointer (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ MonoJitInfo *ji;
+ unsigned char *p, *code_buffer;
+ guint32 simpletype;
+ gint32 local_size;
+ gint32 stackval_pos;
+ gint32 mono_invocation_pos;
+ int i, cpos;
+ int *vtbuf;
+ int *rbpoffsets;
+ int int_arg_regs_used = 0;
+ int float_arg_regs_used = 0;
+ int stacked_args_size = 0; /* bytes of register passed arguments pushed on stack for safe keeping. Used to get alignment right. */
+ int next_stack_arg_rbp_offset = 16;
+ int retval_ptr_rbp_offset = 0;
+ int this_reg = -1; /* Remember register this ptr is in. */
+
+ /*
+ * If it is a static P/Invoke method, we can just return the pointer
+ * to the method implementation.
+ */
+ if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && ((MonoMethodPInvoke*) method)->addr) {
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = 1;
+ ji->code_start = ((MonoMethodPInvoke*) method)->addr;
+
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
+ return ((MonoMethodPInvoke*) method)->addr;
+ }
+
+ sig = method->signature;
+
+ code_buffer = p = alloca (512); /* FIXME: check for overflows... */
+ vtbuf = alloca (sizeof(int)*sig->param_count);
+ rbpoffsets = alloca (sizeof(int)*sig->param_count);
+
+
+ /*
+ * Standard function prolog.
+ */
+ amd64_push_reg (p, AMD64_RBP);
+ amd64_mov_reg_reg (p, AMD64_RBP, AMD64_RSP, 8);
+
+ /* If there is an implicit return value pointer in the first args reg, save it now so
+ * the result can be stored through the pointer at the end.
+ */
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype)
+ {
+ amd64_push_reg (p, int_arg_regs[int_arg_regs_used]);
+ int_arg_regs_used++;
+ stacked_args_size += 8;
+ retval_ptr_rbp_offset = -stacked_args_size;
+ }
+
+ /*
+ * If there is a this pointer, remember the number of the register it is in.
+ */
+ if (sig->hasthis) {
+ this_reg = int_arg_regs[int_arg_regs_used++];
+ }
+
+ /* Put all arguments passed in registers on the stack.
+ * Record offsets from RBP to each argument.
+ */
+ cpos = 0;
+
+ for (i = 0; i < sig->param_count; i++) {
+ if (sig->params [i]->byref)
+ simpletype = MONO_TYPE_PTR;
+ else
+ simpletype = sig->params [i]->type;
+enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_I8:
+ if (int_arg_regs_used < MAX_INT_ARG_REGS) {
+ amd64_push_reg (p, int_arg_regs[int_arg_regs_used]);
+ int_arg_regs_used++;
+ stacked_args_size += 8;
+ rbpoffsets[i] = -stacked_args_size;
+ }
+ else
+ {
+ rbpoffsets[i] = next_stack_arg_rbp_offset;
+ next_stack_arg_rbp_offset += 8;
+ }
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ else
+ {
+ int size;
+ int arg_type;
+ int regs_used;
+ int offset1;
+ int size1;
+ int offset2;
+ int size2;
+
+ arg_type = value_type_info(sig->params [i]->data.klass, &size, &regs_used, &offset1, &size1, &offset2, &size2);
+
+ if (arg_type == ARG_IN_INT_REGS &&
+ (int_arg_regs_used + regs_used) <= MAX_INT_ARG_REGS)
+ {
+ amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, size);
+ stacked_args_size += size;
+ rbpoffsets[i] = stacked_args_size;
+
+ amd64_mov_reg_membase (p, int_arg_regs[int_arg_regs_used], AMD64_RSP, offset1, size1);
+ int_arg_regs_used++;
+ if (regs_used > 1)
+ {
+ amd64_mov_reg_membase (p, int_arg_regs[int_arg_regs_used], AMD64_RSP, offset2, size2);
+ int_arg_regs_used++;
+ }
+ break;
+ }
+
+ if (arg_type == ARG_IN_FLOAT_REGS &&
+ (float_arg_regs_used + regs_used) <= MAX_FLOAT_ARG_REGS)
+ {
+ amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, size);
+ stacked_args_size += size;
+ rbpoffsets[i] = stacked_args_size;
+
+ if (size1 == 4)
+ amd64_movss_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset1);
+ else
+ amd64_movsd_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset1);
+ float_arg_regs_used++;
+
+ if (regs_used > 1)
+ {
+ if (size2 == 4)
+ amd64_movss_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset2);
+ else
+ amd64_movsd_reg_membase (p, float_arg_regs_used, AMD64_RSP, offset2);
+ float_arg_regs_used++;
+ }
+ break;
+ }
+
+ rbpoffsets[i] = next_stack_arg_rbp_offset;
+ next_stack_arg_rbp_offset += size;
+ }
+ break;
+ }
+ case MONO_TYPE_R4:
+ if (float_arg_regs_used < MAX_FLOAT_ARG_REGS) {
+ amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, 8);
+ amd64_movss_regp_reg (p, AMD64_RSP, float_arg_regs_used);
+ float_arg_regs_used++;
+ stacked_args_size += 8;
+ rbpoffsets[i] = -stacked_args_size;
+ }
+ else
+ {
+ rbpoffsets[i] = next_stack_arg_rbp_offset;
+ next_stack_arg_rbp_offset += 8;
+ }
+ break;
+ case MONO_TYPE_R8:
+ stacked_args_size += 8;
+ if (float_arg_regs_used < MAX_FLOAT_ARG_REGS) {
+ amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, 8);
+ amd64_movsd_regp_reg (p, AMD64_RSP, float_arg_regs_used);
+ float_arg_regs_used++;
+ stacked_args_size += 8;
+ rbpoffsets[i] = -stacked_args_size;
+ }
+ else
+ {
+ rbpoffsets[i] = next_stack_arg_rbp_offset;
+ next_stack_arg_rbp_offset += 8;
+ }
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+ local_size = sizeof (MonoInvocation) + sizeof (stackval) * (sig->param_count + 1) + stacked_args_size;
+
+ local_size += 15;
+ local_size &= ~15;
+
+ stackval_pos = -local_size;
+ mono_invocation_pos = stackval_pos + sizeof (stackval) * (sig->param_count + 1);
+
+ /* stacked_args_size has already been pushed onto the stack. Make room for the rest of it. */
+ amd64_alu_reg_imm (p, X86_SUB, AMD64_RSP, local_size - stacked_args_size);
+
+ /* Be careful not to trash any arg regs before saving this_reg to MonoInvocation structure below. */
+
+ /*
+ * Initialize MonoInvocation fields, first the ones known now.
+ */
+ amd64_alu_reg_reg (p, X86_XOR, AMD64_RAX, AMD64_RAX);
+ amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, ex)), AMD64_RAX, 8);
+ amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, ex_handler)), AMD64_RAX, 8);
+ amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, parent)), AMD64_RAX, 8);
+ /*
+ * Set the method pointer.
+ */
+ amd64_mov_membase_imm (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, method)), (long)method, 8);
+
+ /*
+ * Handle this.
+ */
+ if (sig->hasthis)
+ amd64_mov_membase_reg(p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, obj)), this_reg, 8);
+
+ /*
+ * Handle the arguments. stackval_pos is the offset from RBP of the stackval in the MonoInvocation args array .
+ * arg_pos is the offset from RBP to the incoming arg on the stack.
+ * We just call stackval_from_data to handle all the (nasty) issues....
+ */
+ amd64_lea_membase (p, AMD64_RAX, AMD64_RBP, stackval_pos);
+ amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, stack_args)), AMD64_RAX, 8);
+ for (i = 0; i < sig->param_count; ++i) {
+/* Need to call stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke); */
+ amd64_mov_reg_imm (p, AMD64_R11, stackval_from_data);
+ amd64_mov_reg_imm (p, int_arg_regs[0], sig->params[i]);
+ amd64_lea_membase (p, int_arg_regs[1], AMD64_RBP, stackval_pos);
+ amd64_lea_membase (p, int_arg_regs[2], AMD64_RBP, rbpoffsets[i]);
+ amd64_mov_reg_imm (p, int_arg_regs[3], sig->pinvoke);
+ amd64_call_reg (p, AMD64_R11);
+ stackval_pos += sizeof (stackval);
+#if 0
+ /* fixme: alignment */
+ if (sig->pinvoke)
+ arg_pos += mono_type_native_stack_size (sig->params [i], &align);
+ else
+ arg_pos += mono_type_stack_size (sig->params [i], &align);
+#endif
+ }
+
+ /*
+ * Handle the return value storage area.
+ */
+ amd64_lea_membase (p, AMD64_RAX, AMD64_RBP, stackval_pos);
+ amd64_mov_membase_reg (p, AMD64_RBP, (mono_invocation_pos + G_STRUCT_OFFSET (MonoInvocation, retval)), AMD64_RAX, 8);
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ amd64_mov_reg_membase (p, AMD64_RCX, AMD64_RBP, retval_ptr_rbp_offset, 8);
+ amd64_mov_membase_reg (p, AMD64_RBP, stackval_pos, AMD64_RCX, 8);
+ }
+ }
+
+ /*
+ * Call the method.
+ */
+ amd64_lea_membase (p, int_arg_regs[0], AMD64_RBP, mono_invocation_pos);
+ amd64_mov_reg_imm (p, AMD64_R11, ves_exec_method);
+ amd64_call_reg (p, AMD64_R11);
+
+ /*
+ * Move the return value to the proper place.
+ */
+ amd64_lea_membase (p, AMD64_RAX, AMD64_RBP, stackval_pos);
+ if (sig->ret->byref) {
+ amd64_mov_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 8);
+ } else {
+ int simpletype = sig->ret->type;
+ enum_retvalue:
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 1);
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 2);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 4);
+ break;
+ case MONO_TYPE_I8:
+ amd64_movzx_reg_membase (p, AMD64_RAX, AMD64_RAX, 0, 8);
+ break;
+ case MONO_TYPE_R4:
+ amd64_movss_regp_reg (p, AMD64_RAX, AMD64_XMM0);
+ break;
+ case MONO_TYPE_R8:
+ amd64_movsd_regp_reg (p, AMD64_RAX, AMD64_XMM0);
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ int size;
+ int arg_type;
+ int regs_used;
+ int offset1;
+ int size1;
+ int offset2;
+ int size2;
+
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+
+ arg_type = value_type_info(sig->params [i]->data.klass, &size, &regs_used, &offset1, &size1, &offset2, &size2);
+
+ if (arg_type == ARG_IN_INT_REGS)
+ {
+ if (regs_used > 1)
+ amd64_mov_membase_reg (p, AMD64_RAX, offset2, AMD64_RDX, size2);
+ amd64_mov_membase_reg (p, AMD64_RAX, offset1, AMD64_RAX, size1);
+ break;
+ }
+
+ if (arg_type == ARG_IN_FLOAT_REGS)
+ {
+ if (size1 == 4)
+ amd64_movss_membase_reg (p, AMD64_RAX, offset1, AMD64_XMM0);
+ else
+ amd64_movsd_membase_reg (p, AMD64_RAX, offset1, AMD64_XMM0);
+
+ if (regs_used > 1)
+ {
+ if (size2 == 4)
+ amd64_movss_membase_reg (p, AMD64_RAX, offset2, AMD64_XMM1);
+ else
+ amd64_movsd_membase_reg (p, AMD64_RAX, offset2, AMD64_XMM1);
+ }
+ break;
+ }
+
+ /* Else result should have been stored in place already. IA32 code has a stackval_to_data call here, which
+ * looks wrong to me as the pointer in the stack val being converted is setup to point to the output area anyway.
+ * It all looks a bit suspect anyway.
+ */
+ break;
+ }
+ default:
+ g_error ("Type 0x%x not handled yet in thunk creation", sig->ret->type);
+ break;
+ }
+ }
+
+ /*
+ * Standard epilog.
+ */
+ amd64_leave (p);
+ amd64_ret (p);
+
+ g_assert (p - code_buffer < 512);
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = p - code_buffer;
+ ji->code_start = g_memdup (code_buffer, p - code_buffer);
+
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
+
+ return ji->code_start;
+}
diff --git a/mono/arch/amd64/x86-64-codegen.h b/mono/arch/amd64/x86-64-codegen.h
new file mode 100644
index 00000000000..68bcfec56c4
--- /dev/null
+++ b/mono/arch/amd64/x86-64-codegen.h
@@ -0,0 +1,409 @@
+/*
+ * amd64-codegen.h: Macros for generating x86 code
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ * Intel Corporation (ORP Project)
+ * Sergey Chaban (serge@wildwestsoftware.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
+ * Zalman Stern
+ *
+ * Not all routines are done for AMD64. Much could also be removed from here if supporting tramp.c is the only goal.
+ *
+ * Copyright (C) 2000 Intel Corporation. All rights reserved.
+ * Copyright (C) 2001, 2002 Ximian, Inc.
+ */
+
+#ifndef AMD64_H
+#define AMD64_H
+
+typedef enum {
+ AMD64_RAX = 0,
+ AMD64_RCX = 1,
+ AMD64_RDX = 2,
+ AMD64_RBX = 3,
+ AMD64_RSP = 4,
+ AMD64_RBP = 5,
+ AMD64_RSI = 6,
+ AMD64_RDI = 7,
+ AMD64_R8 = 8,
+ AMD64_R9 = 9,
+ AMD64_R10 = 10,
+ AMD64_R11 = 11,
+ AMD64_R12 = 12,
+ AMD64_R13 = 13,
+ AMD64R_14 = 14,
+ AMD64_R15 = 15,
+ AMD64_NREG
+} AMD64_Reg_No;
+
+typedef enum {
+ AMD64_XMM0 = 0,
+ AMD64_XMM1 = 1,
+ AMD64_XMM2 = 2,
+ AMD64_XMM3 = 3,
+ AMD64_XMM4 = 4,
+ AMD64_XMM5 = 5,
+ AMD64_XMM6 = 6,
+ AMD64_XMM8 = 8,
+ AMD64_XMM9 = 9,
+ AMD64_XMM10 = 10,
+ AMD64_XMM11 = 11,
+ AMD64_XMM12 = 12,
+ AMD64_XMM13 = 13,
+ AMD64_XMM14 = 14,
+ AMD64_XMM15 = 15,
+ AMD64_XMM_NREG = 16,
+} AMD64_XMM_Reg_No;
+
+typedef enum
+{
+ AMD64_REX_B = 1, /* The register in r/m field, base register in SIB byte, or reg in opcode is 8-15 rather than 0-7 */
+ AMD64_REX_X = 2, /* The index register in SIB byte is 8-15 rather than 0-7 */
+ AMD64_REX_R = 4, /* The reg field of ModRM byte is 8-15 rather than 0-7 */
+ AMD64_REX_W = 8 /* Opeartion is 64-bits instead of 32 (default) or 16 (with 0x66 prefix) */
+} AMD64_REX_Bits;
+
+#define AMD64_REX(bits) ((unsigned char)(0x40 | (bits)))
+#define amd64_emit_rex(inst, width, reg_modrm, reg_index, reg_rm_base_opcode) \
+ { \
+ unsigned char _amd64_rex_bits = \
+ (((width) > 4) ? AMD64_REX_W : 0) | \
+ (((reg_modrm) > 7) ? AMD64_REX_R : 0) | \
+ (((reg_index) > 7) ? AMD64_REX_X : 0) | \
+ (((reg_rm_base_opcode) > 7) ? AMD64_REX_B : 0); \
+ if (_amd64_rex_bits != 0) *(inst)++ = AMD64_REX(_amd64_rex_bits); \
+ }
+
+typedef union {
+ long val;
+ unsigned char b [8];
+} amd64_imm_buf;
+
+#include "../x86/x86-codegen.h"
+
+
+/* Need to fill this info in for amd64. */
+
+#if 0
+/*
+// bitvector mask for callee-saved registers
+*/
+#define X86_ESI_MASK (1<<X86_ESI)
+#define X86_EDI_MASK (1<<X86_EDI)
+#define X86_EBX_MASK (1<<X86_EBX)
+#define X86_EBP_MASK (1<<X86_EBP)
+
+#define X86_CALLEE_REGS ((1<<X86_EAX) | (1<<X86_ECX) | (1<<X86_EDX))
+#define X86_CALLER_REGS ((1<<X86_EBX) | (1<<X86_EBP) | (1<<X86_ESI) | (1<<X86_EDI))
+#define X86_BYTE_REGS ((1<<X86_EAX) | (1<<X86_ECX) | (1<<X86_EDX) | (1<<X86_EBX))
+
+#define X86_IS_SCRATCH(reg) (X86_CALLER_REGS & (1 << (reg))) /* X86_EAX, X86_ECX, or X86_EDX */
+#define X86_IS_CALLEE(reg) (X86_CALLEE_REGS & (1 << (reg))) /* X86_ESI, X86_EDI, X86_EBX, or X86_EBP */
+
+#define X86_IS_BYTE_REG(reg) ((reg) < 4)
+
+/*
+// Frame structure:
+//
+// +--------------------------------+
+// | in_arg[0] = var[0] |
+// | in_arg[1] = var[1] |
+// | . . . |
+// | in_arg[n_arg-1] = var[n_arg-1] |
+// +--------------------------------+
+// | return IP |
+// +--------------------------------+
+// | saved EBP | <-- frame pointer (EBP)
+// +--------------------------------+
+// | ... | n_extra
+// +--------------------------------+
+// | var[n_arg] |
+// | var[n_arg+1] | local variables area
+// | . . . |
+// | var[n_var-1] |
+// +--------------------------------+
+// | |
+// | |
+// | spill area | area for spilling mimic stack
+// | |
+// +--------------------------------|
+// | ebx |
+// | ebp [ESP_Frame only] |
+// | esi | 0..3 callee-saved regs
+// | edi | <-- stack pointer (ESP)
+// +--------------------------------+
+// | stk0 |
+// | stk1 | operand stack area/
+// | . . . | out args
+// | stkn-1 |
+// +--------------------------------|
+//
+//
+*/
+#endif
+
+#define x86_imm_emit64(inst,imm) \
+ do { \
+ amd64_imm_buf imb; imb.val = (long) (imm); \
+ *(inst)++ = imb.b [0]; \
+ *(inst)++ = imb.b [1]; \
+ *(inst)++ = imb.b [2]; \
+ *(inst)++ = imb.b [3]; \
+ *(inst)++ = imb.b [4]; \
+ *(inst)++ = imb.b [5]; \
+ *(inst)++ = imb.b [6]; \
+ *(inst)++ = imb.b [7]; \
+ } while (0)
+
+#define amd64_alu_reg_imm(inst,opc,reg,imm) \
+ do { \
+ if ((reg) == X86_EAX) { \
+ amd64_emit_rex(inst, 8, 0, 0, 0); \
+ *(inst)++ = (((unsigned char)(opc)) << 3) + 5; \
+ x86_imm_emit64 ((inst), (imm)); \
+ break; \
+ } \
+ if (x86_is_imm8((imm))) { \
+ amd64_emit_rex(inst, 8, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x83; \
+ x86_reg_emit ((inst), (opc), (reg)); \
+ x86_imm_emit8 ((inst), (imm)); \
+ } else { \
+ amd64_emit_rex(inst, 8, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x81; \
+ x86_reg_emit ((inst), (opc), (reg)); \
+ x86_imm_emit32 ((inst), (imm)); \
+ } \
+ } while (0)
+
+#define amd64_alu_reg_reg(inst,opc,dreg,reg) \
+ do { \
+ amd64_emit_rex(inst, 8, (dreg), 0, (reg)); \
+ *(inst)++ = (((unsigned char)(opc)) << 3) + 3; \
+ x86_reg_emit ((inst), (dreg), (reg)); \
+ } while (0)
+
+#define amd64_mov_regp_reg(inst,regp,reg,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, (regp)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x88; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x89; break; \
+ default: assert (0); \
+ } \
+ x86_regp_emit ((inst), (reg), (regp)); \
+ } while (0)
+
+#define amd64_mov_membase_reg(inst,basereg,disp,reg,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, (basereg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x88; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x89; break; \
+ default: assert (0); \
+ } \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+
+#define amd64_mov_reg_reg(inst,dreg,reg,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (dreg), 0, (reg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x8a; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_reg_emit ((inst), (dreg), (reg)); \
+ } while (0)
+
+#define amd64_mov_reg_mem(inst,reg,mem,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, 0); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x8a; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_mem_emit ((inst), (reg), (mem)); \
+ } while (0)
+
+#define amd64_mov_reg_membase(inst,reg,basereg,disp,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), (reg), 0, (basereg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x8a; break; \
+ case 2: case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+#define amd64_movzx_reg_membase(inst,reg,basereg,disp,size) \
+ do { \
+ amd64_emit_rex(inst, (size), (reg), 0, (basereg)); \
+ switch ((size)) { \
+ case 1: *(inst)++ = (unsigned char)0x0f; *(inst)++ = (unsigned char)0xb6; break; \
+ case 2: *(inst)++ = (unsigned char)0x0f; *(inst)++ = (unsigned char)0xb7; break; \
+ case 4: case 8: *(inst)++ = (unsigned char)0x8b; break; \
+ default: assert (0); \
+ } \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+/* Pretty much the only instruction that supports a 64-bit immediate. Optimize for common case of
+ * 32-bit immediate. Pepper with casts to avoid warnings.
+ */
+#define amd64_mov_reg_imm(inst,reg,imm) \
+ do { \
+ int _amd64_width_temp = ((long)(imm) == (long)(int)(long)(imm)); \
+ amd64_emit_rex(inst, _amd64_width_temp ? 8 : 4, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0xb8 + ((reg) & 0x7); \
+ if (_amd64_width_temp) \
+ x86_imm_emit64 ((inst), (long)(imm)); \
+ else \
+ x86_imm_emit32 ((inst), (int)(long)(imm)); \
+ } while (0)
+
+#define amd64_mov_membase_imm(inst,basereg,disp,imm,size) \
+ do { \
+ if ((size) == 2) \
+ *(inst)++ = (unsigned char)0x66; \
+ amd64_emit_rex(inst, (size), 0, 0, (basereg)); \
+ if ((size) == 1) { \
+ *(inst)++ = (unsigned char)0xc6; \
+ x86_membase_emit ((inst), 0, (basereg), (disp)); \
+ x86_imm_emit8 ((inst), (imm)); \
+ } else if ((size) == 2) { \
+ *(inst)++ = (unsigned char)0xc7; \
+ x86_membase_emit ((inst), 0, (basereg), (disp)); \
+ x86_imm_emit16 ((inst), (imm)); \
+ } else { \
+ *(inst)++ = (unsigned char)0xc7; \
+ x86_membase_emit ((inst), 0, (basereg), (disp)); \
+ x86_imm_emit32 ((inst), (imm)); \
+ } \
+ } while (0)
+
+#define amd64_lea_membase(inst,reg,basereg,disp) \
+ do { \
+ amd64_emit_rex(inst, 8, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x8d; \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+/* Instruction are implicitly 64-bits so don't generate REX for just the size. */
+#define amd64_push_reg(inst,reg) \
+ do { \
+ amd64_emit_rex(inst, 0, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x50 + ((reg) & 0x7); \
+ } while (0)
+
+/* Instruction is implicitly 64-bits so don't generate REX for just the size. */
+#define amd64_push_membase(inst,basereg,disp) \
+ do { \
+ amd64_emit_rex(inst, 0, 0, 0, (basereg)); \
+ *(inst)++ = (unsigned char)0xff; \
+ x86_membase_emit ((inst), 6, (basereg), (disp)); \
+ } while (0)
+
+#define amd64_pop_reg(inst,reg) \
+ do { \
+ amd64_emit_rex(inst, 0, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0x58 + (reg); \
+ } while (0)
+
+#define amd64_call_reg(inst,reg) \
+ do { \
+ amd64_emit_rex(inst, 0, 0, 0, (reg)); \
+ *(inst)++ = (unsigned char)0xff; \
+ x86_reg_emit ((inst), 2, (reg)); \
+ } while (0)
+
+#define amd64_ret(inst) do { *(inst)++ = (unsigned char)0xc3; } while (0)
+#define amd64_leave(inst) do { *(inst)++ = (unsigned char)0xc9; } while (0)
+#define amd64_movsd_reg_regp(inst,reg,regp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_regp_emit ((inst), (reg), (regp)); \
+ } while (0)
+
+#define amd64_movsd_regp_reg(inst,regp,reg) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_regp_emit ((inst), (reg), (regp)); \
+ } while (0)
+
+#define amd64_movss_reg_regp(inst,reg,regp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_regp_emit ((inst), (reg), (regp)); \
+ } while (0)
+
+#define amd64_movss_regp_reg(inst,regp,reg) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (regp)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_regp_emit ((inst), (reg), (regp)); \
+ } while (0)
+
+#define amd64_movsd_reg_membase(inst,reg,basereg,disp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+#define amd64_movss_reg_membase(inst,reg,basereg,disp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x10; \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+#define amd64_movsd_membase_reg(inst,reg,basereg,disp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf2; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+#define amd64_movss_membase_reg(inst,reg,basereg,disp) \
+ do { \
+ *(inst)++ = (unsigned char)0xf3; \
+ amd64_emit_rex(inst, 0, (reg), 0, (basereg)); \
+ *(inst)++ = (unsigned char)0x0f; \
+ *(inst)++ = (unsigned char)0x11; \
+ x86_membase_emit ((inst), (reg), (basereg), (disp)); \
+ } while (0)
+
+#endif // AMD64_H
diff --git a/mono/arch/arm/Makefile.am b/mono/arch/arm/Makefile.am
index afce5cd673d..b245bcd9bd9 100644
--- a/mono/arch/arm/Makefile.am
+++ b/mono/arch/arm/Makefile.am
@@ -14,7 +14,7 @@ libmonoarch_arm_la_SOURCES = $(BUILT_SOURCES) \
arm-dis.h
arm_dpimacros.h: dpiops.sh mov_macros.th dpi_macros.th cmp_macros.th
- bash ./dpiops.sh
+ bash $(srcdir)/dpiops.sh
CLEANFILES = $(BUILT_SOURCES)
diff --git a/mono/arch/arm/arm-codegen.c b/mono/arch/arm/arm-codegen.c
index 88d572afe13..9914ace34f3 100644
--- a/mono/arch/arm/arm-codegen.c
+++ b/mono/arch/arm/arm-codegen.c
@@ -156,9 +156,9 @@ arminstr_t* arm_mov_reg_imm32_cond(arminstr_t* p, int reg, armword_t imm32, int
if ((shift & 0x80000001) != 1) {
if (shift >= 0) {
- ARM_MOV_REG_IMM_COND(p, reg, imm32 >> ((32 - shift) & 31), shift >> 1, cond);
+ ARM_MOV_REG_IMM_COND(p, reg, imm32 >> ((32 - shift) & 31), shift, cond);
} else {
- ARM_MVN_REG_IMM_COND(p, reg, (imm32 ^ (~0)) >> ((32 + 2 + shift) & 31), (-shift - 2) >> 1, cond);
+ ARM_MVN_REG_IMM_COND(p, reg, (imm32 ^ (~0)) >> ((32 + 2 + shift) & 31), (-shift - 2), cond);
}
} else {
mov_op = ARMOP_MOV;
@@ -172,12 +172,12 @@ arminstr_t* arm_mov_reg_imm32_cond(arminstr_t* p, int reg, armword_t imm32, int
shift = (arm_bsf(imm32) - 1) & (~1);
snip = imm32 & (0xFF << shift);
- ARM_EMIT(p, ARM_DEF_DPI_IMM_COND(snip >> shift, (32 - shift) >> 1, reg, 0, 0, mov_op, cond));
+ ARM_EMIT(p, ARM_DEF_DPI_IMM_COND((unsigned)snip >> shift, (32 - shift) >> 1, reg, 0, 0, mov_op, cond));
while ((imm32 ^= snip) != 0) {
shift = (arm_bsf(imm32) - 1) & (~1);
snip = imm32 & (0xFF << shift);
- ARM_EMIT(p, ARM_DEF_DPI_IMM_COND(snip >> shift, (32 - shift) >> 1, reg, reg, 0, step_op, cond));
+ ARM_EMIT(p, ARM_DEF_DPI_IMM_COND((unsigned)snip >> shift, (32 - shift) >> 1, reg, reg, 0, step_op, cond));
}
}
diff --git a/mono/arch/arm/arm-codegen.h b/mono/arch/arm/arm-codegen.h
index 3d6c7988a60..61302a43937 100644
--- a/mono/arch/arm/arm-codegen.h
+++ b/mono/arch/arm/arm-codegen.h
@@ -31,7 +31,13 @@ arminstr_t* arm_mov_reg_imm32(arminstr_t* p, int reg, armword_t imm32);
void __inline _arm_emit(arminstr_t** p, arminstr_t i) {**p = i; (*p)++;}
# define ARM_EMIT(p, i) _arm_emit((arminstr_t**)&p, (arminstr_t)(i))
#else
-# define ARM_EMIT(p, i) *(arminstr_t*)p = (arminstr_t)i; ((arminstr_t*)p)++
+# define ARM_EMIT(p, i) do {*(arminstr_t*)p = (arminstr_t)i; ((arminstr_t*)p)++;} while (0)
+#endif
+
+#if defined(_MSC_VER) && !defined(ARM_NOIASM)
+# define ARM_IASM(_expr) __emit (_expr)
+#else
+# define ARM_IASM(_expr)
#endif
/* even_scale = rot << 1 */
@@ -98,6 +104,9 @@ typedef enum {
ARMREG_CR14,
ARMREG_CR15,
+ /* XScale: acc0 on CP0 */
+ ARMREG_ACC0 = ARMREG_CR0,
+
ARMREG_MAX = ARMREG_R15
} ARMReg;
@@ -110,22 +119,22 @@ typedef enum {
typedef enum {
- ARMCOND_EQ = 0x0, /* Equal */
- ARMCOND_NE = 0x1, /* Not equal, or unordered */
- ARMCOND_CS = 0x2, /* Carry set */
- ARMCOND_HS = ARMCOND_CS, /* Unsigned higher or same */
- ARMCOND_CC = 0x3, /* Carry clear */
+ ARMCOND_EQ = 0x0, /* Equal; Z = 1 */
+ ARMCOND_NE = 0x1, /* Not equal, or unordered; Z = 0 */
+ ARMCOND_CS = 0x2, /* Carry set; C = 1 */
+ ARMCOND_HS = ARMCOND_CS, /* Unsigned higher or same; */
+ ARMCOND_CC = 0x3, /* Carry clear; C = 0 */
ARMCOND_LO = ARMCOND_CC, /* Unsigned lower */
- ARMCOND_MI = 0x4, /* Negative */
- ARMCOND_PL = 0x5, /* Positive or zero */
- ARMCOND_VS = 0x6, /* Overflow */
- ARMCOND_VC = 0x7, /* No overflow */
- ARMCOND_HI = 0x8, /* Unsigned higher */
- ARMCOND_LS = 0x9, /* Unsigned lower or same */
- ARMCOND_GE = 0xA, /* Signed greater than or equal */
- ARMCOND_LT = 0xB, /* Signed less than */
- ARMCOND_GT = 0xC, /* Signed greater than */
- ARMCOND_LE = 0xD, /* Signed less than or equal */
+ ARMCOND_MI = 0x4, /* Negative; N = 1 */
+ ARMCOND_PL = 0x5, /* Positive or zero; N = 0 */
+ ARMCOND_VS = 0x6, /* Overflow; V = 1 */
+ ARMCOND_VC = 0x7, /* No overflow; V = 0 */
+ ARMCOND_HI = 0x8, /* Unsigned higher; C = 1 && Z = 0 */
+ ARMCOND_LS = 0x9, /* Unsigned lower or same; C = 0 || Z = 1 */
+ ARMCOND_GE = 0xA, /* Signed greater than or equal; N = V */
+ ARMCOND_LT = 0xB, /* Signed less than; N != V */
+ ARMCOND_GT = 0xC, /* Signed greater than; Z = 0 && N = V */
+ ARMCOND_LE = 0xD, /* Signed less than or equal; Z = 1 && N != V */
ARMCOND_AL = 0xE, /* Always */
ARMCOND_NV = 0xF, /* Never */
@@ -185,12 +194,41 @@ typedef enum {
ARMOP_MLA = 0x1, /* Rd := (Rm*Rs)+Rn */
/* ARM3M+ */
- ARMOP_UMUL = 0x4,
+ ARMOP_UMULL = 0x4,
ARMOP_UMLAL = 0x5,
ARMOP_SMULL = 0x6,
- ARMOP_SMLAL = 0x7
+ ARMOP_SMLAL = 0x7,
+
+ /* for data transfers with register offset */
+ ARM_UP = 1,
+ ARM_DOWN = 0
} ARMOpcode;
+typedef enum {
+ THUMBOP_AND = 0,
+ THUMBOP_EOR = 1,
+ THUMBOP_LSL = 2,
+ THUMBOP_LSR = 3,
+ THUMBOP_ASR = 4,
+ THUMBOP_ADC = 5,
+ THUMBOP_SBC = 6,
+ THUMBOP_ROR = 7,
+ THUMBOP_TST = 8,
+ THUMBOP_NEG = 9,
+ THUMBOP_CMP = 10,
+ THUMBOP_CMN = 11,
+ THUMBOP_ORR = 12,
+ THUMBOP_MUL = 13,
+ THUMBOP_BIC = 14,
+ THUMBOP_MVN = 15,
+ THUMBOP_MOV = 16,
+ THUMBOP_CMPI = 17,
+ THUMBOP_ADD = 18,
+ THUMBOP_SUB = 19,
+ THUMBOP_CMPH = 19,
+ THUMBOP_MOVH = 20
+} ThumbOpcode;
+
/* Generic form - all ARM instructions are conditional. */
typedef struct {
@@ -295,12 +333,18 @@ typedef union {
#define ARM_DEF_DPI_IMM(imm8, rot, rd, rn, s, op) \
ARM_DEF_DPI_IMM_COND(imm8, rot, rd, rn, s, op, ARMCOND_AL)
-
+/* codegen */
#define ARM_DPIOP_REG_IMM8ROT_COND(p, op, rd, rn, imm8, rot, cond) \
ARM_EMIT(p, ARM_DEF_DPI_IMM_COND((imm8), ((rot) >> 1), (rd), (rn), 0, (op), cond))
#define ARM_DPIOP_S_REG_IMM8ROT_COND(p, op, rd, rn, imm8, rot, cond) \
ARM_EMIT(p, ARM_DEF_DPI_IMM_COND((imm8), ((rot) >> 1), (rd), (rn), 1, (op), cond))
+/* inline */
+#define ARM_IASM_DPIOP_REG_IMM8ROT_COND(p, op, rd, rn, imm8, rot, cond) \
+ ARM_IASM(ARM_DEF_DPI_IMM_COND((imm8), ((rot) >> 1), (rd), (rn), 0, (op), cond))
+#define ARM_IASM_DPIOP_S_REG_IMM8ROT_COND(p, op, rd, rn, imm8, rot, cond) \
+ ARM_IASM(ARM_DEF_DPI_IMM_COND((imm8), ((rot) >> 1), (rd), (rn), 1, (op), cond))
+
#define ARM_DEF_DPI_REG_IMMSHIFT_COND(rm, shift_type, imm_shift, rd, rn, s, op, cond) \
@@ -314,6 +358,7 @@ typedef union {
(ARM_DPI_TAG) | \
ARM_DEF_COND(cond)
+/* codegen */
#define ARM_DPIOP_REG_IMMSHIFT_COND(p, op, rd, rn, rm, shift_t, imm_shift, cond) \
ARM_EMIT(p, ARM_DEF_DPI_REG_IMMSHIFT_COND((rm), shift_t, imm_shift, (rd), (rn), 0, (op), cond))
@@ -326,7 +371,46 @@ typedef union {
#define ARM_DPIOP_S_REG_REG_COND(p, op, rd, rn, rm, cond) \
ARM_EMIT(p, ARM_DEF_DPI_REG_IMMSHIFT_COND((rm), ARMSHIFT_LSL, 0, (rd), (rn), 1, (op), cond))
+/* inline */
+#define ARM_IASM_DPIOP_REG_IMMSHIFT_COND(p, op, rd, rn, rm, shift_t, imm_shift, cond) \
+ ARM_IASM(ARM_DEF_DPI_REG_IMMSHIFT_COND((rm), shift_t, imm_shift, (rd), (rn), 0, (op), cond))
+#define ARM_IASM_DPIOP_S_REG_IMMSHIFT_COND(p, op, rd, rn, rm, shift_t, imm_shift, cond) \
+ ARM_IASM(ARM_DEF_DPI_REG_IMMSHIFT_COND((rm), shift_t, imm_shift, (rd), (rn), 1, (op), cond))
+
+#define ARM_IASM_DPIOP_REG_REG_COND(p, op, rd, rn, rm, cond) \
+ ARM_IASM(ARM_DEF_DPI_REG_IMMSHIFT_COND((rm), ARMSHIFT_LSL, 0, (rd), (rn), 0, (op), cond))
+
+#define ARM_IASM_DPIOP_S_REG_REG_COND(p, op, rd, rn, rm, cond) \
+ ARM_IASM_EMIT(ARM_DEF_DPI_REG_IMMSHIFT_COND((rm), ARMSHIFT_LSL, 0, (rd), (rn), 1, (op), cond))
+
+
+/* Rd := Rn op (Rm shift_type Rs) */
+#define ARM_DEF_DPI_REG_REGSHIFT_COND(rm, shift_type, rs, rd, rn, s, op, cond) \
+ (rm) | \
+ (1 << 4) | \
+ ((shift_type & 3) << 5) | \
+ ((rs) << 8) | \
+ ((rd) << 12) | \
+ ((rn) << 16) | \
+ ((s) << 20) | \
+ ((op) << 21) | \
+ (ARM_DPI_TAG) | \
+ ARM_DEF_COND(cond)
+
+/* codegen */
+#define ARM_DPIOP_REG_REGSHIFT_COND(p, op, rd, rn, rm, shift_t, rs, cond) \
+ ARM_EMIT(p, ARM_DEF_DPI_REG_REGSHIFT_COND((rm), shift_t, (rs), (rd), (rn), 0, (op), cond))
+
+#define ARM_DPIOP_S_REG_REGSHIFT_COND(p, op, rd, rn, rm, shift_t, rs, cond) \
+ ARM_EMIT(p, ARM_DEF_DPI_REG_REGSHIFT_COND((rm), shift_t, (rs), (rd), (rn), 1, (op), cond))
+
+/* inline */
+#define ARM_IASM_DPIOP_REG_REGSHIFT_COND(p, op, rd, rn, rm, shift_t, rs, cond) \
+ ARM_IASM(ARM_DEF_DPI_REG_REGSHIFT_COND((rm), shift_t, (rs), (rd), (rn), 0, (op), cond))
+
+#define ARM_IASM_DPIOP_S_REG_REGSHIFT_COND(p, op, rd, rn, rm, shift_t, rs, cond) \
+ ARM_IASM(ARM_DEF_DPI_REG_REGSHIFT_COND((rm), shift_t, (rs), (rd), (rn), 1, (op), cond))
@@ -348,27 +432,47 @@ typedef struct {
#define ARM_MRT_TAG ARM_MRT_ID << 25
#define ARM_DEF_MRT(regs, rn, l, w, s, u, p, cond) \
- (regs) | \
- (rn << 16) | \
- (l << 20) | \
- (w << 21) | \
- (s << 22) | \
- (u << 23) | \
- (p << 24) | \
- (ARM_MRT_TAG) | \
- ARM_DEF_COND(cond)
+ (regs) | \
+ (rn << 16) | \
+ (l << 20) | \
+ (w << 21) | \
+ (s << 22) | \
+ (u << 23) | \
+ (p << 24) | \
+ (ARM_MRT_TAG) | \
+ ARM_DEF_COND(cond)
/* stmdb sp!, {regs} */
#define ARM_PUSH(p, regs) ARM_EMIT(p, ARM_DEF_MRT(regs, ARMREG_SP, 0, 1, 0, 0, 1, ARMCOND_AL))
+#define ARM_IASM_PUSH(regs) ARM_IASM(ARM_DEF_MRT(regs, ARMREG_SP, 0, 1, 0, 0, 1, ARMCOND_AL))
/* ldmia sp!, {regs} */
#define ARM_POP(p, regs) ARM_EMIT(p, ARM_DEF_MRT(regs, ARMREG_SP, 1, 1, 0, 1, 0, ARMCOND_AL))
+#define ARM_IASM_POP(regs) ARM_IASM_EMIT(ARM_DEF_MRT(regs, ARMREG_SP, 1, 1, 0, 1, 0, ARMCOND_AL))
/* ldmia sp, {regs} ; (no write-back) */
#define ARM_POP_NWB(p, regs) ARM_EMIT(p, ARM_DEF_MRT(regs, ARMREG_SP, 1, 0, 0, 1, 0, ARMCOND_AL))
-
+#define ARM_IASM_POP_NWB(regs) ARM_IASM_EMIT(ARM_DEF_MRT(regs, ARMREG_SP, 1, 0, 0, 1, 0, ARMCOND_AL))
+
+#define ARM_PUSH1(p, r1) ARM_PUSH(p, (1 << r1))
+#define ARM_PUSH2(p, r1, r2) ARM_PUSH(p, (1 << r1) | (1 << r2))
+#define ARM_PUSH3(p, r1, r2, r3) ARM_PUSH(p, (1 << r1) | (1 << r2) | (1 << r3))
+#define ARM_PUSH4(p, r1, r2, r3, r4) ARM_PUSH(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4))
+#define ARM_PUSH5(p, r1, r2, r3, r4, r5) ARM_PUSH(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5))
+#define ARM_PUSH6(p, r1, r2, r3, r4, r5, r6) ARM_PUSH(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5) | (1 << r6))
+#define ARM_PUSH7(p, r1, r2, r3, r4, r5, r6, r7) ARM_PUSH(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5) | (1 << r6) | (1 << r7))
+#define ARM_PUSH8(p, r1, r2, r3, r4, r5, r6, r7, r8) ARM_PUSH(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5) | (1 << r6) | (1 << r7) | (1 << r8))
+
+#define ARM_POP8(p, r1, r2, r3, r4, r5, r6, r7, r8) ARM_POP(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5) | (1 << r6) | (1 << r7) | (1 << r8))
+#define ARM_POP7(p, r1, r2, r3, r4, r5, r6, r7) ARM_POP(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5) | (1 << r6) | (1 << r7))
+#define ARM_POP6(p, r1, r2, r3, r4, r5, r6) ARM_POP(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5) | (1 << r6))
+#define ARM_POP5(p, r1, r2, r3, r4, r5) ARM_POP(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4) | (1 << r5))
+#define ARM_POP4(p, r1, r2, r3, r4) ARM_POP(p, (1 << r1) | (1 << r2) | (1 << r3) | (1 << r4))
+#define ARM_POP3(p, r1, r2, r3) ARM_POP(p, (1 << r1) | (1 << r2) | (1 << r3))
+#define ARM_POP2(p, r1, r2) ARM_POP(p, (1 << r1) | (1 << r2))
+#define ARM_POP1(p, r1) ARM_POP(p, (1 << r1))
/* Multiply instructions */
@@ -389,6 +493,60 @@ typedef struct {
#define ARM_MUL_MASK ((0xF << 24) | (0xF << 4))
#define ARM_MUL_TAG ((ARM_MUL_ID << 24) | (ARM_MUL_ID2 << 4))
+#define ARM_DEF_MUL_COND(op, rd, rm, rs, rn, s, cond) \
+ (rm) | \
+ ((rs) << 8) | \
+ ((rn) << 12) | \
+ ((rd) << 16) | \
+ ((s & 1) << 17) | \
+ ((op & 7) << 18) | \
+ ARM_MUL_TAG | \
+ ARM_DEF_COND(cond)
+
+/* Rd := (Rm * Rs)[31:0]; 32 x 32 -> 32 */
+#define ARM_MUL_COND(p, rd, rm, rs, cond) \
+ ARM_EMIT(p, ARM_DEF_MUL_COND(ARMOP_MUL, rd, rm, rs, 0, 0, cond))
+#define ARM_MUL(p, rd, rm, rs) \
+ ARM_MUL_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_MULS_COND(p, rd, rm, rs, cond) \
+ ARM_EMIT(p, ARM_DEF_MUL_COND(ARMOP_MUL, rd, rm, rs, 0, 1, cond))
+#define ARM_MULS(p, rd, rm, rs) \
+ ARM_MULS_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_MUL_REG_REG(p, rd, rm, rs) ARM_MUL(p, rd, rm, rs)
+#define ARM_MULS_REG_REG(p, rd, rm, rs) ARM_MULS(p, rd, rm, rs)
+
+/* inline */
+#define ARM_IASM_MUL_COND(rd, rm, rs, cond) \
+ ARM_IASM_EMIT(ARM_DEF_MUL_COND(ARMOP_MUL, rd, rm, rs, 0, 0, cond))
+#define ARM_IASM_MUL(rd, rm, rs) \
+ ARM_IASM_MUL_COND(rd, rm, rs, ARMCOND_AL)
+#define ARM_IASM_MULS_COND(rd, rm, rs, cond) \
+ ARM_IASM_EMIT(ARM_DEF_MUL_COND(ARMOP_MUL, rd, rm, rs, 0, 1, cond))
+#define ARM_IASM_MULS(rd, rm, rs) \
+ ARM_IASM_MULS_COND(rd, rm, rs, ARMCOND_AL)
+
+
+/* Rd := (Rm * Rs) + Rn; 32x32+32->32 */
+#define ARM_MLA_COND(p, rd, rm, rs, rn, cond) \
+ ARM_EMIT(p, ARM_DEF_MUL_COND(ARMOP_MLA, rd, rm, rs, rn, 0, cond))
+#define ARM_MLA(p, rd, rm, rs, rn) \
+ ARM_MLA_COND(p, rd, rm, rs, rn, ARMCOND_AL)
+#define ARM_MLAS_COND(p, rd, rm, rs, rn, cond) \
+ ARM_EMIT(p, ARM_DEF_MUL_COND(ARMOP_MLA, rd, rm, rs, rn, 1, cond))
+#define ARM_MLAS(p, rd, rm, rs, rn) \
+ ARM_MLAS_COND(p, rd, rm, rs, rn, ARMCOND_AL)
+
+/* inline */
+#define ARM_IASM_MLA_COND(rd, rm, rs, rn, cond) \
+ ARM_IASM_EMIT(ARM_DEF_MUL_COND(ARMOP_MLA, rd, rm, rs, rn, 0, cond))
+#define ARM_IASM_MLA(rd, rm, rs, rn) \
+ ARM_IASM_MLA_COND(rd, rm, rs, rn, ARMCOND_AL)
+#define ARM_IASM_MLAS_COND(rd, rm, rs, rn, cond) \
+ ARM_IASM_EMIT(ARM_DEF_MUL_COND(ARMOP_MLA, rd, rm, rs, rn, 1, cond))
+#define ARM_IASM_MLAS(rd, rm, rs, rn) \
+ ARM_IASM_MLAS_COND(rd, rm, rs, rn, ARMCOND_AL)
+
+
/* Word/byte transfer */
typedef union {
@@ -400,7 +558,7 @@ typedef union {
arminstr_t ls : 1;
arminstr_t wb : 1;
arminstr_t b : 1;
- arminstr_t u : 1;
+ arminstr_t u : 1; /* down(0) / up(1) */
arminstr_t p : 1; /* post-index(0) / pre-index(1) */
arminstr_t type : 1; /* imm(0) / register(1) */
arminstr_t tag : 2; /* 0 1 */
@@ -427,7 +585,7 @@ typedef union {
#define ARM_WXFER_MAX_OFFS 0xFFF
-/* this macro checks imm12 bounds */
+/* this macro checks for imm12 bounds */
#define ARM_EMIT_WXFER_IMM(ptr, imm12, rd, rn, ls, wb, b, p, cond) \
do { \
int _imm12 = (int)(imm12) < -ARM_WXFER_MAX_OFFS \
@@ -487,9 +645,13 @@ typedef union {
#define ARM_STRB_IMM(p, rd, rn, imm) ARM_STRB_IMM_COND(p, rd, rn, imm, ARMCOND_AL)
+/* write-back */
+#define ARM_STR_IMM_WB_COND(p, rd, rn, imm, cond) \
+ ARM_EMIT_WXFER_IMM(p, imm, rd, rn, ARMOP_STR, 1, 0, 1, cond)
+#define ARM_STR_IMM_WB(p, rd, rn, imm) ARM_STR_IMM_WB_COND(p, rd, rn, imm, ARMCOND_AL)
-#define ARM_DEF_WXFER_REG_REG(rm, shift_type, shift, rd, rn, ls, wb, b, p, cond) \
+#define ARM_DEF_WXFER_REG_REG_UPDOWN_COND(rm, shift_type, shift, rd, rn, ls, wb, b, u, p, cond) \
(rm) | \
((shift_type) << 5) | \
((shift) << 7) | \
@@ -498,21 +660,49 @@ typedef union {
((ls) << 20) | \
((wb) << 21) | \
((b) << 22) | \
- ((p) << 24) | \
- (1 << 25) | \
+ ((u) << 23) | \
+ ((p) << 24) | \
+ (1 << 25) | \
ARM_WXFER_TAG | \
ARM_DEF_COND(cond)
+#define ARM_DEF_WXFER_REG_REG_COND(rm, shift_type, shift, rd, rn, ls, wb, b, p, cond) \
+ ARM_DEF_WXFER_REG_REG_UPDOWN_COND(rm, shift_type, shift, rd, rn, ls, wb, b, ARM_UP, p, cond)
+#define ARM_DEF_WXFER_REG_MINUS_REG_COND(rm, shift_type, shift, rd, rn, ls, wb, b, p, cond) \
+ ARM_DEF_WXFER_REG_REG_UPDOWN_COND(rm, shift_type, shift, rd, rn, ls, wb, b, ARM_DOWN, p, cond)
+
#define ARM_LDR_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, cond) \
- ARM_EMIT(p, ARM_DEF_WXFER_REG_REG(rm, shift_type, shift, rd, rn, ARMOP_LDR, 0, 0, 1, cond))
+ ARM_EMIT(p, ARM_DEF_WXFER_REG_REG_COND(rm, shift_type, shift, rd, rn, ARMOP_LDR, 0, 0, 1, cond))
#define ARM_LDR_REG_REG_SHIFT(p, rd, rn, rm, shift_type, shift) \
ARM_LDR_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, ARMCOND_AL)
#define ARM_LDR_REG_REG(p, rd, rn, rm) \
ARM_LDR_REG_REG_SHIFT(p, rd, rn, rm, ARMSHIFT_LSL, 0)
-
-
+#define ARM_LDRB_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, cond) \
+ ARM_EMIT(p, ARM_DEF_WXFER_REG_REG_COND(rm, shift_type, shift, rd, rn, ARMOP_LDR, 0, 1, 1, cond))
+#define ARM_LDRB_REG_REG_SHIFT(p, rd, rn, rm, shift_type, shift) \
+ ARM_LDRB_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, ARMCOND_AL)
+#define ARM_LDRB_REG_REG(p, rd, rn, rm) \
+ ARM_LDRB_REG_REG_SHIFT(p, rd, rn, rm, ARMSHIFT_LSL, 0)
+
+#define ARM_STR_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, cond) \
+ ARM_EMIT(p, ARM_DEF_WXFER_REG_REG_COND(rm, shift_type, shift, rd, rn, ARMOP_STR, 0, 0, 1, cond))
+#define ARM_STR_REG_REG_SHIFT(p, rd, rn, rm, shift_type, shift) \
+ ARM_STR_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, ARMCOND_AL)
+#define ARM_STR_REG_REG(p, rd, rn, rm) \
+ ARM_STR_REG_REG_SHIFT(p, rd, rn, rm, ARMSHIFT_LSL, 0)
+
+/* zero-extend */
+#define ARM_STRB_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, cond) \
+ ARM_EMIT(p, ARM_DEF_WXFER_REG_REG_COND(rm, shift_type, shift, rd, rn, ARMOP_STR, 0, 1, 1, cond))
+#define ARM_STRB_REG_REG_SHIFT(p, rd, rn, rm, shift_type, shift) \
+ ARM_STRB_REG_REG_SHIFT_COND(p, rd, rn, rm, shift_type, shift, ARMCOND_AL)
+#define ARM_STRB_REG_REG(p, rd, rn, rm) \
+ ARM_STRB_REG_REG_SHIFT(p, rd, rn, rm, ARMSHIFT_LSL, 0)
+
+
+/* ARMv4+ */
/* Half-word or byte (signed) transfer. */
typedef struct {
arminstr_t rm : 4; /* imm_lo */
@@ -573,6 +763,43 @@ typedef struct {
ARM_STRH_IMM_COND(p, rd, rn, imm, ARMCOND_AL)
+#define ARM_DEF_HXFER_REG_REG_UPDOWN_COND(rm, h, s, rd, rn, ls, wb, u, p, cond) \
+ ((rm) & 0xF) | \
+ ((h) << 5) | \
+ ((s) << 6) | \
+ ((rd) << 12) | \
+ ((rn) << 16) | \
+ ((ls) << 20) | \
+ ((wb) << 21) | \
+ (0 << 22) | \
+ ((u) << 23) | \
+ ((p) << 24) | \
+ ARM_HXFER_TAG | \
+ ARM_DEF_COND(cond)
+
+#define ARM_DEF_HXFER_REG_REG_COND(rm, h, s, rd, rn, ls, wb, p, cond) \
+ ARM_DEF_HXFER_REG_REG_UPDOWN_COND(rm, h, s, rd, rn, ls, wb, ARM_UP, p, cond)
+#define ARM_DEF_HXFER_REG_MINUS_REG_COND(rm, h, s, rd, rn, ls, wb, p, cond) \
+ ARM_DEF_HXFER_REG_REG_UPDOWN_COND(rm, h, s, rd, rn, ls, wb, ARM_DOWN, p, cond)
+
+#define ARM_LDRH_REG_REG_COND(p, rm, rd, rn, cond) \
+ ARM_EMIT(p, ARM_DEF_HXFER_REG_REG_COND(rm, 1, 0, rd, rn, ARMOP_LDR, 0, 1, cond))
+#define ARM_LDRH_REG_REG(p, rm, rd, rn) \
+ ARM_LDRH_REG_REG_COND(p, rm, rd, rn, ARMCOND_AL)
+#define ARM_LDRSH_REG_REG_COND(p, rm, rd, rn, cond) \
+ ARM_EMIT(p, ARM_DEF_HXFER_REG_REG_COND(rm, 1, 1, rd, rn, ARMOP_LDR, 0, 1, cond))
+#define ARM_LDRSH_REG_REG(p, rm, rd, rn) \
+ ARM_LDRSH_REG_REG_COND(p, rm, rd, rn, ARMCOND_AL)
+#define ARM_LDRSB_REG_REG_COND(p, rm, rd, rn, cond) \
+ ARM_EMIT(p, ARM_DEF_HXFER_REG_REG_COND(rm, 0, 1, rd, rn, ARMOP_LDR, 0, 1, cond))
+#define ARM_LDRSB_REG_REG(p, rm, rd, rn) ARM_LDRSB_REG_REG_COND(p, rm, rd, rn, ARMCOND_AL)
+
+#define ARM_STRH_REG_REG_COND(p, rm, rd, rn, cond) \
+ ARM_EMIT(p, ARM_DEF_HXFER_REG_REG_COND(rm, 1, 0, rd, rn, ARMOP_STR, 0, 1, cond))
+#define ARM_STRH_REG_REG(p, rm, rd, rn) \
+ ARM_STRH_REG_REG_COND(p, rm, rd, rn, ARMCOND_AL)
+
+
/* Swap */
typedef struct {
@@ -713,6 +940,114 @@ typedef struct {
+
+#include "arm_dpimacros.h"
+
+#define ARM_NOP(p) ARM_MOV_REG_REG(p, ARMREG_R0, ARMREG_R0)
+
+
+#define ARM_SHL_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOV_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_LSL, imm, cond)
+#define ARM_SHL_IMM(p, rd, rm, imm) \
+ ARM_SHL_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+#define ARM_SHLS_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOVS_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_LSL, imm, cond)
+#define ARM_SHLS_IMM(p, rd, rm, imm) \
+ ARM_SHLS_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+
+#define ARM_SHR_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOV_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_LSR, imm, cond)
+#define ARM_SHR_IMM(p, rd, rm, imm) \
+ ARM_SHR_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+#define ARM_SHRS_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOVS_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_LSR, imm, cond)
+#define ARM_SHRS_IMM(p, rd, rm, imm) \
+ ARM_SHRS_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+
+#define ARM_SAR_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOV_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_ASR, imm, cond)
+#define ARM_SAR_IMM(p, rd, rm, imm) \
+ ARM_SAR_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+#define ARM_SARS_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOVS_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_ASR, imm, cond)
+#define ARM_SARS_IMM(p, rd, rm, imm) \
+ ARM_SARS_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+
+#define ARM_ROR_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOV_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_ROR, imm, cond)
+#define ARM_ROR_IMM(p, rd, rm, imm) \
+ ARM_ROR_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+#define ARM_RORS_IMM_COND(p, rd, rm, imm, cond) \
+ ARM_MOVS_REG_IMMSHIFT_COND(p, rd, rm, ARMSHIFT_ROR, imm, cond)
+#define ARM_RORS_IMM(p, rd, rm, imm) \
+ ARM_RORS_IMM_COND(p, rd, rm, imm, ARMCOND_AL)
+
+#define ARM_SHL_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOV_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_LSL, rs, cond)
+#define ARM_SHL_REG(p, rd, rm, rs) \
+ ARM_SHL_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_SHLS_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOVS_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_LSL, rs, cond)
+#define ARM_SHLS_REG(p, rd, rm, rs) \
+ ARM_SHLS_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_SHLS_REG_REG(p, rd, rm, rs) ARM_SHLS_REG(p, rd, rm, rs)
+
+#define ARM_SHR_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOV_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_LSR, rs, cond)
+#define ARM_SHR_REG(p, rd, rm, rs) \
+ ARM_SHR_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_SHRS_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOVS_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_LSR, rs, cond)
+#define ARM_SHRS_REG(p, rd, rm, rs) \
+ ARM_SHRS_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_SHRS_REG_REG(p, rd, rm, rs) ARM_SHRS_REG(p, rd, rm, rs)
+
+#define ARM_SAR_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOV_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_ASR, rs, cond)
+#define ARM_SAR_REG(p, rd, rm, rs) \
+ ARM_SAR_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_SARS_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOVS_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_ASR, rs, cond)
+#define ARM_SARS_REG(p, rd, rm, rs) \
+ ARM_SARS_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_SARS_REG_REG(p, rd, rm, rs) ARM_SARS_REG(p, rd, rm, rs)
+
+#define ARM_ROR_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOV_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_ROR, rs, cond)
+#define ARM_ROR_REG(p, rd, rm, rs) \
+ ARM_ROR_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_RORS_REG_COND(p, rd, rm, rs, cond) \
+ ARM_MOVS_REG_REGSHIFT_COND(p, rd, rm, ARMSHIFT_ROR, rs, cond)
+#define ARM_RORS_REG(p, rd, rm, rs) \
+ ARM_RORS_REG_COND(p, rd, rm, rs, ARMCOND_AL)
+#define ARM_RORS_REG_REG(p, rd, rm, rs) ARM_RORS_REG(p, rd, rm, rs)
+
+#define ARM_DBRK(p) ARM_EMIT(p, 0xE6000010)
+#define ARM_IASM_DBRK() ARM_IASM_EMIT(0xE6000010)
+
+#define ARM_INC(p, reg) ARM_ADD_REG_IMM8(p, reg, reg, 1)
+#define ARM_DEC(p, reg) ARM_SUB_REG_IMM8(p, reg, reg, 1)
+
+
+/* ARM V5 */
+
+/* Count leading zeros, CLZ{cond} Rd, Rm */
+typedef struct {
+ arminstr_t rm : 4;
+ arminstr_t tag2 : 8;
+ arminstr_t rd : 4;
+ arminstr_t tag : 12;
+ arminstr_t cond : 4;
+} ARMInstrCLZ;
+
+#define ARM_CLZ_ID 0x16F
+#define ARM_CLZ_ID2 0xF1
+#define ARM_CLZ_MASK ((0xFFF << 16) | (0xFF < 4))
+#define ARM_CLZ_TAG ((ARM_CLZ_ID << 16) | (ARM_CLZ_ID2 << 4))
+
+
+
+
typedef union {
ARMInstrBR br;
ARMInstrDPI dpi;
@@ -727,22 +1062,16 @@ typedef union {
ARMInstrSWI swi;
ARMInstrMSR msr;
ARMInstrMRS mrs;
+ ARMInstrCLZ clz;
ARMInstrGeneric generic;
arminstr_t raw;
} ARMInstr;
-#include "arm_dpimacros.h"
-
-#define ARM_NOP(p) ARM_MOV_REG_REG(p, ARMREG_R0, ARMREG_R0)
-
-
#ifdef __cplusplus
}
#endif
#endif /* ARM_H */
-
-
diff --git a/mono/arch/arm/arm-dis.c b/mono/arch/arm/arm-dis.c
index caec7e5f767..0a478bc9f6b 100644
--- a/mono/arch/arm/arm-dis.c
+++ b/mono/arch/arm/arm-dis.c
@@ -26,7 +26,7 @@ const static char* ops[] = {
const static char* shift_types[] = {"lsl", "lsr", "asr", "ror"};
const static char* mul_ops[] = {
- "mul", "mla", "?", "?", "umul", "umlal", "smull", "smlal"
+ "mul", "mla", "?", "?", "umull", "umlal", "smull", "smlal"
};
const static char* reg_alias[] = {
@@ -58,6 +58,7 @@ void dump_mul(ARMDis* dis, ARMInstr i);
void dump_swi(ARMDis* dis, ARMInstr i);
void dump_swp(ARMDis* dis, ARMInstr i);
void dump_wxfer(ARMDis* dis, ARMInstr i);
+void dump_clz(ARMDis* dis, ARMInstr i);
/*
@@ -92,9 +93,9 @@ FILE* armdis_get_output(ARMDis* dis) {
void dump_reg(ARMDis* dis, int reg) {
reg &= 0xF;
if (!use_reg_alias || (reg > 3 && reg < 11)) {
- fprintf(dis->dis_out, "r%d", reg);
+ fprintf(dis->dis_out, "r%d", reg);
} else {
- fprintf(dis->dis_out, reg_alias[reg]);
+ fprintf(dis->dis_out, reg_alias[reg]);
}
}
@@ -136,28 +137,29 @@ void dump_reglist(ARMDis* dis, int reg_list) {
void dump_br(ARMDis* dis, ARMInstr i) {
- fprintf(dis->dis_out, "b%s%s\t%x",
+ fprintf(dis->dis_out, "b%s%s\t%x\t; %p -> %p",
(i.br.link == 1) ? "l" : "",
- cond[i.br.cond], i.br.offset);
+ cond[i.br.cond], i.br.offset, dis->pi, (int)dis->pi + 4*2 + ((int)(i.br.offset << 8) >> 6));
}
void dump_dpi(ARMDis* dis, ARMInstr i) {
fprintf(dis->dis_out, "%s%s", ops[i.dpi.all.opcode], cond[i.dpi.all.cond]);
- if ((i.dpi.all.opcode >= ARMOP_TST) && (i.dpi.all.opcode <= ARMOP_CMN) && (i.dpi.all.s != 0)) {
+ if ((i.dpi.all.opcode < ARMOP_TST || i.dpi.all.opcode > ARMOP_CMN) && (i.dpi.all.s != 0)) {
fprintf(dis->dis_out, "s");
}
fprintf(dis->dis_out, "\t");
if ((i.dpi.all.opcode < ARMOP_TST) || (i.dpi.all.opcode > ARMOP_CMN)) {
- /* comparison operation */
+ /* for comparison operations Rd is ignored */
dump_reg(dis, i.dpi.all.rd);
fprintf(dis->dis_out, ", ");
}
if ((i.dpi.all.opcode != ARMOP_MOV) && (i.dpi.all.opcode != ARMOP_MVN)) {
+ /* for MOV/MVN Rn is ignored */
dump_reg(dis, i.dpi.all.rn);
fprintf(dis->dis_out, ", ");
}
@@ -189,10 +191,11 @@ void dump_dpi(ARMDis* dis, ARMInstr i) {
}
void dump_wxfer(ARMDis* dis, ARMInstr i) {
- fprintf(dis->dis_out, "%s%s%s\t",
+ fprintf(dis->dis_out, "%s%s%s%s\t",
(i.wxfer.all.ls == 0) ? "str" : "ldr",
cond[i.generic.cond],
- (i.wxfer.all.b == 0) ? "" : "b");
+ (i.wxfer.all.b == 0) ? "" : "b",
+ (i.wxfer.all.ls != 0 && i.wxfer.all.wb != 0) ? "t" : "");
dump_reg(dis, i.wxfer.all.rd);
fprintf(dis->dis_out, ", [");
dump_reg(dis, i.wxfer.all.rn);
@@ -277,7 +280,7 @@ void dump_mul(ARMDis* dis, ARMInstr i) {
fprintf(dis->dis_out, ", ");
dump_reg(dis, i.mul.rn);
break;
- case ARMOP_UMUL:
+ case ARMOP_UMULL:
case ARMOP_UMLAL:
case ARMOP_SMULL:
case ARMOP_SMLAL:
@@ -372,6 +375,15 @@ void dump_swi(ARMDis* dis, ARMInstr i) {
}
+void dump_clz(ARMDis* dis, ARMInstr i) {
+ fprintf(dis->dis_out, "clz%s\t");
+ dump_reg(dis, i.clz.rd);
+ fprintf(dis->dis_out, ", ");
+ dump_reg(dis, i.clz.rm);
+ fprintf(dis->dis_out, "\n");
+}
+
+
void armdis_decode(ARMDis* dis, void* p, int size) {
int i;
@@ -386,6 +398,7 @@ void armdis_decode(ARMDis* dis, void* p, int size) {
for (i=0; i<size; ++i) {
fprintf(dis->dis_out, "%p:\t%08x\t", pi, *pi);
+ dis->pi = pi;
instr.raw = *pi++;
if ((instr.raw & ARM_BR_MASK) == ARM_BR_TAG) {
@@ -394,6 +407,8 @@ void armdis_decode(ARMDis* dis, void* p, int size) {
dump_swp(dis, instr);
} else if ((instr.raw & ARM_MUL_MASK) == ARM_MUL_TAG) {
dump_mul(dis, instr);
+ } else if ((instr.raw & ARM_CLZ_MASK) == ARM_CLZ_TAG) {
+ dump_clz(dis, instr);
} else if ((instr.raw & ARM_WXFER_MASK) == ARM_WXFER_TAG) {
dump_wxfer(dis, instr);
} else if ((instr.raw & ARM_HXFER_MASK) == ARM_HXFER_TAG) {
diff --git a/mono/arch/arm/arm-dis.h b/mono/arch/arm/arm-dis.h
index b93db303ffa..8019499ce97 100644
--- a/mono/arch/arm/arm-dis.h
+++ b/mono/arch/arm/arm-dis.h
@@ -14,6 +14,7 @@ extern "C" {
typedef struct _ARMDis {
FILE* dis_out;
+ void* pi;
} ARMDis;
diff --git a/mono/arch/arm/arm-wmmx.h b/mono/arch/arm/arm-wmmx.h
new file mode 100755
index 00000000000..427c4fc9f60
--- /dev/null
+++ b/mono/arch/arm/arm-wmmx.h
@@ -0,0 +1,177 @@
+/*
+ * ARM CodeGen
+ * XScale WirelessMMX extensions
+ * Copyright 2002 Wild West Software
+ */
+
+#ifndef __WMMX_H__
+#define __WMMX_H__ 1
+
+#if 0
+#include <arm-codegen.h>
+#endif
+
+#if defined(ARM_IASM)
+# define WM_ASM(_expr) ARM_IASM(_expr)
+#else
+# define WM_ASM(_expr) __emit (_expr)
+#endif
+
+#if defined(ARM_EMIT)
+# define WM_EMIT(p, i) ARM_EMIT(p, i)
+#else
+# define WM_EMIT(p, i)
+#endif
+
+enum {
+ WM_CC_EQ = 0x0,
+ WM_CC_NE = 0x1,
+ WM_CC_CS = 0x2,
+ WM_CC_HS = WM_CC_CS,
+ WM_CC_CC = 0x3,
+ WM_CC_LO = WM_CC_CC,
+ WM_CC_MI = 0x4,
+ WM_CC_PL = 0x5,
+ WM_CC_VS = 0x6,
+ WM_CC_VC = 0x7,
+ WM_CC_HI = 0x8,
+ WM_CC_LS = 0x9,
+ WM_CC_GE = 0xA,
+ WM_CC_LT = 0xB,
+ WM_CC_GT = 0xC,
+ WM_CC_LE = 0xD,
+ WM_CC_AL = 0xE,
+ WM_CC_NV = 0xF,
+ WM_CC_SHIFT = 28
+};
+
+#if defined(ARM_DEF_COND)
+# define WM_DEF_CC(_cc) ARM_DEF_COND(_cc)
+#else
+# define WM_DEF_CC(_cc) ((_cc & 0xF) << WM_CC_SHIFT)
+#endif
+
+
+enum {
+ WM_R0 = 0x0,
+ WM_R1 = 0x1,
+ WM_R2 = 0x2,
+ WM_R3 = 0x3,
+ WM_R4 = 0x4,
+ WM_R5 = 0x5,
+ WM_R6 = 0x6,
+ WM_R7 = 0x7,
+ WM_R8 = 0x8,
+ WM_R9 = 0x9,
+ WM_R10 = 0xA,
+ WM_R11 = 0xB,
+ WM_R12 = 0xC,
+ WM_R13 = 0xD,
+ WM_R14 = 0xE,
+ WM_R15 = 0xF,
+
+ WM_wR0 = 0x0,
+ WM_wR1 = 0x1,
+ WM_wR2 = 0x2,
+ WM_wR3 = 0x3,
+ WM_wR4 = 0x4,
+ WM_wR5 = 0x5,
+ WM_wR6 = 0x6,
+ WM_wR7 = 0x7,
+ WM_wR8 = 0x8,
+ WM_wR9 = 0x9,
+ WM_wR10 = 0xA,
+ WM_wR11 = 0xB,
+ WM_wR12 = 0xC,
+ WM_wR13 = 0xD,
+ WM_wR14 = 0xE,
+ WM_wR15 = 0xF
+};
+
+
+/*
+ * Qualifiers:
+ * H - 16-bit (HalfWord) SIMD
+ * W - 32-bit (Word) SIMD
+ * D - 64-bit (Double)
+ */
+enum {
+ WM_B = 0,
+ WM_H = 1,
+ WM_D = 2
+};
+
+/*
+ * B.2.3 Transfers From Coprocessor Register (MRC)
+ * Table B-5
+ */
+enum {
+ WM_TMRC_OP2 = 0,
+ WM_TMRC_CPNUM = 1,
+
+ WM_TMOVMSK_OP2 = 1,
+ WM_TMOVMSK_CPNUM = 0,
+
+ WM_TANDC_OP2 = 1,
+ WM_TANDC_CPNUM = 1,
+
+ WM_TORC_OP2 = 2,
+ WM_TORC_CPNUM = 1,
+
+ WM_TEXTRC_OP2 = 3,
+ WM_TEXTRC_CPNUM = 1,
+
+ WM_TEXTRM_OP2 = 3,
+ WM_TEXTRM_CPNUM = 0
+};
+
+
+/*
+ * TANDC<B,H,W>{Cond} R15
+ * Performs AND across the fields of the SIMD PSR register (wCASF) and sends the result
+ * to CPSR; can be performed after a Byte, Half-word or Word operation that sets the flags.
+ * NOTE: R15 is omitted from the macro declaration;
+ */
+#define DEF_WM_TNADC_CC(_q, _cc) WM_DEF_CC((_cc)) + ((_q) << 0x16) + 0xE13F130
+
+#define _WM_TNADC_CC(_q, _cc) WM_ASM(DEF_WM_TNADC_CC(_q, _cc))
+#define ARM_WM_TNADC_CC(_p, _q, _cc) WM_EMIT(_p, DEF_WM_TNADC_CC(_q, _cc))
+
+/* inline assembly */
+#define _WM_TNADC(_q) _WM_TNADC_CC((_q), WM_CC_AL)
+#define _WM_TNADCB() _WM_TNADC(WM_B)
+#define _WM_TNADCH() _WM_TNADC(WM_H)
+#define _WM_TNADCD() _WM_TNADC(WM_D)
+
+/* codegen */
+#define ARM_WM_TNADC(_p, _q) ARM_WM_TNADC_CC((_p), (_q), WM_CC_AL)
+#define ARM_WM_TNADCB(_p) ARM_WM_TNADC(_p, WM_B)
+#define ARM_WM_TNADCH(_p) ARM_WM_TNADC(_p, WM_H)
+#define ARM_WM_TNADCD(_p) ARM_WM_TNADC(_p, WM_D)
+
+
+/*
+ * TBCST<B,H,W>{Cond} wRd, Rn
+ * Broadcasts a value from the ARM Source reg (Rn) to every SIMD position
+ * in the WMMX Destination reg (wRd).
+ */
+#define DEF_WM_TBCST_CC(_q, _cc, _wrd, _rn) \
+ WM_DEF_CC((_cc)) + ((_q) << 6) + ((_wrd) << 16) + ((_rn) << 12) + 0xE200010
+
+#define _WM_TBCST_CC(_q, _cc, _wrd, _rn) WM_ASM(DEF_WM_TBCST_CC(_q, _cc, _wrd, _rn))
+#define ARM_WM_TBCST_CC(_p, _q, _cc, _wrd, _rn) WM_EMIT(_p, DEF_WM_TBCST_CC(_q, _cc, _wrd, _rn))
+
+/* inline */
+#define _WM_TBCST(_q, _wrd, _rn) _WM_TBCST_CC(_q, WM_CC_AL, _wrd, _rn)
+#define _WM_TBCSTB(_wrd, _rn) _WM_TBCST(WM_B)
+#define _WM_TBCSTH(_wrd, _rn) _WM_TBCST(WM_H)
+#define _WM_TBCSTD(_wrd, _rn) _WM_TBCST(WM_D)
+
+/* codegen */
+#define ARM_WM_TBCST(_p, _q, _wrd, _rn) ARM_WM_TBCST_CC(_p, _q, WM_CC_AL, _wrd, _rn)
+#define ARM_WM_TBCSTB(_p, _wrd, _rn) _WM_TBCST(_p, WM_B)
+#define ARM_WM_TBCSTH(_p, _wrd, _rn) _WM_TBCST(_p, WM_H)
+#define ARM_WM_TBCSTD(_p, _wrd, _rn) _WM_TBCST(_p, WM_D)
+
+
+#endif /* __WMMX_H__ */
diff --git a/mono/arch/arm/cmp_macros.th b/mono/arch/arm/cmp_macros.th
index 8a357087a32..cb2639dec1f 100644
--- a/mono/arch/arm/cmp_macros.th
+++ b/mono/arch/arm/cmp_macros.th
@@ -1,11 +1,56 @@
-/* PSR = <Op> rd, (imm8 ROR 2*rot) */
-#define ARM_<Op>_REG_IMM_COND(p, rd, imm8, rot, cond) \
- ARM_DPIOP_REG_IMM8ROT_COND(p, ARMOP_<Op>, rd, 0, imm8, rot, cond)
-#define ARM_<Op>_REG_IMM(p, rd, imm8, rot) \
- ARM_<Op>_REG_IMM_COND(p, rd, imm8, rot, ARMCOND_AL)
-/* PSR = <Op> rd, imm8 */
-#define ARM_<Op>_REG_IMM8_COND(p, rd, imm8, cond) \
- ARM_<Op>_REG_IMM_COND(p, rd, imm8, 0, cond)
-#define ARM_<Op>_REG_IMM8(p, rd, imm8) \
- ARM_<Op>_REG_IMM8_COND(p, rd, imm8, ARMCOND_AL)
+/* PSR := <Op> Rn, (imm8 ROR 2*rot) */
+#define ARM_<Op>_REG_IMM_COND(p, rn, imm8, rot, cond) \
+ ARM_DPIOP_S_REG_IMM8ROT_COND(p, ARMOP_<Op>, 0, rn, imm8, rot, cond)
+#define ARM_<Op>_REG_IMM(p, rn, imm8, rot) \
+ ARM_<Op>_REG_IMM_COND(p, rn, imm8, rot, ARMCOND_AL)
+
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMM_COND(rn, imm8, rot, cond) \
+ ARM_IASM_DPIOP_S_REG_IMM8ROT_COND(ARMOP_<Op>, 0, rn, imm8, rot, cond)
+#define _<Op>_REG_IMM(rn, imm8, rot) \
+ _<Op>_REG_IMM_COND(rn, imm8, rot, ARMCOND_AL)
+#endif
+
+
+/* PSR := <Op> Rn, imm8 */
+#define ARM_<Op>_REG_IMM8_COND(p, rn, imm8, cond) \
+ ARM_<Op>_REG_IMM_COND(p, rn, imm8, 0, cond)
+#define ARM_<Op>_REG_IMM8(p, rn, imm8) \
+ ARM_<Op>_REG_IMM8_COND(p, rn, imm8, ARMCOND_AL)
+
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMM8_COND(rn, imm8, cond) \
+ _<Op>_REG_IMM_COND(rn, imm8, 0, cond)
+#define _<Op>_REG_IMM8(rn, imm8) \
+ _<Op>_REG_IMM8_COND(rn, imm8, ARMCOND_AL)
+#endif
+
+
+/* PSR := <Op> Rn, Rm */
+#define ARM_<Op>_REG_REG_COND(p, rn, rm, cond) \
+ ARM_DPIOP_S_REG_REG_COND(p, ARMOP_<Op>, 0, rn, rm, cond)
+#define ARM_<Op>_REG_REG(p, rn, rm) \
+ ARM_<Op>_REG_REG_COND(p, rn, rm, ARMCOND_AL)
+
+#ifndef ARM_NOIASM
+#define _<Op>_REG_REG_COND(rn, rm, cond) \
+ ARM_IASM_DPIOP_S_REG_REG_COND(ARMOP_<Op>, 0, rn, rm, cond)
+#define _<Op>_REG_REG(rn, rm) \
+ _<Op>_REG_REG_COND(rn, rm, ARMCOND_AL)
+#endif
+
+
+/* PSR := <Op> Rn, (Rm <shift_type> imm8) */
+#define ARM_<Op>_REG_IMMSHIFT_COND(p, rn, rm, shift_type, imm_shift, cond) \
+ ARM_DPIOP_S_REG_IMMSHIFT_COND(p, ARMOP_<Op>, 0, rn, rm, shift_type, imm_shift, cond)
+#define ARM_<Op>_REG_IMMSHIFT(p, rn, rm, shift_type, imm_shift) \
+ ARM_<Op>_REG_IMMSHIFT_COND(p, rn, rm, shift_type, imm_shift, ARMCOND_AL)
+
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMMSHIFT_COND(rn, rm, shift_type, imm_shift, cond) \
+ ARM_IASM_DPIOP_S_REG_IMMSHIFT_COND(ARMOP_<Op>, 0, rn, rm, shift_type, imm_shift, cond)
+#define _<Op>_REG_IMMSHIFT(rn, rm, shift_type, imm_shift) \
+ _<Op>_REG_IMMSHIFT_COND(rn, rm, shift_type, imm_shift, ARMCOND_AL)
+#endif
+
diff --git a/mono/arch/arm/dpi_macros.th b/mono/arch/arm/dpi_macros.th
index f8ec6086e92..be43d1fe729 100644
--- a/mono/arch/arm/dpi_macros.th
+++ b/mono/arch/arm/dpi_macros.th
@@ -1,6 +1,6 @@
/* -- <Op> -- */
-/* rd = rn <Op> (imm8 ROR rot) ; rot is power of 2 */
+/* Rd := Rn <Op> (imm8 ROR rot) ; rot is power of 2 */
#define ARM_<Op>_REG_IMM_COND(p, rd, rn, imm8, rot, cond) \
ARM_DPIOP_REG_IMM8ROT_COND(p, ARMOP_<Op>, rd, rn, imm8, rot, cond)
#define ARM_<Op>_REG_IMM(p, rd, rn, imm8, rot) \
@@ -10,7 +10,19 @@
#define ARM_<Op>S_REG_IMM(p, rd, rn, imm8, rot) \
ARM_<Op>S_REG_IMM_COND(p, rd, rn, imm8, rot, ARMCOND_AL)
-/* rd = rn <Op> imm8 */
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMM_COND(rd, rn, imm8, rot, cond) \
+ ARM_IASM_DPIOP_REG_IMM8ROT_COND(ARMOP_<Op>, rd, rn, imm8, rot, cond)
+#define _<Op>_REG_IMM(rd, rn, imm8, rot) \
+ _<Op>_REG_IMM_COND(rd, rn, imm8, rot, ARMCOND_AL)
+#define _<Op>S_REG_IMM_COND(rd, rn, imm8, rot, cond) \
+ ARM_IASM_DPIOP_S_REG_IMM8ROT_COND(ARMOP_<Op>, rd, rn, imm8, rot, cond)
+#define _<Op>S_REG_IMM(rd, rn, imm8, rot) \
+ _<Op>S_REG_IMM_COND(rd, rn, imm8, rot, ARMCOND_AL)
+#endif
+
+
+/* Rd := Rn <Op> imm8 */
#define ARM_<Op>_REG_IMM8_COND(p, rd, rn, imm8, cond) \
ARM_<Op>_REG_IMM_COND(p, rd, rn, imm8, 0, cond)
#define ARM_<Op>_REG_IMM8(p, rd, rn, imm8) \
@@ -20,8 +32,19 @@
#define ARM_<Op>S_REG_IMM8(p, rd, rn, imm8) \
ARM_<Op>S_REG_IMM8_COND(p, rd, rn, imm8, ARMCOND_AL)
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMM8_COND(rd, rn, imm8, cond) \
+ _<Op>_REG_IMM_COND(rd, rn, imm8, 0, cond)
+#define _<Op>_REG_IMM8(rd, rn, imm8) \
+ _<Op>_REG_IMM8_COND(rd, rn, imm8, ARMCOND_AL)
+#define _<Op>S_REG_IMM8_COND(rd, rn, imm8, cond) \
+ _<Op>S_REG_IMM_COND(rd, rn, imm8, 0, cond)
+#define _<Op>S_REG_IMM8(rd, rn, imm8) \
+ _<Op>S_REG_IMM8_COND(rd, rn, imm8, ARMCOND_AL)
+#endif
+
-/* rd = rn <Op> rm */
+/* Rd := Rn <Op> Rm */
#define ARM_<Op>_REG_REG_COND(p, rd, rn, rm, cond) \
ARM_DPIOP_REG_REG_COND(p, ARMOP_<Op>, rd, rn, rm, cond)
#define ARM_<Op>_REG_REG(p, rd, rn, rm) \
@@ -31,7 +54,19 @@
#define ARM_<Op>S_REG_REG(p, rd, rn, rm) \
ARM_<Op>S_REG_REG_COND(p, rd, rn, rm, ARMCOND_AL)
-/* rd = rn <Op> (rm <shift_type> imm_shift) */
+#ifndef ARM_NOIASM
+#define _<Op>_REG_REG_COND(rd, rn, rm, cond) \
+ ARM_IASM_DPIOP_REG_REG_COND(ARMOP_<Op>, rd, rn, rm, cond)
+#define _<Op>_REG_REG(rd, rn, rm) \
+ _<Op>_REG_REG_COND(rd, rn, rm, ARMCOND_AL)
+#define _<Op>S_REG_REG_COND(rd, rn, rm, cond) \
+ ARM_IASM_DPIOP_S_REG_REG_COND(ARMOP_<Op>, rd, rn, rm, cond)
+#define _<Op>S_REG_REG(rd, rn, rm) \
+ _<Op>S_REG_REG_COND(rd, rn, rm, ARMCOND_AL)
+#endif
+
+
+/* Rd := Rn <Op> (Rm <shift_type> imm_shift) */
#define ARM_<Op>_REG_IMMSHIFT_COND(p, rd, rn, rm, shift_type, imm_shift, cond) \
ARM_DPIOP_REG_IMMSHIFT_COND(p, ARMOP_<Op>, rd, rn, rm, shift_type, imm_shift, cond)
#define ARM_<Op>_REG_IMMSHIFT(p, rd, rn, rm, shift_type, imm_shift) \
@@ -41,4 +76,37 @@
#define ARM_<Op>S_REG_IMMSHIFT(p, rd, rn, rm, shift_type, imm_shift) \
ARM_<Op>S_REG_IMMSHIFT_COND(p, rd, rn, rm, shift_type, imm_shift, ARMCOND_AL)
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMMSHIFT_COND(rd, rn, rm, shift_type, imm_shift, cond) \
+ ARM_IASM_DPIOP_REG_IMMSHIFT_COND(ARMOP_<Op>, rd, rn, rm, shift_type, imm_shift, cond)
+#define _<Op>_REG_IMMSHIFT(rd, rn, rm, shift_type, imm_shift) \
+ _<Op>_REG_IMMSHIFT_COND(rd, rn, rm, shift_type, imm_shift, ARMCOND_AL)
+#define _<Op>S_REG_IMMSHIFT_COND(rd, rn, rm, shift_type, imm_shift, cond) \
+ ARM_IASM_DPIOP_S_REG_IMMSHIFT_COND(ARMOP_<Op>, rd, rn, rm, shift_type, imm_shift, cond)
+#define _<Op>S_REG_IMMSHIFT(rd, rn, rm, shift_type, imm_shift) \
+ _<Op>S_REG_IMMSHIFT_COND(rd, rn, rm, shift_type, imm_shift, ARMCOND_AL)
+#endif
+
+
+/* Rd := Rn <Op> (Rm <shift_type> Rs) */
+#define ARM_<Op>_REG_REGSHIFT_COND(p, rd, rn, rm, shift_type, rs, cond) \
+ ARM_DPIOP_REG_REGSHIFT_COND(p, ARMOP_<Op>, rd, rn, rm, shift_t, rs, cond)
+#define ARM_<Op>_REG_REGSHIFT(p, rd, rn, rm, shift_type, rs) \
+ ARM_<Op>_REG_REGSHIFT_COND(p, rd, rn, rm, shift_type, rs, ARMCOND_AL)
+#define ARM_<Op>S_REG_REGSHIFT_COND(p, rd, rn, rm, shift_type, rs, cond) \
+ ARM_DPIOP_S_REG_REGSHIFT_COND(p, ARMOP_<Op>, rd, rn, rm, shift_t, rs, cond)
+#define ARM_<Op>S_REG_REGSHIFT(p, rd, rn, rm, shift_type, rs) \
+ ARM_<Op>S_REG_REGSHIFT_COND(p, rd, rn, rm, shift_type, rs, ARMCOND_AL)
+
+#ifndef ARM_NOIASM
+#define _<Op>_REG_REGSHIFT_COND(rd, rn, rm, shift_type, rs, cond) \
+ ARM_IASM_DPIOP_REG_REGSHIFT_COND(ARMOP_<Op>, rd, rn, rm, shift_t, rs, cond)
+#define _<Op>_REG_REGSHIFT(rd, rn, rm, shift_type, rs) \
+ _<Op>_REG_REGSHIFT_COND(rd, rn, rm, shift_type, rs, ARMCOND_AL)
+#define _<Op>S_REG_REGSHIFT_COND(rd, rn, rm, shift_type, rs, cond) \
+ ARM_IASM_DPIOP_S_REG_REGSHIFT_COND(ARMOP_<Op>, rd, rn, rm, shift_t, rs, cond)
+#define _<Op>S_REG_REGSHIFT(rd, rn, rm, shift_type, rs) \
+ _<Op>S_REG_REGSHIFT_COND(rd, rn, rm, shift_type, rs, ARMCOND_AL)
+#endif
+
diff --git a/mono/arch/arm/dpiops.sh b/mono/arch/arm/dpiops.sh
index 2eb43d9a75a..ad394ae632b 100755
--- a/mono/arch/arm/dpiops.sh
+++ b/mono/arch/arm/dpiops.sh
@@ -28,5 +28,5 @@ echo -e "\n\n" >> $OUTFILE
echo -e "\n/* DPIs, comparison */\n" >> $OUTFILE
gen "$CMP_OPCODES" cmp_macros
-echo -e "/* end generated */\n\n" >> $OUTFILE
+echo -e "\n/* end generated */\n" >> $OUTFILE
diff --git a/mono/arch/arm/mov_macros.th b/mono/arch/arm/mov_macros.th
index 151a29ba717..6bac29003a9 100644
--- a/mono/arch/arm/mov_macros.th
+++ b/mono/arch/arm/mov_macros.th
@@ -1,18 +1,52 @@
-/* rd = imm8 ROR rot */
+/* Rd := imm8 ROR rot */
#define ARM_<Op>_REG_IMM_COND(p, reg, imm8, rot, cond) \
ARM_DPIOP_REG_IMM8ROT_COND(p, ARMOP_<Op>, reg, 0, imm8, rot, cond)
#define ARM_<Op>_REG_IMM(p, reg, imm8, rot) \
ARM_<Op>_REG_IMM_COND(p, reg, imm8, rot, ARMCOND_AL)
-#define ARM_<Op>_REG_IMM8(p, reg, imm8) \
- ARM_<Op>_REG_IMM(p, reg, imm8, 0)
/* S */
#define ARM_<Op>S_REG_IMM_COND(p, reg, imm8, rot, cond) \
ARM_DPIOP_S_REG_IMM8ROT_COND(p, ARMOP_<Op>, reg, 0, imm8, rot, cond)
#define ARM_<Op>S_REG_IMM(p, reg, imm8, rot) \
ARM_<Op>S_REG_IMM_COND(p, reg, imm8, rot, ARMCOND_AL)
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMM_COND(reg, imm8, rot, cond) \
+ ARM_IASM_DPIOP_REG_IMM8ROT_COND(ARMOP_<Op>, reg, 0, imm8, rot, cond)
+#define _<Op>_REG_IMM(reg, imm8, rot) \
+ _<Op>_REG_IMM_COND(reg, imm8, rot, ARMCOND_AL)
+/* S */
+#define _<Op>S_REG_IMM_COND(reg, imm8, rot, cond) \
+ ARM_IASM_DPIOP_S_REG_IMM8ROT_COND(ARMOP_<Op>, reg, 0, imm8, rot, cond)
+#define _<Op>S_REG_IMM(reg, imm8, rot) \
+ _<Op>S_REG_IMM_COND(reg, imm8, rot, ARMCOND_AL)
+#endif
+
+
+/* Rd := imm8 */
+#define ARM_<Op>_REG_IMM8_COND(p, reg, imm8, cond) \
+ ARM_DPIOP_REG_IMM8ROT_COND(p, ARMOP_<Op>, reg, 0, imm8, 0, cond)
+#define ARM_<Op>_REG_IMM8(p, reg, imm8) \
+ ARM_<Op>_REG_IMM8_COND(p, reg, imm8, ARMCOND_AL)
+/* S */
+#define ARM_<Op>S_REG_IMM8_COND(p, reg, imm8, cond) \
+ ARM_DPIOP_S_REG_IMM8ROT_COND(p, ARMOP_<Op>, reg, 0, imm8, 0, cond)
+#define ARM_<Op>S_REG_IMM8(p, reg, imm8) \
+ ARM_<Op>S_REG_IMM8_COND(p, reg, imm8, ARMCOND_AL)
+
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMM8_COND(reg, imm8, cond) \
+ ARM_IASM_DPIOP_REG_IMM8ROT_COND(ARMOP_<Op>, reg, 0, imm8, 0, cond)
+#define _<Op>_REG_IMM8(reg, imm8) \
+ _<Op>_REG_IMM8_COND(reg, imm8, ARMCOND_AL)
+/* S */
+#define _<Op>S_REG_IMM8_COND(reg, imm8, cond) \
+ ARM_IASM_DPIOP_S_REG_IMM8ROT_COND(ARMOP_<Op>, reg, 0, imm8, 0, cond)
+#define _<Op>S_REG_IMM8(reg, imm8) \
+ _<Op>S_REG_IMM8_COND(reg, imm8, ARMCOND_AL)
+#endif
+
-/* rd = rm */
+/* Rd := Rm */
#define ARM_<Op>_REG_REG_COND(p, rd, rm, cond) \
ARM_DPIOP_REG_REG_COND(p, ARMOP_<Op>, rd, 0, rm, cond)
#define ARM_<Op>_REG_REG(p, rd, rm) \
@@ -23,9 +57,20 @@
#define ARM_<Op>S_REG_REG(p, rd, rm) \
ARM_<Op>S_REG_REG_COND(p, rd, rm, ARMCOND_AL)
+#ifndef ARM_NOIASM
+#define _<Op>_REG_REG_COND(rd, rm, cond) \
+ ARM_IASM_DPIOP_REG_REG_COND(ARMOP_<Op>, rd, 0, rm, cond)
+#define _<Op>_REG_REG(rd, rm) \
+ _<Op>_REG_REG_COND(rd, rm, ARMCOND_AL)
+/* S */
+#define _<Op>S_REG_REG_COND(rd, rm, cond) \
+ ARM_IASM_DPIOP_S_REG_REG_COND(ARMOP_<Op>, rd, 0, rm, cond)
+#define _<Op>S_REG_REG(rd, rm) \
+ _<Op>S_REG_REG_COND(rd, rm, ARMCOND_AL)
+#endif
-/* rd = rm <shift_type> imm_shift */
+/* Rd := Rm <shift_type> imm_shift */
#define ARM_<Op>_REG_IMMSHIFT_COND(p, rd, rm, shift_type, imm_shift, cond) \
ARM_DPIOP_REG_IMMSHIFT_COND(p, ARMOP_<Op>, rd, 0, rm, shift_type, imm_shift, cond)
#define ARM_<Op>_REG_IMMSHIFT(p, rd, rm, shift_type, imm_shift) \
@@ -36,4 +81,41 @@
#define ARM_<Op>S_REG_IMMSHIFT(p, rd, rm, shift_type, imm_shift) \
ARM_<Op>S_REG_IMMSHIFT_COND(p, rd, rm, shift_type, imm_shift, ARMCOND_AL)
+#ifndef ARM_NOIASM
+#define _<Op>_REG_IMMSHIFT_COND(rd, rm, shift_type, imm_shift, cond) \
+ ARM_IASM_DPIOP_REG_IMMSHIFT_COND(ARMOP_<Op>, rd, 0, rm, shift_type, imm_shift, cond)
+#define _<Op>_REG_IMMSHIFT(rd, rm, shift_type, imm_shift) \
+ _<Op>_REG_IMMSHIFT_COND(rd, rm, shift_type, imm_shift, ARMCOND_AL)
+/* S */
+#define _<Op>S_REG_IMMSHIFT_COND(rd, rm, shift_type, imm_shift, cond) \
+ ARM_IASM_DPIOP_S_REG_IMMSHIFT_COND(ARMOP_<Op>, rd, 0, rm, shift_type, imm_shift, cond)
+#define _<Op>S_REG_IMMSHIFT(rd, rm, shift_type, imm_shift) \
+ _<Op>S_REG_IMMSHIFT_COND(rd, rm, shift_type, imm_shift, ARMCOND_AL)
+#endif
+
+
+
+/* Rd := (Rm <shift_type> Rs) */
+#define ARM_<Op>_REG_REGSHIFT_COND(p, rd, rm, shift_type, rs, cond) \
+ ARM_DPIOP_REG_REGSHIFT_COND(p, ARMOP_<Op>, rd, 0, rm, shift_type, rs, cond)
+#define ARM_<Op>_REG_REGSHIFT(p, rd, rm, shift_type, rs) \
+ ARM_<Op>_REG_REGSHIFT_COND(p, rd, rm, shift_type, rs, ARMCOND_AL)
+/* S */
+#define ARM_<Op>S_REG_REGSHIFT_COND(p, rd, rm, shift_type, rs, cond) \
+ ARM_DPIOP_S_REG_REGSHIFT_COND(p, ARMOP_<Op>, rd, 0, rm, shift_type, rs, cond)
+#define ARM_<Op>S_REG_REGSHIFT(p, rd, rm, shift_type, rs) \
+ ARM_<Op>S_REG_REGSHIFT_COND(p, rd, rm, shift_type, rs, ARMCOND_AL)
+
+#ifndef ARM_NOIASM
+#define _<Op>_REG_REGSHIFT_COND(rd, rm, shift_type, rs, cond) \
+ ARM_IASM_DPIOP_REG_REGSHIFT_COND(ARMOP_<Op>, rd, 0, rm, shift_type, rs, cond)
+#define _<Op>_REG_REGSHIFT(rd, rm, shift_type, rs) \
+ _<Op>_REG_REGSHIFT_COND(rd, rm, shift_type, rs, ARMCOND_AL)
+/* S */
+#define _<Op>S_REG_REGSHIFT_COND(rd, rm, shift_type, rs, cond) \
+ ARM_IASM_DPIOP_S_REG_REGSHIFT_COND(ARMOP_<Op>, rd, 0, rm, shift_type, rs, cond)
+#define _<Op>S_REG_REGSHIFT(rd, rm, shift_type, rs) \
+ _<Op>S_REG_REGSHIFT_COND(rd, rm, shift_type, rs, ARMCOND_AL)
+#endif
+
diff --git a/mono/arch/arm/tramp.c b/mono/arch/arm/tramp.c
index 3e5af332e17..b9e04b560f6 100644
--- a/mono/arch/arm/tramp.c
+++ b/mono/arch/arm/tramp.c
@@ -1,6 +1,8 @@
/*
* Create trampolines to invoke arbitrary functions.
* Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
+ *
+ * Contributions by Malte Hildingson
*/
#include "arm-codegen.h"
@@ -10,17 +12,18 @@
# include <windows.h>
#endif
+#include <errno.h>
+
#include "mono/metadata/class.h"
#include "mono/metadata/tabledefs.h"
#include "mono/interpreter/interp.h"
#include "mono/metadata/appdomain.h"
-#if 1
+#if 0
# define ARM_DUMP_DISASM 1
#endif
-
/* prototypes for private functions (to avoid compiler warnings) */
void flush_icache (void);
void* alloc_code_buff (int num_instr);
@@ -64,15 +67,27 @@ void flush_icache ()
void* alloc_code_buff (int num_instr)
{
void* code_buff;
+ int code_size = num_instr * sizeof(arminstr_t);
#if defined(_WIN32) || defined(UNDER_CE)
int old_prot = 0;
-#endif
-
- code_buff = malloc(num_instr * sizeof(arminstr_t));
-#if defined(_WIN32) || defined(UNDER_CE)
- VirtualProtect(code_buff, num_instr * sizeof(arminstr_t), PAGE_EXECUTE_READWRITE, &old_prot);
+ code_buff = malloc(code_size);
+ VirtualProtect(code_buff, code_size, PAGE_EXECUTE_READWRITE, &old_prot);
+#else
+#include <unistd.h>
+#include <sys/mman.h>
+ int page_size = sysconf(_SC_PAGESIZE);
+ int new_code_size;
+
+ new_code_size = code_size + page_size - 1;
+ code_buff = malloc(new_code_size);
+ code_buff = (void *) (((int) code_buff + page_size - 1) & ~(page_size - 1));
+
+ if (mprotect(code_buff, code_size, PROT_READ|PROT_WRITE|PROT_EXEC) != 0) {
+ g_critical (G_GNUC_PRETTY_FUNCTION
+ ": mprotect error: %s", g_strerror (errno));
+ }
#endif
return code_buff;
@@ -82,18 +97,15 @@ void* alloc_code_buff (int num_instr)
/*
* Refer to ARM Procedure Call Standard (APCS) for more info.
*/
-MonoPIFunc mono_create_trampoline (MonoMethod* method, int runtime)
+MonoPIFunc mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
- MonoMethodSignature* sig;
MonoType* param;
MonoPIFunc code_buff;
- arminstr_t* p, * utf8_addr, * free_addr, * str_new_addr;
+ arminstr_t* p;
guint32 code_size, stack_size;
guint32 simple_type;
int i, hasthis, aregs, regc, stack_offs;
- int utf8_offs, utf8_reg, utf8_stack_offs;
int this_loaded;
- int str_args, strc;
guchar reg_alloc [ARM_NUM_ARG_REGS];
/* pessimistic estimation for prologue/epilogue size */
@@ -106,8 +118,6 @@ MonoPIFunc mono_create_trampoline (MonoMethod* method, int runtime)
code_size += 2;
stack_size = 0;
- str_args = 0;
- sig = method->signature;
hasthis = sig->hasthis ? 1 : 0;
aregs = ARM_NUM_ARG_REGS - hasthis;
@@ -157,13 +167,6 @@ enum_calc_size:
code_size += 2;
stack_size += 4;
}
-
- if (simple_type == MONO_TYPE_STRING
- && !(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
- && !runtime) {
- code_size += 6; /* rough */
- ++str_args;
- }
break;
case MONO_TYPE_I8:
case MONO_TYPE_U8:
@@ -193,6 +196,7 @@ enum_calc_size:
simple_type = param->data.klass->enum_basetype->type;
goto enum_calc_size;
}
+
if (mono_class_value_size(param->data.klass, NULL) != 4) {
g_error("can only marshal enums, not generic structures (size: %d)", mono_class_value_size(param->data.klass, NULL));
}
@@ -213,14 +217,11 @@ enum_calc_size:
}
}
- if (str_args) code_size += 2;
-
code_buff = (MonoPIFunc)alloc_code_buff(code_size);
p = (arminstr_t*)code_buff;
/* prologue */
- p = arm_emit_lean_prologue((arminstr_t*)p,
- stack_size + str_args*sizeof(gpointer),
+ p = arm_emit_lean_prologue(p, stack_size,
/* save workset (r4-r7) */
(1 << ARMREG_R4) | (1 << ARMREG_R5) | (1 << ARMREG_R6) | (1 << ARMREG_R7));
@@ -229,7 +230,7 @@ enum_calc_size:
/* callme - always present */
ARM_MOV_REG_REG(p, ARMREG_R4, ARMREG_A1);
/* retval */
- if (sig->ret->byref || (sig->ret->type != MONO_TYPE_VOID)) {
+ if (sig->ret->byref || string_ctor || (sig->ret->type != MONO_TYPE_VOID)) {
ARM_MOV_REG_REG(p, ARMREG_R5, ARMREG_A2);
}
/* this_obj */
@@ -247,44 +248,20 @@ enum_calc_size:
ARM_MOV_REG_REG(p, ARMREG_R7, ARMREG_A4);
}
- if (str_args || sig->ret->type == MONO_TYPE_STRING) {
- /* branch around address table */
- ARM_B(p, str_args ? 2 : 0);
-
- /* create branch table for string functions */
- if (str_args) {
- /* allocate slots for convert
- * and free functions only if
- * we have some string args,
- * otherwise only string_new
- * is needed for retval.
- */
- utf8_addr = p;
- *p++ = (arminstr_t)&mono_string_to_utf8;
- free_addr = p;
- *p++ = (arminstr_t)&g_free;
- }
- str_new_addr = p;
- *p++ = (arminstr_t)&mono_string_new_wrapper;
-
- strc = str_args; /* # of string args */
- }
-
stack_offs = stack_size;
- utf8_stack_offs = stack_size + str_args*sizeof(gpointer);
/* handle arguments */
/* in reverse order so we could use r0 (arg1) for memory transfers */
for (i = sig->param_count; --i >= 0;) {
param = sig->params [i];
if (param->byref) {
- if (i < aregs) {
- ARM_LDR_IMM(p, ARMREG_A1 + i, REG_ARGP, i*ARG_SIZE);
- } else {
- stack_offs -= sizeof(armword_t);
- ARM_LDR_IMM(p, ARMREG_R4, REG_ARGP, i*ARG_SIZE);
- ARM_STR_IMM(p, ARMREG_R4, ARMREG_SP, stack_offs);
- }
+ if (i < aregs && reg_alloc[i] > 0) {
+ ARM_LDR_IMM(p, ARMREG_A1 + i, REG_ARGP, i*ARG_SIZE);
+ } else {
+ stack_offs -= sizeof(armword_t);
+ ARM_LDR_IMM(p, ARMREG_R0, REG_ARGP, i*ARG_SIZE);
+ ARM_STR_IMM(p, ARMREG_R0, ARMREG_SP, stack_offs);
+ }
} else {
simple_type = param->type;
enum_marshal:
@@ -304,7 +281,7 @@ enum_marshal:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
-push_a_word:
+ case MONO_TYPE_STRING:
if (i < aregs && reg_alloc [i] > 0) {
/* pass in register */
ARM_LDR_IMM(p, ARMREG_A1 + hasthis + (aregs - reg_alloc [i]), REG_ARGP, i*ARG_SIZE);
@@ -337,66 +314,23 @@ push_a_word:
ARM_STR_IMM(p, ARMREG_R0, ARMREG_SP, stack_offs + 4);
}
break;
- case MONO_TYPE_STRING:
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime) {
- goto push_a_word;
- } else {
- if (sig->hasthis && this_loaded) {
- ARM_MOV_REG_REG(p, REG_THIS, ARMREG_A1);
- this_loaded = 0;
- }
-
- if (sig->hasthis && strc == str_args) {
- ARM_PUSH(p, (1 << REG_THIS));
- /* adjust stack pointers */
- stack_offs += sizeof(armword_t);
- utf8_stack_offs += sizeof(armword_t);
- }
-
- utf8_offs = -(p + 2 - utf8_addr) * sizeof(arminstr_t);
- utf8_reg = sig->hasthis ? REG_FUNC_ADDR : REG_THIS;
- /* load function address */
- ARM_LDR_IMM(p, utf8_reg, ARMREG_PC, utf8_offs);
- /* load MonoString ptr */
- ARM_LDR_IMM(p, ARMREG_A1, REG_ARGP, i*ARG_SIZE);
- /* call string_to_utf8 function */
- ARM_MOV_REG_REG(p, ARMREG_LR, ARMREG_PC);
- ARM_MOV_REG_REG(p, ARMREG_PC, utf8_reg);
-
- /* count-down string args */
- --strc;
-
- if (sig->hasthis && strc == 0) {
- ARM_POP(p, (1 << REG_THIS));
- /* restore stack pointers */
- stack_offs -= sizeof(armword_t);
- utf8_stack_offs -= sizeof(armword_t);
- }
-
- /* maintain list of allocated strings */
- utf8_stack_offs -= sizeof(gpointer);
- ARM_STR_IMM(p, ARMREG_R0, ARMREG_SP, utf8_stack_offs);
-
- if (i < aregs && reg_alloc [i] > 0) {
- /* pass in register */
- utf8_reg = ARMREG_A1 + hasthis + (aregs - reg_alloc [i]);
- /* result returned in R0, avoid NOPs */
- if (utf8_reg != ARMREG_R0) {
- ARM_MOV_REG_REG(p, utf8_reg, ARMREG_R0);
- }
- } else {
- stack_offs -= sizeof(armword_t);
- ARM_STR_IMM(p, ARMREG_R0, ARMREG_SP, stack_offs);
- }
- }
- break;
case MONO_TYPE_VALUETYPE:
if (param->data.klass->enumtype) {
/* it's an enum value, proceed based on its base type */
simple_type = param->data.klass->enum_basetype->type;
goto enum_marshal;
} else {
- goto push_a_word;
+ if (i < aregs && reg_alloc[i] > 0) {
+ int vtreg = ARMREG_A1 + hasthis +
+ hasthis + (aregs - reg_alloc[i]);
+ ARM_LDR_IMM(p, vtreg, REG_ARGP, i * ARG_SIZE);
+ ARM_LDR_IMM(p, vtreg, vtreg, 0);
+ } else {
+ stack_offs -= sizeof(armword_t);
+ ARM_LDR_IMM(p, ARMREG_R0, REG_ARGP, i * ARG_SIZE);
+ ARM_LDR_IMM(p, ARMREG_R0, ARMREG_R0, 0);
+ ARM_STR_IMM(p, ARMREG_R0, ARMREG_SP, stack_offs);
+ }
}
break;
@@ -415,9 +349,8 @@ push_a_word:
ARM_MOV_REG_REG(p, ARMREG_LR, ARMREG_PC);
ARM_MOV_REG_REG(p, ARMREG_PC, REG_FUNC_ADDR);
-
/* handle retval */
- if (sig->ret->byref) {
+ if (sig->ret->byref || string_ctor) {
ARM_STR_IMM(p, ARMREG_R0, REG_RETVAL, 0);
} else {
simple_type = sig->ret->type;
@@ -446,24 +379,9 @@ enum_retvalue:
case MONO_TYPE_OBJECT:
case MONO_TYPE_CLASS:
case MONO_TYPE_ARRAY:
- ARM_STR_IMM(p, ARMREG_R0, REG_RETVAL, 0);
- break;
+ case MONO_TYPE_SZARRAY:
case MONO_TYPE_STRING:
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime) {
- /* return UTF8 string as-is */
- ARM_STR_IMM(p, ARMREG_R0, REG_RETVAL, 0);
- } else {
- /* if result is non-null convert it back to MonoString */
- utf8_offs = -(p + 2 - str_new_addr) * sizeof(arminstr_t);
- ARM_TEQ_REG_IMM8(p, ARMREG_R0, 0);
- /* load mono_string_new_wrapper address */
- ARM_LDR_IMM_COND(p, ARMREG_R2, ARMREG_PC, utf8_offs, ARMCOND_NE);
- /* call mono_string_new_wrapper */
- ARM_MOV_REG_REG_COND(p, ARMREG_LR, ARMREG_PC, ARMCOND_NE);
- ARM_MOV_REG_REG_COND(p, ARMREG_PC, ARMREG_R2, ARMCOND_NE);
-
- ARM_STR_IMM(p, ARMREG_R0, REG_RETVAL, 0);
- }
+ ARM_STR_IMM(p, ARMREG_R0, REG_RETVAL, 0);
break;
/*
* A 64-bit integer is returned in R0 and R1.
@@ -487,26 +405,8 @@ enum_retvalue:
break;
}
}
-
- /* free allocated strings */
- if (str_args) {
- utf8_stack_offs = stack_size + str_args*sizeof(gpointer);
- for (strc = str_args; --strc >= 0;) {
- utf8_stack_offs -= sizeof(gpointer);
- /* calc PC-relative offset to function addr */
- utf8_offs = -(p + 2 - free_addr) * sizeof(arminstr_t);
- /* load function address */
- ARM_LDR_IMM(p, ARMREG_R2, ARMREG_PC, utf8_offs);
- /* load MonoString ptr */
- ARM_LDR_IMM(p, ARMREG_A1, ARMREG_SP, utf8_stack_offs);
- /* call free function */
- ARM_MOV_REG_REG(p, ARMREG_LR, ARMREG_PC);
- ARM_MOV_REG_REG(p, ARMREG_PC, ARMREG_R2);
- }
- }
-
-
- p = arm_emit_std_epilogue(p, stack_size + str_args*sizeof(gpointer),
+
+ p = arm_emit_std_epilogue(p, stack_size,
/* restore R4-R7 */
(1 << ARMREG_R4) | (1 << ARMREG_R5) | (1 << ARMREG_R6) | (1 << ARMREG_R7));
@@ -524,6 +424,7 @@ enum_retvalue:
#define MINV_OFFS(member) G_STRUCT_OFFSET(MonoInvocation, member)
+
/*
* Returns a pointer to a native function that can be used to
* call the specified method.
@@ -534,13 +435,14 @@ enum_retvalue:
* Still need to figure out how to handle the exception stuff
* across the managed/unmanaged boundary.
*/
-void* mono_create_method_pointer (MonoMethod* method)
+void* mono_arch_create_method_pointer (MonoMethod* method)
{
MonoMethodSignature* sig;
guchar* p, * p_method, * p_stackval_from_data, * p_exec;
void* code_buff;
int i, stack_size, arg_pos, arg_add, stackval_pos, offs;
int areg, reg_args, shift, pos;
+ MonoJitInfo *ji;
code_buff = alloc_code_buff(128);
p = (guchar*)code_buff;
@@ -567,7 +469,6 @@ void* mono_create_method_pointer (MonoMethod* method)
p_exec = p;
p += 4;
-
stack_size = sizeof(MonoInvocation) + ARG_SIZE*(sig->param_count + 1) + ARM_NUM_ARG_REGS*2*sizeof(armword_t);
/* prologue */
@@ -586,7 +487,6 @@ void* mono_create_method_pointer (MonoMethod* method)
ARM_MOV_REG_IMM8(p, ARMREG_R4, 0);
ARM_STR_IMM(p, ARMREG_R4, ARMREG_SP, MINV_OFFS(ex));
ARM_STR_IMM(p, ARMREG_R4, ARMREG_SP, MINV_OFFS(ex_handler));
- ARM_STR_IMM(p, ARMREG_R4, ARMREG_SP, MINV_OFFS(child));
ARM_STR_IMM(p, ARMREG_R4, ARMREG_SP, MINV_OFFS(parent));
/* Set the method pointer. */
@@ -751,6 +651,7 @@ void* mono_create_method_pointer (MonoMethod* method)
case MONO_TYPE_OBJECT:
case MONO_TYPE_CLASS:
case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
ARM_LDR_IMM(p, ARMREG_R0, ARMREG_R5, 0);
break;
case MONO_TYPE_I8:
@@ -778,6 +679,13 @@ void* mono_create_method_pointer (MonoMethod* method)
_armdis_decode((arminstr_t*)code_buff, ((guint8*)p) - ((guint8*)code_buff));
#endif
+ ji = g_new0(MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = ((guint8 *) p) - ((guint8 *) code_buff);
+ ji->code_start = (gpointer) code_buff;
+
+ mono_jit_info_table_add(mono_get_root_domain (), ji);
+
return code_buff;
}
diff --git a/mono/arch/hppa/.cvsignore b/mono/arch/hppa/.cvsignore
new file mode 100644
index 00000000000..051d1bd50ba
--- /dev/null
+++ b/mono/arch/hppa/.cvsignore
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+.deps
diff --git a/mono/arch/hppa/Makefile.am b/mono/arch/hppa/Makefile.am
new file mode 100644
index 00000000000..7e671cd4344
--- /dev/null
+++ b/mono/arch/hppa/Makefile.am
@@ -0,0 +1,7 @@
+
+INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmonoarch-hppa.la
+
+libmonoarch_hppa_la_SOURCES = tramp.c hppa-codegen.h
+
diff --git a/mono/arch/hppa/hppa-codegen.h b/mono/arch/hppa/hppa-codegen.h
new file mode 100644
index 00000000000..0a9586f2631
--- /dev/null
+++ b/mono/arch/hppa/hppa-codegen.h
@@ -0,0 +1,213 @@
+typedef enum {
+ hppa_r0 = 0,
+ hppa_r1,
+ hppa_r2,
+ hppa_rp = hppa_r2,
+ hppa_r3,
+ hppa_r4,
+ hppa_r5,
+ hppa_r6,
+ hppa_r7,
+ hppa_r8,
+ hppa_r9,
+ hppa_r10,
+ hppa_r11,
+ hppa_r12,
+ hppa_r13,
+ hppa_r14,
+ hppa_r15,
+ hppa_r16,
+ hppa_r17,
+ hppa_r18,
+ hppa_r19,
+ hppa_r20,
+ hppa_r21,
+ hppa_r22,
+ hppa_r23,
+ hppa_r24,
+ hppa_r25,
+ hppa_r26,
+ hppa_r27,
+ hppa_r28,
+ hppa_r29,
+ hppa_ap = hppa_r29,
+ hppa_r30,
+ hppa_sp = hppa_r30,
+ hppa_r31
+} HPPAIntRegister;
+
+#define hppa_nop(p); \
+ do { \
+ *(p) = 0x08000240; \
+ p++; \
+ } while (0)
+
+#define hppa_ldb(p, disp, base, dest); \
+ do { \
+ int neg = (disp) < 0; \
+ *(p) = (0x40000000 | (((disp) & 0x1fff) << 1) | ((base) << 21) | ((dest) << 16) | neg); \
+ p++; \
+ } while (0)
+
+#define hppa_stb(p, src, disp, base) \
+ do { \
+ int neg = (disp) < 0; \
+ *(p) = (0x60000000 | (((disp) & 0x1fff) << 1) | ((base) << 21) | ((src) << 16) | neg); \
+ p++; \
+ } while (0)
+
+#define hppa_ldh(p, disp, base, dest) \
+ do { \
+ int neg = (disp) < 0; \
+ g_assert(((disp) & 1) == 0); \
+ *(p) = (0x44000000 | (((disp) & 0x1fff) << 1) | ((base) << 21) | ((dest) << 16) | neg); \
+ p++; \
+ } while (0)
+
+#define hppa_sth(p, src, disp, base) \
+ do { \
+ int neg = (disp) < 0; \
+ g_assert(((disp) & 1) == 0); \
+ *(p) = (0x64000000 | (((disp) & 0x1fff) << 1) | ((base) << 21) | ((src) << 16) | neg); \
+ p++; \
+ } while (0)
+
+#define hppa_ldw(p, disp, base, dest) \
+ do { \
+ int neg = (disp) < 0; \
+ g_assert(((disp) & 3) == 0); \
+ *(p) = (0x48000000 | (((disp) & 0x1fff) << 1) | ((base) << 21) | ((dest) << 16) | neg); \
+ p++; \
+ } while (0)
+
+#define hppa_stw(p, src, disp, base) \
+ do { \
+ int neg = (disp) < 0; \
+ g_assert(((disp) & 3) == 0); \
+ *(p) = (0x68000000 | (((disp) & 0x1fff) << 1) | ((base) << 21) | ((src) << 16) | neg); \
+ p++; \
+ } while (0)
+
+#define hppa_copy(p, src, dest) \
+ do { \
+ *(p) = (0x34000000 | ((src) << 21) | ((dest) << 16)); \
+ p++; \
+ } while (0)
+
+#define hppa_ldd_with_flags(p, disp, base, dest, m, a) \
+ do { \
+ int neg = (disp) < 0; \
+ int im10a = (disp) >> 3; \
+ g_assert(((disp) & 7) == 0); \
+ *(p) = (0x50000000 | (((im10a) & 0x3ff) << 4) | ((base) << 21) | ((dest) << 16) | neg | (m ? 0x8 : 0) | (a ? 0x4 : 0)); \
+ p++; \
+ } while (0)
+
+#define hppa_ldd(p, disp, base, dest) \
+ hppa_ldd_with_flags(p, disp, base, dest, 0, 0)
+
+#define hppa_ldd_mb(p, disp, base, dest) \
+ hppa_ldd_with_flags(p, disp, base, dest, 1, 1)
+
+#define hppa_std_with_flags(p, src, disp, base, m, a); \
+ do { \
+ int neg = (disp) < 0; \
+ int im10a = (disp) >> 3; \
+ g_assert(((disp) & 7) == 0); \
+ *(p) = (0x70000000 | (((im10a) & 0x3ff) << 4) | ((base) << 21) | ((src) << 16) | neg | (m ? 0x8 : 0) | (a ? 0x4 : 0)); \
+ p++; \
+ } while (0)
+
+#define hppa_std(p, disp, base, dest) \
+ hppa_std_with_flags(p, disp, base, dest, 0, 0)
+
+#define hppa_std_ma(p, disp, base, dest) \
+ hppa_std_with_flags(p, disp, base, dest, 1, 0)
+
+#define hppa_fldd_with_flags(p, disp, base, dest, m, a) \
+ do { \
+ int neg = (disp) < 0; \
+ int im10a = (disp) >> 3; \
+ *(p) = (0x50000002 | (((im10a) & 0x3ff) << 4) | ((base) << 21) | ((dest) << 16) | neg | (m ? 0x8 : 0) | (a ? 0x4 : 0)); \
+ p++; \
+ } while (0)
+
+#define hppa_fldd(p, disp, base, dest) \
+ hppa_fldd_with_flags(p, disp, base, dest, 0, 0)
+
+#define hppa_fstd_with_flags(p, src, disp, base, m, a) \
+ do { \
+ int neg = (disp) < 0; \
+ int im10a = (disp) >> 3; \
+ *(p) = (0x70000002 | (((im10a) & 0x3ff) << 4) | ((base) << 21) | ((src) << 16) | neg | (m ? 0x8 : 0) | (a ? 0x4 : 0)); \
+ p++; \
+ } while (0)
+
+#define hppa_fstd(p, disp, base, dest) \
+ hppa_fstd_with_flags(p, disp, base, dest, 0, 0)
+
+
+#define hppa_fldw_with_flags(p, im11a, base, dest, r) \
+ do { \
+ int neg = (disp) < 0; \
+ int im11a = (disp) >> 2; \
+ *(p) = (0x5c000000 | (((im11a) & 0x7ff) << 3) | ((base) << 21) | ((dest) << 16) | neg | ((r) ? 0x2 : 0)); \
+ p++; \
+ } while (0)
+
+#define hppa_fldw(p, disp, base, dest) \
+ hppa_fldw_with_flags(p, disp, base, dest, 1)
+
+#define hppa_fstw_with_flags(p, src, disp, base, r) \
+ do { \
+ int neg = (disp) < 0; \
+ int im11a = (disp) >> 2; \
+ *(p) = (0x7c000000 | (((im11a) & 0x7ff) << 3) | ((base) << 21) | ((src) << 16) | neg | ((r) ? 0x2 : 0)); \
+ p++; \
+ } while (0)
+
+#define hppa_fstw(p, src, disp, base) \
+ hppa_fstw_with_flags(p, src, disp, base, 1)
+
+/* only works on right half SP registers */
+#define hppa_fcnv(p, src, ssng, dest, dsng) \
+ do { \
+ *(p) = (0x38000200 | ((src) << 21) | ((ssng) ? 0x80 : 0x800) | (dest) | ((dsng) ? 0x40 : 0x2000)); \
+ p++; \
+ } while (0)
+
+#define hppa_fcnv_sng_dbl(p, src, dest) \
+ hppa_fcnv(p, src, 1, dest, 0)
+
+#define hppa_fcnv_dbl_sng(p, src, dest) \
+ hppa_fcnv(p, src, 0, dest, 1)
+
+#define hppa_ldil(p, val, dest) \
+ do { \
+ unsigned int t = (val >> 11) & 0x1fffff; \
+ unsigned int im21 = ((t & 0x7c) << 14) | ((t & 0x180) << 7) | ((t & 0x3) << 12) | ((t & 0xffe00) >> 8) | ((t & 0x100000) >> 20); \
+ *(p) = (0x20000000 | im21 | ((dest) << 21)); \
+ p++; \
+ } while (0)
+
+#define hppa_ldo(p, off, base, dest) \
+ do { \
+ int neg = (off) < 0; \
+ *(p) = (0x34000000 | (((off) & 0x1fff)) << 1 | ((base) << 21) | ((dest) << 16) | neg); \
+ p++; \
+ } while (0)
+
+#define hppa_extrdu(p, src, pos, len, dest) \
+ do { \
+ *(p) = (0xd8000000 | ((src) << 21) | ((dest) << 16) | ((pos) > 32 ? 0x800 : 0) | (((pos) & 31) << 5) | ((len) > 32 ? 0x1000 : 0) | (32 - (len & 31))); \
+ p++; \
+ } while (0)
+
+#define hppa_bve(p, reg, link) \
+ do { \
+ *(p) = (0xE8001000 | ((link ? 7 : 6) << 13) | ((reg) << 21)); \
+ p++; \
+ } while (0)
+
+#define hppa_blve(p, reg) \
+ hppa_bve(p, reg, 1)
diff --git a/mono/arch/hppa/tramp.c b/mono/arch/hppa/tramp.c
new file mode 100644
index 00000000000..089abde9d4b
--- /dev/null
+++ b/mono/arch/hppa/tramp.c
@@ -0,0 +1,778 @@
+/*
+ Copyright (c) 2003 Bernie Solomon <bernard@ugsolutions.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.
+
+
+ Trampoline generation for HPPA - currently (Oct 9th 2003) only
+ supports 64 bits - and the HP compiler.
+*/
+#include "mono/interpreter/interp.h"
+#include "mono/metadata/appdomain.h"
+#include "mono/metadata/tabledefs.h"
+#include "hppa-codegen.h"
+
+#if SIZEOF_VOID_P != 8
+#error "HPPA code only currently supports 64bit pointers"
+#endif
+
+// debugging flag which dumps code generated
+static int debug_asm = 0;
+
+
+static void flush_cache(void *address, int length)
+{
+#ifdef __GNUC__
+#error "currently only supports the HP C compiler"
+#else
+ int cache_line_size = 16;
+ ulong_t end = (ulong_t)address + length;
+ register ulong_t sid;
+ register ulong_t offset = (ulong_t) address;
+ register ulong_t r0 = 0;
+
+ _asm("LDSID", 0, offset, sid);
+ _asm("MTSP", sid, 0);
+ _asm("FDC", r0, 0, offset);
+ offset = (offset + (cache_line_size - 1)) & ~(cache_line_size - 1);
+ while (offset < end) {
+ (void)_asm("FDC", r0, 0, offset);
+ offset += cache_line_size;
+ }
+ _asm("SYNC");
+ offset = (ulong_t) address;
+ _asm("FIC", r0, 0, offset);
+ offset = (offset + (cache_line_size - 1)) & ~(cache_line_size - 1);
+ while (offset < end) {
+ (void)_asm("FIC", r0, 0, offset);
+ offset += cache_line_size;
+ }
+ _asm("SYNC");
+ // sync needs at least 7 instructions after it... this is what is used for NOP
+ _asm("OR", 0, 0, 0);
+ _asm("OR", 0, 0, 0);
+ _asm("OR", 0, 0, 0);
+ _asm("OR", 0, 0, 0);
+ _asm("OR", 0, 0, 0);
+ _asm("OR", 0, 0, 0);
+ _asm("OR", 0, 0, 0);
+#endif
+}
+
+static void disassemble (guint32 *code, int n_instrs)
+{
+ const char *tmp_file = "/tmp/mono_adb.in";
+ FILE *fp = fopen(tmp_file, "w");
+ int i;
+ for (i = 0; i < n_instrs; i++)
+ fprintf(fp, "0x%08x=i\n", code[i]);
+ fprintf(fp, "$q\n");
+ fclose(fp);
+ system("adb64 </tmp/mono_adb.in");
+ unlink(tmp_file);
+}
+
+#define ADD_INST(code, pc, gen_exp) \
+ do { if ((code) == NULL) (pc)++; else { gen_exp; pc++; } } while (0)
+
+/*
+ * void func (void (*callme)(), void *retval, void *this_obj, stackval *arguments);
+ */
+
+MonoPIFunc
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+{
+ int pc, save_pc;
+ int param;
+ void **descriptor;
+ unsigned int *code = NULL;
+ unsigned int *code_start = NULL;
+ int arg_reg;
+#define FP_ARG_REG(r) (4 + (26 - arg_reg))
+ int arg_offset;
+ int frame_size = 0;
+ int spill_offset;
+ int parameter_offset;
+ int parameter_slot;
+ int args_on_stack;
+
+ if (debug_asm) {
+ fprintf(stderr, "trampoline: # params %d has this %d exp this %d string %d, ret type %d\n",
+ sig->param_count, sig->hasthis, sig->explicit_this, string_ctor, sig->ret->type);
+ }
+
+ // everything takes 8 bytes unless it is a bigger struct
+ for (param = 0; param < sig->param_count; param++) {
+ if (sig->params[param]->byref)
+ frame_size += 8;
+ else {
+ if (sig->params[param]->type != MONO_TYPE_VALUETYPE)
+ frame_size += 8;
+ else {
+ if (sig->params [param]->data.klass->enumtype)
+ frame_size += 8;
+ else {
+ frame_size += 15; // large structs are 16 byte aligned
+ frame_size &= ~15;
+ frame_size += mono_class_native_size (sig->params [param]->data.klass, NULL);
+ frame_size += 7;
+ frame_size &= ~7;
+ }
+ }
+ }
+ }
+
+ if (sig->hasthis)
+ frame_size += 8;
+ // 16 byte alignment
+ if ((frame_size & 15) != 0)
+ frame_size += 8;
+ // minimum is 64 bytes
+ if (frame_size < 64)
+ frame_size = 64;
+
+ if (debug_asm)
+ fprintf(stderr, "outgoing frame size: %d\n", frame_size);
+
+ frame_size += 16; // for the frame marker (called routines stuff return address etc. here)
+ frame_size += 32; // spill area for r4, r5 and r27 (16 byte aligned)
+
+ spill_offset = -frame_size;
+ parameter_offset = spill_offset + 32; // spill area size is really 24
+ spill_offset += 8;
+
+ /* the rest executes twice - once to count instructions so we can
+ allocate memory in one block and once to fill it in... the count
+ should be pretty fast anyway...
+ */
+generate:
+ pc = 0;
+ arg_reg = 26;
+ arg_offset = 0;
+ args_on_stack = 0;
+ parameter_slot = parameter_offset;
+
+ ADD_INST(code, pc, hppa_std(code, 2, -16, 30)); // STD %r2,-16(%r30)
+ ADD_INST(code, pc, hppa_std_ma(code, 3, frame_size, 30));
+ ADD_INST(code, pc, hppa_std(code, 4, spill_offset, 30));
+ ADD_INST(code, pc, hppa_std(code, 5, spill_offset + 8, 30));
+ ADD_INST(code, pc, hppa_copy(code, 29, 3)); // COPY %r29,%r3
+ ADD_INST(code, pc, hppa_std(code, 27, spill_offset + 16, 30));
+ ADD_INST(code, pc, hppa_nop(code)); // NOP
+
+ ADD_INST(code, pc, hppa_std(code, 26, -64, 29)); // STD %r26,-64(%r29) callme
+ ADD_INST(code, pc, hppa_std(code, 25, -56, 29)); // STD %r25,-56(%r29) retval
+ ADD_INST(code, pc, hppa_std(code, 24, -48, 29)); // STD %r24,-48(%r29) this_obj
+ ADD_INST(code, pc, hppa_std(code, 23, -40, 29)); // STD %r23,-40(%r29) arguments
+
+ if (sig->param_count > 0)
+ ADD_INST(code, pc, hppa_copy(code, 23, 4)); // r4 is the current pointer to the stackval array of args
+
+ if (sig->hasthis) {
+ if (sig->call_convention != MONO_CALL_THISCALL) {
+ ADD_INST(code, pc, hppa_copy(code, 24, arg_reg));
+ --arg_reg;
+ parameter_slot += 8;
+ } else {
+ fprintf(stderr, "case I didn't handle\n");
+ }
+ }
+
+ for (param = 0; param < sig->param_count; param++) {
+ int type = sig->params[param]->type;
+ if (sig->params[param]->byref) {
+ if (args_on_stack) {
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, 5));
+ ADD_INST(code, pc, hppa_std(code, 5, parameter_slot, 30));
+ } else {
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, arg_reg));
+ --arg_reg;
+ }
+ arg_offset += sizeof(stackval);
+ parameter_slot += 8;
+ continue;
+ }
+ typeswitch:
+ switch (type) {
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ if (args_on_stack) {
+ ADD_INST(code, pc, hppa_ldw(code, arg_offset, 4, 5));
+ switch (type) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ ADD_INST(code, pc, hppa_stw(code, 5, parameter_slot + 4, 30));
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ ADD_INST(code, pc, hppa_sth(code, 5, parameter_slot + 6, 30));
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ ADD_INST(code, pc, hppa_stb(code, 5, parameter_slot + 7, 30));
+ break;
+ }
+ } else {
+ ADD_INST(code, pc, hppa_ldw(code, arg_offset, 4, arg_reg));
+ --arg_reg;
+ }
+ arg_offset += sizeof(stackval);
+ parameter_slot += 8;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ if (args_on_stack) {
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, 5));
+ ADD_INST(code, pc, hppa_std(code, 5, parameter_slot, 30));
+ } else {
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, arg_reg));
+ --arg_reg;
+ }
+ arg_offset += sizeof(stackval);
+ parameter_slot += 8;
+ break;
+ case MONO_TYPE_R8:
+ if (args_on_stack) {
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, 5));
+ ADD_INST(code, pc, hppa_std(code, 5, parameter_slot, 30));
+ } else {
+ ADD_INST(code, pc, hppa_fldd(code, arg_offset, 4, FP_ARG_REG(arg_reg)));
+ --arg_reg;
+ }
+ arg_offset += sizeof(stackval);
+ parameter_slot += 8;
+ break;
+ case MONO_TYPE_R4:
+ if (args_on_stack) {
+ ADD_INST(code, pc, hppa_fldd(code, arg_offset, 4, 22));
+ ADD_INST(code, pc, hppa_fcnv_dbl_sng(code, 22, 22));
+ ADD_INST(code, pc, hppa_fstw(code, 22, parameter_slot + 4, 30));
+ } else {
+ ADD_INST(code, pc, hppa_fldd(code, arg_offset, 4, FP_ARG_REG(arg_reg)));
+ ADD_INST(code, pc, hppa_fcnv_dbl_sng(code, FP_ARG_REG(arg_reg), FP_ARG_REG(arg_reg)));
+ --arg_reg;
+ }
+ arg_offset += sizeof(stackval);
+ parameter_slot += 8;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [param]->data.klass->enumtype) {
+ type = sig->params [param]->data.klass->enum_basetype->type;
+ goto typeswitch;
+ } else {
+ int size = mono_class_native_size (sig->params [param]->data.klass, NULL);
+ // assumes struct is 8 byte aligned whatever its size... (as interp.c guarantees at present)
+ // copies multiple of 8 bytes which may include some trailing garbage but should be safe
+ if (size <= 8) {
+ if (args_on_stack) {
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, 5));
+ ADD_INST(code, pc, hppa_ldd(code, 0, 5, 5));
+ ADD_INST(code, pc, hppa_std(code, 5, parameter_slot, 30));
+ } else {
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, arg_reg));
+ ADD_INST(code, pc, hppa_ldd(code, 0, arg_reg, arg_reg));
+ --arg_reg;
+ }
+ parameter_slot += 8;
+ } else {
+ int soffset = 0;
+ if ((parameter_slot & 15) != 0) {
+ --arg_reg;
+ if (arg_reg < 19) {
+ args_on_stack = 1;
+ }
+ parameter_slot += 8;
+ }
+ ADD_INST(code, pc, hppa_ldd(code, arg_offset, 4, 5));
+ // might generate a lot of code for very large structs... should
+ // use a loop or routine call them
+ while (size > 0) {
+ if (args_on_stack) {
+ ADD_INST(code, pc, hppa_ldd(code, soffset, 5, 31));
+ ADD_INST(code, pc, hppa_std(code, 31, parameter_slot, 30));
+ } else {
+ ADD_INST(code, pc, hppa_ldd(code, soffset, 5, arg_reg));
+ --arg_reg;
+ if (arg_reg < 19)
+ args_on_stack = 1;
+ }
+ parameter_slot += 8;
+ soffset += 8;
+ size -= 8;
+ }
+ }
+ arg_offset += sizeof(stackval);
+ break;
+ }
+ break;
+ default:
+ g_error ("mono_create_trampoline: unhandled arg type %d", type);
+ return NULL;
+ }
+
+ if (arg_reg < 19) {
+ args_on_stack = 1;
+ }
+ }
+
+ // for large return structs just pass on the buffer given to us.
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && sig->ret->data.klass->enumtype == 0) {
+ int size = mono_class_native_size (sig->ret->data.klass, NULL);
+ if (size > 16) {
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 28));
+ ADD_INST(code, pc, hppa_ldd(code, 0, 28, 28));
+ }
+ }
+
+ ADD_INST(code, pc, hppa_nop(code)); // NOP
+ ADD_INST(code, pc, hppa_ldd(code, -64, 29, 5));
+ ADD_INST(code, pc, hppa_ldd(code, 24, 5, 27));
+ ADD_INST(code, pc, hppa_ldd(code, 16, 5, 5));
+ ADD_INST(code, pc, hppa_blve(code, 5));
+ ADD_INST(code, pc, hppa_ldo(code, parameter_offset + 64, 30, 29));
+ ADD_INST(code, pc, hppa_ldd(code, spill_offset + 16, 30, 27));
+ ADD_INST(code, pc, hppa_nop(code)); // NOP
+
+ if (string_ctor) {
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19)); // LDD -56(%r3),%r19
+ ADD_INST(code, pc, hppa_std(code, 28, 0, 19)); // STD %r28,0(%r19)
+ }
+ else if (sig->ret->type != MONO_TYPE_VOID) {
+ int type = sig->ret->type;
+
+ rettypeswitch:
+ switch (type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19)); // LDD -56(%r3),%r19
+ ADD_INST(code, pc, hppa_stb(code, 28, 0, 19)); // STB %r28,0(%r19)
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19)); // LDD -56(%r3),%r19
+ ADD_INST(code, pc, hppa_stw(code, 28, 0, 19)); // STW %r28,0(%r19)
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19)); // LDD -56(%r3),%r19
+ ADD_INST(code, pc, hppa_sth(code, 28, 0, 19)); // STH %r28,0(%r19)
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19)); // LDD -56(%r3),%r19
+ ADD_INST(code, pc, hppa_std(code, 28, 0, 19)); // STD %r28,0(%r19)
+ break;
+ case MONO_TYPE_R8:
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19)); // LDD -56(%r3),%r19
+ ADD_INST(code, pc, hppa_fstd(code, 4, 0, 19)); // FSTD %fr4,0(%r19)
+ break;
+ case MONO_TYPE_R4:
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19)); // LDD -56(%r3),%r19
+ ADD_INST(code, pc, hppa_fstw(code, 4, 0, 19)); // FSTW %fr4r,0(%r19)
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ type = sig->ret->data.klass->enum_basetype->type;
+ goto rettypeswitch;
+ } else {
+ int size = mono_class_native_size (sig->ret->data.klass, NULL);
+ if (size <= 16) {
+ int reg = 28;
+ int off = 0;
+ ADD_INST(code, pc, hppa_ldd(code, -56, 3, 19));
+ ADD_INST(code, pc, hppa_ldd(code, 0, 19, 19));
+ if (size > 8) {
+ ADD_INST(code, pc, hppa_std(code, 28, 0, 19));
+ size -= 8;
+ reg = 29;
+ off += 8;
+ }
+ // get rest of value right aligned in the register
+ ADD_INST(code, pc, hppa_extrdu(code, reg, 8 * size - 1, 8 * size, reg));
+ if ((size & 1) != 0) {
+ ADD_INST(code, pc, hppa_stb(code, reg, off + size - 1, 19));
+ ADD_INST(code, pc, hppa_extrdu(code, reg, 55, 56, reg));
+ size -= 1;
+ }
+ if ((size & 2) != 0) {
+ ADD_INST(code, pc, hppa_sth(code, reg, off + size - 2, 19));
+ ADD_INST(code, pc, hppa_extrdu(code, reg, 47, 48, reg));
+ size -= 2;
+ }
+ if ((size & 4) != 0)
+ ADD_INST(code, pc, hppa_stw(code, reg, off + size - 4, 19));
+ }
+ break;
+ }
+ default:
+ g_error ("mono_create_trampoline: unhandled ret type %d", type);
+ return NULL;
+ }
+ }
+
+ ADD_INST(code, pc, hppa_ldd(code, -frame_size-16, 30, 2));
+ ADD_INST(code, pc, hppa_ldd(code, spill_offset, 30, 4));
+ ADD_INST(code, pc, hppa_ldd(code, spill_offset + 8, 30, 5));
+ ADD_INST(code, pc, hppa_bve(code, 2, 0));
+ ADD_INST(code, pc, hppa_ldd_mb(code, -frame_size, 30, 3));
+
+ if (code == NULL) {
+ descriptor = (void **)g_malloc(4 * sizeof(void *) + pc * sizeof(unsigned int));
+ code = (unsigned int *)((char *)descriptor + 4 * sizeof(void *));
+ code_start = code;
+ save_pc = pc;
+ goto generate;
+ } else
+ g_assert(pc == save_pc);
+
+ if (debug_asm) {
+ fprintf(stderr, "generated: %d bytes\n", pc * 4);
+ disassemble(code_start, pc);
+ }
+
+ // must do this so we can actually execute the code we just put in memory
+ flush_cache(code_start, 4 * pc);
+
+ descriptor[0] = 0;
+ descriptor[1] = 0;
+ descriptor[2] = code_start;
+ descriptor[3] = 0;
+
+ return (MonoPIFunc)descriptor;
+}
+
+void *
+mono_arch_create_method_pointer (MonoMethod *method)
+{
+ MonoMethodSignature *sig = method->signature;
+ MonoJitInfo *ji;
+ int i;
+ int pc;
+ int param;
+ void **descriptor = NULL;
+ void **data = NULL;
+ unsigned int *code = NULL;
+ unsigned int *code_start = NULL;
+ int arg_reg = 26;
+ int arg_offset = 0;
+ int frame_size;
+ int invoke_rec_offset;
+ int stack_vals_offset;
+ int stack_val_pos;
+ int arg_val_pos;
+ int spill_offset;
+ int *vtoffsets;
+ int t;
+
+ if (debug_asm) {
+ fprintf(stderr, "mono_create_method_pointer %s: flags %d\n", method->name, method->flags);
+ fprintf(stderr, "method: # params %d has this %d exp this %d\n", sig->param_count, sig->hasthis, sig->explicit_this);
+ fprintf(stderr, "ret %d\n", sig->ret->type);
+ for (i = 0; i < sig->param_count; i++)
+ fprintf(stderr, "%d: %d\n", i, sig->params[i]->type);
+ }
+
+ // the extra stackval is for the return val if necessary
+ // the 64 is for outgoing parameters and the 16 is the frame marker.
+ // the other 16 is space for struct return vals < 16 bytes
+ frame_size = sizeof(MonoInvocation) + (sig->param_count + 1) * sizeof(stackval) + 16 + 64 + 16;
+ frame_size += 15;
+ frame_size &= ~15;
+ invoke_rec_offset = -frame_size;
+ vtoffsets = (int *)alloca(sig->param_count * sizeof(int));
+
+ t = invoke_rec_offset;
+
+ for (i = 0; i < sig->param_count; ++i)
+ if (sig->params[i]->type == MONO_TYPE_VALUETYPE &&
+ !sig->params[i]->data.klass->enumtype && !sig->params[i]->byref) {
+ int size = mono_class_native_size (sig->params[i]->data.klass, NULL);
+ size += 7;
+ size &= ~7;
+ t -= size;
+ frame_size += size;
+ vtoffsets[i] = t;
+ }
+
+ stack_vals_offset = invoke_rec_offset + sizeof(MonoInvocation);
+ stack_vals_offset += 7;
+ stack_vals_offset &= ~7;
+ frame_size += 32;
+ frame_size += 15;
+ frame_size &= ~15;
+ spill_offset = -frame_size + 8;
+
+generate:
+ stack_val_pos = stack_vals_offset;
+ arg_val_pos = -64;
+ pc = 0;
+
+ ADD_INST(code, pc, hppa_std(code, 2, -16, 30));
+ ADD_INST(code, pc, hppa_std_ma(code, 3, frame_size, 30));
+ ADD_INST(code, pc, hppa_std(code, 4, spill_offset, 30));
+ ADD_INST(code, pc, hppa_copy(code, 29, 3));
+ ADD_INST(code, pc, hppa_std(code, 27, spill_offset + 8, 30));
+ ADD_INST(code, pc, hppa_std(code, 28, spill_offset + 16, 30));
+ ADD_INST(code, pc, hppa_nop(code));
+
+ ADD_INST(code, pc, hppa_std(code, 26, -64, 29)); // STD %r26,-64(%r29)
+ ADD_INST(code, pc, hppa_std(code, 25, -56, 29)); // STD %r25,-56(%r29)
+ ADD_INST(code, pc, hppa_std(code, 24, -48, 29)); // STD %r24,-48(%r29)
+ ADD_INST(code, pc, hppa_std(code, 23, -40, 29)); // STD %r23,-40(%r29)
+ ADD_INST(code, pc, hppa_std(code, 22, -32, 29)); // STD %r22,-32(%r29)
+ ADD_INST(code, pc, hppa_std(code, 21, -24, 29)); // STD %r21,-24(%r29)
+ ADD_INST(code, pc, hppa_std(code, 20, -16, 29)); // STD %r20,-16(%r29)
+ ADD_INST(code, pc, hppa_std(code, 19, -8, 29)); // STD %r19,-8(%r29)
+
+ ADD_INST(code, pc, hppa_std(code, 0, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, parent), 30));
+ ADD_INST(code, pc, hppa_std(code, 0, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, ex), 30));
+ ADD_INST(code, pc, hppa_std(code, 0, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, ex_handler), 30));
+ ADD_INST(code, pc, hppa_std(code, 0, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, ip), 30));
+
+ if (data != NULL)
+ data[0] = method;
+ ADD_INST(code, pc, hppa_ldd(code, 0, 27, 19));
+ ADD_INST(code, pc, hppa_std(code, 19, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, method), 30));
+
+ if (sig->hasthis) {
+ if (sig->call_convention != MONO_CALL_THISCALL) {
+ ADD_INST(code, pc, hppa_std(code, arg_reg, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, obj), 30));
+ arg_val_pos += 8;
+ } else {
+ fprintf(stderr, "case I didn't handle 2\n");
+ }
+ }
+
+ if (data != NULL)
+ data[2] = (void *)stackval_from_data;
+
+ for (i = 0; i < sig->param_count; ++i) {
+ if (data != NULL)
+ data[4 + i] = sig->params[i];
+ ADD_INST(code, pc, hppa_ldd(code, (4 + i) * 8, 27, 26)); // LDD x(%r27),%r26 == type
+ ADD_INST(code, pc, hppa_ldo(code, stack_val_pos, 30, 25)); // LDD x(%r30),%r25 == &stackval
+ if (sig->params[i]->byref) {
+ ADD_INST(code, pc, hppa_ldo(code, arg_val_pos, 3, 24));
+ } else {
+ int type = sig->params[i]->type;
+ typeswitch:
+ switch (type) {
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_R8:
+ ADD_INST(code, pc, hppa_ldo(code, arg_val_pos, 3, 24));
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ ADD_INST(code, pc, hppa_ldo(code, arg_val_pos + 4, 3, 24));
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ ADD_INST(code, pc, hppa_ldo(code, arg_val_pos + 6, 3, 24));
+ break;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ ADD_INST(code, pc, hppa_ldo(code, arg_val_pos + 7, 3, 24));
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ type = sig->params [i]->data.klass->enum_basetype->type;
+ goto typeswitch;
+ } else {
+ int size = mono_class_native_size (sig->params[i]->data.klass, NULL);
+ if (size <= 8)
+ ADD_INST(code, pc, hppa_ldo(code, arg_val_pos, 3, 24));
+ else {
+ arg_val_pos += 15;
+ arg_val_pos &= ~15;
+ ADD_INST(code, pc, hppa_ldo(code, arg_val_pos, 3, 24));
+ }
+
+ arg_val_pos += size;
+ arg_val_pos += 7;
+ arg_val_pos &= ~7;
+ arg_val_pos -=8 ; // as it is incremented later
+
+ ADD_INST(code, pc, hppa_ldo(code, vtoffsets[i], 30, 19));
+ ADD_INST(code, pc, hppa_std(code, 19, 0, 25));
+ }
+ break;
+ default:
+ fprintf(stderr, "can not cope in create method pointer %d\n", sig->params[i]->type);
+ break;
+ }
+ }
+
+ ADD_INST(code, pc, hppa_ldo(code, sig->pinvoke, 0, 23)); // LDI sig->pinvoke,%r23
+ ADD_INST(code, pc, hppa_ldd(code, 16, 27, 19)); // LDD x(%r27),%r19 == stackval_from_data
+ ADD_INST(code, pc, hppa_ldd(code, 16, 19, 20)); // LDD 16(%r19),%r20
+ ADD_INST(code, pc, hppa_ldd(code, 24, 19, 27)); // LDD 24(%r19),%r27
+ ADD_INST(code, pc, hppa_blve(code, 20)); // BVE,L (%r20),%r2
+ ADD_INST(code, pc, hppa_ldo(code, -16, 30, 29)); // LDO -16(%r30),%r29
+ ADD_INST(code, pc, hppa_ldd(code, spill_offset + 8, 30, 27));
+
+ stack_val_pos += sizeof (stackval);
+ arg_val_pos += 8;
+ g_assert(stack_val_pos < -96);
+ }
+
+ ADD_INST(code, pc, hppa_ldo(code, stack_vals_offset, 30, 19));
+ ADD_INST(code, pc, hppa_std(code, 19, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, stack_args), 30));
+ ADD_INST(code, pc, hppa_ldo(code, stack_val_pos, 30, 19));
+ ADD_INST(code, pc, hppa_std(code, 19, invoke_rec_offset + G_STRUCT_OFFSET (MonoInvocation, retval), 30));
+
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->data.klass->enumtype) {
+ int size = mono_class_native_size (sig->ret->data.klass, NULL);
+ // for large return structs pass on the pointer given us by our caller.
+ if (size > 16)
+ ADD_INST(code, pc, hppa_ldd(code, spill_offset + 16, 30, 28));
+ else // use space left on stack for the return value
+ ADD_INST(code, pc, hppa_ldo(code, stack_val_pos + sizeof(stackval), 30, 28));
+ ADD_INST(code, pc, hppa_std(code, 28, stack_val_pos, 30));
+ }
+
+ ADD_INST(code, pc, hppa_ldo(code, invoke_rec_offset, 30, 26)); // address of invocation
+
+ if (data != NULL)
+ data[1] = (void *)ves_exec_method;
+ ADD_INST(code, pc, hppa_ldd(code, 8, 27, 19)); // LDD 8(%r27),%r19
+ ADD_INST(code, pc, hppa_ldd(code, 16, 19, 20)); // LDD 16(%r19),%r20
+ ADD_INST(code, pc, hppa_ldd(code, 24, 19, 27)); // LDD 24(%r19),%r27
+ ADD_INST(code, pc, hppa_blve(code, 20)); // BVE,L (%r20),%r2
+ ADD_INST(code, pc, hppa_ldo(code, -16, 30, 29)); // LDO -16(%r30),%r29
+ ADD_INST(code, pc, hppa_ldd(code, spill_offset + 8, 30, 27));
+ if (sig->ret->byref) {
+ fprintf(stderr, "can'ty cope with ret byref\n");
+ } else {
+ int simpletype = sig->ret->type;
+ enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ ADD_INST(code, pc, hppa_ldw(code, stack_val_pos, 30, 28)); // LDW x(%r30),%r28
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ ADD_INST(code, pc, hppa_ldd(code, stack_val_pos, 30, 28)); // LDD x(%r30),%r28
+ break;
+ case MONO_TYPE_R8:
+ ADD_INST(code, pc, hppa_fldd(code, stack_val_pos, 30, 4)); // FLDD x(%r30),%fr4
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ } else {
+ int size = mono_class_native_size (sig->ret->data.klass, NULL);
+ if (size <= 16) {
+ ADD_INST(code, pc, hppa_ldd(code, stack_val_pos, 30, 28));
+ if (size > 8)
+ ADD_INST(code, pc, hppa_ldd(code, 8, 28, 29));
+ ADD_INST(code, pc, hppa_ldd(code, 0, 28, 28));
+ }
+ }
+ break;
+ default:
+ fprintf(stderr, "can't cope with ret type %d\n", simpletype);
+ return NULL;
+ }
+ }
+
+ ADD_INST(code, pc, hppa_ldd(code, -frame_size-16, 30, 2));
+ ADD_INST(code, pc, hppa_ldd(code, spill_offset, 30, 4));
+ ADD_INST(code, pc, hppa_bve(code, 2, 0));
+ ADD_INST(code, pc, hppa_ldd_mb(code, -frame_size, 30, 3));
+ if (code == NULL) {
+ descriptor = (void **)malloc((8 + sig->param_count) * sizeof(void *) + sizeof(unsigned int) * pc);
+ data = descriptor + 4;
+ code = (unsigned int *)(data + 4 + sig->param_count);
+ code_start = code;
+ goto generate;
+ }
+
+ if (debug_asm) {
+ fprintf(stderr, "generated: %d bytes\n", pc * 4);
+ disassemble(code_start, pc);
+ }
+
+ flush_cache(code_start, 4 * pc);
+
+ descriptor[0] = 0;
+ descriptor[1] = 0;
+ descriptor[2] = code_start;
+ descriptor[3] = data;
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = 4; // does this matter?
+ ji->code_start = descriptor;
+
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
+
+ return ji->code_start;
+}
diff --git a/mono/arch/mips/mips-codegen.h b/mono/arch/mips/mips-codegen.h
new file mode 100644
index 00000000000..8cc0cd0bcef
--- /dev/null
+++ b/mono/arch/mips/mips-codegen.h
@@ -0,0 +1,340 @@
+#ifndef __MIPS_CODEGEN_H__
+#define __MIPS_CODEGEN_H__
+/*
+ * Copyright (c) 2004 Novell, Inc
+ * Author: Paolo Molaro (lupus@ximian.com)
+ *
+ */
+
+/* registers */
+enum {
+ mips_zero,
+ mips_at, /* assembler temp */
+ mips_v0, /* return values */
+ mips_v1,
+ mips_a0, /* 4 - func arguments */
+ mips_a1,
+ mips_a2,
+ mips_a3,
+ mips_t0, /* 8 temporaries */
+ mips_t1,
+ mips_t2,
+ mips_t3,
+ mips_t4,
+ mips_t5,
+ mips_t6,
+ mips_t7,
+ mips_s0, /* 16 calle saved */
+ mips_s1,
+ mips_s2,
+ mips_s3,
+ mips_s4,
+ mips_s5,
+ mips_s6,
+ mips_s7,
+ mips_t8, /* 24 temps */
+ mips_t9,
+ mips_k0, /* 26 kernel-reserved */
+ mips_k1,
+ mips_gp, /* 28 */
+ mips_sp, /* stack pointer */
+ mips_fp, /* frame pointer */
+ mips_ra /* return address */
+};
+
+/* we treat the register file as containing just doubles... */
+enum {
+ mips_f0, /* return regs */
+ mips_f2,
+ mips_f4, /* temps */
+ mips_f6,
+ mips_f8,
+ mips_f10,
+ mips_f12, /* first arg */
+ mips_f14, /* second arg */
+ mips_f16, /* temps */
+ mips_f18,
+ mips_f20, /* callee saved */
+ mips_f22,
+ mips_f24,
+ mips_f26,
+ mips_f28,
+ mips_f30
+};
+
+#define mips_emit32(c,x) do { *((unsigned int *) c) = x; ((unsigned int *)c)++;} while (0)
+#define mips_format_i(code,op,rs,rt,imm) mips_emit32 ((code), (((op)<<26)|((rs)<<21)|((rt)<<16)|(imm)))
+#define mips_format_j(code,op,imm) mips_emit32 ((code), (((op)<<26)|(imm)))
+#define mips_format_r(code,op,rs,rt,rd,sa,func) mips_emit32 ((code), (((op)<<26)|((rs)<<21)|((rt)<<16)|((rd)<<11)|((sa)<<6)|(func)))
+#define mips_format_divmul(code,op,src1,src2,fun) mips_emit32 ((code), (((op)<<26)|((src1)<<21)|((src2)<<16)|(fun)))
+
+/* prefetch hints */
+enum {
+ MIPS_FOR_LOAD,
+ MIPS_FOR_STORE,
+ MIPS_FOR_LOAD_STREAMED = 4,
+ MIPS_FOR_STORE_STREAMED,
+ MIPS_FOR_LOAD_RETAINED,
+ MIPS_FOR_STORE_RETAINED
+};
+
+/* coprocessors */
+enum {
+ MIPS_COP0,
+ MIPS_COP1,
+ MIPS_COP2,
+ MIPS_COP3
+};
+
+enum {
+ MIPS_FMT_SINGLE = 16,
+ MIPS_FMT_DOUBLE = 17,
+ MIPS_FMT_WORD = 20,
+ MIPS_FMT_LONG = 21,
+ MIPS_FMT3_SINGLE = 0,
+ MIPS_FMT3_DOUBLE = 1
+};
+
+/* fpu rounding mode */
+enum {
+ MIPS_ROUND_TO_NEAREST,
+ MIPS_ROUND_TO_ZERO,
+ MIPS_ROUND_TO_POSINF,
+ MIPS_ROUND_TO_NEGINF,
+ MIPS_ROUND_MASK = 3
+};
+
+/* fpu enable/cause flags, cc */
+enum {
+ MIPS_FPU_C_MASK = 1 << 23,
+ MIPS_INEXACT = 1,
+ MIPS_UNDERFLOW = 2,
+ MIPS_OVERFLOW = 4,
+ MIPS_DIVZERO = 8,
+ MIPS_INVALID = 16,
+ MIPS_NOTIMPL = 32,
+ MIPS_FPU_FLAGS_OFFSET = 2,
+ MIPS_FPU_ENABLES_OFFSET = 7,
+ MIPS_FPU_CAUSES_OFFSET = 12
+};
+
+/* fpu condition values */
+enum {
+ MIPS_FPU_FALSE, /* TRUE */
+ MIPS_FPU_UNORDERED, /* ORDERED */
+ MIPS_FPU_EQ, /* NOT_EQUAL */
+ MIPS_FPU_UNORD_EQ, /* ORDERED or NEQ */
+ MIPS_FPU_ORD_LT, /* UNORDERED or GE */
+ MIPS_FPU_UNORD_LT, /* ORDERED or GE */
+ MIPS_FPU_ORD_LE, /* UNORDERED or GT */
+ MIPS_FPU_UNORD_LE /* OREDERED or GT */
+};
+
+/* arithmetric ops */
+#define mips_add(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,32)
+#define mips_addi(c,dest,src1,imm) mips_format_i(c,8,src1,dest,imm)
+#define mips_addu(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,33)
+#define mips_addiu(c,dest,src1,imm) mips_format_i(c,9,src1,dest,imm)
+#define mips_dadd(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,44)
+#define mips_daddi(c,dest,src1,imm) mips_format_i(c,24,src1,dest,imm)
+#define mips_daddu(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,45)
+#define mips_daddiu(c,dest,src1,imm) mips_format_i(c,25,src1,dest,imm)
+#define mips_dsub(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,46)
+#define mips_dsubu(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,47)
+#define mips_sub(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,34)
+#define mips_subu(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,35)
+
+/* div and mul ops */
+#define mips_ddiv(c,src1,src2) mips_format_divmul(c,0,src1,src2,30)
+#define mips_ddivu(c,src1,src2) mips_format_divmul(c,0,src1,src2,31)
+#define mips_div(c,src1,src2) mips_format_divmul(c,0,src1,src2,26)
+#define mips_divu(c,src1,src2) mips_format_divmul(c,0,src1,src2,27)
+#define mips_dmult(c,src1,src2) mips_format_divmul(c,0,src1,src2,28)
+#define mips_dmultu(c,src1,src2) mips_format_divmul(c,0,src1,src2,29)
+#define mips_mult(c,src1,src2) mips_format_divmul(c,0,src1,src2,24)
+#define mips_multu(c,src1,src2) mips_format_divmul(c,0,src1,src2,25)
+
+/* shift ops */
+#define mips_dsll(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,56)
+#define mips_dsll32(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,60)
+#define mips_dsllv(c,dest,src1,src2) mips_format_r(c,0,src2,src1,dest,0,20)
+#define mips_dsra(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,59)
+#define mips_dsra32(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,63)
+#define mips_dsrav(c,dest,src1,src2) mips_format_r(c,0,src2,src1,dest,0,23)
+#define mips_dsrl(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,58)
+#define mips_dsrl32(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,62)
+#define mips_dsrlv(c,dest,src1,src2) mips_format_r(c,0,src2,src1,dest,0,22)
+#define mips_sll(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,0)
+#define mips_sllv(c,dest,src1,src2) mips_format_r(c,0,src2,src1,dest,0,4)
+#define mips_sra(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,3)
+#define mips_srav(c,dest,src1,src2) mips_format_r(c,0,src2,src1,dest,0,7)
+#define mips_srl(c,dest,src1,imm) mips_format_r(c,0,0,src1,dest,imm,2)
+#define mips_srlv(c,dest,src1,src2) mips_format_r(c,0,src2,src1,dest,0,6)
+
+/* logical ops */
+#define mips_and(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,36)
+#define mips_andi(c,dest,src1,imm) mips_format_i(c,12,src1,dest,imm)
+#define mips_nor(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,39)
+#define mips_or(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,37)
+#define mips_ori(c,dest,src1,uimm) mips_format_i(c,13,src1,dest,uimm)
+#define mips_xor(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,38)
+#define mips_xori(c,dest,src1,uimm) mips_format_i(c,14,src1,dest,uimm)
+
+/* compares */
+#define mips_slt(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,42)
+#define mips_slti(c,dest,src1,imm) mips_format_i(c,10,src1,dest,imm)
+#define mips_sltiu(c,dest,src1,imm) mips_format_i(c,11,src1,dest,imm)
+#define mips_sltu(c,dest,src1,src2) mips_format_r(c,0,src1,src2,dest,0,43)
+/* missing traps: teq, teqi, tge, tgei, tgeiu, tgeu, tlt, tlti, tltiu, tltu, tne, tnei, */
+
+/* conditional branches */
+#define mips_beq(c,src1,src2,offset) mips_format_i(c,4,src1,src2,offset)
+#define mips_beql(c,src1,src2,offset) mips_format_i(c,20,src1,src2,offset)
+#define mips_bgez(c,src1,offset) mips_format_i(c,1,src1,1,offset)
+#define mips_bgezal(c,src1,offset) mips_format_i(c,1,src1,17,offset)
+#define mips_bgezall(c,src1,offset) mips_format_i(c,1,src1,19,offset)
+#define mips_bgezl(c,src1,offset) mips_format_i(c,1,src1,3,offset)
+#define mips_bgtz(c,src1,offset) mips_format_i(c,7,src1,0,offset)
+#define mips_bgtzl(c,src1,offset) mips_format_i(c,23,src1,0,offset)
+#define mips_blez(c,src1,offset) mips_format_i(c,6,src1,0,offset)
+#define mips_blezl(c,src1,offset) mips_format_i(c,22,src1,0,offset)
+#define mips_bltz(c,src1,offset) mips_format_i(c,1,src1,0,offset)
+#define mips_bltzal(c,src1,offset) mips_format_i(c,1,src1,16,offset)
+#define mips_bltzall(c,src1,offset) mips_format_i(c,1,src1,18,offset)
+#define mips_bltzl(c,src1,offset) mips_format_i(c,1,src1,2,offset)
+#define mips_bne(c,src1,src2,offset) mips_format_i(c,5,src1,src2,offset)
+#define mips_bnel(c,src1,src2,offset) mips_format_i(c,21,src1,src2,offset)
+
+/* uncond branches and calls */
+#define mips_jump(c,target) mips_format_j(c,2,target)
+#define mips_jumpl(c,target) mips_format_j(c,3,target)
+#define mips_jalr(c,src1,retreg) mips_format_r(c,0,src1,0,retreg,0,9)
+#define mips_jr(c,src1) mips_emit32(c,((src1)<<21)|8)
+
+/* loads and stores */
+#define mips_lb(c,dest,base,offset) mips_format_i(c,32,base,dest,offset)
+#define mips_lbu(c,dest,base,offset) mips_format_i(c,36,base,dest,offset)
+#define mips_ld(c,dest,base,offset) mips_format_i(c,55,base,dest,offset)
+#define mips_ldl(c,dest,base,offset) mips_format_i(c,26,base,dest,offset)
+#define mips_ldr(c,dest,base,offset) mips_format_i(c,27,base,dest,offset)
+#define mips_lh(c,dest,base,offset) mips_format_i(c,33,base,dest,offset)
+#define mips_lhu(c,dest,base,offset) mips_format_i(c,37,base,dest,offset)
+#define mips_ll(c,dest,base,offset) mips_format_i(c,48,base,dest,offset)
+#define mips_lld(c,dest,base,offset) mips_format_i(c,52,base,dest,offset)
+#define mips_lui(c,dest,base,uimm) mips_format_i(c,15,base,dest,uimm)
+#define mips_lw(c,dest,base,offset) mips_format_i(c,35,base,dest,offset)
+#define mips_lwl(c,dest,base,offset) mips_format_i(c,34,base,dest,offset)
+#define mips_lwr(c,dest,base,offset) mips_format_i(c,38,base,dest,offset)
+#define mips_lwu(c,dest,base,offset) mips_format_i(c,39,base,dest,offset)
+#define mips_sb(c,src,base,offset) mips_format_i(c,40,base,src,offset)
+#define mips_sc(c,src,base,offset) mips_format_i(c,56,base,src,offset)
+#define mips_scd(c,src,base,offset) mips_format_i(c,60,base,src,offset)
+#define mips_sd(c,src,base,offset) mips_format_i(c,63,base,src,offset)
+#define mips_sdl(c,src,base,offset) mips_format_i(c,44,base,src,offset)
+#define mips_sdr(c,src,base,offset) mips_format_i(c,45,base,src,offset)
+#define mips_sh(c,src,base,offset) mips_format_i(c,41,base,src,offset)
+#define mips_sw(c,src,base,offset) mips_format_i(c,43,base,src,offset)
+#define mips_swl(c,src,base,offset) mips_format_i(c,50,base,src,offset)
+#define mips_swr(c,src,base,offset) mips_format_i(c,54,base,src,offset)
+
+/* misc and coprocessor ops */
+#define mips_move(c,dest,src) mips_add(c,dest,src,mips_zero)
+#define mips_nop(c) mips_sll(c,0,0,0)
+#define mips_break(c,code) mips_emit32(c, ((code)<<6)|13)
+#define mips_mfhi(c,dest) mips_format_r(c,0,0,0,dest,0,16)
+#define mips_mflo(c,dest) mips_format_r(c,0,0,0,dest,0,18)
+#define mips_mthi(c,src) mips_format_r(c,0,src,0,0,0,17)
+#define mips_mtlo(c,src) mips_format_r(c,0,src,0,0,0,19)
+#define mips_movn(c,dest,src,test) mips_format_r(c,0,src,test,dest,0,11)
+#define mips_movz(c,dest,src,test) mips_format_r(c,0,src,test,dest,0,10)
+#define mips_pref(c,hint,base,offset) mips_format_i(c,51,base,hint,offset)
+#define mips_prefidx(c,hint,base,idx) mips_format_r(c,19,base,idx,hint,0,15)
+#define mips_sync(c,stype) mips_emit32(c, ((stype)<<6)|15)
+#define mips_syscall(c,code) mips_emit32(c, ((code)<<6)|12)
+
+#define mips_cop(c,cop,fun) mips_emit32(c, ((16|(cop))<<26)|(fun))
+#define mips_ldc(c,cop,dest,base,offset) mips_format_i(c,(52|(cop)),base,dest,offset)
+#define mips_lwc(c,cop,dest,base,offset) mips_format_i(c,(48|(cop)),base,dest,offset)
+#define mips_sdc(c,cop,src,base,offset) mips_format_i(c,(60|(cop)),base,src,offset)
+#define mips_swc(c,cop,src,base,offset) mips_format_i(c,(56|(cop)),base,src,offset)
+#define mips_cfc1(c,dest,src) mips_format_r(c,17,2,dest,src,0,0)
+#define mips_ctc1(c,dest,src) mips_format_r(c,17,6,dest,src,0,0)
+
+/* fpu ops */
+#define mips_fabss(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,5)
+#define mips_fabsd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,5)
+#define mips_fadds(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_SINGLE,src2,src1,dest,0)
+#define mips_faddd(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_DOUBLE,src2,src1,dest,0)
+#define mips_fdivs(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_SINGLE,src2,src1,dest,3)
+#define mips_fdivd(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_DOUBLE,src2,src1,dest,3)
+#define mips_fmuls(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_SINGLE,src2,src1,dest,2)
+#define mips_fmuld(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_DOUBLE,src2,src1,dest,2)
+#define mips_fnegs(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,7)
+#define mips_fnegd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,7)
+#define mips_fsqrts(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,4)
+#define mips_fsqrtd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,4)
+#define mips_fsubs(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_SINGLE,src2,src1,dest,1)
+#define mips_fsubd(c,dest,src1,src2) mips_format_r(c,17,MIPS_FMT_DOUBLE,src2,src1,dest,1)
+#define mips_madds(c,dest,src1,src2,srcadd) mips_format_r(c,19,srcadd,src2,src1,dest,32|MIPS_FMT_SINGLE)
+#define mips_maddd(c,dest,src1,src2,srcadd) mips_format_r(c,19,srcadd,src2,src1,dest,32|MIPS_FMT_DOUBLE)
+#define mips_nmadds(c,dest,src1,src2,srcadd) mips_format_r(c,19,srcadd,src2,src1,dest,48|MIPS_FMT_SINGLE)
+#define mips_nmaddd(c,dest,src1,src2,srcadd) mips_format_r(c,19,srcadd,src2,src1,dest,48|MIPS_FMT_DOUBLE)
+#define mips_msubs(c,dest,src1,src2,srcsub) mips_format_r(c,19,srcsub,src2,src1,dest,40|MIPS_FMT_SINGLE)
+#define mips_msubd(c,dest,src1,src2,srcsub) mips_format_r(c,19,srcsub,src2,src1,dest,40|MIPS_FMT_DOUBLE)
+#define mips_nmsubs(c,dest,src1,src2,srcsub) mips_format_r(c,19,srcsub,src2,src1,dest,56|MIPS_FMT_SINGLE)
+#define mips_nmsubd(c,dest,src1,src2,srcsub) mips_format_r(c,19,srcsub,src2,src1,dest,56|MIPS_FMT_DOUBLE)
+
+/* fp compare and branch */
+#define mips_fcmps(c,cond,src1,src2) mips_format_r(c,17,MIPS_FMT_SINGLE,src2,src1,0,(3<<4)|(cond))
+#define mips_fcmpd(c,cond,src1,src2) mips_format_r(c,17,MIPS_FMT_DOUBLE,src2,src1,0,(3<<4)|(cond))
+#define mips_fbfalse(c,offset) mips_format_i(c,17,8,0,offset)
+#define mips_fbfalsel(c,offset) mips_format_i(c,17,8,2,offset)
+#define mips_fbtrue(c,offset) mips_format_i(c,17,8,1,offset)
+#define mips_fbtruel(c,offset) mips_format_i(c,17,8,3,offset)
+
+/* fp convert */
+#define mips_ceills(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,10)
+#define mips_ceilld(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,10)
+#define mips_ceilws(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,14)
+#define mips_ceilwd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,14)
+#define mips_cvtds(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,33)
+#define mips_cvtdw(c,dest,src) mips_format_r(c,17,MIPS_FMT_WORD,0,src,dest,33)
+#define mips_cvtdl(c,dest,src) mips_format_r(c,17,MIPS_FMT_LONG,0,src,dest,33)
+#define mips_cvtls(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,37)
+#define mips_cvtld(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,37)
+#define mips_cvtsd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,32)
+#define mips_cvtsw(c,dest,src) mips_format_r(c,17,MIPS_FMT_WORD,0,src,dest,32)
+#define mips_cvtsl(c,dest,src) mips_format_r(c,17,MIPS_FMT_LONG,0,src,dest,32)
+#define mips_cvtws(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,36)
+#define mips_cvtwd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,36)
+#define mips_floorls(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,11)
+#define mips_floorld(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,11)
+#define mips_floorws(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,15)
+#define mips_floorwd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,15)
+#define mips_roundls(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,8)
+#define mips_roundld(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,8)
+#define mips_roundws(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,12)
+#define mips_roundwd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,12)
+#define mips_truncls(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,9)
+#define mips_truncld(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,9)
+#define mips_truncws(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,13)
+#define mips_truncwd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,13)
+
+/* fp moves, loads */
+#define mips_fmovs(c,dest,src) mips_format_r(c,17,MIPS_FMT_SINGLE,0,src,dest,6)
+#define mips_fmovd(c,dest,src) mips_format_r(c,17,MIPS_FMT_DOUBLE,0,src,dest,6)
+#define mips_wmovfc1(c,dest,src) mips_format_r(c,17,0,dest,src,0,0)
+#define mips_wmovtc1(c,dest,src) mips_format_r(c,17,4,src,dest,0,0)
+#define mips_dmovfc1(c,dest,src) mips_format_r(c,17,1,0,dest,src,0,0)
+#define mips_dmovtc1(c,dest,src) mips_format_r(c,17,1,0,src,dest,0,0)
+#define mips_ldc1(c,dest,base,offset) mips_ldc(c,1,dest,base,offset)
+#define mips_ldxc1(c,dest,base,idx) mips_format_r(c,19,base,idx,0,dest,1)
+#define mips_lwc1(c,dest,base,offset) mips_lwc(c,1,dest,base,offset)
+#define mips_lwxc1(c,dest,base,idx) mips_format_r(c,19,base,idx,0,dest,0)
+#define mips_sdc1(c,src,base,offset) mips_sdc(c,1,src,base,offset)
+#define mips_sdxc1(c,src,base,idx) mips_format_r(c,19,base,idx,src,0,9)
+#define mips_swc1(c,src,base,offset) mips_swc(c,1,src,base,offset)
+#define mips_swxc1(c,src,base,idx) mips_format_r(c,19,base,idx,src,0,8)
+
+#endif /* __MIPS_CODEGEN_H__ */
+
diff --git a/mono/arch/mips/test.c b/mono/arch/mips/test.c
new file mode 100644
index 00000000000..d83f833f27e
--- /dev/null
+++ b/mono/arch/mips/test.c
@@ -0,0 +1,149 @@
+#include "mips-codegen.h"
+#include <stdlib.h>
+
+int main () {
+ unsigned int *code, * p;
+
+ code = p = malloc (sizeof (int) * 1024);
+
+ mips_add (p, 3, 4, 5);
+ mips_addi (p, 3, 4, 5);
+ mips_addu (p, 3, 4, 5);
+ mips_addiu (p, 3, 4, 5);
+ mips_sub (p, 3, 4, 5);
+ mips_subu (p, 3, 4, 5);
+ mips_dadd (p, 3, 4, 5);
+ mips_daddi (p, 3, 4, 5);
+ mips_daddu (p, 3, 4, 5);
+ mips_daddiu (p, 3, 4, 5);
+ mips_dsub (p, 3, 4, 5);
+ mips_dsubu (p, 3, 4, 5);
+
+ mips_mult (p, 6, 7);
+ mips_multu (p, 6, 7);
+ mips_div (p, 6, 7);
+ mips_divu (p, 6, 7);
+ mips_dmult (p, 6, 7);
+ mips_dmultu (p, 6, 7);
+ mips_ddiv (p, 6, 7);
+ mips_ddivu (p, 6, 7);
+
+ mips_sll (p, 3, 4, 5);
+ mips_sllv (p, 3, 4, 5);
+ mips_sra (p, 3, 4, 5);
+ mips_srav (p, 3, 4, 5);
+ mips_srl (p, 3, 4, 5);
+ mips_srlv (p, 3, 4, 5);
+ mips_dsll (p, 3, 4, 5);
+ mips_dsll32 (p, 3, 4, 5);
+ mips_dsllv (p, 3, 4, 5);
+ mips_dsra (p, 3, 4, 5);
+ mips_dsra32 (p, 3, 4, 5);
+ mips_dsrav (p, 3, 4, 5);
+ mips_dsrl (p, 3, 4, 5);
+ mips_dsrl32 (p, 3, 4, 5);
+ mips_dsrlv (p, 3, 4, 5);
+
+ mips_and (p, 8, 9, 10);
+ mips_andi (p, 8, 9, 10);
+ mips_nor (p, 8, 9, 10);
+ mips_or (p, 8, 9, 10);
+ mips_ori (p, 8, 9, 10);
+ mips_xor (p, 8, 9, 10);
+ mips_xori (p, 8, 9, 10);
+
+ mips_slt (p, 8, 9, 10);
+ mips_slti (p, 8, 9, 10);
+ mips_sltu (p, 8, 9, 10);
+ mips_sltiu (p, 8, 9, 10);
+
+ mips_beq (p, 8, 9, 0xff1f);
+ mips_beql (p, 8, 9, 0xff1f);
+ mips_bne (p, 8, 9, 0xff1f);
+ mips_bnel (p, 8, 9, 0xff1f);
+ mips_bgez (p, 11, 0xff1f);
+ mips_bgezal (p, 11, 0xff1f);
+ mips_bgezall (p, 11, 0xff1f);
+ mips_bgezl (p, 11, 0xff1f);
+ mips_bgtz (p, 11, 0xff1f);
+ mips_bgtzl (p, 11, 0xff1f);
+ mips_blez (p, 11, 0xff1f);
+ mips_blezl (p, 11, 0xff1f);
+ mips_bltz (p, 11, 0xff1f);
+ mips_bltzal (p, 11, 0xff1f);
+ mips_bltzall (p, 11, 0xff1f);
+ mips_bltzl (p, 11, 0xff1f);
+
+ mips_jump (p, 0xff1f);
+ mips_jumpl (p, 0xff1f);
+ mips_jalr (p, 12, mips_ra);
+ mips_jr (p, 12);
+
+ mips_lb (p, 13, 14, 128);
+ mips_lbu (p, 13, 14, 128);
+ mips_ld (p, 13, 14, 128);
+ mips_ldl (p, 13, 14, 128);
+ mips_ldr (p, 13, 14, 128);
+ mips_lh (p, 13, 14, 128);
+ mips_lhu (p, 13, 14, 128);
+ mips_ll (p, 13, 14, 128);
+ mips_lld (p, 13, 14, 128);
+ mips_lui (p, 13, 14, 128);
+ mips_lw (p, 13, 14, 128);
+ mips_lwl (p, 13, 14, 128);
+ mips_lwr (p, 13, 14, 128);
+ mips_lwu (p, 13, 14, 128);
+ mips_sb (p, 13, 14, 128);
+ mips_sc (p, 13, 14, 128);
+ mips_scd (p, 13, 14, 128);
+ mips_sd (p, 13, 14, 128);
+ mips_sdl (p, 13, 14, 128);
+ mips_sdr (p, 13, 14, 128);
+ mips_sh (p, 13, 14, 128);
+ mips_sw (p, 13, 14, 128);
+ mips_swl (p, 13, 14, 128);
+ mips_swr (p, 13, 14, 128);
+
+ mips_move (p, 15, 16);
+ mips_nop (p);
+ mips_break (p, 0);
+ mips_sync (p, 0);
+ mips_mfhi (p, 17);
+ mips_mflo (p, 17);
+ mips_mthi (p, 17);
+ mips_mtlo (p, 17);
+
+ mips_fabsd (p, 16, 18);
+ mips_fnegd (p, 16, 18);
+ mips_fsqrtd (p, 16, 18);
+ mips_faddd (p, 16, 18, 20);
+ mips_fdivd (p, 16, 18, 20);
+ mips_fmuld (p, 16, 18, 20);
+ mips_fsubd (p, 16, 18, 20);
+
+ mips_fcmpd (p, MIPS_FPU_EQ, 18, 20);
+ mips_fbfalse (p, 0xff1f);
+ mips_fbfalsel (p, 0xff1f);
+ mips_fbtrue (p, 0xff1f);
+ mips_fbtruel (p, 0xff1f);
+
+ mips_ceilwd (p, 20, 22);
+ mips_ceilld (p, 20, 22);
+ mips_floorwd (p, 20, 22);
+ mips_floorld (p, 20, 22);
+ mips_roundwd (p, 20, 22);
+ mips_roundld (p, 20, 22);
+ mips_truncwd (p, 20, 22);
+ mips_truncld (p, 20, 22);
+ mips_cvtdw (p, 20, 22);
+ mips_cvtds (p, 20, 22);
+ mips_cvtdl (p, 20, 22);
+ mips_cvtld (p, 20, 22);
+ mips_cvtsd (p, 20, 22);
+ mips_cvtwd (p, 20, 22);
+
+ mips_fmovd (p, 20, 22);
+ printf ("size: %d\n", p - code);
+
+ return 0;
+}
diff --git a/mono/arch/ppc/ppc-codegen.h b/mono/arch/ppc/ppc-codegen.h
index c3f79b2e437..27c8690b54a 100644
--- a/mono/arch/ppc/ppc-codegen.h
+++ b/mono/arch/ppc/ppc-codegen.h
@@ -1,15 +1,18 @@
/*
Copyright (C) 2001 Radek Doulik
+
+ for testing do the following: ./test | as -o test.o
*/
-#ifndef PPC_H
-#define PPC_H
+#ifndef __MONO_PPC_CODEGEN_H__
+#define __MONO_PPC_CODEGEN_H__
#include <glib.h>
#include <assert.h>
typedef enum {
ppc_r0 = 0,
ppc_r1,
+ ppc_sp = ppc_r1,
ppc_r2,
ppc_r3,
ppc_r4,
@@ -79,14 +82,54 @@ typedef enum {
typedef enum {
ppc_lr = 256,
+ ppc_ctr = 256 + 32,
+ ppc_xer = 32
} PPCSpecialRegister;
-#define ppc_emit32(c,x) *((guint32 *) c) = x; ((guint32 *)c)++
+enum {
+ /* B0 operand for branches */
+ PPC_BR_LIKELY = 1, /* can be or'ed with the conditional variants */
+ PPC_BR_FALSE = 4,
+ PPC_BR_TRUE = 12,
+ PPC_BR_ALWAYS = 20,
+ /* B1 operand for branches */
+ PPC_BR_LT = 0,
+ PPC_BR_GT = 1,
+ PPC_BR_EQ = 2,
+ PPC_BR_SO = 3
+};
+
+enum {
+ PPC_TRAP_LT = 1,
+ PPC_TRAP_GT = 2,
+ PPC_TRAP_EQ = 4,
+ PPC_TRAP_LT_UN = 8,
+ PPC_TRAP_GT_UN = 16,
+ PPC_TRAP_LE = 1 + PPC_TRAP_EQ,
+ PPC_TRAP_GE = 2 + PPC_TRAP_EQ,
+ PPC_TRAP_LE_UN = 8 + PPC_TRAP_EQ,
+ PPC_TRAP_GE_UN = 16 + PPC_TRAP_EQ
+};
+
+#define ppc_emit32(c,x) do { *((guint32 *) (c)) = x; (c) = (char *)(c) + sizeof (guint32);} while (0)
+
+#define ppc_is_imm16(val) ((gint)(val) >= (gint)-(1<<15) && (gint)(val) <= (gint)((1<<15)-1))
+#define ppc_is_uimm16(val) ((gint)(val) >= 0 && (gint)(val) <= 65535)
+#define ppc_load(c,D,v) do { \
+ if (ppc_is_imm16 ((v))) { \
+ ppc_li ((c), (D), (guint16)(v)); \
+ } else { \
+ ppc_lis ((c), (D), (guint32)(v) >> 16); \
+ ppc_ori ((c), (D), (D), (guint32)(v) & 0xffff); \
+ } \
+ } while (0)
+
+#define ppc_break(c) ppc_tw((c),31,0,0)
#define ppc_addi(c,D,A,d) ppc_emit32 (c, (14 << 26) | ((D) << 21) | ((A) << 16) | (guint16)(d))
#define ppc_addis(c,D,A,d) ppc_emit32 (c, (15 << 26) | ((D) << 21) | ((A) << 16) | (guint16)(d))
-#define ppc_li(c,D,v) ppc_addi (c, D, 0, v);
-#define ppc_lis(c,D,v) ppc_addis (c, D, 0, v);
+#define ppc_li(c,D,v) ppc_addi (c, D, 0, (guint16)(v));
+#define ppc_lis(c,D,v) ppc_addis (c, D, 0, (guint16)(v));
#define ppc_lwz(c,D,d,a) ppc_emit32 (c, (32 << 26) | ((D) << 21) | ((a) << 16) | (guint16)(d))
#define ppc_lhz(c,D,d,a) ppc_emit32 (c, (40 << 26) | ((D) << 21) | ((a) << 16) | (guint16)(d))
#define ppc_lbz(c,D,d,a) ppc_emit32 (c, (34 << 26) | ((D) << 21) | ((a) << 16) | (guint16)(d))
@@ -101,8 +144,13 @@ typedef enum {
#define ppc_mflr(c,D) ppc_mfspr (c, D, ppc_lr)
#define ppc_mtspr(c,spr,S) ppc_emit32 (c, (31 << 26) | ((S) << 21) | ((spr) << 11) | (467 << 1))
#define ppc_mtlr(c,S) ppc_mtspr (c, ppc_lr, S)
+#define ppc_mtctr(c,S) ppc_mtspr (c, ppc_ctr, S)
+#define ppc_mtxer(c,S) ppc_mtspr (c, ppc_xer, S)
#define ppc_b(c,li) ppc_emit32 (c, (18 << 26) | ((li) << 2))
+#define ppc_bl(c,li) ppc_emit32 (c, (18 << 26) | ((li) << 2) | 1)
+#define ppc_ba(c,li) ppc_emit32 (c, (18 << 26) | ((li) << 2) | 2)
+#define ppc_bla(c,li) ppc_emit32 (c, (18 << 26) | ((li) << 2) | 3)
#define ppc_blrl(c) ppc_emit32 (c, 0x4e800021)
#define ppc_blr(c) ppc_emit32 (c, 0x4e800020)
@@ -111,5 +159,481 @@ typedef enum {
#define ppc_stfs(c,S,d,a) ppc_emit32 (c, (52 << 26) | ((S) << 21) | ((a) << 16) | (guint16)(d))
#define ppc_stfd(c,S,d,a) ppc_emit32 (c, (54 << 26) | ((S) << 21) | ((a) << 16) | (guint16)(d))
+/***********************************************************************
+The macros below were tapped out by Christopher Taylor <ct_AT_clemson_DOT_edu>
+from 18 November 2002 to 19 December 2002.
+
+Special thanks to rodo, lupus, dietmar, miguel, and duncan for patience,
+and motivation.
+
+The macros found in this file are based on the assembler instructions found
+in Motorola and Digital DNA's:
+
+"Programming Enviornments Manual For 32-bit Implementations of the PowerPC Architecture"
+
+MPCFPE32B/AD
+12/2001
+REV2
+
+see pages 326 - 524 for detailed information regarding each instruction
+
+Also see the "Ximian Copyright Agreement, 2002" for more information regarding
+my and Ximian's copyright to this code. ;)
+*************************************************************************/
+
+#define ppc_addx(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | ((D) << 21) | ((A) << 16) | ((B) << 11) | (OE << 10) | (266 << 1) | Rc)
+#define ppc_add(c,D,A,B) ppc_addx(c,D,A,B,0,0)
+#define ppc_addd(c,D,A,B) ppc_addx(c,D,A,B,0,1)
+#define ppc_addo(c,D,A,B) ppc_addx(c,D,A,B,1,0)
+#define ppc_addod(c,D,A,B) ppc_addx(c,D,A,B,1,1)
+
+#define ppc_addcx(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | ((D) << 21) | ((A) << 16) | ((B) << 11) | (OE << 10) | (10 << 1) | Rc)
+#define ppc_addc(c,D,A,B) ppc_addcx(c,D,A,B,0,0)
+#define ppc_addcd(c,D,A,B) ppc_addcx(c,D,A,B,0,1)
+#define ppc_addco(c,D,A,B) ppc_addcx(c,D,A,B,1,0)
+#define ppc_addcod(c,D,A,B) ppc_addcx(c,D,A,B,1,1)
+
+#define ppc_addex(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | ((D) << 21) | ((A) << 16) | ((B) << 11) | (OE << 10) | (138 << 1) | Rc)
+#define ppc_adde(c,D,A,B) ppc_addex(c,D,A,B,0,0)
+#define ppc_added(c,D,A,B) ppc_addex(c,D,A,B,0,1)
+#define ppc_addeo(c,D,A,B) ppc_addex(c,D,A,B,1,0)
+#define ppc_addeod(c,D,A,B) ppc_addex(c,D,A,B,1,1)
+
+#define ppc_addic(c,D,A,d) ppc_emit32(c, (12 << 26) | ((D) << 21) | ((A) << 16) | (guint16)(d))
+#define ppc_addicd(c,D,A,d) ppc_emit32(c, (13 << 26) | ((D) << 21) | ((A) << 16) | (guint16)(d))
+
+#define ppc_addmex(c,D,A,OE,RC) ppc_emit32(c, (31 << 26) | ((D) << 21 ) | ((A) << 16) | (0 << 11) | ((OE) << 10) | (234 << 1) | RC)
+#define ppc_addme(c,D,A) ppc_addmex(c,D,A,0,0)
+#define ppc_addmed(c,D,A) ppc_addmex(c,D,A,0,1)
+#define ppc_addmeo(c,D,A) ppc_addmex(c,D,A,1,0)
+#define ppc_addmeod(c,D,A) ppc_addmex(c,D,A,1,1)
+
+#define ppc_addzex(c,D,A,OE,RC) ppc_emit32(c, (31 << 26) | ((D) << 21 ) | ((A) << 16) | (0 << 11) | ((OE) << 10) | (202 << 1) | RC)
+#define ppc_addze(c,D,A) ppc_addzex(c,D,A,0,0)
+#define ppc_addzed(c,D,A) ppc_addzex(c,D,A,0,1)
+#define ppc_addzeo(c,D,A) ppc_addzex(c,D,A,1,0)
+#define ppc_addzeod(c,D,A) ppc_addzex(c,D,A,1,1)
+
+#define ppc_andx(c,S,A,B,RC) ppc_emit32(c, (31 << 26) | ((S) << 21 ) | ((A) << 16) | ((B) << 11) | (28 << 1) | RC)
+#define ppc_and(c,S,A,B) ppc_andx(c,S,A,B,0)
+#define ppc_andd(c,S,A,B) ppc_andx(c,S,A,B,1)
+
+#define ppc_andcx(c,S,A,B,RC) ppc_emit32(c, (31 << 26) | ((S) << 21 ) | ((A) << 16) | ((B) << 11) | (60 << 1) | RC)
+#define ppc_andc(c,S,A,B) ppc_andcx(c,S,A,B,0)
+#define ppc_andcd(c,S,A,B) ppc_andcx(c,S,A,B,1)
+
+#define ppc_andid(c,S,A,d) ppc_emit32(c, (28 << 26) | ((S) << 21 ) | ((A) << 16) | ((guint16)(d)))
+#define ppc_andisd(c,S,A,d) ppc_emit32(c, (29 << 26) | ((S) << 21 ) | ((A) << 16) | ((guint16)(d)))
+
+#define ppc_bcx(c,BO,BI,BD,AA,LK) ppc_emit32(c, (16 << 26) | (BO << 21 )| (BI << 16) | (BD << 2) | ((AA) << 1) | LK)
+#define ppc_bc(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,0,0)
+#define ppc_bca(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,1,0)
+#define ppc_bcl(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,0,1)
+#define ppc_bcla(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,1,1)
+
+#define ppc_bcctrx(c,BO,BI,LK) ppc_emit32(c, (19 << 26) | (BO << 21 )| (BI << 16) | (0 << 11) | (528 << 1) | LK)
+#define ppc_bcctr(c,BO,BI) ppc_bcctrx(c,BO,BI,0)
+#define ppc_bcctrl(c,BO,BI) ppc_bcctrx(c,BO,BI,1)
+
+#define ppc_bnectrp(c,BO,BI) ppc_bcctr(c,BO,BI)
+#define ppc_bnectrlp(c,BO,BI) ppc_bcctr(c,BO,BI)
+
+#define ppc_bclrx(c,BO,BI,LK) ppc_emit32(c, (19 << 26) | (BO << 21 )| (BI << 16) | (0 << 11) | (16 << 1) | LK)
+#define ppc_bclr(c,BO,BI) ppc_bclrx(c,BO,BI,0)
+#define ppc_bclrl(c,BO,BI) ppc_bclrx(c,BO,BI,1)
+
+#define ppc_bnelrp(c,BO,BI) ppc_bclr(c,BO,BI)
+#define ppc_bnelrlp(c,BO,BI) ppc_bclr(c,BO,BI)
+
+#define ppc_cmp(c,cfrD,L,A,B) ppc_emit32(c, (31 << 26) | (cfrD << 23) | (0 << 22) | (L << 21) | (A << 16) | (B << 11) | (0x00000 << 1) | 0 )
+#define ppc_cmpi(c,cfrD,L,A,B) ppc_emit32(c, (11 << 26) | (cfrD << 23) | (0 << 22) | (L << 21) | (A << 16) | (guint16)(B))
+#define ppc_cmpl(c,cfrD,L,A,B) ppc_emit32(c, (31 << 26) | (cfrD << 23) | (0 << 22) | (L << 21) | (A << 16) | (B << 11) | (32 << 1) | 0 )
+#define ppc_cmpli(c,cfrD,L,A,B) ppc_emit32(c, (10 << 26) | (cfrD << 23) | (0 << 22) | (L << 21) | (A << 16) | (guint16)(B))
+
+#define ppc_cntlzwx(c,S,A,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (0 << 11) | (26 << 1) | Rc)
+#define ppc_cntlzw(c,S,A) ppc_cntlzwx(c,S,A,0)
+#define ppc_cntlzwd(c,S,A) ppc_cntlzwx(c,S,A,1)
+
+#define ppc_crand(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (257 << 1) | 0)
+#define ppc_crandc(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (129 << 1) | 0)
+#define ppc_creqv(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (289 << 1) | 0)
+#define ppc_crnand(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (225 << 1) | 0)
+#define ppc_crnor(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (33 << 1) | 0)
+#define ppc_cror(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (449 << 1) | 0)
+#define ppc_crorc(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (417 << 1) | 0)
+#define ppc_crxor(c,D,A,B) ppc_emit32(c, (19 << 26) | (D << 21) | (A << 16) | (B << 11) | (193 << 1) | 0)
+
+#define ppc_dcba(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (758 << 1) | 0)
+#define ppc_dcbf(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (86 << 1) | 0)
+#define ppc_dcbi(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (470 << 1) | 0)
+#define ppc_dcbst(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (54 << 1) | 0)
+#define ppc_dcbt(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (278 << 1) | 0)
+#define ppc_dcbtst(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (246 << 1) | 0)
+#define ppc_dcbz(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (1014 << 1) | 0)
+
+#define ppc_divwx(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (OE << 10) | (491 << 1) | Rc)
+#define ppc_divw(c,D,A,B) ppc_divwx(c,D,A,B,0,0)
+#define ppc_divwd(c,D,A,B) ppc_divwx(c,D,A,B,0,1)
+#define ppc_divwo(c,D,A,B) ppc_divwx(c,D,A,B,1,0)
+#define ppc_divwod(c,D,A,B) ppc_divwx(c,D,A,B,1,1)
+
+#define ppc_divwux(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (OE << 10) | (459 << 1) | Rc)
+#define ppc_divwu(c,D,A,B) ppc_divwux(c,D,A,B,0,0)
+#define ppc_divwud(c,D,A,B) ppc_divwux(c,D,A,B,0,1)
+#define ppc_divwuo(c,D,A,B) ppc_divwux(c,D,A,B,1,0)
+#define ppc_divwuod(c,D,A,B) ppc_divwux(c,D,A,B,1,1)
+
+#define ppc_eciwx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (310 << 1) | 0)
+#define ppc_ecowx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (438 << 1) | 0)
+#define ppc_eieio(c) ppc_emit32(c, (31 << 26) | (0 << 21) | (0 << 16) | (0 << 11) | (854 << 1) | 0)
+
+#define ppc_eqvx(c,A,S,B,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (284 << 1) | Rc)
+#define ppc_eqv(c,A,S,B) ppc_eqvx(c,A,S,B,0)
+#define ppc_eqvd(c,A,S,B) ppc_eqvx(c,A,S,B,1)
+
+#define ppc_extsbx(c,A,S,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (0 << 11) | (954 << 1) | Rc)
+#define ppc_extsb(c,A,S) ppc_extsbx(c,A,S,0)
+#define ppc_extsbd(c,A,S) ppc_extsbx(c,A,S,1)
+
+#define ppc_extshx(c,A,S,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (0 << 11) | (922 << 1) | Rc)
+#define ppc_extsh(c,A,S) ppc_extshx(c,A,S,0)
+#define ppc_extshd(c,A,S) ppc_extshx(c,A,S,1)
+
+#define ppc_fabsx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (264 << 1) | Rc)
+#define ppc_fabs(c,D,B) ppc_fabsx(c,D,B,0)
+#define ppc_fabsd(c,D,B) ppc_fabsx(c,D,B,1)
+
+#define ppc_faddx(c,D,A,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 6) | (21 << 1) | Rc)
+#define ppc_fadd(c,D,A,B) ppc_faddx(c,D,A,B,0)
+#define ppc_faddd(c,D,A,B) ppc_faddx(c,D,A,B,1)
+
+#define ppc_faddsx(c,D,A,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 6) | (21 << 1) | Rc)
+#define ppc_fadds(c,D,A,B) ppc_faddsx(c,D,A,B,0)
+#define ppc_faddsd(c,D,A,B) ppc_faddsx(c,D,A,B,1)
+
+#define ppc_fcmpo(c,crfD,A,B) ppc_emit32(c, (63 << 26) | (crfD << 23) | (0 << 21) | (A << 16) | (B << 11) | (32 << 1) | 0)
+#define ppc_fcmpu(c,crfD,A,B) ppc_emit32(c, (63 << 26) | (crfD << 23) | (0 << 21) | (A << 16) | (B << 11) | (0 << 1) | 0)
+
+#define ppc_fctiwx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (14 << 1) | Rc)
+#define ppc_fctiw(c,D,B) ppc_fctiwx(c,D,B,0)
+#define ppc_fctiwd(c,D,B) ppc_fctiwx(c,D,B,1)
+
+#define ppc_fctiwzx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (15 << 1) | Rc)
+#define ppc_fctiwz(c,D,B) ppc_fctiwzx(c,D,B,0)
+#define ppc_fctiwzd(c,D,B) ppc_fctiwzx(c,D,B,1)
+
+#define ppc_fdivx(c,D,A,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 6) | (18 << 1) | Rc)
+#define ppc_fdiv(c,D,A,B) ppc_fdivx(c,D,A,B,0)
+#define ppc_fdivd(c,D,A,B) ppc_fdivx(c,D,A,B,1)
+
+#define ppc_fdivsx(c,D,A,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 6) | (18 << 1) | Rc)
+#define ppc_fdivs(c,D,A,B) ppc_fdivsx(c,D,A,B,0)
+#define ppc_fdivsd(c,D,A,B) ppc_fdivsx(c,D,A,B,1)
+
+#define ppc_fmaddx(c,D,A,B,C,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (29 << 1) | Rc)
+#define ppc_fmadd(c,D,A,B,C) ppc_fmaddx(c,D,A,B,C,0)
+#define ppc_fmaddd(c,D,A,B,C) ppc_fmaddx(c,D,A,B,C,1)
+
+#define ppc_fmaddsx(c,D,A,B,C,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (29 << 1) | Rc)
+#define ppc_fmadds(c,D,A,B,C) ppc_fmaddsx(c,D,A,B,C,0)
+#define ppc_fmaddsd(c,D,A,B,C) ppc_fmaddsx(c,D,A,B,C,1)
+
+#define ppc_fmrx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (72 << 1) | Rc)
+#define ppc_fmr(c,D,B) ppc_fmrx(c,D,B,0)
+#define ppc_fmrd(c,D,B) ppc_fmrx(c,D,B,1)
+
+#define ppc_fmsubx(c,D,A,C,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (28 << 1) | Rc)
+#define ppc_fmsub(c,D,A,C,B) ppc_fmsubx(c,D,A,C,B,0)
+#define ppc_fmsubd(c,D,A,C,B) ppc_fmsubx(c,D,A,C,B,1)
+
+#define ppc_fmsubsx(c,D,A,C,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (28 << 1) | Rc)
+#define ppc_fmsubs(c,D,A,C,B) ppc_fmsubsx(c,D,A,C,B,0)
+#define ppc_fmsubsd(c,D,A,C,B) ppc_fmsubsx(c,D,A,C,B,1)
+
+#define ppc_fmulx(c,D,A,C,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (0 << 11) | (C << 6) | (25 << 1) | Rc)
+#define ppc_fmul(c,D,A,C) ppc_fmulx(c,D,A,C,0)
+#define ppc_fmuld(c,D,A,C) ppc_fmulx(c,D,A,C,1)
+
+#define ppc_fmulsx(c,D,A,C,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (0 << 11) | (C << 6) | (25 << 1) | Rc)
+#define ppc_fmuls(c,D,A,C) ppc_fmulsx(c,D,A,C,0)
+#define ppc_fmulsd(c,D,A,C) ppc_fmulsx(c,D,A,C,1)
+
+#define ppc_fnabsx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (136 << 1) | Rc)
+#define ppc_fnabs(c,D,B) ppc_fnabsx(c,D,B,0)
+#define ppc_fnabsd(c,D,B) ppc_fnabsx(c,D,B,1)
+
+#define ppc_fnegx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (40 << 1) | Rc)
+#define ppc_fneg(c,D,B) ppc_fnegx(c,D,B,0)
+#define ppc_fnegd(c,D,B) ppc_fnegx(c,D,B,1)
+
+#define ppc_fnmaddx(c,D,A,C,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (31 << 1) | Rc)
+#define ppc_fnmadd(c,D,A,C,B) ppc_fnmaddx(c,D,A,C,B,0)
+#define ppc_fnmaddd(c,D,A,C,B) ppc_fnmaddx(c,D,A,C,B,1)
+
+#define ppc_fnmaddsx(c,D,A,C,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (31 << 1) | Rc)
+#define ppc_fnmadds(c,D,A,C,B) ppc_fnmaddsx(c,D,A,C,B,0)
+#define ppc_fnmaddsd(c,D,A,C,B) ppc_fnmaddsx(c,D,A,C,B,1)
+
+#define ppc_fnmsubx(c,D,A,C,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (30 << 1) | Rc)
+#define ppc_fnmsub(c,D,A,C,B) ppc_fnmsubx(c,D,A,C,B,0)
+#define ppc_fnmsubd(c,D,A,C,B) ppc_fnmsubx(c,D,A,C,B,1)
+
+#define ppc_fnmsubsx(c,D,A,C,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (30 << 1) | Rc)
+#define ppc_fnmsubs(c,D,A,C,B) ppc_fnmsubsx(c,D,A,C,B,0)
+#define ppc_fnmsubsd(c,D,A,C,B) ppc_fnmsubsx(c,D,A,C,B,1)
+
+#define ppc_fresx(c,D,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (0 << 16) | (B << 11) | (0 << 6) | (24 << 1) | Rc)
+#define ppc_fres(c,D,B) ppc_fresx(c,D,B,0)
+#define ppc_fresd(c,D,B) ppc_fresx(c,D,B,1)
+
+#define ppc_frspx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (12 << 1) | Rc)
+#define ppc_frsp(c,D,B) ppc_frspx(c,D,B,0)
+#define ppc_frspd(c,D,B) ppc_frspx(c,D,B,1)
+
+#define ppc_frsqrtex(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (0 << 6) | (26 << 1) | Rc)
+#define ppc_frsqrte(c,D,B) ppc_frsqrtex(c,D,B,0)
+#define ppc_frsqrted(c,D,B) ppc_frsqrtex(c,D,B,1)
+
+#define ppc_fselx(c,D,A,C,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (23 << 1) | Rc)
+#define ppc_fsel(c,D,A,C,B) ppc_fselx(c,D,A,C,B,0)
+#define ppc_fseld(c,D,A,C,B) ppc_fselx(c,D,A,C,B,1)
+
+#define ppc_fsqrtx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (0 << 6) | (22 << 1) | Rc)
+#define ppc_fsqrt(c,D,B) ppc_fsqrtx(c,D,B,0)
+#define ppc_fsqrtd(c,D,B) ppc_fsqrtx(c,D,B,1)
+
+#define ppc_fsqrtsx(c,D,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (0 << 16) | (B << 11) | (0 << 6) | (22 << 1) | Rc)
+#define ppc_fsqrts(c,D,B) ppc_fsqrtsx(c,D,B,0)
+#define ppc_fsqrtsd(c,D,B) ppc_fsqrtsx(c,D,B,1)
+
+#define ppc_fsubx(c,D,A,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 6) | (20 << 1) | Rc)
+#define ppc_fsub(c,D,A,B) ppc_fsubx(c,D,A,B,0)
+#define ppc_fsubd(c,D,A,B) ppc_fsubx(c,D,A,B,1)
+
+#define ppc_fsubsx(c,D,A,B,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 6) | (20 << 1) | Rc)
+#define ppc_fsubs(c,D,A,B) ppc_fsubsx(c,D,A,B,0)
+#define ppc_fsubsd(c,D,A,B) ppc_fsubsx(c,D,A,B,1)
+
+#define ppc_icbi(c,A,B) ppc_emit32(c, (31 << 26) | (0 << 21) | (A << 16) | (B << 11) | (982 << 1) | 0)
+
+#define ppc_isync(c) ppc_emit32(c, (19 << 26) | (0 << 11) | (150 << 1) | 0)
+
+#define ppc_lbzu(c,D,A,d) ppc_emit32(c, (35 << 26) | (D << 21) | (A << 16) | (guint16)d)
+#define ppc_lbzux(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (119 << 1) | 0)
+#define ppc_lbzx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (87 << 1) | 0)
+
+#define ppc_lfdu(c,D,A,d) ppc_emit32(c, (51 << 26) | (D << 21) | (A << 16) | (guint16)d)
+#define ppc_lfdux(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (631 << 1) | 0)
+#define ppc_lfdx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (599 << 1) | 0)
+
+#define ppc_lfsu(c,D,A,d) ppc_emit32(c, (49 << 26) | (D << 21) | (A << 16) | (guint16)d)
+#define ppc_lfsux(c,D,A,d) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (567 << 1) | 0)
+#define ppc_lfsx(c,D,A,d) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (535 << 1) | 0)
+
+#define ppc_lha(c,D,A,d) ppc_emit32(c, (42 << 26) | (D << 21) | (A << 16) | (guint16)d)
+#define ppc_lhau(c,D,A,d) ppc_emit32(c, (43 << 26) | (D << 21) | (A << 16) | (guint16)d)
+#define ppc_lhaux(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (375 << 1) | 0)
+#define ppc_lhax(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (343 << 1) | 0)
+#define ppc_lhbrx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (790 << 1) | 0)
+#define ppc_lhzu(c,D,A,d) ppc_emit32(c, (41 << 26) | (D << 21) | (A << 16) | (guint16)d)
+
+#define ppc_lhzux(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (311 << 1) | 0)
+#define ppc_lhzx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (279 << 1) | 0)
+
+#define ppc_lmw(c,D,A,d) ppc_emit32(c, (46 << 26) | (D << 21) | (A << 16) | (guint16)d)
+
+#define ppc_lswi(c,D,A,NB) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (NB << 11) | (597 << 1) | 0)
+#define ppc_lswx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (533 << 1) | 0)
+#define ppc_lwarx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (20 << 1) | 0)
+#define ppc_lwbrx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (534 << 1) | 0)
+
+#define ppc_lwzu(c,D,A,d) ppc_emit32(c, (33 << 26) | (D << 21) | (A << 16) | (guint16)d)
+#define ppc_lwzux(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (55 << 1) | 0)
+#define ppc_lwzx(c,D,A,B) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (23 << 1) | 0)
+
+#define ppc_mcrf(c,crfD,crfS) ppc_emit32(c, (19 << 26) | (crfD << 23) | (0 << 21) | (crfS << 18) | 0)
+#define ppc_mcrfs(c,crfD,crfS) ppc_emit32(c, (63 << 26) | (crfD << 23) | (0 << 21) | (crfS << 18) | (0 << 16) | (64 << 1) | 0)
+#define ppc_mcrxr(c,crfD) ppc_emit32(c, (31 << 26) | (crfD << 23) | (0 << 16) | (512 << 1) | 0)
+
+#define ppc_mfcr(c,D) ppc_emit32(c, (31 << 26) | (D << 21) | (0 << 16) | (19 << 1) | 0)
+#define ppc_mffsx(c,D,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (583 << 1) | Rc)
+#define ppc_mffs(c,D) ppc_mffsx(c,D,0)
+#define ppc_mffsd(c,D) ppc_mffsx(c,D,1)
+#define ppc_mfmsr(c,D) ppc_emit32(c, (31 << 26) | (D << 21) | (0 << 16) | (83 << 1) | 0)
+#define ppc_mfsr(c,D,SR) ppc_emit32(c, (31 << 26) | (D << 21) | (0 << 20) | (SR << 16) | (0 << 11) | (595 << 1) | 0)
+#define ppc_mfsrin(c,D,B) ppc_emit32(c, (31 << 26) | (D << 21) | (0 << 16) | (B << 11) | (659 << 1) | 0)
+#define ppc_mftb(c,D,TBR) ppc_emit32(c, (31 << 26) | (D << 21) | (TBR << 11) | (371 << 1) | 0)
+
+#define ppc_mtcrf(c,CRM,S) ppc_emit32(c, (31 << 26) | (S << 21) | (0 << 20) | (CRM << 12) | (0 << 11) | (144 << 1) | 0)
+
+#define ppc_mtfsb0x(c,CRB,Rc) ppc_emit32(c, (63 << 26) | (CRB << 21) | (0 << 11) | (70 << 1) | Rc)
+#define ppc_mtfsb0(c,CRB) ppc_mtfsb0x(c,CRB,0)
+#define ppc_mtfsb0d(c,CRB) ppc_mtfsb0x(c,CRB,1)
+
+#define ppc_mtfsb1x(c,CRB,Rc) ppc_emit32(c, (63 << 26) | (CRB << 21) | (0 << 11) | (38 << 1) | Rc)
+#define ppc_mtfsb1(c,CRB) ppc_mtfsb1x(c,CRB,0)
+#define ppc_mtfsb1d(c,CRB) ppc_mtfsb1x(c,CRB,1)
+
+#define ppc_mtfsfx(c,FM,B,Rc) ppc_emit32(c, (63 << 26) | (0 << 25) | (FM << 22) | (0 << 21) | (B << 11) | (711 << 1) | Rc)
+#define ppc_mtfsf(c,FM,B) ppc_mtfsfx(c,FM,B,0)
+#define ppc_mtfsfd(c,FM,B) ppc_mtfsfx(c,FM,B,1)
+
+#define ppc_mtfsfix(c,crfD,IMM,Rc) ppc_emit32(c, (63 << 26) | (crfD << 23) | (0 << 16) | (IMM << 12) | (0 << 11) | (134 << 1) | Rc)
+#define ppc_mtfsfi(c,crfD,IMM) ppc_mtfsfix(c,crfD,IMM,0)
+#define ppc_mtfsfid(c,crfD,IMM) ppc_mtfsfix(c,crfD,IMM,1)
+
+#define ppc_mtmsr(c, S) ppc_emit32(c, (31 << 26) | (S << 21) | (0 << 11) | (146 << 1) | 0)
+
+#define ppc_mtsr(c,SR,S) ppc_emit32(c, (31 << 26) | (S << 21) | (0 << 20) | (SR << 16) | (0 << 11) | (210 << 1) | 0)
+#define ppc_mtsrin(c,S,B) ppc_emit32(c, (31 << 26) | (S << 21) | (0 << 16) | (B << 11) | (242 << 1) | 0)
+
+#define ppc_mulhwx(c,D,A,B,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 10) | (75 << 1) | Rc)
+#define ppc_mulhw(c,D,A,B) ppc_mulhwx(c,D,A,B,0)
+#define ppc_mulhwd(c,D,A,B) ppc_mulhwx(c,D,A,B,1)
+
+#define ppc_mulhwux(c,D,A,B,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (0 << 10) | (11 << 1) | Rc)
+#define ppc_mulhwu(c,D,A,B) ppc_mulhwux(c,D,A,B,0)
+#define ppc_mulhwud(c,D,A,B) ppc_mulhwux(c,D,A,B,1)
+
+#define ppc_mulli(c,D,A,SIMM) ppc_emit32(c, ((07) << 26) | (D << 21) | (A << 16) | (guint16)(SIMM))
+
+#define ppc_mullwx(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (OE << 10) | (235 << 1) | Rc)
+#define ppc_mullw(c,D,A,B) ppc_mullwx(c,D,A,B,0,0)
+#define ppc_mullwd(c,D,A,B) ppc_mullwx(c,D,A,B,0,1)
+#define ppc_mullwo(c,D,A,B) ppc_mullwx(c,D,A,B,1,0)
+#define ppc_mullwod(c,D,A,B) ppc_mullwx(c,D,A,B,1,1)
+
+#define ppc_nandx(c,A,S,B,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (476 << 1) | Rc)
+#define ppc_nand(c,A,S,B) ppc_nandx(c,A,S,B,0)
+#define ppc_nandd(c,A,S,B) ppc_nandx(c,A,S,B,1)
+
+#define ppc_negx(c,D,A,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (0 << 11) | (OE << 10) | (104 << 1) | Rc)
+#define ppc_neg(c,D,A) ppc_negx(c,D,A,0,0)
+#define ppc_negd(c,D,A) ppc_negx(c,D,A,0,1)
+#define ppc_nego(c,D,A) ppc_negx(c,D,A,1,0)
+#define ppc_negod(c,D,A) ppc_negx(c,D,A,1,1)
+
+#define ppc_norx(c,A,S,B,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (124 << 1) | Rc)
+#define ppc_nor(c,A,S,B) ppc_norx(c,A,S,B,0)
+#define ppc_nord(c,A,S,B) ppc_norx(c,A,S,B,1)
+
+#define ppc_not(c,A,S) ppc_norx(c,A,S,S,0)
+
+#define ppc_orx(c,A,S,B,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (444 << 1) | Rc)
+#define ppc_ord(c,A,S,B) ppc_orx(c,A,S,B,1)
+
+#define ppc_orcx(c,A,S,B,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (412 << 1) | Rc)
+#define ppc_orc(c,A,S,B) ppc_orcx(c,A,S,B,0)
+#define ppc_orcd(c,A,S,B) ppc_orcx(c,A,S,B,1)
+
+#define ppc_oris(c,A,S,UIMM) ppc_emit32(c, (25 << 26) | (S << 21) | (A << 16) | (guint16)(UIMM))
+
+#define ppc_rfi(c) ppc_emit32(c, (19 << 26) | (0 << 11) | (50 << 1) | 0)
+
+#define ppc_rlwimix(c,A,S,SH,MB,ME,Rc) ppc_emit32(c, (20 << 26) | (S << 21) | (A << 16) | (SH << 11) | (MB << 6) | (ME << 1) | Rc)
+#define ppc_rlwimi(c,A,S,SH,MB,ME) ppc_rlwimix(c,A,S,SH,MB,ME,0)
+#define ppc_rlwimid(c,A,S,SH,MB,ME) ppc_rlwimix(c,A,S,SH,MB,ME,1)
+
+#define ppc_rlwinmx(c,A,S,SH,MB,ME,Rc) ppc_emit32(c, (21 << 26) | (S << 21) | (A << 16) | (SH << 11) | (MB << 6) | (ME << 1) | Rc)
+#define ppc_rlwinm(c,A,S,SH,MB,ME) ppc_rlwinmx(c,A,S,SH,MB,ME,0)
+#define ppc_rlwinmd(c,A,S,SH,MB,ME) ppc_rlwinmx(c,A,S,SH,MB,ME,1)
+
+#define ppc_rlwnmx(c,A,S,SH,MB,ME,Rc) ppc_emit32(c, (23 << 26) | (S << 21) | (A << 16) | (SH << 11) | (MB << 6) | (ME << 1) | Rc)
+#define ppc_rlwnm(c,A,S,SH,MB,ME) ppc_rlwnmx(c,A,S,SH,MB,ME,0)
+#define ppc_rlwnmd(c,A,S,SH,MB,ME) ppc_rlwnmx(c,A,S,SH,MB,ME,1)
+
+#define ppc_sc(c) ppc_emit32(c, (17 << 26) | (0 << 2) | (1 << 1) | 0)
+
+#define ppc_slwx(c,S,A,B,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (24 << 1) | Rc)
+#define ppc_slw(c,S,A,B) ppc_slwx(c,S,A,B,0)
+#define ppc_slwd(c,S,A,B) ppc_slwx(c,S,A,B,1)
+
+#define ppc_srawx(c,A,S,B,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (792 << 1) | Rc)
+#define ppc_sraw(c,A,S,B) ppc_srawx(c,A,S,B,0)
+#define ppc_srawd(c,A,S,B) ppc_srawx(c,A,S,B,1)
+
+#define ppc_srawix(c,A,S,SH,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (SH << 11) | (824 << 1) | Rc)
+#define ppc_srawi(c,A,S,B) ppc_srawix(c,A,S,B,0)
+#define ppc_srawid(c,A,S,B) ppc_srawix(c,A,S,B,1)
+
+#define ppc_srwx(c,A,S,SH,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (SH << 11) | (536 << 1) | Rc)
+#define ppc_srw(c,A,S,B) ppc_srwx(c,A,S,B,0)
+#define ppc_srwd(c,A,S,B) ppc_srwx(c,A,S,B,1)
+
+#define ppc_stbu(c,S,A,D) ppc_emit32(c, (39 << 26) | (S << 21) | (A << 16) | (guint16)(D))
+
+#define ppc_stbux(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (247 << 1) | 0)
+#define ppc_stbx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (215 << 1) | 0)
+
+#define ppc_stfdu(c,S,A,D) ppc_emit32(c, (55 << 26) | (S << 21) | (A << 16) | (guint16)(D))
+
+#define ppc_stfdx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (727 << 1) | 0)
+#define ppc_stfiwx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (983 << 1) | 0)
+
+#define ppc_stfsu(c,S,A,D) ppc_emit32(c, (53 << 26) | (S << 21) | (A << 16) | (guint16)(D))
+#define ppc_stfsux(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (695 << 1) | 0)
+#define ppc_stfsx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (663 << 1) | 0)
+#define ppc_sthbrx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (918 << 1) | 0)
+#define ppc_sthu(c,S,A,D) ppc_emit32(c, (45 << 26) | (S << 21) | (A << 16) | (guint16)(D))
+#define ppc_sthux(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (439 << 1) | 0)
+#define ppc_sthx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (407 << 1) | 0)
+#define ppc_stmw(c,S,A,D) ppc_emit32(c, (47 << 26) | (S << 21) | (A << 16) | (guint16)D)
+#define ppc_stswi(c,S,A,NB) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (NB << 11) | (725 << 1) | 0)
+#define ppc_stswx(c,S,A,NB) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (NB << 11) | (661 << 1) | 0)
+#define ppc_stwbrx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (662 << 1) | 0)
+#define ppc_stwcxd(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (150 << 1) | 1)
+#define ppc_stwux(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (183 << 1) | 0)
+#define ppc_stwx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (151 << 1) | 0)
+
+#define ppc_subfx(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (OE << 10) | (40 << 1) | Rc)
+#define ppc_subf(c,D,A,B) ppc_subfx(c,D,A,B,0,0)
+#define ppc_subfd(c,D,A,B) ppc_subfx(c,D,A,B,0,1)
+#define ppc_subfo(c,D,A,B) ppc_subfx(c,D,A,B,1,0)
+#define ppc_subfod(c,D,A,B) ppc_subfx(c,D,A,B,1,1)
+
+#define ppc_sub(c,D,A,B) ppc_subf(c,D,B,A)
+
+#define ppc_subfcx(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (OE << 10) | (8 << 1) | Rc)
+#define ppc_subfc(c,D,A,B) ppc_subfcx(c,D,A,B,0,0)
+#define ppc_subfcd(c,D,A,B) ppc_subfcx(c,D,A,B,0,1)
+#define ppc_subfco(c,D,A,B) ppc_subfcx(c,D,A,B,1,0)
+#define ppc_subfcod(c,D,A,B) ppc_subfcx(c,D,A,B,1,1)
+
+#define ppc_subfex(c,D,A,B,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (B << 11) | (OE << 10) | (136 << 1) | Rc)
+#define ppc_subfe(c,D,A,B) ppc_subfex(c,D,A,B,0,0)
+#define ppc_subfed(c,D,A,B) ppc_subfex(c,D,A,B,0,1)
+#define ppc_subfeo(c,D,A,B) ppc_subfex(c,D,A,B,1,0)
+#define ppc_subfeod(c,D,A,B) ppc_subfex(c,D,A,B,1,1)
+
+#define ppc_subfic(c,D,A,SIMM) ppc_emit32(c, (8 << 26) | (D << 21) | (A << 16) | (guint16)(SIMM))
+
+#define ppc_subfmex(c,D,A,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (0 << 11) | (OE << 10) | (232 << 1) | Rc)
+#define ppc_subfme(c,D,A) ppc_subfmex(c,D,A,0,0)
+#define ppc_subfmed(c,D,A) ppc_subfmex(c,D,A,0,1)
+#define ppc_subfmeo(c,D,A) ppc_subfmex(c,D,A,1,0)
+#define ppc_subfmeod(c,D,A) ppc_subfmex(c,D,A,1,1)
+
+#define ppc_subfzex(c,D,A,OE,Rc) ppc_emit32(c, (31 << 26) | (D << 21) | (A << 16) | (0 << 11) | (OE << 10) | (200 << 1) | Rc)
+#define ppc_subfze(c,D,A) ppc_subfzex(c,D,A,0,0)
+#define ppc_subfzed(c,D,A) ppc_subfzex(c,D,A,0,1)
+#define ppc_subfzeo(c,D,A) ppc_subfzex(c,D,A,1,0)
+#define ppc_subfzeod(c,D,A) ppc_subfzex(c,D,A,1,1)
+
+#define ppc_sync(c) ppc_emit32(c, (31 << 26) | (0 << 11) | (598 << 1) | 0)
+#define ppc_tlbia(c) ppc_emit32(c, (31 << 26) | (0 << 11) | (370 << 1) | 0)
+#define ppc_tlbie(c,B) ppc_emit32(c, (31 << 26) | (0 << 16) | (B << 11) | (306 << 1) | 0)
+#define ppc_tlbsync(c) ppc_emit32(c, (31 << 26) | (0 << 11) | (566 << 1) | 0)
+
+#define ppc_tw(c,TO,A,B) ppc_emit32(c, (31 << 26) | (TO << 21) | (A << 16) | (B << 11) | (4 << 1) | 0)
+#define ppc_twi(c,TO,A,SIMM) ppc_emit32(c, (3 << 26) | (TO << 21) | (A << 16) | (guint16)(SIMM))
+
+#define ppc_xorx(c,A,S,B,RC) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (316 << 1) | RC)
+#define ppc_xor(c,A,S,B) ppc_xorx(c,A,S,B,0)
+#define ppc_xord(c,A,S,B) ppc_xorx(c,A,S,B,1)
+
+#define ppc_xori(c,S,A,UIMM) ppc_emit32(c, (26 << 26) | (S << 21) | (A << 16) | (guint16)(UIMM))
+#define ppc_xoris(c,S,A,UIMM) ppc_emit32(c, (27 << 26) | (S << 21) | (A << 16) | (guint16)(UIMM))
+
+/* this marks the end of my work, ct */
#endif
diff --git a/mono/arch/ppc/tramp.c b/mono/arch/ppc/tramp.c
index 72d5530ad40..abf5397f64a 100644
--- a/mono/arch/ppc/tramp.c
+++ b/mono/arch/ppc/tramp.c
@@ -7,6 +7,7 @@
#include "config.h"
#include <stdlib.h>
+#include <string.h>
#include "ppc-codegen.h"
#include "mono/metadata/class.h"
#include "mono/metadata/tabledefs.h"
@@ -57,15 +58,68 @@ flush_icache (guint8 *code, guint size)
asm ("isync");
}
+static void
+disassemble (guint8 *code, int size)
+{
+ int i;
+ FILE *ofd;
+ const char *tmp = getenv("TMP");
+ char *as_file;
+ char *o_file;
+ char *cmd;
+
+ if (tmp == NULL)
+ tmp = "/tmp";
+ as_file = g_strdup_printf ("%s/test.s", tmp);
+
+ if (!(ofd = fopen (as_file, "w")))
+ g_assert_not_reached ();
+
+ fprintf (ofd, "tmp:\n");
+
+ for (i = 0; i < size; ++i)
+ fprintf (ofd, ".byte %d\n", (unsigned int) code [i]);
+
+ fclose (ofd);
+#ifdef __APPLE__
+#define DIS_CMD "otool -V -v -t"
+#else
+#define DIS_CMD "objdump -d"
+#endif
+ o_file = g_strdup_printf ("%s/test.o", tmp);
+ cmd = g_strdup_printf ("as %s -o %s", as_file, o_file);
+ system (cmd);
+ g_free (cmd);
+ cmd = g_strdup_printf (DIS_CMD " %s", o_file);
+ system (cmd);
+ g_free (cmd);
+ g_free (o_file);
+ g_free (as_file);
+}
+
+
#define NOT_IMPLEMENTED(x) \
g_error ("FIXME: %s is not yet implemented. (trampoline)", x);
#define PROLOG_INS 8
#define CALL_INS 2
#define EPILOG_INS 6
-#define MINIMAL_STACK_SIZE 5
#define FLOAT_REGS 8
#define GENERAL_REGS 8
+#ifdef __APPLE__
+#define MINIMAL_STACK_SIZE 10
+#define ALWAYS_ON_STACK(s) s
+#define FP_ALSO_IN_REG(s) s
+#define RET_ADDR_OFFSET 8
+#define STACK_PARAM_OFFSET 24
+#else
+#define MINIMAL_STACK_SIZE 5
+#define ALWAYS_ON_STACK(s)
+#define FP_ALSO_IN_REG(s) s
+#define ALIGN_DOUBLES
+#define RET_ADDR_OFFSET 4
+#define STACK_PARAM_OFFSET 8
+#endif
static void inline
add_general (guint *gr, guint *stack_size, guint *code_size, gboolean simple)
@@ -75,41 +129,47 @@ add_general (guint *gr, guint *stack_size, guint *code_size, gboolean simple)
*stack_size += 4;
*code_size += 8; /* load from stack, save on stack */
} else {
+ ALWAYS_ON_STACK (*stack_size += 4);
*code_size += 4; /* load from stack */
}
} else {
if (*gr >= GENERAL_REGS - 1) {
- *stack_size += 8 + (*stack_size % 8);
+ *stack_size += 8;
+#ifdef ALIGN_DOUBLES
+ *stack_size += (*stack_size % 8);
+#endif
*code_size += 16; /* 2x load from stack, 2x save to stack */
} else {
- *code_size += 16; /* 2x load from stack */
+ ALWAYS_ON_STACK (*stack_size += 8);
+ *code_size += 8; /* 2x load from stack */
}
- if ((*gr) && 1)
+#ifdef ALIGN_DOUBLES
+ if ((*gr) & 1)
(*gr) ++;
+#endif
(*gr) ++;
}
(*gr) ++;
}
static void inline
-calculate_sizes (MonoMethod *method, guint *stack_size, guint *code_size, guint *strings, gint runtime)
+calculate_sizes (MonoMethodSignature *sig, guint *stack_size, guint *code_size, gboolean string_ctor, gboolean *use_memcpy)
{
- MonoMethodSignature *sig;
guint i, fr, gr;
guint32 simpletype;
fr = gr = 0;
*stack_size = MINIMAL_STACK_SIZE*4;
*code_size = (PROLOG_INS + CALL_INS + EPILOG_INS)*4;
- *strings = 0;
- sig = method->signature;
if (sig->hasthis) {
add_general (&gr, stack_size, code_size, TRUE);
}
-
+ DEBUG(printf("params: %d\n", sig->param_count));
for (i = 0; i < sig->param_count; ++i) {
+ DEBUG(printf("param %d: ", i));
if (sig->params [i]->byref) {
+ DEBUG(printf("byref\n"));
add_general (&gr, stack_size, code_size, TRUE);
continue;
}
@@ -127,39 +187,59 @@ calculate_sizes (MonoMethod *method, guint *stack_size, guint *code_size, guint
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
add_general (&gr, stack_size, code_size, TRUE);
break;
- case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_SZARRAY:
+ add_general (&gr, stack_size, code_size, TRUE);
+ *code_size += 4;
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
if (sig->params [i]->data.klass->enumtype) {
simpletype = sig->params [i]->data.klass->enum_basetype->type;
goto enum_calc_size;
}
- if (mono_class_value_size (sig->params [i]->data.klass, NULL) != 4)
- g_error ("can only marshal enums, not generic structures (size: %d)",
- mono_class_value_size (sig->params [i]->data.klass, NULL));
- add_general (&gr, stack_size, code_size, TRUE);
- *code_size += 4;
- break;
- case MONO_TYPE_STRING:
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime) {
+ size = mono_class_value_size (sig->params [i]->data.klass, NULL);
+ if (size != 4) {
+ DEBUG(printf ("copy %d bytes struct on stack\n",
+ mono_class_value_size (sig->params [i]->data.klass, NULL)));
+ *use_memcpy = TRUE;
+ *code_size += 8*4;
+ *stack_size += (size + 3) & (~3);
+ if (gr > GENERAL_REGS) {
+ *code_size += 4;
+ *stack_size += 4;
+ }
+ } else {
+ DEBUG(printf ("load %d bytes struct\n",
+ mono_class_value_size (sig->params [i]->data.klass, NULL)));
add_general (&gr, stack_size, code_size, TRUE);
- break;
+ *code_size += 4;
}
- (*strings) ++;
- *code_size += 12*4;
- *stack_size += 4;
break;
+ }
case MONO_TYPE_I8:
add_general (&gr, stack_size, code_size, FALSE);
break;
case MONO_TYPE_R4:
+ if (fr < 7) {
+ *code_size += 4;
+ fr ++;
+ FP_ALSO_IN_REG (gr ++);
+ ALWAYS_ON_STACK (*stack_size += 4);
+ } else {
+ NOT_IMPLEMENTED ("R4 arg");
+ }
+ break;
case MONO_TYPE_R8:
if (fr < 7) {
*code_size += 4;
fr ++;
+ FP_ALSO_IN_REG (gr += 2);
+ ALWAYS_ON_STACK (*stack_size += 8);
} else {
NOT_IMPLEMENTED ("R8 arg");
}
@@ -169,9 +249,7 @@ calculate_sizes (MonoMethod *method, guint *stack_size, guint *code_size, guint
}
}
- if (sig->ret->byref ||
- (method->klass == mono_defaults.string_class &&
- *method->name == '.' && !strcmp (method->name, ".ctor"))) {
+ if (sig->ret->byref || string_ctor) {
*code_size += 8;
} else {
simpletype = sig->ret->type;
@@ -193,13 +271,8 @@ enum_retvalue:
case MONO_TYPE_R8:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
- *code_size += 8;
- break;
case MONO_TYPE_STRING:
*code_size += 8;
- if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) && !runtime) {
- *code_size += 16;
- }
break;
case MONO_TYPE_I8:
*code_size += 12;
@@ -209,7 +282,7 @@ enum_retvalue:
simpletype = sig->ret->data.klass->enum_basetype->type;
goto enum_retvalue;
}
- NOT_IMPLEMENTED ("valuetype");
+ *code_size += 2*4;
break;
case MONO_TYPE_VOID:
break;
@@ -218,96 +291,140 @@ enum_retvalue:
}
}
- if (*strings) {
- /* space to keep parameters and prepared strings */
- *stack_size += 8;
- *code_size += 16;
- if (sig->hasthis) {
- *stack_size += 4;
- *code_size += 12;
- }
+ if (*use_memcpy) {
+ *stack_size += 2*4; /* for r14, r15 */
+ *code_size += 6*4;
+ if (sig->hasthis) {
+ *stack_size += 4; /* for r16 */
+ *code_size += 4;
+ }
}
+
/* align stack size to 16 */
DEBUG (printf (" stack size: %d (%d)\n code size: %d\n", (*stack_size + 15) & ~15, *stack_size, *code_size));
*stack_size = (*stack_size + 15) & ~15;
-
}
static inline guint8 *
-emit_prolog (guint8 *p, MonoMethod *method, guint stack_size, guint strings)
+emit_prolog (guint8 *p, MonoMethodSignature *sig, guint stack_size)
{
/* function prolog */
ppc_stwu (p, ppc_r1, -stack_size, ppc_r1); /* sp <--- sp - stack_size, sp[0] <---- sp save sp, alloc stack */
ppc_mflr (p, ppc_r0); /* r0 <--- LR */
ppc_stw (p, ppc_r31, stack_size - 4, ppc_r1); /* sp[+4] <--- r31 save r31 */
- ppc_stw (p, ppc_r0, stack_size + 4, ppc_r1); /* sp[-4] <--- LR save return address for "callme" */
+ ppc_stw (p, ppc_r0, stack_size + RET_ADDR_OFFSET, ppc_r1); /* sp[-4] <--- LR save return address for "callme" */
ppc_mr (p, ppc_r31, ppc_r1); /* r31 <--- sp */
- /* handle our parameters */
- if (strings) {
- ppc_stw (p, ppc_r30, stack_size - 16, ppc_r1);
- ppc_stw (p, ppc_r29, stack_size - 12, ppc_r1);
- if (method->signature->hasthis) {
- ppc_stw (p, ppc_r28, 24, ppc_r1);
- }
- ppc_mr (p, ppc_r30, ppc_r6); /* args */
- ppc_mr (p, ppc_r29, ppc_r3); /* callme */
- if (method->signature->hasthis) {
- ppc_mr (p, ppc_r28, ppc_r5); /* this */
- }
- } else {
- ppc_mr (p, ppc_r12, ppc_r6); /* keep "arguments" in register */
- ppc_mr (p, ppc_r0, ppc_r3); /* keep "callme" in register */
- }
- ppc_stw (p, ppc_r4, stack_size - 12, ppc_r31); /* preserve "retval", sp[+8] */
-
return p;
}
-#define ARG_BASE strings ? ppc_r30 : ppc_r12
+#define ARG_BASE ppc_r12
+#define ARG_SIZE sizeof (stackval)
#define SAVE_4_IN_GENERIC_REGISTER \
- if (gr < GENERAL_REGS) { \
- ppc_lwz (p, ppc_r3 + gr, i*16, ARG_BASE); \
- gr ++; \
- } else { \
- ppc_lwz (p, ppc_r11, i*16, ARG_BASE); \
- ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1); \
- stack_par_pos += 4; \
- }
+ if (gr < GENERAL_REGS) { \
+ ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE); \
+ gr ++; \
+ ALWAYS_ON_STACK (stack_par_pos += 4); \
+ } else { \
+ ppc_lwz (p, ppc_r11, i*ARG_SIZE, ARG_BASE); \
+ ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1); \
+ stack_par_pos += 4; \
+ }
+#define SAVE_4_VAL_IN_GENERIC_REGISTER \
+ if (gr < GENERAL_REGS) { \
+ ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE); \
+ ppc_lwz (p, ppc_r3 + gr, 0, ppc_r3 + gr); \
+ gr ++; \
+ ALWAYS_ON_STACK (stack_par_pos += 4); \
+ } else { \
+ ppc_lwz (p, ppc_r11, i*ARG_SIZE, ARG_BASE); \
+ ppc_lwz (p, ppc_r11, 0, ppc_r11); \
+ ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1); \
+ stack_par_pos += 4; \
+ }
inline static guint8*
-emit_save_parameters (guint8 *p, MonoMethod *method, guint stack_size, guint strings, gint runtime)
+emit_save_parameters (guint8 *p, MonoMethodSignature *sig, guint stack_size, gboolean use_memcpy)
{
- MonoMethodSignature *sig;
- guint i, fr, gr, act_strs, stack_par_pos;
+ guint i, fr, gr, stack_par_pos, struct_pos, cur_struct_pos;
guint32 simpletype;
fr = gr = 0;
- act_strs = 0;
- sig = method->signature;
- stack_par_pos = 8;
+ stack_par_pos = STACK_PARAM_OFFSET;
- if (strings) {
+ ppc_stw (p, ppc_r4, stack_size - 12, ppc_r31); /* preserve "retval", sp[+8] */
+
+ if (use_memcpy) {
+ ppc_stw (p, ppc_r14, stack_size - 16, ppc_r31); /* save r14 */
+ ppc_stw (p, ppc_r15, stack_size - 20, ppc_r31); /* save r15 */
+ ppc_mr (p, ppc_r14, ppc_r3); /* keep "callme" in register */
+ ppc_mr (p, ppc_r15, ppc_r6); /* keep "arguments" in register */
+ } else {
+ ppc_mr (p, ppc_r12, ppc_r6); /* keep "arguments" in register */
+ ppc_mr (p, ppc_r0, ppc_r3); /* keep "callme" in register */
+ }
+
+ if (sig->hasthis) {
+ if (use_memcpy) {
+ ppc_stw (p, ppc_r16, stack_size - 24, ppc_r31); /* save r16 */
+ ppc_mr (p, ppc_r16, ppc_r5);
+ } else
+ ppc_mr (p, ppc_r3, ppc_r5);
+ gr ++;
+ ALWAYS_ON_STACK (stack_par_pos += 4);
+ }
+
+ if (use_memcpy) {
+ cur_struct_pos = struct_pos = stack_par_pos;
for (i = 0; i < sig->param_count; ++i) {
- if (!sig->params [i]->byref && sig->params [i]->type == MONO_TYPE_STRING
- && !((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime)) {
- ppc_lis (p, ppc_r0, (guint32) mono_string_to_utf8 >> 16);
- ppc_lwz (p, ppc_r3, i*16, ppc_r30);
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) mono_string_to_utf8 & 0xffff);
- ppc_mtlr (p, ppc_r0);
- ppc_blrl (p);
- ppc_stw (p, ppc_r3, stack_size - 24 - act_strs, ppc_r31);
- act_strs += 4;
+ if (sig->params [i]->byref)
+ continue;
+ if (sig->params [i]->type == MONO_TYPE_VALUETYPE && !sig->params [i]->data.klass->enumtype) {
+ gint size;
+
+ size = mono_class_value_size (sig->params [i]->data.klass, NULL);
+ if (size != 4) {
+ /* call memcpy */
+ ppc_addi (p, ppc_r3, ppc_r1, stack_par_pos);
+ ppc_lwz (p, ppc_r4, i*16, ppc_r15);
+ /* FIXME check if size > 0xffff */
+ ppc_li (p, ppc_r5, size & 0xffff);
+ ppc_lis (p, ppc_r0, (guint32) memcpy >> 16);
+ ppc_ori (p, ppc_r0, ppc_r0, (guint32) memcpy & 0xffff);
+ ppc_mtlr (p, ppc_r0);
+ ppc_blrl (p);
+ stack_par_pos += (size + 3) & (~3);
+ }
}
}
+
+ if (sig->hasthis) {
+ ppc_mr (p, ppc_r3, ppc_r16);
+ ppc_lwz (p, ppc_r16, stack_size - 24, ppc_r31); /* restore r16 */
+ }
+ ppc_mr (p, ppc_r0, ppc_r14);
+ ppc_mr (p, ppc_r12, ppc_r15);
+ ppc_lwz (p, ppc_r14, stack_size - 16, ppc_r31); /* restore r14 */
+ ppc_lwz (p, ppc_r15, stack_size - 20, ppc_r31); /* restore r15 */
}
- if (sig->hasthis) {
- ppc_mr (p, ppc_r3, ppc_r5);
- gr ++;
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ gint size = mono_class_native_size (klass, NULL);
+
+ DEBUG(printf ("retval value type size: %d\n", size));
+ if (size > 8) {
+ ppc_lwz (p, ppc_r3, stack_size - 12, ppc_r31);
+ ppc_lwz (p, ppc_r3, 0, ppc_r3);
+ gr ++;
+ ALWAYS_ON_STACK (stack_par_pos += 4);
+ } else {
+ NOT_IMPLEMENTED ("retval valuetype <= 8 bytes");
+ }
+ }
}
- act_strs = 0;
for (i = 0; i < sig->param_count; ++i) {
if (sig->params [i]->byref) {
SAVE_4_IN_GENERIC_REGISTER;
@@ -327,63 +444,74 @@ emit_save_parameters (guint8 *p, MonoMethod *method, guint stack_size, guint str
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
SAVE_4_IN_GENERIC_REGISTER;
break;
- case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
if (sig->params [i]->data.klass->enumtype) {
simpletype = sig->params [i]->data.klass->enum_basetype->type;
goto enum_calc_size;
}
- if (mono_class_value_size (sig->params [i]->data.klass, NULL) != 4)
- g_error ("can only marshal enums, not generic structures (size: %d)",
- mono_class_value_size (sig->params [i]->data.klass, NULL));
- if (gr < GENERAL_REGS) {
- ppc_lwz (p, ppc_r3 + gr, i*16, ARG_BASE);
- ppc_lwz (p, ppc_r3 + gr, 0, ppc_r3 + gr);
- gr ++;
- } else {
- NOT_IMPLEMENTED ("save value type on stack");
- }
- break;
- case MONO_TYPE_STRING:
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime) {
- SAVE_4_IN_GENERIC_REGISTER;
+ size = mono_class_value_size (sig->params [i]->data.klass, NULL);
+ if (size == 4) {
+ SAVE_4_VAL_IN_GENERIC_REGISTER;
} else {
- if (gr < 8) {
- ppc_lwz (p, ppc_r3 + gr, stack_size - 24 - act_strs, ppc_r31);
+ if (gr < GENERAL_REGS) {
+ ppc_addi (p, ppc_r3 + gr, ppc_r1, cur_struct_pos);
gr ++;
- act_strs += 4;
- } else
- NOT_IMPLEMENTED ("string on stack");
+ } else {
+ ppc_lwz (p, ppc_r11, cur_struct_pos, ppc_r1);
+ ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1);
+ stack_par_pos += 4;
+ }
+ cur_struct_pos += (size + 3) & (~3);
}
break;
+ }
case MONO_TYPE_I8:
+DEBUG(printf("Mono_Type_i8. gr = %d, arg_base = %d\n", gr, ARG_BASE));
+#ifdef ALIGN_DOUBLES
+ if (gr & 1)
+ gr++;
+#endif
if (gr < 7) {
- if (gr & 1)
- gr ++;
- ppc_lwz (p, ppc_r3 + gr, i*16, ARG_BASE);
- gr ++;
- ppc_lwz (p, ppc_r3 + gr, i*16 + 4, ARG_BASE);
- gr ++;
- } else {
- NOT_IMPLEMENTED ("i8 on stack");
+ ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE);
+ ppc_lwz (p, ppc_r3 + gr + 1, i*ARG_SIZE + 4, ARG_BASE);
+ ALWAYS_ON_STACK (stack_par_pos += 8);
+ } else if (gr == 7) {
+ ppc_lwz (p, ppc_r3 + gr, i*ARG_SIZE, ARG_BASE);
+ ppc_lwz (p, ppc_r11, i*ARG_SIZE + 4, ARG_BASE);
+ ppc_stw (p, ppc_r11, stack_par_pos + 4, ppc_r1);
+ stack_par_pos += 8;
+ } else {
+ ppc_lwz (p, ppc_r11, i*ARG_SIZE, ARG_BASE);
+ ppc_stw (p, ppc_r11, stack_par_pos, ppc_r1);
+ ppc_lwz (p, ppc_r11, i*ARG_SIZE + 4, ARG_BASE);
+ ppc_stw (p, ppc_r11, stack_par_pos + 4, ppc_r1);
+ stack_par_pos += 8;
}
+ gr += 2;
break;
case MONO_TYPE_R4:
if (fr < 7) {
- ppc_lfs (p, ppc_f1 + fr, i*16, ARG_BASE);
+ ppc_lfs (p, ppc_f1 + fr, i*ARG_SIZE, ARG_BASE);
fr ++;
+ FP_ALSO_IN_REG (gr ++);
+ ALWAYS_ON_STACK (stack_par_pos += 4);
} else {
NOT_IMPLEMENTED ("r4 on stack");
}
break;
case MONO_TYPE_R8:
if (fr < 7) {
- ppc_lfd (p, ppc_f1 + fr, i*16, ARG_BASE);
+ ppc_lfd (p, ppc_f1 + fr, i*ARG_SIZE, ARG_BASE);
fr ++;
+ FP_ALSO_IN_REG (gr += 2);
+ ALWAYS_ON_STACK (stack_par_pos += 8);
} else {
NOT_IMPLEMENTED ("r8 on stack");
}
@@ -421,19 +549,16 @@ mono_string_new_wrapper (const char *text)
} */
static inline guint8 *
-emit_call_and_store_retval (guint8 *p, MonoMethod *method, guint stack_size, guint strings, gint runtime)
+emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig, guint stack_size, gboolean string_ctor)
{
- MonoMethodSignature *sig = method->signature;
guint32 simpletype;
/* call "callme" */
- ppc_mtlr (p, strings ? ppc_r29 : ppc_r0);
+ ppc_mtlr (p, ppc_r0);
ppc_blrl (p);
/* get return value */
- if (sig->ret->byref ||
- (method->klass == mono_defaults.string_class &&
- *method->name == '.' && !strcmp (method->name, ".ctor"))) {
+ if (sig->ret->byref || string_ctor) {
ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
ppc_stw (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
} else {
@@ -460,20 +585,9 @@ enum_retvalue:
case MONO_TYPE_OBJECT:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
- ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
- ppc_stw (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
- break;
case MONO_TYPE_STRING:
- if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) && !runtime) {
- ppc_lis (p, ppc_r0, (guint32) mono_string_new_wrapper >> 16);
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) mono_string_new_wrapper & 0xffff);
- ppc_mtlr (p, ppc_r0);
- ppc_blrl (p);
- }
-
ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
ppc_stw (p, ppc_r3, 0, ppc_r9); /* save return value (r3) to "retval" */
-
break;
case MONO_TYPE_R4:
ppc_lwz (p, ppc_r9, stack_size - 12, ppc_r31); /* load "retval" address */
@@ -493,7 +607,6 @@ enum_retvalue:
simpletype = sig->ret->data.klass->enum_basetype->type;
goto enum_retvalue;
}
- NOT_IMPLEMENTED ("retval valuetype");
break;
case MONO_TYPE_VOID:
break;
@@ -506,37 +619,11 @@ enum_retvalue:
}
static inline guint8 *
-emit_epilog (guint8 *p, MonoMethod *method, guint stack_size, guint strings, gboolean runtime)
+emit_epilog (guint8 *p, MonoMethodSignature *sig, guint stack_size)
{
- if (strings) {
- MonoMethodSignature *sig = method->signature;
- guint i, act_strs;
-
- /* free allocated memory */
- act_strs = 0;
- for (i = 0; i < sig->param_count; ++i) {
- if (!sig->params [i]->byref && sig->params [i]->type == MONO_TYPE_STRING
- && !((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime)) {
- ppc_lis (p, ppc_r0, (guint32) g_free >> 16);
- ppc_lwz (p, ppc_r3, stack_size - 24 - act_strs, ppc_r31);
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) g_free & 0xffff);
- ppc_mtlr (p, ppc_r0);
- ppc_blrl (p);
- act_strs += 4;
- }
- }
-
- /* restore volatile registers */
- ppc_lwz (p, ppc_r30, stack_size - 16, ppc_r1);
- ppc_lwz (p, ppc_r29, stack_size - 12, ppc_r1);
- if (method->signature->hasthis) {
- ppc_lwz (p, ppc_r28, 24, ppc_r1);
- }
- }
-
/* function epilog */
ppc_lwz (p, ppc_r11, 0, ppc_r1); /* r11 <--- sp[0] load backchain from caller's function */
- ppc_lwz (p, ppc_r0, 4, ppc_r11); /* r0 <--- r11[4] load return address */
+ ppc_lwz (p, ppc_r0, RET_ADDR_OFFSET, ppc_r11); /* r0 <--- r11[4] load return address */
ppc_mtlr (p, ppc_r0); /* LR <--- r0 set return address */
ppc_lwz (p, ppc_r31, -4, ppc_r11); /* r31 <--- r11[-4] restore r31 */
ppc_mr (p, ppc_r1, ppc_r11); /* sp <--- r11 restore stack */
@@ -546,19 +633,20 @@ emit_epilog (guint8 *p, MonoMethod *method, guint stack_size, guint strings, gbo
}
MonoPIFunc
-mono_create_trampoline (MonoMethod *method, int runtime)
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
guint8 *p, *code_buffer;
- guint stack_size, code_size, strings;
+ guint stack_size, code_size;
+ gboolean use_memcpy = FALSE;
- DEBUG (printf ("\nPInvoke [start emiting] %s\n", method->name));
- calculate_sizes (method, &stack_size, &code_size, &strings, runtime);
+ DEBUG (printf ("\nPInvoke [start emiting]\n"));
+ calculate_sizes (sig, &stack_size, &code_size, string_ctor, &use_memcpy);
p = code_buffer = alloc_code_memory (code_size);
- p = emit_prolog (p, method, stack_size, strings);
- p = emit_save_parameters (p, method, stack_size, strings, runtime);
- p = emit_call_and_store_retval (p, method, stack_size, strings, runtime);
- p = emit_epilog (p, method, stack_size, strings, runtime);
+ p = emit_prolog (p, sig, stack_size);
+ p = emit_save_parameters (p, sig, stack_size, use_memcpy);
+ p = emit_call_and_store_retval (p, sig, stack_size, string_ctor);
+ p = emit_epilog (p, sig, stack_size);
/* {
guchar *cp;
@@ -584,7 +672,11 @@ mono_create_trampoline (MonoMethod *method, int runtime)
}
+#ifdef __APPLE__
+#define MINV_POS 40 /* MonoInvocation structure offset on stack - STACK_PARAM_OFFSET + 4 pointer args for stackval_from_data */
+#else
#define MINV_POS 8 /* MonoInvocation structure offset on stack */
+#endif
#define STACK_POS (MINV_POS - sizeof (stackval) * sig->param_count)
#define OBJ_POS 8
#define TYPE_OFFSET (G_STRUCT_OFFSET (stackval, type))
@@ -600,36 +692,31 @@ mono_create_trampoline (MonoMethod *method, int runtime)
* across the managed/unmanaged boundary.
*/
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
MonoMethodSignature *sig;
+ MonoJitInfo *ji;
guint8 *p, *code_buffer;
- guint i, code_size, stack_size, stackval_arg_pos, local_pos, local_start, reg_param, stack_param;
+ guint i, align = 0, code_size, stack_size, stackval_arg_pos, local_pos, local_start, reg_param = 0, stack_param,
+ cpos, vt_cur;
+ gint *vtbuf;
guint32 simpletype;
- code_size = 512;
- stack_size = 512;
+ code_size = 1024;
+ stack_size = 1024;
stack_param = 0;
- sig = method->signature;
+ sig = mono_method_signature (method);
p = code_buffer = g_malloc (code_size);
- DEBUG (printf ("\nDelegate [start emiting] %s\n", method->name));
-
- /* jump after header which consist of "Mono" + method ptr */
- ppc_b (p, 3);
- *p = 'M'; p ++;
- *p = 'o'; p ++;
- *p = 'n'; p ++;
- *p = 'o'; p ++;
- *(void **) p = method; p += 4;
+ DEBUG (printf ("\nDelegate [start emiting] %s\n", mono_method_get_name (method)));
/* prolog */
ppc_stwu (p, ppc_r1, -stack_size, ppc_r1); /* sp <--- sp - stack_size, sp[0] <---- sp save sp, alloc stack */
ppc_mflr (p, ppc_r0); /* r0 <--- LR */
ppc_stw (p, ppc_r31, stack_size - 4, ppc_r1); /* sp[+4] <--- r31 save r31 */
- ppc_stw (p, ppc_r0, stack_size + 4, ppc_r1); /* sp[-4] <--- LR save return address for "callme" */
+ ppc_stw (p, ppc_r0, stack_size + RET_ADDR_OFFSET, ppc_r1); /* sp[-4] <--- LR save return address for "callme" */
ppc_mr (p, ppc_r31, ppc_r1); /* r31 <--- sp */
/* let's fill MonoInvocation */
@@ -637,7 +724,6 @@ mono_create_method_pointer (MonoMethod *method)
ppc_li (p, ppc_r0, 0);
ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex)), ppc_r31);
ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler)), ppc_r31);
- ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, child)), ppc_r31);
ppc_stw (p, ppc_r0, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent)), ppc_r31);
/* set method pointer */
@@ -650,13 +736,41 @@ mono_create_method_pointer (MonoMethod *method)
if (sig->hasthis) {
ppc_stw (p, ppc_r3, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)), ppc_r31);
reg_param = 1;
- } else {
- ppc_stw (p, ppc_r3, local_pos, ppc_r31);
- local_pos += 4;
- reg_param = 0;
+ }
+
+ if (sig->param_count) {
+ gint save_count = MIN (8, sig->param_count + sig->hasthis);
+ for (i = reg_param; i < save_count; i ++) {
+ ppc_stw (p, ppc_r3 + i, local_pos, ppc_r31);
+ local_pos += 4;
+ DEBUG (printf ("save r%d\n", 4 + i));
+ }
+ }
+
+ /* prepare space for valuetypes */
+ vt_cur = local_pos;
+ vtbuf = alloca (sizeof(int)*sig->param_count);
+ cpos = 0;
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *type = sig->params [i];
+ vtbuf [i] = -1;
+ if (type->type == MONO_TYPE_VALUETYPE) {
+ MonoClass *klass = type->data.klass;
+ gint size;
+
+ if (klass->enumtype)
+ continue;
+ size = mono_class_native_size (klass, &align);
+ cpos += align - 1;
+ cpos &= ~(align - 1);
+ vtbuf [i] = cpos;
+ cpos += size;
+ }
}
- ppc_stw (p, ppc_r4, local_pos, ppc_r31); local_pos += 4;
- ppc_stw (p, ppc_r5, local_pos, ppc_r31); local_pos += 4;
+ cpos += 3;
+ cpos &= ~3;
+
+ local_pos += cpos;
/* set MonoInvocation::stack_args */
stackval_arg_pos = MINV_POS + sizeof (MonoInvocation);
@@ -665,69 +779,32 @@ mono_create_method_pointer (MonoMethod *method)
/* add stackval arguments */
for (i = 0; i < sig->param_count; ++i) {
-#define CALL_STACKVAL_FROM_DATA \
- ppc_lis (p, ppc_r0, (guint32) stackval_from_data >> 16); \
- ppc_ori (p, ppc_r0, ppc_r0, (guint32) stackval_from_data & 0xffff); \
- ppc_mtlr (p, ppc_r0); \
- ppc_blrl (p)
-#define CALL_SIZE_4 \
- if (reg_param < 3 - (sig->hasthis ? 1 : 0)) { \
- ppc_addi (p, ppc_r5, ppc_r31, local_start + (reg_param - (sig->hasthis ? 1 : 0))*4); \
- reg_param ++; \
- } else if (reg_param < 8) { \
- ppc_stw (p, ppc_r3 + reg_param, local_pos, ppc_r31); \
- ppc_addi (p, ppc_r5, ppc_r31, local_pos); \
- reg_param ++; \
- } else { \
- ppc_addi (p, ppc_r5, stack_size + 8 + stack_param, ppc_r31); \
- stack_param ++; \
- } \
- ppc_lis (p, ppc_r3, (guint32) sig->params [i] >> 16); \
- ppc_addi (p, ppc_r4, ppc_r31, stackval_arg_pos); \
- stackval_arg_pos ++; \
- ppc_ori (p, ppc_r3, ppc_r3, (guint32) sig->params [i] & 0xffff); \
-\
- CALL_STACKVAL_FROM_DATA
-
- if (sig->params [i]->byref) {
- CALL_SIZE_4;
- continue;
+ if (reg_param < 8) {
+ ppc_addi (p, ppc_r5, ppc_r31, local_start + i*4);
+ reg_param ++;
+ } else {
+ ppc_addi (p, ppc_r5, stack_size + 8 + stack_param, ppc_r31);
+ stack_param ++;
}
- simpletype = sig->params [i]->type;
- enum_calc_size:
- switch (simpletype) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_STRING:
- CALL_SIZE_4;
- break;
- case MONO_TYPE_VALUETYPE:
- NOT_IMPLEMENTED ("value type");
- break;
- case MONO_TYPE_I8:
- NOT_IMPLEMENTED ("i8");
- break;
- case MONO_TYPE_R4:
- NOT_IMPLEMENTED ("r4");
- break;
- case MONO_TYPE_R8:
- NOT_IMPLEMENTED ("r8");
- break;
- default:
- g_error ("Can't delegate 0x%x type", sig->params [i]->type);
+ ppc_lis (p, ppc_r3, (guint32) sig->params [i] >> 16);
+
+ if (vtbuf [i] >= 0) {
+ ppc_addi (p, ppc_r4, ppc_r31, vt_cur);
+ ppc_stw (p, ppc_r4, stackval_arg_pos, ppc_r31);
+ ppc_addi (p, ppc_r4, ppc_r31, stackval_arg_pos);
+ ppc_lwz (p, ppc_r5, 0, ppc_r5);
+ vt_cur += vtbuf [i];
+ } else {
+ ppc_addi (p, ppc_r4, ppc_r31, stackval_arg_pos);
}
+ ppc_ori (p, ppc_r3, ppc_r3, (guint32) sig->params [i] & 0xffff);
+ ppc_lis (p, ppc_r0, (guint32) stackval_from_data >> 16);
+ ppc_li (p, ppc_r6, sig->pinvoke);
+ ppc_ori (p, ppc_r0, ppc_r0, (guint32) stackval_from_data & 0xffff);
+ ppc_mtlr (p, ppc_r0);
+ ppc_blrl (p);
+
+ stackval_arg_pos += sizeof (stackval);
}
/* return value storage */
@@ -748,6 +825,7 @@ mono_create_method_pointer (MonoMethod *method)
DEBUG (printf ("ret by ref\n"));
ppc_lwz (p, ppc_r3, stackval_arg_pos, ppc_r31);
} else {
+ enum_retvalue:
switch (sig->ret->type) {
case MONO_TYPE_VOID:
break;
@@ -779,6 +857,13 @@ mono_create_method_pointer (MonoMethod *method)
case MONO_TYPE_R8:
ppc_lfd (p, ppc_f1, stackval_arg_pos, ppc_r31);
break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ NOT_IMPLEMENTED ("value type as ret val from delegate");
+ break;
default:
g_error ("Type 0x%x not handled yet in thunk creation", sig->ret->type);
break;
@@ -787,31 +872,24 @@ mono_create_method_pointer (MonoMethod *method)
/* epilog */
ppc_lwz (p, ppc_r11, 0, ppc_r1); /* r11 <--- sp[0] load backchain from caller's function */
- ppc_lwz (p, ppc_r0, 4, ppc_r11); /* r0 <--- r11[4] load return address */
+ ppc_lwz (p, ppc_r0, RET_ADDR_OFFSET, ppc_r11); /* r0 <--- r11[4] load return address */
ppc_mtlr (p, ppc_r0); /* LR <--- r0 set return address */
ppc_lwz (p, ppc_r31, -4, ppc_r11); /* r31 <--- r11[-4] restore r31 */
ppc_mr (p, ppc_r1, ppc_r11); /* sp <--- r11 restore stack */
ppc_blr (p); /* return */
DEBUG (printf ("emited code size: %d\n", p - code_buffer));
+ DEBUG (disassemble (code_buffer, p - code_buffer));
flush_icache (code_buffer, p - code_buffer);
DEBUG (printf ("Delegate [end emiting]\n"));
- return (MonoPIFunc) code_buffer;
-}
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = p - code_buffer;
+ ji->code_start = code_buffer;
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
-/*
- * mono_create_method_pointer () will insert a pointer to the MonoMethod
- * so that the interp can easily get at the data: this function will retrieve
- * the method from the code stream.
- */
-MonoMethod*
-mono_method_pointer_get (void *code)
-{
- unsigned char *c = code;
- if (c [4] != 'M' || c [5] != 'o' || c [6] != 'n' || c [7] != 'o')
- return NULL;
- return *(MonoMethod**)(c + 8);
+ return ji->code_start;
}
diff --git a/mono/arch/s390/.cvsignore b/mono/arch/s390/.cvsignore
new file mode 100644
index 00000000000..6358454922b
--- /dev/null
+++ b/mono/arch/s390/.cvsignore
@@ -0,0 +1,4 @@
+Makefile.in
+Makefile
+.deps
+.cvsignore
diff --git a/mono/arch/s390/ChangeLog b/mono/arch/s390/ChangeLog
new file mode 100644
index 00000000000..6d033e72eea
--- /dev/null
+++ b/mono/arch/s390/ChangeLog
@@ -0,0 +1,4 @@
+2004-07-30 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * s390-codegen.h: reworked macros for code generation.
+
diff --git a/mono/arch/s390/Makefile.am b/mono/arch/s390/Makefile.am
new file mode 100644
index 00000000000..1c62a88c3bf
--- /dev/null
+++ b/mono/arch/s390/Makefile.am
@@ -0,0 +1,7 @@
+
+INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmonoarch-s390.la
+
+libmonoarch_s390_la_SOURCES = tramp.c s390-codegen.h
+
diff --git a/mono/arch/s390/s390-codegen.h b/mono/arch/s390/s390-codegen.h
new file mode 100644
index 00000000000..c1cabb57196
--- /dev/null
+++ b/mono/arch/s390/s390-codegen.h
@@ -0,0 +1,686 @@
+/*
+ Copyright (C) 2001 Radek Doulik
+*/
+
+#ifndef S390_H
+#define S390_H
+#include <glib.h>
+#include <assert.h>
+
+#define FLOAT_REGS 2 /* No. float registers for parms */
+#define GENERAL_REGS 5 /* No. general registers for parms */
+
+#define ARG_BASE s390_r10 /* Register for addressing arguments*/
+#define STKARG \
+ (i*(sizeof(stackval))) /* Displacement of ith argument */
+
+#define MINV_POS 96 /* MonoInvocation stack offset */
+#define STACK_POS (MINV_POS - sizeof (stackval) * sig->param_count)
+#define OBJ_POS 8
+#define TYPE_OFFSET (G_STRUCT_OFFSET (stackval, type))
+
+#define MIN_CACHE_LINE 256
+
+/*------------------------------------------------------------------*/
+/* Sequence to add an int/long long to parameters to stack_from_data*/
+/*------------------------------------------------------------------*/
+#define ADD_ISTACK_PARM(r, i) \
+ if (reg_param < GENERAL_REGS-(r)) { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ local_start + (reg_param - this_flag) * sizeof(long)); \
+ reg_param += (i); \
+ } else { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(long)); \
+ stack_param += (i); \
+ }
+
+/*------------------------------------------------------------------*/
+/* Sequence to add a float/double to parameters to stack_from_data */
+/*------------------------------------------------------------------*/
+#define ADD_RSTACK_PARM(i) \
+ if (fpr_param < FLOAT_REGS) { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ float_pos + (fpr_param * sizeof(float) * (i))); \
+ fpr_param++; \
+ } else { \
+ stack_param += (stack_param % (i)); \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(float) * (i)); \
+ stack_param += (i); \
+ }
+
+/*------------------------------------------------------------------*/
+/* Sequence to add a structure ptr to parameters to stack_from_data */
+/*------------------------------------------------------------------*/
+#define ADD_TSTACK_PARM \
+ if (reg_param < GENERAL_REGS) { \
+ s390_l (p, s390_r4, 0, STK_BASE, \
+ local_start + (reg_param - this_flag) * sizeof(long)); \
+ reg_param++; \
+ } else { \
+ s390_l (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(long)); \
+ stack_param++; \
+ }
+
+#define ADD_PSTACK_PARM(r, i) \
+ if (reg_param < GENERAL_REGS-(r)) { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ local_start + (reg_param - this_flag) * sizeof(long)); \
+ reg_param += (i); \
+ } else { \
+ s390_l (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(long)); \
+ stack_param++; \
+ }
+typedef enum {
+ s390_r0 = 0,
+ s390_r1,
+ s390_r2,
+ s390_r3,
+ s390_r4,
+ s390_r5,
+ s390_r6,
+ s390_r7,
+ s390_r8,
+ s390_r9,
+ s390_r10,
+ s390_r11,
+ s390_r12,
+ s390_r13,
+ s390_r14,
+ s390_r15,
+} S390IntRegister;
+
+typedef enum {
+ s390_f0 = 0,
+ s390_f1,
+ s390_f2,
+ s390_f3,
+ s390_f4,
+ s390_f5,
+ s390_f6,
+ s390_f7,
+ s390_f8,
+ s390_f9,
+ s390_f10,
+ s390_f11,
+ s390_f12,
+ s390_f13,
+ s390_f14,
+ s390_f15,
+} S390FloatRegister;
+
+typedef enum {
+ s390_a0 = 0,
+ s390_a1,
+ s390_a2,
+ s390_a3,
+ s390_a4,
+ s390_a5,
+ s390_a6,
+ s390_a7,
+ s390_a8,
+ s390_a9,
+ s390_a10,
+ s390_a11,
+ s390_a12,
+ s390_a13,
+ s390_a14,
+ s390_a15,
+} S390AccRegister;
+
+typedef enum {
+ s390_fpc = 256,
+} S390SpecialRegister;
+
+#define s390_is_imm16(val) ((gint)val >= (gint)-(1<<15) && \
+ (gint)val <= (gint)((1<<15)-1))
+#define s390_is_uimm16(val) ((gint)val >= 0 && (gint)val <= 65535)
+#define s390_is_imm12(val) ((gint)val >= (gint)-(1<<11) && \
+ (gint)val <= (gint)((1<<15)-1))
+#define s390_is_uimm12(val) ((gint)val >= 0 && (gint)val <= 4095)
+
+#define STK_BASE s390_r15
+#define S390_MINIMAL_STACK_SIZE 96
+#define S390_PARM_SAVE_OFFSET 8
+#define S390_REG_SAVE_OFFSET 24
+#define S390_RET_ADDR_OFFSET 56
+#define S390_FLOAT_SAVE_OFFSET 64
+
+#define S390_CC_ZR 8
+#define S390_CC_NE 7
+#define S390_CC_NZ 7
+#define S390_CC_LT 4
+#define S390_CC_GT 2
+#define S390_CC_GE 11
+#define S390_CC_LE 13
+#define S390_CC_OV 1
+#define S390_CC_NO 14
+#define S390_CC_CY 3
+#define S390_CC_NC 12
+#define S390_CC_UN 15
+
+#define s390_word(addr, value) do \
+{ \
+ * (guint32 *) addr = (guint32) value; \
+ addr += sizeof(guint32); \
+} while (0)
+
+#define s390_float(addr, value) do \
+{ \
+ * (gfloat *) addr = (gfloat) value; \
+ addr += sizeof(gfloat); \
+} while (0)
+
+#define s390_llong(addr, value) do \
+{ \
+ * (guint64 *) addr = (guint64) value; \
+ addr += sizeof(guint64); \
+} while (0)
+
+#define s390_double(addr, value) do \
+{ \
+ * (gdouble *) addr = (gdouble) value; \
+ addr += sizeof(gdouble); \
+} while (0)
+
+typedef struct {
+ short op;
+} E_Format;
+
+typedef struct {
+ char op;
+ int im;
+} I_Format;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r2 : 4;
+} RR_Format;
+
+typedef struct {
+ short op;
+ char xx;
+ char r1 : 4;
+ char r2 : 4;
+} RRE_Format;
+
+typedef struct {
+ short op;
+ char r1 : 4;
+ char xx : 4;
+ char r3 : 4;
+ char r2 : 4;
+} RRF_Format_1;
+
+typedef struct {
+ short op;
+ char m3 : 4;
+ char xx : 4;
+ char r1 : 4;
+ char r2 : 4;
+} RRF_Format_2;
+
+typedef struct {
+ short op;
+ char r3 : 4;
+ char m4 : 4;
+ char r1 : 4;
+ char r2 : 4;
+} RRF_Format_3;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ short d2 : 12;
+} RX_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ int d2 : 12;
+ char xx;
+ char op2;
+} RXE_Format;
+
+typedef struct {
+ char op1;
+ char r3 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ int d2 : 12;
+ char r1 : 4;
+ char xx : 4;
+ char op2;
+} RXF_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ int d2 : 20;
+ char op2;
+} RXY_Format __attribute__ ((packed));
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ char b2 : 4;
+ int d2 : 12;
+} RS_Format_1;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char m3 : 4;
+ char b2 : 4;
+ int d2 : 12;
+} RS_Format_2;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char xx : 4;
+ char b2 : 4;
+ int d2 : 12;
+} RS_Format_3;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char r3 : 4;
+ char b2 : 4;
+ int d2 : 20;
+ char op2;
+} RSY_Format_1 __attribute__ ((packed));
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char m3 : 4;
+ char b2 : 4;
+ int d2 : 20;
+ char op2;
+} RSY_Format_2 __attribute__ ((packed));
+
+typedef struct {
+ char op1;
+ char l1 : 4;
+ char xx : 4;
+ char b1 : 4;
+ int d1 : 12;
+ char yy;
+ char op2;
+} RSL_Format;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ short i2;
+} RSI_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char op2 : 4;
+ short i2;
+} RI_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char r3 : 4;
+ short i2;
+ char xx;
+ char op2;
+} RIE_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char op2 : 4;
+ int i2;
+} RIL_Format_1 __attribute__ ((packed));
+
+typedef struct {
+ char op1;
+ char m1 : 4;
+ char op2 : 4;
+ int i2;
+} RIL_Format_2 __attribute__ ((packed));
+
+typedef struct {
+ char op;
+ char i2;
+ char b1 : 4;
+ short d1 : 12;
+} SI_Format;
+
+typedef struct {
+ char op1;
+ char i2;
+ char b1 : 4;
+ int d1 : 20;
+ char op2;
+} SIY_Format __attribute__ ((packed));
+
+typedef struct {
+ short op;
+ char b2 : 4;
+ short d2 : 12;
+} S_Format;
+
+typedef struct {
+ char op;
+ char ll;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SS_Format_1;
+
+typedef struct {
+ char op;
+ char l1 : 4;
+ char l2 : 4;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SS_Format_2;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SS_Format_3;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ char b2 : 4;
+ short d2 : 12;
+ char b4 : 4;
+ short d4 : 12;
+} SS_Format_4;
+
+typedef struct {
+ short op;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SSE_Format __attribute__ ((packed));
+
+#define s390_emit16(c, x) do \
+{ \
+ *((guint16 *) c) = x; \
+ c += sizeof(guint16); \
+} while(0)
+
+#define s390_emit32(c, x) do \
+{ \
+ *((guint32 *) c) = x; \
+ c += sizeof(guint32); \
+} while(0)
+
+#define S390_E(c,opc) s390_emit16(c,opc)
+
+#define S390_I(c,opc,imm) s390_emit16(c, (opc << 8 | imm))
+
+#define S390_RR(c,opc,g1,g2) s390_emit16(c, (opc << 8 | (g1) << 4 | g2))
+
+#define S390_RRE(c,opc,g1,g2) s390_emit32(c, (opc << 16 | (g1) << 4 | g2))
+
+#define S390_RRF_1(c,opc,g1,g2,g3) s390_emit32(c, (opc << 16 | (g1) << 12 | (g3) << 4 | g2))
+
+#define S390_RRF_2(c,opc,g1,k3,g2) s390_emit32(c, (opc << 16 | (k3) << 12 | (g1) << 4 | g2))
+
+#define S390_RRF_3(c,opc,g1,g2,k4,g3) s390_emit32(c, (opc << 16 | (g3) << 12 | (k4) << 8 | (g1) << 4 | g2))
+
+#define S390_RX(c,opc,g1,n2,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (n2) << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RXE(c,opc,g1,n2,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | n2)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfff) << 16) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RXY(c,opc,g1,n2,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | n2)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfffff) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RS_1(c,opc,g1,g3,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (g3) << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RS_2(c,opc,g1,k3,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (k3) << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RS_3(c,opc,g1,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RSY_1(c,opc,g1,g3,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | g3)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfffff) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RSY_2(c,opc,g1,k3,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | k3)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfffff) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RSL(c,opc,ln,s1,p1) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (ln) << 4)); \
+ s390_emit32(c, ((s1) << 28 | ((s1 & 0xfff) << 16) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RSI(c,opc,g1,g3,m2) s390_emit32(c, (opc << 24 | (g1) << 20 | (g3) << 16 | (m2 & 0xffff)))
+
+#define S390_RI(c,opc,g1,m2) s390_emit32(c, ((opc >> 4) << 24 | (g1) << 20 | (opc & 0x0f) << 16 | (m2 & 0xffff)))
+
+#define S390_RIE(c,opc,g1,g3,m2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | g3)); \
+ s390_emit32(c, ((m2) << 16 | (opc & 0xff))); \
+} while (0)
+
+#define S390_RIL_1(c,opc,g1,m2) do \
+{ \
+ s390_emit16(c, ((opc >> 4) << 8 | (g1) << 4 | (opc & 0xf))); \
+ s390_emit32(c, m2); \
+} while (0)
+
+#define S390_RIL_2(c,opc,k1,m2) do \
+{ \
+ s390_emit16(c, ((opc >> 4) << 8 | (k1) << 4 | (opc & 0xf))); \
+ s390_emit32(c, m2); \
+} while (0)
+
+#define S390_SI(c,opc,s1,p1,m2) s390_emit32(c, (opc << 24 | (m2) << 16 | (s1) << 12 | ((p1) & 0xfff)));
+
+#define S390_SIY(c,opc,s1,p1,m2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | m2)); \
+ s390_emit32(c, ((s1) << 24 | (((p2) & 0xfffff) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_S(c,opc,s2,p2) s390_emit32(c, (opc << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_SS_1(c,opc,ln,s1,p1,s2,p2) do \
+{ \
+ s390_emit32(c, (opc << 24 | ((ln-1) & 0xff) << 16 | \
+ (s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define S390_SS_2(c,opc,n1,n2,s1,p1,s2,p2) do \
+{ \
+ s390_emit32(c, (opc << 24 | (n1) << 16 | (n2) << 12 | \
+ (s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define S390_SS_3(c,opc,g1,g3,s1,p1,s2,p2) do \
+{ \
+ s390_emit32(c, (opc << 24 | (g1) << 16 | (g3) << 12 | \
+ (s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define S390_SS_4(c,opc,g1,g3,s2,p2,s4,p4) do \
+{ \
+ s390_emit32(c, (opc << 24 | (g1) << 16 | (g3) << 12 | \
+ (s2) << 12 | ((p2) & 0xfff))); \
+ s390_emit16(c, ((s4) << 12 | ((p4) & 0xfff))); \
+} while (0)
+
+#define S390_SSE(c,opc,s1,p1,s2,p2) do \
+{ \
+ s390_emit16(c, opc); \
+ s390_emit16(c, ((s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define s390_basr(c, r1, r2) S390_RR(c, 0x0d, r1, r2)
+#define s390_bras(c, r, o) S390_RI(c, 0xa75, r, o)
+#define s390_brasl(c, r, o) S390_RIL_1(c, 0xc05, r, o)
+#define s390_ahi(c, r, v) S390_RI(c, 0xa7a, r, v)
+#define s390_alcr(c, r1, r2) S390_RRE(c, 0xb998, r1, r2)
+#define s390_ar(c, r1, r2) S390_RR(c, 0x1a, r1, r2)
+#define s390_alr(c, r1, r2) S390_RR(c, 0x1e, r1, r2)
+#define s390_a(c, r, x, b, d) S390_RX(c, 0x5a, r, x, b, d)
+#define s390_al(c, r, x, b, d) S390_RX(c, 0x5e, r, x, b, d)
+#define s390_slbr(c, r1, r2) S390_RRE(c, 0xb999, r1, r2)
+#define s390_sr(c, r1, r2) S390_RR(c, 0x1b, r1, r2)
+#define s390_slr(c, r1, r2) S390_RR(c, 0x1f, r1, r2)
+#define s390_s(c, r, x, b, d) S390_RX(c, 0x5b, r, x, b, d)
+#define s390_sl(c, r, x, b, d) S390_RX(c, 0x5f, r, x, b, d)
+#define s390_mr(c, r1, r2) S390_RR(c, 0x1c, r1, r2)
+#define s390_m(c, r, x, b, d) S390_RX(c, 0x5c, r, x, b, d)
+#define s390_msr(c, r1, r2) S390_RRE(c, 0xb252, r1, r2)
+#define s390_ms(c, r, x, b, d) S390_RX(c, 0x71, r, x, b, d)
+#define s390_mlr(c, r1, r2) S390_RRE(c, 0xb996, r1, r2)
+#define s390_dr(c, r1, r2) S390_RR(c, 0x1d, r1, r2)
+#define s390_dlr(c, r1, r2) S390_RRE(c, 0xb997, r1, r2)
+#define s390_br(c, r) S390_RR(c, 0x07, 0xf, r)
+#define s390_nr(c, r1, r2) S390_RR(c, 0x14, r1, r2)
+#define s390_n(c, r, x, b, d) S390_RX(c, 0x54, r, x, b, d)
+#define s390_or(c, r1, r2) S390_RR(c, 0x16, r1, r2)
+#define s390_o(c, r, x, b, d) S390_RX(c, 0x56, r, x, b, d)
+#define s390_xr(c, r1, r2) S390_RR(c, 0x17, r1, r2)
+#define s390_x(c, r, x, b, d) S390_RX(c, 0x57, r, x, b, d)
+#define s390_lr(c, r1, r2) S390_RR(c, 0x18, r1, r2)
+#define s390_ltr(c, r1, r2) S390_RR(c, 0x12, r1, r2)
+#define s390_l(c, r, x, b, d) S390_RX(c, 0x58, r, x, b, d)
+#define s390_lcr(c, r1, r2) S390_RR(c, 0x13, r1, r2)
+#define s390_lnr(c, r1, r2) S390_RR(c, 0x11, r1, r2)
+#define s390_lpr(c, r1, r2) S390_RR(c, 0x10, r1, r2)
+#define s390_lm(c, r1, r2, b, d) S390_RS_1(c, 0x98, r1, r2, b, d)
+#define s390_lh(c, r, x, b, d) S390_RX(c, 0x48, r, x, b, d)
+#define s390_lhi(c, r, v) S390_RI(c, 0xa78, r, v)
+#define s390_ic(c, r, x, b, d) S390_RX(c, 0x43, r, x, b, d)
+#define s390_icm(c, r, m, b, d) S390_RX(c, 0xbf, r, m, b, d)
+#define s390_st(c, r, x, b, d) S390_RX(c, 0x50, r, x, b, d)
+#define s390_stm(c, r1, r2, b, d) S390_RS_1(c, 0x90, r1, r2, b, d)
+#define s390_stam(c, r1, r2, b, d) S390_RS_1(c, 0x9b, r1, r2, b, d)
+#define s390_lam(c, r1, r2, b, d) S390_RS_1(c, 0x9a, r1, r2, b, d)
+#define s390_sth(c, r, x, b, d) S390_RX(c, 0x40, r, x, b, d)
+#define s390_stc(c, r, x, b, d) S390_RX(c, 0x42, r, x, b, d)
+#define s390_stcm(c, r, m, b, d) S390_RX(c, 0xbe, r, m, b, d)
+#define s390_la(c, r, x, b, d) S390_RX(c, 0x41, r, x, b, d)
+#define s390_larl(c, r, o) S390_RIL_1(c, 0xc00, r, o)
+#define s390_ld(c, f, x, b, d) S390_RX(c, 0x68, f, x, b, d)
+#define s390_le(c, f, x, b, d) S390_RX(c, 0x78, f, x, b, d)
+#define s390_std(c, f, x, b, d) S390_RX(c, 0x60, f, x, b, d)
+#define s390_ste(c, f, x, b, d) S390_RX(c, 0x70, f, x, b, d)
+#define s390_mvc(c, l, b1, d1, b2, d2) S390_SS_1(c, 0xd2, l, b1, d1, b2, d2)
+#define s390_mvcl(c, r1, r2) S390_RR(c, 0x0e, r1, r2)
+#define s390_mvcle(c, r1, r3, d2, b2) S390_RS_1(c, 0xa8, r1, r3, d2, b2)
+#define s390_break(c) S390_RR(c, 0, 0, 0)
+#define s390_nill(c, r, v) S390_RI(c, 0xa57, r, v)
+#define s390_nilh(c, r, v) S390_RI(c, 0xa56, r, v)
+#define s390_cr(c, r1, r2) S390_RR(c, 0x19, r1, r2)
+#define s390_clr(c, r1, r2) S390_RR(c, 0x15, r1, r2)
+#define s390_c(c, r, x, b, d) S390_RX(c, 0x59, r, x, b, d)
+#define s390_cl(c, r, x, b, d) S390_RX(c, 0x55, r, x, b, d)
+#define s390_chi(c, r, i) S390_RI(c, 0xa7e, r, i)
+#define s390_brc(c, m, d) S390_RI(c, 0xa74, m, d)
+#define s390_j(c,d) s390_brc(c, S390_CC_UN, d)
+#define s390_je(c, d) s390_brc(c, S390_CC_EQ, d)
+#define s390_jeo(c, d) s390_brc(c, S390_CC_ZR|S390_CC_OV, d)
+#define s390_jz(c, d) s390_brc(c, S390_CC_ZR, d)
+#define s390_jnz(c, d) s390_brc(c, S390_CC_NZ, d)
+#define s390_jne(c, d) s390_brc(c, S390_CC_NZ, d)
+#define s390_jp(c, d) s390_brc(c, S390_CC_GT, d)
+#define s390_jm(c, d) s390_brc(c, S390_CC_LT, d)
+#define s390_jh(c, d) s390_brc(c, S390_CC_GT, d)
+#define s390_jl(c, d) s390_brc(c, S390_CC_LT, d)
+#define s390_jnh(c, d) s390_brc(c, S390_CC_LE, d)
+#define s390_jo(c, d) s390_brc(c, S390_CC_OV, d)
+#define s390_jnl(c, d) s390_brc(c, S390_CC_GE, d)
+#define s390_jlo(c, d) s390_brc(c, S390_CC_LT|S390_CC_OV, d)
+#define s390_jho(c, d) s390_brc(c, S390_CC_GT|S390_CC_OV, d)
+#define s390_jc(c, m, d) s390_brc(c, m, d)
+#define s390_jcl(c, m, d) S390_RIL_2(c, 0xc04, m, d)
+#define s390_slda(c, r, b, d) S390_RS_3(c, 0x8f, r, b, d)
+#define s390_sldl(c, r, b, d) S390_RS_3(c, 0x8d, r, b, d)
+#define s390_srda(c, r, b, d) S390_RS_3(c, 0x8e, r, b, d)
+#define s390_srdl(c, r, b, d) S390_RS_3(c, 0x8c, r, b, d)
+#define s390_sla(c, r, b, d) S390_RS_3(c, 0x8b, r, b, d)
+#define s390_sll(c, r, b, d) S390_RS_3(c, 0x89, r, b, d)
+#define s390_sra(c, r, b, d) S390_RS_3(c, 0x8a, r, b, d)
+#define s390_srl(c, r, b, d) S390_RS_3(c, 0x88, r, b, d)
+#define s390_sqdbr(c, r1, r2) S390_RRE(c, 0xb315, r1, r2)
+#define s390_sqebr(c, r1, r2) S390_RRE(c, 0xb314, r1, r2)
+#define s390_adbr(c, r1, r2) S390_RRE(c, 0xb31a, r1, r2)
+#define s390_aebr(c, r1, r2) S390_RRE(c, 0xb30a, r1, r2)
+#define s390_adb(c, r, x, b, d) S390_RXE(c, 0xed1a, r, x, b, d)
+#define s390_sdbr(c, r1, r2) S390_RRE(c, 0xb31b, r1, r2)
+#define s390_sebr(c, r1, r2) S390_RRE(c, 0xb30b, r1, r2)
+#define s390_sdb(c, r, x, b, d) S390_RXE(c, 0xed1b, r, x, b, d)
+#define s390_mdbr(c, r1, r2) S390_RRE(c, 0xb31c, r1, r2)
+#define s390_meebr(c, r1, r2) S390_RRE(c, 0xb317, r1, r2)
+#define s390_ldr(c, r1, r2) S390_RR(c, 0x28, r1, r2)
+#define s390_ler(c, r1, r2) S390_RR(c, 0x38, r1, r2)
+#define s390_lzdr(c, r) S390_RRE(c, 0xb375, r, 0)
+#define s390_lzer(c, r) S390_RRE(c, 0xb374, r, 0)
+#define s390_ddbr(c, r1, r2) S390_RRE(c, 0xb31d, r1, r2)
+#define s390_debr(c, r1, r2) S390_RRE(c, 0xb30d, r1, r2)
+#define s390_didbr(c, r1, r2, m, r3) S390_RRF_3(c, 0xb35b, r1, r2, m, r3)
+#define s390_lcdbr(c, r1, r2) S390_RRE(c, 0xb313, r1, r2)
+#define s390_lndbr(c, r1, r2) S390_RRE(c, 0xb311, r1, r2)
+#define s390_ldebr(c, r1, r2) S390_RRE(c, 0xb304, r1, r2)
+#define s390_ledbr(c, r1, r2) S390_RRE(c, 0xb344, r1, r2)
+#define s390_ldeb(c, r, x, b, d) S390_RXE(c, 0xed04, r, x, b, d)
+#define s390_cfdbr(c, r1, m, r2) S390_RRF_2(c, 0xb399, r1, m, r2)
+#define s390_cdfbr(c, r1, r2) S390_RRE(c, 0xb395, r1, r2)
+#define s390_cdbr(c, r1, r2) S390_RRE(c, 0xb319, r1, r2)
+#define s390_cebr(c, r1, r2) S390_RRE(c, 0xb309, r1, r2)
+#define s390_cdb(c, r, x, b, d) S390_RXE(c, 0xed19, r, x, b, d)
+#define s390_tcdb(c, r, x, b, d) S390_RXE(c, 0xed11, r, x, b, d)
+#define s390_tceb(c, r, x, b, d) S390_RXE(c, 0xed10, r, x, b, d)
+#define s390_stfpc(c, b, d) S390_S(c, 0xb29c, b, d)
+#endif
diff --git a/mono/arch/s390/tramp.c b/mono/arch/s390/tramp.c
new file mode 100644
index 00000000000..1483cfd3850
--- /dev/null
+++ b/mono/arch/s390/tramp.c
@@ -0,0 +1,1151 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - tramp.c */
+/* */
+/* Function - Create trampolines to invoke arbitrary functions. */
+/* */
+/* Name - Neale Ferguson. */
+/* */
+/* Date - October, 2002 */
+/* */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define PROLOG_INS 24 /* Size of emitted prolog */
+#define CALL_INS 4 /* Size of emitted call */
+#define EPILOG_INS 18 /* Size of emitted epilog */
+
+#define DEBUG(x)
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#ifdef NEED_MPROTECT
+# include <sys/mman.h>
+# include <limits.h> /* for PAGESIZE */
+# ifndef PAGESIZE
+# define PAGESIZE 4096
+# endif
+#endif
+
+#include "config.h"
+#include <stdlib.h>
+#include <string.h>
+#include "s390-codegen.h"
+#include "mono/metadata/class.h"
+#include "mono/metadata/tabledefs.h"
+#include "mono/interpreter/interp.h"
+#include "mono/metadata/appdomain.h"
+#include "mono/metadata/marshal.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* Structure used to accummulate size of stack, code, and locals */
+/*------------------------------------------------------------------*/
+typedef struct {
+ guint stack_size,
+ local_size,
+ code_size,
+ retStruct;
+} size_data;
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - add_general */
+/* */
+/* Function - Determine code and stack size incremements for a */
+/* parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void inline
+add_general (guint *gr, size_data *sz, gboolean simple)
+{
+ if (simple) {
+ if (*gr >= GENERAL_REGS) {
+ sz->stack_size += sizeof(long);
+ sz->code_size += 12;
+ } else {
+ sz->code_size += 8;
+ }
+ } else {
+ if (*gr >= GENERAL_REGS - 1) {
+ sz->stack_size += 8 + (sz->stack_size % 8);
+ sz->code_size += 10;
+ } else {
+ sz->code_size += 8;
+ }
+ (*gr) ++;
+ }
+ (*gr) ++;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - calculate_sizes */
+/* */
+/* Function - Determine the amount of space required for code */
+/* and stack. In addition determine starting points */
+/* for stack-based parameters, and area for struct- */
+/* ures being returned on the stack. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void inline
+calculate_sizes (MonoMethodSignature *sig, size_data *sz,
+ gboolean string_ctor)
+{
+ guint i, fr, gr, size;
+ guint32 simpletype, align;
+
+ fr = 0;
+ gr = 2;
+ sz->retStruct = 0;
+ sz->stack_size = S390_MINIMAL_STACK_SIZE;
+ sz->code_size = (PROLOG_INS + CALL_INS + EPILOG_INS);
+ sz->local_size = 0;
+
+ if (sig->hasthis) {
+ add_general (&gr, sz, TRUE);
+ }
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the return code/stack in case we*/
+ /* need to reserve a register to be used to address a stack */
+ /* area that the callee will use. */
+ /*----------------------------------------------------------*/
+
+ if (sig->ret->byref || string_ctor) {
+ sz->code_size += 8;
+ } else {
+ simpletype = sig->ret->type;
+enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_I8:
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ gr++;
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->ret->data.klass, &align);
+ if (align > 1)
+ sz->code_size += 10;
+ switch (size) {
+ /*----------------------------------*/
+ /* On S/390, structures of size 1, */
+ /* 2, 4, and 8 bytes are returned */
+ /* in (a) register(s). */
+ /*----------------------------------*/
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ sz->code_size += 16;
+ sz->stack_size += 4;
+ break;
+ default:
+ sz->retStruct = 1;
+ sz->code_size += 32;
+ }
+ break;
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the parameter code and stack */
+ /* requirements by checking the types and sizes of the */
+ /* parameters. */
+ /*----------------------------------------------------------*/
+
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref) {
+ add_general (&gr, sz, TRUE);
+ continue;
+ }
+ simpletype = sig->params [i]->type;
+ enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ add_general (&gr, sz, TRUE);
+ break;
+ case MONO_TYPE_SZARRAY:
+ add_general (&gr, sz, TRUE);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->params [i]->data.klass, &align);
+ DEBUG(printf("%d typesize: %d (%d)\n",i,size,align));
+ switch (size) {
+ /*----------------------------------*/
+ /* On S/390, structures of size 1, */
+ /* 2, 4, and 8 bytes are passed in */
+ /* (a) register(s). */
+ /*----------------------------------*/
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ add_general(&gr, sz, TRUE);
+ break;
+ case 8:
+ add_general(&gr, sz, FALSE);
+ break;
+ default:
+ sz->local_size += (size + (size % align));
+ sz->code_size += 40;
+ }
+ break;
+ case MONO_TYPE_I8:
+ add_general (&gr, sz, FALSE);
+ break;
+ case MONO_TYPE_R4:
+ if (fr < FLOAT_REGS) {
+ sz->code_size += 4;
+ fr++;
+ }
+ else {
+ sz->code_size += 4;
+ sz->stack_size += 8;
+ }
+ break;
+ case MONO_TYPE_R8:
+ if (fr < FLOAT_REGS) {
+ sz->code_size += 4;
+ fr++;
+ } else {
+ sz->code_size += 4;
+ sz->stack_size += 8 + (sz->stack_size % 8);
+ }
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+
+ /* align stack size to 8 */
+ DEBUG (printf (" stack size: %d (%d)\n"
+ " code size: %d\n"
+ " local size: %d\n",
+ (sz->stack_size + 8) & ~8, sz->stack_size,
+ (sz->code_size),(sz->local_size + 8) & ~8));
+ sz->stack_size = (sz->stack_size + 8) & ~8;
+ sz->local_size = (sz->local_size + 8) & ~8;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_prolog */
+/* */
+/* Function - Create the instructions that implement the stand- */
+/* ard function prolog according to the S/390 ABI. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+emit_prolog (guint8 *p, MonoMethodSignature *sig, size_data *sz)
+{
+ guint stack_size;
+
+ stack_size = sz->stack_size + sz->local_size;
+
+ /* function prolog */
+ s390_stm (p, s390_r6, STK_BASE, STK_BASE, 24);
+ s390_l (p, s390_r7, 0, STK_BASE, MINV_POS);
+ s390_lr (p, s390_r11, STK_BASE);
+ s390_ahi (p, STK_BASE, -stack_size);
+ s390_st (p, s390_r11, 0, STK_BASE, 0);
+
+ /*-----------------------------------------*/
+ /* Save: */
+ /* - address of "callme" */
+ /* - address of "retval" */
+ /* - address of "arguments" */
+ /*-----------------------------------------*/
+ s390_lr (p, s390_r9, s390_r2);
+ s390_lr (p, s390_r8, s390_r3);
+ s390_lr (p, s390_r10, s390_r5);
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_save_parameters */
+/* */
+/* Function - Create the instructions that load registers with */
+/* parameters, place others on the stack according */
+/* to the S/390 ABI. */
+/* */
+/* The resulting function takes the form: */
+/* void func (void (*callme)(), void *retval, */
+/* void *this_obj, stackval *arguments); */
+/* */
+/*------------------------------------------------------------------*/
+
+inline static guint8*
+emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz)
+{
+ guint i, fr, gr, act_strs, align,
+ stack_par_pos, size, local_pos;
+ guint32 simpletype;
+
+ /*----------------------------------------------------------*/
+ /* If a structure on stack is being returned, reserve r2 */
+ /* to point to an area where it can be passed. */
+ /*----------------------------------------------------------*/
+ if (sz->retStruct)
+ gr = 1;
+ else
+ gr = 0;
+ fr = 0;
+ act_strs = 0;
+ stack_par_pos = S390_MINIMAL_STACK_SIZE;
+ local_pos = sz->stack_size;
+
+ if (sig->hasthis) {
+ s390_lr (p, s390_r2 + gr, s390_r4);
+ gr++;
+ }
+
+ act_strs = 0;
+ for (i = 0; i < sig->param_count; ++i) {
+ DEBUG(printf("par: %d type: %d ref: %d\n",i,sig->params[i]->type,sig->params[i]->byref));
+ if (sig->params [i]->byref) {
+ if (gr < GENERAL_REGS) {
+ s390_l (p, s390_r2 + gr, 0, ARG_BASE, STKARG);
+ gr ++;
+ } else {
+ s390_l (p, s390_r0, 0, ARG_BASE, STKARG);
+ s390_st (p, s390_r0, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ continue;
+ }
+ simpletype = sig->params [i]->type;
+ enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ if (gr < GENERAL_REGS) {
+ s390_l (p, s390_r2 + gr, 0, ARG_BASE, STKARG);
+ gr ++;
+ } else {
+ s390_l (p, s390_r0, 0, ARG_BASE, STKARG);
+ s390_st (p, s390_r0, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->params [i]->data.klass, &align);
+ DEBUG(printf("parStruct - size %d pinvoke: %d\n",size,sig->pinvoke));
+ switch (size) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ if (gr < GENERAL_REGS) {
+ s390_l (p, s390_r2 + gr, 0,ARG_BASE, STKARG);
+ s390_l (p, s390_r2 + gr, 0, s390_r2 + gr, 0);
+ gr++;
+ } else {
+ stack_par_pos += (stack_par_pos % align);
+ s390_l (p, s390_r10, 0,ARG_BASE, STKARG);
+ s390_l (p, s390_r10, 0, s390_r10, 0);
+ s390_st (p, s390_r10, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ break;
+ case 8:
+ if (gr < GENERAL_REGS-1) {
+ s390_l (p, s390_r2 + gr, 0, ARG_BASE, STKARG);
+ s390_lm (p, s390_r2 + gr, s390_r3 + gr, s390_r2 + gr, 0);
+ } else {
+ stack_par_pos += (stack_par_pos % align);
+ s390_l (p, s390_r10, 0, ARG_BASE, STKARG);
+ s390_mvc (p, sizeof(long long), STK_BASE, stack_par_pos, s390_r10, 0);
+ stack_par_pos += sizeof(long long);
+ }
+ break;
+ default:
+ if (size <= 256) {
+ local_pos += (local_pos % align);
+ s390_l (p, s390_r13, 0, ARG_BASE, STKARG);
+ s390_mvc (p, size, STK_BASE, local_pos, s390_r13, 0);
+ s390_la (p, s390_r13, 0, STK_BASE, local_pos);
+ local_pos += size;
+ } else {
+ local_pos += (local_pos % align);
+ s390_bras (p, s390_r13, 4);
+ s390_word (p, size);
+ s390_l (p, s390_r1, 0, s390_r13, 0);
+ s390_l (p, s390_r0, 0, ARG_BASE, STKARG);
+ s390_lr (p, s390_r14, s390_r12);
+ s390_la (p, s390_r12, 0, STK_BASE, local_pos);
+ s390_lr (p, s390_r13, s390_r1);
+ s390_mvcl (p, s390_r12, s390_r0);
+ s390_lr (p, s390_r12, s390_r14);
+ s390_la (p, s390_r13, 0, STK_BASE, local_pos);
+ local_pos += size;
+ }
+ if (gr < GENERAL_REGS) {
+ s390_lr (p, s390_r2 + gr, s390_r13);
+ gr++;
+ } else {
+ s390_st (p, s390_r13, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ }
+ break;
+ case MONO_TYPE_I8:
+ if (gr < GENERAL_REGS-1) {
+ s390_lm (p, s390_r2 + gr, s390_r2 + gr + 1, ARG_BASE, STKARG);
+ gr += 2;
+ } else {
+ *(guint32 *) p += 7;
+ *(guint32 *) p &= ~7;
+ s390_mvc (p, sizeof(long long), STK_BASE, stack_par_pos, ARG_BASE, STKARG);
+ stack_par_pos += sizeof(long long) + (stack_par_pos % sizeof(long long));
+ }
+ break;
+ case MONO_TYPE_R4:
+ if (fr < FLOAT_REGS) {
+ s390_le (p, s390_r0 + fr, 0, ARG_BASE, STKARG);
+ fr++;
+ } else {
+ s390_mvc (p, sizeof(float), STK_BASE, stack_par_pos, ARG_BASE, STKARG);
+ stack_par_pos += sizeof(float);
+ }
+ break;
+ case MONO_TYPE_R8:
+ if (fr < FLOAT_REGS) {
+ s390_ld (p, s390_r0 + fr, 0, ARG_BASE, STKARG);
+ fr++;
+ } else {
+ *(guint32 *) p += 7;
+ *(guint32 *) p &= ~7;
+ s390_mvc (p, sizeof(double), STK_BASE, stack_par_pos, ARG_BASE, STKARG);
+ stack_par_pos += sizeof(long long) + (stack_par_pos % sizeof(long long));
+ }
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* If we're returning a structure but not in a register */
+ /* then point the result area for the called routine */
+ /*----------------------------------------------------------*/
+ if (sz->retStruct) {
+ s390_l (p, s390_r2, 0, s390_r8, 0);
+ }
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - alloc_code_memory */
+/* */
+/* Function - Allocate space to place the emitted code. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+alloc_code_memory (guint code_size)
+{
+ guint8 *p;
+
+#ifdef NEED_MPROTECT
+ p = g_malloc (code_size + PAGESIZE - 1);
+
+ /* Align to a multiple of PAGESIZE, assumed to be a power of two */
+ p = (char *)(((int) p + PAGESIZE-1) & ~(PAGESIZE-1));
+#else
+ p = g_malloc (code_size);
+#endif
+ DEBUG (printf (" align: %p (%d)\n", p, (guint)p % 4));
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_call_and_store_retval */
+/* */
+/* Function - Emit code that will implement the call to the */
+/* desired function, and unload the result according */
+/* to the S390 ABI for the type of value returned */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig,
+ size_data *sz, gboolean string_ctor)
+{
+ guint32 simpletype;
+ guint retSize, align;
+
+ /* call "callme" */
+ s390_basr (p, s390_r14, s390_r9);
+
+ /* get return value */
+ if (sig->ret->byref || string_ctor) {
+ s390_st (p, s390_r2, 0, s390_r8, 0);
+ } else {
+ simpletype = sig->ret->type;
+enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ s390_stc (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ s390_sth (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ s390_st (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_R4:
+ s390_ste (p, s390_f0, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_R8:
+ s390_std (p, s390_f0, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_I8:
+ s390_stm (p, s390_r2, s390_r3, s390_r8, 0);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ if (sig->pinvoke)
+ retSize = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ retSize = mono_class_value_size (sig->ret->data.klass, &align);
+printf("Returning %d bytes for type %d (%d)\n",retSize,simpletype,sig->pinvoke);
+ switch(retSize) {
+ case 0:
+ break;
+ case 1:
+ s390_stc (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case 2:
+ s390_sth (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case 4:
+ s390_st (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case 8:
+ s390_stm (p, s390_r2, s390_r3, s390_r8, 0);
+ break;
+ default:
+ /*------------------------------------------*/
+ /* The callee has already placed the result */
+ /* in the required area */
+ /*------------------------------------------*/
+ }
+ break;
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x",
+ sig->ret->type);
+ }
+ }
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_epilog */
+/* */
+/* Function - Create the instructions that implement the stand- */
+/* ard function epilog according to the S/390 ABI. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+emit_epilog (guint8 *p, MonoMethodSignature *sig, size_data *sz)
+{
+ /* function epilog */
+ s390_l (p, STK_BASE, 0, STK_BASE, 0);
+ s390_l (p, s390_r4, 0, STK_BASE, 56);
+ s390_lm (p, s390_r6, STK_BASE, STK_BASE, 24);
+ s390_br (p, s390_r4);
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_trampoline. */
+/* */
+/* Function - Create the code that will allow a mono method to */
+/* invoke a system subroutine. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoPIFunc
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+{
+ guint8 *p, *code_buffer;
+ size_data sz;
+
+ DEBUG (printf ("\nPInvoke [start emiting]\n"));
+ calculate_sizes (sig, &sz, string_ctor);
+
+ p = code_buffer = alloc_code_memory (sz.code_size);
+ p = emit_prolog (p, sig, &sz);
+ p = emit_save_parameters (p, sig, &sz);
+ p = emit_call_and_store_retval (p, sig, &sz, string_ctor);
+ p = emit_epilog (p, sig, &sz);
+
+#ifdef NEED_MPROTECT
+ if (mprotect (code_buffer, 1024, PROT_READ | PROT_WRITE | PROT_EXEC)) {
+ g_error ("Cannot mprotect trampoline\n");
+ }
+#endif
+
+ DEBUG (printf ("emited code size: %d\n", p - code_buffer));
+
+ DEBUG (printf ("PInvoke [end emiting]\n"));
+
+ return (MonoPIFunc) code_buffer;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_method_pointer */
+/* */
+/* Function - Returns a pointer to a native function that can */
+/* be used to call the specified method. */
+/* */
+/* The function created will receive the arguments */
+/* according to the calling convention specified in */
+/* in the method. */
+/* */
+/* This function works by creating a MonoInvocation */
+/* structure, filling the fields in and calling */
+/* ves_exec_method() on it. */
+/* */
+/* Logic: */
+/* ------ */
+/* mono_arch_create_method_pointer (MonoMethod *method) */
+/* create the unmanaged->managed wrapper */
+/* register it with mono_jit_info_table_add() */
+/* */
+/* What does the unmanaged->managed wrapper do? */
+/* allocate a MonoInvocation structure (inv) on the stack */
+/* allocate an array of stackval on the stack with length = */
+/* method->signature->param_count + 1 [call it stack_args] */
+/* set inv->ex, inv->ex_handler, inv->parent to NULL */
+/* set inv->method to method */
+/* if method is an instance method, set inv->obj to the */
+/* 'this' argument (the first argument) else set to NULL */
+/* for each argument to the method call: */
+/* stackval_from_data (sig->params[i], &stack_args[i], */
+/* arg, sig->pinvoke); */
+/* Where: */
+/* ------ */
+/* sig - is method->signature */
+/* &stack_args[i] - is the pointer to the ith element */
+/* in the stackval array */
+/* arg - is a pointer to the argument re- */
+/* ceived by the function according */
+/* to the call convention. If it */
+/* gets passed in a register, save */
+/* on the stack first. */
+/* */
+/* set inv->retval to the address of the last element of */
+/* stack_args [recall we allocated param_count+1 of them] */
+/* call ves_exec_method(inv) */
+/* copy the returned value from inv->retval where the calling */
+/* convention expects to find it on return from the wrap- */
+/* per [if it's a structure, use stackval_to_data] */
+/* */
+/*------------------------------------------------------------------*/
+
+void *
+mono_arch_create_method_pointer (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ MonoJitInfo *ji;
+ guint8 *p, *code_buffer;
+ guint i, align = 0, simple_type, retSize, reg_save = 0,
+ stackval_arg_pos, local_pos, float_pos,
+ local_start, reg_param = 0, stack_param,
+ this_flag, arg_pos, fpr_param, parSize;
+ guint32 simpletype;
+ size_data sz;
+ int *vtbuf, cpos, vt_cur;
+
+ sz.code_size = 1024;
+ sz.stack_size = 1024;
+ stack_param = 0;
+ fpr_param = 0;
+ arg_pos = 0;
+
+ sig = method->signature;
+
+ p = code_buffer = g_malloc (sz.code_size);
+
+ DEBUG (printf ("\nDelegate [start emiting] %s at 0x%08x\n",
+ method->name,p));
+
+ /*----------------------------------------------------------*/
+ /* prolog */
+ /*----------------------------------------------------------*/
+ s390_stm (p, s390_r6, STK_BASE, STK_BASE, 24);
+ s390_l (p, s390_r7, 0, STK_BASE, MINV_POS);
+ s390_lr (p, s390_r0, STK_BASE);
+ s390_ahi (p, STK_BASE, -(sz.stack_size+MINV_POS));
+ s390_st (p, s390_r0, 0, STK_BASE, 0);
+ s390_la (p, s390_r8, 0, STK_BASE, 4);
+ s390_lr (p, s390_r10, s390_r8);
+ s390_lhi (p, s390_r9, sz.stack_size+92);
+ s390_lhi (p, s390_r11, 0);
+ s390_mvcl(p, s390_r8, s390_r10);
+
+ /*----------------------------------------------------------*/
+ /* Let's fill MonoInvocation - first zero some fields */
+ /*----------------------------------------------------------*/
+ s390_lhi (p, s390_r0, 0);
+ s390_st (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex)));
+ s390_st (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler)));
+ s390_st (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent)));
+ s390_lhi (p, s390_r0, 1);
+ s390_st (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, invoke_trap)));
+
+ /*----------------------------------------------------------*/
+ /* set method pointer */
+ /*----------------------------------------------------------*/
+ s390_bras (p, s390_r13, 4);
+ s390_word (p, method);
+ s390_l (p, s390_r0, 0, s390_r13, 0);
+ s390_st (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method)));
+
+ local_start = local_pos = MINV_POS +
+ sizeof (MonoInvocation) + (sig->param_count + 1) * sizeof (stackval);
+ this_flag = (sig->hasthis ? 1 : 0);
+
+ /*----------------------------------------------------------*/
+ /* if we are returning a structure, checks it's length to */
+ /* see if there's a "hidden" parameter that points to the */
+ /* area. If necessary save this hidden parameter for later */
+ /*----------------------------------------------------------*/
+ if (MONO_TYPE_ISSTRUCT(sig->ret)) {
+ if (sig->pinvoke)
+ retSize = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ retSize = mono_class_value_size (sig->ret->data.klass, &align);
+ switch(retSize) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ sz.retStruct = 0;
+ break;
+ default:
+ sz.retStruct = 1;
+ s390_lr(p, s390_r8, s390_r2);
+ reg_save = 1;
+ }
+ } else {
+ reg_save = 0;
+ }
+
+ if (this_flag) {
+ s390_st (p, s390_r2 + reg_save, 0, STK_BASE,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)));
+ reg_param++;
+ } else {
+ s390_st (p, s390_r2 + reg_save, 0, STK_BASE, local_pos);
+ local_pos += sizeof(int);
+ s390_st (p, s390_r0, 0, STK_BASE,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)));
+ }
+
+ s390_stm (p, s390_r3 + reg_param, s390_r6, STK_BASE, local_pos);
+ local_pos += 4 * sizeof(long);
+ float_pos = local_pos;
+ s390_std (p, s390_f0, 0, STK_BASE, local_pos);
+ local_pos += sizeof(double);
+ s390_std (p, s390_f2, 0, STK_BASE, local_pos);
+ local_pos += sizeof(double);
+
+ /*----------------------------------------------------------*/
+ /* prepare space for valuetypes */
+ /*----------------------------------------------------------*/
+ vt_cur = local_pos;
+ vtbuf = alloca (sizeof(int)*sig->param_count);
+ cpos = 0;
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *type = sig->params [i];
+ vtbuf [i] = -1;
+ DEBUG(printf("par: %d type: %d ref: %d\n",i,type->type,type->byref));
+ if (type->type == MONO_TYPE_VALUETYPE) {
+ MonoClass *klass = type->data.klass;
+ gint size;
+
+ if (klass->enumtype)
+ continue;
+ size = mono_class_native_size (klass, &align);
+ cpos += align - 1;
+ cpos &= ~(align - 1);
+ vtbuf [i] = cpos;
+ cpos += size;
+ }
+ }
+ cpos += 3;
+ cpos &= ~3;
+
+ local_pos += cpos;
+
+ /*----------------------------------------------------------*/
+ /* set MonoInvocation::stack_args */
+ /*----------------------------------------------------------*/
+ stackval_arg_pos = MINV_POS + sizeof (MonoInvocation);
+ s390_la (p, s390_r0, 0, STK_BASE, stackval_arg_pos);
+ s390_st (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args)));
+
+ /*----------------------------------------------------------*/
+ /* add stackval arguments */
+ /*----------------------------------------------------------*/
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref) {
+ ADD_ISTACK_PARM(0, 1);
+ } else {
+ simple_type = sig->params [i]->type;
+ enum_savechk:
+ switch (simple_type) {
+ case MONO_TYPE_I8:
+ ADD_ISTACK_PARM(-1, 2);
+ break;
+ case MONO_TYPE_R4:
+ ADD_RSTACK_PARM(1);
+ break;
+ case MONO_TYPE_R8:
+ ADD_RSTACK_PARM(2);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simple_type = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_savechk;
+ }
+ if (sig->pinvoke)
+ parSize = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ parSize = mono_class_value_size (sig->params [i]->data.klass, &align);
+ switch(parSize) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ ADD_PSTACK_PARM(0, 1);
+ break;
+ case 8:
+ ADD_PSTACK_PARM(-1, 2);
+ break;
+ default:
+ ADD_TSTACK_PARM;
+ }
+ break;
+ default:
+ ADD_ISTACK_PARM(0, 1);
+ }
+ }
+
+ if (vtbuf [i] >= 0) {
+ s390_la (p, s390_r3, 0, STK_BASE, vt_cur);
+ s390_st (p, s390_r3, 0, STK_BASE, stackval_arg_pos);
+ s390_la (p, s390_r3, 0, STK_BASE, stackval_arg_pos);
+ vt_cur += vtbuf [i];
+ } else {
+ s390_la (p, s390_r3, 0, STK_BASE, stackval_arg_pos);
+ }
+
+ /*--------------------------------------*/
+ /* Load the parameter registers for the */
+ /* call to stackval_from_data */
+ /*--------------------------------------*/
+ s390_bras (p, s390_r13, 8);
+ s390_word (p, sig->params [i]);
+ s390_word (p, sig->pinvoke);
+ s390_word (p, stackval_from_data);
+ s390_l (p, s390_r2, 0, s390_r13, 0);
+
+ s390_l (p, s390_r5, 0, s390_r13, 4);
+
+ s390_l (p, s390_r1, 0, s390_r13, 8);
+ s390_basr (p, s390_r14, s390_r1);
+
+ stackval_arg_pos += sizeof(stackval);
+
+ /* fixme: alignment */
+ DEBUG (printf ("arg_pos %d --> ", arg_pos));
+ if (sig->pinvoke)
+ arg_pos += mono_type_native_stack_size (sig->params [i], &align);
+ else
+ arg_pos += mono_type_stack_size (sig->params [i], &align);
+
+ DEBUG (printf ("%d\n", stackval_arg_pos));
+ }
+
+ /*----------------------------------------------------------*/
+ /* Set return area pointer. */
+ /*----------------------------------------------------------*/
+ s390_la (p, s390_r10, 0, STK_BASE, stackval_arg_pos);
+ s390_st (p, s390_r10, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)));
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ s390_la (p, s390_r9, 0, s390_r10, sizeof(stackval));
+ s390_st (p, s390_r9, 0,STK_BASE, stackval_arg_pos);
+ stackval_arg_pos += sizeof(stackval);
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* call ves_exec_method */
+ /*----------------------------------------------------------*/
+ s390_bras (p, s390_r13, 4);
+ s390_word (p, ves_exec_method);
+ s390_l (p, s390_r1, 0, s390_r13, 0);
+ s390_la (p, s390_r2, 0, STK_BASE, MINV_POS);
+ s390_basr (p, s390_r14, s390_r1);
+
+ /*----------------------------------------------------------*/
+ /* move retval from stackval to proper place (r3/r4/...) */
+ /*----------------------------------------------------------*/
+ DEBUG(printf("retType: %d byRef: %d\n",sig->ret->type,sig->ret->byref));
+ if (sig->ret->byref) {
+ DEBUG (printf ("ret by ref\n"));
+ s390_st (p, s390_r2, 0, s390_r10, 0);
+ } else {
+ enum_retvalue:
+DEBUG(printf("Returns: %d\n",sig->ret->type));
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U1:
+ s390_lhi (p, s390_r2, 0);
+ s390_ic (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ s390_lh (p, s390_r2, 0,s390_r10, 0);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ s390_l (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_I8:
+ s390_lm (p, s390_r2, s390_r3, s390_r10, 0);
+ break;
+ case MONO_TYPE_R4:
+ s390_le (p, s390_f0, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_R8:
+ s390_ld (p, s390_f0, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ /*---------------------------------*/
+ /* Call stackval_to_data to return */
+ /* the structure */
+ /*---------------------------------*/
+ s390_bras (p, s390_r13, 8);
+ s390_word (p, sig->ret);
+ s390_word (p, sig->pinvoke);
+ s390_word (p, stackval_to_data);
+ s390_l (p, s390_r2, 0, s390_r13, 0);
+ s390_l (p, s390_r3, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)));
+ if (sz.retStruct) {
+ /*------------------------------------------*/
+ /* Get stackval_to_data to set result area */
+ /*------------------------------------------*/
+ s390_lr (p, s390_r4, s390_r8);
+ } else {
+ /*------------------------------------------*/
+ /* Give stackval_to_data a temp result area */
+ /*------------------------------------------*/
+ s390_la (p, s390_r4, 0, STK_BASE, stackval_arg_pos);
+ }
+ s390_l (p, s390_r5, 0,s390_r13, 4);
+ s390_l (p, s390_r1, 0, s390_r13, 8);
+ s390_basr (p, s390_r14, s390_r1);
+ switch (retSize) {
+ case 0:
+ break;
+ case 1:
+ s390_lhi (p, s390_r2, 0);
+ s390_ic (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case 2:
+ s390_lh (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case 4:
+ s390_l (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case 8:
+ s390_lm (p, s390_r2, s390_r3, s390_r10, 0);
+ break;
+ default:
+ /*-------------------------------------------------*/
+ /* stackval_to_data has placed data in result area */
+ /*-------------------------------------------------*/
+ }
+ break;
+ default:
+ g_error ("Type 0x%x not handled yet in thunk creation",
+ sig->ret->type);
+ break;
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* epilog */
+ /*----------------------------------------------------------*/
+ s390_l (p, STK_BASE, 0, STK_BASE, 0);
+ s390_l (p, s390_r4, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_lm (p, s390_r6, STK_BASE, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (p, s390_r4);
+
+ DEBUG (printf ("emited code size: %d\n", p - code_buffer));
+
+ DEBUG (printf ("Delegate [end emiting]\n"));
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = p - code_buffer;
+ ji->code_start = code_buffer;
+
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
+
+ return ji->code_start;
+}
+
+/*========================= End of Function ========================*/
diff --git a/mono/arch/s390x/.cvsignore b/mono/arch/s390x/.cvsignore
new file mode 100644
index 00000000000..e9793ab64d0
--- /dev/null
+++ b/mono/arch/s390x/.cvsignore
@@ -0,0 +1,6 @@
+Makefile
+Makefile.in
+.libs
+.deps
+*.la
+*.lo
diff --git a/mono/arch/s390x/ChangeLog b/mono/arch/s390x/ChangeLog
new file mode 100644
index 00000000000..c65fce5770f
--- /dev/null
+++ b/mono/arch/s390x/ChangeLog
@@ -0,0 +1,4 @@
+2004-08-03 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * s390x-codegen.h Makefile.am tramp.c: S/390 64-bit interpreter
+
diff --git a/mono/arch/s390x/Makefile.am b/mono/arch/s390x/Makefile.am
new file mode 100644
index 00000000000..e7466d948c9
--- /dev/null
+++ b/mono/arch/s390x/Makefile.am
@@ -0,0 +1,7 @@
+
+INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmonoarch-s390x.la
+
+libmonoarch_s390x_la_SOURCES = tramp.c s390x-codegen.h
+
diff --git a/mono/arch/s390x/s390x-codegen.h b/mono/arch/s390x/s390x-codegen.h
new file mode 100644
index 00000000000..7b412124703
--- /dev/null
+++ b/mono/arch/s390x/s390x-codegen.h
@@ -0,0 +1,741 @@
+/*
+ Copyright (C) 2001 Radek Doulik
+*/
+
+#ifndef S390X_H
+#define S390X_H
+#include <glib.h>
+#include <assert.h>
+
+#define FLOAT_REGS 2 /* No. float registers for parms */
+#define GENERAL_REGS 5 /* No. general registers for parms */
+
+#define ARG_BASE s390_r10 /* Register for addressing arguments*/
+#define STKARG \
+ (i*(sizeof(stackval))) /* Displacement of ith argument */
+
+#define MINV_POS 160 /* MonoInvocation stack offset */
+#define STACK_POS (MINV_POS - sizeof (stackval) * sig->param_count)
+#define OBJ_POS 8
+#define TYPE_OFFSET (G_STRUCT_OFFSET (stackval, type))
+
+#define MIN_CACHE_LINE 256
+
+/*------------------------------------------------------------------*/
+/* Sequence to add an int/long long to parameters to stack_from_data*/
+/*------------------------------------------------------------------*/
+#define ADD_ISTACK_PARM(r, i) \
+ if (reg_param < GENERAL_REGS-(r)) { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ local_start + (reg_param - this_flag) * sizeof(long)); \
+ reg_param += (i); \
+ } else { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(long)); \
+ stack_param += (i); \
+ }
+
+/*------------------------------------------------------------------*/
+/* Sequence to add a float/double to parameters to stack_from_data */
+/*------------------------------------------------------------------*/
+#define ADD_RSTACK_PARM(i) \
+ if (fpr_param < FLOAT_REGS) { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ float_pos + (fpr_param * sizeof(float) * (i))); \
+ fpr_param++; \
+ } else { \
+ stack_param += (stack_param % (i)); \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(float) * (i)); \
+ stack_param += (i); \
+ }
+
+/*------------------------------------------------------------------*/
+/* Sequence to add a structure ptr to parameters to stack_from_data */
+/*------------------------------------------------------------------*/
+#define ADD_TSTACK_PARM \
+ if (reg_param < GENERAL_REGS) { \
+ s390_l (p, s390_r4, 0, STK_BASE, \
+ local_start + (reg_param - this_flag) * sizeof(long)); \
+ reg_param++; \
+ } else { \
+ s390_l (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(long)); \
+ stack_param++; \
+ }
+
+#define ADD_PSTACK_PARM(r, i) \
+ if (reg_param < GENERAL_REGS-(r)) { \
+ s390_la (p, s390_r4, 0, STK_BASE, \
+ local_start + (reg_param - this_flag) * sizeof(long)); \
+ reg_param += (i); \
+ } else { \
+ s390_l (p, s390_r4, 0, STK_BASE, \
+ sz.stack_size + MINV_POS + stack_param * sizeof(long)); \
+ stack_param++; \
+ }
+typedef enum {
+ s390_r0 = 0,
+ s390_r1,
+ s390_r2,
+ s390_r3,
+ s390_r4,
+ s390_r5,
+ s390_r6,
+ s390_r7,
+ s390_r8,
+ s390_r9,
+ s390_r10,
+ s390_r11,
+ s390_r12,
+ s390_r13,
+ s390_r14,
+ s390_r15,
+} S390IntRegister;
+
+typedef enum {
+ s390_f0 = 0,
+ s390_f1,
+ s390_f2,
+ s390_f3,
+ s390_f4,
+ s390_f5,
+ s390_f6,
+ s390_f7,
+ s390_f8,
+ s390_f9,
+ s390_f10,
+ s390_f11,
+ s390_f12,
+ s390_f13,
+ s390_f14,
+ s390_f15,
+} S390FloatRegister;
+
+typedef enum {
+ s390_a0 = 0,
+ s390_a1,
+ s390_a2,
+ s390_a3,
+ s390_a4,
+ s390_a5,
+ s390_a6,
+ s390_a7,
+ s390_a8,
+ s390_a9,
+ s390_a10,
+ s390_a11,
+ s390_a12,
+ s390_a13,
+ s390_a14,
+ s390_a15,
+} S390AccRegister;
+
+typedef enum {
+ s390_fpc = 256,
+} S390SpecialRegister;
+
+#define s390_is_imm16(val) ((gint)val >= (gint)-(1<<15) && \
+ (gint)val <= (gint)((1<<15)-1))
+#define s390_is_uimm16(val) ((gint)val >= 0 && (gint)val <= 65535)
+#define s390_is_imm12(val) ((gint)val >= (gint)-(1<<11) && \
+ (gint)val <= (gint)((1<<15)-1))
+#define s390_is_uimm12(val) ((gint)val >= 0 && (gint)val <= 4095)
+
+#define STK_BASE s390_r15
+#define S390_MINIMAL_STACK_SIZE 160
+#define S390_REG_SAVE_OFFSET 48
+#define S390_PARM_SAVE_OFFSET 16
+#define S390_RET_ADDR_OFFSET 112
+#define S390_FLOAT_SAVE_OFFSET 128
+
+#define S390_CC_ZR 8
+#define S390_CC_NE 7
+#define S390_CC_NZ 7
+#define S390_CC_LT 4
+#define S390_CC_GT 2
+#define S390_CC_GE 11
+#define S390_CC_LE 13
+#define S390_CC_OV 1
+#define S390_CC_NO 14
+#define S390_CC_CY 3
+#define S390_CC_NC 12
+#define S390_CC_UN 15
+
+#define s390_word(addr, value) do \
+{ \
+ * (guint32 *) addr = (guint32) value; \
+ addr += sizeof(guint32); \
+} while (0)
+
+#define s390_float(addr, value) do \
+{ \
+ * (gfloat *) addr = (gfloat) value; \
+ addr += sizeof(gfloat); \
+} while (0)
+
+#define s390_llong(addr, value) do \
+{ \
+ * (guint64 *) addr = (guint64) value; \
+ addr += sizeof(guint64); \
+} while (0)
+
+#define s390_double(addr, value) do \
+{ \
+ * (gdouble *) addr = (gdouble) value; \
+ addr += sizeof(gdouble); \
+} while (0)
+
+typedef struct {
+ short op;
+} E_Format;
+
+typedef struct {
+ char op;
+ int im;
+} I_Format;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r2 : 4;
+} RR_Format;
+
+typedef struct {
+ short op;
+ char xx;
+ char r1 : 4;
+ char r2 : 4;
+} RRE_Format;
+
+typedef struct {
+ short op;
+ char r1 : 4;
+ char xx : 4;
+ char r3 : 4;
+ char r2 : 4;
+} RRF_Format_1;
+
+typedef struct {
+ short op;
+ char m3 : 4;
+ char xx : 4;
+ char r1 : 4;
+ char r2 : 4;
+} RRF_Format_2;
+
+typedef struct {
+ short op;
+ char r3 : 4;
+ char m4 : 4;
+ char r1 : 4;
+ char r2 : 4;
+} RRF_Format_3;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ short d2 : 12;
+} RX_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ int d2 : 12;
+ char xx;
+ char op2;
+} RXE_Format;
+
+typedef struct {
+ char op1;
+ char r3 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ int d2 : 12;
+ char r1 : 4;
+ char xx : 4;
+ char op2;
+} RXF_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char x2 : 4;
+ char b2 : 4;
+ int d2 : 20;
+ char op2;
+} RXY_Format __attribute__ ((packed));
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ char b2 : 4;
+ int d2 : 12;
+} RS_Format_1;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char m3 : 4;
+ char b2 : 4;
+ int d2 : 12;
+} RS_Format_2;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char xx : 4;
+ char b2 : 4;
+ int d2 : 12;
+} RS_Format_3;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char r3 : 4;
+ char b2 : 4;
+ int d2 : 20;
+ char op2;
+} RSY_Format_1 __attribute__ ((packed));
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char m3 : 4;
+ char b2 : 4;
+ int d2 : 20;
+ char op2;
+} RSY_Format_2 __attribute__ ((packed));
+
+typedef struct {
+ char op1;
+ char l1 : 4;
+ char xx : 4;
+ char b1 : 4;
+ int d1 : 12;
+ char yy;
+ char op2;
+} RSL_Format;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ short i2;
+} RSI_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char op2 : 4;
+ short i2;
+} RI_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char r3 : 4;
+ short i2;
+ char xx;
+ char op2;
+} RIE_Format;
+
+typedef struct {
+ char op1;
+ char r1 : 4;
+ char op2 : 4;
+ int i2;
+} RIL_Format_1 __attribute__ ((packed));
+
+typedef struct {
+ char op1;
+ char m1 : 4;
+ char op2 : 4;
+ int i2;
+} RIL_Format_2 __attribute__ ((packed));
+
+typedef struct {
+ char op;
+ char i2;
+ char b1 : 4;
+ short d1 : 12;
+} SI_Format;
+
+typedef struct {
+ char op1;
+ char i2;
+ char b1 : 4;
+ int d1 : 20;
+ char op2;
+} SIY_Format __attribute__ ((packed));
+
+typedef struct {
+ short op;
+ char b2 : 4;
+ short d2 : 12;
+} S_Format;
+
+typedef struct {
+ char op;
+ char ll;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SS_Format_1;
+
+typedef struct {
+ char op;
+ char l1 : 4;
+ char l2 : 4;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SS_Format_2;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SS_Format_3;
+
+typedef struct {
+ char op;
+ char r1 : 4;
+ char r3 : 4;
+ char b2 : 4;
+ short d2 : 12;
+ char b4 : 4;
+ short d4 : 12;
+} SS_Format_4;
+
+typedef struct {
+ short op;
+ char b1 : 4;
+ short d1 : 12;
+ char b2 : 4;
+ short d2 : 12;
+} SSE_Format __attribute__ ((packed));
+
+#define s390_emit16(c, x) do \
+{ \
+ *((guint16 *) c) = x; \
+ c += sizeof(guint16); \
+} while(0)
+
+#define s390_emit32(c, x) do \
+{ \
+ *((guint32 *) c) = x; \
+ c += sizeof(guint32); \
+} while(0)
+
+#define S390_E(c,opc) s390_emit16(c,opc)
+
+#define S390_I(c,opc,imm) s390_emit16(c, (opc << 8 | imm))
+
+#define S390_RR(c,opc,g1,g2) s390_emit16(c, (opc << 8 | (g1) << 4 | g2))
+
+#define S390_RRE(c,opc,g1,g2) s390_emit32(c, (opc << 16 | (g1) << 4 | g2))
+
+#define S390_RRF_1(c,opc,g1,g2,g3) s390_emit32(c, (opc << 16 | (g1) << 12 | (g3) << 4 | g2))
+
+#define S390_RRF_2(c,opc,g1,k3,g2) s390_emit32(c, (opc << 16 | (k3) << 12 | (g1) << 4 | g2))
+
+#define S390_RRF_3(c,opc,g1,g2,k4,g3) s390_emit32(c, (opc << 16 | (g3) << 12 | (k4) << 8 | (g1) << 4 | g2))
+
+#define S390_RX(c,opc,g1,n2,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (n2) << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RXE(c,opc,g1,n2,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | n2)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfff) << 16) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RXY(c,opc,g1,n2,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | n2)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfff) << 16) | \
+ ((((p2) & 0xff000) >> 12) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RS_1(c,opc,g1,g3,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (g3) << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RS_2(c,opc,g1,k3,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (k3) << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RS_3(c,opc,g1,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_RSY_1(c,opc,g1,g3,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | g3)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfff) << 16) | \
+ ((((p2) & 0xff000) >> 12) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RSY_2(c,opc,g1,k3,s2,p2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | k3)); \
+ s390_emit32(c, ((s2) << 28 | (((p2) & 0xfff) << 16) | \
+ ((((p2) & 0xff000) >> 12) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RSL(c,opc,ln,s1,p1) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (ln) << 4)); \
+ s390_emit32(c, ((s1) << 28 | ((s1 & 0xfff) << 16) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_RSI(c,opc,g1,g3,m2) s390_emit32(c, (opc << 24 | (g1) << 20 | (g3) << 16 | (m2 & 0xffff)))
+
+#define S390_RI(c,opc,g1,m2) s390_emit32(c, ((opc >> 4) << 24 | (g1) << 20 | (opc & 0x0f) << 16 | (m2 & 0xffff)))
+
+#define S390_RIE(c,opc,g1,g3,m2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | (g1) << 4 | g3)); \
+ s390_emit32(c, ((m2) << 16 | (opc & 0xff))); \
+} while (0)
+
+#define S390_RIL_1(c,opc,g1,m2) do \
+{ \
+ s390_emit16(c, ((opc >> 4) << 8 | (g1) << 4 | (opc & 0xf))); \
+ s390_emit32(c, m2); \
+} while (0)
+
+#define S390_RIL_2(c,opc,k1,m2) do \
+{ \
+ s390_emit16(c, ((opc >> 4) << 8 | (k1) << 4 | (opc & 0xf))); \
+ s390_emit32(c, m2); \
+} while (0)
+
+#define S390_SI(c,opc,s1,p1,m2) s390_emit32(c, (opc << 24 | (m2) << 16 | (s1) << 12 | ((p1) & 0xfff)));
+
+#define S390_SIY(c,opc,s1,p1,m2) do \
+{ \
+ s390_emit16(c, ((opc & 0xff00) | m2)); \
+ s390_emit32(c, ((s1) << 24 | (((p2) & 0xfffff) << 8) | \
+ (opc & 0xff))); \
+} while (0)
+
+#define S390_S(c,opc,s2,p2) s390_emit32(c, (opc << 16 | (s2) << 12 | ((p2) & 0xfff)))
+
+#define S390_SS_1(c,opc,ln,s1,p1,s2,p2) do \
+{ \
+ s390_emit32(c, (opc << 24 | ((ln-1) & 0xff) << 16 | \
+ (s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define S390_SS_2(c,opc,n1,n2,s1,p1,s2,p2) do \
+{ \
+ s390_emit32(c, (opc << 24 | (n1) << 16 | (n2) << 12 | \
+ (s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define S390_SS_3(c,opc,g1,g3,s1,p1,s2,p2) do \
+{ \
+ s390_emit32(c, (opc << 24 | (g1) << 16 | (g3) << 12 | \
+ (s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define S390_SS_4(c,opc,g1,g3,s2,p2,s4,p4) do \
+{ \
+ s390_emit32(c, (opc << 24 | (g1) << 16 | (g3) << 12 | \
+ (s2) << 12 | ((p2) & 0xfff))); \
+ s390_emit16(c, ((s4) << 12 | ((p4) & 0xfff))); \
+} while (0)
+
+#define S390_SSE(c,opc,s1,p1,s2,p2) do \
+{ \
+ s390_emit16(c, opc); \
+ s390_emit16(c, ((s1) << 12 | ((p1) & 0xfff))); \
+ s390_emit16(c, ((s2) << 12 | ((p2) & 0xfff))); \
+} while (0)
+
+#define s390_basr(c, r1, r2) S390_RR(c, 0x0d, r1, r2)
+#define s390_bras(c, r, o) S390_RI(c, 0xa75, r, o)
+#define s390_brasl(c, r, o) S390_RIL_1(c, 0xc05, r, o)
+#define s390_ahi(c, r, v) S390_RI(c, 0xa7a, r, v)
+#define s390_aghi(c, r, v) S390_RI(c, 0xa7b, r, v)
+#define s390_alcr(c, r1, r2) S390_RRE(c, 0xb998, r1, r2)
+#define s390_alcgr(c, r1, r2) S390_RRE(c, 0xb988, r1, r2)
+#define s390_ar(c, r1, r2) S390_RR(c, 0x1a, r1, r2)
+#define s390_agr(c, r1, r2) S390_RRE(c, 0xb908, r1, r2)
+#define s390_alr(c, r1, r2) S390_RR(c, 0x1e, r1, r2)
+#define s390_algr(c, r1, r2) S390_RRE(c, 0xb90a, r1, r2)
+#define s390_a(c, r, x, b, d) S390_RX(c, 0x5a, r, x, b, d)
+#define s390_ag(c, r, x, b, d) S390_RXY(c, 0xe308, r, x, b, d)
+#define s390_al(c, r, x, b, d) S390_RX(c, 0x5e, r, x, b, d)
+#define s390_alg(c, r, x, b, d) S390_RXY(c, 0xe30a, r, x, b, d)
+#define s390_slbr(c, r1, r2) S390_RRE(c, 0xb999, r1, r2)
+#define s390_slbgr(c, r1, r2) S390_RRE(c, 0xb989, r1, r2)
+#define s390_sr(c, r1, r2) S390_RR(c, 0x1b, r1, r2)
+#define s390_sgr(c, r1, r2) S390_RRE(c, 0xb909, r1, r2)
+#define s390_slr(c, r1, r2) S390_RR(c, 0x1f, r1, r2)
+#define s390_slgr(c, r1, r2) S390_RRE(c, 0xb90b, r1, r2)
+#define s390_s(c, r, x, b, d) S390_RX(c, 0x5b, r, x, b, d)
+#define s390_sg(c, r, x, b, d) S390_RXY(c, 0xe309, r, x, b, d)
+#define s390_sl(c, r, x, b, d) S390_RX(c, 0x5f, r, x, b, d)
+#define s390_slg(c, r, x, b, d) S390_RXY(c, 0xe30b, r, x, b, d)
+#define s390_mr(c, r1, r2) S390_RR(c, 0x1c, r1, r2)
+#define s390_m(c, r, x, b, d) S390_RX(c, 0x5c, r, x, b, d)
+#define s390_msr(c, r1, r2) S390_RRE(c, 0xb252, r1, r2)
+#define s390_msgr(c, r1, r2) S390_RRE(c, 0xb90c, r1, r2)
+#define s390_msgfr(c, r1, r2) S390_RRE(c, 0xb91c, r1, r2)
+#define s390_ms(c, r, x, b, d) S390_RX(c, 0x71, r, x, b, d)
+#define s390_mlr(c, r1, r2) S390_RRE(c, 0xb996, r1, r2)
+#define s390_mlgr(c, r1, r2) S390_RRE(c, 0xb986, r1, r2)
+#define s390_dr(c, r1, r2) S390_RR(c, 0x1d, r1, r2)
+#define s390_dlr(c, r1, r2) S390_RRE(c, 0xb997, r1, r2)
+#define s390_dlgr(c, r1, r2) S390_RRE(c, 0xb987, r1, r2)
+#define s390_dsgr(c, r1, r2) S390_RRE(c, 0xb90d, r1, r2)
+#define s390_dsgfr(c, r1, r2) S390_RRE(c, 0xb91d, r1, r2)
+#define s390_br(c, r) S390_RR(c, 0x07, 0xf, r)
+#define s390_nr(c, r1, r2) S390_RR(c, 0x14, r1, r2)
+#define s390_ngr(c, r1, r2) S390_RRE(c, 0xb980, r1, r2)
+#define s390_n(c, r, x, b, d) S390_RX(c, 0x54, r, x, b, d)
+#define s390_ng(c, r, x, b, d) S390_RXY(c, 0xe380, r, x, b, d)
+#define s390_or(c, r1, r2) S390_RR(c, 0x16, r1, r2)
+#define s390_ogr(c, r1, r2) S390_RRE(c, 0xb981, r1, r2)
+#define s390_o(c, r, x, b, d) S390_RX(c, 0x56, r, x, b, d)
+#define s390_og(c, r, x, b, d) S390_RXY(c, 0xe381, r, x, b, d)
+#define s390_xr(c, r1, r2) S390_RR(c, 0x17, r1, r2)
+#define s390_xgr(c, r1, r2) S390_RRE(c, 0xb982, r1, r2)
+#define s390_x(c, r, x, b, d) S390_RX(c, 0x57, r, x, b, d)
+#define s390_xg(c, r, x, b, d) S390_RXY(c, 0xe382, r, x, b, d)
+#define s390_lr(c, r1, r2) S390_RR(c, 0x18, r1, r2)
+#define s390_lgr(c, r1, r2) S390_RRE(c, 0xb904, r1, r2)
+#define s390_lgfr(c, r1, r2) S390_RRE(c, 0xb914, r1, r2)
+#define s390_llgfr(c, r1, r2) S390_RRE(c, 0xb916, r1, r2)
+#define s390_ltr(c, r1, r2) S390_RR(c, 0x12, r1, r2)
+#define s390_ltgr(c, r1, r2) S390_RRE(c, 0xb902, r1, r2)
+#define s390_ltgfr(c, r1, r2) S390_RRE(c, 0xb912, r1, r2)
+#define s390_l(c, r, x, b, d) S390_RX(c, 0x58, r, x, b, d)
+#define s390_lg(c, r, x, b, d) S390_RXY(c, 0xe304, r, x, b, d)
+#define s390_lgf(c, r, x, b, d) S390_RXY(c, 0xe314, r, x, b, d)
+#define s390_llgf(c, r, x, b, d) S390_RXY(c, 0xe316, r, x, b, d)
+#define s390_llgc(c, r, x, b, d) S390_RXY(c, 0xe390, r, x, b, d)
+#define s390_llgh(c, r, x, b, d) S390_RXY(c, 0xe391, r, x, b, d)
+#define s390_lb(c, r, x, b, d) S390_RXY(c, 0xe376, r, x, b, d)
+#define s390_lgb(c, r, x, b, d) S390_RXY(c, 0xe377, r, x, b, d)
+#define s390_lcr(c, r1, r2) S390_RR(c, 0x13, r1, r2)
+#define s390_lcgr(c, r1, r2) S390_RRE(c, 0xb903, r1, r2)
+#define s390_lnr(c, r1, r2) S390_RR(c, 0x11, r1, r2)
+#define s390_lngr(c, r1, r2) S390_RRE(c, 0xb901, r1, r2)
+#define s390_lpr(c, r1, r2) S390_RR(c, 0x10, r1, r2)
+#define s390_lpgr(c, r1, r2) S390_RRE(c, 0xb900, r1, r2)
+#define s390_lm(c, r1, r2, b, d) S390_RS_1(c, 0x98, r1, r2, b, d)
+#define s390_lmg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb04, r1, r2, b, d)
+#define s390_lh(c, r, x, b, d) S390_RX(c, 0x48, r, x, b, d)
+#define s390_lhg(c, r, x, b, d) S390_RXY(c, 0xe315, r, x, b, d)
+#define s390_lhi(c, r, v) S390_RI(c, 0xa78, r, v)
+#define s390_lghi(c, r, v) S390_RI(c, 0xa79, r, v)
+#define s390_ic(c, r, x, b, d) S390_RX(c, 0x43, r, x, b, d)
+#define s390_icm(c, r, m, b, d) S390_RX(c, 0xbf, r, m, b, d)
+#define s390_st(c, r, x, b, d) S390_RX(c, 0x50, r, x, b, d)
+#define s390_stg(c, r, x, b, d) S390_RXY(c, 0xe324, r, x, b, d)
+#define s390_stm(c, r1, r2, b, d) S390_RS_1(c, 0x90, r1, r2, b, d)
+#define s390_stmg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb24, r1, r2, b, d)
+#define s390_stam(c, r1, r2, b, d) S390_RS_1(c, 0x9b, r1, r2, b, d)
+#define s390_lam(c, r1, r2, b, d) S390_RS_1(c, 0x9a, r1, r2, b, d)
+#define s390_sth(c, r, x, b, d) S390_RX(c, 0x40, r, x, b, d)
+#define s390_stc(c, r, x, b, d) S390_RX(c, 0x42, r, x, b, d)
+#define s390_stcm(c, r, m, b, d) S390_RX(c, 0xbe, r, m, b, d)
+#define s390_la(c, r, x, b, d) S390_RX(c, 0x41, r, x, b, d)
+#define s390_larl(c, r, o) S390_RIL_1(c, 0xc00, r, o)
+#define s390_ld(c, f, x, b, d) S390_RX(c, 0x68, f, x, b, d)
+#define s390_le(c, f, x, b, d) S390_RX(c, 0x78, f, x, b, d)
+#define s390_std(c, f, x, b, d) S390_RX(c, 0x60, f, x, b, d)
+#define s390_ste(c, f, x, b, d) S390_RX(c, 0x70, f, x, b, d)
+#define s390_mvc(c, l, b1, d1, b2, d2) S390_SS_1(c, 0xd2, l, b1, d1, b2, d2)
+#define s390_mvcl(c, r1, r2) S390_RR(c, 0x0e, r1, r2)
+#define s390_mvcle(c, r1, r3, d2, b2) S390_RS_1(c, 0xa8, r1, r3, d2, b2)
+#define s390_break(c) S390_RR(c, 0, 0, 0)
+#define s390_nill(c, r, v) S390_RI(c, 0xa57, r, v)
+#define s390_nilh(c, r, v) S390_RI(c, 0xa56, r, v)
+#define s390_cr(c, r1, r2) S390_RR(c, 0x19, r1, r2)
+#define s390_cgr(c, r1, r2) S390_RRE(c, 0xb920, r1, r2)
+#define s390_clr(c, r1, r2) S390_RR(c, 0x15, r1, r2)
+#define s390_clgr(c, r1, r2) S390_RRE(c, 0xb921, r1, r2)
+#define s390_c(c, r, x, b, d) S390_RX(c, 0x59, r, x, b, d)
+#define s390_cg(c, r, x, b, d) S390_RXY(c, 0xe320, r, x, b, d)
+#define s390_cl(c, r, x, b, d) S390_RX(c, 0x55, r, x, b, d)
+#define s390_clg(c, r, x, b, d) S390_RXY(c, 0xe321, r, x, b, d)
+#define s390_chi(c, r, i) S390_RI(c, 0xa7e, r, i)
+#define s390_cghi(c, r, i) S390_RI(c, 0xa7f, r, i)
+#define s390_brc(c, m, d) S390_RI(c, 0xa74, m, d)
+#define s390_j(c,d) s390_brc(c, S390_CC_UN, d)
+#define s390_je(c, d) s390_brc(c, S390_CC_EQ, d)
+#define s390_jeo(c, d) s390_brc(c, S390_CC_ZR|S390_CC_OV, d)
+#define s390_jz(c, d) s390_brc(c, S390_CC_ZR, d)
+#define s390_jnz(c, d) s390_brc(c, S390_CC_NZ, d)
+#define s390_jne(c, d) s390_brc(c, S390_CC_NZ, d)
+#define s390_jp(c, d) s390_brc(c, S390_CC_GT, d)
+#define s390_jm(c, d) s390_brc(c, S390_CC_LT, d)
+#define s390_jh(c, d) s390_brc(c, S390_CC_GT, d)
+#define s390_jl(c, d) s390_brc(c, S390_CC_LT, d)
+#define s390_jnh(c, d) s390_brc(c, S390_CC_LE, d)
+#define s390_jo(c, d) s390_brc(c, S390_CC_OV, d)
+#define s390_jnl(c, d) s390_brc(c, S390_CC_GE, d)
+#define s390_jlo(c, d) s390_brc(c, S390_CC_LT|S390_CC_OV, d)
+#define s390_jho(c, d) s390_brc(c, S390_CC_GT|S390_CC_OV, d)
+#define s390_jc(c, m, d) s390_brc(c, m, d)
+#define s390_jcl(c, m, d) S390_RIL_2(c, 0xc04, m, d)
+#define s390_slda(c, r, b, d) S390_RS_3(c, 0x8f, r, b, d)
+#define s390_sldl(c, r, b, d) S390_RS_3(c, 0x8d, r, b, d)
+#define s390_srda(c, r, b, d) S390_RS_3(c, 0x8e, r, b, d)
+#define s390_srdl(c, r, b, d) S390_RS_3(c, 0x8c, r, b, d)
+#define s390_sla(c, r, b, d) S390_RS_3(c, 0x8b, r, b, d)
+#define s390_slag(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0b, r1, r2, b, d)
+#define s390_sll(c, r, b, d) S390_RS_3(c, 0x89, r, b, d)
+#define s390_sllg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0d, r1, r2, b, d)
+#define s390_sra(c, r, b, d) S390_RS_3(c, 0x8a, r, b, d)
+#define s390_srag(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0a, r1, r2, b, d)
+#define s390_srl(c, r, b, d) S390_RS_3(c, 0x88, r, b, d)
+#define s390_srlg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0c, r1, r2, b, d)
+#define s390_sqdbr(c, r1, r2) S390_RRE(c, 0xb315, r1, r2)
+#define s390_sqebr(c, r1, r2) S390_RRE(c, 0xb314, r1, r2)
+#define s390_adbr(c, r1, r2) S390_RRE(c, 0xb31a, r1, r2)
+#define s390_aebr(c, r1, r2) S390_RRE(c, 0xb30a, r1, r2)
+#define s390_adb(c, r, x, b, d) S390_RXE(c, 0xed1a, r, x, b, d)
+#define s390_sdbr(c, r1, r2) S390_RRE(c, 0xb31b, r1, r2)
+#define s390_sebr(c, r1, r2) S390_RRE(c, 0xb30b, r1, r2)
+#define s390_sdb(c, r, x, b, d) S390_RXE(c, 0xed1b, r, x, b, d)
+#define s390_mdbr(c, r1, r2) S390_RRE(c, 0xb31c, r1, r2)
+#define s390_meebr(c, r1, r2) S390_RRE(c, 0xb317, r1, r2)
+#define s390_ldr(c, r1, r2) S390_RR(c, 0x28, r1, r2)
+#define s390_ler(c, r1, r2) S390_RR(c, 0x38, r1, r2)
+#define s390_lzdr(c, r) S390_RRE(c, 0xb375, r, 0)
+#define s390_lzer(c, r) S390_RRE(c, 0xb374, r, 0)
+#define s390_ddbr(c, r1, r2) S390_RRE(c, 0xb31d, r1, r2)
+#define s390_debr(c, r1, r2) S390_RRE(c, 0xb30d, r1, r2)
+#define s390_didbr(c, r1, r2, m, r3) S390_RRF_3(c, 0xb35b, r1, r2, m, r3)
+#define s390_lcdbr(c, r1, r2) S390_RRE(c, 0xb313, r1, r2)
+#define s390_lndbr(c, r1, r2) S390_RRE(c, 0xb311, r1, r2)
+#define s390_ldebr(c, r1, r2) S390_RRE(c, 0xb304, r1, r2)
+#define s390_ledbr(c, r1, r2) S390_RRE(c, 0xb344, r1, r2)
+#define s390_ldeb(c, r, x, b, d) S390_RXE(c, 0xed04, r, x, b, d)
+#define s390_cfdbr(c, r1, m, r2) S390_RRF_2(c, 0xb399, r1, m, r2)
+#define s390_cdfbr(c, r1, r2) S390_RRE(c, 0xb395, r1, r2)
+#define s390_cdbr(c, r1, r2) S390_RRE(c, 0xb319, r1, r2)
+#define s390_cebr(c, r1, r2) S390_RRE(c, 0xb309, r1, r2)
+#define s390_cdb(c, r, x, b, d) S390_RXE(c, 0xed19, r, x, b, d)
+#define s390_tcdb(c, r, x, b, d) S390_RXE(c, 0xed11, r, x, b, d)
+#define s390_tceb(c, r, x, b, d) S390_RXE(c, 0xed10, r, x, b, d)
+#define s390_stfpc(c, b, d) S390_S(c, 0xb29c, b, d)
+#endif
diff --git a/mono/arch/s390x/tramp.c b/mono/arch/s390x/tramp.c
new file mode 100644
index 00000000000..37b8de5c328
--- /dev/null
+++ b/mono/arch/s390x/tramp.c
@@ -0,0 +1,1148 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - tramp.c */
+/* */
+/* Function - Create trampolines to invoke arbitrary functions. */
+/* */
+/* Name - Neale Ferguson. */
+/* */
+/* Date - October, 2002 */
+/* */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define PROLOG_INS 24 /* Size of emitted prolog */
+#define CALL_INS 4 /* Size of emitted call */
+#define EPILOG_INS 18 /* Size of emitted epilog */
+
+#define DEBUG(x)
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#ifdef NEED_MPROTECT
+# include <sys/mman.h>
+# include <limits.h> /* for PAGESIZE */
+# ifndef PAGESIZE
+# define PAGESIZE 4096
+# endif
+#endif
+
+#include "config.h"
+#include <stdlib.h>
+#include <string.h>
+#include "s390x-codegen.h"
+#include "mono/metadata/class.h"
+#include "mono/metadata/tabledefs.h"
+#include "mono/interpreter/interp.h"
+#include "mono/metadata/appdomain.h"
+#include "mono/metadata/marshal.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* Structure used to accummulate size of stack, code, and locals */
+/*------------------------------------------------------------------*/
+typedef struct {
+ guint stack_size,
+ local_size,
+ code_size,
+ retStruct;
+} size_data;
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - add_general */
+/* */
+/* Function - Determine code and stack size incremements for a */
+/* parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void inline
+add_general (guint *gr, size_data *sz, gboolean simple)
+{
+ if (simple) {
+ if (*gr >= GENERAL_REGS) {
+ sz->stack_size += sizeof(long);
+ sz->code_size += 12;
+ } else {
+ sz->code_size += 8;
+ }
+ } else {
+ if (*gr >= GENERAL_REGS - 1) {
+ sz->stack_size += 8 + (sz->stack_size % 8);
+ sz->code_size += 10;
+ } else {
+ sz->code_size += 8;
+ }
+ (*gr) ++;
+ }
+ (*gr) ++;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - calculate_sizes */
+/* */
+/* Function - Determine the amount of space required for code */
+/* and stack. In addition determine starting points */
+/* for stack-based parameters, and area for struct- */
+/* ures being returned on the stack. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void inline
+calculate_sizes (MonoMethodSignature *sig, size_data *sz,
+ gboolean string_ctor)
+{
+ guint i, fr, gr, size;
+ guint32 simpletype, align;
+
+ fr = 0;
+ gr = 2;
+ sz->retStruct = 0;
+ sz->stack_size = S390_MINIMAL_STACK_SIZE;
+ sz->code_size = (PROLOG_INS + CALL_INS + EPILOG_INS);
+ sz->local_size = 0;
+
+ if (sig->hasthis) {
+ add_general (&gr, sz, TRUE);
+ }
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the return code/stack in case we*/
+ /* need to reserve a register to be used to address a stack */
+ /* area that the callee will use. */
+ /*----------------------------------------------------------*/
+
+ if (sig->ret->byref || string_ctor) {
+ sz->code_size += 8;
+ } else {
+ simpletype = sig->ret->type;
+enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_I8:
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ gr++;
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->ret->data.klass, &align);
+ if (align > 1)
+ sz->code_size += 10;
+ switch (size) {
+ /*----------------------------------*/
+ /* On S/390, structures of size 1, */
+ /* 2, 4, and 8 bytes are returned */
+ /* in (a) register(s). */
+ /*----------------------------------*/
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ sz->code_size += 16;
+ sz->stack_size += 4;
+ break;
+ default:
+ sz->retStruct = 1;
+ sz->code_size += 32;
+ }
+ break;
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the parameter code and stack */
+ /* requirements by checking the types and sizes of the */
+ /* parameters. */
+ /*----------------------------------------------------------*/
+
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref) {
+ add_general (&gr, sz, TRUE);
+ continue;
+ }
+ simpletype = sig->params [i]->type;
+ enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ add_general (&gr, sz, TRUE);
+ break;
+ case MONO_TYPE_SZARRAY:
+ add_general (&gr, sz, TRUE);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->params [i]->data.klass, &align);
+ DEBUG(printf("%d typesize: %d (%d)\n",i,size,align));
+ switch (size) {
+ /*----------------------------------*/
+ /* On S/390, structures of size 1, */
+ /* 2, 4, and 8 bytes are passed in */
+ /* (a) register(s). */
+ /*----------------------------------*/
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ add_general(&gr, sz, TRUE);
+ break;
+ case 8:
+ add_general(&gr, sz, FALSE);
+ break;
+ default:
+ sz->local_size += (size + (size % align));
+ sz->code_size += 40;
+ }
+ break;
+ case MONO_TYPE_I8:
+ add_general (&gr, sz, FALSE);
+ break;
+ case MONO_TYPE_R4:
+ if (fr < FLOAT_REGS) {
+ sz->code_size += 4;
+ fr++;
+ }
+ else {
+ sz->code_size += 4;
+ sz->stack_size += 8;
+ }
+ break;
+ case MONO_TYPE_R8:
+ if (fr < FLOAT_REGS) {
+ sz->code_size += 4;
+ fr++;
+ } else {
+ sz->code_size += 4;
+ sz->stack_size += 8 + (sz->stack_size % 8);
+ }
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+
+ /* align stack size to 8 */
+ DEBUG (printf (" stack size: %d (%d)\n"
+ " code size: %d\n"
+ " local size: %d\n",
+ (sz->stack_size + 8) & ~8, sz->stack_size,
+ (sz->code_size),(sz->local_size + 8) & ~8));
+ sz->stack_size = (sz->stack_size + 8) & ~8;
+ sz->local_size = (sz->local_size + 8) & ~8;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_prolog */
+/* */
+/* Function - Create the instructions that implement the stand- */
+/* ard function prolog according to the S/390 ABI. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+emit_prolog (guint8 *p, MonoMethodSignature *sig, size_data *sz)
+{
+ guint stack_size;
+
+ stack_size = sz->stack_size + sz->local_size;
+
+ /* function prolog */
+ s390_stmg(p, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_lg (p, s390_r7, 0, STK_BASE, MINV_POS);
+ s390_lgr (p, s390_r11, STK_BASE);
+ s390_aghi(p, STK_BASE, -stack_size);
+ s390_stg (p, s390_r11, 0, STK_BASE, 0);
+
+ /*-----------------------------------------*/
+ /* Save: */
+ /* - address of "callme" */
+ /* - address of "retval" */
+ /* - address of "arguments" */
+ /*-----------------------------------------*/
+ s390_lgr (p, s390_r9, s390_r2);
+ s390_lgr (p, s390_r8, s390_r3);
+ s390_lgr (p, s390_r10, s390_r5);
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_save_parameters */
+/* */
+/* Function - Create the instructions that load registers with */
+/* parameters, place others on the stack according */
+/* to the S/390 ABI. */
+/* */
+/* The resulting function takes the form: */
+/* void func (void (*callme)(), void *retval, */
+/* void *this_obj, stackval *arguments); */
+/* */
+/*------------------------------------------------------------------*/
+
+inline static guint8*
+emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz)
+{
+ guint i, fr, gr, act_strs, align,
+ stack_par_pos, size, local_pos;
+ guint32 simpletype;
+
+ /*----------------------------------------------------------*/
+ /* If a structure on stack is being returned, reserve r2 */
+ /* to point to an area where it can be passed. */
+ /*----------------------------------------------------------*/
+ if (sz->retStruct)
+ gr = 1;
+ else
+ gr = 0;
+ fr = 0;
+ act_strs = 0;
+ stack_par_pos = S390_MINIMAL_STACK_SIZE;
+ local_pos = sz->stack_size;
+
+ if (sig->hasthis) {
+ s390_lr (p, s390_r2 + gr, s390_r4);
+ gr++;
+ }
+
+ act_strs = 0;
+ for (i = 0; i < sig->param_count; ++i) {
+ DEBUG(printf("par: %d type: %d ref: %d\n",i,sig->params[i]->type,sig->params[i]->byref));
+ if (sig->params [i]->byref) {
+ if (gr < GENERAL_REGS) {
+ s390_lg (p, s390_r2 + gr, 0, ARG_BASE, STKARG);
+ gr ++;
+ } else {
+ s390_lg (p, s390_r0, 0, ARG_BASE, STKARG);
+ s390_stg(p, s390_r0, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ continue;
+ }
+ simpletype = sig->params [i]->type;
+ enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ if (gr < GENERAL_REGS) {
+ s390_lg (p, s390_r2 + gr, 0, ARG_BASE, STKARG);
+ gr ++;
+ } else {
+ s390_lg (p, s390_r0, 0, ARG_BASE, STKARG);
+ s390_stg(p, s390_r0, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->params [i]->data.klass, &align);
+ DEBUG(printf("parStruct - size %d pinvoke: %d\n",size,sig->pinvoke));
+ switch (size) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ if (gr < GENERAL_REGS) {
+ s390_lg (p, s390_r2 + gr, 0,ARG_BASE, STKARG);
+ s390_lgf(p, s390_r2 + gr, 0, s390_r2 + gr, 0);
+ gr++;
+ } else {
+ stack_par_pos += (stack_par_pos % align);
+ s390_lg (p, s390_r10, 0,ARG_BASE, STKARG);
+ s390_lgf(p, s390_r10, 0, s390_r10, 0);
+ s390_st (p, s390_r10, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ break;
+ case 8:
+ if (gr < GENERAL_REGS) {
+ s390_lg (p, s390_r2 + gr, 0, ARG_BASE, STKARG);
+ s390_lg (p, s390_r2 + gr, 0, s390_r2 + gr, 0);
+ } else {
+ stack_par_pos += (stack_par_pos % align);
+ s390_lg (p, s390_r10, 0, ARG_BASE, STKARG);
+ s390_mvc (p, sizeof(long long), STK_BASE, stack_par_pos, s390_r10, 0);
+ stack_par_pos += sizeof(long long);
+ }
+ break;
+ default:
+ if (size <= 256) {
+ local_pos += (local_pos % align);
+ s390_lg (p, s390_r13, 0, ARG_BASE, STKARG);
+ s390_mvc (p, size, STK_BASE, local_pos, s390_r13, 0);
+ s390_la (p, s390_r13, 0, STK_BASE, local_pos);
+ local_pos += size;
+ } else {
+ local_pos += (local_pos % align);
+ s390_bras (p, s390_r13, 4);
+ s390_llong(p, size);
+ s390_lg (p, s390_r1, 0, s390_r13, 0);
+ s390_lg (p, s390_r0, 0, ARG_BASE, STKARG);
+ s390_lgr (p, s390_r14, s390_r12);
+ s390_la (p, s390_r12, 0, STK_BASE, local_pos);
+ s390_lgr (p, s390_r13, s390_r1);
+ s390_mvcl (p, s390_r12, s390_r0);
+ s390_lgr (p, s390_r12, s390_r14);
+ s390_la (p, s390_r13, 0, STK_BASE, local_pos);
+ local_pos += size;
+ }
+ if (gr < GENERAL_REGS) {
+ s390_lgr(p, s390_r2 + gr, s390_r13);
+ gr++;
+ } else {
+ s390_stg(p, s390_r13, 0, STK_BASE, stack_par_pos);
+ stack_par_pos += sizeof(long);
+ }
+ }
+ break;
+ case MONO_TYPE_I8:
+ if (gr < GENERAL_REGS) {
+ s390_lg (p, s390_r2 + gr, 0, ARG_BASE, STKARG);
+ gr += 2;
+ } else {
+ *(guint32 *) p += 7;
+ *(guint32 *) p &= ~7;
+ s390_mvc (p, sizeof(long long), STK_BASE, stack_par_pos, ARG_BASE, STKARG);
+ stack_par_pos += sizeof(long long) + (stack_par_pos % sizeof(long long));
+ }
+ break;
+ case MONO_TYPE_R4:
+ if (fr < FLOAT_REGS) {
+ s390_le (p, s390_r0 + fr, 0, ARG_BASE, STKARG);
+ fr++;
+ } else {
+ s390_mvc (p, sizeof(float), STK_BASE, stack_par_pos, ARG_BASE, STKARG);
+ stack_par_pos += sizeof(float);
+ }
+ break;
+ case MONO_TYPE_R8:
+ if (fr < FLOAT_REGS) {
+ s390_ld (p, s390_r0 + fr, 0, ARG_BASE, STKARG);
+ fr++;
+ } else {
+ *(guint32 *) p += 7;
+ *(guint32 *) p &= ~7;
+ s390_mvc (p, sizeof(double), STK_BASE, stack_par_pos, ARG_BASE, STKARG);
+ stack_par_pos += sizeof(long long) + (stack_par_pos % sizeof(long long));
+ }
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* If we're returning a structure but not in a register */
+ /* then point the result area for the called routine */
+ /*----------------------------------------------------------*/
+ if (sz->retStruct) {
+ s390_lg (p, s390_r2, 0, s390_r8, 0);
+ }
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - alloc_code_memory */
+/* */
+/* Function - Allocate space to place the emitted code. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+alloc_code_memory (guint code_size)
+{
+ guint8 *p;
+
+#ifdef NEED_MPROTECT
+ p = g_malloc (code_size + PAGESIZE - 1);
+
+ /* Align to a multiple of PAGESIZE, assumed to be a power of two */
+ p = (char *)(((int) p + PAGESIZE-1) & ~(PAGESIZE-1));
+#else
+ p = g_malloc (code_size);
+#endif
+ DEBUG (printf (" align: %p (%d)\n", p, (guint)p % 4));
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_call_and_store_retval */
+/* */
+/* Function - Emit code that will implement the call to the */
+/* desired function, and unload the result according */
+/* to the S390 ABI for the type of value returned */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig,
+ size_data *sz, gboolean string_ctor)
+{
+ guint32 simpletype;
+ guint retSize, align;
+
+ /* call "callme" */
+ s390_basr (p, s390_r14, s390_r9);
+
+ /* get return value */
+ if (sig->ret->byref || string_ctor) {
+ s390_stg(p, s390_r2, 0, s390_r8, 0);
+ } else {
+ simpletype = sig->ret->type;
+enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ s390_stc (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ s390_sth (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ s390_st (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_R4:
+ s390_ste (p, s390_f0, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_R8:
+ s390_std (p, s390_f0, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_I8:
+ s390_stg (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ if (sig->pinvoke)
+ retSize = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ retSize = mono_class_value_size (sig->ret->data.klass, &align);
+printf("Returning %d bytes for type %d (%d)\n",retSize,simpletype,sig->pinvoke);
+ switch(retSize) {
+ case 0:
+ break;
+ case 1:
+ s390_stc (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case 2:
+ s390_sth (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case 4:
+ s390_st (p, s390_r2, 0, s390_r8, 0);
+ break;
+ case 8:
+ s390_stg (p, s390_r2, 0, s390_r8, 0);
+ break;
+ default:
+ /*------------------------------------------*/
+ /* The callee has already placed the result */
+ /* in the required area */
+ /*------------------------------------------*/
+ }
+ break;
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x",
+ sig->ret->type);
+ }
+ }
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_epilog */
+/* */
+/* Function - Create the instructions that implement the stand- */
+/* ard function epilog according to the S/390 ABI. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+emit_epilog (guint8 *p, MonoMethodSignature *sig, size_data *sz)
+{
+ /* function epilog */
+ s390_lg (p, STK_BASE, 0, STK_BASE, 0);
+ s390_lg (p, s390_r4, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_lmg (p, s390_r6, STK_BASE, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (p, s390_r4);
+
+ return p;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_trampoline. */
+/* */
+/* Function - Create the code that will allow a mono method to */
+/* invoke a system subroutine. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoPIFunc
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+{
+ guint8 *p, *code_buffer;
+ size_data sz;
+
+ DEBUG (printf ("\nPInvoke [start emiting]\n"));
+ calculate_sizes (sig, &sz, string_ctor);
+
+ p = code_buffer = alloc_code_memory (sz.code_size);
+ p = emit_prolog (p, sig, &sz);
+ p = emit_save_parameters (p, sig, &sz);
+ p = emit_call_and_store_retval (p, sig, &sz, string_ctor);
+ p = emit_epilog (p, sig, &sz);
+
+#ifdef NEED_MPROTECT
+ if (mprotect (code_buffer, 1024, PROT_READ | PROT_WRITE | PROT_EXEC)) {
+ g_error ("Cannot mprotect trampoline\n");
+ }
+#endif
+
+ DEBUG (printf ("emited code size: %d\n", p - code_buffer));
+
+ DEBUG (printf ("PInvoke [end emiting]\n"));
+
+ return (MonoPIFunc) code_buffer;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_method_pointer */
+/* */
+/* Function - Returns a pointer to a native function that can */
+/* be used to call the specified method. */
+/* */
+/* The function created will receive the arguments */
+/* according to the calling convention specified in */
+/* in the method. */
+/* */
+/* This function works by creating a MonoInvocation */
+/* structure, filling the fields in and calling */
+/* ves_exec_method() on it. */
+/* */
+/* Logic: */
+/* ------ */
+/* mono_arch_create_method_pointer (MonoMethod *method) */
+/* create the unmanaged->managed wrapper */
+/* register it with mono_jit_info_table_add() */
+/* */
+/* What does the unmanaged->managed wrapper do? */
+/* allocate a MonoInvocation structure (inv) on the stack */
+/* allocate an array of stackval on the stack with length = */
+/* method->signature->param_count + 1 [call it stack_args] */
+/* set inv->ex, inv->ex_handler, inv->parent to NULL */
+/* set inv->method to method */
+/* if method is an instance method, set inv->obj to the */
+/* 'this' argument (the first argument) else set to NULL */
+/* for each argument to the method call: */
+/* stackval_from_data (sig->params[i], &stack_args[i], */
+/* arg, sig->pinvoke); */
+/* Where: */
+/* ------ */
+/* sig - is method->signature */
+/* &stack_args[i] - is the pointer to the ith element */
+/* in the stackval array */
+/* arg - is a pointer to the argument re- */
+/* ceived by the function according */
+/* to the call convention. If it */
+/* gets passed in a register, save */
+/* on the stack first. */
+/* */
+/* set inv->retval to the address of the last element of */
+/* stack_args [recall we allocated param_count+1 of them] */
+/* call ves_exec_method(inv) */
+/* copy the returned value from inv->retval where the calling */
+/* convention expects to find it on return from the wrap- */
+/* per [if it's a structure, use stackval_to_data] */
+/* */
+/*------------------------------------------------------------------*/
+
+void *
+mono_arch_create_method_pointer (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ MonoJitInfo *ji;
+ guint8 *p, *code_buffer;
+ guint i, align = 0, simple_type, retSize, reg_save = 0,
+ stackval_arg_pos, local_pos, float_pos,
+ local_start, reg_param = 0, stack_param,
+ this_flag, arg_pos, fpr_param, parSize;
+ guint32 simpletype;
+ size_data sz;
+ int *vtbuf, cpos, vt_cur;
+
+ sz.code_size = 1024;
+ sz.stack_size = 1024;
+ stack_param = 0;
+ fpr_param = 0;
+ arg_pos = 0;
+
+ sig = method->signature;
+
+ p = code_buffer = g_malloc (sz.code_size);
+
+ DEBUG (printf ("\nDelegate [start emiting] %s at 0x%08x\n",
+ method->name,p));
+
+ /*----------------------------------------------------------*/
+ /* prolog */
+ /*----------------------------------------------------------*/
+ s390_stmg(p, s390_r6, STK_BASE, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_lg (p, s390_r7, 0, STK_BASE, MINV_POS);
+ s390_lgr (p, s390_r0, STK_BASE);
+ s390_aghi(p, STK_BASE, -(sz.stack_size+MINV_POS));
+ s390_stg (p, s390_r0, 0, STK_BASE, 0);
+ s390_la (p, s390_r8, 0, STK_BASE, 4);
+ s390_lgr (p, s390_r10, s390_r8);
+ s390_lghi(p, s390_r9, sz.stack_size+92);
+ s390_lghi(p, s390_r11, 0);
+ s390_mvcl(p, s390_r8, s390_r10);
+
+ /*----------------------------------------------------------*/
+ /* Let's fill MonoInvocation - first zero some fields */
+ /*----------------------------------------------------------*/
+ s390_lghi (p, s390_r0, 0);
+ s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex)));
+ s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler)));
+ s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent)));
+ s390_lghi (p, s390_r0, 1);
+ s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, invoke_trap)));
+
+ /*----------------------------------------------------------*/
+ /* set method pointer */
+ /*----------------------------------------------------------*/
+ s390_bras (p, s390_r13, 4);
+ s390_llong(p, method);
+ s390_lg (p, s390_r0, 0, s390_r13, 0);
+ s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method)));
+
+ local_start = local_pos = MINV_POS +
+ sizeof (MonoInvocation) + (sig->param_count + 1) * sizeof (stackval);
+ this_flag = (sig->hasthis ? 1 : 0);
+
+ /*----------------------------------------------------------*/
+ /* if we are returning a structure, checks it's length to */
+ /* see if there's a "hidden" parameter that points to the */
+ /* area. If necessary save this hidden parameter for later */
+ /*----------------------------------------------------------*/
+ if (MONO_TYPE_ISSTRUCT(sig->ret)) {
+ if (sig->pinvoke)
+ retSize = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ retSize = mono_class_value_size (sig->ret->data.klass, &align);
+ switch(retSize) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ sz.retStruct = 0;
+ break;
+ default:
+ sz.retStruct = 1;
+ s390_lgr(p, s390_r8, s390_r2);
+ reg_save = 1;
+ }
+ } else {
+ reg_save = 0;
+ }
+
+ if (this_flag) {
+ s390_stg (p, s390_r2 + reg_save, 0, STK_BASE,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)));
+ reg_param++;
+ } else {
+ s390_stg (p, s390_r2 + reg_save, 0, STK_BASE, local_pos);
+ local_pos += sizeof(int);
+ s390_stg (p, s390_r0, 0, STK_BASE,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)));
+ }
+
+ s390_stmg (p, s390_r3 + reg_param, s390_r6, STK_BASE, local_pos);
+ local_pos += 4 * sizeof(long);
+ float_pos = local_pos;
+ s390_std (p, s390_f0, 0, STK_BASE, local_pos);
+ local_pos += sizeof(double);
+ s390_std (p, s390_f2, 0, STK_BASE, local_pos);
+ local_pos += sizeof(double);
+
+ /*----------------------------------------------------------*/
+ /* prepare space for valuetypes */
+ /*----------------------------------------------------------*/
+ vt_cur = local_pos;
+ vtbuf = alloca (sizeof(int)*sig->param_count);
+ cpos = 0;
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *type = sig->params [i];
+ vtbuf [i] = -1;
+ DEBUG(printf("par: %d type: %d ref: %d\n",i,type->type,type->byref));
+ if (type->type == MONO_TYPE_VALUETYPE) {
+ MonoClass *klass = type->data.klass;
+ gint size;
+
+ if (klass->enumtype)
+ continue;
+ size = mono_class_native_size (klass, &align);
+ cpos += align - 1;
+ cpos &= ~(align - 1);
+ vtbuf [i] = cpos;
+ cpos += size;
+ }
+ }
+ cpos += 3;
+ cpos &= ~3;
+
+ local_pos += cpos;
+
+ /*----------------------------------------------------------*/
+ /* set MonoInvocation::stack_args */
+ /*----------------------------------------------------------*/
+ stackval_arg_pos = MINV_POS + sizeof (MonoInvocation);
+ s390_la (p, s390_r0, 0, STK_BASE, stackval_arg_pos);
+ s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args)));
+
+ /*----------------------------------------------------------*/
+ /* add stackval arguments */
+ /*----------------------------------------------------------*/
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref) {
+ ADD_ISTACK_PARM(0, 1);
+ } else {
+ simple_type = sig->params [i]->type;
+ enum_savechk:
+ switch (simple_type) {
+ case MONO_TYPE_I8:
+ ADD_ISTACK_PARM(-1, 2);
+ break;
+ case MONO_TYPE_R4:
+ ADD_RSTACK_PARM(1);
+ break;
+ case MONO_TYPE_R8:
+ ADD_RSTACK_PARM(2);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simple_type = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_savechk;
+ }
+ if (sig->pinvoke)
+ parSize = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ parSize = mono_class_value_size (sig->params [i]->data.klass, &align);
+ switch(parSize) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ ADD_PSTACK_PARM(0, 1);
+ break;
+ case 8:
+ ADD_PSTACK_PARM(-1, 2);
+ break;
+ default:
+ ADD_TSTACK_PARM;
+ }
+ break;
+ default:
+ ADD_ISTACK_PARM(0, 1);
+ }
+ }
+
+ if (vtbuf [i] >= 0) {
+ s390_la (p, s390_r3, 0, STK_BASE, vt_cur);
+ s390_stg (p, s390_r3, 0, STK_BASE, stackval_arg_pos);
+ s390_la (p, s390_r3, 0, STK_BASE, stackval_arg_pos);
+ vt_cur += vtbuf [i];
+ } else {
+ s390_la (p, s390_r3, 0, STK_BASE, stackval_arg_pos);
+ }
+
+ /*--------------------------------------*/
+ /* Load the parameter registers for the */
+ /* call to stackval_from_data */
+ /*--------------------------------------*/
+ s390_bras (p, s390_r13, 8);
+ s390_llong(p, sig->params [i]);
+ s390_llong(p, sig->pinvoke);
+ s390_llong(p, stackval_from_data);
+ s390_lg (p, s390_r2, 0, s390_r13, 0);
+ s390_lg (p, s390_r5, 0, s390_r13, 4);
+ s390_lg (p, s390_r1, 0, s390_r13, 8);
+ s390_basr (p, s390_r14, s390_r1);
+
+ stackval_arg_pos += sizeof(stackval);
+
+ /* fixme: alignment */
+ DEBUG (printf ("arg_pos %d --> ", arg_pos));
+ if (sig->pinvoke)
+ arg_pos += mono_type_native_stack_size (sig->params [i], &align);
+ else
+ arg_pos += mono_type_stack_size (sig->params [i], &align);
+
+ DEBUG (printf ("%d\n", stackval_arg_pos));
+ }
+
+ /*----------------------------------------------------------*/
+ /* Set return area pointer. */
+ /*----------------------------------------------------------*/
+ s390_la (p, s390_r10, 0, STK_BASE, stackval_arg_pos);
+ s390_stg(p, s390_r10, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)));
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ s390_la (p, s390_r9, 0, s390_r10, sizeof(stackval));
+ s390_st (p, s390_r9, 0,STK_BASE, stackval_arg_pos);
+ stackval_arg_pos += sizeof(stackval);
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* call ves_exec_method */
+ /*----------------------------------------------------------*/
+ s390_bras (p, s390_r13, 4);
+ s390_llong(p, ves_exec_method);
+ s390_lg (p, s390_r1, 0, s390_r13, 0);
+ s390_la (p, s390_r2, 0, STK_BASE, MINV_POS);
+ s390_basr (p, s390_r14, s390_r1);
+
+ /*----------------------------------------------------------*/
+ /* move retval from stackval to proper place (r3/r4/...) */
+ /*----------------------------------------------------------*/
+ DEBUG(printf("retType: %d byRef: %d\n",sig->ret->type,sig->ret->byref));
+ if (sig->ret->byref) {
+ DEBUG (printf ("ret by ref\n"));
+ s390_stg(p, s390_r2, 0, s390_r10, 0);
+ } else {
+ enum_retvalue:
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U1:
+ s390_lghi(p, s390_r2, 0);
+ s390_ic (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ s390_lh (p, s390_r2, 0,s390_r10, 0);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ s390_lgf(p, s390_r2, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_I8:
+ s390_lg (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_R4:
+ s390_le (p, s390_f0, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_R8:
+ s390_ld (p, s390_f0, 0, s390_r10, 0);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ /*---------------------------------*/
+ /* Call stackval_to_data to return */
+ /* the structure */
+ /*---------------------------------*/
+ s390_bras (p, s390_r13, 8);
+ s390_llong(p, sig->ret);
+ s390_llong(p, sig->pinvoke);
+ s390_llong(p, stackval_to_data);
+ s390_lg (p, s390_r2, 0, s390_r13, 0);
+ s390_lg (p, s390_r3, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)));
+ if (sz.retStruct) {
+ /*------------------------------------------*/
+ /* Get stackval_to_data to set result area */
+ /*------------------------------------------*/
+ s390_lgr (p, s390_r4, s390_r8);
+ } else {
+ /*------------------------------------------*/
+ /* Give stackval_to_data a temp result area */
+ /*------------------------------------------*/
+ s390_la (p, s390_r4, 0, STK_BASE, stackval_arg_pos);
+ }
+ s390_lg (p, s390_r5, 0,s390_r13, 4);
+ s390_lg (p, s390_r1, 0, s390_r13, 8);
+ s390_basr (p, s390_r14, s390_r1);
+ switch (retSize) {
+ case 0:
+ break;
+ case 1:
+ s390_lghi(p, s390_r2, 0);
+ s390_ic (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case 2:
+ s390_lh (p, s390_r2, 0, s390_r10, 0);
+ break;
+ case 4:
+ s390_lgf(p, s390_r2, 0, s390_r10, 0);
+ break;
+ case 8:
+ s390_lg (p, s390_r2, 0, s390_r10, 0);
+ break;
+ default:
+ /*-------------------------------------------------*/
+ /* stackval_to_data has placed data in result area */
+ /*-------------------------------------------------*/
+ }
+ break;
+ default:
+ g_error ("Type 0x%x not handled yet in thunk creation",
+ sig->ret->type);
+ break;
+ }
+ }
+
+ /*----------------------------------------------------------*/
+ /* epilog */
+ /*----------------------------------------------------------*/
+ s390_lg (p, STK_BASE, 0, STK_BASE, 0);
+ s390_lg (p, s390_r4, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_lmg (p, s390_r6, STK_BASE, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (p, s390_r4);
+
+ DEBUG (printf ("emited code size: %d\n", p - code_buffer));
+
+ DEBUG (printf ("Delegate [end emiting]\n"));
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = p - code_buffer;
+ ji->code_start = code_buffer;
+
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
+
+ return ji->code_start;
+}
+
+/*========================= End of Function ========================*/
diff --git a/mono/arch/sparc/.cvsignore b/mono/arch/sparc/.cvsignore
index 282522db034..051d1bd50ba 100644
--- a/mono/arch/sparc/.cvsignore
+++ b/mono/arch/sparc/.cvsignore
@@ -1,2 +1,3 @@
Makefile
Makefile.in
+.deps
diff --git a/mono/arch/sparc/sparc-codegen.h b/mono/arch/sparc/sparc-codegen.h
index 04a23c35822..2e447a42a41 100644
--- a/mono/arch/sparc/sparc-codegen.h
+++ b/mono/arch/sparc/sparc-codegen.h
@@ -1,6 +1,11 @@
#ifndef __SPARC_CODEGEN_H__
#define __SPARC_CODEGEN_H__
+#if SIZEOF_VOID_P == 8
+#define SPARCV9 1
+#else
+#endif
+
typedef enum {
sparc_r0 = 0,
sparc_r1 = 1,
@@ -152,29 +157,66 @@ typedef enum {
} SparcFCond;
typedef enum {
+ sparc_icc = 4,
+ sparc_xcc = 6,
+ sparc_fcc0 = 0,
+ sparc_fcc1 = 1,
+ sparc_fcc2 = 2,
+ sparc_fcc3 = 3
+} SparcCC;
+
+typedef enum {
+ sparc_icc_short = 0,
+ sparc_xcc_short = 2
+} SparcCCShort;
+
+typedef enum {
/* fop1 format */
- sparc_fitos = 196,
- sparc_fitod = 200,
- sparc_fstoi = 209,
- sparc_fdtoi = 210,
- sparc_fstod = 201,
- sparc_fdtos = 198,
- sparc_fmov = 1,
- sparc_fneg = 5,
- sparc_fabs = 9,
- sparc_fsqrts = 41,
- sparc_fsqrtd = 42,
- sparc_fadds = 65,
- sparc_faddd = 66,
- sparc_fsubs = 69,
- sparc_fsubd = 70,
- sparc_fmuls = 73,
- sparc_fmuld = 74,
- sparc_fdivs = 77,
- sparc_fdivd = 78,
+ sparc_fitos_val = 196,
+ sparc_fitod_val = 200,
+ sparc_fitoq_val = 204,
+ sparc_fxtos_val = 132,
+ sparc_fxtod_val = 136,
+ sparc_fxtoq_val = 140,
+ sparc_fstoi_val = 209,
+ sparc_fdtoi_val = 210,
+ sparc_fqtoi_val = 211,
+ sparc_fstod_val = 201,
+ sparc_fstoq_val = 205,
+ sparc_fdtos_val = 198,
+ sparc_fdtoq_val = 206,
+ sparc_fqtos_val = 199,
+ sparc_fqtod_val = 203,
+ sparc_fmovs_val = 1,
+ sparc_fmovd_val = 2,
+ sparc_fnegs_val = 5,
+ sparc_fnegd_val = 6,
+ sparc_fabss_val = 9,
+ sparc_fabsd_val = 10,
+ sparc_fsqrts_val = 41,
+ sparc_fsqrtd_val = 42,
+ sparc_fsqrtq_val = 43,
+ sparc_fadds_val = 65,
+ sparc_faddd_val = 66,
+ sparc_faddq_val = 67,
+ sparc_fsubs_val = 69,
+ sparc_fsubd_val = 70,
+ sparc_fsubq_val = 71,
+ sparc_fmuls_val = 73,
+ sparc_fmuld_val = 74,
+ sparc_fmulq_val = 75,
+ sparc_fsmuld_val = 105,
+ sparc_fdmulq_val = 111,
+ sparc_fdivs_val = 77,
+ sparc_fdivd_val = 78,
+ sparc_fdivq_val = 79,
/* fop2 format */
- sparc_fcmps = 81,
- sparc_fcmpd = 82
+ sparc_fcmps_val = 81,
+ sparc_fcmpd_val = 82,
+ sparc_fcmpq_val = 83,
+ sparc_fcmpes_val = 85,
+ sparc_fcmped_val = 86,
+ sparc_fcmpeq_val = 87
} SparcFOp;
typedef struct {
@@ -198,6 +240,28 @@ typedef struct {
} sparc_format2b;
typedef struct {
+ unsigned int op : 2; /* always 0 */
+ unsigned int a : 1;
+ unsigned int cond : 4;
+ unsigned int op2 : 3;
+ unsigned int cc01 : 2;
+ unsigned int p : 1;
+ unsigned int d19 : 19;
+} sparc_format2c;
+
+typedef struct {
+ unsigned int op : 2; /* always 0 */
+ unsigned int a : 1;
+ unsigned int res : 1;
+ unsigned int rcond: 3;
+ unsigned int op2 : 3;
+ unsigned int d16hi: 2;
+ unsigned int p : 1;
+ unsigned int rs1 : 5;
+ unsigned int d16lo: 14;
+} sparc_format2d;
+
+typedef struct {
unsigned int op : 2; /* 2 or 3 */
unsigned int rd : 5;
unsigned int op3 : 6;
@@ -213,6 +277,17 @@ typedef struct {
unsigned int op3 : 6;
unsigned int rs1 : 5;
unsigned int i : 1;
+ unsigned int x : 1;
+ unsigned int asi : 7;
+ unsigned int rs2 : 5;
+} sparc_format3ax;
+
+typedef struct {
+ unsigned int op : 2; /* 2 or 3 */
+ unsigned int rd : 5;
+ unsigned int op3 : 6;
+ unsigned int rs1 : 5;
+ unsigned int i : 1;
unsigned int imm : 13;
} sparc_format3b;
@@ -221,13 +296,83 @@ typedef struct {
unsigned int rd : 5;
unsigned int op3 : 6;
unsigned int rs1 : 5;
+ unsigned int i : 1;
+ unsigned int x : 1;
+ unsigned int imm : 12;
+} sparc_format3bx;
+
+typedef struct {
+ unsigned int op : 2; /* 2 or 3 */
+ unsigned int rd : 5;
+ unsigned int op3 : 6;
+ unsigned int rs1 : 5;
unsigned int opf : 9;
unsigned int rs2 : 5;
} sparc_format3c;
+typedef struct {
+ unsigned int op : 2;
+ unsigned int rd : 5;
+ unsigned int op3 : 6;
+ unsigned int rs1 : 5;
+ unsigned int i : 1;
+ unsigned int cc01 : 2;
+ unsigned int res : 6;
+ unsigned int rs2 : 5;
+} sparc_format4a;
+
+typedef struct {
+ unsigned int op : 2;
+ unsigned int rd : 5;
+ unsigned int op3 : 6;
+ unsigned int rs1 : 5;
+ unsigned int i : 1;
+ unsigned int cc01 : 2;
+ unsigned int simm : 11;
+} sparc_format4b;
+
+typedef struct {
+ unsigned int op : 2;
+ unsigned int rd : 5;
+ unsigned int op3 : 6;
+ unsigned int cc2 : 1;
+ unsigned int cond : 4;
+ unsigned int i : 1;
+ unsigned int cc01 : 2;
+ unsigned int res : 6;
+ unsigned int rs2 : 5;
+} sparc_format4c;
+
+typedef struct {
+ unsigned int op : 2;
+ unsigned int rd : 5;
+ unsigned int op3 : 6;
+ unsigned int cc2 : 1;
+ unsigned int cond : 4;
+ unsigned int i : 1;
+ unsigned int cc01 : 2;
+ unsigned int simm : 11;
+} sparc_format4d;
+
/* for use in logical ops, use 0 to not set flags */
#define sparc_cc 16
+#define sparc_is_imm13(val) ((glong)val >= (glong)-(1<<12) && (glong)val <= (glong)((1<<12)-1))
+#define sparc_is_imm22(val) ((glong)val >= (glong)-(1<<21) && (glong)val <= (glong)((1<<21)-1))
+#define sparc_is_imm16(val) ((glong)val >= (glong)-(1<<15) && (glong)val <= (glong)((1<<15)-1))
+#define sparc_is_imm19(val) ((glong)val >= (glong)-(1<<18) && (glong)val <= (glong)((1<<18)-1))
+#define sparc_is_imm30(val) ((glong)val >= (glong)-(1<<29) && (glong)val <= (glong)((1<<29)-1))
+
+/* disassembly */
+#define sparc_inst_op(inst) ((inst) >> 30)
+#define sparc_inst_op2(inst) (((inst) >> 22) & 0x7)
+#define sparc_inst_rd(inst) (((inst) >> 25) & 0x1f)
+#define sparc_inst_op3(inst) (((inst) >> 19) & 0x3f)
+#define sparc_inst_rs1(inst) (((inst) >> 14) & 0x1f)
+#define sparc_inst_rs2(inst) (((inst) >> 0) & 0x1f)
+#define sparc_inst_imm(inst) (((inst) >> 13) & 0x1)
+#define sparc_inst_imm13(inst) (((inst) >> 0) & 0x1fff)
+
#define sparc_encode_call(ins,addr) \
do { \
sparc_format1 *__f = (sparc_format1*)(ins); \
@@ -257,6 +402,34 @@ typedef struct {
(ins) = (unsigned int*)__f + 1; \
} while (0)
+#define sparc_encode_format2c(ins,aval,bcond,oper,xcc,predict,disp19) \
+ do { \
+ sparc_format2c *__f = (sparc_format2c*)(ins); \
+ __f->op = 0; \
+ __f->a = (aval); \
+ __f->cond = (bcond); \
+ __f->op2 = (oper); \
+ __f->cc01 = (xcc); \
+ __f->p = (predict); \
+ __f->d19 = (disp19); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
+#define sparc_encode_format2d(ins,aval,bcond,oper,predict,r1,disp16) \
+ do { \
+ sparc_format2d *__f = (sparc_format2d*)(ins); \
+ __f->op = 0; \
+ __f->a = (aval); \
+ __f->res = 0; \
+ __f->rcond = (bcond); \
+ __f->op2 = (oper); \
+ __f->d16hi = ((disp16) >> 14); \
+ __f->p = (predict); \
+ __f->rs1 = (r1); \
+ __f->d16lo = ((disp16) & 0x3fff); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
#define sparc_encode_format3a(ins,opval,asival,r1,r2,oper,dest) \
do { \
sparc_format3a *__f = (sparc_format3a*)(ins); \
@@ -270,6 +443,20 @@ typedef struct {
(ins) = (unsigned int*)__f + 1; \
} while (0)
+#define sparc_encode_format3ax(ins,opval,asival,r1,r2,oper,dest) \
+ do { \
+ sparc_format3ax *__f = (sparc_format3ax*)(ins); \
+ __f->op = (opval); \
+ __f->asi = (asival); \
+ __f->i = 0; \
+ __f->x = 1; \
+ __f->rd = (dest); \
+ __f->rs1 = (r1); \
+ __f->rs2 = (r2); \
+ __f->op3 = (oper); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
#define sparc_encode_format3b(ins,opval,r1,val,oper,dest) \
do { \
sparc_format3b *__f = (sparc_format3b*)(ins); \
@@ -282,6 +469,19 @@ typedef struct {
(ins) = (unsigned int*)__f + 1; \
} while (0)
+#define sparc_encode_format3bx(ins,opval,r1,val,oper,dest) \
+ do { \
+ sparc_format3bx *__f = (sparc_format3bx*)(ins); \
+ __f->op = (opval); \
+ __f->imm = (val); \
+ __f->i = 1; \
+ __f->x = 1; \
+ __f->rd = (dest); \
+ __f->rs1 = (r1); \
+ __f->op3 = (oper); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
#define sparc_encode_format3c(ins,opval,opfval,r1,oper,r2,dest) \
do { \
sparc_format3c *__f = (sparc_format3c*)(ins); \
@@ -294,6 +494,62 @@ typedef struct {
(ins) = (unsigned int*)__f + 1; \
} while (0)
+#define sparc_encode_format4a(ins,opval,oper,cc,r1,r2,dest) \
+ do { \
+ sparc_format4a *__f = (sparc_format4a*)(ins); \
+ __f->op = (opval); \
+ __f->rd = (dest); \
+ __f->op3 = (oper); \
+ __f->rs1 = (r1); \
+ __f->i = 0; \
+ __f->cc01= (cc) & 0x3; \
+ __f->res = 0; \
+ __f->rs2 = (r2); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
+#define sparc_encode_format4b(ins,opval,oper,cc,r1,imm,dest) \
+ do { \
+ sparc_format4b *__f = (sparc_format4b*)(ins); \
+ __f->op = (opval); \
+ __f->rd = (dest); \
+ __f->op3 = (oper); \
+ __f->rs1 = (r1); \
+ __f->i = 1; \
+ __f->cc01= (cc) & 0x3; \
+ __f->simm = (imm); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
+#define sparc_encode_format4c(ins,opval,oper,cc,bcond,r2,dest) \
+ do { \
+ sparc_format4c *__f = (sparc_format4c*)(ins); \
+ __f->op = (opval); \
+ __f->rd = (dest); \
+ __f->op3 = (oper); \
+ __f->cc2 = ((xcc) >> 2) & 0x1; \
+ __f->cond = bcond; \
+ __f->i = 0; \
+ __f->cc01= (xcc) & 0x3; \
+ __f->res = 0; \
+ __f->rs2 = (r2); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
+#define sparc_encode_format4d(ins,opval,oper,xcc,bcond,imm,dest) \
+ do { \
+ sparc_format4d *__f = (sparc_format4d*)(ins); \
+ __f->op = (opval); \
+ __f->rd = (dest); \
+ __f->op3 = (oper); \
+ __f->cc2 = ((xcc) >> 2) & 0x1; \
+ __f->cond = bcond; \
+ __f->i = 1; \
+ __f->cc01= (xcc) & 0x3; \
+ __f->simm = (imm); \
+ (ins) = (unsigned int*)__f + 1; \
+ } while (0)
+
/* is it useful to provide a non-default value? */
#define sparc_asi 0x0
@@ -313,6 +569,13 @@ typedef struct {
#define sparc_ld(ins,base,disp,dest) sparc_encode_format3a((ins),3,sparc_asi,(base),(disp),0,(dest))
#define sparc_ld_imm(ins,base,disp,dest) sparc_encode_format3b((ins),3,(base),(disp),0,(dest))
+/* Sparc V9 */
+#define sparc_ldx(ins,base,disp,dest) sparc_encode_format3a((ins),3,sparc_asi,(base),(disp),11,(dest))
+#define sparc_ldx_imm(ins,base,disp,dest) sparc_encode_format3b((ins),3,(base),(disp),11,(dest))
+
+#define sparc_ldsw(ins,base,disp,dest) sparc_encode_format3a((ins),3,sparc_asi,(base),(disp),8,(dest))
+#define sparc_ldsw_imm(ins,base,disp,dest) sparc_encode_format3b((ins),3,(base),(disp),8,(dest))
+
#define sparc_ldd(ins,base,disp,dest) sparc_encode_format3a((ins),3,sparc_asi,(base),(disp),3,(dest))
#define sparc_ldd_imm(ins,base,disp,dest) sparc_encode_format3b((ins),3,(base),(disp),3,(dest))
@@ -332,6 +595,10 @@ typedef struct {
#define sparc_st(ins,src,base,disp) sparc_encode_format3a((ins),3,sparc_asi,(base),(disp),4,(src))
#define sparc_st_imm(ins,src,base,disp) sparc_encode_format3b((ins),3,(base),(disp),4,(src))
+/* Sparc V9 */
+#define sparc_stx(ins,src,base,disp) sparc_encode_format3a((ins),3,sparc_asi,(base),(disp),14,(src))
+#define sparc_stx_imm(ins,src,base,disp) sparc_encode_format3b((ins),3,(base),(disp),14,(src))
+
#define sparc_std(ins,src,base,disp) sparc_encode_format3a((ins),3,sparc_asi,(base),(disp),7,(src))
#define sparc_std_imm(ins,src,base,disp) sparc_encode_format3b((ins),3,(base),(disp),7,(src))
@@ -360,10 +627,13 @@ typedef struct {
#define sparc_restore(ins,src,disp,dest) sparc_encode_format3a((ins),2,0,(src),(disp),61,(dest))
#define sparc_restore_imm(ins,src,disp,dest) sparc_encode_format3b((ins),2,(src),(disp),61,(dest))
+#define sparc_rett(ins,src,disp) sparc_encode_format3a((ins),2,0,(src),(disp),0x39,0)
+#define sparc_rett_imm(ins,src,disp) sparc_encode_format3b((ins),2,(src),(disp),0x39,0)
+
#define sparc_jmpl(ins,base,disp,dest) sparc_encode_format3a((ins),2,0,(base),(disp),56,(dest))
#define sparc_jmpl_imm(ins,base,disp,dest) sparc_encode_format3b((ins),2,(base),(disp),56,(dest))
-#define sparc_call_simple(ins,addr) sparc_encode_call((ins),((unsigned int)(addr)>>2))
+#define sparc_call_simple(ins,disp) sparc_encode_call((ins),((unsigned int)(disp)))
#define sparc_rdy(ins,dest) sparc_encode_format3a((ins),2,0,0,0,40,(dest))
@@ -377,17 +647,90 @@ typedef struct {
#define sparc_flush(ins,base,disp) sparc_encode_format3a((ins),2,0,(base),(disp),59,0)
#define sparc_flush_imm(ins,base,disp) sparc_encode_format3b((ins),2,(base),(disp),59,0)
+#define sparc_flushw(ins) sparc_encode_format3a((ins),2,0,0,0,43,0)
+
/* trap */
+#define sparc_ta(ins,tt) sparc_encode_format3b((ins),2,0,(tt),58,0x8)
+
/* alu fop */
/* provide wrappers for: fitos, fitod, fstoi, fdtoi, fstod, fdtos, fmov, fneg, fabs */
#define sparc_fop(ins,r1,op,r2,dest) sparc_encode_format3c((ins),2,(op),(r1),52,(r2),(dest))
#define sparc_fcmp(ins,r1,op,r2) sparc_encode_format3c((ins),2,(op),(r1),53,(r2),0)
+/* format 1 fops */
+#define sparc_fadds(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fadds_val, r2, dest )
+#define sparc_faddd(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_faddd_val, r2, dest )
+#define sparc_faddq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_faddq_val, r2, dest )
+
+#define sparc_fsubs(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubs_val, r2, dest )
+#define sparc_fsubd(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubd_val, r2, dest )
+#define sparc_fsubq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubq_val, r2, dest )
+
+#define sparc_fmuls( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmuls_val, r2, dest )
+#define sparc_fmuld( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmuld_val, r2, dest )
+#define sparc_fmulq( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmulq_val, r2, dest )
+
+#define sparc_fsmuld( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fsmuld_val, r2, dest )
+#define sparc_fdmulq( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdmulq_val, r2, dest )
+
+#define sparc_fdivs( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdivs_val, r2, dest )
+#define sparc_fdivd( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdivd_val, r2, dest )
+#define sparc_fdivq( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fdivq_val, r2, dest )
+
+#define sparc_fitos( ins, r2, dest ) sparc_fop( ins, 0, sparc_fitos_val, r2, dest )
+#define sparc_fitod( ins, r2, dest ) sparc_fop( ins, 0, sparc_fitod_val, r2, dest )
+#define sparc_fitoq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fitoq_val, r2, dest )
+
+#define sparc_fxtos( ins, r2, dest) sparc_fop( ins, 0, sparc_fxtos_val, r2, dest )
+#define sparc_fxtod( ins, r2, dest) sparc_fop( ins, 0, sparc_fxtod_val, r2, dest )
+#define sparc_fxtoq( ins, r2, dest) sparc_fop( ins, 0, sparc_fxtoq_val, r2, dest )
+
+#define sparc_fstoi( ins, r2, dest ) sparc_fop( ins, 0, sparc_fstoi_val, r2, dest )
+#define sparc_fdtoi( ins, r2, dest ) sparc_fop( ins, 0, sparc_fdtoi_val, r2, dest )
+#define sparc_fqtoi( ins, r2, dest ) sparc_fop( ins, 0, sparc_fqtoi_val, r2, dest )
+
+#define sparc_fstod( ins, r2, dest ) sparc_fop( ins, 0, sparc_fstod_val, r2, dest )
+#define sparc_fstoq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fstoq_val, r2, dest )
+
+#define sparc_fdtos( ins, r2, dest ) sparc_fop( ins, 0, sparc_fdtos_val, r2, dest )
+#define sparc_fdtoq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fdtoq_val, r2, dest )
+
+#define sparc_fqtos( ins, r2, dest ) sparc_fop( ins, 0, sparc_fqtos_val, r2, dest )
+#define sparc_fqtod( ins, r2, dest ) sparc_fop( ins, 0, sparc_fqtod_val, r2, dest )
+
+#define sparc_fmovs( ins, r2, dest ) sparc_fop( ins, 0, sparc_fmovs_val, r2, dest )
+#define sparc_fnegs( ins, r2, dest ) sparc_fop( ins, 0, sparc_fnegs_val, r2, dest )
+#define sparc_fabss( ins, r2, dest ) sparc_fop( ins, 0, sparc_fabss_val, r2, dest )
+
+#define sparc_fmovd( ins, r2, dest) sparc_fop (ins, 0, sparc_fmovd_val, r2, dest);
+#define sparc_fnegd( ins, r2, dest) sparc_fop (ins, 0, sparc_fnegd_val, r2, dest);
+#define sparc_fabsd( ins, r2, dest) sparc_fop (ins, 0, sparc_fabsd_val, r2, dest);
+
+#define sparc_fsqrts( ins, r2, dest ) sparc_fop( ins, 0, sparc_fsqrts_val, r2, dest )
+#define sparc_fsqrtd( ins, r2, dest ) sparc_fop( ins, 0, sparc_fsqrtd_val, r2, dest )
+#define sparc_fsqrtq( ins, r2, dest ) sparc_fop( ins, 0, sparc_fsqrtq_val, r2, dest )
+
+/* format 2 fops */
+
+#define sparc_fcmps( ins, r1, r2 ) sparc_fcmp( ins, r1, sparc_fcmps_val, r2 )
+#define sparc_fcmpd( ins, r1, r2 ) sparc_fcmp( ins, r1, sparc_fcmpd_val, r2 )
+#define sparc_fcmpq( ins, r1, r2 ) sparc_fcmp( ins, r1, sparc_fcmpq_val, r2 )
+#define sparc_fcmpes( ins, r1, r2 ) sparc_fcmpes( ins, r1, sparc_fcmpes_val, r2 )
+#define sparc_fcmped( ins, r1, r2 ) sparc_fcmped( ins, r1, sparc_fcmped_val, r2 )
+#define sparc_fcmpeq( ins, r1, r2 ) sparc_fcmpeq( ins, r1, sparc_fcmpeq_val, r2 )
+
/* logical */
-#define sparc_and(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|1,(dest))
-#define sparc_and_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|1,(dest))
+
+/* FIXME: condense this using macros */
+/* FIXME: the setcc stuff is wrong in lots of places */
+
+#define sparc_logic(ins,op,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),((setcc) ? 0x10 : 0) | (op), (dest))
+#define sparc_logic_imm(ins,op,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),((setcc) ? 0x10 : 0) | (op), (dest))
+
+#define sparc_and(ins,setcc,r1,r2,dest) sparc_logic(ins,1,setcc,r1,r2,dest)
+#define sparc_and_imm(ins,setcc,r1,imm,dest) sparc_logic_imm(ins,1,setcc,r1,imm,dest)
#define sparc_andn(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|5,(dest))
#define sparc_andn_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|5,(dest))
@@ -399,7 +742,7 @@ typedef struct {
#define sparc_orn_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|6,(dest))
#define sparc_xor(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|3,(dest))
-#define sparc_xor_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(r2),(imm)|3,(dest))
+#define sparc_xor_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm), (setcc)|3,(dest))
#define sparc_xnor(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|7,(dest))
#define sparc_xnor_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|7,(dest))
@@ -408,50 +751,78 @@ typedef struct {
#define sparc_sll(ins,src,disp,dest) sparc_encode_format3a((ins),2,0,(src),(disp),37,(dest))
#define sparc_sll_imm(ins,src,disp,dest) sparc_encode_format3b((ins),2,(src),(disp),37,(dest))
+/* Sparc V9 */
+#define sparc_sllx(ins,src,disp,dest) sparc_encode_format3ax((ins),2,0,(src),(disp),37,(dest))
+#define sparc_sllx_imm(ins,src,disp,dest) sparc_encode_format3bx((ins),2,(src),(disp),37,(dest))
+
#define sparc_srl(ins,src,disp,dest) sparc_encode_format3a((ins),2,0,(src),(disp),38,(dest))
#define sparc_srl_imm(ins,src,disp,dest) sparc_encode_format3b((ins),2,(src),(disp),38,(dest))
+/* Sparc V9 */
+#define sparc_srlx(ins,src,disp,dest) sparc_encode_format3ax((ins),2,0,(src),(disp),38,(dest))
+#define sparc_srlx_imm(ins,src,disp,dest) sparc_encode_format3bx((ins),2,(src),(disp),38,(dest))
+
#define sparc_sra(ins,src,disp,dest) sparc_encode_format3a((ins),2,0,(src),(disp),39,(dest))
#define sparc_sra_imm(ins,src,disp,dest) sparc_encode_format3b((ins),2,(src),(disp),39,(dest))
+/* Sparc V9 */
+#define sparc_srax(ins,src,disp,dest) sparc_encode_format3ax((ins),2,0,(src),(disp),39,(dest))
+#define sparc_srax_imm(ins,src,disp,dest) sparc_encode_format3bx((ins),2,(src),(disp),39,(dest))
+
/* alu */
-#define sparc_add(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|0,(dest))
-#define sparc_add_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|0,(dest))
-#define sparc_addx(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|8,(dest))
-#define sparc_addx_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|8,(dest))
+#define sparc_alu_reg(ins,op,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),op|((setcc) ? 0x10 : 0),(dest))
+#define sparc_alu_imm(ins,op,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),op|((setcc) ? 0x10 : 0),(dest))
+
+#define sparc_add(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0,(setcc),(r1),(r2),(dest))
+#define sparc_add_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0,(setcc),(r1),(imm),(dest))
+
+#define sparc_addx(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0x8,(setcc),(r1),(r2),(dest))
+#define sparc_addx_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0x8,(setcc),(r1),(imm),(dest))
-#define sparc_sub(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|4,(dest))
-#define sparc_sub_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|4,(dest))
+#define sparc_sub(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0x4,(setcc),(r1),(r2),(dest))
+#define sparc_sub_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0x4,(setcc),(r1),(imm),(dest))
-#define sparc_subx(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|12,(dest))
-#define sparc_subx_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|12,(dest))
+#define sparc_subx(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0xc,(setcc),(r1),(r2),(dest))
+#define sparc_subx_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0xc,(setcc),(r1),(imm),(dest))
#define sparc_muls(ins,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),36,(dest))
#define sparc_muls_imm(ins,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),36,(dest))
-#define sparc_umul(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|10,(dest))
-#define sparc_umul_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|10,(dest))
+#define sparc_umul(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0xa,(setcc),(r1),(r2),(dest))
+#define sparc_umul_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0xa,(setcc),(r1),(imm),(dest))
-#define sparc_smul(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|11,(dest))
-#define sparc_smul_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|11,(dest))
+#define sparc_smul(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0xb,(setcc),(r1),(r2),(dest))
+#define sparc_smul_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0xb,(setcc),(r1),(imm),(dest))
-#define sparc_udiv(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|14,(dest))
-#define sparc_udiv_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|14,(dest))
+#define sparc_udiv(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0xe,(setcc),(r1),(r2),(dest))
+#define sparc_udiv_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0xe,(setcc),(r1),(imm),(dest))
-#define sparc_sdiv(ins,setcc,r1,r2,dest) sparc_encode_format3a((ins),2,0,(r1),(r2),(setcc)|15,(dest))
-#define sparc_sdiv_imm(ins,setcc,r1,imm,dest) sparc_encode_format3b((ins),2,(r1),(imm),(setcc)|15,(dest))
+#define sparc_sdiv(ins,setcc,r1,r2,dest) sparc_alu_reg((ins),0xf,(setcc),(r1),(r2),(dest))
+#define sparc_sdiv_imm(ins,setcc,r1,imm,dest) sparc_alu_imm((ins),0xf,(setcc),(r1),(imm),(dest))
/* branch */
#define sparc_branch(ins,aval,condval,displ) sparc_encode_format2b((ins),(aval),(condval),2,(displ))
/* FIXME: float condition codes are different: unify. */
#define sparc_fbranch(ins,aval,condval,displ) sparc_encode_format2b((ins),(aval),(condval),6,(displ))
+#define sparc_branchp(ins,aval,condval,xcc,predict,displ) sparc_encode_format2c((ins),(aval),(condval),0x1,(xcc),(predict),(displ))
+
+#define sparc_brz(ins,aval,predict,rs1,disp) sparc_encode_format2d((ins), (aval),0x1,0x3,(predict),(rs1),(disp))
+#define sparc_brlez(ins,aval,predict,rs1,disp) sparc_encode_format2d((ins), (aval),0x2,0x3,(predict),(rs1),(disp))
+#define sparc_brlz(ins,aval,predict,rs1,disp) sparc_encode_format2d((ins), (aval),0x3,0x3,(predict),(rs1),(disp))
+#define sparc_brnz(ins,aval,predict,rs1,disp) sparc_encode_format2d((ins), (aval),0x5,0x3,(predict),(rs1),(disp))
+#define sparc_brgz(ins,aval,predict,rs1,disp) sparc_encode_format2d((ins), (aval),0x6,0x3,(predict),(rs1),(disp))
+#define sparc_brgez(ins,aval,predict,rs1,disp) sparc_encode_format2d((ins), (aval),0x7,0x3,(predict),(rs1),(disp))
+
+/* conditional moves */
+#define sparc_movcc(ins,cc,condval,r1,dest) sparc_encode_format4c((ins), 0x2, 0x2c, cc, condval, r1, dest)
+
+#define sparc_movcc_imm(ins,cc,condval,imm,dest) sparc_encode_format4d((ins), 0x2, 0x2c, cc, condval, imm, dest)
/* synthetic instructions */
#define sparc_cmp(ins,r1,r2) sparc_sub((ins),sparc_cc,(r1),(r2),sparc_g0)
#define sparc_cmp_imm(ins,r1,imm) sparc_sub_imm((ins),sparc_cc,(r1),(imm),sparc_g0)
-
#define sparc_jmp(ins,base,disp) sparc_jmpl((ins),(base),(disp),sparc_g0)
#define sparc_jmp_imm(ins,base,disp) sparc_jmpl_imm((ins),(base),(disp),sparc_g0)
#define sparc_call(ins,base,disp) sparc_jmpl((ins),(base),(disp),sparc_o7)
@@ -462,25 +833,106 @@ typedef struct {
#define sparc_ret(ins) sparc_jmpl_imm((ins),sparc_i7,8,sparc_g0)
#define sparc_retl(ins) sparc_jmpl_imm((ins),sparc_o7,8,sparc_g0)
#define sparc_restore_simple(ins) sparc_restore((ins),sparc_g0,sparc_g0,sparc_g0)
+#define sparc_rett_simple(ins) sparc_rett_imm((ins),sparc_i7,8)
+#define sparc_set32(ins,val,reg) \
+ do { \
+ if ((val) == 0) \
+ sparc_clr_reg((ins),(reg)); \
+ else if (((guint32)(val) & 0x1fff) == 0) \
+ sparc_sethi((ins),(guint32)(val),(reg)); \
+ else if (((gint32)(val) >= -4096) && ((gint32)(val) <= 4095)) \
+ sparc_or_imm((ins),FALSE,sparc_g0,(gint32)(val),(reg)); \
+ else { \
+ sparc_sethi((ins),(guint32)(val),(reg)); \
+ sparc_or_imm((ins),FALSE,(reg),(guint32)(val)&0x3ff,(reg)); \
+ } \
+ } while (0)
+
+#ifdef SPARCV9
+#define SPARC_SET_MAX_SIZE (6 * 4)
+#else
+#define SPARC_SET_MAX_SIZE (2 * 4)
+#endif
+
+#if SPARCV9
+#define sparc_set(ins,ptr,reg) \
+ do { \
+ g_assert ((reg) != sparc_g1); \
+ gint64 val = (gint64)ptr; \
+ guint32 top_word = (val) >> 32; \
+ guint32 bottom_word = (val) & 0xffffffff; \
+ if (val == 0) \
+ sparc_clr_reg ((ins), reg); \
+ else if ((val >= -4096) && ((val) <= 4095)) \
+ sparc_or_imm((ins),FALSE,sparc_g0,bottom_word,(reg)); \
+ else if ((val >= 0) && (val <= 4294967295L)) { \
+ sparc_sethi((ins),bottom_word,(reg)); \
+ sparc_or_imm((ins),FALSE,(reg),bottom_word&0x3ff,(reg)); \
+ } \
+ else if ((val >= 0) && (val <= (1L << 44) - 1)) { \
+ sparc_sethi ((ins), (val >> 12), (reg)); \
+ sparc_or_imm ((ins), FALSE, (reg), (val >> 12) & 0x3ff, (reg)); \
+ sparc_sllx_imm ((ins),(reg), 12, (reg)); \
+ sparc_or_imm ((ins), FALSE, (reg), (val) & 0xfff, (reg)); \
+ } \
+ else if (top_word == 0xffffffff) { \
+ sparc_xnor ((ins), FALSE, sparc_g0, sparc_g0, sparc_g1); \
+ sparc_sethi((ins),bottom_word,(reg)); \
+ sparc_sllx_imm((ins),sparc_g1,32,sparc_g1); \
+ sparc_or_imm((ins),FALSE,(reg),bottom_word&0x3ff,(reg)); \
+ sparc_or((ins),FALSE,(reg),sparc_g1,(reg)); \
+ } \
+ else { \
+ sparc_sethi((ins),top_word,sparc_g1); \
+ sparc_sethi((ins),bottom_word,(reg)); \
+ sparc_or_imm((ins),FALSE,sparc_g1,top_word&0x3ff,sparc_g1); \
+ sparc_or_imm((ins),FALSE,(reg),bottom_word&0x3ff,(reg)); \
+ sparc_sllx_imm((ins),sparc_g1,32,sparc_g1); \
+ sparc_or((ins),FALSE,(reg),sparc_g1,(reg)); \
+ } \
+ } while (0)
+#else
#define sparc_set(ins,val,reg) \
do { \
- if (((val) & 0x1fff) == 0) \
- sparc_sethi((ins),(val),(reg)); \
- else if (((val) >= -4096) && ((val) <= 4095)) \
- sparc_or_imm((ins),FALSE,sparc_g0,(val),(reg)); \
+ if ((val) == 0) \
+ sparc_clr_reg((ins),(reg)); \
+ else if (((guint32)(val) & 0x1fff) == 0) \
+ sparc_sethi((ins),(guint32)(val),(reg)); \
+ else if (((gint32)(val) >= -4096) && ((gint32)(val) <= 4095)) \
+ sparc_or_imm((ins),FALSE,sparc_g0,(gint32)(val),(reg)); \
else { \
- sparc_sethi((ins),(val),(reg)); \
- sparc_or_imm((ins),FALSE,(reg),(val)&0x3ff,(reg)); \
+ sparc_sethi((ins),(guint32)(val),(reg)); \
+ sparc_or_imm((ins),FALSE,(reg),(guint32)(val)&0x3ff,(reg)); \
} \
} while (0)
+#endif
+
+#define sparc_set_ptr(ins,val,reg) sparc_set(ins,val,reg)
+
+#ifdef SPARCV9
+#define sparc_set_template(ins,reg) sparc_set (ins,0x7fffffff7fffffff, reg)
+#else
+#define sparc_set_template(ins,reg) sparc_set (ins,0x7fffffff, reg)
+#endif
#define sparc_not(ins,reg) sparc_xnor((ins),FALSE,(reg),sparc_g0,(reg))
#define sparc_neg(ins,reg) sparc_sub((ins),FALSE,sparc_g0,(reg),(reg))
#define sparc_clr_reg(ins,reg) sparc_or((ins),FALSE,sparc_g0,sparc_g0,(reg))
-#define sparc_mov_reg_reg(ins,src,dest) sparc_or_imm((ins),FALSE,(src),0,(dest))
-
+#define sparc_mov_reg_reg(ins,src,dest) sparc_or((ins),FALSE,sparc_g0,(src),(dest))
+
+#ifdef SPARCV9
+#define sparc_sti_imm sparc_stx_imm
+#define sparc_ldi_imm sparc_ldx_imm
+#define sparc_sti sparc_stx
+#define sparc_ldi sparc_ldx
+#else
+#define sparc_sti_imm sparc_st_imm
+#define sparc_ldi_imm sparc_ld_imm
+#define sparc_sti sparc_st
+#define sparc_ldi sparc_ld
+#endif
#endif /* __SPARC_CODEGEN_H__ */
diff --git a/mono/arch/sparc/tramp.c b/mono/arch/sparc/tramp.c
index f628fa04b27..19c0a781fe1 100644
--- a/mono/arch/sparc/tramp.c
+++ b/mono/arch/sparc/tramp.c
@@ -3,139 +3,173 @@
* Create trampolines to invoke arbitrary functions.
*
* Copyright (C) Ximian Inc.
- *
+ *
* Authors: Paolo Molaro (lupus@ximian.com)
* Jeffrey Stedfast <fejj@ximian.com>
- *
+ * Mark Crichton <crichton@gimp.org>
+ *
*/
#include "config.h"
#include <stdlib.h>
+#include <string.h>
#include "sparc-codegen.h"
#include "mono/metadata/class.h"
#include "mono/metadata/tabledefs.h"
#include "mono/interpreter/interp.h"
#include "mono/metadata/appdomain.h"
+#include "mono/metadata/debug-helpers.h"
+#include "mono/metadata/marshal.h"
-#define FUNC_ADDR_POS sparc_i0
-#define RETVAL_POS sparc_i1
-#define THIS_POS sparc_i2
-#define ARGP_POS sparc_i3
-#define LOC_POS -4
-
#define ARG_SIZE sizeof (stackval)
+#define PROLOG_INS 1
+#define CALL_INS 3 /* Max 3. 1 for the jmpl and 1 for the nop and 1 for the possible unimp */
+#define EPILOG_INS 2
+#define FLOAT_REGS 32
+#define OUT_REGS 6
+#define LOCAL_REGS 8
+#define SLOT_SIZE sizeof(gpointer)
+#if SPARCV9
+#define MINIMAL_STACK_SIZE 22
+#define BIAS 2047
+#define FRAME_ALIGN 16
+#else
+#define MINIMAL_STACK_SIZE 23
+#define BIAS 0
+#define FRAME_ALIGN 8
+#endif
+
+#define NOT_IMPL(x) g_error("FIXME: %s", x);
+/*#define DEBUG(a) a*/
+#define DEBUG(a)
+
+/* Some assembly... */
+#ifdef __GNUC__
+#define flushi(addr) __asm__ __volatile__ ("flush %0"::"r"(addr):"memory")
+#else
+static void flushi(void *addr)
+{
+ asm("flush %i0");
+}
+#endif
+
+static char*
+sig_to_name (MonoMethodSignature *sig, const char *prefix)
+{
+ int i;
+ char *result;
+ GString *res = g_string_new ("");
+ char *p;
+
+ if (prefix) {
+ g_string_append (res, prefix);
+ g_string_append_c (res, '_');
+ }
+
+ mono_type_get_desc (res, sig->ret, TRUE);
+
+ for (i = 0; i < sig->param_count; ++i) {
+ g_string_append_c (res, '_');
+ mono_type_get_desc (res, sig->params [i], TRUE);
+ }
+ result = res->str;
+ p = result;
+ /* remove chars Sun's asssembler doesn't like */
+ while (*p != '\0') {
+ if (*p == '.' || *p == '/')
+ *p = '_';
+ else if (*p == '&')
+ *p = '$';
+ else if (*p == '[' || *p == ']')
+ *p = 'X';
+ p++;
+ }
+ g_string_free (res, FALSE);
+ return result;
+}
static void
-fake_func (void (*callme)(gpointer, gpointer), stackval *retval, void *this_obj, stackval *arguments)
+sparc_disassemble_code (guint32 *code_buffer, guint32 *p, const char *id)
{
- /*
- *(gpointer*)retval = (gpointer)(*callme) (arguments [0].data.p, arguments [1].data.p, arguments [2].data.p);
- *(gdouble*) retval = (gdouble)(*callme) (arguments [0].data.f);
- */
-
- /* internal_from_handle() */
- /* return (gpointer)(*callme) (((MonoType *)arguments [0].data.p)->data.klass); */
-
- /* InitializeArray() */
- (*callme) (arguments [0].data.p, arguments [1].data.p);
+ guchar *cp;
+ FILE *ofd;
+
+ if (!(ofd = fopen ("/tmp/test.s", "w")))
+ g_assert_not_reached();
+
+ fprintf (ofd, "%s:\n", id);
+
+ for (cp = (guchar *)code_buffer; cp < (guchar *)p; cp++)
+ fprintf (ofd, ".byte %d\n", *cp);
+
+ fclose (ofd);
+
+#ifdef __GNUC__
+ system ("as /tmp/test.s -o /tmp/test.o;objdump -d /tmp/test.o");
+#else
+ /* this assumes we are using Sun tools as we aren't GCC */
+#if SPARCV9
+ system ("as -xarch=v9 /tmp/test.s -o /tmp/test.o;dis /tmp/test.o");
+#else
+ system ("as /tmp/test.s -o /tmp/test.o;dis /tmp/test.o");
+#endif
+#endif
}
-static const char *
-mono_type (int type)
+
+static void
+add_general (guint *gr, guint *stack_size, guint *code_size, gboolean simple)
{
- switch (type) {
- case MONO_TYPE_END:
- return "MONO_TYPE_END";
- case MONO_TYPE_VOID:
- return "MONO_TYPE_VOID";
- case MONO_TYPE_BOOLEAN:
- return "MONO_TYPE_BOOLEAN";
- case MONO_TYPE_CHAR:
- return "MONO_TYPE_CHAR";
- case MONO_TYPE_I1:
- return "MONO_TYPE_I1";
- case MONO_TYPE_U1:
- return "MONO_TYPE_U1";
- case MONO_TYPE_I2:
- return "MONO_TYPE_I2";
- case MONO_TYPE_U2:
- return "MONO_TYPE_U2";
- case MONO_TYPE_I4:
- return "MONO_TYPE_I4";
- case MONO_TYPE_U4:
- return "MONO_TYPE_U4";
- case MONO_TYPE_I8:
- return "MONO_TYPE_I8";
- case MONO_TYPE_U8:
- return "MONO_TYPE_U8";
- case MONO_TYPE_R4:
- return "MONO_TYPE_R4";
- case MONO_TYPE_R8:
- return "MONO_TYPE_R8";
- case MONO_TYPE_STRING:
- return "MONO_TYPE_STRING";
- case MONO_TYPE_PTR:
- return "MONO_TYPE_PTR";
- case MONO_TYPE_BYREF:
- return "MONO_TYPE_BYREF";
- case MONO_TYPE_VALUETYPE:
- return "MONO_TYPE_VALUETYPE";
- case MONO_TYPE_CLASS:
- return "MONO_TYPE_CLASS";
- case MONO_TYPE_ARRAY:
- return "MONO_TYPE_ARRAY";
- case MONO_TYPE_TYPEDBYREF:
- return "MONO_TYPE_TYPEBYREF";
- case MONO_TYPE_I:
- return "MONO_TYPE_I";
- case MONO_TYPE_U:
- return "MONO_TYPE_U";
- case MONO_TYPE_FNPTR:
- return "MONO_TYPE_FNPTR";
- case MONO_TYPE_OBJECT:
- return "MONO_TYPE_OBJECT";
- case MONO_TYPE_SZARRAY:
- return "MONO_TYPE_SZARRAY";
- case MONO_TYPE_CMOD_REQD:
- return "MONO_TYPE_CMOD_REQD";
- case MONO_TYPE_CMOD_OPT:
- return "MONO_TYPE_CMOD_OPT";
- case MONO_TYPE_INTERNAL:
- return "MONO_TYPE_INTERNAL";
- case MONO_TYPE_MODIFIER:
- return "MONO_TYPE_MODIFIER";
- case MONO_TYPE_SENTINEL:
- return "MONO_TYPE_SENTINEL";
- case MONO_TYPE_PINNED:
- return "MONO_TYPE_PINNED";
+ if (simple) {
+ if (*gr >= OUT_REGS) {
+ *stack_size += SLOT_SIZE;
+ *code_size += 12;
+ } else {
+ *code_size += 4;
+ }
+ } else {
+ if (*gr >= OUT_REGS - 1) {
+ *stack_size += 8 + (*stack_size % 8); /* ???64 */
+ *code_size += 16;
+ } else {
+ *code_size += 16;
+ }
+ (*gr)++;
}
-
- return "??";
+ (*gr)++;
}
static void
-calculate_sizes (MonoMethod *method, guint32 *local_size, guint32 *stack_size, guint32 *code_size, int runtime)
+calculate_sizes (MonoMethodSignature *sig, guint *stack_size, guint *code_size,
+ gboolean string_ctor, gboolean *use_memcpy)
{
- MonoMethodSignature *sig = method->signature;
- guint32 local = 0, stack = 0, code = 6;
+ guint i, fr, gr;
guint32 simpletype;
- int i;
+
+ fr = gr = 0;
+ *stack_size = MINIMAL_STACK_SIZE * SLOT_SIZE;
+ *code_size = (PROLOG_INS + CALL_INS + EPILOG_INS) * 4;
/* function arguments */
if (sig->hasthis)
- code++;
+ add_general (&gr, stack_size, code_size, TRUE);
for (i = 0; i < sig->param_count; i++) {
if (sig->params[i]->byref) {
- stack += sizeof (gpointer);
- code += i < 6 ? 1 : 3;
+ add_general (&gr, stack_size, code_size, TRUE);
continue;
}
-
simpletype = sig->params[i]->type;
enum_calc_size:
switch (simpletype) {
+ case MONO_TYPE_R4:
+#if SPARCV9
+ (*code_size) += 4; /* for the fdtos */
+#else
+ (*code_size) += 12;
+ (*stack_size) += 4;
+#endif
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_CHAR:
case MONO_TYPE_I1:
@@ -147,42 +181,48 @@ calculate_sizes (MonoMethod *method, guint32 *local_size, guint32 *stack_size, g
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
- case MONO_TYPE_R4:
- case MONO_TYPE_SZARRAY:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
- stack += 4;
- code += i < 6 ? 1 : 3;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ add_general (&gr, stack_size, code_size, TRUE);
break;
- case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
+ guint32 align;
if (sig->params[i]->data.klass->enumtype) {
simpletype = sig->params[i]->data.klass->enum_basetype->type;
goto enum_calc_size;
}
- if (mono_class_value_size (sig->params[i]->data.klass, NULL) != 4)
- g_error ("can only marshal enums, not generic structures (size: %d)",
- mono_class_value_size (sig->params[i]->data.klass, NULL));
- stack += 4;
- code += i < 6 ? 1 : 3;
- break;
- case MONO_TYPE_STRING:
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime) {
- stack += 4;
- code += i < 6 ? 1 : 3;
- break;
+ size = mono_class_native_size (sig->params[i]->data.klass, &align);
+#if SPARCV9
+ if (size != 4) {
+#else
+ if (1) {
+#endif
+ DEBUG(fprintf(stderr, "copy %d byte struct on stack\n", size));
+ *use_memcpy = TRUE;
+ *code_size += 8*4;
+
+ *stack_size = (*stack_size + (align - 1)) & (~(align -1));
+ *stack_size += (size + 3) & (~3);
+ if (gr > OUT_REGS) {
+ *code_size += 4;
+ *stack_size += 4;
+ }
+ } else {
+ add_general (&gr, stack_size, code_size, TRUE);
+#if SPARCV9
+ *code_size += 8;
+#else
+ *code_size += 4;
+#endif
}
-
- stack += 4;
- code += 5;
- local++;
break;
+ }
case MONO_TYPE_I8:
- stack += 8;
- code += i < 6 ? 2 : 3;
- break;
case MONO_TYPE_R8:
- stack += 8;
- code += i < 6 ? 2 : 3;
+ add_general (&gr, stack_size, code_size, FALSE);
break;
default:
g_error ("Can't trampoline 0x%x", sig->params[i]->type);
@@ -190,8 +230,8 @@ calculate_sizes (MonoMethod *method, guint32 *local_size, guint32 *stack_size, g
}
/* function return value */
- if (sig->ret->byref) {
- code += 2;
+ if (sig->ret->byref || string_ctor) {
+ *code_size += 8;
} else {
simpletype = sig->ret->type;
enum_retvalue:
@@ -208,30 +248,34 @@ calculate_sizes (MonoMethod *method, guint32 *local_size, guint32 *stack_size, g
case MONO_TYPE_U:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_STRING:
case MONO_TYPE_R4:
case MONO_TYPE_R8:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
- code += 2;
+ *code_size += 8;
break;
-#if 0
- case MONO_TYPE_STRING:
- code += 2;
- if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) && !runtime) {
- code += 4;
- }
- break;
-#endif
case MONO_TYPE_I8:
- code += 3;
+ *code_size += 12;
break;
- case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
if (sig->ret->data.klass->enumtype) {
simpletype = sig->ret->data.klass->enum_basetype->type;
goto enum_retvalue;
}
- code += 2;
+ size = mono_class_native_size (sig->ret->data.klass, NULL);
+#if SPARCV9
+ if (size <= 32)
+ *code_size += 8 + (size + 7) / 2;
+ else
+ *code_size += 8;
+#else
+ *code_size += 8;
+#endif
break;
+ }
case MONO_TYPE_VOID:
break;
default:
@@ -239,303 +283,798 @@ calculate_sizes (MonoMethod *method, guint32 *local_size, guint32 *stack_size, g
}
}
-#define STACKALIGN(x) (((x) + 15) & (~15))
-#define MINFRAME ((16 + 1 + 6) * 4) /* minimum size stack frame, in bytes:
- * 16 for registers, 1 for "hidden param",
- * and 6 in which a callee can store it's
- * arguments.
- */
+ if (*use_memcpy) {
+ *stack_size += 8;
+ *code_size += 24;
+ if (sig->hasthis) {
+ *stack_size += SLOT_SIZE;
+ *code_size += 4;
+ }
+ }
- stack += MINFRAME + (local * 4);
+ *stack_size = (*stack_size + (FRAME_ALIGN - 1)) & (~(FRAME_ALIGN -1));
+}
- fprintf (stderr, "\tstack size: %d (%d)\n\tcode size: %d\n", STACKALIGN(stack), stack, code);
+static inline guint32 *
+emit_epilog (guint32 *p, MonoMethodSignature *sig, guint stack_size)
+{
+ int ret_offset = 8;
+
+ /*
+ * Standard epilog.
+ * 8 may be 12 when returning structures (to skip unimp opcode).
+ */
+#if !SPARCV9
+ if (sig != NULL && !sig->ret->byref && sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->data.klass->enumtype)
+ ret_offset = 12;
+#endif
+ sparc_jmpl_imm (p, sparc_i7, ret_offset, sparc_zero);
+ sparc_restore (p, sparc_zero, sparc_zero, sparc_zero);
- *local_size = local;
- *stack_size = STACKALIGN(stack);
- *code_size = code;
+ return p;
}
-static MonoString *
-mono_string_new_wrapper (const char *text)
+static inline guint32 *
+emit_prolog (guint32 *p, MonoMethodSignature *sig, guint stack_size)
{
- return text ? mono_string_new (mono_domain_get (), text) : NULL;
+ /* yes kids, it is this simple! */
+ sparc_save_imm (p, sparc_sp, -stack_size, sparc_sp);
+ return p;
}
-MonoPIFunc
-mono_create_trampoline (MonoMethod *method, int runtime)
-{
- MonoMethodSignature *sig;
- guint32 *p, *code_buffer;
- guint32 local_size, stack_size, code_size;
- guint32 arg_pos, simpletype;
- int i, stringp, cur_out_reg;
-
- sig = method->signature;
-
- fprintf (stderr, "\nPInvoke [start emiting] %s\n", method->name);
- calculate_sizes (method, &local_size, &stack_size, &code_size, runtime);
-
- code_buffer = p = alloca (code_size * 4);
- cur_out_reg = sparc_o0;
-
- /* Standard function prolog. */
- sparc_save_imm (p, sparc_sp, -stack_size, sparc_sp);
-#if 0
- /* gcc seems to want to store %i0 through %i3 for some reason */
- sparc_st_imm (p, sparc_i0, sparc_fp, 68);
- sparc_st_imm (p, sparc_i1, sparc_fp, 72);
- sparc_st_imm (p, sparc_i2, sparc_fp, 76);
- sparc_st_imm (p, sparc_i3, sparc_fp, 80);
+#if SPARCV9
+#define sparc_st_ptr(a,b,c,d) sparc_stx(a,b,c,d)
+#define sparc_st_imm_ptr(a,b,c,d) sparc_stx_imm(a,b,c,d)
+#define sparc_ld_ptr(a,b,c,d) sparc_ldx(a,b,c,d)
+#define sparc_ld_imm_ptr(a,b,c,d) sparc_ldx_imm(a,b,c,d)
+#else
+#define sparc_st_ptr(a,b,c,d) sparc_st(a,b,c,d)
+#define sparc_st_imm_ptr(a,b,c,d) sparc_st_imm(a,b,c,d)
+#define sparc_ld_ptr(a,b,c,d) sparc_ld(a,b,c,d)
+#define sparc_ld_imm_ptr(a,b,c,d) sparc_ld_imm(a,b,c,d)
#endif
-
- /*
- * We store some local vars here to handle string pointers.
- * and align to 16 byte boundary...
- */
-#if 0
- if (local_size) {
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, local_size * 4);
- stack_size = (stack_size * local_size * 4) % 16;
- } else {
- stack_size = stack_size % 16;
+
+/* synonyms for when values are really widened scalar values */
+#define sparc_st_imm_word sparc_st_imm_ptr
+
+#define ARG_BASE sparc_i3 /* pointer to args in i3 */
+#define SAVE_PTR_IN_GENERIC_REGISTER \
+ if (gr < OUT_REGS) { \
+ sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr); \
+ gr++; \
+ } else { \
+ sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0); \
+ sparc_st_imm_ptr (p, sparc_l0, sparc_sp, stack_par_pos); \
+ stack_par_pos += SLOT_SIZE; \
+ }
+
+#if SPARCV9
+/* This is a half hearted attempt at coping with structs by value - the
+ actual convention is complicated when floats & doubles are involved as
+ you end up with fields in different registers on/off the stack.
+ It will take more time to get right... */
+static guint32 *
+v9_struct_arg(guint32 *p, int arg_index, MonoClass *klass, int size, guint *p_gr)
+{
+ MonoMarshalType *info = mono_marshal_load_type_info (klass);
+ int off = 0;
+ int index = 0;
+ guint gr = *p_gr;
+ sparc_ld_imm_ptr (p, ARG_BASE, arg_index*ARG_SIZE, sparc_l0);
+ if (size > 8) {
+ if (info->fields [index].field->type->type == MONO_TYPE_R8) {
+ sparc_lddf_imm (p, sparc_l0, 0, sparc_f0 + 2 * gr);
+ index++;
+ }
+ else {
+ sparc_ldx_imm (p, sparc_l0, 0, sparc_o0 + gr);
+ index++; /* FIXME could be multiple fields in one register */
+ }
+ gr++;
+ size -= 8;
+ off = 8;
}
- if (stack_size)
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, stack_size);
+ if (size > 0) {
+ if (info->fields [index].field->type->type == MONO_TYPE_R8) {
+ sparc_lddf_imm (p, sparc_l0, off, sparc_f0 + 2 * gr);
+ index++;
+ }
+ else {
+ /* will load extra garbage off end of short structs ... */
+ sparc_ldx_imm (p, sparc_l0, off, sparc_o0 + gr);
+ }
+ gr++;
+ }
+ *p_gr = gr;
+ return p;
+}
#endif
-
- /*
- * %i3 has the pointer to the args.
- */
-
+
+static inline guint32*
+emit_save_parameters (guint32 *p, MonoMethodSignature *sig, guint stack_size,
+ gboolean use_memcpy)
+{
+ guint i, fr, gr, stack_par_pos, struct_pos, cur_struct_pos;
+ guint32 simpletype;
+
+ fr = gr = 0;
+ stack_par_pos = MINIMAL_STACK_SIZE * SLOT_SIZE + BIAS;
+
if (sig->hasthis) {
- sparc_mov_reg_reg (p, sparc_i2, cur_out_reg);
- cur_out_reg++;
+ if (use_memcpy) {
+ /* we don't need to save a thing. */
+ } else
+ sparc_mov_reg_reg (p, sparc_i2, sparc_o0);
+ gr ++;
}
-
- /* Push arguments in reverse order. */
- stringp = 0;
+
+ if (use_memcpy) {
+ cur_struct_pos = struct_pos = stack_par_pos;
+ for (i = 0; i < sig->param_count; i++) {
+ if (sig->params[i]->byref)
+ continue;
+ if (sig->params[i]->type == MONO_TYPE_VALUETYPE &&
+ !sig->params[i]->data.klass->enumtype) {
+ gint size;
+ guint32 align;
+
+ size = mono_class_native_size (sig->params[i]->data.klass, &align);
+#if SPARCV9
+ if (size != 4) {
+#else
+ if (1) {
+#endif
+ /* Add alignment */
+ stack_par_pos = (stack_par_pos + (align - 1)) & (~(align - 1));
+ /* need to call memcpy here */
+ sparc_add_imm (p, 0, sparc_sp, stack_par_pos, sparc_o0);
+ sparc_ld_imm_ptr (p, sparc_i3, i*16, sparc_o1);
+ sparc_set (p, (guint32)size, sparc_o2);
+ sparc_set_ptr (p, (void *)memmove, sparc_l0);
+ sparc_jmpl_imm (p, sparc_l0, 0, sparc_callsite);
+ sparc_nop (p);
+ stack_par_pos += (size + (SLOT_SIZE - 1)) & (~(SLOT_SIZE - 1));
+ }
+ }
+ }
+ }
+
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ gint size = mono_class_native_size (klass, NULL);
+
+ DEBUG(fprintf(stderr, "retval value type size: %d\n", size));
+#if SPARCV9
+ if (size > 32) {
+#else
+ {
+#endif
+ /* pass on buffer in interp.c to called function */
+ sparc_ld_imm_ptr (p, sparc_i1, 0, sparc_l0);
+ sparc_st_imm_ptr (p, sparc_l0, sparc_sp, 64);
+ }
+ }
+ }
+
+ DEBUG(fprintf(stderr, "%s\n", sig_to_name(sig, FALSE)));
+
for (i = 0; i < sig->param_count; i++) {
- arg_pos = ARG_SIZE * i;
-
if (sig->params[i]->byref) {
- fprintf (stderr, "\tpushing params[%d] (byref): type=%s;\n", i, mono_type (sig->params[i]->type));
- sparc_ld_imm (p, sparc_i3, arg_pos, cur_out_reg);
- cur_out_reg++;
+ SAVE_PTR_IN_GENERIC_REGISTER;
continue;
}
-
simpletype = sig->params[i]->type;
-enum_marshal:
- fprintf (stderr, "\tpushing params[%d]: type=%s;\n", i, mono_type (simpletype));
+ enum_calc_size:
switch (simpletype) {
case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ if (gr < OUT_REGS) {
+ sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr);
+ gr++;
+ } else {
+ sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_l0);
+ sparc_st_imm_word (p, sparc_l0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
+ }
+ break;
+
case MONO_TYPE_R4:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- sparc_ld_imm (p, sparc_i3, arg_pos, cur_out_reg);
- cur_out_reg++;
+#if SPARCV9
+ sparc_lddf_imm (p, ARG_BASE, i*ARG_SIZE, sparc_f30); /* fix using this fixed reg */
+ sparc_fdtos(p, sparc_f30, sparc_f0 + 2 * gr + 1);
+ gr++;
break;
- case MONO_TYPE_VALUETYPE:
- if (sig->params[i]->data.klass->enumtype) {
- /* it's an enum value */
- simpletype = sig->params[i]->data.klass->enum_basetype->type;
- goto enum_marshal;
+#else
+ /* Convert from double to single */
+ sparc_lddf_imm (p, ARG_BASE, i*ARG_SIZE, sparc_f0);
+ sparc_fdtos (p, sparc_f0, sparc_f0);
+
+ /*
+ * FIXME: Is there an easier way to do an
+ * freg->ireg move ?
+ */
+ sparc_stf_imm (p, sparc_f0, sparc_sp, stack_par_pos);
+
+ if (gr < OUT_REGS) {
+ sparc_ld_imm (p, sparc_sp, stack_par_pos, sparc_o0 + gr);
+ gr++;
} else {
- /*sparc_ld_imm (p, sparc_i3, arg_pos, cur_out_reg);*/
- sparc_ld_imm (p, sparc_i3, arg_pos, sparc_l0);
- sparc_ld (p, sparc_l0, 0, cur_out_reg);
- cur_out_reg++;
+ sparc_ldf_imm (p, sparc_sp, stack_par_pos, sparc_f0);
+ sparc_stf_imm (p, sparc_f0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
}
break;
- case MONO_TYPE_STRING:
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime) {
- sparc_ld_imm (p, sparc_i3, arg_pos, cur_out_reg);
- cur_out_reg++;
+#endif
+
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ SAVE_PTR_IN_GENERIC_REGISTER;
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
+ guint32 align;
+ MonoClass *klass = sig->params[i]->data.klass;
+ if (klass->enumtype) {
+ simpletype = klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ size = mono_class_native_size (klass, &align);
+#if SPARCV9
+ if (size <= 16) {
+ if (gr < OUT_REGS) {
+ p = v9_struct_arg(p, i, klass, size, &gr);
+ } else {
+ sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0);
+ sparc_ld_imm (p, sparc_l0, 0, sparc_l0);
+ sparc_st_imm_word (p, sparc_l0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
+ }
break;
}
-
-#if 0
- sparc_sethi (p, mono_string_to_utf8, sparc_l0);
- sparc_or_imm (p, 0, sparc_l0, mono_string_to_utf8, sparc_l1);
-
- x86_push_membase (p, X86_EDX, arg_pos);
- x86_mov_reg_imm (p, X86_EDX, mono_string_to_utf8);
- x86_call_reg (p, X86_EDX);
- x86_alu_reg_imm (p, X86_ADD, X86_ESP, 4);
- x86_push_reg (p, X86_EAX);
- /*
- * Store the pointer in a local we'll free later.
+#else
+ /*
+ * FIXME: The 32bit ABI docs do not mention that small
+ * structures are passed in registers.
*/
- stringp++;
- x86_mov_membase_reg (p, X86_EBP, LOC_POS * stringp, X86_EAX, 4);
+
/*
- * we didn't save the reg: restore it here.
- */
- if (i > 1)
- x86_mov_reg_membase (p, X86_EDX, X86_EBP, ARGP_POS, 4);
+ if (size == 4) {
+ if (gr < OUT_REGS) {
+ sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0);
+ sparc_ld_imm (p, sparc_l0, 0, sparc_o0 + gr);
+ gr++;
+ } else {
+ sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0);
+ sparc_ld_imm (p, sparc_l0, 0, sparc_l0);
+ sparc_st_imm_word (p, sparc_l0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
+ }
+ break;
+ }
+ */
#endif
- fprintf (stderr, "MONO_TYPE_STRING not yet fully supported.\n");
- exit (1);
+
+ cur_struct_pos = (cur_struct_pos + (align - 1)) & (~(align - 1));
+ if (gr < OUT_REGS) {
+ sparc_add_imm (p, 0, sparc_sp,
+ cur_struct_pos, sparc_o0 + gr);
+ gr ++;
+ } else {
+ sparc_ld_imm_ptr (p, sparc_sp,
+ cur_struct_pos,
+ sparc_l1);
+ sparc_st_imm_ptr (p, sparc_l1,
+ sparc_sp,
+ stack_par_pos);
+ }
+ cur_struct_pos += (size + (SLOT_SIZE - 1)) & (~(SLOT_SIZE - 1));
break;
+ }
+
+#if SPARCV9
case MONO_TYPE_I8:
- sparc_ld_imm (p, sparc_i3, arg_pos, cur_out_reg);
- cur_out_reg++;
- sparc_ld_imm (p, sparc_i3, arg_pos + 4, cur_out_reg);
- cur_out_reg++;
+ if (gr < OUT_REGS) {
+ sparc_ldx_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr);
+ gr++;
+ } else {
+ sparc_ldx_imm (p, ARG_BASE, i*ARG_SIZE, sparc_l0);
+ sparc_stx_imm (p, sparc_l0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
+ }
break;
case MONO_TYPE_R8:
- sparc_ld_imm (p, sparc_i3, arg_pos, cur_out_reg);
- cur_out_reg++;
- sparc_ld_imm (p, sparc_i3, arg_pos + 4, cur_out_reg);
- cur_out_reg++;
+ sparc_lddf_imm (p, ARG_BASE, i*ARG_SIZE, sparc_f0 + 2 * i);
break;
+#else
+ case MONO_TYPE_I8:
+ case MONO_TYPE_R8:
+ if (gr < (OUT_REGS - 1)) {
+ sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr);
+ gr ++;
+
+ sparc_ld_imm (p, ARG_BASE,
+ (i*ARG_SIZE) + 4,
+ sparc_o0 + gr);
+ gr ++;
+ } else if (gr == (OUT_REGS - 1)) {
+ /* Split register/stack */
+ sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr);
+ gr ++;
+
+ sparc_ld_imm (p, ARG_BASE, (i*ARG_SIZE) + 4, sparc_l0);
+ sparc_st_imm (p, sparc_l0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
+ } else {
+ sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_l0);
+ sparc_st_imm (p, sparc_l0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
+
+ sparc_ld_imm (p, ARG_BASE, (i*ARG_SIZE) + 4, sparc_l0);
+ sparc_st_imm (p, sparc_l0, sparc_sp, stack_par_pos);
+ stack_par_pos += SLOT_SIZE;
+ }
+ break;
+#endif
default:
- g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ g_error ("Can't trampoline 0x%x", sig->params[i]->type);
}
}
-
- /* call the function */
+
+ g_assert ((stack_par_pos - BIAS) <= stack_size);
+
+ return p;
+}
+
+static inline guint32 *
+alloc_code_memory (guint code_size)
+{
+ guint32 *p;
+
+ p = g_malloc(code_size);
+
+ return p;
+}
+
+static inline guint32 *
+emit_call_and_store_retval (guint32 *p, MonoMethodSignature *sig,
+ guint stack_size, gboolean string_ctor)
+{
+ guint32 simpletype;
+
+ /* call "callme" */
sparc_jmpl_imm (p, sparc_i0, 0, sparc_callsite);
sparc_nop (p);
-
- /*
- * Handle retval.
- * Small integer and pointer values are in EAX.
- * Long integers are in EAX:EDX.
- * FP values are on the FP stack.
- */
-#if 0
- if (sig->ret->byref) {
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
+#if !SPARCV9
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->data.klass->enumtype) {
+ int size = mono_class_native_size (sig->ret->data.klass, NULL);
+ sparc_unimp (p, size & 4095);
+ }
+#endif
+
+ /* get return value */
+ if (sig->ret->byref || string_ctor) {
+ sparc_st_ptr (p, sparc_o0, sparc_i1, 0);
} else {
simpletype = sig->ret->type;
-enum_retvalue:
+ enum_retval:
switch (simpletype) {
case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 1);
- break;
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 2);
- break;
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- break;
- case MONO_TYPE_STRING:
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime) {
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- break;
- }
-
- /* If the argument is non-null, then convert the value back */
- x86_alu_reg_reg (p, X86_OR, X86_EAX, X86_EAX);
- x86_branch8 (p, X86_CC_EQ, 11, FALSE);
- x86_push_reg (p, X86_EAX);
- x86_mov_reg_imm (p, X86_EDX, mono_string_new);
- x86_call_reg (p, X86_EDX);
- x86_alu_reg_imm (p, X86_ADD, X86_ESP, 4);
-
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- break;
- case MONO_TYPE_R4:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_fst_membase (p, X86_ECX, 0, FALSE, TRUE);
- break;
- case MONO_TYPE_R8:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_fst_membase (p, X86_ECX, 0, TRUE, TRUE);
- break;
- case MONO_TYPE_I8:
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- x86_mov_membase_reg (p, X86_ECX, 4, X86_EDX, 4);
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->ret->data.klass->enumtype) {
- simpletype = sig->ret->data.klass->enum_basetype->type;
- goto enum_retvalue;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ sparc_stb (p, sparc_o0, sparc_i1, 0);
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ sparc_sth (p, sparc_o0, sparc_i1, 0);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ sparc_st (p, sparc_o0, sparc_i1, 0);
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_PTR:
+ sparc_st_ptr (p, sparc_o0, sparc_i1, 0);
+ break;
+ case MONO_TYPE_R4:
+ sparc_stf (p, sparc_f0, sparc_i1, 0);
+ break;
+ case MONO_TYPE_R8:
+ sparc_stdf (p, sparc_f0, sparc_i1, 0);
+ break;
+ case MONO_TYPE_I8:
+#if SPARCV9
+ sparc_stx (p, sparc_o0, sparc_i1, 0);
+#else
+ sparc_std (p, sparc_o0, sparc_i1, 0);
+#endif
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retval;
+ }
+#if SPARCV9
+ size = mono_class_native_size (sig->ret->data.klass, NULL);
+ if (size <= 32) {
+ int n_regs = size / 8;
+ int j;
+ sparc_ldx_imm (p, sparc_i1, 0, sparc_i1);
+ /* wrong if there are floating values in the struct... */
+ for (j = 0; j < n_regs; j++) {
+ sparc_stx_imm (p, sparc_o0 + j, sparc_i1, j * 8);
+ }
+ size -= n_regs * 8;
+ if (size > 0) {
+ int last_reg = sparc_o0 + n_regs;
+ /* get value right aligned in register */
+ sparc_srlx_imm(p, last_reg, 64 - 8 * size, last_reg);
+ if ((size & 1) != 0) {
+ sparc_stb_imm (p, last_reg, sparc_i1, n_regs * 8 + size - 1);
+ size--;
+ if (size > 0)
+ sparc_srlx_imm(p, last_reg, 8, last_reg);
+ }
+ if ((size & 2) != 0) {
+ sparc_sth_imm (p, last_reg, sparc_i1, n_regs * 8 + size - 2);
+ size -= 2;
+ if (size > 0)
+ sparc_srlx_imm(p, last_reg, 16, last_reg);
+ }
+ if ((size & 4) != 0)
+ sparc_st_imm (p, last_reg, sparc_i1, n_regs * 8);
+ }
}
- case MONO_TYPE_VOID:
- break;
- default:
- g_error ("Can't handle as return value 0x%x", sig->ret->type);
+#endif
+ }
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
}
}
-#endif
+ return p;
+}
+
+MonoPIFunc
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+{
+ guint32 *p, *code_buffer;
+ guint stack_size, code_size, i;
+ gboolean use_memcpy = FALSE;
+ static GHashTable *cache = NULL;
+ MonoPIFunc res;
+
+ if (!cache)
+ cache = g_hash_table_new ((GHashFunc)mono_signature_hash,
+ (GCompareFunc)mono_metadata_signature_equal);
+
+ if ((res = (MonoPIFunc)g_hash_table_lookup(cache, sig)))
+ return res;
+
+ calculate_sizes (sig, &stack_size, &code_size,
+ string_ctor, &use_memcpy);
+
+ p = code_buffer = alloc_code_memory (code_size);
+ p = emit_prolog (p, sig, stack_size);
+ p = emit_save_parameters (p, sig, stack_size, use_memcpy);
+ p = emit_call_and_store_retval (p, sig, stack_size, string_ctor);
+ /* we don't return structs here so pass in NULL as signature */
+ p = emit_epilog (p, NULL, stack_size);
+
+ g_assert(p <= code_buffer + (code_size / 4));
-#if 0
- /* free the allocated strings... */
- if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
- if (local_size)
- x86_mov_reg_imm (p, X86_EDX, g_free);
- for (i = 1; i <= local_size; ++i) {
- x86_push_membase (p, X86_EBP, LOC_POS * i);
- x86_call_reg (p, X86_EDX);
+ DEBUG(sparc_disassemble_code (code_buffer, p, sig_to_name(sig, NULL)));
+
+ /* So here's the deal...
+ * UltraSPARC will flush a whole cache line at a time
+ * BUT, older SPARCs won't.
+ * So, be compatable and flush dwords at a time...
+ */
+
+ for (i = 0; i < ((p - code_buffer)/2); i++)
+ flushi((code_buffer + (i*8)));
+
+ g_hash_table_insert(cache, sig, code_buffer);
+
+ return (MonoPIFunc)code_buffer;
+}
+
+#define MINV_POS (MINIMAL_STACK_SIZE * SLOT_SIZE + BIAS)
+
+void *
+mono_arch_create_method_pointer (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ MonoJitInfo *ji;
+ guint stack_size, code_size, stackval_arg_pos, local_pos;
+ guint i, local_start, reg_param = 0, stack_param, cpos, vt_cur;
+ guint32 align = 0;
+ guint32 *p, *code_buffer;
+ gint *vtbuf;
+ gint32 simpletype;
+
+ code_size = 1024; /* these should be calculated... */
+ stack_size = 1024;
+ stack_param = 0;
+
+ sig = method->signature;
+
+ p = code_buffer = g_malloc (code_size);
+
+ DEBUG(fprintf(stderr, "Delegate [start emiting] %s\n", method->name));
+ DEBUG(fprintf(stderr, "%s\n", sig_to_name(sig, FALSE)));
+
+ p = emit_prolog (p, sig, stack_size);
+
+ /* fill MonoInvocation */
+ sparc_st_imm_ptr (p, sparc_g0, sparc_sp,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex)));
+ sparc_st_imm_ptr (p, sparc_g0, sparc_sp,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler)));
+ sparc_st_imm_ptr (p, sparc_g0, sparc_sp,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent)));
+
+ sparc_set_ptr (p, (void *)method, sparc_l0);
+ sparc_st_imm_ptr (p, sparc_l0, sparc_sp,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method)));
+
+ stackval_arg_pos = MINV_POS + sizeof (MonoInvocation);
+ local_start = local_pos = stackval_arg_pos + (sig->param_count + 1) * sizeof (stackval);
+
+ if (sig->hasthis) {
+ sparc_st_imm_ptr (p, sparc_i0, sparc_sp,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)));
+ reg_param = 1;
+ }
+
+ if (sig->param_count) {
+ gint save_count = MIN (OUT_REGS, sig->param_count + sig->hasthis);
+ for (i = reg_param; i < save_count; i++) {
+ sparc_st_imm_ptr (p, sparc_i0 + i, sparc_sp, local_pos);
+ local_pos += SLOT_SIZE;
}
}
-#endif
- /*
- * Standard epilog.
- * 8 may be 12 when returning structures (to skip unimp opcode).
- */
- sparc_jmpl_imm (p, sparc_i7, 8, sparc_zero);
- sparc_restore (p, sparc_zero, sparc_zero, sparc_zero);
+
+ /* prepare space for valuetypes */
+ vt_cur = local_pos;
+ vtbuf = alloca (sizeof(int)*sig->param_count);
+ cpos = 0;
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *type = sig->params [i];
+ vtbuf [i] = -1;
+ if (!sig->params[i]->byref && type->type == MONO_TYPE_VALUETYPE) {
+ MonoClass *klass = type->data.klass;
+ gint size;
+
+ if (klass->enumtype)
+ continue;
+ size = mono_class_native_size (klass, &align);
+ cpos += align - 1;
+ cpos &= ~(align - 1);
+ vtbuf [i] = cpos;
+ cpos += size;
+ }
+ }
+ cpos += SLOT_SIZE - 1;
+ cpos &= ~(SLOT_SIZE - 1);
- {
- unsigned char *inptr, *inend;
-
- inptr = (unsigned char *) code_buffer;
- inend = (unsigned char *) p;
-
- printf (".text\n.align 4\n.globl main\n.type main,function\nmain:\n");
- while (inptr < inend) {
- printf (".byte 0x%x\n", *inptr);
- inptr++;
+ local_pos += cpos;
+
+ /* set MonoInvocation::stack_args */
+ sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos, sparc_l0);
+ sparc_st_imm_ptr (p, sparc_l0, sparc_sp,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args)));
+
+ /* add stackval arguments */
+ for (i=0; i < sig->param_count; i++) {
+ int stack_offset;
+ int type;
+ if (reg_param < OUT_REGS) {
+ stack_offset = local_start + i * SLOT_SIZE;
+ reg_param++;
+ } else {
+ stack_offset = stack_size + 8 + stack_param;
+ stack_param++;
}
- fflush (stdout);
+
+ if (!sig->params[i]->byref) {
+ type = sig->params[i]->type;
+ enum_arg:
+ switch (type) {
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_R8:
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ stack_offset += SLOT_SIZE - 4;
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ stack_offset += SLOT_SIZE - 2;
+ break;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ stack_offset += SLOT_SIZE - 1;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params[i]->data.klass->enumtype) {
+ type = sig->params[i]->data.klass->enum_basetype->type;
+ goto enum_arg;
+ }
+ g_assert(vtbuf[i] >= 0);
+ break;
+ default:
+ g_error ("can not cope with delegate arg type %d", type);
+ }
+ }
+
+ sparc_add_imm (p, 0, sparc_sp, stack_offset, sparc_o2);
+
+ if (vtbuf[i] >= 0) {
+ sparc_add_imm (p, 0, sparc_sp, vt_cur, sparc_o1);
+ sparc_st_imm_ptr (p, sparc_o1, sparc_sp, stackval_arg_pos);
+ sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos,
+ sparc_o1);
+ sparc_ld_imm_ptr (p, sparc_o2, 0, sparc_o2);
+ vt_cur += vtbuf[i];
+ } else {
+ sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos,
+ sparc_o1);
+ }
+
+ sparc_set_ptr (p, (void *)sig->params[i], sparc_o0);
+ sparc_set (p, (guint32)sig->pinvoke, sparc_o3);
+
+ /* YOU make the CALL! */
+ sparc_set_ptr (p, (void *)stackval_from_data, sparc_l0);
+ sparc_jmpl_imm (p, sparc_l0, 0, sparc_callsite);
+ sparc_nop (p);
+ stackval_arg_pos += sizeof(stackval);
+ }
+
+ /* return value storage */
+ /* Align to dword */
+ stackval_arg_pos = (stackval_arg_pos + (8 - 1)) & (~(8 -1));
+ if (sig->param_count) {
+ sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos, sparc_l0);
}
+ if (!sig->ret->byref && sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->data.klass->enumtype) {
+#if !SPARCV9
+ /* pass on callers buffer */
+ sparc_ld_imm_ptr (p, sparc_fp, 64, sparc_l1);
+ sparc_st_imm_ptr (p, sparc_l1, sparc_l0, 0);
+#else
+ sparc_add_imm (p, 0, sparc_l0, sizeof(stackval), sparc_l1);
+ sparc_st_imm_ptr (p, sparc_l1, sparc_l0, 0);
+#endif
+ }
+
+ sparc_st_imm_ptr (p, sparc_l0, sparc_sp,
+ (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)));
+
+ /* call ves_exec_method */
+ sparc_add_imm (p, 0, sparc_sp, MINV_POS, sparc_o0);
+ sparc_set_ptr (p, (void *)ves_exec_method, sparc_l0);
+ sparc_jmpl_imm (p, sparc_l0, 0, sparc_callsite);
+ sparc_nop (p);
+
+ /* move retval from stackval to proper place (r3/r4/...) */
+ if (sig->ret->byref) {
+ sparc_ld_imm_ptr (p, sparc_sp, stackval_arg_pos, sparc_i0 );
+ } else {
+ enum_retvalue:
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ sparc_ld_imm (p, sparc_sp, stackval_arg_pos, sparc_i0);
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ sparc_ld_imm_ptr (p, sparc_sp, stackval_arg_pos, sparc_i0);
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+#if SPARCV9
+ sparc_ldx_imm (p, sparc_sp, stackval_arg_pos, sparc_i0);
+#else
+ sparc_ld_imm (p, sparc_sp, stackval_arg_pos, sparc_i0);
+ sparc_ld_imm (p, sparc_sp, stackval_arg_pos + 4, sparc_i1);
+#endif
+ break;
+ case MONO_TYPE_R4:
+ sparc_lddf_imm (p, sparc_sp, stackval_arg_pos, sparc_f0);
+ sparc_fdtos(p, sparc_f0, sparc_f0);
+ break;
+ case MONO_TYPE_R8:
+ sparc_lddf_imm (p, sparc_sp, stackval_arg_pos, sparc_f0);
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
+ gint reg = sparc_i0;
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+#if SPARCV9
+ size = mono_class_native_size (sig->ret->data.klass, NULL);
+ sparc_ldx_imm (p, sparc_sp, stackval_arg_pos, sparc_l0);
+ if (size <= 16) {
+ gint off = 0;
+ if (size >= 8) {
+ sparc_ldx_imm (p, sparc_l0, 0, reg);
+ size -= 8;
+ off += 8;
+ reg++;
+ }
+ if (size > 0)
+ sparc_ldx_imm (p, sparc_l0, off, reg);
+ } else
+ NOT_IMPL("value type as ret val from delegate");
+#endif
+ break;
+ }
+ default:
+ g_error ("Type 0x%x not handled yet in thunk creation",
+ sig->ret->type);
+ break;
+ }
+ }
+
+ p = emit_epilog (p, sig, stack_size);
+
+ for (i = 0; i < ((p - code_buffer)/2); i++)
+ flushi((code_buffer + (i*8)));
- fprintf (stderr, "PInvoke [finish emiting] %s\n", method->name);
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = p - code_buffer;
+ ji->code_start = code_buffer;
- /* FIXME: need to flush */
- return g_memdup (code_buffer, 4 * (p - code_buffer));
-}
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
-void *
-mono_create_method_pointer (MonoMethod *method)
-{
- return NULL;
-}
+ DEBUG(sparc_disassemble_code (code_buffer, p, method->name));
-MonoMethod*
-mono_method_pointer_get (void *code)
-{
- return NULL;
+ DEBUG(fprintf(stderr, "Delegate [end emiting] %s\n", method->name));
+
+ return ji->code_start;
}
diff --git a/mono/arch/unknown.c b/mono/arch/unknown.c
index d02edcaf0cc..d865299001c 100644
--- a/mono/arch/unknown.c
+++ b/mono/arch/unknown.c
@@ -1,8 +1,7 @@
-#ifdef NO_PORT
#include "mono/interpreter/interp.h"
-
+#ifdef NO_PORT
MonoPIFunc
-mono_create_trampoline (MonoMethod *method)
+mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
g_error ("Unsupported arch");
return NULL;
diff --git a/mono/arch/x86/tramp.c b/mono/arch/x86/tramp.c
index a08e743fc96..fab5a55325f 100644
--- a/mono/arch/x86/tramp.c
+++ b/mono/arch/x86/tramp.c
@@ -3,7 +3,9 @@
*
* Copyright (C) Ximian Inc.
*
- * Author: Paolo Molaro (lupus@ximian.com)
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
*
*/
@@ -30,33 +32,36 @@
#define ARG_SIZE sizeof (stackval)
MonoPIFunc
-mono_create_trampoline (MonoMethod *method, int runtime)
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
- MonoMethodSignature *sig;
unsigned char *p, *code_buffer;
- guint32 local_size = 0, stack_size = 0, code_size = 50;
+ guint32 stack_size = 0, code_size = 50;
guint32 arg_pos, simpletype;
int i, stringp;
- int need_marshal;
- GList *free_locs = NULL;
+ static GHashTable *cache = NULL;
+ MonoPIFunc res;
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || runtime)
- need_marshal = 0;
- else
- need_marshal = 1;
+ if (!cache)
+ cache = g_hash_table_new ((GHashFunc)mono_signature_hash,
+ (GCompareFunc)mono_metadata_signature_equal);
+
+ if ((res = (MonoPIFunc)g_hash_table_lookup (cache, sig)))
+ return res;
- sig = method->signature;
-
if (sig->hasthis) {
stack_size += sizeof (gpointer);
- code_size += 5;
+ code_size += 10;
}
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype) {
+ stack_size += sizeof (gpointer);
+ code_size += 5;
+ }
+
for (i = 0; i < sig->param_count; ++i) {
if (sig->params [i]->byref) {
stack_size += sizeof (gpointer);
code_size += 20;
- local_size++;
continue;
}
simpletype = sig->params [i]->type;
@@ -73,32 +78,37 @@ enum_calc_size:
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
- case MONO_TYPE_R4:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
stack_size += 4;
code_size += i < 10 ? 5 : 8;
break;
- case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_VALUETYPE: {
+ int size;
if (sig->params [i]->data.klass->enumtype) {
simpletype = sig->params [i]->data.klass->enum_basetype->type;
goto enum_calc_size;
}
- if (mono_class_value_size (sig->params [i]->data.klass, NULL) != 4)
- g_error ("can only marshal enums, not generic structures (size: %d)", mono_class_value_size (sig->params [i]->data.klass, NULL));
- stack_size += 4;
- code_size += i < 10 ? 5 : 8;
- break;
- case MONO_TYPE_STRING:
- stack_size += 4;
- code_size += 20;
- local_size++;
+ if ((size = mono_class_native_size (sig->params [i]->data.klass, NULL)) != 4) {
+ stack_size += size + 3;
+ stack_size &= ~3;
+ code_size += 32;
+ } else {
+ stack_size += 4;
+ code_size += i < 10 ? 5 : 8;
+ }
break;
+ }
case MONO_TYPE_I8:
stack_size += 8;
code_size += i < 10 ? 5 : 8;
break;
+ case MONO_TYPE_R4:
+ stack_size += 4;
+ code_size += i < 10 ? 10 : 13;
+ break;
case MONO_TYPE_R8:
stack_size += 8;
code_size += i < 10 ? 7 : 10;
@@ -119,15 +129,11 @@ enum_calc_size:
x86_push_reg (p, X86_EBP);
x86_mov_reg_reg (p, X86_EBP, X86_ESP, 4);
/*
- * We store some local vars here to handle string pointers.
* and align to 16 byte boundary...
*/
- if (local_size) {
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, local_size * 4);
- stack_size = (stack_size * local_size * 4) % 16;
- } else {
- stack_size = stack_size % 16;
- }
+ stack_size += 15;
+ stack_size &= ~15;
+
if (stack_size)
x86_alu_reg_imm (p, X86_SUB, X86_ESP, stack_size);
@@ -143,31 +149,7 @@ enum_calc_size:
for (i = sig->param_count; i; --i) {
arg_pos = ARG_SIZE * (i - 1);
if (sig->params [i - 1]->byref) {
- if (!need_marshal) {
- x86_push_membase (p, X86_EDX, arg_pos);
- continue;
- }
- if (sig->params [i - 1]->type == MONO_TYPE_SZARRAY &&
- sig->params [i - 1]->data.type->type == MONO_TYPE_STRING) {
- x86_mov_reg_membase (p, X86_EAX, X86_EDX, arg_pos, 4);
- x86_push_regp (p, X86_EAX);
- x86_mov_reg_imm (p, X86_EDX, mono_marshal_string_array);
- x86_call_reg (p, X86_EDX);
- x86_alu_reg_imm (p, X86_ADD, X86_ESP, 4);
- /*
- * Store the pointer in a local we'll free later.
- */
- stringp++;
- x86_mov_membase_reg (p, X86_EBP, LOC_POS * stringp, X86_EAX, 4);
- free_locs = g_list_prepend (free_locs, GUINT_TO_POINTER (LOC_POS * stringp));
- /* load the pointer and push it */
- x86_lea_membase (p, X86_EAX, X86_EBP, LOC_POS * stringp);
- x86_push_reg (p, X86_EAX);
- /* restore pointer to args in EDX */
- x86_mov_reg_membase (p, X86_EDX, X86_EBP, ARGP_POS, 4);
- } else {
- x86_push_membase (p, X86_EDX, arg_pos);
- }
+ x86_push_membase (p, X86_EDX, arg_pos);
continue;
}
simpletype = sig->params [i - 1]->type;
@@ -184,58 +166,50 @@ enum_marshal:
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_PTR:
- case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ x86_push_membase (p, X86_EDX, arg_pos);
+ break;
case MONO_TYPE_R4:
+ x86_alu_reg_imm (p, X86_SUB, X86_ESP, 4);
+ x86_fld_membase (p, X86_EDX, arg_pos, TRUE);
+ x86_fst_membase (p, X86_ESP, 0, FALSE, TRUE);
+ break;
+ case MONO_TYPE_CLASS:
x86_push_membase (p, X86_EDX, arg_pos);
break;
case MONO_TYPE_SZARRAY:
- if (need_marshal) {
- x86_mov_reg_membase (p, X86_EAX, X86_EDX, arg_pos, 4);
- x86_alu_reg_imm (p, X86_ADD, X86_EAX, G_STRUCT_OFFSET (MonoArray, vector));
- x86_push_reg (p, X86_EAX);
- } else {
- x86_push_membase (p, X86_EDX, arg_pos);
- }
+ x86_push_membase (p, X86_EDX, arg_pos);
break;
case MONO_TYPE_VALUETYPE:
if (!sig->params [i - 1]->data.klass->enumtype) {
- /* it's a structure that fits in 4 bytes, need to push the value pointed to */
- x86_mov_reg_membase (p, X86_EAX, X86_EDX, arg_pos, 4);
- x86_push_regp (p, X86_EAX);
+ int size = mono_class_native_size (sig->params [i - 1]->data.klass, NULL);
+ if (size == 4) {
+ /* it's a structure that fits in 4 bytes, need to push the value pointed to */
+ x86_mov_reg_membase (p, X86_EAX, X86_EDX, arg_pos, 4);
+ x86_push_regp (p, X86_EAX);
+ } else {
+ int ss = size;
+ ss += 3;
+ ss &= ~3;
+
+ x86_alu_reg_imm (p, X86_SUB, X86_ESP, ss);
+ x86_push_imm (p, size);
+ x86_push_membase (p, X86_EDX, arg_pos);
+ x86_lea_membase (p, X86_EAX, X86_ESP, 2*4);
+ x86_push_reg (p, X86_EAX);
+ x86_mov_reg_imm (p, X86_EAX, memcpy);
+ x86_call_reg (p, X86_EAX);
+ x86_alu_reg_imm (p, X86_ADD, X86_ESP, 12);
+ /* memcpy might clobber EDX so restore it */
+ x86_mov_reg_membase (p, X86_EDX, X86_EBP, ARGP_POS, 4);
+ }
} else {
/* it's an enum value */
simpletype = sig->params [i - 1]->data.klass->enum_basetype->type;
goto enum_marshal;
}
break;
- case MONO_TYPE_STRING:
- /*
- * If it is an internalcall we assume it's the object we want.
- * Yet another reason why MONO_TYPE_STRING should not be used to indicate char*.
- */
- if (!need_marshal) {
- x86_push_membase (p, X86_EDX, arg_pos);
- break;
- }
- /*if (frame->method->flags & PINVOKE_ATTRIBUTE_CHAR_SET_ANSI*/
- x86_push_membase (p, X86_EDX, arg_pos);
- x86_mov_reg_imm (p, X86_EDX, mono_string_to_utf8);
- x86_call_reg (p, X86_EDX);
- x86_alu_reg_imm (p, X86_ADD, X86_ESP, 4);
- x86_push_reg (p, X86_EAX);
- /*
- * Store the pointer in a local we'll free later.
- */
- stringp++;
- x86_mov_membase_reg (p, X86_EBP, LOC_POS * stringp, X86_EAX, 4);
- free_locs = g_list_prepend (free_locs, GUINT_TO_POINTER (LOC_POS * stringp));
- /*
- * we didn't save the reg: restore it here.
- */
- if (i > 1)
- x86_mov_reg_membase (p, X86_EDX, X86_EBP, ARGP_POS, 4);
- break;
case MONO_TYPE_I8:
case MONO_TYPE_U8:
case MONO_TYPE_R8:
@@ -256,6 +230,14 @@ enum_marshal:
}
}
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
+ x86_push_membase (p, X86_ECX, 0);
+ }
+ }
+
/*
* Insert call to function
*/
@@ -269,14 +251,12 @@ enum_marshal:
* FP values are on the FP stack.
*/
- if (sig->ret->byref ||
- (method->klass == mono_defaults.string_class &&
- *method->name == '.' && !strcmp (method->name, ".ctor"))) {
+ if (sig->ret->byref || string_ctor) {
x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
} else {
simpletype = sig->ret->type;
-enum_retvalue:
+ enum_retvalue:
switch (simpletype) {
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1:
@@ -302,20 +282,6 @@ enum_retvalue:
x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
break;
case MONO_TYPE_STRING:
- if (!need_marshal) {
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
- x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
- break;
- }
-
- /* If the argument is non-null, then convert the value back */
- x86_alu_reg_reg (p, X86_OR, X86_EAX, X86_EAX);
- x86_branch8 (p, X86_CC_EQ, 11, FALSE);
- x86_push_reg (p, X86_EAX);
- x86_mov_reg_imm (p, X86_EDX, mono_string_new_wrapper);
- x86_call_reg (p, X86_EDX);
- x86_alu_reg_imm (p, X86_ADD, X86_ESP, 4);
-
x86_mov_reg_membase (p, X86_ECX, X86_EBP, RETVAL_POS, 4);
x86_mov_regp_reg (p, X86_ECX, X86_EAX, 4);
break;
@@ -345,30 +311,21 @@ enum_retvalue:
}
/*
- * free the allocated strings.
- */
- if (need_marshal) {
- GList* tmp;
- for (tmp = free_locs; tmp; tmp = tmp->next) {
- x86_mov_reg_imm (p, X86_EDX, g_free);
- x86_push_membase (p, X86_EBP, GPOINTER_TO_UINT (tmp->data));
- x86_call_reg (p, X86_EDX);
- }
- g_list_free (free_locs);
- }
- /*
* Standard epilog.
*/
x86_leave (p);
x86_ret (p);
g_assert (p - code_buffer < code_size);
- return g_memdup (code_buffer, p - code_buffer);
+ res = (MonoPIFunc)g_memdup (code_buffer, p - code_buffer);
+
+ g_hash_table_insert (cache, sig, res);
+
+ return res;
}
#define MINV_POS (- sizeof (MonoInvocation))
#define STACK_POS (MINV_POS - sizeof (stackval) * sig->param_count)
-#define OBJ_POS 8
#define TYPE_OFFSET (G_STRUCT_OFFSET (stackval, type))
/*
@@ -382,26 +339,49 @@ enum_retvalue:
* across the managed/unmanaged boundary.
*/
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
MonoMethodSignature *sig;
MonoJitInfo *ji;
unsigned char *p, *code_buffer;
gint32 local_size;
gint32 stackval_pos, arg_pos = 8;
- int i, align;
+ int i, size, align, cpos;
+ int *vtbuf;
- /*
- * If it is a static P/Invoke method, we can just return the pointer
- * to the method implementation.
- */
sig = method->signature;
code_buffer = p = alloca (512); /* FIXME: check for overflows... */
+ vtbuf = alloca (sizeof(int)*sig->param_count);
local_size = sizeof (MonoInvocation) + sizeof (stackval) * (sig->param_count + 1);
+
+ local_size += 7;
+ local_size &= ~7;
+
stackval_pos = -local_size;
+ cpos = 0;
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *type = sig->params [i];
+ vtbuf [i] = -1;
+ if (type->type == MONO_TYPE_VALUETYPE) {
+ MonoClass *klass = type->data.klass;
+ if (klass->enumtype)
+ continue;
+ size = mono_class_native_size (klass, &align);
+ cpos += align - 1;
+ cpos &= ~(align - 1);
+ vtbuf [i] = cpos;
+ cpos += size;
+ }
+ }
+
+ cpos += 7;
+ cpos &= ~7;
+
+ local_size += cpos;
+
/*
* Standard function prolog.
*/
@@ -415,13 +395,15 @@ mono_create_method_pointer (MonoMethod *method)
x86_mov_reg_imm (p, X86_EAX, 0);
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex)), X86_EAX, 4);
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler)), X86_EAX, 4);
- x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, child)), X86_EAX, 4);
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent)), X86_EAX, 4);
/*
* Set the method pointer.
*/
x86_mov_membase_imm (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method)), (int)method, 4);
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref && !sig->ret->data.klass->enumtype)
+ arg_pos += 4;
+
/*
* Handle this.
*/
@@ -430,7 +412,7 @@ mono_create_method_pointer (MonoMethod *method)
/*
* Grab it from the stack, otherwise it's already in ECX.
*/
- x86_mov_reg_membase (p, X86_ECX, X86_EBP, OBJ_POS, 4);
+ x86_mov_reg_membase (p, X86_ECX, X86_EBP, arg_pos, 4);
arg_pos += 4;
}
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj)), X86_ECX, 4);
@@ -443,16 +425,25 @@ mono_create_method_pointer (MonoMethod *method)
x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args)), X86_EAX, 4);
for (i = 0; i < sig->param_count; ++i) {
+ if (vtbuf [i] >= 0) {
+ x86_lea_membase (p, X86_EAX, X86_EBP, - local_size + vtbuf [i]);
+ x86_mov_membase_reg (p, X86_EBP, stackval_pos, X86_EAX, 4);
+ }
x86_mov_reg_imm (p, X86_ECX, stackval_from_data);
x86_lea_membase (p, X86_EDX, X86_EBP, arg_pos);
x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
+ x86_push_imm (p, sig->pinvoke);
x86_push_reg (p, X86_EDX);
x86_push_reg (p, X86_EAX);
x86_push_imm (p, sig->params [i]);
x86_call_reg (p, X86_ECX);
- x86_alu_reg_imm (p, X86_SUB, X86_ESP, 12);
+ x86_alu_reg_imm (p, X86_SUB, X86_ESP, 16);
stackval_pos += sizeof (stackval);
- arg_pos += mono_type_stack_size (sig->params [i], &align);
+ /* fixme: alignment */
+ if (sig->pinvoke)
+ arg_pos += mono_type_native_stack_size (sig->params [i], &align);
+ else
+ arg_pos += mono_type_stack_size (sig->params [i], &align);
}
/*
@@ -460,6 +451,13 @@ mono_create_method_pointer (MonoMethod *method)
*/
x86_lea_membase (p, X86_EAX, X86_EBP, stackval_pos);
x86_mov_membase_reg (p, X86_EBP, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval)), X86_EAX, 4);
+ if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) {
+ MonoClass *klass = sig->ret->data.klass;
+ if (!klass->enumtype) {
+ x86_mov_reg_membase (p, X86_ECX, X86_EBP, 8, 4);
+ x86_mov_membase_reg (p, X86_EBP, stackval_pos, X86_ECX, 4);
+ }
+ }
/*
* Call the method.
@@ -468,7 +466,7 @@ mono_create_method_pointer (MonoMethod *method)
x86_push_reg (p, X86_EAX);
x86_mov_reg_imm (p, X86_EDX, ves_exec_method);
x86_call_reg (p, X86_EDX);
-
+
/*
* Move the return value to the proper place.
*/
@@ -476,12 +474,21 @@ mono_create_method_pointer (MonoMethod *method)
if (sig->ret->byref) {
x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 4);
} else {
+ int simpletype = sig->ret->type;
+ enum_retvalue:
switch (sig->ret->type) {
case MONO_TYPE_VOID:
break;
case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 1);
break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ x86_mov_reg_membase (p, X86_EAX, X86_EAX, 0, 2);
+ break;
case MONO_TYPE_I4:
case MONO_TYPE_U4:
case MONO_TYPE_I:
@@ -498,6 +505,21 @@ mono_create_method_pointer (MonoMethod *method)
case MONO_TYPE_R8:
x86_fld_membase (p, X86_EAX, 0, TRUE);
break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+
+ x86_push_imm (p, sig->pinvoke);
+ x86_push_membase (p, X86_EBP, stackval_pos);
+ x86_push_reg (p, X86_EAX);
+ x86_push_imm (p, sig->ret);
+ x86_mov_reg_imm (p, X86_ECX, stackval_to_data);
+ x86_call_reg (p, X86_ECX);
+ x86_alu_reg_imm (p, X86_SUB, X86_ESP, 16);
+
+ break;
default:
g_error ("Type 0x%x not handled yet in thunk creation", sig->ret->type);
break;
@@ -517,7 +539,7 @@ mono_create_method_pointer (MonoMethod *method)
ji->code_size = p - code_buffer;
ji->code_start = g_memdup (code_buffer, p - code_buffer);
- mono_jit_info_table_add (mono_root_domain, ji);
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
return ji->code_start;
}
diff --git a/mono/arch/x86/x86-codegen.h b/mono/arch/x86/x86-codegen.h
index f69534b63dd..b372bef1bc0 100644
--- a/mono/arch/x86/x86-codegen.h
+++ b/mono/arch/x86/x86-codegen.h
@@ -6,6 +6,7 @@
* Intel Corporation (ORP Project)
* Sergey Chaban (serge@wildwestsoftware.com)
* Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
*
* Copyright (C) 2000 Intel Corporation. All rights reserved.
* Copyright (C) 2001, 2002 Ximian, Inc.
@@ -89,6 +90,39 @@ typedef enum {
X86_CC_NO = 11,
X86_NCC
} X86_CC;
+
+/* FP status */
+enum {
+ X86_FP_C0 = 0x100,
+ X86_FP_C1 = 0x200,
+ X86_FP_C2 = 0x400,
+ X86_FP_C3 = 0x4000,
+ X86_FP_CC_MASK = 0x4500
+};
+
+/* FP control word */
+enum {
+ X86_FPCW_INVOPEX_MASK = 0x1,
+ X86_FPCW_DENOPEX_MASK = 0x2,
+ X86_FPCW_ZERODIV_MASK = 0x4,
+ X86_FPCW_OVFEX_MASK = 0x8,
+ X86_FPCW_UNDFEX_MASK = 0x10,
+ X86_FPCW_PRECEX_MASK = 0x20,
+ X86_FPCW_PRECC_MASK = 0x300,
+ X86_FPCW_ROUNDC_MASK = 0xc00,
+
+ /* values for precision control */
+ X86_FPCW_PREC_SINGLE = 0,
+ X86_FPCW_PREC_DOUBLE = 0x200,
+ X86_FPCW_PREC_EXTENDED = 0x300,
+
+ /* values for rounding control */
+ X86_FPCW_ROUND_NEAREST = 0,
+ X86_FPCW_ROUND_DOWN = 0x400,
+ X86_FPCW_ROUND_UP = 0x800,
+ X86_FPCW_ROUND_TOZERO = 0xc00
+};
+
/*
// prefix code
*/
@@ -103,6 +137,8 @@ typedef enum {
X86_ES_PREFIX = 0x26,
X86_FS_PREFIX = 0x64,
X86_GS_PREFIX = 0x65,
+ X86_UNLIKELY_PREFIX = 0x2E,
+ X86_LIKELY_PREFIX = 0x3E,
X86_OPERAND_PREFIX = 0x66,
X86_ADDRESS_PREFIX = 0x67
} X86_Prefix;
@@ -161,6 +197,8 @@ typedef union {
#define X86_IS_SCRATCH(reg) (X86_CALLER_REGS & (1 << (reg))) /* X86_EAX, X86_ECX, or X86_EDX */
#define X86_IS_CALLEE(reg) (X86_CALLEE_REGS & (1 << (reg))) /* X86_ESI, X86_EDI, X86_EBX, or X86_EBP */
+#define X86_IS_BYTE_REG(reg) ((reg) < 4)
+
/*
// Frame structure:
//
@@ -204,6 +242,10 @@ typedef union {
/*
* useful building blocks
*/
+#define x86_modrm_mod(modrm) ((modrm) >> 6)
+#define x86_modrm_reg(modrm) (((modrm) >> 3) & 0x7)
+#define x86_modrm_rm(modrm) ((modrm) & 0x7)
+
#define x86_address_byte(inst,m,o,r) do { *(inst)++ = ((((m)&0x03)<<6)|(((o)&0x07)<<3)|(((r)&0x07))); } while (0)
#define x86_imm_emit32(inst,imm) \
do { \
@@ -266,7 +308,7 @@ typedef union {
x86_address_byte ((inst), (shift), (indexreg), (basereg)); \
x86_imm_emit8 ((inst), (disp)); \
} else { \
- x86_address_byte ((inst), 0, (r), 4); \
+ x86_address_byte ((inst), 2, (r), 4); \
x86_address_byte ((inst), (shift), (indexreg), 5); \
x86_imm_emit32 ((inst), (disp)); \
} \
@@ -490,6 +532,13 @@ typedef union {
x86_imm_emit32 ((inst), (imm)); \
} \
} while (0)
+
+#define x86_alu_membase8_imm(inst,opc,basereg,disp,imm) \
+ do { \
+ *(inst)++ = (unsigned char)0x80; \
+ x86_membase_emit ((inst), (opc), (basereg), (disp)); \
+ x86_imm_emit8 ((inst), (imm)); \
+ } while (0)
#define x86_alu_mem_reg(inst,opc,mem,reg) \
do { \
@@ -951,6 +1000,7 @@ typedef union {
#define x86_widen_reg(inst,dreg,reg,is_signed,is_half) \
do { \
unsigned char op = 0xb6; \
+ g_assert (is_half || X86_IS_BYTE_REG (reg)); \
*(inst)++ = (unsigned char)0x0f; \
if ((is_signed)) op += 0x08; \
if ((is_half)) op += 0x01; \
@@ -1183,6 +1233,12 @@ typedef union {
*(inst)++ = (unsigned char)0xe8; \
} while (0)
+#define x86_fldpi(inst) \
+ do { \
+ *(inst)++ = (unsigned char)0xd9; \
+ *(inst)++ = (unsigned char)0xeb; \
+ } while (0)
+
#define x86_fst(inst,mem,is_double,pop_stack) \
do { \
*(inst)++ = (is_double) ? (unsigned char)0xdd: (unsigned char)0xd9; \
@@ -1231,6 +1287,13 @@ typedef union {
} \
} while (0)
+#define x86_fstsw(inst) \
+ do { \
+ *(inst)++ = (unsigned char)0x9b; \
+ *(inst)++ = (unsigned char)0xdf; \
+ *(inst)++ = (unsigned char)0xe0; \
+ } while (0)
+
/**
* @x86_fist_membase
* Converts content of ST(0) to integer and stores it at memory location
@@ -1278,10 +1341,18 @@ typedef union {
x86_memindex_emit ((inst), 6, (basereg), (disp), (indexreg), (shift)); \
} while (0)
+#define x86_push_imm_template(inst) x86_push_imm (inst, 0xf0f0f0f0)
+
#define x86_push_imm(inst,imm) \
do { \
- *(inst)++ = (unsigned char)0x68; \
- x86_imm_emit32 ((inst), (imm)); \
+ int _imm = (int) (imm); \
+ if (x86_is_imm8 (_imm)) { \
+ *(inst)++ = (unsigned char)0x6A; \
+ x86_imm_emit8 ((inst), (_imm)); \
+ } else { \
+ *(inst)++ = (unsigned char)0x68; \
+ x86_imm_emit32 ((inst), (_imm)); \
+ } \
} while (0)
#define x86_pop_reg(inst,reg) \
@@ -1422,6 +1493,7 @@ typedef union {
#define x86_set_reg(inst,cond,reg,is_signed) \
do { \
+ g_assert (X86_IS_BYTE_REG (reg)); \
*(inst)++ = (unsigned char)0x0f; \
if ((is_signed)) \
*(inst)++ = x86_cc_signed_map [(cond)] + 0x20; \
diff --git a/mono/benchmark/Makefile.am b/mono/benchmark/Makefile.am
index 00b5f44c880..62354f9311e 100644
--- a/mono/benchmark/Makefile.am
+++ b/mono/benchmark/Makefile.am
@@ -1,4 +1,5 @@
-TEST_PROG=../jit/mono
+TEST_PROG=../mini/mono
+RUNTIME_ARGS="-O=all"
CSC=mcs
@@ -7,16 +8,41 @@ TESTSRC= \
fib.cs \
life.cs \
castclass.cs \
+ cmov1.cs \
+ cmov2.cs \
+ cmov3.cs \
+ cmov4.cs \
+ cmov5.cs \
+ commute.cs \
isinst.cs \
+ sbperf1.cs \
+ sbperf2.cs \
+ iconst-byte.cs \
inline1.cs \
inline2.cs \
inline3.cs \
+ inline4.cs \
+ inline5.cs \
+ inline6.cs \
+ inline-readonly.cs \
+ max-min.cs \
muldiv.cs \
loops.cs \
initlocals.cs \
logic.cs \
+ switch.cs \
+ ctor-bench.cs \
+ readonly.cs \
+ readonly-byte-array.cs \
+ readonly-inst.cs \
+ readonly-vt.cs \
+ regalloc.cs \
+ regalloc-2.cs \
bulkcpy.il \
- math.cs
+ math.cs \
+ boxtest.cs \
+ valuetype-hash-equals.cs \
+ vt2.cs
TESTSI_TMP=$(TESTSRC:.cs=.exe)
TESTSI=$(TESTSI_TMP:.il=.exe)
@@ -33,7 +59,7 @@ test: $(TEST_PROG) $(TESTSI)
@failed=0; \
passed=0; \
for i in $(TESTSI); do \
- if ./test-driver $(TEST_PROG) $$i; \
+ if ./test-driver $(TEST_PROG) $$i $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
diff --git a/mono/benchmark/boxtest.cs b/mono/benchmark/boxtest.cs
new file mode 100755
index 00000000000..04385f712d0
--- /dev/null
+++ b/mono/benchmark/boxtest.cs
@@ -0,0 +1,19 @@
+using System;
+
+
+public class Test {
+
+ public static int Main (string[] args) {
+ object x;
+
+ for (int i = 0 ; i < 5000000; i++) {
+ x = i;
+ }
+
+ int j = (int)x;
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/cmov1.cs b/mono/benchmark/cmov1.cs
new file mode 100644
index 00000000000..d0c0d007e77
--- /dev/null
+++ b/mono/benchmark/cmov1.cs
@@ -0,0 +1,29 @@
+using System;
+class T {
+ static void Main () {
+ int y = 0;
+ int z = 1;
+ for (int i = 0; i < 500000000; i ++) {
+ if (y == 0)
+ z = i;
+
+ if (y == 4)
+ y = i;
+
+ if (z == 0)
+ y = 1;
+
+ if (y == 1)
+ z = i;
+
+ if (y == 1)
+ y = i;
+
+ if (z == 2)
+ y = z;
+ else
+ y = i;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/mono/benchmark/cmov2.cs b/mono/benchmark/cmov2.cs
new file mode 100644
index 00000000000..b2d0706b87d
--- /dev/null
+++ b/mono/benchmark/cmov2.cs
@@ -0,0 +1,23 @@
+using System;
+class T {
+ static void Main () {
+ int a = 1, b = 2, c = 3, d = 4, e = 5;
+ for (int i = 0; i < 500000000; i ++) {
+ // on the stack
+ if (a == b)
+ a = i;
+ if (b == a)
+ b = i;
+ if (c == d)
+ c = i;
+ if (d == e)
+ d = i;
+ if (e == a)
+ e = i;
+ }
+
+ if ((a ^ b ^ c ^ d ^ e) == 12345)
+ return;
+ }
+
+} \ No newline at end of file
diff --git a/mono/benchmark/cmov3.cs b/mono/benchmark/cmov3.cs
new file mode 100644
index 00000000000..4cfc681b488
--- /dev/null
+++ b/mono/benchmark/cmov3.cs
@@ -0,0 +1,14 @@
+using System;
+class T {
+ // test x ? A : B where A and B are constants.
+ static void Main () {
+ int a = 0, b = 0, c = 0, d = 0, e = 0;
+ for (int i = 0; i < 50000000; i ++) {
+ a = b == 10 ? 1 : 1;
+ b = b > 1 ? 9 : 8;
+ c = b <= c ? 1 : 2;
+ d = d > 0 ? 1 : 0;
+ e = e == 0 ? -1 : 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/cmov4.cs b/mono/benchmark/cmov4.cs
new file mode 100644
index 00000000000..c00bc32b6c8
--- /dev/null
+++ b/mono/benchmark/cmov4.cs
@@ -0,0 +1,33 @@
+using System;
+class T {
+ // some more advanced versions.
+ static void Main () {
+ int a = 0, b = 0, c = 0, d = 0, e = 0;
+ for (int i = 0; i < 50000000; i ++) {
+ // sgn (x)
+ if (a == 0)
+ a = 0;
+ else if (a < 0)
+ a = -1;
+ else
+ a = 1;
+
+ // cond incr
+ if (a <= 0)
+ a ++;
+
+ // buffer ring
+ if (b == 49)
+ b = 0;
+ else
+ b ++;
+
+ // max
+ c = a > b ? a : b;
+
+ // abs
+ d = a > 0 ? a : -a;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/mono/benchmark/cmov5.cs b/mono/benchmark/cmov5.cs
new file mode 100644
index 00000000000..c3c6f088923
--- /dev/null
+++ b/mono/benchmark/cmov5.cs
@@ -0,0 +1,15 @@
+using System;
+class T {
+ static void Main () {
+ int a = 1, b = 2, c = 3, d = 4, e = 5;
+ for (int i = 0; i < 500000000; i ++) {
+ // on the stack
+ a = e == 1 ? b : c;
+ b = a == 1 ? c : d;
+ c = b == 1 ? d : e;
+ d = c == 1 ? e : a;
+ e = d == 1 ? a : b;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/mono/benchmark/commute.cs b/mono/benchmark/commute.cs
new file mode 100644
index 00000000000..00dff806c11
--- /dev/null
+++ b/mono/benchmark/commute.cs
@@ -0,0 +1,37 @@
+using System;
+
+class A {
+ static int Main ()
+ {
+ int a = 0;
+
+ for (int i = 0; i < 50000000; i++) {
+
+
+ a =
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7) +
+ (((((a + 1) - 2) + 3) - 4 + 5 - 6 + 7)))))))))))))))))));
+ }
+
+ // no ssa
+ return a != (a + 1) ? 0 : 1;
+ }
+
+ static void Foo (out int dummy) { dummy = 0; }
+} \ No newline at end of file
diff --git a/mono/benchmark/contextbound-perf.cs b/mono/benchmark/contextbound-perf.cs
new file mode 100644
index 00000000000..848ee52e574
--- /dev/null
+++ b/mono/benchmark/contextbound-perf.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections;
+using System.Runtime.Remoting;
+
+public class Bar : System.ContextBoundObject {
+}
+
+public class Driver {
+ public static void Main (string[] args) {
+ Bar b = new Bar();
+
+ for (int i = 0; i != 30000000; i++)
+ if (!b.Equals (b))
+ Console.WriteLine ("error!!");
+ }
+}
+
diff --git a/mono/benchmark/ctor-bench.cs b/mono/benchmark/ctor-bench.cs
new file mode 100644
index 00000000000..31099acdd55
--- /dev/null
+++ b/mono/benchmark/ctor-bench.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Reflection;
+
+class T {
+
+ public T () {
+ }
+
+ const int count = 1000000;
+
+ static void use_new () {
+ for (int i = 0; i < count; ++i)
+ new T ();
+ }
+
+ object Clone () {
+ return MemberwiseClone ();
+ }
+
+ static void use_clone () {
+ T t = new T ();
+ for (int i = 0; i < count; ++i)
+ t.Clone ();
+ }
+
+ static void use_activator () {
+ for (int i = 0; i < count; ++i)
+ Activator.CreateInstance (typeof (T));
+ }
+
+ static void use_ctor () {
+ ConstructorInfo ctor = typeof (T).GetConstructor (Type.EmptyTypes);
+ for (int i = 0; i < count; ++i)
+ ctor.Invoke (null);
+ }
+
+ static void Main () {
+ long start, end, new_val, perc;
+ start = Environment.TickCount;
+
+ start = Environment.TickCount;
+ use_new ();
+ end = Environment.TickCount;
+ Console.WriteLine ("new took {0}", end-start);
+ new_val = end-start;
+
+ start = Environment.TickCount;
+ use_clone ();
+ end = Environment.TickCount;
+ perc = ((end-start-new_val) * 100) / new_val;
+ Console.WriteLine ("clone took {0} {1} %", end-start, perc);
+
+ start = Environment.TickCount;
+ use_activator ();
+ end = Environment.TickCount;
+ perc = ((end-start-new_val) * 100) / new_val;
+ Console.WriteLine ("activator took {0} {1} %", end-start, perc);
+
+ start = Environment.TickCount;
+ use_ctor ();
+ end = Environment.TickCount;
+ perc = ((end-start-new_val) * 100) / new_val;
+ Console.WriteLine ("ctor took {0} {1} %", end-start, perc);
+
+ }
+}
+
diff --git a/mono/benchmark/iconst-byte.cs b/mono/benchmark/iconst-byte.cs
new file mode 100644
index 00000000000..05178ad80e8
--- /dev/null
+++ b/mono/benchmark/iconst-byte.cs
@@ -0,0 +1,41 @@
+using System;
+
+class A {
+ static int Main ()
+ {
+ // prevent ssa (for now)
+ int dummy;
+ Foo (out dummy);
+
+ for (int i = 0; i < 50000000; i++) {
+ byte b;
+
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ b = 0;
+ }
+
+ return 0;
+ }
+
+ static void Foo (out int dummy) { dummy = 0; }
+} \ No newline at end of file
diff --git a/mono/benchmark/incr.cs b/mono/benchmark/incr.cs
new file mode 100644
index 00000000000..696de5a7443
--- /dev/null
+++ b/mono/benchmark/incr.cs
@@ -0,0 +1,26 @@
+using System;
+class T {
+ static void Main () {
+ int i = Environment.TickCount;
+ new T ().X ();
+ Console.WriteLine (Environment.TickCount - i);
+ }
+
+ int [] window = new int [9];
+
+ void X () {
+ int scan = 0, match = 0;
+ for (int i = 0; i < 5000000; i ++) {
+ if (window[++scan] == window[++match] &&
+ window[++scan] == window[++match] &&
+ window[++scan] == window[++match] &&
+ window[++scan] == window[++match] &&
+ window[++scan] == window[++match] &&
+ window[++scan] == window[++match] &&
+ window[++scan] == window[++match] &&
+ window[++scan] == window[++match]) {
+ scan = match = 0;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/inline-readonly.cs b/mono/benchmark/inline-readonly.cs
new file mode 100644
index 00000000000..df610eed406
--- /dev/null
+++ b/mono/benchmark/inline-readonly.cs
@@ -0,0 +1,17 @@
+using System;
+
+public class A {
+
+ static readonly A a = new A ();
+
+ static int Main ()
+ {
+ for (int i = 0; i < 500000000; i++)
+ a.Dummy ();
+
+ return 0;
+ }
+
+ public virtual void Dummy () {
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/inline4.cs b/mono/benchmark/inline4.cs
new file mode 100755
index 00000000000..47cd0ee839c
--- /dev/null
+++ b/mono/benchmark/inline4.cs
@@ -0,0 +1,34 @@
+using System;
+
+public class Tests {
+
+ public static int test (int n) {
+ if ((n & 1) == 0)
+ return 2;
+ else
+ return 1;
+ }
+
+ public static int Main (string[] args) {
+ int repeat = 1;
+ int sum = 0;
+
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ for (int i = 0; i < repeat; i++)
+ for (int j = 0; j < 50000000; j++)
+ sum += test (j);
+
+
+ Console.WriteLine (sum);
+ if (sum != (75000000 * repeat))
+ return 1;
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/inline5.cs b/mono/benchmark/inline5.cs
new file mode 100755
index 00000000000..4e8e45b9bed
--- /dev/null
+++ b/mono/benchmark/inline5.cs
@@ -0,0 +1,27 @@
+using System;
+
+public class Test {
+
+ static int a = 0;
+
+ public static void test (int n) {
+ a+=n;
+ }
+
+ public static int Main (string[] args) {
+ int repeat = 1;
+
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ for (int i = 0; i < repeat; i++)
+ for (int j = 0; j < 500000000; j++)
+ test (a);
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/inline6.cs b/mono/benchmark/inline6.cs
new file mode 100755
index 00000000000..7874a53ea94
--- /dev/null
+++ b/mono/benchmark/inline6.cs
@@ -0,0 +1,29 @@
+using System;
+
+public class Test {
+
+ public static int test (int n) {
+ int x = n + 1;
+
+ return x;
+ }
+
+ public static int Main (string[] args) {
+ int repeat = 1;
+
+ /*
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+ */
+
+ for (int i = 0; i < repeat; i++)
+ for (int j = 0; j < 500000000; j++)
+ test (12345);
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/lock.cs b/mono/benchmark/lock.cs
new file mode 100644
index 00000000000..28e9bf1c41b
--- /dev/null
+++ b/mono/benchmark/lock.cs
@@ -0,0 +1,13 @@
+using System;
+class T {
+ static void Main () {
+ int i = Environment.TickCount;
+ new T ().X ();
+ Console.WriteLine (Environment.TickCount - i);
+ }
+
+ void X () {
+ for (int i = 0; i < 10000000; i ++)
+ lock (this) {}
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/logic.cs b/mono/benchmark/logic.cs
index f9cdecbf80f..db366072646 100755
--- a/mono/benchmark/logic.cs
+++ b/mono/benchmark/logic.cs
@@ -23,7 +23,7 @@
using System;
-public class Logic {
+public class Tests {
public static void logic_run ()
{
diff --git a/mono/benchmark/long-muldiv.cs b/mono/benchmark/long-muldiv.cs
new file mode 100644
index 00000000000..1cdb26c4f69
--- /dev/null
+++ b/mono/benchmark/long-muldiv.cs
@@ -0,0 +1,24 @@
+using System;
+class T {
+ static void Main () {
+ int i = Environment.TickCount;
+ new T ().X ();
+ Console.WriteLine (Environment.TickCount - i);
+ }
+
+ void X () {
+ long a = 1, b = 2, c = 3, d = 4;
+
+ for (int i = 0; i < 10000000; i ++) {
+ a /= (b + 1);
+ b /= (c + 1);
+ c /= (d + 1);
+ d /= (a + 1);
+
+ a *= (b + 2);
+ b *= (c + 2);
+ c *= (d + 2);
+ d *= (a + 2);
+ }
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/max-min.cs b/mono/benchmark/max-min.cs
new file mode 100644
index 00000000000..a2f946bc02d
--- /dev/null
+++ b/mono/benchmark/max-min.cs
@@ -0,0 +1,26 @@
+/*
+mono max-min.exe 0m1.468s
+mono -O=inline max-min.exe 0m1.087s
+../mini/mono max-min.exe 0m0.511s
+*/
+
+class T {
+
+ static int DoIt (int a, int b) {
+ int x = 0;
+ for (int j = 0; j < 200000; j++) {
+ x += System.Math.Max (a, b);
+ x += System.Math.Max (a, b);
+ x += System.Math.Max (j, b);
+ x += System.Math.Max (j, b);
+ x += System.Math.Min (System.Math.Max (j, x), b);
+ x += System.Math.Min (System.Math.Max (j, x), b);
+ }
+ return x;
+ }
+
+ static void Main () {
+ for (int i = 0; i < 50; i++)
+ DoIt (1, 5);
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/pinvoke.cs b/mono/benchmark/pinvoke.cs
new file mode 100755
index 00000000000..5ec3a6b6b9f
--- /dev/null
+++ b/mono/benchmark/pinvoke.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Runtime.InteropServices;
+
+public class Test {
+
+ public static int delegate_test (int a)
+ {
+ if (a == 2)
+ return 0;
+
+ return 1;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_empty_pinvoke")]
+ public static extern int mono_test_empty_pinvoke (int i);
+
+ public static int Main (String[] args) {
+ int repeat = 1;
+
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ for (int i = 0; i < (repeat * 5000); i++)
+ for (int j = 0; j < 10000; j++)
+ mono_test_empty_pinvoke (5);
+
+ return 0;
+ }
+}
diff --git a/mono/benchmark/readonly-byte-array.cs b/mono/benchmark/readonly-byte-array.cs
new file mode 100644
index 00000000000..6af67b37541
--- /dev/null
+++ b/mono/benchmark/readonly-byte-array.cs
@@ -0,0 +1,30 @@
+class Foo {
+ static readonly byte [] my_table = {
+ 0x00, 0x03, 0x06, 0x05, 0x0C, 0x0F, 0x0A, 0x09, 0x18, 0x1B, 0x1E, 0x1D, 0x14, 0x17, 0x12, 0x11,
+ 0x30, 0x33, 0x36, 0x35, 0x3C, 0x3F, 0x3A, 0x39, 0x28, 0x2B, 0x2E, 0x2D, 0x24, 0x27, 0x22, 0x21,
+ 0x60, 0x63, 0x66, 0x65, 0x6C, 0x6F, 0x6A, 0x69, 0x78, 0x7B, 0x7E, 0x7D, 0x74, 0x77, 0x72, 0x71,
+ 0x50, 0x53, 0x56, 0x55, 0x5C, 0x5F, 0x5A, 0x59, 0x48, 0x4B, 0x4E, 0x4D, 0x44, 0x47, 0x42, 0x41,
+ 0xC0, 0xC3, 0xC6, 0xC5, 0xCC, 0xCF, 0xCA, 0xC9, 0xD8, 0xDB, 0xDE, 0xDD, 0xD4, 0xD7, 0xD2, 0xD1,
+ 0xF0, 0xF3, 0xF6, 0xF5, 0xFC, 0xFF, 0xFA, 0xF9, 0xE8, 0xEB, 0xEE, 0xED, 0xE4, 0xE7, 0xE2, 0xE1,
+ 0xA0, 0xA3, 0xA6, 0xA5, 0xAC, 0xAF, 0xAA, 0xA9, 0xB8, 0xBB, 0xBE, 0xBD, 0xB4, 0xB7, 0xB2, 0xB1,
+ 0x90, 0x93, 0x96, 0x95, 0x9C, 0x9F, 0x9A, 0x99, 0x88, 0x8B, 0x8E, 0x8D, 0x84, 0x87, 0x82, 0x81,
+ 0x9B, 0x98, 0x9D, 0x9E, 0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8F, 0x8C, 0x89, 0x8A,
+ 0xAB, 0xA8, 0xAD, 0xAE, 0xA7, 0xA4, 0xA1, 0xA2, 0xB3, 0xB0, 0xB5, 0xB6, 0xBF, 0xBC, 0xB9, 0xBA,
+ 0xFB, 0xF8, 0xFD, 0xFE, 0xF7, 0xF4, 0xF1, 0xF2, 0xE3, 0xE0, 0xE5, 0xE6, 0xEF, 0xEC, 0xE9, 0xEA,
+ 0xCB, 0xC8, 0xCD, 0xCE, 0xC7, 0xC4, 0xC1, 0xC2, 0xD3, 0xD0, 0xD5, 0xD6, 0xDF, 0xDC, 0xD9, 0xDA,
+ 0x5B, 0x58, 0x5D, 0x5E, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46, 0x4F, 0x4C, 0x49, 0x4A,
+ 0x6B, 0x68, 0x6D, 0x6E, 0x67, 0x64, 0x61, 0x62, 0x73, 0x70, 0x75, 0x76, 0x7F, 0x7C, 0x79, 0x7A,
+ 0x3B, 0x38, 0x3D, 0x3E, 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2F, 0x2C, 0x29, 0x2A,
+ 0x0B, 0x08, 0x0D, 0x0E, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1F, 0x1C, 0x19, 0x1A
+ };
+
+ static void Main ()
+ {
+ byte b = 0;
+ byte foo = 0;
+ for (int i = 0; i < 100000000; i ++, b ++) {
+ foo ^= my_table [b];
+ foo ^= my_table [foo];
+ }
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/readonly-inst.cs b/mono/benchmark/readonly-inst.cs
new file mode 100644
index 00000000000..ec257d9fc34
--- /dev/null
+++ b/mono/benchmark/readonly-inst.cs
@@ -0,0 +1,23 @@
+using System;
+
+class A {
+ class B { public readonly C c = new C (); }
+ class C { public readonly D d = new D (); }
+ class D { public readonly E e = new E (); }
+ class E { public readonly int i = 1; }
+
+ static readonly A foo = new A ();
+ static readonly A bar = new A ();
+
+ readonly B b = new B ();
+ static int Main ()
+ {
+
+ for (int i = 0; i < 50000000; i++) {
+ if (foo.b.c.d.e.i != bar.b.c.d.e.i)
+ return 1;
+ }
+
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/readonly-vt.cs b/mono/benchmark/readonly-vt.cs
new file mode 100644
index 00000000000..127724bd80c
--- /dev/null
+++ b/mono/benchmark/readonly-vt.cs
@@ -0,0 +1,22 @@
+// Since the structs are readonly, the expression here is a jit time constant.
+
+using System;
+
+struct A {
+ struct B { int dummy; public C c; }
+ struct C { int dummy; public D d; }
+ struct D { public int i; }
+
+ static readonly B b, bb;
+
+ static int Main ()
+ {
+
+ for (int i = 0; i < 50000000; i++) {
+ if (b.c.d.i != bb.c.d.i)
+ return 1;
+ }
+
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/readonly.cs b/mono/benchmark/readonly.cs
new file mode 100755
index 00000000000..11ed40d7761
--- /dev/null
+++ b/mono/benchmark/readonly.cs
@@ -0,0 +1,27 @@
+using System;
+
+public class Test {
+
+ static readonly int a = 5;
+ static readonly int b = 6;
+
+ public static int Main (string[] args) {
+ int repeat = 1;
+
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ for (int i = 0; i < repeat*3; i++) {
+ for (int j = 0; j < 100000000; j++) {
+ if ((a != 5) || (b != 6))
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/regalloc-2.cs b/mono/benchmark/regalloc-2.cs
new file mode 100644
index 00000000000..69bb0c238f5
--- /dev/null
+++ b/mono/benchmark/regalloc-2.cs
@@ -0,0 +1,40 @@
+//
+// Idealy, we would fold the operations from a...h into one long xor chain,
+// we could then commute the xor operation.
+//
+// More realisticly, we should assign each of a...h to one reg, rather than making
+// the two swap between two registers:
+// (stind.i4 regvar[%edi] (xor (ldind.i4 regoffset[-0x18(%ebp)]) iconst[1]))
+// (stind.i4 regvar[%esi] (xor (ldind.i4 regvar[%edi]) iconst[2]))
+// (stind.i4 regvar[%edi] (xor (ldind.i4 regvar[%esi]) iconst[3]))
+// (stind.i4 regvar[%esi] (xor (ldind.i4 regvar[%edi]) iconst[4]))
+//
+
+class T {
+ static void Main ()
+ {
+ int j = 0, k = 0, l = 0;
+ for (int i = 0; i < 50000000; i ++) {
+ int a = i ^ 1;
+ int b = a ^ 2;
+ int c = b ^ 3;
+ int d = c ^ 4;
+ int e = d ^ 5;
+ int f = e ^ 6;
+ int g = f ^ 7;
+ int h = g ^ 8;
+
+ j ^= h;
+ k ^= h + 1;
+ l ^= h & 5;
+
+ j ^= l;
+ k ^= k + 1;
+ l ^= j & 5;
+
+ j ^= l;
+ k ^= k + 1;
+ l ^= j & 5;
+ }
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/regalloc-3.cs b/mono/benchmark/regalloc-3.cs
new file mode 100644
index 00000000000..643a9cf0c01
--- /dev/null
+++ b/mono/benchmark/regalloc-3.cs
@@ -0,0 +1,65 @@
+//
+// You need a deadce to get rid of the initlocals statements,
+// which make all of the variables overlap in their live ranges.
+//
+
+using System;
+class T {
+ static void Main () {
+ int i = Environment.TickCount;
+ new T ().X ();
+ Console.WriteLine (Environment.TickCount - i);
+ }
+
+ void X () {
+ int a = 0;
+ for (int x = 0; x < 1000; x ++) {
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ for (int i = 0; i < 10000; i ++) a ++;
+ }
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/regalloc.cs b/mono/benchmark/regalloc.cs
new file mode 100644
index 00000000000..d84753fa159
--- /dev/null
+++ b/mono/benchmark/regalloc.cs
@@ -0,0 +1,54 @@
+//
+// To do this test well, I think you need to move the int aX = 0...
+// lines down as far as possible. That way, the lifespan of the variables
+// is short, and they can go into registers.
+//
+
+class T {
+ static int Main ()
+ {
+ for (int r = 0; r < 50; r ++) {
+ int a0 = 0, b0 = 0, c0 = 0, d0 = 0;
+ int a1 = 0, b1 = 0, c1 = 0, d1 = 0;
+ int a2 = 0, b2 = 0, c2 = 0, d2 = 0;
+ int a3 = 0, b3 = 0, c3 = 0, d3 = 0;
+ int a4 = 0, b4 = 0, c4 = 0, d4 = 0;
+
+ int x = 0;
+
+ for (int i = 0; i < 400000; i ++) a0 ++;
+ for (int i = 0; i < 400000; i ++) b0 ++;
+ for (int i = 0; i < 400000; i ++) c0 ++;
+ for (int i = 0; i < 400000; i ++) d0 ++;
+ x ^= a0 ^ b0 ^ c0 ^ d0;
+
+ for (int i = 0; i < 400000; i ++) a1 ++;
+ for (int i = 0; i < 400000; i ++) b1 ++;
+ for (int i = 0; i < 400000; i ++) c1 ++;
+ for (int i = 0; i < 400000; i ++) d1 ++;
+ x ^= a1 ^ b1 ^ c1 ^ d1;
+
+ for (int i = 0; i < 400000; i ++) a2 ++;
+ for (int i = 0; i < 400000; i ++) b2 ++;
+ for (int i = 0; i < 400000; i ++) c2 ++;
+ for (int i = 0; i < 400000; i ++) d2 ++;
+ x ^= a2 ^ b2 ^ c2 ^ d2;
+
+ for (int i = 0; i < 400000; i ++) a3 ++;
+ for (int i = 0; i < 400000; i ++) b3 ++;
+ for (int i = 0; i < 400000; i ++) c3 ++;
+ for (int i = 0; i < 400000; i ++) d3 ++;
+ x ^= a3 ^ b3 ^ c3 ^ d3;
+
+ for (int i = 0; i < 400000; i ++) a4 ++;
+ for (int i = 0; i < 400000; i ++) b4 ++;
+ for (int i = 0; i < 400000; i ++) c4 ++;
+ for (int i = 0; i < 400000; i ++) d4 ++;
+ x ^= a4 ^ b4 ^ c4 ^ d4;
+
+ if (x != 0)
+ return 1;
+ }
+ return 0;
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/regvar.cs b/mono/benchmark/regvar.cs
new file mode 100644
index 00000000000..4f5e0a3559b
--- /dev/null
+++ b/mono/benchmark/regvar.cs
@@ -0,0 +1,43 @@
+//
+// We get stuff like:
+// 48: 8b c3 mov eax,ebx
+// 4a: 8b cf mov ecx,edi
+// 4c: 0b c1 or eax,ecx
+// 4e: 8b d8 mov ebx,eax
+//
+
+using System;
+class T {
+ static void Main () {
+ int i = Environment.TickCount;
+ new T ().X ();
+ Console.WriteLine (Environment.TickCount - i);
+ }
+
+ void X () {
+ int a = 0, b = 0, c = 0, d = 0;
+ for (int i = 0; i < 50000000; i ++) {
+
+
+ a |= b;
+ b |= c;
+ c |= d;
+ b |= d;
+
+ a ^= b;
+ b ^= c;
+ c ^= d;
+ b ^= d;
+
+ a &= b;
+ b &= c;
+ c &= d;
+ b &= d;
+
+ a += b;
+ b += c;
+ c += d;
+ b += d;
+ }
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/sbperf1.cs b/mono/benchmark/sbperf1.cs
new file mode 100644
index 00000000000..f5f13747c74
--- /dev/null
+++ b/mono/benchmark/sbperf1.cs
@@ -0,0 +1,17 @@
+using System.Text;
+
+namespace test {
+ public class Test {
+ public static int Main() {
+ for (int i = 0; i < 500000; i++) {
+ StringBuilder sb = new StringBuilder ();
+ sb.Append ("hello");
+ sb.Append (" world!");
+ sb.ToString ();
+ }
+
+ return 0;
+
+ }
+ }
+}
diff --git a/mono/benchmark/sbperf2.cs b/mono/benchmark/sbperf2.cs
new file mode 100644
index 00000000000..8d7379e4ea9
--- /dev/null
+++ b/mono/benchmark/sbperf2.cs
@@ -0,0 +1,19 @@
+using System.Text;
+
+namespace test {
+ public class Test {
+ public static int Main() {
+ StringBuilder sb = new StringBuilder ();
+ for (int i = 0; i < 1000000; i++) {
+ sb.Append ("hello");
+ sb.Append (" world!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+ string str = sb.ToString ();
+ int len = str.Length;
+ sb.Length = 0;
+ }
+
+ return 0;
+
+ }
+ }
+}
diff --git a/mono/benchmark/static-fields.cs b/mono/benchmark/static-fields.cs
new file mode 100755
index 00000000000..9ac89df333a
--- /dev/null
+++ b/mono/benchmark/static-fields.cs
@@ -0,0 +1,25 @@
+using System;
+
+public class Tests {
+
+ public static int si = 0;
+
+ public static int Main (string[] args) {
+ int h = 0, repeat = 1;
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ for (int i = 0; i < (repeat * 50); i++) {
+ for (int j = 0; j < 10000000; j++) {
+ h += si;
+ }
+ }
+
+ if (h != 0)
+ return 1;
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/stelemref.cs b/mono/benchmark/stelemref.cs
new file mode 100644
index 00000000000..7020f5a9eb8
--- /dev/null
+++ b/mono/benchmark/stelemref.cs
@@ -0,0 +1,15 @@
+using System;
+class T {
+ static void Main () {
+ int i = Environment.TickCount;
+ new T ().X ();
+ Console.WriteLine (Environment.TickCount - i);
+ }
+
+ void X () {
+ object [] x = new object [1];
+ object o = new object ();
+ for (int i = 0; i < 10000000; i ++)
+ x [0] = o;
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/string1.cs b/mono/benchmark/string1.cs
new file mode 100755
index 00000000000..a185d5ffe95
--- /dev/null
+++ b/mono/benchmark/string1.cs
@@ -0,0 +1,30 @@
+using System;
+
+public class Tests {
+
+ public static int Main (string[] args) {
+ int res, repeat = 1;
+ string ts1 = "abcdefghijklmnopqrstuvwxyz";
+
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ int len = ts1.Length;
+
+ for (int i = 0; i < (repeat * 50); i++) {
+ for (int j = 0; j < 100000; j++) {
+ int k, h = 0;
+
+ for (k = 0; k < len; ++k)
+ h += ts1 [k];
+
+ }
+ }
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/switch.cs b/mono/benchmark/switch.cs
new file mode 100755
index 00000000000..da3cb9d1f47
--- /dev/null
+++ b/mono/benchmark/switch.cs
@@ -0,0 +1,26 @@
+public class Tests {
+
+ public static int Main () {
+ int n = 2;
+ int b = 0;
+
+ for (int i = 0; i < 1000000000; i++) {
+ switch (n) {
+ case 0: b = 2; break;
+ case 1: b = 3; break;
+ case 2: b = 4; break;
+ case -1: b = 5; break;
+ default:
+ b = 6;
+ break;
+ }
+ }
+
+ if (b != 4)
+ return 1;
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/benchmark/test-driver b/mono/benchmark/test-driver
index b62810db1d9..4f5ed6777e2 100755
--- a/mono/benchmark/test-driver
+++ b/mono/benchmark/test-driver
@@ -13,7 +13,7 @@ print "Testing $test... ";
for ($c = 20 - length ($test); $c > 0; $c--) { print " "; }
-my $res = system("/usr/bin/time -o .res -f '%U' $interpreter $test 2>/dev/null 1>$stdout");
+my $res = system("/usr/bin/time -o .res -f '%U' $interpreter @ARGV $test 2>/dev/null 1>$stdout");
if ($res) {
printf ("failed $? (%d) signal (%d).\n", $? >> 8, $? & 127);
diff --git a/mono/benchmark/valuetype-hash-equals.cs b/mono/benchmark/valuetype-hash-equals.cs
new file mode 100644
index 00000000000..2aa1a4ba324
--- /dev/null
+++ b/mono/benchmark/valuetype-hash-equals.cs
@@ -0,0 +1,75 @@
+using System;
+
+public class ValueType1
+{
+ static int Main ()
+ {
+ Blah a = new Blah ("abc", 1);
+ Blah b = new Blah ("ab" + 'c', 1);
+ long start, end;
+ start = Environment.TickCount;
+
+ start = Environment.TickCount;
+ for (int i = 0; i < 1000000; i++)
+ a.GetHashCode ();
+ end = Environment.TickCount;
+ Console.WriteLine ("struct common GetHashCode(): {0}", end-start);
+
+ start = Environment.TickCount;
+ for (int i = 0; i < 1000000; i++)
+ a.Equals (b);
+ end = Environment.TickCount;
+ Console.WriteLine ("struct common Equals(): {0}", end-start);
+
+ Blah2 a2 = new Blah2 ("abc", 1);
+ Blah2 b2 = new Blah2 ("abc", 1);
+ start = Environment.TickCount;
+ for (int i = 0; i < 1000000; i++)
+ a2.GetHashCode ();
+ end = Environment.TickCount;
+ Console.WriteLine ("struct specific GetHashCode(): {0}", end-start);
+
+ start = Environment.TickCount;
+ for (int i = 0; i < 1000000; i++)
+ a2.Equals (b2);
+ end = Environment.TickCount;
+ Console.WriteLine ("struct specific Equals(): {0}", end-start);
+
+ return 0;
+ }
+
+ struct Blah
+ {
+ public string s;
+ public int i;
+
+ public Blah (string s, int k)
+ {
+ this.s = s;
+ i = k;
+ }
+ }
+
+ struct Blah2
+ {
+ public string s;
+ public int i;
+
+ public Blah2 (string s, int k)
+ {
+ this.s = s;
+ i = k;
+ }
+
+ public override int GetHashCode () {
+ return i ^ s.GetHashCode ();
+ }
+ public override bool Equals (object obj) {
+ if (obj == null || !(obj is Blah2))
+ return false;
+ Blah2 b = (Blah2)obj;
+ return b.s == this.s && b.i == this.i;
+ }
+ }
+}
+
diff --git a/mono/benchmark/vt2.cs b/mono/benchmark/vt2.cs
new file mode 100644
index 00000000000..295e7249e27
--- /dev/null
+++ b/mono/benchmark/vt2.cs
@@ -0,0 +1,26 @@
+using System;
+
+public struct A {
+ public int a;
+ static int Main ()
+ {
+ A a = new A ();
+ A b = new A ();
+
+ for (int i = 0; i < 50000000; i++) {
+ a.a = i;
+ b.a = i + 5;
+
+ a.a = Foo (a, b);
+ b.a = a.a + 8;
+
+ Foo (a, b);
+ }
+
+ return 0;
+ }
+
+ static int Foo (A a, A b) {
+ return a.a + b.a;
+ }
+} \ No newline at end of file
diff --git a/mono/benchmark/vtype1.cs b/mono/benchmark/vtype1.cs
new file mode 100644
index 00000000000..a6176c0ad58
--- /dev/null
+++ b/mono/benchmark/vtype1.cs
@@ -0,0 +1,26 @@
+using System;
+
+public struct TestResult
+{
+ public TestResult(int x) {
+ a=x;
+ }
+
+ public int a;
+}
+
+public class Test
+{
+ static int Main ()
+ {
+ TestResult x;
+
+ for (int i = 0; i < 500000000; i++) {
+ //x = new TestResult(i, 0m);
+ x = new TestResult(i);
+ }
+
+ return 0;
+ }
+
+}
diff --git a/mono/cil/ChangeLog b/mono/cil/ChangeLog
index 8d7c0a09b8f..1515b38de2f 100644
--- a/mono/cil/ChangeLog
+++ b/mono/cil/ChangeLog
@@ -1,3 +1,45 @@
+2004-08-05 Duncan Mak <duncan@ximian.com>
+
+ * cil-opcodes.xml:
+ * opcode.def: Rename "stelem" to "stelem.any"
+ and "ldelem" to "ldelem.any".
+
+2004-08-02 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (opcode.def): Make $(srcdir)!=$(builddir) safe.
+ * make-opcodes-def.pl (OUTPUT): Use $ARGV[1].
+ (parsefile): Parse $ARGV[0].
+
+2004-07-30 Duncan Mak <duncan@ximian.com>
+
+ * cil-opcodes.xml: Added OpCodeType information to each of the
+ public opcodes with the new "type" attribute. Removed mono_func_*
+ from the opcodes and updated the "o2" attribute for the mono_*
+ opcodes to match the values in the existing opcode.def. Added
+ "mono_save_lmf" and mono_restore_lmf", which were listed in
+ opcode.def, but not in the XML file.
+
+2004-07-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * opcode.def: Remove CEE_MONO_FUNC and related opcodes, replace them
+ with CEE_MONO_ICALL.
+
+2004-05-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * opcode.def: Add mono_save_lmf and mono_restore_lmf.
+
+2004-05-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * opcode.def: Add mono_func2.
+
+2004-03-04 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * opcode.def, cil-opcodes.xml: Added two new opcodes for type checking:
+ mono_cisinst and mono_ccastclass.
+
+Thu May 29 12:52:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * opcode.def, cil-opcodes.xml: fix opcode entries.
Wed Sep 5 15:54:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
diff --git a/mono/cil/Makefile.am b/mono/cil/Makefile.am
index 12141fc56fb..5e3f1554c2c 100644
--- a/mono/cil/Makefile.am
+++ b/mono/cil/Makefile.am
@@ -1,6 +1,6 @@
-
opcode.def: make-opcodes-def.pl cil-opcodes.xml
- perl make-opcodes-def.pl < $(srcdir)/cil-opcodes.xml > opcode.def
+ perl $(srcdir)/make-opcodes-def.pl $(srcdir)/cil-opcodes.xml $@.tmp
+ mv $@.tmp $@
defdir = $(includedir)/mono/cil
def_DATA = opcode.def
diff --git a/mono/cil/cil-opcodes.xml b/mono/cil/cil-opcodes.xml
index dfd5fb106cb..3291174f813 100644
--- a/mono/cil/cil-opcodes.xml
+++ b/mono/cil/cil-opcodes.xml
@@ -1,297 +1,306 @@
-<opdesc>
-<opcode name="nop" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x00" flow="next"/>
-<opcode name="break" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x01" flow="break"/>
-<opcode name="ldarg.0" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x02" flow="next"/>
-<opcode name="ldarg.1" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x03" flow="next"/>
-<opcode name="ldarg.2" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x04" flow="next"/>
-<opcode name="ldarg.3" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x05" flow="next"/>
-<opcode name="ldloc.0" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x06" flow="next"/>
-<opcode name="ldloc.1" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x07" flow="next"/>
-<opcode name="ldloc.2" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x08" flow="next"/>
-<opcode name="ldloc.3" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x09" flow="next"/>
-<opcode name="stloc.0" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0A" flow="next"/>
-<opcode name="stloc.1" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0B" flow="next"/>
-<opcode name="stloc.2" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0C" flow="next"/>
-<opcode name="stloc.3" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0D" flow="next"/>
-<opcode name="ldarg.s" input="Pop0" output="Push1" args="ShortInlineVar" o1="0xFF" o2="0x0E" flow="next"/>
-<opcode name="ldarga.s" input="Pop0" output="PushI" args="ShortInlineVar" o1="0xFF" o2="0x0F" flow="next"/>
-<opcode name="starg.s" input="Pop1" output="Push0" args="ShortInlineVar" o1="0xFF" o2="0x10" flow="next"/>
-<opcode name="ldloc.s" input="Pop0" output="Push1" args="ShortInlineVar" o1="0xFF" o2="0x11" flow="next"/>
-<opcode name="ldloca.s" input="Pop0" output="PushI" args="ShortInlineVar" o1="0xFF" o2="0x12" flow="next"/>
-<opcode name="stloc.s" input="Pop1" output="Push0" args="ShortInlineVar" o1="0xFF" o2="0x13" flow="next"/>
-<opcode name="ldnull" input="Pop0" output="PushRef" args="InlineNone" o1="0xFF" o2="0x14" flow="next"/>
-<opcode name="ldc.i4.m1" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x15" flow="next"/>
-<opcode name="ldc.i4.0" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x16" flow="next"/>
-<opcode name="ldc.i4.1" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x17" flow="next"/>
-<opcode name="ldc.i4.2" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x18" flow="next"/>
-<opcode name="ldc.i4.3" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x19" flow="next"/>
-<opcode name="ldc.i4.4" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1A" flow="next"/>
-<opcode name="ldc.i4.5" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1B" flow="next"/>
-<opcode name="ldc.i4.6" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1C" flow="next"/>
-<opcode name="ldc.i4.7" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1D" flow="next"/>
-<opcode name="ldc.i4.8" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1E" flow="next"/>
-<opcode name="ldc.i4.s" input="Pop0" output="PushI" args="ShortInlineI" o1="0xFF" o2="0x1F" flow="next"/>
-<opcode name="ldc.i4" input="Pop0" output="PushI" args="InlineI" o1="0xFF" o2="0x20" flow="next"/>
-<opcode name="ldc.i8" input="Pop0" output="PushI8" args="InlineI8" o1="0xFF" o2="0x21" flow="next"/>
-<opcode name="ldc.r4" input="Pop0" output="PushR4" args="ShortInlineR" o1="0xFF" o2="0x22" flow="next"/>
-<opcode name="ldc.r8" input="Pop0" output="PushR8" args="InlineR" o1="0xFF" o2="0x23" flow="next"/>
-<opcode name="unused99" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x24" flow="next"/>
-<opcode name="dup" input="Pop1" output="Push1+Push1" args="InlineNone" o1="0xFF" o2="0x25" flow="next"/>
-<opcode name="pop" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x26" flow="next"/>
-<opcode name="jmp" input="Pop0" output="Push0" args="InlineMethod" o1="0xFF" o2="0x27" flow="call"/>
-<opcode name="call" input="VarPop" output="VarPush" args="InlineMethod" o1="0xFF" o2="0x28" flow="call"/>
-<opcode name="calli" input="VarPop" output="VarPush" args="InlineSig" o1="0xFF" o2="0x29" flow="call"/>
-<opcode name="ret" input="VarPop" output="Push0" args="InlineNone" o1="0xFF" o2="0x2A" flow="return"/>
-<opcode name="br.s" input="Pop0" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2B" flow="branch"/>
-<opcode name="brfalse.s" input="PopI" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2C" flow="cond-branch"/>
-<opcode name="brtrue.s" input="PopI" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2D" flow="cond-branch"/>
-<opcode name="beq.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2E" flow="cond-branch"/>
-<opcode name="bge.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2F" flow="cond-branch"/>
-<opcode name="bgt.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x30" flow="cond-branch"/>
-<opcode name="ble.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x31" flow="cond-branch"/>
-<opcode name="blt.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x32" flow="cond-branch"/>
-<opcode name="bne.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x33" flow="cond-branch"/>
-<opcode name="bge.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x34" flow="cond-branch"/>
-<opcode name="bgt.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x35" flow="cond-branch"/>
-<opcode name="ble.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x36" flow="cond-branch"/>
-<opcode name="blt.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x37" flow="cond-branch"/>
-<opcode name="br" input="Pop0" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x38" flow="branch"/>
-<opcode name="brfalse" input="PopI" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x39" flow="cond-branch"/>
-<opcode name="brtrue" input="PopI" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3A" flow="cond-branch"/>
-<opcode name="beq" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3B" flow="cond-branch"/>
-<opcode name="bge" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3C" flow="cond-branch"/>
-<opcode name="bgt" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3D" flow="cond-branch"/>
-<opcode name="ble" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3E" flow="cond-branch"/>
-<opcode name="blt" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3F" flow="cond-branch"/>
-<opcode name="bne.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x40" flow="cond-branch"/>
-<opcode name="bge.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x41" flow="cond-branch"/>
-<opcode name="bgt.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x42" flow="cond-branch"/>
-<opcode name="ble.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x43" flow="cond-branch"/>
-<opcode name="blt.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x44" flow="cond-branch"/>
-<opcode name="switch" input="PopI" output="Push0" args="InlineSwitch" o1="0xFF" o2="0x45" flow="cond-branch"/>
-<opcode name="ldind.i1" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x46" flow="next"/>
-<opcode name="ldind.u1" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x47" flow="next"/>
-<opcode name="ldind.i2" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x48" flow="next"/>
-<opcode name="ldind.u2" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x49" flow="next"/>
-<opcode name="ldind.i4" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x4A" flow="next"/>
-<opcode name="ldind.u4" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x4B" flow="next"/>
-<opcode name="ldind.i8" input="PopI" output="PushI8" args="InlineNone" o1="0xFF" o2="0x4C" flow="next"/>
-<opcode name="ldind.i" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x4D" flow="next"/>
-<opcode name="ldind.r4" input="PopI" output="PushR4" args="InlineNone" o1="0xFF" o2="0x4E" flow="next"/>
-<opcode name="ldind.r8" input="PopI" output="PushR8" args="InlineNone" o1="0xFF" o2="0x4F" flow="next"/>
-<opcode name="ldind.ref" input="PopI" output="PushRef" args="InlineNone" o1="0xFF" o2="0x50" flow="next"/>
-<opcode name="stind.ref" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x51" flow="next"/>
-<opcode name="stind.i1" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x52" flow="next"/>
-<opcode name="stind.i2" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x53" flow="next"/>
-<opcode name="stind.i4" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x54" flow="next"/>
-<opcode name="stind.i8" input="PopI+PopI8" output="Push0" args="InlineNone" o1="0xFF" o2="0x55" flow="next"/>
-<opcode name="stind.r4" input="PopI+PopR4" output="Push0" args="InlineNone" o1="0xFF" o2="0x56" flow="next"/>
-<opcode name="stind.r8" input="PopI+PopR8" output="Push0" args="InlineNone" o1="0xFF" o2="0x57" flow="next"/>
-<opcode name="add" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x58" flow="next"/>
-<opcode name="sub" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x59" flow="next"/>
-<opcode name="mul" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5A" flow="next"/>
-<opcode name="div" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5B" flow="next"/>
-<opcode name="div.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5C" flow="next"/>
-<opcode name="rem" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5D" flow="next"/>
-<opcode name="rem.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5E" flow="next"/>
-<opcode name="and" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5F" flow="next"/>
-<opcode name="or" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x60" flow="next"/>
-<opcode name="xor" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x61" flow="next"/>
-<opcode name="shl" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x62" flow="next"/>
-<opcode name="shr" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x63" flow="next"/>
-<opcode name="shr.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x64" flow="next"/>
-<opcode name="neg" input="Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x65" flow="next"/>
-<opcode name="not" input="Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x66" flow="next"/>
-<opcode name="conv.i1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x67" flow="next"/>
-<opcode name="conv.i2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x68" flow="next"/>
-<opcode name="conv.i4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x69" flow="next"/>
-<opcode name="conv.i8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x6A" flow="next"/>
-<opcode name="conv.r4" input="Pop1" output="PushR4" args="InlineNone" o1="0xFF" o2="0x6B" flow="next"/>
-<opcode name="conv.r8" input="Pop1" output="PushR8" args="InlineNone" o1="0xFF" o2="0x6C" flow="next"/>
-<opcode name="conv.u4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x6D" flow="next"/>
-<opcode name="conv.u8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x6E" flow="next"/>
-<opcode name="callvirt" input="VarPop" output="VarPush" args="InlineMethod" o1="0xFF" o2="0x6F" flow="call"/>
-<opcode name="cpobj" input="PopI+PopI" output="Push0" args="InlineType" o1="0xFF" o2="0x70" flow="next"/>
-<opcode name="ldobj" input="PopI" output="Push1" args="InlineType" o1="0xFF" o2="0x71" flow="next"/>
-<opcode name="ldstr" input="Pop0" output="PushRef" args="InlineString" o1="0xFF" o2="0x72" flow="next"/>
-<opcode name="newobj" input="VarPop" output="PushRef" args="InlineMethod" o1="0xFF" o2="0x73" flow="call"/>
-<opcode name="castclass" input="PopRef" output="PushRef" args="InlineType" o1="0xFF" o2="0x74" flow="next"/>
-<opcode name="isinst" input="PopRef" output="PushI" args="InlineType" o1="0xFF" o2="0x75" flow="next"/>
-<opcode name="conv.r.un" input="Pop1" output="PushR8" args="InlineNone" o1="0xFF" o2="0x76" flow="next"/>
-<opcode name="unused58" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x77" flow="next"/>
-<opcode name="unused1" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x78" flow="next"/>
-<opcode name="unbox" input="PopRef" output="PushI" args="InlineType" o1="0xFF" o2="0x79" flow="next"/>
-<opcode name="throw" input="PopRef" output="Push0" args="InlineNone" o1="0xFF" o2="0x7A" flow="throw"/>
-<opcode name="ldfld" input="PopRef" output="Push1" args="InlineField" o1="0xFF" o2="0x7B" flow="next"/>
-<opcode name="ldflda" input="PopRef" output="PushI" args="InlineField" o1="0xFF" o2="0x7C" flow="next"/>
-<opcode name="stfld" input="PopRef+Pop1" output="Push0" args="InlineField" o1="0xFF" o2="0x7D" flow="next"/>
-<opcode name="ldsfld" input="Pop0" output="Push1" args="InlineField" o1="0xFF" o2="0x7E" flow="next"/>
-<opcode name="ldsflda" input="Pop0" output="PushI" args="InlineField" o1="0xFF" o2="0x7F" flow="next"/>
-<opcode name="stsfld" input="Pop1" output="Push0" args="InlineField" o1="0xFF" o2="0x80" flow="next"/>
-<opcode name="stobj" input="PopI+Pop1" output="Push0" args="InlineType" o1="0xFF" o2="0x81" flow="next"/>
-<opcode name="conv.ovf.i1.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x82" flow="next"/>
-<opcode name="conv.ovf.i2.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x83" flow="next"/>
-<opcode name="conv.ovf.i4.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x84" flow="next"/>
-<opcode name="conv.ovf.i8.un" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x85" flow="next"/>
-<opcode name="conv.ovf.u1.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x86" flow="next"/>
-<opcode name="conv.ovf.u2.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x87" flow="next"/>
-<opcode name="conv.ovf.u4.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x88" flow="next"/>
-<opcode name="conv.ovf.u8.un" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x89" flow="next"/>
-<opcode name="conv.ovf.i.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x8A" flow="next"/>
-<opcode name="conv.ovf.u.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x8B" flow="next"/>
-<opcode name="box" input="Pop1" output="PushRef" args="InlineType" o1="0xFF" o2="0x8C" flow="next"/>
-<opcode name="newarr" input="PopI" output="PushRef" args="InlineType" o1="0xFF" o2="0x8D" flow="next"/>
-<opcode name="ldlen" input="PopRef" output="PushI" args="InlineNone" o1="0xFF" o2="0x8E" flow="next"/>
-<opcode name="ldelema" input="PopRef+PopI" output="PushI" args="InlineType" o1="0xFF" o2="0x8F" flow="next"/>
-<opcode name="ldelem.i1" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x90" flow="next"/>
-<opcode name="ldelem.u1" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x91" flow="next"/>
-<opcode name="ldelem.i2" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x92" flow="next"/>
-<opcode name="ldelem.u2" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x93" flow="next"/>
-<opcode name="ldelem.i4" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x94" flow="next"/>
-<opcode name="ldelem.u4" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x95" flow="next"/>
-<opcode name="ldelem.i8" input="PopRef+PopI" output="PushI8" args="InlineNone" o1="0xFF" o2="0x96" flow="next"/>
-<opcode name="ldelem.i" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x97" flow="next"/>
-<opcode name="ldelem.r4" input="PopRef+PopI" output="PushR4" args="InlineNone" o1="0xFF" o2="0x98" flow="next"/>
-<opcode name="ldelem.r8" input="PopRef+PopI" output="PushR8" args="InlineNone" o1="0xFF" o2="0x99" flow="next"/>
-<opcode name="ldelem.ref" input="PopRef+PopI" output="PushRef" args="InlineNone" o1="0xFF" o2="0x9A" flow="next"/>
-<opcode name="stelem.i" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9B" flow="next"/>
-<opcode name="stelem.i1" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9C" flow="next"/>
-<opcode name="stelem.i2" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9D" flow="next"/>
-<opcode name="stelem.i4" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9E" flow="next"/>
-<opcode name="stelem.i8" input="PopRef+PopI+PopI8" output="Push0" args="InlineNone" o1="0xFF" o2="0x9F" flow="next"/>
-<opcode name="stelem.r4" input="PopRef+PopI+PopR4" output="Push0" args="InlineNone" o1="0xFF" o2="0xA0" flow="next"/>
-<opcode name="stelem.r8" input="PopRef+PopI+PopR8" output="Push0" args="InlineNone" o1="0xFF" o2="0xA1" flow="next"/>
-<opcode name="stelem.ref" input="PopRef+PopI+PopRef" output="Push0" args="InlineNone" o1="0xFF" o2="0xA2" flow="next"/>
-<opcode name="unused2" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA3" flow="next"/>
-<opcode name="unused3" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA4" flow="next"/>
-<opcode name="unused4" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA5" flow="next"/>
-<opcode name="unused5" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA6" flow="next"/>
-<opcode name="unused6" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA7" flow="next"/>
-<opcode name="unused7" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA8" flow="next"/>
-<opcode name="unused8" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA9" flow="next"/>
-<opcode name="unused9" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAA" flow="next"/>
-<opcode name="unused10" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAB" flow="next"/>
-<opcode name="unused11" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAC" flow="next"/>
-<opcode name="unused12" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAD" flow="next"/>
-<opcode name="unused13" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAE" flow="next"/>
-<opcode name="unused14" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAF" flow="next"/>
-<opcode name="unused15" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xB0" flow="next"/>
-<opcode name="unused16" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xB1" flow="next"/>
-<opcode name="unused17" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xB2" flow="next"/>
-<opcode name="conv.ovf.i1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB3" flow="next"/>
-<opcode name="conv.ovf.u1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB4" flow="next"/>
-<opcode name="conv.ovf.i2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB5" flow="next"/>
-<opcode name="conv.ovf.u2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB6" flow="next"/>
-<opcode name="conv.ovf.i4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB7" flow="next"/>
-<opcode name="conv.ovf.u4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB8" flow="next"/>
-<opcode name="conv.ovf.i8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0xB9" flow="next"/>
-<opcode name="conv.ovf.u8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0xBA" flow="next"/>
-<opcode name="unused50" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBB" flow="next"/>
-<opcode name="unused18" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBC" flow="next"/>
-<opcode name="unused19" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBD" flow="next"/>
-<opcode name="unused20" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBE" flow="next"/>
-<opcode name="unused21" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBF" flow="next"/>
-<opcode name="unused22" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC0" flow="next"/>
-<opcode name="unused23" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC1" flow="next"/>
-<opcode name="refanyval" input="Pop1" output="PushI" args="InlineType" o1="0xFF" o2="0xC2" flow="next"/>
-<opcode name="ckfinite" input="Pop1" output="PushR8" args="InlineNone" o1="0xFF" o2="0xC3" flow="next"/>
-<opcode name="unused24" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC4" flow="next"/>
-<opcode name="unused25" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC5" flow="next"/>
-<opcode name="mkrefany" input="PopI" output="Push1" args="InlineType" o1="0xFF" o2="0xC6" flow="next"/>
-<opcode name="unused59" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC7" flow="next"/>
-<opcode name="unused60" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC8" flow="next"/>
-<opcode name="unused61" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC9" flow="next"/>
-<opcode name="unused62" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCA" flow="next"/>
-<opcode name="unused63" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCB" flow="next"/>
-<opcode name="unused64" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCC" flow="next"/>
-<opcode name="unused65" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCD" flow="next"/>
-<opcode name="unused66" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCE" flow="next"/>
-<opcode name="unused67" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCF" flow="next"/>
-<opcode name="ldtoken" input="Pop0" output="PushI" args="InlineTok" o1="0xFF" o2="0xD0" flow="next"/>
-<opcode name="conv.u2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD1" flow="next"/>
-<opcode name="conv.u1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD2" flow="next"/>
-<opcode name="conv.i" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD3" flow="next"/>
-<opcode name="conv.ovf.i" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD4" flow="next"/>
-<opcode name="conv.ovf.u" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD5" flow="next"/>
-<opcode name="add.ovf" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD6" flow="next"/>
-<opcode name="add.ovf.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD7" flow="next"/>
-<opcode name="mul.ovf" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD8" flow="next"/>
-<opcode name="mul.ovf.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD9" flow="next"/>
-<opcode name="sub.ovf" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xDA" flow="next"/>
-<opcode name="sub.ovf.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xDB" flow="next"/>
-<opcode name="endfinally" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xDC" flow="return"/>
-<opcode name="leave" input="Pop0" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0xDD" flow="branch"/>
-<opcode name="leave.s" input="Pop0" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0xDE" flow="branch"/>
-<opcode name="stind.i" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0xDF" flow="next"/>
-<opcode name="conv.u" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xE0" flow="next"/>
-<opcode name="unused26" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE1" flow="next"/>
-<opcode name="unused27" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE2" flow="next"/>
-<opcode name="unused28" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE3" flow="next"/>
-<opcode name="unused29" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE4" flow="next"/>
-<opcode name="unused30" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE5" flow="next"/>
-<opcode name="unused31" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE6" flow="next"/>
-<opcode name="unused32" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE7" flow="next"/>
-<opcode name="unused33" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE8" flow="next"/>
-<opcode name="unused34" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE9" flow="next"/>
-<opcode name="unused35" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEA" flow="next"/>
-<opcode name="unused36" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEB" flow="next"/>
-<opcode name="unused37" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEC" flow="next"/>
-<opcode name="unused38" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xED" flow="next"/>
-<opcode name="unused39" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEE" flow="next"/>
-<opcode name="unused40" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEF" flow="next"/>
-<opcode name="unused41" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF0" flow="next"/>
-<opcode name="unused42" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF1" flow="next"/>
-<opcode name="unused43" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF2" flow="next"/>
-<opcode name="unused44" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF3" flow="next"/>
-<opcode name="unused45" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF4" flow="next"/>
-<opcode name="unused46" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF5" flow="next"/>
-<opcode name="unused47" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF6" flow="next"/>
-<opcode name="unused48" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF7" flow="next"/>
-<opcode name="prefix7" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF8" flow="meta"/>
-<opcode name="prefix6" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF9" flow="meta"/>
-<opcode name="prefix5" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFA" flow="meta"/>
-<opcode name="prefix4" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFB" flow="meta"/>
-<opcode name="prefix3" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFC" flow="meta"/>
-<opcode name="prefix2" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFD" flow="meta"/>
-<opcode name="prefix1" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFE" flow="meta"/>
-<opcode name="prefixref" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFF" flow="meta"/>
-<opcode name="arglist" input="Pop0" output="PushI" args="InlineNone" o1="0xFE" o2="0x00" flow="next"/>
-<opcode name="ceq" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x01" flow="next"/>
-<opcode name="cgt" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x02" flow="next"/>
-<opcode name="cgt.un" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x03" flow="next"/>
-<opcode name="clt" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x04" flow="next"/>
-<opcode name="clt.un" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x05" flow="next"/>
-<opcode name="ldftn" input="Pop0" output="PushI" args="InlineMethod" o1="0xFE" o2="0x06" flow="next"/>
-<opcode name="ldvirtftn" input="PopRef" output="PushI" args="InlineMethod" o1="0xFE" o2="0x07" flow="next"/>
-<opcode name="unused56" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x08" flow="next"/>
-<opcode name="ldarg" input="Pop0" output="Push1" args="InlineVar" o1="0xFE" o2="0x09" flow="next"/>
-<opcode name="ldarga" input="Pop0" output="PushI" args="InlineVar" o1="0xFE" o2="0x0A" flow="next"/>
-<opcode name="starg" input="Pop1" output="Push0" args="InlineVar" o1="0xFE" o2="0x0B" flow="next"/>
-<opcode name="ldloc" input="Pop0" output="Push1" args="InlineVar" o1="0xFE" o2="0x0C" flow="next"/>
-<opcode name="ldloca" input="Pop0" output="PushI" args="InlineVar" o1="0xFE" o2="0x0D" flow="next"/>
-<opcode name="stloc" input="Pop1" output="Push0" args="InlineVar" o1="0xFE" o2="0x0E" flow="next"/>
-<opcode name="localloc" input="PopI" output="PushI" args="InlineNone" o1="0xFE" o2="0x0F" flow="next"/>
-<opcode name="unused57" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x10" flow="next"/>
-<opcode name="endfilter" input="PopI" output="Push0" args="InlineNone" o1="0xFE" o2="0x11" flow="return"/>
-<opcode name="unaligned." input="Pop0" output="Push0" args="ShortInlineI" o1="0xFE" o2="0x12" flow="meta"/>
-<opcode name="volatile." input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x13" flow="meta"/>
-<opcode name="tail." input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x14" flow="meta"/>
-<opcode name="initobj" input="PopI" output="Push0" args="InlineType" o1="0xFE" o2="0x15" flow="next"/>
-<opcode name="unused68" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x16" flow="next"/>
-<opcode name="cpblk" input="PopI+PopI+PopI" output="Push0" args="InlineNone" o1="0xFE" o2="0x17" flow="next"/>
-<opcode name="initblk" input="PopI+PopI+PopI" output="Push0" args="InlineNone" o1="0xFE" o2="0x18" flow="next"/>
-<opcode name="unused69" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x19" flow="next"/>
-<opcode name="rethrow" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1A" flow="throw"/>
-<opcode name="unused" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1B" flow="next"/>
-<opcode name="sizeof" input="Pop0" output="PushI" args="InlineType" o1="0xFE" o2="0x1C" flow="next"/>
-<opcode name="refanytype" input="Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x1D" flow="next"/>
-<opcode name="unused52" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1E" flow="next"/>
-<opcode name="unused53" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1F" flow="next"/>
-<opcode name="unused54" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x20" flow="next"/>
-<opcode name="unused55" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x21" flow="next"/>
-<opcode name="unused70" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x22" flow="next"/>
-<opcode name="illegal" input="Pop0" output="Push0" args="InlineNone" o1="0x00" o2="0x00" flow="meta"/>
-<opcode name="endmac" input="Pop0" output="Push0" args="InlineNone" o1="0x00" o2="0x00" flow="meta"/>
-
-
-</opdesc>
+<opdesc>
+<opcode name="nop" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x00" flow="next" type="Primitive" />
+<opcode name="break" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x01" flow="break" type="Primitive" />
+<opcode name="ldarg.0" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x02" flow="next" type="Macro" />
+<opcode name="ldarg.1" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x03" flow="next" type="Macro" />
+<opcode name="ldarg.2" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x04" flow="next" type="Macro" />
+<opcode name="ldarg.3" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x05" flow="next" type="Macro" />
+<opcode name="ldloc.0" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x06" flow="next" type="Macro" />
+<opcode name="ldloc.1" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x07" flow="next" type="Macro" />
+<opcode name="ldloc.2" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x08" flow="next" type="Macro" />
+<opcode name="ldloc.3" input="Pop0" output="Push1" args="InlineNone" o1="0xFF" o2="0x09" flow="next" type="Macro" />
+<opcode name="stloc.0" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0A" flow="next" type="Macro" />
+<opcode name="stloc.1" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0B" flow="next" type="Macro" />
+<opcode name="stloc.2" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0C" flow="next" type="Macro" />
+<opcode name="stloc.3" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x0D" flow="next" type="Macro" />
+<opcode name="ldarg.s" input="Pop0" output="Push1" args="ShortInlineVar" o1="0xFF" o2="0x0E" flow="next" type="Macro" />
+<opcode name="ldarga.s" input="Pop0" output="PushI" args="ShortInlineVar" o1="0xFF" o2="0x0F" flow="next" type="Macro" />
+<opcode name="starg.s" input="Pop1" output="Push0" args="ShortInlineVar" o1="0xFF" o2="0x10" flow="next" type="Macro" />
+<opcode name="ldloc.s" input="Pop0" output="Push1" args="ShortInlineVar" o1="0xFF" o2="0x11" flow="next" type="Macro" />
+<opcode name="ldloca.s" input="Pop0" output="PushI" args="ShortInlineVar" o1="0xFF" o2="0x12" flow="next" type="Macro" />
+<opcode name="stloc.s" input="Pop1" output="Push0" args="ShortInlineVar" o1="0xFF" o2="0x13" flow="next" type="Macro" />
+<opcode name="ldnull" input="Pop0" output="PushRef" args="InlineNone" o1="0xFF" o2="0x14" flow="next" type="Primitive" />
+<opcode name="ldc.i4.m1" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x15" flow="next" type="Macro" />
+<opcode name="ldc.i4.0" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x16" flow="next" type="Macro" />
+<opcode name="ldc.i4.1" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x17" flow="next" type="Macro" />
+<opcode name="ldc.i4.2" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x18" flow="next" type="Macro" />
+<opcode name="ldc.i4.3" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x19" flow="next" type="Macro" />
+<opcode name="ldc.i4.4" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1A" flow="next" type="Macro" />
+<opcode name="ldc.i4.5" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1B" flow="next" type="Macro" />
+<opcode name="ldc.i4.6" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1C" flow="next" type="Macro" />
+<opcode name="ldc.i4.7" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1D" flow="next" type="Macro" />
+<opcode name="ldc.i4.8" input="Pop0" output="PushI" args="InlineNone" o1="0xFF" o2="0x1E" flow="next" type="Macro" />
+<opcode name="ldc.i4.s" input="Pop0" output="PushI" args="ShortInlineI" o1="0xFF" o2="0x1F" flow="next" type="Macro" />
+<opcode name="ldc.i4" input="Pop0" output="PushI" args="InlineI" o1="0xFF" o2="0x20" flow="next" type="Primitive" />
+<opcode name="ldc.i8" input="Pop0" output="PushI8" args="InlineI8" o1="0xFF" o2="0x21" flow="next" type="Primitive" />
+<opcode name="ldc.r4" input="Pop0" output="PushR4" args="ShortInlineR" o1="0xFF" o2="0x22" flow="next" type="Primitive" />
+<opcode name="ldc.r8" input="Pop0" output="PushR8" args="InlineR" o1="0xFF" o2="0x23" flow="next" type="Primitive" />
+<opcode name="unused99" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x24" flow="next" />
+<opcode name="dup" input="Pop1" output="Push1+Push1" args="InlineNone" o1="0xFF" o2="0x25" flow="next" type="Primitive" />
+<opcode name="pop" input="Pop1" output="Push0" args="InlineNone" o1="0xFF" o2="0x26" flow="next" type="Primitive" />
+<opcode name="jmp" input="Pop0" output="Push0" args="InlineMethod" o1="0xFF" o2="0x27" flow="call" type="Primitive" />
+<opcode name="call" input="VarPop" output="VarPush" args="InlineMethod" o1="0xFF" o2="0x28" flow="call" type="Primitive" />
+<opcode name="calli" input="VarPop" output="VarPush" args="InlineSig" o1="0xFF" o2="0x29" flow="call" type="Primitive" />
+<opcode name="ret" input="VarPop" output="Push0" args="InlineNone" o1="0xFF" o2="0x2A" flow="return" type="Primitive" />
+<opcode name="br.s" input="Pop0" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2B" flow="branch" type="Macro" />
+<opcode name="brfalse.s" input="PopI" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2C" flow="cond-branch" type="Macro" />
+<opcode name="brtrue.s" input="PopI" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2D" flow="cond-branch" type="Macro" />
+<opcode name="beq.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2E" flow="cond-branch" type="Macro" />
+<opcode name="bge.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x2F" flow="cond-branch" type="Macro" />
+<opcode name="bgt.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x30" flow="cond-branch" type="Macro" />
+<opcode name="ble.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x31" flow="cond-branch" type="Macro" />
+<opcode name="blt.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x32" flow="cond-branch" type="Macro" />
+<opcode name="bne.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x33" flow="cond-branch" type="Macro" />
+<opcode name="bge.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x34" flow="cond-branch" type="Macro" />
+<opcode name="bgt.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x35" flow="cond-branch" type="Macro" />
+<opcode name="ble.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x36" flow="cond-branch" type="Macro" />
+<opcode name="blt.un.s" input="Pop1+Pop1" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0x37" flow="cond-branch" type="Macro" />
+<opcode name="br" input="Pop0" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x38" flow="branch" type="Primitive" />
+<opcode name="brfalse" input="PopI" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x39" flow="cond-branch" type="Primitive" />
+<opcode name="brtrue" input="PopI" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3A" flow="cond-branch" type="Primitive" />
+<opcode name="beq" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3B" flow="cond-branch" type="Macro" />
+<opcode name="bge" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3C" flow="cond-branch" type="Macro" />
+<opcode name="bgt" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3D" flow="cond-branch" type="Macro" />
+<opcode name="ble" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3E" flow="cond-branch" type="Macro" />
+<opcode name="blt" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x3F" flow="cond-branch" type="Macro" />
+<opcode name="bne.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x40" flow="cond-branch" type="Macro" />
+<opcode name="bge.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x41" flow="cond-branch" type="Macro" />
+<opcode name="bgt.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x42" flow="cond-branch" type="Macro" />
+<opcode name="ble.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x43" flow="cond-branch" type="Macro" />
+<opcode name="blt.un" input="Pop1+Pop1" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0x44" flow="cond-branch" type="Macro" />
+<opcode name="switch" input="PopI" output="Push0" args="InlineSwitch" o1="0xFF" o2="0x45" flow="cond-branch" type="Primitive" />
+<opcode name="ldind.i1" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x46" flow="next" type="Primitive" />
+<opcode name="ldind.u1" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x47" flow="next" type="Primitive" />
+<opcode name="ldind.i2" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x48" flow="next" type="Primitive" />
+<opcode name="ldind.u2" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x49" flow="next" type="Primitive" />
+<opcode name="ldind.i4" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x4A" flow="next" type="Primitive" />
+<opcode name="ldind.u4" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x4B" flow="next" type="Primitive" />
+<opcode name="ldind.i8" input="PopI" output="PushI8" args="InlineNone" o1="0xFF" o2="0x4C" flow="next" type="Primitive" />
+<opcode name="ldind.i" input="PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x4D" flow="next" type="Primitive" />
+<opcode name="ldind.r4" input="PopI" output="PushR4" args="InlineNone" o1="0xFF" o2="0x4E" flow="next" type="Primitive" />
+<opcode name="ldind.r8" input="PopI" output="PushR8" args="InlineNone" o1="0xFF" o2="0x4F" flow="next" type="Primitive" />
+<opcode name="ldind.ref" input="PopI" output="PushRef" args="InlineNone" o1="0xFF" o2="0x50" flow="next" type="Primitive" />
+<opcode name="stind.ref" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x51" flow="next" type="Primitive" />
+<opcode name="stind.i1" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x52" flow="next" type="Primitive" />
+<opcode name="stind.i2" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x53" flow="next" type="Primitive" />
+<opcode name="stind.i4" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x54" flow="next" type="Primitive" />
+<opcode name="stind.i8" input="PopI+PopI8" output="Push0" args="InlineNone" o1="0xFF" o2="0x55" flow="next" type="Primitive" />
+<opcode name="stind.r4" input="PopI+PopR4" output="Push0" args="InlineNone" o1="0xFF" o2="0x56" flow="next" type="Primitive" />
+<opcode name="stind.r8" input="PopI+PopR8" output="Push0" args="InlineNone" o1="0xFF" o2="0x57" flow="next" type="Primitive" />
+<opcode name="add" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x58" flow="next" type="Primitive" />
+<opcode name="sub" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x59" flow="next" type="Primitive" />
+<opcode name="mul" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5A" flow="next" type="Primitive" />
+<opcode name="div" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5B" flow="next" type="Primitive" />
+<opcode name="div.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5C" flow="next" type="Primitive" />
+<opcode name="rem" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5D" flow="next" type="Primitive" />
+<opcode name="rem.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5E" flow="next" type="Primitive" />
+<opcode name="and" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x5F" flow="next" type="Primitive" />
+<opcode name="or" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x60" flow="next" type="Primitive" />
+<opcode name="xor" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x61" flow="next" type="Primitive" />
+<opcode name="shl" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x62" flow="next" type="Primitive" />
+<opcode name="shr" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x63" flow="next" type="Primitive" />
+<opcode name="shr.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x64" flow="next" type="Primitive" />
+<opcode name="neg" input="Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x65" flow="next" type="Primitive" />
+<opcode name="not" input="Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0x66" flow="next" type="Primitive" />
+<opcode name="conv.i1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x67" flow="next" type="Primitive" />
+<opcode name="conv.i2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x68" flow="next" type="Primitive" />
+<opcode name="conv.i4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x69" flow="next" type="Primitive" />
+<opcode name="conv.i8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x6A" flow="next" type="Primitive" />
+<opcode name="conv.r4" input="Pop1" output="PushR4" args="InlineNone" o1="0xFF" o2="0x6B" flow="next" type="Primitive" />
+<opcode name="conv.r8" input="Pop1" output="PushR8" args="InlineNone" o1="0xFF" o2="0x6C" flow="next" type="Primitive" />
+<opcode name="conv.u4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x6D" flow="next" type="Primitive" />
+<opcode name="conv.u8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x6E" flow="next" type="Primitive" />
+<opcode name="callvirt" input="VarPop" output="VarPush" args="InlineMethod" o1="0xFF" o2="0x6F" flow="call" type="Objmodel" />
+<opcode name="cpobj" input="PopI+PopI" output="Push0" args="InlineType" o1="0xFF" o2="0x70" flow="next" type="Objmodel" />
+<opcode name="ldobj" input="PopI" output="Push1" args="InlineType" o1="0xFF" o2="0x71" flow="next" type="Objmodel" />
+<opcode name="ldstr" input="Pop0" output="PushRef" args="InlineString" o1="0xFF" o2="0x72" flow="next" type="Objmodel" />
+<opcode name="newobj" input="VarPop" output="PushRef" args="InlineMethod" o1="0xFF" o2="0x73" flow="call" type="Objmodel" />
+<opcode name="castclass" input="PopRef" output="PushRef" args="InlineType" o1="0xFF" o2="0x74" flow="next" type="Objmodel" />
+<opcode name="isinst" input="PopRef" output="PushI" args="InlineType" o1="0xFF" o2="0x75" flow="next" type="Objmodel" />
+<opcode name="conv.r.un" input="Pop1" output="PushR8" args="InlineNone" o1="0xFF" o2="0x76" flow="next" type="Primitive" />
+<opcode name="unused58" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x77" flow="next" />
+<opcode name="unused1" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0x78" flow="next" />
+<opcode name="unbox" input="PopRef" output="PushI" args="InlineType" o1="0xFF" o2="0x79" flow="next" type="Primitive" />
+<opcode name="throw" input="PopRef" output="Push0" args="InlineNone" o1="0xFF" o2="0x7A" flow="throw" type="Objmodel" />
+<opcode name="ldfld" input="PopRef" output="Push1" args="InlineField" o1="0xFF" o2="0x7B" flow="next" type="Objmodel" />
+<opcode name="ldflda" input="PopRef" output="PushI" args="InlineField" o1="0xFF" o2="0x7C" flow="next" type="Objmodel" />
+<opcode name="stfld" input="PopRef+Pop1" output="Push0" args="InlineField" o1="0xFF" o2="0x7D" flow="next" type="Objmodel" />
+<opcode name="ldsfld" input="Pop0" output="Push1" args="InlineField" o1="0xFF" o2="0x7E" flow="next" type="Objmodel" />
+<opcode name="ldsflda" input="Pop0" output="PushI" args="InlineField" o1="0xFF" o2="0x7F" flow="next" type="Objmodel" />
+<opcode name="stsfld" input="Pop1" output="Push0" args="InlineField" o1="0xFF" o2="0x80" flow="next" type="Objmodel" />
+<opcode name="stobj" input="PopI+Pop1" output="Push0" args="InlineType" o1="0xFF" o2="0x81" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i1.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x82" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i2.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x83" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i4.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x84" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i8.un" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x85" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u1.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x86" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u2.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x87" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u4.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x88" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u8.un" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0x89" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x8A" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u.un" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0x8B" flow="next" type="Primitive" />
+<opcode name="box" input="Pop1" output="PushRef" args="InlineType" o1="0xFF" o2="0x8C" flow="next" type="Primitive" />
+<opcode name="newarr" input="PopI" output="PushRef" args="InlineType" o1="0xFF" o2="0x8D" flow="next" type="Objmodel" />
+<opcode name="ldlen" input="PopRef" output="PushI" args="InlineNone" o1="0xFF" o2="0x8E" flow="next" type="Objmodel" />
+<opcode name="ldelema" input="PopRef+PopI" output="PushI" args="InlineType" o1="0xFF" o2="0x8F" flow="next" type="Objmodel" />
+<opcode name="ldelem.i1" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x90" flow="next" type="Objmodel" />
+<opcode name="ldelem.u1" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x91" flow="next" type="Objmodel" />
+<opcode name="ldelem.i2" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x92" flow="next" type="Objmodel" />
+<opcode name="ldelem.u2" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x93" flow="next" type="Objmodel" />
+<opcode name="ldelem.i4" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x94" flow="next" type="Objmodel" />
+<opcode name="ldelem.u4" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x95" flow="next" type="Objmodel" />
+<opcode name="ldelem.i8" input="PopRef+PopI" output="PushI8" args="InlineNone" o1="0xFF" o2="0x96" flow="next" type="Objmodel" />
+<opcode name="ldelem.i" input="PopRef+PopI" output="PushI" args="InlineNone" o1="0xFF" o2="0x97" flow="next" type="Objmodel" />
+<opcode name="ldelem.r4" input="PopRef+PopI" output="PushR4" args="InlineNone" o1="0xFF" o2="0x98" flow="next" type="Objmodel" />
+<opcode name="ldelem.r8" input="PopRef+PopI" output="PushR8" args="InlineNone" o1="0xFF" o2="0x99" flow="next" type="Objmodel" />
+<opcode name="ldelem.ref" input="PopRef+PopI" output="PushRef" args="InlineNone" o1="0xFF" o2="0x9A" flow="next" type="Objmodel" />
+<opcode name="stelem.i" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9B" flow="next" type="Objmodel" />
+<opcode name="stelem.i1" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9C" flow="next" type="Objmodel" />
+<opcode name="stelem.i2" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9D" flow="next" type="Objmodel" />
+<opcode name="stelem.i4" input="PopRef+PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0x9E" flow="next" type="Objmodel" />
+<opcode name="stelem.i8" input="PopRef+PopI+PopI8" output="Push0" args="InlineNone" o1="0xFF" o2="0x9F" flow="next" type="Objmodel" />
+<opcode name="stelem.r4" input="PopRef+PopI+PopR4" output="Push0" args="InlineNone" o1="0xFF" o2="0xA0" flow="next" type="Objmodel" />
+<opcode name="stelem.r8" input="PopRef+PopI+PopR8" output="Push0" args="InlineNone" o1="0xFF" o2="0xA1" flow="next" type="Objmodel" />
+<opcode name="stelem.ref" input="PopRef+PopI+PopRef" output="Push0" args="InlineNone" o1="0xFF" o2="0xA2" flow="next" type="Objmodel" />
+<opcode name="ldelem.any" input="PopRef+PopI" output="Push1" args="InlineType" o1="0xFF" o2="0xA3" flow="next" type="Objmodel" />
+<opcode name="stelem.any" input="PopRef+PopI+PopRef" output="Push0" args="InlineType" o1="0xFF" o2="0xA4" flow="next" type="Objmodel" />
+<opcode name="unbox.any" input="PopRef" output="Push1" args="InlineType" o1="0xFF" o2="0xA5" flow="next" type="Objmodel" />
+<opcode name="unused5" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA6" flow="next" />
+<opcode name="unused6" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA7" flow="next" />
+<opcode name="unused7" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA8" flow="next" />
+<opcode name="unused8" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xA9" flow="next" />
+<opcode name="unused9" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAA" flow="next" />
+<opcode name="unused10" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAB" flow="next" />
+<opcode name="unused11" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAC" flow="next" />
+<opcode name="unused12" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAD" flow="next" />
+<opcode name="unused13" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAE" flow="next" />
+<opcode name="unused14" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xAF" flow="next" />
+<opcode name="unused15" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xB0" flow="next" />
+<opcode name="unused16" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xB1" flow="next" />
+<opcode name="unused17" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xB2" flow="next" />
+<opcode name="conv.ovf.i1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB3" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB4" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB5" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB6" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB7" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u4" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xB8" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0xB9" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u8" input="Pop1" output="PushI8" args="InlineNone" o1="0xFF" o2="0xBA" flow="next" type="Primitive" />
+<opcode name="unused50" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBB" flow="next" />
+<opcode name="unused18" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBC" flow="next" />
+<opcode name="unused19" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBD" flow="next" />
+<opcode name="unused20" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBE" flow="next" />
+<opcode name="unused21" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xBF" flow="next" />
+<opcode name="unused22" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC0" flow="next" />
+<opcode name="unused23" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC1" flow="next" />
+<opcode name="refanyval" input="Pop1" output="PushI" args="InlineType" o1="0xFF" o2="0xC2" flow="next" type="Primitive" />
+<opcode name="ckfinite" input="Pop1" output="PushR8" args="InlineNone" o1="0xFF" o2="0xC3" flow="next" type="Primitive" />
+<opcode name="unused24" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC4" flow="next" />
+<opcode name="unused25" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC5" flow="next" />
+<opcode name="mkrefany" input="PopI" output="Push1" args="InlineType" o1="0xFF" o2="0xC6" flow="next" type="Primitive" />
+<opcode name="unused59" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC7" flow="next" />
+<opcode name="unused60" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC8" flow="next" />
+<opcode name="unused61" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xC9" flow="next" />
+<opcode name="unused62" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCA" flow="next" />
+<opcode name="unused63" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCB" flow="next" />
+<opcode name="unused64" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCC" flow="next" />
+<opcode name="unused65" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCD" flow="next" />
+<opcode name="unused66" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCE" flow="next" />
+<opcode name="unused67" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xCF" flow="next" />
+<opcode name="ldtoken" input="Pop0" output="PushI" args="InlineTok" o1="0xFF" o2="0xD0" flow="next" type="Primitive" />
+<opcode name="conv.u2" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD1" flow="next" type="Primitive" />
+<opcode name="conv.u1" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD2" flow="next" type="Primitive" />
+<opcode name="conv.i" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD3" flow="next" type="Primitive" />
+<opcode name="conv.ovf.i" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD4" flow="next" type="Primitive" />
+<opcode name="conv.ovf.u" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xD5" flow="next" type="Primitive" />
+<opcode name="add.ovf" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD6" flow="next" type="Primitive" />
+<opcode name="add.ovf.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD7" flow="next" type="Primitive" />
+<opcode name="mul.ovf" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD8" flow="next" type="Primitive" />
+<opcode name="mul.ovf.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xD9" flow="next" type="Primitive" />
+<opcode name="sub.ovf" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xDA" flow="next" type="Primitive" />
+<opcode name="sub.ovf.un" input="Pop1+Pop1" output="Push1" args="InlineNone" o1="0xFF" o2="0xDB" flow="next" type="Primitive" />
+<opcode name="endfinally" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xDC" flow="return" type="Primitive" />
+<opcode name="leave" input="Pop0" output="Push0" args="InlineBrTarget" o1="0xFF" o2="0xDD" flow="branch" type="Primitive" />
+<opcode name="leave.s" input="Pop0" output="Push0" args="ShortInlineBrTarget" o1="0xFF" o2="0xDE" flow="branch" type="Primitive" />
+<opcode name="stind.i" input="PopI+PopI" output="Push0" args="InlineNone" o1="0xFF" o2="0xDF" flow="next" type="Primitive" />
+<opcode name="conv.u" input="Pop1" output="PushI" args="InlineNone" o1="0xFF" o2="0xE0" flow="next" type="Primitive" />
+<opcode name="unused26" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE1" flow="next" />
+<opcode name="unused27" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE2" flow="next" />
+<opcode name="unused28" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE3" flow="next" />
+<opcode name="unused29" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE4" flow="next" />
+<opcode name="unused30" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE5" flow="next" />
+<opcode name="unused31" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE6" flow="next" />
+<opcode name="unused32" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE7" flow="next" />
+<opcode name="unused33" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE8" flow="next" />
+<opcode name="unused34" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xE9" flow="next" />
+<opcode name="unused35" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEA" flow="next" />
+<opcode name="unused36" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEB" flow="next" />
+<opcode name="unused37" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEC" flow="next" />
+<opcode name="unused38" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xED" flow="next" />
+<opcode name="unused39" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEE" flow="next" />
+<opcode name="unused40" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xEF" flow="next" />
+<opcode name="unused41" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF0" flow="next" />
+<opcode name="unused42" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF1" flow="next" />
+<opcode name="unused43" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF2" flow="next" />
+<opcode name="unused44" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF3" flow="next" />
+<opcode name="unused45" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF4" flow="next" />
+<opcode name="unused46" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF5" flow="next" />
+<opcode name="unused47" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF6" flow="next" />
+<opcode name="unused48" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF7" flow="next" />
+<opcode name="prefix7" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF8" flow="meta" type="Nternal" />
+<opcode name="prefix6" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xF9" flow="meta" type="Nternal" />
+<opcode name="prefix5" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFA" flow="meta" type="Nternal" />
+<opcode name="prefix4" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFB" flow="meta" type="Nternal" />
+<opcode name="prefix3" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFC" flow="meta" type="Nternal" />
+<opcode name="prefix2" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFD" flow="meta" type="Nternal" />
+<opcode name="prefix1" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFE" flow="meta" type="Nternal" />
+<opcode name="prefixref" input="Pop0" output="Push0" args="InlineNone" o1="0xFF" o2="0xFF" flow="meta" type="Nternal" />
+<opcode name="arglist" input="Pop0" output="PushI" args="InlineNone" o1="0xFE" o2="0x00" flow="next" type="Primitive" />
+<opcode name="ceq" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x01" flow="next" type="Primitive" />
+<opcode name="cgt" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x02" flow="next" type="Primitive" />
+<opcode name="cgt.un" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x03" flow="next" type="Primitive" />
+<opcode name="clt" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x04" flow="next" type="Primitive" />
+<opcode name="clt.un" input="Pop1+Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x05" flow="next" type="Primitive" />
+<opcode name="ldftn" input="Pop0" output="PushI" args="InlineMethod" o1="0xFE" o2="0x06" flow="next" type="Primitive" />
+<opcode name="ldvirtftn" input="PopRef" output="PushI" args="InlineMethod" o1="0xFE" o2="0x07" flow="next" type="Primitive" />
+<opcode name="unused56" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x08" flow="next" />
+<opcode name="ldarg" input="Pop0" output="Push1" args="InlineVar" o1="0xFE" o2="0x09" flow="next" type="Primitive" />
+<opcode name="ldarga" input="Pop0" output="PushI" args="InlineVar" o1="0xFE" o2="0x0A" flow="next" type="Primitive" />
+<opcode name="starg" input="Pop1" output="Push0" args="InlineVar" o1="0xFE" o2="0x0B" flow="next" type="Primitive" />
+<opcode name="ldloc" input="Pop0" output="Push1" args="InlineVar" o1="0xFE" o2="0x0C" flow="next" type="Primitive" />
+<opcode name="ldloca" input="Pop0" output="PushI" args="InlineVar" o1="0xFE" o2="0x0D" flow="next" type="Primitive" />
+<opcode name="stloc" input="Pop1" output="Push0" args="InlineVar" o1="0xFE" o2="0x0E" flow="next" type="Primitive" />
+<opcode name="localloc" input="PopI" output="PushI" args="InlineNone" o1="0xFE" o2="0x0F" flow="next" type="Primitive" />
+<opcode name="unused57" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x10" flow="next" />
+<opcode name="endfilter" input="PopI" output="Push0" args="InlineNone" o1="0xFE" o2="0x11" flow="return" type="Primitive" />
+<opcode name="unaligned." input="Pop0" output="Push0" args="ShortInlineI" o1="0xFE" o2="0x12" flow="meta" type="Prefix" />
+<opcode name="volatile." input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x13" flow="meta" type="Prefix" />
+<opcode name="tail." input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x14" flow="meta" type="Prefix" />
+<opcode name="initobj" input="PopI" output="Push0" args="InlineType" o1="0xFE" o2="0x15" flow="next" type="Objmodel" />
+<opcode name="constrained." input="Pop0" output="Push0" args="InlineTok" o1="0xFE" o2="0x16" flow="next" type="Prefix" />
+<opcode name="cpblk" input="PopI+PopI+PopI" output="Push0" args="InlineNone" o1="0xFE" o2="0x17" flow="next" type="Primitive" />
+<opcode name="initblk" input="PopI+PopI+PopI" output="Push0" args="InlineNone" o1="0xFE" o2="0x18" flow="next" type="Primitive" />
+<opcode name="no." input="Pop0" output="Push0" args="ShortInlineI" o1="0xFE" o2="0x19" flow="next" />
+<opcode name="rethrow" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1A" flow="throw" type="Objmodel" />
+<opcode name="unused" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1B" flow="next" />
+<opcode name="sizeof" input="Pop0" output="PushI" args="InlineType" o1="0xFE" o2="0x1C" flow="next" type="Primitive" />
+<opcode name="refanytype" input="Pop1" output="PushI" args="InlineNone" o1="0xFE" o2="0x1D" flow="next" type="Primitive" />
+<opcode name="readonly." input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1E" flow="next" />
+<opcode name="unused53" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x1F" flow="next" />
+<opcode name="unused54" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x20" flow="next" />
+<opcode name="unused55" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x21" flow="next" />
+<opcode name="unused70" input="Pop0" output="Push0" args="InlineNone" o1="0xFE" o2="0x22" flow="next" />
+<opcode name="illegal" input="Pop0" output="Push0" args="InlineNone" o1="0x00" o2="0x00" flow="meta" />
+<opcode name="endmac" input="Pop0" output="Push0" args="InlineNone" o1="0x00" o2="0x00" flow="meta" />
+<opcode name="mono_icall" input="VarPop" output="VarPush" args="ShortInlineI" o1="0xF0" o2="0x00" flow="next" />
+<opcode name="mono_objaddr" input="Pop1" output="PushI" args="InlineNone" o1="0xF0" o2="0x01" flow="next" />
+<opcode name="mono_ldptr" input="Pop0" output="PushI" args="InlineI" o1="0xF0" o2="0x02" flow="next" />
+<opcode name="mono_vtaddr" input="Pop1" output="PushI" args="InlineNone" o1="0xF0" o2="0x03" flow="next" />
+<opcode name="mono_newobj" input="Pop0" output="PushRef" args="InlineType" o1="0xF0" o2="0x04" flow="next" />
+<opcode name="mono_retobj" input="PopI" output="Push0" args="InlineType" o1="0xF0" o2="0x05" flow="return" />
+<opcode name="mono_ldnativeobj" input="PopI" output="Push1" args="InlineType" o1="0xF0" o2="0x06" flow="return" />
+<opcode name="mono_cisinst" input="PopRef" output="Push1" args="InlineType" o1="0xF0" o2="0x07" flow="next" />
+<opcode name="mono_ccastclass" input="PopRef" output="Push1" args="InlineType" o1="0xF0" o2="0x08" flow="next" />
+<opcode name="mono_save_lmf" input="Pop0" output="Push0" args="InlineNone" o1="0xF0" o2="0x09" flow="next" />
+<opcode name="mono_restore_lmf" input="Pop0" output="Push0" args="InlineNone" o1="0xF0" o2="0x0A" flow="next" />
+</opdesc> \ No newline at end of file
diff --git a/mono/cil/make-opcodes-def.pl b/mono/cil/make-opcodes-def.pl
index 3114918bb65..a94c15778ca 100644
--- a/mono/cil/make-opcodes-def.pl
+++ b/mono/cil/make-opcodes-def.pl
@@ -19,10 +19,10 @@ my %valid_flow;
# the XML file also includes "throw"
@valid_flow{qw(next call return branch meta cond-branch)} = ();
-open OUTPUT, ">opcode.def" || die "Can not create opcode.def file: $!";
+open OUTPUT, ">$ARGV[1]" || die "Can not create $ARGV[1] file: $!";
my $parser = new XML::Parser (Handlers => {Start => \&handle_opcode});
-$parser->parsefile("cil-opcodes.xml");
+$parser->parsefile($ARGV[0]);
print_trailer();
close(OUTPUT) || die "Can not close file: $!";
diff --git a/mono/cil/opcode.def b/mono/cil/opcode.def
index 9331159500d..fc51371066d 100644
--- a/mono/cil/opcode.def
+++ b/mono/cil/opcode.def
@@ -161,9 +161,9 @@ OPDEF(CEE_STELEM_I8, "stelem.i8", PopRef+PopI+PopI8, Push0, InlineNone, X, 1, 0x
OPDEF(CEE_STELEM_R4, "stelem.r4", PopRef+PopI+PopR4, Push0, InlineNone, X, 1, 0xFF, 0xA0, NEXT)
OPDEF(CEE_STELEM_R8, "stelem.r8", PopRef+PopI+PopR8, Push0, InlineNone, X, 1, 0xFF, 0xA1, NEXT)
OPDEF(CEE_STELEM_REF, "stelem.ref", PopRef+PopI+PopRef, Push0, InlineNone, X, 1, 0xFF, 0xA2, NEXT)
-OPDEF(CEE_UNUSED2, "unused2", Pop0, Push0, InlineNone, X, 1, 0xFF, 0xA3, NEXT)
-OPDEF(CEE_UNUSED3, "unused3", Pop0, Push0, InlineNone, X, 1, 0xFF, 0xA4, NEXT)
-OPDEF(CEE_UNUSED4, "unused4", Pop0, Push0, InlineNone, X, 1, 0xFF, 0xA5, NEXT)
+OPDEF(CEE_LDELEM_ANY, "ldelem.any", PopRef+PopI, Push1, InlineType, X, 1, 0xFF, 0xA3, NEXT)
+OPDEF(CEE_STELEM_ANY, "stelem.any", PopRef+PopI+PopRef, Push0, InlineType, X, 1, 0xFF, 0xA4, NEXT)
+OPDEF(CEE_UNBOX_ANY, "unbox.any", PopRef, Push1, InlineType, X, 1, 0xFF, 0xA5, NEXT)
OPDEF(CEE_UNUSED5, "unused5", Pop0, Push0, InlineNone, X, 1, 0xFF, 0xA6, NEXT)
OPDEF(CEE_UNUSED6, "unused6", Pop0, Push0, InlineNone, X, 1, 0xFF, 0xA7, NEXT)
OPDEF(CEE_UNUSED7, "unused7", Pop0, Push0, InlineNone, X, 1, 0xFF, 0xA8, NEXT)
@@ -276,21 +276,32 @@ OPDEF(CEE_UNALIGNED_, "unaligned.", Pop0, Push0, ShortInlineI, X, 2, 0xFE, 0x12,
OPDEF(CEE_VOLATILE_, "volatile.", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x13, META)
OPDEF(CEE_TAIL_, "tail.", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x14, META)
OPDEF(CEE_INITOBJ, "initobj", PopI, Push0, InlineType, X, 2, 0xFE, 0x15, NEXT)
-OPDEF(CEE_UNUSED68, "unused68", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x16, NEXT)
+OPDEF(CEE_CONSTRAINED_, "constrained.", Pop0, Push0, InlineTok, X, 2, 0xFE, 0x16, NEXT)
OPDEF(CEE_CPBLK, "cpblk", PopI+PopI+PopI, Push0, InlineNone, X, 2, 0xFE, 0x17, NEXT)
OPDEF(CEE_INITBLK, "initblk", PopI+PopI+PopI, Push0, InlineNone, X, 2, 0xFE, 0x18, NEXT)
-OPDEF(CEE_UNUSED69, "unused69", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x19, NEXT)
+OPDEF(CEE_NO_, "no.", Pop0, Push0, ShortInlineI, X, 2, 0xFE, 0x19, NEXT)
OPDEF(CEE_RETHROW, "rethrow", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x1A, ERROR)
OPDEF(CEE_UNUSED, "unused", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x1B, NEXT)
OPDEF(CEE_SIZEOF, "sizeof", Pop0, PushI, InlineType, X, 2, 0xFE, 0x1C, NEXT)
OPDEF(CEE_REFANYTYPE, "refanytype", Pop1, PushI, InlineNone, X, 2, 0xFE, 0x1D, NEXT)
-OPDEF(CEE_UNUSED52, "unused52", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x1E, NEXT)
+OPDEF(CEE_READONLY_, "readonly.", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x1E, NEXT)
OPDEF(CEE_UNUSED53, "unused53", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x1F, NEXT)
OPDEF(CEE_UNUSED54, "unused54", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x20, NEXT)
OPDEF(CEE_UNUSED55, "unused55", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x21, NEXT)
OPDEF(CEE_UNUSED70, "unused70", Pop0, Push0, InlineNone, X, 2, 0xFE, 0x22, NEXT)
OPDEF(CEE_ILLEGAL, "illegal", Pop0, Push0, InlineNone, X, 2, 0x00, 0x00, META)
OPDEF(CEE_ENDMAC, "endmac", Pop0, Push0, InlineNone, X, 2, 0x00, 0x00, META)
+OPDEF(CEE_MONO_ICALL, "mono_icall", VarPop, VarPush, ShortInlineI, X, 2, 0xF0, 0x00, NEXT)
+OPDEF(CEE_MONO_OBJADDR, "mono_objaddr", Pop1, PushI, InlineNone, X, 2, 0xF0, 0x01, NEXT)
+OPDEF(CEE_MONO_LDPTR, "mono_ldptr", Pop0, PushI, InlineI, X, 2, 0xF0, 0x02, NEXT)
+OPDEF(CEE_MONO_VTADDR, "mono_vtaddr", Pop1, PushI, InlineNone, X, 2, 0xF0, 0x03, NEXT)
+OPDEF(CEE_MONO_NEWOBJ, "mono_newobj", Pop0, PushRef, InlineType, X, 2, 0xF0, 0x04, NEXT)
+OPDEF(CEE_MONO_RETOBJ, "mono_retobj", PopI, Push0, InlineType, X, 2, 0xF0, 0x05, RETURN)
+OPDEF(CEE_MONO_LDNATIVEOBJ, "mono_ldnativeobj", PopI, Push1, InlineType, X, 2, 0xF0, 0x06, RETURN)
+OPDEF(CEE_MONO_CISINST, "mono_cisinst", PopRef, Push1, InlineType, X, 2, 0xF0, 0x07, NEXT)
+OPDEF(CEE_MONO_CCASTCLASS, "mono_ccastclass", PopRef, Push1, InlineType, X, 2, 0xF0, 0x08, NEXT)
+OPDEF(CEE_MONO_SAVE_LMF, "mono_save_lmf", Pop0, Push0, InlineNone, X, 2, 0xF0, 0x09, NEXT)
+OPDEF(CEE_MONO_RESTORE_LMF, "mono_restore_lmf", Pop0, Push0, InlineNone, X, 2, 0xF0, 0x0A, NEXT)
#ifndef OPALIAS
#define _MONO_CIL_OPALIAS_DEFINED_
#define OPALIAS(a,s,r)
diff --git a/mono/dis/ChangeLog b/mono/dis/ChangeLog
index acfaf076476..46e58753a45 100644
--- a/mono/dis/ChangeLog
+++ b/mono/dis/ChangeLog
@@ -1,4 +1,497 @@
+Tue Nov 9 17:29:28 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * dis-cil.c, get.c, get.h: update to exception clause structure changes.
+
+2004-11-08 Ben Maurer <bmaurer@ximian.com>
+
+ * get.c, dump.c: warning free.
+
+2004-10-21 Jackson Harper <jackson@ximian.com>
+
+ * get.c: Escape typedef names.
+
+2004-10-19 <vargaz@freemail.hu>
+
+ * main.c: Applied patch from Alexandre Rocha Lima e Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really fix 2.95 build.
+
+2004-10-04 Sebastien Pouliot <sebastien@ximian.com>
+
+ * dump.c: Added new "internal" security actions for non-CAS demands:
+ NonCasDemand, NonCasLinkDemand and NonCasInheritance.
+ * main.c: Added new "internal" security actions for non-CAS demands:
+ noncasdemand, noncaslinkdemand and noncasinheritance.
+
+2004-09-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * main.c: Add support for pinvoke flags BestFit and
+ ThrowOnUnmappableChar.
+
+2004-09-23 Miguel de Icaza <miguel@ximian.com>
+
+ * main.c (dis_directive_assemblyref): Dump the locale and public
+ key tokens
+
+ * get.c (dis_stringify_object_with_class): Escape assembly name.
+
+ * main.c (dis_directive_assemblyref): Escape assembly name
+
+2004-09-21 Martin Baulig <martin@ximian.com>
+
+ * main.c (main): If just a single assembly was specified, use the
+ runtime version it requires.
+
+2004-09-16 Sebastien Pouliot <sebastien@ximian.com>
+
+ * dump.c: Added new security actions added in 2.0: LinkDemandChoice,
+ InheritanceDemandChoice and DemandChoice.
+ * main.c: Added ".permissionset" to output IL. Removed "hassecurity"
+ as MS ilasm can't compile it.
+
+2004-09-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * get.c (get_token): Add support for memberrefs.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * main.c: Fix build && warnings.
+
+2004-09-05 Jambunathan K <kjambunathan@novell.com>
+ * main.c (dump_cattrs_list): Newly carved out of dump_cattrs.
+
+ Renamed cattrs_for_method() to more meaningful
+ dump_cattrs_for_method_params()
+
+ (dump_cattrs_for_method_params): Fixed so that ".param[]" gets
+ dumped only when necessary. i.e., when a method parameter has
+ either a default value and/or when it has a custom attribute.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * get.c: Fix printing of unmanaged calling conventions.
+ (get_constant): Fix warning.
+
+2004-08-28 Jambunathan K <kjambunathan@novell.com>
+ * main.c: modified cattrs_for_method so that
+ emitting of ".param[] = ..." is complete.
+
+ * get.c: Modified get_constant() so that
+ 1. MONO_TYPE_CHAR now handles unicode characters
+ 2. MONO_TYPE_I8 now emits int64(...)
+ 3. MONO_TYPE_STRING emits a bytearray()
+
+2004-08-18 Jambunathan K <kjambunathan@novell.com>
+ * get.c: Changed dis_stringify_param to emit [opt] for parameters
+ that are marked as Optional.
+
+ * dump.c: Fixed dump_table_constant so that the parent field's
+ description is correctly displayed.
+
+2004-08-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * get.c (get_typespec): Append '*' to pointer types. Fixes #62331.
+
+2004-08-03 Martin Baulig <martin@ximian.com>
+
+ * dump.c (method_dor_to_token): Moved to get.c and made public.
+
+ * get.c (get_method_override): New public function.
+
+ * main.c (dis_code): Added `.override' for override methods.
+
+2004-08-02 Martin Baulig <martin@ximian.com>
+
+ * get.c (dis_stringify_object_with_class): Include our generic
+ arguments in the method's class name.
+
+ * main.c (dis_generic_param_and_constraints): Use the new
+ constraints syntax.
+
+2004-08-02 Martin Baulig <martin@ximian.com>
+
+ * dump.c (dump_stream_blob): Format this nicely.
+ (dump_table_standalonesig): New public function.
+
+ * main.c (dis_locals): If --show-tokens was requested, print the
+ standalone signature token.
+ (table_list): Added "--standalonesig".
+
+2004-07-09 Jackson Harper <jackson@ximian.com>
+
+ * get.c: Make "class" the default so only valuetypes get the
+ "valuetype" modifier. Otherwise object, string, int,... will get
+ it.
+
+2004-07-08 Jackson Harper <jackson@ximian.com>
+
+ * main.c: Spaces after visibility types.
+
+2004-07-06 Jackson Harper <jackson@ximian.com>
+
+ * get.c: Add float cast for outputing floats. Patch by Steve Brown.
+
+2004-06-25 Jackson Harper <jackson@ximian.com>
+
+ * get.c: Add a few more keywords to be escaped.
+ * main.c: MS's ildasm writes '// end of class' not '// end of
+ type'. The python.net tool searches for this string.
+
+2004-06-24 David Waite <mass@akuma.org>
+
+ * dump.c: change to C90-style comments from C99/C++-style
+
+2004-06-23 Raja R Harinath <rharinath@novell.com>
+
+ * main.c (dis_event_signature): Decode and print event_flags.
+
+2004-06-20 Jackson Harper <jackson@ximian.com>
+
+ * dis-cil.c: Handle switch statements with no labels.
+
+2004-06-19 Jackson Harper <jackson@ximian.com>
+
+ * dump.c/h: New function to dump the contents of the blob
+ stream. I found it useful for debugging so I will share.
+ * main.c: Add --blob switch to dump the blob stream.
+ * monodis.1: Document --blob
+
+2004-06-19 Jackson Harper <jackson@ximian.com>
+
+ * get.c/h: New function to stringify function pointers.
+
+2004-06-19 Jackson Harper <jackson@ximian.com>
+
+ * get.c: Fix name escaping so we dont escape everything in the
+ world anymore.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * get.c (get_methodref_signature): Include "vararg " in the
+ signature of a varargs method.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * get.c (get_methodref_signature): If we're a varargs method,
+ print "..." for the sentinel followed by the actual types.
+
+2004-06-08 Martin Baulig <martin@ximian.com>
+
+ * dump.c (dump_table_memberref): Added support for MethodDef
+ parents.
+
+2004-05-06 Bernie Solomon <bernard@ugsolutions.com>
+
+ * dump.c:
+ * get.c:
+ * main.c:
+ * util.c:
+ * util.h: rename map_t dis_map_t to avoid AIX symbol clash
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * dump.c (dump_table_memberref): Added support for TypeDef's.
+
+2004-03-29 Jackson Harper <jackson@ximian.com>
+
+ * main.c: Handle pinvoke info where there is not an impl_map
+ entry.
+
+2004-03-27 Vladimir Vukicevic <vladimir@pobox.com>
+
+ * get.c (get_constant): output bool consts as bool(true) or
+ bool(false) (to be same as ildasm, also what mono and ms
+ ilasm expect)
+
+2004-01-31 Martin Baulig <martin@ximian.com>
+
+ * get.c (get_methodspec): It's a methoddef or ref token.
+
+2004-01-26 Martin Baulig <martin@ximian.com>
+
+ * main.cs (--show-tokens): New command line argument to show
+ type tokens in the disassembly.
+
+ * get.c (get_typedef, get_typespec, get_typeref): If
+ `show_tokens', include the token in the type name.
+ (get_type): Do some type parsing here and include the token in the
+ returned type name if requested.
+ (get_method): Include tokens if requested.
+
+2004-01-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * main.c get.c: Add support for dumping the custom attributes of
+ modules.
+
+2004-01-09 Jackson Harper <jackson@ximian.com>
+
+ * monodis.1: Add --show-method-tokens switch
+ * get.c: When stringifying methods show the method token if the
+ show-method-tokens flag is set.
+ * get.h: Add show_method_tokens flag
+ * main.c: Add --show-method-tokens switch
+
+2004-01-09 Jackson Harper <jackson@ximian.com>
+
+ * monodis.1: Add typespec switch
+
+2004-01-08 Jackson Harper <jackson@ximian.com>
+
+ * main.c: Add switch to dump typespec table.
+ * dump.c/dump.h: Add function for dumping typespec table.
+
+2003-12-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * dump.c (dump_table_exported): Fix output.
+
+2003-12-08 Jackson Harper <jackson@ximian.com>
+
+ * main.cs: escape module names.
+
+2003-12-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * main.c (dis_field_list): Update after changes to
+ mono_metadata_get_constant_index ().
+
+2003-11-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * dump.c dump.h main.c: Added support for dumping the ImplMap table
+ (--implmap).
+
+ * main.c (dis_method_list): Avoid disassembling native code.
+
+2003-11-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * get.c (dis_stringify_modifiers): Fix display of modreq and modopt.
+
+Thu Nov 13 16:12:09 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * util.h, dump.c: get rid of ugly CSIZE macro.
+
+2003-11-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * main.c: Add disassembly of module, moduleref and file tables.
+
+ * get.h get.c: Add support for modulerefs.
+
+ * dump.c: Avoid crash on empty assembly table.
+
+2003-10-22 Jackson Harper <jackson@ximian.com>
+
+ * main.c: Use escaped names for method, and type names. Initialize
+ the name table.
+ * main.c (visibility_map): Fix typo, should be nested family not
+ family
+ * main.c (dis_data): Use uppercase hex to avoid name conflicts.
+ * get.c/get.h: New method to get an escaped name. This method will
+ take a name and escape it if it is an ilasm keyword, or uses a non
+ id char. Use escaped names for type, method, field, and parameter names.
+ * get.c (get_typespec): A typespec can be used for anything, so we
+ need to handle all types not just modified types.
+ * get.c (dis_stringify_object_with_class): Handle nested classes
+ * get.c (get_token): Add field keyword to field tokens.
+
+2003-10-21 Jackson Harper <jackson@ximian.com>
+
+ * get.c (get_fieldref_signature): Use MONO_MEMBERREF_SIGNATURE in
+ the member ref table.
+
+2003-10-21 Martin Baulig <martin@ximian.com>
+
+ * get.c (get_typespec): Add MONO_TYPE_VAR and MONO_TYPE_MVAR.
+
+2003-10-18 Jackson Harper <jackson@ximian.com>
+
+ * dis-cil.c (get_encoded_user_string): use g_strescape instead of
+ escaping manually.
+ * util.c (hex_dump): Use uppercase hex so there are no conflicts
+ with ilasm keywords ie cf
+
+2003-10-17 Jackson Harper <jackson@ximian.com>
+
+ * dis-cil.c (get_encoded_user_string): Escape user strings when
+ loading. ie ""quote"" should be "\"quote\"".
+ * dis-cil.c (dissasemble_cil): Write SEH debug info into a comment
+ block. Combine SEH blocks that have the same offset and length,
+ this prevents creating invalid SEH blocks.
+
+2003-10-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * get.c (get_ret_type): Remove needless warning message.
+
+2003-10-13 Jackson Harper <jackson@ximian.com>
+
+ * get.c: stringify nested types properly ie Outer/Inner.
+
+2003-10-10 Jackson Harper <jackson@ximian.com>
+
+ * dump.c: When dumping methodspecs dump the full methodspec with
+ signature, and dump the signature.
+
+2003-10-10 Jackson Harper <jackson@ximian.com>
+
+ * get.c/get.h: Add methods to get stringified methodspecs and
+ method type parameters.
+
+2003-10-09 Jackson Harper <jackson@ximian.com>
+
+ * main.c/get.c: Remove magic numbers, use constants.
+
+2003-10-08 Jackson Harper <jackson@ximian.com>
+
+ * main.c (dis_genericparam): renamed to
+ dis_generic_param_and_constraints, allow a table type to be passed
+ to the method so this could be used with generic methods (It is
+ not though).
+ * get.c/get.h (get_generic_param): method to stringify generic
+ type and method parameters.
+ * get.c (dis_stringify_method_signature): Add generic parameters.
+
+2003-10-08 Jackson Harper <jackson@ximian.com>
+
+ * main.c (dis_type): NULL cnst_block so we dont explode on
+ interfaces.
+ * main.c (dis_genericparam): oops, fix off-by-one error.
+
+2003-10-08 Jackson Harper <jackson@ximian.com>
+
+ * get.c/get.h add method to get a methoddef from an index, simplify
+ get_typd_or_methdef, use new get_methoddef to get the method
+ because we have a method index not a method token.
+
+2003-10-07 Jackson Harper <jackson@ximian.com>
+
+ * main.c: When dis. generic parameters the TypeOrMethodDef token
+ only needs to be shifted 1 bit. Added dis of generic constraints.
+ * get.c/get.h: New method for getting a TypeOrMethodDef token
+ * dump.c: When dumping generic parameters and generic constraints
+ output readable names instead of just tokens.
+
+2003-10-01 Jackson Harper <jackson@latitudegeo.com>
+
+ * main.c: Fix visibility level names, when outputing pinvoke info
+ quote the module and method names, properties have specialname,
+ and rtspecialname flags (nothing else), dis global methods and
+ fields FIXME: indentation issues.
+ * get.h: declare get_fieldref_signature
+ * get.c: Fix unsigned ints (not uint), single quote argument names
+ (this is kinda a hack, ildasm will only single quote arg names
+ that are ilasm keywords), remove fixme, we know what typedbyref
+ means, output fieldref signatures instead of their token value.
+
+2003-09-19 Jackson Harper <jackson@latitudegeo.com>
+
+ * dis-cil.c: Output fault blocks, and filter blocks. If in a
+ filter block outptut 0xDC as endfilter if in a fault output as
+ endfault.
+
+2003-08-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * main.c (dis_event_list): Same for event methods.
+
+ * get.c (dis_stringify_method_signature): New argument specifying
+ whenever to return a fully qualified method name.
+ * dump.c main.c: Updated to work with the new function.
+
+ * main.c (dis_property_methods): Print fully qualified method names
+ for property methods. Fixes #46221.
+
+2003-07-22 Jackson Harper <jackson@latitudegeo.com>
+
+ * main.c: Dissasemble generic type parameters for type
+ definitions. TODO: Sort type parameters by index, and
+ auto-generate names for parameters that have no name.
+
+Fri Jul 18 13:12:38 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * get.c: updates for array type representation changes.
+
+2003-06-16 Jackson Harper <jackson@latitudegeo.com>
+
+ * get.c: Fix modopt and modreq
+
+Thu May 29 12:21:47 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * dump.c, get.c: misc fixes.
+
+Wed May 7 16:50:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * main.c: output custom attributes for method parameters.
+
+Wed May 7 16:24:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * main.c: output nested types inside their nesting class.
+
+2003-04-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * get.c (dis_stringify_modifiers): Print a space between custom modifers.
+ * get.c (get_custom_mod): Handle multiple custom modifiers aka bug #30812.
+ * main.c: Print klass name at the end of each method to make it easier
+ to find a given method.
+
+2003-03-31 Miguel de Icaza <miguel@ximian.com>
+
+ * main.c: Sorted command line options table by name.
+
+ * dump.c: Add support for dumping the new generic tables.
+
+ * monodis.1: Update man page.
+
+2003-03-09 Jackson Harper <jackson@latitudegeo.com>
+
+ * main.c: Ouput implements clause as a comma seperated list.
+
+Thu Feb 6 02:43:23 PST 2003 Piers Haken <piersh@friskit.com>
+
+ * dump.c: more warning cleanups
+
+Mon Jan 27 17:16:50 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * get.c: decode also the size info in get_marshal_info()
+ for ByValStr and ByValArray.
+
+Tue Sep 24 11:48:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * main.c: use mono_type_size () to get the size of
+ a blob of data for a type (Zoltan Varga spotted the bug).
+
+2002-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * get.c: closes bug #30814. Thanks to Zoltan Varga.
+
+Mon Sep 16 18:49:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * main.c, get.c, dump.c: updates for changes in libmetadata.
+
+Fri Sep 13 15:39:41 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * main.c: dump public key.
+ * get.c, util.h, util.c: prettyfy data dumps.
+
+2002-08-28 Dick Porter <dick@ximian.com>
+
+ * Makefile.am: Export HOST_CC for w32 builds
+
+Tue Aug 6 12:40:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * main.c: use mono_image_get_entry_point ().
+
+Fri Jul 26 11:41:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * main.c, dump.h, dump.c: output hash value in File table.
+ Add dumper function for DeclSecurity table.
+
+Fri Jul 19 14:20:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * main.c: handle null parent.
+
+2002-07-02 Martin Baulig <martin@gnome.org>
+
+ * get.c (dis_stringify_object_with_class): New static function to
+ stringify an object when we already have its class.
+ (dis_stringify_object): Get the class and call dis_stringify_object().
+ (get_method): Call dis_stringify_object_with_class() since we already
+ have the object's class.
+
Thu Jun 20 11:50:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
* main.c, dump.c, dump.h: code to dump the MethodImpl table.
diff --git a/mono/dis/Makefile.am b/mono/dis/Makefile.am
index 7cf51142868..2bf93f06d41 100644
--- a/mono/dis/Makefile.am
+++ b/mono/dis/Makefile.am
@@ -1,8 +1,12 @@
INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
+if PLATFORM_WIN32
+export HOST_CC
+endif
+
bin_PROGRAMS = monodis
-lib_LIBRARIES = libmonodis.a
+noinst_LIBRARIES = libmonodis.a
libmonodis_a_SOURCES = \
get.c \
@@ -20,9 +24,10 @@ monodis_SOURCES = \
monodis_LDADD = \
libmonodis.a \
- ../metadata/libmetadata.a \
- ../io-layer/libwapi.a \
- ../utils/libmonoutils.a \
+ ../metadata/libmetadata.la \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ $(LIBGC_LIBS) \
$(GMODULE_LIBS) \
$(GLIB_LIBS)
diff --git a/mono/dis/dis-cil.c b/mono/dis/dis-cil.c
index a250356a0d7..636980fedfb 100644
--- a/mono/dis/dis-cil.c
+++ b/mono/dis/dis-cil.c
@@ -9,7 +9,9 @@
#include <config.h>
#include <glib.h>
#include <stdio.h>
+#ifdef HAVE_WCHAR_H
#include <wchar.h>
+#endif
#include "meta.h"
#include "get.h"
#include "dump.h"
@@ -23,7 +25,7 @@
static char *
get_encoded_user_string (const char *ptr)
{
- char *res;
+ char *res, *result;
int len, i, j;
len = mono_metadata_decode_blob_size (ptr, &ptr);
@@ -36,8 +38,11 @@ get_encoded_user_string (const char *ptr)
res [j] = ptr [i];
res [j] = 0;
-
- return res;
+
+ result = g_strescape (res, NULL);
+ g_free (res);
+
+ return result;
}
#define CODE_INDENT g_assert (indent_level < 512); \
@@ -59,30 +64,59 @@ dissasemble_cil (MonoImage *m, MonoMethodHeader *mh)
const MonoOpcode *entry;
char indent[1024];
int i, indent_level = 0;
- const char *clause_names[] = {"catch", "filter", "finally", "fault"};
-
+ gboolean in_fault = 0;
+ const char *clause_names[] = {"catch", "filter", "finally", "", "fault"};
+ gboolean *trys = NULL;
indent [0] = 0;
#ifdef DEBUG
for (i = 0; i < mh->num_clauses; ++i) {
#define clause mh->clauses [i]
- g_print ("out clause %d: from %d len=%d, handler at %d, %d\n",
+ g_print ("/* out clause %d: from %d len=%d, handler at %d, %d */\n",
clause.flags, clause.try_offset, clause.try_len, clause.handler_offset, clause.handler_len);
#undef clause
}
#endif
+
+ if (mh->num_clauses) {
+ trys = g_malloc0 (sizeof (gboolean) * mh->num_clauses);
+ trys [0] = 1;
+ for (i=1; i < mh->num_clauses; ++i) {
+#define pcl mh->clauses [i-1]
+#define cl mh->clauses [i]
+ if (pcl.try_offset != cl.try_offset || pcl.try_len != cl.try_len)
+ trys [i] = 1;
+#undef pcl
+#undef cl
+ }
+ }
+
while (ptr < end){
for (i = mh->num_clauses - 1; i >= 0 ; --i) {
- if ((mh->clauses[i].flags == 0 || mh->clauses[i].flags == 2) && ptr == start + mh->clauses[i].try_offset) {
+ if (ptr == start + mh->clauses[i].try_offset && trys [i]) {
fprintf (output, "\t%s.try { // %d\n", indent, i);
CODE_INDENT;
}
+
if (ptr == start + mh->clauses[i].handler_offset) {
- char * klass = mh->clauses[i].flags ? g_strdup ("") : dis_stringify_token (m, mh->clauses[i].token_or_filter);
- fprintf (output, "\t%s%s %s { // %d\n", indent, clause_names [mh->clauses[i].flags], klass, i);
+ if (mh->clauses[i].flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ CODE_UNINDENT;
+ fprintf (output, "\t%s} { // %d\n", indent, i);
+ } else {
+ char * klass = mh->clauses[i].flags ? g_strdup ("") :
+ dis_stringify_object_with_class (m, mh->clauses[i].data.catch_class);
+ fprintf (output, "\t%s%s %s { // %d\n", indent,
+ clause_names [mh->clauses[i].flags], klass, i);
+ g_free (klass);
+ }
CODE_INDENT;
- g_free (klass);
- }
+ if (mh->clauses[i].flags == MONO_EXCEPTION_CLAUSE_FAULT)
+ in_fault = 1;
+ }
+ if (mh->clauses[i].flags == MONO_EXCEPTION_CLAUSE_FILTER && ptr == start + mh->clauses[i].data.filter_offset) {
+ fprintf (output, "\t%s%s {\n", indent, clause_names[1]);
+ CODE_INDENT;
+ }
}
fprintf (output, "\t%sIL_%04x: ", indent, (int) (ptr - start));
i = *ptr;
@@ -92,7 +126,10 @@ dissasemble_cil (MonoImage *m, MonoMethodHeader *mh)
}
entry = &mono_opcodes [i];
- fprintf (output, "%s ", mono_opcode_names [i]);
+ if (in_fault && entry->opval == 0xDC)
+ fprintf (output, " %s", "endfault");
+ else
+ fprintf (output, " %s ", mono_opcode_name (i));
ptr++;
switch (entry->argument){
case MonoInlineBrTarget: {
@@ -180,7 +217,7 @@ dissasemble_cil (MonoImage *m, MonoMethodHeader *mh)
ptr += 4;
endswitch = ptr + sizeof (guint32) * count;
- fprintf (output, "(\n");
+ fprintf (output, count > 0 ? "(\n" : "( )");
CODE_INDENT;
for (n = 0; n < count; n++){
fprintf (output, "\t%sIL_%04x%s", indent,
@@ -259,14 +296,18 @@ dissasemble_cil (MonoImage *m, MonoMethodHeader *mh)
fprintf (output, "\n");
for (i = 0; i < mh->num_clauses; ++i) {
- if ((mh->clauses[i].flags == 0 || mh->clauses[i].flags == 2) && ptr == start + mh->clauses[i].try_offset + mh->clauses[i].try_len) {
+ if (ptr == start + mh->clauses[i].try_offset + mh->clauses[i].try_len && trys [i]) {
CODE_UNINDENT;
fprintf (output, "\t%s} // end .try %d\n", indent, i);
}
if (ptr == start + mh->clauses[i].handler_offset + mh->clauses[i].handler_len) {
CODE_UNINDENT;
fprintf (output, "\t%s} // end handler %d\n", indent, i);
+ if (mh->clauses[i].flags == MONO_EXCEPTION_CLAUSE_FAULT)
+ in_fault = 0;
}
}
}
+ if (trys)
+ g_free (trys);
}
diff --git a/mono/dis/dump.c b/mono/dis/dump.c
index 0e00455ec63..e3dc453000e 100644
--- a/mono/dis/dump.c
+++ b/mono/dis/dump.c
@@ -25,9 +25,13 @@ dump_table_assembly (MonoImage *m)
const char *ptr;
int len;
- mono_metadata_decode_row (t, 0, cols, MONO_ASSEMBLY_SIZE);
fprintf (output, "Assembly Table\n");
+ if (!t->rows)
+ return;
+
+ mono_metadata_decode_row (t, 0, cols, MONO_ASSEMBLY_SIZE);
+
fprintf (output, "Name: %s\n", mono_metadata_string_heap (m, cols [MONO_ASSEMBLY_NAME]));
fprintf (output, "Hash Algoritm: 0x%08x\n", cols [MONO_ASSEMBLY_HASH_ALG]);
fprintf (output, "Version: %d.%d.%d.%d\n", cols [MONO_ASSEMBLY_MAJOR_VERSION],
@@ -90,6 +94,23 @@ dump_table_typedef (MonoImage *m)
}
void
+dump_table_typespec (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_TYPESPEC];
+ int i;
+
+ fprintf (output, "Typespec Table\n");
+
+ for (i = 1; i <= t->rows; i++){
+ char *typespec = get_typespec (m, i);
+
+ fprintf (output, "%d: %s\n", i, typespec);
+ g_free (typespec);
+ }
+ fprintf (output, "\n");
+}
+
+void
dump_table_assemblyref (MonoImage *m)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_ASSEMBLYREF];
@@ -133,7 +154,7 @@ dump_table_param (MonoImage *m)
for (i = 0; i < t->rows; i++){
guint32 cols [MONO_PARAM_SIZE];
- mono_metadata_decode_row (t, i, cols, CSIZE (cols));
+ mono_metadata_decode_row (t, i, cols, MONO_PARAM_SIZE);
fprintf (output, "%d: 0x%04x %d %s\n",
i + 1,
cols [MONO_PARAM_FLAGS], cols [MONO_PARAM_SEQUENCE],
@@ -201,7 +222,7 @@ dump_table_memberref (MonoImage *m)
int i, kind, idx;
char *x, *xx;
char *sig;
- const char *blob, *ks;
+ const char *blob, *ks = NULL;
fprintf (output, "MemberRef Table (1..%d)\n", t->rows);
@@ -217,7 +238,11 @@ dump_table_memberref (MonoImage *m)
switch (kind){
case 0:
- ks = "TypeDef"; break;
+ ks = "TypeDef";
+ xx = get_typedef (m, idx);
+ x = g_strconcat (xx, ".", mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]), NULL);
+ g_free (xx);
+ break;
case 1:
ks = "TypeRef";
xx = get_typeref (m, idx);
@@ -227,7 +252,9 @@ dump_table_memberref (MonoImage *m)
case 2:
ks = "ModuleRef"; break;
case 3:
- ks = "MethodDef"; break;
+ ks = "MethodDef";
+ x = get_methoddef (m, idx);
+ break;
case 4:
ks = "TypeSpec";
xx = get_typespec (m, idx);
@@ -267,7 +294,7 @@ dump_table_class_layout (MonoImage *m)
for (i = 0; i < t->rows; i++){
guint32 cols [MONO_CLASS_LAYOUT_SIZE];
- mono_metadata_decode_row (t, i, cols, CSIZE (cols));
+ mono_metadata_decode_row (t, i, cols, MONO_CLASS_LAYOUT_SIZE);
fprintf (output, "%d: PackingSize=%d ClassSize=%d Parent=%s\n",
i + 1, cols [MONO_CLASS_LAYOUT_PACKING_SIZE],
@@ -291,12 +318,12 @@ dump_table_constant (MonoImage *m)
for (i = 0; i < t->rows; i++){
guint32 cols [MONO_CONSTANT_SIZE];
- const char *parent = desc [cols [MONO_CONSTANT_PARENT] & HASCONSTANT_MASK];
-
+ const char *parent;
mono_metadata_decode_row (t, i, cols, MONO_CONSTANT_SIZE);
+ parent = desc [cols [MONO_CONSTANT_PARENT] & MONO_HASCONSTANT_MASK];
fprintf (output, "%d: Parent= %s: %d %s\n",
- i + 1, parent, cols [MONO_CONSTANT_PARENT] >> HASCONSTANT_BITS,
+ i + 1, parent, cols [MONO_CONSTANT_PARENT] >> MONO_HASCONSTANT_BITS,
get_constant (m, (MonoTypeEnum) cols [MONO_CONSTANT_TYPE], cols [MONO_CONSTANT_VALUE]));
}
@@ -316,7 +343,7 @@ dump_table_property_map (MonoImage *m)
mono_metadata_decode_row (t, i, cols, MONO_PROPERTY_MAP_SIZE);
s = get_typedef (m, cols [MONO_PROPERTY_MAP_PARENT]);
- fprintf (output, "%d: %s %d\n", i + 1, s, cols [MONO_PROPERTY_MAP_PROPERTY_LIST]);
+ fprintf (output, "%d: %s (%d) %d\n", i + 1, s, cols [MONO_PROPERTY_MAP_PARENT], cols [MONO_PROPERTY_MAP_PROPERTY_LIST]);
g_free (s);
}
}
@@ -395,18 +422,23 @@ void
dump_table_file (MonoImage *m)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_FILE];
- int i;
+ int i, j, len;
fprintf (output, "File Table (1..%d)\n", t->rows);
for (i = 0; i < t->rows; i++){
guint32 cols [MONO_FILE_SIZE];
- const char *name;
+ const char *name, *hash;
mono_metadata_decode_row (t, i, cols, MONO_FILE_SIZE);
name = mono_metadata_string_heap (m, cols [MONO_FILE_NAME]);
- fprintf (output, "%d: %s %s\n", i + 1, name,
+ fprintf (output, "%d: %s %s [", i + 1, name,
cols [MONO_FILE_FLAGS] & 0x1 ? "nometadata" : "containsmetadata");
+ hash = mono_metadata_blob_heap (m, cols [MONO_FILE_HASH_VALUE]);
+ len = mono_metadata_decode_blob_size (hash, &hash);
+ for (j = 0; j < len; ++j)
+ fprintf (output, "%s%02X", j? " ": "", hash [j] & 0xff);
+ fprintf (output, "]\n");
}
}
@@ -418,15 +450,17 @@ get_manifest_implementation (MonoImage *m, guint32 idx)
const char* table = "";
if (!idx)
return g_strdup ("current module");
- row = idx >> IMPLEMENTATION_BITS;
- switch (idx & IMPLEMENTATION_MASK) {
- case IMPLEMENTATION_FILE:
+ row = idx >> MONO_IMPLEMENTATION_BITS;
+ switch (idx & MONO_IMPLEMENTATION_MASK) {
+ case MONO_IMPLEMENTATION_FILE:
table = "file";
break;
- case IMPLEMENTATION_ASSEMBLYREF:
+ case MONO_IMPLEMENTATION_ASSEMBLYREF:
table = "assemblyref";
break;
- case IMPLEMENTATION_EXP_TYPE:
+ case MONO_IMPLEMENTATION_EXP_TYPE:
+ table = "exportedtype";
+ break;
default:
g_assert_not_reached ();
}
@@ -504,8 +538,7 @@ dump_table_module (MonoImage *m)
name = mono_metadata_string_heap (m, cols [MONO_MODULE_NAME]);
guid = get_guid (m, cols [MONO_MODULE_MVID]);
fprintf (output, "%d: %s %d %s\n", i + 1, name, cols [MONO_MODULE_MVID], guid);
- }
-
+ }
}
void
@@ -540,8 +573,8 @@ dump_table_method (MonoImage *m)
mono_metadata_decode_row (t, i - 1, cols, MONO_METHOD_SIZE);
sigblob = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
mono_metadata_decode_blob_size (sigblob, &sigblob);
- method = mono_metadata_parse_method_signature (m, 1, sigblob, &sigblob);
- sig = dis_stringify_method_signature (m, method, i);
+ method = mono_metadata_parse_method_signature (m, i, sigblob, &sigblob);
+ sig = dis_stringify_method_signature (m, method, i, FALSE);
fprintf (output, "%d: %s (param: %d)\n", i, sig, cols [MONO_METHOD_PARAMLIST]);
g_free (sig);
mono_metadata_free_method_signature (method);
@@ -549,22 +582,36 @@ dump_table_method (MonoImage *m)
}
-static guint32
-method_dor_to_token (guint32 idx) {
- switch (idx & METHODDEFORREF_MASK) {
- case METHODDEFORREF_METHODDEF:
- return MONO_TOKEN_METHOD_DEF | (idx >> METHODDEFORREF_BITS);
- case METHODDEFORREF_METHODREF:
- return MONO_TOKEN_MEMBER_REF | (idx >> METHODDEFORREF_BITS);
+void
+dump_table_implmap (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_IMPLMAP];
+ MonoTableInfo *td = &m->tables [MONO_TABLE_MODULEREF];
+ int i;
+
+ fprintf (output, "ImplMap Table (1..%d)\n", t->rows);
+
+ for (i = 1; i <= t->rows; i++){
+ guint32 cols [MONO_IMPLMAP_SIZE];
+ char *method;
+
+ mono_metadata_decode_row (t, i - 1, cols, MONO_IMPLMAP_SIZE);
+
+ method = get_method (m, MONO_TOKEN_METHOD_DEF | (cols [MONO_IMPLMAP_MEMBER] >> MONO_MEMBERFORWD_BITS));
+
+ fprintf (output, "%d: %s %d (%s %s)\n", i,
+ method,
+ cols [MONO_IMPLMAP_FLAGS],
+ mono_metadata_string_heap (m, cols [MONO_IMPLMAP_NAME]),
+ mono_metadata_string_heap (m, mono_metadata_decode_row_col (td, cols [MONO_IMPLMAP_SCOPE] - 1, MONO_MODULEREF_NAME)));
}
- return -1;
}
void
dump_table_methodimpl (MonoImage *m)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_METHODIMPL];
- MonoTableInfo *td = &m->tables [MONO_TABLE_TYPEDEF];
+ /*MonoTableInfo *td = &m->tables [MONO_TABLE_TYPEDEF];*/
int i;
fprintf (output, "MethodImpl Table (1..%d)\n", t->rows);
@@ -585,7 +632,7 @@ dump_table_methodimpl (MonoImage *m)
}
-static map_t semantics_map [] = {
+static dis_map_t semantics_map [] = {
{1, "setter"},
{2, "getter"},
{4, "other"},
@@ -608,8 +655,8 @@ dump_table_methodsem (MonoImage *m)
mono_metadata_decode_row (t, i - 1, cols, MONO_METHOD_SEMA_SIZE);
semantics = flags (cols [MONO_METHOD_SEMA_SEMANTICS], semantics_map);
- is_property = cols [MONO_METHOD_SEMA_ASSOCIATION] & HAS_SEMANTICS_MASK;
- index = cols [MONO_METHOD_SEMA_ASSOCIATION] >> HAS_SEMANTICS_BITS;
+ is_property = cols [MONO_METHOD_SEMA_ASSOCIATION] & MONO_HAS_SEMANTICS_MASK;
+ index = cols [MONO_METHOD_SEMA_ASSOCIATION] >> MONO_HAS_SEMANTICS_BITS;
fprintf (output, "%d: [%d] %s method: %d %s %d\n", i, cols [MONO_METHOD_SEMA_ASSOCIATION], semantics,
cols [MONO_METHOD_SEMA_METHOD] - 1,
is_property? "property" : "event",
@@ -637,66 +684,66 @@ dump_table_interfaceimpl (MonoImage *m)
static char*
has_cattr_get_table (MonoImage *m, guint32 val)
{
- guint32 t = val & CUSTOM_ATTR_MASK;
- guint32 index = val >> CUSTOM_ATTR_BITS;
+ guint32 t = val & MONO_CUSTOM_ATTR_MASK;
+ guint32 index = val >> MONO_CUSTOM_ATTR_BITS;
const char *table;
switch (t) {
- case CUSTOM_ATTR_METHODDEF:
+ case MONO_CUSTOM_ATTR_METHODDEF:
table = "MethodDef";
break;
- case CUSTOM_ATTR_FIELDDEF:
+ case MONO_CUSTOM_ATTR_FIELDDEF:
table = "FieldDef";
break;
- case CUSTOM_ATTR_TYPEREF:
+ case MONO_CUSTOM_ATTR_TYPEREF:
table = "TypeRef";
break;
- case CUSTOM_ATTR_TYPEDEF:
+ case MONO_CUSTOM_ATTR_TYPEDEF:
table = "TypeDef";
break;
- case CUSTOM_ATTR_PARAMDEF:
+ case MONO_CUSTOM_ATTR_PARAMDEF:
table = "Param";
break;
- case CUSTOM_ATTR_INTERFACE:
+ case MONO_CUSTOM_ATTR_INTERFACE:
table = "InterfaceImpl";
break;
- case CUSTOM_ATTR_MEMBERREF:
+ case MONO_CUSTOM_ATTR_MEMBERREF:
table = "MemberRef";
break;
- case CUSTOM_ATTR_MODULE:
+ case MONO_CUSTOM_ATTR_MODULE:
table = "Module";
break;
- case CUSTOM_ATTR_PERMISSION:
+ case MONO_CUSTOM_ATTR_PERMISSION:
table = "DeclSecurity?";
break;
- case CUSTOM_ATTR_PROPERTY:
+ case MONO_CUSTOM_ATTR_PROPERTY:
table = "Property";
break;
- case CUSTOM_ATTR_EVENT:
+ case MONO_CUSTOM_ATTR_EVENT:
table = "Event";
break;
- case CUSTOM_ATTR_SIGNATURE:
+ case MONO_CUSTOM_ATTR_SIGNATURE:
table = "StandAloneSignature";
break;
- case CUSTOM_ATTR_MODULEREF:
+ case MONO_CUSTOM_ATTR_MODULEREF:
table = "ModuleRef";
break;
- case CUSTOM_ATTR_TYPESPEC:
+ case MONO_CUSTOM_ATTR_TYPESPEC:
table = "TypeSpec";
break;
- case CUSTOM_ATTR_ASSEMBLY:
+ case MONO_CUSTOM_ATTR_ASSEMBLY:
table = "Assembly";
break;
- case CUSTOM_ATTR_ASSEMBLYREF:
+ case MONO_CUSTOM_ATTR_ASSEMBLYREF:
table = "AssemblyRef";
break;
- case CUSTOM_ATTR_FILE:
+ case MONO_CUSTOM_ATTR_FILE:
table = "File";
break;
- case CUSTOM_ATTR_EXP_TYPE:
+ case MONO_CUSTOM_ATTR_EXP_TYPE:
table = "ExportedType";
break;
- case CUSTOM_ATTR_MANIFEST:
+ case MONO_CUSTOM_ATTR_MANIFEST:
table = "Manifest";
break;
default:
@@ -785,8 +832,8 @@ handle_enum:
break;
}
case MONO_TYPE_VALUETYPE:
- if (sig->params [i]->data.klass->enumtype) {
- type = sig->params [i]->data.klass->enum_basetype->type;
+ if (mono_class_is_enum (sig->params [i]->data.klass)) {
+ type = mono_class_enum_basetype (sig->params [i]->data.klass)->type;
goto handle_enum;
} else {
g_warning ("generic valutype not handled in custom attr value decoding");
@@ -794,6 +841,11 @@ handle_enum:
break;
case MONO_TYPE_CLASS: /* It must be a Type: check? */
case MONO_TYPE_STRING:
+ if (*p == (char)0xff) {
+ g_string_append (res, "null");
+ p++;
+ break;
+ }
slen = mono_metadata_decode_value (p, &p);
g_string_append_c (res, '"');
g_string_append (res, p);
@@ -836,12 +888,12 @@ dump_table_customattr (MonoImage *m)
mono_metadata_decode_row (t, i - 1, cols, MONO_CUSTOM_ATTR_SIZE);
desc = has_cattr_get_table (m, cols [MONO_CUSTOM_ATTR_PARENT]);
- mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> CUSTOM_ATTR_TYPE_BITS;
- switch (cols [MONO_CUSTOM_ATTR_TYPE] & CUSTOM_ATTR_TYPE_MASK) {
- case CUSTOM_ATTR_TYPE_METHODDEF:
+ mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> MONO_CUSTOM_ATTR_TYPE_BITS;
+ switch (cols [MONO_CUSTOM_ATTR_TYPE] & MONO_CUSTOM_ATTR_TYPE_MASK) {
+ case MONO_CUSTOM_ATTR_TYPE_METHODDEF:
mtoken |= MONO_TOKEN_METHOD_DEF;
break;
- case CUSTOM_ATTR_TYPE_MEMBERREF:
+ case MONO_CUSTOM_ATTR_TYPE_MEMBERREF:
mtoken |= MONO_TOKEN_MEMBER_REF;
break;
default:
@@ -850,7 +902,7 @@ dump_table_customattr (MonoImage *m)
}
method = get_method (m, mtoken);
meth = mono_get_method (m, mtoken, NULL);
- params = custom_attr_params (m, meth->signature, mono_metadata_blob_heap (m, cols [MONO_CUSTOM_ATTR_VALUE]));
+ params = custom_attr_params (m, mono_method_signature (meth), mono_metadata_blob_heap (m, cols [MONO_CUSTOM_ATTR_VALUE]));
fprintf (output, "%d: %s: %s [%s]\n", i, desc, method, params);
g_free (desc);
g_free (method);
@@ -887,13 +939,18 @@ dump_table_exported (MonoImage *m)
guint32 cols [MONO_EXP_TYPE_SIZE];
int i;
const char *name, *nspace;
+ char *impl;
+ guint32 index;
fprintf (output, "ExportedType Table (1..%d)\n", t->rows);
for (i = 1; i <= t->rows; i++) {
mono_metadata_decode_row (t, i - 1, cols, MONO_EXP_TYPE_SIZE);
name = mono_metadata_string_heap (m, cols [MONO_EXP_TYPE_NAME]);
nspace = mono_metadata_string_heap (m, cols [MONO_EXP_TYPE_NAMESPACE]);
- fprintf (output, "%d: %s %s\n", i, name, nspace);
+ impl = get_manifest_implementation (m, cols [MONO_EXP_TYPE_IMPLEMENTATION]);
+ index = cols [MONO_EXP_TYPE_TYPEDEF];
+ fprintf (output, "%d: %s%s%s is in %s, token %x\n", i, nspace, *nspace ? "." : "", name, impl, index);
+ g_free (impl);
}
}
@@ -913,11 +970,198 @@ dump_table_field_marshal (MonoImage *m)
mono_metadata_decode_row (t, i - 1, cols, MONO_FIELD_MARSHAL_SIZE);
blob = mono_metadata_blob_heap (m, cols [MONO_FIELD_MARSHAL_NATIVE_TYPE]);
native = get_marshal_info (m, blob);
- is_field = (cols [MONO_FIELD_MARSHAL_PARENT] & HAS_FIELD_MARSHAL_MASK) == HAS_FIELD_MARSHAL_FIELDSREF;
- idx = cols [MONO_FIELD_MARSHAL_PARENT] >> HAS_FIELD_MARSHAL_BITS;
+ is_field = (cols [MONO_FIELD_MARSHAL_PARENT] & MONO_HAS_FIELD_MARSHAL_MASK) == MONO_HAS_FIELD_MARSHAL_FIELDSREF;
+ idx = cols [MONO_FIELD_MARSHAL_PARENT] >> MONO_HAS_FIELD_MARSHAL_BITS;
fprintf (output, "%d: (0x%04x) %s %d: %s\n", i, cols [MONO_FIELD_MARSHAL_PARENT], is_field? "Field" : "Param", idx, native);
g_free (native);
}
}
+static const char*
+get_security_action (int val) {
+ static char buf [32];
+
+ switch (val) {
+ case SECURITY_ACTION_DEMAND:
+ return "Demand";
+ case SECURITY_ACTION_ASSERT:
+ return "Assert";
+ case SECURITY_ACTION_DENY:
+ return "Deny";
+ case SECURITY_ACTION_PERMITONLY:
+ return "PermitOnly";
+ case SECURITY_ACTION_LINKDEMAND:
+ return "LinkDemand";
+ case SECURITY_ACTION_INHERITDEMAND:
+ return "InheritanceDemand";
+ case SECURITY_ACTION_REQMIN:
+ return "RequestMinimum";
+ case SECURITY_ACTION_REQOPT:
+ return "RequestOptional";
+ case SECURITY_ACTION_REQREFUSE:
+ return "RequestRefuse";
+ /* Special actions (for non CAS permissions) */
+ case SECURITY_ACTION_NONCASDEMAND:
+ return "NonCasDemand";
+ case SECURITY_ACTION_NONCASLINKDEMAND:
+ return "NonCasLinkDemand";
+ case SECURITY_ACTION_NONCASINHERITANCE:
+ return "NonCasInheritance";
+ /* Fx 2.0 actions (for both CAS and non-CAS permissions) */
+ case SECURITY_ACTION_LINKDEMANDCHOICE:
+ return "LinkDemandChoice";
+ case SECURITY_ACTION_INHERITDEMANDCHOICE:
+ return "InheritanceDemandChoice";
+ case SECURITY_ACTION_DEMANDCHOICE:
+ return "DemandChoice";
+ default:
+ g_snprintf (buf, sizeof (buf), "0x%04X", val);
+ return buf;
+ }
+}
+
+void
+dump_table_declsec (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_DECLSECURITY];
+ guint32 cols [MONO_DECL_SECURITY_SIZE];
+ int i, len;
+ guint32 idx;
+ const char *blob, *action;
+ const char* parent[] = {
+ "TypeDef", "MethodDef", "Assembly", ""
+ };
+
+ fprintf (output, "DeclSecurity Table (1..%d)\n", t->rows);
+
+ for (i = 1; i <= t->rows; i++) {
+ mono_metadata_decode_row (t, i - 1, cols, MONO_DECL_SECURITY_SIZE);
+ blob = mono_metadata_blob_heap (m, cols [MONO_DECL_SECURITY_PERMISSIONSET]);
+ len = mono_metadata_decode_blob_size (blob, &blob);
+ action = get_security_action (cols [MONO_DECL_SECURITY_ACTION]);
+ idx = cols [MONO_DECL_SECURITY_PARENT];
+ fprintf (output, "%d: %s on %s %d%s", i, action, parent [idx & MONO_HAS_DECL_SECURITY_MASK], idx >> MONO_HAS_DECL_SECURITY_BITS, len? ":\n\t":"\n");
+ if (!len)
+ continue;
+ for (idx = 0; idx < len; ++idx)
+ fprintf (output, "%c", blob [idx]);
+ fprintf (output, "\n");
+ }
+}
+
+void
+dump_table_genericpar (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_GENERICPARAM];
+ guint32 cols [MONO_GENERICPARAM_SIZE];
+ int i;
+
+ fprintf (output, "GenericParameters (1..%d)\n", t->rows);
+
+ for (i = 1; i <= t->rows; i++) {
+ char *sig;
+ mono_metadata_decode_row (t, i - 1, cols, MONO_GENERICPARAM_SIZE);
+
+ sig = get_type_or_methdef (m, cols [MONO_GENERICPARAM_OWNER]);
+ fprintf (output, "%d: %d, flags=%d, owner=%s %s\n", i,
+ cols [MONO_GENERICPARAM_NUMBER],
+ cols [MONO_GENERICPARAM_FLAGS], sig,
+ mono_metadata_string_heap (m, cols [MONO_GENERICPARAM_NAME]));
+ g_free (sig);
+ }
+}
+
+void
+dump_table_methodspec (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_METHODSPEC];
+ guint32 cols [MONO_METHODSPEC_SIZE];
+ int i;
+
+ fprintf (output, "MethodSpec (1..%d)\n", t->rows);
+
+ for (i = 1; i <= t->rows; i++) {
+ char *sig;
+ char *method;
+ guint32 token;
+
+ mono_metadata_decode_row (t, i - 1, cols, MONO_METHODSPEC_SIZE);
+
+ /* build a methodspec token to get the method */
+ token = MONO_TOKEN_METHOD_SPEC | i;
+ method = get_method (m, token);
+
+ sig = get_method_type_param (m, cols [MONO_METHODSPEC_SIGNATURE]);
+ fprintf (output, "%d: %s, %s\n", i, method, sig);
+ g_free (sig);
+ g_free (method);
+ }
+}
+
+void
+dump_table_parconstraint (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_GENERICPARAMCONSTRAINT];
+ guint32 cols [MONO_GENPARCONSTRAINT_SIZE];
+ int i;
+
+ fprintf (output, "Generic Param Constraint (1..%d)\n", t->rows);
+
+ for (i = 1; i <= t->rows; i++) {
+ char *sig;
+ mono_metadata_decode_row (t, i - 1, cols, MONO_GENPARCONSTRAINT_SIZE);
+
+ sig = get_typedef_or_ref (m, cols [MONO_GENPARCONSTRAINT_CONSTRAINT]);
+ fprintf (output, "%d: gen-par=%d, Constraint=%s\n", i,
+ cols [MONO_GENPARCONSTRAINT_GENERICPAR], sig);
+ g_free (sig);
+ }
+}
+
+void
+dump_stream_blob (MonoImage *m)
+{
+ int i;
+
+ fprintf (output, "Blob heap contents\n");
+
+ for (i = 0; i < m->heap_blob.size; i++) {
+ if (i > 0) {
+ if ((i % 16) == 0)
+ fprintf (output, "\n");
+ else if ((i % 8) == 0)
+ fprintf (output, "- ");
+ }
+ fprintf (output, "%02x ", m->heap_blob.data [i] & 0xff);
+ }
+
+ fprintf (output, "\n");
+}
+
+void
+dump_table_standalonesig (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_STANDALONESIG];
+ guint32 cols [MONO_STAND_ALONE_SIGNATURE_SIZE];
+ int i;
+
+ fprintf (output, "Stand alone signature (1..%d)\n", t->rows);
+
+ for (i = 1; i <= t->rows; i++) {
+ const char *locals_ptr;
+ int j, bsize;
+
+ mono_metadata_decode_row (t, i - 1, cols, MONO_STAND_ALONE_SIGNATURE_SIZE);
+
+ locals_ptr = mono_metadata_blob_heap (m, cols [MONO_STAND_ALONE_SIGNATURE]);
+ bsize = mono_metadata_decode_blob_size (locals_ptr, &locals_ptr);
+
+ fprintf (output, "%d: blob[0x%x] = ", i, cols [MONO_STAND_ALONE_SIGNATURE]);
+
+ for (j = 0; j < bsize; j++) {
+ fprintf (output, "%02x ", locals_ptr [j]);
+ }
+ fprintf (output, "\n");
+ }
+}
diff --git a/mono/dis/dump.h b/mono/dis/dump.h
index 351cfbe3d79..44f95be3f7a 100644
--- a/mono/dis/dump.h
+++ b/mono/dis/dump.h
@@ -5,6 +5,7 @@ void dump_table_assemblyref (MonoImage *m);
void dump_table_class_layout (MonoImage *m);
void dump_table_constant (MonoImage *m);
void dump_table_customattr (MonoImage *m);
+void dump_table_declsec (MonoImage *m);
void dump_table_property (MonoImage *m);
void dump_table_property_map (MonoImage *m);
void dump_table_event (MonoImage *m);
@@ -20,7 +21,14 @@ void dump_table_memberref (MonoImage *m);
void dump_table_param (MonoImage *m);
void dump_table_typedef (MonoImage *m);
void dump_table_typeref (MonoImage *m);
+void dump_table_typespec (MonoImage *m);
void dump_table_exported (MonoImage *m);
void dump_table_nestedclass (MonoImage *m);
void dump_table_interfaceimpl (MonoImage *m);
void dump_table_field_marshal (MonoImage *m);
+void dump_table_genericpar (MonoImage *m);
+void dump_table_methodspec (MonoImage *m);
+void dump_table_parconstraint(MonoImage *m);
+void dump_table_implmap (MonoImage *m);
+void dump_table_standalonesig (MonoImage *m);
+void dump_stream_blob (MonoImage *m);
diff --git a/mono/dis/get.c b/mono/dis/get.c
index 18d0540403c..7aaa0ba29c0 100644
--- a/mono/dis/get.c
+++ b/mono/dis/get.c
@@ -20,18 +20,54 @@
extern gboolean substitute_with_mscorlib_p;
+static char *
+get_memberref_parent (MonoImage *m, guint32 mrp_token);
+
+GHashTable *key_table = NULL;
+gboolean show_method_tokens = FALSE;
+gboolean show_tokens = FALSE;
+
char *
get_typedef (MonoImage *m, int idx)
{
guint32 cols [MONO_TYPEDEF_SIZE];
const char *ns;
-
+ char *tstring, *result, *ename;
+ guint32 token;
+
mono_metadata_decode_row (&m->tables [MONO_TABLE_TYPEDEF], idx - 1, cols, MONO_TYPEDEF_SIZE);
- ns = mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAMESPACE]);
- return g_strdup_printf (
- "%s%s%s", ns, *ns?".":"",
- mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAME]));
+ ns = mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAMESPACE]);
+
+ /* Check if this is a nested type */
+ token = MONO_TOKEN_TYPE_DEF | (idx);
+ token = mono_metadata_nested_in_typedef (m, token);
+ tstring = show_tokens ? g_strdup_printf ("/*%08x*/", token) : NULL;
+ if (token) {
+ char *outer;
+
+ outer = get_typedef (m, mono_metadata_token_index (token));
+ result = g_strdup_printf (
+ "%s%s%s/%s%s", ns, *ns?".":"", outer,
+ mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAME]),
+ tstring ? tstring : "");
+ ename = get_escaped_name (result);
+ g_free (result);
+ g_free (outer);
+ g_free (tstring);
+ return ename;
+ }
+
+
+ result = g_strdup_printf (
+ "%s%s%s%s", ns, *ns?".":"",
+ mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAME]),
+ tstring ? tstring : "");
+ ename = get_escaped_name (result);
+ g_free (result);
+ g_free (tstring);
+
+ return ename;
}
char *
@@ -50,6 +86,16 @@ get_module (MonoImage *m, int idx)
}
char *
+get_moduleref (MonoImage *m, int idx)
+{
+ guint32 cols [MONO_MODULEREF_SIZE];
+
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_MODULEREF], idx - 1, cols, MONO_MODULEREF_SIZE);
+
+ return g_strdup (mono_metadata_string_heap (m, cols [MONO_MODULEREF_NAME]));
+}
+
+char *
get_assemblyref (MonoImage *m, int idx)
{
guint32 cols [MONO_ASSEMBLYREF_SIZE];
@@ -132,6 +178,10 @@ get_typespec (MonoImage *m, guint32 idx)
GString *res = g_string_new ("");
int len;
+ MonoType *type;
+
+ type = mono_type_create_from_typespec (m, idx);
+
mono_metadata_decode_row (&m->tables [MONO_TABLE_TYPESPEC], idx-1, cols, MONO_TYPESPEC_SIZE);
ptr = mono_metadata_blob_heap (m, cols [MONO_TYPESPEC_SIGNATURE]);
len = mono_metadata_decode_value (ptr, &ptr);
@@ -152,17 +202,14 @@ get_typespec (MonoImage *m, guint32 idx)
if (s)
g_string_append (res, s);
}
+ g_string_append (res, "*");
break;
case MONO_TYPE_FNPTR:
- g_string_append (res, "FNPTR ");
- /*
- * we assume MethodRefSig, as we do not know
- * whether it is a MethodDefSig or a MethodRefSig.
- */
- printf ("\n FNPTR:\n");
-
- hex_dump (ptr, 0, 40);
+ s = dis_stringify_function_ptr (m, type->data.method);
+ g_string_append (res, "method ");
+ g_string_append (res, s);
+ g_free (s);
break;
case MONO_TYPE_ARRAY:
@@ -186,9 +233,28 @@ get_typespec (MonoImage *m, guint32 idx)
g_string_append (res, s);
g_string_append (res, "[]");
g_free (s);
+ break;
+
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ ptr = get_type (m, ptr-1, &s);
+ g_string_append (res, s);
+ g_free (s);
+ break;
+
+ default:
+ s = dis_stringify_type (m, type);
+ g_string_append (res, s);
+ g_free (s);
+ break;
}
- result = res->str;
+ if (show_tokens) {
+ int token = mono_metadata_make_token (MONO_TABLE_TYPESPEC, idx);
+ result = g_strdup_printf ("%s/*%08x*/", res->str, token);
+ } else
+ result = res->str;
+
g_string_free (res, FALSE);
return result;
@@ -207,21 +273,22 @@ get_typeref (MonoImage *m, int idx)
t = mono_metadata_string_heap (m, cols [MONO_TYPEREF_NAME]);
s = mono_metadata_string_heap (m, cols [MONO_TYPEREF_NAMESPACE]);
- rs_idx = cols [MONO_TYPEREF_SCOPE] >> RESOLTION_SCOPE_BITS;
- table = cols [MONO_TYPEREF_SCOPE] & RESOLTION_SCOPE_MASK;
+ rs_idx = cols [MONO_TYPEREF_SCOPE] >> MONO_RESOLTION_SCOPE_BITS;
+ table = cols [MONO_TYPEREF_SCOPE] & MONO_RESOLTION_SCOPE_MASK;
switch (table){
- case RESOLTION_SCOPE_MODULE: /* Module */
+ case MONO_RESOLTION_SCOPE_MODULE: /* Module */
x = get_module (m, rs_idx);
ret = g_strdup_printf ("[%s] %s%s%s", x, s, *s?".":"", t);
g_free (x);
break;
- case RESOLTION_SCOPE_MODULEREF: /* ModuleRef */
- ret = g_strdup_printf ("TODO:TypeRef-ModuleRef (%s.%s)", s, t);
+ case MONO_RESOLTION_SCOPE_MODULEREF: /* ModuleRef */
+ x = get_moduleref (m, rs_idx);
+ ret = g_strdup_printf ("[.module %s]%s%s%s", x, s, *s ? "." : "", t);
break;
- case RESOLTION_SCOPE_ASSEMBLYREF: /*
+ case MONO_RESOLTION_SCOPE_ASSEMBLYREF: /*
* AssemblyRef (ECMA docs claim it is 3, but it looks to
* me like it is 2 (tokens are prefixed with 0x23)
*/
@@ -230,7 +297,7 @@ get_typeref (MonoImage *m, int idx)
g_free (x);
break;
- case RESOLTION_SCOPE_TYPEREF: /* TypeRef */
+ case MONO_RESOLTION_SCOPE_TYPEREF: /* TypeRef */
x = get_typeref (m, rs_idx);
ret = g_strdup_printf ("%s/%s", x, t);
g_free (x);
@@ -240,6 +307,13 @@ get_typeref (MonoImage *m, int idx)
ret = g_strdup_printf ("Unknown table in TypeRef %d", table);
}
+ if (show_tokens) {
+ int token = mono_metadata_make_token (MONO_TABLE_TYPEREF, idx);
+ char *temp = g_strdup_printf ("%s/*%08x*/", ret, token);
+ g_free (ret);
+ ret = temp;
+ }
+
return ret;
}
@@ -257,14 +331,14 @@ get_typeref (MonoImage *m, int idx)
char *
get_typedef_or_ref (MonoImage *m, guint32 dor_token)
{
- char *temp = NULL, *s;
+ char *temp = NULL, *s = NULL;
int table, idx;
/*
* low 2 bits contain encoding
*/
- table = dor_token & 0x03;
- idx = dor_token >> 2;
+ table = dor_token & MONO_TYPEDEFORREF_MASK;
+ idx = dor_token >> MONO_TYPEDEFORREF_BITS;
switch (table){
case 0: /* TypeDef */
@@ -292,6 +366,25 @@ get_typedef_or_ref (MonoImage *m, guint32 dor_token)
return s;
}
+/**
+ * get_type_or_methdef
+ * @m: metadata context
+ * @dor_token: type or method def encoded index
+ *
+ * Low bit contains the table to lookup from
+ * high bits contain the index into the type def or method def table
+ *
+ * Returns: a stringified version of the TypeOrMethodDef token
+ */
+char *
+get_type_or_methdef (MonoImage *m, guint32 dor_token)
+{
+ if (dor_token & MONO_TYPEORMETHOD_METHOD) /* MethodDef */
+ return get_methoddef (m, dor_token >> MONO_TYPEORMETHOD_BITS);
+ else /* TypeDef */
+ return get_typedef (m, dor_token >> MONO_TYPEORMETHOD_BITS);
+}
+
/**
* get_encoded_typedef_or_ref:
* @m: metadata context
@@ -325,21 +418,26 @@ const char *
get_custom_mod (MonoImage *m, const char *ptr, char **return_value)
{
char *s;
+ const char *reqd;
- if ((*ptr == MONO_TYPE_CMOD_OPT) ||
- (*ptr == MONO_TYPE_CMOD_REQD)){
+ *return_value = NULL;
+ while ((*ptr == MONO_TYPE_CMOD_OPT) ||
+ (*ptr == MONO_TYPE_CMOD_REQD)) {
+ reqd = (*ptr == MONO_TYPE_CMOD_REQD) ? "reqd" : "opt";
ptr++;
ptr = get_encoded_typedef_or_ref (m, ptr, &s);
- *return_value = g_strconcat ("CMOD ", s, NULL);
+ if (*return_value == NULL)
+ *return_value = g_strconcat (reqd, " ", s, NULL);
+ else
+ *return_value = g_strconcat (*return_value, " ", reqd, " ", s, NULL);
g_free (s);
- } else
- *return_value = NULL;
+ }
return ptr;
}
-static map_t element_type_map [] = {
+static dis_map_t element_type_map [] = {
{ MONO_TYPE_END , "end" },
{ MONO_TYPE_VOID , "void" },
{ MONO_TYPE_BOOLEAN , "bool" },
@@ -347,11 +445,11 @@ static map_t element_type_map [] = {
{ MONO_TYPE_I1 , "int8" },
{ MONO_TYPE_U1 , "unsigned int8" },
{ MONO_TYPE_I2 , "int16" },
- { MONO_TYPE_U2 , "uint16" },
+ { MONO_TYPE_U2 , "unsigned int16" },
{ MONO_TYPE_I4 , "int32" },
- { MONO_TYPE_U4 , "uint32" },
+ { MONO_TYPE_U4 , "unsigned int32" },
{ MONO_TYPE_I8 , "int64" },
- { MONO_TYPE_U8 , "uint64" },
+ { MONO_TYPE_U8 , "unsigned int64" },
{ MONO_TYPE_R4 , "float32" },
{ MONO_TYPE_R8 , "float64" },
{ MONO_TYPE_STRING , "string" },
@@ -362,12 +460,12 @@ static map_t element_type_map [] = {
{ 0, NULL }
};
-static map_t call_conv_type_map [] = {
+static dis_map_t call_conv_type_map [] = {
{ MONO_CALL_DEFAULT , "default" },
- { MONO_CALL_C , "c" },
- { MONO_CALL_STDCALL , "stdcall" },
- { MONO_CALL_THISCALL , "thiscall" },
- { MONO_CALL_FASTCALL , "fastcall" },
+ { MONO_CALL_C , "unmanaged cdecl" },
+ { MONO_CALL_STDCALL , "unmanaged stdcall" },
+ { MONO_CALL_THISCALL , "unmanaged thiscall" },
+ { MONO_CALL_FASTCALL , "unmanaged fastcall" },
{ MONO_CALL_VARARG , "vararg" },
{ 0, NULL }
};
@@ -393,7 +491,7 @@ dis_stringify_array (MonoImage *m, MonoArrayType *array)
GString *s = g_string_new("");
int i;
- type = dis_stringify_type (m, array->type);
+ type = dis_stringify_type (m, &array->eklass->byval_arg);
g_string_append (s, type);
g_free (type);
g_string_append_c (s, '[');
@@ -421,7 +519,9 @@ dis_stringify_modifiers (MonoImage *m, int n, MonoCustomMod *mod)
int i;
for (i = 0; i < n; ++i) {
char *tok = dis_stringify_token (m, mod[i].token);
- g_string_sprintfa (s, "%s %s", mod[i].required ? "opt": "reqd", tok);
+ if (i > 0)
+ g_string_sprintfa (s, " ");
+ g_string_sprintfa (s, "%s (%s)", mod[i].required ? "modreq": "modopt", tok);
g_free (tok);
}
g_string_append_c (s, ' ');
@@ -435,44 +535,111 @@ dis_stringify_param (MonoImage *m, MonoType *param)
{
char *t;
char *result;
- const char *out = param->attrs & 2 ? "[out] ": "";
+ char *attribs;
+ const char *out = param->attrs & PARAM_ATTRIBUTE_OUT ? "[out]": "";
+ const char *opt = param->attrs & PARAM_ATTRIBUTE_OPTIONAL ? "[opt]": "";
+ attribs = g_strconcat(out, opt, NULL);
t = dis_stringify_type (m, param);
- result = g_strconcat (out, t, NULL);
+ result = g_strjoin(attribs[0] ? " ":"", attribs, t, NULL);
g_free (t);
+ g_free (attribs);
return result;
}
+/**
+ * get_generic_param
+ * @m: metadata context
+ * @table_type: The type of table we are getting generics for (0 for typedef, 1 for method)
+ * @row: The row in the table
+ *
+ * Returns: Allocated stringified generic parameters
+ */
char*
-dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row)
+get_generic_param (MonoImage *m, int table_type, guint32 row)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_GENERICPARAM];
+ GString *result = g_string_new ("");
+ char *retval;
+ guint32 cols [MONO_GENERICPARAM_SIZE];
+ int i, own_tok, table, idx, found_count;
+
+ g_assert (table_type != MONO_TYPEORMETHOD_TYPE || table_type != MONO_TYPEORMETHOD_METHOD);
+
+ found_count = 0;
+ for (i = 1; i <= t->rows; i++) {
+ mono_metadata_decode_row (t, i-1, cols, MONO_GENERICPARAM_SIZE);
+ own_tok = cols [MONO_GENERICPARAM_OWNER];
+ table = own_tok & MONO_TYPEORMETHOD_MASK;
+ idx = own_tok >> MONO_TYPEORMETHOD_BITS;
+
+ if (table != table_type || idx != row)
+ continue;
+
+ if (found_count == 0)
+ g_string_append_printf (result, "<%s",
+ mono_metadata_string_heap (m, cols [MONO_GENERICPARAM_NAME]));
+ else
+ g_string_append_printf (result, ", %s",
+ mono_metadata_string_heap (m, cols [MONO_GENERICPARAM_NAME]));
+ found_count++;
+ }
+
+ if (found_count)
+ g_string_append_c (result, '>');
+ retval = result->str;
+ g_string_free (result, FALSE);
+ return retval;
+}
+
+char*
+dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row, gboolean fully_qualified)
{
guint32 cols [MONO_METHOD_SIZE];
guint32 pcols [MONO_PARAM_SIZE];
guint32 param_index = 0;
const char *name = "";
int free_method = 0;
- char *retval;
+ char *retval, *esname;
+ char *type = NULL;
+ char *gen_param = NULL;
GString *result = g_string_new ("");
int i;
-
+
g_assert (method || methoddef_row);
if (methoddef_row) {
mono_metadata_decode_row (&m->tables [MONO_TABLE_METHOD], methoddef_row -1, cols, MONO_METHOD_SIZE);
+ if (fully_qualified)
+ type = get_typedef (m, mono_metadata_typedef_from_method (m, methoddef_row));
name = mono_metadata_string_heap (m, cols [MONO_METHOD_NAME]);
param_index = cols [MONO_METHOD_PARAMLIST];
if (!method) {
const char *sig = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
mono_metadata_decode_blob_size (sig, &sig);
- method = mono_metadata_parse_method_signature (m, 1, sig, &sig);
+ method = mono_metadata_parse_method_signature (m, methoddef_row, sig, &sig);
free_method = 1;
- }
+ }
+ gen_param = get_generic_param (m, 1, methoddef_row);
}
retval = dis_stringify_param (m, method->ret);
if (method->hasthis)
g_string_append (result, "instance ");
g_string_append (result, map (method->call_convention, call_conv_type_map));
- g_string_sprintfa (result, " %s %s(", retval, name);
+ g_string_sprintfa (result, " %s ", retval);
+ if (type) {
+ char *estype = get_escaped_name (type);
+ g_string_sprintfa (result, "%s::", estype);
+ g_free (estype);
+ }
+ esname = get_escaped_name (name);
+ g_string_append (result, esname);
+ g_free (esname);
+ if (gen_param) {
+ g_string_append (result, gen_param);
+ g_free (gen_param);
+ }
+ g_string_append (result, " (");
g_free (retval);
for (i = 0; i < method->param_count; ++i) {
if (param_index && param_index <= m->tables [MONO_TABLE_PARAM].rows) {
@@ -486,11 +653,17 @@ dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int m
if (i)
g_string_append (result, ", ");
retval = dis_stringify_param (m, method->params [i]);
- g_string_sprintfa (result, "%s %s", retval, name);
+ esname = get_escaped_name (name);
+ g_string_append_printf (result, "%s %s", retval, esname);
g_free (retval);
+ g_free (esname);
}
g_string_append (result, ") ");
+ if (show_method_tokens && methoddef_row)
+ g_string_append_printf (result, " /* 0x%X */ ",
+ (methoddef_row >> MONO_TYPEORMETHOD_BITS) | MONO_TOKEN_METHOD_DEF);
+
if (free_method)
mono_metadata_free_method_signature (method);
retval = result->str;
@@ -499,32 +672,106 @@ dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int m
return retval;
}
-static char *
-dis_stringify_object (MonoImage *m, MonoType *type)
+char*
+dis_stringify_function_ptr (MonoImage *m, MonoMethodSignature *method)
+{
+ char *retval;
+ GString *result = g_string_new ("");
+ int i;
+
+ g_assert (method);
+
+ g_string_append (result, map (method->call_convention, call_conv_type_map));
+
+ retval = dis_stringify_param (m, method->ret);
+ g_string_sprintfa (result, " %s ", retval);
+ g_free (retval);
+
+ g_string_append (result, " *(");
+ for (i = 0; i < method->param_count; ++i) {
+ if (i)
+ g_string_append (result, ", ");
+ retval = dis_stringify_param (m, method->params [i]);
+ g_string_append (result, retval);
+ g_free (retval);
+ }
+ g_string_append (result, ") ");
+
+ retval = result->str;
+ g_string_free (result, FALSE);
+
+ return retval;
+}
+
+char *
+dis_stringify_object_with_class (MonoImage *m, MonoClass *c)
{
/* FIXME: handle MONO_TYPE_OBJECT ... */
- const char *otype = type->type == MONO_TYPE_CLASS? "class" : "valuetype";
- char *assemblyref = NULL, *result;
- MonoClass *c = mono_class_from_mono_type (type);
- if (!c)
- return g_strdup ("Unknown");
+ const char *otype = c->byval_arg.type == MONO_TYPE_VALUETYPE ? "valuetype" : "class" ;
+ char *assemblyref = NULL, *result, *esname, *generic = NULL;
if (m != c->image) {
if (c->image->assembly_name) {
/* we cheat */
if (substitute_with_mscorlib_p && !strcmp ("corlib", c->image->assembly_name))
assemblyref = g_strdup_printf ("[%s]", "mscorlib");
- else
- assemblyref = g_strdup_printf ("[%s]", c->image->assembly->aname.name);
+ else {
+ char *esc = get_escaped_name (c->image->assembly->aname.name);
+
+ assemblyref = g_strdup_printf ("[%s]", esc);
+ g_free (esc);
+ }
} else {
assemblyref = g_strdup_printf ("[.module %s]", c->image->module_name);
}
}
- result = g_strdup_printf ("%s %s%s%s%s", otype, assemblyref?assemblyref:"", c->name_space,
+
+ if (c->nested_in) {
+ result = g_strdup_printf ("%s%s%s/%s", c->nested_in->name_space,
+ *c->nested_in->name_space?".":"", c->nested_in->name,
+ c->name);
+ } else {
+ result = g_strdup_printf ("%s%s%s", c->name_space,
*c->name_space?".":"", c->name);
+ }
+
+ esname = get_escaped_name (result);
+ g_free (result);
+
+ if (c->generic_inst) {
+ MonoGenericInst *ginst = c->generic_inst;
+ GString *str = g_string_new ("");
+ int i;
+
+ for (i = 0; i < ginst->type_argc; i++){
+ char *t = dis_stringify_type (m, ginst->type_argv [i]);
+
+ g_string_append (str, t);
+ if (i+1 != ginst->type_argc)
+ g_string_append (str, ", ");
+ g_free (t);
+ }
+ generic = g_strdup_printf ("<%s>", str->str);
+ g_string_free (str, TRUE);
+ }
+
+
+ result = g_strdup_printf ("%s %s%s%s", otype, assemblyref?assemblyref:"",
+ esname, generic?generic:"");
+
+ g_free (generic);
g_free (assemblyref);
+ g_free (esname);
+
return result;
}
+static char *
+dis_stringify_object (MonoImage *m, MonoType *type)
+{
+ MonoClass *c = mono_class_from_mono_type (type);
+ return dis_stringify_object_with_class (m, c);
+}
+
char*
dis_stringify_type (MonoImage *m, MonoType *type)
{
@@ -560,16 +807,26 @@ dis_stringify_type (MonoImage *m, MonoType *type)
case MONO_TYPE_CLASS:
bare = dis_stringify_object (m, type);
break;
+ case MONO_TYPE_FNPTR: {
+ char *child_type;
+ child_type = dis_stringify_function_ptr (m, type->data.method);
+ bare = g_strdup_printf ("method %s", child_type);
+ g_free (child_type);
+ break;
+ }
+ case MONO_TYPE_PTR: {
+ char *child_type;
+ child_type = dis_stringify_type (m, type->data.type);
- case MONO_TYPE_FNPTR:
- bare = dis_stringify_method_signature (m, type->data.method, 0);
+ bare = g_strdup_printf ("%s*", child_type);
+ g_free (child_type);
break;
- case MONO_TYPE_PTR:
+ }
case MONO_TYPE_SZARRAY: {
char *child_type;
- child_type = dis_stringify_type (m, type->data.type);
+ child_type = dis_stringify_type (m, &type->data.klass->byval_arg);
- bare = g_strdup_printf (type->type == MONO_TYPE_PTR ? "%s*" : "%s[]", child_type);
+ bare = g_strdup_printf ("%s[]", child_type);
g_free (child_type);
break;
}
@@ -579,6 +836,30 @@ dis_stringify_type (MonoImage *m, MonoType *type)
case MONO_TYPE_VOID:
bare = g_strdup ("void");
break;
+ case MONO_TYPE_MVAR:
+ bare = g_strdup_printf ("!!%d", type->data.generic_param->num);
+ break;
+ case MONO_TYPE_VAR:
+ bare = g_strdup_printf ("!%d", type->data.generic_param->num);
+ break;
+ case MONO_TYPE_GENERICINST: {
+ GString *str = g_string_new ("");
+ int i;
+ char *generic_type = dis_stringify_type (m, type->data.generic_inst->generic_type);
+
+ for (i = 0; i < type->data.generic_inst->type_argc; i++){
+ char *t = dis_stringify_type (m, type->data.generic_inst->type_argv [i]);
+
+ g_string_append (str, t);
+ if (i+1 != type->data.generic_inst->type_argc)
+ g_string_append (str, ", ");
+ g_free (t);
+ }
+ bare = g_strdup_printf ("%s<%s>", generic_type, str->str);
+ g_string_free (str, TRUE);
+ break;
+ }
+
default:
g_error ("Do not know how to stringify type 0x%x", type->type);
}
@@ -610,9 +891,62 @@ dis_stringify_type (MonoImage *m, MonoType *type)
const char *
get_type (MonoImage *m, const char *ptr, char **result)
{
- MonoType *type = mono_metadata_parse_type (m, MONO_PARSE_TYPE, 0, ptr, &ptr);
- *result = dis_stringify_type (m, type);
- mono_metadata_free_type (type);
+ const char *start = ptr;
+ guint32 type;
+ MonoType *t;
+
+ if (*ptr == MONO_TYPE_BYREF)
+ ++ptr;
+
+ type = mono_metadata_decode_value (ptr, &ptr);
+
+ switch (type){
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_CLASS: {
+ guint32 token = mono_metadata_parse_typedef_or_ref (m, ptr, &ptr);
+ MonoClass *klass = mono_class_get (m, token);
+ char *temp = dis_stringify_object_with_class (m, klass);
+
+ if (show_tokens) {
+ *result = g_strdup_printf ("%s/*%08x*/", temp, token);
+ g_free (temp);
+ } else
+ *result = temp;
+ break;
+ }
+
+ case MONO_TYPE_GENERICINST: {
+ GString *str = g_string_new ("");
+ int count, i;
+ char *temp;
+
+ ptr = get_type (m, ptr, &temp);
+ g_string_append (str, temp);
+ g_free (temp);
+
+ count = mono_metadata_decode_value (ptr, &ptr);
+ g_string_append (str, "<");
+
+ for (i = 0; i < count; i++) {
+ if (i)
+ g_string_append (str, ",");
+ ptr = get_type (m, ptr, &temp);
+ g_string_append (str, temp);
+ }
+
+ g_string_append (str, ">");
+ *result = str->str;
+ g_string_free (str, FALSE);
+ break;
+ }
+
+ default:
+ t = mono_metadata_parse_type (m, MONO_PARSE_TYPE, 0, start, &ptr);
+ *result = dis_stringify_type (m, t);
+ mono_metadata_free_type (t);
+ break;
+ }
+
return ptr;
}
@@ -647,7 +981,7 @@ get_field_signature (MonoImage *m, guint32 blob_signature)
if (allocated_modifier_string)
g_free (allocated_modifier_string);
if (allocated_type_string)
- g_free (allocated_modifier_string);
+ g_free (allocated_type_string);
return res;
}
@@ -711,14 +1045,13 @@ get_ret_type (MonoImage *m, const char *ptr, char **ret_type)
}
if (*ptr == MONO_TYPE_TYPEDBYREF){
- /* TODO: what does `typedbyref' mean? */
- g_string_append (str, "/* FIXME: What does this mean? */ typedbyref ");
+ g_string_append (str, "typedbyref");
ptr++;
} else if (*ptr == MONO_TYPE_VOID){
g_string_append (str, "void");
ptr++;
} else {
- if (*ptr == MONO_TYPE_BYREF){
+ if (*ptr == MONO_TYPE_BYREF){
g_string_append (str, "[out] ");
ptr++;
}
@@ -758,15 +1091,19 @@ get_param (MonoImage *m, const char *ptr, char **retval)
}
if (*ptr == MONO_TYPE_TYPEDBYREF){
- g_string_append (str, "/*FIXME: what does typedbyref mean? */ typedbyref ");
+ g_string_append (str, " typedbyref ");
ptr++;
} else {
- if (*ptr == MONO_TYPE_BYREF){
+ gboolean by_ref = 0;
+ if (*ptr == MONO_TYPE_BYREF){
g_string_append (str, "[out] ");
ptr++;
+ by_ref = 1;
}
ptr = get_type (m, ptr, &allocated_type_string);
g_string_append (str, allocated_type_string);
+ if (by_ref)
+ g_string_append_c (str, '&');
g_free (allocated_type_string);
}
@@ -775,7 +1112,35 @@ get_param (MonoImage *m, const char *ptr, char **retval)
return ptr;
}
-static map_t param_map [] = {
+/**
+ * get_escaped_name
+ *
+ * Returns: An allocated escaped name. A name needs to be escaped
+ * because it might be an ilasm keyword.
+ */
+char*
+get_escaped_name (const char *name)
+{
+ const char *s;
+
+ g_assert (key_table);
+
+ if (strlen (name) == 0)
+ return g_strdup (name);
+
+ for (s = name; *s; s++) {
+ if (isalnum (*s) || *s == '_' || *s == '$' || *s == '@' || *s == '?' || *s == '.' || *s == 0)
+ continue;
+ return g_strdup_printf ("'%s'", name);
+ }
+
+ if (g_hash_table_lookup (key_table, name))
+ return g_strdup_printf ("'%s'", name);
+
+ return g_strdup (name);
+}
+
+static dis_map_t param_map [] = {
{ PARAM_ATTRIBUTE_IN, "[in] " },
{ PARAM_ATTRIBUTE_OUT, "[out] " },
{ PARAM_ATTRIBUTE_OPTIONAL, "optional " },
@@ -790,7 +1155,7 @@ param_flags (guint32 f)
return g_strdup (flags (f, param_map));
}
-static map_t field_access_map [] = {
+static dis_map_t field_access_map [] = {
{ FIELD_ATTRIBUTE_COMPILER_CONTROLLED, "compilercontrolled " },
{ FIELD_ATTRIBUTE_PRIVATE, "private " },
{ FIELD_ATTRIBUTE_FAM_AND_ASSEM, "famandassem " },
@@ -801,7 +1166,7 @@ static map_t field_access_map [] = {
{ 0, NULL }
};
-static map_t field_flags_map [] = {
+static dis_map_t field_flags_map [] = {
{ FIELD_ATTRIBUTE_STATIC, "static " },
{ FIELD_ATTRIBUTE_INIT_ONLY, "initonly " },
{ FIELD_ATTRIBUTE_LITERAL, "literal " },
@@ -810,8 +1175,6 @@ static map_t field_flags_map [] = {
{ FIELD_ATTRIBUTE_PINVOKE_IMPL, "FIXME:pinvokeimpl " },
{ FIELD_ATTRIBUTE_RT_SPECIAL_NAME, "rtspecialname " },
{ FIELD_ATTRIBUTE_HAS_FIELD_MARSHAL, "hasfieldmarshal " },
- { FIELD_ATTRIBUTE_HAS_DEFAULT, "hasdefault " },
- { FIELD_ATTRIBUTE_HAS_FIELD_RVA, "hasfieldrva " },
{ 0, NULL }
};
@@ -842,9 +1205,11 @@ get_methodref_signature (MonoImage *m, guint32 blob_signature, const char *fancy
GString *res = g_string_new ("");
const char *ptr = mono_metadata_blob_heap (m, blob_signature);
char *allocated_ret_type, *s;
+ const char *cconv_str;
gboolean seen_vararg = 0;
int param_count, signature_len;
- int i;
+ int i, gen_count = 0;
+ int cconv;
signature_len = mono_metadata_decode_value (ptr, &ptr);
@@ -855,22 +1220,32 @@ get_methodref_signature (MonoImage *m, guint32 blob_signature, const char *fancy
g_string_append (res, "instance "); /* has-this */
}
- if (*ptr & 0x05)
- seen_vararg = 1;
+ if (*ptr & 0x10)
+ gen_count = 1;
+ cconv = *ptr & 0x0f;
+ cconv_str = map (cconv, call_conv_type_map);
+ if (strcmp (cconv_str, "default") != 0) {
+ g_string_append (res, cconv_str);
+ g_string_append (res, " ");
+ }
ptr++;
+ if (gen_count)
+ gen_count = mono_metadata_decode_value (ptr, &ptr);
param_count = mono_metadata_decode_value (ptr, &ptr);
- ptr = get_ret_type (m, ptr, &allocated_ret_type);
-
- g_string_append (res, allocated_ret_type);
+ if (cconv != 0xa) {
+ ptr = get_ret_type (m, ptr, &allocated_ret_type);
+ g_string_append (res, allocated_ret_type);
+ g_free (allocated_ret_type);
+ }
if (fancy_name){
g_string_append_c (res, ' ');
g_string_append (res, fancy_name);
}
-
+
g_string_append (res, "(");
-
+
/*
* param_count describes parameters *before* and *after*
* the vararg sentinel
@@ -882,8 +1257,12 @@ get_methodref_signature (MonoImage *m, guint32 blob_signature, const char *fancy
* If ptr is a SENTINEL
*/
if (*ptr == 0x41){
- g_string_append (res, " varargs ");
- continue;
+ if (!seen_vararg){
+ g_string_append (res, "..., ");
+ seen_vararg = 1;
+ }
+
+ ptr++;
}
ptr = get_param (m, ptr, &param);
@@ -897,13 +1276,34 @@ get_methodref_signature (MonoImage *m, guint32 blob_signature, const char *fancy
/*
* cleanup and return
*/
- g_free (allocated_ret_type);
s = res->str;
g_string_free (res, FALSE);
return s;
}
/**
+ * Returns a stringifed representation of a field ref
+ */
+char *
+get_fieldref_signature (MonoImage *m, int idx)
+{
+ guint32 cols [MONO_MEMBERREF_SIZE];
+ char *sig;
+ char *full_sig;
+
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_MEMBERREF],
+ idx - 1, cols, MONO_MEMBERREF_SIZE);
+
+ sig = get_field_signature (m, cols [MONO_MEMBERREF_SIGNATURE]);
+ full_sig = g_strdup_printf ("%s %s::%s", sig,
+ get_memberref_parent (m, cols [MONO_MEMBERREF_CLASS]),
+ mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]));
+ g_free (sig);
+
+ return full_sig;
+}
+
+/**
* get_field:
* @m: metadata context
* @token: a FIELD_DEF token
@@ -917,7 +1317,7 @@ get_field (MonoImage *m, guint32 token)
{
int idx = mono_metadata_token_index (token);
guint32 cols [MONO_FIELD_SIZE];
- char *sig, *res, *type;
+ char *sig, *res, *type, *estype, *esname;
guint32 type_idx;
/*
@@ -925,7 +1325,7 @@ get_field (MonoImage *m, guint32 token)
* defined in another module/assembly, just like in get_method ()
*/
if (mono_metadata_token_code (token) == MONO_TOKEN_MEMBER_REF) {
- return g_strdup_printf ("fieldref-0x%08x", token);
+ return get_fieldref_signature (m, idx);
}
g_assert (mono_metadata_token_code (token) == MONO_TOKEN_FIELD_DEF);
@@ -939,11 +1339,15 @@ get_field (MonoImage *m, guint32 token)
type_idx = mono_metadata_typedef_from_field (m, idx);
type = get_typedef (m, type_idx);
+ estype = get_escaped_name (type);
+ esname = get_escaped_name (mono_metadata_string_heap (m, cols [MONO_FIELD_NAME]));
res = g_strdup_printf ("%s %s::%s",
- sig, type,
- mono_metadata_string_heap (m, cols [MONO_FIELD_NAME]));
+ sig, estype, esname);
+
g_free (type);
g_free (sig);
+ g_free (estype);
+ g_free (esname);
return res;
}
@@ -991,16 +1395,21 @@ get_method (MonoImage *m, guint32 token)
{
int idx = mono_metadata_token_index (token);
guint32 member_cols [MONO_MEMBERREF_SIZE], method_cols [MONO_METHOD_SIZE];
- char *sig;
+ char *sig = NULL, *esname;
const char *name;
MonoMethod *mh;
mh = mono_get_method (m, token, NULL);
if (mh) {
- sig = dis_stringify_object (m, &mh->klass->byval_arg);
- name = g_strdup_printf ("%s::%s", sig, mh->name);
+ esname = get_escaped_name (mh->name);
+ sig = dis_stringify_object_with_class (m, mh->klass);
+ if (show_tokens)
+ name = g_strdup_printf ("%s/*%08x*/::%s", sig, token, esname);
+ else
+ name = g_strdup_printf ("%s::%s", sig, esname);
g_free (sig);
+ g_free (esname);
} else
name = NULL;
@@ -1010,10 +1419,9 @@ get_method (MonoImage *m, guint32 token)
idx - 1, method_cols, MONO_METHOD_SIZE);
sig = get_methodref_signature (m, method_cols [MONO_METHOD_SIGNATURE], name);
- return sig;
+ break;
case MONO_TOKEN_MEMBER_REF: {
-
mono_metadata_decode_row (&m->tables [MONO_TABLE_MEMBERREF],
idx - 1, member_cols, MONO_MEMBERREF_SIZE);
if (!name)
@@ -1022,16 +1430,182 @@ get_method (MonoImage *m, guint32 token)
mono_metadata_string_heap (m, member_cols [MONO_MEMBERREF_NAME]));
sig = get_methodref_signature (
m, member_cols [MONO_MEMBERREF_SIGNATURE], name);
+ break;
+ }
+ case MONO_TOKEN_METHOD_SPEC: {
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_METHODSPEC],
+ idx - 1, member_cols, MONO_METHODSPEC_SIZE);
+ token = member_cols [MONO_METHODSPEC_METHOD];
+ sig = get_methodspec (m, idx, token, name);
+ break;
+ }
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ if (show_tokens) {
+ char *retval = g_strdup_printf ("%s /* %08x */", sig, token);
+ g_free (sig);
+ return retval;
+ } else
return sig;
+}
+
+/**
+ * get_methoddef
+ * @m: metadata context
+ * @idx: index into the method table
+ *
+ * Returns: A stringified version of the method signature.
+ */
+char *
+get_methoddef (MonoImage *m, guint32 idx)
+{
+ guint32 cols [MONO_METHOD_SIZE];
+ char *sig;
+ const char *name;
+
+ MonoMethod *mh;
+
+ mh = mono_get_method (m, MONO_TOKEN_METHOD_DEF | idx, NULL);
+ if (mh) {
+ sig = dis_stringify_object_with_class (m, mh->klass);
+ name = g_strdup_printf ("%s::%s", sig, mh->name);
+ g_free (sig);
+ } else
+ name = NULL;
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_METHOD],
+ idx - 1, cols, MONO_METHOD_SIZE);
+ sig = get_methodref_signature (m, cols [MONO_METHOD_SIGNATURE], name);
+
+ return sig;
+}
+
+char *
+get_method_type_param (MonoImage *m, guint32 blob_signature)
+{
+ GString *res = g_string_new ("");
+ const char *ptr = mono_metadata_blob_heap (m, blob_signature);
+ int param_count;
+ int i = 0;
+ char *s;
+
+ mono_metadata_decode_value (ptr, &ptr);
+ ptr++;
+ param_count = mono_metadata_decode_value (ptr, &ptr);
+
+ g_string_append_c (res, '<');
+
+ for (i = 0; i < param_count; i++){
+ char *param = NULL;
+
+ ptr = get_param (m, ptr, &param);
+ g_string_append (res, param);
+ if (i+1 != param_count)
+ g_string_append (res, ", ");
+ g_free (param);
}
-
+ g_string_append_c (res, '>');
+
+ s = res->str;
+ g_string_free (res, FALSE);
+ return s;
+}
+
+/**
+ * get_methodspec
+ *
+ * Returns: An allocated stringified version of the methodspec signature.
+ */
+
+char *
+get_methodspec (MonoImage *m, int idx, guint32 token, const char *fancy_name)
+{
+ GString *res = g_string_new ("");
+ guint32 member_cols [MONO_MEMBERREF_SIZE], method_cols [MONO_METHOD_SIZE];
+ char *s, *type_param;
+ const char *ptr;
+ guint32 sig = 0;
+ int param_count, cconv, i, gen_count = 0;
+
+ switch (token & MONO_METHODDEFORREF_MASK) {
+ case MONO_METHODDEFORREF_METHODDEF:
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_METHOD],
+ (token >> MONO_METHODDEFORREF_BITS) - 1,
+ method_cols, MONO_METHOD_SIZE);
+ sig = method_cols [MONO_METHOD_SIGNATURE];
+ break;
+ case MONO_METHODDEFORREF_METHODREF:
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_MEMBERREF],
+ (token >> MONO_METHODDEFORREF_BITS) - 1,
+ member_cols, MONO_MEMBERREF_SIZE);
+ sig = member_cols [MONO_MEMBERREF_SIGNATURE];
+ break;
default:
g_assert_not_reached ();
}
- g_assert_not_reached ();
- return NULL;
+
+ ptr = mono_metadata_blob_heap (m, sig);
+ mono_metadata_decode_value (ptr, &ptr);
+
+ if (*ptr & 0x20){
+ if (*ptr & 0x40)
+ g_string_append (res, "explicit-this ");
+ else
+ g_string_append (res, "instance "); /* has-this */
+ }
+
+ if (*ptr & 0x10)
+ gen_count = 1;
+ cconv = *ptr & 0x0f;
+ ptr++;
+ if (gen_count)
+ gen_count = mono_metadata_decode_value (ptr, &ptr);
+ param_count = mono_metadata_decode_value (ptr, &ptr);
+ if (cconv != 0xa) {
+ char *allocated_ret_type;
+ ptr = get_ret_type (m, ptr, &allocated_ret_type);
+ g_string_append (res, allocated_ret_type);
+ g_free (allocated_ret_type);
+ }
+
+ if (fancy_name){
+ g_string_append_c (res, ' ');
+ g_string_append (res, fancy_name);
+ }
+
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_METHODSPEC],
+ idx - 1, member_cols, MONO_METHODSPEC_SIZE);
+ token = member_cols [MONO_METHODSPEC_SIGNATURE];
+ type_param = get_method_type_param (m, token);
+ g_string_append (res, type_param);
+ g_string_append (res, " (");
+
+ /*
+ * methodspecs can not be varargs so we don't need to worry about that here
+ */
+
+ for (i = 0; i < param_count; i++){
+ char *param = NULL;
+
+ ptr = get_param (m, ptr, &param);
+ g_string_append (res, param);
+ if (i+1 != param_count)
+ g_string_append (res, ", ");
+ g_free (param);
+ }
+ g_string_append (res, ")");
+
+ /*
+ * cleanup and return
+ */
+ s = res->str;
+ g_string_free (res, FALSE);
+ return s;
}
+
/**
* get_constant:
* @m: metadata context
@@ -1043,17 +1617,17 @@ get_method (MonoImage *m, guint32 token)
char *
get_constant (MonoImage *m, MonoTypeEnum t, guint32 blob_index)
{
- const char *ptr = mono_metadata_blob_heap (m, blob_index);
+ const unsigned char *ptr = mono_metadata_blob_heap (m, blob_index);
int len;
- len = mono_metadata_decode_value (ptr, &ptr);
+ len = mono_metadata_decode_value (ptr, (const char**)&ptr);
switch (t){
case MONO_TYPE_BOOLEAN:
- return g_strdup_printf ("%s", *ptr ? "true" : "false");
+ return g_strdup_printf ("%s", *ptr ? "bool(true)" : "bool(false)");
case MONO_TYPE_CHAR:
- return g_strdup_printf ("%c", *ptr); /* FIXME: unicode char */
+ return g_strdup_printf ("char(0x%04x)", read16(ptr));
case MONO_TYPE_U1:
case MONO_TYPE_I1:
@@ -1072,7 +1646,7 @@ get_constant (MonoImage *m, MonoTypeEnum t, guint32 blob_index)
guint32 low, high;
low = read32 (ptr);
high = read32 (ptr + 4);
- return g_strdup_printf ("0x%08x%08x", high, low);
+ return g_strdup_printf ("int64(0x%08x%08x)", high, low);
}
case MONO_TYPE_U8: {
guint32 low, high;
@@ -1083,54 +1657,51 @@ get_constant (MonoImage *m, MonoTypeEnum t, guint32 blob_index)
case MONO_TYPE_R4: {
float r;
readr4 (ptr, &r);
- return g_strdup_printf ("%g", (double) r);
+ return g_strdup_printf ("float32(%g)", (double) r);
}
case MONO_TYPE_R8: {
double r;
readr8 (ptr, &r);
- return g_strdup_printf ("%g", r);
+ return g_strdup_printf ("float64(%g)", r);
}
case MONO_TYPE_STRING: {
- int i, j, e;
- char *res;
- e = len = 0;
- for (i = 0; !ptr [i+1]; i += 2){
- len++;
- switch (ptr [i]) {
- case '"':
- case '\\':
- case '\n': /* add more */
- e++;
- }
- }
- res = g_malloc (len + e + 3);
- j = 1;
- res [0] = '"';
-
- for (i = 0; i < len; i += 2){
- switch(ptr[i]) {
- case '"':
- res[j++] = '\\';
- res[j++] = '"';
- case '\\':
- res[j++] = '\\';
- res[j++] = '\\';
- case '\n':
- res[j++] = '\\';
- res[j++] = 'n';
- break;
- default:
- res[j++] = isprint (ptr [i]) ? ptr [i] : '.';
- break;
+ gchar *str;
+ int i, j, tspaces = (len%16);
+ GString *res = g_string_new ("bytearray (\n\t");
+
+ for(i = 1; i <= len; ++i) {
+ g_string_append_printf(res, "%02x ", ptr[i-1]);
+
+ if(i%16 == 0) {
+ if(i == len)
+ g_string_append(res, ")// ");
+ else
+ g_string_append(res, " // ");
+
+ for(j = i-16; j < i; ++j)
+ g_string_append_printf(res, "%c", isprint(ptr[j]) ? ptr[j] : '.');
+ g_string_append(res, "\n\t");
}
}
- res[j++] = '"';
- res[j] = 0;
- return res;
+
+ if(tspaces) {
+ g_string_append(res, ") ");
+ for(i = tspaces+1; i < 16; ++i)
+ g_string_append_printf(res, " ");
+
+ g_string_append(res, " // ");
+ for(i = len-tspaces; i < len; ++i)
+ g_string_append_printf(res, "%c", isprint(ptr[i]) ? ptr[i] : '.');
+ g_string_append(res, "\n\t");
+ }
+
+ str = res->str;
+ g_string_free(res, FALSE);
+ return str;
}
case MONO_TYPE_CLASS:
- return g_strdup ("CLASS CONSTANT. MUST BE ZERO");
+ return g_strdup ("nullref");
default:
g_error ("Unknown MONO_TYPE (%d) on constant at Blob index (0x%08x)\n",
@@ -1151,17 +1722,38 @@ get_constant (MonoImage *m, MonoTypeEnum t, guint32 blob_index)
char *
get_token (MonoImage *m, guint32 token)
{
+ char *temp, *result;
guint32 idx = mono_metadata_token_index (token);
switch (mono_metadata_token_code (token)){
case MONO_TOKEN_FIELD_DEF:
- return (get_field (m, token));
+ temp = get_field (m, token);
+ result = g_strdup_printf ("field %s", temp);
+ g_free (temp);
+ return result;
case MONO_TOKEN_TYPE_DEF:
return get_typedef (m, idx);
case MONO_TOKEN_TYPE_REF:
return get_typeref (m, idx);
case MONO_TOKEN_TYPE_SPEC:
return get_typespec (m, idx);
+ case MONO_TOKEN_MEMBER_REF: {
+ guint32 cols [MONO_MEMBERREF_SIZE];
+ const char *sig;
+ mono_metadata_decode_row (&m->tables [MONO_TABLE_MEMBERREF], mono_metadata_token_index (token) - 1, cols, MONO_MEMBERREF_SIZE);
+ sig = mono_metadata_blob_heap (m, cols [MONO_MEMBERREF_SIGNATURE]);
+ mono_metadata_decode_blob_size (sig, &sig);
+ if (*sig == 0x6) { /* it's a field */
+ temp = get_field (m, token);
+ result = g_strdup_printf ("field %s", temp);
+ g_free (temp);
+ return result;
+ }
+ else {
+ g_error ("Do not know how to decode tokens of type 0x%08x", token);
+ }
+ break;
+ }
default:
g_error ("Do not know how to decode tokens of type 0x%08x", token);
}
@@ -1182,7 +1774,7 @@ get_token (MonoImage *m, guint32 token)
char *
get_token_type (MonoImage *m, guint32 token)
{
- char *temp = NULL, *s;
+ char *temp = NULL, *s = NULL;
int idx;
idx = mono_metadata_token_index (token);
@@ -1231,7 +1823,7 @@ GList *
dis_get_custom_attrs (MonoImage *m, guint32 token)
{
GList *list = NULL;
- guint32 idx, i, j, len, mtoken;
+ guint32 idx, i, len, mtoken;
guint32 cols [MONO_CUSTOM_ATTR_SIZE];
MonoTableInfo *ca;
char *method;
@@ -1239,29 +1831,32 @@ dis_get_custom_attrs (MonoImage *m, guint32 token)
const char *val;
idx = mono_metadata_token_index (token);
- idx <<= CUSTOM_ATTR_BITS;
+ idx <<= MONO_CUSTOM_ATTR_BITS;
switch (mono_metadata_token_table (token)) {
case MONO_TABLE_TYPEDEF:
- idx |= CUSTOM_ATTR_TYPEDEF;
+ idx |= MONO_CUSTOM_ATTR_TYPEDEF;
break;
case MONO_TABLE_ASSEMBLY:
- idx |= CUSTOM_ATTR_ASSEMBLY;
+ idx |= MONO_CUSTOM_ATTR_ASSEMBLY;
+ break;
+ case MONO_TABLE_MODULE:
+ idx |= MONO_CUSTOM_ATTR_MODULE;
break;
case MONO_TABLE_PROPERTY:
- idx |= CUSTOM_ATTR_PROPERTY;
+ idx |= MONO_CUSTOM_ATTR_PROPERTY;
break;
case MONO_TABLE_EVENT:
- idx |= CUSTOM_ATTR_EVENT;
+ idx |= MONO_CUSTOM_ATTR_EVENT;
break;
case MONO_TABLE_FIELD:
- idx |= CUSTOM_ATTR_FIELDDEF;
+ idx |= MONO_CUSTOM_ATTR_FIELDDEF;
break;
case MONO_TABLE_METHOD:
- idx |= CUSTOM_ATTR_METHODDEF;
+ idx |= MONO_CUSTOM_ATTR_METHODDEF;
break;
case MONO_TABLE_PARAM:
- idx |= CUSTOM_ATTR_PARAMDEF;
+ idx |= MONO_CUSTOM_ATTR_PARAMDEF;
break;
default:
g_print ("Missing custom attr get support for token 0x%08x\n", token);
@@ -1271,15 +1866,16 @@ dis_get_custom_attrs (MonoImage *m, guint32 token)
ca = &m->tables [MONO_TABLE_CUSTOMATTRIBUTE];
/* the table is not sorted */
for (i = 0; i < ca->rows; ++i) {
+ char *dump;
mono_metadata_decode_row (ca, i, cols, MONO_CUSTOM_ATTR_SIZE);
if (cols [MONO_CUSTOM_ATTR_PARENT] != idx)
continue;
- mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> CUSTOM_ATTR_TYPE_BITS;
- switch (cols [MONO_CUSTOM_ATTR_TYPE] & CUSTOM_ATTR_TYPE_MASK) {
- case CUSTOM_ATTR_TYPE_METHODDEF:
+ mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> MONO_CUSTOM_ATTR_TYPE_BITS;
+ switch (cols [MONO_CUSTOM_ATTR_TYPE] & MONO_CUSTOM_ATTR_TYPE_MASK) {
+ case MONO_CUSTOM_ATTR_TYPE_METHODDEF:
mtoken |= MONO_TOKEN_METHOD_DEF;
break;
- case CUSTOM_ATTR_TYPE_MEMBERREF:
+ case MONO_CUSTOM_ATTR_TYPE_MEMBERREF:
mtoken |= MONO_TOKEN_MEMBER_REF;
break;
default:
@@ -1290,13 +1886,9 @@ dis_get_custom_attrs (MonoImage *m, guint32 token)
val = mono_metadata_blob_heap (m, cols [MONO_CUSTOM_ATTR_VALUE]);
len = mono_metadata_decode_value (val, &val);
attr = g_string_new (".custom ");
- g_string_sprintfa (attr, "%s = (", method);
- for (j = 0; j < len; ++j) {
- if (len > 4 && !(j % 16))
- g_string_append (attr, "\n\t\t");
- g_string_sprintfa (attr, " %02X", (val [j] & 0xff));
- }
- g_string_append_c (attr, ')');
+ dump = data_dump (val, len, "\t\t");
+ g_string_sprintfa (attr, "%s = %s", method, dump);
+ g_free (dump);
list = g_list_append (list, attr->str);
g_string_free (attr, FALSE);
g_free (method);
@@ -1344,6 +1936,7 @@ get_marshal_info (MonoImage *m, const char *blob) {
case MONO_NATIVE_LPTSTR:
return g_strdup ("lptstr");
case MONO_NATIVE_BYVALTSTR:
+ size = mono_metadata_decode_value (blob + 1, &blob);
return g_strdup_printf ("fixed sysstring [%d]", size);
case MONO_NATIVE_IUNKNOWN:
return g_strdup ("iunknown");
@@ -1356,6 +1949,7 @@ get_marshal_info (MonoImage *m, const char *blob) {
case MONO_NATIVE_SAFEARRAY:
return g_strdup ("safearray");
case MONO_NATIVE_BYVALARRAY:
+ size = mono_metadata_decode_value (blob + 1, &blob);
return g_strdup_printf ("fixed array [%d]", size);
case MONO_NATIVE_INT:
return g_strdup ("int");
@@ -1373,7 +1967,7 @@ get_marshal_info (MonoImage *m, const char *blob) {
return g_strdup ("method");
case MONO_NATIVE_ASANY:
return g_strdup ("as any");
- case MONO_NATIVE_ARRAY:
+ case MONO_NATIVE_LPARRAY:
return g_strdup ("[]");
case MONO_NATIVE_LPSTRUCT:
return g_strdup ("lpstruct");
@@ -1386,3 +1980,408 @@ get_marshal_info (MonoImage *m, const char *blob) {
}
}
+void
+init_key_table (void)
+{
+ key_table = g_hash_table_new (g_str_hash, g_str_equal);
+
+ /* auto generated */
+ g_hash_table_insert (key_table, (char *) "abstract", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "add", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "add.ovf", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "add.ovf.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "algorithm", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "alignment", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "and", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ansi", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "any", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "arglist", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "array", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "as", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "assembly", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "assert", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "at", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "auto", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "autochar", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "beforefieldinit", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "beq", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "beq.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bge", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bge.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bge.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bge.un.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bgt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bgt.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bgt.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "9", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bgt.un.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ble", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ble.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ble.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ble.un.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "blob", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "blob_object", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "blt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "blt.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "blt.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "blt.un.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bne.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bne.un.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bool", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "box", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "br", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "br.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "break", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brfalse", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brfalse.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brinst", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brinst.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brnull", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brnull.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brtrue", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brtrue.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brzero", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "brzero.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bstr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "bytearray", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "byvalstr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "call", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "calli", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "callmostderived", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "callvirt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "carray", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "castclass", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "catch", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "cdecl", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ceq", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "cf", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "cgt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "cgt.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "char", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "cil", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ckfinite", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "class", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "clsid", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "clt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "clt.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "const", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.i", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.i1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.i2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.i4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.i8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i1.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i2.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i4.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.i8.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u1.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u2.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u4.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.ovf.u8.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.r.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.r4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.r8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.u", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.u1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.u2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.u4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "conv.u8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "cpblk", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "cpobj", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "currency", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "custom", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "date", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "decimal", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "default", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "default", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "demand", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "deny", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "div", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "div.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "dup", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "endfault", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "endfilter", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "endfinally", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "endmac", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "enum", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "error", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "explicit", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "extends", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "extern", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "false", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "famandassem", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "family", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "famorassem", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "fastcall", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "fastcall", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "fault", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "field", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "filetime", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "filter", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "final", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "finally", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "fixed", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "float", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "float32", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "float64", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "forwardref", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "fromunmanaged", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "handler", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "hidebysig", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "hresult", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "idispatch", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "il", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "illegal", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "implements", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "implicitcom", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "implicitres", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "import", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "in", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "inheritcheck", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "init", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "initblk", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "initobj", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "initonly", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "instance", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "int", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "int16", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "int32", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "int64", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "int8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "interface", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "internalcall", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "isinst", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "iunknown", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "jmp", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "lasterr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "lcid", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarg", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarg.0", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarg.1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarg.2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarg.3", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarg.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarga", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldarga.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.0", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.3", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.5", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.6", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.7", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.M1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.m1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i4.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.i8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.r4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldc.r8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.i", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.i1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.i2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.i4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.i8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.r4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.r8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.ref", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.u1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.u2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.u4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelem.u8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldelema", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldfld", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldflda", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldftn", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.i", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.i1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.i2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.i4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.i8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.r4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.r8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.ref", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.u1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.u2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.u4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldind.u8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldlen", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloc", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloc.0", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloc.1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloc.2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloc.3", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloc.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloca", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldloca.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldnull", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldobj", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldsfld", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldsflda", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldstr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldtoken", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ldvirtftn", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "leave", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "leave.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "linkcheck", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "literal", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "localloc", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "lpstr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "lpstruct", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "lptstr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "lpvoid", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "lpwstr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "managed", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "marshal", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "method", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "mkrefany", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "modopt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "modreq", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "mul", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "mul.ovf", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "mul.ovf.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "native", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "neg", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "nested", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "newarr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "newobj", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "newslot", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "noappdomain", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "noinlining", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "nomachine", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "nomangle", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "nometadata", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "noncasdemand", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "noncasinheritance", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "noncaslinkdemand", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "nop", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "noprocess", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "not", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "not_in_gc_heap", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "notremotable", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "notserialized", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "null", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "nullref", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "object", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "objectref", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "opt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "optil", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "or", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "out", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "permitonly", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "pinned", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "pinvokeimpl", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "pop", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefix1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefix2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefix3", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefix4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefix5", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefix6", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefix7", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prefixref", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prejitdeny", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "prejitgrant", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "preservesig", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "private", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "Compilercontrolled", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "protected", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "public", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "readonly", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "record", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "refany", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "refanytype", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "refanyval", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "rem", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "rem.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "reqmin", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "reqopt", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "reqrefuse", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "reqsecobj", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "request", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "ret", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "rethrow", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "retval", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "rtspecialname", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "runtime", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "safearray", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "sealed", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "sequential", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "serializable", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "shl", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "shr", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "shr.un", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "sizeof", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "special", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "specialname", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "starg", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "starg.s", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "static", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stdcall", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stdcall", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.i", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.i1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.i2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.i4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.i8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.r4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.r8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stelem.ref", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stfld", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stind.i", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stind.i1", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stind.i2", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stind.i4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stind.i8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stind.r4", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "stind.r8", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "to", GINT_TO_POINTER (TRUE));
+ g_hash_table_insert (key_table, (char *) "value", GINT_TO_POINTER (TRUE));
+}
+
+guint32
+method_dor_to_token (guint32 idx) {
+ switch (idx & MONO_METHODDEFORREF_MASK) {
+ case MONO_METHODDEFORREF_METHODDEF:
+ return MONO_TOKEN_METHOD_DEF | (idx >> MONO_METHODDEFORREF_BITS);
+ case MONO_METHODDEFORREF_METHODREF:
+ return MONO_TOKEN_MEMBER_REF | (idx >> MONO_METHODDEFORREF_BITS);
+ }
+ return -1;
+}
+
+char *
+get_method_override (MonoImage *m, guint32 token)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_METHODIMPL];
+ int i;
+
+ for (i = 1; i <= t->rows; i++){
+ guint32 cols [MONO_METHODIMPL_SIZE];
+ guint32 decl, impl;
+
+ mono_metadata_decode_row (t, i - 1, cols, MONO_METHODIMPL_SIZE);
+
+ impl = method_dor_to_token (cols [MONO_METHODIMPL_BODY]);
+ decl = method_dor_to_token (cols [MONO_METHODIMPL_DECLARATION]);
+
+ if (token == impl)
+ return get_method (m, decl);
+ }
+
+ return NULL;
+}
diff --git a/mono/dis/get.h b/mono/dis/get.h
index 116549d1c5c..764743064c9 100644
--- a/mono/dis/get.h
+++ b/mono/dis/get.h
@@ -4,22 +4,32 @@
*/
char *get_typedef (MonoImage *m, int idx);
char *get_module (MonoImage *m, int idx);
+char *get_moduleref (MonoImage *m, int idx);
char *get_assemblyref (MonoImage *m, int idx);
char *get_typeref (MonoImage *m, int idx);
char *get_typedef_or_ref (MonoImage *m, guint32 dor_token);
+char *dis_stringify_object_with_class (MonoImage *m, MonoClass *c);
+char *get_type_or_methdef (MonoImage *m, guint32 dor_token);
char *get_field_signature (MonoImage *m, guint32 blob_signature);
+char *get_fieldref_signature (MonoImage *m, int idx);
char *decode_literal (MonoImage *m, guint32 token);
char *get_field (MonoImage *m, guint32 token);
char *param_flags (guint32 f);
char *field_flags (guint32 f);
char *get_methodref_signature (MonoImage *m, guint32 blob_signature, const char *fancy);
+char *get_methodspec (MonoImage *m, int idx, guint32 token, const char *fancy);
char *get_constant (MonoImage *m, MonoTypeEnum t, guint32 blob_index);
char *get_token (MonoImage *m, guint32 token);
char *get_token_type (MonoImage *m, guint32 token);
char *get_typespec (MonoImage *m, guint32 blob_idx);
+char *get_methoddef (MonoImage *m, guint32 idx);
char *get_method (MonoImage *m, guint32 token);
+char *get_method_type_param (MonoImage *m, guint32 blob_signature);
char *get_guid (MonoImage *m, guint32 guid_index);
char *get_marshal_info (MonoImage *m, const char *blob);
+char *get_generic_param (MonoImage *m, int table_type, guint32 row);
+char *get_escaped_name (const char *name);
+char *get_method_override (MonoImage *m, guint32 token);
GList *dis_get_custom_attrs (MonoImage *m, guint32 token);
@@ -28,7 +38,10 @@ char *dis_stringify_token (MonoImage *m, guint32 token);
char *dis_stringify_array (MonoImage *m, MonoArrayType *array);
char *dis_stringify_modifiers (MonoImage *m, int n, MonoCustomMod *mod);
char *dis_stringify_param (MonoImage *m, MonoType *param);
-char *dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row);
+char *dis_stringify_method_signature (MonoImage *m, MonoMethodSignature *method, int methoddef_row, gboolean fully_qualified);
+char *dis_stringify_function_ptr (MonoImage *m, MonoMethodSignature *method);
+
+guint32 method_dor_to_token (guint32 idx);
/*
* These functions are used during the decoding of streams in the
@@ -55,3 +68,10 @@ const char *get_blob_encoded_size (const char *ptr, int *size);
MonoTypeEnum get_field_literal_type (MonoImage *m, guint32 blob_signature);
+/**
+ * This is called to initialize the table containing keyword names
+ */
+void init_key_table (void);
+
+extern gboolean show_method_tokens;
+extern gboolean show_tokens;
diff --git a/mono/dis/main.c b/mono/dis/main.c
index c555a549e5f..49ba78efc79 100644
--- a/mono/dis/main.c
+++ b/mono/dis/main.c
@@ -48,11 +48,10 @@ dump_header_data (MonoImage *img)
}
static void
-dump_cattrs (MonoImage *m, guint32 token, const char *indent)
+dump_cattrs_list (GList *list, const char *indent)
{
- GList *tmp, *list;
+ GList *tmp;
- list = dis_get_custom_attrs (m, token);
for (tmp = list; tmp; tmp = tmp->next) {
fprintf (output, "%s%s\n", indent, (char*)tmp->data);
g_free (tmp->data);
@@ -61,6 +60,86 @@ dump_cattrs (MonoImage *m, guint32 token, const char *indent)
}
static void
+dump_cattrs (MonoImage *m, guint32 token, const char *indent)
+{
+ GList *list;
+
+ list = dis_get_custom_attrs (m, token);
+ dump_cattrs_list (list, indent);
+}
+
+static const char*
+get_il_security_action (int val)
+{
+ static char buf [32];
+
+ switch (val) {
+ case SECURITY_ACTION_DEMAND:
+ return "demand";
+ case SECURITY_ACTION_ASSERT:
+ return "assert";
+ case SECURITY_ACTION_DENY:
+ return "deny";
+ case SECURITY_ACTION_PERMITONLY:
+ return "permitonly";
+ case SECURITY_ACTION_LINKDEMAND:
+ return "linkcheck";
+ case SECURITY_ACTION_INHERITDEMAND:
+ return "inheritcheck";
+ case SECURITY_ACTION_REQMIN:
+ return "reqmin";
+ case SECURITY_ACTION_REQOPT:
+ return "reqopt";
+ case SECURITY_ACTION_REQREFUSE:
+ return "reqrefuse";
+ /* Special actions (for non CAS permissions) */
+ case SECURITY_ACTION_NONCASDEMAND:
+ return "noncasdemand";
+ case SECURITY_ACTION_NONCASLINKDEMAND:
+ return "noncaslinkdemand";
+ case SECURITY_ACTION_NONCASINHERITANCE:
+ return "noncasinheritance";
+ /* Fx 2.0 actions (for both CAS and non-CAS permissions) */
+ case SECURITY_ACTION_LINKDEMANDCHOICE:
+ return "linkdemandor";
+ case SECURITY_ACTION_INHERITDEMANDCHOICE:
+ return "inheritancedemandor";
+ case SECURITY_ACTION_DEMANDCHOICE:
+ return "demandor";
+ default:
+ g_snprintf (buf, sizeof (buf), "0x%04X", val);
+ return buf;
+ }
+}
+
+#define OBJECT_TYPE_TYPEDEF 0
+#define OBJECT_TYPE_METHODDEF 1
+#define OBJECT_TYPE_ASSEMBLYDEF 2
+
+static void
+dump_declarative_security (MonoImage *m, guint32 objectType, guint32 token, const char *indent)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_DECLSECURITY];
+ guint32 cols [MONO_DECL_SECURITY_SIZE];
+ int i, len;
+ guint32 idx;
+ const char *blob, *action;
+
+ for (i = 1; i <= t->rows; i++) {
+ mono_metadata_decode_row (t, i - 1, cols, MONO_DECL_SECURITY_SIZE);
+ blob = mono_metadata_blob_heap (m, cols [MONO_DECL_SECURITY_PERMISSIONSET]);
+ len = mono_metadata_decode_blob_size (blob, &blob);
+ action = get_il_security_action (cols [MONO_DECL_SECURITY_ACTION]);
+ idx = cols [MONO_DECL_SECURITY_PARENT];
+ if (((idx & MONO_HAS_DECL_SECURITY_MASK) == objectType) && ((idx >> MONO_HAS_DECL_SECURITY_BITS) == token)) {
+ char *dump = data_dump (blob, len, indent);
+ fprintf (output, "%s.permissionset %s = %s", indent, action, dump);
+ g_free (dump);
+ }
+ }
+}
+
+static void
dis_directive_assembly (MonoImage *m)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_ASSEMBLY];
@@ -74,20 +153,23 @@ dis_directive_assembly (MonoImage *m)
fprintf (output, ".assembly '%s'\n{\n",
mono_metadata_string_heap (m, cols [MONO_ASSEMBLY_NAME]));
dump_cattrs (m, MONO_TOKEN_ASSEMBLY | 1, " ");
+ dump_declarative_security (m, OBJECT_TYPE_ASSEMBLYDEF, 1, " ");
fprintf (output,
" .hash algorithm 0x%08x\n"
- " .ver %d:%d:%d:%d"
- "%s %s"
- "%s"
- "\n"
- "}\n",
+ " .ver %d:%d:%d:%d\n",
cols [MONO_ASSEMBLY_HASH_ALG],
cols [MONO_ASSEMBLY_MAJOR_VERSION], cols [MONO_ASSEMBLY_MINOR_VERSION],
- cols [MONO_ASSEMBLY_BUILD_NUMBER], cols [MONO_ASSEMBLY_REV_NUMBER],
- cols [MONO_ASSEMBLY_CULTURE] ? "\n .locale" : "",
- cols [MONO_ASSEMBLY_CULTURE] ? mono_metadata_string_heap (m, cols [MONO_ASSEMBLY_CULTURE]) : "",
- cols [MONO_ASSEMBLY_PUBLIC_KEY] ? "\n .publickey" : ""
- );
+ cols [MONO_ASSEMBLY_BUILD_NUMBER], cols [MONO_ASSEMBLY_REV_NUMBER]);
+ if (cols [MONO_ASSEMBLY_CULTURE])
+ fprintf (output, " .locale %s\n", mono_metadata_string_heap (m, cols [MONO_ASSEMBLY_CULTURE]));
+ if (cols [MONO_ASSEMBLY_PUBLIC_KEY]) {
+ const char* b = mono_metadata_blob_heap (m, cols [MONO_ASSEMBLY_PUBLIC_KEY]);
+ int len = mono_metadata_decode_blob_size (b, &b);
+ char *dump = data_dump (b, len, "\t\t");
+ fprintf (output, " .publickey =%s", dump);
+ g_free (dump);
+ }
+ fprintf (output, "}\n");
}
static void
@@ -101,40 +183,129 @@ dis_directive_assemblyref (MonoImage *m)
return;
for (i = 0; i < t->rows; i++){
+ char *esc;
+
mono_metadata_decode_row (t, i, cols, MONO_ASSEMBLYREF_SIZE);
+ esc = get_escaped_name (mono_metadata_string_heap (m, cols [MONO_ASSEMBLYREF_NAME]));
+
fprintf (output,
".assembly extern %s\n"
"{\n"
- " .ver %d:%d:%d:%d\n"
- "}\n",
- mono_metadata_string_heap (m, cols [MONO_ASSEMBLYREF_NAME]),
+ " .ver %d:%d:%d:%d\n",
+ esc,
cols [MONO_ASSEMBLYREF_MAJOR_VERSION], cols [MONO_ASSEMBLYREF_MINOR_VERSION],
cols [MONO_ASSEMBLYREF_BUILD_NUMBER], cols [MONO_ASSEMBLYREF_REV_NUMBER]
);
+ if (cols [MONO_ASSEMBLYREF_CULTURE]){
+ fprintf (output, " .locale %s\n", mono_metadata_string_heap (m, cols [MONO_ASSEMBLYREF_CULTURE]));
+ }
+ if (cols [MONO_ASSEMBLYREF_PUBLIC_KEY]){
+ const char* b = mono_metadata_blob_heap (m, cols [MONO_ASSEMBLYREF_PUBLIC_KEY]);
+ int len = mono_metadata_decode_blob_size (b, &b);
+ char *dump = data_dump (b, len, "\t\t");
+ fprintf (output, " .publickeytoken =%s", dump);
+ g_free (dump);
+ }
+ fprintf (output, "}\n");
+ g_free (esc);
+ }
+}
+
+static void
+dis_directive_module (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_MODULE];
+ int i;
+
+ for (i = 0; i < t->rows; i++){
+ guint32 cols [MONO_MODULE_SIZE];
+ const char *name;
+ char *guid, *ename;
+
+ mono_metadata_decode_row (t, i, cols, MONO_MODULE_SIZE);
+
+ name = mono_metadata_string_heap (m, cols [MONO_MODULE_NAME]);
+ ename = get_escaped_name (name);
+ guid = get_guid (m, cols [MONO_MODULE_MVID]);
+ fprintf (output, ".module %s // GUID = %s\n\n", ename, guid);
+ g_free (ename);
+
+ dump_cattrs (m, MONO_TOKEN_MODULE | (i + 1), "");
+ }
+}
+
+static void
+dis_directive_moduleref (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_MODULEREF];
+ int i;
+
+ for (i = 0; i < t->rows; i++){
+ guint32 cols [MONO_MODULEREF_SIZE];
+ const char *name;
+
+ mono_metadata_decode_row (t, i, cols, MONO_MODULEREF_SIZE);
+
+ name = mono_metadata_string_heap (m, cols [MONO_MODULEREF_NAME]);
+ fprintf (output, ".module extern %s\n", name);
+ }
+
+}
+
+static void
+dis_directive_file (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_FILE];
+ int i, j, len;
+ guint32 entry_point;
+
+ entry_point = mono_image_get_entry_point (m);
+
+ for (i = 0; i < t->rows; i++){
+ guint32 cols [MONO_FILE_SIZE];
+ const char *name, *hash;
+ guint32 token;
+
+ mono_metadata_decode_row (t, i, cols, MONO_FILE_SIZE);
+
+ name = mono_metadata_string_heap (m, cols [MONO_FILE_NAME]);
+
+ hash = mono_metadata_blob_heap (m, cols [MONO_FILE_HASH_VALUE]);
+ len = mono_metadata_decode_blob_size (hash, &hash);
+
+ fprintf (output, ".file %s%s .hash = (", name,
+ cols [MONO_FILE_FLAGS] & FILE_CONTAINS_NO_METADATA ? " nometadata" : "");
+
+ for (j = 0; j < len; ++j)
+ fprintf (output, " %02X", hash [j] & 0xff);
+
+ token = mono_metadata_make_token (MONO_TABLE_FILE, i + 1);
+ fprintf (output, " )%s\n", (token == entry_point) ? " .entrypoint" : "");
}
+
}
-static map_t visibility_map [] = {
+static dis_map_t visibility_map [] = {
{ TYPE_ATTRIBUTE_NOT_PUBLIC, "private " },
{ TYPE_ATTRIBUTE_PUBLIC, "public " },
- { TYPE_ATTRIBUTE_NESTED_PUBLIC, "nested-public " },
- { TYPE_ATTRIBUTE_NESTED_PRIVATE, "nested-private " },
- { TYPE_ATTRIBUTE_NESTED_FAMILY, "family " },
- { TYPE_ATTRIBUTE_NESTED_ASSEMBLY, "nested-assembly" },
- { TYPE_ATTRIBUTE_NESTED_FAM_AND_ASSEM, "nested-fam-and-assembly" },
- { TYPE_ATTRIBUTE_NESTED_FAM_OR_ASSEM, "nested-fam-or-assembly" },
+ { TYPE_ATTRIBUTE_NESTED_PUBLIC, "nested public " },
+ { TYPE_ATTRIBUTE_NESTED_PRIVATE, "nested private " },
+ { TYPE_ATTRIBUTE_NESTED_FAMILY, "nested family " },
+ { TYPE_ATTRIBUTE_NESTED_ASSEMBLY, "nested assembly " },
+ { TYPE_ATTRIBUTE_NESTED_FAM_AND_ASSEM, "nested famandassem " },
+ { TYPE_ATTRIBUTE_NESTED_FAM_OR_ASSEM, "nested famorassem " },
{ 0, NULL }
};
-static map_t layout_map [] = {
+static dis_map_t layout_map [] = {
{ TYPE_ATTRIBUTE_AUTO_LAYOUT, "auto " },
{ TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT, "sequential " },
{ TYPE_ATTRIBUTE_EXPLICIT_LAYOUT, "explicit " },
{ 0, NULL }
};
-static map_t format_map [] = {
+static dis_map_t format_map [] = {
{ TYPE_ATTRIBUTE_ANSI_CLASS, "ansi " },
{ TYPE_ATTRIBUTE_UNICODE_CLASS, "unicode " },
{ TYPE_ATTRIBUTE_AUTO_CLASS, "auto " },
@@ -184,6 +355,7 @@ dis_field_list (MonoImage *m, guint32 start, guint32 end)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_FIELD];
guint32 cols [MONO_FIELD_SIZE];
+ char *esname;
char rva_desc [32];
guint32 rva;
int i;
@@ -211,38 +383,39 @@ dis_field_list (MonoImage *m, guint32 start, guint32 end)
mono_metadata_field_info (m, i, &field_offset, NULL, NULL);
if (field_offset != -1)
attrs = g_strdup_printf ("[%d]", field_offset);
+ esname = get_escaped_name (mono_metadata_string_heap (m, cols [MONO_FIELD_NAME]));
if (cols [MONO_FIELD_FLAGS] & FIELD_ATTRIBUTE_LITERAL){
char *lit;
guint32 const_cols [MONO_CONSTANT_SIZE];
guint32 crow;
- if ((crow = mono_metadata_get_constant_index (m, MONO_TOKEN_FIELD_DEF | (i+1)))) {
+ if ((crow = mono_metadata_get_constant_index (m, MONO_TOKEN_FIELD_DEF | (i+1), 0))) {
mono_metadata_decode_row (&m->tables [MONO_TABLE_CONSTANT], crow-1, const_cols, MONO_CONSTANT_SIZE);
lit = get_constant (m, const_cols [MONO_CONSTANT_TYPE], const_cols [MONO_CONSTANT_VALUE]);
} else {
lit = g_strdup ("not found");
}
+
fprintf (output, " .field %s %s %s = ",
- flags, sig,
- mono_metadata_string_heap (m, cols [MONO_FIELD_NAME]));
+ flags, sig, esname);
fprintf (output, "%s\n", lit);
g_free (lit);
} else
fprintf (output, " .field %s %s %s %s%s\n",
- attrs? attrs: "", flags, sig,
- mono_metadata_string_heap (m, cols [MONO_FIELD_NAME]), rva_desc);
+ attrs? attrs: "", flags, sig, esname, rva_desc);
g_free (attrs);
g_free (flags);
g_free (sig);
+ g_free (esname);
dump_cattrs (m, MONO_TOKEN_FIELD_DEF | (i + 1), " ");
}
}
-static map_t method_access_map [] = {
+static dis_map_t method_access_map [] = {
{ METHOD_ATTRIBUTE_COMPILER_CONTROLLED, "compilercontrolled " },
- { METHOD_ATTRIBUTE_PRIVATE, "private" },
- { METHOD_ATTRIBUTE_FAM_AND_ASSEM, "famandassem" },
+ { METHOD_ATTRIBUTE_PRIVATE, "private " },
+ { METHOD_ATTRIBUTE_FAM_AND_ASSEM, "famandassem " },
{ METHOD_ATTRIBUTE_ASSEM, "assembly " },
{ METHOD_ATTRIBUTE_FAMILY, "family " },
{ METHOD_ATTRIBUTE_FAM_OR_ASSEM, "famorassem " },
@@ -250,7 +423,7 @@ static map_t method_access_map [] = {
{ 0, NULL }
};
-static map_t method_flags_map [] = {
+static dis_map_t method_flags_map [] = {
{ METHOD_ATTRIBUTE_STATIC, "static " },
{ METHOD_ATTRIBUTE_FINAL, "final " },
{ METHOD_ATTRIBUTE_VIRTUAL, "virtual " },
@@ -260,7 +433,8 @@ static map_t method_flags_map [] = {
{ METHOD_ATTRIBUTE_SPECIAL_NAME, "specialname " },
{ METHOD_ATTRIBUTE_RT_SPECIAL_NAME, "rtspecialname " },
{ METHOD_ATTRIBUTE_UNMANAGED_EXPORT, "export " },
- { METHOD_ATTRIBUTE_HAS_SECURITY, "hassecurity" },
+/* MS ilasm doesn't compile this statement - is must be added automagically when permissionset are present */
+/* { METHOD_ATTRIBUTE_HAS_SECURITY, "hassecurity" }, */
{ METHOD_ATTRIBUTE_REQUIRE_SEC_OBJECT, "requiresecobj" },
{ METHOD_ATTRIBUTE_PINVOKE_IMPL, "pinvokeimpl " },
{ 0, NULL }
@@ -287,13 +461,17 @@ method_flags (guint32 f)
return s;
}
-static map_t pinvoke_flags_map [] = {
+static dis_map_t pinvoke_flags_map [] = {
{ PINVOKE_ATTRIBUTE_NO_MANGLE , "nomangle " },
{ PINVOKE_ATTRIBUTE_SUPPORTS_LAST_ERROR, "lasterr " },
+ { PINVOKE_ATTRIBUTE_BEST_FIT_ENABLED, "bestfit:on" },
+ { PINVOKE_ATTRIBUTE_BEST_FIT_DISABLED, "bestfit:off" },
+ { PINVOKE_ATTRIBUTE_THROW_ON_UNMAPPABLE_ENABLED, "charmaperror:on" },
+ { PINVOKE_ATTRIBUTE_THROW_ON_UNMAPPABLE_DISABLED, "charmaperror:off" },
{ 0, NULL }
};
-static map_t pinvoke_call_conv_map [] = {
+static dis_map_t pinvoke_call_conv_map [] = {
{ PINVOKE_ATTRIBUTE_CALL_CONV_WINAPI, "winapi " },
{ PINVOKE_ATTRIBUTE_CALL_CONV_CDECL, "cdecl " },
{ PINVOKE_ATTRIBUTE_CALL_CONV_STDCALL, "stdcall " },
@@ -302,7 +480,7 @@ static map_t pinvoke_call_conv_map [] = {
{ 0, NULL }
};
-static map_t pinvoke_char_set_map [] = {
+static dis_map_t pinvoke_char_set_map [] = {
{ PINVOKE_ATTRIBUTE_CHAR_SET_NOT_SPEC, "" },
{ PINVOKE_ATTRIBUTE_CHAR_SET_ANSI, "ansi " },
{ PINVOKE_ATTRIBUTE_CHAR_SET_UNICODE , "unicode " },
@@ -333,7 +511,7 @@ pinvoke_flags (guint32 f)
return s;
}
-static map_t method_impl_map [] = {
+static dis_map_t method_impl_map [] = {
{ METHOD_IMPL_ATTRIBUTE_IL, "cil " },
{ METHOD_IMPL_ATTRIBUTE_NATIVE, "native " },
{ METHOD_IMPL_ATTRIBUTE_OPTIL, "optil " },
@@ -341,13 +519,13 @@ static map_t method_impl_map [] = {
{ 0, NULL }
};
-static map_t managed_type_map [] = {
+static dis_map_t managed_type_map [] = {
{ METHOD_IMPL_ATTRIBUTE_UNMANAGED, "unmanaged " },
{ METHOD_IMPL_ATTRIBUTE_MANAGED, "managed " },
{ 0, NULL }
};
-static map_t managed_impl_flags [] = {
+static dis_map_t managed_impl_flags [] = {
{ METHOD_IMPL_ATTRIBUTE_FORWARD_REF, "fwdref " },
{ METHOD_IMPL_ATTRIBUTE_PRESERVE_SIG, "preservesig " },
{ METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL, "internalcall " },
@@ -374,11 +552,38 @@ method_impl_flags (guint32 f)
}
static void
-dis_locals (MonoImage *m, MonoMethodHeader *mh)
+dis_locals (MonoImage *m, MonoMethodHeader *mh, const char *ptr)
{
int i;
- fprintf(output, "\t.locals %s(\n", mh->init_locals ? "init " : "");
+ if (show_tokens) {
+ unsigned char flags = *(const unsigned char *) ptr;
+ unsigned char format = flags & METHOD_HEADER_FORMAT_MASK;
+ guint16 fat_flags;
+ guint32 local_var_sig_tok, max_stack, code_size, init_locals;
+ int hsize;
+
+ g_assert (format == METHOD_HEADER_FAT_FORMAT);
+ fat_flags = read16 (ptr);
+ ptr += 2;
+ hsize = (fat_flags >> 12) & 0xf;
+ max_stack = read16 (ptr);
+ ptr += 2;
+ code_size = read32 (ptr);
+ ptr += 4;
+ local_var_sig_tok = read32 (ptr);
+ ptr += 4;
+
+ if (fat_flags & METHOD_HEADER_INIT_LOCALS)
+ init_locals = 1;
+ else
+ init_locals = 0;
+
+ fprintf(output, "\t.locals /*%08x*/ %s(\n",
+ local_var_sig_tok, init_locals ? "init " : "");
+ } else
+ fprintf(output, "\t.locals %s(\n", mh->init_locals ? "init " : "");
+
for (i=0; i < mh->num_locals; ++i) {
char * desc;
if (i)
@@ -392,19 +597,26 @@ dis_locals (MonoImage *m, MonoMethodHeader *mh)
}
static void
-dis_code (MonoImage *m, guint32 rva)
+dis_code (MonoImage *m, guint32 token, guint32 rva)
{
MonoMethodHeader *mh;
- MonoCLIImageInfo *ii = m->image_info;
- const char *ptr = mono_cli_rva_map (ii, rva);
+ const char *ptr = mono_image_rva_map (m, rva);
const char *loc;
+ gchar *override;
+ guint32 entry_point;
if (rva == 0)
return;
+ override = get_method_override (m, token);
+ if (override) {
+ fprintf (output, "\t.override method %s\n", override);
+ g_free (override);
+ }
+
mh = mono_metadata_parse_mh (m, ptr);
- if (ii->cli_cli_header.ch_entry_point){
- loc = mono_metadata_locate_token (m, ii->cli_cli_header.ch_entry_point);
+ if ((entry_point = mono_image_get_entry_point (m))){
+ loc = mono_metadata_locate_token (m, entry_point);
if (rva == read32 (loc))
fprintf (output, "\t.entrypoint\n");
}
@@ -412,7 +624,7 @@ dis_code (MonoImage *m, guint32 rva)
fprintf (output, "\t// Code size %d (0x%x)\n", mh->code_size, mh->code_size);
fprintf (output, "\t.maxstack %d\n", mh->max_stack);
if (mh->num_locals)
- dis_locals (m, mh);
+ dis_locals (m, mh, ptr);
dissasemble_cil (m, mh);
/*
@@ -449,7 +661,7 @@ pinvoke_info (MonoImage *m, guint32 mindex)
scope = mono_metadata_string_heap (m, mr_cols [MONO_MODULEREF_NAME]);
- return g_strdup_printf ("(%s as %s %s)", scope, import,
+ return g_strdup_printf ("(\"%s\" as \"%s\" %s)", scope, import,
flags);
g_free (flags);
}
@@ -458,6 +670,49 @@ pinvoke_info (MonoImage *m, guint32 mindex)
return NULL;
}
+static void
+dump_cattrs_for_method_params (MonoImage *m, guint32 midx, MonoMethodSignature *sig) {
+ MonoTableInfo *methodt;
+ MonoTableInfo *paramt;
+ guint param_index, lastp, i;
+
+ methodt = &m->tables [MONO_TABLE_METHOD];
+ paramt = &m->tables [MONO_TABLE_PARAM];
+ param_index = mono_metadata_decode_row_col (methodt, midx, MONO_METHOD_PARAMLIST);
+ if (midx + 1 < methodt->rows)
+ lastp = mono_metadata_decode_row_col (methodt, midx + 1, MONO_METHOD_PARAMLIST);
+ else
+ lastp = paramt->rows + 1;
+ for (i = param_index; i < lastp; ++i) {
+ char *lit;
+ int crow;
+ guint32 param_cols [MONO_PARAM_SIZE];
+ GList *list;
+
+ list = dis_get_custom_attrs (m, MONO_TOKEN_PARAM_DEF | i);
+
+ mono_metadata_decode_row (paramt, i-1, param_cols, MONO_PARAM_SIZE);
+ if (!(param_cols[MONO_PARAM_FLAGS] & PARAM_ATTRIBUTE_HAS_DEFAULT)) {
+ if(list != NULL)
+ fprintf (output, "\t.param [%d]\n", param_cols[MONO_PARAM_SEQUENCE]);
+ } else {
+ fprintf (output, "\t.param [%d] = ", param_cols[MONO_PARAM_SEQUENCE]);
+
+ if ((crow = mono_metadata_get_constant_index(m, MONO_TOKEN_PARAM_DEF | i, 0))) {
+ guint32 const_cols [MONO_CONSTANT_SIZE];
+ mono_metadata_decode_row( &m->tables[MONO_TABLE_CONSTANT], crow-1, const_cols, MONO_CONSTANT_SIZE);
+ lit = get_constant(m, const_cols [MONO_CONSTANT_TYPE], const_cols [MONO_CONSTANT_VALUE]);
+ }
+ else {
+ lit = g_strdup ("not found");
+ }
+ fprintf(output, "%s\n", lit);
+ g_free(lit);
+ }
+ dump_cattrs_list (list, "\t");
+ }
+}
+
/**
* dis_method_list:
* @m: metadata context
@@ -467,7 +722,7 @@ pinvoke_info (MonoImage *m, guint32 mindex)
* This routine displays the methods in the Method Table from @start to @end
*/
static void
-dis_method_list (MonoImage *m, guint32 start, guint32 end)
+dis_method_list (const char *klass_name, MonoImage *m, guint32 start, guint32 end)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_METHOD];
guint32 cols [MONO_METHOD_SIZE];
@@ -484,6 +739,7 @@ dis_method_list (MonoImage *m, guint32 start, guint32 end)
char *flags, *impl_flags;
const char *sig;
char *sig_str;
+ guint32 token;
mono_metadata_decode_row (t, i, cols, MONO_METHOD_SIZE);
@@ -492,26 +748,38 @@ dis_method_list (MonoImage *m, guint32 start, guint32 end)
sig = mono_metadata_blob_heap (m, cols [MONO_METHOD_SIGNATURE]);
mono_metadata_decode_blob_size (sig, &sig);
- ms = mono_metadata_parse_method_signature (m, 1, sig, &sig);
- sig_str = dis_stringify_method_signature (m, ms, i + 1);
-
+ ms = mono_metadata_parse_method_signature (m, i + 1, sig, &sig);
+ sig_str = dis_stringify_method_signature (m, ms, i + 1, FALSE);
+
fprintf (output, " // method line %d\n", i + 1);
fprintf (output, " .method %s", flags);
- if (cols [MONO_METHOD_FLAGS] & METHOD_ATTRIBUTE_PINVOKE_IMPL)
- fprintf (output, "%s", pinvoke_info (m, i));
+ if ((cols [MONO_METHOD_FLAGS] & METHOD_ATTRIBUTE_PINVOKE_IMPL) && (cols [MONO_METHOD_RVA] == 0)) {
+ gchar *pi = pinvoke_info (m, i);
+ if (pi) {
+ fprintf (output, "%s", pi);
+ g_free (pi);
+ }
+ }
fprintf (output, "\n %s", sig_str);
fprintf (output, " %s\n", impl_flags);
g_free (flags);
g_free (impl_flags);
+
+ token = MONO_TOKEN_METHOD_DEF | (i + 1);
fprintf (output, " {\n");
- dump_cattrs (m, MONO_TOKEN_METHOD_DEF | (i + 1), " ");
+ dump_cattrs (m, token, " ");
+ dump_cattrs_for_method_params (m, i, ms);
/* FIXME: need to sump also param custom attributes */
fprintf (output, " // Method begins at RVA 0x%x\n", cols [MONO_METHOD_RVA]);
- dis_code (m, cols [MONO_METHOD_RVA]);
- fprintf (output, " } // end of method %s\n\n", sig_str);
+ dump_declarative_security (m, OBJECT_TYPE_METHODDEF, i + 1, " ");
+ if (cols [MONO_METHOD_IMPLFLAGS] & METHOD_IMPL_ATTRIBUTE_NATIVE)
+ fprintf (output, " // Disassembly of native methods is not supported\n");
+ else
+ dis_code (m, token, cols [MONO_METHOD_RVA]);
+ fprintf (output, " } // end of method %s::%s\n\n", klass_name, sig_str);
mono_metadata_free_method_signature (ms);
g_free (sig_str);
}
@@ -556,7 +824,7 @@ dis_property_methods (MonoImage *m, guint32 prop)
start = mono_metadata_methods_from_property (m, prop, &end);
while (start < end) {
mono_metadata_decode_row (msemt, start, cols, MONO_METHOD_SEMA_SIZE);
- sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD]);
+ sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD], TRUE);
fprintf (output, "\t\t%s %s\n", type [cols [MONO_METHOD_SEMA_SEMANTICS]], sig);
g_free (sig);
++start;
@@ -590,11 +858,9 @@ dis_property_signature (MonoImage *m, guint32 prop_idx)
type = mono_metadata_parse_type (m, MONO_PARSE_TYPE, 0, ptr, &ptr);
blurb = dis_stringify_type (m, type);
if (prop_flags & 0x0200)
- g_string_append (res, "special ");
+ g_string_append (res, "specialname ");
if (prop_flags & 0x0400)
- g_string_append (res, "runtime ");
- if (prop_flags & 0x1000)
- g_string_append (res, "hasdefault ");
+ g_string_append (res, "rtspecialname ");
g_string_sprintfa (res, "%s %s (", blurb, name);
g_free (blurb);
mono_metadata_free_type (type);
@@ -634,17 +900,27 @@ static char*
dis_event_signature (MonoImage *m, guint32 event_idx)
{
MonoTableInfo *et = &m->tables [MONO_TABLE_EVENT];
- const char *name;
- char *type, *res;
+ char *type, *result, *esname;
guint32 cols [MONO_EVENT_SIZE];
+ int event_flags;
+ GString *res = g_string_new ("");
mono_metadata_decode_row (et, event_idx, cols, MONO_EVENT_SIZE);
- name = mono_metadata_string_heap (m, cols [MONO_EVENT_NAME]);
+ esname = get_escaped_name (mono_metadata_string_heap (m, cols [MONO_EVENT_NAME]));
type = get_typedef_or_ref (m, cols [MONO_EVENT_TYPE]);
+ event_flags = cols [MONO_EVENT_FLAGS];
+
+ if (event_flags & 0x0200)
+ g_string_append (res, "specialname ");
+ if (event_flags & 0x0400)
+ g_string_append (res, "rtspecialname ");
+ g_string_sprintfa (res, "%s %s", type, esname);
- res = g_strdup_printf ("%s %s", type, name);
g_free (type);
- return res;
+ g_free (esname);
+ result = res->str;
+ g_string_free (res, FALSE);
+ return result;
}
static void
@@ -654,12 +930,12 @@ dis_event_methods (MonoImage *m, guint32 event)
MonoTableInfo *msemt = &m->tables [MONO_TABLE_METHODSEMANTICS];
guint32 cols [MONO_METHOD_SEMA_SIZE];
char *sig;
- const char *type;
+ const char *type = "";
start = mono_metadata_methods_from_event (m, event, &end);
while (start < end) {
mono_metadata_decode_row (msemt, start, cols, MONO_METHOD_SEMA_SIZE);
- sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD]);
+ sig = dis_stringify_method_signature (m, NULL, cols [MONO_METHOD_SEMA_METHOD], TRUE);
switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
case METHOD_SEMANTIC_OTHER:
type = ".other"; break;
@@ -699,6 +975,7 @@ dis_interfaces (MonoImage *m, guint32 typedef_row)
{
plocator_t loc;
guint start;
+ gboolean first_interface = 1;
guint32 cols [MONO_INTERFACEIMPL_SIZE];
char *intf;
MonoTableInfo *table = &m->tables [MONO_TABLE_INTERFACEIMPL];
@@ -728,13 +1005,79 @@ dis_interfaces (MonoImage *m, guint32 typedef_row)
if (cols [MONO_INTERFACEIMPL_CLASS] != loc.idx)
break;
intf = get_typedef_or_ref (m, cols [MONO_INTERFACEIMPL_INTERFACE]);
- fprintf (output, " \timplements %s\n", intf);
+ if (first_interface) {
+ fprintf (output, " \timplements %s", intf);
+ first_interface = 0;
+ } else {
+ fprintf (output, ", %s", intf);
+ }
g_free (intf);
++start;
}
}
/**
+ * dis_generic_param_and_constraints:
+ * @m: metadata context
+ * @table_type: Type of table (0 for typedef, 1 for methoddef)
+ * @row: Row in table
+ *
+ * Dissasembles the generic parameters for this type or method, also
+ * returns an allocated GString containing the generic constraints NULL
+ * if their are no generic constraints.
+ */
+static GString*
+dis_generic_param_and_constraints (MonoImage *m, int table_type, guint32 typedef_row)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_GENERICPARAM];
+ MonoTableInfo *ct = &m->tables [MONO_TABLE_GENERICPARAMCONSTRAINT];
+ GString* cnst_block = NULL;
+ guint32 cols [MONO_GENERICPARAM_SIZE];
+ guint32 ccols [MONO_GENPARCONSTRAINT_SIZE];
+ int i, own_tok, table, idx, found_count, cnst_start, cnst_ind;
+
+ g_assert (table_type != MONO_TYPEORMETHOD_TYPE || table_type != MONO_TYPEORMETHOD_METHOD);
+
+ found_count = cnst_start = 0;
+ for (i = 1; i <= t->rows; i++) {
+ mono_metadata_decode_row (t, i-1, cols, MONO_GENERICPARAM_SIZE);
+ own_tok = cols [MONO_GENERICPARAM_OWNER];
+ table = own_tok & MONO_TYPEORMETHOD_MASK;
+ idx = own_tok >> MONO_TYPEORMETHOD_BITS;
+
+ if (table != table_type || idx != typedef_row)
+ continue;
+
+ if (found_count == 0)
+ fprintf (output, "<");
+ else
+ fprintf (output, ", ");
+
+ for (cnst_ind = cnst_start; cnst_ind < ct->rows; cnst_ind++) {
+ char *sig;
+ mono_metadata_decode_row (ct, cnst_ind, ccols, MONO_GENPARCONSTRAINT_SIZE);
+ if (ccols [MONO_GENPARCONSTRAINT_GENERICPAR] != i)
+ continue;
+ if (cnst_block == NULL)
+ cnst_block = g_string_new ("");
+ sig = get_typedef_or_ref (m, ccols [MONO_GENPARCONSTRAINT_CONSTRAINT]);
+ fprintf (output, "(%s) ", sig);
+ g_free (sig);
+ cnst_start = cnst_ind;
+ }
+
+ fprintf (output, "%s", mono_metadata_string_heap (m, cols [MONO_GENERICPARAM_NAME]));
+
+ found_count++;
+ }
+
+ if (found_count)
+ fprintf (output, ">");
+
+ return cnst_block;
+}
+
+/**
* dis_type:
* @m: metadata context
* @n: index of type to disassemble
@@ -745,12 +1088,15 @@ static void
dis_type (MonoImage *m, int n)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_TYPEDEF];
+ GString *cnst_block = NULL;
guint32 cols [MONO_TYPEDEF_SIZE];
guint32 cols_next [MONO_TYPEDEF_SIZE];
const char *name, *nspace;
+ char *esname;
guint32 packing_size, class_size;
gboolean next_is_valid, last;
-
+ guint32 nested;
+
mono_metadata_decode_row (t, n, cols, MONO_TYPEDEF_SIZE);
if (t->rows > n + 1) {
@@ -759,22 +1105,38 @@ dis_type (MonoImage *m, int n)
} else
next_is_valid = 0;
+ name = mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAME]);
nspace = mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAMESPACE]);
if (*nspace)
fprintf (output, ".namespace %s\n{\n", nspace);
- name = mono_metadata_string_heap (m, cols [MONO_TYPEDEF_NAME]);
+ esname = get_escaped_name (name);
if ((cols [MONO_TYPEDEF_FLAGS] & TYPE_ATTRIBUTE_CLASS_SEMANTIC_MASK) == TYPE_ATTRIBUTE_CLASS){
- char *base = get_typedef_or_ref (m, cols [MONO_TYPEDEF_EXTENDS]);
- fprintf (output, " .class %s%s\n", typedef_flags (cols [MONO_TYPEDEF_FLAGS]), name);
- fprintf (output, " \textends %s\n", base);
- g_free (base);
- } else
- fprintf (output, " .class interface %s%s\n", typedef_flags (cols [MONO_TYPEDEF_FLAGS]), name);
-
+ fprintf (output, " .class %s%s", typedef_flags (cols [MONO_TYPEDEF_FLAGS]), esname);
+
+ cnst_block = dis_generic_param_and_constraints (m, MONO_TYPEORMETHOD_TYPE, n+1);
+ fprintf (output, "\n");
+ if (cols [MONO_TYPEDEF_EXTENDS]) {
+ char *base = get_typedef_or_ref (m, cols [MONO_TYPEDEF_EXTENDS]);
+ fprintf (output, " \textends %s\n", base);
+ g_free (base);
+ }
+ } else {
+ fprintf (output, " .class interface %s%s", typedef_flags (cols [MONO_TYPEDEF_FLAGS]), esname);
+
+ cnst_block = dis_generic_param_and_constraints (m, MONO_TYPEORMETHOD_TYPE, n+1);
+ fprintf (output, "\n");
+ }
+
+ g_free (esname);
dis_interfaces (m, n + 1);
fprintf (output, " {\n");
+ if (cnst_block) {
+ fprintf (output, "%s", cnst_block->str);
+ g_string_free (cnst_block, TRUE);
+ }
dump_cattrs (m, MONO_TOKEN_TYPE_DEF | (n + 1), " ");
+ dump_declarative_security (m, OBJECT_TYPE_TYPEDEF, (n + 1), " ");
if (mono_metadata_packing_from_typedef (m, n + 1, &packing_size, &class_size)) {
fprintf (output, " .pack %d\n", packing_size);
@@ -800,17 +1162,74 @@ dis_type (MonoImage *m, int n)
last = m->tables [MONO_TABLE_METHOD].rows;
if (cols [MONO_TYPEDEF_METHOD_LIST] && cols [MONO_TYPEDEF_METHOD_LIST] <= m->tables [MONO_TABLE_METHOD].rows)
- dis_method_list (m, cols [MONO_TYPEDEF_METHOD_LIST] - 1, last);
+ dis_method_list (name, m, cols [MONO_TYPEDEF_METHOD_LIST] - 1, last);
dis_property_list (m, n);
dis_event_list (m, n);
- fprintf (output, " } // end of type %s%s%s\n", nspace, *nspace? ".": "", name);
+ t = &m->tables [MONO_TABLE_NESTEDCLASS];
+ nested = mono_metadata_nesting_typedef (m, n + 1, 1);
+ while (nested) {
+ dis_type (m, mono_metadata_decode_row_col (t, nested - 1, MONO_NESTED_CLASS_NESTED) - 1);
+ nested = mono_metadata_nesting_typedef (m, n + 1, nested + 1);
+ }
+
+ fprintf (output, " } // end of class %s%s%s\n", nspace, *nspace? ".": "", name);
if (*nspace)
fprintf (output, "}\n");
fprintf (output, "\n");
}
+
+/**
+ * dis_globals
+ * @m: metadata context
+ *
+ * disassembles all the global fields and methods
+ */
+static void
+dis_globals (MonoImage *m)
+{
+ MonoTableInfo *t = &m->tables [MONO_TABLE_TYPEDEF];
+ guint32 cols [MONO_TYPEDEF_SIZE];
+ guint32 cols_next [MONO_TYPEDEF_SIZE];
+ gboolean next_is_valid, last;
+ gchar *name;
+
+ name = g_strdup ("<Module>");
+
+ mono_metadata_decode_row (t, 0, cols, MONO_TYPEDEF_SIZE);
+
+ if (t->rows > 1) {
+ mono_metadata_decode_row (t, 1, cols_next, MONO_TYPEDEF_SIZE);
+ next_is_valid = 1;
+ } else
+ next_is_valid = 0;
+
+ /*
+ * The value in the table is always valid, we know we have fields
+ * if the value stored is different than the next record.
+ */
+
+ if (next_is_valid)
+ last = cols_next [MONO_TYPEDEF_FIELD_LIST] - 1;
+ else
+ last = m->tables [MONO_TABLE_FIELD].rows;
+
+ if (cols [MONO_TYPEDEF_FIELD_LIST] && cols [MONO_TYPEDEF_FIELD_LIST] <= m->tables [MONO_TABLE_FIELD].rows)
+ dis_field_list (m, cols [MONO_TYPEDEF_FIELD_LIST] - 1, last);
+ fprintf (output, "\n");
+
+ if (next_is_valid)
+ last = cols_next [MONO_TYPEDEF_METHOD_LIST] - 1;
+ else
+ last = m->tables [MONO_TABLE_METHOD].rows;
+
+ if (cols [MONO_TYPEDEF_METHOD_LIST] && cols [MONO_TYPEDEF_METHOD_LIST] <= m->tables [MONO_TABLE_METHOD].rows)
+ dis_method_list (name, m, cols [MONO_TYPEDEF_METHOD_LIST] - 1, last);
+
+}
+
/**
* dis_types:
* @m: metadata context
@@ -822,9 +1241,16 @@ dis_types (MonoImage *m)
{
MonoTableInfo *t = &m->tables [MONO_TABLE_TYPEDEF];
int i;
-
- for (i = 1; i < t->rows; i++)
- dis_type (m, i);
+ guint32 flags;
+
+ dis_globals (m);
+
+ for (i = 1; i < t->rows; i++) {
+ flags = mono_metadata_decode_row_col (t, i, MONO_TYPEDEF_FLAGS);
+ flags &= TYPE_ATTRIBUTE_VISIBILITY_MASK;
+ if (flags == TYPE_ATTRIBUTE_PUBLIC || flags == TYPE_ATTRIBUTE_NOT_PUBLIC)
+ dis_type (m, i);
+ }
}
/**
@@ -846,19 +1272,19 @@ dis_data (MonoImage *m)
for (i = 0; i < t->rows; i++) {
mono_metadata_decode_row (t, i, cols, MONO_FIELD_RVA_SIZE);
- rva = mono_cli_rva_map (m->image_info, cols [MONO_FIELD_RVA_RVA]);
+ rva = mono_image_rva_map (m, cols [MONO_FIELD_RVA_RVA]);
sig = mono_metadata_blob_heap (m, mono_metadata_decode_row_col (ft, cols [MONO_FIELD_RVA_FIELD] -1, MONO_FIELD_SIGNATURE));
mono_metadata_decode_value (sig, &sig);
/* FIELD signature == 0x06 */
g_assert (*sig == 0x06);
type = mono_metadata_parse_field_type (m, 0, sig + 1, &sig);
mono_class_init (mono_class_from_mono_type (type));
- size = mono_class_value_size (mono_class_from_mono_type (type), &align);
+ size = mono_type_size (type, &align);
fprintf (output, ".data D_%08x = bytearray (", cols [MONO_FIELD_RVA_RVA]);
for (b = 0; b < size; ++b) {
if (!(b % 16))
fprintf (output, "\n\t");
- fprintf (output, " %02x", rva [b] & 0xff);
+ fprintf (output, " %02X", rva [b] & 0xff);
}
fprintf (output, ") // size: %d\n", size);
}
@@ -869,31 +1295,39 @@ struct {
int table;
void (*dumper) (MonoImage *m);
} table_list [] = {
- { "--assembly", MONO_TABLE_ASSEMBLY, dump_table_assembly },
- { "--assemblyref", MONO_TABLE_ASSEMBLYREF, dump_table_assemblyref },
- { "--fields", MONO_TABLE_FIELD, dump_table_field },
- { "--marshal", MONO_TABLE_FIELDMARSHAL, dump_table_field_marshal },
- { "--memberref", MONO_TABLE_MEMBERREF, dump_table_memberref },
- { "--param", MONO_TABLE_PARAM, dump_table_param },
- { "--typedef", MONO_TABLE_TYPEDEF, dump_table_typedef },
- { "--typeref", MONO_TABLE_TYPEREF, dump_table_typeref },
+ { "--assembly", MONO_TABLE_ASSEMBLY, dump_table_assembly },
+ { "--assemblyref", MONO_TABLE_ASSEMBLYREF, dump_table_assemblyref },
+ { "--classlayout", MONO_TABLE_CLASSLAYOUT, dump_table_class_layout },
+ { "--constant", MONO_TABLE_CONSTANT, dump_table_constant },
+ { "--customattr", MONO_TABLE_CUSTOMATTRIBUTE, dump_table_customattr },
+ { "--declsec", MONO_TABLE_DECLSECURITY, dump_table_declsec },
+ { "--event", MONO_TABLE_EVENT, dump_table_event },
{ "--exported", MONO_TABLE_EXPORTEDTYPE, dump_table_exported },
- { "--nested", MONO_TABLE_NESTEDCLASS, dump_table_nestedclass },
- { "--interface", MONO_TABLE_INTERFACEIMPL, dump_table_interfaceimpl },
- { "--classlayout", MONO_TABLE_CLASSLAYOUT, dump_table_class_layout },
- { "--constant", MONO_TABLE_CONSTANT, dump_table_constant },
- { "--customattr", MONO_TABLE_CUSTOMATTRIBUTE, dump_table_customattr },
- { "--property", MONO_TABLE_PROPERTY, dump_table_property },
- { "--propertymap", MONO_TABLE_PROPERTYMAP, dump_table_property_map },
- { "--event", MONO_TABLE_EVENT, dump_table_event },
- { "--file", MONO_TABLE_FILE, dump_table_file },
- { "--moduleref", MONO_TABLE_MODULEREF, dump_table_moduleref },
- { "--module", MONO_TABLE_MODULE, dump_table_module },
- { "--method", MONO_TABLE_METHOD, dump_table_method },
- { "--methodimpl", MONO_TABLE_METHODIMPL, dump_table_methodimpl },
- { "--methodsem", MONO_TABLE_METHODSEMANTICS, dump_table_methodsem },
- { "--manifest", MONO_TABLE_MANIFESTRESOURCE, dump_table_manifest },
- { NULL, -1 }
+ { "--fields", MONO_TABLE_FIELD, dump_table_field },
+ { "--file", MONO_TABLE_FILE, dump_table_file },
+ { "--genericpar", MONO_TABLE_GENERICPARAM, dump_table_genericpar },
+ { "--interface", MONO_TABLE_INTERFACEIMPL, dump_table_interfaceimpl },
+ { "--manifest", MONO_TABLE_MANIFESTRESOURCE, dump_table_manifest },
+ { "--marshal", MONO_TABLE_FIELDMARSHAL, dump_table_field_marshal },
+ { "--memberref", MONO_TABLE_MEMBERREF, dump_table_memberref },
+ { "--method", MONO_TABLE_METHOD, dump_table_method },
+ { "--methodimpl", MONO_TABLE_METHODIMPL, dump_table_methodimpl },
+ { "--methodsem", MONO_TABLE_METHODSEMANTICS, dump_table_methodsem },
+ { "--methodspec", MONO_TABLE_METHODSPEC, dump_table_methodspec },
+ { "--moduleref", MONO_TABLE_MODULEREF, dump_table_moduleref },
+ { "--module", MONO_TABLE_MODULE, dump_table_module },
+ { "--nested", MONO_TABLE_NESTEDCLASS, dump_table_nestedclass },
+ { "--param", MONO_TABLE_PARAM, dump_table_param },
+ { "--parconst", MONO_TABLE_GENERICPARAMCONSTRAINT, dump_table_parconstraint },
+ { "--property", MONO_TABLE_PROPERTY, dump_table_property },
+ { "--propertymap", MONO_TABLE_PROPERTYMAP, dump_table_property_map },
+ { "--typedef", MONO_TABLE_TYPEDEF, dump_table_typedef },
+ { "--typeref", MONO_TABLE_TYPEREF, dump_table_typeref },
+ { "--typespec", MONO_TABLE_TYPESPEC, dump_table_typespec },
+ { "--implmap", MONO_TABLE_IMPLMAP, dump_table_implmap },
+ { "--standalonesig", MONO_TABLE_STANDALONESIG, dump_table_standalonesig },
+ { "--blob", 0, dump_stream_blob },
+ { NULL, -1, }
};
/**
@@ -924,6 +1358,9 @@ disassemble_file (const char *file)
dis_directive_assemblyref (img);
dis_directive_assembly (img);
+ dis_directive_file (img);
+ dis_directive_module (img);
+ dis_directive_moduleref (img);
dis_types (img);
dis_data (img);
}
@@ -934,7 +1371,7 @@ disassemble_file (const char *file)
static void
usage (void)
{
- GString *args = g_string_new ("[--output=filename] [--help] [--mscorlib] ");
+ GString *args = g_string_new ("[--output=filename] [--help] [--mscorlib]\n");
int i;
for (i = 0; table_list [i].name != NULL; i++){
@@ -956,6 +1393,7 @@ main (int argc, char *argv [])
int i, j;
output = stdout;
+ init_key_table ();
for (i = 1; i < argc; i++){
if (argv [i][0] == '-'){
if (argv [i][1] == 'h')
@@ -965,6 +1403,12 @@ main (int argc, char *argv [])
else if (strcmp (argv [i], "--mscorlib") == 0) {
substitute_with_mscorlib_p = TRUE;
continue;
+ } else if (strcmp (argv [i], "--show-method-tokens") == 0) {
+ show_method_tokens = TRUE;
+ continue;
+ } else if (strcmp (argv [i], "--show-tokens") == 0) {
+ show_tokens = TRUE;
+ continue;
} else if (strncmp (argv [i], "--output=", 9) == 0) {
output = fopen (argv [i]+9, "w");
if (output == NULL) {
@@ -987,11 +1431,21 @@ main (int argc, char *argv [])
if (input_files == NULL)
usage ();
-
- mono_init (argv [0]);
- for (l = input_files; l; l = l->next)
- disassemble_file (l->data);
+ /*
+ * If we just have one file, use the corlib version it requires.
+ */
+ if (!input_files->next) {
+ char *filename = input_files->data;
+
+ mono_init_from_assembly (argv [0], filename);
+ disassemble_file (filename);
+ } else {
+ mono_init (argv [0]);
+
+ for (l = input_files; l; l = l->next)
+ disassemble_file (l->data);
+ }
return 0;
}
diff --git a/mono/dis/meta.h b/mono/dis/meta.h
index e1de23c7003..869b075905c 100644
--- a/mono/dis/meta.h
+++ b/mono/dis/meta.h
@@ -3,5 +3,6 @@
#include <mono/metadata/mono-endian.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/tokentype.h>
+#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/blob.h>
diff --git a/mono/dis/monodis.1 b/mono/dis/monodis.1
index a670f388772..fe7c8647aeb 100644
--- a/mono/dis/monodis.1
+++ b/mono/dis/monodis.1
@@ -21,6 +21,7 @@ monodis \- CIL image content dumper and disassembler.
[\-\-exported]
[\-\-fields]
[\-\-file]
+[\-\-genericpar]
[\-\-interface]
[\-\-manifest]
[\-\-memberref]
@@ -29,10 +30,12 @@ monodis \- CIL image content dumper and disassembler.
[\-\-module]
[\-\-moduleref]
[\-\-param]
+[\-\-parconst]
[\-\-property]
[\-\-propertymap]
[\-\-typedef]
[\-\-typeref]
+[\-\-blob]
[FILES...]
.SH DESCRIPTION
The \fImonodis\fP program is used to dump the contents a CIL image
@@ -50,6 +53,9 @@ Write output into \fIFILENAME\fP.
For non-corlib assemblies, use "mscorlib" as the assembly name. This
is useful for round-tripping the IL with ilasm.
.TP
+.I "--show-method-tokens"
+Display tokens for dissasembled methods
+.TP
.I "--assembly"
Dumps the contents of the assembly table
.TP
@@ -74,6 +80,8 @@ Dumps the contents of the fields table
.I "--file"
Dumps the contents of the file table
.TP
+.I "--genericpar"
+Dumps the contents of the generic parameter table.
.I "--interface"
Dumps the contents of the interface table
.TP
@@ -86,6 +94,9 @@ Dumps the contents of the memberref table
.I "--method"
Dumps the contents of the method table
.TP
+.I "--methodspec"
+Dumps the contents of the method spec table.
+.TP
.I "--methodsem"
Dumps the contents of the methodsem table
.TP
@@ -98,6 +109,9 @@ Dumps the contents of the moduleref table
.I "--param"
Dumps the contents of the param table
.TP
+.I "--parconst"
+Dumps the contents of the gemeric parameter constraint table
+.TP
.I "--property"
Dumps the contents of the property table
.TP
@@ -107,11 +121,17 @@ Dumps the contents of the propertymap table
.I "--typedef"
Dumps the contents of the typedef table
.TP
+.I "--typespec"
+Dumps the contents of the typespec table
+.TP
.I "--typeref"
Dumps the contents of the typeref table
+.TP
+.I "--blob"
+Dumps the entire contents of the blob stream as hex
.PP
If no flags are specified the program dumps the content of the image
-in a format that can be used to rountrip the code.
+in a format that can be used to rountrip the code.
.PP
.SH ENVIRONMENT VARIABLES
.TP
diff --git a/mono/dis/util.c b/mono/dis/util.c
index 997f67fe2b7..f3fff1c77e7 100644
--- a/mono/dis/util.c
+++ b/mono/dis/util.c
@@ -20,7 +20,7 @@
* Warning: returns static buffer.
*/
const char *
-map (guint32 code, map_t *table)
+map (guint32 code, dis_map_t *table)
{
int i;
@@ -38,7 +38,7 @@ map (guint32 code, map_t *table)
* Warning: returns static buffer.
*/
const char *
-flags (guint32 code, map_t *table)
+flags (guint32 code, dis_map_t *table)
{
static char buffer [1024];
int i;
@@ -75,10 +75,48 @@ hex_dump (const char *buffer, int base, int count)
for (i = 0; i < count; i++){
if (show_header)
if ((i % 16) == 0)
- printf ("\n0x%08x: ", (unsigned char) base + i);
+ printf ("\n0x%08X: ", (unsigned char) base + i);
- printf ("%02x ", (unsigned char) (buffer [i]));
+ printf ("%02X ", (unsigned char) (buffer [i]));
}
fflush (stdout);
}
+char*
+data_dump (const char *data, int len, const char* prefix) {
+ int i, j;
+ GString *str;
+ if (!len)
+ return g_strdup (" ()\n");
+ str = g_string_new (" (");
+ for (i = 0; i + 15 < len; i += 16) {
+ if (i == 0)
+ g_string_sprintfa (str, "\n");
+ g_string_sprintfa (str, "%s", prefix);
+ for (j = 0; j < 16; ++j)
+ g_string_sprintfa (str, "%02X ", (unsigned char) (data [i + j]));
+ g_string_sprintfa (str, i == len - 16? ") // ": " // ");
+ for (j = 0; j < 16; ++j)
+ g_string_sprintfa (str, "%c", data [i + j] >= 32 && data [i + j] <= 126? data [i + j]: '.');
+ g_string_sprintfa (str, "\n");
+ }
+ if (i == len)
+ return g_string_free (str, FALSE);
+ if (len > 16)
+ g_string_sprintfa (str, "%s", prefix);
+ j = i;
+ for (; i < len; ++i)
+ g_string_sprintfa (str, "%02X ", (unsigned char) (data [i]));
+ if (len > 16) {
+ /* align */
+ int count = 16 - (len % 16);
+ for (i = 0; i < count; ++i)
+ g_string_sprintfa (str, " ");
+ }
+ g_string_sprintfa (str, ") // ");
+ for (i = j; i < len; ++i)
+ g_string_sprintfa (str, "%c", data [i] >= 32 && data [i] <= 126? data [i]: '.');
+ g_string_sprintfa (str, "\n");
+ return g_string_free (str, FALSE);
+}
+
diff --git a/mono/dis/util.h b/mono/dis/util.h
index 4c33534049e..cbb9a4f365d 100644
--- a/mono/dis/util.h
+++ b/mono/dis/util.h
@@ -1,11 +1,10 @@
-
typedef struct {
int code;
const char *str;
-} map_t;
+} dis_map_t;
-const char *map (guint32 code, map_t *table);
-const char *flags (guint32 code, map_t *table);
+const char *map (guint32 code, dis_map_t *table);
+const char *flags (guint32 code, dis_map_t *table);
void hex_dump (const char *buffer, int base, int count);
+char* data_dump (const char *data, int len, const char* prefix);
-#define CSIZE(x) (sizeof (x) / 4)
diff --git a/mono/handles/ChangeLog b/mono/handles/ChangeLog
index f4ed279de03..570c79dd71d 100644
--- a/mono/handles/ChangeLog
+++ b/mono/handles/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-05 Dick Porter <dick@ximian.com>
+
+ * hps.c:
+ * shmdel.c:
+ * scratch.c: Update to new api
Sat Jun 1 13:54:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
diff --git a/mono/handles/Makefile.am b/mono/handles/Makefile.am
index ae6b663f1f2..f496a5300c2 100644
--- a/mono/handles/Makefile.am
+++ b/mono/handles/Makefile.am
@@ -7,22 +7,25 @@ INCLUDES = \
$(GLIB_CFLAGS)
hps_LDADD = \
- ../io-layer/libwapi.a \
- ../utils/libmonoutils.a \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ $(LIBGC_LIBS) \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
-lm
scratch_LDADD = \
- ../io-layer/libwapi.a \
- ../utils/libmonoutils.a \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ $(LIBGC_LIBS) \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
-lm
shmdel_LDADD = \
- ../io-layer/libwapi.a \
- ../utils/libmonoutils.a \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ $(LIBGC_LIBS) \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
-lm
diff --git a/mono/handles/hps.c b/mono/handles/hps.c
index 541707cf893..4b704ade0fe 100644
--- a/mono/handles/hps.c
+++ b/mono/handles/hps.c
@@ -17,6 +17,7 @@ static const guchar *event_details (struct _WapiHandleShared *handle);
static const guchar *socket_details (struct _WapiHandleShared *handle);
static const guchar *find_details (struct _WapiHandleShared *handle);
static const guchar *process_details (struct _WapiHandleShared *handle);
+static const guchar *pipe_details (struct _WapiHandleShared *handle);
/* This depends on the ordering of the enum WapiHandleType in
* io-layer/wapi-private.h
@@ -32,6 +33,7 @@ static const char *typename[]={
"Socket",
"Find",
"Process",
+ "Pipe",
"Error!!"
};
@@ -48,27 +50,38 @@ static const guchar * (*details[])(struct _WapiHandleShared *)=
socket_details,
find_details,
process_details,
+ pipe_details,
unused_details,
};
int main (int argc, char **argv)
{
- guint32 idx;
+ guint32 handle_idx;
gboolean success;
- int shm_id;
- _wapi_shared_data=_wapi_shm_attach (FALSE, &success, &shm_id);
+ _wapi_shared_data=g_new0 (struct _WapiHandleShared_list *, 1);
+ _wapi_shared_scratch=g_new0 (struct _WapiHandleScratch, 1);
+
+ success=_wapi_shm_attach (&_wapi_shared_data[0],
+ &_wapi_shared_scratch);
if(success==FALSE) {
- g_error ("Failed to attach shared memory! (tried shared memory ID 0x%x)", shm_id);
+ g_error ("Failed to attach shared memory!");
exit (-1);
}
/* Make sure index 0 is actually unused */
- for(idx=0; idx<_WAPI_MAX_HANDLES; idx++) {
- struct _WapiHandleShared *shared=&_wapi_shared_data->handles[idx];
+ for(handle_idx=0; handle_idx<_wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT; handle_idx++) {
+ guint32 segment, idx;
+ struct _WapiHandleShared *shared;
+
+ _wapi_handle_segment (GUINT_TO_POINTER (handle_idx), &segment,
+ &idx);
+ _wapi_handle_ensure_mapped (segment);
+
+ shared=&_wapi_shared_data[segment]->handles[idx];
if(shared->type!=WAPI_HANDLE_UNUSED) {
- g_print ("%4x [%7s] %4u %s (%s)\n", idx,
+ g_print ("%6x [%7s] %4u %s (%s)\n", handle_idx,
typename[shared->type], shared->ref,
shared->signalled?"Sg":"Un",
details[shared->type](shared));
@@ -89,7 +102,7 @@ static const guchar *file_details (struct _WapiHandleShared *handle)
guchar *name;
struct _WapiHandle_file *file=&handle->u.file;
- name=_wapi_handle_scratch_lookup_as_string (file->filename);
+ name=_wapi_handle_scratch_lookup (file->filename);
g_snprintf (buf, sizeof(buf),
"[%20s] acc: %c%c%c, shr: %c%c%c, attrs: %5u",
@@ -143,7 +156,7 @@ static const guchar *mutex_details (struct _WapiHandleShared *handle)
guchar *name;
struct _WapiHandle_mutex *mut=&handle->u.mutex;
- name=_wapi_handle_scratch_lookup_as_string (mut->name);
+ name=_wapi_handle_scratch_lookup (mut->sharedns.name);
g_snprintf (buf, sizeof(buf), "[%20s] own: %5d:%5ld, count: %5u",
name==NULL?(guchar *)"":name, mut->pid, mut->tid,
@@ -175,22 +188,29 @@ static const guchar *socket_details (struct _WapiHandleShared *handle)
static const guchar *find_details (struct _WapiHandleShared *handle)
{
- static guchar buf[80];
- struct _WapiHandle_find *find=&handle->u.find;
-
- g_snprintf (buf, sizeof(buf), "count: %5d",
- find->count);
-
- return(buf);
+ /* Nothing to see here either */
+ return("");
}
static const guchar *process_details (struct _WapiHandleShared *handle)
{
static guchar buf[80];
+ guchar *name;
struct _WapiHandle_process *proc=&handle->u.process;
- g_snprintf (buf, sizeof(buf), "pid: %5u",
- proc->id);
+ name=_wapi_handle_scratch_lookup (proc->proc_name);
+
+ g_snprintf (buf, sizeof(buf), "[%20s] pid: %5u",
+ name==NULL?(guchar *)"":name, proc->id);
+
+ if(name!=NULL) {
+ g_free (name);
+ }
return(buf);
}
+
+static const guchar *pipe_details (struct _WapiHandleShared *handle)
+{
+ return(file_details (handle));
+}
diff --git a/mono/handles/scratch.c b/mono/handles/scratch.c
index 3ad845b0ace..b0288e77030 100644
--- a/mono/handles/scratch.c
+++ b/mono/handles/scratch.c
@@ -36,27 +36,29 @@ int main (int argc, char **argv)
guint32 idx=0;
struct _WapiScratchHeader *hdr;
gboolean success;
- int shm_id;
- _wapi_shared_data=_wapi_shm_attach (FALSE, &success, &shm_id);
+ _wapi_shared_data=g_new0 (struct _WapiHandleShared_list *, 1);
+ _wapi_shared_scratch=g_new0 (struct _WapiHandleScratch, 1);
+
+ success=_wapi_shm_attach (&_wapi_shared_data[0], &_wapi_shared_scratch);
if(success==FALSE) {
- g_error ("Failed to attach shared memory! (tried shared memory ID 0x%x)", shm_id);
+ g_error ("Failed to attach shared memory!");
exit (-1);
}
- hdr=(struct _WapiScratchHeader *)&_wapi_shared_data->scratch_base[0];
+ hdr=(struct _WapiScratchHeader *)&_wapi_shared_scratch->scratch_data;
if(hdr->flags==0 && hdr->length==0) {
g_print ("Scratch space unused\n");
exit (0);
}
- while(idx < _WAPI_SHM_SCRATCH_SIZE) {
- hdr=(struct _WapiScratchHeader *)&_wapi_shared_data->scratch_base[idx];
+ while(idx < _wapi_shared_scratch->data_len) {
+ hdr=(struct _WapiScratchHeader *)&_wapi_shared_scratch->scratch_data[idx];
if(hdr->flags & WAPI_SHM_SCRATCH_FREE) {
g_print ("Free block at %6d (index %6d), length %6d\n",
idx, idx+HDRSIZE, hdr->length);
} else {
- guchar *data=&_wapi_shared_data->scratch_base[idx+HDRSIZE];
+ guchar *data=&_wapi_shared_scratch->scratch_data[idx+HDRSIZE];
g_print ("Used block at %6d (index %6d), length %6d, [%s]\n",
idx, idx+HDRSIZE, hdr->length,
diff --git a/mono/handles/shmdel.c b/mono/handles/shmdel.c
index 173fc664dfe..7c0ba8b2f2a 100644
--- a/mono/handles/shmdel.c
+++ b/mono/handles/shmdel.c
@@ -1,6 +1,8 @@
#include <config.h>
#include <glib.h>
+#include <mono/io-layer/io-layer.h>
+
/* We're digging into handle internals here... */
#include <mono/io-layer/shared.h>
diff --git a/mono/interpreter/.cvsignore b/mono/interpreter/.cvsignore
index d1628f487a6..691129259d2 100644
--- a/mono/interpreter/.cvsignore
+++ b/mono/interpreter/.cvsignore
@@ -4,3 +4,6 @@ mint
*.o
.libs
.deps
+interp.lo
+libmint.la
+*.lo
diff --git a/mono/interpreter/ChangeLog b/mono/interpreter/ChangeLog
index e8285e718bb..0aa1ceeee14 100644
--- a/mono/interpreter/ChangeLog
+++ b/mono/interpreter/ChangeLog
@@ -1,3 +1,478 @@
+
+Tue Nov 9 17:28:48 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: update to exception clause structure changes.
+
+2004-11-08 Ben Maurer <bmaurer@ximian.com>
+
+ * interp.c: warning free
+
+2004-10-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (libgc_libs): Do some automake magic so libmono/mono
+ depends on libmonogc.
+
+Wed Sep 22 19:06:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: updates for stack walk interface.
+
+2004-09-09 Lluis Sanchez Gual <lluis@novell.com>
+
+ * interp.c: In interp_walk_stack, don't crash if the context is not set
+ (this may happen if the method is called by unmanaged code).
+
+2004-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * interp.c: thread local alloc
+
+2004-08-05 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c: (mono_interp_init) use g_thread_supported
+ to stop multiple g_thread_init calls.
+ Also attach domain to thread like mono_jit_init
+
+2004-07-31 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.h: add mono_interp_ftnptr_to_delegate
+
+ * transform.c (generate): use mono_interp_ftnptr_to_delegate
+ as ical function.
+
+ * interp.c: add mono_interp_ftnptr_to_delegate to create
+ interpreter style delegate. fixes pinvoke3
+
+2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * interp.c: Use mono_init_from_assembly instead of mono_init.
+
+2004-07-27 Bernie Solomon <bernard@ugsolutions.com>
+
+ * transform.c (mono_interp_transform_method):
+ quick fix to cope with the fake ptr classes
+
+2004-07-26 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mintops.def: more options on ICALL op code
+
+ * interp.c: cope with exception in ICALL ops, more of them
+
+ * transforms.c: more ICALL opcodes
+
+2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mintops.def: rename the ICALL op codes to give a better
+ clue about their signature.
+
+ * transform.c (generate): use new ICALL types and add
+ a case for two args + a result
+
+ * interp.c (ves_exec_method_with_context): new ICALL
+ op codes.
+
+2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mintops.def: add MINT_DUP_VT
+
+ * transform.c (generate): cope with CEE_DUP on value type
+
+ * interp.c (ves_exec_method_with_context): implement MINT_DUP_VT
+ (interp_mono_runtime_invoke): don't unbox this for valuetypes
+ here as it is now done in the callers.
+
+2004-07-09 Ben Maurer <bmaurer@ximian.com>
+
+ * interp.c: register gc roots
+
+2004-07-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c mintops.def transform.c: Replace CEE_MONO_PROC<x> with
+ CEE_MONO_ICALL.
+
+2004-07-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mintops.h: Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Add support for unaligned access on little endian machines.
+
+ * interp.c:Applied patch from Marcin Krzyzanowski (krzak@pld-linux.org). Fix crash seen on amd64.
+
+2004-06-24 David Waite <mass@akuma.org>
+
+ * interp.c: change to C90-style comments from C99/C++-style
+
+Mon Jun 21 14:06:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * interp.h: API updates.
+
+2004-05-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * transform.c: ignore new LMF opcodes
+
+2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * interp.c, interp.h: Use the new methods for handling thread.abort.
+
+2004-05-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (ves_exec_method_with_context): Disable explicit assignment
+ of 'esi' to the ip variable, since it causes register allocation errors
+ on some versions of gcc. Fixes #58010.
+
+2004-04-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * transform.c (generate): missed a couple
+ of places that should use ADD_CODE so buffer
+ gets grown properly.
+
+ * interp.c (interp_mono_runtime_invoke):
+ restore state better on catching exception
+ via longjmp here
+
+2004-04-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * transform.c:
+ * interp.c:
+ Implement STARG for valuetypes as mcs needs it.
+
+2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
+
+ * transform.c: Make sure ENSURE_I4 is called on
+ 32 bit machines too.
+ (mono_interp_transform_method): allow some stack
+ space for tracing to work.
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * interp.h: remove comma from end of enumeration constants
+ declarations
+
+2004-04-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.h: put in space for old type field
+ for PPC as tramp.c assumes it. Quick fix until that's fixed.
+
+ * interp.c: reenable instruction tracing for DEBUG_INTERP
+
+2004-04-19 Bernie Solomon <bernard@ugsolutions.com>
+
+ * Makefile.am:
+ * interp.h:
+ * interp.c: now interprets different VM code
+ * mintops.h:
+ * mintops.def:
+ * mintops.c: definition of new VM code
+ * transform.c: convert CIL to new VM code
+
+2004-04-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (ves_exec_method_with_context): Add support for STRWLPARRAY
+ marshalling convention.
+
+2004-03-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c interp.h: remove child from MonoInvocation
+ as it isn't used.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * interp.c (stackval_from_data): Added MONO_TYPE_GENERICINST.
+ (stackval_to_data): Added MONO_TYPE_GENERICINST.
+ (calc_offsets): Use mono_class_get_full() and mono_get_method_full().
+ (ves_exec_method_with_context): Likewise.
+
+2004-03-04 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * interp.c: Get the type of transparent proxies from its remote_class.
+
+2004-02-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (ves_exec_method_with_context): Add new marshalling
+ conventions.
+
+2004-01-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (mono_main): Remove call to mono_verify_corlib (), since
+ the verification code is not up-to-date.
+
+2004-01-19 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c (ves_exec_method_with_context):
+ get_native_wrapper removed and call
+ mono_marshal_get_native_wrapper directly
+ with new DllNotFoundException handling
+
+Mon Jan 19 17:52:33 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: eliminate CSIZE macro.
+
+2004-01-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (ves_array_set): Check for ArrayTypeMismatchException.
+
+2004-01-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * interp.c: call setlocale (). Fixes bug #52100.
+
+2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
+
+ * embed.h, main.c: new files to enable embedding
+ the interpreter
+
+ * interp.c: make main callable from main.c
+ rearrange main for embedding
+
+ * Makefile.am: changes now most code is in a library
+
+2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * interp.c: Added support for context static fields.
+
+2003-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (mono_create_method_pointer): New function which contains
+ the arch independent part of method wrapper creation. Add a cache
+ for the wrapper code, since Delegate::Equals depends on the wrapper
+ address being constant for a method. Fixes #50366.
+
+2003-10-30 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c: (ves_exec_method_with_context)
+ we need to lookup internal calls now.
+ don't free type in CEE_SIZEOF.
+ fix CEE_NEWOBJ inside wrapper methods
+
+2003-10-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c: Update after appdomain changes.
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c - set large stack size on HP 64bit
+
+2003-10-02 Bernie Solomon <bernard@ugsolutions.com>
+
+ * hacks.h - work round HP 64 bit problem with isunordered
+
+2003-10-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (dump_frame): Avoid crash on frames without a method. Patch
+ sam@superduper.net (sam clegg). Fixes #46197.
+ (ves_exec_method_with_context): Fix unbox casting.
+
+2003-09-25 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c - reinstate use of mono_marshal_get_delegate_invoke
+ for ordering and fix CALLI to handle wrapper. More wrapper handling
+ in CALL and LDSTR. Add another string conversion case.
+
+2003-09-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (ves_exec_method): Fix warning.
+ (ves_exec_method_with_context): Fix CGT_UN and CLT_UN. Patch by
+ David Waite (mass@akuma.org).
+
+2003-9-24 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c: I broke calling native delegates reinstate
+ old code for the moment.
+
+2003-9-22 Bernie Solomon <bernard@ugsolutions.com>
+
+ * interp.c: use mono_marshal_get_delegate_invoke to get delegate
+ invocation order consistent. Fix THROW_EX, fix ip in overflow
+ exceptions.
+
+Fri Sep 12 10:42:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c, interp.h: patch from Bernie Solomon <bernard@ugsolutions.com>:
+ 64 bit/opcodes/exception handling fixes.
+
+2003-08-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c: Use mono_field_from_token () in the appropriate places.
+ This simplifies the code and also fixes #48051.
+
+2003-08-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (main): Fix the order of initialization calls so it maches
+ the order in the JIT.Patch by Bernie Solomon (bernard@ugsolutions.com).
+ Also remove the unused ms mutex.
+
+ * interp.c: Get rid of metadata_section.
+
+2003-08-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (main): Call g_thread_init () to make glib thread-safe.
+ Fixes #47682. Thanks to Laurent Morichetti (l_m@pacbell.net) for
+ reporting this.
+
+2003-08-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c: Get rid of duplicate definition of CHECK_MUL_OVERFLOW.
+ * interp.h interp.c: Get rid of VAL_VALUETA, use VAL_MP instead. Fix
+ the INITOBJ opcode which was the only user of VALUETA.
+
+2003-08-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (ves_exec_method): Implemented mul.ovf correctly for int32
+ and int64. Implement the conv.ovf opcodes for all argument types.
+
+2003-08-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c (ves_exec_method): Handle non-valuetypes in CEE_STOBJ.
+ Fixes #46781.
+ (ves_exec_method): Added support for the synchronized flag to the
+ interpreter. Also fixed the CALLI opcode, and made exception handling
+ work though the managed-unmanaged barrier.
+
+Fri Jul 25 19:06:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: updates for new instructions.
+
+2003-07-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c: Use the new metadata_section lock instead of metadata_lock.
+ Patch by Bernie Solomon (bernard@ugsolutions.com).
+
+Fri Jul 18 15:11:44 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: 64 bit fixes from Laurent Morichetti <l_m@pacbell.net>.
+ Install cleanup function.
+
+2003-07-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * interp.c: Keep alloca()-d data on a free list to prevent stack
+ overflow errors when valuetypes are allocated in a loop. Fixes
+ #27420. Is the new code still faster than using malloc/free ?
+
+ * interp.c (ves_array_get): Add index checking to ves_array_get/set.
+ Fixes decimal-array.exe.
+
+ * interp.c (interp_mono_runtime_invoke): Unbox value type instances
+ before calling the method. Fixes appdomain2.exe.
+
+ * interp.c: Fix warnings.
+
+ * interp.c: Report unhandled exceptions correctly.
+
+ * interp.c: Implement CEE_ISINST and CEE_CASTCLASS using
+ mono_object_isinst. Fixes bug #45539 and reflection-enum.exe.
+
+Tue May 27 16:36:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: don't use relative numbering stuff.
+
+Tue May 27 12:18:44 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: update for mono_class_vtable() changes.
+
+Tue May 13 16:43:18 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: handle thread static fields.
+
+Sun Apr 27 13:27:59 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: check for arraytypemismatch.
+
+2003-04-23 Martin Baulig <martin@ximian.com>
+
+ * interp.c: When running with --dieonex, use the debugging code to
+ print source lines in the backtrace.
+
+2003-02-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * interp.c: added a dummy mono_runtime_install_handlers function to
+ avoid crashing when ves_pinvoke_method tries to call it.
+
+2003-02-06 Piers Haken <piersh@friskit.com>
+
+ * interp.c: warning cleanups
+
+2002-11-15 Dick Porter <dick@ximian.com>
+
+ * interp.c: mono_runtime_init() now has an extra parameter for
+ thread attaching.
+
+2002-10-31 Dick Porter <dick@ximian.com>
+
+ * Makefile.am: The previous automake-1.6 fix broke automake-1.4 on
+ cygwin. Try again.
+
+2002-09-27 Dick Porter <dick@ximian.com>
+
+ * interp.c: Tell glib what the program name is, by passing it the
+ name of the managed file we're executing
+
+2002-08-28 Dick Porter <dick@ximian.com>
+
+ * interp.c: mono_set_rootdir() doesnt take any args now
+
+ * Makefile.am: Export HOST_CC and turn on optimisation for w32 builds
+
+2002-08-28 Nick Drochak <ndrochak@gol.com>
+
+ * interp.c: check and throw exception if needed for overflow on
+ multiplication of integer types.
+
+2002-08-07 Dietmar Maurer <dietmar@ximian.com>
+
+ * interp.c (interp_walk_stack): removed the createdelegate icall
+
+2002-08-02 Dietmar Maurer <dietmar@ximian.com>
+
+ * interp.c (get_virtual_method): support proxies
+ (ves_exec_method): impl. LDFLD/STFLD for proxies.
+
+Fri Aug 2 13:00:41 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c, interp.h: implemented exception trap for runtime_invoke
+ and handle exceptions across managed/unmanaged boundaries.
+
+2002-08-01 Dietmar Maurer <dietmar@ximian.com>
+
+ * interp.c (stackval_from_data): add pinvoke argument
+ (stackval_to_data): add pinvoke argument. We need consider the
+ fact that unmanages structures may have different sizes.
+ (ves_pinvoke_method): do not call stackval_from_data if the result
+ is a value type.
+
+Wed Jul 31 17:47:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: simplified some more branch code.
+
+Wed Jul 31 16:50:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: fixed indentation, simplified some code.
+
+Wed Jul 31 14:29:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: fix so that mint can at least get to executing Main().
+
+2002-07-31 Dietmar Maurer <dietmar@ximian.com>
+
+ * interp.c: use the new marshaling code. better delegate/remoting
+ support.
+ (ves_exec_method): bug fix - directly jump to handle_exception.
+
+2002-07-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * interp.c (main): install compile_method handler
+
+Wed Jul 24 13:02:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: implemented stack walking function.
+
+Fri Jul 19 14:21:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: fix float boxing on LE systems.
+
+Sat Jul 13 19:54:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * interp.c: advance ip in conv.r.un.
+
+2002-07-01 Dick Porter <dick@ximian.com>
+
+ * interp.c (ves_exec): Removed unneeded argument to
+ mono_runtime_run_main()
+
2002-06-25 Dick Porter <dick@ximian.com>
* interp.c (ves_exec): Pass the assembly to mono_runtime_run_main
diff --git a/mono/interpreter/Makefile.am b/mono/interpreter/Makefile.am
index 96ef3c2642a..3c8a9d17aa6 100644
--- a/mono/interpreter/Makefile.am
+++ b/mono/interpreter/Makefile.am
@@ -1,24 +1,58 @@
INCLUDES = \
-I$(top_srcdir) \
+ $(LIBGC_CFLAGS) \
$(GMODULE_CFLAGS) \
- $(GLIB_CFLAGS)
+ $(GLIB_CFLAGS)
+
+if PLATFORM_WIN32
+export HOST_CC
+# The mingw math.h has "extern inline" functions that dont appear in libs, so
+# optimisation is required to actually inline them
+AM_CFLAGS = -O
+endif
bin_PROGRAMS = mint
+lib_LTLIBRARIES = libmint.la
+
mint_SOURCES = \
+ main.c
+
+mint_LDADD = \
+ libmint.la
+
+libmint_la_SOURCES = \
hacks.h \
interp.h \
- interp.c
+ interp.c \
+ mintops.h \
+ mintops.def \
+ mintops.c \
+ transform.c
+
+libmintincludedir = $(includedir)/mono/interpreter
+
+libmintinclude_HEADERS = \
+ embed.h
+
+# This is needed for automake dependency generation
+if INCLUDED_LIBGC
+libgc_libs=../../libgc/libmonogc.la
+else
+libgc_libs=$(LIBGC_LIBS)
+endif
-mint_LDADD = \
+libmint_la_LIBADD = \
../arch/libmonoarch.la \
- ../os/libmonoos.a \
- ../metadata/libmonoruntime.a \
- ../metadata/libmetadata.a \
- ../io-layer/libwapi.a \
- ../utils/libmonoutils.a \
+ ../metadata/libmonoruntime.la \
+ ../metadata/libmetadata.la \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ ../os/libmonoos.la \
+ $(libgc_libs) \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
+ $(ICU_LIBS) \
-lm
man_MANS = mint.1
diff --git a/mono/interpreter/embed.h b/mono/interpreter/embed.h
new file mode 100644
index 00000000000..b3a54490eed
--- /dev/null
+++ b/mono/interpreter/embed.h
@@ -0,0 +1,15 @@
+#include <mono/metadata/object.h>
+#include <mono/metadata/appdomain.h>
+
+int
+mono_main (int argc, char* argv[]);
+
+MonoDomain *
+mono_interp_init(const char *file);
+
+int
+mono_interp_exec(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]);
+
+void
+mono_interp_cleanup(MonoDomain *domain);
+
diff --git a/mono/interpreter/hacks.h b/mono/interpreter/hacks.h
index 030bf9a9eeb..9697ccbad6f 100644
--- a/mono/interpreter/hacks.h
+++ b/mono/interpreter/hacks.h
@@ -44,6 +44,17 @@
#else
+/* isunordered seems to crash on HPUX when built 64 bits
+ so use generic implementation.
+*/
+#if defined(__hpux) && SIZEOF_VOID_P == 8
+#undef isunordered
+#undef islessgreater
+#undef islessequal
+#undef isless
+#undef isgreater
+#endif
+
#ifndef isunordered
# define isunordered(u, v) (isnan(u) || isnan(v))
#endif
diff --git a/mono/interpreter/interp.c b/mono/interpreter/interp.c
index ee286a01952..7063ba41024 100644
--- a/mono/interpreter/interp.c
+++ b/mono/interpreter/interp.c
@@ -21,10 +21,10 @@
#include <glib.h>
#include <setjmp.h>
#include <signal.h>
+#include <math.h>
+#include <locale.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
@@ -40,7 +40,6 @@
#include <mono/metadata/cil-coff.h>
#include <mono/metadata/mono-endian.h>
#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/blob.h>
#include <mono/metadata/tokentype.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/threads.h>
@@ -52,40 +51,46 @@
#include <mono/metadata/verify.h>
#include <mono/metadata/opcodes.h>
#include <mono/metadata/debug-helpers.h>
-#include <mono/io-layer/io-layer.h>
-#include <mono/metadata/socket-io.h>
#include <mono/metadata/mono-config.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/mono-debug.h>
#include <mono/os/util.h>
-/*#include <mono/cli/types.h>*/
#include "interp.h"
+#include "mintops.h"
+#include "embed.h"
#include "hacks.h"
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
+ a = i,
+
+enum {
+#include "mono/cil/opcode.def"
+ CEE_LASTOP
+};
+#undef OPDEF
+
+/* Mingw 2.1 doesnt need this any more, but leave it in for now for older versions */
#ifdef _WIN32
#define isnan _isnan
#define finite _finite
#endif
+#ifndef HAVE_FINITE
+#ifdef HAVE_ISFINITE
+#define finite isfinite
+#endif
+#endif
+
+static gint *abort_requested;
/* If true, then we output the opcodes as we interpret them */
static int global_tracing = 0;
static int global_no_pointers = 0;
-static int debug_indent_level = 0;
-
-/*
- * Pull the list of opcodes
- */
-#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
- a = i,
-
-enum {
-#include "mono/cil/opcode.def"
- LAST = 0xff
-};
-#undef OPDEF
+int mono_interp_traceopt = 0;
-#define GET_NATI(sp) ((sp).data.nati)
-#define CSIZE(x) (sizeof (x) / 4)
+static int debug_indent_level = 0;
#define INIT_FRAME(frame,parent_frame,obj_this,method_args,method_retval,mono_method) \
do { \
@@ -93,25 +98,30 @@ enum {
(frame)->obj = (obj_this); \
(frame)->stack_args = (method_args); \
(frame)->retval = (method_retval); \
- (frame)->method = (mono_method); \
- (frame)->ex_handler = NULL; \
+ (frame)->runtime_method = mono_interp_get_runtime_method (mono_method); \
(frame)->ex = NULL; \
- (frame)->child = NULL; \
+ (frame)->ip = NULL; \
+ (frame)->invoke_trap = 0; \
} while (0)
void ves_exec_method (MonoInvocation *frame);
+static char* dump_stack (stackval *stack, stackval *sp);
+static char* dump_frame (MonoInvocation *inv);
+static MonoArray *get_trace_ips (MonoDomain *domain, MonoInvocation *top);
+static void ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context);
+
typedef void (*ICallMethod) (MonoInvocation *frame);
static guint32 die_on_exception = 0;
-static guint32 frame_thread_id = 0;
+static guint32 thread_context_id = 0;
#define DEBUG_INTERP 1
+#define COUNT_OPS 0
#if DEBUG_INTERP
-static unsigned long opcode_count = 0;
-static unsigned long fcall_count = 0;
static int break_on_method = 0;
+static int nested_trace = 0;
static GList *db_methods = NULL;
static void
@@ -134,44 +144,40 @@ db_match_method (gpointer data, gpointer user_data)
}
#define DEBUG_ENTER() \
- fcall_count++; \
- g_list_foreach (db_methods, db_match_method, (gpointer)frame->method); \
- if (break_on_method) tracing=2; \
- break_on_method = 0; \
+ if (db_methods) { \
+ g_list_foreach (db_methods, db_match_method, (gpointer)frame->runtime_method->method); \
+ if (break_on_method) tracing=nested_trace ? (global_tracing = 2, 3) : 2; \
+ break_on_method = 0; \
+ } \
if (tracing) { \
- MonoClass *klass = frame->method->klass; \
- char *args = dump_stack (frame->stack_args, frame->stack_args+signature->param_count); \
+ MonoMethod *method = frame->runtime_method->method ;\
+ char *mn, *args = dump_args (frame); \
debug_indent_level++; \
output_indent (); \
- g_print ("(%d) Entering %s.%s::%s (", GetCurrentThreadId(), klass->name_space, klass->name, frame->method->name); \
- if (signature->hasthis) { \
- if (global_no_pointers) { \
- g_print ("this%s ", frame->obj ? "" : "=null"); \
- } else { \
- g_print ("%p ", frame->obj); } \
- } \
+ mn = mono_method_full_name (method, FALSE); \
+ g_print ("(%u) Entering %s (", GetCurrentThreadId(), mn); \
+ g_free (mn); \
g_print ("%s)\n", args); \
g_free (args); \
} \
if (mono_profiler_events & MONO_PROFILE_ENTER_LEAVE) \
- mono_profiler_method_enter (frame->method);
+ mono_profiler_method_enter (frame->runtime_method->method);
#define DEBUG_LEAVE() \
if (tracing) { \
- MonoClass *klass = frame->method->klass; \
- char *args; \
- if (signature->ret->type != MONO_TYPE_VOID) \
- args = dump_stack (frame->retval, frame->retval + 1); \
- else \
- args = g_strdup (""); \
+ char *mn, *args; \
+ args = dump_retval (frame); \
output_indent (); \
- g_print ("(%d) Leaving %s.%s::%s", GetCurrentThreadId(), klass->name_space, klass->name, frame->method->name); \
+ mn = mono_method_full_name (frame->runtime_method->method, FALSE); \
+ g_print ("(%u) Leaving %s", GetCurrentThreadId(), mn); \
+ g_free (mn); \
g_print (" => %s\n", args); \
g_free (args); \
debug_indent_level--; \
+ if (tracing == 3) global_tracing = 0; \
} \
if (mono_profiler_events & MONO_PROFILE_ENTER_LEAVE) \
- mono_profiler_method_leave (frame->method);
+ mono_profiler_method_leave (frame->runtime_method->method);
#else
@@ -182,127 +188,128 @@ db_match_method (gpointer data, gpointer user_data)
static void
interp_ex_handler (MonoException *ex) {
- MonoInvocation *frame = TlsGetValue (frame_thread_id);
- frame->ex = ex;
- longjmp (*(jmp_buf*)frame->locals, 1);
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ char *stack_trace;
+ if (context == NULL)
+ return;
+ stack_trace = dump_frame (context->current_frame);
+ ex->stack_trace = mono_string_new (mono_domain_get(), stack_trace);
+ g_free (stack_trace);
+ if (context->current_env == NULL || strcmp(ex->object.vtable->klass->name, "ExecutionEngineException") == 0) {
+ char *strace = mono_string_to_utf8 (ex->stack_trace);
+ fprintf(stderr, "Nothing can catch this exception: ");
+ fprintf(stderr, "%s", ex->object.vtable->klass->name);
+ if (ex->message != NULL) {
+ char *m = mono_string_to_utf8 (ex->message);
+ fprintf(stderr, ": %s", m);
+ g_free(m);
+ }
+ fprintf(stderr, "\n");
+ fprintf(stderr, "%s\n", strace);
+ g_free (strace);
+ if (ex->inner_ex != NULL) {
+ ex = (MonoException *)ex->inner_ex;
+ fprintf(stderr, "Inner exception: %s", ex->object.vtable->klass->name);
+ if (ex->message != NULL) {
+ char *m = mono_string_to_utf8 (ex->message);
+ fprintf(stderr, ": %s", m);
+ g_free(m);
+ }
+ strace = mono_string_to_utf8 (ex->stack_trace);
+ fprintf(stderr, "\n");
+ fprintf(stderr, "%s\n", strace);
+ g_free (strace);
+ }
+ /* wait for other threads to also collapse */
+ Sleep(1000);
+ exit(1);
+ }
+ context->env_frame->ex = ex;
+ context->search_for_handler = 1;
+ longjmp (*context->current_env, 1);
}
static void
ves_real_abort (int line, MonoMethod *mh,
- const unsigned char *ip, stackval *stack, stackval *sp)
+ const unsigned short *ip, stackval *stack, stackval *sp)
{
- MonoMethodNormal *mm = (MonoMethodNormal *)mh;
fprintf (stderr, "Execution aborted in method: %s::%s\n", mh->klass->name, mh->name);
fprintf (stderr, "Line=%d IP=0x%04x, Aborted execution\n", line,
- ip-mm->header->code);
+ ip-(const unsigned short *)mono_method_get_header (mh)->code);
g_print ("0x%04x %02x\n",
- ip-mm->header->code, *ip);
+ ip-(const unsigned short *)mono_method_get_header (mh)->code, *ip);
if (sp > stack)
- printf ("\t[%d] %d 0x%08x %0.5f\n", sp-stack, sp[-1].type, sp[-1].data.i, sp[-1].data.f);
+ printf ("\t[%d] 0x%08x %0.5f\n", sp-stack, sp[-1].data.i, sp[-1].data.f);
}
-#define ves_abort() do {ves_real_abort(__LINE__, frame->method, ip, frame->stack, sp); THROW_EX (mono_get_exception_execution_engine (NULL), ip);} while (0);
-static MonoMethodMessage *
-arch_method_call_message_new (MonoMethod *method, void *obj, stackval *args, MonoMethod *invoke,
- MonoDelegate **cb, MonoObject **state)
-{
- MonoDomain *domain = mono_domain_get ();
- MonoMethodSignature *sig = method->signature;
- MonoMethodMessage *msg;
- int i, count, type, size, align;
- /*char *cpos = stack;*/
-
- msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
-
- if (invoke) {
- mono_message_init (domain, msg, mono_method_get_object (domain, invoke), NULL);
- count = sig->param_count - 2;
- } else {
- mono_message_init (domain, msg, mono_method_get_object (domain, method), NULL);
- count = sig->param_count;
- }
-
- for (i = 0; i < count; i++) {
- gpointer vpos;
- MonoClass *class;
- MonoObject *arg;
-
- size = mono_type_stack_size (sig->params [i], &align);
-
- /* FIXME: endian issues */
- if (sig->params [i]->byref)
- vpos = *((gpointer *)args [i].data.p);
- else
- vpos = &args [i].data;
-
- type = sig->params [i]->type;
- class = mono_class_from_mono_type (sig->params [i]);
-
- if (class->valuetype)
- arg = mono_value_box (domain, class, vpos);
- else
- arg = args [i].data.p;
-
- mono_array_set (msg->args, gpointer, i, arg);
- }
-
- if (invoke) {
- /* the last two arguments of begininvoke */
- *cb = args [count].data.p;
- *state = args [count + 1].data.p;
- }
- return msg;
-}
+#define ves_abort() \
+ do {\
+ ves_real_abort(__LINE__, frame->runtime_method->method, ip, frame->stack, sp); \
+ THROW_EX (mono_get_exception_execution_engine (NULL), ip); \
+ } while (0);
static gpointer
interp_create_remoting_trampoline (MonoMethod *method)
{
- return method;
+ return mono_interp_get_runtime_method (mono_marshal_get_remoting_invoke (method));
}
-static void
-invoke_remoting_trampoline (MonoInvocation *frame) {
- MonoMethodMessage *msg;
- MonoTransparentProxy *this;
- MonoObject *res, *exc;
- MonoArray *out_args;
-
- this = frame->obj;
- msg = arch_method_call_message_new (frame->method, frame->obj, frame->stack_args, NULL, NULL, NULL);
+static CRITICAL_SECTION runtime_method_lookup_section;
- res = mono_remoting_invoke ((MonoObject *)this->rp, msg, &exc, &out_args);
-
- if (exc)
- mono_raise_exception ((MonoException *)exc);
+RuntimeMethod*
+mono_interp_get_runtime_method (MonoMethod *method)
+{
+ MonoDomain *domain = mono_domain_get ();
+ RuntimeMethod *rtm;
- /*arch_method_return_message_restore (method, &first_arg, res, out_args);*/
+ EnterCriticalSection (&runtime_method_lookup_section);
+ if ((rtm = g_hash_table_lookup (domain->jit_code_hash, method))) {
+ LeaveCriticalSection (&runtime_method_lookup_section);
+ return rtm;
+ }
+ rtm = mono_mempool_alloc (domain->mp, sizeof (RuntimeMethod));
+ memset (rtm, 0, sizeof (*rtm));
+ rtm->method = method;
+ rtm->param_count = method->signature->param_count;
+ rtm->hasthis = method->signature->hasthis;
+ rtm->valuetype = method->klass->valuetype;
+ g_hash_table_insert (domain->jit_code_hash, method, rtm);
+ LeaveCriticalSection (&runtime_method_lookup_section);
+
+ return rtm;
}
-static MonoMethod*
-get_virtual_method (MonoDomain *domain, MonoMethod *m, stackval *objs)
+static gpointer
+interp_create_trampoline (MonoMethod *method)
{
- MonoObject *obj;
- MonoClass *klass;
- MonoMethod **vtable;
-
- if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL))
- return m;
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ method = mono_marshal_get_synchronized_wrapper (method);
+ return mono_interp_get_runtime_method (method);
+}
- obj = objs->data.p;
- klass = obj->vtable->klass;
- vtable = (MonoMethod **)obj->vtable->vtable;
+static inline RuntimeMethod*
+get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
+{
+ MonoMethod *m = runtime_method->method;
+
+ if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
+ if (obj->vtable->klass == mono_defaults.transparent_proxy_class)
+ return mono_interp_get_runtime_method (mono_marshal_get_remoting_invoke (m));
+ else if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ return mono_interp_get_runtime_method (mono_marshal_get_synchronized_wrapper (m));
+ else
+ return runtime_method;
+ }
if (m->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
- return *(MonoMethod**)((char*)obj->vtable->interface_offsets [m->klass->interface_id] + (m->slot<<2));
+ return ((RuntimeMethod **)obj->vtable->interface_offsets [m->klass->interface_id]) [m->slot];
+ } else {
+ return ((RuntimeMethod **)obj->vtable->vtable) [m->slot];
}
-
- g_assert (vtable [m->slot]);
-
- return vtable [m->slot];
}
void inline
-stackval_from_data (MonoType *type, stackval *result, char *data)
+stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke)
{
if (type->byref) {
switch (type->type) {
@@ -311,62 +318,51 @@ stackval_from_data (MonoType *type, stackval *result, char *data)
case MONO_TYPE_STRING:
case MONO_TYPE_ARRAY:
case MONO_TYPE_SZARRAY:
- result->type = VAL_OBJ;
break;
default:
- result->type = VAL_VALUETA;
break;
}
result->data.p = *(gpointer*)data;
- result->data.vt.klass = mono_class_from_mono_type (type);
return;
}
switch (type->type) {
case MONO_TYPE_VOID:
return;
case MONO_TYPE_I1:
- result->type = VAL_I32;
result->data.i = *(gint8*)data;
return;
case MONO_TYPE_U1:
case MONO_TYPE_BOOLEAN:
- result->type = VAL_I32;
result->data.i = *(guint8*)data;
return;
case MONO_TYPE_I2:
- result->type = VAL_I32;
result->data.i = *(gint16*)data;
return;
case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
- result->type = VAL_I32;
result->data.i = *(guint16*)data;
return;
case MONO_TYPE_I4:
- result->type = VAL_I32;
result->data.i = *(gint32*)data;
return;
case MONO_TYPE_U:
case MONO_TYPE_I:
+ result->data.nati = *(mono_i*)data;
+ return;
case MONO_TYPE_PTR:
- result->type = VAL_TP;
result->data.p = *(gpointer*)data;
return;
case MONO_TYPE_U4:
- result->type = VAL_I32;
result->data.i = *(guint32*)data;
return;
case MONO_TYPE_R4:
- result->type = VAL_DOUBLE;
result->data.f = *(float*)data;
return;
case MONO_TYPE_I8:
case MONO_TYPE_U8:
- result->type = VAL_I64;
result->data.l = *(gint64*)data;
return;
case MONO_TYPE_R8:
- result->type = VAL_DOUBLE;
result->data.f = *(double*)data;
return;
case MONO_TYPE_STRING:
@@ -374,17 +370,20 @@ stackval_from_data (MonoType *type, stackval *result, char *data)
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
case MONO_TYPE_ARRAY:
- result->type = VAL_OBJ;
result->data.p = *(gpointer*)data;
- result->data.vt.klass = mono_class_from_mono_type (type);
return;
case MONO_TYPE_VALUETYPE:
if (type->data.klass->enumtype) {
- return stackval_from_data (type->data.klass->enum_basetype, result, data);
+ stackval_from_data (type->data.klass->enum_basetype, result, data, pinvoke);
+ return;
} else {
- result->type = VAL_VALUET;
- result->data.vt.klass = type->data.klass;
- memcpy (result->data.vt.vt, data, mono_class_value_size (type->data.klass, NULL));
+ int size;
+
+ if (pinvoke)
+ size = mono_class_native_size (type->data.klass, NULL);
+ else
+ size = mono_class_value_size (type->data.klass, NULL);
+ memcpy (result->data.vt, data, size);
}
return;
default:
@@ -393,14 +392,15 @@ stackval_from_data (MonoType *type, stackval *result, char *data)
}
}
-static void inline
-stackval_to_data (MonoType *type, stackval *val, char *data)
+void inline
+stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke)
{
if (type->byref) {
gpointer *p = (gpointer*)data;
*p = val->data.p;
return;
}
+ /* printf ("TODAT0 %p\n", data); */
switch (type->type) {
case MONO_TYPE_I1:
case MONO_TYPE_U1: {
@@ -420,20 +420,27 @@ stackval_to_data (MonoType *type, stackval *val, char *data)
*p = val->data.i;
return;
}
-#if SIZEOF_VOID_P == 4
- case MONO_TYPE_I:
- case MONO_TYPE_U:
-#endif
+ case MONO_TYPE_I: {
+ mono_i *p = (mono_i*)data;
+ /* In theory the value used by stloc should match the local var type
+ but in practice it sometimes doesn't (a int32 gets dup'd and stloc'd into
+ a native int - both by csc and mcs). Not sure what to do about sign extension
+ as it is outside the spec... doing the obvious */
+ *p = (mono_i)val->data.nati;
+ return;
+ }
+ case MONO_TYPE_U: {
+ mono_u *p = (mono_u*)data;
+ /* see above. */
+ *p = (mono_u)val->data.nati;
+ return;
+ }
case MONO_TYPE_I4:
case MONO_TYPE_U4: {
gint32 *p = (gint32*)data;
*p = val->data.i;
return;
}
-#if SIZEOF_VOID_P == 8
- case MONO_TYPE_I:
- case MONO_TYPE_U:
-#endif
case MONO_TYPE_I8:
case MONO_TYPE_U8: {
gint64 *p = (gint64*)data;
@@ -462,9 +469,17 @@ stackval_to_data (MonoType *type, stackval *val, char *data)
}
case MONO_TYPE_VALUETYPE:
if (type->data.klass->enumtype) {
- return stackval_to_data (type->data.klass->enum_basetype, val, data);
+ stackval_to_data (type->data.klass->enum_basetype, val, data, pinvoke);
+ return;
} else {
- memcpy (data, val->data.vt.vt, mono_class_value_size (type->data.klass, NULL));
+ int size;
+
+ if (pinvoke)
+ size = mono_class_native_size (type->data.klass, NULL);
+ else
+ size = mono_class_value_size (type->data.klass, NULL);
+
+ memcpy (data, val->data.p, size);
}
return;
default:
@@ -473,6 +488,26 @@ stackval_to_data (MonoType *type, stackval *val, char *data)
}
}
+static void
+fill_in_trace (MonoException *exception, MonoInvocation *frame)
+{
+ char *stack_trace = dump_frame (frame);
+ MonoDomain *domain = mono_domain_get();
+ (exception)->stack_trace = mono_string_new (domain, stack_trace);
+ (exception)->trace_ips = get_trace_ips (domain, frame);
+ g_free (stack_trace);
+}
+
+#define FILL_IN_TRACE(exception, frame) fill_in_trace(exception, frame)
+
+#define THROW_EX(exception,ex_ip) \
+ do {\
+ frame->ip = (ex_ip); \
+ frame->ex = (MonoException*)(exception); \
+ FILL_IN_TRACE(frame->ex, frame); \
+ goto handle_exception; \
+ } while (0)
+
static MonoObject*
ves_array_create (MonoDomain *domain, MonoClass *klass, MonoMethodSignature *sig, stackval *values)
{
@@ -519,19 +554,32 @@ ves_array_set (MonoInvocation *frame)
for (i = 1; i < ac->rank; i++) {
if ((t = sp [i].data.i - ao->bounds [i].lower_bound) >=
ao->bounds [i].length) {
- g_warning ("wrong array index");
- g_assert_not_reached ();
+ frame->ex = mono_get_exception_index_out_of_range ();
+ FILL_IN_TRACE(frame->ex, frame);
+ return;
}
pos = pos*ao->bounds [i].length + sp [i].data.i -
ao->bounds [i].lower_bound;
}
+ } else if (pos >= ao->max_length) {
+ frame->ex = mono_get_exception_index_out_of_range ();
+ FILL_IN_TRACE(frame->ex, frame);
+ return;
+ }
+
+#if 0 /* FIX */
+ if (sp [ac->rank].data.p && !mono_object_isinst (sp [ac->rank].data.p, mono_object_class (o)->element_class)) {
+ frame->ex = mono_get_exception_array_type_mismatch ();
+ FILL_IN_TRACE (frame->ex, frame);
+ return;
}
+#endif
esize = mono_array_element_size (ac);
ea = mono_array_addr_with_size (ao, esize, pos);
- mt = frame->method->signature->params [ac->rank];
- stackval_to_data (mt, &sp [ac->rank], ea);
+ mt = frame->runtime_method->method->signature->params [ac->rank];
+ stackval_to_data (mt, &sp [ac->rank], ea, FALSE);
}
static void
@@ -541,7 +589,7 @@ ves_array_get (MonoInvocation *frame)
MonoObject *o;
MonoArray *ao;
MonoClass *ac;
- gint32 i, pos, esize;
+ gint32 i, t, pos, esize;
gpointer ea;
MonoType *mt;
@@ -554,16 +602,28 @@ ves_array_get (MonoInvocation *frame)
pos = sp [0].data.i;
if (ao->bounds != NULL) {
pos -= ao->bounds [0].lower_bound;
- for (i = 1; i < ac->rank; i++)
+ for (i = 1; i < ac->rank; i++) {
+ if ((t = sp [i].data.i - ao->bounds [i].lower_bound) >=
+ ao->bounds [i].length) {
+ frame->ex = mono_get_exception_index_out_of_range ();
+ FILL_IN_TRACE(frame->ex, frame);
+ return;
+ }
+
pos = pos*ao->bounds [i].length + sp [i].data.i -
ao->bounds [i].lower_bound;
+ }
+ } else if (pos >= ao->max_length) {
+ frame->ex = mono_get_exception_index_out_of_range ();
+ FILL_IN_TRACE(frame->ex, frame);
+ return;
}
esize = mono_array_element_size (ac);
ea = mono_array_addr_with_size (ao, esize, pos);
- mt = frame->method->signature->ret;
- stackval_from_data (mt, frame->retval, ea);
+ mt = frame->runtime_method->method->signature->ret;
+ stackval_from_data (mt, frame->retval, ea, FALSE);
}
static void
@@ -573,7 +633,7 @@ ves_array_element_address (MonoInvocation *frame)
MonoObject *o;
MonoArray *ao;
MonoClass *ac;
- gint32 i, pos, esize;
+ gint32 i, t, pos, esize;
gpointer ea;
o = frame->obj;
@@ -585,45 +645,141 @@ ves_array_element_address (MonoInvocation *frame)
pos = sp [0].data.i;
if (ao->bounds != NULL) {
pos -= ao->bounds [0].lower_bound;
- for (i = 1; i < ac->rank; i++)
+ for (i = 1; i < ac->rank; i++) {
+ if ((t = sp [i].data.i - ao->bounds [i].lower_bound) >=
+ ao->bounds [i].length) {
+ frame->ex = mono_get_exception_index_out_of_range ();
+ FILL_IN_TRACE(frame->ex, frame);
+ return;
+ }
pos = pos*ao->bounds [i].length + sp [i].data.i -
ao->bounds [i].lower_bound;
+ }
+ } else if (pos >= ao->max_length) {
+ frame->ex = mono_get_exception_index_out_of_range ();
+ FILL_IN_TRACE(frame->ex, frame);
+ return;
}
esize = mono_array_element_size (ac);
ea = mono_array_addr_with_size (ao, esize, pos);
- frame->retval->type = VAL_TP;
frame->retval->data.p = ea;
}
+static void
+interp_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data)
+{
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ MonoInvocation *frame;
+ int il_offset;
+ MonoMethodHeader *hd;
+
+ if (!context) return;
+
+ frame = context->current_frame;
+
+ while (frame) {
+ gboolean managed = FALSE;
+ MonoMethod *method = frame->runtime_method->method;
+ if (!method || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)))
+ il_offset = -1;
+ else {
+ hd = mono_method_get_header (method);
+ il_offset = frame->ip - (const unsigned short *)hd->code;
+ if (!method->wrapper_type)
+ managed = TRUE;
+ }
+ if (func (method, -1, il_offset, managed, user_data))
+ return;
+ frame = frame->parent;
+ }
+}
+
static void
-ves_pinvoke_method (MonoInvocation *frame)
+ves_pinvoke_method (MonoInvocation *frame, MonoMethodSignature *sig, MonoFunc addr, gboolean string_ctor, ThreadContext *context)
{
jmp_buf env;
MonoPIFunc func;
-
- if (setjmp(env)) {
- TlsSetValue (frame_thread_id, frame->args);
+ MonoInvocation *old_frame = context->current_frame;
+ MonoInvocation *old_env_frame = context->env_frame;
+ jmp_buf *old_env = context->current_env;
+
+ if (setjmp (env)) {
+ context->current_frame = old_frame;
+ context->env_frame = old_env_frame;
+ context->current_env = old_env;
+ context->managed_code = 1;
return;
}
- if (!frame->method->info)
- frame->method->info = mono_create_trampoline (frame->method, 0);
- func = (MonoPIFunc)frame->method->info;
-
- /*
- * frame->locals and args are unused for P/Invoke methods, so we reuse them.
- * locals will point to the jmp_buf, while args will point to the previous
- * MonoInvocation frame: this is needed to make exception searching work across
- * managed/unmanaged boundaries.
- */
- frame->locals = (char*)&env;
- frame->args = (char*)TlsGetValue (frame_thread_id);
- TlsSetValue (frame_thread_id, frame);
- func ((MonoFunc)frame->method->addr, &frame->retval->data.p, frame->obj, frame->stack_args);
- stackval_from_data (frame->method->signature->ret, frame->retval, (char*)&frame->retval->data.p);
- TlsSetValue (frame_thread_id, frame->args);
+ frame->ex = NULL;
+ context->env_frame = frame;
+ context->current_env = &env;
+
+ if (frame->runtime_method) {
+ func = frame->runtime_method->func;
+ } else {
+ func = mono_arch_create_trampoline (sig, string_ctor);
+ }
+
+ context->current_frame = frame;
+ context->managed_code = 0;
+
+ func (addr, &frame->retval->data.p, frame->obj, frame->stack_args);
+
+ context->managed_code = 1;
+ /* domain can only be changed by native code */
+ context->domain = mono_domain_get ();
+
+ if (*abort_requested)
+ mono_thread_interruption_checkpoint ();
+
+ if (string_ctor) {
+ stackval_from_data (&mono_defaults.string_class->byval_arg,
+ frame->retval, (char*)&frame->retval->data.p, sig->pinvoke);
+ } else if (!MONO_TYPE_ISSTRUCT (sig->ret))
+ stackval_from_data (sig->ret, frame->retval, (char*)&frame->retval->data.p, sig->pinvoke);
+
+ context->current_frame = old_frame;
+ context->env_frame = old_env_frame;
+ context->current_env = old_env;
+}
+
+static void
+interp_delegate_ctor (MonoDomain *domain, MonoObject *this, MonoObject *target, RuntimeMethod *runtime_method)
+{
+ MonoDelegate *delegate = (MonoDelegate *)this;
+
+ delegate->method_info = mono_method_get_object (domain, runtime_method->method, NULL);
+ delegate->target = target;
+
+ if (target && target->vtable->klass == mono_defaults.transparent_proxy_class) {
+ MonoMethod *method = mono_marshal_get_remoting_invoke (runtime_method->method);
+ delegate->method_ptr = mono_interp_get_runtime_method (method);
+ } else {
+ delegate->method_ptr = runtime_method;
+ }
+}
+
+MonoDelegate*
+mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
+{
+ MonoDelegate *d;
+ MonoJitInfo *ji;
+ MonoDomain *domain = mono_domain_get ();
+
+ d = (MonoDelegate*)mono_object_new (domain, klass);
+
+ ji = mono_jit_info_table_find (domain, ftn);
+ if (ji == NULL)
+ mono_raise_exception (mono_get_exception_argument ("", "Function pointer was not created by a Delegate."));
+
+ /* FIXME: discard the wrapper and call the original method */
+ interp_delegate_ctor (domain, (MonoObject*)d, NULL, mono_interp_get_runtime_method (ji->method));
+
+ return d;
}
/*
@@ -632,102 +788,39 @@ ves_pinvoke_method (MonoInvocation *frame)
* provided by the runtime and is primarily used for the methods of delegates.
*/
static void
-ves_runtime_method (MonoInvocation *frame)
+ves_runtime_method (MonoInvocation *frame, ThreadContext *context)
{
- const char *name = frame->method->name;
+ MonoMethod *method = frame->runtime_method->method;
+ const char *name = method->name;
MonoObject *obj = (MonoObject*)frame->obj;
- MonoMulticastDelegate *delegate = (MonoMulticastDelegate*)frame->obj;
- MonoInvocation call;
- mono_class_init (frame->method->klass);
+ mono_class_init (method->klass);
- if (*name == '.' && (strcmp (name, ".ctor") == 0) && obj &&
- mono_object_isinst (obj, mono_defaults.multicastdelegate_class)) {
-
- mono_delegate_ctor (obj, frame->stack_args[0].data.p, frame->stack_args[1].data.p);
- return;
- }
- if (*name == 'I' && (strcmp (name, "Invoke") == 0) && obj &&
- mono_object_isinst (obj, mono_defaults.multicastdelegate_class)) {
- guchar *code;
- MonoJitInfo *ji;
- MonoMethod *method;
-
- while (delegate) {
-
- code = (guchar*)delegate->delegate.method_ptr;
- if ((ji = mono_jit_info_table_find (mono_root_domain, code))) {
- method = ji->method;
- INIT_FRAME(&call,frame,delegate->delegate.target,frame->stack_args,frame->retval,method);
- ves_exec_method (&call);
- } else {
-#if 0
- if (!method->addr)
- method->addr = mono_create_trampoline (method, 1);
- func = method->addr;
- /* FIXME: need to handle exceptions across managed/unmanaged boundaries */
- func ((MonoFunc)delegate->method_ptr, &frame->retval->data.p,
- delegate->target, frame->stack_args);
- stackval_from_data (frame->method->signature->ret, frame->retval,
- (char*)&frame->retval->data.p);
-#endif
- g_assert_not_reached ();
- }
-
- delegate = delegate->prev;
+ if (obj && mono_object_isinst (obj, mono_defaults.multicastdelegate_class)) {
+ if (*name == '.' && (strcmp (name, ".ctor") == 0)) {
+ interp_delegate_ctor (context->domain, obj, frame->stack_args[0].data.p, frame->stack_args[1].data.p);
+ return;
}
- return;
}
- if (*name == 'B' && (strcmp (name, "BeginInvoke") == 0) && obj &&
- mono_object_isinst (obj, mono_defaults.multicastdelegate_class)) {
- MonoMethodMessage *msg;
- MonoDelegate *async_callback;
- MonoObject *state;
- MonoMethod *im;
- MonoAsyncResult *ares;
-
- im = mono_get_delegate_invoke (frame->method->klass);
- msg = arch_method_call_message_new (frame->method, frame->obj, frame->stack_args, im, &async_callback, &state);
- ares = mono_thread_pool_add (delegate, msg, async_callback, state);
- frame->retval->data.p = ares;
- return;
- }
- if (*name == 'E' && (strcmp (name, "EndInvoke") == 0) && obj &&
- mono_object_isinst (obj, mono_defaults.multicastdelegate_class)) {
- MonoAsyncResult *ares;
- MonoMethodSignature *sig = frame->method->signature;
- MonoMethodMessage *msg;
- MonoObject *res, *exc;
- MonoArray *out_args;
-
- msg = arch_method_call_message_new (frame->method, frame->obj, frame->stack_args, NULL, NULL, NULL);
-
- ares = mono_array_get (msg->args, gpointer, sig->param_count - 1);
- g_assert (ares);
-
- res = mono_thread_pool_finish (ares, &out_args, &exc);
-
- if (exc) {
- char *strace = mono_string_to_utf8 (((MonoException*)exc)->stack_trace);
- char *tmp;
- tmp = g_strdup_printf ("%s\nException Rethrown at:\n", strace);
- g_free (strace);
- ((MonoException*)exc)->stack_trace = mono_string_new (mono_object_domain (exc), tmp);
- g_free (tmp);
- mono_raise_exception ((MonoException*)exc);
+ if (obj && mono_object_isinst (obj, mono_defaults.array_class)) {
+ if (*name == 'S' && (strcmp (name, "Set") == 0)) {
+ ves_array_set (frame);
+ return;
}
-
- /* restore return value */
- if (sig->ret->type != MONO_TYPE_VOID) {
- g_assert (res);
- /*arch_method_return_message_restore (method, &first_arg, res, out_args);*/
+ if (*name == 'G' && (strcmp (name, "Get") == 0)) {
+ ves_array_get (frame);
+ return;
+ }
+ if (*name == 'A' && (strcmp (name, "Address") == 0)) {
+ ves_array_element_address (frame);
+ return;
}
- return;
}
+
g_error ("Don't know how to exec runtime method %s.%s::%s",
- frame->method->klass->name_space, frame->method->klass->name,
- frame->method->name);
+ method->klass->name_space, method->klass->name,
+ method->name);
}
static char*
@@ -740,338 +833,160 @@ dump_stack (stackval *stack, stackval *sp)
return g_string_free (str, FALSE);
while (s < sp) {
- switch (s->type) {
- case VAL_I32: g_string_sprintfa (str, "[%d] ", s->data.i); break;
- case VAL_I64: g_string_sprintfa (str, "[%lld] ", s->data.l); break;
- case VAL_DOUBLE: g_string_sprintfa (str, "[%0.5f] ", s->data.f); break;
- case VAL_VALUET:
- if (!global_no_pointers)
- g_string_sprintfa (str, "[vt: %p] ", s->data.vt.vt);
- else
- g_string_sprintfa (str, "[vt%s] ", s->data.vt.vt ? "" : "=null");
- break;
- case VAL_OBJ: {
- MonoObject *obj = s->data.p;
- if (global_no_pointers && obj && obj->vtable) {
- MonoClass *klass = mono_object_class (obj);
- if (klass == mono_defaults.string_class) {
- char *utf8 = mono_string_to_utf8 ((MonoString*) obj);
- g_string_sprintfa (str, "[str:%s] ", utf8);
- g_free (utf8);
- break;
- } else if (klass == mono_defaults.sbyte_class) {
- g_string_sprintfa (str, "[b:%d] ",
- *(gint8 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.int16_class) {
- g_string_sprintfa (str, "[b:%d] ",
- *(gint16 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.int32_class) {
- g_string_sprintfa (str, "[b:%d] ",
- *(gint32 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.byte_class) {
- g_string_sprintfa (str, "[b:%u] ",
- *(guint8 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.char_class
- || klass == mono_defaults.uint16_class) {
- g_string_sprintfa (str, "[b:%u] ",
- *(guint16 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.uint32_class) {
- g_string_sprintfa (str, "[b:%u] ",
- *(guint32 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.int64_class) {
- g_string_sprintfa (str, "[b:%lld] ",
- *(gint64 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.uint64_class) {
- g_string_sprintfa (str, "[b:%llu] ",
- *(guint64 *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.double_class) {
- g_string_sprintfa (str, "[b:%0.5f] ",
- *(gdouble *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.single_class) {
- g_string_sprintfa (str, "[b:%0.5f] ",
- *(gfloat *)((guint8 *) obj + sizeof (MonoObject)));
- break;
- } else if (klass == mono_defaults.boolean_class) {
- g_string_sprintfa (str, "[b:%s] ",
- *(gboolean *)((guint8 *) obj + sizeof (MonoObject))
- ? "true" : "false");
- break;
- }
- }
- /* fall thru */
- }
- default:
- if (!global_no_pointers)
- g_string_sprintfa (str, "[%p] ", s->data.p);
- else
- g_string_sprintfa (str, s->data.p ? "[ptr] " : "[null] ");
- break;
- }
+ g_string_sprintfa (str, "[%lld/0x%0llx] ", s->data.l, s->data.l);
++s;
}
return g_string_free (str, FALSE);
}
+static void
+dump_stackval (GString *str, stackval *s, MonoType *type)
+{
+ switch (type->type) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_BOOLEAN:
+ g_string_sprintfa (str, "[%d] ", s->data.i);
+ break;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ g_string_sprintfa (str, "[%p] ", s->data.p);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype)
+ g_string_sprintfa (str, "[%d] ", s->data.i);
+ else
+ g_string_sprintfa (str, "[vt:%p] ", s->data.p);
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ g_string_sprintfa (str, "[%g] ", s->data.f);
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ default:
+ g_string_sprintfa (str, "[%lld/0x%0llx] ", s->data.l, s->data.l);
+ break;
+ }
+}
+
static char*
-dump_frame (MonoInvocation *inv)
+dump_args (MonoInvocation *inv)
{
GString *str = g_string_new ("");
int i;
- char *args;
- for (i = 0; inv; inv = inv->parent, ++i) {
- MonoClass *k = inv->method->klass;
- int codep;
- const char * opname;
- if (inv->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL ||
- inv->method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) {
- codep = 0;
- opname = "";
- } else {
- MonoMethodHeader *hd = ((MonoMethodNormal *)inv->method)->header;
- if (inv->ip)
- codep = *(inv->ip) == 0xfe? inv->ip [1] + 256: *(inv->ip);
- else
- codep = 0;
- opname = mono_opcode_names [codep];
- codep = inv->ip - hd->code;
- }
- args = dump_stack (inv->stack_args, inv->stack_args + inv->method->signature->param_count);
- g_string_sprintfa (str, "#%d: 0x%05x %-10s in %s.%s::%s (%s)\n", i, codep, opname,
- k->name_space, k->name, inv->method->name, args);
- g_free (args);
- }
+ MonoMethodSignature *signature = inv->runtime_method->method->signature;
+
+ if (signature->param_count == 0)
+ return g_string_free (str, FALSE);
+
+ if (signature->hasthis)
+ g_string_sprintfa (str, "%p ", inv->obj);
+
+ for (i = 0; i < signature->param_count; ++i)
+ dump_stackval (str, inv->stack_args + i, signature->params [i]);
+
return g_string_free (str, FALSE);
}
-static CRITICAL_SECTION metadata_lock;
+static char*
+dump_retval (MonoInvocation *inv)
+{
+ GString *str = g_string_new ("");
+ MonoType *ret = inv->runtime_method->method->signature->ret;
-typedef enum {
- INLINE_STRING_LENGTH = 1,
- INLINE_ARRAY_LENGTH,
- INLINE_ARRAY_RANK,
- INLINE_TYPE_ELEMENT_TYPE
-} InlineMethod;
+ if (ret->type != MONO_TYPE_VOID)
+ dump_stackval (str, inv->retval, ret);
-static void
-calc_offsets (MonoImage *image, MonoMethod *method)
+ return g_string_free (str, FALSE);
+}
+
+static char*
+dump_frame (MonoInvocation *inv)
{
- int i, align, size, offset = 0;
- MonoMethodHeader *header = ((MonoMethodNormal*)method)->header;
- MonoMethodSignature *signature = method->signature;
- int hasthis = signature->hasthis;
- register const unsigned char *ip, *end;
- const MonoOpcode *opcode;
- guint32 token;
- MonoMethod *m;
- MonoClass *class;
- MonoDomain *domain = mono_domain_get ();
- guint32 *offsets;
-
- mono_profiler_method_jit (method); /* sort of... */
- offsets = g_new0 (guint32, 2 + header->num_locals + signature->param_count + signature->hasthis);
- for (i = 0; i < header->num_locals; ++i) {
- size = mono_type_size (header->locals [i], &align);
- offset += align - 1;
- offset &= ~(align - 1);
- offsets [2 + i] = offset;
- offset += size;
- }
- offsets [0] = offset;
- offset = 0;
- if (hasthis) {
- offset += sizeof (gpointer) - 1;
- offset &= ~(sizeof (gpointer) - 1);
- offsets [2 + header->num_locals] = offset;
- offset += sizeof (gpointer);
- }
- for (i = 0; i < signature->param_count; ++i) {
- size = mono_type_size (signature->params [i], &align);
- offset += align - 1;
- offset &= ~(align - 1);
- offsets [2 + hasthis + header->num_locals + i] = offset;
- offset += size;
- }
- offsets [1] = offset;
-
- EnterCriticalSection (&metadata_lock);
- /* intern the strings in the method. */
- ip = header->code;
- end = ip + header->code_size;
- while (ip < end) {
- i = *ip;
- if (*ip == 0xfe) {
- ip++;
- i = *ip + 256;
- }
- opcode = &mono_opcodes [i];
- switch (opcode->argument) {
- case MonoInlineNone:
- ++ip;
- break;
- case MonoInlineString:
- mono_ldstr (domain, image, mono_metadata_token_index (read32 (ip + 1)));
- ip += 5;
- break;
- case MonoInlineType:
- class = mono_class_get (image, read32 (ip + 1));
- mono_class_init (class);
- if (!(class->flags & TYPE_ATTRIBUTE_INTERFACE))
- mono_class_vtable (domain, class);
- ip += 5;
- break;
- case MonoInlineField:
- token = read32 (ip + 1);
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
- mono_field_from_memberref (image, token, &class);
- } else {
- class = mono_class_get (image,
- MONO_TOKEN_TYPE_DEF | mono_metadata_typedef_from_field (image, token & 0xffffff));
+ GString *str = g_string_new ("");
+ int i;
+ char *args;
+ for (i = 0; inv; inv = inv->parent) {
+ if (inv->runtime_method != NULL) {
+ MonoMethod *method = inv->runtime_method->method;
+ MonoClass *k;
+
+ int codep = 0;
+ const char * opname = "";
+ char *name;
+ gchar *source = NULL;
+
+ k = method->klass;
+
+ if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 &&
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) == 0) {
+ MonoMethodHeader *hd = mono_method_get_header (method);
+
+ if (hd != NULL) {
+ if (inv->ip) {
+ opname = mono_interp_opname [*inv->ip];
+ codep = inv->ip - inv->runtime_method->code;
+ } else
+ opname = "";
+
+ source = mono_debug_source_location_from_il_offset (method, codep, NULL);
+ }
}
- mono_class_init (class);
- mono_class_vtable (domain, class);
- ip += 5;
- break;
- case MonoInlineMethod:
- m = mono_get_method (image, read32 (ip + 1), NULL);
- mono_class_init (m->klass);
- if (!(m->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
- mono_class_vtable (domain, m->klass);
- ip += 5;
- break;
- case MonoInlineTok:
- case MonoInlineSig:
- case MonoShortInlineR:
- case MonoInlineI:
- case MonoInlineBrTarget:
- ip += 5;
- break;
- case MonoInlineVar:
- ip += 3;
- break;
- case MonoShortInlineVar:
- case MonoShortInlineI:
- case MonoShortInlineBrTarget:
- ip += 2;
- break;
- case MonoInlineSwitch: {
- guint32 n;
- ++ip;
- n = read32 (ip);
- ip += 4;
- ip += 4 * n;
- break;
- }
- case MonoInlineR:
- case MonoInlineI8:
- ip += 9;
- break;
- default:
- g_assert_not_reached ();
+ args = dump_args (inv);
+ name = mono_method_full_name (method, TRUE);
+ if (source)
+ g_string_sprintfa (str, "#%d: 0x%05x %-10s in %s (%s) at %s\n", i, codep, opname,
+ name, args, source);
+ else
+ g_string_sprintfa (str, "#%d: 0x%05x %-10s in %s (%s)\n", i, codep, opname,
+ name, args);
+ g_free (name);
+ g_free (args);
+ g_free (source);
+ ++i;
}
-
}
- method->info = offsets;
-
- /*
- * We store the inline info in addr, since it's unused for IL methods.
- */
- if (method->klass == mono_defaults.string_class) {
- if (strcmp (method->name, "get_Length") == 0)
- method->addr = GUINT_TO_POINTER (INLINE_STRING_LENGTH);
- } else if (method->klass == mono_defaults.array_class) {
- if (strcmp (method->name, "get_Length") == 0)
- method->addr = GUINT_TO_POINTER (INLINE_ARRAY_LENGTH);
- else if (strcmp (method->name, "get_Rank") == 0 || strcmp (method->name, "GetRank") == 0)
- method->addr = GUINT_TO_POINTER (INLINE_ARRAY_RANK);
- } else if (method->klass == mono_defaults.monotype_class) {
- if (strcmp (method->name, "GetElementType") == 0)
- method->addr = GUINT_TO_POINTER (INLINE_TYPE_ELEMENT_TYPE);
- }
- LeaveCriticalSection (&metadata_lock);
- mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
+ return g_string_free (str, FALSE);
}
-#define LOCAL_POS(n) (frame->locals + offsets [2 + (n)])
-#define LOCAL_TYPE(header, n) ((header)->locals [(n)])
+static MonoArray *
+get_trace_ips (MonoDomain *domain, MonoInvocation *top)
+{
+ int i;
+ MonoArray *res;
+ MonoInvocation *inv;
-#define ARG_POS(n) (args_pointers [(n)])
-#define ARG_TYPE(sig, n) ((n) ? (sig)->params [(n) - (sig)->hasthis] : \
- (sig)->hasthis ? &frame->method->klass->this_arg: (sig)->params [(0)])
+ for (i = 0, inv = top; inv; inv = inv->parent)
+ if (inv->runtime_method != NULL)
+ ++i;
-#define THROW_EX(exception,ex_ip) \
- do {\
- char *stack_trace; \
- frame->ip = (ex_ip); \
- stack_trace = dump_frame (frame); \
- frame->ex = (MonoException*)(exception); \
- frame->ex->stack_trace = mono_string_new (domain, stack_trace); \
- g_free (stack_trace); \
- goto handle_exception; \
- } while (0)
-
-typedef struct _vtallocation vtallocation;
-
-struct _vtallocation {
- vtallocation *next;
- guint32 size;
- char data [MONO_ZERO_LEN_ARRAY];
-};
+ res = mono_array_new (domain, mono_defaults.int_class, 2 * i);
-/*
- * we don't use vtallocation->next, yet
- */
-#define vt_alloc(vtype,sp) \
- if ((vtype)->type == MONO_TYPE_VALUETYPE && !(vtype)->data.klass->enumtype) { \
- if (!(vtype)->byref) { \
- guint32 align; \
- guint32 size = mono_class_value_size ((vtype)->data.klass, &align); \
- if (!vtalloc || vtalloc->size <= size) { \
- vtalloc = alloca (sizeof (vtallocation) + size); \
- vtalloc->size = size; \
- g_assert (size < 10000); \
- } \
- (sp)->data.vt.vt = vtalloc->data; \
- vtalloc = NULL; \
- } else { \
- (sp)->data.vt.klass = (vtype)->data.klass; \
- } \
- }
-
-#define vt_free(sp) \
- do { \
- if ((sp)->type == VAL_VALUET) { \
- vtalloc = (vtallocation*)(((char*)(sp)->data.vt.vt) - G_STRUCT_OFFSET (vtallocation, data)); \
- } \
- } while (0)
+ for (i = 0, inv = top; inv; inv = inv->parent)
+ if (inv->runtime_method != NULL) {
+ mono_array_set (res, gpointer, i, inv->runtime_method);
+ ++i;
+ mono_array_set (res, gpointer, i, (gpointer)inv->ip);
+ ++i;
+ }
-static void
-verify_method (MonoMethod *m)
-{
- GSList *errors, *tmp;
- MonoVerifyInfo *info;
-
- errors = mono_method_verify (m, MONO_VERIFY_ALL);
- if (errors)
- g_print ("Method %s.%s::%s has invalid IL.\n", m->klass->name_space, m->klass->name, m->name);
- for (tmp = errors; tmp; tmp = tmp->next) {
- info = tmp->data;
- g_print ("%s\n", info->message);
- }
- if (errors)
- G_BREAKPOINT ();
- mono_free_verify_list (errors);
+ return res;
}
-#define MYGUINT64_MAX 18446744073709551615UL
+
+#define MYGUINT64_MAX 18446744073709551615ULL
#define MYGINT64_MAX 9223372036854775807LL
#define MYGINT64_MIN (-MYGINT64_MAX -1LL)
@@ -1083,33 +998,120 @@ verify_method (MonoMethod *m)
(gint32)(b) >= 0 ? (gint32)(MYGINT32_MAX) - (gint32)(b) < (gint32)(a) ? -1 : 0 \
: (gint32)(MYGINT32_MIN) - (gint32)(b) > (gint32)(a) ? +1 : 0
+#define CHECK_SUB_OVERFLOW(a,b) \
+ (gint32)(b) < 0 ? (gint32)(MYGINT32_MAX) + (gint32)(b) < (gint32)(a) ? -1 : 0 \
+ : (gint32)(MYGINT32_MIN) + (gint32)(b) > (gint32)(a) ? +1 : 0
+
#define CHECK_ADD_OVERFLOW_UN(a,b) \
(guint32)(MYGUINT32_MAX) - (guint32)(b) < (guint32)(a) ? -1 : 0
+#define CHECK_SUB_OVERFLOW_UN(a,b) \
+ (guint32)(a) < (guint32)(b) ? -1 : 0
+
#define CHECK_ADD_OVERFLOW64(a,b) \
(gint64)(b) >= 0 ? (gint64)(MYGINT64_MAX) - (gint64)(b) < (gint64)(a) ? -1 : 0 \
: (gint64)(MYGINT64_MIN) - (gint64)(b) > (gint64)(a) ? +1 : 0
+#define CHECK_SUB_OVERFLOW64(a,b) \
+ (gint64)(b) < 0 ? (gint64)(MYGINT64_MAX) + (gint64)(b) < (gint64)(a) ? -1 : 0 \
+ : (gint64)(MYGINT64_MIN) + (gint64)(b) > (gint64)(a) ? +1 : 0
+
#define CHECK_ADD_OVERFLOW64_UN(a,b) \
(guint64)(MYGUINT64_MAX) - (guint64)(b) < (guint64)(a) ? -1 : 0
+#define CHECK_SUB_OVERFLOW64_UN(a,b) \
+ (guint64)(a) < (guint64)(b) ? -1 : 0
+
+#if SIZEOF_VOID_P == 4
+#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW(a,b)
+#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW_UN(a,b)
+#else
+#define CHECK_ADD_OVERFLOW_NAT(a,b) CHECK_ADD_OVERFLOW64(a,b)
+#define CHECK_ADD_OVERFLOW_NAT_UN(a,b) CHECK_ADD_OVERFLOW64_UN(a,b)
+#endif
+
+/* Resolves to TRUE if the operands would overflow */
+#define CHECK_MUL_OVERFLOW(a,b) \
+ ((gint32)(a) == 0) || ((gint32)(b) == 0) ? 0 : \
+ (((gint32)(a) > 0) && ((gint32)(b) == -1)) ? FALSE : \
+ (((gint32)(a) < 0) && ((gint32)(b) == -1)) ? (a == - MYGINT32_MAX) : \
+ (((gint32)(a) > 0) && ((gint32)(b) > 0)) ? (gint32)(a) > ((MYGINT32_MAX) / (gint32)(b)) : \
+ (((gint32)(a) > 0) && ((gint32)(b) < 0)) ? (gint32)(a) > ((MYGINT32_MIN) / (gint32)(b)) : \
+ (((gint32)(a) < 0) && ((gint32)(b) > 0)) ? (gint32)(a) < ((MYGINT32_MIN) / (gint32)(b)) : \
+ (gint32)(a) < ((MYGINT32_MAX) / (gint32)(b))
+
+#define CHECK_MUL_OVERFLOW_UN(a,b) \
+ ((guint32)(a) == 0) || ((guint32)(b) == 0) ? 0 : \
+ (guint32)(b) > ((MYGUINT32_MAX) / (guint32)(a))
+
+#define CHECK_MUL_OVERFLOW64(a,b) \
+ ((gint64)(a) == 0) || ((gint64)(b) == 0) ? 0 : \
+ (((gint64)(a) > 0) && ((gint64)(b) == -1)) ? FALSE : \
+ (((gint64)(a) < 0) && ((gint64)(b) == -1)) ? (a == - MYGINT64_MAX) : \
+ (((gint64)(a) > 0) && ((gint64)(b) > 0)) ? (gint64)(a) > ((MYGINT64_MAX) / (gint64)(b)) : \
+ (((gint64)(a) > 0) && ((gint64)(b) < 0)) ? (gint64)(a) > ((MYGINT64_MIN) / (gint64)(b)) : \
+ (((gint64)(a) < 0) && ((gint64)(b) > 0)) ? (gint64)(a) < ((MYGINT64_MIN) / (gint64)(b)) : \
+ (gint64)(a) < ((MYGINT64_MAX) / (gint64)(b))
+
+#define CHECK_MUL_OVERFLOW64_UN(a,b) \
+ ((guint64)(a) == 0) || ((guint64)(b) == 0) ? 0 : \
+ (guint64)(b) > ((MYGUINT64_MAX) / (guint64)(a))
+
+#if SIZEOF_VOID_P == 4
+#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW(a,b)
+#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW_UN(a,b)
+#else
+#define CHECK_MUL_OVERFLOW_NAT(a,b) CHECK_MUL_OVERFLOW64(a,b)
+#define CHECK_MUL_OVERFLOW_NAT_UN(a,b) CHECK_MUL_OVERFLOW64_UN(a,b)
+#endif
+
static MonoObject*
interp_mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
{
MonoInvocation frame;
+ ThreadContext * volatile context = TlsGetValue (thread_context_id);
MonoObject *retval = NULL;
MonoMethodSignature *sig = method->signature;
MonoClass *klass = mono_class_from_mono_type (sig->ret);
- int i, type, isobject = 0, string_ctor = 0;
- void *ret;
+ int i, type, isobject = 0;
+ void *ret = NULL;
stackval result;
stackval *args = alloca (sizeof (stackval) * sig->param_count);
+ ThreadContext context_struct;
+ MonoInvocation *old_frame = NULL;
+ jmp_buf env;
+
+ frame.ex = NULL;
+
+ if (setjmp(env)) {
+ if (context != &context_struct) {
+ context->domain = mono_domain_get ();
+ context->current_frame = old_frame;
+ context->managed_code = 0;
+ } else
+ TlsSetValue (thread_context_id, NULL);
+ if (exc != NULL)
+ *exc = (MonoObject *)frame.ex;
+ return retval;
+ }
- /* FIXME: Set frame for execption handling. */
+ if (context == NULL) {
+ context = &context_struct;
+ context_struct.base_frame = &frame;
+ context_struct.current_frame = NULL;
+ context_struct.env_frame = &frame;
+ context_struct.current_env = &env;
+ context_struct.search_for_handler = 0;
+ context_struct.managed_code = 0;
+ TlsSetValue (thread_context_id, context);
+ }
+ else
+ old_frame = context->current_frame;
+
+ context->domain = mono_domain_get ();
switch (sig->ret->type) {
case MONO_TYPE_VOID:
- string_ctor = method->klass == mono_defaults.string_class && !strcmp (method->name, ".ctor");
break;
case MONO_TYPE_STRING:
case MONO_TYPE_OBJECT:
@@ -1119,20 +1121,19 @@ interp_mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoOb
isobject = 1;
break;
case MONO_TYPE_VALUETYPE:
- retval = mono_object_new (mono_domain_get (), klass);
+ retval = mono_object_new (context->domain, klass);
ret = ((char*)retval) + sizeof (MonoObject);
if (!sig->ret->data.klass->enumtype)
- result.data.vt.vt = ret;
+ result.data.vt = ret;
break;
default:
- retval = mono_object_new (mono_domain_get (), klass);
+ retval = mono_object_new (context->domain, klass);
ret = ((char*)retval) + sizeof (MonoObject);
break;
}
for (i = 0; i < sig->param_count; ++i) {
if (sig->params [i]->byref) {
- args [i].type = VAL_POINTER;
args [i].data.p = params [i];
continue;
}
@@ -1142,16 +1143,12 @@ handle_enum:
case MONO_TYPE_U1:
case MONO_TYPE_I1:
case MONO_TYPE_BOOLEAN:
- args [i].type = VAL_I32;
args [i].data.i = *(MonoBoolean*)params [i];
- args [i].data.vt.klass = NULL;
break;
case MONO_TYPE_U2:
case MONO_TYPE_I2:
case MONO_TYPE_CHAR:
- args [i].type = VAL_I32;
args [i].data.i = *(gint16*)params [i];
- args [i].data.vt.klass = NULL;
break;
#if SIZEOF_VOID_P == 4
case MONO_TYPE_U: /* use VAL_POINTER? */
@@ -1159,9 +1156,7 @@ handle_enum:
#endif
case MONO_TYPE_U4:
case MONO_TYPE_I4:
- args [i].type = VAL_I32;
args [i].data.i = *(gint32*)params [i];
- args [i].data.vt.klass = NULL;
break;
#if SIZEOF_VOID_P == 8
case MONO_TYPE_U:
@@ -1169,16 +1164,14 @@ handle_enum:
#endif
case MONO_TYPE_U8:
case MONO_TYPE_I8:
- args [i].type = VAL_I64;
args [i].data.l = *(gint64*)params [i];
- args [i].data.vt.klass = NULL;
break;
case MONO_TYPE_VALUETYPE:
if (sig->params [i]->data.klass->enumtype) {
type = sig->params [i]->data.klass->enum_basetype->type;
goto handle_enum;
} else {
- g_warning ("generic valutype %s not handled in runtime invoke", sig->params [i]->data.klass->name);
+ args [i].data.p = params [i];
}
break;
case MONO_TYPE_STRING:
@@ -1186,156 +1179,283 @@ handle_enum:
case MONO_TYPE_ARRAY:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
- args [i].type = VAL_OBJ;
args [i].data.p = params [i];
- args [i].data.vt.klass = NULL;
break;
default:
g_error ("type 0x%x not handled in runtime invoke", sig->params [i]->type);
}
}
- INIT_FRAME(&frame,NULL,obj,args,&result,method);
- ves_exec_method (&frame);
- if (sig->ret->type == MONO_TYPE_VOID && !string_ctor)
+ if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ method = mono_marshal_get_native_wrapper (method);
+ INIT_FRAME(&frame,context->current_frame,obj,args,&result,method);
+ if (exc)
+ frame.invoke_trap = 1;
+ context->managed_code = 1;
+ ves_exec_method_with_context (&frame, context);
+ context->managed_code = 0;
+ if (context == &context_struct)
+ TlsSetValue (thread_context_id, NULL);
+ else
+ context->current_frame = old_frame;
+ if (frame.ex != NULL) {
+ if (exc != NULL) {
+ *exc = (MonoObject*) frame.ex;
+ return NULL;
+ }
+ if (context->current_env != NULL) {
+ context->env_frame->ex = frame.ex;
+ longjmp(*context->current_env, 1);
+ }
+ else
+ printf("dropped exception...\n");
+ }
+ if (sig->ret->type == MONO_TYPE_VOID && !method->string_ctor)
return NULL;
- if (isobject || string_ctor)
+ if (isobject || method->string_ctor)
return result.data.p;
- stackval_to_data (sig->ret, &result, ret);
+ stackval_to_data (sig->ret, &result, ret, sig->pinvoke);
return retval;
}
-/*
- * Need to optimize ALU ops when natural int == int32
- *
- * IDEA: if we maintain a stack of ip, sp to be checked
- * in the return opcode, we could inline simple methods that don't
- * use the stack or local variables....
- *
- * The {,.S} versions of many opcodes can/should be merged to reduce code
- * duplication.
- *
- */
-void
-ves_exec_method (MonoInvocation *frame)
+static stackval *
+do_icall (ThreadContext *context, int op, stackval *sp, gpointer ptr)
{
- MonoDomain *domain = mono_domain_get ();
- MonoInvocation child_frame;
- MonoMethodHeader *header;
- MonoMethodSignature *signature;
- MonoImage *image;
- GSList *finally_ips = NULL;
- const unsigned char *endfinally_ip;
- register const unsigned char *ip;
- register stackval *sp;
- void **args_pointers;
- guint32 *offsets;
- gint il_ins_count = -1;
- gint tracing = global_tracing;
- unsigned char tail_recursion = 0;
- unsigned char unaligned_address = 0;
- unsigned char volatile_address = 0;
- vtallocation *vtalloc = NULL;
- GOTO_LABEL_VARS;
+ MonoInvocation *old_frame = context->current_frame;
+ MonoInvocation *old_env_frame = context->env_frame;
+ jmp_buf *old_env = context->current_env;
+ jmp_buf env;
- signature = frame->method->signature;
+ if (setjmp (env)) {
+ context->current_frame = old_frame;
+ context->env_frame = old_env_frame;
+ context->current_env = old_env;
+ context->managed_code = 1;
+ return sp;
+ }
- DEBUG_ENTER ();
+ context->env_frame = context->current_frame;
+ context->current_env = &env;
+ context->managed_code = 0;
- if (frame->method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
- if (!frame->method->addr) {
- frame->ex = (MonoException*)mono_get_exception_missing_method ();
- DEBUG_LEAVE ();
- return;
- }
- if (frame->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
- ves_pinvoke_method (frame);
- } else {
- ICallMethod icall = (ICallMethod)frame->method->addr;
- icall (frame);
- }
- if (frame->ex)
- goto handle_exception;
- DEBUG_LEAVE ();
- return;
- }
+ switch (op) {
+ case MINT_ICALL_P_V: {
+ void (*func)(gpointer) = ptr;
+ func (sp [-1].data.p);
+ sp --;
+ break;
+ }
+ case MINT_ICALL_P_P: {
+ gpointer (*func)(gpointer) = ptr;
+ sp [-1].data.p = func (sp [-1].data.p);
+ break;
+ }
+ case MINT_ICALL_PP_V: {
+ void (*func)(gpointer,gpointer) = ptr;
+ sp -= 2;
+ func (sp [0].data.p, sp [1].data.p);
+ break;
+ }
+ case MINT_ICALL_PI_V: {
+ void (*func)(gpointer,int) = ptr;
+ sp -= 2;
+ func (sp [0].data.p, sp [1].data.i);
+ break;
+ }
+ case MINT_ICALL_PP_P: {
+ gpointer (*func)(gpointer,gpointer) = ptr;
+ --sp;
+ sp [-1].data.p = func (sp [-1].data.p, sp [0].data.p);
+ break;
+ }
+ case MINT_ICALL_PI_P: {
+ gpointer (*func)(gpointer,int) = ptr;
+ --sp;
+ sp [-1].data.p = func (sp [-1].data.p, sp [0].data.i);
+ break;
+ }
+ case MINT_ICALL_PPP_V: {
+ void (*func)(gpointer,gpointer,gpointer) = ptr;
+ sp -= 3;
+ func (sp [0].data.p, sp [1].data.p, sp [2].data.p);
+ break;
+ }
+ case MINT_ICALL_PPI_V: {
+ void (*func)(gpointer,gpointer,int) = ptr;
+ sp -= 3;
+ func (sp [0].data.p, sp [1].data.p, sp [2].data.i);
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ }
- if (frame->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
- if (!frame->method->addr) {
- if (!mono_lookup_pinvoke_call (frame->method)) {
- frame->ex = (MonoException*)mono_get_exception_missing_method ();
- DEBUG_LEAVE ();
- return;
- }
- }
- ves_pinvoke_method (frame);
- if (frame->ex)
- goto handle_exception;
- DEBUG_LEAVE ();
- return;
- }
+ context->env_frame = old_env_frame;
+ context->current_env = old_env;
- if (frame->method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) {
- ves_runtime_method (frame);
- if (frame->ex)
- goto handle_exception;
- DEBUG_LEAVE ();
- return;
- }
+ return sp;
+}
+
+static CRITICAL_SECTION create_method_pointer_mutex;
- /*verify_method (frame->method);*/
+static MonoGHashTable *method_pointer_hash = NULL;
- header = ((MonoMethodNormal *)frame->method)->header;
- image = frame->method->klass->image;
+static void *
+mono_create_method_pointer (MonoMethod *method)
+{
+ gpointer addr;
+ MonoJitInfo *ji;
- if (!frame->method->info)
- calc_offsets (image, frame->method);
- offsets = frame->method->info;
+ EnterCriticalSection (&create_method_pointer_mutex);
+ if (!method_pointer_hash) {
+ MONO_GC_REGISTER_ROOT (method_pointer_hash);
+ method_pointer_hash = mono_g_hash_table_new (NULL, NULL);
+ }
+ addr = mono_g_hash_table_lookup (method_pointer_hash, method);
+ if (addr) {
+ LeaveCriticalSection (&create_method_pointer_mutex);
+ return addr;
+ }
/*
- * with alloca we get the expected huge performance gain
- * stackval *stack = g_new0(stackval, header->max_stack);
+ * If it is a static P/Invoke method, we can just return the pointer
+ * to the method implementation.
*/
- g_assert (header->max_stack < 10000);
- sp = frame->stack = alloca (sizeof (stackval) * header->max_stack);
-
- if (header->num_locals) {
- g_assert (offsets [0] < 10000);
- frame->locals = alloca (offsets [0]);
- /*
- * yes, we do it unconditionally, because it needs to be done for
- * some cases anyway and checking for that would be even slower.
- */
- memset (frame->locals, 0, offsets [0]);
+ if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && ((MonoMethodPInvoke*) method)->addr) {
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_size = 1;
+ ji->code_start = addr = ((MonoMethodPInvoke*) method)->addr;
+
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
+ }
+ else
+ addr = mono_arch_create_method_pointer (method);
+
+ mono_g_hash_table_insert (method_pointer_hash, method, addr);
+ LeaveCriticalSection (&create_method_pointer_mutex);
+
+ return addr;
+}
+
+#if COUNT_OPS
+static int opcode_counts[512];
+
+#define COUNT_OP(op) opcode_counts[op]++
+#else
+#define COUNT_OP(op)
+#endif
+
+#if DEBUG_INTERP
+#define DUMP_INSTR() \
+ if (tracing > 1) { \
+ char *ins; \
+ if (sp > frame->stack) { \
+ ins = dump_stack (frame->stack, sp); \
+ } else { \
+ ins = g_strdup (""); \
+ } \
+ sp->data.l = 0; \
+ output_indent (); \
+ g_print ("(%u) ", GetCurrentThreadId()); \
+ mono_interp_dis_mintop(rtm->code, ip); \
+ g_print ("\t%d:%s\n", vt_sp - vtalloc, ins); \
+ g_free (ins); \
}
- /*
- * Copy args from stack_args to args.
- */
- if (signature->param_count || signature->hasthis) {
- int i;
- int has_this = signature->hasthis;
-
- g_assert (offsets [1] < 10000);
- frame->args = alloca (offsets [1]);
- g_assert ((signature->param_count + has_this) < 1000);
- args_pointers = alloca (sizeof(void*) * (signature->param_count + has_this));
- if (has_this) {
- gpointer *this_arg;
- this_arg = args_pointers [0] = frame->args;
- *this_arg = frame->obj;
- }
- for (i = 0; i < signature->param_count; ++i) {
- args_pointers [i + has_this] = frame->args + offsets [2 + header->num_locals + has_this + i];
- stackval_to_data (signature->params [i], frame->stack_args + i, args_pointers [i + has_this]);
+#else
+#define DUMP_INSTR()
+#endif
+
+#ifdef __GNUC__
+#define USE_COMPUTED_GOTO 1
+#endif
+#if USE_COMPUTED_GOTO
+#define MINT_IN_SWITCH(op) COUNT_OP(op); goto *in_labels[op];
+#define MINT_IN_CASE(x) LAB_ ## x:
+#if DEBUG_INTERP
+#define MINT_IN_BREAK if (tracing > 1) goto main_loop; else { COUNT_OP(*ip); goto *in_labels[*ip]; }
+#else
+#define MINT_IN_BREAK { COUNT_OP(*ip); goto *in_labels[*ip]; }
+#endif
+#define MINT_IN_DEFAULT mint_default: if (0) goto mint_default; /* make gcc shut up */
+#else
+#define MINT_IN_SWITCH(op) switch (op)
+#define MINT_IN_CASE(x) case x:
+#define MINT_IN_BREAK break
+#define MINT_IN_DEFAULT default:
+#endif
+
+/*
+ * Defining this causes register allocation errors in some versions of gcc:
+ * error: unable to find a register to spill in class `SIREG'
+ */
+/* #define MINT_USE_DEDICATED_IP_REG */
+
+static void
+ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
+{
+ MonoInvocation child_frame;
+ GSList *finally_ips = NULL;
+ const unsigned short *endfinally_ip = NULL;
+#if defined(__GNUC__) && defined (i386) && defined (MINT_USE_DEDICATED_IP_REG)
+ register const unsigned short *ip asm ("%esi");
+#else
+ register const unsigned short *ip;
+#endif
+ register stackval *sp;
+ RuntimeMethod *rtm;
+#if DEBUG_INTERP
+ gint tracing = global_tracing;
+ unsigned char *vtalloc;
+#endif
+ int i32;
+ unsigned char *vt_sp;
+ char *locals;
+ MonoObject *o = NULL;
+ MonoClass *c;
+#if USE_COMPUTED_GOTO
+ static void *in_labels[] = {
+#define OPDEF(a,b,c,d) \
+ &&LAB_ ## a,
+#include "mintops.def"
+ 0 };
+#endif
+
+ frame->ex = NULL;
+ frame->ex_handler = NULL;
+ frame->ip = NULL;
+ context->current_frame = frame;
+
+ DEBUG_ENTER ();
+
+ if (!frame->runtime_method->transformed) {
+ context->managed_code = 0;
+ frame->ex = mono_interp_transform_method (frame->runtime_method, context);
+ context->managed_code = 1;
+ if (frame->ex) {
+ rtm = NULL;
+ ip = NULL;
+ goto exit_frame;
}
}
+ rtm = frame->runtime_method;
+ frame->args = alloca (rtm->alloca_size);
+ sp = frame->stack = (stackval *)((char *)frame->args + rtm->args_size);
+#if DEBUG_INTERP
+ if (tracing > 1)
+ memset(sp, 0, rtm->stack_size);
+#endif
+ vt_sp = (char *)sp + rtm->stack_size;
+#if DEBUG_INTERP
+ vtalloc = vt_sp;
+#endif
+ locals = vt_sp + rtm->vt_stack_size;
+
child_frame.parent = frame;
- frame->child = &child_frame;
- frame->ex = NULL;
/* ready to go */
- ip = header->code;
+ ip = rtm->code;
/*
* using while (ip < end) may result in a 15% performance drop,
@@ -1343,1213 +1463,1117 @@ ves_exec_method (MonoInvocation *frame)
*/
while (1) {
main_loop:
- /*g_assert (sp >= stack);*/
-#if DEBUG_INTERP
- opcode_count++;
- if (tracing > 1) {
- char *ins, *discode;
- if (sp > frame->stack) {
- ins = dump_stack (frame->stack, sp);
- } else {
- ins = g_strdup ("");
- }
- output_indent ();
- discode = mono_disasm_code_one (NULL, frame->method, ip);
- discode [strlen (discode) - 1] = 0; /* no \n */
- g_print ("(%d) %-29s %s\n", GetCurrentThreadId(), discode, ins);
- g_free (ins);
- g_free (discode);
- }
- if (il_ins_count > 0)
- if (!(--il_ins_count))
- G_BREAKPOINT ();
-#endif
-
- SWITCH (*ip) {
- CASE (CEE_NOP)
+ /* g_assert (sp >= frame->stack); */
+ /* g_assert(vt_sp - vtalloc <= rtm->vt_stack_size); */
+ DUMP_INSTR();
+ MINT_IN_SWITCH (*ip) {
+ MINT_IN_CASE(MINT_INITLOCALS)
+ memset (locals, 0, rtm->locals_size);
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NOP)
++ip;
- BREAK;
- CASE (CEE_BREAK)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BREAK)
++ip;
G_BREAKPOINT (); /* this is not portable... */
- BREAK;
- CASE (CEE_LDARG_0)
- CASE (CEE_LDARG_1)
- CASE (CEE_LDARG_2)
- CASE (CEE_LDARG_3) {
- int n = (*ip)-CEE_LDARG_0;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDNULL)
+ sp->data.p = NULL;
++ip;
- vt_alloc (ARG_TYPE (signature, n), sp);
- stackval_from_data (ARG_TYPE (signature, n), sp, ARG_POS (n));
++sp;
- BREAK;
- }
- CASE (CEE_LDLOC_0)
- CASE (CEE_LDLOC_1)
- CASE (CEE_LDLOC_2)
- CASE (CEE_LDLOC_3) {
- int n = (*ip)-CEE_LDLOC_0;
- ++ip;
- if ((LOCAL_TYPE (header, n))->type == MONO_TYPE_I4) {
- sp->type = VAL_I32;
- sp->data.i = *(gint32*) LOCAL_POS (n);
- ++sp;
- BREAK;
- } else {
- vt_alloc (LOCAL_TYPE (header, n), sp);
- stackval_from_data (LOCAL_TYPE (header, n), sp, LOCAL_POS (n));
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_VTRESULT) {
+ int ret_size = * (guint16 *)(ip + 1);
+ char *ret_vt_sp = vt_sp;
+ vt_sp -= READ32(ip + 2);
+ if (ret_size > 0) {
+ memmove (vt_sp, ret_vt_sp, ret_size);
+ vt_sp += (ret_size + 7) & ~7;
}
- ++sp;
- BREAK;
- }
- CASE (CEE_STLOC_0)
- CASE (CEE_STLOC_1)
- CASE (CEE_STLOC_2)
- CASE (CEE_STLOC_3) {
- int n = (*ip)-CEE_STLOC_0;
- ++ip;
- --sp;
- if ((LOCAL_TYPE (header, n))->type == MONO_TYPE_I4) {
- gint32 *p = (gint32*)LOCAL_POS (n);
- *p = sp->data.i;
- BREAK;
- } else {
- stackval_to_data (LOCAL_TYPE (header, n), sp, LOCAL_POS (n));
- vt_free (sp);
- BREAK;
- }
- }
- CASE (CEE_LDARG_S)
- ++ip;
- vt_alloc (ARG_TYPE (signature, *ip), sp);
- stackval_from_data (ARG_TYPE (signature, *ip), sp, ARG_POS (*ip));
- ++sp;
- ++ip;
- BREAK;
- CASE (CEE_LDARGA_S) {
- MonoType *t;
- MonoClass *c;
-
- ++ip;
- t = ARG_TYPE (signature, *ip);
- c = mono_class_from_mono_type (t);
- sp->data.vt.klass = c;
- sp->data.vt.vt = ARG_POS (*ip);
-
- if (c->valuetype)
- sp->type = VAL_VALUETA;
- else
- sp->type = VAL_TP;
-
- ++sp;
- ++ip;
- BREAK;
- }
- CASE (CEE_STARG_S)
- ++ip;
- --sp;
- stackval_to_data (ARG_TYPE (signature, *ip), sp, ARG_POS (*ip));
- vt_free (sp);
- ++ip;
- BREAK;
- CASE (CEE_LDLOC_S)
- ++ip;
- vt_alloc (LOCAL_TYPE (header, *ip), sp);
- stackval_from_data (LOCAL_TYPE (header, *ip), sp, LOCAL_POS (*ip));
- ++ip;
- ++sp;
- BREAK;
- CASE (CEE_LDLOCA_S) {
- MonoType *t;
- MonoClass *c;
-
- ++ip;
- t = LOCAL_TYPE (header, *ip);
- c = mono_class_from_mono_type (t);
- sp->data.vt.klass = c;
- sp->data.p = LOCAL_POS (*ip);
-
- if (c->valuetype)
- sp->type = VAL_VALUETA;
- else
- sp->type = VAL_TP;
-
- ++sp;
- ++ip;
- BREAK;
+ ip += 4;
+ MINT_IN_BREAK;
}
- CASE (CEE_STLOC_S)
- ++ip;
- --sp;
- stackval_to_data (LOCAL_TYPE (header, *ip), sp, LOCAL_POS (*ip));
- vt_free (sp);
- ++ip;
- BREAK;
- CASE (CEE_LDNULL)
- ++ip;
- sp->type = VAL_OBJ;
- sp->data.p = NULL;
- sp->data.vt.klass = NULL;
- ++sp;
- BREAK;
- CASE (CEE_LDC_I4_M1)
- ++ip;
- sp->type = VAL_I32;
- sp->data.i = -1;
- ++sp;
- BREAK;
- CASE (CEE_LDC_I4_0)
- CASE (CEE_LDC_I4_1)
- CASE (CEE_LDC_I4_2)
- CASE (CEE_LDC_I4_3)
- CASE (CEE_LDC_I4_4)
- CASE (CEE_LDC_I4_5)
- CASE (CEE_LDC_I4_6)
- CASE (CEE_LDC_I4_7)
- CASE (CEE_LDC_I4_8)
- sp->type = VAL_I32;
- sp->data.i = (*ip) - CEE_LDC_I4_0;
+#define LDC(n) do { sp->data.i = (n); ++ip; ++sp; } while (0)
+ MINT_IN_CASE(MINT_LDC_I4_M1)
+ LDC(-1);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_0)
+ LDC(0);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_1)
+ LDC(1);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_2)
+ LDC(2);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_3)
+ LDC(3);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_4)
+ LDC(4);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_5)
+ LDC(5);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_6)
+ LDC(6);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_7)
+ LDC(7);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_8)
+ LDC(8);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4_S)
+ sp->data.i = *(const short *)(ip + 1);
+ ip += 2;
++sp;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I4)
++ip;
- BREAK;
- CASE (CEE_LDC_I4_S)
- ++ip;
- sp->type = VAL_I32;
- sp->data.i = *(const gint8 *)ip;
- ++ip;
+ sp->data.i = READ32 (ip);
+ ip += 2;
++sp;
- BREAK;
- CASE (CEE_LDC_I4)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_I8)
++ip;
- sp->type = VAL_I32;
- sp->data.i = read32 (ip);
+ sp->data.l = READ64 (ip);
ip += 4;
++sp;
- BREAK;
- CASE (CEE_LDC_I8)
- ++ip;
- sp->type = VAL_I64;
- sp->data.l = read64 (ip);
- ip += 8;
- ++sp;
- BREAK;
- CASE (CEE_LDC_R4) {
- float val;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDC_R4) {
+ guint32 val;
++ip;
- sp->type = VAL_DOUBLE;
- readr4 (ip, &val);
- sp->data.f = val;
- ip += 4;
+ val = READ32(ip);
+ sp->data.f = * (float *)&val;
+ ip += 2;
++sp;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_LDC_R8)
- ++ip;
- sp->type = VAL_DOUBLE;
- readr8(ip, &sp->data.f);
- ip += 8;
+ MINT_IN_CASE(MINT_LDC_R8)
+ sp->data.l = READ64 (ip + 1); /* note union usage */
+ ip += 5;
+ ++sp;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_DUP)
+ sp [0] = sp[-1];
++sp;
- BREAK;
- CASE (CEE_UNUSED99) ves_abort (); BREAK;
- CASE (CEE_DUP)
- if (sp [-1].type == VAL_VALUET) {
- MonoClass *c = sp [-1].data.vt.klass;
- vt_alloc (&c->byval_arg, sp);
- stackval_from_data (&c->byval_arg, sp, sp [-1].data.vt.vt);
- } else {
- *sp = sp [-1];
- }
- ++sp;
++ip;
- BREAK;
- CASE (CEE_POP)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_DUP_VT)
+ i32 = READ32 (ip + 1);
+ sp->data.p = vt_sp;
+ memcpy(sp->data.p, sp [-1].data.p, i32);
+ vt_sp += (i32 + 7) & ~7;
+ ++sp;
+ ip += 3;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_POP)
++ip;
--sp;
- vt_free (sp);
- BREAK;
- CASE (CEE_JMP) ves_abort(); BREAK;
- CASE (CEE_CALLVIRT) /* Fall through */
- CASE (CEE_CALLI) /* Fall through */
- CASE (CEE_CALL) {
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_JMP) {
+ RuntimeMethod *new_method = rtm->data_items [* (guint16 *)(ip + 1)];
+ if (!new_method->transformed) {
+ frame->ip = ip;
+ frame->ex = mono_interp_transform_method (new_method, context);
+ if (frame->ex)
+ goto exit_frame;
+ }
+ ip += 2;
+ if (new_method->alloca_size > rtm->alloca_size)
+ g_error ("MINT_JMP to method which needs more stack space (%d > %d)", new_method->alloca_size, rtm->alloca_size);
+ rtm = frame->runtime_method = new_method;
+ vt_sp = (char *)sp + rtm->stack_size;
+#if DEBUG_INTERP
+ vtalloc = vt_sp;
+#endif
+ locals = vt_sp + rtm->vt_stack_size;
+ ip = rtm->new_body_start; /* bypass storing input args from callers frame */
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_CALLI) {
MonoMethodSignature *csignature;
- stackval retval;
stackval *endsp = sp;
- guint32 token;
- int virtual = *ip == CEE_CALLVIRT;
- int calli = *ip == CEE_CALLI;
-
- /*
- * We ignore tail recursion for now.
- */
- tail_recursion = 0;
frame->ip = ip;
- ++ip;
- token = read32 (ip);
- ip += 4;
- if (calli) {
- MonoJitInfo *ji;
- unsigned char *code;
- --sp;
- code = sp->data.p;
- if ((ji = mono_jit_info_table_find (mono_root_domain, code))) {
- child_frame.method = ji->method;
- csignature = child_frame.method->signature;
- } else {
- /* fixme: native code ? */
- g_assert_not_reached ();
- }
- } else {
- child_frame.method = mono_get_method (image, token, NULL);
- if (!child_frame.method)
- THROW_EX (mono_get_exception_missing_method (), ip -5);
- csignature = child_frame.method->signature;
- if (virtual) {
- stackval *this_arg = &sp [-csignature->param_count-1];
- if (!this_arg->data.p)
- THROW_EX (mono_get_exception_null_reference(), ip - 5);
- child_frame.method = get_virtual_method (domain, child_frame.method, this_arg);
- if (!child_frame.method)
- THROW_EX (mono_get_exception_missing_method (), ip -5);
- }
- }
- g_assert (csignature->call_convention == MONO_CALL_DEFAULT);
+ csignature = rtm->data_items [* (guint16 *)(ip + 1)];
+ ip += 2;
+ --sp;
+ --endsp;
+ child_frame.runtime_method = sp->data.p;
+
+ sp->data.p = vt_sp;
+ child_frame.retval = sp;
/* decrement by the actual number of args */
- if (csignature->param_count) {
- sp -= csignature->param_count;
- child_frame.stack_args = sp;
- } else {
- child_frame.stack_args = NULL;
- }
+ sp -= csignature->param_count;
+ child_frame.stack_args = sp;
if (csignature->hasthis) {
- g_assert (sp >= frame->stack);
--sp;
- /*
- * It may also be a TP from LD(S)FLDA
- * g_assert (sp->type == VAL_OBJ || sp->type == VAL_VALUETA);
- */
- if (sp->type == VAL_OBJ && child_frame.method->klass->valuetype) /* unbox it */
- child_frame.obj = (char*)sp->data.p + sizeof (MonoObject);
- else
- child_frame.obj = sp->data.p;
+ child_frame.obj = sp->data.p;
} else {
child_frame.obj = NULL;
}
+ if (csignature->hasthis &&
+ ((MonoObject *)child_frame.obj)->vtable->klass == mono_defaults.transparent_proxy_class) {
+ child_frame.runtime_method = mono_interp_get_runtime_method (
+ mono_marshal_get_remoting_invoke (child_frame.runtime_method->method));
+ } else if (child_frame.runtime_method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ child_frame.runtime_method = mono_interp_get_runtime_method (
+ mono_marshal_get_native_wrapper (child_frame.runtime_method->method));
+
+ ves_exec_method_with_context (&child_frame, context);
+
+ context->current_frame = frame;
+
+ if (child_frame.ex) {
+ /*
+ * An exception occurred, need to run finally, fault and catch handlers..
+ */
+ frame->ex = child_frame.ex;
+ goto handle_finally;
+ }
+
+ /* need to handle typedbyref ... */
if (csignature->ret->type != MONO_TYPE_VOID) {
- vt_alloc (csignature->ret, &retval);
- child_frame.retval = &retval;
- } else {
- child_frame.retval = NULL;
+ *sp = *endsp;
+ sp++;
}
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_CALLI_NAT) {
+ MonoMethodSignature *csignature;
+ stackval *endsp = sp;
+ unsigned char *code = NULL;
- child_frame.ex = NULL;
- child_frame.ex_handler = NULL;
+ frame->ip = ip;
+
+ csignature = rtm->data_items [* (guint16 *)(ip + 1)];
+ ip += 2;
+ --sp;
+ --endsp;
+ code = sp->data.p;
+ child_frame.runtime_method = NULL;
- if (csignature->hasthis && sp->type == VAL_OBJ &&
- ((MonoObject *)sp->data.p)->vtable->klass == mono_defaults.transparent_proxy_class) {
- /* implement remoting */
- invoke_remoting_trampoline (&child_frame);
+ sp->data.p = vt_sp;
+ child_frame.retval = sp;
+ /* decrement by the actual number of args */
+ sp -= csignature->param_count;
+ child_frame.stack_args = sp;
+ if (csignature->hasthis) {
+ --sp;
+ child_frame.obj = sp->data.p;
} else {
- switch (GPOINTER_TO_UINT (child_frame.method->addr)) {
- case INLINE_STRING_LENGTH:
- retval.type = VAL_I32;
- retval.data.i = ((MonoString*)sp->data.p)->length;
- /*g_print ("length of '%s' is %d\n", mono_string_to_utf8 (sp->data.p), retval.data.i);*/
- break;
- case INLINE_ARRAY_LENGTH:
- retval.type = VAL_I32;
- retval.data.i = mono_array_length ((MonoArray*)sp->data.p);
- break;
- case INLINE_ARRAY_RANK:
- retval.type = VAL_I32;
- retval.data.i = mono_object_class (sp->data.p)->rank;
- break;
- case INLINE_TYPE_ELEMENT_TYPE:
- retval.type = VAL_OBJ;
- {
- MonoClass *c = mono_class_from_mono_type (((MonoReflectionType*)sp->data.p)->type);
- retval.data.vt.klass = NULL;
- if (c->enumtype && c->enum_basetype) /* types that are modifierd typebuilkders may not have enum_basetype set */
- retval.data.p = mono_type_get_object (domain, c->enum_basetype);
- else if (c->element_class)
- retval.data.p = mono_type_get_object (domain, &c->element_class->byval_arg);
- else
- retval.data.p = NULL;
- }
- break;
- default:
- ves_exec_method (&child_frame);
- }
+ child_frame.obj = NULL;
}
+ ves_pinvoke_method (&child_frame, csignature, (MonoFunc) code, FALSE, context);
- while (endsp > sp) {
- --endsp;
- vt_free (endsp);
- }
+ context->current_frame = frame;
if (child_frame.ex) {
/*
* An exception occurred, need to run finally, fault and catch handlers..
*/
frame->ex = child_frame.ex;
+ if (context->search_for_handler) {
+ context->search_for_handler = 0;
+ goto handle_exception;
+ }
goto handle_finally;
}
/* need to handle typedbyref ... */
if (csignature->ret->type != MONO_TYPE_VOID) {
- *sp = retval;
+ *sp = *endsp;
sp++;
}
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_RET)
- if (signature->ret->type != MONO_TYPE_VOID) {
- --sp;
- if (sp->type == VAL_VALUET) {
- /* the caller has already allocated the memory */
- stackval_from_data (signature->ret, frame->retval, sp->data.vt.vt);
- vt_free (sp);
- } else {
- *frame->retval = *sp;
- }
- }
- if (sp > frame->stack)
- g_warning ("more values on stack: %d", sp-frame->stack);
+ MINT_IN_CASE(MINT_CALL) {
+ stackval *endsp = sp;
- DEBUG_LEAVE ();
- return;
- CASE (CEE_BR_S) /* Fall through */
- CASE (CEE_BR)
- if (*ip == CEE_BR) {
- ++ip;
- ip += (gint32) read32(ip);
- ip += 4;
+ frame->ip = ip;
+
+ child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
+ ip += 2;
+ sp->data.p = vt_sp;
+ child_frame.retval = sp;
+ /* decrement by the actual number of args */
+ sp -= child_frame.runtime_method->param_count;
+ child_frame.stack_args = sp;
+ if (child_frame.runtime_method->hasthis) {
+ --sp;
+ child_frame.obj = sp->data.p;
} else {
- ++ip;
- ip += (signed char) *ip;
- ++ip;
- }
- BREAK;
- CASE (CEE_BRFALSE) /* Fall through */
- CASE (CEE_BRFALSE_S) {
- int result;
- int near_jump = *ip == CEE_BRFALSE_S;
- ++ip;
- --sp;
- switch (sp->type) {
- case VAL_I32: result = sp->data.i == 0; break;
- case VAL_I64: result = sp->data.l == 0; break;
- case VAL_DOUBLE: result = sp->data.f ? 0: 1; break;
- default: result = sp->data.p == NULL; break;
- }
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+ child_frame.obj = NULL;
}
- ip += near_jump ? 1: 4;
- BREAK;
- }
- CASE (CEE_BRTRUE) /* Fall through */
- CASE (CEE_BRTRUE_S) {
- int result;
- int near_jump = *ip == CEE_BRTRUE_S;
- ++ip;
- --sp;
- switch (sp->type) {
- case VAL_I32: result = sp->data.i != 0; break;
- case VAL_I64: result = sp->data.l != 0; break;
- case VAL_DOUBLE: result = sp->data.f ? 1 : 0; break;
- default: result = sp->data.p != NULL; break;
+ if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->valuetype &&
+ ((MonoObject *)child_frame.obj)->vtable->klass == mono_defaults.transparent_proxy_class) {
+ child_frame.runtime_method = mono_interp_get_runtime_method (
+ mono_marshal_get_remoting_invoke (child_frame.runtime_method->method));
}
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+ ves_exec_method_with_context (&child_frame, context);
+
+ context->current_frame = frame;
+
+ if (child_frame.ex) {
+ /*
+ * An exception occurred, need to run finally, fault and catch handlers..
+ */
+ frame->ex = child_frame.ex;
+ goto handle_finally;
}
- ip += near_jump ? 1: 4;
- BREAK;
+
+ /* need to handle typedbyref ... */
+ *sp = *endsp;
+ sp++;
+ MINT_IN_BREAK;
}
- CASE (CEE_BEQ) /* Fall through */
- CASE (CEE_BEQ_S) {
- int result;
- int near_jump = *ip == CEE_BEQ_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = sp [0].data.i == (gint)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = sp [0].data.l == sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = sp [0].data.f == sp [1].data.f;
- else
- result = (gint)GET_NATI (sp [0]) == (gint)GET_NATI (sp [1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+ MINT_IN_CASE(MINT_VCALL) {
+ frame->ip = ip;
+
+ child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
+ ip += 2;
+
+ sp->data.p = vt_sp;
+ child_frame.retval = sp;
+ /* decrement by the actual number of args */
+ sp -= child_frame.runtime_method->param_count;
+ child_frame.stack_args = sp;
+ if (child_frame.runtime_method->hasthis) {
+ --sp;
+ child_frame.obj = sp->data.p;
+ } else {
+ child_frame.obj = NULL;
}
- ip += near_jump ? 1: 4;
- BREAK;
- }
- CASE (CEE_BGE) /* Fall through */
- CASE (CEE_BGE_S) {
- int result;
- int near_jump = *ip == CEE_BGE_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = sp [0].data.i >= (gint)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = sp [0].data.l >= sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = sp [0].data.f >= sp [1].data.f;
- else
- result = (gint)GET_NATI (sp [0]) >= (gint)GET_NATI (sp [1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+
+ if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->valuetype &&
+ ((MonoObject *)child_frame.obj)->vtable->klass == mono_defaults.transparent_proxy_class) {
+ child_frame.runtime_method = mono_interp_get_runtime_method (
+ mono_marshal_get_remoting_invoke (child_frame.runtime_method->method));
}
- ip += near_jump ? 1: 4;
- BREAK;
- }
- CASE (CEE_BGT) /* Fall through */
- CASE (CEE_BGT_S) {
- int result;
- int near_jump = *ip == CEE_BGT_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = sp [0].data.i > (gint)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = sp [0].data.l > sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = sp [0].data.f > sp [1].data.f;
- else
- result = (gint)GET_NATI (sp [0]) > (gint)GET_NATI (sp [1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+
+ ves_exec_method_with_context (&child_frame, context);
+
+ context->current_frame = frame;
+
+ if (child_frame.ex) {
+ /*
+ * An exception occurred, need to run finally, fault and catch handlers..
+ */
+ frame->ex = child_frame.ex;
+ goto handle_finally;
}
- ip += near_jump ? 1: 4;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_BLT) /* Fall through */
- CASE (CEE_BLT_S) {
- int result;
- int near_jump = *ip == CEE_BLT_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = sp[0].data.i < (gint)GET_NATI(sp[1]);
- else if (sp->type == VAL_I64)
- result = sp[0].data.l < sp[1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = sp[0].data.f < sp[1].data.f;
- else
- result = (gint)GET_NATI(sp[0]) < (gint)GET_NATI(sp[1]);
- if (result) {
- if (near_jump)
- ip += 1 + (signed char)*ip;
- else
- ip += 4 + (gint32) read32 (ip);
- BREAK;
- } else {
- ip += near_jump ? 1: 4;
- BREAK;
+ MINT_IN_CASE(MINT_CALLVIRT) {
+ stackval *endsp = sp;
+ MonoObject *this_arg;
+ guint32 token;
+
+ frame->ip = ip;
+
+ token = * (unsigned short *)(ip + 1);
+ ip += 2;
+ child_frame.runtime_method = rtm->data_items [token];
+ sp->data.p = vt_sp;
+ child_frame.retval = sp;
+
+ /* decrement by the actual number of args */
+ sp -= child_frame.runtime_method->param_count;
+ child_frame.stack_args = sp;
+ --sp;
+ child_frame.obj = this_arg = sp->data.p;
+ if (!this_arg)
+ THROW_EX (mono_get_exception_null_reference(), ip - 2);
+ child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
+
+ if (this_arg->vtable->klass->valuetype && child_frame.runtime_method->valuetype) {
+ child_frame.obj = (char *)this_arg + sizeof(MonoObject);
}
- }
- CASE (CEE_BLE) /* fall through */
- CASE (CEE_BLE_S) {
- int result;
- int near_jump = *ip == CEE_BLE_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = sp [0].data.i <= (gint)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = sp [0].data.l <= sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = sp [0].data.f <= sp [1].data.f;
- else {
+ ves_exec_method_with_context (&child_frame, context);
+
+ context->current_frame = frame;
+
+ if (child_frame.ex) {
/*
- * FIXME: here and in other places GET_NATI on the left side
- * _will_ be wrong when we change the macro to work on 64 bits
- * systems.
+ * An exception occurred, need to run finally, fault and catch handlers..
*/
- result = (gint)GET_NATI (sp [0]) <= (gint)GET_NATI (sp [1]);
- }
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
- }
- ip += near_jump ? 1: 4;
- BREAK;
- }
- CASE (CEE_BNE_UN) /* Fall through */
- CASE (CEE_BNE_UN_S) {
- int result;
- int near_jump = *ip == CEE_BNE_UN_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = (guint32)sp [0].data.i != (guint32)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = (guint64)sp [0].data.l != (guint64)sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = isunordered (sp [0].data.f, sp [1].data.f) ||
- (sp [0].data.f != sp [1].data.f);
- else
- result = GET_NATI (sp [0]) != GET_NATI (sp [1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+ frame->ex = child_frame.ex;
+ if (context->search_for_handler) {
+ context->search_for_handler = 0;
+ goto handle_exception;
+ }
+ goto handle_finally;
}
- ip += near_jump ? 1: 4;
- BREAK;
+
+ /* need to handle typedbyref ... */
+ *sp = *endsp;
+ sp++;
+ MINT_IN_BREAK;
}
- CASE (CEE_BGE_UN) /* Fall through */
- CASE (CEE_BGE_UN_S) {
- int result;
- int near_jump = *ip == CEE_BGE_UN_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = (guint32)sp [0].data.i >= (guint32)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = (guint64)sp [0].data.l >= (guint64)sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = !isless (sp [0].data.f,sp [1].data.f);
- else
- result = GET_NATI (sp [0]) >= GET_NATI (sp [1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+ MINT_IN_CASE(MINT_VCALLVIRT) {
+ MonoObject *this_arg;
+ guint32 token;
+
+ frame->ip = ip;
+
+ token = * (unsigned short *)(ip + 1);
+ ip += 2;
+ child_frame.runtime_method = rtm->data_items [token];
+ sp->data.p = vt_sp;
+ child_frame.retval = sp;
+
+ /* decrement by the actual number of args */
+ sp -= child_frame.runtime_method->param_count;
+ child_frame.stack_args = sp;
+ --sp;
+ child_frame.obj = this_arg = sp->data.p;
+ if (!this_arg)
+ THROW_EX (mono_get_exception_null_reference(), ip - 2);
+ child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
+
+ if (this_arg->vtable->klass->valuetype && child_frame.runtime_method->valuetype) {
+ child_frame.obj = (char *)this_arg + sizeof(MonoObject);
}
- ip += near_jump ? 1: 4;
- BREAK;
- }
- CASE (CEE_BGT_UN) /* Fall through */
- CASE (CEE_BGT_UN_S) {
- int result;
- int near_jump = *ip == CEE_BGT_UN_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = (guint32)sp [0].data.i > (guint32)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = (guint64)sp [0].data.l > (guint64)sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = isgreater (sp [0].data.f, sp [1].data.f);
- else
- result = GET_NATI (sp [0]) > GET_NATI (sp [1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+
+ ves_exec_method_with_context (&child_frame, context);
+
+ context->current_frame = frame;
+
+ if (child_frame.ex) {
+ /*
+ * An exception occurred, need to run finally, fault and catch handlers..
+ */
+ frame->ex = child_frame.ex;
+ if (context->search_for_handler) {
+ context->search_for_handler = 0;
+ goto handle_exception;
+ }
+ goto handle_finally;
}
- ip += near_jump ? 1: 4;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_BLE_UN) /* Fall through */
- CASE (CEE_BLE_UN_S) {
- int result;
- int near_jump = *ip == CEE_BLE_UN_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = (guint32)sp [0].data.i <= (guint32)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = (guint64)sp [0].data.l <= (guint64)sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = islessequal (sp [0].data.f, sp [1].data.f);
- else
- result = GET_NATI (sp [0]) <= GET_NATI (sp [1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+ MINT_IN_CASE(MINT_CALLINT)
+ ves_pinvoke_method (frame, frame->runtime_method->method->signature, ((MonoMethodPInvoke*) frame->runtime_method->method)->addr,
+ frame->runtime_method->method->string_ctor, context);
+ if (frame->ex) {
+ rtm = NULL;
+ goto handle_exception;
}
- ip += near_jump ? 1: 4;
- BREAK;
- }
- CASE (CEE_BLT_UN) /* Fall through */
- CASE (CEE_BLT_UN_S) {
- int result;
- int near_jump = *ip == CEE_BLT_UN_S;
- ++ip;
- sp -= 2;
- if (sp->type == VAL_I32)
- result = (guint32)sp[0].data.i < (guint32)GET_NATI(sp[1]);
- else if (sp->type == VAL_I64)
- result = (guint64)sp[0].data.l < (guint64)sp[1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = isunordered (sp [0].data.f, sp [1].data.f) ||
- (sp [0].data.f < sp [1].data.f);
- else
- result = GET_NATI(sp[0]) < GET_NATI(sp[1]);
- if (result) {
- if (near_jump)
- ip += (signed char)*ip;
- else
- ip += (gint32) read32 (ip);
+ goto exit_frame;
+ MINT_IN_CASE(MINT_CALLRUN)
+ ves_runtime_method (frame, context);
+ if (frame->ex) {
+ rtm = NULL;
+ goto handle_exception;
}
- ip += near_jump ? 1: 4;
- BREAK;
- }
- CASE (CEE_SWITCH) {
+ goto exit_frame;
+ MINT_IN_CASE(MINT_RET)
+ --sp;
+ *frame->retval = *sp;
+ if (sp > frame->stack)
+ g_warning ("ret: more values on stack: %d", sp-frame->stack);
+ goto exit_frame;
+ MINT_IN_CASE(MINT_RET_VOID)
+ if (sp > frame->stack)
+ g_warning ("ret.void: more values on stack: %d", sp-frame->stack);
+ goto exit_frame;
+ MINT_IN_CASE(MINT_RET_VT)
+ i32 = READ32(ip + 1);
+ --sp;
+ memcpy(frame->retval->data.p, sp->data.p, i32);
+ if (sp > frame->stack)
+ g_warning ("ret.vt: more values on stack: %d", sp-frame->stack);
+ goto exit_frame;
+ MINT_IN_CASE(MINT_BR_S)
+ ip += (short) *(ip + 1);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BR)
+ ip += (gint32) READ32(ip + 1);
+ MINT_IN_BREAK;
+#define ZEROP_S(datamem, op) \
+ --sp; \
+ if (sp->data.datamem op 0) \
+ ip += * (gint16 *)(ip + 1); \
+ else \
+ ip += 2;
+
+#define ZEROP(datamem, op) \
+ --sp; \
+ if (sp->data.datamem op 0) \
+ ip += READ32(ip + 1); \
+ else \
+ ip += 3;
+
+ MINT_IN_CASE(MINT_BRFALSE_I4_S)
+ ZEROP_S(i, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRFALSE_I8_S)
+ ZEROP_S(l, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRFALSE_R8_S)
+ ZEROP_S(f, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRFALSE_I4)
+ ZEROP(i, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRFALSE_I8)
+ ZEROP(l, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRFALSE_R8)
+ ZEROP_S(f, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRTRUE_I4_S)
+ ZEROP_S(i, !=);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRTRUE_I8_S)
+ ZEROP_S(l, !=);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRTRUE_R8_S)
+ ZEROP_S(f, !=);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRTRUE_I4)
+ ZEROP(i, !=);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRTRUE_I8)
+ ZEROP(l, !=);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BRTRUE_R8)
+ ZEROP(f, !=);
+ MINT_IN_BREAK;
+#define CONDBR_S(cond) \
+ sp -= 2; \
+ if (cond) \
+ ip += * (gint16 *)(ip + 1); \
+ else \
+ ip += 2;
+#define BRELOP_S(datamem, op) \
+ CONDBR_S(sp[0].data.datamem op sp[1].data.datamem)
+
+#define CONDBR(cond) \
+ sp -= 2; \
+ if (cond) \
+ ip += READ32(ip + 1); \
+ else \
+ ip += 3;
+
+#define BRELOP(datamem, op) \
+ CONDBR(sp[0].data.datamem op sp[1].data.datamem)
+
+ MINT_IN_CASE(MINT_BEQ_I4_S)
+ BRELOP_S(i, ==)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BEQ_I8_S)
+ BRELOP_S(l, ==)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BEQ_R8_S)
+ CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f == sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BEQ_I4)
+ BRELOP(i, ==)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BEQ_I8)
+ BRELOP(l, ==)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BEQ_R8)
+ CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f == sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_I4_S)
+ BRELOP_S(i, >=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_I8_S)
+ BRELOP_S(l, >=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_R8_S)
+ CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f >= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_I4)
+ BRELOP(i, >=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_I8)
+ BRELOP(l, >=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_R8)
+ CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f >= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_I4_S)
+ BRELOP_S(i, >)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_I8_S)
+ BRELOP_S(l, >)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_R8_S)
+ CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f > sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_I4)
+ BRELOP(i, >)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_I8)
+ BRELOP(l, >)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_R8)
+ CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f > sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_I4_S)
+ BRELOP_S(i, <)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_I8_S)
+ BRELOP_S(l, <)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_R8_S)
+ CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f < sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_I4)
+ BRELOP(i, <)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_I8)
+ BRELOP(l, <)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_R8)
+ CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f < sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_I4_S)
+ BRELOP_S(i, <=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_I8_S)
+ BRELOP_S(l, <=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_R8_S)
+ CONDBR_S(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f <= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_I4)
+ BRELOP(i, <=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_I8)
+ BRELOP(l, <=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_R8)
+ CONDBR(!isunordered (sp [0].data.f, sp [1].data.f) && sp[0].data.f <= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BNE_UN_I4_S)
+ BRELOP_S(i, !=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BNE_UN_I8_S)
+ BRELOP_S(l, !=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BNE_UN_R8_S)
+ CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f != sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BNE_UN_I4)
+ BRELOP(i, !=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BNE_UN_I8)
+ BRELOP(l, !=)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BNE_UN_R8)
+ CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f != sp[1].data.f)
+ MINT_IN_BREAK;
+
+#define BRELOP_S_CAST(datamem, op, type) \
+ sp -= 2; \
+ if ((type) sp[0].data.datamem op (type) sp[1].data.datamem) \
+ ip += * (gint16 *)(ip + 1); \
+ else \
+ ip += 2;
+
+#define BRELOP_CAST(datamem, op, type) \
+ sp -= 2; \
+ if ((type) sp[0].data.datamem op (type) sp[1].data.datamem) \
+ ip += READ32(ip + 1); \
+ else \
+ ip += 3;
+
+ MINT_IN_CASE(MINT_BGE_UN_I4_S)
+ BRELOP_S_CAST(i, >=, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_UN_I8_S)
+ BRELOP_S_CAST(l, >=, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_UN_R8_S)
+ CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f >= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_UN_I4)
+ BRELOP_CAST(i, >=, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_UN_I8)
+ BRELOP_CAST(l, >=, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGE_UN_R8)
+ CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f >= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_UN_I4_S)
+ BRELOP_S_CAST(i, >, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_UN_I8_S)
+ BRELOP_S_CAST(l, >, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_UN_R8_S)
+ CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f > sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_UN_I4)
+ BRELOP_CAST(i, >, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_UN_I8)
+ BRELOP_CAST(l, >, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BGT_UN_R8)
+ CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f > sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_UN_I4_S)
+ BRELOP_S_CAST(i, <=, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_UN_I8_S)
+ BRELOP_S_CAST(l, <=, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_UN_R8_S)
+ CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f <= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_UN_I4)
+ BRELOP_CAST(i, <=, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_UN_I8)
+ BRELOP_CAST(l, <=, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLE_UN_R8)
+ CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f <= sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_UN_I4_S)
+ BRELOP_S_CAST(i, <, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_UN_I8_S)
+ BRELOP_S_CAST(l, <, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_UN_R8_S)
+ CONDBR_S(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f < sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_UN_I4)
+ BRELOP_CAST(i, <, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_UN_I8)
+ BRELOP_CAST(l, <, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BLT_UN_R8)
+ CONDBR(isunordered (sp [0].data.f, sp [1].data.f) || sp[0].data.f < sp[1].data.f)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SWITCH) {
guint32 n;
- const unsigned char *st;
+ const unsigned short *st;
++ip;
- n = read32 (ip);
- ip += 4;
- st = ip + sizeof (gint32) * n;
+ n = READ32 (ip);
+ ip += 2;
+ st = ip + 2 * n;
--sp;
if ((guint32)sp->data.i < n) {
gint offset;
- ip += sizeof (gint32) * (guint32)sp->data.i;
- offset = read32 (ip);
+ ip += 2 * (guint32)sp->data.i;
+ offset = READ32 (ip);
ip = st + offset;
} else {
ip = st;
}
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_LDIND_I1)
+ MINT_IN_CASE(MINT_LDIND_I1)
++ip;
- sp[-1].type = VAL_I32;
sp[-1].data.i = *(gint8*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_U1)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_U1)
++ip;
- sp[-1].type = VAL_I32;
sp[-1].data.i = *(guint8*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_I2)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_I2)
++ip;
- sp[-1].type = VAL_I32;
sp[-1].data.i = *(gint16*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_U2)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_U2)
++ip;
- sp[-1].type = VAL_I32;
sp[-1].data.i = *(guint16*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_I4) /* Fall through */
- CASE (CEE_LDIND_U4)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_I4) /* Fall through */
+ MINT_IN_CASE(MINT_LDIND_U4)
++ip;
- sp[-1].type = VAL_I32;
sp[-1].data.i = *(gint32*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_I8)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_I8)
++ip;
- sp[-1].type = VAL_I64;
sp[-1].data.l = *(gint64*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_I)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_I)
++ip;
- sp[-1].type = VAL_NATI;
sp[-1].data.p = *(gpointer*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_R4)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_R4)
++ip;
- sp[-1].type = VAL_DOUBLE;
sp[-1].data.f = *(gfloat*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_R8)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_R8)
++ip;
- sp[-1].type = VAL_DOUBLE;
sp[-1].data.f = *(gdouble*)sp[-1].data.p;
- BREAK;
- CASE (CEE_LDIND_REF)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDIND_REF)
++ip;
- sp[-1].type = VAL_OBJ;
sp[-1].data.p = *(gpointer*)sp[-1].data.p;
- sp[-1].data.vt.klass = NULL;
- BREAK;
- CASE (CEE_STIND_REF) {
- gpointer *p;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_REF)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = sp[1].data.p;
- BREAK;
- }
- CASE (CEE_STIND_I1) {
- gint8 *p;
+ * (gpointer *) sp->data.p = sp[1].data.p;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_I1)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = (gint8)sp[1].data.i;
- BREAK;
- }
- CASE (CEE_STIND_I2) {
- gint16 *p;
+ * (gint8 *) sp->data.p = (gint8)sp[1].data.i;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_I2)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = (gint16)sp[1].data.i;
- BREAK;
- }
- CASE (CEE_STIND_I4) {
- gint32 *p;
+ * (gint16 *) sp->data.p = (gint16)sp[1].data.i;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_I4)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = sp[1].data.i;
- BREAK;
- }
- CASE (CEE_STIND_I) {
- mono_i *p;
+ * (gint32 *) sp->data.p = sp[1].data.i;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_I)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = (mono_i)sp[1].data.p;
- BREAK;
- }
- CASE (CEE_STIND_I8) {
- gint64 *p;
+ * (mono_i *) sp->data.p = (mono_i)sp[1].data.p;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_I8)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = sp[1].data.l;
- BREAK;
- }
- CASE (CEE_STIND_R4) {
- float *p;
+ * (gint64 *) sp->data.p = sp[1].data.l;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_R4)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = (gfloat)sp[1].data.f;
- BREAK;
- }
- CASE (CEE_STIND_R8) {
- double *p;
+ * (float *) sp->data.p = (gfloat)sp[1].data.f;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STIND_R8)
++ip;
sp -= 2;
- p = sp->data.p;
- *p = sp[1].data.f;
- BREAK;
- }
- CASE (CEE_ADD)
+ * (double *) sp->data.p = sp[1].data.f;
+ MINT_IN_BREAK;
+#define BINOP(datamem, op) \
+ --sp; \
+ sp [-1].data.datamem = sp [-1].data.datamem op sp [0].data.datamem; \
+ ++ip;
+ MINT_IN_CASE(MINT_ADD_I4)
+ BINOP(i, +);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ADD_I8)
+ BINOP(l, +);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ADD_R8)
+ BINOP(f, +);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ADD1_I4)
+ ++sp [-1].data.i;
++ip;
- --sp;
- /* should probably consider the pointers as unsigned */
- if (sp->type == VAL_I32)
- sp [-1].data.i += GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l += sp [0].data.l;
- else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f += sp [0].data.f;
- else {
- char *p = sp [-1].data.p;
- p += GET_NATI (sp [0]);
- sp [-1].data.p = p;
- }
- BREAK;
- CASE (CEE_SUB)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB_I4)
+ BINOP(i, -);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB_I8)
+ BINOP(l, -);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB_R8)
+ BINOP(f, -);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB1_I4)
+ --sp [-1].data.i;
++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MUL_I4)
+ BINOP(i, *);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MUL_I8)
+ BINOP(l, *);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MUL_R8)
+ BINOP(f, *);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_DIV_I4)
+ if (sp [-1].data.i == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP(i, /);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_DIV_I8)
+ if (sp [-1].data.l == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP(l, /);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_DIV_R8)
+ BINOP(f, /);
+ MINT_IN_BREAK;
+
+#define BINOP_CAST(datamem, op, type) \
+ --sp; \
+ sp [-1].data.datamem = (type)sp [-1].data.datamem op (type)sp [0].data.datamem; \
+ ++ip;
+ MINT_IN_CASE(MINT_DIV_UN_I4)
+ if (sp [-1].data.i == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP_CAST(i, /, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_DIV_UN_I8)
+ if (sp [-1].data.l == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP_CAST(l, /, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_REM_I4)
+ if (sp [-1].data.i == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP(i, %);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_REM_I8)
+ if (sp [-1].data.l == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP(l, %);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_REM_R8)
+ /* FIXME: what do we actually do here? */
--sp;
- /* should probably consider the pointers as unsigned */
- if (sp->type == VAL_I32)
- sp [-1].data.i -= GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l -= sp [0].data.l;
- else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f -= sp [0].data.f;
- else {
- char *p = sp [-1].data.p;
- p -= GET_NATI (sp [0]);
- sp [-1].data.p = p;
- }
- BREAK;
- CASE (CEE_MUL)
+ sp [-1].data.f = fmod (sp [-1].data.f, sp [0].data.f);
++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_REM_UN_I4)
+ if (sp [-1].data.i == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP_CAST(i, %, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_REM_UN_I8)
+ if (sp [-1].data.l == 0)
+ THROW_EX (mono_get_exception_divide_by_zero (), ip);
+ BINOP_CAST(l, %, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_AND_I4)
+ BINOP(i, &);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_AND_I8)
+ BINOP(l, &);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_OR_I4)
+ BINOP(i, |);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_OR_I8)
+ BINOP(l, |);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_XOR_I4)
+ BINOP(i, ^);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_XOR_I8)
+ BINOP(l, ^);
+ MINT_IN_BREAK;
+
+#define SHIFTOP(datamem, op) \
+ --sp; \
+ sp [-1].data.datamem = sp [-1].data.datamem op sp [0].data.i; \
+ ++ip;
+
+ MINT_IN_CASE(MINT_SHL_I4)
+ SHIFTOP(i, <<);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SHL_I8)
+ SHIFTOP(l, <<);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SHR_I4)
+ SHIFTOP(i, >>);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SHR_I8)
+ SHIFTOP(l, >>);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SHR_UN_I4)
--sp;
- if (sp->type == VAL_I32)
- sp [-1].data.i *= (gint)GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l *= sp [0].data.l;
- else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f *= sp [0].data.f;
- BREAK;
- CASE (CEE_DIV)
+ sp [-1].data.i = (guint32)sp [-1].data.i >> sp [0].data.i;
++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SHR_UN_I8)
--sp;
- if (sp->type == VAL_I32) {
- if (GET_NATI (sp [0]) == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- sp [-1].data.i /= (gint)GET_NATI (sp [0]);
- } else if (sp->type == VAL_I64) {
- if (sp [0].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- sp [-1].data.l /= sp [0].data.l;
- } else if (sp->type == VAL_DOUBLE) {
- /* set NaN is divisor is 0.0 */
- sp [-1].data.f /= sp [0].data.f;
- }
- BREAK;
- CASE (CEE_DIV_UN)
+ sp [-1].data.l = (guint64)sp [-1].data.l >> sp [0].data.i;
++ip;
- --sp;
- if (sp->type == VAL_I32) {
- guint32 val;
- if (GET_NATI (sp [0]) == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- val = sp [-1].data.i;
- val /= (guint32)GET_NATI (sp [0]);
- sp [-1].data.i = val;
- } else if (sp->type == VAL_I64) {
- guint64 val;
- if (sp [0].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- val = sp [-1].data.l;
- val /= (guint64)sp [0].data.l;
- sp [-1].data.l = val;
- } else if (sp->type == VAL_NATI) {
- mono_u val;
- if (GET_NATI (sp [0]) == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- val = (mono_u)sp [-1].data.p;
- val /= (mono_u)sp [0].data.p;
- sp [-1].data.p = (gpointer)val;
- }
- BREAK;
- CASE (CEE_REM)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NEG_I4)
+ sp [-1].data.i = - sp [-1].data.i;
++ip;
- --sp;
- if (sp->type == VAL_I32) {
- if (GET_NATI (sp [0]) == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- sp [-1].data.i %= (gint)GET_NATI (sp [0]);
- } else if (sp->type == VAL_I64) {
- if (sp [0].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- sp [-1].data.l %= sp [0].data.l;
- } else if (sp->type == VAL_DOUBLE) {
- /* FIXME: what do we actually do here? */
- sp [-1].data.f = fmod (sp [-1].data.f, sp [0].data.f);
- } else {
- if (GET_NATI (sp [0]) == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- (gint)GET_NATI (sp [-1]) %= (gint)GET_NATI (sp [0]);
- }
- BREAK;
- CASE (CEE_REM_UN)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NEG_I8)
+ sp [-1].data.l = - sp [-1].data.l;
++ip;
- --sp;
- if (sp->type == VAL_I32) {
- if (GET_NATI (sp [0]) == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- (guint)sp [-1].data.i %= (guint)GET_NATI (sp [0]);
- } else if (sp->type == VAL_I64) {
- if (sp [0].data.l == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- (guint64)sp [-1].data.l %= (guint64)sp [0].data.l;
- } else if (sp->type == VAL_DOUBLE) {
- /* unspecified behaviour according to the spec */
- } else {
- if (GET_NATI (sp [0]) == 0)
- THROW_EX (mono_get_exception_divide_by_zero (), ip - 1);
- (guint64)GET_NATI (sp [-1]) %= (guint64)GET_NATI (sp [0]);
- }
- BREAK;
- CASE (CEE_AND)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NEG_R8)
+ sp [-1].data.f = - sp [-1].data.f;
++ip;
- --sp;
- if (sp->type == VAL_I32)
- sp [-1].data.i &= GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l &= sp [0].data.l;
- else
- GET_NATI (sp [-1]) &= GET_NATI (sp [0]);
- BREAK;
- CASE (CEE_OR)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NOT_I4)
+ sp [-1].data.i = ~ sp [-1].data.i;
++ip;
- --sp;
- if (sp->type == VAL_I32)
- sp [-1].data.i |= GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l |= sp [0].data.l;
- else
- GET_NATI (sp [-1]) |= GET_NATI (sp [0]);
- BREAK;
- CASE (CEE_XOR)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NOT_I8)
+ sp [-1].data.l = ~ sp [-1].data.l;
++ip;
- --sp;
- if (sp->type == VAL_I32)
- sp [-1].data.i ^= GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l ^= sp [0].data.l;
- else
- GET_NATI (sp [-1]) ^= GET_NATI (sp [0]);
- BREAK;
- CASE (CEE_SHL)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I1_I4)
+ sp [-1].data.i = (gint8)sp [-1].data.i;
++ip;
- --sp;
- if (sp [-1].type == VAL_I32)
- sp [-1].data.i <<= GET_NATI (sp [0]);
- else if (sp [-1].type == VAL_I64)
- sp [-1].data.l <<= GET_NATI (sp [0]);
- else
- GET_NATI (sp [-1]) <<= GET_NATI (sp [0]);
- BREAK;
- CASE (CEE_SHR)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I1_I8)
+ sp [-1].data.i = (gint8)sp [-1].data.l;
++ip;
- --sp;
- if (sp [-1].type == VAL_I32)
- sp [-1].data.i >>= GET_NATI (sp [0]);
- else if (sp [-1].type == VAL_I64)
- sp [-1].data.l >>= GET_NATI (sp [0]);
- else
- (gint)GET_NATI (sp [-1]) >>= GET_NATI (sp [0]);
- BREAK;
- CASE (CEE_SHR_UN)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I1_R8)
+ sp [-1].data.i = (gint8)sp [-1].data.f;
++ip;
- --sp;
- if (sp [-1].type == VAL_I32)
- (guint)sp [-1].data.i >>= GET_NATI (sp [0]);
- else if (sp [-1].type == VAL_I64)
- (guint64)sp [-1].data.l >>= GET_NATI (sp [0]);
- else
- (guint64)GET_NATI (sp [-1]) >>= GET_NATI (sp [0]);
- BREAK;
- CASE (CEE_NEG)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U1_I4)
+ sp [-1].data.i = (guint8)sp [-1].data.i;
++ip;
- --sp;
- if (sp->type == VAL_I32)
- sp->data.i = - sp->data.i;
- else if (sp->type == VAL_I64)
- sp->data.l = - sp->data.l;
- else if (sp->type == VAL_DOUBLE)
- sp->data.f = - sp->data.f;
- else if (sp->type == VAL_NATI)
- sp->data.p = (gpointer)(- (mono_i)sp->data.p);
- ++sp;
- BREAK;
- CASE (CEE_NOT)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U1_I8)
+ sp [-1].data.i = (guint8)sp [-1].data.l;
++ip;
- --sp;
- if (sp->type == VAL_I32)
- sp->data.i = ~ sp->data.i;
- else if (sp->type == VAL_I64)
- sp->data.l = ~ sp->data.l;
- else if (sp->type == VAL_NATI)
- sp->data.p = (gpointer)(~ (mono_i)sp->data.p);
- ++sp;
- BREAK;
- CASE (CEE_CONV_U1) /* fall through */
- CASE (CEE_CONV_I1) {
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U1_R8)
+ sp [-1].data.i = (guint8)sp [-1].data.f;
++ip;
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- sp [-1].data.i = (gint8)sp [-1].data.f;
- break;
- case VAL_I64:
- sp [-1].data.i = (gint8)sp [-1].data.l;
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- sp [-1].data.i = (gint8)sp [-1].data.i;
- break;
- default:
- sp [-1].data.i = (gint8)sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_I32;
- BREAK;
- }
- CASE (CEE_CONV_U2) /* fall through */
- CASE (CEE_CONV_I2) {
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I2_I4)
+ sp [-1].data.i = (gint16)sp [-1].data.i;
++ip;
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- sp [-1].data.i = (gint16)sp [-1].data.f;
- break;
- case VAL_I64:
- sp [-1].data.i = (gint16)sp [-1].data.l;
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- sp [-1].data.i = (gint16)sp [-1].data.i;
- break;
- default:
- sp [-1].data.i = (gint16)sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_I32;
- BREAK;
- }
- CASE (CEE_CONV_U4) /* Fall through */
-#if SIZEOF_VOID_P == 4
- CASE (CEE_CONV_I) /* Fall through */
- CASE (CEE_CONV_U) /* Fall through */
-#endif
- CASE (CEE_CONV_I4) {
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I2_I8)
+ sp [-1].data.i = (gint16)sp [-1].data.l;
++ip;
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- sp [-1].data.i = (gint32)sp [-1].data.f;
- break;
- case VAL_I64:
- sp [-1].data.i = (gint32)sp [-1].data.l;
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- break;
- default:
- sp [-1].data.i = (gint32)sp [-1].data.p;
- break;
- }
- sp [-1].type = VAL_I32;
- BREAK;
- }
-#if SIZEOF_VOID_P == 8
- CASE (CEE_CONV_I) /* Fall through */
-#endif
- CASE (CEE_CONV_I8)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I2_R8)
+ sp [-1].data.i = (gint16)sp [-1].data.f;
++ip;
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- sp [-1].data.l = (gint64)sp [-1].data.f;
- break;
- case VAL_I64:
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- sp [-1].data.l = (gint64)sp [-1].data.i;
- break;
- default:
- sp [-1].data.l = (gint64)sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_I64;
- BREAK;
- CASE (CEE_CONV_R4) /* Fall through */
- CASE (CEE_CONV_R8) {
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U2_I4)
+ sp [-1].data.i = (guint16)sp [-1].data.i;
++ip;
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- sp [-1].data.f = (double)sp [-1].data.f;
- break;
- case VAL_I64:
- sp [-1].data.f = (double)sp [-1].data.l;
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- sp [-1].data.f = (double)sp [-1].data.i;
- break;
- default:
- sp [-1].data.f = (double)sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_DOUBLE;
- BREAK;
- }
-#if SIZEOF_VOID_P == 8
- CASE (CEE_CONV_U) /* Fall through */
-#endif
- CASE (CEE_CONV_U8)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U2_I8)
+ sp [-1].data.i = (guint16)sp [-1].data.l;
++ip;
-
- switch (sp [-1].type){
- case VAL_DOUBLE:
- sp [-1].data.l = (guint64)sp [-1].data.f;
- break;
- case VAL_I64:
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- sp [-1].data.l = sp [-1].data.i & 0xffffffff;
- break;
- default:
- sp [-1].data.l = (guint64) sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_I64;
- BREAK;
- CASE (CEE_CPOBJ) {
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U2_R8)
+ sp [-1].data.i = (guint16)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I4_R8)
+ sp [-1].data.i = (gint32)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U4_I8)
+ MINT_IN_CASE(MINT_CONV_I4_I8)
+ sp [-1].data.i = (gint32)sp [-1].data.l;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I4_I8_SP)
+ sp [-2].data.i = (gint32)sp [-2].data.l;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U4_R8)
+ sp [-1].data.i = (guint32)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I8_I4)
+ sp [-1].data.l = sp [-1].data.i;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I8_I4_SP)
+ sp [-2].data.l = sp [-2].data.i;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I8_U4)
+ sp [-1].data.l = (guint32)sp [-1].data.i;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_I8_R8)
+ sp [-1].data.l = (gint64)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_R4_I4)
+ sp [-1].data.f = (float)sp [-1].data.i;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_R4_I8)
+ sp [-1].data.f = (float)sp [-1].data.l;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_R4_R8)
+ sp [-1].data.f = (float)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_R8_I4)
+ sp [-1].data.f = (double)sp [-1].data.i;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_R8_I8)
+ sp [-1].data.f = (double)sp [-1].data.l;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U8_I4)
+ sp [-1].data.l = sp [-1].data.i & 0xffffffff;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_U8_R8)
+ sp [-1].data.l = (guint64)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+#if 0
+ MINT_IN_CASE(MINT_CPOBJ) {
MonoClass *vtklass;
++ip;
- vtklass = mono_class_get (image, read32 (ip));
- ip += 4;
+ vtklass = rtm->data_items[READ32 (ip)];
+ ip += 2;
sp -= 2;
memcpy (sp [0].data.p, sp [1].data.p, mono_class_value_size (vtklass, NULL));
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_LDOBJ) {
- guint32 token;
- MonoClass *c;
- char *addr;
-
- ++ip;
- token = read32 (ip);
- ip += 4;
- c = mono_class_get (image, token);
- addr = sp [-1].data.vt.vt;
- vt_alloc (&c->byval_arg, &sp [-1]);
- stackval_from_data (&c->byval_arg, &sp [-1], addr);
- BREAK;
+#endif
+ MINT_IN_CASE(MINT_LDOBJ) {
+ int size;
+ void *p;
+ c = rtm->data_items[* (guint16 *)(ip + 1)];
+ ip += 2;
+ if (c->byval_arg.type != MONO_TYPE_VALUETYPE || c->byval_arg.data.klass->enumtype) {
+ p = sp [-1].data.p;
+ stackval_from_data (&c->byval_arg, &sp [-1], p, FALSE);
+ } else {
+ size = mono_class_value_size (c, NULL);
+ p = sp [-1].data.p;
+ sp [-1].data.p = vt_sp;
+ memcpy(vt_sp, p, size);
+ vt_sp += (size + 7) & ~7;
+ }
+ MINT_IN_BREAK;
}
- CASE (CEE_LDSTR) {
- MonoObject *o;
- guint32 str_index;
-
- ip++;
- str_index = mono_metadata_token_index (read32 (ip));
- ip += 4;
-
- o = (MonoObject*)mono_ldstr (domain, image, str_index);
- sp->type = VAL_OBJ;
- sp->data.p = o;
- sp->data.vt.klass = NULL;
-
+ MINT_IN_CASE(MINT_LDSTR)
+ sp->data.p = rtm->data_items [* (guint16 *)(ip + 1)];
++sp;
- BREAK;
- }
- CASE (CEE_NEWOBJ) {
- MonoObject *o;
+ ip += 2;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NEWOBJ) {
MonoClass *newobj_class;
MonoMethodSignature *csig;
stackval valuetype_this;
- stackval *endsp = sp;
guint32 token;
stackval retval;
frame->ip = ip;
- ip++;
- token = read32 (ip);
- ip += 4;
-
- if (!(child_frame.method = mono_get_method (image, token, NULL)))
- THROW_EX (mono_get_exception_missing_method (), ip -5);
+ token = * (guint16 *)(ip + 1);
+ ip += 2;
- csig = child_frame.method->signature;
- newobj_class = child_frame.method->klass;
+ child_frame.runtime_method = rtm->data_items [token];
+ csig = child_frame.runtime_method->method->signature;
+ newobj_class = child_frame.runtime_method->method->klass;
/*if (profiling_classes) {
guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, newobj_class));
count++;
@@ -2559,7 +2583,7 @@ ves_exec_method (MonoInvocation *frame)
if (newobj_class->parent == mono_defaults.array_class) {
sp -= csig->param_count;
- o = ves_array_create (domain, newobj_class, csig, sp);
+ o = ves_array_create (context->domain, newobj_class, csig, sp);
goto array_constructed;
}
@@ -2567,20 +2591,20 @@ ves_exec_method (MonoInvocation *frame)
* First arg is the object.
*/
if (newobj_class->valuetype) {
- void *zero;
- vt_alloc (&newobj_class->byval_arg, &valuetype_this);
if (!newobj_class->enumtype && (newobj_class->byval_arg.type == MONO_TYPE_VALUETYPE)) {
- zero = valuetype_this.data.vt.vt;
- child_frame.obj = valuetype_this.data.vt.vt;
+ child_frame.obj = vt_sp;
+ valuetype_this.data.p = vt_sp;
} else {
memset (&valuetype_this, 0, sizeof (stackval));
- zero = &valuetype_this;
child_frame.obj = &valuetype_this;
}
- stackval_from_data (&newobj_class->byval_arg, &valuetype_this, zero);
} else {
if (newobj_class != mono_defaults.string_class) {
- o = mono_object_new (domain, newobj_class);
+ context->managed_code = 0;
+ o = mono_object_new (context->domain, newobj_class);
+ context->managed_code = 1;
+ if (*abort_requested)
+ mono_thread_interruption_checkpoint ();
child_frame.obj = o;
} else {
child_frame.retval = &retval;
@@ -2596,15 +2620,12 @@ ves_exec_method (MonoInvocation *frame)
g_assert (csig->call_convention == MONO_CALL_DEFAULT);
+ child_frame.ip = NULL;
child_frame.ex = NULL;
- child_frame.ex_handler = NULL;
- ves_exec_method (&child_frame);
+ ves_exec_method_with_context (&child_frame, context);
- while (endsp > sp) {
- --endsp;
- vt_free (endsp);
- }
+ context->current_frame = frame;
if (child_frame.ex) {
/*
@@ -2622,565 +2643,576 @@ array_constructed:
} else if (newobj_class == mono_defaults.string_class) {
*sp = retval;
} else {
- sp->type = VAL_OBJ;
sp->data.p = o;
- sp->data.vt.klass = newobj_class;
}
++sp;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_CASTCLASS) /* Fall through */
- CASE (CEE_ISINST) {
- MonoObject *o;
- MonoVTable *vt;
- MonoClass *c , *oclass;
- guint32 token;
- int do_isinst = *ip == CEE_ISINST;
- gboolean found = FALSE;
-
- ++ip;
- token = read32 (ip);
- c = mono_class_get (image, token);
-
- g_assert (sp [-1].type == VAL_OBJ);
-
+ MINT_IN_CASE(MINT_CASTCLASS)
+ c = rtm->data_items [*(guint16 *)(ip + 1)];
if ((o = sp [-1].data.p)) {
-
- vt = o->vtable;
- oclass = vt->klass;
-
- if (c->flags & TYPE_ATTRIBUTE_INTERFACE) {
- if ((c->interface_id <= oclass->max_interface_id) &&
- vt->interface_offsets [c->interface_id])
- found = TRUE;
+ if (c->marshalbyref) {
+ if (!mono_object_isinst_mbyref (o, c))
+ THROW_EX (mono_get_exception_invalid_cast (), ip);
} else {
- if (oclass == mono_defaults.transparent_proxy_class) {
- /* fixme: add check for IRemotingTypeInfo */
- MonoRealProxy *rp = ((MonoTransparentProxy *)o)->rp;
- MonoType *type;
- type = rp->class_to_proxy->type;
- oclass = mono_class_from_mono_type (type);
- }
- /* handle array casts */
- if (oclass->rank && oclass->rank == c->rank) {
- if ((oclass->element_class->baseval - c->element_class->baseval) <= c->element_class->diffval) {
- sp [-1].data.vt.klass = c;
- found = TRUE;
+ MonoVTable *vt = o->vtable;
+ MonoClass *oklass = vt->klass;
+ if (c->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ if (c->interface_id > vt->max_interface_id ||
+ vt->interface_offsets [c->interface_id] == 0) {
+ THROW_EX (mono_get_exception_invalid_cast (), ip);
}
- } else if ((oclass->baseval - c->baseval) <= c->diffval) {
- sp [-1].data.vt.klass = c;
- found = TRUE;
+ } else if (c->rank) {
+ if (!mono_object_isinst (o, c))
+ THROW_EX (mono_get_exception_invalid_cast (), ip);
+ } else if (!mono_class_has_parent (oklass, c)) {
+ THROW_EX (mono_get_exception_invalid_cast (), ip);
}
}
-
- if (!found) {
- if (do_isinst) {
+ }
+ ip += 2;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ISINST)
+ c = rtm->data_items [*(guint16 *)(ip + 1)];
+ if ((o = sp [-1].data.p)) {
+ if (c->marshalbyref) {
+ if (!mono_object_isinst_mbyref (o, c))
+ sp [-1].data.p = NULL;
+ } else {
+ MonoVTable *vt = o->vtable;
+ MonoClass *oklass = vt->klass;
+ if (c->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ if (c->interface_id > vt->max_interface_id ||
+ vt->interface_offsets [c->interface_id] == 0) {
+ sp [-1].data.p = NULL;
+ }
+ } else if (c->rank) {
+ if (!mono_object_isinst (o, c))
+ sp [-1].data.p = NULL;
+ } else if (!mono_class_has_parent (oklass, c)) {
sp [-1].data.p = NULL;
- sp [-1].data.vt.klass = NULL;
- } else
- THROW_EX (mono_get_exception_invalid_cast (), ip - 1);
+ }
}
}
- ip += 4;
- BREAK;
- }
- CASE (CEE_CONV_R_UN)
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- break;
- case VAL_I64:
- sp [-1].data.f = (double)(guint64)sp [-1].data.l;
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- sp [-1].data.f = (double)(guint32)sp [-1].data.i;
- break;
- default:
- sp [-1].data.f = (double)(guint64)sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_DOUBLE;
- BREAK;
- CASE (CEE_UNUSED58)
- CASE (CEE_UNUSED1) ves_abort(); BREAK;
- CASE (CEE_UNBOX) {
- MonoObject *o;
- MonoClass *c;
- guint32 token;
-
+ ip += 2;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_R_UN_I4)
+ sp [-1].data.f = (double)(guint32)sp [-1].data.i;
++ip;
- token = read32 (ip);
-
- c = mono_class_get (image, token);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_R_UN_I8)
+ sp [-1].data.f = (double)(guint64)sp [-1].data.l;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_UNBOX)
+ c = rtm->data_items[*(guint16 *)(ip + 1)];
o = sp [-1].data.p;
if (!o)
- THROW_EX (mono_get_exception_null_reference(), ip - 1);
+ THROW_EX (mono_get_exception_null_reference(), ip);
- if (o->vtable->klass->element_class->type_token != c->element_class->type_token)
- THROW_EX (mono_get_exception_invalid_cast (), ip - 1);
+ if (!(mono_object_isinst (o, c) ||
+ ((o->vtable->klass->rank == 0) &&
+ (o->vtable->klass->element_class == c->element_class))))
+ THROW_EX (mono_get_exception_invalid_cast (), ip);
- sp [-1].type = VAL_MP;
sp [-1].data.p = (char *)o + sizeof (MonoObject);
-
- ip += 4;
- BREAK;
- }
- CASE (CEE_THROW)
+ ip += 2;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_THROW)
--sp;
frame->ex_handler = NULL;
if (!sp->data.p)
sp->data.p = mono_get_exception_null_reference ();
- THROW_EX (sp->data.p, ip);
- BREAK;
- CASE (CEE_LDFLDA) /* Fall through */
- CASE (CEE_LDFLD) {
- MonoObject *obj;
- MonoClassField *field;
- guint32 token, offset;
- int load_addr = *ip == CEE_LDFLDA;
-
- if (!sp [-1].data.p)
+ THROW_EX ((MonoException *)sp->data.p, ip);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLDA)
+ o = sp [-1].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ sp[-1].data.p = (char *)o + * (guint16 *)(ip + 1);
+ ip += 2;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CKNULL)
+ o = sp [-1].data.p;
+ if (!o)
THROW_EX (mono_get_exception_null_reference (), ip);
-
++ip;
- token = read32 (ip);
+ MINT_IN_BREAK;
+
+#define LDFLD(datamem, fieldtype) \
+ o = sp [-1].data.p; \
+ if (!o) \
+ THROW_EX (mono_get_exception_null_reference (), ip); \
+ sp[-1].data.datamem = * (fieldtype *)((char *)o + * (guint16 *)(ip + 1)) ; \
+ ip += 2;
+
+ MINT_IN_CASE(MINT_LDFLD_I1) LDFLD(i, gint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_U1) LDFLD(i, guint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_I2) LDFLD(i, gint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_U2) LDFLD(i, guint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_I4) LDFLD(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_I8) LDFLD(l, gint64); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_R4) LDFLD(f, float); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_R8) LDFLD(f, double); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_O) LDFLD(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFLD_P) LDFLD(p, gpointer); MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_LDFLD_VT)
+ o = sp [-1].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ i32 = READ32(ip + 2);
+ sp [-1].data.p = vt_sp;
+ memcpy(sp [-1].data.p, (char *)o + * (guint16 *)(ip + 1), i32);
+ vt_sp += (i32 + 7) & ~7;
ip += 4;
+ MINT_IN_BREAK;
- if (sp [-1].type == VAL_OBJ) {
- obj = sp [-1].data.p;
- /* if we access a field from our parent and the parent was
- * defined in another assembly, we get a memberref.
- */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF)
- field = mono_field_from_memberref (image, token, NULL);
- else
- field = mono_class_get_field (obj->vtable->klass, token);
- offset = field->offset;
- } else { /* valuetype */
- /*g_assert (sp [-1].type == VAL_VALUETA); */
- obj = sp [-1].data.vt.vt;
- field = mono_class_get_field (sp [-1].data.vt.klass, token);
- offset = field->offset - sizeof (MonoObject);
- }
- if (load_addr) {
- sp [-1].type = VAL_TP;
- sp [-1].data.p = (char*)obj + offset;
- sp [-1].data.vt.klass = mono_class_from_mono_type (field->type);
+ MINT_IN_CASE(MINT_LDRMFLD) {
+ MonoClassField *field;
+ char *addr;
+
+ o = sp [-1].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ field = rtm->data_items[* (guint16 *)(ip + 1)];
+ ip += 2;
+ if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
+ MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
+ addr = mono_load_remote_field (o, klass, field, NULL);
} else {
- vt_alloc (field->type, &sp [-1]);
- stackval_from_data (field->type, &sp [-1], (char*)obj + offset);
-
- }
- BREAK;
+ addr = (char*)o + field->offset;
+ }
+
+ stackval_from_data (field->type, &sp [-1], addr, FALSE);
+ MINT_IN_BREAK;
}
- CASE (CEE_STFLD) {
- MonoObject *obj;
+
+ MINT_IN_CASE(MINT_LDRMFLD_VT) {
MonoClassField *field;
- guint32 token, offset;
+ char *addr;
+ o = sp [-1].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ field = rtm->data_items[* (guint16 *)(ip + 1)];
+ i32 = READ32(ip + 2);
+ ip += 4;
+ if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
+ MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
+ addr = mono_load_remote_field (o, klass, field, NULL);
+ } else {
+ addr = (char*)o + field->offset;
+ }
+
+ sp [-1].data.p = vt_sp;
+ memcpy(sp [-1].data.p, (char *)o + * (guint16 *)(ip + 1), i32);
+ vt_sp += (i32 + 7) & ~7;
+ memcpy(sp [-1].data.p, addr, i32);
+ MINT_IN_BREAK;
+ }
+
+#define STFLD(datamem, fieldtype) \
+ o = sp [-2].data.p; \
+ if (!o) \
+ THROW_EX (mono_get_exception_null_reference (), ip); \
+ sp -= 2; \
+ * (fieldtype *)((char *)o + * (guint16 *)(ip + 1)) = sp[1].data.datamem; \
+ ip += 2;
+
+ MINT_IN_CASE(MINT_STFLD_I1) STFLD(i, gint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_U1) STFLD(i, guint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_I2) STFLD(i, gint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_U2) STFLD(i, guint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_I4) STFLD(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_I8) STFLD(l, gint64); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_R4) STFLD(f, float); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_R8) STFLD(f, double); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_O) STFLD(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STFLD_P) STFLD(p, gpointer); MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_STFLD_VT)
+ o = sp [-2].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ i32 = READ32(ip + 2);
sp -= 2;
-
- if (!sp [0].data.p)
+ memcpy((char *)o + * (guint16 *)(ip + 1), sp [1].data.p, i32);
+ vt_sp -= (i32 + 7) & ~7;
+ ip += 4;
+ MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_STRMFLD) {
+ MonoClassField *field;
+
+ o = sp [-2].data.p;
+ if (!o)
THROW_EX (mono_get_exception_null_reference (), ip);
- ++ip;
- token = read32 (ip);
+ field = rtm->data_items[* (guint16 *)(ip + 1)];
+ ip += 2;
+
+ if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
+ MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
+ mono_store_remote_field (o, klass, field, &sp [-1].data);
+ } else
+ stackval_to_data (field->type, &sp [-1], (char*)o + field->offset, FALSE);
+
+ sp -= 2;
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_STRMFLD_VT) {
+ MonoClassField *field;
+
+ o = sp [-2].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ field = rtm->data_items[* (guint16 *)(ip + 1)];
+ i32 = READ32(ip + 2);
ip += 4;
-
- if (sp [0].type == VAL_OBJ) {
- obj = sp [0].data.p;
- /* if we access a field from our parent and the parent was
- * defined in another assembly, we get a memberref.
- */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF)
- field = mono_field_from_memberref (image, token, NULL);
- else
- field = mono_class_get_field (obj->vtable->klass, token);
- offset = field->offset;
- } else { /* valuetype */
- /*g_assert (sp->type == VAL_VALUETA); */
- obj = sp [0].data.vt.vt;
- field = mono_class_get_field (sp [0].data.vt.klass, token);
- offset = field->offset - sizeof (MonoObject);
+
+ if (o->vtable->klass == mono_defaults.transparent_proxy_class) {
+ MonoClass *klass = ((MonoTransparentProxy*)o)->remote_class->proxy_class;
+ mono_store_remote_field (o, klass, field, &sp [-1].data);
+ } else
+ memcpy((char*)o + field->offset, sp [-1].data.p, i32);
+
+ sp -= 2;
+ vt_sp -= (i32 + 7) & ~7;
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_LDSFLDA) {
+ MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
+ MonoVTable *vt = mono_class_vtable (context->domain, field->parent);
+ gpointer addr;
+
+ if (!vt->initialized) {
+ frame->ip = ip;
+ mono_runtime_class_init (vt);
+ }
+ ip += 2;
+
+ if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
+ sp->data.p = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
+ else
+ sp->data.p = (char*)(vt->data) + field->offset;
+ ++sp;
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_LDSFLD) {
+ MonoVTable *vt;
+ MonoClassField *field;
+ gpointer addr;
+
+ field = rtm->data_items[*(guint16 *)(ip + 1)];
+ vt = rtm->data_items [*(guint16 *)(ip + 2)];
+ if (!vt->initialized) {
+ frame->ip = ip;
+ mono_runtime_class_init (vt);
}
+ ip += 3;
+ if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
+ addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
+ else
+ addr = (char*)(vt->data) + field->offset;
- stackval_to_data (field->type, &sp [1], (char*)obj + offset);
- vt_free (&sp [1]);
- BREAK;
+ stackval_from_data (field->type, sp, addr, FALSE);
+ ++sp;
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_LDSFLD_I4) {
+ MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
+ MonoVTable *vt = rtm->data_items [*(guint16 *)(ip + 2)];
+ if (!vt->initialized) {
+ frame->ip = ip;
+ mono_runtime_class_init (vt);
+ }
+ ip += 3;
+ sp->data.i = * (gint32 *)((char*)(vt->data) + field->offset);
+ ++sp;
+ MINT_IN_BREAK;
}
- CASE (CEE_LDSFLD) /* Fall through */
- CASE (CEE_LDSFLDA) {
+ MINT_IN_CASE(MINT_LDSFLD_O) {
+ MonoClassField *field = rtm->data_items[*(guint16 *)(ip + 1)];
+ MonoVTable *vt = rtm->data_items [*(guint16 *)(ip + 2)];
+ if (!vt->initialized) {
+ frame->ip = ip;
+ mono_runtime_class_init (vt);
+ }
+ ip += 3;
+ sp->data.p = * (gpointer *)((char*)(vt->data) + field->offset);
+ ++sp;
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_LDSFLD_VT) {
MonoVTable *vt;
- MonoClass *klass;
MonoClassField *field;
guint32 token;
- int load_addr = *ip == CEE_LDSFLDA;
gpointer addr;
+ int size;
- ++ip;
- token = read32 (ip);
+ token = * (guint16 *)(ip + 1);
+ size = READ32(ip + 2);
+ field = rtm->data_items[token];
ip += 4;
-
- /* need to handle fieldrefs */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
- field = mono_field_from_memberref (image, token, &klass);
- } else {
- klass = mono_class_get (image,
- MONO_TOKEN_TYPE_DEF | mono_metadata_typedef_from_field (image, token & 0xffffff));
- field = mono_class_get_field (klass, token);
+
+ vt = mono_class_vtable (context->domain, field->parent);
+ if (!vt->initialized) {
+ frame->ip = ip - 2;
+ mono_runtime_class_init (vt);
}
- g_assert (field);
- vt = mono_class_vtable (domain, klass);
- addr = (char*)(vt->data) + field->offset;
+ if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
+ addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
+ else
+ addr = (char*)(vt->data) + field->offset;
- if (load_addr) {
- sp->type = VAL_TP;
- sp->data.p = addr;
- sp->data.vt.klass = mono_class_from_mono_type (field->type);
- } else {
- vt_alloc (field->type, sp);
- stackval_from_data (field->type, sp, addr);
- }
+ sp->data.p = vt_sp;
+ vt_sp += (size + 7) & ~7;
+ stackval_from_data (field->type, sp, addr, FALSE);
++sp;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_STSFLD) {
+ MINT_IN_CASE(MINT_STSFLD) {
MonoVTable *vt;
- MonoClass *klass;
MonoClassField *field;
guint32 token;
gpointer addr;
- ++ip;
- token = read32 (ip);
- ip += 4;
+ token = * (guint16 *)(ip + 1);
+ field = rtm->data_items[token];
+ ip += 2;
--sp;
- /* need to handle fieldrefs */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
- field = mono_field_from_memberref (image, token, &klass);
- } else {
- klass = mono_class_get (image,
- MONO_TOKEN_TYPE_DEF | mono_metadata_typedef_from_field (image, token & 0xffffff));
- field = mono_class_get_field (klass, token);
+ vt = mono_class_vtable (context->domain, field->parent);
+ if (!vt->initialized) {
+ frame->ip = ip - 2;
+ mono_runtime_class_init (vt);
}
- g_assert (field);
-
- vt = mono_class_vtable (domain, klass);
- addr = (char*)(vt->data) + field->offset;
+
+ if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
+ addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
+ else
+ addr = (char*)(vt->data) + field->offset;
- stackval_to_data (field->type, sp, addr);
- vt_free (sp);
- BREAK;
+ stackval_to_data (field->type, sp, addr, FALSE);
+ MINT_IN_BREAK;
}
- CASE (CEE_STOBJ) {
- MonoClass *vtklass;
- ++ip;
- vtklass = mono_class_get (image, read32 (ip));
+ MINT_IN_CASE(MINT_STSFLD_VT) {
+ MonoVTable *vt;
+ MonoClassField *field;
+ guint32 token;
+ gpointer addr;
+ int size;
+
+ token = * (guint16 *)(ip + 1);
+ size = READ32(ip + 2);
+ field = rtm->data_items[token];
ip += 4;
+
+ vt = mono_class_vtable (context->domain, field->parent);
+ if (!vt->initialized) {
+ frame->ip = ip - 2;
+ mono_runtime_class_init (vt);
+ }
+
+ if (context->domain->special_static_fields && (addr = g_hash_table_lookup (context->domain->special_static_fields, field)))
+ addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
+ else
+ addr = (char*)(vt->data) + field->offset;
+ --sp;
+ stackval_to_data (field->type, sp, addr, FALSE);
+ vt_sp -= (size + 7) & ~7;
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_STOBJ_VT) {
+ int size;
+ c = rtm->data_items[* (guint16 *)(ip + 1)];
+ ip += 2;
+ size = mono_class_value_size (c, NULL);
+ memcpy(sp [-2].data.p, sp [-1].data.p, size);
+ vt_sp -= (size + 7) & ~7;
sp -= 2;
- memcpy (sp [0].data.p, sp [1].data.vt.vt, mono_class_value_size (vtklass, NULL));
- BREAK;
+ MINT_IN_BREAK;
}
-#if SIZEOF_VOID_P == 8
- CASE (CEE_CONV_OVF_I_UN)
-#endif
- CASE (CEE_CONV_OVF_I8_UN) {
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- if (sp [-1].data.f < 0 || sp [-1].data.f > 9223372036854775807L)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.l = (guint64)sp [-1].data.f;
- break;
- case VAL_I64:
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- /* Can't overflow */
- sp [-1].data.l = (guint64)sp [-1].data.i;
- break;
- default:
- sp [-1].data.l = (guint64)sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_I64;
- ++ip;
- BREAK;
+ MINT_IN_CASE(MINT_STOBJ) {
+ int size;
+ c = rtm->data_items[* (guint16 *)(ip + 1)];
+ ip += 2;
+ size = mono_class_value_size (c, NULL);
+ memcpy(sp [-2].data.p, &sp [-1].data, size);
+ sp -= 2;
+ MINT_IN_BREAK;
}
-#if SIZEOF_VOID_P == 8
- CASE (CEE_CONV_OVF_U_UN)
-#endif
- CASE (CEE_CONV_OVF_U8_UN) {
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- if (sp [-1].data.f < 0 || sp [-1].data.f > MYGUINT64_MAX)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.l = (guint64)sp [-1].data.f;
- break;
- case VAL_I64:
- /* nothing to do */
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- /* Can't overflow */
- sp [-1].data.l = (guint64)sp [-1].data.i;
- break;
- default:
- /* Can't overflow */
- sp [-1].data.l = (guint64)sp [-1].data.nati;
- break;
- }
- sp [-1].type = VAL_I64;
+ MINT_IN_CASE(MINT_CONV_OVF_I4_UN_R8)
+ if (sp [-1].data.f < 0 || sp [-1].data.f > MYGUINT32_MAX)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (guint32)sp [-1].data.f;
++ip;
- BREAK;
- }
-#if SIZEOF_VOID_P == 4
- CASE (CEE_CONV_OVF_I_UN)
- CASE (CEE_CONV_OVF_U_UN)
-#endif
- CASE (CEE_CONV_OVF_I1_UN)
- CASE (CEE_CONV_OVF_I2_UN)
- CASE (CEE_CONV_OVF_I4_UN)
- CASE (CEE_CONV_OVF_U1_UN)
- CASE (CEE_CONV_OVF_U2_UN)
- CASE (CEE_CONV_OVF_U4_UN) {
- guint64 value;
- switch (sp [-1].type) {
- case VAL_DOUBLE:
- value = (guint64)sp [-1].data.f;
- break;
- case VAL_I64:
- value = (guint64)sp [-1].data.l;
- break;
- case VAL_VALUET:
- ves_abort();
- case VAL_I32:
- value = (guint64)sp [-1].data.i;
- break;
- default:
- value = (guint64)sp [-1].data.nati;
- break;
- }
- switch (*ip) {
- case CEE_CONV_OVF_I1_UN:
- if (value > 127)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
- case CEE_CONV_OVF_I2_UN:
- if (value > 32767)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
-#if SIZEOF_VOID_P == 4
- case CEE_CONV_OVF_I_UN: /* Fall through */
-#endif
- case CEE_CONV_OVF_I4_UN:
- if (value > 2147483647)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
- case CEE_CONV_OVF_U1_UN:
- if (value > 255)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
- case CEE_CONV_OVF_U2_UN:
- if (value > 65535)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
-#if SIZEOF_VOID_P == 4
- case CEE_CONV_OVF_U_UN: /* Fall through */
-#endif
- case CEE_CONV_OVF_U4_UN:
- if (value > 4294967295U)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = value;
- sp [-1].type = VAL_I32;
- break;
- default:
- g_assert_not_reached ();
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U8_I4)
+ if (sp [-1].data.i < 0)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.l = sp [-1].data.i;
++ip;
- BREAK;
- }
- CASE (CEE_BOX) {
- guint32 token;
- MonoClass *class;
-
- ip++;
- token = read32 (ip);
-
- class = mono_class_get (image, token);
- g_assert (class != NULL);
-
- sp [-1].type = VAL_OBJ;
- if (class->byval_arg.type == MONO_TYPE_VALUETYPE && !class->enumtype)
- sp [-1].data.p = mono_value_box (domain, class, sp [-1].data.p);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U8_R8)
+ MINT_IN_CASE(MINT_CONV_OVF_I8_UN_R8)
+ if (sp [-1].data.f < 0 || sp [-1].data.f > 9223372036854775807LL)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.l = (guint64)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I8_R8)
+ if (sp [-1].data.f < MYGINT64_MIN || sp [-1].data.f > MYGINT64_MAX)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.l = (gint64)sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I4_UN_I8)
+ if ((mono_u)sp [-1].data.l > MYGUINT32_MAX)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (mono_u)sp [-1].data.l;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_BOX)
+ c = rtm->data_items [* (guint16 *)(ip + 1)];
+
+ if (c->byval_arg.type == MONO_TYPE_VALUETYPE && !c->enumtype) {
+ int size = mono_class_value_size (c, NULL);
+ sp [-1].data.p = mono_value_box (context->domain, c, sp [-1].data.p);
+ size = (size + 7) & ~7;
+ vt_sp -= size;
+ }
else {
-#if G_BYTE_ORDER != G_LITTLE_ENDIAN
- stackval_to_data (&class->byval_arg, &sp [-1], (char*)&sp [-1]);
-#endif
- sp [-1].data.p = mono_value_box (domain, class, &sp [-1]);
+ stackval_to_data (&c->byval_arg, &sp [-1], (char*)&sp [-1], FALSE);
+ sp [-1].data.p = mono_value_box (context->domain, c, &sp [-1]);
}
- /* need to vt_free (sp); */
-
- ip += 4;
-
- BREAK;
- }
- CASE (CEE_NEWARR) {
- MonoClass *class;
- MonoObject *o;
- guint32 token;
-
- ip++;
- token = read32 (ip);
- class = mono_class_get (image, token);
- o = (MonoObject*) mono_array_new (domain, class, sp [-1].data.i);
- ip += 4;
-
- sp [-1].type = VAL_OBJ;
- sp [-1].data.p = o;
+ ip += 2;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_NEWARR)
+ sp [-1].data.p = (MonoObject*) mono_array_new (context->domain, rtm->data_items[*(guint16 *)(ip + 1)], sp [-1].data.i);
+ ip += 2;
/*if (profiling_classes) {
guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, o->vtable->klass));
count++;
g_hash_table_insert (profiling_classes, o->vtable->klass, GUINT_TO_POINTER (count));
}*/
- BREAK;
- }
- CASE (CEE_LDLEN) {
- MonoArray *o;
-
- ip++;
-
- g_assert (sp [-1].type == VAL_OBJ);
-
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLEN)
o = sp [-1].data.p;
if (!o)
- THROW_EX (mono_get_exception_null_reference (), ip - 1);
-
- g_assert (MONO_CLASS_IS_ARRAY (o->obj.vtable->klass));
-
- sp [-1].type = VAL_I32;
- sp [-1].data.i = mono_array_length (o);
-
- BREAK;
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ sp [-1].data.nati = mono_array_length ((MonoArray *)o);
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_GETCHR) {
+ MonoString *s;
+ s = sp [-2].data.p;
+ if (!s)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ i32 = sp [-1].data.i;
+ if (i32 < 0 || i32 >= mono_string_length (s))
+ THROW_EX (mono_get_exception_index_out_of_range (), ip);
+ --sp;
+ sp [-1].data.i = mono_string_chars(s)[i32];
+ ++ip;
+ MINT_IN_BREAK;
}
- CASE (CEE_LDELEMA) {
- MonoArray *o;
- guint32 esize, token;
-
+ MINT_IN_CASE(MINT_STRLEN)
++ip;
- token = read32 (ip);
- ip += 4;
+ sp [-1].data.i = mono_string_length ((MonoString*)sp [-1].data.p);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ARRAY_RANK)
+ o = sp [-1].data.p;
+ if (!o)
+ THROW_EX (mono_get_exception_null_reference (), ip);
+ sp [-1].data.i = mono_object_class (sp [-1].data.p)->rank;
+ ip++;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDELEMA) {
+ guint32 esize;
+ mono_u aindex;
+
+ /*token = READ32 (ip)*/;
+ ip += 2;
sp -= 2;
- g_assert (sp [0].type == VAL_OBJ);
o = sp [0].data.p;
- g_assert (MONO_CLASS_IS_ARRAY (o->obj.vtable->klass));
-
- if (sp [1].data.nati >= mono_array_length (o))
- THROW_EX (mono_get_exception_index_out_of_range (), ip - 5);
+ aindex = sp [1].data.i;
+ if (aindex >= mono_array_length ((MonoArray *) o))
+ THROW_EX (mono_get_exception_index_out_of_range (), ip - 2);
/* check the array element corresponds to token */
- esize = mono_array_element_size (o->obj.vtable->klass);
+ esize = mono_array_element_size (((MonoArray *) o)->obj.vtable->klass);
- sp->type = VAL_MP;
- sp->data.p = mono_array_addr_with_size (o, esize, sp [1].data.i);
- sp->data.vt.klass = o->obj.vtable->klass->element_class;
-
+ sp->data.p = mono_array_addr_with_size ((MonoArray *) o, esize, aindex);
++sp;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_LDELEM_I1) /* fall through */
- CASE (CEE_LDELEM_U1) /* fall through */
- CASE (CEE_LDELEM_I2) /* fall through */
- CASE (CEE_LDELEM_U2) /* fall through */
- CASE (CEE_LDELEM_I4) /* fall through */
- CASE (CEE_LDELEM_U4) /* fall through */
- CASE (CEE_LDELEM_I8) /* fall through */
- CASE (CEE_LDELEM_I) /* fall through */
- CASE (CEE_LDELEM_R4) /* fall through */
- CASE (CEE_LDELEM_R8) /* fall through */
- CASE (CEE_LDELEM_REF) {
+ MINT_IN_CASE(MINT_LDELEM_I1) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_U1) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_I2) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_U2) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_I4) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_U4) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_I8) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_I) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_R4) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_R8) /* fall through */
+ MINT_IN_CASE(MINT_LDELEM_REF) {
MonoArray *o;
mono_u aindex;
sp -= 2;
- g_assert (sp [0].type == VAL_OBJ);
o = sp [0].data.p;
if (!o)
THROW_EX (mono_get_exception_null_reference (), ip);
- g_assert (MONO_CLASS_IS_ARRAY (o->obj.vtable->klass));
-
- aindex = sp [1].data.nati;
+ aindex = sp [1].data.i;
if (aindex >= mono_array_length (o))
THROW_EX (mono_get_exception_index_out_of_range (), ip);
-
+
/*
* FIXME: throw mono_get_exception_array_type_mismatch () if needed
*/
switch (*ip) {
- case CEE_LDELEM_I1:
+ case MINT_LDELEM_I1:
sp [0].data.i = mono_array_get (o, gint8, aindex);
- sp [0].type = VAL_I32;
break;
- case CEE_LDELEM_U1:
+ case MINT_LDELEM_U1:
sp [0].data.i = mono_array_get (o, guint8, aindex);
- sp [0].type = VAL_I32;
break;
- case CEE_LDELEM_I2:
+ case MINT_LDELEM_I2:
sp [0].data.i = mono_array_get (o, gint16, aindex);
- sp [0].type = VAL_I32;
break;
- case CEE_LDELEM_U2:
+ case MINT_LDELEM_U2:
sp [0].data.i = mono_array_get (o, guint16, aindex);
- sp [0].type = VAL_I32;
break;
- case CEE_LDELEM_I:
+ case MINT_LDELEM_I:
sp [0].data.nati = mono_array_get (o, mono_i, aindex);
- sp [0].type = VAL_NATI;
break;
- case CEE_LDELEM_I4:
+ case MINT_LDELEM_I4:
sp [0].data.i = mono_array_get (o, gint32, aindex);
- sp [0].type = VAL_I32;
break;
- case CEE_LDELEM_U4:
+ case MINT_LDELEM_U4:
sp [0].data.i = mono_array_get (o, guint32, aindex);
- sp [0].type = VAL_I32;
break;
- case CEE_LDELEM_I8:
+ case MINT_LDELEM_I8:
sp [0].data.l = mono_array_get (o, guint64, aindex);
- sp [0].type = VAL_I64;
break;
- case CEE_LDELEM_R4:
+ case MINT_LDELEM_R4:
sp [0].data.f = mono_array_get (o, float, aindex);
- sp [0].type = VAL_DOUBLE;
break;
- case CEE_LDELEM_R8:
+ case MINT_LDELEM_R8:
sp [0].data.f = mono_array_get (o, double, aindex);
- sp [0].type = VAL_DOUBLE;
break;
- case CEE_LDELEM_REF:
+ case MINT_LDELEM_REF:
sp [0].data.p = mono_array_get (o, gpointer, aindex);
- sp [0].data.vt.klass = NULL;
- sp [0].type = VAL_OBJ;
break;
default:
ves_abort();
@@ -3188,312 +3220,247 @@ array_constructed:
++ip;
++sp;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_STELEM_I) /* fall through */
- CASE (CEE_STELEM_I1) /* fall through */
- CASE (CEE_STELEM_I2) /* fall through */
- CASE (CEE_STELEM_I4) /* fall through */
- CASE (CEE_STELEM_I8) /* fall through */
- CASE (CEE_STELEM_R4) /* fall through */
- CASE (CEE_STELEM_R8) /* fall through */
- CASE (CEE_STELEM_REF) {
- MonoArray *o;
- MonoClass *ac;
+ MINT_IN_CASE(MINT_STELEM_I) /* fall through */
+ MINT_IN_CASE(MINT_STELEM_I1) /* fall through */
+ MINT_IN_CASE(MINT_STELEM_I2) /* fall through */
+ MINT_IN_CASE(MINT_STELEM_I4) /* fall through */
+ MINT_IN_CASE(MINT_STELEM_I8) /* fall through */
+ MINT_IN_CASE(MINT_STELEM_R4) /* fall through */
+ MINT_IN_CASE(MINT_STELEM_R8) /* fall through */
+ MINT_IN_CASE(MINT_STELEM_REF) {
mono_u aindex;
sp -= 3;
- g_assert (sp [0].type == VAL_OBJ);
o = sp [0].data.p;
if (!o)
THROW_EX (mono_get_exception_null_reference (), ip);
- ac = o->obj.vtable->klass;
- g_assert (MONO_CLASS_IS_ARRAY (ac));
-
- aindex = sp [1].data.nati;
- if (aindex >= mono_array_length (o))
+ aindex = sp [1].data.i;
+ if (aindex >= mono_array_length ((MonoArray *)o))
THROW_EX (mono_get_exception_index_out_of_range (), ip);
- /*
- * FIXME: throw mono_get_exception_array_type_mismatch () if needed
- */
switch (*ip) {
- case CEE_STELEM_I:
- mono_array_set (o, mono_i, aindex, sp [2].data.nati);
+ case MINT_STELEM_I:
+ mono_array_set ((MonoArray *)o, mono_i, aindex, sp [2].data.nati);
break;
- case CEE_STELEM_I1:
- mono_array_set (o, gint8, aindex, sp [2].data.i);
+ case MINT_STELEM_I1:
+ mono_array_set ((MonoArray *)o, gint8, aindex, sp [2].data.i);
break;
- case CEE_STELEM_I2:
- mono_array_set (o, gint16, aindex, sp [2].data.i);
+ case MINT_STELEM_I2:
+ mono_array_set ((MonoArray *)o, gint16, aindex, sp [2].data.i);
break;
- case CEE_STELEM_I4:
- mono_array_set (o, gint32, aindex, sp [2].data.i);
+ case MINT_STELEM_I4:
+ mono_array_set ((MonoArray *)o, gint32, aindex, sp [2].data.i);
break;
- case CEE_STELEM_I8:
- mono_array_set (o, gint64, aindex, sp [2].data.l);
+ case MINT_STELEM_I8:
+ mono_array_set ((MonoArray *)o, gint64, aindex, sp [2].data.l);
break;
- case CEE_STELEM_R4:
- mono_array_set (o, float, aindex, sp [2].data.f);
+ case MINT_STELEM_R4:
+ mono_array_set ((MonoArray *)o, float, aindex, sp [2].data.f);
break;
- case CEE_STELEM_R8:
- mono_array_set (o, double, aindex, sp [2].data.f);
+ case MINT_STELEM_R8:
+ mono_array_set ((MonoArray *)o, double, aindex, sp [2].data.f);
break;
- case CEE_STELEM_REF:
- g_assert (sp [2].type == VAL_OBJ);
- mono_array_set (o, gpointer, aindex, sp [2].data.p);
+ case MINT_STELEM_REF:
+ if (sp [2].data.p && !mono_object_isinst (sp [2].data.p, mono_object_class (o)->element_class))
+ THROW_EX (mono_get_exception_array_type_mismatch (), ip);
+ mono_array_set ((MonoArray *)o, gpointer, aindex, sp [2].data.p);
break;
default:
ves_abort();
}
++ip;
- BREAK;
+ MINT_IN_BREAK;
}
- CASE (CEE_UNUSED2)
- CASE (CEE_UNUSED3)
- CASE (CEE_UNUSED4)
- CASE (CEE_UNUSED5)
- CASE (CEE_UNUSED6)
- CASE (CEE_UNUSED7)
- CASE (CEE_UNUSED8)
- CASE (CEE_UNUSED9)
- CASE (CEE_UNUSED10)
- CASE (CEE_UNUSED11)
- CASE (CEE_UNUSED12)
- CASE (CEE_UNUSED13)
- CASE (CEE_UNUSED14)
- CASE (CEE_UNUSED15)
- CASE (CEE_UNUSED16)
- CASE (CEE_UNUSED17) ves_abort(); BREAK;
- CASE (CEE_CONV_OVF_I1)
- if (sp [-1].type == VAL_I32) {
- if (sp [-1].data.i < 128 || sp [-1].data.i > 127)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint8)sp [-1].data.i;
- } else if (sp [-1].type == VAL_I64) {
- if (sp [-1].data.l < 128 || sp [-1].data.l > 127)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint8)sp [-1].data.l;
- } else {
- ves_abort();
- }
+ MINT_IN_CASE(MINT_CONV_OVF_I4_U4)
+ if (sp [-1].data.i < 0)
+ THROW_EX (mono_get_exception_overflow (), ip);
++ip;
- BREAK;
- CASE (CEE_CONV_OVF_U1)
- if (sp [-1].type == VAL_I32) {
- if (sp [-1].data.i < 0 || sp [-1].data.i > 255)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint8)sp [-1].data.i;
- } else if (sp [-1].type == VAL_I64) {
- if (sp [-1].data.l < 0 || sp [-1].data.l > 255)
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint8)sp [-1].data.l;
- } else {
- ves_abort();
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I4_I8)
+ if (sp [-1].data.l < MYGINT32_MIN || sp [-1].data.l > MYGINT32_MAX)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (gint32) sp [-1].data.l;
++ip;
- BREAK;
- CASE (CEE_CONV_OVF_I2)
- CASE (CEE_CONV_OVF_U2)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I4_R8)
+ if (sp [-1].data.f < MYGINT32_MIN || sp [-1].data.f > MYGINT32_MAX)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (gint32) sp [-1].data.f;
++ip;
- /* FIXME: handle other cases */
- if (sp [-1].type == VAL_I32) {
- /* defined as NOP */
- } else {
- ves_abort();
- }
- BREAK;
- CASE (CEE_CONV_OVF_I4)
- /* FIXME: handle other cases */
- if (sp [-1].type == VAL_I32) {
- /* defined as NOP */
- } else if(sp [-1].type == VAL_I64) {
- sp [-1].data.i = (gint32)sp [-1].data.l;
- sp [-1].type = VAL_I32;
- } else {
- ves_abort();
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U4_I4)
+ if (sp [-1].data.i < 0)
+ THROW_EX (mono_get_exception_overflow (), ip);
++ip;
- BREAK;
- CASE (CEE_CONV_OVF_U4)
- /* FIXME: handle other cases */
- if (sp [-1].type == VAL_I32) {
- /* defined as NOP */
- } else if(sp [-1].type == VAL_I64) {
- sp [-1].data.i = (guint32)sp [-1].data.l;
- sp [-1].type = VAL_I32;
- } else {
- ves_abort();
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U4_I8)
+ if (sp [-1].data.l < 0 || sp [-1].data.l > MYGUINT32_MAX)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (guint32) sp [-1].data.l;
++ip;
- BREAK;
- CASE (CEE_CONV_OVF_I8)
- /* FIXME: handle other cases */
- if (sp [-1].type == VAL_I32) {
- sp [-1].data.l = (guint64)sp [-1].data.i;
- sp [-1].type = VAL_I64;
- } else if(sp [-1].type == VAL_I64) {
- /* defined as NOP */
- } else {
- ves_abort();
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U4_R8)
+ if (sp [-1].data.f < 0 || sp [-1].data.f > MYGUINT32_MAX)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (guint32) sp [-1].data.f;
++ip;
- BREAK;
- CASE (CEE_CONV_OVF_U8)
- /* FIXME: handle other cases */
- if (sp [-1].type == VAL_I32) {
- sp [-1].data.l = (guint64) sp [-1].data.i;
- sp [-1].type = VAL_I64;
- } else if(sp [-1].type == VAL_I64) {
- /* defined as NOP */
- } else {
- ves_abort();
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I2_I4)
+ if (sp [-1].data.i < -32768 || sp [-1].data.i > 32767)
+ THROW_EX (mono_get_exception_overflow (), ip);
++ip;
- BREAK;
- CASE (CEE_UNUSED50)
- CASE (CEE_UNUSED18)
- CASE (CEE_UNUSED19)
- CASE (CEE_UNUSED20)
- CASE (CEE_UNUSED21)
- CASE (CEE_UNUSED22)
- CASE (CEE_UNUSED23) ves_abort(); BREAK;
- CASE (CEE_REFANYVAL) ves_abort(); BREAK;
- CASE (CEE_CKFINITE)
- if (!finite(sp [-1].data.f))
- THROW_EX (mono_get_exception_arithmetic (), ip);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I2_I8)
+ if (sp [-1].data.l < -32768 || sp [-1].data.l > 32767)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (gint16) sp [-1].data.l;
++ip;
- BREAK;
- CASE (CEE_UNUSED24) ves_abort(); BREAK;
- CASE (CEE_UNUSED25) ves_abort(); BREAK;
- CASE (CEE_MKREFANY) ves_abort(); BREAK;
- CASE (CEE_UNUSED59)
- CASE (CEE_UNUSED60)
- CASE (CEE_UNUSED61)
- CASE (CEE_UNUSED62)
- CASE (CEE_UNUSED63)
- CASE (CEE_UNUSED64)
- CASE (CEE_UNUSED65)
- CASE (CEE_UNUSED66)
- CASE (CEE_UNUSED67) ves_abort(); BREAK;
- CASE (CEE_LDTOKEN) {
- gpointer handle;
- MonoClass *handle_class;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I2_R8)
+ if (sp [-1].data.f < -32768 || sp [-1].data.f > 32767)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (gint16) sp [-1].data.f;
++ip;
- handle = mono_ldtoken (image, read32 (ip), &handle_class);
- ip += 4;
- vt_alloc (&handle_class->byval_arg, sp);
- stackval_from_data (&handle_class->byval_arg, sp, (char*)&handle);
- ++sp;
- BREAK;
- }
- CASE (CEE_CONV_OVF_I)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U2_I4)
+ if (sp [-1].data.i < 0 || sp [-1].data.i > 65535)
+ THROW_EX (mono_get_exception_overflow (), ip);
++ip;
- --sp;
- /* FIXME: check overflow. */
- switch (sp->type) {
- case VAL_I32:
- sp->data.p = (gpointer)(mono_i) sp->data.i;
- break;
- case VAL_I64:
- sp->data.p = (gpointer)(mono_i) sp->data.l;
- break;
- case VAL_NATI:
- break;
- case VAL_DOUBLE:
- sp->data.p = (gpointer)(mono_i) sp->data.f;
- break;
- default:
- ves_abort ();
- }
- sp->type = VAL_NATI;
- ++sp;
- BREAK;
- CASE (CEE_CONV_OVF_U) ves_abort(); BREAK;
- CASE (CEE_ADD_OVF)
- --sp;
- /* FIXME: check overflow */
- if (sp->type == VAL_I32) {
- if (CHECK_ADD_OVERFLOW (sp [-1].data.i, GET_NATI (sp [0])))
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (gint32)sp [-1].data.i + (gint32)GET_NATI (sp [0]);
- } else if (sp->type == VAL_I64) {
- if (CHECK_ADD_OVERFLOW64 (sp [-1].data.l, sp [0].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.l = (gint64)sp [-1].data.l + (gint64)sp [0].data.l;
- } else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f += sp [0].data.f;
- else {
- char *p = sp [-1].data.p;
- p += GET_NATI (sp [0]);
- sp [-1].data.p = p;
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U2_I8)
+ if (sp [-1].data.l < 0 || sp [-1].data.l > 65535)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (guint16) sp [-1].data.l;
++ip;
- BREAK;
- CASE (CEE_ADD_OVF_UN)
- --sp;
- /* FIXME: check overflow, make unsigned */
- if (sp->type == VAL_I32) {
- if (CHECK_ADD_OVERFLOW_UN (sp [-1].data.i, GET_NATI (sp [0])))
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.i = (guint32)sp [-1].data.i + (guint32)GET_NATI (sp [0]);
- } else if (sp->type == VAL_I64) {
- if (CHECK_ADD_OVERFLOW64_UN (sp [-1].data.l, sp [0].data.l))
- THROW_EX (mono_get_exception_overflow (), ip);
- sp [-1].data.l = (guint64)sp [-1].data.l + (guint64)sp [0].data.l;
- } else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f += sp [0].data.f;
- else {
- char *p = sp [-1].data.p;
- p += GET_NATI (sp [0]);
- sp [-1].data.p = p;
- }
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U2_R8)
+ if (sp [-1].data.f < 0 || sp [-1].data.f > 65535)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (guint16) sp [-1].data.f;
++ip;
- BREAK;
- CASE (CEE_MUL_OVF)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I1_I4)
+ if (sp [-1].data.i < -128 || sp [-1].data.i > 127)
+ THROW_EX (mono_get_exception_overflow (), ip);
++ip;
- --sp;
- /* FIXME: check overflow */
- if (sp->type == VAL_I32)
- sp [-1].data.i *= (gint)GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l *= sp [0].data.l;
- else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f *= sp [0].data.f;
- BREAK;
- CASE (CEE_MUL_OVF_UN)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I1_I8)
+ if (sp [-1].data.l < -128 || sp [-1].data.l > 127)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (gint8) sp [-1].data.l;
++ip;
- --sp;
- /* FIXME: check overflow, make unsigned */
- if (sp->type == VAL_I32)
- sp [-1].data.i *= (gint)GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l *= sp [0].data.l;
- else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f *= sp [0].data.f;
- BREAK;
- CASE (CEE_SUB_OVF)
- CASE (CEE_SUB_OVF_UN)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_I1_R8)
+ if (sp [-1].data.f < -128 || sp [-1].data.f > 127)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (gint8) sp [-1].data.f;
++ip;
- --sp;
- /* FIXME: handle undeflow/unsigned */
- /* should probably consider the pointers as unsigned */
- if (sp->type == VAL_I32)
- sp [-1].data.i -= GET_NATI (sp [0]);
- else if (sp->type == VAL_I64)
- sp [-1].data.l -= sp [0].data.l;
- else if (sp->type == VAL_DOUBLE)
- sp [-1].data.f -= sp [0].data.f;
- else {
- char *p = sp [-1].data.p;
- p -= GET_NATI (sp [0]);
- sp [-1].data.p = p;
- }
- BREAK;
- CASE (CEE_ENDFINALLY)
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U1_I4)
+ if (sp [-1].data.i < 0 || sp [-1].data.i > 255)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U1_I8)
+ if (sp [-1].data.l < 0 || sp [-1].data.l > 255)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (guint8) sp [-1].data.l;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CONV_OVF_U1_R8)
+ if (sp [-1].data.f < 0 || sp [-1].data.f > 255)
+ THROW_EX (mono_get_exception_overflow (), ip);
+ sp [-1].data.i = (guint8) sp [-1].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+#if 0
+ MINT_IN_CASE(MINT_LDELEM)
+ MINT_IN_CASE(MINT_STELEM)
+ MINT_IN_CASE(MINT_UNBOX_ANY)
+
+ MINT_IN_CASE(MINT_REFANYVAL) ves_abort(); MINT_IN_BREAK;
+#endif
+ MINT_IN_CASE(MINT_CKFINITE)
+ if (!finite(sp [-1].data.f))
+ THROW_EX (mono_get_exception_arithmetic (), ip);
+ ++ip;
+ MINT_IN_BREAK;
+#if 0
+ MINT_IN_CASE(MINT_MKREFANY) ves_abort(); MINT_IN_BREAK;
+#endif
+ MINT_IN_CASE(MINT_LDTOKEN)
+ sp->data.p = vt_sp;
+ vt_sp += 8;
+ * (gpointer *)sp->data.p = rtm->data_items[*(guint16 *)(ip + 1)];
+ ip += 2;
+ ++sp;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ADD_OVF_I4)
+ if (CHECK_ADD_OVERFLOW (sp [-2].data.i, sp [-1].data.i))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP(i, +);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ADD_OVF_I8)
+ if (CHECK_ADD_OVERFLOW64 (sp [-2].data.l, sp [-1].data.l))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP(l, +);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ADD_OVF_UN_I4)
+ if (CHECK_ADD_OVERFLOW_UN (sp [-2].data.i, sp [-1].data.i))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP_CAST(i, +, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ADD_OVF_UN_I8)
+ if (CHECK_ADD_OVERFLOW64_UN (sp [-2].data.l, sp [-1].data.l))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP_CAST(l, +, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MUL_OVF_I4)
+ if (CHECK_MUL_OVERFLOW (sp [-2].data.i, sp [-1].data.i))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP(i, *);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MUL_OVF_I8)
+ if (CHECK_MUL_OVERFLOW64 (sp [-2].data.l, sp [-1].data.l))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP(l, *);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MUL_OVF_UN_I4)
+ if (CHECK_MUL_OVERFLOW_UN (sp [-2].data.i, sp [-1].data.i))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP_CAST(i, *, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MUL_OVF_UN_I8)
+ if (CHECK_MUL_OVERFLOW64_UN (sp [-2].data.l, sp [-1].data.l))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP_CAST(l, *, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB_OVF_I4)
+ if (CHECK_SUB_OVERFLOW (sp [-2].data.i, sp [-1].data.i))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP(i, -);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB_OVF_I8)
+ if (CHECK_SUB_OVERFLOW64 (sp [-2].data.l, sp [-1].data.l))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP(l, -);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB_OVF_UN_I4)
+ if (CHECK_SUB_OVERFLOW_UN (sp [-2].data.i, sp [-1].data.i))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP_CAST(i, -, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_SUB_OVF_UN_I8)
+ if (CHECK_SUB_OVERFLOW64_UN (sp [-2].data.l, sp [-1].data.l))
+ THROW_EX (mono_get_exception_overflow (), ip);
+ BINOP_CAST(l, -, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ENDFINALLY)
if (finally_ips) {
ip = finally_ips->data;
finally_ips = g_slist_remove (finally_ips, ip);
@@ -3501,396 +3468,386 @@ array_constructed:
}
if (frame->ex)
goto handle_fault;
- /*
- * There was no exception, we continue normally at the target address.
- */
- ip = endfinally_ip;
- BREAK;
- CASE (CEE_LEAVE) /* Fall through */
- CASE (CEE_LEAVE_S)
- sp = frame->stack; /* empty the stack */
+ ves_abort();
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LEAVE) /* Fall through */
+ MINT_IN_CASE(MINT_LEAVE_S)
+ while (sp > frame->stack) {
+ --sp;
+ }
frame->ip = ip;
- if (*ip == CEE_LEAVE_S) {
- ++ip;
- ip += (signed char) *ip;
- ++ip;
+ if (*ip == MINT_LEAVE_S) {
+ ip += (short) *(ip + 1);
} else {
- ++ip;
- ip += (gint32) read32 (ip);
- ip += 4;
+ ip += (gint32) READ32 (ip + 1);
}
-#if 0
- /*
- * We may be either inside a try block or inside an handler.
- * In the first case there was no exception and we go on
- * executing the finally handlers and after that resume control
- * at endfinally_ip.
- * In the second case we need to clear the exception and
- * continue directly at the target ip.
- */
- if (!frame->ex) {
- endfinally_ip = ip;
- goto handle_finally;
- } else {
- frame->ex = NULL;
+ endfinally_ip = ip;
+ if (frame->ex_handler != NULL && MONO_OFFSET_IN_HANDLER(frame->ex_handler, frame->ip - rtm->code)) {
frame->ex_handler = NULL;
+ frame->ex = NULL;
}
-#else
- frame->ex = NULL;
- frame->ex_handler = NULL;
- endfinally_ip = ip;
goto handle_finally;
- BREAK;
-#endif
- CASE (CEE_UNUSED26)
- CASE (CEE_UNUSED27)
- CASE (CEE_UNUSED28)
- CASE (CEE_UNUSED29)
- CASE (CEE_UNUSED30)
- CASE (CEE_UNUSED31)
- CASE (CEE_UNUSED32)
- CASE (CEE_UNUSED33)
- CASE (CEE_UNUSED34)
- CASE (CEE_UNUSED35)
- CASE (CEE_UNUSED36)
- CASE (CEE_UNUSED37)
- CASE (CEE_UNUSED38)
- CASE (CEE_UNUSED39)
- CASE (CEE_UNUSED40)
- CASE (CEE_UNUSED41)
- CASE (CEE_UNUSED42)
- CASE (CEE_UNUSED43)
- CASE (CEE_UNUSED44)
- CASE (CEE_UNUSED45)
- CASE (CEE_UNUSED46)
- CASE (CEE_UNUSED47)
- CASE (CEE_UNUSED48)
- CASE (CEE_PREFIX7)
- CASE (CEE_PREFIX6)
- CASE (CEE_PREFIX5)
- CASE (CEE_PREFIX4)
- CASE (CEE_PREFIX3)
- CASE (CEE_PREFIX2)
- CASE (CEE_PREFIXREF) ves_abort(); BREAK;
- /*
- * Note: Exceptions thrown when executing a prefixed opcode need
- * to take into account the number of prefix bytes (usually the
- * throw point is just (ip - n_prefix_bytes).
- */
- SUB_SWITCH
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_ICALL_P_V)
+ MINT_IN_CASE(MINT_ICALL_P_P)
+ MINT_IN_CASE(MINT_ICALL_PP_V)
+ MINT_IN_CASE(MINT_ICALL_PI_V)
+ MINT_IN_CASE(MINT_ICALL_PP_P)
+ MINT_IN_CASE(MINT_ICALL_PI_P)
+ MINT_IN_CASE(MINT_ICALL_PPP_V)
+ MINT_IN_CASE(MINT_ICALL_PPI_V)
+ sp = do_icall (context, *ip, sp, rtm->data_items [*(guint16 *)(ip + 1)]);
+ if (frame->ex != NULL)
+ goto handle_exception;
+ ip += 2;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MONO_LDPTR)
+ sp->data.p = rtm->data_items [*(guint16 *)(ip + 1)];
+ ip += 2;
+ ++sp;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MONO_NEWOBJ)
+ sp->data.p = mono_object_new (context->domain, rtm->data_items [*(guint16 *)(ip + 1)]);
+ ip += 2;
+ sp++;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MONO_FREE)
++ip;
- switch (*ip) {
- case CEE_ARGLIST: ves_abort(); break;
- case CEE_CEQ: {
- gint32 result;
- ++ip;
- sp -= 2;
-
- if (sp->type == VAL_I32)
- result = sp [0].data.i == (gint)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = sp [0].data.l == sp [1].data.l;
- else if (sp->type == VAL_DOUBLE) {
- if (isnan (sp [0].data.f) || isnan (sp [1].data.f))
- result = 0;
- else
- result = sp [0].data.f == sp [1].data.f;
- } else
- result = GET_NATI (sp [0]) == GET_NATI (sp [1]);
- sp->type = VAL_I32;
- sp->data.i = result;
+ --sp;
+ g_free (sp->data.p);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_MONO_RETOBJ)
+ ++ip;
+ sp--;
+ stackval_from_data (frame->runtime_method->method->signature->ret, frame->retval, sp->data.p, frame->runtime_method->method->signature->pinvoke);
+ if (sp > frame->stack)
+ g_warning ("retobj: more values on stack: %d", sp-frame->stack);
+ goto exit_frame;
+
+#define RELOP(datamem, op) \
+ --sp; \
+ sp [-1].data.i = sp [-1].data.datamem op sp [0].data.datamem; \
+ ++ip;
+ MINT_IN_CASE(MINT_CEQ_I4)
+ RELOP(i, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CEQ0_I4)
+ sp [-1].data.i = (sp [-1].data.i == 0);
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CEQ_I8)
+ RELOP(l, ==);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CEQ_R8)
+ --sp;
+ if (isunordered (sp [-1].data.f, sp [0].data.f))
+ sp [-1].data.i = 0;
+ else
+ sp [-1].data.i = sp [-1].data.f == sp [0].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CGT_I4)
+ RELOP(i, >);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CGT_I8)
+ RELOP(l, >);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CGT_R8)
+ --sp;
+ if (isunordered (sp [-1].data.f, sp [0].data.f))
+ sp [-1].data.i = 0;
+ else
+ sp [-1].data.i = sp [-1].data.f > sp [0].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+
+#define RELOP_CAST(datamem, op, type) \
+ --sp; \
+ sp [-1].data.i = (type)sp [-1].data.datamem op (type)sp [0].data.datamem; \
+ ++ip;
+
+ MINT_IN_CASE(MINT_CGT_UN_I4)
+ RELOP_CAST(i, >, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CGT_UN_I8)
+ RELOP_CAST(l, >, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CGT_UN_R8)
+ --sp;
+ if (isunordered (sp [-1].data.f, sp [0].data.f))
+ sp [-1].data.i = 1;
+ else
+ sp [-1].data.i = sp [-1].data.f > sp [0].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CLT_I4)
+ RELOP(i, <);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CLT_I8)
+ RELOP(l, <);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CLT_R8)
+ --sp;
+ if (isunordered (sp [-1].data.f, sp [0].data.f))
+ sp [-1].data.i = 0;
+ else
+ sp [-1].data.i = sp [-1].data.f < sp [0].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CLT_UN_I4)
+ RELOP_CAST(i, <, guint32);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CLT_UN_I8)
+ RELOP_CAST(l, <, guint64);
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CLT_UN_R8)
+ --sp;
+ if (isunordered (sp [-1].data.f, sp [0].data.f))
+ sp [-1].data.i = 1;
+ else
+ sp [-1].data.i = sp [-1].data.f < sp [0].data.f;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDFTN) {
+ sp->data.p = rtm->data_items [* (guint16 *)(ip + 1)];
+ ++sp;
+ ip += 2;
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_LDVIRTFTN) {
+ RuntimeMethod *m = rtm->data_items [* (guint16 *)(ip + 1)];
+ ip += 2;
+ --sp;
+ if (!sp->data.p)
+ THROW_EX (mono_get_exception_null_reference (), ip - 2);
+
+ sp->data.p = get_virtual_method (m, sp->data.p);
+ ++sp;
+ MINT_IN_BREAK;
+ }
- sp++;
- break;
- }
- case CEE_CGT: {
- gint32 result;
- ++ip;
- sp -= 2;
-
- if (sp->type == VAL_I32)
- result = sp [0].data.i > (gint)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = sp [0].data.l > sp [1].data.l;
- else if (sp->type == VAL_DOUBLE) {
- if (isnan (sp [0].data.f) || isnan (sp [1].data.f))
- result = 0;
- else
- result = sp [0].data.f > sp [1].data.f;
- } else
- result = (gint)GET_NATI (sp [0]) > (gint)GET_NATI (sp [1]);
- sp->type = VAL_I32;
- sp->data.i = result;
+ MINT_IN_CASE(MINT_LDTHIS)
+ sp->data.p = frame->obj;
+ ++ip;
+ ++sp;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STTHIS)
+ --sp;
+ frame->obj = sp->data.p;
+ ++ip;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDTHISA)
+ sp->data.p = &frame->obj;
+ ++ip;
+ ++sp;
+ MINT_IN_BREAK;
- sp++;
- break;
- }
- case CEE_CGT_UN: {
- gint32 result;
- ++ip;
- sp -= 2;
-
- if (sp->type == VAL_I32)
- result = (guint32)sp [0].data.i > (mono_u)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = (guint64)sp [0].data.l > (guint64)sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = isnan (sp [0].data.f) || isnan (sp [1].data.f);
- else
- result = (mono_u)GET_NATI (sp [0]) > (mono_u)GET_NATI (sp [1]);
- sp->type = VAL_I32;
- sp->data.i = result;
+#define LDARG(datamem, argtype) \
+ sp->data.datamem = * (argtype *)(frame->args + * (guint16 *)(ip + 1)); \
+ ip += 2; \
+ ++sp;
+
+ MINT_IN_CASE(MINT_LDARG_I1) LDARG(i, gint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_U1) LDARG(i, guint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_I2) LDARG(i, gint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_U2) LDARG(i, guint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_I4) LDARG(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_I8) LDARG(l, gint64); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_R4) LDARG(f, float); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_R8) LDARG(f, double); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_O) LDARG(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDARG_P) LDARG(p, gpointer); MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_LDARG_VT)
+ sp->data.p = vt_sp;
+ i32 = READ32(ip + 2);
+ memcpy(sp->data.p, frame->args + * (guint16 *)(ip + 1), i32);
+ vt_sp += (i32 + 7) & ~7;
+ ip += 4;
+ ++sp;
+ MINT_IN_BREAK;
- sp++;
- break;
- }
- case CEE_CLT: {
- gint32 result;
- ++ip;
- sp -= 2;
-
- if (sp->type == VAL_I32)
- result = sp [0].data.i < (gint)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = sp [0].data.l < sp [1].data.l;
- else if (sp->type == VAL_DOUBLE) {
- if (isnan (sp [0].data.f) || isnan (sp [1].data.f))
- result = 0;
- else
- result = sp [0].data.f < sp [1].data.f;
- } else
- result = (gint)GET_NATI (sp [0]) < (gint)GET_NATI (sp [1]);
- sp->type = VAL_I32;
- sp->data.i = result;
+#define STARG(datamem, argtype) \
+ --sp; \
+ * (argtype *)(frame->args + * (guint16 *)(ip + 1)) = sp->data.datamem; \
+ ip += 2; \
+
+ MINT_IN_CASE(MINT_STARG_I1) STARG(i, gint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_U1) STARG(i, guint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_I2) STARG(i, gint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_U2) STARG(i, guint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_I4) STARG(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_I8) STARG(l, gint64); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_R4) STARG(f, float); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_R8) STARG(f, double); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_O) STARG(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STARG_P) STARG(p, gpointer); MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_STARG_VT)
+ i32 = READ32(ip + 2);
+ --sp;
+ memcpy(frame->args + * (guint16 *)(ip + 1), sp->data.p, i32);
+ vt_sp -= (i32 + 7) & ~7;
+ ip += 4;
+ MINT_IN_BREAK;
- sp++;
- break;
- }
- case CEE_CLT_UN: {
- gint32 result;
- ++ip;
- sp -= 2;
-
- if (sp->type == VAL_I32)
- result = (guint32)sp [0].data.i < (mono_u)GET_NATI (sp [1]);
- else if (sp->type == VAL_I64)
- result = (guint64)sp [0].data.l < (guint64)sp [1].data.l;
- else if (sp->type == VAL_DOUBLE)
- result = isnan (sp [0].data.f) || isnan (sp [1].data.f);
- else
- result = (mono_u)GET_NATI (sp [0]) < (mono_u)GET_NATI (sp [1]);
- sp->type = VAL_I32;
- sp->data.i = result;
+#define STINARG(datamem, argtype) \
+ do { \
+ int n = * (guint16 *)(ip + 1); \
+ * (argtype *)(frame->args + rtm->arg_offsets [n]) = frame->stack_args [n].data.datamem; \
+ ip += 2; \
+ } while (0)
+
+ MINT_IN_CASE(MINT_STINARG_I1) STINARG(i, gint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_U1) STINARG(i, guint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_I2) STINARG(i, gint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_U2) STINARG(i, guint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_I4) STINARG(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_I8) STINARG(l, gint64); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_R4) STINARG(f, float); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_R8) STINARG(f, double); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_O) STINARG(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STINARG_P) STINARG(p, gpointer); MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_STINARG_VT) {
+ int n = * (guint16 *)(ip + 1);
+ i32 = READ32(ip + 2);
+ memcpy (frame->args + rtm->arg_offsets [n], frame->stack_args [n].data.p, i32);
+ ip += 4;
+ MINT_IN_BREAK;
+ }
- sp++;
- break;
- }
- case CEE_LDFTN:
- case CEE_LDVIRTFTN: {
- int virtual = *ip == CEE_LDVIRTFTN;
- MonoMethod *m;
- guint32 token;
- ++ip;
- token = read32 (ip);
- ip += 4;
- m = mono_get_method (image, token, NULL);
- if (!m)
- THROW_EX (mono_get_exception_missing_method (), ip - 5);
- if (virtual) {
- --sp;
- if (!sp->data.p)
- THROW_EX (mono_get_exception_null_reference (), ip - 5);
- m = get_virtual_method (domain, m, sp);
- }
- sp->type = VAL_NATI;
- sp->data.p = mono_create_method_pointer (m);
- sp->data.vt.klass = NULL;
- ++sp;
- break;
- }
- case CEE_UNUSED56: ves_abort(); break;
- case CEE_LDARG: {
- guint32 arg_pos;
- ++ip;
- arg_pos = read16 (ip);
- ip += 2;
- vt_alloc (ARG_TYPE (signature, arg_pos), sp);
- stackval_from_data (ARG_TYPE (signature, arg_pos), sp, ARG_POS (arg_pos));
- ++sp;
- break;
- }
- case CEE_LDARGA: {
- MonoType *t;
- MonoClass *c;
- guint32 anum;
-
- ++ip;
- anum = read16 (ip);
- ip += 2;
- t = ARG_TYPE (signature, anum);
- c = mono_class_from_mono_type (t);
- sp->data.vt.klass = c;
- sp->data.vt.vt = ARG_POS (anum);
-
- if (c->valuetype)
- sp->type = VAL_VALUETA;
- else
- sp->type = VAL_TP;
-
- ++sp;
- break;
- }
- case CEE_STARG: {
- guint32 arg_pos;
- ++ip;
- arg_pos = read16 (ip);
- ip += 2;
- --sp;
- stackval_to_data (ARG_TYPE (signature, arg_pos), sp, ARG_POS (arg_pos));
- vt_free (sp);
- break;
- }
- case CEE_LDLOC: {
- guint32 loc_pos;
- ++ip;
- loc_pos = read16 (ip);
- ip += 2;
- vt_alloc (LOCAL_TYPE (header, loc_pos), sp);
- stackval_from_data (LOCAL_TYPE (header, loc_pos), sp, LOCAL_POS (loc_pos));
- ++sp;
- break;
- }
- case CEE_LDLOCA: {
- MonoType *t;
- MonoClass *c;
- guint32 loc_pos;
-
- ++ip;
- loc_pos = read16 (ip);
- ip += 2;
- t = LOCAL_TYPE (header, loc_pos);
- c = mono_class_from_mono_type (t);
- sp->data.vt.vt = LOCAL_POS (loc_pos);
- sp->data.vt.klass = c;
-
- if (c->valuetype)
- sp->type = VAL_VALUETA;
- else
- sp->type = VAL_TP;
-
- ++sp;
- break;
- }
- case CEE_STLOC: {
- guint32 loc_pos;
- ++ip;
- loc_pos = read16 (ip);
- ip += 2;
- --sp;
- stackval_to_data (LOCAL_TYPE (header, loc_pos), sp, LOCAL_POS (loc_pos));
- vt_free (sp);
- break;
- }
- case CEE_LOCALLOC:
- if (sp != frame->stack)
- THROW_EX (mono_get_exception_execution_engine (NULL), ip - 1);
- ++ip;
- sp->data.p = alloca (sp->data.i);
- sp->type = VAL_TP;
- break;
- case CEE_UNUSED57: ves_abort(); break;
- case CEE_ENDFILTER: ves_abort(); break;
- case CEE_UNALIGNED_:
- ++ip;
- unaligned_address = 1;
- break;
- case CEE_VOLATILE_:
- ++ip;
- volatile_address = 1;
- break;
- case CEE_TAIL_:
- ++ip;
- tail_recursion = 1;
- break;
- case CEE_INITOBJ: {
- guint32 token;
- ++ip;
- token = read32 (ip);
- ip += 4;
- /*
- * we ignore the value of token (I think we can as unspecified
- * behavior described in Partition II, 3.5).
- */
- --sp;
- g_assert (sp->type == VAL_VALUETA || sp->type == VAL_TP);
- memset (sp->data.vt.vt, 0, mono_class_value_size (sp->data.vt.klass, NULL));
- break;
- }
- case CEE_UNUSED68: ves_abort(); break;
- case CEE_CPBLK:
- sp -= 3;
- if (!sp [0].data.p || !sp [1].data.p)
- THROW_EX (mono_get_exception_null_reference(), ip - 1);
- ++ip;
- /* FIXME: value and size may be int64... */
- memcpy (sp [0].data.p, sp [1].data.p, sp [2].data.i);
- break;
- case CEE_INITBLK:
- sp -= 3;
- if (!sp [0].data.p)
- THROW_EX (mono_get_exception_null_reference(), ip - 1);
- ++ip;
- /* FIXME: value and size may be int64... */
- memset (sp [0].data.p, sp [1].data.i, sp [2].data.i);
- break;
- case CEE_UNUSED69: ves_abort(); break;
- case CEE_RETHROW:
- /*
- * need to clarify what this should actually do:
- * start the search from the last found handler in
- * this method or continue in the caller or what.
- * Also, do we need to run finally/fault handlers after a retrow?
- * Well, this implementation will follow the usual search
- * for an handler, considering the current ip as throw spot.
- * We need to NULL frame->ex_handler for the later code to
- * actually run the new found handler.
- */
- frame->ex_handler = NULL;
- THROW_EX (frame->ex, ip - 1);
- break;
- case CEE_UNUSED: ves_abort(); break;
- case CEE_SIZEOF: {
- guint32 token;
- int align;
- ++ip;
- token = read32 (ip);
- ip += 4;
- if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC) {
- MonoType *type = mono_type_create_from_typespec (image, token);
- sp->data.i = mono_type_size (type, &align);
- mono_metadata_free_type (type);
- } else {
- MonoClass *szclass = mono_class_get (image, token);
- mono_class_init (szclass);
- if (!szclass->valuetype)
- THROW_EX (mono_exception_from_name (mono_defaults.corlib, "System", "InvalidProgramException"), ip - 5);
- sp->data.i = mono_class_value_size (szclass, &align);
- }
- sp->type = VAL_I32;
- ++sp;
- break;
- }
- case CEE_REFANYTYPE: ves_abort(); break;
- case CEE_UNUSED52:
- case CEE_UNUSED53:
- case CEE_UNUSED54:
- case CEE_UNUSED55:
- case CEE_UNUSED70:
- default:
- g_error ("Unimplemented opcode: 0xFE %02x at 0x%x\n", *ip, ip-header->code);
- }
- continue;
- DEFAULT;
+ MINT_IN_CASE(MINT_LDARGA)
+ sp->data.p = frame->args + * (guint16 *)(ip + 1);
+ ip += 2;
+ ++sp;
+ MINT_IN_BREAK;
+
+#define LDLOC(datamem, argtype) \
+ sp->data.datamem = * (argtype *)(locals + * (guint16 *)(ip + 1)); \
+ ip += 2; \
+ ++sp;
+
+ MINT_IN_CASE(MINT_LDLOC_I1) LDLOC(i, gint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_U1) LDLOC(i, guint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_I2) LDLOC(i, gint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_U2) LDLOC(i, guint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_I4) LDLOC(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_I8) LDLOC(l, gint64); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_R4) LDLOC(f, float); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_R8) LDLOC(f, double); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_O) LDLOC(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_LDLOC_P) LDLOC(p, gpointer); MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_LDLOC_VT)
+ sp->data.p = vt_sp;
+ i32 = READ32(ip + 2);
+ memcpy(sp->data.p, locals + * (guint16 *)(ip + 1), i32);
+ vt_sp += (i32 + 7) & ~7;
+ ip += 4;
+ ++sp;
+ MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_LDLOCA_S)
+ sp->data.p = locals + * (guint16 *)(ip + 1);
+ ip += 2;
+ ++sp;
+ MINT_IN_BREAK;
+
+#define STLOC(datamem, argtype) \
+ --sp; \
+ * (argtype *)(locals + * (guint16 *)(ip + 1)) = sp->data.datamem; \
+ ip += 2;
+
+ MINT_IN_CASE(MINT_STLOC_I1) STLOC(i, gint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_U1) STLOC(i, guint8); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_I2) STLOC(i, gint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_U2) STLOC(i, guint16); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_I4) STLOC(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_I8) STLOC(l, gint64); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_R4) STLOC(f, float); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_R8) STLOC(f, double); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_O) STLOC(p, gpointer); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_P) STLOC(p, gpointer); MINT_IN_BREAK;
+
+#define STLOC_NP(datamem, argtype) \
+ * (argtype *)(locals + * (guint16 *)(ip + 1)) = sp [-1].data.datamem; \
+ ip += 2;
+
+ MINT_IN_CASE(MINT_STLOC_NP_I4) STLOC_NP(i, gint32); MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_STLOC_NP_O) STLOC_NP(p, gpointer); MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_STLOC_VT)
+ i32 = READ32(ip + 2);
+ --sp;
+ memcpy(locals + * (guint16 *)(ip + 1), sp->data.p, i32);
+ vt_sp -= (i32 + 7) & ~7;
+ ip += 4;
+ MINT_IN_BREAK;
+
+ MINT_IN_CASE(MINT_LOCALLOC)
+ if (sp != frame->stack + 1) /*FIX?*/
+ THROW_EX (mono_get_exception_execution_engine (NULL), ip);
+ sp [-1].data.p = alloca (sp [-1].data.i);
+ ++ip;
+ MINT_IN_BREAK;
+#if 0
+ MINT_IN_CASE(MINT_ENDFILTER) ves_abort(); MINT_IN_BREAK;
+#endif
+ MINT_IN_CASE(MINT_INITOBJ)
+ --sp;
+ memset (sp->data.vt, 0, READ32(ip + 1));
+ ip += 3;
+ MINT_IN_BREAK;
+ MINT_IN_CASE(MINT_CPBLK)
+ sp -= 3;
+ if (!sp [0].data.p || !sp [1].data.p)
+ THROW_EX (mono_get_exception_null_reference(), ip - 1);
+ ++ip;
+ /* FIXME: value and size may be int64... */
+ memcpy (sp [0].data.p, sp [1].data.p, sp [2].data.i);
+ MINT_IN_BREAK;
+#if 0
+ MINT_IN_CASE(MINT_CONSTRAINED_) {
+ guint32 token;
+ /* FIXME: implement */
+ ++ip;
+ token = READ32 (ip);
+ ip += 2;
+ MINT_IN_BREAK;
+ }
+#endif
+ MINT_IN_CASE(MINT_INITBLK)
+ sp -= 3;
+ if (!sp [0].data.p)
+ THROW_EX (mono_get_exception_null_reference(), ip - 1);
+ ++ip;
+ /* FIXME: value and size may be int64... */
+ memset (sp [0].data.p, sp [1].data.i, sp [2].data.i);
+ MINT_IN_BREAK;
+#if 0
+ MINT_IN_CASE(MINT_NO_)
+ /* FIXME: implement */
+ ip += 2;
+ MINT_IN_BREAK;
+#endif
+ MINT_IN_CASE(MINT_RETHROW)
+ /*
+ * need to clarify what this should actually do:
+ * start the search from the last found handler in
+ * this method or continue in the caller or what.
+ * Also, do we need to run finally/fault handlers after a retrow?
+ * Well, this implementation will follow the usual search
+ * for an handler, considering the current ip as throw spot.
+ * We need to NULL frame->ex_handler for the later code to
+ * actually run the new found handler.
+ */
+ frame->ex_handler = NULL;
+ THROW_EX (frame->ex, ip - 1);
+ MINT_IN_BREAK;
+ MINT_IN_DEFAULT
+ g_print ("Unimplemented opcode: %04x %s at 0x%x\n", *ip, mono_interp_opname[*ip], ip-rtm->code);
+ THROW_EX (mono_get_exception_execution_engine ("Unimplemented opcode"), ip);
}
}
@@ -3905,30 +3862,37 @@ array_constructed:
int i;
guint32 ip_offset;
MonoInvocation *inv;
- MonoMethodHeader *hd;
MonoExceptionClause *clause;
- char *message;
+ /*char *message;*/
MonoObject *ex_obj;
#if DEBUG_INTERP
if (tracing)
- g_print ("* Handling exception '%s' at IL_%04x\n", mono_object_class (frame->ex)->name, frame->ip - header->code);
+ g_print ("* Handling exception '%s' at IL_%04x\n",
+ frame->ex == NULL ? "** Unknown **" : mono_object_class (frame->ex)->name,
+ rtm == NULL ? 0 : frame->ip - rtm->code);
#endif
if (die_on_exception)
goto die_on_ex;
-
+
for (inv = frame; inv; inv = inv->parent) {
- if (inv->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ MonoMethod *method;
+ if (inv->runtime_method == NULL)
+ continue;
+ method = inv->runtime_method->method;
+ if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ continue;
+ if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))
continue;
- if (inv->method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))
+ if (inv->ip == NULL)
continue;
- hd = ((MonoMethodNormal*)inv->method)->header;
- ip_offset = inv->ip - hd->code;
- for (i = 0; i < hd->num_clauses; ++i) {
- clause = &hd->clauses [i];
+ ip_offset = inv->ip - inv->runtime_method->code;
+ inv->ex_handler = NULL; /* clear this in case we are trhowing an exception while handling one - this one wins */
+ for (i = 0; i < inv->runtime_method->num_clauses; ++i) {
+ clause = &inv->runtime_method->clauses [i];
if (clause->flags <= 1 && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
if (!clause->flags) {
- if (mono_object_isinst ((MonoObject*)frame->ex, mono_class_get (inv->method->klass->image, clause->token_or_filter))) {
+ if (mono_object_isinst ((MonoObject*)frame->ex, clause->data.catch_class)) {
/*
* OK, we found an handler, now we need to execute the finally
* and fault blocks before branching to the handler code.
@@ -3936,16 +3900,9 @@ array_constructed:
inv->ex_handler = clause;
#if DEBUG_INTERP
if (tracing)
- g_print ("* Found handler at '%s'\n", inv->method->name);
+ g_print ("* Found handler at '%s'\n", method->name);
#endif
- /*
- * It seems that if the catch handler is found in the same method,
- * it gets executed before the finally handler.
- */
- if (inv == frame)
- goto handle_fault;
- else
- goto handle_finally;
+ goto handle_finally;
}
} else {
/* FIXME: handle filter clauses */
@@ -3957,6 +3914,10 @@ array_constructed:
/*
* If we get here, no handler was found: print a stack trace.
*/
+ for (inv = frame; inv; inv = inv->parent) {
+ if (inv->invoke_trap)
+ goto handle_finally;
+ }
die_on_ex:
ex_obj = (MonoObject*)frame->ex;
mono_unhandled_exception (ex_obj);
@@ -3967,21 +3928,32 @@ die_on_ex:
int i;
guint32 ip_offset;
MonoExceptionClause *clause;
+ GSList *old_list = finally_ips;
+ MonoMethod *method = frame->runtime_method->method;
+ MonoMethodHeader *header = mono_method_get_header (method);
- if (frame->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
- DEBUG_LEAVE ();
- return;
+#if DEBUG_INTERP
+ if (tracing)
+ g_print ("* Handle finally IL_%04x\n", endfinally_ip == NULL ? 0 : endfinally_ip - rtm->code);
+#endif
+ if (rtm == NULL || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ || (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))) {
+ goto exit_frame;
}
- ip_offset = frame->ip - header->code;
+ ip_offset = frame->ip - rtm->code;
- for (i = 0; i < header->num_clauses; ++i) {
- clause = &header->clauses [i];
- if (clause == frame->ex_handler)
+ if (endfinally_ip != NULL)
+ finally_ips = g_slist_prepend(finally_ips, (void *)endfinally_ip);
+ for (i = 0; i < header->num_clauses; ++i)
+ if (frame->ex_handler == &rtm->clauses [i])
break;
- if (MONO_OFFSET_IN_CLAUSE (clause, ip_offset) && !(MONO_OFFSET_IN_CLAUSE (clause, endfinally_ip - header->code))) {
+ while (i > 0) {
+ --i;
+ clause = &rtm->clauses [i];
+ if (MONO_OFFSET_IN_CLAUSE (clause, ip_offset) && (endfinally_ip == NULL || !(MONO_OFFSET_IN_CLAUSE (clause, endfinally_ip - rtm->code)))) {
if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
- ip = header->code + clause->handler_offset;
- finally_ips = g_slist_append (finally_ips, ip);
+ ip = rtm->code + clause->handler_offset;
+ finally_ips = g_slist_prepend (finally_ips, (gpointer) ip);
#if DEBUG_INTERP
if (tracing)
g_print ("* Found finally at IL_%04x with exception: %s\n", clause->handler_offset, frame->ex? "yes": "no");
@@ -3989,9 +3961,13 @@ die_on_ex:
}
}
}
- if (finally_ips) {
+
+ endfinally_ip = NULL;
+
+ if (old_list != finally_ips && finally_ips) {
ip = finally_ips->data;
finally_ips = g_slist_remove (finally_ips, ip);
+ sp = frame->stack; /* spec says stack should be empty at endfinally so it should be at the start too */
goto main_loop;
}
@@ -4001,20 +3977,24 @@ die_on_ex:
*/
if (frame->ex)
goto handle_fault;
- ip = endfinally_ip;
- goto main_loop;
+ ves_abort();
}
handle_fault:
{
int i;
guint32 ip_offset;
MonoExceptionClause *clause;
+ MonoMethodHeader *header = mono_method_get_header (frame->runtime_method->method);
- ip_offset = frame->ip - header->code;
+#if DEBUG_INTERP
+ if (tracing)
+ g_print ("* Handle fault\n");
+#endif
+ ip_offset = frame->ip - rtm->code;
for (i = 0; i < header->num_clauses; ++i) {
- clause = &header->clauses [i];
- if (clause->flags == 3 && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
- ip = header->code + clause->handler_offset;
+ clause = &rtm->clauses [i];
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_FAULT && MONO_OFFSET_IN_CLAUSE (clause, ip_offset)) {
+ ip = rtm->code + clause->handler_offset;
#if DEBUG_INTERP
if (tracing)
g_print ("* Executing handler at IL_%04x\n", clause->handler_offset);
@@ -4030,34 +4010,82 @@ die_on_ex:
* is corrently not assigned in the ECMA specs: LAMESPEC.
*/
if (frame->ex_handler) {
- ip = header->code + frame->ex_handler->handler_offset;
+#if DEBUG_INTERP
+ if (tracing)
+ g_print ("* Executing handler at IL_%04x\n", frame->ex_handler->handler_offset);
+#endif
+ ip = rtm->code + frame->ex_handler->handler_offset;
sp = frame->stack;
- sp->type = VAL_OBJ;
+ vt_sp = (char *)sp + rtm->stack_size;
sp->data.p = frame->ex;
++sp;
goto main_loop;
}
- DEBUG_LEAVE ();
+ goto exit_frame;
+ }
+exit_frame:
+ DEBUG_LEAVE ();
+}
+
+void
+ves_exec_method (MonoInvocation *frame)
+{
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ ThreadContext context_struct;
+ jmp_buf env;
+
+ frame->ex = NULL;
+
+ if (setjmp(env)) {
+ mono_unhandled_exception ((MonoObject*)frame->ex);
return;
}
-
+ if (context == NULL) {
+ context = &context_struct;
+ context_struct.domain = mono_domain_get ();
+ context_struct.base_frame = frame;
+ context_struct.current_frame = NULL;
+ context_struct.env_frame = frame;
+ context_struct.current_env = &env;
+ context_struct.search_for_handler = 0;
+ context_struct.managed_code = 0;
+ TlsSetValue (thread_context_id, context);
+ }
+ frame->ip = NULL;
+ frame->parent = context->current_frame;
+ frame->runtime_method = mono_interp_get_runtime_method (frame->method);
+ context->managed_code = 1;
+ ves_exec_method_with_context(frame, context);
+ context->managed_code = 0;
+ if (frame->ex) {
+ if (context != &context_struct && context->current_env) {
+ context->env_frame->ex = frame->ex;
+ longjmp (*context->current_env, 1);
+ }
+ else
+ mono_unhandled_exception ((MonoObject*)frame->ex);
+ }
+ if (context->base_frame == frame)
+ TlsSetValue (thread_context_id, NULL);
+ else
+ context->current_frame = frame->parent;
}
static int
ves_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
{
- MonoImage *image = assembly->image;
- MonoCLIImageInfo *iinfo;
+ MonoImage *image = mono_assembly_get_image (assembly);
MonoMethod *method;
MonoObject *exc = NULL;
int rval;
- iinfo = image->image_info;
- method = mono_get_method (image, iinfo->cli_cli_header.ch_entry_point, NULL);
+ method = mono_get_method (image, mono_image_get_entry_point (image), NULL);
if (!method)
- g_error ("No entry point method found in %s", image->name);
+ g_error ("No entry point method found in %s", mono_image_get_filename (image));
- rval = mono_runtime_run_main (method, argc, argv, &exc, assembly);
+ rval = mono_runtime_run_main (method, argc, argv, &exc);
+ if (exc != NULL)
+ mono_unhandled_exception (exc);
return rval;
}
@@ -4107,33 +4135,101 @@ test_load_class (MonoImage* image)
}
#endif
-static MonoException * segv_exception = NULL;
+static void
+add_signal_handler (int signo, void (*handler)(int))
+{
+#ifdef PLATFORM_WIN32
+ signal (signo, handler);
+#else
+ struct sigaction sa;
+
+ sa.sa_handler = handler;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+
+ g_assert (sigaction (signo, &sa, NULL) != -1);
+#endif
+}
static void
segv_handler (int signum)
{
- signal (signum, segv_handler);
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ MonoException *segv_exception;
+
+ if (context == NULL)
+ return;
+ segv_exception = mono_get_exception_null_reference ();
+ segv_exception->message = mono_string_new (mono_domain_get (), "Null Reference (SIGSEGV)");
mono_raise_exception (segv_exception);
}
+
+static void
+quit_handler (int signum)
+{
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ MonoException *quit_exception;
+
+ if (context == NULL)
+ return;
+ quit_exception = mono_get_exception_execution_engine ("Interrupted (SIGQUIT).");
+ mono_raise_exception (quit_exception);
+}
+
+static void
+abrt_handler (int signum)
+{
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ MonoException *abrt_exception;
+
+ if (context == NULL)
+ return;
+ abrt_exception = mono_get_exception_execution_engine ("Abort (SIGABRT).");
+ mono_raise_exception (abrt_exception);
+}
+
+static void
+thread_abort_handler (int signum)
+{
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ MonoException *exc;
+
+ if (context == NULL)
+ return;
+
+ exc = mono_thread_request_interruption (context->managed_code);
+ if (exc) mono_raise_exception (exc);
+}
+
static MonoBoolean
ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
MonoReflectionMethod **method,
gint32 *iloffset, gint32 *native_offset,
MonoString **file, gint32 *line, gint32 *column)
{
+ ThreadContext *context = TlsGetValue (thread_context_id);
+ MonoInvocation *inv = context->current_frame;
+ int i;
+
+ for (i = 0; inv && i < skip; inv = inv->parent)
+ if (inv->runtime_method != NULL)
+ ++i;
+
if (iloffset)
*iloffset = 0;
if (native_offset)
*native_offset = 0;
if (method)
- *method = NULL;
+ *method = inv == NULL ? NULL : mono_method_get_object (context->domain, inv->runtime_method->method, NULL);
if (line)
*line = 0;
- if (column)
- *column = 0;
- if (file)
- *file = mono_string_new (mono_domain_get (), "unknown");
+ if (need_file_info) {
+ if (column)
+ *column = 0;
+ if (file)
+ *file = mono_string_new (mono_domain_get (), "unknown");
+ }
return TRUE;
}
@@ -4141,20 +4237,200 @@ ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
static MonoArray *
ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info)
{
- return NULL;
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ MonoArray *ta = exc->trace_ips;
+ int i, len;
+
+ if (ta == NULL) {
+ /* Exception is not thrown yet */
+ return mono_array_new (domain, mono_defaults.stack_frame_class, 0);
+ }
+
+ len = mono_array_length (ta);
+
+ res = mono_array_new (domain, mono_defaults.stack_frame_class, len > skip ? len - skip : 0);
+
+ for (i = skip; i < len / 2; i++) {
+ MonoStackFrame *sf = (MonoStackFrame *)mono_object_new (domain, mono_defaults.stack_frame_class);
+ gushort *ip = mono_array_get (ta, gpointer, 2 * i + 1);
+ RuntimeMethod *rtm = mono_array_get (ta, gpointer, 2 * i);
+
+ if (rtm != NULL) {
+ sf->method = mono_method_get_object (domain, rtm->method, NULL);
+ sf->native_offset = ip - rtm->code;
+ }
+
+#if 0
+ sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, sf->native_offset, &sf->line, domain);
+
+ sf->filename = filename? mono_string_new (domain, filename): NULL;
+ sf->column = 0;
+
+ g_free (filename);
+ }
+#endif
+
+ mono_array_set (res, gpointer, i, sf);
+ }
+
+ return res;
}
-int
-main (int argc, char *argv [])
+static MonoObject *
+ves_icall_System_Delegate_CreateDelegate_internal (MonoReflectionType *type, MonoObject *target,
+ MonoReflectionMethod *info)
+{
+ MonoClass *delegate_class = mono_class_from_mono_type (type->type);
+ MonoObject *delegate;
+
+ mono_assert (delegate_class->parent == mono_defaults.multicastdelegate_class);
+
+ delegate = mono_object_new (mono_object_domain (type), delegate_class);
+
+ interp_delegate_ctor (mono_object_domain (type), delegate, target, mono_interp_get_runtime_method (info->method));
+
+ return delegate;
+}
+
+
+typedef struct
{
MonoDomain *domain;
+ int enable_debugging;
+ char *file;
+ int argc;
+ char **argv;
+} MainThreadArgs;
+
+static void main_thread_handler (gpointer user_data)
+{
+ MainThreadArgs *main_args=(MainThreadArgs *)user_data;
MonoAssembly *assembly;
- int retval = 0, i, ocount = 0;
- char *file, *error, *config_file = NULL;
+ if (main_args->enable_debugging) {
+ mono_debug_init (MONO_DEBUG_FORMAT_MONO);
+ mono_debug_init_1 (main_args->domain);
+ }
+
+ assembly = mono_domain_assembly_open (main_args->domain,
+ main_args->file);
+
+ if (!assembly){
+ fprintf (stderr, "Can not open image %s\n", main_args->file);
+ exit (1);
+ }
+
+ if (main_args->enable_debugging)
+ mono_debug_init_2 (assembly);
+
+#ifdef RUN_TEST
+ test_load_class (assembly->image);
+#else
+
+ ves_exec (main_args->domain, assembly, main_args->argc, main_args->argv);
+#endif
+}
+
+static void
+mono_runtime_install_handlers (void)
+{
+ add_signal_handler (SIGSEGV, segv_handler);
+ add_signal_handler (SIGINT, quit_handler);
+ add_signal_handler (SIGABRT, abrt_handler);
+ add_signal_handler (mono_thread_get_abort_signal (), thread_abort_handler);
+}
+
+static void
+quit_function (MonoDomain *domain, gpointer user_data)
+{
+ mono_profiler_shutdown ();
+
+ mono_runtime_cleanup (domain);
+ mono_domain_free (domain, TRUE);
+
+}
+
+void
+mono_interp_cleanup(MonoDomain *domain)
+{
+ quit_function (domain, NULL);
+}
+
+int
+mono_interp_exec(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
+{
+ return ves_exec (domain, assembly, argc, argv);
+}
+
+MonoDomain *
+mono_interp_init(const char *file)
+{
+ MonoDomain *domain;
+
+ g_set_prgname (file);
+ mono_set_rootdir ();
+
+ g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
+ g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
+
+ if (!g_thread_supported ())
+ g_thread_init (NULL);
+
+ thread_context_id = TlsAlloc ();
+ TlsSetValue (thread_context_id, NULL);
+ InitializeCriticalSection (&runtime_method_lookup_section);
+ InitializeCriticalSection (&create_method_pointer_mutex);
+
+ mono_runtime_install_handlers ();
+ mono_interp_transform_init ();
+ mono_install_compile_method (mono_create_method_pointer);
+ mono_install_runtime_invoke (interp_mono_runtime_invoke);
+ mono_install_remoting_trampoline (interp_create_remoting_trampoline);
+ mono_install_trampoline (interp_create_trampoline);
+
+ mono_install_handler (interp_ex_handler);
+ mono_install_stack_walk (interp_walk_stack);
+ mono_runtime_install_cleanup (quit_function);
+ abort_requested = mono_thread_interruption_request_flag ();
+
+ domain = mono_init_from_assembly (file, file);
+#ifdef __hpux /* generates very big stack frames */
+ mono_threads_set_default_stacksize(32*1024*1024);
+#endif
+ mono_init_icall ();
+ mono_add_internal_call ("System.Diagnostics.StackFrame::get_frame_info", ves_icall_get_frame_info);
+ mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace", ves_icall_get_trace);
+ mono_add_internal_call ("Mono.Runtime::mono_runtime_install_handlers", mono_runtime_install_handlers);
+ mono_add_internal_call ("System.Delegate::CreateDelegate_internal", ves_icall_System_Delegate_CreateDelegate_internal);
+
+ mono_runtime_init (domain, NULL, NULL);
+
+ mono_thread_attach (domain);
+ return domain;
+}
+
+int
+mono_main (int argc, char *argv [])
+{
+ MonoDomain *domain;
+ int retval = 0, i;
+ char *file, *config_file = NULL;
+ int enable_debugging = FALSE;
+ MainThreadArgs main_args;
+ const char *error;
+
+ setlocale (LC_ALL, "");
if (argc < 2)
usage ();
+ MONO_GC_PRE_INIT ();
+
for (i = 1; i < argc && argv [i][0] == '-'; i++){
if (strcmp (argv [i], "--trace") == 0)
global_tracing = 1;
@@ -4162,20 +4438,22 @@ main (int argc, char *argv [])
global_no_pointers = 1;
if (strcmp (argv [i], "--traceops") == 0)
global_tracing = 2;
- if (strcmp (argv [i], "--dieonex") == 0)
+ if (strcmp (argv [i], "--traceopt") == 0)
+ ++mono_interp_traceopt;
+ if (strcmp (argv [i], "--dieonex") == 0) {
die_on_exception = 1;
+ enable_debugging = 1;
+ }
if (strcmp (argv [i], "--print-vtable") == 0)
mono_print_vtable = TRUE;
if (strcmp (argv [i], "--profile") == 0)
- mono_profiler_install_simple ();
- if (strcmp (argv [i], "--opcode-count") == 0)
- ocount = 1;
+ mono_profiler_load (NULL);
if (strcmp (argv [i], "--config") == 0)
config_file = argv [++i];
if (strcmp (argv [i], "--workers") == 0) {
- mono_worker_threads = atoi (argv [++i]);
- if (mono_worker_threads < 1)
- mono_worker_threads = 1;
+ mono_max_worker_threads = atoi (argv [++i]);
+ if (mono_max_worker_threads < 1)
+ mono_max_worker_threads = 1;
}
if (strcmp (argv [i], "--help") == 0)
usage ();
@@ -4186,6 +4464,8 @@ main (int argc, char *argv [])
g_error ("Invalid method name '%s'", argv [i]);
db_methods = g_list_append (db_methods, desc);
}
+ if (strcmp (argv [i], "--nested") == 0)
+ nested_trace = 1;
#endif
}
@@ -4194,66 +4474,34 @@ main (int argc, char *argv [])
if (!file)
usage ();
- mono_set_rootdir (argv [0]);
+ domain = mono_interp_init(file);
mono_config_parse (config_file);
-
- g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
- g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
-
- mono_init_icall ();
- mono_add_internal_call ("System.Array::Set", ves_array_set);
- mono_add_internal_call ("System.Array::Get", ves_array_get);
- mono_add_internal_call ("System.Array::Address", ves_array_element_address);
- mono_add_internal_call ("System.Diagnostics.StackFrame::get_frame_info", ves_icall_get_frame_info);
- mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace", ves_icall_get_trace);
- frame_thread_id = TlsAlloc ();
- TlsSetValue (frame_thread_id, NULL);
-
- mono_install_runtime_invoke (interp_mono_runtime_invoke);
- mono_install_remoting_trampoline (interp_create_remoting_trampoline);
-
- mono_install_handler (interp_ex_handler);
-
- InitializeCriticalSection (&metadata_lock);
- domain = mono_init (file);
- mono_runtime_init (domain, NULL);
-
- assembly = mono_domain_assembly_open (domain, file);
-
- if (!assembly){
- fprintf (stderr, "Can not open image %s\n", file);
- exit (1);
- }
-
-
-#ifdef RUN_TEST
- test_load_class (assembly->image);
-#else
- error = mono_verify_corlib ();
+ error = mono_check_corlib_version ();
if (error) {
fprintf (stderr, "Corlib not in sync with this runtime: %s\n", error);
+ fprintf (stderr, "Download a newer corlib at http://www.go-mono.com/daily.\n");
exit (1);
}
- segv_exception = mono_get_exception_null_reference ();
- segv_exception->message = mono_string_new (domain, "Segmentation fault");
- signal (SIGSEGV, segv_handler);
- retval = ves_exec (domain, assembly, argc - i, argv + i);
-#endif
- mono_profiler_shutdown ();
+ main_args.domain=domain;
+ main_args.file=file;
+ main_args.argc=argc-i;
+ main_args.argv=argv+i;
+ main_args.enable_debugging=enable_debugging;
- mono_runtime_cleanup (domain);
- mono_domain_unload (domain, TRUE);
+ mono_runtime_exec_managed_code (domain, main_thread_handler,
+ &main_args);
-#if DEBUG_INTERP
- if (ocount) {
- fprintf (stderr, "opcode count: %ld\n", opcode_count);
- fprintf (stderr, "fcall count: %ld\n", fcall_count);
- }
+ quit_function (domain, NULL);
+
+ /* Get the return value from System.Environment.ExitCode */
+ retval=mono_environment_exitcode_get ();
+
+#if COUNT_OPS
+ for (i = 0; i < 512; i++)
+ if (opcode_counts[i] != 0)
+ printf("%s %d\n", mono_interp_opname[i], opcode_counts[i]);
#endif
return retval;
}
-
-
-
diff --git a/mono/interpreter/interp.h b/mono/interpreter/interp.h
index 49d90a5713f..18cc9f245d9 100644
--- a/mono/interpreter/interp.h
+++ b/mono/interpreter/interp.h
@@ -1,7 +1,10 @@
-
+#include <setjmp.h>
#include <glib.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/object.h>
+#include <mono/metadata/domain-internals.h>
+#include <mono/metadata/class-internals.h>
+#include "config.h"
enum {
VAL_I32 = 0,
@@ -12,8 +15,7 @@ enum {
VAL_NATI = 0 + VAL_POINTER,
VAL_MP = 1 + VAL_POINTER,
VAL_TP = 2 + VAL_POINTER,
- VAL_OBJ = 3 + VAL_POINTER,
- VAL_VALUETA = 8
+ VAL_OBJ = 3 + VAL_POINTER
};
#if SIZEOF_VOID_P == 4
@@ -37,42 +39,95 @@ typedef struct {
/* native size integer and pointer types */
gpointer p;
mono_u nati;
- struct {
- gpointer vt;
- MonoClass *klass;
- } vt;
+ gpointer vt;
} data;
- unsigned int type;
+#if defined(__ppc__) || defined(__powerpc__)
+ int pad;
+#endif
} stackval;
typedef struct _MonoInvocation MonoInvocation;
+typedef void (*MonoFunc) (void);
+typedef void (*MonoPIFunc) (MonoFunc callme, void *retval, void *obj_this, stackval *arguments);
+
+/*
+ * Structure representing a method transformed for the interpreter
+ * This is domain specific
+ */
+typedef struct
+{
+ guint32 locals_size;
+ guint32 args_size;
+ guint32 stack_size;
+ guint32 vt_stack_size;
+ guint32 alloca_size;
+ unsigned short *code;
+ unsigned short *new_body_start; /* after all STINARG instrs */
+ MonoMethod *method;
+ MonoPIFunc func;
+ int num_clauses;
+ MonoExceptionClause *clauses;
+ void **data_items;
+ int transformed;
+ guint32 *arg_offsets;
+ guint32 *local_offsets;
+ unsigned int param_count;
+ unsigned int hasthis;
+ unsigned int valuetype;
+} RuntimeMethod;
+
struct _MonoInvocation {
MonoInvocation *parent; /* parent */
- MonoInvocation *child;
+ RuntimeMethod *runtime_method; /* parent */
MonoMethod *method; /* parent */
stackval *retval; /* parent */
void *obj; /* this - parent */
- char *locals;
char *args;
stackval *stack_args; /* parent */
stackval *stack;
+ stackval *sp; /* For GC stack marking */
/* exception info */
- const unsigned char *ip;
+ unsigned char invoke_trap;
+ const unsigned short *ip;
MonoException *ex;
MonoExceptionClause *ex_handler;
};
+typedef struct {
+ MonoDomain *domain;
+ MonoInvocation *base_frame;
+ MonoInvocation *current_frame;
+ MonoInvocation *env_frame;
+ jmp_buf *current_env;
+ unsigned char search_for_handler;
+ unsigned char managed_code;
+} ThreadContext;
+
void mono_init_icall (void);
-void inline stackval_from_data (MonoType *type, stackval *result, char *data);
-void ves_exec_method (MonoInvocation *frame);
+MonoException *
+mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
-typedef void (*MonoFunc) (void);
-typedef void (*MonoPIFunc) (MonoFunc callme, void *retval, void *obj_this, stackval *arguments);
+MonoDelegate*
+mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
+
+void
+mono_interp_transform_init (void);
+
+void inline stackval_from_data (MonoType *type, stackval *result, char *data, gboolean pinvoke);
+void inline stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke);
+void ves_exec_method (MonoInvocation *frame);
/*
* defined in an arch specific file.
*/
-MonoPIFunc mono_create_trampoline (MonoMethod *method, int runtime);
-void *mono_create_method_pointer (MonoMethod *method);
+MonoPIFunc
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor);
+
+RuntimeMethod *
+mono_interp_get_runtime_method (MonoMethod *method);
+
+void *mono_arch_create_method_pointer (MonoMethod *method);
+
+extern int mono_interp_traceopt;
diff --git a/mono/interpreter/main.c b/mono/interpreter/main.c
new file mode 100644
index 00000000000..70b5d96d1b7
--- /dev/null
+++ b/mono/interpreter/main.c
@@ -0,0 +1,9 @@
+#include "interp.h"
+#include "embed.h"
+
+int
+main (int argc, char* argv[])
+{
+ return mono_main (argc, argv);
+}
+
diff --git a/mono/interpreter/mint.1 b/mono/interpreter/mint.1
index de35edfc2c9..77e00c376f6 100644
--- a/mono/interpreter/mint.1
+++ b/mono/interpreter/mint.1
@@ -69,6 +69,11 @@ Directories are separated by the platform path separator (colons on unix). Examp
.SH FILES
Assemblies are lodaed from the installation lib directory. If you set
`prefix' to /usr, the assemblies will be located in /usr/lib.
+.PP
+/etc/mono/config, ~/.mono/config
+.IP
+Mono runtime configuration file. See the mono-config(5) manual page
+for more information.
.SH MAILING LISTS
Visit http://mail.ximian.com/mailman/mono-list for details.
.SH WEB SITE
diff --git a/mono/interpreter/mintops.c b/mono/interpreter/mintops.c
new file mode 100644
index 00000000000..5b4d69269e8
--- /dev/null
+++ b/mono/interpreter/mintops.c
@@ -0,0 +1,120 @@
+/*
+ * Utilities for handling interpreter VM instructions
+ *
+ * Authors:
+ * Bernie Solomon (bernard@ugsolutions.com)
+ *
+ */
+#include <glib.h>
+#include <stdio.h>
+#include "mintops.h"
+
+#define OPDEF(a,b,c,d) \
+ b,
+const char *mono_interp_opname[] = {
+#include "mintops.def"
+ ""
+};
+#undef OPDEF
+
+#define OPDEF(a,b,c,d) \
+ c,
+unsigned char mono_interp_oplen[] = {
+#include "mintops.def"
+ 0
+};
+#undef OPDEF
+
+
+#define OPDEF(a,b,c,d) \
+ d,
+MintOpArgType mono_interp_opargtype[] = {
+#include "mintops.def"
+ 0
+};
+#undef OPDEF
+
+const guint16 *
+mono_interp_dis_mintop(const guint16 *base, const guint16 *ip)
+{
+ int len = mono_interp_oplen [*ip];
+ guint32 token;
+ int target;
+ if (len < 0 || len > 10) {
+ g_print ("op %d len %d\n", *ip, len);
+ g_assert_not_reached ();
+ } else if (len == 0) { /* SWITCH */
+ int n = READ32 (ip + 1);
+ len = 3 + n * 2;
+ }
+
+ g_print ("IL_%04x: %-10s", ip - base, mono_interp_opname [*ip]);
+ switch (mono_interp_opargtype [*ip]) {
+ case MintOpNoArgs:
+ break;
+ case MintOpUShortInt:
+ g_print (" %u", * (guint16 *)(ip + 1));
+ break;
+ case MintOpTwoShorts:
+ g_print (" %u,%u", * (guint16 *)(ip + 1), * (guint16 *)(ip + 2));
+ break;
+ case MintOpShortAndInt:
+ g_print (" %u,%u", * (guint16 *)(ip + 1), (guint32)READ32(ip + 2));
+ break;
+ case MintOpShortInt:
+ g_print (" %d", * (short *)(ip + 1));
+ break;
+ case MintOpClassToken:
+ case MintOpMethodToken:
+ case MintOpFieldToken:
+ token = * (guint16 *)(ip + 1);
+ g_print (" %u", token);
+ break;
+ case MintOpInt:
+ g_print (" %d", (gint32)READ32 (ip + 1));
+ break;
+ case MintOpLongInt:
+ g_print (" %lld", (gint64)READ64 (ip + 1));
+ break;
+ case MintOpFloat: {
+ gint32 tmp = READ32 (ip + 1);
+ g_print (" %g", * (float *)&tmp);
+ break;
+ }
+ case MintOpDouble: {
+ gint64 tmp = READ64 (ip + 1);
+ g_print (" %g", * (double *)&tmp);
+ break;
+ }
+ case MintOpShortBranch:
+ target = ip + * (short *)(ip + 1) - base;
+ g_print (" IL_%04x", target);
+ break;
+ case MintOpBranch:
+ target = ip + (gint32)READ32 (ip + 1) - base;
+ g_print (" IL_%04x", target);
+ break;
+ case MintOpSwitch: {
+ const guint16 *p = ip + 1;
+ int sval = (gint32)READ32 (p);
+ int i;
+ p += 2;
+ g_print ("(");
+ for (i = 0; i < sval; ++i) {
+ int offset;
+ if (i > 0)
+ g_print (", ");
+ offset = (gint32)READ32 (p);
+ g_print ("IL_%04x", ip - base + 3 + 2 * sval + offset);
+ p += 2;
+ }
+ g_print (")");
+ break;
+ }
+ default:
+ g_print("unknown arg type\n");
+ }
+
+ return ip + len;
+}
+
diff --git a/mono/interpreter/mintops.def b/mono/interpreter/mintops.def
new file mode 100644
index 00000000000..5ecdbb6baa2
--- /dev/null
+++ b/mono/interpreter/mintops.def
@@ -0,0 +1,509 @@
+/*
+ * Definitions of VM instructions executed by interp.c
+ *
+ * Authors:
+ * Bernie Solomon (bernard@ugsolutions.com)
+ *
+ */
+
+/* OPDEF (opsymbol, opstring, oplength, optype) */
+
+OPDEF(MINT_NOP, "nop", 1, MintOpNoArgs)
+OPDEF(MINT_BREAK, "break", 1, MintOpNoArgs)
+OPDEF(MINT_LDNULL, "ldnull", 1, MintOpNoArgs)
+OPDEF(MINT_DUP, "dup", 1, MintOpNoArgs)
+OPDEF(MINT_DUP_VT, "dup.vt", 3, MintOpInt)
+OPDEF(MINT_POP, "pop", 1, MintOpNoArgs)
+
+OPDEF(MINT_RET, "ret", 1, MintOpNoArgs)
+OPDEF(MINT_RET_VOID, "ret.void", 1, MintOpNoArgs)
+OPDEF(MINT_RET_VT, "ret.vt", 3, MintOpInt)
+
+OPDEF(MINT_VTRESULT, "vtresult", 4, MintOpShortAndInt) /*FIX should be unsigned*/
+
+OPDEF(MINT_LDC_I4_M1, "ldc.i4.m1", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_0, "ldc.i4.0", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_1, "ldc.i4.1", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_2, "ldc.i4.2", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_3, "ldc.i4.3", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_4, "ldc.i4.4", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_5, "ldc.i4.5", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_6, "ldc.i4.6", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_7, "ldc.i4.7", 1, MintOpNoArgs)
+OPDEF(MINT_LDC_I4_8, "ldc.i4.8", 1, MintOpNoArgs)
+
+OPDEF(MINT_LDC_I4_S, "ldc.i4.s", 2, MintOpShortInt)
+OPDEF(MINT_LDC_I4, "ldc.i4", 3, MintOpInt)
+OPDEF(MINT_LDC_I8, "ldc.i8", 5, MintOpLongInt)
+
+OPDEF(MINT_LDC_R4, "ldc.r4", 3, MintOpFloat)
+OPDEF(MINT_LDC_R8, "ldc.r8", 5, MintOpDouble)
+
+OPDEF(MINT_LDARG_I1, "ldarg.i1", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_U1, "ldarg.u1", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_I2, "ldarg.i2", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_U2, "ldarg.u2", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_I4, "ldarg.i4", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_I8, "ldarg.i8", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_R4, "ldarg.r4", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_R8, "ldarg.r8", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_O, "ldarg.o", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_P, "ldarg.p", 2, MintOpUShortInt)
+OPDEF(MINT_LDARG_VT, "ldarg.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_LDTHIS, "ldthis", 1, MintOpNoArgs)
+
+OPDEF(MINT_STARG_I1, "starg.i1", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_U1, "starg.u1", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_I2, "starg.i2", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_U2, "starg.u2", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_I4, "starg.i4", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_I8, "starg.i8", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_R4, "starg.r4", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_R8, "starg.r8", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_O, "starg.o", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_P, "starg.p", 2, MintOpUShortInt)
+OPDEF(MINT_STARG_VT, "starg.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_STTHIS, "stthis", 1, MintOpNoArgs)
+
+OPDEF(MINT_STINARG_I1, "stinarg.i1", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_U1, "stinarg.u1", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_I2, "stinarg.i2", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_U2, "stinarg.u2", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_I4, "stinarg.i4", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_I8, "stinarg.i8", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_R4, "stinarg.r4", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_R8, "stinarg.r8", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_O, "stinarg.o", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_P, "stinarg.p", 2, MintOpUShortInt)
+OPDEF(MINT_STINARG_VT, "stinarg.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_LDARGA, "ldarga", 2, MintOpUShortInt)
+OPDEF(MINT_LDTHISA, "ldthisa", 1, MintOpNoArgs)
+
+OPDEF(MINT_LDFLD_I1, "ldfld.i1", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_U1, "ldfld.u1", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_I2, "ldfld.i2", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_U2, "ldfld.u2", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_I4, "ldfld.i4", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_I8, "ldfld.i8", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_R4, "ldfld.r4", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_R8, "ldfld.r8", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_O, "ldfld.o", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_P, "ldfld.p", 2, MintOpUShortInt)
+OPDEF(MINT_LDFLD_VT, "ldfld.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_LDRMFLD, "ldrmfld", 2, MintOpFieldToken)
+OPDEF(MINT_LDRMFLD_VT, "ldrmfld.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_LDFLDA, "ldflda", 2, MintOpUShortInt)
+
+OPDEF(MINT_STFLD_I1, "stfld.i1", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_U1, "stfld.u1", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_I2, "stfld.i2", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_U2, "stfld.u2", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_I4, "stfld.i4", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_I8, "stfld.i8", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_R4, "stfld.r4", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_R8, "stfld.r8", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_O, "stfld.o", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_P, "stfld.p", 2, MintOpUShortInt)
+OPDEF(MINT_STFLD_VT, "stfld.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_STRMFLD, "strmfld", 2, MintOpFieldToken)
+OPDEF(MINT_STRMFLD_VT, "strmfld.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_LDSFLD, "ldsfld", 3, MintOpTwoShorts)
+OPDEF(MINT_LDSFLD_I4, "ldsfld.i4", 3, MintOpTwoShorts)
+OPDEF(MINT_LDSFLD_O, "ldsfld.o", 3, MintOpTwoShorts)
+OPDEF(MINT_LDSFLD_VT, "ldsfld.vt", 4, MintOpShortAndInt)
+OPDEF(MINT_STSFLD, "stsfld", 2, MintOpUShortInt)
+OPDEF(MINT_STSFLD_VT, "stsfld.vt", 4, MintOpShortAndInt)
+OPDEF(MINT_LDSFLDA, "ldsflda", 2, MintOpUShortInt)
+
+OPDEF(MINT_LDLOC_I1, "ldloc.i1", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_U1, "ldloc.u1", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_I2, "ldloc.i2", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_U2, "ldloc.u2", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_I4, "ldloc.i4", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_I8, "ldloc.i8", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_R4, "ldloc.r4", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_R8, "ldloc.r8", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_O, "ldloc.o", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_P, "ldloc.p", 2, MintOpUShortInt)
+OPDEF(MINT_LDLOC_VT, "ldloc.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_STLOC_I1, "stloc.i1", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_U1, "stloc.u1", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_I2, "stloc.i2", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_U2, "stloc.u2", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_I4, "stloc.i4", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_I8, "stloc.i8", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_R4, "stloc.r4", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_R8, "stloc.r8", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_O, "stloc.o", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_P, "stloc.p", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_VT, "stloc.vt", 4, MintOpShortAndInt)
+
+OPDEF(MINT_STLOC_NP_I4, "stloc.np.i4", 2, MintOpUShortInt)
+OPDEF(MINT_STLOC_NP_O, "stloc.np.o", 2, MintOpUShortInt)
+
+OPDEF(MINT_LDLOCA_S, "ldloca.s", 2, MintOpUShortInt)
+
+OPDEF(MINT_LDIND_I1, "ldind.i1", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_U1, "ldind.u1", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_I2, "ldind.i2", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_U2, "ldind.u2", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_I4, "ldind.i4", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_U4, "ldind.u4", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_I8, "ldind.i8", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_I, "ldind.i", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_R4, "ldind.r4", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_R8, "ldind.r8", 1, MintOpNoArgs)
+OPDEF(MINT_LDIND_REF, "ldind.ref", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_I1, "stind.i1", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_I2, "stind.i2", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_I4, "stind.i4", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_I8, "stind.i8", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_I, "stind.i", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_R4, "stind.r4", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_R8, "stind.r8", 1, MintOpNoArgs)
+OPDEF(MINT_STIND_REF, "stind.ref", 1, MintOpNoArgs)
+
+OPDEF(MINT_BR, "br", 3, MintOpBranch)
+OPDEF(MINT_LEAVE, "leave", 3, MintOpBranch)
+OPDEF(MINT_BR_S, "br.s", 2, MintOpShortBranch)
+OPDEF(MINT_LEAVE_S, "leave.s", 2, MintOpShortBranch)
+
+OPDEF(MINT_THROW, "throw", 1, MintOpNoArgs)
+OPDEF(MINT_RETHROW, "rethrow", 1, MintOpNoArgs)
+OPDEF(MINT_ENDFINALLY, "endfinally", 1, MintOpNoArgs)
+
+OPDEF(MINT_BRFALSE_I4, "brfalse.i4", 3, MintOpBranch)
+OPDEF(MINT_BRFALSE_I8, "brfalse.i8", 3, MintOpBranch)
+OPDEF(MINT_BRFALSE_R8, "brfalse.r8", 3, MintOpBranch)
+OPDEF(MINT_BRTRUE_I4, "brtrue.i4", 3, MintOpBranch)
+OPDEF(MINT_BRTRUE_I8, "brtrue.i8", 3, MintOpBranch)
+OPDEF(MINT_BRTRUE_R8, "brtrue.r8", 3, MintOpBranch)
+
+OPDEF(MINT_BRFALSE_I4_S, "brfalse.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BRFALSE_I8_S, "brfalse.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BRFALSE_R8_S, "brfalse.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BRTRUE_I4_S, "brtrue.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BRTRUE_I8_S, "brtrue.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BRTRUE_R8_S, "brtrue.r8.s", 2, MintOpShortBranch)
+
+OPDEF(MINT_BEQ_I4, "beq.i4", 3, MintOpBranch)
+OPDEF(MINT_BEQ_I8, "beq.i8", 3, MintOpBranch)
+OPDEF(MINT_BEQ_R8, "beq.r8", 3, MintOpBranch)
+OPDEF(MINT_BGE_I4, "bge.i4", 3, MintOpBranch)
+OPDEF(MINT_BGE_I8, "bge.i8", 3, MintOpBranch)
+OPDEF(MINT_BGE_R8, "bge.r8", 3, MintOpBranch)
+OPDEF(MINT_BGT_I4, "bgt.i4", 3, MintOpBranch)
+OPDEF(MINT_BGT_I8, "bgt.i8", 3, MintOpBranch)
+OPDEF(MINT_BGT_R8, "bgt.r8", 3, MintOpBranch)
+OPDEF(MINT_BLT_I4, "blt.i4", 3, MintOpBranch)
+OPDEF(MINT_BLT_I8, "blt.i8", 3, MintOpBranch)
+OPDEF(MINT_BLT_R8, "blt.r8", 3, MintOpBranch)
+OPDEF(MINT_BLE_I4, "ble.i4", 3, MintOpBranch)
+OPDEF(MINT_BLE_I8, "ble.i8", 3, MintOpBranch)
+OPDEF(MINT_BLE_R8, "ble.r8", 3, MintOpBranch)
+
+OPDEF(MINT_BNE_UN_I4, "bne.un.i4", 3, MintOpBranch)
+OPDEF(MINT_BNE_UN_I8, "bne.un.i8", 3, MintOpBranch)
+OPDEF(MINT_BNE_UN_R8, "bne.un.r8", 3, MintOpBranch)
+OPDEF(MINT_BGE_UN_I4, "bge.un.i4", 3, MintOpBranch)
+OPDEF(MINT_BGE_UN_I8, "bge.un.i8", 3, MintOpBranch)
+OPDEF(MINT_BGE_UN_R8, "bge.un.r8", 3, MintOpBranch)
+OPDEF(MINT_BGT_UN_I4, "bgt.un.i4", 3, MintOpBranch)
+OPDEF(MINT_BGT_UN_I8, "bgt.un.i8", 3, MintOpBranch)
+OPDEF(MINT_BGT_UN_R8, "bgt.un.r8", 3, MintOpBranch)
+OPDEF(MINT_BLE_UN_I4, "ble.un.i4", 3, MintOpBranch)
+OPDEF(MINT_BLE_UN_I8, "ble.un.i8", 3, MintOpBranch)
+OPDEF(MINT_BLE_UN_R8, "ble.un.r8", 3, MintOpBranch)
+OPDEF(MINT_BLT_UN_I4, "blt.un.i4", 3, MintOpBranch)
+OPDEF(MINT_BLT_UN_I8, "blt.un.i8", 3, MintOpBranch)
+OPDEF(MINT_BLT_UN_R8, "blt.un.r8", 3, MintOpBranch)
+
+OPDEF(MINT_BEQ_I4_S, "beq.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BEQ_I8_S, "beq.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BEQ_R8_S, "beq.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGE_I4_S, "bge.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGE_I8_S, "bge.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGE_R8_S, "bge.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGT_I4_S, "bgt.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGT_I8_S, "bgt.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGT_R8_S, "bgt.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLT_I4_S, "blt.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLT_I8_S, "blt.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLT_R8_S, "blt.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLE_I4_S, "ble.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLE_I8_S, "ble.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLE_R8_S, "ble.r8.s", 2, MintOpShortBranch)
+
+OPDEF(MINT_BNE_UN_I4_S, "bne.un.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BNE_UN_I8_S, "bne.un.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BNE_UN_R8_S, "bne.un.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGE_UN_I4_S, "bge.un.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGE_UN_I8_S, "bge.un.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGE_UN_R8_S, "bge.un.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGT_UN_I4_S, "bgt.un.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGT_UN_I8_S, "bgt.un.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BGT_UN_R8_S, "bgt.un.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLE_UN_I4_S, "ble.un.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLE_UN_I8_S, "ble.un.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLE_UN_R8_S, "ble.un.r8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLT_UN_I4_S, "blt.un.i4.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLT_UN_I8_S, "blt.un.i8.s", 2, MintOpShortBranch)
+OPDEF(MINT_BLT_UN_R8_S, "blt.un.r8.s", 2, MintOpShortBranch)
+
+OPDEF(MINT_SWITCH, "switch", 0, MintOpSwitch)
+
+OPDEF(MINT_LDSTR, "ldstr", 2, MintOpMethodToken) /* not really */
+
+OPDEF(MINT_CALL, "call", 2, MintOpMethodToken)
+OPDEF(MINT_VCALL, "vcall", 2, MintOpMethodToken)
+OPDEF(MINT_CALLVIRT, "callvirt", 2, MintOpMethodToken)
+OPDEF(MINT_VCALLVIRT, "vcallvirt", 2, MintOpMethodToken)
+OPDEF(MINT_CALLI, "calli", 2, MintOpMethodToken)
+OPDEF(MINT_CALLI_NAT, "calli.nat", 2, MintOpMethodToken)
+OPDEF(MINT_JMP, "jmp", 2, MintOpMethodToken)
+
+OPDEF(MINT_CALLINT, "callint", 1, MintOpNoArgs)
+OPDEF(MINT_CALLRUN, "callrun", 1, MintOpNoArgs)
+
+OPDEF(MINT_NEWOBJ, "newobj", 2, MintOpMethodToken)
+OPDEF(MINT_INITOBJ, "initobj", 3, MintOpInt)
+OPDEF(MINT_CASTCLASS, "castclass", 2, MintOpClassToken)
+OPDEF(MINT_ISINST, "isinst", 2, MintOpClassToken)
+OPDEF(MINT_NEWARR, "newarr", 2, MintOpClassToken)
+OPDEF(MINT_BOX, "box", 2, MintOpClassToken)
+OPDEF(MINT_UNBOX, "unbox", 2, MintOpClassToken)
+OPDEF(MINT_LDTOKEN, "ldtoken", 2, MintOpClassToken) /* not really */
+OPDEF(MINT_LDFTN, "ldftn", 2, MintOpMethodToken)
+OPDEF(MINT_LDVIRTFTN, "ldvirtftn", 2, MintOpMethodToken)
+OPDEF(MINT_LDOBJ, "ldobj", 2, MintOpClassToken)
+OPDEF(MINT_STOBJ, "stobj", 2, MintOpClassToken)
+OPDEF(MINT_STOBJ_VT, "stobj.vt", 2, MintOpClassToken)
+OPDEF(MINT_CPBLK, "cpblk", 1, MintOpNoArgs)
+OPDEF(MINT_INITBLK, "initblk", 1, MintOpNoArgs)
+OPDEF(MINT_LOCALLOC, "localloc", 1, MintOpNoArgs)
+OPDEF(MINT_INITLOCALS, "initlocals", 1, MintOpNoArgs)
+
+OPDEF(MINT_LDELEM_I, "ldelem.i", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_I1, "ldelem.i1", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_U1, "ldelem.u1", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_I2, "ldelem.i2", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_U2, "ldelem.u2", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_I4, "ldelem.i4", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_U4, "ldelem.u4", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_I8, "ldelem.i8", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_R4, "ldelem.r4", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_R8, "ldelem.r8", 1, MintOpNoArgs)
+OPDEF(MINT_LDELEM_REF, "ldelem.ref", 1, MintOpNoArgs)
+
+OPDEF(MINT_LDELEMA, "ldelema", 2, MintOpClassToken)
+
+OPDEF(MINT_STELEM_I, "stelem.i", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_I1, "stelem.i1", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_I2, "stelem.i2", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_I4, "stelem.i4", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_I8, "stelem.i8", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_R4, "stelem.r4", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_R8, "stelem.r8", 1, MintOpNoArgs)
+OPDEF(MINT_STELEM_REF, "stelem.ref", 1, MintOpNoArgs)
+
+OPDEF(MINT_LDLEN, "ldlen", 1, MintOpNoArgs)
+
+OPDEF(MINT_ADD_I4, "add.i4", 1, MintOpNoArgs)
+OPDEF(MINT_ADD_I8, "add.i8", 1, MintOpNoArgs)
+OPDEF(MINT_ADD_R8, "add.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_ADD1_I4, "add1.i4", 1, MintOpNoArgs)
+
+OPDEF(MINT_SUB_I4, "sub.i4", 1, MintOpNoArgs)
+OPDEF(MINT_SUB_I8, "sub.i8", 1, MintOpNoArgs)
+OPDEF(MINT_SUB_R8, "sub.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_SUB1_I4, "sub1.i4", 1, MintOpNoArgs)
+
+OPDEF(MINT_MUL_I4, "mul.i4", 1, MintOpNoArgs)
+OPDEF(MINT_MUL_I8, "mul.i8", 1, MintOpNoArgs)
+OPDEF(MINT_MUL_R8, "mul.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_DIV_I4, "div.i4", 1, MintOpNoArgs)
+OPDEF(MINT_DIV_I8, "div.i8", 1, MintOpNoArgs)
+OPDEF(MINT_DIV_R8, "div.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_DIV_UN_I4, "div.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_DIV_UN_I8, "div.un.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_ADD_OVF_I4, "add.ovf.i4", 1, MintOpNoArgs)
+OPDEF(MINT_ADD_OVF_I8, "add.ovf.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_ADD_OVF_UN_I4, "add.ovf.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_ADD_OVF_UN_I8, "add.ovf.un.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_MUL_OVF_I4, "mul.ovf.i4", 1, MintOpNoArgs)
+OPDEF(MINT_MUL_OVF_I8, "mul.ovf.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_MUL_OVF_UN_I4, "mul.ovf.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_MUL_OVF_UN_I8, "mul.ovf.un.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_SUB_OVF_I4, "sub.ovf.i4", 1, MintOpNoArgs)
+OPDEF(MINT_SUB_OVF_I8, "sub.ovf.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_SUB_OVF_UN_I4, "sub.ovf.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_SUB_OVF_UN_I8, "sub.ovf.un.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_NEG_I4, "neg.i4", 1, MintOpNoArgs)
+OPDEF(MINT_NEG_I8, "neg.i8", 1, MintOpNoArgs)
+OPDEF(MINT_NEG_R8, "neg.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_NOT_I4, "not.i4", 1, MintOpNoArgs)
+OPDEF(MINT_NOT_I8, "not.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_AND_I4, "and.i4", 1, MintOpNoArgs)
+OPDEF(MINT_AND_I8, "and.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_OR_I4, "or.i4", 1, MintOpNoArgs)
+OPDEF(MINT_OR_I8, "or.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_XOR_I4, "xor.i4", 1, MintOpNoArgs)
+OPDEF(MINT_XOR_I8, "xor.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_REM_I4, "rem.i4", 1, MintOpNoArgs)
+OPDEF(MINT_REM_I8, "rem.i8", 1, MintOpNoArgs)
+OPDEF(MINT_REM_R8, "rem.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_REM_UN_I4, "rem.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_REM_UN_I8, "rem.un.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_SHR_UN_I4, "shr.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_SHR_UN_I8, "shr.un.i8", 1, MintOpNoArgs)
+OPDEF(MINT_SHL_I4, "shl.i4", 1, MintOpNoArgs)
+OPDEF(MINT_SHL_I8, "shl.i8", 1, MintOpNoArgs)
+OPDEF(MINT_SHR_I4, "shr.i4", 1, MintOpNoArgs)
+OPDEF(MINT_SHR_I8, "shr.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_R_UN_I4, "conv.r.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_R_UN_I8, "conv.r.un.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_I1_I4, "conv.i1.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_I1_I8, "conv.i1.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_I1_R8, "conv.i1.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_U1_I4, "conv.u1.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_U1_I8, "conv.u1.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_U1_R8, "conv.u1.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_I2_I4, "conv.i2.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_I2_I8, "conv.i2.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_I2_R8, "conv.i2.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_U2_I4, "conv.u2.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_U2_I8, "conv.u2.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_U2_R8, "conv.u2.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_I4_I8, "conv.i4.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_I4_R8, "conv.i4.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_U4_I8, "conv.u4.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_U4_R8, "conv.u4.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_I8_I4, "conv.i8.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_I8_U4, "conv.i8.u4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_I8_R8, "conv.i8.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_R4_I4, "conv.r4.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_R4_I8, "conv.r4.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_R4_R8, "conv.r4.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_R8_I4, "conv.r8.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_R8_I8, "conv.r8.i8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_I4_I8_SP, "conv.i4.i8.sp", 1, MintOpNoArgs) /* special for narrowing sp[-2] on 64 bits */
+OPDEF(MINT_CONV_I8_I4_SP, "conv.i8.i4.sp", 1, MintOpNoArgs) /* special for widening sp[-2] on 64 bits */
+
+OPDEF(MINT_CONV_U8_I4, "conv.u8.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_U8_R8, "conv.u8.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_I1_I4, "conv.ovf.i1.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_I1_I8, "conv.ovf.i1.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_I1_R8, "conv.ovf.i1.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_U1_I4, "conv.ovf.u1.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_U1_I8, "conv.ovf.u1.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_U1_R8, "conv.ovf.u1.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_I2_I4, "conv.ovf.i2.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_I2_I8, "conv.ovf.i2.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_I2_R8, "conv.ovf.i2.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_U2_I4, "conv.ovf.u2.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_U2_I8, "conv.ovf.u2.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_U2_R8, "conv.ovf.u2.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_I4_U4, "conv.ovf.i4.u4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_I4_I8, "conv.ovf.i4.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_I4_R8, "conv.ovf.i4.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_I4_UN_I8, "conv.ovf.i4.un.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_I4_UN_R8, "conv.ovf.i4.un.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_U4_I4, "conv.ovf.u4.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_U4_I8, "conv.ovf.u4.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_U4_R8, "conv.ovf.u4.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_I8_R8, "conv.ovf.i8.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_I8_UN_R8, "conv.ovf.i8.un.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CONV_OVF_U8_I4, "conv.ovf.u8.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CONV_OVF_U8_R8, "conv.ovf.u8.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CEQ_I4, "ceq.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CEQ_I8, "ceq.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CEQ_R8, "ceq.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CEQ0_I4, "ceq0.i4", 1, MintOpNoArgs)
+
+OPDEF(MINT_CGT_I4, "cgt.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CGT_I8, "cgt.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CGT_R8, "cgt.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CGT_UN_I4, "cgt.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CGT_UN_I8, "cgt.un.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CGT_UN_R8, "cgt.un.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CLT_I4, "clt.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CLT_I8, "clt.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CLT_R8, "clt.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CLT_UN_I4, "clt.un.i4", 1, MintOpNoArgs)
+OPDEF(MINT_CLT_UN_I8, "clt.un.i8", 1, MintOpNoArgs)
+OPDEF(MINT_CLT_UN_R8, "clt.un.r8", 1, MintOpNoArgs)
+
+OPDEF(MINT_CKFINITE, "ckfinite", 1, MintOpNoArgs)
+
+OPDEF(MINT_CKNULL, "cknull", 1, MintOpNoArgs)
+
+OPDEF(MINT_GETCHR, "getchr", 1, MintOpNoArgs)
+OPDEF(MINT_STRLEN, "strlen", 1, MintOpNoArgs)
+OPDEF(MINT_ARRAY_RANK, "array_rank", 1, MintOpNoArgs)
+
+OPDEF(MINT_ICALL_P_V, "mono_icall_p_v", 2, MintOpClassToken) /* not really */
+OPDEF(MINT_ICALL_P_P, "mono_icall_p_p", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PP_V, "mono_icall_pp_v", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PI_V, "mono_icall_pi_v", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PP_P, "mono_icall_pp_p", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PI_P, "mono_icall_pi_p", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PPP_V, "mono_icall_ppp_v", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PPI_V, "mono_icall_ppi_v", 2, MintOpClassToken)
+OPDEF(MINT_MONO_LDPTR, "mono_ldptr", 2, MintOpClassToken)
+OPDEF(MINT_MONO_NEWOBJ, "mono_newobj", 2, MintOpClassToken)
+OPDEF(MINT_MONO_RETOBJ, "mono_retobj", 1, MintOpNoArgs)
+OPDEF(MINT_MONO_FREE, "mono_free", 1, MintOpNoArgs)
+
+
diff --git a/mono/interpreter/mintops.h b/mono/interpreter/mintops.h
new file mode 100644
index 00000000000..e787526e2fe
--- /dev/null
+++ b/mono/interpreter/mintops.h
@@ -0,0 +1,58 @@
+#ifndef __INTERPRETER_MINTOPS_H
+#define __INTERPRETER_MINTOPS_H
+
+#include <glib.h>
+
+typedef enum
+{
+ MintOpNoArgs,
+ MintOpShortInt,
+ MintOpUShortInt,
+ MintOpInt,
+ MintOpLongInt,
+ MintOpFloat,
+ MintOpDouble,
+ MintOpBranch,
+ MintOpShortBranch,
+ MintOpSwitch,
+ MintOpMethodToken,
+ MintOpFieldToken,
+ MintOpClassToken,
+ MintOpTwoShorts,
+ MintOpShortAndInt
+} MintOpArgType;
+
+#define OPDEF(a,b,c,d) \
+ a,
+enum {
+#include "mintops.def"
+ MINT_LASTOP
+};
+#undef OPDEF
+
+#if NO_UNALIGNED_ACCESS
+# if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define READ32(x) (((guint16 *)(x)) [0] | ((guint16 *)(x)) [1] << 16)
+#define READ64(x) ((guint64)((guint16 *)(x)) [0] | \
+ (guint64)((guint16 *)(x)) [1] << 16 | \
+ (guint64)((guint16 *)(x)) [2] << 32 | \
+ (guint64)((guint16 *)(x)) [3] << 48)
+# else
+#define READ32(x) (((guint16 *)(x)) [0] << 16 | ((guint16 *)(x)) [1])
+#define READ64(x) ((guint64)((guint16 *)(x)) [0] << 48 | \
+ (guint64)((guint16 *)(x)) [1] << 32 | \
+ (guint64)((guint16 *)(x)) [2] << 16 | \
+ (guint64)((guint16 *)(x)) [3])
+# endif
+#else /* unaligned access OK */
+#define READ32(x) (*(guint32 *)(x))
+#define READ64(x) (*(guint64 *)(x))
+#endif
+
+extern const char *mono_interp_opname[];
+extern unsigned char mono_interp_oplen[];
+extern MintOpArgType mono_interp_opargtype[];
+extern const guint16 *mono_interp_dis_mintop(const unsigned short *base, const guint16 *ip);
+
+#endif
+
diff --git a/mono/interpreter/transform.c b/mono/interpreter/transform.c
new file mode 100644
index 00000000000..34f8a89ac59
--- /dev/null
+++ b/mono/interpreter/transform.c
@@ -0,0 +1,3041 @@
+/*
+ * transform CIL into different opcodes for more
+ * efficient interpretation
+ *
+ * Written by Bernie Solomon (bernard@ugsolutions.com)
+ * Copyright (c) 2004.
+ */
+
+#include <string.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/mono-endian.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/profiler-private.h>
+#include <mono/metadata/tabledefs.h>
+
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
+ a = i,
+
+enum {
+#include "mono/cil/opcode.def"
+ CEE_LASTOP
+};
+#undef OPDEF
+
+#include "mintops.h"
+#include "interp.h"
+
+#define DEBUG 0
+
+typedef struct
+{
+ MonoClass *klass;
+ unsigned char type;
+ unsigned char flags;
+} StackInfo;
+
+typedef struct
+{
+ MonoMethod *method;
+ MonoMethodHeader *header;
+ RuntimeMethod *rtm;
+ const unsigned char *il_code;
+ const unsigned char *ip;
+ const unsigned char *last_ip;
+ const unsigned char *in_start;
+ int code_size;
+ int *in_offsets;
+ int *forward_refs;
+ StackInfo **stack_state;
+ int *stack_height;
+ int *vt_stack_size;
+ unsigned char *is_bb_start;
+ unsigned short *new_code;
+ unsigned short *new_code_end;
+ unsigned short *new_ip;
+ unsigned short *last_new_ip;
+ unsigned int max_code_size;
+ StackInfo *stack;
+ StackInfo *sp;
+ unsigned int max_stack_height;
+ unsigned int vt_sp;
+ unsigned int max_vt_sp;
+ int n_data_items;
+ int max_data_items;
+ void **data_items;
+ GHashTable *data_hash;
+} TransformData;
+
+#define MINT_TYPE_I1 0
+#define MINT_TYPE_U1 1
+#define MINT_TYPE_I2 2
+#define MINT_TYPE_U2 3
+#define MINT_TYPE_I4 4
+#define MINT_TYPE_I8 5
+#define MINT_TYPE_R4 6
+#define MINT_TYPE_R8 7
+#define MINT_TYPE_O 8
+#define MINT_TYPE_P 9
+#define MINT_TYPE_VT 10
+
+#define STACK_TYPE_I4 0
+#define STACK_TYPE_I8 1
+#define STACK_TYPE_R8 2
+#define STACK_TYPE_O 3
+#define STACK_TYPE_VT 4
+#define STACK_TYPE_MP 5
+#define STACK_TYPE_F 6
+
+static const char *stack_type_string [] = { "I4", "I8", "R8", "O ", "VT", "MP", "F " };
+
+#if SIZEOF_VOID_P == 8
+#define STACK_TYPE_I STACK_TYPE_I8
+#else
+#define STACK_TYPE_I STACK_TYPE_I4
+#endif
+
+static int stack_type [] = {
+ STACK_TYPE_I4, /*I1*/
+ STACK_TYPE_I4, /*U1*/
+ STACK_TYPE_I4, /*I2*/
+ STACK_TYPE_I4, /*U2*/
+ STACK_TYPE_I4, /*I4*/
+ STACK_TYPE_I8, /*I8*/
+ STACK_TYPE_R8, /*R4*/
+ STACK_TYPE_R8, /*R8*/
+ STACK_TYPE_O, /*O*/
+ STACK_TYPE_MP, /*P*/
+ STACK_TYPE_VT
+};
+
+static void
+grow_code (TransformData *td)
+{
+ unsigned int old_ip_offset = td->new_ip - td->new_code;
+ unsigned int old_last_ip_offset = td->last_new_ip - td->new_code;
+ g_assert (old_ip_offset <= td->max_code_size);
+ td->new_code = g_realloc (td->new_code, (td->max_code_size *= 2) * sizeof (td->new_code [0]));
+ td->new_code_end = td->new_code + td->max_code_size;
+ td->new_ip = td->new_code + old_ip_offset;
+ td->last_new_ip = td->new_code + old_last_ip_offset;
+}
+
+#define ENSURE_CODE(td, n) \
+ do { \
+ if ((td)->new_ip + (n) > (td)->new_code_end) \
+ grow_code (td); \
+ } while (0)
+
+#define ADD_CODE(td, n) \
+ do { \
+ if ((td)->new_ip == (td)->new_code_end) \
+ grow_code (td); \
+ *(td)->new_ip++ = (n); \
+ } while (0)
+
+#define CHECK_STACK(td, n) \
+ do { \
+ int stack_size = (td)->sp - (td)->stack; \
+ if (stack_size < (n)) \
+ g_warning ("%s.%s: not enough values (%d < %d) on stack at %04x", \
+ (td)->method->klass->name, (td)->method->name, \
+ stack_size, n, (td)->ip - (td)->il_code); \
+ } while (0)
+
+#define ENSURE_I4(td, sp_off) \
+ do { \
+ if ((td)->sp [-sp_off].type == STACK_TYPE_I8) \
+ ADD_CODE(td, sp_off == 1 ? MINT_CONV_I4_I8 : MINT_CONV_I4_I8_SP); \
+ } while (0)
+
+static void
+handle_branch(TransformData *td, int short_op, int long_op, int offset)
+{
+ int shorten_branch = 0;
+ int target = td->ip + offset - td->il_code;
+ if (target < 0 || target >= td->code_size)
+ g_assert_not_reached ();
+ if (offset > 0 && td->stack_height [target] < 0) {
+ td->stack_height [target] = td->sp - td->stack;
+ if (td->stack_height [target] > 0)
+ td->stack_state [target] = g_memdup (td->stack, td->stack_height [target] * sizeof (td->stack [0]));
+ td->vt_stack_size [target] = td->vt_sp;
+ }
+ if (offset < 0) {
+ offset = td->in_offsets [target] - (td->new_ip - td->new_code);
+ if (offset >= -32768) {
+ shorten_branch = 1;
+ }
+ } else {
+ int prev = td->forward_refs [target];
+ td->forward_refs [td->ip - td->il_code] = prev;
+ td->forward_refs [target] = td->ip - td->il_code;
+ offset = 0;
+ if (td->header->code_size <= 25000) /* FIX to be precise somehow? */
+ shorten_branch = 1;
+ }
+ if (shorten_branch) {
+ ADD_CODE(td, short_op);
+ ADD_CODE(td, offset);
+ } else {
+ ADD_CODE(td, long_op);
+ ADD_CODE(td, * (unsigned short *)(&offset));
+ ADD_CODE(td, * ((unsigned short *)&offset + 1));
+ }
+}
+
+static void
+one_arg_branch(TransformData *td, int mint_op, int offset)
+{
+ int type = td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-1].type;
+ int long_op = mint_op + type - STACK_TYPE_I4;
+ int short_op = long_op + MINT_BRFALSE_I4_S - MINT_BRFALSE_I4;
+ CHECK_STACK(td, 1);
+ --td->sp;
+ handle_branch (td, short_op, long_op, offset);
+}
+
+static void
+two_arg_branch(TransformData *td, int mint_op, int offset)
+{
+ int type1 = td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-1].type;
+ int type2 = td->sp [-2].type == STACK_TYPE_O || td->sp [-2].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-2].type;
+ int long_op = mint_op + type1 - STACK_TYPE_I4;
+ int short_op = long_op + MINT_BEQ_I4_S - MINT_BEQ_I4;
+ CHECK_STACK(td, 2);
+ if (type1 == STACK_TYPE_I4 && type2 == STACK_TYPE_I8) {
+ ADD_CODE(td, MINT_CONV_I8_I4);
+ td->in_offsets [td->ip - td->il_code]++;
+ } else if (type1 == STACK_TYPE_I8 && type2 == STACK_TYPE_I4) {
+ ADD_CODE(td, MINT_CONV_I8_I4_SP);
+ td->in_offsets [td->ip - td->il_code]++;
+ } else if (type1 != type2) {
+ g_warning("%s.%s: branch type mismatch %d %d",
+ td->method->klass->name, td->method->name,
+ td->sp [-1].type, td->sp [-2].type);
+ }
+ td->sp -= 2;
+ handle_branch (td, short_op, long_op, offset);
+}
+
+static void
+unary_arith_op(TransformData *td, int mint_op)
+{
+ int op = mint_op + td->sp [-1].type - STACK_TYPE_I4;
+ CHECK_STACK(td, 1);
+ ADD_CODE(td, op);
+}
+
+static void
+binary_arith_op(TransformData *td, int mint_op)
+{
+ int type1 = td->sp [-2].type;
+ int type2 = td->sp [-1].type;
+ int op;
+#if SIZEOF_VOID_P == 8
+ if ((type1 == STACK_TYPE_MP || type1 == STACK_TYPE_I8) && type2 == STACK_TYPE_I4) {
+ ADD_CODE(td, MINT_CONV_I8_I4);
+ type2 = STACK_TYPE_I8;
+ }
+ if (type1 == STACK_TYPE_I4 && (type2 == STACK_TYPE_MP || type2 == STACK_TYPE_I8)) {
+ ADD_CODE(td, MINT_CONV_I8_I4_SP);
+ type1 = STACK_TYPE_I8;
+ td->sp [-2].type = STACK_TYPE_I8;
+ }
+#endif
+ if (type1 == STACK_TYPE_MP)
+ type1 = STACK_TYPE_I;
+ if (type2 == STACK_TYPE_MP)
+ type2 = STACK_TYPE_I;
+ if (type1 != type2) {
+ g_warning("%s.%s: %04x arith type mismatch %s %d %d",
+ td->method->klass->name, td->method->name,
+ td->ip - td->il_code, mono_interp_opname[mint_op], type1, type2);
+ }
+ op = mint_op + type1 - STACK_TYPE_I4;
+ CHECK_STACK(td, 2);
+ ADD_CODE(td, op);
+ --td->sp;
+}
+
+static void
+binary_int_op(TransformData *td, int mint_op)
+{
+ int op = mint_op + td->sp [-1].type - STACK_TYPE_I4;
+ CHECK_STACK(td, 2);
+ if (td->sp [-1].type != td->sp [-2].type)
+ g_warning("%s.%s: int type mismatch", td->method->klass->name, td->method->name);
+ ADD_CODE(td, op);
+ --td->sp;
+}
+
+static void
+shift_op(TransformData *td, int mint_op)
+{
+ int op = mint_op + td->sp [-2].type - STACK_TYPE_I4;
+ CHECK_STACK(td, 2);
+ if (td->sp [-1].type != STACK_TYPE_I4) {
+ g_warning("%s.%s: shift type mismatch %d",
+ td->method->klass->name, td->method->name,
+ td->sp [-2].type);
+ }
+ ADD_CODE(td, op);
+ --td->sp;
+}
+
+static int
+mint_type(MonoType *type)
+{
+ if (type->byref)
+ return MINT_TYPE_P;
+enum_type:
+ switch (type->type) {
+ case MONO_TYPE_I1:
+ return MINT_TYPE_I1;
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ return MINT_TYPE_U1;
+ case MONO_TYPE_I2:
+ return MINT_TYPE_I2;
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ return MINT_TYPE_U2;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ return MINT_TYPE_I4;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#if SIZEOF_VOID_P == 4
+ return MINT_TYPE_I4;
+#else
+ return MINT_TYPE_I8;
+#endif
+ case MONO_TYPE_PTR:
+ return MINT_TYPE_P;
+ case MONO_TYPE_R4:
+ return MINT_TYPE_R4;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ return MINT_TYPE_I8;
+ case MONO_TYPE_R8:
+ return MINT_TYPE_R8;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_ARRAY:
+ return MINT_TYPE_O;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto enum_type;
+ } else
+ return MINT_TYPE_VT;
+ default:
+ g_warning ("got type 0x%02x", type->type);
+ g_assert_not_reached ();
+ }
+ return -1;
+}
+
+static int
+can_store (int stack_type, int var_type)
+{
+ if (stack_type == STACK_TYPE_O || stack_type == STACK_TYPE_MP)
+ stack_type = STACK_TYPE_I;
+ if (var_type == STACK_TYPE_O || var_type == STACK_TYPE_MP)
+ var_type = STACK_TYPE_I;
+ return stack_type == var_type;
+}
+
+#define SET_SIMPLE_TYPE(s, ty) \
+ do { \
+ (s)->type = (ty); \
+ (s)->flags = 0; \
+ (s)->klass = NULL; \
+ } while (0)
+
+#define SET_TYPE(s, ty, k) \
+ do { \
+ (s)->type = (ty); \
+ (s)->flags = 0; \
+ (s)->klass = k; \
+ } while (0)
+
+#define PUSH_SIMPLE_TYPE(td, ty) \
+ do { \
+ int sp_height; \
+ (td)->sp++; \
+ sp_height = (td)->sp - (td)->stack; \
+ if (sp_height > (td)->max_stack_height) \
+ (td)->max_stack_height = sp_height; \
+ SET_SIMPLE_TYPE((td)->sp - 1, ty); \
+ } while (0)
+
+#define PUSH_TYPE(td, ty, k) \
+ do { \
+ int sp_height; \
+ (td)->sp++; \
+ sp_height = (td)->sp - (td)->stack; \
+ if (sp_height > (td)->max_stack_height) \
+ (td)->max_stack_height = sp_height; \
+ SET_TYPE((td)->sp - 1, ty, k); \
+ } while (0)
+
+#define PUSH_VT(td, size) \
+ do { \
+ (td)->vt_sp += ((size) + 7) & ~7; \
+ if ((td)->vt_sp > (td)->max_vt_sp) \
+ (td)->max_vt_sp = (td)->vt_sp; \
+ } while (0)
+
+#define POP_VT(td, size) \
+ do { \
+ (td)->vt_sp -= ((size) + 7) & ~7; \
+ } while (0)
+
+#if NO_UNALIGNED_ACCESS
+#define WRITE32(td, v) \
+ do { \
+ ENSURE_CODE(td, 2); \
+ * (guint16 *)((td)->new_ip) = * (guint16 *)(v); \
+ * ((guint16 *)((td)->new_ip) + 1) = * ((guint16 *)(v) + 1); \
+ (td)->new_ip += 2; \
+ } while (0)
+
+#define WRITE64(td, v) \
+ do { \
+ ENSURE_CODE(td, 4); \
+ * (guint16 *)((td)->new_ip) = * (guint16 *)(v); \
+ * ((guint16 *)((td)->new_ip) + 1) = * ((guint16 *)(v) + 1); \
+ * ((guint16 *)((td)->new_ip) + 2) = * ((guint16 *)(v) + 2); \
+ * ((guint16 *)((td)->new_ip) + 3) = * ((guint16 *)(v) + 3); \
+ (td)->new_ip += 4; \
+ } while (0)
+#else
+#define WRITE32(td, v) \
+ do { \
+ ENSURE_CODE(td, 2); \
+ * (guint32 *)((td)->new_ip) = * (guint32 *)(v); \
+ (td)->new_ip += 2; \
+ } while (0)
+
+#define WRITE64(td, v) \
+ do { \
+ ENSURE_CODE(td, 4); \
+ * (guint64 *)((td)->new_ip) = * (guint64 *)(v); \
+ (td)->new_ip += 4; \
+ } while (0)
+
+#endif
+
+static void
+load_arg(TransformData *td, int n)
+{
+ int mt;
+ MonoClass *klass = NULL;
+ if (n == 0 && td->method->signature->hasthis) {
+ if (td->method->klass->valuetype)
+ mt = MINT_TYPE_P;
+ else {
+ mt = MINT_TYPE_O;
+ klass = td->method->klass;
+ }
+ ADD_CODE(td, MINT_LDTHIS);
+ } else {
+ MonoType *type;
+ n -= td->method->signature->hasthis;
+ type = td->method->signature->params [n];
+ mt = mint_type (type);
+ if (mt == MINT_TYPE_VT) {
+ gint32 size;
+ if (td->method->signature->pinvoke)
+ size = mono_class_native_size (type->data.klass, NULL);
+ else
+ size = mono_class_value_size (type->data.klass, NULL);
+ PUSH_VT(td, size);
+ ADD_CODE(td, MINT_LDARG_VT);
+ ADD_CODE(td, td->rtm->arg_offsets [n]); /* FIX for large offset */
+ WRITE32(td, &size);
+ klass = type->data.klass;
+ } else {
+ ADD_CODE(td, MINT_LDARG_I1 + (mt - MINT_TYPE_I1));
+ ADD_CODE(td, td->rtm->arg_offsets [n]); /* FIX for large offset */
+ if (mt == MINT_TYPE_O)
+ klass = mono_class_from_mono_type (type);
+ }
+ }
+ PUSH_TYPE(td, stack_type[mt], klass);
+}
+
+static void
+store_arg(TransformData *td, int n)
+{
+ int mt;
+ CHECK_STACK (td, 1);
+ if (n == 0 && td->method->signature->hasthis)
+ ADD_CODE(td, MINT_STTHIS);
+ else {
+ MonoType *type;
+ n -= td->method->signature->hasthis;
+ type = td->method->signature->params [n];
+ mt = mint_type (type);
+ if (mt == MINT_TYPE_VT) {
+ gint32 size;
+ if (td->method->signature->pinvoke)
+ size = mono_class_native_size (type->data.klass, NULL);
+ else
+ size = mono_class_value_size (type->data.klass, NULL);
+ ADD_CODE(td, MINT_STARG_VT);
+ ADD_CODE(td, n);
+ WRITE32(td, &size);
+ if (td->sp [-1].type == STACK_TYPE_VT)
+ POP_VT(td, size);
+ } else {
+ ADD_CODE(td, MINT_STARG_I1 + (mt - MINT_TYPE_I1));
+ ADD_CODE(td, td->rtm->arg_offsets [n]);
+ }
+ }
+ --td->sp;
+}
+
+static void
+store_inarg(TransformData *td, int n)
+{
+ MonoType *type = td->method->signature->params [n];
+ int mt = mint_type (type);
+ if (mt == MINT_TYPE_VT) {
+ gint32 size;
+ if (td->method->signature->pinvoke)
+ size = mono_class_native_size (type->data.klass, NULL);
+ else
+ size = mono_class_value_size (type->data.klass, NULL);
+ ADD_CODE(td, MINT_STINARG_VT);
+ ADD_CODE(td, n);
+ WRITE32(td, &size);
+ } else {
+ ADD_CODE(td, MINT_STINARG_I1 + (mt - MINT_TYPE_I1));
+ ADD_CODE(td, n);
+ }
+}
+
+static void
+load_local(TransformData *td, int n)
+{
+ MonoType *type = td->header->locals [n];
+ int mt = mint_type (type);
+ int offset = td->rtm->local_offsets [n];
+ MonoClass *klass = NULL;
+ if (mt == MINT_TYPE_VT) {
+ gint32 size = mono_class_value_size (type->data.klass, NULL);
+ PUSH_VT(td, size);
+ ADD_CODE(td, MINT_LDLOC_VT);
+ ADD_CODE(td, offset); /*FIX for large offset */
+ WRITE32(td, &size);
+ klass = type->data.klass;
+ } else {
+ if (mt == MINT_TYPE_I4 && !td->is_bb_start [td->in_start - td->il_code] && td->last_new_ip != NULL &&
+ td->last_new_ip [0] == MINT_STLOC_I4 && td->last_new_ip [1] == offset) {
+ td->last_new_ip [0] = MINT_STLOC_NP_I4;
+ } else if (mt == MINT_TYPE_O && !td->is_bb_start [td->in_start - td->il_code] && td->last_new_ip != NULL &&
+ td->last_new_ip [0] == MINT_STLOC_O && td->last_new_ip [1] == offset) {
+ td->last_new_ip [0] = MINT_STLOC_NP_O;
+ } else {
+ ADD_CODE(td, MINT_LDLOC_I1 + (mt - MINT_TYPE_I1));
+ ADD_CODE(td, offset); /*FIX for large offset */
+ }
+ if (mt == MINT_TYPE_O)
+ klass = mono_class_from_mono_type (type);
+ }
+ PUSH_TYPE(td, stack_type[mt], klass);
+}
+
+static void
+store_local(TransformData *td, int n)
+{
+ MonoType *type = td->header->locals [n];
+ int mt = mint_type (type);
+ int offset = td->rtm->local_offsets [n];
+ CHECK_STACK (td, 1);
+#if SIZEOF_VOID_P == 8
+ if (td->sp [-1].type == STACK_TYPE_I4 && stack_type [mt] == STACK_TYPE_I8) {
+ ADD_CODE(td, MINT_CONV_I8_I4);
+ td->sp [-1].type = STACK_TYPE_I8;
+ }
+#endif
+ if (!can_store(td->sp [-1].type, stack_type [mt])) {
+ g_warning("%s.%s: Store local stack type mismatch %d %d",
+ td->method->klass->name, td->method->name,
+ stack_type [mt], td->sp [-1].type);
+ }
+ if (mt == MINT_TYPE_VT) {
+ gint32 size = mono_class_value_size (type->data.klass, NULL);
+ ADD_CODE(td, MINT_STLOC_VT);
+ ADD_CODE(td, offset); /*FIX for large offset */
+ WRITE32(td, &size);
+ if (td->sp [-1].type == STACK_TYPE_VT)
+ POP_VT(td, size);
+ } else {
+ ADD_CODE(td, MINT_STLOC_I1 + (mt - MINT_TYPE_I1));
+ ADD_CODE(td, offset); /*FIX for large offset */
+ }
+ --td->sp;
+}
+
+#define SIMPLE_OP(td, op) \
+ do { \
+ ADD_CODE(&td, op); \
+ ++td.ip; \
+ } while (0)
+
+static guint16
+get_data_item_index (TransformData *td, void *ptr)
+{
+ gpointer p = g_hash_table_lookup (td->data_hash, ptr);
+ guint index;
+ if (p != NULL)
+ return GPOINTER_TO_UINT (p) - 1;
+ if (td->max_data_items == td->n_data_items) {
+ td->max_data_items = td->n_data_items == 0 ? 16 : 2 * td->max_data_items;
+ td->data_items = g_realloc (td->data_items, td->max_data_items * sizeof(td->data_items [0]));
+ }
+ index = td->n_data_items;
+ td->data_items [index] = ptr;
+ ++td->n_data_items;
+ g_hash_table_insert (td->data_hash, ptr, GUINT_TO_POINTER (index + 1));
+ return index;
+}
+
+static void
+generate(MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start)
+{
+ MonoMethodHeader *header = mono_method_get_header (method);
+ MonoMethodSignature *signature = method->signature;
+ MonoImage *image = method->klass->image;
+ MonoDomain *domain = mono_domain_get ();
+ MonoGenericContext *generic_context = NULL;
+ int offset, mt;
+ int i;
+ int i32;
+ MonoClass *klass;
+ MonoClassField *field;
+ const unsigned char *end;
+ int new_in_start_offset;
+ int body_start_offset;
+ int target;
+ guint32 token;
+ TransformData td;
+ int generating_code = 1;
+
+ if (method->signature->is_inflated)
+ generic_context = ((MonoMethodInflated *) method)->context;
+
+ memset(&td, 0, sizeof(td));
+ td.method = method;
+ td.rtm = rtm;
+ td.is_bb_start = is_bb_start;
+ td.il_code = header->code;
+ td.code_size = header->code_size;
+ td.header = header;
+ td.max_code_size = td.code_size;
+ td.new_code = (unsigned short *)g_malloc(td.max_code_size * sizeof(gushort));
+ td.new_code_end = td.new_code + td.max_code_size;
+ td.in_offsets = g_malloc0(header->code_size * sizeof(int));
+ td.forward_refs = g_malloc(header->code_size * sizeof(int));
+ td.stack_state = g_malloc0(header->code_size * sizeof(StackInfo *));
+ td.stack_height = g_malloc(header->code_size * sizeof(int));
+ td.vt_stack_size = g_malloc(header->code_size * sizeof(int));
+ td.n_data_items = 0;
+ td.max_data_items = 0;
+ td.data_items = NULL;
+ td.data_hash = g_hash_table_new (NULL, NULL);
+ rtm->data_items = td.data_items;
+ for (i = 0; i < header->code_size; i++) {
+ td.forward_refs [i] = -1;
+ td.stack_height [i] = -1;
+ }
+ td.new_ip = td.new_code;
+ td.last_new_ip = NULL;
+
+ td.stack = g_malloc0(header->max_stack * sizeof(td.stack[0]));
+ td.sp = td.stack;
+ td.max_stack_height = 0;
+
+ for (i = 0; i < header->num_clauses; i++) {
+ MonoExceptionClause *c = header->clauses + i;
+ td.stack_height [c->handler_offset] = 0;
+ td.vt_stack_size [c->handler_offset] = 0;
+ td.is_bb_start [c->handler_offset] = 1;
+ if (c->flags == MONO_EXCEPTION_CLAUSE_NONE) {
+ td.stack_height [c->handler_offset] = 1;
+ td.stack_state [c->handler_offset] = g_malloc0(sizeof(StackInfo));
+ td.stack_state [c->handler_offset][0].type = STACK_TYPE_O;
+ td.stack_state [c->handler_offset][0].klass = NULL; /*FIX*/
+ }
+ }
+
+ td.ip = header->code;
+ end = td.ip + header->code_size;
+
+ if (mono_interp_traceopt) {
+ char *tmp = mono_disasm_code (NULL, method, td.ip, end);
+ char *name = mono_method_full_name (method, TRUE);
+ g_print ("Method %s, original code:\n", name);
+ g_print ("%s\n", tmp);
+ g_free (tmp);
+ g_free (name);
+ }
+
+ for (i = 0; i < signature->param_count; i++)
+ store_inarg(&td, i);
+
+ body_start_offset = td.new_ip - td.new_code;
+
+ for (i = 0; i < header->num_locals; i++) {
+ int mt = mint_type(header->locals [i]);
+ if (mt == MINT_TYPE_VT || mt == MINT_TYPE_O) {
+ ADD_CODE(&td, MINT_INITLOCALS);
+ break;
+ }
+ }
+
+ while (td.ip < end) {
+ int in_offset;
+
+ g_assert (td.sp >= td.stack);
+ g_assert (td.vt_sp < 0x10000000);
+ in_offset = td.ip - header->code;
+ td.in_offsets [in_offset] = td.new_ip - td.new_code;
+ new_in_start_offset = td.new_ip - td.new_code;
+ td.in_start = td.ip;
+ while (td.forward_refs [in_offset] >= 0) {
+ int j = td.forward_refs [in_offset];
+ int slot;
+ td.forward_refs [in_offset] = td.forward_refs [j];
+ if (td.in_offsets [j] < 0) {
+ int old_switch_offset = -td.in_offsets [j];
+ int new_switch_offset = td.in_offsets [old_switch_offset];
+ int switch_case = (j - old_switch_offset - 5) / 4;
+ int n_cases = read32 (header->code + old_switch_offset + 1);
+ offset = (td.new_ip - td.new_code) - (new_switch_offset + 2 * n_cases + 3);
+ slot = new_switch_offset + 3 + 2 * switch_case;
+ td.new_code [slot] = * (unsigned short *)(&offset);
+ td.new_code [slot + 1] = * ((unsigned short *)&offset + 1);
+ } else {
+ int op = td.new_code [td.in_offsets [j]];
+ if (mono_interp_opargtype [op] == MintOpShortBranch) {
+ offset = (td.new_ip - td.new_code) - td.in_offsets [j];
+ g_assert (offset <= 32767);
+ slot = td.in_offsets [j] + 1;
+ td.new_code [slot] = offset;
+ } else {
+ offset = (td.new_ip - td.new_code) - td.in_offsets [j];
+ slot = td.in_offsets [j] + 1;
+ td.new_code [slot] = * (unsigned short *)(&offset);
+ td.new_code [slot + 1] = * ((unsigned short *)&offset + 1);
+ }
+ }
+ }
+ if (td.stack_height [in_offset] >= 0) {
+ g_assert (is_bb_start [in_offset]);
+ if (td.stack_height [in_offset] > 0)
+ memcpy (td.stack, td.stack_state [in_offset], td.stack_height [in_offset] * sizeof(td.stack [0]));
+ td.sp = td.stack + td.stack_height [in_offset];
+ td.vt_sp = td.vt_stack_size [in_offset];
+ }
+ if (is_bb_start [in_offset]) {
+ generating_code = 1;
+ }
+ if (!generating_code) {
+ while (td.ip < end && !is_bb_start [td.ip - td.il_code])
+ ++td.ip;
+ continue;
+ }
+ if (mono_interp_traceopt > 1) {
+ printf("IL_%04x %s %-10s -> IL_%04x, sp %d, %s %-12s vt_sp %u (max %u)\n",
+ td.ip - td.il_code,
+ td.is_bb_start [td.ip - td.il_code] == 3 ? "<>" :
+ td.is_bb_start [td.ip - td.il_code] == 2 ? "< " :
+ td.is_bb_start [td.ip - td.il_code] == 1 ? " >" : " ",
+ mono_opcode_name (*td.ip), td.new_ip - td.new_code, td.sp - td.stack,
+ td.sp > td.stack ? stack_type_string [td.sp [-1].type] : " ",
+ (td.sp > td.stack && (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_VT)) ? (td.sp [-1].klass == NULL ? "?" : td.sp [-1].klass->name) : "",
+ td.vt_sp, td.max_vt_sp);
+ }
+ switch (*td.ip) {
+ case CEE_NOP:
+ /* lose it */
+ ++td.ip;
+ break;
+ case CEE_BREAK:
+ SIMPLE_OP(td, MINT_BREAK);
+ break;
+ case CEE_LDARG_0:
+ case CEE_LDARG_1:
+ case CEE_LDARG_2:
+ case CEE_LDARG_3:
+ load_arg (&td, *td.ip - CEE_LDARG_0);
+ ++td.ip;
+ break;
+ case CEE_LDLOC_0:
+ case CEE_LDLOC_1:
+ case CEE_LDLOC_2:
+ case CEE_LDLOC_3:
+ load_local (&td, *td.ip - CEE_LDLOC_0);
+ ++td.ip;
+ break;
+ case CEE_STLOC_0:
+ case CEE_STLOC_1:
+ case CEE_STLOC_2:
+ case CEE_STLOC_3:
+ store_local (&td, *td.ip - CEE_STLOC_0);
+ ++td.ip;
+ break;
+ case CEE_LDARG_S:
+ load_arg (&td, ((guint8 *)td.ip)[1]);
+ td.ip += 2;
+ break;
+ case CEE_LDARGA_S: {
+ int n = ((guint8 *)td.ip)[1];
+ if (n == 0 && signature->hasthis)
+ ADD_CODE(&td, MINT_LDTHISA);
+ else {
+ ADD_CODE(&td, MINT_LDARGA);
+ ADD_CODE(&td, td.rtm->arg_offsets [n - signature->hasthis]);
+ }
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
+ td.ip += 2;
+ break;
+ }
+ case CEE_STARG_S:
+ store_arg (&td, ((guint8 *)td.ip)[1]);
+ td.ip += 2;
+ break;
+ case CEE_LDLOC_S:
+ load_local (&td, ((guint8 *)td.ip)[1]);
+ td.ip += 2;
+ break;
+ case CEE_LDLOCA_S:
+ ADD_CODE(&td, MINT_LDLOCA_S);
+ ADD_CODE(&td, td.rtm->local_offsets [((guint8 *)td.ip)[1]]);
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
+ td.ip += 2;
+ break;
+ case CEE_STLOC_S:
+ store_local (&td, ((guint8 *)td.ip)[1]);
+ td.ip += 2;
+ break;
+ case CEE_LDNULL:
+ SIMPLE_OP(td, MINT_LDNULL);
+ PUSH_TYPE(&td, STACK_TYPE_O, NULL);
+ break;
+ case CEE_LDC_I4_M1:
+ SIMPLE_OP(td, MINT_LDC_I4_M1);
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+ break;
+ case CEE_LDC_I4_0:
+ if (!td.is_bb_start[td.ip + 1 - td.il_code] && td.ip [1] == 0xfe && td.ip [2] == CEE_CEQ &&
+ td.sp > td.stack && td.sp [-1].type == STACK_TYPE_I4) {
+ SIMPLE_OP(td, MINT_CEQ0_I4);
+ td.ip += 2;
+ } else {
+ SIMPLE_OP(td, MINT_LDC_I4_0);
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+ }
+ break;
+ case CEE_LDC_I4_1:
+ if (!td.is_bb_start[td.ip + 1 - td.il_code] &&
+ (td.ip [1] == CEE_ADD || td.ip [1] == CEE_SUB) && td.sp [-1].type == STACK_TYPE_I4) {
+ ADD_CODE(&td, td.ip [1] == CEE_ADD ? MINT_ADD1_I4 : MINT_SUB1_I4);
+ td.ip += 2;
+ } else {
+ SIMPLE_OP(td, MINT_LDC_I4_1);
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+ }
+ break;
+ case CEE_LDC_I4_2:
+ case CEE_LDC_I4_3:
+ case CEE_LDC_I4_4:
+ case CEE_LDC_I4_5:
+ case CEE_LDC_I4_6:
+ case CEE_LDC_I4_7:
+ case CEE_LDC_I4_8:
+ SIMPLE_OP(td, (*td.ip - CEE_LDC_I4_0) + MINT_LDC_I4_0);
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+ break;
+ case CEE_LDC_I4_S:
+ ADD_CODE(&td, MINT_LDC_I4_S);
+ ADD_CODE(&td, ((gint8 *) td.ip) [1]);
+ td.ip += 2;
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+ break;
+ case CEE_LDC_I4:
+ i32 = read32 (td.ip + 1);
+ ADD_CODE(&td, MINT_LDC_I4);
+ WRITE32(&td, &i32);
+ td.ip += 5;
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+ break;
+ case CEE_LDC_I8: {
+ gint64 val = read64 (td.ip + 1);
+ ADD_CODE(&td, MINT_LDC_I8);
+ WRITE64(&td, &val);
+ td.ip += 9;
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I8);
+ break;
+ }
+ case CEE_LDC_R4: {
+ float val;
+ readr4 (td.ip + 1, &val);
+ ADD_CODE(&td, MINT_LDC_R4);
+ WRITE32(&td, &val);
+ td.ip += 5;
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_R8);
+ break;
+ }
+ case CEE_LDC_R8: {
+ double val;
+ readr8 (td.ip + 1, &val);
+ ADD_CODE(&td, MINT_LDC_R8);
+ WRITE64(&td, &val);
+ td.ip += 9;
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_R8);
+ break;
+ }
+ case CEE_DUP: {
+ int type = td.sp [-1].type;
+ MonoClass *klass = td.sp [-1].klass;
+ if (td.sp [-1].type == STACK_TYPE_VT) {
+ gint32 size = mono_class_value_size (klass, NULL);
+ PUSH_VT(&td, size);
+ ADD_CODE(&td, MINT_DUP_VT);
+ WRITE32(&td, &size);
+ td.ip ++;
+ } else
+ SIMPLE_OP(td, MINT_DUP);
+ PUSH_TYPE(&td, type, klass);
+ break;
+ }
+ case CEE_POP:
+ CHECK_STACK(&td, 1);
+ SIMPLE_OP(td, MINT_POP);
+ if (td.sp [-1].type == STACK_TYPE_VT) {
+ int size = mono_class_value_size (td.sp [-1].klass, NULL);
+ size = (size + 7) & ~7;
+ ADD_CODE(&td, MINT_VTRESULT);
+ ADD_CODE(&td, 0);
+ WRITE32(&td, &size);
+ td.vt_sp -= size;
+ }
+ --td.sp;
+ break;
+ case CEE_JMP: {
+ MonoMethod *m;
+ if (td.sp > td.stack)
+ g_warning ("CEE_JMP: stack must be empty");
+ token = read32 (td.ip + 1);
+ m = mono_get_method_full (image, token, NULL, generic_context);
+ ADD_CODE(&td, MINT_JMP);
+ ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (m)));
+ td.ip += 5;
+ break;
+ }
+ case CEE_CALLVIRT: /* Fall through */
+ case CEE_CALLI: /* Fall through */
+ case CEE_CALL: {
+ MonoMethod *m;
+ MonoMethodSignature *csignature;
+ int virtual = *td.ip == CEE_CALLVIRT;
+ int calli = *td.ip == CEE_CALLI;
+ int i;
+ guint32 vt_stack_used = 0;
+ guint32 vt_res_size = 0;
+ int op = -1;
+ int native = 0;
+ int is_void = 0;
+
+ token = read32 (td.ip + 1);
+ if (calli) {
+ CHECK_STACK(&td, 1);
+ native = (method->wrapper_type != MONO_WRAPPER_DELEGATE_INVOKE && td.sp [-1].type == STACK_TYPE_I);
+ --td.sp;
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ csignature = (MonoMethodSignature *)mono_method_get_wrapper_data (method, token);
+ else
+ csignature = mono_metadata_parse_signature (image, token);
+ m = NULL;
+ } else {
+ if (method->wrapper_type == MONO_WRAPPER_NONE)
+ m = mono_get_method_full (image, token, NULL, generic_context);
+ else
+ m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
+ csignature = m->signature;
+ if (m->klass == mono_defaults.string_class) {
+ if (m->name [0] == 'g') {
+ if (strcmp (m->name, "get_Chars") == 0)
+ op = MINT_GETCHR;
+ else if (strcmp (m->name, "get_Length") == 0)
+ op = MINT_STRLEN;
+ }
+ } else if (m->klass == mono_defaults.array_class) {
+ if (strcmp (m->name, "get_Rank") == 0)
+ op = MINT_ARRAY_RANK;
+ else if (strcmp (m->name, "get_Length") == 0)
+ op = MINT_LDLEN;
+ }
+ }
+ CHECK_STACK(&td, csignature->param_count + csignature->hasthis);
+ if (!calli && (!virtual || (m->flags & METHOD_ATTRIBUTE_VIRTUAL) == 0) &&
+ (m->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 &&
+ (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) == 0) {
+ int called_inited = mono_class_vtable (domain, m->klass)->initialized;
+ MonoMethodHeader *mheader = mono_method_get_header (m);
+
+ if (/*mono_metadata_signature_equal (method->signature, m->signature) */ method == m && *(td.ip + 5) == CEE_RET) {
+ int offset;
+ if (mono_interp_traceopt)
+ g_print ("Optimize tail call of %s.%s\n", m->klass->name, m->name);
+ for (i = csignature->param_count - 1; i >= 0; --i)
+ store_arg (&td, i + csignature->hasthis);
+
+ if (csignature->hasthis) {
+ ADD_CODE(&td, MINT_STTHIS);
+ --td.sp;
+ }
+ ADD_CODE(&td, MINT_BR_S);
+ offset = body_start_offset - ((td.new_ip - 1) - td.new_code);
+ ADD_CODE(&td, offset);
+ if (!is_bb_start [td.ip + 5 - td.il_code])
+ ++td.ip; /* gobble the CEE_RET if it isn't branched to */
+ td.ip += 5;
+ break;
+ } else {
+
+ if (*mheader->code == CEE_RET && called_inited) {
+ if (mono_interp_traceopt)
+ g_print ("Inline (empty) call of %s.%s\n", m->klass->name, m->name);
+ for (i = 0; i < csignature->param_count; i++)
+ ADD_CODE(&td, MINT_POP); /*FIX: vt */
+ if (csignature->hasthis) {
+ if (virtual)
+ ADD_CODE(&td, MINT_CKNULL);
+ ADD_CODE(&td, MINT_POP);
+ }
+ td.sp -= csignature->param_count + csignature->hasthis;
+ td.ip += 5;
+ break;
+ }
+ }
+ }
+ if (method->wrapper_type == MONO_WRAPPER_NONE && m != NULL) {
+ if (m->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ m = mono_marshal_get_native_wrapper (m);
+ if (!virtual && m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ m = mono_marshal_get_synchronized_wrapper (m);
+ }
+ g_assert (csignature->call_convention == MONO_CALL_DEFAULT || csignature->call_convention == MONO_CALL_C);
+ td.sp -= csignature->param_count + csignature->hasthis;
+ for (i = 0; i < csignature->param_count; ++i) {
+ if (td.sp [i + csignature->hasthis].type == STACK_TYPE_VT) {
+ gint32 size;
+ if (csignature->pinvoke && method->wrapper_type != MONO_WRAPPER_NONE)
+ size = mono_class_native_size (csignature->params [i]->data.klass, NULL);
+ else
+ size = mono_class_value_size (csignature->params [i]->data.klass, NULL);
+ size = (size + 7) & ~7;
+ vt_stack_used += size;
+ }
+ }
+
+ /* need to handle typedbyref ... */
+ if (csignature->ret->type != MONO_TYPE_VOID) {
+ int mt = mint_type(csignature->ret);
+ MonoClass *klass = NULL;
+ if (mt == MINT_TYPE_VT) {
+ if (csignature->pinvoke && method->wrapper_type != MONO_WRAPPER_NONE)
+ vt_res_size = mono_class_native_size (csignature->ret->data.klass, NULL);
+ else
+ vt_res_size = mono_class_value_size (csignature->ret->data.klass, NULL);
+ PUSH_VT(&td, vt_res_size);
+ klass = csignature->ret->data.klass;
+ } else if (mt == MINT_TYPE_O)
+ klass = mono_class_from_mono_type (csignature->ret);
+ PUSH_TYPE(&td, stack_type[mt], klass);
+ } else
+ is_void = TRUE;
+
+ if (op >= 0) {
+ ADD_CODE(&td, op);
+#if SIZEOF_VOID_P == 8
+ if (op == MINT_LDLEN)
+ ADD_CODE(&td, MINT_CONV_I4_I8);
+#endif
+ } else {
+ if (calli)
+ ADD_CODE(&td, native ? MINT_CALLI_NAT : MINT_CALLI);
+ else if (virtual)
+ ADD_CODE(&td, is_void ? MINT_VCALLVIRT : MINT_CALLVIRT);
+ else
+ ADD_CODE(&td, is_void ? MINT_VCALL : MINT_CALL);
+ ADD_CODE(&td, get_data_item_index (&td, calli? (void *)csignature : (void *)mono_interp_get_runtime_method (m)));
+ }
+ td.ip += 5;
+ if (vt_stack_used != 0 || vt_res_size != 0) {
+ ADD_CODE(&td, MINT_VTRESULT);
+ ADD_CODE(&td, vt_res_size);
+ WRITE32(&td, &vt_stack_used);
+ td.vt_sp -= vt_stack_used;
+ }
+ break;
+ }
+ case CEE_RET: {
+ int vt_size = 0;
+ if (signature->ret->type != MONO_TYPE_VOID) {
+ --td.sp;
+ if (mint_type(signature->ret) == MINT_TYPE_VT) {
+ vt_size = mono_class_value_size (signature->ret->data.klass, NULL);
+ vt_size = (vt_size + 7) & ~7;
+ }
+ }
+ if (td.sp > td.stack)
+ g_warning ("%s.%s: CEE_RET: more values on stack: %d", td.method->klass->name, td.method->name, td.sp - td.stack);
+ if (td.vt_sp != vt_size)
+ g_warning ("%s.%s: CEE_RET: value type stack: %d", td.method->klass->name, td.method->name, td.vt_sp);
+ if (vt_size == 0)
+ SIMPLE_OP(td, signature->ret->type == MONO_TYPE_VOID ? MINT_RET_VOID : MINT_RET);
+ else {
+ ADD_CODE(&td, MINT_RET_VT);
+ WRITE32(&td, &vt_size);
+ ++td.ip;
+ }
+ generating_code = 0;
+ break;
+ }
+ case CEE_BR:
+ handle_branch (&td, MINT_BR_S, MINT_BR, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ generating_code = 0;
+ break;
+ case CEE_BR_S:
+ handle_branch (&td, MINT_BR_S, MINT_BR, 2 + (gint8)td.ip [1]);
+ td.ip += 2;
+ generating_code = 0;
+ break;
+ case CEE_BRFALSE:
+ one_arg_branch (&td, MINT_BRFALSE_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BRFALSE_S:
+ one_arg_branch (&td, MINT_BRFALSE_I4, 2 + (gint8)td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BRTRUE:
+ one_arg_branch (&td, MINT_BRTRUE_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BRTRUE_S:
+ one_arg_branch (&td, MINT_BRTRUE_I4, 2 + (gint8)td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BEQ:
+ two_arg_branch (&td, MINT_BEQ_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BEQ_S:
+ two_arg_branch (&td, MINT_BEQ_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BGE:
+ two_arg_branch (&td, MINT_BGE_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BGE_S:
+ two_arg_branch (&td, MINT_BGE_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BGT:
+ two_arg_branch (&td, MINT_BGT_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BGT_S:
+ two_arg_branch (&td, MINT_BGT_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BLT:
+ two_arg_branch (&td, MINT_BLT_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BLT_S:
+ two_arg_branch (&td, MINT_BLT_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BLE:
+ two_arg_branch (&td, MINT_BLE_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BLE_S:
+ two_arg_branch (&td, MINT_BLE_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BNE_UN:
+ two_arg_branch (&td, MINT_BNE_UN_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BNE_UN_S:
+ two_arg_branch (&td, MINT_BNE_UN_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BGE_UN:
+ two_arg_branch (&td, MINT_BGE_UN_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BGE_UN_S:
+ two_arg_branch (&td, MINT_BGE_UN_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BGT_UN:
+ two_arg_branch (&td, MINT_BGT_UN_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BGT_UN_S:
+ two_arg_branch (&td, MINT_BGT_UN_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BLE_UN:
+ two_arg_branch (&td, MINT_BLE_UN_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BLE_UN_S:
+ two_arg_branch (&td, MINT_BLE_UN_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_BLT_UN:
+ two_arg_branch (&td, MINT_BLT_UN_I4, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ break;
+ case CEE_BLT_UN_S:
+ two_arg_branch (&td, MINT_BLT_UN_I4, 2 + (gint8) td.ip [1]);
+ td.ip += 2;
+ break;
+ case CEE_SWITCH: {
+ guint32 n;
+ const unsigned char *next_ip;
+ const unsigned char *base_ip = td.ip;
+ unsigned short *next_new_ip;
+ ++td.ip;
+ n = read32 (td.ip);
+ ADD_CODE(&td, MINT_SWITCH);
+ ADD_CODE(&td, * (unsigned short *)(&n));
+ ADD_CODE(&td, * ((unsigned short *)&n + 1));
+ td.ip += 4;
+ next_ip = td.ip + n * 4;
+ next_new_ip = td.new_ip + n * 2;
+ for (i = 0; i < n; i++) {
+ offset = read32 (td.ip);
+ target = next_ip - td.il_code + offset;
+ if (offset < 0)
+ target = td.in_offsets [target] - (next_new_ip - td.new_code);
+ else {
+ int prev = td.forward_refs [target];
+ td.forward_refs [td.ip - td.il_code] = prev;
+ td.forward_refs [target] = td.ip - td.il_code;
+ td.in_offsets [td.ip - td.il_code] = - (base_ip - td.il_code);
+ }
+ ADD_CODE(&td, * (unsigned short *)(&target));
+ ADD_CODE(&td, * ((unsigned short *)&target + 1));
+ td.ip += 4;
+ }
+ --td.sp;
+ break;
+ }
+ case CEE_LDIND_I1:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_I1);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDIND_U1:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_U1);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDIND_I2:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_I2);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDIND_U2:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_U2);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDIND_I4:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_I4);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDIND_U4:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_U4);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDIND_I8:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_I8);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ break;
+ case CEE_LDIND_I:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_I);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+ break;
+ case CEE_LDIND_R4:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_R4);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+ break;
+ case CEE_LDIND_R8:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_R8);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+ break;
+ case CEE_LDIND_REF:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDIND_REF);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_O);
+ break;
+ case CEE_STIND_REF:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_REF);
+ td.sp -= 2;
+ break;
+ case CEE_STIND_I1:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_I1);
+ td.sp -= 2;
+ break;
+ case CEE_STIND_I2:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_I2);
+ td.sp -= 2;
+ break;
+ case CEE_STIND_I4:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_I4);
+ td.sp -= 2;
+ break;
+ case CEE_STIND_I:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_I);
+ td.sp -= 2;
+ break;
+ case CEE_STIND_I8:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_I8);
+ td.sp -= 2;
+ break;
+ case CEE_STIND_R4:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_R4);
+ td.sp -= 2;
+ break;
+ case CEE_STIND_R8:
+ CHECK_STACK (&td, 2);
+ SIMPLE_OP (td, MINT_STIND_R8);
+ td.sp -= 2;
+ break;
+ case CEE_ADD:
+ binary_arith_op(&td, MINT_ADD_I4);
+ ++td.ip;
+ break;
+ case CEE_SUB:
+ binary_arith_op(&td, MINT_SUB_I4);
+ ++td.ip;
+ break;
+ case CEE_MUL:
+ binary_arith_op(&td, MINT_MUL_I4);
+ ++td.ip;
+ break;
+ case CEE_DIV:
+ binary_arith_op(&td, MINT_DIV_I4);
+ ++td.ip;
+ break;
+ case CEE_DIV_UN:
+ binary_arith_op(&td, MINT_DIV_UN_I4);
+ ++td.ip;
+ break;
+ case CEE_REM:
+ binary_int_op (&td, MINT_REM_I4);
+ ++td.ip;
+ break;
+ case CEE_REM_UN:
+ binary_int_op (&td, MINT_REM_UN_I4);
+ ++td.ip;
+ break;
+ case CEE_AND:
+ binary_int_op (&td, MINT_AND_I4);
+ ++td.ip;
+ break;
+ case CEE_OR:
+ binary_int_op (&td, MINT_OR_I4);
+ ++td.ip;
+ break;
+ case CEE_XOR:
+ binary_int_op (&td, MINT_XOR_I4);
+ ++td.ip;
+ break;
+ case CEE_SHL:
+ shift_op (&td, MINT_SHL_I4);
+ ++td.ip;
+ break;
+ case CEE_SHR:
+ shift_op (&td, MINT_SHR_I4);
+ ++td.ip;
+ break;
+ case CEE_SHR_UN:
+ shift_op (&td, MINT_SHR_UN_I4);
+ ++td.ip;
+ break;
+ case CEE_NEG:
+ unary_arith_op (&td, MINT_NEG_I4);
+ ++td.ip;
+ break;
+ case CEE_NOT:
+ unary_arith_op (&td, MINT_NOT_I4);
+ ++td.ip;
+ break;
+ case CEE_CONV_U1:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_U1_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_U1_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_U1_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_I1:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_I1_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_I1_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_I1_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_U2:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_U2_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_U2_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_U2_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_I2:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_I2_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_I2_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_I2_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_U:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+#if SIZEOF_VOID_P == 4
+ ADD_CODE(&td, MINT_CONV_U4_R8);
+#else
+ ADD_CODE(&td, MINT_CONV_U8_R8);
+#endif
+ break;
+ case STACK_TYPE_I4:
+#if SIZEOF_VOID_P == 8
+ ADD_CODE(&td, MINT_CONV_U8_I4);
+#endif
+ break;
+ case STACK_TYPE_I8:
+#if SIZEOF_VOID_P == 4
+ ADD_CODE(&td, MINT_CONV_U4_I8);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+ break;
+ case CEE_CONV_I:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+#if SIZEOF_VOID_P == 8
+ ADD_CODE(&td, MINT_CONV_I8_R8);
+#else
+ ADD_CODE(&td, MINT_CONV_I4_R8);
+#endif
+ break;
+ case STACK_TYPE_I4:
+#if SIZEOF_VOID_P == 8
+ ADD_CODE(&td, MINT_CONV_I8_I4);
+#endif
+ break;
+ case STACK_TYPE_O:
+ break;
+ case STACK_TYPE_MP:
+ break;
+ case STACK_TYPE_I8:
+#if SIZEOF_VOID_P == 4
+ ADD_CODE(&td, MINT_CONV_I4_I8);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+ break;
+ case CEE_CONV_U4:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_U4_R8);
+ break;
+ case STACK_TYPE_I4:
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_U4_I8);
+ break;
+ case STACK_TYPE_MP:
+#if SIZEOF_VOID_P == 8
+ ADD_CODE(&td, MINT_CONV_U4_I8);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_I4:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_I4_R8);
+ break;
+ case STACK_TYPE_I4:
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_I4_I8);
+ break;
+ case STACK_TYPE_MP:
+#if SIZEOF_VOID_P == 8
+ ADD_CODE(&td, MINT_CONV_I4_I8);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_I8:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_I8_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_I8_I4);
+ break;
+ case STACK_TYPE_I8:
+ break;
+ case STACK_TYPE_MP:
+#if SIZEOF_VOID_P == 4
+ ADD_CODE(&td, MINT_CONV_I8_I4);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ break;
+ case CEE_CONV_R4:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_R4_R8);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_R4_I8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_R4_I4);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+ break;
+ case CEE_CONV_R8:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_R8_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_R8_I8);
+ break;
+ case STACK_TYPE_R8:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+ break;
+ case CEE_CONV_U8:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_U8_I4);
+ break;
+ case STACK_TYPE_I8:
+ break;
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_U8_R8);
+ break;
+ case STACK_TYPE_MP:
+#if SIZEOF_VOID_P == 4
+ ADD_CODE(&td, MINT_CONV_U8_I4);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ break;
+#if 0
+ case CEE_CPOBJ: {
+ MonoClass *vtklass;
+ ++ip;
+ vtklass = mono_class_get_full (image, read32 (ip), generic_context);
+ ip += 4;
+ sp -= 2;
+ memcpy (sp [0].data.p, sp [1].data.p, mono_class_value_size (vtklass, NULL));
+ break;
+ }
+#endif
+ case CEE_LDOBJ: {
+ int size;
+ CHECK_STACK (&td, 1);
+
+ token = read32 (td.ip + 1);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ ADD_CODE(&td, MINT_LDOBJ);
+ ADD_CODE(&td, get_data_item_index(&td, klass));
+ if (klass->byval_arg.type == MONO_TYPE_VALUETYPE && !klass->byval_arg.data.klass->enumtype) {
+ size = mono_class_value_size (klass, NULL);
+ PUSH_VT(&td, size);
+ }
+ td.ip += 5;
+ SET_TYPE(td.sp - 1, stack_type[mint_type(&klass->byval_arg)], klass);
+ break;
+ }
+ case CEE_LDSTR: {
+ MonoString *s;
+ token = mono_metadata_token_index (read32 (td.ip + 1));
+ td.ip += 5;
+ if (method->wrapper_type != MONO_WRAPPER_NONE) {
+ s = mono_string_new_wrapper(
+ mono_method_get_wrapper_data (method, token));
+ }
+ else
+ s = mono_ldstr (domain, image, token);
+ ADD_CODE(&td, MINT_LDSTR);
+ ADD_CODE(&td, get_data_item_index (&td, s));
+ PUSH_TYPE(&td, STACK_TYPE_O, mono_defaults.string_class);
+ break;
+ }
+ case CEE_NEWOBJ: {
+ MonoMethod *m;
+ MonoMethodSignature *csignature;
+ guint32 vt_stack_used = 0;
+ guint32 vt_res_size = 0;
+
+ td.ip++;
+ token = read32 (td.ip);
+ td.ip += 4;
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
+ else
+ m = mono_get_method_full (image, token, NULL, generic_context);
+
+ csignature = m->signature;
+ klass = m->klass;
+ td.sp -= csignature->param_count;
+ ADD_CODE(&td, MINT_NEWOBJ);
+ ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (m)));
+ if (klass->byval_arg.type == MONO_TYPE_VALUETYPE) {
+ vt_res_size = mono_class_value_size (klass, NULL);
+ PUSH_VT(&td, vt_res_size);
+ }
+ for (i = 0; i < csignature->param_count; ++i) {
+ int mt = mint_type(csignature->params [i]);
+ if (mt == MINT_TYPE_VT) {
+ gint32 size = mono_class_value_size (csignature->params [i]->data.klass, NULL);
+ size = (size + 7) & ~7;
+ vt_stack_used += size;
+ }
+ }
+ if (vt_stack_used != 0 || vt_res_size != 0) {
+ ADD_CODE(&td, MINT_VTRESULT);
+ ADD_CODE(&td, vt_res_size);
+ WRITE32(&td, &vt_stack_used);
+ td.vt_sp -= vt_stack_used;
+ }
+ PUSH_TYPE(&td, stack_type [mint_type (&klass->byval_arg)], klass);
+ break;
+ }
+ case CEE_CASTCLASS:
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+ klass = mono_class_get_full (image, token, generic_context);
+ ADD_CODE(&td, MINT_CASTCLASS);
+ ADD_CODE(&td, get_data_item_index (&td, klass));
+ td.sp [-1].klass = klass;
+ td.ip += 5;
+ break;
+ case CEE_ISINST:
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+ klass = mono_class_get_full (image, token, generic_context);
+ ADD_CODE(&td, MINT_ISINST);
+ ADD_CODE(&td, get_data_item_index (&td, klass));
+ td.ip += 5;
+ break;
+ case CEE_CONV_R_UN:
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_R_UN_I8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_R_UN_I4);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+ ++td.ip;
+ break;
+ case CEE_UNBOX:
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ ADD_CODE(&td, MINT_UNBOX);
+ ADD_CODE(&td, get_data_item_index (&td, klass));
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+ td.ip += 5;
+ break;
+ case CEE_THROW:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_THROW);
+ --td.sp;
+ generating_code = 0;
+ break;
+ case CEE_LDFLDA:
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ mono_class_init (klass);
+ mt = mint_type(field->type);
+ ADD_CODE(&td, MINT_LDFLDA);
+ ADD_CODE(&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
+ td.ip += 5;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+ break;
+ case CEE_LDFLD: {
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ mono_class_init (klass);
+ mt = mint_type(field->type);
+ if (klass->marshalbyref) {
+ ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_LDRMFLD_VT : MINT_LDRMFLD);
+ ADD_CODE(&td, get_data_item_index (&td, field));
+ } else {
+ ADD_CODE(&td, MINT_LDFLD_I1 + mt - MINT_TYPE_I1);
+ ADD_CODE(&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
+ }
+ klass = NULL;
+ if (mt == MINT_TYPE_VT) {
+ int size = mono_class_value_size (field->type->data.klass, NULL);
+ PUSH_VT(&td, size);
+ WRITE32(&td, &size);
+ klass = field->type->data.klass;
+ } else if (mt == MINT_TYPE_O)
+ klass = mono_class_from_mono_type (field->type);
+ td.ip += 5;
+ SET_TYPE(td.sp - 1, stack_type [mt], klass);
+ break;
+ }
+ case CEE_STFLD:
+ CHECK_STACK (&td, 2);
+ token = read32 (td.ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ mono_class_init (klass);
+ mt = mint_type(field->type);
+ if (klass->marshalbyref) {
+ ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STRMFLD_VT : MINT_STRMFLD);
+ ADD_CODE(&td, get_data_item_index (&td, field));
+ } else {
+ ADD_CODE(&td, MINT_STFLD_I1 + mt - MINT_TYPE_I1);
+ ADD_CODE(&td, klass->valuetype ? field->offset - sizeof(MonoObject) : field->offset);
+ }
+ if (mt == MINT_TYPE_VT) {
+ int size = mono_class_value_size (field->type->data.klass, NULL);
+ POP_VT(&td, size);
+ WRITE32(&td, &size);
+ }
+ td.ip += 5;
+ td.sp -= 2;
+ break;
+ case CEE_LDSFLDA:
+ token = read32 (td.ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ ADD_CODE(&td, MINT_LDSFLDA);
+ ADD_CODE(&td, get_data_item_index (&td, field));
+ td.ip += 5;
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
+ break;
+ case CEE_LDSFLD:
+ token = read32 (td.ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ mt = mint_type(field->type);
+ ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_LDSFLD_VT : MINT_LDSFLD);
+ ADD_CODE(&td, get_data_item_index (&td, field));
+ klass = NULL;
+ if (mt == MINT_TYPE_VT) {
+ int size = mono_class_value_size (field->type->data.klass, NULL);
+ PUSH_VT(&td, size);
+ WRITE32(&td, &size);
+ klass = field->type->data.klass;
+ } else {
+ if (mt == MINT_TYPE_O)
+ klass = mono_class_from_mono_type (field->type);
+ if (!domain->special_static_fields || !g_hash_table_lookup (domain->special_static_fields, field)) {
+ if (mt == MINT_TYPE_O)
+ td.new_ip [-2] = MINT_LDSFLD_O;
+ else if (mt == MINT_TYPE_I4)
+ td.new_ip [-2] = MINT_LDSFLD_I4;
+ }
+ ADD_CODE(&td, get_data_item_index (&td, mono_class_vtable (domain, field->parent)));
+ }
+ td.ip += 5;
+ PUSH_TYPE(&td, stack_type [mt], klass);
+ break;
+ case CEE_STSFLD:
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ mt = mint_type(field->type);
+ ADD_CODE(&td, mt == MINT_TYPE_VT ? MINT_STSFLD_VT : MINT_STSFLD);
+ ADD_CODE(&td, get_data_item_index (&td, field));
+ if (mt == MINT_TYPE_VT) {
+ int size = mono_class_value_size (field->type->data.klass, NULL);
+ POP_VT(&td, size);
+ WRITE32(&td, &size);
+ }
+ td.ip += 5;
+ --td.sp;
+ break;
+ case CEE_STOBJ: {
+ int size;
+ token = read32 (td.ip + 1);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ ADD_CODE(&td, td.sp [-1].type == STACK_TYPE_VT ? MINT_STOBJ_VT : MINT_STOBJ);
+ ADD_CODE(&td, get_data_item_index (&td, klass));
+ if (td.sp [-1].type == STACK_TYPE_VT) {
+ size = mono_class_value_size (klass, NULL);
+ size = (size + 7) & ~7;
+ td.vt_sp -= size;
+ }
+ td.ip += 5;
+ td.sp -= 2;
+ break;
+ }
+ case CEE_CONV_OVF_I_UN:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+#if SIZEOF_VOID_P == 8
+ ADD_CODE(&td, MINT_CONV_OVF_I8_UN_R8);
+#else
+ ADD_CODE(&td, MINT_CONV_OVF_I4_UN_R8);
+#endif
+ break;
+ case STACK_TYPE_I8:
+ /*FIX*/
+ break;
+ case STACK_TYPE_I4:
+#if SIZEOF_VOID_P == 8
+ ADD_CODE(&td, MINT_CONV_I8_U4);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ ++td.ip;
+ break;
+ case CEE_CONV_OVF_I8_UN:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_I8_UN_R8);
+ break;
+ case STACK_TYPE_I8:
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_I8_U4);
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ ++td.ip;
+ break;
+ case CEE_BOX: {
+ int size;
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+ g_assert (klass->valuetype);
+ if (klass->byval_arg.type == MONO_TYPE_VALUETYPE && !klass->enumtype) {
+ size = mono_class_value_size (klass, NULL);
+ size = (size + 7) & ~7;
+ td.vt_sp -= size;
+ }
+ ADD_CODE(&td, MINT_BOX);
+ ADD_CODE(&td, get_data_item_index (&td, klass));
+ SET_TYPE(td.sp - 1, STACK_TYPE_O, klass);
+ td.ip += 5;
+ break;
+ }
+ case CEE_NEWARR:
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ ADD_CODE(&td, MINT_NEWARR);
+ ADD_CODE(&td, get_data_item_index (&td, klass));
+ SET_TYPE(td.sp - 1, STACK_TYPE_O, klass);
+ td.ip += 5;
+ break;
+ case CEE_LDLEN:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_LDLEN);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+ break;
+ case CEE_LDELEMA:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ token = read32 (td.ip + 1);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ ADD_CODE(&td, MINT_LDELEMA);
+ ADD_CODE(&td, get_data_item_index (&td, klass));
+ td.ip += 5;
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+ break;
+ case CEE_LDELEM_I1:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_I1);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDELEM_U1:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_U1);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDELEM_I2:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_I2);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDELEM_U2:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_U2);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDELEM_I4:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_I4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDELEM_U4:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_U4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_LDELEM_I8:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_I8);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ break;
+ case CEE_LDELEM_I:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_I);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+ break;
+ case CEE_LDELEM_R4:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_R4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+ break;
+ case CEE_LDELEM_R8:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_R8);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_R8);
+ break;
+ case CEE_LDELEM_REF:
+ CHECK_STACK (&td, 2);
+ ENSURE_I4 (&td, 1);
+ SIMPLE_OP (td, MINT_LDELEM_REF);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_O);
+ break;
+ case CEE_STELEM_I:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_I);
+ td.sp -= 3;
+ break;
+ case CEE_STELEM_I1:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_I1);
+ td.sp -= 3;
+ break;
+ case CEE_STELEM_I2:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_I2);
+ td.sp -= 3;
+ break;
+ case CEE_STELEM_I4:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_I4);
+ td.sp -= 3;
+ break;
+ case CEE_STELEM_I8:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_I8);
+ td.sp -= 3;
+ break;
+ case CEE_STELEM_R4:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_R4);
+ td.sp -= 3;
+ break;
+ case CEE_STELEM_R8:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_R8);
+ td.sp -= 3;
+ break;
+ case CEE_STELEM_REF:
+ CHECK_STACK (&td, 3);
+ ENSURE_I4 (&td, 2);
+ SIMPLE_OP (td, MINT_STELEM_REF);
+ td.sp -= 3;
+ break;
+#if 0
+ case CEE_LDELEM:
+ case CEE_STELEM:
+ case CEE_UNBOX_ANY:
+
+ case CEE_CONV_OVF_U1:
+
+ case CEE_CONV_OVF_I8:
+
+#if SIZEOF_VOID_P == 8
+ case CEE_CONV_OVF_U:
+#endif
+ case CEE_REFANYVAL: ves_abort(); break;
+#endif
+ case CEE_CKFINITE:
+ CHECK_STACK (&td, 1);
+ SIMPLE_OP (td, MINT_CKFINITE);
+ break;
+ case CEE_CONV_OVF_I1:
+ case CEE_CONV_OVF_I1_UN:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_I1_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_OVF_I1_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_OVF_I1_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_OVF_U1:
+ case CEE_CONV_OVF_U1_UN:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_U1_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_OVF_U1_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_OVF_U1_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_OVF_I2:
+ case CEE_CONV_OVF_I2_UN:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_I2_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_OVF_I2_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_OVF_I2_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+ case CEE_CONV_OVF_U2_UN:
+ case CEE_CONV_OVF_U2:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_U2_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_OVF_U2_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_OVF_U2_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+#if SIZEOF_VOID_P == 4
+ case CEE_CONV_OVF_I:
+#endif
+ case CEE_CONV_OVF_I4:
+ case CEE_CONV_OVF_I4_UN:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_I4_R8);
+ break;
+ case STACK_TYPE_I4:
+ if (*td.ip == CEE_CONV_OVF_I4_UN)
+ ADD_CODE(&td, MINT_CONV_OVF_I4_U4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_OVF_I4_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+#if SIZEOF_VOID_P == 4
+ case CEE_CONV_OVF_U:
+#endif
+ case CEE_CONV_OVF_U4:
+ case CEE_CONV_OVF_U4_UN:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_U4_R8);
+ break;
+ case STACK_TYPE_I4:
+ if (*td.ip != CEE_CONV_OVF_U4_UN)
+ ADD_CODE(&td, MINT_CONV_OVF_U4_I4);
+ break;
+ case STACK_TYPE_I8:
+ ADD_CODE(&td, MINT_CONV_OVF_U4_I8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ break;
+#if SIZEOF_VOID_P == 8
+ case CEE_CONV_OVF_I:
+#endif
+ case CEE_CONV_OVF_I8:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_I8_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_I8_I4);
+ break;
+ case STACK_TYPE_I8:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ break;
+#if SIZEOF_VOID_P == 8
+ case CEE_CONV_OVF_U:
+#endif
+ case CEE_CONV_OVF_U8:
+ CHECK_STACK (&td, 1);
+ switch (td.sp [-1].type) {
+ case STACK_TYPE_R8:
+ ADD_CODE(&td, MINT_CONV_OVF_U8_R8);
+ break;
+ case STACK_TYPE_I4:
+ ADD_CODE(&td, MINT_CONV_OVF_U8_I4);
+ break;
+ case STACK_TYPE_I8:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I8);
+ break;
+ case CEE_LDTOKEN: {
+ int size;
+ gpointer handle;
+ token = read32 (td.ip + 1);
+ handle = mono_ldtoken (image, token, &klass, generic_context);
+ mt = mint_type(&klass->byval_arg);
+ g_assert (mt == MINT_TYPE_VT);
+ size = mono_class_value_size (klass, NULL);
+ g_assert (size == sizeof(gpointer));
+ PUSH_VT(&td, sizeof(gpointer));
+ ADD_CODE(&td, MINT_LDTOKEN);
+ ADD_CODE(&td, get_data_item_index (&td, handle));
+ PUSH_SIMPLE_TYPE(&td, stack_type [mt]);
+ td.ip += 5;
+ break;
+ }
+ case CEE_ADD_OVF:
+ binary_arith_op(&td, MINT_ADD_OVF_I4);
+ ++td.ip;
+ break;
+ case CEE_ADD_OVF_UN:
+ binary_arith_op(&td, MINT_ADD_OVF_UN_I4);
+ ++td.ip;
+ break;
+ case CEE_MUL_OVF:
+ binary_arith_op(&td, MINT_MUL_OVF_I4);
+ ++td.ip;
+ break;
+ case CEE_MUL_OVF_UN:
+ binary_arith_op(&td, MINT_MUL_OVF_UN_I4);
+ ++td.ip;
+ break;
+ case CEE_SUB_OVF:
+ binary_arith_op(&td, MINT_SUB_OVF_I4);
+ ++td.ip;
+ break;
+ case CEE_SUB_OVF_UN:
+ binary_arith_op(&td, MINT_SUB_OVF_UN_I4);
+ ++td.ip;
+ break;
+ case CEE_ENDFINALLY:
+ SIMPLE_OP (td, MINT_ENDFINALLY);
+ generating_code = 0;
+ break;
+ case CEE_LEAVE:
+ td.sp = td.stack;
+ handle_branch (&td, MINT_LEAVE_S, MINT_LEAVE, 5 + read32 (td.ip + 1));
+ td.ip += 5;
+ generating_code = 0;
+ break;
+ case CEE_LEAVE_S:
+ td.sp = td.stack;
+ handle_branch (&td, MINT_LEAVE_S, MINT_LEAVE, 2 + (gint8)td.ip [1]);
+ td.ip += 2;
+ generating_code = 0;
+ break;
+ case CEE_UNUSED41:
+ ++td.ip;
+ switch (*td.ip) {
+ case CEE_MONO_ICALL: {
+ guint32 token;
+ gpointer func;
+ MonoJitICallInfo *info;
+
+ token = read32 (td.ip + 1);
+ td.ip += 5;
+ func = mono_method_get_wrapper_data (method, token);
+ info = mono_find_jit_icall_by_addr (func);
+ g_assert (info);
+
+ CHECK_STACK (&td, info->sig->param_count);
+ switch (info->sig->param_count) {
+ case 1:
+ if (MONO_TYPE_IS_VOID (info->sig->ret))
+ ADD_CODE (&td,MINT_ICALL_P_V);
+ else
+ ADD_CODE (&td,MINT_ICALL_P_P);
+ break;
+ case 2:
+ if (MONO_TYPE_IS_VOID (info->sig->ret)) {
+ if (info->sig->params [1]->type == MONO_TYPE_I4)
+ ADD_CODE (&td,MINT_ICALL_PI_V);
+ else
+ ADD_CODE (&td,MINT_ICALL_PP_V);
+ } else {
+ if (info->sig->params [1]->type == MONO_TYPE_I4)
+ ADD_CODE (&td,MINT_ICALL_PI_P);
+ else
+ ADD_CODE (&td,MINT_ICALL_PP_P);
+ }
+ break;
+ case 3:
+ g_assert (MONO_TYPE_IS_VOID (info->sig->ret));
+ if (info->sig->params [2]->type == MONO_TYPE_I4)
+ ADD_CODE (&td,MINT_ICALL_PPI_V);
+ else
+ ADD_CODE (&td,MINT_ICALL_PPP_V);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ if (func == mono_ftnptr_to_delegate)
+ func = mono_interp_ftnptr_to_delegate;
+ ADD_CODE(&td, get_data_item_index (&td, func));
+ td.sp -= info->sig->param_count;
+
+ if (!MONO_TYPE_IS_VOID (info->sig->ret)) {
+ td.sp ++;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I);
+ }
+ break;
+ }
+ case CEE_MONO_VTADDR: {
+ int size;
+ CHECK_STACK (&td, 1);
+ if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)
+ size = mono_class_native_size(td.sp [-1].klass, NULL);
+ else
+ size = mono_class_value_size(td.sp [-1].klass, NULL);
+ size = (size + 7) & ~7;
+ ADD_CODE(&td, MINT_VTRESULT);
+ ADD_CODE(&td, 0);
+ WRITE32(&td, &size);
+ td.vt_sp -= size;
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+ break;
+ }
+ case CEE_MONO_LDPTR:
+ token = read32 (td.ip + 1);
+ td.ip += 5;
+ ADD_CODE(&td, MINT_MONO_LDPTR);
+ ADD_CODE(&td, get_data_item_index (&td, mono_method_get_wrapper_data (method, token)));
+ td.sp [0].type = STACK_TYPE_I;
+ ++td.sp;
+ break;
+ case CEE_MONO_OBJADDR:
+ CHECK_STACK (&td, 1);
+ ++td.ip;
+ td.sp[-1].type = STACK_TYPE_MP;
+ /* do nothing? */
+ break;
+ case CEE_MONO_NEWOBJ:
+ token = read32 (td.ip + 1);
+ td.ip += 5;
+ ADD_CODE(&td, MINT_MONO_NEWOBJ);
+ ADD_CODE(&td, get_data_item_index (&td, mono_method_get_wrapper_data (method, token)));
+ td.sp [0].type = STACK_TYPE_O;
+ ++td.sp;
+ break;
+ case CEE_MONO_RETOBJ:
+ CHECK_STACK (&td, 1);
+ token = read32 (td.ip + 1);
+ td.ip += 5;
+ ADD_CODE(&td, MINT_MONO_RETOBJ);
+ td.sp--;
+
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+
+ /*stackval_from_data (signature->ret, frame->retval, sp->data.vt, signature->pinvoke);*/
+
+ if (td.sp > td.stack)
+ g_warning ("CEE_MONO_RETOBJ: more values on stack: %d", td.sp-td.stack);
+ break;
+ case CEE_MONO_LDNATIVEOBJ:
+ token = read32 (td.ip + 1);
+ td.ip += 5;
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ g_assert(klass->valuetype);
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+ break;
+ case CEE_MONO_SAVE_LMF:
+ case CEE_MONO_RESTORE_LMF:
+ ++td.ip;
+ break;
+ default:
+ g_error ("transform.c: Unimplemented opcode: 0xF0 %02x at 0x%x\n", *td.ip, td.ip-header->code);
+ }
+ break;
+#if 0
+ case CEE_PREFIX7:
+ case CEE_PREFIX6:
+ case CEE_PREFIX5:
+ case CEE_PREFIX4:
+ case CEE_PREFIX3:
+ case CEE_PREFIX2:
+ case CEE_PREFIXREF: ves_abort(); break;
+#endif
+ /*
+ * Note: Exceptions thrown when executing a prefixed opcode need
+ * to take into account the number of prefix bytes (usually the
+ * throw point is just (ip - n_prefix_bytes).
+ */
+ case CEE_PREFIX1:
+ ++td.ip;
+ switch (*td.ip) {
+#if 0
+ case CEE_ARGLIST: ves_abort(); break;
+#endif
+ case CEE_CEQ:
+ CHECK_STACK(&td, 2);
+ if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
+ ADD_CODE(&td, MINT_CEQ_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+ else
+ ADD_CODE(&td, MINT_CEQ_I4 + td.sp [-1].type - STACK_TYPE_I4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ ++td.ip;
+ break;
+ case CEE_CGT:
+ CHECK_STACK(&td, 2);
+ if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
+ ADD_CODE(&td, MINT_CGT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+ else
+ ADD_CODE(&td, MINT_CGT_I4 + td.sp [-1].type - STACK_TYPE_I4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ ++td.ip;
+ break;
+ case CEE_CGT_UN:
+ CHECK_STACK(&td, 2);
+ if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
+ ADD_CODE(&td, MINT_CGT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+ else
+ ADD_CODE(&td, MINT_CGT_UN_I4 + td.sp [-1].type - STACK_TYPE_I4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ ++td.ip;
+ break;
+ case CEE_CLT:
+ CHECK_STACK(&td, 2);
+ if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
+ ADD_CODE(&td, MINT_CLT_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+ else
+ ADD_CODE(&td, MINT_CLT_I4 + td.sp [-1].type - STACK_TYPE_I4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ ++td.ip;
+ break;
+ case CEE_CLT_UN:
+ CHECK_STACK(&td, 2);
+ if (td.sp [-1].type == STACK_TYPE_O || td.sp [-1].type == STACK_TYPE_MP)
+ ADD_CODE(&td, MINT_CLT_UN_I4 + STACK_TYPE_I - STACK_TYPE_I4);
+ else
+ ADD_CODE(&td, MINT_CLT_UN_I4 + td.sp [-1].type - STACK_TYPE_I4);
+ --td.sp;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_I4);
+ ++td.ip;
+ break;
+ case CEE_LDVIRTFTN: /* fallthrough */
+ case CEE_LDFTN: {
+ MonoMethod *m;
+ if (*td.ip == CEE_LDVIRTFTN) {
+ CHECK_STACK (&td, 1);
+ --td.sp;
+ }
+ token = read32 (td.ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ m = (MonoMethod *)mono_method_get_wrapper_data (method, token);
+ else
+ m = mono_get_method_full (image, token, NULL, generic_context);
+
+ if (method->wrapper_type == MONO_WRAPPER_NONE && m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ m = mono_marshal_get_synchronized_wrapper (m);
+
+ ADD_CODE(&td, *td.ip == CEE_LDFTN ? MINT_LDFTN : MINT_LDVIRTFTN);
+ ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (m)));
+ td.ip += 5;
+ PUSH_SIMPLE_TYPE (&td, STACK_TYPE_F);
+ break;
+ }
+ case CEE_LDARG:
+ load_arg (&td, read16 (td.ip + 1));
+ td.ip += 3;
+ break;
+ case CEE_LDARGA: {
+ int n = read16 (td.ip + 1);
+ if (n == 0 && signature->hasthis)
+ ADD_CODE(&td, MINT_LDTHISA);
+ else {
+ ADD_CODE(&td, MINT_LDARGA);
+ ADD_CODE(&td, td.rtm->arg_offsets [n - signature->hasthis]); /* FIX for large offsets */
+ }
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
+ td.ip += 3;
+ break;
+ }
+ case CEE_STARG:
+ store_arg (&td, read16 (td.ip + 1));
+ td.ip += 3;
+ break;
+ case CEE_LDLOC:
+ load_local (&td, read16 (td.ip + 1));
+ td.ip += 3;
+ break;
+ case CEE_LDLOCA:
+ ADD_CODE(&td, MINT_LDLOCA_S);
+ ADD_CODE(&td, td.rtm->local_offsets [read16 (td.ip + 1)]);
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
+ td.ip += 3;
+ break;
+ case CEE_STLOC:
+ store_local (&td, read16 (td.ip + 1));
+ td.ip += 3;
+ break;
+ case CEE_LOCALLOC:
+ CHECK_STACK (&td, 1);
+#if SIZEOF_VOID_P == 8
+ if (td.sp [-1].type == STACK_TYPE_I8)
+ ADD_CODE(&td, MINT_CONV_I4_I8);
+#endif
+ ADD_CODE(&td, MINT_LOCALLOC);
+ if (td.sp != td.stack + 1)
+ g_warning("CEE_LOCALLOC: stack not empty");
+ ++td.ip;
+ SET_SIMPLE_TYPE(td.sp - 1, STACK_TYPE_MP);
+ break;
+#if 0
+ case CEE_UNUSED57: ves_abort(); break;
+ case CEE_ENDFILTER: ves_abort(); break;
+#endif
+ case CEE_UNALIGNED_:
+ ++td.ip;
+ /* FIX: should do something? */;
+ break;
+ case CEE_VOLATILE_:
+ ++td.ip;
+ /* FIX: should do something? */;
+ break;
+ case CEE_TAIL_:
+ ++td.ip;
+ /* FIX: should do something? */;
+ break;
+ case CEE_INITOBJ:
+ CHECK_STACK(&td, 1);
+ token = read32 (td.ip + 1);
+ klass = mono_class_get_full (image, token, generic_context);
+ ADD_CODE(&td, MINT_INITOBJ);
+ i32 = mono_class_value_size (klass, NULL);
+ WRITE32(&td, &i32);
+ td.ip += 5;
+ --td.sp;
+ break;
+ case CEE_CPBLK:
+ CHECK_STACK(&td, 3);
+ /* FIX? convert length to I8? */
+ ADD_CODE(&td, MINT_CPBLK);
+ td.sp -= 3;
+ ++td.ip;
+ break;
+#if 0
+ case CEE_CONSTRAINED_: {
+ guint32 token;
+ /* FIXME: implement */
+ ++ip;
+ token = read32 (ip);
+ ip += 4;
+ break;
+ }
+#endif
+ case CEE_INITBLK:
+ CHECK_STACK(&td, 3);
+ ADD_CODE(&td, MINT_INITBLK);
+ td.sp -= 3;
+ break;
+#if 0
+ case CEE_NO_:
+ /* FIXME: implement */
+ ip += 2;
+ break;
+#endif
+ case CEE_RETHROW:
+ SIMPLE_OP (td, MINT_RETHROW);
+ generating_code = 0;
+ break;
+ case CEE_SIZEOF: {
+ guint32 align;
+ gint32 size;
+ token = read32 (td.ip + 1);
+ td.ip += 5;
+ if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC) {
+ MonoType *type = mono_type_create_from_typespec (image, token);
+ size = mono_type_size (type, &align);
+ } else {
+ MonoClass *szclass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (szclass);
+#if 0
+ if (!szclass->valuetype)
+ THROW_EX (mono_exception_from_name (mono_defaults.corlib, "System", "InvalidProgramException"), ip - 5);
+#endif
+ size = mono_class_value_size (szclass, &align);
+ }
+ ADD_CODE(&td, MINT_LDC_I4);
+ WRITE32(&td, &size);
+ PUSH_SIMPLE_TYPE(&td, STACK_TYPE_I4);
+ break;
+ }
+#if 0
+ case CEE_REFANYTYPE: ves_abort(); break;
+#endif
+ default:
+ g_error ("transform.c: Unimplemented opcode: 0xFE %02x at 0x%x\n", *td.ip, td.ip-header->code);
+ }
+ break;
+ default:
+ g_error ("transform.c: Unimplemented opcode: %02x at 0x%x\n", *td.ip, td.ip-header->code);
+ }
+
+ if (td.new_ip - td.new_code != new_in_start_offset)
+ td.last_new_ip = td.new_code + new_in_start_offset;
+ else if (td.is_bb_start [td.in_start - td.il_code])
+ td.is_bb_start [td.ip - td.il_code] = 1;
+
+ td.last_ip = td.in_start;
+ }
+
+ if (mono_interp_traceopt) {
+ const guint16 *p = td.new_code;
+ printf("Runtime method: %p, VT stack size: %d\n", rtm, td.max_vt_sp);
+ printf("Calculated stack size: %d, stated size: %d\n", td.max_stack_height, header->max_stack);
+ while (p < td.new_ip) {
+ p = mono_interp_dis_mintop(td.new_code, p);
+ printf("\n");
+ }
+ }
+
+ rtm->clauses = mono_mempool_alloc (domain->mp, header->num_clauses * sizeof(MonoExceptionClause));
+ memcpy (rtm->clauses, header->clauses, header->num_clauses * sizeof(MonoExceptionClause));
+ rtm->code = mono_mempool_alloc (domain->mp, (td.new_ip - td.new_code) * sizeof(gushort));
+ memcpy (rtm->code, td.new_code, (td.new_ip - td.new_code) * sizeof(gushort));
+ g_free (td.new_code);
+ rtm->new_body_start = rtm->code + body_start_offset;
+ rtm->num_clauses = header->num_clauses;
+ for (i = 0; i < header->num_clauses; i++) {
+ MonoExceptionClause *c = rtm->clauses + i;
+ int end_off = c->try_offset + c->try_len;
+ c->try_offset = td.in_offsets [c->try_offset];
+ c->try_len = td.in_offsets [end_off] - c->try_offset;
+ end_off = c->handler_offset + c->handler_len;
+ c->handler_offset = td.in_offsets [c->handler_offset];
+ c->handler_len = td.in_offsets [end_off] - c->handler_offset;
+ }
+ rtm->vt_stack_size = td.max_vt_sp;
+ rtm->alloca_size = rtm->locals_size + rtm->args_size + rtm->vt_stack_size + rtm->stack_size;
+ rtm->data_items = mono_mempool_alloc (domain->mp, td.n_data_items * sizeof (td.data_items [0]));
+ memcpy (rtm->data_items, td.data_items, td.n_data_items * sizeof (td.data_items [0]));
+ g_free (td.in_offsets);
+ g_free (td.forward_refs);
+ for (i = 0; i < header->code_size; ++i)
+ g_free (td.stack_state [i]);
+ g_free (td.stack_state);
+ g_free (td.stack_height);
+ g_free (td.vt_stack_size);
+ g_free (td.data_items);
+ g_hash_table_destroy (td.data_hash);
+}
+
+static CRITICAL_SECTION calc_section;
+
+void
+mono_interp_transform_init (void)
+{
+ InitializeCriticalSection(&calc_section);
+}
+
+MonoException *
+mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context)
+{
+ int i, align, size, offset;
+ MonoMethod *method = runtime_method->method;
+ MonoImage *image = method->klass->image;
+ MonoMethodHeader *header = mono_method_get_header (method);
+ MonoMethodSignature *signature = method->signature;
+ register const unsigned char *ip, *end;
+ const MonoOpcode *opcode;
+ MonoMethod *m;
+ MonoClass *class;
+ MonoDomain *domain = mono_domain_get ();
+ unsigned char *is_bb_start;
+ int in;
+ MonoVTable *method_class_vt;
+ int backwards;
+ MonoGenericContext *generic_context = NULL;
+
+ method_class_vt = mono_class_vtable (domain, runtime_method->method->klass);
+ if (!method_class_vt->initialized) {
+ jmp_buf env;
+ MonoInvocation *last_env_frame = context->env_frame;
+ jmp_buf *old_env = context->current_env;
+
+ if (setjmp(env)) {
+ MonoException *failed = context->env_frame->ex;
+ context->env_frame->ex = NULL;
+ context->env_frame = last_env_frame;
+ context->current_env = old_env;
+ return failed;
+ }
+ context->env_frame = context->current_frame;
+ context->current_env = &env;
+ mono_runtime_class_init (method_class_vt);
+ context->env_frame = last_env_frame;
+ context->current_env = old_env;
+ }
+
+ mono_profiler_method_jit (method); /* sort of... */
+
+ if (method->signature->is_inflated)
+ generic_context = ((MonoMethodInflated *) method)->context;
+
+ if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
+ MonoMethod *nm = NULL;
+ EnterCriticalSection(&calc_section);
+ if (runtime_method->transformed) {
+ LeaveCriticalSection(&calc_section);
+ mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
+ return NULL;
+ }
+
+ /* assumes all internal calls with an array this are built in... */
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL &&
+ (!method->signature->hasthis || method->klass->rank == 0)) {
+ runtime_method->code = g_malloc(sizeof(short));
+ runtime_method->code[0] = MINT_CALLINT;
+ if (((MonoMethodPInvoke*) method)->addr == NULL)
+ ((MonoMethodPInvoke*) method)->addr = mono_lookup_internal_call (method);
+ runtime_method->func = mono_arch_create_trampoline (method->signature, method->string_ctor);
+ } else {
+ const char *name = method->name;
+ if (method->klass->parent == mono_defaults.multicastdelegate_class) {
+ if (*name == 'I' && (strcmp (name, "Invoke") == 0)) {
+ nm = mono_marshal_get_delegate_invoke (method);
+ } else if (*name == 'B' && (strcmp (name, "BeginInvoke") == 0)) {
+ nm = mono_marshal_get_delegate_begin_invoke (method);
+ } else if (*name == 'E' && (strcmp (name, "EndInvoke") == 0)) {
+ nm = mono_marshal_get_delegate_end_invoke (method);
+ }
+ }
+ if (nm == NULL) {
+ runtime_method->code = g_malloc(sizeof(short));
+ runtime_method->code[0] = MINT_CALLRUN;
+ }
+ }
+ if (nm == NULL) {
+ runtime_method->stack_size = sizeof (stackval); /* for tracing */
+ runtime_method->alloca_size = runtime_method->stack_size;
+ runtime_method->transformed = TRUE;
+ LeaveCriticalSection(&calc_section);
+ mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
+ return NULL;
+ }
+ method = nm;
+ header = mono_method_get_header (nm);
+ LeaveCriticalSection(&calc_section);
+ }
+ g_assert ((signature->param_count + signature->hasthis) < 1000);
+ g_assert (header->max_stack < 10000);
+ /* intern the strings in the method. */
+ ip = header->code;
+ end = ip + header->code_size;
+
+ is_bb_start = g_malloc0(header->code_size);
+ is_bb_start [0] = 1;
+ while (ip < end) {
+ in = *ip;
+ if (in == 0xfe) {
+ ip++;
+ in = *ip + 256;
+ }
+ else if (in == 0xf0) {
+ ip++;
+ in = *ip + MONO_CEE_MONO_ICALL;
+ }
+ opcode = &mono_opcodes [in];
+ switch (opcode->argument) {
+ case MonoInlineNone:
+ ++ip;
+ break;
+ case MonoInlineString:
+ if (method->wrapper_type == MONO_WRAPPER_NONE)
+ mono_ldstr (domain, image, mono_metadata_token_index (read32 (ip + 1)));
+ ip += 5;
+ break;
+ case MonoInlineType:
+ if (method->wrapper_type == MONO_WRAPPER_NONE) {
+ class = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ mono_class_init (class);
+ /* quick fix to not do this for the fake ptr classes - probably should not be getting the vtable at all here */
+ if (!(class->flags & TYPE_ATTRIBUTE_INTERFACE) && class->interface_offsets != NULL)
+ mono_class_vtable (domain, class);
+ }
+ ip += 5;
+ break;
+ case MonoInlineMethod:
+ if (method->wrapper_type == MONO_WRAPPER_NONE && *ip != CEE_CALLI) {
+ m = mono_get_method_full (image, read32 (ip + 1), NULL, generic_context);
+ if (m == NULL) {
+ g_free (is_bb_start);
+ return mono_get_exception_missing_method ();
+ }
+ mono_class_init (m->klass);
+ if (!(m->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
+ mono_class_vtable (domain, m->klass);
+ }
+ ip += 5;
+ break;
+ case MonoInlineField:
+ case MonoInlineSig:
+ case MonoInlineI:
+ case MonoInlineTok:
+ case MonoShortInlineR:
+ ip += 5;
+ break;
+ case MonoInlineBrTarget:
+ offset = read32 (ip + 1);
+ ip += 5;
+ backwards = offset < 0;
+ offset += ip - header->code;
+ g_assert (offset >= 0 && offset < header->code_size);
+ is_bb_start [offset] |= backwards ? 2 : 1;
+ break;
+ case MonoShortInlineBrTarget:
+ offset = ((gint8 *)ip) [1];
+ ip += 2;
+ backwards = offset < 0;
+ offset += ip - header->code;
+ g_assert (offset >= 0 && offset < header->code_size);
+ is_bb_start [offset] |= backwards ? 2 : 1;
+ break;
+ case MonoInlineVar:
+ ip += 3;
+ break;
+ case MonoShortInlineVar:
+ case MonoShortInlineI:
+ ip += 2;
+ break;
+ case MonoInlineSwitch: {
+ guint32 n;
+ const unsigned char *next_ip;
+ ++ip;
+ n = read32 (ip);
+ ip += 4;
+ next_ip = ip + 4 * n;
+ for (i = 0; i < n; i++) {
+ offset = read32 (ip);
+ backwards = offset < 0;
+ offset += next_ip - header->code;
+ g_assert (offset >= 0 && offset < header->code_size);
+ is_bb_start [offset] |= backwards ? 2 : 1;
+ ip += 4;
+ }
+ break;
+ }
+ case MonoInlineR:
+ case MonoInlineI8:
+ ip += 9;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
+ /* the rest needs to be locked so it is only done once */
+ EnterCriticalSection(&calc_section);
+ if (runtime_method->transformed) {
+ LeaveCriticalSection(&calc_section);
+ g_free (is_bb_start);
+ mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
+ return NULL;
+ }
+
+ runtime_method->local_offsets = g_malloc (header->num_locals * sizeof(guint32));
+ runtime_method->stack_size = (sizeof (stackval) + 2) * header->max_stack; /* + 1 for returns of called functions + 1 for 0-ing in trace*/
+ runtime_method->stack_size = (runtime_method->stack_size + 7) & ~7;
+ offset = 0;
+ for (i = 0; i < header->num_locals; ++i) {
+ size = mono_type_size (header->locals [i], &align);
+ offset += align - 1;
+ offset &= ~(align - 1);
+ runtime_method->local_offsets [i] = offset;
+ offset += size;
+ }
+ offset = (offset + 7) & ~7;
+ runtime_method->locals_size = offset;
+ g_assert (runtime_method->locals_size < 65536);
+ offset = 0;
+ runtime_method->arg_offsets = g_malloc(signature->param_count * sizeof(guint32));
+ for (i = 0; i < signature->param_count; ++i) {
+ if (signature->pinvoke) {
+ size = mono_type_native_stack_size (signature->params [i], &align);
+ align = 8;
+ }
+ else
+ size = mono_type_stack_size (signature->params [i], &align);
+ offset += align - 1;
+ offset &= ~(align - 1);
+ runtime_method->arg_offsets [i] = offset;
+ offset += size;
+ }
+ offset = (offset + 7) & ~7;
+ runtime_method->args_size = offset;
+ g_assert (runtime_method->args_size < 10000);
+
+ generate(method, runtime_method, is_bb_start);
+
+ g_free (is_bb_start);
+
+ mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
+ runtime_method->transformed = TRUE;
+ LeaveCriticalSection(&calc_section);
+
+ return NULL;
+}
+
diff --git a/mono/io-layer/.cvsignore b/mono/io-layer/.cvsignore
index 8a92924d2d6..f4e769a61d2 100644
--- a/mono/io-layer/.cvsignore
+++ b/mono/io-layer/.cvsignore
@@ -3,3 +3,5 @@
Makefile
Makefile.in
mono-handle-d
+*.lo
+*.la
diff --git a/mono/io-layer/ChangeLog b/mono/io-layer/ChangeLog
index 790dd75b486..14e132ec983 100644
--- a/mono/io-layer/ChangeLog
+++ b/mono/io-layer/ChangeLog
@@ -1,3 +1,1292 @@
+2004-10-14 Dick Porter <dick@ximian.com>
+
+ * sockets.c (_wapi_accept): Revert the previous change. We now
+ set the accepted socket to have the same blocking status as the
+ listening socket in managed code. This follows MS behaviour.
+
+2004-10-14 Dick Porter <dick@ximian.com>
+
+ * sockets.c (_wapi_accept): On Darwin, make sure a newly
+ accept()ed socket is blocking. Fixes bug 67355, patch by
+ grompf@sublimeintervention.com.
+
+2004-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * system.c: check the number of online processors instead of the
+ existing ones. Sanitize return value if it's an error.
+
+2004-10-03 Ben Maurer <bmaurer@ximian.com>
+
+ * system.c: Add support for getting the # of cpus.
+
+2004-09-28 Dick Porter <dick@ximian.com>
+
+ * io.c (pipe_close_private): Fix one small typo in the last change
+ that totally hosed process creation with redirected pipes.
+
+2004-09-24 Dick Porter <dick@ximian.com>
+
+ * wapi-private.h:
+ * sockets.c:
+ * socket-private.h:
+ * io.c:
+ * io-private.h:
+ * handles-private.h: Cope when a file descriptor is reused while
+ the handle that thought it owned it is still referenced, instead
+ of asserting. Probably fixes bug 66479, though we've been unable
+ to reproduce it.
+
+2004-09-09 Dick Porter <dick@ximian.com>
+
+ * error.c:
+ * io.c: Set error codes everywhere.
+
+2004-09-06 Dick Porter <dick@ximian.com>
+
+ * handles.c (_wapi_handle_unref): Reset the private record's type
+ (CloseHandle): Check for a fd mapping failure, and return FALSE.
+ (_wapi_handle_process_fork): Fix long-standing bug in checking
+ handle return values. Also do the required bookkeeping with the
+ new process's handles.
+
+ * daemon.c: When creating a new process's handles, check whether
+ the shared space needs to be increased
+
+2004-09-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * shared.c (_wapi_shm_file): Fix leaking of filename.
+
+2004-08-19 Dick Porter <dick@ximian.com>
+
+ * handles.c (_wapi_handle_count_signalled_handles): Fix thinko
+ introduced with the fd offset stuff: unlock handles properly when
+ backing off. Fixes the monologue hang at exit.
+
+2004-08-18 Dick Porter <dick@ximian.com>
+
+ * sockets.c:
+ * io.c: Check that new fds fit in the table, return error if not
+
+ * daemon.c (_wapi_daemon_main):
+ * handles.c (shared_init): Have all processes agree on a size for
+ the fd table.
+
+2004-08-17 Dick Porter <dick@ximian.com>
+
+ * daemon.c (process_new):
+ * handles.c (_wapi_handle_new_internal): Cope when the space
+ reserved for file descriptors is larger than the shared segment
+ size. Fixes the crash reported when running mono under gdb on
+ macosx.
+
+2004-08-16 Dick Porter <dick@ximian.com>
+
+ * sockets.c:
+ * io.c:
+ * handles-private.h (_wapi_handle_fd_offset_to_handle): Improve
+ error checking with passed-in file descriptors.
+
+2004-08-11 Dick Porter <dick@ximian.com>
+
+ * sockets.c:
+ * io.c: Returned handle values are the file descriptor the handle
+ encapsulates
+
+ * handles.c:
+ * handles-private.h:
+ * daemon.c: Reserve the range of handles that can have the same
+ values as file descriptors. These won't be used, but the values
+ will be used as file, console, pipe or socket handles. The fd to
+ handle mapping is done internally and is invisible to users.
+ Fixes bug 61828.
+
+ * wapi-private.h (_WAPI_HANDLE_VERSION): Increment, because we now
+ reserve a chunk of handle space.
+
+2004-08-04 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * atomic.h: add support for 64-bit S/390
+
+2004-07-22 Dick Porter <dick@ximian.com>
+
+ * timed-thread.c:
+ * threads.c: Move the destruction of the internal thread data to
+ after the thread has been joined. Fixes bug 61418.
+
+2004-07-14 Dick Porter <dick@ximian.com>
+
+ * wait.c (test_and_own): When not waiting for all handles to
+ become signalled, only own and return the lowest. All the
+ documentation suggests that the old way was correct, but
+ experimentation shows it actually works like this. Patch by
+ Sébastien Robitaille
+ (sebastien.robitaille@croesus.com), fixes bug 61511.
+
+2004-07-09 Ben Maurer <bmaurer@ximian.com>
+
+ * threads.c: register roots for gc
+
+2004-07-08 Dick Porter <dick@ximian.com>
+
+ * io.c (file_seek): If there is a high 32bit offset part, make
+ sure the low part isn't sign-extended. Set error codes when
+ returning failure. Fixes bug 61131.
+
+2004-07-06 Dick Porter <dick@ximian.com>
+
+ * io.c (file_setfiletime): Check for underflow when converting to
+ time_t values. Set error codes when returning failure. Fixes bug
+ 60970.
+
+2004-07-05 Dick Porter <dick@ximian.com>
+
+ * mutexes.c (mutex_ops_init): Make the named mutex mutex sharable.
+
+ * daemon.c (unref_handle): Only destroy a handle if all processes
+ have released it, not just the current one. Fixes bug 60887.
+
+2004-06-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-mutex.h atomic.h: Add G_GNUC_UNUSED to static inline functions
+ to prevent warnings.
+
+2004-06-24 Dick Porter <dick@ximian.com>
+
+ * mutexes.c: Indicate when a named mutex was reused
+
+2004-06-24 Dick Porter <dick@ximian.com>
+
+ * threads.c (SuspendThread):
+ * timed-thread.c (_wapi_timed_thread_suspend): Wrap sem_wait in a
+ while loop. See bug 58161.
+
+Wed Jun 23 23:29:04 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * io.c: don't use sharemode for on-disk file permissions: it's used
+ for shared access to the open file.
+
+2004-06-22 Dick Porter <dick@ximian.com>
+
+ * events.c (CreateEvent): When creating an auto-reset event that
+ is initially owned, make sure the set count starts at 1.
+
+2004-06-18 Dick Porter <dick@ximian.com>
+
+ * event-private.h:
+ * events.c: Auto-reset events need to release one thread for each
+ time SetEvent() is called. Fixes bug 41292.
+
+ * threads.h:
+ * mutex-private.h:
+ * mutexes.c: Scan for mutexes that are still locked by a thread
+ when it exits. Fixes the MS demo app linked by bug 41292.
+
+ * wait.c (test_and_own): Make sure a handle is signalled before it
+ is owned.
+
+2004-06-16 Dick Porter <dick@ximian.com>
+
+ * timed-thread.c: Call the thread cleanup exit routine before taking
+ the join mutex, because this could deadlock if another thread tries
+ to join in the meantime. This fixes the hang-at-exit problem seen
+ on macos.
+
+2004-06-03 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * threads.c: Implemented SleepEx.
+ * threads.h: Fixed SleepEx signature.
+
+2004-06-03 Miguel de Icaza <miguel@ximian.com>
+
+ * threads.c: When running under valgrind, do not allocate too much
+ stack, as Valgrind default is 1 meg.
+
+2004-05-27 Dick Porter <dick@ximian.com>
+
+ * io.h:
+ * io.c: Implemented LockFile() and UnlockFile()
+
+2004-05-21 Dick Porter <dick@ximian.com>
+
+ * io.c (CreateFile): Check for existing share modes when opening
+ a file.
+
+ * handles.c:
+ * handles-private.h:
+ * daemon-messages.h:
+ * daemon.c: Maintain a hash of file share modes, keying on device
+ and inode (to cope with symlinks.)
+
+2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * daemon-messages.c: Retry if the communication with the daemon is
+ interrupted by a signal.
+ * io.c, sockets.c: Check for EINTR in every syscall that can be interrumped.
+ Only return an error in this case if there is something in the apc queue
+ (which means that it is an interruption requested by the "user").
+ * processes.c: Use WaitForSingleObjectEx. No need to pass "alertable" as
+ true since the wait is small.
+ * shared.c: Retry write calls when interrumped by a signal.
+ * timed-thread.h, timed-thread.c: added _wapi_thread_apc_pending, which
+ returns TRUE if there are pending asynchronous calls (APC) for the
+ provided thread. Also added _wapi_thread_dispatch_apc_queue which calls
+ the enqueued APCs. Defined a new struct ApcInfo that holds information
+ about an enqueued APC.
+ * thread-private.h, threads.c: Implemented QueueUserAPC (which does the same
+ as in win32),_wapi_thread_apc_pending and _wapi_thread_dispatch_apc_queue.
+ These last two methods call the corresponding apc methods in
+ thread-private using the provided thread handle.
+ * threads.h: Added QueueUserAPC.
+ * uglify.h: Added WapiApcProc (needed by QueueUserAPC).
+ * wait.c, wait.h: Changed WaitForSingleObject to WaitForSingleObjectEx, and
+ WaitForMultipleObjects to WaitForMultipleObjectsEx. Implemented support
+ for APCs in those two methods and also in SleepEx.
+
+2004-05-17 Dick Porter <dick@ximian.com>
+
+ * io.c (CopyFile): Speed up. Fixes bug 57859.
+
+2004-05-13 Dick Porter <dick@ximian.com>
+ * mono-mutex.c (mono_mutex_unlock): Return EPERM when the current
+ thread doesn't own the mutex, rather than assert()ing.
+
+2004-05-11 Dick Porter <dick@ximian.com>
+
+ * shared.c (_wapi_shm_attach): Cope when a previous daemon startup
+ attempt failed, leaving shared files that look like a daemon is
+ still starting.
+
+2004-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c:
+ (SetFileAttributes): don't the the exec bit if the corresponding read
+ bit is not set.
+
+2004-05-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * io.c (FindFirstFile): Fix invalid free.
+
+2004-05-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c: translate from GFileError to errno codes and don't free
+ variables right after calling mono_io_scandir, as we may overwrite
+ errno value.
+
+2004-05-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c: g_dir_open return ENOENT for directories on which we don't have
+ read/execute permission, while returning EPERM for anything below those.
+ So, change ENOENT by EPERM if the directory exists.
+
+2004-05-07 Dick Porter <dick@ximian.com>
+
+ * io.c (SetFileAttributes): Don't have failed chmod()s cause a
+ "file not found" error. Fixes bug 54032.
+
+2004-05-07 Dick Porter <dick@ximian.com>
+
+ * io.c (FindFirstFile): Comment out a windows-compatibility check
+ that breaks when directories have metachars in their names.
+ Workaround for bug 58116.
+
+2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c: fixed for FindFirstFile for empty directories. Closes
+ bug #58147.
+
+2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * processes.c: set the start time for the current process. Fixes bug
+ #58109.
+
+2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io-private.h: 'namelist' is now a gchar ** in _WapiHandlePrivate_find.
+ * io.c: implemented scandir using glib functions.
+
+2004-05-04 Dick Porter <dick@ximian.com>
+
+ * daemon.c (read_message): Return FALSE on error so the GSource
+ callback itself can return FALSE. Cures the infinite loop poll()
+ warning on MacosX.
+ * shared.c: Fix some daemon startup race conditions.
+
+2004-04-29 Miguel de Icaza <miguel@ximian.com>
+
+ * io.c (CopyFile): Use 32k buffers to copy the file instead of 2k,
+ use the stack, do not use dynamic memory.
+
+2004-04-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * io.c: Add scandir implementation for platforms which do not have
+ it, like solaris.
+
+2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.[ch]: implemented GetLogicalDriveStrings.
+
+2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c:
+ * sockets.c: use the field name from configure when accessing sigval
+ pointer field. Makes this work on the Mac.
+
+2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
+
+ * atomic.c: (InterlockedExchange) fix typo for
+ mutex name
+
+2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c:
+ * sockets.c: added check for sys/aio.h.
+
+2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * error.[ch]: added _wapi_get_win32_file_error...
+ * io.c: ... which was _wapi_get_win32_error here.
+ * sockets.c: rename the function calls here too.
+
+2004-04-28 Dick Porter <dick@ximian.com>
+
+ * daemon-messages.c: Avoid a deadlock when a thread is killed while
+ waiting for the daemon by using a recursive mutex. Helps bug 56699.
+
+2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c: fixed leak in async_notifier().
+
+ * sockets.[ch]: added AIO support for sockets and fixed WSAIoctl
+ declaration.
+
+ * threads.c: removed old comment.
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * daemon-messages.h:
+ * daemon-private.h
+ * error.h:
+ * io.h:
+ * processes.h:
+ * shared.h:
+ * thread-private.h:
+ * wapi-private.h: remove comma from end of enumeration declarations
+ * status.h: cast unsigned int types to int for enum assignment
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * io.c:
+ * timefuncs.c: declare 64-bit constants as long long types (i.e.
+ 10ULL)
+
+2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-wrappers.h: _wapi_socket == WSASocket now. Added
+ WSA_FLAG_OVERLAPPED.
+
+ * sockets.c: new unused parameters for _wapi_socket.
+
+2004-04-22 Miguel de Icaza <miguel@ximian.com>
+
+ * timed-thread.c: Replace sem_init with MONO_SEM_INIT to handle
+ the fact that MacOS X is a piece of junk (sem_init is *defined* in
+ the libc, but they return `not implemented').
+
+2004-04-22 Dick Porter <dick@ximian.com>
+
+ * handles.c:
+ * handles-private.h: Reference the handle when it is locked, so
+ that another thread can't blow it away while we're waiting for it
+ to become signalled.
+
+ * wait.c:
+ * timed-thread.c:
+ * threads.c:
+ * sockets.c:
+ * semaphores.c:
+ * mutexes.c:
+ * mono-mutex.c:
+ * io.c:
+ * handles.c:
+ * handles-private.h:
+ * events.c:
+ * error.c:
+ * daemon-messages.c:
+ * critical-sections.c:
+ * atomic.c: Added pthreads cleanup handlers and error asserts
+
+ * shared.c:
+ * handles.c: Fixed the gcc "variable might be used uninitialised"
+ warnings. They can't happen, but gcc doesn't know that
+ g_assert()s don't return.
+
+ Fixed the declaration of _wapi_handle_process_kill() so that it
+ expects the correct type for the pid.
+
+ * threads.c: Removed the TLS_PTHREAD_MUTEX style locking that
+ hasn't been used in ages and just made the code more complex.
+
+2004-04-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * processes.c: Include <signal.h> for SIGKILL and SIGILL + fix some
+ warnings. Fixes #57168.
+
+2004-04-16 Dick Porter <dick@ximian.com>
+
+ * threads.c (Sleep): Using div(3) with a negative (when signed)
+ numerator causes the quotient to be 0 and the remainder to be the
+ numerator. This feeds a small negative value to nanosleep(3),
+ which will return immediately and cause a busy wait. Fixes bug
+ 56351.
+
+2004-04-15 Dick Porter <dick@ximian.com>
+
+ * io-private.h:
+ * io.c: Rewrite FindFirstFile and FindNextFile using scandir(3)
+ and fnmatch(3) instead of glob(3). glob() can't cope with being
+ given filenames containing metachars. This fixes bug 40557.
+
+2004-04-14 Bernie Solomon <bernard@ugsolutions.com>
+
+ * security.c: #warning is a GCC-ism
+
+2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
+
+ * security.c: Removed GetUserName as glib g_get_user_name does a
+ better (portability) job. Added ImpersonateLoggedOnUser and
+ RevertToSelf.
+
+2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mono-mutex.h: move pthread_mutex_timedlock declaration to...
+ * mono-mutex.c: ...here. It was causing a warning that prevented
+ libgdiplus compilation.
+
+2004-04-04 Miguel de Icaza <miguel@ximian.com>
+
+ * security.c (GetUserName): Make it work on MacOS X
+
+2004-04-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * security.c: use getpwuid_r if available. This one is thread-safe.
+
+2004-04-02 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Makefile.am: Added security.c|h.
+ * security.c: New file for security related functions. Added function
+ GetUserName to fix #56144.
+ * security.h: New. Header file for security.c
+ * wapi.h: Added include for security.h
+
+2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * daemon-messages.h: added kill structs.
+
+ * daemon.c: implemented process_process_kill.
+ * handles-private.h: define process_process_kill.
+ * handles.c: implemented _wapi_handle_process_kill.
+ * processes.[ch]: implemented TerminateProcess.
+
+2004-03-25 Bernie Solomon <bernard@ugsolutions.com>
+
+ * daemon.c (rem_fd): On solaris you seem to get an
+ error even after removing the input source so don't
+ try and rem_fd it twice.
+
+2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * daemon.c: in process_post_mortem, If the child terminated due to the
+ receipt of a signal, the exit status must be based on WTERMSIG, since
+ WEXITSTATUS returns 0 in this case.
+
+2004-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * daemon.c: turned a warning into a DEBUG statement. Now we may hit it.
+
+2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * daemon.c: only call getdtablesize () once.
+ * processes.c: wait 500 ms to check if execve failed and throw the same
+ exception as MS on failure. Fixes bug #32809.
+
+2004-03-17 Bernie Solomon <bernard@ugsolutions.com>
+
+ * io.c (async_notifier): use "union sigval" rather
+ than sigval_t as Solaris doesn't have sigval_t
+ (which isn't in IEEE 1003.1 either).
+
+2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c: added debug stuff and removed a few redundant lines in
+ file_write.
+
+2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io-private.h: added new fields for file structure. Declare
+ _wapi_io_add_callback.
+
+ * io.c: added _wapi_get_win32_error, support aio_read/write in
+ file_read/write. Implemented _wapi_io_add_callback, which is where
+ BindHandle ends up.
+
+ * io.h: added new fields for WapiOverlapped and typedef for the
+ callback.
+
+ * processes.c: fixed off-by-one bug when handling environment variables
+ passed in.
+
+ * threads.[ch]: implemented BindIoCompletionCallback.
+
+ * uglify.h: added typedef for LPOVERLAPPED_COMPLETION_ROUTINE.
+
+2004-03-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * socket-wrappers.h: Remove extra semicolon.
+
+2004-03-03 Dave Camp <dave@ximian.com>
+
+ * daemon.c: (add_fd), (fd_activity), (_wapi_daemon_main):
+ Use a new main context.
+
+2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c:
+ (GetFileAttributes): set the error depending on errno instead of
+ setting ERROR_FILE_NOT_FOUND always. See bug #55160.
+
+2004-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c:
+ (CopyFile): free the buffer on error.
+ * sockets.c:
+ (WSAIoctl): free the buffer on error.
+
+2004-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * error.c: fixed mapping for EPROTONOSUPPORT and ESOCKTNOSUPPORT.
+
+ * sockets.[ch]: retry creating the socket for AF_INET, SOCK_RAW
+ using IP protocol with IP over IP. Implemented WSAIoctl UNIX-style.
+
+2004-01-27 Bernie Solomon <bernard@ugsolutions.com>
+
+ * shared.c (_wapi_shm_file): add hostname
+ to shared data file names to handle NFS mounted
+ .wapi directories.
+
+Mon Jan 26 16:15:03 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * sockets.h: remove obsolete soklen_t typedef.
+
+Fri Jan 23 21:07:02 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * socket-wrappers.h, sockets.h, sockets.c, Makefile.am: move socket
+ wrappers to its own non-installed header file.
+
+2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c:
+ (FindFirstFile): unlock the handle if FindNextFile fails.
+ (FindNextFile): g_free a couple of pointers before retrying.
+
+ * wait.c:
+ (WaitForMultipleObjects): if only one handle provided, use
+ WaitForSingleObject.
+
+2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
+
+ * handles-private.h: (_wapi_handle_type) check
+ for segment in range before using it
+
+2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
+
+ * thread-private.h: _wapi_thread_ops is now const
+ must match .c file.
+
+Mon Dec 22 18:29:03 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * threads.c, timed-thread.c, timed-thread.h: use mach
+ semaphores on Darwin (MacOSX) since the posix ones
+ are mostly broken there (threads are not created suspended
+ and they can start executing before they are fully initialized
+ like in tests/thread-static.cs).
+
+Mon Dec 22 17:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * atomic.h: ppc fixes.
+
+2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
+
+ * handles.c: remove my bad use of MONO_ZERO_ARRAY_LENGTH
+ in HDRSIZE
+
+2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
+
+ * shared.c: (_wapi_shm_open) make scratch file
+ not have to immediately regrow to avoid remaps
+ (HPUX can't cope with these).
+ (_wapi_shm_attach) use actual size of file
+ to set scratch data_len for the creating process.
+
+ * handles.c: (_wapi_handle_new_internal) make
+ sure mutex & cond var are initialized even for
+ non process shared ones.
+ (_wapi_handle_unref) always call destroy
+ routines on mutex & cond var
+
+2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
+
+ * daemon.c: change channel data structure so
+ input sources are removed from glib event loop
+ properly. xsp works better on Solaris and
+ fixes #51278
+
+2003-12-12 Bernie Solomon <bernard@ugsolutions.com>
+
+ * wapi-private.h: Replace G_GNUC_PRETTY_FUNCTION
+ definition with file & line number for non-GCC
+ compiles.
+
+2003-12-08 Bernie Solomon <bernard@ugsolutions.com>
+
+ * Makefile.am: make sure hppa_atomic.s is in distribution
+
+2003-12-01 Dick Porter <dick@ximian.com>
+
+ * wapi-private.h:
+ * mutexes.c (CreateMutex):
+ * mutex-private.h (struct _WapiHandle_mutex):
+ * handles.c: Look up certain handle types by name, in a shared
+ namespace. Currently only mutex handles have this implemented.
+ Fixes bug 51089.
+
+ * semaphores.c (CreateSemaphore):
+ * events.c (CreateEvent): Fix signature
+
+2003-11-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c: don't call g_free before testing errno as it may modify it.
+ If the path exists, return an error if it's not a directory. Fixes
+ bug #50753.
+
+2003-11-20 Dick Porter <dick@ximian.com>
+
+ * io.c: Missed a little-endian UTF16 conversion. Patch from
+ Jeroen Zwartepoorte (Jeroen@xs4all.nl), fixes bug 51065.
+
+2003-10-29 Dick Porter <dick@ximian.com>
+
+ * io.c (MoveFile): If the move crosses filesystems, try and fall
+ back to copy and delete. Patch from Jörg Rosenkranz
+ (JoergR@voelcker.com), fixes bug 50298.
+
+2003-10-28 Dick Porter <dick@ximian.com>
+
+ * io.c: Use the new encoding conversion to cope with non-utf8
+ locales in filenames.
+
+ * processes.c: Ditto for process arguments.
+
+Tue Oct 21 12:01:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * atomic.h: some ppc inline asm fixes (incorrect use of labels,
+ incorrect register constraints, incorrect clobber lists).
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * Makefile.am hppa_atomic.s: add HP 64bit
+ implementation of atomic ops
+
+2003-10-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * threads.c (CreateThread): Wrap pthread_attr_setstacksize call in
+ a conditional for platforms that don't have it.
+
+2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
+
+ * threads.c: (CreateThread) use stacksize argument
+ if non-zero - change default for 64 bits to 4Mb
+
+2003-09-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * sockets.c: set last error when socket creation fails. This shed some
+ light on bug #49015.
+
+2003-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * processes.c: fixed bug #48973: we only change \ by / for the argument
+ to be used as command.
+ When getting the program name from the args, don't let the space between
+ them in the args.
+
+2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
+
+ * atomic.h atomic.c: fix sparc so lock is
+ global, increment does so and it compiles under Sun compiler.
+
+2003-09-22 Bernie Solomon <bernard@ugsolutions.com>
+
+ * handles.c: include <string.h> directly as may
+ not be nested in <sys/un.h> like Linux
+
+2003-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * io.c:
+ (DeleteFile): call SetLastError on failure. Fix by
+ richard.torkar@htu.se (Richard Torkar). Closes bug #48222.
+
+2003-09-15 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * daemon.c: In compare_process(), discard handles already signalled.
+
+2003-09-02 Dick Porter <dick@ximian.com>
+
+ * io.c: Work around glib brain-dead assumptions about utf8-encoded
+ filenames. Fixes bug 30781.
+
+2003-08-28 Dick Porter <dick@ximian.com>
+
+ * critical-sections.c: Patch from Bernie Solomon
+ <bernard@ugsolutions.com> to emit a warning if locking a critical
+ section fails.
+
+2003-07-23 Dick Porter <dick@ximian.com>
+
+ * shared.c:
+ * daemon.c (maybe_exit): Avoid the race condition when the daemon is
+ closing but another client comes along when the shared data is still
+ visible. Should fix bugs 33671 and 35213.
+
+2003-07-23 Dick Porter <dick@ximian.com>
+
+ * handles.c: Initialise handle mutex and cond. Fix by
+ Bernie Solomon <bernard@ugsolutions.com>
+
+2003-07-15 Dick Porter <dick@ximian.com>
+
+ * timed-thread.c (timed_thread_start_routine): Fix virtual memory
+ leak when threads quit. Fixes bug 44067.
+
+Wed Jun 18 19:08:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * io.c: never add write permission for group or others in
+ SetFileAttributes ().
+
+2003-06-17 Dick Porter <dick@ximian.com>
+
+ * io.c (SetFileAttributes): Implement the ReadOnly attribute, and
+ ignore the unsupported ones ("fixes" bug 44977).
+
+2003-06-17 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * misc.c: fix bug in _wapi_calc_timeout. It gave wrong values for
+ high ms values (there was an overflow).
+
+2003-06-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * system.h (struct _WapiSystemInfo ): Fix warnings when using gcc-3.3.
+
+2003-06-11 Dick Porter <dick@ximian.com>
+
+ * shared.c: Fix shared directory creation. Patch from
+ Pablo Baena <pbaena@uol.com.ar>
+
+2003-06-10 Dick Porter <dick@ximian.com>
+
+ * atomic.c: Delete the useless compile warning
+
+2003-06-09 Dick Porter <dick@ximian.com>
+
+ * daemon.c: Lookup env as a string array. Fixes bug 44289. Also
+ make setting the process handle value in the environment actually
+ work.
+
+ * processes.c: Pretty up the process name, if it happens to be
+ "mono" such as when another mono process forks "mono foo.exe"
+
+2003-06-05 Dick Porter <dick@ximian.com>
+
+ * processes.c (process_set_current): Don't do an expensive handle
+ search at application startup, check the environment to see if the
+ process handle has already been created.
+
+ * io.c: Don't do an expensive handle search when creating stdin,
+ stdout and stderr handles, just create them all the first time one
+ is requested.
+
+ * wapi-private.h:
+ * shared.c:
+ * shared.h:
+ * handles.c:
+ * handles-private.h:
+ * daemon-messages.h:
+ * daemon-private.h:
+ * daemon.c: Support for "unlimited" number of handles and scratch
+ data.
+
+ Speed up application startup by passing process handle in the
+ environment, rather than let the app scan all handles (which gets
+ really slow when there are more than a few thousand to check.)
+
+ Initialise some structs passed to syscalls, noticed by valgrind.
+
+
+2003-05-20 Dick Porter <dick@ximian.com>
+
+ * io.c (FindFirstFile): Include . files in the glob. Fixes bug
+ 43229.
+
+2003-05-19 Dick Porter <dick@ximian.com>
+
+ * threads.c: Set the new thread's stack size to 2M. Fix needed
+ for BSD, reported by Martin Dvorak <md@9ll.cz>
+
+2003-05-16 Dick Porter <dick@ximian.com>
+
+ * io.h:
+ * io.c: Implement GetTempPath()
+
+2003-05-16 Dick Porter <dick@ximian.com>
+
+ * processes.c (CreateProcess): Set some error codes
+
+2003-05-12 Dick Porter <dick@ximian.com>
+
+ * misc.c (_wapi_calc_timeout): Cope with overflowing tv_nsec.
+ Patch from Martin Dvorak <mdvorak@ninell.cz>.
+
+2003-05-10 Dick Porter <dick@ximian.com>
+
+ * io.c (CopyFile): Copy file mode as well as file data. Based on
+ suggestion by Giuseppe Greco <giuseppe.greco@agamura.com>, bug
+ 42706.
+
+2003-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * handles.c: don't call GC_gcollect when creating new handles.
+
+2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * handles.c: added some debugging code. Call GC_gcollect
+ before creating a new handle. It makes Lupus' test run smoother and
+ faster (from 62 to 83 request per second). Notice that calling
+ GC_finalizer_notifier if needed (GC_should_invoke_finalizer ()) does
+ not improve nor degrade the performance, so i don't do it.
+
+2003-05-02 Dick Porter <dick@ximian.com>
+
+ * sockets.c: Rearrange closesocket() and socket_close_private(),
+ and remember to unref the handle, so we don't leak socket handles.
+ Fix from Pelle Johnsen <pelle.johnsen@mail.dk>
+
+2003-04-11 Dick Porter <dick@ximian.com>
+
+ * atomic.h: ARM atomic operations by Malte Hildingson
+ <tds00mahi@tellus.thn.htu.se>
+
+Tue Apr 8 11:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * atomic.h: fix macosx build by "Urs C. Muff" <umuff@quark.com>.
+
+2003-04-03 Martin Baulig <martin@ximian.com>
+
+ The following change is conditional to `WITH_INCLUDED_LIBGC'
+ which is not yet enabled by default.
+
+ * threads.c (SuspendThread, ResumeThread): Fully implemented this.
+ (gc_init): New static function; install a signal handler for
+ SIGPWR which is used to suspend threads. [FIXME: it SIGPWR
+ doesn't exist on all Unix systems, we need to find another
+ signal].
+ (mono_wapi_push_thread_stack): New public function. Tells the
+ garbage collector about the current stack pointer of a suspended
+ thread.
+
+2003-04-03 Martin Baulig <martin@ximian.com>
+
+ * timed-thread.h (TimedThread): Added `suspended_sem',
+ `suspend_count' and `stack_ptr'.
+
+2003-03-28 Dick Porter <dick@ximian.com>
+
+ * atomic.h: PPC support gratiously donated to the public domain
+ by John Duncan <jddst19@mac.com>
+
+2003-03-20 Dick Porter <dick@ximian.com>
+
+ * sockets.c (_wapi_connect): If connect() fails with EACCES, try
+ setting SO_BROADCAST and connecting again. Fixes bug 39178.
+
+2003-03-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * processes.c: included Jerome Laban's patch and call SetLastError when
+ the executable is not found.
+
+2003-03-03 Dick Porter <dick@ximian.com>
+
+ * io.c (CreateFile): Try opening directories readonly, so that
+ timestamps can be adjusted. Patch by Elan Feingold
+ <efeingold@mn.rr.com>.
+
+2003-02-25 Dick Porter <dick@ximian.com>
+
+ * shared.c (_wapi_shm_attach): Return a failure code on system
+ call errors, rather than exiting.
+
+2003-02-21 Dick Porter <dick@ximian.com>
+
+ * processes.c (GetCurrentProcessId): Use the current process
+ handle to return the process ID, as getpid() is unreliable
+ (linuxthreads gives each thread a different pid). Fixes bug
+ 37550.
+
+2003-02-21 Dick Porter <dick@ximian.com>
+
+ * io.c (FindNextFile): Skip over dangling symlinks. Fixes bug
+ 34076.
+
+2003-02-11 Dick Porter <dick@ximian.com>
+
+ * timefuncs.h:
+ * timefuncs.c: Added GetTickCount()
+
+2003-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * error.c: added WSA_EHOSTUNREACH mapping.
+
+2003-01-26 Miguel de Icaza <miguel@ximian.com>
+
+ * io.c (SetFileAttributes): This routine is not currently
+ implemented for the general case, but I added a special case to
+ set the executable bit on Linux.
+
+Wed Jan 15 15:55:40 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * sockets.h, daemon.c, io.c: compilation fixes on MacOSX.
+
+2003-01-08 Dick Porter <dick@ximian.com>
+
+ * sockets.c: Fixed setting blocking mode to true (fixes bug 36388)
+
+2002-12-11 Juli Mallett <jmallett@FreeBSD.org>
+
+ * daemon.c, handles-private.h, handles.c, wapi-private.h:
+ Check for an implementation which says it supports
+ _POSIX_THREAD_PROCESS_SHARED, rather than just one that
+ defines the symbol. Defined but with a value of -1 still
+ means that it is unsupported.
+
+2002-12-08 Martin Baulig <martin@ximian.com>
+
+ * handles.c (_wapi_handle_new): Create new non-shared handles with
+ an initial refcount of 1, not 0.
+
+2002-11-22 Dietmar Maurer <dietmar@ximian.com>
+
+ * threads.c (TlsGetValue): removed unnecessary mutex
+
+2002-11-20 Dick Porter <dick@ximian.com>
+
+ * timed-thread.c (_wapi_timed_thread_attach): Attached threads
+ need to store their data structure too.
+
+ * threads.c: Make sure the threading data is initialised wherever
+ it is needed
+
+2002-11-15 Dick Porter <dick@ximian.com>
+
+ * timed-thread.c: Removed unneeded parameters in
+ _wapi_timed_thread_attach().
+
+ * threads.c: Renamed AttachThread() to make it not look like
+ external API. Removed unneeded parameters.
+
+2002-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * error.[ch]: added errno_to_WSA (). It displays a warning and return
+ WSASYSCALLFAILURE if there is no error mapping for the given errno,
+
+ * sockets.c: use errno_to_WSA and fixed display of warning for h_errno.
+
+2002-10-31 Dick Porter <dick@ximian.com>
+
+ * io.h:
+ * io.c: Define and use INVALID_FILE_ATTRIBUTES
+
+2002-10-07 Dick Porter <dick@ximian.com>
+
+ * timefuncs.c:
+ * daemon.c: Use a more accurate time source for process start and
+ end times.
+
+2002-10-03 Dick Porter <dick@ximian.com>
+
+ * daemon.c:
+ * handles.c:
+ * threads.c: Fixes for freebsd. Make sure that mutex and condition
+ creation and deletion happen in the process that owns them, when
+ POSIX shared thread objects aren't supported. This breaks on
+ freebsd, as pthread_t is a pointer to data.
+
+2002-10-02 Dick Porter <dick@ximian.com>
+
+ * shared.c: Use mmap() instead of sysv shm for the shared data.
+
+ * wapi-private.h (_WAPI_HANDLE_VERSION): Reset back to 0, for the
+ new system
+
+ * daemon-private.h:
+ * daemon.c: mmap()ed regions survive fork, so just pass the
+ pointer to _wapi_daemon_main instead of mapping it again.
+
+2002-10-01 Dick Porter <dick@ximian.com>
+
+ * timed-thread.c: Kludge for CREATE_SUSPENDED thread creation.
+ Unfortunately libgc uses the same thread suspend technique that I
+ want to, and the two don't mix: libgc will deadlock when it tries
+ to stop the world if a thread has already been suspended by
+ someone else. Just do the simple suspended create rather than the
+ general purpose thread suspension for now.
+
+ * threads.c: Pass create flags to the timed_thread create call, to
+ implement suspended thread creation. ResumeThread() partially
+ implemented, to cope with the case where a newly created but
+ suspended thread is launched.
+
+2002-09-30 Dick Porter <dick@ximian.com>
+
+ * sockets.c (ioctlsocket): Set non-blocking mode in a better way,
+ with fcntl.
+
+2002-09-27 Dick Porter <dick@ximian.com>
+
+ * semaphores.c: Only include semaphore.h if it's present. Patch
+ for BSD from jmmv@hispabsd.org (Julio Merino).
+
+2002-09-27 Dick Porter <dick@ximian.com>
+
+ * processes.c: Pass environment and working directory to the
+ daemon when forking. Don't let argv[0] be duplicated when looking
+ for the program name. Implement EnumProcessModules (simple
+ version for now, lsof-style later if needed), GetModuleBaseName,
+ {Get,Set}ProcessWorkingSetSize (just faked, because the vm hints
+ aren't available on Linux).
+
+ * process-private.h: Store the process name, and the working set
+ min and max
+
+ * handles.c:
+ * handles-private.h: New functions to store and retrieve an array
+ of strings in the scratch space
+
+ * daemon.c: Don't miss deleting some handles when a client exits
+ (we used to rely on the client doing the final cleanup, but
+ obviously if the client is no longer there the daemon has to do
+ it).
+
+ Process forking now sets the environment and the working
+ directory.
+
+ * io.c: Don't confuse fd 0 with an unassigned handle struct
+
+ * atomic.h: Add a google cache alternative to the msdn URL
+
+2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * sockets.c:
+ (_wapi_recvfrom): added ECONNRESET to the switch.
+
+2002-09-24 Mark Crichton <crichton@gimp.org>
+
+ * atomic.h: Yea. On linux, sparc isn't sparc, it's __sparc__.
+ Added to ifdef.
+
+2002-09-19 Mark Crichton <crichton@gimp.org>
+
+ * daemon.c, shared.c: Added NEED_LINK_UNLINK for systems that
+ dont have Linux's abstract filesystem for sockets.
+
+2002-09-19 Mark Crichton <crichton@gimp.org>
+
+ * atomic.h: Added SPARC atomic asm code.
+ * daemon.c, handles-private.h, handles.c, wapi-private.h:
+ undefined _POSIX_THREAD_PROCESS_SHARED. This actually exists on
+ Solaris 9, however, the code paths don't seem to work. More testing
+ on the shared case is *really* needed.
+
+2002-09-03 Dick Porter <dick@ximian.com>
+
+ * threads.h:
+ * threads.c: Removed PosixKillThread(), because it's not in the
+ w32 api
+
+2002-08-20 Dick Porter <dick@ximian.com>
+
+ * handles.c (_wapi_handle_scratch_store): Made stored byte lengths
+ multiples of 4 bytes, to keep header structures aligned. Needed
+ for sparc, at least. (Patch from crichton@gimp.org)
+
+ * handles.c: Removed 'disable_shm' variable (we've defaulted to
+ building with shm enabled for months now)
+
+2002-08-19 Dick Porter <dick@ximian.com>
+
+ * daemon.c: Rewrote the poll() loop to use GIOChannels instead,
+ for legacy NeXT-based systems.
+
+2002-08-12 Dick Porter <dick@ximian.com>
+
+ * atomic.h: Rename some parameters to avoid c++ keywords (Patch
+ from Joseph Wenninger <kde@jowenn.at>)
+
+2002-08-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * threads.c: use fast spinlocks by default
+
+2002-08-02 Dick Porter <dick@ximian.com>
+
+ * io.c (GetStdHandle): Add a handle reference when returning a
+ duplicate console handle. This fixes the unref_handle errors in
+ NUnit.
+
+2002-08-01 Dietmar Maurer <dietmar@ximian.com>
+
+ * threads.c (TLS_PTHREAD_MUTEX): define this because else some
+ tests does not work
+
+2002-08-01 Dick Porter <dick@ximian.com>
+
+ * threads.c: Use atomic spinlocks in TLS functions
+
+ * mono-spinlock.h:
+ * Makefile.am: Added mono-spinlock.h
+
+2002-07-21 Jeffrey Stedfast <fejj@ximian.com>
+
+ * daemon-messages.c: #include <sys/types.h> and <sys/sockets.h> -
+ these are needed for sendmsg() and also for struct msghdr (at
+ least on Solaris). Solaris still won't build because struct msghdr
+ doesn't have msg_flags, msg_control, or msg_controllen members.
+ (CMSG_SPACE): Define for systems that don't have it.
+ (CMSG_LEN): Same.
+
+2002-07-20 Dick Porter <dick@ximian.com>
+
+ * wapi-private.h:
+ * io-private.h:
+ * io.h:
+ * io.c:
+ * handles.c: Implemented pipe handles
+
+ * handles.c:
+ * daemon.c: Fixed bug in handle closing.
+
+ * shared.c:
+ * daemon.c: Forked processes now close all open file descriptors.
+
+Fri Jul 19 19:05:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * sockets.h, io-layer.h, critical-sections.h: don't include config.h
+ in header files.
+
+2002-07-19 Martin Baulig <martin@gnome.org>
+
+ * threads.c (ExitThread): Call exit() if no threads has been
+ created yet.
+
+2002-07-17 Dick Porter <dick@ximian.com>
+
+ * daemon-messages.c: Freebsd fixes from Andreas Kohn
+ <andreas.kohn@gmx.net>
+
+2002-07-15 Dick Porter <dick@ximian.com>
+
+ * io.c: Removed bogus console_flush() method, that was just cut
+ and pasted from file_flush when I separated the two handle types.
+
+2002-07-12 Dick Porter <dick@ximian.com>
+
+ * io.c (convert_from_flags): Fixed misunderstanding wrt fcntl
+ flags. Fixes bug 27633.
+
+2002-07-12 Dick Porter <dick@ximian.com>
+
+ * wapi-private.h:
+ * handles.c:
+ * daemon.c: Use size of sockaddr_un.sun_path from config.h
+
+2002-07-12 Dick Porter <dick@ximian.com>
+
+ * processes.c (CreateProcess): Send stdin, stdout and stderr
+ handles if the startup info doesnt specify new ones
+
+ * io.c (GetStdHandle): Return the same handle when the same
+ standard handle is requested
+
+ * handles.c: Pass file descriptors when forking
+
+ * daemon.c: Use supplied file descriptors when forking a new
+ process
+
+ * daemon-messages.h:
+ * daemon-messages.c: Pass stdin, stdout and stderr file
+ descriptors to the daemon (used when forking)
+
+2002-07-11 Miguel de Icaza <miguel@ximian.com>
+
+ * daemon.c (_wapi_daemon_main): Use sizeof
+ (main_socket_address.sun_path) instead of hardcoded 108 value.
+
+ * handles.c (shared_init): Use sizeof
+ (shared_socket_address.sun_path) instead of hardcoded 108 value.
+
+2002-07-10 Dennis Haney <davh@davh.dk>
+
+ * shared.c:
+ * handles.c:
+ * daemon.c: Lots of documentation, some added error checking, and
+ code readability improvements.
+
+ * daemon-messages.h: Add the Error request type to improve error
+ checking.
+
+ * daemon-messages.c: Do a bit more error checking on send() and
+ recv(), and log errors with a higher severity level.
+
+2002-07-04 Dick Porter <dick@ximian.com>
+
+ * daemon.c (process_process_fork): Fix argument handling, due to
+ buggy understanding of g_strsplit() behaviour.
+
+2002-07-03 Dick Porter <dick@ximian.com>
+
+ * threads.h:
+ * threads.c: Implement OpenThread(). Define access-control values
+ for thread handles.
+
+ * wapi.h:
+ * processes.h:
+ * access.h:
+ * Makefile.am: Added access.h, to hold shared access-control
+ definitions
+
+2002-07-02 Dick Porter <dick@ximian.com>
+
+ * wapi-private.h (_WAPI_HANDLE_VERSION): New protocol version
+
+2002-07-02 Dick Porter <dick@ximian.com>
+
+ * handles.c (shared_init): Make a second attempt to contact the
+ daemon if the shared memory attach succeeds, but the connect()
+ fails. (This copes with the daemon crashing without cleaning up
+ the shared memory.)
+
+ * Makefile.am:
+ * daemon-private.h:
+ * daemon.c:
+ * shared.c (_wapi_shm_attach): Don't exec() anything when we fork
+ the daemon, it's now built into the library.
+
2002-06-25 Dick Porter <dick@ximian.com>
* handles.c:
@@ -456,5 +1745,3 @@ Mon Feb 18 15:50:59 CET 2002 Paolo Molaro <lupus@ximian.com>
* Initial checkin.
This is a library emulating the win32 threading and IO API.
-
-
diff --git a/mono/io-layer/Makefile.am b/mono/io-layer/Makefile.am
index c0d06352ee7..a9625478458 100644
--- a/mono/io-layer/Makefile.am
+++ b/mono/io-layer/Makefile.am
@@ -1,15 +1,16 @@
-lib_LIBRARIES = libwapi.a
+noinst_LTLIBRARIES = libwapi.la
INCLUDES = \
$(GLIB_CFLAGS) \
$(GMODULE_CFLAGS) \
- -D_WAPI_BUILDING=1 \
+ $(LIBGC_CFLAGS) \
-DMONO_BINDIR=\""$(bindir)"\" \
-I$(top_srcdir)
libwapiincludedir = $(includedir)/mono/io-layer
OTHER_H = \
+ access.h \
atomic.h \
context.h \
critical-sections.h \
@@ -19,8 +20,10 @@ OTHER_H = \
io.h \
io-layer.h \
macros.h \
+ mono-mutex.h \
mutexes.h \
processes.h \
+ security.h \
semaphores.h \
sockets.h \
status.h \
@@ -34,12 +37,15 @@ OTHER_H = \
wapi.h
OTHER_SRC = \
+ access.h \
atomic.c \
atomic.h \
context.c \
context.h \
critical-sections.c \
critical-sections.h \
+ daemon.c \
+ daemon-private.h \
daemon-messages.c \
daemon-messages.h \
error.c \
@@ -62,9 +68,12 @@ OTHER_SRC = \
mutex-private.h \
mono-mutex.c \
mono-mutex.h \
+ mono-spinlock.h \
processes.c \
processes.h \
process-private.h \
+ security.c \
+ security.h \
semaphores.c \
semaphores.h \
semaphore-private.h \
@@ -73,6 +82,7 @@ OTHER_SRC = \
sockets.c \
sockets.h \
socket-private.h \
+ socket-wrappers.h \
status.h \
system.c \
system.h \
@@ -86,8 +96,6 @@ OTHER_SRC = \
timed-thread.h \
types.h \
uglify.h \
- unicode.c \
- unicode.h \
versioninfo.h \
wait.c \
wait.h \
@@ -101,28 +109,26 @@ WINDOWS_SRC = \
io-layer.h \
io-layer-dummy.c
+HPPA_SRC = \
+ hppa_atomic.s
+
if PLATFORM_WIN32
-libwapi_a_SOURCES = $(WINDOWS_SRC)
+libwapi_la_SOURCES = $(WINDOWS_SRC)
libwapiinclude_HEADERS = $(WINDOWS_H)
else
-libwapi_a_SOURCES = $(OTHER_SRC)
+if HPPA
+libwapi_la_SOURCES = $(OTHER_SRC) $(HPPA_SRC)
+# to enable pick up of config.h
+libwapi_la_CCASFLAGS = -I$(top_builddir)
+else
+libwapi_la_SOURCES = $(OTHER_SRC)
+endif
libwapiinclude_HEADERS = $(OTHER_H)
-
-bin_PROGRAMS = mono-handle-d
-
-mono_handle_d_SOURCES = \
- daemon.c \
- daemon-messages.c \
- daemon-messages.h
-
-mono_handle_d_LDADD = \
- $(GLIB_LIBS) \
- $(top_builddir)/mono/io-layer/libwapi.a \
- $(top_builddir)/mono/utils/libmonoutils.a
endif
EXTRA_DIST = \
$(WINDOWS_SRC) \
+ $(HPPA_SRC) \
$(OTHER_SRC)
diff --git a/mono/io-layer/access.h b/mono/io-layer/access.h
new file mode 100644
index 00000000000..2cb48b308ac
--- /dev/null
+++ b/mono/io-layer/access.h
@@ -0,0 +1,20 @@
+/*
+ * access.h: Access control definitions
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#ifndef _WAPI_ACCESS_H_
+#define _WAPI_ACCESS_H_
+
+#include <glib.h>
+
+#include <mono/io-layer/wapi.h>
+
+#define SYNCHRONIZE 0x00100000
+#define STANDARD_RIGHTS_REQUIRED 0x000f0000
+
+#endif /* _WAPI_ACCESS_H_ */
diff --git a/mono/io-layer/atomic.c b/mono/io-layer/atomic.c
index 1bf0bf416ac..1721edadea1 100644
--- a/mono/io-layer/atomic.c
+++ b/mono/io-layer/atomic.c
@@ -14,15 +14,17 @@
#include "mono/io-layer/wapi.h"
-#ifndef WAPI_ATOMIC_ASM
-#warning "Atomic functions are not atomic!"
+#ifdef WAPI_ATOMIC_ASM
+#if defined(sparc) || defined (__sparc__)
+volatile unsigned char _wapi_sparc_lock;
+#endif
+#else
-static pthread_mutex_t spin;
+static pthread_mutex_t spin = PTHREAD_MUTEX_INITIALIZER;
static mono_once_t spin_once=MONO_ONCE_INIT;
static void spin_init(void)
{
- pthread_mutex_init(&spin, 0);
g_warning("Using non-atomic functions!");
}
@@ -30,16 +32,24 @@ gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch,
gint32 comp)
{
gint32 old;
+ int ret;
mono_once(&spin_once, spin_init);
- pthread_mutex_lock(&spin);
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&spin);
+ ret = pthread_mutex_lock(&spin);
+ g_assert (ret == 0);
old= *dest;
if(old==comp) {
*dest=exch;
}
- pthread_mutex_unlock(&spin);
+ ret = pthread_mutex_unlock(&spin);
+ g_assert (ret == 0);
+
+ pthread_cleanup_pop (0);
return(old);
}
@@ -48,16 +58,24 @@ gpointer InterlockedCompareExchangePointer(volatile gpointer *dest,
gpointer exch, gpointer comp)
{
gpointer old;
+ int ret;
mono_once(&spin_once, spin_init);
- pthread_mutex_lock(&spin);
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&spin);
+ ret = pthread_mutex_lock(&spin);
+ g_assert (ret == 0);
old= *dest;
if(old==comp) {
*dest=exch;
}
- pthread_mutex_unlock(&spin);
+ ret = pthread_mutex_unlock(&spin);
+ g_assert (ret == 0);
+
+ pthread_cleanup_pop (0);
return(old);
}
@@ -65,14 +83,22 @@ gpointer InterlockedCompareExchangePointer(volatile gpointer *dest,
gint32 InterlockedIncrement(volatile gint32 *dest)
{
gint32 ret;
+ int thr_ret;
mono_once(&spin_once, spin_init);
- pthread_mutex_lock(&spin);
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&spin);
+ thr_ret = pthread_mutex_lock(&spin);
+ g_assert (thr_ret == 0);
*dest++;
ret= *dest;
- pthread_mutex_unlock(&spin);
+ thr_ret = pthread_mutex_unlock(&spin);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
return(ret);
}
@@ -80,14 +106,22 @@ gint32 InterlockedIncrement(volatile gint32 *dest)
gint32 InterlockedDecrement(volatile gint32 *dest)
{
gint32 ret;
+ int thr_ret;
mono_once(&spin_once, spin_init);
- pthread_mutex_lock(&spin);
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&spin);
+ thr_ret = pthread_mutex_lock(&spin);
+ g_assert (thr_ret == 0);
*dest--;
ret= *dest;
- pthread_mutex_unlock(&spin);
+ thr_ret = pthread_mutex_unlock(&spin);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
return(ret);
}
@@ -95,14 +129,22 @@ gint32 InterlockedDecrement(volatile gint32 *dest)
gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
{
gint32 ret;
+ int thr_ret;
mono_once(&spin_once, spin_init);
- pthread_mutex_lock(&spin);
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&spin);
+ thr_ret = pthread_mutex_lock(&spin);
+ g_assert (thr_ret == 0);
ret=*dest;
*dest=exch;
- pthread_mutex_unlock(&spin);
+ thr_ret = pthread_mutex_unlock(&spin);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
return(ret);
}
@@ -110,14 +152,22 @@ gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
{
gpointer ret;
+ int thr_ret;
mono_once(&spin_once, spin_init);
- pthread_mutex_lock(&spin);
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&spin);
+ thr_ret = pthread_mutex_lock(&spin);
+ g_assert (thr_ret == 0);
ret=*dest;
*dest=exch;
- pthread_mutex_unlock(&spin);
+ thr_ret = pthread_mutex_unlock(&spin);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
return(ret);
}
@@ -125,15 +175,23 @@ gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
{
gint32 ret;
+ int thr_ret;
mono_once(&spin_once, spin_init);
- pthread_mutex_lock(&spin);
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&spin);
+ thr_ret = pthread_mutex_lock(&spin);
+ g_assert (thr_ret == 0);
ret= *dest;
*dest+=add;
- pthread_mutex_unlock(&spin);
-
+ thr_ret = pthread_mutex_unlock(&spin);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
+
return(ret);
}
diff --git a/mono/io-layer/atomic.h b/mono/io-layer/atomic.h
index 5e24bcaffd2..6e168f3291b 100644
--- a/mono/io-layer/atomic.h
+++ b/mono/io-layer/atomic.h
@@ -14,7 +14,7 @@
#include "mono/io-layer/wapi.h"
-#ifdef __i386__
+#if defined(__i386__) || defined(__x86_64__)
#define WAPI_ATOMIC_ASM
/*
@@ -41,9 +41,16 @@ static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest
{
gpointer old;
- __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
+ __asm__ __volatile__ ("lock; "
+#ifdef __x86_64__
+ "cmpxchgq"
+#else
+ "cmpxchgl"
+#endif
+ " %2, %0"
: "=m" (*dest), "=a" (old)
: "r" (exch), "m" (*dest), "a" (comp));
+
return(old);
}
@@ -73,26 +80,38 @@ static inline gint32 InterlockedDecrement(volatile gint32 *val)
* See
* http://msdn.microsoft.com/library/en-us/dnmag00/html/win320700.asp?frame=true
* for the reasons for using cmpxchg and a loop here.
+ *
+ * That url is no longer valid, but it's still in the google cache at the
+ * moment: http://www.google.com/search?q=cache:http://msdn.microsoft.com/library/en-us/dnmag00/html/win320700.asp?frame=true
+ *
+ * For the time being, http://msdn.microsoft.com/msdnmag/issues/0700/Win32/
+ * might work. Bet it will change soon enough though.
*/
-static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new)
+static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val)
{
gint32 ret;
__asm__ __volatile__ ("1:; lock; cmpxchgl %2, %0; jne 1b"
: "=m" (*val), "=a" (ret)
- : "r" (new), "m" (*val), "a" (*val));
+ : "r" (new_val), "m" (*val), "a" (*val));
return(ret);
}
static inline gpointer InterlockedExchangePointer(volatile gpointer *val,
- gpointer new)
+ gpointer new_val)
{
gpointer ret;
- __asm__ __volatile__ ("1:; lock; cmpxchgl %2, %0; jne 1b"
+ __asm__ __volatile__ ("1:; lock; "
+#ifdef __x86_64__
+ "cmpxchgq"
+#else
+ "cmpxchgl"
+#endif
+ " %2, %0; jne 1b"
: "=m" (*val), "=a" (ret)
- : "r" (new), "m" (*val), "a" (*val));
+ : "r" (new_val), "m" (*val), "a" (*val));
return(ret);
}
@@ -107,7 +126,478 @@ static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
return(ret);
}
+
+#elif defined(sparc) || defined (__sparc__)
+#define WAPI_ATOMIC_ASM
+
+#ifdef __GNUC__
+#define BEGIN_SPIN(tmp,lock) \
+__asm__ __volatile__("1: ldstub [%1],%0\n\t" \
+ " cmp %0, 0\n\t" \
+ " bne 1b\n\t" \
+ " nop" \
+ : "=&r" (tmp) \
+ : "r" (&lock) \
+ : "memory");
+
+#define END_SPIN(lock) \
+__asm__ __volatile__("stb %%g0, [%0]" \
+ : /* no outputs */ \
+ : "r" (&lock)\
+ : "memory");
#else
+static inline void begin_spin(volatile unsigned char *lock)
+{
+ asm("1: ldstub [%i0], %l0");
+ asm("cmp %l0,0");
+ asm("bne 1b");
+ asm("nop");
+}
+#define BEGIN_SPIN(tmp,lock) begin_spin(&lock);
+#define END_SPIN(lock) ((lock) = 0);
+#endif
+
+extern volatile unsigned char _wapi_sparc_lock;
+
+G_GNUC_UNUSED
+static inline gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch, gint32 comp)
+{
+ int tmp;
+ gint32 old;
+
+ BEGIN_SPIN(tmp,_wapi_sparc_lock)
+
+ old = *dest;
+ if (old==comp) {
+ *dest=exch;
+ }
+
+ END_SPIN(_wapi_sparc_lock)
+
+ return(old);
+}
+
+G_GNUC_UNUSED
+static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
+{
+ int tmp;
+ gpointer old;
+
+ BEGIN_SPIN(tmp,_wapi_sparc_lock)
+
+ old = *dest;
+ if (old==comp) {
+ *dest=exch;
+ }
+
+ END_SPIN(_wapi_sparc_lock)
+
+ return(old);
+}
+
+G_GNUC_UNUSED
+static inline gint32 InterlockedIncrement(volatile gint32 *dest)
+{
+ int tmp;
+ gint32 ret;
+
+ BEGIN_SPIN(tmp,_wapi_sparc_lock)
+
+ (*dest)++;
+ ret = *dest;
+
+ END_SPIN(_wapi_sparc_lock)
+
+ return(ret);
+}
+
+G_GNUC_UNUSED
+static inline gint32 InterlockedDecrement(volatile gint32 *dest)
+{
+ int tmp;
+ gint32 ret;
+
+ BEGIN_SPIN(tmp,_wapi_sparc_lock)
+
+ (*dest)--;
+ ret = *dest;
+
+ END_SPIN(_wapi_sparc_lock)
+
+ return(ret);
+}
+
+G_GNUC_UNUSED
+static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
+{
+ int tmp;
+ gint32 ret;
+
+ BEGIN_SPIN(tmp,_wapi_sparc_lock)
+
+ ret = *dest;
+ *dest = exch;
+
+ END_SPIN(_wapi_sparc_lock)
+
+ return(ret);
+}
+
+G_GNUC_UNUSED
+static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
+{
+ int tmp;
+ gpointer ret;
+
+ BEGIN_SPIN(tmp,_wapi_sparc_lock)
+
+ ret = *dest;
+ *dest = exch;
+
+ END_SPIN(_wapi_sparc_lock)
+
+ return(ret);
+}
+
+G_GNUC_UNUSED
+static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
+{
+ int tmp;
+ gint32 ret;
+
+ BEGIN_SPIN(tmp,_wapi_sparc_lock)
+
+ ret = *dest;
+ *dest += add;
+
+ END_SPIN(_wapi_sparc_lock)
+
+ return(ret);
+}
+
+#elif __s390__
+
+#define WAPI_ATOMIC_ASM
+
+static inline gint32
+InterlockedCompareExchange(volatile gint32 *dest,
+ gint32 exch, gint32 comp)
+{
+ gint32 old;
+
+ __asm__ __volatile__ ("\tL\t%1,%0\n"
+ "\tLA\t1,%0\n"
+ "0:\tCS\t%3,%2,0(1)\n"
+ "\tJNZ\t0b\n"
+ : "+m" (*dest), "+r" (old)
+ : "r" (exch), "r" (comp)
+ : "1", "cc");
+ return(old);
+}
+
+#ifndef __s390x__
+# define InterlockedCompareExchangePointer InterlockedCompareExchange
+# else
+static inline gpointer
+InterlockedCompareExchangePointer(volatile gpointer *dest,
+ gpointer exch,
+ gpointer comp)
+{
+ __asm__ __volatile__ ("\tLA\t1,%0\n"
+ "\tCSG\t%1,%2,0(1)\n"
+ : "+m" (*dest), "+r" (comp)
+ : "r" (exch)
+ : "1", "2", "cc");
+
+ return(comp);
+}
+# endif
+
+
+static inline gint32
+InterlockedIncrement(volatile gint32 *val)
+{
+ gint32 tmp;
+
+ __asm__ __volatile__ ("\tLA\t2,%1\n"
+ "\tL\t%0,%1\n"
+ "\tLR\t1,%0\n"
+ "\tAHI\t1,1\n"
+ "0:\tCS\t%0,1,0(2)\n"
+ "\tJNZ\t0b"
+ : "=r" (tmp), "+m" (*val)
+ : : "1", "2", "cc");
+
+ return(tmp+1);
+}
+
+static inline gint32
+InterlockedDecrement(volatile gint32 *val)
+{
+ gint32 tmp;
+
+ __asm__ __volatile__ ("\tLA\t2,%1\n"
+ "\tL\t%0,%1\n"
+ "\tLR\t1,%0\n"
+ "\tAHI\t1,-1\n"
+ "0:\tCS\t%0,1,0(2)\n"
+ "\tJNZ\t0b"
+ : "=r" (tmp), "+m" (*val)
+ : : "1", "2", "cc");
+
+ return(tmp-1);
+}
+
+
+static inline gint32
+InterlockedExchange(volatile gint32 *val, gint32 new_val)
+{
+ gint32 ret;
+
+ __asm__ __volatile__ ("\tLA\t1,%1\n"
+ "0:\tL\t%1,%0\n"
+ "\tCS\t%1,%2,0(1)\n"
+ "\tJNZ\t0b"
+ : "+m" (*val), "+r" (ret)
+ : "r" (new_val)
+ : "1", "cc");
+
+ return(ret);
+}
+
+# ifndef __s390x__
+# define InterlockedExchangePointer InterlockedExchange
+# else
+static inline gpointer
+InterlockedExchangePointer(volatile gpointer *val, gpointer new_val)
+{
+ gpointer ret;
+
+ __asm__ __volatile__ ("\tLA\t1,%1\n"
+ "0:\tLG\t%1,%0\n"
+ "\tCSG\t%1,%2,0(1)\n"
+ "\tJNZ\t0b"
+ : "+m" (*val), "+r" (ret)
+ : "r" (new_val)
+ : "1", "cc");
+
+ return(ret);
+}
+# endif
+
+static inline gint32
+InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
+{
+ gint32 ret;
+
+ __asm__ __volatile__ ("\tL\t%0,%1\n"
+ "\tLR\t1,%0\n"
+ "\tAR\t1,%2\n"
+ "\tLA\t2,%1\n"
+ "0:\tCS\t%0,1,0(2)\n"
+ "\tJNZ\t0b"
+ : "=r" (ret), "+m" (*val)
+ : "r" (add)
+ : "1", "2", "cc");
+
+ return(ret);
+}
+
+#elif defined(__ppc__) || defined (__powerpc__)
+#define WAPI_ATOMIC_ASM
+
+static inline gint32 InterlockedIncrement(volatile gint32 *val)
+{
+ gint32 tmp;
+
+ __asm__ __volatile__ ("\n1:\n\t"
+ "lwarx %0, 0, %2\n\t"
+ "addi %1, %0, 1\n\t"
+ "stwcx. %1, 0, %2\n\t"
+ "bne- 1b"
+ : "=&b" (tmp): "r" (tmp), "r" (val): "cc", "memory");
+ return tmp;
+}
+
+static inline gint32 InterlockedDecrement(volatile gint32 *val)
+{
+ gint32 tmp;
+
+ __asm__ __volatile__ ("\n1:\n\t"
+ "lwarx %0, 0, %2\n\t"
+ "addi %1, %0, -1\n\t"
+ "stwcx. %1, 0, %2\n\t"
+ "bne- 1b"
+ : "=&b" (tmp) : "r" (tmp), "r" (val): "cc", "memory");
+ return(tmp);
+}
+
+#define InterlockedCompareExchangePointer InterlockedCompareExchange
+
+static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
+ gint32 exch, gint32 comp) {
+ gint32 tmp = 0;
+
+ __asm__ __volatile__ ("\n1:\n\t"
+ "lwarx %0, 0, %1\n\t"
+ "cmpw %2, %3\n\t"
+ "bne- 2f\n\t"
+ "stwcx. %4, 0, %1\n\t"
+ "bne- 1b\n"
+ "2:"
+ : "=r" (tmp)
+ : "r" (dest), "0" (tmp) ,"r" (comp), "r" (exch): "cc", "memory");
+ return(tmp);
+}
+
+static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
+{
+ gint32 tmp;
+
+ __asm__ __volatile__ ("\n1:\n\t"
+ "lwarx %0, 0, %1\n\t"
+ "stwcx. %2, 0, %1\n\t"
+ "bne 1b"
+ : "=r" (tmp) : "r" (dest), "r" (exch): "cc", "memory");
+ return(tmp);
+}
+#define InterlockedExchangePointer InterlockedExchange
+
+static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
+{
+ gint32 tmp;
+
+ __asm__ __volatile__ ("\n1:\n\t"
+ "lwarx %0, 0, %2\n\t"
+ "add %1, %3, %4\n\t"
+ "stwcx. %1, 0, %2\n\t"
+ "bne 1b"
+ : "=r" (tmp), "=r" (add)
+ : "r" (dest), "0" (tmp), "1" (add) : "cc", "memory");
+ return(tmp);
+}
+
+#elif defined(__arm__)
+#define WAPI_ATOMIC_ASM
+
+static inline gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch, gint32 comp)
+{
+ int a, b;
+
+ __asm__ __volatile__ ( "0:\n\t"
+ "ldr %1, [%2]\n\t"
+ "cmp %1, %4\n\t"
+ "bne 1f\n\t"
+ "swp %0, %3, [%2]\n\t"
+ "cmp %0, %1\n\t"
+ "swpne %3, %0, [%2]\n\t"
+ "bne 0b\n\t"
+ "1:"
+ : "=&r" (a), "=&r" (b)
+ : "r" (dest), "r" (exch), "r" (comp)
+ : "cc", "memory");
+
+ return a;
+}
+
+static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
+{
+ gpointer a, b;
+
+ __asm__ __volatile__ ( "0:\n\t"
+ "ldr %1, [%2]\n\t"
+ "cmp %1, %4\n\t"
+ "bne 1f\n\t"
+ "swpeq %0, %3, [%2]\n\t"
+ "cmp %0, %1\n\t"
+ "swpne %3, %0, [%2]\n\t"
+ "bne 0b\n\t"
+ "1:"
+ : "=&r" (a), "=&r" (b)
+ : "r" (dest), "r" (exch), "r" (comp)
+ : "cc", "memory");
+
+ return a;
+}
+
+static inline gint32 InterlockedIncrement(volatile gint32 *dest)
+{
+ int a, b, c;
+
+ __asm__ __volatile__ ( "0:\n\t"
+ "ldr %0, [%3]\n\t"
+ "add %1, %0, %4\n\t"
+ "swp %2, %1, [%3]\n\t"
+ "cmp %0, %2\n\t"
+ "swpne %1, %2, [%3]\n\t"
+ "bne 0b"
+ : "=&r" (a), "=&r" (b), "=&r" (c)
+ : "r" (dest), "r" (1)
+ : "cc", "memory");
+
+ return b;
+}
+
+static inline gint32 InterlockedDecrement(volatile gint32 *dest)
+{
+ int a, b, c;
+
+ __asm__ __volatile__ ( "0:\n\t"
+ "ldr %0, [%3]\n\t"
+ "add %1, %0, %4\n\t"
+ "swp %2, %1, [%3]\n\t"
+ "cmp %0, %2\n\t"
+ "swpne %1, %2, [%3]\n\t"
+ "bne 0b"
+ : "=&r" (a), "=&r" (b), "=&r" (c)
+ : "r" (dest), "r" (-1)
+ : "cc", "memory");
+
+ return b;
+}
+
+static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
+{
+ int a;
+
+ __asm__ __volatile__ ( "swp %0, %2, [%1]"
+ : "=&r" (a)
+ : "r" (dest), "r" (exch));
+
+ return a;
+}
+
+static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
+{
+ gpointer a;
+
+ __asm__ __volatile__ ( "swp %0, %2, [%1]"
+ : "=&r" (a)
+ : "r" (dest), "r" (exch));
+
+ return a;
+}
+
+static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
+{
+ int a, b, c;
+
+ __asm__ __volatile__ ( "0:\n\t"
+ "ldr %0, [%3]\n\t"
+ "add %1, %0, %4\n\t"
+ "swp %2, %1, [%3]\n\t"
+ "cmp %0, %2\n\t"
+ "swpne %1, %2, [%3]\n\t"
+ "bne 0b"
+ : "=&r" (a), "=&r" (b), "=&r" (c)
+ : "r" (dest), "r" (add)
+ : "cc", "memory");
+
+ return a;
+}
+
+#else
+
extern gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch, gint32 comp);
extern gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp);
extern gint32 InterlockedIncrement(volatile gint32 *dest);
@@ -115,6 +605,11 @@ extern gint32 InterlockedDecrement(volatile gint32 *dest);
extern gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch);
extern gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch);
extern gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add);
+
+#if defined(__hpux) && !defined(__GNUC__)
+#define WAPI_ATOMIC_ASM
+#endif
+
#endif
#endif /* _WAPI_ATOMIC_H_ */
diff --git a/mono/io-layer/critical-sections.c b/mono/io-layer/critical-sections.c
index e3b4326bdc5..7f8553ce528 100644
--- a/mono/io-layer/critical-sections.c
+++ b/mono/io-layer/critical-sections.c
@@ -31,8 +31,13 @@ static mono_mutexattr_t attr;
static void attr_init(void)
{
- mono_mutexattr_init(&attr);
- mono_mutexattr_settype(&attr, MONO_MUTEX_RECURSIVE);
+ int ret;
+
+ ret = mono_mutexattr_init(&attr);
+ g_assert (ret == 0);
+
+ ret = mono_mutexattr_settype(&attr, MONO_MUTEX_RECURSIVE);
+ g_assert (ret == 0);
}
/**
@@ -43,8 +48,11 @@ static void attr_init(void)
*/
void InitializeCriticalSection(WapiCriticalSection *section)
{
+ int ret;
+
mono_once(&attr_key_once, attr_init);
- mono_mutex_init(&section->mutex, &attr);
+ ret = mono_mutex_init(&section->mutex, &attr);
+ g_assert (ret == 0);
}
/**
@@ -75,7 +83,10 @@ gboolean InitializeCriticalSectionAndSpinCount(WapiCriticalSection *section,
*/
void DeleteCriticalSection(WapiCriticalSection *section)
{
- mono_mutex_destroy(&section->mutex);
+ int ret;
+
+ ret = mono_mutex_destroy(&section->mutex);
+ g_assert (ret == 0);
}
/**
@@ -135,7 +146,12 @@ gboolean TryEnterCriticalSection(WapiCriticalSection *section)
*/
void EnterCriticalSection(WapiCriticalSection *section)
{
- mono_mutex_lock(&section->mutex);
+ int stat;
+
+ if ((stat = mono_mutex_lock(&section->mutex)) != 0) {
+ g_error (G_GNUC_PRETTY_FUNCTION
+ ": EnterCriticalSection failed: %s", g_strerror(stat));
+ }
}
/**
@@ -150,6 +166,9 @@ void EnterCriticalSection(WapiCriticalSection *section)
*/
void LeaveCriticalSection(WapiCriticalSection *section)
{
- mono_mutex_unlock(&section->mutex);
+ int ret;
+
+ ret = mono_mutex_unlock(&section->mutex);
+ g_assert (ret == 0);
}
diff --git a/mono/io-layer/critical-sections.h b/mono/io-layer/critical-sections.h
index d395b577103..4ddafddab84 100644
--- a/mono/io-layer/critical-sections.h
+++ b/mono/io-layer/critical-sections.h
@@ -10,8 +10,6 @@
#ifndef _WAPI_CRITICAL_SECTIONS_H_
#define _WAPI_CRITICAL_SECTIONS_H_
-#include <config.h>
-
#include <glib.h>
#include <pthread.h>
diff --git a/mono/io-layer/daemon-messages.c b/mono/io-layer/daemon-messages.c
index cc95fb9750d..c7c929cd348 100644
--- a/mono/io-layer/daemon-messages.c
+++ b/mono/io-layer/daemon-messages.c
@@ -1,5 +1,5 @@
/*
- * daemon-messages.h: Communications to and from the handle daemon
+ * daemon-messages.c: Communications to and from the handle daemon
*
* Author:
* Dick Porter (dick@ximian.com)
@@ -12,6 +12,10 @@
#include <pthread.h>
#include <errno.h>
#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+/* Freebsd needs this included explicitly, but it doesn't hurt on Linux */
+#include <sys/uio.h>
#ifndef HAVE_MSG_NOSIGNAL
#include <signal.h>
@@ -20,33 +24,72 @@
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/daemon-messages.h>
+/* Solaris doesn't define these */
+#ifndef CMSG_LEN
+#define CMSG_LEN(size) (sizeof (struct cmsghdr) + (size))
+#endif
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(size) (sizeof (struct cmsghdr) + (size))
+#endif
+
+static mono_mutex_t req_mutex;
+static mono_once_t attr_key_once = MONO_ONCE_INIT;
+static mono_mutexattr_t attr;
+
+static void attr_init (void)
+{
+ int ret;
+
+ ret = mono_mutexattr_init (&attr);
+ g_assert (ret == 0);
+
+ ret = mono_mutexattr_settype (&attr, MONO_MUTEX_RECURSIVE);
+ g_assert (ret == 0);
+
+ ret = mono_mutex_init (&req_mutex, &attr);
+ g_assert (ret == 0);
+}
+
/* Send request on fd, wait for response (called by applications, not
- * the daemon)
-*/
-void _wapi_daemon_request_response (int fd, WapiHandleRequest *req,
- WapiHandleResponse *resp)
+ * the daemon, indirectly through _wapi_daemon_request_response and
+ * _wapi_daemon_request_response_with_fds)
+ */
+static void _wapi_daemon_request_response_internal (int fd,
+ struct msghdr *msg,
+ WapiHandleResponse *resp)
{
- static pthread_mutex_t req_mutex=PTHREAD_MUTEX_INITIALIZER;
int ret;
#ifndef HAVE_MSG_NOSIGNAL
void (*old_sigpipe)(int);
#endif
+ mono_once (&attr_key_once, attr_init);
+
/* Serialise requests to the daemon from the same process. We
* rely on request turnaround time being minimal anyway, so
* performance shouldnt suffer from the mutex.
*/
- pthread_mutex_lock (&req_mutex);
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&req_mutex);
+ ret = mono_mutex_lock (&req_mutex);
+ g_assert (ret == 0);
#ifdef HAVE_MSG_NOSIGNAL
- ret=send (fd, req, sizeof(WapiHandleRequest), MSG_NOSIGNAL);
+ do {
+ ret=sendmsg (fd, msg, MSG_NOSIGNAL);
+ }
+ while (ret==-1 && errno==EINTR);
#else
old_sigpipe = signal (SIGPIPE, SIG_IGN);
- ret=send (fd, req, sizeof(WapiHandleRequest), 0);
+ do {
+ ret=sendmsg (fd, msg, 0);
+ }
+ while (ret==-1 && errno==EINTR);
#endif
+
if(ret!=sizeof(WapiHandleRequest)) {
if(errno==EPIPE) {
- g_warning (G_GNUC_PRETTY_FUNCTION ": The handle daemon vanished!");
+ g_critical (G_GNUC_PRETTY_FUNCTION ": The handle daemon vanished!");
exit (-1);
} else {
g_warning (G_GNUC_PRETTY_FUNCTION ": Send error: %s",
@@ -56,14 +99,21 @@ void _wapi_daemon_request_response (int fd, WapiHandleRequest *req,
}
#ifdef HAVE_MSG_NOSIGNAL
- ret=recv (fd, resp, sizeof(WapiHandleResponse), MSG_NOSIGNAL);
+ do {
+ ret=recv (fd, resp, sizeof(WapiHandleResponse), MSG_NOSIGNAL);
+ }
+ while (ret==-1 && errno==EINTR);
#else
- ret=recv (fd, resp, sizeof(WapiHandleResponse), 0);
+ do {
+ ret=recv (fd, resp, sizeof(WapiHandleResponse), 0);
+ }
+ while (ret==-1 && errno==EINTR);
signal (SIGPIPE, old_sigpipe);
#endif
+
if(ret==-1) {
if(errno==EPIPE) {
- g_warning (G_GNUC_PRETTY_FUNCTION ": The handle daemon vanished!");
+ g_critical (G_GNUC_PRETTY_FUNCTION ": The handle daemon vanished!");
exit (-1);
} else {
g_warning (G_GNUC_PRETTY_FUNCTION ": Send error: %s",
@@ -71,44 +121,176 @@ void _wapi_daemon_request_response (int fd, WapiHandleRequest *req,
g_assert_not_reached ();
}
}
+
+ ret = mono_mutex_unlock (&req_mutex);
+ g_assert (ret == 0);
+
+ pthread_cleanup_pop (0);
+}
+
+/* Send request on fd with filedescriptors, wait for response (called
+ * by applications, not the daemon)
+ */
+void _wapi_daemon_request_response_with_fds (int fd, WapiHandleRequest *req,
+ WapiHandleResponse *resp,
+ int in_fd, int out_fd, int err_fd)
+{
+ struct msghdr msg={0};
+ struct cmsghdr *cmsg;
+ struct iovec iov;
+ char cmsgdata[CMSG_SPACE (sizeof(int)*3)];
+ int *fdptr;
+
+ msg.msg_name=NULL;
+ msg.msg_namelen=0;
+ msg.msg_iov=&iov;
+ msg.msg_iovlen=1;
+ msg.msg_control=cmsgdata;
+ msg.msg_controllen=sizeof(cmsgdata);
+ msg.msg_flags=0;
+
+ iov.iov_base=req;
+ iov.iov_len=sizeof(WapiHandleRequest);
+
+ cmsg=CMSG_FIRSTHDR (&msg);
+ cmsg->cmsg_len=CMSG_LEN (sizeof(int)*3);
+ cmsg->cmsg_level=SOL_SOCKET;
+ cmsg->cmsg_type=SCM_RIGHTS;
+ fdptr=(int *)CMSG_DATA (cmsg);
+ fdptr[0]=in_fd;
+ fdptr[1]=out_fd;
+ fdptr[2]=err_fd;
- pthread_mutex_unlock (&req_mutex);
+ msg.msg_controllen=CMSG_SPACE (sizeof(int)*3);
+
+ _wapi_daemon_request_response_internal (fd, &msg, resp);
+}
+
+/* Send request on fd, wait for response (called by applications, not
+ * the daemon)
+ */
+void _wapi_daemon_request_response (int fd, WapiHandleRequest *req,
+ WapiHandleResponse *resp)
+{
+ struct msghdr msg={0};
+ struct iovec iov;
+
+ msg.msg_name=NULL;
+ msg.msg_namelen=0;
+ msg.msg_iov=&iov;
+ msg.msg_iovlen=1;
+ msg.msg_control=NULL;
+ msg.msg_controllen=0;
+ msg.msg_flags=0;
+
+ iov.iov_base=req;
+ iov.iov_len=sizeof(WapiHandleRequest);
+
+ _wapi_daemon_request_response_internal (fd, &msg, resp);
}
/* Read request on fd (called by the daemon) */
-void _wapi_daemon_request (int fd, WapiHandleRequest *req)
+int _wapi_daemon_request (int fd, WapiHandleRequest *req, int *fds,
+ gboolean *has_fds)
{
int ret;
+ struct msghdr msg;
+ struct iovec iov;
+ struct cmsghdr *cmsg;
+ guchar cmsgdata[CMSG_SPACE (sizeof(int)*3)];
+
+ msg.msg_name=NULL;
+ msg.msg_namelen=0;
+ msg.msg_iov=&iov;
+ msg.msg_iovlen=1;
+ msg.msg_control=cmsgdata;
+ msg.msg_controllen=sizeof(cmsgdata);
+ msg.msg_flags=0;
+ iov.iov_base=req;
+ iov.iov_len=sizeof(WapiHandleRequest);
+ do {
#ifdef HAVE_MSG_NOSIGNAL
- ret=recv (fd, req, sizeof(WapiHandleRequest), MSG_NOSIGNAL);
+ ret=recvmsg (fd, &msg, MSG_NOSIGNAL);
#else
- ret=recv (fd, req, sizeof(WapiHandleRequest), 0);
+ ret=recvmsg (fd, &msg, 0);
#endif
- if(ret==-1) {
+ }
+ while (ret==-1 && errno==EINTR);
+
+ if(ret==-1 || ret!= sizeof(WapiHandleRequest)) {
+ /* Make sure we dont do anything with this response */
+ req->type=WapiHandleRequestType_Error;
+
#ifdef DEBUG
g_warning (G_GNUC_PRETTY_FUNCTION ": Recv error: %s",
strerror (errno));
#endif
/* The next loop around poll() should tidy up */
}
+
+#ifdef DEBUG
+ if(msg.msg_flags & MSG_OOB) {
+ g_message (G_GNUC_PRETTY_FUNCTION ": OOB data received");
+ }
+ if(msg.msg_flags & MSG_CTRUNC) {
+ g_message (G_GNUC_PRETTY_FUNCTION ": ancillary data was truncated");
+ }
+ g_message (G_GNUC_PRETTY_FUNCTION ": msg.msg_controllen=%d",
+ msg.msg_controllen);
+#endif
+
+ cmsg=CMSG_FIRSTHDR (&msg);
+ if(cmsg!=NULL && cmsg->cmsg_level==SOL_SOCKET &&
+ cmsg->cmsg_type==SCM_RIGHTS) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": cmsg->cmsg_len=%d",
+ cmsg->cmsg_len);
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": cmsg->level=%d cmsg->type=%d", cmsg->cmsg_level,
+ cmsg->cmsg_type);
+#endif
+
+ memcpy (fds, (int *)CMSG_DATA (cmsg), sizeof(int)*3);
+ *has_fds=TRUE;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": fd[0]=%d, fd[1]=%d, fd[2]=%d", fds[0], fds[1],
+ fds[2]);
+#endif
+ } else {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": no ancillary data");
+#endif
+ *has_fds=FALSE;
+ }
+
+ return(ret);
}
/* Send response on fd (called by the daemon) */
-void _wapi_daemon_response (int fd, WapiHandleResponse *resp)
+int _wapi_daemon_response (int fd, WapiHandleResponse *resp)
{
int ret;
-
+
+ do {
#ifdef HAVE_MSG_NOSIGNAL
- ret=send (fd, resp, sizeof(WapiHandleResponse), MSG_NOSIGNAL);
+ ret=send (fd, resp, sizeof(WapiHandleResponse), MSG_NOSIGNAL);
#else
- ret=send (fd, resp, sizeof(WapiHandleResponse), 0);
+ ret=send (fd, resp, sizeof(WapiHandleResponse), 0);
#endif
- if(ret==-1) {
+ }
+ while (ret==-1 && errno==EINTR);
+
#ifdef DEBUG
+
+ if(ret==-1 || ret != sizeof(WapiHandleResponse)) {
g_warning (G_GNUC_PRETTY_FUNCTION ": Send error: %s",
strerror (errno));
-#endif
/* The next loop around poll() should tidy up */
}
+#endif
+
+ return(ret);
}
diff --git a/mono/io-layer/daemon-messages.h b/mono/io-layer/daemon-messages.h
index 1d3ba81100d..237e951b5e6 100644
--- a/mono/io-layer/daemon-messages.h
+++ b/mono/io-layer/daemon-messages.h
@@ -13,12 +13,16 @@
#include <mono/io-layer/wapi-private.h>
typedef enum {
+ WapiHandleRequestType_Error,
WapiHandleRequestType_New,
WapiHandleRequestType_Open,
WapiHandleRequestType_Close,
WapiHandleRequestType_Scratch,
WapiHandleRequestType_ScratchFree,
WapiHandleRequestType_ProcessFork,
+ WapiHandleRequestType_ProcessKill,
+ WapiHandleRequestType_GetOrSetShare,
+ WapiHandleRequestType_SetShare
} WapiHandleRequestType;
typedef struct
@@ -49,7 +53,6 @@ typedef struct
typedef struct
{
guint32 cmd;
- guint32 args;
guint32 env;
guint32 dir;
guint32 stdin_handle;
@@ -59,6 +62,27 @@ typedef struct
guint32 flags;
} WapiHandleRequest_ProcessFork;
+typedef struct {
+ pid_t pid;
+ gint32 signo;
+} WapiHandleRequest_ProcessKill;
+
+typedef struct
+{
+ dev_t device;
+ ino_t inode;
+ guint32 new_sharemode;
+ guint32 new_access;
+} WapiHandleRequest_GetOrSetShare;
+
+typedef struct
+{
+ dev_t device;
+ ino_t inode;
+ guint32 sharemode;
+ guint32 access;
+} WapiHandleRequest_SetShare;
+
typedef struct
{
WapiHandleRequestType type;
@@ -70,6 +94,9 @@ typedef struct
WapiHandleRequest_Scratch scratch;
WapiHandleRequest_ScratchFree scratch_free;
WapiHandleRequest_ProcessFork process_fork;
+ WapiHandleRequest_ProcessKill process_kill;
+ WapiHandleRequest_GetOrSetShare get_or_set_share;
+ WapiHandleRequest_SetShare set_share;
} u;
} WapiHandleRequest;
@@ -81,6 +108,9 @@ typedef enum {
WapiHandleResponseType_Scratch,
WapiHandleResponseType_ScratchFree,
WapiHandleResponseType_ProcessFork,
+ WapiHandleResponseType_ProcessKill,
+ WapiHandleResponseType_GetOrSetShare,
+ WapiHandleResponseType_SetShare
} WapiHandleResponseType;
typedef struct
@@ -108,6 +138,7 @@ typedef struct
typedef struct
{
guint32 idx;
+ gboolean remap;
} WapiHandleResponse_Scratch;
typedef struct
@@ -125,6 +156,23 @@ typedef struct
typedef struct
{
+ guint32 err;
+} WapiHandleResponse_ProcessKill;
+
+typedef struct
+{
+ gboolean exists;
+ guint32 sharemode;
+ guint32 access;
+} WapiHandleResponse_GetOrSetShare;
+
+typedef struct
+{
+ guint32 dummy;
+} WapiHandleResponse_SetShare;
+
+typedef struct
+{
WapiHandleResponseType type;
union
{
@@ -135,12 +183,21 @@ typedef struct
WapiHandleResponse_Scratch scratch;
WapiHandleResponse_ScratchFree scratch_free;
WapiHandleResponse_ProcessFork process_fork;
+ WapiHandleResponse_ProcessKill process_kill;
+ WapiHandleResponse_GetOrSetShare get_or_set_share;
+ WapiHandleResponse_SetShare set_share;
} u;
} WapiHandleResponse;
extern void _wapi_daemon_request_response (int fd, WapiHandleRequest *req,
WapiHandleResponse *resp);
-extern void _wapi_daemon_request (int fd, WapiHandleRequest *req);
-extern void _wapi_daemon_response (int fd, WapiHandleResponse *resp);
+extern void _wapi_daemon_request_response_with_fds (int fd,
+ WapiHandleRequest *req,
+ WapiHandleResponse *resp,
+ int in_fd, int out_fd,
+ int err_fd);
+extern int _wapi_daemon_request (int fd, WapiHandleRequest *req, int *fds,
+ gboolean *has_fds);
+extern int _wapi_daemon_response (int fd, WapiHandleResponse *resp);
#endif /* _WAPI_DAEMON_MESSAGES_H_ */
diff --git a/mono/io-layer/daemon-private.h b/mono/io-layer/daemon-private.h
new file mode 100644
index 00000000000..4dc59072b84
--- /dev/null
+++ b/mono/io-layer/daemon-private.h
@@ -0,0 +1,24 @@
+/*
+ * daemon-private.h: External daemon functions
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#ifndef _WAPI_DAEMON_PRIVATE_H_
+#define _WAPI_DAEMON_PRIVATE_H_
+
+#include <mono/io-layer/wapi-private.h>
+
+typedef enum {
+ DAEMON_STARTING = 0,
+ DAEMON_RUNNING = 1,
+ DAEMON_DIED_AT_STARTUP = 2,
+ DAEMON_CLOSING = 3
+} _wapi_daemon_status;
+
+extern void _wapi_daemon_main (gpointer data, gpointer scratch);
+
+#endif /* _WAPI_DAEMON_PRIVATE_H_ */
diff --git a/mono/io-layer/daemon.c b/mono/io-layer/daemon.c
index 566ff6245f2..e2eca91b3eb 100644
--- a/mono/io-layer/daemon.c
+++ b/mono/io-layer/daemon.c
@@ -14,36 +14,90 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <sys/poll.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <sys/wait.h>
+#include <string.h>
+#include <sys/time.h>
+
+#ifdef HAVE_POLL
+#include <sys/poll.h>
+#endif
#include <mono/io-layer/io-layer.h>
#include <mono/io-layer/handles-private.h>
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/daemon-messages.h>
#include <mono/io-layer/timefuncs-private.h>
+#include <mono/io-layer/daemon-private.h>
+#include <mono/io-layer/socket-wrappers.h>
#undef DEBUG
-static struct pollfd *pollfds=NULL;
-static int nfds=0, maxfds=0;
-/* handle_refs[0] is used by the daemon itself */
-static gpointer *handle_refs=NULL;
+/* The shared thread codepath doesn't seem to work yet... */
+#undef _POSIX_THREAD_PROCESS_SHARED
+
+/* Keep track of the number of clients */
+static int nfds=0;
+
+/* Arrays to keep track of channel data for the
+ * daemon and clients indexed by file descriptor
+ * value.
+ */
+
+typedef struct _channel_data {
+ int io_source; /* the ID given back by g_io_add_watch */
+ guint32 *open_handles; /* array of open handles for this client */
+} ChannelData;
+
+static ChannelData *daemon_channel_data=NULL;
+static ChannelData *channels=NULL;
+static int channels_length=0;
+
+/* The socket which we listen to new connections on */
static int main_sock;
/* Set to TRUE by the SIGCHLD signal handler */
static volatile gboolean check_processes=FALSE;
+/* The file_share_hash is used to emulate the windows file sharing mode */
+typedef struct _share_key
+{
+ dev_t device;
+ ino_t inode;
+} ShareKey;
+
+typedef struct _share_data
+{
+ guint32 sharemode;
+ guint32 access;
+} ShareData;
+
+static GHashTable *file_share_hash = NULL;
+
+static gboolean fd_activity (GIOChannel *channel, GIOCondition condition,
+ gpointer data);
+static void check_sharing (dev_t device, ino_t inode);
+
/* Deletes the shared memory segment. If we're exiting on error,
* clients will get EPIPEs.
*/
static void cleanup (void)
{
- _wapi_shm_destroy ();
+ int i;
+
+#ifdef NEED_LINK_UNLINK
+ unlink(_wapi_shared_data[0]->daemon);
+#endif
+ for(i=1; i<_wapi_shared_data[0]->num_segments; i++) {
+ unlink (_wapi_shm_file (WAPI_SHM_DATA, i));
+ }
+ unlink (_wapi_shm_file (WAPI_SHM_DATA, 0));
+
+ /* There's only one scratch file */
+ unlink (_wapi_shm_file (WAPI_SHM_SCRATCH, 0));
}
/* If there is only one socket, and no child processes, we can exit.
@@ -52,7 +106,7 @@ static void cleanup (void)
*/
static void maybe_exit (void)
{
- guint32 *open_handles=handle_refs[0], i;
+ guint32 i;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": Seeing if we should exit");
@@ -65,41 +119,121 @@ static void maybe_exit (void)
return;
}
- for(i=0; i<_WAPI_MAX_HANDLES; i++) {
- if(open_handles[i]>0) {
+ /* Prevent new clients from connecting... */
+ _wapi_shared_data[0]->daemon_running=DAEMON_CLOSING;
+
+ for(i=0;
+ i<_wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT;
+ i++) {
+ if(daemon_channel_data->open_handles[i]>0) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": Still got handle references");
#endif
+
+ _wapi_shared_data[0]->daemon_running=DAEMON_RUNNING;
return;
}
}
+#ifdef HAVE_POLL
+ /* Last check, make sure no client came along while we were
+ * checking the handle lists.
+ *
+ * Use poll() directly here, as glib doesn't seem to have any
+ * exposed way of seeing if a file descriptor is ready
+ * (g_io_channel_get_buffer_condition() isn't it.)
+ *
+ * Crappy systems that don't have poll() will just have to
+ * lump it (for them there is still the very slight chance
+ * that someone tried to connect just as the DAEMON_CLOSING
+ * flag was being set.)
+ */
+ {
+ struct pollfd fds[1];
+
+ fds[0].fd=main_sock;
+ fds[0].events=POLLIN;
+ fds[0].revents=0;
+
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Byebye");
+ g_message (G_GNUC_PRETTY_FUNCTION ": Last connect check");
+#endif
+
+ if(poll (fds, 1, 0)>0) {
+ /* Someone did connect, so carry on running */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Someone connected");
#endif
+ _wapi_shared_data[0]->daemon_running=DAEMON_RUNNING;
+ return;
+ }
+ }
+#endif
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Byebye");
+#endif
+
cleanup ();
exit (0);
}
-static void signal_handler (int unused)
+/*
+ * signal_handler:
+ * @unused: unused
+ *
+ * Called if daemon receives a SIGTERM or SIGINT
+ */
+static void signal_handler (int signo)
{
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": daemon received signal %d", signo);
+#endif
cleanup ();
exit (-1);
}
+/*
+ * sigchld_handler:
+ * @unused: unused
+ *
+ * Called if daemon receives a SIGCHLD, and notes that a process needs
+ * to be wait()ed for.
+ */
static void sigchld_handler (int unused)
{
/* Notice that a child process died */
check_processes=TRUE;
}
+static guint sharedata_hash (gconstpointer key)
+{
+ ShareKey *sharekey = (ShareKey *)key;
+
+ return(g_int_hash (&(sharekey->inode)));
+}
+
+static gboolean sharedata_equal (gconstpointer a, gconstpointer b)
+{
+ ShareKey *share_a = (ShareKey *)a;
+ ShareKey *share_b = (ShareKey *)b;
+
+ return(share_a->device == share_b->device &&
+ share_a->inode == share_b->inode);
+}
+
+/*
+ * startup:
+ *
+ * Bind signals, attach to shared memory and set up any internal data
+ * structures needed.
+ */
static void startup (void)
{
struct sigaction sa;
- gboolean success;
- int shm_id;
sa.sa_handler=signal_handler;
sigemptyset (&sa.sa_mask);
@@ -116,12 +250,12 @@ static void startup (void)
sa.sa_flags=SA_NOCLDSTOP;
sigaction (SIGCHLD, &sa, NULL);
- _wapi_shared_data=_wapi_shm_attach (TRUE, &success, &shm_id);
- if(success==FALSE) {
- g_error ("Failed to attach shared memory! (tried shared memory ID 0x%x)", shm_id);
- exit (-1);
- }
-
+#ifdef NEED_LINK_UNLINK
+ /* Here's a more portable method... */
+ snprintf (_wapi_shared_data[0]->daemon, MONO_SIZEOF_SUNPATH-1,
+ "/tmp/mono-handle-daemon-%d-%ld-%ld", getuid (), random (),
+ time (NULL));
+#else
/* Leave the first byte NULL so we create the socket in the
* abstrace namespace, not on the filesystem. (Lets see how
* portable _that_ is :)
@@ -129,73 +263,141 @@ static void startup (void)
* The name is intended to be unique, not cryptographically
* secure...
*/
- snprintf (_wapi_shared_data->daemon+1, 106,
+ snprintf (_wapi_shared_data[0]->daemon+1, MONO_SIZEOF_SUNPATH-2,
"mono-handle-daemon-%d-%d-%ld", getuid (), getpid (),
time (NULL));
+#endif
+
+ file_share_hash = g_hash_table_new_full (sharedata_hash,
+ sharedata_equal, g_free,
+ g_free);
}
-static void ref_handle (guint32 idx, guint32 handle)
+
+/*
+ * ref_handle:
+ * @channel_data: Channel data for calling client
+ * @handle: handle to inc refcnt
+ *
+ * Increase ref count of handle for the calling client. Handle 0 is
+ * ignored.
+ */
+static void ref_handle (ChannelData *channel_data, guint32 handle)
{
- guint32 *open_handles=handle_refs[idx];
+ guint32 segment, idx;
if(handle==0) {
return;
}
- _wapi_shared_data->handles[handle].ref++;
- open_handles[handle]++;
+ _wapi_handle_segment (GUINT_TO_POINTER (handle), &segment, &idx);
+
+ _wapi_shared_data[segment]->handles[idx].ref++;
+ channel_data->open_handles[handle]++;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": handle 0x%x ref now %d (%d this process)", handle,
- _wapi_shared_data->handles[handle].ref,
- open_handles[handle]);
+ _wapi_shared_data[segment]->handles[idx].ref,
+ channel_data->open_handles[handle]);
#endif
}
-static gboolean unref_handle (guint32 idx, guint32 handle)
+/*
+ * unref_handle:
+ * @channel_data: Channel data for calling client
+ * @handle: handle to inc refcnt
+ *
+ * Decrease ref count of handle for the calling client. If global ref
+ * count reaches 0 it is free'ed. Return TRUE if the local ref count
+ * is 0. Handle 0 is ignored.
+ */
+static gboolean unref_handle (ChannelData *channel_data, guint32 handle)
{
- guint32 *open_handles=handle_refs[idx];
gboolean destroy=FALSE;
+ guint32 segment, idx;
if(handle==0) {
return(FALSE);
}
- _wapi_shared_data->handles[handle].ref--;
- open_handles[handle]--;
+ if (channel_data->open_handles[handle] == 0) {
+ g_warning(G_GNUC_PRETTY_FUNCTION
+ ": unref on %d called when ref was already 0",
+ handle);
+ return TRUE;
+ }
+
+ _wapi_handle_segment (GUINT_TO_POINTER (handle), &segment, &idx);
+
+ _wapi_shared_data[segment]->handles[idx].ref--;
+ channel_data->open_handles[handle]--;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": handle 0x%x ref now %d (%d this process)", handle,
- _wapi_shared_data->handles[handle].ref,
- open_handles[handle]);
+ _wapi_shared_data[segment]->handles[idx].ref,
+ channel_data->open_handles[handle]);
#endif
- if(open_handles[handle]==0) {
+ if (_wapi_shared_data[segment]->handles[idx].ref == 0) {
+ gboolean was_file;
+ dev_t device = 0;
+ ino_t inode = 0;
+
/* This client has released the handle */
destroy=TRUE;
- }
- if(_wapi_shared_data->handles[handle].ref==0) {
- if (open_handles[handle]!=0) {
- g_warning (G_GNUC_PRETTY_FUNCTION ": per-process open_handles mismatch, set to %d, should be 0", open_handles[handle]);
+ if (channel_data->open_handles[handle]!=0) {
+ g_warning (G_GNUC_PRETTY_FUNCTION ": per-process open_handles mismatch, set to %d, should be 0",
+ channel_data->open_handles[handle]);
}
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": Destroying handle 0x%x",
handle);
#endif
+
+ /* if this was a file handle, save the device and
+ * inode numbers so we can scan the share info data
+ * later to see if the last handle to a file has been
+ * closed, and delete the data if so.
+ */
+ was_file = (_wapi_shared_data[segment]->handles[idx].type == WAPI_HANDLE_FILE);
+ if (was_file) {
+ struct _WapiHandle_file *file_handle;
+ gboolean ok;
+
+ ok = _wapi_lookup_handle (GUINT_TO_POINTER (handle),
+ WAPI_HANDLE_FILE,
+ (gpointer *)&file_handle,
+ NULL);
+ if (ok == FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up file handle %x",
+ handle);
+ } else {
+ device = file_handle->device;
+ inode = file_handle->inode;
+ }
+ }
_wapi_handle_ops_close_shared (GUINT_TO_POINTER (handle));
- _wapi_shared_data->handles[handle].type=WAPI_HANDLE_UNUSED;
- mono_mutex_destroy (&_wapi_shared_data->handles[handle].signal_mutex);
- pthread_cond_destroy (&_wapi_shared_data->handles[handle].signal_cond);
- memset (&_wapi_shared_data->handles[handle].u, '\0', sizeof(_wapi_shared_data->handles[handle].u));
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ mono_mutex_destroy (&_wapi_shared_data[segment]->handles[idx].signal_mutex);
+ pthread_cond_destroy (&_wapi_shared_data[segment]->handles[idx].signal_cond);
+#endif
+
+ memset (&_wapi_shared_data[segment]->handles[idx].u, '\0', sizeof(_wapi_shared_data[segment]->handles[idx].u));
+ _wapi_shared_data[segment]->handles[idx].type=WAPI_HANDLE_UNUSED;
+
+ if (was_file) {
+ check_sharing (device, inode);
+ }
}
- if(idx==0) {
+ if(channel_data == daemon_channel_data) {
/* The daemon released a reference, so see if it's
* ready to exit
*/
@@ -205,30 +407,80 @@ static gboolean unref_handle (guint32 idx, guint32 handle)
return(destroy);
}
-static void add_fd(int fd)
+/*
+ * add_fd:
+ * @fd: Filehandle to add
+ *
+ * Create a new GIOChannel, and add it to the main loop event sources.
+ */
+static void add_fd(int fd, GMainContext *context)
{
- if(nfds==maxfds) {
- /* extend the array */
- maxfds+=10;
- pollfds=g_renew (struct pollfd, pollfds, maxfds);
- handle_refs=g_renew (gpointer, handle_refs, maxfds);
+ GIOChannel *io_channel;
+ GSource *source;
+ guint32 *refs;
+
+ io_channel=g_io_channel_unix_new (fd);
+
+ /* Turn off all encoding and buffering crap */
+ g_io_channel_set_encoding (io_channel, NULL, NULL);
+ g_io_channel_set_buffered (io_channel, FALSE);
+
+ refs=g_new0 (guint32,_wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT);
+
+ if(fd>=channels_length) {
+ /* Add a bit of padding, so we dont resize for _every_
+ * new connection
+ */
+ int old_len=channels_length * sizeof(ChannelData);
+
+ channels_length=fd+10;
+ if(channels==NULL) {
+ channels=g_new0 (ChannelData, channels_length);
+ /* We rely on the daemon channel being created first.
+ * That's safe, because every other channel is the
+ * result of an accept() on the daemon channel.
+ */
+ daemon_channel_data = &channels[fd];
+ } else {
+ int daemon_index=daemon_channel_data - channels;
+
+ /* Can't use g_renew here, because the unused
+ * elements must be NULL and g_renew doesn't
+ * initialise the memory it returns
+ */
+ channels=_wapi_g_renew0 (channels, old_len, channels_length * sizeof(ChannelData));
+ daemon_channel_data = channels + daemon_index;
+ }
+
}
- pollfds[nfds].fd=fd;
- pollfds[nfds].events=POLLIN;
- pollfds[nfds].revents=0;
-
- handle_refs[nfds]=g_new0 (guint32, _WAPI_MAX_HANDLES);
+ channels[fd].open_handles=refs;
+
+ source = g_io_create_watch (io_channel,
+ G_IO_IN|G_IO_ERR|G_IO_HUP|G_IO_NVAL);
+ g_source_set_callback (source, (GSourceFunc)fd_activity,
+ context, NULL);
+ channels[fd].io_source=g_source_attach (source, context);
+ g_source_unref (source);
nfds++;
}
-static void rem_fd(int idx)
+/*
+ * rem_fd:
+ * @channel: GIOChannel to close
+ *
+ * Closes the IO channel. Closes all handles that it may have open. If
+ * only main_sock is left, the daemon is shut down.
+ */
+static void rem_fd(GIOChannel *channel, ChannelData *channel_data)
{
- guint32 *open_handles=handle_refs[idx], handle_count;
- int i, j;
+ guint32 handle_count;
+ int i, j, fd;
+
+ fd=g_io_channel_unix_get_fd (channel);
- if(idx==0) {
+ if(fd == main_sock) {
/* We shouldn't be deleting the daemon's fd */
g_warning (G_GNUC_PRETTY_FUNCTION ": Deleting daemon fd!");
cleanup ();
@@ -236,25 +488,41 @@ static void rem_fd(int idx)
}
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Removing client at %d", idx);
+ g_message (G_GNUC_PRETTY_FUNCTION ": Removing client fd %d", fd);
#endif
- close(pollfds[idx].fd);
+ if (channel_data->io_source == 0) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": channel already closed for fd %d", fd);
+#endif
+ return;
+ }
+
+
+ g_io_channel_shutdown (channel, TRUE, NULL);
+ g_source_remove (channel_data->io_source);
+ g_io_channel_unref (channel);
- for(i=0; i<_WAPI_MAX_HANDLES; i++) {
- handle_count=open_handles[i];
+ for(i=0;
+ i<_wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT;
+ i++) {
+ handle_count=channel_data->open_handles[i];
for(j=0; j<handle_count; j++) {
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": closing handle 0x%x for client at index %d", i, idx);
+ g_message (G_GNUC_PRETTY_FUNCTION ": closing handle 0x%x for client at index %d", i, g_io_channel_unix_get_fd (channel));
#endif
/* Ignore the hint to the client to destroy
* the handle private data
*/
- unref_handle (idx, i);
+ unref_handle (channel_data, i);
}
}
+ g_free (channel_data->open_handles);
+ channel_data->open_handles=NULL;
+ channel_data->io_source=0;
+
nfds--;
if(nfds==1) {
/* Just the master socket left, so see if we can
@@ -262,15 +530,103 @@ static void rem_fd(int idx)
*/
maybe_exit ();
}
+}
+
+static void sharemode_set (dev_t device, ino_t inode, guint32 sharemode,
+ guint32 access)
+{
+ ShareKey *sharekey;
+ ShareData *sharedata;
+
+ sharekey = g_new (ShareKey, 1);
+ sharekey->device = device;
+ sharekey->inode = inode;
+
+ sharedata = g_new (ShareData, 1);
+ sharedata->sharemode = sharemode;
+ sharedata->access = access;
+
+ /* Setting share mode to include all access bits is really
+ * removing the share info
+ */
+ if (sharemode == (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE)) {
+ g_hash_table_remove (file_share_hash, sharekey);
+ } else {
+ g_hash_table_insert (file_share_hash, sharekey, sharedata);
+ }
+}
+
+static gboolean sharemode_get (dev_t device, ino_t inode, guint32 *sharemode,
+ guint32 *access)
+{
+ ShareKey sharekey;
+ ShareData *sharedata;
+
+ sharekey.device = device;
+ sharekey.inode = inode;
+
+ sharedata = (ShareData *)g_hash_table_lookup (file_share_hash,
+ &sharekey);
+ if (sharedata == NULL) {
+ return(FALSE);
+ }
+
+ *sharemode = sharedata->sharemode;
+ *access = sharedata->access;
+
+ return(TRUE);
+}
+
+static gboolean share_compare (gpointer handle, gpointer user_data)
+{
+ struct _WapiHandle_file *file_handle;
+ gboolean ok;
+ ShareKey *sharekey = (ShareKey *)user_data;
+
+ ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
+ (gpointer *)&file_handle, NULL);
+ if (ok == FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up file handle %p", handle);
+ return(FALSE);
+ }
- memset(&pollfds[idx], '\0', sizeof(struct pollfd));
- g_free (handle_refs[idx]);
+ if (file_handle->device == sharekey->device &&
+ file_handle->inode == sharekey->inode) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": found one, handle %p",
+ handle);
+#endif
+ return(TRUE);
+ } else {
+ return(FALSE);
+ }
+}
+
+static void check_sharing (dev_t device, ino_t inode)
+{
+ ShareKey sharekey;
+ gpointer file_handle;
- if(idx<nfds) {
- memmove(&pollfds[idx], &pollfds[idx+1],
- sizeof(struct pollfd) * (nfds-idx));
- memmove (&handle_refs[idx], &handle_refs[idx+1],
- sizeof(guint32) * (nfds-idx));
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Checking if anything has (dev 0x%llx, inode %lld) still open", device, inode);
+#endif
+
+ sharekey.device = device;
+ sharekey.inode = inode;
+
+ file_handle = _wapi_search_handle (WAPI_HANDLE_FILE, share_compare,
+ &sharekey, NULL, NULL);
+
+ if (file_handle == NULL) {
+ /* Delete this share info, as the last handle to it
+ * has been closed
+ */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Deleting share data for (dev 0x%llx inode %lld)", device, inode);
+#endif
+
+ g_hash_table_remove (file_share_hash, &sharekey);
}
}
@@ -279,6 +635,7 @@ static gboolean process_compare (gpointer handle, gpointer user_data)
struct _WapiHandle_process *process_handle;
gboolean ok;
pid_t pid;
+ guint32 segment, idx;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_PROCESS,
(gpointer *)&process_handle, NULL);
@@ -288,6 +645,11 @@ static gboolean process_compare (gpointer handle, gpointer user_data)
return(FALSE);
}
+ _wapi_handle_segment (handle, &segment, &idx);
+ if (_wapi_shared_data[segment]->handles[idx].signalled) {
+ return(FALSE);
+ }
+
pid=GPOINTER_TO_UINT (user_data);
if(process_handle->id==pid) {
return(TRUE);
@@ -300,6 +662,7 @@ static gboolean process_thread_compare (gpointer handle, gpointer user_data)
{
struct _WapiHandle_thread *thread_handle;
gboolean ok;
+ guint32 segment, idx;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
(gpointer *)&thread_handle, NULL);
@@ -320,7 +683,7 @@ static gboolean process_thread_compare (gpointer handle, gpointer user_data)
thread_handle->exitstatus=0;
-#ifdef _POSIX_THREAD_PROCESS_SHARED
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
_wapi_handle_lock_handle (handle);
_wapi_handle_set_signal_state (handle, TRUE, TRUE);
_wapi_handle_unlock_handle (handle);
@@ -332,7 +695,8 @@ static gboolean process_thread_compare (gpointer handle, gpointer user_data)
* to cope with missing condition signals for when
* process-shared pthread support is missing.
*/
- _wapi_shared_data->handles[GPOINTER_TO_UINT (handle)].signalled=TRUE;
+ _wapi_handle_segment (handle, &segment, &idx);
+ _wapi_shared_data[segment]->handles[idx].signalled=TRUE;
#endif /* _POSIX_THREAD_PROCESS_SHARED */
}
@@ -350,6 +714,7 @@ static void process_post_mortem (pid_t pid, int status)
{
gpointer process_handle;
struct _WapiHandle_process *process_handle_data;
+ guint32 segment, idx;
process_handle=_wapi_search_handle (WAPI_HANDLE_PROCESS,
process_compare,
@@ -357,28 +722,42 @@ static void process_post_mortem (pid_t pid, int status)
(gpointer *)&process_handle_data,
NULL);
if(process_handle==0) {
+#ifdef DEBUG
+ /*
+ * This may happen if we use Process.EnableRaisingEvents +
+ * process.Exited event and the parent has finished.
+ */
g_warning (G_GNUC_PRETTY_FUNCTION
": Couldn't find handle for process %d!", pid);
+#endif
} else {
/* Signal the handle. Don't use
* _wapi_handle_set_signal_state() unless we have
* process-shared pthread support.
*/
+ struct timeval tv;
+
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": Set process %d exitstatus to %d", pid,
WEXITSTATUS (status));
#endif
- /* Technically WEXITSTATUS is only valid if the
- * process exited normally, but I don't care if the
- * process caught a signal or not.
+ /* If the child terminated due to the receipt of a signal,
+ * the exit status must be based on WTERMSIG, since WEXITSTATUS
+ * returns 0 in this case.
*/
- process_handle_data->exitstatus=WEXITSTATUS (status);
- _wapi_time_t_to_filetime (time (NULL),
- &process_handle_data->exit_time);
+ if (WIFSIGNALED(status))
+ process_handle_data->exitstatus=128 + WTERMSIG (status);
+ else
+ process_handle_data->exitstatus=WEXITSTATUS (status);
+
+ /* Ignore errors */
+ gettimeofday (&tv, NULL);
+ _wapi_timeval_to_filetime (&tv,
+ &process_handle_data->exit_time);
-#ifdef _POSIX_THREAD_PROCESS_SHARED
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
_wapi_handle_lock_handle (process_handle);
_wapi_handle_set_signal_state (process_handle, TRUE, TRUE);
_wapi_handle_unlock_handle (process_handle);
@@ -390,7 +769,8 @@ static void process_post_mortem (pid_t pid, int status)
* to cope with missing condition signals for when
* process-shared pthread support is missing.
*/
- _wapi_shared_data->handles[GPOINTER_TO_UINT (process_handle)].signalled=TRUE;
+ _wapi_handle_segment (process_handle, &segment, &idx);
+ _wapi_shared_data[segment]->handles[idx].signalled=TRUE;
#endif /* _POSIX_THREAD_PROCESS_SHARED */
}
@@ -401,8 +781,9 @@ static void process_post_mortem (pid_t pid, int status)
(void)_wapi_search_handle (WAPI_HANDLE_THREAD, process_thread_compare,
process_handle, NULL, NULL);
- unref_handle (0, GPOINTER_TO_UINT (process_handle_data->main_thread));
- unref_handle (0, GPOINTER_TO_UINT (process_handle));
+ unref_handle (daemon_channel_data,
+ GPOINTER_TO_UINT (process_handle_data->main_thread));
+ unref_handle (daemon_channel_data, GPOINTER_TO_UINT (process_handle));
}
static void process_died (void)
@@ -435,20 +816,82 @@ static void process_died (void)
}
}
-static void send_reply (guint32 idx, WapiHandleResponse *resp)
+
+/*
+ * send_reply:
+ * @channel: channel to send reply to
+ * @resp: Package to send
+ *
+ * Send a package to a client
+ */
+static void send_reply (GIOChannel *channel, WapiHandleResponse *resp)
{
/* send message */
- _wapi_daemon_response (pollfds[idx].fd, resp);
+ _wapi_daemon_response (g_io_channel_unix_get_fd (channel), resp);
+}
+
+static guint32 new_handle_with_shared_check (WapiHandleType type)
+{
+ guint32 handle = 0;
+
+ while ((handle = _wapi_handle_new_internal (type)) == 0) {
+ /* Try and allocate a new shared segment, and have
+ * another go
+ */
+ guint32 segment=_wapi_shared_data[0]->num_segments;
+ int i;
+
+ _wapi_handle_ensure_mapped (segment);
+ if(_wapi_shared_data[segment]!=NULL) {
+ /* Got a new segment */
+ gulong old_len, new_len;
+
+ old_len=_wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT * sizeof(guint32);
+ _wapi_shared_data[0]->num_segments++;
+ new_len=_wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT * sizeof(guint32);
+
+ /* Need to expand all the handle reference
+ * count arrays
+ */
+
+ for(i=0; i<channels_length; i++) {
+ if(channels[i].open_handles!=NULL) {
+ channels[i].open_handles=_wapi_g_renew0 (channels[i].open_handles, old_len, new_len);
+ }
+ }
+ } else {
+ /* Map failed. Just return 0 meaning "out of
+ * handles"
+ */
+ break;
+ }
+ }
+
+ return(handle);
}
-static void process_new (guint32 idx, WapiHandleType type)
+/*
+ * process_new:
+ * @channel: The client making the request
+ * @channel_data: Our data for this channel
+ * @type: type to init handle to
+ *
+ * Find a free handle and initialize it to 'type', increase refcnt and
+ * send back a reply to the client.
+ */
+static void process_new (GIOChannel *channel, ChannelData *channel_data,
+ WapiHandleType type)
{
guint32 handle;
- WapiHandleResponse resp;
+ WapiHandleResponse resp={0};
+
+ handle = new_handle_with_shared_check (type);
- /* handle might be set to 0. This is handled at the client end */
- handle=_wapi_handle_new_internal (type);
- ref_handle (idx, handle);
+ /* handle might still be set to 0. This is handled at the
+ * client end
+ */
+
+ ref_handle (channel_data, handle);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": returning new handle 0x%x",
@@ -459,16 +902,30 @@ static void process_new (guint32 idx, WapiHandleType type)
resp.u.new.type=type;
resp.u.new.handle=handle;
- send_reply (idx, &resp);
+ send_reply (channel, &resp);
}
-static void process_open (guint32 idx, guint32 handle)
+/*
+ * process_open:
+ * @channel: The client making the request
+ * @channel_data: Our data for this channel
+ * @handle: handle no.
+ *
+ * Increase refcnt on a previously created handle and send back a
+ * response to the client.
+ */
+static void process_open (GIOChannel *channel, ChannelData *channel_data,
+ guint32 handle)
{
- WapiHandleResponse resp;
- struct _WapiHandleShared *shared=&_wapi_shared_data->handles[handle];
+ WapiHandleResponse resp={0};
+ guint32 segment, idx;
+ struct _WapiHandleShared *shared;
+
+ _wapi_handle_segment (GUINT_TO_POINTER (handle), &segment, &idx);
+ shared=&_wapi_shared_data[segment]->handles[idx];
if(shared->type!=WAPI_HANDLE_UNUSED && handle!=0) {
- ref_handle (idx, handle);
+ ref_handle (channel_data, handle);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
@@ -479,7 +936,7 @@ static void process_open (guint32 idx, guint32 handle)
resp.u.new.type=shared->type;
resp.u.new.handle=handle;
- send_reply (idx, &resp);
+ send_reply (channel, &resp);
return;
}
@@ -487,41 +944,64 @@ static void process_open (guint32 idx, guint32 handle)
resp.type=WapiHandleResponseType_Open;
resp.u.new.handle=0;
- send_reply (idx, &resp);
+ send_reply (channel, &resp);
}
-static void process_close (guint32 idx, guint32 handle)
+/*
+ * process_close:
+ * @channel: The client making the request
+ * @channel_data: Our data for this channel
+ * @handle: handle no.
+ *
+ * Decrease refcnt on a previously created handle and send back a
+ * response to the client with notice of it being destroyed.
+ */
+static void process_close (GIOChannel *channel, ChannelData *channel_data,
+ guint32 handle)
{
- WapiHandleResponse resp;
+ WapiHandleResponse resp={0};
resp.type=WapiHandleResponseType_Close;
- resp.u.close.destroy=unref_handle (idx, handle);
+ resp.u.close.destroy=unref_handle (channel_data, handle);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unreffing handle 0x%x", handle);
#endif
- send_reply (idx, &resp);
+ send_reply (channel, &resp);
}
-static void process_scratch (guint32 idx, guint32 length)
+/*
+ * process_scratch:
+ * @channel: The client making the request
+ * @length: allocate this much scratch space
+ *
+ * Allocate some scratch space and send a reply to the client.
+ */
+static void process_scratch (GIOChannel *channel, guint32 length)
{
- WapiHandleResponse resp;
+ WapiHandleResponse resp={0};
resp.type=WapiHandleResponseType_Scratch;
- resp.u.scratch.idx=_wapi_handle_scratch_store_internal (length);
-
+ resp.u.scratch.idx=_wapi_handle_scratch_store_internal (length, &resp.u.scratch.remap);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": allocating scratch index 0x%x",
resp.u.scratch.idx);
#endif
- send_reply (idx, &resp);
+ send_reply (channel, &resp);
}
-static void process_scratch_free (guint32 idx, guint32 scratch_idx)
+/*
+ * process_scratch_free:
+ * @channel: The client making the request
+ * @scratch_idx: deallocate this scratch space
+ *
+ * Deallocate scratch space and send a reply to the client.
+ */
+static void process_scratch_free (GIOChannel *channel, guint32 scratch_idx)
{
- WapiHandleResponse resp;
+ WapiHandleResponse resp={0};
resp.type=WapiHandleResponseType_ScratchFree;
_wapi_handle_scratch_delete_internal (scratch_idx);
@@ -531,17 +1011,57 @@ static void process_scratch_free (guint32 idx, guint32 scratch_idx)
scratch_idx);
#endif
- send_reply (idx, &resp);
+ send_reply (channel, &resp);
}
-static void process_process_fork (guint32 idx,
- WapiHandleRequest_ProcessFork process_fork)
+/*
+ * process_process_kill:
+ * @channel: The client making the request
+ * @process_kill: pid and signal to send to the pid.
+ *
+ * Sends the specified signal to the process.
+ */
+static void
+process_process_kill (GIOChannel *channel,
+ WapiHandleRequest_ProcessKill process_kill)
{
- WapiHandleResponse resp;
+ WapiHandleResponse resp = {0};
+
+ resp.type = WapiHandleResponseType_ProcessKill;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": kill (%d, %d)",
+ process_kill.pid, process_kill.signo);
+#endif
+ if (kill (process_kill.pid, process_kill.signo) == -1) {
+ resp.u.process_kill.err = errno;
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": kill (%d, %d) failed: %d",
+ process_kill.pid, process_kill.signo, resp.u.process_kill.err);
+#endif
+ }
+
+ send_reply (channel, &resp);
+}
+
+/*
+ * process_process_fork:
+ * @channel: The client making the request
+ * @process_fork: Describes the process to fork
+ * @fds: stdin, stdout, and stderr for the new process
+ *
+ * Forks a new process, and returns the process and thread data to the
+ * client.
+ */
+static void process_process_fork (GIOChannel *channel, ChannelData *channel_data,
+ WapiHandleRequest_ProcessFork process_fork,
+ int *fds)
+{
+ WapiHandleResponse resp={0};
guint32 process_handle, thread_handle;
struct _WapiHandle_process *process_handle_data;
struct _WapiHandle_thread *thread_handle_data;
- pid_t pid;
+ pid_t pid = 0;
resp.type=WapiHandleResponseType_ProcessFork;
@@ -551,94 +1071,178 @@ static void process_process_fork (guint32 idx,
* client must check if either handle is 0 and take
* appropriate error handling action.
*/
- process_handle=_wapi_handle_new_internal (WAPI_HANDLE_PROCESS);
- ref_handle (0, process_handle);
- ref_handle (idx, process_handle);
+ process_handle = new_handle_with_shared_check (WAPI_HANDLE_PROCESS);
+ ref_handle (daemon_channel_data, process_handle);
+ ref_handle (channel_data, process_handle);
- thread_handle=_wapi_handle_new_internal (WAPI_HANDLE_THREAD);
- ref_handle (0, thread_handle);
- ref_handle (idx, thread_handle);
+ thread_handle = new_handle_with_shared_check (WAPI_HANDLE_THREAD);
+ ref_handle (daemon_channel_data, thread_handle);
+ ref_handle (channel_data, thread_handle);
if(process_handle==0 || thread_handle==0) {
/* unref_handle() copes with the handle being 0 */
- unref_handle (0, process_handle);
- unref_handle (idx, process_handle);
- unref_handle (0, thread_handle);
- unref_handle (idx, thread_handle);
+ unref_handle (daemon_channel_data, process_handle);
+ unref_handle (channel_data, process_handle);
+ unref_handle (daemon_channel_data, thread_handle);
+ unref_handle (channel_data, thread_handle);
process_handle=0;
thread_handle=0;
} else {
- char *cmd=NULL, *args=NULL;
-
- /* Get usable copies of the cmd and args now rather
- * than in the child process. This is to prevent the
- * race condition where the parent can return the
- * reply to the client, which then promptly deletes
- * the scratch data before the new process gets to see
- * it.
+ char *cmd=NULL, *dir=NULL, **argv, **env;
+ GError *gerr=NULL;
+ gboolean ret;
+ struct timeval tv;
+
+ /* Get usable copies of the cmd, dir and env now
+ * rather than in the child process. This is to
+ * prevent the race condition where the parent can
+ * return the reply to the client, which then promptly
+ * deletes the scratch data before the new process
+ * gets to see it. Also explode argv here so we can
+ * use it to set the process name.
*/
- cmd=_wapi_handle_scratch_lookup_as_string (process_fork.cmd);
- if(process_fork.args!=0) {
- args=_wapi_handle_scratch_lookup_as_string (process_fork.args);
- }
-
+ cmd=_wapi_handle_scratch_lookup (process_fork.cmd);
+ dir=_wapi_handle_scratch_lookup (process_fork.dir);
+ env=_wapi_handle_scratch_lookup_string_array (process_fork.env);
+
+ ret=g_shell_parse_argv (cmd, NULL, &argv, &gerr);
+ if(ret==FALSE) {
+ /* FIXME: Could do something with the
+ * GError here
+ */
+ process_handle_data->exec_errno=gerr->code;
+ } else {
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": forking");
+ g_message (G_GNUC_PRETTY_FUNCTION ": forking");
#endif
- _wapi_lookup_handle (GUINT_TO_POINTER (process_handle),
- WAPI_HANDLE_PROCESS,
- (gpointer *)&process_handle_data, NULL);
+ _wapi_lookup_handle (GUINT_TO_POINTER (process_handle),
+ WAPI_HANDLE_PROCESS,
+ (gpointer *)&process_handle_data,
+ NULL);
- _wapi_lookup_handle (GUINT_TO_POINTER (thread_handle),
- WAPI_HANDLE_THREAD,
- (gpointer *)&thread_handle_data, NULL);
+ _wapi_lookup_handle (GUINT_TO_POINTER (thread_handle),
+ WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle_data,
+ NULL);
- /* Fork, exec cmd with args and optional env, and
- * return the handles with pid and blank thread id
- */
- pid=fork ();
- if(pid==-1) {
- process_handle_data->exec_errno=errno;
- } else if (pid==0) {
- /* child */
- char **argv;
-
- /* should we detach from the process group?
- * We're already running without a controlling
- * tty...
+ /* Fork, exec cmd with args and optional env,
+ * and return the handles with pid and blank
+ * thread id
*/
- if(process_fork.inherit!=TRUE) {
+ pid=fork ();
+ if(pid==-1) {
+ process_handle_data->exec_errno=errno;
+ } else if (pid==0) {
+ /* child */
+ int i;
+
+ /* should we detach from the process
+ * group? We're already running
+ * without a controlling tty...
+ */
+
+ /* Connect stdin, stdout and stderr */
+ dup2 (fds[0], 0);
+ dup2 (fds[1], 1);
+ dup2 (fds[2], 2);
+
+ if(process_fork.inherit!=TRUE) {
+ /* FIXME: do something here */
+ }
+
/* Close all file descriptors */
- }
-
- /* Connect stdin, stdout and stderr */
+ for (i = getdtablesize () - 1; i > 2; i--) {
+ close (i);
+ }
+ /* pass process and thread handle info
+ * to the child, so it doesn't have to
+ * do an expensive search over the
+ * whole list
+ */
+ {
+ guint env_count=0;
+
+ while(env[env_count]!=NULL) {
+ env_count++;
+ }
+
+ env=(char **)g_renew (char **, env, env_count+3);
+
+ env[env_count]=g_strdup_printf ("_WAPI_PROCESS_HANDLE=%d", process_handle);
+ env[env_count+1]=g_strdup_printf ("_WAPI_THREAD_HANDLE=%d", thread_handle);
+ env[env_count+2]=NULL;
+ }
+
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION
- ": exec()ing [%s] args [%s]", cmd, args);
-#endif
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": exec()ing [%s] in dir [%s]",
+ cmd, dir);
+ {
+ i=0;
+ while(argv[i]!=NULL) {
+ g_message ("arg %d: [%s]",
+ i, argv[i]);
+ i++;
+ }
+
+ i=0;
+ while(env[i]!=NULL) {
+ g_message ("env %d: [%s]",
+ i, env[i]);
+ i++;
+ }
+ }
+#endif
+
+ /* set cwd */
+ if(chdir (dir)==-1) {
+ process_handle_data->exec_errno=errno;
+ exit (-1);
+ }
+
+ /* exec */
+ execve (argv[0], argv, env);
- if(args!=NULL) {
- argv=g_strsplit (args, " \t", 0);
- } else {
- argv=g_new0 (char *, 1);
+ /* bummer! */
+ process_handle_data->exec_errno=errno;
+ exit (-1);
}
+ }
+ /* parent */
+
+ /* store process name, based on the last section of the cmd */
+ {
+ char *slash=strrchr (argv[0], '/');
- /* exec */
- execv (cmd, argv);
+ if(slash!=NULL) {
+ process_handle_data->proc_name=_wapi_handle_scratch_store (slash+1, strlen (slash+1));
+ } else {
+ process_handle_data->proc_name=_wapi_handle_scratch_store (argv[0], strlen (argv[0]));
+ }
+ }
+
+ /* These seem to be the defaults on w2k */
+ process_handle_data->min_working_set=204800;
+ process_handle_data->max_working_set=1413120;
- /* bummer! */
- process_handle_data->exec_errno=errno;
- exit (-1);
+ if(cmd!=NULL) {
+ g_free (cmd);
}
- /* parent */
+ if(dir!=NULL) {
+ g_free (dir);
+ }
+ g_strfreev (argv);
+ g_strfreev (env);
/* store pid */
process_handle_data->id=pid;
process_handle_data->main_thread=GUINT_TO_POINTER (thread_handle);
- _wapi_time_t_to_filetime (time (NULL),
- &process_handle_data->create_time);
+ /* Ignore errors */
+ gettimeofday (&tv, NULL);
+ _wapi_timeval_to_filetime (&tv,
+ &process_handle_data->create_time);
/* FIXME: if env==0, inherit the env from the current
* process
@@ -649,62 +1253,268 @@ static void process_process_fork (guint32 idx,
resp.u.process_fork.pid=pid;
}
-
+
resp.u.process_fork.process_handle=process_handle;
resp.u.process_fork.thread_handle=thread_handle;
- send_reply (idx, &resp);
+ send_reply (channel, &resp);
}
-static void read_message (guint32 idx)
+/*
+ * process_set_share:
+ * @channel: The client making the request
+ * @channel_data: The channel data
+ * @set_share: Set share data passed from the client
+ *
+ * Sets file share info
+ */
+static void process_set_share (GIOChannel *channel, ChannelData *channel_data,
+ WapiHandleRequest_SetShare set_share)
+{
+ WapiHandleResponse resp = {0};
+
+ resp.type = WapiHandleResponseType_SetShare;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Setting share for file (dev:0x%llx, ino:%lld) mode 0x%x access 0x%x", set_share.device, set_share.inode, set_share.sharemode, set_share.access);
+#endif
+
+ sharemode_set (set_share.device, set_share.inode, set_share.sharemode,
+ set_share.access);
+
+ send_reply (channel, &resp);
+}
+
+/*
+ * process_get_or_set_share:
+ * @channel: The client making the request
+ * @channel_data: The channel data
+ * @get_share: GetOrSetShare data passed from the client
+ *
+ * Gets a file share status, and sets the status if it doesn't already
+ * exist
+ */
+static void process_get_or_set_share (GIOChannel *channel,
+ ChannelData *channel_data,
+ WapiHandleRequest_GetOrSetShare get_share)
+{
+ WapiHandleResponse resp = {0};
+
+ resp.type = WapiHandleResponseType_GetOrSetShare;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Getting share status for file (dev:0x%llx, ino:%lld)",
+ get_share.device, get_share.inode);
+#endif
+
+ resp.u.get_or_set_share.exists = sharemode_get (get_share.device, get_share.inode, &resp.u.get_or_set_share.sharemode, &resp.u.get_or_set_share.access);
+
+ if (resp.u.get_or_set_share.exists) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Share mode: 0x%x",
+ resp.u.get_or_set_share.sharemode);
+#endif
+ } else {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": file share info not already known, setting");
+#endif
+ sharemode_set (get_share.device, get_share.inode,
+ get_share.new_sharemode, get_share.new_access);
+ }
+
+ send_reply (channel, &resp);
+}
+
+/*
+ * read_message:
+ * @channel: The client to read the request from
+ * @open_handles: An array of handles referenced by this client
+ *
+ * Read a message (A WapiHandleRequest) from a client and dispatch
+ * whatever it wants to the process_* calls. Return TRUE if the message
+ * was read successfully, FALSE otherwise.
+ */
+static gboolean read_message (GIOChannel *channel, ChannelData *channel_data)
{
WapiHandleRequest req;
+ int fds[3]={0, 1, 2};
+ int ret;
+ gboolean has_fds=FALSE;
/* Reading data */
- _wapi_daemon_request (pollfds[idx].fd, &req);
+ ret=_wapi_daemon_request (g_io_channel_unix_get_fd (channel), &req,
+ fds, &has_fds);
+ if(ret==0) {
+ /* Other end went away */
+#ifdef DEBUG
+ g_message ("Read 0 bytes on fd %d, closing it",
+ g_io_channel_unix_get_fd (channel));
+#endif
+ rem_fd (channel, channel_data);
+ return(FALSE);
+ }
+
+#ifdef DEBUG
+ g_message ("Process request %d", req.type);
+#endif
switch(req.type) {
case WapiHandleRequestType_New:
- process_new (idx, req.u.new.type);
+ process_new (channel, channel_data, req.u.new.type);
break;
case WapiHandleRequestType_Open:
- process_open (idx, req.u.open.handle);
+#ifdef DEBUG
+ g_assert(req.u.open.handle < _wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT);
+#endif
+ process_open (channel, channel_data, req.u.open.handle);
break;
case WapiHandleRequestType_Close:
- process_close (idx, req.u.close.handle);
+#ifdef DEBUG
+ g_assert(req.u.close.handle < _wapi_shared_data[0]->num_segments * _WAPI_HANDLES_PER_SEGMENT);
+#endif
+ process_close (channel, channel_data, req.u.close.handle);
break;
case WapiHandleRequestType_Scratch:
- process_scratch (idx, req.u.scratch.length);
+ process_scratch (channel, req.u.scratch.length);
break;
case WapiHandleRequestType_ScratchFree:
- process_scratch_free (idx, req.u.scratch_free.idx);
+ process_scratch_free (channel, req.u.scratch_free.idx);
break;
case WapiHandleRequestType_ProcessFork:
- process_process_fork (idx, req.u.process_fork);
+ process_process_fork (channel, channel_data,
+ req.u.process_fork, fds);
break;
+ case WapiHandleRequestType_ProcessKill:
+ process_process_kill (channel, req.u.process_kill);
+ break;
+ case WapiHandleRequestType_SetShare:
+ process_set_share (channel, channel_data, req.u.set_share);
+ break;
+ case WapiHandleRequestType_GetOrSetShare:
+ process_get_or_set_share (channel, channel_data,
+ req.u.get_or_set_share);
+ break;
+ case WapiHandleRequestType_Error:
+ /* fall through */
+ default:
+ /* Catch bogus requests */
+ /* FIXME: call rem_fd? */
+ break;
+ }
+
+ if(has_fds==TRUE) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": closing %d", fds[0]);
+ g_message (G_GNUC_PRETTY_FUNCTION ": closing %d", fds[1]);
+ g_message (G_GNUC_PRETTY_FUNCTION ": closing %d", fds[2]);
+#endif
+
+ close (fds[0]);
+ close (fds[1]);
+ close (fds[2]);
+ }
+
+ return(TRUE);
+}
+
+/*
+ * fd_activity:
+ * @channel: The IO channel that is active
+ * @condition: The condition that has been satisfied
+ * @data: A pointer to an array of handles referenced by this client
+ *
+ * The callback called by the main loop when there is activity on an
+ * IO channel.
+ */
+static gboolean fd_activity (GIOChannel *channel, GIOCondition condition,
+ gpointer data)
+{
+ int fd=g_io_channel_unix_get_fd (channel);
+ ChannelData *channel_data=&channels[fd];
+ GMainContext *context=data;
+
+ if(condition & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) {
+#ifdef DEBUG
+ g_message ("fd %d error", fd);
+#endif
+
+ rem_fd (channel, channel_data);
+ return(FALSE);
+ }
+
+ if(condition & (G_IO_IN | G_IO_PRI)) {
+ if(fd==main_sock) {
+ int newsock;
+ struct sockaddr addr;
+ socklen_t addrlen=sizeof(struct sockaddr);
+
+ newsock=accept (main_sock, &addr, &addrlen);
+ if(newsock==-1) {
+ g_critical ("accept error: %s",
+ g_strerror (errno));
+ cleanup ();
+ exit (-1);
+ }
+
+#ifdef DEBUG
+ g_message ("accept returning %d", newsock);
+#endif
+
+ add_fd (newsock, context);
+ } else {
+#ifdef DEBUG
+ g_message ("reading data on fd %d", fd);
+#endif
+
+ return(read_message (channel, channel_data));
+ }
+ return(TRUE);
}
+
+ return(FALSE); /* remove source */
}
-int main(int argc, char **argv)
+/*
+ * _wapi_daemon_main:
+ *
+ * Open socket, create shared mem segment and begin listening for
+ * clients.
+ */
+void _wapi_daemon_main(gpointer data, gpointer scratch)
{
struct sockaddr_un main_socket_address;
int ret;
+ GMainContext *context;
#ifdef DEBUG
g_message ("Starting up...");
#endif
+ _wapi_shared_data[0]=data;
+ _wapi_shared_scratch=scratch;
+ _wapi_shared_scratch->is_shared=TRUE;
+
+ /* Note that we've got the starting segment already */
+ _wapi_shared_data[0]->num_segments=1;
+ _wapi_shm_mapped_segments=1;
+
+ _wapi_fd_offset_table_size=getdtablesize ();
+ _wapi_shared_data[0]->fd_offset_table_size = _wapi_fd_offset_table_size;
+
startup ();
main_sock=socket(PF_UNIX, SOCK_STREAM, 0);
main_socket_address.sun_family=AF_UNIX;
- memcpy(main_socket_address.sun_path, _wapi_shared_data->daemon, 108);
+ memcpy(main_socket_address.sun_path, _wapi_shared_data[0]->daemon,
+ MONO_SIZEOF_SUNPATH);
ret=bind(main_sock, (struct sockaddr *)&main_socket_address,
sizeof(struct sockaddr_un));
if(ret==-1) {
- g_warning ("bind failed: %s", strerror (errno));
- _wapi_shared_data->daemon_running=2;
+ g_critical ("bind failed: %s", g_strerror (errno));
+ _wapi_shared_data[0]->daemon_running=DAEMON_DIED_AT_STARTUP;
exit(-1);
}
@@ -714,8 +1524,8 @@ int main(int argc, char **argv)
ret=listen(main_sock, 5);
if(ret==-1) {
- g_warning ("listen failed: %s", strerror (errno));
- _wapi_shared_data->daemon_running=2;
+ g_critical ("listen failed: %s", g_strerror (errno));
+ _wapi_shared_data[0]->daemon_running=DAEMON_DIED_AT_STARTUP;
exit(-1);
}
@@ -723,17 +1533,17 @@ int main(int argc, char **argv)
g_message("listening");
#endif
- add_fd(main_sock);
+ context = g_main_context_new ();
+
+ add_fd(main_sock, context);
/* We're finished setting up, let everyone else know we're
* ready. From now on, it's up to us to delete the shared
* memory segment when appropriate.
*/
- _wapi_shared_data->daemon_running=1;
+ _wapi_shared_data[0]->daemon_running=DAEMON_RUNNING;
while(TRUE) {
- int i;
-
if(check_processes==TRUE) {
process_died ();
}
@@ -742,49 +1552,12 @@ int main(int argc, char **argv)
g_message ("polling");
#endif
- /* Block until something happens */
- ret=poll(pollfds, nfds, -1);
- if(ret==-1 && errno!=EINTR) {
- g_message ("poll error: %s", strerror (errno));
- cleanup ();
- exit(-1);
- }
-
- for(i=0; i<nfds; i++) {
- if(((pollfds[i].revents&POLLHUP)==POLLHUP) ||
- ((pollfds[i].revents&POLLERR)==POLLERR) ||
- ((pollfds[i].revents&POLLNVAL)==POLLNVAL)) {
-#ifdef DEBUG
- g_message ("fd[%d] %d error", i,
- pollfds[i].fd);
-#endif
- rem_fd(i);
- } else if((pollfds[i].revents&POLLIN)==POLLIN) {
- if(pollfds[i].fd==main_sock) {
- int newsock;
- struct sockaddr addr;
- socklen_t addrlen=sizeof(struct sockaddr);
- newsock=accept(main_sock, &addr,
- &addrlen);
- if(newsock==-1) {
- g_message("accept error: %s",
- strerror (errno));
- cleanup ();
- exit(-1);
- }
-#ifdef DEBUG
- g_message ("accept returning %d",
- newsock);
-#endif
- add_fd(newsock);
- } else {
-#ifdef DEBUG
- g_message ("reading data on fd %d",
- pollfds[i].fd);
-#endif
- read_message (i);
- }
- }
- }
+ /* Block until something happens. We don't use
+ * g_main_loop_run() because we rely on the SIGCHLD
+ * signal interrupting poll() so we can reap child
+ * processes as soon as they die, without burning cpu
+ * time by polling the flag.
+ */
+ g_main_context_iteration (context, TRUE);
}
}
diff --git a/mono/io-layer/error.c b/mono/io-layer/error.c
index 4e91047580c..b167c1e9999 100644
--- a/mono/io-layer/error.c
+++ b/mono/io-layer/error.c
@@ -10,6 +10,8 @@
#include <config.h>
#include <glib.h>
#include <pthread.h>
+#include <string.h>
+#include <errno.h>
#include "mono/io-layer/wapi.h"
@@ -18,7 +20,10 @@ static mono_once_t error_key_once=MONO_ONCE_INIT;
static void error_init(void)
{
- pthread_key_create(&error_key, NULL);
+ int ret;
+
+ ret = pthread_key_create(&error_key, NULL);
+ g_assert (ret == 0);
}
/**
@@ -49,7 +54,160 @@ guint32 GetLastError(void)
*/
void SetLastError(guint32 code)
{
+ int ret;
+
/* Set the thread-local error code */
mono_once(&error_key_once, error_init);
- pthread_setspecific(error_key, GUINT_TO_POINTER(code));
+ ret = pthread_setspecific(error_key, GUINT_TO_POINTER(code));
+ g_assert (ret == 0);
}
+
+guint32
+errno_to_WSA (guint32 code, const gchar *function_name)
+{
+ gint result = -1;
+ char *sys_error;
+ gchar *msg;
+
+ switch (code) {
+ case EACCES: result = WSAEACCES; break;
+ case EADDRINUSE: result = WSAEADDRINUSE; break;
+ case EAFNOSUPPORT: result = WSAEAFNOSUPPORT; break;
+#if EAGAIN != EWOULDBLOCK
+ case EAGAIN: result = WSAEWOULDBLOCK; break;
+#endif
+ case EALREADY: result = WSAEALREADY; break;
+ case EBADF: result = WSAENOTSOCK; break;
+ case ECONNABORTED: result = WSAENETDOWN; break;
+ case ECONNREFUSED: result = WSAECONNREFUSED; break;
+ case ECONNRESET: result = WSAECONNRESET; break;
+ case EFAULT: result = WSAEFAULT; break;
+ case EHOSTUNREACH: result = WSAEHOSTUNREACH; break;
+ case EINPROGRESS: result = WSAEINPROGRESS; break;
+ case EINTR: result = WSAEINTR; break;
+ case EINVAL: result = WSAEINVAL; break;
+ /*FIXME: case EIO: result = WSAE????; break; */
+ case EISCONN: result = WSAEISCONN; break;
+ /* FIXME: case ELOOP: result = WSA????; break; */
+ case EMFILE: result = WSAEMFILE; break;
+ case EMSGSIZE: result = WSAEMSGSIZE; break;
+ /* FIXME: case ENAMETOOLONG: result = WSAEACCES; break; */
+ case ENETUNREACH: result = WSAENETUNREACH; break;
+ case ENOBUFS: result = WSAENOBUFS; break; /* not documented */
+ /* case ENOENT: result = WSAE????; break; */
+ case ENOMEM: result = WSAENOBUFS; break;
+ case ENOPROTOOPT: result = WSAENOPROTOOPT; break;
+#ifdef ENOSR
+ case ENOSR: result = WSAENETDOWN; break;
+#endif
+ case ENOTCONN: result = WSAENOTCONN; break;
+ /*FIXME: case ENOTDIR: result = WSAE????; break; */
+ case ENOTSOCK: result = WSAENOTSOCK; break;
+ case ENOTTY: result = WSAENOTSOCK; break;
+ case EOPNOTSUPP: result = WSAEOPNOTSUPP; break;
+ case EPERM: result = WSAEACCES; break;
+ case EPIPE: result = WSAESHUTDOWN; break;
+ case EPROTONOSUPPORT: result = WSAEPROTONOSUPPORT; break;
+#if ERESTARTSYS
+ case ERESTARTSYS: result = WSAENETDOWN; break;
+#endif
+ /*FIXME: case EROFS: result = WSAE????; break; */
+ case ESOCKTNOSUPPORT: result = WSAESOCKTNOSUPPORT; break;
+ case ETIMEDOUT: result = WSAENETDOWN; break;
+ case EWOULDBLOCK: result = WSAEWOULDBLOCK; break;
+ default:
+ sys_error = strerror (code);
+ msg = g_locale_to_utf8 (sys_error, strlen (sys_error), NULL, NULL, NULL);
+ if (function_name == NULL)
+ function_name = G_GNUC_PRETTY_FUNCTION;
+
+ g_warning ("%s: Need to translate %d [%s] into winsock error",
+ function_name, code, msg);
+
+ g_free (msg);
+ result = WSASYSCALLFAILURE;
+ }
+
+ return result;
+}
+
+gint
+_wapi_get_win32_file_error (gint err)
+{
+ gint ret;
+ /* mapping ideas borrowed from wine. they may need some work */
+
+ switch (err) {
+ case EACCES: case EPERM: case EROFS:
+ ret = ERROR_ACCESS_DENIED;
+ break;
+
+ case EAGAIN:
+ ret = ERROR_SHARING_VIOLATION;
+ break;
+
+ case EBUSY:
+ ret = ERROR_LOCK_VIOLATION;
+ break;
+
+ case EEXIST:
+ ret = ERROR_FILE_EXISTS;
+ break;
+
+ case EINVAL: case ESPIPE:
+ ret = ERROR_SEEK;
+ break;
+
+ case EISDIR:
+ ret = ERROR_CANNOT_MAKE;
+ break;
+
+ case ENFILE: case EMFILE:
+ ret = ERROR_NO_MORE_FILES;
+ break;
+
+ case ENOENT: case ENOTDIR:
+ ret = ERROR_FILE_NOT_FOUND;
+ break;
+
+ case ENOSPC:
+ ret = ERROR_HANDLE_DISK_FULL;
+ break;
+
+ case ENOTEMPTY:
+ ret = ERROR_DIR_NOT_EMPTY;
+ break;
+
+ case ENOEXEC:
+ ret = ERROR_BAD_FORMAT;
+ break;
+
+ case ENAMETOOLONG:
+ ret = ERROR_FILENAME_EXCED_RANGE;
+ break;
+
+ case EINPROGRESS:
+ ret = ERROR_IO_PENDING;
+ break;
+
+ case ENOSYS:
+ ret = ERROR_NOT_SUPPORTED;
+ break;
+
+ case EBADF:
+ ret = ERROR_INVALID_HANDLE;
+ break;
+
+ case EIO:
+ ret = ERROR_INVALID_HANDLE;
+ break;
+
+ default:
+ g_message ("Unknown errno: %s\n", strerror (err));
+ ret = ERROR_GEN_FAILURE;
+ break;
+ }
+
+ return ret;
+}
+
diff --git a/mono/io-layer/error.h b/mono/io-layer/error.h
index e07156d0d36..a07dc774814 100644
--- a/mono/io-layer/error.h
+++ b/mono/io-layer/error.h
@@ -1792,10 +1792,16 @@ typedef enum {
ERROR_SXS_UNTRANSLATABLE_HRESULT = 14077,
ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING = 14078,
ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE = 14079,
- ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME = 14080,
+ ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME = 14080
} WapiError;
-extern guint32 GetLastError(void);
-extern void SetLastError(guint32 code);
+G_BEGIN_DECLS
+
+guint32 GetLastError (void);
+void SetLastError (guint32 code);
+guint32 errno_to_WSA (guint32 code, const char *function_name);
+gint _wapi_get_win32_file_error (gint err);
+
+G_END_DECLS
#endif /* _WAPI_ERROR_H_ */
diff --git a/mono/io-layer/event-private.h b/mono/io-layer/event-private.h
index e0046554f11..2f7da3a8d8c 100644
--- a/mono/io-layer/event-private.h
+++ b/mono/io-layer/event-private.h
@@ -21,6 +21,7 @@ extern struct _WapiHandleOps _wapi_event_ops;
struct _WapiHandle_event
{
gboolean manual;
+ guint32 set_count;
};
struct _WapiHandlePrivate_event
diff --git a/mono/io-layer/events.c b/mono/io-layer/events.c
index 60dfea7299e..c99175dd342 100644
--- a/mono/io-layer/events.c
+++ b/mono/io-layer/events.c
@@ -85,7 +85,11 @@ static void event_own (gpointer handle)
#endif
if(event_handle->manual==FALSE) {
- _wapi_handle_set_signal_state (handle, FALSE, FALSE);
+ g_assert (event_handle->set_count > 0);
+
+ if (--event_handle->set_count == 0) {
+ _wapi_handle_set_signal_state (handle, FALSE, FALSE);
+ }
}
}
@@ -110,11 +114,13 @@ static void event_own (gpointer handle)
* Return value: A new handle, or %NULL on error.
*/
gpointer CreateEvent(WapiSecurityAttributes *security G_GNUC_UNUSED, gboolean manual,
- gboolean initial, const guchar *name G_GNUC_UNUSED)
+ gboolean initial, const gunichar2 *name G_GNUC_UNUSED)
{
struct _WapiHandle_event *event_handle;
gpointer handle;
gboolean ok;
+ gpointer ret = NULL;
+ int thr_ret;
mono_once (&event_ops_once, event_ops_init);
@@ -125,20 +131,28 @@ gpointer CreateEvent(WapiSecurityAttributes *security G_GNUC_UNUSED, gboolean ma
return(NULL);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_EVENT,
(gpointer *)&event_handle, NULL);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up event handle %p", handle);
- _wapi_handle_unlock_handle (handle);
- return(NULL);
+ goto cleanup;
}
+ ret = handle;
event_handle->manual=manual;
+ event_handle->set_count = 0;
if(initial==TRUE) {
+ if (manual == FALSE) {
+ event_handle->set_count = 1;
+ }
+
_wapi_handle_set_signal_state (handle, TRUE, FALSE);
}
@@ -147,9 +161,13 @@ gpointer CreateEvent(WapiSecurityAttributes *security G_GNUC_UNUSED, gboolean ma
handle);
#endif
- _wapi_handle_unlock_handle (handle);
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
- return(handle);
+ pthread_cleanup_pop (0);
+
+ return(ret);
}
/**
@@ -171,6 +189,7 @@ gboolean PulseEvent(gpointer handle)
{
struct _WapiHandle_event *event_handle;
gboolean ok;
+ int thr_ret;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_EVENT,
(gpointer *)&event_handle, NULL);
@@ -180,7 +199,10 @@ gboolean PulseEvent(gpointer handle)
return(FALSE);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Pulsing event handle %p", handle);
@@ -189,10 +211,14 @@ gboolean PulseEvent(gpointer handle)
if(event_handle->manual==TRUE) {
_wapi_handle_set_signal_state (handle, TRUE, TRUE);
} else {
+ event_handle->set_count++;
_wapi_handle_set_signal_state (handle, TRUE, FALSE);
}
- _wapi_handle_unlock_handle (handle);
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
if(event_handle->manual==TRUE) {
/* For a manual-reset event, we're about to try and
@@ -212,9 +238,15 @@ gboolean PulseEvent(gpointer handle)
": Obtained write lock on event handle %p", handle);
#endif
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle, handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
+
_wapi_handle_set_signal_state (handle, FALSE, FALSE);
- _wapi_handle_unlock_handle (handle);
+
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
}
return(TRUE);
@@ -233,6 +265,7 @@ gboolean ResetEvent(gpointer handle)
{
struct _WapiHandle_event *event_handle;
gboolean ok;
+ int thr_ret;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_EVENT,
(gpointer *)&event_handle, NULL);
@@ -247,26 +280,31 @@ gboolean ResetEvent(gpointer handle)
handle);
#endif
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
+
if(_wapi_handle_issignalled (handle)==FALSE) {
-
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": No need to reset event handle %p", handle);
#endif
-
- _wapi_handle_unlock_handle (handle);
- return(TRUE);
- }
-
+ } else {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": Obtained write lock on event handle %p", handle);
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": Obtained write lock on event handle %p", handle);
#endif
- _wapi_handle_set_signal_state (handle, FALSE, FALSE);
-
- _wapi_handle_unlock_handle (handle);
+ _wapi_handle_set_signal_state (handle, FALSE, FALSE);
+ }
+
+ event_handle->set_count = 0;
+
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
return(TRUE);
}
@@ -289,6 +327,7 @@ gboolean SetEvent(gpointer handle)
{
struct _WapiHandle_event *event_handle;
gboolean ok;
+ int thr_ret;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_EVENT,
(gpointer *)&event_handle, NULL);
@@ -298,7 +337,10 @@ gboolean SetEvent(gpointer handle)
return(FALSE);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Setting event handle %p", handle);
@@ -307,10 +349,14 @@ gboolean SetEvent(gpointer handle)
if(event_handle->manual==TRUE) {
_wapi_handle_set_signal_state (handle, TRUE, TRUE);
} else {
+ event_handle->set_count++;
_wapi_handle_set_signal_state (handle, TRUE, FALSE);
}
- _wapi_handle_unlock_handle (handle);
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
return(TRUE);
}
diff --git a/mono/io-layer/events.h b/mono/io-layer/events.h
index 7ae5247ba34..8d480978c77 100644
--- a/mono/io-layer/events.h
+++ b/mono/io-layer/events.h
@@ -13,7 +13,7 @@
#include <glib.h>
extern gpointer CreateEvent(WapiSecurityAttributes *security, gboolean manual,
- gboolean initial, const guchar *name);
+ gboolean initial, const gunichar2 *name);
extern gboolean PulseEvent(gpointer handle);
extern gboolean ResetEvent(gpointer handle);
extern gboolean SetEvent(gpointer handle);
diff --git a/mono/io-layer/handles-private.h b/mono/io-layer/handles-private.h
index 9331547ca72..ad03546705c 100644
--- a/mono/io-layer/handles-private.h
+++ b/mono/io-layer/handles-private.h
@@ -15,11 +15,21 @@
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/shared.h>
+#include <mono/io-layer/misc-private.h>
#undef DEBUG
-extern struct _WapiHandleShared_list *_wapi_shared_data;
-extern struct _WapiHandlePrivate_list *_wapi_private_data;
+/* Shared threads dont seem to work yet */
+#undef _POSIX_THREAD_PROCESS_SHARED
+
+extern struct _WapiHandleShared_list **_wapi_shared_data;
+extern struct _WapiHandleScratch *_wapi_shared_scratch;
+extern struct _WapiHandlePrivate_list **_wapi_private_data;
+extern pthread_mutex_t _wapi_shared_mutex;
+extern guint32 _wapi_shm_mapped_segments;
+
+extern guint32 _wapi_fd_offset_table_size;
+extern gpointer *_wapi_fd_offset_table;
extern guint32 _wapi_handle_new_internal (WapiHandleType type);
extern gpointer _wapi_handle_new (WapiHandleType type);
@@ -29,14 +39,21 @@ extern gpointer _wapi_search_handle (WapiHandleType type,
gboolean (*check)(gpointer, gpointer),
gpointer user_data,
gpointer *shared, gpointer *private);
+extern gpointer _wapi_search_handle_namespace (WapiHandleType type,
+ gchar *utf8_name,
+ gpointer *shared,
+ gpointer *private);
extern void _wapi_handle_ref (gpointer handle);
extern void _wapi_handle_unref (gpointer handle);
-extern guint32 _wapi_handle_scratch_store_internal (guint32 bytes);
+extern guint32 _wapi_handle_scratch_store_internal (guint32 bytes,
+ gboolean *remap);
extern guint32 _wapi_handle_scratch_store (gconstpointer data, guint32 bytes);
-extern gconstpointer _wapi_handle_scratch_lookup (guint32 idx);
-extern guchar *_wapi_handle_scratch_lookup_as_string (guint32 idx);
+extern guint32 _wapi_handle_scratch_store_string_array (gchar **data);
+extern gpointer _wapi_handle_scratch_lookup (guint32 idx);
+extern gchar **_wapi_handle_scratch_lookup_string_array (guint32 idx);
extern void _wapi_handle_scratch_delete_internal (guint32 idx);
extern void _wapi_handle_scratch_delete (guint32 idx);
+extern void _wapi_handle_scratch_delete_string_array (guint32 idx);
extern void _wapi_handle_register_capabilities (WapiHandleType type,
WapiHandleCapability caps);
extern gboolean _wapi_handle_test_capabilities (gpointer handle,
@@ -59,9 +76,9 @@ extern int _wapi_handle_timedwait_signal (struct timespec *timeout);
extern int _wapi_handle_wait_signal_handle (gpointer handle);
extern int _wapi_handle_timedwait_signal_handle (gpointer handle,
struct timespec *timeout);
-extern gboolean _wapi_handle_process_fork (guint32 cmd, guint32 args,
- guint32 env, guint32 dir,
- gboolean inherit, guint32 flags,
+extern gboolean _wapi_handle_process_fork (guint32 cmd, guint32 env,
+ guint32 dir, gboolean inherit,
+ guint32 flags,
gpointer stdin_handle,
gpointer stdout_handle,
gpointer stderr_handle,
@@ -69,19 +86,239 @@ extern gboolean _wapi_handle_process_fork (guint32 cmd, guint32 args,
gpointer *thread_handle,
guint32 *pid, guint32 *tid);
+extern gboolean _wapi_handle_process_kill (pid_t pid, guint32 signo,
+ gint *err);
+extern gboolean _wapi_handle_get_or_set_share (dev_t device, ino_t inode,
+ guint32 new_sharemode,
+ guint32 new_access,
+ guint32 *old_sharemode,
+ guint32 *old_access);
+extern void _wapi_handle_set_share (dev_t device, ino_t inode,
+ guint32 sharemode, guint32 access);
+
+static inline struct _WapiHandleShared_list *_wapi_handle_get_shared_segment (guint32 segment)
+{
+ struct _WapiHandleShared_list *shared;
+ int thr_ret;
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&_wapi_shared_mutex);
+ thr_ret = pthread_mutex_lock (&_wapi_shared_mutex);
+ g_assert (thr_ret == 0);
+
+ shared=_wapi_shared_data[segment];
+
+ thr_ret = pthread_mutex_unlock (&_wapi_shared_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(shared);
+}
+
+static inline struct _WapiHandlePrivate_list *_wapi_handle_get_private_segment (guint32 segment)
+{
+ struct _WapiHandlePrivate_list *priv;
+ int thr_ret;
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&_wapi_shared_mutex);
+ thr_ret = pthread_mutex_lock (&_wapi_shared_mutex);
+ g_assert (thr_ret == 0);
+
+ priv=_wapi_private_data[segment];
+
+ thr_ret = pthread_mutex_unlock (&_wapi_shared_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(priv);
+}
+
+static inline void _wapi_handle_ensure_mapped (guint32 segment)
+{
+ int thr_ret;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": checking segment %d is mapped",
+ segment);
+ g_message (G_GNUC_PRETTY_FUNCTION ": _wapi_shm_mapped_segments: %d",
+ _wapi_shm_mapped_segments);
+ if(segment<_wapi_shm_mapped_segments) {
+ g_message (G_GNUC_PRETTY_FUNCTION ": _wapi_handle_get_shared_segment(segment): %p", _wapi_handle_get_shared_segment (segment));
+ }
+#endif
+
+ if(segment<_wapi_shm_mapped_segments &&
+ _wapi_handle_get_shared_segment (segment)!=NULL) {
+ /* Got it already */
+ return;
+ }
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&_wapi_shared_mutex);
+ thr_ret = pthread_mutex_lock (&_wapi_shared_mutex);
+ g_assert (thr_ret == 0);
+
+ if(segment>=_wapi_shm_mapped_segments) {
+ /* Need to extend the arrays. We can't use g_renew
+ * here, because the unmapped segments must be NULL,
+ * and g_renew doesn't initialise the memory it
+ * returns
+ */
+ gulong old_len, new_len;
+
+ old_len=_wapi_shm_mapped_segments;
+ new_len=segment+1;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": extending shared array: mapped_segments is %d",
+ _wapi_shm_mapped_segments);
+#endif
+
+ _wapi_shared_data=_wapi_g_renew0 (_wapi_shared_data, sizeof(struct _WapiHandleShared_list *) * old_len, sizeof(struct _WapiHandleShared_list *) * new_len);
+
+ if(_wapi_private_data!=NULL) {
+ /* the daemon doesn't deal with private data */
+ _wapi_private_data=_wapi_g_renew0 (_wapi_private_data, sizeof(struct _WapiHandlePrivate_list *) * old_len, sizeof(struct _WapiHandlePrivate_list *) * new_len);
+ }
+
+ _wapi_shm_mapped_segments=segment+1;
+ }
+
+ if(_wapi_shared_data[segment]==NULL) {
+ /* Need to map it too */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": mapping segment %d",
+ segment);
+#endif
+
+ _wapi_shared_data[segment]=_wapi_shm_file_map (WAPI_SHM_DATA,
+ segment, NULL,
+ NULL);
+ if(_wapi_private_data!=NULL) {
+ /* the daemon doesn't deal with private data */
+ _wapi_private_data[segment]=g_new0 (struct _WapiHandlePrivate_list, 1);
+ }
+ }
+
+ thr_ret = pthread_mutex_unlock (&_wapi_shared_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+}
+
+static inline void _wapi_handle_segment (gpointer handle, guint32 *segment,
+ guint32 *idx)
+{
+ guint32 h=GPOINTER_TO_UINT (handle);
+ div_t divvy;
+
+ divvy=div (h, _WAPI_HANDLES_PER_SEGMENT);
+ *segment=divvy.quot;
+ *idx=divvy.rem;
+}
+
+static inline guint32 _wapi_handle_index (guint32 segment, guint32 idx)
+{
+ return((segment*_WAPI_HANDLES_PER_SEGMENT)+idx);
+}
+
+static inline gpointer _wapi_handle_fd_offset_to_handle (gpointer fd_handle)
+{
+ int fd = GPOINTER_TO_INT (fd_handle);
+ gpointer handle;
+
+ if (fd >= _wapi_fd_offset_table_size) {
+ return(NULL);
+ }
+
+ handle = _wapi_fd_offset_table[fd];
+
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ return(NULL);
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Returning fd offset %d of %p", fd,
+ handle);
+#endif
+
+ return(handle);
+}
+
static inline WapiHandleType _wapi_handle_type (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx;
+ guint32 segment;
- return(_wapi_shared_data->handles[idx].type);
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ if(segment>=_wapi_shm_mapped_segments)
+ return WAPI_HANDLE_UNUSED;
+
+ return(_wapi_handle_get_shared_segment (segment)->handles[idx].type);
+}
+
+static inline void _wapi_handle_fd_offset_store (int fd, gpointer handle)
+{
+ g_assert (fd < _wapi_fd_offset_table_size);
+
+ if (_wapi_fd_offset_table[fd] != NULL && handle != NULL) {
+ gpointer oldhandle = _wapi_fd_offset_table[fd];
+ struct _WapiHandlePrivate *private_handle;
+ guint32 idx;
+ guint32 segment;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Reassigning fd offset %d from %p", fd,
+ oldhandle);
+#endif
+
+ /* The WapiFDMapped struct at the head of the private
+ * handle data means we don't need to do a full
+ * lookup, and we don't need to know the handle type.
+ */
+ g_assert (_wapi_handle_type (oldhandle) == WAPI_HANDLE_FILE ||
+ _wapi_handle_type (oldhandle) == WAPI_HANDLE_CONSOLE ||
+ _wapi_handle_type (oldhandle) == WAPI_HANDLE_PIPE ||
+ _wapi_handle_type (oldhandle) == WAPI_HANDLE_SOCKET);
+
+ _wapi_handle_segment (oldhandle, &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+
+ private_handle=&_wapi_handle_get_private_segment(segment)->handles[idx];
+ ((WapiFDMapped *)(&private_handle->u))->assigned = FALSE;
+ }
+
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size || handle==NULL);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Assigning fd offset %d to %p", fd,
+ handle);
+#endif
+
+ _wapi_fd_offset_table[fd]=handle;
}
static inline void _wapi_handle_set_signal_state (gpointer handle,
gboolean state,
gboolean broadcast)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
-
+ guint32 idx;
+ guint32 segment;
+ struct _WapiHandleShared *shared_handle;
+ int thr_ret;
+
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
+
+ _wapi_handle_segment (handle, &segment, &idx);
+ shared_handle=&_wapi_handle_get_shared_segment (segment)->handles[idx];
+
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": setting state of %p to %s (broadcast %s)", handle, state?"TRUE":"FALSE", broadcast?"TRUE":"FALSE");
#endif
@@ -92,45 +329,73 @@ static inline void _wapi_handle_set_signal_state (gpointer handle,
/* This function _must_ be called with
* handle->signal_mutex locked
*/
- _wapi_shared_data->handles[idx].signalled=state;
+ shared_handle->signalled=state;
if(broadcast==TRUE) {
- pthread_cond_broadcast (&_wapi_shared_data->handles[idx].signal_cond);
+ thr_ret = pthread_cond_broadcast (&shared_handle->signal_cond);
+ g_assert (thr_ret == 0);
} else {
- pthread_cond_signal (&_wapi_shared_data->handles[idx].signal_cond);
+ thr_ret = pthread_cond_signal (&shared_handle->signal_cond);
+ g_assert (thr_ret == 0);
}
/* Tell everyone blocking on multiple handles that something
* was signalled
*/
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- mono_mutex_lock (&_wapi_shared_data->signal_mutex);
- pthread_cond_broadcast (&_wapi_shared_data->signal_cond);
- mono_mutex_unlock (&_wapi_shared_data->signal_mutex);
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ {
+ struct _WapiHandleShared_list *segment0=_wapi_handle_get_shared_segment (0);
+
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup, (void *)&segment0->signal_mutex);
+ thr_ret = mono_mutex_lock (&segment0->signal_mutex);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_cond_broadcast (&segment0->signal_cond);
+ g_assert (thr_ret == 0);
+
+ thr_ret = mono_mutex_unlock (&segment0->signal_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+ }
#else
+ {
+ struct _WapiHandlePrivate_list *segment0=_wapi_handle_get_private_segment (0);
+
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": lock global signal mutex");
+ g_message (G_GNUC_PRETTY_FUNCTION ": lock global signal mutex");
#endif
- mono_mutex_lock (&_wapi_private_data->signal_mutex);
- pthread_cond_broadcast (&_wapi_private_data->signal_cond);
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup, (void *)&segment0->signal_mutex);
+ thr_ret = mono_mutex_lock (&segment0->signal_mutex);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_cond_broadcast (&segment0->signal_cond);
+ g_assert (thr_ret == 0);
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": unlock global signal mutex");
+ g_message (G_GNUC_PRETTY_FUNCTION ": unlock global signal mutex");
#endif
- mono_mutex_unlock (&_wapi_private_data->signal_mutex);
+ thr_ret = mono_mutex_unlock (&segment0->signal_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+ }
#endif /* _POSIX_THREAD_PROCESS_SHARED */
} else {
- _wapi_shared_data->handles[idx].signalled=state;
+ shared_handle->signalled=state;
}
}
static inline gboolean _wapi_handle_issignalled (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
-
- return(_wapi_shared_data->handles[idx].signalled);
+ guint32 idx;
+ guint32 segment;
+
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ return(_wapi_handle_get_shared_segment (segment)->handles[idx].signalled);
}
static inline int _wapi_handle_lock_signal_mutex (void)
@@ -138,45 +403,63 @@ static inline int _wapi_handle_lock_signal_mutex (void)
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": lock global signal mutex");
#endif
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- return(mono_mutex_lock (&_wapi_shared_data->signal_mutex));
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ return(mono_mutex_lock (&_wapi_handle_get_shared_segment (0)->signal_mutex));
#else
- return(mono_mutex_lock (&_wapi_private_data->signal_mutex));
+ return(mono_mutex_lock (&_wapi_handle_get_private_segment (0)->signal_mutex));
#endif /* _POSIX_THREAD_PROCESS_SHARED */
}
-static inline int _wapi_handle_unlock_signal_mutex (void)
+/* the parameter makes it easier to call from a pthread cleanup handler */
+static inline int _wapi_handle_unlock_signal_mutex (void *unused)
{
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unlock global signal mutex");
#endif
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- return(mono_mutex_unlock (&_wapi_shared_data->signal_mutex));
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ return(mono_mutex_unlock (&_wapi_handle_get_shared_segment (0)->signal_mutex));
#else
- return(mono_mutex_unlock (&_wapi_private_data->signal_mutex));
+ return(mono_mutex_unlock (&_wapi_handle_get_private_segment (0)->signal_mutex));
#endif /* _POSIX_THREAD_PROCESS_SHARED */
}
static inline int _wapi_handle_lock_handle (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
-
+ guint32 idx;
+ guint32 segment;
+
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
+
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": locking handle %p", handle);
#endif
+
+ _wapi_handle_ref (handle);
+
+ _wapi_handle_segment (handle, &segment, &idx);
- return(mono_mutex_lock (&_wapi_shared_data->handles[idx].signal_mutex));
+ return(mono_mutex_lock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex));
}
static inline int _wapi_handle_unlock_handle (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
-
+ guint32 idx;
+ guint32 segment;
+ int ret;
+
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
+
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handle %p", handle);
#endif
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ ret = mono_mutex_unlock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
+
+ _wapi_handle_unref (handle);
- return(mono_mutex_unlock (&_wapi_shared_data->handles[idx].signal_mutex));
+ return(ret);
}
#endif /* _WAPI_HANDLES_PRIVATE_H_ */
diff --git a/mono/io-layer/handles.c b/mono/io-layer/handles.c
index 88af3c2b318..a1c3dde13ef 100644
--- a/mono/io-layer/handles.c
+++ b/mono/io-layer/handles.c
@@ -12,13 +12,13 @@
#include <pthread.h>
#include <errno.h>
#include <unistd.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <sys/mman.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/wapi-private.h>
@@ -29,9 +29,24 @@
#include <mono/io-layer/daemon-messages.h>
#undef DEBUG
+#undef HEAVY_DEBUG /* This will print handle counts on every handle created */
-static WapiHandleCapability handle_caps[WAPI_HANDLE_COUNT]={0};
+/* Shared threads don't seem to work yet */
+#undef _POSIX_THREAD_PROCESS_SHARED
+
+/*
+ * This flag _MUST_ remain set to FALSE in the daemon process. When
+ * we exec()d a standalone daemon, that happened because shared_init()
+ * didnt get called in the daemon process. Now we just fork() without
+ * exec(), we need to ensure that the fork() happens when shared is
+ * still FALSE.
+ *
+ * This is further complicated by the second attempt to start the
+ * daemon if the connect() fails.
+ */
static gboolean shared=FALSE;
+
+static WapiHandleCapability handle_caps[WAPI_HANDLE_COUNT]={0};
static struct _WapiHandleOps *handle_ops[WAPI_HANDLE_COUNT]={
NULL,
&_wapi_file_ops,
@@ -43,6 +58,7 @@ static struct _WapiHandleOps *handle_ops[WAPI_HANDLE_COUNT]={
&_wapi_socket_ops,
&_wapi_find_ops,
&_wapi_process_ops,
+ &_wapi_pipe_ops,
};
static int daemon_sock;
@@ -50,33 +66,51 @@ static int daemon_sock;
static pthread_mutexattr_t mutex_shared_attr;
static pthread_condattr_t cond_shared_attr;
-struct _WapiHandleShared_list *_wapi_shared_data=NULL;
-struct _WapiHandlePrivate_list *_wapi_private_data=NULL;
+struct _WapiHandleShared_list **_wapi_shared_data=NULL;
+struct _WapiHandleScratch *_wapi_shared_scratch=NULL;
+struct _WapiHandlePrivate_list **_wapi_private_data=NULL;
+pthread_mutex_t _wapi_shared_mutex=PTHREAD_MUTEX_INITIALIZER;
+
+/* This holds the length of the _wapi_shared_data and
+ * _wapi_private_data arrays, so we know if a segment is off the end
+ * of the array, requiring a realloc
+ */
+guint32 _wapi_shm_mapped_segments;
+
+guint32 _wapi_fd_offset_table_size;
+gpointer *_wapi_fd_offset_table=NULL;
-int disable_shm = 0;
static void shared_init (void)
{
struct sockaddr_un shared_socket_address;
+ gboolean tried_once=FALSE;
int ret;
-
- if (getenv ("MONO_ENABLE_SHM"))
- disable_shm = 0;
+ int thr_ret;
+ _wapi_shared_data=g_new0 (struct _WapiHandleShared_list *, 1);
+ _wapi_private_data=g_new0 (struct _WapiHandlePrivate_list *, 1);
+
+attach_again:
+
#ifndef DISABLE_SHARED_HANDLES
- if(getenv ("MONO_DISABLE_SHM") || disable_shm)
+ if(getenv ("MONO_DISABLE_SHM"))
#endif
{
shared=FALSE;
#ifndef DISABLE_SHARED_HANDLES
} else {
- int shm_id;
+ /* Ensure that shared==FALSE while _wapi_shm_attach()
+ * calls fork()
+ */
+ shared=FALSE;
- _wapi_shared_data=_wapi_shm_attach (FALSE, &shared, &shm_id);
+ shared=_wapi_shm_attach (&_wapi_shared_data[0],
+ &_wapi_shared_scratch);
if(shared==FALSE) {
- g_warning ("Failed to attach shared memory! "
- "(tried shared memory ID 0x%x). "
- "Falling back to non-shared handles",
- shm_id);
+ g_warning (
+ "Failed to attach shared memory! "
+ "Falling back to non-shared handles\n"
+ "See: http://www.go-mono.com/issues.html#wapi for details");
}
#endif /* DISABLE_SHARED_HANDLES */
}
@@ -85,15 +119,39 @@ static void shared_init (void)
if(shared==TRUE) {
daemon_sock=socket (PF_UNIX, SOCK_STREAM, 0);
shared_socket_address.sun_family=AF_UNIX;
- memcpy (shared_socket_address.sun_path, _wapi_shared_data->daemon, 108);
- ret=connect (daemon_sock, (struct sockaddr *)&shared_socket_address,
+ memcpy (shared_socket_address.sun_path,
+ _wapi_shared_data[0]->daemon, MONO_SIZEOF_SUNPATH);
+ ret=connect (daemon_sock,
+ (struct sockaddr *)&shared_socket_address,
sizeof(struct sockaddr_un));
if(ret==-1) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- "connect to daemon failed: %s",
- strerror (errno));
- /* Fall back to private handles */
- shared=FALSE;
+ if(tried_once==TRUE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": connect to daemon failed: %s",
+ g_strerror (errno));
+ /* Fall back to private handles */
+ shared=FALSE;
+ } else {
+ /* It's possible that the daemon
+ * crashed without destroying the
+ * shared memory segment (thus fooling
+ * subsequent processes into thinking
+ * the daemon is still active).
+ *
+ * Destroy the shared memory segment
+ * and try once more. This won't
+ * break running apps, but no new apps
+ * will be able to see the current
+ * shared memory segment.
+ */
+ tried_once=TRUE;
+ _wapi_shm_destroy ();
+
+ goto attach_again;
+ }
+ } else {
+ _wapi_fd_offset_table_size = _wapi_shared_data[0]->fd_offset_table_size;
+ _wapi_fd_offset_table=g_new0 (gpointer, _wapi_fd_offset_table_size);
}
}
@@ -102,44 +160,154 @@ static void shared_init (void)
g_message (G_GNUC_PRETTY_FUNCTION
": Using process-private handles");
#endif
- _wapi_shared_data=
- g_malloc0 (sizeof(struct _WapiHandleShared_list)+
- _WAPI_SHM_SCRATCH_SIZE);
- }
- _wapi_private_data=g_new0 (struct _WapiHandlePrivate_list, 1);
+ _wapi_shared_data[0]=g_new0 (struct _WapiHandleShared_list, 1);
+ _wapi_shared_data[0]->num_segments=1;
+
+ _wapi_shared_scratch=g_new0 (struct _WapiHandleScratch, 1);
- pthread_mutexattr_init (&mutex_shared_attr);
- pthread_condattr_init (&cond_shared_attr);
+ _wapi_fd_offset_table_size=getdtablesize ();
+ _wapi_fd_offset_table=g_new0 (gpointer,
+ _wapi_fd_offset_table_size);
+ }
+ _wapi_private_data[0]=g_new0 (struct _WapiHandlePrivate_list, 1);
+ _wapi_shm_mapped_segments=1;
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- pthread_mutexattr_setpshared (&mutex_shared_attr,
- PTHREAD_PROCESS_SHARED);
- pthread_condattr_setpshared (&cond_shared_attr,
- PTHREAD_PROCESS_SHARED);
+ thr_ret = pthread_mutexattr_init (&mutex_shared_attr);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_condattr_init (&cond_shared_attr);
+ g_assert (thr_ret == 0);
+
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ thr_ret = pthread_mutexattr_setpshared (&mutex_shared_attr,
+ PTHREAD_PROCESS_SHARED);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_condattr_setpshared (&cond_shared_attr,
+ PTHREAD_PROCESS_SHARED);
+ g_assert (thr_ret == 0);
+#else
+ thr_ret = pthread_cond_init(&_wapi_private_data[0]->signal_cond, NULL);
+ g_assert (thr_ret == 0);
+
+ thr_ret = mono_mutex_init(&_wapi_private_data[0]->signal_mutex, NULL);
+ g_assert (thr_ret == 0);
#endif
}
+#ifdef HEAVY_DEBUG
+static void
+print_handle_count (gint mask)
+{
+ gint *count, num_handles;
+ gint i;
+ static const gchar *names [] = {"WAPI_HANDLE_UNUSED",
+ "WAPI_HANDLE_FILE",
+ "WAPI_HANDLE_CONSOLE",
+ "WAPI_HANDLE_THREAD",
+ "WAPI_HANDLE_SEM",
+ "WAPI_HANDLE_MUTEX",
+ "WAPI_HANDLE_EVENT",
+ "WAPI_HANDLE_SOCKET",
+ "WAPI_HANDLE_FIND",
+ "WAPI_HANDLE_PROCESS",
+ "WAPI_HANDLE_PIPE"
+ };
+
+
+ num_handles=_wapi_handle_get_shared_segment (0)->num_segments * _WAPI_HANDLES_PER_SEGMENT;
+ count=g_new0 (gint, num_handles);
+
+ for (i = 1; i < num_handles; i++) {
+ struct _WapiHandleShared *shared;
+ guint32 segment, idx;
+
+ _wapi_handle_segment (GUINT_TO_POINTER (i), &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+
+ shared = &_wapi_handle_get_shared_segment (segment)->handles[idx];
+ count [shared->type]++;
+ }
+
+ for (i = 0; i < num_handles; i++)
+ if ((i & mask) == i) /* Always prints the UNUSED count */
+ g_print ("%s: %d\n", names [i], count [i]);
+
+ g_free (count);
+}
+#endif /* HEAVY_DEBUG */
+
+/*
+ * _wapi_handle_new_internal:
+ * @type: Init handle to this type
+ *
+ * Search for a free handle and initialize it. Return the handle on
+ * success and 0 on failure.
+ */
guint32 _wapi_handle_new_internal (WapiHandleType type)
{
- guint32 i;
+ guint32 segment, idx;
+ guint32 i, j;
static guint32 last=1;
+ int thr_ret;
+ guint32 num_segments = _wapi_handle_get_shared_segment (0)->num_segments;
/* A linear scan should be fast enough. Start from the last
* allocation, assuming that handles are allocated more often
* than they're freed. Leave 0 (NULL) as a guard
*/
+#ifdef HEAVY_DEBUG
+ print_handle_count (0xFFF);
+#endif
again:
- for(i=last; i<_WAPI_MAX_HANDLES; i++) {
- struct _WapiHandleShared *shared=&_wapi_shared_data->handles[i];
+ _wapi_handle_segment (GUINT_TO_POINTER (last), &segment, &idx);
+ for(i=segment; i < num_segments; i++) {
+ if(i!=segment) {
+ idx=0;
+ }
- if(shared->type==WAPI_HANDLE_UNUSED) {
- last=i;
- shared->type=type;
- shared->signalled=FALSE;
- mono_mutex_init (&_wapi_shared_data->handles[i].signal_mutex, &mutex_shared_attr);
- pthread_cond_init (&_wapi_shared_data->handles[i].signal_cond, &cond_shared_attr);
-
- return(i);
+ for(j=idx; j<_WAPI_HANDLES_PER_SEGMENT; j++) {
+ struct _WapiHandleShared *shared;
+
+ /* Make sure we dont try and assign the
+ * handles that would clash with fds
+ */
+ if ((i * _WAPI_HANDLES_PER_SEGMENT + j) < _wapi_fd_offset_table_size) {
+ i = _wapi_fd_offset_table_size / _WAPI_HANDLES_PER_SEGMENT;
+ j = _wapi_fd_offset_table_size - (i * _WAPI_HANDLES_PER_SEGMENT);
+
+ if (i >= num_segments) {
+ /* Need to get the caller to
+ * add more shared segments
+ */
+ return(0);
+ }
+
+ continue;
+ }
+
+ shared=&_wapi_handle_get_shared_segment (i)->handles[j];
+
+ if(shared->type==WAPI_HANDLE_UNUSED) {
+ last=(_wapi_handle_index (i, j)+1) % (_wapi_handle_get_shared_segment (0)->num_segments * _WAPI_HANDLES_PER_SEGMENT);
+ shared->type=type;
+ shared->signalled=FALSE;
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ thr_ret = mono_mutex_init (&shared->signal_mutex, &mutex_shared_attr);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_cond_init (&shared->signal_cond, &cond_shared_attr);
+ g_assert (thr_ret == 0);
+#else
+ thr_ret = pthread_cond_init(&shared->signal_cond, NULL);
+ g_assert (thr_ret == 0);
+
+ thr_ret = mono_mutex_init(&shared->signal_mutex, NULL);
+ g_assert (thr_ret == 0);
+#endif
+
+ return(_wapi_handle_index (i, j));
+ }
}
}
@@ -148,7 +316,8 @@ again:
last=1;
goto again;
}
-
+
+ /* Will need a new segment. The caller will sort it out */
return(0);
}
@@ -157,13 +326,14 @@ gpointer _wapi_handle_new (WapiHandleType type)
{
static mono_once_t shared_init_once = MONO_ONCE_INIT;
static pthread_mutex_t scan_mutex=PTHREAD_MUTEX_INITIALIZER;
- guint32 idx;
+ guint32 handle_idx = 0, idx, segment;
gpointer handle;
- WapiHandleRequest new;
- WapiHandleResponse new_resp;
+ WapiHandleRequest new={0};
+ WapiHandleResponse new_resp={0};
#if HAVE_BOEHM_GC
gboolean tried_collect=FALSE;
#endif
+ int thr_ret;
mono_once (&shared_init_once, shared_init);
@@ -175,7 +345,7 @@ again:
_wapi_daemon_request_response (daemon_sock, &new, &new_resp);
if (new_resp.type==WapiHandleResponseType_New) {
- idx=new_resp.u.new.handle;
+ handle_idx=new_resp.u.new.handle;
} else {
g_warning (G_GNUC_PRETTY_FUNCTION
": bogus daemon response, type %d",
@@ -183,12 +353,38 @@ again:
g_assert_not_reached ();
}
} else {
- pthread_mutex_lock (&scan_mutex);
- idx=_wapi_handle_new_internal (type);
- pthread_mutex_unlock (&scan_mutex);
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&scan_mutex);
+ thr_ret = pthread_mutex_lock (&scan_mutex);
+ g_assert (thr_ret == 0);
+
+ while ((handle_idx = _wapi_handle_new_internal (type)) == 0) {
+ /* Try and get a new segment, and have another go */
+ segment=_wapi_handle_get_shared_segment (0)->num_segments;
+ _wapi_handle_ensure_mapped (segment);
+
+ if(_wapi_handle_get_shared_segment (segment)!=NULL) {
+ /* Got a new segment */
+ _wapi_handle_get_shared_segment (0)->num_segments++;
+ } else {
+ /* Map failed. Just return 0 meaning
+ * "out of handles"
+ */
+ }
+ }
+
+ _wapi_handle_segment (GUINT_TO_POINTER (handle_idx), &segment, &idx);
+ _wapi_handle_get_shared_segment (segment)->handles[idx].ref++;
+
+ thr_ret = pthread_mutex_unlock (&scan_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
}
- if(idx==0) {
+ /* Make sure we left the space for fd mappings */
+ g_assert (handle_idx >= _wapi_fd_offset_table_size);
+
+ if(handle_idx==0) {
g_warning (G_GNUC_PRETTY_FUNCTION ": Ran out of handles!");
#if HAVE_BOEHM_GC
@@ -198,7 +394,7 @@ again:
if(tried_collect==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": Seeing if GC collection helps...");
- GC_gcollect ();
+ GC_gcollect (); /* FIXME: we should wait for finalizers to be called */
tried_collect=TRUE;
goto again;
} else {
@@ -210,12 +406,26 @@ again:
return(GUINT_TO_POINTER (_WAPI_HANDLE_INVALID));
}
- handle=GUINT_TO_POINTER (idx);
+ _wapi_handle_segment (GUINT_TO_POINTER (handle_idx), &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+
+ if(_wapi_private_data!=NULL) {
+ _wapi_handle_get_private_segment (segment)->handles[idx].type=type;
+ }
+
+#if !defined(_POSIX_THREAD_PROCESS_SHARED) || _POSIX_THREAD_PROCESS_SHARED == -1
+ thr_ret = mono_mutex_init (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex, &mutex_shared_attr);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_cond_init (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond, &cond_shared_attr);
+ g_assert (thr_ret == 0);
+#endif
+ handle=GUINT_TO_POINTER (handle_idx);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": Allocated new handle %p", handle);
#endif
-
+
return(handle);
}
@@ -223,27 +433,41 @@ gboolean _wapi_lookup_handle (gpointer handle, WapiHandleType type,
gpointer *shared, gpointer *private)
{
struct _WapiHandleShared *shared_handle_data;
- struct _WapiHandlePrivate *private_handle_data;
- guint32 idx=GPOINTER_TO_UINT (handle);
+ struct _WapiHandlePrivate *private_handle_data = NULL;
+ guint32 idx;
+ guint32 segment;
- if(shared!=NULL) {
- shared_handle_data=&_wapi_shared_data->handles[idx];
- /* Allow WAPI_HANDLE_UNUSED to mean "dont care which
- * type"
- */
- if(shared_handle_data->type!=type &&
- type != WAPI_HANDLE_UNUSED) {
- return(FALSE);
- }
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
+
+ _wapi_handle_segment (handle, &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+
+ shared_handle_data=&_wapi_handle_get_shared_segment (segment)->handles[idx];
+ if(shared!=NULL) {
*shared=&shared_handle_data->u;
}
if(private!=NULL) {
- private_handle_data=&_wapi_private_data->handles[idx];
+ private_handle_data=&_wapi_handle_get_private_segment (segment)->handles[idx];
*private=&private_handle_data->u;
}
+
+ if(shared_handle_data->type!=type) {
+ /* If shared type is UNUSED, see if the private type
+ * matches what we are looking for - this can happen
+ * when the handle is being destroyed and the
+ * close_private function is looking up the private
+ * data
+ */
+ if(shared_handle_data->type==WAPI_HANDLE_UNUSED &&
+ (private!=NULL && private_handle_data->type==type)) {
+ return(TRUE);
+ } else {
+ return(FALSE);
+ }
+ }
return(TRUE);
}
@@ -255,10 +479,15 @@ gpointer _wapi_search_handle (WapiHandleType type,
{
struct _WapiHandleShared *shared_handle_data;
struct _WapiHandlePrivate *private_handle_data;
- guint32 i;
+ guint32 i, segment, idx;
- for(i=1; i<_WAPI_MAX_HANDLES; i++) {
- struct _WapiHandleShared *shared=&_wapi_shared_data->handles[i];
+ for(i=1; i<_wapi_handle_get_shared_segment (0)->num_segments * _WAPI_HANDLES_PER_SEGMENT; i++) {
+ struct _WapiHandleShared *shared;
+
+ _wapi_handle_segment (GUINT_TO_POINTER (i), &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+
+ shared=&_wapi_handle_get_shared_segment (segment)->handles[idx];
if(shared->type==type) {
if(check (GUINT_TO_POINTER (i), user_data)==TRUE) {
@@ -267,18 +496,18 @@ gpointer _wapi_search_handle (WapiHandleType type,
}
}
- if(i==_WAPI_MAX_HANDLES) {
+ if(i==_wapi_handle_get_shared_segment (0)->num_segments * _WAPI_HANDLES_PER_SEGMENT) {
return(GUINT_TO_POINTER (0));
}
if(shared!=NULL) {
- shared_handle_data=&_wapi_shared_data->handles[i];
+ shared_handle_data=&_wapi_handle_get_shared_segment (segment)->handles[idx];
*shared=&shared_handle_data->u;
}
if(private!=NULL) {
- private_handle_data=&_wapi_private_data->handles[i];
+ private_handle_data=&_wapi_handle_get_private_segment (segment)->handles[idx];
*private=&private_handle_data->u;
}
@@ -286,16 +515,116 @@ gpointer _wapi_search_handle (WapiHandleType type,
return(GUINT_TO_POINTER (i));
}
-void _wapi_handle_ref (gpointer handle)
+gpointer _wapi_search_handle_namespace (WapiHandleType type,
+ gchar *utf8_name, gpointer *shared,
+ gpointer *private)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ struct _WapiHandleShared *shared_handle_data;
+ struct _WapiHandlePrivate *private_handle_data;
+ guint32 i, segment, idx;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Lookup for handle named [%s] type %d", utf8_name, type);
+#endif
+
+ for(i=1; i<_wapi_handle_get_shared_segment (0)->num_segments * _WAPI_HANDLES_PER_SEGMENT; i++) {
+ struct _WapiHandleShared *shared;
+
+ _wapi_handle_segment (GUINT_TO_POINTER (i), &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+
+ shared=&_wapi_handle_get_shared_segment (segment)->handles[idx];
+
+ /* Check mutex, event, semaphore, timer, job and file-mapping
+ * object names. So far only mutex is implemented.
+ */
+ if(_WAPI_SHARED_NAMESPACE (shared->type)) {
+ gchar *lookup_name;
+ WapiSharedNamespace *sharedns;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": found a shared namespace handle at 0x%x (type %d)", i, shared->type);
+#endif
+
+ shared_handle_data=&_wapi_handle_get_shared_segment (segment)->handles[idx];
+ sharedns=(WapiSharedNamespace *)&shared_handle_data->u;
+
+
+ if(sharedns->name) {
+ lookup_name=_wapi_handle_scratch_lookup (
+ sharedns->name);
+ } else {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": handle 0x%x is unnamed", i);
+#endif
+ continue;
+ }
+ if(lookup_name==NULL) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": couldn't find handle 0x%x name",
+ i);
+#endif
+ continue;
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": name is [%s]",
+ lookup_name);
+#endif
+
+ if(strcmp (lookup_name, utf8_name)==0) {
+ if(shared->type!=type) {
+ /* Its the wrong type, so fail now */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": handle 0x%x matches name but is wrong type: %d", i, shared->type);
+#endif
+ return(_WAPI_HANDLE_INVALID);
+ } else {
+ /* fall through so we can fill
+ * in the data
+ */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": handle 0x%x matches name and type", i);
+#endif
+ break;
+ }
+ }
+ }
+ }
+
+ if(i==_wapi_handle_get_shared_segment (0)->num_segments * _WAPI_HANDLES_PER_SEGMENT) {
+ return(GUINT_TO_POINTER (0));
+ }
+
+ if(shared!=NULL) {
+ shared_handle_data=&_wapi_handle_get_shared_segment (segment)->handles[idx];
+
+ *shared=&shared_handle_data->u;
+ }
+
+ if(private!=NULL) {
+ private_handle_data=&_wapi_handle_get_private_segment (segment)->handles[idx];
+
+ *private=&private_handle_data->u;
+ }
+
+ return(GUINT_TO_POINTER (i));
+}
+
+void _wapi_handle_ref (gpointer handle)
+{
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
+
if(shared==TRUE) {
- WapiHandleRequest req;
- WapiHandleResponse resp;
+ WapiHandleRequest req={0};
+ WapiHandleResponse resp={0};
req.type=WapiHandleRequestType_Open;
- req.u.open.handle=idx;
+ req.u.open.handle=GPOINTER_TO_UINT (handle);
_wapi_daemon_request_response (daemon_sock, &req, &resp);
if(resp.type!=WapiHandleResponseType_Open) {
@@ -305,23 +634,34 @@ void _wapi_handle_ref (gpointer handle)
g_assert_not_reached ();
}
} else {
- _wapi_shared_data->handles[idx].ref++;
+ guint32 idx, segment;
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ _wapi_handle_get_shared_segment (segment)->handles[idx].ref++;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": handle %p ref now %d",
- handle, _wapi_shared_data->handles[idx].ref);
+ handle,
+ _wapi_handle_get_shared_segment (segment)->handles[idx].ref);
#endif
}
}
+/* The handle must not be locked on entry to this function */
void _wapi_handle_unref (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
- gboolean destroy;
+ guint32 idx, segment;
+ gboolean destroy = FALSE;
+ int thr_ret;
+
+ g_assert (GPOINTER_TO_UINT (handle) >= _wapi_fd_offset_table_size);
+
+ _wapi_handle_segment (handle, &segment, &idx);
if(shared==TRUE) {
- WapiHandleRequest req;
- WapiHandleResponse resp;
+ WapiHandleRequest req={0};
+ WapiHandleResponse resp={0};
req.type=WapiHandleRequestType_Close;
req.u.close.handle=GPOINTER_TO_UINT (handle);
@@ -336,11 +676,10 @@ void _wapi_handle_unref (gpointer handle)
destroy=resp.u.close.destroy;
}
} else {
- _wapi_shared_data->handles[idx].ref--;
+ _wapi_handle_get_shared_segment (segment)->handles[idx].ref--;
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": handle %p ref now %d",
- handle, _wapi_shared_data->handles[idx].ref);
+ g_message (G_GNUC_PRETTY_FUNCTION ": handle %p ref now %d", handle, _wapi_handle_get_shared_segment (segment)->handles[idx].ref);
#endif
/* Possible race condition here if another thread refs
@@ -349,7 +688,7 @@ void _wapi_handle_unref (gpointer handle)
* that allowing a handle reference to reach 0 isn't
* an application bug anyway.
*/
- destroy=(_wapi_shared_data->handles[idx].ref==0);
+ destroy=(_wapi_handle_get_shared_segment (segment)->handles[idx].ref==0);
}
if(destroy==TRUE) {
@@ -360,39 +699,68 @@ void _wapi_handle_unref (gpointer handle)
if(shared==FALSE) {
_wapi_handle_ops_close_shared (handle);
- _wapi_shared_data->handles[idx].type=WAPI_HANDLE_UNUSED;
- mono_mutex_destroy (&_wapi_shared_data->handles[idx].signal_mutex);
- pthread_cond_destroy (&_wapi_shared_data->handles[idx].signal_cond);
- memset (&_wapi_shared_data->handles[idx].u, '\0', sizeof(_wapi_shared_data->handles[idx].u));
+
+ memset (&_wapi_handle_get_shared_segment (segment)->handles[idx].u, '\0', sizeof(_wapi_handle_get_shared_segment (segment)->handles[idx].u));
}
-
+
_wapi_handle_ops_close_private (handle);
+ _wapi_handle_get_shared_segment (segment)->handles[idx].type=WAPI_HANDLE_UNUSED;
+ _wapi_handle_get_private_segment (segment)->handles[idx].type=WAPI_HANDLE_UNUSED;
+
+ /* Destroy the mutex and cond var. We hope nobody
+ * tried to grab them between the handle unlock and
+ * now, but pthreads doesn't have a
+ * "unlock_and_destroy" atomic function.
+ */
+ thr_ret = mono_mutex_destroy (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_cond_destroy (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond);
+ g_assert (thr_ret == 0);
}
}
#define HDRSIZE sizeof(struct _WapiScratchHeader)
-guint32 _wapi_handle_scratch_store_internal (guint32 bytes)
+static pthread_mutex_t _wapi_scratch_mutex=PTHREAD_MUTEX_INITIALIZER;
+
+/* _wapi_scratch_mutex must be held when this function is called in
+ * the non-shared case
+ */
+static void _wapi_handle_scratch_expand (void)
+{
+ guint32 old_len, new_len;
+
+ old_len=sizeof(struct _WapiHandleScratch) +
+ _wapi_shared_scratch->data_len;
+ new_len=old_len+_WAPI_SHM_SCRATCH_SIZE;
+
+ if(_wapi_shared_scratch->is_shared==TRUE) {
+ /* expand via mmap() */
+ _wapi_shared_scratch=_wapi_shm_file_expand (_wapi_shared_scratch, WAPI_SHM_SCRATCH, 0, old_len, new_len);
+ } else {
+ _wapi_shared_scratch=_wapi_g_renew0 (_wapi_shared_scratch, old_len, new_len);
+ }
+ _wapi_shared_scratch->data_len+=_WAPI_SHM_SCRATCH_SIZE;
+}
+
+/* _wapi_scratch_mutex must be held when this function is called in
+ * the non-shared case
+ */
+static guint32 _wapi_handle_scratch_locate_space (guint32 bytes)
{
guint32 idx=0, last_idx=0;
- struct _WapiScratchHeader *hdr, *last_hdr;
+ struct _WapiScratchHeader *hdr, *last_hdr = NULL;
gboolean last_was_free=FALSE;
- guchar *storage=&_wapi_shared_data->scratch_base[0];
+ guchar *storage=_wapi_shared_scratch->scratch_data;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": looking for %d bytes of scratch space (%d bytes total)",
- bytes, _WAPI_SHM_SCRATCH_SIZE);
+ bytes, _wapi_shared_scratch->data_len);
#endif
-
- hdr=(struct _WapiScratchHeader *)&storage[0];
- if(hdr->flags==0 && hdr->length==0) {
- /* Need to initialise scratch data */
- hdr->flags |= WAPI_SHM_SCRATCH_FREE;
- hdr->length = _WAPI_SHM_SCRATCH_SIZE - HDRSIZE;
- }
- while(idx< _WAPI_SHM_SCRATCH_SIZE) {
+ while(idx< _wapi_shared_scratch->data_len) {
hdr=(struct _WapiScratchHeader *)&storage[idx];
/* Do a simple first-fit allocation, coalescing
@@ -422,6 +790,10 @@ guint32 _wapi_handle_scratch_store_internal (guint32 bytes)
g_message (G_GNUC_PRETTY_FUNCTION ": new header at %d, length %d", idx+bytes, hdr->length);
#endif
+ /*
+ * It was memset(0..) when free/made so no need to do it here
+ */
+
return(idx);
} else if(hdr->flags & WAPI_SHM_SCRATCH_FREE &&
last_was_free == FALSE) {
@@ -471,81 +843,295 @@ guint32 _wapi_handle_scratch_store_internal (guint32 bytes)
/* Don't let the coalescing blow away this block */
last_was_free=FALSE;
+
+ /* But remember where the last block started */
+ last_idx=idx;
}
}
+
+ /* Not enough free space. last_idx points to the last block.
+ * If it's free, just tack on more space and update the
+ * length. If it's allocated, it must have fit right into the
+ * available space, so add more space and add a new header
+ * after this block.
+ */
+ _wapi_handle_scratch_expand ();
+ storage=_wapi_shared_scratch->scratch_data;
+ hdr=(struct _WapiScratchHeader *)&storage[last_idx];
+ if(hdr->flags & WAPI_SHM_SCRATCH_FREE) {
+ hdr->length+=_WAPI_SHM_SCRATCH_SIZE;
+ } else {
+ idx=(hdr->length+HDRSIZE);
+ hdr=(struct _WapiScratchHeader *)&storage[idx];
+ hdr->flags |= WAPI_SHM_SCRATCH_FREE;
+ hdr->length = _WAPI_SHM_SCRATCH_SIZE-HDRSIZE;
+ }
+
+ /* The caller will try again */
return(0);
}
-guint32 _wapi_handle_scratch_store (gconstpointer data, guint32 bytes)
+/*
+ * _wapi_handle_scratch_store_internal:
+ * @bytes: Allocate no. bytes
+ *
+ * Like malloc(3) except its for the shared memory segment's scratch
+ * part. Memory block returned is zeroed out.
+ */
+guint32 _wapi_handle_scratch_store_internal (guint32 bytes, gboolean *remap)
{
- static pthread_mutex_t scratch_mutex=PTHREAD_MUTEX_INITIALIZER;
+ guchar *storage;
guint32 idx;
+ struct _WapiScratchHeader *hdr;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": storing %d bytes", bytes);
+#endif
+
+ *remap=FALSE;
+
+ if(_wapi_shared_scratch->data_len==0) {
+ /* Need to expand the data array for the first use */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": setting up scratch space");
+#endif
+
+ _wapi_handle_scratch_expand ();
+ *remap=TRUE;
+ }
+
+ storage=_wapi_shared_scratch->scratch_data;
+ hdr=(struct _WapiScratchHeader *)&storage[0];
+ if(hdr->flags==0 && hdr->length==0) {
+ /* Need to initialise scratch data */
+ hdr->flags |= WAPI_SHM_SCRATCH_FREE;
+ hdr->length = _wapi_shared_scratch->data_len - HDRSIZE;
+ }
+
+ idx=_wapi_handle_scratch_locate_space (bytes);
+ if(idx==0) {
+ /* Some more space will have been allocated, so try again */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": trying again");
+#endif
+
+ idx=_wapi_handle_scratch_locate_space (bytes);
+ *remap=TRUE;
+ }
+
+ return(idx);
+}
+
+guint32 _wapi_handle_scratch_store (gconstpointer data, guint32 bytes)
+{
+ guint32 idx = 0, store_bytes;
+ gboolean remap;
+ int thr_ret;
+ guint32 ret = 0;
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": storing %d bytes", bytes);
+#endif
+
/* No point storing no data */
if(bytes==0) {
return(0);
}
+
+ /* Align bytes to 32 bits (needed for sparc at least) */
+ store_bytes = (((bytes) + 3) & (~3));
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&_wapi_scratch_mutex);
+ thr_ret = pthread_mutex_lock (&_wapi_scratch_mutex);
+ g_assert (thr_ret == 0);
if(shared==TRUE) {
- WapiHandleRequest scratch;
- WapiHandleResponse scratch_resp;
-
+ WapiHandleRequest scratch={0};
+ WapiHandleResponse scratch_resp={0};
+ guint32 old_len=sizeof(struct _WapiHandleScratch) +
+ _wapi_shared_scratch->data_len;
+
scratch.type=WapiHandleRequestType_Scratch;
- scratch.u.scratch.length=bytes;
+ scratch.u.scratch.length=store_bytes;
_wapi_daemon_request_response (daemon_sock, &scratch,
&scratch_resp);
if(scratch_resp.type==WapiHandleResponseType_Scratch) {
idx=scratch_resp.u.scratch.idx;
+ remap=scratch_resp.u.scratch.remap;
} else {
g_warning (G_GNUC_PRETTY_FUNCTION
": bogus daemon response, type %d",
scratch_resp.type);
g_assert_not_reached ();
}
+
+ if(remap==TRUE) {
+ munmap (_wapi_shared_scratch, old_len);
+ _wapi_shared_scratch=_wapi_shm_file_map (WAPI_SHM_SCRATCH, 0, NULL, NULL);
+ }
} else {
- pthread_mutex_lock (&scratch_mutex);
- idx=_wapi_handle_scratch_store_internal (bytes);
- pthread_mutex_unlock (&scratch_mutex);
-
+ idx=_wapi_handle_scratch_store_internal (store_bytes, &remap);
if(idx==0) {
/* Failed to allocate space */
- return(0);
+ goto cleanup;
}
}
+ ret = idx;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": stored [%s] at %d (len %d, aligned len %d)",
+ (char *)data, idx, bytes, store_bytes);
+#endif
+
+ memcpy (&_wapi_shared_scratch->scratch_data[idx], data, bytes);
+
+cleanup:
+ thr_ret = pthread_mutex_unlock (&_wapi_scratch_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
+}
+
+guint32 _wapi_handle_scratch_store_string_array (gchar **data)
+{
+ guint32 *stored_strings, count=0, i, idx;
+ gchar **strings;
+
+ /* No point storing no data */
+ if(data==NULL) {
+ return(0);
+ }
+
+ strings=data;
+ while(*strings!=NULL) {
+ count++;
+ strings++;
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %d strings to store", count);
+#endif
+
+ if(count==0) {
+ return(0);
+ }
- memcpy (&_wapi_shared_data->scratch_base[idx], data, bytes);
+ /* stored_strings[0] is the count */
+ stored_strings=g_new0 (guint32, count+1);
+ stored_strings[0]=count;
+
+ strings=data;
+ for(i=0; i<count; i++) {
+ stored_strings[i+1]=_wapi_handle_scratch_store (strings[i], strlen (strings[i]));
+ }
+
+ idx=_wapi_handle_scratch_store (stored_strings,
+ sizeof(guint32)*(count+1));
return(idx);
}
-guchar *_wapi_handle_scratch_lookup_as_string (guint32 idx)
+gpointer _wapi_handle_scratch_lookup (guint32 idx)
{
struct _WapiScratchHeader *hdr;
- guchar *str;
- guchar *storage=&_wapi_shared_data->scratch_base[0];
+ gpointer ret;
+ guchar *storage;
+ int thr_ret;
- if(idx < HDRSIZE || idx > _WAPI_SHM_SCRATCH_SIZE) {
+ if(idx < HDRSIZE || idx > _wapi_shared_scratch->data_len) {
return(NULL);
}
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&_wapi_scratch_mutex);
+ thr_ret = pthread_mutex_lock (&_wapi_scratch_mutex);
+ g_assert (thr_ret == 0);
+
+ storage=_wapi_shared_scratch->scratch_data;
hdr=(struct _WapiScratchHeader *)&storage[idx - HDRSIZE];
- str=g_malloc0 (hdr->length+1);
- memcpy (str, &storage[idx], hdr->length);
+ ret=g_malloc0 (hdr->length+1);
+ memcpy (ret, &storage[idx], hdr->length);
+
+ thr_ret = pthread_mutex_unlock (&_wapi_scratch_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
+}
+
+gchar **_wapi_handle_scratch_lookup_string_array (guint32 idx)
+{
+ gchar **strings;
+ guint32 *stored_strings;
+ guint32 count, i;
+
+ if(idx < HDRSIZE || idx > _wapi_shared_scratch->data_len) {
+ return(NULL);
+ }
+
+ stored_strings=_wapi_handle_scratch_lookup (idx);
+ if(stored_strings==NULL) {
+ return(NULL);
+ }
+
+ /* stored_strings[0] is the number of strings, the index of
+ * each string follows
+ */
+ count=stored_strings[0];
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": looking up an array of %d strings", count);
+#endif
+
+ /* NULL-terminate the array */
+ strings=g_new0 (gchar *, count+1);
+
+ for(i=0; i<count; i++) {
+ strings[i]=_wapi_handle_scratch_lookup (stored_strings[i+1]);
- return(str);
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": string %d is [%s]", i,
+ strings[i]);
+#endif
+ }
+
+ g_free (stored_strings);
+
+ return(strings);
}
+/*
+ * _wapi_handle_scratch_delete_internal:
+ * @idx: Index to free block
+ *
+ * Like free(3) except its for the shared memory segment's scratch
+ * part.
+ */
void _wapi_handle_scratch_delete_internal (guint32 idx)
{
struct _WapiScratchHeader *hdr;
- guchar *storage=&_wapi_shared_data->scratch_base[0];
+ guchar *storage;
+ int thr_ret;
- if(idx < HDRSIZE || idx > _WAPI_SHM_SCRATCH_SIZE) {
+ if(idx < HDRSIZE || idx > _wapi_shared_scratch->data_len) {
return;
}
+
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&_wapi_scratch_mutex);
+ thr_ret = pthread_mutex_lock (&_wapi_scratch_mutex);
+ g_assert (thr_ret == 0);
+
+ storage=_wapi_shared_scratch->scratch_data;
hdr=(struct _WapiScratchHeader *)&storage[idx - HDRSIZE];
memset (&storage[idx], '\0', hdr->length);
@@ -554,13 +1140,17 @@ void _wapi_handle_scratch_delete_internal (guint32 idx)
/* We could coalesce forwards here if the next block is also
* free, but the _store() function will do that anyway.
*/
+
+ thr_ret = pthread_mutex_unlock (&_wapi_scratch_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
}
void _wapi_handle_scratch_delete (guint32 idx)
{
if(shared==TRUE) {
- WapiHandleRequest scratch_free;
- WapiHandleResponse scratch_free_resp;
+ WapiHandleRequest scratch_free={0};
+ WapiHandleResponse scratch_free_resp={0};
scratch_free.type=WapiHandleRequestType_ScratchFree;
scratch_free.u.scratch_free.idx=idx;
@@ -579,6 +1169,35 @@ void _wapi_handle_scratch_delete (guint32 idx)
}
}
+void _wapi_handle_scratch_delete_string_array (guint32 idx)
+{
+ guint32 *stored_strings;
+ guint32 count, i;
+
+ stored_strings=_wapi_handle_scratch_lookup (idx);
+ if(stored_strings==NULL) {
+ return;
+ }
+
+ /* stored_strings[0] is the number of strings, the index of
+ * each string follows
+ */
+ count=stored_strings[0];
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": deleting an array of %d strings",
+ count);
+#endif
+
+ for(i=1; i<count; i++) {
+ _wapi_handle_scratch_delete (stored_strings[i]);
+ }
+
+ _wapi_handle_scratch_delete (idx);
+
+ g_free (stored_strings);
+}
+
void _wapi_handle_register_capabilities (WapiHandleType type,
WapiHandleCapability caps)
{
@@ -588,10 +1207,16 @@ void _wapi_handle_register_capabilities (WapiHandleType type,
gboolean _wapi_handle_test_capabilities (gpointer handle,
WapiHandleCapability caps)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
WapiHandleType type;
- type=_wapi_shared_data->handles[idx].type;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": testing 0x%x against 0x%x (%d)",
@@ -603,10 +1228,16 @@ gboolean _wapi_handle_test_capabilities (gpointer handle,
void _wapi_handle_ops_close_shared (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
WapiHandleType type;
- type=_wapi_shared_data->handles[idx].type;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
if(handle_ops[type]!=NULL && handle_ops[type]->close_shared!=NULL) {
handle_ops[type]->close_shared (handle);
@@ -615,10 +1246,23 @@ void _wapi_handle_ops_close_shared (gpointer handle)
void _wapi_handle_ops_close_private (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
WapiHandleType type;
- type=_wapi_shared_data->handles[idx].type;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
+
+ /* When a handle in the process of being destroyed the shared
+ * type has already been set to UNUSED
+ */
+ if(type==WAPI_HANDLE_UNUSED && _wapi_private_data!=NULL) {
+ type=_wapi_handle_get_private_segment (segment)->handles[idx].type;
+ }
if(handle_ops[type]!=NULL && handle_ops[type]->close_private!=NULL) {
handle_ops[type]->close_private (handle);
@@ -627,10 +1271,16 @@ void _wapi_handle_ops_close_private (gpointer handle)
void _wapi_handle_ops_signal (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
WapiHandleType type;
- type=_wapi_shared_data->handles[idx].type;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
if(handle_ops[type]!=NULL && handle_ops[type]->signal!=NULL) {
handle_ops[type]->signal (handle);
@@ -639,10 +1289,16 @@ void _wapi_handle_ops_signal (gpointer handle)
void _wapi_handle_ops_own (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
WapiHandleType type;
- type=_wapi_shared_data->handles[idx].type;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
if(handle_ops[type]!=NULL && handle_ops[type]->own_handle!=NULL) {
handle_ops[type]->own_handle (handle);
@@ -651,10 +1307,16 @@ void _wapi_handle_ops_own (gpointer handle)
gboolean _wapi_handle_ops_isowned (gpointer handle)
{
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
WapiHandleType type;
- type=_wapi_shared_data->handles[idx].type;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
+ type=_wapi_handle_get_shared_segment (segment)->handles[idx].type;
if(handle_ops[type]!=NULL && handle_ops[type]->is_owned!=NULL) {
return(handle_ops[type]->is_owned (handle));
@@ -676,6 +1338,14 @@ gboolean _wapi_handle_ops_isowned (gpointer handle)
*/
gboolean CloseHandle(gpointer handle)
{
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ if (handle == NULL) {
+ return(FALSE);
+ }
+
_wapi_handle_unref (handle);
return(TRUE);
@@ -689,29 +1359,44 @@ gboolean _wapi_handle_count_signalled_handles (guint32 numhandles,
{
guint32 count, i, iter=0;
gboolean ret;
+ int thr_ret;
/* Lock all the handles, with backoff */
again:
for(i=0; i<numhandles; i++) {
- guint32 idx=GPOINTER_TO_UINT (handles[i]);
+ guint32 idx, segment;
+ gpointer handle = handles[i];
+
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": attempting to lock %p",
- handles[i]);
+ handle);
#endif
- ret=mono_mutex_trylock (&_wapi_shared_data->handles[idx].signal_mutex);
+ ret=mono_mutex_trylock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
if(ret!=0) {
/* Bummer */
struct timespec sleepytime;
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": attempt failed for %p", handles[i]);
+ g_message (G_GNUC_PRETTY_FUNCTION ": attempt failed for %p: %s", handle, strerror (ret));
#endif
while(i--) {
- idx=GPOINTER_TO_UINT (handles[i]);
- mono_mutex_unlock (&_wapi_shared_data->handles[idx].signal_mutex);
+ handle = handles[i];
+
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+ thr_ret = mono_mutex_unlock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
+ g_assert (thr_ret == 0);
}
/* If iter ever reaches 100 the nanosleep will
@@ -746,21 +1431,30 @@ again:
*lowest=numhandles;
for(i=0; i<numhandles; i++) {
- guint32 idx=GPOINTER_TO_UINT (handles[i]);
+ guint32 idx, segment;
+ gpointer handle = handles[i];
+
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_ref (handle);
+
+ _wapi_handle_segment (handle, &segment, &idx);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": Checking handle %p",
- handles[i]);
+ handle);
#endif
- if(((_wapi_handle_test_capabilities (handles[i], WAPI_HANDLE_CAP_OWN)==TRUE) &&
- (_wapi_handle_ops_isowned (handles[i])==TRUE)) ||
- (_wapi_shared_data->handles[idx].signalled==TRUE)) {
+ if(((_wapi_handle_test_capabilities (handle, WAPI_HANDLE_CAP_OWN)==TRUE) &&
+ (_wapi_handle_ops_isowned (handle)==TRUE)) ||
+ (_wapi_handle_get_shared_segment (segment)->handles[idx].signalled==TRUE)) {
count++;
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
- ": Handle %p signalled", handles[i]);
+ ": Handle %p signalled", handle);
#endif
if(*lowest>i) {
*lowest=i;
@@ -792,16 +1486,27 @@ again:
void _wapi_handle_unlock_handles (guint32 numhandles, gpointer *handles)
{
guint32 i;
+ int thr_ret;
for(i=0; i<numhandles; i++) {
- guint32 idx=GPOINTER_TO_UINT (handles[i]);
+ guint32 idx, segment;
+ gpointer handle = handles[i];
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
+
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handle %p",
- handles[i]);
+ handle);
#endif
- mono_mutex_unlock (&_wapi_shared_data->handles[idx].signal_mutex);
+ thr_ret = mono_mutex_unlock (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex);
+ g_assert (thr_ret == 0);
+
+ _wapi_handle_unref (handle);
}
}
@@ -816,17 +1521,17 @@ void _wapi_handle_unlock_handles (guint32 numhandles, gpointer *handles)
*/
int _wapi_handle_wait_signal (void)
{
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- return(mono_cond_wait (&_wapi_shared_data->signal_cond,
- &_wapi_shared_data->signal_mutex));
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ return(mono_cond_wait (&_wapi_handle_get_shared_segment (0)->signal_cond,
+ &_wapi_handle_get_shared_segment (0)->signal_mutex));
#else
struct timespec fake_timeout;
int ret;
_wapi_calc_timeout (&fake_timeout, 100);
- ret=mono_cond_timedwait (&_wapi_private_data->signal_cond,
- &_wapi_private_data->signal_mutex,
+ ret=mono_cond_timedwait (&_wapi_handle_get_private_segment (0)->signal_cond,
+ &_wapi_handle_get_private_segment (0)->signal_mutex,
&fake_timeout);
if(ret==ETIMEDOUT) {
ret=0;
@@ -838,9 +1543,9 @@ int _wapi_handle_wait_signal (void)
int _wapi_handle_timedwait_signal (struct timespec *timeout)
{
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- return(mono_cond_timedwait (&_wapi_shared_data->signal_cond,
- &_wapi_shared_data->signal_mutex,
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ return(mono_cond_timedwait (&_wapi_handle_get_shared_segment (0)->signal_cond,
+ &_wapi_handle_get_shared_segment (0)->signal_mutex,
timeout));
#else
struct timespec fake_timeout;
@@ -852,12 +1557,12 @@ int _wapi_handle_timedwait_signal (struct timespec *timeout)
(fake_timeout.tv_sec==timeout->tv_sec &&
fake_timeout.tv_nsec > timeout->tv_nsec)) {
/* Real timeout is less than 100ms time */
- ret=mono_cond_timedwait (&_wapi_private_data->signal_cond,
- &_wapi_private_data->signal_mutex,
+ ret=mono_cond_timedwait (&_wapi_handle_get_private_segment (0)->signal_cond,
+ &_wapi_handle_get_private_segment (0)->signal_mutex,
timeout);
} else {
- ret=mono_cond_timedwait (&_wapi_private_data->signal_cond,
- &_wapi_private_data->signal_mutex,
+ ret=mono_cond_timedwait (&_wapi_handle_get_private_segment (0)->signal_cond,
+ &_wapi_handle_get_private_segment (0)->signal_mutex,
&fake_timeout);
if(ret==ETIMEDOUT) {
ret=0;
@@ -870,20 +1575,31 @@ int _wapi_handle_timedwait_signal (struct timespec *timeout)
int _wapi_handle_wait_signal_handle (gpointer handle)
{
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- guint32 idx=GPOINTER_TO_UINT (handle);
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ guint32 idx, segment;
+
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
- return(mono_cond_wait (&_wapi_shared_data->handles[idx].signal_cond,
- &_wapi_shared_data->handles[idx].signal_mutex));
+ return(mono_cond_wait (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond,
+ &_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex));
#else
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
struct timespec fake_timeout;
int ret;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
_wapi_calc_timeout (&fake_timeout, 100);
- ret=mono_cond_timedwait (&_wapi_shared_data->handles[idx].signal_cond,
- &_wapi_shared_data->handles[idx].signal_mutex,
+ ret=mono_cond_timedwait (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond,
+ &_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex,
&fake_timeout);
if(ret==ETIMEDOUT) {
ret=0;
@@ -896,29 +1612,40 @@ int _wapi_handle_wait_signal_handle (gpointer handle)
int _wapi_handle_timedwait_signal_handle (gpointer handle,
struct timespec *timeout)
{
-#ifdef _POSIX_THREAD_PROCESS_SHARED
- guint32 idx=GPOINTER_TO_UINT (handle);
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ guint32 idx, segment;
+
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
- return(mono_cond_timedwait (&_wapi_shared_data->handles[idx].signal_cond,
- &_wapi_shared_data->handles[idx].signal_mutex,
+ return(mono_cond_timedwait (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond,
+ &_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex,
timeout));
#else
- guint32 idx=GPOINTER_TO_UINT (handle);
+ guint32 idx, segment;
struct timespec fake_timeout;
int ret;
+ if (GPOINTER_TO_UINT (handle) < _wapi_fd_offset_table_size) {
+ handle = _wapi_handle_fd_offset_to_handle (handle);
+ }
+
+ _wapi_handle_segment (handle, &segment, &idx);
_wapi_calc_timeout (&fake_timeout, 100);
if((fake_timeout.tv_sec>timeout->tv_sec) ||
(fake_timeout.tv_sec==timeout->tv_sec &&
fake_timeout.tv_nsec > timeout->tv_nsec)) {
/* Real timeout is less than 100ms time */
- ret=mono_cond_timedwait (&_wapi_shared_data->handles[idx].signal_cond,
- &_wapi_shared_data->handles[idx].signal_mutex,
+ ret=mono_cond_timedwait (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond,
+ &_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex,
timeout);
} else {
- ret=mono_cond_timedwait (&_wapi_shared_data->handles[idx].signal_cond,
- &_wapi_shared_data->handles[idx].signal_mutex,
+ ret=mono_cond_timedwait (&_wapi_handle_get_shared_segment (segment)->handles[idx].signal_cond,
+ &_wapi_handle_get_shared_segment (segment)->handles[idx].signal_mutex,
&fake_timeout);
if(ret==ETIMEDOUT) {
ret=0;
@@ -929,17 +1656,18 @@ int _wapi_handle_timedwait_signal_handle (gpointer handle,
#endif /* _POSIX_THREAD_PROCESS_SHARED */
}
-gboolean _wapi_handle_process_fork (guint32 cmd, guint32 args, guint32 env,
- guint32 dir, gboolean inherit,
- guint32 flags, gpointer stdin_handle,
+gboolean _wapi_handle_process_fork (guint32 cmd, guint32 env, guint32 dir,
+ gboolean inherit, guint32 flags,
+ gpointer stdin_handle,
gpointer stdout_handle,
gpointer stderr_handle,
gpointer *process_handle,
gpointer *thread_handle, guint32 *pid,
guint32 *tid)
{
- WapiHandleRequest fork_proc;
- WapiHandleResponse fork_proc_resp;
+ WapiHandleRequest fork_proc={0};
+ WapiHandleResponse fork_proc_resp={0};
+ int in_fd, out_fd, err_fd;
if(shared!=TRUE) {
return(FALSE);
@@ -947,7 +1675,6 @@ gboolean _wapi_handle_process_fork (guint32 cmd, guint32 args, guint32 env,
fork_proc.type=WapiHandleRequestType_ProcessFork;
fork_proc.u.process_fork.cmd=cmd;
- fork_proc.u.process_fork.args=args;
fork_proc.u.process_fork.env=env;
fork_proc.u.process_fork.dir=dir;
fork_proc.u.process_fork.stdin_handle=GPOINTER_TO_UINT (stdin_handle);
@@ -956,8 +1683,19 @@ gboolean _wapi_handle_process_fork (guint32 cmd, guint32 args, guint32 env,
fork_proc.u.process_fork.inherit=inherit;
fork_proc.u.process_fork.flags=flags;
- _wapi_daemon_request_response (daemon_sock, &fork_proc,
- &fork_proc_resp);
+ in_fd=_wapi_file_handle_to_fd (stdin_handle);
+ out_fd=_wapi_file_handle_to_fd (stdout_handle);
+ err_fd=_wapi_file_handle_to_fd (stderr_handle);
+
+ if(in_fd==-1 || out_fd==-1 || err_fd==-1) {
+ /* We were given duff handles */
+ /* FIXME: error code */
+ return(FALSE);
+ }
+
+ _wapi_daemon_request_response_with_fds (daemon_sock, &fork_proc,
+ &fork_proc_resp, in_fd,
+ out_fd, err_fd);
if(fork_proc_resp.type==WapiHandleResponseType_ProcessFork) {
*process_handle=GUINT_TO_POINTER (fork_proc_resp.u.process_fork.process_handle);
*thread_handle=GUINT_TO_POINTER (fork_proc_resp.u.process_fork.thread_handle);
@@ -970,9 +1708,26 @@ gboolean _wapi_handle_process_fork (guint32 cmd, guint32 args, guint32 env,
* exec_errno will be set, and the handle will be
* signalled immediately.
*/
- if(process_handle==0 || thread_handle==0) {
+ if(*process_handle==0 || *thread_handle==0) {
return(FALSE);
} else {
+ /* This call returns new handles, so we need to do
+ * a little bookkeeping
+ */
+ if (_wapi_private_data != NULL) {
+ guint32 segment, idx;
+
+ _wapi_handle_segment (*process_handle,
+ &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+ _wapi_handle_get_private_segment (segment)->handles[idx].type = WAPI_HANDLE_PROCESS;
+
+ _wapi_handle_segment (*thread_handle,
+ &segment, &idx);
+ _wapi_handle_ensure_mapped (segment);
+ _wapi_handle_get_private_segment (segment)->handles[idx].type = WAPI_HANDLE_THREAD;
+ }
+
return(TRUE);
}
} else {
@@ -984,3 +1739,99 @@ gboolean _wapi_handle_process_fork (guint32 cmd, guint32 args, guint32 env,
return(FALSE);
}
+
+gboolean
+_wapi_handle_process_kill (pid_t process, guint32 signo, gint *errnum)
+{
+ WapiHandleRequest killproc = {0};
+ WapiHandleResponse killprocresp = {0};
+ gint result;
+
+ if (shared != TRUE) {
+ if (errnum) *errnum = EINVAL;
+ return FALSE;
+ }
+
+ killproc.type = WapiHandleRequestType_ProcessKill;
+ killproc.u.process_kill.pid = process;
+ killproc.u.process_kill.signo = signo;
+
+ _wapi_daemon_request_response (daemon_sock, &killproc, &killprocresp);
+
+ if (killprocresp.type != WapiHandleResponseType_ProcessKill) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": bogus daemon response, type %d",
+ killprocresp.type);
+ g_assert_not_reached ();
+ }
+
+ result = killprocresp.u.process_kill.err;
+ if (result != 0 && errnum != NULL)
+ *errnum = (result == FALSE) ? result : 0;
+
+ return (result == 0);
+}
+
+gboolean _wapi_handle_get_or_set_share (dev_t device, ino_t inode,
+ guint32 new_sharemode,
+ guint32 new_access,
+ guint32 *old_sharemode,
+ guint32 *old_access)
+{
+ WapiHandleRequest req = {0};
+ WapiHandleResponse resp = {0};
+
+ if(shared != TRUE) {
+ /* No daemon means we don't know if a file is sharable.
+ * We're running in our own little world if this is
+ * the case, so there's no point in pretending that
+ * the file isn't sharable.
+ */
+ return(FALSE);
+ }
+
+ req.type = WapiHandleRequestType_GetOrSetShare;
+ req.u.get_or_set_share.device = device;
+ req.u.get_or_set_share.inode = inode;
+ req.u.get_or_set_share.new_sharemode = new_sharemode;
+ req.u.get_or_set_share.new_access = new_access;
+
+ _wapi_daemon_request_response (daemon_sock, &req, &resp);
+ if (resp.type != WapiHandleResponseType_GetOrSetShare) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": bogus daemon response, type %d", resp.type);
+ g_assert_not_reached ();
+ }
+
+ *old_sharemode = resp.u.get_or_set_share.sharemode;
+ *old_access = resp.u.get_or_set_share.access;
+
+ return(resp.u.get_or_set_share.exists);
+}
+
+void _wapi_handle_set_share (dev_t device, ino_t inode, guint32 sharemode,
+ guint32 access)
+{
+ WapiHandleRequest req = {0};
+ WapiHandleResponse resp = {0};
+
+ if(shared != TRUE) {
+ /* No daemon, so there's no one else to tell about
+ * file sharing.
+ */
+ return;
+ }
+
+ req.type = WapiHandleRequestType_SetShare;
+ req.u.set_share.device = device;
+ req.u.set_share.inode = inode;
+ req.u.set_share.sharemode = sharemode;
+ req.u.set_share.access = access;
+
+ _wapi_daemon_request_response (daemon_sock, &req, &resp);
+ if (resp.type != WapiHandleResponseType_SetShare) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": bogus daemon response, type %d", resp.type);
+ g_assert_not_reached ();
+ }
+}
diff --git a/mono/io-layer/hppa_atomic.s b/mono/io-layer/hppa_atomic.s
new file mode 100644
index 00000000000..3c5f91c6c98
--- /dev/null
+++ b/mono/io-layer/hppa_atomic.s
@@ -0,0 +1,252 @@
+/*
+ Copyright (c) 2003 Bernie Solomon <bernard@ugsolutions.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.
+
+
+
+ Implementation of "atomic" operations for HPPA. Currently (Oct 9th 2003)
+ only implemented for 64 bit compiles. There is only one atomic
+ instruction LDCW which is used to implement spinlocks. There are
+ 16 locks which are selected by taking 4 bits out of the address of
+ the relevant variable to try to avoid too much contention
+ for a single lock.
+*/
+#include "config.h"
+#if SIZEOF_VOID_P != 8
+#error "Currently only supports 64 bit pointers"
+#endif
+
+ .SPACE $TEXT$,SORT=8
+ .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=0x2c,CODE_ONLY,SORT=24
+InterlockedIncrement
+ .EXPORT InterlockedIncrement,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
+ .PROC
+ .CALLINFO FRAME=0,ARGS_SAVED,ORDERING_AWARE
+ .ENTRY
+ ADDIL L'locks-$global$,%r27,%r1
+ LDO R'locks-$global$(%r1),%r31
+ EXTRD,U %r26,60,4,%r28
+ DEPD,Z %r28,59,60,%r29
+ ADD,L %r29,%r31,%r31
+atomictest$1
+ LDCW 0(%r31),%r29
+ CMPB,<>,N %r0,%r29,gotlock$1
+ NOP
+spin$1
+ LDW 0(%r31),%r29
+ CMPB,=,N %r29,%r0,spin$1
+ NOP
+ B,N atomictest$1
+gotlock$1
+ LDW 0(%r26),%r28
+ LDO 1(%r28),%r28
+ STW %r28,0(%r26)
+ LDI 1,%r29
+ STW %r29,0(%r31)
+ .EXIT
+ BVE,N (%r2)
+ .PROCEND
+
+InterlockedDecrement
+ .EXPORT InterlockedDecrement,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
+ .PROC
+ .CALLINFO FRAME=0,ARGS_SAVED,ORDERING_AWARE
+ .ENTRY
+ ADDIL L'locks-$global$,%r27,%r1
+ LDO R'locks-$global$(%r1),%r31
+ EXTRD,U %r26,60,4,%r28
+ DEPD,Z %r28,59,60,%r29
+ ADD,L %r29,%r31,%r31
+atomictest$2
+ LDCW 0(%r31),%r29
+ CMPB,<>,N %r0,%r29,gotlock$2
+ NOP
+spin$2
+ LDW 0(%r31),%r29
+ CMPB,=,N %r29,%r0,spin$2
+ NOP
+ B,N atomictest$2
+gotlock$2
+ LDW 0(%r26),%r28
+ LDO -1(%r28),%r28
+ STW %r28,0(%r26)
+ LDI 1,%r29
+ STW %r29,0(%r31)
+ .EXIT
+ BVE,N (%r2)
+ .PROCEND
+
+InterlockedExchange
+ .EXPORT InterlockedExchange,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
+ .PROC
+ .CALLINFO FRAME=0,ARGS_SAVED,ORDERING_AWARE
+ .ENTRY
+ ADDIL L'locks-$global$,%r27,%r1
+ LDO R'locks-$global$(%r1),%r31
+ EXTRD,U %r26,60,4,%r28
+ DEPD,Z %r28,59,60,%r29
+ ADD,L %r29,%r31,%r31
+atomictest$3
+ LDCW 0(%r31),%r29
+ CMPB,<>,N %r0,%r29,gotlock$3
+ NOP
+spin$3
+ LDW 0(%r31),%r29
+ CMPB,=,N %r29,%r0,spin$3
+ NOP
+ B,N atomictest$3
+gotlock$3
+ LDW 0(%r26),%r28
+ STW %r25,0(%r26)
+ LDI 1,%r29
+ STW %r29,0(%r31)
+ .EXIT
+ BVE,N (%r2)
+ .PROCEND
+
+InterlockedExchangePointer
+ .EXPORT InterlockedExchangePointer,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
+ .PROC
+ .CALLINFO FRAME=0,ARGS_SAVED,ORDERING_AWARE
+ .ENTRY
+ ADDIL L'locks-$global$,%r27,%r1
+ LDO R'locks-$global$(%r1),%r31
+ EXTRD,U %r26,60,4,%r28
+ DEPD,Z %r28,59,60,%r29
+ ADD,L %r29,%r31,%r31
+atomictest$4
+ LDCW 0(%r31),%r29
+ CMPB,<>,N %r0,%r29,gotlock$4
+ NOP
+spin$4
+ LDW 0(%r31),%r29
+ CMPB,=,N %r29,%r0,spin$4
+ NOP
+ B,N atomictest$4
+gotlock$4
+ LDD 0(%r26),%r28
+ STD %r25,0(%r26)
+ LDI 1,%r29
+ STW %r29,0(%r31)
+ .EXIT
+ BVE,N (%r2)
+ .PROCEND
+
+InterlockedCompareExchange
+ .EXPORT InterlockedCompareExchange,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
+ .PROC
+ .CALLINFO FRAME=0,ARGS_SAVED,ORDERING_AWARE
+ .ENTRY
+ ADDIL L'locks-$global$,%r27,%r1
+ LDO R'locks-$global$(%r1),%r31
+ EXTRD,U %r26,60,4,%r28
+ DEPD,Z %r28,59,60,%r29
+ ADD,L %r29,%r31,%r31
+atomictest$5
+ LDCW 0(%r31),%r29
+ CMPB,<>,N %r0,%r29,gotlock$5
+ NOP
+spin$5
+ LDW 0(%r31),%r29
+ CMPB,=,N %r29,%r0,spin$5
+ NOP
+ B,N atomictest$5
+gotlock$5
+ LDW 0(%r26),%r28
+ CMPB,<> %r28,%r24,noexchange$5
+ NOP
+ STW %r25,0(%r26)
+noexchange$5
+ LDI 1,%r29
+ STW %r29,0(%r31)
+ .EXIT
+ BVE,N (%r2)
+ .PROCEND
+
+InterlockedCompareExchangePointer
+ .EXPORT InterlockedCompareExchangePointer,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
+ .PROC
+ .CALLINFO FRAME=0,ARGS_SAVED,ORDERING_AWARE
+ .ENTRY
+ ADDIL L'locks-$global$,%r27,%r1
+ LDO R'locks-$global$(%r1),%r31
+ EXTRD,U %r26,60,4,%r28
+ DEPD,Z %r28,59,60,%r29
+ ADD,L %r29,%r31,%r31
+atomictest$6
+ LDCW 0(%r31),%r29
+ CMPB,<>,N %r0,%r29,gotlock$6
+ NOP
+spin$6
+ LDW 0(%r31),%r29
+ CMPB,=,N %r29,%r0,spin$6
+ NOP
+ B,N atomictest$6
+gotlock$6
+ LDD 0(%r26),%r28
+ CMPB,*<> %r28,%r24,noexchange$6
+ NOP
+ STD %r25,0(%r26)
+noexchange$6
+ LDI 1,%r29
+ STW %r29,0(%r31)
+ .EXIT
+ BVE,N (%r2)
+ .PROCEND
+
+
+ .SPACE $PRIVATE$,SORT=16
+ .SUBSPA $SHORTDATA$,QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=24
+locks
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .ALIGN 16
+ .STRING "\x00\x00\x00\x01"
+ .IMPORT $global$,DATA
+ .END
diff --git a/mono/io-layer/io-layer.h b/mono/io-layer/io-layer.h
index 7153eb22336..00b351fea21 100644
--- a/mono/io-layer/io-layer.h
+++ b/mono/io-layer/io-layer.h
@@ -11,9 +11,7 @@
#ifndef _MONO_IOLAYER_IOLAYER_H_
#define _MONO_IOLAYER_IOLAYER_H_
-#include <config.h>
-
-#if defined(PLATFORM_WIN32)
+#if defined(__WIN32__)
/* Native win32 */
#define UNICODE
#define _UNICODE
@@ -21,6 +19,7 @@
#include <w32api.h>
#include <windows.h>
#include <ws2tcpip.h>
+#include <psapi.h>
#else /* EVERYONE ELSE */
#include "mono/io-layer/wapi.h"
#include "mono/io-layer/uglify.h"
diff --git a/mono/io-layer/io-private.h b/mono/io-layer/io-private.h
index cc680831a57..0fd2b4a7d4b 100644
--- a/mono/io-layer/io-private.h
+++ b/mono/io-layer/io-private.h
@@ -12,13 +12,15 @@
#include <config.h>
#include <glib.h>
-#include <glob.h>
+#include <dirent.h>
+#include <mono/io-layer/io.h>
extern struct _WapiHandleOps _wapi_file_ops;
extern struct _WapiHandleOps _wapi_console_ops;
extern struct _WapiHandleOps _wapi_find_ops;
+extern struct _WapiHandleOps _wapi_pipe_ops;
-/* Currently used for both FILE and CONSOLE handle types. This may
+/* Currently used for both FILE, CONSOLE and PIPE handle types. This may
* have to change in future.
*/
struct _WapiHandle_file
@@ -28,23 +30,35 @@ struct _WapiHandle_file
guint32 fileaccess;
guint32 sharemode;
guint32 attrs;
+ dev_t device;
+ ino_t inode;
};
struct _WapiHandlePrivate_file
{
- int fd;
+ WapiFDMapped fd_mapped;
+ gboolean async;
+ WapiOverlappedCB callback;
};
struct _WapiHandle_find
{
- glob_t glob;
- size_t count;
+ int dummy;
};
struct _WapiHandlePrivate_find
{
- int dummy;
+ gchar **namelist;
+ gchar *dir_part;
+ int num;
+ size_t count;
};
+G_BEGIN_DECLS
+int _wapi_file_handle_to_fd (gpointer handle);
+gboolean _wapi_io_add_callback (gpointer handle,
+ WapiOverlappedCB callback,
+ guint64 flags);
+G_END_DECLS
#endif /* _WAPI_IO_PRIVATE_H_ */
diff --git a/mono/io-layer/io.c b/mono/io-layer/io.c
index 9f11b982e16..21708612564 100644
--- a/mono/io-layer/io.c
+++ b/mono/io-layer/io.c
@@ -13,22 +13,38 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#include <sys/poll.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <glob.h>
+#include <dirent.h>
+#include <fnmatch.h>
#include <stdio.h>
#include <utime.h>
+#ifndef PLATFORM_WIN32
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#define USE_AIO 1
+#elif defined(HAVE_SYS_AIO_H)
+#include <sys/aio.h>
+#define USE_AIO 1
+#else
+#undef USE_AIO
+#endif
+#endif
+
#include <mono/io-layer/wapi.h>
-#include <mono/io-layer/unicode.h>
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/handles-private.h>
#include <mono/io-layer/io-private.h>
#include <mono/io-layer/timefuncs-private.h>
+#include <mono/io-layer/thread-private.h>
+#include <mono/utils/strenc.h>
#undef DEBUG
+static gboolean _wapi_lock_file_region (int fd, off_t offset, off_t length);
+static gboolean _wapi_unlock_file_region (int fd, off_t offset, off_t length);
+
static void file_close_shared (gpointer handle);
static void file_close_private (gpointer handle);
static WapiFileType file_getfiletype(void);
@@ -69,7 +85,6 @@ static gboolean console_read(gpointer handle, gpointer buffer,
static gboolean console_write(gpointer handle, gconstpointer buffer,
guint32 numbytes, guint32 *byteswritten,
WapiOverlapped *overlapped);
-static gboolean console_flush(gpointer handle);
/* Console is mostly the same as file, except it can block waiting for
* input or output
@@ -85,8 +100,27 @@ struct _WapiHandleOps _wapi_console_ops = {
/* Find handle has no ops.
*/
struct _WapiHandleOps _wapi_find_ops = {
- NULL, /* close */
- NULL, /* getfiletype */
+ NULL, /* close_shared */
+ NULL, /* close_private */
+ NULL, /* signal */
+ NULL, /* own */
+ NULL, /* is_owned */
+};
+
+static void pipe_close_shared (gpointer handle);
+static void pipe_close_private (gpointer handle);
+static WapiFileType pipe_getfiletype (void);
+static gboolean pipe_read (gpointer handle, gpointer buffer, guint32 numbytes,
+ guint32 *bytesread, WapiOverlapped *overlapped);
+static gboolean pipe_write (gpointer handle, gconstpointer buffer,
+ guint32 numbytes, guint32 *byteswritten,
+ WapiOverlapped *overlapped);
+
+/* Pipe handles
+ */
+struct _WapiHandleOps _wapi_pipe_ops = {
+ pipe_close_shared, /* close_shared */
+ pipe_close_private, /* close_private */
NULL, /* signal */
NULL, /* own */
NULL, /* is_owned */
@@ -96,7 +130,7 @@ static struct {
/* File, console and pipe handles */
WapiFileType (*getfiletype)(void);
- /* File and console handles */
+ /* File, console and pipe handles */
gboolean (*readfile)(gpointer handle, gpointer buffer,
guint32 numbytes, guint32 *bytesread,
WapiOverlapped *overlapped);
@@ -131,8 +165,7 @@ static struct {
{console_getfiletype,
console_read,
console_write,
- console_flush,
- NULL, NULL, NULL, NULL, NULL},
+ NULL, NULL, NULL, NULL, NULL, NULL},
/* thread */
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
/* sem */
@@ -147,6 +180,11 @@ static struct {
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
/* process */
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+ /* pipe */
+ {pipe_getfiletype,
+ pipe_read,
+ pipe_write,
+ NULL, NULL, NULL, NULL, NULL, NULL},
};
@@ -180,64 +218,10 @@ static guint32 _wapi_stat_to_file_attributes (struct stat *buf)
return attrs;
}
-static void _wapi_set_last_error_from_errno (void)
+static void
+_wapi_set_last_error_from_errno (void)
{
- /* mapping ideas borrowed from wine. they may need some work */
-
- switch (errno) {
- case EACCES: case EPERM: case EROFS:
- SetLastError (ERROR_ACCESS_DENIED);
- break;
-
- case EAGAIN:
- SetLastError (ERROR_SHARING_VIOLATION);
- break;
-
- case EBUSY:
- SetLastError (ERROR_LOCK_VIOLATION);
- break;
-
- case EEXIST:
- SetLastError (ERROR_FILE_EXISTS);
- break;
-
- case EINVAL: case ESPIPE:
- SetLastError (ERROR_SEEK);
- break;
-
- case EISDIR:
- SetLastError (ERROR_CANNOT_MAKE);
- break;
-
- case ENFILE: case EMFILE:
- SetLastError (ERROR_NO_MORE_FILES);
- break;
-
- case ENOENT: case ENOTDIR:
- SetLastError (ERROR_FILE_NOT_FOUND);
- break;
-
- case ENOSPC:
- SetLastError (ERROR_HANDLE_DISK_FULL);
- break;
-
- case ENOTEMPTY:
- SetLastError (ERROR_DIR_NOT_EMPTY);
- break;
-
- case ENOEXEC:
- SetLastError (ERROR_BAD_FORMAT);
- break;
-
- case ENAMETOOLONG:
- SetLastError (ERROR_FILENAME_EXCED_RANGE);
- break;
-
- default:
- g_message ("Unknown errno: %s\n", strerror (errno));
- SetLastError (ERROR_GEN_FAILURE);
- break;
- }
+ SetLastError (_wapi_get_win32_file_error (errno));
}
/* Handle ops.
@@ -252,6 +236,7 @@ static void file_close_shared (gpointer handle)
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
return;
}
@@ -274,20 +259,26 @@ static void file_close_private (gpointer handle)
struct _WapiHandlePrivate_file *file_private_handle;
gboolean ok;
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_UNUSED, NULL,
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FILE, NULL,
(gpointer *)&file_private_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
return;
}
+ if (file_private_handle->fd_mapped.assigned) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": closing file handle %p with fd %d",
- handle, file_private_handle->fd);
+ g_message(G_GNUC_PRETTY_FUNCTION ": closing file handle %p with fd %d",
+ handle, file_private_handle->fd_mapped.fd);
#endif
- close(file_private_handle->fd);
+ /* Blank out the mapping, to make catching errors easier */
+ _wapi_handle_fd_offset_store (file_private_handle->fd_mapped.fd, NULL);
+
+ close(file_private_handle->fd_mapped.fd);
+ }
}
static WapiFileType file_getfiletype(void)
@@ -295,9 +286,41 @@ static WapiFileType file_getfiletype(void)
return(FILE_TYPE_DISK);
}
+#ifdef USE_AIO
+typedef struct {
+ struct aiocb *aio;
+ WapiOverlapped *overlapped;
+ WapiOverlappedCB callback;
+} notifier_data_t;
+
+#define SIGPTR(a) a.SIGVAL_PTR
+
+static void
+async_notifier (union sigval sig)
+{
+ notifier_data_t *ndata = SIGPTR (sig);
+ guint32 error;
+ guint32 numbytes;
+
+ error = aio_return (ndata->aio);
+ if (error < 0) {
+ error = _wapi_get_win32_file_error (error);
+ numbytes = 0;
+ } else {
+ numbytes = error;
+ error = 0;
+ }
+
+ ndata->callback (error, numbytes, ndata->overlapped);
+ g_free (ndata->aio);
+ g_free (ndata);
+}
+
+#endif /* USE_AIO */
+
static gboolean file_read(gpointer handle, gpointer buffer,
guint32 numbytes, guint32 *bytesread,
- WapiOverlapped *overlapped G_GNUC_UNUSED)
+ WapiOverlapped *overlapped)
{
struct _WapiHandle_file *file_handle;
struct _WapiHandlePrivate_file *file_private_handle;
@@ -310,6 +333,12 @@ static gboolean file_read(gpointer handle, gpointer buffer,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -320,28 +349,97 @@ static gboolean file_read(gpointer handle, gpointer buffer,
if(!(file_handle->fileaccess&GENERIC_READ) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION": handle %p fd %d doesn't have GENERIC_READ access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION": handle %p fd %d doesn't have GENERIC_READ access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
-
- ret=read(file_private_handle->fd, buffer, numbytes);
- if(ret==-1) {
+
+ if (file_private_handle->async == FALSE) {
+ do {
+ ret=read(file_private_handle->fd_mapped.fd, buffer,
+ numbytes);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
+ if(ret==-1) {
+ gint err = errno;
+
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": read of handle %p fd %d error: %s", handle,
- file_private_handle->fd, strerror(errno));
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": read of handle %p fd %d error: %s", handle,
+ file_private_handle->fd_mapped.fd,
+ strerror(err));
#endif
+ SetLastError (_wapi_get_win32_file_error (err));
+ return(FALSE);
+ }
+
+ if(bytesread!=NULL) {
+ *bytesread=ret;
+ }
+
+ return(TRUE);
+ }
- return(FALSE);
+#ifndef USE_AIO
+ SetLastError (ERROR_NOT_SUPPORTED);
+ return FALSE;
+#else
+ if (overlapped == NULL || file_private_handle->callback == NULL) {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return FALSE;
}
-
- if(bytesread!=NULL) {
- *bytesread=ret;
+
+ {
+ int fd = file_private_handle->fd_mapped.fd;
+ struct aiocb *aio;
+ int result;
+ notifier_data_t *ndata;
+
+ ndata = g_new0 (notifier_data_t, 1);
+ aio = g_new0 (struct aiocb, 1);
+ ndata->overlapped = overlapped;
+ ndata->aio = aio;
+ ndata->callback = file_private_handle->callback;
+
+ aio->aio_fildes = fd;
+ aio->aio_lio_opcode = LIO_READ;
+ aio->aio_nbytes = numbytes;
+ aio->aio_offset = overlapped->Offset + (((gint64) overlapped->OffsetHigh) << 32);
+ aio->aio_buf = buffer;
+ aio->aio_sigevent.sigev_notify = SIGEV_THREAD;
+ aio->aio_sigevent.sigev_notify_function = async_notifier;
+ SIGPTR (aio->aio_sigevent.sigev_value) = ndata;
+
+ result = aio_read (aio);
+ if (result == -1) {
+ _wapi_set_last_error_from_errno ();
+ return FALSE;
}
-
- return(TRUE);
+
+ result = aio_error (aio);
+#ifdef DEBUG
+ g_print ("aio_error (read) returned %d for %d\n", result, fd);
+#endif
+ if (result == 0) {
+ numbytes = aio_return (aio);
+#ifdef DEBUG
+ g_print ("numbytes %d for %d\n", numbytes, fd);
+#endif
+ } else {
+ errno = result;
+ _wapi_set_last_error_from_errno ();
+ return FALSE;
+ }
+
+ if (bytesread)
+ *bytesread = numbytes;
+
+ return TRUE;
+ }
+#endif
}
static gboolean file_write(gpointer handle, gconstpointer buffer,
@@ -359,6 +457,12 @@ static gboolean file_write(gpointer handle, gconstpointer buffer,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -369,27 +473,119 @@ static gboolean file_write(gpointer handle, gconstpointer buffer,
if(!(file_handle->fileaccess&GENERIC_WRITE) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
- ret=write(file_private_handle->fd, buffer, numbytes);
- if(ret==-1) {
+ if (file_private_handle->async == FALSE) {
+ off_t current_pos;
+
+ /* Need to lock the region we're about to write to,
+ * because we only do advisory locking on POSIX
+ * systems
+ */
+ current_pos = lseek (file_private_handle->fd_mapped.fd,
+ (off_t)0, SEEK_CUR);
+ if (current_pos == -1) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": write of handle %p fd %d error: %s", handle,
- file_private_handle->fd, strerror(errno));
+ g_message (G_GNUC_PRETTY_FUNCTION ": handle %p fd %d lseek failed: %s", handle, file_private_handle->fd_mapped.fd, strerror (errno));
#endif
+ _wapi_set_last_error_from_errno ();
+ return(FALSE);
+ }
+
+ if (_wapi_lock_file_region (file_private_handle->fd_mapped.fd,
+ current_pos, numbytes) == FALSE) {
+ /* The error has already been set */
+ return(FALSE);
+ }
+
+ do {
+ ret=write(file_private_handle->fd_mapped.fd, buffer,
+ numbytes);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
- return(FALSE);
+ _wapi_unlock_file_region (file_private_handle->fd_mapped.fd,
+ current_pos, numbytes);
+
+ if(ret==-1) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": write of handle %p fd %d error: %s", handle,
+ file_private_handle->fd_mapped.fd,
+ strerror(errno));
+#endif
+
+ _wapi_set_last_error_from_errno ();
+ return(FALSE);
+ }
+ if(byteswritten!=NULL) {
+ *byteswritten=ret;
+ }
+ return(TRUE);
}
- if(byteswritten!=NULL) {
- *byteswritten=ret;
+
+#ifndef USE_AIO
+ SetLastError (ERROR_NOT_SUPPORTED);
+ return FALSE;
+#else
+ if (overlapped == NULL || file_private_handle->callback == NULL) {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return FALSE;
}
-
- return(TRUE);
+
+ {
+ int fd = file_private_handle->fd_mapped.fd;
+ struct aiocb *aio;
+ int result;
+ notifier_data_t *ndata;
+
+ ndata = g_new0 (notifier_data_t, 1);
+ aio = g_new0 (struct aiocb, 1);
+ ndata->overlapped = overlapped;
+ ndata->aio = aio;
+ ndata->callback = file_private_handle->callback;
+
+ aio->aio_fildes = fd;
+ aio->aio_lio_opcode = LIO_WRITE;
+ aio->aio_nbytes = numbytes;
+ aio->aio_offset = overlapped->Offset + (((gint64) overlapped->OffsetHigh) << 32);
+ aio->aio_buf = (gpointer) buffer;
+ aio->aio_sigevent.sigev_notify = SIGEV_THREAD;
+ aio->aio_sigevent.sigev_notify_function = async_notifier;
+ SIGPTR (aio->aio_sigevent.sigev_value) = ndata;
+
+ result = aio_write (aio);
+ if (result == -1) {
+ _wapi_set_last_error_from_errno ();
+ return FALSE;
+ }
+
+ result = aio_error (aio);
+#ifdef DEBUG
+ g_print ("aio_error (write) returned %d for %d\n", result, fd);
+#endif
+ if (result == 0) {
+ numbytes = aio_return (aio);
+#ifdef DEBUG
+ g_print ("numbytes %d for %d\n", numbytes, fd);
+#endif
+ } else {
+ errno = result;
+ _wapi_set_last_error_from_errno ();
+ return FALSE;
+ }
+
+ if (byteswritten)
+ *byteswritten = numbytes;
+
+ return TRUE;
+ }
+#endif
}
static gboolean file_flush(gpointer handle)
@@ -405,26 +601,34 @@ static gboolean file_flush(gpointer handle)
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
if(!(file_handle->fileaccess&GENERIC_WRITE) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
- ret=fsync(file_private_handle->fd);
+ ret=fsync(file_private_handle->fd_mapped.fd);
if (ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
- ": write of handle %p fd %d error: %s", handle,
- file_private_handle->fd, strerror(errno));
+ ": fsync of handle %p fd %d error: %s", handle,
+ file_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
@@ -447,16 +651,23 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
return(INVALID_SET_FILE_POINTER);
}
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
if(!(file_handle->fileaccess&GENERIC_READ) &&
!(file_handle->fileaccess&GENERIC_WRITE) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(INVALID_SET_FILE_POINTER);
}
@@ -476,6 +687,7 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
method);
#endif
+ SetLastError (ERROR_INVALID_PARAMETER);
return(INVALID_SET_FILE_POINTER);
}
@@ -488,7 +700,7 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
movedistance);
#endif
} else {
- offset=((gint64) *highmovedistance << 32) | movedistance;
+ offset=((gint64) *highmovedistance << 32) | (unsigned long)movedistance;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": setting offset to %lld 0x%llx (high %d 0x%x, low %d 0x%x)", offset, offset, *highmovedistance, *highmovedistance, movedistance, movedistance);
@@ -502,22 +714,24 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
#ifdef HAVE_LARGE_FILE_SUPPORT
g_message(G_GNUC_PRETTY_FUNCTION
": moving handle %p fd %d by %lld bytes from %d", handle,
- file_private_handle->fd, offset, whence);
+ file_private_handle->fd_mapped.fd, offset, whence);
#else
g_message(G_GNUC_PRETTY_FUNCTION
": moving handle %p fd %d by %ld bytes from %d", handle,
- file_private_handle->fd, offset, whence);
+ file_private_handle->fd_mapped.fd, offset, whence);
#endif
#endif
- newpos=lseek(file_private_handle->fd, offset, whence);
+ newpos=lseek(file_private_handle->fd_mapped.fd, offset, whence);
if(newpos==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": lseek on handle %p fd %d returned error %s",
- handle, file_private_handle->fd, strerror(errno));
+ handle, file_private_handle->fd_mapped.fd,
+ strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(INVALID_SET_FILE_POINTER);
}
@@ -545,7 +759,7 @@ static guint32 file_seek(gpointer handle, gint32 movedistance,
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": move of handle %p fd %d returning %d/%d", handle,
- file_private_handle->fd, ret,
+ file_private_handle->fd_mapped.fd, ret,
highmovedistance==NULL?0:*highmovedistance);
#endif
@@ -567,15 +781,22 @@ static gboolean file_setendoffile(gpointer handle)
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
if(!(file_handle->fileaccess&GENERIC_WRITE) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
@@ -585,40 +806,47 @@ static gboolean file_setendoffile(gpointer handle)
* than the length, truncate the file.
*/
- ret=fstat(file_private_handle->fd, &statbuf);
+ ret=fstat(file_private_handle->fd_mapped.fd, &statbuf);
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d fstat failed: %s", handle,
- file_private_handle->fd, strerror(errno));
+ file_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
size=statbuf.st_size;
- pos=lseek(file_private_handle->fd, (off_t)0, SEEK_CUR);
+ pos=lseek(file_private_handle->fd_mapped.fd, (off_t)0, SEEK_CUR);
if(pos==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d lseek failed: %s", handle,
- file_private_handle->fd, strerror(errno));
+ file_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
if(pos>size) {
/* extend */
- ret=write(file_private_handle->fd, "", 1);
+ do {
+ ret=write(file_private_handle->fd_mapped.fd, "", 1);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d extend write failed: %s",
- handle, file_private_handle->fd,
+ handle, file_private_handle->fd_mapped.fd,
strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
}
@@ -626,14 +854,19 @@ static gboolean file_setendoffile(gpointer handle)
/* always truncate, because the extend write() adds an extra
* byte to the end of the file
*/
- ret=ftruncate(file_private_handle->fd, pos);
+ do {
+ ret=ftruncate(file_private_handle->fd_mapped.fd, pos);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d ftruncate failed: %s", handle,
- file_private_handle->fd, strerror(errno));
+ file_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
@@ -655,27 +888,35 @@ static guint32 file_getfilesize(gpointer handle, guint32 *highsize)
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
return(INVALID_FILE_SIZE);
}
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
if(!(file_handle->fileaccess&GENERIC_READ) &&
!(file_handle->fileaccess&GENERIC_WRITE) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(INVALID_FILE_SIZE);
}
- ret=fstat(file_private_handle->fd, &statbuf);
+ ret=fstat(file_private_handle->fd_mapped.fd, &statbuf);
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d fstat failed: %s", handle,
- file_private_handle->fd, strerror(errno));
+ file_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(INVALID_FILE_SIZE);
}
@@ -717,26 +958,34 @@ static gboolean file_getfiletime(gpointer handle, WapiFileTime *create_time,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
if(!(file_handle->fileaccess&GENERIC_READ) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
- ret=fstat(file_private_handle->fd, &statbuf);
+ ret=fstat(file_private_handle->fd_mapped.fd, &statbuf);
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d fstat failed: %s", handle,
- file_private_handle->fd, strerror(errno));
+ file_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
@@ -755,14 +1004,14 @@ static gboolean file_getfiletime(gpointer handle, WapiFileTime *create_time,
*/
if(statbuf.st_atime < statbuf.st_ctime) {
create_ticks=((guint64)statbuf.st_atime*10000000)
- + 116444736000000000UL;
+ + 116444736000000000ULL;
} else {
create_ticks=((guint64)statbuf.st_ctime*10000000)
- + 116444736000000000UL;
+ + 116444736000000000ULL;
}
- access_ticks=((guint64)statbuf.st_atime*10000000)+116444736000000000UL;
- write_ticks=((guint64)statbuf.st_mtime*10000000)+116444736000000000UL;
+ access_ticks=((guint64)statbuf.st_atime*10000000)+116444736000000000ULL;
+ write_ticks=((guint64)statbuf.st_mtime*10000000)+116444736000000000ULL;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
@@ -808,15 +1057,22 @@ static gboolean file_setfiletime(gpointer handle,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
if(!(file_handle->fileaccess&GENERIC_WRITE) &&
!(file_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd, file_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
@@ -824,30 +1080,44 @@ static gboolean file_setfiletime(gpointer handle,
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d unknown filename", handle,
- file_private_handle->fd);
+ file_private_handle->fd_mapped.fd);
#endif
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
/* Get the current times, so we can put the same times back in
* the event that one of the FileTime structs is NULL
*/
- ret=fstat(file_private_handle->fd, &statbuf);
+ ret=fstat(file_private_handle->fd_mapped.fd, &statbuf);
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p fd %d fstat failed: %s", handle,
- file_private_handle->fd, strerror(errno));
+ file_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ SetLastError (ERROR_INVALID_PARAMETER);
return(FALSE);
}
if(last_access!=NULL) {
access_ticks=((guint64)last_access->dwHighDateTime << 32) +
last_access->dwLowDateTime;
- utbuf.actime=(access_ticks - 116444736000000000) / 10000000;
+ /* This is (time_t)0. We can actually go to INT_MIN,
+ * but this will do for now.
+ */
+ if (access_ticks < 116444736000000000ULL) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": attempt to set access time too early");
+#endif
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return(FALSE);
+ }
+
+ utbuf.actime=(access_ticks - 116444736000000000ULL) / 10000000;
} else {
utbuf.actime=statbuf.st_atime;
}
@@ -855,7 +1125,19 @@ static gboolean file_setfiletime(gpointer handle,
if(last_write!=NULL) {
write_ticks=((guint64)last_write->dwHighDateTime << 32) +
last_write->dwLowDateTime;
- utbuf.modtime=(write_ticks - 116444736000000000) / 10000000;
+ /* This is (time_t)0. We can actually go to INT_MIN,
+ * but this will do for now.
+ */
+ if (write_ticks < 116444736000000000ULL) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": attempt to set write time too early");
+#endif
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return(FALSE);
+ }
+
+ utbuf.modtime=(write_ticks - 116444736000000000ULL) / 10000000;
} else {
utbuf.modtime=statbuf.st_mtime;
}
@@ -866,17 +1148,19 @@ static gboolean file_setfiletime(gpointer handle,
utbuf.actime, utbuf.modtime);
#endif
- name=_wapi_handle_scratch_lookup_as_string (file_handle->filename);
+ name=_wapi_handle_scratch_lookup (file_handle->filename);
ret=utime(name, &utbuf);
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": handle %p [%s] fd %d utime failed: %s", handle,
- name, file_private_handle->fd, strerror(errno));
+ name, file_private_handle->fd_mapped.fd,
+ strerror(errno));
#endif
g_free (name);
+ SetLastError (ERROR_INVALID_PARAMETER);
return(FALSE);
}
@@ -895,6 +1179,7 @@ static void console_close_shared (gpointer handle)
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up console handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
return;
}
@@ -917,21 +1202,27 @@ static void console_close_private (gpointer handle)
struct _WapiHandlePrivate_file *console_private_handle;
gboolean ok;
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_UNUSED, NULL,
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_CONSOLE, NULL,
(gpointer *)&console_private_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up console handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
return;
}
+ if (console_private_handle->fd_mapped.assigned == TRUE) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": closing console handle %p with fd %d", handle,
- console_private_handle->fd);
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": closing console handle %p with fd %d", handle,
+ console_private_handle->fd_mapped.fd);
#endif
- close(console_private_handle->fd);
+ /* Blank out the mapping, to make catching errors easier */
+ _wapi_handle_fd_offset_store (console_private_handle->fd_mapped.fd, NULL);
+
+ close(console_private_handle->fd_mapped.fd);
+ }
}
static WapiFileType console_getfiletype(void)
@@ -954,6 +1245,12 @@ static gboolean console_read(gpointer handle, gpointer buffer,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up console handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (console_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -964,20 +1261,28 @@ static gboolean console_read(gpointer handle, gpointer buffer,
if(!(console_handle->fileaccess&GENERIC_READ) &&
!(console_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION": handle %p fd %d doesn't have GENERIC_READ access: %u", handle, console_private_handle->fd, console_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION": handle %p fd %d doesn't have GENERIC_READ access: %u", handle, console_private_handle->fd_mapped.fd, console_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
- ret=read(console_private_handle->fd, buffer, numbytes);
+ do {
+ ret=read(console_private_handle->fd_mapped.fd, buffer,
+ numbytes);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": read of handle %p fd %d error: %s", handle,
- console_private_handle->fd, strerror(errno));
+ console_private_handle->fd_mapped.fd,
+ strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
@@ -1003,6 +1308,12 @@ static gboolean console_write(gpointer handle, gconstpointer buffer,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up console handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (console_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1013,20 +1324,28 @@ static gboolean console_write(gpointer handle, gconstpointer buffer,
if(!(console_handle->fileaccess&GENERIC_WRITE) &&
!(console_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, console_private_handle->fd, console_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, console_private_handle->fd_mapped.fd, console_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
- ret=write(console_private_handle->fd, buffer, numbytes);
+ do {
+ ret=write(console_private_handle->fd_mapped.fd, buffer,
+ numbytes);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": write of handle %p fd %d error: %s", handle,
- console_private_handle->fd, strerror(errno));
+ console_private_handle->fd_mapped.fd,
+ strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
if(byteswritten!=NULL) {
@@ -1036,41 +1355,200 @@ static gboolean console_write(gpointer handle, gconstpointer buffer,
return(TRUE);
}
-static gboolean console_flush(gpointer handle)
+static void pipe_close_shared (gpointer handle)
{
- struct _WapiHandle_file *console_handle;
- struct _WapiHandlePrivate_file *console_private_handle;
+ struct _WapiHandle_file *pipe_handle;
+ gboolean ok;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_PIPE,
+ (gpointer *)&pipe_handle, NULL);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up pipe handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return;
+ }
+
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": closing pipe handle %p", handle);
+#endif
+
+ if(pipe_handle->filename!=0) {
+ _wapi_handle_scratch_delete (pipe_handle->filename);
+ pipe_handle->filename=0;
+ }
+ if(pipe_handle->security_attributes!=0) {
+ _wapi_handle_scratch_delete (pipe_handle->security_attributes);
+ pipe_handle->security_attributes=0;
+ }
+}
+
+static void pipe_close_private (gpointer handle)
+{
+ struct _WapiHandlePrivate_file *pipe_private_handle;
+ gboolean ok;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_PIPE, NULL,
+ (gpointer *)&pipe_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up pipe handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return;
+ }
+
+ if (pipe_private_handle->fd_mapped.assigned == TRUE) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": closing pipe handle %p with fd %d", handle,
+ pipe_private_handle->fd_mapped.fd);
+#endif
+
+ /* Blank out the mapping, to make catching errors easier */
+ _wapi_handle_fd_offset_store (pipe_private_handle->fd_mapped.fd, NULL);
+
+ close(pipe_private_handle->fd_mapped.fd);
+ }
+}
+
+static WapiFileType pipe_getfiletype(void)
+{
+ return(FILE_TYPE_PIPE);
+}
+
+static gboolean pipe_read (gpointer handle, gpointer buffer,
+ guint32 numbytes, guint32 *bytesread,
+ WapiOverlapped *overlapped G_GNUC_UNUSED)
+{
+ struct _WapiHandle_file *pipe_handle;
+ struct _WapiHandlePrivate_file *pipe_private_handle;
gboolean ok;
int ret;
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_CONSOLE,
- (gpointer *)&console_handle,
- (gpointer *)&console_private_handle);
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_PIPE,
+ (gpointer *)&pipe_handle,
+ (gpointer *)&pipe_private_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up console handle %p", handle);
+ ": error looking up pipe handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
- if(!(console_handle->fileaccess&GENERIC_WRITE) &&
- !(console_handle->fileaccess&GENERIC_ALL)) {
+ if (pipe_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if(bytesread!=NULL) {
+ *bytesread=0;
+ }
+
+ if(!(pipe_handle->fileaccess&GENERIC_READ) &&
+ !(pipe_handle->fileaccess&GENERIC_ALL)) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, console_private_handle->fd, console_handle->fileaccess);
+ g_message(G_GNUC_PRETTY_FUNCTION": handle %p fd %d doesn't have GENERIC_READ access: %u", handle, pipe_private_handle->fd_mapped.fd, pipe_handle->fileaccess);
#endif
+ SetLastError (ERROR_ACCESS_DENIED);
return(FALSE);
}
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": reading up to %d bytes from pipe %p (fd %d)", numbytes,
+ handle, pipe_private_handle->fd_mapped.fd);
+#endif
- ret=fsync(console_private_handle->fd);
- if (ret==-1) {
+ do {
+ ret=read(pipe_private_handle->fd_mapped.fd, buffer, numbytes);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
+ if(ret==-1) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": read of handle %p fd %d error: %s", handle,
+ pipe_private_handle->fd_mapped.fd, strerror(errno));
+#endif
+
+ _wapi_set_last_error_from_errno ();
+ return(FALSE);
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": read %d bytes from pipe", ret);
+#endif
+
+ if(bytesread!=NULL) {
+ *bytesread=ret;
+ }
+
+ return(TRUE);
+}
+
+static gboolean pipe_write(gpointer handle, gconstpointer buffer,
+ guint32 numbytes, guint32 *byteswritten,
+ WapiOverlapped *overlapped G_GNUC_UNUSED)
+{
+ struct _WapiHandle_file *pipe_handle;
+ struct _WapiHandlePrivate_file *pipe_private_handle;
+ gboolean ok;
+ int ret;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_PIPE,
+ (gpointer *)&pipe_handle,
+ (gpointer *)&pipe_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up pipe handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (pipe_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if(byteswritten!=NULL) {
+ *byteswritten=0;
+ }
+
+ if(!(pipe_handle->fileaccess&GENERIC_WRITE) &&
+ !(pipe_handle->fileaccess&GENERIC_ALL)) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_WRITE access: %u", handle, pipe_private_handle->fd_mapped.fd, pipe_handle->fileaccess);
+#endif
+
+ SetLastError (ERROR_ACCESS_DENIED);
+ return(FALSE);
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": writing up to %d bytes to pipe %p (fd %d)", numbytes,
+ handle, pipe_private_handle->fd_mapped.fd);
+#endif
+
+ do {
+ ret=write(pipe_private_handle->fd_mapped.fd, buffer, numbytes);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
+ if(ret==-1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": write of handle %p fd %d error: %s", handle,
- console_private_handle->fd, strerror(errno));
+ pipe_private_handle->fd_mapped.fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(FALSE);
}
+ if(byteswritten!=NULL) {
+ *byteswritten=ret;
+ }
return(TRUE);
}
@@ -1127,11 +1605,15 @@ static guint32 convert_from_flags(int flags)
{
guint32 fileaccess=0;
- if(flags&O_RDONLY) {
+#ifndef O_ACCMODE
+#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
+#endif
+
+ if((flags & O_ACCMODE) == O_RDONLY) {
fileaccess=GENERIC_READ;
- } else if (flags&O_WRONLY) {
+ } else if ((flags & O_ACCMODE) == O_WRONLY) {
fileaccess=GENERIC_WRITE;
- } else if (flags&O_RDWR) {
+ } else if ((flags & O_ACCMODE) == O_RDWR) {
fileaccess=GENERIC_READ|GENERIC_WRITE;
} else {
#ifdef DEBUG
@@ -1195,33 +1677,63 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
gpointer handle;
gboolean ok;
int flags=convert_flags(fileaccess, createmode);
- mode_t perms=convert_perms(sharemode);
+ /*mode_t perms=convert_perms(sharemode);*/
+ /* we don't use sharemode, because that relates to sharing of the file
+ * when the file is open and is already handled by other code, perms instead
+ * are the on-disk permissions and this is a sane default.
+ */
+ mode_t perms=0644;
gchar *filename;
- int ret;
-
- mono_once (&io_ops_once, io_ops_init);
+ int fd, ret;
+ int thr_ret;
+ gpointer cf_ret = INVALID_HANDLE_VALUE;
+ struct stat statbuf;
+ gboolean file_already_shared;
+ guint32 file_existing_share, file_existing_access;
+ mono_once (&io_ops_once, io_ops_init);
+
if(name==NULL) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
#endif
+ SetLastError (ERROR_INVALID_NAME);
return(INVALID_HANDLE_VALUE);
}
- filename=_wapi_unicode_to_utf8(name);
+ filename=mono_unicode_to_external (name);
if(filename==NULL) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": unicode conversion returned NULL");
#endif
+ SetLastError (ERROR_INVALID_NAME);
return(INVALID_HANDLE_VALUE);
}
- ret=open(filename, flags, perms);
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Opening %s with share 0x%x and access 0x%x", filename, sharemode, fileaccess);
+#endif
- if(ret==-1) {
+ fd = open(filename, flags, perms);
+
+ /* If we were trying to open a directory with write permissions
+ * (e.g. O_WRONLY or O_RDWR), this call will fail with
+ * EISDIR. However, this is a bit bogus because calls to
+ * manipulate the directory (e.g. SetFileTime) will still work on
+ * the directory because they use other API calls
+ * (e.g. utime()). Hence, if we failed with the EISDIR error, try
+ * to open the directory again without write permission.
+ */
+ if (fd == -1 && errno == EISDIR)
+ {
+ /* Try again but don't try to make it writable */
+ fd = open(filename, flags & ~(O_RDWR|O_WRONLY), perms);
+ }
+
+ if (fd == -1) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Error opening file %s: %s",
filename, strerror(errno));
@@ -1232,16 +1744,96 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
return(INVALID_HANDLE_VALUE);
}
+ if (fd >= _wapi_fd_offset_table_size) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
+#endif
+
+ SetLastError (ERROR_TOO_MANY_OPEN_FILES);
+
+ close (fd);
+ g_free (filename);
+
+ return(INVALID_HANDLE_VALUE);
+ }
+
+ ret = fstat (fd, &statbuf);
+ if (ret == -1) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": fstat error of file %s: %s", filename, strerror (errno));
+#endif
+ _wapi_set_last_error_from_errno ();
+ g_free (filename);
+ close (fd);
+
+ return(INVALID_HANDLE_VALUE);
+ }
+
+ file_already_shared = _wapi_handle_get_or_set_share (statbuf.st_dev, statbuf.st_ino, sharemode, fileaccess, &file_existing_share, &file_existing_access);
+
+ if (file_already_shared) {
+ if (file_existing_share == 0) {
+ /* Quick and easy, no possibility to share */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Share mode prevents open: requested access: 0x%x, file has sharing = NONE", fileaccess);
+#endif
+ SetLastError (ERROR_SHARING_VIOLATION);
+ g_free (filename);
+ close (fd);
+
+ return(INVALID_HANDLE_VALUE);
+ }
+
+ if (((file_existing_share == FILE_SHARE_READ) &&
+ (fileaccess != GENERIC_READ)) ||
+ ((file_existing_share == FILE_SHARE_WRITE) &&
+ (fileaccess != GENERIC_WRITE))) {
+ /* New access mode doesn't match up */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Share mode prevents open: requested access: 0x%x, file has sharing: 0x%x", fileaccess, file_existing_share);
+#endif
+ SetLastError (ERROR_SHARING_VIOLATION);
+ g_free (filename);
+ close (fd);
+
+ return(INVALID_HANDLE_VALUE);
+ }
+
+ if (((file_existing_access & GENERIC_READ) &&
+ !(sharemode & FILE_SHARE_READ)) ||
+ ((file_existing_access & GENERIC_WRITE) &&
+ !(sharemode & FILE_SHARE_WRITE))) {
+ /* New share mode doesn't match up */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Access mode prevents open: requested share: 0x%x, file has access: 0x%x", sharemode, file_existing_access);
+#endif
+ SetLastError (ERROR_SHARING_VIOLATION);
+ g_free (filename);
+ close (fd);
+
+ return(INVALID_HANDLE_VALUE);
+ }
+ } else {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": New file!");
+#endif
+ }
+
handle=_wapi_handle_new (WAPI_HANDLE_FILE);
if(handle==_WAPI_HANDLE_INVALID) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error creating file handle");
g_free (filename);
-
+ close (fd);
+
+ SetLastError (ERROR_GEN_FAILURE);
return(INVALID_HANDLE_VALUE);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
(gpointer *)&file_handle,
@@ -1249,13 +1841,17 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up file handle %p", handle);
- _wapi_handle_unlock_handle (handle);
- g_free (filename);
-
- return(INVALID_HANDLE_VALUE);
+ SetLastError (ERROR_INVALID_HANDLE);
+ close (fd);
+ goto cleanup;
}
- file_private_handle->fd=ret;
+ _wapi_handle_fd_offset_store (fd, handle);
+ cf_ret = GINT_TO_POINTER (fd);
+
+ file_private_handle->fd_mapped.fd=fd;
+ file_private_handle->fd_mapped.assigned=TRUE;
+ file_private_handle->async = ((attrs & FILE_FLAG_OVERLAPPED) != 0);
file_handle->filename=_wapi_handle_scratch_store (filename,
strlen (filename));
if(security!=NULL) {
@@ -1266,17 +1862,23 @@ gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
file_handle->fileaccess=fileaccess;
file_handle->sharemode=sharemode;
file_handle->attrs=attrs;
+ file_handle->device = statbuf.st_dev;
+ file_handle->inode = statbuf.st_ino;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": returning handle %p with fd %d", handle,
- file_private_handle->fd);
+ file_private_handle->fd_mapped.fd);
#endif
- _wapi_handle_unlock_handle (handle);
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
g_free (filename);
- return(handle);
+ return(cf_ret);
}
/**
@@ -1298,16 +1900,18 @@ gboolean DeleteFile(const gunichar2 *name)
g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
#endif
+ SetLastError (ERROR_INVALID_NAME);
return(FALSE);
}
- filename=_wapi_unicode_to_utf8(name);
+ filename=mono_unicode_to_external(name);
if(filename==NULL) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": unicode conversion returned NULL");
#endif
+ SetLastError (ERROR_INVALID_NAME);
return(FALSE);
}
@@ -1317,9 +1921,10 @@ gboolean DeleteFile(const gunichar2 *name)
if(ret==0) {
return(TRUE);
- } else {
- return(FALSE);
}
+
+ _wapi_set_last_error_from_errno ();
+ return(FALSE);
}
/**
@@ -1337,23 +1942,44 @@ gboolean MoveFile (const gunichar2 *name, const gunichar2 *dest_name)
{
gchar *utf8_name, *utf8_dest_name;
int result;
+
+ if(name==NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
- utf8_name = _wapi_unicode_to_utf8 (name);
+ utf8_name = mono_unicode_to_external (name);
if (utf8_name == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
#endif
+ SetLastError (ERROR_INVALID_NAME);
return FALSE;
}
+
+ if(dest_name==NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
- utf8_dest_name = _wapi_unicode_to_utf8 (dest_name);
+ g_free (utf8_name);
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
+
+ utf8_dest_name = mono_unicode_to_external (dest_name);
if (utf8_dest_name == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
#endif
g_free (utf8_name);
+ SetLastError (ERROR_INVALID_NAME);
return FALSE;
}
@@ -1361,8 +1987,19 @@ gboolean MoveFile (const gunichar2 *name, const gunichar2 *dest_name)
g_free (utf8_name);
g_free (utf8_dest_name);
- if (result == 0)
+ if (result != 0 && errno == EXDEV) {
+ /* Try a copy to the new location, and delete the source */
+ if (CopyFile (name, dest_name, TRUE)==FALSE) {
+ /* CopyFile will set the error */
+ return(FALSE);
+ }
+
+ return(DeleteFile (name));
+ }
+
+ if (result == 0) {
return TRUE;
+ }
switch (errno) {
case EEXIST:
@@ -1392,120 +2029,177 @@ gboolean MoveFile (const gunichar2 *name, const gunichar2 *dest_name)
gboolean CopyFile (const gunichar2 *name, const gunichar2 *dest_name,
gboolean fail_if_exists)
{
- gpointer src, dest;
- guint32 attrs;
- char *buffer;
+ gchar *utf8_src, *utf8_dest;
+ int src_fd, dest_fd;
+ int buf_size;
+ char *buf;
int remain, n;
+ struct stat st;
+
+ if(name==NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
- attrs = GetFileAttributes (name);
- if (attrs == -1) {
- SetLastError (ERROR_FILE_NOT_FOUND);
- return FALSE;
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
}
- src = CreateFile (name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, OPEN_EXISTING, 0, NULL);
- if (src == INVALID_HANDLE_VALUE) {
- _wapi_set_last_error_from_errno ();
- return FALSE;
+ utf8_src = mono_unicode_to_external (name);
+ if (utf8_src == NULL) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion of source returned NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return(FALSE);
}
- dest = CreateFile (dest_name, GENERIC_WRITE, 0, NULL,
- fail_if_exists ? CREATE_NEW : CREATE_ALWAYS, attrs, NULL);
- if (dest == INVALID_HANDLE_VALUE) {
+ if(dest_name==NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
+
+ g_free (utf8_src);
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
+
+ utf8_dest = mono_unicode_to_external (dest_name);
+ if (utf8_dest == NULL) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion of dest returned NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_PARAMETER);
+
+ g_free (utf8_src);
+
+ return(FALSE);
+ }
+
+ src_fd = open (utf8_src, O_RDONLY);
+ if (src_fd < 0) {
_wapi_set_last_error_from_errno ();
- CloseHandle (src);
- return FALSE;
+
+ g_free (utf8_src);
+ g_free (utf8_dest);
+
+ return(FALSE);
}
- buffer = g_new (gchar, 2048);
+ if (fstat (src_fd, &st) < 0) {
+ _wapi_set_last_error_from_errno ();
+ g_free (utf8_src);
+ g_free (utf8_dest);
+ close (src_fd);
+
+ return(FALSE);
+ }
+
+ if (fail_if_exists) {
+ dest_fd = open (utf8_dest, O_WRONLY | O_CREAT, st.st_mode);
+ } else {
+ dest_fd = open (utf8_dest, O_WRONLY | O_TRUNC, st.st_mode);
+ if (dest_fd < 0) {
+ /* O_TRUNC might cause a fail if the file
+ * doesn't exist
+ */
+ dest_fd = open (utf8_dest, O_WRONLY | O_CREAT,
+ st.st_mode);
+ }
+ }
+ if (dest_fd < 0) {
+ _wapi_set_last_error_from_errno ();
+
+ g_free (utf8_src);
+ g_free (utf8_dest);
+ close (src_fd);
+
+ return(FALSE);
+ }
+
+ buf_size = st.st_blksize;
+ buf = (char *) alloca (buf_size);
+
for (;;) {
- if (ReadFile (src, buffer,sizeof (buffer), &remain, NULL) == 0) {
+ remain = read (src_fd, buf, buf_size);
+
+ if (remain < 0) {
+ if (errno == EINTR && !_wapi_thread_cur_apc_pending()) {
+ continue;
+ }
+
_wapi_set_last_error_from_errno ();
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": read failed.");
-#endif
+
+ g_free (utf8_src);
+ g_free (utf8_dest);
+ close (src_fd);
+ close (dest_fd);
- CloseHandle (dest);
- CloseHandle (src);
- return FALSE;
+ return(FALSE);
}
-
- if (remain == 0)
+
+ if (remain == 0) {
break;
+ }
while (remain > 0) {
- if (WriteFile (dest, buffer, remain, &n, NULL) == 0) {
+ if ((n = write (dest_fd, buf, remain)) < 0) {
+ if (errno == EINTR && !_wapi_thread_cur_apc_pending())
+ continue;
+
_wapi_set_last_error_from_errno ();
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": write failed.");
#endif
-
- CloseHandle (dest);
- CloseHandle (src);
- return FALSE;
+
+ g_free (utf8_src);
+ g_free (utf8_dest);
+ close (src_fd);
+ close (dest_fd);
+
+ return (FALSE);
}
remain -= n;
}
}
- g_free (buffer);
+ g_free (utf8_src);
+ g_free (utf8_dest);
+ close (src_fd);
+ close (dest_fd);
- CloseHandle (dest);
- CloseHandle (src);
- return TRUE;
+ return(TRUE);
}
-/**
- * GetStdHandle:
- * @stdhandle: specifies the file descriptor
- *
- * Returns a handle for stdin, stdout, or stderr. Always returns the
- * same handle for the same @stdhandle.
- *
- * Return value: the handle, or %INVALID_HANDLE_VALUE on error
- */
+static mono_once_t stdhandle_once=MONO_ONCE_INIT;
+static gpointer stdin_handle=INVALID_HANDLE_VALUE;
+static gpointer stdout_handle=INVALID_HANDLE_VALUE;
+static gpointer stderr_handle=INVALID_HANDLE_VALUE;
-gpointer GetStdHandle(WapiStdHandle stdhandle)
+static gpointer stdhandle_create (int fd, const guchar *name)
{
struct _WapiHandle_file *file_handle;
struct _WapiHandlePrivate_file *file_private_handle;
gboolean ok;
- gpointer handle;
- const guchar *name;
- int flags, fd;
-
- mono_once (&io_ops_once, io_ops_init);
+ gpointer handle, ret = INVALID_HANDLE_VALUE;
+ int flags;
+ int thr_ret;
- switch(stdhandle) {
- case STD_INPUT_HANDLE:
- fd=0;
- name="<stdin>";
- break;
-
- case STD_OUTPUT_HANDLE:
- fd=1;
- name="<stdout>";
- break;
-
- case STD_ERROR_HANDLE:
- fd=2;
- name="<stderr>";
- break;
-
- default:
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": unknown standard handle type");
+ g_message(G_GNUC_PRETTY_FUNCTION ": creating standard handle type %s",
+ name);
#endif
-
- return(INVALID_HANDLE_VALUE);
- }
/* Check if fd is valid */
- flags=fcntl(fd, F_GETFL);
+ do {
+ flags=fcntl(fd, F_GETFL);
+ }
+ while (flags==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
if(flags==-1) {
/* Invalid fd. Not really much point checking for EBADF
* specifically
@@ -1515,17 +2209,22 @@ gpointer GetStdHandle(WapiStdHandle stdhandle)
fd, strerror(errno));
#endif
+ _wapi_set_last_error_from_errno ();
return(INVALID_HANDLE_VALUE);
}
-
+
handle=_wapi_handle_new (WAPI_HANDLE_CONSOLE);
if(handle==_WAPI_HANDLE_INVALID) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error creating file handle");
- return(NULL);
+ SetLastError (ERROR_GEN_FAILURE);
+ return(INVALID_HANDLE_VALUE);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_CONSOLE,
(gpointer *)&file_handle,
@@ -1533,11 +2232,16 @@ gpointer GetStdHandle(WapiStdHandle stdhandle)
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up console handle %p", handle);
- _wapi_handle_unlock_handle (handle);
- return(NULL);
+ SetLastError (ERROR_INVALID_HANDLE);
+ goto cleanup;
}
+
+ /* We know this is fd 0, 1 or 2 */
+ _wapi_handle_fd_offset_store (fd, handle);
+ ret = GINT_TO_POINTER (fd);
- file_private_handle->fd=fd;
+ file_private_handle->fd_mapped.fd=fd;
+ file_private_handle->fd_mapped.assigned=TRUE;
file_handle->filename=_wapi_handle_scratch_store (name, strlen (name));
/* some default security attributes might be needed */
file_handle->security_attributes=0;
@@ -1547,11 +2251,72 @@ gpointer GetStdHandle(WapiStdHandle stdhandle)
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": returning handle %p with fd %d",
- handle, file_private_handle->fd);
+ handle, file_private_handle->fd_mapped.fd);
+#endif
+
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
+}
+
+static void stdhandle_init (void)
+{
+ stdin_handle=stdhandle_create (0, "<stdin>");
+ stdout_handle=stdhandle_create (1, "<stdout>");
+ stderr_handle=stdhandle_create (2, "<stderr>");
+}
+
+/**
+ * GetStdHandle:
+ * @stdhandle: specifies the file descriptor
+ *
+ * Returns a handle for stdin, stdout, or stderr. Always returns the
+ * same handle for the same @stdhandle.
+ *
+ * Return value: the handle, or %INVALID_HANDLE_VALUE on error
+ */
+
+gpointer GetStdHandle(WapiStdHandle stdhandle)
+{
+ gpointer handle;
+
+ mono_once (&io_ops_once, io_ops_init);
+ mono_once (&stdhandle_once, stdhandle_init);
+
+ switch(stdhandle) {
+ case STD_INPUT_HANDLE:
+ handle=stdin_handle;
+ break;
+
+ case STD_OUTPUT_HANDLE:
+ handle=stdout_handle;
+ break;
+
+ case STD_ERROR_HANDLE:
+ handle=stderr_handle;
+ break;
+
+ default:
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": unknown standard handle type");
#endif
- _wapi_handle_unlock_handle (handle);
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return(INVALID_HANDLE_VALUE);
+ }
+ if (handle == INVALID_HANDLE_VALUE) {
+ SetLastError (ERROR_NO_MORE_FILES);
+ return(INVALID_HANDLE_VALUE);
+ }
+
+ /* Add a reference to this handle */
+ _wapi_handle_ref (_wapi_handle_fd_offset_to_handle (handle));
+
return(handle);
}
@@ -1582,12 +2347,21 @@ gpointer GetStdHandle(WapiStdHandle stdhandle)
* read due to an attempt to read past the end of the file), %FALSE on
* error.
*/
-gboolean ReadFile(gpointer handle, gpointer buffer, guint32 numbytes,
+gboolean ReadFile(gpointer fd_handle, gpointer buffer, guint32 numbytes,
guint32 *bytesread, WapiOverlapped *overlapped)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].readfile==NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1620,12 +2394,21 @@ gboolean ReadFile(gpointer handle, gpointer buffer, guint32 numbytes,
*
* Return value: %TRUE if the write succeeds, %FALSE on error.
*/
-gboolean WriteFile(gpointer handle, gconstpointer buffer, guint32 numbytes,
+gboolean WriteFile(gpointer fd_handle, gconstpointer buffer, guint32 numbytes,
guint32 *byteswritten, WapiOverlapped *overlapped)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].writefile==NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1643,11 +2426,20 @@ gboolean WriteFile(gpointer handle, gconstpointer buffer, guint32 numbytes,
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean FlushFileBuffers(gpointer handle)
+gboolean FlushFileBuffers(gpointer fd_handle)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].flushfile==NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1664,11 +2456,20 @@ gboolean FlushFileBuffers(gpointer handle)
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean SetEndOfFile(gpointer handle)
+gboolean SetEndOfFile(gpointer fd_handle)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].setendoffile==NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1704,13 +2505,22 @@ gboolean SetEndOfFile(gpointer handle)
* If @highmovedistance is not %NULL, the high 32 bits of the new file
* pointer are stored there. On failure, %INVALID_SET_FILE_POINTER.
*/
-guint32 SetFilePointer(gpointer handle, gint32 movedistance,
+guint32 SetFilePointer(gpointer fd_handle, gint32 movedistance,
gint32 *highmovedistance, WapiSeekMethod method)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(INVALID_SET_FILE_POINTER);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].seek==NULL) {
- return(FALSE);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(INVALID_SET_FILE_POINTER);
}
return(io_ops[type].seek (handle, movedistance, highmovedistance,
@@ -1728,12 +2538,21 @@ guint32 SetFilePointer(gpointer handle, gint32 movedistance,
* %FILE_TYPE_CHAR - @handle is a character device, such as a console.
* %FILE_TYPE_PIPE - @handle is a named or anonymous pipe.
*/
-WapiFileType GetFileType(gpointer handle)
+WapiFileType GetFileType(gpointer fd_handle)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FILE_TYPE_UNKNOWN);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].getfiletype==NULL) {
- return(FALSE);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FILE_TYPE_UNKNOWN);
}
return(io_ops[type].getfiletype ());
@@ -1755,12 +2574,21 @@ WapiFileType GetFileType(gpointer handle)
* @highsize is non-%NULL then the high 32 bits of the file size are
* stored here. On failure %INVALID_FILE_SIZE is returned.
*/
-guint32 GetFileSize(gpointer handle, guint32 *highsize)
+guint32 GetFileSize(gpointer fd_handle, guint32 *highsize)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(INVALID_FILE_SIZE);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].getfilesize==NULL) {
- return(FALSE);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(INVALID_FILE_SIZE);
}
return(io_ops[type].getfilesize (handle, highsize));
@@ -1791,12 +2619,21 @@ guint32 GetFileSize(gpointer handle, guint32 *highsize)
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean GetFileTime(gpointer handle, WapiFileTime *create_time,
+gboolean GetFileTime(gpointer fd_handle, WapiFileTime *create_time,
WapiFileTime *last_access, WapiFileTime *last_write)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].getfiletime==NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1827,13 +2664,22 @@ gboolean GetFileTime(gpointer handle, WapiFileTime *create_time,
*
* Return value: %TRUE on success, %FALSE otherwise.
*/
-gboolean SetFileTime(gpointer handle, const WapiFileTime *create_time,
+gboolean SetFileTime(gpointer fd_handle, const WapiFileTime *create_time,
const WapiFileTime *last_access,
const WapiFileTime *last_write)
{
- WapiHandleType type=_wapi_handle_type (handle);
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ WapiHandleType type;
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ type = _wapi_handle_type (handle);
if(io_ops[type].setfiletime==NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
@@ -1848,8 +2694,8 @@ gboolean SetFileTime(gpointer handle, const WapiFileTime *create_time,
#define TICKS_PER_MILLISECOND 10000L
#define TICKS_PER_SECOND 10000000L
#define TICKS_PER_MINUTE 600000000L
-#define TICKS_PER_HOUR 36000000000L
-#define TICKS_PER_DAY 864000000000L
+#define TICKS_PER_HOUR 36000000000LL
+#define TICKS_PER_DAY 864000000000LL
#define isleap(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
@@ -1880,6 +2726,7 @@ gboolean FileTimeToSystemTime(const WapiFileTime *file_time,
g_message(G_GNUC_PRETTY_FUNCTION ": system_time NULL");
#endif
+ SetLastError (ERROR_INVALID_PARAMETER);
return(FALSE);
}
@@ -1895,6 +2742,7 @@ gboolean FileTimeToSystemTime(const WapiFileTime *file_time,
g_message(G_GNUC_PRETTY_FUNCTION ": file_time too big");
#endif
+ SetLastError (ERROR_INVALID_PARAMETER);
return(FALSE);
}
@@ -2001,105 +2849,352 @@ gboolean FileTimeToSystemTime(const WapiFileTime *file_time,
return(TRUE);
}
+static gint
+file_compare (gconstpointer a, gconstpointer b)
+{
+ gchar *astr = *(gchar **) a;
+ gchar *bstr = *(gchar **) b;
+
+ return strcmp (astr, bstr);
+}
+
+static gint
+get_errno_from_g_file_error (gint error)
+{
+ switch (error) {
+#ifdef EACCESS
+ case G_FILE_ERROR_ACCES:
+ error = EACCES;
+ break;
+#endif
+#ifdef ENAMETOOLONG
+ case G_FILE_ERROR_NAMETOOLONG:
+ error = ENAMETOOLONG;
+ break;
+#endif
+#ifdef ENOENT
+ case G_FILE_ERROR_NOENT:
+ error = ENOENT;
+ break;
+#endif
+#ifdef ENOTDIR
+ case G_FILE_ERROR_NOTDIR:
+ error = ENOTDIR;
+ break;
+#endif
+#ifdef ENXIO
+ case G_FILE_ERROR_NXIO:
+ error = ENXIO;
+ break;
+#endif
+#ifdef ENODEV
+ case G_FILE_ERROR_NODEV:
+ error = ENODEV;
+ break;
+#endif
+#ifdef EROFS
+ case G_FILE_ERROR_ROFS:
+ error = EROFS;
+ break;
+#endif
+#ifdef ETXTBSY
+ case G_FILE_ERROR_TXTBSY:
+ error = ETXTBSY;
+ break;
+#endif
+#ifdef EFAULT
+ case G_FILE_ERROR_FAULT:
+ error = EFAULT;
+ break;
+#endif
+#ifdef ELOOP
+ case G_FILE_ERROR_LOOP:
+ error = ELOOP;
+ break;
+#endif
+#ifdef ENOSPC
+ case G_FILE_ERROR_NOSPC:
+ error = ENOSPC;
+ break;
+#endif
+#ifdef ENOMEM
+ case G_FILE_ERROR_NOMEM:
+ error = ENOMEM;
+ break;
+#endif
+#ifdef EMFILE
+ case G_FILE_ERROR_MFILE:
+ error = EMFILE;
+ break;
+#endif
+#ifdef ENFILE
+ case G_FILE_ERROR_NFILE:
+ error = ENFILE;
+ break;
+#endif
+#ifdef EBADF
+ case G_FILE_ERROR_BADF:
+ error = EBADF;
+ break;
+#endif
+#ifdef EINVAL
+ case G_FILE_ERROR_INVAL:
+ error = EINVAL;
+ break;
+#endif
+#ifdef EPIPE
+ case G_FILE_ERROR_PIPE:
+ error = EPIPE;
+ break;
+#endif
+#ifdef EAGAIN
+ case G_FILE_ERROR_AGAIN:
+ error = EAGAIN;
+ break;
+#endif
+#ifdef EINTR
+ case G_FILE_ERROR_INTR:
+ error = EINTR;
+ break;
+#endif
+#ifdef EWIO
+ case G_FILE_ERROR_IO:
+ error = EIO;
+ break;
+#endif
+#ifdef EPERM
+ case G_FILE_ERROR_PERM:
+ error = EPERM;
+ break;
+#endif
+ case G_FILE_ERROR_FAILED:
+ error = ERROR_INVALID_PARAMETER;
+ break;
+ }
+
+ return error;
+}
+
+/* scandir using glib */
+static gint
+mono_io_scandir (const gchar *dirname, const gchar *pattern, gchar ***namelist)
+{
+ GError *error = NULL;
+ GDir *dir;
+ GPtrArray *names;
+ const gchar *name;
+ gint result;
+ GPatternSpec *patspec;
+
+ dir = g_dir_open (dirname, 0, &error);
+ if (dir == NULL) {
+ /* g_dir_open returns ENOENT on directories on which we don't
+ * have read/x permission */
+ gint errnum = get_errno_from_g_file_error (error->code);
+ g_error_free (error);
+ if (errnum == ENOENT && g_file_test (dirname, G_FILE_TEST_IS_DIR))
+ errnum = EACCES;
+
+ errno = errnum;
+ return -1;
+ }
+
+ patspec = g_pattern_spec_new (pattern);
+ names = g_ptr_array_new ();
+ while ((name = g_dir_read_name (dir)) != NULL) {
+ if (g_pattern_match_string (patspec, name))
+ g_ptr_array_add (names, g_strdup (name));
+ }
+
+ g_pattern_spec_free (patspec);
+ g_dir_close (dir);
+ result = names->len;
+ if (result > 0) {
+ g_ptr_array_sort (names, file_compare);
+ g_ptr_array_set_size (names, result + 1);
+
+ *namelist = (gchar **) g_ptr_array_free (names, FALSE);
+ } else {
+ g_ptr_array_free (names, TRUE);
+ }
+
+ return result;
+}
+
gpointer FindFirstFile (const gunichar2 *pattern, WapiFindData *find_data)
{
- struct _WapiHandle_find *find_handle;
- gpointer handle;
+ struct _WapiHandlePrivate_find *find_handle;
+ gpointer handle, find_ret = INVALID_HANDLE_VALUE;
gboolean ok;
- gchar *utf8_pattern = NULL;
+ gchar *utf8_pattern = NULL, *dir_part, *entry_part;
int result;
+ int thr_ret;
+ gboolean unref = FALSE;
if (pattern == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": pattern is NULL");
#endif
- return INVALID_HANDLE_VALUE;
+ SetLastError (ERROR_PATH_NOT_FOUND);
+ return(INVALID_HANDLE_VALUE);
}
- utf8_pattern = _wapi_unicode_to_utf8 (pattern);
+ utf8_pattern = mono_unicode_to_external (pattern);
if (utf8_pattern == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
#endif
- return INVALID_HANDLE_VALUE;
+ SetLastError (ERROR_INVALID_NAME);
+ return(INVALID_HANDLE_VALUE);
}
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": looking for [%s]",
+ utf8_pattern);
+#endif
+
+ /* Figure out which bit of the pattern is the directory */
+ dir_part=g_path_get_dirname (utf8_pattern);
+ entry_part=g_path_get_basename (utf8_pattern);
+
+#if 0
+ /* Don't do this check for now, it breaks if directories
+ * really do have metachars in their names (see bug 58116).
+ * FIXME: Figure out a better solution to keep some checks...
+ */
+ if (strchr (dir_part, '*') || strchr (dir_part, '?')) {
+ SetLastError (ERROR_INVALID_NAME);
+ g_free (dir_part);
+ g_free (entry_part);
+ g_free (utf8_pattern);
+ return(INVALID_HANDLE_VALUE);
+ }
+#endif
handle=_wapi_handle_new (WAPI_HANDLE_FIND);
if(handle==_WAPI_HANDLE_INVALID) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error creating find handle");
+ g_warning (G_GNUC_PRETTY_FUNCTION ": error creating find handle");
+ g_free (dir_part);
+ g_free (entry_part);
g_free (utf8_pattern);
+ SetLastError (ERROR_GEN_FAILURE);
return(INVALID_HANDLE_VALUE);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FIND,
- (gpointer *)&find_handle, NULL);
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FIND, NULL,
+ (gpointer *)&find_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up find handle %p", handle);
- _wapi_handle_unlock_handle (handle);
+ g_free (dir_part);
+ dir_part = NULL;
+ g_free (entry_part);
+ entry_part = NULL;
g_free (utf8_pattern);
-
- return(INVALID_HANDLE_VALUE);
- }
-
- result = glob (utf8_pattern, 0, NULL, &find_handle->glob);
- g_free (utf8_pattern);
-
- if (result != 0) {
- globfree (&find_handle->glob);
- _wapi_handle_unlock_handle (handle);
- _wapi_handle_unref (handle);
+ utf8_pattern = NULL;
+ SetLastError (ERROR_INVALID_HANDLE);
+ goto cleanup;
+ }
+
+ /* The pattern can specify a directory or a set of files.
+ *
+ * The pattern can have wildcard characters ? and *, but only
+ * in the section after the last directory delimiter. (Return
+ * ERROR_INVALID_NAME if there are wildcards in earlier path
+ * sections.) "*" has the usual 0-or-more chars meaning. "?"
+ * means "match one character", "??" seems to mean "match one
+ * or two characters", "???" seems to mean "match one, two or
+ * three characters", etc. Windows will also try and match
+ * the mangled "short name" of files, so 8 character patterns
+ * with wildcards will show some surprising results.
+ *
+ * All the written documentation I can find says that '?'
+ * should only match one character, and doesn't mention '??',
+ * '???' etc. I'm going to assume that the strict behaviour
+ * (ie '???' means three and only three characters) is the
+ * correct one, because that lets me use fnmatch(3) rather
+ * than mess around with regexes.
+ */
- switch (result) {
-#ifdef GLOB_NOMATCH
- case GLOB_NOMATCH:
- SetLastError (ERROR_NO_MORE_FILES);
- break;
+ find_handle->namelist = NULL;
+ result = mono_io_scandir (dir_part, entry_part, &find_handle->namelist);
+
+ if (result < 0) {
+#ifdef DEBUG
+ gint errnum = errno;
#endif
+ _wapi_set_last_error_from_errno ();
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": scandir error: %s", g_strerror (errnum));
+#endif
+ g_free (utf8_pattern);
+ g_free (entry_part);
+ g_free (dir_part);
+ unref = TRUE;
+ goto cleanup;
+ }
- default:
+ g_free (utf8_pattern);
+ g_free (entry_part);
+
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": glob failed with code %d.", result);
+ g_message (G_GNUC_PRETTY_FUNCTION ": Got %d matches", result);
#endif
- break;
- }
+ find_handle->dir_part = dir_part;
+ find_handle->num = result;
+ find_handle->count = 0;
- return INVALID_HANDLE_VALUE;
- }
+ find_ret = handle;
- find_handle->count = 0;
- if (!FindNextFile (handle, find_data)) {
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ /* FindNextFile has to be called after unlocking the handle,
+ * because it wants to lock the handle itself
+ */
+ if (find_ret != INVALID_HANDLE_VALUE &&
+ !FindNextFile (handle, find_data)) {
FindClose (handle);
SetLastError (ERROR_NO_MORE_FILES);
- return INVALID_HANDLE_VALUE;
+ find_ret = INVALID_HANDLE_VALUE;
}
- _wapi_handle_unlock_handle (handle);
-
- return (handle);
+ /* Must not call _wapi_handle_unref() with the handle already
+ * locked
+ */
+ if (unref) {
+ _wapi_handle_unref (handle);
+ }
+
+ return (find_ret);
}
gboolean FindNextFile (gpointer handle, WapiFindData *find_data)
{
- struct _WapiHandle_find *find_handle;
+ struct _WapiHandlePrivate_find *find_handle;
gboolean ok;
struct stat buf;
- const gchar *filename;
-
- gchar *base_filename;
+ gchar *filename;
+ gchar *utf8_filename, *utf8_basename;
gunichar2 *utf16_basename;
time_t create_time;
- int i;
+ glong bytes;
+ int thr_ret;
+ gboolean ret = FALSE;
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FIND,
- (gpointer *)&find_handle, NULL);
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FIND, NULL,
+ (gpointer *)&find_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up find handle %p", handle);
@@ -2107,23 +3202,56 @@ gboolean FindNextFile (gpointer handle, WapiFindData *find_data)
return(FALSE);
}
- if (find_handle->count >= find_handle->glob.gl_pathc) {
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
+
+retry:
+ if (find_handle->count >= find_handle->num) {
SetLastError (ERROR_NO_MORE_FILES);
- return FALSE;
+ goto cleanup;
}
- /* stat next glob match */
+ /* stat next match */
- filename = find_handle->glob.gl_pathv [find_handle->count ++];
- if (stat (filename, &buf) != 0) {
+ filename = g_build_filename (find_handle->dir_part, find_handle->namelist[find_handle->count ++], NULL);
+ if (lstat (filename, &buf) != 0) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": stat failed: %s", filename);
#endif
- SetLastError (ERROR_NO_MORE_FILES);
- return FALSE;
+ g_free (filename);
+ goto retry;
}
+ /* Check for dangling symlinks, and ignore them (principle of
+ * least surprise, avoiding confusion where we report the file
+ * exists, but when someone tries to open it we would report
+ * it isn't there.)
+ */
+ if(S_ISLNK (buf.st_mode)) {
+ if(stat (filename, &buf) != 0) {
+ g_free (filename);
+ goto retry;
+ }
+ }
+
+ utf8_filename=mono_utf8_from_external (filename);
+ if(utf8_filename==NULL) {
+ /* We couldn't turn this filename into utf8 (eg the
+ * encoding of the name wasn't convertible), so just
+ * ignore it.
+ */
+ g_free (filename);
+ goto retry;
+ }
+ g_free (filename);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Found [%s]", utf8_filename);
+#endif
+
/* fill data block */
if (buf.st_mtime < buf.st_ctime)
@@ -2149,21 +3277,39 @@ gboolean FindNextFile (gpointer handle, WapiFindData *find_data)
find_data->dwReserved0 = 0;
find_data->dwReserved1 = 0;
- base_filename = g_path_get_basename (filename);
- utf16_basename = g_utf8_to_utf16 (base_filename, MAX_PATH, NULL, NULL, NULL);
-
- i = 0;
- while (utf16_basename [i] != 0) { /* copy basename */
- find_data->cFileName [i] = utf16_basename [i];
- ++ i;
+ utf8_basename = g_path_get_basename (utf8_filename);
+ utf16_basename = g_utf8_to_utf16 (utf8_basename, -1, NULL, &bytes,
+ NULL);
+ if(utf16_basename==NULL) {
+ g_free (utf8_basename);
+ g_free (utf8_filename);
+ goto retry;
}
+ ret = TRUE;
+
+ /* utf16 is 2 * utf8 */
+ bytes *= 2;
+
+ memset (find_data->cFileName, '\0', (MAX_PATH*2));
+
+ /* Truncating a utf16 string like this might leave the last
+ * char incomplete
+ */
+ memcpy (find_data->cFileName, utf16_basename,
+ bytes<(MAX_PATH*2)-2?bytes:(MAX_PATH*2)-2);
- find_data->cFileName[i] = 0; /* null terminate */
find_data->cAlternateFileName [0] = 0; /* not used */
- g_free (base_filename);
+ g_free (utf8_basename);
+ g_free (utf8_filename);
g_free (utf16_basename);
- return TRUE;
+
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
}
/**
@@ -2176,22 +3322,34 @@ gboolean FindNextFile (gpointer handle, WapiFindData *find_data)
*/
gboolean FindClose (gpointer handle)
{
- struct _WapiHandle_find *find_handle;
+ struct _WapiHandlePrivate_find *find_handle;
gboolean ok;
-
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FIND,
- (gpointer *)&find_handle, NULL);
+ int thr_ret;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FIND, NULL,
+ (gpointer *)&find_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up find handle %p", handle);
SetLastError (ERROR_INVALID_HANDLE);
return(FALSE);
}
+
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
- globfree (&find_handle->glob);
- _wapi_handle_unref (handle);
+ g_strfreev (find_handle->namelist);
+ g_free (find_handle->dir_part);
- return TRUE;
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ _wapi_handle_unref (handle);
+
+ return(TRUE);
}
/**
@@ -2208,30 +3366,55 @@ gboolean CreateDirectory (const gunichar2 *name, WapiSecurityAttributes *securit
{
gchar *utf8_name;
int result;
+ struct stat buf;
+ guint32 attrs;
- utf8_name = _wapi_unicode_to_utf8 (name);
+ if (name == NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
+
+ utf8_name = mono_unicode_to_external (name);
if (utf8_name == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
#endif
+ SetLastError (ERROR_INVALID_NAME);
return FALSE;
}
result = mkdir (utf8_name, 0777);
- g_free (utf8_name);
- if (result == 0)
+ if (result == 0) {
+ g_free (utf8_name);
return TRUE;
+ }
- switch (errno) {
- case EEXIST:
- return TRUE;
- default:
+ if (errno == EEXIST) {
+ result = stat (utf8_name, &buf);
+ if (result == -1) {
+ _wapi_set_last_error_from_errno ();
+ g_free (utf8_name);
+ return FALSE;
+ }
+
+ g_free (utf8_name);
+ attrs = _wapi_stat_to_file_attributes (&buf);
+ if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
+ return TRUE;
+
+ errno = EEXIST;
_wapi_set_last_error_from_errno ();
- break;
+ return FALSE;
}
-
+
+ _wapi_set_last_error_from_errno ();
+ g_free (utf8_name);
return FALSE;
}
@@ -2248,13 +3431,23 @@ gboolean RemoveDirectory (const gunichar2 *name)
{
gchar *utf8_name;
int result;
+
+ if (name == NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
- utf8_name = _wapi_unicode_to_utf8 (name);
+ utf8_name = mono_unicode_to_external (name);
if (utf8_name == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
#endif
+ SetLastError (ERROR_INVALID_NAME);
return FALSE;
}
@@ -2274,7 +3467,7 @@ gboolean RemoveDirectory (const gunichar2 *name)
*
* Gets the attributes for @name;
*
- * Return value: -1 on failure
+ * Return value: %INVALID_FILE_ATTRIBUTES on failure
*/
guint32 GetFileAttributes (const gunichar2 *name)
{
@@ -2282,24 +3475,34 @@ guint32 GetFileAttributes (const gunichar2 *name)
struct stat buf;
int result;
- utf8_name = _wapi_unicode_to_utf8 (name);
+ if (name == NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
+
+ utf8_name = mono_unicode_to_external (name);
if (utf8_name == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
#endif
SetLastError (ERROR_INVALID_PARAMETER);
- return -1;
+ return (INVALID_FILE_ATTRIBUTES);
}
result = stat (utf8_name, &buf);
- g_free (utf8_name);
if (result != 0) {
- SetLastError (ERROR_FILE_NOT_FOUND);
- return -1;
+ _wapi_set_last_error_from_errno ();
+ g_free (utf8_name);
+ return (INVALID_FILE_ATTRIBUTES);
}
+ g_free (utf8_name);
return _wapi_stat_to_file_attributes (&buf);
}
@@ -2327,10 +3530,20 @@ gboolean GetFileAttributesEx (const gunichar2 *name, WapiGetFileExInfoLevels lev
g_message (G_GNUC_PRETTY_FUNCTION ": info level %d not supported.", level);
#endif
+ SetLastError (ERROR_INVALID_PARAMETER);
return FALSE;
}
+
+ if (name == NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
- utf8_name = _wapi_unicode_to_utf8 (name);
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
+
+ utf8_name = mono_unicode_to_external (name);
if (utf8_name == NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
@@ -2387,9 +3600,74 @@ gboolean GetFileAttributesEx (const gunichar2 *name, WapiGetFileExInfoLevels lev
extern gboolean SetFileAttributes (const gunichar2 *name, guint32 attrs)
{
/* FIXME: think of something clever to do on unix */
+ gchar *utf8_name;
+ struct stat buf;
+ int result;
+
+ /*
+ * Currently we only handle one *internal* case, with a value that is
+ * not standard: 0x80000000, which means `set executable bit'
+ */
- SetLastError (ERROR_INVALID_FUNCTION);
- return FALSE;
+ if (name == NULL) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": name is NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_NAME);
+ return(FALSE);
+ }
+
+ utf8_name = mono_unicode_to_external (name);
+ if (utf8_name == NULL) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": unicode conversion returned NULL");
+#endif
+
+ SetLastError (ERROR_INVALID_NAME);
+ return FALSE;
+ }
+
+ result = stat (utf8_name, &buf);
+ if (result != 0) {
+ g_free (utf8_name);
+ SetLastError (ERROR_FILE_NOT_FOUND);
+ return FALSE;
+ }
+
+ /* Contrary to the documentation, ms allows NORMAL to be
+ * specified along with other attributes, so dont bother to
+ * catch that case here.
+ */
+ if (attrs & FILE_ATTRIBUTE_READONLY) {
+ result = chmod (utf8_name, buf.st_mode & ~(S_IWRITE | S_IWOTH | S_IWGRP));
+ } else {
+ result = chmod (utf8_name, buf.st_mode | S_IWRITE);
+ }
+
+ /* Ignore the other attributes for now */
+
+ if (attrs & 0x80000000){
+ mode_t exec_mask = 0;
+
+ if ((buf.st_mode & S_IRUSR) != 0)
+ exec_mask |= S_IXUSR;
+
+ if ((buf.st_mode & S_IRGRP) != 0)
+ exec_mask |= S_IXGRP;
+
+ if ((buf.st_mode & S_IROTH) != 0)
+ exec_mask |= S_IXOTH;
+
+ result = chmod (utf8_name, buf.st_mode | exec_mask);
+ }
+ /* Don't bother to reset executable (might need to change this
+ * policy)
+ */
+
+ g_free (utf8_name);
+
+ return(TRUE);
}
/**
@@ -2404,30 +3682,31 @@ extern gboolean SetFileAttributes (const gunichar2 *name, guint32 attrs)
extern guint32 GetCurrentDirectory (guint32 length, gunichar2 *buffer)
{
gchar *path;
- gunichar2 *utf16_path, *ptr;
- glong count = 0;
+ gunichar2 *utf16_path;
+ glong count;
+ gsize bytes;
path = g_get_current_dir ();
if (path == NULL)
return 0;
+
+ utf16_path=mono_unicode_from_external (path, &bytes);
/* if buffer too small, return number of characters required.
* this is plain dumb.
*/
- count = strlen (path) + 1;
- if (count > length)
- return count;
-
- utf16_path = g_utf8_to_utf16 (path, -1, NULL, NULL, NULL);
- if (utf16_path == NULL)
- return 0;
+ count = (bytes/2)+1;
+ if (count > length) {
+ g_free(path);
+ g_free (utf16_path);
+
+ return (count);
+ }
- ptr = utf16_path;
- while (*ptr)
- *buffer ++ = *ptr ++;
-
- *buffer = 0;
+ /* Add the terminator */
+ memset (buffer, '\0', bytes+2);
+ memcpy (buffer, utf16_path, bytes);
g_free (utf16_path);
g_free (path);
@@ -2448,7 +3727,7 @@ extern gboolean SetCurrentDirectory (const gunichar2 *path)
gchar *utf8_path;
gboolean result;
- utf8_path = _wapi_unicode_to_utf8 (path);
+ utf8_path = mono_unicode_to_external (path);
if (chdir (utf8_path) != 0) {
_wapi_set_last_error_from_errno ();
result = FALSE;
@@ -2459,3 +3738,562 @@ extern gboolean SetCurrentDirectory (const gunichar2 *path)
g_free (utf8_path);
return result;
}
+
+/* When we're confident there are no more bugs in the fd->handle
+ * mapping, this can be replaced as a no-op: GPOINTER_TO_INT(fd_handle) == fd
+ */
+int _wapi_file_handle_to_fd (gpointer fd_handle)
+{
+ struct _WapiHandlePrivate_file *file_private_handle;
+ gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": looking up fd for %p", handle);
+#endif
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_CONSOLE, NULL,
+ (gpointer *)&file_private_handle);
+ if(ok==FALSE) {
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_FILE, NULL,
+ (gpointer *)&file_private_handle);
+ if(ok==FALSE) {
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_PIPE, NULL,
+ (gpointer *)&file_private_handle);
+ if(ok==FALSE) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": returning -1");
+#endif
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(-1);
+ }
+ }
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(-1);
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": returning %d",
+ file_private_handle->fd_mapped.fd);
+#endif
+
+ g_assert (file_private_handle->fd_mapped.fd == GPOINTER_TO_INT (fd_handle));
+
+ return(file_private_handle->fd_mapped.fd);
+}
+
+gboolean CreatePipe (gpointer *readpipe, gpointer *writepipe,
+ WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 size)
+{
+ struct _WapiHandle_file *pipe_read_handle;
+ struct _WapiHandle_file *pipe_write_handle;
+ struct _WapiHandlePrivate_file *pipe_read_private_handle;
+ struct _WapiHandlePrivate_file *pipe_write_private_handle;
+ gpointer read_handle;
+ gpointer write_handle;
+ gboolean ok;
+ int filedes[2];
+ int ret;
+ int thr_ret;
+ gboolean unref_read = FALSE, unref_write = FALSE;
+ gboolean cp_ret = FALSE;
+
+ mono_once (&io_ops_once, io_ops_init);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Creating pipe");
+#endif
+
+ ret=pipe (filedes);
+ if(ret==-1) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Error creating pipe: %s",
+ strerror (errno));
+#endif
+
+ _wapi_set_last_error_from_errno ();
+ return(FALSE);
+ }
+
+ if (filedes[0] >= _wapi_fd_offset_table_size ||
+ filedes[1] >= _wapi_fd_offset_table_size) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
+#endif
+
+ SetLastError (ERROR_TOO_MANY_OPEN_FILES);
+
+ close (filedes[0]);
+ close (filedes[1]);
+
+ return(FALSE);
+ }
+
+ /* filedes[0] is open for reading, filedes[1] for writing */
+
+ read_handle=_wapi_handle_new (WAPI_HANDLE_PIPE);
+ if(read_handle==_WAPI_HANDLE_INVALID) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error creating pipe read handle");
+ close (filedes[0]);
+ close (filedes[1]);
+ SetLastError (ERROR_GEN_FAILURE);
+
+ return(FALSE);
+ }
+
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ read_handle);
+ thr_ret = _wapi_handle_lock_handle (read_handle);
+ g_assert (thr_ret == 0);
+
+ ok=_wapi_lookup_handle (read_handle, WAPI_HANDLE_PIPE,
+ (gpointer *)&pipe_read_handle,
+ (gpointer *)&pipe_read_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION ": error looking up pipe handle %p", read_handle);
+ close (filedes[0]);
+ close (filedes[1]);
+ SetLastError (ERROR_INVALID_HANDLE);
+ goto cleanup;
+ }
+
+ write_handle=_wapi_handle_new (WAPI_HANDLE_PIPE);
+ if(write_handle==_WAPI_HANDLE_INVALID) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error creating pipe write handle");
+ unref_read = TRUE;
+
+ close (filedes[0]);
+ close (filedes[1]);
+ SetLastError (ERROR_GEN_FAILURE);
+
+ goto cleanup;
+ }
+
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ write_handle);
+ thr_ret = _wapi_handle_lock_handle (write_handle);
+ g_assert (thr_ret == 0);
+
+ ok=_wapi_lookup_handle (write_handle, WAPI_HANDLE_PIPE,
+ (gpointer *)&pipe_write_handle,
+ (gpointer *)&pipe_write_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION ": error looking up pipe handle %p", read_handle);
+ unref_read = TRUE;
+ unref_write = TRUE;
+
+ close (filedes[0]);
+ close (filedes[1]);
+ SetLastError (ERROR_INVALID_HANDLE);
+ goto write_cleanup;
+ }
+ cp_ret = TRUE;
+
+ pipe_read_private_handle->fd_mapped.fd=filedes[0];
+ pipe_read_private_handle->fd_mapped.assigned=TRUE;
+ pipe_read_handle->fileaccess=GENERIC_READ;
+
+ _wapi_handle_fd_offset_store (filedes[0], read_handle);
+ *readpipe=GINT_TO_POINTER (filedes[0]);
+
+ pipe_write_private_handle->fd_mapped.fd=filedes[1];
+ pipe_write_private_handle->fd_mapped.assigned=TRUE;
+ pipe_write_handle->fileaccess=GENERIC_WRITE;
+
+ _wapi_handle_fd_offset_store (filedes[1], write_handle);
+ *writepipe=GINT_TO_POINTER (filedes[1]);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Returning pipe: read handle %p (fd %d), write handle %p (fd %d)", read_handle, filedes[0], write_handle, filedes[1]);
+#endif
+
+write_cleanup:
+ thr_ret =_wapi_handle_unlock_handle (write_handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ if (unref_write) {
+ _wapi_handle_unref (write_handle);
+ }
+
+cleanup:
+ thr_ret =_wapi_handle_unlock_handle (read_handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ /* Must not call _wapi_handle_unref() with the handle already
+ * locked
+ */
+ if (unref_read) {
+ _wapi_handle_unref (read_handle);
+ }
+
+ return(cp_ret);
+}
+
+guint32 GetTempPath (guint32 len, gunichar2 *buf)
+{
+ gchar *tmpdir=g_strdup (g_get_tmp_dir ());
+ gunichar2 *tmpdir16=NULL;
+ glong dirlen;
+ gsize bytes;
+ guint32 ret;
+
+ if(tmpdir[strlen (tmpdir)]!='/') {
+ g_free (tmpdir);
+ tmpdir=g_strdup_printf ("%s/", g_get_tmp_dir ());
+ }
+
+ tmpdir16=mono_unicode_from_external (tmpdir, &bytes);
+ if(tmpdir16==NULL) {
+ g_free (tmpdir);
+ return(0);
+ } else {
+ dirlen=(bytes/2);
+
+ if(dirlen+1>len) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Size %d smaller than needed (%ld)", len,
+ dirlen+1);
+#endif
+
+ ret=dirlen+1;
+ } else {
+ /* Add the terminator */
+ memset (buf, '\0', bytes+2);
+ memcpy (buf, tmpdir16, bytes);
+
+ ret=dirlen;
+ }
+ }
+
+ if(tmpdir16!=NULL) {
+ g_free (tmpdir16);
+ }
+ g_free (tmpdir);
+
+ return(ret);
+}
+
+gboolean
+_wapi_io_add_callback (gpointer fd_handle,
+ WapiOverlappedCB callback,
+ guint64 flags G_GNUC_UNUSED)
+{
+ struct _WapiHandle_file *file_handle;
+ struct _WapiHandlePrivate_file *file_private_handle;
+ gboolean ok;
+ int thr_ret;
+ gboolean ret = FALSE;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
+ (gpointer *) &file_handle,
+ (gpointer *) &file_private_handle);
+
+ if (ok == FALSE) {
+ ok = _wapi_lookup_handle (handle, WAPI_HANDLE_PIPE,
+ (gpointer *) &file_handle,
+ (gpointer *) &file_private_handle);
+
+ }
+
+ if (ok == FALSE || file_private_handle->async == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
+
+ if (file_private_handle->callback != NULL) {
+ SetLastError (ERROR_INVALID_PARAMETER);
+ goto cleanup;
+ }
+ ret = TRUE;
+
+ file_private_handle->callback = callback;
+
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
+}
+
+gint32
+GetLogicalDriveStrings (guint32 len, gunichar2 *buf)
+{
+ FILE *fp;
+ gunichar2 *ptr, *dir;
+ glong length, total = 0;
+ gchar buffer [512];
+ gchar **splitted;
+
+ memset (buf, 0, sizeof (gunichar2) * (len + 1));
+ buf [0] = '/';
+ buf [1] = 0;
+ buf [2] = 0;
+
+ /* Sigh, mntent and friends don't work well.
+ * It stops on the first line that doesn't begin with a '/'.
+ * (linux 2.6.5, libc 2.3.2.ds1-12) - Gonz */
+ fp = fopen ("/etc/mtab", "rt");
+ if (fp == NULL) {
+ fp = fopen ("/etc/mnttab", "rt");
+ if (fp == NULL)
+ return 1;
+ }
+
+ ptr = buf;
+ while (fgets (buffer, 512, fp) != NULL) {
+ if (*buffer != '/')
+ continue;
+
+ splitted = g_strsplit (buffer, " ", 0);
+ if (!*splitted || !*(splitted + 1))
+ continue;
+
+ dir = g_utf8_to_utf16 (*(splitted + 1), -1, &length, NULL, NULL);
+ g_strfreev (splitted);
+ if (total + length + 1 > len) {
+ return len * 2; /* guess */
+ }
+
+ memcpy (ptr + total, dir, sizeof (gunichar2) * length);
+ g_free (dir);
+ total += length + 1;
+ }
+
+ fclose (fp);
+ return total;
+/* Commented out, does not work with my mtab!!! - Gonz */
+#ifdef NOTENABLED /* HAVE_MNTENT_H */
+{
+ FILE *fp;
+ struct mntent *mnt;
+ gunichar2 *ptr, *dir;
+ glong len, total = 0;
+
+
+ fp = setmntent ("/etc/mtab", "rt");
+ if (fp == NULL) {
+ fp = setmntent ("/etc/mnttab", "rt");
+ if (fp == NULL)
+ return;
+ }
+
+ ptr = buf;
+ while ((mnt = getmntent (fp)) != NULL) {
+ g_print ("GOT %s\n", mnt->mnt_dir);
+ dir = g_utf8_to_utf16 (mnt->mnt_dir, &len, NULL, NULL, NULL);
+ if (total + len + 1 > len) {
+ return len * 2; /* guess */
+ }
+
+ memcpy (ptr + total, dir, sizeof (gunichar2) * len);
+ g_free (dir);
+ total += len + 1;
+ }
+
+ endmntent (fp);
+ return total;
+}
+#endif
+}
+
+static gboolean _wapi_lock_file_region (int fd, off_t offset, off_t length)
+{
+ struct flock lock_data;
+ int ret;
+
+ lock_data.l_type = F_WRLCK;
+ lock_data.l_whence = SEEK_SET;
+ lock_data.l_start = offset;
+ lock_data.l_len = length;
+
+ do {
+ ret = fcntl (fd, F_SETLK, &lock_data);
+ }
+ while(ret == -1 && errno == EINTR && !_wapi_thread_cur_apc_pending ());
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": fcntl returns %d", ret);
+#endif
+
+ if (ret == -1) {
+ SetLastError (ERROR_LOCK_VIOLATION);
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
+
+static gboolean _wapi_unlock_file_region (int fd, off_t offset, off_t length)
+{
+ struct flock lock_data;
+ int ret;
+
+ lock_data.l_type = F_UNLCK;
+ lock_data.l_whence = SEEK_SET;
+ lock_data.l_start = offset;
+ lock_data.l_len = length;
+
+ do {
+ ret = fcntl (fd, F_SETLK, &lock_data);
+ }
+ while(ret == -1 && errno == EINTR && !_wapi_thread_cur_apc_pending ());
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": fcntl returns %d", ret);
+#endif
+
+ if (ret == -1) {
+ SetLastError (ERROR_LOCK_VIOLATION);
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
+
+gboolean LockFile (gpointer fd_handle, guint32 offset_low, guint32 offset_high,
+ guint32 length_low, guint32 length_high)
+{
+ struct _WapiHandle_file *file_handle;
+ struct _WapiHandlePrivate_file *file_private_handle;
+ gboolean ok;
+ off_t offset, length;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
+ (gpointer *)&file_handle,
+ (gpointer *)&file_private_handle);
+ if (ok == FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (!(file_handle->fileaccess & GENERIC_READ) &&
+ !(file_handle->fileaccess & GENERIC_WRITE) &&
+ !(file_handle->fileaccess & GENERIC_ALL)) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
+#endif
+ SetLastError (ERROR_ACCESS_DENIED);
+ return(FALSE);
+ }
+
+#ifdef HAVE_LARGE_FILE_SUPPORT
+ offset = ((gint64)offset_high << 32) | offset_low;
+ length = ((gint64)length_high << 32) | length_low;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Locking handle %p fd %d, offset %lld, length %lld",
+ handle, file_private_handle->fd_mapped.fd, offset, length);
+#endif
+#else
+ offset = offset_low;
+ length = length_low;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Locking handle %p fd %d, offset %ld, length %ld",
+ handle, file_private_handle->fd_mapped.fd, offset, length);
+#endif
+#endif
+
+ return(_wapi_lock_file_region (file_private_handle->fd_mapped.fd,
+ offset, length));
+}
+
+gboolean UnlockFile (gpointer fd_handle, guint32 offset_low,
+ guint32 offset_high, guint32 length_low,
+ guint32 length_high)
+{
+ struct _WapiHandle_file *file_handle;
+ struct _WapiHandlePrivate_file *file_private_handle;
+ gboolean ok;
+ off_t offset, length;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+
+ if (handle == NULL) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ ok = _wapi_lookup_handle (handle, WAPI_HANDLE_FILE,
+ (gpointer *)&file_handle,
+ (gpointer *)&file_private_handle);
+ if (ok == FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up file handle %p", handle);
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (file_private_handle->fd_mapped.assigned == FALSE) {
+ SetLastError (ERROR_INVALID_HANDLE);
+ return(FALSE);
+ }
+
+ if (!(file_handle->fileaccess & GENERIC_READ) &&
+ !(file_handle->fileaccess & GENERIC_WRITE) &&
+ !(file_handle->fileaccess & GENERIC_ALL)) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": handle %p fd %d doesn't have GENERIC_READ or GENERIC_WRITE access: %u", handle, file_private_handle->fd_mapped.fd, file_handle->fileaccess);
+#endif
+ SetLastError (ERROR_ACCESS_DENIED);
+ return(FALSE);
+ }
+
+#ifdef HAVE_LARGE_FILE_SUPPORT
+ offset = ((gint64)offset_high << 32) | offset_low;
+ length = ((gint64)length_high << 32) | length_low;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Unlocking handle %p fd %d, offset %lld, length %lld",
+ handle, file_private_handle->fd_mapped.fd, offset, length);
+#endif
+#else
+ offset = offset_low;
+ length = length_low;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Unlocking handle %p fd %d, offset %ld, length %ld",
+ handle, file_private_handle->fd_mapped.fd, offset, length);
+#endif
+#endif
+
+ return(_wapi_unlock_file_region (file_private_handle->fd_mapped.fd,
+ offset, length));
+}
diff --git a/mono/io-layer/io.h b/mono/io-layer/io.h
index 017e3f7acf0..a9b68208f4d 100644
--- a/mono/io-layer/io.h
+++ b/mono/io-layer/io.h
@@ -33,8 +33,13 @@ struct _WapiOverlapped
guint32 Offset;
guint32 OffsetHigh;
gpointer hEvent;
+ gpointer handle1;
+ gpointer handle2;
};
+typedef void (*WapiOverlappedCB) (guint32 error, guint32 numbytes,
+ WapiOverlapped *overlapped);
+
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define GENERIC_EXECUTE 0x20000000
@@ -80,13 +85,13 @@ struct _WapiOverlapped
typedef enum {
STD_INPUT_HANDLE=-10,
STD_OUTPUT_HANDLE=-11,
- STD_ERROR_HANDLE=-12,
+ STD_ERROR_HANDLE=-12
} WapiStdHandle;
typedef enum {
FILE_BEGIN=0,
FILE_CURRENT=1,
- FILE_END=2,
+ FILE_END=2
} WapiSeekMethod;
typedef enum {
@@ -94,7 +99,7 @@ typedef enum {
FILE_TYPE_DISK=0x0001,
FILE_TYPE_CHAR=0x0002,
FILE_TYPE_PIPE=0x0003,
- FILE_TYPE_REMOTE=0x8000,
+ FILE_TYPE_REMOTE=0x8000
} WapiFileType;
typedef enum {
@@ -140,6 +145,7 @@ typedef struct
#define INVALID_SET_FILE_POINTER ((guint32)-1)
#define INVALID_FILE_SIZE ((guint32)0xFFFFFFFF)
+#define INVALID_FILE_ATTRIBUTES ((guint32)-1)
extern gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
guint32 sharemode,
@@ -184,5 +190,15 @@ extern gboolean GetFileAttributesEx (const gunichar2 *name,
extern gboolean SetFileAttributes (const gunichar2 *name, guint32 attrs);
extern guint32 GetCurrentDirectory (guint32 length, gunichar2 *buffer);
extern gboolean SetCurrentDirectory (const gunichar2 *path);
+extern gboolean CreatePipe (gpointer *readpipe, gpointer *writepipe,
+ WapiSecurityAttributes *security, guint32 size);
+extern guint32 GetTempPath (guint32 len, gunichar2 *buf);
+extern gint32 GetLogicalDriveStrings (guint32 len, gunichar2 *buf);
+extern gboolean LockFile (gpointer handle, guint32 offset_low,
+ guint32 offset_high, guint32 length_low,
+ guint32 length_high);
+extern gboolean UnlockFile (gpointer handle, guint32 offset_low,
+ guint32 offset_high, guint32 length_low,
+ guint32 length_high);
#endif /* _WAPI_IO_H_ */
diff --git a/mono/io-layer/misc-private.h b/mono/io-layer/misc-private.h
index 00b209c4eb5..2966d80b176 100644
--- a/mono/io-layer/misc-private.h
+++ b/mono/io-layer/misc-private.h
@@ -14,5 +14,6 @@
#include <sys/time.h>
extern void _wapi_calc_timeout(struct timespec *timeout, guint32 ms);
+extern gpointer _wapi_g_renew0 (gpointer mem, gulong old_len, gulong new_len);
#endif /* _WAPI_MISC_PRIVATE_H_ */
diff --git a/mono/io-layer/misc.c b/mono/io-layer/misc.c
index 67ffbeed501..9d2f427a2e1 100644
--- a/mono/io-layer/misc.c
+++ b/mono/io-layer/misc.c
@@ -18,10 +18,22 @@ void _wapi_calc_timeout(struct timespec *timeout, guint32 ms)
{
struct timeval now;
div_t divvy;
-
- divvy=div((int)ms, 1000);
+
gettimeofday(&now, NULL);
+ divvy=div((now.tv_usec/1000)+ms, 1000);
timeout->tv_sec=now.tv_sec+divvy.quot;
- timeout->tv_nsec=(now.tv_usec+divvy.rem)*1000;
+ timeout->tv_nsec=divvy.rem*1000000;
+}
+
+/* This is used instead of g_renew when we need to keep unused
+ * elements NULL, because g_renew doesn't initialize the memory it
+ * returns.
+ */
+gpointer _wapi_g_renew0 (gpointer mem, gulong old_len, gulong new_len)
+{
+ gpointer new_mem=g_malloc0 (new_len);
+ memcpy (new_mem, mem, old_len);
+ g_free (mem);
+ return(new_mem);
}
diff --git a/mono/io-layer/mono-mutex.c b/mono/io-layer/mono-mutex.c
index 604afbe7103..104c36b46fc 100644
--- a/mono/io-layer/mono-mutex.c
+++ b/mono/io-layer/mono-mutex.c
@@ -35,6 +35,9 @@
#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
+int pthread_mutex_timedlock (pthread_mutex_t *mutex,
+ const struct timespec *timeout);
+
int
pthread_mutex_timedlock (pthread_mutex_t *mutex, const struct timespec *timeout)
{
@@ -65,13 +68,22 @@ pthread_mutex_timedlock (pthread_mutex_t *mutex, const struct timespec *timeout)
int
mono_once (mono_once_t *once, void (*once_init) (void))
{
+ int thr_ret;
+
if (!once->complete) {
- pthread_mutex_lock (&once->mutex);
+ pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock,
+ (void *)&once->mutex);
+ thr_ret = pthread_mutex_lock (&once->mutex);
+ g_assert (thr_ret == 0);
+
if (!once->complete) {
once_init ();
once->complete = TRUE;
}
- pthread_mutex_unlock (&once->mutex);
+ thr_ret = pthread_mutex_unlock (&once->mutex);
+ g_assert (thr_ret == 0);
+
+ pthread_cleanup_pop (0);
}
return 0;
@@ -153,20 +165,24 @@ mono_mutexattr_destroy (mono_mutexattr_t *attr)
int
mono_mutex_init (mono_mutex_t *mutex, const mono_mutexattr_t *attr)
{
+ int ret;
+ int thr_ret;
+
mutex->waiters = 0;
mutex->depth = 0;
mutex->owner = MONO_THREAD_NONE;
if (!attr || attr->type == MONO_MUTEX_NORMAL) {
mutex->type = MONO_MUTEX_NORMAL;
- pthread_mutex_init (&mutex->mutex, NULL);
+ ret = pthread_mutex_init (&mutex->mutex, NULL);
} else {
mutex->type = MONO_MUTEX_RECURSIVE;
- pthread_mutex_init (&mutex->mutex, NULL);
- pthread_cond_init (&mutex->cond, NULL);
+ ret = pthread_mutex_init (&mutex->mutex, NULL);
+ thr_ret = pthread_cond_init (&mutex->cond, NULL);
+ g_assert (thr_ret == 0);
}
- return 0;
+ return(ret);
}
int
@@ -192,7 +208,7 @@ mono_mutex_lock (mono_mutex_t *mutex)
break;
} else {
mutex->waiters++;
- if (pthread_cond_wait (&mutex->cond, &mutex->mutex) == -1)
+ if (pthread_cond_wait (&mutex->cond, &mutex->mutex) != 0)
return EINVAL;
mutex->waiters--;
}
@@ -279,6 +295,8 @@ mono_mutex_timedlock (mono_mutex_t *mutex, const struct timespec *timeout)
int
mono_mutex_unlock (mono_mutex_t *mutex)
{
+ int thr_ret;
+
switch (mutex->type) {
case MONO_MUTEX_NORMAL:
return pthread_mutex_unlock (&mutex->mutex);
@@ -286,13 +304,19 @@ mono_mutex_unlock (mono_mutex_t *mutex)
if (pthread_mutex_lock (&mutex->mutex) != 0)
return EINVAL;
- assert (mutex->owner == pthread_self ());
+ if (mutex->owner != pthread_self()) {
+ /* Not owned by this thread */
+ pthread_mutex_unlock (&mutex->mutex);
+ return EPERM;
+ }
mutex->depth--;
if (mutex->depth == 0) {
mutex->owner = MONO_THREAD_NONE;
- if (mutex->waiters > 0)
- pthread_cond_signal (&mutex->cond);
+ if (mutex->waiters > 0) {
+ thr_ret = pthread_cond_signal (&mutex->cond);
+ g_assert (thr_ret == 0);
+ }
}
return pthread_mutex_unlock (&mutex->mutex);
@@ -305,6 +329,7 @@ int
mono_mutex_destroy (mono_mutex_t *mutex)
{
int ret = 0;
+ int thr_ret;
switch (mutex->type) {
case MONO_MUTEX_NORMAL:
@@ -312,7 +337,8 @@ mono_mutex_destroy (mono_mutex_t *mutex)
break;
case MONO_MUTEX_RECURSIVE:
if ((ret = pthread_mutex_destroy (&mutex->mutex)) == 0) {
- pthread_cond_destroy (&mutex->cond);
+ thr_ret = pthread_cond_destroy (&mutex->cond);
+ g_assert (thr_ret == 0);
}
}
diff --git a/mono/io-layer/mono-mutex.h b/mono/io-layer/mono-mutex.h
index 8e233167629..8f4f3f2c947 100644
--- a/mono/io-layer/mono-mutex.h
+++ b/mono/io-layer/mono-mutex.h
@@ -33,12 +33,6 @@ extern "C" {
#include <pthread.h>
#include <time.h>
-#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
-extern int pthread_mutex_timedlock (pthread_mutex_t *mutex,
- const struct timespec *timeout);
-#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */
-
-
typedef struct {
pthread_mutex_t mutex;
gboolean complete;
@@ -165,6 +159,15 @@ typedef pthread_mutexattr_t mono_mutexattr_t;
#endif /* USE_MONO_MUTEX */
+/* This is a function so it can be passed to pthread_cleanup_push -
+ * that is a macro and giving it a macro as a parameter breaks.
+ */
+G_GNUC_UNUSED
+static inline int mono_mutex_unlock_in_cleanup (mono_mutex_t *mutex)
+{
+ return(mono_mutex_unlock (mutex));
+}
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/mono/io-layer/mono-spinlock.h b/mono/io-layer/mono-spinlock.h
new file mode 100644
index 00000000000..2ba4100b981
--- /dev/null
+++ b/mono/io-layer/mono-spinlock.h
@@ -0,0 +1,20 @@
+/*
+ * mono-spinlock.h: Lightweight spinlocks, for internal use only
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#ifndef _WAPI_MONO_SPINLOCK_H_
+#define _WAPI_MONO_SPINLOCK_H_
+
+#include <glib.h>
+
+#include <mono/io-layer/wapi.h>
+
+#define MONO_SPIN_LOCK(lock) while((InterlockedCompareExchange(&lock, 1, 0))!=0)
+#define MONO_SPIN_UNLOCK(lock) lock=0
+
+#endif /* _WAPI_MONO_SPINLOCK_H_ */
diff --git a/mono/io-layer/mutex-private.h b/mono/io-layer/mutex-private.h
index cb702a749fd..41fe02a3891 100644
--- a/mono/io-layer/mutex-private.h
+++ b/mono/io-layer/mutex-private.h
@@ -19,7 +19,7 @@ extern struct _WapiHandleOps _wapi_mutex_ops;
struct _WapiHandle_mutex
{
- guint32 name;
+ WapiSharedNamespace sharedns;
pid_t pid;
pthread_t tid;
guint32 recursion;
@@ -30,4 +30,6 @@ struct _WapiHandlePrivate_mutex
int dummy;
};
+extern void _wapi_mutex_check_abandoned (pid_t pid, pthread_t tid);
+
#endif /* _WAPI_MUTEX_PRIVATE_H_ */
diff --git a/mono/io-layer/mutexes.c b/mono/io-layer/mutexes.c
index 0949a687134..ee10921578a 100644
--- a/mono/io-layer/mutexes.c
+++ b/mono/io-layer/mutexes.c
@@ -22,6 +22,10 @@
#undef DEBUG
+/* This is used to serialise mutex creation when names are given
+ */
+static mono_mutex_t named_mutex_mutex;
+
static void mutex_close_shared (gpointer handle);
static void mutex_signal(gpointer handle);
static void mutex_own (gpointer handle);
@@ -39,6 +43,23 @@ static mono_once_t mutex_ops_once=MONO_ONCE_INIT;
static void mutex_ops_init (void)
{
+ int thr_ret;
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
+ pthread_mutexattr_t mutex_shared_attr;
+
+ thr_ret = mono_mutexattr_init (&mutex_shared_attr);
+ g_assert (thr_ret == 0);
+
+ thr_ret = mono_mutexattr_setpshared (&mutex_shared_attr,
+ PTHREAD_PROCESS_SHARED);
+ g_assert (thr_ret == 0);
+
+ thr_ret = mono_mutex_init (&named_mutex_mutex, &mutex_shared_attr);
+ g_assert (thr_ret == 0);
+#else
+ thr_ret = mono_mutex_init (&named_mutex_mutex, NULL);
+#endif
+
_wapi_handle_register_capabilities (WAPI_HANDLE_MUTEX,
WAPI_HANDLE_CAP_WAIT |
WAPI_HANDLE_CAP_SIGNAL |
@@ -62,9 +83,9 @@ static void mutex_close_shared (gpointer handle)
g_message(G_GNUC_PRETTY_FUNCTION ": closing mutex handle %p", handle);
#endif
- if(mutex_handle->name!=0) {
- _wapi_handle_scratch_delete (mutex_handle->name);
- mutex_handle->name=0;
+ if(mutex_handle->sharedns.name!=0) {
+ _wapi_handle_scratch_delete (mutex_handle->sharedns.name);
+ mutex_handle->sharedns.name=0;
}
}
@@ -135,14 +156,73 @@ static gboolean mutex_is_owned (gpointer handle)
} else {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
- ": mutex handle %p not owned by %d:%ld", handle,
- getpid (), pthread_self ());
+ ": mutex handle %p not owned by %d:%ld, but locked %d times by %d:%ld", handle, getpid (), pthread_self (), mutex_handle->recursion, mutex_handle->pid, mutex_handle->tid);
#endif
return(FALSE);
}
}
+struct mutex_check_data
+{
+ pid_t pid;
+ pthread_t tid;
+};
+
+static gboolean mutex_check (gpointer handle, gpointer user_data)
+{
+ struct _WapiHandle_mutex *mutex_handle;
+ gboolean ok;
+ struct mutex_check_data *data = (struct mutex_check_data *)user_data;
+ int thr_ret;
+
+ ok = _wapi_lookup_handle (handle, WAPI_HANDLE_MUTEX,
+ (gpointer *)&mutex_handle, NULL);
+ if (ok == FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up mutex handle %p", handle);
+ return(FALSE);
+ }
+
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
+
+ if (mutex_handle->pid == data->pid &&
+ mutex_handle->tid == data->tid) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Mutex handle %p abandoned!", handle);
+#endif
+
+ mutex_handle->recursion = 0;
+ mutex_handle->pid = 0;
+ mutex_handle->tid = 0;
+
+ _wapi_handle_set_signal_state (handle, TRUE, FALSE);
+ }
+
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ /* Return false to keep searching */
+ return(FALSE);
+}
+
+/* When a thread exits, any mutexes it still holds need to be signalled */
+void _wapi_mutex_check_abandoned (pid_t pid, pthread_t tid)
+{
+ struct mutex_check_data data;
+
+ data.pid = pid;
+ data.tid = tid;
+
+ _wapi_search_handle (WAPI_HANDLE_MUTEX, mutex_check, &data, NULL,
+ NULL);
+}
+
/**
* CreateMutex:
* @security: Ignored for now.
@@ -163,35 +243,99 @@ static gboolean mutex_is_owned (gpointer handle)
* Return value: A new handle, or %NULL on error.
*/
gpointer CreateMutex(WapiSecurityAttributes *security G_GNUC_UNUSED, gboolean owned,
- const guchar *name)
+ const gunichar2 *name)
{
struct _WapiHandle_mutex *mutex_handle;
gpointer handle;
gboolean ok;
+ gchar *utf8_name;
+ int thr_ret;
+ gpointer ret = NULL;
mono_once (&mutex_ops_once, mutex_ops_init);
+
+ /* w32 seems to guarantee that opening named mutexes can't
+ * race each other
+ */
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&named_mutex_mutex);
+ thr_ret = mono_mutex_lock (&named_mutex_mutex);
+ g_assert (thr_ret == 0);
+
+ /* Need to blow away any old errors here, because code tests
+ * for ERROR_ALREADY_EXISTS on success (!) to see if a mutex
+ * was freshly created
+ */
+ SetLastError (ERROR_SUCCESS);
+
+ if(name!=NULL) {
+ utf8_name=g_utf16_to_utf8 (name, -1, NULL, NULL, NULL);
+ } else {
+ utf8_name=NULL;
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Creating mutex (name [%s])",
+ utf8_name==NULL?"<unnamed>":utf8_name);
+#endif
+
+ if(name!=NULL) {
+ handle=_wapi_search_handle_namespace (
+ WAPI_HANDLE_MUTEX, utf8_name,
+ (gpointer *)&mutex_handle, NULL);
+ if(handle==_WAPI_HANDLE_INVALID) {
+ /* The name has already been used for a different
+ * object.
+ */
+ g_free (utf8_name);
+ SetLastError (ERROR_INVALID_HANDLE);
+ goto cleanup;
+ } else if (handle!=NULL) {
+ g_free (utf8_name);
+ _wapi_handle_ref (handle);
+ ret = handle;
+
+ /* Not an error, but this is how the caller is
+ * informed that the mutex wasn't freshly
+ * created
+ */
+ SetLastError (ERROR_ALREADY_EXISTS);
+ goto cleanup;
+ }
+ /* Otherwise fall through to create the mutex. */
+ }
handle=_wapi_handle_new (WAPI_HANDLE_MUTEX);
if(handle==_WAPI_HANDLE_INVALID) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error creating mutex handle");
- return(NULL);
+ if(utf8_name!=NULL) {
+ g_free (utf8_name);
+ }
+ goto cleanup;
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_MUTEX,
(gpointer *)&mutex_handle, NULL);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up mutex handle %p", handle);
- _wapi_handle_unlock_handle (handle);
- return(NULL);
+ if(utf8_name!=NULL) {
+ g_free (utf8_name);
+ }
+
+ goto handle_cleanup;
}
-
- if(name!=NULL) {
- mutex_handle->name=_wapi_handle_scratch_store (name,
- strlen (name));
+ ret = handle;
+
+ if(utf8_name!=NULL) {
+ mutex_handle->sharedns.name=_wapi_handle_scratch_store (
+ utf8_name, strlen (utf8_name));
}
if(owned==TRUE) {
@@ -205,9 +349,21 @@ gpointer CreateMutex(WapiSecurityAttributes *security G_GNUC_UNUSED, gboolean ow
handle);
#endif
- _wapi_handle_unlock_handle (handle);
+ if(utf8_name!=NULL) {
+ g_free (utf8_name);
+ }
- return(handle);
+handle_cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+cleanup:
+ thr_ret = mono_mutex_unlock (&named_mutex_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
}
/**
@@ -225,6 +381,8 @@ gboolean ReleaseMutex(gpointer handle)
gboolean ok;
pthread_t tid=pthread_self();
pid_t pid=getpid ();
+ int thr_ret;
+ gboolean ret = FALSE;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_MUTEX,
(gpointer *)&mutex_handle, NULL);
@@ -234,7 +392,10 @@ gboolean ReleaseMutex(gpointer handle)
return(FALSE);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Releasing mutex handle %p",
@@ -246,10 +407,10 @@ gboolean ReleaseMutex(gpointer handle)
g_message(G_GNUC_PRETTY_FUNCTION ": We don't own mutex handle %p (owned by %d:%ld, me %d:%ld)", handle, mutex_handle->pid, mutex_handle->tid, pid, tid);
#endif
- _wapi_handle_unlock_handle (handle);
- return(FALSE);
+ goto cleanup;
}
-
+ ret = TRUE;
+
/* OK, we own this mutex */
mutex_handle->recursion--;
@@ -264,7 +425,10 @@ gboolean ReleaseMutex(gpointer handle)
_wapi_handle_set_signal_state (handle, TRUE, FALSE);
}
- _wapi_handle_unlock_handle (handle);
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
- return(TRUE);
+ return(ret);
}
diff --git a/mono/io-layer/mutexes.h b/mono/io-layer/mutexes.h
index 3caa06e5d45..82aacfdb879 100644
--- a/mono/io-layer/mutexes.h
+++ b/mono/io-layer/mutexes.h
@@ -13,7 +13,7 @@
#include <glib.h>
extern gpointer CreateMutex(WapiSecurityAttributes *security, gboolean owned,
- const guchar *name);
+ const gunichar2 *name);
extern gboolean ReleaseMutex(gpointer handle);
#endif /* _WAPI_MUTEXES_H_ */
diff --git a/mono/io-layer/process-private.h b/mono/io-layer/process-private.h
index 98e01c67794..dcd66815e9b 100644
--- a/mono/io-layer/process-private.h
+++ b/mono/io-layer/process-private.h
@@ -24,6 +24,9 @@ struct _WapiHandle_process
guint32 env;
WapiFileTime create_time;
WapiFileTime exit_time;
+ guint32 proc_name;
+ size_t min_working_set;
+ size_t max_working_set;
};
struct _WapiHandlePrivate_process
diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c
index 4617f3e9438..dedd4e2f652 100644
--- a/mono/io-layer/processes.c
+++ b/mono/io-layer/processes.c
@@ -9,7 +9,7 @@
#include <config.h>
#if HAVE_BOEHM_GC
-#include <gc/gc.h>
+#include <mono/os/gc_wrapper.h>
#include "mono/utils/mono-hash.h"
#endif
#include <glib.h>
@@ -20,15 +20,19 @@
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
+#include <signal.h>
#include <mono/io-layer/wapi.h>
-#include <mono/io-layer/unicode.h>
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/handles-private.h>
#include <mono/io-layer/misc-private.h>
#include <mono/io-layer/mono-mutex.h>
#include <mono/io-layer/process-private.h>
#include <mono/io-layer/threads.h>
+#include <mono/utils/strenc.h>
+
+/* The process' environment strings */
+extern char **environ;
#undef DEBUG
@@ -55,7 +59,6 @@ static void process_ops_init (void)
static void process_close_shared (gpointer handle G_GNUC_UNUSED)
{
-#ifdef DEBUG
struct _WapiHandle_process *process_handle;
gboolean ok;
@@ -67,28 +70,33 @@ static void process_close_shared (gpointer handle G_GNUC_UNUSED)
return;
}
+#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": closing process handle %p with id %d", handle,
process_handle->id);
#endif
+
+ if(process_handle->proc_name!=0) {
+ _wapi_handle_scratch_delete (process_handle->proc_name);
+ process_handle->proc_name=0;
+ }
}
gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
WapiSecurityAttributes *process_attrs G_GNUC_UNUSED,
WapiSecurityAttributes *thread_attrs G_GNUC_UNUSED,
gboolean inherit_handles, guint32 create_flags,
- gpointer environ, const gunichar2 *cwd,
+ gpointer new_environ, const gunichar2 *cwd,
WapiStartupInfo *startup,
WapiProcessInformation *process_info)
{
- gchar *cmd=NULL, *prog, *args=NULL, *dir=NULL;
- gunichar2 *environp;
- guint32 env=0, stored_dir=0, stored_prog=0, stored_args=0;
- guint32 env_count=0, i;
+ gchar *cmd=NULL, *prog = NULL, *full_prog = NULL, *args=NULL, *args_after_prog=NULL, *dir=NULL;
+ guint32 env=0, stored_dir=0, stored_prog=0, i;
gboolean ret=FALSE;
- gpointer stdin_handle=NULL, stdout_handle=NULL, stderr_handle=NULL;
+ gpointer stdin_handle, stdout_handle, stderr_handle;
guint32 pid, tid;
gpointer process_handle, thread_handle;
+ struct _WapiHandle_process *process_handle_data;
mono_once (&process_ops_once, process_ops_init);
@@ -119,13 +127,14 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
* so crap, with an API like this :-(
*/
if(appname!=NULL) {
- cmd=_wapi_unicode_to_utf8 (appname);
+ cmd=mono_unicode_to_external (appname);
if(cmd==NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": unicode conversion returned NULL");
#endif
+ SetLastError(ERROR_PATH_NOT_FOUND);
goto cleanup;
}
@@ -138,32 +147,27 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
}
if(cmdline!=NULL) {
- args=_wapi_unicode_to_utf8 (cmdline);
+ args=mono_unicode_to_external (cmdline);
if(args==NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": unicode conversion returned NULL");
#endif
+ SetLastError(ERROR_PATH_NOT_FOUND);
goto cleanup;
}
-
- /* Turn all the slashes round the right way */
- for(i=0; i<strlen (args); i++) {
- if(args[i]=='\\') {
- args[i]='/';
- }
- }
}
if(cwd!=NULL) {
- dir=_wapi_unicode_to_utf8 (cwd);
+ dir=mono_unicode_to_external (cwd);
if(dir==NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": unicode conversion returned NULL");
#endif
+ SetLastError(ERROR_PATH_NOT_FOUND);
goto cleanup;
}
@@ -173,28 +177,55 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
dir[i]='/';
}
}
- stored_dir=_wapi_handle_scratch_store (dir, strlen (dir));
+ } else {
+ dir=g_get_current_dir ();
}
+ stored_dir=_wapi_handle_scratch_store (dir, strlen (dir));
- /* environ is a block of NULL-terminated strings, which is
- * itself NULL-terminated. Of course, passing an array of
+
+ /* new_environ is a block of NULL-terminated strings, which
+ * is itself NULL-terminated. Of course, passing an array of
* string pointers would have made things too easy :-(
+ *
+ * If new_environ is not NULL it specifies the entire set of
+ * environment variables in the new process. Otherwise the
+ * new process inherits the same environment.
*/
- /* Not sure whether I should turn the w32 env block into
- * proper env vars, or just leave it to be read back by other
- * w32 emulation functions.
- */
- if(environ!=NULL) {
- /* env_count counts bytes, not chars */
- for(environp=(gunichar2 *)environ; *environp;
- env_count+=2, environp++) {
- while(*environp) {
- env_count+=2;
- environp++;
+ if(new_environ!=NULL) {
+ gchar **strings;
+ guint32 count=0;
+ gunichar2 *new_environp;
+
+ /* Count the number of strings */
+ for(new_environp=(gunichar2 *)new_environ; *new_environp;
+ new_environp++) {
+ count++;
+ while(*new_environp) {
+ new_environp++;
+ }
+ }
+ strings=g_new0 (gchar *, count + 1); /* +1 -> last one is NULL */
+
+ /* Copy each environ string into 'strings' turning it
+ * into utf8 (or the requested encoding) at the same
+ * time
+ */
+ count=0;
+ for(new_environp=(gunichar2 *)new_environ; *new_environp;
+ new_environp++) {
+ strings[count]=mono_unicode_to_external (new_environp);
+ count++;
+ while(*new_environp) {
+ new_environp++;
}
}
- env=_wapi_handle_scratch_store (environ, env_count);
+ env=_wapi_handle_scratch_store_string_array (strings);
+
+ g_strfreev (strings);
+ } else {
+ /* Use the existing environment */
+ env=_wapi_handle_scratch_store_string_array (environ);
}
/* We can't put off locating the executable any longer :-( */
@@ -211,6 +242,16 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
if(cmd[0]=='/') {
/* Assume full path given */
prog=g_strdup (cmd);
+
+ /* Executable existing ? */
+ if(access (prog, X_OK)!=0) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Couldn't find executable %s", prog);
+#endif
+ g_free (prog);
+ SetLastError (ERROR_FILE_NOT_FOUND);
+ goto cleanup;
+ }
} else {
/* Search for file named by cmd in the current
* directory
@@ -220,6 +261,8 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
prog=g_strdup_printf ("%s/%s", curdir, cmd);
g_free (curdir);
}
+
+ args_after_prog=args;
} else {
gchar *token=NULL;
@@ -227,6 +270,15 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
* marks into account
*/
+ /* First, strip off all leading whitespace */
+ args=g_strchug (args);
+
+ /* args_after_prog points to the contents of args
+ * after token has been set (otherwise argv[0] is
+ * duplicated)
+ */
+ args_after_prog=args;
+
/* Assume the opening quote will always be the first
* character
*/
@@ -235,6 +287,7 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
if(g_ascii_isspace (args[i+1])) {
/* We found the first token */
token=g_strndup (args+1, i-1);
+ args_after_prog=args+i;
} else {
/* Quotation mark appeared in the
* middle of the token. Just give the
@@ -249,6 +302,7 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
for(i=0; args[i]!='\0'; i++) {
if(g_ascii_isspace (args[i])) {
token=g_strndup (args, i);
+ args_after_prog=args+i+1;
break;
}
}
@@ -257,6 +311,7 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
if(token==NULL && args[0]!='\0') {
/* Must be just one token in the string */
token=g_strdup (args);
+ args_after_prog=NULL;
}
if(token==NULL) {
@@ -266,9 +321,17 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
": Couldn't find what to exec");
#endif
+ SetLastError(ERROR_PATH_NOT_FOUND);
goto cleanup;
}
+ /* Turn all the slashes round the right way. Only for the prg. name */
+ for(i=0; i < strlen (token); i++) {
+ if (token[i]=='\\') {
+ token[i]='/';
+ }
+ }
+
if(g_ascii_isalpha (token[0]) && (token[1]==':')) {
/* Strip off the drive letter. I can't
* believe that CP/M holdover is still
@@ -281,6 +344,18 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
if(token[0]=='/') {
/* Assume full path given */
prog=g_strdup (token);
+
+ /* Executable existing ? */
+ if(access (prog, X_OK)!=0) {
+ g_free (prog);
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Couldn't find executable %s", token);
+#endif
+ g_free (token);
+ SetLastError (ERROR_FILE_NOT_FOUND);
+ goto cleanup;
+ }
+
} else {
char *curdir=g_get_current_dir ();
@@ -305,6 +380,7 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
#endif
g_free (token);
+ SetLastError (ERROR_FILE_NOT_FOUND);
goto cleanup;
}
}
@@ -314,40 +390,62 @@ gboolean CreateProcess (const gunichar2 *appname, gunichar2 *cmdline,
}
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Exec prog [%s] args [%s]",
- prog, args);
+ g_message (G_GNUC_PRETTY_FUNCTION ": Exec prog [%s] args [%s]", prog,
+ args_after_prog);
#endif
- stored_prog=_wapi_handle_scratch_store (prog, strlen (prog));
- stored_args=_wapi_handle_scratch_store (args, strlen (args));
+ if(args_after_prog!=NULL) {
+ full_prog=g_strconcat (prog, " ", args_after_prog, NULL);
+ } else {
+ full_prog=g_strdup (prog);
+ }
- if(startup!=NULL) {
- if(startup->dwFlags & STARTF_USESTDHANDLES) {
- stdin_handle=startup->hStdInput;
- stdout_handle=startup->hStdOutput;
- stderr_handle=startup->hStdError;
- }
+ stored_prog=_wapi_handle_scratch_store (full_prog, strlen (full_prog));
+
+ if(startup!=NULL && startup->dwFlags & STARTF_USESTDHANDLES) {
+ stdin_handle=startup->hStdInput;
+ stdout_handle=startup->hStdOutput;
+ stderr_handle=startup->hStdError;
+ } else {
+ stdin_handle=GetStdHandle (STD_INPUT_HANDLE);
+ stdout_handle=GetStdHandle (STD_OUTPUT_HANDLE);
+ stderr_handle=GetStdHandle (STD_ERROR_HANDLE);
}
- ret=_wapi_handle_process_fork (stored_prog, stored_args, env,
- stored_dir, inherit_handles,
- create_flags, stdin_handle,
- stdout_handle, stderr_handle,
- &process_handle, &thread_handle, &pid,
- &tid);
+ ret=_wapi_handle_process_fork (stored_prog, env, stored_dir,
+ inherit_handles, create_flags,
+ stdin_handle, stdout_handle,
+ stderr_handle, &process_handle,
+ &thread_handle, &pid, &tid);
if(ret==TRUE && process_info!=NULL) {
process_info->hProcess=process_handle;
process_info->hThread=thread_handle;
process_info->dwProcessId=pid;
process_info->dwThreadId=tid;
+ /* Wait for possible execve failure */
+ if (WaitForSingleObjectEx (process_handle, 500, FALSE) != WAIT_TIMEOUT) {
+ _wapi_lookup_handle (GUINT_TO_POINTER (process_handle),
+ WAPI_HANDLE_PROCESS,
+ (gpointer *) &process_handle_data,
+ NULL);
+
+ if (process_handle_data && process_handle_data->exec_errno != 0) {
+ ret = FALSE;
+ SetLastError (ERROR_PATH_NOT_FOUND);
+ }
+ }
+ } else if (ret==FALSE) {
+ /* FIXME: work out a better error code
+ */
+ SetLastError (ERROR_PATH_NOT_FOUND);
}
-
+
cleanup:
if(cmd!=NULL) {
g_free (cmd);
}
- if(prog!=NULL) {
+ if(full_prog!=NULL) {
g_free (prog);
}
if(stored_prog!=0) {
@@ -356,9 +454,6 @@ cleanup:
if(args!=NULL) {
g_free (args);
}
- if(stored_args!=0) {
- _wapi_handle_scratch_delete (stored_args);
- }
if(dir!=NULL) {
g_free (dir);
}
@@ -366,46 +461,47 @@ cleanup:
_wapi_handle_scratch_delete (stored_dir);
}
if(env!=0) {
- _wapi_handle_scratch_delete (env);
+ _wapi_handle_scratch_delete_string_array (env);
}
return(ret);
}
-
-static gboolean process_compare (gpointer handle, gpointer user_data)
+
+static void process_set_name (struct _WapiHandle_process *process_handle)
{
- struct _WapiHandle_process *process_handle;
- gboolean ok;
- pid_t pid;
+ gchar *progname, *utf8_progname, *slash;
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_PROCESS,
- (gpointer *)&process_handle, NULL);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up process handle %p", handle);
- return(FALSE);
- }
+ progname=g_get_prgname ();
+ utf8_progname=mono_utf8_from_external (progname);
- pid=GPOINTER_TO_UINT (user_data);
- if(process_handle->id==pid) {
- return(TRUE);
- } else {
- return(FALSE);
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": using [%s] as prog name",
+ progname);
+#endif
+
+ if(utf8_progname!=NULL) {
+ slash=strrchr (utf8_progname, '/');
+ if(slash!=NULL) {
+ process_handle->proc_name=_wapi_handle_scratch_store (slash+1, strlen (slash+1));
+ } else {
+ process_handle->proc_name=_wapi_handle_scratch_store (utf8_progname, strlen (utf8_progname));
+ }
+
+ g_free (utf8_progname);
}
}
-
+
+extern void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime);
+
static void process_set_current (void)
{
struct _WapiHandle_process *process_handle;
gboolean ok;
pid_t pid=getpid ();
+ char *handle_env;
- current_process=_wapi_search_handle (WAPI_HANDLE_PROCESS,
- process_compare,
- GUINT_TO_POINTER (pid),
- (gpointer *)&process_handle,
- NULL);
- if(current_process==0) {
+ handle_env=getenv ("_WAPI_PROCESS_HANDLE");
+ if(handle_env==NULL) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
": Need to create my own process handle");
@@ -428,10 +524,58 @@ static void process_set_current (void)
}
process_handle->id=pid;
+
+ /* These seem to be the defaults on w2k */
+ process_handle->min_working_set=204800;
+ process_handle->max_working_set=1413120;
+
+ _wapi_time_t_to_filetime (time (NULL), &process_handle->create_time);
+
+ process_set_name (process_handle);
+
+ /* Make sure the new handle has a reference so it wont go away
+ * until this process exits
+ */
+ _wapi_handle_ref (current_process);
} else {
+ guchar *procname;
+
+ current_process=GUINT_TO_POINTER (atoi (handle_env));
+
#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Found my process handle");
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Found my process handle: %p", current_process);
#endif
+
+ ok=_wapi_lookup_handle (current_process, WAPI_HANDLE_PROCESS,
+ (gpointer *)&process_handle, NULL);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up process handle %p",
+ current_process);
+ return;
+ }
+
+ procname=_wapi_handle_scratch_lookup (process_handle->proc_name);
+ if(procname!=NULL) {
+ if(!strcmp (procname, "mono")) {
+ /* Set a better process name */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Setting better process name");
+#endif
+
+ _wapi_handle_scratch_delete (process_handle->proc_name);
+ process_set_name (process_handle);
+ } else {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Leaving process name: %s",
+ procname);
+#endif
+ }
+
+ g_free (procname);
+ }
}
}
@@ -445,16 +589,35 @@ gpointer GetCurrentProcess (void)
guint32 GetCurrentProcessId (void)
{
+ struct _WapiHandle_process *current_process_handle;
+ gboolean ok;
+
mono_once (&process_current_once, process_set_current);
- return(getpid ());
+ ok=_wapi_lookup_handle (current_process, WAPI_HANDLE_PROCESS,
+ (gpointer *)&current_process_handle, NULL);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up current process handle %p",
+ current_process);
+ /* No failure return is defined. PID 0 is invalid.
+ * This should only be reached when something else has
+ * gone badly wrong anyway.
+ */
+ return(0);
+ }
+
+ return(current_process_handle->id);
}
static gboolean process_enum (gpointer handle, gpointer user_data)
{
GPtrArray *processes=user_data;
- g_ptr_array_add (processes, handle);
+ /* Ignore processes that have already exited (ie they are signalled) */
+ if(_wapi_handle_issignalled (handle)==FALSE) {
+ g_ptr_array_add (processes, handle);
+ }
/* Return false to keep searching */
return(FALSE);
@@ -465,6 +628,8 @@ gboolean EnumProcesses (guint32 *pids, guint32 len, guint32 *needed)
GPtrArray *processes=g_ptr_array_new ();
guint32 fit, i;
+ mono_once (&process_current_once, process_set_current);
+
_wapi_search_handle (WAPI_HANDLE_PROCESS, process_enum, processes,
NULL, NULL);
@@ -613,3 +778,196 @@ gboolean GetProcessTimes (gpointer process, WapiFileTime *create_time,
return(TRUE);
}
+
+gboolean EnumProcessModules (gpointer process, gpointer *modules,
+ guint32 size, guint32 *needed)
+{
+ /* Store modules in an array of pointers (main module as
+ * modules[0]), using the load address for each module as a
+ * token. (Use 'NULL' as an alternative for the main module
+ * so that the simple implementation can just return one item
+ * for now.) Get the info from /proc/<pid>/maps on linux,
+ * other systems will have to implement /dev/kmem reading or
+ * whatever other horrid technique is needed.
+ */
+ if(size<sizeof(gpointer)) {
+ return(FALSE);
+ }
+
+#ifdef linux
+ modules[0]=NULL;
+ *needed=sizeof(gpointer);
+#else
+ modules[0]=NULL;
+ *needed=sizeof(gpointer);
+#endif
+
+ return(TRUE);
+}
+
+guint32 GetModuleBaseName (gpointer process, gpointer module,
+ gunichar2 *basename, guint32 size)
+{
+ struct _WapiHandle_process *process_handle;
+ gboolean ok;
+
+ mono_once (&process_current_once, process_set_current);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Getting module base name, process handle %p module %p",
+ process, module);
+#endif
+
+ if(basename==NULL || size==0) {
+ return(FALSE);
+ }
+
+ ok=_wapi_lookup_handle (process, WAPI_HANDLE_PROCESS,
+ (gpointer *)&process_handle, NULL);
+ if(ok==FALSE) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Can't find process %p",
+ process);
+#endif
+
+ return(FALSE);
+ }
+
+ if(module==NULL) {
+ /* Shorthand for the main module, which has the
+ * process name recorded in the handle data
+ */
+ pid_t pid;
+ gunichar2 *procname;
+ guchar *procname_utf8;
+ glong len, bytes;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Returning main module name");
+#endif
+
+ pid=process_handle->id;
+ procname_utf8=_wapi_handle_scratch_lookup (process_handle->proc_name);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Process name is [%s]",
+ procname_utf8);
+#endif
+
+ procname=g_utf8_to_utf16 (procname_utf8, -1, NULL, &len, NULL);
+ if(procname==NULL) {
+ /* bugger */
+ g_free (procname_utf8);
+ return(0);
+ }
+
+ /* Add the terminator, and convert chars to bytes */
+ bytes=(len+1)*2;
+
+ if(size<bytes) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Size %d smaller than needed (%ld); truncating", size, bytes);
+#endif
+
+ memcpy (basename, procname, size);
+ } else {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Size %d larger than needed (%ld)",
+ size, bytes);
+#endif
+
+ memcpy (basename, procname, bytes);
+ }
+
+ g_free (procname_utf8);
+ g_free (procname);
+
+ return(len);
+ } else {
+ /* Look up the address in /proc/<pid>/maps */
+ }
+
+ return(0);
+}
+
+gboolean GetProcessWorkingSetSize (gpointer process, size_t *min, size_t *max)
+{
+ struct _WapiHandle_process *process_handle;
+ gboolean ok;
+
+ mono_once (&process_current_once, process_set_current);
+
+ if(min==NULL || max==NULL) {
+ /* Not sure if w32 allows NULLs here or not */
+ return(FALSE);
+ }
+
+ ok=_wapi_lookup_handle (process, WAPI_HANDLE_PROCESS,
+ (gpointer *)&process_handle, NULL);
+ if(ok==FALSE) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Can't find process %p",
+ process);
+#endif
+
+ return(FALSE);
+ }
+
+ *min=process_handle->min_working_set;
+ *max=process_handle->max_working_set;
+
+ return(TRUE);
+}
+
+gboolean SetProcessWorkingSetSize (gpointer process, size_t min, size_t max)
+{
+ struct _WapiHandle_process *process_handle;
+ gboolean ok;
+
+ mono_once (&process_current_once, process_set_current);
+
+ ok=_wapi_lookup_handle (process, WAPI_HANDLE_PROCESS,
+ (gpointer *)&process_handle, NULL);
+ if(ok==FALSE) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Can't find process %p",
+ process);
+#endif
+
+ return(FALSE);
+ }
+
+ process_handle->min_working_set=min;
+ process_handle->max_working_set=max;
+
+ return(TRUE);
+}
+
+
+gboolean
+TerminateProcess (gpointer process, gint32 exitCode)
+{
+ struct _WapiHandle_process *process_handle;
+ gboolean ok;
+ gint signo;
+ gint err;
+
+ ok = _wapi_lookup_handle (process, WAPI_HANDLE_PROCESS,
+ (gpointer *) &process_handle, NULL);
+
+ if (ok == FALSE) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Can't find process %p",
+ process);
+#endif
+ SetLastError (ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ signo = (exitCode == -1) ? SIGKILL : SIGTERM;
+ return _wapi_handle_process_kill (process_handle->id, signo, &err);
+}
+
diff --git a/mono/io-layer/processes.h b/mono/io-layer/processes.h
index 98644f480a8..6b0005e9a58 100644
--- a/mono/io-layer/processes.h
+++ b/mono/io-layer/processes.h
@@ -12,7 +12,8 @@
#include <glib.h>
-#include "mono/io-layer/handles.h"
+#include <mono/io-layer/handles.h>
+#include <mono/io-layer/access.h>
typedef enum {
STARTF_USESHOWWINDOW=0x001,
@@ -23,7 +24,7 @@ typedef enum {
STARTF_RUNFULLSCREEN=0x020,
STARTF_FORCEONFEEDBACK=0x040,
STARTF_FORCEOFFFEEDBACK=0x080,
- STARTF_USESTDHANDLES=0x100,
+ STARTF_USESTDHANDLES=0x100
} WapiStartupFlags;
@@ -87,13 +88,6 @@ struct _WapiProcessInformation
#define CREATE_PRESERVE_CODE_AUTHZ_LEVEL find out the value for this one...
#endif
-/* These are general access control defines, not process-specific.
- * They will move to an access control-defining header when more
- * things use them.
- */
-#define SYNCHRONIZE 0x00100000
-#define STANDARD_RIGHTS_REQUIRED 0x000f0000
-
#define PROCESS_TERMINATE 0x0001
#define PROCESS_CREATE_THREAD 0x0002
#define PROCESS_SET_SESSIONID 0x0004
@@ -123,5 +117,15 @@ extern gboolean GetProcessTimes (gpointer process, WapiFileTime *create_time,
WapiFileTime *exit_time,
WapiFileTime *kernel_time,
WapiFileTime *user_time);
+extern gboolean EnumProcessModules (gpointer process, gpointer *modules,
+ guint32 size, guint32 *needed);
+extern guint32 GetModuleBaseName (gpointer process, gpointer module,
+ gunichar2 *basename, guint32 size);
+extern gboolean GetProcessWorkingSetSize (gpointer process, size_t *min,
+ size_t *max);
+extern gboolean SetProcessWorkingSetSize (gpointer process, size_t min,
+ size_t max);
+
+extern gboolean TerminateProcess (gpointer process, gint32 exitCode);
#endif /* _WAPI_PROCESSES_H_ */
diff --git a/mono/io-layer/security.c b/mono/io-layer/security.c
new file mode 100644
index 00000000000..3a5c622de9d
--- /dev/null
+++ b/mono/io-layer/security.c
@@ -0,0 +1,60 @@
+/*
+ * security.c: Security
+ *
+ * Author:
+ * Sebastien Pouliot <sebastien@ximian.com>
+ *
+ * (C) 2004 Novell (http://www.novell.com)
+ */
+
+#include <config.h>
+#include <mono/io-layer/io-layer.h>
+
+#include <pwd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+
+/* Disclaimers */
+
+#if defined(__GNUC__)
+#ifndef HAVE_GETRESUID
+ #warning getresuid not supported. WindowsImpersonationContext wont work
+#endif
+#ifndef HAVE_SETRESUID
+ #warning setresuid not supported. WindowsImpersonationContext wont work
+#endif
+#endif
+
+
+gboolean
+ImpersonateLoggedOnUser (gpointer handle)
+{
+ uid_t token = (uid_t) handle;
+#ifdef HAVE_SETRESUID
+ if (setresuid (-1, token, getuid ()) < 0)
+ return FALSE;
+#endif
+ return (geteuid () == token);
+}
+
+
+gboolean RevertToSelf (void)
+{
+#ifdef HAVE_GETRESUID
+ uid_t ruid, euid;
+#endif
+ uid_t suid = -1;
+
+#ifdef HAVE_GETRESUID
+ if (getresuid (&ruid, &euid, &suid) < 0)
+ return FALSE;
+#endif
+#ifdef HAVE_SETRESUID
+ if (setresuid (-1, suid, -1) < 0)
+ return FALSE;
+#endif
+ return (geteuid () == suid);
+}
+
diff --git a/mono/io-layer/security.h b/mono/io-layer/security.h
new file mode 100644
index 00000000000..8d0d64eb093
--- /dev/null
+++ b/mono/io-layer/security.h
@@ -0,0 +1,18 @@
+/*
+ * security.h: Security
+ *
+ * Author:
+ * Sebastien Pouliot <sebastien@ximian.com>
+ *
+ * (C) 2004 Novell (http://www.novell.com)
+ */
+
+#ifndef _WAPI_SECURITY_H_
+#define _WAPI_SECURITY_H_
+
+#include <glib.h>
+
+extern gboolean ImpersonateLoggedOnUser (gpointer handle);
+extern gboolean RevertToSelf (void);
+
+#endif /* _WAPI_SECURITY_H_ */
diff --git a/mono/io-layer/semaphores.c b/mono/io-layer/semaphores.c
index 728e16d9a4f..4538064d168 100644
--- a/mono/io-layer/semaphores.c
+++ b/mono/io-layer/semaphores.c
@@ -10,7 +10,9 @@
#include <config.h>
#include <glib.h>
#include <pthread.h>
+#ifdef HAVE_SEMAPHORE_H
#include <semaphore.h>
+#endif
#include <errno.h>
#include <string.h>
#include <sys/time.h>
@@ -106,11 +108,13 @@ static void sema_own (gpointer handle)
*
* Return value: a new handle, or NULL
*/
-gpointer CreateSemaphore(WapiSecurityAttributes *security G_GNUC_UNUSED, gint32 initial, gint32 max, const guchar *name G_GNUC_UNUSED)
+gpointer CreateSemaphore(WapiSecurityAttributes *security G_GNUC_UNUSED, gint32 initial, gint32 max, const gunichar2 *name G_GNUC_UNUSED)
{
struct _WapiHandle_sem *sem_handle;
gpointer handle;
gboolean ok;
+ int thr_ret;
+ gpointer ret = NULL;
mono_once (&sem_ops_once, sem_ops_init);
@@ -137,17 +141,20 @@ gpointer CreateSemaphore(WapiSecurityAttributes *security G_GNUC_UNUSED, gint32
return(NULL);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_SEM,
(gpointer *)&sem_handle, NULL);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error lookup up semaphore handle %p", handle);
- _wapi_handle_unlock_handle (handle);
- return(NULL);
+ goto cleanup;
}
-
+ ret = handle;
+
sem_handle->val=initial;
sem_handle->max=max;
@@ -161,9 +168,12 @@ gpointer CreateSemaphore(WapiSecurityAttributes *security G_GNUC_UNUSED, gint32
initial, max);
#endif
- _wapi_handle_unlock_handle (handle);
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
- return(handle);
+ return(ret);
}
/**
@@ -183,6 +193,7 @@ gboolean ReleaseSemaphore(gpointer handle, gint32 count, gint32 *prevcount)
struct _WapiHandle_sem *sem_handle;
gboolean ok;
gboolean ret=FALSE;
+ int thr_ret;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_SEM,
(gpointer *)&sem_handle, NULL);
@@ -192,7 +203,10 @@ gboolean ReleaseSemaphore(gpointer handle, gint32 count, gint32 *prevcount)
return(FALSE);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": sem %p val %d count %d",
@@ -227,7 +241,9 @@ gboolean ReleaseSemaphore(gpointer handle, gint32 count, gint32 *prevcount)
#endif
end:
- _wapi_handle_unlock_handle (handle);
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
return(ret);
}
diff --git a/mono/io-layer/semaphores.h b/mono/io-layer/semaphores.h
index 6ccba9ba6c1..7d898b8c611 100644
--- a/mono/io-layer/semaphores.h
+++ b/mono/io-layer/semaphores.h
@@ -14,7 +14,7 @@
extern gpointer CreateSemaphore(WapiSecurityAttributes *security,
gint32 initial, gint32 max,
- const guchar *name);
+ const gunichar2 *name);
extern gboolean ReleaseSemaphore(gpointer handle, gint32 count,
gint32 *prevcount);
diff --git a/mono/io-layer/shared.c b/mono/io-layer/shared.c
index 3a1ded0b0f0..b0e828a2221 100644
--- a/mono/io-layer/shared.c
+++ b/mono/io-layer/shared.c
@@ -17,149 +17,431 @@
* that I may as well take advantage of sysV shared memory too.
* Actually, semaphores seem to be buggy, or I was using them
* incorrectly :-). I've replaced the sysV semaphore with a shared
- * integer controlled with Interlocked functions.
-
+ * integer controlled with Interlocked functions. And I've since
+ * replaced that with a separate process to serialise access to the
+ * shared memory, to avoid the possibility of DOS by leaving the
+ * shared memory locked, and also to allow the shared memory to be
+ * cleaned up.
+ *
* mmap() files have the advantage of avoiding namespace collisions,
* but have the disadvantage of needing cleaning up, and also msync().
* sysV shared memory has a really stupid way of getting random key
* IDs, which can lead to collisions.
*
- * I deliberately don't ever delete the shared memory: I'd like to
- * have been able to set the shared memory segment to destroy itself
- * on last close, but it doesn't support that. (Setting IPC_RMID on a
- * segment causes subsequent shmat() with the same key to get a new
- * segment :-( ). The function to delete the shared memory segment is
- * only called from a debugging tool (mono/handles/shmdel).
+ * Having tried sysv shm, I tested mmap() and found that MAP_SHARED
+ * makes msync() irrelevent, and both types need cleaning up. Seeing
+ * as mmap() doesn't suffer from the bonkers method of allocating
+ * segments, it seems to be the best method.
*
- * w32 processes do not have the POSIX parent-child relationship, so a
- * process handle is available to any other process to find out exit
- * status. Handles are destroyed when the last reference to them is
- * closed. New handles can be created for long lasting items such as
- * processes or threads, and also for named synchronisation objects so
- * long as these haven't been deleted by having the last referencing
- * handle closed.
+ * This shared memory is needed because w32 processes do not have the
+ * POSIX parent-child relationship, so a process handle is available
+ * to any other process to find out exit status. Handles are
+ * destroyed when the last reference to them is closed. New handles
+ * can be created for long lasting items such as processes or threads,
+ * and also for named synchronisation objects so long as these haven't
+ * been deleted by having the last referencing handle closed.
*/
+
#include <config.h>
#include <glib.h>
#include <stdio.h>
+#include <fcntl.h>
#include <unistd.h>
+#include <sys/mman.h>
#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
+#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/shared.h>
+#include <mono/io-layer/daemon-private.h>
#undef DEBUG
-gpointer _wapi_shm_attach (gboolean daemon, gboolean *success, int *shm_id)
+/* Define this to make it easier to run valgrind on the daemon. Then
+ * the first process to start will turn into a daemon without forking
+ * (the debug utility mono/handles/hps is ideal for this.)
+ */
+#undef VALGRINDING
+
+guchar *_wapi_shm_file (_wapi_shm_t type, guint32 segment)
{
- gpointer shm_seg;
- key_t key;
- gboolean fork_daemon=FALSE;
- struct _WapiHandleShared_list *data;
- int tries;
-
- /*
- * This is an attempt to get a unique key id. The first arg
- * to ftok is a path, so when the config file support is done
- * we should use that.
+ static guchar file[_POSIX_PATH_MAX];
+ guchar *name = NULL, *filename, *dir, *wapi_dir;
+ gchar machine_name[256];
+
+ if (gethostname(machine_name, sizeof(machine_name)) != 0)
+ machine_name[0] = '\0';
+
+ /* Change the filename whenever the format of the contents
+ * changes
+ */
+ if(type==WAPI_SHM_DATA) {
+ name=g_strdup_printf ("shared_data-%s-%d-%d",
+ machine_name, _WAPI_HANDLE_VERSION, segment);
+ } else if (type==WAPI_SHM_SCRATCH) {
+ name=g_strdup_printf ("shared_scratch-%s-%d-%d",
+ machine_name, _WAPI_HANDLE_VERSION, segment);
+ } else {
+ g_assert_not_reached ();
+ }
+
+ /* I don't know how nfs affects mmap. If mmap() of files on
+ * nfs mounts breaks, then there should be an option to set
+ * the directory.
*/
- key=ftok (g_get_home_dir (), _WAPI_HANDLE_VERSION);
+ wapi_dir=getenv ("MONO_SHARED_DIR");
+ if(wapi_dir==NULL) {
+ filename=g_build_filename (g_get_home_dir (), ".wapi", name,
+ NULL);
+ } else {
+ filename=g_build_filename (wapi_dir, ".wapi", name, NULL);
+ }
+ g_free (name);
+
+ g_snprintf (file, _POSIX_PATH_MAX, "%s", filename);
+ g_free (filename);
+
+ /* No need to check if the dir already exists or check
+ * mkdir() errors, because on any error the open() call will
+ * report the problem.
+ */
+ dir=g_path_get_dirname (file);
+ mkdir (dir, 0755);
+ g_free (dir);
+
+ return(file);
+}
+
+gpointer _wapi_shm_file_expand (gpointer mem, _wapi_shm_t type,
+ guint32 segment, guint32 old_len,
+ guint32 new_len)
+{
+ int fd;
+ gpointer new_mem;
+ guchar *filename=_wapi_shm_file (type, segment);
+ int ret;
+
+ if(old_len>=new_len) {
+ return(mem);
+ }
+
+ munmap (mem, old_len);
+
+ fd=open (filename, O_RDWR, 0600);
+ if(fd==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION
+ ": shared file [%s] open error: %s", filename,
+ g_strerror (errno));
+ return(NULL);
+ }
+
+ if(lseek (fd, new_len-1, SEEK_SET)==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION
+ ": shared file [%s] lseek error: %s", filename,
+ g_strerror (errno));
+ return(NULL);
+ }
+
+ do {
+ ret=write (fd, "", 1);
+ }
+ while (ret==-1 && errno==EINTR);
+
+ if(ret==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION
+ ": shared file [%s] write error: %s", filename,
+ g_strerror (errno));
+ return(NULL);
+ }
+
+ close (fd);
+
+ new_mem=_wapi_shm_file_map (type, segment, NULL, NULL);
+
+ return(new_mem);
+}
+
+static int _wapi_shm_file_open (const guchar *filename, _wapi_shm_t type,
+ gboolean *created)
+{
+ int fd;
+ struct stat statbuf;
+ guint32 wanted_size = 0;
+ int ret;
+
+ if(created) {
+ *created=FALSE;
+ }
+
+ if(type==WAPI_SHM_DATA) {
+ wanted_size=sizeof(struct _WapiHandleShared_list);
+ } else if (type==WAPI_SHM_SCRATCH) {
+ wanted_size=sizeof(struct _WapiHandleScratch) +
+ (_WAPI_SHM_SCRATCH_SIZE - MONO_ZERO_ARRAY_LENGTH);
+ } else {
+ g_assert_not_reached ();
+ }
try_again:
- *shm_id=shmget (key, sizeof(struct _WapiHandleShared_list)+
- _WAPI_SHM_SCRATCH_SIZE, IPC_CREAT | IPC_EXCL | 0600);
- if(*shm_id==-1 && errno==EEXIST) {
- /* Cool, we dont have to fork the handle daemon, but
- * we still need to try and get the shm_id.
- */
- *shm_id=shmget (key, 0, 0600);
-
- /* it's possible that the shared memory segment was
- * deleted in between seeing if it exists, and
- * attaching it. If we got an error here, just try
- * attaching it again.
+ /* No O_CREAT yet, because we need to initialise the file if
+ * we have to create it.
+ */
+ fd=open (filename, O_RDWR, 0600);
+ if(fd==-1 && errno==ENOENT) {
+ /* OK, its up to us to create it. O_EXCL to avoid a
+ * race condition where two processes can
+ * simultaneously try and create the file
*/
- if(*shm_id==-1) {
+ fd=open (filename, O_CREAT|O_EXCL|O_RDWR, 0600);
+ if(fd==-1 && errno==EEXIST) {
+ /* It's possible that the file was created in
+ * between finding it didn't exist, and trying
+ * to create it. Just try opening it again
+ */
goto try_again;
- }
- } else if (*shm_id!=-1) {
- /* We created the shared memory segment, so we need to
- * fork the handle daemon too
- */
- fork_daemon=TRUE;
+ } else if (fd==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION
+ ": shared file [%s] open error: %s",
+ filename, g_strerror (errno));
+ return(-1);
+ } else {
+ /* We created the file, so we need to expand
+ * the file and inform the caller so it can
+ * fork the handle daemon too.
+ *
+ * (wanted_size-1, because we're about to
+ * write the other byte to actually expand the
+ * file.)
+ */
+ if(lseek (fd, wanted_size-1, SEEK_SET)==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION ": shared file [%s] lseek error: %s", filename, g_strerror (errno));
+ close (fd);
+ unlink (filename);
+ return(-1);
+ }
+
+ do {
+ ret=write (fd, "", 1);
+ }
+ while (ret==-1 && errno==EINTR);
+
+ if(ret==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION ": shared file [%s] write error: %s", filename, g_strerror (errno));
+ close (fd);
+ unlink (filename);
+ return(-1);
+ }
+
+ if(created) {
+ *created=TRUE;
+ }
- /* sysv shared mem is set to all zero when allocated,
- * so we don't need to do any more initialisation here
- */
- } else {
- /* Some error other than EEXIST */
- g_message (G_GNUC_PRETTY_FUNCTION ": shmget error: %s",
- strerror (errno));
- exit (-1);
+ /* The contents of the file is set to all
+ * zero, because it is opened up with lseek,
+ * so we don't need to do any more
+ * initialisation here
+ */
+ }
+ } else if(fd==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION
+ ": shared file [%s] open error: %s", filename,
+ g_strerror (errno));
+ return(-1);
}
- /* From now on, we need to delete the shm segment before
- * exiting on error if we created it (ie, if
- * fork_daemon==TRUE)
+ /* From now on, we need to delete the file before exiting on
+ * error if we created it (ie, if *created==TRUE)
*/
- shm_seg=shmat (*shm_id, NULL, 0);
- if(shm_seg==(gpointer)-1) {
- g_message (G_GNUC_PRETTY_FUNCTION ": shmat error: %s",
- strerror (errno));
- if(fork_daemon==TRUE) {
- _wapi_shm_destroy ();
+
+ /* Use stat to find the file size (instead of hard coding it)
+ * because we can expand the file later if needed (for more
+ * handles or scratch space.)
+ */
+ if(fstat (fd, &statbuf)==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION ": fstat error: %s",
+ g_strerror (errno));
+ if(created && *created==TRUE) {
+ unlink (filename);
+ }
+ close (fd);
+ return(-1);
+ }
+
+ if(statbuf.st_size < wanted_size) {
+ close (fd);
+ if(created && *created==TRUE) {
+#ifdef HAVE_LARGE_FILE_SUPPORT
+ /* Keep gcc quiet... */
+ g_critical (G_GNUC_PRETTY_FUNCTION ": shared file [%s] is not big enough! (found %lld, need %d bytes)", filename, statbuf.st_size, wanted_size);
+#else
+ g_critical (G_GNUC_PRETTY_FUNCTION ": shared file [%s] is not big enough! (found %ld, need %d bytes)", filename, statbuf.st_size, wanted_size);
+#endif
+ unlink (filename);
+ return(-1);
+ } else {
+ /* We didn't create it, so just try opening it again */
+ goto try_again;
}
- exit (-1);
}
+
+ return(fd);
+}
- if(daemon==TRUE) {
- /* No more to do in the daemon */
- *success=TRUE;
- return(shm_seg);
+gpointer _wapi_shm_file_map (_wapi_shm_t type, guint32 segment,
+ gboolean *created, off_t *size)
+{
+ gpointer shm_seg;
+ int fd;
+ struct stat statbuf;
+ guchar *filename=_wapi_shm_file (type, segment);
+
+ fd=_wapi_shm_file_open (filename, type, created);
+ if(fd==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION
+ ": shared file [%s] open error", filename);
+ return(NULL);
+ }
+
+ if(fstat (fd, &statbuf)==-1) {
+ g_critical (G_GNUC_PRETTY_FUNCTION ": fstat error: %s",
+ g_strerror (errno));
+ close (fd);
+ return(NULL);
+ }
+ if(size) {
+ *size=statbuf.st_size;
+ }
+
+ shm_seg=mmap (NULL, statbuf.st_size, PROT_READ|PROT_WRITE, MAP_SHARED,
+ fd, 0);
+ if(shm_seg==MAP_FAILED) {
+ g_critical (G_GNUC_PRETTY_FUNCTION ": mmap error: %s",
+ g_strerror (errno));
+ close (fd);
+ return(NULL);
}
- data=shm_seg;
+ close (fd);
+ return(shm_seg);
+}
+
+/*
+ * _wapi_shm_attach:
+ * @success: Was it a success
+ *
+ * Attach to the shared memory file or create it if it did not
+ * exist. If it was created and daemon was FALSE a new daemon is
+ * forked into existence. Returns the memory area the file was mmapped
+ * to.
+ */
+gboolean _wapi_shm_attach (struct _WapiHandleShared_list **data,
+ struct _WapiHandleScratch **scratch)
+{
+ gboolean data_created=FALSE, scratch_created=FALSE;
+ off_t data_size, scratch_size;
+ int tries, closing_tries=0;
+
+map_again:
+ *data=_wapi_shm_file_map (WAPI_SHM_DATA, 0, &data_created, &data_size);
+ if(*data==NULL) {
+ return(FALSE);
+ }
+
+ *scratch=_wapi_shm_file_map (WAPI_SHM_SCRATCH, 0, &scratch_created,
+ &scratch_size);
+ if(*scratch==NULL) {
+ if(data_created) {
+ _wapi_shm_destroy ();
+ }
+ return(FALSE);
+ }
+
+ if(scratch_created)
+ (*scratch)->data_len = scratch_size -
+ (sizeof(struct _WapiHandleScratch) - MONO_ZERO_ARRAY_LENGTH);
- if(fork_daemon==TRUE) {
+ if(data_created==FALSE && (*data)->daemon_running==DAEMON_CLOSING) {
+ /* Daemon is closing down, give it a few ms and try
+ * again.
+ */
+
+ struct timespec sleepytime;
+
+ /* Something must have gone wrong, so delete the
+ * shared segments and try again.
+ */
+ _wapi_shm_destroy ();
+
+ munmap (*data, data_size);
+ munmap (*scratch, scratch_size);
+
+ if(closing_tries++ == 5) {
+ /* Still can't get going, so bail out */
+ g_warning ("The handle daemon is stuck closing");
+ return(FALSE);
+ }
+
+ sleepytime.tv_sec=0;
+ sleepytime.tv_nsec=10000000; /* 10ms */
+
+ nanosleep (&sleepytime, NULL);
+ goto map_again;
+ }
+
+ if(data_created==TRUE) {
+#ifdef VALGRINDING
+ /* _wapi_daemon_main() does not return */
+ _wapi_daemon_main (*data, *scratch);
+
+ /* But just in case... */
+ (*data)->daemon_running=DAEMON_DIED_AT_STARTUP;
+ exit (-1);
+#else
pid_t pid;
pid=fork ();
if(pid==-1) {
- g_message (G_GNUC_PRETTY_FUNCTION ": fork error: %s",
- strerror (errno));
+ g_critical (G_GNUC_PRETTY_FUNCTION ": fork error: %s",
+ strerror (errno));
_wapi_shm_destroy ();
- exit (-1);
+ return(FALSE);
} else if (pid==0) {
+ int i;
+
/* child */
setsid ();
- execl (MONO_BINDIR "/mono-handle-d", "mono-handle-d",
- NULL);
- g_warning (": exec of %s/mono-handle-d failed: %s",
- MONO_BINDIR, strerror (errno));
- data->daemon_running=2;
+
+ /* FIXME: Set process title to something
+ * informative
+ */
+
+ /* Start the daemon with a clean sheet of file
+ * descriptors
+ */
+ for(i=3; i<getdtablesize (); i++) {
+ close (i);
+ }
+
+ /* _wapi_daemon_main() does not return */
+ _wapi_daemon_main (*data, *scratch);
+
+ /* But just in case... */
+ (*data)->daemon_running=DAEMON_DIED_AT_STARTUP;
exit (-1);
}
/* parent carries on */
- } else {
- /* Do some sanity checking on the shared memory we
- * attached
- */
- if(!(data->daemon_running==0 || data->daemon_running==1 ||
- data->daemon_running==2) ||
- (strncmp (data->daemon+1, "mono-handle-daemon-", 19)!=0)) {
- g_warning ("Shared memory sanity check failed.");
- *success=FALSE;
- return(NULL);
- }
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Daemon pid %d", pid);
+#endif
+#endif /* !VALGRINDING */
}
- for(tries=0; data->daemon_running==0 && tries < 100; tries++) {
+ for(tries=0; (*data)->daemon_running==DAEMON_STARTING && tries < 100;
+ tries++) {
/* wait for the daemon to sort itself out. To be
* completely safe, we should have a timeout before
* giving up.
@@ -171,59 +453,82 @@ try_again:
nanosleep (&sleepytime, NULL);
}
- if(tries==100 && data->daemon_running==0) {
+ if(tries==100 && (*data)->daemon_running==DAEMON_STARTING) {
/* Daemon didnt get going */
- if(fork_daemon==TRUE) {
- _wapi_shm_destroy ();
+ struct timespec sleepytime;
+
+ /* Something must have gone wrong, so delete the
+ * shared segments and try again.
+ */
+ _wapi_shm_destroy ();
+
+ /* Daemon didn't get going, give it a few ms and try
+ * again.
+ */
+
+ munmap (*data, data_size);
+ munmap (*scratch, scratch_size);
+
+ if(closing_tries++ == 5) {
+ /* Still can't get going, so bail out */
+ g_warning ("The handle daemon didnt start up properly");
+ return(FALSE);
}
- g_warning ("The handle daemon didnt start up properly");
- *success=FALSE;
- return(NULL);
+
+ sleepytime.tv_sec=0;
+ sleepytime.tv_nsec=10000000; /* 10ms */
+
+ nanosleep (&sleepytime, NULL);
+ goto map_again;
}
- if(data->daemon_running==2) {
+ if((*data)->daemon_running==DAEMON_DIED_AT_STARTUP) {
/* Oh dear, the daemon had an error starting up */
- if(fork_daemon==TRUE) {
+ if(data_created==TRUE) {
_wapi_shm_destroy ();
}
g_warning ("Handle daemon failed to start");
- *success=FALSE;
- return(NULL);
+ return(FALSE);
+ }
+
+ /* Do some sanity checking on the shared memory we
+ * attached
+ */
+ if(((*data)->daemon_running!=DAEMON_RUNNING) ||
+#ifdef NEED_LINK_UNLINK
+ (strncmp ((*data)->daemon, "/tmp/mono-handle-daemon-",
+ 24)!=0)) {
+#else
+ (strncmp ((*data)->daemon+1, "mono-handle-daemon-", 19)!=0)) {
+#endif
+ g_warning ("Shared memory sanity check failed.");
+ g_warning("status: %d", (*data)->daemon_running);
+#ifdef NEED_LINK_UNLINK
+ g_warning("daemon: [%s]", (*data)->daemon);
+#else
+ g_warning("daemon: [%s]", (*data)->daemon+1);
+#endif
+ return(FALSE);
}
/* From now on, it's up to the daemon to delete the shared
* memory segment
*/
- *success=TRUE;
- return(shm_seg);
+ return(TRUE);
}
void _wapi_shm_destroy (void)
{
#ifndef DISABLE_SHARED_HANDLES
- int shm_id;
- key_t key;
-
- /*
- * This is an attempt to get a unique key id. The
- * first arg to ftok is a path, so when the config
- * file support is done we should use that.
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": unlinking shared data");
+#endif
+ /* Only delete the first segments. The daemon will destroy
+ * any others when it exits
*/
- key=ftok (g_get_home_dir (), _WAPI_HANDLE_VERSION);
-
- shm_id=shmget (key, 0, 0600);
- if(shm_id==-1 && errno==ENOENT) {
- return;
- } else if (shm_id==-1) {
- g_message (G_GNUC_PRETTY_FUNCTION ": shmget error: %s",
- strerror (errno));
- exit (-1);
- }
- if(shmctl (shm_id, IPC_RMID, NULL)==-1) {
- g_message (G_GNUC_PRETTY_FUNCTION ": shmctl error: %s",
- strerror (errno));
- exit (-1);
- }
+ unlink (_wapi_shm_file (WAPI_SHM_DATA, 0));
+ unlink (_wapi_shm_file (WAPI_SHM_SCRATCH, 0));
#endif /* DISABLE_SHARED_HANDLES */
}
+
diff --git a/mono/io-layer/shared.h b/mono/io-layer/shared.h
index fe469898643..55ac5d575a6 100644
--- a/mono/io-layer/shared.h
+++ b/mono/io-layer/shared.h
@@ -10,6 +10,8 @@
#ifndef _WAPI_SHARED_H_
#define _WAPI_SHARED_H_
+#include <mono/io-layer/wapi-private.h>
+
struct _WapiScratchHeader
{
/* These two can be merged */
@@ -18,13 +20,22 @@ struct _WapiScratchHeader
};
enum {
- WAPI_SHM_SCRATCH_FREE=0x1,
+ WAPI_SHM_SCRATCH_FREE=0x1
};
-#define _WAPI_SHM_SCRATCH_SIZE 409600
+typedef enum {
+ WAPI_SHM_DATA,
+ WAPI_SHM_SCRATCH
+} _wapi_shm_t;
-extern gpointer _wapi_shm_attach (gboolean daemon, gboolean *success,
- int *shm_id);
+extern guchar *_wapi_shm_file (_wapi_shm_t type, guint32 segment);
+extern gpointer _wapi_shm_file_map (_wapi_shm_t type, guint32 segment,
+ gboolean *created, off_t *size);
+extern gpointer _wapi_shm_file_expand (gpointer mem, _wapi_shm_t type,
+ guint32 segment, guint32 old_len,
+ guint32 new_len);
+extern gboolean _wapi_shm_attach (struct _WapiHandleShared_list **data,
+ struct _WapiHandleScratch **scratch);
extern void _wapi_shm_destroy (void);
#endif /* _WAPI_SHARED_H_ */
diff --git a/mono/io-layer/socket-private.h b/mono/io-layer/socket-private.h
index 47f14c1315f..4da7f58d8ad 100644
--- a/mono/io-layer/socket-private.h
+++ b/mono/io-layer/socket-private.h
@@ -22,7 +22,7 @@ struct _WapiHandle_socket
struct _WapiHandlePrivate_socket
{
- int fd;
+ WapiFDMapped fd_mapped;
};
#endif /* _WAPI_SOCKET_PRIVATE_H_ */
diff --git a/mono/io-layer/socket-wrappers.h b/mono/io-layer/socket-wrappers.h
new file mode 100644
index 00000000000..3592da609f7
--- /dev/null
+++ b/mono/io-layer/socket-wrappers.h
@@ -0,0 +1,79 @@
+/*
+ * Special header file to be included only in selected C files.
+ * We need to use the _wapi_ equivalents of the socket API when
+ * working with io-layer handles. On windows we define the wrappers to use
+ * the normal win32 functions.
+ */
+
+#include <config.h>
+
+#ifndef HAVE_SOCKLEN_T
+#define socklen_t int
+#endif
+
+#ifdef PLATFORM_WIN32
+#define _wapi_accept accept
+#define _wapi_bind bind
+#define _wapi_connect connect
+#define _wapi_getpeername getpeername
+#define _wapi_getsockname getsockname
+#define _wapi_getsockopt getsockopt
+#define _wapi_listen listen
+#define _wapi_recv recv
+#define _wapi_recvfrom recvfrom
+#define _wapi_send send
+#define _wapi_sendto sendto
+#define _wapi_setsockopt setsockopt
+#define _wapi_shutdown shutdown
+#define _wapi_socket WSASocket
+#define _wapi_gethostbyname gethostbyname
+#define _wapi_select select
+
+/* No need to wrap FD_ZERO because it doesnt involve file
+ * descriptors
+*/
+#define _wapi_FD_CLR FD_CLR
+#define _wapi_FD_ISSET FD_ISSET
+#define _wapi_FD_SET FD_SET
+
+#else
+
+#define WSA_FLAG_OVERLAPPED 0x01
+
+extern guint32 _wapi_accept(guint32 handle, struct sockaddr *addr,
+ socklen_t *addrlen);
+extern int _wapi_bind(guint32 handle, struct sockaddr *my_addr,
+ socklen_t addrlen);
+extern int _wapi_connect(guint32 handle, const struct sockaddr *serv_addr,
+ socklen_t addrlen);
+extern int _wapi_getpeername(guint32 handle, struct sockaddr *name,
+ socklen_t *namelen);
+extern int _wapi_getsockname(guint32 handle, struct sockaddr *name,
+ socklen_t *namelen);
+extern int _wapi_getsockopt(guint32 handle, int level, int optname,
+ void *optval, socklen_t *optlen);
+extern int _wapi_listen(guint32 handle, int backlog);
+extern int _wapi_recv(guint32 handle, void *buf, size_t len, int recv_flags);
+extern int _wapi_recvfrom(guint32 handle, void *buf, size_t len,
+ int recv_flags, struct sockaddr *from,
+ socklen_t *fromlen);
+extern int _wapi_send(guint32 handle, const void *msg, size_t len,
+ int send_flags);
+extern int _wapi_sendto(guint32 handle, const void *msg, size_t len,
+ int send_flags, const struct sockaddr *to,
+ socklen_t tolen);
+extern int _wapi_setsockopt(guint32 handle, int level, int optname,
+ const void *optval, socklen_t optlen);
+extern int _wapi_shutdown(guint32 handle, int how);
+extern guint32 _wapi_socket(int domain, int type, int protocol, void *unused,
+ guint32 unused2, guint32 flags);
+extern struct hostent *_wapi_gethostbyname(const char *hostname);
+extern int _wapi_select(int nfds, fd_set *readfds, fd_set *writefds,
+ fd_set *exceptfds, struct timeval *timeout);
+
+extern void _wapi_FD_CLR(guint32 handle, fd_set *set);
+extern int _wapi_FD_ISSET(guint32 handle, fd_set *set);
+extern void _wapi_FD_SET(guint32 handle, fd_set *set);
+
+#endif /* PLATFORM_WIN32 */
+
diff --git a/mono/io-layer/sockets.c b/mono/io-layer/sockets.c
index 81ef793cb15..df7ac8a25dc 100644
--- a/mono/io-layer/sockets.c
+++ b/mono/io-layer/sockets.c
@@ -22,15 +22,29 @@
#include <sys/sockio.h> /* defines SIOCATMARK */
#endif
#include <unistd.h>
+#include <fcntl.h>
#ifndef HAVE_MSG_NOSIGNAL
#include <signal.h>
#endif
+#ifndef PLATFORM_WIN32
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#define USE_AIO 1
+#elif defined(HAVE_SYS_AIO_H)
+#include <sys/aio.h>
+#define USE_AIO 1
+#else
+#undef USE_AIO
+#endif
+#endif
+
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/socket-private.h>
#include <mono/io-layer/handles-private.h>
+#include <mono/io-layer/socket-wrappers.h>
#undef DEBUG
@@ -58,12 +72,54 @@ static void socket_ops_init (void)
static void socket_close_private (gpointer handle)
{
+ struct _WapiHandlePrivate_socket *socket_private_handle;
+ gboolean ok;
+ int ret;
+
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": closing socket handle 0x%x",
+ g_message(G_GNUC_PRETTY_FUNCTION ": closing socket handle %p",
handle);
#endif
- closesocket(GPOINTER_TO_UINT (handle));
+ if(startup_count==0) {
+ WSASetLastError(WSANOTINITIALISED);
+ return;
+ }
+
+ ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
+ NULL, (gpointer *)&socket_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up socket handle %p", handle);
+ WSASetLastError(WSAENOTSOCK);
+ return;
+ }
+
+ g_ptr_array_remove_fast(sockets, GUINT_TO_POINTER (handle));
+
+ if (socket_private_handle->fd_mapped.assigned == TRUE) {
+ /* Blank out the mapping, to make catching errors easier */
+ _wapi_handle_fd_offset_store (socket_private_handle->fd_mapped.fd, NULL);
+
+ do {
+ ret=close(socket_private_handle->fd_mapped.fd);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
+ if(ret==-1) {
+ gint errnum = errno;
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": close error: %s",
+ strerror(errno));
+#endif
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
+
+ return;
+ }
+ } else {
+ WSASetLastError(WSAENOTSOCK);
+ }
}
int WSAStartup(guint32 requested, WapiWSAData *data)
@@ -129,13 +185,19 @@ int WSACleanup(void)
static void error_init(void)
{
- pthread_key_create(&error_key, NULL);
+ int ret;
+
+ ret = pthread_key_create(&error_key, NULL);
+ g_assert (ret == 0);
}
void WSASetLastError(int error)
{
+ int ret;
+
mono_once(&error_key_once, error_init);
- pthread_setspecific(error_key, GINT_TO_POINTER(error));
+ ret = pthread_setspecific(error_key, GINT_TO_POINTER(error));
+ g_assert (ret == 0);
}
int WSAGetLastError(void)
@@ -150,130 +212,67 @@ int WSAGetLastError(void)
return(err);
}
-int closesocket(guint32 handle)
+int closesocket(guint32 fd_handle)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
- int ret;
-
- if(startup_count==0) {
- WSASetLastError(WSANOTINITIALISED);
- return(SOCKET_ERROR);
- }
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd_handle));
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
- WSASetLastError(WSAENOTSOCK);
- return(SOCKET_ERROR);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ WSASetLastError (WSAENOTSOCK);
+ return(0);
}
- g_ptr_array_remove_fast(sockets, GUINT_TO_POINTER (handle));
-
- ret=close(socket_private_handle->fd);
- if(ret==-1) {
-#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": close error: %s",
- strerror(errno));
-#endif
-
- switch(errno) {
- case EBADF:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EINTR:
- WSASetLastError(WSAEINTR);
- break;
- case EIO:
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
-
- return(SOCKET_ERROR);
- }
- return(ret);
+ _wapi_handle_unref (handle);
+ return(0);
}
-guint32 _wapi_accept(guint32 handle, struct sockaddr *addr,
- socklen_t *addrlen)
+guint32 _wapi_accept(guint32 fd, struct sockaddr *addr, socklen_t *addrlen)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
struct _WapiHandlePrivate_socket *new_socket_private_handle;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
gpointer new_handle;
gboolean ok;
- int fd;
+ int new_fd;
+ int thr_ret;
+ guint32 ret = INVALID_SOCKET;
if(startup_count==0) {
WSASetLastError(WSANOTINITIALISED);
return(INVALID_SOCKET);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(INVALID_SOCKET);
}
- fd=accept(socket_private_handle->fd, addr, addrlen);
- if(fd==-1) {
+ do {
+ new_fd=accept(fd, addr, addrlen);
+ }
+ while (new_fd==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
+ if(new_fd==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": accept error: %s",
strerror(errno));
#endif
- switch(errno) {
-#if EAGAIN != EWOULDBLOCK
- case EAGAIN:
-#endif
- case EWOULDBLOCK:
- WSASetLastError(WSAEWOULDBLOCK);
- break;
- case EBADF:
- break;
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EOPNOTSUPP:
- WSASetLastError(WSAEOPNOTSUPP);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- case EPERM:
- WSASetLastError(WSAENETDOWN);
- break;
- case ENOBUFS:
- case ENOMEM:
- WSASetLastError(WSAENOBUFS);
- break;
- case EMFILE:
- WSASetLastError(WSAEMFILE);
- break;
- case EINVAL:
- WSASetLastError(WSAEINVAL);
- break;
-#ifdef ENOSR
- case ENOSR:
-#endif
- case ECONNABORTED:
- case ESOCKTNOSUPPORT:
- case EPROTONOSUPPORT:
- case ETIMEDOUT:
-#ifdef ERESTARTSYS
- case ERESTARTSYS:
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
+
+ return(INVALID_SOCKET);
+ }
+
+ if (new_fd >= _wapi_fd_offset_table_size) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
#endif
- WSASetLastError(WSAENETDOWN);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+
+ WSASetLastError (WSASYSCALLFAILURE);
+
+ close (new_fd);
return(INVALID_SOCKET);
}
@@ -282,177 +281,134 @@ guint32 _wapi_accept(guint32 handle, struct sockaddr *addr,
if(new_handle==_WAPI_HANDLE_INVALID) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error creating socket handle");
+ WSASetLastError (ERROR_GEN_FAILURE);
return(INVALID_SOCKET);
}
- _wapi_handle_lock_handle (new_handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ new_handle);
+ thr_ret = _wapi_handle_lock_handle (new_handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (new_handle, WAPI_HANDLE_SOCKET, NULL,
(gpointer *)&new_socket_private_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
- _wapi_handle_unlock_handle (new_handle);
- return(INVALID_SOCKET);
+ ": error looking up new socket handle %p",
+ new_handle);
+ goto cleanup;
}
+
+ _wapi_handle_fd_offset_store (new_fd, new_handle);
+ ret = new_fd;
- new_socket_private_handle->fd=fd;
+ new_socket_private_handle->fd_mapped.fd = new_fd;
+ new_socket_private_handle->fd_mapped.assigned = TRUE;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": returning newly accepted socket handle %p with fd %d",
- new_handle, new_socket_private_handle->fd);
+ new_handle, new_socket_private_handle->fd_mapped.fd);
#endif
- _wapi_handle_unlock_handle (new_handle);
-
- return(GPOINTER_TO_UINT (new_handle));
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (new_handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
}
-int _wapi_bind(guint32 handle, struct sockaddr *my_addr, socklen_t addrlen)
+int _wapi_bind(guint32 fd, struct sockaddr *my_addr, socklen_t addrlen)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
WSASetLastError(WSANOTINITIALISED);
return(SOCKET_ERROR);
}
-
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=bind(socket_private_handle->fd, my_addr, addrlen);
+ ret=bind(fd, my_addr, addrlen);
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": bind error: %s",
strerror(errno));
#endif
-
- switch(errno) {
- case EINVAL:
- WSASetLastError(WSAEINVAL);
- break;
- case EACCES:
- WSASetLastError(WSAEACCES);
- break;
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
-
- /* The following apply to Unix domain sockets */
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
-
- case EADDRINUSE:
- WSASetLastError(WSAEADDRINUSE);
- break;
-
- case EROFS:
- case ENAMETOOLONG:
- case ENOENT:
- case ENOMEM:
- case ENOTDIR:
- case ELOOP:
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
return(ret);
}
-int _wapi_connect(guint32 handle, const struct sockaddr *serv_addr,
+int _wapi_connect(guint32 fd, const struct sockaddr *serv_addr,
socklen_t addrlen)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
+ gint errnum;
if(startup_count==0) {
WSASetLastError(WSANOTINITIALISED);
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=connect(socket_private_handle->fd, serv_addr, addrlen);
+ do {
+ ret=connect(fd, serv_addr, addrlen);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
+ if(ret==-1 && errno==EACCES) {
+ /* Try setting SO_BROADCAST and connecting again, but
+ * keep the original errno
+ */
+ int true=1;
+
+ errnum = errno;
+
+ ret=setsockopt (fd, SOL_SOCKET, SO_BROADCAST, &true,
+ sizeof(true));
+ if(ret==0) {
+ do {
+ ret=connect (fd, serv_addr, addrlen);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+ }
+ } else if (ret==-1) {
+ errnum = errno;
+ }
+
if(ret==-1) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": bind error: %s",
- strerror(errno));
+ g_message(G_GNUC_PRETTY_FUNCTION ": connect error: %s",
+ strerror(errnum));
#endif
-
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- case EISCONN:
- WSASetLastError(WSAEISCONN);
- break;
- case ECONNREFUSED:
- WSASetLastError(WSAECONNREFUSED);
- break;
- case ETIMEDOUT:
- WSASetLastError(WSAETIMEDOUT);
- break;
- case ENETUNREACH:
- WSASetLastError(WSAENETUNREACH);
- break;
- case EADDRINUSE:
- WSASetLastError(WSAEADDRINUSE);
- break;
- case EINPROGRESS:
- WSASetLastError(WSAEINPROGRESS);
- break;
- case EALREADY:
- WSASetLastError(WSAEALREADY);
- break;
- case EAFNOSUPPORT:
- WSASetLastError(WSAEAFNOSUPPORT);
- break;
- case EACCES:
- case EPERM:
- WSASetLastError(WSAEACCES);
- break;
- case EAGAIN:
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
return(ret);
}
-int _wapi_getpeername(guint32 handle, struct sockaddr *name,
- socklen_t *namelen)
+int _wapi_getpeername(guint32 fd, struct sockaddr *name, socklen_t *namelen)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -460,41 +416,22 @@ int _wapi_getpeername(guint32 handle, struct sockaddr *name,
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=getpeername(socket_private_handle->fd, name, namelen);
+ ret=getpeername(fd, name, namelen);
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": getpeername error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case ENOTCONN:
- WSASetLastError(WSAENOTCONN);
- break;
- case ENOBUFS:
- /* not documented */
- WSASetLastError(WSAENOBUFS);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -502,11 +439,9 @@ int _wapi_getpeername(guint32 handle, struct sockaddr *name,
return(ret);
}
-int _wapi_getsockname(guint32 handle, struct sockaddr *name,
- socklen_t *namelen)
+int _wapi_getsockname(guint32 fd, struct sockaddr *name, socklen_t *namelen)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -514,38 +449,22 @@ int _wapi_getsockname(guint32 handle, struct sockaddr *name,
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=getsockname(socket_private_handle->fd, name, namelen);
+ ret=getsockname(fd, name, namelen);
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": getsockname error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case ENOBUFS:
- /* not documented */
- WSASetLastError(WSAENOBUFS);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -553,11 +472,10 @@ int _wapi_getsockname(guint32 handle, struct sockaddr *name,
return(ret);
}
-int _wapi_getsockopt(guint32 handle, int level, int optname, void *optval,
+int _wapi_getsockopt(guint32 fd, int level, int optname, void *optval,
socklen_t *optlen)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -565,38 +483,22 @@ int _wapi_getsockopt(guint32 handle, int level, int optname, void *optval,
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=getsockopt(socket_private_handle->fd, level, optname, optval,
- optlen);
+ ret=getsockopt(fd, level, optname, optval, optlen);
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": getsockopt error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case ENOPROTOOPT:
- WSASetLastError(WSAENOPROTOOPT);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -604,10 +506,9 @@ int _wapi_getsockopt(guint32 handle, int level, int optname, void *optval,
return(ret);
}
-int _wapi_listen(guint32 handle, int backlog)
+int _wapi_listen(guint32 fd, int backlog)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -615,37 +516,22 @@ int _wapi_listen(guint32 handle, int backlog)
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=listen(socket_private_handle->fd, backlog);
+ ret=listen(fd, backlog);
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": listen error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EADDRINUSE:
- WSASetLastError(WSAEADDRINUSE);
- break;
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EOPNOTSUPP:
- WSASetLastError(WSAEOPNOTSUPP);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -653,19 +539,18 @@ int _wapi_listen(guint32 handle, int backlog)
return(0);
}
-int _wapi_recv(guint32 handle, void *buf, size_t len, int recv_flags)
+int _wapi_recv(guint32 fd, void *buf, size_t len, int recv_flags)
{
- return(_wapi_recvfrom(handle, buf, len, recv_flags, NULL, 0));
+ return(_wapi_recvfrom(fd, buf, len, recv_flags, NULL, 0));
}
-int _wapi_recvfrom(guint32 handle, void *buf, size_t len, int recv_flags,
+int _wapi_recvfrom(guint32 fd, void *buf, size_t len, int recv_flags,
struct sockaddr *from, socklen_t *fromlen)
{
#ifndef HAVE_MSG_NOSIGNAL
void (*old_sigpipe)(int); // old SIGPIPE handler
#endif
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -673,72 +558,48 @@ int _wapi_recvfrom(guint32 handle, void *buf, size_t len, int recv_flags,
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
#ifdef HAVE_MSG_NOSIGNAL
- ret=recvfrom(socket_private_handle->fd, buf, len, recv_flags | MSG_NOSIGNAL, from,
- fromlen);
+ do {
+ ret=recvfrom(fd, buf, len, recv_flags | MSG_NOSIGNAL, from,
+ fromlen);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
#else
old_sigpipe = signal(SIGPIPE, SIG_IGN);
- ret=recvfrom(socket_private_handle->fd, buf, len, recv_flags, from,
- fromlen);
+ do {
+ ret=recvfrom(fd, buf, len, recv_flags, from, fromlen);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
signal(SIGPIPE, old_sigpipe);
#endif
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": recv error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case ECONNREFUSED:
- /* Not documented */
- WSASetLastError(WSAECONNREFUSED);
- break;
- case ENOTCONN:
- WSASetLastError(WSAENOTCONN);
- break;
- case EAGAIN:
- WSASetLastError(WSAEWOULDBLOCK);
- break;
- case EINTR:
- WSASetLastError(WSAEINTR);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- case EINVAL:
- WSASetLastError(WSAEINVAL);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
return(ret);
}
-int _wapi_send(guint32 handle, const void *msg, size_t len, int send_flags)
+int _wapi_send(guint32 fd, const void *msg, size_t len, int send_flags)
{
#ifndef HAVE_MSG_NOSIGNAL
void (*old_sigpipe)(int); // old SIGPIPE handler
#endif
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -746,76 +607,47 @@ int _wapi_send(guint32 handle, const void *msg, size_t len, int send_flags)
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
#ifdef HAVE_MSG_NOSIGNAL
- ret=send(socket_private_handle->fd, msg, len, send_flags | MSG_NOSIGNAL);
+ do {
+ ret=send(fd, msg, len, send_flags | MSG_NOSIGNAL);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
#else
old_sigpipe = signal(SIGPIPE, SIG_IGN);
- ret=send(socket_private_handle->fd, msg, len, send_flags);
+ do {
+ ret=send(fd, msg, len, send_flags);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
signal(SIGPIPE, old_sigpipe);
#endif
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": send error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- case EMSGSIZE:
- WSASetLastError(WSAEMSGSIZE);
- break;
-#if EAGAIN != EWOULDBLOCK
- case EAGAIN:
-#endif
- case EWOULDBLOCK:
- WSASetLastError(WSAEWOULDBLOCK);
- break;
- case ENOBUFS:
- WSASetLastError(WSAENOBUFS);
- break;
- case EINTR:
- WSASetLastError(WSAEINTR);
- break;
- case EINVAL:
- WSASetLastError(WSAEINVAL);
- break;
- case EPIPE:
- WSASetLastError(WSAESHUTDOWN);
- break;
- case ENOMEM:
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
return(ret);
}
-int _wapi_sendto(guint32 handle, const void *msg, size_t len, int send_flags,
+int _wapi_sendto(guint32 fd, const void *msg, size_t len, int send_flags,
const struct sockaddr *to, socklen_t tolen)
{
#ifndef HAVE_MSG_NOSIGNAL
void (*old_sigpipe)(int); // old SIGPIPE handler
#endif
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -823,73 +655,44 @@ int _wapi_sendto(guint32 handle, const void *msg, size_t len, int send_flags,
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
#ifdef HAVE_MSG_NOSIGNAL
- ret=sendto(socket_private_handle->fd, msg, len, send_flags | MSG_NOSIGNAL, to, tolen);
+ do {
+ ret=sendto(fd, msg, len, send_flags | MSG_NOSIGNAL, to, tolen);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
#else
old_sigpipe = signal(SIGPIPE, SIG_IGN);
- ret=sendto(socket_private_handle->fd, msg, len, send_flags, to, tolen);
+ do {
+ ret=sendto(fd, msg, len, send_flags, to, tolen);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
signal(SIGPIPE, old_sigpipe);
#endif
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": send error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- case EMSGSIZE:
- WSASetLastError(WSAEMSGSIZE);
- break;
-#if EAGAIN != EWOULDBLOCK
- case EAGAIN:
-#endif
- case EWOULDBLOCK:
- WSASetLastError(WSAEWOULDBLOCK);
- break;
- case ENOBUFS:
- WSASetLastError(WSAENOBUFS);
- break;
- case EINTR:
- WSASetLastError(WSAEINTR);
- break;
- case EINVAL:
- WSASetLastError(WSAEINVAL);
- break;
- case EPIPE:
- WSASetLastError(WSAESHUTDOWN);
- break;
- case ENOMEM:
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
return(ret);
}
-int _wapi_setsockopt(guint32 handle, int level, int optname,
+int _wapi_setsockopt(guint32 fd, int level, int optname,
const void *optval, socklen_t optlen)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -897,38 +700,22 @@ int _wapi_setsockopt(guint32 handle, int level, int optname,
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=setsockopt(socket_private_handle->fd, level, optname, optval,
- optlen);
+ ret=setsockopt(fd, level, optname, optval, optlen);
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": setsockopt error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case ENOPROTOOPT:
- WSASetLastError(WSAENOPROTOOPT);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -936,10 +723,9 @@ int _wapi_setsockopt(guint32 handle, int level, int optname,
return(ret);
}
-int _wapi_shutdown(guint32 handle, int how)
+int _wapi_shutdown(guint32 fd, int how)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -947,34 +733,22 @@ int _wapi_shutdown(guint32 handle, int how)
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
- ret=shutdown(socket_private_handle->fd, how);
+ ret=shutdown(fd, how);
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": shutdown error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- case ENOTSOCK:
- WSASetLastError(WSAENOTSOCK);
- break;
- case ENOTCONN:
- WSASetLastError(WSAENOTCONN);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -982,22 +756,44 @@ int _wapi_shutdown(guint32 handle, int how)
return(ret);
}
-guint32 _wapi_socket(int domain, int type, int protocol)
+guint32 _wapi_socket(int domain, int type, int protocol, void *unused, guint32 unused2, guint32 unused3)
{
struct _WapiHandlePrivate_socket *socket_private_handle;
gpointer handle;
gboolean ok;
int fd;
+ int thr_ret;
+ guint32 ret = INVALID_SOCKET;
fd=socket(domain, type, protocol);
- if(fd==-1) {
+ if (fd==-1 && domain == AF_INET && type == SOCK_RAW && protocol == 0) {
+ /* Retry with protocol == 4 (see bug #54565) */
+ fd = socket (AF_INET, SOCK_RAW, 4);
+ }
+
+ if (fd == -1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": socket error: %s", strerror(errno));
#endif
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
+
+ return(INVALID_SOCKET);
+ }
+
+ if (fd >= _wapi_fd_offset_table_size) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": File descriptor is too big");
+#endif
+ WSASetLastError (WSASYSCALLFAILURE);
+ close (fd);
+
return(INVALID_SOCKET);
}
+
mono_once (&socket_ops_once, socket_ops_init);
handle=_wapi_handle_new (WAPI_HANDLE_SOCKET);
@@ -1007,28 +803,37 @@ guint32 _wapi_socket(int domain, int type, int protocol)
return(INVALID_SOCKET);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_SOCKET, NULL,
(gpointer *)&socket_private_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up socket handle %p", handle);
- _wapi_handle_unlock_handle (handle);
- return(INVALID_SOCKET);
+ goto cleanup;
}
+
+ _wapi_handle_fd_offset_store (fd, handle);
+ ret = fd;
- socket_private_handle->fd=fd;
+ socket_private_handle->fd_mapped.fd = fd;
+ socket_private_handle->fd_mapped.assigned = TRUE;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": returning socket handle %p with fd %d", handle,
- socket_private_handle->fd);
+ socket_private_handle->fd_mapped.fd);
#endif
- _wapi_handle_unlock_handle (handle);
-
- return(GPOINTER_TO_UINT (handle));
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ return(ret);
}
struct hostent *_wapi_gethostbyname(const char *hostname)
@@ -1043,8 +848,8 @@ struct hostent *_wapi_gethostbyname(const char *hostname)
he=gethostbyname(hostname);
if(he==NULL) {
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": listen error: %s",
- strerror(errno));
+ g_message(G_GNUC_PRETTY_FUNCTION ": gethostbyname error: %s",
+ strerror(h_errno));
#endif
switch(h_errno) {
@@ -1064,7 +869,7 @@ struct hostent *_wapi_gethostbyname(const char *hostname)
WSASetLastError(WSATRY_AGAIN);
break;
default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
+ g_warning (G_GNUC_PRETTY_FUNCTION ": Need to translate %d into winsock error", h_errno);
break;
}
}
@@ -1072,10 +877,62 @@ struct hostent *_wapi_gethostbyname(const char *hostname)
return(he);
}
-int ioctlsocket(guint32 handle, gint32 command, gpointer arg)
+int
+WSAIoctl (guint32 fd, gint32 command,
+ gchar *input, gint i_len,
+ gchar *output, gint o_len, glong *written,
+ void *unused1, void *unused2)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
+ int ret;
+ gchar *buffer = NULL;
+
+ if(startup_count==0) {
+ WSASetLastError(WSANOTINITIALISED);
+ return(SOCKET_ERROR);
+ }
+
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ WSASetLastError (WSAENOTSOCK);
+ return SOCKET_ERROR;
+ }
+
+ if (i_len > 0)
+ buffer = g_memdup (input, i_len);
+
+ ret = ioctl (fd, command, buffer);
+ if (ret == -1) {
+ gint errnum = errno;
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": WSAIoctl error: %s",
+ strerror(errno));
+#endif
+
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
+ g_free (buffer);
+
+ return SOCKET_ERROR;
+ }
+
+ if (buffer == NULL) {
+ *written = 0;
+ } else {
+ /* We just copy the buffer to the output. Some ioctls
+ * don't even output any data, but, well... */
+ i_len = (i_len > o_len) ? o_len : i_len;
+ memcpy (output, buffer, i_len);
+ g_free (buffer);
+ *written = i_len;
+ }
+
+ return 0;
+}
+
+int ioctlsocket(guint32 fd, gint32 command, gpointer arg)
+{
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
int ret;
if(startup_count==0) {
@@ -1083,11 +940,8 @@ int ioctlsocket(guint32 handle, gint32 command, gpointer arg)
return(SOCKET_ERROR);
}
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(SOCKET_ERROR);
}
@@ -1102,27 +956,34 @@ int ioctlsocket(guint32 handle, gint32 command, gpointer arg)
return(SOCKET_ERROR);
}
- ret=ioctl(socket_private_handle->fd, command, arg);
+#ifdef O_NONBLOCK
+ /* This works better than ioctl(...FIONBIO...) on Linux (it causes
+ * connect to return EINPROGRESS, but the ioctl doesn't seem to)
+ */
+ if(command==FIONBIO) {
+ ret=fcntl(fd, F_GETFL, 0);
+ if(ret!=-1) {
+ if(*(gboolean *)arg) {
+ ret &= ~O_NONBLOCK;
+ } else {
+ ret |= O_NONBLOCK;
+ }
+ ret=fcntl(fd, F_SETFL, ret);
+ }
+ } else
+#endif /* O_NONBLOCK */
+ {
+ ret=ioctl(fd, command, arg);
+ }
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": ioctl error: %s",
strerror(errno));
#endif
- switch(errno) {
- case ENOTTY:
- case EBADF:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EFAULT:
- WSASetLastError(WSAEFAULT);
- break;
- case EINVAL:
- WSASetLastError(WSAEINVAL);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -1140,29 +1001,19 @@ int _wapi_select(int nfds G_GNUC_UNUSED, fd_set *readfds, fd_set *writefds,
return(SOCKET_ERROR);
}
- ret=select(getdtablesize(), readfds, writefds, exceptfds, timeout);
+ do {
+ ret=select(getdtablesize(), readfds, writefds, exceptfds, timeout);
+ }
+ while (ret==-1 && errno==EINTR && !_wapi_thread_cur_apc_pending());
+
if(ret==-1) {
+ gint errnum = errno;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": select error: %s",
strerror(errno));
#endif
- switch(errno) {
- case EBADF:
- WSASetLastError(WSAENOTSOCK);
- break;
- case EINTR:
- WSASetLastError(WSAEINTR);
- break;
- case EINVAL:
- WSASetLastError(WSAEINVAL);
- break;
- case ENOMEM:
- WSASetLastError(WSAEFAULT);
- break;
- default:
- g_warning(G_GNUC_PRETTY_FUNCTION ": Need to translate [%s] into winsock error", strerror(errno));
- break;
- }
+ errnum = errno_to_WSA (errnum, G_GNUC_PRETTY_FUNCTION);
+ WSASetLastError (errnum);
return(SOCKET_ERROR);
}
@@ -1170,54 +1021,149 @@ int _wapi_select(int nfds G_GNUC_UNUSED, fd_set *readfds, fd_set *writefds,
return(ret);
}
-void _wapi_FD_CLR(guint32 handle, fd_set *set)
+void _wapi_FD_CLR(guint32 fd, fd_set *set)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return;
}
- FD_CLR(socket_private_handle->fd, set);
+ FD_CLR(fd, set);
}
-int _wapi_FD_ISSET(guint32 handle, fd_set *set)
+int _wapi_FD_ISSET(guint32 fd, fd_set *set)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return(0);
}
- return(FD_ISSET(socket_private_handle->fd, set));
+ return(FD_ISSET(fd, set));
}
-void _wapi_FD_SET(guint32 handle, fd_set *set)
+void _wapi_FD_SET(guint32 fd, fd_set *set)
{
- struct _WapiHandlePrivate_socket *socket_private_handle;
- gboolean ok;
+ gpointer handle = _wapi_handle_fd_offset_to_handle (GUINT_TO_POINTER (fd));
- ok=_wapi_lookup_handle (GUINT_TO_POINTER (handle), WAPI_HANDLE_SOCKET,
- NULL, (gpointer *)&socket_private_handle);
- if(ok==FALSE) {
- g_warning (G_GNUC_PRETTY_FUNCTION
- ": error looking up socket handle 0x%x", handle);
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
WSASetLastError(WSAENOTSOCK);
return;
}
- FD_SET(socket_private_handle->fd, set);
+ FD_SET(fd, set);
+}
+
+#ifdef USE_AIO
+
+typedef struct {
+ struct aiocb *aio;
+ gpointer ares;
+ SocketAsyncCB callback;
+} notifier_data_t;
+
+#define SIGPTR(a) a.SIGVAL_PTR
+
+static void
+async_notifier (union sigval sig)
+{
+ notifier_data_t *ndata = SIGPTR (sig);
+ guint32 error;
+ guint32 numbytes;
+
+ error = aio_return (ndata->aio);
+ if (error < 0) {
+ error = _wapi_get_win32_file_error (error);
+ numbytes = 0;
+ } else {
+ numbytes = error;
+ error = 0;
+ }
+
+ ndata->callback (error, numbytes, ndata->ares);
+ g_free (ndata->aio);
+ g_free (ndata);
+}
+
+static gboolean
+do_aio_call (gboolean is_read, gpointer fd_handle, gpointer buffer,
+ guint32 numbytes, guint32 *out_bytes,
+ gpointer ares,
+ SocketAsyncCB callback)
+{
+ gpointer handle = _wapi_handle_fd_offset_to_handle (fd_handle);
+ int fd = GPOINTER_TO_UINT (fd_handle);
+ struct aiocb *aio;
+ int result;
+ notifier_data_t *ndata;
+
+ if (handle == NULL ||
+ _wapi_handle_type (handle) != WAPI_HANDLE_SOCKET) {
+ WSASetLastError (WSAENOTSOCK);
+ return FALSE;
+ }
+
+ ndata = g_new0 (notifier_data_t, 1);
+ aio = g_new0 (struct aiocb, 1);
+ ndata->ares = ares;
+ ndata->aio = aio;
+ ndata->callback = callback;
+
+ aio->aio_fildes = fd;
+ aio->aio_lio_opcode = (is_read) ? LIO_READ : LIO_WRITE;
+ aio->aio_nbytes = numbytes;
+ aio->aio_offset = 0;
+ aio->aio_buf = buffer;
+ aio->aio_sigevent.sigev_notify = SIGEV_THREAD;
+ aio->aio_sigevent.sigev_notify_function = async_notifier;
+ SIGPTR (aio->aio_sigevent.sigev_value) = ndata;
+
+ if (is_read) {
+ result = aio_read (aio);
+ } else {
+ result = aio_write (aio);
+ }
+
+ if (result == -1) {
+ WSASetLastError (errno_to_WSA (errno, "do_aio_call"));
+ return FALSE;
+ }
+
+ result = aio_error (aio);
+ if (result == 0) {
+ numbytes = aio_return (aio);
+ } else {
+ WSASetLastError (errno_to_WSA (result, "do_aio_call"));
+ return FALSE;
+ }
+
+ if (out_bytes)
+ *out_bytes = numbytes;
+
+ return TRUE;
+}
+
+gboolean _wapi_socket_async_read (gpointer handle, gpointer buffer,
+ guint32 numbytes,
+ guint32 *bytesread, gpointer ares,
+ SocketAsyncCB callback)
+{
+ return do_aio_call (TRUE, handle, buffer, numbytes, bytesread, ares, callback);
+}
+
+gboolean _wapi_socket_async_write (gpointer handle, gpointer buffer,
+ guint32 numbytes,
+ guint32 *byteswritten, gpointer ares,
+ SocketAsyncCB callback)
+{
+ return do_aio_call (FALSE, handle, buffer, numbytes, byteswritten, ares, callback);
}
+#endif /* USE_AIO */
+
diff --git a/mono/io-layer/sockets.h b/mono/io-layer/sockets.h
index 64f6db17898..19268c9b68b 100644
--- a/mono/io-layer/sockets.h
+++ b/mono/io-layer/sockets.h
@@ -10,7 +10,6 @@
#ifndef _WAPI_SOCKETS_H_
#define _WAPI_SOCKETS_H_
-#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
@@ -19,13 +18,6 @@
#include <netdb.h>
#include <arpa/inet.h>
-#ifdef HAVE_SYS_FILIO_H
-#include <sys/filio.h> /* defines FIONBIO and FIONREAD */
-#endif
-#ifdef HAVE_SYS_SOCKIO_H
-#include <sys/sockio.h> /* defines SIOCATMARK */
-#endif
-
#include "mono/io-layer/wapi.h"
#define WSADESCRIPTION_LEN 256
@@ -51,78 +43,24 @@ extern void WSASetLastError(int error);
extern int WSAGetLastError(void);
extern int closesocket(guint32 handle);
-#ifndef _WAPI_BUILDING
-#define accept _wapi_accept
-#define bind _wapi_bind
-#define connect _wapi_connect
-#define getpeername _wapi_getpeername
-#define getsockname _wapi_getsockname
-#define getsockopt _wapi_getsockopt
-#define listen _wapi_listen
-#define recv _wapi_recv
-#define recvfrom _wapi_recvfrom
-#define send _wapi_send
-#define sendto _wapi_sendto
-#define setsockopt _wapi_setsockopt
-#define shutdown _wapi_shutdown
-#define socket _wapi_socket
-#define gethostbyname _wapi_gethostbyname
-#define select _wapi_select
-
-#ifdef FD_CLR
-#undef FD_CLR
-#endif
-
-#ifdef FD_ISSET
-#undef FD_ISSET
-#endif
-
-#ifdef FD_SET
-#undef FD_SET
-#endif
-
-/* No need to wrap FD_ZERO because it doesnt involve file
- * descriptors
-*/
-#define FD_CLR _wapi_FD_CLR
-#define FD_ISSET _wapi_FD_ISSET
-#define FD_SET _wapi_FD_SET
-
-#endif /* _WAPI_BUILDING */
-
-extern guint32 _wapi_accept(guint32 handle, struct sockaddr *addr,
- socklen_t *addrlen);
-extern int _wapi_bind(guint32 handle, struct sockaddr *my_addr,
- socklen_t addrlen);
-extern int _wapi_connect(guint32 handle, const struct sockaddr *serv_addr,
- socklen_t addrlen);
-extern int _wapi_getpeername(guint32 handle, struct sockaddr *name,
- socklen_t *namelen);
-extern int _wapi_getsockname(guint32 handle, struct sockaddr *name,
- socklen_t *namelen);
-extern int _wapi_getsockopt(guint32 handle, int level, int optname,
- void *optval, socklen_t *optlen);
-extern int _wapi_listen(guint32 handle, int backlog);
-extern int _wapi_recv(guint32 handle, void *buf, size_t len, int recv_flags);
-extern int _wapi_recvfrom(guint32 handle, void *buf, size_t len,
- int recv_flags, struct sockaddr *from,
- socklen_t *fromlen);
-extern int _wapi_send(guint32 handle, const void *msg, size_t len,
- int send_flags);
-extern int _wapi_sendto(guint32 handle, const void *msg, size_t len,
- int send_flags, const struct sockaddr *to,
- socklen_t tolen);
-extern int _wapi_setsockopt(guint32 handle, int level, int optname,
- const void *optval, socklen_t optlen);
-extern int _wapi_shutdown(guint32 handle, int how);
-extern guint32 _wapi_socket(int domain, int type, int protocol);;
-extern struct hostent *_wapi_gethostbyname(const char *hostname);
-extern int _wapi_select(int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout);
-extern void _wapi_FD_CLR(guint32 handle, fd_set *set);
-extern int _wapi_FD_ISSET(guint32 handle, fd_set *set);
-extern void _wapi_FD_SET(guint32 handle, fd_set *set);
-
extern int ioctlsocket(guint32 handle, gint32 command, gpointer arg);
+extern int WSAIoctl (guint32 handle, gint32 command,
+ gchar *input, gint i_len,
+ gchar *output, gint o_len, glong *written,
+ void *unused1, void *unused2);
+
+#ifndef PLATFORM_WIN32
+typedef void (*SocketAsyncCB) (guint32 error, guint32 numbytes, gpointer ares);
+
+gboolean _wapi_socket_async_read (gpointer handle, gpointer buffer,
+ guint32 numbytes,
+ guint32 *bytesread, gpointer ares,
+ SocketAsyncCB callback);
+
+gboolean _wapi_socket_async_write (gpointer handle, gpointer buffer,
+ guint32 numbytes,
+ guint32 *bytesread, gpointer ares,
+ SocketAsyncCB callback);
+#endif
#endif /* _WAPI_SOCKETS_H_ */
diff --git a/mono/io-layer/status.h b/mono/io-layer/status.h
index 68c7c1c9422..ce183698550 100644
--- a/mono/io-layer/status.h
+++ b/mono/io-layer/status.h
@@ -11,35 +11,35 @@
#define _WAPI_STATUS_H_
typedef enum {
- STATUS_WAIT_0 = 0x00000000,
- STATUS_ABANDONED_WAIT_0 = 0x00000080,
- STATUS_USER_APC = 0x000000C0,
- STATUS_TIMEOUT = 0x00000102,
- STATUS_PENDING = 0x00000103,
- STATUS_SEGMENT_NOTIFICATION = 0x40000005,
- STATUS_GUARD_PAGE_VIOLATION = 0x80000001,
- STATUS_DATATYPE_MISALIGNMENT = 0x80000002,
- STATUS_BREAKPOINT = 0x80000003,
- STATUS_SINGLE_STEP = 0x80000004,
- STATUS_ACCESS_VIOLATION = 0xC0000005,
- STATUS_IN_PAGE_ERROR = 0xC0000006,
- STATUS_NO_MEMORY = 0xC0000017,
- STATUS_ILLEGAL_INSTRUCTION = 0xC000001D,
- STATUS_NONCONTINUABLE_EXCEPTION = 0xC0000025,
- STATUS_INVALID_DISPOSITION = 0xC0000026,
- STATUS_ARRAY_BOUNDS_EXCEEDED = 0xC000008C,
- STATUS_FLOAT_DENORMAL_OPERAND = 0xC000008D,
- STATUS_FLOAT_DIVIDE_BY_ZERO = 0xC000008E,
- STATUS_FLOAT_INEXACT_RESULT = 0xC000008F,
- STATUS_FLOAT_INVALID_OPERATION = 0xC0000090,
- STATUS_FLOAT_OVERFLOW = 0xC0000091,
- STATUS_FLOAT_STACK_CHECK = 0xC0000092,
- STATUS_FLOAT_UNDERFLOW = 0xC0000093,
- STATUS_INTEGER_DIVIDE_BY_ZERO = 0xC0000094,
- STATUS_INTEGER_UNDERFLOW = 0xC0000095,
- STATUS_PRIVILEGED_INSTRUCTION = 0xC0000096,
- STATUS_STACK_OVERFLOW = 0xC00000FD,
- STATUS_CONTROL_C_EXIT = 0xC000013A,
+ STATUS_WAIT_0 = (int) 0x00000000,
+ STATUS_ABANDONED_WAIT_0 = (int) 0x00000080,
+ STATUS_USER_APC = (int) 0x000000C0,
+ STATUS_TIMEOUT = (int) 0x00000102,
+ STATUS_PENDING = (int) 0x00000103,
+ STATUS_SEGMENT_NOTIFICATION = (int) 0x40000005,
+ STATUS_GUARD_PAGE_VIOLATION = (int) 0x80000001,
+ STATUS_DATATYPE_MISALIGNMENT = (int) 0x80000002,
+ STATUS_BREAKPOINT = (int) 0x80000003,
+ STATUS_SINGLE_STEP = (int) 0x80000004,
+ STATUS_ACCESS_VIOLATION = (int) 0xC0000005,
+ STATUS_IN_PAGE_ERROR = (int) 0xC0000006,
+ STATUS_NO_MEMORY = (int) 0xC0000017,
+ STATUS_ILLEGAL_INSTRUCTION = (int) 0xC000001D,
+ STATUS_NONCONTINUABLE_EXCEPTION = (int) 0xC0000025,
+ STATUS_INVALID_DISPOSITION = (int) 0xC0000026,
+ STATUS_ARRAY_BOUNDS_EXCEEDED = (int) 0xC000008C,
+ STATUS_FLOAT_DENORMAL_OPERAND = (int) 0xC000008D,
+ STATUS_FLOAT_DIVIDE_BY_ZERO = (int) 0xC000008E,
+ STATUS_FLOAT_INEXACT_RESULT = (int) 0xC000008F,
+ STATUS_FLOAT_INVALID_OPERATION = (int) 0xC0000090,
+ STATUS_FLOAT_OVERFLOW = (int) 0xC0000091,
+ STATUS_FLOAT_STACK_CHECK = (int) 0xC0000092,
+ STATUS_FLOAT_UNDERFLOW = (int) 0xC0000093,
+ STATUS_INTEGER_DIVIDE_BY_ZERO = (int) 0xC0000094,
+ STATUS_INTEGER_UNDERFLOW = (int) 0xC0000095,
+ STATUS_PRIVILEGED_INSTRUCTION = (int) 0xC0000096,
+ STATUS_STACK_OVERFLOW = (int) 0xC00000FD,
+ STATUS_CONTROL_C_EXIT = (int) 0xC000013A
} WapiStatus;
#endif /* _WAPI_STATUS_H_ */
diff --git a/mono/io-layer/system.c b/mono/io-layer/system.c
index 1cedb180644..3a336ce2cef 100644
--- a/mono/io-layer/system.c
+++ b/mono/io-layer/system.c
@@ -20,7 +20,13 @@ void GetSystemInfo(WapiSystemInfo *info)
info->dwPageSize=getpagesize();
/* Fill in the rest of this junk. Maybe with libgtop */
- info->dwNumberOfProcessors=1;
+#ifdef _SC_NPROCESSORS_ONLN
+ info->dwNumberOfProcessors = sysconf (_SC_NPROCESSORS_ONLN);
+ if (info->dwNumberOfProcessors <= 0)
+ info->dwNumberOfProcessors = 1;
+#else
+ info->dwNumberOfProcessors = 1;
+#endif
}
diff --git a/mono/io-layer/system.h b/mono/io-layer/system.h
index 847114a246a..761ec26a3d5 100644
--- a/mono/io-layer/system.h
+++ b/mono/io-layer/system.h
@@ -23,8 +23,8 @@ struct _WapiSystemInfo
{
guint16 wProcessorArchitecture;
guint16 wReserved;
- };
- };
+ } _anon_struct;
+ } _anon_union;
guint32 dwPageSize;
gpointer lpMinimumApplicationAddress;
diff --git a/mono/io-layer/thread-private.h b/mono/io-layer/thread-private.h
index 533d6b0513b..93a38f21d52 100644
--- a/mono/io-layer/thread-private.h
+++ b/mono/io-layer/thread-private.h
@@ -19,7 +19,7 @@ extern struct _WapiHandleOps _wapi_thread_ops;
typedef enum {
THREAD_STATE_START,
- THREAD_STATE_EXITED,
+ THREAD_STATE_EXITED
} WapiThreadState;
struct _WapiHandle_thread
@@ -35,4 +35,9 @@ struct _WapiHandlePrivate_thread
gboolean joined;
};
+gboolean _wapi_thread_apc_pending (gpointer handle);
+gboolean _wapi_thread_cur_apc_pending (void);
+gboolean _wapi_thread_dispatch_apc_queue (gpointer handle);
+
+
#endif /* _WAPI_THREAD_PRIVATE_H_ */
diff --git a/mono/io-layer/threads.c b/mono/io-layer/threads.c
index 327c2fc92c4..e5e8fbaf3df 100644
--- a/mono/io-layer/threads.c
+++ b/mono/io-layer/threads.c
@@ -9,15 +9,19 @@
#include <config.h>
#if HAVE_BOEHM_GC
-#include <gc/gc.h>
+#include <mono/os/gc_wrapper.h>
#include "mono/utils/mono-hash.h"
#endif
+#include <stdio.h>
#include <glib.h>
#include <string.h>
#include <pthread.h>
+#include <signal.h>
#include <sched.h>
#include <sys/time.h>
#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/wapi-private.h>
@@ -26,10 +30,17 @@
#include <mono/io-layer/misc-private.h>
#include <mono/io-layer/mono-mutex.h>
#include <mono/io-layer/thread-private.h>
+#include <mono/io-layer/mono-spinlock.h>
+#include <mono/io-layer/mutex-private.h>
+
+#if HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
#undef DEBUG
#undef TLS_DEBUG
+
/* Hash threads with tids. I thought of using TLS for this, but that
* would have to set the data in the new thread, which is more hassle
*/
@@ -54,10 +65,18 @@ struct _WapiHandleOps _wapi_thread_ops = {
static mono_once_t thread_ops_once=MONO_ONCE_INIT;
+#ifdef WITH_INCLUDED_LIBGC
+static void gc_init (void);
+#endif
+
static void thread_ops_init (void)
{
_wapi_handle_register_capabilities (WAPI_HANDLE_THREAD,
WAPI_HANDLE_CAP_WAIT);
+
+#ifdef WITH_INCLUDED_LIBGC
+ gc_init ();
+#endif
}
static void thread_close_private (gpointer handle)
@@ -65,7 +84,7 @@ static void thread_close_private (gpointer handle)
struct _WapiHandlePrivate_thread *thread_handle;
gboolean ok;
- ok=_wapi_lookup_handle (handle, WAPI_HANDLE_UNUSED, NULL,
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD, NULL,
(gpointer *)&thread_handle);
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
@@ -80,9 +99,7 @@ static void thread_close_private (gpointer handle)
thread_handle->thread->id);
#endif
- if(thread_handle->thread!=NULL) {
- _wapi_timed_thread_destroy (thread_handle->thread);
- }
+ thread_handle->thread=NULL;
}
static void thread_own (gpointer handle)
@@ -112,6 +129,7 @@ static void thread_exit(guint32 exitstatus, gpointer handle)
struct _WapiHandle_thread *thread_handle;
struct _WapiHandlePrivate_thread *thread_private_handle;
gboolean ok;
+ int thr_ret;
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
(gpointer *)&thread_handle,
@@ -121,8 +139,14 @@ static void thread_exit(guint32 exitstatus, gpointer handle)
": error looking up thread handle %p", handle);
return;
}
+
+ _wapi_mutex_check_abandoned (getpid (),
+ thread_private_handle->thread->id);
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
@@ -133,7 +157,9 @@ static void thread_exit(guint32 exitstatus, gpointer handle)
thread_handle->state=THREAD_STATE_EXITED;
_wapi_handle_set_signal_state (handle, TRUE, TRUE);
- _wapi_handle_unlock_handle (handle);
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
@@ -142,9 +168,16 @@ static void thread_exit(guint32 exitstatus, gpointer handle)
#endif
/* Remove this thread from the hash */
- mono_mutex_lock(&thread_hash_mutex);
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&thread_hash_mutex);
+ thr_ret = mono_mutex_lock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+
g_hash_table_remove(thread_hash, &thread_private_handle->thread->id);
- mono_mutex_unlock(&thread_hash_mutex);
+
+ thr_ret = mono_mutex_unlock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
/* The thread is no longer active, so unref it */
_wapi_handle_unref (handle);
@@ -171,15 +204,19 @@ static void thread_hash_init(void)
*
* Return value: a new handle, or NULL
*/
-gpointer CreateThread(WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 stacksize G_GNUC_UNUSED,
- WapiThreadStart start, gpointer param, guint32 create G_GNUC_UNUSED,
+gpointer CreateThread(WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 stacksize,
+ WapiThreadStart start, gpointer param, guint32 create,
guint32 *tid)
{
struct _WapiHandle_thread *thread_handle;
struct _WapiHandlePrivate_thread *thread_private_handle;
+ pthread_attr_t attr;
gpointer handle;
gboolean ok;
int ret;
+ int thr_ret;
+ int i, unrefs = 0;
+ gpointer ct_ret = NULL;
mono_once(&thread_hash_once, thread_hash_init);
mono_once (&thread_ops_once, thread_ops_init);
@@ -195,7 +232,10 @@ gpointer CreateThread(WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 st
return(NULL);
}
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
(gpointer *)&thread_handle,
@@ -203,8 +243,7 @@ gpointer CreateThread(WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 st
if(ok==FALSE) {
g_warning (G_GNUC_PRETTY_FUNCTION
": error looking up thread handle %p", handle);
- _wapi_handle_unlock_handle (handle);
- return(NULL);
+ goto cleanup;
}
/* Hold a reference while the thread is active, because we use
@@ -217,27 +256,53 @@ gpointer CreateThread(WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 st
/* Lock around the thread create, so that the new thread cant
* race us to look up the thread handle in GetCurrentThread()
*/
- mono_mutex_lock(&thread_hash_mutex);
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&thread_hash_mutex);
+ thr_ret = mono_mutex_lock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+
+ /* Set a 2M stack size. This is the default on Linux, but BSD
+ * needs it. (The original bug report from Martin Dvorak <md@9ll.cz>
+ * set the size to 2M-4k. I don't know why it's short by 4k, so
+ * I'm leaving it as 2M until I'm told differently.)
+ */
+ thr_ret = pthread_attr_init(&attr);
+ g_assert (thr_ret == 0);
- ret=_wapi_timed_thread_create(&thread_private_handle->thread, NULL,
- start, thread_exit, param, handle);
+ /* defaults of 2Mb for 32bits and 4Mb for 64bits */
+ if (stacksize == 0){
+#if HAVE_VALGRIND_MEMCHECK_H
+ if (RUNNING_ON_VALGRIND)
+ stacksize = 1 << 20;
+ else
+ stacksize = (SIZEOF_VOID_P / 2) * 1024 * 1024;
+#else
+ stacksize = (SIZEOF_VOID_P / 2) * 1024 * 1024;
+#endif
+
+ }
+
+#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
+ thr_ret = pthread_attr_setstacksize(&attr, stacksize);
+ g_assert (thr_ret == 0);
+#endif
+
+ ret=_wapi_timed_thread_create(&thread_private_handle->thread, &attr,
+ create, start, thread_exit, param,
+ handle);
if(ret!=0) {
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Thread create error: %s",
strerror(ret));
#endif
- mono_mutex_unlock(&thread_hash_mutex);
- _wapi_handle_unlock_handle (handle);
- _wapi_handle_unref (handle);
-
- /* And again, because of the reference we took above */
- _wapi_handle_unref (handle);
- return(NULL);
+ /* Two, because of the reference we took above */
+ unrefs = 2;
+ goto thread_hash_cleanup;
}
-
+ ct_ret = handle;
+
g_hash_table_insert(thread_hash, &thread_private_handle->thread->id,
handle);
- mono_mutex_unlock(&thread_hash_mutex);
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
@@ -247,12 +312,65 @@ gpointer CreateThread(WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 st
#endif
if(tid!=NULL) {
+#ifdef PTHREAD_POINTER_ID
+ *tid=GPOINTER_TO_UINT(thread_private_handle->thread->id);
+#else
*tid=thread_private_handle->thread->id;
+#endif
}
- _wapi_handle_unlock_handle (handle);
+thread_hash_cleanup:
+ thr_ret = mono_mutex_unlock (&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ /* Must not call _wapi_handle_unref() with the handle already
+ * locked
+ */
+ for (i = 0; i < unrefs; i++) {
+ _wapi_handle_unref (handle);
+ }
+
+ return(ct_ret);
+}
+
+gpointer OpenThread (guint32 access G_GNUC_UNUSED, gboolean inherit G_GNUC_UNUSED, guint32 tid)
+{
+ gpointer ret=NULL;
+ int thr_ret;
+
+ mono_once(&thread_hash_once, thread_hash_init);
+ mono_once (&thread_ops_once, thread_ops_init);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": looking up thread %d", tid);
+#endif
+
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&thread_hash_mutex);
+ thr_ret = mono_mutex_lock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+
+ ret=g_hash_table_lookup(thread_hash, &tid);
+
+ thr_ret = mono_mutex_unlock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
- return(handle);
+ if(ret!=NULL) {
+ _wapi_handle_ref (ret);
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": returning thread handle %p", ret);
+#endif
+
+ return(ret);
}
/**
@@ -335,7 +453,113 @@ guint32 GetCurrentThreadId(void)
{
pthread_t tid=pthread_self();
+#ifdef PTHREAD_POINTER_ID
+ return(GPOINTER_TO_UINT(tid));
+#else
return(tid);
+#endif
+}
+
+static gpointer thread_attach(guint32 *tid)
+{
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gpointer handle;
+ gboolean ok;
+ int ret;
+ int thr_ret;
+ int i, unrefs = 0;
+ gpointer ta_ret = NULL;
+
+ mono_once(&thread_hash_once, thread_hash_init);
+ mono_once (&thread_ops_once, thread_ops_init);
+
+ handle=_wapi_handle_new (WAPI_HANDLE_THREAD);
+ if(handle==_WAPI_HANDLE_INVALID) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error creating thread handle");
+ return(NULL);
+ }
+
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ goto cleanup;
+ }
+
+ /* Hold a reference while the thread is active, because we use
+ * the handle to store thread exit information
+ */
+ _wapi_handle_ref (handle);
+
+ thread_handle->state=THREAD_STATE_START;
+
+ /* Lock around the thread create, so that the new thread cant
+ * race us to look up the thread handle in GetCurrentThread()
+ */
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&thread_hash_mutex);
+ thr_ret = mono_mutex_lock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+
+ ret=_wapi_timed_thread_attach(&thread_private_handle->thread,
+ thread_exit, handle);
+ if(ret!=0) {
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": Thread attach error: %s",
+ strerror(ret));
+#endif
+ /* Two, because of the reference we took above */
+ unrefs = 2;
+
+ goto thread_hash_cleanup;
+ }
+ ta_ret = handle;
+
+ g_hash_table_insert(thread_hash, &thread_private_handle->thread->id,
+ handle);
+
+#ifdef DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": Attached thread handle %p thread %p ID %ld", handle,
+ thread_private_handle->thread,
+ thread_private_handle->thread->id);
+#endif
+
+ if(tid!=NULL) {
+#ifdef PTHREAD_POINTER_ID
+ *tid=GPOINTER_TO_UINT(thread_private_handle->thread->id);
+#else
+ *tid=thread_private_handle->thread->id;
+#endif
+ }
+
+thread_hash_cleanup:
+ thr_ret = mono_mutex_unlock (&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+cleanup:
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ /* Must not call _wapi_handle_unref() with the handle already
+ * locked
+ */
+ for (i = 0; i < unrefs; i++) {
+ _wapi_handle_unref (handle);
+ }
+
+ return(ta_ret);
}
/**
@@ -353,15 +577,28 @@ gpointer GetCurrentThread(void)
{
gpointer ret=NULL;
guint32 tid;
+ int thr_ret;
+
+ mono_once(&thread_hash_once, thread_hash_init);
+ mono_once (&thread_ops_once, thread_ops_init);
tid=GetCurrentThreadId();
- mono_mutex_lock(&thread_hash_mutex);
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&thread_hash_mutex);
+ thr_ret = mono_mutex_lock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
ret=g_hash_table_lookup(thread_hash, &tid);
+
+ thr_ret = mono_mutex_unlock(&thread_hash_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
- mono_mutex_unlock(&thread_hash_mutex);
-
+ if (!ret) {
+ ret = thread_attach (NULL);
+ }
+
return(ret);
}
@@ -374,9 +611,38 @@ gpointer GetCurrentThread(void)
*
* Return value: the previous suspend count, or 0xFFFFFFFF on error.
*/
-guint32 ResumeThread(gpointer handle G_GNUC_UNUSED)
+guint32 ResumeThread(gpointer handle)
{
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gboolean ok;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ return(0xFFFFFFFF);
+ }
+
+ if (thread_private_handle->thread == NULL) {
+ return(0xFFFFFFFF);
+ }
+
+#ifdef WITH_INCLUDED_LIBGC
+ if (thread_private_handle->thread->suspend_count <= 1)
+ _wapi_timed_thread_resume (thread_private_handle->thread);
+
+ return --thread_private_handle->thread->suspend_count;
+#else
+ /* This is still a kludge that only copes with starting a
+ * thread that was suspended on create, so don't bother with
+ * the suspend count crap yet
+ */
+ _wapi_timed_thread_resume (thread_private_handle->thread);
return(0xFFFFFFFF);
+#endif
}
/**
@@ -388,9 +654,45 @@ guint32 ResumeThread(gpointer handle G_GNUC_UNUSED)
*
* Return value: the previous suspend count, or 0xFFFFFFFF on error.
*/
-guint32 SuspendThread(gpointer handle G_GNUC_UNUSED)
+guint32 SuspendThread(gpointer handle)
{
+#ifdef WITH_INCLUDED_LIBGC
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gpointer current;
+ gboolean ok;
+
+ current = GetCurrentThread ();
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ return(0xFFFFFFFF);
+ }
+
+ if (thread_private_handle->thread == NULL) {
+ return(0xFFFFFFFF);
+ }
+
+ if (!thread_private_handle->thread->suspend_count) {
+ if (handle == current)
+ _wapi_timed_thread_suspend (thread_private_handle->thread);
+ else {
+ pthread_kill (thread_private_handle->thread->id, SIGPWR);
+ while (MONO_SEM_WAIT (&thread_private_handle->thread->suspended_sem) != 0) {
+ if (errno != EINTR) {
+ return(0xFFFFFFFF);
+ }
+ }
+ }
+ }
+
+ return thread_private_handle->thread->suspend_count++;
+#else
return(0xFFFFFFFF);
+#endif
}
/*
@@ -405,7 +707,7 @@ guint32 SuspendThread(gpointer handle G_GNUC_UNUSED)
static pthread_key_t TLS_keys[TLS_MINIMUM_AVAILABLE];
static gboolean TLS_used[TLS_MINIMUM_AVAILABLE]={FALSE};
-static mono_mutex_t TLS_mutex=MONO_MUTEX_INITIALIZER;
+static guint32 TLS_spinlock=0;
/**
* TlsAlloc:
@@ -420,15 +722,17 @@ static mono_mutex_t TLS_mutex=MONO_MUTEX_INITIALIZER;
guint32 TlsAlloc(void)
{
guint32 i;
+ int thr_ret;
- mono_mutex_lock(&TLS_mutex);
+ MONO_SPIN_LOCK (TLS_spinlock);
for(i=0; i<TLS_MINIMUM_AVAILABLE; i++) {
if(TLS_used[i]==FALSE) {
TLS_used[i]=TRUE;
- pthread_key_create(&TLS_keys[i], NULL);
+ thr_ret = pthread_key_create(&TLS_keys[i], NULL);
+ g_assert (thr_ret == 0);
- mono_mutex_unlock(&TLS_mutex);
+ MONO_SPIN_UNLOCK (TLS_spinlock);
#ifdef TLS_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": returning key %d",
@@ -439,7 +743,7 @@ guint32 TlsAlloc(void)
}
}
- mono_mutex_unlock(&TLS_mutex);
+ MONO_SPIN_UNLOCK (TLS_spinlock);
#ifdef TLS_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": out of indices");
@@ -462,24 +766,29 @@ guint32 TlsAlloc(void)
*/
gboolean TlsFree(guint32 idx)
{
+ int thr_ret;
+
#ifdef TLS_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": freeing key %d", idx);
#endif
- mono_mutex_lock(&TLS_mutex);
+ MONO_SPIN_LOCK (TLS_spinlock);
if(TLS_used[idx]==FALSE) {
- mono_mutex_unlock(&TLS_mutex);
+ MONO_SPIN_UNLOCK (TLS_spinlock);
+
return(FALSE);
}
TLS_used[idx]=FALSE;
- pthread_key_delete(TLS_keys[idx]);
+ thr_ret = pthread_key_delete(TLS_keys[idx]);
+ g_assert (thr_ret == 0);
#if HAVE_BOEHM_GC
mono_g_hash_table_remove (tls_gc_hash, MAKE_GC_ID (idx));
#endif
- mono_mutex_unlock(&TLS_mutex);
+
+ MONO_SPIN_UNLOCK (TLS_spinlock);
return(TRUE);
}
@@ -501,17 +810,6 @@ gpointer TlsGetValue(guint32 idx)
#ifdef TLS_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": looking up key %d", idx);
#endif
-
- mono_mutex_lock(&TLS_mutex);
-
- if(TLS_used[idx]==FALSE) {
-#ifdef TLS_DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": key %d unused", idx);
-#endif
-
- mono_mutex_unlock(&TLS_mutex);
- return(NULL);
- }
ret=pthread_getspecific(TLS_keys[idx]);
@@ -519,8 +817,6 @@ gpointer TlsGetValue(guint32 idx)
g_message (G_GNUC_PRETTY_FUNCTION ": returning %p", ret);
#endif
- mono_mutex_unlock(&TLS_mutex);
-
return(ret);
}
@@ -542,14 +838,15 @@ gboolean TlsSetValue(guint32 idx, gpointer value)
value);
#endif
- mono_mutex_lock(&TLS_mutex);
+ MONO_SPIN_LOCK (TLS_spinlock);
if(TLS_used[idx]==FALSE) {
#ifdef TLS_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": key %d unused", idx);
#endif
- mono_mutex_unlock(&TLS_mutex);
+ MONO_SPIN_UNLOCK (TLS_spinlock);
+
return(FALSE);
}
@@ -560,51 +857,72 @@ gboolean TlsSetValue(guint32 idx, gpointer value)
": pthread_setspecific error: %s", strerror (ret));
#endif
- mono_mutex_unlock(&TLS_mutex);
+ MONO_SPIN_UNLOCK (TLS_spinlock);
+
return(FALSE);
}
#if HAVE_BOEHM_GC
- if (!tls_gc_hash)
+ if (!tls_gc_hash) {
+ MONO_GC_REGISTER_ROOT (tls_gc_hash);
tls_gc_hash = mono_g_hash_table_new(g_direct_hash, g_direct_equal);
+ }
mono_g_hash_table_insert (tls_gc_hash, MAKE_GC_ID (idx), value);
#endif
- mono_mutex_unlock(&TLS_mutex);
+
+ MONO_SPIN_UNLOCK (TLS_spinlock);
return(TRUE);
}
/**
- * Sleep:
+ * SleepEx:
* @ms: The time in milliseconds to suspend for
+ * @alertable: if TRUE, the wait can be interrupted by an APC call
*
* Suspends execution of the current thread for @ms milliseconds. A
* value of zero causes the thread to relinquish its time slice. A
* value of %INFINITE causes an infinite delay.
*/
-void Sleep(guint32 ms)
+guint32 SleepEx(guint32 ms, gboolean alertable)
{
struct timespec req, rem;
- div_t divvy;
+ int ms_quot, ms_rem;
int ret;
+ gpointer current_thread = NULL;
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Sleeping for %d ms", ms);
#endif
+ if (alertable) {
+ current_thread = GetCurrentThread ();
+ if (_wapi_thread_apc_pending (current_thread)) {
+ _wapi_thread_dispatch_apc_queue (current_thread);
+ return WAIT_IO_COMPLETION;
+ }
+ }
+
if(ms==0) {
sched_yield();
- return;
+ return 0;
}
/* FIXME: check for INFINITE and sleep forever */
- divvy=div((int)ms, 1000);
+ ms_quot = ms / 1000;
+ ms_rem = ms % 1000;
- req.tv_sec=divvy.quot;
- req.tv_nsec=divvy.rem*1000000;
+ req.tv_sec=ms_quot;
+ req.tv_nsec=ms_rem*1000000;
again:
ret=nanosleep(&req, &rem);
+
+ if (alertable && _wapi_thread_apc_pending (current_thread)) {
+ _wapi_thread_dispatch_apc_queue (current_thread);
+ return WAIT_IO_COMPLETION;
+ }
+
if(ret==-1) {
/* Sleep interrupted with rem time remaining */
#ifdef DEBUG
@@ -616,14 +934,146 @@ again:
req=rem;
goto again;
}
+
+ return 0;
}
-/* FIXME: implement alertable */
-void SleepEx(guint32 ms, gboolean alertable)
+void Sleep(guint32 ms)
{
- if(alertable==TRUE) {
- g_warning(G_GNUC_PRETTY_FUNCTION ": alertable not implemented");
- }
+ SleepEx(ms, FALSE);
+}
+
+gboolean
+BindIoCompletionCallback (gpointer handle,
+ WapiOverlappedCB callback,
+ guint64 flags)
+{
+ WapiHandleType type;
- Sleep(ms);
+ type = _wapi_handle_type (handle);
+ if (type == WAPI_HANDLE_FILE || type == WAPI_HANDLE_PIPE)
+ return _wapi_io_add_callback (handle, callback, flags);
+
+ SetLastError (ERROR_NOT_SUPPORTED);
+ return FALSE;
+}
+
+guint32 QueueUserAPC (WapiApcProc apc_callback, gpointer handle,
+ gpointer param)
+{
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gboolean ok;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ return(0);
+ }
+
+ _wapi_timed_thread_queue_apc (thread_private_handle->thread,
+ apc_callback, param);
+ return(1);
}
+
+gboolean _wapi_thread_cur_apc_pending (void)
+{
+ return _wapi_thread_apc_pending (GetCurrentThread ());
+}
+
+gboolean _wapi_thread_apc_pending (gpointer handle)
+{
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gboolean ok;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ return(FALSE);
+ }
+
+ return _wapi_timed_thread_apc_pending (thread_private_handle->thread);
+}
+
+gboolean _wapi_thread_dispatch_apc_queue (gpointer handle)
+{
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gboolean ok;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ return(0);
+ }
+
+ _wapi_timed_thread_dispatch_apc_queue (thread_private_handle->thread);
+ return(1);
+}
+
+
+
+#ifdef WITH_INCLUDED_LIBGC
+
+static void GC_suspend_handler (int sig)
+{
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gpointer handle;
+ gboolean ok;
+
+ handle = GetCurrentThread ();
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ return;
+ }
+
+ thread_private_handle->thread->stack_ptr = &ok;
+ MONO_SEM_POST (&thread_private_handle->thread->suspended_sem);
+
+ _wapi_timed_thread_suspend (thread_private_handle->thread);
+
+ thread_private_handle->thread->stack_ptr = NULL;
+}
+
+static void gc_init (void)
+{
+ struct sigaction act;
+
+ act.sa_handler = GC_suspend_handler;
+ g_assert (sigaction (SIGPWR, &act, NULL) == 0);
+}
+
+void mono_wapi_push_thread_stack (gpointer handle, gpointer stack_ptr)
+{
+ struct _WapiHandle_thread *thread_handle;
+ struct _WapiHandlePrivate_thread *thread_private_handle;
+ gboolean ok;
+
+ ok=_wapi_lookup_handle (handle, WAPI_HANDLE_THREAD,
+ (gpointer *)&thread_handle,
+ (gpointer *)&thread_private_handle);
+ if(ok==FALSE) {
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": error looking up thread handle %p", handle);
+ return;
+ }
+
+ GC_push_all_stack (thread_private_handle->thread->stack_ptr, stack_ptr);
+}
+
+#endif /* WITH_INCLUDED_LIBGC */
diff --git a/mono/io-layer/threads.h b/mono/io-layer/threads.h
index 83da7b8ac6c..e074463af13 100644
--- a/mono/io-layer/threads.h
+++ b/mono/io-layer/threads.h
@@ -12,10 +12,11 @@
#include <glib.h>
-#include "mono/io-layer/handles.h"
-#include "mono/io-layer/io.h"
-#include "mono/io-layer/status.h"
-#include "mono/io-layer/processes.h"
+#include <mono/io-layer/handles.h>
+#include <mono/io-layer/io.h>
+#include <mono/io-layer/status.h>
+#include <mono/io-layer/processes.h>
+#include <mono/io-layer/access.h>
#define TLS_MINIMUM_AVAILABLE 64
#define TLS_OUT_OF_INDEXES 0xFFFFFFFF
@@ -23,11 +24,24 @@
#define STILL_ACTIVE STATUS_PENDING
+#define THREAD_TERMINATE 0x0001
+#define THREAD_SUSPEND_RESUME 0x0002
+#define THREAD_GET_CONTEXT 0x0008
+#define THREAD_SET_CONTEXT 0x0010
+#define THREAD_SET_INFORMATION 0x0020
+#define THREAD_QUERY_INFORMATION 0x0040
+#define THREAD_SET_THREAD_TOKEN 0x0080
+#define THREAD_IMPERSONATE 0x0100
+#define THREAD_DIRECT_IMPERSONATION 0x0200
+#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
+
typedef guint32 (*WapiThreadStart)(gpointer);
+typedef guint32 (*WapiApcProc)(gpointer);
extern gpointer CreateThread(WapiSecurityAttributes *security,
guint32 stacksize, WapiThreadStart start,
gpointer param, guint32 create, guint32 *tid);
+extern gpointer OpenThread (guint32 access, gboolean inherit, guint32 tid);
extern void ExitThread(guint32 exitcode) G_GNUC_NORETURN;
extern gboolean GetExitCodeThread(gpointer handle, guint32 *exitcode);
extern guint32 GetCurrentThreadId(void);
@@ -39,6 +53,12 @@ extern gboolean TlsFree(guint32 idx);
extern gpointer TlsGetValue(guint32 idx);
extern gboolean TlsSetValue(guint32 idx, gpointer value);
extern void Sleep(guint32 ms);
-extern void SleepEx(guint32 ms, gboolean);
+extern guint32 SleepEx(guint32 ms, gboolean alertable);
+extern gboolean BindIoCompletionCallback (gpointer handle,
+ WapiOverlappedCB callback,
+ guint64 flags);
+
+extern guint32 QueueUserAPC (WapiApcProc apc_callback, gpointer thread_handle,
+ gpointer param);
#endif /* _WAPI_THREADS_H_ */
diff --git a/mono/io-layer/timed-thread.c b/mono/io-layer/timed-thread.c
index 37feeeb5365..6599e0660f3 100644
--- a/mono/io-layer/timed-thread.c
+++ b/mono/io-layer/timed-thread.c
@@ -9,10 +9,14 @@
#include <config.h>
#include <glib.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include <pthread.h>
+#ifdef HAVE_SEMAPHORE_H
+#include <semaphore.h>
+#endif
+#include <errno.h>
+
+#include <mono/io-layer/processes.h>
#include "timed-thread.h"
@@ -27,16 +31,25 @@
static pthread_key_t timed_thread_key;
static mono_once_t timed_thread_once = MONO_ONCE_INIT;
+static mono_mutex_t apc_mutex;
+
static void timed_thread_init(void)
{
- pthread_key_create(&timed_thread_key, NULL);
+ int thr_ret;
+
+ thr_ret = pthread_key_create(&timed_thread_key, NULL);
+ g_assert (thr_ret == 0);
+
+ thr_ret = mono_mutex_init(&apc_mutex, NULL);
+ g_assert (thr_ret == 0);
}
void _wapi_timed_thread_exit(guint32 exitstatus)
{
TimedThread *thread;
void *specific;
+ int thr_ret;
if((specific = pthread_getspecific(timed_thread_key)) == NULL) {
/* Handle cases which won't happen with correct usage.
@@ -45,8 +58,15 @@ void _wapi_timed_thread_exit(guint32 exitstatus)
}
thread=(TimedThread *)specific;
+
+ if(thread->exit_routine!=NULL) {
+ thread->exit_routine(exitstatus, thread->exit_userdata);
+ }
- mono_mutex_lock(&thread->join_mutex);
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&thread->join_mutex);
+ thr_ret = mono_mutex_lock(&thread->join_mutex);
+ g_assert (thr_ret == 0);
/* Tell a joiner that we're exiting.
*/
@@ -58,13 +78,13 @@ void _wapi_timed_thread_exit(guint32 exitstatus)
thread->exitstatus=exitstatus;
thread->exiting=TRUE;
-
- if(thread->exit_routine!=NULL) {
- thread->exit_routine(exitstatus, thread->exit_userdata);
- }
- pthread_cond_signal(&thread->exit_cond);
- mono_mutex_unlock(&thread->join_mutex);
+ thr_ret = pthread_cond_signal(&thread->exit_cond);
+ g_assert (thr_ret == 0);
+
+ thr_ret = mono_mutex_unlock(&thread->join_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
/* Call pthread_exit() to call destructors and really exit the
* thread.
@@ -79,10 +99,39 @@ static void *timed_thread_start_routine(gpointer args) G_GNUC_NORETURN;
static void *timed_thread_start_routine(gpointer args)
{
TimedThread *thread = (TimedThread *)args;
+ int thr_ret;
mono_once(&timed_thread_once, timed_thread_init);
- pthread_setspecific(timed_thread_key, (void *)thread);
- pthread_detach(thread->id);
+ thr_ret = pthread_setspecific(timed_thread_key, (void *)thread);
+ g_assert (thr_ret == 0);
+
+ /* This used to be pthread_detach(thread->id);
+ *
+ * thread->id is set in _wapi_timed_thread_create:
+ *
+ * if((result = pthread_create(&thread->id, attr,
+ * timed_thread_start_routine,
+ * (void *)thread)) != 0) {
+ *
+ * Strangeness happened: if _wapi_timed_thread_create was
+ * called directly, then thread->id was always set here.
+ * However, if _wapi_timed_thread_create was called via
+ * another function that did nothing but call
+ * _wapi_timed_thread_create, thread->id was not ever set,
+ * leading to the thread's 2M stack being wasted as it was not
+ * detached.
+ *
+ * This was 100% reproducible on Debian Woody with gcc 2.95.4,
+ * and on Red Hat 9 with gcc 3.2.2.
+ */
+ thr_ret = pthread_detach(pthread_self ());
+ g_assert (thr_ret == 0);
+
+ if(thread->create_flags & CREATE_SUSPENDED) {
+ thread->suspend_count = 1;
+ _wapi_timed_thread_suspend (thread);
+ }
+
_wapi_timed_thread_exit(thread->start_routine(thread->arg));
}
@@ -90,23 +139,33 @@ static void *timed_thread_start_routine(gpointer args)
*/
int _wapi_timed_thread_create(TimedThread **threadp,
const pthread_attr_t *attr,
+ guint32 create_flags,
guint32 (*start_routine)(gpointer),
void (*exit_routine)(guint32, gpointer),
gpointer arg, gpointer exit_userdata)
{
TimedThread *thread;
int result;
+ int thr_ret;
thread=(TimedThread *)g_new0(TimedThread, 1);
- mono_mutex_init(&thread->join_mutex, NULL);
- pthread_cond_init(&thread->exit_cond, NULL);
+ thr_ret = mono_mutex_init(&thread->join_mutex, NULL);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_cond_init(&thread->exit_cond, NULL);
+ g_assert (thr_ret == 0);
+
+ thread->create_flags = create_flags;
+ MONO_SEM_INIT (&thread->suspend_sem, 0);
+ MONO_SEM_INIT (&thread->suspended_sem, 0);
thread->start_routine = start_routine;
thread->exit_routine = exit_routine;
thread->arg = arg;
thread->exit_userdata = exit_userdata;
thread->exitstatus = 0;
thread->exiting = FALSE;
+ thread->apc_queue = NULL;
*threadp = thread;
@@ -120,12 +179,57 @@ int _wapi_timed_thread_create(TimedThread **threadp,
return(0);
}
+int _wapi_timed_thread_attach(TimedThread **threadp,
+ void (*exit_routine)(guint32, gpointer),
+ gpointer exit_userdata)
+{
+ TimedThread *thread;
+ int thr_ret;
+
+ thread=(TimedThread *)g_new0(TimedThread, 1);
+
+ thr_ret = mono_mutex_init(&thread->join_mutex, NULL);
+ g_assert (thr_ret == 0);
+
+ thr_ret = pthread_cond_init(&thread->exit_cond, NULL);
+ g_assert (thr_ret == 0);
+
+ thr_ret = MONO_SEM_INIT (&thread->suspend_sem, 0);
+ g_assert (thr_ret != -1);
+
+ thr_ret = MONO_SEM_INIT (&thread->suspended_sem, 0);
+ g_assert (thr_ret != -1);
+
+ thread->exit_routine = exit_routine;
+ thread->exit_userdata = exit_userdata;
+ thread->exitstatus = 0;
+ thread->exiting = FALSE;
+ thread->id = pthread_self();
+
+ /* Make sure the timed-thread initialisation that the start
+ * routing does happens here too (we might be first to be
+ * called)
+ */
+ mono_once(&timed_thread_once, timed_thread_init);
+ thr_ret = pthread_setspecific(timed_thread_key, (void *)thread);
+ g_assert (thr_ret == 0);
+
+ *threadp = thread;
+
+ return(0);
+}
+
int _wapi_timed_thread_join(TimedThread *thread, struct timespec *timeout,
guint32 *exitstatus)
{
int result;
+ int thr_ret;
+
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&thread->join_mutex);
+ thr_ret = mono_mutex_lock(&thread->join_mutex);
+ g_assert (thr_ret == 0);
- mono_mutex_lock(&thread->join_mutex);
result=0;
/* Wait until the thread announces that it's exiting, or until
@@ -142,11 +246,16 @@ int _wapi_timed_thread_join(TimedThread *thread, struct timespec *timeout,
}
}
- mono_mutex_unlock(&thread->join_mutex);
+ thr_ret = mono_mutex_unlock(&thread->join_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
if(result == 0 && thread->exiting) {
if(exitstatus!=NULL) {
*exitstatus = thread->exitstatus;
}
+
+ _wapi_timed_thread_destroy (thread);
}
return(result);
}
@@ -155,6 +264,98 @@ void _wapi_timed_thread_destroy (TimedThread *thread)
{
mono_mutex_destroy (&thread->join_mutex);
pthread_cond_destroy (&thread->exit_cond);
+ MONO_SEM_DESTROY (&thread->suspend_sem);
+ MONO_SEM_DESTROY (&thread->suspended_sem);
g_free(thread);
}
+
+/* I was going to base thread suspending on the algorithm presented at
+ * http://home.earthlink.net/~anneart/family/Threads/code/susp.c
+ *
+ * Unfortunately the Boehm GC library also wants to use this technique
+ * to stop the world, and will deadlock if a thread has already been
+ * suspended when it tries.
+ *
+ * While Mono is still using libgc this will just have to be a kludge
+ * to implement suspended creation of threads, rather than the general
+ * purpose thread suspension.
+ */
+void _wapi_timed_thread_suspend (TimedThread *thread)
+{
+ TimedThread *self;
+ void *specific;
+
+ if((specific = pthread_getspecific (timed_thread_key))==NULL) {
+ g_warning (G_GNUC_PRETTY_FUNCTION ": thread lookup failed");
+ return;
+ }
+ self=(TimedThread *)specific;
+
+ if(thread != self) {
+ g_error (G_GNUC_PRETTY_FUNCTION
+ ": attempt to suspend a different thread!");
+ exit (-1);
+ }
+
+ while (MONO_SEM_WAIT (&thread->suspend_sem) != 0 && errno == EINTR);
+}
+
+void _wapi_timed_thread_resume (TimedThread *thread)
+{
+ MONO_SEM_POST (&thread->suspend_sem);
+}
+
+void _wapi_timed_thread_queue_apc (TimedThread *thread,
+ guint32 (*apc_callback)(gpointer), gpointer param)
+{
+ ApcInfo *apc;
+ int thr_ret;
+
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&apc_mutex);
+ thr_ret = mono_mutex_lock(&apc_mutex);
+ g_assert (thr_ret == 0);
+
+ apc = (ApcInfo *)g_new(ApcInfo, 1);
+ apc->callback = apc_callback;
+ apc->param = param;
+ thread->apc_queue = g_slist_append (thread->apc_queue, apc);
+
+ thr_ret = mono_mutex_unlock(&apc_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+}
+
+gboolean _wapi_timed_thread_apc_pending (TimedThread *thread)
+{
+ return thread->apc_queue != NULL;
+}
+
+void _wapi_timed_thread_dispatch_apc_queue (TimedThread *thread)
+{
+ ApcInfo* apc;
+ GSList *list;
+ int thr_ret;
+
+ pthread_cleanup_push ((void(*)(void *))mono_mutex_unlock_in_cleanup,
+ (void *)&apc_mutex);
+ thr_ret = mono_mutex_lock(&apc_mutex);
+ g_assert (thr_ret == 0);
+
+ list = thread->apc_queue;
+ thread->apc_queue = NULL;
+
+ thr_ret = mono_mutex_unlock(&apc_mutex);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ while (list != NULL) {
+ apc = (ApcInfo*)list->data;
+ apc->callback (apc->param);
+ g_free (apc);
+ list = g_slist_next (list);
+ }
+ g_slist_free (list);
+}
+
diff --git a/mono/io-layer/timed-thread.h b/mono/io-layer/timed-thread.h
index 82c9d6c307e..a656f8b8221 100644
--- a/mono/io-layer/timed-thread.h
+++ b/mono/io-layer/timed-thread.h
@@ -13,6 +13,25 @@
#include <config.h>
#include <glib.h>
#include <pthread.h>
+#ifdef HAVE_SEMAPHORE_H
+#include <semaphore.h>
+#endif
+#ifdef USE_MACH_SEMA
+#include <mach/mach_init.h>
+#include <mach/task.h>
+#include <mach/semaphore.h>
+typedef semaphore_t MonoSemType;
+#define MONO_SEM_INIT(addr,value) semaphore_create(current_task(), (addr), SYNC_POLICY_FIFO, (value))
+#define MONO_SEM_WAIT(sem) semaphore_wait(*(sem))
+#define MONO_SEM_POST(sem) semaphore_signal(*(sem))
+#define MONO_SEM_DESTROY(sem) semaphore_destroy(current_task(), *(sem))
+#else
+typedef sem_t MonoSemType;
+#define MONO_SEM_INIT(addr,value) sem_init ((addr), 0, (value))
+#define MONO_SEM_WAIT(sem) sem_wait((sem))
+#define MONO_SEM_POST(sem) sem_post((sem))
+#define MONO_SEM_DESTROY(sem) sem_destroy((sem))
+#endif
#include "mono-mutex.h"
@@ -21,23 +40,47 @@ typedef struct
pthread_t id;
mono_mutex_t join_mutex;
pthread_cond_t exit_cond;
+ guint32 create_flags;
+ int suspend_count;
+ MonoSemType suspend_sem;
+ MonoSemType suspended_sem;
guint32 (*start_routine)(gpointer arg);
void (*exit_routine)(guint32 exitstatus, gpointer userdata);
gpointer arg;
gpointer exit_userdata;
guint32 exitstatus;
gboolean exiting;
+ gpointer stack_ptr;
+ GSList *apc_queue;
} TimedThread;
+typedef struct
+{
+ guint32 (*callback)(gpointer arg);
+ gpointer param;
+} ApcInfo;
+
extern void _wapi_timed_thread_exit(guint32 exitstatus) G_GNUC_NORETURN;
extern int _wapi_timed_thread_create(TimedThread **threadp,
const pthread_attr_t *attr,
+ guint32 create_flags,
guint32 (*start_routine)(gpointer),
void (*exit_routine)(guint32, gpointer),
gpointer arg, gpointer exit_userdata);
+extern int _wapi_timed_thread_attach(TimedThread **threadp,
+ void (*exit_routine)(guint32, gpointer),
+ gpointer exit_userdata);
extern int _wapi_timed_thread_join(TimedThread *thread,
struct timespec *timeout,
guint32 *exitstatus);
extern void _wapi_timed_thread_destroy (TimedThread *thread);
+extern void _wapi_timed_thread_suspend (TimedThread *thread);
+extern void _wapi_timed_thread_resume (TimedThread *thread);
+
+extern void _wapi_timed_thread_queue_apc (TimedThread *thread,
+ guint32 (*apc_callback)(gpointer), gpointer param);
+extern gboolean _wapi_timed_thread_apc_pending (TimedThread *thread);
+extern void _wapi_timed_thread_dispatch_apc_queue (TimedThread *thread);
+
#endif /* _WAPI_TIMED_THREAD_H_ */
diff --git a/mono/io-layer/timefuncs-private.h b/mono/io-layer/timefuncs-private.h
index 6479d255467..64c6dbb9a85 100644
--- a/mono/io-layer/timefuncs-private.h
+++ b/mono/io-layer/timefuncs-private.h
@@ -12,7 +12,10 @@
#include <config.h>
#include <glib.h>
+#include <sys/time.h>
extern void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime);
+extern void _wapi_timeval_to_filetime (struct timeval *tv,
+ WapiFileTime *filetime);
#endif /* _WAPI_TIMEFUNCS_PRIVATE_H_ */
diff --git a/mono/io-layer/timefuncs.c b/mono/io-layer/timefuncs.c
index 274fdd53536..06042ec140e 100644
--- a/mono/io-layer/timefuncs.c
+++ b/mono/io-layer/timefuncs.c
@@ -15,11 +15,23 @@
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/timefuncs-private.h>
+#undef DEBUG
+
void _wapi_time_t_to_filetime (time_t timeval, WapiFileTime *filetime)
{
guint64 ticks;
- ticks = ((guint64)timeval * 10000000) + 116444736000000000UL;
+ ticks = ((guint64)timeval * 10000000) + 116444736000000000ULL;
+ filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
+ filetime->dwHighDateTime = ticks >> 32;
+}
+
+void _wapi_timeval_to_filetime (struct timeval *tv, WapiFileTime *filetime)
+{
+ guint64 ticks;
+
+ ticks = ((guint64)tv->tv_sec * 10000000) +
+ ((guint64)tv->tv_usec * 10) + 116444736000000000ULL;
filetime->dwLowDateTime = ticks & 0xFFFFFFFF;
filetime->dwHighDateTime = ticks >> 32;
}
@@ -34,3 +46,25 @@ gboolean QueryPerformanceFrequency(WapiLargeInteger *freq G_GNUC_UNUSED)
return(FALSE);
}
+guint32 GetTickCount (void)
+{
+ struct timeval tv;
+ guint32 ret;
+
+ ret=gettimeofday (&tv, NULL);
+ if(ret==-1) {
+ return(0);
+ }
+
+ /* This is supposed to return milliseconds since reboot but I
+ * really can't be bothered to work out the uptime, especially
+ * as the 32bit value wraps around every 47 days
+ */
+ ret=(guint32)((tv.tv_sec * 1000) + (tv.tv_usec / 1000));
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": returning %d", ret);
+#endif
+
+ return(ret);
+}
diff --git a/mono/io-layer/timefuncs.h b/mono/io-layer/timefuncs.h
index e2a86bbd4fe..6f13e8b13fc 100644
--- a/mono/io-layer/timefuncs.h
+++ b/mono/io-layer/timefuncs.h
@@ -20,7 +20,8 @@ typedef struct
guint32 dwHighDateTime;
} WapiFileTime;
-gboolean QueryPerformanceCounter(WapiLargeInteger *count);
-gboolean QueryPerformanceFrequency(WapiLargeInteger *freq);
+extern gboolean QueryPerformanceCounter(WapiLargeInteger *count);
+extern gboolean QueryPerformanceFrequency(WapiLargeInteger *freq);
+extern guint32 GetTickCount (void);
#endif /* _WAPI_TIME_H_ */
diff --git a/mono/io-layer/uglify.h b/mono/io-layer/uglify.h
index e762c016a7d..f7055de04d0 100644
--- a/mono/io-layer/uglify.h
+++ b/mono/io-layer/uglify.h
@@ -31,14 +31,17 @@ typedef guint32 ULONG;
typedef gint32 *PLONG;
typedef guint64 LONGLONG;
typedef gunichar2 TCHAR;
+typedef size_t SIZE_T;
typedef gpointer HANDLE;
typedef gpointer *LPHANDLE;
typedef guint32 SOCKET;
typedef gpointer HMODULE;
+typedef WapiSecurityAttributes SECURITY_ATTRIBUTES;
typedef WapiSecurityAttributes *LPSECURITY_ATTRIBUTES;
typedef WapiOverlapped *LPOVERLAPPED;
+typedef WapiOverlappedCB LPOVERLAPPED_COMPLETION_ROUTINE;
typedef WapiThreadStart LPTHREAD_START_ROUTINE;
typedef WapiCriticalSection CRITICAL_SECTION;
typedef WapiCriticalSection *LPCRITICAL_SECTION;
@@ -64,6 +67,7 @@ typedef WapiStartupInfo STARTUPINFO;
typedef WapiStartupInfo *LPSTARTUPINFO;
typedef WapiProcessInformation PROCESS_INFORMATION;
typedef WapiFixedFileInfo VS_FIXEDFILEINFO;
+typedef WapiApcProc PAPCFUNC;
#define CONST const
#define VOID void
diff --git a/mono/io-layer/unicode.c b/mono/io-layer/unicode.c
deleted file mode 100644
index dbca82b857c..00000000000
--- a/mono/io-layer/unicode.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * unicode.c: unicode conversion
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <pthread.h>
-#if HAVE_ICONV_H
-#include <iconv.h>
-#elif HAVE_GICONV_H
-#include <giconv.h>
-#endif
-#include <errno.h>
-
-#include "mono/io-layer/wapi.h"
-#include "unicode.h"
-
-gchar *_wapi_unicode_to_utf8(const gunichar2 *uni)
-{
- GError *error = NULL;
- gchar *res;
-
- res = g_utf16_to_utf8 (uni, -1, NULL, NULL, &error);
-
- g_assert (!error);
-
- return res;
-}
diff --git a/mono/io-layer/unicode.h b/mono/io-layer/unicode.h
deleted file mode 100644
index d50cabe8a44..00000000000
--- a/mono/io-layer/unicode.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * unicode.h: unicode conversion
- *
- * Author:
- * Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef _WAPI_UNICODE_H_
-#define _WAPI_UNICODE_H_
-
-/* This is an internal, private header file */
-
-#include <glib.h>
-
-extern gchar *_wapi_unicode_to_utf8 (const gunichar2 *uni);
-
-#endif /* _WAPI_UNICODE_H_ */
diff --git a/mono/io-layer/wait.c b/mono/io-layer/wait.c
index 695ac101cd1..a236d17ed3e 100644
--- a/mono/io-layer/wait.c
+++ b/mono/io-layer/wait.c
@@ -12,9 +12,7 @@
#include <string.h>
#include <errno.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include <mono/io-layer/wapi.h>
#include <mono/io-layer/handles-private.h>
@@ -25,9 +23,10 @@
#undef DEBUG
/**
- * WaitForSingleObject:
+ * WaitForSingleObjectEx:
* @handle: an object to wait for
* @timeout: the maximum time in milliseconds to wait for
+ * @alertable: if TRUE, the wait can be interrupted by an APC call
*
* This function returns when either @handle is signalled, or @timeout
* ms elapses. If @timeout is zero, the object's state is tested and
@@ -40,12 +39,16 @@
* to nonsignalled. %WAIT_OBJECT_0 - The state of @handle is
* signalled. %WAIT_TIMEOUT - The @timeout interval elapsed and
* @handle's state is still not signalled. %WAIT_FAILED - an error
- * occurred.
+ * occurred. %WAIT_IO_COMPLETION - the wait was ended by an APC.
*/
-guint32 WaitForSingleObject(gpointer handle, guint32 timeout)
+guint32 WaitForSingleObjectEx(gpointer handle, guint32 timeout,
+ gboolean alertable)
{
guint32 ret, waited;
struct timespec abstime;
+ int thr_ret;
+ gboolean apc_pending = FALSE;
+ gpointer current_thread = GetCurrentThread ();
if(_wapi_handle_test_capabilities (handle,
WAPI_HANDLE_CAP_WAIT)==FALSE) {
@@ -61,7 +64,10 @@ guint32 WaitForSingleObject(gpointer handle, guint32 timeout)
g_message (G_GNUC_PRETTY_FUNCTION ": locking handle %p", handle);
#endif
- _wapi_handle_lock_handle (handle);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ handle);
+ thr_ret = _wapi_handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
if(_wapi_handle_test_capabilities (handle,
WAPI_HANDLE_CAP_OWN)==TRUE) {
@@ -76,6 +82,12 @@ guint32 WaitForSingleObject(gpointer handle, guint32 timeout)
}
}
+ if (alertable && _wapi_thread_apc_pending (current_thread)) {
+ apc_pending = TRUE;
+ ret = WAIT_IO_COMPLETION;
+ goto done;
+ }
+
if(_wapi_handle_issignalled (handle)) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
@@ -99,8 +111,11 @@ guint32 WaitForSingleObject(gpointer handle, guint32 timeout)
waited=_wapi_handle_timedwait_signal_handle (handle,
&abstime);
}
+
+ if (alertable)
+ apc_pending = _wapi_thread_apc_pending (current_thread);
- if(waited==0) {
+ if(waited==0 && !apc_pending) {
/* Condition was signalled, so hopefully
* handle is signalled now. (It might not be
* if someone else got in before us.)
@@ -118,7 +133,7 @@ guint32 WaitForSingleObject(gpointer handle, guint32 timeout)
/* Better luck next time */
}
- } while(waited==0);
+ } while(waited==0 && !apc_pending);
/* Timeout or other error */
#ifdef DEBUG
@@ -134,10 +149,24 @@ done:
g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handle %p", handle);
#endif
- _wapi_handle_unlock_handle (handle);
+ thr_ret = _wapi_handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+
+ if (apc_pending) {
+ _wapi_thread_dispatch_apc_queue (current_thread);
+ ret = WAIT_IO_COMPLETION;
+ }
+
return(ret);
}
+guint32 WaitForSingleObject(gpointer handle, guint32 timeout)
+{
+ return WaitForSingleObjectEx (handle, timeout, FALSE);
+}
+
+
/**
* SignalObjectAndWait:
* @signal_handle: An object to signal
@@ -178,6 +207,9 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait,
{
guint32 ret, waited;
struct timespec abstime;
+ int thr_ret;
+ gboolean apc_pending = FALSE;
+ gpointer current_thread = GetCurrentThread ();
if(_wapi_handle_test_capabilities (signal_handle,
WAPI_HANDLE_CAP_SIGNAL)==FALSE) {
@@ -193,7 +225,10 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait,
g_message (G_GNUC_PRETTY_FUNCTION ": locking handle %p", wait);
#endif
- _wapi_handle_lock_handle (wait);
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_handle,
+ wait);
+ thr_ret = _wapi_handle_lock_handle (wait);
+ g_assert (thr_ret == 0);
_wapi_handle_ops_signal (signal_handle);
@@ -209,6 +244,12 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait,
}
}
+ if (alertable && _wapi_thread_apc_pending (current_thread)) {
+ apc_pending = TRUE;
+ ret = WAIT_IO_COMPLETION;
+ goto done;
+ }
+
if(_wapi_handle_issignalled (wait)) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION
@@ -233,7 +274,10 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait,
&abstime);
}
- if(waited==0) {
+ if (alertable)
+ apc_pending = _wapi_thread_apc_pending (current_thread);
+
+ if(waited==0 && !apc_pending) {
/* Condition was signalled, so hopefully
* handle is signalled now. (It might not be
* if someone else got in before us.)
@@ -251,7 +295,7 @@ guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait,
/* Better luck next time */
}
- } while(waited==0);
+ } while(waited==0 && !apc_pending);
/* Timeout or other error */
#ifdef DEBUG
@@ -267,17 +311,76 @@ done:
g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handle %p", wait);
#endif
- _wapi_handle_unlock_handle (wait);
+ thr_ret = _wapi_handle_unlock_handle (wait);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
- if(alertable==TRUE) {
- /* Deal with queued APC or IO completion routines */
+ if (apc_pending) {
+ _wapi_thread_dispatch_apc_queue (current_thread);
+ ret = WAIT_IO_COMPLETION;
}
return(ret);
}
+struct handle_cleanup_data
+{
+ guint32 numobjects;
+ gpointer *handles;
+};
+
+static void handle_cleanup (void *data)
+{
+ struct handle_cleanup_data *handles = (struct handle_cleanup_data *)data;
+
+ _wapi_handle_unlock_handles (handles->numobjects, handles->handles);
+}
+
+static gboolean test_and_own (guint32 numobjects, gpointer *handles,
+ gboolean waitall, guint32 *count,
+ guint32 *lowest)
+{
+ struct handle_cleanup_data cleanup_data;
+ gboolean done;
+ int i;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": locking handles");
+#endif
+ cleanup_data.numobjects = numobjects;
+ cleanup_data.handles = handles;
+
+ pthread_cleanup_push (handle_cleanup, (void *)&cleanup_data);
+ done = _wapi_handle_count_signalled_handles (numobjects, handles,
+ waitall, count, lowest);
+ if (done == TRUE) {
+ if (waitall == TRUE) {
+ for (i = 0; i < numobjects; i++) {
+ if (_wapi_handle_issignalled (handles[i])) {
+ _wapi_handle_ops_own (handles[i]);
+ }
+ }
+ } else {
+ if (_wapi_handle_issignalled (handles[*lowest])) {
+ _wapi_handle_ops_own (handles[*lowest]);
+ }
+ }
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handles");
+#endif
+
+ /* calls the unlock function */
+ pthread_cleanup_pop (1);
+
+ return(done);
+}
+
+
+
/**
- * WaitForMultipleObjects:
+ * WaitForMultipleObjectsEx:
* @numobjects: The number of objects in @handles. The maximum allowed
* is %MAXIMUM_WAIT_OBJECTS.
* @handles: An array of object handles. Duplicates are not allowed.
@@ -285,6 +388,7 @@ done:
* are signalled. If %FALSE, this function returns when any object is
* signalled.
* @timeout: The maximum time in milliseconds to wait for.
+ * @alertable: if TRUE, the wait can be interrupted by an APC call
*
* This function returns when either one or more of @handles is
* signalled, or @timeout ms elapses. If @timeout is zero, the state
@@ -303,9 +407,10 @@ done:
* indicates the first index into @handles of an abandoned mutex.
* %WAIT_TIMEOUT - The @timeout interval elapsed and no objects in
* @handles are signalled. %WAIT_FAILED - an error occurred.
+ * %WAIT_IO_COMPLETION - the wait was ended by an APC.
*/
-guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
- gboolean waitall, guint32 timeout)
+guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
+ gboolean waitall, guint32 timeout, gboolean alertable)
{
GHashTable *dups;
gboolean duplicate=FALSE, bogustype=FALSE, done;
@@ -313,6 +418,8 @@ guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
struct timespec abstime;
guint i;
guint32 ret;
+ int thr_ret;
+ gpointer current_thread = GetCurrentThread ();
if(numobjects>MAXIMUM_WAIT_OBJECTS) {
#ifdef DEBUG
@@ -323,6 +430,10 @@ guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
return(WAIT_FAILED);
}
+ if (numobjects == 1) {
+ return WaitForSingleObjectEx (handles [0], timeout, alertable);
+ }
+
/* Check for duplicates */
dups=g_hash_table_new(g_direct_hash, g_direct_equal);
for(i=0; i<numobjects; i++) {
@@ -369,45 +480,32 @@ guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
return(WAIT_FAILED);
}
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": locking handles");
-#endif
-
- done=_wapi_handle_count_signalled_handles (numobjects, handles,
- waitall, &count, &lowest);
+ done=test_and_own (numobjects, handles, waitall, &count, &lowest);
if(done==TRUE) {
- for(i=0; i<numobjects; i++) {
- _wapi_handle_ops_own (handles[i]);
- }
-
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handles");
-#endif
-
- _wapi_handle_unlock_handles (numobjects, handles);
return(WAIT_OBJECT_0+lowest);
}
/* Have to wait for some or all handles to become signalled
*/
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handles");
-#endif
-
- _wapi_handle_unlock_handles (numobjects, handles);
-
if(timeout!=INFINITE) {
_wapi_calc_timeout (&abstime, timeout);
}
+ if (alertable && _wapi_thread_apc_pending (current_thread)) {
+ _wapi_thread_dispatch_apc_queue (current_thread);
+ return WAIT_IO_COMPLETION;
+ }
+
while(1) {
#ifdef DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": locking signal mutex");
#endif
- _wapi_handle_lock_signal_mutex ();
-
+ pthread_cleanup_push ((void(*)(void *))_wapi_handle_unlock_signal_mutex, NULL);
+ thr_ret = _wapi_handle_lock_signal_mutex ();
+ g_assert (thr_ret == 0);
+
if(timeout==INFINITE) {
ret=_wapi_handle_wait_signal ();
} else {
@@ -418,35 +516,22 @@ guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
g_message (G_GNUC_PRETTY_FUNCTION ": unlocking signal mutex");
#endif
- _wapi_handle_unlock_signal_mutex ();
+ thr_ret = _wapi_handle_unlock_signal_mutex (NULL);
+ g_assert (thr_ret == 0);
+ pthread_cleanup_pop (0);
+ if (alertable && _wapi_thread_apc_pending (current_thread)) {
+ _wapi_thread_dispatch_apc_queue (current_thread);
+ return WAIT_IO_COMPLETION;
+ }
+
if(ret==0) {
/* Something was signalled ... */
- done=_wapi_handle_count_signalled_handles (numobjects,
- handles,
- waitall,
- &count,
- &lowest);
+ done = test_and_own (numobjects, handles, waitall,
+ &count, &lowest);
if(done==TRUE) {
- for(i=0; i<numobjects; i++) {
- _wapi_handle_ops_own (handles[i]);
- }
-
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handles");
-#endif
-
- _wapi_handle_unlock_handles (numobjects,
- handles);
-
return(WAIT_OBJECT_0+lowest);
}
-
-#ifdef DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": unlocking handles");
-#endif
-
- _wapi_handle_unlock_handles (numobjects, handles);
} else {
/* Timeout or other error */
#ifdef DEBUG
@@ -461,3 +546,9 @@ guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
}
}
}
+
+guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
+ gboolean waitall, guint32 timeout)
+{
+ return WaitForMultipleObjectsEx(numobjects, handles, waitall, timeout, FALSE);
+}
diff --git a/mono/io-layer/wait.h b/mono/io-layer/wait.h
index 5c0111c758e..9eec987ea80 100644
--- a/mono/io-layer/wait.h
+++ b/mono/io-layer/wait.h
@@ -26,9 +26,13 @@
#define WAIT_IO_COMPLETION STATUS_USER_APC
extern guint32 WaitForSingleObject(gpointer handle, guint32 timeout);
+extern guint32 WaitForSingleObjectEx(gpointer handle, guint32 timeout,
+ gboolean alertable);
extern guint32 SignalObjectAndWait(gpointer signal_handle, gpointer wait,
guint32 timeout, gboolean alertable);
extern guint32 WaitForMultipleObjects(guint32 numobjects, gpointer *handles,
gboolean waitall, guint32 timeout);
+extern guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
+ gboolean waitall, guint32 timeout, gboolean alertable);
#endif /* _WAPI_WAIT_H_ */
diff --git a/mono/io-layer/wapi-private.h b/mono/io-layer/wapi-private.h
index 9d54d710c90..2a7203c6937 100644
--- a/mono/io-layer/wapi-private.h
+++ b/mono/io-layer/wapi-private.h
@@ -13,15 +13,29 @@
#include <config.h>
#include <glib.h>
-#include "mono/io-layer/handles.h"
-#include "mono/io-layer/io.h"
+#include <mono/io-layer/handles.h>
+#include <mono/io-layer/io.h>
+#include <mono/io-layer/daemon-private.h>
+
+/* for non-GCC compilers where Glib gives an empty pretty function
+ * macro create one that gives file & line number instead
+ */
+#ifndef __GNUC__
+#undef G_GNUC_PRETTY_FUNCTION
+#define STRINGIZE_HELPER(exp) #exp
+#define STRINGIZE(exp) STRINGIZE_HELPER(exp)
+#define G_GNUC_PRETTY_FUNCTION __FILE__ "(" STRINGIZE(__LINE__) ")"
+#endif
+
+/* Catch this here rather than corrupt the shared data at runtime */
+#if MONO_SIZEOF_SUNPATH==0
+#error configure failed to discover size of unix socket path
+#endif
/* Increment this whenever an incompatible change is made to the
* shared handle structure.
- *
- * If this ever reaches 255, we have problems :-(
*/
-#define _WAPI_HANDLE_VERSION 2
+#define _WAPI_HANDLE_VERSION 3
typedef enum {
WAPI_HANDLE_UNUSED=0,
@@ -34,13 +48,34 @@ typedef enum {
WAPI_HANDLE_SOCKET,
WAPI_HANDLE_FIND,
WAPI_HANDLE_PROCESS,
- WAPI_HANDLE_COUNT,
+ WAPI_HANDLE_PIPE,
+ WAPI_HANDLE_COUNT
} WapiHandleType;
+#define _WAPI_SHARED_NAMESPACE(type) (type==WAPI_HANDLE_MUTEX)
+
+typedef struct
+{
+ guint32 name;
+} WapiSharedNamespace;
+
+/* The boolean is for distinguishing between a zeroed struct being not
+ * as yet assigned, and one containing a valid fd 0. It's also used
+ * to signal that a previously-good fd has been reused behind our
+ * back, so we need to invalidate the handle that thought it owned the
+ * fd.
+ */
+typedef struct
+{
+ int fd;
+ gboolean assigned;
+} WapiFDMapped;
+
+
typedef enum {
WAPI_HANDLE_CAP_WAIT=0x01,
WAPI_HANDLE_CAP_SIGNAL=0x02,
- WAPI_HANDLE_CAP_OWN=0x04,
+ WAPI_HANDLE_CAP_OWN=0x04
} WapiHandleCapability;
struct _WapiHandleOps
@@ -71,6 +106,9 @@ struct _WapiHandleOps
#include <mono/io-layer/thread-private.h>
#include <mono/io-layer/process-private.h>
+/* Shared threads don't seem to work yet */
+#undef _POSIX_THREAD_PROCESS_SHARED
+
struct _WapiHandleShared
{
WapiHandleType type;
@@ -92,30 +130,57 @@ struct _WapiHandleShared
} u;
};
-#define _WAPI_MAX_HANDLES 4096
+#define _WAPI_HANDLES_PER_SEGMENT 4096
#define _WAPI_HANDLE_INVALID (gpointer)-1
+#define _WAPI_SHM_SCRATCH_SIZE 512000
+
/*
- * This is the layout of the shared memory segment
+ * This is the layout of the shared scratch data. When the data array
+ * is filled, it will be expanded by _WAPI_SHM_SCRATCH_SIZE
+ * bytes. (scratch data is always copied out of the shared memory, so
+ * it doesn't matter that the mapping will move around.)
*/
-struct _WapiHandleShared_list
+struct _WapiHandleScratch
{
- /* UNIX_PATH_MAX doesnt seem to be defined in any accessible
- * header file
+ guint32 data_len;
+
+ /* This is set to TRUE by the daemon. It determines whether a
+ * resize will go via mremap() or just realloc().
*/
- guchar daemon[108];
- guint32 daemon_running;
+ gboolean is_shared;
+ guchar scratch_data[MONO_ZERO_ARRAY_LENGTH];
+};
+
+/*
+ * This is the layout of the shared memory segments. When the handles
+ * array is filled, another shared memory segment will be allocated
+ * with the same structure. This is to avoid having the shared memory
+ * potentially move if it is resized and remapped.
+ *
+ * Note that the additional segments have the same structure, but only
+ * the handle array is used.
+ */
+struct _WapiHandleShared_list
+{
+ guchar daemon[MONO_SIZEOF_SUNPATH];
+ _wapi_daemon_status daemon_running;
+ guint32 fd_offset_table_size;
-#ifdef _POSIX_THREAD_PROCESS_SHARED
+#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED != -1
mono_mutex_t signal_mutex;
pthread_cond_t signal_cond;
#endif
- struct _WapiHandleShared handles[_WAPI_MAX_HANDLES];
- guchar scratch_base[0];
+
+ /* This holds the number of segments */
+ guint32 num_segments;
+ struct _WapiHandleShared handles[_WAPI_HANDLES_PER_SEGMENT];
};
struct _WapiHandlePrivate
{
+ WapiHandleType type;
+
union
{
struct _WapiHandlePrivate_event event;
@@ -129,16 +194,20 @@ struct _WapiHandlePrivate
} u;
};
-/* Per-process handle info. For lookup convenience, each index matches
- * the corresponding shared data.
+/* Per-process handle info. For lookup convenience, each segment and
+ * index matches the corresponding shared data.
+ *
+ * Note that the additional segments have the same structure, but only
+ * the handle array is used.
*/
struct _WapiHandlePrivate_list
{
-#ifndef _POSIX_THREAD_PROCESS_SHARED
+#if !defined(_POSIX_THREAD_PROCESS_SHARED) || _POSIX_THREAD_PROCESS_SHARED == -1
mono_mutex_t signal_mutex;
pthread_cond_t signal_cond;
#endif
- struct _WapiHandlePrivate handles[_WAPI_MAX_HANDLES];
+
+ struct _WapiHandlePrivate handles[_WAPI_HANDLES_PER_SEGMENT];
};
diff --git a/mono/io-layer/wapi.h b/mono/io-layer/wapi.h
index 15dbfdca8dd..d6d41359246 100644
--- a/mono/io-layer/wapi.h
+++ b/mono/io-layer/wapi.h
@@ -14,6 +14,7 @@
#include <mono/io-layer/macros.h>
#include <mono/io-layer/handles.h>
#include <mono/io-layer/io.h>
+#include <mono/io-layer/access.h>
#include <mono/io-layer/atomic.h>
#include <mono/io-layer/context.h>
#include <mono/io-layer/critical-sections.h>
@@ -21,6 +22,7 @@
#include <mono/io-layer/events.h>
#include <mono/io-layer/mutexes.h>
#include <mono/io-layer/processes.h>
+#include <mono/io-layer/security.h>
#include <mono/io-layer/semaphores.h>
#include <mono/io-layer/sockets.h>
#include <mono/io-layer/status.h>
diff --git a/mono/jit/.cvsignore b/mono/jit/.cvsignore
index 90b6b6b6546..fa6b0f4f57f 100644
--- a/mono/jit/.cvsignore
+++ b/mono/jit/.cvsignore
@@ -2,6 +2,8 @@ Makefile
Makefile.in
*.o
*.exe
+*.lo
+*.la
.libs
.deps
testjit
diff --git a/mono/jit/ChangeLog b/mono/jit/ChangeLog
index 72410847eff..11096730d60 100644
--- a/mono/jit/ChangeLog
+++ b/mono/jit/ChangeLog
@@ -1,3 +1,983 @@
+2003-07-21 Miguel de Icaza <miguel@ximian.com>
+
+ * jit.c: Remove definition of metadata_section mutex from here
+
+2003-05-19 Dick Porter <dick@ximian.com>
+
+ * jit.c: Netbsd build fix by marc@informatik.uni-bremen.de.
+
+Thu Apr 24 17:11:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: rename mono and libmono to oldmono and liboldmono.
+
+2003-04-23 Martin Baulig <martin@ximian.com>
+
+ * mono.c: The `--debug' command line argument doesn't take any
+ arguments anymore, removed the `--debug-args' argument.
+
+ * debug-jit.c (mono_debug_add_method): Renamed this to
+ mono_debug_jit_add_method(); create the JIT-specific data
+ structure and pass it to mono_debug_add_method().
+
+ * debug.[ch]: Removed. The code is now in
+ ../metadata/mono-debug.[ch] and mono-debug-debugger.[ch].
+
+ * debug-stabs.c, debug-dwarf2.c: Removed; nobody used this for the
+ last six months.
+
+2003-04-21 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debug_open): Splitted into mono_debug_init() and
+ mono_debug_init_2().
+ (mono_debug_open_image): Don't open referenced assemblies; this is
+ done automatically by the code in assembly.c.
+
+ * mono.c (main_thread_handler): Call mono_debug_init() before
+ opening the assembly because we need to install the assembly load
+ hook before doing so.
+
+2003-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * jit.c:
+ (mono_jit_cleanup): moved mono_runtime_cleanup call after the call to
+ mono_domain_finalize.
+
+2003-04-05 Miguel de Icaza <miguel@ximian.com>
+
+ * jit.c (check_inlining): honor the NOINLING atttribute.
+
+2003-03-31 Martin Baulig <martin@ximian.com>
+
+ * debug.h (MonoDebuggerEvent): Removed
+ MONO_DEBUGGER_EVENT_THREAD_CREATED.
+
+ * jit.c (mono_thread_start_cb): Don't send the
+ MONO_DEBUGGER_EVENT_THREAD_CREATED event.
+
+2003-03-13 Martin Baulig <martin@ximian.com>
+
+ * debug.c (_mono_debug_address_from_il_offset): Moved to
+ ../metadata/debug-mono-symfile.c
+
+2003-03-07 Martin Baulig <martin@ximian.com>
+
+ * debug-jit.c: #include <config.h>.
+
+2003-03-05 Martin Baulig <martin@ximian.com>
+
+ * debug-jit.c, debug-jit.h: New files. Moved all JIT-specific
+ stuff here.
+
+ * debug.c (mono_debug_add_method): Moved to debug-jit.c.
+ (mono_debug_handle, mono_debug_initialized): Made them global.
+ (replace_suffix): Removed, this isn't used anymore.
+ (record_line_number): Moved to debug-jit.c.
+ (debug_generate_method_lines): Moved to debug-jit.c
+ (generate_line_number): Renamed to
+ _mono_debug_generate_line_number() and made it global.
+ (debug_update_il_offsets): Moved to debug-jit.c
+ (mono_debug_get_image): Renamed to _mono_debug_get_image() and made
+ it global.
+ (address_from_il_offset): Renamed to
+ _mono_debug_address_from_il_offset() and made it global.
+ (il_offset_from_position): Moved to debug-jit.c
+ (lookup_method): Renamed to _mono_debug_lookup_method() and made
+ it global.
+ (mono_debug_add_method): Moved to debug-jit.c.
+ (mono_debug_create_notification_function): Use two new functions
+ mono_debug_codegen_breakpoint() and mono_debug_codegen_ret()
+ instead of x86_breakpoint() and x86_ret().
+
+Sat Mar 1 12:36:45 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c: remove unnecessary assert when inlining.
+
+2003-02-17 Martin Baulig <martin@ximian.com>
+
+ * jit.c (mono_jit_compile_method): Don't emit a `nop' at the start
+ of each method.
+
+2003-02-14 Patrik Torstensson
+
+ * x86.brg: Implemented CONV_OVF_[I|U]4 (freg), this fixes the issues
+ with the "checked" keyword. Closes bugs #33421 and #35280 (JIT not mint)
+
+2003-02-14 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c (mono_arch_find_jit_info): better way to handle
+ situations where we have no MonoJitInfo
+
+2003-02-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * trampoline.c (arch_create_jit_trampoline): This function should
+ allways return a trampoline for managed methods. Fixes bug #29859.
+
+2003-02-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * debug.c: allocate debug->source_files. Fixes GLib-CRITICAL upon
+ debugging clean up.
+
+2003-02-02 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debug_add_wrapper): Lookup the wrapper method in a
+ hash table; we need to provide the correct code_size.
+
+2003-02-02 Martin Baulig <martin@ximian.com>
+
+ * jit.c (mono_jit_compile_method): Call mono_debug_add_wrapper()
+ to add the interncall to the symbol file.
+
+ * debug.c (mono_debug_add_wrapper): New public function.
+
+2003-02-02 Martin Baulig <martin@ximian.com>
+
+ * debug.c (debug_update_il_offsets): Set the prologue end address
+ to the address of the first source line.
+
+2003-01-31 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): use the wrapper signature if necessary
+
+2003-01-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * debug.c (mono_debug_open_image): dynamic assemblies have no debug
+ info.
+
+Thu Jan 30 11:07:06 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * helper.c: handle MONO_TYPE_ARRAY as well.
+
+2003-01-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): impl. CEE_MONO_LDNATIVEOBJ
+ (mono_analyze_stack): RETOBJ always returns native sized objects
+
+2003-01-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * x86.brg (mono_ldintftn): use <= instead of <, since the
+ interface_offsets array is max_interface_id + 1 long.
+
+2003-01-28 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (mono_ldintftn): fix from Zoltan: use max_interface_id
+
+2003-01-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * exception.c (ves_icall_get_trace): avoid crash if the exception is
+ not yet thrown.
+
+ * exception.c (ves_icall_get_trace): avoid crash on unmanaged frames.
+
+2003-01-26 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debug_init): Take a boolean argument which
+ specifies whether we're running in the Mono Debugger.
+
+2003-01-24 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debug_io_layer): Disable this on Windows.
+
+2003-01-23 Dick Porter <dick@ximian.com>
+
+ * mono.c: Use mono_runtime_exec_managed_code() to run all managed
+ code in a subthread.
+
+ * jit.c: Changed thread start and attach callbacks to pass the
+ thread ID, not the MonoThread pointer. Arrange that managed code
+ execution will fail an assertion in the main thread, just to be
+ sure.
+
+2003-01-22 Martin Baulig <martin@ximian.com>
+
+ * debug.c: Reverted Gonzalo's last change since it is wrong.
+ We're also using the debugging code on Windows, for instance the
+ stabs stuff when running in gdb. I hope this code still builds on
+ Windows; if not, we need to fix this.
+ Moved all the mono debugger support code into the debugger itself;
+ when debugging a managed application, the debugger new launches a
+ small unmanaged wrapper application which contains this stuff.
+
+ * debug.h (MonoDebuggerIOLayer): New public typedef; this is just
+ initialized to an array of function pointers to the io-layer
+ function; they don't seem to be public in the `libmono' library.
+ (mono_debugger_event): New public function. Sends the debugger an
+ event if we're running in the Mono Debugger and does nothing otherwise.
+
+ * mono.c: Don't initialize the Mono Debugger here.
+
+ * jit.c (mono_debug_insert_breakpoint): Removed, this isn't used anymore.
+ (mono_thread_start_cb, mono_thread_attach_cb): Call
+ mono_debugger_event() to send the debugger a callback.
+
+2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * debug.c: make all public symbols just dummy for windows.
+
+2003-01-20 Miguel de Icaza <miguel@ximian.com>
+
+ * debug.c (initialize_debugger_support): ifdef out the call to
+ mono_debugger_init_thread_debug for the release.
+
+ Someone should look into why its not defined. I think the problem
+ is what Dick pointed out somewhere: code in io-layer is not
+ supposed to ever be used in Windows, so code for the debugger that
+ lives there must be moved elsewhere.
+
+2003-01-19 Martin Baulig <martin@ximian.com>
+
+ * debug.c: Ok, this should now finally be working this time ....
+
+2003-01-18 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debugger_jit_exec): Send the background thread a
+ SIGKILL before returning.
+
+2003-01-17 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg: removed duplicated CONV_OVF_I4
+
+2003-01-17 Martin Baulig <martin@ximian.com>
+
+ * debug.c: Don't use mono_once here. Reworked the API a bit to
+ use `mono_debug_' and `debug_' for the general debugging API and
+ `mono_debugger_' and `debugger_' for the Mono Debugger stuff.
+
+2003-01-16 Martin Baulig <martin@ximian.com>
+
+ * debug.c (debugger_thread_func): We don't need to `raise
+ (SIGSTOP)' anymore; the thread manager already takes care of this.
+
+2003-01-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c (arch_handle_exception): exclude runtime invoke
+ wrapper from the stack trace
+
+ * jit.c (mono_cfg_new): allocate extra space to store esp (used by exceptions)
+ (mono_thread_start_cb): save an additional LMF at thread start
+
+2003-01-16 Martin Baulig <martin@ximian.com>
+
+ * jit.c (mono_runtime_install_handlers): Use SYS_sigaction() for
+ the mono_thread_get_abort_signal () - this is SIGUSR1 on FreeBSD
+ and the LinuxThreads port doesn't allow you to override the handler.
+ [FIXME: This avoids an assertion failure on startup, but there's
+ still an issue with thread termination.]
+
+2003-01-16 Martin Baulig <martin@ximian.com>
+
+ * debug.c (debugger_thread_func): We don't need to `raise
+ (SIGSTOP)' anymore; the thread manager already takes care of this.
+
+2003-01-16 Martin Baulig <martin@ximian.com>
+
+ * debug.c: Use the mono/io-layer functions here instead of gthread.
+
+2003-01-14 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_jit_compile_method): make sure runtime_init is called
+ (mono_analyze_stack): make sure runtime_init is called
+
+2003-01-14 Martin Baulig <martin@ximian.com>
+
+ * debug.c (debugger_update_symbol_file_table): Moved all the
+ functionality into debugger_update_symbol_file_table_internal();
+ the latter one will be called from the background thread while
+ already owning the lock. This'll allow us to step into
+ debugger_update_symbol_file_table() in the debugger and debug it.
+
+2003-01-14 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am: Link against gthread.
+
+ * jit.c: After realizing that mono-mutex doesn't work either
+ because it doesn't support recursive mutexes on FreeBSD, rewrote
+ the whole thread stuff to use gthread. This seems to fix this
+ weird deadlock in the debugger as well.
+
+2003-01-12 Alp Toker <alp@atoker.com>
+
+ * exception.c: Typo fix: insinde -> inside
+
+2003-01-08 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c (ves_icall_get_frame_info): skip one more frame and also
+ MONO_WRAPPER_RUNTIME_INVOKE wrappers
+ (x86_unwind_native_frame): disable unnecessary assertion
+
+2003-01-07 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c (ves_icall_get_frame_info): fix bug 36382
+
+Tue Jan 7 15:15:41 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c: handle wrapper_data in NEWOBJ/CALL.
+
+2003-01-07 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): add check for NULL target in STFLD
+
+2003-01-06 Martin Baulig <martin@ximian.com>
+
+ * debug.c (debugger_finished_mutex): Use a recursive mutex here.
+
+ * debug.c: Correctly handle the `debugger_finished_mutex'; it is
+ only unlocked by the pthread_cond_wait() in mono_debugger_wait().
+
+2003-01-04 Jackson Harper <jackson@latitudegeo.com>
+
+ * debug.c: Move must_send_finished var declaration out of #if win32
+ block (this fixes the build on win32)
+
+2003-01-05 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debugger_jit_exec): Custom version of mono_jit_exec();
+ this is used when we're running inside the Mono Debugger
+ (mono_debugger_wait): Put the waiting code into a function of its own.
+
+ * mono.c (main): Call mono_debugger_jit_exec() instead of
+ mono_jit_exec() if we're running inside the Mono Debugger.
+
+2003-01-05 Martin Baulig <martin@ximian.com>
+
+ * debug.h (MonoDebugFormat): Added
+ `MONO_DEBUG_FORMAT_MONO_DEBUGGER'; this allows us to check whether
+ we're running inside the Mono Debugger prior to the args parsing.
+
+2003-01-04 Martin Baulig <martin@ximian.com>
+
+ * debug.c (release_symbol_file_table): Only call this if we're
+ actually modifying the symbol tables.
+ (mono_debug_open): Always set the `mono_debugger_class_init_func'
+ for MONO_DEBUG_FORMAT_MONO; this stuff should also go into core dumps.
+
+2003-01-03 Martin Baulig <martin@ximian.com>
+
+ * debug.c: Disable the mono debugger stuff on Windows.
+
+2003-01-03 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debugger_trampoline_breakpoint_callback): New
+ function. This is called from the breakpoint trampoline to signal
+ the debugger and wait until it has reload the symbol tables.
+
+ * trampoline.c (get_breakpoint_trampoline): Call the new
+ mono_debugger_trampoline_breakpoint_callback() in the breakpoint
+ trampoline just before the breakpoint.
+
+2002-12-31 Martin Baulig <martin@ximian.com>
+
+ * debug.c (MonoDebuggerSymbolFileTable): Added `global_symfile'
+ field to point to the MonoGlobalSymbolTable.
+
+2002-12-30 Martin Baulig <martin@ximian.com>
+
+ * debug.c (MonoDebuggerInfo): Put back `symbol_file_modified'.
+ This variable now specifies that the symbol tables have been
+ modified after the last notification has been send. The debugger
+ uses this flag to check whether it needs to reload the symbol
+ tables or not.
+ (debugger_compile_method): Just send a notification to the
+ debugger, but don't set the modified flag. It may or may not be
+ set when the debugger gets the notification - depending on whether
+ the JIT compilation added a new method to the symbol tables.
+
+2002-12-30 Martin Baulig <martin@ximian.com>
+
+ * debug.c (debugger_compile_method): This is a wrapper around
+ mono_compile_method() which always sends a notification to the
+ debugger.
+
+2002-12-30 Martin Baulig <martin@ximian.com>
+
+ * debug.c: Reload the symbol file table before sending the
+ notification event to the debugger.
+ (MonoDebuggerInfo): Removed `update_symbol_file_table'.
+
+2002-12-31 Martin Baulig <martin@ximian.com>
+
+ * debug.c: Propertly lock everything and avoid race conditions.
+ (MonoDebuggerInfo): Removed the `symbol_file_modified' again.
+
+2002-12-31 Duncan Mak <duncan@ximian.com>
+
+ * debug.c (initialize_debugger_support): Fix build error by
+ declaring ret at the top of the function.
+
+2002-12-30 Martin Baulig <martin@ximian.com>
+
+ * debug.c: When running under the mono debugger, create a special
+ debugger thread; always protect the symbol tables with a mutex.
+
+2002-12-28 Martin Baulig <martin@ximian.com>
+
+ * debug.c (MonoDebuggerInfo): Added `symbol_file_modified'; it's
+ incremented each time one of the symbol tables is modified.
+
+Thu Dec 19 18:31:54 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c: fix LDELEMA implementation here as well.
+
+Wed Dec 18 11:42:58 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c: handle CEE_CONV_OVF_U8_UN like CEE_CONV_OVF_I8_UN.
+
+Wed Dec 18 11:36:04 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c: query the thread abort signal from the runtime.
+
+2002-12-12 Juli Mallett <jmallett@FreeBSD.org>
+
+ * jit.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
+
+2002-12-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * jit.c (mono_analyze_stack): call the utility function
+ mono_field_from_token to avoid code duplication.
+
+2002-12-02 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): added some additinal checks to verify IL code
+
+ * x86.brg (stmt): POP floating point stack correctly
+
+2002-11-28 Dietmar Maurer <dietmar@ximian.com>
+
+ * emit-x86.c (arch_emit_prologue): don't save caller saved
+ registers twice.
+
+ * exception.c (x86_unwind_native_frame): support exceptions inside
+ native code using gcc generated exception tables (-fexception).
+
+2002-11-19 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c: include some code from Zoltan Varga, but modified
+ it slightly.
+
+2002-11-27 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c: massive code cleanups. The code is still
+ architecture dependent, but it should be now possible to reuse the
+ complex parts for other architecture.
+
+2002-11-15 Dick Porter <dick@ximian.com>
+
+ * jit.c: Pass the attach callback to mono_runtime_init().
+
+2002-11-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * jit.c: display the domain name in trace output.
+
+2002-11-08 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (reg): fix bug #2721
+
+ * jit.c (mono_runtime_install_handlers): impl.
+
+2002-10-17 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debug_add_method): Make this actually work if we don't
+ have any lifetime information.
+
+2002-10-15 Martin Baulig <martin@gnome.org>
+
+ * jit.cs (PUSH_TREE): Always set t->cli_addr here.
+
+ * debug.c (generate_line_number): Small fix to make this actually
+ work for more complex things.
+
+2002-10-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (freg): use fprem instead of fprem1
+
+2002-10-03 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (ves_array_element_address): added check for out of range index
+ (mono_analyze_stack): added fix for bug #31654
+
+2002-10-01 Martin Baulig <martin@gnome.org>
+
+ * debug.c: Don't create an .il file for the dynamic symbol file.
+
+2002-10-01 Martin Baulig <martin@gnome.org>
+
+ * debug.c (MonoDebuggerInfo): Added mono_runtime_invoke().
+
+2002-09-27 Martin Baulig <martin@gnome.org>
+
+ * debug.c (debug_load_method_lines): Don't use sigaction() on win32.
+
+2002-09-27 Dick Porter <dick@ximian.com>
+
+ * mono.c: Tell glib what the program name is, by passing it the
+ name of the managed file we're executing
+
+2002-09-26 Martin Baulig <martin@gnome.org>
+
+ * trampoline.c (x86_magic_trampoline): Don't insert the breakpoint
+ trampoline into the vtable, also use it for non-virtual methods,
+ remove the breakpoint when done.
+
+2002-09-26 Martin Baulig <martin@gnome.org>
+
+ * debug.c (debug_load_method_lines): Block SIGCHLD while running
+ monodis.
+
+2002-09-26 Martin Baulig <martin@gnome.org>
+
+ * debug.c: Reworked the whole debugging stuff. We have now one
+ single `mono_debug_handle' which keeps a hashtable of
+ `AssemblyDebugInfo's (which may have different debugging formats).
+ The AssemblyDebugInfo is now created when the assembly is loaded,
+ but never when adding a class/type.
+
+ * mono.c: Initialize debugging stuff after corlib and the assembly
+ have been loaded.
+
+2002-09-25 Martin Baulig <martin@gnome.org>
+
+ * debug-private.h (DebugLineNumberInfo): Removed. There's now a
+ MonoDebugLineNumberEntry type in debug-mono-symfile.h which we're
+ using instead of it.
+ (DebugMethodInfo): Removed `line_numbers'.
+
+ * debug.c: Reworked the line number generation; we're now using
+ the MonoDebugLineNumberEntry try for all debugging formats. This
+ type also includes the line number and IL offset, this allows the
+ JIT to produce better line number info: we only emit line number
+ information for source lines which actually have code.
+
+2002-09-25 Martin Baulig <martin@gnome.org>
+
+ * debug.h: Removed external declaration of all functions which
+ should only be called from the Mono Debugger and also made them
+ static. Since the debugger gets their address from the
+ `MONO_DEBUGGER__debugger_info' vtable, there's no need to export
+ these functions.
+
+2002-09-25 Martin Baulig <martin@gnome.org>
+
+ Improved breakpoint support, we can now dynamically insert and
+ remove breakpoints at runtime and when called from withing the
+ Mono Debugger, we're using a special breakpoint trampoline.
+
+ * debug.h (mono_method_has_breakpoint): New method to check
+ whether to insert a breakpoint for a method.
+ (mono_insert_breakpoint): New method to insert a breakpoint.
+ (mono_insert_breakpoint_full): New method to insert a breakpoint,
+ takes a MonoMethodDesc.
+ (mono_remove_breakpoint): New method to remove a breakpoint.
+
+ * debug.c (mono_debugger_insert_breakpoint): New function for the
+ debugger. Should only be called from the debugger.
+ (mono_debugger_remove_breakpoint): Likewise.
+
+ * mono.c (main): Use mono_insert_breakpoint() to insert breakpoints.
+
+ * trampoline.c (get_breakpoint_trampoline): New static function to
+ create a special breakpoint trampoline for the debugger.
+ (x86_magic_trampoline): If we're running inside the Mono Debugger
+ and a breakpoint was requested for the method, generate a special
+ breakpoint trampoline.
+
+ * jit.c (mono_debug_methods): Removed, use mono_insert_breakpoint()
+ to insert a breakpoint.
+ (mono_debug_last_breakpoint_address): Removed.
+ (match_debug_method): Removed, use mono_method_has_breakpoint().
+
+Wed Sep 25 12:04:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c: reorder mono_runtime_cleanup () call since it needs the
+ engine still fully working.
+
+2002-09-24 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debug_open): When we're invoked from inside the
+ Mono Debugger, set mono_debugger_class_init_func (exported in
+ metadata/class.c) to mono_add_type().
+ (mono_add_type): Call mono_debug_symfile_add_type().
+
+Tue Sep 24 11:34:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c: avoid including cil-coff.h (again). Optimize typeof (type).
+ Run finalize on domain cleanup.
+ * mono.c: call setlocale ().
+ * trampoline.c: clearer error message for invalid trampoline.
+
+2002-09-21 Martin Baulig <martin@gnome.org>
+
+ * debug.c (MonoDebuggerSymbolFileTable): Use an actual typedef for this
+ instead of writing a byte blob.
+ (mono_debug_make_symbols): This doesn't touch the symbol tables anymore.
+ (mono_debug_add_method): Incrementally add the new method to the symbol
+ table.
+
+ * exception.c (arch_handle_exception): If we have debugging support,
+ call mono_debugger_update_symbol_file_table () as well.
+
+2002-09-20 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debug_add_method): The `MonoDebugVarInfo' now includes
+ the size of the variable.
+
+2002-09-18 Dietmar Maurer <dietmar@ximian.com>
+
+ * linear-scan.c (mono_analyze_liveness): we can save 30% of needed
+ iterations if we visit blocks in reverse order.
+
+2002-09-12 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): cleaup of the array code
+
+ * exception.c: added patch from Julio Merno to fix bug #30048
+
+ * jit.c (mono_analyze_stack): code cleanup, fix bug #29365
+
+2002-09-09 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (LDELEMA): use x86_lea
+
+2002-09-06 Martin Baulig <martin@gnome.org>
+
+ * debug.c (debug_update_il_offsets): Fixed a memory corruption bug.
+ If you were getting random crashes when using the JIT with debugging
+ turned on, this fixes it.
+
+2002-09-06 Dietmar Maurer <dietmar@ximian.com>
+
+ * emit-x86.c (arch_emit_epilogue): use pop instead of mov
+
+2002-09-05 Martin Baulig <martin@gnome.org>
+
+ * debug.c (MONO_DEBUGGER__debugger_info): New global data symbol
+ which is read by the debugger.
+
+Wed Sep 4 14:06:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: link libmono directly into mono. Use a ld script
+ to reduce exported symbols.
+
+2002-09-03 Martin Baulig <martin@gnome.org>
+
+ * debug.c (free_method_info): Make this actually work.
+
+2002-09-03 Martin Baulig <martin@gnome.org>
+
+ * debug.h (MonoDebugFormat): Killed MONO_DEBUG_FORMAT_DWARF2_PLUS.
+ * debug-dwarf2-plus.c: Removed.
+
+ * debug-private.h (DebugMethodInfo): Removed the `method_info' field.
+ (AssemblyDebugInfo): Removed the old `symfile' field and renamed
+ `mono_symfile' to `symfile'.
+
+ * debug.c (mono_debug_open): Replaced the assembly argument with a
+ file name argument; you can now call this before loading the assembly.
+ (debug_generate_method_lines): The MonoDebugILOffsetInfo struct is gone,
+ we now use MonoSymbolFileLineNumberEntry's and a separate address array
+ instead; splitted out all MonoSymbolFileLineNumberEntry code into
+ debug_generate_il_offsets() and debug_update_il_offsets().
+ (mono_debug_add_method): Don't create the MonoDebugMethodInfo here; it's
+ created when reading the symbol file or from debug_load_method_lines().
+ (debug_load_method_lines): Create the MonoDebugMethodInfo for all methods.
+
+ * exception.c (arch_handle_exception): Call mono_debug_make_symbols() before
+ looking up an address.
+
+ * debug.c: Don't create the .il files for MONO_DEBUG_FORMAT_MONO.
+
+ * mono.c (main): Initialize debugging before loading the first assembly.
+
+2002-08-28 Dick Porter <dick@ximian.com>
+
+ * mono.c: mono_set_rootdir() doesnt take any args now
+
+ * Makefile.am: Export HOST_CC for w32 builds
+
+2002-08-28 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_store_tree): only allocate vars if really necessary
+
+2002-08-27 Martin Baulig <martin@gnome.org>
+
+ * debug.c: The mono symbol file is installed together with the assembly
+ it belongs to and it's used on a per-image basis.
+
+Tue Aug 27 19:44:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * mono.c: don't use the cil-coff header outside of the loader.
+
+2002-08-27 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debugger_internal_get_symbol_files): Removed, we need
+ to use global variables for this since they're stored in a core file.
+ (mono_debugger_symbol_file_table_generation): New global variable.
+ (mono_debugger_symbol_file_table): New global variable.
+ (mono_debugger_update_symbol_file_table): New global function to update
+ the symbol file table.
+
+2002-08-27 Martin Baulig <martin@gnome.org>
+
+ * trampoline.c (mono_generic_trampoline_code): New global variable.
+ (arch_create_jit_trampoline): Use the new global variable to store the
+ generic trampoline code instead of using a static one. This allows the
+ debugger to access this variable to check whether a method is a trampoline.
+
+ * debug.h (mono_generic_trampoline_code): Added external declaration.
+
+2002-08-27 Martin Baulig <martin@gnome.org>
+
+ * debug.c (MonoDebugHandle): Moved the method hash into the
+ AssemblyDebugInfo struct since we need to use a separate hash for each
+ MonoImage.
+
+ * debug.c: Added special undocumented command line argument to create a
+ symbol file for IL files on-the-fly. In this case, we also need to create
+ the IL files and parse them.
+ (mono_debugger_internal_get_symbol_files): Return something more reasonable.
+
+2002-08-26 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debugger_internal_free_symbol_files): New function.
+ (mono_debugger_internal_symbol_files_changed): New global variable.
+
+2002-08-24 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debugger_internal_get_symbol_files): New function.
+
+2002-08-24 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debug_write_symbols): Added support for the new
+ debugging format.
+
+ * mono.c (main): The `--debug' argument now knows about a new
+ debugging format `mono' which will be used to display source lines
+ in backtraces.
+
+ * debug.h (MonoDebugFormat): Added a new MONO_DEBUG_FORMAT_MONO
+ which will be used when displaying backtraces. It reads a new
+ binary symbol file.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * jit.c (match_debug_method): Don't include runtime invoke methods
+ in the search.
+
+ * mono.c (main): Accept `Main' as argument to --break to insert a
+ breakpoint on the application's main method.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * debug-dwarf2.c (dwarf2_write_class_field): Don't include any static fields.
+
+2002-08-21 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c (arch_handle_exception): don't set stack_trace to
+ null (so that it contains the full trace even when we rethrow the
+ exception).
+
+2002-08-19 Nick Drochak <ndrochak@gol.com>
+
+ * x86.brg (mono_llmult_ovf): Simplified the code greatly by refactoring
+ the algebraic form we are using. This also eliminated a silly overflow
+ of the intermediate result that was causing troubles.
+
+2002-08-16 Nick Drochak <ndrochak@gol.com>
+
+ * x86.brg (mono_llmult_ovf): Flip ALL the bits, dummy. Now negative numbers
+ work.
+
+2002-08-15 Nick Drochak <ndrochak@gol.com>
+
+ * x86.brg (mono_llmult_ovf): Fix so it throws an overflow when result
+ will not fit in 64 bits. Fixes bug #27375.
+
+Wed Aug 14 17:31:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * exception.c: updates for API changes in metadata/.
+
+2002-08-13 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_jit_init): use ((gpointer)-1) as end_of_stack
+ address for the main thread.
+
+2002-08-12 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): added support for Thread::Abort ()
+
+2002-08-08 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c (arch_handle_exception): simply return and let the
+ libpthread/kernel restore the context. This should work on recent
+ versions of linuxthreads.
+
+ * jit.c (mono_runtime_install_handlers): switch back to use
+ sigaction from libpthreads. As long as this does not make problems
+ we should use this instead of syscall.
+
+2002-08-07 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c: removed the createdelegate icall
+ (mono_analyze_stack): special case Array::Address()
+
+2002-08-06 Dietmar Maurer <dietmar@ximian.com>
+
+ * emit-x86.c (arch_emit_prologue): make the call to
+ mono_get_lmf_addr relocatable.
+ (arch_jit_compile_cfg): do not waste memory
+ (arch_jit_compile_cfg): use a mempool to store native code. This
+ improves locality of code.
+
+2002-08-01 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): impl. CEE_MONO_RETOBJ
+
+2002-07-30 Sergey Chaban <serge@wildwestsoftware.com>
+
+ * x86.brg (LOCALLOC): under Windows, if allocation size is bigger
+ than one page, it's necessary to allocate memory incrementally,
+ in page-size steps, performing stack-touch every time.
+ Also added LOCALLOC(CONST_I4) implementation.
+
+2002-07-27 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_get_runtime_method): code cleanup
+
+ * x86.brg: we do not need to save EAX/ECX/EDX in stmt:
+
+2002-07-24 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): added CEE_TAIL (but it is ignored)
+
+Wed Jul 24 13:02:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * jit.c, jit.h, exception.c: implemented stack walking function.
+
+2002-07-24 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (ARG_OBJ): removed zero sized object warning
+
+2002-07-23 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_allocate_excvar): mark excvar as volatile
+
+ * emit-x86.c (enter_method): use arch_get_argument_info to get
+ stack layout.
+
+ * jit.c (mono_analyze_stack): use arch_get_argument_info to get
+ stack layout.
+ (mono_analyze_stack): removed unused code
+
+ * emit-x86.c (arch_allocate_arg): impl.
+
+2002-07-22 Dietmar Maurer <dietmar@ximian.com>
+
+ * emit-x86.c (arch_allocate_var): fix alignment bug
+
+ * x86.brg (X86_CALL_BEGIN): add argument padding before emitting a call
+
+ * jit.c (mono_analyze_stack): s/k/k + 1/
+
+ * x86.brg (LOCALLOC): align to MONO_FRAME_ALIGNMENT
+
+ * emit-x86.c (arch_get_argument_info): impl.
+
+2002-07-21 Miguel de Icaza <miguel@ximian.com>
+
+ * exception.c (arch_handle_exception): Memory leak fix.
+
+2002-07-19 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack): avoid recursive inlining
+
+Fri Jul 19 18:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * emit-x86.c: temporary workaround for gcc bug.
+ * jit.h, jit.c, mono.c: move mono_jit_image to jit.c.
+ Don't include config.h in headers.
+
+2002-07-19 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg: correctly align valuetype arguments on the stack
+
+ * jit.c (mono_analyze_stack): do not compute frame size here.
+
+ * x86.brg: use macros to avoid code duplication for CALL opcodes,
+ compute frame size in x86.brg
+
+2002-07-18 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (ARG_OBJ): allow zero sized ARG_OBJ
+
+ * exception.c (arch_handle_exception): removed duplicated code,
+ added support for exception filters
+
+ * jit.c (mono_jit_compile_method): support exception filters
+
+2002-07-17 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit.c (mono_analyze_stack CEE_DIV): added fix from Zoltan Varga
+ (bug #27423)
+ * jit.c: s/ISSTRUCT/MONO_TYPE_ISSTRUCT/
+
+ * helpers.c (mono_map_ldind_type): added suggested changes from
+ Zoltan Varga (support MONO_TYPE_U), variou 64bit fixes
+
+ * jit.c (mono_analyze_stack): remove the vtype pointer from the
+ stack (fix bug #27420)
+
+2002-07-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (CALL_VOID): fix bug #27751
+ (CONV_R_UN) use reg2 instead of reg1 for the negative check /fix bug 27849.
+
+ * jit.c (mono_analyze_stack): adjust valuetype size for pinvoke calls
+
+i2002-07-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (freg): new rule freg: CALL_R8 (this, reg)
+
+2002-07-10 Dietmar Maurer <dietmar@ximian.com>
+
+ * emit-x86.c (arch_emit_prologue): added code to save LMF
+
+2002-07-04 Dietmar Maurer <dietmar@ximian.com>
+
+ * x86.brg (LOCALLOC): added fix from Zoltan Varga (for bug #27396)
+
+2002-07-05 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debug_add_method): Fix a bug in the `begin_scope' and
+ `end_scope' calculations when linear scan register allocation is disabled.
+
+2002-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mono.c: removed the "RESULT: X" message.
+
+2002-07-01 Dietmar Maurer <dietmar@ximian.com>
+
+ * exception.c (arch_get_call_finally): restore caller saved
+ register used by global reg. allocation when calling finally
+ handlers (fixes bug #24943).
+
+2002-07-01 Dick Porter <dick@ximian.com>
+
+ * jit.c (mono_jit_exec): Removed unneeded argument to
+ mono_runtime_run_main()
+
+2002-06-28 Martin Baulig <martin@gnome.org>
+
+ * debug.c (debug_generate_method_lines, mono_debug_add_method): Make methods
+ start on the nop instruction to make single-stepping into an already-JITed
+ method work.
+
+2002-06-26 Martin Baulig <martin@gnome.org>
+
+ * debug.c (mono_debug_source_location_from_address): Added
+ `guint32 *line_number' argument. If it's not NULL, store the line number
+ there and return the file name without the line number.
+
+ * exception.c (ves_icall_get_trace): Fill in `sf->filename' and `sf->line'.
+ (ves_icall_get_frame_info): Likewise.
+
2002-06-25 Dick Porter <dick@ximian.com>
* jit.c (mono_jit_exec): Pass the assembly to mono_runtime_run_main
diff --git a/mono/jit/Makefile.am b/mono/jit/Makefile.am
index 4db65b7b71f..a79805f5b18 100644
--- a/mono/jit/Makefile.am
+++ b/mono/jit/Makefile.am
@@ -3,49 +3,63 @@ INCLUDES = \
$(GMODULE_CFLAGS) \
$(GLIB_CFLAGS)
+liboldmono_la_LDFLAGS=-Wl,-version-script=$(srcdir)/ldscript
+
if X86
-bin_PROGRAMS = mono
-lib_LIBRARIES = libmono.a
+if PLATFORM_WIN32
+export HOST_CC
+endif
+
+bin_PROGRAMS = oldmono
+lib_LTLIBRARIES = liboldmono.la
+
+liboldmono_la_LIBADD = \
+ ../metadata/libmonoruntime.la \
+ ../metadata/libmetadata.la \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ ../os/libmonoos.la
+
endif
-libmono_a_SOURCES = \
+jitsources = \
win32-exception.c \
win32-exception.h \
codegen.h \
codegen-x86.c \
emit-x86.c \
- jit.h \
- regset.h \
regset.c \
- debug.h \
- debug-private.h \
- debug.c \
- debug-stabs.c \
- debug-dwarf2.c \
- debug-dwarf2-plus.c \
+ debug-jit.h \
+ debug-jit.c \
jit.c \
trampoline.c \
- delegate.c \
exception.c \
- invoke.c \
- message.c \
linear-scan.c \
helpers.h \
helpers.c
-mono_SOURCES = mono.c
+liboldmono_la_SOURCES = $(jitsources)
+
+liboldmonoincludedir = $(includedir)/mono/jit
+liboldmonoinclude_HEADERS = \
+ jit.h \
+ regset.h
-mono_LDADD = \
- libmono.a \
- ../metadata/libmonoruntime.a \
- ../metadata/libmetadata.a \
- ../io-layer/libwapi.a \
- ../utils/libmonoutils.a \
- ../os/libmonoos.a \
+oldmono_SOURCES = mono.c $(jitsources)
+
+#mono_LDFLAGS=-static
+oldmono_LDADD = \
+ ../metadata/libmonoruntime.la \
+ ../metadata/libmetadata.la \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ ../os/libmonoos.la \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
-lm
+oldmono_CFLAGS = $(AM_CFLAGS)
+
codegen-x86.c codegen.h: x86.brg
../monoburg/monoburg $(srcdir)/x86.brg -d codegen.h -s codegen-x86.c
@@ -53,5 +67,5 @@ BUILT_SOURCES = codegen-x86.c codegen.h
CLEANFILES = $(BUILT_SOURCES)
-EXTRA_DIST = x86.brg
+EXTRA_DIST = x86.brg ldscript
diff --git a/mono/jit/README b/mono/jit/README
new file mode 100644
index 00000000000..3d3eeeb59d9
--- /dev/null
+++ b/mono/jit/README
@@ -0,0 +1,10 @@
+Hello fellow developer,
+
+ This directory contains the first implementation of the Mono just-in-time
+compiler. This is what most people use as of April 2003 but we are phasing it
+out in favor of the new compilation architecture found in the directory "mini".
+
+ We encourage developers and contributors to look at the other JIT engine,
+as it is more extensible, easier, cleaner and more powerful.
+
+Miguel.
diff --git a/mono/jit/TODO b/mono/jit/TODO
index e1973b982e1..ab11a9232d9 100644
--- a/mono/jit/TODO
+++ b/mono/jit/TODO
@@ -1,17 +1,12 @@
* 64bit integer mult with overflow checks + test bench
-* correctly align value types on the stack and in arrays
-* impl. marshalling attributes for pinvoke
* raise exceptions everywhere
-* exceptions: save/restore floating point state
+* exceptions: save/restore floating point state?
* implement all floating point instruction in x86.brg, we also need to check
the floating branch instruction - some of them seems to be wrong, we need to
write better tests for that.
* document the functions and variables in the JIT
* implement a register set for FP registers (just count register usage on x86)
-* inline all calls in System.Math::*, we should use coprocessor instructions
- directly whenever possible.
-
* Calling conventions:
Implement fast call
@@ -20,8 +15,7 @@
Implement CONV_OVF_XXX (constant) variants that emit either
loads or exceptions (as we can always tell)
-
-
+
* use short jump opcodes where possible (for backward jumps), will give better
performance.
diff --git a/mono/jit/debug-dwarf2-plus.c b/mono/jit/debug-dwarf2-plus.c
deleted file mode 100644
index c2f09f8f5ae..00000000000
--- a/mono/jit/debug-dwarf2-plus.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/debug-symfile.h>
-#include <mono/jit/codegen.h>
-#include <mono/jit/debug.h>
-
-#include "debug-private.h"
-
-static MonoDebugMethodInfo *
-method_info_func (MonoDebugSymbolFile *symfile, guint32 token, gpointer user_data)
-{
- AssemblyDebugInfo *info = user_data;
- MonoMethod *method;
- DebugMethodInfo *minfo;
-
- method = g_hash_table_lookup (info->image->method_cache, GINT_TO_POINTER (token));
- if (!method)
- return NULL;
-
- minfo = g_hash_table_lookup (info->handle->methods, method);
-
- return (MonoDebugMethodInfo *) minfo;
-}
-
-void
-mono_debug_open_assembly_dwarf2_plus (AssemblyDebugInfo *info)
-{
- if (!(info->handle->flags & MONO_DEBUG_FLAGS_DONT_ASSEMBLE)) {
- struct stat stata, statb;
-
- if (stat (info->filename, &stata)) {
- g_warning ("cannot access assembly file (%s): %s",
- info->filename, g_strerror (errno));
- return;
- }
-
- /* If the stat() failed or the file is older. */
- if (stat (info->objfile, &statb) || (statb.st_mtime < stata.st_mtime)) {
- char *buf;
-
- buf = g_strdup_printf ("as %s -o %s", info->filename, info->objfile);
- system (buf);
- g_free (buf);
- }
- }
-
- if (!(info->handle->flags & MONO_DEBUG_FLAGS_DONT_PRECOMPILE))
- mono_jit_compile_image (info->image, FALSE);
-
- info->symfile = mono_debug_open_symbol_file (info->image, info->objfile, TRUE);
-}
-
-void
-mono_debug_close_assembly_dwarf2_plus (AssemblyDebugInfo *info)
-{
- if (info->symfile)
- mono_debug_close_symbol_file (info->symfile);
-}
-
-void
-mono_debug_write_assembly_dwarf2_plus (AssemblyDebugInfo *info)
-{
- if (info->symfile)
- mono_debug_update_symbol_file (info->symfile, method_info_func, info);
-}
diff --git a/mono/jit/debug-dwarf2.c b/mono/jit/debug-dwarf2.c
deleted file mode 100644
index 2866c269619..00000000000
--- a/mono/jit/debug-dwarf2.c
+++ /dev/null
@@ -1,1372 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/jit/codegen.h>
-#include <mono/jit/debug.h>
-
-#include "debug-private.h"
-
-#define ABBREV_COMPILE_UNIT 1
-#define ABBREV_SUBPROGRAM 2
-#define ABBREV_SUBPROGRAM_RETVAL 3
-#define ABBREV_BASE_TYPE 4
-#define ABBREV_FORMAL_PARAMETER 5
-#define ABBREV_PARAMETER 6
-#define ABBREV_LOCAL_VARIABLE 7
-#define ABBREV_STRUCT_TYPE 8
-#define ABBREV_STRUCT_MEMBER 9
-#define ABBREV_STRUCT_ACCESS 10
-#define ABBREV_ENUM_TYPE 11
-#define ABBREV_ENUM_VALUE 12
-#define ABBREV_ENUM_VALUE_UNSIGNED 13
-#define ABBREV_ENUM_VALUE_SIGNED 14
-#define ABBREV_CLASS_TYPE 15
-#define ABBREV_CLASS_INHERITANCE 16
-#define ABBREV_POINTER_TYPE 17
-#define ABBREV_CLASS_METHOD 18
-#define ABBREV_CLASS_METHOD_RETVAL 19
-#define ABBREV_ARTIFICIAL_PARAMETER 20
-#define ABBREV_SIMPLE_ARRAY 21
-#define ABBREV_ARRAY 22
-#define ABBREV_SUBRANGE 23
-
-// The following constants are defined in the DWARF 2 specification
-#define DW_TAG_array_type 0x01
-#define DW_TAG_class_type 0x02
-#define DW_TAG_enumeration_type 0x04
-#define DW_TAG_formal_parameter 0x05
-#define DW_TAG_member 0x0d
-#define DW_TAG_pointer_type 0x0f
-#define DW_TAG_compile_unit 0x11
-#define DW_TAG_structure_type 0x13
-#define DW_TAG_inheritance 0x1c
-#define DW_TAG_subrange_type 0x21
-#define DW_TAG_access_declaration 0x23
-#define DW_TAG_base_type 0x24
-#define DW_TAG_enumerator 0x28
-#define DW_TAG_subprogram 0x2e
-#define DW_TAG_variable 0x34
-
-#define DW_CHILDREN_no 0
-#define DW_CHILDREN_yes 1
-
-#define DW_AT_location 0x02
-#define DW_AT_name 0x03
-#define DW_AT_byte_size 0x0b
-#define DW_AT_stmt_list 0x10
-#define DW_AT_low_pc 0x11
-#define DW_AT_high_pc 0x12
-#define DW_AT_language 0x13
-#define DW_AT_const_value 0x1c
-#define DW_AT_lower_bound 0x22
-#define DW_AT_producer 0x25
-#define DW_AT_start_scope 0x2c
-#define DW_AT_upper_bound 0x2f
-#define DW_AT_accessibility 0x32
-#define DW_AT_artificial 0x34
-#define DW_AT_calling_convention 0x36
-#define DW_AT_count 0x37
-#define DW_AT_data_member_location 0x38
-#define DW_AT_encoding 0x3e
-#define DW_AT_external 0x3f
-#define DW_AT_type 0x49
-#define DW_AT_virtuality 0x4c
-#define DW_AT_vtable_elem_location 0x4d
-
-/* Martin Baulig's extensions. */
-#define DW_AT_end_scope 0x2121
-
-#define DW_FORM_addr 0x01
-#define DW_FORM_block4 0x04
-#define DW_FORM_data2 0x05
-#define DW_FORM_data4 0x06
-#define DW_FORM_data8 0x07
-#define DW_FORM_string 0x08
-#define DW_FORM_data1 0x0b
-#define DW_FORM_flag 0x0c
-#define DW_FORM_sdata 0x0d
-#define DW_FORM_udata 0x0f
-#define DW_FORM_ref4 0x13
-
-#define DW_ATE_void 0x00
-#define DW_ATE_address 0x01
-#define DW_ATE_boolean 0x02
-#define DW_ATE_complex_float 0x03
-#define DW_ATE_float 0x04
-#define DW_ATE_signed 0x05
-#define DW_ATE_signed_char 0x06
-#define DW_ATE_unsigned 0x07
-#define DW_ATE_unsigned_char 0x08
-
-#define DW_OP_const1u 0x08
-#define DW_OP_const1s 0x09
-#define DW_OP_constu 0x10
-#define DW_OP_consts 0x11
-#define DW_OP_plus 0x22
-#define DW_OP_reg0 0x50
-#define DW_OP_breg0 0x70
-#define DW_OP_fbreg 0x91
-#define DW_OP_piece 0x93
-
-#define DW_CC_normal 1
-#define DW_CC_program 2
-#define DW_CC_nocall 3
-
-#define DW_ACCESS_public 1
-#define DW_ACCESS_protected 2
-#define DW_ACCESS_private 3
-
-#define DW_VIRTUALITY_none 0
-#define DW_VIRTUALITY_virtual 1
-#define DW_VIRTUALITY_pure_virtual 2
-
-#define DW_LANG_C_plus_plus 0x04
-#define DW_LANG_Java 0x0b
-// This is NOT in the standard, we're using Java for the moment. */
-#define DW_LANG_C_sharp DW_LANG_C_plus_plus
-
-#define DW_LNS_extended_op 0
-#define DW_LNS_copy 1
-#define DW_LNS_advance_pc 2
-#define DW_LNS_advance_line 3
-#define DW_LNS_set_file 4
-#define DW_LNS_set_column 5
-#define DW_LNS_negate_stmt 6
-#define DW_LNS_set_basic_block 7
-#define DW_LNS_const_add_pc 8
-#define DW_LNS_fixed_advance_pc 9
-
-#define DW_LNE_end_sequence 1
-#define DW_LNE_set_address 2
-#define DW_LNE_define_file 3
-
-
-static const int line_base = 1, line_range = 8, opcode_base = 10;
-static const int standard_opcode_sizes [10] = {
- 0, 0, 1, 1, 1, 1, 0, 0, 0, 0
-};
-
-static void
-dwarf2_write_byte (FILE *f, int byte)
-{
- fprintf (f, "\t.byte %d\n", byte);
-}
-
-static void
-dwarf2_write_2byte (FILE *f, int word)
-{
- fprintf (f, "\t.word %d\n", word);
-}
-
-static void
-dwarf2_write_pair (FILE *f, int a, int b)
-{
- fprintf (f, "\t.uleb128 %d, %d\n", a, b);
-}
-
-static void
-dwarf2_write_long (FILE *f, unsigned long value)
-{
- fprintf (f, "\t.long %lu\n", value);
-}
-
-static void
-dwarf2_write_address (FILE *f, void *address)
-{
- fprintf (f, "\t.long 0x%lx\n", address);
-}
-
-static void
-dwarf2_write_string (FILE *f, const char *string)
-{
- fprintf (f, "\t.string \"%s\"\n", string);
-}
-
-static void
-dwarf2_write_sleb128 (FILE *f, long value)
-{
- fprintf (f, "\t.sleb128 %ld\n", value);
-}
-
-static void
-dwarf2_write_uleb128 (FILE *f, unsigned long value)
-{
- fprintf (f, "\t.uleb128 %lu\n", value);
-}
-
-static void
-dwarf2_write_section_start (FILE *f, const char *section)
-{
- fprintf (f, "\t.section .%s\n", section);
-}
-
-static void
-dwarf2_write_label (FILE *f, const char *label)
-{
- fprintf (f, ".L_%s:\n", label);
-}
-
-static void
-dwarf2_write_section_size (FILE *f, const char *start_label, const char *end_label)
-{
- fprintf (f, "\t.long .L_%s - .L_%s\n", end_label, start_label);
-}
-
-static void
-dwarf2_write_ref4 (FILE *f, const char *target_label)
-{
- fprintf (f, "\t.long .L_%s\n", target_label);
-}
-
-static void
-dwarf2_write_type_ref (FILE *f, unsigned long type_index)
-{
- fprintf (f, "\t.long .L_TYPE_%lu - .L_debug_info_b\n", type_index);
-}
-
-static void
-dwarf2_write_type_ptr_ref (FILE *f, unsigned long idx)
-{
- fprintf (f, "\t.long .L_TYPE_PTR_%lu - .L_debug_info_b\n", idx);
-}
-
-static void
-dwarf2_write_relative_ref (FILE *f, const gchar *name, unsigned long idx)
-{
- fprintf (f, "\t.long .L_%s_%lu - .L_debug_info_b\n", name, idx);
-}
-
-static void
-dwarf2_write_dw_lns_copy (FILE *f)
-{
- dwarf2_write_byte (f, DW_LNS_copy);
-}
-
-static void
-dwarf2_write_dw_lns_advance_pc (FILE *f, unsigned value)
-{
- dwarf2_write_byte (f, DW_LNS_advance_pc);
- dwarf2_write_uleb128 (f, value);
-}
-
-static void
-dwarf2_write_dw_lns_advance_line (FILE *f, int value)
-{
- dwarf2_write_byte (f, DW_LNS_advance_line);
- dwarf2_write_sleb128 (f, value);
-}
-
-static void
-dwarf2_write_dw_lns_set_file (FILE *f, unsigned value)
-{
- dwarf2_write_byte (f, DW_LNS_set_file);
- dwarf2_write_uleb128 (f, value + 1);
-}
-
-static void
-dwarf2_write_dw_lns_negate_stmt (FILE *f)
-{
- dwarf2_write_byte (f, DW_LNS_negate_stmt);
-}
-
-#if 0 /* never used */
-static void
-dwarf2_write_dw_lns_set_basic_block (FILE *f)
-{
- dwarf2_write_byte (f, DW_LNS_set_basic_block);
-}
-#endif
-
-static void
-dwarf2_write_dw_lne_end_sequence (FILE *f)
-{
- dwarf2_write_byte (f, 0);
- dwarf2_write_byte (f, 1);
- dwarf2_write_byte (f, DW_LNE_end_sequence);
-}
-
-static void
-dwarf2_write_dw_lne_set_address (FILE *f, void *address)
-{
- dwarf2_write_byte (f, 0);
- dwarf2_write_byte (f, sizeof (address) + 1);
- dwarf2_write_byte (f, DW_LNE_set_address);
- dwarf2_write_address (f, address);
-}
-
-static void
-dwarf2_write_base_type (MonoDebugHandle *debug, int idx,
- int type, int size, const gchar *name)
-{
- char buffer [BUFSIZ];
-
- sprintf (buffer, "TYPE_%d", idx);
- dwarf2_write_label (debug->f, buffer);
- // DW_TAG_basic_type
- dwarf2_write_byte (debug->f, ABBREV_BASE_TYPE);
- dwarf2_write_string (debug->f, name);
- dwarf2_write_byte (debug->f, type);
- dwarf2_write_byte (debug->f, size);
-}
-
-static void
-dwarf2_write_enum_value (MonoDebugHandle *debug, MonoClass *klass, int idx)
-{
- const void *ptr;
- guint32 field_index = idx + klass->field.first;
- guint32 crow;
-
- crow = mono_metadata_get_constant_index (klass->image, MONO_TOKEN_FIELD_DEF | (field_index + 1));
- if (!crow) {
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_long (debug->f, 0);
- return;
- }
-
- crow = mono_metadata_decode_row_col (&klass->image->tables [MONO_TABLE_CONSTANT], crow-1,
- MONO_CONSTANT_VALUE);
-
- ptr = 1 + mono_metadata_blob_heap (klass->image, crow);
-
- switch (klass->enum_basetype->type) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_U1:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_UNSIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_uleb128 (debug->f, *(guint8 *) ptr);
- break;
- case MONO_TYPE_I1:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_SIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_sleb128 (debug->f, *(gint8 *) ptr);
- break;
- case MONO_TYPE_CHAR:
- case MONO_TYPE_U2:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_UNSIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_uleb128 (debug->f, *(guint16 *) ptr);
- break;
- case MONO_TYPE_I2:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_SIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_sleb128 (debug->f, *(gint16 *) ptr);
- break;
- case MONO_TYPE_U4:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_UNSIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_uleb128 (debug->f, *(guint32 *) ptr);
- break;
- case MONO_TYPE_I4:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_SIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_sleb128 (debug->f, *(gint32 *) ptr);
- break;
- case MONO_TYPE_U8:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_UNSIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_uleb128 (debug->f, *(guint64 *) ptr);
- break;
- case MONO_TYPE_I8:
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_SIGNED);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- dwarf2_write_sleb128 (debug->f, *(gint64 *) ptr);
- break;
- default:
- g_assert_not_reached ();
- }
-}
-
-static void
-dwarf2_write_enum_type (MonoDebugHandle *debug, MonoClass *klass)
-{
- int i;
-
- // DW_TAG_enumeration_type
- dwarf2_write_byte (debug->f, ABBREV_ENUM_TYPE);
- dwarf2_write_string (debug->f, klass->name);
- dwarf2_write_long (debug->f, klass->instance_size - sizeof (MonoObject));
-
- for (i = 0; i < klass->field.count; i++) {
- if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_LITERAL)
- dwarf2_write_enum_value (debug, klass, i);
- }
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_enumeration_type ends here
-}
-
-static void
-dwarf2_write_class_field (MonoDebugHandle *debug, MonoClass *klass, int idx,
- int type_index, int start_offset)
-{
- MonoClass *subclass = mono_class_from_mono_type (klass->fields [idx].type);
- char start [BUFSIZ], end [BUFSIZ];
- static long label_index = 0;
-
- sprintf (start, "DSF1_%ld", ++label_index);
- sprintf (end, "DSF2_%ld", label_index);
-
- // DW_TAG_member
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_MEMBER);
- dwarf2_write_string (debug->f, klass->fields [idx].name);
- if (!subclass->valuetype)
- dwarf2_write_type_ptr_ref (debug->f, type_index);
- else
- dwarf2_write_type_ref (debug->f, type_index);
-
- if (klass->fields [idx].type->attrs & FIELD_ATTRIBUTE_PRIVATE)
- dwarf2_write_byte (debug->f, DW_ACCESS_private);
- else if (klass->fields [idx].type->attrs & FIELD_ATTRIBUTE_FAMILY)
- dwarf2_write_byte (debug->f, DW_ACCESS_protected);
- else
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
-
- dwarf2_write_section_size (debug->f, start, end);
- dwarf2_write_label (debug->f, start);
- dwarf2_write_byte (debug->f, DW_OP_constu);
- dwarf2_write_uleb128 (debug->f, klass->fields [idx].offset - start_offset);
- dwarf2_write_label (debug->f, end);
-
- dwarf2_write_long (debug->f, subclass->instance_size);
-}
-
-static void
-dwarf2_write_class_method (MonoDebugHandle *debug, MonoClass *klass, MonoMethod *method)
-{
- MonoType *ret_type = NULL;
- gchar **names;
- int i;
-
- if (method->signature->ret->type != MONO_TYPE_VOID)
- ret_type = method->signature->ret;
-
- // DW_TAG_subprogram
- if (ret_type)
- dwarf2_write_byte (debug->f, ABBREV_CLASS_METHOD_RETVAL);
- else
- dwarf2_write_byte (debug->f, ABBREV_CLASS_METHOD);
- dwarf2_write_string (debug->f, method->name);
-
- if (method->flags & METHOD_ATTRIBUTE_PUBLIC)
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- else if (method->flags & METHOD_ATTRIBUTE_PRIVATE)
- dwarf2_write_byte (debug->f, DW_ACCESS_private);
- else
- dwarf2_write_byte (debug->f, DW_ACCESS_protected);
-
- if (method->flags & METHOD_ATTRIBUTE_VIRTUAL)
- dwarf2_write_byte (debug->f, DW_VIRTUALITY_pure_virtual);
- else
- dwarf2_write_byte (debug->f, DW_VIRTUALITY_none);
-
- dwarf2_write_byte (debug->f, DW_CC_nocall);
-
- if (ret_type) {
- MonoClass *k = mono_class_from_mono_type (ret_type);
- int type_index = mono_debug_get_type (debug, k);
- dwarf2_write_type_ref (debug->f, type_index);
- }
-
- if (method->signature->hasthis) {
- int type_index = mono_debug_get_type (debug, klass);
-
- dwarf2_write_byte (debug->f, ABBREV_ARTIFICIAL_PARAMETER);
- dwarf2_write_string (debug->f, "this");
- dwarf2_write_type_ptr_ref (debug->f, type_index);
- dwarf2_write_byte (debug->f, 1);
- }
-
- names = g_new (char *, method->signature->param_count);
- mono_method_get_param_names (method, (const char **) names);
-
- for (i = 0; i < method->signature->param_count; i++) {
- MonoType *subtype = method->signature->params [i];
- MonoClass *subklass = mono_class_from_mono_type (subtype);
- int type_index = mono_debug_get_type (debug, subklass);
-
- // DW_TAG_formal_parameter
- dwarf2_write_byte (debug->f, ABBREV_FORMAL_PARAMETER);
- dwarf2_write_string (debug->f, names [i]);
- if (subklass->valuetype)
- dwarf2_write_type_ref (debug->f, type_index);
- else
- dwarf2_write_type_ptr_ref (debug->f, type_index);
- }
-
- g_free (names);
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_subprogram ends here
-}
-
-static void
-dwarf2_write_struct_type (MonoDebugHandle *debug, MonoClass *klass)
-{
- guint32 *idxs;
- int i;
-
- idxs = g_new0 (guint32, klass->field.last - klass->field.first + 1);
- for (i = 0; i < klass->field.count; i++) {
- MonoClass *subclass = mono_class_from_mono_type (klass->fields [i].type);
- idxs [i] = mono_debug_get_type (debug, subclass);
- }
-
- // DW_TAG_structure_type
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_TYPE);
- dwarf2_write_string (debug->f, klass->name);
- dwarf2_write_long (debug->f, klass->instance_size - sizeof (MonoObject));
-
- for (i = 0; i < klass->field.count; i++)
- dwarf2_write_class_field (debug, klass, i, idxs [i], sizeof (MonoObject));
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_structure_type ends here
-
- g_free (idxs);
-}
-
-static void
-dwarf2_write_class_type (MonoDebugHandle *debug, MonoClass *klass)
-{
- guint32 *idxs;
- int i;
-
- idxs = g_new0 (guint32, klass->field.last - klass->field.first + 1);
- for (i = 0; i < klass->field.count; i++) {
- MonoClass *subclass = mono_class_from_mono_type (klass->fields [i].type);
- idxs [i] = mono_debug_get_type (debug, subclass);
- }
-
- // DW_TAG_structure_type
- dwarf2_write_byte (debug->f, ABBREV_CLASS_TYPE);
- dwarf2_write_string (debug->f, klass->name);
- dwarf2_write_long (debug->f, klass->instance_size);
- if (klass->flags & TYPE_ATTRIBUTE_PUBLIC)
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- else
- dwarf2_write_byte (debug->f, DW_ACCESS_private);
-
- if (klass->parent && klass->parent->byval_arg.type == MONO_TYPE_CLASS) {
- guint32 parent_index = mono_debug_get_type (debug, klass->parent);
-
- // DW_TAG_inheritance
- dwarf2_write_byte (debug->f, ABBREV_CLASS_INHERITANCE);
- dwarf2_write_type_ref (debug->f, parent_index);
- if (klass->parent->flags & TYPE_ATTRIBUTE_PUBLIC)
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- else
- dwarf2_write_byte (debug->f, DW_ACCESS_private);
- }
-
- for (i = 0; i < klass->field.count; i++)
- dwarf2_write_class_field (debug, klass, i, idxs [i], 0);
-
- for (i = 0; i < klass->method.count; i++) {
- if (!strcmp (klass->methods [i]->name, ".ctor"))
- continue;
-
- dwarf2_write_class_method (debug, klass, klass->methods [i]);
- }
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_class_type ends here
-
- g_free (idxs);
-}
-
-static void
-dwarf2_write_array (MonoDebugHandle *debug, const gchar *name, MonoClass *element_class,
- int rank, int idx)
-{
- unsigned long uint32_index = mono_debug_get_type (debug, mono_defaults.uint32_class);
- char buffer [BUFSIZ];
- MonoArray array;
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_TYPE);
- dwarf2_write_string (debug->f, name);
- dwarf2_write_long (debug->f, sizeof (MonoArray));
-
- // DW_TAG_structure_type
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_MEMBER);
- dwarf2_write_string (debug->f, "max_length");
- dwarf2_write_type_ref (debug->f, uint32_index);
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- dwarf2_write_long (debug->f, 2);
- dwarf2_write_byte (debug->f, DW_OP_const1u);
- dwarf2_write_byte (debug->f, (guchar *) &array.max_length - (guchar *) &array);
- dwarf2_write_long (debug->f, 4);
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_MEMBER);
- dwarf2_write_string (debug->f, "bounds");
- dwarf2_write_relative_ref (debug->f, "ARRAY_BOUNDS_PTR", idx);
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- dwarf2_write_long (debug->f, 2);
- dwarf2_write_byte (debug->f, DW_OP_const1u);
- dwarf2_write_byte (debug->f, (guchar *) &array.bounds - (guchar *) &array);
- dwarf2_write_long (debug->f, 4);
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_MEMBER);
- dwarf2_write_string (debug->f, "vector");
- dwarf2_write_relative_ref (debug->f, "ARRAY_PTR", idx);
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- dwarf2_write_long (debug->f, 2);
- dwarf2_write_byte (debug->f, DW_OP_const1u);
- dwarf2_write_byte (debug->f, (guchar *) &array.vector - (guchar *) &array);
- dwarf2_write_long (debug->f, 4);
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_structure_type ends here
-
- sprintf (buffer, "ARRAY_BOUNDS_PTR_%u", idx);
- dwarf2_write_label (debug->f, buffer);
-
- // DW_TAG_pointer_type
- dwarf2_write_byte (debug->f, ABBREV_POINTER_TYPE);
- dwarf2_write_relative_ref (debug->f, "ARRAY_BOUNDS", idx);
-
- sprintf (buffer, "ARRAY_BOUNDS_%u", idx);
- dwarf2_write_label (debug->f, buffer);
-
- // DW_TAG_array_type
- dwarf2_write_byte (debug->f, ABBREV_ARRAY);
- dwarf2_write_string (debug->f, name);
- dwarf2_write_type_ref (debug->f, uint32_index);
- dwarf2_write_long (debug->f, rank * 2);
-
- // DW_TAG_subrange_type
- dwarf2_write_byte (debug->f, ABBREV_SUBRANGE);
- dwarf2_write_long (debug->f, 0);
- dwarf2_write_long (debug->f, rank-1);
- dwarf2_write_long (debug->f, rank);
-
- // DW_TAG_subrange_type
- dwarf2_write_byte (debug->f, ABBREV_SUBRANGE);
- dwarf2_write_long (debug->f, 0);
- dwarf2_write_long (debug->f, 1);
- dwarf2_write_long (debug->f, 2);
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_array_type ends here
-
- sprintf (buffer, "ARRAY_PTR_%u", idx);
- dwarf2_write_label (debug->f, buffer);
-
- // DW_TAG_array_type
- dwarf2_write_byte (debug->f, ABBREV_SIMPLE_ARRAY);
- dwarf2_write_string (debug->f, name);
- if (element_class->valuetype)
- dwarf2_write_type_ref (debug->f, mono_debug_get_type (debug, element_class));
- else
- dwarf2_write_type_ptr_ref (debug->f, mono_debug_get_type (debug, element_class));
-}
-
-static void
-dwarf2_write_array_type (MonoDebugHandle *debug, MonoClass *klass, int idx)
-{
- char buffer [BUFSIZ], *name;
- int i;
-
- buffer[0] = '\0';
- for (i = 0; i < klass->rank; i++)
- strcat (buffer, "[]");
-
- name = g_strdup_printf ("%s%s", klass->element_class->name, buffer);
-
- dwarf2_write_array (debug, name, klass->element_class, klass->rank, idx);
-
- g_free (name);
-}
-
-static void
-dwarf2_write_string_type (MonoDebugHandle *debug, MonoClass *klass, int idx)
-{
- unsigned long uint32_index = mono_debug_get_type (debug, mono_defaults.uint32_class);
- char buffer [BUFSIZ];
- MonoString string;
-
- // DW_TAG_structure_type
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_TYPE);
- dwarf2_write_string (debug->f, klass->name);
- dwarf2_write_long (debug->f, sizeof (MonoString));
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_MEMBER);
- dwarf2_write_string (debug->f, "length");
- dwarf2_write_type_ref (debug->f, uint32_index);
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- dwarf2_write_long (debug->f, 2);
- dwarf2_write_byte (debug->f, DW_OP_const1u);
- dwarf2_write_byte (debug->f, (guchar *) &string.length - (guchar *) &string);
- dwarf2_write_long (debug->f, 4);
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_MEMBER);
- dwarf2_write_string (debug->f, "chars");
- dwarf2_write_relative_ref (debug->f, "CHARS", idx);
- dwarf2_write_byte (debug->f, DW_ACCESS_public);
- dwarf2_write_long (debug->f, 2);
- dwarf2_write_byte (debug->f, DW_OP_const1u);
- dwarf2_write_byte (debug->f, (guchar *) &string.chars - (guchar *) &string);
- dwarf2_write_long (debug->f, 4);
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_structure_type ends here
-
- sprintf (buffer, "CHARS_%u", idx);
- dwarf2_write_label (debug->f, buffer);
-
- dwarf2_write_byte (debug->f, ABBREV_SIMPLE_ARRAY);
- dwarf2_write_string (debug->f, "Char[]");
- dwarf2_write_type_ref (debug->f, mono_debug_get_type (debug, mono_defaults.char_class));
-}
-
-static void
-dwarf2_write_class (MonoDebugHandle *debug, MonoClass *klass, int idx)
-{
- char buffer [BUFSIZ];
- int print = 0;
-
- if (!strncmp (klass->name, "My", 2)) {
- g_message (G_STRLOC ": %s - %s - %x", klass->name_space, klass->name, klass->flags);
- print = 1;
- // G_BREAKPOINT ();
- }
-
- if (!klass->valuetype) {
- sprintf (buffer, "TYPE_PTR_%u", idx);
- dwarf2_write_label (debug->f, buffer);
-
- // DW_TAG_pointer_type
- dwarf2_write_byte (debug->f, ABBREV_POINTER_TYPE);
- dwarf2_write_type_ref (debug->f, idx);
- }
-
- sprintf (buffer, "TYPE_%u", idx);
- dwarf2_write_label (debug->f, buffer);
-
- if (klass->enumtype) {
- dwarf2_write_enum_type (debug, klass);
- return;
- }
-
- switch (klass->byval_arg.type) {
- case MONO_TYPE_VALUETYPE:
- dwarf2_write_struct_type (debug, klass);
- break;
- case MONO_TYPE_CLASS:
- dwarf2_write_class_type (debug, klass);
- break;
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_ARRAY:
- dwarf2_write_array_type (debug, klass, idx);
- break;
- case MONO_TYPE_STRING:
- dwarf2_write_string_type (debug, klass, idx);
- break;
- default:
-#if 0
- g_message (G_STRLOC ": %s.%s - 0x%x - 0x%x", klass->name_space, klass->name,
- klass->byval_arg.type, klass->flags);
-#endif
-
- // DW_TAG_basic_type
- dwarf2_write_byte (debug->f, ABBREV_BASE_TYPE);
- dwarf2_write_string (debug->f, klass->name);
- dwarf2_write_byte (debug->f, DW_ATE_address);
- dwarf2_write_byte (debug->f, 0);
- break;
- }
-}
-
-static void
-dwarf2_write_variable_location (MonoDebugHandle *debug, MonoDebugVarInfo *var)
-{
- switch (var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS) {
- case MONO_DEBUG_VAR_ADDRESS_MODE_STACK:
- /*
- * Variable is on the stack.
- *
- * If `index' is zero, use the normal frame register. Otherwise, bits
- * 0..4 of `index' contain the frame register.
- *
- */
-
- if (!var->index)
- /* Use the normal frame register (%ebp on the i386). */
- dwarf2_write_byte (debug->f, DW_OP_fbreg);
- else
- /* Use a custom frame register. */
- dwarf2_write_byte (debug->f, DW_OP_breg0 + (var->index & 0x001f));
- dwarf2_write_sleb128 (debug->f, var->offset);
- break;
-
- case MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER:
- /*
- * Variable is in the register whose number is contained in bits 0..4
- * of `index'.
- *
- */
- dwarf2_write_byte (debug->f, DW_OP_reg0 + (var->index & 0x001f));
- if (var->offset) {
- dwarf2_write_byte (debug->f, DW_OP_consts);
- dwarf2_write_sleb128 (debug->f, var->offset);
- dwarf2_write_byte (debug->f, DW_OP_plus);
- }
- break;
-
- case MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS:
- /*
- * Variable is in two registers whose numbers are in bits 0..4 and 5..9 of
- * the `index' field.
- */
- dwarf2_write_byte (debug->f, DW_OP_reg0 + (var->index & 0x001f));
- dwarf2_write_byte (debug->f, DW_OP_piece);
- dwarf2_write_byte (debug->f, sizeof (int));
-
- dwarf2_write_byte (debug->f, DW_OP_reg0 + ((var->index & 0x1f0) >> 5));
- dwarf2_write_byte (debug->f, DW_OP_piece);
- dwarf2_write_byte (debug->f, sizeof (int));
-
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-static void
-dwarf2_write_parameter (MonoDebugHandle *debug, DebugMethodInfo *minfo, const gchar *name,
- MonoDebugVarInfo *var, MonoClass *klass)
-{
- static long label_index = 0;
- int type_index = mono_debug_get_type (debug, klass);
- char start [BUFSIZ], end [BUFSIZ];
-
- sprintf (start, "DT1_%ld", ++label_index);
- sprintf (end, "DT2_%ld", label_index);
-
- // DW_TAG_format_parameter
- dwarf2_write_byte (debug->f, ABBREV_PARAMETER);
- dwarf2_write_string (debug->f, name);
- if (klass->valuetype)
- dwarf2_write_type_ref (debug->f, type_index);
- else
- dwarf2_write_type_ptr_ref (debug->f, type_index);
- dwarf2_write_section_size (debug->f, start, end);
- dwarf2_write_label (debug->f, start);
- dwarf2_write_variable_location (debug, var);
- dwarf2_write_label (debug->f, end);
- dwarf2_write_long (debug->f, minfo->method_info.prologue_end);
-}
-
-static void
-dwarf2_write_variable (MonoDebugHandle *debug, DebugMethodInfo *minfo, const gchar *name,
- MonoDebugVarInfo *var, MonoClass *klass)
-{
- static long label_index = 0;
- int type_index = mono_debug_get_type (debug, klass);
- char start [BUFSIZ], end [BUFSIZ];
-
- sprintf (start, "DT3_%ld", ++label_index);
- sprintf (end, "DT4_%ld", label_index);
-
- // DW_TAG_formal_parameter
- dwarf2_write_byte (debug->f, ABBREV_LOCAL_VARIABLE);
- dwarf2_write_string (debug->f, name);
- if (klass->valuetype)
- dwarf2_write_type_ref (debug->f, type_index);
- else
- dwarf2_write_type_ptr_ref (debug->f, type_index);
- dwarf2_write_section_size (debug->f, start, end);
- dwarf2_write_label (debug->f, start);
- dwarf2_write_variable_location (debug, var);
- dwarf2_write_label (debug->f, end);
- dwarf2_write_address (debug->f, minfo->method_info.code_start + var->begin_scope);
- dwarf2_write_address (debug->f, minfo->method_info.code_start + var->end_scope);
-}
-
-static void
-write_method_lines_dwarf2 (MonoDebugHandle *debug, DebugMethodInfo *minfo)
-{
- guint32 st_line = 0;
- gpointer st_address = 0;
- int i;
-
- if (!minfo->line_numbers)
- return;
-
- // Start of statement program
- dwarf2_write_dw_lns_set_file (debug->f, minfo->source_file);
- dwarf2_write_dw_lns_advance_line (debug->f, minfo->start_line - 1);
- dwarf2_write_dw_lne_set_address (debug->f, minfo->method_info.code_start);
- dwarf2_write_dw_lns_negate_stmt (debug->f);
- dwarf2_write_dw_lns_copy (debug->f);
-
- st_line = minfo->start_line;
- st_address = minfo->method_info.code_start;
-
- for (i = 1; i < minfo->line_numbers->len; i++) {
- DebugLineNumberInfo *lni = g_ptr_array_index (minfo->line_numbers, i);
- gint32 line_inc, addr_inc, opcode;
- int used_standard_opcode = 0;
-
- line_inc = lni->line - st_line;
- addr_inc = (char *)lni->address - (char *)st_address;
-
- if (addr_inc < 0) {
- dwarf2_write_dw_lne_set_address (debug->f, lni->address);
- used_standard_opcode = 1;
- } else if (addr_inc && !line_inc) {
- dwarf2_write_dw_lns_advance_pc (debug->f, addr_inc);
- used_standard_opcode = 1;
- }
-
- if ((line_inc < 0) || (line_inc >= line_range)) {
- dwarf2_write_dw_lns_advance_pc (debug->f, addr_inc);
- dwarf2_write_dw_lns_advance_line (debug->f, line_inc);
- used_standard_opcode = 1;
- } else if (line_inc > 0) {
- opcode = (line_inc - 1) + (line_range * addr_inc) + opcode_base;
- g_assert (opcode >= 0);
-
- if (opcode >= 256) {
- dwarf2_write_dw_lns_advance_pc (debug->f, addr_inc);
- dwarf2_write_dw_lns_advance_line (debug->f, line_inc);
- used_standard_opcode = 1;
- } else
- dwarf2_write_byte (debug->f, opcode);
- }
-
- if (used_standard_opcode)
- dwarf2_write_dw_lns_copy (debug->f);
-
- st_line += line_inc;
- st_address = (char *)st_address + addr_inc;
- }
-
- dwarf2_write_dw_lne_set_address (debug->f,
- (char *)minfo->method_info.code_start +
- minfo->method_info.epilogue_begin);
- dwarf2_write_dw_lns_advance_line (debug->f, minfo->last_line - st_line);
- dwarf2_write_dw_lns_copy (debug->f);
-
- dwarf2_write_dw_lns_copy (debug->f);
- dwarf2_write_dw_lne_end_sequence (debug->f);
-}
-
-static void
-write_method_lines_func (gpointer key, gpointer value, gpointer user_data)
-{
- write_method_lines_dwarf2 (user_data, value);
-}
-
-static void
-write_line_numbers (MonoDebugHandle *debug)
-{
- /* State machine registers. */
- int i;
-
- // Line number information.
- dwarf2_write_section_start (debug->f, "debug_line");
- dwarf2_write_label (debug->f, "debug_line_b");
- dwarf2_write_section_size (debug->f, "DL1", "debug_line_e");
- dwarf2_write_label (debug->f, "DL1");
- dwarf2_write_2byte (debug->f, 2);
- dwarf2_write_section_size (debug->f, "DL2", "DL3");
- dwarf2_write_label (debug->f, "DL2");
- // minimum instruction length
- dwarf2_write_byte (debug->f, 1);
- // default is statement
- dwarf2_write_byte (debug->f, 1);
- // line base
- dwarf2_write_byte (debug->f, line_base);
- // line range
- dwarf2_write_byte (debug->f, line_range);
- // opcode base
- dwarf2_write_byte (debug->f, opcode_base);
- // standard opcode sizes
- for (i = 1; i < opcode_base; i++)
- dwarf2_write_byte (debug->f, standard_opcode_sizes [i]);
- // include directories
- dwarf2_write_byte (debug->f, 0);
- // file names
- for (i = 0; i < debug->source_files->len; i++) {
- gchar *source_file = g_ptr_array_index (debug->source_files, i);
- dwarf2_write_string (debug->f, source_file);
- dwarf2_write_uleb128 (debug->f, 0);
- dwarf2_write_uleb128 (debug->f, 0);
- dwarf2_write_uleb128 (debug->f, 0);
- }
- // end of list
- dwarf2_write_byte (debug->f, 0);
- dwarf2_write_label (debug->f, "DL3");
-
- g_hash_table_foreach (debug->methods, write_method_lines_func, debug);
-
- dwarf2_write_label (debug->f, "debug_line_e");
-}
-
-static void
-write_class_dwarf2 (MonoDebugHandle *debug, MonoClass *klass, guint idx)
-{
- switch (klass->byval_arg.type) {
- case MONO_TYPE_VOID:
- dwarf2_write_base_type (debug, idx, DW_ATE_unsigned, 0, "Void");
- break;
- case MONO_TYPE_BOOLEAN:
- dwarf2_write_base_type (debug, idx, DW_ATE_boolean, 1, "Boolean");
- break;
- case MONO_TYPE_CHAR:
- dwarf2_write_base_type (debug, idx, DW_ATE_unsigned_char, 2, "Char");
- break;
- case MONO_TYPE_I1:
- dwarf2_write_base_type (debug, idx, DW_ATE_signed, 1, "SByte");
- break;
- case MONO_TYPE_U1:
- dwarf2_write_base_type (debug, idx, DW_ATE_unsigned, 1, "Byte");
- break;
- case MONO_TYPE_I2:
- dwarf2_write_base_type (debug, idx, DW_ATE_signed, 2, "Int16");
- break;
- case MONO_TYPE_U2:
- dwarf2_write_base_type (debug, idx, DW_ATE_unsigned, 2, "UInt16");
- break;
- case MONO_TYPE_I4:
- dwarf2_write_base_type (debug, idx, DW_ATE_signed, 4, "Int32");
- break;
- case MONO_TYPE_U4:
- dwarf2_write_base_type (debug, idx, DW_ATE_unsigned, 4, "UInt32");
- break;
- case MONO_TYPE_I8:
- dwarf2_write_base_type (debug, idx, DW_ATE_signed, 8, "Int64");
- break;
- case MONO_TYPE_U8:
- dwarf2_write_base_type (debug, idx, DW_ATE_unsigned, 8, "UInt64");
- break;
- case MONO_TYPE_R4:
- dwarf2_write_base_type (debug, idx, DW_ATE_float, 4, "Float");
- break;
- case MONO_TYPE_R8:
- dwarf2_write_base_type (debug, idx, DW_ATE_float, 8, "Double");
- break;
- default:
- dwarf2_write_class (debug, klass, idx);
- break;
- }
-}
-
-static void
-write_class (gpointer key, gpointer value, gpointer user_data)
-{
- write_class_dwarf2 (user_data, key, GPOINTER_TO_INT (value));
-}
-
-static void
-write_method_dwarf2 (MonoDebugHandle *debug, DebugMethodInfo *minfo)
-{
- int is_external = 0, i;
- MonoType *ret_type = NULL;
- gchar **names;
-
- if (minfo->method_info.method->signature->ret->type != MONO_TYPE_VOID)
- ret_type = minfo->method_info.method->signature->ret;
-
- // DW_TAG_subprogram
- if (ret_type)
- dwarf2_write_byte (debug->f, ABBREV_SUBPROGRAM_RETVAL);
- else
- dwarf2_write_byte (debug->f, ABBREV_SUBPROGRAM);
- dwarf2_write_string (debug->f, minfo->name);
- dwarf2_write_byte (debug->f, is_external);
- dwarf2_write_address (debug->f, minfo->method_info.code_start);
- dwarf2_write_address (debug->f, (char *)minfo->method_info.code_start + minfo->method_info.code_size);
- dwarf2_write_byte (debug->f, DW_CC_nocall);
- if (ret_type) {
- MonoClass *klass = mono_class_from_mono_type (ret_type);
- int type_index = mono_debug_get_type (debug, klass);
- dwarf2_write_type_ref (debug->f, type_index);
- }
-
- if (minfo->method_info.method->signature->hasthis)
- dwarf2_write_parameter (debug, minfo, "this", minfo->method_info.this_var,
- minfo->method_info.method->klass);
-
- names = g_new (char *, minfo->method_info.method->signature->param_count);
- mono_method_get_param_names (minfo->method_info.method, (const char **) names);
-
- for (i = 0; i < minfo->method_info.num_params; i++) {
- MonoType *type = minfo->method_info.method->signature->params [i];
- MonoClass *klass = mono_class_from_mono_type (type);
-
- dwarf2_write_parameter (debug, minfo, names [i], &minfo->method_info.params [i], klass);
- }
-
- g_free (names);
-
- for (i = 0; i < minfo->method_info.num_locals; i++) {
- MonoMethodHeader *header = ((MonoMethodNormal*) minfo->method_info.method)->header;
- MonoClass *klass = mono_class_from_mono_type (header->locals [i]);
- char name [BUFSIZ];
-
- sprintf (name, "V_%d", i);
- dwarf2_write_variable (debug, minfo, name, &minfo->method_info.locals [i], klass);
- }
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_subprogram ends here
-}
-
-static void
-write_method_func (gpointer key, gpointer value, gpointer user_data)
-{
- write_method_dwarf2 (user_data, value);
-}
-
-void
-mono_debug_write_dwarf2 (MonoDebugHandle *debug)
-{
- if (!(debug->f = fopen (debug->filename, "w"))) {
- g_warning ("Can't create dwarf file `%s': %s", debug->filename, g_strerror (errno));
- return;
- }
-
- // Produce assembler code which is free of comments and extra whitespaces.
- fprintf (debug->f, "#NOAPP\n");
-
- // DWARF 2 Abbreviation table.
- dwarf2_write_section_start (debug->f, "debug_abbrev");
- dwarf2_write_label (debug->f, "debug_abbrev");
-
- dwarf2_write_byte (debug->f, ABBREV_COMPILE_UNIT);
- dwarf2_write_byte (debug->f, DW_TAG_compile_unit);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_language, DW_FORM_data2);
- dwarf2_write_pair (debug->f, DW_AT_producer, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_stmt_list, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_SUBPROGRAM);
- dwarf2_write_byte (debug->f, DW_TAG_subprogram);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_external, DW_FORM_flag);
- dwarf2_write_pair (debug->f, DW_AT_low_pc, DW_FORM_addr);
- dwarf2_write_pair (debug->f, DW_AT_high_pc, DW_FORM_addr);
- dwarf2_write_pair (debug->f, DW_AT_calling_convention, DW_FORM_data1);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_SUBPROGRAM_RETVAL);
- dwarf2_write_byte (debug->f, DW_TAG_subprogram);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_external, DW_FORM_flag);
- dwarf2_write_pair (debug->f, DW_AT_low_pc, DW_FORM_addr);
- dwarf2_write_pair (debug->f, DW_AT_high_pc, DW_FORM_addr);
- dwarf2_write_pair (debug->f, DW_AT_calling_convention, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_BASE_TYPE);
- dwarf2_write_byte (debug->f, DW_TAG_base_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_encoding, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_byte_size, DW_FORM_data1);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_FORMAL_PARAMETER);
- dwarf2_write_byte (debug->f, DW_TAG_formal_parameter);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_ARTIFICIAL_PARAMETER);
- dwarf2_write_byte (debug->f, DW_TAG_formal_parameter);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, DW_AT_artificial, DW_FORM_data1);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_PARAMETER);
- dwarf2_write_byte (debug->f, DW_TAG_formal_parameter);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, DW_AT_location, DW_FORM_block4);
- dwarf2_write_pair (debug->f, DW_AT_start_scope, DW_FORM_data4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_LOCAL_VARIABLE);
- dwarf2_write_byte (debug->f, DW_TAG_variable);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, DW_AT_location, DW_FORM_block4);
- dwarf2_write_pair (debug->f, DW_AT_start_scope, DW_FORM_addr);
- dwarf2_write_pair (debug->f, DW_AT_end_scope, DW_FORM_addr);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_TYPE);
- dwarf2_write_byte (debug->f, DW_TAG_structure_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_byte_size, DW_FORM_data4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_MEMBER);
- dwarf2_write_byte (debug->f, DW_TAG_member);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, DW_AT_accessibility, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_data_member_location, DW_FORM_block4);
- dwarf2_write_pair (debug->f, DW_AT_byte_size, DW_FORM_data4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_STRUCT_ACCESS);
- dwarf2_write_byte (debug->f, DW_TAG_access_declaration);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_accessibility, DW_FORM_data1);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_ENUM_TYPE);
- dwarf2_write_byte (debug->f, DW_TAG_enumeration_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_byte_size, DW_FORM_data4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE);
- dwarf2_write_byte (debug->f, DW_TAG_enumerator);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_const_value, DW_FORM_data4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_UNSIGNED);
- dwarf2_write_byte (debug->f, DW_TAG_enumerator);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_const_value, DW_FORM_udata);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_ENUM_VALUE_SIGNED);
- dwarf2_write_byte (debug->f, DW_TAG_enumerator);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_const_value, DW_FORM_sdata);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_CLASS_TYPE);
- dwarf2_write_byte (debug->f, DW_TAG_class_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_byte_size, DW_FORM_data4);
- dwarf2_write_pair (debug->f, DW_AT_accessibility, DW_FORM_data1);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_CLASS_INHERITANCE);
- dwarf2_write_byte (debug->f, DW_TAG_inheritance);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, DW_AT_accessibility, DW_FORM_data1);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_POINTER_TYPE);
- dwarf2_write_byte (debug->f, DW_TAG_pointer_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_CLASS_METHOD);
- dwarf2_write_byte (debug->f, DW_TAG_subprogram);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_accessibility, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_virtuality, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_calling_convention, DW_FORM_data1);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_CLASS_METHOD_RETVAL);
- dwarf2_write_byte (debug->f, DW_TAG_subprogram);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_accessibility, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_virtuality, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_calling_convention, DW_FORM_data1);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_SIMPLE_ARRAY);
- dwarf2_write_byte (debug->f, DW_TAG_array_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_ARRAY);
- dwarf2_write_byte (debug->f, DW_TAG_array_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_yes);
- dwarf2_write_pair (debug->f, DW_AT_name, DW_FORM_string);
- dwarf2_write_pair (debug->f, DW_AT_type, DW_FORM_ref4);
- dwarf2_write_pair (debug->f, DW_AT_byte_size, DW_FORM_data4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_byte (debug->f, ABBREV_SUBRANGE);
- dwarf2_write_byte (debug->f, DW_TAG_subrange_type);
- dwarf2_write_byte (debug->f, DW_CHILDREN_no);
- dwarf2_write_pair (debug->f, DW_AT_lower_bound, DW_FORM_data4);
- dwarf2_write_pair (debug->f, DW_AT_upper_bound, DW_FORM_data4);
- dwarf2_write_pair (debug->f, DW_AT_count, DW_FORM_data4);
- dwarf2_write_pair (debug->f, 0, 0);
-
- dwarf2_write_label (debug->f, "debug_abbrev_e");
-
- // Line numbers
- write_line_numbers (debug);
-
- // Compile unit header
- dwarf2_write_section_start (debug->f, "debug_info");
- dwarf2_write_label (debug->f, "debug_info_b");
- dwarf2_write_section_size (debug->f, "DI1", "debug_info_e");
- dwarf2_write_label (debug->f, "DI1");
- dwarf2_write_2byte (debug->f, 2);
- dwarf2_write_ref4 (debug->f, "debug_abbrev_b");
- dwarf2_write_byte (debug->f, sizeof (gpointer));
-
- // DW_TAG_compile_unit
- dwarf2_write_byte (debug->f, ABBREV_COMPILE_UNIT);
- dwarf2_write_string (debug->f, debug->name);
- dwarf2_write_2byte (debug->f, DW_LANG_C_sharp);
- dwarf2_write_string (debug->f, debug->producer_name);
- dwarf2_write_ref4 (debug->f, "debug_lines_b");
-
- // Methods
- g_hash_table_foreach (debug->methods, write_method_func, debug);
-
- // Derived types
- g_hash_table_foreach (debug->type_hash, write_class, debug);
-
- dwarf2_write_byte (debug->f, 0);
- // DW_TAG_compile_unit ends here
-
- dwarf2_write_label (debug->f, "debug_info_e");
-
- fclose (debug->f);
- debug->f = NULL;
-
- if (!(debug->flags & MONO_DEBUG_FLAGS_DONT_ASSEMBLE)) {
- char *buf;
-
- /* yes, it's completely unsafe */
- buf = g_strdup_printf ("as %s -o %s", debug->filename, debug->objfile);
- system (buf);
- g_free (buf);
- }
-}
diff --git a/mono/jit/debug-jit.c b/mono/jit/debug-jit.c
new file mode 100644
index 00000000000..02f2e07c328
--- /dev/null
+++ b/mono/jit/debug-jit.c
@@ -0,0 +1,198 @@
+#include <config.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
+#include <mono/jit/debug-jit.h>
+#include "codegen.h"
+
+/*
+ * This method is only called when running in the Mono Debugger.
+ */
+gpointer
+mono_debugger_create_notification_function (gpointer *notification_address)
+{
+ guint8 *ptr, *buf;
+
+ ptr = buf = g_malloc0 (16);
+ x86_breakpoint (buf);
+ if (notification_address)
+ *notification_address = buf;
+ x86_ret (buf);
+
+ return ptr;
+}
+
+static void
+record_line_number (MonoDebugMethodJitInfo *jit, guint32 address, guint32 offset)
+{
+ MonoDebugLineNumberEntry *lne = g_new0 (MonoDebugLineNumberEntry, 1);
+
+ lne->address = address;
+ lne->offset = offset;
+
+ g_array_append_val (jit->line_numbers, *lne);
+}
+
+static void
+debug_update_il_offsets (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoFlowGraph* cfg)
+{
+ MonoMethodHeader *header;
+ guint32 address, offset;
+ int i;
+
+ jit->line_numbers = g_array_new (FALSE, TRUE, sizeof (MonoDebugLineNumberEntry));
+
+ address = jit->prologue_end;
+ offset = 0;
+
+ g_assert (((MonoMethodNormal*)method)->header);
+ header = ((MonoMethodNormal*)method)->header;
+
+ record_line_number (jit, address, offset);
+
+ /* start lines of basic blocks */
+ for (i = 0; i < cfg->block_count; ++i) {
+ int j;
+
+ for (j = 0; cfg->bblocks [i].forest && (j < cfg->bblocks [i].forest->len); ++j) {
+ MBTree *t = (MBTree *) g_ptr_array_index (cfg->bblocks [i].forest, j);
+
+ if ((t->cli_addr == -1) || (t->cli_addr == offset) || (t->addr == address))
+ continue;
+
+ offset = t->cli_addr;
+ address = t->addr;
+
+ record_line_number (jit, address, offset);
+ }
+ }
+
+ record_line_number (jit, jit->epilogue_begin, header->code_size);
+}
+
+static gint32
+il_offset_from_position (MonoFlowGraph *cfg, MonoPosition *pos)
+{
+ MonoBBlock *bblock;
+ MBTree *tree;
+
+ if (pos->abs_pos == 0)
+ return -1;
+
+ if (pos->pos.bid >= cfg->block_count)
+ return -1;
+
+ bblock = &cfg->bblocks [pos->pos.bid];
+ if (pos->pos.tid >= bblock->forest->len)
+ return -1;
+
+ tree = (MBTree *) g_ptr_array_index (bblock->forest, pos->pos.tid);
+
+ return tree->cli_addr;
+}
+
+static gint32
+address_from_il_offset (MonoDebugMethodJitInfo *jit, guint32 il_offset)
+{
+ int i;
+
+ for (i = jit->line_numbers->len - 1; i >= 0; i--) {
+ MonoDebugLineNumberEntry lne = g_array_index (
+ jit->line_numbers, MonoDebugLineNumberEntry, i);
+
+ if (lne.offset <= il_offset)
+ return lne.address;
+ }
+
+ return -1;
+}
+
+void
+mono_debug_jit_add_method (MonoFlowGraph *cfg)
+{
+ MonoMethod *method = cfg->method;
+ MonoClass *klass = method->klass;
+ MonoDebugMethodJitInfo *jit;
+ int i;
+
+ mono_class_init (klass);
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->flags & METHOD_ATTRIBUTE_ABSTRACT))
+ return;
+
+ jit = g_new0 (MonoDebugMethodJitInfo, 1);
+ jit->code_start = cfg->start;
+ jit->code_size = cfg->epilogue_end;
+ jit->prologue_end = cfg->prologue_end;
+ jit->epilogue_begin = cfg->epilog;
+ jit->num_params = method->signature->param_count;
+ jit->params = g_new0 (MonoDebugVarInfo, jit->num_params);
+
+ if (method->signature->hasthis) {
+ MonoVarInfo *ptr = ((MonoVarInfo *) cfg->varinfo->data) + cfg->args_start_index;
+
+ jit->this_var = g_new0 (MonoDebugVarInfo, 1);
+ jit->this_var->offset = ptr->offset;
+ jit->this_var->size = ptr->size;
+ }
+
+ for (i = 0; i < jit->num_params; i++) {
+ MonoVarInfo *ptr = ((MonoVarInfo *) cfg->varinfo->data) + cfg->args_start_index +
+ method->signature->hasthis;
+
+ jit->params [i].offset = ptr [i].offset;
+ jit->params [i].size = ptr [i].size;
+ }
+
+ debug_update_il_offsets (method, jit, cfg);
+
+ if (!method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
+ MonoMethodHeader *header = ((MonoMethodNormal*)method)->header;
+ MonoVarInfo *ptr = ((MonoVarInfo *) cfg->varinfo->data) + cfg->locals_start_index;
+ MonoDebugVarInfo *locals;
+
+ locals = g_new0 (MonoDebugVarInfo, header->num_locals);
+ for (i = 0; i < header->num_locals; i++) {
+ gint32 begin_offset, end_offset;
+ gint32 begin_scope, end_scope;
+
+ if (ptr [i].reg >= 0) {
+ locals [i].index = ptr [i].reg | MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER;
+ locals [i].offset = 0;
+ } else
+ locals [i].offset = ptr [i].offset;
+
+ locals [i].size = ptr [i].size;
+
+ begin_offset = il_offset_from_position (cfg, &ptr [i].range.first_use);
+ end_offset = il_offset_from_position (cfg, &ptr [i].range.last_use);
+ if (end_offset >= 0)
+ end_offset++;
+
+ if (begin_offset >= 0)
+ begin_scope = address_from_il_offset (jit, begin_offset);
+ else
+ begin_scope = -1;
+ if (end_offset >= 0)
+ end_scope = address_from_il_offset (jit, end_offset);
+ else
+ end_scope = -1;
+
+ if (begin_scope > 0)
+ locals [i].begin_scope = begin_scope;
+ else
+ locals [i].begin_scope = jit->prologue_end;
+ if (end_scope > 0)
+ locals [i].end_scope = end_scope;
+ else
+ locals [i].end_scope = jit->epilogue_begin;
+ }
+
+ jit->num_locals = header->num_locals;
+ jit->locals = locals;
+ }
+
+ mono_debug_add_method (method, jit, cfg->domain);
+}
diff --git a/mono/jit/debug-jit.h b/mono/jit/debug-jit.h
new file mode 100644
index 00000000000..495ca9351cc
--- /dev/null
+++ b/mono/jit/debug-jit.h
@@ -0,0 +1,8 @@
+#ifndef __MONO_JIT_DEBUG_JIT_H__
+#define __MONO_JIT_DEBUG_JIT_H__
+
+#include <mono/jit/codegen.h>
+
+void mono_debug_jit_add_method (MonoFlowGraph *cfg);
+
+#endif /* __MONO_JIT_DEBUG_JIT_H__ */
diff --git a/mono/jit/debug-private.h b/mono/jit/debug-private.h
deleted file mode 100644
index 82a98d4d699..00000000000
--- a/mono/jit/debug-private.h
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef __MONO_JIT_DEBUG_PRIVATE_H__
-#define __MONO_JIT_DEBUG_PRIVATE_H__
-
-#include <mono/metadata/debug-symfile.h>
-
-#include "debug.h"
-
-typedef struct {
- gpointer address;
- guint32 line;
- int is_basic_block;
- int source_file;
-} DebugLineNumberInfo;
-
-typedef struct _AssemblyDebugInfo AssemblyDebugInfo;
-
-typedef enum {
- MONO_DEBUG_FLAGS_NONE = 0,
- // Don't run the assembler.
- MONO_DEBUG_FLAGS_DONT_ASSEMBLE = (1 << 1),
- // Install the generated *.il files in the assembly dir.
- MONO_DEBUG_FLAGS_INSTALL_IL_FILES = (1 << 2),
- // Don't update the *.il files.
- MONO_DEBUG_FLAGS_DONT_UPDATE_IL_FILES = (1 << 3),
- // Don't create any new *.il files.
- MONO_DEBUG_FLAGS_DONT_CREATE_IL_FILES = (1 << 4),
- // Don't fallback to normal dwarf2.
- MONO_DEBUG_FLAGS_DONT_FALLBACK = (1 << 5),
- // Don't precompile image.
- MONO_DEBUG_FLAGS_DONT_PRECOMPILE = (1 << 6),
- // Update symbol file on exit.
- MONO_DEBUG_FLAGS_UPDATE_ON_EXIT = (1 << 7)
-} MonoDebugFlags;
-
-typedef struct {
- MonoDebugMethodInfo method_info;
- AssemblyDebugInfo *info;
- gchar *name;
- int source_file;
- guint32 method_number;
- guint32 start_line;
- guint32 first_line;
- guint32 last_line;
- GPtrArray *line_numbers;
-} DebugMethodInfo;
-
-struct _AssemblyDebugInfo {
- MonoDebugFormat format;
- MonoDebugHandle *handle;
- MonoDebugSymbolFile *symfile;
- char *name;
- char *ilfile;
- char *filename;
- char *objfile;
- int source_file;
- int total_lines;
- int *mlines;
- int *moffsets;
- int nmethods;
- MonoImage *image;
- gpointer _priv;
-};
-
-struct _MonoDebugHandle {
- MonoDebugHandle *next;
- MonoDebugFormat format;
- MonoDebugFlags flags;
- char *name;
- char *filename;
- char *objfile;
- char *producer_name;
- GHashTable *type_hash;
- GHashTable *methods;
- GPtrArray *source_files;
- int next_idx;
- int next_klass_idx;
- int dirty;
- GList *info;
- FILE *f;
-};
-
-guint32 mono_debug_get_type (MonoDebugHandle* debug, MonoClass *klass);
-
-void mono_debug_open_assembly_dwarf2_plus (AssemblyDebugInfo *info);
-
-void mono_debug_write_assembly_dwarf2_plus (AssemblyDebugInfo *info);
-
-void mono_debug_close_assembly_dwarf2_plus (AssemblyDebugInfo *info);
-
-void mono_debug_write_stabs (MonoDebugHandle *debug);
-
-void mono_debug_write_dwarf2 (MonoDebugHandle *debug);
-
-#endif /* __MONO_JIT_DEBUG_PRIVATE_H__ */
diff --git a/mono/jit/debug-stabs.c b/mono/jit/debug-stabs.c
deleted file mode 100644
index 40a2e67ac2a..00000000000
--- a/mono/jit/debug-stabs.c
+++ /dev/null
@@ -1,217 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/jit/codegen.h>
-#include <mono/jit/debug.h>
-
-#include "debug-private.h"
-
-typedef struct {
- const char *name;
- const char *spec;
-} BaseTypes;
-
-/*
- * Not 64 bit clean.
- * Note: same order of MonoTypeEnum.
- */
-static BaseTypes
-base_types[] = {
- {"", NULL},
- {"Void", "(0,1)"},
- {"Boolean", ";0;255;"},
- {"Char", ";0;65535;"},
- {"SByte", ";-128;127;"},
- {"Byte", ";0;255;"},
- {"Int16", ";-32768;32767;"},
- {"UInt16", ";0;65535;"},
- {"Int32", ";0020000000000;0017777777777;"},
- {"UInt32", ";0000000000000;0037777777777;"},
- {"Int64", ";01000000000000000000000;0777777777777777777777;"},
- {"UInt64", ";0000000000000;01777777777777777777777;"},
- {"Single", "r(0,8);4;0;"},
- {"Double", "r(0,8);8;0;"},
- {"String", "(0,41)=*(0,42)=xsMonoString:"}, /*string*/
- {"", }, /*ptr*/
- {"", }, /*byref*/
- {"", }, /*valuetype*/
- {"Class", "(0,44)=*(0,45)=xsMonoObject:"}, /*class*/
- {"", }, /*unused*/
- {"Array", }, /*array*/
- {"", }, /*typedbyref*/
- {"", }, /*unused*/
- {"", }, /*unused*/
- {"IntPtr", ";0020000000000;0017777777777;"},
- {"UIntPtr", ";0000000000000;0037777777777;"},
- {"", }, /*unused*/
- {"FnPtr", "*(0,1)"}, /*fnptr*/
- {"Object", "(0,47)=*(0,48)=xsMonoObject:"}, /*object*/
- {"SzArray", "(0,50)=*(0,51))=xsMonoArray:"}, /*szarray*/
- {NULL, NULL}
-};
-
-static void
-write_method_stabs (MonoDebugHandle *debug, DebugMethodInfo *minfo)
-{
- int i;
- MonoMethod *method = minfo->method_info.method;
- MonoClass *klass = method->klass;
- MonoMethodSignature *sig = method->signature;
- char **names = g_new (char*, sig->param_count);
- gchar *source_file;
-
- source_file = g_ptr_array_index (debug->source_files, minfo->source_file);
-
- fprintf (debug->f, ".stabs \"%s\",100,0,0,0\n", source_file);
-
- fprintf (debug->f, ".stabs \"%s:F(0,%d)\",36,0,%d,%p\n", minfo->name, sig->ret->type,
- minfo->start_line, minfo->method_info.code_start);
-
- /* params */
- mono_method_get_param_names (method, (const char **)names);
- if (sig->hasthis)
- fprintf (debug->f, ".stabs \"this:p(0,%d)=(0,%d)\",160,0,%d,%d\n",
- debug->next_idx++, klass->byval_arg.type, minfo->start_line,
- minfo->method_info.this_var->offset);
- for (i = 0; i < minfo->method_info.num_params; i++) {
- int stack_offset = minfo->method_info.params [i].offset;
-
- fprintf (debug->f, ".stabs \"%s:p(0,%d)=(0,%d)\",160,0,%d,%d\n",
- names [i], debug->next_idx++, sig->params [i]->type,
- minfo->start_line, stack_offset);
- }
-
- /* local vars */
- for (i = 0; i < minfo->method_info.num_locals; ++i) {
- MonoMethodHeader *header = ((MonoMethodNormal*)method)->header;
- int stack_offset = minfo->method_info.locals [i].offset;
-
- fprintf (debug->f, ".stabs \"local_%d:(0,%d)=(0,%d)\",128,0,%d,%d\n",
- i, debug->next_idx++, header->locals [i]->type, minfo->start_line, stack_offset);
- }
-
- if (minfo->line_numbers) {
- fprintf (debug->f, ".stabn 68,0,%d,%d\n", minfo->start_line, 0);
- fprintf (debug->f, ".stabn 68,0,%d,%d\n", minfo->first_line, minfo->method_info.prologue_end);
-
- for (i = 1; i < minfo->line_numbers->len; i++) {
- DebugLineNumberInfo *lni = g_ptr_array_index (minfo->line_numbers, i);
-
- fprintf (debug->f, ".stabn 68,0,%d,%d\n", lni->line,
- (char *)lni->address - minfo->method_info.code_start);
- }
-
- fprintf (debug->f, ".stabn 68,0,%d,%d\n", minfo->last_line, minfo->method_info.epilogue_begin);
- }
-
- /* end of function */
- fprintf (debug->f, ".stabs \"\",36,0,0,%d\n", minfo->method_info.code_size);
-
- g_free (names);
- fflush (debug->f);
-}
-
-static void
-get_enumvalue (MonoClass *klass, int idx, char *buf)
-{
- guint32 const_cols [MONO_CONSTANT_SIZE];
- const char *ptr;
- guint32 crow = mono_metadata_get_constant_index (klass->image, MONO_TOKEN_FIELD_DEF | (idx + 1));
-
- if (!crow) {
- buf [0] = '0';
- buf [1] = 0;
- return;
- }
- mono_metadata_decode_row (&klass->image->tables [MONO_TABLE_CONSTANT], crow-1, const_cols, MONO_CONSTANT_SIZE);
- ptr = mono_metadata_blob_heap (klass->image, const_cols [MONO_CONSTANT_VALUE]);
- switch (const_cols [MONO_CONSTANT_TYPE]) {
- case MONO_TYPE_U4:
- case MONO_TYPE_I4:
- /* FIXME: add other types... */
- default:
- g_snprintf (buf, 64, "%d", *(gint32*)ptr);
- }
-}
-
-static void
-write_method_func (gpointer key, gpointer value, gpointer user_data)
-{
- write_method_stabs (user_data, value);
-}
-
-static void
-write_class_stabs (MonoDebugHandle *debug, MonoClass *klass, int idx)
-{
- char *name;
- int i;
- char buf [64];
-
- /* output enums ...*/
- if (klass->enumtype) {
- name = g_strdup_printf ("%s%s%s", klass->name_space, klass->name_space [0]? "_": "", klass->name);
- fprintf (debug->f, ".stabs \"%s:T%d=e", name, ++debug->next_idx);
- g_free (name);
- for (i = 0; i < klass->field.count; ++i) {
- if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_LITERAL) {
- get_enumvalue (klass, klass->field.first + i, buf);
- fprintf (debug->f, "%s_%s=%s,", klass->name, klass->fields [i].name, buf);
- }
- }
- fprintf (debug->f, ";\",128,0,0,0\n");
- }
- fflush (debug->f);
-}
-
-static void
-write_class (gpointer key, gpointer value, gpointer user_data)
-{
- write_class_stabs (user_data, key, GPOINTER_TO_INT (value));
-}
-
-void
-mono_debug_write_stabs (MonoDebugHandle *debug)
-{
- gchar *source_file;
- int i;
-
- if (!(debug->f = fopen (debug->filename, "w"))) {
- g_warning ("Can't create stabs file `%s': %s", debug->filename, g_strerror (errno));
- return;
- }
-
- source_file = g_ptr_array_index (debug->source_files, 0);
-
- fprintf (debug->f, ".stabs \"%s\",100,0,0,0\n", source_file);
-
- for (i = 0; base_types [i].name; ++i) {
- if (! base_types [i].spec)
- continue;
- fprintf (debug->f, ".stabs \"%s:t(0,%d)=", base_types [i].name, i);
- if (base_types [i].spec [0] == ';') {
- fprintf (debug->f, "r(0,%d)%s\"", i, base_types [i].spec);
- } else {
- fprintf (debug->f, "%s\"", base_types [i].spec);
- }
- fprintf (debug->f, ",128,0,0,0\n");
- }
-
- g_hash_table_foreach (debug->methods, write_method_func, debug);
-
- g_hash_table_foreach (debug->type_hash, write_class, debug);
-
- fclose (debug->f);
- debug->f = NULL;
-
- if (!(debug->flags & MONO_DEBUG_FLAGS_DONT_ASSEMBLE)) {
- char *buf;
-
- /* yes, it's completely unsafe */
- buf = g_strdup_printf ("as %s -o %s", debug->filename, debug->objfile);
- system (buf);
- g_free (buf);
- }
-}
diff --git a/mono/jit/debug.c b/mono/jit/debug.c
deleted file mode 100644
index 81a60db8208..00000000000
--- a/mono/jit/debug.c
+++ /dev/null
@@ -1,837 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/jit/codegen.h>
-#include <mono/jit/debug.h>
-
-#include "debug-private.h"
-
-static MonoDebugHandle *mono_debug_handles = NULL;
-static MonoDebugHandle *mono_default_debug_handle = NULL;
-
-static void
-free_method_info (DebugMethodInfo *minfo)
-{
- if (minfo->line_numbers)
- g_ptr_array_free (minfo->line_numbers, TRUE);
- g_free (minfo->method_info.params);
- g_free (minfo->method_info.locals);
- g_free (minfo);
-}
-
-static void
-debug_arg_warning (const char *message)
-{
- g_warning ("Error while processing --debug-args arguments: %s", message);
-}
-
-MonoDebugHandle*
-mono_debug_open (MonoAssembly *assembly, MonoDebugFormat format, const char **args)
-{
- MonoDebugHandle *debug;
- const char **ptr;
-
- debug = g_new0 (MonoDebugHandle, 1);
- debug->name = g_strdup (assembly->image->name);
- debug->format = format;
- debug->producer_name = g_strdup_printf ("Mono JIT compiler version %s", VERSION);
- debug->next_idx = 100;
- debug->dirty = TRUE;
-
- debug->type_hash = g_hash_table_new (NULL, NULL);
- debug->methods = g_hash_table_new_full (g_direct_hash, g_direct_equal,
- NULL, (GDestroyNotify) free_method_info);
- debug->source_files = g_ptr_array_new ();
-
- for (ptr = args; ptr && *ptr; ptr++) {
- const char *arg = *ptr;
- gchar *message;
-
- switch (debug->format) {
- case MONO_DEBUG_FORMAT_STABS:
- case MONO_DEBUG_FORMAT_DWARF2:
- if (!strncmp (arg, "filename=", 9)) {
- if (debug->filename)
- debug_arg_warning ("The `filename' argument can be given only once.");
- debug->filename = g_strdup (arg + 9);
- continue;
- } else if (!strncmp (arg, "objfile=", 8)) {
- if (debug->objfile)
- debug_arg_warning ("The `objfile' argument can be given only once.");
- debug->objfile = g_strdup (arg + 8);
- continue;
- } else if (!strcmp (arg, "install_il_files")) {
- debug->flags |= MONO_DEBUG_FLAGS_INSTALL_IL_FILES;
- continue;
- } else if (!strcmp (arg, "dont_update_il_files")) {
- debug->flags |= MONO_DEBUG_FLAGS_DONT_UPDATE_IL_FILES;
- continue;
- } else if (!strcmp (arg, "dont_create_il_files")) {
- debug->flags |= MONO_DEBUG_FLAGS_DONT_CREATE_IL_FILES;
- continue;
- }
- break;
- case MONO_DEBUG_FORMAT_DWARF2_PLUS:
- if (!strcmp (arg, "dont_fallback")) {
- debug->flags |= MONO_DEBUG_FLAGS_DONT_FALLBACK;
- continue;
- } else if (!strcmp (arg, "dont_precompile")) {
- debug->flags |= MONO_DEBUG_FLAGS_DONT_PRECOMPILE;
- continue;
- }
- break;
- default:
- break;
- }
-
- if (!strcmp (arg, "dont_assemble")) {
- debug->flags |= MONO_DEBUG_FLAGS_DONT_ASSEMBLE;
- continue;
- } else if (!strcmp (arg, "update_on_exit")) {
- debug->flags |= MONO_DEBUG_FLAGS_UPDATE_ON_EXIT;
- continue;
- }
-
- message = g_strdup_printf ("Unknown argument `%s'.", arg);
- debug_arg_warning (message);
- g_free (message);
- }
-
- switch (debug->format) {
- case MONO_DEBUG_FORMAT_STABS:
- if (!debug->filename)
- debug->filename = g_strdup_printf ("%s-stabs.s", g_basename (debug->name));
- if (!debug->objfile)
- debug->objfile = g_strdup_printf ("%s.o", g_basename (debug->name));
- break;
- case MONO_DEBUG_FORMAT_DWARF2:
- if (!debug->filename)
- debug->filename = g_strdup_printf ("%s-dwarf.s", g_basename (debug->name));
- if (!debug->objfile)
- debug->objfile = g_strdup_printf ("%s.o", g_basename (debug->name));
- break;
- case MONO_DEBUG_FORMAT_DWARF2_PLUS:
- if (!mono_default_debug_handle && !(debug->flags & MONO_DEBUG_FLAGS_DONT_FALLBACK))
- mono_debug_open (assembly, MONO_DEBUG_FORMAT_DWARF2, NULL);
- break;
- default:
- g_assert_not_reached ();
- }
-
- debug->next = mono_debug_handles;
- mono_debug_handles = debug;
-
- if (!mono_default_debug_handle && (debug->format != MONO_DEBUG_FORMAT_DWARF2_PLUS))
- mono_default_debug_handle = debug;
-
- return debug;
-}
-
-static void
-debug_load_method_lines (AssemblyDebugInfo* info)
-{
- FILE *f;
- char buf [1024];
- int i, mnum;
- int offset = -1;
-
- if (!(info->handle->flags & MONO_DEBUG_FLAGS_DONT_UPDATE_IL_FILES)) {
- char *command = g_strdup_printf ("monodis --output=%s %s",
- info->ilfile, info->image->name);
- struct stat stata, statb;
- int need_update = FALSE;
-
- if (stat (info->image->name, &stata)) {
- g_warning ("cannot access assembly file (%s): %s",
- info->image->name, g_strerror (errno));
- g_free (command);
- return;
- }
-
- /* If the stat() failed or the file is older. */
- if (stat (info->ilfile, &statb)) {
- /* Don't create any new *.il files if the user told us not to do so. */
- if (!(info->handle->flags & MONO_DEBUG_FLAGS_DONT_CREATE_IL_FILES))
- need_update = TRUE;
- } else if (statb.st_mtime < stata.st_mtime)
- need_update = TRUE;
-
- if (need_update) {
- g_print ("Recreating %s from %s.\n", info->ilfile, info->image->name);
- if (system (command)) {
- g_warning ("cannot create IL assembly file (%s): %s",
- command, g_strerror (errno));
- g_free (command);
- return;
- }
- }
- }
-
- /* use an env var with directories for searching. */
- if (!(f = fopen (info->ilfile, "r"))) {
- g_warning ("cannot open IL assembly file %s", info->ilfile);
- return;
- }
-
- info->total_lines = 100;
- info->moffsets = g_malloc (info->total_lines * sizeof (int));
-
- i = 0;
- while (fgets (buf, sizeof (buf), f)) {
- int pos = i;
-
- info->moffsets [i++] = offset;
- if (i + 2 >= info->total_lines) {
- info->total_lines += 100;
- info->moffsets = g_realloc (info->moffsets, info->total_lines * sizeof (int));
- g_assert (info->moffsets);
- }
-
- if (!sscanf (buf, " // method line %d", &mnum))
- continue;
-
- offset = 0;
-
- if (mnum >= info->nmethods)
- break;
-
- while (fgets (buf, sizeof (buf), f)) {
- int newoffset;
-
- ++i;
- if (i + 2 >= info->total_lines) {
- info->total_lines += 100;
- info->moffsets = g_realloc (info->moffsets, info->total_lines * sizeof (int));
- g_assert (info->moffsets);
- }
-
- if (strstr (buf, "}")) {
- offset = -1;
- break;
- }
-
- if (sscanf (buf, " IL_%x:", &newoffset)) {
- offset = newoffset;
- if (!offset)
- pos = i;
- }
-
- info->moffsets [i] = offset;
- }
- /* g_print ("method %d found at %d\n", mnum, pos); */
- info->mlines [mnum] = pos;
- }
- fclose (f);
-}
-
-static void
-record_line_number (DebugMethodInfo *minfo, gpointer address, guint32 line, int is_basic_block)
-{
- DebugLineNumberInfo *lni = g_new0 (DebugLineNumberInfo, 1);
-
- lni->address = address;
- lni->line = line;
- lni->is_basic_block = is_basic_block;
- lni->source_file = minfo->source_file;
-
- g_ptr_array_add (minfo->line_numbers, lni);
-}
-
-static void
-record_il_offset (GPtrArray *array, guint32 offset, guint32 address)
-{
- MonoDebugILOffsetInfo *info = g_new0 (MonoDebugILOffsetInfo, 1);
-
- info->offset = offset;
- info->address = address;
-
- g_ptr_array_add (array, info);
-}
-
-static void
-debug_generate_method_lines (AssemblyDebugInfo *info, DebugMethodInfo *minfo, MonoFlowGraph* cfg)
-{
- guint32 st_address, st_line;
- GPtrArray *il_offsets;
- int i;
-
- il_offsets = g_ptr_array_new ();
- minfo->line_numbers = g_ptr_array_new ();
-
- st_line = minfo->first_line;
- st_address = minfo->method_info.prologue_end;
-
- /* record_line_number takes absolute memory addresses. */
- record_line_number (minfo, minfo->method_info.code_start, minfo->start_line, FALSE);
- /* record_il_offsets uses offsets relative to minfo->method_info.code_start. */
- record_il_offset (il_offsets, 0, st_address);
-
- /* This is the first actual code line of the method. */
- record_line_number (minfo, minfo->method_info.code_start + st_address, st_line, TRUE);
-
- /* start lines of basic blocks */
- for (i = 0; i < cfg->block_count; ++i) {
- int j;
-
- for (j = 0; cfg->bblocks [i].forest && (j < cfg->bblocks [i].forest->len); ++j) {
- MBTree *t = (MBTree *) g_ptr_array_index (cfg->bblocks [i].forest, j);
- gint32 line_inc = 0, addr_inc;
-
- if (!i && !j) {
- st_line = minfo->first_line;
- st_address = t->addr - 1;
-
- record_line_number (minfo, cfg->start + st_address, st_line, TRUE);
- }
-
- addr_inc = t->addr - st_address - 1;
- st_address += addr_inc;
-
- if (t->cli_addr != -1)
- record_il_offset (il_offsets, t->cli_addr, st_address);
-
- if (!info->moffsets)
- continue;
-
-
- if (t->cli_addr != -1) {
- int *lines = info->moffsets + st_line;
- int *k = lines;
-
- while ((*k != -1) && (*k < t->cli_addr))
- k++;
-
- line_inc = k - lines;
- }
-
- st_line += line_inc;
-
- record_line_number (minfo, minfo->method_info.code_start + st_address,
- st_line, j == 0);
- }
- }
-
- minfo->method_info.num_il_offsets = il_offsets->len;
- minfo->method_info.il_offsets = g_new0 (MonoDebugILOffsetInfo, il_offsets->len);
- for (i = 0; i < il_offsets->len; i++) {
- MonoDebugILOffsetInfo *il = (MonoDebugILOffsetInfo *) g_ptr_array_index (il_offsets, i);
-
- minfo->method_info.il_offsets [i] = *il;
- }
-
- g_ptr_array_free (il_offsets, TRUE);
-}
-
-static AssemblyDebugInfo *
-mono_debug_get_image (MonoDebugHandle* debug, MonoImage *image)
-{
- GList *tmp;
- AssemblyDebugInfo *info;
-
- if (debug->format == MONO_DEBUG_FORMAT_NONE)
- return NULL;
-
- for (tmp = debug->info; tmp; tmp = tmp->next) {
- info = (AssemblyDebugInfo*)tmp->data;
-
- if (info->image == image)
- return info;
- }
-
- return NULL;
-}
-
-static AssemblyDebugInfo *
-mono_debug_open_image (MonoDebugHandle* debug, MonoImage *image)
-{
- AssemblyDebugInfo *info;
-
- info = mono_debug_get_image (debug, image);
- if (info != NULL)
- return info;
-
- debug->dirty = TRUE;
-
- info = g_new0 (AssemblyDebugInfo, 1);
- info->image = image;
- info->image->ref_count++;
- info->name = g_strdup (image->assembly_name);
- info->format = debug->format;
- info->handle = debug;
-
- info->source_file = debug->source_files->len;
- g_ptr_array_add (debug->source_files, g_strdup_printf ("%s.il", image->assembly_name));
-
- debug->info = g_list_prepend (debug->info, info);
-
- info->nmethods = image->tables [MONO_TABLE_METHOD].rows + 1;
- info->mlines = g_new0 (int, info->nmethods);
-
- switch (info->format) {
- case MONO_DEBUG_FORMAT_STABS:
- case MONO_DEBUG_FORMAT_DWARF2:
- if (debug->flags & MONO_DEBUG_FLAGS_INSTALL_IL_FILES) {
- gchar *dirname = g_path_get_dirname (image->name);
- info->ilfile = g_strdup_printf ("%s/%s.il", dirname, info->name);
- g_free (dirname);
- } else
- info->ilfile = g_strdup_printf ("%s.il", info->name);
- break;
- case MONO_DEBUG_FORMAT_DWARF2_PLUS: {
- gchar *dirname = g_path_get_dirname (image->name);
- info->filename = g_strdup_printf ("%s/%s-debug.s", dirname, info->name);
- info->objfile = g_strdup_printf ("%s-debug.o", info->name);
- mono_debug_open_assembly_dwarf2_plus (info);
- g_free (dirname);
- break;
- }
- default:
- break;
- }
-
- if (debug->format != MONO_DEBUG_FORMAT_DWARF2_PLUS)
- debug_load_method_lines (info);
-
- return info;
-}
-
-void
-mono_debug_add_image (MonoDebugHandle* debug, MonoImage *image)
-{
- mono_debug_open_image (debug, image);
-}
-
-void
-mono_debug_write_symbols (MonoDebugHandle *debug)
-{
- GList *tmp;
-
- if (!debug || !debug->dirty)
- return;
-
- switch (debug->format) {
- case MONO_DEBUG_FORMAT_STABS:
- mono_debug_write_stabs (debug);
- break;
- case MONO_DEBUG_FORMAT_DWARF2:
- mono_debug_write_dwarf2 (debug);
- break;
- case MONO_DEBUG_FORMAT_DWARF2_PLUS:
- for (tmp = debug->info; tmp; tmp = tmp->next) {
- AssemblyDebugInfo *info = (AssemblyDebugInfo*)tmp->data;
-
- mono_debug_write_assembly_dwarf2_plus (info);
- }
- break;
- default:
- g_assert_not_reached ();
- }
-
- debug->dirty = FALSE;
-}
-
-void
-mono_debug_make_symbols (void)
-{
- MonoDebugHandle *debug;
-
- for (debug = mono_debug_handles; debug; debug = debug->next)
- mono_debug_write_symbols (debug);
-}
-
-static void
-mono_debug_close_assembly (AssemblyDebugInfo* info)
-{
- switch (info->format) {
- case MONO_DEBUG_FORMAT_DWARF2_PLUS:
- mono_debug_close_assembly_dwarf2_plus (info);
- break;
- default:
- break;
- }
- g_free (info->mlines);
- g_free (info->moffsets);
- g_free (info->name);
- g_free (info->ilfile);
- g_free (info->filename);
- g_free (info->objfile);
- g_free (info);
-}
-
-void
-mono_debug_cleanup (void)
-{
- MonoDebugHandle *debug, *temp;
-
- for (debug = mono_debug_handles; debug; debug = temp) {
- GList *tmp;
-
- if (debug->flags & MONO_DEBUG_FLAGS_UPDATE_ON_EXIT)
- mono_debug_write_symbols (debug);
-
-
- for (tmp = debug->info; tmp; tmp = tmp->next) {
- AssemblyDebugInfo* info = (AssemblyDebugInfo*)tmp->data;
-
- mono_debug_close_assembly (info);
- }
-
- g_ptr_array_free (debug->source_files, TRUE);
- g_hash_table_destroy (debug->methods);
- g_hash_table_destroy (debug->type_hash);
- g_free (debug->producer_name);
- g_free (debug->name);
-
- temp = debug->next;
- g_free (debug);
- }
-
- mono_debug_handles = NULL;
- mono_default_debug_handle = NULL;
-}
-
-guint32
-mono_debug_get_type (MonoDebugHandle *debug, MonoClass *klass)
-{
- guint index, i;
-
- mono_class_init (klass);
-
- index = GPOINTER_TO_INT (g_hash_table_lookup (debug->type_hash, klass));
- if (index)
- return index;
-
- debug->dirty = TRUE;
-
- index = ++debug->next_klass_idx;
- g_hash_table_insert (debug->type_hash, klass, GINT_TO_POINTER (index));
-
- if (klass->enumtype)
- return index;
-
- switch (klass->byval_arg.type) {
- case MONO_TYPE_CLASS:
- if (klass->parent)
- mono_debug_get_type (debug, klass->parent);
-
- for (i = 0; i < klass->method.count; i++) {
- MonoMethod *method = klass->methods [i];
- MonoType *ret_type = NULL;
- int j;
-
- if (method->signature->ret->type != MONO_TYPE_VOID)
- ret_type = method->signature->ret;
-
- if (ret_type) {
- MonoClass *ret_klass = mono_class_from_mono_type (ret_type);
- mono_debug_get_type (debug, ret_klass);
- }
-
- for (j = 0; j < method->signature->param_count; j++) {
- MonoType *sub_type = method->signature->params [j];
- MonoClass *sub_klass = mono_class_from_mono_type (sub_type);
- mono_debug_get_type (debug, sub_klass);
- }
- }
- // fall through
- case MONO_TYPE_VALUETYPE:
- for (i = 0; i < klass->field.count; i++) {
- MonoClass *subclass = mono_class_from_mono_type (klass->fields [i].type);
- mono_debug_get_type (debug, subclass);
- }
- break;
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
- mono_debug_get_type (debug, klass->element_class);
- break;
- default:
- break;
- }
-
- return index;
-}
-
-MonoDebugHandle *
-mono_debug_handle_from_class (MonoClass *klass)
-{
- MonoDebugHandle *debug;
-
- mono_class_init (klass);
-
- for (debug = mono_debug_handles; debug; debug = debug->next) {
- GList *tmp;
-
- for (tmp = debug->info; tmp; tmp = tmp->next) {
- AssemblyDebugInfo *info = (AssemblyDebugInfo*)tmp->data;
-
- if (info->image == klass->image)
- return debug;
- }
- }
-
- return NULL;
-}
-
-static gint32
-il_offset_from_address (DebugMethodInfo *minfo, guint32 address)
-{
- int i;
-
- for (i = 0; i < minfo->method_info.num_il_offsets; i++) {
- MonoDebugILOffsetInfo *ilo = &minfo->method_info.il_offsets [i];
-
- if (ilo->address > address)
- return ilo->offset;
- }
-
- return -1;
-}
-
-static gint32
-address_from_il_offset (DebugMethodInfo *minfo, guint32 il_offset)
-{
- int i;
-
- for (i = 0; i < minfo->method_info.num_il_offsets; i++) {
- MonoDebugILOffsetInfo *ilo = &minfo->method_info.il_offsets [i];
-
- if (ilo->offset > il_offset)
- return ilo->address;
- }
-
- return -1;
-}
-
-void
-mono_debug_add_type (MonoClass *klass)
-{
- MonoDebugHandle *debug = mono_debug_handle_from_class (klass);
-
- g_assert (debug != NULL);
-
- mono_debug_get_type (debug, klass);
-}
-
-static guint32
-il_offset_from_position (MonoFlowGraph *cfg, MonoPosition *pos)
-{
- MonoBBlock *bblock;
- MBTree *tree;
-
- if (pos->pos.bid >= cfg->block_count)
- return -1;
-
- bblock = &cfg->bblocks [pos->pos.bid];
- if (pos->pos.tid >= bblock->forest->len)
- return -1;
-
- tree = (MBTree *) g_ptr_array_index (bblock->forest, pos->pos.tid);
-
- return tree->cli_addr;
-}
-
-void
-mono_debug_add_method (MonoFlowGraph *cfg)
-{
- MonoMethod *method = cfg->method;
- MonoClass *klass = method->klass;
- int method_number = 0, line = 0, start_line = 0, end_line = 0, i;
- MonoDebugHandle* debug;
- AssemblyDebugInfo* info;
- DebugMethodInfo *minfo;
- char *name;
-
- mono_class_init (klass);
-
- debug = mono_debug_handle_from_class (klass);
- if (!debug) {
- if (mono_default_debug_handle)
- debug = mono_default_debug_handle;
- else
- return;
- }
-
- info = mono_debug_open_image (debug, klass->image);
-
- /*
- * Find the method index in the image.
- */
- for (i = 0; klass->methods && i < klass->method.count; ++i) {
- if (klass->methods [i] == method) {
- method_number = klass->method.first + i + 1;
- line = info->mlines [method_number];
- break;
- }
- }
-
- if (g_hash_table_lookup (debug->methods, method))
- return;
-
- debug->dirty = TRUE;
-
- if (info->moffsets) {
- /* info->moffsets contains -1 "outside" of functions. */
- for (i = line; (i > 0) && (info->moffsets [i] == 0); i--)
- ;
- start_line = i + 1;
-
- for (i = start_line; info->moffsets [i] != -1; i++)
- ;
- end_line = i;
- }
-
- name = g_strdup_printf ("%s%s%s.%s", klass->name_space, klass->name_space [0]? ".": "",
- klass->name, method->name);
-
- minfo = g_new0 (DebugMethodInfo, 1);
- minfo->name = name;
- minfo->start_line = start_line;
- minfo->first_line = line;
- minfo->last_line = end_line;
- minfo->source_file = info->source_file;
- minfo->info = info;
- minfo->method_info.code_start = cfg->start + 1;
- minfo->method_info.code_size = cfg->epilogue_end - 1;
- minfo->method_number = method_number;
- minfo->method_info.method = method;
- minfo->method_info.num_params = method->signature->param_count;
- minfo->method_info.params = g_new0 (MonoDebugVarInfo, minfo->method_info.num_params);
- minfo->method_info.prologue_end = cfg->prologue_end - 1;
- minfo->method_info.epilogue_begin = cfg->epilog - 1;
-
- if (method->signature->hasthis) {
- MonoVarInfo *ptr = ((MonoVarInfo *) cfg->varinfo->data) + cfg->args_start_index;
-
- minfo->method_info.this_var = g_new0 (MonoDebugVarInfo, 1);
- minfo->method_info.this_var->offset = ptr->offset;
- }
-
- for (i = 0; i < minfo->method_info.num_params; i++) {
- MonoVarInfo *ptr = ((MonoVarInfo *) cfg->varinfo->data) + cfg->args_start_index +
- method->signature->hasthis;
-
- minfo->method_info.params [i].offset = ptr [i].offset;
- }
-
- debug_generate_method_lines (info, minfo, cfg);
-
- if (!method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
- MonoMethodHeader *header = ((MonoMethodNormal*)method)->header;
- MonoVarInfo *ptr = ((MonoVarInfo *) cfg->varinfo->data) + cfg->locals_start_index;
- MonoDebugVarInfo *locals;
-
- locals = g_new0 (MonoDebugVarInfo, header->num_locals);
- for (i = 0; i < header->num_locals; i++) {
- gint32 begin_scope, end_scope;
-
- if (ptr [i].reg >= 0) {
- locals [i].index = ptr [i].reg | MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER;
- locals [i].offset = 0;
- } else
- locals [i].offset = ptr [i].offset;
-
- begin_scope = address_from_il_offset
- (minfo, il_offset_from_position (cfg, &ptr [i].range.first_use));
- end_scope = address_from_il_offset
- (minfo, il_offset_from_position (cfg, &ptr [i].range.last_use) + 1);
-
- if (begin_scope > 0)
- locals [i].begin_scope = begin_scope;
- else
- locals [i].begin_scope = minfo->method_info.prologue_end;
- if (end_scope > 0)
- locals [i].end_scope = end_scope;
- else
- locals [i].end_scope = minfo->method_info.epilogue_begin;
- }
-
- minfo->method_info.num_locals = header->num_locals;
- minfo->method_info.locals = locals;
- }
-
- g_hash_table_insert (debug->methods, method, minfo);
-}
-
-gchar *
-mono_debug_source_location_from_address (MonoMethod *method, guint32 address)
-{
- MonoDebugHandle *debug;
- DebugMethodInfo *minfo = NULL;
- int i;
-
- for (debug = mono_debug_handles; debug; debug = debug->next) {
- minfo = g_hash_table_lookup (debug->methods, method);
-
- if (minfo)
- break;
- }
-
- if (!minfo)
- return NULL;
-
- if (minfo->info->symfile) {
- gint32 offset = il_offset_from_address (minfo, address);
-
- if (offset < 0)
- return NULL;
-
- return mono_debug_find_source_location (minfo->info->symfile, method, offset);
- }
-
- if (!minfo->line_numbers)
- return NULL;
-
- for (i = 0; i < minfo->line_numbers->len; i++) {
- DebugLineNumberInfo *lni = g_ptr_array_index (minfo->line_numbers, i);
-
- if ((gchar *)lni->address > minfo->method_info.code_start + address) {
- gchar *source_file = g_ptr_array_index (debug->source_files, lni->source_file);
-
- return g_strdup_printf ("%s:%d", source_file, lni->line);
- }
- }
-
- return NULL;
-}
-
-gint32
-mono_debug_il_offset_from_address (MonoMethod *method, guint32 address)
-{
- MonoDebugHandle *debug;
- DebugMethodInfo *minfo = NULL;
-
- for (debug = mono_debug_handles; debug; debug = debug->next) {
- minfo = g_hash_table_lookup (debug->methods, method);
-
- if (minfo)
- break;
- }
-
- if (!minfo || !minfo->method_info.il_offsets)
- return -1;
-
- return il_offset_from_address (minfo, address);
-}
-
-gint32
-mono_debug_address_from_il_offset (MonoMethod *method, guint32 il_offset)
-{
- MonoDebugHandle *debug;
- DebugMethodInfo *minfo = NULL;
-
- for (debug = mono_debug_handles; debug; debug = debug->next) {
- minfo = g_hash_table_lookup (debug->methods, method);
-
- if (minfo)
- break;
- }
-
- if (!minfo || !minfo->method_info.il_offsets)
- return -1;
-
- return address_from_il_offset (minfo, il_offset);
-}
diff --git a/mono/jit/debug.h b/mono/jit/debug.h
deleted file mode 100644
index 775dc0aa1ad..00000000000
--- a/mono/jit/debug.h
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef __MONO_JIT_DEBUG_H__
-#define __MONO_JIT_DEBUG_H__
-
-#include <glib.h>
-#include <stdio.h>
-#include <mono/metadata/debug-symfile.h>
-#include <mono/metadata/loader.h>
-#include <mono/jit/jit.h>
-
-typedef struct _MonoDebugHandle MonoDebugHandle;
-
-typedef enum {
- MONO_DEBUG_FORMAT_NONE,
- MONO_DEBUG_FORMAT_STABS,
- MONO_DEBUG_FORMAT_DWARF2,
- MONO_DEBUG_FORMAT_DWARF2_PLUS
-} MonoDebugFormat;
-
-extern MonoDebugFormat mono_debug_format;
-extern GList *mono_debug_methods;
-
-/*
- * This variable is intended to be set in a debugger.
- *
- * If it's non-zero, arch_compile_method() will insert a breakpoint next time
- * it compiles a method.
- *
- * If it's positive, it acts as a counter which is decremented each time it's
- * used. Set it to a negative value to make arch_compile_method() insert a
- * breakpoint for each method.
- *
- * To use this, you should create a GDB macro like this:
- *
- * define enter
- * set mono_debug_insert_breakpoint = 1
- * continue
- * set *mono_debug_last_breakpoint_address = 0x90
- * reload-symbol-files
- * frame
- * end
- *
- * define reload-symbol-files
- * call mono_debug_make_symbols ()
- * add-symbol-file Test-debug.o
- * add-symbol-file /tmp/corlib.o
- * end
- *
- */
-extern int mono_debug_insert_breakpoint;
-
-/*
- * This is set the the core address of the last inserted breakpoint. You can
- * use this in GDB to unset the breakpoint.
- */
-
-extern gchar *mono_debug_last_breakpoint_address;
-
-MonoDebugHandle* mono_debug_open (MonoAssembly *assembly, MonoDebugFormat format,
- const char **args);
-
-void mono_debug_cleanup (void);
-
-void mono_debug_add_image (MonoDebugHandle* debug, MonoImage *image);
-
-MonoDebugHandle* mono_debug_handle_from_class (MonoClass *klass);
-
-void mono_debug_add_method (MonoFlowGraph *cfg);
-
-void mono_debug_add_type (MonoClass *klass);
-
-gchar * mono_debug_source_location_from_address (MonoMethod *method, guint32 address);
-
-gint32 mono_debug_il_offset_from_address (MonoMethod *method, guint32 address);
-
-gint32 mono_debug_address_from_il_offset (MonoMethod *method, guint32 il_offset);
-
-/* DEBUGGER PUBLIC FUNCTION:
- *
- * This is a public function which is supposed to be called from within a debugger
- * each time the program stops. It's used to recreate the symbol file to tell the
- * debugger about method addresses and such things. After calling this function,
- * you must tell your debugger to reload its symbol file.
- */
-void mono_debug_make_symbols (void);
-
-void mono_debug_write_symbols (MonoDebugHandle* debug);
-
-#endif /* __MONO_JIT_DEBUG_H__ */
diff --git a/mono/jit/delegate.c b/mono/jit/delegate.c
deleted file mode 100644
index 3de6d21d454..00000000000
--- a/mono/jit/delegate.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * delegate.c: delegate support functions
- *
- * Authors:
- * Dietmar Maurer (dietmar@ximian.com)
- *
- * (C) 2001 Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-
-#include <mono/arch/x86/x86-codegen.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/threadpool.h>
-
-#include "jit.h"
-#include "codegen.h"
-
-static gpointer
-arch_begin_invoke (MonoMethod *method, gpointer ret_ip, MonoObject *delegate)
-{
- MonoMethodMessage *msg;
- MonoDelegate *async_callback;
- MonoObject *state;
- MonoMethod *im;
-
- im = mono_get_delegate_invoke (method->klass);
- msg = arch_method_call_message_new (method, &delegate, im, &async_callback, &state);
-
- return mono_thread_pool_add (delegate, msg, async_callback, state);
-}
-
-gpointer
-arch_get_delegate_begin_invoke (MonoMethod *method)
-{
- guint8 *code, *addr;
-
- code = addr = g_malloc (32);
-
- x86_push_imm (code, method);
- x86_call_code (code, arch_begin_invoke);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
- x86_ret (code);
- g_assert ((code - addr) <= 32);
-
- return addr;
-}
-
-void
-arch_end_invoke (MonoMethod *method, gpointer first_arg, ...)
-{
- MonoDomain *domain = mono_domain_get ();
- MonoAsyncResult *ares;
- MonoMethodSignature *sig = method->signature;
- MonoMethodMessage *msg;
- MonoObject *res, *exc;
- MonoArray *out_args;
-
- g_assert (method);
-
- msg = arch_method_call_message_new (method, &first_arg, NULL, NULL, NULL);
-
- ares = mono_array_get (msg->args, gpointer, sig->param_count - 1);
- g_assert (ares);
-
- res = mono_thread_pool_finish (ares, &out_args, &exc);
-
- if (exc) {
- char *strace = mono_string_to_utf8 (((MonoException*)exc)->stack_trace);
- char *tmp;
- tmp = g_strdup_printf ("%s\nException Rethrown at:\n", strace);
- g_free (strace);
- ((MonoException*)exc)->stack_trace = mono_string_new (domain, tmp);
- g_free (tmp);
- mono_raise_exception ((MonoException*)exc);
- }
-
- /* restore return value */
- if (method->signature->ret->type != MONO_TYPE_VOID) {
- g_assert (res);
- arch_method_return_message_restore (method, &first_arg, res, out_args);
- }
-}
-
-gpointer
-arch_get_delegate_invoke (MonoMethod *method)
-{
- /*
- * Invoke( args .. ) {
- * if ( prev )
- * prev.Invoke();
- * return this.<m_target>( args );
- * }
- */
- MonoMethodSignature *csig = method->signature;
- guint8 *code, *addr, *br[2], *pos[2];
- int i, arg_size, this_pos = 4;
-
- if (csig->ret->type == MONO_TYPE_VALUETYPE) {
- g_assert (!csig->ret->byref);
- this_pos = 8;
- }
-
- arg_size = 0;
- if (csig->param_count) {
- int align;
-
- for (i = 0; i < csig->param_count; ++i) {
- arg_size += mono_type_stack_size (csig->params [i], &align);
- g_assert (align == 4);
- }
- }
-
- code = addr = g_malloc (64 + arg_size * 2);
-
- /* load the this pointer */
- x86_mov_reg_membase (code, X86_EAX, X86_ESP, this_pos, 4);
-
- /* load prev */
- x86_mov_reg_membase (code, X86_EDX, X86_EAX, G_STRUCT_OFFSET (MonoMulticastDelegate, prev), 4);
-
- /* prev == 0 ? */
- x86_alu_reg_imm (code, X86_CMP, X86_EDX, 0);
- br[0] = code; x86_branch32 (code, X86_CC_EQ, 0, TRUE );
- pos[0] = code;
-
- x86_push_reg( code, X86_EAX );
- /* push args */
- for ( i = 0; i < (arg_size>>2); i++ )
- x86_push_membase( code, X86_ESP, (arg_size + this_pos + 4) );
- /* push next */
- x86_push_reg( code, X86_EDX );
- if (this_pos == 8)
- x86_push_membase (code, X86_ESP, (arg_size + 8));
- /* recurse */
- br[1] = code; x86_call_imm( code, 0 );
- pos[1] = code; x86_call_imm( br[1], addr - pos[1] );
-
- if (this_pos == 8)
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, arg_size + 8);
- else
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, arg_size + 4);
- x86_pop_reg( code, X86_EAX );
-
- /* prev == 0 */
- x86_branch32( br[0], X86_CC_EQ, code - pos[0], TRUE );
-
- /* load mtarget */
- x86_mov_reg_membase (code, X86_EDX, X86_EAX, G_STRUCT_OFFSET (MonoDelegate, target), 4);
- /* mtarget == 0 ? */
- x86_alu_reg_imm (code, X86_CMP, X86_EDX, 0);
- br[0] = code; x86_branch32 (code, X86_CC_EQ, 0, TRUE);
- pos[0] = code;
-
- /*
- * virtual delegate methods: we have to
- * replace the this pointer with the actual
- * target
- */
- x86_mov_membase_reg (code, X86_ESP, this_pos, X86_EDX, 4);
-
- /* jump to method_ptr() */
- x86_jump_membase (code, X86_EAX, G_STRUCT_OFFSET (MonoDelegate, method_ptr));
-
- /* mtarget != 0 */
- x86_branch32( br[0], X86_CC_EQ, code - pos[0], TRUE);
- /*
- * static delegate methods: we have to remove
- * the this pointer from the activation frame
- * - I do this creating a new stack frame anx
- * copy all arguments except the this pointer
- */
- g_assert ((arg_size & 3) == 0);
- for (i = 0; i < (arg_size>>2); i++) {
- x86_push_membase (code, X86_ESP, (arg_size + this_pos));
- }
-
- if (this_pos == 8)
- x86_push_membase (code, X86_ESP, (arg_size + 4));
-
- x86_call_membase (code, X86_EAX, G_STRUCT_OFFSET (MonoDelegate, method_ptr));
- if (arg_size) {
- if (this_pos == 8)
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, arg_size + 4);
- else
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, arg_size);
- }
-
- x86_ret (code);
-
- g_assert ((code - addr) < (64 + arg_size * 2));
-
- return addr;
-}
diff --git a/mono/jit/emit-x86.c b/mono/jit/emit-x86.c
index 93fb5af7d2c..bbeb063383d 100644
--- a/mono/jit/emit-x86.c
+++ b/mono/jit/emit-x86.c
@@ -24,13 +24,12 @@
#include "jit.h"
#include "helpers.h"
#include "codegen.h"
-#include "debug.h"
//#define DEBUG_REGALLOC
//#define DEBUG_SPILLS
-char *
+const char *
arch_get_reg_name (int regnum)
{
switch (regnum) {
@@ -66,6 +65,9 @@ int mono_x86_have_cmov = 0;
static int
cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx)
{
+#ifdef PIC
+ return 0;
+#else
int have_cpuid = 0;
__asm__ __volatile__ (
"pushfl\n"
@@ -91,6 +93,7 @@ cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx)
return 1;
}
return 0;
+#endif
}
void
@@ -105,62 +108,123 @@ mono_cpu_detect (void) {
}
}
+/*
+ * arch_get_argument_info:
+ * @csig: a method signature
+ * @param_count: the number of parameters to consider
+ * @arg_info: an array to store the result infos
+ *
+ * Gathers information on parameters such as size, alignment and
+ * padding. arg_info should be large enought to hold param_count + 1 entries.
+ *
+ * Returns the size of the activation frame.
+ */
+int
+arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+{
+ int k, frame_size = 0;
+ int size, align, pad;
+ int offset = 8;
+
+ if (MONO_TYPE_ISSTRUCT (csig->ret)) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].offset = offset;
+
+ if (csig->hasthis) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].size = frame_size;
+
+ for (k = 0; k < param_count; k++) {
+
+ if (csig->pinvoke)
+ size = mono_type_native_stack_size (csig->params [k], &align);
+ else
+ size = mono_type_stack_size (csig->params [k], &align);
+
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+ frame_size += size;
+ arg_info [k + 1].pad = 0;
+ arg_info [k + 1].size = size;
+ offset += pad;
+ arg_info [k + 1].offset = offset;
+ offset += size;
+ }
+
+ align = MONO_FRAME_ALIGNMENT;
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+
+ return frame_size;
+}
+
static void
enter_method (MonoMethod *method, char *ebp)
{
int i, j;
MonoClass *class;
MonoObject *o;
- char *tmpsig;
+ MonoJitArgumentInfo *arg_info;
+ MonoMethodSignature *sig;
+ char *fname;
- tmpsig = mono_signature_get_desc(method->signature, TRUE);
- printf ("ENTER: %s.%s::%s (%s)\n(", method->klass->name_space,
- method->klass->name, method->name, tmpsig);
- g_free (tmpsig);
+ fname = mono_method_full_name (method, TRUE);
+ printf ("ENTER: %s\n(", fname);
+ g_free (fname);
- if (((int)ebp & 3) != 0) {
+ if (((int)ebp & (MONO_FRAME_ALIGNMENT - 1)) != 0) {
g_error ("unaligned stack detected (%p)", ebp);
}
- ebp += 8;
+ sig = method->signature;
- if (ISSTRUCT (method->signature->ret)) {
- int size, align;
-
- g_assert (!method->signature->ret->byref);
+ if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)
+ g_assert (!sig->pinvoke);
- size = mono_type_stack_size (method->signature->ret, &align);
+ arg_info = alloca (sizeof (MonoJitArgumentInfo) * (sig->param_count + 1));
- printf ("VALUERET:%p, ", *((gpointer *)ebp));
- ebp += sizeof (gpointer);
+ arch_get_argument_info (sig, sig->param_count, arg_info);
+
+ if (MONO_TYPE_ISSTRUCT (method->signature->ret)) {
+ g_assert (!method->signature->ret->byref);
+
+ printf ("VALUERET:%p, ", *((gpointer *)(ebp + 8)));
}
if (method->signature->hasthis) {
+ gpointer *this = (gpointer *)(ebp + arg_info [0].offset);
if (method->klass->valuetype) {
- printf ("value:%p, ", *((gpointer *)ebp));
+ printf ("value:%p, ", *this);
} else {
- o = *((MonoObject **)ebp);
+ o = *((MonoObject **)this);
- g_assert (o);
-
- class = o->vtable->klass;
+ if (o) {
+ class = o->vtable->klass;
- if (class == mono_defaults.string_class) {
- printf ("this:[STRING:%p:%s], ", o, mono_string_to_utf8 ((MonoString *)o));
- } else {
- printf ("this:%p[%s.%s], ", o, class->name_space, class->name);
- }
+ if (class == mono_defaults.string_class) {
+ printf ("this:[STRING:%p:%s], ", o, mono_string_to_utf8 ((MonoString *)o));
+ } else {
+ printf ("this:%p[%s.%s], ", o, class->name_space, class->name);
+ }
+ } else
+ printf ("this:NULL, ");
}
- ebp += sizeof (gpointer);
}
for (i = 0; i < method->signature->param_count; ++i) {
- MonoType *type = method->signature->params [i];
- int size, align;
- size = mono_type_stack_size (type, &align);
+ gpointer *cpos = (gpointer *)(ebp + arg_info [i + 1].offset);
+ int size = arg_info [i + 1].size;
+ MonoType *type = method->signature->params [i];
+
if (type->byref) {
- printf ("[BYREF:%p], ", *((gpointer *)ebp));
+ printf ("[BYREF:%p], ", *cpos);
} else switch (type->type) {
case MONO_TYPE_BOOLEAN:
@@ -173,10 +237,10 @@ enter_method (MonoMethod *method, char *ebp)
case MONO_TYPE_U4:
case MONO_TYPE_I:
case MONO_TYPE_U:
- printf ("%d, ", *((int *)(ebp)));
+ printf ("%d, ", *((int *)(cpos)));
break;
case MONO_TYPE_STRING: {
- MonoString *s = *((MonoString **)ebp);
+ MonoString *s = *((MonoString **)cpos);
if (s) {
g_assert (((MonoObject *)s)->vtable->klass == mono_defaults.string_class);
printf ("[STRING:%p:%s], ", s, mono_string_to_utf8 (s));
@@ -186,7 +250,7 @@ enter_method (MonoMethod *method, char *ebp)
}
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT: {
- o = *((MonoObject **)ebp);
+ o = *((MonoObject **)cpos);
if (o) {
class = o->vtable->klass;
@@ -197,7 +261,7 @@ enter_method (MonoMethod *method, char *ebp)
} else
printf ("[%s.%s:%p], ", class->name_space, class->name, o);
} else {
- printf ("%p, ", *((gpointer *)(ebp)));
+ printf ("%p, ", *((gpointer *)(cpos)));
}
break;
}
@@ -205,30 +269,26 @@ enter_method (MonoMethod *method, char *ebp)
case MONO_TYPE_FNPTR:
case MONO_TYPE_ARRAY:
case MONO_TYPE_SZARRAY:
- printf ("%p, ", *((gpointer *)(ebp)));
+ printf ("%p, ", *((gpointer *)(cpos)));
break;
case MONO_TYPE_I8:
- printf ("%lld, ", *((gint64 *)(ebp)));
+ printf ("%lld, ", *((gint64 *)(cpos)));
break;
case MONO_TYPE_R4:
- printf ("%f, ", *((float *)(ebp)));
+ printf ("%f, ", *((float *)(cpos)));
break;
case MONO_TYPE_R8:
- printf ("%f, ", *((double *)(ebp)));
+ printf ("%f, ", *((double *)(cpos)));
break;
case MONO_TYPE_VALUETYPE:
printf ("[");
for (j = 0; j < size; j++)
- printf ("%02x,", *((guint8*)ebp +j));
+ printf ("%02x,", *((guint8*)cpos +j));
printf ("], ");
break;
default:
printf ("XX, ");
}
-
- g_assert (align == 4 || align == 8);
- ebp += size + align - 1;
- ebp = (gpointer)((unsigned)ebp & ~(align - 1));
}
printf (")\n");
@@ -238,9 +298,11 @@ static void
leave_method (MonoMethod *method, int edx, int eax, double test)
{
gint64 l;
+ char *fname;
- printf ("LEAVE: %s.%s::%s ", method->klass->name_space,
- method->klass->name, method->name);
+ fname = mono_method_full_name (method, TRUE);
+ printf ("LEAVE: %s", fname);
+ g_free (fname);
switch (method->signature->ret->type) {
case MONO_TYPE_VOID:
@@ -281,6 +343,8 @@ leave_method (MonoMethod *method, int edx, int eax, double test)
printf ("[BOOLEAN:%p:%d]", o, *((guint8 *)o + sizeof (MonoObject)));
} else if (o->vtable->klass == mono_defaults.int32_class) {
printf ("[INT32:%p:%d]", o, *((gint32 *)((char *)o + sizeof (MonoObject))));
+ } else if (o->vtable->klass == mono_defaults.int64_class) {
+ printf ("[INT64:%p:%lld]", o, *((gint64 *)((char *)o + sizeof (MonoObject))));
} else
printf ("[%s.%s:%p]", o->vtable->klass->name_space, o->vtable->klass->name, o);
} else
@@ -321,28 +385,69 @@ arch_emit_prologue (MonoFlowGraph *cfg)
{
MonoMethod *method = cfg->method;
MonoMethodHeader *header = ((MonoMethodNormal *)method)->header;
- int i, j, k, alloc_size;
+ int i, j, k, alloc_size, pos;
x86_push_reg (cfg->code, X86_EBP);
x86_mov_reg_reg (cfg->code, X86_EBP, X86_ESP, 4);
alloc_size = cfg->locals_size;
+ pos = 0;
- if (mono_regset_reg_used (cfg->rs, X86_EBX)) {
- x86_push_reg (cfg->code, X86_EBX);
- alloc_size -= 4;
- }
+ if (method->save_lmf) {
+
+ pos += sizeof (MonoLMF);
- if (mono_regset_reg_used (cfg->rs, X86_EDI)) {
+ /* save the current IP */
+ cfg->lmfip_offset = cfg->code + 1 - cfg->start;
+ x86_push_imm (cfg->code, 0);
+ /* save all caller saved regs */
+ x86_push_reg (cfg->code, X86_EBX);
x86_push_reg (cfg->code, X86_EDI);
- alloc_size -= 4;
- }
-
- if (mono_regset_reg_used (cfg->rs, X86_ESI)) {
x86_push_reg (cfg->code, X86_ESI);
- alloc_size -= 4;
+ x86_push_reg (cfg->code, X86_EBP);
+
+ /* save method info */
+ x86_push_imm (cfg->code, method);
+
+ /* get the address of lmf for the current thread */
+ mono_add_jump_info (cfg, cfg->code, MONO_JUMP_INFO_ABS, mono_get_lmf_addr);
+ x86_call_code (cfg->code, 0);
+
+ /* push lmf */
+ x86_push_reg (cfg->code, X86_EAX);
+ /* push *lfm (previous_lmf) */
+ x86_push_membase (cfg->code, X86_EAX, 0);
+ /* *(lmf) = ESP */
+ x86_mov_membase_reg (cfg->code, X86_EAX, 0, X86_ESP, 4);
+ } else {
+
+#if 0
+ /* activation frame alignment check */
+ x86_mov_reg_reg (cfg->code, X86_EAX, X86_ESP, 4);
+ x86_alu_reg_imm (cfg->code, X86_AND, X86_EAX, MONO_FRAME_ALIGNMENT - 1);
+ x86_alu_reg_imm (cfg->code, X86_CMP, X86_EAX, 0);
+ x86_branch32 (cfg->code, X86_CC_EQ, 1, FALSE);
+ x86_breakpoint (cfg->code);
+#endif
+
+ if (mono_regset_reg_used (cfg->rs, X86_EBX)) {
+ x86_push_reg (cfg->code, X86_EBX);
+ pos += 4;
+ }
+
+ if (mono_regset_reg_used (cfg->rs, X86_EDI)) {
+ x86_push_reg (cfg->code, X86_EDI);
+ pos += 4;
+ }
+
+ if (mono_regset_reg_used (cfg->rs, X86_ESI)) {
+ x86_push_reg (cfg->code, X86_ESI);
+ pos += 4;
+ }
}
+ alloc_size -= pos;
+
if (alloc_size)
x86_alu_reg_imm (cfg->code, X86_SUB, X86_ESP, alloc_size);
@@ -500,24 +605,85 @@ arch_emit_epilogue (MonoFlowGraph *cfg)
x86_pop_reg (cfg->code, X86_EAX);
}
- pos = -4;
- if (mono_regset_reg_used (cfg->rs, X86_EBX)) {
- x86_mov_reg_membase (cfg->code, X86_EBX, X86_EBP, pos, 4);
- pos -= 4;
+ pos = 0;
+
+ if (cfg->method->save_lmf) {
+ pos = -sizeof (MonoLMF);
+ } else {
+ if (mono_regset_reg_used (cfg->rs, X86_EBX)) {
+ pos -= 4;
}
- if (mono_regset_reg_used (cfg->rs, X86_EDI)) {
- x86_mov_reg_membase (cfg->code, X86_EDI, X86_EBP, pos, 4);
- pos -= 4;
+ if (mono_regset_reg_used (cfg->rs, X86_EDI)) {
+ pos -= 4;
+ }
+ if (mono_regset_reg_used (cfg->rs, X86_ESI)) {
+ pos -= 4;
+ }
}
- if (mono_regset_reg_used (cfg->rs, X86_ESI)) {
- x86_mov_reg_membase (cfg->code, X86_ESI, X86_EBP, pos, 4);
- pos -= 4;
+ if (pos)
+ x86_lea_membase (cfg->code, X86_ESP, X86_EBP, pos);
+
+ if (cfg->method->save_lmf) {
+ /* ebx = previous_lmf */
+ x86_pop_reg (cfg->code, X86_EBX);
+ /* edi = lmf */
+ x86_pop_reg (cfg->code, X86_EDI);
+ /* *(lmf) = previous_lmf */
+ x86_mov_membase_reg (cfg->code, X86_EDI, 0, X86_EBX, 4);
+
+ /* discard method info */
+ x86_pop_reg (cfg->code, X86_ESI);
+
+ /* restore caller saved regs */
+ x86_pop_reg (cfg->code, X86_EBP);
+ x86_pop_reg (cfg->code, X86_ESI);
+ x86_pop_reg (cfg->code, X86_EDI);
+ x86_pop_reg (cfg->code, X86_EBX);
+
+ } else {
+
+ if (mono_regset_reg_used (cfg->rs, X86_ESI)) {
+ x86_pop_reg (cfg->code, X86_ESI);
+ }
+ if (mono_regset_reg_used (cfg->rs, X86_EDI)) {
+ x86_pop_reg (cfg->code, X86_EDI);
+ }
+ if (mono_regset_reg_used (cfg->rs, X86_EBX)) {
+ x86_pop_reg (cfg->code, X86_EBX);
+ }
}
x86_leave (cfg->code);
x86_ret (cfg->code);
}
+static void
+init_varinfo (MonoFlowGraph *cfg, MonoVarInfo *vi)
+{
+ vi->range.last_use.abs_pos = 0;
+ vi->range.first_use.pos.bid = 0xffff;
+ vi->range.first_use.pos.tid = 0;
+ vi->isvolatile = 0;
+ vi->reg = -1;
+ vi->varnum = cfg->varinfo->len;
+}
+
+int
+arch_allocate_arg (MonoFlowGraph *cfg, MonoJitArgumentInfo *info, MonoValueType type)
+{
+ MonoVarInfo vi;
+
+ mono_jit_stats.allocate_var++;
+
+ init_varinfo (cfg, &vi);
+ vi.isvolatile = 1;
+
+ SET_VARINFO (vi, type, MONO_ARGVAR, info->offset, info->size);
+ g_array_append_val (cfg->varinfo, vi);
+
+ return cfg->varinfo->len - 1;
+}
+
int
arch_allocate_var (MonoFlowGraph *cfg, int size, int align, MonoVarType vartype, MonoValueType type)
{
@@ -525,43 +691,17 @@ arch_allocate_var (MonoFlowGraph *cfg, int size, int align, MonoVarType vartype,
mono_jit_stats.allocate_var++;
- vi.range.last_use.abs_pos = 0;
- vi.range.first_use.pos.bid = 0xffff;
- vi.range.first_use.pos.tid = 0;
- vi.isvolatile = 0;
- vi.reg = -1;
- vi.varnum = cfg->varinfo->len;
+ init_varinfo (cfg, &vi);
if (size != sizeof (gpointer))
vi.isvolatile = 1;
- switch (vartype) {
- case MONO_TEMPVAR:
- case MONO_LOCALVAR: {
- cfg->locals_size += size;
- cfg->locals_size += align - 1;
- cfg->locals_size &= ~(align - 1);
-
- SET_VARINFO (vi, type, vartype, - cfg->locals_size, size);
- g_array_append_val (cfg->varinfo, vi);
- break;
- }
- case MONO_ARGVAR: {
- int arg_start = 8 + cfg->has_vtarg*4;
+ cfg->locals_size += size;
+ cfg->locals_size += align - 1;
+ cfg->locals_size &= ~(align - 1);
- g_assert ((align & 3) == 0);
-
- SET_VARINFO (vi, type, vartype, cfg->args_size + arg_start, size);
- g_array_append_val (cfg->varinfo, vi);
-
- cfg->args_size += size;
- cfg->args_size += 3;
- cfg->args_size &= ~3;
- break;
- }
- default:
- g_assert_not_reached ();
- }
+ SET_VARINFO (vi, type, vartype, - cfg->locals_size, size);
+ g_array_append_val (cfg->varinfo, vi);
return cfg->varinfo->len - 1;
}
@@ -587,9 +727,8 @@ mono_label_cfg (MonoFlowGraph *cfg)
mbstate = mono_burg_label (t1, cfg);
if (!mbstate) {
- if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
- return FALSE;
- g_warning ("tree does not match");
+ g_warning ("tree does not match in %s: 0x%04x",
+ mono_method_full_name (cfg->method, TRUE), t1->cli_addr);
mono_print_ctree (cfg, t1); printf ("\n\n");
mono_print_forest (cfg, forest);
@@ -1065,6 +1204,12 @@ mono_compute_branches (MonoFlowGraph *cfg)
}
x86_patch (ip, target);
}
+
+ /* patch the IP in the LMF saving code */
+ if (cfg->lmfip_offset) {
+ *((guint32 *)(cfg->start + cfg->lmfip_offset)) =
+ (gint32)(cfg->start + cfg->lmfip_offset);
+ }
}
void
@@ -1086,6 +1231,7 @@ arch_jit_compile_cfg (MonoDomain *target_domain, MonoFlowGraph *cfg)
MonoJitInfo *ji;
guint32 ls_used_mask = 0;
MonoMethod *method = cfg->method;
+ int offset, gap;
ji = mono_mempool_alloc0 (target_domain->mp, sizeof (MonoJitInfo));
@@ -1101,11 +1247,10 @@ arch_jit_compile_cfg (MonoDomain *target_domain, MonoFlowGraph *cfg)
mono_linear_scan (cfg, &ls_used_mask);
cfg->rs->used_mask |= ls_used_mask;
}
-
+
if (mono_jit_dump_forest) {
int i;
- printf ("FOREST %s.%s:%s\n", method->klass->name_space,
- method->klass->name, method->name);
+ printf ("FOREST %s\n", mono_method_full_name (method, TRUE));
for (i = 0; i < cfg->block_count; i++) {
printf ("BLOCK %d:\n", i);
mono_print_forest (cfg, cfg->bblocks [i].forest);
@@ -1127,6 +1272,21 @@ arch_jit_compile_cfg (MonoDomain *target_domain, MonoFlowGraph *cfg)
arch_emit_epilogue (cfg);
cfg->epilogue_end = cfg->code - cfg->start;
+ offset = cfg->code - cfg->start;
+ gap = cfg->code_size - offset;
+ if (gap > 0) {
+ char *org = cfg->start;
+#if 0
+ cfg->start = g_realloc (cfg->start, offset);
+#else
+ cfg->start = mono_mempool_alloc (target_domain->code_mp, offset);
+ memcpy (cfg->start, org, offset);
+ g_free (org);
+#endif
+ cfg->code_size = offset;
+ cfg->code = cfg->start + offset;
+ }
+
mono_compute_branches (cfg);
ji->code_size = cfg->code - cfg->start;
diff --git a/mono/jit/exception.c b/mono/jit/exception.c
index 5cbc63e1bfc..59b4c811a9c 100644
--- a/mono/jit/exception.c
+++ b/mono/jit/exception.c
@@ -9,18 +9,19 @@
#include <config.h>
#include <glib.h>
+#include <signal.h>
#include <mono/arch/x86/x86-codegen.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/threads.h>
#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/mono-debug.h>
#include "jit.h"
#include "codegen.h"
-#include "debug.h"
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
# define SC_EAX sc_eax
# define SC_EBX sc_ebx
# define SC_ECX sc_ecx
@@ -42,6 +43,280 @@
# define SC_ESI esi
#endif
+typedef struct sigcontext MonoContext;
+
+#define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->SC_EIP = (long)ip; } while (0);
+#define MONO_CONTEXT_SET_BP(ctx,bp) do { (ctx)->SC_EBP = (long)bp; } while (0);
+#define MONO_CONTEXT_SET_EXCREG(ctx,exc) do { (ctx)->SC_ECX = (long)exc; } while (0);
+
+#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->SC_EIP))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->SC_EBP))
+
+#ifdef MONO_USE_EXC_TABLES
+
+/*************************************/
+/* STACK UNWINDING STUFF */
+/*************************************/
+
+/* These definitions are from unwind-dw2.c in glibc 2.2.5 */
+
+/* For x86 */
+#define DWARF_FRAME_REGISTERS 17
+
+typedef struct frame_state
+{
+ void *cfa;
+ void *eh_ptr;
+ long cfa_offset;
+ long args_size;
+ long reg_or_offset[DWARF_FRAME_REGISTERS+1];
+ unsigned short cfa_reg;
+ unsigned short retaddr_column;
+ char saved[DWARF_FRAME_REGISTERS+1];
+} frame_state;
+
+static long
+get_sigcontext_reg (struct sigcontext *ctx, int dwarf_regnum)
+{
+ switch (dwarf_regnum) {
+ case X86_EAX:
+ return ctx->eax;
+ case X86_EBX:
+ return ctx->ebx;
+ case X86_ECX:
+ return ctx->ecx;
+ case X86_EDX:
+ return ctx->edx;
+ case X86_ESI:
+ return ctx->esi;
+ case X86_EDI:
+ return ctx->edi;
+ case X86_EBP:
+ return ctx->ebp;
+ case X86_ESP:
+ return ctx->esp;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return 0;
+}
+
+static void
+set_sigcontext_reg (struct sigcontext *ctx, int dwarf_regnum, long value)
+{
+ switch (dwarf_regnum) {
+ case X86_EAX:
+ ctx->eax = value;
+ break;
+ case X86_EBX:
+ ctx->ebx = value;
+ break;
+ case X86_ECX:
+ ctx->ecx = value;
+ break;
+ case X86_EDX:
+ ctx->edx = value;
+ break;
+ case X86_ESI:
+ ctx->esi = value;
+ break;
+ case X86_EDI:
+ ctx->edi = value;
+ break;
+ case X86_EBP:
+ ctx->ebp = value;
+ break;
+ case X86_ESP:
+ ctx->esp = value;
+ break;
+ case 8:
+ ctx->eip = value;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+typedef struct frame_state * (*framesf) (void *, struct frame_state *);
+
+static framesf frame_state_for = NULL;
+
+static gboolean inited = FALSE;
+
+typedef char ** (*get_backtrace_symbols_type) (void *__const *__array, int __size);
+
+static get_backtrace_symbols_type get_backtrace_symbols = NULL;
+
+static void
+init_frame_state_for (void)
+{
+ GModule *module;
+
+ /*
+ * There are two versions of __frame_state_for: one in libgcc.a and the
+ * other in glibc.so. We need the version from glibc.
+ * For more info, see this:
+ * http://gcc.gnu.org/ml/gcc/2002-08/msg00192.html
+ */
+ if ((module = g_module_open ("libc.so.6", G_MODULE_BIND_LAZY))) {
+
+ if (!g_module_symbol (module, "__frame_state_for", (gpointer*)&frame_state_for))
+ frame_state_for = NULL;
+
+ if (!g_module_symbol (module, "backtrace_symbols", (gpointer*)&get_backtrace_symbols)) {
+ get_backtrace_symbols = NULL;
+ frame_state_for = NULL;
+ }
+
+ g_module_close (module);
+ }
+
+ inited = TRUE;
+}
+
+/* mono_has_unwind_info:
+ *
+ * Tests if a function has an DWARF exception table able to restore
+ * all caller saved registers.
+ */
+gboolean
+mono_has_unwind_info (MonoMethod *method)
+{
+ struct frame_state state_in;
+ struct frame_state *res;
+
+ if (!inited)
+ init_frame_state_for ();
+
+ if (!frame_state_for)
+ return FALSE;
+
+ g_assert (method->addr);
+
+ memset (&state_in, 0, sizeof (state_in));
+
+ /* offset 10 is just a guess, but it works for all methods tested */
+ if ((res = frame_state_for ((char *)method->addr + 10, &state_in))) {
+
+ if (res->saved [X86_EBX] != 1 ||
+ res->saved [X86_EDI] != 1 ||
+ res->saved [X86_EBP] != 1 ||
+ res->saved [X86_ESI] != 1) {
+ return FALSE;
+ }
+ return TRUE;
+ } else
+ return FALSE;
+}
+
+struct stack_frame
+{
+ void *next;
+ void *return_address;
+};
+
+static MonoJitInfo *
+x86_unwind_native_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, struct sigcontext *ctx,
+ struct sigcontext *new_ctx, MonoLMF *lmf, char **trace)
+{
+ struct stack_frame *frame;
+ gpointer max_stack;
+ MonoJitInfo *ji;
+ struct frame_state state_in;
+ struct frame_state *res;
+
+ if (trace)
+ *trace = NULL;
+
+ if (!inited)
+ init_frame_state_for ();
+
+ if (!frame_state_for)
+ return FALSE;
+
+ frame = MONO_CONTEXT_GET_BP (ctx);
+
+ max_stack = lmf && lmf->method ? lmf : jit_tls->end_of_stack;
+
+ *new_ctx = *ctx;
+
+ memset (&state_in, 0, sizeof (state_in));
+
+ while ((gpointer)frame->next < (gpointer)max_stack) {
+ gpointer ip, addr = frame->return_address;
+ void *cfa;
+ char *tmp, **symbols;
+
+ if (trace) {
+ ip = MONO_CONTEXT_GET_IP (new_ctx);
+ symbols = get_backtrace_symbols (&ip, 1);
+ if (*trace)
+ tmp = g_strdup_printf ("%s\nin (unmanaged) %s", *trace, symbols [0]);
+ else
+ tmp = g_strdup_printf ("in (unmanaged) %s", symbols [0]);
+
+ free (symbols);
+ g_free (*trace);
+ *trace = tmp;
+ }
+
+ if ((res = frame_state_for (addr, &state_in))) {
+ int i;
+
+ cfa = (gint8*) (get_sigcontext_reg (new_ctx, res->cfa_reg) + res->cfa_offset);
+ frame = (struct stack_frame *)((gint8*)cfa - 8);
+ for (i = 0; i < DWARF_FRAME_REGISTERS + 1; i++) {
+ int how = res->saved[i];
+ long val;
+ g_assert ((how == 0) || (how == 1));
+
+ if (how == 1) {
+ val = * (long*) ((gint8*)cfa + res->reg_or_offset[i]);
+ set_sigcontext_reg (new_ctx, i, val);
+ }
+ }
+ new_ctx->esp = (long)cfa;
+
+ if (res->saved [X86_EBX] == 1 &&
+ res->saved [X86_EDI] == 1 &&
+ res->saved [X86_EBP] == 1 &&
+ res->saved [X86_ESI] == 1 &&
+ (ji = mono_jit_info_table_find (domain, frame->return_address))) {
+ //printf ("FRAME CFA %s\n", mono_method_full_name (ji->method, TRUE));
+ return ji;
+ }
+
+ } else {
+ //printf ("FRAME %p %p %p\n", frame, MONO_CONTEXT_GET_IP (new_ctx), mono_jit_info_table_find (domain, MONO_CONTEXT_GET_IP (new_ctx)));
+
+ MONO_CONTEXT_SET_IP (new_ctx, frame->return_address);
+ frame = frame->next;
+ MONO_CONTEXT_SET_BP (new_ctx, frame);
+
+ /* stop if !frame or when we detect an unexpected managed frame */
+ if (!frame || mono_jit_info_table_find (domain, frame->return_address)) {
+ if (trace) {
+ g_free (*trace);
+ *trace = NULL;
+ }
+ return NULL;
+ }
+ }
+ }
+
+ //if (!lmf)
+ //g_assert_not_reached ();
+
+ if (trace) {
+ g_free (*trace);
+ *trace = NULL;
+ }
+ return NULL;
+}
+
+#endif
+
/*
* arch_get_restore_context:
*
@@ -86,14 +361,16 @@ arch_get_restore_context (void)
}
/*
- * arch_get_call_finally:
+ * arch_get_call_filter:
*
- * Returns a pointer to a method which calls a finally handler.
+ * Returns a pointer to a method which calls an exception filter. We
+ * also use this function to call finally handlers (we pass NULL as
+ * @exc object in this case).
*/
static gpointer
-arch_get_call_finally (void)
+arch_get_call_filter (void)
{
- static guint8 start [28];
+ static guint8 start [64];
static int inited = 0;
guint8 *code;
@@ -101,7 +378,7 @@ arch_get_call_finally (void)
return start;
inited = 1;
- /* call_finally (struct sigcontext *ctx, unsigned long eip) */
+ /* call_filter (struct sigcontext *ctx, unsigned long eip, gpointer exc) */
code = start;
x86_push_reg (code, X86_EBP);
@@ -116,12 +393,18 @@ arch_get_call_finally (void)
x86_mov_reg_membase (code, X86_ECX, X86_EBP, 12, 4);
/* save EBP */
x86_push_reg (code, X86_EBP);
+ /* push exc */
+ x86_push_membase (code, X86_EBP, 16);
/* set new EBP */
x86_mov_reg_membase (code, X86_EBP, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EBP), 4);
+ /* restore registers used by global register allocation (EBX & ESI) */
+ x86_mov_reg_membase (code, X86_EBX, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EBX), 4);
+ x86_mov_reg_membase (code, X86_ESI, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_ESI), 4);
/* save the ESP - this is used by endfinally */
- x86_mov_membase_reg (code, X86_EBP, -16, X86_ESP, 4);
+ x86_mov_membase_reg (code, X86_EBP, mono_exc_esp_offset, X86_ESP, 4);
/* call the handler */
x86_call_reg (code, X86_ECX);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
/* restore EBP */
x86_pop_reg (code, X86_EBP);
/* restore saved regs */
@@ -131,10 +414,124 @@ arch_get_call_finally (void)
x86_leave (code);
x86_ret (code);
- g_assert ((code - start) < 28);
+ g_assert ((code - start) < 64);
+ return start;
+}
+
+static void
+throw_exception (unsigned long eax, unsigned long ecx, unsigned long edx, unsigned long ebx,
+ unsigned long esi, unsigned long edi, unsigned long ebp, MonoObject *exc,
+ unsigned long eip, unsigned long esp)
+{
+ static void (*restore_context) (struct sigcontext *);
+ struct sigcontext ctx;
+
+ if (!restore_context)
+ restore_context = arch_get_restore_context ();
+
+ /* adjust eip so that it point into the call instruction */
+ eip -= 1;
+
+ ctx.SC_ESP = esp;
+ ctx.SC_EIP = eip;
+ ctx.SC_EBP = ebp;
+ ctx.SC_EDI = edi;
+ ctx.SC_ESI = esi;
+ ctx.SC_EBX = ebx;
+ ctx.SC_EDX = edx;
+ ctx.SC_ECX = ecx;
+ ctx.SC_EAX = eax;
+
+ arch_handle_exception (&ctx, exc, FALSE);
+ restore_context (&ctx);
+
+ g_assert_not_reached ();
+}
+
+/**
+ * arch_get_throw_exception:
+ *
+ * Returns a function pointer which can be used to raise
+ * exceptions. The returned function has the following
+ * signature: void (*func) (MonoException *exc);
+ * For example to raise an arithmetic exception you can use:
+ *
+ * x86_push_imm (code, mono_get_exception_arithmetic ());
+ * x86_call_code (code, arch_get_throw_exception ());
+ *
+ */
+gpointer
+arch_get_throw_exception (void)
+{
+ static guint8 start [24];
+ static int inited = 0;
+ guint8 *code;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ code = start;
+
+ x86_push_reg (code, X86_ESP);
+ x86_push_membase (code, X86_ESP, 4); /* IP */
+ x86_push_membase (code, X86_ESP, 12); /* exception */
+ x86_push_reg (code, X86_EBP);
+ x86_push_reg (code, X86_EDI);
+ x86_push_reg (code, X86_ESI);
+ x86_push_reg (code, X86_EBX);
+ x86_push_reg (code, X86_EDX);
+ x86_push_reg (code, X86_ECX);
+ x86_push_reg (code, X86_EAX);
+ x86_call_code (code, throw_exception);
+ /* we should never reach this breakpoint */
+ x86_breakpoint (code);
+
+ g_assert ((code - start) < 24);
return start;
}
+/**
+ * arch_get_throw_exception_by_name:
+ *
+ * Returns a function pointer which can be used to raise
+ * corlib exceptions. The returned function has the following
+ * signature: void (*func) (char *exc_name);
+ * For example to raise an arithmetic exception you can use:
+ *
+ * x86_push_imm (code, "ArithmeticException");
+ * x86_call_code (code, arch_get_throw_exception ());
+ *
+ */
+gpointer
+arch_get_throw_exception_by_name ()
+{
+ static guint8 start [32];
+ static int inited = 0;
+ guint8 *code;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ code = start;
+
+ /* fixme: we do not save EAX, EDX, ECD - unsure if we need that */
+
+ x86_push_membase (code, X86_ESP, 4); /* exception name */
+ x86_push_imm (code, "System");
+ x86_push_imm (code, mono_defaults.exception_class->image);
+ x86_call_code (code, mono_exception_from_name);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 12);
+ /* save the newly create object (overwrite exception name)*/
+ x86_mov_membase_reg (code, X86_ESP, 4, X86_EAX, 4);
+ x86_jump_code (code, arch_get_throw_exception ());
+
+ g_assert ((code - start) < 32);
+
+ return start;
+}
+
static MonoArray *
glist_to_array (GList *list)
{
@@ -154,146 +551,136 @@ glist_to_array (GList *list)
return res;
}
-/*
- * return TRUE if the exception is catched. It also sets the
- * stack_trace String.
+/* mono_arch_find_jit_info:
+ *
+ * This function is used to gather information from @ctx. It return the
+ * MonoJitInfo of the corresponding function, unwinds one stack frame and
+ * stores the resulting context into @new_ctx. It also stores a string
+ * describing the stack location into @trace (if not NULL), and modifies
+ * the @lmf if necessary. @native_offset return the IP offset from the
+ * start of the function or -1 if that info is not available.
*/
-static gboolean
-arch_exc_is_caught (MonoDomain *domain, MonoJitTlsData *jit_tls, gpointer ip,
- gpointer *bp, gpointer obj)
+static MonoJitInfo *
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoContext *ctx,
+ MonoContext *new_ctx, char **trace, MonoLMF **lmf, int *native_offset,
+ gboolean *managed)
{
MonoJitInfo *ji;
- gpointer *end_of_stack;
- MonoLMF *lmf = jit_tls->lmf;
- MonoMethod *m;
- GList *trace_ips = NULL;
- int i;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
- end_of_stack = jit_tls->end_of_stack;
- g_assert (end_of_stack);
+ ji = mono_jit_info_table_find (domain, ip);
- while (1) {
+ if (trace)
+ *trace = NULL;
- ji = mono_jit_info_table_find (domain, ip);
+ if (native_offset)
+ *native_offset = -1;
- if (ji) { /* we are inside managed code */
- m = ji->method;
-
- if (mono_object_isinst (obj, mono_defaults.exception_class)) {
- char *strace;
- char *tmp, *tmpsig, *source_location, *tmpaddr;
- gint32 address, iloffset;
+ if (managed)
+ *managed = FALSE;
- trace_ips = g_list_append (trace_ips, ip);
+ if (ji != NULL) {
+ char *source_location, *tmpaddr, *fname;
+ gint32 address, iloffset;
+ int offset;
- if (!((MonoException*)obj)->stack_trace)
- strace = g_strdup ("");
- else
- strace = mono_string_to_utf8 (((MonoException*)obj)->stack_trace);
+ *new_ctx = *ctx;
- address = (char *)ip - (char *)ji->code_start;
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
- source_location = mono_debug_source_location_from_address (m, address);
- iloffset = mono_debug_il_offset_from_address (m, address);
+ address = (char *)ip - (char *)ji->code_start;
- if (iloffset < 0)
- tmpaddr = g_strdup_printf ("<0x%05x>", address);
- else
- tmpaddr = g_strdup_printf ("[0x%05x]", iloffset);
+ if (native_offset)
+ *native_offset = address;
- tmpsig = mono_signature_get_desc(m->signature, TRUE);
- if (source_location)
- tmp = g_strdup_printf ("%sin %s (at %s) %s.%s:%s (%s)\n", strace, tmpaddr,
- source_location, m->klass->name_space, m->klass->name,
- m->name, tmpsig);
- else
- tmp = g_strdup_printf ("%sin %s %s.%s:%s (%s)\n", strace, tmpaddr,
- m->klass->name_space, m->klass->name, m->name, tmpsig);
- g_free (source_location);
- g_free (tmpsig);
- g_free (strace);
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
- ((MonoException*)obj)->stack_trace = mono_string_new (domain, tmp);
- g_free (tmp);
- }
+ if (trace) {
+ source_location = mono_debug_source_location_from_address (ji->method, address, NULL, domain);
+ iloffset = mono_debug_il_offset_from_address (ji->method, address, domain);
- if (ji->num_clauses) {
+ if (iloffset < 0)
+ tmpaddr = g_strdup_printf ("<0x%05x>", address);
+ else
+ tmpaddr = g_strdup_printf ("[0x%05x]", iloffset);
+
+ fname = mono_method_full_name (ji->method, TRUE);
- g_assert (ji->clauses);
+ if (source_location)
+ *trace = g_strdup_printf ("in %s (at %s) %s", tmpaddr, source_location, fname);
+ else
+ *trace = g_strdup_printf ("in %s %s", tmpaddr, fname);
- for (i = 0; i < ji->num_clauses; i++) {
- MonoJitExceptionInfo *ei = &ji->clauses [i];
+ g_free (fname);
+ g_free (source_location);
+ g_free (tmpaddr);
+ }
- if (ei->try_start <= ip && ip <= (ei->try_end)) {
- /* catch block */
- if (ei->flags == 0 && mono_object_isinst (obj,
- mono_class_get (m->klass->image, ei->token_or_filter))) {
- ((MonoException*)obj)->trace_ips = glist_to_array (trace_ips);
- g_list_free (trace_ips);
- return TRUE;
- }
- }
- }
- }
-
- /* continue unwinding */
-
- ip = (gpointer)(*((int *)bp + 1) - 5);
- bp = (gpointer)(*((int *)bp));
-
- if (bp >= end_of_stack) {
- ((MonoException*)obj)->trace_ips = glist_to_array (trace_ips);
- g_list_free (trace_ips);
- if (!jit_tls->env)
- return FALSE;
- return TRUE;
- }
-
- } else {
- if (!lmf) {
- ((MonoException*)obj)->trace_ips = glist_to_array (trace_ips);
- g_list_free (trace_ips);
- return FALSE;
- }
-
- bp = (gpointer)lmf->ebp;
- ip = (gpointer)lmf->eip;
-
- m = lmf->method;
+ offset = -1;
+ /* restore caller saved registers */
+ if (ji->used_regs & X86_EBX_MASK) {
+ new_ctx->SC_EBX = *((int *)ctx->SC_EBP + offset);
+ offset--;
+ }
+ if (ji->used_regs & X86_EDI_MASK) {
+ new_ctx->SC_EDI = *((int *)ctx->SC_EBP + offset);
+ offset--;
+ }
+ if (ji->used_regs & X86_ESI_MASK) {
+ new_ctx->SC_ESI = *((int *)ctx->SC_EBP + offset);
+ }
- if (mono_object_isinst (obj, mono_defaults.exception_class)) {
- char *strace;
- char *tmp;
+ new_ctx->SC_ESP = ctx->SC_EBP;
+ /* we substract 1, so that the IP points into the call instruction */
+ new_ctx->SC_EIP = *((int *)ctx->SC_EBP + 1) - 1;
+ new_ctx->SC_EBP = *((int *)ctx->SC_EBP);
+
+ *res = *ji;
+ return res;
+#ifdef MONO_USE_EXC_TABLES
+ } else if ((ji = x86_unwind_native_frame (domain, jit_tls, ctx, new_ctx, *lmf, trace))) {
+ *res = *ji;
+ return res;
+#endif
+ } else if (*lmf) {
+
+ *new_ctx = *ctx;
- trace_ips = g_list_append (trace_ips, lmf->method->info);
+ if (!(*lmf)->method)
+ return (gpointer)-1;
- if (!((MonoException*)obj)->stack_trace)
- strace = g_strdup ("");
- else
- strace = mono_string_to_utf8 (((MonoException*)obj)->stack_trace);
+ if (trace)
+ *trace = g_strdup_printf ("in (unmanaged) %s", mono_method_full_name ((*lmf)->method, TRUE));
- tmp = g_strdup_printf ("%sin (unmanaged) %s.%s:%s ()\n", strace, m->klass->name_space,
- m->klass->name, m->name);
- g_free (strace);
+ if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+ *res = *ji;
+ } else {
+ memset (res, 0, sizeof (MonoJitInfo));
+ res->method = (*lmf)->method;
+ }
- ((MonoException*)obj)->stack_trace = mono_string_new (domain, tmp);
- g_free (tmp);
- }
+ new_ctx->SC_ESI = (*lmf)->esi;
+ new_ctx->SC_EDI = (*lmf)->edi;
+ new_ctx->SC_EBX = (*lmf)->ebx;
+ new_ctx->SC_EBP = (*lmf)->ebp;
+ new_ctx->SC_EIP = (*lmf)->eip;
+ /* the lmf is always stored on the stack, so the following
+ * expression points to a stack location which can be used as ESP */
+ new_ctx->SC_ESP = (unsigned long)&((*lmf)->eip);
- lmf = lmf->previous_lmf;
+ *lmf = (*lmf)->previous_lmf;
- if (bp >= end_of_stack) {
- ((MonoException*)obj)->trace_ips = glist_to_array (trace_ips);
- g_list_free (trace_ips);
- if (!jit_tls->env)
- return FALSE;
- return TRUE;
- }
- }
+ return res;
+
}
-
- return FALSE;
+
+ return NULL;
}
MonoArray *
@@ -303,6 +690,11 @@ ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info
MonoArray *res;
MonoArray *ta = exc->trace_ips;
int i, len;
+
+ if (ta == NULL) {
+ /* Exception is not thrown yet */
+ return mono_array_new (domain, mono_defaults.stack_frame_class, 0);
+ }
len = mono_array_length (ta);
@@ -314,16 +706,27 @@ ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info
gpointer ip = mono_array_get (ta, gpointer, i);
ji = mono_jit_info_table_find (domain, ip);
+ if (ji == NULL) {
+ /* Unmanaged frame */
+ mono_array_set (res, gpointer, i, sf);
+ continue;
+ }
+
g_assert (ji != NULL);
- sf->method = mono_method_get_object (domain, ji->method);
+ sf->method = mono_method_get_object (domain, ji->method, NULL);
sf->native_offset = (char *)ip - (char *)ji->code_start;
- sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset);
+ sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset, domain);
if (need_file_info) {
- sf->filename = mono_string_new (domain, ji->method->klass->image->name);
- sf->line = 0; // fixme:
- sf->column = 0; // fixme:
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, sf->native_offset, &sf->line, domain);
+
+ sf->filename = mono_string_new (domain, filename ? filename : "<unknown>");
+ sf->column = 0;
+
+ g_free (filename);
}
mono_array_set (res, gpointer, i, sf);
@@ -332,6 +735,37 @@ ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info
return res;
}
+void
+mono_jit_walk_stack (MonoStackWalk func, gpointer user_data) {
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ gint native_offset, il_offset;
+ gboolean managed;
+
+ MonoContext ctx, new_ctx;
+
+ MONO_CONTEXT_SET_IP (&ctx, __builtin_return_address (0));
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (1));
+
+ while (MONO_CONTEXT_GET_BP (&ctx) < jit_tls->end_of_stack) {
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, &ctx, &new_ctx, NULL, &lmf, &native_offset, &managed);
+ g_assert (ji);
+
+ if (ji == (gpointer)-1)
+ return;
+
+ il_offset = mono_debug_il_offset_from_address (ji->method, native_offset, domain);
+
+ if (func (ji->method, native_offset, il_offset, managed, user_data))
+ return;
+
+ ctx = new_ctx;
+ }
+}
+
MonoBoolean
ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
MonoReflectionMethod **method,
@@ -341,48 +775,40 @@ ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
MonoDomain *domain = mono_domain_get ();
MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
MonoLMF *lmf = jit_tls->lmf;
- gpointer *sf = (gpointer *)&skip;
- gpointer ip = sf [-1];
- int addr;
- gpointer *bp = sf [-2];
- MonoMethod *m = NULL;
+ MonoJitInfo *ji, rji;
+ MonoContext ctx, new_ctx;
- do {
- MonoJitInfo *ji;
- addr = -1; /* unknown */
+ MONO_CONTEXT_SET_IP (&ctx, ves_icall_get_frame_info);
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (0));
- if ((ji = mono_jit_info_table_find (domain, ip))) {
- m = ji->method;
- addr = (char *)ip - (char *)ji->code_start;
- ip = (gpointer)((char *)bp [1] - 5);
- bp = bp [0];
- } else {
- if (!lmf)
- return FALSE;
-
- m = lmf->method;
+ skip++;
- bp = (gpointer)lmf->ebp;
- ip = (gpointer)lmf->eip;
-
- lmf = lmf->previous_lmf;
- }
-
- if ((unsigned)bp >= (unsigned)jit_tls->end_of_stack)
+ do {
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, &ctx, &new_ctx, NULL, &lmf, native_offset, NULL);
+ ctx = new_ctx;
+
+ if (!ji || ji == (gpointer)-1 || MONO_CONTEXT_GET_BP (&ctx) >= jit_tls->end_of_stack)
return FALSE;
- } while (skip-- > 0);
+ if (ji->method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE)
+ continue;
+
+ skip--;
- g_assert (m);
+ } while (skip >= 0);
- *method = mono_method_get_object (domain, m);
- *iloffset = mono_debug_il_offset_from_address (m, addr);
- *native_offset = addr;
+ *method = mono_method_get_object (domain, ji->method, NULL);
+ *iloffset = mono_debug_il_offset_from_address (ji->method, *native_offset, domain);
if (need_file_info) {
- *file = mono_string_new (domain, m->klass->image->name);
- *column = 0; // fixme
- *line = 0; // fixme
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, *native_offset, line, domain);
+
+ *file = mono_string_new (domain, filename ? filename : "<unknown>");
+ *column = 0;
+
+ g_free (filename);
}
return TRUE;
@@ -391,22 +817,22 @@ ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
/**
* arch_handle_exception:
* @ctx: saved processor state
- * @obj:
+ * @obj: the exception object
+ * @test_only: only test if the exception is caught, but dont call handlers
+ *
+ *
*/
-void
-arch_handle_exception (struct sigcontext *ctx, gpointer obj)
+gboolean
+arch_handle_exception (MonoContext *ctx, gpointer obj, gboolean test_only)
{
MonoDomain *domain = mono_domain_get ();
- MonoJitInfo *ji;
- gpointer ip = (gpointer)ctx->SC_EIP;
- static void (*restore_context) (struct sigcontext *);
- static void (*call_finally) (struct sigcontext *, unsigned long);
- void (*cleanup) (MonoObject *exc);
+ MonoJitInfo *ji, rji;
+ static int (*call_filter) (MonoContext *, gpointer, gpointer) = NULL;
MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
- gpointer end_of_stack;
+ MonoLMF *lmf = jit_tls->lmf;
+ GList *trace_ips = NULL;
g_assert (ctx != NULL);
-
if (!obj) {
MonoException *ex = mono_get_exception_null_reference ();
ex->message = mono_string_new (domain,
@@ -414,35 +840,53 @@ arch_handle_exception (struct sigcontext *ctx, gpointer obj)
obj = (MonoObject *)ex;
}
- ((MonoException *)obj)->stack_trace = NULL;
+ g_assert (mono_object_isinst (obj, mono_defaults.exception_class));
- if (!restore_context)
- restore_context = arch_get_restore_context ();
-
- if (!call_finally)
- call_finally = arch_get_call_finally ();
-
- end_of_stack = jit_tls->end_of_stack;
- g_assert (end_of_stack);
+ if (!call_filter)
+ call_filter = arch_get_call_filter ();
- cleanup = jit_tls->abort_func;
+ g_assert (jit_tls->end_of_stack);
+ g_assert (jit_tls->abort_func);
- if (!arch_exc_is_caught (domain, jit_tls, ip, (gpointer *)ctx->SC_EBP, obj)) {
- if (mono_break_on_exc) {
- if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
- mono_debug_make_symbols ();
- G_BREAKPOINT ();
+ if (!test_only) {
+ MonoContext ctx_cp = *ctx;
+ if (!arch_handle_exception (&ctx_cp, obj, TRUE)) {
+ if (mono_break_on_exc)
+ G_BREAKPOINT ();
+ mono_unhandled_exception (obj);
}
- mono_unhandled_exception (obj);
}
while (1) {
+ MonoContext new_ctx;
+ char *trace = NULL;
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, ctx, &new_ctx,
+ test_only ? &trace : NULL, &lmf, NULL, NULL);
+
+ if (!ji) {
+ g_warning ("Exception inside function without unwind info");
+ g_assert_not_reached ();
+ }
- ji = mono_jit_info_table_find (domain, ip);
-
- if (ji) { /* we are inside managed code */
- MonoMethod *m = ji->method;
- int offset;
+ if (ji != (gpointer)-1) {
+ if (test_only && ji->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE) {
+ char *tmp, *strace;
+
+ trace_ips = g_list_append (trace_ips, MONO_CONTEXT_GET_IP (ctx));
+
+ if (!((MonoException*)obj)->stack_trace)
+ strace = g_strdup ("");
+ else
+ strace = mono_string_to_utf8 (((MonoException*)obj)->stack_trace);
+
+ tmp = g_strdup_printf ("%s%s\n", strace, trace);
+ g_free (strace);
+
+ ((MonoException*)obj)->stack_trace = mono_string_new (domain, tmp);
+
+ g_free (tmp);
+ }
if (ji->num_clauses) {
int i;
@@ -452,82 +896,54 @@ arch_handle_exception (struct sigcontext *ctx, gpointer obj)
for (i = 0; i < ji->num_clauses; i++) {
MonoJitExceptionInfo *ei = &ji->clauses [i];
- if (ei->try_start <= ip && ip <= (ei->try_end)) {
+ if (ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) <= ei->try_end) {
/* catch block */
- if (ei->flags == 0 && mono_object_isinst (obj,
- mono_class_get (m->klass->image, ei->token_or_filter))) {
-
- ctx->SC_EIP = (unsigned long)ei->handler_start;
- ctx->SC_ECX = (unsigned long)obj;
- restore_context (ctx);
- g_assert_not_reached ();
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE &&
+ mono_object_isinst (obj, mono_class_get (ji->method->klass->image, ei->data.token))) ||
+ ((ei->flags == MONO_EXCEPTION_CLAUSE_FILTER &&
+ call_filter (ctx, ei->data.filter, obj)))) {
+ if (test_only) {
+ ((MonoException*)obj)->trace_ips = glist_to_array (trace_ips);
+ g_list_free (trace_ips);
+ return TRUE;
+ }
+ MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
+ MONO_CONTEXT_SET_EXCREG (ctx, obj);
+ jit_tls->lmf = lmf;
+ return 0;
}
}
}
/* no handler found - we need to call all finally handlers */
- for (i = 0; i < ji->num_clauses; i++) {
- MonoJitExceptionInfo *ei = &ji->clauses [i];
-
- if (ei->try_start <= ip && ip < (ei->try_end) &&
- (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
- call_finally (ctx, (unsigned long)ei->handler_start);
+ if (!test_only) {
+ for (i = 0; i < ji->num_clauses; i++) {
+ MonoJitExceptionInfo *ei = &ji->clauses [i];
+
+ if (ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) < ei->try_end &&
+ (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
+ call_filter (ctx, ei->handler_start, NULL);
+ }
}
}
}
+ }
- /* continue unwinding */
-
- offset = -1;
- /* restore caller saved registers */
- if (ji->used_regs & X86_EBX_MASK) {
- ctx->SC_EBX = *((int *)ctx->SC_EBP + offset);
- offset--;
- }
- if (ji->used_regs & X86_EDI_MASK) {
- ctx->SC_EDI = *((int *)ctx->SC_EBP + offset);
- offset--;
- }
- if (ji->used_regs & X86_ESI_MASK) {
- ctx->SC_ESI = *((int *)ctx->SC_EBP + offset);
- }
-
- ctx->SC_ESP = ctx->SC_EBP;
- ctx->SC_EIP = *((int *)ctx->SC_EBP + 1) - 5;
- ctx->SC_EBP = *((int *)ctx->SC_EBP);
-
- ip = (gpointer)ctx->SC_EIP;
-
- if (ctx->SC_EBP > (unsigned)end_of_stack) {
- g_assert (cleanup);
- cleanup (obj);
- g_assert_not_reached ();
- }
-
- } else {
- MonoLMF *lmf = jit_tls->lmf;
-
- if (!lmf) {
- g_assert (cleanup);
- cleanup (obj);
- g_assert_not_reached ();
- }
-
- jit_tls->lmf = lmf->previous_lmf;
-
- ctx->SC_ESI = lmf->esi;
- ctx->SC_EDI = lmf->edi;
- ctx->SC_EBX = lmf->ebx;
- ctx->SC_EBP = lmf->ebp;
- ctx->SC_EIP = lmf->eip;
- ctx->SC_ESP = (unsigned long)&lmf->eip;
-
- ip = (gpointer)ctx->SC_EIP;
+ g_free (trace);
+
+ *ctx = new_ctx;
- if (ctx->SC_EBP >= (unsigned)end_of_stack) {
- g_assert (cleanup);
- cleanup (obj);
+ if ((ji == (gpointer)-1) || MONO_CONTEXT_GET_BP (ctx) >= jit_tls->end_of_stack) {
+ if (!test_only) {
+ jit_tls->lmf = lmf;
+ jit_tls->abort_func (obj);
g_assert_not_reached ();
+ } else {
+ ((MonoException*)obj)->trace_ips = glist_to_array (trace_ips);
+ g_list_free (trace_ips);
+ return FALSE;
}
}
}
@@ -535,111 +951,4 @@ arch_handle_exception (struct sigcontext *ctx, gpointer obj)
g_assert_not_reached ();
}
-static void
-throw_exception (unsigned long eax, unsigned long ecx, unsigned long edx, unsigned long ebx,
- unsigned long esi, unsigned long edi, unsigned long ebp, MonoObject *exc,
- unsigned long eip, unsigned long esp)
-{
- struct sigcontext ctx;
-
- /* adjust eip so that it point to the call instruction */
- eip -= 5;
-
- ctx.SC_ESP = esp;
- ctx.SC_EIP = eip;
- ctx.SC_EBP = ebp;
- ctx.SC_EDI = edi;
- ctx.SC_ESI = esi;
- ctx.SC_EBX = ebx;
- ctx.SC_EDX = edx;
- ctx.SC_ECX = ecx;
- ctx.SC_EAX = eax;
-
- arch_handle_exception (&ctx, exc);
-
- g_assert_not_reached ();
-}
-
-/**
- * arch_get_throw_exception:
- *
- * Returns a function pointer which can be used to raise
- * exceptions. The returned function has the following
- * signature: void (*func) (MonoException *exc);
- * For example to raise an arithmetic exception you can use:
- *
- * x86_push_imm (code, mono_get_exception_arithmetic ());
- * x86_call_code (code, arch_get_throw_exception ());
- *
- */
-gpointer
-arch_get_throw_exception (void)
-{
- static guint8 start [24];
- static int inited = 0;
- guint8 *code;
-
- if (inited)
- return start;
-
- inited = 1;
- code = start;
- x86_push_reg (code, X86_ESP);
- x86_push_membase (code, X86_ESP, 4); /* IP */
- x86_push_membase (code, X86_ESP, 12); /* exception */
- x86_push_reg (code, X86_EBP);
- x86_push_reg (code, X86_EDI);
- x86_push_reg (code, X86_ESI);
- x86_push_reg (code, X86_EBX);
- x86_push_reg (code, X86_EDX);
- x86_push_reg (code, X86_ECX);
- x86_push_reg (code, X86_EAX);
- x86_call_code (code, throw_exception);
- /* we should never reach this breakpoint */
- x86_breakpoint (code);
-
- g_assert ((code - start) < 24);
- return start;
-}
-
-/**
- * arch_get_throw_exception_by_name:
- *
- * Returns a function pointer which can be used to raise
- * corlib exceptions. The returned function has the following
- * signature: void (*func) (char *exc_name);
- * For example to raise an arithmetic exception you can use:
- *
- * x86_push_imm (code, "ArithmeticException");
- * x86_call_code (code, arch_get_throw_exception ());
- *
- */
-gpointer
-arch_get_throw_exception_by_name ()
-{
- static guint8 start [32];
- static int inited = 0;
- guint8 *code;
-
- if (inited)
- return start;
-
- inited = 1;
- code = start;
-
- /* fixme: we do not save EAX, EDX, ECD - unsure if we need that */
-
- x86_push_membase (code, X86_ESP, 4); /* exception name */
- x86_push_imm (code, "System");
- x86_push_imm (code, mono_defaults.exception_class->image);
- x86_call_code (code, mono_exception_from_name);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 12);
- /* save the newly create object (overwrite exception name)*/
- x86_mov_membase_reg (code, X86_ESP, 4, X86_EAX, 4);
- x86_jump_code (code, arch_get_throw_exception ());
-
- g_assert ((code - start) < 32);
-
- return start;
-}
diff --git a/mono/jit/helpers.c b/mono/jit/helpers.c
index e4f8fdbb888..f72bd4fd8eb 100644
--- a/mono/jit/helpers.c
+++ b/mono/jit/helpers.c
@@ -8,9 +8,7 @@
*/
#include <config.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include <glib.h>
#include "codegen.h"
@@ -73,13 +71,15 @@ mono_map_stind_type (MonoType *type)
case MONO_TYPE_I1:
case MONO_TYPE_U1:
case MONO_TYPE_BOOLEAN:
-
return MB_TERM_STIND_I1;
case MONO_TYPE_I2:
case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
return MB_TERM_STIND_I2;
+#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I4:
case MONO_TYPE_U4:
return MB_TERM_STIND_I4;
@@ -92,6 +92,10 @@ mono_map_stind_type (MonoType *type)
return MB_TERM_STIND_REF;
case MONO_TYPE_I8:
case MONO_TYPE_U8:
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
return MB_TERM_STIND_I8;
case MONO_TYPE_R4:
return MB_TERM_STIND_R4;
@@ -134,7 +138,10 @@ mono_map_remote_stind_type (MonoType *type)
case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
return MB_TERM_REMOTE_STIND_I2;
+#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I4:
case MONO_TYPE_U4:
return MB_TERM_REMOTE_STIND_I4;
@@ -145,6 +152,10 @@ mono_map_remote_stind_type (MonoType *type)
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
return MB_TERM_REMOTE_STIND_REF;
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I8:
case MONO_TYPE_U8:
return MB_TERM_REMOTE_STIND_I8;
@@ -179,7 +190,10 @@ mono_map_starg_type (MonoType *type)
case MONO_TYPE_I2:
case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
+#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I4:
case MONO_TYPE_U4:
return MB_TERM_STIND_I4;
@@ -190,6 +204,10 @@ mono_map_starg_type (MonoType *type)
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
return MB_TERM_STIND_REF;
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I8:
case MONO_TYPE_U8:
return MB_TERM_STIND_I8;
@@ -224,20 +242,30 @@ mono_map_arg_type (MonoType *type)
case MONO_TYPE_I2:
case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
+#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
case MONO_TYPE_U:
+#endif
case MONO_TYPE_I4:
case MONO_TYPE_U4:
+ return MB_TERM_ARG_I4;
case MONO_TYPE_CLASS:
case MONO_TYPE_OBJECT:
case MONO_TYPE_PTR:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
- return MB_TERM_ARG_I4;
case MONO_TYPE_STRING:
+#if SIZEOF_VOID_P == 8
+ return MB_TERM_ARG_I8;
+#else
return MB_TERM_ARG_I4;
+#endif
case MONO_TYPE_I8:
case MONO_TYPE_U8:
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
return MB_TERM_ARG_I8;
case MONO_TYPE_R4:
return MB_TERM_ARG_R4;
@@ -287,10 +315,15 @@ mono_map_ldind_type (MonoType *type, MonoValueType *svt)
case MONO_TYPE_CHAR:
*svt = VAL_I32;
return MB_TERM_LDIND_U2;
+#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
+#endif
case MONO_TYPE_I4:
*svt = VAL_I32;
return MB_TERM_LDIND_I4;
+#if SIZEOF_VOID_P == 4
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_U4:
*svt = VAL_I32;
return MB_TERM_LDIND_U4;
@@ -302,6 +335,10 @@ mono_map_ldind_type (MonoType *type, MonoValueType *svt)
case MONO_TYPE_ARRAY:
*svt = VAL_POINTER;
return MB_TERM_LDIND_REF;
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I8:
case MONO_TYPE_U8:
*svt = VAL_I64;
@@ -343,7 +380,10 @@ mono_map_ldarg_type (MonoType *type, MonoValueType *svt)
case MONO_TYPE_I2:
case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
+#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I4:
case MONO_TYPE_U4:
*svt = VAL_I32;
@@ -355,9 +395,13 @@ mono_map_ldarg_type (MonoType *type, MonoValueType *svt)
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
*svt = VAL_POINTER;
- return MB_TERM_LDIND_U4;
+ return MB_TERM_LDIND_REF;
case MONO_TYPE_I8:
case MONO_TYPE_U8:
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
*svt = VAL_I64;
return MB_TERM_LDIND_I8;
case MONO_TYPE_R4:
@@ -405,7 +449,10 @@ mono_map_call_type (MonoType *type, MonoValueType *svt)
case MONO_TYPE_I2:
case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
+#if SIZEOF_VOID_P == 4
case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
case MONO_TYPE_I4:
case MONO_TYPE_U4:
*svt = VAL_I32;
@@ -422,10 +469,19 @@ mono_map_call_type (MonoType *type, MonoValueType *svt)
case MONO_TYPE_STRING:
case MONO_TYPE_PTR:
case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
*svt = VAL_POINTER;
+#if SIZEOF_VOID_P == 8
+ return MB_TERM_CALL_I8;
+#else
return MB_TERM_CALL_I4;
+#endif
case MONO_TYPE_I8:
case MONO_TYPE_U8:
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
*svt = VAL_I64;
return MB_TERM_CALL_I8;
case MONO_TYPE_R4:
diff --git a/mono/jit/invoke.c b/mono/jit/invoke.c
deleted file mode 100644
index ac1f22d9102..00000000000
--- a/mono/jit/invoke.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- * invoke.c: runtime invoke code
- *
- * Authors:
- * Dietmar Maurer (dietmar@ximian.com)
- *
- * (C) 2001 Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-
-#include <mono/arch/x86/x86-codegen.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/tabledefs.h>
-#include <mono/metadata/profiler-private.h>
-
-#include "jit.h"
-#include "codegen.h"
-
-gpointer
-arch_get_lmf_addr (void)
-{
- MonoJitTlsData *jit_tls;
-
- if ((jit_tls = TlsGetValue (mono_jit_tls_id)))
- return &jit_tls->lmf;
-
- g_assert_not_reached ();
-
- return NULL;
-}
-
-/*
- * this returns a helper method to invoke a method with a user supplied
- * stack frame. The returned method has the following signature:
- * invoke_method_with_frame ((gpointer code, gpointer frame, int frame_size);
- */
-static gpointer
-get_invoke_method_with_frame (void)
-{
- static guint8 *start;
- guint8 *code;
-
- if (start)
- return start;
-
- start = code = g_malloc (64);
-
- /* Prolog */
- x86_push_reg (code, X86_EBP);
- x86_mov_reg_reg (code, X86_EBP, X86_ESP, 4);
- x86_push_reg (code, X86_EBX);
- x86_push_reg (code, X86_EDI);
- x86_push_reg (code, X86_ESI);
-
- x86_mov_reg_membase (code, X86_EAX, X86_EBP, 16, 4);
- x86_alu_reg_reg (code, X86_SUB, X86_ESP, X86_EAX);
-
- x86_push_membase (code, X86_EBP, 16);
- x86_push_membase (code, X86_EBP, 12);
- x86_lea_membase (code, X86_EAX, X86_ESP, 2*4);
- x86_push_reg (code, X86_EAX);
- x86_call_code (code, memcpy);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 12);
-
- x86_mov_reg_membase (code, X86_EAX, X86_EBP, 8, 4);
- x86_call_reg (code, X86_EAX);
-
- x86_mov_reg_membase (code, X86_ECX, X86_EBP, 16, 4);
- x86_alu_reg_reg (code, X86_ADD, X86_ESP, X86_ECX);
-
- /* Epilog */
- x86_pop_reg (code, X86_ESI);
- x86_pop_reg (code, X86_EDI);
- x86_pop_reg (code, X86_EBX);
- x86_leave (code);
- x86_ret (code);
-
- g_assert ((code - start) < 64);
-
- return start;
-}
-
-/**
- * arch_runtime_invoke:
- * @method: the method to invoke
- * @obj: this pointer
- * @params: array of parameter values.
- *
- * TODO: very ugly piece of code. we should replace that with a method-specific
- * trampoline (as suggested by Paolo).
- */
-MonoObject*
-arch_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
-{
- static guint64 (*invoke_int64) (gpointer code, gpointer frame, int frame_size) = NULL;
- static double (*invoke_double) (gpointer code, gpointer frame, int frame_size) = NULL;
- MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
- MonoObject *retval;
- MonoMethodSignature *sig;
- int i, tmp, type, sp = 0, string_ctor = 0;
- void *ret;
- int frame_size = 0;
- gpointer *frame;
- gpointer code;
- gpointer last_end_of_stack;
- jmp_buf env, *last_env;
-
- sig = method->signature;
-
- if (exc) {
- last_end_of_stack = jit_tls->end_of_stack;
- last_env = jit_tls->env;
-
- jit_tls->end_of_stack = &last_env;
- jit_tls->env = &env;
-
- if ((*exc = (MonoObject *)setjmp (env))) {
- jit_tls->end_of_stack = last_end_of_stack;
- jit_tls->env = last_env;
- return NULL;
- }
- }
-
- /* allocate ret object. */
- if (sig->ret->type == MONO_TYPE_VOID) {
- string_ctor = method->klass == mono_defaults.string_class && !strcmp (method->name, ".ctor");
- if (string_ctor) {
- ret = &retval;
- } else {
- retval = NULL;
- ret = NULL;
- }
- } else {
- MonoClass *klass = mono_class_from_mono_type (sig->ret);
- if (klass->valuetype) {
- retval = mono_object_new (mono_domain_get (), klass);
- ret = ((char*)retval) + sizeof (MonoObject);
- } else {
- ret = &retval;
- }
- }
-
- if (ISSTRUCT (sig->ret))
- frame_size += sizeof (gpointer);
-
- if (sig->hasthis)
- frame_size += sizeof (gpointer);
-
- for (i = 0; i < sig->param_count; ++i) {
- int align;
- frame_size += mono_type_stack_size (sig->params [i], &align);
- }
-
- frame = alloca (frame_size);
-
- if (ISSTRUCT (sig->ret))
- frame [sp++] = ret;
-
- if (sig->hasthis)
- frame [sp++] = obj;
-
-
- for (i = 0; i < sig->param_count; ++i) {
- if (sig->params [i]->byref) {
- frame [sp++] = params [i];
- continue;
- }
- type = sig->params [i]->type;
-handle_enum:
- switch (type) {
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- case MONO_TYPE_BOOLEAN:
- tmp = *(MonoBoolean*)params [i];
- frame [sp++] = (gpointer)tmp;
- break;
- case MONO_TYPE_U2:
- case MONO_TYPE_I2:
- case MONO_TYPE_CHAR:
- tmp = *(gint16*)params [i];
- frame [sp++] = (gpointer)tmp;
- break;
-#if SIZEOF_VOID_P == 4
- case MONO_TYPE_U:
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U4:
- case MONO_TYPE_I4:
- frame [sp++] = (gpointer)*(gint32*)params [i];
- break;
-#if SIZEOF_VOID_P == 8
- case MONO_TYPE_U:
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U8:
- case MONO_TYPE_I8:
- frame [sp++] = (gpointer)*(gint32*)params [i];
- frame [sp++] = (gpointer)*(((gint32*)params [i]) + 1);
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->params [i]->data.klass->enumtype) {
- type = sig->params [i]->data.klass->enum_basetype->type;
- goto handle_enum;
- } else {
- g_warning ("generic valutype %s not handled in runtime invoke", sig->params [i]->data.klass->name);
- }
- break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_OBJECT:
- frame [sp++] = params [i];
- break;
- default:
- g_error ("type 0x%x not handled in arch_runtime_invoke", sig->params [i]->type);
- }
- }
-
- code = mono_compile_method (method);
-
- if (!invoke_int64)
- invoke_int64 = (gpointer)invoke_double = get_invoke_method_with_frame ();
-
- type = sig->ret->type;
-handle_enum_2:
- switch (type) {
- case MONO_TYPE_VOID:
- if (string_ctor)
- *((guint32 *)ret) = invoke_int64 (code, frame, frame_size);
- else
- invoke_int64 (code, frame, frame_size);
- break;
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_U2:
- case MONO_TYPE_I2:
- case MONO_TYPE_CHAR:
-#if SIZEOF_VOID_P == 4
- case MONO_TYPE_U:
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U4:
- case MONO_TYPE_I4:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_PTR:
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_STRING:
- *((guint32 *)ret) = invoke_int64 (code, frame, frame_size);
- break;
-#if SIZEOF_VOID_P == 8
- case MONO_TYPE_U:
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U8:
- case MONO_TYPE_I8:
- *((guint64 *)ret) = invoke_int64 (code, frame, frame_size);
- break;
- case MONO_TYPE_R4:
- *((float *)ret) = invoke_double (code, frame, frame_size);
- break;
- case MONO_TYPE_R8:
- *((double *)ret) = invoke_double (code, frame, frame_size);
- break;
- case MONO_TYPE_VALUETYPE:
- if (sig->ret->data.klass->enumtype) {
- type = sig->ret->data.klass->enum_basetype->type;
- goto handle_enum_2;
- } else {
- invoke_int64 (code, frame, frame_size);
- }
- break;
- default:
- g_error ("return type 0x%x not handled in arch_runtime_invoke", type);
- }
-
- if (exc) {
- jit_tls->end_of_stack = last_end_of_stack;
- jit_tls->env = last_env;
- }
-
- return retval;
-}
-
-/**
- * arch_create_delegate_trampoline:
- * @delegate: pointer to a Delegate object
- *
- * This trampoline is called when we invoke delegates from unmanaged code
- */
-static gpointer
-arch_create_delegate_trampoline (MonoDelegate *delegate)
-{
- MonoMethod *method, *invoke;
- MonoMethodSignature *sig;
- MonoClass *klass;
- guint8 *code, *start, *invoke_code;
- int i, align, arg_size = 0;;
-
- if (!delegate)
- return NULL;
-
- /* fixme: add the delegate to a scanned hash
- * so that is is never destroyed, or store
- * this wrapper inside a new field in the delegate */
-
- klass = ((MonoObject *)delegate)->vtable->klass;
- g_assert (klass->delegate);
-
- if (delegate->delegate_trampoline)
- return delegate->delegate_trampoline;
-
- method = delegate->method_info->method;
- sig = method->signature;
-
- if (sig->param_count) {
- for (i = 0; i < sig->param_count; ++i)
- arg_size += mono_type_stack_size (sig->params [i], &align);
- }
-
- invoke = 0;
- for (i = 0; i < klass->method.count; ++i) {
- if (klass->methods [i]->name[0] == 'I' &&
- !strcmp ("Invoke", klass->methods [i]->name) &&
- klass->methods [i]->signature->param_count == sig->param_count) {
- invoke = klass->methods [i];
- }
- }
- g_assert (invoke);
- invoke_code = mono_compile_method (invoke);
-
- /* fixme: when do we free this code ? */
-
- code = start = g_malloc (64 + arg_size);
-
- /* start of original frame */
- x86_lea_membase (code, X86_ECX, X86_ESP, 4);
-
- /* allocate stack frame */
- x86_alu_reg_imm (code, X86_SUB, X86_ESP, arg_size);
-
- /* fixme: mybe we need to transform char* to Strings */
-
- /* memcopy activation frame to the stack */
- x86_push_imm (code, arg_size);
- x86_push_reg (code, X86_ECX);
- x86_lea_membase (code, X86_ECX, X86_ESP, 8);
- x86_push_reg (code, X86_ECX);
- x86_call_code (code, memcpy);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 12);
-
- /* call delegate invoke */
- x86_push_imm (code, delegate);
- x86_call_code (code, invoke_code);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, arg_size + 4);
-
- x86_ret (code);
-
- delegate->delegate_trampoline = start;
-
- return start;
-}
-
-gpointer
-arch_create_native_wrapper (MonoMethod *method)
-{
- MonoMethodSignature *csig = method->signature;
- MonoJitInfo *ji;
- guint8 *code, *start;
- int i, align, locals = 0, arg_size = 0;
- gboolean pinvoke = FALSE;
- GList *free_list = NULL;
- gboolean end_invoke = FALSE;
-
- mono_profiler_method_jit (method);
-
- if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) &&
- (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
- pinvoke = TRUE;
-
- /* compute the size of the activation frame */
-
- if (csig->hasthis)
- arg_size += sizeof (gpointer);
-
- if (!csig->ret->byref && csig->ret->type == MONO_TYPE_VALUETYPE) {
- //printf ("XTEST %s.%s:%s\n",
- //g_assert (!csig->ret->byref);
- arg_size += sizeof (gpointer);
- }
-
- for (i = 0; i < csig->param_count; ++i) {
- arg_size += mono_type_stack_size (csig->params [i], &align);
- if (pinvoke && (csig->params [i]->type == MONO_TYPE_STRING))
- locals++;
- if (pinvoke && (csig->params [i]->type == MONO_TYPE_OBJECT) &&
- csig->params [i]->data.klass->delegate)
- locals++;
- }
-
- start = code = g_malloc (512);
-
- if (mono_jit_profile) {
- x86_push_imm (code, method);
- x86_mov_reg_imm (code, X86_EAX, mono_profiler_method_enter);
- x86_call_reg (code, X86_EAX);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
- }
-
- /* save LMF - the instruction pointer is already on the
- * stack (return address) */
-
- /* save all caller saved regs */
- x86_push_reg (code, X86_EBX);
- x86_push_reg (code, X86_EDI);
- x86_push_reg (code, X86_ESI);
- x86_push_reg (code, X86_EBP);
-
- /* save method info */
- x86_push_imm (code, method);
-
- /* get the address of lmf for the current thread */
- x86_call_code (code, arch_get_lmf_addr);
- /* push lmf */
- x86_push_reg (code, X86_EAX);
- /* push *lfm (previous_lmf) */
- x86_push_membase (code, X86_EAX, 0);
- /* *(lmf) = ESP */
- x86_mov_membase_reg (code, X86_EAX, 0, X86_ESP, 4);
-
- if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
- guint8 *l1, *l2;
-
- if (method->klass->parent == mono_defaults.multicastdelegate_class &&
- *method->name == 'E' && !strcmp (method->name, "EndInvoke"))
- end_invoke = TRUE;
-
- if (arg_size) {
- /* repush all arguments */
- /* load argument size -4 into ECX */
- x86_mov_reg_imm (code, X86_ECX, (arg_size - 4));
- /* load source address */
- x86_lea_membase (code, X86_ESI, X86_ESP, sizeof (MonoLMF));
- /* allocate destination */
- x86_alu_reg_imm (code, X86_SUB, X86_ESP, arg_size);
- /* load destination address */
- x86_mov_reg_reg (code, X86_EDI, X86_ESP, 4);
-
- l1 = code;
- x86_mov_reg_memindex (code, X86_EAX, X86_ESI, 0, X86_ECX, 0, 4);
- x86_mov_memindex_reg (code, X86_EDI, 0, X86_ECX, 0, X86_EAX, 4);
- x86_alu_reg_imm (code, X86_SUB, X86_ECX, 4);
- l2 = code;
- x86_branch8 (code, X86_CC_GEZ, l1 - (l2 + 2), FALSE);
- }
-
- } else if (pinvoke) {
- int offset = arg_size + (locals <<2) + sizeof (MonoLMF) - 4;
- int l = 0;
-
- /* allocate locals */
- if (locals) {
- x86_alu_reg_imm (code, X86_SUB, X86_ESP, (locals<<2));
- x86_mov_reg_reg (code, X86_EBP, X86_ESP, 4);
- }
-
- for (i = csig->param_count - 1; i >= 0; i--) {
- MonoType *t = csig->params [i];
- int type;
-
- if (t->byref) {
- x86_push_membase (code, X86_ESP, offset);
- continue;
- }
-
- type = t->type;
-enum_marshal:
- switch (type) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_I1:
- case MONO_TYPE_U1:
- case MONO_TYPE_I2:
- case MONO_TYPE_U2:
- case MONO_TYPE_I4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I:
- case MONO_TYPE_U:
- case MONO_TYPE_PTR:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_TYPEDBYREF:
- case MONO_TYPE_R4:
- x86_push_membase (code, X86_ESP, offset);
- break;
- case MONO_TYPE_SZARRAY:
- x86_mov_reg_membase (code, X86_EAX, X86_ESP, offset, 4);
- x86_alu_reg_imm (code, X86_ADD, X86_EAX, G_STRUCT_OFFSET (MonoArray, vector));
- x86_push_reg (code, X86_EAX);
- break;
- case MONO_TYPE_FNPTR:
- /* fixme: dont know when this is used */
- g_assert_not_reached ();
- break;
- case MONO_TYPE_CLASS:
- case MONO_TYPE_OBJECT:
- if (t->data.klass->delegate) {
- x86_push_membase (code, X86_ESP, offset);
- x86_call_code (code, arch_create_delegate_trampoline);
- x86_mov_membase_reg (code, X86_ESP, 0, X86_EAX, 4);
- } else
- x86_push_membase (code, X86_ESP, offset);
- break;
- case MONO_TYPE_STRING:
- x86_push_membase (code, X86_ESP, offset);
- x86_call_code (code, mono_string_to_utf8);
- x86_mov_membase_reg (code, X86_ESP, 0, X86_EAX, 4);
- free_list = g_list_prepend (free_list, (gpointer)l);
- x86_mov_membase_reg (code, X86_EBP, l, X86_EAX, 4);
- l+= 4;
- break;
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- case MONO_TYPE_R8:
- x86_push_membase (code, X86_ESP, offset);
- x86_push_membase (code, X86_ESP, offset);
- break;
- case MONO_TYPE_VALUETYPE:
- if (t->data.klass->enumtype) {
- type = t->data.klass->enum_basetype->type;
- goto enum_marshal;
- } else {
- int j, size;
- size = mono_type_stack_size (csig->params [i], &align);
- size = size >> 2;
- for (j = 0; j < size; j++)
- x86_push_membase (code, X86_ESP, offset);
- }
- break;
- default:
- g_error ("type 0x%02x unknown", t->type);
-
- }
- }
-
- if (!csig->ret->byref && csig->ret->type == MONO_TYPE_VALUETYPE) {
- x86_push_membase (code, X86_ESP, offset);
- }
-
- if (csig->hasthis) {
- x86_push_membase (code, X86_ESP, offset);
- }
-
- } else {
- g_assert_not_reached ();
- }
-
- if (pinvoke && !method->addr)
- mono_lookup_pinvoke_call (method);
- if (method->addr) {
- /* special case EndInvoke - we pass the MonoMethod as first parameter */
- if (end_invoke)
- x86_push_imm (code, method);
- /* call the native code */
- x86_call_code (code, method->addr);
- } else {
- /* raise exception */
- x86_push_imm (code, "NotImplementedException");
- x86_call_code (code, arch_get_throw_exception_by_name ());
- }
-
- /* free pinvoke string args */
- if (free_list) {
- GList *l;
-
- x86_push_reg (code, X86_EAX);
- x86_push_reg (code, X86_EDX);
-
- for (l = free_list; l; l = l->next) {
- x86_push_membase (code, X86_EBP, ((int)l->data));
- x86_call_code (code, g_free);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
- }
-
- x86_pop_reg (code, X86_EDX);
- x86_pop_reg (code, X86_EAX);
-
- g_list_free (free_list);
- }
-
- /* remove arguments from stack */
- if (arg_size || locals || end_invoke)
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, arg_size + (locals<<2) +
- (end_invoke ? 4 : 0));
-
- if (pinvoke && !csig->ret->byref && csig->ret->type == MONO_TYPE_STRING) {
- /* If the argument is non-null, then convert the value back */
- x86_alu_reg_reg (code, X86_OR, X86_EAX, X86_EAX);
- x86_branch8 (code, X86_CC_EQ, 9, FALSE);
- x86_push_reg (code, X86_EAX);
- x86_call_code (code, mono_string_new_wrapper);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
- }
-
- /* restore the LMF */
-
- /* ebx = previous_lmf */
- x86_pop_reg (code, X86_EBX);
- /* edi = lmf */
- x86_pop_reg (code, X86_EDI);
- /* *(lmf) = previous_lmf */
- x86_mov_membase_reg (code, X86_EDI, 0, X86_EBX, 4);
-
- /* discard method info */
- x86_pop_reg (code, X86_ESI);
-
- /* restore caller saved regs */
- x86_pop_reg (code, X86_EBP);
- x86_pop_reg (code, X86_ESI);
- x86_pop_reg (code, X86_EDI);
- x86_pop_reg (code, X86_EBX);
-
- if (mono_jit_profile) {
- x86_push_reg (code, X86_EAX);
- x86_push_reg (code, X86_EDX);
- x86_push_imm (code, method);
- x86_mov_reg_imm (code, X86_EAX, mono_profiler_method_leave);
- x86_call_reg (code, X86_EAX);
- x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
- x86_pop_reg (code, X86_EDX);
- x86_pop_reg (code, X86_EAX);
- }
- x86_ret (code);
-
- /* we store a dummy jit info (code size 4), so that mono_delegate_ctor
- * is able to find a method info for icalls and pinvoke methods */
- ji = mono_mempool_alloc0 (mono_root_domain->mp, sizeof (MonoJitInfo));
- ji->method = method;
- ji->code_start = start;
- ji->code_size = 4;
- ji->used_regs = 0;
- ji->num_clauses = 0;
- mono_jit_info_table_add (mono_root_domain, ji);
-
- g_assert ((code - start) < 512);
-
- mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
- return start;
-}
-
diff --git a/mono/jit/jit.c b/mono/jit/jit.c
index 7ae61538334..6420b0fc7ba 100644
--- a/mono/jit/jit.c
+++ b/mono/jit/jit.c
@@ -8,9 +8,7 @@
*/
#include <config.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include <glib.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -20,7 +18,6 @@
#include <mono/metadata/verify.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/loader.h>
-#include <mono/metadata/cil-coff.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/class.h>
#include <mono/metadata/object.h>
@@ -34,12 +31,15 @@
#include <mono/arch/x86/x86-codegen.h>
#include <mono/io-layer/io-layer.h>
#include <mono/metadata/profiler-private.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
#include "jit.h"
#include "helpers.h"
#include "regset.h"
#include "codegen.h"
-#include "debug.h"
+#include "debug-jit.h"
/*
* if OPT_BOOL is defined we use 32bit to store boolean local variables. This
@@ -214,6 +214,9 @@ gboolean mono_use_linear_scan = TRUE;
/* inline code */
gboolean mono_jit_inline_code = TRUE;
+/* generate bound checking */
+gboolean mono_jit_boundcheck = TRUE;
+
/* inline memcpy */
gboolean mono_inline_memcpy = TRUE;
@@ -226,21 +229,8 @@ guint32 mono_jit_tls_id;
/* issue a breakpoint on unhandled excepions */
gboolean mono_break_on_exc = FALSE;
-MonoDebugFormat mono_debug_format = MONO_DEBUG_FORMAT_NONE;
-GList *mono_debug_methods = NULL;
-
-/* If non-zero, insert a breakpoint when compiling the next method.
- * If positive, interpret this variable as a counter and decrement
- * it after setting the breakpoint. */
-int mono_debug_insert_breakpoint = 0;
-
-/* This is the address of the last breakpoint which was inserted. */
-gchar *mono_debug_last_breakpoint_address = NULL;
-
MonoJitStats mono_jit_stats;
-CRITICAL_SECTION *metadata_section = NULL;
-
/*
* We sometimes need static data, for example the forest generator need it to
* store constants or class data.
@@ -268,7 +258,7 @@ mono_allocate_intvar (MonoFlowGraph *cfg, int slot, MonoValueType type)
/* take care if you modify MonoValueType */
g_assert (VAL_DOUBLE == 4);
- /* fixme: machine dependant */
+ /* fixme: machine dependant */
if (type == VAL_POINTER)
type = VAL_I32; /* VAL_I32 and VAL_POINTER share the same slot */
@@ -291,9 +281,28 @@ mono_allocate_excvar (MonoFlowGraph *cfg)
cfg->excvar = arch_allocate_var (cfg, 4, 4, MONO_TEMPVAR, VAL_POINTER);
+ VARINFO (cfg, cfg->excvar).isvolatile = 1;
+
return cfg->excvar;
}
+/**
+ * mono_jit_runtime_invoke:
+ * @method: the method to invoke
+ * @obj: this pointer
+ * @params: array of parameter values.
+ * @exc: used to catch exceptions objects
+ */
+static MonoObject*
+mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
+{
+ MonoMethod *invoke;
+ MonoObject *(*runtime_invoke) (MonoObject *this, void **params, MonoObject **exc);
+
+ invoke = mono_marshal_get_runtime_invoke (method);
+ runtime_invoke = mono_compile_method (invoke);
+ return runtime_invoke (obj, params, exc);
+}
/**
* ctree_create_load:
@@ -323,7 +332,6 @@ ctree_create_load (MonoFlowGraph *cfg, MonoType *type, MBTree *addr, MonoValueTy
/**
* ctree_create_store:
* @mp: pointer to a memory pool
- * @addr_type: address type (MB_TERM_ADDR_L or MB_TERM_ADDR_G)
* @s: the value (tree) to store
* @type: the type of the value
* @addr: the address of the value
@@ -345,7 +353,7 @@ ctree_create_store (MonoFlowGraph *cfg, MonoType *type, MBTree *addr,
t = mono_ctree_new (mp, stind, addr, s);
- if (ISSTRUCT (type))
+ if (MONO_TYPE_ISSTRUCT (type))
t->data.i = mono_class_value_size (type->data.klass, NULL);
return t;
@@ -423,6 +431,12 @@ ctree_create_dup (MonoMemPool *mp, MBTree *s)
t = mono_ctree_new (mp, MB_TERM_LDIND_R8, t, NULL);
t->svt = VAL_DOUBLE;
break;
+ case MB_TERM_STIND_OBJ:
+ case MB_TERM_LDIND_OBJ:
+ t = ctree_dup_address (mp, s->left);
+ t = mono_ctree_new (mp, MB_TERM_LDIND_OBJ, t, NULL);
+ t->svt = VAL_UNKNOWN;
+ break;
default:
g_warning ("unknown op \"%s\"", mono_burg_term_string [s->op]);
g_assert_not_reached ();
@@ -470,7 +484,8 @@ mono_store_tree (MonoFlowGraph *cfg, int slot, MBTree *s, MBTree **tdup)
g_assert (s->svt != VAL_UNKNOWN);
if (slot >= 0) {
- vnum = mono_allocate_intvar (cfg, slot, s->svt);
+ if (!vnum)
+ vnum = mono_allocate_intvar (cfg, slot, s->svt);
} else {
int size, align;
mono_get_val_sizes (s->svt, &size, &align);
@@ -486,7 +501,7 @@ mono_store_tree (MonoFlowGraph *cfg, int slot, MBTree *s, MBTree **tdup)
}
if (tdup)
- mono_store_tree (cfg, -1, t, tdup);
+ *tdup = ctree_create_dup (mp, t);
return t;
}
@@ -541,7 +556,7 @@ static void
mono_analyze_flow (MonoFlowGraph *cfg)
{
MonoMethod *method = cfg->method;
- register const unsigned char *ip, *end;
+ const unsigned char *ip, *end;
MonoMethodHeader *header;
MonoBytecodeInfo *bcinfo;
MonoExceptionClause *clause;
@@ -562,11 +577,14 @@ mono_analyze_flow (MonoFlowGraph *cfg)
mono_jit_stats.cil_code_size += header->code_size;
- /* fixme: add block boundaries for exceptions */
for (i = 0; i < header->num_clauses; ++i) {
clause = &header->clauses [i];
+
CREATE_BLOCK (clause->try_offset);
CREATE_BLOCK (clause->handler_offset);
+
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_FILTER)
+ CREATE_BLOCK (clause->token_or_filter);
}
while (ip < end) {
@@ -579,12 +597,7 @@ mono_analyze_flow (MonoFlowGraph *cfg)
block_end = FALSE;
}
- if (*ip == 0xfe) {
- ++ip;
- i = *ip + 256;
- } else {
- i = *ip;
- }
+ i = mono_opcode_value (&ip);
opcode = &mono_opcodes [i];
@@ -721,12 +734,7 @@ mono_analyze_flow (MonoFlowGraph *cfg)
}
g_assert (bb);
- if (*ip == 0xfe) {
- ++ip;
- i = *ip + 256;
- } else {
- i = *ip;
- }
+ i = mono_opcode_value (&ip);
opcode = &mono_opcodes [i];
@@ -806,6 +814,8 @@ ves_array_element_address (MonoArray *this, ...)
int i, ind, esize;
gpointer ea;
+ MONO_ARCH_SAVE_REGS;
+
g_assert (this != NULL);
va_start(ap, this);
@@ -813,17 +823,20 @@ ves_array_element_address (MonoArray *this, ...)
class = this->obj.vtable->klass;
ind = va_arg(ap, int);
- if (this->bounds != NULL) {
- ind -= this->bounds [0].lower_bound;
- for (i = 1; i < class->rank; i++) {
- ind = ind*this->bounds [i].length + va_arg(ap, int) -
- this->bounds [i].lower_bound;;
- }
+ g_assert (this->bounds != NULL);
+
+ ind -= this->bounds [0].lower_bound;
+ for (i = 1; i < class->rank; i++) {
+ ind = ind*this->bounds [i].length + va_arg(ap, int) -
+ this->bounds [i].lower_bound;;
}
+ if (ind >= this->max_length)
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
+
esize = mono_array_element_size (class);
ea = (gpointer*)((char*)this->vector + (ind * esize));
- //printf ("AADDRESS %p %p %d\n", this, ea, ind);
+ //printf ("AADDRESS %p %p %d %d %08X\n", this, ea, ind, esize, *(gpointer *)ea);
va_end(ap);
@@ -862,7 +875,7 @@ mono_array_new_va (MonoMethod *cm, ...)
}
#define ADD_TREE(t,a) do { t->cli_addr = a; g_ptr_array_add (forest, (t)); } while (0)
-#define PUSH_TREE(t,k) do { int tt = k; *sp = t; t->svt = tt; sp++; } while (0)
+#define PUSH_TREE(t,k) do { int tt = k; *sp = t; t->svt = tt; t->cli_addr = cli_addr; sp++; } while (0)
#define LOCAL_POS(n) (1 + n)
@@ -960,11 +973,15 @@ check_inlining (MonoMethod *method)
method->inline_info = 1;
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ goto fail;
+
if ((method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_NOINLINING) ||
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
(method->klass->marshalbyref) ||
- ISSTRUCT (signature->ret))
+ MONO_TYPE_ISSTRUCT (signature->ret))
goto fail;;
if (!(header = ((MonoMethodNormal *)method)->header) ||
@@ -1132,8 +1149,12 @@ check_inlining (MonoMethod *method)
token = read32 (ip);
ip += 4;
- cm = mono_get_method (method->klass->image, token, NULL);
- g_assert (cm);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ cm = mono_method_get_wrapper_data (method, token);
+ else
+ cm = mono_get_method (method->klass->image, token, NULL);
+ if (!cm)
+ goto fail;
if (cm == method)
goto fail;
@@ -1322,14 +1343,16 @@ mono_analyze_stack (MonoFlowGraph *cfg)
MonoImage *image;
MonoValueType svt;
MBTree **sp, **stack, **arg_sp, **arg_map = NULL, *t1, *t2, *t3;
+ MonoJitArgumentInfo *arg_info, default_arg_info [10];
register const unsigned char *ip, *end;
GPtrArray *forest;
int i, j, depth, repeat_count;
- int varnum = 0, firstarg = 0, retvtarg = 0;
+ int varnum = 0, firstarg = 0;
gboolean repeat, superblock_end;
MonoBBlock *bb, *tbb;
int maxstack;
GList *inline_list = NULL;
+ gboolean tail_recursion;
header = ((MonoMethodNormal *)method)->header;
signature = method->signature;
@@ -1339,6 +1362,8 @@ mono_analyze_stack (MonoFlowGraph *cfg)
maxstack = header->max_stack + 10;
sp = stack = alloca (sizeof (MBTree *) * (maxstack + 1));
+ /* allocate local variables */
+
if (header->num_locals) {
int size, align;
@@ -1352,48 +1377,49 @@ mono_analyze_stack (MonoFlowGraph *cfg)
}
}
- if (ISSTRUCT (signature->ret)) {
- int size, align;
+ cfg->args_start_index = firstarg = varnum + 1;
+
+ /* allocate argument variables */
- cfg->has_vtarg = 1;
+ if (signature->param_count + 1 < 10)
+ arg_info = default_arg_info;
+ else
+ arg_info = g_new (MonoJitArgumentInfo, signature->param_count + 1);
- size = mono_type_size (signature->ret, &align);
-
- retvtarg = varnum = arch_allocate_var (cfg, size, align, MONO_LOCALVAR, VAL_UNKNOWN);
-
- //printf ("VALUETYPE METHOD %s.%s::%s %d\n", method->klass->name_space,
- //method->klass->name, method->name, size);
- }
+ arch_get_argument_info (signature, signature->param_count, arg_info);
+
+ if (signature->hasthis)
+ arch_allocate_arg (cfg, &arg_info [0], VAL_POINTER);
- cfg->args_start_index = firstarg = varnum + 1;
-
- if (signature->hasthis) {
- int thisvar;
- thisvar = arch_allocate_var (cfg, sizeof (gpointer), sizeof (gpointer), MONO_ARGVAR, VAL_POINTER);
- VARINFO (cfg, thisvar).isvolatile = 1;
- }
+ if (signature->param_count)
+ for (i = 0; i < signature->param_count; ++i)
+ arch_allocate_arg (cfg, &arg_info [i + 1], VAL_UNKNOWN);
- if (signature->param_count) {
- int align, size;
+ if (signature->param_count > 9)
+ g_free (arg_info);
- for (i = 0; i < signature->param_count; ++i) {
- int argvar;
- size = mono_type_stack_size (signature->params [i], &align);
- argvar = arch_allocate_var (cfg, size, align, MONO_ARGVAR, VAL_UNKNOWN);
- VARINFO (cfg, argvar).isvolatile = 1;
- }
- }
for (i = 0; i < header->num_clauses; ++i) {
MonoExceptionClause *clause = &header->clauses [i];
tbb = &cfg->bblocks [bcinfo [clause->handler_offset].block_id];
- if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE) {
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE ||
+ clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
tbb->instack = mono_mempool_alloc (mp, sizeof (MBTree *));
tbb->indepth = 1;
tbb->instack [0] = t1 = mono_ctree_new_leaf (mp, MB_TERM_EXCEPTION);
t1->data.i = mono_allocate_excvar (cfg);
t1->svt = VAL_POINTER;
tbb->reached = 1;
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ tbb = &cfg->bblocks [bcinfo [clause->token_or_filter].block_id];
+ g_assert (tbb);
+ tbb->instack = mono_mempool_alloc (mp, sizeof (MBTree *));
+ tbb->indepth = 1;
+ tbb->instack [0] = t1 = mono_ctree_new_leaf (mp, MB_TERM_EXCEPTION);
+ t1->data.i = mono_allocate_excvar (cfg);
+ t1->svt = VAL_POINTER;
+ tbb->reached = 1;
+ }
} else if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
mark_reached (cfg, tbb, NULL, 0);
} else {
@@ -1443,6 +1469,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
superblock_end = FALSE;
+ tail_recursion = FALSE;
while (inline_list || ip < end) {
guint32 cli_addr;
@@ -1452,6 +1479,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
if (ip >= ii->end) {
inline_list = g_list_remove_link (inline_list, inline_list);
ip = ii->saved_ip;
+ tail_recursion = FALSE;
image = ii->saved_image;
if (inline_list)
arg_map = ((MonoInlineInfo *)inline_list->data)->arg_map;
@@ -1487,7 +1515,10 @@ mono_analyze_stack (MonoFlowGraph *cfg)
token = read32 (ip);
ip += 4;
- c = mono_class_get (image, token);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ c = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ c = mono_class_get (image, token);
t1 = mono_ctree_new_leaf (mp, MB_TERM_NEWOBJ);
t1->data.p = c;
@@ -1518,7 +1549,11 @@ mono_analyze_stack (MonoFlowGraph *cfg)
ip += 4;
sp--;
- class = mono_class_get (image, token);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ class = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ class = mono_class_get (image, token);
+
t1 = mono_ctree_new (mp, MB_TERM_UNBOX, *sp, NULL);
t1->data.klass = class;
@@ -1543,7 +1578,10 @@ mono_analyze_stack (MonoFlowGraph *cfg)
ip += 4;
sp--;
- c = mono_class_get (image, token);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ c = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ c = mono_class_get (image, token);
g_assert (c->valuetype);
t1 = ctree_create_load (cfg, &c->byval_arg, *sp, &svt, FALSE);
@@ -1600,19 +1638,10 @@ mono_analyze_stack (MonoFlowGraph *cfg)
++ip;
token = read32 (ip);
ip += 4;
-
- /* need to handle fieldrefs */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
- field = mono_field_from_memberref (image, token, &klass);
- mono_class_init (klass);
- } else {
- klass = mono_class_get (image,
- MONO_TOKEN_TYPE_DEF | mono_metadata_typedef_from_field (image, token & 0xffffff));
- mono_class_init (klass);
- field = mono_class_get_field (klass, token);
- }
- g_assert (field);
+ /* need to handle fieldrefs */
+ field = mono_field_from_token (image, token, &klass);
+ g_assert (field);
if (cfg->share_code) {
t1 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
@@ -1647,15 +1676,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
sp--;
/* need to handle fieldrefs */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
- field = mono_field_from_memberref (image, token, &klass);
- mono_class_init (klass);
- } else {
- klass = mono_class_get (image,
- MONO_TOKEN_TYPE_DEF | mono_metadata_typedef_from_field (image, token & 0xffffff));
- mono_class_init (klass);
- field = mono_class_get_field (klass, token);
- }
+ field = mono_field_from_token (image, token, &klass);
g_assert (field);
if (klass->marshalbyref) {
@@ -1692,16 +1713,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
--sp;
/* need to handle fieldrefs */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
- field = mono_field_from_memberref (image, token, &klass);
- mono_class_init (klass);
- } else {
- klass = mono_class_get (image,
- MONO_TOKEN_TYPE_DEF | mono_metadata_typedef_from_field (image, token & 0xffffff));
- mono_class_init (klass);
- field = mono_class_get_field (klass, token);
-
- }
+ field = mono_field_from_token (image, token, &klass);
g_assert (field);
if (cfg->share_code) {
@@ -1730,15 +1742,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
sp -= 2;
/* need to handle fieldrefs */
- if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
- field = mono_field_from_memberref (image, token, &klass);
- mono_class_init (klass);
- } else {
- klass = mono_class_get (image,
- MONO_TOKEN_TYPE_DEF | mono_metadata_typedef_from_field (image, token & 0xffffff));
- mono_class_init (klass);
- field = mono_class_get_field (klass, token);
- }
+ field = mono_field_from_token (image, token, &klass);
g_assert (field);
if (klass->marshalbyref) {
@@ -1749,10 +1753,10 @@ mono_analyze_stack (MonoFlowGraph *cfg)
t1 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
t1->data.i = klass->valuetype ? field->offset - sizeof (MonoObject) : field->offset;
t1 = mono_ctree_new (mp, MB_TERM_ADD, sp [0], t1);
+ t1 = mono_ctree_new (mp, MB_TERM_CHECKTHIS, t1, NULL);
t1 = ctree_create_store (cfg, field->type, t1, sp [1], FALSE);
}
-
ADD_TREE (t1, cli_addr);
break;
}
@@ -1769,9 +1773,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
mono_class_init (class);
- esize = mono_class_instance_size (class);
- if (class->valuetype)
- esize -= sizeof (MonoObject);
+ esize = mono_class_array_element_size (class);
t1 = mono_ctree_new (mp, MB_TERM_LDELEMA, sp [0], sp [1]);
t1->data.i = esize;
@@ -1827,13 +1829,24 @@ mono_analyze_stack (MonoFlowGraph *cfg)
case CEE_LDTOKEN: {
gpointer handle;
MonoClass *handle_class;
+ MonoMethod *next_method;
++ip;
handle = mono_ldtoken (image, read32 (ip), &handle_class);
ip += 4;
- t1 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
- t1->data.p = handle;
+ if (!cfg->share_code && (*ip == CEE_CALL) && (next_method = mono_get_method (image, read32 (ip+1), NULL)) &&
+ (next_method->klass == mono_defaults.monotype_class->parent) &&
+ (strcmp (next_method->name, "GetTypeFromHandle") == 0)) {
+ MonoClass *tclass = mono_class_from_mono_type (handle);
+ mono_class_init (tclass);
+ ip += 5;
+ t1 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
+ t1->data.p = mono_type_get_object (cfg->domain, handle);
+ } else {
+ t1 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
+ t1->data.p = handle;
+ }
PUSH_TREE (t1, VAL_POINTER);
break;
@@ -1845,9 +1858,13 @@ mono_analyze_stack (MonoFlowGraph *cfg)
ip++;
--sp;
token = read32 (ip);
- class = mono_class_get (image, token);
ip += 4;
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ class = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ class = mono_class_get (image, token);
+
if (cfg->share_code) {
t1 = mono_ctree_new (mp, MB_TERM_NEWARR, *sp, NULL);
t1->data.p = class;
@@ -1886,7 +1903,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
MonoMethod *cm;
MBTree *this = NULL;
guint32 token;
- int k, align, size, args_size = 0;
+ int k, frame_size;
int newarr = FALSE;
int newstr = FALSE;
@@ -1894,7 +1911,10 @@ mono_analyze_stack (MonoFlowGraph *cfg)
token = read32 (ip);
ip += 4;
- cm = mono_get_method (image, token, NULL);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ cm = mono_method_get_wrapper_data (method, token);
+ else
+ cm = mono_get_method (image, token, NULL);
g_assert (cm);
g_assert (!strcmp (cm->name, ".ctor"));
@@ -1911,10 +1931,16 @@ mono_analyze_stack (MonoFlowGraph *cfg)
newarr = TRUE;
this = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
this->data.m = cm;
- } else if (cm->klass == mono_defaults.string_class) {
+ } else if (cm->string_ctor) {
+ static MonoString *string_dummy = NULL;
+
+ if (!string_dummy)
+ string_dummy = mono_string_new_wrapper ("dummy");
+
newstr = TRUE;
+ /* we just pass a dummy as this, it is not used */
this = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
- this->data.m = cm;
+ this->data.p = string_dummy;
} else {
if (cm->klass->valuetype) {
t1 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
@@ -1936,33 +1962,33 @@ mono_analyze_stack (MonoFlowGraph *cfg)
g_assert (t1);
ADD_TREE (t1, cli_addr);
}
-
- args_size += sizeof (gpointer); /* this argument */
+
+ if (csig->param_count + 1 < 10)
+ arg_info = default_arg_info;
+ else
+ arg_info = g_new (MonoJitArgumentInfo, csig->param_count + 1);
+ frame_size = arch_get_argument_info (csig, csig->param_count, arg_info);
+
for (k = csig->param_count - 1; k >= 0; k--) {
- MonoType *type = cm->signature->params [k];
-
- size = mono_type_stack_size (type, &align);
- t1 = mono_ctree_new (mp, mono_map_arg_type (type), arg_sp [k], NULL);
- t1->data.i = size;
+ t1 = mono_ctree_new (mp, mono_map_arg_type (csig->params [k]), arg_sp [k], NULL);
+ t1->data.arg_info = arg_info [k + 1];
ADD_TREE (t1, cli_addr);
- args_size += size;
}
-
if (newarr || newstr) {
- t2 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
+ t2 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_G);
+ t2->data.nonvirt_info.method = cm;
if (newarr) {
- t2->data.p = mono_array_new_va;
+ t2->data.nonvirt_info.p = mono_array_new_va;
} else {
- t2->data.p = arch_create_jit_trampoline (cm);
+ t2->data.nonvirt_info.p = arch_create_jit_trampoline (cm);
}
t1 = mono_ctree_new (mp, MB_TERM_CALL_I4, this, t2);
- t1->data.ci.args_size = args_size;
- t1->data.ci.vtype_num = 0;
-
+ t1->data.call_info.pad = arg_info [0].pad;
+ t1->data.call_info.frame_size = frame_size;
t1->svt = VAL_POINTER;
t1 = mono_store_tree (cfg, -1, t1, &t2);
@@ -1973,11 +1999,12 @@ mono_analyze_stack (MonoFlowGraph *cfg)
} else {
t2 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_G);
- t2->data.p = arch_create_jit_trampoline (cm);
+ t2->data.nonvirt_info.p = arch_create_jit_trampoline (cm);
+ t2->data.nonvirt_info.method = cm;
t1 = mono_ctree_new (mp, mono_map_call_type (csig->ret, &svt), this, t2);
- t1->data.ci.args_size = args_size;
- t1->data.ci.vtype_num = 0;
+ t1->data.call_info.pad = arg_info [0].pad;
+ t1->data.call_info.frame_size = frame_size;
t1->svt = svt;
ADD_TREE (t1, cli_addr);
@@ -1991,6 +2018,10 @@ mono_analyze_stack (MonoFlowGraph *cfg)
PUSH_TREE (t1, t1->svt);
}
}
+
+ if (csig->param_count > 9)
+ g_free (arg_info);
+
break;
}
case CEE_CALLI:
@@ -2000,11 +2031,10 @@ mono_analyze_stack (MonoFlowGraph *cfg)
MonoMethod *cm;
MBTree *ftn, *this = NULL;
guint32 token;
- int k, align, size, args_size = 0;
+ int k, frame_size;
int virtual = *ip == CEE_CALLVIRT;
int calli = *ip == CEE_CALLI;
- gboolean array_set = FALSE;
- gboolean array_get = FALSE;
+ int array_rank = 0;
/* fixme: compute this value */
gboolean shared_to_unshared_call = FALSE;
int nargs, vtype_num = 0;
@@ -2013,9 +2043,16 @@ mono_analyze_stack (MonoFlowGraph *cfg)
token = read32 (ip);
ip += 4;
+ tail_recursion = FALSE;
+
if (calli) {
ftn = *(--sp);
- csig = mono_metadata_parse_signature (image, token);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ csig = (MonoMethodSignature *)mono_method_get_wrapper_data (method, token);
+ else
+ csig = mono_metadata_parse_signature (image, token);
+
g_assert (csig);
arg_sp = sp -= csig->param_count;
} else {
@@ -2043,9 +2080,9 @@ mono_analyze_stack (MonoFlowGraph *cfg)
}
}
- if (cm->klass == mono_defaults.string_class &&
- *cm->name == '.' && !strcmp (cm->name, ".ctor"))
+ if (cm->string_ctor)
g_assert_not_reached ();
+
arg_sp = sp -= cm->signature->param_count;
if ((cm->flags & METHOD_ATTRIBUTE_FINAL &&
@@ -2054,126 +2091,155 @@ mono_analyze_stack (MonoFlowGraph *cfg)
virtual = 0;
}
+ g_assert (sp >= stack);
+
if (!calli && mono_jit_inline_code && !virtual && cm->inline_count != -1 &&
- (cm->inline_info || check_inlining (cm) >= 0)) {
+ cm != method && (cm->inline_info || check_inlining (cm) >= 0)) {
MonoInlineInfo *ii = alloca (sizeof (MonoInlineInfo));
int args;
+ GList *l;
- mono_jit_stats.inlined_methods++;
-
- if (cm->signature->hasthis)
- sp--;
-
- args = cm->signature->param_count + cm->signature->hasthis;
-
- ii->method = cm;
- ii->saved_ip = ip;
- ii->saved_image = image;
- ii->arg_map = alloca (args * sizeof (MBTree *));
- memcpy (ii->arg_map, sp, args * sizeof (MBTree *));
-
- if (cm->signature->hasthis && !cm->uses_this &&
- (ii->arg_map [0]->op != MB_TERM_CHECKTHIS)) {
- ii->arg_map [0] = mono_ctree_new (mp, MB_TERM_CHECKTHIS,
- ii->arg_map [0], NULL);
- ADD_TREE (ii->arg_map [0], cli_addr);
+ /* avoid recursive inlining */
+ for (l = inline_list; l; l = l->next) {
+ if (((MonoInlineInfo *)l->data)->method == cm)
+ break;
}
- if (cm->inline_count) {
- inline_list = g_list_prepend (inline_list, ii);
- ip = ((MonoMethodNormal *)cm)->header->code;
- ii->end = ip + cm->inline_count;
- arg_map = ii->arg_map;
- image = cm->klass->image;
+ if (!l) {
+
+ /* make sure runtime_init is called */
+ mono_class_vtable (cfg->domain, cm->klass);
+
+ mono_jit_stats.inlined_methods++;
+
+ if (cm->signature->hasthis)
+ sp--;
+
+ args = cm->signature->param_count + cm->signature->hasthis;
+
+ ii->method = cm;
+ ii->saved_ip = ip;
+ ii->saved_image = image;
+ ii->arg_map = alloca (args * sizeof (MBTree *));
+ memcpy (ii->arg_map, sp, args * sizeof (MBTree *));
+
+ if (cm->signature->hasthis && !cm->uses_this &&
+ (ii->arg_map [0]->op != MB_TERM_CHECKTHIS)) {
+ ii->arg_map [0] = mono_ctree_new (mp, MB_TERM_CHECKTHIS,
+ ii->arg_map [0], NULL);
+ ADD_TREE (ii->arg_map [0], ii->arg_map [0]->cli_addr);
+ }
+
+ if (cm->inline_count) {
+ inline_list = g_list_prepend (inline_list, ii);
+ ip = ((MonoMethodNormal *)cm)->header->code;
+ ii->end = ip + cm->inline_count;
+ arg_map = ii->arg_map;
+ image = cm->klass->image;
+ }
+ continue;
}
- continue;
}
- if (!calli)
- csig = cm->signature;
-
+ if (!calli) {
+ MonoMethod *wrapper;
+ if (cm->signature->pinvoke) {
+#ifdef MONO_USE_EXC_TABLES
+ if (mono_method_blittable (cm)) {
+ csig = cm->signature;
+ } else {
+#endif
+ wrapper = mono_marshal_get_native_wrapper (cm);
+ csig = wrapper->signature;
+#ifdef MONO_USE_EXC_TABLES
+ }
+#endif
+ } else {
+ csig = cm->signature;
+ }
+ }
nargs = csig->param_count;
+
g_assert (csig->call_convention == MONO_CALL_DEFAULT);
g_assert (!virtual || csig->hasthis);
if (!calli && cm->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
if (cm->klass->parent == mono_defaults.array_class) {
- if (!strcmp (cm->name, "Set")) {
- array_set = TRUE;
+ array_rank = cm->klass->rank;
+
+ if (cm->name [0] == 'S') /* Set */
nargs--;
- } else if (!strcmp (cm->name, "Get"))
- array_get = TRUE;
}
}
+ if (csig->param_count + 1 < 10)
+ arg_info = default_arg_info;
+ else
+ arg_info = g_new (MonoJitArgumentInfo, csig->param_count + 1);
+
+ frame_size = arch_get_argument_info (csig, nargs, arg_info);
+
for (k = nargs - 1; k >= 0; k--) {
- MonoType *type = csig->params [k];
- t1 = mono_ctree_new (mp, mono_map_arg_type (type), arg_sp [k], NULL);
- size = mono_type_stack_size (type, &align);
- t1->data.i = size;
- ADD_TREE (t1, cli_addr);
- args_size += size;
- // fixme: align value type arguments to 8 byte boundary on the stack
+ g_assert (arg_sp [k]);
+ t1 = mono_ctree_new (mp, mono_map_arg_type (csig->params [k]), arg_sp [k], NULL);
+ t1->data.arg_info = arg_info [k + 1];
+ ADD_TREE (t1, arg_sp [k]->cli_addr);
}
- if (csig->hasthis) {
+ if (csig->hasthis)
this = *(--sp);
- args_size += sizeof (gpointer);
- } else
+ else
this = mono_ctree_new_leaf (mp, MB_TERM_NOP);
+
+
+ if (MONO_TYPE_ISSTRUCT (csig->ret) && !array_rank) {
+ int size, align;
+ if (csig->pinvoke)
+ size = mono_class_native_size (csig->ret->data.klass, &align);
+ else
+ size = mono_class_value_size (csig->ret->data.klass, &align);
- if (ISSTRUCT (csig->ret)) {
- size = mono_type_size (csig->ret, &align);
vtype_num = arch_allocate_var (cfg, size, align, MONO_TEMPVAR, VAL_UNKNOWN);
}
- if (array_get) {
- int vnum;
-
+ if (array_rank) {
+
t2 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
t2->data.p = ves_array_element_address;
-
+
t1 = mono_ctree_new (mp, MB_TERM_CALL_I4, this, t2);
- t1->data.ci.args_size = args_size;
- t1->data.ci.vtype_num = vtype_num;
-
- t1 = mono_ctree_new (mp, mono_map_ldind_type (csig->ret, &svt), t1, NULL);
- t1->svt = svt;
-
- mono_get_val_sizes (t1->svt, &size, &align);
- vnum = arch_allocate_var (cfg, size, align, MONO_TEMPVAR, svt);
-
- t2 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_L);
- t2->data.i = vnum;
- t1 = mono_ctree_new (mp, mono_map_store_svt_type (svt), t2, t1);
- t1->svt = svt;
+ t1->data.call_info.vtype_num = vtype_num;
+ t1->data.call_info.frame_size = frame_size;
+ t1->data.call_info.pad = arg_info [0].pad;
+ t1->svt = VAL_POINTER;
+ t1 = mono_store_tree (cfg, -1, t1, &t2);
+ g_assert (t1);
ADD_TREE (t1, cli_addr);
- t1 = ctree_create_dup (mp, t1);
- PUSH_TREE (t1, t1->svt);
-
- } else if (array_set) {
- t2 = mono_ctree_new_leaf (mp, MB_TERM_CONST_I4);
- t2->data.p = ves_array_element_address;
-
- t1 = mono_ctree_new (mp, MB_TERM_CALL_I4, this, t2);
- t1->data.ci.args_size = args_size;
- t1->data.ci.vtype_num = vtype_num;
+ if (cm->name [0] == 'G') { /* Get */
+ t1 = mono_ctree_new (mp, mono_map_ldind_type (csig->ret, &svt), t2, NULL);
+ t1->svt = svt;
+ PUSH_TREE (t1, t1->svt);
+ } else if (cm->name [0] == 'S') { /* Set */
+ t1 = ctree_create_store (cfg, csig->params [nargs], t2, arg_sp [nargs], FALSE);
+ ADD_TREE (t1, cli_addr);
+ } else if (cm->name [0] == 'A') { /* Address */
+ PUSH_TREE (t2, t1->svt);
+ } else {
+ g_assert_not_reached ();
+ }
- t1 = ctree_create_store (cfg, csig->params [nargs], t1, arg_sp [nargs], FALSE);
- ADD_TREE (t1, cli_addr);
-
} else {
if (calli) {
t2 = ftn;
} else if (virtual || (csig->hasthis &&
- !(cm->flags & METHOD_ATTRIBUTE_VIRTUAL) &&
- (cm->klass->marshalbyref || shared_to_unshared_call))) {
-
+ !(cm->flags & METHOD_ATTRIBUTE_VIRTUAL) &&
+ (cm->klass->marshalbyref || shared_to_unshared_call))) {
+
mono_class_init (cm->klass);
-
+
if (cm->klass->flags & TYPE_ATTRIBUTE_INTERFACE)
t2 = mono_ctree_new_leaf (mp, MB_TERM_INTF_ADDR);
else
@@ -2183,12 +2249,15 @@ mono_analyze_stack (MonoFlowGraph *cfg)
} else {
t2 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_G);
- t2->data.p = arch_create_jit_trampoline (cm);
+ t2->data.nonvirt_info.p = arch_create_jit_trampoline (cm);
+ t2->data.nonvirt_info.method = cm;
}
+
t1 = mono_ctree_new (mp, mono_map_call_type (csig->ret, &svt), this, t2);
- t1->data.ci.args_size = args_size;
- t1->data.ci.vtype_num = vtype_num;
+ t1->data.call_info.vtype_num = vtype_num;
+ t1->data.call_info.frame_size = frame_size;
+ t1->data.call_info.pad = arg_info [0].pad;
t1->svt = svt;
if (csig->ret->type != MONO_TYPE_VOID) {
@@ -2206,9 +2275,11 @@ mono_analyze_stack (MonoFlowGraph *cfg)
}
} else
ADD_TREE (t1, cli_addr);
-
}
+ if (csig->param_count > 9)
+ g_free (arg_info);
+
break;
}
case CEE_ISINST: {
@@ -2326,9 +2397,8 @@ mono_analyze_stack (MonoFlowGraph *cfg)
t1 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_L);
t1->data.i = LOCAL_POS (n);
- if (!ISSTRUCT (LOCAL_TYPE (n)))
+ if (!MONO_TYPE_ISSTRUCT (LOCAL_TYPE (n)))
t1 = ctree_create_load (cfg, LOCAL_TYPE (n), t1, &svt, FALSE);
-
PUSH_TREE (t1, svt);
break;
}
@@ -2337,7 +2407,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
t1 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_L);
t1->data.i = LOCAL_POS (*ip);
- if (!ISSTRUCT (LOCAL_TYPE (*ip)))
+ if (!MONO_TYPE_ISSTRUCT (LOCAL_TYPE (*ip)))
t1 = ctree_create_load (cfg, LOCAL_TYPE (*ip), t1, &svt, FALSE);
++ip;
@@ -2457,7 +2527,9 @@ mono_analyze_stack (MonoFlowGraph *cfg)
case CEE_DIV: {
++ip;
sp -= 2;
- if (sp [0]->op == MB_TERM_CONST_I4 && sp [1]->op == MB_TERM_CONST_I4) {
+ if (sp [0]->op == MB_TERM_CONST_I4 && sp [1]->op == MB_TERM_CONST_I4
+ && (sp[1]->data.i != 0)
+ && ((sp[0]->data.i != 0x080000000) || (sp[1]->data.i != -1))) {
t1 = mono_ctree_new_icon4 (mp, sp [0]->data.i / sp [1]->data.i);
PUSH_TREE (t1, sp [0]->svt);
} else {
@@ -2626,7 +2698,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
gint32 target;
MonoBBlock *hb;
int leave_s = (*ip == CEE_LEAVE_S);
-
+ int k;
++ip;
if (leave_s)
target = cli_addr + 2 + (signed char) *ip;
@@ -2655,6 +2727,19 @@ mono_analyze_stack (MonoFlowGraph *cfg)
ADD_TREE (t1, cli_addr);
}
+ /* check if we leave a catch handler, if so we have to
+ * rethrow ThreadAbort exceptions */
+ for (k = 0; k < header->num_clauses; ++k) {
+ MonoExceptionClause *clause = &header->clauses [k];
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE &&
+ MONO_OFFSET_IN_HANDLER (clause, cli_addr)) {
+ t1 = mono_ctree_new_leaf (mp, MB_TERM_RETHROW_ABORT);
+ t1->data.i = mono_allocate_excvar (cfg);
+ ADD_TREE (t1, cli_addr);
+ break;
+ }
+ }
+
t1 = mono_ctree_new_leaf (mp, MB_TERM_BR);
t1->data.p = tbb;
ADD_TREE (t1, cli_addr);
@@ -2737,7 +2822,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
if (ret->type != MONO_TYPE_VOID) {
--sp;
- if (ISSTRUCT (ret)) {
+ if (MONO_TYPE_ISSTRUCT (ret)) {
int align;
t1 = mono_ctree_new (mp, MB_TERM_RET_OBJ, *sp, NULL);
t1->data.i = mono_class_value_size (ret->data.klass, &align);
@@ -2753,7 +2838,9 @@ mono_analyze_stack (MonoFlowGraph *cfg)
ADD_TREE (t1, cli_addr);
if (sp > stack) {
- g_warning ("more values on stack at IL_%04x: %d", ip - header->code, sp - stack);
+ g_warning ("more values on stack at %s IL_%04x: %d",
+ mono_method_full_name (method, TRUE),
+ ip - header->code, sp - stack);
mono_print_ctree (cfg, sp [-1]);
printf ("\n");
}
@@ -2784,7 +2871,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
} else {
t1 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_L);
t1->data.i = ARG_POS (n);
- if (!ISSTRUCT (ARG_TYPE (n)))
+ if (!MONO_TYPE_ISSTRUCT (ARG_TYPE (n)))
t1 = ctree_create_load (cfg, ARG_TYPE (n), t1, &svt, TRUE);
PUSH_TREE (t1, svt);
@@ -2801,7 +2888,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
} else {
t1 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_L);
t1->data.i = ARG_POS (*ip);
- if (!ISSTRUCT (ARG_TYPE (*ip)))
+ if (!MONO_TYPE_ISSTRUCT (ARG_TYPE (*ip)))
t1 = ctree_create_load (cfg, ARG_TYPE (*ip), t1, &svt, TRUE);
PUSH_TREE (t1, svt);
}
@@ -3059,15 +3146,241 @@ mono_analyze_stack (MonoFlowGraph *cfg)
PUSH_TREE (t1, VAL_I32);
break;
case CEE_CONV_OVF_I8_UN:
+ case CEE_CONV_OVF_U8_UN: /* FIXME: slightly incorrect, but non worth fixing the corner cases in the old jit */
++ip;
sp--;
t1 = mono_ctree_new (mp, MB_TERM_CONV_OVF_I8_UN, *sp, NULL);
PUSH_TREE (t1, VAL_I64);
break;
+ case MONO_CUSTOM_PREFIX: {
+ ++ip;
+ switch (*ip) {
+
+ case CEE_MONO_FUNC1: {
+ MonoMarshalConv conv;
+ ++ip;
+
+ conv = *ip;
+
+ ++ip;
+
+ sp--;
+ t1 = mono_ctree_new (mp, MB_TERM_FUNC1, *sp, NULL);
+
+ switch (conv) {
+ case MONO_MARSHAL_CONV_STR_LPWSTR:
+ t1->data.p = mono_string_to_utf16;
+ break;
+ case MONO_MARSHAL_CONV_LPWSTR_STR:
+ t1->data.p = mono_string_from_utf16;
+ break;
+ case MONO_MARSHAL_CONV_LPSTR_STR:
+ t1->data.p = mono_string_new_wrapper;
+ break;
+ case MONO_MARSHAL_CONV_STR_LPTSTR:
+ case MONO_MARSHAL_CONV_STR_LPSTR:
+ t1->data.p = mono_string_to_utf8;
+ break;
+ case MONO_MARSHAL_CONV_STR_BSTR:
+ t1->data.p = mono_string_to_bstr;
+ break;
+ case MONO_MARSHAL_CONV_STR_TBSTR:
+ case MONO_MARSHAL_CONV_STR_ANSIBSTR:
+ t1->data.p = mono_string_to_ansibstr;
+ break;
+ case MONO_MARSHAL_CONV_SB_LPSTR:
+ t1->data.p = mono_string_builder_to_utf8;
+ break;
+ case MONO_MARSHAL_CONV_ARRAY_SAVEARRAY:
+ t1->data.p = mono_array_to_savearray;
+ break;
+ case MONO_MARSHAL_CONV_ARRAY_LPARRAY:
+ t1->data.p = mono_array_to_lparray;
+ break;
+ case MONO_MARSHAL_CONV_DEL_FTN:
+ t1->data.p = mono_delegate_to_ftnptr;
+ break;
+ case MONO_MARSHAL_CONV_STRARRAY_STRLPARRAY:
+ t1->data.p = mono_marshal_string_array;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ PUSH_TREE (t1, VAL_POINTER);
+ break;
+ }
+ case CEE_MONO_PROC2: {
+ MonoMarshalConv conv;
+ ++ip;
+ conv = *ip;
+ ++ip;
+
+ sp -= 2;
+ t1 = mono_ctree_new (mp, MB_TERM_PROC2, sp [0], sp [1]);
+
+ switch (conv) {
+ case MONO_MARSHAL_CONV_LPSTR_SB:
+ t1->data.p = mono_string_utf8_to_builder;
+ break;
+ case MONO_MARSHAL_FREE_ARRAY:
+ t1->data.p = mono_marshal_free_array;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ADD_TREE (t1, cli_addr);
+ break;
+ }
+ case CEE_MONO_PROC3: {
+ MonoMarshalConv conv;
+ ++ip;
+ conv = *ip;
+ ++ip;
+
+ sp -= 3;
+
+ t1 = mono_ctree_new (mp, MB_TERM_CPSRC, sp [1], sp [2]);
+ t1 = mono_ctree_new (mp, MB_TERM_PROC3, sp [0], t1);
+
+ switch (conv) {
+ case MONO_MARSHAL_CONV_STR_BYVALSTR:
+ t1->data.p = mono_string_to_byvalstr;
+ break;
+ case MONO_MARSHAL_CONV_STR_BYVALWSTR:
+ t1->data.p = mono_string_to_byvalwstr;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ ADD_TREE (t1, cli_addr);
+ break;
+ }
+ case CEE_MONO_LDNATIVEOBJ: {
+ guint32 token;
+ MonoClass *c;
+
+ ++ip;
+ token = read32 (ip);
+ ip += 4;
+ sp--;
+
+ g_assert (method->wrapper_type != MONO_WRAPPER_NONE);
+ c = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ g_assert (c->valuetype);
+
+ t1 = ctree_create_load (cfg, &c->byval_arg, *sp, &svt, FALSE);
+ PUSH_TREE (t1, svt);
+ break;
+ }
+ case CEE_MONO_FREE: {
+ ++ip;
+
+ sp -= 1;
+ t1 = mono_ctree_new (mp, MB_TERM_FREE, *sp, NULL);
+ ADD_TREE (t1, cli_addr);
+ break;
+ }
+ case CEE_MONO_OBJADDR: {
+ ++ip;
+
+ sp -= 1;
+ t1 = mono_ctree_new (mp, MB_TERM_OBJADDR, *sp, NULL);
+ PUSH_TREE (t1, VAL_POINTER);
+ break;
+ }
+ case CEE_MONO_VTADDR: {
+ ++ip;
+
+ sp -= 1;
+ t1 = mono_ctree_new (mp, MB_TERM_VTADDR, *sp, NULL);
+ PUSH_TREE (t1, VAL_POINTER);
+ break;
+ }
+ case CEE_MONO_LDPTR: {
+ guint32 token;
+ ++ip;
+
+ token = read32 (ip);
+ ip += 4;
+
+ t1 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_G);
+ t1->data.p = mono_method_get_wrapper_data (method, token);
+
+ PUSH_TREE (t1, VAL_POINTER);
+ break;
+ }
+ case CEE_MONO_NEWOBJ: {
+ MonoClass *class;
+ guint32 token;
+
+ ++ip;
+ token = read32 (ip);
+ ip += 4;
+
+ class = (MonoClass *)mono_method_get_wrapper_data (method, token);
+
+ t1 = mono_ctree_new_leaf (mp, MB_TERM_NEWOBJ);
+ t1->data.p = class;
+ PUSH_TREE (t1, VAL_POINTER);
+
+ break;
+ }
+ case CEE_MONO_RETOBJ: {
+ MonoType *ret = signature->ret;
+ MonoClass *class;
+ guint32 token;
+
+ ++ip;
+ token = read32 (ip);
+ ip += 4;
+
+ class = (MonoClass *)mono_method_get_wrapper_data (method, token);
+
+ sp--;
+
+ g_assert (MONO_TYPE_ISSTRUCT (ret));
+
+ t1 = ctree_create_load (cfg, &class->byval_arg, *sp, &svt, FALSE);
+ t1 = mono_ctree_new (mp, MB_TERM_RET_OBJ, t1, NULL);
+ t1->data.i = mono_class_native_size (ret->data.klass, NULL);
+ t1->last_instr = (ip == (header->code + header->code_size));
+
+ ADD_TREE (t1, cli_addr);
+
+ if (sp > stack) {
+ g_warning ("more values on stack at %s IL_%04x: %d",
+ mono_method_full_name (method, TRUE),
+ ip - header->code, sp - stack);
+ mono_print_ctree (cfg, sp [-1]);
+ printf ("\n");
+ }
+ superblock_end = TRUE;
+ break;
+ }
+ default:
+ g_error ("Unimplemented opcode at IL_%04x "
+ "%02x %02x", ip - header->code, MONO_CUSTOM_PREFIX, *ip);
+ }
+ break;
+ }
case CEE_PREFIX1: {
++ip;
switch (*ip) {
+ case CEE_ENDFILTER: {
+ ip++;
+
+ sp--;
+ t1 = mono_ctree_new (mp, MB_TERM_ENDFILTER, *sp, NULL);
+ ADD_TREE (t1, cli_addr);
+ t1->last_instr = FALSE;
+
+ g_assert (sp == stack);
+ superblock_end = TRUE;
+ break;
+ }
+
case CEE_LDLOC: {
int n;
++ip;
@@ -3075,7 +3388,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
t1 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_L);
t1->data.i = LOCAL_POS (n);
- if (!ISSTRUCT (LOCAL_TYPE (n)))
+ if (!MONO_TYPE_ISSTRUCT (LOCAL_TYPE (n)))
t1 = ctree_create_load (cfg, LOCAL_TYPE (n), t1, &svt, FALSE);
ip += 2;
@@ -3141,7 +3454,11 @@ mono_analyze_stack (MonoFlowGraph *cfg)
token = read32 (ip);
ip += 4;
- cm = mono_get_method (image, token, NULL);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ cm = (MonoMethod *)mono_method_get_wrapper_data (method, token);
+ else
+ cm = mono_get_method (image, token, NULL);
+
g_assert (cm);
t1 = mono_ctree_new_leaf (mp, MB_TERM_LDFTN);
@@ -3197,7 +3514,7 @@ mono_analyze_stack (MonoFlowGraph *cfg)
t1 = mono_ctree_new_leaf (mp, MB_TERM_ADDR_L);
t1->data.i = ARG_POS (n);
- if (!ISSTRUCT (ARG_TYPE (n)))
+ if (!MONO_TYPE_ISSTRUCT (ARG_TYPE (n)))
t1 = ctree_create_load (cfg, ARG_TYPE (n), t1, &svt, TRUE);
PUSH_TREE (t1, svt);
break;
@@ -3246,14 +3563,18 @@ mono_analyze_stack (MonoFlowGraph *cfg)
}
case CEE_UNALIGNED_: {
++ip;
- // fixme: implement me
+ /* fixme: implement me */
break;
}
case CEE_VOLATILE_: {
++ip;
- // fixme: implement me
+ /* fixme: implement me */
break;
}
+ case CEE_TAIL_:
+ ++ip;
+ tail_recursion = TRUE;
+ break;
case CEE_LOCALLOC: {
++ip;
--sp;
@@ -3344,6 +3665,8 @@ mono_cfg_free (MonoFlowGraph *cfg)
mono_mempool_destroy (cfg->mp);
}
+int mono_exc_esp_offset = 0;
+
static MonoFlowGraph *
mono_cfg_new (MonoMethod *method)
{
@@ -3359,10 +3682,16 @@ mono_cfg_new (MonoMethod *method)
cfg->method = method;
cfg->mp = mp;
- /* reserve space for caller saved registers */
- /* fixme: this is arch dependent */
- /* we save EAX, EDX, ECX - and ESP if we call finally handlers */
- cfg->locals_size = 16;
+ /* reserve space to save LMF */
+ cfg->locals_size = sizeof (MonoLMF);
+
+ cfg->locals_size += sizeof (gpointer);
+ mono_exc_esp_offset = - cfg->locals_size;
+
+ cfg->locals_size += sizeof (gpointer);
+
+ /* aligment check */
+ g_assert (!(cfg->locals_size & 0x7));
/* fixme: we should also consider loader optimisation attributes */
cfg->share_code = mono_jit_share_code;
@@ -3376,7 +3705,7 @@ mono_cfg_new (MonoMethod *method)
((MonoMethodNormal *)method)->header->max_stack);
mono_analyze_flow (cfg);
-
+
if (!mono_analyze_stack (cfg)) {
mono_cfg_free (cfg);
return NULL;
@@ -3388,80 +3717,148 @@ mono_cfg_new (MonoMethod *method)
static gpointer
mono_get_runtime_method (MonoMethod* method)
{
+ MonoMethod *nm;
const char *name = method->name;
- guint8 *addr = NULL;
- gboolean delegate = FALSE;
- if (method->klass->parent == mono_defaults.multicastdelegate_class)
- delegate = TRUE;
-
- if (delegate && *name == '.' && (strcmp (name, ".ctor") == 0)) {
- addr = (gpointer)mono_delegate_ctor;
- } else if (delegate && *name == 'I' && (strcmp (name, "Invoke") == 0)) {
- addr = arch_get_delegate_invoke (method);
- } else if (delegate && *name == 'B' && (strcmp (name, "BeginInvoke") == 0)) {
- addr = arch_get_delegate_begin_invoke (method);
- } else if (delegate && *name == 'E' && (strcmp (name, "EndInvoke") == 0)) {
- /* this can raise exceptions, so we need a wrapper to save/restore LMF */
- method->addr = (gpointer)arch_end_invoke;
- addr = arch_create_native_wrapper (method);
+ if (method->klass->parent == mono_defaults.multicastdelegate_class) {
+ if (*name == '.' && (strcmp (name, ".ctor") == 0)) {
+ return (gpointer)mono_delegate_ctor;
+ } else if (*name == 'I' && (strcmp (name, "Invoke") == 0)) {
+ nm = mono_marshal_get_delegate_invoke (method);
+ return mono_compile_method (nm);
+ } else if (*name == 'B' && (strcmp (name, "BeginInvoke") == 0)) {
+ nm = mono_marshal_get_delegate_begin_invoke (method);
+ return mono_compile_method (nm);
+ } else if (*name == 'E' && (strcmp (name, "EndInvoke") == 0)) {
+ nm = mono_marshal_get_delegate_end_invoke (method);
+ return mono_compile_method (nm);
+ }
}
+ return NULL;
+}
- return addr;
+#ifdef MONO_USE_EXC_TABLES
+static gboolean
+mono_type_blittable (MonoType *type)
+{
+ if (type->byref)
+ return FALSE;
+
+ switch (type->type){
+ case MONO_TYPE_VOID:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ return TRUE;
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_CLASS:
+ return type->data.klass->blittable;
+ break;
+ default:
+ break;
+ }
+
+ return FALSE;
}
-static int
-match_debug_method (MonoMethod* method)
+gboolean
+mono_method_blittable (MonoMethod *method)
{
- GList *tmp = mono_debug_methods;
+ MonoMethodSignature *sig;
+ int i;
+
+ if (!method->addr)
+ return FALSE;
- for (; tmp; tmp = tmp->next) {
- if (mono_method_desc_full_match (tmp->data, method))
- return 1;
+ if (!mono_has_unwind_info (method)) {
+ return FALSE;
}
- return 0;
+
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
+ return TRUE;
+
+ sig = method->signature;
+
+ if (!mono_type_blittable (sig->ret))
+ return FALSE;
+
+ for (i = 0; i < sig->param_count; i++)
+ if (!mono_type_blittable (sig->params [i]))
+ return FALSE;
+
+ return TRUE;
}
+#endif
/**
- * mono_compile_method:
+ * mono_jit_compile_method:
* @method: pointer to the method info
*
* JIT compilation of a single method.
*
* Returns: a pointer to the newly created code.
*/
-gpointer
-mono_compile_method (MonoMethod *method)
+static gpointer
+mono_jit_compile_method (MonoMethod *method)
{
MonoDomain *target_domain, *domain = mono_domain_get ();
MonoJitInfo *ji;
guint8 *addr;
GHashTable *jit_code_hash;
- if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
- (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
- if (!method->info)
- method->info = arch_create_native_wrapper (method);
- return method->info;
- }
-
if (mono_jit_share_code)
target_domain = mono_root_domain;
else
target_domain = domain;
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
+
+ if (!method->info) {
+ MonoMethod *nm;
+
+ if (!method->addr && (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ mono_lookup_pinvoke_call (method);
+#ifdef MONO_USE_EXC_TABLES
+ if (mono_method_blittable (method)) {
+ method->info = method->addr;
+ } else {
+#endif
+ nm = mono_marshal_get_native_wrapper (method);
+ method->info = mono_compile_method (nm);
+
+ if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
+ mono_debug_add_wrapper (method, nm, target_domain);
+#ifdef MONO_USE_EXC_TABLES
+ }
+#endif
+ }
+
+ return method->info;
+ }
+
jit_code_hash = target_domain->jit_code_hash;
if ((addr = g_hash_table_lookup (jit_code_hash, method))) {
mono_jit_stats.methods_lookups++;
+
return addr;
}
mono_jit_stats.methods_compiled++;
if (mono_jit_trace_calls || mono_jit_dump_asm || mono_jit_dump_forest) {
- printf ("Start JIT compilation of %s.%s:%s\n", method->klass->name_space,
- method->klass->name, method->name);
+ printf ("Start JIT compilation of %s, domain '%s'\n",
+ mono_method_full_name (method, TRUE), target_domain->friendly_name);
}
if (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) {
@@ -3470,8 +3867,7 @@ mono_compile_method (MonoMethod *method)
if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
return NULL;
- g_error ("Don't know how to exec runtime method %s.%s::%s",
- method->klass->name_space, method->klass->name, method->name);
+ g_error ("Don't know how to exec runtime method %s", mono_method_full_name (method, TRUE));
}
} else {
MonoMethodHeader *header = ((MonoMethodNormal *)method)->header;
@@ -3488,16 +3884,8 @@ mono_compile_method (MonoMethod *method)
cfg->code_size = MAX (header->code_size * 5, 256);
cfg->start = cfg->code = g_malloc (cfg->code_size);
- /* fixme: make this arch independent */
- mono_debug_last_breakpoint_address = cfg->code;
-
- if (match_debug_method (method) || mono_debug_insert_breakpoint)
+ if (mono_debugger_method_has_breakpoint (method))
x86_breakpoint (cfg->code);
- else if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
- x86_nop (cfg->code);
-
- if (mono_debug_insert_breakpoint > 0)
- mono_debug_insert_breakpoint--;
if (!(ji = arch_jit_compile_cfg (target_domain, cfg))) {
mono_profiler_method_end_jit (method, MONO_PROFILE_FAILED);
@@ -3527,15 +3915,16 @@ mono_compile_method (MonoMethod *method)
g_free (id);
}
if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
- mono_debug_add_method (cfg);
+ mono_debug_jit_add_method (cfg);
mono_jit_stats.native_code_size += ji->code_size;
+ ji->num_clauses = header->num_clauses;
+
if (header->num_clauses) {
- int i, start_block, end_block;
+ int i, start_block, end_block, filter_block;
- ji->num_clauses = header->num_clauses;
ji->clauses = mono_mempool_alloc0 (target_domain->mp,
sizeof (MonoJitExceptionInfo) * header->num_clauses);
@@ -3544,7 +3933,14 @@ mono_compile_method (MonoMethod *method)
MonoJitExceptionInfo *ei = &ji->clauses [i];
ei->flags = ec->flags;
- ei->token_or_filter = ec->token_or_filter;
+
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ g_assert (cfg->bcinfo [ec->token_or_filter].is_block_start);
+ filter_block = cfg->bcinfo [ec->token_or_filter].block_id;
+ ei->data.filter = cfg->start + cfg->bblocks [filter_block].addr;
+ } else {
+ ei->data.token = ec->token_or_filter;
+ }
g_assert (cfg->bcinfo [ec->try_offset].is_block_start);
start_block = cfg->bcinfo [ec->try_offset].block_id;
@@ -3557,8 +3953,6 @@ mono_compile_method (MonoMethod *method)
g_assert (cfg->bcinfo [ec->handler_offset].is_block_start);
start_block = cfg->bcinfo [ec->handler_offset].block_id;
ei->handler_start = cfg->start + cfg->bblocks [start_block].addr;
-
- //printf ("TEST %x %x %x\n", ei->try_start, ei->try_end, ei->handler_start);
}
}
@@ -3572,29 +3966,55 @@ mono_compile_method (MonoMethod *method)
}
if (mono_jit_trace_calls || mono_jit_dump_asm || mono_jit_dump_forest) {
- printf ("END JIT compilation of %s.%s:%s %p %p\n", method->klass->name_space,
- method->klass->name, method->name, method, addr);
+ printf ("END JIT compilation of %s %p %p, domain '%s'\n",
+ mono_method_full_name (method, FALSE),
+ method,
+ addr,
+ target_domain->friendly_name);
}
g_hash_table_insert (jit_code_hash, method, addr);
+ /* make sure runtime_init is called */
+ mono_class_vtable (target_domain, method->klass);
+
+ return addr;
+}
+
+/* mono_jit_create_remoting_trampoline:
+ * @method: pointer to the method info
+ *
+ * Creates a trampoline which calls the remoting functions. This
+ * is used in the vtable of transparent proxies.
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_jit_create_remoting_trampoline (MonoMethod *method)
+{
+ MonoMethod *nm;
+ guint8 *addr = NULL;
+
+ nm = mono_marshal_get_remoting_invoke (method);
+ addr = mono_compile_method (nm);
+
return addr;
}
/* this function is never called */
-static void
+static void
ves_array_set (MonoArray *this, ...)
{
g_assert_not_reached ();
}
/* this function is never called */
-static void
+static void
ves_array_get (MonoArray *this, ...)
{
g_assert_not_reached ();
}
-
+
/**
* mono_jit_exec:
* @assembly: reference to an assembly
@@ -3607,17 +4027,11 @@ int
mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
{
MonoImage *image = assembly->image;
- MonoCLIImageInfo *iinfo;
MonoMethod *method;
- MonoObject *exc;
- int rval;
-
- iinfo = image->image_info;
- method = mono_get_method (image, iinfo->cli_cli_header.ch_entry_point, NULL);
- rval = mono_runtime_run_main (method, argc, argv, &exc, assembly);
+ method = mono_get_method (image, mono_image_get_entry_point (image), NULL);
- return rval;
+ return mono_runtime_run_main (method, argc, argv, NULL);
}
#ifdef PLATFORM_WIN32
@@ -3637,9 +4051,7 @@ sigfpe_signal_handler (int _dummy)
exc = mono_get_exception_divide_by_zero ();
- arch_handle_exception (ctx, exc);
-
- g_error ("we should never reach this code");
+ arch_handle_exception (ctx, exc, FALSE);
}
static void
@@ -3647,12 +4059,9 @@ sigill_signal_handler (int _dummy)
{
MonoException *exc;
GET_CONTEXT
-
exc = mono_get_exception_execution_engine ("SIGILL");
- arch_handle_exception (ctx, exc);
-
- g_error ("we should never reach this code");
+ arch_handle_exception (ctx, exc, FALSE);
}
static void
@@ -3663,9 +4072,32 @@ sigsegv_signal_handler (int _dummy)
exc = mono_get_exception_null_reference ();
- arch_handle_exception (ctx, exc);
+ arch_handle_exception (ctx, exc, FALSE);
+}
+
+static void
+sigusr1_signal_handler (int _dummy)
+{
+ MonoThread *thread;
+ GET_CONTEXT
+
+ thread = mono_thread_current ();
+
+ g_assert (thread->abort_exc);
- g_error ("we should never reach this code");
+ arch_handle_exception (ctx, thread->abort_exc, FALSE);
+}
+
+gpointer
+mono_get_lmf_addr (void)
+{
+ MonoJitTlsData *jit_tls;
+
+ if ((jit_tls = TlsGetValue (mono_jit_tls_id)))
+ return &jit_tls->lmf;
+
+ g_assert_not_reached ();
+ return NULL;
}
/**
@@ -3679,21 +4111,16 @@ mono_thread_abort (MonoObject *obj)
{
MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
- g_assert (obj);
-
- if (jit_tls->env) {
- longjmp (*jit_tls->env, (int)obj);
- }
-
g_free (jit_tls);
ExitThread (-1);
}
-
+
static void
-mono_thread_start_cb (gpointer stack_start)
+mono_thread_start_cb (guint32 tid, gpointer stack_start, gpointer func)
{
MonoJitTlsData *jit_tls;
+ MonoLMF *lmf;
jit_tls = g_new0 (MonoJitTlsData, 1);
@@ -3701,6 +4128,41 @@ mono_thread_start_cb (gpointer stack_start)
jit_tls->abort_func = mono_thread_abort;
jit_tls->end_of_stack = stack_start;
+
+ lmf = g_new0 (MonoLMF, 1);
+ lmf->ebp = -1;
+
+ jit_tls->lmf = lmf;
+}
+
+void (*mono_thread_attach_aborted_cb ) (MonoObject *obj) = NULL;
+
+static void
+mono_thread_abort_dummy (MonoObject *obj)
+{
+ if (mono_thread_attach_aborted_cb)
+ mono_thread_attach_aborted_cb (obj);
+ else
+ mono_thread_abort (obj);
+}
+
+static void
+mono_thread_attach_cb (guint32 tid, gpointer stack_start)
+{
+ MonoJitTlsData *jit_tls;
+ MonoLMF *lmf;
+
+ jit_tls = g_new0 (MonoJitTlsData, 1);
+
+ TlsSetValue (mono_jit_tls_id, jit_tls);
+
+ jit_tls->abort_func = mono_thread_abort_dummy;
+ jit_tls->end_of_stack = stack_start;
+
+ lmf = g_new0 (MonoLMF, 1);
+ lmf->ebp = -1;
+
+ jit_tls->lmf = lmf;
}
static CRITICAL_SECTION ms;
@@ -3718,30 +4180,51 @@ mono_runtime_install_handlers (void)
win32_seh_set_handler(SIGILL, sigill_signal_handler);
win32_seh_set_handler(SIGSEGV, sigsegv_signal_handler);
#else /* !PLATFORM_WIN32 */
+
+ /* libpthreads has its own implementation of sigaction(),
+ * but it seems to work well with our current exception
+ * handlers. If not we must call syscall directly instead
+ * of sigaction */
+
/* catch SIGFPE */
sa.sa_handler = sigfpe_signal_handler;
sigemptyset (&sa.sa_mask);
sa.sa_flags = 0;
- g_assert (syscall (SYS_sigaction, SIGFPE, &sa, NULL) != -1);
+ //g_assert (syscall (SYS_sigaction, SIGFPE, &sa, NULL) != -1);
+ g_assert (sigaction (SIGFPE, &sa, NULL) != -1);
/* catch SIGILL */
sa.sa_handler = sigill_signal_handler;
sigemptyset (&sa.sa_mask);
sa.sa_flags = 0;
- g_assert (syscall (SYS_sigaction, SIGILL, &sa, NULL) != -1);
+ //g_assert (syscall (SYS_sigaction, SIGILL, &sa, NULL) != -1);
+ g_assert (sigaction (SIGILL, &sa, NULL) != -1);
+
+ /* catch the thread abort signal */
+ sa.sa_handler = sigusr1_signal_handler;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+ //g_assert (syscall (SYS_sigaction, SIGILL, &sa, NULL) != -1);
+#ifdef __NetBSD__
+ g_assert (sigaction (mono_thread_get_abort_signal (), &sa, NULL) != -1);
+#else
+ g_assert (syscall (SYS_sigaction, mono_thread_get_abort_signal (), &sa, NULL) != -1);
+ //g_assert (sigaction (mono_thread_get_abort_signal (), &sa, NULL) != -1);
+#endif
#if 1
/* catch SIGSEGV */
sa.sa_handler = sigsegv_signal_handler;
sigemptyset (&sa.sa_mask);
sa.sa_flags = 0;
- g_assert (syscall (SYS_sigaction, SIGSEGV, &sa, NULL) != -1);
+ //g_assert (syscall (SYS_sigaction, SIGSEGV, &sa, NULL) != -1);
+ g_assert (sigaction (SIGSEGV, &sa, NULL) != -1);
#endif
#endif /* PLATFORM_WIN32 */
}
MonoDomain*
-mono_jit_init (char *file) {
+mono_jit_init (const char *file) {
MonoDomain *domain;
mono_cpu_detect ();
@@ -3756,20 +4239,34 @@ mono_jit_init (char *file) {
ves_icall_get_frame_info);
mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace",
ves_icall_get_trace);
+ mono_add_internal_call ("Mono.Runtime::mono_runtime_install_handlers", mono_runtime_install_handlers);
metadata_section = &ms;
InitializeCriticalSection (metadata_section);
mono_jit_tls_id = TlsAlloc ();
- mono_thread_start_cb (&file);
+ /* Don't set up the main thread for managed code execution -
+ * this will give a handy assertion fail in
+ * mono_get_lmf_addr() if any buggy runtime code tries to run
+ * managed code in this thread.
+ *
+ * Note, adding static initializer/objects to thread.cs will
+ * also cause mon_get_lmf_addr assertion
+ *
+ */
+ /* mono_thread_start_cb (GetCurrentThreadId (), (gpointer)-1, NULL); */
+
+ mono_install_compile_method (mono_jit_compile_method);
mono_install_trampoline (arch_create_jit_trampoline);
- mono_install_remoting_trampoline (arch_create_remoting_trampoline);
+ mono_install_remoting_trampoline (mono_jit_create_remoting_trampoline);
mono_install_handler (arch_get_throw_exception ());
- mono_install_runtime_invoke (arch_runtime_invoke);
+ mono_install_runtime_invoke (mono_jit_runtime_invoke);
+ mono_install_stack_walk (mono_jit_walk_stack);
+ mono_install_get_config_dir ();
domain = mono_init (file);
- mono_runtime_init (domain, mono_thread_start_cb);
+ mono_runtime_init (domain, mono_thread_start_cb, mono_thread_attach_cb);
return domain;
}
@@ -3777,14 +4274,16 @@ mono_jit_init (char *file) {
void
mono_jit_cleanup (MonoDomain *domain)
{
+ mono_domain_finalize (domain);
+
+ mono_runtime_cleanup (domain);
+
mono_debug_cleanup ();
#ifdef PLATFORM_WIN32
win32_seh_cleanup();
#endif
- mono_runtime_cleanup (domain);
-
mono_domain_unload (domain, TRUE);
if (mono_jit_stats.enabled) {
@@ -3818,3 +4317,36 @@ mono_jit_cleanup (MonoDomain *domain)
}
+/**
+ * mono_jit_image:
+ * @image: reference to an image
+ * @verbose: If true, print debugging information on stdout.
+ *
+ * JIT compilation of all methods in the image.
+ */
+void
+mono_jit_compile_image (MonoImage *image, int verbose)
+{
+ MonoMethod *method;
+ MonoTableInfo *t = &image->tables [MONO_TABLE_METHOD];
+ int i;
+
+ for (i = 0; i < t->rows; i++) {
+
+ method = mono_get_method (image,
+ (MONO_TABLE_METHOD << 24) | (i + 1),
+ NULL);
+
+ if (verbose)
+ g_print ("Compiling: %s:%s\n\n", image->assembly_name, method->name);
+
+ if (method->flags & METHOD_ATTRIBUTE_ABSTRACT) {
+ if (verbose)
+ printf ("ABSTARCT\n");
+ } else
+ mono_compile_method (method);
+
+ }
+
+}
+
diff --git a/mono/jit/jit.h b/mono/jit/jit.h
index 5ee35781539..a1deac973e3 100644
--- a/mono/jit/jit.h
+++ b/mono/jit/jit.h
@@ -8,14 +8,13 @@
#ifndef _MONO_JIT_JIT_H_
#define _MONO_JIT_JIT_H_
-#include <config.h>
/*
* io-layer.h must be _BEFORE_ win32-exception.h to avoid problems when
* compiling with version 1.2 of mingw and w32api.
*/
#include <mono/io-layer/io-layer.h>
-#ifdef PLATFORM_WIN32
+#ifdef __WIN32__
#include "win32-exception.h"
#else
#include <signal.h>
@@ -43,12 +42,13 @@
#define MB_TERM_REMOTE_STIND_REF MB_TERM_REMOTE_STIND_I4
#endif
-#define ISSTRUCT(t) (!t->byref && t->type == MONO_TYPE_VALUETYPE && !t->data.klass->enumtype)
-
#define VARINFO(cfg,num) (g_array_index (cfg->varinfo, MonoVarInfo, num))
#define SET_VARINFO(vi,t,k,o,s) do { vi.type=t; vi.vartype=k; vi.offset=o; vi.size=s; } while (0)
+extern int mono_exc_esp_offset;
+
+extern void (*mono_thread_attach_aborted_cb ) (MonoObject *obj);
typedef struct _MBTree MBTree;
@@ -90,12 +90,12 @@ typedef struct {
} MonoLiveRange;
typedef struct {
- MonoValueType type;
- MonoVarType vartype;
+ MonoValueType type:4;
+ MonoVarType vartype:4;
+ unsigned isvolatile:1;
int offset;
int size;
MonoLiveRange range;
- unsigned isvolatile:1;
int reg;
int varnum; /* only for debugging */
} MonoVarInfo;
@@ -153,9 +153,9 @@ typedef struct {
MonoBytecodeInfo *bcinfo;
MonoBBlock *bblocks;
int block_count;
+
GArray *varinfo;
gint32 locals_size;
- gint32 args_size;
guint16 *intvars;
guint16 excvar;
@@ -165,6 +165,7 @@ typedef struct {
gint32 code_size;
gint32 prologue_end;
gint32 epilogue_end;
+ gint32 lmfip_offset;
MonoRegSet *rs;
guint32 epilog;
guint32 args_start_index;
@@ -175,9 +176,9 @@ typedef struct {
} MonoFlowGraph;
typedef struct {
- gint16 args_size;
- gint16 vtype_num;
-} MonoJitCallInfo;
+ gpointer p;
+ MonoMethod *method;
+} MonoJitNonVirtualCallInfo;
typedef struct {
MonoClass *klass;
@@ -190,6 +191,18 @@ typedef struct {
} MonoJitBranchInfo;
typedef struct {
+ guint16 size;
+ guint16 offset;
+ guint8 pad;
+} MonoJitArgumentInfo;
+
+typedef struct {
+ guint16 vtype_num;
+ guint16 frame_size;
+ guint8 pad;
+} MonoJitCallInfo;
+
+typedef struct {
gulong methods_compiled;
gulong methods_lookups;
gulong method_trampolines;
@@ -212,7 +225,6 @@ typedef struct {
typedef struct {
gpointer end_of_stack;
- jmp_buf *env;
MonoLMF *lmf;
void (*abort_func) (MonoObject *object);
} MonoJitTlsData;
@@ -228,15 +240,15 @@ extern gboolean mono_use_linear_scan;
extern gboolean mono_use_fast_iconv;
extern gboolean mono_break_on_exc;
extern gboolean mono_inline_memcpy;
-
extern guint32 mono_jit_tls_id;
+extern gboolean mono_jit_boundcheck;
extern CRITICAL_SECTION *metadata_section;
/* architecture independent functions */
MonoDomain *
-mono_jit_init (char *file);
+mono_jit_init (const char *file);
int
mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly,
@@ -250,18 +262,29 @@ mono_jit_compile_image (MonoImage *image, int verbose);
void
mono_jit_compile_class (MonoAssembly *assembly, char *compile_class,
int compile_times, int verbose);
+
+gpointer
+mono_jit_create_remoting_trampoline (MonoMethod *method);
+
void
mono_add_jump_info (MonoFlowGraph *cfg, gpointer ip,
MonoJumpInfoType type, gpointer target);
gpointer
-mono_compile_method (MonoMethod *method);
+mono_get_lmf_addr (void);
void
mono_cpu_detect (void);
/* architecture dependent functions */
+void
+mono_jit_walk_stack (MonoStackWalk func, gpointer user_data);
+
+int
+arch_get_argument_info (MonoMethodSignature *csig, int param_count,
+ MonoJitArgumentInfo *arg_info);
+
MonoBoolean
ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
MonoReflectionMethod **method,
@@ -272,8 +295,8 @@ MonoArray *
ves_icall_get_trace (MonoException *exc, gint32 skip,
MonoBoolean need_file_info);
-void
-arch_handle_exception (struct sigcontext *ctx, gpointer obj);
+gboolean
+arch_handle_exception (struct sigcontext *ctx, gpointer obj, gboolean test_only);
gpointer
arch_get_throw_exception (void);
@@ -287,14 +310,8 @@ arch_jit_compile_cfg (MonoDomain *target_domain, MonoFlowGraph *cfg);
gpointer
arch_create_jit_trampoline (MonoMethod *method);
-gpointer
-arch_create_remoting_trampoline (MonoMethod *method);
-
-MonoObject*
-arch_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc);
-
-gpointer
-arch_create_native_wrapper (MonoMethod *method);
+int
+arch_allocate_arg (MonoFlowGraph *cfg, MonoJitArgumentInfo *info, MonoValueType type);
int
arch_allocate_var (MonoFlowGraph *cfg, int size, int align,
@@ -303,40 +320,16 @@ arch_allocate_var (MonoFlowGraph *cfg, int size, int align,
void
mono_linear_scan (MonoFlowGraph *cfg, guint32 *used_mask);
-gpointer
-arch_get_lmf_addr (void);
-
-char *
+const char *
arch_get_reg_name (int regnum);
-/* delegate support functions */
-
-gpointer
-arch_get_delegate_begin_invoke (MonoMethod *method);
-
-void
-arch_end_invoke (MonoMethod *method, gpointer first_arg, ...);
+int
+arch_activation_frame_size (MonoMethodSignature *sig);
-gpointer
-arch_get_delegate_invoke (MonoMethod *method);
-
-/* remoting support */
-
-gpointer
-mono_load_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer *res);
-
-void
-mono_store_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer val);
-
-/* stack/message transition */
-
-MonoMethodMessage *
-arch_method_call_message_new (MonoMethod *method, gpointer stack, MonoMethod *invoke,
- MonoDelegate **cb, MonoObject **state);
-
-void
-arch_method_return_message_restore (MonoMethod *method, gpointer stack,
- MonoObject *result, MonoArray *out_args);
+gboolean
+mono_has_unwind_info (MonoMethod *method);
+gboolean
+mono_method_blittable (MonoMethod *method);
#endif
diff --git a/mono/jit/ldscript b/mono/jit/ldscript
new file mode 100644
index 00000000000..6910c888b07
--- /dev/null
+++ b/mono/jit/ldscript
@@ -0,0 +1,6 @@
+VER_1 {
+ global:
+ mono_*;
+ local:
+ *;
+};
diff --git a/mono/jit/linear-scan.c b/mono/jit/linear-scan.c
index b04f2eb8e27..7d2366ad295 100644
--- a/mono/jit/linear-scan.c
+++ b/mono/jit/linear-scan.c
@@ -13,7 +13,6 @@
#include "jit.h"
#include "codegen.h"
-#include "debug.h"
//#define MNAME "nest_test"
@@ -191,7 +190,8 @@ mono_analyze_liveness (MonoFlowGraph *cfg)
do {
changes = FALSE;
- for (i = 0; i < cfg->block_count; i++) {
+
+ for (i = cfg->block_count - 1; i >= 0; i--) {
MonoBBlock *bb = &cfg->bblocks [i];
mono_bitset_copyto (bb->live_in_set, old_live_in_set);
diff --git a/mono/jit/message.c b/mono/jit/message.c
deleted file mode 100644
index 5cb85fe4c73..00000000000
--- a/mono/jit/message.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * message.c: stack <-> message translation
- *
- * Author:
- * Dietmar Maurer (dietmar@ximian.com)
- *
- * (C) 2001 Ximian, Inc.
- */
-
-#include <config.h>
-#include <string.h>
-
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/tabledefs.h>
-
-#include "jit.h"
-
-static void
-arch_return_value (MonoType *return_type, MonoObject *result, gpointer stack)
-{
- gpointer resp, vt_resp;
- int type;
-
- resp = &result;
- vt_resp = (char *)result + sizeof (MonoObject);
-
- if (return_type->byref) {
- asm ("movl (%0),%%eax" : : "r" (resp) : "eax");
- return;
- }
-
- type = return_type->type;
- handle_enum:
- switch (type) {
- case MONO_TYPE_VOID:
- /* nothing to do */
- break;
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_U2:
- case MONO_TYPE_I2:
- case MONO_TYPE_CHAR:
-#if SIZEOF_VOID_P == 4
- case MONO_TYPE_U:
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U4:
- case MONO_TYPE_I4:
- asm ("movl (%0),%%eax" : : "r" (vt_resp) : "eax");
- break;
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- asm ("movl (%0),%%eax" : : "r" (resp) : "eax");
- break;
-#if SIZEOF_VOID_P == 8
- case MONO_TYPE_U:
- case MONO_TYPE_I:
-#endif
- case MONO_TYPE_U8:
- case MONO_TYPE_I8:
- asm ("movl 0(%0),%%eax;"
- "movl 4(%0),%%edx"
- : : "r"(vt_resp)
- : "eax", "edx");
- break;
- case MONO_TYPE_R4:
- asm ("fld (%0)" : : "r" (vt_resp) : "st", "st(1)" );
- break;
- case MONO_TYPE_R8:
- asm ("fldl (%0)" : : "r" (vt_resp) : "st", "st(1)" );
- break;
- case MONO_TYPE_VALUETYPE:
- if (return_type->data.klass->enumtype) {
- type = return_type->data.klass->enum_basetype->type;
- goto handle_enum;
- } else {
- memcpy (*((gpointer *)stack), vt_resp,
- mono_class_value_size (return_type->data.klass, NULL));
- }
- break;
- default:
- g_error ("type 0x%x not handled in remoting invoke", return_type->type);
-
- }
-}
-
-/**
- * arch_method_return_message_restore:
- * @method: method info
- * @stack: pointer to the stack arguments
- * @result: result to restore
- * @out_args: out arguments to restore
- *
- * Restore results from message based processing back to the stack.
- */
-void
-arch_method_return_message_restore (MonoMethod *method, gpointer stack,
- MonoObject *result, MonoArray *out_args)
-{
- MonoMethodSignature *sig = method->signature;
- MonoClass *class;
- int i, j, type, size, align;
- char *cpos = stack;
-
- if (ISSTRUCT (sig->ret))
- cpos += 4;
-
- if (sig->hasthis)
- cpos += 4;
-
- for (i = 0, j = 0; i < sig->param_count; i++) {
- size = mono_type_stack_size (sig->params [i], &align);
-
- if (sig->params [i]->byref) {
- char *arg = mono_array_get (out_args, gpointer, j);
- type = sig->params [i]->type;
- class = mono_class_from_mono_type (sig->params [i]);
-
- switch (type) {
- case MONO_TYPE_VOID:
- g_assert_not_reached ();
- break;
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_U2:
- case MONO_TYPE_I2:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_U4:
- case MONO_TYPE_I4:
- case MONO_TYPE_I8:
- case MONO_TYPE_U8:
- case MONO_TYPE_R4:
- case MONO_TYPE_R8:
- case MONO_TYPE_VALUETYPE: {
- memcpy (*((gpointer *)cpos), arg + sizeof (MonoObject), size);
- break;
- }
- case MONO_TYPE_STRING:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
- *((MonoObject **)cpos) = (MonoObject *)arg;
- break;
- default:
- g_assert_not_reached ();
- }
-
- j++;
- }
-
- cpos += size;
- }
-
- arch_return_value (sig->ret, result, stack);
-}
-
-/**
- * arch_method_call_message_new:
- * @method: method info
- * @stack: pointer to the stack arguments
- *
- * Translates arguments on the stack into a Message.
- */
-
-MonoMethodMessage *
-arch_method_call_message_new (MonoMethod *method, gpointer stack, MonoMethod *invoke,
- MonoDelegate **cb, MonoObject **state)
-{
- MonoDomain *domain = mono_domain_get ();
- MonoMethodSignature *sig = method->signature;
- MonoMethodMessage *msg;
- int i, count, type, size, align;
- char *cpos = stack;
-
- msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
-
- if (invoke) {
- mono_message_init (domain, msg, mono_method_get_object (domain, invoke), NULL);
- count = sig->param_count - 2;
- } else {
- mono_message_init (domain, msg, mono_method_get_object (domain, method), NULL);
- count = sig->param_count;
- }
- /* the first argument is an implizit reference for valuetype
- * return values */
- if (!invoke && ISSTRUCT (sig->ret))
- cpos += 4;
-
- if (sig->hasthis)
- cpos += 4;
-
-
- for (i = 0; i < count; i++) {
- gpointer vpos;
- MonoClass *class;
- MonoObject *arg;
-
- size = mono_type_stack_size (sig->params [i], &align);
-
- if (sig->params [i]->byref)
- vpos = *((gpointer *)cpos);
- else
- vpos = cpos;
-
- type = sig->params [i]->type;
- class = mono_class_from_mono_type (sig->params [i]);
-
- if (class->valuetype)
- arg = mono_value_box (domain, class, vpos);
- else
- arg = *((MonoObject **)vpos);
-
- mono_array_set (msg->args, gpointer, i, arg);
- cpos += size;
- }
-
- if (invoke) {
- *cb = *((MonoDelegate **)cpos);
- cpos += sizeof (MonoObject *);
- *state = *((MonoObject **)cpos);
- }
-
- return msg;
-}
-
-/**
- * mono_load_remote_field:
- * @this: pointer to an object
- * @klass: klass of the object containing @field
- * @field: the field to load
- * @res: a storage to store the result
- *
- * This method is called by the runtime on attempts to load fields of
- * transparent proxy objects. @this points to such TP, @klass is the class of
- * the object containing @field. @res is only a storage location which can be
- * used to store the result.
- *
- * Returns: an address pointing to the value of field.
- */
-gpointer
-mono_load_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer *res)
-{
- static MonoMethod *getter = NULL;
- MonoDomain *domain = mono_domain_get ();
- MonoClass *field_class;
- MonoMethodMessage *msg;
- MonoArray *out_args;
- MonoObject *exc;
-
- g_assert (this->vtable->klass == mono_defaults.transparent_proxy_class);
-
- if (!getter) {
- int i;
-
- for (i = 0; i < mono_defaults.object_class->method.count; ++i) {
- MonoMethod *cm = mono_defaults.object_class->methods [i];
-
- if (!strcmp (cm->name, "FieldGetter")) {
- getter = cm;
- break;
- }
- }
- g_assert (getter);
- }
-
- field_class = mono_class_from_mono_type (field->type);
-
- msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
- out_args = mono_array_new (domain, mono_defaults.object_class, 1);
- mono_message_init (domain, msg, mono_method_get_object (domain, getter), out_args);
-
- mono_array_set (msg->args, gpointer, 0, mono_string_new (domain, klass->name));
- mono_array_set (msg->args, gpointer, 1, mono_string_new (domain, field->name));
-
- mono_remoting_invoke ((MonoObject *)((MonoTransparentProxy *)this)->rp, msg, &exc, &out_args);
-
- *res = mono_array_get (out_args, MonoObject *, 0);
-
- if (field_class->valuetype) {
- return ((char *)*res) + sizeof (MonoObject);
- } else
- return res;
-}
-
-/**
- * mono_store_remote_field:
- * @this: pointer to an object
- * @klass: klass of the object containing @field
- * @field: the field to load
- * @val: the value/object to store
- *
- * This method is called by the runtime on attempts to store fields of
- * transparent proxy objects. @this points to such TP, @klass is the class of
- * the object containing @field. @val is the new value to store in @field.
- */
-void
-mono_store_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer val)
-{
- static MonoMethod *setter = NULL;
- MonoDomain *domain = mono_domain_get ();
- MonoClass *field_class;
- MonoMethodMessage *msg;
- MonoArray *out_args;
- MonoObject *exc;
- MonoObject *arg;
-
- g_assert (this->vtable->klass == mono_defaults.transparent_proxy_class);
-
- if (!setter) {
- int i;
-
- for (i = 0; i < mono_defaults.object_class->method.count; ++i) {
- MonoMethod *cm = mono_defaults.object_class->methods [i];
-
- if (!strcmp (cm->name, "FieldSetter")) {
- setter = cm;
- break;
- }
- }
- g_assert (setter);
- }
-
- field_class = mono_class_from_mono_type (field->type);
-
- if (field_class->valuetype)
- arg = mono_value_box (domain, field_class, val);
- else
- arg = *((MonoObject **)val);
-
-
- msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
- mono_message_init (domain, msg, mono_method_get_object (domain, setter), NULL);
-
- mono_array_set (msg->args, gpointer, 0, mono_string_new (domain, klass->name));
- mono_array_set (msg->args, gpointer, 1, mono_string_new (domain, field->name));
- mono_array_set (msg->args, gpointer, 2, arg);
-
- mono_remoting_invoke ((MonoObject *)((MonoTransparentProxy *)this)->rp, msg, &exc, &out_args);
-}
-
diff --git a/mono/jit/mono.c b/mono/jit/mono.c
index 12d02a87b9e..78b3c592fc4 100644
--- a/mono/jit/mono.c
+++ b/mono/jit/mono.c
@@ -9,47 +9,17 @@
#include "jit.h"
#include "regset.h"
#include "codegen.h"
-#include "debug.h"
#include "mono/metadata/debug-helpers.h"
#include "mono/metadata/verify.h"
#include "mono/metadata/profiler.h"
#include "mono/metadata/threadpool.h"
#include "mono/metadata/mono-config.h"
#include <mono/metadata/profiler-private.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
#include <mono/os/util.h>
-
-/**
- * mono_jit_image:
- * @image: reference to an image
- * @verbose: If true, print debugging information on stdout.
- *
- * JIT compilation of all methods in the image.
- */
-void
-mono_jit_compile_image (MonoImage *image, int verbose)
-{
- MonoMethod *method;
- MonoTableInfo *t = &image->tables [MONO_TABLE_METHOD];
- int i;
-
- for (i = 0; i < t->rows; i++) {
-
- method = mono_get_method (image,
- (MONO_TABLE_METHOD << 24) | (i + 1),
- NULL);
-
- if (verbose)
- g_print ("Compiling: %s:%s\n\n", image->assembly_name, method->name);
-
- if (method->flags & METHOD_ATTRIBUTE_ABSTRACT) {
- if (verbose)
- printf ("ABSTARCT\n");
- } else
- mono_compile_method (method);
-
- }
-
-}
+#include <locale.h>
static MonoClass *
find_class_in_assembly (MonoAssembly *assembly, const char *namespace, const char *name)
@@ -186,18 +156,15 @@ usage (char *name)
" namespace.name:method compile the given method\n"
" @imagename compile the given image\n"
" --ncompile NUM compile methods NUM times (default: 1000)\n"
+ " --noboundcheck Disables bound checks\n"
"\n"
"Development:\n"
- " --debug[=FORMAT] write a debugging file. FORMAT is one of:\n"
- " stabs to write stabs information\n"
- " dwarf to write dwarf2 information\n"
- " dwarf-plus to write extended dwarf2 information\n"
- " --debug-args ARGS comma-separated list of additional arguments for the\n"
- " symbol writer. See the manpage for details.\n"
+ " --debug enable debugging support.\n"
" --profile record and dump profile info\n"
" --breakonex set a breakpoint for unhandled exception\n"
" --break NAME insert a breakpoint at the start of method NAME\n"
- " (NAME is in `namespace.name:methodname' format)\n"
+ " (NAME is in `namespace.name:methodname' format\n"
+ " or `Main' to break on the application's main method)\n"
" --precompile name precompile NAME before executing the main application:\n"
" NAME is in one of the following formats:\n"
" namespace.name compile the given class\n"
@@ -216,20 +183,81 @@ usage (char *name)
exit (1);
}
+typedef struct
+{
+ MonoDomain *domain;
+ char *file;
+ gboolean testjit;
+ gboolean enable_debugging;
+ char *compile_class;
+ int compile_times;
+ GList *precompile_classes;
+ int verbose;
+ int break_on_main;
+ int argc;
+ char **argv;
+} MainThreadArgs;
+
+static void main_thread_handler (gpointer user_data)
+{
+ MainThreadArgs *main_args=(MainThreadArgs *)user_data;
+ MonoAssembly *assembly;
+
+ if (main_args->enable_debugging)
+ mono_debug_init (MONO_DEBUG_FORMAT_MONO);
+
+ assembly = mono_domain_assembly_open (main_args->domain,
+ main_args->file);
+ if (!assembly){
+ fprintf (stderr, "Can not open image %s\n", main_args->file);
+ exit (1);
+ }
+
+ if (main_args->enable_debugging)
+ mono_debug_init_2 (assembly);
+
+ if (main_args->testjit) {
+ mono_jit_compile_image (assembly->image, TRUE);
+ } else if (main_args->compile_class) {
+ mono_jit_compile_class (assembly, main_args->compile_class, main_args->compile_times, TRUE);
+ } else {
+ GList *tmp;
+
+ for (tmp = main_args->precompile_classes; tmp; tmp = tmp->next)
+ mono_jit_compile_class (assembly, tmp->data, 1,
+ main_args->verbose);
+
+ if (main_args->break_on_main) {
+ MonoImage *image = assembly->image;
+ MonoMethodDesc *desc;
+ MonoMethod *method;
+
+ method = mono_get_method (image, mono_image_get_entry_point (image), NULL);
+ desc = mono_method_desc_from_method (method);
+ mono_debugger_insert_breakpoint_full (desc);
+ }
+
+ mono_jit_exec (main_args->domain, assembly, main_args->argc,
+ main_args->argv);
+ }
+}
+
int
main (int argc, char *argv [])
{
MonoDomain *domain;
- MonoAssembly *assembly;
int retval = 0, i;
int compile_times = 1000;
char *compile_class = NULL;
- char *debug_args = NULL;
+ gboolean enable_debugging = FALSE;
char *file, *error, *config_file = NULL;
gboolean testjit = FALSE;
int verbose = FALSE;
GList *precompile_classes = NULL;
-
+ int break_on_main = FALSE;
+ MainThreadArgs main_args;
+
+ setlocale(LC_ALL, "");
g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
@@ -255,6 +283,8 @@ main (int argc, char *argv [])
mono_jit_inline_code = FALSE;
else if (strcmp (argv [i], "--nointrinsic") == 0)
mono_inline_memcpy = FALSE;
+ else if (strcmp (argv [i], "--noboundcheck") == 0)
+ mono_jit_boundcheck = FALSE;
else if (strcmp (argv [i], "--nols") == 0)
mono_use_linear_scan = FALSE;
else if (strcmp (argv [i], "--breakonex") == 0)
@@ -262,10 +292,13 @@ main (int argc, char *argv [])
else if (strcmp (argv [i], "--print-vtable") == 0)
mono_print_vtable = TRUE;
else if (strcmp (argv [i], "--break") == 0) {
- MonoMethodDesc *desc = mono_method_desc_new (argv [++i], FALSE);
- if (!desc)
- g_error ("Invalid method name '%s'", argv [i]);
- mono_debug_methods = g_list_append (mono_debug_methods, desc);
+ if (!strcmp (argv [i+1], "Main")) {
+ break_on_main = TRUE;
+ i++;
+ } else {
+ if (!mono_debugger_insert_breakpoint (argv [++i], FALSE))
+ g_error ("Invalid method name '%s'", argv [i]);
+ }
} else if (strcmp (argv [i], "--count") == 0) {
compile_times = atoi (argv [++i]);
} else if (strcmp (argv [i], "--config") == 0) {
@@ -284,27 +317,8 @@ main (int argc, char *argv [])
} else if (strcmp (argv [i], "--stats") == 0) {
memset (&mono_jit_stats, 0, sizeof (MonoJitStats));
mono_jit_stats.enabled = TRUE;
- } else if (strncmp (argv [i], "--debug=", 8) == 0) {
- const char *format = &argv [i][8];
-
- if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
- g_error ("You can only use one debugging format.");
- if (strcmp (format, "stabs") == 0)
- mono_debug_format = MONO_DEBUG_FORMAT_STABS;
- else if (strcmp (format, "dwarf") == 0)
- mono_debug_format = MONO_DEBUG_FORMAT_DWARF2;
- else if (strcmp (format, "dwarf-plus") == 0)
- mono_debug_format = MONO_DEBUG_FORMAT_DWARF2_PLUS;
- else
- g_error ("Unknown debugging format: %s", argv [i] + 8);
} else if (strcmp (argv [i], "--debug") == 0) {
- if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
- g_error ("You can only use one debugging format.");
- mono_debug_format = MONO_DEBUG_FORMAT_DWARF2_PLUS;
- } else if (strcmp (argv [i], "--debug-args") == 0) {
- if (debug_args)
- g_error ("You can use --debug-args only once.");
- debug_args = argv [++i];
+ enable_debugging = TRUE;
} else if (strcmp (argv [i], "--precompile") == 0) {
precompile_classes = g_list_append (precompile_classes, argv [++i]);
} else if (strcmp (argv [i], "--verbose") == 0) {
@@ -320,8 +334,10 @@ main (int argc, char *argv [])
if (!file)
usage (argv [0]);
+ g_set_prgname (file);
mono_config_parse (config_file);
- mono_set_rootdir (argv [0]);
+ mono_set_rootdir ();
+
domain = mono_jit_init (file);
error = mono_verify_corlib ();
@@ -329,41 +345,27 @@ main (int argc, char *argv [])
fprintf (stderr, "Corlib not in sync with this runtime: %s\n", error);
exit (1);
}
-
- assembly = mono_domain_assembly_open (domain, file);
- if (!assembly){
- fprintf (stderr, "Can not open image %s\n", file);
- exit (1);
- }
-
- if (mono_debug_format != MONO_DEBUG_FORMAT_NONE) {
- MonoDebugHandle *debug;
- gchar **args;
-
- args = g_strsplit (debug_args ? debug_args : "", ",", -1);
- debug = mono_debug_open (assembly, mono_debug_format, (const char **) args);
- mono_debug_add_image (debug, assembly->image);
- g_strfreev (args);
- }
-
- if (testjit) {
- mono_jit_compile_image (assembly->image, TRUE);
- } else if (compile_class) {
- mono_jit_compile_class (assembly, compile_class, compile_times, TRUE);
- } else {
- GList *tmp;
-
- for (tmp = precompile_classes; tmp; tmp = tmp->next)
- mono_jit_compile_class (assembly, tmp->data, 1, verbose);
-
- retval = mono_jit_exec (domain, assembly, argc - i, argv + i);
- printf ("RESULT: %d\n", retval);
- }
+
+ main_args.domain=domain;
+ main_args.file=file;
+ main_args.testjit=testjit;
+ main_args.enable_debugging=enable_debugging;
+ main_args.compile_class=compile_class;
+ main_args.compile_times=compile_times;
+ main_args.precompile_classes=precompile_classes;
+ main_args.verbose=verbose;
+ main_args.break_on_main=break_on_main;
+ main_args.argc=argc-i;
+ main_args.argv=argv+i;
+
+ mono_runtime_exec_managed_code (domain, main_thread_handler,
+ &main_args);
mono_profiler_shutdown ();
mono_jit_cleanup (domain);
+ /* Look up return value from System.Environment.ExitCode */
+ retval=mono_environment_exitcode_get ();
+
return retval;
}
-
-
diff --git a/mono/jit/trampoline.c b/mono/jit/trampoline.c
index 9f0e102b372..5bbfd7fb3d3 100644
--- a/mono/jit/trampoline.c
+++ b/mono/jit/trampoline.c
@@ -13,43 +13,16 @@
#include <mono/metadata/appdomain.h>
#include <mono/metadata/tabledefs.h>
#include <mono/arch/x86/x86-codegen.h>
+#include <mono/metadata/mono-debug-debugger.h>
#include "jit.h"
#include "codegen.h"
-static void
-arch_remoting_invoke (MonoMethod *method, gpointer ip, gpointer first_arg)
-{
- MonoMethodSignature *sig = method->signature;
- MonoMethodMessage *msg;
- MonoTransparentProxy *this;
- MonoObject *res, *exc;
- MonoArray *out_args;
- int this_pos = 0;
-
- //printf ("REMOTING %s.%s:%s\n", method->klass->name_space, method->klass->name,
- //method->name);
-
- if (ISSTRUCT (sig->ret))
- this_pos += 4;
-
- this = *(MonoTransparentProxy **)(((char *)&first_arg) + this_pos);
-
- g_assert (((MonoObject *)this)->vtable->klass == mono_defaults.transparent_proxy_class);
-
- msg = arch_method_call_message_new (method, &first_arg, NULL, NULL, NULL);
-
- res = mono_remoting_invoke ((MonoObject *)this->rp, msg, &exc, &out_args);
-
- if (exc)
- mono_raise_exception ((MonoException *)exc);
-
- arch_method_return_message_restore (method, &first_arg, res, out_args);
-
- /* WARNING: do not write any code here, because that would destroy
- * the return value
- */
-}
+/*
+ * Address of the x86 trampoline code. This is used by the debugger to check
+ * whether a method is a trampoline.
+ */
+guint8 *mono_generic_trampoline_code = NULL;
/*
* get_unbox_trampoline:
@@ -131,8 +104,8 @@ x86_magic_trampoline (int eax, int ecx, int edx, int esi, int edi,
*((guint32*)(code + 2)) = (guint)addr - ((guint)code + 1) - 5;
return addr;
} else {
- printf ("%x %x %x %x %x %x \n", code [0], code [1], code [2], code [3],
- code [4], code [5]);
+ printf ("Invalid trampoline sequence: %x %x %x %x %x %x %x\n", code [0], code [1], code [2], code [3],
+ code [4], code [5], code [6]);
g_assert_not_reached ();
}
}
@@ -183,10 +156,7 @@ x86_magic_trampoline (int eax, int ecx, int edx, int esi, int edi,
gpointer
arch_create_jit_trampoline (MonoMethod *method)
{
- MonoDomain *domain = mono_domain_get ();
guint8 *code, *buf;
- static guint8 *vc = NULL;
- GHashTable *jit_code_hash;
/* previously created trampoline code */
if (method->info)
@@ -201,23 +171,26 @@ arch_create_jit_trampoline (MonoMethod *method)
/* icalls use method->addr */
if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
- method->info = arch_create_native_wrapper (method);
+ MonoMethod *nm;
+
+ if (!method->addr && (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ mono_lookup_pinvoke_call (method);
+
+#ifdef MONO_USE_EXC_TABLES
+ if (mono_method_blittable (method)) {
+ method->info = method->addr;
+ } else {
+#endif
+ nm = mono_marshal_get_native_wrapper (method);
+ method->info = mono_compile_method (nm);
+#ifdef MONO_USE_EXC_TABLES
+ }
+#endif
return method->info;
}
- /* check if we already have JITed code */
- if (mono_jit_share_code)
- jit_code_hash = mono_root_domain->jit_code_hash;
- else
- jit_code_hash = domain->jit_code_hash;
-
- if ((code = g_hash_table_lookup (jit_code_hash, method))) {
- mono_jit_stats.methods_lookups++;
- return code;
- }
-
- if (!vc) {
- vc = buf = g_malloc (256);
+ if (!mono_generic_trampoline_code) {
+ mono_generic_trampoline_code = buf = g_malloc (256);
/* save caller save regs because we need to do a call */
x86_push_reg (buf, X86_EDX);
x86_push_reg (buf, X86_EAX);
@@ -236,7 +209,7 @@ arch_create_jit_trampoline (MonoMethod *method)
/* save method info */
x86_push_membase (buf, X86_ESP, 32);
/* get the address of lmf for the current thread */
- x86_call_code (buf, arch_get_lmf_addr);
+ x86_call_code (buf, mono_get_lmf_addr);
/* push lmf */
x86_push_reg (buf, X86_EAX);
/* push *lfm (previous_lmf) */
@@ -284,12 +257,12 @@ arch_create_jit_trampoline (MonoMethod *method)
/* call the compiled method */
x86_jump_reg (buf, X86_EAX);
- g_assert ((buf - vc) <= 256);
+ g_assert ((buf - mono_generic_trampoline_code) <= 256);
}
code = buf = g_malloc (16);
x86_push_imm (buf, method);
- x86_jump_code (buf, vc);
+ x86_jump_code (buf, mono_generic_trampoline_code);
g_assert ((buf - code) <= 16);
/* store trampoline address */
@@ -299,43 +272,3 @@ arch_create_jit_trampoline (MonoMethod *method)
return code;
}
-
-/* arch_create_remoting_trampoline:
- * @method: pointer to the method info
- *
- * Creates a trampoline which calls the remoting functions. This
- * is used in the vtable of transparent proxies.
- *
- * Returns: a pointer to the newly created code
- */
-gpointer
-arch_create_remoting_trampoline (MonoMethod *method)
-{
- MonoJitInfo *ji;
- guint8 *code, *buf;
-
- if (method->remoting_tramp)
- return method->remoting_tramp;
-
- code = buf = g_malloc (16);
- x86_push_imm (buf, method);
- x86_call_code (buf, arch_remoting_invoke);
- x86_alu_reg_imm (buf, X86_ADD, X86_ESP, 4);
- x86_ret (buf);
-
- g_assert ((buf - code) <= 16);
-
- method->remoting_tramp = code;
-
- /* we store a jit info, so that mono_delegate_ctor
- * is able to find a method info */
- ji = mono_mempool_alloc0 (mono_root_domain->mp, sizeof (MonoJitInfo));
- ji->method = method;
- ji->code_start = code;
- ji->code_size = buf - code;
- ji->used_regs = 0;
- ji->num_clauses = 0;
- mono_jit_info_table_add (mono_root_domain, ji);
-
- return code;
-}
diff --git a/mono/jit/x86.brg b/mono/jit/x86.brg
index eebddbdd795..3f2b2e2267f 100644
--- a/mono/jit/x86.brg
+++ b/mono/jit/x86.brg
@@ -3,6 +3,7 @@
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
*
* (C) 2001 Ximian, Inc.
*/
@@ -24,6 +25,8 @@
#include <mono/metadata/object.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/threads.h>
#include <mono/arch/x86/x86-codegen.h>
#include "regset.h"
@@ -41,6 +44,9 @@ enum {
};
#undef OPDEF
+/* alignment of activation frames */
+#define MONO_FRAME_ALIGNMENT 4
+
void print_lmf (void);
#define MBTREE_TYPE MBTree
@@ -90,9 +96,11 @@ struct _MBTree {
MonoClass *klass;
MonoClassField *field;
X86AddressInfo ainfo;
- MonoJitCallInfo ci;
MonoJitFieldInfo fi;
MonoJitBranchInfo bi;
+ MonoJitCallInfo call_info;
+ MonoJitArgumentInfo arg_info;
+ MonoJitNonVirtualCallInfo nonvirt_info;
} data;
};
@@ -109,8 +117,10 @@ gpointer mono_ldvirtftn (MonoObject *this, int slot);
gpointer mono_ldintftn (MonoObject *this, int slot);
gpointer mono_ldftn (MonoMethod *method);
-void mono_emit_fast_iconv(MBCGEN_TYPE* s, MBTREE_TYPE* tree);
-void mono_emit_fast_iconv_i8(MBCGEN_TYPE* s, MBTREE_TYPE* tree);
+void mono_emit_fast_iconv (MBCGEN_TYPE* s, MBTREE_TYPE* tree);
+void mono_emit_fast_iconv_i8 (MBCGEN_TYPE* s, MBTREE_TYPE* tree);
+void mono_emit_stack_alloc (MBCGEN_TYPE* s, MBTREE_TYPE* tree);
+void mono_emit_stack_alloc_const (MBCGEN_TYPE* s, MBTREE_TYPE* tree, int size);
MonoArray*
mono_array_new_wrapper (MonoClass *eclass, guint32 n);
@@ -158,7 +168,7 @@ void *
debug_memcopy (void *dest, const void *src, size_t n);
#ifdef DEBUG
-#define MEMCOPY debug_memcpy
+#define MEMCOPY debug_memcopy
#define PRINT_REG(text,reg) REAL_PRINT_REG(text,reg)
#else
@@ -190,6 +200,36 @@ debug_memcopy (void *dest, const void *src, size_t n);
x86_call_code (s->code, 0); \
} while (0);
+#define X86_ARG_PAD(pad) do { \
+ if (pad) { \
+ if (pad == 4) \
+ x86_push_reg (s->code, X86_EAX); \
+ else \
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, pad); \
+ } \
+} while (0)
+
+#define X86_CALL_END do { \
+ int size = tree->data.call_info.frame_size; \
+ if (size) \
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, size); \
+} while (0)
+
+#define X86_CALL_BEGIN do { \
+ int pad = tree->data.call_info.pad; \
+ X86_ARG_PAD (pad); \
+ if (tree->left->op != MB_TERM_NOP) { \
+ mono_assert (lreg >= 0); \
+ x86_push_reg (s->code, lreg); \
+ x86_alu_membase_imm (s->code, X86_CMP, lreg, 0, 0); \
+ } \
+ if (tree->data.call_info.vtype_num) { \
+ int offset = VARINFO (s, tree->data.call_info.vtype_num).offset; \
+ x86_lea_membase (s->code, treg, X86_EBP, offset); \
+ x86_push_reg (s->code, treg); \
+ } \
+} while (0)
+
/* we use this macro to move one lreg to another - source and
destination may overlap, but the register allocator has to
make sure that ((d1 < d2) && (s1 < s2))
@@ -209,7 +249,35 @@ debug_memcopy (void *dest, const void *src, size_t n);
x86_mov_reg_reg (s->code, d1, s1, 4); \
} \
} while (0);
-
+
+#define X86_REMOTING_CHECK tree->left->op != MB_TERM_NOP && tree->right->data.nonvirt_info.method && \
+ (tree->right->data.nonvirt_info.method->klass->marshalbyref || \
+ tree->right->data.nonvirt_info.method->klass == mono_defaults.object_class)
+
+/*
+ This macro adds transparant proxy checks for non-virtual methods in a MBR object
+ and methods that belongs to System::Object.
+*/
+#define X86_REMOTING_CALL do { \
+ guint8 *br[2]; \
+ x86_push_reg (s->code, lreg); \
+ x86_mov_reg_membase (s->code, lreg, lreg, 0, 4); \
+ x86_mov_reg_membase (s->code, lreg, lreg, 0, 4); \
+ x86_alu_reg_imm (s->code, X86_CMP, lreg, (int)mono_defaults.transparent_proxy_class); \
+ x86_pop_reg (s->code, lreg); \
+ br [0] = s->code; x86_branch8 (s->code, X86_CC_NE, 0, FALSE); \
+ X86_CALL_BEGIN; \
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, mono_jit_create_remoting_trampoline (tree->right->data.nonvirt_info.method)); \
+ x86_call_code (s->code, 0); \
+ X86_CALL_END; \
+ br [1] = s->code; x86_jump8 (s->code, 0); \
+ x86_patch (br [0], s->code); \
+ X86_CALL_BEGIN; \
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.nonvirt_info.p); \
+ x86_call_code (s->code, 0); \
+ X86_CALL_END; \
+ x86_patch (br [1], s->code); \
+ } while (0);
%%
@@ -221,8 +289,8 @@ debug_memcopy (void *dest, const void *src, size_t n);
%term CONST_I4 CONST_I8 CONST_R4 CONST_R8
%term LDIND_I1 LDIND_U1 LDIND_I2 LDIND_U2 LDIND_I4 LDIND_I8 LDIND_R4 LDIND_R8 LDIND_OBJ
%term STIND_I1 STIND_I2 STIND_I4 STIND_I8 STIND_R4 STIND_R8 STIND_OBJ
-%term ADDR_L ADDR_G ARG_I4 ARG_I8 ARG_R4 ARG_R8 ARG_OBJ ARG_STRING CALL_I4 CALL_I8 CALL_R8 CALL_VOID
-%term BREAK SWITCH BR RET_VOID RET RET_OBJ ENDFINALLY JMP
+%term ADDR_L ADDR_G ARG_I4 ARG_I8 ARG_R4 ARG_R8 ARG_OBJ CALL_I4 CALL_I8 CALL_R8 CALL_VOID
+%term BREAK SWITCH BR RET_VOID RET RET_OBJ ENDFINALLY ENDFILTER JMP
%term ADD ADD_OVF ADD_OVF_UN SUB SUB_OVF SUB_OVF_UN MUL MUL_OVF MUL_OVF_UN
%term DIV DIV_UN REM REM_UN AND OR XOR SHL SHR SHR_UN NEG NOT CKFINITE
%term COMPARE CBRANCH BRTRUE BRFALSE CSET
@@ -233,11 +301,14 @@ debug_memcopy (void *dest, const void *src, size_t n);
%term CONV_OVF_I1 CONV_OVF_U1 CONV_OVF_I2 CONV_OVF_U2 CONV_OVF_U4 CONV_OVF_U8 CONV_OVF_I4
%term CONV_OVF_I4_UN CONV_OVF_U1_UN CONV_OVF_U2_UN
%term CONV_OVF_I2_UN CONV_OVF_I8_UN CONV_OVF_I1_UN
-%term EXCEPTION THROW RETHROW HANDLER CHECKTHIS
+%term EXCEPTION THROW RETHROW HANDLER CHECKTHIS RETHROW_ABORT
%term LDLEN LDELEMA LDFTN LDVIRTFTN LDSTR LDSFLDA
%term REMOTE_LDFLDA REMOTE_STIND_I1 REMOTE_STIND_I2 REMOTE_STIND_I4
%term REMOTE_STIND_I8 REMOTE_STIND_R4 REMOTE_STIND_R8 REMOTE_STIND_OBJ
%term SIN COS SQRT
+
+%term FUNC1 PROC2 PROC3 FREE OBJADDR VTADDR
+
#
# we start at stmt
#
@@ -342,16 +413,12 @@ addr: ADD (index, base) {
# we pass exception in ECX to catch handler
reg: EXCEPTION {
int offset = VARINFO (s, tree->data.i).offset;
- int reg = VARINFO (s, tree->data.i).reg;
if (tree->reg1 != X86_ECX)
x86_mov_reg_reg (s->code, tree->reg1, X86_ECX, 4);
/* store it so that we can RETHROW it later */
- if (reg < 0)
- x86_mov_membase_reg (s->code, X86_EBP, offset, tree->reg1, 4);
- else
- x86_mov_reg_reg (s->code, reg, tree->reg1, 4);
+ x86_mov_membase_reg (s->code, X86_EBP, offset, tree->reg1, 4);
}
stmt: THROW (reg) {
@@ -364,32 +431,60 @@ stmt: THROW (reg) {
}
stmt: RETHROW {
- int off = VARINFO (s, tree->data.i).offset;
- int reg = VARINFO (s, tree->data.i).reg;
+ int offset = VARINFO (s, tree->data.i).offset;
gpointer target;
- if (reg < 0)
- x86_push_membase (s->code, X86_EBP, off);
- else
- x86_push_reg (s->code, reg);
+ x86_push_membase (s->code, X86_EBP, offset);
target = arch_get_throw_exception ();
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, target);
x86_call_code (s->code, target);
}
+stmt: RETHROW_ABORT {
+ guint8 *br;
+ gpointer target;
+
+ target = mono_thread_current;
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, target);
+ x86_call_code (s->code, target);
+
+ x86_mov_reg_membase (s->code, X86_EAX, X86_EAX, G_STRUCT_OFFSET (MonoThread, abort_exc), 4);
+ x86_alu_reg_imm (s->code, X86_CMP, X86_EAX, 0);
+ /* check for NULL */
+ br = s->code; x86_branch8 (s->code, X86_CC_EQ, 0, FALSE);
+
+ x86_push_reg (s->code, X86_EAX);
+
+ target = arch_get_throw_exception ();
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, target);
+ x86_call_code (s->code, target);
+
+ x86_patch (br, s->code);
+}
+
stmt: HANDLER {
/* save ESP (used by ENDFINALLY) */
- x86_mov_membase_reg (s->code, X86_EBP, -16, X86_ESP, 4);
+ x86_mov_membase_reg (s->code, X86_EBP, mono_exc_esp_offset, X86_ESP, 4);
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_BB, tree->data.bb);
x86_call_imm (s->code, 0);
}
stmt: ENDFINALLY {
- /* restore ESP - which an be modified when we allocate value types
+ /* restore ESP - which can be modified when we allocate value types
* in the finally handler */
- x86_mov_reg_membase (s->code, X86_ESP, X86_EBP, -16, 4);
+ x86_mov_reg_membase (s->code, X86_ESP, X86_EBP, mono_exc_esp_offset, 4);
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 4);
+ x86_ret (s->code);
+}
+
+stmt: ENDFILTER (reg) {
+ /* restore ESP - which can be modified when we allocate value types
+ * in the filter */
+ x86_mov_reg_membase (s->code, X86_ESP, X86_EBP, mono_exc_esp_offset, 4);
x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 4);
+ if (tree->left->reg1 != X86_EAX)
+ x86_mov_reg_reg (s->code, X86_EAX, tree->left->reg1, 4);
x86_ret (s->code);
}
@@ -896,7 +991,7 @@ reg: REMOTE_LDFLDA (reg) {
x86_push_reg (s->code, X86_EDX);
x86_push_reg (s->code, X86_ECX);
- x86_push_reg (s->code, X86_ESP);
+ x86_push_imm (s->code, 0);
x86_push_imm (s->code, tree->data.fi.field);
x86_push_imm (s->code, tree->data.fi.klass);
x86_push_reg (s->code, lreg);
@@ -962,7 +1057,6 @@ reg: CONV_U2 (reg) {
x86_widen_reg (s->code, tree->reg1, tree->left->reg1, FALSE, TRUE);
}
-# warning: this chain rule requires a register
reg: CONST_I4 1 {
x86_mov_reg_imm (s->code, tree->reg1, tree->data.i);
}
@@ -985,6 +1079,27 @@ reg: CONV_OVF_I4 (reg) {
PRINT_REG ("CONV_OVF_I4", tree->left->reg1);
}
+reg: CONV_OVF_I4 (freg) {
+ x86_push_reg (s->code, X86_EAX);
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 4);
+ x86_fnstcw_membase(s->code, X86_ESP, 0);
+ x86_mov_reg_membase (s->code, tree->left->reg1, X86_ESP, 0, 2);
+ x86_alu_reg_imm (s->code, X86_OR, tree->left->reg1, 0xc00);
+ x86_mov_membase_reg (s->code, X86_ESP, 2, tree->left->reg1, 2);
+ x86_fldcw_membase (s->code, X86_ESP, 2);
+ x86_push_reg (s->code, X86_EAX); // SP = SP - 4
+ x86_fist_pop_membase (s->code, X86_ESP, 0, FALSE);
+ x86_fstsw(s->code); // stores flags in ax
+ x86_alu_reg_imm (s->code, X86_AND, X86_EAX, 0x80000000);
+
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_EQ, FALSE, "OverflowException");
+
+ x86_pop_reg (s->code, tree->reg1);
+ x86_fldcw_membase (s->code, X86_ESP, 0);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 4);
+ x86_pop_reg (s->code, X86_EAX);
+}
+
reg: CONV_OVF_U4 (reg) {
/* Keep in sync with CONV_OVF_I4_UN below, they are the same on 32-bit machines */
x86_test_reg_imm (s->code, tree->left->reg1, 0x8000000);
@@ -1001,6 +1116,30 @@ reg: CONV_OVF_I4_UN (reg) {
x86_mov_reg_reg (s->code, tree->reg1, tree->left->reg1, 4);
}
+reg: CONV_OVF_U4 (freg) {
+ x86_push_reg (s->code, X86_EAX);
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 4);
+ x86_fnstcw_membase(s->code, X86_ESP, 0);
+ x86_mov_reg_membase (s->code, tree->left->reg1, X86_ESP, 0, 2);
+ x86_alu_reg_imm (s->code, X86_OR, tree->left->reg1, 0xc00);
+ x86_mov_membase_reg (s->code, X86_ESP, 2, tree->left->reg1, 2);
+ x86_fldcw_membase (s->code, X86_ESP, 2);
+ x86_push_reg (s->code, X86_EAX); // SP = SP - 4
+ x86_fist_pop_membase (s->code, X86_ESP, 0, FALSE);
+ x86_fstsw(s->code); // stores flags in ax
+ x86_alu_reg_imm (s->code, X86_AND, X86_EAX, 0x80000000);
+
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_EQ, FALSE, "OverflowException");
+
+ x86_pop_reg (s->code, tree->reg1);
+ x86_fldcw_membase (s->code, X86_ESP, 0);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 4);
+ x86_pop_reg (s->code, X86_EAX);
+
+ x86_test_reg_imm (s->code, tree->reg1, 0x8000000);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_EQ, FALSE, "OverflowException");
+}
+
reg: CONV_OVF_I1 (reg) {
/* probe value to be within -128 to 127 */
x86_alu_reg_imm (s->code, X86_CMP, tree->left->reg1, 127);
@@ -1581,22 +1720,22 @@ reg: LDLEN (reg) {
reg: LDELEMA (reg, CONST_I4) {
int ind;
- x86_alu_membase_imm (s->code, X86_CMP, tree->left->reg1, G_STRUCT_OFFSET (MonoArray, max_length), tree->right->data.i);
- EMIT_COND_SYSTEM_EXCEPTION (X86_CC_GT, FALSE, "IndexOutOfRangeException");
+ if (mono_jit_boundcheck){
+ x86_alu_membase_imm (s->code, X86_CMP, tree->left->reg1, G_STRUCT_OFFSET (MonoArray, max_length), tree->right->data.i);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_GT, FALSE, "IndexOutOfRangeException");
+ }
ind = tree->data.i * tree->right->data.i + G_STRUCT_OFFSET (MonoArray, vector);
- x86_alu_reg_imm (s->code, X86_ADD, tree->left->reg1, ind);
-
- if (tree->reg1 != tree->left->reg1)
- x86_mov_reg_reg (s->code, tree->reg1, tree->left->reg1, 4);
-
+ x86_lea_membase (s->code, tree->reg1, tree->left->reg1, ind);
}
reg: LDELEMA (reg, reg) {
- x86_alu_reg_membase (s->code, X86_CMP, tree->right->reg1, tree->left->reg1, G_STRUCT_OFFSET (MonoArray, max_length));
- EMIT_COND_SYSTEM_EXCEPTION (X86_CC_LT, FALSE, "IndexOutOfRangeException");
+ if (mono_jit_boundcheck){
+ x86_alu_reg_membase (s->code, X86_CMP, tree->right->reg1, tree->left->reg1, G_STRUCT_OFFSET (MonoArray, max_length));
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_LT, FALSE, "IndexOutOfRangeException");
+ }
if (tree->data.i == 1 || tree->data.i == 2 ||
tree->data.i == 4 || tree->data.i == 8) {
@@ -1643,7 +1782,7 @@ reg: NEWARR (reg) {
x86_push_imm (s->code, tree->data.p);
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, mono_array_new_wrapper);
x86_call_code (s->code, 0);
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, sizeof (gpointer) + 4);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 8);
x86_pop_reg (s->code, X86_EDX);
x86_pop_reg (s->code, X86_ECX);
@@ -1665,7 +1804,7 @@ reg: NEWARR_SPEC (reg) {
x86_push_imm (s->code, tree->data.p);
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, mono_array_new_specific);
x86_call_code (s->code, 0);
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, sizeof (gpointer) + 4);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 8);
x86_pop_reg (s->code, X86_EDX);
x86_pop_reg (s->code, X86_ECX);
@@ -1686,7 +1825,7 @@ reg: NEWOBJ {
x86_push_imm (s->code, tree->data.klass);
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, mono_object_new_wrapper);
x86_call_code (s->code, 0);
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, sizeof (gpointer));
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 4);
x86_pop_reg (s->code, X86_EDX);
x86_pop_reg (s->code, X86_ECX);
@@ -1706,7 +1845,7 @@ reg: NEWOBJ_SPEC {
x86_push_imm (s->code, tree->data.p);
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, mono_object_new_specific);
x86_call_code (s->code, 0);
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, sizeof (gpointer));
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 4);
x86_pop_reg (s->code, X86_EDX);
x86_pop_reg (s->code, X86_ECX);
@@ -1717,14 +1856,113 @@ reg: NEWOBJ_SPEC {
PRINT_REG ("NEWOBJ_SPEC", tree->reg1);
}
+reg: OBJADDR (reg) {
+ if (tree->left->reg1 != tree->reg1)
+ x86_mov_reg_reg (s->code, tree->reg1, tree->left->reg1, 4);
+}
+
+reg: VTADDR (ADDR_L) {
+ int offset = VARINFO (s, tree->left->data.i).offset;
+
+ x86_lea_membase (s->code, tree->reg1, X86_EBP, offset);
+}
+
+stmt: FREE (reg) {
+ x86_push_reg (s->code, tree->left->reg1);
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, g_free);
+ x86_call_code (s->code, 0);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 4);
+}
+
+stmt: PROC2 (reg, reg) {
+ x86_push_reg (s->code, tree->right->reg1);
+ x86_push_reg (s->code, tree->left->reg1);
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->data.p);
+ x86_call_code (s->code, 0);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 8);
+}
+
+stmt: PROC3 (reg, CPSRC (reg, reg)) {
+ x86_push_reg (s->code, tree->right->right->reg1);
+ x86_push_reg (s->code, tree->right->left->reg1);
+ x86_push_reg (s->code, tree->left->reg1);
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->data.p);
+ x86_call_code (s->code, 0);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 12);
+}
+
+reg: FUNC1 (reg) {
+ if (tree->reg1 != X86_EAX)
+ x86_push_reg (s->code, X86_EAX);
+ x86_push_reg (s->code, X86_ECX);
+ x86_push_reg (s->code, X86_EDX);
+
+ x86_push_reg (s->code, tree->left->reg1);
+
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->data.p);
+ x86_call_code (s->code, 0);
+ x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, sizeof (gpointer));
+
+ x86_pop_reg (s->code, X86_EDX);
+ x86_pop_reg (s->code, X86_ECX);
+ if (tree->reg1 != X86_EAX) {
+ x86_mov_reg_reg (s->code, tree->reg1, X86_EAX, 4);
+ x86_pop_reg (s->code, X86_EAX);
+ }
+}
+
+reg: LOCALLOC (CONST_I4) {
+ int size;
+ int offset;
+
+ size = (tree->left->data.i + (MONO_FRAME_ALIGNMENT - 1)) & ~(MONO_FRAME_ALIGNMENT - 1); // align to MONO_FRAME_ALIGNMENT boundary
+ offset = 0;
+
+ if (size) {
+ mono_emit_stack_alloc_const (s, tree, size);
+
+ if (tree->reg1 != X86_EDI && tree->left->reg1 != X86_EDI) {
+ x86_push_reg (s->code, X86_EDI);
+ offset += 4;
+ }
+ if (tree->reg1 != X86_EAX && tree->left->reg1 != X86_EAX) {
+ x86_push_reg (s->code, X86_EAX);
+ offset += 4;
+ }
+ if (tree->reg1 != X86_ECX && tree->left->reg1 != X86_ECX) {
+ x86_push_reg (s->code, X86_ECX);
+ offset += 4;
+ }
+
+ x86_mov_reg_imm (s->code, X86_ECX, size >> 2);
+ x86_alu_reg_reg (s->code, X86_SUB, X86_EAX, X86_EAX);
+
+ x86_lea_membase (s->code, X86_EDI, X86_ESP, offset);
+ x86_cld (s->code);
+ x86_prefix (s->code, X86_REP_PREFIX);
+ x86_stosd (s->code);
+
+ if (tree->reg1 != X86_ECX && tree->left->reg1 != X86_ECX)
+ x86_pop_reg (s->code, X86_ECX);
+ if (tree->reg1 != X86_EAX && tree->left->reg1 != X86_EAX)
+ x86_pop_reg (s->code, X86_EAX);
+ if (tree->reg1 != X86_EDI && tree->left->reg1 != X86_EDI)
+ x86_pop_reg (s->code, X86_EDI);
+ }
+
+ x86_mov_reg_reg (s->code, tree->reg1, X86_ESP, 4);
+}
+
+
+
reg: LOCALLOC (reg) {
int offset = 0;
- /* size must be aligned to 4 bytes */
- x86_alu_reg_imm (s->code, X86_ADD, tree->left->reg1, 3);
- x86_alu_reg_imm (s->code, X86_AND, tree->left->reg1, ~3);
+ /* size must be aligned to MONO_FRAME_ALIGNMENT bytes */
+ x86_alu_reg_imm (s->code, X86_ADD, tree->left->reg1, MONO_FRAME_ALIGNMENT - 1);
+ x86_alu_reg_imm (s->code, X86_AND, tree->left->reg1, ~(MONO_FRAME_ALIGNMENT - 1));
/* allocate space on stack */
- x86_alu_reg_reg (s->code, X86_SUB, X86_ESP, tree->left->reg1);
+ mono_emit_stack_alloc (s, tree);
if (tree->data.i) {
/* initialize with zero */
@@ -1751,12 +1989,12 @@ reg: LOCALLOC (reg) {
x86_prefix (s->code, X86_REP_PREFIX);
x86_stosl (s->code);
+ if (tree->reg1 != X86_EDI && tree->left->reg1 != X86_EDI)
+ x86_pop_reg (s->code, X86_EDI);
if (tree->reg1 != X86_ECX && tree->left->reg1 != X86_ECX)
x86_pop_reg (s->code, X86_ECX);
if (tree->reg1 != X86_EAX && tree->left->reg1 != X86_EAX)
x86_pop_reg (s->code, X86_EAX);
- if (tree->reg1 != X86_EDI && tree->left->reg1 != X86_EDI)
- x86_pop_reg (s->code, X86_EDI);
}
x86_mov_reg_reg (s->code, tree->reg1, X86_ESP, 4);
@@ -1807,10 +2045,10 @@ reg: CASTCLASS (reg) {
x86_alu_membase_imm (s->code, X86_CMP, lreg, G_STRUCT_OFFSET (MonoClass, rank), klass->rank);
EMIT_COND_SYSTEM_EXCEPTION (X86_CC_EQ, FALSE, "InvalidCastException");
- x86_mov_reg_membase (s->code, lreg, lreg, G_STRUCT_OFFSET (MonoClass, element_class), 4);
+ x86_mov_reg_membase (s->code, lreg, lreg, G_STRUCT_OFFSET (MonoClass, cast_class), 4);
x86_mov_reg_membase (s->code, lreg, lreg, G_STRUCT_OFFSET (MonoClass, baseval), 4);
- x86_alu_reg_mem (s->code, X86_SUB, lreg, &klass->element_class->baseval);
- x86_alu_reg_mem (s->code, X86_CMP, lreg, &klass->element_class->diffval);
+ x86_alu_reg_mem (s->code, X86_SUB, lreg, &klass->cast_class->baseval);
+ x86_alu_reg_mem (s->code, X86_CMP, lreg, &klass->cast_class->diffval);
EMIT_COND_SYSTEM_EXCEPTION (X86_CC_LE, FALSE, "InvalidCastException");
} else {
@@ -1874,10 +2112,10 @@ reg: ISINST (reg) {
x86_alu_membase_imm (s->code, X86_CMP, lreg, G_STRUCT_OFFSET (MonoClass, rank), klass->rank);
br [1] = s->code; x86_branch8 (s->code, X86_CC_NE, 0, FALSE);
- x86_mov_reg_membase (s->code, lreg, lreg, G_STRUCT_OFFSET (MonoClass, element_class), 4);
+ x86_mov_reg_membase (s->code, lreg, lreg, G_STRUCT_OFFSET (MonoClass, cast_class), 4);
x86_mov_reg_membase (s->code, lreg, lreg, G_STRUCT_OFFSET (MonoClass, baseval), 4);
- x86_alu_reg_mem (s->code, X86_SUB, lreg, &klass->element_class->baseval);
- x86_alu_reg_mem (s->code, X86_CMP, lreg, &klass->element_class->diffval);
+ x86_alu_reg_mem (s->code, X86_SUB, lreg, &klass->cast_class->baseval);
+ x86_alu_reg_mem (s->code, X86_CMP, lreg, &klass->cast_class->diffval);
br [2] = s->code; x86_branch8 (s->code, X86_CC_LE, 0, FALSE);
x86_patch (br [1], s->code);
x86_mov_membase_imm (s->code, X86_ESP, 0, 0, 4);
@@ -1913,7 +2151,8 @@ reg: ISINST (reg) {
stmt: INITOBJ (reg) {
int i, j;
- i = tree->data.i;
+ if (!(i = tree->data.i))
+ return;
if (i == 1 || i == 2 || i == 4) {
x86_mov_membase_imm (s->code, tree->left->reg1, 0, 0, i);
@@ -2542,9 +2781,11 @@ stmt: RET_VOID {
}
}
-
stmt: ARG_I4 (LDIND_I4 (addr)) {
MBTree *at = tree->left->left;
+ int pad = tree->data.arg_info.pad;
+
+ X86_ARG_PAD (pad);
switch (at->data.ainfo.amode) {
@@ -2569,6 +2810,9 @@ stmt: ARG_I4 (LDIND_I4 (addr)) {
stmt: ARG_I4 (LDIND_I4 (ADDR_L)) {
int treg = VARINFO (s, tree->left->left->data.i).reg;
+ int pad = tree->data.arg_info.pad;
+
+ X86_ARG_PAD (pad);
x86_push_reg (s->code, treg);
} cost {
MBCOND ((VARINFO (data, tree->left->left->data.i).reg >= 0));
@@ -2576,34 +2820,23 @@ stmt: ARG_I4 (LDIND_I4 (ADDR_L)) {
}
stmt: ARG_I4 (reg) {
- x86_push_reg (s->code, tree->left->reg1);
- PRINT_REG ("ARG_I4", tree->left->reg1);
-}
-
-# fixme: we must free the allocated strings somewhere
-stmt: ARG_STRING (reg) {
- x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 4);
- x86_push_reg (s->code, X86_EAX);
- x86_push_reg (s->code, X86_ECX);
- x86_push_reg (s->code, X86_EDX);
+ int pad = tree->data.arg_info.pad;
+ X86_ARG_PAD (pad);
x86_push_reg (s->code, tree->left->reg1);
- mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, mono_string_to_utf8);
- x86_call_code (s->code, 0);
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 4);
-
- x86_mov_membase_reg (s->code, X86_ESP, 12, X86_EAX, 4);
-
- x86_pop_reg (s->code, X86_EDX);
- x86_pop_reg (s->code, X86_ECX);
- x86_pop_reg (s->code, X86_EAX);
}
stmt: ARG_I4 (ADDR_G) {
+ int pad = tree->data.arg_info.pad;
+
+ X86_ARG_PAD (pad);
x86_push_imm (s->code, tree->left->data.p);
}
stmt: ARG_I4 (CONST_I4) "MB_USE_OPT1(0)" {
+ int pad = tree->data.arg_info.pad;
+
+ X86_ARG_PAD (pad);
x86_push_imm (s->code, tree->left->data.i);
}
@@ -2662,23 +2895,11 @@ reg: CALL_I4 (this, reg) {
if (lreg == treg || rreg == treg)
mono_assert_not_reached ();
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_call_reg (s->code, rreg);
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
-
- PRINT_REG ("CALL_I4", tree->reg1);
+ X86_CALL_END;
mono_assert (tree->reg1 == X86_EAX);
}
@@ -2690,26 +2911,19 @@ reg: CALL_I4 (this, ADDR_G) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- x86_alu_membase_imm (s->code, X86_CMP, lreg, 0, 0);
- }
+ if (X86_REMOTING_CHECK)
+ {
+ X86_REMOTING_CALL;
+ } else
+ {
+ X86_CALL_BEGIN;
+
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
+ x86_call_code (s->code, 0);
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
+ X86_CALL_END;
}
-
- mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
- x86_call_code (s->code, 0);
-
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
-
- PRINT_REG ("CALL_I4", tree->reg1);
-
+
mono_assert (tree->reg1 == X86_EAX);
}
@@ -2743,16 +2957,7 @@ reg: CALL_I4 (this, INTF_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_mov_reg_membase (s->code, lreg, lreg,
@@ -2760,10 +2965,7 @@ reg: CALL_I4 (this, INTF_ADDR) {
x86_mov_reg_membase (s->code, lreg, lreg, tree->right->data.m->klass->interface_id << 2, 4);
x86_call_virtual (s->code, lreg, tree->right->data.m->slot << 2);
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
-
- PRINT_REG ("CALL_I4(INTERFACE)", tree->reg1);
+ X86_CALL_END;
mono_assert (tree->reg1 == X86_EAX);
}
@@ -2818,25 +3020,13 @@ reg: CALL_I4 (this, VFUNC_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_call_virtual (s->code, lreg,
G_STRUCT_OFFSET (MonoVTable, vtable) + (tree->right->data.m->slot << 2));
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
-
- PRINT_REG ("CALL_I4(VIRTUAL)", tree->reg1);
+ X86_CALL_END;
mono_assert (tree->reg1 == X86_EAX);
}
@@ -2848,48 +3038,37 @@ stmt: CALL_VOID (this, ADDR_G) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- x86_alu_membase_imm (s->code, X86_CMP, lreg, 0, 0);
- }
+ if (X86_REMOTING_CHECK)
+ {
+ X86_REMOTING_CALL;
+ } else
+ {
+ X86_CALL_BEGIN;
+
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
+ x86_call_code (s->code, 0);
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
+ X86_CALL_END;
}
-
- mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
- x86_call_code (s->code, 0);
-
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
}
stmt: CALL_VOID (this, reg) {
- int lreg = tree->left->reg1;
int treg = X86_EAX;
+ int lreg = tree->left->reg1;
+ int rreg = tree->right->reg1;
- if (lreg == treg)
+ if (lreg == treg || rreg == treg)
treg = X86_EDX;
+ if (lreg == treg || rreg == treg)
+ treg = X86_ECX;
+ if (lreg == treg || rreg == treg)
+ mono_assert_not_reached ();
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- x86_alu_membase_imm (s->code, X86_CMP, lreg, 0, 0);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_call_reg (s->code, tree->right->reg1);
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
+ X86_CALL_END;
}
stmt: CALL_VOID (this, INTF_ADDR) {
@@ -2899,16 +3078,7 @@ stmt: CALL_VOID (this, INTF_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_mov_reg_membase (s->code, lreg, lreg,
@@ -2916,8 +3086,7 @@ stmt: CALL_VOID (this, INTF_ADDR) {
x86_mov_reg_membase (s->code, lreg, lreg, tree->right->data.m->klass->interface_id << 2, 4);
x86_call_virtual (s->code, lreg, tree->right->data.m->slot << 2);
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
+ X86_CALL_END;
}
stmt: CALL_VOID (this, VFUNC_ADDR) {
@@ -2927,23 +3096,13 @@ stmt: CALL_VOID (this, VFUNC_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_call_virtual (s->code, lreg,
G_STRUCT_OFFSET (MonoVTable, vtable) + (tree->right->data.m->slot << 2));
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
+ X86_CALL_END;
}
stmt: SWITCH (reg) {
@@ -2989,49 +3148,7 @@ reg: CONV_U4 (lreg) {
x86_mov_reg_reg (s->code, tree->reg1, tree->left->reg1, 4);
}
-
-reg: CONV_OVF_I4 (lreg){
- guint8 *start = s->code;
- guchar* o1, *o2, *o3, *o4, *o5;
- int i;
-
- /*
- * Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000
- */
- for (i = 0; i < 2; i++) {
- s->code = start;
-
- x86_test_reg_reg (s->code, tree->left->reg1, tree->left->reg1);
-
- /* If the low word top bit is set, see if we are negative */
- x86_branch8 (s->code, X86_CC_LT, o3 - o1, TRUE);
- o1 = s->code;
-
- /* We are not negative (no top bit set, check for our top word to be zero */
- x86_test_reg_reg (s->code, tree->left->reg2, tree->left->reg2);
- x86_branch8 (s->code, X86_CC_EQ, o4 - o2, TRUE);
- o2 = s->code;
-
- /* throw exception */
- x86_push_imm (s->code, "OverflowException");
- mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS,
- arch_get_throw_exception_by_name ());
- x86_call_code (s->code, 0);
-
- o3 = s->code;
- /* our top bit is set, check that top word is 0xfffffff */
- x86_alu_reg_imm (s->code, X86_CMP, tree->left->reg2, 0xffffffff);
-
- o4 = s->code;
- /* nope, emit exception */
- x86_branch8 (s->code, X86_CC_NE, o2 - o5, TRUE);
- o5 = s->code;
-
- if (tree->reg1 != tree->left->reg1)
- x86_mov_reg_reg (s->code, tree->reg1, tree->left->reg1, 4);
- }
-}
-reg: CONV_OVF_I4 (lreg){
+reg: CONV_OVF_I4 (lreg) {
guint8 *br [3], *label [1];
/*
@@ -3041,7 +3158,6 @@ reg: CONV_OVF_I4 (lreg){
/* If the low word top bit is set, see if we are negative */
br [0] = s->code; x86_branch8 (s->code, X86_CC_LT, 0, TRUE);
-
/* We are not negative (no top bit set, check for our top word to be zero */
x86_test_reg_reg (s->code, tree->left->reg2, tree->left->reg2);
br [1] = s->code; x86_branch8 (s->code, X86_CC_EQ, 0, TRUE);
@@ -3600,6 +3716,28 @@ lreg: REM_UN (lreg, lreg) {
tree->reg2 == X86_EDX);
}
+lreg: CALL_I8 (this, reg) {
+ int treg = X86_EAX;
+ int lreg = tree->left->reg1;
+ int rreg = tree->right->reg1;
+
+ if (lreg == treg || rreg == treg)
+ treg = X86_EDX;
+ if (lreg == treg || rreg == treg)
+ treg = X86_ECX;
+ if (lreg == treg || rreg == treg)
+ mono_assert_not_reached ();
+
+ X86_CALL_BEGIN;
+
+ x86_call_reg (s->code, rreg);
+
+ X86_CALL_END;
+
+ mono_assert (tree->reg1 == X86_EAX);
+ mono_assert (tree->reg2 == X86_EDX);
+}
+
lreg: CALL_I8 (this, ADDR_G) {
int lreg = tree->left->reg1;
int treg = X86_EAX;
@@ -3607,24 +3745,19 @@ lreg: CALL_I8 (this, ADDR_G) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- x86_alu_membase_imm (s->code, X86_CMP, lreg, 0, 0);
- }
+ if (X86_REMOTING_CHECK)
+ {
+ X86_REMOTING_CALL;
+ } else
+ {
+ X86_CALL_BEGIN;
+
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
+ x86_call_code (s->code, 0);
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
+ X86_CALL_END;
}
-
- mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
- x86_call_code (s->code, 0);
-
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
-
+
mono_assert (tree->reg1 == X86_EAX);
mono_assert (tree->reg2 == X86_EDX);
}
@@ -3636,26 +3769,13 @@ lreg: CALL_I8 (this, VFUNC_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_call_virtual (s->code, lreg,
G_STRUCT_OFFSET (MonoVTable, vtable) + (tree->right->data.m->slot << 2));
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
-
- PRINT_REG ("CALL0_I8(VIRTUAL)", tree->reg1);
- PRINT_REG ("CALL1_I8(VIRTUAL)", tree->reg2);
+ X86_CALL_END;
mono_assert (tree->reg1 == X86_EAX);
mono_assert (tree->reg2 == X86_EDX);
@@ -3668,16 +3788,7 @@ lreg: CALL_I8 (this, INTF_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_mov_reg_membase (s->code, lreg, lreg,
@@ -3685,10 +3796,7 @@ lreg: CALL_I8 (this, INTF_ADDR) {
x86_mov_reg_membase (s->code, lreg, lreg, tree->right->data.m->klass->interface_id << 2, 4);
x86_call_virtual (s->code, lreg, tree->right->data.m->slot << 2);
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
-
- PRINT_REG ("CALL_I8(INTERFACE)", tree->reg1);
+ X86_CALL_END;
mono_assert (tree->reg1 == X86_EAX);
mono_assert (tree->reg2 == X86_EDX);
@@ -3717,6 +3825,9 @@ stmt: RET (lreg) {
stmt: ARG_I8 (lreg) {
+ int pad = tree->data.arg_info.pad;
+
+ X86_ARG_PAD (pad);
x86_push_reg (s->code, tree->left->reg2);
x86_push_reg (s->code, tree->left->reg1);
}
@@ -4147,7 +4258,7 @@ freg: CONV_R_UN (lreg) {
x86_fst80_membase (s->code, X86_ESP, 0);
/* test if lreg is negative */
- x86_test_reg_reg (s->code, tree->left->reg1, tree->left->reg1);
+ x86_test_reg_reg (s->code, tree->left->reg2, tree->left->reg2);
br [0] = s->code; x86_branch8 (s->code, X86_CC_GEZ, 0, TRUE);
/* add correction constant mn */
@@ -4155,7 +4266,7 @@ freg: CONV_R_UN (lreg) {
x86_fld80_membase (s->code, X86_ESP, 0);
x86_fp_op_reg (s->code, X86_FADD, 1, TRUE);
x86_fst80_membase (s->code, X86_ESP, 0);
-
+ //x86_breakpoint (s->code);
x86_patch (br [0], s->code);
x86_fld80_membase (s->code, X86_ESP, 0);
@@ -4286,7 +4397,7 @@ freg: REM (freg, freg) {
/* this requires a loop, because fprem1 somtimes
* returns a partial remainder */
l1 = s->code;
- x86_fprem1 (s->code);
+ x86_fprem (s->code);
x86_fnstsw (s->code);
x86_alu_reg_imm (s->code, X86_AND, X86_EAX, 0x0400);
l2 = s->code + 2;
@@ -4300,7 +4411,9 @@ freg: NEG (freg) {
x86_fchs (s->code);
}
-stmt: POP (freg)
+stmt: POP (freg) {
+ x86_fstp (s->code, 0);
+}
stmt: STIND_R4 (addr, freg) {
@@ -4431,12 +4544,16 @@ stmt: REMOTE_STIND_R8 (reg, freg) {
}
stmt: ARG_R4 (freg) {
- x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 4);
+ int pad = tree->data.arg_info.pad;
+
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 4 + pad);
x86_fst_membase (s->code, X86_ESP, 0, FALSE, TRUE);
}
stmt: ARG_R8 (freg) {
- x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 8);
+ int pad = tree->data.arg_info.pad;
+
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 8 + pad);
x86_fst_membase (s->code, X86_ESP, 0, TRUE, TRUE);
}
@@ -4500,6 +4617,25 @@ stmt: CBRANCH (COMPARE (freg, freg)) {
}
}
+freg: CALL_R8 (this, reg) {
+ int treg = X86_EAX;
+ int lreg = tree->left->reg1;
+ int rreg = tree->right->reg1;
+
+ if (lreg == treg || rreg == treg)
+ treg = X86_EDX;
+ if (lreg == treg || rreg == treg)
+ treg = X86_ECX;
+ if (lreg == treg || rreg == treg)
+ mono_assert_not_reached ();
+
+ X86_CALL_BEGIN;
+
+ x86_call_reg (s->code, rreg);
+
+ X86_CALL_END;
+}
+
freg: CALL_R8 (this, ADDR_G) {
int lreg = tree->left->reg1;
int treg = X86_EAX;
@@ -4507,23 +4643,18 @@ freg: CALL_R8 (this, ADDR_G) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- x86_alu_membase_imm (s->code, X86_CMP, lreg, 0, 0);
- }
+ if (X86_REMOTING_CHECK)
+ {
+ X86_REMOTING_CALL;
+ } else
+ {
+ X86_CALL_BEGIN;
+
+ mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
+ x86_call_code (s->code, 0);
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
+ X86_CALL_END;
}
-
- mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, tree->right->data.p);
- x86_call_code (s->code, 0);
-
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
}
freg: CALL_R8 (this, INTF_ADDR) {
@@ -4533,16 +4664,7 @@ freg: CALL_R8 (this, INTF_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_mov_reg_membase (s->code, lreg, lreg,
@@ -4550,8 +4672,7 @@ freg: CALL_R8 (this, INTF_ADDR) {
x86_mov_reg_membase (s->code, lreg, lreg, tree->right->data.m->klass->interface_id << 2, 4);
x86_call_virtual (s->code, lreg, tree->right->data.m->slot << 2);
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
+ X86_CALL_END;
}
freg: CALL_R8 (this, VFUNC_ADDR) {
@@ -4561,23 +4682,13 @@ freg: CALL_R8 (this, VFUNC_ADDR) {
if (lreg == treg)
treg = X86_EDX;
- if (tree->left->op != MB_TERM_NOP) {
- mono_assert (lreg >= 0);
- x86_push_reg (s->code, lreg);
- }
-
- if (tree->data.ci.vtype_num) {
- int offset = VARINFO (s, tree->data.ci.vtype_num).offset;
- x86_lea_membase (s->code, treg, X86_EBP, offset);
- x86_push_reg (s->code, treg);
- }
+ X86_CALL_BEGIN;
x86_mov_reg_membase (s->code, lreg, lreg, 0, 4);
x86_call_virtual (s->code, lreg,
G_STRUCT_OFFSET (MonoVTable, vtable) + (tree->right->data.m->slot << 2));
- if (tree->data.ci.args_size)
- x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, tree->data.ci.args_size);
+ X86_CALL_END;
}
stmt: RET (freg) {
@@ -4664,37 +4775,33 @@ stmt: REMOTE_STIND_OBJ (reg, reg) {
}
stmt: ARG_OBJ (CONST_I4) {
+ int pad = tree->data.arg_info.pad;
+
+ X86_ARG_PAD (pad);
x86_push_imm (s->code, tree->left->data.i);
}
stmt: ARG_OBJ (reg) {
- int size = tree->data.i;
+ int size = tree->data.arg_info.size;
+ int pad = tree->data.arg_info.pad;
int sa;
- mono_assert (size > 0);
+ if (!size)
+ return;
- sa = size + 3;
- sa &= ~3;
+ sa = size + pad;
/* reserve space for the argument */
x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, sa);
- x86_push_reg (s->code, X86_EAX);
- x86_push_reg (s->code, X86_EDX);
- x86_push_reg (s->code, X86_ECX);
-
x86_push_imm (s->code, size);
x86_push_reg (s->code, tree->left->reg1);
- x86_lea_membase (s->code, X86_EAX, X86_ESP, 5*4);
+ x86_lea_membase (s->code, X86_EAX, X86_ESP, 2*4);
x86_push_reg (s->code, X86_EAX);
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, MEMCOPY);
x86_call_code (s->code, 0);
x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, 12);
-
- x86_pop_reg (s->code, X86_ECX);
- x86_pop_reg (s->code, X86_EDX);
- x86_pop_reg (s->code, X86_EAX);
}
stmt: RET_OBJ (reg) {
@@ -4704,7 +4811,6 @@ stmt: RET_OBJ (reg) {
x86_push_reg (s->code, tree->left->reg1);
x86_push_membase (s->code, X86_EBP, 8);
-
mono_add_jump_info (s, s->code, MONO_JUMP_INFO_ABS, MEMCOPY);
x86_call_code (s->code, 0);
@@ -4753,26 +4859,85 @@ mono_llmult_ovf_un (gpointer *exc, guint32 al, guint32 ah, guint32 bl, guint32 b
return 0;
}
+
guint64
-mono_llmult_ovf (gpointer *exc, guint32 al, gint32 ah, guint32 bl, gint32 bh)
-{
+mono_llmult_ovf (gpointer *exc, guint32 al, gint32 ah, guint32 bl, gint32 bh) {
+ /*
+ Use Karatsuba algorithm where:
+ a*b is: AhBh(R^2+R)+(Ah-Al)(Bl-Bh)R+AlBl(R+1)
+ where Ah is the "high half" (most significant 32 bits) of a and
+ where Al is the "low half" (least significant 32 bits) of a and
+ where Bh is the "high half" of b and Bl is the "low half" and
+ where R is the Radix or "size of the half" (in our case 32 bits)
+
+ Note, for the product of two 64 bit numbers to fit into a 64
+ result, ah and/or bh must be 0. This will save us from doing
+ the AhBh term at all.
+
+ Also note that we refactor so that we don't overflow 64 bits with
+ intermediate results. So we use [(Ah-Al)(Bl-Bh)+AlBl]R+AlBl
+ */
+
gint64 res, t1;
+ gint32 sign;
+
+ /* need to work with absoulte values, so find out what the
+ resulting sign will be and convert any negative numbers
+ from two's complement
+ */
+ sign = ah ^ bh;
+ if (ah < 0) {
+ /* flip the bits and add 1 */
+ ah ^= ~0;
+ if (al == 0)
+ ah += 1;
+ else {
+ al ^= ~0;
+ al +=1;
+ }
+ }
- // fixme: check for overflow
+ if (bh < 0) {
+ /* flip the bits and add 1 */
+ bh ^= ~0;
+ if (bl == 0)
+ bh += 1;
+ else {
+ bl ^= ~0;
+ bl +=1;
+ }
+ }
+
+ /* we overflow for sure if both upper halves are greater
+ than zero because we would need to shift their
+ product 64 bits to the left and that will not fit
+ in a 64 bit result */
+ if (ah && bh)
+ goto raise_exception;
- res = (gint64)al * (gint64)bl;
+ /* do the AlBl term first */
+ t1 = (gint64)al * (gint64)bl;
- t1 = (gint64)ah * bl + al * (gint64)bh;
+ res = t1;
- res += ((gint64)t1) << 32;
+ /* now do the [(Ah-Al)(Bl-Bh)+AlBl]R term */
+ t1 += (gint64)(ah - al) * (gint64)(bl - bh);
+ t1 <<= 32;
+ /* check for overflow */
+ if (t1 > (0x7FFFFFFFFFFFFFFF - res))
+ goto raise_exception;
+
+ res += t1;
*exc = NULL;
- return res;
-/*
+ if (sign < 0)
+ return -res;
+ else
+ return res;
+
raise_exception:
*exc = mono_get_exception_overflow ();
return 0;
-*/
}
gint64
@@ -4918,6 +5083,94 @@ void mono_emit_fast_iconv_i8 (MBCGEN_TYPE* s, MBTREE_TYPE* tree)
x86_patch (br[2], s->code);
}
+void mono_emit_stack_alloc (MBCGEN_TYPE* s, MBTREE_TYPE* tree)
+{
+#ifdef PLATFORM_WIN32
+ guint8* br[5];
+ int sreg;
+
+ /*
+ * Under Windows:
+ * If requested stack size is larger than one page,
+ * perform stack-touch operation
+ * (see comments in mono_emit_stack_alloc_const below).
+ */
+ x86_test_reg_imm (s->code, tree->left->reg1, ~0xFFF);
+ br[0] = s->code; x86_branch8 (s->code, X86_CC_Z, 0, FALSE);
+
+ sreg = tree->left->reg1;
+
+ br[2] = s->code; /* loop */
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 0x1000);
+ x86_test_membase_reg (s->code, X86_ESP, 0, X86_ESP);
+ x86_alu_reg_imm (s->code, X86_SUB, sreg, 0x1000);
+ x86_alu_reg_imm (s->code, X86_CMP, sreg, 0x1000);
+ br[3] = s->code; x86_branch8 (s->code, X86_CC_AE, 0, FALSE);
+ x86_patch (br[3], br[2]);
+ x86_test_reg_reg (s->code, sreg, sreg);
+ br[4] = s->code; x86_branch8 (s->code, X86_CC_Z, 0, FALSE);
+ x86_alu_reg_reg (s->code, X86_SUB, X86_ESP, sreg);
+
+ br[1] = s->code; x86_jump8 (s->code, 0);
+
+ x86_patch (br[0], s->code);
+ x86_alu_reg_reg (s->code, X86_SUB, X86_ESP, tree->left->reg1);
+ x86_patch (br[1], s->code);
+ x86_patch (br[4], s->code);
+#else /* PLATFORM_WIN32 */
+ x86_alu_reg_reg (s->code, X86_SUB, X86_ESP, tree->left->reg1);
+#endif
+}
+
+void mono_emit_stack_alloc_const (MBCGEN_TYPE* s, MBTREE_TYPE* tree, int size)
+{
+#ifdef PLATFORM_WIN32
+ int i, npages;
+ guint8* br[2];
+
+ if (size > 0xFFE) {
+ /*
+ * Generate stack probe code.
+ * Under Windows, it is necessary to allocate one page at a time,
+ * "touching" stack after each successful sub-allocation. This is
+ * because of the way stack growth is implemented - there is a
+ * guard page before the lowest stack page that is currently commited.
+ * Stack normally grows sequentially so OS traps access to the
+ * guard page and commits more pages when needed.
+ */
+ npages = ((unsigned) size) >> 12;
+ if (npages > 4) {
+ if (tree->reg1 != X86_EAX && tree->left->reg1 != X86_EAX) {
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 0x1000);
+ x86_test_membase_reg (s->code, X86_ESP, 0, X86_ESP);
+ x86_mov_membase_reg (s->code, X86_ESP, 0x1000 - 4, X86_EAX, 4); /* save EAX */
+ x86_mov_reg_imm (s->code, X86_EAX, npages - 1);
+ } else {
+ x86_mov_reg_imm (s->code, X86_EAX, npages);
+ }
+ br[0] = s->code; /* loop */
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 0x1000);
+ x86_test_membase_reg (s->code, X86_ESP, 0, X86_ESP);
+ x86_dec_reg (s->code, X86_EAX);
+ br[1] = s->code; x86_branch8 (s->code, X86_CC_NZ, 0, TRUE);
+ x86_patch (br[1], br[0]);
+ if (tree->reg1 != X86_EAX && tree->left->reg1 != X86_EAX)
+ x86_mov_reg_membase (s->code, X86_EAX, X86_ESP, (npages * 0x1000) - 4, 4); /* restore EAX */
+ } else {
+ /* generate unrolled code for relatively small allocs */
+ for (i = npages; --i >= 0;) {
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, 0x1000);
+ x86_test_membase_reg (s->code, X86_ESP, 0, X86_ESP);
+ }
+ }
+ }
+
+ if (size & 0xFFF) x86_alu_reg_imm (s->code, X86_ADD, X86_ESP, -(size & 0xFFF));
+#else /* PLATFORM_WIN32 */
+ x86_alu_reg_imm (s->code, X86_SUB, X86_ESP, size);
+#endif
+}
+
gpointer
mono_ldvirtftn (MonoObject *this, int slot)
{
@@ -4938,7 +5191,7 @@ mono_ldvirtftn (MonoObject *this, int slot)
m = class->vtable [slot];
if (is_proxy) {
- return arch_create_remoting_trampoline (m);
+ return mono_jit_create_remoting_trampoline (m);
} else {
EnterCriticalSection (metadata_section);
addr = mono_compile_method (m);
@@ -4961,14 +5214,14 @@ mono_ldintftn (MonoObject *this, int slot)
is_proxy = TRUE;
}
- g_assert (slot < class->interface_count);
+ g_assert (slot <= class->max_interface_id);
slot = class->interface_offsets [slot];
m = class->vtable [slot];
if (is_proxy) {
- return arch_create_remoting_trampoline (m);
+ return mono_jit_create_remoting_trampoline (m);
} else {
EnterCriticalSection (metadata_section);
addr = mono_compile_method (m);
diff --git a/mono/metadata/.cvsignore b/mono/metadata/.cvsignore
index 896769d89cf..18f33722269 100644
--- a/mono/metadata/.cvsignore
+++ b/mono/metadata/.cvsignore
@@ -1,5 +1,8 @@
Makefile
Makefile.in
pedump
+monosn
.libs
.deps
+*.lo
+*.la
diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog
index 11dd01a2afe..0d96d5596a7 100644
--- a/mono/metadata/ChangeLog
+++ b/mono/metadata/ChangeLog
@@ -1,3 +1,9795 @@
+2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: use memmove in BlockCopyInternal when the source and
+ destination arrays are the same.
+
+2004-11-09 Martin Baulig <martin@ximian.com>
+
+ * class-internals.h (MonoGenericContainer): Removed `method' and
+ `signature', replaced them with `is_method' and `is_signature'
+ flags. Added `context'.
+
+ * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
+ instead of a `MonoGenericContainer *'.
+
+ * metadata.c (mono_metadata_generic_param_equal): Removed the hack
+ for dynamic type parameters.
+ (mono_metadata_load_generic_params): Setup `container->context'.
+
+ * reflection.c (mono_reflection_setup_generic_class): Setup
+ `tb->generic_container->context'.
+ (do_mono_reflection_bind_generic_parameters): Use
+ mono_class_inflate_generic_type() to correctly inflate types,
+ rather than using our own hack just for MONO_TYPE_VAR.
+
+2004-11-09 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_inflate_generic_method): Small fix; don't
+ crash here.
+
+ * icall.c
+ (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
+ (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
+ (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
+ (ves_icall_Type_BindGenericParameters): Likewise.
+ (ves_icall_Type_get_IsGenericInstance): Likewise.
+ (ves_icall_Type_GetGenericParameterPosition): Likewise.
+ (ves_icall_MonoType_get_HasGenericArguments): Likewise.
+ (ves_icall_MonoType_get_IsGenericParameter): Likewise.
+ (ves_icall_MonoType_get_DeclaringMethod): Likewise.
+
+2004-11-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c (mono_assembly_names_equal): Reenable the comparison of
+ assembly versions and public key tokens. Fixes #69113.
+
+Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c: fix bug introduced with the type cache changes
+ on 2004-11-06.
+
+Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.h, metadata.c, domain-internals.h, marshal.c: include
+ the MonoClass pointer instead of the token in exception clauses.
+ * reflection.c: updates for the above and make the code not depend
+ on the structure of MonoExceptionClause.
+
+2004-11-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
+ Add support for dynamic assemblies. Fixes #69114.
+
+ * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
+
+2004-11-07 Ben Maurer <bmaurer@ximian.com>
+
+ * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
+ since most only those methods use it. the code member of
+ MonoMethodPInvoke was dead, so that can be removed too. Also,
+ remove inline_count (again, not used), and move slot so that it
+ can share bits with some other flags. This saves 8 bytes in the
+ structure and gives us about 50 kb back for mcs helloworld.cs
+
+ * *.[ch]: Do naming changes for the above.
+
+ * loader.c (mono_method_get_header): Lazily init the header
+ on first access.
+ (mono_get_method_from_token): don't init the header here
+ (mono_free_method): the header may never be allocated
+
+ Overall, this saves 150 kb of unmanaged allocations
+ for mcs helloworld.cs. That accounts for 10% of the unmanaged
+ memory at runtime.
+
+ * loader.c, loader.h (mono_method_get_header): new accessor.
+
+ * *.[ch]: use the above method. Prepares us to lazily load
+ the header.
+
+ * *.[ch]: Clean up all the pesky warnings. gcc now only gives
+ three warnings, which are actual bugs (see 69206).
+
+ * class-internals.h (MonoMethod): Remove remoting_tramp. It is
+ unused. Saves a cool 4 bytes / method.
+
+2004-11-06 Ben Maurer <bmaurer@ximian.com>
+
+ * metadata.c (builtin_types): Add types for System.Object here.
+ (mono_metadata_parse_type_full): Cache MonoType*'s that are
+ for a class or valuetype from klass->this_arg or klass->byval_arg.
+
+ On mcs for a hello world, this gets us down from 21836 MonoType's
+ to 14560.
+
+ (mono_metadata_free_type): Account for the above change.
+
+2004-11-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an
+ exception instead of asserting if name is null.
+ (ves_icall_System_AppDomain_GetData): Ditto.
+
+2004-11-05 Zoltan Varga <vargaz@freemail.hu>
+
+ (ves_icall_get_enum_info): Avoid crash when called on a non-finished
+ EnumBuilder.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly):
+ Return NULL when the domain does not have entry_assembly set.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal):
+ Add a 'resource_modules' argument.
+ (ves_icall_type_GetTypeCode): Fix typecode of byref types.
+
+ * reflection.c (mono_reflection_create_runtime_class): Move setting
+ of wastypebuilder here, so mono_get_type_object () returns a MonoType
+ for enums too.
+
+ * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
+ (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
+ Throw an ArgumentNullException if 'ptr' is null.
+
+ * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
+ assemblies here. Fixes #69020.
+
+2004-11-05 Geoff Norton <gnorton@customerdna.com>
+
+ * reflection.c (build_compressed_metadata): Fix the previous patch for
+ big endian systems. GUINT32_FROM_LE isn't needed on strlen and was overwriting
+ the stack.
+
+2004-11-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c (mono_assembly_names_equal): Allow a match if one of
+ the cultures is false. Fixes #69090.
+
+ * reflection.c (build_compressed_metadata): Fix invalid memory read
+ detected by valgrind.
+
+ * reflection.c (mono_reflection_get_type): Avoid triggering a
+ TypeResolve multiple times for the same type. Fixes #65577.
+
+2004-11-04 Ben Maurer <bmaurer@ximian.com>
+
+ * marshal.c: Avoid using ldftn to call managed functions. It is
+ much slower than just a call.
+
+ * reflection.c (mono_module_get_object): free the basename we
+ allocate here from glib.
+
+ * reflection.c (ensure_runtime_vtable): make sure to free
+ overrides. Also, we were allocating an array of MonoMethod not an
+ array of MonoMethod*.
+
+ * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
+
+ * image.c (mono_image_close): free image->guid here.
+
+2004-11-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c: Fix some spec conformance issues with the PE file
+ structures so mcs compiled apps run on the Net 2.0 beta.
+
+2004-11-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * string-icalls.c (ves_icall_System_String_ctor_encoding):
+ Implement this. Fixes #67264.
+
+ * debug-helpers.h debug-helpers.c marshal.c: Move
+ mono_find_method_by_name to debug-helpers.c.
+
+2004-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_release_type_locks): type_initialization_hash is
+ a GHashTable.
+
+ * reflection.c object.c object-internals.h: Fix warnings.
+
+ * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
+ without accessors. Fixes #61561.
+
+ * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
+ application base from the root domain if not set. Fixes #65641.
+ (mono_runtime_init): Fix warning.
+
+2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: call mono_thread_pool_init.
+ * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
+ of worker threads based on the number of CPUs and the environment
+ variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
+ for non-windows (windows) systems.
+
+2004-10-27 Chris Toshok <toshok@ximian.com>
+
+ * mono-debug-debugger.c (write_class): don't call mono_class_init
+ here, as even with the check for (!klass->init_pending), we get
+ into a situation where we're hitting cycles in class
+ initialization. Fixes #68816.
+
+2004-10-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.c: Avoid overwriting values in the loaded_images_hash when an
+ assembly is loaded multiple times. Fixes #61152.
+
+ * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
+ so multiple satellite assemblies for the same name can be loaded.
+ Fixes #68259.
+
+ * mono_domain_assembly_preload: Actually return the loaded assembly,
+ not NULL.
+
+ * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
+ (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
+
+ * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
+ pending finalizers are not invoked after the appdomain has been
+ unloaded. Fixes #67862.
+
+2004-10-22 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c
+ (mono_debugger_runtime_invoke): Don't box valuetypes.
+
+2004-10-22 Chris Toshok <toshok@ximian.com>
+
+ * mono-debug-debugger.c (do_write_class): handle .cctors too, and
+ don't hide private methods.
+
+2004-10-22 Sebastien Pouliot <sebastien@ximian.com>
+
+ * icall.c: Allows the runtime to "share" (when known) the public key
+ token of an assembly. This avoid the need to recalculate the token
+ (from the public key) in managed code.
+
+2004-10-21 Chris Toshok <toshok@ximian.com>
+
+ * debug-helpers.c (append_class_name): argh, revert last patch.
+
+2004-10-21 Chris Toshok <toshok@ximian.com>
+
+ * debug-helpers.c (append_class_name): use '+' as the delimiter,
+ not '/', so that it matches what the debugger uses to look up
+ methods.
+
+2004-10-21 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_throw_exception): New
+ public method; this is called each time an exception is thrown and
+ allows the debugger to use exception catch points.
+
+2004-10-21 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_handle_exception): Write
+ the stack pointer and the exception object in some struct and pass
+ that to the debugger.
+
+2004-10-21 Chris Toshok <toshok@ximian.com>
+
+ * mono-debug-debugger.c (do_write_class): add instance/static
+ event support. We don't expose "raise" or "other" yet.
+ (event_is_static): new method.
+
+2004-10-20 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono-debug-debugger.c
+ (mono_debugger_handle_exception): Remove
+ bogus return value for fussy compilers.
+
+2004-10-20 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c
+ (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
+ (mono_debugger_handled_exception): Likewise.
+
+2004-10-20 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.h (MonoDebuggerEvent): Added
+ MONO_DEBUGGER_EVENT_EXCEPTION.
+
+ * mono-debug-debugger.c (mono_debugger_handle_exception): New
+ public function to send the debugger a notification for an
+ exception and inform it about a catch/finally clause.
+
+2004-10-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
+ Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
+ fix 2.95 build.
+
+ * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
+
+2004-10-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
+ marshalled as [In,Out]. Fixes #58325.
+
+2004-10-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_method_body_get_object): Implement some fields.
+
+2004-10-12 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Small
+ fix, correctly retrieve our parent from a generic instance.
+
+2004-10-12 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (mono_metadata_generic_param_equal): We always have
+ an owner.
+
+ * class.c
+ (mono_class_from_generic_parameter): We need to have an owner.
+ (my_mono_class_from_generic_parameter): Likewise.
+
+ * reflection.c (mono_reflection_setup_generic_class): Renamed to
+ mono_reflection_create_generic_class() and added a new
+ mono_reflection_setup_generic_class().
+ (mono_reflection_initialize_generic_param): If we're a nested
+ generic type and inherited from the containing class, set our
+ owner to the outer class.
+
+2004-10-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
+
+ * reflection.c (mono_method_body_get_object): New function to create
+ a MethodBody object.
+
+ * object-internals.h object.h: Add MonoReflectionMethodBody structure.
+
+2004-10-11 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (_mono_metadata_type_equal): Renamed to
+ do_mono_metadata_type_equal() and made static.
+
+2004-10-11 Martin Baulig <martin@ximian.com>
+
+ * appdomain.c: Bump corlib version number to 28.
+
+2004-10-10 Martin Baulig <martin@ximian.com>
+
+ * class-internals.h
+ (MonoGenericInst): Added `MonoGenericContainer *container'.
+ (MonoGenericMethod): Likewise.
+ (MonoGenericContext): Likewise.
+ (MonoGenericParam): Added `MonoGenericContainer *owner'.
+
+ * metadata.c
+ (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
+ (do_mono_metadata_parse_generic_inst): Likewise.
+ (mono_metadata_parse_type_full): New public method. This is the actual
+ mono_metadata_parse_type() implementation - with an additional
+ `MonoGenericContainer *' argument.
+ (mono_metadata_parse_array_full): Likewise.
+ (mono_metadata_parse_signature_full): Likewise.
+ (mono_metadata_parse_method_signature_full): Likewise.
+ (mono_metadata_parse_mh_full): Likewise.
+ (mono_type_create_from_typespec): Likewise.
+ (mono_metadata_interfaces_from_typedef_full): New public method;
+ this is similar to the other _full() methods, but we take a
+ `MonoGenericContext *' since we have to pass it to mono_class_get_full().
+ (mono_metadata_parse_generic_param): Take an additional
+ `MonoGenericContainer *' argument and lookup the MonoGenericParam
+ from that container.
+ (mono_metadata_generic_param_equal): New static method to compare
+ two type parameters.
+ (_mono_metadata_type_equal): New static method; takes an
+ additional `gboolean signature_only' argument - if true, we don't
+ compare the owners of generic parameters.
+ (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
+ with a TRUE argument - do a signature-only comparision.
+
+ * loader.c: Use the new _full() methods and pass the
+ MonoGenericContainer to them.
+
+ * object-internals.h (MonoReflectionTypeBuilder): Added
+ `MonoGenericContainer *generic_container' field.
+ (MonoReflectionMethodBuilder): Likewise.
+
+2004-10-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
+ case initial images of dynamic assemblies.
+
+ * reflection.c (mono_image_basic_init): Set 'initial_image' field.
+
+ * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
+
+ * reflection.c (mono_reflection_event_builder_get_event_info): Fix
+ length of event->other array.
+ (typebuilder_setup_events): Ditto.
+
+ * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
+ 'assembly_by_name' and add an 'assemblies' list.
+
+ * assembly.h assembly.c: Add a new search hook for determining whenever
+ an assembly is already loaded. Use this instead of searching in the
+ loaded_assemblies list.
+
+ * domain.c appdomain.c: Implement the new search hook so loaded
+ assemblies are now scoped by appdomain. Fixes #67727.
+
+2004-10-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * threads.c (mono_thread_attach): Initialize synch_lock field so
+ mono_thread_detach works again.
+
+ * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
+ 'lib' too. Fixes #63130.
+
+2004-10-06 Jackson Harper <jackson@ximian.com>
+
+ * culture-info-tables.h: regenerated.
+
+2004-10-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_Type_GetInterfaces): Include interfaces
+ implemented by other interfaces in the result. Fixes #65764.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
+ Handle unloadable modules without crashing.
+
+ * image.c (load_modules): Revert the previous patch since modules must
+ have a fixed index inside the array.
+
+ * image.c (load_modules): Don't include native modules in the modules
+ array.
+
+2004-10-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h: Add param_defaults field.
+
+ * reflection.c: Add support for parameter defaults in dynamic methods.
+ Fixes #64595.
+
+ * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
+ an empty string when a type has no namespace. Fixes #64230.
+
+2004-10-04 Sebastien Pouliot <sebastien@ximian.com>
+
+ * tabledefs.h: Added "internal" security actions to support non-CAS
+ permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance.
+ Note: they do not seems to be used anymore in 2.0 (new metadata format)
+
+2004-10-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
+ constructor of abstract class. Fixes #61689.
+
+2004-10-04 Martin Baulig <martin@ximian.com>
+
+ * class-internals.h (MonoGenericContainer): New type.
+ (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
+ `MonoGenericContainer *generic_container'.
+ (MonoClass): Replaced `gen_params' and `num_gen_params' with
+ `MonoGenericContainer *generic_container'.
+
+ * metadata.c (mono_metadata_load_generic_params): Return a
+ `MonoGenericContainer *' instead of a `MonoGenericParam *';
+ removed the `num' argument.
+
+2004-10-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
+ for dynamic images.
+
+ * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
+ machine fields.
+
+ * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
+
+ * reflection.c: Save pe_kind and machine values into the generated
+ image file.
+
+ * appdomain.c: Bump corlib version number.
+
+ * object-internals.h: Reorganize layout of LocalBuilder.
+
+ * class-internals.h class.c (mono_class_get_implemented_interfaces):
+ New helper function.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
+ created MonoType for dynamic types. Fixes #66180.
+
+2004-10-02 Ben Maurer <bmaurer@ximian.com>
+
+ * threadpool.c: the ares hashtable needs a critical section around it.
+ this prevents some nasty segfaults
+
+2004-10-02 Massimiliano Mantione <massi@ximian.com>
+
+ * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
+ on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
+ bug 67324).
+
+2004-09-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
+
+2004-09-30 Lluis Sanchez Gual <lluis@novell.com>
+
+ * image.c: Always canonicalize image file names, to avoid loading
+ the same assembly twice when referenced using a relative path.
+
+2004-09-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.h marshal.c icall.c: Fix bugs in previous patch.
+
+ * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
+
+ * marshal.c: Fix warnings.
+
+2004-09-29 Geoff Norton <gnorton@customerdna.com>
+
+ * marshal.c (mono_ftnptr_to_delegate): This method was improperly
+ attempting to marshal the delegate_trampoline as the method_addr.
+ This patch has a static hashtable of marshalled delegates so that
+ we can map delegate_trampoline addresses back to delegates. This
+ allows a delegate passed to managed code to be passed back into native
+ code. Fixes #67039
+
+2004-09-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c: Add GetFunctionPointerForDelegateInternal icall.
+
+ * reflection.c (method_encode_code): Align method headers properly.
+ Fixes #66025.
+
+2004-09-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * marshal.c: In the runtime invoke wrapper, reset the abort
+ exception if it is cached. This avoids the automatic rethrowal of
+ the exception after the catch of the wrapper. Also check for pending
+ interruptions before calling the managed method. This is done using
+ the new method emit_thread_force_interrupt_checkpoint, since the
+ normal checkpoint method is ignored when running the invoke wrapper.
+ * object.c: If the abort exception is rethrown, set the abort_exc
+ field of the thread, so it will be rethrown aftere every catch.
+ * threadpool.c: Only run an interruption checkpoint if what has been
+ requested is a stop of the thread (aborts will be ignored).
+ * threads.c: By default, a thread will now never be interrumped while
+ running the runtime invoke wrapper (this ensures that runtime_invoke
+ will always return to the caller if an exception pointer is provided).
+ There is a new special method mono_thread_force_interruption_checkpoint()
+ to force an interruption checkpoint even if running a protected
+ wrapper, which is used by the same runtime invoke wrapper to do a check
+ at a safe point.
+
+2004-09-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * object.c, object-internals.h: Implemented mono_release_type_locks,
+ which releases the cctor locks held by a thread.
+ * threads.c, threads.h: In thread_cleanup, release cctor locks held
+ by a thread. Added mono_thread_exit() method to be used to safely stop
+ a thread.
+
+2004-09-28 Raja R Harinath <rharinath@novell.com>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
+ Move null check before dereference. Avoid indexing beyond the end
+ of the 'modules' array.
+
+2004-09-28 Raja R Harinath <rharinath@novell.com>
+
+ * metadata-internals.h (MonoImage): Add module_count field.
+ * image.c (load_modules): Set image->module_count.
+ (mono_image_load_file_for_image): Use image->module_count.
+ * reflection.c (mono_image_load_module): Append to image->modules array
+ of dynamic assembly.
+ (mono_module_get_object): Fix loop to actually increment index.
+ Use image->module_count.
+ * assembly.c (mono_assembly_load_references): Use image->module_count.
+ * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
+ Likewise.
+
+2004-09-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
+ Avoid assert on generic types.
+
+2004-09-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
+
+ * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
+
+ * reflection.c (mono_reflection_marshal_from_marshal_spec): New
+ function to convert a MarshalSpec structure to its managed counterpart.
+
+ * reflection.c: Fix warnings.
+
+ * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
+ field.
+
+ * icall.c (mono_create_icall_signature): Fix build.
+
+2004-09-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c: Add MakePointType icall.
+
+ * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
+ warnings.
+
+2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: reuse allocated slots in the queue.
+
+2004-09-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * object-internals.h (MonoReflectionDllImportAttribute): New structure.
+
+ * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
+
+ * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
+ previous change.
+
+ * tabledefs.h: Add constants for pinvoke attributes BestFit and
+ ThrowOnUnmappableChar.
+
+ * icall.c (ves_icall_Type_GetPacking): New icall.
+
+2004-09-24 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
+
+2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c:
+ (mono_domain_set): allow setting a domain that is being unloaded.
+ (mono_domain_unload): invoke the DomainUnload callbacks in the domain
+ being unloaded.
+
+2004-09-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
+ the GetCustomAttributes icall.
+
+2004-09-23 Martin Baulig <martin@ximian.com>
+
+ * object-internals.h (MonoReflectionGenericParam): Replaced
+ 'has_ctor_constraint', `has_reference_type' and `has_value_type'
+ with `guint32 attrs'.
+
+2004-09-23 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
+
+2004-09-23 Martin Baulig <martin@ximian.com>
+
+ * object-internals.h (GenericParameterAttributes): New enum.
+
+2004-09-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * object-internals.h (MonoEventInfo): Add 'other_methods' field.
+
+ * class.c (init_events): Fill out event->other field.
+
+ * class.c: Fix warnings.
+
+ * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
+
+Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
+ walk which doesn't supply the IL offset.
+
+2004-09-22 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_setup_internal_class): If we're
+ System.ValueType, System.Object or System.Enum, set
+ `klass->instance_size' and create the vtable.
+ (mono_reflection_create_internal_class): If we're an enum type,
+ get the base class from our current corlib.
+
+2004-09-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h (MonoResolveTokenError): New type.
+
+ * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
+ icall.
+
+ * icall.c: Add an 'error' argument to the ResolveToken icalls.
+
+2004-09-22 Lluis Sanchez Gual <lluis@novell.com>
+
+ * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
+ Support also calling constructors, but only for already allocated objects.
+
+2004-09-17 Geoff Norton <gnorton@customerdna.com>
+
+ * reflection.c (type_get_qualified_name): If the klass is null
+ return the typename to avoid a NullRefEx.
+ (encode_cattr_value): Get the qualified name of the boxed type,
+ not the underlying enumtype. Fixes #62984.
+
+2004-09-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c: Fix problems with previous checkin.
+
+2004-09-21 <vargaz@freemail.hu>
+
+ * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
+ existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
+
+ * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
+
+2004-09-21 Geoff Norton <gnorton@customerdna.com>
+
+ * icall.c (ves_icall_MonoType_GetElementType): GetElementType
+ should only return a type for pointers, arrays, and passbyref types.
+ Fixes bug #63841.
+
+2004-09-21 Martin Baulig <martin@ximian.com>
+
+ * domain.c (mono_debugger_check_runtime_version): New public
+ function.
+
+ * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.
+
+2004-09-20 Sebastien Pouliot <sebastien@ximian.com>
+
+ * reflection.c: Added missing sort to the declarative security
+ attributes table. MS implementation stops seeing the attributes if the
+ token number regress in the table (as shown by ildasm and permview).
+
+2004-09-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * object-internals.h (MonoReflectionModule): Add 'token' field.
+
+ * reflection.c (mono_reflection_get_token): Add support for Module
+ and Assembly.
+ (mono_module_get_object): Set 'token' field.
+ (mono_module_file_get_object): Set 'token' field.
+
+ * icall.c: Add new Assembly and Module icalls.
+
+ * appdomain.c: Bump corlib version.
+
+2004-09-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.h loader.c class.h class.c: Add helper functions for obtaining
+ tokens of metadata objects.
+
+ * reflection.h reflection.c (mono_reflection_get_token): New function
+ to obtain the token of a metadata object.
+
+ * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
+
+2004-09-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
+
+ * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
+
+2004-09-16 Sebastien Pouliot <sebastien@ximian.com>
+
+ * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
+ * object-internals.h: Added 3 MonoArray* members to MonoReflection
+ AssemblyBuilder to access the permissions set in the class lib.
+ * reflection.c: Added security attributes encoding step in
+ mono_image_build_metadata.
+ * tabledefs.h: Added new security actions defined in 2.0:
+ LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
+
+2004-09-16 Lluis Sanchez Gual <lluis@novell.com>
+
+ * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
+ macro parameter.
+
+2004-09-16 Lluis Sanchez Gual <lluis@novell.com>
+
+ * locales.c: nullify the ICU_collator member of CompareInfo when it is
+ finalized. There where random SIGSEVs at program termination, when
+ an object being finalized was trying to do a string comparison and
+ the current culture was already finalized.
+
+2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c: call thread_cleanup before finishing the thread if we get
+ there.
+
+2004-09-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
+ assemblies from the parent. Fixes #65665.
+
+2004-09-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.c (mono_metadata_parse_type): Fix parsing of custom
+ modifiers.
+
+2004-09-14 Bernie Solomon <bernard@ugsolutions.com>
+
+ * reflection.h: add prototype for mono_get_dbnull_object
+ * reflection.c: add prototypes for get_default_param_value_blobs
+ and mono_get_object_from_blob for fussier compilers
+
+2004-09-14 Lluis Sanchez Gual <lluis@novell.com>
+
+ * object.c: Added a "done" flag to TypeInitializationLock. This avoids
+ false deadlock checks in class initialization.
+
+2004-09-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.c (mono_image_addref): Fix comment.
+
+ * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
+ possible.
+
+2004-09-12 Jambunathan K <kjambunathan@novell.com>
+
+ * reflection.c (mono_param_get_objects): Modified to return
+ ParameterInfo.DefaultValue object.
+
+ (get_default_param_value_blobs):
+ (mono_get_object_from_blob):
+ (mono_get_dbnull_object): New helper routines.
+
+ * object.c (mono_get_constant_value_from_blob): New helper routine
+ carved out from get_default_field_value ()
+
+ * object-internals.h (mono_get_constant_value_from_blob): Added
+ function declaration.
+
+2004-09-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load
+ referenced assemblies. Fixes #62135.
+
+ * exception.h exception.c (mono_get_exception_file_not_found2): New
+ helper function.
+
+2004-09-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.h class.c: Add mono_type_get_underlying_type ().
+
+2004-09-09 Geoff Norton <gnorton@customerndna.com>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
+ Fix GetTypes() to support dynamically created assemblies.
+
+2004-09-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
+
+ * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
+ previous patch.
+
+ * reflection.h reflection.c loader.c: Allow dynamic construction of
+ pinvoke methods. Fixes #65571.
+
+ * reflection.c (mono_reflection_get_type): Revert previous change since
+ it causes regressions.
+
+2004-09-08 Martin Baulig <martin@ximian.com>
+
+ * class.c (class_compute_field_layout): Don't call
+ mono_class_layout_fields() for open generic instances.
+
+2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
+ * threads.c appdomain.c: fix typo in GC macro
+
+2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c: don't call mono_thread_detach() in start_wrapper(),
+ avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
+
+2004-09-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.c (mono_image_close): Applied patch from
+ vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
+ assembly is loaded multiple times from data.
+
+ * image.c (mono_image_open): Fix warning.
+
+2004-09-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h reflection.c icall.c: Only call TypeResolve handlers
+ once. Fixes #58334.
+
+ * reflection.c (mono_reflection_create_runtime_class): Initialize
+ klass->nested_classes. Fixes #61224.
+
+Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * threads.c: sched_yield() on exit, to allow threads to quit.
+
+2004-09-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_unhandled_exception): Remove leftover debug code.
+
+2004-09-07 Atsushi Enomoto <atsushi@ximian.com>
+
+ * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
+
+2004-09-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (emit_marshal_array): Really null terminate string arrays.
+
+ * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (emit_marshal_array): Null terminate string arrays.
+
+ * marshal.c (raise_auto_layout_exception): Fix warning.
+
+ * reflection.c (mono_param_get_objects): Initialize the default value
+ with DBNull.Value, not null. Fixes #62123.
+
+2004-09-01 Miguel de Icaza <miguel@ximian.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
+ throw an exception with a cute explanation.
+
+2004-09-06 Dick Porter <dick@ximian.com>
+
+ * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
+ Close the new process's thread handle, as we don't use it. The
+ handle stays around forever otherwise.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (arith_overflow): Fix warning.
+
+ * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
+ calling conventions in method refs. Fixes #65352.
+
+ * reflection.c: Fix warnings.
+
+2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * icall.c: Add a new icall for Array.Clear
+
+2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * object.c: When allocating an array, we have to throw
+ an overflow exception if any of the lengths are < 0.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.h marshal.c: Free unmanaged memory allocated by managed code
+ properly. Also move implementation of string array marshalling to
+ managed code. Fixes #42316.
+
+2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * assembly.c: provide more information when loading an assembly fails.
+
+2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * filewatcher.c: don't expect the development fam package to be
+ installed.
+
+2004-09-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c: Make a copy of the signature cookie since it will be
+ freed by the caller.
+
+ * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
+
+ * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
+
+ * metadata.c (mono_metadata_free_marshal_spec): New function to free
+ marshal specs.
+
+ * marshal.c: More refactoring.
+
+ * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
+ smaller functions.
+
+2004-09-03 Lluis Sanchez Gual <lluis@novell.com>
+
+ * object.c: In mono_message_invoke, fill the output parameter array after
+ calling the managed method (it was done before the call). This fixes
+ bug #59299.
+
+2004-09-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
+ as well.
+
+2004-09-02 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_instance_size): Don't allow generic type
+ definitions or open generic instances.
+ (mono_class_array_element_size): If we're a value type, call
+ mono_class_instance_size() on the original class.
+
+ * metadata.c (mono_type_size, mono_type_stack_size): Correctly
+ handle generic instances.
+
+ * mono-debug-debugger.c (write_type): Handle generic instances
+ like classes.
+
+2004-09-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
+ the allocation request fails. Fixes #65089.
+
+ * object.c (mono_runtime_free_method): Do not call mono_free_method.
+
+ * object.c (mono_runtime_free_method): New function to free a dynamic
+ method.
+
+ * marshal.c (mono_delegate_free_ftnptr): New function to free the
+ delegate trampoline.
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
+ with hasthis as dynamic,
+
+ * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
+
+ * domain.c (mono_jit_info_table_remove): New function to remove an
+ entry from the jit info table.
+
+ * class-internals.h (MonoMethod): Add 'dynamic' field.
+
+ * loader.c: Fix warnings.
+
+2004-09-01 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
+ instead of mono_debugger_lock() because the latter one is a no-op
+ unless running in the debugger.
+
+2004-09-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (class_compute_field_layout): Classes with auto-layout or
+ reference fields are not blittable.
+
+2004-09-01 Dick Porter <dick@ximian.com>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
+ mono_image_get_filename() to get the assembly location.
+
+ * icall.c:
+ * metadata.h: Fix compile warnings
+
+2004-09-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (class_compute_field_layout): System.Object is blittable.
+
+ * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
+ as in/out. Fixes #59909.
+
+2004-09-01 Martin Baulig <martin@ximian.com>
+
+ * metadata.h (MONO_TYPE_ISREFERENCE): Call
+ mono_metadata_generic_inst_is_valuetype() if we're a generic
+ instance to check whether our underlying type is a reference type.
+
+2004-09-01 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (mono_type_size): If we're a generic instance, call
+ mono_class_value_size() for value types.
+
+2004-08-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c: Implement more custom marshalling functionality. Fixes
+ #64915.
+
+Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-debug.c, debug-mono-symfile.c: add some locking love.
+
+2004-08-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
+
+ * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
+
+ * icall.c: Fix some warnings.
+
+ * threads.c (abort_appdomain_thread): Fix unref errors.
+ (mono_thread_current): Fix THREAD_DEBUG define.
+
+2004-08-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
+
+ * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
+
+2004-08-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Add support for byref
+ string arrays.
+
+2004-08-28 Martin Baulig <martin@ximian.com>
+
+ * metadata.c
+ (mono_metadata_generic_inst_is_valuetype): New public function.
+
+ * metadata.h (MONO_TYPE_ISSTRUCT): Call
+ mono_metadata_generic_inst_is_valuetype() if we're a generic
+ instance to check whether our underlying type is a valuetype.
+
+2004-08-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
+ #63768.
+
+2004-08-25 Martin Baulig <martin@ximian.com>
+
+ * loader.c (mono_get_method_from_token): Abstract methods can also
+ be generic and thus have type parameters.
+
+ * metadata-internals.h
+ (MonoDynamicImage): Added `GPtrArray *gen_params'.
+
+ * reflection.c (mono_image_get_generic_param_info): Don't create a
+ metadata row, just add an entry to the `gen_params' array.
+ (build_compressed_metadata): Sort the `gen_params' array and then
+ actually create the metadata.
+
+2004-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
+
+2004-08-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
+
+2004-08-24 Martin Baulig <martin@ximian.com>
+
+ * class.cs (mono_class_is_subclass_of): Like an interface, a
+ generic instance also derives from System.Object.
+
+2004-08-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
+ custom modifiers to be in any order. Fixes #61990.
+
+2004-08-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c: Register mono_object_new_fast icall.
+
+ * object.c (mono_class_get_allocation_ftn): Return to calling
+ mono_object_new_fast, since it seems faster to compute the object
+ size in unmanaged code than passing it as a parameter.
+
+ * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
+
+ * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
+ this function with Boehm as the oom handler, so we don't have to check
+ the result of GC_malloc.
+
+ * object.c: Remove checks for oom.
+
+ * object.h object.c (mono_class_get_allocation_ftn): New function to
+ return the icall which can be used to allocate an instance of a given
+ class.
+
+ * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
+
+ * class-internals.h: Add 'enabled' field.
+
+2004-08-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
+
+2004-08-18 Jambunathan K <kjambunathan@novell.com>
+ * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
+ value 0x0010.
+
+2004-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * appdomain.c: use the Tls function for appdomain too,
+ at Zoltan's request. Actually return in mono_context_get
+
+ * appdomain.c, profiler.c, threads.c: use __thread
+
+2004-08-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c threads.c: Call GC_CreateThread on windows.
+
+ * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
+ multiple libraries since this don't work on windows.
+
+2004-08-18 Martin Baulig <martin@ximian.com>
+
+ * class-internals.h
+ (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
+ MonoMethodHeader.
+
+ * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
+ MonoMethodNormal since we also need it for abstract and interface
+ methods.
+
+ * reflection.c
+ (build_compressed_metadata): Sort the GenericParam table.
+ (mono_image_create_token): Added `gboolean create_methodspec'
+ argument; this is false when generating a MethodImpl token.
+ (reflection_methodbuilder_to_mono_method): Abstract and interface
+ methods may also have generic parameters.
+
+2004-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * appdomain.c: thread local alloc
+
+2004-08-17 Martin Baulig <martin@ximian.com>
+
+ * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
+
+ * icall.c
+ (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
+ argument.
+
+ * class.c (mono_type_get_full_name): New public function.
+ (mono_type_get_name): Don't include the type arguments.
+
+2004-08-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Build static versions of libmetadata and libmonoruntime
+ for inclusion into the mono executable.
+
+2004-08-16 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (do_mono_metadata_parse_generic_inst): Store the
+ MonoGenericInst, not the MonoType in the `generic_inst_cache'.
+
+2004-08-14 Martin Baulig <martin@ximian.com>
+
+ * class.c (dup_type): Also copy the `byref' field.
+
+2004-08-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (create_dynamic_mono_image): Revert the last change
+ since it breaks bootstrap.
+
+2004-08-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
+
+ * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
+ not free them with g_free.
+
+2004-08-11 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_setup_internal_class): Also call
+ mono_class_setup_mono_type() if we already have a `tb->type.type'.
+
+2004-08-09 Sebastien Pouliot <sebastien@ximian.com>
+
+ * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when
+ called during default (first) AppDomain creation. Keep track of
+ Evidence when loading assemblies.
+
+Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * opcodes.c, opcodes.h: reduce runtime relocations.
+
+Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * culture-info.h, locales.c: fixes and chages to sue the new
+ optimized format of the locale data.
+ * culture-info-tables.h: regenerated.
+
+2004-08-06 Geoff Norton <gnorton@customerdna.com>
+
+ * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
+
+2004-08-05 Sebastien Pouliot <sebastien@ximian.com>
+
+ * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
+ ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
+ * domain-internals.h: icall declaration.
+ * icall.c: icall registration.
+ * object-internals.h: New fields in MonoAssembly for CAS.
+
+2004-08-05 Duncan Mak <duncan@ximian.com>
+
+ * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
+ CEE_LDELEM_ANY.
+
+Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fix to deal with object[] arrays in custom ctors
+ (bug #62550).
+
+2004-08-05 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_array_element_size): Added support for
+ generic instances and correctly handle "recursive" types.
+
+2004-08-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c: Fix warnings.
+
+2004-08-04 Martin Baulig <martin@ximian.com>
+
+ * class.c
+ (mono_type_get_name_recurse): Added `gboolean include_arity'
+ argument specifying whether or not we should include the generic
+ arity in the type name.
+ (_mono_type_get_name): New static function.
+ (mono_class_setup_vtable): If we're a generic instance, don't
+ include the generic arity in the names of explicit method
+ implementations.
+
+2004-08-03 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_type_get_name_recurse): Enclose the generic type
+ arguments in `<', '>'.
+
+Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: make GC warning messages use the trace API, they are just
+ noise to most of the users.
+
+2004-08-03 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c (read_string): Correctly read the string.
+
+2004-07-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (signature_dup_add_this): Fix bug in previous patch.
+
+ * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
+ icalls.
+ (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
+
+2004-07-30 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
+ Reflect latest symbol writer changes.
+
+Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: always create an object if null is passed
+ to Invoke() where a valuetype is expected.
+
+2004-07-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * marshal.c (mono_marshal_init): make managed
+ signatures match native ones better for 64bits.
+
+2004-07-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: hack to build correctly the private bin path on windows.
+ Fixes bug #61991.
+
+2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * assembly.c: Load mscorlib from the correct framework directory
+ (mono/<version>/mscorlib.dll).
+ * appdomain.h: Added prototypes for new functions.
+ * internals.h: Added some prototypes.
+ * domain.c: When initializing the runtime, get from the executable and
+ the configuration files the runtime version that the app supports.
+ Added support methods for reading app.exe.config. Added list of versions
+ supported by the JIT. Added two new methods: mono_init_from_assembly,
+ which initializes the runtime and determines the required version from
+ the provided exe file, and mono_init_version, which initializes
+ the runtime using the provided version.
+ * icall.c: Get machine.config from version-specific directory.
+ * reflection.c: When generating an image, embed the version number
+ of the current runtime.
+
+2004-07-28 Dick Porter <dick@ximian.com>
+
+ * socket-io.c
+ (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
+ returned sockaddr size before creating the remote address object.
+ Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
+ 61608.
+
+2004-07-28 Dick Porter <dick@ximian.com>
+
+ * locales.c (string_invariant_compare_char): Fix invariant char
+ compares between upper and lower cases. Fixes bug 61458.
+
+2004-07-27 Ben Maurer <bmaurer@ximain.com>
+
+ * marshal.c: actually cache stelem.ref wrappers.
+
+Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image
+ sections and remove the mono_cli_rva_map () function.
+
+Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * debug-mono-symfile.c: fix one more endianess issue, from a patch
+ by Geoff Norton (<gnorton@customerdna.com>).
+
+Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: fix class loads for pointer types (typeof(int) !=
+ typeof(int*)).
+
+2004-07-27 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
+ reading the debugging information from an external ".mdb" file.
+
+2004-07-24 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_image_get_type_info): Only write a class
+ layout entry if we actually have a size or a packing size.
+
+2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * reflection.c (type_get_fully_qualified_name):
+ insert cast to get type checking of ?: with non-gcc compilers
+
+2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * rand.c: use g_getenv for both lookups of
+ MONO_EGD_SOCKET
+
+2004-07-17 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_bind_generic_method_parameters):
+ Set `gmethod->reflection_info'.
+
+2004-07-17 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_create_from_typedef): Insert the newly
+ created class into the hash table before computing the interfaces
+ since we could be called recursively.
+
+2004-07-16 Ben Maurer <bmaurer@ximain.com>
+
+ * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
+ function to implement stelem.ref in managed code
+ * class-internals.h, debug-helpers.c: a new wrapper type
+ for the above.
+
+Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: allow GC handles to work even when no GC is compiled in.
+ Fix part of bug #61134 (GetAddrOfPinnedObject).
+
+2004-07-13 Peter Williams <peter@newton.cx>
+
+ * process.c (complete_path): Make sure we don't attempt to execute
+ directories.
+
+2004-07-12 Geoff Norton <gnorton@customerdna.com>
+
+ * DateTime.cs: Patch for bug #61112. Our DateTime wasn't roundtripping over timezone
+ boundaries properly. This patch checkes ToLocalTime() to see if we're tripping over a boundary
+ and will add/subtract the hour if needed
+
+2004-07-12 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_field_get_object): If we have
+ `field->generic_info', take the attributes from
+ `field->generic_info->generic_type'.
+
+2004-07-12 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
+ This function must be called before initializing the runtime.
+ (mono_debug_init_1): New function; call this after initializing
+ the runtime, but before loading the assembly. It tells the
+ debugger to load corlib and the builtin types.
+
+ * mono-debug-debugger.c: Did some larger changes in the debugging
+ code; support recursive class declarations, make sure we actually
+ add all classes.
+
+2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * debug-helpers.c: undo my previous patch and fixed the real issue in
+ ../mini/exceptions-x86.c
+
+2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
+ when no HOME env. variable was set and a NullRef was thrown in a .cctor
+ called from other .cctors.
+
+2004-07-09 Miguel de Icaza <miguel@ximian.com>
+
+ * loader.c: Removed the mono_loader_wine_init hack now that we are
+ doing a managed version of Windows.Forms.
+
+2004-07-09 Ben Maurer <bmaurer@ximian.com>
+
+ * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
+ threadpool.c, threads.c: remove static data from rootset.
+
+2004-07-09 Dick Porter <dick@ximian.com>
+
+ * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
+ Don't do any more processing if the matched length was 0. It was
+ increasing the size of the string before. Fixes bug 61167.
+
+2004-07-09 Dick Porter <dick@ximian.com>
+
+ * socket-io.h:
+ * socket-io.c
+ (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
+ Add support for SO_PEERCRED if its available.
+
+2004-07-09 Peter Bartok <pbartok@novell.com>
+ * loader.c: winelib.exe.so error message is now only displayed if
+ MONO_DEBUG is set. To help us avoid questions when people are trying
+ out the new Managed.Windows.Forms.
+
+2004-07-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * class-internals.h debug-helpers.c marshal.c: Add new wrapper types
+ for isinst and castclass wrappers.
+
+ * class-internals.h icall.c: Move registration and lookup of JIT icalls
+ to libmetadata from the JIT, so they could be used by the marshalling
+ code and the interpreter.
+
+ * marshal.c: Register marshalling related JIT icalls here instead of
+ in mini.c. Use CEE_MONO_ICALL instead of the family of
+ CEE_MONO_PROC<x> opcodes to call marshalling functions.
+
+ * metadata.h: Remove unneeded marshalling conversions.
+
+ * opcodes.c: Update for new opcodes.
+
+2004-07-08 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
+ (mono_debug_get_domain_data): Make this function static.
+
+Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c, object.h: add nice GC handle API for embedders.
+
+2004-07-06 Ben Maurer <bmaurer@ximian.com>
+
+ * reflection.c: more changes for the new api
+
+ * object.c: When we reflect on a field w/ a constant value, it
+ will not have a memory location, so we must access metadata. Also,
+ allow easier reading of strings so that we can read them from
+ the constant data.
+
+ * class.c (mono_class_layout_fields): no need for literal fields here.
+
+ * class-internals.h: api changes for const fields
+
+ * icall.c (ves_icall_get_enum_info): use new apis for const fields
+
+2004-07-06 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.h: Increment version number to 44.
+
+ * mono-debug.c (mono_debug_add_wrapper): The second argument is
+ now a gpointer, rewrote this whole method.
+
+ * mono-debug-debugger.c (mono_debugger_add_wrapper): New
+ function. Add information about the wrapper in a new "misc table".
+
+ * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
+ for the new misc table.
+
+2004-07-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata-internals.h image.c: Add a cache for helper signatures.
+
+ * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
+
+2004-07-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
+ delegates from a delegate. Fixes #61033.
+
+ * marshal.c: Fix managed->native stringbuilder marshalling. Implement
+ marshalling of stringbuilder arrays. Fixes #59900.
+
+2004-07-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c: Add EnumBuilder:setup_enum_type icall.
+
+2004-06-30 Ben Maurer <bmaurer@ximian.com>
+
+ * icall.c: Added a new icall for the property version of
+ OffsetOfStringData.
+
+2004-06-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
+ it has a constant size across platforms.
+
+ * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
+ stack trace.
+
+2004-06-29 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.c (mono_debug_add_method): Protect the whole function
+ in mono_debugger_lock(), not just parts of it.
+
+Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: make sure padding bytes in heaps are zeroed.
+
+2004-06-24 David Waite <mass@akuma.org>
+
+ * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
+ image.c, loader.c, locales.c, marshal.c, metadata.c,
+ mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
+ string-icalls.c, threads.c: change to C90-style comments from C99 /
+ C++ -style
+
+2004-06-24 Dick Porter <dick@ximian.com>
+
+ * threads.c
+ (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
+ return createdNew. Fixes bug 60412.
+
+ * threads-types.h:
+ * icall.c: Add createdNew parameter to CreateMutex icall
+
+Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c, object-internals.h: save default value in params.
+
+2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: for paths in PrivateBinPath that are absolute, there's
+ no need to build a new path combining that with the application base.
+ Fixes bug #60442.
+
+Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fixed minor standard compliance issues.
+
+Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fixed issue with encoding some custom attributes
+ (arrays in properties and fields, bug #60411).
+
+2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c: fix start address when copying the public key token.
+
+2004-06-23 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
+ the `exc' object in a static object to put it into the GC's root set.
+
+Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: make mono_reflection_setup_internal_class ()
+ callable a second time to setup a new parent class.
+
+2004-06-23 Dick Porter <dick@ximian.com>
+
+ * threads.c: Check for WAIT_IO_COMPLETION return values.
+
+2004-06-22 Sebastien Pouliot <sebastien@ximian.com>
+
+ * appdomain.c: Removed the g_free on the public key token. Now copy
+ the pk token string into the MonoAssemblyName buffer using g_strlcpy.
+ * assembly.c: Added public key token string value when loading
+ assemblies. Fix bug #60439.
+ * icall.c: Added missing informations (like public key) in
+ GetReferencedAssemblies. Fix #60519.
+ * image.h: Changed definition for public key token from const char*
+ public_tok_value to guchar public_key_token [17];
+ * reflection.c: Updated for changes to public key token.
+
+2004-06-22 Lluis Sanchez Gual
+
+ * icall.c: In ves_icall_InternalExecute, when setting a filed, also look
+ for the field in base classes.
+
+Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
+ mark headers as not supported, they are installed only for use by the
+ debugger.
+
+Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * *.c, *.h: avoid namespace pollution in public headers.
+
+2004-06-21 Martin Baulig <martin@ximian.com>
+
+ * exception.c (mono_get_exception_security): It's in
+ "System.Security", not in "System".
+
+ * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
+ the exception classes.
+
+2004-06-21 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_unhandled_exception):
+ Protect the exception object from being finalized.
+
+2004-06-21 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
+ public function.
+
+2004-06-21 Sebastien Pouliot <sebastien@ximian.com>
+
+ * reflection.c: Load the assembly in mono_reflection_type_from_name,
+ if it was not loaded before. Fix parts of #60439.
+
+Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
+ code that was broken since Ben's change: wrappers are now
+ dependent on the method signature only again.
+
+2004-06-21 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (write_class): Cleaned this up a bit and
+ added interface support.
+
+2004-06-21 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_vtable_get_static_field_data): New public method.
+
+2004-06-20 Atsushi Enomoto <atsushi@ximian.com>
+
+ * filewatcher.c : Windows build fix to be compliant with API changes.
+
+Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * class.h, class.c: more accessors.
+ * metadata.h, metadata.c: prepare for hiding MonoType and
+ MonoMethodSignature: people should use the accessors from now on
+ outside of the tree.
+
+Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * *.c, *.h: more API cleanups.
+
+2004-06-18 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: Trace loading assemblies.
+ * loader.c: Trace loading native libraries.
+ * mono-config.c: Trace loading config files.
+
+2004-06-18 Dick Porter <dick@ximian.com>
+
+ * locales.c: Tell ICU the lengths of strings, it can cope with
+ embedded \0 then. Fixes bug 59274, and doesn't break bug 55822.
+
+Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * image.c: swapped name/filename;
+
+2004-06-18 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (write_class): Write the parent class at
+ the end of the header.
+
+Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
+
+2004-06-17 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (PLATFORM_LIB): New. Possibly refer to ../os/libmonoos.la.
+ (bundle_obj): New conditional define.
+ (BUILT_SOURCES): Remove.
+ ($(bundle_srcs)): Make parallel-make safe.
+ (libmonoruntime_la_LIBADD): Make unconditional.
+ (libmetadata_la_LIBADD): Make unconditional. Refer to $(bundle_obj).
+ (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
+
+2004-06-17 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: It was inconsistent with the latest
+ supp info files.
+
+2004-06-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c (mono_assembly_open): Fix crash when the assembly can't
+ be loaded.
+
+ * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
+ with gcc 2.95.
+
+Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
+ cleaned up public header threads.h.
+
+Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am, *.c, *.h: more API cleanups.
+
+Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: removed monosn from compilation.
+ * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
+ debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
+ image.c, image.h, loader.c, marshal.c, metadata-internals.h,
+ metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
+ mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
+ reflection.c, reflection.h, verify.c: more API cleanups and fixes.
+
+2004-06-15 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: Make locales lower case when searching the GAC for
+ assemblies. gacutil will always make locales lowercase when
+ installing so this effectively makes them case insensitive.
+
+2004-06-15 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
+ * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
+ parameter which allows to choose whether the wait can be interrupted or
+ not. Also added the method mono_monitor_enter(), which locks the monitor
+ using an infinite wait and without allowing interruption.
+ In the Monitor.Enter and Wait icalls, retry the lock if the wait is
+ interrupted.
+ * object.h: Added new fields in MonoThread. suspend_event holds the event
+ used to susped/resume the thread. synch_lock is the lock object to use for
+ modifying the thread state.
+ * threads.c: Use the new synch_lock object for locking, instead of "this",
+ which can generate deadlocks.
+ Moved thread state change in Thread.Sleep and Thread.Join from managed
+ to unmanaged code. This avoids a deadlock when the thread was suspended
+ just after acquiring the thread lock.
+ In general, use mono_monitor_enter instead of mono_monitor_try_enter.
+ Implemented Thread.Suspend using an event instead of ThreadSuspend,
+ which is not fully implemented in the io-layer.
+ * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
+
+Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
+ threads-types.h: more API cleanups.
+
+Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
+ domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
+ threadpool.c, threads.c: first pass at the exported API cleanup.
+
+Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
+
+2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added internalGetHome.
+
+2004-06-14 Dick Porter <dick@ximian.com>
+
+ * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
+ possible to return successfully when '.' or '..' were the only
+ entries in a directory, but were skipped. The MonoIOStat was not
+ filled in in that case. Now return ERROR_NO_MORE_FILES instead.
+ Fixes bug 59574.
+
+Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: make binaries run on .Net 1.1 by default.
+
+Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
+
+Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: keep track of struct size with explicit layout
+ (bug #59979).
+
+2004-06-12 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c: Comment out a debugging g_message().
+
+Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c, reflection.h: do not free custom attrs that are cached.
+ * icall.c: use braces to make code clearer.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoInflatedField): New type.
+ (MonoClassField): Replaced `MonoType *generic_type' with
+ `MonoInflatedField *generic_info'.
+
+ * icall.c
+ (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_image_create_method_token): Correctly encode
+ varargs methods.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (mono_metadata_parse_method_signature): When parsing
+ a MethodDef which has VarArgs, also set sentinelpos if we don't
+ have any parameters.
+
+2004-06-11 Martin Baulig <martin@ximian.com>
+
+ * verify.c (mono_method_verify): In CEE_CALL, use
+ mono_method_get_signature() to get the method's signature, unless
+ we're a PInvoke method.
+
+2004-06-10 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: Use <path>/lib/mono/gac for the extra paths
+ lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
+ logical name as the supplied path is just a prefix to the gac not
+ the direct path to it.
+
+Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: make the token for a created method match
+ the token of the MethodBuilder it was created from
+ (IKVM requires this behaviour now).
+
+Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
+ reflection.c, socket-io.c: leak fixes.
+
+Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: handle sentinel pos in vararg methods in position different
+ from 0.
+
+2004-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * culture-info-tables.h: freshly generated.
+
+2004-06-09 Martin Baulig <martin@ximian.com>
+
+ * loader.c (mono_get_method_constrained): Call `mono_class_init
+ (constrained_class)'.
+
+2004-06-08 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * icall.c (ves_icall_MonoType_GetEvent): Handle events without
+ any methods. Fixes #59629.
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+2004-06-08 Dick Porter <dick@ximian.com>
+
+ * object.h:
+ * locales.c: Fixed compile warnings, including a real bug in
+ CompareInfo_internal_compare.
+
+2004-06-08 Dick Porter <dick@ximian.com>
+
+ * locales.c
+ (ves_icall_System_Globalization_CompareInfo_internal_index):
+ (ves_icall_System_Globalization_CompareInfo_internal_index_char):
+ Double-check the resuls of usearches, because ICU currently
+ ignores most of the collator settings here. Fixes bug 59720.
+
+2004-06-08 Dick Porter <dick@ximian.com>
+
+ * locales.c
+ (ves_icall_System_Globalization_CompareInfo_internal_index_char):
+ Fix memory leak and segfault-causing typo. No idea how this one
+ lasted so long without being noticed.
+
+2004-06-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
+ any methods. Fixes #59629.
+
+2004-06-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * assembly.c:
+ (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
+ own the critical section before). Removed dead code (that's done
+ in the preload hook).
+
+ (mono_assembly_load_with_partial_name): call the preload hook.
+
+2004-06-08 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (mono_metadata_signature_alloc): Default
+ `sentinelpos' to -1.
+
+ * reflection.c (mono_image_get_array_token): Likewise.
+
+2004-06-08 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
+
+ * metadata.c (mono_metadata_parse_method_signature): When parsing
+ a MethodDef which has VarArgs, set sentinelpos.
+
+ * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
+ `gint16' since we're using -1 for non-varargs methods.
+
+ * reflection.c
+ (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
+ (method_encode_signature): Added varargs support.
+ (method_builder_encode_signature): Likewise.
+ (mono_image_get_varargs_method_token): New static method.
+ (mono_image_create_method_token): New public method; this is
+ called via an icall instead of mono_image_create_token() when
+ calling a varargs method.
+
+2004-06-08 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h : Reflecting the latest locale-builder that
+ fixed empty array representation ({} to {0}).
+
+2004-06-07 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
+ looking up extra gac paths. This allows MONO_GAC_PATH to act
+ exactly like a prefix.
+
+2004-06-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_type_from_name): Make a copy of the
+ type name before modifying it. Fixes #59405.
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info.h: added fields for "all datetime patterns".
+ * locales.c: ( ves_icall_System_Globalization_CultureInfo
+ _construct_datetime_format ()): fill xxx_patterns fields.
+ * object.h: added fields for "all datetime patterns" to
+ MonoDateTimeFormatInfo.
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+2004-06-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
+ the event has no add and remove methods. Fixes #59629.
+
+2004-06-05 Sebastien Pouliot <sebastien@ximian.com>
+
+ * object.c: Fixed possible integer overflow when allocating large
+ strings.
+
+2004-06-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+2004-06-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+2004-06-03 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+2004-06-03 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * threads.c: Made Thread.Sleep abortable.
+
+2004-06-02 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
+
+ * debug-mono-symfile.h: Bumped symbol file version number to 37.
+
+2004-05-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
+
+2004-05-30 Jackson Harper <jackson@ximian.com>
+
+ * reflection.c: Do not hardcode assembly versions or public key
+ tokens anymore. All of this except the corlib section was dead
+ code anyways.
+
+2004-05-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_runtime_invoke_array): Automatically create boxed
+ objects for byref valuetypes if needed. Fixes #59300.
+
+ * object.c (mono_method_return_message_restore): Handle
+ MONO_TYPE_OBJECT as well.
+
+2004-05-28 Jackson Harper <jackson@ximian.com>
+
+ * reflection.c: The modified type encoding was causing build
+ problems. Reverted for now.
+
+2004-05-28 Jackson Harper <jackson@ximian.com>
+
+ * reflection.c/h: Take an assembly ref so that we dont create
+ fully qualified names when encoding types in the same assembly as
+ the custom attribute being emitted.
+ * appdomain.c: Increment version number.
+
+2004-05-26 Duncan Mak <duncan@ximian.com>
+
+ * icall.c
+ (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
+ Set the full version number (major, minor, build, revision).
+
+2004-05-28 Vladimir Vukicevic <vladimir@pobox.com>
+
+ * marshal.c (emit_struct_conv): increment src/dst after blit
+ (mono_marshal_get_managed_wrapper,
+ mono_marshal_get_native_wrapper): make sure we have marshalling
+ info before marshalling params (info computation affects
+ blittable)
+
+ * class.c (class_compute_field_layout): correctly deal with
+ blittable
+ (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
+ value types (as per what windows dows by default)
+ (mono_class_setup_mono_type): System.ValueType is blittable
+ (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
+ blittable
+
+ * marshal.c (mono_marshal_load_type_info): flag types as
+ non-blittable if the native layout doesn't match the managed
+ layout
+
+2004-05-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: don't add stuff in the private search path that is
+ above the application base. If application base is not set, there's
+ no private search path.
+
+2004-05-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
+ byref struct arguments in native->managed marshalling.
+
+2004-05-28 Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * marshal.c (mono_marshal_get_runtime_invoke): correctly
+ cache methods using signature (special case for methods
+ that are value type or string class)
+
+ * image.c (mono_image_close): clean up allocated GSList's
+ in runtime_invoke_cache.
+
+2004-05-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mono-config.c: set the correct path for mono_cfg_dir on windows when
+ there's no MONO_CFG_DIR environment variable defined.
+
+2004-05-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c: windows version must be >= 0x0500 to include OpenThread.
+
+2004-05-28 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * threadpool.c: Really wait for 500ms after the async call, even if the wait
+ is interrumped.
+ * threads.c: In mono_thread_manage, call OpenThread to ref each handle
+ before waiting for it, and call CloseHandle after the wait to unref it.
+ This will make sure that handles are not disposed too early.
+
+2004-05-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c:
+ * appdomain.h:
+ * icall.c: removed
+ ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
+ needed now.
+
+ * object.c: se the application_base only for the domain that runs
+ Main. Fixes bug #59216,
+
+2004-05-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c:
+ * object.c: only the domain in which Main is run have
+ SetupInformation.ConfigurationFile set, so moved a few lines from
+ appdomain.c to object.c.
+
+2004-05-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: we tried to load [name].(dll|exe), but according
+ to bug #57710, we must also try [culture]/[name].(dll|exe) and
+ [culture]/[name]/[name](dll|exe). This patch fixes the bug.
+ There's a test case attached to bug #58922.
+
+2004-05-27 Dick Porter <dick@ximian.com>
+
+ * icall.c:
+ * file-io.c: Implemented icalls for locking and unlocking regions
+ in a file.
+ (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
+ FALSE on error (fixes both compiler warning and real bug.)
+
+2004-05-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+ (Added missing ChangeLog entry for 05/26)
+
+2004-05-27 Jackson Harper <jackson@ximian.com>
+
+ * locales.c: Fix some cut and paste errors.
+
+2004-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mono-config.c: set the correct path for config. directory on windows.
+
+2004-05-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
+ on win32.
+
+2004-05-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
+ from pinvoke functions.
+
+ * marshal.c (mono_ftnptr_to_delegate): Implement this.
+
+2004-05-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+2004-05-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
+ #59086.
+
+2004-05-26 Sebastien Pouliot <sebastien@ximian.com>
+
+ * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
+ * icall.c: Modified icalls for RNG.
+ * rand.c|h: Changed RNG interface to allow thread-safe usage under
+ Windows (CryptoAPI).
+
+2004-05-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * locales.c: Fix build.
+
+2004-05-25 Atsushi Enomoto <atsushi@ximian.com>
+
+ * culture-info-tables.h: reflecting locale-builder updates.
+
+2004-05-25 Jackson Harper <jackson@ximian.com>
+
+ * locales.c: When creating the current culture use the $LANGs
+ specific culture. So DateTimeFormat and NumberFormat entries are created.
+
+2004-05-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
+ a char array as parameter.
+
+2004-05-24 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * image.c: In mono_image_open(), always use an absolute path name to
+ look for already loaded images.
+
+2004-05-24 Sebastien Pouliot <sebastien@ximian.com>
+
+ * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
+ missing in the windows build (like older cygwin include files).
+
+2004-05-23 Sebastien Pouliot <sebastien@ximian.com>
+
+ * icall.c: Fixed check for possible integer overflow in Buffer_
+ BlockCopy icall. Replaced comments style // by /* */.
+
+2004-05-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_ftnptr_to_delegate): Fix warning.
+
+ * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
+ check after MONO_VTADDR. Fixes pinvoke2.exe.
+
+ * marshal.h marshal.c metadata.h: Add beginnings of support for
+ ftnptr -> delegate marshalling.
+
+2004-05-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
+ * threads.c: Fix warnings.
+
+2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
+ * icall.c: Registered icalls for Suspend and Resume.
+ * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
+ Thread.Abort.
+ * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
+ * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
+ * process.c: Use WaitForSingleObjectEx.
+ * threadpool.c: Use WaitForSingleObjectEx. Added some interruption
+ checkpoints.
+ * threads.c, threads.h: Make use of new Ex wait methods. Improved
+ implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
+ for Suspend and Resume. Added new mono_thread_stop, used for stoping
+ background threads. Added basic support for Abort in Windows.
+ Start new threads using a managed delegate invoke wrapper. This wrapper
+ has an interruption checkpoint that is needed since an interruption
+ can be requested before the thread leaves the unmanaged code that starts
+ the thread.
+ * marshal.c: Added interruption checkpoint after every native call, and
+ also before managed calls for wrappers called from unmanaged code to
+ go into managed code.
+ * object.h: Added new field in MonoThread to keep track of interruption
+ requests.
+
+2004-05-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
+ calls.
+
+2004-05-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c:
+ * assembly.c:
+ * gc.c:
+ * locales.c:
+ * mono-config.c:
+ * rand.c: getenv -> g_getenv (windows!)
+
+ * process.c: complete_path is also used on non-windows platforms.
+
+2004-05-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: new signature for Process_Start.
+
+ * process.[ch]: new signature for Process_Start. If we're on windows
+ and UseShellExecute is false, we have to search for the program by
+ ourselves if we don't get a full path.
+
+2004-05-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Fix up custom
+ marshalling and call CleanUpNativeData if needed. Fixes #58646.
+
+2004-05-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
+ Fixes bug #58373.
+
+2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * process.c: use double quotes to quote program name and arguments on
+ windows. Fixes bug #58575.
+
+2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * file-io.c: don't return "." and ".." when using windows Find*File.
+
+2003-05-17 Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * marshal.c: Don't pass wrappers to message init because method
+ addressed used to lookup metadata. part of remoting[2|3] fix.
+
+2004-05-15 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
+ path is essentially the same as MONO_PATH except that it points to
+ GACs instead of lib directories.
+ * loader.h: The user gac is gone so we dont need function to
+ enable/disable it.
+ * mono-config.c: user gac option is now gone.
+
+2004-05-15 Jackson Harper <jackson@ximian.com>
+
+ * culture-info.h: Make defines more consistent, add calendar data
+ to the culture info table.
+ * culture-info-tables.h: Add basic calendar data. Basically
+ everyone gets default gregorian until all the data is
+ updated.
+ * locales.c: Use the new consistent defines. Set calendar data for
+ culture info objects.
+ * object.h: add a field for calendar data to CultureInfo
+
+2004-05-14 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * image.c: image->runtime_invoke_cache is keyed on signatures now.
+ * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
+ a signature.
+ (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
+ (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
+ an extra param that is the pointer of the method to invoke. The IL for
+ the invoke method is no longer specific to the method, but to the
+ signature of the method. Thus, we can share the same code for multiple
+ methods. This reduces the number of methods that have to be compiled.
+
+2004-05-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
+
+ * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
+
+ * icall.c: Optimize Buffer.BlockCopy.
+
+2004-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * culture-info-tables.h: seems like Spanish and Portuguese cultures had
+ DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
+ quote). Changed them to "MMMM yyyy".
+
+2004-05-12 Miguel de Icaza <miguel@ximian.com>
+
+ * rand.c
+ (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file.
+
+2004-05-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h: Updated after changes to managed structures.
+
+ * appdomain.c: Bump corlib version.
+
+2004-05-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
+ windows.
+
+2004-05-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: link to ../os/libmonoos.la on windows.
+
+ * assembly.c:
+ -If MONO_DEBUG, warn about non-existing directories in
+ MONO_PATH.
+ -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
+ compile time variable.
+ -Removed init_default_path and call mono_set_rootdir from
+ libmonoos.a instead (windows only).
+
+ * assembly.h: declare mono_assembly_getrootdir().
+
+ * domain.c:
+ * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
+
+ * loader.c: s/getenv/g_getenv/
+
+2004-05-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.{h,c}: Add support for UnmanagedType.AsAny.
+
+ * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
+
+ * metadata.h: Add new marshalling conversions.
+
+ * metadata.h metadata.c (mono_metadata_signature_dup): New helper
+ function.
+
+ * reflection.c (mono_reflection_get_type): Lookup the type in all
+ modules of a multi-module assembly. Fixes #58291.
+
+2004-05-11 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * threads.c: Before aborting a background, set the StopRequested
+ state. This avoids throwing the Abort exception.
+ In mono_thread_manage, don't continue with the shutdown until all
+ aborted threads have actually stopped.
+
+2004-05-10 Jackson Harper <jackson@ximian.com>
+
+ * locales.c: Remove the modifier from culture names.
+
+2004-05-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: monosn is not installed any more. It has been deprecated
+ in favor of sn.
+
+2004-05-07 Jackson Harper <jackson@ximian.com>
+
+ * locales.c
+ (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
+ Fix array construction, add bailout if the length is 0.
+
+2004-05-07 Dick Porter <dick@ximian.com>
+
+ * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
+ machine doesn't have a DNS entry. Patch by Urs Muff
+ (umuff@quark.com), fixes bug 57928.
+
+2004-05-06 Jackson Harper <jackson@ximian.com>
+
+ * reflection.c: Handle null PublicTokens properly. alloc mem for
+ assembly names culture so we dont crash when freeing it.
+
+2004-05-06 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: Check the usergac when loading with partial names.
+
+2004-05-05 Sebastien Pouliot <sebastien@ximian.com>
+
+ * rand.c|h: Added new icall for (optionally) seeding the PRNG. This
+ does nothing for now (not required for Linux/Windows) but the class
+ library can call it (and a newer or modified runtime could need it).
+ * icall.c: Registred icall.
+
+2004-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * loader.c: prints a message on module loading error we set MONO_DEBUG
+ environment variable.
+
+2004-05-05 Jackson Harper <jackson@ximian.com>
+
+ * appdomain.c: Handle PublicKeyToken=null properly.
+
+2004-05-05 Sebastien Pouliot <sebastien@ximian.com>
+
+ * environment.c|h: Added icall ves_icall_System_Environment_
+ GetOSVersionString to get the current OS version as a string.
+ * icall.c: Registred icall.
+
+2004-05-05 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * object.c: in mono_object_get_virtual_method(), take into account that
+ non-virtual methods don't have a slot in the vtable. Check needed when
+ the object is a proxy.
+
+2004-05-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
+ (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
+
+ * object.c (mono_class_compute_gc_descriptor): Fix warning.
+
+ * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
+ passed when a valuetype is expected.
+
+ * object.c (mono_unhandled_exception): Only set the exit code if the
+ exception happens in the main thread. Fixes thread5.exe.
+
+ * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
+ invalid names. Fixes #58047.
+
+2004-05-03 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: This line was committed accidently and is unneeded.
+
+2004-05-03 Jackson Harper <jackson@ximian.com>
+
+ * icall.c: Add new icall for Assembly::LoadWithPartialName
+ * assembly.c/.h: new function that probes the GAC to load partial
+ assembly names by Paolo Molaro.
+
+2004-05-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
+ * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
+ (type_get_fully_qualified_name): Added PublicKeyToken when building a
+ full type name.
+
+2004-05-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: fixed check for 'neutral' culture and removed warning.
+ * reflection.c: fix bug when parsing a full type name and Version is not
+ the last thing in the string.
+
+2004-05-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
+ crashes when it is freed.
+
+2004-05-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * assembly.c: print the compat warning to stderr.
+
+2004-05-01 Miguel de Icaza <miguel@ximian.com>
+
+ * assembly.c (mono_assembly_load_references): Add a compatibility
+ hack to run old applications that might be still referencing the
+ 3300-based assemblies, only do this for System.xxx.
+
+2004-05-01 Jackson Harper <jackson@ximian.com>
+
+ * appdomain.c: If the culture is neutral we set it to "".
+
+2004-04-29 Jackson Harper <jackson@ximian.com>
+
+ * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
+
+2004-04-29 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
+
+ * string-icalls.c: added low overhead function for copying chars
+ * icall.c: added needed icall for the above function
+
+2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: fix return value of get_global_assembly_cache. Implemented
+ Environment.GetLogicalDrives.
+
+2004-04-28 Bernie Solomon <bernard@ugsolutions.com>
+
+ * rand.c: try and talk to egd or prngd
+ for random bytes if opening devices fail.
+
+2004-04-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_load_type_info): Calculate the minimum
+ alignment for the type using the native alignment of its members
+ instead of using klass->min_align.
+
+ * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
+
+2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * file-io.c:
+ * socket-io.c: added check for sys/aio.h.
+
+2004-04-28 Dick Porter <dick@ximian.com>
+
+ * threads.c: Don't abort a thread thats already aborting, when
+ terminating everything.
+
+2004-04-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added 2 new async calls for Socket.
+
+ * socket-io.[ch]: fixed some warnings. Added support for asynchronous
+ IO on *nix systems.
+
+ * threadpool.c: removed unused variable.
+
+2004-04-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
+
+Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * locales.c: put back string_invariant_tolower () and
+ string_invariant_toupper ().
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * file-io.h:
+ * socket-io.h:
+ * threads.h:
+ * unicode.h: remove comma from end of enumeration declarations
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * debug-mono-symfile.h:
+ * decimal.c:
+ * mono_debug.h:
+ * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
+
+
+2004-04-26 Jackson Harper <jackson@ximian.com>
+
+ * appdomain.c: Increment version number.
+
+2004-04-26 Jackson Harper <jackson@ximian.com>
+
+ * appdomain.c: Set assembly references public token value when
+ PublicKeyToken is specified, not the hash_value. Free public token
+ values when free assembly name data. Previously the public key
+ token was hex decoded, however we are using hex encoded public key
+ tokens, so this is not neccasary.
+ * assembly.c: Lookup assemblies in the gac if their public token
+ value is set. Add function to allow enabling user gac
+ lookups. Specify whether or not the assembly was loaded from the
+ GAC. Compare full assembly names when checking the cache for
+ assemblies (Temporarily disabled see comment in code). Remove
+ mscorlib -> corlib mapping cruft. Add trace-loading. When a user
+ specifies trace-loader they get extra info to stdout on the
+ loading of assemblies.
+ * image.h: Add a field for an assembly references public token
+ value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
+ whether an assembly has been loaded from the GAC.
+ * image.c: Remove a corlib -> mscorlib name mapping.
+ * loader.h: Add function to enable/disable the user gac.
+ * mono-config.c: Check if the usergac is enabled in the config
+ file.
+ * icall.c: New icall to determine whether or not an assembly has
+ been loaded from the GAC. Remove some mscorlib -> corlib mappings.
+ * tabldefs.h: Add constant for assemblyref flag that specifies a
+ full public key is used instead of a public token.
+ * reflection.c: Remove mscorlib -> corlib mappings. Set
+ PublicTokenValue instead of hash value. This value is a hex
+ string so it does not need to be expanded.
+
+2004-04-26 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_initialize): Set
+ `mono_debugger_initialized' before calling mono_debug_lock().
+
+2004-04-42 Robert Shade <rshade@dvsconsulting.com>
+
+ * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
+ InternalToUpper/InternalToLower.
+ * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
+ removed invariant culture shortcut. This is now done in managed code.
+ * locales.c: (string_invariant_toupper/tolower) removed.
+
+2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
+ Added Poll internal call.
+
+ * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
+ call for Poll. Select was too heavy for polling a single socket.
+
+ * threadpool.[ch]: added mono_threadpool_cleanup.
+ * threads.c: use it. Don't use Thread_Abort on windows.
+
+2004-04-23 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
+
+2004-04-23 Sebastien Pouliot <sebastien@ximian.com>
+
+ * icall.c: Registred new icalls for key pair protection and added an
+ icall for Environment.GetFolderPath on Windows.
+ * security.c|h: Added new icalls for key pair protection.
+
+2004-04-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: don't display the non-supported family warning for known
+ families. Now this is not displayed on windows when checking support
+ for IPv4/IPv6.
+
+2004-04-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * class.c: don't display the layout warning for static fields.
+
+2004-04-21 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
+ * locales.c, locales.h: Added new icalls for culture-specific
+ Char.ToLower and Char.ToUpper.
+
+2004-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
+ by David Waite.
+
+2004-04-20 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
+ of the type name before passing it to mono_reflection_type_from_name().
+
+2004-04-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
+ encodings here. Fixes #56965.
+
+2004-04-18 Bernie Solomon <bernard@ugsolutions.com>
+
+ * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
+ fix test on strstr result not that I can see anything that
+ relies on the result.
+
+2004-04-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
+ Fixes #57081.
+
+ * marshal.c (mono_marshal_get_string_encoding): New helper function.
+
+ * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
+ function to determine which marshalling to use for strings. Fixes
+ #56965.
+
+ * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
+
+ * reflection.c (encode_marshal_blob): Add support for LPARRAY.
+
+2004-04-15 Bernie Solomon <bernard@ugsolutions.com>
+
+ * icall.c: #include mono-config.h
+
+2004-04-15 Jackson Harper <jackson@ximian.com>
+
+ * culture-info-tables.h: Fix date formats for en-US culture.
+
+2004-04-15 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * icall.c: Registered icalls for ThreadPool.GetMinThreads and
+ ThreadPool.SetMinThreads.
+ * threadpool.c: Implemented ThreadPool.GetMinThreads and
+ ThreadPool.SetMinThreads.
+
+Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-config.c: also load the .config file in the directory
+ where the assembly was found.
+
+Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * assembly.c: load per-assembly config files.
+ * icall.c: decrapified code to get the config dir and moved to
+ mono-config.c.
+ * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
+ per-assembly config files. When doing a dll map lookup give precedence
+ to the per-assembly data.
+
+2004-04-14 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.h (MonoDebuggerEvent): Removed
+ MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
+ and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
+
+ * mono-debugger-debugger.c: While the debugger is locked, remember
+ whether the symbol tables have changes and send one single
+ MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
+
+2004-04-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
+
+ * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New
+ function.
+
+ * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
+ account when marshalling string arrays. Fixes #56965.
+
+2004-04-13 Sebastien Pouliot <sebastien@ximian.com>
+
+ * icall.c: Add new icalls mapping for security.
+ * security.c|h: Add internal calls for WindowsIdentity,
+ WindowsImpersonationContext and WindowsPrincipal.
+
+2004-04-13 Gert Driesen (drieseng@users.sourceforge.net)
+
+ * class.c: Added comment to ensure the System.MonoDummy class
+ is removed when no longer necessary
+
+2004-04-13 Miguel de Icaza <miguel@ximian.com>
+
+ * appdomain.c: Pass arguments to the bootstraping exceptions to
+ minimize JITed methods at boot
+
+ * metadata.c (mono_exception_from_name_two_strings): Allow for the
+ second string to be null.
+
+ * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
+ Change the protocol to minimize the JIT methods at startup. Now
+ it Returns the internal codepage, if the value of "int_code_page"
+ is 1 at entry, and we can not compute a suitable code page
+ number, returns the code page as a string.
+
+2004-04-13 Jackson Harper <jackson@ximian.com>
+
+ * culture-info-tables.h: Fix number of decimal digits for all
+ english locales.
+
+2004-04-13 Jackson Harper <jackson@ximian.com>
+
+ * icall.c: Clairfy out of sync error message. It is not always
+ your corlib that is out of sync.
+
+2004-04-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
+ properties when only the set accessor is overriden. Fixes #55874.
+
+2004-04-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c (mono_assembly_load_references): Make this thread safe.
+ Fixes #56327.
+
+2004-04-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * monosn.c: Add missing initialization calls.
+
+2004-04-08 Bernie Solomon <bernard@ugsolutions.com>
+
+ * locales.c:
+ ves_icall_System_Globalization_CultureInfo_construct_number_format
+ Fix g_assert so it compiles on fussier compilers re int/ptr
+ mismatch
+
+2004-04-08 Dick Porter <dick@ximian.com>
+
+ * socket-io.h:
+ * socket-io.c: Don't set SO_REUSEADDR on windows. Fixes bug
+ 53992. Also rearrange the code so that the internal calls return
+ an error value and exceptions are thrown from managed code.
+
+ * icall.c: Add type info to the socket icalls.
+
+2004-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
+ owes me a beer.
+
+2004-04-07 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_from_generic_parameter): Don't default
+ `klass->parent' to `mono_defaults.object_type'.
+
+2004-04-07 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_initialize_generic_parameter): Set
+ `param->pklass->reflection_info'.
+
+2004-04-07 Jackson Harper <jackson@ximian.com>
+
+ * culture-info-tables.h: Fix date separator symbol.
+
+2004-04-07 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
+ from System.Type to System.MonoType.
+
+2004-04-07 Martin Baulig <martin@ximian.com>
+
+ * reflection.h
+ (MonoReflectionGenericParam): Added `has_reference_type' and
+ `has_value_type' fields.
+
+ * reflection.c (mono_image_get_generic_param_info): Encode the
+ correct flags if we have the `class' or `struct' constraint.
+
+2004-04-07 Martin Baulig <martin@ximian.com>
+
+ * reflection.h
+ (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
+
+2004-04-07 Jackson Harper <jackson@ximian.com>
+
+ * appdomain.c: Revert extra patches, just wanted to bump the
+ version number.
+
+2004-04-07 Jackson Harper <jackson@ximian.com>
+
+ * Makefile.am: Add culture-info private headers.
+ * icall.c: Add new icalls for contructing locales.
+ * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
+ * locales.h: Declare new culture info construction methods.
+ * object.h: Add new fields used to avoid the CultureMap to
+ MonoCultureInfo.
+ * culture-info.h: Definition of structs used in the culture info
+ tables.
+ * culture-info-tables.h: Autogenerated tables that contain culture
+ info data. This file was generated with the locale-builder tool.
+ * appdomain.c: Incement corlib version number.
+
+2004-04-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * appdomain.c: (mono_runtime_init) move mono_thread_init
+ to before mono_object_new calls so critical sections
+ are initialized before use.
+
+2004-04-07 Martin Baulig <martin@ximian.com>
+
+ * icall.c
+ (ves_icall_TypeBuilder_define_generic_parameter): Removed.
+ (ves_icall_MethodBuilder_define_generic_parameter): Removed.
+ (ves_icall_MonoGenericParam_initialize): Removed.
+ (monogenericparam_icalls): Removed.
+ (generictypeparambuilder_icalls): Added new table for
+ System.Reflection.Emit.GenericTypeParameterBuilder.
+
+ * reflection.c
+ (mono_reflection_define_generic_parameter): Removed.
+ (mono_reflection_initialize_generic_parameter): This is now called
+ from GenericTypeParameterBuilder's .ctor.
+
+2004-04-06 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_init): Don't inflate nested classes in a
+ generic instance.
+ (mono_type_get_name_recurse): Include the generic arguments for
+ generic instances and generic type declarations.
+ (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
+ (_mono_class_get_instantiation_name): Removed.
+ (mono_class_create_generic): Always use `gklass->name' as our name.
+
+ * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
+
+ * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
+ (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
+ (ves_icall_MonoMethod_GetGenericParameters): Renamed to
+ ves_icall_MonoMethod_GetGenericArguments() and correctly handle
+ closed generic methods here.
+
+ * reflection.c
+ (mono_reflection_generic_inst_get_nested_types): Removed.
+ (inflate_mono_method): Copy the generic parameters from the
+ MonoMethodHeader into out MonoGenericMethod.
+
+2004-04-06 Martin Baulig <martin@ximian.com>
+
+ * row-indexes.h
+ (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
+
+ * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
+
+ * reflection.c (build_compressed_metadata): If we have any entries
+ in the GenericParam, MethodSpec or GenericParamConstraint tables,
+ set the header version to 1.1.
+
+2004-04-06 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_init): If we're a generic instance,
+ initialize our nested classes, too.
+ (_mono_class_get_instantiation_name): Deal with the new `!%d'
+ suffix.
+
+2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * process.c: quote the argument passed to the shell on windows.
+
+2004-04-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * threads.c (mono_alloc_special_static_data): Allow this to be
+ called during startup.
+
+2004-04-02 Martin Baulig <martin@ximian.com>
+
+ * icall.c
+ (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
+
+2004-04-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c: Fix build.
+
+2004-04-02 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Makefile.am: Added security.c|h.
+ * icall.c: Added icall for get_UserName;
+ * security.c: New file for security related icalls. Added function
+ get_UserName for System.Environment (fix #56144).
+ * security.h: New. Header file for security.c
+
+2004-04-02 Dick Porter <dick@ximian.com>
+
+ * icall.c: Deleted the icalls that were obsoleted some time ago
+ by the ICU string code, and which were mixed into the icall
+ rearranging. Fixes bug 55969.
+
+ * string-icalls.h:
+ * string-icalls.c: Deleted the code that those icalls reference.
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
+
+ * class.c (mono_class_from_generic_parameter): Don't set
+ TYPE_ATTRIBUTE_INTERFACE.
+ (my_mono_class_from_generic_parameter): Likewise.
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * loader.c (find_method): Added an optional `MonoClass *ic'
+ argument to search in a specific interface.
+ (mono_get_method_constrained): New public function.
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_image_get_generic_field_token): Use the
+ `handleref' cache here.
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
+
+ * reflection.c (create_generic_typespec): Use the `typespec' hash
+ here, not the `typeref' one.
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_inflate_generic_type): Moved the
+ functionality into a new static inflate_generic_type() which
+ returns NULL if it didn't do anything. Only increment the
+ `mono_stats.inflated_type_count' if we actually inflated
+ something.
+ (mono_class_get_full): Check the classes type to see whether we
+ need to inflate it; also inflate MONO_TYPE_(M)VAR.
+
+2004-04-01 Jackson Harper <jackson@ximian.com>
+
+ * reflection.c: Set culture for assembly references.
+
+2004-04-01 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * reflection.[ch], icall.[ch], Fix support for pinning variables.
+
+2004-04-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * assembly.c:
+ (do_mono_assembly_open): the critical section also covers
+ mono_image_open and mono_image_open_from_data. Fixes bug #56327.
+
+2004-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c:
+ (mono_manage_threads): abort the background threads when finishing.
+ Fixes bug #47232.
+
+2004-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * gc.c: only close the done_event handle if there was no timeout.
+ C-ified comments.
+
+2004-03-30 Martin Baulig <martin@ximian.com>
+
+ * icall.c (icall_entries): It's called "System.Activator", not
+ "System.Activation".
+
+2004-03-30 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
+ (mono_class_create_from_typespec): Likewise.
+
+2004-03-30 Martin Baulig <martin@ximian.com>
+
+ * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
+ `has_ctor_constraint' and `initialized'.
+
+2004-03-30 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (encode_new_constraint): New static function to add
+ the constructor constraint attribute to a type parameter.
+ (encode_constraints): Call encode_new_constraint() if necessary.
+
+ * reflection.h
+ (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
+
+ * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
+
+2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * reflection.c, icall.c: add support for pinning variables.
+
+2004-03-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper):
+ init bool local with zero rather than null.
+
+2004-03-29 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
+ the "official" behavior here.
+ (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
+
+2004-03-29 Martin Baulig <martin@ximian.com>
+
+ * icall.c: Reflect latest API changes.
+
+2004-03-29 Martin Baulig <martin@ximian.com>
+
+ * loader.c (mono_get_method_from_token): Also call
+ mono_metadata_load_generic_params () for abstract and interface
+ methods; replace the type arguments in the method signature with
+ the ones which are loaded from the metadata.
+
+2004-03-29 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
+ of the lock is not the current thread. MS.NET don't do it, in spite of
+ what the documentation says. See bug #56157.
+
+2004-03-28 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_init): Don't call init_properties() and
+ init_events() for generic instances; set `prop->parent' when
+ inflating properties.
+
+ * reflection.c (mono_generic_inst_get_object): Call
+ `mono_class_init (ginst->klass)'.
+ (mono_type_get_object): Only create a MonoGenericInst if your
+ generic type is a TypeBuilder.
+ (do_mono_reflection_bind_generic_parameters): Only set
+ `ginst->is_dynamic' if our generic type is a TypeBuilder.
+
+2004-03-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
+ Fixes #56091.
+
+2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added Kill_internal icall.
+ * process.[ch]: added Kill_internal icall.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoStats): Added `generic_instance_count',
+ `inflated_method_count', `inflated_type_count' and
+ `generics_metadata_size'.
+
+2004-03-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c: no warnings now.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_get_full): New public function; does a
+ mono_class_get(), but also takes a `MonoGenericContext *'.
+
+ * loader.c (mono_field_from_memberref): Renamed to
+ `field_from_memberref', made static and added `MonoGenericContext *'
+ argument.
+ (mono_field_from_token): Added `MonoGenericInst *' argument.
+ (method_from_memberef): Likewise.
+ (mono_get_method_from_token): Likewise.
+ (mono_get_method_full): New public function; does a
+ mono_get_method(), but also takes a `MonoGenericContext *'.
+
+ * verify.c (mono_method_verify): Get the method's generic context
+ and pass it to mono_field_from_token(), mono_get_method_full() and
+ mono_class_get_full().
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_inflate_generic_type): Take a
+ `MonoGenericContext *' instead of a `MonoGenericInst *' and a
+ `MonoGenericMethod *'.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * loader.h (MonoMethodInflated): Store the MonoGenericContext
+ instead of the MonoGenericMethod here.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericInst): Added `MonoGenericContext *context';
+ each time we create a new MonoGenericInst, we also create a new
+ context which points back to us.
+
+ * class.c (inflate_method): Use `ginst->context' instead of
+ creating a new context.
+
+ * loader.c (method_from_memberref): Use
+ `klass->generic_inst->context' instead of creating a new context.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericContext): New struct.
+ (MonoGenericMethod): Removed `generic_inst'.
+
+ * class.c (mono_class_inflate_generic_method): Take a
+ `MonoGenericContext *' instead of a `MonoGenericMethod *'.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * loader.h (MonoMethodInflated): New typedef.
+
+ * metadata.h (MonoMethodSignature): Removed `gen_method', make
+ `generic_param_count' consume just 30 bits, added `is_inflated'
+ and `has_type_parameters' flags (one bit each).
+
+ * class.c (mono_class_inflate_generic_method): Create a
+ MonoMethodInflated instead of a MonoMethodNormal and set
+ `is_inflated' in the method signature.
+
+ * class.h (MonoGenericMethod): Removed `generic_method'.
+
+2004-03-25 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * image.c: Make sure the name of a MonoImage is always an absolute path.
+ This fixes bug #54415.
+
+2004-03-24 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_setup_vtable): If we're a generic instance,
+ use our generic type's vtable size.
+
+2004-03-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
+ MONO_NO_UNLOAD env var as a temporary workaround for unloading
+ problems.
+
+2004-03-23 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoDynamicGenericInst): Added `int count_events' and
+ `MonoEvent *events'.
+
+ * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
+ (typebuilder_icalls): Added "get_event_info"; calls
+ mono_reflection_event_builder_get_event_info().
+
+ * reflection.c (mono_reflection_generic_inst_initialize): Added
+ `MonoArray *events'.
+ (mono_reflection_event_builder_get_event_info): New function.
+
+2004-03-23 Bernie Solomon <bernard@ugsolutions.com>
+
+ * object.h: add mono_type_initialization_init
+
+ * object.c (mono_runtime_class_init):
+ implement class constructor synchronization rules
+ to cope with threading issues.
+ add mono_type_initialization_init
+
+ * appdomain.c (mono_runtime_init): call
+ mono_type_initialization_init
+
+ * class.h: removing initializing field from MonoVTable
+
+2004-03-23 Martin Baulig <martin@ximian.com>
+
+ * class.c (my_mono_class_from_generic_parameter): Use
+ `param->name' if it's not NULL.
+
+2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * class.c: do not insert non-virtual methods in the vtable.
+ * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
+ that means the method is non-virtual. This never would have
+ happened before.
+
+2004-03-22 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * profiler.c: Added lock for accessing coverage_hash.
+
+2004-03-22 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
+ `method->method->signature->generic_param_count != 0' to make it
+ work for interface methods.
+
+2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * process.c: quote the string passed to the shell using g_shell_quote.
+
+2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c:
+ (mono_threads_manage): don't remove the finalizer thread and self
+ from the threads hash table so that mono_thread_manage can be called
+ more than once.
+
+2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * process.c: quote the arguments when UseShellExecute is true. Fixes
+ bug #55790.
+
+2004-03-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c: set mono_thread_detach as a cleanup routine for every
+ thread. This way it's always executed upon thread termination, either
+ aborted or finished normally. No more xsp hangs!
+
+2004-03-17 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericInst): Replaced the `GList *nested' with an
+ `int count_nested' and a `MonoType **nested'.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Moved
+ most of the functionality into a new static
+ do_mono_reflection_bind_generic_parameters() and don't take a
+ `MonoType *nested_in' argument any more. Don't compute nested
+ types here.
+ (mono_reflection_generic_inst_get_nested_types): New public method
+ to get nested types.
+
+ * class.c (mono_class_create_generic): Set `klass->nested_in' if
+ we're a nested class.
+
+ * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
+ mono_reflection_generic_inst_get_nested_types() to compute the
+ nested types.
+
+2004-03-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
+ descriptive error message under windows.
+
+2004-03-17 Martin Baulig <martin@ximian.com>
+
+ * class.c (dup_type): Added `const MonoType *original' argument;
+ copy the attrs from the original type.
+
+2004-03-17 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (do_mono_metadata_parse_generic_inst): Use the
+ `m->generic_inst_cache' here.
+
+2004-03-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * exception.h exception.c: Add stack_overflow_exception.
+
+2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c:
+ (overlapped_callback): call SetEvent *after* invoking the callback.
+ No need to call CloseHandle.
+
+2004-03-16 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_image_get_fieldref_token): Take a
+ `MonoReflectionField *' instead of a `MonoClassField *' and a
+ `MonoClass *'; store the `MonoReflectionField *' in the hash.
+
+2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: don't add the culture to the filename we're looking for
+ if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
+
+2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * locales.c: don't ignore symbols when doing case insensitive compares.
+ Thanks Dick! Fixes bug #54046.
+
+ * threads.c: surround 'threads' usage with enter/leave in
+ mono_thread_manage.
+
+2004-03-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Char arrays are
+ implicitly marshalled as [Out]. Fixes #55450.
+
+ (mono_marshal_get_runtime_invoke): Zero out the result if there is
+ an exception.
+
+2004-03-16 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_from_generic_parameter): Use the actual
+ parameter name.
+
+2004-03-16 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (type_get_signature_size): New static function.
+ Compues the size of the type in a method signature.
+ (method_get_signature_size): New static function; calls
+ type_get_signature_size() to compute the actual size of the
+ method's signature.
+ (method_encode_signature): Use method_get_signature_size() to get
+ the signature's size rather than using `nparams * 10'.
+
+2004-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * file-io.h: define here WapiOverlapped on windows. I don't want the
+ regular OVERLAPPED one.
+
+ * file-io.c:
+ * threadpool.c: somehow, BindIoCompletionCallback is not found.
+ Disabling AIO on windows.
+
+2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
+ bug #55385.
+
+2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: upgraded corlib version.
+
+ * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
+ and BeginWrite. Allow opening files for asynchrnous operations.
+
+ * file-io.h: new struct that maps FileStreamAsyncResult.
+ * icall.c: added new icalls.
+ * process.[ch]: support setting child process environment variables
+ and use the SHELL or COMSPEC when UseShellExecute is true.
+
+ * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
+ callback for async. IO is here and also BindHandle.
+
+ * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
+ from here.
+
+2004-03-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (create_custom_attr): Allow len == 0.
+
+ * object.c (mono_class_compute_gc_descriptor): Fix descriptor
+ computation on big-endian machines.
+
+2004-03-13 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericInst): Added `int count_ifaces'.
+
+ * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
+ `ginst->count_ifaces' instead `klass->interface_count' since we
+ may get called before the vtable is created.
+
+ * loader.c (mono_method_get_param_names): If we're a generic
+ instance, return and don't initialize the class.
+
+ * reflection.c (mono_reflection_setup_generic_class): Don't call
+ ensure_runtime_vtable().
+ (mono_reflection_bind_generic_parameters): Set
+ `ginst->count_ifaces'.
+
+2004-03-11 Jackson Harper <jackson@ximian.com>
+
+ * icall.c:
+ * unicode.c:
+ * unicode.h: Remove unused System.Char icalls.
+
+2004-03-11 Miguel de Icaza <miguel@ximian.com>
+
+ * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
+ code when we P/Invoke the first library in Windows.Forms, instead
+ of when we first open the assembly.
+
+ * assembly.c: Drop the lookup from here.
+
+2004-03-10 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_get_custom_attrs): Use the correct
+ class for properties, fields and events. Finally fixes #54945.
+
+2004-03-10 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (mono_metadata_class_equal): New static function;
+ checks whether two generic instances or two generic parameters are
+ equal.
+ (mono_metadata_type_equal): Use mono_metadata_class_equal() to
+ compare classes.
+
+2004-03-10 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
+
+ * reflection.c (inflate_mono_method): Added `MonoObject *obj'
+ argument and write it into the `reflection_info' field.
+
+ * icall.c
+ (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
+ (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
+
+2004-03-09 Jackson Harper <jackson@ximian.com>
+
+ * char-conversions.h: use 8 bits for numeric data its all we need
+ * icall.c: numeric data is only 8 bits now.
+
+2004-03-09 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
+
+ * class.c (init_properties, init_events): Initialize the new
+ `parent' field.
+
+ * reflection.c (typebuilder_setup_properties): Likewise.
+ (typebuilder_setup_events): Likewise.
+
+ * reflection.h (MonoEventInfo): Replaced `parent with
+ `declaring_type' and `reflected_type'.
+
+ * icall.c (ves_icall_get_property_info): Distinguish between
+ declaring and reflected type.
+ (ves_icall_get_event_info): Likewise.
+
+2004-03-09 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
+ (ves_icall_Type_GetField): Correctly set field->klass.
+
+2004-03-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.h: Fix warning.
+
+2004-03-08 Miguel de Icaza <miguel@ximian.com>
+
+ * loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
+ library routine if present. Notice that it will still continue
+ executing even if its missing, for those working on the Gtk#
+ edition of Windows.Forms.
+
+ * assembly.c (do_mono_assembly_open): If loading the
+ System.Windows.Forms call mono_loader_wini_init.
+
+2004-03-04 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * class.h: Added MonoRemoteClass struct.
+ * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
+ function for MonoStrings.
+ * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
+ Added internal call for getting the proxy type.
+ * marshal.c: Get the type of transparent proxies from its remote_class.
+ Added methods that generate the IL for type checks and casts:
+ mono_marshal_get_isinst, mono_marshal_get_castclass,
+ mono_marshal_get_proxy_cancast.
+ * marshal.h: Declaration of the previous new methods.
+ * object.c: Added new moethods for creating and updating MonoRemoteClass
+ instances: mono_remote_class, mono_upgrade_remote_class,
+ * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
+ * verify.c: FIx transparent_proxy_fields layout.
+ * appdomain.c: Bump corlib version.
+
+2004-03-04 Jackson Harper <jackson@ximian.com>
+
+ * icall.c: Add icall to access char conversion tables.
+ * char-conversions.h: Character conversion tables.
+ * Makefile.am: Add char-conversions.h private header file.
+
+2004-03-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (unload_thread_main): Increase unloading timeout to
+ 10 sec as a temporary workaround for Nant problems.
+
+2004-02-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c: Add checks for GC_enable and GC_disable.
+
+ * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
+ (jaak@zd.com.pl). Fix memory corruption in String.Replace
+ (bug #54988).
+
+2004-02-27 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Take a
+ `MonoReflectionType *' instead of a `MonoType *'.
+
+2004-02-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c (run_finalize): Avoid finalizing the object representing the
+ finalizer thread.
+ (finalizer_thread): Fix warning.
+
+2004-02-25 Martin Baulig <martin@ximian.com>
+
+ * class.c (_mono_class_get_instantiation_name): Added `int offset'
+ argument for nested types.
+ (mono_class_create_generic): Added support for nested generictypes.
+
+ * class.h (MonoGenericInst): Added `MonoType *nested_in' and
+ `GList *nested'.
+
+ * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
+
+ * reflection.c (method_encode_signature): Increase the minimum
+ value of `size' from 10 to 11.
+ (mono_reflection_bind_generic_parameters): Take `int type_argc'
+ and `MonoType **types' arguments instead of the `MonoArray
+ *types'; added `MonoType *nested_in'. Recursively instantiate
+ nested classes.
+
+2004-02-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.h (MonoDomain): Add preallocated null_reference_ex and
+ stack_overflow_ex members which are used by exception handling.
+
+ * appdomain.c (mono_runtime_init): Initialize the new members.
+
+ * gc.c (mono_gc_enable): New helper function.
+ * gc.c (mono_gc_disable): New helper function.
+
+2004-02-23 Martin Baulig <martin@ximian.com>
+
+ * icall.c: I must have been really stupid - make it actually work
+ this time ;-)
+
+2004-02-23 Martin Baulig <martin@ximian.com>
+
+ * loader.c (method_from_memberref): Only inflate the method if
+ it's in another klass.
+
+2004-02-23 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_inflate_generic_type): Fixed two bugs.
+ (mono_class_init): If we're a generic instance and an interface,
+ compute `class->interface_id'; also create `class->interfaces'
+ here and inflate them.
+
+ * metadata.c (do_mono_metadata_parse_generic_inst): Compute
+ `ginst->is_open'.
+ (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
+
+ * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
+
+2004-02-15 Miguel de Icaza <miguel@ximian.com>
+
+ * reflection.c (method_encode_code): Improved the error message
+ generated by the exception.
+
+2004-02-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: Martin did not do what he said in the ChangeLog for
+ 2004-02-18, but put back the changes for properties and events.
+ Commenting those changes out again and adding comment to bug #54518.
+
+ * process.c: removed warning.
+
+2004-02-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (emit_struct_conv): Print an error message instead of
+ asserting when a type does not have the StructLayout attribute.
+
+2004-02-20 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_type_get_object): Also use the cache for
+ generic instances.
+ (mono_reflection_bind_generic_parameters): Always compute
+ `ginst->ifaces'.
+
+2004-02-20 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericMethod): Removed `klass'.
+
+ * class.c (mono_class_inflate_generic_method): Added `MonoClass
+ *klass' argument.
+
+2004-02-20 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (method_encode_methodspec): Actually use the
+ uninflated signature for the memberref.
+
+2004-02-20 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericMethod): Removed `declaring'.
+
+ * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
+ is NULL, compute it here.
+
+2004-02-20 Martin Baulig <martin@ximian.com>
+
+ * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
+
+ * metadata.c (mono_metadata_generic_inst_hash): New method.
+ (mono_metadata_generic_inst_equal): New method.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Use the
+ `klass->image->generic_inst_cache' cache to avoid creating
+ duplicate MonoGenericInst's.
+
+ * class.c (mono_class_inflate_generic_type): Use the cache.
+
+Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: fixed gc descriptor calculation for embedded valuetypes.
+
+2004-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added Socket.WSAIoctl icall.
+
+ * socket-io.[ch]: implemented
+ ves_icall_System_Net_Sockets_Socket_WSAIoctl.
+
+2004-02-19 Atsushi Enomoto <atsushi@ximian.com>
+
+ * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
+
+2004-02-18 Urs C Muff <umuff@quark.com>
+
+ * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
+ this work on PPC and other big-endian architectures.
+
+ * debug-mono-symfile.h: Prepended the names of all the `guint32'
+ fields with an underscore to make sure they're only accessed by
+ the read32() macro.
+
+2004-02-18 Martin Baulig <martin@ximian.com>
+
+ * icall.c: Put the klass->refclass changes back for methods and
+ fields, but not for properties and events. We're currently not
+ distinguishing between DeclaringType and ReflectedType for
+ properties and events, that's what caused the regressions.
+
+2004-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c:
+ (mono_async_result_new): the handle can be NULL.
+
+ * threadpool.c: Use an event instead of a semaphore, don't initialize
+ it until needed. This saves quite a few semaphores from being created
+ when using the threadpool.
+
+2004-02-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_string_is_interned_lookup): Fix interning of long
+ strings. Fixes #54473.
+
+ * domain.c (ldstr_equal): Optimize if the two strings are equal.
+
+ * icall.c: Revert the klass->refclass changes since they introduce
+ regressions (bug #54518).
+
+2004-02-18 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_init): If we're a generic instance and don't
+ come from a TypeBuilder, inflate our members here.
+ (mono_class_from_generic): Removed; just use `ginst->klass' instead.
+ (mono_class_create_generic): New public method.
+ (mono_class_initialize_generic): Removed.
+ (get_instantiation_name): Renamed to
+ _mono_class_get_instantiation_name() and made it public.
+
+2004-02-18 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_inflate_generic_type): Clear the new
+ instance's `nginst->klass' when inflating a generic instance.
+ (mono_class_is_subclass_of): Added (basic) support for generic
+ instances.
+
+Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h, domain.c: use a MonoCodeManager instead of a
+ MonoMempool to hold compiled native code.
+
+2004-02-17 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoDynamicGenericInst): Added `count_properties' and
+ `properties'.
+
+ * reflection.c (mono_reflection_generic_inst_initialize): Added
+ `MonoArray *properties' argument.
+
+ * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.
+
+2004-02-17 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_GetFields): Renamed to
+ ves_icall_Type_GetFields_internal() and added a
+ `MonoReflectionType *rtype' argument; pass it to
+ mono_field_get_object() to set the field's "reflected" type.
+ (ves_icall_Type_GetConstructors): Likewise.
+ (ves_icall_Type_GetEvents): Likewise.
+ (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
+ argument; pass it to mono_method_get_object() to set the method's
+ "reflected" type.
+
+2004-02-17 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoDynamicGenericInst): New type.
+ (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
+
+ * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
+ (ves_icall_MonoGenericInst_GetConstructors): New interncall.
+ (ves_icall_MonoGenericInst_GetFields): New interncall.
+
+ * class.c (mono_class_from_generic): Don't call
+ mono_class_initialize_generic() if this is a dynamic instance;
+ ie. it's being created from a TypeBuilder.
+ Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
+ `class->byval_arg.type'.
+
+ * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
+ to `inflate_method' and made static.
+ (mono_reflection_inflate_field): Removed.
+ (mono_reflection_generic_inst_initialize): New public method.
+
+ * reflection.h (MonoReflectionGenericInst): Removed `methods',
+ `ctors' and `fields'; added `initialized'.
+
+2004-02-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * debug-helpers.c (mono_method_full_name): Fix output for empty
+ namespaces.
+
+2004-02-12 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoClassField): Added `MonoType *generic_type'.
+
+ * reflection.c (mono_image_get_fieldref_token): Added support for
+ instantiated generic types.
+ (field_encode_inflated_field): Removed.
+ (mono_image_get_inflated_field_token): Removed.
+ (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
+
+ * reflection.h (MonoReflectionInflatedField): Removed.
+
+2004-02-12 Martin Baulig <martin@ximian.com>
+
+ * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
+ `gen_method' field from MonoMethodHeader to MonoMethodSignature.
+
+ * reflection.c (mono_image_get_methodspec_token): Take a
+ `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
+ (mono_image_create_token): Check whether we have a
+ `method->signature->gen_method' and call
+ mono_image_get_methodspec_token() if appropriate.
+ (inflated_method_get_object): Removed.
+ (mono_reflection_bind_generic_method_parameters): Return a
+ `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
+ (mono_reflection_inflate_method_or_ctor): Likewise.
+
+ * reflection.h (MonoReflectionInflatedMethod): Removed.
+
+2004-02-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
+ for custom valuetype marshalling.
+
+ * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
+
+2004-02-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: fixed WSAGetLastError_internal name.
+
+2004-02-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * threads.c (mono_thread_attach): Allow this to be called multiple
+ times for a thread.
+
+ * threads.c (build_wait_tids): Do not wait for ourselves.
+
+ * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the
+ appdomain list is empty.
+
+ * marshal.c (mono_marshal_get_native_wrapper): Do not free the
+ memory returned by mono_string_builder_to_utf16, since it points into
+ managed memory. Thanks to Bernie Solomon for noticing this.
+
+ * icall.c: Add AppDomainSetup icalls.
+
+ * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
+
+ * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
+ types.
+
+ * reflection.c (reflection_methodbuilder_to_mono_method): Save
+ custom attributes to the method_aux struct. Also fix array indexes etc.
+
+ * loader.c (mono_method_get_param_names): Make dynamic case work again.
+
+Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c, loader.c: icall cleanup: we save quite a bit of memory
+ (both static and runtime) and reduce startup time.
+
+2004-02-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
+ AsAny marshalling conversion instead of crashing.
+
+ * marshal.c: Fix warnings.
+
+2004-02-09 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
+
+ * reflection.h (MonoReflectionInflatedMethod): Removed the
+ `declaring' field, it's now in the unmanaged MonoGenericMethod.
+
+ * reflection.c (method_encode_methodspec): Removed the `method'
+ argument; we get it from `gmethod->declaring'.
+ (inflated_method_get_object): Removed the `declaring' argument.
+
+2004-02-09 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericMethod): New type.
+ (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
+ `generic_method'.
+
+ * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
+ a `MonoGenericMethod *gen_method' one.
+
+ * class.c (mono_class_inflate_generic_type): Take an additional
+ `MonoGenericMethod * argument. This is only non-NULL if we're
+ inflating types for a generic method.
+ (mono_class_inflate_generic_signature): Renamed to
+ inflate_generic_signature() and made static; take a
+ `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
+ (inflate_generic_header): Take a `MonoGenericMethod *' argument
+ instead of a `MonoGenericInst *' one.
+ (mono_class_inflate_generic_method): Likewise.
+
+ * reflection.c (encode_generic_method_sig): Take a
+ `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
+ (method_encode_methodspec): Likewise.
+ (inflated_method_get_object): Likewise.
+
+ * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
+ field with a `MonoGenericMethod *gmethod' one.
+
+2004-02-08 Bernie Solomon <bernard@ugsolutions.com>
+
+ * class.h (mono_class_has_parent): add parens to expansion
+ so you can ! this.
+
+2004-02-08 Martin Baulig <martin@ximian.com>
+
+ * image.h (MonoImage): Removed `generics_cache'.
+
+ * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
+ instead of a `MonoType *' argument; removed the `inflate_methods'
+ argument. Don't inflate methods here.
+
+ * loader.c (find_method): If it's a generic instance, call
+ mono_class_init() on the `sclass->generic_inst->generic_type'.
+
+ * metadata.c (mono_type_size): Make this work on uninitialized
+ generic instances; call it on the `ginst->generic_type's class.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Call
+ mono_class_from_generic() to create the `ginst->klass'.
+
+2004-02-08 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoClass): Changed type of `generic_inst' from
+ `MonoType *' to `MonoGenericInst *'.
+
+2004-02-08 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_BindGenericParameters): Just call
+ mono_type_get_object(), this is now creating a `MonoGenericInst'
+ for MONO_TYPE_GENERICINST.
+ (ves_icall_MonoGenericInst_GetParentType): Likewise.
+ (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
+
+ * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
+ instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
+ (inflated_method_get_object): Added `MonoClass *refclass' argument.
+ (mono_reflection_inflate_method_or_ctor): Correctly set declaring
+ and reflected type.
+
+ * reflection.h (MonoReflectionInflatedMethod): Removed
+ `declaring_type' and `reflected_type'.
+
+2004-02-08 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericInst): Added `MonoType *parent' and
+ `MonoType **ifaces'.
+
+ * reflection.h (MonoReflectionGenericInst): Removed `klass',
+ `parent' and `interfaces'.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Take a
+ `MonoType *' argument and return a `MonoType *'.
+
+ * icall.c
+ (ves_icall_MonoGenericInst_GetParentType): New interncall.
+ (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
+
+2004-02-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
+ valuetype marshalling.
+
+2004-02-06 Martin Baulig <martin@ximian.com>
+
+ * class.c
+ (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
+ (my_mono_class_from_generic_parameter): Likewise.
+
+2004-02-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
+ contents of the symbol files lazily.
+
+ * object.h (MonoThread): Add 'name' and 'name_len' fields.
+
+ * threads.h threads.c icall.c: New icalls for getting and setting the
+ threads name.
+
+2004-02-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID):
+ Raise an exception when the domain is not found.
+
+2004-02-03 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_image_get_methodspec_token): Use the
+ uninflated signature; fixes gen-33.
+
+2004-02-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c threads.c: Make the finalizer thread a normal managed thread so
+ the finalizer code can use thread functionality.
+
+ * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for
+ the finalizer thread.
+
+ * threads.c: Make some functions more robust.
+
+ * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
+
+ * metadata.h: Add new marshalling conventions.
+
+ * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
+ stringbuilder marshalling. Fixes #53700.
+
+ * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
+
+ * reflection.c (mono_image_get_type_info): Save declarative security
+ info.
+
+ * reflection.c (mono_image_get_field_info): Handle uninitialized
+ unmanaged fields as well.
+
+ * appdomain.c: Bump corlib version.
+
+2004-02-01 Martin Baulig <martin@ximian.com>
+
+ * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
+ method type arguments.
+
+2004-01-30 Duncan Mak <duncan@ximian.com>
+
+ * marshal.h: Add prototype for
+ "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
+ and
+ "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
+ fix the build.
+
+2004-01-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
+ (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
+
+2004-01-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Add support for
+ custom marshalling of valuetypes.
+
+ * marshal.c: Fix some warnings.
+
+2004-01-29 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
+ for generic method parameters.
+
+ * reflection.c (method_encode_methodspec): Write the uninflated
+ signature into the methodspec table.
+ (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
+ is always the uninflated method.
+ (reflection_methodbuilder_to_mono_method): Copy the generic
+ parameters from the MethodBuilder into `header->gen_params'.
+
+2004-01-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_class_from_generic_parameter): Fix warning.
+
+2004-01-27 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_from_generic_parameter): Don't create
+ `klass->methods' here.
+
+2004-01-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
+ extension since it does not work with libraries named lib<FOO>.dll.so.
+
+2004-01-25 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_inflate_generic_type): Added support for
+ MONO_TYPE_GENERICINST.
+
+ * reflection.c (mono_reflection_inflate_method_or_ctor): Also
+ inflate methods on open constructed types.
+
+2004-01-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c: fire ProcessExit event in the root AppDomain after running
+ Main. Fixes bug #53299.
+
+Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * socket-io.c: include the new socket-wrappers.h header.
+ Use the wrappers instead of the unix socket functions to make the code
+ more clear.
+
+2004-01-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
+
+ * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
+ Fixes #22532.
+
+2004-01-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_image_create_pefile): Handle the case when the
+ entry point is not a MethodBuilder.
+
+ * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
+ field to ReflectionMethod since it is not allways a builder.
+
+ * reflection.c (type_get_fully_qualified_name): New helper function to
+ return the fully qualified name of a type.
+
+ * reflection.c (encode_marshal_blob): Always emit the fully qualified
+ type name for custom marshallers.
+
+ * reflection.c (mono_marshal_spec_from_builder): Ditto.
+
+ * class.c (mono_class_setup_vtable): If a parent class already
+ implements an interface, use the implementing methods from that class.
+ Fixes #53148.
+
+2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: just return instead of ExitThread to allow for thread
+ clean up earlier.
+
+2004-01-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
+ when closing resource modules.
+
+ * reflection.c (mono_image_create_pefile): Handle the case when the
+ entry point is not a MethodBuilder.
+
+ * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
+ field to ReflectionMethod since it is not allways a builder.
+
+2004-01-20 Bernie Solomon <bernard@ugsolutions.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper):
+ mono_marshal_alloc takes native int so CONV_I
+ the arg for 64bits.
+
+2004-01-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (fixup_cattrs): New function to fixup the methoddef
+ tokens in the cattr table. Fixes #53108.
+
+2004-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * loader.c: don't trim ".dll" before looking up in the config file.
+ Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
+
+2004-01-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
+ Return the module which contains the resource as well.
+ (ves_icall_System_Reflection_Module_Close): New icall.
+
+ * appdomain.c: Bump corlib version number.
+
+ * image.c (mono_image_addref): New public function.
+
+ * assembly.c: Call mono_image_addref.
+
+ * reflection.c (mono_module_get_object): Increase reference count of
+ the image.
+
+ * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
+ Fixes #22532.
+
+ * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
+ Applied patch from Bernie Solomon <bernard@ugsolutions.com>. Throw
+ proper exceptions on DllImport problems.
+
+Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, metadata.c: eliminate CSIZE macro.
+
+2004-01-19 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * icall.c: Added ves_icall_type_IsInstanceOf internal call.
+ * object.h: Added async_callback field in MonoAsyncResult.
+ * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
+ * verify.c: Added async_callback in MonoAsyncResult layout.
+
+2004-01-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_get_custom_attrs): Add support
+ for Modules.
+
+2004-01-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder
+ marshalling.
+ (mono_marshal_method_from_wrapper): Add null pointer check.
+
+2004-01-16 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h: Set version number to 36 and reflect
+ latest symbol writer changes.
+
+2004-01-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
+ multi-dimensional arrays.
+ (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
+ (mono_class_from_mono_type): Use bounded_array_class_get.
+
+ * class.c (mono_bounded_array_class_get): New function which takes
+ a 'bounded' bool argument to distinguish vectors from one dimensional
+ arrays.
+
+ * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call
+ bounded_array_class_get if the array has bounds.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
+ Search modules loaded using AssemblyBuilder:AddModule as well.
+
+2004-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: increased corlib version.
+ * filewatcher.c: removed g_print.
+ * icall.c:
+ (get_property_info): only allocate what is actually requested.
+ (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
+
+2004-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: added filewatcher.[ch]
+ * filewatcher.[ch]: FileSystemWatcher runtime support.
+ * icall.c: added new FSW icalls.
+
+Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * string-icalls.c: fix stringbuilder regression as suggested by
+ Iain McCoy <iain@mccoy.id.au>.
+
+2004-01-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * process.c (process_read_stringtable_block): Recognize '007f' as
+ a language neutral stringtable block.
+
+2004-01-12 Patrik Torstensson
+
+ * object.h (MonoStringBuilder) : Changed layout to support our
+ new stringbuilder class.
+ * marshal.c: Change marshalling to support the new layout of
+ string builder.
+ * appdomain.c: increased version number because new layout of
+ string builder.
+
+2004-01-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
+ assembly name as an string instead of an AssemblyName, since it is
+ easier to extract info from it.
+
+ * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
+ the culture subdirectories too. Fixes #52231.
+
+2004-01-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
+ It takes 2 new parameters with an optional name for the method to look
+ for and case ignoring info.
+
+ * threadpool.c: removed unused variable.
+
+2004-01-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
+ It takes 2 new parameters with an optional name for the property to look
+ for and case ignoring info.
+ Fixes bug #52753.
+
+2004-01-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
+ Fix #52451.
+
+2004-01-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c:
+ * assembly.c: escape the uri before passing it to g_filename_from_uri.
+ Fixes bug #52630.
+
+2004-01-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c: Add support for more than one unmanaged resource.
+
+ * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
+ in field->def_value, as done in all other cases.
+
+ * reflection.c (mono_reflection_get_custom_attrs): Add support for
+ TypeBuilders.
+
+ * reflection.c (mono_reflection_create_runtime_class): Remove
+ errorneous assignment to klass->element_class, since it is already
+ done in mono_reflection_setup_internal_class.
+
+2004-01-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * gc.c: added missing LeaveCriticalSection.
+ * icall.c: indented a couple of lines.
+ * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
+ if we call EndInvoke inside a callback. Fixes bug #52601.
+
+2004-01-07 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.h
+ (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
+
+2004-01-06 Miguel de Icaza <miguel@ximian.com>
+
+ * appdomain.c: Use messages in NotImplementedException.
+
+ * exception.c (mono_get_exception_not_implemented): Now this takes
+ a message argument.
+
+ * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
+ exception instead of g_asserting an aborting when something is not
+ implemented.
+
+ Add some inline docs.
+
+2004-01-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h: Update after changes to object layout.
+
+ * reflection.c: Implement saving of unmanaged aka win32 resources.
+
+ * appdomain.c: Bump version number.
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID):
+ Handle missing domains gracefully.
+
+2004-01-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * file-io.c : On Windows, there are much more invalid_path_chars.
+
+Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * class.h, object.c: prepare for GetType () speedup.
+
+2003-12-24 Atsushi Enomoto <atsushi@ximian.com>
+
+ * profiler.c: workaround for --profile null reference exception on
+ cygwin. Patch by Patrik Torstensson.
+
+2003-12-22 Bernie Solomon <bernard@ugsolutions.com>
+
+ * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
+ make work for unaligned access.
+
+Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: small cleanup (class->fields [i] -> field).
+ * image.c: check address of metadata is valid.
+
+2003-12-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.h assembly.c (mono_assembly_loaded): New public function to
+ search the list of loaded assemblies.
+
+ * reflection.c (mono_reflection_type_from_name): Use
+ mono_assembly_loaded instead of mono_image_loaded.
+
+ * reflection.c: Fix warnings.
+
+2003-12-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.h (MonoImage): Add a new 'dynamic' field to denote that the image
+ is dynamic. This is needed since an assembly can contain both dynamic and
+ non-dynamic images.
+
+ * class.c loader.c metadata.c object.c: Use image->dynamic instead of
+ assembly->dynamic.
+
+ * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
+
+ * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
+ to store modules loaded using AddModule.
+
+ * reflection.c (mono_image_fill_file_table): Generalize this so it works
+ on Modules.
+
+ * reflection.c (mono_image_fill_export_table_from_class): New helper function.
+
+ * reflection.c (mono_image_fill_export_table_from_module): New function to
+ fill out the EXPORTEDTYPES table from a module.
+
+ * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
+ into a separate function. Also handle loaded non-dynamic modules.
+
+ * reflection.c (mono_image_basic_init): Fix memory allocation.
+
+ * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
+
+ * assembly.c (mono_assembly_load_references): Make this public.
+
+2003-12-19 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_initialize_generic): Made this static, take
+ a `MonoGenericInst *' instead of a `MonoClass *'.
+ (mono_class_from_generic): Call mono_class_initialize_generic()
+ unless we're already initialized or being called from
+ do_mono_metadata_parse_generic_inst().
+
+ * class.h (MonoGenericInst): Added `initialized' and
+ `init_pending' flags.
+
+ * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
+ `mono_class_init (gklass)' or mono_class_initialize_generic()
+ here; set `generic_inst->init_pending' while parsing the
+ `type_argv'.
+
+2003-12-19 Bernie Solomon <bernard@ugsolutions.com>
+
+ * locales.c: include string.h for memxxx prototypes
+
+2003-12-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
+ constructor when accessing literal fields.
+
+2003-12-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
+
+ * reflection.c (assembly_add_resource_manifest): New function to fill
+ the MANIFESTRESOURCE table.
+
+ * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
+
+ * reflection.h: Update to changes in class layout.
+
+ * icall.c (ves_icall_System_Environment_get_HasShutdownStarted):
+ Reenable call to mono_runtime_is_shutting_down ().
+
+ * appdomain.c (mono_runtime_is_shutting_down): New helper function to
+ determine if the runtime is shutting down.
+
+2003-12-16 Jackson Harper <jackson@ximian.com>
+
+ * icall.c: comment out call to mono_runtime_is_shutting_down to
+ fix build.
+
+2003-12-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
+ (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
+
+2003-12-15 Bernie Solomon <bernard@ugsolutions.com>
+
+ * reflection.c: move definition of swap_with_size
+ to before its first call
+
+2003-12-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (mono_runtime_is_shutting_down): New public function.
+
+ * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
+ icall.
+
+ * object.c: Fix warnings.
+
+ * icall.c (ves_icall_Type_Get...): Only consider inherited static
+ members if FlattenHierarchy is set.
+
+ * reflection.c (mono_image_add_decl_security): New function to emit
+ declarative security.
+
+ * reflection.h reflection.c: Add support for declarative security.
+
+ * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
+
+2003-12-13 Zoltan Varga <vargaz@freemail.hu>
+
+ appdomain.c (MONO_CORLIB_VERSION): Bump version number.
+
+ * appdomain.c verify.c: Moved corlib version checking into its own
+ function in appdomain.c since it needs to create vtables etc.
+
+2003-12-13 Patrik Torstensson <p@rxc.se>
+
+ * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this
+ instead of unwrapped server.
+
+2003-12-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * verify.c (check_corlib): Fix field index.
+
+2003-12-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
+ GetGacPath icall.
+
+2003-12-10 Bernie Solomon <bernard@ugsolutions.com>
+
+ * process.c: (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
+ ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
+ cope with sizeof(size_t) != sizeof(guint32).
+
+2003-12-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
+ in case of failure.
+
+2003-12-10 Mark Crichton <crichton@gimp.org>
+
+ * icall.c: removed the GetNonZeroBytes. We now handle this case
+ in managed code.
+
+ * rand.c, rand.h: Same here. Also cleaned up the clode slightly.
+
+Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
+ marked as deleted.
+
+2003-12-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * verify.c (check_corlib): Handle the case when the version field is
+ initialized by a static constructor.
+
+2003-12-08 Patrik Torstensson <p@rxc.se>
+
+ * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
+
+2003-12-08 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
+ a MonoReflectionGenericParameter, also take the parameter index
+ and name as arguments.
+ (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
+ (ves_icall_MonoGenericParam_initialize): New interncall.
+ (ves_icall_Type_make_byref_type): New interncall.
+
+ * reflection.h (MonoReflectionGenericParam): Derive from
+ MonoReflectionType, not just from MonoObject. Added `refobj' and
+ `index' fields.
+
+ * reflection.c (mono_reflection_define_generic_parameter): Create
+ and return a new MonoReflectionGenericParam; don't initialize the
+ constraints here.
+ (mono_reflection_initialize_generic_parameter): New public method;
+ initializes the constraints and creates the `param->pklass'.
+
+2003-12-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h reflection.c: Use the new fields 'num_types',
+ 'num_fields' and 'num_methods' to track the number of types etc.
+
+ * verify.c (check_corlib): Check corlib version number.
+
+2003-12-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
+ function works on all methods.
+
+2003-12-07 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
+ * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
+ the custom_type_info flag of the transparent proxy.
+ * object.c: Added method mono_object_isinst_mbyref for casting mbyref
+ objects that supports IRemotingTypeInfo.
+ * object.h: Added custom_type_info field in transparent proxy.
+
+2003-12-06 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_create_from_generic): Removed.
+ (mono_class_from_generic): Check `ginst->klass' before doing
+ anything else. This is important to fully support "recursive"
+ generic types.
+
+ * metadata.c (do_mono_metadata_parse_generic_inst): Create an
+ empty `generic_inst->klass' before doing anything else.
+
+2003-12-06 Dick Porter <dick@ximian.com>
+
+ * verify.c:
+ * object.h:
+ * icall.c:
+ * locales.c: Use C structs to access class fields. Don't do a
+ conversion between MonoString and UChar because both are
+ platform-endian UTF-16. Compare now takes startindex and count
+ parameters. Add a char overload for IndexOf. Speed up the
+ invariant string IndexOf.
+
+2003-12-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (monosn_LDADD): Fix parallel build.
+
+2003-12-04 Martin Baulig <martin@ximian.com>
+
+ * icall.c
+ (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
+ (ves_icall_Type_make_array_type): New interncall.
+
+2003-12-04 Martin Baulig <martin@ximian.com>
+
+ * locales.c: also change it in the !HAVE_ICU case.
+
+2003-12-04 Dick Porter <dick@ximian.com>
+
+ * icall.c:
+ * locales.c: construct_compareinfo is now in CompareInfo, not
+ CultureInfo.
+
+2003-12-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.c (mono_image_load_file_for_image): Cache loaded images in the
+ image->files array.
+
+ * image.c (load_class_name): Load class names from the EXPORTEDTYPES
+ table as well.
+
+ * assembly.c (mono_assembly_load_references): Only load references
+ once.
+
+ * class.c (mono_class_from_name): Avoid linear search of the
+ EXPORTEDTYPE table.
+
+ * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
+
+2003-12-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.h (MonoImage): Add 'field_cache' field.
+
+ * loader.c (mono_field_from_token): Cache field lookups.
+
+ * reflection.c (mono_module_get_object): Fix name property.
+
+ * icall.c (ves_icall_get_enum_info): Update after changes to
+ mono_metadata_get_constant_index ().
+
+ * icall.c: Get rid of get_type_info icall, use a separate icall for
+ each type property to avoid needless memory allocations. Fixes #51514.
+
+ * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
+ to avoid needless binary searches.
+
+ * class.c (class_compute_field_layout): Move the initialization of
+ field->def_value to mono_class_vtable ().
+
+ * class.c (mono_class_layout_fields): Enable GC aware auto layout for
+ non-corlib types.
+
+ * object.c (mono_object_allocate): Make it inline.
+
+ * object.c (mono_object_allocate_spec): Make it inline.
+
+2003-12-02 Dick Porter <dick@ximian.com>
+
+ * locales.c (create_NumberFormat): NumberFormatInfo construction.
+ Patch by Mohammad DAMT (mdamt@cdl2000.com).
+
+2003-12-01 Dick Porter <dick@ximian.com>
+
+ * threads.c: Fix signature and call in CreateMutex and
+ CreateEvent.
+
+2003-12-01 Dick Porter <dick@ximian.com>
+
+ * icall.c:
+ * locales.c: Implement string compares and searching
+
+ * object.h: Add extra Thread field
+
+2003-11-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (fixup_method): Add support for MonoCMethod.
+
+2003-11-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
+
+ * reflection.c (assembly_name_to_aname): Allow extra characters in
+ assembly names. Fixes #51468.
+
+2003-11-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * exception.c (mono_exception_from_name_domain): New helper function.
+
+ * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
+ exception object in the correct domain.
+
+ * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix
+ formatting + make a copy a the input data.
+
+ * loader.c (mono_get_method_from_token): Methods which contain
+ native code do not have entries in the ImplMap.
+
+ (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
+ Thanks to Gonzalo for spotting this.
+
+ * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
+ patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
+
+ * assembly.h (mono_assembly_load_from): Split the second part of
+ assembly loading into a new public function.
+
+ * exception.h (mono_get_exception_bad_image_format): New function.
+
+2003-11-24 Zoltan Varga <vargaz@freemail.hu>
+
+ icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
+ Enumerate all modules inside a dynamic assembly. Fixes #51293.
+
+ * icall.c: Add new icall for creating dynamic methods.
+
+ * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
+
+ * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
+
+ * reflection.c (mono_reflection_create_dynamic_method): New icall to
+ create a dynamic method.
+
+ * reflection.c (resolve_object): New helper function.
+
+ * reflection.c: Generalize ReflectionMethodBuilder and the functions
+ which manipulate it so they can also work on dynamic methods.
+
+ * reflection.c (reflection_method_builder_to_mono_method): Avoid
+ creating the MonoReflectionMethodAux structure if it is not needed.
+
+ * reflection.h verify.c: Update after changes to object layout.
+
+ * reflection.c (method_builder_encode_signature): Fix compilation on
+ gcc 2.95.x.
+
+2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * appdomain.h: Added support for context static fields. Added static_data
+ field to MonoAppContext and renamed thread_static_fields to a more
+ generic special_static_fields in MonoAppDomain, since it can now contain
+ context static fields.
+ * domain.c: Updated hashtable name.
+ * object.c: Replaced field_is_thread_static() for a more generic
+ field_is_special_static() which also checks for context static attribute.
+ In mono_class_vtable(), added support for static context fields.
+ * threads.c: Changed methods that manage thread static fields to more
+ generic methods so they can be reused both for thread and context static
+ data.
+ * threads.h: Declared some new methods.
+
+2003-11-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h: Update after changes to the managed types.
+
+ * reflection.c (encode_custom_modifiers): New helper function.
+
+ * reflection.c (method_encode_signature): Emit custom modifiers.
+
+ * reflection.c (field_encode_signature): Emit custom modifiers.
+
+2003-11-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
+
+ * icall.c (ves_icall_System_ValueType_Equals): New optimized
+ implementation.
+
+ * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New
+ icall.
+
+ * object.c (mono_field_get_value_object): New function.
+
+ * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
+ specific.
+
+2003-11-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
+ return a preallocated out-of-memory exception instance.
+
+ * object.c (out_of_memory): Use the new function.
+
+ * metadata.c (mono_metadata_parse_type): Handle the case when the byref
+ flag is before the custom modifiers. Fixes #49802.
+
+2003-11-16 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_is_open_constructed_type): Implemented the
+ MONO_TYPE_GENERICINST case.
+
+2003-11-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c (mono_assembly_fill_assembly_name): New function to
+ fill out the MonoAssemblyName structure.
+ (mono_assembly_open): Use the new function.
+
+ * icall.c (fill_reflection_assembly_name): New helper function.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
+ new function.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
+
+2003-11-15 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_is_open_constructed_type): New public
+ function; checks whether a type is an open constructed type,
+ ie. whether it still contains type parameters.
+ (mono_class_inflate_generic_type): If we're a type parameter and
+ the inflated type is also a MONO_TYPE_(M)VAR, return the original
+ type.
+
+ * class.h (MonoGenericInst): Added `guint32 is_open'.
+
+ * loader.c (method_from_methodspec): Check whether we're an open
+ or closed constructed type and set `ginst->is_open'.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Check
+ whether we're an open or closed constructed type and set
+ `ginst->is_open'.
+ (mono_reflection_inflate_method_or_ctor): Don't inflate methods
+ from open constructed types.
+
+2003-11-15 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_bind_generic_parameters): If we're
+ a generic instance (instead of a generic type declaration) with
+ unbound generic parameters, bind them to our actual types.
+
+2003-11-14 Martin Baulig <martin@ximian.com>
+
+ * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): If we're
+ an interface type, populate `res->interfaces' with instantiated
+ versions of all the interfaces we inherit.
+
+2003-11-13 Aleksey Demakov <avd@openlinksw.com>
+
+ * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
+ when MONO_PATH is set but doesn't contain the install dir.
+
+2003-11-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c:
+ (ves_icall_Type_GetInterfaces): don't return an interface twice when
+ it's also implemented in base classes. Fixes bug #50927.
+
+2003-11-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
+ if this method is called from a finalizer. Fixes #50913.
+
+2003-11-12 Miguel de Icaza <miguel@ximian.com>
+
+ * threads.c: Implement VolatileRead/VolatileWrite
+
+ * icall.c: Add new icalls for VolatileRead/VolatileWrite
+
+2003-11-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied
+ patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
+ 2.95.3.
+
+ * assembly.c (mono_assembly_open): Fix windows build. Applied patch
+ from Peter Ross (pro@missioncriticalit.com).
+
+2003-11-12 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * icall.c: Added internal call for System.Environment::GetMachineConfigPath
+
+2003-11-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c (mono_assembly_load_references): Disable check because it
+ triggers on older corlibs which lots of people have.
+
+2003-11-12 Jackson Harper <jackson@ximian.com>
+
+ * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
+ load corlib.dll if mscorlib.dll is not found.
+ * assembly.h: Remove corlib name define.
+ * class.c:
+ * domain.c:
+ * image.c: Change corlib name to mscorlib.
+
+2003-11-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
+
+2003-11-11 Miguel de Icaza <miguel@ximian.com>
+
+ * appdomain.h: Added loader_optimization here to sync with the C#
+ code, and add disallow_binding_redirects field.
+
+2003-11-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
+
+ * reflection.c (mono_image_build_metadata): Fix crash on modules
+ with no types.
+
+ * reflection.h (MonoMethodInfo): Track changes to the managed structure.
+
+ * icall.c (ves_icall_get_method_info): Return callingConvention as
+ well.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add
+ namespaces from the EXPORTEDTYPE table as well.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
+ from all modules inside the assembly.
+
+2003-11-11 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Make
+ this work for interfaces.
+
+2003-11-11 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
+
+2003-11-11 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
+ "MonoInflatedMethod" and "MonoInflatedCtor".
+
+2003-11-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (resolution_scope_from_image): Use the assembly table
+ from the manifest module, since other modules don't have it.
+
+ * debug-helpers.c (mono_type_full_name): New helper function.
+
+ * image.h (MonoAssembly): Change 'dynamic' to a boolean.
+
+ * image.c (mono_image_load_file_for_image): New public function which
+ is a replacement for the load_file_for_image in class.c.
+
+ * assembly.c (mono_assembly_load_module): A wrapper for the function
+ above which does assembly association and reference loading too.
+
+ * class.c (mono_class_from_name): Call mono_assembly_load_module.
+
+2003-11-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: not all of the attributes for the full assembly name
+ are required and the order doesn't matter. Fixes bug #50787.
+
+2003-11-10 Dick Porter <dick@ximian.com>
+
+ * locales.c: Use platform-endian UTF16
+
+2003-11-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c: Emit FILE and EXPORTEDTYPE tables.
+
+2003-11-10 Martin Baulig <martin@ximian.com>
+
+ * metadata.c
+ (mono_metadata_load_generic_params): Make this actually work.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): If our
+ parent is a generic instance, pass all the `types' to it, no
+ matter whether it has the same number of type parameters or not.
+
+2003-11-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c: Emit FILE and EXPORTEDTYPE tables.
+
+ * assembly.c (mono_assembly_load_references): Move the image<->assembly
+ assignment code to this function so it gets called recursively for all
+ modules.
+
+ * image.c (load_modules): Remove the assembly assignment since it is
+ now done by mono_assembly_load_references.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
+ Add 'module' argument.
+ (mono_module_get_types): New helper function.
+ (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
+
+2003-11-08 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_inflate_generic_method): Interface method
+ don't have a header.
+
+ * reflection.c (mono_image_get_methodspec_token): Take an
+ additional `MonoGenericInst *' argument instead of reading it from
+ the header; this is necessary to support interfaces.
+ (mono_image_create_token): Pass the `MonoGenericInst *' from the
+ MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
+ (inflated_method_get_object): Take an additional `MonoGenericInst *'
+ argument.
+
+ * reflection.h (MonoReflectionInflatedMethod): Added
+ `MonoGenericInst *ginst'.
+
+2003-11-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c (mono_domain_finalize): Fix compilation for no GC case.
+
+2003-11-06 Zoltan Varga <zovarga@ws-zovarga2>
+
+ * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
+
+2003-11-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c
+ (reflection_methodbuilder_from_method_builder):
+ (reflection_methodbuilder_from_ctor_builder): New helper functions to
+ initialize a ReflectionMethodBuilder structure.
+ (mono_image_get_methodbuilder_token):
+ (mono_image_get_ctorbuilder_token): New functions to emit memberref
+ tokens which point to types in another module inside the same assembly.
+
+ * reflection.c: Use the new helper functions.
+
+ * reflection.c (mono_image_basic_init): Initialize basedir and culture.
+
+ * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image
+ instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
+
+ * reflection.c (resolution_scope_from_image): Emit a moduleref if
+ neccesary.
+
+ * reflection.c (mono_image_build_metadata): Emit metadata only for the
+ current module. Emit the manifest only for the main module.
+
+ * reflection.c (mono_image_create_token): Add assertion when a
+ memberref needs to be created.
+
+ * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
+
+ * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a
+ larger buffer for the custom attribute blob. Fixes #50637.
+
+2003-11-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: notify listener on async processing handles after
+ invoking the async callback. Thanks to Zoltan.
+
+2003-11-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (create_dynamic_mono_image): Call mono_image_init to
+ avoid code duplication.
+
+ * reflection.h (MonoDynamicImage): New type which is currently unused,
+ but will be used through the ref.emit code in place of
+ MonoDynamicAssembly.
+
+ * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
+ object layout.
+
+ * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
+ a MonoDynamicImage instead of just a MonoImage.
+
+ * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
+ icalls to ModuleBuilder but keep their semantics, so they will work
+ with moduleb->assemblyb. This will change later.
+
+2003-11-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
+ object layout.
+
+ * reflection.c (mono_image_build_metadata): Avoid creation of a default
+ main module, since it is now done by the managed code.
+
+2003-11-03 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_inflate_method_or_ctor): Set
+ `ginst->klass' here.
+ (method_encode_methodspec): Don't use the `ginst->generic_method's
+ klass if it's a generic instance, use `ginst->klass' in this case.
+
+2003-11-03 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_image_get_generic_method_param_info):
+ Removed, use mono_image_get_generic_param_info() instead.
+ (mono_image_get_type_info): Write the GenericParam table before
+ the Method table. This is neccessary because in the GenericParam
+ table, type parameters of the class (ie. '!0' etc.) must come
+ before the ones from its generic methods (ie. '!!0' etc).
+
+2003-11-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
+
+2003-11-02 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (create_generic_typespec): Take a
+ `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
+ the generic parameters from it.
+
+2003-11-02 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (fieldref_encode_signature): Take a `MonoType *'
+ instead of a `MonoClassField *' since we just need the type.
+ (create_generic_typespec): New static function. Creates a
+ TypeSpec token for a generic type declaration.
+ (mono_image_get_generic_field_token): New static function.
+ (mono_image_create_token): If we're a FieldBuilder in a generic
+ type declaration, call mono_image_get_generic_field_token() to get
+ the token.
+
+2003-11-02 Martin Baulig <martin@ximian.com>
+
+ * reflection.h
+ (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
+ `MonoReflectionGenericInst *declaring_type' and
+ `MonoReflectionGenericInst *reflected_type' fields.
+
+ * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
+ `MonoReflectionGenericInst *declaring_type' and a
+ `MonoReflectionGenericInst *reflected_type' argument instead of a
+ single `MonoReflectionGenericInst *type' one. Set
+ `res->declaring_type' and `res->reflected_type' from them.
+ (mono_reflection_inflate_field): Likewise.
+
+2003-11-02 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_setup_vtable): Don't store generic methods
+ in the vtable.
+
+2003-11-02 Martin Baulig <martin@ximian.com>
+
+ * reflection.h (MonoReflectionGenericInst): Added
+ `MonoReflectionType *declaring_type'.
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Use
+ `if (tb->parent)' instead of `klass->parent'.
+
+2003-11-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
+ with an empty ASSEMBLY table.
+
+ * reflection.c (mono_image_build_metadata): Avoid using the same loop
+ variable in the inner and outer loops.
+
+2003-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.h (mono_metadata_make_token): Put parentheses around macro
+ argument.
+
+ * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
+
+ * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain
+ icalls. Instead, do everything in managed code. This is needed since
+ it is hard to restore the original domain etc. in unmanaged code in the
+ presence of undeniable exceptions.
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef):
+ New icalls to push and pop appdomain refs.
+
+2003-10-31 Martin Baulig <martin@ximian.com>
+
+ * class.c (inflate_generic_type): Renamed to
+ mono_class_inflate_generic_type() and made it public.
+
+ * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
+ New interncall.
+
+ * loader.c (mono_field_from_memberref): Also set the retklass for
+ typespecs.
+
+ * fielder.c (mono_image_get_inflated_field_token): New static
+ method; creates a metadata token for an inflated field.
+ (mono_image_create_token, fixup_method): Added support for
+ "MonoInflatedField".
+ (fieldbuilder_to_mono_class_field): New static function.
+ (mono_reflection_inflate_field): New public function.
+
+ * reflection.h
+ (MonoReflectionGenericInst): Added `MonoArray *fields'.
+ (MonoReflectionInflatedField): New typedef.
+
+2003-10-30 Bernie Solomon <bernard@ugsolutions.com>
+
+ * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
+ for Solaris and other platforms without s6_addr16
+
+2003-10-30 Martin Baulig <martin@ximian.com>
+
+ * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
+ argument instead of two.
+ (mono_class_inflate_generic_signature): Likewise.
+ (inflate_generic_header): Likewise.
+ (mono_class_inflate_generic_method): Likewise. In addition, if
+ `ginst->klass' is set, it becomes the new `method->klass'.
+
+ * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
+ field.
+
+ * reflection.c (encode_generic_method_sig): Write a 0xa as the
+ first byte. [FIXME]
+ (method_encode_methodspec): If we have generic parameters, create
+ a MethodSpec instead of a MethodRef.
+ (fixup_method): Added support for "MonoInflatedMethod" and
+ "MonoInflatedCtor".
+ (mono_image_create_token): Added support for "MonoInflatedMethod"
+ and "MonoInflatedCtor".
+ (inflated_method_get_object): New static function; returns a
+ managed "System.Reflection.MonoInflatedMethod" object.
+ (mono_reflection_bind_generic_method_parameters): Return a
+ `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
+ (mono_reflection_inflate_method_or_ctor): Likewise.
+ (mono_image_get_generic_method_param_info): Initialize unused
+ fields to zero.
+ (mono_image_get_generic_param_info): Likewise.
+
+ * reflection.h (MonoReflectionInflatedMethod): New public
+ typedef. Corresponds to the managed "S.R.MonoInflatedMethod" and
+ "S.R.MonoInflatedCtor" classes.
+
+ * loader.c (method_from_memberref): If we're a TypeSpec and it
+ resolves to a generic instance, inflate the method.
+
+2003-10-28 Dick Porter <dick@ximian.com>
+
+ * object.c (mono_runtime_run_main): Convert command-line arguments
+ into utf8, falling back to the user's locale encoding to do so.
+
+2003-10-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.c (mono_get_method_from_token): Avoid looking up the icalls
+ at this time.
+
+ * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
+
+ * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
+ up icalls at method definition time. Partially fixes #33569.
+
+2003-10-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
+ marshalling of arrays. Fixes #50116.
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
+
+ * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
+ points to a vtable in the dying appdomain.
+
+ * appdomain.c (mono_domain_unload): Move the notification of OnUnload
+ listeners into unmanaged code inside the lock.
+
+ * object.c (mono_class_vtable): Turn off typed allocation in non-root
+ domains and add some comments.
+
+2003-10-25 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericInst): Added `MonoClass *klass' field.
+
+ * image.h (MonoImage): Added `GHashTable *typespec_cache'.
+
+ * metadata.c (mono_metadata_parse_generic_inst): Renamed to
+ `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
+ currently parsing. Create the generic class and store it in
+ `generic_inst->klass' before parsing the type arguments. This is
+ required to support "recursive" definitions; see mcs/tests/gen-23.cs
+ for an example.
+ (mono_type_create_from_typespec): Use a new `image->typespec_cache'
+ to support recursive typespec entries.
+
+ * class.c (mono_class_setup_parent): If our parent is a generic
+ instance, we may get called before it has its name set.
+ (mono_class_from_generic): Splitted into
+ mono_class_create_from_generic() and mono_class_initialize_generic().
+
+2003-10-25 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_BindGenericParameters): Return a
+ `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
+ ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
+ ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
+
+ * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
+ (create_typespec): Likewise.
+ (mono_reflection_bind_generic_parameters): Return a
+ `MonoReflectionGenericInst *' instead of a `MonoClass *'.
+ (mono_reflection_inflate_method_or_ctor): New public function.
+
+ * reflection.h (MonoReflectionGenericInst): New typedef.
+
+2003-10-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_class_proxy_vtable): Run the whole vtable construction
+ inside the domain lock. Fixes #49993.
+
+ * object.c (mono_class_vtable): When typed allocation is used,
+ allocate vtables in the GC heap instead of in the mempool, since the
+ vtables contain GC descriptors which are used by the collector even
+ after the domain owning the mempool is unloaded.
+
+ * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
+
+ * domain.c (mono_domain_unload): Rename to mono_domain_free to better
+ reflect what it does. Also invalidate mempools instead of freeing
+ them if a define is set.
+
+ * appdomain.h (MonoAppDomainState): New enumeration to hold the state
+ of the appdomain.
+
+ * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
+ hold the finalizable objects in this domain.
+
+ * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
+ appdomain.
+
+ * appdomain.c (mono_domain_set): New function to set the current
+ appdomain, but only if it is not being unloaded.
+
+ * appdomain.c threads.c threadpool.c object.c: Avoid entering an
+ appdomain which is being unloaded.
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
+ unloading of the root appdomain.
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
+ icall to execute a method in another appdomain. Intended as a
+ replacement for InternalSetDomain, which can confuse the code
+ generation in the JIT.
+
+ * appdomain.c (mono_domain_is_unloading): New function to determine
+ whenever an appdomain is unloading.
+
+ * appdomain.c (mono_domain_unload): New function to correctly unload
+ an appdomain.
+
+ * assembly.c (mono_assembly_load_references): Check that an assembly
+ does not references itself.
+
+ * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
+ domain manually, it asks the finalizer thread to do it, then waits for
+ the result. Also added a timeout.
+
+ * icall.c: Register the new icalls.
+
+ * threads.h threads.c: Export the mono_gc_stop_world and
+ mono_gc_start_world functions.
+
+ * mempool.h mempool.c (mono_mempool_invalidate): New debugging
+ function to fill out the mempool with 0x2a.
+
+2003-10-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h (MonoReflectionMethodAux): New structure to store
+ information which is rarely used, thus is not in the MonoMethod
+ structure.
+
+ * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
+ store the aux info.
+
+ * reflection.c (mono_methodbuilder_to_mono_method): Store param names
+ and marshalling info into the aux structure.
+
+ * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
+ from the aux structure.
+
+ * loader.c (mono_method_get_param_names): Retrieve the param names from
+ the aux structure.
+
+2003-10-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * exception.h exception.c: Add AppDomainUnloadedException && fix
+ warning.
+
+2003-10-21 Dick Porter <dick@ximian.com>
+
+ * socket-io.c
+ (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
+ patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
+
+2003-10-21 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_bind_generic_parameters):
+ `klass->parent' is NULL for interfaces.
+
+2003-10-21 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
+
+2003-10-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * exception.c (mono_exception_from_name_msg): New helper function for
+ creating exceptions and initializing their message field.
+
+ * exception.c: Simplify functions using the new helper.
+
+ * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
+ New function.
+
+ * object.h object.c: Remove G_GNUC_NORETURN from the signature of
+ mono_raise_exception, since otherwise gcc doesn't generate the function
+ epilog for raise_exception, confusing the stack unwinding in the JIT.
+ Fixes #45043.
+
+ * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
+ PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
+ Fixes #49499.
+
+2003-10-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
+ utf8.
+
+2003-10-18 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * icall.c: Removed GetUninitializedObject method because
+ AllocateUninitializedClassInstance does the same.
+
+2003-10-18 Martin Baulig <martin@ximian.com>
+
+ * class.c (inflate_generic_signature): Renamed to
+ mono_class_inflate_generic_signature() and made it public.
+ (my_mono_class_from_generic_parameter): New static function; if we
+ don't already have the generic parameter's MonoClass, create a
+ very simple one which is just used internally in the runtime and
+ not passed back to managed code.
+
+ * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
+
+ * metadata.h (MonoMethodSignature): Moved the
+ `MonoGenericParam *gen_params' to the MonoMethodHeader.
+ (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
+
+ * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
+ ves_icall_MonoMethod_GetGenericArguments(); this is now an
+ interncall on the MonoMethod class, not on MethodInfo.
+ (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
+ calling mono_reflection_bind_generic_method_parameters() directly.
+
+ * loader.c (mono_method_get_signature): If this is a MethodSpec;
+ return the already computed `method->signature'.
+ (method_from_methodspec): New static function to load a method
+ from a MethodSpec entry.
+ (mono_get_method_from_token): Call the new method_from_methodspec()
+ for MethodSpec tokens.
+ (mono_get_method_from_token): If we're a generic method, load the
+ type parameters.
+
+ * reflection.c (mono_image_get_memberref_token): Allow
+ MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
+ table.
+ (fixup_method): Added support for MONO_TABLE_METHODSPEC.
+ (mono_image_create_token): First check whether it's a generic
+ method (so we'd need to create a MethodSpec), then do the other
+ two alternatives.
+ (mono_reflection_bind_generic_method_parameters): Return a
+ `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
+ called directly from the interncall.
+
+2003-10-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (load_public_key): Move loading of the public key
+ into managed code.
+
+ * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
+
+ * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
+ fields.
+
+ * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
+ culture, hash_alg and public_key. Fixes #49555.
+
+2003-10-17 Martin Baulig <martin@ximian.com>
+
+ * class.h (MonoGenericInst): Moved this declaration here and added
+ `MonoMethod *generic_method'.
+
+ * icall.c
+ (ves_icall_MethodInfo_GetGenericArguments): New interncall.
+ (ves_icall_MethodInfo_BindGenericParameters): New interncall.
+
+ * metadata.c (mono_metadata_type_equal): Two types of
+ MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
+ index; ie. don't compare the address of the `MonoGenericParam'
+ structure.
+ (mono_metadata_load_generic_params): Removed the `MonoMethod
+ *method' argument.
+
+ * metadata.h (MonoGenericInst): Moved declaration to class.h.
+ (MonoMethodHeader): Added `MonoGenericInst *geninst'.
+
+ * reflection.c (method_encode_signature): Encode the number of
+ generic parameters.
+ (encode_generic_method_sig): New static function.
+ (method_encode_methodspec): New static function; creates an entry
+ in the MethodSpec table for a generic method.
+ (mono_image_get_methodspec_token): New static function.
+ (mono_image_create_token): Call mono_image_get_methodspec_token()
+ for generic methods.
+ (mono_reflection_bind_generic_method_parameters): New public
+ function. Instantiates a generic method.
+
+2003-10-16 Martin Baulig <martin@ximian.com>
+
+ * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
+ *gen_params' here from MonoMethodHeader.
+
+ * metadata.c (mono_metadata_parse_method_signature): If we have
+ generic parameters, initialize `method->gen_params' and then set
+ the correct `type->data.generic_param' in all the parameters.
+
+2003-10-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * threads.c (mono_threads_get_default_stacksize): New function to
+ return the default stacksize.
+
+ * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
+ termination of the finalizer thread, since the previous method had
+ race conditions. Fixes #49628.
+
+ * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
+ as for the other managed threads.
+
+2003-10-16 Martin Baulig <martin@ximian.com>
+
+ * class.c (inflate_generic_signature): Copy `generic_param_count'
+ and `gen_params'.
+
+ * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
+ New interncall.
+
+ * metadata.c (mono_metadata_parse_method_signature): Actually set
+ the `method->generic_param_count' here.
+ (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
+
+2003-10-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.h: Add a new field to TypedRef to simplify the implementation
+ of the REFANY opcodes in the JIT.
+
+ * icall.c: Make use of the new field.
+
+ * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
+ dynamically.
+
+2003-10-15 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_from_gen_param): Renamed to
+ mono_class_from_generic_parameter() and moved most of the
+ functionality from mono_reflection_define_generic_parameter()
+ here; ie. we create a "real" class here.
+ (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
+ MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
+ previously been called.
+
+ * class.h (MonoGenericParam): Moved the declaration of this struct
+ here from metadata.h and added `MonoMethod *method'.
+
+ * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
+ interncall.
+
+ * loader.c (mono_get_method_from_token): If we have any generic
+ parameters, call mono_metadata_load_generic_params() to read them
+ from the MONO_TABLE_GENERICPAR.
+
+ * metadata.c (mono_metadata_load_generic_params): Added
+ `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
+
+ * metadata.h (MonoMethodSignature): Replaced
+ `MonoGenericInst *geninst' with `guint16 generic_param_count'.
+ (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
+
+ * reflection.c (mono_reflection_define_generic_parameter): Moved
+ most of the functionality into the new
+ mono_class_from_generic_parameter(); set the `method' field if
+ we're a method parameter.
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * marshal.c (emit_struct_conv): if native size is 0
+ emit no code.
+
+2003-10-14 Martin Baulig <martin@ximian.com>
+
+ * icall.c: The generics API has changed in the spec since it was
+ added to System.Type; these modifications make it match the spec
+ again.
+ (ves_icall_Type_GetGenericParameters): Renamed to
+ `ves_icall_Type_GetGenericArguments'.
+ (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
+ (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
+ `ves_icall_MonoType_get_HasGenericArguments'.
+ (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
+ `ves_icall_MonoType_get_IsGenericParameter'.
+ (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
+ this is no interncall anymore.
+ (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
+ `ves_icall_TypeBuilder_get_IsGenericParameter'.
+
+2003-10-14 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_bind_generic_parameters): Also
+ inflate generic methods if we're reading the class from IL.
+
+2003-10-13 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_define_generic_parameter): This
+ method isn't called directly from the icall anymore; take a
+ `MonoReflectionAssemblyBuilder *' so we can use this for type and
+ method generic parameters.
+ (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
+ (method_builder_encode_signature): Encode generic parameters.
+ (mono_image_get_method_info): Write generic params to the
+ MONO_TABLE_GENERICPARAM table.
+
+ * reflection.h (MonoReflectionMethodBuilder): Added
+ `MonoArray *generic_params'.
+
+ * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
+
+ * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
+ wrapper for mono_reflection_define_generic_parameter().
+ (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
+
+2003-10-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.h: Add missing function to fix build.
+
+ * marshal.c (mono_marshal_get_native_wrapper): Add support for
+ the SetLastError pinvoke attribute.
+
+ * marshal.c (mono_marshal_set_last_error): New helper function called
+ by the generated code.
+
+ * marshal.c (mono_mb_emit_branch): New helper function.
+
+ * marshal.c (mono_mb_emit_exception): Added exception name parameter.
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Added support for
+ classes as parameters and return values of delegates. Fixes #29256.
+
+2003-10-12 Bernie Solomon <bernard@ugsolutions.com>
+
+ * locales.c: use gint32 in non HAVE_ICU case
+
+2003-10-11 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.c (mono_debug_add_method): Added a workaround for
+ bug #48591.
+
+2003-10-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
+ delegates passed to native code must use the STDCALL calling
+ convention. Fixes #35987.
+
+2003-10-10 Martin Baulig <martin@ximian.com>
+
+ * class.c (inflate_generic_type): If we're inflating for a generic
+ type instance (and not for a generic method), return
+ MONO_TYPE_MVAR unchanged.
+
+2003-10-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * string-icalls.c: Join ignores null strings in the source array.
+ * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
+ * threads.c: GetAvailableTheads is slightly more accurate.
+
+2003-10-09 Bernie Solomon <bernard@ugsolutions.com>
+
+ * threads.h threads.c : add mono_threads_set_default_stacksize
+ and pass default to CreateThread calls.
+
+2003-10-09 Dick Porter <dick@ximian.com>
+
+ * icall.c:
+ * locales.h:
+ * locales.c: Internal calls for constructing CultureInfo and
+ related objects from libicu (if its available.)
+
+2003-10-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
+
+2003-10-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: added an argument to async_invoke_thread that is the
+ item to process, pass the MonoAsyncResult to the thread start function
+ when creating a new thread. This way we don't need to acquire any lock
+ when we're creating a new thread. Readded a semaphore for faster
+ response times (instead of that Sleep i added).
+
+2003-10-08 Bernie Solomon <bernard@ugsolutions.com>
+
+ * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
+ get daylight change dates better on Windows, fix handling
+ of platforms without tm_gmtoff.
+
+2003-10-06 Martin Baulig <martin@ximian.com>
+
+ * class.c (inflate_generic_method): Renamed to
+ mono_class_inflate_generic_method() and made public.
+ (mono_class_init): Don't inflate the generic methods here.
+ (mono_class_from_generic): Added `gboolean inflate_methods'
+ argument. Inflate the methods here.
+
+ * loader.c (mono_method_get_param_names): Ignore instances of
+ generic types for the moment.
+
+ * reflection.c (fixup_method): Added support for inflated methods.
+ (mono_image_create_token): Use mono_image_get_methodref_token()
+ for inflated methods.
+ (mono_custom_attrs_from_param): Ignore instances of generic types
+ for the moment.
+ (mono_reflection_bind_generic_parameters): New public function.
+ Moved all the functionality from
+ ves_icall_Type_BindGenericParameters() here and added support for
+ dynamic types.
+ (mono_reflection_define_generic_parameter): Initialize
+ `klass->methods' here.
+
+ * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
+ functionality into mono_reflection_define_generic_parameter().
+ (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
+ TypeBuilder, return that TypeBuilder.
+
+2003-10-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: removed mono_delegate_semaphore.
+
+ * threadpool.c:
+ (mono_thread_pool_add): moved hash table creation inside and the thread
+ creation outside of the critical region.
+ (mono_thread_pool_finish): removed obsolete code.
+ (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
+ continue or exit the thread depending on the queue.
+
+2003-10-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
+ marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
+ handle more bool marshalling options
+
+2003-10-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
+ arrays of structs. Also add a more descriptive error message when
+ a structure member is marshalled as LPArray.
+
+2003-10-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_get_native_wrapper): Add support for
+ marshalling arrays of complex types. Fixes #29098. Also remove an
+ usused and incomplete function.
+
+Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: report heap_size - free_bytes as total memory allocated
+ (bug#49362).
+
+2003-10-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally
+ fix timezone handling problems on Windows.
+
+ * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
+ asserts when the year is outside the range handled by ms the functions.
+
+ * class.c (setup_interface_offsets): If the class is an interface,
+ fill out its interface_offsets slot.
+
+2003-10-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: mark threadpool threads as background.
+
+2003-10-03 Bernie Solomon <bernard@ugsolutions.com>
+
+ * decimal.c - define DECINLINE to nothing if not using GCC
+
+2003-10-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.c: More refcount fixes.
+
+2003-10-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * string-icalls.c: if we're not trimming, return the same string.
+ When not splitting, don't create a new string.
+
+2003-10-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * image.c:
+ (mono_image_open): increment the ref_count inside the critical section.
+
+2003-10-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.c (mono_image_open): Fix reference counting bug.
+
+2003-09-30 Bernie Solomon <bernard@ugsolutions.com>
+
+ * marshal.c (mono_marshal_type_size) struct alignment changed for
+ 64bit machines. (emit_ptr_to_str_conv) Fix bool conversions for
+ 64bits. Avoid leak in mono_marshal_get_native_wrapper when
+ mono_lookup_pinvoke_call throws.
+
+2003-09-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_parse_type): Fix #49114.
+
+ * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
+ temporary workaround for cygwin header problem.
+
+ * object.c (mono_object_isinst): Synchronize this with the code
+ generated by the JIT for casts.
+
+2003-09-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (encode_type): Fix #38332.
+
+2003-09-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_method_from_wrapper): New function to return
+ the original method from the wrapper method.
+
+2003-09-25 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
+ interncall since it was identical to `Type.GetGenericTypeDefinition()'.
+ (ves_icall_Type_get_IsGenericInstance): New interncall.
+
+2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
+
+ * object.c: fix cast warning in big endian code.
+
+2003-09-19 Jackson Harper <jackson@latitudegeo.com>
+
+ * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
+
+2003-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * assembly.c: don't call check_env from mono_assembly_load. It's
+ already done once in mono_assemblies_init and may cause headaches when
+ multiple threads are loading assemblies.
+
+2003-09-19 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_define_generic_parameter): Don't
+ allocate `klass->methods', set `klass->flags' to
+ TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
+
+2003-09-18 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_init): Don't create `class->methods' if it's
+ already initialized.
+
+ * metadata.c (mono_metadata_load_generic_params): Make this
+ actually work.
+
+ * reflection.c (mono_reflection_define_generic_parameter): Set
+ parent class and interfaces from the constraints.
+
+ * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
+ to keep this struct in sync with the declaration in TypeBuilder.cs.
+
+2003-09-17 Martin Baulig <martin@ximian.com>
+
+ * metadata.h (MonoType): Replaced the data's `int type_param'
+ field with `MonoGenericParam *generic_param'.
+ (MonoGenericParam): Added `MonoClass *klass'.
+
+ * class.c (mono_class_from_gen_param): Removed the
+ `MonoImage *image' and `int type_num' arguments.
+
+ * metadata.c (mono_metadata_parse_generic_param): New static
+ method; creates a MonoGenericParam which just contains the index.
+ (do_mono_metadata_parse_type): Call
+ mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
+ MONO_TYPE_MVAR.
+
+ * reflection.c (mono_image_typedef_or_ref): Generic type
+ parameters may be in the same assembly, but never use a typedef
+ for them.
+ (mono_reflection_define_generic_parameter): We're now creating a
+ "real" class for the type parameter; it's now safe to call
+ mono_class_from_mono_type() on the class'es type, it'll do the
+ right thing.
+
+2003-09-16 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
+ `symfile->range_entry_size' and `symfile->class_entry_size' here;
+ the `symfile' data structure must be fully initialized before it
+ gets added to the table.
+
+2003-09-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
+
+ * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
+ class init trampolines.
+
+2003-09-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
+ to the built-in profiler to turn off time and allocation profiling
+ respectively.
+
+2003-09-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
+ g_direct_equal.
+
+ * debug-helpers.c (mono_method_full_name): Print the wrapper type
+ in human readable form.
+
+2003-09-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c icall.c: Fixed warnings.
+
+ * image.c (load_class_names): Use a temporary hash table to hold the
+ namespaces in order to avoid doing many string comparisons.
+
+ * image.h: Fix typo.
+
+ * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
+ Pass NULL instead of g_direct_equal to the GHashTable constructor
+ since the NULL case is short-circuited inside g_hash_table_lookup,
+ leading to better performance.
+
+ * metadata.c (mono_metadata_custom_attrs_from_index): New function to
+ obtain the first custom attribute for a given index. Depends on the
+ CustomAttribute table being sorted by the parent field.
+
+ * reflection.c (mono_custom_attrs_from_index): Use the new function
+ for better performance.
+
+2003-09-07 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_init): If we're a generic instance, inflate
+ all our methods instead of loading them from the image.
+ (mono_class_from_generic): Set `class->methods = gklass->methods'.
+
+2003-09-07 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c: Added support for constructors.
+
+2003-09-06 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
+ New interncall.
+
+ * reflection.c (mono_reflection_setup_generic_class): Call
+ ensure_runtime_vtable() to create the vtable.
+
+2003-09-05 Martin Baulig <martin@ximian.com>
+
+ * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
+ MONO_TYPE_MVAR.
+
+2003-09-04 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_reflection_define_generic_parameter): Generic
+ parameters start with zero.
+
+2003-09-04 Martin Baulig <martin@ximian.com>
+
+ * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
+
+ * reflection.h (MonoReflectionGenericParam): New typedef.
+ (MonoReflectionTypeBuilder): Added `generic_params' fields to get
+ the generic parameters from the managed TypeBuilder.
+
+ * reflection.c (mono_reflection_define_generic_parameter): New function.
+ (mono_reflection_create_runtime_class): Encode generic parameters.
+ (mono_reflection_setup_generic_class): New function; this is
+ called after adding adding all generic params to the TypeBuilder.
+ (encode_type): Added MONO_TYPE_VAR.
+
+2003-09-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.h class.c (mono_class_needs_cctor_run): Moved this method
+ here from the JIT.
+
+ * assembly.h assembly.c: Moved the AOT loading code into an assembly
+ load hook.
+
+2003-09-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h reflection.c class.h class.c: Delete duplicate
+ definition of mono_type_get_name () from reflection.c and export the
+ one in class.c.
+
+ * class.c: Class loading fixes from Bernie Solomon
+ (bernard@ugsolutions.com).
+
+ * reflection.c: Endianness fixes from Bernie Solomon
+ (bernard@ugsolutions.com).
+
+2003-09-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * assembly.h assembly.c: Define a file format version for AOT
+ libraries.
+
+ * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
+
+ * appdomain.h (MonoJitInfo): New field to determine whenever the
+ code is domain neutral.
+
+2003-08-31 Miguel de Icaza <miguel@ximian.com>
+
+ * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
+
+2003-08-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir):
+ (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
+ Avoid caching the result since strings must be domain specific. Fixes
+ #48050.
+
+2003-08-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.c (mono_marshal_init): Make this callable multiple times
+ since it is hard to find a correct place to call it.
+
+ * object.c (mono_runtime_class_init): Execute static constructors in
+ the correct appdomain.
+
+ * image.c (build_guid_table): Handle the case when multiple images have
+ the same GUID.
+
+2003-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added a couple of icalls for System.Web.
+
+2003-08-28 Martin Baulig <martin@ximian.com>
+
+ * icall.c (ves_icall_Type_BindGenericParameters): Use
+ `klass->generic_inst' instead of `&klass->byval_arg' in the
+ mono_type_get_object() call. The returned type must be
+ MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
+
+2003-08-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * NOTES: New file.
+
+ * object.c (mono_class_proxy_vtable): Make it thread safe.
+
+ * pedump.c: Fix warning.
+
+ * object.c appdomain.h: Get rid of metadata_section.
+ It is no longer needed and it was causing deadlocks with domain->lock.
+
+ * appdomain.c (add_assemblies_to_domain): Make it thread safe.
+
+2003-08-26 Martin Baulig <martin@ximian.com>
+
+ * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
+
+2003-08-26 Martin Baulig <martin@ximian.com>
+
+ * pedump.c (main): Call mono_metadata_init(),
+ mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
+ and mono_loader_init().
+
+2003-08-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.h: Add missing include to fix build.
+
+ * image.h: mono_image_load_references is no more.
+
+ * assembly.c: Reworked assembly loading to make it really thread safe.
+ After these changes, the assembly returned by mono_assembly_open is
+ fully initialized, i.e. all its references assemblies are loaded.
+
+ * assembly.c (mono_image_load_references): Renamed to
+ mono_assembly_load_references, and made private, since clients no
+ longer need to call it.
+
+ * class.c: Removed calls to mono_assembly_load_references, since it was
+ a source of deadlocks.
+
+ * loader.h loader.c class.h class.c: Protect data structures using a
+ new lock, the loader lock.
+
+ * class.c (mono_class_setup_vtable): Create temporary hash tables and
+ GPtrArrays only when needed.
+
+ * class.c (mono_class_layout_fields): Ignore the dummy field inserted
+ into empty structures by mcs. Fixes pinvoke7.cs.
+
+ * domain.c (mono_init): Call a new initialization function.
+
+ * appdomain.c (mono_runtime_init): Call the new initializer function
+ of the marshal module.
+
+ * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
+ inserted into empty structures by mcs. Fixes pinvoke7.cs.
+
+ * marshal.h marshal.c: Added locks around the wrapper caches to make
+ this module thread safe.
+
+ * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
+ this argument. Fixes pinvoke1.exe.
+
+2003-08-25 Lluis Sanchez <lluis@ximian.com>
+
+ * object.h: Added call_type field to MonoMethodMessage and the corresponding
+ enumeration of values. Removed fields to store remote call output values in
+ MonoAsyncResult. Not needed any more.
+ * object.c: Initialize call_type and async_result fields in mono_message_init.
+ * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
+ dispatching the message.
+ mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
+ async call to finish. To do it use a message with EndInvoke call type.
+
+2003-08-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.h loader.c (mono_method_hash_marhal_info): New function which
+ determines whenever a method has marshalling info.
+
+2003-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * assembly.c: fix the build on windows.
+
+2003-08-22 Lluis Sanchez <lluis@ximian.com>
+
+ * object.cs: Fixed bug #47785.
+
+2003-08-22 Jackson Harper <jackson@latitudegeo.com>
+
+ * string-icalls.c (StringReplace): If their are no occurances of
+ the old string found return a reference to the supplied
+ string. This saves some memory and matches MS behavoir.
+
+2003-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: fixed compilation for systems that define AF_INET6
+ and don't define SOL_IP/SOL_IPV6.
+
+2003-08-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_object_isinst): Fix casts to TransparentProxy in
+ the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
+
+ * rawbuffer.c rawbuffer.h: Make this module thread safe.
+
+ * domain.c: Make this module thread safe.
+
+ * domain.c (mono_init): Call new initialization function.
+
+ * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
+ reference types too. Fixes #38812.
+
+ * image.c (mono_image_init): Fixed warnings.
+
+ * class.c (mono_class_from_typeref): Handle assembly load failure
+ correctly.
+
+ * appdomain.c (add_assemblies_to_domain): Handle the case when
+ the references of an assembly are not yet loaded.
+
+ * metadata.c image.c assembly.c: Moved initialization of global
+ variables to a separate function called at startup since lazy
+ initialization of these variables is not thread safe.
+
+ * image.c assembly.c: Made this module thread safe by adding locks in
+ the appropriate places.
+
+ * domain.c (mono_init): Call the new initialization functions of the
+ three modules.
+
+2003-08-20 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
+ make a direct call. It is proxy's work to make the call asynchronous.
+ mono_delegate_end_invoke(): If the targe is a proxy, just collect
+ the return values.
+ * object.cs: mono_method_call_message_new(): read AsyncResult and
+ state object from parameters list, if this info is requested.
+ * object.h: Added fields to store remote call output values in
+ MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
+
+Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.h: add needed fields to MonoThread.
+ * threads.c, threads.h: allow registering a function to cleanup data
+ allocated per thread by the JIT.
+
+Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * loader.h: portability fix by Bernie Solomon
+ * <bernard@ugsolutions.com>.
+
+2003-08-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h reflection.c (mono_param_get_objects): Changed this to
+ return a MonoArray. This simplifies the code and also ensures that
+ the cache allways contains an object reference as a value.
+
+ * icall.c (ves_icall_get_parameter_info): Simplified using the new
+ function.
+
+2003-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
+ fixes a problem with byte ordering when getting the address family for
+ a socket.
+
+2003-08-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * .cvsignore: Added monosn.
+
+ * reflection.h reflection.c loader.c: Added support for parameter
+ marshalling to dynamically created types. Fixes #47295.
+
+Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * rand.c: remove useless warnings.
+
+Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: implemented ldtoken for methods and fieldrefs.
+
+2003-08-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: when mono_async_invoke was called, no one took care of
+ monitoring the queue. So if the method invoked took some time and we
+ got new async invoke requests after 500 ms (the thread created waited
+ that long in WaitForSingleObject), the new async invoke was not called
+ until the previous one finished.
+
+ This is fixed now. Thanks to Totte for helping with it.
+
+2003-08-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
+
+2003-08-11 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
+
+2003-08-06 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c: Added support for static fields,
+ properties and methods.
+
+2003-08-06 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c: Don't store the MonoString's vtable to
+ make this work for applications with multiple application domains.
+
+2003-08-04 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c: Completely reworked the type support; the
+ most important thing is that we're now just using one single
+ `MonoType' instance per type.
+
+Sat Aug 2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
+
+ * mono-endian.h, mono-endian.c, icall.c: Added icall
+ ves_icall_System_Double_AssertEndianity to assert double word endianity
+ on ARM (FPA). The icall uses a macro defined in mono-endian.h.
+
+Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
+ support, icalls and fixes.
+
+2003-07-31 Miguel de Icaza <miguel@ximian.com>
+
+ * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
+ classes that are a punctuation character in .NET is not the same a
+ g_unichar_ispunct.
+
+Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
+
+2003-07-29 Miguel de Icaza <miguel@ximian.com>
+
+ * icall.c: Add new MemCopy internalcall.
+ (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
+ Simplified code; It is not necessary to handle all the cases here,
+ as the C# code takes care of it. Only handle the case of the name
+ resource embedded into the assembly.
+
+ Changed signature to return the data pointer and the size of the
+ data.
+
+2003-07-26 Miguel de Icaza <miguel@ximian.com>
+
+ * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
+ encoded. (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
+
+2003-07-29 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * socket-io.c: ignore EINTR error in select.
+
+Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.h, class.c: removed unused subclasses field in MonoClass.
+
+2003-07-29 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * icall.c: improve fix of get_base_definition(). If the parent class
+ doesn't have the mehod, look at the parent of the parent.
+ * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
+ to check if a parameter is an in or out parameter
+ (PARAM_ATTRIBUTE_IN is not set by default).
+ mono_method_return_message_restore(): Use mono_class_value_size to
+ get the size of a value type. mono_type_stack_size (parameterType)
+ does not return the correct value if parameterType is byRef.
+ mono_load_remote_field(), mono_load_remote_field_new(),
+ mono_store_remote_field(), mono_store_remote_field_new():
+ raise exception if the remote call returns an exception.
+
+2003-07-28 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
+ method. This is a wrapper around mono_runtime_invoke() which
+ boxes the instance object if neccessary.
+
+Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, class.h, image.c, image.h, loader.c, metadata.c,
+ metadata.h, row-indexes.h, verify.c: first cut of generics support.
+
+Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: disable mcs bug workaround.
+
+2003-07-21 Miguel de Icaza <miguel@ximian.com>
+
+ * object.c (mono_runtime_class_init): Take the metadata_section
+ mutex before obtaining the domain mutex.
+
+ * appdomain.h: Added definition of metadata_section mutex here.
+
+ * object.c: define metadata_mutex here.
+
+2003-07-24 Ravi Pratap <ravi@ximian.com>
+
+ * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
+ fixed.
+
+2003-07-24 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * reflection.c: Fix bug #46669
+
+2003-07-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * exception.c:
+ * exception.h:
+ * icall.c:
+ * object.h: fill in the type name for TypeLoadException.
+
+2003-07-23 Ravi Pratap <ravi@ximian.com>
+
+ * class.c: Fixes from Paolo in response to bug #45415 (Subclass
+ relationship between TypeBuilders while compiling corlib) and bug
+ 45993 (Array types returned from the runtime while compiling
+ corlib were from the loaded corlib).
+
+2003-07-22 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c: Reworked the type support a bit more;
+ distinguish between types and classes.
+
+Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: add IsArrayImpl icall.
+
+2003-07-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_class_layout_fields): Fix gc aware auto layout by
+ initializing real_size only once. Also fix bug #46602.
+
+2003-07-21 Jerome Laban <jlaban@wanadoo.fr>
+
+ * object.c: Renamed mono_metadata_section to metadata_section.
+
+2003-07-21 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
+ empty array if the type is an array. Fixed.
+ ves_icall_MonoMethod_get_base_definition: if the base method
+ is abstract, get the MethodInfo from the list of methods of
+ the class.
+ * reflection.c: ParameterInfo.PositionImpl should be zero-based
+ and it was 1-based. Fixed in mono_param_get_objects.
+
+2003-07-20 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.h: Set version number to 31.
+ (mono_debug_init): Added `MonoDomain *' argument.
+
+ * mono-debug-debugger.c: Reworked the type support; explicitly
+ tell the debugger about builtin types; pass the `klass' address to
+ the debugger.
+
+2003-07-20 Jackson Harper <jackson@latitudegeo.com>
+
+ * image.c: Allow new metadata tables to be loaded without a
+ warning. Also update the warning message to give the new constant value.
+
+Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
+ metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c:
+ array type representation changes.
+
+Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
+ on Environment.Exit () call.
+
+Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c, reflection.h, reflection.c, verify.c: cleanups,
+ requires a matching corlib.
+
+2003-07-17 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * Changelog: My editor decided to add a CR to each line. Sorry about that.
+ Committed again without the CRs.
+
+2003-07-17 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * socket-io.c: Get system_assembly using mono_image_loaded(), instead
+ getting it from the "this" socket instance. Did not work
+ if the socket is a subclass of Socket.
+ Also fixed bug #35371.
+
+Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c: fixed size for TypedByRef.
+ * loader.c: when searching for a method, consider the vararg amrker.
+ * unicode.c, decimal.c: constify some arrays.
+
+2003-07-15 Dick Porter <dick@ximian.com>
+
+ * socket-io.c: Fixed compilation for gcc < 3.2.
+
+ Fixed compilation for machines that don't have AF_INET6 (thanks to
+ Bernie Solomon <bernard@ugsolutions.com> for that part.)
+
+ Fixed compile warnings.
+
+ Fixed formatting and line endings.
+
+2003-07-14 Jerome Laban <jlaban@wanadoo.fr>
+
+ * socket-io.h:
+ * socket-io.c: Added IPv6 support.
+
+2003-07-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_class_is_assignable_from): New function to implement
+ the is_assignable_from logic. Used by mono_object_isinst,
+ Type::IsAssignableFrom () and the interpreter.
+
+ * class.c (mono_class_is_subclass_of): Make all classes a subclass of
+ Object, even interfaces.
+
+ * object.c (mono_object_isinst): Implement in terms of
+ is_assignable_from.
+
+ * icall.c (ves_icall_type_is_assignable_from): New icall.
+
+2003-07-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * domain.c (foreach_domain): fix compiler warning.
+
+2003-07-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * image.c (load_metadata_ptrs): use g_strndup because strndup is
+ not available on all plattforms
+
+2003-07-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.h image.c: Store the metadata version string in MonoImage.
+ * icall.c: New icall to retrieve the image version.
+ * reflection.c (create_dynamic_image): Fill in the image version field
+ * reflection.c (build_compressed_metadata): Use the image version
+ from the image structure.
+
+2003-07-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: modified comment.
+ * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
+ That will be its last iteration when mono_gc_cleanup is called from
+ mono_runtime_cleanup and before the domain is unloaded.
+
+ Fixes bug #45962.
+
+2003-07-04 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
+ attributes.
+
+Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
+ rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
+ Bernie Solomon <bernard@ugsolutions.com>.
+
+Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.c, object.h: provide mono_object_new_fast() for faster
+ allocation in some special cases.
+
+Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.h, reflection.h, verify.c: fixes for some 64bit issues,
+ mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
+
+Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * threadpool.c: fix leaks.
+
+2003-07-01 Dick Porter <dick@ximian.com>
+
+ * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
+ using MonoGHashTables. Fixes threadpool bug posted to list.
+
+Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * image.h, image.c: added support to load an assembly from a byte array.
+ * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added
+ assembly bundle support.
+
+2003-06-27 Dietmar Maurer <dietmar@ximian.com>
+
+ * threadpool.c (mono_thread_pool_add): keep a reference to the
+ AsyncResult to prevent GC
+
+Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: leak fix.
+
+2003-06-25 Dick Porter <dick@ximian.com>
+
+ * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
+ for the async object, the WaitHandle object will close the handle.
+ Fixes bug 45321.
+
+Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: in mono_array_class_get (), lookup from the hash with the
+ same type we insert: this works around a bug in
+ mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
+ lluis. The real fix will have to wait for after the release.
+
+Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: fix memory leak when getting type members.
+
+Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: added more pubtoken special cases.
+
+Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: handle field offset correctly when class size
+ is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
+
+2003-06-20 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
+ *image' field.
+
+2003-06-20 Martin Baulig <martin@ximian.com>
+
+ * image.h, mono-debug-debugger.h: Fixed compiler warnings.
+
+2003-06-20 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed. We
+ just distinguish between variables in registers and variables at
+ an offset relative to a register.
+
+2003-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: #ifdef out latest changes until mcs is fixed.
+
+Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: return members in metadata order.
+
+Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: avoid infinite loop in GetTimeZoneData.
+
+Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: added Marshal.Prelink/All icalls.
+
+Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.c, object.h: fix warnings and do some overflow checking
+ when creating arrays.
+
+2003-06-17 Dick Porter <dick@ximian.com>
+
+ * file-io.h:
+ * file-io.c: File attributes need to be tweaked slightly when
+ passed from the managed to the w32 world.
+
+2003-06-17 Zoltan Varga <vargaz@freemail.hu>
+ * profiler.h profiler-private.h profiler.c: Rework last patch
+ based on suggestion by Paolo.
+
+2003-06-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * profiler.h profiler-private.h profiler.c: Added infrastructure for
+ instruction level coverage data collection.
+ * profiler.h profiler.c (: Added new callback function which can be
+ used by the profiler to limit which functions should have coverage
+ instrumentation.
+ * profiler.c (mono_profiler_load): Call g_module_build_path to
+ generate the file name of the profiler library.
+
+Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * profiler.c, profiler.h, profiler-private.h: added basic block
+ coverage profiling API.
+
+2003-06-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_create_runtime_class): Add support
+ for events in dynamically generated code.
+
+ * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
+ not allocated.
+
+Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: when getting timezone info, return reasonable values if we
+ can't get the actual data.
+
+2003-06-14 Dick Porter <dick@ximian.com>
+
+ * threads.c (start_wrapper): Remove the reference to the thread
+ object in the TLS data, so the thread object can be finalized.
+ This won't be reached if the thread threw an uncaught exception,
+ so those thread handles will stay referenced :-( (This is due to
+ missing support for scanning thread-specific data in the Boehm GC
+ - the io-layer keeps a GC-visible hash of pointers to TLS data.)
+
+Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: ensure streams and tables are first allocated with
+ ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
+
+Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: fixed GetElementType for byrefs (bug# 44792).
+
+2003-06-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_create_runtime_class): Add support for
+ properties to dynamically created classes.
+ * reflection.c: Fix a few places where non-MonoObjects were inserted
+ into the tokens hashtable.
+
+Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: some support to handle out of memory exceptions.
+
+2003-06-12 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): support reference
+ return types
+
+Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.h, object.c: more portability stuff from Bernie Solomon.
+ Unexport mono_object_allocate(). Added mono_object_unbox ().
+ Set exitcode when an unhandled exception is thrown.
+
+2003-06-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): use custom
+ marshaler for return types.
+
+2003-06-10 Dick Porter <dick@ximian.com>
+
+ * socket-io.c: Don't assume that one of struct ip_mreqn or struct
+ ip_mreq is available
+
+Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
+ mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
+ by Bernie Solomon <bernard@ugsolutions.com>.
+
+2003-06-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c (mono_gc_init): Avoid error message on shutdown when
+ GC_DONT_GC=1 is used.
+
+ * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal):
+ New icall to return the GUID of a module.
+
+Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: ensure instance size always includes the parent's size
+ even whem class size is set explicitly (fixes bug#44294).
+
+Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * profiler.h, profiler.c: made the simple profiler thread-safe,
+ get more accurate timing info. Allow the loading of an
+ externally-developed profiler module.
+
+2003-06-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): improved
+ class/byref arguments.
+ (mono_marshal_get_native_wrapper): better string marshaling support.
+
+Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: ensure .pack and .size are handled correctly and
+ simplified layout of static fields.
+
+2003-06-04 Dietmar Maurer <dietmar@ximian.com>
+
+ * appdomain.c
+ (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
+
+ * loader.c (mono_lookup_pinvoke_call): look for modules in the
+ current directory (fix bug 44008)
+
+2003-06-03 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): started support for
+ custom marshalers.
+ (mono_delegate_to_ftnptr): consider marshalling specifications
+
+Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c, reflection.h: emit custom marshal info.
+
+2003-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c: free the GError.
+ * icall.c: added CloseEvent_internal.
+ * threads.[ch]:
+ (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
+ call.
+
+2003-06-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.c (mono_method_get_signature): Add support for dynamic
+ assemblies.
+
+Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fixed bug #43905.
+
+Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, domain.c, icall.c, metadata.h, object.h: support for
+ handling TypedReference and ArgIterator.
+ * loader.c, loader.h: added function to get signature at call site.
+
+Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more
+ data readonly. Buglets and warning fixes. Some MethodSpec support.
+
+Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.h, class.c, object.c: remove relative numbering support.
+
+2003-05-26 Miguel de Icaza <miguel@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): For now, do not
+ free the string, until we get a chance to fix Gtk#
+
+2003-05-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * marshal.c: revert last patch.
+
+Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: updates for new mono_class_vtable() not calling
+ the type constructor anymore.
+
+Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.h, object.c: separate vtable creation from type
+ initialization. Make running the .cctor thread safe.
+
+2003-05-26 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): free string return values.
+
+2003-05-21 Dietmar Maurer <dietmar@ximian.com>
+
+ * loader.c (mono_get_method): consider calling convention
+
+2003-05-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
+ to return the invisible global type for a module.
+
+ * reflection.c (mono_image_build_metadata): Emit global fields too.
+
+2003-05-20 Peter Williams <peterw@ximian.com>
+
+ * loader.c (mono_lookup_internal_call): Add a few newlines.
+
+2003-05-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
+ literal strings.
+
+ * appdomain.c (set_domain_search_path): Recalculate search path when
+ AppDomainSetup.PrivateBinPath changes.
+
+ * object.c (mono_class_compute_gc_descriptor): It turns out some
+ parts of the class libs (like System.Thread) holds pointers to
+ GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
+ to treat native int a pointer type here.
+
+Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h, domain.c: add hashtable for jump target resolution.
+
+2003-05-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h reflection.c icall.c: Added new icalls
+ GetManifestResourceInfoInternal, GetModulesInternal and support
+ infrastructure.
+
+2003-05-16 Dick Porter <dick@ximian.com>
+
+ * icall.c:
+ * file-io.h:
+ * file-io.c: Implement System.IO.MonoIO::GetTempPath
+
+2003-05-14 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * object.c: mono_store_remote_field: little fix to previous patch.
+
+Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: add constructors to array classes.
+ * icall.c: special case array construction for InternalInvoke (),
+
+2003-05-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.h class.c reflection.c object.c: Added support for field
+ defaults in dynamically generated classes.
+
+Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: properly encode charset for ddlimport.
+
+Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * threads.c: allow compiling without GC.
+
+Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h, object.c, object.h, threads.c, threads.h: added
+ handling of thread static data.
+
+Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.h, reflection.c: added mono_custom_attrs_free ().
+
+2003-05-13 Dietmar Maurer <dietmar@ximian.com>
+
+ * class.c (mono_array_class_get): always set the serializable flags
+ (mono_array_class_get): always set the SEALED attribute for array types
+
+2003-05-12 Dietmar Maurer <dietmar@ximian.com>
+
+ * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
+ attributes (fix for bug 42021).
+
+2003-05-12 Dick Porter <dick@ximian.com>
+
+ * gc.c: Don't run finalizers when the finalizer thread is
+ finishing up, because the default domain has already been
+ destroyed.
+
+2003-05-11 Miguel de Icaza <miguel@ximian.com>
+
+ * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
+ value is null, we should throw an exception. This is slightly
+ different than the other conventions used for the constructor.
+
+2003-05-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: fixed windows build.
+
+2003-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: patch by Jerome Laban that fixes bug #42393.
+
+2003-05-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_string_new_wrapper): Compatibility fix for MS
+ compilers.
+
+2003-05-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_class_layout_fields): Add experimental GC aware
+ auto layout facility. Requires class library changes to work correctly.
+
+ (mono_class_setup_vtable): Avoid overriding explicit interface
+ method implementations. Fixes iface3.exe test.
+
+ * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
+ object reference.
+ (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
+ (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
+
+ * metadata.h: Add new type classification macro which determines
+ whenever the type holds an object reference.
+
+2003-05-08 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): cleanups
+
+2003-05-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * gc.c (finalizer_thread): Work around a GC bug.
+
+2003-05-07 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (emit_struct_conv): allow unions
+
+ * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
+
+2003-05-06 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
+
+2003-05-06 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
+
+2003-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c:
+ (Select_internal): allow NULLs, don't create arrays if not needed.
+ Coupled with Socket.cs changes.
+
+ * threadpool.c:
+ (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
+ register a finalizer for it that will close the semaphore handle. This
+ fixes the leak and make Lupus' test run with > 4080 loops.
+
+2003-05-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
+ Jerome Laban (bug #42287)
+
+2003-05-02 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h
+ (MonoSymbolFile): Moved declaration into mono-debug.h.
+ (MonoDebugMethodJitInfo): Likewise.
+ (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
+ argument.
+ (_mono_debug_address_from_il_offset): Take a
+ MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
+
+ * mono-debug.h
+ (MonoDebugDomainData): New struct.
+ (mono_debug_get_domain_data): New function.
+ (mono_debug_add_method): Take an additional `MonoDomain *'
+ argument.
+ (mono_debug_source_location_from_address): Likewise.
+ (mono_debug_il_offset_from_address): Likewise.
+ (mono_debug_address_from_il_offset): Likewise.
+
+Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: one more check for null type in custom attrs.
+
+2003-05-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c: avoid warning (comparison is always false due to limited
+ range of data type).
+
+2003-05-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: throw an exception in Type.GetField if the argument 'name'
+ is NULL.
+
+Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fixed handling of enums in named arguments to custom
+ attributes (bug #42123).
+
+Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: use the right array element type and handle
+ a null for a Type argument, too.
+
+Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: handle arrays as arguments to custom attributes.
+
+Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: handle a string value in a custom attr
+ ctor that takes an object.
+
+2003-04-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
+ (fix bug #42063)
+
+2003-04-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
+
+2003-04-27 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
+ MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
+ MONO_DEBUGGER_EVENT_BREAKPOINT.
+ (mono_breakpoint_trampoline_code): Removed.
+ (mono_debugger_event_handler): The last argument is now a
+ `guint32'.
+ (mono_debugger_insert_breakpoint_full): Removed the
+ `use_trampoline' argument.
+ (mono_debugger_method_has_breakpoint): Likewise.
+ (mono_debugger_trampoline_breakpoint_callback): Renamed to
+ mono_debugger_breakpoint_callback(); take the method and
+ breakpoint number as arguments.
+
+Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c: fix off by one when loading parameters attributes.
+
+2003-04-24 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
+
+2003-04-24 Martin Baulig <martin@ximian.com>
+
+ * mono-debug-debugger.c: Moved all code which interacts with the
+ Mono Debugger here.
+
+ * debug-mono-symfile.c: This code now just deals with the symbol
+ file itself, the debugger code is now in mono-debug-debugger.c.
+
+2003-04-23 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.c (mono_debug_source_location_from_il_offset):
+ New method; like mono_debug_source_location_from_address(), but
+ takes an IL offset instead of a machine address.
+
+2003-04-23 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
+ `line' field; this is now computed by the debugger.
+
+2003-04-23 Martin Baulig <martin@ximian.com>
+
+ * mono-debug.[ch]: New files. This is the new debugging interface.
+
+ * mono-debug-debugger.[ch]: New files. Moved all code which
+ interacts with the Mono Debugger here.
+
+2003-04-22 Dietmar Maurer <dietmar@ximian.com>
+
+ * domain.c (mono_init): initialize mono_defaults.monitor_class
+
+2003-04-21 Miguel de Icaza <miguel@ximian.com>
+
+ * reflection.c (method_encode_code): Add a spicy exception to help
+ future compiler authors.
+
+2003-04-21 Martin Baulig <martin@ximian.com>
+
+ * icall.c
+ (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
+ Make this work with relative pathnames; g_filename_to_uri() needs
+ an absolute filename.
+
+2003-04-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c: Track name changes in Object and ValueType.
+
+2003-04-18 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.c (mono_type_stack_size): size should be a multiple of
+ sizeof (gpointer)
+
+2003-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * gc.c:
+ (internal_domain_finalize): moved into mono_domain_finalize. No need
+ to create another thread because the finalizers will be run in the
+ finalizer thread.
+
+ (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
+ (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
+ to be run (MS does this too).
+
+2003-04-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_class_compute_gc_descriptor): Update comment.
+
+ * loader.h marshal.h marshal.c: Added synchronized method wrappers.
+
+ * image.h: Add synchronized wrapper cache.
+
+ * image.c (do_mono_image_open): Initialize cache.
+
+ * reflection.c (create_dynamic_mono_image): Initialize cache.
+
+2003-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
+ ves_icall_System_Buffer_ByteLengthInternal.
+
+Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: setup klass->nested_in earlier. Allow
+ a dash in the assembly name.
+
+2003-04-15 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.c (mono_type_to_unmanaged): dont access
+ type->data.klass for MONO_TYPE_OBJECT
+ (mono_type_to_unmanaged): consider System.Delegate class
+
+Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: just setup supertypes in the proper place instead of
+ initializing the full element class for arrays.
+
+Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: ensure the element class of arrays is initialized.
+ Setup the supertype info for array classes, too.
+
+2003-04-14 Miguel de Icaza <miguel@ximian.com>
+
+ * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
+
+2003-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: re-added -m option when running cygpath. This way,
+ MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
+ separator.
+ * mono-config.c: same codepath for locating mono config file for WIN32
+ and the rest.
+ * assembly.c: if mono_assembly_setrootdir is called, don't override
+ the value set.
+
+2003-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
+ MONO_ASSEMBLIES variable.
+
+Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: added Assembly::GetNamespaces() icall.
+
+2003-04-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c: fix from Jaak <jaak@zd.com.pl>.
+
+2003-04-10 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
+ * object.c: fixed bug in the construction of vtable for proxies
+
+2003-04-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c (mono_array_new): Mark mono_array_new as an icall.
+
+2003-04-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * class.c: fixed test for public method when overriding interfaces.
+ Closes bug #40970.
+
+Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h, domain.c: added mono_domain_foreach() to
+ be able to access the currently loaded appdomains.
+ * object.c: make string interning work across sppdomains.
+ Mark some functions for use as icalls.
+
+2003-04-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c reflection.c: Fix memory leaks reported by ccmalloc.
+
+ * reflection.h reflection.c: Allocate long living data using
+ GC_MALLOC_ATOMIC so the collector does not need to scan it.
+
+ * reflection.c: Double the allocation size in streams instead of
+ increasing it, to prevent unneccesary copying on large assemblies.
+
+ * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
+ creation if the assembly does not have the Run flag set.
+
+Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.h: avoid the C++ keywords in header files (Jerome Laban
+ spotted and fixed this).
+
+2003-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c:
+ (mono_unhandled_exception): fill in the arguments for the
+ UnhandledException event. Only trigger that event for the default
+ domain (as MS does).
+
+2003-04-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c: Improve typed allocation stuff based on suggestions from
+ Paolo. Also turn it on if the GC library supports it.
+
+2003-04-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.c object.h class.h: Added experimental typed allocation
+ facility using the interfaces in gc_gcj.h.
+
+ * os/gc_wrapper.h: Added new include files.
+
+2003-04-03 Martin Baulig <martin@ximian.com>
+
+ All the following changes are conditional to `WITH_INCLUDED_LIBGC'
+ which is not yet enabled by default.
+
+ * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
+ functions.
+ (mono_gc_lock, mono_gc_unlock): New static functions.
+
+ * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
+ functions; stop/start the world for the garbage collector. This
+ is using the windows API; we need to complete the SuspendThread()/
+ ResumeThread() implementation in the io-layer to make this work on Unix.
+ (mono_gc_push_all_stacks): New public function; tells the garbage
+ collector about the stack pointers from all managed threads.
+
+2003-04-03 Martin Baulig <martin@ximian.com>
+
+ * object.h (MonoThread): Added `gpointer stack_ptr'.
+
+ * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
+
+2003-04-03 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
+
+2003-04-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (typebuilder_setup_fields): Initialize field.first and
+ field.last.
+
+2003-04-02 Miguel de Icaza <miguel@ximian.com>
+
+ * loader.c (mono_lookup_internal_call): Report the corlib that is
+ out of sync.
+
+2003-03-05 Aleksey Demakov <avd@openlinksw.com>
+
+ * icall.c (ves_icall_type_GetTypeCode): fixed check for
+ System.DBNull (it's class not valuetype).
+
+Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: set table_idx in MonoReflectionArrayMethod object even
+ if the array method was already assigned a token (fixes bug#40646).
+
+2003-04-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_get_type): Attempt type resolve even
+ if no assembly is given.
+
+2003-04-01 Miguel de Icaza <miguel@ximian.com>
+
+ * metadata.h: Added the new tables.
+
+ * row-indexes.h: Added definitions for new tables.
+
+ * metadata.c: Add schemas for new tables, and add support for
+ computing the sizes of them.
+
+ * class.c: Update for handling the new type cases.
+
+2003-04-01 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.h (MONO_TYPE_IS_VOID): new macro
+
+2003-03-31 Martin Baulig <martin@ximian.com>
+
+ * threads.h (MonoThreadCallbacks): Added `thread_created'.
+
+ * threads.c (mono_thread_new_init): Call `thread_created' in the
+ mono_thread_callbacks.
+
+2003-03-31 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * loader.h: added marshalbyrefobject_class to mono_defaults
+ * domain.c: added initialization of mono_defaults.marshalbyrefobject_class
+ * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
+ generation of output parameters.
+ ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
+ * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
+ contextbound and the target object belongs to the context of the caller.
+ * object.h: added context and unwrapped_server variables in MonoRealProxy.
+ * object.c: Implemented support for interfaces and abstract classes
+ in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
+ proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
+
+2003-03-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.h class.c (mono_class_is_subclass_of): New function.
+
+ * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
+ routines for most common case (calls from ArrayList::ToArray).
+
+ * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown
+ routine so programs which call Environment::Exit() can be profiled.
+
+ * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
+ Added MONO_ARCH_SAVE_REGS.
+
+ * icall.c (ves_icall_type_is_subtype_of): Use new function.
+
+2003-03-29 Miguel de Icaza <miguel@ximian.com>
+
+ * blob.h: Add a couple of new MonoType types definitions.
+
+ * tabledefs.h: Add a couple of new call convs.
+
+2003-03-27 Zoltan Varga <vargaz@freemail.h>
+
+ * reflection.h (MonoReflectionDynamicAssembly): track changes in
+ the layout of the class.
+
+ * reflection.c (alloc_table): double the size on overflow to avoid
+ unnecessary copying.
+
+ * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
+ avoid filling out metadata tables and blobs. Also set mb->ilgen to
+ null so it can be garbage collected.
+
+2003-03-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_get_type): Return the resolved type
+ only if it is in the assembly we searched.
+
+ * reflection.c (ensure_runtime_vtable): Initialize method slots.
+
+ * class.c (mono_class_setup_vtable): Set the slot of the overriding
+ method.
+
+2003-03-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c:
+ (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
+ the right one is 'file:///blah', but MS allows it.
+ * assembly.c:
+ (mono_assembly_open): allow 'file://blah'
+
+ Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
+
+2003-03-26 Aleksey Demakov <avd@openlinksw.com>
+
+ * socket-io.c: fixes bug #40310.
+
+2003-03-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_parse_type): handle deeply nested
+ types correctly.
+
+ * reflection.c (mono_image_create_token): Use unique token values
+ since they will be put into a hash table.
+
+ * class.c (mono_class_setup_vtable): If a method occurs in more than
+ one place in the vtable, and it gets overriden, then change the
+ other occurances too.
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Added support for
+ object as return type.
+
+2003-03-22 Pedro Mart�nez Juli� <yoros@wanadoo.es>
+
+ * icall.c: Deleted "ToString" implementation for double and float
+ because they are full implemented in managed code.
+
+Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c, reflection.h: implemented and exported functions
+ to retrieve info about custom attributes.
+
+2003-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: moved Uri handling to assembly.c
+ * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
+ work when using a file Uri in *nix and windows.
+
+ * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
+ GetReferencedAssemblies.
+
+2003-03-18 Dick Porter <dick@ximian.com>
+
+ * icall.c: Rename a couple of internal calls
+
+ * threads.c: Set the thread state to Stopped when a thread exits.
+ Fixes bug 39377.
+
+2003-03-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
+ New icall.
+
+ * object.c (mono_class_vtable): fix warning.
+
+2003-03-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
+
+ * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
+ memory.
+ (method_encode_clauses): Create exception info structures in the right
+ order.
+ (mono_reflection_setup_internal_class): Initialize supertypes field.
+
+ * class.c object.c: Handle interfaces which implement other interfaces
+ correctly.
+
+ * class.h class.c: Move the supertypes array initialization code into
+ a separate function so it can be used for dynamic types too. Also call
+ it earlier, in mono_class_init(), since it can be used before the
+ type is initialized.
+
+2003-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am:
+ * assembly.c:
+ * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
+
+ * appdomain.c:
+ * appdomain.h:
+ * marshal.c:
+ * object.c: remove warnings.
+
+2003-03-13 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
+ (MonoDebugLexicalBlockEntry): New types.
+
+ * debug-mono-symfile.c
+ (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
+
+2003-03-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * process.c: ret can be any non-zero value accroding to MS doc.
+
+2003-03-07 Miguel de Icaza <miguel@ximian.com>
+
+ * class.c (mono_marshal_load_type_info): Fix buglet: Noticed when
+ fixing a warning for a miss-used prototype, would have cause
+ random memory corruption.
+
+2003-03-07 Martin Baulig <martin@ximian.com>
+
+ * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
+ getting really annoying ....
+
+2003-03-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (fixup_method): added support for array methods.
+
+Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * socket-io.c: handle case when AF_INET6 and AF_IPX are not defined
+ (pointed out by Michael Adams).
+
+2003-03-04 Dick Porter <dick@ximian.com>
+
+ * icall.c: Temporarily reverted the Double and Single ToString()
+ change, because it broke nunit.
+
+Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.h, threads.h: make include files compatible with C++
+ (patch by Jerome Laban <jlaban@wanadoo.fr>).
+
+2003-03-04 Pedro Mart�nez Juli� <yoros@wanadoo.es>
+
+ * icall.c: Erased ToString helper functions for Double and Single.
+ Now, that implementations ar all in managed code (Double and Single
+ Formatters).
+
+2003-03-03 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * appdomain.c: Added method for initializing the default context of
+ a domain. Added internal call for getting the default context.
+ * appdomain.h: Added context variable in MonoDomain struct.
+ * domain.c: mono_domain_set also sets the default context of the domain
+ * icall.c: Mapped internal method InternalGetDefaultContext.
+ * object.c: mono_object_get_virtual_method returns always a remoting
+ wrapper if the object is a transparent proxy.
+ mono_runtime_invoke_array: when creating an object by calling the
+ constructor, if the created object is a proxy, then the constructor should
+ be called using the a remoting wrapper.
+
+2003-03-03 Dick Porter <dick@ximian.com>
+
+ * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
+ variable so it compiles on solaris. Problem spotted by
+ Christopher Taylor <ct@cs.clemson.edu>
+
+2003-03-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c:
+ (get_info_from_assembly_name): don't leak value.
+
+ * icall.c:
+ (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
+ result.
+
+Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * assembly.c: export mono_image_load_references ().
+ * class.c: handle function pointers. mono_class_from_name() now
+ supports nested type names directly.
+
+2003-02-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.h reflection.c: Encode already created dynamic methods
+ and fields correctly as a DEF instead of a REF.
+
+ * reflection.c: Get rid of the force_ref argument to
+ mono_image_typedef_or_ref since it was wrong in the first place.
+
+ * string-icalls.c: add error checking to string constructors according
+ to the MSDN docs.
+
+ * reflection.c: Emit types in the order their TypeBuilders were
+ created. Previously, a new table index was assigned to each type before
+ the tables were emitted. This was wrong because the signature blob
+ might already refer to a type by its original table index.
+
+2003-02-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
+ change.
+
+2003-02-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: make assemblies dir have \ instead of / on windows.
+
+2003-02-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
+ iterate over the NESTEDCLASS table using a linear search since the
+ table is not guaranteed to be sorted by the secondary key.
+
+ * class.c (mono_class_create_from_typedef): fixed up call to
+ mono_metadata_nesting_typedef.
+
+2003-02-27 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_string_to_byvalstr): clear the memory as
+ suggested by Jerome Laban <jlaban@wanadoo.fr>
+
+2003-02-26 Dick Porter <dick@ximian.com>
+
+ * process.c: Cope with padding in .rsrc blocks
+
+2003-02-26 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.h: reverted the filter_len change, it breaks reflection
+
+2003-02-26 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.h: added a new field to store the filter_len
+
+
+Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: handle custom attributes for types and members
+ created with Reflection.Emit (bug#38422).
+
+2003-02-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c: define RTSpecialName automatically for constructors for
+ compatibility with MS.NET.
+
+ * reflection.c (mono_reflection_create_runtime_class): initialize
+ nested_in field of dynamically created classes.
+
+2003-02-22 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h: Incremented version number.
+
+2003-02-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * object.h icall.c process.c: fix warnings.
+
+2003-02-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.h appdomain.c:
+ (mono_domain_try_type_resolve): split the
+ name_or_tb argument into a name and a tb argument.
+ (mono_domain_has_type_resolve): new function to check whenever the
+ application has registered a TypeResolve event handler.
+
+ * icall.c reflection.h reflection.c: move the type resolve logic into
+ mono_reflection_get_type () so it will be invoked when
+ Assembly::GetType () is called.
+
+ * reflection.c:
+ (mono_reflection_get_type): renamed to get_type_internal.
+ (mono_reflection_get_type): fixed type name generation so it works
+ for nested types too.
+ (mono_reflection_get_type): call has_type_resolve () to avoid the
+ costly type name generation if there is no resolve event handler.
+
+Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, image.c: load exported types from file references.
+
+2003-02-19 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
+ used to cache the managed methods used to create proxies and make
+ remote invocation of methods.
+ * class.h: Added in MonoVTable a flag to indicate that a class needs
+ to be remotely created.
+ * object.c: Modified the method mono_class_vtable(). It now initializes
+ the remote flag of the vtable. Modified mono_object_new_specific(),
+ so now it checks the remote flag.
+ * icall.c: Added a couple of internal methods, one for enabling instance
+ creation interception for a type, and one for creating objects bypassing
+ the remote check.
+
+2003-02-18 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
+ New interncall to get a method's metadata token.
+
+ * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
+ New interncall for the debugger.
+
+2003-02-18 Dietmar Maurer <dietmar@ximian.com>
+
+ * class.c (mono_class_setup_vtable): allocate supertype array
+
+2003-02-18 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
+
+2003-02-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c:
+ (assembly_name_to_aname): jump over unknown properties (i've found
+ something like: 'type, assembly, version=xxx, custom=null, public...',
+ so now will ignore custom=null and still get the rest of the values).
+
+2003-02-17 Dick Porter <dick@ximian.com>
+
+ * threads.c: Have Thread.Start() wait for a semaphore to signal
+ that the thread has set up all its local data. This fixes bug
+ 34323, where Abort() raced the new thread's TLS data.
+
+ Also removes the handle_store() call from start_wrapper, because
+ threads are now always created suspended and there is no longer a
+ race between the parent and child threads to store the info.
+
+Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * image.c: explain the #- heap issue in a message, hopefully
+ avoiding FAQs on mono-list.
+
+2003-02-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c:
+ (GetEntryAssembly): if the domain has not invoked
+ AppDomain.ExecuteAssembly yet, return the assembly of the default
+ AppDomain.
+
+2003-02-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_ldtoken): make it work in dynamic assemblies.
+
+Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c, reflection.c: simple speedup to type hash
+ and equals code.
+
+Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * image.c, image.h, class.c, assembly.c: move module loading
+ to MonoImage. When loading metadata, consider alignemnet from
+ the start of metadata, not from the metadata address in memory.
+
+2003-02-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_get_custom_attrs): Added support for
+ AssemblyBuilder objects. Factored out custom attribute creation into
+ a separate function.
+ (create_custom_attr): new function to create custom attributes.
+
+2003-02-12 Miguel de Icaza <miguel@ximian.com>
+
+ * Makefile.am: Got tired of typing the full pathname to pedump.
+ Until there is another option, am installing this.
+
+2003-02-12 Dietmar Maurer <dietmar@ximian.com>
+
+ * class.c (class_compute_field_layout): always set field->parent
+ (mono_ldtoken): use mono_defaults.fieldhandle_class;
+
+2003-02-11 Dick Porter <dick@ximian.com>
+
+ * threads-types.h:
+ * monitor.c: Rewrote Monitor, making lock much faster and
+ Pulse/Wait work as specified. Also uses much fewer handles, and only
+ creates them as needed.
+
+ * exception.c: Added SynchronizationLockException
+
+ * threads.c: Deleted old Monitor implementation. The new one is
+ in a new file.
+
+Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: handled TypedReference type code. Set the correct size for
+ class data. Setup interface_offsets for interface classes, too.
+
+2003-02-09 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h: Reflect latest symbol writer changes.
+
+Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
+ * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
+ * object.c: fixed mono_object_get_virtual_method () for interfaces.
+ * verify.c: check for code that runs after the end of the method.
+
+2003-02-08 Pedro Mart�nez Juli� <yoros@wanadoo.es>
+
+ * icall.c: Added "System.Math::Floor", "System.Math::Round" and
+ "System.Math::Round2".
+ * sysmath.h: Added Floor, Round and Round2 definitions.
+ * sysmath.c: Modified certain functions that were not 100% compliant
+ with MS.NET (math precision) and added the implementation of Floor,
+ Round and Round2.
+
+2003-02-07 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
+
+2003-02-07 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c: Reflected latest symwriter changes.
+ (mono_debug_create_mono_symbol_file): Removed.
+ (mono_debug_open_mono_symbol_file): Take an argument which
+ specifies whether to create a dynamic symbol file.
+
+2003-02-07 Dietmar Maurer <dietmar@ximian.com>
+
+ * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
+
+2003-02-05 Martin Baulig <martin@ximian.com>
+
+ * reflection.c (mono_image_build_metadata): Make this public,
+ protect it against being called multiple times, don't create
+ resources and don't build the compressed metadata here.
+ (mono_image_create_pefile): Do this here.
+
+ * icall.c
+ ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
+
+2003-02-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: fixed bug #36322.
+
+2003-02-06 Piers Haken <piersh@friskit.com>
+
+ * appdomain.[ch]:
+ * class.h:
+ * debug-mono-symfile.c:
+ * icall.c:
+ * loader.c:
+ * mono-config.c:
+ * monosn.c:
+ * reflection.c:
+ * socket-io.c: warning cleanups
+
+2003-02-06 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
+ function. works like remoting invoke, but does a check for the Proxy first.
+
+2003-02-05 Miguel de Icaza <miguel@ximian.com>
+
+ * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
+
+2003-02-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): only allocate an
+ array of pointers.
+ (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
+ (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
+
+ * object.c (mono_store_remote_field_new): used by the new jit
+ instead of mono_store_remote_field
+ (mono_load_remote_field_new): used by the new jit
+ instead of mono_load_remote_field
+
+2003-02-05 Patrik Torstensson
+
+ * appdomain.c: changed unload to take the domain id instead
+ of domain
+
+ * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
+
+
+2003-02-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: don't look for assemblies in ApplicationBase if
+ PrivateBinPathProbe is set.
+
+2003-02-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c: make the first argument in main_args contain the absolute
+ path to the assembly. Fixes bug #37511.
+
+2003-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: get correct UTC offset for countries not using daylight
+ time saving. Fixes bug #30030.
+
+2003-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
+ and 1 are the family).
+
+2003-02-04 Dietmar Maurer <dietmar@ximian.com>
+
+ * icall.c (ves_icall_InternalExecute): removed wrong assertion
+
+ * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
+
+2003-02-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c: added support for SignatureHelper tokens, which is
+ needed by the Calli opcode.
+
+ * reflection.h: track changes to SignatureHelper class.
+
+ * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
+
+2003-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: fixed loading assemblies from PrivateBinPath.
+
+2003-02-03 Patrik Torstensson
+ * appdomain.[c|h], domain.c :
+ - Added support for getting a domain via domain id
+ - Support for setting and getting domain from System.AppDomain
+ (used in cross appdomain channel)
+ - Added support for get/set for a MonoAppContext on a thread
+ (Context class in System.Runtime.Remoting.Contexts),
+ - Removed hack in Get/SetData and ExecuteAssembly.
+
+ * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
+ the managed world to get control when a proxy is created.
+
+ * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
+
+2003-02-03 Miguel de Icaza <miguel@ximian.com>
+
+ * icall.c
+ (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
+ Populate the codebase field as well.
+
+2003-02-02 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c
+ (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
+ (mono_debug_symfile_add_method): Allow interncalls.
+
+2003-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: throw parse exception if strtod fails or the string is empty.
+
+Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: handle object type separately from defined
+ class types.
+
+Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: handle NATIVE_LPSTR for strings when it's
+ explicitly specified.
+
+Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c, reflection.h, icall.c: setup the reflection
+ handle cache for ModuleBuilders and AssemblyBuilders.
+
+2003-01-30 Dietmar Maurer <dietmar@ximian.com>
+
+ * reflection.c (reflection_methodbuilder_to_mono_method): set
+ pinvoke flag
+
+2003-01-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
+
+2003-01-29 Dick Porter <dick@ximian.com>
+
+ * threads.c: No need for the fake_thread kludge now that Thread
+ doesn't run a class constructor
+
+2003-01-29 Dick Porter <dick@ximian.com>
+
+ * threads.c: Use g_direct_hash instead of the rather bogus
+ g_int_hash
+
+2003-01-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): add check for null
+ (fix pinvoke12.exe)
+ (mono_marshal_get_struct_to_ptr): generate valid IL code
+ (mono_marshal_get_ptr_to_struct): generate valid IL code
+ (*): correctly set sig->pinvoke, we need to memdup the signature
+ to do that
+
+Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
+ to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
+
+Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * profiler.c: provide more callers information.
+
+2003-01-28 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
+
+ * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
+
+ * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
+
+2003-01-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
+ exception instead of going into an infinite loop on dates which it
+ can't yet handle.
+
+ * string-icalls.c (ves_icall_System_String_get_Chars): raise
+ out-of-range exception if needed.
+
+ * class.c (mono_class_setup_vtable): allow a virtual method to provide
+ an implementation for an interface method and to override an inherited
+ method at the same time.
+ Imagine a scenario when a virtual method is used to override a
+ virtual abstract method in a parent class, and this same method
+ provides an implementation for an method inherited from an interface.
+ In this case, the interface resolution code will set im->slot, which
+ means that the virtual method override pass will skip this method
+ which means a pointer to the abstract method inherited from the parent
+ will remain in the vtable of this non-abstract class.
+
+ * class.c: (mono_class_setup_vtable): continue search for a real
+ method if only an abstract method is found.
+
+Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: add size to encoding for ByValStr and ByValArray
+ marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
+
+2003-01-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * class.c (mono_class_setup_vtable): pass the override info as an
+ argument.
+
+ * class.c (mono_class_setup_vtable): set the slot of overriding methods
+ correctly.
+
+ * reflection.c (ensure_runtime_vtable); add support for method
+ overrides.
+
+2003-01-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (resolution_scope_from_image): Hack to work to work with
+ dynamic assemblies.
+
+ * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and
+ added a 'force_ref' argument to force this function to allways return
+ a TypeRef. This is needed by mono_image_get_memberref_token ().
+
+2003-01-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_image_get_type_info): interfaces really don't have
+ a parent.
+
+ * reflection.c (mono_image_basic_init): fill out missing fields of
+ image structure.
+
+ * reflection.c (mono_image_basic_init): Invoke assembly load hooks for
+ dynamic assemblies. This is required so dynamic assemblies show up in
+ AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
+ Type::GetType() etc. This is consistent with MS behaviour.
+
+ * image.c image.h reflection.c: add newly created classes to the name
+ cache so mono_class_get () will find them.
+
+2003-01-27 Zoltan Varga <vargaz@freemail.hu>
+
+ First part of changes to get IKVM.NET running under mono.
+
+ * appdomain.h, appdomain.c: added new function
+ mono_domain_try_type_resolve() which will emit TypeResolve events.
+ This function will call AppDomain::DoTypeResolve to do the actual work.
+
+ * class.h, class.c, loader.c, object.c, reflection.h, reflection.c:
+ moved existing code dealing with dynamic tokens to a new function
+ called mono_reflection_lookup_dynamic_token (). This function will
+ raise TypeResolve events when appropriate. Since reflection.c is not
+ part of libmetadata, a new hook function called
+ mono_lookup_dynamic_token() is added to class.c which will call this.
+
+ * assembly.h assembly.c: make the invoke_load_hook function public,
+ so it can be called for dynamic assemblies.
+
+ * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
+
+ * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the
+ type isn't found.
+
+ * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a
+ MonoGHashTable, since it contains pointers to objects which the GC
+ needs to track.
+
+ * assembly.c (search_loaded): remove unused variable.
+
+Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: fixed issue exposed by gcc-generated IL programs
+ that use RVA data for pointers.
+
+2003-01-25 Martin Baulig <martin@ximian.com>
+
+ * threads.c (start_wrapper): Moved the initialization of
+ `start_func' above the mono_new_thread_init() call to which we
+ pass it as argument.
+
+2003-01-24 Martin Baulig <martin@ximian.com>
+
+ * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
+ the MonoThread pointer.
+
+2003-01-21 Miguel de Icaza <miguel@ximian.com>
+
+ * icall.c: Rename `PowImpl' to Pow.
+
+2003-01-23 Dick Porter <dick@ximian.com>
+
+ * threads.c (start_wrapper): Create a Thread object if needed, so
+ the Main() thread can do the class initialisation in a subthread
+ that has been set up to allow managed code execution.
+
+ Pass the thread ID instead of the MonoThread pointer to the thread
+ start and attach callbacks. This change is required, because the
+ jit thread start callback must be called _before_ the Thread
+ object can be created.
+
+ (mono_thread_init): Removed much object creation code that is no
+ longer needed. No managed code is called from here now.
+
+ * object.c (mono_runtime_exec_managed_code): Create a subthread
+ for Main, and call back to the runtime to use it.
+ Set the exit code when Main exits.
+
+ * gc.c: Make sure domain finalisation happens in a subthread.
+ Re-enable threaded GC, fixing bug 31333 (again).
+
+ * environment.c: System.Environment internall calls (so far just
+ ExitCode is here, the others are still in icall.c)
+
+ * appdomain.c (mono_runtime_cleanup): All threads running managed
+ code should have finished before mono_runtime_cleanup() is
+ reached, so no need to clean up threads.
+
+2003-01-22 Martin Baulig <martin@ximian.com>
+
+ * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
+ `gpointer func' arguments.
+ (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
+ but added `MonoThread *thread' argument.
+ (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
+
+ * threads.c (mono_new_thread_init): Added `gpointer func' argument
+ and pass it to the mono_thread_start_cb callback.
+ (mono_install_thread_callbacks): New public function to install a
+ set of callbacks which are set by the debugger.
+ (mono_thread_init): The last argument is now a MonoThreadAttachCB.
+
+2003-01-22 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am: Install debug-mono-symfile.h.
+
+2003-01-21 Aleksey Demakov <avd@openlinksw.com>
+
+ * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
+
+2003-01-21 Dietmar Maurer <dietmar@ximian.com>
+
+ * added the following fix from Jackson Harper <jackson@latitudegeo.com>
+ * class.c (mono_ptr_class_get): correctly set access levels of pointers
+ (mono_array_class_get): correctly set access levels of arrays
+
+2003-01-20 Patrik Torstensson
+ * image.h (MonoAssemblyName): changed major, minor, build, revision
+ from signed to unsigned.
+
+2003-01-20 sean kasun <skasun@azstarnet.com>
+
+ * reflection.c (load_cattr_value): Now this handles
+ MONO_TYPE_SZARRAY. Fixes bug #35629
+
+2003-01-20 Miguel de Icaza <miguel@ximian.com>
+
+ * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
+ integer value
+
+2003-01-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * decimal.c: fixed bug #26056.
+
+2003-01-17 Martin Baulig <martin@ximian.com>
+
+ * gc.c: Raise an ExecutionEngineException instead of using g_error().
+
+2003-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * exception.[ch]:
+ (mono_get_exception_type_initialization): new function.
+
+ * object.c: throw a TypeInitializationException when an exception is
+ thrown invoking the class constructor.
+
+2003-01-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c: fixed attribute reading.
+
+2003-01-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c:
+ (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
+ provided, look for the type in the calling assembly and then in
+ mscorlib; if the assembly name is provided, only try that one.
+
+Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: register the vtable before there is a chance it's
+ queried again recursively.
+
+2003-01-13 Duncan Mak <duncan@ximian.com>
+
+ * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
+ gc-internal.h.
+
+2003-01-12 Patrik Torstensson <totte@race-x-change.com>
+
+ * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
+
+2003-01-11 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
+ this to 20 for the release.
+
+2003-01-10 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
+
+ * loader.c (mono_method_get_marshal_info): bug fix
+
+ * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
+ structures with explicit layout
+
+Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * profiler.c: made the output more readable (and sorted).
+ Added caller information for the allocation profiler.
+
+2003-01-09 Sebastien Pouliot <spouliot@videotron.ca>
+
+ * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
+
+2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
+ to get value types.
+
+Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * object.c, profiler.h, profiler.c, profiler-private.h:
+ Added object allocation profiler.
+
+Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.h, reflection.c: handle global methods.
+ Compress blob entries.
+
+Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: fix compilation.
+
+2003-01-09 Dietmar Maurer <dietmar@ximian.com>
+
+ * loader.c (mono_method_get_marshal_info): impl.
+
+ * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
+
+2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
+ for reference types.
+
+Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * loader.c: fixed off by one error in loaded parameter names.
+
+2003-01-08 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_icall_wrapper): like
+ mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
+ instead of a MonoMethod.
+
+2003-01-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * decimal.c: fixed bug #36537.
+
+Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: throw a missing method exception if a
+ P/Invoke method is not found.
+
+Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: allow a null this for constructors.
+
+Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: raise the proper exceptions if the arguments to the
+ internal Invoke are incorrect.
+
+2003-01-03 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
+
+2003-01-03 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
+
+2002-12-31 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.c: Completely rewrote the type section.
+ Instead of using individual malloc()ed fields, we use one big
+ continuous memory area and offsets into this area.
+ See the comments in the source code for details.
+
+2002-12-30 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
+
+2002-12-30 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
+ line number table in this data blob instead of using an external
+ pointer.
+
+2002-12-28 Martin Baulig <martin@ximian.com>
+
+ * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
+
+2002-12-22 Rachel Hestilow <hestilow@ximian.com>
+
+ * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
+ as a boxed return type.
+
+2002-12-21 Miguel de Icaza <miguel@ximian.com>
+
+ * appdomain.c
+ (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
+ g_build_filename to properly get separators on the filename created.
+
+ * object.h: Small change, introduce MonoMarshalByRefObject to
+ track the layout of that structure in the C# universe as we make
+ changes there.
+
+Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: removed assert to allow static fields on interfaces.
+ * loader.c: a TypeSpec may be used for any type, not just arrays.
+
+Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, class.h: added mono_class_array_element_size ().
+ Ignore static methods in interfaces.
+
+2002-12-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * threads.c: fixed the build under cygwin.
+
+Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: handle nullref constants. Allocate keys for
+ reflection handles with the GC.
+
+Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * threads.c, threads.h: added mono_thread_get_abort_signal()
+ to get a suitable signal for thread abort.
+
+Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c: fix handling of ExportedType table.
+
+2002-12-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added WriteWindowsDebugString internal call.
+
+2002-12-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.h: added fields to match C# implementation.
+
+2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
+
+2002-12-12 Juli Mallett <jmallett@FreeBSD.org>
+
+ * gc.h, gc-internal.h: Rename header for GC internal calls to
+ gc-internal.h from gc.h as to not clash with Boehm GC having its
+ header installed as <gc.h> in outside include paths.
+ * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
+ * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
+
+2002-12-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: assign minor, build and revision in FillName.
+
+2002-12-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * image.h reflection.h reflection.c class.h class.c loader.c object.c:
+ Added support for running code generated by Reflection.Emit.
+
+2002-12-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: check for NULL argument in LoadFrom.
+
+2002-12-10 Dick Porter <dick@ximian.com>
+
+ * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
+
+2002-12-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: fix buglet when building exe file name. Handle full
+ assembly name (needed after latest changes to AssemblyName).
+ * image.c:
+ (mono_image_close): free some hashtables.
+
+2002-12-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN
+ instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation
+ on some systems (redhat 7.3)
+
+Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * threads.c: delete the critical section of a sync block,
+ spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
+
+Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
+
+2002-12-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.[ch]: handle the assembly preload event to try loading the
+ assemblies using the paths we have in the current domain.
+
+ * assembly.[ch]: created an assembly preload hook that is called to try
+ loading the assembly by other means that the ones provided here.
+
+ * domain.c: initialize the domain search path.
+
+ From now on, assemblies (TODO: except corlib and System) are loaded
+ according to these rules when using mono_assembly_load ():
+
+ 1. It tries to load the assembly from the ApplicationBase
+ of the current domain appending .dll and .exe (TODO: have to
+ try loading from name/name.dll and name/name.exe).
+
+ 2. It tries the search path specified in PrivateBinPath for the
+ current domain (if any).
+
+ 3. Previous behavior.
+
+Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: implemented GetInterfaceMap() related icall.
+ * domain.c, loader.h: load MethodInfo in mono_defaults.
+
+Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: disable the finalizer thread for now, untill all the issues
+ with it are resolved.
+
+Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * string-icalls.c: handle embedded nulls in string ctor when the
+ length is specified.
+
+Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: look for explicit interface implementation in parent
+ classes, too.
+
+2002-12-03 Dietmar Maurer <dietmar@ximian.com>
+
+ * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3)
+
+Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: protect handles with a critical section.
+
+2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c:
+ (ves_icall_type_from_name): it now has throwOnError and ignoreCase
+ parameters. If no assembly specified, try getting the type from all
+ the assemblies in the current domain, else, load the assembly and get
+ the type from it.
+
+2002-11-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * marshal.c: applied patch from Aleksey Demakov that fixes
+ ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
+
+2002-11-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: fixed get_location.
+
+2002-11-28 Dietmar Maurer <dietmar@ximian.com>
+
+ * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
+ declarations to make it work with older gcc.
+
+ * loader.c (mono_get_method): set signature->pinvoke for native calls
+
+2002-11-20 Dick Porter <dick@ximian.com>
+
+ * threads.c (mono_thread_init): Set the main thread's handle
+
+Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: allow compilation without GC support. Changed to match the
+ mono coding style.
+
+Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
+
+Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: set a public key token on the core assemblies.
+
+2002-11-18 Dick Porter <dick@ximian.com>
+
+ * threads.c: Split out some thread initialisation so that other
+ files can set the start callback function.
+
+ * gc.c: Run finalisers in a separate thread, to avoid stack
+ overflow. Fixes bug 31333.
+
+ * appdomain.c: Set up GC finalisation thread.
+
+ * reflection.c:
+ * object.c:
+ * domain.c: Use gc.h macros for GC_malloc
+
+2002-11-15 Dick Porter <dick@ximian.com>
+
+ * threadpool.c:
+ * threads.c:
+ * appdomain.c: Removed mono_runtime_init_with_attach(),
+ mono_thread_create_arg(), and mono_thread_init_with_attach(), by
+ merging the extra parameter with the existing function. Removed
+ unneeded code in mono_thread_attach().
+
+2002-11-14 Dietmar Maurer <dietmar@ximian.com>
+
+ * image.c (mono_image_loaded_by_guid): a method to get loaded
+ images by guid.
+ (load_metadata_ptrs): we store the guid as string.
+
+2002-11-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
+
+ * metadata.c (mono_guid_to_string): imported method form Zoltan
+ Varga (slightly modified)
+
+ * assembly.c (mono_assembly_open): load precompiled code
+
+ * loader.h (MonoMethod): we store the method token for use in the
+ aot compiler.
+
+2002-11-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: insert the loaded assemblies in the domain->assemblies in
+ the hook function called when an assembly is loaded.
+
+ * domain.c: Modified file.
+ (mono_domain_assembly_load): removed hash table insertion of assemblies.
+
+ Fixes bug #33196.
+
+2002-11-07 Miguel de Icaza <miguel@ximian.com>
+
+ * reflection.c: Map PEFileKind to the value expected by the WinNT
+ image loader.
+
+2002-11-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * rand.c: use /dev/urandom. If it fails to open, use the previous one.
+ Read until the buffer is filled completely.
+
+2002-11-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: implemented MonoType.InternalGetEvent ().
+
+2002-11-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: implemented InitAppDomainSetup. Delayed
+ AppDomain.SetupInformation until mono_runtime_exec_main, where we get
+ the entry_assembly.
+
+ * assembly.c: base_dir is now an absolute path ending with
+ G_DIR_SEPARATOR.
+
+ * icall.c: modified get_location according to the above changes.
+
+ * object.c: init AppDomain.SetupInformation for the default domain after
+ we have the entry assembly.
+
+ * domain.c: when unloading a domain, setup = NULL.
+
+2002-11-04 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
+
+Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.h, object.c: introduced mono_object_get_virtual_method ()
+ to lookup the method invoked on an object when a callvirt is done on
+ a method.
+ * icall.c: make MethodInfo::Invoke() always do a virtual call.
+
+2002-11-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
+ current domain when loaded an assembly and failed to load it.
+
+ * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
+
+2002-10-31 Dick Porter <dick@ximian.com>
+
+ * icall.c:
+ * file-io.h:
+ * file-io.c: Return the error status in a parameter, as the
+ GetLastError() value has long since been blown away if we try and
+ look it up in a subsequent internal call invocation. Delete the
+ GetLastError() internal call, because it's useless.
+
+2002-10-31 Dietmar Maurer <dietmar@ximian.com>
+
+ * class.[ch]: added cast_class to fix bug 29517
+
+Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: create valid IL code in the filter clause:
+ the new JIT is less forgiving:-)
+
+2002-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: removed get_property internal call.
+
+2002-10-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain.h domain.c: Added an ID to appdomains.
+
+ * threads.c threads.h icall.c: Implement icall
+ Thread:GetDomainID(), and remove unused icall
+ CurrentThreadDomain_internal.
+
+2002-10-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: Don't recurse through the base types in GetConstructor.
+ Fixes bug #32063.
+
+Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * mempool.h, mempool.c: added mono_mempool_empty() and
+ mono_mempool_stats().
+
+2002-10-23 Dick Porter <dick@ximian.com>
+
+ * file-io.c:
+ * file-io.h:
+ * icall.c: Added MonoIO.GetFileType internal call
+
+2002-10-17 Dick Porter <dick@ximian.com>
+
+ * appdomain.c (mono_runtime_cleanup): Don't signal the async
+ delegate semaphore before waiting for all threads to finish,
+ because new threads can also call async delegates. Fixes bug
+ 32004.
+
+ * threadpool.c (async_invoke_thread): Only wait for 500ms instead
+ of 3 seconds, in case another async job is queued. (This part is
+ needed because the bug fix reintroduced the 3s exit lag.) This
+ makes the mono_runtime_shutdown flag superfluous.
+
+Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: include ehader size in method section headers.
+ Really check for suplicated modules entries.
+
+2002-10-17 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Added back support for locals.
+
+2002-10-14 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
+ MONO_TYPE_VOID.
+
+2002-10-14 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
+ mono_class_get() instead of looking in the class cache.
+
+2002-10-13 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Set version number to 28, include the
+ signature in method names.
+
+2002-10-13 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.h: Set version number to 27.
+
+2002-10-11 Martin Baulig <martin@gnome.org>
+
+ * gc.c: Don't register/unregister NULL pointers as disappearing links.
+
+Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c, metadata.h: added helper function to allocate signatures.
+
+2002-10-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added internal call to get the location of machine.config.
+
+2002-10-08 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Ignore classes with a pending init for the
+ moment.
+
+2002-10-03 Dick Porter <dick@ximian.com>
+
+ * threads.c: Freebsd pthread_t is a pointer
+
+2002-10-03 Dick Porter <dick@ximian.com>
+
+ * socket-io.c: Implemented GetHostName_internal
+
+2002-10-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mono-config.c:
+ (mono_config_parse_file): don't leak the text.
+
+2002-10-02 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Added support for methods.
+
+2002-10-01 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Don't emit methods and line numbers for
+ the dynamic symbol file, just write the type table. We can easily
+ have an external helper program which creates a symbol file for an
+ IL file.
+
+2002-10-01 Dick Porter <dick@ximian.com>
+
+ * threads.c (ves_icall_System_Threading_Thread_Start_internal):
+ Only add the handle to the cleanup array when we're about to
+ launch the thread. Bug 31425 deadlocked when the test was run on
+ mono under w32.
+
+2002-10-01 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Added support for properties.
+
+Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: unaligned store fix from Mark Crichton
+ <crichton@gimp.org>.
+
+2002-09-27 Martin Baulig <martin@gnome.org>
+
+ * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
+ New interncall.
+
+Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * assembly.h, assembly.c: use a sane API to hook into the assembly
+ loading process instead of a useless special-purpouse hack
+ (ngen needs a hook, too, for example).
+
+2002-09-27 Dick Porter <dick@ximian.com>
+
+ * threads.c (mono_thread_init): Call GetCurrentProcess() so
+ io-layer can set up some process handle info. Not needed on w32,
+ but doesn't hurt either.
+
+ * process.c: Pass the program name in the second parameter to
+ CreateProcess, so the path is searched. Include the working
+ directory. Implemented process name, process enumeration, and some
+ process detail internal calls.
+
+ * icall.c: Added internal calls for process lookup, and some
+ process details
+
+2002-09-26 Martin Baulig <martin@gnome.org>
+
+ * assembly.c (mono_install_open_assembly_hook): New global
+ function to install a function to be invoked each time a new
+ assembly is loaded.
+ (mono_assembly_open): Run this callback function if set.
+
+ * debug-mono-symfile.c: Put back line numbers for the dynamic
+ symbol file and also record the .il file as source file. This
+ allows us to install the temporary symbol file as `file.dbg' just
+ like a compiler-generated one.
+
+2002-09-26 Nick Zigarovich <nick@chemlab.org>
+
+ * Corrected typo in gc.c (BOHEM vs BOEHM).
+
+2002-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
+ GetProperties. Also avoid calling g_slist_length in GetProperties and
+ GetMethods.
+
+Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: avoid unaligned stores (bug spotted by
+ Mark Crichton <crichton@gimp.org>).
+
+2002-09-25 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
+ instead of guint64 for addresses and added prologue/epilogue info.
+
+2002-09-25 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
+ store line number info. For the dynamic symbol file, we only need
+ to provide the JIT generated dynamic line number info for the dynamic
+ symbol file.
+
+2002-09-25 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.h: Incremented version number.
+
+2002-09-24 Martin Baulig <martin@gnome.org>
+
+ * class.c (mono_debugger_class_init_func): New global function
+ pointer variable.
+ (mono_class_init): If mono_debugger_class_init_func is non-NULL,
+ call it.
+
+ * debug-mono-symfile.c (mono_debug_symfile_add_type): New
+ function. This is called via the mono_debugger_class_init_func
+ hook to add all types to the dynamic type table.
+ (ves_icall_MonoDebugger_GetType): New interncall to get a class
+ from its metadata token.
+
+ * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
+ New interncall for the debugger.
+
+2002-09-24 Nick Drochak <ndrochak@gol.com>
+
+ * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
+ before using it in case it is null.
+
+Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * metadata.c: allow custom modifiers in local var signatures
+ (bug spotted by Zoltan Varga).
+
+Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: deal with the <Module> class that may have a NULL vtable.
+ Eliminate warnings.
+
+Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * image.c, image.h: more strong name helpers.
+ * monosn.c: more work: convert pem keys to cryptoapi format.
+
+Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * string-icalls.c: speedup IndexOf.
+
+Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: updates from Zoltan.2.Varga@nokia.com.
+
+Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: cleanup: use mono_object_domain ().
+
+2002-09-23 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Improved type support.
+
+2002-09-22 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Added support for reference types and strings.
+
+2002-09-22 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Started to work on the type table.
+
+2002-09-21 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Largely reworked the symbol table format.
+ The symbol table is now incrementally updated each time a new
+ method is added. We're now also using our own magic and version
+ so that you don't need to recompile all your classes if the
+ dynamic table changes.
+ (mono_debug_update_mono_symbol_file): Removed.
+ (mono_debug_symfile_add_method): New function to add a method.
+
+2002-09-21 Martin Baulig <martin@gnome.org>
+
+ * icall.c
+ ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
+ New interncall.
+
+ * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
+ New interncall to get a method from its metadata token.
+
+2002-09-21 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Create type table.
+
+2002-09-20 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
+
+2002-09-20 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Provide information about params and locals.
+
+2002-09-20 Martin Baulig <martin@gnome.org>
+
+ * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
+ New interncall.
+
+ * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
+ interncall to get a method from its metadata token.
+
+2002-09-20 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Added a few checks for method->header
+ being non-NULL. This should never happen, but for the moment
+ let's use a g_warning() rather than a g_assert().
+
+2002-09-19 Mark Crichton <crichton@gimp.org>
+
+ * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
+ even if support for it isn't present. Added an #ifdef to fix this.
+
+ * socket-io.c: Added checks back for Solaris support.
+
+2002-09-19 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c (read_string, write_string): Reflect latest
+ changes in the symbol file format.
+
+2002-09-18 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Set version number to 21.
+
+2002-09-18 Dick Porter <dick@ximian.com>
+
+ * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
+ on netbsd. Fixes bug 30051.
+
+2002-09-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c:
+ (set_version_from_string): little fix.
+
+Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * monosn.c, Makefile.am: added strong name utility.
+ * reflection.h, reflection.c: implemented delayed signing,
+ locale, version and hash id assembly attributes.
+
+Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * loader.c, metadata.c: load param attributes in signatures.
+
+2002-09-16 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Added string table with all method names.
+
+2002-09-14 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
+ fast method lookup.
+
+Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: record the public key token of referenced assemblies.
+
+Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * image.c, image.h: added functions to get the strong name and the
+ public key of an assembly.
+ * pedump.c: use them.
+
+2002-09-12 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
+
+2002-09-12 Miguel de Icaza <miguel@ximian.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): Added
+ MONO_TYPE_BOOLEAN
+
+2002-09-11 Martin Baulig <martin@gnome.org>
+
+ * gc.c: Call GC_unregister_disappearing_link() on all links when
+ finalizing them, this is necessary to aviod a crash in boehm's
+ finalize handler.
+
+Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: handle GetTarget for finalized objects spotted and fixed by
+ nick@chemlab.org.
+
+Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: implemented MonoType::Module.
+ * reflection.c, reflection.h: mono_module_get_object () from
+ Tomi Pakarinen <tomi.pakarinen@welho.com>.
+
+Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: ignore overridden methods in GetMethods ().
+ Fix for FieldInfo::SetValue().
+ * object.c: handle float/double in runtime invoke.
+
+Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: allow a constructor to be called again on an object.
+
+Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.h, class.c: move field layout code to it's own function and
+ export it. Get an interface id earlier. Move fields in MonoClass
+ so they are more cache friendly and align the bitfields.
+ * loader.c: temporary handle get_param_names() for a runtime method.
+ * reflection.c, reflection.h: more code to handle runtime creation of
+ types.
+
+2002-09-09 Martin Baulig <martin@gnome.org>
+
+ * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
+ signature with the pinvoke field being set for the actual call.
+
+Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: removed some unused icalls. Start of map of glib charsets
+ to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
+
+Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * debug-helpers.c: break infinite loop (found and fixed by
+ Holger Arnold <harnold@gmx.de>).
+
+Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: target may be null in create_delegate.
+
+Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: handle a boolean return type.
+
+Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
+
+Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * gc.c: fix weakreferences.
+
+Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: added icall to get default codepage.
+
+2002-09-03 Dick Porter <dick@ximian.com>
+
+ * threads.h:
+ * threads.c: Use MonoThread instead of MonoObject where
+ apropriate.
+
+ Store running thread objects in a hash table, so that we have all
+ the info to hand when waiting for them to finish
+ (means we don't need OpenThread() any more, so mingw builds should
+ be fully functional again.)
+
+ * verify.c:
+ * object.h: Added thread ID to MonoThread
+
+2002-09-03 Martin Baulig <martin@gnome.org>
+
+ * icall.c (System.Reflection.Assembly::get_location): New interncall.
+
+2002-09-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: fixed leak in get_temp_path. Thanks lupus.
+
+2002-09-03 Martin Baulig <martin@gnome.org>
+
+ * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
+ argument to store the end address of the disassembled instruction.
+
+ * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
+ here from debug-symfile.h.
+ (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
+ JIT into this struct.
+ (MonoSymbolFile): Added `char *image_file' field.
+ (MonoDebugGetMethodFunc): Removed.
+ (mono_debug_update_mono_symbol_file): Removed the hash table argument.
+ (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
+ (mono_debug_find_method): New method.
+
+ * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
+ create a full symbol file.
+ (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
+ and static symbol files.
+ (mono_debug_find_method): The symbol file keeps an internal method hash,
+ call this to get a MonoDebugMethodInfo from a MonoMethod.
+
+ * debug-symfile.[ch]: Removed.
+
+2002-08-29 Miguel de Icaza <miguel@ximian.com>
+
+ * image.c (do_mono_image_open): Remove linker version check.
+
+2002-08-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): don't cache
+ wrappers for instance methods.
+
+2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added ves_icall_System_IO_Path_get_temp_path.
+
+2002-08-28 Dick Porter <dick@ximian.com>
+
+ * Makefile.am: Export HOST_CC for w32 builds
+
+Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * file-io.c process.c: MonoString are null terminated, no
+ need for mono_string_to_utf16() anymore.
+
+Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
+
+Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c, reflection.h: speedup System.MonoType.
+
+Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: allow null as the value of a string argument in
+ custom attributes constructors.
+
+2002-08-27 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
+ `trampoline_address' field.
+
+2002-08-27 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
+ check (fixes bug #29486)
+
+2002-08-27 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c: Changed the file format in a way that allows us
+ open it read-only and to use a specially malloced area for all the
+ dynamic data. We can now also generate a symbol file on-the-fly if we're
+ debugging IL code and there is no MCS generated symbol file for it.
+
+Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: added a define for a good string and array
+ creation speedup (not enabled by default because we need to deal with
+ the synch stuff).
+
+2002-08-26 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
+ function to create a dynamic symbol file. This is used by the
+ debugger to create a symbol file for IL code on-the-fly.
+
+2002-08-26 Martin Baulig <martin@gnome.org>
+
+ * loader.c (mono_lookup_pinvoke_call): Include the error message
+ from g_module_error() in the error message.
+
+2002-08-24 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
+ function to update the symbol file. The symbol file is mmap()ed
+ writable, but private. This allows us to install the symbol file
+ together with the assembly.
+
+2002-08-24 Martin Baulig <martin@gnome.org>
+
+ * debug-mono-symfile.[ch]: New files. Similar to debug-symfile.[ch]
+ but they can read the new symbol file format which mcs is now creating.
+
+ * debug-symfile.c (mono_debug_find_source_location): Moved to
+ debug-mono-symfile.c; this is now operating on the new symbol file.
+
+2002-08-23 Martin Baulig <martin@gnome.org>
+
+ * debug-helpers.c (mono_method_desc_from_method): New function to get
+ a MonoMethodDesc from a MonoMethod.
+
+Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: fixes assertion failure caused by multiple ExecuteAssembly
+ calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
+
+Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * string-icalls.[ch]: make helper methods static.
+
+2002-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
+ types to it and to SetValueInternal.
+
+ * object.c: Moved handle_enum label to its proper place. This was the
+ f... bug! ;-)
+
+ This time i compiled mcs and gtk-sharp and they both work.
+
+2002-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: reverted partially my previous patch until
+ object.c:set_value handles enums correcly.
+
+2002-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c:
+ (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
+ (ves_icall_System_Environment_get_MachineName): removed warning when
+ compiling under cygwin.
+
+Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: fixed field_get_value() for reference types.
+
+2002-08-22 Dick Porter <dick@ximian.com>
+
+ * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
+ Don't free a buffer while it's still needed. Patch from Jonathan
+ Liger <Jonathan.liger@wanadoo.fr>
+
+2002-08-21 Miguel de Icaza <miguel@ximian.com>
+
+ * icall.c (ves_icall_System_Environment_get_Platform): Add new
+ internal call.
+
+2002-08-21 Dietmar Maurer <dietmar@ximian.com>
+
+ * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
+ (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
+
+ * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
+ we call unmanaged code which throws exceptions.
+
+Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h: added per-domain entry_assembly.
+ * appdomain.c: ensure mono_runtime_exec_main () gets non-null
+ arguments.
+ * icall.c: Assembly::GetEntryAssembly icall.
+ * object.c: set domain->entry_assembly in mono_runtime_exec_main().
+ Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
+
+Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h, gc.c: added mono_domain_finalize ().
+
+2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c:
+ (mono_print_unhandled_exception): changed g_warning by g_printerr
+ because g_log has a 1024 characters limit (yeah, i got a big stack
+ trace). Don't print exception name, that should be in ToString
+ returned string.
+
+2002-08-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added ves_icall_FieldInfo_SetValueInternal.
+ * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
+
+2002-08-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c:
+ (mono_print_unhandled_exception): after previous commit, i realized
+ that MS calls ToString on the exception. I changed this function to
+ do that. This way we get stack_trace for free.
+
+2002-08-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * object.c:
+ (mono_print_unhandled_exception): invoke Message property instead of
+ getting 'message' field from Exception. Don't allocate memory for
+ 'trace' and 'message' if not needed.
+
+2002-08-18 Dick Porter <dick@ximian.com>
+
+ * unicode.c: Fix asserts to match Encoder.cs checks
+
+Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * marshal.c: fix unaligned store issue and a few wrong
+ opcode argument types.
+
+2002-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c: added GetUninitializedObjectInternal internal call.
+
+2002-08-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
+ to the right domain.
+
+2002-08-14 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
+
+ * class.c (class_compute_field_layout): set blittable to false for Strings
+
+ * appdomain.c (mono_domain_transfer_object): added support for ISerializable
+
+Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
+ first chunk of code to create types at runtime. Code to
+ handle ReflectedType/DeclaringType. Make reflection handles
+ domain specific.
+
+Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: set correct name in arrays.
+
+2002-08-13 Dietmar Maurer <dietmar@ximian.com>
+
+ * appdomain.c (mono_domain_transfer_object): make it work with
+ valuetypes. bug fixes.
+
+2002-08-12 Dick Porter <dick@ximian.com>
+
+ * object.h: Rename some parameters to avoid c++ keywords (Patch
+ from Joseph Wenninger <kde@jowenn.at>)
+
+Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: added icall to implement Assembly.GetFile*.
+
+Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.h, reflection.c: code to embed managed resources.
+
+Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: move all the type size stuff into
+ class_compute_field_layout().
+
+Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c: ensure enums have always the correct instance size.
+ * unicode.c: remove wrong assert.
+
+Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * assembly.c: fix mem corruption issue.
+ * image.h, image.c: added mono_image_get_resource () to access
+ managed resources.
+ * icall.c: implemented Assembly.EntryPoint property and some
+ Managed Resources related internalcalls.
+
+
+Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * image.c, image.h: impemented mono_image_get_entry_point ().
+ * appdomain.c: use mono_image_get_entry_point.
+
+Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: support the object type argument when loading
+ custom attributes.
+
+2002-08-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
+ String as return type.
+
+Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fix encoding of named args for custom attrs to match
+ the ms implementation. Read them back when instantiating custom
+ attributes.
+
+2002-08-02 Radek Doulik <rodo@ximian.com>
+
+ * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
+ by Dietmar as quick fix
+ (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
+ 16 as stack size, used on more places as quick fix before Dietmar
+ will fix it properly
+
+Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.h, object.c: added accessors for fields and properties.
+
+Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, class.h: made mono_class_get_field_from_name ()
+ loop on parent types.
+ Added mono_class_get_property_from_name ().
+
+Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, class.h: move the code to setup the type vtable in its own
+ function so that it can be reused also for types created at runtime.
+ Eliminate the "class" identifier from the header file.
+ * reflection.c: setup the vtable for enums so that we can create
+ objects for use in SetConstant ().
+
+2002-08-02 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
+ instead of the delegate itself as this pointer (bug #28383)
+
+2002-08-01 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_managed_wrapper): added return type
+ conversions.
+
+Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * loader.c: don't set the pinvoke bit on icalls.
+
+2002-07-31 Dietmar Maurer <dietmar@ximian.com>
+
+ * debug-helpers.c (mono_method_full_name): only print a number to
+ indicate wrapper type (so that the output is more readable in traces).
+
+2002-07-30 Dietmar Maurer <dietmar@ximian.com>
+
+ * class.c (mono_class_init): include method override patch from Paolo
+
+Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: fixed GetTypeCode().
+
+2002-07-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
+ use real delegate invoke function to make it work with multicast
+ delegates (fix bug# 28291).
+
+Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.c: load constant strings.
+
+Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: no magic numbers.
+ * tabledefs.h: security action enum.
+
+Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * assembly.c: fix possible memory corruption.
+
+Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.h, reflection.c: added support for linking resources.
+ * verify.c: check we have an updated corlib.
+
+2002-07-25 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
+ string arrays.
+ (mono_marshal_string_array): null terminate unmanaged string arrays.
+ (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
+
+Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.c: Type.GetType () can now return also types from the
+ calling assembly.
+
+Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * loader.h, loader.c: stack walking support.
+ * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
+ GetCallingAssembly.
+
+2002-07-24 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c: added optimisations for blittable types
+
+ * class.c (mono_array_class_get): do not set blittable attribute on arrays
+ (mono_class_setup_mono_type): set blittable attribute for single
+ and double.
+
+ * marshal.c (mono_string_utf8_to_builder): impl.
+ (mono_string_builder_to_utf8): impl.
+ (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
+
+2002-07-23 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
+ (mono_marshal_get_managed_wrapper): impl. byref types
+
+2002-07-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c:
+ (search_method): don't display debug message.
+
+2002-07-22 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
+
+Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.c: set the missing filename when throwing exception.
+
+2002-07-22 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.c (mono_type_size): code cleanup
+ (mono_type_stack_size): removed some test code
+
+2002-07-21 Miguel de Icaza <miguel@ximian.com>
+
+ * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
+ mono_get_exception_file_not_found now.
+
+ * exception.c (mono_exception_from_name_two_strings): New version
+ that will call a constructor with two string arguments.
+ (mono_get_exception_file_not_found): New helper routine, used to
+ report file-not-found errors.
+
+2002-07-20 Dick Porter <dick@ximian.com>
+
+ * process.h:
+ * process.c: Pass file handles to CreateProcess
+
+ * icall.c:
+ * file-io.h:
+ * file-io.c: Implemented CreatePipe
+
+2002-07-19 Dietmar Maurer <dietmar@ximian.com>
+
+ * metadata.c (mono_get_param_info): set alignment for value types
+
+Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
+ Constify mono_domain_assembly_open().
+ * loader.c: handle null namespace in icalls.
+
+2002-07-19 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (emit_ptr_to_str_conv): marshal object as structs
+ (emit_str_to_ptr_conv): marshal object as structs
+
+ * metadata.c (mono_type_to_unmanaged): marshal object as structs
+
+ * marshal.c (mono_marshal_get_runtime_invoke): support value types
+
+2002-07-18 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
+ (mono_marshal_get_native_wrapper): we an now return value types
+
+Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * verify.c: more checks implemented.
+
+2002-07-17 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_delegate_to_ftnptr): invoke the right method
+ (fix bug #27695)
+ (mono_marshal_get_native_wrapper): allow byref arguments
+ (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
+ impl. PtrToStringXXX methods
+ (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
+ (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
+ (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
+ (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
+ (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
+
+Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fix buglet in parsing an assembly name.
+
+2002-07-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (emit_ptr_to_str_conv): first impl.
+
+Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * object.c, class.h: cache the vtable in the class as suggested by
+ vargaz@freemail.hu (Zoltan Varga).
+
+Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * class.h, loader.c: added mono_field_from_token().
+ * verify.c: first cut of type checking code.
+
+2002-07-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
+
+2002-07-15 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): handle enum types
+ (fix bug #27782)
+ (mono_marshal_get_remoting_invoke): impl.
+ (mono_delegate_begin_invoke): impl.
+ (mono_mb_emit_save_args): impl.
+ (mono_delegate_end_invoke): impl.
+ (mono_marshal_get_delegate_begin_invoke):
+ (mono_marshal_get_delegate_end_invoke):
+ (mono_marshal_get_delegate_invoke): generate a special name for
+ those methods (including the signature) and associate them whith
+ the delegate class.
+
+2002-07-13 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
+
+ * reflection.[ch]:
+ (mono_reflection_type_from_name): now it has a MonoImage parameter
+ which is used as the default image to search the type in. If the image
+ is NULL or getting the type from it fails, it defaults to corlib.
+
+ * icall.c: changed 1 call to mono_reflection_type_from_name to match
+ new parameter.
+
+Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: update the parameter table index.
+
+Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * domain.c: don't include the mark byte in the string hash.
+
+Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * icall.cs: icall for Type.GetTypeCode ().
+ * verify: a couple of fixes and disabled local initialization checks.
+
+2002-07-12 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
+
+ * debug-helpers.c (mono_method_full_name): print the type of the
+ runtime wrapper
+
+ * metadata.c (mono_signature_hash): a hash function for signatures
+ (mono_signature_hash): better hash algorithm
+
+ * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
+
+ * debug-helpers.c (mono_method_full_name): this can now generate
+ method names with signatures
+
+ * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
+ method dont have this pointers.
+
+Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: fixup typebuilder tokens.
+ * image.c: fix buglet.
+ * marshal.h: remove whitespace.
+ * metadata.h, metadata.c: reinstate code that was removed.
+ * verify.c: handle catch directives and fix another couple of bugs.
+
+2002-07-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
+ (mono_marshal_get_native_wrapper): make it comp. with the old code
+ (mono_marshal_get_native_wrapper): support boolean
+ (mono_marshal_get_managed_wrapper): support more types
+
+2002-06-25 Dietmar Maurer <dietmar@ximian.com>
+
+ * class.c (class_compute_field_layout): compute class->blittable attribute.
+
+2002-07-09 Dick Porter <dick@ximian.com>
+
+ * threads.c: Make the thread cleaning up cope with threads that
+ call ExitThread()
+
+2002-07-08 Radek Doulik <rodo@ximian.com>
+
+ * reflection.c (method_encode_code): use non-translated values to
+ compute finally_start, this fixes exception handling on ppc, yay!
+
+ * decimal.h (struct signscale): fix endianess
+
+2002-07-07 Radek Doulik <rodo@ximian.com>
+
+ * reflection.c: swap box_val and not val
+
+Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c, reflection.h: handle full assembly info in type name.
+ Handle Type arguments when loading custom attributes.
+ * icall.c: updated to use new mono_reflection_type_from_name () method.
+
+2002-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * loader.c:
+ (method_from_memberref): also print assembly name when method not found.
+
+2002-07-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * icall.c:
+ (ves_icall_TypeGetProperties): fixed bug #27473.
+
+2002-07-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * reflection.c: display image name and token when cannot find the
+ .ctor for an attribute.
+
+2002-07-05 Martin Baulig <martin@gnome.org>
+
+ * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
+
+2002-07-04 Dick Porter <dick@ximian.com>
+
+ * threads.c (mono_thread_cleanup): Nasty kludge to get this to
+ compile on mingw. This will cause mingw builds to not wait for
+ subthreads to terminate after the main thread does. I've lodged a
+ bug with the mingw developers for them to wrap OpenThread().
+
+2002-07-03 Dick Porter <dick@ximian.com>
+
+ * threads.c: Store thread IDs instead of handles, because
+ GetCurrentThread() returns a pseudohandle and therefore stores
+ useless values. mono_thread_cleanup() continues checking the
+ array of threads until it is empty, to cope with subthreads
+ spawning new threads after the main thread has finished.
+
+ * profiler.h:
+ * profiler.c:
+ * profiler-private.h: Pass the thread ID to thread profiler
+ functions, instead of a handle
+
+Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * verify.c: fixes to make it more usable.
+ * pedump.c: added --verify code to verify IL code in an assembly.
+
+Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: turn errors into warnings to allow compiling corlib.
+
+Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: add special cases to compile corlib.
+
+Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: handle properties with only a set method.
+
+Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * opcodes.h: add enum with opcodes in opval order.
+
+2002-07-01 Dick Porter <dick@ximian.com>
+
+ * object.h:
+ * object.c (mono_runtime_run_main): Removed unneeded argument
+
+2002-06-28 Martin Baulig <martin@gnome.org>
+
+ * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
+
+2002-06-27 Dick Porter <dick@ximian.com>
+
+ * threads.c: Store the handle in both the parent thread and in the
+ subthread, to minimise the time between starting a new thread and
+ storing its ID.
+
+2002-06-26 Dick Porter <dick@ximian.com>
+
+ * appdomain.c (mono_runtime_cleanup): Close the socket library
+ after all the threads have finished, not before
+
+2002-06-26 Martin Baulig <martin@gnome.org>
+
+ * debug-symfile.c (mono_debug_find_source_location): Added
+ `guint32 *line_number' argument. If it's not NULL, store the line number
+ there and return the file name without the line number.
+
2002-06-25 Dick Porter <dick@ximian.com>
* icall.c:
diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am
index 9e5e9241ac4..9f2044f78e2 100644
--- a/mono/metadata/Makefile.am
+++ b/mono/metadata/Makefile.am
@@ -1,30 +1,71 @@
-noinst_PROGRAMS = pedump
+if PLATFORM_WIN32
+export HOST_CC
+# Use -m here. This will use / as directory separator (C:/WINNT).
+# The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
+# / by \ if running under WIN32.
+assembliesdir = `cygpath -m "${libdir}"`
+confdir = `cygpath -m "${sysconfdir}"`
+# The mingw math.h has "extern inline" functions that dont appear in libs, so
+# optimisation is required to actually inline them
+AM_CFLAGS = -O
+PLATFORM_LIB = ../os/libmonoos.la
+else
+assembliesdir = $(libdir)
+confdir = $(sysconfdir)
+endif
-lib_LIBRARIES = libmetadata.a libmonoruntime.a
+bin_PROGRAMS = pedump
#
-# Keep in sync with mono/runtime/Makefile.am
+# libtool is not capable of creating static/shared versions of the same
+# convenience lib, so we have to do it ourselves
#
-assembliesdir = $(libdir)
+noinst_LTLIBRARIES = libmetadata.la libmonoruntime.la libmetadata-static.la libmonoruntime-static.la
+
+
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) $(ICU_CFLAGS) \
+ -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
+
+if WITH_BUNDLE
+bundle_srcs = mono-bundle.s mono-bundle.h
+bundle_obj = mono-bundle.o
+#BUILT_SOURCES = $(bundle_srcs)
+
+$(bundle_obj): $(bundle_srcs)
+$(bundle_srcs): mono-bundle.stamp
+ @if test -f $@; then :; else rm -f mono-bundle.stamp; $(MAKE) mono-bundle.stamp; fi
+mono-bundle.stamp: $(BUNDLE_FILE) $(srcdir)/make-bundle.pl
+ echo stamp > $@t
+ perl $(srcdir)/make-bundle.pl $(BUNDLE_FILE) mono-bundle.h mono-bundle.s
+ mv $@t $@
+
+endif
+
+CLEANFILES = mono-bundle.stamp
-INCLUDES = $(GLIB_CFLAGS) $(GMODULE_CFLAGS) -I$(top_srcdir) -I$(top_srcdir)/mono \
- -DMONO_ASSEMBLIES=\""$(assembliesdir)"\" -DMONO_CFG_DIR=\""$(sysconfdir)"\"
+libmetadata_la_LIBADD = $(bundle_obj) $(PLATFORM_LIB)
-libmonoruntime_a_SOURCES = \
+libmonoruntime_static_la_LIBADD = $(libmonoruntime_la_LIBADD)
+libmetadata_static_la_LIBADD = $(libmetadata_la_LIBADD)
+
+libmonoruntime_la_SOURCES = \
reflection.c \
object.c \
+ object-internals.h \
icall.c \
+ char-conversions.h \
decimal.c \
decimal.h \
gc.c \
- gc.h \
+ gc-internal.h \
marshal.c \
marshal.h \
+ monitor.c \
+ monitor.h \
threads.c \
- threads.h \
+ threads-types.h \
threadpool.c \
threadpool.h \
- threads-types.h \
file-io.c \
file-io.h \
socket-io.c \
@@ -33,58 +74,84 @@ libmonoruntime_a_SOURCES = \
exception.h \
unicode.c \
unicode.h \
- appdomain.h \
appdomain.c \
- debug-helpers.h \
- debug-helpers.c \
- debug-symfile.h \
- debug-symfile.c \
+ debug-mono-symfile.h \
+ debug-mono-symfile.c \
+ mono-debug.h \
+ mono-debug.c \
+ mono-debug-debugger.h \
+ mono-debug-debugger.c \
profiler.c \
profiler-private.h \
rand.h \
rand.c \
+ security.c \
+ security.h \
string-icalls.c \
string-icalls.h \
sysmath.h \
sysmath.c \
process.c \
- process.h
+ process.h \
+ environment.c \
+ environment.h \
+ locales.c \
+ locales.h \
+ filewatcher.c \
+ filewatcher.h \
+ culture-info.h \
+ culture-info-tables.h
-libmetadata_a_SOURCES = \
+libmetadata_la_SOURCES = \
assembly.c \
domain.c \
+ domain-internals.h \
opcodes.c \
image.c \
+ cil-coff.h \
+ tabledefs.h \
metadata.c \
+ metadata-internals.h \
verify.c \
mono-endian.c \
+ mono-endian.h \
mono-config.c \
mono-config.h \
private.h \
rawbuffer.c \
+ rawbuffer.h \
loader.c \
class.c \
- mempool.h \
+ class-internals.h \
mempool.c \
- debug-helpers.h \
debug-helpers.c
+libmetadata_static_la_SOURCES = $(libmetadata_la_SOURCES)
+libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
+
+libmetadata_static_la_LDFLAGS = -static
+libmonoruntime_static_la_LDFLAGS = -static
+
libmetadataincludedir = $(includedir)/mono/metadata
libmonoruntimeincludedir = $(includedir)/mono/metadata
+libmonoruntimeinclude_HEADERS = \
+ appdomain.h \
+ mono-debug.h \
+ mono-debug-debugger.h \
+ debug-mono-symfile.h \
+ threads.h \
+ environment.h
+
libmetadatainclude_HEADERS = \
assembly.h \
opcodes.h \
blob.h \
- cil-coff.h \
- mono-endian.h \
image.h \
metadata.h \
verify.h \
- rawbuffer.h \
reflection.h \
row-indexes.h \
- tabledefs.h \
tokentype.h \
loader.h \
class.h \
@@ -92,11 +159,14 @@ libmetadatainclude_HEADERS = \
exception.h \
profiler.h \
appdomain.h \
- rand.h
+ debug-helpers.h \
+ mempool.h
pedump_SOURCES = \
- pedump.c $(libmetadata_a_SOURCES)
+ pedump.c
-pedump_LDADD = ../io-layer/libwapi.a ../utils/libmonoutils.a $(GLIB_LIBS) $(GMODULE_LIBS) -lm
+pedump_LDADD = libmetadata.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
+ $(LIBGC_LIBS) $(GLIB_LIBS) $(GMODULE_LIBS) -lm
+EXTRA_DIST = make-bundle.pl sample-bundle
diff --git a/mono/metadata/NOTES b/mono/metadata/NOTES
new file mode 100644
index 00000000000..4edf1cd699c
--- /dev/null
+++ b/mono/metadata/NOTES
@@ -0,0 +1,113 @@
+
+1. Thread safety of metadata structures
+----------------------------------------
+
+1.1 Synchronization of read-only data
+-------------------------------------
+
+Read-only data is data which is not modified after creation, like the
+actual binary metadata in the metadata tables.
+
+There are three kinds of threads with regards to read-only data:
+- readers
+- the creator of the data
+- the destroyer of the data
+
+Most threads are readers.
+
+- synchronization between readers is not neccesary
+- synchronization between the writers is done using locks.
+- synchronization between the readers and the creator is done by not exposing
+ the data to readers before it is fully constructed.
+- synchronization between the readers and the destroyer: TBD.
+
+1.2 Deadlock prevention plan
+----------------------------
+
+Hold locks for the shortest time possible. Avoid calling functions inside
+locks which might obtain global locks (i.e. locks known outside this module).
+
+1.3 Locks
+----------
+
+1.3.1 Simple locks
+------------------
+
+ There are a lot of global data structures which can be protected by a 'simple' lock. Simple means:
+ - the lock protects only this data structure or it only protects the data structures in a given C module.
+ An example would be the appdomains list in domain.c
+ - the lock is only held for a short amount of time, and no other lock is acquired inside this simple lock. Thus there is
+ no possibility of deadlock.
+
+1.3.2 The class loader lock
+---------------------------
+
+This locks is held by the class loading routines in class.c and loader.c. It
+protects the various caches inside MonoImage which are used by these modules.
+
+1.3.3 The domain lock
+---------------------
+
+Each appdomain has a lock which protects the per-domain data structures.
+
+1.3.4 The locking hierarchy
+---------------------------
+
+It is useful to model locks by a locking hierarchy, which is a relation between locks, which is reflexive, transitive,
+and antisymmetric, in other words, a lattice. If a thread wants to acquire a lock B, while already holding A, it can only
+do it if A < B. If all threads work this way, then no deadlocks can occur.
+
+Our locking hierarchy so far looks like this:
+ <DOMAIN LOCK>
+ \
+ <CLASS LOADER LOCK>
+ \ \
+ <SIMPLE LOCK 1> <SIMPLE LOCK 2>
+
+1.4 Notes
+----------
+
+Some common scenarios:
+- if a function needs to access a data structure, then it should lock it itself, and do not count on its caller locking it.
+ So for example, the image->class_cache hash table would be locked by mono_class_get().
+
+- there are lots of places where a runtime data structure is created and stored in a cache. In these places, care must be
+ taken to avoid multiple threads creating the same runtime structure, for example, two threads might call mono_class_get ()
+ with the same class name. There are two choices here:
+
+ <enter mutex>
+ <check that item is created>
+ if (created) {
+ <leave mutex>
+ return item
+ }
+ <create item>
+ <store it in cache>
+ <leave mutex>
+
+ This is the easiest solution, but it requires holding the lock for the whole time which might create a scalability problem, and could also lead to deadlock.
+
+ <enter mutex>
+ <check that item is created>
+ <leave mutex>
+ if (created) {
+ return item
+ }
+ <create item>
+ <enter mutex>
+ <check that item is created>
+ if (created) {
+ /* Another thread already created and stored the same item */
+ <free our item>
+ <leave mutex>
+ return orig item
+ }
+ else {
+ <store item in cache>
+ <leave mutex>
+ return item
+ }
+
+ This solution does not present scalability problems, but the created item might be hard to destroy (like a MonoClass).
+
+- lazy initialization of hashtables etc. is not thread safe
diff --git a/mono/metadata/TODO b/mono/metadata/TODO
index 98c3ce7b7d3..f37fd656388 100644
--- a/mono/metadata/TODO
+++ b/mono/metadata/TODO
@@ -1,15 +1,4 @@
-* mono_class_from_name
-
- In many places we call mono_class_from_name with static values,
- we should cache that instead:
-
- static MonoClass *klass;
-
- if (!klass){
- klass = mono_class_from_name (...);
- }
-
* Uniform names
We have a mess of names in the icall.c file, we need to sort that out.
diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c
index d0840a4d2fd..e6f49a51881 100644
--- a/mono/metadata/appdomain.c
+++ b/mono/metadata/appdomain.c
@@ -1,31 +1,62 @@
/*
* appdomain.c: AppDomain functions
*
- * Author:
+ * Authors:
* Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
+ * Gonzalo Paniagua Javier (gonzalo@ximian.com)
*
- * (C) 2001 Ximian, Inc.
+ * (c) 2001-2003 Ximian, Inc. (http://www.ximian.com)
*/
#include <config.h>
#include <glib.h>
#include <string.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include <mono/metadata/object.h>
-#include <mono/metadata/appdomain.h>
+#include <mono/metadata/domain-internals.h>
+#include "mono/metadata/metadata-internals.h"
#include <mono/metadata/assembly.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/threads.h>
#include <mono/metadata/socket-io.h>
-#include <mono/metadata/cil-coff.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/threadpool.h>
+#include <mono/utils/mono-uri.h>
+
+#define MONO_CORLIB_VERSION 28
-HANDLE mono_delegate_semaphore = NULL;
CRITICAL_SECTION mono_delegate_section;
-int mono_runtime_shutdown = 0;
+
+static gunichar2 process_guid [36];
+static gboolean process_guid_set = FALSE;
+
+static gboolean shutting_down = FALSE;
+
+static MonoAssembly *
+mono_domain_assembly_preload (MonoAssemblyName *aname,
+ gchar **assemblies_path,
+ gpointer user_data);
+
+static MonoAssembly *
+mono_domain_assembly_search (MonoAssemblyName *aname,
+ gpointer user_data);
+
+static void
+mono_domain_fire_assembly_load (MonoAssembly *assembly, gpointer user_data);
+
+static void
+add_assemblies_to_domain (MonoDomain *domain, MonoAssembly *ass);
+
+static MonoMethod *
+look_for_method_by_name (MonoClass *klass, const gchar *name);
+
+static void
+mono_domain_unload (MonoDomain *domain);
/*
* mono_runtime_init:
@@ -34,17 +65,33 @@ int mono_runtime_shutdown = 0;
* Initialize the core AppDomain: this function will run also some
* IL initialization code, so it needs the execution engine to be fully
* operational.
+ *
+ * AppDomain.SetupInformation is set up in mono_runtime_exec_main, where
+ * we know the entry_assembly.
+ *
*/
void
-mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb)
+mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
+ MonoThreadAttachCB attach_cb)
{
MonoAppDomainSetup *setup;
MonoAppDomain *ad;
MonoClass *class;
+ MonoString *arg;
+ MONO_GC_PRE_INIT ();
+ mono_thread_pool_init ();
+ mono_marshal_init ();
+
+ mono_install_assembly_preload_hook (mono_domain_assembly_preload, NULL);
+ mono_install_assembly_search_hook (mono_domain_assembly_search, NULL);
+ mono_install_assembly_load_hook (mono_domain_fire_assembly_load, NULL);
+ mono_install_lookup_dynamic_token (mono_reflection_lookup_dynamic_token);
+
+ mono_thread_init (start_cb, attach_cb);
+
class = mono_class_from_name (mono_defaults.corlib, "System", "AppDomainSetup");
setup = (MonoAppDomainSetup *) mono_object_new (domain, class);
- ves_icall_System_AppDomainSetup_InitAppDomainSetup (setup);
class = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
ad = (MonoAppDomain *) mono_object_new (domain, class);
@@ -52,120 +99,201 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb)
domain->domain = ad;
domain->setup = setup;
- mono_delegate_semaphore = CreateSemaphore (NULL, 0, 0x7fffffff, NULL);
- g_assert (mono_delegate_semaphore != INVALID_HANDLE_VALUE);
InitializeCriticalSection (&mono_delegate_section);
+
+ mono_context_init (domain);
+ mono_context_set (domain->default_context);
+
+ mono_type_initialization_init ();
+
+
+ /*
+ * Create an instance early since we can't do it when there is no memory.
+ */
+ arg = mono_string_new (domain, "Out of memory");
+ domain->out_of_memory_ex = mono_exception_from_name_two_strings (mono_defaults.corlib, "System", "OutOfMemoryException", arg, NULL);
+
+ /*
+ * These two are needed because the signal handlers might be executing on
+ * an alternate stack, and Boehm GC can't handle that.
+ */
+ arg = mono_string_new (domain, "A null value was found where an object instance was required");
+ domain->null_reference_ex = mono_exception_from_name_two_strings (mono_defaults.corlib, "System", "NullReferenceException", arg, NULL);
+ arg = mono_string_new (domain, "The requested operation caused a stack overflow.");
+ domain->stack_overflow_ex = mono_exception_from_name_two_strings (mono_defaults.corlib, "System", "StackOverflowException", arg, NULL);
- mono_thread_init (domain, start_cb);
+ /* GC init has to happen after thread init */
+ mono_gc_init ();
mono_network_init ();
+ /* mscorlib is loaded before we install the load hook */
+ mono_domain_fire_assembly_load (mono_defaults.corlib->assembly, NULL);
+
return;
}
+static int
+mono_get_corlib_version (void)
+{
+ MonoClass *klass;
+ MonoClassField *field;
+ MonoObject *value;
+
+ klass = mono_class_from_name (mono_defaults.corlib, "System", "Environment");
+ mono_class_init (klass);
+ field = mono_class_get_field_from_name (klass, "mono_corlib_version");
+ if (!field)
+ return -1;
+ if (! (field->type->attrs & FIELD_ATTRIBUTE_STATIC))
+ return -1;
+ value = mono_field_get_value_object (mono_domain_get (), field, NULL);
+ return *(gint32*)((gchar*)value + sizeof (MonoObject));
+}
+
+const char*
+mono_check_corlib_version (void)
+{
+ int version = mono_get_corlib_version ();
+ if (version != MONO_CORLIB_VERSION)
+ return g_strdup_printf ("expected corlib version %d, found %d.", MONO_CORLIB_VERSION, version);
+ else
+ return NULL;
+}
+
+void
+mono_context_init (MonoDomain *domain)
+{
+ MonoClass *class;
+ MonoAppContext *context;
+
+ class = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context");
+ context = (MonoAppContext *) mono_object_new (domain, class);
+ context->domain_id = domain->domain_id;
+ context->context_id = 0;
+ domain->default_context = context;
+}
+
+/* This must not be called while there are still running threads executing
+ * managed code.
+ */
void
mono_runtime_cleanup (MonoDomain *domain)
{
- mono_runtime_shutdown = 1;
+ shutting_down = TRUE;
- mono_network_cleanup ();
+ /* This ends up calling any pending pending (for at most 2 seconds) */
+ mono_gc_cleanup ();
- /* signal all waiters in order to stop all workers (max. 0xffff) */
- ReleaseSemaphore (mono_delegate_semaphore, 0xffff, NULL);
+ mono_network_cleanup ();
+}
- mono_thread_cleanup ();
-
+static MonoDomainFunc quit_function = NULL;
+void
+mono_runtime_install_cleanup (MonoDomainFunc func)
+{
+ quit_function = func;
}
void
-ves_icall_System_AppDomainSetup_InitAppDomainSetup (MonoAppDomainSetup *setup)
+mono_runtime_quit ()
{
- /* FIXME: implement me */
+ if (quit_function != NULL)
+ quit_function (mono_get_root_domain (), NULL);
}
-/**
- * mono_domain_transfer_object:
- * @src: the source domain
- * @dst: the destination domain
- * @obj: the object to transfer
- *
- * This function is used to transfer objects between domains. This is done by
- * marshalling or serialisation.
- */
-static MonoObject *
-mono_domain_transfer_object (MonoDomain *src, MonoDomain *dst, MonoObject *obj)
+gboolean
+mono_runtime_is_shutting_down (void)
{
- MonoClass *klass;
- MonoObject *res;
+ return shutting_down;
+}
- if (!obj)
- return NULL;
+gboolean
+mono_domain_has_type_resolve (MonoDomain *domain)
+{
+ static MonoClassField *field = NULL;
+ MonoObject *o;
- g_assert (obj->vtable->domain == src);
+ if (field == NULL) {
+ MonoClass *klass = mono_defaults.appdomain_class;
+ int i;
- /* fixme: transfer an object from one domain into another */
+ for (i = 0; i < klass->field.count; ++i)
+ if (strcmp (klass->fields [i].name, "TypeResolve") == 0)
+ field = &klass->fields [i];
+ g_assert (field);
+ }
- klass = obj->vtable->klass;
+ mono_field_get_value ((MonoObject*)(domain->domain), field, &o);
+ return o != NULL;
+}
- if (MONO_CLASS_IS_ARRAY (klass)) {
- MonoArray *ao = (MonoArray *)obj;
- int esize, ecount, i;
- guint32 *sizes;
-
- esize = mono_array_element_size (klass);
- if (ao->bounds == NULL) {
- ecount = mono_array_length (ao);
- res = (MonoObject *)mono_array_new_full (dst, klass, &ecount, NULL);
- }
- else {
- sizes = alloca (klass->rank * sizeof(guint32) * 2);
- ecount = 1;
- for (i = 0; i < klass->rank; ++i) {
- sizes [i] = ao->bounds [i].length;
- ecount *= ao->bounds [i].length;
- sizes [i + klass->rank] = ao->bounds [i].lower_bound;
- }
- res = (MonoObject *)mono_array_new_full (dst, klass, sizes, sizes + klass->rank);
- }
- if (klass->element_class->valuetype) {
- memcpy (res, (char *)ao + sizeof(MonoArray), esize * ecount);
- } else {
- g_assert (esize == sizeof (gpointer));
- for (i = 0; i < ecount; i++) {
- int offset = sizeof (MonoArray) + esize * i;
- gpointer *src_ea = (gpointer *)((char *)ao + offset);
- gpointer *dst_ea = (gpointer *)((char *)res + offset);
+MonoReflectionAssembly *
+mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb)
+{
+ MonoClass *klass;
+ void *params [1];
+ static MonoMethod *method = NULL;
- *dst_ea = mono_domain_transfer_object (src, dst, *src_ea);
- }
+ g_assert (domain != NULL && ((name != NULL) || (tb != NULL)));
+
+ if (method == NULL) {
+ klass = domain->domain->mbr.obj.vtable->klass;
+ g_assert (klass);
+
+ method = look_for_method_by_name (klass, "DoTypeResolve");
+ if (method == NULL) {
+ g_warning ("Method AppDomain.DoTypeResolve not found.\n");
+ return NULL;
}
- } else if (klass == mono_defaults.string_class) {
- MonoString *str = (MonoString *)obj;
- res = (MonoObject *)mono_string_new_utf16 (dst,
- (const guint16 *)mono_string_chars (str), str->length);
- } else {
- /* FIXME: we need generic marshalling code here */
- g_assert_not_reached ();
}
-
- return res;
+
+ if (name)
+ *params = (MonoObject*)mono_string_new (mono_domain_get (), name);
+ else
+ *params = tb;
+ return (MonoReflectionAssembly *) mono_runtime_invoke (method, domain->domain, params, NULL);
+}
+
+/*
+ * mono_domain_set:
+ *
+ * Set the current appdomain to @domain. If @force is set, set it even
+ * if it is being unloaded.
+ * Returns:
+ * - TRUE on success
+ * - FALSE if the domain is unloaded
+ */
+gboolean
+mono_domain_set (MonoDomain *domain, gboolean force)
+{
+ if (!force && domain->state == MONO_APPDOMAIN_UNLOADED)
+ return FALSE;
+
+ mono_domain_set_internal (domain);
+
+ return TRUE;
}
MonoObject *
ves_icall_System_AppDomain_GetData (MonoAppDomain *ad, MonoString *name)
{
MonoDomain *add = ad->data;
- MonoDomain *cur = mono_domain_get ();
MonoObject *o;
char *str;
+ MONO_ARCH_SAVE_REGS;
+
g_assert (ad != NULL);
- g_assert (name != NULL);
+
+ if (name == NULL)
+ mono_raise_exception (mono_get_exception_argument_null ("name"));
str = mono_string_to_utf8 (name);
mono_domain_lock (add);
+
if (!strcmp (str, "APPBASE"))
o = (MonoObject *)add->setup->application_base;
else if (!strcmp (str, "APP_CONFIG_FILE"))
@@ -185,7 +313,7 @@ ves_icall_System_AppDomain_GetData (MonoAppDomain *ad, MonoString *name)
else if (!strcmp (str, "FORCE_CACHE_INSTALL"))
o = (MonoObject *)add->setup->shadow_copy_files;
else
- o = g_hash_table_lookup (add->env, str);
+ o = mono_g_hash_table_lookup (add->env, name);
mono_domain_unlock (add);
g_free (str);
@@ -193,33 +321,33 @@ ves_icall_System_AppDomain_GetData (MonoAppDomain *ad, MonoString *name)
if (!o)
return NULL;
- return mono_domain_transfer_object (add, cur, o);
+ return o;
}
void
ves_icall_System_AppDomain_SetData (MonoAppDomain *ad, MonoString *name, MonoObject *data)
{
MonoDomain *add = ad->data;
- MonoDomain *cur = mono_domain_get ();
- MonoObject *o;
- char *str;
+
+ MONO_ARCH_SAVE_REGS;
g_assert (ad != NULL);
- g_assert (name != NULL);
- o = mono_domain_transfer_object (cur, add, data);
+ if (name == NULL)
+ mono_raise_exception (mono_get_exception_argument_null ("name"));
- /* fixme: need a hash func for MonoString */
- str = mono_string_to_utf8 (name);
mono_domain_lock (add);
- g_hash_table_insert (add->env, str, o);
+
+ mono_g_hash_table_insert (add->env, name, data);
+
mono_domain_unlock (add);
- g_free (str);
}
MonoAppDomainSetup *
ves_icall_System_AppDomain_getSetup (MonoAppDomain *ad)
{
+ MONO_ARCH_SAVE_REGS;
+
g_assert (ad != NULL);
g_assert (ad->data != NULL);
@@ -229,6 +357,8 @@ ves_icall_System_AppDomain_getSetup (MonoAppDomain *ad)
MonoString *
ves_icall_System_AppDomain_getFriendlyName (MonoAppDomain *ad)
{
+ MONO_ARCH_SAVE_REGS;
+
g_assert (ad != NULL);
g_assert (ad->data != NULL);
@@ -239,27 +369,62 @@ MonoAppDomain *
ves_icall_System_AppDomain_getCurDomain ()
{
MonoDomain *add = mono_domain_get ();
+
+ MONO_ARCH_SAVE_REGS;
+
return add->domain;
}
MonoAppDomain *
+ves_icall_System_AppDomain_getDomainByID (gint32 domain_id)
+{
+ MonoDomain *add = mono_domain_get_by_id (domain_id);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return ((add == NULL) ? NULL : add->domain);
+}
+
+static void
+add_assembly_to_domain (gpointer key, gpointer value, gpointer user_data)
+{
+ add_assemblies_to_domain ((MonoDomain*)user_data, (MonoAssembly*)value);
+}
+
+MonoAppDomain *
ves_icall_System_AppDomain_createDomain (MonoString *friendly_name, MonoAppDomainSetup *setup)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_domain_get ();
MonoClass *adclass;
MonoAppDomain *ad;
MonoDomain *data;
+ MONO_ARCH_SAVE_REGS;
+
adclass = mono_class_from_name (mono_defaults.corlib, "System", "AppDomain");
-
+
/* FIXME: pin all those objects */
- ad = (MonoAppDomain *) mono_object_new (domain, adclass);
- ad->data = data = mono_domain_create ();
+ data = mono_domain_create();
+
+ ad = (MonoAppDomain *) mono_object_new (data, adclass);
+ ad->data = data;
data->domain = ad;
data->setup = setup;
data->friendly_name = mono_string_to_utf8 (friendly_name);
+ data->out_of_memory_ex = mono_exception_from_name_domain (data, mono_defaults.corlib, "System", "OutOfMemoryException");
+
+ if (!setup->application_base) {
+ /* Inherit from the root domain since MS.NET does this */
+ MonoDomain *root = mono_get_root_domain ();
+ setup->application_base = mono_string_new_utf16 (data, mono_string_chars (root->setup->application_base), mono_string_length (root->setup->application_base));
+ }
- /* FIXME: what to do next ? */
+ mono_context_init (data);
+
+ /* The new appdomain should have all assemblies loaded */
+ mono_domain_lock (domain);
+ g_hash_table_foreach (domain->assemblies_by_name, add_assembly_to_domain, data);
+ mono_domain_unlock (domain);
return ad;
}
@@ -286,22 +451,391 @@ ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad)
MonoArray *res;
add_assembly_helper_t ah;
+ MONO_ARCH_SAVE_REGS;
+
if (!System_Reflection_Assembly)
System_Reflection_Assembly = mono_class_from_name (
mono_defaults.corlib, "System.Reflection", "Assembly");
- res = mono_array_new (domain, System_Reflection_Assembly, g_hash_table_size (domain->assemblies));
+ res = mono_array_new (domain, System_Reflection_Assembly, g_hash_table_size (domain->assemblies_by_name));
ah.domain = domain;
ah.res = res;
ah.idx = 0;
mono_domain_lock (domain);
- g_hash_table_foreach (domain->assemblies, add_assembly, &ah);
+ g_hash_table_foreach (domain->assemblies_by_name, add_assembly, &ah);
mono_domain_unlock (domain);
return res;
}
+/*
+ * Used to find methods in AppDomain class.
+ * It only works if there are no multiple signatures for any given method name
+ */
+static MonoMethod *
+look_for_method_by_name (MonoClass *klass, const gchar *name)
+{
+ gint i;
+ MonoMethod *method;
+
+ for (i = 0; i < klass->method.count; i++) {
+ method = klass->methods [i];
+ if (!strcmp (method->name, name))
+ return method;
+ }
+
+ return NULL;
+}
+
+static MonoReflectionAssembly *
+try_assembly_resolve (MonoDomain *domain, MonoString *fname)
+{
+ MonoClass *klass;
+ MonoMethod *method;
+ void *params [1];
+
+ g_assert (domain != NULL && fname != NULL);
+
+ klass = domain->domain->mbr.obj.vtable->klass;
+ g_assert (klass);
+
+ method = look_for_method_by_name (klass, "DoAssemblyResolve");
+ if (method == NULL) {
+ g_warning ("Method AppDomain.DoAssemblyResolve not found.\n");
+ return NULL;
+ }
+
+ *params = fname;
+ return (MonoReflectionAssembly *) mono_runtime_invoke (method, domain->domain, params, NULL);
+}
+
+static void
+add_assemblies_to_domain (MonoDomain *domain, MonoAssembly *ass)
+{
+ gint i;
+
+ if (!ass->aname.name)
+ return;
+
+ mono_domain_lock (domain);
+
+ if (g_hash_table_lookup (domain->assemblies_by_name, ass->aname.name)) {
+ mono_domain_unlock (domain);
+ return; /* This is ok while no lazy loading of assemblies */
+ }
+
+ g_hash_table_insert (domain->assemblies_by_name, (gpointer) ass->aname.name, ass);
+ domain->assemblies = g_list_prepend (domain->assemblies, ass);
+ mono_domain_unlock (domain);
+
+ if (ass->image->references)
+ for (i = 0; ass->image->references [i] != NULL; i++)
+ add_assemblies_to_domain (domain, ass->image->references [i]);
+}
+
+static void
+mono_domain_fire_assembly_load (MonoAssembly *assembly, gpointer user_data)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoReflectionAssembly *ref_assembly;
+ MonoClass *klass;
+ MonoMethod *method;
+ void *params [1];
+
+ klass = domain->domain->mbr.obj.vtable->klass;
+
+ method = look_for_method_by_name (klass, "DoAssemblyLoad");
+ if (method == NULL) {
+ g_warning ("Method AppDomain.DoAssemblyLoad not found.\n");
+ return;
+ }
+
+ add_assemblies_to_domain (domain, assembly);
+
+ ref_assembly = mono_assembly_get_object (domain, assembly);
+ g_assert (ref_assembly);
+
+ *params = ref_assembly;
+ mono_runtime_invoke (method, domain->domain, params, NULL);
+}
+
+static gchar *
+reduce_path (const gchar *dirname)
+{
+ gchar **parts;
+ gchar *part;
+ GList *list, *tmp;
+ GString *result;
+ gchar *res;
+ gint i;
+
+ parts = g_strsplit (dirname, G_DIR_SEPARATOR_S, 0);
+ list = NULL;
+ for (i = 0; (part = parts [i]) != NULL; i++) {
+ if (!strcmp (part, "."))
+ continue;
+
+ if (!strcmp (part, "..")) {
+ if (list && list->next) /* Don't remove root */
+ list = g_list_delete_link (list, list);
+ } else {
+ list = g_list_prepend (list, part);
+ }
+ }
+
+ result = g_string_new ("");
+ list = g_list_reverse (list);
+
+ for (tmp = list; tmp; tmp = tmp->next) {
+ gchar *data = (gchar *) tmp->data;
+
+ if (data && *data) {
+#ifdef PLATFORM_WIN32
+ if (result->len == 0)
+ g_string_append_printf (result, "%s\\", data);
+ else if (result->str [result->len - 1] == '\\')
+ g_string_append_printf (result, "%s", data);
+ else
+#endif
+ g_string_append_printf (result, "%c%s",
+ G_DIR_SEPARATOR, data);
+ }
+ }
+
+ res = result->str;
+ g_string_free (result, FALSE);
+ g_list_free (list);
+ g_strfreev (parts);
+ return res;
+}
+
+static void
+set_domain_search_path (MonoDomain *domain)
+{
+ MonoAppDomainSetup *setup;
+ gchar **tmp;
+ gchar *utf8;
+ gint i;
+ gint npaths = 0;
+ gchar **pvt_split = NULL;
+ GError *error = NULL;
+ gint appbaselen = -1;
+
+ if ((domain->search_path != NULL) && !domain->setup->path_changed)
+ return;
+
+ setup = domain->setup;
+ if (!setup->application_base)
+ return; /* Must set application base to get private path working */
+
+ npaths++;
+ if (setup->private_bin_path) {
+ utf8 = mono_string_to_utf8 (setup->private_bin_path);
+ pvt_split = g_strsplit (utf8, G_SEARCHPATH_SEPARATOR_S, 1000);
+ g_free (utf8);
+ for (tmp = pvt_split; *tmp; tmp++, npaths++);
+ }
+
+ if (!npaths) {
+ if (pvt_split)
+ g_strfreev (pvt_split);
+ /*
+ * Don't do this because the first time is called, the domain
+ * setup is not finished.
+ *
+ * domain->search_path = g_malloc (sizeof (char *));
+ * domain->search_path [0] = NULL;
+ */
+ return;
+ }
+
+ if (domain->search_path)
+ g_strfreev (domain->search_path);
+
+ domain->search_path = tmp = g_malloc ((npaths + 1) * sizeof (gchar *));
+ tmp [npaths] = NULL;
+
+ *tmp = mono_string_to_utf8 (setup->application_base);
+
+ /* FIXME: is this needed? */
+ if (strncmp (*tmp, "file://", 7) == 0) {
+ gchar *file = *tmp;
+ gchar *uri = *tmp;
+ gchar *tmpuri;
+
+ if (uri [7] != '/')
+ uri = g_strdup_printf ("file:///%s", uri + 7);
+
+ tmpuri = uri;
+ uri = mono_escape_uri_string (tmpuri);
+ *tmp = g_filename_from_uri (uri, NULL, &error);
+ g_free (uri);
+
+ if (tmpuri != file)
+ g_free (tmpuri);
+
+ if (error != NULL) {
+ g_warning ("%s\n", error->message);
+ g_error_free (error);
+ *tmp = file;
+ } else {
+ g_free (file);
+ }
+ }
+
+ for (i = 1; pvt_split && i < npaths; i++) {
+ if (g_path_is_absolute (pvt_split [i - 1])) {
+ tmp [i] = g_strdup (pvt_split [i - 1]);
+ } else {
+ tmp [i] = g_build_filename (tmp [0], pvt_split [i - 1], NULL);
+ }
+
+ if (strchr (tmp [i], '.')) {
+ gchar *reduced;
+ gchar *freeme;
+
+ reduced = reduce_path (tmp [i]);
+ if (appbaselen == -1)
+ appbaselen = strlen (tmp [0]);
+
+ if (strncmp (tmp [0], reduced, appbaselen)) {
+ g_free (reduced);
+ g_free (tmp [i]);
+ tmp [i] = g_strdup ("");
+ continue;
+ }
+
+ freeme = tmp [i];
+ tmp [i] = reduced;
+ g_free (freeme);
+ }
+ }
+
+ if (setup->private_bin_path_probe != NULL) {
+ g_free (tmp [0]);
+ tmp [0] = g_strdup ("");
+ }
+
+ domain->setup->path_changed = FALSE;
+
+ g_strfreev (pvt_split);
+}
+
+static gboolean
+try_load_from (MonoAssembly **assembly, const gchar *path1, const gchar *path2,
+ const gchar *path3, const gchar *path4)
+{
+ gchar *fullpath;
+
+ *assembly = NULL;
+ fullpath = g_build_filename (path1, path2, path3, path4, NULL);
+ if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR))
+ *assembly = mono_assembly_open (fullpath, NULL);
+
+ g_free (fullpath);
+ return (*assembly != NULL);
+}
+
+static MonoAssembly *
+real_load (gchar **search_path, const gchar *culture, const gchar *name)
+{
+ MonoAssembly *result = NULL;
+ gchar **path;
+ gchar *filename;
+ const gchar *local_culture;
+ gint len;
+
+ if (!culture || *culture == '\0') {
+ local_culture = "";
+ } else {
+ local_culture = culture;
+ }
+
+ filename = g_strconcat (name, ".dll", NULL);
+ len = strlen (filename);
+
+ for (path = search_path; *path; path++) {
+ if (**path == '\0')
+ continue; /* Ignore empty ApplicationBase */
+
+ /* See test cases in bug #58992 and bug #57710 */
+ /* 1st try: [culture]/[name].dll (culture may be empty) */
+ strcpy (filename + len - 4, ".dll");
+ if (try_load_from (&result, *path, local_culture, "", filename))
+ break;
+
+ /* 2nd try: [culture]/[name].exe (culture may be empty) */
+ strcpy (filename + len - 4, ".exe");
+ if (try_load_from (&result, *path, local_culture, "", filename))
+ break;
+
+ /* 3rd try: [culture]/[name]/[name].dll (culture may be empty) */
+ strcpy (filename + len - 4, ".dll");
+ if (try_load_from (&result, *path, local_culture, name, filename))
+ break;
+
+ /* 4th try: [culture]/[name]/[name].exe (culture may be empty) */
+ strcpy (filename + len - 4, ".exe");
+ if (try_load_from (&result, *path, local_culture, name, filename))
+ break;
+ }
+
+ g_free (filename);
+ return result;
+}
+
+/*
+ * Try loading the assembly from ApplicationBase and PrivateBinPath
+ * and then from assemblies_path if any.
+ */
+static MonoAssembly *
+mono_domain_assembly_preload (MonoAssemblyName *aname,
+ gchar **assemblies_path,
+ gpointer user_data)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoAssembly *result = NULL;
+
+ set_domain_search_path (domain);
+
+ if (domain->search_path && domain->search_path [0] != NULL) {
+ result = real_load (domain->search_path, aname->culture, aname->name);
+ }
+
+ if (result == NULL && assemblies_path && assemblies_path [0] != NULL) {
+ result = real_load (assemblies_path, aname->culture, aname->name);
+ }
+
+ return result;
+}
+
+/*
+ * Check whenever a given assembly was already loaded in the current appdomain.
+ */
+static MonoAssembly *
+mono_domain_assembly_search (MonoAssemblyName *aname,
+ gpointer user_data)
+{
+ MonoDomain *domain = mono_domain_get ();
+ GList *tmp;
+ MonoAssembly *ass;
+
+ mono_domain_lock (domain);
+ for (tmp = domain->assemblies; tmp; tmp = tmp->next) {
+ ass = tmp->data;
+ /* Dynamic assemblies can't match here in MS.NET */
+ if (ass->dynamic || !mono_assembly_names_equal (aname, &ass->aname))
+ continue;
+
+ mono_domain_unlock (domain);
+ return ass;
+ }
+ mono_domain_unlock (domain);
+
+ return NULL;
+}
+
MonoReflectionAssembly *
ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *fname)
{
@@ -310,95 +844,529 @@ ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *fname)
MonoImageOpenStatus status = MONO_IMAGE_OK;
MonoAssembly *ass;
- name = filename = mono_string_to_utf8 (fname);
+ MONO_ARCH_SAVE_REGS;
- /* FIXME: move uri handling to mono_assembly_open */
- if (strncmp (filename, "file://", 7) == 0)
- filename += 7;
+ if (fname == NULL) {
+ MonoException *exc = mono_get_exception_argument_null ("assemblyFile");
+ mono_raise_exception (exc);
+ }
+
+ name = filename = mono_string_to_utf8 (fname);
ass = mono_assembly_open (filename, &status);
g_free (name);
- if (!ass)
- mono_raise_exception ((MonoException *)mono_exception_from_name (mono_defaults.corlib, "System.IO", "FileNotFoundException"));
+ if (!ass){
+ MonoException *exc = mono_get_exception_file_not_found (fname);
+ mono_raise_exception (exc);
+ }
return mono_assembly_get_object (domain, ass);
}
+static void
+free_assembly_name (MonoAssemblyName *aname)
+{
+ if (aname == NULL)
+ return;
+
+ g_free ((void *) aname->name);
+ g_free ((void *) aname->culture);
+ g_free ((void *) aname->hash_value);
+}
+
+static gboolean
+get_info_from_assembly_name (MonoString *assRef, MonoAssemblyName *aname)
+{
+ gchar *name;
+ gchar *value;
+ gchar **parts;
+ gchar **tmp;
+ gint major, minor, build, revision;
+
+ memset (aname, 0, sizeof (MonoAssemblyName));
+
+ name = mono_string_to_utf8 (assRef);
+ parts = tmp = g_strsplit (name, ",", 4);
+ g_free (name);
+ if (!tmp || !*tmp) {
+ g_strfreev (tmp);
+ return FALSE;
+ }
+
+ value = g_strstrip (*tmp);
+ /* g_print ("Assembly name: %s\n", value); */
+ aname->name = g_strdup (value);
+ tmp++;
+ if (!*tmp) {
+ g_strfreev (parts);
+ return TRUE;
+ }
+
+ while (*tmp) {
+ value = g_strstrip (*tmp);
+ if (!g_ascii_strncasecmp (value, "Version=", 8)) {
+ if (sscanf (value + 8, "%u.%u.%u.%u",
+ &major, &minor, &build, &revision) != 4) {
+ g_strfreev (parts);
+ return FALSE;
+ }
+ /* g_print ("Version: %u.%u.%u.%u\n", major, minor, build, revision); */
+ aname->major = major;
+ aname->minor = minor;
+ aname->build = build;
+ aname->revision = revision;
+ tmp++;
+ continue;
+ }
+
+ if (!g_ascii_strncasecmp (value, "Culture=", 8)) {
+ gchar *t = g_strdup (value + 8);
+ g_strchug (t);
+ aname->culture = g_strdup (g_strchomp (t));
+ tmp++;
+ g_free (t);
+ if (g_strcasecmp (aname->culture, "neutral") == 0) {
+ g_free ((void *) aname->culture);
+ aname->culture = g_strdup ("");
+ }
+ continue;
+ }
+
+ if (!g_ascii_strncasecmp (value, "PublicKeyToken=", 15)) {
+ tmp++;
+ value += 15;
+ if (*value && strncmp (value, "null", 4)) {
+ gchar *t = g_strdup (value);
+ g_strchug (t);
+ g_strlcpy (aname->public_key_token, g_strchomp (value), MONO_PUBLIC_KEY_TOKEN_LENGTH);
+ g_free (t);
+ }
+ continue;
+ }
+
+ g_strfreev (parts);
+ return FALSE;
+ }
+
+ g_strfreev (parts);
+ return TRUE;
+}
+
+MonoReflectionAssembly *
+ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomain *ad,
+ MonoArray *raw_assembly,
+ MonoArray *raw_symbol_store, MonoObject *evidence)
+{
+ MonoAssembly *ass;
+ MonoReflectionAssembly *refass = NULL;
+ MonoDomain *domain = ad->data;
+ MonoImageOpenStatus status;
+ guint32 raw_assembly_len = mono_array_length (raw_assembly);
+ MonoImage *image = mono_image_open_from_data (mono_array_addr (raw_assembly, gchar, 0), raw_assembly_len, TRUE, NULL);
+
+ if (raw_symbol_store)
+ mono_raise_exception (mono_get_exception_not_implemented ("LoadAssemblyRaw: Raw Symbol Store not Implemented"));
+
+ if (!image) {
+ mono_raise_exception (mono_get_exception_bad_image_format (""));
+ return NULL;
+ }
+
+ ass = mono_assembly_load_from (image, "", &status);
+
+ if (!ass) {
+ mono_image_close (image);
+ mono_raise_exception (mono_get_exception_bad_image_format (""));
+ return NULL;
+ }
+
+ refass = mono_assembly_get_object (domain, ass);
+ refass->evidence = evidence;
+ return refass;
+}
MonoReflectionAssembly *
-ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad, MonoReflectionAssemblyName *assRef, MonoObject *evidence)
+ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad, MonoString *assRef, MonoObject *evidence)
{
MonoDomain *domain = ad->data;
- char *name;
MonoImageOpenStatus status = MONO_IMAGE_OK;
MonoAssembly *ass;
MonoAssemblyName aname;
+ MonoReflectionAssembly *refass = NULL;
- memset (&aname, 0, sizeof (aname));
-
- /* FIXME : examine evidence? */
+ MONO_ARCH_SAVE_REGS;
g_assert (assRef != NULL);
- g_assert (assRef->name != NULL);
- /* FIXME : examine version, culture info */
+ if (!get_info_from_assembly_name (assRef, &aname)) {
+ MonoException *exc;
- aname.name = name = mono_string_to_utf8 (assRef->name);
+ free_assembly_name (&aname);
+ /* This is a parse error... */
+ exc = mono_get_exception_file_not_found (assRef);
+ mono_raise_exception (exc);
+ }
ass = mono_assembly_load (&aname, NULL, &status);
-
- g_free (name);
+ free_assembly_name (&aname);
+
+ if (!ass && (refass = try_assembly_resolve (domain, assRef)) == NULL){
+ /* FIXME: it doesn't make much sense since we really don't have a filename ... */
+ MonoException *exc = mono_get_exception_file_not_found (assRef);
+ mono_raise_exception (exc);
+ }
- if (!ass)
- mono_raise_exception ((MonoException *)mono_exception_from_name (mono_defaults.corlib, "System.IO", "FileNotFoundException"));
+ if (refass == NULL)
+ refass = mono_assembly_get_object (domain, ass);
- return mono_assembly_get_object (domain, ass);
+ refass->evidence = evidence;
+ return refass;
}
void
-ves_icall_System_AppDomain_Unload (MonoAppDomain *ad)
+ves_icall_System_AppDomain_InternalUnload (gint32 domain_id)
{
- mono_domain_unload (ad->data, FALSE);
+ MonoDomain * domain = mono_domain_get_by_id (domain_id);
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (NULL == domain) {
+ MonoException *exc = mono_get_exception_execution_engine ("Failed to unload domain, domain id not found");
+ mono_raise_exception (exc);
+ }
+
+ if (domain == mono_get_root_domain ()) {
+ mono_raise_exception (mono_get_exception_cannot_unload_appdomain ("The default appdomain can not be unloaded."));
+ return;
+ }
+
+ /*
+ * Unloading seems to cause problems when running NUnit/NAnt, hence
+ * this workaround.
+ */
+ if (g_getenv ("MONO_NO_UNLOAD"))
+ return;
+
+ mono_domain_unload (domain);
+}
+
+gboolean
+ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id)
+{
+ MonoDomain *domain = mono_domain_get_by_id (domain_id);
+
+ if (!domain)
+ return TRUE;
+
+ return mono_domain_is_unloading (domain);
}
gint32
ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad, MonoString *file,
MonoObject *evidence, MonoArray *args)
{
- MonoDomain *cdom = mono_domain_get ();
MonoAssembly *assembly;
MonoImage *image;
- MonoCLIImageInfo *iinfo;
MonoMethod *method;
- MonoObject *margs;
char *filename;
gint32 res;
+ MonoReflectionAssembly *refass;
- mono_domain_set (ad->data);
+ MONO_ARCH_SAVE_REGS;
filename = mono_string_to_utf8 (file);
assembly = mono_assembly_open (filename, NULL);
g_free (filename);
- if (!assembly) {
- mono_raise_exception ((MonoException *)mono_exception_from_name (
- mono_defaults.corlib, "System.IO", "FileNotFoundException"));
- }
+ if (!assembly)
+ mono_raise_exception (mono_get_exception_file_not_found (file));
image = assembly->image;
- iinfo = image->image_info;
- method = mono_get_method (image, iinfo->cli_cli_header.ch_entry_point, NULL);
+
+ method = mono_get_method (image, mono_image_get_entry_point (image), NULL);
if (!method)
g_error ("No entry point method found in %s", image->name);
- margs = mono_domain_transfer_object (cdom, ad->data, (MonoObject *)args);
- res = mono_runtime_exec_main (method, (MonoArray *)margs, NULL);
+ if (!args)
+ args = (MonoArray *) mono_array_new (ad->data, mono_defaults.string_class, 0);
+
+ refass = mono_assembly_get_object (ad->data, assembly);
+ refass->evidence = evidence;
- mono_domain_set (cdom);
+ res = mono_runtime_exec_main (method, (MonoArray *)args, NULL);
return res;
}
+gint32
+ves_icall_System_AppDomain_GetIDFromDomain (MonoAppDomain * ad)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return ad->data->domain_id;
+}
+
+MonoAppDomain *
+ves_icall_System_AppDomain_InternalSetDomain (MonoAppDomain *ad)
+{
+ MonoDomain *old_domain = mono_domain_get();
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!mono_domain_set (ad->data, FALSE))
+ mono_raise_exception (mono_get_exception_appdomain_unloaded ());
+
+ return old_domain->domain;
+}
+
+MonoAppDomain *
+ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid)
+{
+ MonoDomain *current_domain = mono_domain_get ();
+ MonoDomain *domain = mono_domain_get_by_id (domainid);
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!domain || !mono_domain_set (domain, FALSE))
+ mono_raise_exception (mono_get_exception_appdomain_unloaded ());
+
+ return current_domain->domain;
+}
+
+void
+ves_icall_System_AppDomain_InternalPushDomainRef (MonoAppDomain *ad)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ mono_thread_push_appdomain_ref (ad->data);
+}
+
+void
+ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id)
+{
+ MonoDomain *domain = mono_domain_get_by_id (domain_id);
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!domain)
+ /*
+ * Raise an exception to prevent the managed code from executing a pop
+ * later.
+ */
+ mono_raise_exception (mono_get_exception_appdomain_unloaded ());
+
+ mono_thread_push_appdomain_ref (domain);
+}
+
+void
+ves_icall_System_AppDomain_InternalPopDomainRef (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ mono_thread_pop_appdomain_ref ();
+}
+
+MonoAppContext *
+ves_icall_System_AppDomain_InternalGetContext ()
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_context_get ();
+}
+
+MonoAppContext *
+ves_icall_System_AppDomain_InternalGetDefaultContext ()
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_domain_get ()->default_context;
+}
+
+MonoAppContext *
+ves_icall_System_AppDomain_InternalSetContext (MonoAppContext *mc)
+{
+ MonoAppContext *old_context = mono_context_get ();
+
+ MONO_ARCH_SAVE_REGS;
+
+ mono_context_set (mc);
+
+ return old_context;
+}
+
+MonoString *
+ves_icall_System_AppDomain_InternalGetProcessGuid (MonoString* newguid)
+{
+ MonoDomain* mono_root_domain = mono_get_root_domain ();
+ mono_domain_lock (mono_root_domain);
+ if (process_guid_set) {
+ mono_domain_unlock (mono_root_domain);
+ return mono_string_new_utf16 (mono_domain_get (), process_guid, sizeof(process_guid)/2);
+ }
+ memcpy (process_guid, mono_string_chars(newguid), sizeof(process_guid));
+ process_guid_set = TRUE;
+ mono_domain_unlock (mono_root_domain);
+ return newguid;
+}
+
+gboolean
+mono_domain_is_unloading (MonoDomain *domain)
+{
+ if (domain->state == MONO_APPDOMAIN_UNLOADING || domain->state == MONO_APPDOMAIN_UNLOADED)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+static void
+clear_cached_vtable (gpointer key, gpointer value, gpointer user_data)
+{
+ MonoClass *klass = (MonoClass*)key;
+ MonoDomain *domain = (MonoDomain*)user_data;
+ MonoVTable *vt;
+
+ vt = klass->cached_vtable;
+ if (vt && vt->domain == domain)
+ klass->cached_vtable = NULL;
+}
+
+typedef struct unload_data {
+ MonoDomain *domain;
+ char *failure_reason;
+} unload_data;
+
+static guint32
+unload_thread_main (void *arg)
+{
+ unload_data *data = (unload_data*)arg;
+ MonoDomain *domain = data->domain;
+
+ /*
+ * FIXME: Abort our parent thread last, so we can return a failure
+ * indication if aborting times out.
+ */
+ if (!mono_threads_abort_appdomain_threads (domain, 10000)) {
+ data->failure_reason = g_strdup_printf ("Aborting of threads in domain %s timed out.", domain->friendly_name);
+ return 1;
+ }
+
+ /* Finalize all finalizable objects in the doomed appdomain */
+ if (!mono_domain_finalize (domain, 10000)) {
+ data->failure_reason = g_strdup_printf ("Finalization of domain %s timed out.", domain->friendly_name);
+ return 1;
+ }
+
+ /* Clear references to our vtables in class->cached_vtable */
+ mono_domain_lock (domain);
+ mono_g_hash_table_foreach (domain->class_vtable_hash, clear_cached_vtable,
+ domain);
+ mono_domain_unlock (domain);
+
+ domain->state = MONO_APPDOMAIN_UNLOADED;
+
+ /* printf ("UNLOADED %s.\n", domain->friendly_name); */
+
+ mono_domain_free (domain, FALSE);
+
+#ifdef HAVE_BOEHM_GC
+ GC_gcollect ();
+#endif
+
+ return 0;
+}
+
+/*
+ * mono_domain_unload:
+ *
+ * Unloads an appdomain. Follows the process outlined in:
+ * http://blogs.gotdotnet.com/cbrumme
+ * If doing things the 'right' way is too hard or complex, we do it the
+ * 'simple' way, which means do everything needed to avoid crashes and
+ * memory leaks, but not much else.
+ */
+static void
+mono_domain_unload (MonoDomain *domain)
+{
+ HANDLE thread_handle;
+ guint32 tid;
+ MonoAppDomainState prev_state;
+ MonoMethod *method;
+ MonoObject *exc;
+ unload_data thread_data;
+ MonoDomain *caller_domain = mono_domain_get ();
+
+ /* printf ("UNLOAD STARTING FOR %s.\n", domain->friendly_name); */
+
+ /* Atomically change our state to UNLOADING */
+ prev_state = InterlockedCompareExchange (&domain->state,
+ MONO_APPDOMAIN_UNLOADING,
+ MONO_APPDOMAIN_CREATED);
+ if (prev_state != MONO_APPDOMAIN_CREATED) {
+ if (prev_state == MONO_APPDOMAIN_UNLOADING)
+ mono_raise_exception (mono_get_exception_cannot_unload_appdomain ("Appdomain is already being unloaded."));
+ else
+ if (prev_state == MONO_APPDOMAIN_UNLOADED)
+ mono_raise_exception (mono_get_exception_cannot_unload_appdomain ("Appdomain is already unloaded."));
+ else
+ g_assert_not_reached ();
+ }
+
+ mono_domain_set (domain, FALSE);
+ /* Notify OnDomainUnload listeners */
+ method = look_for_method_by_name (domain->domain->mbr.obj.vtable->klass, "DoDomainUnload");
+ g_assert (method);
+
+ exc = NULL;
+ mono_runtime_invoke (method, domain->domain, NULL, &exc);
+ if (exc) {
+ /* Roll back the state change */
+ domain->state = MONO_APPDOMAIN_CREATED;
+ mono_domain_set (caller_domain, FALSE);
+ mono_raise_exception ((MonoException*)exc);
+ }
+
+ thread_data.domain = domain;
+ thread_data.failure_reason = NULL;
+
+ /*
+ * First we create a separate thread for unloading, since
+ * we might have to abort some threads, including the current one.
+ */
+ /*
+ * If we create a non-suspended thread, the runtime will hang.
+ * See:
+ * http://bugzilla.ximian.com/show_bug.cgi?id=27663
+ */
+#if 0
+ thread_handle = CreateThread (NULL, 0, unload_thread_main, &thread_data, 0, &tid);
+#else
+#if defined(PLATFORM_WIN32) && defined (HAVE_BOEHM_GC)
+ thread_handle = GC_CreateThread (NULL, 0, unload_thread_main, &thread_data, CREATE_SUSPENDED, &tid);
+#else
+ thread_handle = CreateThread (NULL, 0, unload_thread_main, &thread_data, CREATE_SUSPENDED, &tid);
+#endif
+ ResumeThread (thread_handle);
+#endif
+
+ while (WaitForSingleObjectEx (thread_handle, INFINITE, FALSE) == WAIT_IO_COMPLETION)
+ ; /* wait for the thread */
+
+
+ mono_domain_set (caller_domain, FALSE);
+ if (thread_data.failure_reason) {
+ MonoException *ex;
+
+ ex = mono_get_exception_cannot_unload_appdomain (thread_data.failure_reason);
+ /* Roll back the state change */
+ domain->state = MONO_APPDOMAIN_CREATED;
+
+ g_warning (thread_data.failure_reason);
+
+ g_free (thread_data.failure_reason);
+
+ mono_raise_exception (ex);
+ }
+}
diff --git a/mono/metadata/appdomain.h b/mono/metadata/appdomain.h
index f89b2d3f358..92589309977 100644
--- a/mono/metadata/appdomain.h
+++ b/mono/metadata/appdomain.h
@@ -10,158 +10,169 @@
#ifndef _MONO_METADATA_APPDOMAIN_H_
#define _MONO_METADATA_APPDOMAIN_H_
-#include <config.h>
#include <glib.h>
#include <mono/metadata/object.h>
#include <mono/metadata/reflection.h>
#include <mono/metadata/mempool.h>
-#include <mono/utils/mono-hash.h>
-#include <mono/io-layer/io-layer.h>
-
-typedef void (*MonoThreadStartCB) (gpointer stack_start);
-
-/* This is a copy of System.AppDomainSetup */
-typedef struct {
- MonoObject object;
- MonoString *application_base;
- MonoString *application_name;
- MonoString *cache_path;
- MonoString *configuration_file;
- MonoString *dynamic_base;
- MonoString *license_file;
- MonoString *private_bin_path;
- MonoString *private_bin_path_probe;
- MonoString *shadow_copy_directories;
- MonoString *shadow_copy_files;
- MonoBoolean publisher_policy;
-} MonoAppDomainSetup;
-
-typedef GArray MonoJitInfoTable;
-
-typedef struct {
- guint32 flags;
- gpointer try_start;
- gpointer try_end;
- gpointer handler_start;
- guint32 token_or_filter;
-} MonoJitExceptionInfo;
-
-typedef struct {
- MonoMethod *method;
- gpointer code_start;
- int code_size;
- guint32 used_regs;
- unsigned num_clauses;
- MonoJitExceptionInfo *clauses;
-} MonoJitInfo;
+
+typedef void (*MonoThreadStartCB) (guint32 tid, gpointer stack_start,
+ gpointer func);
+typedef void (*MonoThreadAttachCB) (guint32 tid, gpointer stack_start);
typedef struct _MonoAppDomain MonoAppDomain;
+typedef struct _MonoAppContext MonoAppContext;
+typedef struct _MonoJitInfo MonoJitInfo;
-struct _MonoDomain {
- MonoAppDomain *domain;
- CRITICAL_SECTION lock;
- MonoMemPool *mp;
- GHashTable *env;
- GHashTable *assemblies;
- MonoAppDomainSetup *setup;
- char *friendly_name;
- MonoGHashTable *ldstr_table;
- MonoGHashTable *class_vtable_hash;
- MonoGHashTable *proxy_vtable_hash;
- MonoGHashTable *static_data_hash;
- GHashTable *jit_code_hash;
- MonoJitInfoTable *jit_info_table;
-};
-
-/* This is a copy of System.AppDomain */
-struct _MonoAppDomain {
- MonoObject object;
- MonoDomain *data;
-};
-
-extern MonoDomain *mono_root_domain;
-
-extern HANDLE mono_delegate_semaphore;
-extern CRITICAL_SECTION mono_delegate_section;
-extern int mono_runtime_shutdown;
-
-#define mono_domain_lock(domain) EnterCriticalSection(&(domain)->lock)
-#define mono_domain_unlock(domain) LeaveCriticalSection(&(domain)->lock)
+typedef void (*MonoDomainFunc) (MonoDomain *domain, gpointer user_data);
MonoDomain*
mono_init (const char *filename);
+MonoDomain *
+mono_init_from_assembly (const char *domain_name, const char *filename);
+
+MonoDomain *
+mono_init_version (const char *domain_name, const char *version);
+
+MonoDomain*
+mono_get_root_domain (void);
+
void
-mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb);
+mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
+ MonoThreadAttachCB attach_cb);
void
mono_runtime_cleanup (MonoDomain *domain);
+void
+mono_runtime_install_cleanup (MonoDomainFunc func);
+
+void
+mono_runtime_quit (void);
+
+gboolean
+mono_runtime_is_shutting_down (void);
+
+const char*
+mono_check_corlib_version (void);
+
MonoDomain *
mono_domain_create (void);
inline MonoDomain *
mono_domain_get (void);
+inline MonoDomain *
+mono_domain_get_by_id (gint32 domainid);
+
+gint32
+mono_domain_get_id (MonoDomain *domain);
+
+inline gboolean
+mono_domain_set (MonoDomain *domain, gboolean force);
+
inline void
-mono_domain_set (MonoDomain *domain);
+mono_domain_set_internal (MonoDomain *domain);
+
+gboolean
+mono_domain_is_unloading (MonoDomain *domain);
+
+void
+mono_domain_foreach (MonoDomainFunc func, gpointer user_data);
MonoAssembly *
-mono_domain_assembly_open (MonoDomain *domain, char *name);
+mono_domain_assembly_open (MonoDomain *domain, const char *name);
+
+gboolean
+mono_domain_finalize (MonoDomain *domain, guint32 timeout);
void
-mono_domain_unload (MonoDomain *domain, gboolean force);
+mono_domain_free (MonoDomain *domain, gboolean force);
+
+gboolean
+mono_domain_has_type_resolve (MonoDomain *domain);
+
+MonoReflectionAssembly *
+mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb);
void
-mono_jit_info_table_add (MonoDomain *domain, MonoJitInfo *ji);
+mono_context_init (MonoDomain *domain);
+
+inline void
+mono_context_set (MonoAppContext *new_context);
+
+inline MonoAppContext *
+mono_context_get (void);
MonoJitInfo *
mono_jit_info_table_find (MonoDomain *domain, char *addr);
-void
-ves_icall_System_AppDomainSetup_InitAppDomainSetup (MonoAppDomainSetup *setup);
+MonoImage*
+mono_get_corlib (void);
-MonoAppDomain *
-ves_icall_System_AppDomain_getCurDomain (void);
+MonoClass*
+mono_get_object_class (void);
-MonoAppDomain *
-ves_icall_System_AppDomain_createDomain (MonoString *friendly_name,
- MonoAppDomainSetup *setup);
+MonoClass*
+mono_get_byte_class (void);
-MonoObject *
-ves_icall_System_AppDomain_GetData (MonoAppDomain *ad,
- MonoString *name);
+MonoClass*
+mono_get_void_class (void);
-void
-ves_icall_System_AppDomain_SetData (MonoAppDomain *ad,
- MonoString *name,
- MonoObject *data);
+MonoClass*
+mono_get_boolean_class (void);
-MonoAppDomainSetup *
-ves_icall_System_AppDomain_getSetup (MonoAppDomain *ad);
+MonoClass*
+mono_get_sbyte_class (void);
-MonoString *
-ves_icall_System_AppDomain_getFriendlyName (MonoAppDomain *ad);
+MonoClass*
+mono_get_int16_class (void);
-MonoArray *
-ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad);
+MonoClass*
+mono_get_uint16_class (void);
-MonoReflectionAssembly *
-ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *fname);
+MonoClass*
+mono_get_int32_class (void);
-MonoReflectionAssembly *
-ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad,
- MonoReflectionAssemblyName *assRef,
- MonoObject *evidence);
+MonoClass*
+mono_get_uint32_class (void);
-void
-ves_icall_System_AppDomain_Unload (MonoAppDomain *ad);
+MonoClass*
+mono_get_intptr_class (void);
-gint32
-ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad,
- MonoString *file,
- MonoObject *evidence,
- MonoArray *args);
+MonoClass*
+mono_get_uintptr_class (void);
+
+MonoClass*
+mono_get_int64_class (void);
+
+MonoClass*
+mono_get_uint64_class (void);
+
+MonoClass*
+mono_get_single_class (void);
+
+MonoClass*
+mono_get_double_class (void);
+
+MonoClass*
+mono_get_char_class (void);
+
+MonoClass*
+mono_get_string_class (void);
+
+MonoClass*
+mono_get_enum_class (void);
+
+MonoClass*
+mono_get_array_class (void);
+
+MonoClass*
+mono_get_thread_class (void);
+
+MonoClass*
+mono_get_exception_class (void);
#endif /* _MONO_METADATA_APPDOMAIN_H_ */
+
diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c
index 9a32472a0be..e8fbe134043 100644
--- a/mono/metadata/assembly.c
+++ b/mono/metadata/assembly.c
@@ -6,8 +6,6 @@
*
* (C) 2001 Ximian, Inc. http://www.ximian.com
*
- * TODO:
- * Implement big-endian versions of the reading routines.
*/
#include <config.h>
#include <stdio.h>
@@ -19,6 +17,21 @@
#include "image.h"
#include "cil-coff.h"
#include "rawbuffer.h"
+#ifdef WITH_BUNDLE
+#include "mono-bundle.h"
+#endif
+#include <mono/metadata/loader.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/domain-internals.h>
+#include <mono/io-layer/io-layer.h>
+#include <mono/utils/mono-uri.h>
+#include <mono/metadata/mono-config.h>
+#include <mono/utils/mono-digest.h>
+#include <mono/utils/mono-logger.h>
+#ifdef PLATFORM_WIN32
+#include <mono/os/util.h>
+#endif
/* the default search path is just MONO_ASSEMBLIES */
static const char*
@@ -28,72 +41,136 @@ default_path [] = {
};
static char **assemblies_path = NULL;
-static int env_checked = 0;
+
+/*
+ * keeps track of loaded assemblies
+ */
+static GList *loaded_assemblies = NULL;
+static MonoAssembly *corlib;
+
+/* This protects loaded_assemblies and image->references */
+static CRITICAL_SECTION assemblies_mutex;
+
+/* A hastable of thread->assembly list mappings */
+static GHashTable *assemblies_loading;
+
+static char **extra_gac_paths = NULL;
+
+static gchar*
+encode_public_tok (const guchar *token, gint32 len)
+{
+ const static gchar allowed [] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+ gchar *res;
+ int i;
+
+ res = g_malloc (len * 2 + 1);
+ for (i = 0; i < len; i++) {
+ res [i * 2] = allowed [token [i] >> 4];
+ res [i * 2 + 1] = allowed [token [i] & 0xF];
+ }
+ res [len * 2] = 0;
+ return res;
+}
static void
-check_env (void) {
+check_path_env (void) {
const char *path;
char **splitted;
- if (env_checked)
- return;
- env_checked = 1;
-
- path = getenv ("MONO_PATH");
+ path = g_getenv ("MONO_PATH");
if (!path)
return;
+
splitted = g_strsplit (path, G_SEARCHPATH_SEPARATOR_S, 1000);
if (assemblies_path)
g_strfreev (assemblies_path);
assemblies_path = splitted;
+ if (g_getenv ("MONO_DEBUG") == NULL)
+ return;
+
+ while (*splitted) {
+ if (**splitted && !g_file_test (*splitted, G_FILE_TEST_IS_DIR))
+ g_warning ("'%s' in MONO_PATH doesn't exist or has wrong permissions.", *splitted);
+
+ splitted++;
+ }
}
-/*
- * keeps track of loaded assemblies
- */
-static GList *loaded_assemblies = NULL;
-static MonoAssembly *corlib;
+static void
+check_extra_gac_path_env (void) {
+ const char *path;
+ char **splitted;
+
+ path = g_getenv ("MONO_GAC_PREFIX");
+ if (!path)
+ return;
+
+ splitted = g_strsplit (path, G_SEARCHPATH_SEPARATOR_S, 1000);
+ if (extra_gac_paths)
+ g_strfreev (extra_gac_paths);
+ extra_gac_paths = splitted;
+ if (g_getenv ("MONO_DEBUG") == NULL)
+ return;
+
+ while (*splitted) {
+ if (**splitted && !g_file_test (*splitted, G_FILE_TEST_IS_DIR))
+ g_warning ("'%s' in MONO_GAC_PATH doesn't exist or has wrong permissions.", *splitted);
+
+ splitted++;
+ }
+}
+
+gboolean
+mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r)
+{
+ if (!l->name || !r->name)
+ return FALSE;
+
+ if (strcmp (l->name, r->name))
+ return FALSE;
+
+ if (l->culture && r->culture && strcmp (l->culture, r->culture))
+ return FALSE;
+
+ if (l->major != r->major || l->minor != r->minor ||
+ l->build != r->build || l->revision != r->revision)
+ if (! ((l->major == 0 && l->minor == 0 && l->build == 0 && l->revision == 0) || (r->major == 0 && r->minor == 0 && r->build == 0 && r->revision == 0)))
+ return FALSE;
+
+ if (!l->public_key_token [0] || !r->public_key_token [0])
+ return TRUE;
+
+ if (strcmp (l->public_key_token, r->public_key_token))
+ return FALSE;
+
+ return TRUE;
+}
static MonoAssembly*
search_loaded (MonoAssemblyName* aname)
{
GList *tmp;
MonoAssembly *ass;
+ GList *loading;
+
+ ass = mono_assembly_invoke_search_hook (aname);
+ if (ass)
+ return ass;
- for (tmp = loaded_assemblies; tmp; tmp = tmp->next) {
+ /*
+ * The assembly might be under load by this thread. In this case, it is
+ * safe to return an incomplete instance to prevent loops.
+ */
+ loading = g_hash_table_lookup (assemblies_loading, GetCurrentThread ());
+ for (tmp = loading; tmp; tmp = tmp->next) {
ass = tmp->data;
- /* we just compare the name, but later we'll do all the checks */
- /* g_print ("compare %s %s\n", aname->name, ass->aname.name); */
- if (strcmp (aname->name, ass->aname.name))
+ if (!mono_assembly_names_equal (aname, &ass->aname))
continue;
- /* g_print ("success\n"); */
+
return ass;
}
- return NULL;
-}
-/**
- * g_concat_dir_and_file:
- * @dir: directory name
- * @file: filename.
- *
- * returns a new allocated string that is the concatenation of dir and file,
- * takes care of the exact details for concatenating them.
- */
-static char *
-g_concat_dir_and_file (const char *dir, const char *file)
-{
- g_return_val_if_fail (dir != NULL, NULL);
- g_return_val_if_fail (file != NULL, NULL);
-
- /*
- * If the directory name doesn't have a / on the end, we need
- * to add one so we get a proper path to the file
- */
- if (dir [strlen(dir) - 1] != G_DIR_SEPARATOR)
- return g_strconcat (dir, G_DIR_SEPARATOR_S, file, NULL);
- else
- return g_strconcat (dir, file, NULL);
+ return NULL;
}
static MonoAssembly *
@@ -104,7 +181,7 @@ load_in_path (const char *basename, const char** search_path, MonoImageOpenStatu
MonoAssembly *result;
for (i = 0; search_path [i]; ++i) {
- fullpath = g_concat_dir_and_file (search_path [i], basename);
+ fullpath = g_build_filename (search_path [i], basename, NULL);
result = mono_assembly_open (fullpath, status);
g_free (fullpath);
if (result)
@@ -128,59 +205,422 @@ mono_assembly_setrootdir (const char *root_dir)
/*
* Override the MONO_ASSEMBLIES directory configured at compile time.
*/
+ /* Leak if called more than once */
default_path [0] = g_strdup (root_dir);
}
-static void
-load_references (MonoImage *image, MonoImageOpenStatus *status) {
+G_CONST_RETURN gchar *
+mono_assembly_getrootdir (void)
+{
+ return default_path [0];
+}
+
+/**
+ * mono_assemblies_init:
+ *
+ * Initialize global variables used by this module.
+ */
+void
+mono_assemblies_init (void)
+{
+#ifdef PLATFORM_WIN32
+ mono_set_rootdir ();
+#endif
+
+ check_path_env ();
+ check_extra_gac_path_env ();
+
+ InitializeCriticalSection (&assemblies_mutex);
+
+ assemblies_loading = g_hash_table_new (NULL, NULL);
+}
+
+gboolean
+mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname)
+{
+ MonoTableInfo *t = &image->tables [MONO_TABLE_ASSEMBLY];
+ guint32 cols [MONO_ASSEMBLY_SIZE];
+
+ if (!t->rows)
+ return FALSE;
+
+ mono_metadata_decode_row (t, 0, cols, MONO_ASSEMBLY_SIZE);
+
+ aname->hash_len = 0;
+ aname->hash_value = NULL;
+ aname->name = mono_metadata_string_heap (image, cols [MONO_ASSEMBLY_NAME]);
+ aname->culture = mono_metadata_string_heap (image, cols [MONO_ASSEMBLY_CULTURE]);
+ aname->flags = cols [MONO_ASSEMBLY_FLAGS];
+ aname->major = cols [MONO_ASSEMBLY_MAJOR_VERSION];
+ aname->minor = cols [MONO_ASSEMBLY_MINOR_VERSION];
+ aname->build = cols [MONO_ASSEMBLY_BUILD_NUMBER];
+ aname->revision = cols [MONO_ASSEMBLY_REV_NUMBER];
+ aname->hash_alg = cols [MONO_ASSEMBLY_HASH_ALG];
+ if (cols [MONO_ASSEMBLY_PUBLIC_KEY]) {
+ gchar* token = g_malloc (8);
+ gchar* encoded;
+ int len;
+
+ aname->public_key = mono_metadata_blob_heap (image, cols [MONO_ASSEMBLY_PUBLIC_KEY]);
+ len = mono_metadata_decode_blob_size (aname->public_key, (const char**)&aname->public_key);
+
+ mono_digest_get_public_token (token, aname->public_key, len);
+ encoded = encode_public_tok (token, 8);
+ g_strlcpy (aname->public_key_token, encoded, MONO_PUBLIC_KEY_TOKEN_LENGTH);
+
+ g_free (encoded);
+ g_free (token);
+ }
+ else {
+ aname->public_key = NULL;
+ memset (aname->public_key_token, 0, MONO_PUBLIC_KEY_TOKEN_LENGTH);
+ }
+
+ if (cols [MONO_ASSEMBLY_PUBLIC_KEY]) {
+ aname->public_key = mono_metadata_blob_heap (image, cols [MONO_ASSEMBLY_PUBLIC_KEY]);
+ }
+ else
+ aname->public_key = 0;
+
+ return TRUE;
+}
+
+static gchar*
+assemblyref_public_tok (MonoImage *image, guint32 key_index, guint32 flags)
+{
+ const gchar *public_tok;
+ int len;
+
+ public_tok = mono_metadata_blob_heap (image, key_index);
+ len = mono_metadata_decode_blob_size (public_tok, &public_tok);
+
+ if (flags & ASSEMBLYREF_FULL_PUBLIC_KEY_FLAG) {
+ gchar token [8];
+ mono_digest_get_public_token (token, public_tok, len);
+ return encode_public_tok (token, 8);
+ }
+
+ return encode_public_tok (public_tok, len);
+}
+
+void
+mono_assembly_load_reference (MonoImage *image, int index)
+{
MonoTableInfo *t;
guint32 cols [MONO_ASSEMBLYREF_SIZE];
const char *hash;
- int i;
+ MonoAssembly *reference;
+ MonoAssemblyName aname;
+ MonoImageOpenStatus status;
- if (image->references)
+ /*
+ * image->references is shared between threads, so we need to access
+ * it inside a critical section.
+ */
+ EnterCriticalSection (&assemblies_mutex);
+ reference = image->references [index];
+ LeaveCriticalSection (&assemblies_mutex);
+ if (reference)
return;
t = &image->tables [MONO_TABLE_ASSEMBLYREF];
- image->references = g_new0 (MonoAssembly *, t->rows + 1);
+ mono_metadata_decode_row (t, index, cols, MONO_ASSEMBLYREF_SIZE);
+
+ hash = mono_metadata_blob_heap (image, cols [MONO_ASSEMBLYREF_HASH_VALUE]);
+ aname.hash_len = mono_metadata_decode_blob_size (hash, &hash);
+ aname.hash_value = hash;
+ aname.name = mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_NAME]);
+ aname.culture = mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_CULTURE]);
+ aname.flags = cols [MONO_ASSEMBLYREF_FLAGS];
+ aname.major = cols [MONO_ASSEMBLYREF_MAJOR_VERSION];
+ aname.minor = cols [MONO_ASSEMBLYREF_MINOR_VERSION];
+ aname.build = cols [MONO_ASSEMBLYREF_BUILD_NUMBER];
+ aname.revision = cols [MONO_ASSEMBLYREF_REV_NUMBER];
- /*
- * Load any assemblies this image references
- */
- for (i = 0; i < t->rows; i++) {
- MonoAssemblyName aname;
+ if (cols [MONO_ASSEMBLYREF_PUBLIC_KEY]) {
+ gchar *token = assemblyref_public_tok (image, cols [MONO_ASSEMBLYREF_PUBLIC_KEY], aname.flags);
+ g_strlcpy (aname.public_key_token, token, MONO_PUBLIC_KEY_TOKEN_LENGTH);
+ g_free (token);
+ } else {
+ memset (aname.public_key_token, 0, MONO_PUBLIC_KEY_TOKEN_LENGTH);
+ }
- mono_metadata_decode_row (t, i, cols, MONO_ASSEMBLYREF_SIZE);
-
- hash = mono_metadata_blob_heap (image, cols [MONO_ASSEMBLYREF_HASH_VALUE]);
- aname.hash_len = mono_metadata_decode_blob_size (hash, &hash);
- aname.hash_value = hash;
- aname.name = mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_NAME]);
- aname.culture = mono_metadata_string_heap (image, cols [MONO_ASSEMBLYREF_CULTURE]);
- aname.flags = cols [MONO_ASSEMBLYREF_FLAGS];
- aname.major = cols [MONO_ASSEMBLYREF_MAJOR_VERSION];
- aname.minor = cols [MONO_ASSEMBLYREF_MINOR_VERSION];
- aname.build = cols [MONO_ASSEMBLYREF_BUILD_NUMBER];
- aname.revision = cols [MONO_ASSEMBLYREF_REV_NUMBER];
-
- image->references [i] = mono_assembly_load (&aname, image->assembly->basedir, status);
-
- if (image->references [i] == NULL){
- int j;
+ reference = mono_assembly_load (&aname, image->assembly->basedir, &status);
+
+ if (reference == NULL){
+ /*
+ ** Temporary work around: any System.* which are 3300 build, will get
+ ** remapped, this is to keep old applications running that might have
+ ** been linked against our 5000 API, before we were strongnamed, and
+ ** hence were labeled as 3300 builds by reflection.c
+ */
+ if (aname.build == 3300 && strncmp (aname.name, "System", 6) == 0){
+ aname.build = 5000;
+
+ reference = mono_assembly_load (&aname, image->assembly->basedir, &status);
+ }
+ if (reference != NULL){
+ if (g_getenv ("MONO_SILENT_WARNING") == NULL)
+ g_printerr ("Compat mode: the request from %s to load %s was remapped (http://www.go-mono.com/remap.html)\n",
+ image->name, aname.name);
+
+ } else {
+ char *extra_msg = g_strdup ("");
+
+ if (status == MONO_IMAGE_ERROR_ERRNO) {
+ extra_msg = g_strdup_printf ("System error: %s\n", strerror (errno));
+ } else if (status == MONO_IMAGE_MISSING_ASSEMBLYREF) {
+ extra_msg = g_strdup ("Cannot find an assembly referenced from this one.\n");
+ } else if (status == MONO_IMAGE_IMAGE_INVALID) {
+ extra_msg = g_strdup ("The file exists but is not a valid assembly.\n");
+ }
- for (j = 0; j < i; j++)
- mono_assembly_close (image->references [j]);
- g_free (image->references);
- image->references = NULL;
-
- g_warning ("Could not find assembly %s", aname.name);
- *status = MONO_IMAGE_MISSING_ASSEMBLYREF;
- return;
+ g_warning ("Could not find assembly %s, references from %s (assemblyref_index=%d)\n"
+ " Major/Minor: %d,%d\n"
+ " Build: %d,%d\n"
+ " Token: %s\n%s",
+ aname.name, image->name, index,
+ aname.major, aname.minor, aname.build, aname.revision,
+ aname.public_key_token, extra_msg);
+ g_free (extra_msg);
+ }
+ }
+
+ if (reference == NULL)
+ /* Flag as not found */
+ reference = (gpointer)-1;
+
+ EnterCriticalSection (&assemblies_mutex);
+ if (!image->references [index])
+ image->references [index] = reference;
+ LeaveCriticalSection (&assemblies_mutex);
+
+ if (image->references [index] != reference) {
+ /* Somebody loaded it before us */
+ mono_assembly_close (reference);
+ }
+}
+
+void
+mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status)
+{
+ MonoTableInfo *t;
+ int i;
+
+ *status = MONO_IMAGE_OK;
+
+ t = &image->tables [MONO_TABLE_ASSEMBLYREF];
+
+ image->references = g_new0 (MonoAssembly *, t->rows + 1);
+
+ /* resolve assembly references for modules */
+ for (i = 0; i < image->module_count; i++){
+ if (image->modules [i]) {
+ image->modules [i]->assembly = image->assembly;
+ mono_assembly_load_references (image->modules [i], status);
+ }
+ }
+}
+
+typedef struct AssemblyLoadHook AssemblyLoadHook;
+struct AssemblyLoadHook {
+ AssemblyLoadHook *next;
+ MonoAssemblyLoadFunc func;
+ gpointer user_data;
+};
+
+AssemblyLoadHook *assembly_load_hook = NULL;
+
+void
+mono_assembly_invoke_load_hook (MonoAssembly *ass)
+{
+ AssemblyLoadHook *hook;
+
+ for (hook = assembly_load_hook; hook; hook = hook->next) {
+ hook->func (ass, hook->user_data);
+ }
+}
+
+void
+mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, gpointer user_data)
+{
+ AssemblyLoadHook *hook;
+
+ g_return_if_fail (func != NULL);
+
+ hook = g_new0 (AssemblyLoadHook, 1);
+ hook->func = func;
+ hook->user_data = user_data;
+ hook->next = assembly_load_hook;
+ assembly_load_hook = hook;
+}
+
+typedef struct AssemblySearchHook AssemblySearchHook;
+struct AssemblySearchHook {
+ AssemblySearchHook *next;
+ MonoAssemblySearchFunc func;
+ gpointer user_data;
+};
+
+AssemblySearchHook *assembly_search_hook = NULL;
+
+MonoAssembly*
+mono_assembly_invoke_search_hook (MonoAssemblyName *aname)
+{
+ AssemblySearchHook *hook;
+
+ for (hook = assembly_search_hook; hook; hook = hook->next) {
+ MonoAssembly *ass = hook->func (aname, hook->user_data);
+ if (ass)
+ return ass;
+ }
+
+ return NULL;
+}
+
+void
+mono_install_assembly_search_hook (MonoAssemblySearchFunc func, gpointer user_data)
+{
+ AssemblySearchHook *hook;
+
+ g_return_if_fail (func != NULL);
+
+ hook = g_new0 (AssemblySearchHook, 1);
+ hook->func = func;
+ hook->user_data = user_data;
+ hook->next = assembly_search_hook;
+ assembly_search_hook = hook;
+}
+
+typedef struct AssemblyPreLoadHook AssemblyPreLoadHook;
+struct AssemblyPreLoadHook {
+ AssemblyPreLoadHook *next;
+ MonoAssemblyPreLoadFunc func;
+ gpointer user_data;
+};
+
+AssemblyPreLoadHook *assembly_preload_hook = NULL;
+
+static MonoAssembly *
+invoke_assembly_preload_hook (MonoAssemblyName *aname, gchar **assemblies_path)
+{
+ AssemblyPreLoadHook *hook;
+ MonoAssembly *assembly;
+
+ for (hook = assembly_preload_hook; hook; hook = hook->next) {
+ assembly = hook->func (aname, assemblies_path, hook->user_data);
+ if (assembly != NULL)
+ return assembly;
+ }
+
+ return NULL;
+}
+
+void
+mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func, gpointer user_data)
+{
+ AssemblyPreLoadHook *hook;
+
+ g_return_if_fail (func != NULL);
+
+ hook = g_new0 (AssemblyPreLoadHook, 1);
+ hook->func = func;
+ hook->user_data = user_data;
+ hook->next = assembly_preload_hook;
+ assembly_preload_hook = hook;
+}
+
+static gchar *
+absolute_dir (const gchar *filename)
+{
+ gchar *cwd;
+ gchar *mixed;
+ gchar **parts;
+ gchar *part;
+ GList *list, *tmp;
+ GString *result;
+ gchar *res;
+ gint i;
+
+ if (g_path_is_absolute (filename))
+ return g_path_get_dirname (filename);
+
+ cwd = g_get_current_dir ();
+ mixed = g_build_filename (cwd, filename, NULL);
+ parts = g_strsplit (mixed, G_DIR_SEPARATOR_S, 0);
+ g_free (mixed);
+ g_free (cwd);
+
+ list = NULL;
+ for (i = 0; (part = parts [i]) != NULL; i++) {
+ if (!strcmp (part, "."))
+ continue;
+
+ if (!strcmp (part, "..")) {
+ if (list && list->next) /* Don't remove root */
+ list = g_list_delete_link (list, list);
+ } else {
+ list = g_list_prepend (list, part);
+ }
+ }
+
+ result = g_string_new ("");
+ list = g_list_reverse (list);
+
+ /* Ignores last data pointer, which should be the filename */
+ for (tmp = list; tmp && tmp->next != NULL; tmp = tmp->next)
+ if (tmp->data)
+ g_string_append_printf (result, "%s%c", (char *) tmp->data,
+ G_DIR_SEPARATOR);
+
+ res = result->str;
+ g_string_free (result, FALSE);
+ g_list_free (list);
+ g_strfreev (parts);
+ if (*res == '\0') {
+ g_free (res);
+ return g_strdup (".");
+ }
+
+ return res;
+}
+
+static MonoImage*
+do_mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
+{
+ MonoImage *image = NULL;
+#ifdef WITH_BUNDLE
+ int i;
+ char *name = g_path_get_basename (filename);
+ char *dot = strrchr (name, '.');
+ GList *tmp;
+ MonoAssembly *ass;
+
+ if (dot)
+ *dot = 0;
+ /* we do a very simple search for bundled assemblies: it's not a general
+ * purpose assembly loading mechanism.
+ */
+ EnterCriticalSection (&assemblies_mutex);
+ for (i = 0; !image && bundled_assemblies [i]; ++i) {
+ if (strcmp (bundled_assemblies [i]->name, name) == 0) {
+ image = mono_image_open_from_data ((char*)bundled_assemblies [i]->data, bundled_assemblies [i]->size, FALSE, status);
+ break;
}
}
- image->references [i] = NULL;
+ LeaveCriticalSection (&assemblies_mutex);
+ g_free (name);
+ if (image) {
+ mono_image_addref (image);
+ return image;
+ }
+#endif
+ EnterCriticalSection (&assemblies_mutex);
+ image = mono_image_open (filename, status);
+ LeaveCriticalSection (&assemblies_mutex);
+ return image;
}
/**
@@ -197,13 +637,10 @@ load_references (MonoImage *image, MonoImageOpenStatus *status) {
MonoAssembly *
mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
{
- MonoAssembly *ass, *ass2;
MonoImage *image;
- MonoTableInfo *t;
- guint32 cols [MONO_ASSEMBLY_SIZE];
- int i;
- char *base_dir;
+ MonoAssembly *ass;
MonoImageOpenStatus def_status;
+ gchar *fname;
g_return_val_if_fail (filename != NULL, NULL);
@@ -211,16 +648,92 @@ mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
status = &def_status;
*status = MONO_IMAGE_OK;
- /* g_print ("file loading %s\n", filename); */
- image = mono_image_open (filename, status);
+ if (strncmp (filename, "file://", 7) == 0) {
+ GError *error = NULL;
+ gchar *uri = (gchar *) filename;
+ gchar *tmpuri;
+
+ /*
+ * MS allows file://c:/... and fails on file://localhost/c:/...
+ * They also throw an IndexOutOfRangeException if "file://"
+ */
+ if (uri [7] != '/')
+ uri = g_strdup_printf ("file:///%s", uri + 7);
+
+ tmpuri = uri;
+ uri = mono_escape_uri_string (tmpuri);
+ fname = g_filename_from_uri (uri, NULL, &error);
+ g_free (uri);
+
+ if (tmpuri != filename)
+ g_free (tmpuri);
+
+ if (error != NULL) {
+ g_warning ("%s\n", error->message);
+ g_error_free (error);
+ fname = g_strdup (filename);
+ }
+ } else {
+ fname = g_strdup (filename);
+ }
+
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY,
+ "Assembly Loader probing location: '%s'.", filename);
+ image = do_mono_assembly_open (fname, status);
if (!image){
*status = MONO_IMAGE_ERROR_ERRNO;
+ g_free (fname);
return NULL;
}
- base_dir = g_path_get_dirname (filename);
-
+ ass = mono_assembly_load_from (image, fname, status);
+
+ if (ass) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY,
+ "Assembly Loader loaded assembly from location: '%s'.", filename);
+ mono_config_for_assembly (ass->image);
+ }
+
+ g_free (fname);
+
+ return ass;
+}
+
+MonoAssembly *
+mono_assembly_load_from (MonoImage *image, const char*fname,
+ MonoImageOpenStatus *status)
+{
+ MonoAssembly *ass, *ass2;
+ char *base_dir;
+ GList *loading;
+
+#if defined (PLATFORM_WIN32)
+ {
+ gchar *tmp_fn;
+ int i;
+
+ tmp_fn = g_strdup (fname);
+ for (i = strlen (tmp_fn) - 1; i >= 0; i--) {
+ if (tmp_fn [i] == '/')
+ tmp_fn [i] = '\\';
+ }
+
+ base_dir = absolute_dir (tmp_fn);
+ g_free (tmp_fn);
+ }
+#else
+ base_dir = absolute_dir (fname);
+#endif
+
+ /*
+ * To avoid deadlocks and scalability problems, we load assemblies outside
+ * the assembly lock. This means that multiple threads might try to load
+ * the same assembly at the same time. The first one to load it completely
+ * "wins", the other threads free their copy and use the one loaded by
+ * the winning thread.
+ */
+
/*
* Create assembly struct, and enter it into the assembly cache
*/
@@ -228,120 +741,303 @@ mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
ass->basedir = base_dir;
ass->image = image;
- image->assembly = ass;
+ mono_assembly_fill_assembly_name (image, &ass->aname);
- t = &image->tables [MONO_TABLE_ASSEMBLY];
- if (t->rows) {
- mono_metadata_decode_row (t, 0, cols, MONO_ASSEMBLY_SIZE);
-
- ass->aname.hash_len = 0;
- ass->aname.hash_value = NULL;
- ass->aname.name = mono_metadata_string_heap (image, cols [MONO_ASSEMBLY_NAME]);
- ass->aname.culture = mono_metadata_string_heap (image, cols [MONO_ASSEMBLY_CULTURE]);
- ass->aname.flags = cols [MONO_ASSEMBLY_FLAGS];
- ass->aname.major = cols [MONO_ASSEMBLY_MAJOR_VERSION];
- ass->aname.minor = cols [MONO_ASSEMBLY_MINOR_VERSION];
- ass->aname.build = cols [MONO_ASSEMBLY_BUILD_NUMBER];
- ass->aname.revision = cols [MONO_ASSEMBLY_REV_NUMBER];
-
- /* avoid loading the same assembly twixe for now... */
+ /*
+ * Atomically search the loaded list and add ourselves to it if necessary.
+ */
+ EnterCriticalSection (&assemblies_mutex);
+ if (ass->aname.name)
+ /* avoid loading the same assembly twice for now... */
if ((ass2 = search_loaded (&ass->aname))) {
g_free (ass);
g_free (base_dir);
+ mono_image_close (image);
*status = MONO_IMAGE_OK;
+ LeaveCriticalSection (&assemblies_mutex);
return ass2;
}
- }
+ loading = g_hash_table_lookup (assemblies_loading, GetCurrentThread ());
+ loading = g_list_prepend (loading, ass);
+ g_hash_table_insert (assemblies_loading, GetCurrentThread (), loading);
+ LeaveCriticalSection (&assemblies_mutex);
- /* register right away to prevent loops */
- loaded_assemblies = g_list_prepend (loaded_assemblies, ass);
+ image->assembly = ass;
+
+ mono_assembly_load_references (image, status);
+
+ EnterCriticalSection (&assemblies_mutex);
- load_references (image, status);
+ loading = g_hash_table_lookup (assemblies_loading, GetCurrentThread ());
+ loading = g_list_remove (loading, ass);
+ if (loading == NULL)
+ /* Prevent memory leaks */
+ g_hash_table_remove (assemblies_loading, GetCurrentThread ());
+ else
+ g_hash_table_insert (assemblies_loading, GetCurrentThread (), loading);
if (*status != MONO_IMAGE_OK) {
+ LeaveCriticalSection (&assemblies_mutex);
mono_assembly_close (ass);
return NULL;
}
-
- t = &image->tables [MONO_TABLE_MODULEREF];
- ass->modules = g_new0 (MonoImage *, t->rows);
- for (i = 0; i < t->rows; i++){
- char *module_ref;
- const char *name;
- guint32 cols [MONO_MODULEREF_SIZE];
-
- mono_metadata_decode_row (t, i, cols, MONO_MODULEREF_SIZE);
- name = mono_metadata_string_heap (image, cols [MONO_MODULEREF_NAME]);
- module_ref = g_concat_dir_and_file (base_dir, name);
- ass->modules [i] = mono_image_open (module_ref, status);
- if (ass->modules [i]) {
- ass->modules [i]->assembly = ass;
- load_references (ass->modules [i], status);
+
+ if (ass->aname.name) {
+ ass2 = search_loaded (&ass->aname);
+ if (ass2) {
+ /* Somebody else has loaded the assembly before us */
+ LeaveCriticalSection (&assemblies_mutex);
+ mono_assembly_close (ass);
+ return ass2;
}
- /*
- * FIXME: what do we do here? it could be a native dll...
- * We should probably do lazy-loading of modules.
- */
- *status = MONO_IMAGE_OK;
- g_free (module_ref);
}
- g_free (base_dir);
+ loaded_assemblies = g_list_prepend (loaded_assemblies, ass);
+ LeaveCriticalSection (&assemblies_mutex);
+
+ mono_assembly_invoke_load_hook (ass);
+
return ass;
}
+static MonoAssembly*
+probe_for_partial_name (const char *basepath, const char *fullname, MonoImageOpenStatus *status)
+{
+ MonoAssembly *res = NULL;
+ gchar *fullpath;
+ GDir *dirhandle;
+ const char* direntry;
+
+ dirhandle = g_dir_open (basepath, 0, NULL);
+ if (!dirhandle)
+ return NULL;
+
+ while ((direntry = g_dir_read_name (dirhandle))) {
+ fullpath = g_build_path (G_DIR_SEPARATOR_S, basepath, direntry, fullname, NULL);
+ res = mono_assembly_open (fullpath, status);
+ g_free (fullpath);
+ if (res)
+ break;
+ }
+ g_dir_close (dirhandle);
+
+ return res;
+}
+
+MonoAssembly*
+mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status)
+{
+ MonoAssembly *res;
+ MonoAssemblyName aname;
+ gchar *fullname, *gacpath;
+ gchar **paths;
+
+ memset (&aname, 0, sizeof (MonoAssemblyName));
+ aname.name = name;
+
+ res = invoke_assembly_preload_hook (&aname, assemblies_path);
+ if (res) {
+ res->in_gac = FALSE;
+ return res;
+ }
+
+ res = mono_assembly_loaded (&aname);
+ if (res)
+ return res;
+
+ fullname = g_strdup_printf ("%s.dll", name);
+
+ if (extra_gac_paths) {
+ paths = extra_gac_paths;
+ while (!res && *paths) {
+ gacpath = g_build_path (G_DIR_SEPARATOR_S, *paths, "lib", "mono", "gac", name, NULL);
+ res = probe_for_partial_name (gacpath, fullname, status);
+ g_free (gacpath);
+ paths++;
+ }
+ }
+
+ if (res) {
+ res->in_gac = TRUE;
+ g_free (fullname);
+ return res;
+
+ }
+
+ gacpath = g_build_path (G_DIR_SEPARATOR_S, mono_assembly_getrootdir (), "mono", "gac", name, NULL);
+ res = probe_for_partial_name (gacpath, fullname, status);
+ g_free (gacpath);
+
+ if (res)
+ res->in_gac = TRUE;
+
+ g_free (fullname);
+
+ return res;
+}
+
+/**
+ * mono_assembly_load_from_gac
+ *
+ * @aname: The assembly name object
+ */
+static MonoAssembly*
+mono_assembly_load_from_gac (MonoAssemblyName *aname, gchar *filename, MonoImageOpenStatus *status)
+{
+ MonoAssembly *result = NULL;
+ gchar *name, *version, *culture, *fullpath, *subpath;
+ gint32 len;
+ gchar **paths;
+
+ if (aname->public_key_token [0] == 0) {
+ return NULL;
+ }
+
+ if (strstr (aname->name, ".dll")) {
+ len = strlen (filename) - 4;
+ name = g_malloc (len);
+ strncpy (name, aname->name, len);
+ } else {
+ name = g_strdup (aname->name);
+ }
+
+ if (aname->culture) {
+ culture = g_strdup (aname->culture);
+ g_strdown (culture);
+ } else {
+ culture = g_strdup ("");
+ }
+
+ version = g_strdup_printf ("%d.%d.%d.%d_%s_%s", aname->major,
+ aname->minor, aname->build, aname->revision,
+ culture, aname->public_key_token);
+
+ subpath = g_build_path (G_DIR_SEPARATOR_S, name, version, filename, NULL);
+ g_free (name);
+ g_free (version);
+ g_free (culture);
+
+ if (extra_gac_paths) {
+ paths = extra_gac_paths;
+ while (!result && *paths) {
+ fullpath = g_build_path (G_DIR_SEPARATOR_S, *paths, "lib", "mono", "gac", subpath, NULL);
+ result = mono_assembly_open (fullpath, status);
+ g_free (fullpath);
+ paths++;
+ }
+ }
+
+ if (result) {
+ result->in_gac = TRUE;
+ g_free (subpath);
+ return result;
+ }
+
+ fullpath = g_build_path (G_DIR_SEPARATOR_S, mono_assembly_getrootdir (),
+ "mono", "gac", subpath, NULL);
+ result = mono_assembly_open (fullpath, status);
+ g_free (fullpath);
+
+ if (result)
+ result->in_gac = TRUE;
+
+ g_free (subpath);
+
+ return result;
+}
+
+
MonoAssembly*
mono_assembly_load (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status)
{
MonoAssembly *result;
char *fullpath, *filename;
- check_env ();
+ result = invoke_assembly_preload_hook (aname, assemblies_path);
+ if (result) {
+ result->in_gac = FALSE;
+ return result;
+ }
+
+ result = mono_assembly_loaded (aname);
+ if (result)
+ return result;
/* g_print ("loading %s\n", aname->name); */
/* special case corlib */
- if ((strcmp (aname->name, "mscorlib") == 0) || (strcmp (aname->name, "corlib") == 0)) {
+ if (strcmp (aname->name, "mscorlib") == 0) {
+ char *corlib_file;
if (corlib) {
/* g_print ("corlib already loaded\n"); */
return corlib;
}
/* g_print ("corlib load\n"); */
if (assemblies_path) {
- corlib = load_in_path (CORLIB_NAME, (const char**)assemblies_path, status);
+ corlib = load_in_path ("mscorlib.dll", (const char**)assemblies_path, status);
if (corlib)
return corlib;
}
- corlib = load_in_path (CORLIB_NAME, default_path, status);
+ corlib = load_in_path ("mscorlib.dll", default_path, status);
+
+ if (corlib)
+ return corlib;
+
+ /* Load corlib from mono/<version> */
+
+ corlib_file = g_build_filename ("mono", mono_get_framework_version (), "mscorlib.dll", NULL);
+ if (assemblies_path) {
+ corlib = load_in_path (corlib_file, (const char**)assemblies_path, status);
+ if (corlib) {
+ g_free (corlib_file);
+ return corlib;
+ }
+ }
+ corlib = load_in_path (corlib_file, default_path, status);
+ g_free (corlib_file);
+
return corlib;
}
- result = search_loaded (aname);
- if (result)
- return result;
- /* g_print ("%s not found in cache\n", aname->name); */
+
if (strstr (aname->name, ".dll"))
filename = g_strdup (aname->name);
else
filename = g_strconcat (aname->name, ".dll", NULL);
+
+ result = mono_assembly_load_from_gac (aname, filename, status);
+ if (result) {
+ g_free (filename);
+ return result;
+ }
+
if (basedir) {
- fullpath = g_concat_dir_and_file (basedir, filename);
+ fullpath = g_build_filename (basedir, filename, NULL);
result = mono_assembly_open (fullpath, status);
g_free (fullpath);
if (result) {
+ result->in_gac = FALSE;
g_free (filename);
return result;
}
}
- if (assemblies_path) {
- result = load_in_path (filename, (const char**)assemblies_path, status);
- if (result) {
- g_free (filename);
- return result;
- }
- }
+
result = load_in_path (filename, default_path, status);
+ if (result)
+ result->in_gac = FALSE;
g_free (filename);
return result;
}
+MonoAssembly*
+mono_assembly_loaded (MonoAssemblyName *aname)
+{
+ MonoAssembly *res;
+
+ EnterCriticalSection (&assemblies_mutex);
+ res = search_loaded (aname);
+ LeaveCriticalSection (&assemblies_mutex);
+
+ return res;
+}
+
void
mono_assembly_close (MonoAssembly *assembly)
{
@@ -350,29 +1046,56 @@ mono_assembly_close (MonoAssembly *assembly)
g_return_if_fail (assembly != NULL);
- if (--assembly->ref_count != 0)
+ EnterCriticalSection (&assemblies_mutex);
+ if (--assembly->ref_count != 0) {
+ LeaveCriticalSection (&assemblies_mutex);
return;
-
+ }
loaded_assemblies = g_list_remove (loaded_assemblies, assembly);
+ LeaveCriticalSection (&assemblies_mutex);
image = assembly->image;
if (image->references) {
for (i = 0; image->references [i] != NULL; i++)
- mono_image_close (image->references [i]->image);
+ if (image->references [i] && (image->references [i] != (gpointer)-1))
+ mono_image_close (image->references [i]->image);
g_free (image->references);
}
-
+
mono_image_close (assembly->image);
g_free (assembly->basedir);
g_free (assembly);
}
+MonoImage*
+mono_assembly_load_module (MonoAssembly *assembly, guint32 idx)
+{
+ MonoImageOpenStatus status;
+ MonoImage *module;
+
+ module = mono_image_load_file_for_image (assembly->image, idx);
+ if (module)
+ mono_assembly_load_references (module, &status);
+
+ return module;
+}
+
void
mono_assembly_foreach (GFunc func, gpointer user_data)
{
- /* In the future this can do locking of loaded_assemblies */
+ GList *copy;
+
+ /*
+ * We make a copy of the list to avoid calling the callback inside the
+ * lock, which could lead to deadlocks.
+ */
+ EnterCriticalSection (&assemblies_mutex);
+ copy = g_list_copy (loaded_assemblies);
+ LeaveCriticalSection (&assemblies_mutex);
g_list_foreach (loaded_assemblies, func, user_data);
+
+ g_list_free (copy);
}
/* Holds the assembly of the application, for
@@ -391,3 +1114,9 @@ mono_assembly_get_main (void)
{
return(main_assembly);
}
+
+MonoImage*
+mono_assembly_get_image (MonoAssembly *assembly)
+{
+ return assembly->image;
+}
diff --git a/mono/metadata/assembly.h b/mono/metadata/assembly.h
index 6551e54a8b3..3dfeed5c839 100644
--- a/mono/metadata/assembly.h
+++ b/mono/metadata/assembly.h
@@ -5,17 +5,55 @@
#include <mono/metadata/image.h>
-#define CORLIB_NAME "corlib.dll"
-
+void mono_assemblies_init (void);
MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status);
+MonoAssembly* mono_assembly_load_from (MonoImage *image, const char *fname,
+ MonoImageOpenStatus *status);
+
+MonoAssembly* mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status);
+
+MonoAssembly* mono_assembly_loaded (MonoAssemblyName *aname);
+void mono_assembly_load_reference (MonoImage *image, int index);
+void mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status);
+MonoImage* mono_assembly_load_module (MonoAssembly *assembly, guint32 idx);
void mono_assembly_close (MonoAssembly *assembly);
void mono_assembly_setrootdir (const char *root_dir);
+G_CONST_RETURN gchar *mono_assembly_getrootdir (void);
void mono_assembly_foreach (GFunc func, gpointer user_data);
void mono_assembly_set_main (MonoAssembly *assembly);
MonoAssembly *mono_assembly_get_main (void);
+MonoImage *mono_assembly_get_image (MonoAssembly *assembly);
+gboolean mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname);
+gboolean mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r);
+
+/* Installs a function which is called each time a new assembly is loaded. */
+typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, gpointer user_data);
+void mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, gpointer user_data);
+
+/*
+ * Installs a new function which is used to search the list of loaded
+ * assemblies for a given assembly name.
+ */
+typedef MonoAssembly *(*MonoAssemblySearchFunc) (MonoAssemblyName *aname, gpointer user_data);
+void mono_install_assembly_search_hook (MonoAssemblySearchFunc func, gpointer user_data);
+
+MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname);
+
+/* Installs a function which is called before a new assembly is loaded
+ * The hook are invoked from last hooked to first. If any of them returns
+ * a non-null value, that will be the value returned in mono_assembly_load */
+typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
+ gchar **assemblies_path,
+ gpointer user_data);
+
+void mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func,
+ gpointer user_data);
+
+void mono_assembly_invoke_load_hook (MonoAssembly *ass);
#endif
+
diff --git a/mono/metadata/blob.h b/mono/metadata/blob.h
index 41243d76c4b..df8c8edcc98 100644
--- a/mono/metadata/blob.h
+++ b/mono/metadata/blob.h
@@ -5,10 +5,6 @@
#ifndef _MONO_METADATA_BLOB_H_
#define _MONO_METADATA_BLOB_H_
-#define SIGNATURE_HAS_THIS 0x20
-#define SIGNATURE_EXPLICIT_THIS 0x40
-#define SIGNATURE_VARARG 0x05
-
/*
* Encoding for type signatures used in the Metadata
*/
@@ -32,13 +28,16 @@ typedef enum {
MONO_TYPE_BYREF = 0x10, /* arg: <type> token */
MONO_TYPE_VALUETYPE = 0x11, /* arg: <type> token */
MONO_TYPE_CLASS = 0x12, /* arg: <type> token */
+ MONO_TYPE_VAR = 0x13, /* number */
MONO_TYPE_ARRAY = 0x14, /* type, rank, boundsCount, bound1, loCount, lo1 */
+ MONO_TYPE_GENERICINST= 0x15, /* <type> <type-arg-count> <type-1> \x{2026} <type-n> */
MONO_TYPE_TYPEDBYREF = 0x16,
MONO_TYPE_I = 0x18,
MONO_TYPE_U = 0x19,
MONO_TYPE_FNPTR = 0x1b, /* arg: full method signature */
MONO_TYPE_OBJECT = 0x1c,
MONO_TYPE_SZARRAY = 0x1d, /* 0-based one-dim-array */
+ MONO_TYPE_MVAR = 0x1e, /* number */
MONO_TYPE_CMOD_REQD = 0x1f, /* arg: typedef or typeref token */
MONO_TYPE_CMOD_OPT = 0x20, /* optional arg: typedef or typref token */
MONO_TYPE_INTERNAL = 0x21, /* CLR internal type */
diff --git a/mono/metadata/char-conversions.h b/mono/metadata/char-conversions.h
new file mode 100644
index 00000000000..271aa251dd8
--- /dev/null
+++ b/mono/metadata/char-conversions.h
@@ -0,0 +1,2004 @@
+#ifndef _MONO_METADATA_CHAR_CONVERSIONS_H_
+#define _MONO_METADATA_CHAR_CONVERSIONS_H_ 1
+
+static const guint8 CategoryData [] = {
+ 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,11,24,24,24,26,24,24,24,20,21,24,25,24,19,24,24,8,8,
+ 8,8,8,8,8,8,8,8,24,24,25,25,25,24,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24,21,27,18,27,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,20,25,21,25,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
+ 14,14,14,14,14,14,14,14,14,14,11,24,26,26,26,26,28,28,27,28,1,22,25,19,28,27,28,25,10,10,27,1,28,24,27,10,1,23,10,10,10,24,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,25,1,1,
+ 1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1,0,0,
+ 0,0,1,0,0,1,0,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,0,0,1,0,1,0,0,1,1,4,0,1,1,1,4,4,
+ 4,4,0,2,1,0,2,1,0,2,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,2,1,
+ 0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,29,29,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,29,29,3,3,3,3,3,3,3,3,3,27,27,3,
+ 3,3,3,3,3,3,27,27,27,27,27,27,27,27,27,27,27,27,27,27,3,3,27,27,27,27,27,27,27,27,27,27,27,27,27,27,3,3,3,3,3,27,27,27,27,27,27,27,27,27,
+ 3,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,5,5,5,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,27,27,29,29,29,29,3,29,29,29,24,29,29,29,29,29,
+ 27,27,0,24,0,0,0,29,0,29,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,29,1,1,0,0,0,1,1,1,29,29,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,1,1,1,1,29,29,29,29,29,29,29,29,29,29,29,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,28,5,5,5,5,29,7,7,29,29,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,29,29,0,1,29,29,0,1,29,29,29,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,29,29,0,1,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,29,3,24,24,24,24,24,24,29,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,29,24,19,29,29,29,29,29,29,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,29,5,5,5,5,5,5,5,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,29,5,5,5,24,5,24,5,5,24,5,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,4,4,4,24,24,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,24,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,24,29,29,29,24,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,
+ 3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,29,29,29,29,29,29,29,29,29,29,8,8,8,8,8,8,8,8,8,8,24,24,24,24,29,29,5,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,24,4,
+ 5,5,5,5,5,5,5,7,7,5,5,5,5,5,5,3,3,5,5,28,5,5,5,5,29,29,8,8,8,8,8,8,8,8,8,8,4,4,4,28,28,29,24,24,24,24,24,24,24,24,
+ 24,24,24,24,24,24,29,15,4,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,5,5,5,5,5,5,5,5,5,5,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,5,5,6,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,29,29,5,4,6,6,6,5,5,5,5,5,5,5,5,6,6,6,6,5,29,29,4,5,5,5,5,29,29,29,4,4,4,4,4,4,4,4,
+ 4,4,5,5,24,24,8,8,8,8,8,8,8,8,8,8,24,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,5,6,6,29,4,4,4,4,4,4,4,4,29,29,4,4,29,
+ 29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,29,4,29,29,29,4,4,4,4,29,29,5,29,6,6,6,5,5,5,
+ 5,29,29,6,6,29,29,6,6,5,29,29,29,29,29,29,29,29,29,6,29,29,29,29,4,4,29,4,4,4,5,5,29,29,8,8,8,8,8,8,8,8,8,8,4,4,26,26,10,10,
+ 10,10,10,10,28,29,29,29,29,29,29,29,5,29,29,4,4,4,4,4,4,29,29,29,29,4,4,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,29,4,4,4,4,4,4,4,29,4,4,29,4,4,29,4,4,29,29,5,29,6,6,6,5,5,29,29,29,29,5,5,29,29,5,5,5,29,29,29,29,29,29,29,29,29,29,29,4,
+ 4,4,4,29,4,29,29,29,29,29,29,29,8,8,8,8,8,8,8,8,8,8,5,5,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,5,5,6,29,4,4,4,4,4,4,4,
+ 29,4,29,4,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,29,4,4,29,4,4,4,4,4,29,29,5,4,
+ 6,6,6,5,5,5,5,5,29,5,5,6,29,6,6,5,29,29,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,29,29,29,29,29,8,8,8,8,8,8,8,8,8,8,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,5,6,6,29,4,4,4,4,4,4,4,4,29,29,4,4,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,29,4,4,29,29,4,4,4,4,29,29,5,4,6,5,6,5,5,5,29,29,29,6,6,29,29,6,6,5,29,29,29,29,29,29,
+ 29,29,5,6,29,29,29,29,4,4,29,4,4,4,29,29,29,29,8,8,8,8,8,8,8,8,8,8,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,5,6,29,4,
+ 4,4,4,4,4,29,29,29,4,4,4,29,4,4,4,4,29,29,29,4,4,29,4,29,4,4,29,29,29,4,4,29,29,29,4,4,4,29,29,29,4,4,4,4,4,4,4,4,29,4,
+ 4,4,29,29,29,29,6,6,5,6,6,29,29,29,6,6,6,29,6,6,6,5,29,29,29,29,29,29,29,29,29,6,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,8,8,8,
+ 8,8,8,8,8,8,10,10,10,29,29,29,29,29,29,29,29,29,29,29,29,29,29,6,6,6,29,4,4,4,4,4,4,4,4,29,4,4,4,29,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,29,29,29,29,5,5,5,6,6,6,6,29,5,5,5,29,5,5,5,5,
+ 29,29,29,29,29,29,29,5,5,29,29,29,29,29,29,29,29,29,4,4,29,29,29,29,8,8,8,8,8,8,8,8,8,8,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,6,6,29,4,4,4,4,4,4,4,4,29,4,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,
+ 4,4,29,4,4,4,4,4,29,29,29,29,6,5,6,6,6,6,6,29,5,6,6,29,6,6,5,5,29,29,29,29,29,29,29,6,6,29,29,29,29,29,29,29,4,29,4,4,29,29,
+ 29,29,8,8,8,8,8,8,8,8,8,8,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,6,6,29,4,4,4,4,4,4,4,4,29,4,4,4,29,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,6,6,6,5,5,5,29,29,6,6,
+ 6,29,6,6,6,5,29,29,29,29,29,29,29,29,29,6,29,29,29,29,29,29,29,29,4,4,29,29,29,29,8,8,8,8,8,8,8,8,8,8,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,6,6,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,4,29,4,29,29,4,4,4,4,4,4,4,29,29,29,5,29,29,29,29,6,6,6,5,5,5,29,5,29,6,6,6,6,6,6,
+ 6,6,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,6,6,24,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,4,4,5,5,5,5,5,5,5,29,29,29,29,26,4,4,
+ 4,4,4,4,3,5,5,5,5,5,5,5,5,24,8,8,8,8,8,8,8,8,8,8,24,24,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,29,4,29,29,4,4,29,4,29,29,4,29,29,29,29,29,29,4,4,4,4,29,4,4,4,4,4,4,4,29,4,4,4,29,4,
+ 29,4,29,29,4,4,29,4,4,4,4,5,4,4,5,5,5,5,5,5,29,5,5,4,29,29,4,4,4,4,4,29,3,29,5,5,5,5,5,5,29,29,8,8,8,8,8,8,8,8,
+ 8,8,29,29,4,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,28,28,28,24,24,24,24,24,24,
+ 24,24,24,24,24,24,24,24,24,28,28,28,28,28,5,5,28,28,28,28,28,28,8,8,8,8,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,28,5,28,5,28,5,20,21,
+ 20,21,6,6,4,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,
+ 29,29,29,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,5,5,5,5,5,24,5,5,4,4,4,4,29,29,29,29,5,5,5,5,5,5,5,5,29,5,5,5,5,5,5,5,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,29,28,28,28,28,28,28,28,28,5,28,28,28,28,28,28,29,29,28,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,29,4,4,29,6,5,5,5,5,6,5,29,29,29,
+ 5,5,6,5,29,29,29,29,29,29,8,8,8,8,8,8,8,8,8,8,24,24,24,24,24,24,4,4,4,4,4,4,6,6,5,5,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,29,29,29,29,29,
+ 29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,24,29,29,
+ 29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,29,29,29,29,29,29,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,29,4,4,4,4,29,29,4,4,4,4,4,4,4,29,4,29,4,4,
+ 4,4,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,29,4,4,4,4,
+ 29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,29,4,4,4,4,29,29,4,4,4,4,4,4,4,29,
+ 4,29,4,4,4,4,29,29,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,29,4,4,4,4,29,29,4,4,4,4,4,4,4,29,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,29,29,29,29,29,29,24,24,24,24,24,24,24,24,8,8,8,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,24,24,4,4,4,4,4,4,4,
+ 4,29,29,29,29,29,29,29,29,29,11,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,20,21,29,29,29,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,24,24,24,10,10,10,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,5,6,6,5,5,5,5,5,5,5,5,5,5,5,
+ 24,24,24,24,24,24,24,26,24,29,29,29,8,8,8,8,8,8,8,8,8,8,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,24,24,24,24,24,24,
+ 19,24,24,24,24,15,15,15,15,29,8,8,8,8,8,8,8,8,8,8,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,5,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,29,29,29,29,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
+ 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,29,29,29,29,29,29,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+ 0,0,1,1,1,1,1,1,29,29,0,0,0,0,0,0,29,29,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+ 1,1,1,1,1,1,29,29,0,0,0,0,0,0,29,29,1,1,1,1,1,1,1,1,29,0,29,0,29,0,29,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,29,29,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,
+ 1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1,1,29,1,1,0,0,0,0,2,27,1,27,27,27,1,1,1,29,1,1,0,0,0,0,2,27,27,27,1,1,1,1,29,29,
+ 1,1,0,0,0,0,29,27,27,27,1,1,1,1,1,1,1,1,0,0,0,0,0,27,27,27,29,29,1,1,1,29,1,1,0,0,0,0,2,27,27,29,11,11,11,11,11,11,11,11,
+ 11,11,11,11,15,15,15,15,19,19,19,19,19,19,24,24,22,23,20,22,22,23,20,22,24,24,24,24,24,24,24,24,12,13,15,15,15,15,15,11,24,24,24,24,24,24,24,24,24,22,
+ 23,24,24,24,24,18,18,24,24,24,25,20,21,29,24,24,24,24,24,24,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,15,15,
+ 15,15,15,15,10,29,29,29,10,10,10,10,10,10,25,25,25,20,21,1,10,10,10,10,10,10,10,10,10,10,25,25,25,20,21,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 5,5,5,5,5,5,5,5,5,5,5,5,5,7,7,7,7,5,7,7,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,
+ 0,28,28,28,28,0,28,28,1,0,0,0,1,1,0,0,0,1,28,0,28,28,28,0,0,0,0,0,28,28,28,28,28,28,0,28,0,28,0,28,0,0,0,0,28,1,0,0,28,0,
+ 1,4,4,4,4,1,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,10,10,10,10,10,10,10,10,10,10,10,10,10,9,9,9,9,9,9,
+ 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,29,29,29,29,29,29,29,29,29,29,29,29,25,25,25,25,25,28,28,28,
+ 28,28,25,25,28,28,28,28,25,28,28,25,28,28,25,28,28,28,28,28,28,28,25,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,25,25,28,28,25,28,25,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,
+ 29,29,29,29,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+ 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+ 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+ 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,
+ 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,25,25,25,25,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,25,25,28,28,28,28,28,28,
+ 28,20,21,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 10,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,25,28,28,28,28,28,28,28,28,28,25,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,
+ 29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,25,28,28,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,29,28,28,28,28,29,29,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,29,28,29,28,28,28,28,29,29,29,28,29,28,28,28,28,28,28,28,29,29,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,28,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,11,24,24,24,28,3,4,9,20,21,20,21,
+ 20,21,20,21,20,21,28,28,20,21,20,21,20,21,20,21,19,20,21,21,28,9,9,9,9,9,9,9,9,9,5,5,5,5,5,5,19,3,3,3,3,3,28,28,9,9,9,29,29,29,
+ 28,28,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,5,5,27,27,3,3,29,29,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,18,3,3,3,29,29,29,29,29,29,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,28,28,10,10,10,10,28,28,28,28,28,28,
+ 28,28,28,28,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,10,10,10,10,10,10,10,10,10,10,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,28,10,10,10,10,10,10,10,10,10,10,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,28,28,28,28,28,28,28,28,
+ 28,28,28,28,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,28,28,
+ 28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,28,28,28,28,28,28,28,28,28,28,28,28,29,28,28,28,29,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
+ 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
+ 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,1,1,1,1,1,1,1,29,29,29,29,29,29,29,29,29,29,29,29,1,1,1,1,1,29,29,29,29,29,4,5,4,4,4,4,4,4,4,4,4,4,25,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,29,4,4,4,4,4,29,4,29,4,4,29,4,4,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,20,21,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,29,29,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,29,29,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
+ 29,29,29,29,29,29,5,5,5,5,29,29,29,29,29,29,29,29,29,29,29,29,24,19,19,18,18,20,21,20,21,20,21,20,21,20,21,20,21,20,21,20,21,29,29,29,29,24,24,24,
+ 24,18,18,18,24,24,24,29,24,24,24,24,19,20,21,20,21,20,21,24,24,24,25,19,25,25,25,29,24,26,24,24,29,29,29,29,4,4,4,29,4,29,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,15,29,24,24,24,26,24,24,24,20,21,24,25,24,19,24,24,8,8,8,8,
+ 8,8,8,8,8,8,24,24,25,25,25,24,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,24,21,27,18,27,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,20,25,21,25,29,29,24,20,21,24,18,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,4,4,4,4,4,4,4,4,4,4,
+ 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,29,29,29,4,4,4,4,4,4,29,29,4,4,4,4,4,4,29,29,4,4,4,4,4,4,29,29,4,4,
+ 4,29,29,29,26,26,25,27,28,26,26,29,28,25,25,25,25,28,28,29,29,29,29,29,29,29,29,29,29,15,15,15,28,28,29,29
+};
+
+static const guint8 NumericData [] = {
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,
+ 2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,2,3,57,57,57,57,57,1,57,57,44,33,45,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,1,2,
+ 3,4,57,16,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,1,2,3,
+ 4,5,6,7,8,9,10,28,30,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,
+ 8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,33,34,35,36,37,38,39,40,41,56,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,1,2,3,4,5,6,7,8,9,10,20,21,22,23,24,25,26,27,28,32,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,17,18,19,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,0,57,57,57,4,5,6,7,8,9,57,57,57,57,57,57,0,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,42,43,46,47,48,49,50,51,52,53,54,55,1,1,2,3,4,5,6,
+ 7,8,9,10,11,12,23,28,29,30,1,2,3,4,5,6,7,8,9,10,11,12,23,28,29,30,30,31,32,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
+ 19,20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 0,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,0,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,1,2,3,4,5,6,7,8,9,57,57,57,57,57,57,57,57,57,57,57,57,57,57,10,20,21,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,1,2,3,4,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,1,2,3,4,5,6,7,8,9,10,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,
+ 57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,1,2,3,4,5,6,7,8,9,10
+};
+
+static const gdouble NumericDataValues [] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 30, 40, 50, 60, 70, 80, 90,100,500,
+ 1000, 5000, 10000, 1/2, 3/2, 5/2, 7/2, 9/2, 11/2, 13/2,
+ 15/2, 17/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5,
+ 1/6, 5/6, 1/8, 3/8, 5/8, 7/8, -1/2, -1
+};
+
+static const guint16 ToLowerDataLow [] = {
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
+ 50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95,96,97,98,99,
+ 100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,
+ 150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,224,225,226,227,228,229,230,231,
+ 232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,
+ 250,251,252,253,254,255,257,257,259,259,261,261,263,263,265,265,267,267,269,269,271,271,273,273,275,275,277,277,279,279,281,281,283,283,285,285,287,287,289,289,291,291,293,293,295,295,297,297,299,299,
+ 301,301,303,303,105,305,307,307,309,309,311,311,312,314,314,316,316,318,318,320,320,322,322,324,324,326,326,328,328,329,331,331,333,333,335,335,337,337,339,339,341,341,343,343,345,345,347,347,349,349,
+ 351,351,353,353,355,355,357,357,359,359,361,361,363,363,365,365,367,367,369,369,371,371,373,373,375,375,255,378,378,380,380,382,382,383,384,595,387,387,389,389,596,392,392,598,599,396,396,397,477,601,
+ 603,402,402,608,611,405,617,616,409,409,410,411,623,626,414,629,417,417,419,419,421,421,640,424,424,643,426,427,429,429,648,432,432,650,651,436,436,438,438,658,441,441,442,443,445,445,446,447,448,449,
+ 450,451,454,454,454,457,457,457,460,460,460,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,477,479,479,481,481,483,483,485,485,487,487,489,489,491,491,493,493,495,495,496,499,499,499,
+ 501,501,405,447,505,505,507,507,509,509,511,511,513,513,515,515,517,517,519,519,521,521,523,523,525,525,527,527,529,529,531,531,533,533,535,535,537,537,539,539,541,541,543,543,544,545,547,547,549,549,
+ 551,551,553,553,555,555,557,557,559,559,561,561,563,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,
+ 600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,
+ 650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,
+ 700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,
+ 750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,
+ 800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,
+ 850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,
+ 900,901,940,903,941,942,943,907,972,909,973,974,912,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,930,963,964,965,966,967,968,969,970,971,940,941,942,943,944,945,946,947,948,949,
+ 950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,987,987,989,989,991,991,993,993,995,995,997,997,999,999,
+ 1001,1001,1003,1003,1005,1005,1007,1007,1008,1009,1010,1011,952,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,
+ 1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,
+ 1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1121,1121,1123,1123,1125,1125,1127,1127,1129,1129,1131,1131,1133,1133,1135,1135,1137,1137,1139,1139,1141,1141,1143,1143,1145,1145,1147,1147,1149,1149,
+ 1151,1151,1153,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1165,1165,1167,1167,1169,1169,1171,1171,1173,1173,1175,1175,1177,1177,1179,1179,1181,1181,1183,1183,1185,1185,1187,1187,1189,1189,1191,1191,1193,1193,1195,1195,1197,1197,1199,1199,
+ 1201,1201,1203,1203,1205,1205,1207,1207,1209,1209,1211,1211,1213,1213,1215,1215,1216,1218,1218,1220,1220,1221,1222,1224,1224,1225,1226,1228,1228,1229,1230,1231,1233,1233,1235,1235,1237,1237,1239,1239,1241,1241,1243,1243,1245,1245,1247,1247,1249,1249,
+ 1251,1251,1253,1253,1255,1255,1257,1257,1259,1259,1261,1261,1263,1263,1265,1265,1267,1267,1269,1269,1270,1271,1273,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,
+ 1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,
+ 1398,1399,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1367,1368,1369,1370,1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,
+ 1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,
+ 1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,
+ 1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,
+ 1550,1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,
+ 1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,
+ 1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,
+ 1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,
+ 1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,
+ 1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,
+ 1850,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,
+ 1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,
+ 1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,
+ 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,
+ 2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,
+ 2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,
+ 2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2194,2195,2196,2197,2198,2199,
+ 2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,
+ 2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,
+ 2300,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,
+ 2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,
+ 2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,
+ 2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,
+ 2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,
+ 2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,
+ 2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,
+ 2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,
+ 2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,
+ 2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,
+ 2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,
+ 2850,2851,2852,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,
+ 2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,
+ 2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,
+ 3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,
+ 3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,
+ 3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,
+ 3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,
+ 3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,
+ 3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,
+ 3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,
+ 3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,
+ 3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,
+ 3450,3451,3452,3453,3454,3455,3456,3457,3458,3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,
+ 3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,
+ 3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,
+ 3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,
+ 3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,
+ 3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,
+ 3750,3751,3752,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,
+ 3800,3801,3802,3803,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,3822,3823,3824,3825,3826,3827,3828,3829,3830,3831,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,
+ 3850,3851,3852,3853,3854,3855,3856,3857,3858,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,3870,3871,3872,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,3887,3888,3889,3890,3891,3892,3893,3894,3895,3896,3897,3898,3899,
+ 3900,3901,3902,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,3925,3926,3927,3928,3929,3930,3931,3932,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,
+ 3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996,3997,3998,3999,
+ 4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,
+ 4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,
+ 4100,4101,4102,4103,4104,4105,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,
+ 4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,
+ 4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,
+ 4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,
+ 4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,
+ 4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,
+ 4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,4443,4444,4445,4446,4447,4448,4449,
+ 4450,4451,4452,4453,4454,4455,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,
+ 4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,
+ 4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,
+ 4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,
+ 4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,
+ 4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,
+ 4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,
+ 4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,
+ 4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,4884,4885,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,
+ 4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,4912,4913,4914,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,
+ 4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,4981,4982,4983,4984,4985,4986,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,
+ 5000,5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,5040,5041,5042,5043,5044,5045,5046,5047,5048,5049,
+ 5050,5051,5052,5053,5054,5055,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,
+ 5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,
+ 5150,5151,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,5199,
+ 5200,5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,5248,5249,
+ 5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,
+ 5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,
+ 5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,
+ 5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,
+ 5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,
+ 5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,
+ 5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,
+ 5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,
+ 5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,
+ 5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,
+ 5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,
+ 5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,
+ 5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,
+ 5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,
+ 5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,
+ 6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,
+ 6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,
+ 6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,
+ 6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,
+ 6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,
+ 6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,
+ 6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,
+ 6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,
+ 6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,
+ 6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,
+ 6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,
+ 6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,
+ 6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,
+ 6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,
+ 6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,
+ 6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,
+ 6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,
+ 6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,
+ 6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,
+ 6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,
+ 7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,
+ 7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,
+ 7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,
+ 7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,
+ 7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,
+ 7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,
+ 7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,
+ 7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,
+ 7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,
+ 7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,
+ 7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,
+ 7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,
+ 7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,
+ 7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7681,7681,7683,7683,7685,7685,7687,7687,7689,7689,7691,7691,7693,7693,7695,7695,7697,7697,7699,7699,
+ 7701,7701,7703,7703,7705,7705,7707,7707,7709,7709,7711,7711,7713,7713,7715,7715,7717,7717,7719,7719,7721,7721,7723,7723,7725,7725,7727,7727,7729,7729,7731,7731,7733,7733,7735,7735,7737,7737,7739,7739,7741,7741,7743,7743,7745,7745,7747,7747,7749,7749,
+ 7751,7751,7753,7753,7755,7755,7757,7757,7759,7759,7761,7761,7763,7763,7765,7765,7767,7767,7769,7769,7771,7771,7773,7773,7775,7775,7777,7777,7779,7779,7781,7781,7783,7783,7785,7785,7787,7787,7789,7789,7791,7791,7793,7793,7795,7795,7797,7797,7799,7799,
+ 7801,7801,7803,7803,7805,7805,7807,7807,7809,7809,7811,7811,7813,7813,7815,7815,7817,7817,7819,7819,7821,7821,7823,7823,7825,7825,7827,7827,7829,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7841,7841,7843,7843,7845,7845,7847,7847,7849,7849,
+ 7851,7851,7853,7853,7855,7855,7857,7857,7859,7859,7861,7861,7863,7863,7865,7865,7867,7867,7869,7869,7871,7871,7873,7873,7875,7875,7877,7877,7879,7879,7881,7881,7883,7883,7885,7885,7887,7887,7889,7889,7891,7891,7893,7893,7895,7895,7897,7897,7899,7899,
+ 7901,7901,7903,7903,7905,7905,7907,7907,7909,7909,7911,7911,7913,7913,7915,7915,7917,7917,7919,7919,7921,7921,7923,7923,7925,7925,7927,7927,7929,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7936,7937,7938,7939,7940,7941,
+ 7942,7943,7952,7953,7954,7955,7956,7957,7958,7959,7952,7953,7954,7955,7956,7957,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7968,7969,7970,7971,7972,7973,7974,7975,7984,7985,7986,7987,7988,7989,7990,7991,7984,7985,7986,7987,7988,7989,7990,7991,
+ 8000,8001,8002,8003,8004,8005,8006,8007,8000,8001,8002,8003,8004,8005,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8017,8026,8019,8028,8021,8030,8023,8032,8033,8034,8035,8036,8037,8038,8039,8032,8033,8034,8035,8036,8037,8038,8039,8048,8049,
+ 8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8064,8065,8066,8067,8068,8069,8070,8071,8080,8081,8082,8083,8084,8085,8086,8087,8080,8081,8082,8083,8084,8085,8086,8087,8096,8097,8098,8099,
+ 8100,8101,8102,8103,8096,8097,8098,8099,8100,8101,8102,8103,8112,8113,8114,8115,8116,8117,8118,8119,8112,8113,8048,8049,8115,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8050,8051,8052,8053,8131,8141,8142,8143,8144,8145,8146,8147,8148,8149,
+ 8150,8151,8144,8145,8054,8055,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8160,8161,8058,8059,8165,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8056,8057,8060,8061,8179,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,
+ 8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,
+ 8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,
+ 8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,
+ 8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,
+ 8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,
+ 8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,969,8487,8488,8489,107,229,8492,8493,8494,8495,8496,8497,8498,8499,
+ 8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,
+ 8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,
+ 8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,
+ 8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,
+ 8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,
+ 8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,8789,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,
+ 8800,8801,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,8848,8849,
+ 8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,
+ 8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,8925,8926,8927,8928,8929,8930,8931,8932,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,8944,8945,8946,8947,8948,8949,
+ 8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,8993,8994,8995,8996,8997,8998,8999,
+ 9000,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,
+ 9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,
+ 9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,9142,9143,9144,9145,9146,9147,9148,9149,
+ 9150,9151,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,
+ 9200,9201,9202,9203,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9248,9249,
+ 9250,9251,9252,9253,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,
+ 9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,
+ 9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,
+ 9400,9401,9402,9403,9404,9405,9406,9407,9408,9409,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,9422,9423
+};
+
+static const guint16 ToLowerDataHigh [] = {
+ 65345,65346,65347,65348,65349,
+ 65350,65351,65352,65353,65354,65355,65356,65357,65358,65359,65360,65361,65362,65363,65364,65365,65366,65367,65368,65369,65370,65371,65372,65373,65374,65375,65376,65377,65378,65379,65380,65381,65382,65383,65384,65385,65386,65387,65388,65389,65390,65391,65392,65393,65394,65395,65396,65397,65398,65399,
+ 65400,65401,65402,65403,65404,65405,65406,65407,65408,65409,65410,65411,65412,65413,65414,65415,65416,65417,65418,65419,65420,65421,65422,65423,65424,65425,65426,65427,65428,65429,65430,65431,65432,65433,65434,65435,65436,65437,65438,65439,65440,65441,65442,65443,65444,65445,65446,65447,65448,65449,
+ 65450,65451,65452,65453,65454,65455,65456,65457,65458,65459,65460,65461,65462,65463,65464,65465,65466,65467,65468,65469,65470,65471,65472,65473,65474,65475,65476,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487,65488,65489,65490,65491,65492,65493,65494,65495,65496,65497,65498,65499,
+ 65500,65501,65502,65503,65504,65505,65506,65507,65508,65509,65510,65511,65512,65513,65514,65515,65516,65517,65518,65519,65520,65521,65522,65523,65524,65525,65526,65527,65528,65529,65530,65531,65532,65533,65534,65535
+};
+
+static const guint16 ToUpperDataLow [] = {
+ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
+ 50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,65,66,67,
+ 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,
+ 150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,
+ 200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,247,216,217,
+ 218,219,220,221,222,376,256,256,258,258,260,260,262,262,264,264,266,266,268,268,270,270,272,272,274,274,276,276,278,278,280,280,282,282,284,284,286,286,288,288,290,290,292,292,294,294,296,296,298,298,
+ 300,300,302,302,304,73,306,306,308,308,310,310,312,313,313,315,315,317,317,319,319,321,321,323,323,325,325,327,327,329,330,330,332,332,334,334,336,336,338,338,340,340,342,342,344,344,346,346,348,348,
+ 350,350,352,352,354,354,356,356,358,358,360,360,362,362,364,364,366,366,368,368,370,370,372,372,374,374,376,377,377,379,379,381,381,383,384,385,386,386,388,388,390,391,391,393,394,395,395,397,398,399,
+ 400,401,401,403,404,405,406,407,408,408,410,411,412,413,414,415,416,416,418,418,420,420,422,423,423,425,426,427,428,428,430,431,431,433,434,435,435,437,437,439,440,440,442,443,444,444,446,447,448,449,
+ 450,451,452,452,452,455,455,455,458,458,458,461,461,463,463,465,465,467,467,469,469,471,471,473,473,475,475,398,478,478,480,480,482,482,484,484,486,486,488,488,490,490,492,492,494,494,496,497,497,497,
+ 500,500,502,503,504,505,506,506,508,508,510,510,512,512,514,514,516,516,518,518,520,520,522,522,524,524,526,526,528,528,530,530,532,532,534,534,536,537,538,539,540,541,542,543,544,545,546,547,548,549,
+ 550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,385,390,597,393,394,
+ 600,399,602,400,604,605,606,607,403,609,610,404,612,613,614,615,407,406,618,619,620,621,622,412,624,625,413,627,628,415,630,631,632,633,634,635,636,637,638,639,640,641,642,425,644,645,646,647,430,649,
+ 433,434,652,653,654,655,656,657,439,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,
+ 700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,
+ 750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,
+ 800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,
+ 850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,
+ 900,901,902,903,904,905,906,907,908,909,910,911,938,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,902,904,905,906,939,913,914,915,916,917,
+ 918,919,920,921,922,923,924,925,926,927,928,929,931,931,932,933,934,935,936,937,938,939,908,910,911,975,914,920,978,979,980,934,928,983,984,985,986,987,988,989,990,991,992,993,994,994,996,996,998,998,
+ 1000,1000,1002,1002,1004,1004,1006,1006,922,929,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,
+ 1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,
+ 1068,1069,1070,1071,1104,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1117,1038,1039,1120,1120,1122,1122,1124,1124,1126,1126,1128,1128,1130,1130,1132,1132,1134,1134,1136,1136,1138,1138,1140,1140,1142,1142,1144,1144,1146,1146,1148,1148,
+ 1150,1150,1152,1152,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1168,1170,1170,1172,1172,1174,1174,1176,1176,1178,1178,1180,1180,1182,1182,1184,1184,1186,1186,1188,1188,1190,1190,1192,1192,1194,1194,1196,1196,1198,1198,
+ 1200,1200,1202,1202,1204,1204,1206,1206,1208,1208,1210,1210,1212,1212,1214,1214,1216,1217,1217,1219,1219,1221,1222,1223,1223,1225,1226,1227,1227,1229,1230,1231,1232,1232,1234,1234,1236,1236,1238,1238,1240,1240,1242,1242,1244,1244,1246,1246,1248,1248,
+ 1250,1250,1252,1252,1254,1254,1256,1256,1258,1258,1260,1261,1262,1262,1264,1264,1266,1266,1268,1268,1270,1271,1272,1272,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,
+ 1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,
+ 1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,1371,1372,1373,1374,1375,1376,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,
+ 1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,
+ 1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,
+ 1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,
+ 1550,1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,
+ 1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,
+ 1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,
+ 1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,
+ 1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,
+ 1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,
+ 1850,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,
+ 1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,
+ 1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,
+ 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,
+ 2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,
+ 2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,
+ 2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2194,2195,2196,2197,2198,2199,
+ 2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,
+ 2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,
+ 2300,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,
+ 2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,
+ 2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,
+ 2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,
+ 2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,
+ 2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,
+ 2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,
+ 2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,
+ 2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,
+ 2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,
+ 2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,
+ 2850,2851,2852,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,
+ 2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,
+ 2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,
+ 3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,
+ 3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,
+ 3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,
+ 3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,
+ 3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,
+ 3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,
+ 3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,
+ 3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,
+ 3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,
+ 3450,3451,3452,3453,3454,3455,3456,3457,3458,3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,
+ 3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,
+ 3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,
+ 3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,
+ 3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,
+ 3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,
+ 3750,3751,3752,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,
+ 3800,3801,3802,3803,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,3822,3823,3824,3825,3826,3827,3828,3829,3830,3831,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,
+ 3850,3851,3852,3853,3854,3855,3856,3857,3858,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,3870,3871,3872,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,3887,3888,3889,3890,3891,3892,3893,3894,3895,3896,3897,3898,3899,
+ 3900,3901,3902,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,3925,3926,3927,3928,3929,3930,3931,3932,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,
+ 3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996,3997,3998,3999,
+ 4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,
+ 4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,
+ 4100,4101,4102,4103,4104,4105,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,
+ 4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,
+ 4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,
+ 4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,
+ 4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,
+ 4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,
+ 4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,4443,4444,4445,4446,4447,4448,4449,
+ 4450,4451,4452,4453,4454,4455,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,
+ 4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,
+ 4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,
+ 4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,
+ 4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,
+ 4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,
+ 4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,
+ 4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,
+ 4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,4884,4885,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,
+ 4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,4912,4913,4914,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,
+ 4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,4981,4982,4983,4984,4985,4986,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,
+ 5000,5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,5040,5041,5042,5043,5044,5045,5046,5047,5048,5049,
+ 5050,5051,5052,5053,5054,5055,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,
+ 5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,
+ 5150,5151,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,5199,
+ 5200,5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,5248,5249,
+ 5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,
+ 5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,
+ 5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,
+ 5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,
+ 5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,
+ 5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,
+ 5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,
+ 5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,
+ 5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,
+ 5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,
+ 5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,
+ 5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,
+ 5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,
+ 5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,
+ 5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,
+ 6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,
+ 6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,
+ 6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,
+ 6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,
+ 6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,
+ 6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,
+ 6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,
+ 6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,
+ 6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,
+ 6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,
+ 6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,
+ 6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,
+ 6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,
+ 6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,
+ 6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,
+ 6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,
+ 6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,
+ 6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,
+ 6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,
+ 6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,
+ 7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,
+ 7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,
+ 7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,
+ 7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,
+ 7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,
+ 7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,
+ 7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,
+ 7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,
+ 7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,
+ 7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,
+ 7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,
+ 7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,
+ 7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,
+ 7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7680,7682,7682,7684,7684,7686,7686,7688,7688,7690,7690,7692,7692,7694,7694,7696,7696,7698,7698,
+ 7700,7700,7702,7702,7704,7704,7706,7706,7708,7708,7710,7710,7712,7712,7714,7714,7716,7716,7718,7718,7720,7720,7722,7722,7724,7724,7726,7726,7728,7728,7730,7730,7732,7732,7734,7734,7736,7736,7738,7738,7740,7740,7742,7742,7744,7744,7746,7746,7748,7748,
+ 7750,7750,7752,7752,7754,7754,7756,7756,7758,7758,7760,7760,7762,7762,7764,7764,7766,7766,7768,7768,7770,7770,7772,7772,7774,7774,7776,7776,7778,7778,7780,7780,7782,7782,7784,7784,7786,7786,7788,7788,7790,7790,7792,7792,7794,7794,7796,7796,7798,7798,
+ 7800,7800,7802,7802,7804,7804,7806,7806,7808,7808,7810,7810,7812,7812,7814,7814,7816,7816,7818,7818,7820,7820,7822,7822,7824,7824,7826,7826,7828,7828,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7840,7842,7842,7844,7844,7846,7846,7848,7848,
+ 7850,7850,7852,7852,7854,7854,7856,7856,7858,7858,7860,7860,7862,7862,7864,7864,7866,7866,7868,7868,7870,7870,7872,7872,7874,7874,7876,7876,7878,7878,7880,7880,7882,7882,7884,7884,7886,7886,7888,7888,7890,7890,7892,7892,7894,7894,7896,7896,7898,7898,
+ 7900,7900,7902,7902,7904,7904,7906,7906,7908,7908,7910,7910,7912,7912,7914,7914,7916,7916,7918,7918,7920,7920,7922,7922,7924,7924,7926,7926,7928,7928,7930,7931,7932,7933,7934,7935,7944,7945,7946,7947,7948,7949,7950,7951,7944,7945,7946,7947,7948,7949,
+ 7950,7951,7960,7961,7962,7963,7964,7965,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7976,7977,7978,7979,7980,7981,7982,7983,7976,7977,7978,7979,7980,7981,7982,7983,7992,7993,7994,7995,7996,7997,7998,7999,7992,7993,7994,7995,7996,7997,7998,7999,
+ 8008,8009,8010,8011,8012,8013,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8025,8018,8027,8020,8029,8022,8031,8024,8025,8026,8027,8028,8029,8030,8031,8040,8041,8042,8043,8044,8045,8046,8047,8040,8041,8042,8043,8044,8045,8046,8047,8122,8123,
+ 8136,8137,8138,8139,8154,8155,8184,8185,8170,8171,8186,8187,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,
+ 8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8120,8121,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8152,8153,8146,8147,8148,8149,
+ 8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8168,8169,8162,8163,8164,8172,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,
+ 8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,
+ 8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,
+ 8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,
+ 8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,
+ 8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,
+ 8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,
+ 8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,
+ 8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,
+ 8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,
+ 8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,
+ 8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,
+ 8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,8789,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,
+ 8800,8801,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,8848,8849,
+ 8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,
+ 8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,8925,8926,8927,8928,8929,8930,8931,8932,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,8944,8945,8946,8947,8948,8949,
+ 8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,8993,8994,8995,8996,8997,8998,8999,
+ 9000,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,
+ 9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,
+ 9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,9142,9143,9144,9145,9146,9147,9148,9149,
+ 9150,9151,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,
+ 9200,9201,9202,9203,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9248,9249,
+ 9250,9251,9252,9253,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,
+ 9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,
+ 9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,
+ 9400,9401,9402,9403,9404,9405,9406,9407,9408,9409,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,9422,9423,9398,9399,9400,9401,9402,9403,9404,9405,9406,9407,9408,9409,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,9422,9423
+};
+
+static const guint16 ToUpperDataHigh [] = {
+ 65313,65314,65315,65316,65317,65318,65319,65320,65321,65322,65323,65324,
+ 65325,65326,65327,65328,65329,65330,65331,65332,65333,65334,65335,65336,
+ 65337,65338,65339,65340,65341,65342,65343,65344,65313,65314,65315,65316,
+ 65317,65318,65319,65320,65321,65322,65323,65324,65325,65326,65327,65328,
+ 65329,65330,65331,65332,65333,65334,65335,65336,65337,65338,65371,65372,
+ 65373,65374,65375,65376,65377,65378,65379,65380,65381,65382,65383,65384,
+ 65385,65386,65387,65388,65389,65390,65391,65392,65393,65394,65395,65396,
+ 65397,65398,65399,65400,65401,65402,65403,65404,65405,65406,65407,65408,
+ 65409,65410,65411,65412,65413,65414,65415,65416,65417,65418,65419,65420,
+ 65421,65422,65423,65424,65425,65426,65427,65428,65429,65430,65431,65432,
+ 65433,65434,65435,65436,65437,65438,65439,65440,65441,65442,65443,65444,
+ 65445,65446,65447,65448,65449,65450,65451,65452,65453,65454,65455,65456,
+ 65457,65458,65459,65460,65461,65462,65463,65464,65465,65466,65467,65468,
+ 65469,65470,65471,65472,65473,65474,65475,65476,65477,65478,65479,65480,
+ 65481,65482,65483,65484,65485,65486,65487,65488,65489,65490,65491,65492,
+ 65493,65494,65495,65496,65497,65498,65499,65500,65501,65502,65503,65504,
+ 65505,65506,65507,65508,65509,65510,65511,65512,65513,65514,65515,65516,
+ 65517,65518,65519,65520,65521,65522,65523,65524,65525,65526,65527,65528,
+ 65529,65530,65531,65532,65533,65534,65535
+};
+
+#endif
+
diff --git a/mono/metadata/cil-coff.h b/mono/metadata/cil-coff.h
index 1a3500c9140..098057f6fc3 100644
--- a/mono/metadata/cil-coff.h
+++ b/mono/metadata/cil-coff.h
@@ -224,6 +224,7 @@ typedef struct {
#define CLI_FLAGS_ILONLY 0x01
#define CLI_FLAGS_32BITREQUIRED 0x02
+#define CLI_FLAGS_STRONGNAMESIGNED 0x8
#define CLI_FLAGS_TRACKDEBUGDATA 0x00010000
guint32 ch_flags;
@@ -256,6 +257,5 @@ typedef struct {
} MonoCLIImageInfo;
guint32 mono_cli_rva_image_map (MonoCLIImageInfo *iinfo, guint32 rva);
-char *mono_cli_rva_map (MonoCLIImageInfo *iinfo, guint32 rva);
#endif /* __MONO_CIL_COFF_H__ */
diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h
new file mode 100644
index 00000000000..268403a8b73
--- /dev/null
+++ b/mono/metadata/class-internals.h
@@ -0,0 +1,521 @@
+#ifndef __MONO_METADATA_CLASS_INTERBALS_H__
+#define __MONO_METADATA_CLASS_INTERBALS_H__
+
+#include <mono/metadata/class.h>
+#include <mono/io-layer/io-layer.h>
+
+#define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
+
+#define MONO_DEFAULT_SUPERTABLE_SIZE 6
+
+extern gboolean mono_print_vtable;
+
+typedef void (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
+
+typedef struct _MonoMethodNormal MonoMethodNormal;
+typedef struct _MonoMethodWrapper MonoMethodWrapper;
+typedef struct _MonoMethodInflated MonoMethodInflated;
+typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
+
+typedef enum {
+ MONO_WRAPPER_NONE,
+ MONO_WRAPPER_DELEGATE_INVOKE,
+ MONO_WRAPPER_DELEGATE_BEGIN_INVOKE,
+ MONO_WRAPPER_DELEGATE_END_INVOKE,
+ MONO_WRAPPER_RUNTIME_INVOKE,
+ MONO_WRAPPER_NATIVE_TO_MANAGED,
+ MONO_WRAPPER_MANAGED_TO_NATIVE,
+ MONO_WRAPPER_REMOTING_INVOKE,
+ MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK,
+ MONO_WRAPPER_LDFLD,
+ MONO_WRAPPER_STFLD,
+ MONO_WRAPPER_SYNCHRONIZED,
+ MONO_WRAPPER_DYNAMIC_METHOD,
+ MONO_WRAPPER_ISINST,
+ MONO_WRAPPER_CASTCLASS,
+ MONO_WRAPPER_PROXY_ISINST,
+ MONO_WRAPPER_STELEMREF,
+ MONO_WRAPPER_UNKNOWN
+} MonoWrapperType;
+
+struct _MonoMethod {
+ guint16 flags; /* method flags */
+ guint16 iflags; /* method implementation flags */
+ guint32 token;
+ MonoClass *klass;
+ MonoMethodSignature *signature;
+ gpointer info; /* runtime info */
+ /* name is useful mostly for debugging */
+ const char *name;
+ /* this is used by the inlining algorithm */
+ unsigned int inline_info:1;
+ unsigned int uses_this:1;
+ unsigned int wrapper_type:5;
+ unsigned int string_ctor:1;
+ unsigned int save_lmf:1;
+ unsigned int dynamic:1; /* created & destroyed during runtime */
+ gint slot : 22;
+};
+
+struct _MonoMethodNormal {
+ MonoMethod method;
+ MonoGenericContainer *generic_container;
+ MonoMethodHeader *header;
+};
+
+struct _MonoMethodWrapper {
+ MonoMethodNormal method;
+ GList *data;
+};
+
+struct _MonoMethodInflated {
+ MonoMethodNormal nmethod;
+ MonoGenericContext *context;
+ MonoMethod *declaring;
+};
+
+struct _MonoMethodPInvoke {
+ MonoMethod method;
+ gpointer addr;
+ /* add marshal info */
+ guint16 piflags; /* pinvoke flags */
+ guint16 implmap_idx; /* index into IMPLMAP */
+};
+
+typedef struct {
+ MonoType *generic_type;
+ gpointer reflection_info;
+} MonoInflatedField;
+
+/*
+ * MonoClassField is just a runtime representation of the metadata for
+ * field, it doesn't contain the data directly. Static fields are
+ * stored in MonoVTable->data. Instance fields are allocated in the
+ * objects after the object header.
+ */
+struct _MonoClassField {
+ /* Type of the field */
+ MonoType *type;
+
+ /* If this is an instantiated generic type, this is the
+ * "original" type, ie. the MONO_TYPE_VAR or MONO_TYPE_GENERICINST
+ * it was instantiated from.
+ */
+ MonoInflatedField *generic_info;
+
+ /*
+ * Offset where this field is stored; if it is an instance
+ * field, it's the offset from the start of the object, if
+ * it's static, it's from the start of the memory chunk
+ * allocated for statics for the class.
+ */
+ int offset;
+
+ const char *name;
+
+ /*
+ * If the field is constant, pointer to the metadata constant
+ * value.
+ * If the field has an RVA flag, pointer to the data.
+ * Else, invalid.
+ */
+ const char *data;
+
+ /* Type where the field was defined */
+ MonoClass *parent;
+
+ /*
+ * If the field is constant, the type of the constant.
+ */
+ MonoTypeEnum def_type;
+};
+
+/* a field is ignored if it's named "_Deleted" and it has the specialname and rtspecialname flags set */
+#define mono_field_is_deleted(field) ((field)->name[0] == '_' && ((field)->type->attrs & 0x600) && (strcmp ((field)->name, "_Deleted") == 0))
+
+typedef struct {
+ MonoClassField *field;
+ guint32 offset;
+ MonoMarshalSpec *mspec;
+} MonoMarshalField;
+
+typedef struct {
+ guint32 native_size;
+ guint32 num_fields;
+ MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
+} MonoMarshalType;
+
+struct _MonoProperty {
+ MonoClass *parent;
+ const char *name;
+ MonoMethod *get;
+ MonoMethod *set;
+ guint32 attrs;
+};
+
+struct _MonoEvent {
+ MonoClass *parent;
+ const char *name;
+ MonoMethod *add;
+ MonoMethod *remove;
+ MonoMethod *raise;
+ MonoMethod **other;
+ guint32 attrs;
+};
+
+struct _MonoClass {
+ MonoImage *image;
+
+ /* The underlying type of the enum */
+ MonoType *enum_basetype;
+ /* element class for arrays and enum */
+ MonoClass *element_class;
+ /* used for subtype checks */
+ MonoClass *cast_class;
+ /* array dimension */
+ guint32 rank;
+
+ guint inited : 1;
+ /* We use init_pending to detect cyclic calls to mono_class_init */
+ guint init_pending : 1;
+
+ /* A class contains static and non static data. Static data can be
+ * of the same type as the class itselfs, but it does not influence
+ * the instance size of the class. To avoid cyclic calls to
+ * mono_class_init (from mono_class_instance_size ()) we first
+ * initialise all non static fields. After that we set size_inited
+ * to 1, because we know the instance size now. After that we
+ * initialise all static fields.
+ */
+ guint size_inited : 1;
+ guint valuetype : 1; /* derives from System.ValueType */
+ guint enumtype : 1; /* derives from System.Enum */
+ guint blittable : 1; /* class is blittable */
+ guint unicode : 1; /* class uses unicode char when marshalled */
+ guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
+ /* next byte */
+ guint min_align : 4;
+ guint packing_size : 4;
+ /* next byte */
+ guint ghcimpl : 1; /* class has its own GetHashCode impl */
+ guint has_finalize : 1; /* class has its own Finalize impl */
+ guint marshalbyref : 1; /* class is a MarshalByRefObject */
+ guint contextbound : 1; /* class is a ContextBoundObject */
+ guint delegate : 1; /* class is a Delegate */
+ guint gc_descr_inited : 1; /* gc_descr is initialized */
+ guint dummy : 1; /* temporary hack */
+
+ MonoClass *parent;
+ MonoClass *nested_in;
+ GList *nested_classes;
+
+ guint32 type_token;
+ const char *name;
+ const char *name_space;
+
+ guint interface_count;
+ guint interface_id; /* unique inderface id (for interfaces) */
+ guint max_interface_id;
+ gint *interface_offsets;
+ MonoClass **interfaces;
+
+ /* for fast subtype checks */
+ guint idepth;
+ MonoClass **supertypes;
+
+ /*
+ * Computed object instance size, total.
+ */
+ int instance_size;
+ int class_size;
+ int vtable_size; /* number of slots */
+
+ /*
+ * From the TypeDef table
+ */
+ guint32 flags;
+ struct {
+ guint32 first, last;
+ int count;
+ } field, method, property, event;
+
+ /* loaded on demand */
+ MonoMarshalType *marshal_info;
+
+ /*
+ * Field information: Type and location from object base
+ */
+ MonoClassField *fields;
+
+ MonoProperty *properties;
+
+ MonoEvent *events;
+
+ MonoMethod **methods;
+
+ /* used as the type of the this argument and when passing the arg by value */
+ MonoType this_arg;
+ MonoType byval_arg;
+
+ MonoGenericInst *generic_inst;
+ MonoGenericContainer *generic_container;
+
+ void *reflection_info;
+
+ void *gc_descr;
+ guint64 gc_bitmap;
+
+ MonoMethod *ptr_to_str;
+ MonoMethod *str_to_ptr;
+
+ MonoVTable *cached_vtable;
+ MonoMethod **vtable;
+};
+
+struct MonoVTable {
+ MonoClass *klass;
+ /*
+ * According to comments in gc_gcj.h, this should be the second word in
+ * the vtable.
+ */
+ void *gc_descr;
+ MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
+ guint32 max_interface_id;
+ gpointer *interface_offsets;
+ gpointer data; /* to store static class data */
+ gpointer type; /* System.Type type for klass */
+ guint remote : 1; /* class is remotely activated */
+ guint initialized : 1; /* cctor has been run */
+ /* do not add any fields after vtable, the structure is dynamically extended */
+ gpointer vtable [MONO_ZERO_LEN_ARRAY];
+};
+
+/*
+ * Generic instantiation data type encoding.
+ */
+struct _MonoGenericInst {
+ MonoGenericContainer *container;
+ MonoGenericContext *context;
+ MonoClass *klass;
+ MonoType *parent;
+ int count_ifaces;
+ MonoType **ifaces;
+ MonoType *generic_type;
+ MonoDynamicGenericInst *dynamic_info;
+ int type_argc;
+ MonoType **type_argv;
+ guint is_open : 1;
+ guint initialized : 1;
+ guint init_pending : 1;
+ guint is_dynamic : 1;
+};
+
+struct _MonoDynamicGenericInst {
+ int count_methods;
+ MonoMethod **methods;
+ int count_ctors;
+ MonoMethod **ctors;
+ int count_fields;
+ MonoClassField *fields;
+ int count_properties;
+ MonoProperty *properties;
+ int count_events;
+ MonoEvent *events;
+};
+
+struct _MonoGenericMethod {
+ MonoGenericContainer *container;
+ gpointer reflection_info;
+ int mtype_argc;
+ MonoType **mtype_argv;
+ guint is_open : 1;
+};
+
+struct _MonoGenericContext {
+ MonoGenericContainer *container;
+ MonoGenericInst *ginst;
+ MonoGenericMethod *gmethod;
+};
+
+struct _MonoGenericContainer {
+ MonoGenericContainer *parent;
+ MonoGenericContext *context;
+ MonoClass *klass;
+ int type_argc : 6;
+ int is_method : 1;
+ int is_signature : 1;
+ MonoGenericParam *type_params;
+};
+
+struct _MonoGenericParam {
+ MonoGenericContainer *owner;
+ MonoClass *pklass;
+ MonoMethod *method;
+ const char *name;
+ guint16 flags;
+ guint16 num;
+ MonoClass** constraints; /* NULL means end of list */
+};
+
+typedef struct {
+ const char *name;
+ gconstpointer func;
+ gconstpointer wrapper;
+ MonoMethodSignature *sig;
+} MonoJitICallInfo;
+
+#define mono_class_has_parent(klass,parent) (((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent)))
+
+typedef struct {
+ gulong new_object_count;
+ gulong initialized_class_count;
+ gulong used_class_count;
+ gulong class_vtable_size;
+ gulong class_static_data_size;
+ gulong generic_instance_count;
+ gulong inflated_method_count;
+ gulong inflated_type_count;
+ gulong generics_metadata_size;
+ gboolean enabled;
+} MonoStats;
+
+extern MonoStats mono_stats;
+
+typedef gpointer (*MonoTrampoline) (MonoMethod *method);
+
+typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token);
+
+void
+mono_classes_init (void);
+
+void
+mono_class_layout_fields (MonoClass *klass);
+
+void
+mono_class_setup_vtable (MonoClass *klass, MonoMethod **overrides, int onum);
+
+void
+mono_class_setup_mono_type (MonoClass *klass);
+
+void
+mono_class_setup_parent (MonoClass *klass, MonoClass *parent);
+
+void
+mono_class_setup_supertypes (MonoClass *klass);
+
+GPtrArray*
+mono_class_get_implemented_interfaces (MonoClass *klass);
+
+gboolean
+mono_class_is_open_constructed_type (MonoType *t);
+
+MonoMethod**
+mono_class_get_overrides (MonoImage *image, guint32 type_token, gint32 *num_overrides);
+
+gboolean
+mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller);
+
+void
+mono_install_trampoline (MonoTrampoline func);
+
+void
+mono_install_remoting_trampoline (MonoTrampoline func);
+
+gpointer
+mono_lookup_dynamic_token (MonoImage *image, guint32 token);
+
+void
+mono_install_lookup_dynamic_token (MonoLookupDynamicToken func);
+
+typedef struct {
+ MonoImage *corlib;
+ MonoClass *object_class;
+ MonoClass *byte_class;
+ MonoClass *void_class;
+ MonoClass *boolean_class;
+ MonoClass *sbyte_class;
+ MonoClass *int16_class;
+ MonoClass *uint16_class;
+ MonoClass *int32_class;
+ MonoClass *uint32_class;
+ MonoClass *int_class;
+ MonoClass *uint_class;
+ MonoClass *int64_class;
+ MonoClass *uint64_class;
+ MonoClass *single_class;
+ MonoClass *double_class;
+ MonoClass *char_class;
+ MonoClass *string_class;
+ MonoClass *enum_class;
+ MonoClass *array_class;
+ MonoClass *delegate_class;
+ MonoClass *multicastdelegate_class;
+ MonoClass *asyncresult_class;
+ MonoClass *waithandle_class;
+ MonoClass *typehandle_class;
+ MonoClass *fieldhandle_class;
+ MonoClass *methodhandle_class;
+ MonoClass *monotype_class;
+ MonoClass *exception_class;
+ MonoClass *threadabortexception_class;
+ MonoClass *thread_class;
+ MonoClass *transparent_proxy_class;
+ MonoClass *real_proxy_class;
+ MonoClass *mono_method_message_class;
+ MonoClass *appdomain_class;
+ MonoClass *field_info_class;
+ MonoClass *method_info_class;
+ MonoClass *stringbuilder_class;
+ MonoClass *math_class;
+ MonoClass *stack_frame_class;
+ MonoClass *stack_trace_class;
+ MonoClass *marshal_class;
+ MonoClass *iserializeable_class;
+ MonoClass *serializationinfo_class;
+ MonoClass *streamingcontext_class;
+ MonoClass *typed_reference_class;
+ MonoClass *argumenthandle_class;
+ MonoClass *marshalbyrefobject_class;
+ MonoClass *monitor_class;
+ MonoClass *iremotingtypeinfo_class;
+} MonoDefaults;
+
+extern MonoDefaults mono_defaults;
+
+void
+mono_loader_init (void);
+
+void
+mono_loader_lock (void);
+
+void
+mono_loader_unlock (void);
+
+void
+mono_init_icall (void);
+
+gpointer
+mono_method_get_wrapper_data (MonoMethod *method, guint32 id);
+
+void
+mono_install_stack_walk (MonoStackWalkImpl func);
+
+MonoGenericContainer *mono_metadata_load_generic_params (MonoImage *image, guint32 token);
+
+MonoMethodSignature*
+mono_create_icall_signature (const char *sigstr);
+
+MonoJitICallInfo *
+mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
+
+void
+mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper);
+
+MonoJitICallInfo *
+mono_find_jit_icall_by_name (const char *name);
+
+MonoJitICallInfo *
+mono_find_jit_icall_by_addr (gconstpointer addr);
+
+#endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */
+
diff --git a/mono/metadata/class.c b/mono/metadata/class.c
index 086c34d7dc4..33fbc0c9470 100644
--- a/mono/metadata/class.c
+++ b/mono/metadata/class.c
@@ -20,20 +20,20 @@
#include <stdlib.h>
#include <signal.h>
#include <mono/metadata/image.h>
+#include <mono/metadata/assembly.h>
#include <mono/metadata/cil-coff.h>
#include <mono/metadata/metadata.h>
+#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/tokentype.h>
-#include <mono/metadata/class.h>
+#include <mono/metadata/class-internals.h>
#include <mono/metadata/object.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/mono-endian.h>
#include <mono/metadata/debug-helpers.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
-
-#define CSIZE(x) (sizeof (x) / 4)
+#include <mono/metadata/reflection.h>
+#include <mono/metadata/mono-debug-debugger.h>
+#include <mono/os/gc_wrapper.h>
MonoStats mono_stats;
@@ -41,6 +41,9 @@ gboolean mono_print_vtable = FALSE;
static MonoClass * mono_class_create_from_typedef (MonoImage *image, guint32 type_token);
+void (*mono_debugger_start_class_init_func) (MonoClass *klass) = NULL;
+void (*mono_debugger_class_init_func) (MonoClass *klass) = NULL;
+
MonoClass *
mono_class_from_typeref (MonoImage *image, guint32 type_token)
{
@@ -49,22 +52,23 @@ mono_class_from_typeref (MonoImage *image, guint32 type_token)
guint32 idx;
const char *name, *nspace;
MonoClass *res;
+ MonoAssembly **references;
mono_metadata_decode_row (t, (type_token&0xffffff)-1, cols, MONO_TYPEREF_SIZE);
name = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAME]);
nspace = mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAMESPACE]);
- idx = cols [MONO_TYPEREF_SCOPE] >> RESOLTION_SCOPE_BITS;
- switch (cols [MONO_TYPEREF_SCOPE] & RESOLTION_SCOPE_MASK) {
- case RESOLTION_SCOPE_MODULE:
+ idx = cols [MONO_TYPEREF_SCOPE] >> MONO_RESOLTION_SCOPE_BITS;
+ switch (cols [MONO_TYPEREF_SCOPE] & MONO_RESOLTION_SCOPE_MASK) {
+ case MONO_RESOLTION_SCOPE_MODULE:
if (!idx)
g_error ("null ResolutionScope not yet handled");
/* a typedef in disguise */
return mono_class_from_name (image, nspace, name);
- case RESOLTION_SCOPE_MODULEREF:
- return mono_class_from_name (image->assembly->modules [idx - 1], nspace, name);
- case RESOLTION_SCOPE_TYPEREF: {
+ case MONO_RESOLTION_SCOPE_MODULEREF:
+ return mono_class_from_name (image->modules [idx - 1], nspace, name);
+ case MONO_RESOLTION_SCOPE_TYPEREF: {
MonoClass *enclosing = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | idx);
GList *tmp;
mono_class_init (enclosing);
@@ -76,36 +80,372 @@ mono_class_from_typeref (MonoImage *image, guint32 type_token)
g_warning ("TypeRef ResolutionScope not yet handled (%d)", idx);
return NULL;
}
- case RESOLTION_SCOPE_ASSEMBLYREF:
+ case MONO_RESOLTION_SCOPE_ASSEMBLYREF:
break;
}
- if (!image->references || !image->references [idx-1]) {
- /*
- * detected a reference to mscorlib, we simply return a reference to a dummy
- * until we have a better solution.
- */
- fprintf(stderr, "Sending dummy where %s.%s expected\n", mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAMESPACE]), mono_metadata_string_heap (image, cols [MONO_TYPEREF_NAME]));
-
- res = mono_class_from_name (image, "System", "MonoDummy");
- /* prevent method loading */
- res->dummy = 1;
- /* some storage if the type is used - very ugly hack */
- res->instance_size = 2*sizeof (gpointer);
- return res;
- }
+ references = image->references;
+ if (!references [idx-1])
+ mono_assembly_load_reference (image, idx - 1);
+ if (references [idx - 1] == (gpointer)-1)
+ return NULL;
- /* load referenced assembly */
- image = image->references [idx-1]->image;
+ image = references [idx-1]->image;
return mono_class_from_name (image, nspace, name);
}
+static MonoType*
+dup_type (MonoType* t, const MonoType *original)
+{
+ MonoType *r = g_new0 (MonoType, 1);
+ *r = *t;
+ r->attrs = original->attrs;
+ r->byref = original->byref;
+ mono_stats.generics_metadata_size += sizeof (MonoType);
+ return r;
+}
+
+static void
+mono_type_get_name_recurse (MonoType *type, GString *str, gboolean is_recursed,
+ gboolean include_arity)
+{
+ MonoClass *klass;
+
+ switch (type->type) {
+ case MONO_TYPE_ARRAY: {
+ int i, rank = type->data.array->rank;
+
+ mono_type_get_name_recurse (
+ &type->data.array->eklass->byval_arg, str, FALSE, include_arity);
+ g_string_append_c (str, '[');
+ for (i = 1; i < rank; i++)
+ g_string_append_c (str, ',');
+ g_string_append_c (str, ']');
+ break;
+ }
+ case MONO_TYPE_SZARRAY:
+ mono_type_get_name_recurse (
+ &type->data.klass->byval_arg, str, FALSE, include_arity);
+ g_string_append (str, "[]");
+ break;
+ case MONO_TYPE_PTR:
+ mono_type_get_name_recurse (type->data.type, str, FALSE, include_arity);
+ g_string_append_c (str, '*');
+ break;
+ default:
+ klass = mono_class_from_mono_type (type);
+ if (klass->nested_in) {
+ mono_type_get_name_recurse (
+ &klass->nested_in->byval_arg, str, TRUE, include_arity);
+ g_string_append_c (str, '+');
+ }
+ if (*klass->name_space) {
+ g_string_append (str, klass->name_space);
+ g_string_append_c (str, '.');
+ }
+ if (!include_arity) {
+ char *s = strchr (klass->name, '`');
+ int len = s ? s - klass->name : strlen (klass->name);
+
+ g_string_append_len (str, klass->name, len);
+ } else
+ g_string_append (str, klass->name);
+ if (is_recursed)
+ break;
+ if (klass->generic_inst) {
+ MonoGenericInst *ginst = klass->generic_inst;
+ int i;
+
+ g_string_append_c (str, '<');
+ for (i = 0; i < ginst->type_argc; i++) {
+ if (i)
+ g_string_append_c (str, ',');
+ mono_type_get_name_recurse (
+ ginst->type_argv [i], str, FALSE, include_arity);
+ }
+ g_string_append_c (str, '>');
+ } else if (klass->generic_container) {
+ int i;
+
+ g_string_append_c (str, '<');
+ for (i = 0; i < klass->generic_container->type_argc; i++) {
+ if (i)
+ g_string_append_c (str, ',');
+ g_string_append (str, klass->generic_container->type_params [i].name);
+ }
+ g_string_append_c (str, '>');
+ }
+ break;
+ }
+}
+
+/*
+ * mono_type_get_name:
+ * @type: a type
+ *
+ * Returns the string representation for type as required by System.Reflection.
+ * The inverse of mono_reflection_parse_type ().
+ */
+static char*
+_mono_type_get_name (MonoType *type, gboolean is_recursed, gboolean include_arity)
+{
+ GString* result = g_string_new ("");
+ mono_type_get_name_recurse (type, result, is_recursed, include_arity);
+
+ if (type->byref)
+ g_string_append_c (result, '&');
+
+ return g_string_free (result, FALSE);
+}
+
+char*
+mono_type_get_name (MonoType *type)
+{
+ return _mono_type_get_name (type, TRUE, TRUE);
+}
+
+char*
+mono_type_get_full_name (MonoType *type)
+{
+ return _mono_type_get_name (type, FALSE, TRUE);
+}
+
+MonoType*
+mono_type_get_underlying_type (MonoType *type)
+{
+ switch (type->type) {
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype)
+ return type->data.klass->enum_basetype;
+ break;
+ case MONO_TYPE_GENERICINST:
+ return mono_type_get_underlying_type (type->data.generic_inst->generic_type);
+ default:
+ break;
+ }
+
+ return type;
+}
+
+gboolean
+mono_class_is_open_constructed_type (MonoType *t)
+{
+ switch (t->type) {
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ return TRUE;
+ case MONO_TYPE_SZARRAY:
+ return mono_class_is_open_constructed_type (&t->data.klass->byval_arg);
+ case MONO_TYPE_ARRAY:
+ return mono_class_is_open_constructed_type (&t->data.array->eklass->byval_arg);
+ case MONO_TYPE_PTR:
+ return mono_class_is_open_constructed_type (t->data.type);
+ case MONO_TYPE_GENERICINST: {
+ MonoGenericInst *ginst = t->data.generic_inst;
+ int i;
+
+ if (mono_class_is_open_constructed_type (ginst->generic_type))
+ return TRUE;
+ for (i = 0; i < ginst->type_argc; i++)
+ if (mono_class_is_open_constructed_type (ginst->type_argv [i]))
+ return TRUE;
+ return FALSE;
+ }
+ default:
+ return FALSE;
+ }
+}
+
+static MonoType*
+inflate_generic_type (MonoType *type, MonoGenericContext *context)
+{
+ switch (type->type) {
+ case MONO_TYPE_MVAR:
+ if (context->gmethod && context->gmethod->mtype_argv)
+ return dup_type (
+ context->gmethod->mtype_argv [type->data.generic_param->num],
+ type);
+ else
+ return NULL;
+ case MONO_TYPE_VAR:
+ if (context->ginst)
+ return dup_type (
+ context->ginst->type_argv [type->data.generic_param->num],
+ type);
+ else
+ return NULL;
+ case MONO_TYPE_SZARRAY: {
+ MonoClass *eclass = type->data.klass;
+ MonoType *nt, *inflated = inflate_generic_type (&eclass->byval_arg, context);
+ if (!inflated)
+ return NULL;
+ nt = dup_type (type, type);
+ nt->data.klass = mono_class_from_mono_type (inflated);
+ return nt;
+ }
+ case MONO_TYPE_GENERICINST: {
+ MonoGenericInst *oginst = type->data.generic_inst;
+ MonoGenericInst *nginst, *cached;
+ MonoType *nt;
+ int i;
+
+ nginst = g_new0 (MonoGenericInst, 1);
+ *nginst = *oginst;
+
+ nginst->is_open = FALSE;
+
+ nginst->type_argv = g_new0 (MonoType *, oginst->type_argc);
+
+ for (i = 0; i < oginst->type_argc; i++) {
+ MonoType *t = oginst->type_argv [i];
+ nginst->type_argv [i] = mono_class_inflate_generic_type (t, context);
+
+ if (!nginst->is_open)
+ nginst->is_open = mono_class_is_open_constructed_type (nginst->type_argv [i]);
+ };
+
+ nginst->klass = NULL;
+
+ nginst->context = g_new0 (MonoGenericContext, 1);
+ nginst->context->ginst = nginst;
+
+ mono_loader_lock ();
+ cached = g_hash_table_lookup (oginst->klass->image->generic_inst_cache, nginst);
+
+ if (cached) {
+ g_free (nginst->type_argv);
+ g_free (nginst);
+ mono_loader_unlock ();
+
+ nt = dup_type (type, type);
+ nt->data.generic_inst = cached;
+ return nt;
+ }
+
+ nginst->dynamic_info = NULL;
+ nginst->initialized = FALSE;
+
+ mono_class_create_generic (nginst);
+
+ mono_stats.generic_instance_count++;
+ mono_stats.generics_metadata_size += sizeof (MonoGenericInst) +
+ sizeof (MonoGenericContext) +
+ nginst->type_argc * sizeof (MonoType);
+
+ nt = dup_type (type, type);
+ nt->data.generic_inst = nginst;
+ g_hash_table_insert (oginst->klass->image->generic_inst_cache, nginst, nginst);
+ mono_loader_unlock ();
+ return nt;
+ }
+ default:
+ return NULL;
+ }
+ return NULL;
+}
+
+MonoType*
+mono_class_inflate_generic_type (MonoType *type, MonoGenericContext *context)
+{
+ MonoType *inflated = inflate_generic_type (type, context);
+
+ if (!inflated)
+ return type;
+
+ mono_stats.inflated_type_count++;
+ return inflated;
+}
+
+static MonoMethodSignature*
+inflate_generic_signature (MonoImage *image, MonoMethodSignature *sig,
+ MonoGenericContext *context)
+{
+ MonoMethodSignature *res;
+ int i;
+ res = mono_metadata_signature_alloc (image, sig->param_count);
+ res->ret = mono_class_inflate_generic_type (sig->ret, context);
+ for (i = 0; i < sig->param_count; ++i)
+ res->params [i] = mono_class_inflate_generic_type (sig->params [i], context);
+ res->hasthis = sig->hasthis;
+ res->explicit_this = sig->explicit_this;
+ res->call_convention = sig->call_convention;
+ res->generic_param_count = sig->generic_param_count;
+ res->is_inflated = 1;
+ return res;
+}
+
+static MonoMethodHeader*
+inflate_generic_header (MonoMethodHeader *header, MonoGenericContext *context)
+{
+ MonoMethodHeader *res;
+ int i;
+ res = g_malloc0 (sizeof (MonoMethodHeader) + sizeof (gpointer) * header->num_locals);
+ res->code = header->code;
+ res->code_size = header->code_size;
+ res->max_stack = header->max_stack;
+ res->num_clauses = header->num_clauses;
+ res->init_locals = header->init_locals;
+ res->num_locals = header->num_locals;
+ res->clauses = header->clauses;
+ for (i = 0; i < header->num_locals; ++i)
+ res->locals [i] = mono_class_inflate_generic_type (header->locals [i], context);
+ return res;
+}
+
+MonoMethod*
+mono_class_inflate_generic_method (MonoMethod *method, MonoGenericContext *context,
+ MonoClass *klass)
+{
+ MonoMethodInflated *result;
+ MonoClass *rklass;
+
+ if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+ return method;
+
+ mono_stats.inflated_method_count++;
+ mono_stats.generics_metadata_size +=
+ sizeof (MonoMethodInflated) - sizeof (MonoMethodNormal);
+
+ result = g_new0 (MonoMethodInflated, 1);
+ result->nmethod = *(MonoMethodNormal*)method;
+
+ if (mono_method_get_header (method))
+ result->nmethod.header = inflate_generic_header (
+ mono_method_get_header (method), context);
+
+ if (klass)
+ rklass = result->nmethod.method.klass = klass;
+ else {
+ MonoType *declaring = mono_class_inflate_generic_type (&method->klass->byval_arg, context);
+ rklass = result->nmethod.method.klass = mono_class_from_mono_type (declaring);
+ }
+
+ result->nmethod.method.signature = inflate_generic_signature (
+ method->klass->image, method->signature, context);
+
+ if (context->gmethod) {
+ result->context = g_new0 (MonoGenericContext, 1);
+ result->context->gmethod = context->gmethod;
+ result->context->ginst = rklass->generic_inst;
+
+ mono_stats.generics_metadata_size += sizeof (MonoGenericContext);
+ } else if (rklass->generic_inst)
+ result->context = rklass->generic_inst->context;
+
+ if (method->signature->is_inflated)
+ result->declaring = ((MonoMethodInflated *) method)->declaring;
+ else
+ result->declaring = method;
+
+ return (MonoMethod *) result;
+}
+
/**
* class_compute_field_layout:
* @m: pointer to the metadata.
* @class: The class to initialize
- * @pack: the value from the .pack directive (or 0)
*
* Initializes the class->fields.
*
@@ -113,14 +453,54 @@ mono_class_from_typeref (MonoImage *image, guint32 type_token)
* a good job at it. This is temporary to get the code for Paolo.
*/
static void
-class_compute_field_layout (MonoClass *class, int pack)
+class_compute_field_layout (MonoClass *class)
{
MonoImage *m = class->image;
const int top = class->field.count;
guint32 layout = class->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
MonoTableInfo *t = &m->tables [MONO_TABLE_FIELD];
- int i;
+ int i, blittable = TRUE, real_size = 0;
guint32 rva;
+ guint32 packing_size = 0;
+ gboolean explicit_size;
+ MonoClassField *field;
+
+ if (class->size_inited)
+ return;
+
+ if (class->parent) {
+ if (!class->parent->size_inited)
+ class_compute_field_layout (class->parent);
+ class->instance_size += class->parent->instance_size;
+ class->min_align = class->parent->min_align;
+ blittable = class->parent->blittable;
+ } else {
+ class->instance_size = sizeof (MonoObject);
+ class->min_align = 1;
+ }
+
+ /* Get the real size */
+ explicit_size = mono_metadata_packing_from_typedef (class->image, class->type_token, &packing_size, &real_size);
+
+ if (explicit_size) {
+ g_assert ((packing_size & 0xfffffff0) == 0);
+ class->packing_size = packing_size;
+ real_size += class->instance_size;
+ }
+
+ if (!top) {
+ if (explicit_size && real_size) {
+ class->instance_size = MAX (real_size, class->instance_size);
+ }
+ class->size_inited = 1;
+ class->blittable = blittable;
+ return;
+ }
+
+ if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+ blittable = FALSE;
+
+ class->fields = g_new0 (MonoClassField, top);
/*
* Fetch all the field information.
@@ -129,88 +509,218 @@ class_compute_field_layout (MonoClass *class, int pack)
const char *sig;
guint32 cols [MONO_FIELD_SIZE];
int idx = class->field.first + i;
-
- mono_metadata_decode_row (t, idx, cols, CSIZE (cols));
+ MonoGenericContainer *container = NULL;
+
+ field = &class->fields [i];
+ mono_metadata_decode_row (t, idx, cols, MONO_FIELD_SIZE);
/* The name is needed for fieldrefs */
- class->fields [i].name = mono_metadata_string_heap (m, cols [MONO_FIELD_NAME]);
+ field->name = mono_metadata_string_heap (m, cols [MONO_FIELD_NAME]);
sig = mono_metadata_blob_heap (m, cols [MONO_FIELD_SIGNATURE]);
mono_metadata_decode_value (sig, &sig);
/* FIELD signature == 0x06 */
g_assert (*sig == 0x06);
- class->fields [i].type = mono_metadata_parse_field_type (
- m, cols [MONO_FIELD_FLAGS], sig + 1, &sig);
+ if (class->generic_container)
+ container = class->generic_container;
+ else if (class->generic_inst) {
+ g_assert (class->generic_inst->container);
+ container = class->generic_inst->container;
+ }
+ field->type = mono_metadata_parse_type_full (
+ m, container, MONO_PARSE_FIELD, cols [MONO_FIELD_FLAGS], sig + 1, &sig);
+ if (mono_field_is_deleted (field))
+ continue;
+ if (class->generic_inst) {
+ field->type = mono_class_inflate_generic_type (
+ field->type, class->generic_inst->context);
+ field->type->attrs = cols [MONO_FIELD_FLAGS];
+ }
+
+ field->parent = class;
+
+ /* Only do these checks if we still think this type is blittable */
+ if (blittable && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC)) {
+ if (field->type->byref || MONO_TYPE_IS_REFERENCE (field->type)) {
+ blittable = FALSE;
+ } else {
+ MonoClass *field_class = mono_class_from_mono_type (field->type);
+ if (!field_class || !field_class->blittable)
+ blittable = FALSE;
+ }
+ }
+
+ if (layout == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) {
+ mono_metadata_field_info (m, idx, &field->offset, NULL, NULL);
+ if (field->offset == (guint32)-1 && !(field->type->attrs & FIELD_ATTRIBUTE_STATIC))
+ g_warning ("%s not initialized correctly (missing field layout info for %s)", class->name, field->name);
+ }
+
if (cols [MONO_FIELD_FLAGS] & FIELD_ATTRIBUTE_HAS_FIELD_RVA) {
mono_metadata_field_info (m, idx, NULL, &rva, NULL);
if (!rva)
- g_warning ("field %s in %s should have RVA data, but hasn't", class->fields [i].name, class->name);
- class->fields [i].data = mono_cli_rva_map (class->image->image_info, rva);
+ g_warning ("field %s in %s should have RVA data, but hasn't", field->name, class->name);
+ field->data = mono_image_rva_map (class->image, rva);
}
+
if (class->enumtype && !(cols [MONO_FIELD_FLAGS] & FIELD_ATTRIBUTE_STATIC)) {
- class->enum_basetype = class->fields [i].type;
- class->element_class = mono_class_from_mono_type (class->enum_basetype);
+ class->enum_basetype = field->type;
+ class->cast_class = class->element_class = mono_class_from_mono_type (class->enum_basetype);
+ blittable = class->element_class->blittable;
}
+
+ /* The def_value of fields is compute lazily during vtable creation */
}
+
+ if (class == mono_defaults.string_class)
+ blittable = FALSE;
+
+ class->blittable = blittable;
+
if (class->enumtype && !class->enum_basetype) {
if (!((strcmp (class->name, "Enum") == 0) && (strcmp (class->name_space, "System") == 0)))
G_BREAKPOINT ();
}
+ if (explicit_size && real_size) {
+ class->instance_size = MAX (real_size, class->instance_size);
+ }
+
+ if (class->generic_container ||
+ (class->generic_inst && class->generic_inst->is_open))
+ return;
+
+ mono_class_layout_fields (class);
+}
+
+void
+mono_class_layout_fields (MonoClass *class)
+{
+ int i;
+ const int top = class->field.count;
+ guint32 layout = class->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
+ guint32 pass, passes, real_size;
+ gboolean gc_aware_layout = FALSE;
+ MonoClassField *field;
+
+ /*
+ * Enable GC aware auto layout: in this mode, reference
+ * fields are grouped together inside objects, increasing collector
+ * performance.
+ * Requires that all classes whose layout is known to native code be annotated
+ * with [StructLayout (LayoutKind.Sequential)]
+ * Value types have gc_aware_layout disabled by default, as per
+ * what the default is for other runtimes.
+ */
+ /* corlib is missing [StructLayout] directives in many places */
+ if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+ if (class->image != mono_defaults.corlib &&
+ class->byval_arg.type != MONO_TYPE_VALUETYPE)
+ gc_aware_layout = TRUE;
+ }
+
/*
* Compute field layout and total size (not considering static fields)
*/
+
switch (layout) {
case TYPE_ATTRIBUTE_AUTO_LAYOUT:
case TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT:
- for (i = 0; i < top; i++){
- int size, align;
-
- if (class->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
- continue;
- size = mono_type_size (class->fields [i].type, &align);
+ if (gc_aware_layout)
+ passes = 2;
+ else
+ passes = 1;
- /* FIXME (LAMESPEC): should we also change the min alignment according to pack? */
- align = pack? MIN (pack, align): align;
- class->min_align = MAX (align, class->min_align);
- class->fields [i].offset = class->instance_size;
- class->fields [i].offset += align - 1;
- class->fields [i].offset &= ~(align - 1);
- class->instance_size = class->fields [i].offset + size;
- }
+ if (layout != TYPE_ATTRIBUTE_AUTO_LAYOUT)
+ passes = 1;
+
+ if (class->parent)
+ real_size = class->parent->instance_size;
+ else
+ real_size = sizeof (MonoObject);
+
+ for (pass = 0; pass < passes; ++pass) {
+ for (i = 0; i < top; i++){
+ int size, align;
+ field = &class->fields [i];
+
+ if (mono_field_is_deleted (field))
+ continue;
+ if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+
+ if (gc_aware_layout) {
+ /*
+ * We process fields with reference type in the first pass,
+ * and fields with non-reference type in the second pass.
+ * We use IS_POINTER instead of IS_REFERENCE because in
+ * some internal structures, we store GC_MALLOCed memory
+ * in IntPtr fields...
+ */
+ if (MONO_TYPE_IS_POINTER (field->type)) {
+ if (pass == 1)
+ continue;
+ } else {
+ if (pass == 0)
+ continue;
+ }
+ }
+
+ if ((top == 1) && (class->instance_size == sizeof (MonoObject)) &&
+ (strcmp (field->name, "$PRIVATE$") == 0)) {
+ /* This field is a hack inserted by MCS to empty structures */
+ continue;
+ }
+
+ size = mono_type_size (field->type, &align);
+
+ /* FIXME (LAMESPEC): should we also change the min alignment according to pack? */
+ align = class->packing_size ? MIN (class->packing_size, align): align;
+ class->min_align = MAX (align, class->min_align);
+ field->offset = real_size;
+ field->offset += align - 1;
+ field->offset &= ~(align - 1);
+ real_size = field->offset + size;
+ }
+
+ class->instance_size = MAX (real_size, class->instance_size);
- if (class->instance_size & (class->min_align - 1)) {
- class->instance_size += class->min_align - 1;
- class->instance_size &= ~(class->min_align - 1);
+ if (class->instance_size & (class->min_align - 1)) {
+ class->instance_size += class->min_align - 1;
+ class->instance_size &= ~(class->min_align - 1);
+ }
}
break;
case TYPE_ATTRIBUTE_EXPLICIT_LAYOUT:
+ real_size = 0;
for (i = 0; i < top; i++) {
int size, align;
- int idx = class->field.first + i;
+ field = &class->fields [i];
/*
* There must be info about all the fields in a type if it
* uses explicit layout.
*/
- if (class->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
+ if (mono_field_is_deleted (field))
+ continue;
+ if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
continue;
- size = mono_type_size (class->fields [i].type, &align);
+ size = mono_type_size (field->type, &align);
- mono_metadata_field_info (m, idx, &class->fields [i].offset, NULL, NULL);
- if (class->fields [i].offset == (guint32)-1)
- g_warning ("%s not initialized correctly (missing field layout info for %s)", class->name, class->fields [i].name);
/*
+ * When we get here, field->offset is already set by the
+ * loader (for either runtime fields or fields loaded from metadata).
* The offset is from the start of the object: this works for both
* classes and valuetypes.
*/
- class->fields [i].offset += sizeof (MonoObject);
+ field->offset += sizeof (MonoObject);
+
/*
* Calc max size.
*/
- size += class->fields [i].offset;
- class->instance_size = MAX (class->instance_size, size);
+ real_size = MAX (real_size, size + field->offset);
}
+ class->instance_size = MAX (real_size, class->instance_size);
break;
}
@@ -219,42 +729,20 @@ class_compute_field_layout (MonoClass *class, int pack)
/*
* Compute static field layout and size
*/
- switch (layout) {
- case TYPE_ATTRIBUTE_AUTO_LAYOUT:
- case TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT:
- for (i = 0; i < top; i++){
- int size, align;
-
- if (!(class->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC))
- continue;
+ for (i = 0; i < top; i++){
+ int size, align;
+ field = &class->fields [i];
- size = mono_type_size (class->fields [i].type, &align);
- class->fields [i].offset = class->class_size;
- class->fields [i].offset += align - 1;
- class->fields [i].offset &= ~(align - 1);
- class->class_size = class->fields [i].offset + size;
- }
- break;
- case TYPE_ATTRIBUTE_EXPLICIT_LAYOUT:
- for (i = 0; i < top; i++){
- int size, align;
-
- /*
- * There must be info about all the fields in a type if it
- * uses explicit layout.
- */
-
+ if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC) || field->type->attrs & FIELD_ATTRIBUTE_LITERAL)
+ continue;
+ if (mono_field_is_deleted (field))
+ continue;
- if (!(class->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC))
- continue;
-
- size = mono_type_size (class->fields [i].type, &align);
- class->fields [i].offset = class->class_size;
- class->fields [i].offset += align - 1;
- class->fields [i].offset &= ~(align - 1);
- class->class_size = class->fields [i].offset + size;
- }
- break;
+ size = mono_type_size (field->type, &align);
+ field->offset = class->class_size;
+ field->offset += align - 1;
+ field->offset &= ~(align - 1);
+ class->class_size = field->offset + size;
}
}
@@ -272,6 +760,7 @@ init_properties (MonoClass *class)
class->properties = g_new0 (MonoProperty, class->property.count);
for (i = class->property.first; i < class->property.last; ++i) {
mono_metadata_decode_row (pt, i, cols, MONO_PROPERTY_SIZE);
+ class->properties [i - class->property.first].parent = class;
class->properties [i - class->property.first].attrs = cols [MONO_PROPERTY_FLAGS];
class->properties [i - class->property.first].name = mono_metadata_string_heap (class->image, cols [MONO_PROPERTY_NAME]);
@@ -305,24 +794,39 @@ init_events (MonoClass *class)
class->events = g_new0 (MonoEvent, class->event.count);
for (i = class->event.first; i < class->event.last; ++i) {
+ MonoEvent *event = &class->events [i - class->event.first];
+
mono_metadata_decode_row (pt, i, cols, MONO_EVENT_SIZE);
- class->events [i - class->event.first].attrs = cols [MONO_EVENT_FLAGS];
- class->events [i - class->event.first].name = mono_metadata_string_heap (class->image, cols [MONO_EVENT_NAME]);
+ event->parent = class;
+ event->attrs = cols [MONO_EVENT_FLAGS];
+ event->name = mono_metadata_string_heap (class->image, cols [MONO_EVENT_NAME]);
startm = mono_metadata_methods_from_event (class->image, i, &endm);
for (j = startm; j < endm; ++j) {
mono_metadata_decode_row (msemt, j, cols, MONO_METHOD_SEMA_SIZE);
switch (cols [MONO_METHOD_SEMA_SEMANTICS]) {
case METHOD_SEMANTIC_ADD_ON:
- class->events [i - class->event.first].add = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+ event->add = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
break;
case METHOD_SEMANTIC_REMOVE_ON:
- class->events [i - class->event.first].remove = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+ event->remove = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
break;
case METHOD_SEMANTIC_FIRE:
- class->events [i - class->event.first].raise = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+ event->raise = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
+ break;
+ case METHOD_SEMANTIC_OTHER: {
+ int n = 0;
+
+ if (event->other == NULL) {
+ event->other = g_new0 (MonoMethod*, 1);
+ } else {
+ while (event->other [n])
+ n++;
+ event->other = g_realloc (event->other, (n + 1) * sizeof (MonoMethod*));
+ }
+ event->other [n] = class->methods [cols [MONO_METHOD_SEMA_METHOD] - 1 - class->method.first];
break;
- case METHOD_SEMANTIC_OTHER: /* don't care for now */
+ }
default:
break;
}
@@ -339,7 +843,9 @@ mono_get_unique_iid (MonoClass *class)
char *str;
gpointer value;
- g_assert (class->flags & TYPE_ATTRIBUTE_INTERFACE);
+ g_assert (MONO_CLASS_IS_INTERFACE (class));
+
+ mono_loader_lock ();
if (!iid_hash)
iid_hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -347,6 +853,7 @@ mono_get_unique_iid (MonoClass *class)
str = g_strdup_printf ("%s|%s.%s\n", class->image->name, class->name_space, class->name);
if (g_hash_table_lookup_extended (iid_hash, str, NULL, &value)) {
+ mono_loader_unlock ();
g_free (str);
return (guint)value;
} else {
@@ -354,109 +861,43 @@ mono_get_unique_iid (MonoClass *class)
++iid;
}
+ mono_loader_unlock ();
+
return iid - 1;
}
-/**
- * mono_class_init:
- * @class: the class to initialize
- *
- * compute the instance_size, class_size and other infos that cannot be
- * computed at mono_class_get() time. Also compute a generic vtable and
- * the method slot numbers. We use this infos later to create a domain
- * specific vtable.
- */
-void
-mono_class_init (MonoClass *class)
+static void
+collect_implemented_interfaces_aux (MonoClass *klass, GPtrArray **res)
{
- MonoClass *k, *ic;
- MonoMethod **vtable;
- int i, max_vtsize = 0, max_iid, cur_slot = 0;
- static MonoMethod *default_ghc = NULL;
- static MonoMethod *default_finalize = NULL;
- static int finalize_slot = -1;
- static int ghc_slot = -1;
- guint32 packing_size = 0;
-
- g_assert (class);
-
- if (class->inited)
- return;
-
- if (class->init_pending) {
- /* this indicates a cyclic dependency */
- g_error ("pending init %s.%s\n", class->name_space, class->name);
- }
-
- class->init_pending = 1;
-
- mono_stats.initialized_class_count++;
-
- if (class->parent) {
- if (!class->parent->inited)
- mono_class_init (class->parent);
- class->instance_size += class->parent->instance_size;
- class->class_size += class->parent->class_size;
- class->min_align = class->parent->min_align;
- cur_slot = class->parent->vtable_size;
- } else
- class->min_align = 1;
-
- if (mono_metadata_packing_from_typedef (class->image, class->type_token, &packing_size, &class->instance_size))
- class->instance_size += sizeof (MonoObject);
- /* use packing_size in field layout */
-
- /*
- * Computes the size used by the fields, and their locations
- */
- if (!class->size_inited && class->field.count > 0){
- class->fields = g_new0 (MonoClassField, class->field.count);
- class_compute_field_layout (class, packing_size);
- }
-
- if (!(class->flags & TYPE_ATTRIBUTE_INTERFACE)) {
- for (i = 0; i < class->interface_count; i++)
- max_vtsize += class->interfaces [i]->method.count;
+ int i;
+ MonoClass *ic;
- if (class->parent)
- max_vtsize += class->parent->vtable_size;
-
- max_vtsize += class->method.count;
- }
+ for (i = 0; i < klass->interface_count; i++) {
+ ic = klass->interfaces [i];
- vtable = alloca (sizeof (gpointer) * max_vtsize);
- memset (vtable, 0, sizeof (gpointer) * max_vtsize);
+ if (*res == NULL)
+ *res = g_ptr_array_new ();
+ g_ptr_array_add (*res, ic);
- /* initialize method pointers */
- class->methods = g_new (MonoMethod*, class->method.count);
- for (i = 0; i < class->method.count; ++i)
- class->methods [i] = mono_get_method (class->image,
- MONO_TOKEN_METHOD_DEF | (i + class->method.first + 1), class);
-
- init_properties (class);
- init_events (class);
-
- i = mono_metadata_nesting_typedef (class->image, class->type_token);
- while (i) {
- MonoClass* nclass;
- guint32 cols [MONO_NESTED_CLASS_SIZE];
- mono_metadata_decode_row (&class->image->tables [MONO_TABLE_NESTEDCLASS], i - 1, cols, MONO_NESTED_CLASS_SIZE);
- if (cols [MONO_NESTED_CLASS_ENCLOSING] != mono_metadata_token_index (class->type_token))
- break;
- nclass = mono_class_create_from_typedef (class->image, MONO_TOKEN_TYPE_DEF | cols [MONO_NESTED_CLASS_NESTED]);
- class->nested_classes = g_list_prepend (class->nested_classes, nclass);
- ++i;
+ collect_implemented_interfaces_aux (ic, res);
}
+}
- if (class->flags & TYPE_ATTRIBUTE_INTERFACE) {
- for (i = 0; i < class->method.count; ++i)
- class->methods [i]->slot = i;
- class->init_pending = 0;
- class->inited = 1;
- return;
- }
+GPtrArray*
+mono_class_get_implemented_interfaces (MonoClass *klass)
+{
+ GPtrArray *res = NULL;
- /* printf ("METAINIT %s.%s\n", class->name_space, class->name); */
+ collect_implemented_interfaces_aux (klass, &res);
+ return res;
+}
+
+static int
+setup_interface_offsets (MonoClass *class, int cur_slot)
+{
+ MonoClass *k, *ic;
+ int i, max_iid;
+ GPtrArray *ifaces;
/* compute maximum number of slots and maximum interface id */
max_iid = 0;
@@ -471,7 +912,11 @@ mono_class_init (MonoClass *class)
max_iid = ic->interface_id;
}
}
-
+
+ if (MONO_CLASS_IS_INTERFACE (class)) {
+ if (max_iid < class->interface_id)
+ max_iid = class->interface_id;
+ }
class->max_interface_id = max_iid;
/* compute vtable offset for interfaces */
class->interface_offsets = g_malloc (sizeof (gpointer) * (max_iid + 1));
@@ -479,46 +924,123 @@ mono_class_init (MonoClass *class)
for (i = 0; i <= max_iid; i++)
class->interface_offsets [i] = -1;
- for (i = 0; i < class->interface_count; i++) {
- ic = class->interfaces [i];
- class->interface_offsets [ic->interface_id] = cur_slot;
- cur_slot += ic->method.count;
+ ifaces = mono_class_get_implemented_interfaces (class);
+ if (ifaces) {
+ for (i = 0; i < ifaces->len; ++i) {
+ ic = g_ptr_array_index (ifaces, i);
+ class->interface_offsets [ic->interface_id] = cur_slot;
+ cur_slot += ic->method.count;
+ }
+ g_ptr_array_free (ifaces, TRUE);
}
for (k = class->parent; k ; k = k->parent) {
- for (i = 0; i < k->interface_count; i++) {
- ic = k->interfaces [i];
- if (class->interface_offsets [ic->interface_id] == -1) {
- int io = k->interface_offsets [ic->interface_id];
+ ifaces = mono_class_get_implemented_interfaces (k);
+ if (ifaces) {
+ for (i = 0; i < ifaces->len; ++i) {
+ ic = g_ptr_array_index (ifaces, i);
+
+ if (class->interface_offsets [ic->interface_id] == -1) {
+ int io = k->interface_offsets [ic->interface_id];
- g_assert (io >= 0);
- g_assert (io <= max_vtsize);
+ g_assert (io >= 0);
- class->interface_offsets [ic->interface_id] = io;
+ class->interface_offsets [ic->interface_id] = io;
+ }
}
+ g_ptr_array_free (ifaces, TRUE);
}
}
+ if (MONO_CLASS_IS_INTERFACE (class))
+ class->interface_offsets [class->interface_id] = cur_slot;
+
+ return cur_slot;
+}
+
+void
+mono_class_setup_vtable (MonoClass *class, MonoMethod **overrides, int onum)
+{
+ MonoClass *k, *ic;
+ MonoMethod **vtable;
+ int i, max_vtsize = 0, max_iid, cur_slot = 0;
+ GPtrArray *ifaces;
+ MonoGHashTable *override_map = NULL;
+
+ /* setup_vtable() must be called only once on the type */
+ if (class->interface_offsets) {
+ g_warning ("vtable already computed in %s.%s", class->name_space, class->name);
+ return;
+ }
+
+ ifaces = mono_class_get_implemented_interfaces (class);
+ if (ifaces) {
+ for (i = 0; i < ifaces->len; i++) {
+ MonoClass *ic = g_ptr_array_index (ifaces, i);
+ max_vtsize += ic->method.count;
+ }
+ g_ptr_array_free (ifaces, TRUE);
+ }
+
+ if (class->parent) {
+ max_vtsize += class->parent->vtable_size;
+ cur_slot = class->parent->vtable_size;
+ }
+
+ max_vtsize += class->method.count;
+
+ vtable = alloca (sizeof (gpointer) * max_vtsize);
+ memset (vtable, 0, sizeof (gpointer) * max_vtsize);
+
+ /* printf ("METAINIT %s.%s\n", class->name_space, class->name); */
+
+ cur_slot = setup_interface_offsets (class, cur_slot);
+ max_iid = class->max_interface_id;
+
if (class->parent && class->parent->vtable_size)
memcpy (vtable, class->parent->vtable, sizeof (gpointer) * class->parent->vtable_size);
-
+
+ /* override interface methods */
+ for (i = 0; i < onum; i++) {
+ MonoMethod *decl = overrides [i*2];
+ if (MONO_CLASS_IS_INTERFACE (decl->klass)) {
+ int dslot;
+ g_assert (decl->slot != -1);
+ dslot = decl->slot + class->interface_offsets [decl->klass->interface_id];
+ vtable [dslot] = overrides [i*2 + 1];
+ vtable [dslot]->slot = dslot;
+ if (!override_map)
+ override_map = mono_g_hash_table_new (NULL, NULL);
+
+ mono_g_hash_table_insert (override_map, overrides [i * 2], overrides [i * 2 + 1]);
+ }
+ }
+
for (k = class; k ; k = k->parent) {
- for (i = 0; i < k->interface_count; i++) {
+ int nifaces = 0;
+ ifaces = mono_class_get_implemented_interfaces (k);
+ if (ifaces)
+ nifaces = ifaces->len;
+ for (i = 0; i < nifaces; i++) {
int j, l, io;
- ic = k->interfaces [i];
+ ic = g_ptr_array_index (ifaces, i);
io = k->interface_offsets [ic->interface_id];
-
+
g_assert (io >= 0);
g_assert (io <= max_vtsize);
if (k == class) {
for (l = 0; l < ic->method.count; l++) {
MonoMethod *im = ic->methods [l];
+
+ if (vtable [io + l] && !(vtable [io + l]->flags & METHOD_ATTRIBUTE_ABSTRACT))
+ continue;
+
for (j = 0; j < class->method.count; ++j) {
MonoMethod *cm = class->methods [j];
if (!(cm->flags & METHOD_ATTRIBUTE_VIRTUAL) ||
- !(cm->flags & METHOD_ATTRIBUTE_PUBLIC) ||
+ !((cm->flags & METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == METHOD_ATTRIBUTE_PUBLIC) ||
!(cm->flags & METHOD_ATTRIBUTE_NEW_SLOT))
continue;
if (!strcmp(cm->name, im->name) &&
@@ -540,7 +1062,7 @@ mono_class_init (MonoClass *class)
g_assert (io + l <= max_vtsize);
- if (vtable [io + l])
+ if (vtable [io + l] && !(vtable [io + l]->flags & METHOD_ATTRIBUTE_ABSTRACT))
continue;
for (k1 = class; k1; k1 = k1->parent) {
@@ -560,34 +1082,50 @@ mono_class_init (MonoClass *class)
}
g_assert (io + l <= max_vtsize);
- if (vtable [io + l])
+ if (vtable [io + l] && !(vtable [io + l]->flags & METHOD_ATTRIBUTE_ABSTRACT))
break;
}
}
for (l = 0; l < ic->method.count; l++) {
MonoMethod *im = ic->methods [l];
- char *qname, *fqname;
+ char *qname, *fqname, *cname, *the_cname;
+ MonoClass *k1;
- qname = g_strconcat (ic->name, ".", im->name, NULL);
+ if (vtable [io + l])
+ continue;
+
+ if (ic->generic_inst) {
+ MonoClass *the_ic = mono_class_from_mono_type (ic->generic_inst->generic_type);
+ the_cname = _mono_type_get_name (&the_ic->byval_arg, TRUE, FALSE);
+ cname = the_cname;
+ } else {
+ the_cname = NULL;
+ cname = (char*)ic->name;
+ }
+
+ qname = g_strconcat (cname, ".", im->name, NULL);
if (ic->name_space && ic->name_space [0])
- fqname = g_strconcat (ic->name_space, ".", ic->name, ".", im->name, NULL);
+ fqname = g_strconcat (ic->name_space, ".", cname, ".", im->name, NULL);
else
fqname = NULL;
- for (j = 0; j < class->method.count; ++j) {
- MonoMethod *cm = class->methods [j];
+ for (k1 = class; k1; k1 = k1->parent) {
+ for (j = 0; j < k1->method.count; ++j) {
+ MonoMethod *cm = k1->methods [j];
- if (!(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
- continue;
+ if (!(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
+ continue;
- if (((fqname && !strcmp (cm->name, fqname)) || !strcmp (cm->name, qname)) &&
- mono_metadata_signature_equal (cm->signature, im->signature)) {
- g_assert (io + l <= max_vtsize);
- vtable [io + l] = cm;
- break;
+ if (((fqname && !strcmp (cm->name, fqname)) || !strcmp (cm->name, qname)) &&
+ mono_metadata_signature_equal (cm->signature, im->signature)) {
+ g_assert (io + l <= max_vtsize);
+ vtable [io + l] = cm;
+ break;
+ }
}
}
+ g_free (the_cname);
g_free (qname);
g_free (fqname);
}
@@ -596,9 +1134,29 @@ mono_class_init (MonoClass *class)
if (!(class->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
for (l = 0; l < ic->method.count; l++) {
char *msig;
- MonoMethod *im = ic->methods [l];
+ MonoMethod *im = ic->methods [l];
+ if (im->flags & METHOD_ATTRIBUTE_STATIC)
+ continue;
g_assert (io + l <= max_vtsize);
+
+ /*
+ * If one of our parents already implements this interface
+ * we can inherit the implementation.
+ */
+ if (!(vtable [io + l])) {
+ MonoClass *parent = class->parent;
+
+ if ((ic->interface_id <= parent->max_interface_id) &&
+ (parent->interface_offsets [ic->interface_id]) &&
+ parent->vtable)
+ vtable [io + l] = parent->vtable [parent->interface_offsets [ic->interface_id] + l];
+ }
+
if (!(vtable [io + l])) {
+ for (j = 0; j < onum; ++j) {
+ g_print (" at slot %d: %s (%d) overrides %s (%d)\n", io+l, overrides [j*2+1]->name,
+ overrides [j*2+1]->slot, overrides [j*2]->name, overrides [j*2]->slot);
+ }
msig = mono_signature_get_desc (im->signature, FALSE);
printf ("no implementation for interface method %s.%s::%s(%s) in class %s.%s\n",
ic->name_space, ic->name, im->name, msig, class->name_space, class->name);
@@ -628,24 +1186,28 @@ mono_class_init (MonoClass *class)
}
}
}
+ if (ifaces)
+ g_ptr_array_free (ifaces, TRUE);
}
for (i = 0; i < class->method.count; ++i) {
MonoMethod *cm;
cm = class->methods [i];
-
-#if 0
- if (!(cm->flags & METHOD_ATTRIBUTE_VIRTUAL) ||
- (cm->slot >= 0))
- continue;
-#else /* EXT_VTABLE_HACK */
- if (cm->slot >= 0)
+ /*
+ * Non-virtual method have no place in the vtable.
+ * This also catches static methods (since they are not virtual).
+ */
+ if (!(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
continue;
-#endif
-
- if (!(cm->flags & METHOD_ATTRIBUTE_NEW_SLOT) && (cm->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
+
+ /*
+ * If the method is REUSE_SLOT, we must check in the
+ * base class for a method to override.
+ */
+ if (!(cm->flags & METHOD_ATTRIBUTE_NEW_SLOT)) {
+ int slot = -1;
for (k = class->parent; k ; k = k->parent) {
int j;
for (j = 0; j < k->method.count; ++j) {
@@ -654,31 +1216,67 @@ mono_class_init (MonoClass *class)
continue;
if (!strcmp(cm->name, m1->name) &&
mono_metadata_signature_equal (cm->signature, m1->signature)) {
- cm->slot = k->methods [j]->slot;
+ slot = k->methods [j]->slot;
g_assert (cm->slot < max_vtsize);
+ if (!override_map)
+ override_map = mono_g_hash_table_new (NULL, NULL);
+ mono_g_hash_table_insert (override_map, m1, cm);
break;
}
}
- if (cm->slot >= 0)
+ if (slot >= 0)
break;
}
+ if (slot >= 0)
+ cm->slot = slot;
}
if (cm->slot < 0)
cm->slot = cur_slot++;
- if (!(cm->flags & METHOD_ATTRIBUTE_ABSTRACT))
+ if (!(cm->flags & METHOD_ATTRIBUTE_ABSTRACT) && !cm->signature->generic_param_count)
vtable [cm->slot] = cm;
}
+ /* override non interface methods */
+ for (i = 0; i < onum; i++) {
+ MonoMethod *decl = overrides [i*2];
+ if (!MONO_CLASS_IS_INTERFACE (decl->klass)) {
+ g_assert (decl->slot != -1);
+ vtable [decl->slot] = overrides [i*2 + 1];
+ overrides [i * 2 + 1]->slot = decl->slot;
+ if (!override_map)
+ override_map = mono_g_hash_table_new (NULL, NULL);
+ mono_g_hash_table_insert (override_map, decl, overrides [i * 2 + 1]);
+ }
+ }
+
+ /*
+ * If a method occupies more than one place in the vtable, and it is
+ * overriden, then change the other occurances too.
+ */
+ if (override_map) {
+ for (i = 0; i < max_vtsize; ++i)
+ if (vtable [i]) {
+ MonoMethod *cm = mono_g_hash_table_lookup (override_map, vtable [i]);
+ if (cm)
+ vtable [i] = cm;
+ }
+
+ mono_g_hash_table_destroy (override_map);
+ }
+
+ if (class->generic_inst) {
+ MonoClass *gklass = mono_class_from_mono_type (class->generic_inst->generic_type);
+
+ mono_class_init (gklass);
+ class->vtable_size = gklass->vtable_size;
+ } else
+ class->vtable_size = cur_slot;
- class->vtable_size = cur_slot;
class->vtable = g_malloc0 (sizeof (gpointer) * class->vtable_size);
memcpy (class->vtable, vtable, sizeof (gpointer) * class->vtable_size);
- class->inited = 1;
- class->init_pending = 0;
-
if (mono_print_vtable) {
int icount = 0;
@@ -722,12 +1320,231 @@ mono_class_init (MonoClass *class)
}
}
}
+}
+
+/**
+ * mono_class_init:
+ * @class: the class to initialize
+ *
+ * compute the instance_size, class_size and other infos that cannot be
+ * computed at mono_class_get() time. Also compute a generic vtable and
+ * the method slot numbers. We use this infos later to create a domain
+ * specific vtable.
+ */
+void
+mono_class_init (MonoClass *class)
+{
+ int i;
+ static MonoMethod *default_ghc = NULL;
+ static MonoMethod *default_finalize = NULL;
+ static int finalize_slot = -1;
+ static int ghc_slot = -1;
+ MonoMethod **overrides;
+ int onum = 0;
+
+ g_assert (class);
+
+ if (class->inited)
+ return;
+
+ /*g_print ("Init class %s\n", class->name);*/
+
+ /* We do everything inside the lock to prevent races */
+ mono_loader_lock ();
+
+ if (class->inited) {
+ mono_loader_unlock ();
+ /* Somebody might have gotten in before us */
+ return;
+ }
+
+ if (class->init_pending) {
+ /* this indicates a cyclic dependency */
+ g_error ("pending init %s.%s\n", class->name_space, class->name);
+ }
+
+ class->init_pending = 1;
+
+ if (mono_debugger_start_class_init_func)
+ mono_debugger_start_class_init_func (class);
+
+ mono_stats.initialized_class_count++;
+
+ if (class->generic_inst && !class->generic_inst->is_dynamic) {
+ MonoGenericInst *ginst = class->generic_inst;
+ MonoClass *gklass;
+ GList *list;
+
+ gklass = mono_class_from_mono_type (ginst->generic_type);
+ mono_class_init (gklass);
+
+ if (ginst->parent)
+ class->parent = mono_class_from_mono_type (ginst->parent);
+ else
+ class->parent = gklass->parent;
+
+ mono_class_setup_parent (class, class->parent);
+
+ if (MONO_CLASS_IS_INTERFACE (class))
+ class->interface_id = mono_get_unique_iid (class);
+
+ class->method = gklass->method;
+ class->methods = g_new0 (MonoMethod *, class->method.count);
+
+ for (i = 0; i < class->method.count; i++)
+ class->methods [i] = mono_class_inflate_generic_method (
+ gklass->methods [i], ginst->context, ginst->klass);
+
+ class->field = gklass->field;
+ class->fields = g_new0 (MonoClassField, class->field.count);
+
+ for (i = 0; i < class->field.count; i++) {
+ MonoInflatedField *ifield = g_new0 (MonoInflatedField, 1);
+ ifield->generic_type = gklass->fields [i].type;
+
+ class->fields [i] = gklass->fields [i];
+ class->fields [i].generic_info = ifield;
+ class->fields [i].parent = class;
+ class->fields [i].type = mono_class_inflate_generic_type (
+ class->fields [i].type, ginst->context);
+ }
+
+ class->property = gklass->property;
+ class->properties = g_new0 (MonoProperty, class->property.count);
+
+ for (i = 0; i < class->property.count; i++) {
+ MonoProperty *prop = &class->properties [i];
+
+ *prop = gklass->properties [i];
+
+ if (prop->get)
+ prop->get = mono_class_inflate_generic_method (
+ prop->get, ginst->context, ginst->klass);
+ if (prop->set)
+ prop->set = mono_class_inflate_generic_method (
+ prop->set, ginst->context, ginst->klass);
+
+ prop->parent = class;
+ }
+
+ class->interface_count = gklass->interface_count;
+ class->interfaces = g_new0 (MonoClass *, class->interface_count);
+ for (i = 0; i < class->interface_count; i++) {
+ MonoType *it = &gklass->interfaces [i]->byval_arg;
+ MonoType *inflated = mono_class_inflate_generic_type (
+ it, ginst->context);
+ class->interfaces [i] = mono_class_from_mono_type (inflated);
+ mono_class_init (class->interfaces [i]);
+ }
+
+ for (list = gklass->nested_classes; list; list = list->next)
+ class->nested_classes = g_list_append (
+ class->nested_classes, list->data);
+ }
+
+ if (class->parent && !class->parent->inited)
+ mono_class_init (class->parent);
+
+ /*
+ * Computes the size used by the fields, and their locations
+ */
+ if (!class->size_inited)
+ class_compute_field_layout (class);
+
+ /* initialize method pointers */
+ if (class->rank) {
+ MonoMethod *ctor;
+ MonoMethodSignature *sig;
+ class->method.count = class->rank > 1? 2: 1;
+ sig = mono_metadata_signature_alloc (class->image, class->rank);
+ sig->ret = &mono_defaults.void_class->byval_arg;
+ sig->pinvoke = TRUE;
+ for (i = 0; i < class->rank; ++i)
+ sig->params [i] = &mono_defaults.int32_class->byval_arg;
+
+ ctor = (MonoMethod *) g_new0 (MonoMethodPInvoke, 1);
+ ctor->klass = class;
+ ctor->flags = METHOD_ATTRIBUTE_PUBLIC | METHOD_ATTRIBUTE_RT_SPECIAL_NAME | METHOD_ATTRIBUTE_SPECIAL_NAME;
+ ctor->iflags = METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL;
+ ctor->signature = sig;
+ ctor->name = ".ctor";
+ ctor->slot = -1;
+ class->methods = g_new (MonoMethod*, class->method.count);
+ class->methods [0] = ctor;
+ if (class->rank > 1) {
+ sig = mono_metadata_signature_alloc (class->image, class->rank * 2);
+ sig->ret = &mono_defaults.void_class->byval_arg;
+ sig->pinvoke = TRUE;
+ for (i = 0; i < class->rank * 2; ++i)
+ sig->params [i] = &mono_defaults.int32_class->byval_arg;
+
+ ctor = (MonoMethod *) g_new0 (MonoMethodPInvoke, 1);
+ ctor->klass = class;
+ ctor->flags = METHOD_ATTRIBUTE_PUBLIC | METHOD_ATTRIBUTE_RT_SPECIAL_NAME | METHOD_ATTRIBUTE_SPECIAL_NAME;
+ ctor->iflags = METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL;
+ ctor->signature = sig;
+ ctor->name = ".ctor";
+ ctor->slot = -1;
+ class->methods [1] = ctor;
+ }
+ } else {
+ if (!class->generic_inst && !class->methods) {
+ class->methods = g_new (MonoMethod*, class->method.count);
+ for (i = 0; i < class->method.count; ++i) {
+ class->methods [i] = mono_get_method (class->image,
+ MONO_TOKEN_METHOD_DEF | (i + class->method.first + 1), class);
+ }
+ }
+ }
+
+ if (!class->generic_inst) {
+ init_properties (class);
+ init_events (class);
+
+ i = mono_metadata_nesting_typedef (class->image, class->type_token, 1);
+ while (i) {
+ MonoClass* nclass;
+ guint32 cols [MONO_NESTED_CLASS_SIZE];
+ mono_metadata_decode_row (&class->image->tables [MONO_TABLE_NESTEDCLASS], i - 1, cols, MONO_NESTED_CLASS_SIZE);
+ nclass = mono_class_create_from_typedef (class->image, MONO_TOKEN_TYPE_DEF | cols [MONO_NESTED_CLASS_NESTED]);
+ class->nested_classes = g_list_prepend (class->nested_classes, nclass);
+
+ i = mono_metadata_nesting_typedef (class->image, class->type_token, i + 1);
+ }
+ }
+
+ mono_class_setup_supertypes (class);
+
+ if (MONO_CLASS_IS_INTERFACE (class)) {
+ for (i = 0; i < class->method.count; ++i)
+ class->methods [i]->slot = i;
+ class->init_pending = 0;
+ class->inited = 1;
+ /*
+ * class->interface_offsets is needed for the castclass/isinst code, so
+ * we have to setup them for interfaces, too.
+ */
+ setup_interface_offsets (class, 0);
+ mono_loader_unlock ();
+
+ if (mono_debugger_class_init_func)
+ mono_debugger_class_init_func (class);
+
+ return;
+ }
+
+ overrides = mono_class_get_overrides (class->image, class->type_token, &onum);
+ mono_class_setup_vtable (class, overrides, onum);
+ g_free (overrides);
+
+ class->inited = 1;
+ class->init_pending = 0;
if (!default_ghc) {
if (class == mono_defaults.object_class) {
for (i = 0; i < class->vtable_size; ++i) {
- MonoMethod *cm = vtable [i];
+ MonoMethod *cm = class->vtable [i];
if (!strcmp (cm->name, "GetHashCode")) {
ghc_slot = i;
@@ -737,14 +1554,14 @@ mono_class_init (MonoClass *class)
g_assert (ghc_slot > 0);
- default_ghc = vtable [ghc_slot];
+ default_ghc = class->vtable [ghc_slot];
}
}
class->ghcimpl = 1;
- if (class != mono_defaults.object_class) {
+ if (class->parent) {
- if (vtable [ghc_slot] == default_ghc) {
+ if (class->vtable [ghc_slot] == default_ghc) {
class->ghcimpl = 0;
}
}
@@ -753,7 +1570,7 @@ mono_class_init (MonoClass *class)
if (class == mono_defaults.object_class) {
for (i = 0; i < class->vtable_size; ++i) {
- MonoMethod *cm = vtable [i];
+ MonoMethod *cm = class->vtable [i];
if (!strcmp (cm->name, "Finalize")) {
finalize_slot = i;
@@ -763,36 +1580,21 @@ mono_class_init (MonoClass *class)
g_assert (finalize_slot > 0);
- default_finalize = vtable [finalize_slot];
+ default_finalize = class->vtable [finalize_slot];
}
}
/* Object::Finalize should have empty implemenatation */
class->has_finalize = 0;
- if (class != mono_defaults.object_class) {
- if (vtable [finalize_slot] != default_finalize)
+ if (class->parent) {
+ if (class->vtable [finalize_slot] != default_finalize)
class->has_finalize = 1;
}
-}
+ mono_loader_unlock ();
-/*
- * Compute a relative numbering of the class hierarchy as described in
- * "Java for Large-Scale Scientific Computations?"
- */
-static void
-mono_compute_relative_numbering (MonoClass *class, int *c)
-{
- GList *s;
-
- (*c)++;
-
- class->baseval = *c;
-
- for (s = class->subclasses; s; s = s->next)
- mono_compute_relative_numbering ((MonoClass *)s->data, c);
-
- class->diffval = *c - class->baseval;
+ if (mono_debugger_class_init_func)
+ mono_debugger_class_init_func (class);
}
void
@@ -801,6 +1603,9 @@ mono_class_setup_mono_type (MonoClass *class)
const char *name = class->name;
const char *nspace = class->name_space;
+ if (MONO_CLASS_IS_INTERFACE (class))
+ class->interface_id = mono_get_unique_iid (class);
+
class->this_arg.byref = 1;
class->this_arg.data.klass = class;
class->this_arg.type = MONO_TYPE_CLASS;
@@ -813,6 +1618,7 @@ mono_class_setup_mono_type (MonoClass *class)
* do not set the valuetype bit for System.ValueType.
* class->valuetype = 1;
*/
+ class->blittable = TRUE;
} else if (!strcmp (name, "Enum")) {
/*
* do not set the valuetype bit for System.Enum.
@@ -824,6 +1630,8 @@ mono_class_setup_mono_type (MonoClass *class)
class->this_arg.type = class->byval_arg.type = MONO_TYPE_OBJECT;
} else if (!strcmp (name, "String")) {
class->this_arg.type = class->byval_arg.type = MONO_TYPE_STRING;
+ } else if (!strcmp (name, "TypedReference")) {
+ class->this_arg.type = class->byval_arg.type = MONO_TYPE_TYPEDBYREF;
}
}
@@ -836,6 +1644,7 @@ mono_class_setup_mono_type (MonoClass *class)
t = MONO_TYPE_BOOLEAN;
} else if (!strcmp(name, "Byte")) {
t = MONO_TYPE_U1;
+ class->blittable = TRUE;
}
break;
case 'C':
@@ -846,35 +1655,52 @@ mono_class_setup_mono_type (MonoClass *class)
case 'D':
if (!strcmp (name, "Double")) {
t = MONO_TYPE_R8;
+ class->blittable = TRUE;
}
break;
case 'I':
if (!strcmp (name, "Int32")) {
t = MONO_TYPE_I4;
+ class->blittable = TRUE;
} else if (!strcmp(name, "Int16")) {
t = MONO_TYPE_I2;
+ class->blittable = TRUE;
} else if (!strcmp(name, "Int64")) {
t = MONO_TYPE_I8;
+ class->blittable = TRUE;
} else if (!strcmp(name, "IntPtr")) {
t = MONO_TYPE_I;
+ class->blittable = TRUE;
}
break;
case 'S':
if (!strcmp (name, "Single")) {
t = MONO_TYPE_R4;
+ class->blittable = TRUE;
} else if (!strcmp(name, "SByte")) {
t = MONO_TYPE_I1;
+ class->blittable = TRUE;
}
break;
case 'U':
if (!strcmp (name, "UInt32")) {
t = MONO_TYPE_U4;
+ class->blittable = TRUE;
} else if (!strcmp(name, "UInt16")) {
t = MONO_TYPE_U2;
+ class->blittable = TRUE;
} else if (!strcmp(name, "UInt64")) {
t = MONO_TYPE_U8;
+ class->blittable = TRUE;
} else if (!strcmp(name, "UIntPtr")) {
t = MONO_TYPE_U;
+ class->blittable = TRUE;
+ }
+ break;
+ case 'T':
+ if (!strcmp (name, "TypedReference")) {
+ t = MONO_TYPE_TYPEDBYREF;
+ class->blittable = TRUE;
}
break;
case 'V':
@@ -909,13 +1735,21 @@ mono_class_setup_parent (MonoClass *class, MonoClass *parent)
return;
}
- if (!(class->flags & TYPE_ATTRIBUTE_INTERFACE)) {
- int rnum = 0;
+ if (!MONO_CLASS_IS_INTERFACE (class)) {
class->parent = parent;
if (!parent)
g_assert_not_reached (); /* FIXME */
+ if (parent->generic_inst && !parent->name) {
+ /*
+ * If the parent is a generic instance, we may get
+ * called before it is fully initialized, especially
+ * before it has its name.
+ */
+ return;
+ }
+
class->marshalbyref = parent->marshalbyref;
class->contextbound = parent->contextbound;
class->delegate = parent->delegate;
@@ -938,14 +1772,38 @@ mono_class_setup_parent (MonoClass *class, MonoClass *parent)
class->valuetype = class->enumtype = 1;
}
/*class->enumtype = class->parent->enumtype; */
- class->parent->subclasses = g_list_prepend (class->parent->subclasses, class);
- mono_compute_relative_numbering (mono_defaults.object_class, &rnum);
+ mono_class_setup_supertypes (class);
} else {
class->parent = NULL;
}
}
+void
+mono_class_setup_supertypes (MonoClass *class)
+{
+ MonoClass *k;
+ int ms, i;
+
+ if (class->supertypes)
+ return;
+
+ class->idepth = 0;
+ for (k = class; k ; k = k->parent) {
+ class->idepth++;
+ }
+
+ ms = MAX (MONO_DEFAULT_SUPERTABLE_SIZE, class->idepth);
+ class->supertypes = g_new0 (MonoClass *, ms);
+
+ if (class->parent) {
+ for (i = class->idepth, k = class; k ; k = k->parent)
+ class->supertypes [--i] = k;
+ } else {
+ class->supertypes [0] = class;
+ }
+}
+
/**
* @image: context where the image is created
* @type_token: typedef token
@@ -958,30 +1816,26 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
guint32 cols [MONO_TYPEDEF_SIZE];
guint32 cols_next [MONO_TYPEDEF_SIZE];
guint tidx = mono_metadata_token_index (type_token);
+ MonoGenericContext *context = NULL;
const char *name, *nspace;
guint icount = 0;
MonoClass **interfaces;
- if ((class = g_hash_table_lookup (image->class_cache, GUINT_TO_POINTER (type_token))))
+ mono_loader_lock ();
+
+ if ((class = g_hash_table_lookup (image->class_cache, GUINT_TO_POINTER (type_token)))) {
+ mono_loader_unlock ();
return class;
+ }
g_assert (mono_metadata_token_table (type_token) == MONO_TABLE_TYPEDEF);
-
+
mono_metadata_decode_row (tt, tidx - 1, cols, MONO_TYPEDEF_SIZE);
name = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]);
nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]);
- if (cols [MONO_TYPEDEF_EXTENDS])
- parent = mono_class_get (image, mono_metadata_token_from_dor (cols [MONO_TYPEDEF_EXTENDS]));
- interfaces = mono_metadata_interfaces_from_typedef (image, type_token, &icount);
-
class = g_malloc0 (sizeof (MonoClass));
-
- g_hash_table_insert (image->class_cache, GUINT_TO_POINTER (type_token), class);
-
- class->interfaces = interfaces;
- class->interface_count = icount;
class->name = name;
class->name_space = nspace;
@@ -990,9 +1844,33 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
class->type_token = type_token;
class->flags = cols [MONO_TYPEDEF_FLAGS];
- class->element_class = class;
+ g_hash_table_insert (image->class_cache, GUINT_TO_POINTER (type_token), class);
- /*g_print ("Init class %s\n", name);*/
+ class->generic_container = mono_metadata_load_generic_params (image, class->type_token);
+ if (class->generic_container) {
+ class->generic_container->klass = class;
+ context = g_new0 (MonoGenericContext, 1);
+ context->container = class->generic_container;
+ }
+
+ if (cols [MONO_TYPEDEF_EXTENDS])
+ parent = mono_class_get_full (
+ image, mono_metadata_token_from_dor (cols [MONO_TYPEDEF_EXTENDS]), context);
+ interfaces = mono_metadata_interfaces_from_typedef_full (image, type_token, &icount, context);
+
+ class->interfaces = interfaces;
+ class->interface_count = icount;
+
+ if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_UNICODE_CLASS)
+ class->unicode = 1;
+ /* fixme: maybe we must set this on windows
+ if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_AUTO_CLASS)
+ class->unicode = 1;
+ */
+
+ class->cast_class = class->element_class = class;
+
+ /*g_print ("Load class %s\n", name);*/
mono_class_setup_parent (class, parent);
@@ -1005,7 +1883,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
class->method.first = cols [MONO_TYPEDEF_METHOD_LIST] - 1;
if (tt->rows > tidx){
- mono_metadata_decode_row (tt, tidx, cols_next, CSIZE (cols_next));
+ mono_metadata_decode_row (tt, tidx, cols_next, MONO_TYPEDEF_SIZE);
class->field.last = cols_next [MONO_TYPEDEF_FIELD_LIST] - 1;
class->method.last = cols_next [MONO_TYPEDEF_METHOD_LIST] - 1;
} else {
@@ -1030,21 +1908,130 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
g_assert (class->field.count == 0);
}
- if (class->flags & TYPE_ATTRIBUTE_INTERFACE)
- class->interface_id = mono_get_unique_iid (class);
-
- /*class->interfaces = mono_metadata_interfaces_from_typedef (image, type_token, &class->interface_count); */
-
- if (class->enumtype) {
- class->fields = g_new0 (MonoClassField, class->field.count);
- class_compute_field_layout (class, 0);
- }
+ if (class->enumtype)
+ class_compute_field_layout (class);
if ((type_token = mono_metadata_nested_in_typedef (image, type_token)))
class->nested_in = mono_class_create_from_typedef (image, type_token);
+
+ mono_loader_unlock ();
+
return class;
}
+MonoClass*
+mono_class_create_generic (MonoGenericInst *ginst)
+{
+ MonoClass *klass, *gklass;
+
+ if (!ginst->klass)
+ ginst->klass = g_malloc0 (sizeof (MonoClass));
+ klass = ginst->klass;
+
+ gklass = mono_class_from_mono_type (ginst->generic_type);
+
+ klass->nested_in = gklass->nested_in;
+
+ klass->name = gklass->name;
+ klass->name_space = gklass->name_space;
+ klass->image = gklass->image;
+ klass->flags = gklass->flags;
+
+ klass->generic_inst = ginst;
+
+ klass->this_arg.type = klass->byval_arg.type = MONO_TYPE_GENERICINST;
+ klass->this_arg.data.generic_inst = klass->byval_arg.data.generic_inst = ginst;
+ klass->this_arg.byref = TRUE;
+
+ klass->cast_class = klass->element_class = klass;
+
+ if (ginst->is_dynamic) {
+ klass->instance_size = gklass->instance_size;
+ klass->class_size = gklass->class_size;
+ klass->size_inited = 1;
+
+ klass->valuetype = gklass->valuetype;
+ }
+
+ return klass;
+}
+
+MonoClass *
+mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, gboolean is_mvar)
+{
+ MonoClass *klass, **ptr;
+ int count, pos, i;
+
+ if (param->pklass)
+ return param->pklass;
+
+ klass = param->pklass = g_new0 (MonoClass, 1);
+
+ for (count = 0, ptr = param->constraints; ptr && *ptr; ptr++, count++)
+ ;
+
+ pos = 0;
+ if ((count > 0) && !MONO_CLASS_IS_INTERFACE (param->constraints [0])) {
+ klass->parent = param->constraints [0];
+ pos++;
+ }
+
+ if (count - pos > 0) {
+ klass->interface_count = count - pos;
+ klass->interfaces = g_new0 (MonoClass *, count - pos);
+ for (i = pos; i < count; i++)
+ klass->interfaces [i - pos] = param->constraints [i];
+ }
+
+ g_assert (param->name && param->owner);
+
+ klass->name = param->name;
+ klass->name_space = "";
+ klass->image = image;
+ klass->cast_class = klass->element_class = klass;
+ klass->enum_basetype = &klass->element_class->byval_arg;
+ klass->flags = TYPE_ATTRIBUTE_PUBLIC;
+
+ klass->this_arg.type = klass->byval_arg.type = is_mvar ? MONO_TYPE_MVAR : MONO_TYPE_VAR;
+ klass->this_arg.data.generic_param = klass->byval_arg.data.generic_param = param;
+ klass->this_arg.byref = TRUE;
+
+ mono_class_init (klass);
+
+ return klass;
+}
+
+static MonoClass *
+my_mono_class_from_generic_parameter (MonoGenericParam *param, gboolean is_mvar)
+{
+ MonoClass *klass;
+
+ if (param->pklass)
+ return param->pklass;
+
+ g_assert (param->owner);
+
+ klass = g_new0 (MonoClass, 1);
+
+ if (param->name)
+ klass->name = param->name;
+ else
+ klass->name = g_strdup_printf (is_mvar ? "!!%d" : "!%d", param->num);
+ klass->name_space = "";
+ klass->image = mono_defaults.corlib;
+ klass->cast_class = klass->element_class = klass;
+ klass->enum_basetype = &klass->element_class->byval_arg;
+ klass->flags = TYPE_ATTRIBUTE_PUBLIC;
+
+ klass->this_arg.type = klass->byval_arg.type = is_mvar ? MONO_TYPE_MVAR : MONO_TYPE_VAR;
+ klass->this_arg.data.generic_param = klass->byval_arg.data.generic_param = param;
+ klass->this_arg.byref = TRUE;
+
+ mono_class_init (klass);
+
+ return klass;
+}
+
MonoClass *
mono_ptr_class_get (MonoType *type)
{
@@ -1052,32 +2039,82 @@ mono_ptr_class_get (MonoType *type)
MonoClass *el_class;
static GHashTable *ptr_hash = NULL;
+ mono_loader_lock ();
+
if (!ptr_hash)
- ptr_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
+ ptr_hash = g_hash_table_new (NULL, NULL);
el_class = mono_class_from_mono_type (type);
- if ((result = g_hash_table_lookup (ptr_hash, el_class)))
+ if ((result = g_hash_table_lookup (ptr_hash, el_class))) {
+ mono_loader_unlock ();
return result;
+ }
result = g_new0 (MonoClass, 1);
result->parent = NULL; /* no parent for PTR types */
- result->name = "System";
- result->name_space = "MonoPtrFakeClass";
+ result->name_space = el_class->name_space;
+ result->name = g_strdup_printf ("%s*", el_class->name);
result->image = el_class->image;
result->inited = TRUE;
+ result->flags = TYPE_ATTRIBUTE_CLASS | (el_class->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK);
/* Can pointers get boxed? */
result->instance_size = sizeof (gpointer);
- /*
- * baseval, diffval: need them to allow casting ?
- */
- result->element_class = el_class;
+ result->cast_class = result->element_class = el_class;
result->enum_basetype = &result->element_class->byval_arg;
+ result->blittable = TRUE;
result->this_arg.type = result->byval_arg.type = MONO_TYPE_PTR;
result->this_arg.data.type = result->byval_arg.data.type = result->enum_basetype;
result->this_arg.byref = TRUE;
+ mono_class_setup_supertypes (result);
+
g_hash_table_insert (ptr_hash, el_class, result);
+ mono_loader_unlock ();
+
+ return result;
+}
+
+static MonoClass *
+mono_fnptr_class_get (MonoMethodSignature *sig)
+{
+ MonoClass *result;
+ static GHashTable *ptr_hash = NULL;
+
+ mono_loader_lock ();
+
+ if (!ptr_hash)
+ ptr_hash = g_hash_table_new (NULL, NULL);
+
+ if ((result = g_hash_table_lookup (ptr_hash, sig))) {
+ mono_loader_unlock ();
+ return result;
+ }
+ result = g_new0 (MonoClass, 1);
+
+ result->parent = NULL; /* no parent for PTR types */
+ result->name = "System";
+ result->name_space = "MonoFNPtrFakeClass";
+ result->image = NULL; /* need to fix... */
+ result->inited = TRUE;
+ result->flags = TYPE_ATTRIBUTE_CLASS; /* | (el_class->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK); */
+ /* Can pointers get boxed? */
+ result->instance_size = sizeof (gpointer);
+ result->cast_class = result->element_class = result;
+ result->blittable = TRUE;
+
+ result->this_arg.type = result->byval_arg.type = MONO_TYPE_FNPTR;
+ result->this_arg.data.method = result->byval_arg.data.method = sig;
+ result->this_arg.byref = TRUE;
+ result->enum_basetype = &result->element_class->byval_arg;
+ result->blittable = TRUE;
+
+ mono_class_setup_supertypes (result);
+
+ g_hash_table_insert (ptr_hash, sig, result);
+
+ mono_loader_unlock ();
+
return result;
}
@@ -1086,50 +2123,61 @@ mono_class_from_mono_type (MonoType *type)
{
switch (type->type) {
case MONO_TYPE_OBJECT:
- return mono_defaults.object_class;
+ return type->data.klass? type->data.klass: mono_defaults.object_class;
case MONO_TYPE_VOID:
- return mono_defaults.void_class;
+ return type->data.klass? type->data.klass: mono_defaults.void_class;
case MONO_TYPE_BOOLEAN:
- return mono_defaults.boolean_class;
+ return type->data.klass? type->data.klass: mono_defaults.boolean_class;
case MONO_TYPE_CHAR:
- return mono_defaults.char_class;
+ return type->data.klass? type->data.klass: mono_defaults.char_class;
case MONO_TYPE_I1:
- return mono_defaults.sbyte_class;
+ return type->data.klass? type->data.klass: mono_defaults.sbyte_class;
case MONO_TYPE_U1:
- return mono_defaults.byte_class;
+ return type->data.klass? type->data.klass: mono_defaults.byte_class;
case MONO_TYPE_I2:
- return mono_defaults.int16_class;
+ return type->data.klass? type->data.klass: mono_defaults.int16_class;
case MONO_TYPE_U2:
- return mono_defaults.uint16_class;
+ return type->data.klass? type->data.klass: mono_defaults.uint16_class;
case MONO_TYPE_I4:
- return mono_defaults.int32_class;
+ return type->data.klass? type->data.klass: mono_defaults.int32_class;
case MONO_TYPE_U4:
- return mono_defaults.uint32_class;
+ return type->data.klass? type->data.klass: mono_defaults.uint32_class;
case MONO_TYPE_I:
- return mono_defaults.int_class;
+ return type->data.klass? type->data.klass: mono_defaults.int_class;
case MONO_TYPE_U:
- return mono_defaults.uint_class;
+ return type->data.klass? type->data.klass: mono_defaults.uint_class;
case MONO_TYPE_I8:
- return mono_defaults.int64_class;
+ return type->data.klass? type->data.klass: mono_defaults.int64_class;
case MONO_TYPE_U8:
- return mono_defaults.uint64_class;
+ return type->data.klass? type->data.klass: mono_defaults.uint64_class;
case MONO_TYPE_R4:
- return mono_defaults.single_class;
+ return type->data.klass? type->data.klass: mono_defaults.single_class;
case MONO_TYPE_R8:
- return mono_defaults.double_class;
+ return type->data.klass? type->data.klass: mono_defaults.double_class;
case MONO_TYPE_STRING:
- return mono_defaults.string_class;
+ return type->data.klass? type->data.klass: mono_defaults.string_class;
+ case MONO_TYPE_TYPEDBYREF:
+ return type->data.klass? type->data.klass: mono_defaults.typed_reference_class;
case MONO_TYPE_ARRAY:
- return mono_array_class_get (type->data.array->type, type->data.array->rank);
+ return mono_bounded_array_class_get (type->data.array->eklass, type->data.array->rank, TRUE);
case MONO_TYPE_PTR:
return mono_ptr_class_get (type->data.type);
+ case MONO_TYPE_FNPTR:
+ return mono_fnptr_class_get (type->data.method);
case MONO_TYPE_SZARRAY:
- return mono_array_class_get (type->data.type, 1);
+ return mono_array_class_get (type->data.klass, 1);
case MONO_TYPE_CLASS:
case MONO_TYPE_VALUETYPE:
return type->data.klass;
+ case MONO_TYPE_GENERICINST:
+ g_assert (type->data.generic_inst->klass);
+ return type->data.generic_inst->klass;
+ case MONO_TYPE_VAR:
+ return my_mono_class_from_generic_parameter (type->data.generic_param, FALSE);
+ case MONO_TYPE_MVAR:
+ return my_mono_class_from_generic_parameter (type->data.generic_param, TRUE);
default:
- g_warning ("implement me %02x\n", type->type);
+ g_warning ("implement me 0x%02x\n", type->type);
g_assert_not_reached ();
}
@@ -1141,22 +2189,39 @@ mono_class_from_mono_type (MonoType *type)
* @type_spec: typespec token
*/
static MonoClass *
-mono_class_create_from_typespec (MonoImage *image, guint32 type_spec)
+mono_class_create_from_typespec (MonoImage *image, guint32 type_spec,
+ MonoGenericContext *context)
{
- MonoType *type;
+ MonoType *type, *inflated;
+ MonoGenericContainer *container = NULL;
MonoClass *class;
- type = mono_type_create_from_typespec (image, type_spec);
+ if (context) {
+ if (context->gmethod && context->gmethod->container) {
+ g_assert (context->gmethod->container);
+ container = context->gmethod->container;
+ } else if (context->ginst) {
+ g_assert (context->ginst->container);
+ container = context->ginst->container;
+ } else if (context->container)
+ container = context->container;
+ }
+
+ type = mono_type_create_from_typespec_full (image, container, type_spec);
switch (type->type) {
case MONO_TYPE_ARRAY:
- class = mono_array_class_get (type->data.array->type, type->data.array->rank);
+ class = mono_array_class_get (type->data.array->eklass, type->data.array->rank);
break;
case MONO_TYPE_SZARRAY:
- class = mono_array_class_get (type->data.type, 1);
+ class = mono_array_class_get (type->data.klass, 1);
break;
case MONO_TYPE_PTR:
- class = mono_class_from_mono_type (type->data.type);
+ class = mono_ptr_class_get (type->data.type);
+ break;
+ case MONO_TYPE_GENERICINST:
+ g_assert (type->data.generic_inst->klass);
+ class = type->data.generic_inst->klass;
break;
default:
/* it seems any type can be stored in TypeSpec as well */
@@ -1164,84 +2229,135 @@ mono_class_create_from_typespec (MonoImage *image, guint32 type_spec)
break;
}
- mono_metadata_free_type (type);
-
- return class;
+ if (!class || !context)
+ return class;
+
+ inflated = mono_class_inflate_generic_type (&class->byval_arg, context);
+
+ return mono_class_from_mono_type (inflated);
}
/**
- * mono_array_class_get:
- * @element_type: element type
+ * mono_bounded_array_class_get:
+ * @element_class: element class
* @rank: the dimension of the array class
+ * @bounded: whenever the array has non-zero bounds
*
* Returns: a class object describing the array with element type @element_type and
* dimension @rank.
*/
MonoClass *
-mono_array_class_get (MonoType *element_type, guint32 rank)
+mono_bounded_array_class_get (MonoClass *eclass, guint32 rank, gboolean bounded)
{
- MonoClass *eclass;
MonoImage *image;
MonoClass *class;
MonoClass *parent = NULL;
- GSList *list;
- int rnum = 0;
+ GSList *list, *rootlist;
+ int nsize;
+ char *name;
+ gboolean corlib_type = FALSE;
- eclass = mono_class_from_mono_type (element_type);
g_assert (rank <= 255);
- parent = mono_defaults.array_class;
-
- if (!parent->inited)
- mono_class_init (parent);
+ if (rank > 1)
+ /* bounded only matters for one-dimensional arrays */
+ bounded = FALSE;
image = eclass->image;
- if ((list = g_hash_table_lookup (image->array_cache, element_type))) {
+ mono_loader_lock ();
+
+ if ((rootlist = list = g_hash_table_lookup (image->array_cache, eclass))) {
for (; list; list = list->next) {
class = list->data;
- if (class->rank == rank)
+ if ((class->rank == rank) && (class->byval_arg.type == (bounded ? MONO_TYPE_ARRAY : MONO_TYPE_SZARRAY))) {
+ mono_loader_unlock ();
return class;
+ }
}
}
-
- class = g_malloc0 (sizeof (MonoClass) + parent->vtable_size * sizeof (gpointer));
+
+ /* for the building corlib use System.Array from it */
+ if (image->assembly && image->assembly->dynamic && strcmp (image->assembly_name, "mscorlib") == 0) {
+ parent = mono_class_from_name (image, "System", "Array");
+ corlib_type = TRUE;
+ } else {
+ parent = mono_defaults.array_class;
+ if (!parent->inited)
+ mono_class_init (parent);
+ }
+
+ class = g_malloc0 (sizeof (MonoClass));
class->image = image;
- class->name_space = "System";
- class->name = "Array";
+ class->name_space = eclass->name_space;
+ nsize = strlen (eclass->name);
+ name = g_malloc (nsize + 2 + rank);
+ memcpy (name, eclass->name, nsize);
+ name [nsize] = '[';
+ if (rank > 1)
+ memset (name + nsize + 1, ',', rank - 1);
+ name [nsize + rank] = ']';
+ name [nsize + rank + 1] = 0;
+ class->name = name;
class->type_token = 0;
- class->flags = TYPE_ATTRIBUTE_CLASS;
+ /* all arrays are marked serializable and sealed, bug #42779 */
+ class->flags = TYPE_ATTRIBUTE_CLASS | TYPE_ATTRIBUTE_SERIALIZABLE | TYPE_ATTRIBUTE_SEALED |
+ (eclass->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK);
class->parent = parent;
class->instance_size = mono_class_instance_size (class->parent);
class->class_size = 0;
- class->vtable_size = parent->vtable_size;
- class->parent->subclasses = g_list_prepend (class->parent->subclasses, class);
- mono_compute_relative_numbering (mono_defaults.object_class, &rnum);
+ mono_class_setup_supertypes (class);
class->rank = rank;
+
+ if (eclass->enumtype)
+ class->cast_class = eclass->element_class;
+ else
+ class->cast_class = eclass;
+
class->element_class = eclass;
- if (rank > 1) {
+
+ if ((rank > 1) || bounded) {
MonoArrayType *at = g_new0 (MonoArrayType, 1);
class->byval_arg.type = MONO_TYPE_ARRAY;
class->byval_arg.data.array = at;
- at->type = &eclass->byval_arg;
+ at->eklass = eclass;
at->rank = rank;
/* FIXME: complete.... */
} else {
- /* FIXME: this is not correct. the lbound could be >0 */
class->byval_arg.type = MONO_TYPE_SZARRAY;
- class->byval_arg.data.type = &eclass->byval_arg;
+ class->byval_arg.data.klass = eclass;
}
class->this_arg = class->byval_arg;
class->this_arg.byref = 1;
+ if (corlib_type) {
+ class->inited = 1;
+ }
+
+ list = g_slist_append (rootlist, class);
+ g_hash_table_insert (image->array_cache, eclass, list);
+
+ mono_loader_unlock ();
- list = g_slist_append (list, class);
- g_hash_table_insert (image->array_cache, &class->element_class->byval_arg, list);
return class;
}
/**
+ * mono_array_class_get:
+ * @element_class: element class
+ * @rank: the dimension of the array class
+ *
+ * Returns: a class object describing the array with element type @element_type and
+ * dimension @rank.
+ */
+MonoClass *
+mono_array_class_get (MonoClass *eclass, guint32 rank)
+{
+ return mono_bounded_array_class_get (eclass, rank, FALSE);
+}
+
+/**
* mono_class_instance_size:
* @klass: a class
*
@@ -1249,15 +2365,31 @@ mono_array_class_get (MonoType *element_type, guint32 rank)
*/
gint32
mono_class_instance_size (MonoClass *klass)
-{
-
+{
if (!klass->size_inited)
mono_class_init (klass);
+ g_assert (!klass->generic_container &&
+ (!klass->generic_inst || !klass->generic_inst->is_open));
return klass->instance_size;
}
/**
+ * mono_class_min_align:
+ * @klass: a class
+ *
+ * Returns: minimm alignment requirements
+ */
+gint32
+mono_class_min_align (MonoClass *klass)
+{
+ if (!klass->size_inited)
+ mono_class_init (klass);
+
+ return klass->min_align;
+}
+
+/**
* mono_class_value_size:
* @klass: a class
*
@@ -1292,8 +2424,7 @@ mono_class_value_size (MonoClass *klass, guint32 *align)
*/
gint32
mono_class_data_size (MonoClass *klass)
-{
-
+{
if (!klass->inited)
mono_class_init (klass);
@@ -1344,13 +2475,91 @@ mono_class_get_field_from_name (MonoClass *klass, const char *name)
{
int i;
- for (i = 0; i < klass->field.count; ++i) {
- if (strcmp (name, klass->fields [i].name) == 0)
- return &klass->fields [i];
+ while (klass) {
+ for (i = 0; i < klass->field.count; ++i) {
+ if (strcmp (name, klass->fields [i].name) == 0)
+ return &klass->fields [i];
+ }
+ klass = klass->parent;
}
return NULL;
}
+guint32
+mono_class_get_field_token (MonoClassField *field)
+{
+ MonoClass *klass = field->parent;
+ int i;
+
+ while (klass) {
+ for (i = 0; i < klass->field.count; ++i) {
+ if (&klass->fields [i] == field)
+ return mono_metadata_make_token (MONO_TABLE_FIELD, klass->field.first + i + 1);
+ }
+ klass = klass->parent;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+guint32
+mono_class_get_event_token (MonoEvent *event)
+{
+ MonoClass *klass = event->parent;
+ int i;
+
+ while (klass) {
+ for (i = 0; i < klass->event.count; ++i) {
+ if (&klass->events [i] == event)
+ return mono_metadata_make_token (MONO_TABLE_EVENT, klass->event.first + i + 1);
+ }
+ klass = klass->parent;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+void *
+mono_vtable_get_static_field_data (MonoVTable *vt)
+{
+ return vt->data;
+}
+
+MonoProperty*
+mono_class_get_property_from_name (MonoClass *klass, const char *name)
+{
+ int i;
+
+ while (klass) {
+ for (i = 0; i < klass->property.count; ++i) {
+ if (strcmp (name, klass->properties [i].name) == 0)
+ return &klass->properties [i];
+ }
+ klass = klass->parent;
+ }
+ return NULL;
+}
+
+guint32
+mono_class_get_property_token (MonoProperty *prop)
+{
+ MonoClass *klass = prop->parent;
+ int i;
+
+ while (klass) {
+ for (i = 0; i < klass->property.count; ++i) {
+ if (&klass->properties [i] == prop)
+ return mono_metadata_make_token (MONO_TABLE_PROPERTY, klass->property.first + i + 1);
+ }
+ klass = klass->parent;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
/**
* mono_class_get:
* @image: the image where the class resides
@@ -1359,10 +2568,13 @@ mono_class_get_field_from_name (MonoClass *klass, const char *name)
*
* Returns: the MonoClass that represents @type_token in @image
*/
-MonoClass *
-mono_class_get (MonoImage *image, guint32 type_token)
+static MonoClass *
+_mono_class_get (MonoImage *image, guint32 type_token, MonoGenericContext *context)
{
- MonoClass *class;
+ MonoClass *class = NULL;
+
+ if (image->dynamic)
+ return mono_lookup_dynamic_token (image, type_token);
switch (type_token & 0xff000000){
case MONO_TOKEN_TYPE_DEF:
@@ -1372,7 +2584,7 @@ mono_class_get (MonoImage *image, guint32 type_token)
class = mono_class_from_typeref (image, type_token);
break;
case MONO_TOKEN_TYPE_SPEC:
- class = mono_class_create_from_typespec (image, type_token);
+ class = mono_class_create_from_typespec (image, type_token, context);
break;
default:
g_warning ("unknown token type %x", type_token & 0xff000000);
@@ -1381,10 +2593,61 @@ mono_class_get (MonoImage *image, guint32 type_token)
if (!class)
g_warning ("Could not load class from token 0x%08x in %s", type_token, image->name);
+
return class;
}
MonoClass *
+mono_class_get (MonoImage *image, guint32 type_token)
+{
+ return _mono_class_get (image, type_token, NULL);
+}
+
+MonoClass *
+mono_class_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context)
+{
+ MonoClass *class = _mono_class_get (image, type_token, context);
+ MonoType *inflated;
+
+ if (!class || !context || (!context->ginst && !context->gmethod))
+ return class;
+
+ switch (class->byval_arg.type) {
+ case MONO_TYPE_GENERICINST:
+ if (!class->generic_inst->is_open)
+ return class;
+ break;
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ break;
+ default:
+ return class;
+ }
+
+ inflated = inflate_generic_type (&class->byval_arg, context);
+ if (!inflated)
+ return class;
+
+ return mono_class_from_mono_type (inflated);
+}
+
+/**
+ * mono_class_from_name_case:
+ * @image: The MonoImage where the type is looked up in, or NULL for looking up in all loaded assemblies
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * Obtains a MonoClass with a given namespace and a given name which
+ * is located in the given MonoImage. The namespace and name
+ * lookups are case insensitive.
+ *
+ * You can also pass `NULL' to the image, and that will lookup for
+ * a type with the given namespace and name in all of the loaded
+ * assemblies: notice that since there might be a name clash in this
+ * case, passing NULL is not encouraged if you need a precise type.
+ *
+ */
+MonoClass *
mono_class_from_name_case (MonoImage *image, const char* name_space, const char *name)
{
MonoTableInfo *t = &image->tables [MONO_TABLE_TYPEDEF];
@@ -1408,25 +2671,275 @@ mono_class_from_name_case (MonoImage *image, const char* name_space, const char
return NULL;
}
+static MonoClass*
+return_nested_in (MonoClass *class, char *nested) {
+ MonoClass *found;
+ char *s = strchr (nested, '/');
+ GList *tmp;
+
+ if (s) {
+ *s = 0;
+ s++;
+ }
+ for (tmp = class->nested_classes; tmp; tmp = tmp->next) {
+ found = tmp->data;
+ if (strcmp (found->name, nested) == 0) {
+ if (s)
+ return return_nested_in (found, s);
+ return found;
+ }
+ }
+ return NULL;
+}
+
+
+/**
+ * mono_class_from_name_case:
+ * @image: The MonoImage where the type is looked up in, or NULL for looking up in all loaded assemblies
+ * @name_space: the type namespace
+ * @name: the type short name.
+ *
+ * Obtains a MonoClass with a given namespace and a given name which
+ * is located in the given MonoImage.
+ *
+ * You can also pass `NULL' to the image, and that will lookup for
+ * a type with the given namespace and name in all of the loaded
+ * assemblies: notice that since there might be a name clash in this
+ * case, passing NULL is not encouraged if you need a precise type.
+ *
+ */
MonoClass *
mono_class_from_name (MonoImage *image, const char* name_space, const char *name)
{
GHashTable *nspace_table;
- guint32 token;
+ MonoImage *loaded_image;
+ guint32 token = 0;
+ MonoClass *class;
+ char *nested;
+ char buf [1024];
+
+ if ((nested = strchr (name, '/'))) {
+ int pos = nested - name;
+ int len = strlen (name);
+ if (len > 1023)
+ return NULL;
+ memcpy (buf, name, len + 1);
+ buf [pos] = 0;
+ nested = buf + pos + 1;
+ name = buf;
+ }
+
+ mono_loader_lock ();
nspace_table = g_hash_table_lookup (image->name_cache, name_space);
- if (!nspace_table)
- return 0;
- token = GPOINTER_TO_UINT (g_hash_table_lookup (nspace_table, name));
-
- if (!token) {
- /*g_warning ("token not found for %s.%s in image %s", name_space, name, image->name);*/
+
+ if (nspace_table)
+ token = GPOINTER_TO_UINT (g_hash_table_lookup (nspace_table, name));
+
+ mono_loader_unlock ();
+
+ if (!token)
return NULL;
+
+ if (mono_metadata_token_table (token) == MONO_TABLE_EXPORTEDTYPE) {
+ MonoTableInfo *t = &image->tables [MONO_TABLE_EXPORTEDTYPE];
+ guint32 cols [MONO_EXP_TYPE_SIZE];
+ guint32 idx, impl;
+
+ idx = mono_metadata_token_index (token);
+
+ mono_metadata_decode_row (t, idx - 1, cols, MONO_EXP_TYPE_SIZE);
+
+ impl = cols [MONO_EXP_TYPE_IMPLEMENTATION];
+ if ((impl & MONO_IMPLEMENTATION_MASK) == MONO_IMPLEMENTATION_FILE) {
+ loaded_image = mono_assembly_load_module (image->assembly, impl >> MONO_IMPLEMENTATION_BITS);
+ if (!loaded_image)
+ return NULL;
+ class = mono_class_from_name (loaded_image, name_space, name);
+ if (nested)
+ return return_nested_in (class, nested);
+ return class;
+ } else {
+ g_error ("not yet implemented");
+ }
}
token = MONO_TOKEN_TYPE_DEF | token;
- return mono_class_get (image, token);
+ class = mono_class_get (image, token);
+ if (nested)
+ return return_nested_in (class, nested);
+ return class;
+}
+
+gboolean
+mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc,
+ gboolean check_interfaces)
+{
+ again:
+ if (check_interfaces && MONO_CLASS_IS_INTERFACE (klassc) && !MONO_CLASS_IS_INTERFACE (klass)) {
+ if ((klassc->interface_id <= klass->max_interface_id) &&
+ (klass->interface_offsets [klassc->interface_id] >= 0))
+ return TRUE;
+ } else if (check_interfaces && MONO_CLASS_IS_INTERFACE (klassc) && MONO_CLASS_IS_INTERFACE (klass)) {
+ int i;
+
+ for (i = 0; i < klass->interface_count; i ++) {
+ MonoClass *ic = klass->interfaces [i];
+ if (ic == klassc)
+ return TRUE;
+ }
+ } else {
+ if (!MONO_CLASS_IS_INTERFACE (klass) && mono_class_has_parent (klass, klassc))
+ return TRUE;
+ }
+
+ /*
+ * MS.NET thinks interfaces are a subclass of Object, so we think it as
+ * well.
+ */
+ if (klassc == mono_defaults.object_class)
+ return TRUE;
+
+ if (klass->generic_inst) {
+ MonoType *parent = klass->generic_inst->parent;
+ if (!parent)
+ return FALSE;
+
+ if (mono_metadata_type_equal (parent, &klassc->byval_arg))
+ return TRUE;
+ klass = mono_class_from_mono_type (parent);
+ goto again;
+ }
+
+ return FALSE;
+}
+
+gboolean
+mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass)
+{
+ if (!klass->inited)
+ mono_class_init (klass);
+
+ if (!oklass->inited)
+ mono_class_init (oklass);
+
+ if (MONO_CLASS_IS_INTERFACE (klass)) {
+ if ((klass->interface_id <= oklass->max_interface_id) &&
+ (oklass->interface_offsets [klass->interface_id] != -1))
+ return TRUE;
+ } else
+ if (klass->rank) {
+ MonoClass *eclass, *eoclass;
+
+ if (oklass->rank != klass->rank)
+ return FALSE;
+
+ /* vectors vs. one dimensional arrays */
+ if (oklass->byval_arg.type != klass->byval_arg.type)
+ return FALSE;
+
+ eclass = klass->cast_class;
+ eoclass = oklass->cast_class;
+
+
+ /*
+ * a is b does not imply a[] is b[] when a is a valuetype, and
+ * b is a reference type.
+ */
+
+ if (eoclass->valuetype) {
+ if ((eclass == mono_defaults.enum_class) ||
+ (eclass == mono_defaults.enum_class->parent) ||
+ (eclass == mono_defaults.object_class))
+ return FALSE;
+ }
+
+ return mono_class_is_assignable_from (klass->cast_class, oklass->cast_class);
+ }
+ else
+ if (klass == mono_defaults.object_class)
+ return TRUE;
+
+ return mono_class_has_parent (oklass, klass);
+}
+
+/*
+ * mono_class_needs_cctor_run:
+ *
+ * Determines whenever the class has a static constructor and whenever it
+ * needs to be called when executing CALLER.
+ */
+gboolean
+mono_class_needs_cctor_run (MonoClass *klass, MonoMethod *caller)
+{
+ int i;
+ MonoMethod *method;
+
+ for (i = 0; i < klass->method.count; ++i) {
+ method = klass->methods [i];
+ if ((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) &&
+ (strcmp (".cctor", method->name) == 0)) {
+ if (caller == method)
+ return FALSE;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Returns the nnumber of bytes an element of type klass
+ * uses when stored into an array.
+ */
+gint32
+mono_class_array_element_size (MonoClass *klass)
+{
+ MonoType *type = &klass->byval_arg;
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ return 1;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ return 2;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_R4:
+ return 4;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ return sizeof (gpointer);
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R8:
+ return 8;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ klass = klass->element_class;
+ goto handle_enum;
+ }
+ return mono_class_instance_size (klass) - sizeof (MonoObject);
+ case MONO_TYPE_GENERICINST:
+ type = type->data.generic_inst->generic_type;
+ goto handle_enum;
+ default:
+ g_error ("unknown type 0x%02x in mono_class_array_element_size", type->type);
+ }
+ return -1;
}
/**
@@ -1438,22 +2951,43 @@ mono_class_from_name (MonoImage *image, const char* name_space, const char *name
gint32
mono_array_element_size (MonoClass *ac)
{
- if (ac->element_class->valuetype)
- return mono_class_instance_size (ac->element_class) - sizeof (MonoObject);
- else
- return sizeof (gpointer);
+ return mono_class_array_element_size (ac->element_class);
}
gpointer
-mono_ldtoken (MonoImage *image, guint32 token, MonoClass **handle_class)
+mono_ldtoken (MonoImage *image, guint32 token, MonoClass **handle_class,
+ MonoGenericContext *context)
{
+ if (image->dynamic) {
+ gpointer obj = mono_lookup_dynamic_token (image, token);
+
+ switch (token & 0xff000000) {
+ case MONO_TOKEN_TYPE_DEF:
+ case MONO_TOKEN_TYPE_REF:
+ case MONO_TOKEN_TYPE_SPEC:
+ if (handle_class)
+ *handle_class = mono_defaults.typehandle_class;
+ return &((MonoClass*)obj)->byval_arg;
+ case MONO_TOKEN_METHOD_DEF:
+ if (handle_class)
+ *handle_class = mono_defaults.methodhandle_class;
+ return obj;
+ case MONO_TOKEN_FIELD_DEF:
+ if (handle_class)
+ *handle_class = mono_defaults.fieldhandle_class;
+ return obj;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
switch (token & 0xff000000) {
case MONO_TOKEN_TYPE_DEF:
case MONO_TOKEN_TYPE_REF: {
MonoClass *class;
if (handle_class)
*handle_class = mono_defaults.typehandle_class;
- class = mono_class_get (image, token);
+ class = mono_class_get_full (image, token, context);
mono_class_init (class);
/* We return a MonoType* as handle */
return &class->byval_arg;
@@ -1462,21 +2996,47 @@ mono_ldtoken (MonoImage *image, guint32 token, MonoClass **handle_class)
MonoClass *class;
if (handle_class)
*handle_class = mono_defaults.typehandle_class;
- class = mono_class_create_from_typespec (image, token);
+ class = mono_class_create_from_typespec (image, token, context);
mono_class_init (class);
return &class->byval_arg;
}
case MONO_TOKEN_FIELD_DEF: {
MonoClass *class;
guint32 type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
- class = mono_class_get (image, MONO_TOKEN_TYPE_DEF | type);
+ class = mono_class_get_full (image, MONO_TOKEN_TYPE_DEF | type, context);
mono_class_init (class);
if (handle_class)
- *handle_class = mono_class_from_name (mono_defaults.corlib, "System", "RuntimeFieldHandle");
+ *handle_class = mono_defaults.fieldhandle_class;
return mono_class_get_field (class, token);
}
- case MONO_TOKEN_METHOD_DEF:
- case MONO_TOKEN_MEMBER_REF:
+ case MONO_TOKEN_METHOD_DEF: {
+ MonoMethod *meth;
+ meth = mono_get_method_full (image, token, NULL, context);
+ if (handle_class)
+ *handle_class = mono_defaults.methodhandle_class;
+ return meth;
+ }
+ case MONO_TOKEN_MEMBER_REF: {
+ guint32 cols [MONO_MEMBERREF_SIZE];
+ const char *sig;
+ mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], mono_metadata_token_index (token) - 1, cols, MONO_MEMBERREF_SIZE);
+ sig = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]);
+ mono_metadata_decode_blob_size (sig, &sig);
+ if (*sig == 0x6) { /* it's a field */
+ MonoClass *klass;
+ MonoClassField *field;
+ field = mono_field_from_token (image, token, &klass, context);
+ if (handle_class)
+ *handle_class = mono_defaults.fieldhandle_class;
+ return field;
+ } else {
+ MonoMethod *meth;
+ meth = mono_get_method_full (image, token, NULL, context);
+ if (handle_class)
+ *handle_class = mono_defaults.methodhandle_class;
+ return meth;
+ }
+ }
default:
g_warning ("Unknown token 0x%08x in ldtoken", token);
break;
@@ -1484,3 +3044,642 @@ mono_ldtoken (MonoImage *image, guint32 token, MonoClass **handle_class)
return NULL;
}
+/**
+ * This function might need to call runtime functions so it can't be part
+ * of the metadata library.
+ */
+static MonoLookupDynamicToken lookup_dynamic = NULL;
+
+void
+mono_install_lookup_dynamic_token (MonoLookupDynamicToken func)
+{
+ lookup_dynamic = func;
+}
+
+gpointer
+mono_lookup_dynamic_token (MonoImage *image, guint32 token)
+{
+ return lookup_dynamic (image, token);
+}
+
+MonoImage*
+mono_class_get_image (MonoClass *klass)
+{
+ return klass->image;
+}
+
+/**
+ * mono_class_get_element_class:
+ * @klass: the MonoClass to act on
+ *
+ * Returns the element class of an array or an enumeration.
+ */
+MonoClass*
+mono_class_get_element_class (MonoClass *klass)
+{
+ return klass->element_class;
+}
+
+/**
+ * mono_class_is_valuetype:
+ * @klass: the MonoClass to act on
+ *
+ * Returns true if the MonoClass represents a ValueType.
+ */
+gboolean
+mono_class_is_valuetype (MonoClass *klass)
+{
+ return klass->valuetype;
+}
+
+/**
+ * mono_class_is_enum:
+ * @klass: the MonoClass to act on
+ *
+ * Returns true if the MonoClass represents an enumeration.
+ */
+gboolean
+mono_class_is_enum (MonoClass *klass)
+{
+ return klass->enumtype;
+}
+
+/**
+ * mono_class_enum_basetype:
+ * @klass: the MonoClass to act on
+ *
+ * Returns the underlying type representation for an enumeration.
+ */
+MonoType*
+mono_class_enum_basetype (MonoClass *klass)
+{
+ return klass->enum_basetype;
+}
+
+/**
+ * mono_class_get_parent
+ * @klass: the MonoClass to act on
+ *
+ * Returns the parent class for this class.
+ */
+MonoClass*
+mono_class_get_parent (MonoClass *klass)
+{
+ return klass->parent;
+}
+
+/**
+ * mono_class_get_nesting_type;
+ * @klass: the MonoClass to act on
+ *
+ * Returns the container type where this type is nested or NULL if this type is not a nested type.
+ */
+MonoClass*
+mono_class_get_nesting_type (MonoClass *klass)
+{
+ return klass->nested_in;
+}
+
+/**
+ * mono_class_get_rank:
+ * @klass: the MonoClass to act on
+ *
+ * Returns the rank for the array (the number of dimensions).
+ */
+int
+mono_class_get_rank (MonoClass *klass)
+{
+ return klass->rank;
+}
+
+/**
+ * mono_class_get_flags:
+ * @klass: the MonoClass to act on
+ *
+ * The type flags from the TypeDef table from the metadata.
+ * see the TYPE_ATTRIBUTE_* definitions on tabledefs.h for the
+ * different values.
+ *
+ * Returns the flags from the TypeDef table.
+ */
+guint32
+mono_class_get_flags (MonoClass *klass)
+{
+ return klass->flags;
+}
+
+/**
+ * mono_class_get_name
+ * @klass: the MonoClass to act on
+ *
+ * Returns the name of the class.
+ */
+const char*
+mono_class_get_name (MonoClass *klass)
+{
+ return klass->name;
+}
+
+/**
+ * mono_class_get_namespace:
+ * @klass: the MonoClass to act on
+ *
+ * Returns the namespace of the class.
+ */
+const char*
+mono_class_get_namespace (MonoClass *klass)
+{
+ return klass->name_space;
+}
+
+/**
+ * mono_class_get_type:
+ * @klass: the MonoClass to act on
+ *
+ * This method returns the internal Type representation for the class.
+ *
+ * Returns the MonoType from the class.
+ */
+MonoType*
+mono_class_get_type (MonoClass *klass)
+{
+ return &klass->byval_arg;
+}
+
+/**
+ * mono_class_get_byref_type:
+ * @klass: the MonoClass to act on
+ *
+ *
+ */
+MonoType*
+mono_class_get_byref_type (MonoClass *klass)
+{
+ return &klass->this_arg;
+}
+
+/**
+ * mono_class_num_fields:
+ * @klass: the MonoClass to act on
+ *
+ * Returns the number of static and instance fields in the class.
+ */
+int
+mono_class_num_fields (MonoClass *klass)
+{
+ return klass->field.count;
+}
+
+/**
+ * mono_class_num_methods:
+ * @klass: the MonoClass to act on
+ *
+ * Returns the number of methods in the class.
+ */
+int
+mono_class_num_methods (MonoClass *klass)
+{
+ return klass->method.count;
+}
+
+/**
+ * mono_class_num_properties
+ * @klass: the MonoClass to act on
+ *
+ * Returns the number of properties in the class.
+ */
+int
+mono_class_num_properties (MonoClass *klass)
+{
+ return klass->property.count;
+}
+
+/**
+ * mono_class_num_events:
+ * @klass: the MonoClass to act on
+ *
+ * Returns the number of events in the class.
+ */
+int
+mono_class_num_events (MonoClass *klass)
+{
+ return klass->event.count;
+}
+
+/**
+ * mono_class_get_fields:
+ * @klass: the MonoClass to act on
+ *
+ * This routine is an iterator routine for retrieving the fields in a class.
+ *
+ * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * iterate over all of the elements. When no more values are
+ * available, the return value is NULL.
+ *
+ * Returns a `MonoClassField *' on each iteration, or NULL when no more fields are available.
+ */
+MonoClassField*
+mono_class_get_fields (MonoClass* klass, gpointer *iter)
+{
+ MonoClassField* field;
+ if (!iter)
+ return NULL;
+ if (!klass->inited)
+ mono_class_init (klass);
+ if (!*iter) {
+ /* start from the first */
+ if (klass->field.count) {
+ return *iter = &klass->fields [0];
+ } else {
+ /* no fields */
+ return NULL;
+ }
+ }
+ field = *iter;
+ field++;
+ if (field < &klass->fields [klass->field.count]) {
+ return *iter = field;
+ }
+ return NULL;
+}
+
+/**
+ * mono_class_get_methods
+ * @klass: the MonoClass to act on
+ *
+ * This routine is an iterator routine for retrieving the fields in a class.
+ *
+ * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * iterate over all of the elements. When no more values are
+ * available, the return value is NULL.
+ *
+ * Returns a MonoMethod on each iteration or NULL when no more methods are available.
+ */
+MonoMethod*
+mono_class_get_methods (MonoClass* klass, gpointer *iter)
+{
+ MonoMethod** method;
+ if (!iter)
+ return NULL;
+ if (!klass->inited)
+ mono_class_init (klass);
+ if (!*iter) {
+ /* start from the first */
+ if (klass->method.count) {
+ *iter = &klass->methods [0];
+ return klass->methods [0];
+ } else {
+ /* no method */
+ return NULL;
+ }
+ }
+ method = *iter;
+ method++;
+ if (method < &klass->methods [klass->method.count]) {
+ *iter = method;
+ return *method;
+ }
+ return NULL;
+}
+
+/**
+ * mono_class_get_properties:
+ * @klass: the MonoClass to act on
+ *
+ * This routine is an iterator routine for retrieving the properties in a class.
+ *
+ * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * iterate over all of the elements. When no more values are
+ * available, the return value is NULL.
+ *
+ * Returns a `MonoProperty *' on each invocation, or NULL when no more are available.
+ */
+MonoProperty*
+mono_class_get_properties (MonoClass* klass, gpointer *iter)
+{
+ MonoProperty* property;
+ if (!iter)
+ return NULL;
+ if (!klass->inited)
+ mono_class_init (klass);
+ if (!*iter) {
+ /* start from the first */
+ if (klass->property.count) {
+ return *iter = &klass->properties [0];
+ } else {
+ /* no fields */
+ return NULL;
+ }
+ }
+ property = *iter;
+ property++;
+ if (property < &klass->properties [klass->property.count]) {
+ return *iter = property;
+ }
+ return NULL;
+}
+
+/**
+ * mono_class_get_events:
+ * @klass: the MonoClass to act on
+ *
+ * This routine is an iterator routine for retrieving the properties in a class.
+ *
+ * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * iterate over all of the elements. When no more values are
+ * available, the return value is NULL.
+ *
+ * Returns a `MonoEvent *' on each invocation, or NULL when no more are available.
+ */
+MonoEvent*
+mono_class_get_events (MonoClass* klass, gpointer *iter)
+{
+ MonoEvent* event;
+ if (!iter)
+ return NULL;
+ if (!klass->inited)
+ mono_class_init (klass);
+ if (!*iter) {
+ /* start from the first */
+ if (klass->event.count) {
+ return *iter = &klass->events [0];
+ } else {
+ /* no fields */
+ return NULL;
+ }
+ }
+ event = *iter;
+ event++;
+ if (event < &klass->events [klass->event.count]) {
+ return *iter = event;
+ }
+ return NULL;
+}
+
+/**
+ * mono_class_get_interfaces
+ * @klass: the MonoClass to act on
+ *
+ * This routine is an iterator routine for retrieving the interfaces implemented by this class.
+ *
+ * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * iterate over all of the elements. When no more values are
+ * available, the return value is NULL.
+ *
+ * Returns a `Monoclass *' on each invocation, or NULL when no more are available.
+ */
+MonoClass*
+mono_class_get_interfaces (MonoClass* klass, gpointer *iter)
+{
+ MonoClass** iface;
+ if (!iter)
+ return NULL;
+ if (!klass->inited)
+ mono_class_init (klass);
+ if (!*iter) {
+ /* start from the first */
+ if (klass->interface_count) {
+ *iter = &klass->interfaces [0];
+ return klass->interfaces [0];
+ } else {
+ /* no interface */
+ return NULL;
+ }
+ }
+ iface = *iter;
+ iface++;
+ if (iface < &klass->interfaces [klass->interface_count]) {
+ *iter = iface;
+ return *iface;
+ }
+ return NULL;
+}
+
+/**
+ * mono_class_get_nested_types
+ * @klass: the MonoClass to act on
+ *
+ * This routine is an iterator routine for retrieving the nested types of a class.
+ *
+ * You must pass a gpointer that points to zero and is treated as an opaque handle to
+ * iterate over all of the elements. When no more values are
+ * available, the return value is NULL.
+ *
+ * Returns a `Monoclass *' on each invocation, or NULL when no more are available.
+ */
+MonoClass*
+mono_class_get_nested_types (MonoClass* klass, gpointer *iter)
+{
+ GList *item;
+ if (!iter)
+ return NULL;
+ if (!klass->inited)
+ mono_class_init (klass);
+ if (!*iter) {
+ /* start from the first */
+ if (klass->nested_classes) {
+ *iter = klass->nested_classes;
+ return klass->nested_classes->data;
+ } else {
+ /* no nested types */
+ return NULL;
+ }
+ }
+ item = *iter;
+ item = item->next;
+ if (item) {
+ *iter = item;
+ return item->data;
+ }
+ return NULL;
+}
+
+/**
+ * mono_field_get_name:
+ * @field: the MonoClassField to act on
+ *
+ * Returns the name of the field.
+ */
+const char*
+mono_field_get_name (MonoClassField *field)
+{
+ return field->name;
+}
+
+/**
+ * mono_field_get_type:
+ * @field: the MonoClassField to act on
+ *
+ * Returns MonoType of the field.
+ */
+MonoType*
+mono_field_get_type (MonoClassField *field)
+{
+ return field->type;
+}
+
+/**
+ * mono_field_get_type:
+ * @field: the MonoClassField to act on
+ *
+ * Returns MonoClass where the field was defined.
+ */
+MonoClass*
+mono_field_get_parent (MonoClassField *field)
+{
+ return field->parent;
+}
+
+/**
+ * mono_field_get_flags;
+ * @field: the MonoClassField to act on
+ *
+ * The metadata flags for a field are encoded using the
+ * FIELD_ATTRIBUTE_* constants. See the tabledefs.h file for details.
+ *
+ * Returns the flags for the field.
+ */
+guint32
+mono_field_get_flags (MonoClassField *field)
+{
+ return field->type->attrs;
+}
+
+/**
+ * mono_property_get_name:
+ * @prop: the MonoProperty to act on
+ *
+ * Returns the name of the property
+ */
+const char*
+mono_property_get_name (MonoProperty *prop)
+{
+ return prop->name;
+}
+
+/**
+ * mono_property_get_set_method
+ * @prop: the MonoProperty to act on.
+ *
+ * Returns the setter method of the property (A MonoMethod)
+ */
+MonoMethod*
+mono_property_get_set_method (MonoProperty *prop)
+{
+ return prop->set;
+}
+
+/**
+ * mono_property_get_get_method
+ * @prop: the MonoProperty to act on.
+ *
+ * Returns the setter method of the property (A MonoMethod)
+ */
+MonoMethod*
+mono_property_get_get_method (MonoProperty *prop)
+{
+ return prop->get;
+}
+
+/**
+ * mono_property_get_parent:
+ * @prop: the MonoProperty to act on.
+ *
+ * Returns the MonoClass where the property was defined.
+ */
+MonoClass*
+mono_property_get_parent (MonoProperty *prop)
+{
+ return prop->parent;
+}
+
+/**
+ * mono_property_get_flags:
+ * @prop: the MonoProperty to act on.
+ *
+ * The metadata flags for a property are encoded using the
+ * PROPERTY_ATTRIBUTE_* constants. See the tabledefs.h file for details.
+ *
+ * Returns the flags for the property.
+ */
+guint32
+mono_property_get_flags (MonoProperty *prop)
+{
+ return prop->attrs;
+}
+
+/**
+ * mono_event_get_name:
+ * @event: the MonoEvent to act on
+ *
+ * Returns the name of the event.
+ */
+const char*
+mono_event_get_name (MonoEvent *event)
+{
+ return event->name;
+}
+
+/**
+ * mono_event_get_add_method:
+ * @event: The MonoEvent to act on.
+ *
+ * Returns the `add' method for the event (a MonoMethod).
+ */
+MonoMethod*
+mono_event_get_add_method (MonoEvent *event)
+{
+ return event->add;
+}
+
+/**
+ * mono_event_get_remove_method:
+ * @event: The MonoEvent to act on.
+ *
+ * Returns the `remove' method for the event (a MonoMethod).
+ */
+MonoMethod*
+mono_event_get_remove_method (MonoEvent *event)
+{
+ return event->remove;
+}
+
+/**
+ * mono_event_get_raise_method:
+ * @event: The MonoEvent to act on.
+ *
+ * Returns the `raise' method for the event (a MonoMethod).
+ */
+MonoMethod*
+mono_event_get_raise_method (MonoEvent *event)
+{
+ return event->raise;
+}
+
+/**
+ * mono_event_get_parent:
+ * @event: the MonoEvent to act on.
+ *
+ * Returns the MonoClass where the event is defined.
+ */
+MonoClass*
+mono_event_get_parent (MonoEvent *event)
+{
+ return event->parent;
+}
+
+/**
+ * mono_event_get_flags
+ * @event: the MonoEvent to act on.
+ *
+ * The metadata flags for an event are encoded using the
+ * EVENT_* constants. See the tabledefs.h file for details.
+ *
+ * Returns the flags for the event.
+ */
+guint32
+mono_event_get_flags (MonoEvent *event)
+{
+ return event->attrs;
+}
+
diff --git a/mono/metadata/class.h b/mono/metadata/class.h
index 7bcbe0d472e..863cf11e391 100644
--- a/mono/metadata/class.h
+++ b/mono/metadata/class.h
@@ -5,168 +5,31 @@
#include <mono/metadata/image.h>
#include <mono/metadata/loader.h>
-#define MONO_CLASS_IS_ARRAY(c) ((c)->rank)
+typedef struct MonoVTable MonoVTable;
-extern gboolean mono_print_vtable;
-
-/* declared in marshal.h */
-typedef struct MonoMarshalType MonoMarshalType;
-
-typedef struct {
- MonoType *type;
- int offset;
- const char *name;
- const char *data;
- /* add marshal data, too */
-} MonoClassField;
+typedef struct _MonoClassField MonoClassField;
+typedef struct _MonoProperty MonoProperty;
+typedef struct _MonoEvent MonoEvent;
typedef struct {
- const char *name;
- MonoMethod *get;
- MonoMethod *set;
- guint32 attrs;
-} MonoProperty;
-
-typedef struct {
- const char *name;
- MonoMethod *add;
- MonoMethod *remove;
- MonoMethod *raise;
- MonoMethod **other;
- guint32 attrs;
-} MonoEvent;
-
-struct _MonoClass {
- MonoImage *image;
- guint32 type_token;
-
- guint dummy : 1; /* temorary hack */
- guint inited : 1;
- /* We use init_pending to detect cyclic calls to mono_class_init */
- guint init_pending : 1;
-
- /* A class contains static and non static data. Static data can be
- * of the same type as the class itselfs, but it does not influence
- * the instance size of the class. To avoid cyclic calls to
- * mono_class_init (from mono_class_instance_size ()) we first
- * initialise all non static fields. After that we set size_inited
- * to 1, because we know the instance size now. After that we
- * initialise all static fields.
- */
- guint size_inited : 1;
- guint valuetype : 1; /* derives from System.ValueType */
- guint enumtype : 1; /* derives from System.Enum */
- guint ghcimpl : 1; /* class has its own GetHashCode impl */
- guint has_finalize : 1; /* class has its own Finalize impl */
- guint marshalbyref : 1; /* class is a MarshalByRefObject */
- guint contextbound : 1; /* class is a ContextBoundObject */
- guint delegate : 1; /* class is a Delegate */
- guint min_align : 4;
-
- MonoClass *parent;
- MonoClass *nested_in;
- GList *nested_classes;
- GList *subclasses; /* list of all subclasses */
-
- const char *name;
- const char *name_space;
-
- guint interface_count;
- guint interface_id; /* unique inderface id (for interfaces) */
- guint max_interface_id;
- gint *interface_offsets;
+ MonoVTable *vtable;
+ MonoClass *proxy_class;
+ guint interface_count;
MonoClass **interfaces;
-
- /*
- * Computed object instance size, total.
- */
- int instance_size;
- int class_size;
- int vtable_size; /* number of slots */
-
- /*
- * relative numbering for fast type checking
- */
- unsigned int baseval;
- unsigned int diffval;
-
- /*
- * From the TypeDef table
- */
- guint32 flags;
- struct {
- guint32 first, last;
- int count;
- } field, method, property, event;
-
- /* loaded on demand */
- MonoMarshalType *marshal_info;
-
- /*
- * Field information: Type and location from object base
- */
- MonoClassField *fields;
-
- MonoProperty *properties;
-
- MonoEvent *events;
-
- MonoMethod **methods;
-
- /* The underlying type of the enum */
- MonoType *enum_basetype;
- /* element class for arrays and enum */
- MonoClass *element_class;
- /* array dimension */
- guint32 rank;
-
- /* used as the type of the this argument and when passing the arg by value */
- MonoType this_arg;
- MonoType byval_arg;
-
- void *reflection_info;
-
- MonoMethod **vtable;
-};
-
-typedef struct {
- MonoClass *klass;
- MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
- guint max_interface_id;
- gpointer *interface_offsets;
- gpointer data;
- gpointer vtable [MONO_ZERO_LEN_ARRAY];
-} MonoVTable;
-
-typedef struct {
- gulong new_object_count;
- gulong initialized_class_count;
- gulong used_class_count;
- gulong class_vtable_size;
- gulong class_static_data_size;
-} MonoStats;
-
-extern MonoStats mono_stats;
-
-typedef gpointer (*MonoTrampoline) (MonoMethod *method);
+ char* proxy_class_name;
+} MonoRemoteClass;
MonoClass *
mono_class_get (MonoImage *image, guint32 type_token);
+MonoClass *
+mono_class_get_full (MonoImage *image, guint32 type_token, MonoGenericContext *context);
+
void
mono_class_init (MonoClass *klass);
MonoVTable *
-mono_class_vtable (MonoDomain *domain, MonoClass *class);
-
-MonoVTable *
-mono_class_proxy_vtable (MonoDomain *domain, MonoClass *class);
-
-void
-mono_class_setup_mono_type (MonoClass *class);
-
-void
-mono_class_setup_parent (MonoClass *class, MonoClass *parent);
+mono_class_vtable (MonoDomain *domain, MonoClass *klass);
MonoClass *
mono_class_from_name (MonoImage *image, const char* name_space, const char *name);
@@ -177,11 +40,26 @@ mono_class_from_name_case (MonoImage *image, const char* name_space, const char
MonoClass *
mono_class_from_typeref (MonoImage *image, guint32 type_token);
+MonoClass *
+mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, gboolean is_mvar);
+
+MonoClass*
+mono_class_create_generic (MonoGenericInst *ginst);
+
+MonoType*
+mono_class_inflate_generic_type (MonoType *type, MonoGenericContext *context);
+
+MonoMethod*
+mono_class_inflate_generic_method (MonoMethod *method, MonoGenericContext *context, MonoClass *klass);
+
MonoClassField*
-mono_field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass);
+mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, MonoGenericContext *context);
+
+MonoClass *
+mono_bounded_array_class_get (MonoClass *element_class, guint32 rank, gboolean bounded);
MonoClass *
-mono_array_class_get (MonoType *element_type, guint32 rank);
+mono_array_class_get (MonoClass *element_class, guint32 rank);
MonoClass *
mono_ptr_class_get (MonoType *type);
@@ -192,6 +70,18 @@ mono_class_get_field (MonoClass *klass, guint32 field_token);
MonoClassField *
mono_class_get_field_from_name (MonoClass *klass, const char *name);
+guint32
+mono_class_get_field_token (MonoClassField *field);
+
+guint32
+mono_class_get_event_token (MonoEvent *event);
+
+MonoProperty*
+mono_class_get_property_from_name (MonoClass *klass, const char *name);
+
+guint32
+mono_class_get_property_token (MonoProperty *prop);
+
gint32
mono_array_element_size (MonoClass *ac);
@@ -199,21 +89,159 @@ gint32
mono_class_instance_size (MonoClass *klass);
gint32
-mono_class_value_size (MonoClass *klass, guint32 *align);
+mono_class_array_element_size (MonoClass *klass);
gint32
mono_class_data_size (MonoClass *klass);
+gint32
+mono_class_value_size (MonoClass *klass, guint32 *align);
+
+gint32
+mono_class_min_align (MonoClass *klass);
+
MonoClass *
mono_class_from_mono_type (MonoType *type);
+gboolean
+mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc,
+ gboolean check_interfaces);
+
+gboolean
+mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass);
+
gpointer
-mono_ldtoken (MonoImage *image, guint32 token, MonoClass **retclass);
+mono_ldtoken (MonoImage *image, guint32 token, MonoClass **retclass, MonoGenericContext *context);
-void
-mono_install_trampoline (MonoTrampoline func);
+char*
+mono_type_get_name (MonoType *type);
+
+char*
+mono_type_get_full_name (MonoType *type);
+
+MonoType*
+mono_type_get_underlying_type (MonoType *type);
+
+/* MonoClass accessors */
+MonoImage*
+mono_class_get_image (MonoClass *klass);
+
+MonoClass*
+mono_class_get_element_class (MonoClass *klass);
+
+gboolean
+mono_class_is_valuetype (MonoClass *klass);
+
+gboolean
+mono_class_is_enum (MonoClass *klass);
+
+MonoType*
+mono_class_enum_basetype (MonoClass *klass);
+
+MonoClass*
+mono_class_get_parent (MonoClass *klass);
+
+MonoClass*
+mono_class_get_nesting_type (MonoClass *klass);
+
+int
+mono_class_get_rank (MonoClass *klass);
+
+guint32
+mono_class_get_flags (MonoClass *klass);
+
+const char*
+mono_class_get_name (MonoClass *klass);
+
+const char*
+mono_class_get_namespace (MonoClass *klass);
+
+MonoType*
+mono_class_get_type (MonoClass *klass);
+
+MonoType*
+mono_class_get_byref_type (MonoClass *klass);
+
+int
+mono_class_num_fields (MonoClass *klass);
+
+int
+mono_class_num_methods (MonoClass *klass);
+
+int
+mono_class_num_properties (MonoClass *klass);
+
+int
+mono_class_num_events (MonoClass *klass);
+
+MonoClassField*
+mono_class_get_fields (MonoClass* klass, gpointer *iter);
+
+MonoMethod*
+mono_class_get_methods (MonoClass* klass, gpointer *iter);
+
+MonoProperty*
+mono_class_get_properties (MonoClass* klass, gpointer *iter);
+
+MonoEvent*
+mono_class_get_events (MonoClass* klass, gpointer *iter);
+
+MonoClass*
+mono_class_get_interfaces (MonoClass* klass, gpointer *iter);
+
+MonoClass*
+mono_class_get_nested_types (MonoClass* klass, gpointer *iter);
+
+/* MonoClassField accessors */
+const char*
+mono_field_get_name (MonoClassField *field);
+
+MonoType*
+mono_field_get_type (MonoClassField *field);
+
+MonoClass*
+mono_field_get_parent (MonoClassField *field);
+
+guint32
+mono_field_get_flags (MonoClassField *field);
+
+/* MonoProperty acessors */
+const char*
+mono_property_get_name (MonoProperty *prop);
+
+MonoMethod*
+mono_property_get_set_method (MonoProperty *prop);
+
+MonoMethod*
+mono_property_get_get_method (MonoProperty *prop);
+
+MonoClass*
+mono_property_get_parent (MonoProperty *prop);
+
+guint32
+mono_property_get_flags (MonoProperty *prop);
+
+/* MonoEvent accessors */
+const char*
+mono_event_get_name (MonoEvent *event);
+
+MonoMethod*
+mono_event_get_add_method (MonoEvent *event);
+
+MonoMethod*
+mono_event_get_remove_method (MonoEvent *event);
+
+MonoMethod*
+mono_event_get_remove_method (MonoEvent *event);
+
+MonoMethod*
+mono_event_get_raise_method (MonoEvent *event);
+
+MonoClass*
+mono_event_get_parent (MonoEvent *event);
+
+guint32
+mono_event_get_flags (MonoEvent *event);
-void
-mono_install_remoting_trampoline (MonoTrampoline func);
#endif /* _MONO_CLI_CLASS_H_ */
diff --git a/mono/metadata/culture-info-tables.h b/mono/metadata/culture-info-tables.h
new file mode 100644
index 00000000000..a559ce09555
--- /dev/null
+++ b/mono/metadata/culture-info-tables.h
@@ -0,0 +1,3006 @@
+
+/* This is a generated file. Do not edit. See tools/locale-builder. */
+#ifndef MONO_METADATA_CULTURE_INFO_TABLES
+#define MONO_METADATA_CULTURE_INFO_TABLES 1
+
+
+#define NUM_CULTURE_ENTRIES 155
+
+
+static const DateTimeFormatEntry datetime_format_entries [] = {
+ {1, 24, 37, 46, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {87, 98, 113, 130, 147, 160, 173}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {327, 349, 362, 378, 387, 393, 403, 411, 414, {417, 430, 451, 466, 477, 496, 507}, {520, 528, 536, 542, 548, 558, 566}, {574, 587, 604, 613, 624, 631, 638, 645, 658, 677, 694, 709}, {726, 732, 604, 740, 624, 631, 638, 748, 756, 764, 772, 782, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 825, 378, 387, 393, 403, 411, 414, {836, 845, 853, 861, 870, 877, 887}, {896, 900, 904, 908, 912, 916, 920}, {924, 930, 937, 943, 949, 954, 959, 966, 972, 981, 989, 998}, {1007, 1012, 937, 1017, 949, 954, 1022, 1027, 1031, 1036, 1041, 1046, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1051, 1074, 1087, 1096, 1104, 393, 1109, 1117, 1122, {1127, 1135, 1145, 1153, 1161, 1170, 1177}, {1184, 1187, 1190, 1194, 1197, 1201, 1205}, {1208, 1214, 1220, 1228, 1234, 1242, 1250, 1260, 1266, 1274, 1282, 1291}, {1300, 1302, 1305, 1309, 1312, 1314, 1317, 1321, 1326, 1329, 1331, 1334, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1338, 1361, 1373, 378, 387, 393, 403, 411, 414, {1384, 1392, 1399, 1407, 1414, 1422, 1429}, {1437, 1442, 1446, 1450, 1454, 1458, 1462}, {1467, 1474, 1482, 1488, 1494, 1498, 1503, 1508, 1515, 1525, 1533, 1542}, {1551, 1555, 1559, 1563, 1494, 1567, 1571, 1575, 1579, 1583, 1587, 1591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1595, 1074, 1619, 378, 387, 393, 1109, 1630, 1636, {1643, 1651, 1658, 1667, 1676, 1687, 1695}, {1703, 1706, 1709, 1712, 1715, 1718, 1721}, {1724, 1731, 1739, 1745, 1751, 1755, 1760, 1765, 1772, 1782, 1790, 1799}, {1808, 1812, 1816, 1820, 1751, 1824, 1828, 1832, 1836, 1840, 1844, 1848, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1852, 349, 37, 1877, 56, 393, 403, 1888, 1893, {1898, 1913, 1928, 1939, 1954, 1967, 1986}, {2001, 2008, 2015, 2022, 2029, 2036, 2043}, {2050, 2071, 2094, 2109, 2126, 2137, 2152, 2167, 2186, 2209, 2228, 2247}, {2268, 2275, 2282, 2289, 2296, 2303, 2312, 2321, 2328, 2335, 2342, 2349, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {2356, 2381, 2401, 1877, 2410, 393, 2418, 411, 414, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {2703, 2731, 1087, 1096, 387, 2748, 1109, 411, 414, {2762, 2772, 2782, 2790, 2802, 2810, 2820}, {2829, 2832, 2835, 2838, 2841, 2844, 2847}, {2850, 2859, 2868, 2878, 2887, 2896, 2905, 2915, 2922, 2930, 2938, 2948}, {2957, 2963, 2969, 2976, 2982, 2988, 2994, 3001, 3005, 3010, 3015, 3022, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 825, 378, 387, 393, 74, 411, 414, {3028, 3037, 3043, 3049, 3058, 3064, 3073}, {3080, 3085, 3090, 3095, 3100, 3105, 3110}, {3115, 3123, 3132, 3137, 3143, 3147, 3152, 3160, 3166, 3176, 989, 3184}, {3194, 3200, 3132, 3207, 3143, 3147, 3212, 3160, 3218, 1036, 1041, 3224, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {3230, 813, 825, 378, 387, 393, 74, 411, 414, {3253, 3271, 3285, 3303, 3321, 3339, 3355}, {3362, 3365, 3368, 3371, 3374, 3377, 3380}, {3383, 3394, 3407, 3414, 3425, 3432, 3441, 3450, 3463, 3476, 3491, 3504}, {3515, 3522, 3407, 3529, 3425, 3536, 3543, 3550, 3557, 3564, 3571, 3578, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {3585, 3609, 3623, 1096, 1104, 3637, 2418, 3648, 3651, {3654, 3664, 3672, 3677, 3684, 3697, 3705}, {1312, 3713, 3715, 3717, 3721, 3724, 3726}, {3730, 3738, 3747, 3756, 3765, 3772, 3780, 3788, 3798, 3809, 1533, 1542}, {3818, 3823, 3829, 3836, 3842, 3848, 3854, 3860, 3865, 3872, 1041, 3877, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1595, 1074, 1087, 378, 387, 393, 1109, 411, 414, {3882, 3893, 3904, 3918, 3932, 3944, 3956}, {3968, 3972, 3977, 3982, 3987, 3991, 3996}, {4000, 4008, 3132, 4017, 4024, 4029, 4036, 4043, 1515, 3809, 4051, 4061}, {1551, 1555, 1559, 1563, 4024, 4070, 4075, 4080, 1579, 1583, 4086, 4091, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {4095, 349, 825, 4118, 387, 393, 74, 4126, 4129, {4132, 4141, 4149, 4158, 4169, 4178, 4187}, {4194, 4198, 1559, 4202, 4206, 4210, 4214}, {4218, 4226, 4235, 4241, 4248, 4255, 4262, 4269, 4276, 4286, 989, 4294}, {4303, 1555, 1559, 1563, 4307, 4311, 4315, 4319, 4323, 4327, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {4335, 4367, 4389, 4400, 1104, 4410, 4421, 4429, 4436, {4443, 4453, 4463, 4473, 4483, 4493, 4503}, {4513, 4517, 4521, 4525, 4529, 4533, 4537}, {4541, 4546, 4551, 4556, 4561, 4566, 4571, 4576, 4581, 4586, 4592, 4598}, {4604, 4606, 4608, 4610, 4612, 4614, 4616, 4618, 4620, 4622, 4625, 4628, 322}, 0, 0, 323, 325, {4389,2603,4631,4638,4647,4666,4683},{4367,4702,4726,4753},{1104,387,4782,4790},{1096,378,4799,4810}},
+ {4822, 4872, 4896, 4910, 4918, 4925, 4937, 4946, 4953, {4960, 4970, 4980, 4990, 5000, 5010, 5020}, {5030, 5034, 5038, 5042, 5046, 5050, 5054}, {5058, 5063, 5068, 5073, 5078, 5083, 5088, 5093, 5098, 5103, 5109, 5115}, {5058, 5063, 5068, 5073, 5078, 5083, 5088, 5093, 5098, 5103, 5109, 5115, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {5121, 813, 5143, 1096, 1104, 393, 74, 411, 414, {5152, 5159, 5167, 5175, 5184, 5194, 5202}, {5211, 2832, 5214, 5217, 5220, 5223, 5226}, {5229, 5237, 5246, 1488, 5252, 1498, 1503, 5256, 1515, 1525, 1533, 1542}, {1551, 1555, 5265, 1563, 5252, 1567, 1571, 1575, 1579, 1583, 1587, 1591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 2612, 378, 387, 393, 74, 411, 414, {5269, 5279, 5293, 5300, 5307, 5316, 1177}, {5324, 5326, 5329, 5332, 5336, 5339, 1703}, {5342, 5351, 5356, 5363, 1494, 5373, 5382, 5389, 5399, 5409, 1282, 5422}, {5432, 5436, 1559, 5440, 1494, 5444, 5448, 5452, 5456, 5460, 5465, 5469, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {5473, 5512, 37, 378, 387, 5534, 5549, 411, 414, {5561, 5569, 5583, 5596, 5609, 5622, 5634}, {4194, 5642, 5646, 5650, 5654, 5658, 5662}, {5667, 5675, 5685, 943, 5692, 5697, 5703, 4269, 5709, 5718, 5726, 5735}, {1551, 5744, 1559, 5748, 3143, 1567, 1571, 4319, 4323, 5752, 1587, 5756, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 1619, 378, 387, 393, 74, 411, 414, {5760, 5770, 5775, 5782, 5791, 5795, 5802}, {5813, 5815, 5817, 1712, 5820, 1312, 5822}, {5824, 5833, 5843, 5850, 3143, 5858, 5864, 1508, 5870, 5881, 5891, 5901}, {5911, 1812, 2564, 1820, 1751, 5915, 5919, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {5923, 5951, 1619, 1096, 1104, 393, 74, 411, 414, {5969, 5992, 451, 6015, 6026, 6041, 6056}, {6071, 6076, 6081, 6086, 6091, 6096, 6101}, {6106, 6119, 6134, 6143, 6156, 6163, 6172, 6181, 6194, 6211, 6226, 6239}, {6254, 6261, 6268, 6275, 624, 6282, 6289, 6296, 6303, 6310, 6317, 6324, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {6331, 6356, 1087, 1096, 387, 3637, 6370, 411, 414, {6378, 6387, 6399, 6406, 6414, 6424, 6430}, {6437, 6441, 6445, 6449, 6453, 6458, 6462}, {6466, 6476, 6485, 6493, 6501, 6509, 6516, 6523, 6531, 1282, 6537, 6545}, {6554, 6558, 6562, 6567, 6571, 5448, 6575, 6579, 6583, 5465, 6587, 6591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1051, 1074, 6595, 1096, 1104, 393, 1109, 411, 414, {6606, 6614, 6623, 6630, 6637, 6646, 6653}, {6660, 6663, 6666, 6669, 6672, 6676, 1703}, {3730, 3738, 6679, 4017, 6685, 4070, 4075, 1508, 1515, 3809, 1533, 1542}, {1551, 1555, 1559, 1563, 6685, 4070, 4075, 1575, 1579, 1583, 1587, 1591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {6690, 349, 2612, 6715, 6726, 393, 403, 6733, 6736, {6739, 6746, 6755, 6764, 6776, 6784, 6793}, {6803, 6807, 2564, 6812, 6817, 6821, 6825}, {6829, 6835, 3132, 6842, 1494, 6848, 6856, 6863, 6869, 6877, 6883, 6891}, {1808, 6899, 2564, 6903, 6907, 6911, 6915, 6919, 6825, 6923, 6927, 6932, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {6936, 6964, 2612, 378, 6981, 393, 74, 6987, 6990, {6993, 7001, 7009, 1407, 1414, 1422, 7016}, {7024, 7028, 2835, 7032, 2841, 7035, 7038}, {5229, 5237, 3132, 1488, 1494, 1498, 1503, 7042, 1515, 1525, 1533, 1542}, {1551, 1555, 1559, 1563, 1494, 1567, 1571, 1575, 1579, 1583, 1587, 1591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {7050, 813, 37, 1096, 1104, 393, 74, 7103, 7134, {7165, 7196, 7224, 7252, 7271, 7305, 7330}, {7355, 7363, 7368, 7373, 7378, 7386, 7391}, {7396, 7415, 7446, 7465, 7484, 7506, 7531, 7553, 7575, 7597, 7616, 7644}, {7666, 7675, 7684, 7696, 7708, 7717, 7729, 7738, 7747, 7756, 7765, 7774, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {7783, 7812, 1619, 378, 387, 393, 403, 411, 414, {7830, 7836, 7846, 7852, 7863, 7873, 7878}, {7888, 7892, 7896, 7900, 7905, 7909, 7913}, {7917, 7922, 7929, 7934, 7940, 7947, 7955, 7962, 7971, 7978, 7983, 7990}, {7998, 8002, 2564, 8007, 2533, 8011, 8015, 8019, 8024, 8028, 8032, 8036, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {8040, 349, 825, 1096, 1104, 393, 403, 411, 414, {8061, 8068, 8074, 8081, 8086, 8092, 8098}, {8104, 8108, 8112, 8116, 8120, 8124, 8128}, {8132, 8140, 8149, 1745, 8155, 1755, 1760, 8159, 1772, 1782, 1790, 8167}, {1808, 1812, 2564, 1820, 8155, 1824, 1828, 8176, 1836, 1840, 1844, 8180, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 1619, 1096, 387, 393, 74, 411, 414, {8184, 8197, 8216, 8233, 8246, 8259, 8275}, {8288, 6076, 6081, 6086, 6091, 6096, 6101}, {8293, 8304, 8317, 8332, 8345, 8358, 8371, 8382, 8395, 8410, 8423, 8442}, {8455, 8462, 8469, 8476, 8485, 8494, 8503, 8510, 8519, 8526, 8535, 8544, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {8553, 813, 1619, 1096, 6981, 393, 74, 411, 414, {8576, 8591, 8612, 8627, 8640, 8653, 8668}, {8681, 8686, 8691, 8696, 8701, 8706, 8711}, {8716, 8733, 8742, 8757, 624, 8774, 8789, 8802, 8817, 8834, 8855, 8872}, {8887, 8462, 8894, 8901, 624, 8908, 8915, 8922, 8519, 8929, 8936, 8943, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {8950, 8974, 1087, 1096, 1104, 393, 8988, 411, 414, {8997, 9005, 9016, 9022, 9028, 9037, 1177}, {6437, 6441, 1454, 9043, 6453, 6458, 9047}, {1467, 1474, 6679, 1488, 1494, 9051, 9057, 9063, 1515, 1525, 1533, 1542}, {1551, 1555, 1559, 1563, 1494, 1567, 1571, 9070, 1579, 1583, 1587, 1591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {5121, 813, 9074, 1096, 1104, 393, 9084, 411, 414, {9092, 9103, 9114, 9125, 9136, 9147, 9153}, {3724, 9162, 9164, 3715, 5324, 9166, 5815}, {9168, 9176, 9185, 9192, 3143, 9199, 9205, 1508, 1515, 9211, 1533, 9220}, {9230, 9235, 9185, 1563, 3143, 9199, 9205, 1575, 9241, 1583, 1587, 9246, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {9251, 9283, 9304, 1096, 387, 9316, 1109, 411, 414, {9334, 9345, 9355, 9364, 9375, 9387, 9398}, {9408, 3724, 9411, 9164, 9413, 9415, 5822}, {9418, 9428, 1482, 9439, 9448, 9454, 9462, 9470, 9478, 9489, 9498, 9508}, {1808, 1812, 2564, 1820, 1751, 9518, 9523, 1832, 1836, 1840, 1844, 2572, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {9528, 9561, 9583, 378, 387, 9594, 2418, 411, 414, {9609, 9621, 9633, 9645, 9659, 9674, 9687}, {9701, 9704, 9707, 9710, 9713, 5326, 6672}, {9716, 9723, 9731, 9736, 9747, 9757, 9767, 9774, 9786, 9795, 9802, 9813}, {9823, 9827, 9831, 9835, 9839, 9843, 9847, 9851, 9855, 9859, 9863, 9867, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {9871, 813, 2401, 2691, 387, 393, 74, 9896, 9903, {9910, 9926, 9939, 9955, 9972, 9990, 9999}, {10008, 10012, 10016, 10020, 10024, 10028, 10032}, {10036, 10049, 208, 10060, 10071, 10076, 10085, 10096, 10103, 10118, 10129, 10142}, {10155, 10162, 10169, 10176, 10183, 10190, 10197, 10096, 10204, 10211, 10218, 10225, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {10232, 349, 825, 1877, 387, 393, 403, 10256, 10259, {10262, 10275, 10285, 10294, 10304, 10315, 10326}, {10338, 10341, 10346, 10351, 10356, 10361, 10366}, {10371, 10384, 10395, 10405, 10416, 10428, 10440, 10453, 10465, 10478, 10493, 10514}, {10533, 10539, 10545, 10551, 10557, 10563, 10569, 10575, 10581, 10587, 10594, 10601, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {10608, 2633, 1619, 1096, 387, 393, 2418, 10633, 10641, {10649, 10662, 10683, 10702, 10723, 10742, 10755}, {10766, 10773, 10780, 10787, 10794, 10801, 10808}, {10815, 10832, 10849, 10858, 10869, 10880, 10893, 10906, 10921, 10940, 10959, 10976}, {10995, 11002, 11009, 11016, 11023, 11030, 11037, 11044, 11051, 11058, 11065, 11072, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {10608, 2633, 1619, 1096, 387, 393, 2418, 10633, 11079, {10649, 10662, 10683, 10702, 10723, 10742, 10755}, {10766, 10773, 10780, 10787, 10794, 10801, 10808}, {11087, 11102, 10849, 10858, 10869, 11117, 11130, 10906, 10921, 10940, 10959, 10976}, {11143, 11150, 11009, 11016, 11023, 11157, 11164, 11044, 11051, 11058, 11065, 11072, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11171, 11212, 4389, 378, 387, 11242, 11257, 411, 414, {11270, 11278, 11289, 11299, 11310, 11319, 11328}, {11338, 11341, 11344, 11347, 11350, 11353, 11356}, {11359, 11369, 11377, 11385, 11393, 11401, 11408, 11416, 11424, 11431, 11437, 11444}, {11452, 11456, 1559, 11460, 3143, 11464, 11468, 11472, 11476, 11480, 11484, 11488, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11492, 349, 1619, 378, 387, 393, 403, 411, 414, {11516, 430, 451, 6015, 11529, 11546, 11557}, {520, 528, 536, 11570, 11578, 558, 11586}, {11594, 587, 604, 613, 11609, 11616, 11625, 645, 658, 677, 694, 709}, {11634, 732, 11642, 740, 11650, 11658, 11666, 748, 11674, 764, 772, 11684, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11696, 349, 4389, 2691, 56, 393, 403, 322, 322, {11719, 11726, 11734, 11742, 11751, 11761, 11768}, {1703, 5817, 1709, 11777, 1715, 11780, 1721}, {11783, 11792, 11802, 1745, 8155, 11808, 11814, 11820, 1772, 1782, 1790, 8167}, {1808, 1812, 2564, 1820, 8155, 1824, 1828, 1832, 1836, 1840, 1844, 8180, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1338, 1361, 1373, 11829, 387, 393, 403, 411, 414, {3882, 11838, 11849, 11859, 11869, 11879, 11893}, {3968, 3972, 11905, 11910, 11914, 11919, 11924}, {1467, 1474, 3132, 4017, 3143, 1498, 1503, 1508, 1515, 1525, 1533, 4061}, {1551, 1555, 1559, 1563, 3143, 1567, 1571, 1575, 1579, 1583, 1587, 4091, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11928, 813, 1373, 378, 56, 393, 74, 11952, 11980, {12002, 12021, 12040, 12062, 12081, 12103, 12128}, {12147, 12157, 12167, 12180, 12190, 12203, 12219}, {12229, 12245, 12261, 12277, 12296, 12303, 12313, 12329, 12345, 12367, 12389, 12408}, {12229, 12245, 12261, 12277, 12296, 12303, 12313, 12329, 12345, 12367, 12389, 12408, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {12430, 12454, 2401, 12467, 387, 12478, 6370, 411, 414, {12488, 12497, 12506, 12514, 12523, 12532, 12539}, {12548, 12552, 12556, 12560, 12564, 12568, 12572}, {8132, 8140, 12576, 12582, 8155, 1755, 12589, 12595, 12602, 12611, 12618, 12626}, {1808, 1812, 2564, 1820, 8155, 1824, 1828, 12634, 1836, 1840, 1844, 8180, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {12638, 813, 12663, 12671, 12684, 393, 74, 12692, 12734, {12776, 12795, 12814, 12836, 12855, 12877, 12902}, {12921, 12931, 12941, 12954, 12964, 12977, 12993}, {13003, 13031, 13059, 13075, 13094, 13101, 13111, 13127, 13143, 13171, 13193, 13215}, {13240, 13259, 13059, 13075, 13094, 13101, 13111, 13127, 13278, 13294, 13310, 13320, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11928, 813, 13333, 13340, 56, 393, 74, 13352, 13365, {13378, 13397, 13419, 13444, 13460, 13482, 13501}, {13511, 13518, 13525, 13532, 13539, 13546, 13553}, {13557, 13573, 13598, 13617, 13636, 13643, 13656, 13669, 13688, 13719, 13744, 13766}, {13791, 13799, 13813, 13827, 13636, 13643, 13656, 13838, 13846, 13860, 13871, 13879, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11928, 813, 13890, 13340, 56, 393, 74, 13899, 13927, {13949, 13971, 13993, 14018, 14040, 14065, 14093}, {14115, 14125, 14135, 14148, 14158, 14171, 14187}, {14197, 14213, 14238, 14257, 14279, 14286, 14299, 14312, 14331, 14362, 14387, 14406}, {14197, 14213, 14238, 14257, 14279, 14286, 14299, 14312, 14331, 14362, 14387, 14406, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {12638, 813, 13333, 12671, 12684, 393, 74, 14431, 14459, {14481, 14500, 14519, 14541, 14560, 14582, 14607}, {14626, 14631, 14639, 14647, 14655, 14663, 14671}, {14682, 14698, 14723, 14742, 14764, 14771, 14784, 14797, 14816, 14844, 14869, 14891}, {14682, 14698, 14723, 14742, 14764, 14771, 14784, 14797, 14816, 14844, 14869, 14891, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11928, 813, 13333, 13340, 56, 393, 74, 14916, 14928, {12002, 12021, 14940, 12062, 12081, 12103, 12128}, {12147, 12157, 14962, 12180, 12190, 12203, 12219}, {14975, 15000, 12261, 15025, 15044, 12303, 15051, 15064, 15080, 15108, 15130, 15158}, {14975, 15000, 12261, 15025, 15044, 12303, 15051, 15064, 15080, 15108, 15130, 15158, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11492, 349, 15180, 15189, 387, 393, 403, 411, 414, {15200, 15208, 15213, 15220, 15230, 15236, 15243}, {15251, 15255, 2564, 15259, 15264, 15268, 15272}, {15277, 15285, 15294, 15300, 15306, 15311, 15317, 15323, 15330, 15339, 15347, 15356}, {15365, 1812, 2564, 15369, 1751, 15373, 15378, 12634, 15382, 15386, 1844, 2572, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11928, 813, 13333, 13340, 56, 393, 74, 14916, 14928, {15390, 12021, 15418, 12062, 12081, 12103, 12128}, {12147, 12157, 14962, 12180, 12190, 12203, 12219}, {14975, 15437, 12261, 15025, 15044, 12303, 15051, 15064, 15080, 15108, 15130, 15158}, {14975, 15000, 12261, 15025, 15044, 12303, 15051, 15064, 15080, 15108, 15130, 15158, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 37, 46, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1595, 1074, 1619, 378, 387, 393, 1109, 1630, 1636, {1643, 1651, 1658, 1667, 1676, 1687, 1695}, {1703, 1706, 1709, 1712, 1715, 1718, 1721}, {1724, 1731, 1739, 1745, 1751, 1755, 1760, 1765, 1772, 1782, 1790, 1799}, {1808, 1812, 1816, 1820, 1751, 1824, 1828, 1832, 1836, 1840, 1844, 1848, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 825, 378, 387, 393, 74, 411, 414, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 15660, 1096, 387, 393, 74, 411, 414, {3028, 3037, 3043, 3049, 3058, 3064, 3073}, {3080, 3085, 3090, 3095, 3100, 3105, 3110}, {3115, 3123, 3132, 3137, 3143, 3147, 3152, 3160, 3166, 3176, 989, 3184}, {3194, 3200, 3132, 3207, 3143, 3147, 3212, 3160, 3218, 1036, 1041, 3224, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 1619, 378, 387, 393, 74, 4126, 4129, {4132, 4141, 4149, 4158, 4169, 4178, 4187}, {4194, 4198, 1559, 4202, 4206, 4210, 4214}, {4218, 4226, 4235, 4241, 4248, 4255, 4262, 4269, 4276, 4286, 989, 4294}, {4303, 1555, 1559, 1563, 4307, 4311, 4315, 4319, 4323, 4327, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 15660, 1096, 387, 393, 74, 411, 414, {5152, 5159, 5167, 5175, 5184, 5194, 5202}, {5211, 2832, 5214, 5217, 5220, 5223, 5226}, {5229, 5237, 5246, 1488, 5252, 1498, 1503, 5256, 1515, 1525, 1533, 1542}, {1551, 1555, 5265, 1563, 5252, 1567, 1571, 1575, 1579, 1583, 1587, 1591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15670, 5512, 1373, 1096, 387, 5534, 5549, 411, 414, {5561, 5569, 5583, 5596, 5609, 5622, 5634}, {4194, 5642, 5646, 5650, 5654, 5658, 5662}, {5667, 5675, 5685, 943, 5692, 5697, 5703, 4269, 5709, 5718, 5726, 5735}, {1551, 5744, 1559, 5748, 3143, 1567, 1571, 4319, 4323, 5752, 1587, 5756, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {6936, 6964, 1087, 378, 6981, 393, 74, 6987, 6990, {6993, 7001, 7009, 1407, 1414, 1422, 7016}, {7024, 7028, 2835, 7032, 2841, 7035, 7038}, {5229, 5237, 3132, 1488, 1494, 1498, 1503, 7042, 1515, 1525, 1533, 1542}, {1551, 1555, 1559, 1563, 1494, 1567, 1571, 1575, 1579, 1583, 1587, 1591, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15703, 8974, 1619, 378, 387, 393, 8988, 1630, 1636, {1643, 1651, 1658, 1667, 1676, 1687, 1695}, {1703, 1706, 1709, 1712, 1715, 1718, 1721}, {15728, 1731, 1739, 1745, 1751, 1755, 1760, 1765, 1772, 1782, 1790, 1799}, {15736, 1812, 15741, 1820, 1751, 1824, 1828, 1832, 1836, 1840, 1844, 1848, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15746, 813, 15660, 1877, 56, 393, 74, 411, 414, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15670, 5512, 825, 1096, 1104, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 2612, 378, 387, 393, 74, 411, 414, {3028, 3037, 3043, 3049, 3058, 3064, 3073}, {3080, 3085, 3090, 3095, 3100, 3105, 3110}, {3115, 3123, 3132, 3137, 3143, 3147, 3152, 3160, 3166, 3176, 989, 3184}, {3194, 3200, 3132, 3207, 3143, 3147, 3212, 3160, 3218, 1036, 1041, 3224, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1595, 1074, 1619, 378, 387, 393, 1109, 1630, 1636, {1643, 1651, 1658, 1667, 1676, 1687, 1695}, {1703, 1706, 1709, 1712, 1715, 1718, 1721}, {1724, 1731, 1739, 1745, 1751, 1755, 1760, 1765, 1772, 1782, 1790, 1799}, {1808, 1812, 1816, 1820, 1751, 1824, 1828, 1832, 1836, 1840, 1844, 1848, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {2356, 15768, 825, 1877, 56, 393, 2418, 411, 414, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 1619, 378, 387, 393, 74, 411, 414, {3028, 3037, 3043, 3049, 3058, 3064, 3073}, {3080, 3085, 3090, 3095, 3100, 3105, 3110}, {3115, 3123, 3132, 3137, 3143, 3147, 3152, 3160, 3166, 3176, 989, 3184}, {3194, 3200, 3132, 3207, 3143, 3147, 3212, 3160, 3218, 1036, 1041, 3224, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 1373, 1096, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15746, 813, 15660, 1877, 56, 393, 74, 15524, 15529, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 825, 378, 387, 393, 74, 411, 414, {3028, 3037, 3043, 3049, 3058, 3064, 3073}, {3080, 3085, 3090, 3095, 3100, 3105, 3110}, {3115, 3123, 3132, 3137, 3143, 3147, 3152, 3160, 3166, 3176, 989, 3184}, {3194, 3200, 3132, 3207, 3143, 3147, 3212, 3160, 3218, 1036, 1041, 3224, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 1373, 1096, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {790, 813, 825, 378, 387, 393, 74, 15524, 15529, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15489, 5512, 2592, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 1373, 1096, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {87, 98, 113, 130, 147, 160, 173}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11696, 349, 4389, 2691, 56, 393, 403, 411, 414, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {87, 98, 113, 130, 147, 160, 173}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15781, 5512, 825, 2691, 1104, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {87, 98, 113, 130, 147, 160, 173}, {15813, 15837, 15846, 15855, 15866, 15875, 15888, 15897, 15902, 15913, 15935, 15959}, {15813, 15837, 15846, 15855, 15866, 15875, 15888, 15897, 15902, 15913, 15935, 15959, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {87, 98, 113, 130, 147, 160, 173}, {15813, 15837, 15846, 15855, 15981, 15875, 15888, 15897, 15902, 15913, 15935, 15959}, {15813, 15837, 15846, 15855, 15981, 15875, 15888, 15897, 15902, 15913, 15935, 15959, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15781, 5512, 825, 2691, 387, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {87, 98, 113, 130, 147, 160, 173}, {15813, 15837, 15846, 15855, 15866, 15875, 15888, 15897, 15902, 15913, 15935, 15959}, {15813, 15837, 15846, 15855, 15866, 15875, 15888, 15897, 15902, 15913, 15935, 15959, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {11696, 349, 2401, 1877, 56, 393, 403, 411, 414, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15781, 5512, 825, 1096, 1104, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {2356, 15768, 2401, 1877, 56, 393, 2418, 411, 414, {2425, 2432, 2439, 2447, 2457, 2466, 2473}, {2482, 2486, 2490, 2494, 2498, 2502, 2506}, {2510, 2518, 2527, 1745, 2533, 2537, 2542, 1765, 1772, 2547, 1790, 2555}, {1808, 1812, 2564, 1820, 2533, 1824, 1828, 1832, 1836, 2568, 1844, 2572, 322}, 0, 0, 323, 325, {2401,2576,2576,2583,2592,2603,2612,2623},{2381,2633,2647,2667},{2410,2682,1104,387},{1877,2691,1096,378}},
+ {15781, 5512, 1373, 1096, 1104, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {15468, 15471, 15474, 15477, 15480, 15483, 15486}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {1, 24, 825, 2691, 56, 63, 74, 81, 84, {87, 98, 113, 130, 147, 160, 173}, {87, 98, 113, 130, 147, 160, 173}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309}, {184, 195, 208, 217, 228, 237, 248, 259, 270, 283, 296, 309, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15990, 16026, 825, 2691, 12684, 5534, 16049, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}},
+ {15489, 5512, 825, 2691, 12684, 5534, 5549, 15524, 15529, {5561, 15534, 15540, 15547, 15558, 15565, 5634}, {4194, 4198, 1559, 15573, 15578, 15582, 5662}, {15586, 15592, 4235, 943, 15600, 15605, 15611, 4269, 15617, 981, 15628, 15638}, {15648, 1555, 1559, 5748, 15652, 1567, 1571, 4319, 1579, 15656, 1587, 4331, 322}, 0, 0, 323, 325, {0},{0},{0},{0}}
+};
+
+
+static const NumberFormatEntry number_format_entries [] = {
+ {16062, 16065, 16062, 16065, 16062, 16065, 16068, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 1, 0, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16107, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16121, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16125, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 12, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 1, 1, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16128, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 0, 0, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 0, 0, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16153, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16157, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16160, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16164, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 0, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16166, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 0, 0, 1, 0, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 0, 0, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16170, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16174, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16178, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16182, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 5, 1, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16186, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 9701, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16189, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16125, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16193, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16197, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16200, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 0, 1, 1, 1, 0, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16203, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 0, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 1, 0, 1, 1, 1, 0, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16211, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16125, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16215, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16218, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {2, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16221, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 0, 3, 2, 2, 1, 0, 2, 2, {5, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16225, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 0, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 0, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16228, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 0, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 9166, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16125, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 12, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16232, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16239, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16243, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16250, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16257, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16232, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16232, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16232, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}, {2, 2, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16265, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 3, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16275, 16115, 16275, 16115, 16275, 16277, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16282, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {4, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16128, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16275, 16115, 16275, 16115, 16275, 16277, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16285, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 9, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16128, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {4, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16104, 16102, 16104, 16102, 16104, 16128, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16295, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 3, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16128, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16305, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16275, 16115, 16275, 16115, 16275, 16307, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 2, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16312, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16128, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {4, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16322, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16117, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 8, 3, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16326, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16117, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16336, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16339, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 1, 0, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 9166, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16349, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16353, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16363, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 12, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16366, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 1, 0, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16128, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16376, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 1, 0, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16386, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16389, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 3, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16128, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16399, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16409, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 1, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16412, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16416, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 3, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16426, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16128, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 2, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16430, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16440, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 2, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16444, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 11, 2, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16454, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 12, 2, 1, 1, 1, 0, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16062, 16065, 16062, 16065, 16062, 16065, 16457, 16078, 16081, 16085, 16089, 16094, 16098, 16100, 1, 0, 1, 1, 3, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16102, 16115, 16102, 16115, 16102, 16115, 16467, 16113, 16081, 16085, 16089, 16094, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16470, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16474, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16477, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}},
+ {16115, 16102, 16115, 16102, 16115, 16102, 16128, 16113, 16130, 16085, 16134, 16144, 16098, 16100, 0, 0, 1, 1, 1, 2, 2, 2, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}, {3, -1, -1, -1, -1}}
+};
+
+
+static const CultureInfoEntry culture_entries [] = {
+ {0x0001, 0x007F, 0x0401, 16480, 16483, 16483, 16483, 16490, 16505, 16509, 16480, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0002, 0x007F, 0x0402, 16513, 16516, 16516, 16516, 16526, 16545, 16549, 16513, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0003, 0x007F, 0x0403, 16553, 16556, 16556, 16556, 16564, 16572, 16576, 16553, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0005, 0x007F, 0x0405, 16580, 16583, 16583, 16583, 16589, 16599, 16603, 16580, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0006, 0x007F, 0x0406, 16607, 16610, 16610, 16610, 16617, 16623, 16627, 16607, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0007, 0x007F, 0x0407, 16631, 16634, 16634, 16634, 16641, 16649, 16653, 16631, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0008, 0x007F, 0x0408, 16657, 16660, 16660, 16660, 16666, 16683, 16687, 16657, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0009, 0x007F, 0x0409, 16691, 16694, 16694, 16694, 16694, 16702, 16706, 16691, {0, 0, 0, 0, 0}, -1, -1},
+ {0x000A, 0x007F, 0x0C0A, 16710, 16713, 16713, 16713, 16721, 16730, 16734, 16710, {0, 0, 0, 0, 0}, -1, -1},
+ {0x000B, 0x007F, 0x040B, 16738, 16741, 16741, 16741, 16749, 16755, 16759, 16738, {0, 0, 0, 0, 0}, -1, -1},
+ {0x000C, 0x007F, 0x040C, 7035, 16763, 16763, 16763, 16770, 16780, 16784, 7035, {0, 0, 0, 0, 0}, -1, -1},
+ {0x000D, 0x007F, 0x040D, 16788, 16791, 16791, 16791, 16798, 16809, 16813, 16788, {0, 0, 0, 0, 0}, -1, -1},
+ {0x000E, 0x007F, 0x040E, 16817, 16820, 16820, 16820, 16830, 16837, 16841, 16817, {0, 0, 0, 0, 0}, -1, -1},
+ {0x000F, 0x007F, 0x040F, 16845, 16848, 16848, 16848, 16858, 16868, 16872, 16845, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0010, 0x007F, 0x0410, 16876, 16879, 16879, 16879, 16887, 16896, 16900, 16876, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0011, 0x007F, 0x0411, 16904, 16907, 16907, 16907, 16916, 16926, 16930, 16904, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0012, 0x007F, 0x0412, 16934, 16937, 16937, 16937, 16944, 16954, 16958, 16934, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0013, 0x007F, 0x0413, 16962, 16965, 16965, 16965, 16971, 16982, 16986, 16962, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0015, 0x007F, 0x0415, 16990, 16993, 16993, 16993, 17000, 17007, 17011, 16990, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0016, 0x007F, 0x0416, 17015, 17018, 17018, 17018, 17029, 17040, 17044, 17015, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0018, 0x007F, 0x0418, 17048, 17051, 17051, 17051, 17060, 17069, 17073, 17048, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0019, 0x007F, 0x0419, 17077, 17080, 17080, 17080, 17088, 17103, 17107, 17077, {0, 0, 0, 0, 0}, -1, -1},
+ {0x001A, 0x007F, 0x041A, 17111, 17114, 17114, 17114, 17123, 17132, 17136, 17111, {0, 0, 0, 0, 0}, -1, -1},
+ {0x001B, 0x007F, 0x041B, 17140, 17143, 17143, 17143, 17150, 17161, 17165, 17140, {0, 0, 0, 0, 0}, -1, -1},
+ {0x001C, 0x007F, 0x041C, 17169, 17172, 17172, 17172, 17181, 17188, 17192, 17169, {0, 0, 0, 0, 0}, -1, -1},
+ {0x001D, 0x007F, 0x041D, 17196, 17199, 17199, 17199, 17207, 17215, 17219, 17196, {0, 0, 0, 0, 0}, -1, -1},
+ {0x001E, 0x007F, 0x041E, 17223, 17226, 17226, 17226, 17231, 17241, 17245, 17223, {0, 0, 0, 0, 0}, -1, -1},
+ {0x001F, 0x007F, 0x041F, 17249, 17252, 17252, 17252, 17260, 17269, 17273, 17249, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0021, 0x007F, 0x0421, 17277, 17280, 17280, 17280, 17291, 17308, 17312, 17277, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0022, 0x007F, 0x0422, 17316, 17319, 17319, 17319, 17329, 17350, 17354, 17316, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0023, 0x007F, 0x0423, 17358, 17361, 17361, 17361, 17372, 17391, 17395, 17358, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0024, 0x007F, 0x0424, 17399, 17402, 17402, 17402, 17412, 17426, 17430, 17399, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0025, 0x007F, 0x0425, 17434, 17437, 17437, 17437, 17446, 17452, 17456, 17434, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0026, 0x007F, 0x0426, 17460, 17463, 17463, 17463, 17471, 17481, 17485, 17460, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0027, 0x007F, 0x0427, 17489, 17492, 17492, 17492, 17503, 17513, 17517, 17489, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0029, 0x007F, 0x0429, 17521, 17524, 17524, 17524, 17532, 17543, 17547, 17521, {0, 0, 0, 0, 0}, -1, -1},
+ {0x002A, 0x007F, 0x042A, 17551, 17554, 17554, 17554, 17565, 17580, 15582, 17551, {0, 0, 0, 0, 0}, -1, -1},
+ {0x002B, 0x007F, 0x042B, 17584, 17587, 17587, 17587, 17596, 17611, 17615, 17584, {0, 0, 0, 0, 0}, -1, -1},
+ {0x002D, 0x007F, 0x042D, 17619, 17622, 17622, 17622, 17629, 17637, 17641, 17619, {0, 0, 0, 0, 0}, -1, -1},
+ {0x002F, 0x007F, 0x042F, 17645, 17648, 17648, 17648, 17659, 17680, 17684, 17645, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0036, 0x007F, 0x0436, 17688, 17691, 17691, 17691, 17701, 17712, 17716, 17688, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0038, 0x007F, 0x0438, 17720, 17723, 17723, 17723, 17731, 17741, 17745, 17720, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0039, 0x007F, 0x0439, 17749, 17752, 17752, 17752, 17758, 17774, 17778, 17749, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0041, 0x007F, 0x0441, 17782, 17785, 17785, 17785, 17793, 17803, 17807, 17782, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0047, 0x007F, 0x0447, 17811, 17814, 17814, 17814, 17823, 17845, 17849, 17811, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0049, 0x007F, 0x0449, 17853, 17856, 17856, 17856, 17862, 17878, 17882, 17853, {0, 0, 0, 0, 0}, -1, -1},
+ {0x004A, 0x007F, 0x044A, 17886, 17889, 17889, 17889, 17896, 17915, 17919, 17886, {0, 0, 0, 0, 0}, -1, -1},
+ {0x004B, 0x007F, 0x044B, 17923, 17926, 17926, 17926, 17934, 17950, 17954, 17923, {0, 0, 0, 0, 0}, -1, -1},
+ {0x004E, 0x007F, 0x044E, 17958, 17961, 17961, 17961, 17969, 17985, 1559, 17958, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0056, 0x007F, 0x0456, 17989, 17992, 17992, 17992, 18001, 18008, 18012, 17989, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0057, 0x007F, 0x0457, 18016, 18020, 18020, 18020, 18028, 18047, 18016, 17749, {0, 0, 0, 0, 0}, -1, -1},
+ {0x0401, 0x0001, 0x0401, 18051, 18057, 18057, 18057, 18079, 16505, 16509, 16480, {16777216, 0, 0, 0, 0}, 0, 0},
+ {0x0402, 0x0002, 0x0402, 18128, 18134, 18134, 18134, 18155, 16545, 16549, 16513, {0, 0, 0, 0, 0}, 1, 1},
+ {0x0403, 0x0003, 0x0403, 18193, 18199, 18199, 18199, 18215, 16572, 16576, 16553, {0, 0, 0, 0, 0}, 2, 2},
+ {0x0405, 0x0005, 0x0405, 18233, 18239, 18239, 18239, 18262, 16599, 16603, 16580, {0, 0, 0, 0, 0}, 3, 3},
+ {0x0406, 0x0006, 0x0406, 18292, 18298, 18298, 18298, 18315, 16623, 16627, 16607, {0, 0, 0, 0, 0}, 4, 4},
+ {0x0407, 0x0007, 0x0407, 18331, 18337, 18337, 18337, 18354, 16649, 16653, 16631, {0, 0, 0, 0, 0}, 5, 5},
+ {0x0408, 0x0008, 0x0408, 18376, 18382, 18382, 18382, 18397, 16683, 16687, 16657, {0, 0, 0, 0, 0}, 6, 6},
+ {0x0409, 0x0009, 0x0409, 18429, 18435, 18435, 18435, 18435, 16702, 16706, 16691, {0, 0, 0, 0, 0}, 7, 7},
+ {0x040B, 0x000B, 0x040B, 18459, 18465, 18465, 18465, 18483, 16755, 16759, 16738, {0, 0, 0, 0, 0}, 8, 8},
+ {0x040C, 0x000C, 0x040C, 18497, 18503, 18503, 18503, 18519, 16780, 16784, 7035, {0, 0, 0, 0, 0}, 9, 9},
+ {0x040D, 0x000D, 0x040D, 18538, 18544, 18544, 18544, 18560, 16809, 16813, 16788, {0, 0, 0, 0, 0}, 10, 10},
+ {0x040E, 0x000E, 0x040E, 18584, 18590, 18590, 18590, 18610, 16837, 16841, 16817, {0, 0, 0, 0, 0}, 11, 11},
+ {0x040F, 0x000F, 0x040F, 18633, 18639, 18639, 18639, 18659, 16868, 16872, 16845, {0, 0, 0, 0, 0}, 12, 12},
+ {0x0410, 0x0010, 0x0410, 18679, 18685, 18685, 18685, 18701, 16896, 16900, 16876, {0, 0, 0, 0, 0}, 13, 13},
+ {0x0411, 0x0011, 0x0411, 18719, 18725, 18725, 18725, 18742, 16926, 16930, 16904, {0, 0, 0, 0, 0}, 14, 14},
+ {0x0412, 0x0012, 0x0412, 18761, 18767, 18767, 18767, 18788, 16954, 16958, 16934, {0, 0, 0, 0, 0}, 15, 15},
+ {0x0413, 0x0013, 0x0413, 18813, 18819, 18819, 18819, 18839, 16982, 16986, 16962, {0, 0, 0, 0, 0}, 16, 16},
+ {0x0415, 0x0015, 0x0415, 18862, 18868, 18868, 18868, 18884, 17007, 17011, 16990, {0, 0, 0, 0, 0}, 17, 17},
+ {0x0416, 0x0016, 0x0416, 18900, 18906, 18906, 18906, 18926, 17040, 17044, 17015, {0, 0, 0, 0, 0}, 18, 18},
+ {0x0418, 0x0018, 0x0418, 18946, 18952, 18952, 18952, 18971, 17069, 17073, 17048, {0, 0, 0, 0, 0}, 19, 19},
+ {0x0419, 0x0019, 0x0419, 18991, 18997, 18997, 18997, 19014, 17103, 17107, 17077, {0, 0, 0, 0, 0}, 20, 20},
+ {0x041A, 0x001A, 0x041A, 19044, 19050, 19050, 19050, 19069, 17132, 17136, 17111, {0, 0, 0, 0, 0}, 21, 21},
+ {0x041B, 0x001B, 0x041B, 19089, 19095, 19095, 19095, 19113, 17161, 17165, 17140, {0, 0, 0, 0, 0}, 22, 22},
+ {0x041C, 0x001C, 0x041C, 19147, 19153, 19153, 19153, 19172, 17188, 17192, 17169, {0, 0, 0, 0, 0}, 23, 23},
+ {0x041D, 0x001D, 0x041D, 19192, 19198, 19198, 19198, 19215, 17215, 17219, 17196, {0, 0, 0, 0, 0}, 24, 24},
+ {0x041E, 0x001E, 0x041E, 19233, 19239, 19239, 19239, 19255, 17241, 17245, 17223, {0, 0, 0, 0, 0}, 25, 25},
+ {0x041F, 0x001F, 0x041F, 19295, 19301, 19301, 19301, 19318, 17269, 17273, 17249, {0, 0, 0, 0, 0}, 26, 26},
+ {0x0421, 0x0021, 0x0421, 19338, 19344, 19344, 19344, 19367, 17308, 17312, 17277, {0, 0, 0, 0, 0}, 27, 27},
+ {0x0422, 0x0022, 0x0422, 19396, 19402, 19402, 19402, 19422, 17350, 17354, 17316, {0, 0, 0, 0, 0}, 28, 28},
+ {0x0423, 0x0023, 0x0423, 19460, 19466, 19466, 19466, 19487, 17391, 17395, 17358, {0, 0, 0, 0, 0}, 29, 29},
+ {0x0424, 0x0024, 0x0424, 19525, 19531, 19531, 19531, 19552, 17426, 17430, 17399, {0, 0, 0, 0, 0}, 30, 30},
+ {0x0425, 0x0025, 0x0425, 19578, 19584, 19584, 19584, 19603, 17452, 17456, 17434, {0, 0, 0, 0, 0}, 31, 31},
+ {0x0426, 0x0026, 0x0426, 19617, 19623, 19623, 19623, 19640, 17481, 17485, 17460, {0, 0, 0, 0, 0}, 32, 32},
+ {0x0427, 0x0027, 0x0427, 19660, 19666, 19666, 19666, 19689, 17513, 17517, 17489, {0, 0, 0, 0, 0}, 33, 33},
+ {0x0429, 0x0029, 0x0429, 19709, 19715, 19715, 19715, 19730, 17543, 17547, 17521, {0, 0, 0, 0, 0}, 34, 34},
+ {0x042A, 0x002A, 0x042A, 19754, 19760, 19760, 19760, 19781, 17580, 15582, 17551, {0, 0, 0, 0, 0}, 35, 35},
+ {0x042B, 0x002B, 0x042B, 19809, 19815, 19815, 19815, 19834, 17611, 17615, 17584, {0, 0, 0, 0, 0}, 36, 36},
+ {0x042B, 0x002B, 0x042B, 19809, 19815, 19815, 19815, 19834, 17611, 17615, 17584, {0, 0, 0, 0, 0}, 37, 37},
+ {0x042D, 0x002D, 0x042D, 19899, 19905, 19905, 19905, 19920, 17637, 17641, 17619, {0, 0, 0, 0, 0}, 38, 38},
+ {0x042F, 0x002F, 0x042F, 19939, 19945, 19945, 19945, 19968, 17680, 17684, 17645, {0, 0, 0, 0, 0}, 39, 39},
+ {0x0436, 0x0036, 0x0436, 20012, 20018, 20018, 20018, 20043, 17712, 17716, 17688, {0, 0, 0, 0, 0}, 40, 40},
+ {0x0438, 0x0038, 0x0438, 20068, 20074, 20074, 20074, 20098, 17741, 17745, 17720, {0, 0, 0, 0, 0}, 41, 41},
+ {0x0439, 0x0039, 0x0439, 20119, 20125, 20125, 20125, 20139, 17774, 17778, 17749, {0, 0, 0, 0, 0}, 42, 42},
+ {0x0441, 0x0041, 0x0441, 20170, 20176, 20176, 20176, 20192, 17803, 17807, 17782, {0, 0, 0, 0, 0}, 43, 43},
+ {0x0447, 0x0047, 0x0447, 20210, 20216, 20216, 20216, 20233, 17845, 17849, 17811, {0, 0, 0, 0, 0}, 44, 44},
+ {0x0449, 0x0049, 0x0449, 20270, 20276, 20276, 20276, 20290, 17878, 17882, 17853, {0, 0, 0, 0, 0}, 45, 45},
+ {0x044A, 0x004A, 0x044A, 20330, 20336, 20336, 20336, 20351, 17915, 17919, 17886, {0, 0, 0, 0, 0}, 46, 46},
+ {0x044B, 0x004B, 0x044B, 20398, 20404, 20404, 20404, 20420, 17950, 17954, 17923, {0, 0, 0, 0, 0}, 47, 47},
+ {0x044E, 0x004E, 0x044E, 20451, 20457, 20457, 20457, 20473, 17985, 1559, 17958, {0, 0, 0, 0, 0}, 48, 48},
+ {0x0456, 0x0056, 0x0456, 20504, 20510, 20510, 20510, 20527, 18008, 18012, 17989, {0, 0, 0, 0, 0}, 49, 49},
+ {0x0457, 0x0057, 0x0457, 20544, 20551, 20551, 20551, 20567, 18047, 18016, 18016, {0, 0, 0, 0, 0}, 50, 50},
+ {0x0801, 0x0001, 0x0801, 20601, 20607, 20607, 20607, 20621, 20651, 16509, 16480, {2, 1, 0, 0, 0}, 51, 51},
+ {0x0807, 0x0007, 0x0807, 20655, 20661, 20661, 20661, 20682, 20700, 16653, 16631, {0, 0, 0, 0, 0}, 52, 52},
+ {0x0809, 0x0009, 0x0809, 20704, 20710, 20710, 20710, 20710, 20735, 16706, 16691, {0, 0, 0, 0, 0}, 53, 53},
+ {0x080A, 0x000A, 0x080A, 20739, 20745, 20745, 20745, 20762, 20781, 16734, 16710, {0, 0, 0, 0, 0}, 54, 54},
+ {0x080C, 0x000C, 0x080C, 20785, 20791, 20791, 20791, 20808, 20829, 16784, 7035, {0, 0, 0, 0, 0}, 55, 55},
+ {0x0810, 0x0010, 0x0810, 20833, 20839, 20839, 20839, 20861, 20881, 16900, 16876, {0, 0, 0, 0, 0}, 56, 56},
+ {0x0813, 0x0013, 0x0813, 20885, 20891, 20891, 20891, 20907, 20928, 16986, 16962, {0, 0, 0, 0, 0}, 57, 57},
+ {0x0816, 0x0016, 0x0816, 20932, 20938, 20938, 20938, 20960, 20982, 17044, 17015, {0, 0, 0, 0, 0}, 58, 58},
+ {0x081D, 0x001D, 0x081D, 20986, 20992, 20992, 20992, 21010, 21028, 17219, 17196, {0, 0, 0, 0, 0}, 59, 59},
+ {0x0C01, 0x0001, 0x0C01, 21032, 21038, 21038, 21038, 21053, 21077, 16509, 16480, {16777216, 0, 0, 0, 0}, 60, 60},
+ {0x0C07, 0x0007, 0x0C07, 21081, 21087, 21087, 21087, 21104, 21126, 16653, 16631, {0, 0, 0, 0, 0}, 61, 61},
+ {0x0C09, 0x0009, 0x0C09, 21130, 21136, 21136, 21136, 21136, 21156, 16706, 16691, {0, 0, 0, 0, 0}, 62, 62},
+ {0x0C0A, 0x000A, 0x0C0A, 21160, 21166, 21166, 21166, 21182, 21201, 16734, 16710, {0, 0, 0, 0, 0}, 63, 63},
+ {0x0C0C, 0x000C, 0x0C0C, 21205, 21211, 21211, 21211, 21227, 21246, 16784, 7035, {0, 0, 0, 0, 0}, 64, 64},
+ {0x1001, 0x0001, 0x1001, 21250, 21256, 21256, 21256, 21271, 21299, 16509, 16480, {16777216, 0, 0, 0, 0}, 65, 65},
+ {0x1007, 0x0007, 0x1007, 21303, 21309, 21309, 21309, 21329, 21349, 16653, 16631, {0, 0, 0, 0, 0}, 66, 66},
+ {0x1009, 0x0009, 0x1009, 21353, 21359, 21359, 21359, 21359, 21376, 16706, 16691, {0, 0, 0, 0, 0}, 67, 67},
+ {0x100A, 0x000A, 0x100A, 21380, 21386, 21386, 21386, 21406, 21427, 16734, 16710, {0, 0, 0, 0, 0}, 68, 68},
+ {0x100C, 0x000C, 0x100C, 21431, 21437, 21437, 21437, 21458, 21477, 16784, 7035, {0, 0, 0, 0, 0}, 69, 69},
+ {0x1401, 0x0001, 0x1401, 21481, 21487, 21487, 21487, 21504, 21536, 16509, 16480, {16777216, 0, 0, 0, 0}, 70, 70},
+ {0x1409, 0x0009, 0x1409, 21540, 21546, 21546, 21546, 21546, 21568, 16706, 16691, {0, 0, 0, 0, 0}, 71, 71},
+ {0x140A, 0x000A, 0x140A, 21572, 21578, 21578, 21578, 21599, 21621, 16734, 16710, {0, 0, 0, 0, 0}, 72, 72},
+ {0x140C, 0x000C, 0x140C, 21625, 21631, 21631, 21631, 21651, 21674, 16784, 7035, {0, 0, 0, 0, 0}, 73, 73},
+ {0x1801, 0x0001, 0x1801, 21678, 21684, 21684, 21684, 21701, 21731, 16509, 16480, {16777216, 0, 0, 0, 0}, 74, 74},
+ {0x1809, 0x0009, 0x1809, 21735, 21741, 21741, 21741, 21741, 21759, 16706, 16691, {0, 0, 0, 0, 0}, 75, 75},
+ {0x180A, 0x000A, 0x180A, 21763, 21769, 21769, 21769, 21786, 21805, 16734, 16710, {0, 0, 0, 0, 0}, 76, 76},
+ {0x1C01, 0x0001, 0x1C01, 21809, 21815, 21815, 21815, 21832, 21858, 16509, 16480, {16777216, 0, 0, 0, 0}, 77, 77},
+ {0x1C09, 0x0009, 0x1C09, 21862, 21868, 21868, 21868, 21868, 21891, 16706, 16691, {0, 0, 0, 0, 0}, 78, 78},
+ {0x1C0A, 0x000A, 0x1C0A, 21895, 21901, 21901, 21901, 21930, 21963, 16734, 16710, {0, 0, 0, 0, 0}, 79, 79},
+ {0x2001, 0x0001, 0x2001, 21967, 21973, 21973, 21973, 21987, 22013, 16509, 16480, {16777216, 0, 0, 0, 0}, 80, 80},
+ {0x200A, 0x000A, 0x200A, 22017, 22023, 22023, 22023, 22043, 22064, 16734, 16710, {0, 0, 0, 0, 0}, 81, 81},
+ {0x2401, 0x0001, 0x2401, 22068, 22074, 22074, 22074, 22089, 22117, 16509, 16480, {16777216, 0, 0, 0, 0}, 82, 82},
+ {0x240A, 0x000A, 0x240A, 22121, 22127, 22127, 22127, 22146, 22166, 16734, 16710, {0, 0, 0, 0, 0}, 83, 83},
+ {0x2801, 0x0001, 0x2801, 22170, 22176, 22176, 22176, 22191, 22219, 16509, 16480, {16777216, 0, 0, 0, 0}, 84, 84},
+ {0x280A, 0x000A, 0x280A, 22223, 22229, 22229, 22229, 22244, 22261, 16734, 16710, {0, 0, 0, 0, 0}, 85, 85},
+ {0x2C01, 0x0001, 0x2C01, 22265, 22271, 22271, 22271, 22287, 22317, 16509, 16480, {16777216, 0, 0, 0, 0}, 86, 86},
+ {0x2C0A, 0x000A, 0x2C0A, 22321, 22327, 22327, 22327, 22347, 22368, 16734, 16710, {0, 0, 0, 0, 0}, 87, 87},
+ {0x3001, 0x0001, 0x3001, 22372, 22378, 22378, 22378, 22395, 22423, 16509, 16480, {16777216, 0, 0, 0, 0}, 88, 88},
+ {0x3009, 0x0009, 0x3009, 22427, 22433, 22433, 22433, 22433, 22452, 16706, 16691, {0, 0, 0, 0, 0}, 89, 89},
+ {0x300A, 0x000A, 0x300A, 22456, 22462, 22462, 22462, 22480, 22499, 16734, 16710, {0, 0, 0, 0, 0}, 90, 90},
+ {0x3401, 0x0001, 0x3401, 22503, 22509, 22509, 22509, 22525, 22555, 16509, 16480, {16777216, 0, 0, 0, 0}, 91, 91},
+ {0x3409, 0x0009, 0x3409, 22559, 22565, 22565, 22565, 22565, 22587, 16706, 16691, {0, 0, 0, 0, 0}, 92, 92},
+ {0x340A, 0x000A, 0x340A, 22591, 22597, 22597, 22597, 22613, 22630, 16734, 16710, {0, 0, 0, 0, 0}, 93, 93},
+ {0x3801, 0x0001, 0x3801, 22634, 22640, 22640, 22640, 22670, 22734, 16509, 16480, {16777216, 0, 0, 0, 0}, 94, 94},
+ {0x380A, 0x000A, 0x380A, 22738, 22744, 22744, 22744, 22762, 22781, 16734, 16710, {0, 0, 0, 0, 0}, 95, 95},
+ {0x3C01, 0x0001, 0x3C01, 22785, 22791, 22791, 22791, 22808, 22840, 16509, 16480, {16777216, 0, 0, 0, 0}, 96, 96},
+ {0x3C0A, 0x000A, 0x3C0A, 22844, 22850, 22850, 22850, 22869, 22889, 16734, 16710, {0, 0, 0, 0, 0}, 97, 97},
+ {0x4001, 0x0001, 0x4001, 22893, 22899, 22899, 22899, 22914, 22938, 16509, 16480, {16777216, 0, 0, 0, 0}, 98, 98},
+ {0x400A, 0x000A, 0x400A, 22942, 22948, 22948, 22948, 22966, 22985, 16734, 16710, {0, 0, 0, 0, 0}, 99, 99},
+ {0x440A, 0x000A, 0x440A, 22989, 22995, 22995, 22995, 23017, 23040, 16734, 16710, {0, 0, 0, 0, 0}, 100, 100},
+ {0x480A, 0x000A, 0x480A, 23044, 23050, 23050, 23050, 23069, 23089, 16734, 16710, {0, 0, 0, 0, 0}, 101, 101},
+ {0x4C0A, 0x000A, 0x4C0A, 23093, 23099, 23099, 23099, 23119, 23140, 16734, 16710, {0, 0, 0, 0, 0}, 102, 102},
+ {0x500A, 0x000A, 0x500A, 23144, 23150, 23150, 23150, 23172, 23195, 16734, 16710, {0, 0, 0, 0, 0}, 103, 103}
+};
+
+
+static const CultureInfoNameEntry culture_name_entries [] = {
+ {17688, 40},
+ {23199, 91},
+ {16480, 0},
+ {23205, 145},
+ {23211, 147},
+ {23217, 121},
+ {23223, 111},
+ {23229, 102},
+ {23235, 137},
+ {23241, 142},
+ {23247, 139},
+ {23253, 116},
+ {23259, 125},
+ {23265, 131},
+ {23271, 149},
+ {23277, 51},
+ {23283, 135},
+ {23289, 128},
+ {23295, 133},
+ {17358, 30},
+ {23301, 80},
+ {16513, 1},
+ {23307, 52},
+ {16553, 2},
+ {23313, 53},
+ {16580, 3},
+ {23319, 54},
+ {16607, 4},
+ {23325, 55},
+ {16631, 5},
+ {23331, 112},
+ {23337, 103},
+ {23343, 56},
+ {23349, 117},
+ {16657, 6},
+ {23355, 57},
+ {16691, 7},
+ {23361, 113},
+ {23367, 118},
+ {23373, 104},
+ {23379, 126},
+ {23385, 122},
+ {23391, 143},
+ {23397, 58},
+ {23403, 129},
+ {23409, 140},
+ {16710, 8},
+ {23415, 138},
+ {23421, 150},
+ {23427, 144},
+ {23433, 134},
+ {23439, 123},
+ {23445, 130},
+ {23451, 141},
+ {23457, 114},
+ {23463, 119},
+ {23469, 152},
+ {23475, 105},
+ {23481, 153},
+ {23487, 127},
+ {23493, 136},
+ {23499, 154},
+ {23505, 148},
+ {23511, 151},
+ {23517, 146},
+ {23523, 132},
+ {17434, 32},
+ {23529, 82},
+ {17619, 38},
+ {23535, 89},
+ {17521, 35},
+ {23541, 85},
+ {16738, 9},
+ {23547, 59},
+ {17720, 41},
+ {23553, 92},
+ {7035, 10},
+ {23559, 106},
+ {23565, 115},
+ {23571, 120},
+ {23577, 60},
+ {23583, 124},
+ {17989, 49},
+ {23589, 100},
+ {17811, 44},
+ {23595, 95},
+ {16788, 11},
+ {23601, 61},
+ {17749, 42},
+ {23607, 93},
+ {17111, 22},
+ {23613, 72},
+ {16817, 12},
+ {23619, 62},
+ {17584, 37},
+ {23625, 87},
+ {23625, 88},
+ {17277, 28},
+ {23631, 78},
+ {16845, 13},
+ {23637, 63},
+ {16876, 14},
+ {23643, 107},
+ {23649, 64},
+ {16904, 15},
+ {23655, 65},
+ {17923, 47},
+ {23661, 98},
+ {16934, 16},
+ {23667, 66},
+ {18016, 50},
+ {23673, 101},
+ {17489, 34},
+ {23680, 84},
+ {17460, 33},
+ {23686, 83},
+ {17645, 39},
+ {23692, 90},
+ {17958, 48},
+ {23698, 99},
+ {16962, 17},
+ {23704, 108},
+ {23710, 67},
+ {16990, 18},
+ {23716, 68},
+ {17015, 19},
+ {23722, 69},
+ {23728, 109},
+ {17048, 20},
+ {23734, 70},
+ {17077, 21},
+ {23740, 71},
+ {17140, 23},
+ {23746, 73},
+ {17399, 31},
+ {23752, 81},
+ {17169, 24},
+ {23758, 74},
+ {17196, 25},
+ {23764, 110},
+ {23770, 75},
+ {17782, 43},
+ {23776, 94},
+ {17853, 45},
+ {23782, 96},
+ {17886, 46},
+ {23788, 97},
+ {17223, 26},
+ {23794, 76},
+ {17249, 27},
+ {23800, 77},
+ {17316, 29},
+ {23806, 79},
+ {17551, 36},
+ {23812, 86}
+};
+
+
+static const char locale_strings [] = {
+"\0"
+ "d MMMM, yyyy h:mm:ss t\0"
+ "d MMMM, yyyy\0"
+ "d/M/yyyy\0"
+ "h:mm:ss t\0"
+ "h:mm t\0"
+ "MMMM, yyyy\0"
+ "d MMMM\0"
+ "\xd8\xb5\0"
+ "\xd9\x85\0"
+ "\xd8\xa7\xd9\x84\xd8\xa3\xd8\xad\xd8\xaf\0"
+ "\xd8\xa7\xd9\x84\xd8\xa7\xd8\xab\xd9\x86\xd9\x8a\xd9\x86\0"
+ "\xd8\xa7\xd9\x84\xd8\xab\xd9\x84\xd8\xa7\xd8\xab\xd8\xa7\xd8\xa1\0"
+ "\xd8\xa7\xd9\x84\xd8\xa3\xd8\xb1\xd8\xa8\xd8\xb9\xd8\xa7\xd8\xa1\0"
+ "\xd8\xa7\xd9\x84\xd8\xae\xd9\x85\xd9\x8a\xd8\xb3\0"
+ "\xd8\xa7\xd9\x84\xd8\xac\xd9\x85\xd8\xb9\xd8\xa9\0"
+ "\xd8\xa7\xd9\x84\xd8\xb3\xd8\xa8\xd8\xaa\0"
+ "\xd9\x8a\xd9\x86\xd8\xa7\xd9\x8a\xd8\xb1\0"
+ "\xd9\x81\xd8\xa8\xd8\xb1\xd8\xa7\xd9\x8a\xd8\xb1\0"
+ "\xd9\x85\xd8\xa7\xd8\xb1\xd8\xb3\0"
+ "\xd8\xa3\xd8\xa8\xd8\xb1\xd9\x8a\xd9\x84\0"
+ "\xd9\x85\xd8\xa7\xd9\x8a\xd9\x88\0"
+ "\xd9\x8a\xd9\x88\xd9\x86\xd9\x8a\xd9\x88\0"
+ "\xd9\x8a\xd9\x88\xd9\x84\xd9\x8a\xd9\x88\0"
+ "\xd8\xa3\xd8\xba\xd8\xb3\xd8\xb7\xd8\xb3\0"
+ "\xd8\xb3\xd8\xa8\xd8\xaa\xd9\x85\xd8\xa8\xd8\xb1\0"
+ "\xd8\xa3\xd9\x83\xd8\xaa\xd9\x88\xd8\xa8\xd8\xb1\0"
+ "\xd9\x86\xd9\x88\xd9\x81\xd9\x85\xd8\xa8\xd8\xb1\0"
+ "\xd8\xaf\xd9\x8a\xd8\xb3\xd9\x85\xd8\xa8\xd8\xb1\0"
+ "\0"
+ "/\0"
+ ":\0"
+ "dd MMMM yyyy HH:mm:ss\0"
+ "dd MMMM yyyy\0"
+ "dd.M.yyyy '\xd0\xb3.'\0"
+ "HH:mm:ss\0"
+ "HH:mm\0"
+ "MMMM yyyy\0"
+ "dd MMMM\0"
+ "AM\0"
+ "PM\0"
+ "\xd0\xbd\xd0\xb5\xd0\xb4\xd0\xb5\xd0\xbb\xd1\x8f\0"
+ "\xd0\xbf\xd0\xbe\xd0\xbd\xd0\xb5\xd0\xb4\xd0\xb5\xd0\xbb\xd0\xbd\xd0\xb8\xd0\xba\0"
+ "\xd0\xb2\xd1\x82\xd0\xbe\xd1\x80\xd0\xbd\xd0\xb8\xd0\xba\0"
+ "\xd1\x81\xd1\x80\xd1\x8f\xd0\xb4\xd0\xb0\0"
+ "\xd1\x87\xd0\xb5\xd1\x82\xd0\xb2\xd1\x8a\xd1\x80\xd1\x82\xd1\x8a\xd0\xba\0"
+ "\xd0\xbf\xd0\xb5\xd1\x82\xd1\x8a\xd0\xba\0"
+ "\xd1\x81\xd1\x8a\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0\0"
+ "\xd0\xbd\xd0\xb5\xd0\xb4.\0"
+ "\xd0\xbf\xd0\xbe\xd0\xbd.\0"
+ "\xd0\xb2\xd1\x82.\0"
+ "\xd1\x81\xd1\x80.\0"
+ "\xd1\x87\xd0\xb5\xd1\x82\xd0\xb2.\0"
+ "\xd0\xbf\xd0\xb5\xd1\x82.\0"
+ "\xd1\x81\xd1\x8a\xd0\xb1.\0"
+ "\xd1\x8f\xd0\xbd\xd1\x83\xd0\xb0\xd1\x80\xd0\xb8\0"
+ "\xd1\x84\xd0\xb5\xd0\xb2\xd1\x80\xd1\x83\xd0\xb0\xd1\x80\xd0\xb8\0"
+ "\xd0\xbc\xd0\xb0\xd1\x80\xd1\x82\0"
+ "\xd0\xb0\xd0\xbf\xd1\x80\xd0\xb8\xd0\xbb\0"
+ "\xd0\xbc\xd0\xb0\xd0\xb9\0"
+ "\xd1\x8e\xd0\xbd\xd0\xb8\0"
+ "\xd1\x8e\xd0\xbb\xd0\xb8\0"
+ "\xd0\xb0\xd0\xb2\xd0\xb3\xd1\x83\xd1\x81\xd1\x82\0"
+ "\xd1\x81\xd0\xb5\xd0\xbf\xd1\x82\xd0\xb5\xd0\xbc\xd0\xb2\xd1\x80\xd0\xb8\0"
+ "\xd0\xbe\xd0\xba\xd1\x82\xd0\xbe\xd0\xbc\xd0\xb2\xd1\x80\xd0\xb8\0"
+ "\xd0\xbd\xd0\xbe\xd0\xb5\xd0\xbc\xd0\xb2\xd1\x80\xd0\xb8\0"
+ "\xd0\xb4\xd0\xb5\xd0\xba\xd0\xb5\xd0\xbc\xd0\xb2\xd1\x80\xd0\xb8\0"
+ "\xd1\x8f\xd0\xbd.\0"
+ "\xd1\x84\xd0\xb5\xd0\xb2.\0"
+ "\xd0\xb0\xd0\xbf\xd1\x80.\0"
+ "\xd0\xb0\xd0\xb2\xd0\xb3.\0"
+ "\xd1\x81\xd0\xb5\xd0\xbf.\0"
+ "\xd0\xbe\xd0\xba\xd1\x82.\0"
+ "\xd0\xbd\xd0\xbe\xd0\xb5\xd0\xbc.\0"
+ "\xd0\xb4\xd0\xb5\xd0\xba.\0"
+ "d MMMM yyyy HH:mm:ss z\0"
+ "d MMMM yyyy\0"
+ "dd/MM/yyyy\0"
+ "diumenge\0"
+ "dilluns\0"
+ "dimarts\0"
+ "dimecres\0"
+ "dijous\0"
+ "divendres\0"
+ "dissabte\0"
+ "dg.\0"
+ "dl.\0"
+ "dt.\0"
+ "dc.\0"
+ "dj.\0"
+ "dv.\0"
+ "ds.\0"
+ "gener\0"
+ "febrer\0"
+ "mar\xc3\xa7\0"
+ "abril\0"
+ "maig\0"
+ "juny\0"
+ "juliol\0"
+ "agost\0"
+ "setembre\0"
+ "octubre\0"
+ "novembre\0"
+ "desembre\0"
+ "gen.\0"
+ "feb.\0"
+ "abr.\0"
+ "jul.\0"
+ "ag.\0"
+ "set.\0"
+ "oct.\0"
+ "nov.\0"
+ "des.\0"
+ "d. MMMM yyyy H:mm:ss z\0"
+ "d. MMMM yyyy\0"
+ "d.M.yyyy\0"
+ "H:mm:ss\0"
+ "H:mm\0"
+ "d. MMMM\0"
+ "dop.\0"
+ "odp.\0"
+ "ned\xc4\x9ble\0"
+ "pond\xc4\x9bl\xc3\xad\0"
+ "\xc3\xbater\xc3\xbd\0"
+ "st\xc5\x99\x65\x64\x61\0"
+ "\xc4\x8dtvrtek\0"
+ "p\xc3\xa1tek\0"
+ "sobota\0"
+ "ne\0"
+ "po\0"
+ "\xc3\xbat\0"
+ "st\0"
+ "\xc4\x8dt\0"
+ "p\xc3\xa1\0"
+ "so\0"
+ "leden\0"
+ "\xc3\xbanor\0"
+ "b\xc5\x99\x65zen\0"
+ "duben\0"
+ "kv\xc4\x9bten\0"
+ "\xc4\x8d\x65rven\0"
+ "\xc4\x8d\x65rvenec\0"
+ "srpen\0"
+ "z\xc3\xa1\xc5\x99\xc3\xad\0"
+ "\xc5\x99\xc3\xadjen\0"
+ "listopad\0"
+ "prosinec\0"
+ "I\0"
+ "II\0"
+ "III\0"
+ "IV\0"
+ "V\0"
+ "VI\0"
+ "VII\0"
+ "VIII\0"
+ "IX\0"
+ "X\0"
+ "XI\0"
+ "XII\0"
+ "d. MMM yyyy HH:mm:ss z\0"
+ "d. MMM yyyy\0"
+ "dd-MM-yyyy\0"
+ "s\xc3\xb8ndag\0"
+ "mandag\0"
+ "tirsdag\0"
+ "onsdag\0"
+ "torsdag\0"
+ "fredag\0"
+ "l\xc3\xb8rdag\0"
+ "s\xc3\xb8n\0"
+ "man\0"
+ "tir\0"
+ "ons\0"
+ "tor\0"
+ "fre\0"
+ "l\xc3\xb8r\0"
+ "januar\0"
+ "februar\0"
+ "marts\0"
+ "april\0"
+ "maj\0"
+ "juni\0"
+ "juli\0"
+ "august\0"
+ "september\0"
+ "oktober\0"
+ "november\0"
+ "december\0"
+ "jan\0"
+ "feb\0"
+ "mar\0"
+ "apr\0"
+ "jun\0"
+ "jul\0"
+ "aug\0"
+ "sep\0"
+ "okt\0"
+ "nov\0"
+ "dec\0"
+ "d. MMMM yyyy HH:mm:ss z\0"
+ "dd.MM.yyyy\0"
+ "vorm.\0"
+ "nachm.\0"
+ "Sonntag\0"
+ "Montag\0"
+ "Dienstag\0"
+ "Mittwoch\0"
+ "Donnerstag\0"
+ "Freitag\0"
+ "Samstag\0"
+ "So\0"
+ "Mo\0"
+ "Di\0"
+ "Mi\0"
+ "Do\0"
+ "Fr\0"
+ "Sa\0"
+ "Januar\0"
+ "Februar\0"
+ "M\xc3\xa4rz\0"
+ "April\0"
+ "Mai\0"
+ "Juni\0"
+ "Juli\0"
+ "August\0"
+ "September\0"
+ "Oktober\0"
+ "November\0"
+ "Dezember\0"
+ "Jan\0"
+ "Feb\0"
+ "Mrz\0"
+ "Apr\0"
+ "Jun\0"
+ "Jul\0"
+ "Aug\0"
+ "Sep\0"
+ "Okt\0"
+ "Nov\0"
+ "Dez\0"
+ "dd MMMM yyyy h:mm:ss t z\0"
+ "h:mm:ss tt\0"
+ "\xce\xa0\xce\x9c\0"
+ "\xce\x9c\xce\x9c\0"
+ "\xce\x9a\xcf\x85\xcf\x81\xce\xb9\xce\xb1\xce\xba\xce\xae\0"
+ "\xce\x94\xce\xb5\xcf\x85\xcf\x84\xce\xad\xcf\x81\xce\xb1\0"
+ "\xce\xa4\xcf\x81\xce\xaf\xcf\x84\xce\xb7\0"
+ "\xce\xa4\xce\xb5\xcf\x84\xce\xac\xcf\x81\xcf\x84\xce\xb7\0"
+ "\xce\xa0\xce\xad\xce\xbc\xcf\x80\xcf\x84\xce\xb7\0"
+ "\xce\xa0\xce\xb1\xcf\x81\xce\xb1\xcf\x83\xce\xba\xce\xb5\xcf\x85\xce\xae\0"
+ "\xce\xa3\xce\xac\xce\xb2\xce\xb2\xce\xb1\xcf\x84\xce\xbf\0"
+ "\xce\x9a\xcf\x85\xcf\x81\0"
+ "\xce\x94\xce\xb5\xcf\x85\0"
+ "\xce\xa4\xcf\x81\xce\xb9\0"
+ "\xce\xa4\xce\xb5\xcf\x84\0"
+ "\xce\xa0\xce\xb5\xce\xbc\0"
+ "\xce\xa0\xce\xb1\xcf\x81\0"
+ "\xce\xa3\xce\xb1\xce\xb2\0"
+ "\xce\x99\xce\xb1\xce\xbd\xce\xbf\xcf\x85\xce\xac\xcf\x81\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\xa6\xce\xb5\xce\xb2\xcf\x81\xce\xbf\xcf\x85\xce\xac\xcf\x81\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x9c\xce\xac\xcf\x81\xcf\x84\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x91\xcf\x80\xcf\x81\xce\xaf\xce\xbb\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x9c\xce\xac\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x99\xce\xbf\xcf\x8d\xce\xbd\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x99\xce\xbf\xcf\x8d\xce\xbb\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x91\xcf\x8d\xce\xb3\xce\xbf\xcf\x85\xcf\x83\xcf\x84\xce\xbf\xcf\x82\0"
+ "\xce\xa3\xce\xb5\xcf\x80\xcf\x84\xce\xad\xce\xbc\xce\xb2\xcf\x81\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x9f\xce\xba\xcf\x84\xcf\x8e\xce\xb2\xcf\x81\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x9d\xce\xbf\xce\xad\xce\xbc\xce\xb2\xcf\x81\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x94\xce\xb5\xce\xba\xce\xad\xce\xbc\xce\xb2\xcf\x81\xce\xb9\xce\xbf\xcf\x82\0"
+ "\xce\x99\xce\xb1\xce\xbd\0"
+ "\xce\xa6\xce\xb5\xce\xb2\0"
+ "\xce\x9c\xce\xb1\xcf\x81\0"
+ "\xce\x91\xcf\x80\xcf\x81\0"
+ "\xce\x9c\xce\xb1\xcf\x8a\0"
+ "\xce\x99\xce\xbf\xcf\x85\xce\xbd\0"
+ "\xce\x99\xce\xbf\xcf\x85\xce\xbb\0"
+ "\xce\x91\xcf\x85\xce\xb3\0"
+ "\xce\xa3\xce\xb5\xcf\x80\0"
+ "\xce\x9f\xce\xba\xcf\x84\0"
+ "\xce\x9d\xce\xbf\xce\xb5\0"
+ "\xce\x94\xce\xb5\xce\xba\0"
+ "MMMM d, yyyy h:mm:ss t z\0"
+ "dddd, MMMM dd, yyyy\0"
+ "M/d/yyyy\0"
+ "h:mm tt\0"
+ "MMMM d\0"
+ "Sunday\0"
+ "Monday\0"
+ "Tuesday\0"
+ "Wednesday\0"
+ "Thursday\0"
+ "Friday\0"
+ "Saturday\0"
+ "Sun\0"
+ "Mon\0"
+ "Tue\0"
+ "Wed\0"
+ "Thu\0"
+ "Fri\0"
+ "Sat\0"
+ "January\0"
+ "February\0"
+ "March\0"
+ "May\0"
+ "June\0"
+ "July\0"
+ "October\0"
+ "December\0"
+ "Mar\0"
+ "Oct\0"
+ "Dec\0"
+ "M/d/yy\0"
+ "MM/dd/yy\0"
+ "MM/dd/yyyy\0"
+ "yy/MM/dd\0"
+ "yyyy-MM-dd\0"
+ "dd-MMM-yy\0"
+ "MMMM dd, yyyy\0"
+ "dddd, dd MMMM, yyyy\0"
+ "dd, MMMM, yyyy\0"
+ "hh:mm tt\0"
+ "hh:mm:ss tt\0"
+ "d. MMMM'ta 'yyyy HH:mm:ss z\0"
+ "d. MMMM'ta 'yyyy\0"
+ "MMMM'ta 'yyyy\0"
+ "sunnuntai\0"
+ "maanantai\0"
+ "tiistai\0"
+ "keskiviikko\0"
+ "torstai\0"
+ "perjantai\0"
+ "lauantai\0"
+ "su\0"
+ "ma\0"
+ "ti\0"
+ "ke\0"
+ "to\0"
+ "pe\0"
+ "la\0"
+ "tammikuu\0"
+ "helmikuu\0"
+ "maaliskuu\0"
+ "huhtikuu\0"
+ "toukokuu\0"
+ "kes\xc3\xa4kuu\0"
+ "hein\xc3\xa4kuu\0"
+ "elokuu\0"
+ "syyskuu\0"
+ "lokakuu\0"
+ "marraskuu\0"
+ "joulukuu\0"
+ "tammi\0"
+ "helmi\0"
+ "maalis\0"
+ "huhti\0"
+ "touko\0"
+ "kes\xc3\xa4\0"
+ "hein\xc3\xa4\0"
+ "elo\0"
+ "syys\0"
+ "loka\0"
+ "marras\0"
+ "joulu\0"
+ "dimanche\0"
+ "lundi\0"
+ "mardi\0"
+ "mercredi\0"
+ "jeudi\0"
+ "vendredi\0"
+ "samedi\0"
+ "dim.\0"
+ "lun.\0"
+ "mar.\0"
+ "mer.\0"
+ "jeu.\0"
+ "ven.\0"
+ "sam.\0"
+ "janvier\0"
+ "f\xc3\xa9vrier\0"
+ "mars\0"
+ "avril\0"
+ "mai\0"
+ "juin\0"
+ "juillet\0"
+ "ao\xc3\xbbt\0"
+ "septembre\0"
+ "octobre\0"
+ "d\xc3\xa9\x63\x65mbre\0"
+ "janv.\0"
+ "f\xc3\xa9vr.\0"
+ "avr.\0"
+ "juil.\0"
+ "sept.\0"
+ "d\xc3\xa9\x63.\0"
+ "HH:mm:ss z d MMMM yyyy\0"
+ "\xd7\x99\xd7\x95\xd7\x9d \xd7\xa8\xd7\x90\xd7\xa9\xd7\x95\xd7\x9f\0"
+ "\xd7\x99\xd7\x95\xd7\x9d \xd7\xa9\xd7\xa0\xd7\x99\0"
+ "\xd7\x99\xd7\x95\xd7\x9d \xd7\xa9\xd7\x9c\xd7\x99\xd7\xa9\xd7\x99\0"
+ "\xd7\x99\xd7\x95\xd7\x9d \xd7\xa8\xd7\x91\xd7\x99\xd7\xa2\xd7\x99\0"
+ "\xd7\x99\xd7\x95\xd7\x9d \xd7\x97\xd7\x9e\xd7\x99\xd7\xa9\xd7\x99\0"
+ "\xd7\x99\xd7\x95\xd7\x9d \xd7\xa9\xd7\x99\xd7\xa9\xd7\x99\0"
+ "\xd7\xa9\xd7\x91\xd7\xaa\0"
+ "\xd7\x90\0"
+ "\xd7\x91\0"
+ "\xd7\x92\0"
+ "\xd7\x93\0"
+ "\xd7\x94\0"
+ "\xd7\x95\0"
+ "\xd7\xa9\0"
+ "\xd7\x99\xd7\xa0\xd7\x95\xd7\x90\xd7\xa8\0"
+ "\xd7\xa4\xd7\x91\xd7\xa8\xd7\x95\xd7\x90\xd7\xa8\0"
+ "\xd7\x9e\xd7\xa8\xd7\xa5\0"
+ "\xd7\x90\xd7\xa4\xd7\xa8\xd7\x99\xd7\x9c\0"
+ "\xd7\x9e\xd7\x90\xd7\x99\0"
+ "\xd7\x99\xd7\x95\xd7\xa0\xd7\x99\0"
+ "\xd7\x99\xd7\x95\xd7\x9c\xd7\x99\0"
+ "\xd7\x90\xd7\x95\xd7\x92\xd7\x95\xd7\xa1\xd7\x98\0"
+ "\xd7\xa1\xd7\xa4\xd7\x98\xd7\x9e\xd7\x91\xd7\xa8\0"
+ "\xd7\x90\xd7\x95\xd7\xa7\xd7\x98\xd7\x95\xd7\x91\xd7\xa8\0"
+ "\xd7\xa0\xd7\x95\xd7\x91\xd7\x9e\xd7\x91\xd7\xa8\0"
+ "\xd7\x93\xd7\xa6\xd7\x9e\xd7\x91\xd7\xa8\0"
+ "\xd7\x99\xd7\xa0\xd7\x95\0"
+ "\xd7\xa4\xd7\x91\xd7\xa8\0"
+ "\xd7\x90\xd7\xa4\xd7\xa8\0"
+ "\xd7\x99\xd7\x95\xd7\xa0\0"
+ "\xd7\x99\xd7\x95\xd7\x9c\0"
+ "\xd7\x90\xd7\x95\xd7\x92\0"
+ "\xd7\xa1\xd7\xa4\xd7\x98\0"
+ "\xd7\x90\xd7\x95\xd7\xa7\0"
+ "\xd7\xa0\xd7\x95\xd7\x91\0"
+ "\xd7\x93\xd7\xa6\xd7\x9e\0"
+ "yyyy. MMMM d. H:mm:ss z\0"
+ "yyyy. MMMM d.\0"
+ "yyyy. MM. dd.\0"
+ "yyyy. MMMM\0"
+ "DE\0"
+ "DU\0"
+ "vas\xc3\xa1rnap\0"
+ "h\xc3\xa9tf\xc5\x91\0"
+ "kedd\0"
+ "szerda\0"
+ "cs\xc3\xbct\xc3\xb6rt\xc3\xb6k\0"
+ "p\xc3\xa9ntek\0"
+ "szombat\0"
+ "H\0"
+ "K\0"
+ "Sze\0"
+ "Cs\0"
+ "P\0"
+ "Szo\0"
+ "janu\xc3\xa1r\0"
+ "febru\xc3\xa1r\0"
+ "m\xc3\xa1rcius\0"
+ "\xc3\xa1prilis\0"
+ "m\xc3\xa1jus\0"
+ "j\xc3\xbanius\0"
+ "j\xc3\xbalius\0"
+ "augusztus\0"
+ "szeptember\0"
+ "okt\xc3\xb3\x62\x65r\0"
+ "jan.\0"
+ "febr.\0"
+ "m\xc3\xa1rc.\0"
+ "\xc3\xa1pr.\0"
+ "m\xc3\xa1j.\0"
+ "j\xc3\xban.\0"
+ "j\xc3\xbal.\0"
+ "aug.\0"
+ "szept.\0"
+ "okt.\0"
+ "dec.\0"
+ "sunnudagur\0"
+ "m\xc3\xa1nudagur\0"
+ "\xc3\xberi\xc3\xb0judagur\0"
+ "mi\xc3\xb0vikudagur\0"
+ "fimmtudagur\0"
+ "f\xc3\xb6studagur\0"
+ "laugardagur\0"
+ "sun\0"
+ "m\xc3\xa1n\0"
+ "\xc3\xberi\0"
+ "mi\xc3\xb0\0"
+ "fim\0"
+ "f\xc3\xb6s\0"
+ "lau\0"
+ "jan\xc3\xba\x61r\0"
+ "febr\xc3\xba\x61r\0"
+ "apr\xc3\xadl\0"
+ "ma\xc3\xad\0"
+ "j\xc3\xban\xc3\xad\0"
+ "j\xc3\xbal\xc3\xad\0"
+ "\xc3\xa1g\xc3\xbast\0"
+ "n\xc3\xb3vember\0"
+ "desember\0"
+ "j\xc3\xban\0"
+ "j\xc3\xbal\0"
+ "\xc3\xa1g\xc3\xba\0"
+ "n\xc3\xb3v\0"
+ "des\0"
+ "dd MMMM yyyy H:mm:ss z\0"
+ "H.mm.ss\0"
+ "m.\0"
+ "p.\0"
+ "domenica\0"
+ "luned\xc3\xac\0"
+ "marted\xc3\xac\0"
+ "mercoled\xc3\xac\0"
+ "gioved\xc3\xac\0"
+ "venerd\xc3\xac\0"
+ "sabato\0"
+ "dom\0"
+ "lun\0"
+ "mer\0"
+ "gio\0"
+ "ven\0"
+ "sab\0"
+ "gennaio\0"
+ "febbraio\0"
+ "marzo\0"
+ "aprile\0"
+ "maggio\0"
+ "giugno\0"
+ "luglio\0"
+ "agosto\0"
+ "settembre\0"
+ "ottobre\0"
+ "dicembre\0"
+ "gen\0"
+ "mag\0"
+ "giu\0"
+ "lug\0"
+ "ago\0"
+ "set\0"
+ "ott\0"
+ "dic\0"
+ "yyyy'\xe5\xb9\xb4'M'\xe6\x9c\x88'd'\xe6\x97\xa5' H:mm:ss:z\0"
+ "yyyy'\xe5\xb9\xb4'M'\xe6\x9c\x88'd'\xe6\x97\xa5'\0"
+ "yyyy/MM/dd\0"
+ "H:mm:ss:z\0"
+ "yyyy'\xe5\xb9\xb4'M\0"
+ "M'\xe6\x9c\x88'd\0"
+ "\xe5\x8d\x88\xe5\x89\x8d\0"
+ "\xe5\x8d\x88\xe5\xbe\x8c\0"
+ "\xe6\x97\xa5\xe6\x9b\x9c\xe6\x97\xa5\0"
+ "\xe6\x9c\x88\xe6\x9b\x9c\xe6\x97\xa5\0"
+ "\xe7\x81\xab\xe6\x9b\x9c\xe6\x97\xa5\0"
+ "\xe6\xb0\xb4\xe6\x9b\x9c\xe6\x97\xa5\0"
+ "\xe6\x9c\xa8\xe6\x9b\x9c\xe6\x97\xa5\0"
+ "\xe9\x87\x91\xe6\x9b\x9c\xe6\x97\xa5\0"
+ "\xe5\x9c\x9f\xe6\x9b\x9c\xe6\x97\xa5\0"
+ "\xe6\x97\xa5\0"
+ "\xe6\x9c\x88\0"
+ "\xe7\x81\xab\0"
+ "\xe6\xb0\xb4\0"
+ "\xe6\x9c\xa8\0"
+ "\xe9\x87\x91\0"
+ "\xe5\x9c\x9f\0"
+ "1\xe6\x9c\x88\0"
+ "2\xe6\x9c\x88\0"
+ "3\xe6\x9c\x88\0"
+ "4\xe6\x9c\x88\0"
+ "5\xe6\x9c\x88\0"
+ "6\xe6\x9c\x88\0"
+ "7\xe6\x9c\x88\0"
+ "8\xe6\x9c\x88\0"
+ "9\xe6\x9c\x88\0"
+ "10\xe6\x9c\x88\0"
+ "11\xe6\x9c\x88\0"
+ "12\xe6\x9c\x88\0"
+ "1\0"
+ "2\0"
+ "3\0"
+ "4\0"
+ "5\0"
+ "6\0"
+ "7\0"
+ "8\0"
+ "9\0"
+ "10\0"
+ "11\0"
+ "12\0"
+ "yy/M/d\0"
+ "yyyy/M/d\0"
+ "yy/MM/dd' ('ddd')'\0"
+ "yy/M/d' ('ddd')'\0"
+ "yyyy/M/d' ('ddd')'\0"
+ "yyyy'\xe5\xb9\xb4'MM'\xe6\x9c\x88'dd'\xe6\x97\xa5'\0"
+ "yyyy'\xe5\xb9\xb4'M'\xe6\x9c\x88'd'\xe6\x97\xa5' dddd\0"
+ "yyyy'\xe5\xb9\xb4'MM'\xe6\x9c\x88'dd'\xe6\x97\xa5' dddd\0"
+ "tt h:mm\0"
+ "tt hh:mm\0"
+ "tt h:mm:ss\0"
+ "tt hh:mm:ss\0"
+ "yyyy'\xeb\x85\x84' M'\xec\x9b\x94' d'\xec\x9d\xbc' t hh'\xec\x8b\x9c' mm'\xeb\xb6\x84' ss'\xec\xb4\x88'\0"
+ "yyyy'\xeb\x85\x84' M'\xec\x9b\x94' d'\xec\x9d\xbc'\0"
+ "yyyy-MM-dd tt\0"
+ "h:mm:ss\0"
+ "t h:mm\0"
+ "yyyy'\xeb\x85\x84' M\0"
+ "M'\xec\x9b\x94' d\0"
+ "\xec\x98\xa4\xec\xa0\x84\0"
+ "\xec\x98\xa4\xed\x9b\x84\0"
+ "\xec\x9d\xbc\xec\x9a\x94\xec\x9d\xbc\0"
+ "\xec\x9b\x94\xec\x9a\x94\xec\x9d\xbc\0"
+ "\xed\x99\x94\xec\x9a\x94\xec\x9d\xbc\0"
+ "\xec\x88\x98\xec\x9a\x94\xec\x9d\xbc\0"
+ "\xeb\xaa\xa9\xec\x9a\x94\xec\x9d\xbc\0"
+ "\xea\xb8\x88\xec\x9a\x94\xec\x9d\xbc\0"
+ "\xed\x86\xa0\xec\x9a\x94\xec\x9d\xbc\0"
+ "\xec\x9d\xbc\0"
+ "\xec\x9b\x94\0"
+ "\xed\x99\x94\0"
+ "\xec\x88\x98\0"
+ "\xeb\xaa\xa9\0"
+ "\xea\xb8\x88\0"
+ "\xed\x86\xa0\0"
+ "1\xec\x9b\x94\0"
+ "2\xec\x9b\x94\0"
+ "3\xec\x9b\x94\0"
+ "4\xec\x9b\x94\0"
+ "5\xec\x9b\x94\0"
+ "6\xec\x9b\x94\0"
+ "7\xec\x9b\x94\0"
+ "8\xec\x9b\x94\0"
+ "9\xec\x9b\x94\0"
+ "10\xec\x9b\x94\0"
+ "11\xec\x9b\x94\0"
+ "12\xec\x9b\x94\0"
+ "d MMMM yyyy H:mm:ss z\0"
+ "d-M-yyyy\0"
+ "zondag\0"
+ "maandag\0"
+ "dinsdag\0"
+ "woensdag\0"
+ "donderdag\0"
+ "vrijdag\0"
+ "zaterdag\0"
+ "zo\0"
+ "di\0"
+ "wo\0"
+ "do\0"
+ "vr\0"
+ "za\0"
+ "januari\0"
+ "februari\0"
+ "maart\0"
+ "mei\0"
+ "augustus\0"
+ "mrt\0"
+ "niedziela\0"
+ "poniedzia\xc5\x82\x65k\0"
+ "wtorek\0"
+ "\xc5\x9broda\0"
+ "czwartek\0"
+ "pi\xc4\x85tek\0"
+ "N\0"
+ "Pn\0"
+ "Wt\0"
+ "\xc5\x9ar\0"
+ "Cz\0"
+ "Pt\0"
+ "stycze\xc5\x84\0"
+ "luty\0"
+ "marzec\0"
+ "kwiecie\xc5\x84\0"
+ "czerwiec\0"
+ "lipiec\0"
+ "sierpie\xc5\x84\0"
+ "wrzesie\xc5\x84\0"
+ "pa\xc5\xba\x64ziernik\0"
+ "grudzie\xc5\x84\0"
+ "sty\0"
+ "lut\0"
+ "kwi\0"
+ "cze\0"
+ "lip\0"
+ "sie\0"
+ "wrz\0"
+ "pa\xc5\xba\0"
+ "lis\0"
+ "gru\0"
+ "d' de 'MMMM' de 'yyyy H'h'm'min's's' z\0"
+ "d' de 'MMMM' de 'yyyy\0"
+ "MMMM' de 'yyyy\0"
+ "d' de 'MMMM\0"
+ "domingo\0"
+ "segunda-feira\0"
+ "ter\xc3\xa7\x61-feira\0"
+ "quarta-feira\0"
+ "quinta-feira\0"
+ "sexta-feira\0"
+ "s\xc3\xa1\x62\x61\x64o\0"
+ "seg\0"
+ "ter\0"
+ "qua\0"
+ "qui\0"
+ "sex\0"
+ "s\xc3\xa1\x62\0"
+ "janeiro\0"
+ "fevereiro\0"
+ "mar\xc3\xa7o\0"
+ "maio\0"
+ "junho\0"
+ "julho\0"
+ "setembro\0"
+ "outubro\0"
+ "novembro\0"
+ "dezembro\0"
+ "fev\0"
+ "abr\0"
+ "out\0"
+ "dez\0"
+ "duminic\xc4\x83\0"
+ "luni\0"
+ "mar\xc5\xa3i\0"
+ "miercuri\0"
+ "joi\0"
+ "vineri\0"
+ "s\xc3\xaemb\xc4\x83t\xc4\x83\0"
+ "D\0"
+ "L\0"
+ "Ma\0"
+ "J\0"
+ "S\0"
+ "ianuarie\0"
+ "februarie\0"
+ "martie\0"
+ "aprilie\0"
+ "iunie\0"
+ "iulie\0"
+ "septembrie\0"
+ "octombrie\0"
+ "noiembrie\0"
+ "decembrie\0"
+ "Ian\0"
+ "Iun\0"
+ "Iul\0"
+ "d MMMM yyyy '\xd0\xb3.' H:mm:ss z\0"
+ "d MMMM yyyy '\xd0\xb3.'\0"
+ "\xd0\xb2\xd0\xbe\xd1\x81\xd0\xba\xd1\x80\xd0\xb5\xd1\x81\xd0\xb5\xd0\xbd\xd1\x8c\xd0\xb5\0"
+ "\xd0\xbf\xd0\xbe\xd0\xbd\xd0\xb5\xd0\xb4\xd0\xb5\xd0\xbb\xd1\x8c\xd0\xbd\xd0\xb8\xd0\xba\0"
+ "\xd1\x81\xd1\x80\xd0\xb5\xd0\xb4\xd0\xb0\0"
+ "\xd1\x87\xd0\xb5\xd1\x82\xd0\xb2\xd0\xb5\xd1\x80\xd0\xb3\0"
+ "\xd0\xbf\xd1\x8f\xd1\x82\xd0\xbd\xd0\xb8\xd1\x86\xd0\xb0\0"
+ "\xd1\x81\xd1\x83\xd0\xb1\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0\0"
+ "\xd0\x92\xd1\x81\0"
+ "\xd0\x9f\xd0\xbd\0"
+ "\xd0\x92\xd1\x82\0"
+ "\xd0\xa1\xd1\x80\0"
+ "\xd0\xa7\xd1\x82\0"
+ "\xd0\x9f\xd1\x82\0"
+ "\xd0\xa1\xd0\xb1\0"
+ "\xd0\xaf\xd0\xbd\xd0\xb2\xd0\xb0\xd1\x80\xd1\x8c\0"
+ "\xd0\xa4\xd0\xb5\xd0\xb2\xd1\x80\xd0\xb0\xd0\xbb\xd1\x8c\0"
+ "\xd0\x9c\xd0\xb0\xd1\x80\xd1\x82\0"
+ "\xd0\x90\xd0\xbf\xd1\x80\xd0\xb5\xd0\xbb\xd1\x8c\0"
+ "\xd0\x9c\xd0\xb0\xd0\xb9\0"
+ "\xd0\x98\xd1\x8e\xd0\xbd\xd1\x8c\0"
+ "\xd0\x98\xd1\x8e\xd0\xbb\xd1\x8c\0"
+ "\xd0\x90\xd0\xb2\xd0\xb3\xd1\x83\xd1\x81\xd1\x82\0"
+ "\xd0\xa1\xd0\xb5\xd0\xbd\xd1\x82\xd1\x8f\xd0\xb1\xd1\x80\xd1\x8c\0"
+ "\xd0\x9e\xd0\xba\xd1\x82\xd1\x8f\xd0\xb1\xd1\x80\xd1\x8c\0"
+ "\xd0\x9d\xd0\xbe\xd1\x8f\xd0\xb1\xd1\x80\xd1\x8c\0"
+ "\xd0\x94\xd0\xb5\xd0\xba\xd0\xb0\xd0\xb1\xd1\x80\xd1\x8c\0"
+ "\xd1\x8f\xd0\xbd\xd0\xb2\0"
+ "\xd1\x84\xd0\xb5\xd0\xb2\0"
+ "\xd0\xbc\xd0\xb0\xd1\x80\0"
+ "\xd0\xb0\xd0\xbf\xd1\x80\0"
+ "\xd0\xb8\xd1\x8e\xd0\xbd\0"
+ "\xd0\xb8\xd1\x8e\xd0\xbb\0"
+ "\xd0\xb0\xd0\xb2\xd0\xb3\0"
+ "\xd1\x81\xd0\xb5\xd0\xbd\0"
+ "\xd0\xbe\xd0\xba\xd1\x82\0"
+ "\xd0\xbd\xd0\xbe\xd1\x8f\0"
+ "\xd0\xb4\xd0\xb5\xd0\xba\0"
+ "yyyy. MMMM dd HH:mm:ss z\0"
+ "yyyy. MMMM dd\0"
+ "MMMM dd\0"
+ "nedjelja\0"
+ "ponedjeljak\0"
+ "utorak\0"
+ "srijeda\0"
+ "\xc4\x8d\x65tvrtak\0"
+ "petak\0"
+ "subota\0"
+ "ned\0"
+ "pon\0"
+ "uto\0"
+ "sri\0"
+ "\xc4\x8d\x65t\0"
+ "pet\0"
+ "sub\0"
+ "sije\xc4\x8d\x61nj\0"
+ "velja\xc4\x8d\x61\0"
+ "o\xc5\xbeujak\0"
+ "travanj\0"
+ "svibanj\0"
+ "lipanj\0"
+ "srpanj\0"
+ "kolovoz\0"
+ "rujan\0"
+ "studeni\0"
+ "prosinac\0"
+ "sij\0"
+ "vel\0"
+ "o\xc5\xbeu\0"
+ "tra\0"
+ "svi\0"
+ "srp\0"
+ "kol\0"
+ "ruj\0"
+ "stu\0"
+ "pro\0"
+ "d. M. yyyy\0"
+ "Nede\xc4\xbe\x61\0"
+ "Pondelok\0"
+ "Utorok\0"
+ "Streda\0"
+ "\xc5\xa0tvrtok\0"
+ "Piatok\0"
+ "Sobota\0"
+ "Ne\0"
+ "Po\0"
+ "Ut\0"
+ "St\0"
+ "\xc5\xa0t\0"
+ "Pi\0"
+ "marec\0"
+ "m\xc3\xa1j\0"
+ "dd MMMM yyyy h.mm.ss.t z\0"
+ "h:mm:ss.tt\0"
+ "h.mm.t\0"
+ "PD\0"
+ "MD\0"
+ "e diel\0"
+ "e h\xc3\xabn\xc3\xab\0"
+ "e mart\xc3\xab\0"
+ "e m\xc3\xabrkur\xc3\xab\0"
+ "e enjte\0"
+ "e premte\0"
+ "e shtun\xc3\xab\0"
+ "Die\0"
+ "H\xc3\xabn\0"
+ "M\xc3\xabr\0"
+ "Enj\0"
+ "Pre\0"
+ "Sht\0"
+ "janar\0"
+ "shkurt\0"
+ "prill\0"
+ "qershor\0"
+ "korrik\0"
+ "gusht\0"
+ "shtator\0"
+ "tetor\0"
+ "n\xc3\xabntor\0"
+ "dhjetor\0"
+ "Shk\0"
+ "Pri\0"
+ "Maj\0"
+ "Qer\0"
+ "Kor\0"
+ "Gsh\0"
+ "Tet\0"
+ "N\xc3\xabn\0"
+ "Dhj\0"
+ "'den 'd MMM yyyy HH.mm.ss z\0"
+ "'den 'd MMM yyyy\0"
+ "HH.mm\0"
+ "fm\0"
+ "em\0"
+ "s\xc3\xb6ndag\0"
+ "m\xc3\xa5ndag\0"
+ "tisdag\0"
+ "l\xc3\xb6rdag\0"
+ "s\xc3\xb6\0"
+ "m\xc3\xa5\0"
+ "on\0"
+ "fr\0"
+ "l\xc3\xb6\0"
+ "augusti\0"
+ "d MMMM yyyy, H' \xe0\xb8\x99\xe0\xb8\xb2\xe0\xb8\xac\xe0\xb8\xb4\xe0\xb8\x81\xe0\xb8\xb2 'm' \xe0\xb8\x99\xe0\xb8\xb2\xe0\xb8\x97\xe0\xb8\xb5'\0"
+ "\xe0\xb8\x81\xe0\xb9\x88\xe0\xb8\xad\xe0\xb8\x99\xe0\xb9\x80\xe0\xb8\x97\xe0\xb8\xb5\xe0\xb9\x88\xe0\xb8\xa2\xe0\xb8\x87\0"
+ "\xe0\xb8\xab\xe0\xb8\xa5\xe0\xb8\xb1\xe0\xb8\x87\xe0\xb9\x80\xe0\xb8\x97\xe0\xb8\xb5\xe0\xb9\x88\xe0\xb8\xa2\xe0\xb8\x87\0"
+ "\xe0\xb8\xa7\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\xad\xe0\xb8\xb2\xe0\xb8\x97\xe0\xb8\xb4\xe0\xb8\x95\xe0\xb8\xa2\xe0\xb9\x8c\0"
+ "\xe0\xb8\xa7\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\x88\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\x97\xe0\xb8\xa3\xe0\xb9\x8c\0"
+ "\xe0\xb8\xa7\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\xad\xe0\xb8\xb1\xe0\xb8\x87\xe0\xb8\x84\xe0\xb8\xb2\xe0\xb8\xa3\0"
+ "\xe0\xb8\xa7\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\x9e\xe0\xb8\xb8\xe0\xb8\x98\0"
+ "\xe0\xb8\xa7\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\x9e\xe0\xb8\xa4\xe0\xb8\xab\xe0\xb8\xb1\xe0\xb8\xaa\xe0\xb8\x9a\xe0\xb8\x94\xe0\xb8\xb5\0"
+ "\xe0\xb8\xa7\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\xa8\xe0\xb8\xb8\xe0\xb8\x81\xe0\xb8\xa3\xe0\xb9\x8c\0"
+ "\xe0\xb8\xa7\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb9\x80\xe0\xb8\xaa\xe0\xb8\xb2\xe0\xb8\xa3\xe0\xb9\x8c\0"
+ "\xe0\xb8\xad\xe0\xb8\xb2.\0"
+ "\xe0\xb8\x88.\0"
+ "\xe0\xb8\xad.\0"
+ "\xe0\xb8\x9e.\0"
+ "\xe0\xb8\x9e\xe0\xb8\xa4.\0"
+ "\xe0\xb8\xa8.\0"
+ "\xe0\xb8\xaa.\0"
+ "\xe0\xb8\xa1\xe0\xb8\x81\xe0\xb8\xa3\xe0\xb8\xb2\xe0\xb8\x84\xe0\xb8\xa1\0"
+ "\xe0\xb8\x81\xe0\xb8\xb8\xe0\xb8\xa1\xe0\xb8\xa0\xe0\xb8\xb2\xe0\xb8\x9e\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\x98\xe0\xb9\x8c\0"
+ "\xe0\xb8\xa1\xe0\xb8\xb5\xe0\xb8\x99\xe0\xb8\xb2\xe0\xb8\x84\xe0\xb8\xa1\0"
+ "\xe0\xb9\x80\xe0\xb8\xa1\xe0\xb8\xa9\xe0\xb8\xb2\xe0\xb8\xa2\xe0\xb8\x99\0"
+ "\xe0\xb8\x9e\xe0\xb8\xa4\xe0\xb8\xa9\xe0\xb8\xa0\xe0\xb8\xb2\xe0\xb8\x84\xe0\xb8\xa1\0"
+ "\xe0\xb8\xa1\xe0\xb8\xb4\xe0\xb8\x96\xe0\xb8\xb8\xe0\xb8\x99\xe0\xb8\xb2\xe0\xb8\xa2\xe0\xb8\x99\0"
+ "\xe0\xb8\x81\xe0\xb8\xa3\xe0\xb8\x81\xe0\xb8\x8e\xe0\xb8\xb2\xe0\xb8\x84\xe0\xb8\xa1\0"
+ "\xe0\xb8\xaa\xe0\xb8\xb4\xe0\xb8\x87\xe0\xb8\xab\xe0\xb8\xb2\xe0\xb8\x84\xe0\xb8\xa1\0"
+ "\xe0\xb8\x81\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\xa2\xe0\xb8\xb2\xe0\xb8\xa2\xe0\xb8\x99\0"
+ "\xe0\xb8\x95\xe0\xb8\xb8\xe0\xb8\xa5\xe0\xb8\xb2\xe0\xb8\x84\xe0\xb8\xa1\0"
+ "\xe0\xb8\x9e\xe0\xb8\xa4\xe0\xb8\xa8\xe0\xb8\x88\xe0\xb8\xb4\xe0\xb8\x81\xe0\xb8\xb2\xe0\xb8\xa2\xe0\xb8\x99\0"
+ "\xe0\xb8\x98\xe0\xb8\xb1\xe0\xb8\x99\xe0\xb8\xa7\xe0\xb8\xb2\xe0\xb8\x84\xe0\xb8\xa1\0"
+ "\xe0\xb8\xa1.\xe0\xb8\x84.\0"
+ "\xe0\xb8\x81.\xe0\xb8\x9e.\0"
+ "\xe0\xb8\xa1\xe0\xb8\xb5.\xe0\xb8\x84.\0"
+ "\xe0\xb9\x80\xe0\xb8\xa1.\xe0\xb8\xa2.\0"
+ "\xe0\xb8\x9e.\xe0\xb8\x84.\0"
+ "\xe0\xb8\xa1\xe0\xb8\xb4.\xe0\xb8\xa2.\0"
+ "\xe0\xb8\x81.\xe0\xb8\x84.\0"
+ "\xe0\xb8\xaa.\xe0\xb8\x84.\0"
+ "\xe0\xb8\x81.\xe0\xb8\xa2.\0"
+ "\xe0\xb8\x95.\xe0\xb8\x84.\0"
+ "\xe0\xb8\x9e.\xe0\xb8\xa2.\0"
+ "\xe0\xb8\x98.\xe0\xb8\x84.\0"
+ "dd MMMM yyyy EEEE HH:mm:ss z\0"
+ "dd MMMM yyyy EEEE\0"
+ "Pazar\0"
+ "Pazartesi\0"
+ "Sal\xc4\xb1\0"
+ "\xc3\x87\x61r\xc5\x9f\x61mba\0"
+ "Per\xc5\x9f\x65mbe\0"
+ "Cuma\0"
+ "Cumartesi\0"
+ "Paz\0"
+ "Pzt\0"
+ "Sal\0"
+ "\xc3\x87\x61r\0"
+ "Per\0"
+ "Cum\0"
+ "Cmt\0"
+ "Ocak\0"
+ "\xc5\x9eubat\0"
+ "Mart\0"
+ "Nisan\0"
+ "May\xc4\xb1s\0"
+ "Haziran\0"
+ "Temmuz\0"
+ "A\xc4\x9fustos\0"
+ "Eyl\xc3\xbcl\0"
+ "Ekim\0"
+ "Kas\xc4\xb1m\0"
+ "Aral\xc4\xb1k\0"
+ "Oca\0"
+ "\xc5\x9eub\0"
+ "Nis\0"
+ "Haz\0"
+ "Tem\0"
+ "A\xc4\x9fu\0"
+ "Eyl\0"
+ "Eki\0"
+ "Kas\0"
+ "Ara\0"
+ "dd MMMM yyyy H:mm:ss\0"
+ "Minggu\0"
+ "Senin\0"
+ "Selasa\0"
+ "Rabu\0"
+ "Kamis\0"
+ "Jumat\0"
+ "Sabtu\0"
+ "Min\0"
+ "Sen\0"
+ "Sel\0"
+ "Rab\0"
+ "Kam\0"
+ "Jum\0"
+ "Sab\0"
+ "Januari\0"
+ "Februari\0"
+ "Maret\0"
+ "Mei\0"
+ "Agustus\0"
+ "Desember\0"
+ "Agu\0"
+ "Des\0"
+ "\xd0\x9d\xd0\xb5\xd0\xb4\xd1\x96\xd0\xbb\xd1\x8f\0"
+ "\xd0\x9f\xd0\xbe\xd0\xbd\xd0\xb5\xd0\xb4\xd1\x96\xd0\xbb\xd0\xbe\xd0\xba\0"
+ "\xd0\x92\xd1\x96\xd0\xb2\xd1\x82\xd0\xbe\xd1\x80\xd0\xbe\xd0\xba\0"
+ "\xd0\xa1\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb4\xd0\xb0\0"
+ "\xd0\xa7\xd0\xb5\xd1\x82\xd0\xb2\xd0\xb5\xd1\x80\0"
+ "\xd0\x9f'\xd1\x8f\xd1\x82\xd0\xbd\xd0\xb8\xd1\x86\xd1\x8f\0"
+ "\xd0\xa1\xd1\x83\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0\0"
+ "\xd0\x9d\xd0\xb4\0"
+ "\xd1\x81\xd1\x96\xd1\x87\xd0\xbd\xd1\x8f\0"
+ "\xd0\xbb\xd1\x8e\xd1\x82\xd0\xbe\xd0\xb3\xd0\xbe\0"
+ "\xd0\xb1\xd0\xb5\xd1\x80\xd0\xb5\xd0\xb7\xd0\xbd\xd1\x8f\0"
+ "\xd0\xba\xd0\xb2\xd1\x96\xd1\x82\xd0\xbd\xd1\x8f\0"
+ "\xd1\x82\xd1\x80\xd0\xb0\xd0\xb2\xd0\xbd\xd1\x8f\0"
+ "\xd1\x87\xd0\xb5\xd1\x80\xd0\xb2\xd0\xbd\xd1\x8f\0"
+ "\xd0\xbb\xd0\xb8\xd0\xbf\xd0\xbd\xd1\x8f\0"
+ "\xd1\x81\xd0\xb5\xd1\x80\xd0\xbf\xd0\xbd\xd1\x8f\0"
+ "\xd0\xb2\xd0\xb5\xd1\x80\xd0\xb5\xd1\x81\xd0\xbd\xd1\x8f\0"
+ "\xd0\xb6\xd0\xbe\xd0\xb2\xd1\x82\xd0\xbd\xd1\x8f\0"
+ "\xd0\xbb\xd0\xb8\xd1\x81\xd1\x82\xd0\xbe\xd0\xbf\xd0\xb0\xd0\xb4\xd0\xb0\0"
+ "\xd0\xb3\xd1\x80\xd1\x83\xd0\xb4\xd0\xbd\xd1\x8f\0"
+ "\xd1\x81\xd1\x96\xd1\x87\0"
+ "\xd0\xbb\xd1\x8e\xd1\x82\0"
+ "\xd0\xb1\xd0\xb5\xd1\x80\0"
+ "\xd0\xba\xd0\xb2\xd1\x96\xd1\x82\0"
+ "\xd1\x82\xd1\x80\xd0\xb0\xd0\xb2\0"
+ "\xd1\x87\xd0\xb5\xd1\x80\xd0\xb2\0"
+ "\xd0\xbb\xd0\xb8\xd0\xbf\0"
+ "\xd1\x81\xd0\xb5\xd1\x80\xd0\xbf\0"
+ "\xd0\xb2\xd0\xb5\xd1\x80\0"
+ "\xd0\xb6\xd0\xbe\xd0\xb2\xd1\x82\0"
+ "\xd0\xbb\xd0\xb8\xd1\x81\xd1\x82\0"
+ "\xd0\xb3\xd1\x80\xd1\x83\xd0\xb4\0"
+ "d MMMM yyyy HH.mm.ss z\0"
+ "\xd0\xbd\xd1\x8f\xd0\xb4\xd0\xb7\xd0\xb5\xd0\xbb\xd1\x8f\0"
+ "\xd0\xbf\xd0\xb0\xd0\xbd\xd1\x8f\xd0\xb4\xd0\xb7\xd0\xb5\xd0\xbb\xd0\xb0\xd0\xba\0"
+ "\xd0\xb0\xd1\x9e\xd1\x82\xd0\xbe\xd1\x80\xd0\xb0\xd0\xba\0"
+ "\xd1\x81\xd0\xb5\xd1\x80\xd0\xb0\xd0\xb4\xd0\xb0\0"
+ "\xd1\x87\xd0\xb0\xd1\x86\xd0\xb2\xd0\xb5\xd1\x80\0"
+ "\xd0\xbf\xd1\x8f\xd1\x82\xd0\xbd\xd1\x96\xd1\x86\xd0\xb0\0"
+ "\xd1\x81\xd1\x83\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0\0"
+ "\xd0\xbd\xd0\xb4\0"
+ "\xd0\xbf\xd0\xbd\0"
+ "\xd0\xb0\xd1\x9e\0"
+ "\xd1\x81\xd1\x80\0"
+ "\xd1\x87\xd1\x86\0"
+ "\xd0\xbf\xd1\x82\0"
+ "\xd1\x81\xd0\xb1\0"
+ "\xd1\x81\xd1\x82\xd1\x83\xd0\xb4\xd0\xb7\xd0\xb5\xd0\xbd\xd1\x8c\0"
+ "\xd0\xbb\xd1\x8e\xd1\x82\xd1\x8b\0"
+ "\xd1\x81\xd0\xb0\xd0\xba\xd0\xb0\xd0\xb2\xd1\x96\xd0\xba\0"
+ "\xd0\xba\xd1\x80\xd0\xb0\xd1\x81\xd0\xb0\xd0\xb2\xd1\x96\xd0\xba\0"
+ "\xd1\x87\xd1\x8d\xd1\x80\xd0\xb2\xd0\xb5\xd0\xbd\xd1\x8c\0"
+ "\xd0\xbb\xd1\x96\xd0\xbf\xd0\xb5\xd0\xbd\xd1\x8c\0"
+ "\xd0\xb6\xd0\xbd\xd1\x96\xd0\xb2\xd0\xb5\xd0\xbd\xd1\x8c\0"
+ "\xd0\xb2\xd0\xb5\xd1\x80\xd0\xb0\xd1\x81\xd0\xb5\xd0\xbd\xd1\x8c\0"
+ "\xd0\xba\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd1\x8b\xd1\x87\xd0\xbd\xd1\x96\xd0\xba\0"
+ "\xd0\xbb\xd1\x96\xd1\x81\xd1\x82\xd0\xb0\xd0\xbf\xd0\xb0\xd0\xb4\0"
+ "\xd1\x81\xd0\xbd\xd0\xb5\xd0\xb6\xd0\xb0\xd0\xbd\xd1\x8c\0"
+ "\xd1\x81\xd1\x82\xd1\x83\0"
+ "\xd1\x81\xd0\xb0\xd0\xba\0"
+ "\xd0\xba\xd1\x80\xd0\xb0\0"
+ "\xd1\x87\xd1\x8d\xd1\x80\0"
+ "\xd0\xbb\xd1\x96\xd0\xbf\0"
+ "\xd0\xb6\xd0\xbd\xd1\x96\0"
+ "\xd0\xba\xd0\xb0\xd1\x81\0"
+ "\xd0\xbb\xd1\x96\xd1\x81\0"
+ "\xd1\x81\xd0\xbd\xd0\xb5\0"
+ "dd. MMMM yyyy H:mm:ss z\0"
+ "dd. MMMM yyyy\0"
+ "dd. MMMM\0"
+ "nedelja\0"
+ "ponedeljek\0"
+ "torek\0"
+ "sreda\0"
+ "\xc4\x8d\x65trtek\0"
+ "petek\0"
+ "sre\0"
+ "sob\0"
+ "junij\0"
+ "julij\0"
+ "avgust\0"
+ "avg\0"
+ "d.MM.yyyy\0"
+ "d, MMMM\0"
+ "p\xc3\xbchap\xc3\xa4\x65v\0"
+ "esmasp\xc3\xa4\x65v\0"
+ "teisip\xc3\xa4\x65v\0"
+ "kolmap\xc3\xa4\x65v\0"
+ "neljap\xc3\xa4\x65v\0"
+ "reede\0"
+ "laup\xc3\xa4\x65v\0"
+ "E\0"
+ "T\0"
+ "R\0"
+ "jaanuar\0"
+ "veebruar\0"
+ "m\xc3\xa4rts\0"
+ "aprill\0"
+ "juuni\0"
+ "juuli\0"
+ "oktoober\0"
+ "detsember\0"
+ "jaan\0"
+ "veebr\0"
+ "sept\0"
+ "dets\0"
+ "yyyy'. gada 'd. MMMM HH:mm:ss z\0"
+ "yyyy'. gada 'd. MMMM\0"
+ "yyyy.MM.dd.\0"
+ "yyyy'. gada 'MMMM\0"
+ "sv\xc4\x93tdiena\0"
+ "pirmdiena\0"
+ "otrdiena\0"
+ "tre\xc5\xa1\x64iena\0"
+ "ceturtdiena\0"
+ "piektdiena\0"
+ "sestdiena\0"
+ "Sv\0"
+ "O\0"
+ "C\0"
+ "Pk\0"
+ "janv\xc4\x81ris\0"
+ "febru\xc4\x81ris\0"
+ "apr\xc4\xablis\0"
+ "maijs\0"
+ "j\xc5\xabnijs\0"
+ "j\xc5\xablijs\0"
+ "augusts\0"
+ "septembris\0"
+ "oktobris\0"
+ "novembris\0"
+ "decembris\0"
+ "J\xc5\xabn\0"
+ "J\xc5\xabl\0"
+ "yyyy 'm.' MMMM d 'd.' HH:mm:ss z\0"
+ "yyyy 'm.' MMMM d 'd.'\0"
+ "yyyy.MM.dd\0"
+ "yyyy 'm.' MMMM\0"
+ "Sekmadienis\0"
+ "Pirmadienis\0"
+ "Antradienis\0"
+ "Tre\xc4\x8diadienis\0"
+ "Ketvirtadienis\0"
+ "Penktadienis\0"
+ "\xc5\xa0\x65\xc5\xa1tadienis\0"
+ "Sk\0"
+ "Pr\0"
+ "An\0"
+ "Tr\0"
+ "Kt\0"
+ "Sausio\0"
+ "Vasario\0"
+ "Kovo\0"
+ "Baland\xc5\xbeio\0"
+ "Gegu\xc5\xbe\xc4\x97s\0"
+ "Bir\xc5\xbe\x65lio\0"
+ "Liepos\0"
+ "Rugpj\xc5\xab\xc4\x8dio\0"
+ "Rugs\xc4\x97jo\0"
+ "Spalio\0"
+ "Lapkri\xc4\x8dio\0"
+ "Gruod\xc5\xbeio\0"
+ "Sau\0"
+ "Vas\0"
+ "Kov\0"
+ "Bal\0"
+ "Geg\0"
+ "Bir\0"
+ "Lie\0"
+ "Rgp\0"
+ "Rgs\0"
+ "Spa\0"
+ "Lap\0"
+ "Grd\0"
+ "d MMMM yyyy HH:mm:ss (z)\0"
+ "\xd9\x82.\xd8\xb8.\0"
+ "\xd8\xa8.\xd8\xb8.\0"
+ "\xdb\x8c\xda\xa9\xe2\x80\x8c\xd8\xb4\xd9\x86\xd8\xa8\xd9\x87\0"
+ "\xd8\xaf\xd9\x88\xd8\xb4\xd9\x86\xd8\xa8\xd9\x87\0"
+ "\xd8\xb3\xd9\x87\xe2\x80\x8c\xd8\xb4\xd9\x86\xd8\xa8\xd9\x87\0"
+ "\xda\x86\xd9\x87\xd8\xa7\xd8\xb1\xd8\xb4\xd9\x86\xd8\xa8\xd9\x87\0"
+ "\xd9\xbe\xd9\x86\xd8\xac\xe2\x80\x8c\xd8\xb4\xd9\x86\xd8\xa8\xd9\x87\0"
+ "\xd8\xac\xd9\x85\xd8\xb9\xd9\x87\0"
+ "\xd8\xb4\xd9\x86\xd8\xa8\xd9\x87\0"
+ "\xdb\x8c.\0"
+ "\xd8\xaf.\0"
+ "\xd8\xb3.\0"
+ "\xda\x86.\0"
+ "\xd9\xbe.\0"
+ "\xd8\xac.\0"
+ "\xd8\xb4.\0"
+ "\xda\x98\xd8\xa7\xd9\x86\xd9\x88\xdb\x8c\xd9\x87\0"
+ "\xd9\x81\xd9\x88\xd8\xb1\xdb\x8c\xd9\x87\0"
+ "\xd8\xa2\xd9\x88\xd8\xb1\xdb\x8c\xd9\x84\0"
+ "\xd9\x85\xd9\x87\0"
+ "\xda\x98\xd9\x88\xd8\xa6\xd9\x86\0"
+ "\xda\x98\xd9\x88\xd8\xa6\xdb\x8c\xd9\x87\0"
+ "\xd8\xa7\xd9\x88\xd8\xaa\0"
+ "\xd8\xb3\xd9\xbe\xd8\xaa\xd8\xa7\xd9\x85\xd8\xa8\xd8\xb1\0"
+ "\xd8\xa7\xda\xa9\xd8\xaa\xd8\xa8\xd8\xb1\0"
+ "\xd9\x86\xd9\x88\xd8\xa7\xd9\x85\xd8\xa8\xd8\xb1\0"
+ "\xd8\xaf\xd8\xb3\xd8\xa7\xd9\x85\xd8\xa8\xd8\xb1\0"
+ "\xda\x98\xd8\xa7\xd9\x86\0"
+ "\xd9\x81\xd9\x88\xd8\xb1\0"
+ "\xd9\x85\xd8\xa7\xd8\xb1\0"
+ "\xd8\xa2\xd9\x88\xd8\xb1\0"
+ "\xd9\x85\xd9\x80\xd9\x87\0"
+ "\xda\x98\xd9\x88\xd9\x86\0"
+ "\xda\x98\xd9\x88\xdb\x8c\0"
+ "\xd8\xb3\xd9\xbe\xd8\xaa\0"
+ "\xd8\xa7\xda\xa9\xd8\xaa\0"
+ "\xd9\x86\xd9\x88\xd8\xa7\0"
+ "\xd8\xaf\xd8\xb3\xd8\xa7\0"
+ "HH:mm:ss z dd MMMM yyyy\0"
+ "SA\0"
+ "CH\0"
+ "Ch\xe1\xbb\xa7 nh\xe1\xba\xadt\0"
+ "Th\xe1\xbb\xa9 hai\0"
+ "Th\xe1\xbb\xa9 ba\0"
+ "Th\xe1\xbb\xa9 t\xc6\xb0\0"
+ "Th\xe1\xbb\xa9 n\xc4\x83m\0"
+ "Th\xe1\xbb\xa9 s\xc3\xa1u\0"
+ "Th\xe1\xbb\xa9 b\xe1\xba\xa3y\0"
+ "CN\0"
+ "Th 2\0"
+ "Th 3\0"
+ "Th 4\0"
+ "Th 5\0"
+ "Th 6\0"
+ "Th 7\0"
+ "Th\xc3\xa1ng m\xe1\xbb\x99t\0"
+ "Th\xc3\xa1ng hai\0"
+ "Th\xc3\xa1ng ba\0"
+ "Th\xc3\xa1ng t\xc6\xb0\0"
+ "Th\xc3\xa1ng n\xc4\x83m\0"
+ "Th\xc3\xa1ng s\xc3\xa1u\0"
+ "Th\xc3\xa1ng b\xe1\xba\xa3y\0"
+ "Th\xc3\xa1ng t\xc3\xa1m\0"
+ "Th\xc3\xa1ng ch\xc3\xadn\0"
+ "Th\xc3\xa1ng m\xc6\xb0\xe1\xbb\x9di\0"
+ "Th\xc3\xa1ng m\xc6\xb0\xe1\xbb\x9di m\xe1\xbb\x99t\0"
+ "Th\xc3\xa1ng m\xc6\xb0\xe1\xbb\x9di hai\0"
+ "Thg 1\0"
+ "Thg 2\0"
+ "Thg 3\0"
+ "Thg 4\0"
+ "Thg 5\0"
+ "Thg 6\0"
+ "Thg 7\0"
+ "Thg 8\0"
+ "Thg 9\0"
+ "Thg 10\0"
+ "Thg 11\0"
+ "Thg 12\0"
+ "MMMM dd, yyyy HH:mm:ss z\0"
+ "\xd4\xb1\xd5\xbc\xe2\x80\xa4\0"
+ "\xd4\xb5\xd6\x80\xe2\x80\xa4\0"
+ "\xd4\xbf\xd5\xab\xd6\x80\xd5\xa1\xd5\xaf\xd5\xab\0"
+ "\xd4\xb5\xd6\x80\xd5\xaf\xd5\xb8\xd6\x82\xd5\xb7\xd5\xa1\xd5\xa2\xd5\xa9\xd5\xab\0"
+ "\xd4\xb5\xd6\x80\xd5\xa5\xd6\x84\xd5\xb7\xd5\xa1\xd5\xa2\xd5\xa9\xd5\xab\0"
+ "\xd5\x89\xd5\xb8\xd6\x80\xd5\xa5\xd6\x84\xd5\xb7\xd5\xa1\xd5\xa2\xd5\xa9\xd5\xab\0"
+ "\xd5\x80\xd5\xab\xd5\xb6\xd5\xa3\xd5\xb7\xd5\xa1\xd5\xa2\xd5\xa9\xd5\xab\0"
+ "\xd5\x88\xd6\x82\xd6\x80\xd5\xa2\xd5\xa1\xd5\xa9\0"
+ "\xd5\x87\xd5\xa1\xd5\xa2\xd5\xa1\xd5\xa9\0"
+ "\xd4\xbf\xd5\xab\xd6\x80\0"
+ "\xd4\xb5\xd6\x80\xd5\xaf\0"
+ "\xd4\xb5\xd6\x80\xd6\x84\0"
+ "\xd5\x89\xd5\xb8\xd6\x80\0"
+ "\xd5\x80\xd5\xb6\xd5\xa3\0"
+ "\xd5\x88\xd6\x82\xd6\x80\0"
+ "\xd5\x87\xd5\xa1\xd5\xa2\0"
+ "\xd5\x85\xd5\xb8\xd6\x82\xd5\xb6\xd5\xb8\xd6\x82\xd5\xa1\xd6\x80\0"
+ "\xd5\x93\xd5\xa5\xd5\xbf\xd6\x80\xd5\xb8\xd6\x82\xd5\xa1\xd6\x80\0"
+ "\xd5\x84\xd5\xa1\xd6\x80\xd5\xbf\0"
+ "\xd4\xb1\xd5\xba\xd6\x80\xd5\xab\xd5\xac\0"
+ "\xd5\x84\xd5\xa1\xd5\xb5\xd5\xab\xd5\xbd\0"
+ "\xd5\x85\xd5\xb8\xd6\x82\xd5\xb6\xd5\xab\xd5\xbd\0"
+ "\xd5\x85\xd5\xb8\xd6\x82\xd5\xac\xd5\xab\xd5\xbd\0"
+ "\xd5\x95\xd5\xa3\xd5\xb8\xd5\xbd\xd5\xbf\xd5\xb8\xd5\xbd\0"
+ "\xd5\x8d\xd5\xa5\xd5\xba\xd5\xbf\xd5\xa5\xd5\xb4\xd5\xa2\xd5\xa5\xd6\x80\0"
+ "\xd5\x80\xd5\xb8\xd5\xaf\xd5\xbf\xd5\xa5\xd5\xb4\xd5\xa2\xd5\xa5\xd6\x80\0"
+ "\xd5\x86\xd5\xb8\xd5\xb5\xd5\xa5\xd5\xb4\xd5\xa2\xd5\xa5\xd6\x80\0"
+ "\xd4\xb4\xd5\xa5\xd5\xaf\xd5\xbf\xd5\xa5\xd5\xb4\xd5\xa2\xd5\xa5\xd6\x80\0"
+ "\xd5\x85\xd5\xb6\xd6\x80\0"
+ "\xd5\x93\xd5\xbf\xd6\x80\0"
+ "\xd5\x84\xd6\x80\xd5\xbf\0"
+ "\xd4\xb1\xd5\xba\xd6\x80\0"
+ "\xd5\x84\xd5\xb5\xd5\xbd\0"
+ "\xd5\x85\xd5\xb6\xd5\xbd\0"
+ "\xd5\x85\xd5\xac\xd5\xbd\0"
+ "\xd5\x95\xd5\xa3\xd5\xbd\0"
+ "\xd5\x8d\xd5\xa5\xd5\xba\0"
+ "\xd5\x80\xd5\xb8\xd5\xaf\0"
+ "\xd5\x86\xd5\xb8\xd5\xb5\0"
+ "\xd4\xb4\xd5\xa5\xd5\xaf\0"
+ "\xd4\xbf\xd5\xa5\xe2\x80\xa4\0"
+ "\xd5\x80\xd5\xb8\xd6\x82\xd5\xb6\xd5\xbe\xd5\xa1\xd6\x80\0"
+ "\xd5\x93\xd5\xa5\xd5\xbf\xd6\x80\xd5\xbe\xd5\xa1\xd6\x80\0"
+ "\xd5\x80\xd5\xb8\xd6\x82\xd5\xb6\xd5\xab\xd5\xbd\0"
+ "\xd5\x80\xd5\xb8\xd6\x82\xd5\xac\xd5\xab\xd5\xbd\0"
+ "\xd5\x80\xd5\xb6\xd5\xbe\0"
+ "\xd5\x93\xd5\xbf\xd5\xbe\0"
+ "\xd5\x80\xd5\xb6\xd5\xbd\0"
+ "\xd5\x80\xd5\xac\xd5\xbd\0"
+ "EEE, yyyy'eko' MMM'ren' dd'a' HH:mm:ss z\0"
+ "EEE, yyyy'eko' MMM'ren' dd'a'\0"
+ "yyyy'eko' MMMM\0"
+ "MMMM'ren' dd\0"
+ "igandea\0"
+ "astelehena\0"
+ "asteartea\0"
+ "asteazkena\0"
+ "osteguna\0"
+ "ostirala\0"
+ "larunbata\0"
+ "ig\0"
+ "al\0"
+ "as\0"
+ "az\0"
+ "og\0"
+ "or\0"
+ "lr\0"
+ "urtarrila\0"
+ "otsaila\0"
+ "martxoa\0"
+ "apirila\0"
+ "maiatza\0"
+ "ekaina\0"
+ "uztaila\0"
+ "abuztua\0"
+ "iraila\0"
+ "urria\0"
+ "azaroa\0"
+ "abendua\0"
+ "urt\0"
+ "ots\0"
+ "api\0"
+ "eka\0"
+ "uzt\0"
+ "abu\0"
+ "ira\0"
+ "urr\0"
+ "aza\0"
+ "abe\0"
+ "dd MMMM yyyy HH:mm:ss z\0"
+ "\xd0\xbd\xd0\xb5\xd0\xb4\xd0\xb5\xd0\xbb\xd0\xb0\0"
+ "\xd1\x87\xd0\xb5\xd1\x82\xd0\xb2\xd1\x80\xd1\x82\xd0\xbe\xd0\xba\0"
+ "\xd0\xbf\xd0\xb5\xd1\x82\xd0\xbe\xd0\xba\0"
+ "\xd1\x81\xd0\xb0\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0\0"
+ "\xd1\x81\xd1\x80\xd0\xb5.\0"
+ "\xd1\x87\xd0\xb5\xd1\x82.\0"
+ "\xd1\x81\xd0\xb0\xd0\xb1.\0"
+ "\xd1\x98\xd0\xb0\xd0\xbd\xd1\x83\xd0\xb0\xd1\x80\xd0\xb8\0"
+ "\xd0\xbc\xd0\xb0\xd1\x98\0"
+ "\xd1\x98\xd1\x83\xd0\xbd\xd0\xb8\0"
+ "\xd1\x98\xd1\x83\xd0\xbb\xd0\xb8\0"
+ "\xd1\x98\xd0\xb0\xd0\xbd.\0"
+ "\xd0\xbc\xd0\xb0\xd1\x80.\0"
+ "\xd0\xbc\xd0\xb0\xd1\x98.\0"
+ "\xd1\x98\xd1\x83\xd0\xbd.\0"
+ "\xd1\x98\xd1\x83\xd0\xbb.\0"
+ "\xd1\x81\xd0\xb5\xd0\xbf\xd1\x82.\0"
+ "\xd0\xb4\xd0\xb5\xd0\xba\xd0\xb5\xd0\xbc.\0"
+ "dd MMMM yyyy h:mm:ss t\0"
+ "Sondag\0"
+ "Maandag\0"
+ "Dinsdag\0"
+ "Woensdag\0"
+ "Donderdag\0"
+ "Vrydag\0"
+ "Saterdag\0"
+ "Wo\0"
+ "Vr\0"
+ "Januarie\0"
+ "Februarie\0"
+ "Maart\0"
+ "Junie\0"
+ "Julie\0"
+ "Augustus\0"
+ "HH.mm.ss\0"
+ "m\xc3\xa1nadagur\0"
+ "t\xc3\xbdsdagur\0"
+ "mikudagur\0"
+ "h\xc3\xb3sdagur\0"
+ "fr\xc3\xadggjadagur\0"
+ "leygardagur\0"
+ "t\xc3\xbds\0"
+ "mik\0"
+ "h\xc3\xb3s\0"
+ "fr\xc3\xad\0"
+ "ley\0"
+ "d MMMM yyyy h:mm:ss t z\0"
+ "\xe0\xa4\xaa\xe0\xa5\x82\xe0\xa4\xb0\xe0\xa5\x8d\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb9\xe0\xa5\x8d\xe0\xa4\xa8\0"
+ "\xe0\xa4\x85\xe0\xa4\xaa\xe0\xa4\xb0\xe0\xa4\xbe\xe0\xa4\xb9\xe0\xa5\x8d\xe0\xa4\xa8\0"
+ "\xe0\xa4\xb0\xe0\xa4\xb5\xe0\xa4\xbf\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xb8\xe0\xa5\x8b\xe0\xa4\xae\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xae\xe0\xa4\x82\xe0\xa4\x97\xe0\xa4\xb2\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xac\xe0\xa5\x81\xe0\xa4\xa7\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\x97\xe0\xa5\x81\xe0\xa4\xb0\xe0\xa5\x81\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xb6\xe0\xa5\x81\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xb6\xe0\xa4\xa8\xe0\xa4\xbf\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xb0\xe0\xa4\xb5\xe0\xa4\xbf\0"
+ "\xe0\xa4\xb8\xe0\xa5\x8b\xe0\xa4\xae\0"
+ "\xe0\xa4\xae\xe0\xa4\x82\xe0\xa4\x97\xe0\xa4\xb2\0"
+ "\xe0\xa4\xac\xe0\xa5\x81\xe0\xa4\xa7\0"
+ "\xe0\xa4\x97\xe0\xa5\x81\xe0\xa4\xb0\xe0\xa5\x81\0"
+ "\xe0\xa4\xb6\xe0\xa5\x81\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\xb0\0"
+ "\xe0\xa4\xb6\xe0\xa4\xa8\xe0\xa4\xbf\0"
+ "\xe0\xa4\x9c\xe0\xa4\xa8\xe0\xa4\xb5\xe0\xa4\xb0\xe0\xa5\x80\0"
+ "\xe0\xa4\xab\xe0\xa4\xb0\xe0\xa4\xb5\xe0\xa4\xb0\xe0\xa5\x80\0"
+ "\xe0\xa4\xae\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa5\x8d\xe0\xa4\x9a\0"
+ "\xe0\xa4\x85\xe0\xa4\xaa\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa5\x88\xe0\xa4\xb2\0"
+ "\xe0\xa4\xae\xe0\xa4\x88\0"
+ "\xe0\xa4\x9c\xe0\xa5\x82\xe0\xa4\xa8\0"
+ "\xe0\xa4\x9c\xe0\xa5\x81\xe0\xa4\xb2\xe0\xa4\xbe\xe0\xa4\x88\0"
+ "\xe0\xa4\x85\xe0\xa4\x97\xe0\xa4\xb8\xe0\xa5\x8d\xe0\xa4\xa4\0"
+ "\xe0\xa4\xb8\xe0\xa4\xbf\xe0\xa4\xa4\xe0\xa4\xae\xe0\xa5\x8d\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "\xe0\xa4\x85\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\xa4\xe0\xa5\x82\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "\xe0\xa4\xa8\xe0\xa4\xb5\xe0\xa4\xae\xe0\xa5\x8d\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "\xe0\xa4\xa6\xe0\xa4\xbf\xe0\xa4\xb8\xe0\xa4\xae\xe0\xa5\x8d\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "yyyy MMMM d HH:mm:ss z\0"
+ "yyyy MMMM d \0"
+ "h.mm.ss tt\0"
+ "yyyy MMMM\0"
+ "Jumapili\0"
+ "Jumatatu\0"
+ "Jumanne\0"
+ "Jumatano\0"
+ "Alhamisi\0"
+ "Ijumaa\0"
+ "Jumamosi\0"
+ "Jpi\0"
+ "Jtt\0"
+ "Jnn\0"
+ "Jtn\0"
+ "Alh\0"
+ "Iju\0"
+ "Jmo\0"
+ "Machi\0"
+ "Aprili\0"
+ "Julai\0"
+ "Agosti\0"
+ "Septemba\0"
+ "Oktoba\0"
+ "Novemba\0"
+ "Desemba\0"
+ "Ago\0"
+ "d MMMM yyyy hh:mm:ss t z\0"
+ "d-MM-yy\0"
+ "hh:mm:ss t z\0"
+ "hh:mm t\0"
+ "\xe0\xaa\xaa\xe0\xab\x82\xe0\xaa\xb0\xe0\xab\x8d\xe0\xaa\xb5\xc2\xa0\xe0\xaa\xae\xe0\xaa\xa7\xe0\xab\x8d\xe0\xaa\xaf\xe0\xaa\xbe\xe0\xaa\xb9\xe0\xab\x8d\xe0\xaa\xa8\0"
+ "\xe0\xaa\x89\xe0\xaa\xa4\xe0\xab\x8d\xe0\xaa\xa4\xe0\xaa\xb0\xc2\xa0\xe0\xaa\xae\xe0\xaa\xa7\xe0\xab\x8d\xe0\xaa\xaf\xe0\xaa\xbe\xe0\xaa\xb9\xe0\xab\x8d\xe0\xaa\xa8\0"
+ "\xe0\xaa\xb0\xe0\xaa\xb5\xe0\xaa\xbf\xe0\xaa\xb5\xe0\xaa\xbe\xe0\xaa\xb0\0"
+ "\xe0\xaa\xb8\xe0\xab\x8b\xe0\xaa\xae\xe0\xaa\xb5\xe0\xaa\xbe\xe0\xaa\xb0\0"
+ "\xe0\xaa\xae\xe0\xaa\x82\xe0\xaa\x97\xe0\xaa\xb3\xe0\xaa\xb5\xe0\xaa\xbe\xe0\xaa\xb0\0"
+ "\xe0\xaa\xac\xe0\xab\x81\xe0\xaa\xa7\xe0\xaa\xb5\xe0\xaa\xbe\xe0\xaa\xb0\0"
+ "\xe0\xaa\x97\xe0\xab\x81\xe0\xaa\xb0\xe0\xab\x81\xe0\xaa\xb5\xe0\xaa\xbe\xe0\xaa\xb0\0"
+ "\xe0\xaa\xb6\xe0\xab\x81\xe0\xaa\x95\xe0\xab\x8d\xe0\xaa\xb0\xe0\xaa\xb5\xe0\xaa\xbe\xe0\xaa\xb0\0"
+ "\xe0\xaa\xb6\xe0\xaa\xa8\xe0\xaa\xbf\xe0\xaa\xb5\xe0\xaa\xbe\xe0\xaa\xb0\0"
+ "\xe0\xaa\xb0\xe0\xaa\xb5\xe0\xaa\xbf\0"
+ "\xe0\xaa\xb8\xe0\xab\x8b\xe0\xaa\xae\0"
+ "\xe0\xaa\xae\xe0\xaa\x82\xe0\xaa\x97\xe0\xaa\xb3\0"
+ "\xe0\xaa\xac\xe0\xab\x81\xe0\xaa\xa7\0"
+ "\xe0\xaa\x97\xe0\xab\x81\xe0\xaa\xb0\xe0\xab\x81\0"
+ "\xe0\xaa\xb6\xe0\xab\x81\xe0\xaa\x95\xe0\xab\x8d\xe0\xaa\xb0\0"
+ "\xe0\xaa\xb6\xe0\xaa\xa8\xe0\xaa\xbf\0"
+ "\xe0\xaa\x9c\xe0\xaa\xbe\xe0\xaa\xa8\xe0\xab\x8d\xe0\xaa\xaf\xe0\xab\x81\xe0\xaa\x86\xe0\xaa\xb0\xe0\xab\x80\0"
+ "\xe0\xaa\xab\xe0\xab\x87\xe0\xaa\xac\xe0\xab\x8d\xe0\xaa\xb0\xe0\xab\x81\xe0\xaa\x86\xe0\xaa\xb0\xe0\xab\x80\0"
+ "\xe0\xaa\xae\xe0\xaa\xbe\xe0\xaa\xb0\xe0\xab\x8d\xe0\xaa\x9a\0"
+ "\xe0\xaa\x8f\xe0\xaa\xaa\xe0\xab\x8d\xe0\xaa\xb0\xe0\xaa\xbf\xe0\xaa\xb2\0"
+ "\xe0\xaa\xae\xe0\xab\x87\0"
+ "\xe0\xaa\x9c\xe0\xab\x82\xe0\xaa\xa8\0"
+ "\xe0\xaa\x9c\xe0\xab\x81\xe0\xaa\xb2\xe0\xaa\xbe\xe0\xaa\x88\0"
+ "\xe0\xaa\x91\xe0\xaa\x97\xe0\xaa\xb8\xe0\xab\x8d\xe0\xaa\x9f\0"
+ "\xe0\xaa\xb8\xe0\xaa\xaa\xe0\xab\x8d\xe0\xaa\x9f\xe0\xab\x87\xe0\xaa\xae\xe0\xab\x8d\xe0\xaa\xac\xe0\xaa\xb0\0"
+ "\xe0\xaa\x91\xe0\xaa\x95\xe0\xab\x8d\xe0\xaa\x9f\xe0\xab\x8d\xe0\xaa\xac\xe0\xaa\xb0\0"
+ "\xe0\xaa\xa8\xe0\xaa\xb5\xe0\xab\x87\xe0\xaa\xae\xe0\xab\x8d\xe0\xaa\xac\xe0\xaa\xb0\0"
+ "\xe0\xaa\xa1\xe0\xaa\xbf\xe0\xaa\xb8\xe0\xab\x87\xe0\xaa\xae\xe0\xab\x8d\xe0\xaa\xac\xe0\xaa\xb0\0"
+ "\xe0\xaa\x9c\xe0\xaa\xbe\xe0\xaa\xa8\xe0\xab\x8d\xe0\xaa\xaf\xe0\xab\x81\0"
+ "\xe0\xaa\xab\xe0\xab\x87\xe0\xaa\xac\xe0\xab\x8d\xe0\xaa\xb0\xe0\xab\x81\0"
+ "\xe0\xaa\xb8\xe0\xaa\xaa\xe0\xab\x8d\xe0\xaa\x9f\xe0\xab\x87\0"
+ "\xe0\xaa\x91\xe0\xaa\x95\xe0\xab\x8d\xe0\xaa\x9f\xe0\xab\x8b\0"
+ "\xe0\xaa\xa8\xe0\xaa\xb5\xe0\xab\x87\0"
+ "\xe0\xaa\xa1\xe0\xaa\xbf\xe0\xaa\xb8\xe0\xab\x87\0"
+ "d-M-yy\0"
+ "h:mm:ss t z\0"
+ "\xe0\xae\x95\xe0\xae\xbe\xe0\xae\xb2\xe0\xaf\x88\0"
+ "\xe0\xae\xae\xe0\xae\xbe\xe0\xae\xb2\xe0\xaf\x88\0"
+ "\xe0\xae\x9e\xe0\xae\xbe\xe0\xae\xaf\xe0\xae\xbf\xe0\xae\xb1\xe0\xaf\x81\0"
+ "\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\x99\xe0\xaf\x8d\xe0\xae\x95\xe0\xae\xb3\xe0\xaf\x8d\0"
+ "\xe0\xae\x9a\xe0\xaf\x86\xe0\xae\xb5\xe0\xaf\x8d\xe0\xae\xb5\xe0\xae\xbe\xe0\xae\xaf\xe0\xaf\x8d\0"
+ "\xe0\xae\xaa\xe0\xaf\x81\xe0\xae\xa4\xe0\xae\xa9\xe0\xaf\x8d\0"
+ "\xe0\xae\xb5\xe0\xae\xbf\xe0\xae\xaf\xe0\xae\xbe\xe0\xae\xb4\xe0\xae\xa9\xe0\xaf\x8d\0"
+ "\xe0\xae\xb5\xe0\xaf\x86\xe0\xae\xb3\xe0\xaf\x8d\xe0\xae\xb3\xe0\xae\xbf\0"
+ "\xe0\xae\x9a\xe0\xae\xa9\xe0\xae\xbf\0"
+ "\xe0\xae\x9e\xe0\xae\xbe\0"
+ "\xe0\xae\xa4\xe0\xae\xbf\0"
+ "\xe0\xae\x9a\xe0\xaf\x86\0"
+ "\xe0\xae\xaa\xe0\xaf\x81\0"
+ "\xe0\xae\xb5\xe0\xae\xbf\0"
+ "\xe0\xae\xb5\xe0\xaf\x86\0"
+ "\xe0\xae\x9a\0"
+ "\xe0\xae\x9c\xe0\xae\xa9\xe0\xae\xb5\xe0\xae\xb0\xe0\xae\xbf\0"
+ "\xe0\xae\xaa\xe0\xae\xbf\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xb0\xe0\xae\xb5\xe0\xae\xb0\xe0\xae\xbf\0"
+ "\xe0\xae\xae\xe0\xae\xbe\xe0\xae\xb0\xe0\xaf\x8d\xe0\xae\x9a\xe0\xaf\x8d\0"
+ "\xe0\xae\x8f\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xb0\xe0\xae\xb2\xe0\xaf\x8d\0"
+ "\xe0\xae\xae\xe0\xaf\x87\0"
+ "\xe0\xae\x9c\xe0\xaf\x82\xe0\xae\xa9\xe0\xaf\x8d\0"
+ "\xe0\xae\x9c\xe0\xaf\x82\xe0\xae\xb2\xe0\xaf\x88\0"
+ "\xe0\xae\x86\xe0\xae\x95\xe0\xae\xb8\xe0\xaf\x8d\xe0\xae\x9f\xe0\xaf\x8d\0"
+ "\xe0\xae\x9a\xe0\xaf\x86\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\x9f\xe0\xae\xae\xe0\xaf\x8d\xe0\xae\xaa\xe0\xae\xb0\xe0\xaf\x8d\0"
+ "\xe0\xae\x85\xe0\xae\x95\xe0\xaf\x8d\xe0\xae\x9f\xe0\xaf\x8b\xe0\xae\xaa\xe0\xae\xb0\xe0\xaf\x8d\0"
+ "\xe0\xae\xa8\xe0\xae\xb5\xe0\xae\xae\xe0\xaf\x8d\xe0\xae\xaa\xe0\xae\xb0\xe0\xaf\x8d\0"
+ "\xe0\xae\x9f\xe0\xae\xbf\xe0\xae\x9a\xe0\xae\xae\xe0\xaf\x8d\xe0\xae\xaa\xe0\xae\xb0\xe0\xaf\x8d\0"
+ "\xe0\xae\x9c\xe0\xae\xa9.\0"
+ "\xe0\xae\xaa\xe0\xae\xbf\xe0\xae\xaa\xe0\xaf\x8d.\0"
+ "\xe0\xae\xae\xe0\xae\xbe\xe0\xae\xb0\xe0\xaf\x8d.\0"
+ "\xe0\xae\x8f\xe0\xae\xaa\xe0\xaf\x8d.\0"
+ "\xe0\xae\x86\xe0\xae\x95.\0"
+ "\xe0\xae\x9a\xe0\xaf\x86\xe0\xae\xaa\xe0\xaf\x8d.\0"
+ "\xe0\xae\x85\xe0\xae\x95\xe0\xaf\x8d.\0"
+ "\xe0\xae\xa8\xe0\xae\xb5.\0"
+ "\xe0\xae\x9f\xe0\xae\xbf\xe0\xae\x9a.\0"
+ "dd-MM-yy\0"
+ "\xe0\xb0\xaa\xe0\xb1\x82\xe0\xb0\xb0\xe0\xb1\x8d\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb9\xe0\xb1\x8d\xe0\xb0\xa8\0"
+ "\xe0\xb0\x85\xe0\xb0\xaa\xe0\xb0\xb0\xe0\xb0\xbe\xe0\xb0\xb9\xe0\xb1\x8d\xe0\xb0\xa8\0"
+ "\xe0\xb0\x86\xe0\xb0\xa6\xe0\xb0\xbf\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\x82\0"
+ "\xe0\xb0\xb8\xe0\xb1\x8b\xe0\xb0\xae\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\x82\0"
+ "\xe0\xb0\xae\xe0\xb0\x82\xe0\xb0\x97\xe0\xb0\xb3\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\x82\0"
+ "\xe0\xb0\xac\xe0\xb1\x81\xe0\xb0\xa7\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\x82\0"
+ "\xe0\xb0\x97\xe0\xb1\x81\xe0\xb0\xb0\xe0\xb1\x81\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\x82\0"
+ "\xe0\xb0\xb6\xe0\xb1\x81\xe0\xb0\x95\xe0\xb1\x8d\xe0\xb0\xb0\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\x82\0"
+ "\xe0\xb0\xb6\xe0\xb0\xa8\xe0\xb0\xbf\xe0\xb0\xb5\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\x82\0"
+ "\xe0\xb0\x86\xe0\xb0\xa6\xe0\xb0\xbf\0"
+ "\xe0\xb0\xb8\xe0\xb1\x8b\xe0\xb0\xae\0"
+ "\xe0\xb0\xae\xe0\xb0\x82\xe0\xb0\x97\xe0\xb0\xb3\0"
+ "\xe0\xb0\xac\xe0\xb1\x81\xe0\xb0\xa7\0"
+ "\xe0\xb0\x97\xe0\xb1\x81\xe0\xb0\xb0\xe0\xb1\x81\0"
+ "\xe0\xb0\xb6\xe0\xb1\x81\xe0\xb0\x95\xe0\xb1\x8d\xe0\xb0\xb0\0"
+ "\xe0\xb0\xb6\xe0\xb0\xa8\xe0\xb0\xbf\0"
+ "\xe0\xb0\x9c\xe0\xb0\xa8\xe0\xb0\xb5\xe0\xb0\xb0\xe0\xb0\xbf\0"
+ "\xe0\xb0\xab\xe0\xb0\xbf\xe0\xb0\xac\xe0\xb1\x8d\xe0\xb0\xb0\xe0\xb0\xb5\xe0\xb0\xb0\xe0\xb0\xbf\0"
+ "\xe0\xb0\xae\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb1\x8d\xe0\xb0\x9a\xe0\xb0\xbf\0"
+ "\xe0\xb0\x8f\xe0\xb0\xaa\xe0\xb1\x8d\xe0\xb0\xb0\xe0\xb0\xbf\xe0\xb0\xb2\xe0\xb1\x8d\0"
+ "\xe0\xb0\xae\xe0\xb1\x87\0"
+ "\xe0\xb0\x9c\xe0\xb1\x82\xe0\xb0\xa8\xe0\xb1\x8d\0"
+ "\xe0\xb0\x9c\xe0\xb1\x82\xe0\xb0\xb2\xe0\xb1\x88\0"
+ "\xe0\xb0\x86\xe0\xb0\x97\xe0\xb0\xb8\xe0\xb1\x8d\xe0\xb0\x9f\xe0\xb1\x81\0"
+ "\xe0\xb0\xb8\xe0\xb1\x86\xe0\xb0\xaa\xe0\xb1\x8d\xe0\xb0\x9f\xe0\xb1\x86\xe0\xb0\x82\xe0\xb0\xac\xe0\xb0\xb0\xe0\xb1\x8d\0"
+ "\xe0\xb0\x85\xe0\xb0\x95\xe0\xb1\x8d\xe0\xb0\x9f\xe0\xb1\x8b\xe0\xb0\xac\xe0\xb0\xb0\xe0\xb1\x8d\0"
+ "\xe0\xb0\xa8\xe0\xb0\xb5\xe0\xb0\x82\xe0\xb0\xac\xe0\xb0\xb0\xe0\xb1\x8d\0"
+ "\xe0\xb0\xa1\xe0\xb0\xbf\xe0\xb0\xb8\xe0\xb1\x86\xe0\xb0\x82\xe0\xb0\xac\xe0\xb0\xb0\xe0\xb1\x8d\0"
+ "\xe0\xb2\xaa\xe0\xb3\x82\xe0\xb2\xb0\xe0\xb3\x8d\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb9\xe0\xb3\x8d\xe0\xb2\xa8\0"
+ "\xe0\xb2\x85\xe0\xb2\xaa\xe0\xb2\xb0\xe0\xb2\xbe\xe0\xb2\xb9\xe0\xb3\x8d\xe0\xb2\xa8\0"
+ "\xe0\xb2\xb0\xe0\xb2\xb5\xe0\xb2\xbf\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb0\0"
+ "\xe0\xb2\xb8\xe0\xb3\x8b\xe0\xb2\xae\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb0\0"
+ "\xe0\xb2\xae\xe0\xb2\x82\xe0\xb2\x97\xe0\xb2\xb3\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb0\0"
+ "\xe0\xb2\xac\xe0\xb3\x81\xe0\xb2\xa7\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb0\0"
+ "\xe0\xb2\x97\xe0\xb3\x81\xe0\xb2\xb0\xe0\xb3\x81\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb0\0"
+ "\xe0\xb2\xb6\xe0\xb3\x81\xe0\xb2\x95\xe0\xb3\x8d\xe0\xb2\xb0\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb0\0"
+ "\xe0\xb2\xb6\xe0\xb2\xa8\xe0\xb2\xbf\xe0\xb2\xb5\xe0\xb2\xbe\xe0\xb2\xb0\0"
+ "\xe0\xb2\xb0.\0"
+ "\xe0\xb2\xb8\xe0\xb3\x8b.\0"
+ "\xe0\xb2\xae\xe0\xb2\x82.\0"
+ "\xe0\xb2\xac\xe0\xb3\x81.\0"
+ "\xe0\xb2\x97\xe0\xb3\x81.\0"
+ "\xe0\xb2\xb6\xe0\xb3\x81.\0"
+ "\xe0\xb2\xb6\xe0\xb2\xa8\xe0\xb2\xbf.\0"
+ "\xe0\xb2\x9c\xe0\xb2\xa8\xe0\xb2\xb5\xe0\xb2\xb0\xe0\xb3\x80\0"
+ "\xe0\xb2\xab\xe0\xb3\x86\xe0\xb2\xac\xe0\xb3\x8d\xe0\xb2\xb0\xe0\xb2\xb5\xe0\xb2\xb0\xe0\xb3\x80\0"
+ "\xe0\xb2\xae\xe0\xb2\xbe\xe0\xb2\xb0\xe0\xb3\x8d\xe0\xb2\x9a\xe0\xb3\x8d\0"
+ "\xe0\xb2\x8e\xe0\xb2\xaa\xe0\xb3\x8d\xe0\xb2\xb0\xe0\xb2\xbf\xe0\xb2\xb2\xe0\xb3\x8d\0"
+ "\xe0\xb2\xae\xe0\xb3\x86\0"
+ "\xe0\xb2\x9c\xe0\xb3\x82\xe0\xb2\xa8\xe0\xb3\x8d\0"
+ "\xe0\xb2\x9c\xe0\xb3\x81\xe0\xb2\xb2\xe0\xb3\x88\0"
+ "\xe0\xb2\x86\xe0\xb2\x97\xe0\xb2\xb8\xe0\xb3\x8d\xe0\xb2\x9f\xe0\xb3\x8d\0"
+ "\xe0\xb2\xb8\xe0\xb2\xaa\xe0\xb3\x8d\xe0\xb2\x9f\xe0\xb3\x86\xe0\xb2\x82\xe0\xb2\xac\xe0\xb2\xb0\xe0\xb3\x8d\0"
+ "\xe0\xb2\x85\xe0\xb2\x95\xe0\xb3\x8d\xe0\xb2\x9f\xe0\xb3\x8b\xe0\xb2\xac\xe0\xb2\xb0\xe0\xb3\x8d\0"
+ "\xe0\xb2\xa8\xe0\xb2\xb5\xe0\xb3\x86\xe0\xb2\x82\xe0\xb2\xac\xe0\xb2\xb0\xe0\xb3\x8d\0"
+ "\xe0\xb2\xa1\xe0\xb2\xbf\xe0\xb2\xb8\xe0\xb3\x86\xe0\xb2\x82\xe0\xb2\xac\xe0\xb2\xb0\xe0\xb3\x8d\0"
+ "\xe0\xa4\xae.\xe0\xa4\xaa\xe0\xa5\x82.\0"
+ "\xe0\xa4\xae.\xe0\xa4\xa8\xe0\xa4\x82.\0"
+ "\xe0\xa4\xae\xe0\xa4\x82\xe0\xa4\x97\xe0\xa4\xb3\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xae\xe0\xa4\x82\xe0\xa4\x97\xe0\xa4\xb3\0"
+ "\xe0\xa4\x9c\xe0\xa4\xbe\xe0\xa4\xa8\xe0\xa5\x87\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa5\x80\0"
+ "\xe0\xa4\xab\xe0\xa5\x87\xe0\xa4\xac\xe0\xa5\x83\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa5\x80\0"
+ "\xe0\xa4\x8f\xe0\xa4\xaa\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa4\xbf\xe0\xa4\xb2\0"
+ "\xe0\xa4\xae\xe0\xa5\x87\0"
+ "\xe0\xa4\x9c\xe0\xa5\x81\xe0\xa4\xb2\xe0\xa5\x88\0"
+ "\xe0\xa4\x93\xe0\xa4\x97\xe0\xa4\xb8\xe0\xa5\x8d\xe0\xa4\x9f\0"
+ "\xe0\xa4\xb8\xe0\xa5\x87\xe0\xa4\xaa\xe0\xa5\x8d\xe0\xa4\x9f\xe0\xa5\x87\xe0\xa4\x82\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "\xe0\xa4\x93\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\x9f\xe0\xa5\x8b\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "\xe0\xa4\xa8\xe0\xa5\x8b\xe0\xa4\xb5\xe0\xa5\x8d\xe0\xa4\xb9\xe0\xa5\x87\xe0\xa4\x82\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "\xe0\xa4\xa1\xe0\xa4\xbf\xe0\xa4\xb8\xe0\xa5\x87\xe0\xa4\x82\xe0\xa4\xac\xe0\xa4\xb0\0"
+ "dd/MM/yy\0"
+ "HH:mm:ss z\0"
+ "Domingo\0"
+ "Luns\0"
+ "Martes\0"
+ "M\xc3\xa9rcores\0"
+ "Xoves\0"
+ "Venres\0"
+ "S\xc3\xa1\x62\x61\x64o\0"
+ "Dom\0"
+ "Lun\0"
+ "M\xc3\xa9r\0"
+ "Xov\0"
+ "Ven\0"
+ "S\xc3\xa1\x62\0"
+ "Xaneiro\0"
+ "Febreiro\0"
+ "Marzo\0"
+ "Abril\0"
+ "Maio\0"
+ "Xu\xc3\xb1o\0"
+ "Xullo\0"
+ "Agosto\0"
+ "Setembro\0"
+ "Outubro\0"
+ "Novembro\0"
+ "Decembro\0"
+ "Xan\0"
+ "Abr\0"
+ "Xu\xc3\xb1\0"
+ "Xul\0"
+ "Set\0"
+ "Out\0"
+ "\xe0\xa4\x86\xe0\xa4\xa6\xe0\xa4\xbf\xe0\xa4\xa4\xe0\xa5\x8d\xe0\xa4\xaf\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xae\xe0\xa4\x82\xe0\xa4\x97\xe0\xa4\xb3\xe0\xa4\xbe\xe0\xa4\xb0\0"
+ "\xe0\xa4\xab\xe0\xa5\x87\xe0\xa4\xac\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa5\x81\xe0\xa4\xb5\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa5\x80\0"
+ "\xd8\xad\0"
+ "\xd9\x86\0"
+ "\xd8\xab\0"
+ "\xd8\xb1\0"
+ "\xd8\xae\0"
+ "\xd8\xac\0"
+ "\xd8\xb3\0"
+ "d' de 'MMMM' de 'yyyy hh:mm:ss t z\0"
+ "a.m.\0"
+ "p.m.\0"
+ "lunes\0"
+ "martes\0"
+ "mi\xc3\xa9rcoles\0"
+ "jueves\0"
+ "viernes\0"
+ "mi\xc3\xa9\0"
+ "jue\0"
+ "vie\0"
+ "enero\0"
+ "febrero\0"
+ "mayo\0"
+ "junio\0"
+ "julio\0"
+ "septiembre\0"
+ "noviembre\0"
+ "diciembre\0"
+ "ene\0"
+ "may\0"
+ "oct\0"
+ "d/MM/yyyy\0"
+ "d' de 'MMMM' de 'yyyy HH:mm:ss z\0"
+ "dd. MMMM yyyy HH:mm:ss z\0"
+ "J\xc3\xa4nner\0"
+ "J\xc3\xa4n\0"
+ "M\xc3\xa4r\0"
+ "d MMMM yyyy h:mm:ss t\0"
+ "MMMM d, yyyy\0"
+ "d' de 'MMMM' de 'yyyy H:mm:ss z\0"
+ "\xd9\x83\xd8\xa7\xd9\x86\xd9\x88\xd9\x86 \xd8\xa7\xd9\x84\xd8\xab\xd8\xa7\xd9\x86\xd9\x8a\0"
+ "\xd8\xb4\xd8\xa8\xd8\xa7\xd8\xb7\0"
+ "\xd8\xa2\xd8\xb0\xd8\xa7\xd8\xb1\0"
+ "\xd9\x86\xd9\x8a\xd8\xb3\xd8\xa7\xd9\x86\0"
+ "\xd9\x86\xd9\x88\xd8\xa7\xd8\xb1\0"
+ "\xd8\xad\xd8\xb2\xd9\x8a\xd8\xb1\xd8\xa7\xd9\x86\0"
+ "\xd8\xaa\xd9\x85\xd9\x88\xd8\xb2\0"
+ "\xd8\xa2\xd8\xa8\0"
+ "\xd8\xa3\xd9\x8a\xd9\x84\xd9\x88\xd9\x84\0"
+ "\xd8\xaa\xd8\xb4\xd8\xb1\xd9\x8a\xd9\x86 \xd8\xa7\xd9\x84\xd8\xa3\xd9\x88\xd9\x84\0"
+ "\xd8\xaa\xd8\xb4\xd8\xb1\xd9\x8a\xd9\x86 \xd8\xa7\xd9\x84\xd8\xab\xd8\xa7\xd9\x86\xd9\x8a\0"
+ "\xd9\x83\xd8\xa7\xd9\x86\xd9\x88\xd9\x86 \xd8\xa7\xd9\x84\xd8\xa3\xd9\x88\xd9\x84\0"
+ "\xd8\xa3\xd9\x8a\xd8\xa7\xd8\xb1\0"
+ "dd' de 'MMMM' de 'yyyy hh:mm:ss t z\0"
+ "dd' de 'MMMM' de 'yyyy\0"
+ "dd' de 'MMMM\0"
+ "\xd9\xab\0"
+ "\xd9\xac\0"
+ "\xd8\xb1.\xd8\xb3.\xe2\x80\x8f\0"
+ "\xd9\xaa\0"
+ "\xef\xbf\xbd\0"
+ "\xe2\x80\xb0\0"
+ "-\xe2\x88\x9e\0"
+ "\xe2\x88\x9e\0"
+ "-\0"
+ "+\0"
+ ",\0"
+ "\xc2\xa0\0"
+ "\xd0\xbb\xd0\xb2.\0"
+ "%\0"
+ ".\0"
+ "\xe2\x82\xac\0"
+ "K\xc4\x8d\0"
+ "kr\0"
+ "$\0"
+ "NaN\0"
+ "-Infinity\0"
+ "Infinity\0"
+ "\xe2\x82\xaa\0"
+ "Ft\0"
+ "kr.\0"
+ "\\\0"
+ "\xef\xbf\xa6\0"
+ "z\xc5\x82\0"
+ "R$ \0"
+ "lei\0"
+ "\xd1\x80.\0"
+ "Kn\0"
+ "Lek\0"
+ "\xe0\xb8\xbf\0"
+ "TL\0"
+ "Rp\0"
+ "\xd0\xb3\xd1\x80\xd0\xbd.\0"
+ "SIT\0"
+ "Ls\0"
+ "Lt\0"
+ "\xef\xb7\xbc\0"
+ "\xc4\x91\0"
+ "Den\0"
+ "\xe0\xa4\xb0\xe0\xa5\x81\0"
+ "KSh\0"
+ "\xe0\xaa\xb0\xe0\xab\x81\0"
+ "\xe0\xae\xb0\xe0\xaf\x82\0"
+ "\xe0\xb0\xb0\xe0\xb1\x82.\0"
+ "\xd8\xaf.\xd8\xb9.\xe2\x80\x8f\0"
+ "'\0"
+ "SFr.\0"
+ "\xc2\xa3\0"
+ "\xd8\xac.\xd9\x85.\xe2\x80\x8f\0"
+ "\xd8\xaf.\xd9\x84.\xe2\x80\x8f\0"
+ "Q\0"
+ "sFr.\0"
+ "\xd8\xaf.\xd8\xac.\xe2\x80\x8f\0"
+ "CRC\0"
+ "\xd8\xaf.\xd9\x85.\xe2\x80\x8f\0"
+ "B/\0"
+ "\xd8\xaf.\xd8\xaa.\xe2\x80\x8f\0"
+ "RD$\0"
+ "\xd8\xb1.\xd8\xb9.\xe2\x80\x8f\0"
+ "Bs\0"
+ "\xd8\xb1.\xd9\x8a.\xe2\x80\x8f\0"
+ "\xd9\x84.\xd8\xb3.\xe2\x80\x8f\0"
+ "S/\0"
+ "\xd8\xaf.\xd8\xa3.\xe2\x80\x8f\0"
+ "\xd9\x84.\xd9\x84.\xe2\x80\x8f\0"
+ "Z$\0"
+ "S/.\0"
+ "\xd8\xaf.\xd9\x83.\xe2\x80\x8f\0"
+ "PHP\0"
+ "\xd8\xaf.\xd8\xa5.\xe2\x80\x8f\0"
+ "NU$\0"
+ "\xd8\xaf.\xd8\xa8.\xe2\x80\x8f\0"
+ "Gs\0"
+ "\xd8\xb1.\xd9\x82.\xe2\x80\x8f\0"
+ "$b\0"
+ "SVC\0"
+ "L.\0"
+ "C$\0"
+ "ar\0"
+ "Arabic\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9\0"
+ "ARA\0"
+ "ara\0"
+ "bg\0"
+ "Bulgarian\0"
+ "\xd0\x91\xd1\x8a\xd0\xbb\xd0\xb3\xd0\xb0\xd1\x80\xd1\x81\xd0\xba\xd0\xb8\0"
+ "BGR\0"
+ "bul\0"
+ "ca\0"
+ "Catalan\0"
+ "catal\xc3\xa0\0"
+ "CAT\0"
+ "cat\0"
+ "cs\0"
+ "Czech\0"
+ "\xc4\x8c\x65\xc5\xa1tina\0"
+ "CSY\0"
+ "ces\0"
+ "da\0"
+ "Danish\0"
+ "Dansk\0"
+ "DAN\0"
+ "dan\0"
+ "de\0"
+ "German\0"
+ "Deutsch\0"
+ "DEU\0"
+ "deu\0"
+ "el\0"
+ "Greek\0"
+ "\xce\x95\xce\xbb\xce\xbb\xce\xb7\xce\xbd\xce\xb9\xce\xba\xce\xac\0"
+ "ELL\0"
+ "ell\0"
+ "en\0"
+ "English\0"
+ "ENU\0"
+ "eng\0"
+ "es\0"
+ "Spanish\0"
+ "espa\xc3\xb1ol\0"
+ "ESP\0"
+ "spa\0"
+ "fi\0"
+ "Finnish\0"
+ "suomi\0"
+ "FIN\0"
+ "fin\0"
+ "French\0"
+ "fran\xc3\xa7\x61is\0"
+ "FRA\0"
+ "fra\0"
+ "he\0"
+ "Hebrew\0"
+ "\xd7\xa2\xd7\x91\xd7\xa8\xd7\x99\xd7\xaa\0"
+ "HEB\0"
+ "heb\0"
+ "hu\0"
+ "Hungarian\0"
+ "magyar\0"
+ "HUN\0"
+ "hun\0"
+ "is\0"
+ "Icelandic\0"
+ "\xc3\xadslenska\0"
+ "ISL\0"
+ "isl\0"
+ "it\0"
+ "Italian\0"
+ "italiano\0"
+ "ITA\0"
+ "ita\0"
+ "ja\0"
+ "Japanese\0"
+ "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e\0"
+ "JPN\0"
+ "jpn\0"
+ "ko\0"
+ "Korean\0"
+ "\xed\x95\x9c\xea\xb5\xad\xec\x96\xb4\0"
+ "KOR\0"
+ "kor\0"
+ "nl\0"
+ "Dutch\0"
+ "Nederlands\0"
+ "NLD\0"
+ "nld\0"
+ "pl\0"
+ "Polish\0"
+ "polski\0"
+ "PLK\0"
+ "pol\0"
+ "pt\0"
+ "Portuguese\0"
+ "portugu\xc3\xaas\0"
+ "PTB\0"
+ "por\0"
+ "ro\0"
+ "Romanian\0"
+ "Rom\xc3\xa2n\xc4\x83\0"
+ "ROM\0"
+ "ron\0"
+ "ru\0"
+ "Russian\0"
+ "\xd0\xa0\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9\0"
+ "RUS\0"
+ "rus\0"
+ "hr\0"
+ "Croatian\0"
+ "hrvatski\0"
+ "HRV\0"
+ "hrv\0"
+ "sk\0"
+ "Slovak\0"
+ "slovensk\xc3\xbd\0"
+ "SKY\0"
+ "slk\0"
+ "sq\0"
+ "Albanian\0"
+ "shqipe\0"
+ "SQI\0"
+ "sqi\0"
+ "sv\0"
+ "Swedish\0"
+ "svenska\0"
+ "SVE\0"
+ "swe\0"
+ "th\0"
+ "Thai\0"
+ "\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
+ "THA\0"
+ "tha\0"
+ "tr\0"
+ "Turkish\0"
+ "T\xc3\xbcrk\xc3\xa7\x65\0"
+ "TRK\0"
+ "tur\0"
+ "id\0"
+ "Indonesian\0"
+ "Bahasa Indonesia\0"
+ "IND\0"
+ "ind\0"
+ "uk\0"
+ "Ukrainian\0"
+ "\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd1\x81\xd1\x8c\xd0\xba\xd0\xb0\0"
+ "UKR\0"
+ "ukr\0"
+ "be\0"
+ "Belarusian\0"
+ "\xd0\x91\xd0\xb5\xd0\xbb\xd0\xb0\xd1\x80\xd1\x83\xd1\x81\xd0\xba\xd1\x96\0"
+ "BEL\0"
+ "bel\0"
+ "sl\0"
+ "Slovenian\0"
+ "Sloven\xc5\xa1\xc4\x8dina\0"
+ "SLV\0"
+ "slv\0"
+ "et\0"
+ "Estonian\0"
+ "Eesti\0"
+ "ETI\0"
+ "est\0"
+ "lv\0"
+ "Latvian\0"
+ "latvie\xc5\xa1u\0"
+ "LVI\0"
+ "lav\0"
+ "lt\0"
+ "Lithuanian\0"
+ "Lietuvi\xc5\xb3\0"
+ "LTH\0"
+ "lit\0"
+ "fa\0"
+ "Persian\0"
+ "\xd9\x81\xd8\xa7\xd8\xb1\xd8\xb3\xdb\x8c\0"
+ "FAR\0"
+ "fas\0"
+ "vi\0"
+ "Vietnamese\0"
+ "Ti\xe1\xba\xbfng Vi\xe1\xbb\x87t\0"
+ "VIT\0"
+ "hy\0"
+ "Armenian\0"
+ "\xd5\x80\xd5\xa1\xd5\xb5\xd5\xa5\xd6\x80\xd5\xa7\xd5\xb6\0"
+ "HYE\0"
+ "hye\0"
+ "eu\0"
+ "Basque\0"
+ "euskara\0"
+ "EUQ\0"
+ "eus\0"
+ "mk\0"
+ "Macedonian\0"
+ "\xd0\xbc\xd0\xb0\xd0\xba\xd0\xb5\xd0\xb4\xd0\xbe\xd0\xbd\xd1\x81\xd0\xba\xd0\xb8\0"
+ "MKI\0"
+ "mkd\0"
+ "af\0"
+ "Afrikaans\0"
+ "Afrikaanse\0"
+ "AFK\0"
+ "afr\0"
+ "fo\0"
+ "Faroese\0"
+ "f\xc3\xb8royskt\0"
+ "FOS\0"
+ "fao\0"
+ "hi\0"
+ "Hindi\0"
+ "\xe0\xa4\xb9\xe0\xa4\xbf\xe0\xa4\x82\xe0\xa4\xa6\xe0\xa5\x80\0"
+ "HIN\0"
+ "hin\0"
+ "sw\0"
+ "Swahili\0"
+ "Kiswahili\0"
+ "SWK\0"
+ "swa\0"
+ "gu\0"
+ "Gujarati\0"
+ "\xe0\xaa\x97\xe0\xab\x81\xe0\xaa\x9c\xe0\xaa\xb0\xe0\xaa\xbe\xe0\xaa\xa4\xe0\xab\x80\0"
+ "GUJ\0"
+ "guj\0"
+ "ta\0"
+ "Tamil\0"
+ "\xe0\xae\xa4\xe0\xae\xae\xe0\xae\xbf\xe0\xae\xb4\xe0\xaf\x8d\0"
+ "TAM\0"
+ "tam\0"
+ "te\0"
+ "Telugu\0"
+ "\xe0\xb0\xa4\xe0\xb1\x86\xe0\xb0\xb2\xe0\xb1\x81\xe0\xb0\x97\xe0\xb1\x81\0"
+ "TEL\0"
+ "tel\0"
+ "kn\0"
+ "Kannada\0"
+ "\xe0\xb2\x95\xe0\xb2\xa8\xe0\xb3\x8d\xe0\xb2\xa8\xe0\xb2\xa1\0"
+ "KAN\0"
+ "kan\0"
+ "mr\0"
+ "Marathi\0"
+ "\xe0\xa4\xae\xe0\xa4\xb0\xe0\xa4\xbe\xe0\xa4\xa0\xe0\xa5\x80\0"
+ "MAR\0"
+ "gl\0"
+ "Gallegan\0"
+ "galego\0"
+ "GLC\0"
+ "glg\0"
+ "kok\0"
+ "Konkani\0"
+ "\xe0\xa4\x95\xe0\xa5\x8b\xe0\xa4\x82\xe0\xa4\x95\xe0\xa4\xa3\xe0\xa5\x80\0"
+ "KNK\0"
+ "ar-SA\0"
+ "Arabic (Saudi Arabia)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 \xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xd9\x8a\xd8\xa9)\0"
+ "bg-BG\0"
+ "Bulgarian (Bulgaria)\0"
+ "\xd0\x91\xd1\x8a\xd0\xbb\xd0\xb3\xd0\xb0\xd1\x80\xd1\x81\xd0\xba\xd0\xb8 (\xd0\x91\xd1\x8a\xd0\xbb\xd0\xb3\xd0\xb0\xd1\x80\xd0\xb8\xd1\x8f)\0"
+ "ca-ES\0"
+ "Catalan (Spain)\0"
+ "catal\xc3\xa0 (Espanya)\0"
+ "cs-CZ\0"
+ "Czech (Czech Republic)\0"
+ "\xc4\x8c\x65\xc5\xa1tina (\xc4\x8c\x65sk\xc3\xa1 republika)\0"
+ "da-DK\0"
+ "Danish (Denmark)\0"
+ "Dansk (Danmark)\0"
+ "de-DE\0"
+ "German (Germany)\0"
+ "Deutsch (Deutschland)\0"
+ "el-GR\0"
+ "Greek (Greece)\0"
+ "\xce\x95\xce\xbb\xce\xbb\xce\xb7\xce\xbd\xce\xb9\xce\xba\xce\xac (\xce\x95\xce\xbb\xce\xbb\xce\xac\xce\xb4\xce\xb1)\0"
+ "en-US\0"
+ "English (United States)\0"
+ "fi-FI\0"
+ "Finnish (Finland)\0"
+ "suomi (Suomi)\0"
+ "fr-FR\0"
+ "French (France)\0"
+ "fran\xc3\xa7\x61is (France)\0"
+ "he-IL\0"
+ "Hebrew (Israel)\0"
+ "\xd7\xa2\xd7\x91\xd7\xa8\xd7\x99\xd7\xaa (\xd7\x99\xd7\xa9\xd7\xa8\xd7\x90\xd7\x9c)\0"
+ "hu-HU\0"
+ "Hungarian (Hungary)\0"
+ "magyar (Magyarorsz\xc3\xa1g)\0"
+ "is-IS\0"
+ "Icelandic (Iceland)\0"
+ "\xc3\xadslenska (\xc3\x8dsland)\0"
+ "it-IT\0"
+ "Italian (Italy)\0"
+ "italiano (Italia)\0"
+ "ja-JP\0"
+ "Japanese (Japan)\0"
+ "\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (\xe6\x97\xa5\xe6\x9c\xac)\0"
+ "ko-KR\0"
+ "Korean (South Korea)\0"
+ "\xed\x95\x9c\xea\xb5\xad\xec\x96\xb4 (\xeb\x8c\x80\xed\x95\x9c\xeb\xaf\xbc\xea\xb5\xad)\0"
+ "nl-NL\0"
+ "Dutch (Netherlands)\0"
+ "Nederlands (Nederland)\0"
+ "pl-PL\0"
+ "Polish (Poland)\0"
+ "polski (Polska)\0"
+ "pt-BR\0"
+ "Portuguese (Brazil)\0"
+ "portugu\xc3\xaas (Brasil)\0"
+ "ro-RO\0"
+ "Romanian (Romania)\0"
+ "Rom\xc3\xa2n\xc4\x83 (Rom\xc3\xa2nia)\0"
+ "ru-RU\0"
+ "Russian (Russia)\0"
+ "\xd0\xa0\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9 (\xd0\xa0\xd0\xbe\xd1\x81\xd1\x81\xd0\xb8\xd1\x8f)\0"
+ "hr-HR\0"
+ "Croatian (Croatia)\0"
+ "hrvatski (Hrvatska)\0"
+ "sk-SK\0"
+ "Slovak (Slovakia)\0"
+ "slovensk\xc3\xbd (Slovensk\xc3\xa1 republika)\0"
+ "sq-AL\0"
+ "Albanian (Albania)\0"
+ "shqipe (Shqip\xc3\xabria)\0"
+ "sv-SE\0"
+ "Swedish (Sweden)\0"
+ "svenska (Sverige)\0"
+ "th-TH\0"
+ "Thai (Thailand)\0"
+ "\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2 (\xe0\xb8\x9b\xe0\xb8\xa3\xe0\xb8\xb0\xe0\xb9\x80\xe0\xb8\x97\xe0\xb8\xa8\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2)\0"
+ "tr-TR\0"
+ "Turkish (Turkey)\0"
+ "T\xc3\xbcrk\xc3\xa7\x65 (T\xc3\xbcrkiye)\0"
+ "id-ID\0"
+ "Indonesian (Indonesia)\0"
+ "Bahasa Indonesia (Indonesia)\0"
+ "uk-UA\0"
+ "Ukrainian (Ukraine)\0"
+ "\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd1\x81\xd1\x8c\xd0\xba\xd0\xb0 (\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0)\0"
+ "be-BY\0"
+ "Belarusian (Belarus)\0"
+ "\xd0\x91\xd0\xb5\xd0\xbb\xd0\xb0\xd1\x80\xd1\x83\xd1\x81\xd0\xba\xd1\x96 (\xd0\x91\xd0\xb5\xd0\xbb\xd0\xb0\xd1\x80\xd1\x83\xd1\x81\xd1\x8c)\0"
+ "sl-SI\0"
+ "Slovenian (Slovenia)\0"
+ "Sloven\xc5\xa1\xc4\x8dina (Slovenija)\0"
+ "et-EE\0"
+ "Estonian (Estonia)\0"
+ "Eesti (Eesti)\0"
+ "lv-LV\0"
+ "Latvian (Latvia)\0"
+ "latvie\xc5\xa1u (Latvija)\0"
+ "lt-LT\0"
+ "Lithuanian (Lithuania)\0"
+ "Lietuvi\xc5\xb3 (Lietuva)\0"
+ "fa-IR\0"
+ "Persian (Iran)\0"
+ "\xd9\x81\xd8\xa7\xd8\xb1\xd8\xb3\xdb\x8c (\xd8\xa7\xdb\x8c\xd8\xb1\xd8\xa7\xd9\x86)\0"
+ "vi-VN\0"
+ "Vietnamese (Vietnam)\0"
+ "Ti\xe1\xba\xbfng Vi\xe1\xbb\x87t (Vi\xe1\xbb\x87t Nam)\0"
+ "hy-AM\0"
+ "Armenian (Armenia)\0"
+ "\xd5\x80\xd5\xa1\xd5\xb5\xd5\xa5\xd6\x80\xd5\xa7\xd5\xb6 (\xd5\x80\xd5\xa1\xd5\xb5\xd5\xa1\xd5\xbd\xd5\xbf\xd5\xa1\xd5\xb6\xd5\xab \xd5\x80\xd5\xa1\xd5\xb6\xd6\x80\xd5\xa1\xd5\xba\xd5\xa5\xd5\xbf\xd5\xb8\xd6\x82\xd5\xa9\xd5\xab\xd6\x82\xd5\xb6)\0"
+ "eu-ES\0"
+ "Basque (Spain)\0"
+ "euskara (Espainia)\0"
+ "mk-MK\0"
+ "Macedonian (Macedonia)\0"
+ "\xd0\xbc\xd0\xb0\xd0\xba\xd0\xb5\xd0\xb4\xd0\xbe\xd0\xbd\xd1\x81\xd0\xba\xd0\xb8 (\xd0\x9c\xd0\xb0\xd0\xba\xd0\xb5\xd0\xb4\xd0\xbe\xd0\xbd\xd0\xb8\xd1\x98\xd0\xb0)\0"
+ "af-ZA\0"
+ "Afrikaans (South Africa)\0"
+ "Afrikaanse (Suid-Afrika)\0"
+ "fo-FO\0"
+ "Faroese (Faroe Islands)\0"
+ "f\xc3\xb8royskt (F\xc3\xb8royar)\0"
+ "hi-IN\0"
+ "Hindi (India)\0"
+ "\xe0\xa4\xb9\xe0\xa4\xbf\xe0\xa4\x82\xe0\xa4\xa6\xe0\xa5\x80 (\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa4\xa4)\0"
+ "sw-KE\0"
+ "Swahili (Kenya)\0"
+ "Kiswahili (Kenya)\0"
+ "gu-IN\0"
+ "Gujarati (India)\0"
+ "\xe0\xaa\x97\xe0\xab\x81\xe0\xaa\x9c\xe0\xaa\xb0\xe0\xaa\xbe\xe0\xaa\xa4\xe0\xab\x80 (\xe0\xaa\xad\xe0\xaa\xbe\xe0\xaa\xb0\xe0\xaa\xa4)\0"
+ "ta-IN\0"
+ "Tamil (India)\0"
+ "\xe0\xae\xa4\xe0\xae\xae\xe0\xae\xbf\xe0\xae\xb4\xe0\xaf\x8d (\xe0\xae\x87\xe0\xae\xa8\xe0\xaf\x8d\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\xaf\xe0\xae\xbe)\0"
+ "te-IN\0"
+ "Telugu (India)\0"
+ "\xe0\xb0\xa4\xe0\xb1\x86\xe0\xb0\xb2\xe0\xb1\x81\xe0\xb0\x97\xe0\xb1\x81 (\xe0\xb0\xad\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\xa4 \xe0\xb0\xa6\xe0\xb1\x87\xe0\xb0\xb3\xe0\xb1\xa6)\0"
+ "kn-IN\0"
+ "Kannada (India)\0"
+ "\xe0\xb2\x95\xe0\xb2\xa8\xe0\xb3\x8d\xe0\xb2\xa8\xe0\xb2\xa1 (\xe0\xb2\xad\xe0\xb2\xbe\xe0\xb2\xb0\xe0\xb2\xa4)\0"
+ "mr-IN\0"
+ "Marathi (India)\0"
+ "\xe0\xa4\xae\xe0\xa4\xb0\xe0\xa4\xbe\xe0\xa4\xa0\xe0\xa5\x80 (\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa4\xa4)\0"
+ "gl-ES\0"
+ "Gallegan (Spain)\0"
+ "galego (Espa\xc3\xb1\x61)\0"
+ "kok-IN\0"
+ "Konkani (India)\0"
+ "\xe0\xa4\x95\xe0\xa5\x8b\xe0\xa4\x82\xe0\xa4\x95\xe0\xa4\xa3\xe0\xa5\x80 (\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa4\xa4)\0"
+ "ar-IQ\0"
+ "Arabic (Iraq)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa7\xd9\x82)\0"
+ "ARI\0"
+ "de-CH\0"
+ "German (Switzerland)\0"
+ "Deutsch (Schweiz)\0"
+ "DES\0"
+ "en-GB\0"
+ "English (United Kingdom)\0"
+ "ENG\0"
+ "es-MX\0"
+ "Spanish (Mexico)\0"
+ "espa\xc3\xb1ol (M\xc3\xa9xico)\0"
+ "ESM\0"
+ "fr-BE\0"
+ "French (Belgium)\0"
+ "fran\xc3\xa7\x61is (Belgique)\0"
+ "FRB\0"
+ "it-CH\0"
+ "Italian (Switzerland)\0"
+ "italiano (Svizzera)\0"
+ "ITS\0"
+ "nl-BE\0"
+ "Dutch (Belgium)\0"
+ "Nederlands (Belgi\xc3\xab)\0"
+ "NLB\0"
+ "pt-PT\0"
+ "Portuguese (Portugal)\0"
+ "portugu\xc3\xaas (Portugal)\0"
+ "PTG\0"
+ "sv-FI\0"
+ "Swedish (Finland)\0"
+ "svenska (Finland)\0"
+ "SVF\0"
+ "ar-EG\0"
+ "Arabic (Egypt)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd9\x85\xd8\xb5\xd8\xb1)\0"
+ "ARE\0"
+ "de-AT\0"
+ "German (Austria)\0"
+ "Deutsch (\xc3\x96sterreich)\0"
+ "DEA\0"
+ "en-AU\0"
+ "English (Australia)\0"
+ "ENA\0"
+ "es-ES\0"
+ "Spanish (Spain)\0"
+ "espa\xc3\xb1ol (Espa\xc3\xb1\x61)\0"
+ "ESN\0"
+ "fr-CA\0"
+ "French (Canada)\0"
+ "fran\xc3\xa7\x61is (Canada)\0"
+ "FRC\0"
+ "ar-LY\0"
+ "Arabic (Libya)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd9\x84\xd9\x8a\xd8\xa8\xd9\x8a\xd8\xa7)\0"
+ "ARL\0"
+ "de-LU\0"
+ "German (Luxembourg)\0"
+ "Deutsch (Luxemburg)\0"
+ "DEL\0"
+ "en-CA\0"
+ "English (Canada)\0"
+ "ENC\0"
+ "es-GT\0"
+ "Spanish (Guatemala)\0"
+ "espa\xc3\xb1ol (Guatemala)\0"
+ "ESG\0"
+ "fr-CH\0"
+ "French (Switzerland)\0"
+ "fran\xc3\xa7\x61is (Suisse)\0"
+ "FRS\0"
+ "ar-DZ\0"
+ "Arabic (Algeria)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd8\xac\xd8\xb2\xd8\xa7\xd8\xa6\xd8\xb1)\0"
+ "ARG\0"
+ "en-NZ\0"
+ "English (New Zealand)\0"
+ "ENZ\0"
+ "es-CR\0"
+ "Spanish (Costa Rica)\0"
+ "espa\xc3\xb1ol (Costa Rica)\0"
+ "ESC\0"
+ "fr-LU\0"
+ "French (Luxembourg)\0"
+ "fran\xc3\xa7\x61is (Luxembourg)\0"
+ "FRL\0"
+ "ar-MA\0"
+ "Arabic (Morocco)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd9\x85\xd8\xba\xd8\xb1\xd8\xa8)\0"
+ "ARM\0"
+ "en-IE\0"
+ "English (Ireland)\0"
+ "ENI\0"
+ "es-PA\0"
+ "Spanish (Panama)\0"
+ "espa\xc3\xb1ol (Panam\xc3\xa1)\0"
+ "ESA\0"
+ "ar-TN\0"
+ "Arabic (Tunisia)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xaa\xd9\x88\xd9\x86\xd8\xb3)\0"
+ "ART\0"
+ "en-ZA\0"
+ "English (South Africa)\0"
+ "ENS\0"
+ "es-DO\0"
+ "Spanish (Dominican Republic)\0"
+ "espa\xc3\xb1ol (Rep\xc3\xba\x62lica Dominicana)\0"
+ "ESD\0"
+ "ar-OM\0"
+ "Arabic (Oman)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xb9\xd9\x85\xd8\xa7\xd9\x86)\0"
+ "ARO\0"
+ "es-VE\0"
+ "Spanish (Venezuela)\0"
+ "espa\xc3\xb1ol (Venezuela)\0"
+ "ESV\0"
+ "ar-YE\0"
+ "Arabic (Yemen)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd9\x8a\xd9\x85\xd9\x86)\0"
+ "ARY\0"
+ "es-CO\0"
+ "Spanish (Colombia)\0"
+ "espa\xc3\xb1ol (Colombia)\0"
+ "ESO\0"
+ "ar-SY\0"
+ "Arabic (Syria)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xb3\xd9\x88\xd8\xb1\xd9\x8a\xd8\xa9)\0"
+ "ARS\0"
+ "es-PE\0"
+ "Spanish (Peru)\0"
+ "espa\xc3\xb1ol (Per\xc3\xba)\0"
+ "ESR\0"
+ "ar-JO\0"
+ "Arabic (Jordan)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd8\xa7\xd8\xb1\xd8\xaf\xd9\x86)\0"
+ "ARJ\0"
+ "es-AR\0"
+ "Spanish (Argentina)\0"
+ "espa\xc3\xb1ol (Argentina)\0"
+ "ESS\0"
+ "ar-LB\0"
+ "Arabic (Lebanon)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd9\x84\xd8\xa8\xd9\x86\xd8\xa7\xd9\x86)\0"
+ "ARB\0"
+ "en-ZW\0"
+ "English (Zimbabwe)\0"
+ "ENW\0"
+ "es-EC\0"
+ "Spanish (Ecuador)\0"
+ "espa\xc3\xb1ol (Ecuador)\0"
+ "ESF\0"
+ "ar-KW\0"
+ "Arabic (Kuwait)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd9\x83\xd9\x88\xd9\x8a\xd8\xaa)\0"
+ "ARK\0"
+ "en-PH\0"
+ "English (Philippines)\0"
+ "ENP\0"
+ "es-CL\0"
+ "Spanish (Chile)\0"
+ "espa\xc3\xb1ol (Chile)\0"
+ "ESL\0"
+ "ar-AE\0"
+ "Arabic (United Arab Emirates)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd8\xa7\xd9\x85\xd8\xa7\xd8\xb1\xd8\xa7\xd8\xaa \xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 \xd8\xa7\xd9\x84\xd9\x85\xd8\xaa\xd8\xad\xd8\xaf\xd8\xa9)\0"
+ "ARU\0"
+ "es-UY\0"
+ "Spanish (Uruguay)\0"
+ "espa\xc3\xb1ol (Uruguay)\0"
+ "ESY\0"
+ "ar-BH\0"
+ "Arabic (Bahrain)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd8\xa7\xd9\x84\xd8\xa8\xd8\xad\xd8\xb1\xd9\x8a\xd9\x86)\0"
+ "ARH\0"
+ "es-PY\0"
+ "Spanish (Paraguay)\0"
+ "espa\xc3\xb1ol (Paraguay)\0"
+ "ESZ\0"
+ "ar-QA\0"
+ "Arabic (Qatar)\0"
+ "\xd8\xa7\xd9\x84\xd8\xb9\xd8\xb1\xd8\xa8\xd9\x8a\xd8\xa9 (\xd9\x82\xd8\xb7\xd8\xb1)\0"
+ "ARQ\0"
+ "es-BO\0"
+ "Spanish (Bolivia)\0"
+ "espa\xc3\xb1ol (Bolivia)\0"
+ "ESB\0"
+ "es-SV\0"
+ "Spanish (El Salvador)\0"
+ "espa\xc3\xb1ol (El Salvador)\0"
+ "ESE\0"
+ "es-HN\0"
+ "Spanish (Honduras)\0"
+ "espa\xc3\xb1ol (Honduras)\0"
+ "ESH\0"
+ "es-NI\0"
+ "Spanish (Nicaragua)\0"
+ "espa\xc3\xb1ol (Nicaragua)\0"
+ "ESI\0"
+ "es-PR\0"
+ "Spanish (Puerto Rico)\0"
+ "espa\xc3\xb1ol (Puerto Rico)\0"
+ "ESU\0"
+ "af-za\0"
+ "ar-ae\0"
+ "ar-bh\0"
+ "ar-dz\0"
+ "ar-eg\0"
+ "ar-iq\0"
+ "ar-jo\0"
+ "ar-kw\0"
+ "ar-lb\0"
+ "ar-ly\0"
+ "ar-ma\0"
+ "ar-om\0"
+ "ar-qa\0"
+ "ar-sa\0"
+ "ar-sy\0"
+ "ar-tn\0"
+ "ar-ye\0"
+ "be-by\0"
+ "bg-bg\0"
+ "ca-es\0"
+ "cs-cz\0"
+ "da-dk\0"
+ "de-at\0"
+ "de-ch\0"
+ "de-de\0"
+ "de-lu\0"
+ "el-gr\0"
+ "en-au\0"
+ "en-ca\0"
+ "en-gb\0"
+ "en-ie\0"
+ "en-nz\0"
+ "en-ph\0"
+ "en-us\0"
+ "en-za\0"
+ "en-zw\0"
+ "es-ar\0"
+ "es-bo\0"
+ "es-cl\0"
+ "es-co\0"
+ "es-cr\0"
+ "es-do\0"
+ "es-ec\0"
+ "es-es\0"
+ "es-gt\0"
+ "es-hn\0"
+ "es-mx\0"
+ "es-ni\0"
+ "es-pa\0"
+ "es-pe\0"
+ "es-pr\0"
+ "es-py\0"
+ "es-sv\0"
+ "es-uy\0"
+ "es-ve\0"
+ "et-ee\0"
+ "eu-es\0"
+ "fa-ir\0"
+ "fi-fi\0"
+ "fo-fo\0"
+ "fr-be\0"
+ "fr-ca\0"
+ "fr-ch\0"
+ "fr-fr\0"
+ "fr-lu\0"
+ "gl-es\0"
+ "gu-in\0"
+ "he-il\0"
+ "hi-in\0"
+ "hr-hr\0"
+ "hu-hu\0"
+ "hy-am\0"
+ "id-id\0"
+ "is-is\0"
+ "it-ch\0"
+ "it-it\0"
+ "ja-jp\0"
+ "kn-in\0"
+ "ko-kr\0"
+ "kok-in\0"
+ "lt-lt\0"
+ "lv-lv\0"
+ "mk-mk\0"
+ "mr-in\0"
+ "nl-be\0"
+ "nl-nl\0"
+ "pl-pl\0"
+ "pt-br\0"
+ "pt-pt\0"
+ "ro-ro\0"
+ "ru-ru\0"
+ "sk-sk\0"
+ "sl-si\0"
+ "sq-al\0"
+ "sv-fi\0"
+ "sv-se\0"
+ "sw-ke\0"
+ "ta-in\0"
+ "te-in\0"
+ "th-th\0"
+ "tr-tr\0"
+ "uk-ua\0"
+ "vi-vn\0"
+};
+
+
+#endif
+
diff --git a/mono/metadata/culture-info.h b/mono/metadata/culture-info.h
new file mode 100644
index 00000000000..f6e688faeee
--- /dev/null
+++ b/mono/metadata/culture-info.h
@@ -0,0 +1,109 @@
+
+#ifndef _MONO_METADATA_CULTURE_INFO_H_
+#define _MONO_METADATA_CULTURE_INFO_H_ 1
+
+#include <glib.h>
+
+#define NUM_DAYS 7
+#define NUM_MONTHS 13
+#define GROUP_SIZE 5
+#define NUM_OPT_CALS 5
+
+#define NUM_SHORT_DATE_PATTERNS 14
+#define NUM_LONG_DATE_PATTERNS 8
+#define NUM_SHORT_TIME_PATTERNS 5
+#define NUM_LONG_TIME_PATTERNS 6
+
+#define idx2string(idx) (locale_strings + (idx))
+
+/* need to change this if the string data ends up to not fit in a 64KB array. */
+typedef guint16 stridx_t;
+
+typedef struct {
+ const stridx_t full_date_time_pattern;
+ const stridx_t long_date_pattern;
+ const stridx_t short_date_pattern;
+ const stridx_t long_time_pattern;
+ const stridx_t short_time_pattern;
+ const stridx_t year_month_pattern;
+ const stridx_t month_day_pattern;
+
+ const stridx_t am_designator;
+ const stridx_t pm_designator;
+
+ const stridx_t day_names [NUM_DAYS];
+ const stridx_t abbreviated_day_names [NUM_DAYS];
+ const stridx_t month_names [NUM_MONTHS];
+ const stridx_t abbreviated_month_names [NUM_MONTHS];
+
+ gint calendar_week_rule;
+ gint first_day_of_week;
+
+ const stridx_t date_separator;
+ const stridx_t time_separator;
+
+ const stridx_t short_date_patterns [NUM_SHORT_DATE_PATTERNS];
+ const stridx_t long_date_patterns [NUM_LONG_DATE_PATTERNS];
+ const stridx_t short_time_patterns [NUM_SHORT_TIME_PATTERNS];
+ const stridx_t long_time_patterns [NUM_LONG_TIME_PATTERNS];
+} DateTimeFormatEntry;
+
+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 stridx_t currency_symbol;
+ const stridx_t percent_symbol;
+ const stridx_t nan_symbol;
+ const stridx_t per_mille_symbol;
+ const stridx_t negative_infinity_symbol;
+ const stridx_t positive_infinity_symbol;
+
+ const stridx_t negative_sign;
+ const stridx_t positive_sign;
+
+ gint currency_negative_pattern;
+ gint currency_positive_pattern;
+ gint percent_negative_pattern;
+ gint percent_positive_pattern;
+ gint number_negative_pattern;
+
+ gint currency_decimal_digits;
+ gint percent_decimal_digits;
+ gint 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;
+
+typedef struct {
+ gint lcid;
+ gint parent_lcid;
+ gint specific_lcid;
+ const stridx_t name;
+ const stridx_t icu_name;
+ const stridx_t englishname;
+ const stridx_t displayname;
+ const stridx_t nativename;
+ const stridx_t win3lang;
+ const stridx_t iso3lang;
+ const stridx_t iso2lang;
+
+ gint calendar_data [NUM_OPT_CALS];
+
+ gint16 datetime_format_index;
+ gint16 number_format_index;
+} CultureInfoEntry;
+
+typedef struct {
+ const stridx_t name;
+ gint16 culture_entry_index;
+} CultureInfoNameEntry;
+
+#endif
+
diff --git a/mono/metadata/debug-helpers.c b/mono/metadata/debug-helpers.c
index d00934e0f4e..5cdc10ce68f 100644
--- a/mono/metadata/debug-helpers.c
+++ b/mono/metadata/debug-helpers.c
@@ -2,6 +2,7 @@
#include <string.h>
#include "mono/metadata/tokentype.h"
#include "mono/metadata/opcodes.h"
+#include "mono/metadata/class-internals.h"
#include "mono/metadata/mono-endian.h"
#include "mono/metadata/debug-helpers.h"
@@ -14,6 +15,43 @@ struct MonoMethodDesc {
gboolean include_namespace;
};
+static const char *wrapper_type_names [] = {
+ "none",
+ "delegate-invoke",
+ "delegate-begin-invoke",
+ "delegate-end-invoke",
+ "runtime-invoke",
+ "native-to-managed",
+ "managed-to-native",
+ "remoting-invoke",
+ "remoting-invoke-with-check",
+ "ldfld",
+ "stfld",
+ "synchronized",
+ "dynamic-method",
+ "isinst",
+ "cancast",
+ "proxy_isinst",
+ "stelemref",
+ "unknown"
+};
+
+static void
+append_class_name (GString *res, MonoClass *class, gboolean include_namespace)
+{
+ if (!class) {
+ g_string_append (res, "Unknown");
+ return;
+ }
+ if (class->nested_in) {
+ append_class_name (res, class->nested_in, include_namespace);
+ g_string_append_c (res, '/');
+ }
+ if (include_namespace && *(class->name_space))
+ g_string_sprintfa (res, "%s.", class->name_space);
+ g_string_sprintfa (res, "%s", class->name);
+}
+
void
mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace) {
switch (type->type) {
@@ -58,25 +96,20 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace) {
g_string_append_c (res, '*');
break;
case MONO_TYPE_ARRAY:
- mono_type_get_desc (res, type->data.array->type, include_namespace);
+ append_class_name (res, type->data.array->eklass, include_namespace);
g_string_sprintfa (res, "[%d]", type->data.array->rank);
break;
case MONO_TYPE_SZARRAY:
- mono_type_get_desc (res, type->data.type, include_namespace);
+ mono_type_get_desc (res, &type->data.klass->byval_arg, include_namespace);
g_string_append (res, "[]");
break;
case MONO_TYPE_CLASS:
- case MONO_TYPE_VALUETYPE: {
- MonoClass *class = type->data.klass;
- if (!class) {
- g_string_append (res, "Unknown");
- break;
- }
- if (include_namespace && *(class->name_space))
- g_string_sprintfa (res, "%s.", class->name_space);
- g_string_sprintfa (res, "%s", class->name);
+ case MONO_TYPE_VALUETYPE:
+ append_class_name (res, type->data.klass, include_namespace);
+ break;
+ case MONO_TYPE_GENERICINST:
+ mono_type_get_desc (res, type->data.generic_inst->generic_type, include_namespace);
break;
- }
default:
break;
}
@@ -85,6 +118,20 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace) {
}
char*
+mono_type_full_name (MonoType *type)
+{
+ GString *str;
+ char *res;
+
+ str = g_string_new ("");
+ mono_type_get_desc (str, type, TRUE);
+
+ res = g_strdup (str->str);
+ g_string_free (str, TRUE);
+ return res;
+}
+
+char*
mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace)
{
int i;
@@ -101,10 +148,17 @@ mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace)
return result;
}
-/*
- * The allowed format of a method description string is:
+/**
+ * mono_method_desc_new:
+ *
+ * Creates a method description for `name', which conforms to the following
+ * specification:
+ *
* [namespace.]classname:methodname[(args...)]
- * TODO: describe instance methods.
+ *
+ * in all the loaded assemblies.
+ *
+ * Returns a parsed representation of the method description.
*/
MonoMethodDesc*
mono_method_desc_new (const char *name, gboolean include_namespace)
@@ -154,12 +208,32 @@ mono_method_desc_new (const char *name, gboolean include_namespace)
while (*end) {
if (*end == ',')
result->num_args++;
+ ++end;
}
}
return result;
}
+MonoMethodDesc*
+mono_method_desc_from_method (MonoMethod *method)
+{
+ MonoMethodDesc *result;
+
+ result = g_new0 (MonoMethodDesc, 1);
+ result->include_namespace = TRUE;
+ result->name = g_strdup (method->name);
+ result->klass = g_strdup (method->klass->name);
+ result->namespace = g_strdup (method->klass->name_space);
+
+ return result;
+}
+
+/**
+ * mono_method_desc_free:
+ *
+ * Releases the MonoMethodDesc object `desc'.
+ */
void
mono_method_desc_free (MonoMethodDesc *desc)
{
@@ -219,8 +293,8 @@ MonoMethod*
mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
{
MonoClass *klass;
- MonoTableInfo *tdef;
- MonoTableInfo *methods;
+ const MonoTableInfo *tdef;
+ const MonoTableInfo *methods;
MonoMethod *method;
int i;
@@ -231,9 +305,9 @@ mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
return mono_method_desc_search_in_class (desc, klass);
}
- tdef = &image->tables [MONO_TABLE_TYPEDEF];
- methods = &image->tables [MONO_TABLE_METHOD];
- for (i = 0; i < methods->rows; ++i) {
+ tdef = mono_image_get_table_info (image, MONO_TABLE_TYPEDEF);
+ methods = mono_image_get_table_info (image, MONO_TABLE_METHOD);
+ for (i = 0; i < mono_table_info_get_rows (methods); ++i) {
guint32 token = mono_metadata_decode_row_col (methods, i, MONO_METHOD_NAME);
const char *n = mono_metadata_string_heap (image, token);
@@ -247,9 +321,9 @@ mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
}
static const unsigned char*
-dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned char *ip)
+dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned char *ip, const unsigned char *end)
{
- MonoMethodHeader *header = ((MonoMethodNormal*)method)->header;
+ MonoMethodHeader *header = mono_method_get_header (method);
const MonoOpcode *opcode;
guint32 i, label, token;
gint32 sval;
@@ -264,14 +338,10 @@ dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned cha
if (dh->label_format)
g_string_sprintfa (str, dh->label_format, label);
- i = *ip;
- if (*ip == 0xfe) {
- ip++;
- i = *ip + 256;
- }
- ++ip;
+ i = mono_opcode_value (&ip, end);
+ ip++;
opcode = &mono_opcodes [i];
- g_string_sprintfa (str, "%-10s", mono_opcode_names [i]);
+ g_string_sprintfa (str, "%-10s", mono_opcode_name (i));
switch (opcode->argument) {
case MonoInlineNone:
@@ -383,14 +453,17 @@ default_dh = {
};
char*
-mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip)
+mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar **endp)
{
char *result;
GString *res = g_string_new ("");
if (!dh)
dh = &default_dh;
- dis_one (res, dh, method, ip);
+ /* set ip + 2 as the end: this is just a debugging method */
+ ip = dis_one (res, dh, method, ip, ip + 2);
+ if (endp)
+ *endp = ip;
result = res->str;
g_string_free (res, FALSE);
@@ -406,7 +479,7 @@ mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const
if (!dh)
dh = &default_dh;
while (ip < end) {
- ip = dis_one (res, dh, method, ip);
+ ip = dis_one (res, dh, method, ip, end);
}
result = res->str;
@@ -414,3 +487,58 @@ mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const
return result;
}
+static const char*
+wrapper_type_to_str (guint32 wrapper_type)
+{
+ g_assert (wrapper_type < sizeof (wrapper_type_names) / sizeof (char*));
+
+ return wrapper_type_names [wrapper_type];
+}
+
+char *
+mono_method_full_name (MonoMethod *method, gboolean signature)
+{
+ char *res;
+ char wrapper [64];
+ const char *nspace = method->klass->name_space;
+
+ if (signature) {
+ char *tmpsig = mono_signature_get_desc (method->signature, TRUE);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ sprintf (wrapper, "(wrapper %s) ", wrapper_type_to_str (method->wrapper_type));
+ else
+ strcpy (wrapper, "");
+ res = g_strdup_printf ("%s%s%s%s:%s (%s)", wrapper,
+ nspace, *nspace ? "." : "",
+ method->klass->name, method->name, tmpsig);
+ g_free (tmpsig);
+ } else {
+
+ res = g_strdup_printf ("%02d %s%s%s:%s", method->wrapper_type,
+ nspace, *nspace ? "." : "",
+ method->klass->name, method->name);
+ }
+
+ return res;
+}
+
+MonoMethod *
+mono_find_method_by_name (MonoClass *klass, const char *name, int param_count)
+{
+ MonoMethod *res = NULL;
+ int i;
+
+ mono_class_init (klass);
+
+ for (i = 0; i < klass->method.count; ++i) {
+ if (klass->methods [i]->name[0] == name [0] &&
+ !strcmp (name, klass->methods [i]->name) &&
+ klass->methods [i]->signature->param_count == param_count) {
+ res = klass->methods [i];
+ break;
+ }
+ }
+ return res;
+}
+
diff --git a/mono/metadata/debug-helpers.h b/mono/metadata/debug-helpers.h
index 0903c1ce354..9a0f887f955 100644
--- a/mono/metadata/debug-helpers.h
+++ b/mono/metadata/debug-helpers.h
@@ -18,20 +18,27 @@ struct MonoDisHelper {
gpointer user_data;
};
-char* mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip);
+char* mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar** endp);
char* mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar* end);
typedef struct MonoMethodDesc MonoMethodDesc;
void mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace);
+char* mono_type_full_name (MonoType *type);
+
char* mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace);
MonoMethodDesc* mono_method_desc_new (const char *name, gboolean include_namespace);
+MonoMethodDesc*mono_method_desc_from_method (MonoMethod *method);
void mono_method_desc_free (MonoMethodDesc *desc);
gboolean mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method);
gboolean mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method);
MonoMethod* mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass);
MonoMethod* mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image);
+char* mono_method_full_name (MonoMethod *method, gboolean signature);
+
+MonoMethod * mono_find_method_by_name (MonoClass *klass, const char *name, int param_count);
+
#endif /* __MONO_DEBUG_HELPERS_H__ */
diff --git a/mono/metadata/debug-mono-symfile.c b/mono/metadata/debug-mono-symfile.c
new file mode 100644
index 00000000000..69ed072183e
--- /dev/null
+++ b/mono/metadata/debug-mono-symfile.c
@@ -0,0 +1,295 @@
+#include <config.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/param.h>
+#include <mono/metadata/metadata.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/rawbuffer.h>
+#include <mono/metadata/tokentype.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/debug-mono-symfile.h>
+#include <mono/metadata/mono-endian.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#define RANGE_TABLE_CHUNK_SIZE 256
+#define CLASS_TABLE_CHUNK_SIZE 256
+#define TYPE_TABLE_PTR_CHUNK_SIZE 256
+#define TYPE_TABLE_CHUNK_SIZE 65536
+
+static void
+free_method_info (MonoDebugMethodInfo *minfo)
+{
+ g_free (minfo);
+}
+
+static gchar *
+get_class_name (MonoClass *klass)
+{
+ MonoClass *nested_in = mono_class_get_nesting_type (klass);
+ const char *name_space;
+ if (nested_in) {
+ gchar *parent_name = get_class_name (nested_in);
+ gchar *name = g_strdup_printf ("%s.%s", parent_name, mono_class_get_name (klass));
+ g_free (parent_name);
+ return name;
+ }
+
+ name_space = mono_class_get_namespace (klass);
+ return g_strdup_printf ("%s%s%s", name_space,
+ name_space [0] ? "." : "", mono_class_get_name (klass));
+}
+
+static int
+load_symfile (MonoDebugHandle *handle, MonoSymbolFile *symfile)
+{
+ const char *ptr, *start;
+ gchar *guid;
+ guint64 magic;
+ long version;
+
+ ptr = start = symfile->raw_contents;
+ if (!ptr)
+ return FALSE;
+
+ magic = read64(ptr);
+ ptr += sizeof(guint64);
+ if (magic != MONO_SYMBOL_FILE_MAGIC) {
+ g_warning ("Symbol file %s is not a mono symbol file", symfile->filename);
+ return FALSE;
+ }
+
+ version = read32(ptr);
+ ptr += sizeof(guint32);
+ if (version != MONO_SYMBOL_FILE_VERSION) {
+ g_warning ("Symbol file %s has incorrect version "
+ "(expected %d, got %ld)", symfile->filename,
+ MONO_SYMBOL_FILE_VERSION, version);
+ return FALSE;
+ }
+
+ guid = mono_guid_to_string ((const guint8 *) ptr);
+ ptr += 16;
+
+ if (strcmp (handle->image->guid, guid)) {
+ g_warning ("Symbol file %s doesn't match image %s", symfile->filename,
+ handle->image_file);
+ return FALSE;
+ }
+
+ symfile->offset_table = (MonoSymbolFileOffsetTable *) ptr;
+
+ symfile->method_hash = g_hash_table_new_full (
+ g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) free_method_info);
+
+ return TRUE;
+}
+
+MonoSymbolFile *
+mono_debug_open_mono_symbol_file (MonoDebugHandle *handle, gboolean create_symfile)
+{
+ MonoSymbolFile *symfile;
+
+ mono_loader_lock ();
+ symfile = g_new0 (MonoSymbolFile, 1);
+
+ symfile->filename = g_strdup_printf ("%s.mdb", mono_image_get_filename (handle->image));
+
+ if (!g_file_get_contents (symfile->filename, (gchar **) &symfile->raw_contents,
+ &symfile->raw_contents_size, NULL))
+ symfile->raw_contents = NULL;
+
+ if (load_symfile (handle, symfile)) {
+ mono_loader_unlock ();
+ return symfile;
+ } else if (!create_symfile) {
+ mono_debug_close_mono_symbol_file (symfile);
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ mono_loader_unlock ();
+ return symfile;
+}
+
+void
+mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile)
+{
+ if (!symfile)
+ return;
+
+ mono_loader_lock ();
+ if (symfile->method_hash)
+ g_hash_table_destroy (symfile->method_hash);
+
+ g_free (symfile);
+ mono_loader_unlock ();
+}
+
+static int
+read_leb128 (const char *ptr, const char **rptr)
+{
+ int ret = 0;
+ int shift = 0;
+ char b;
+
+ do {
+ b = *ptr++;
+
+ ret = ret | ((b & 0x7f) << shift);
+ shift += 7;
+ } while ((b & 0x80) == 0x80);
+
+ if (rptr)
+ *rptr = ptr;
+
+ return ret;
+}
+
+static gchar *
+read_string (const char *ptr)
+{
+ int len = read_leb128 (ptr, &ptr);
+ return g_filename_from_utf8 (ptr, len, NULL, NULL, NULL);
+}
+
+gchar *
+mono_debug_find_source_location (MonoSymbolFile *symfile, MonoMethod *method, guint32 offset,
+ guint32 *line_number)
+{
+ MonoSymbolFileLineNumberEntry *lne;
+ MonoDebugMethodInfo *minfo;
+ gchar *source_file = NULL;
+ const char *ptr;
+ int i;
+
+ mono_loader_lock ();
+ if (!symfile->method_hash) {
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ minfo = g_hash_table_lookup (symfile->method_hash, method);
+ if (!minfo) {
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ if (read32(&(minfo->entry->_source_index))) {
+ int offset = read32(&(symfile->offset_table->_source_table_offset)) +
+ (read32(&(minfo->entry->_source_index)) - 1) * sizeof (MonoSymbolFileSourceEntry);
+ MonoSymbolFileSourceEntry *se = (MonoSymbolFileSourceEntry *) (symfile->raw_contents + offset);
+
+ source_file = read_string (symfile->raw_contents + read32(&(se->_name_offset)));
+ }
+
+ ptr = symfile->raw_contents + read32(&(minfo->entry->_line_number_table_offset));
+
+ lne = (MonoSymbolFileLineNumberEntry *) ptr;
+
+ for (i = 0; i < read32(&(minfo->entry->_num_line_numbers)); i++, lne++) {
+ if (read32(&(lne->_offset)) < offset)
+ continue;
+
+ if (line_number) {
+ *line_number = read32(&(lne->_row));
+ mono_loader_unlock ();
+ if (source_file)
+ return source_file;
+ else
+ return NULL;
+ } else if (source_file) {
+ gchar *retval = g_strdup_printf ("%s:%d", source_file, read32(&(lne->_row)));
+ g_free (source_file);
+ mono_loader_unlock ();
+ return retval;
+ } else {
+ gchar* retval = g_strdup_printf ("%d", read32(&(lne->_row)));
+ mono_loader_unlock ();
+ return retval;
+ }
+ }
+
+ mono_loader_unlock ();
+ return NULL;
+}
+
+gint32
+_mono_debug_address_from_il_offset (MonoDebugMethodJitInfo *jit, guint32 il_offset)
+{
+ int i;
+
+ if (!jit || !jit->line_numbers)
+ return -1;
+
+ for (i = jit->line_numbers->len - 1; i >= 0; i--) {
+ MonoDebugLineNumberEntry lne = g_array_index (
+ jit->line_numbers, MonoDebugLineNumberEntry, i);
+
+ if (lne.offset <= il_offset)
+ return lne.address;
+ }
+
+ return -1;
+}
+
+static int
+compare_method (const void *key, const void *object)
+{
+ guint32 token = GPOINTER_TO_UINT (key);
+ MonoSymbolFileMethodIndexEntry *me = (MonoSymbolFileMethodIndexEntry*)object;
+
+ return token - read32(&(me->_token));
+}
+
+MonoDebugMethodInfo *
+mono_debug_find_method (MonoDebugHandle *handle, MonoMethod *method)
+{
+ MonoSymbolFileMethodEntry *me;
+ MonoSymbolFileMethodIndexEntry *first_ie, *ie;
+ MonoDebugMethodInfo *minfo;
+ MonoSymbolFile *symfile = handle->symfile;
+
+ if (!symfile->method_hash)
+ return NULL;
+
+ if (handle->image != mono_class_get_image (mono_method_get_class (method)))
+ return NULL;
+
+ mono_loader_lock ();
+ first_ie = (MonoSymbolFileMethodIndexEntry *)
+ (symfile->raw_contents + read32(&(symfile->offset_table->_method_table_offset)));
+
+ ie = bsearch (GUINT_TO_POINTER (mono_method_get_token (method)), first_ie,
+ read32(&(symfile->offset_table->_method_count)),
+ sizeof (MonoSymbolFileMethodIndexEntry), compare_method);
+
+ if (!ie) {
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ me = (MonoSymbolFileMethodEntry *) (symfile->raw_contents + read32(&(ie->_file_offset)));
+
+ minfo = g_new0 (MonoDebugMethodInfo, 1);
+ minfo->index = (ie - first_ie) + 1;
+ minfo->method = method;
+ minfo->handle = handle;
+ minfo->num_il_offsets = read32(&(me->_num_line_numbers));
+ minfo->il_offsets = (MonoSymbolFileLineNumberEntry *)
+ (symfile->raw_contents + read32(&(me->_line_number_table_offset)));
+ minfo->entry = me;
+
+ g_hash_table_insert (symfile->method_hash, method, minfo);
+
+ mono_loader_unlock ();
+ return minfo;
+}
diff --git a/mono/metadata/debug-mono-symfile.h b/mono/metadata/debug-mono-symfile.h
new file mode 100644
index 00000000000..18353d751a3
--- /dev/null
+++ b/mono/metadata/debug-mono-symfile.h
@@ -0,0 +1,151 @@
+/*
+ * This header is only installed for use by the debugger:
+ * the structures and the API declared here are not supported.
+ */
+
+#ifndef __MONO_DEBUG_MONO_SYMFILE_H__
+#define __MONO_DEBUG_MONO_SYMFILE_H__
+
+#include <glib.h>
+#include <mono/metadata/class.h>
+#include <mono/metadata/reflection.h>
+#include <mono/metadata/mono-debug.h>
+
+typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable;
+typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry;
+typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry;
+typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress;
+typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable;
+typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry;
+typedef struct MonoSymbolFileMethodIndexEntry MonoSymbolFileMethodIndexEntry;
+typedef struct MonoSymbolFileLexicalBlockEntry MonoSymbolFileLexicalBlockEntry;
+
+typedef struct MonoDebugMethodInfo MonoDebugMethodInfo;
+typedef struct MonoDebugLexicalBlockEntry MonoDebugLexicalBlockEntry;
+typedef struct MonoDebugLineNumberEntry MonoDebugLineNumberEntry;
+
+/* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
+struct MonoSymbolFileOffsetTable {
+ guint32 _total_file_size;
+ guint32 _data_section_offset;
+ guint32 _data_section_size;
+ guint32 _source_count;
+ guint32 _source_table_offset;
+ guint32 _source_table_size;
+ guint32 _method_count;
+ guint32 _method_table_offset;
+ guint32 _method_table_size;
+ guint32 _type_count;
+};
+
+struct MonoSymbolFileMethodEntry {
+ guint32 _source_index;
+ guint32 _token;
+ guint32 _start_row;
+ guint32 _end_row;
+ guint32 _num_locals;
+ guint32 _num_line_numbers;
+ guint32 _name_offset;
+ guint32 _type_index_table_offset;
+ guint32 _local_variable_table_offset;
+ guint32 _line_number_table_offset;
+ guint32 _num_lexical_blocks;
+ guint32 _lexical_block_table_offset;
+ guint32 _namespace_idx;
+ guint32 _local_names_ambiguous;
+};
+
+struct MonoSymbolFileSourceEntry {
+ guint32 _index;
+ guint32 _num_methods;
+ guint32 _num_namespaces;
+ guint32 _name_offset;
+ guint32 _method_offset;
+ guint32 _nstable_offset;
+};
+
+struct MonoSymbolFileMethodIndexEntry {
+ guint32 _file_offset;
+ guint32 _token;
+};
+
+struct MonoSymbolFileMethodAddress {
+ guint32 size;
+ const guint8 *start_address;
+ const guint8 *end_address;
+ const guint8 *method_start_address;
+ const guint8 *method_end_address;
+ const guint8 *wrapper_address;
+ guint32 has_this;
+ guint32 num_params;
+ guint32 variable_table_offset;
+ guint32 type_table_offset;
+ guint32 num_line_numbers;
+ guint32 line_number_offset;
+ guint32 lexical_block_table_offset;
+ guint8 data [MONO_ZERO_LEN_ARRAY];
+};
+
+struct MonoSymbolFileLexicalBlockEntry {
+ guint32 _start_offset;
+ guint32 _end_offset;
+};
+
+struct MonoSymbolFileLineNumberEntry {
+ guint32 _row;
+ guint32 _offset;
+};
+
+struct MonoDebugMethodInfo {
+ MonoMethod *method;
+ MonoDebugHandle *handle;
+ guint32 index;
+ guint32 num_il_offsets;
+ MonoSymbolFileLineNumberEntry *il_offsets;
+ MonoSymbolFileMethodEntry *entry;
+};
+
+struct MonoDebugLexicalBlockEntry {
+ guint32 start_address;
+ guint32 end_address;
+};
+
+struct MonoDebugLineNumberEntry {
+ guint32 offset;
+ guint32 address;
+};
+
+struct _MonoSymbolFile {
+ const guint8 *raw_contents;
+ int raw_contents_size;
+ gchar *filename;
+ GHashTable *method_hash;
+ MonoSymbolFileOffsetTable *offset_table;
+};
+
+#define MONO_SYMBOL_FILE_VERSION 38
+#define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
+
+MonoSymbolFile *
+mono_debug_open_mono_symbol_file (MonoDebugHandle *handle,
+ gboolean create_symfile);
+
+void
+mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
+
+gchar *
+mono_debug_find_source_location (MonoSymbolFile *symfile,
+ MonoMethod *method,
+ guint32 offset,
+ guint32 *line_number);
+
+gint32
+_mono_debug_address_from_il_offset (MonoDebugMethodJitInfo *jit,
+ guint32 il_offset);
+
+MonoDebugMethodInfo *
+mono_debug_find_method (MonoDebugHandle *handle,
+ MonoMethod *method);
+
+#endif /* __MONO_SYMFILE_H__ */
+
diff --git a/mono/metadata/debug-symfile.c b/mono/metadata/debug-symfile.c
deleted file mode 100644
index bd7c705adc6..00000000000
--- a/mono/metadata/debug-symfile.c
+++ /dev/null
@@ -1,856 +0,0 @@
-#include <config.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/rawbuffer.h>
-#include <mono/metadata/tokentype.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/exception.h>
-#include <mono/metadata/debug-symfile.h>
-
-#include <fcntl.h>
-#include <unistd.h>
-
-#ifdef HAVE_ELF_H
-#include <elf.h>
-#endif
-
-/* Keep in sync with Mono.CSharp.Debugger.MonoDwarfFileWriter */
-#define MRT_none 0x00
-#define MRT_target_address_size 0x01
-#define MRT_il_offset 0x02
-#define MRT_method_start_address 0x03
-#define MRT_method_end_address 0x04
-#define MRT_local_variable 0x05
-#define MRT_method_parameter 0x06
-#define MRT_type_sizeof 0x07
-#define MRT_type_field_offset 0x08
-#define MRT_mono_string_sizeof 0x09
-#define MRT_mono_string_offset 0x0a
-#define MRT_mono_array_sizeof 0x0b
-#define MRT_mono_array_offset 0x0c
-#define MRT_mono_array_bounds_sizeof 0x0d
-#define MRT_mono_array_bounds_offset 0x0e
-#define MRT_variable_start_scope 0x0f
-#define MRT_variable_end_scope 0x10
-#define MRT_mono_string_fieldsize 0x11
-#define MRT_mono_array_fieldsize 0x12
-#define MRT_type_field_fieldsize 0x13
-
-#define MRI_string_offset_length 0x00
-#define MRI_string_offset_chars 0x01
-
-#define MRI_array_offset_bounds 0x00
-#define MRI_array_offset_max_length 0x01
-#define MRI_array_offset_vector 0x02
-
-#define MRI_array_bounds_offset_lower 0x00
-#define MRI_array_bounds_offset_length 0x01
-
-#define MRS_debug_info 0x01
-#define MRS_debug_abbrev 0x02
-#define MRS_debug_line 0x03
-#define MRS_mono_reloc_table 0x04
-
-#define DW_OP_const4s 0x0d
-#define DW_OP_plus 0x22
-#define DW_OP_reg0 0x50
-#define DW_OP_breg0 0x70
-#define DW_OP_fbreg 0x91
-#define DW_OP_piece 0x93
-#define DW_OP_nop 0x96
-
-#ifdef HAVE_ELF_H
-
-static gboolean
-get_sections_elf32 (MonoDebugSymbolFile *symfile, gboolean emit_warnings)
-{
- Elf32_Ehdr *header;
- Elf32_Shdr *section, *strtab_section;
- const char *strtab;
- int i;
-
- header = (Elf32_Ehdr *)symfile->raw_contents;
- if (header->e_version != EV_CURRENT) {
- if (emit_warnings)
- g_warning ("Symbol file %s has unknown ELF version %d",
- symfile->file_name, header->e_version);
- return FALSE;
- }
-
- if (header->e_machine != EM_386) {
- if (emit_warnings)
- g_warning ("ELF file %s is for unknown architecture %d",
- symfile->file_name, header->e_machine);
- return FALSE;
- }
-
- if (header->e_shentsize != sizeof (*section)) {
- if (emit_warnings)
- g_warning ("ELF file %s has unknown section header size "
- "(expected %d, got %d)", symfile->file_name,
- sizeof (*section), header->e_shentsize);
- return FALSE;
- }
-
- symfile->section_offsets = g_new0 (MonoDebugSymbolFileSection, MONO_DEBUG_SYMBOL_SECTION_MAX);
-
- section = (Elf32_Shdr *)(symfile->raw_contents + header->e_shoff);
- strtab_section = section + header->e_shstrndx;
- strtab = symfile->raw_contents + strtab_section->sh_offset;
-
- for (i = 0; i < header->e_shnum; i++, section++) {
- const gchar *name = strtab + section->sh_name;
-
- if (!strcmp (name, ".debug_info")) {
- MonoDebugSymbolFileSection *sfs;
-
- sfs = &symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_DEBUG_INFO];
- sfs->type = MONO_DEBUG_SYMBOL_SECTION_DEBUG_INFO;
- sfs->file_offset = section->sh_offset;
- sfs->size = section->sh_size;
- } else if (!strcmp (name, ".debug_line")) {
- MonoDebugSymbolFileSection *sfs;
-
- sfs = &symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_DEBUG_LINE];
- sfs->type = MONO_DEBUG_SYMBOL_SECTION_DEBUG_LINE;
- sfs->file_offset = section->sh_offset;
- sfs->size = section->sh_size;
- } else if (!strcmp (name, ".debug_abbrev")) {
- MonoDebugSymbolFileSection *sfs;
-
- sfs = &symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_DEBUG_ABBREV];
- sfs->type = MONO_DEBUG_SYMBOL_SECTION_DEBUG_ABBREV;
- sfs->file_offset = section->sh_offset;
- sfs->size = section->sh_size;
- } else if (!strcmp (name, ".mono_reloc_table")) {
- MonoDebugSymbolFileSection *sfs;
-
- sfs = &symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_MONO_RELOC_TABLE];
- sfs->type = MONO_DEBUG_SYMBOL_SECTION_MONO_RELOC_TABLE;
- sfs->file_offset = section->sh_offset;
- sfs->size = section->sh_size;
- } else if (!strcmp (name, ".mono_line_numbers")) {
- MonoDebugSymbolFileSection *sfs;
-
- sfs = &symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_MONO_LINE_NUMBERS];
- sfs->type = MONO_DEBUG_SYMBOL_SECTION_MONO_LINE_NUMBERS;
- sfs->file_offset = section->sh_offset;
- sfs->size = section->sh_size;
- }
- }
-
- return TRUE;
-}
-
-#endif /* HAVE_ELF_H */
-
-static gboolean
-get_sections (MonoDebugSymbolFile *symfile, gboolean emit_warnings)
-{
-#ifdef HAVE_ELF_H
-#ifdef __FreeBSD__
- static const char ELFMAG[] = { ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, 0 };
-#endif
- if (!strncmp (symfile->raw_contents, ELFMAG, strlen (ELFMAG)))
- return get_sections_elf32 (symfile, emit_warnings);
-#endif
-
- if (emit_warnings)
- g_warning ("Symbol file %s has unknown file format", symfile->file_name);
-
- return FALSE;
-}
-
-static void
-read_line_numbers (MonoDebugSymbolFile *symfile)
-{
- const char *ptr, *start, *end;
- int version;
- long section_size;
-
- if (!symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_MONO_LINE_NUMBERS].file_offset)
- return;
-
- ptr = start = symfile->raw_contents +
- symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_MONO_LINE_NUMBERS].file_offset;
-
- version = *((guint16 *) ptr)++;
- if (version != MONO_DEBUG_SYMBOL_FILE_VERSION) {
- g_warning ("Symbol file %s has incorrect line number table version "
- "(expected %d, got %d)", symfile->file_name,
- MONO_DEBUG_SYMBOL_FILE_VERSION, version);
- return;
- }
-
- section_size = *((guint32 *) ptr)++;
- end = ptr + section_size;
-
- symfile->line_number_table = g_hash_table_new_full (g_direct_hash, g_direct_equal,
- NULL, (GDestroyNotify) g_free);
-
- while (ptr < end) {
- MonoDebugLineNumberBlock *lnb;
- guint32 token, source_offset;
- MonoMethod *method;
-
- token = * ((guint32 *) ptr)++;
- method = mono_get_method (symfile->image, token, NULL);
- if (!method)
- continue;
-
- lnb = g_new0 (MonoDebugLineNumberBlock, 1);
- lnb->token = token;
- source_offset = * ((guint32 *) ptr)++;
- lnb->source_file = (const char *) start + source_offset;
- lnb->start_line = * ((guint32 *) ptr)++;
- lnb->file_offset = * ((guint32 *) ptr)++;
-
- g_hash_table_insert (symfile->line_number_table, method, lnb);
- }
-}
-
-static MonoClass *
-mono_debug_class_get (MonoDebugSymbolFile *symfile, guint32 type_token)
-{
- MonoClass *klass;
-
- if ((klass = g_hash_table_lookup (symfile->image->class_cache, GUINT_TO_POINTER (type_token))))
- return klass;
-
- return NULL;
-}
-
-MonoDebugSymbolFile *
-mono_debug_open_symbol_file (MonoImage *image, const char *filename, gboolean emit_warnings)
-{
- MonoDebugSymbolFile *symfile;
- off_t file_size;
- void *ptr;
- int fd;
-
- fd = open (filename, O_RDWR);
- if (fd == -1) {
- if (emit_warnings)
- g_warning ("Can't open symbol file: %s", filename);
- return NULL;
- }
-
- file_size = lseek (fd, 0, SEEK_END);
- lseek (fd, 0, SEEK_SET);
-
- if (file_size == (off_t) -1) {
- if (emit_warnings)
- g_warning ("Can't get size of symbol file: %s", filename);
- return NULL;
- }
-
- ptr = mono_raw_buffer_load (fd, 1, 0, file_size);
- if (!ptr) {
- if (emit_warnings)
- g_warning ("Can't read symbol file: %s", filename);
- return NULL;
- }
-
- symfile = g_new0 (MonoDebugSymbolFile, 1);
- symfile->fd = fd;
- symfile->file_name = g_strdup (filename);
- symfile->image = image;
- symfile->raw_contents = ptr;
- symfile->raw_contents_size = file_size;
-
- if (!get_sections (symfile, emit_warnings)) {
- mono_debug_close_symbol_file (symfile);
- return NULL;
- }
-
- read_line_numbers (symfile);
-
- return symfile;
-}
-
-void
-mono_debug_close_symbol_file (MonoDebugSymbolFile *symfile)
-{
- if (!symfile)
- return;
-
- if (symfile->raw_contents)
- mono_raw_buffer_free (symfile->raw_contents);
- if (symfile->fd)
- close (symfile->fd);
-
- if (symfile->line_number_table)
- g_hash_table_destroy (symfile->line_number_table);
- g_free (symfile->file_name);
- g_free (symfile->section_offsets);
- g_free (symfile);
-}
-
-static void
-relocate_variable (MonoDebugVarInfo *var, void *base_ptr)
-{
- if (!var) {
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- return;
- }
-
- /*
- * Update the location description for a local variable or method parameter.
- * MCS always reserves 8 bytes for us to do this, if we don't need them all
- * we just fill up the rest with DW_OP_nop's.
- */
-
- switch (var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS) {
- case MONO_DEBUG_VAR_ADDRESS_MODE_STACK:
- /*
- * Variable is on the stack.
- *
- * If `index' is zero, use the normal frame register. Otherwise, bits
- * 0..4 of `index' contain the frame register.
- *
- * Both DW_OP_fbreg and DW_OP_breg0 ... DW_OP_breg31 take an ULeb128
- * argument - since this has an variable size, we set it to zero and
- * manually add a 4 byte constant using DW_OP_plus.
- */
- if (!var->index)
- /* Use the normal frame register (%ebp on the i386). */
- * ((guint8 *) base_ptr)++ = DW_OP_fbreg;
- else
- /* Use a custom frame register. */
- * ((guint8 *) base_ptr)++ = DW_OP_breg0 + (var->index & 0x001f);
- * ((guint8 *) base_ptr)++ = 0;
- * ((guint8 *) base_ptr)++ = DW_OP_const4s;
- * ((gint32 *) base_ptr)++ = var->offset;
- * ((guint8 *) base_ptr)++ = DW_OP_plus;
- break;
-
- case MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER:
- /*
- * Variable is in the register whose number is contained in bits 0..4
- * of `index'.
- *
- * We need to write exactly 8 bytes in this location description, so instead
- * of filling up the rest with DW_OP_nop's just add the `offset' even if
- * it's zero.
- */
- * ((guint8 *) base_ptr)++ = DW_OP_reg0 + (var->index & 0x001f);
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_const4s;
- * ((gint32 *) base_ptr)++ = var->offset;
- * ((guint8 *) base_ptr)++ = DW_OP_plus;
- break;
-
- case MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS:
- /*
- * Variable is in two registers whose numbers are in bits 0..4 and 5..9 of
- * the `index' field. Don't add `offset' since we have only two bytes left,
- * fill them up with DW_OP_nop's.
- */
- * ((guint8 *) base_ptr)++ = DW_OP_reg0 + (var->index & 0x001f);
- * ((guint8 *) base_ptr)++ = DW_OP_piece;
- * ((guint8 *) base_ptr)++ = sizeof (int);
- * ((guint8 *) base_ptr)++ = DW_OP_reg0 + ((var->index & 0x1f0) >> 5);
- * ((guint8 *) base_ptr)++ = DW_OP_piece;
- * ((guint8 *) base_ptr)++ = sizeof (int);
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- * ((guint8 *) base_ptr)++ = DW_OP_nop;
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-void
-mono_debug_update_symbol_file (MonoDebugSymbolFile *symfile,
- MonoDebugMethodInfoFunc method_info_func,
- gpointer user_data)
-{
- const char *reloc_ptr, *reloc_start, *reloc_end;
- int version, already_relocated = 0;
- long reloc_size;
-
- if (!symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_MONO_RELOC_TABLE].file_offset)
- return;
-
- reloc_ptr = reloc_start = symfile->raw_contents +
- symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_MONO_RELOC_TABLE].file_offset;
-
- version = *((guint16 *) reloc_ptr)++;
- if (version != MONO_DEBUG_SYMBOL_FILE_VERSION) {
- g_warning ("Symbol file %s has incorrect relocation table version "
- "(expected %d, got %d)", symfile->file_name,
- MONO_DEBUG_SYMBOL_FILE_VERSION, version);
- return;
- }
-
- already_relocated = *reloc_ptr;
- *((char *) reloc_ptr)++ = 1;
-
- reloc_size = *((guint32 *) reloc_ptr)++;
- reloc_end = reloc_ptr + reloc_size;
-
- while (reloc_ptr < reloc_end) {
- int type, size, section, offset;
- const char *tmp_ptr;
- char *base_ptr;
-
- type = *reloc_ptr++;
- size = * ((guint32 *) reloc_ptr)++;
-
- tmp_ptr = reloc_ptr;
- reloc_ptr += size;
-
- section = *tmp_ptr++;
- offset = *((guint32 *) tmp_ptr)++;
-
- if (section >= MONO_DEBUG_SYMBOL_SECTION_MAX) {
- g_warning ("Symbol file %s contains a relocation entry for unknown section %d",
- symfile->file_name, section);
- continue;
- }
-
- if (!symfile->section_offsets [section].file_offset) {
- g_warning ("Symbol file %s contains a relocation entry for non-existing "
- "section %d", symfile->file_name, section);
- continue;
- }
-
- base_ptr = symfile->raw_contents + symfile->section_offsets [section].file_offset;
- base_ptr = base_ptr + offset;
-
- switch (type) {
- case MRT_target_address_size:
- * (guint8 *) base_ptr = sizeof (void *);
- break;
- case MRT_method_start_address: {
- int token = *((guint32 *) tmp_ptr)++;
- MonoDebugMethodInfo *minfo;
-
- minfo = method_info_func (symfile, token, user_data);
-
- if (!minfo) {
- * (void **) base_ptr = 0;
- continue;
- }
-
-#if 0
- g_message ("Start of `%s' (%ld) relocated to %p", minfo->method->name,
- token, minfo->code_start);
-#endif
-
- * (void **) base_ptr = minfo->code_start;
-
- break;
- }
- case MRT_method_end_address: {
- int token = *((guint32 *) tmp_ptr)++;
- MonoDebugMethodInfo *minfo;
-
- minfo = method_info_func (symfile, token, user_data);
-
- if (!minfo) {
- * (void **) base_ptr = 0;
- continue;
- }
-
- * (void **) base_ptr = (char *)minfo->code_start + minfo->code_size;
-
- break;
- }
- case MRT_il_offset: {
- guint32 token = *((guint32 *) tmp_ptr)++;
- guint32 original = *((guint32 *) tmp_ptr)++;
- MonoDebugMethodInfo *minfo;
- guint32 address;
- int i;
-
- minfo = method_info_func (symfile, token, user_data);
-
- if (!minfo) {
- * (void **) base_ptr = 0;
- continue;
- }
-
- address = minfo->code_size;
-
- for (i = 0; i < minfo->num_il_offsets; i++) {
- MonoDebugILOffsetInfo *il = &minfo->il_offsets [i];
-
- if (il->offset >= original) {
- address = il->address;
- break;
- }
- }
-
-#if 0
- g_message ("Relocating IL offset %04x in `%s' to %d (%p)",
- original, minfo->method->name, address,
- minfo->code_start + address);
-#endif
-
- * (void **) base_ptr = minfo->code_start + address;
-
- break;
- }
- case MRT_local_variable: {
- guint32 token = *((guint32 *) tmp_ptr)++;
- guint32 original = *((guint32 *) tmp_ptr)++;
- MonoDebugMethodInfo *minfo;
-
- minfo = method_info_func (symfile, token, user_data);
-
- if (!minfo) {
- relocate_variable (NULL, base_ptr);
- continue;
- }
-
- if (original > minfo->num_locals) {
- g_warning ("Symbol file %s contains relocation entry for non-existing "
- "local variable %d, but method %s only has %d local variables.",
- symfile->file_name, original, minfo->method->name,
- minfo->num_locals);
- g_message (G_STRLOC ": %d", token);
- G_BREAKPOINT ();
- continue;
- }
-
- relocate_variable (&minfo->locals [original], base_ptr);
-
- break;
- }
- case MRT_method_parameter: {
- guint32 token = *((guint32 *) tmp_ptr)++;
- guint32 original = *((guint32 *) tmp_ptr)++;
- MonoDebugMethodInfo *minfo;
-
- minfo = method_info_func (symfile, token, user_data);
-
- if (!minfo) {
- relocate_variable (NULL, base_ptr);
- continue;
- }
-
- if (minfo->method->signature->hasthis) {
- if (original == 0) {
- relocate_variable (minfo->this_var, base_ptr);
- continue;
- }
-
- original--;
- }
-
- if (original > minfo->num_params) {
- g_warning ("Symbol file %s contains relocation entry for non-existing "
- "parameter %d, but method %s only has %d parameters.",
- symfile->file_name, original, minfo->method->name,
- minfo->num_params);
- continue;
- }
-
- relocate_variable (&minfo->params [original], base_ptr);
-
- break;
- }
- case MRT_type_sizeof: {
- guint32 token = *((guint32 *) tmp_ptr)++;
- MonoClass *klass = mono_debug_class_get (symfile, token);
-
- if (!klass)
- continue;
-
- mono_class_init (klass);
-
- if (klass->enumtype || klass->valuetype)
- * (gint8 *) base_ptr = klass->instance_size - sizeof (MonoObject);
- else
- * (gint8 *) base_ptr = klass->instance_size;
-
- break;
- }
- case MRT_type_field_offset: {
- guint32 token = *((guint32 *) tmp_ptr)++;
- guint32 original = *((guint32 *) tmp_ptr)++;
- MonoClass *klass = mono_debug_class_get (symfile, token);
- guint32 off;
-
- if (!klass)
- continue;
-
- mono_class_init (klass);
-
- if (original > klass->field.count) {
- g_warning ("Symbol file %s contains invalid field offset entry.",
- symfile->file_name);
- g_message (G_STRLOC ": %d", token);
- /* G_BREAKPOINT (); */
- continue;
- }
-
- if (!klass->fields)
- continue;
-
- off = klass->fields [original].offset;
- if (klass->byval_arg.type == MONO_TYPE_VALUETYPE)
- off -= sizeof (MonoObject);
-
-#if 0
- g_message ("Setting field %d of type %u to offset %d", original,
- token, off);
-#endif
-
- * (guint32 *) base_ptr = off;
-
- break;
- }
- case MRT_mono_string_sizeof:
- * (gint8 *) base_ptr = sizeof (MonoString);
- break;
-
- case MRT_mono_string_offset: {
- guint32 idx = *((guint32 *) tmp_ptr)++;
- MonoString string;
- guint32 off;
-
- switch (idx) {
- case MRI_string_offset_length:
- off = (guchar *) &string.length - (guchar *) &string;
- break;
-
- case MRI_string_offset_chars:
- off = (guchar *) &string.chars - (guchar *) &string;
- break;
-
- default:
- g_warning ("Symbol file %s contains invalid string offset entry",
- symfile->file_name);
- continue;
- }
-
- * (guint32 *) base_ptr = off;
-
- break;
- }
- case MRT_mono_array_sizeof:
- * (gint8 *) base_ptr = sizeof (MonoArray);
- break;
-
- case MRT_mono_array_offset: {
- guint32 idx = *((guint32 *) tmp_ptr)++;
- MonoArray array;
- guint32 off;
-
- switch (idx) {
- case MRI_array_offset_bounds:
- off = (guchar *) &array.bounds - (guchar *) &array;
- break;
-
- case MRI_array_offset_max_length:
- off = (guchar *) &array.max_length - (guchar *) &array;
- break;
-
- case MRI_array_offset_vector:
- off = (guchar *) &array.vector - (guchar *) &array;
- break;
-
- default:
- g_warning ("Symbol file %s contains invalid array offset entry",
- symfile->file_name);
- continue;
- }
-
- * (guint32 *) base_ptr = off;
-
- break;
- }
-
- case MRT_mono_array_bounds_sizeof:
- * (gint8 *) base_ptr = sizeof (MonoArrayBounds);
- break;
-
- case MRT_mono_array_bounds_offset: {
- guint32 idx = *((guint32 *) tmp_ptr)++;
- MonoArrayBounds bounds;
- guint32 off;
-
- switch (idx) {
- case MRI_array_bounds_offset_lower:
- off = (guchar *) &bounds.lower_bound - (guchar *) &bounds;
- break;
-
- case MRI_array_bounds_offset_length:
- off = (guchar *) &bounds.length - (guchar *) &bounds;
- break;
-
- default:
- g_warning ("Symbol file %s contains invalid array bounds offset entry",
- symfile->file_name);
- continue;
- }
-
- * (guint32 *) base_ptr = off;
-
- break;
- }
-
- case MRT_variable_start_scope: {
- guint32 token = *((guint32 *) tmp_ptr)++;
- guint32 original = *((guint32 *) tmp_ptr)++;
- MonoDebugMethodInfo *minfo;
- gint32 address;
-
- minfo = method_info_func (symfile, token, user_data);
-
- if (!minfo || !minfo->locals) {
- * (void **) base_ptr = 0;
- continue;
- }
-
- if (original > minfo->num_locals) {
- g_warning ("Symbol file %s contains relocation entry for non-existing "
- "local variable %d, but method %s only has %d local variables.",
- symfile->file_name, original, minfo->method->name,
- minfo->num_locals);
- continue;
- }
-
- address = minfo->locals [original].begin_scope;
-
- * (void **) base_ptr = minfo->code_start + address;
-
- break;
- }
-
- case MRT_variable_end_scope: {
- guint32 token = *((guint32 *) tmp_ptr)++;
- guint32 original = *((guint32 *) tmp_ptr)++;
- MonoDebugMethodInfo *minfo;
- gint32 address;
-
- minfo = method_info_func (symfile, token, user_data);
-
- if (!minfo || !minfo->locals) {
- * (void **) base_ptr = 0;
- continue;
- }
-
- if (original > minfo->num_locals) {
- g_warning ("Symbol file %s contains relocation entry for non-existing "
- "local variable %d, but method %s only has %d local variables.",
- symfile->file_name, original, minfo->method->name,
- minfo->num_locals);
- continue;
- }
-
- address = minfo->locals [original].end_scope;
-
- * (void **) base_ptr = minfo->code_start + address;
-
- break;
- }
-
- case MRT_mono_string_fieldsize: {
- guint32 idx = *((guint32 *) tmp_ptr)++;
- MonoString string;
- guint32 fieldsize;
-
- switch (idx) {
- case MRI_string_offset_length:
- fieldsize = sizeof (string.length);
- break;
-
- default:
- g_warning ("Symbol file %s contains invalid string fieldsize entry",
- symfile->file_name);
- continue;
- }
-
- * (guint32 *) base_ptr = fieldsize;
-
- break;
- }
-
- case MRT_mono_array_fieldsize: {
- guint32 idx = *((guint32 *) tmp_ptr)++;
- MonoArray array;
- guint32 fieldsize;
-
- switch (idx) {
- case MRI_array_offset_bounds:
- fieldsize = sizeof (array.bounds);
- break;
-
- case MRI_array_offset_max_length:
- fieldsize = sizeof (array.max_length);
- break;
-
- case MRI_array_offset_vector:
- fieldsize = sizeof (array.vector);
- break;
-
- default:
- g_warning ("Symbol file %s contains invalid array fieldsize entry",
- symfile->file_name);
- continue;
- }
-
- * (guint32 *) base_ptr = fieldsize;
-
- break;
- }
-
-
- default:
- g_warning ("Symbol file %s contains unknown relocation entry %d",
- symfile->file_name, type);
- break;
- }
- }
-
- mono_raw_buffer_update (symfile->raw_contents, symfile->raw_contents_size);
-}
-
-gchar *
-mono_debug_find_source_location (MonoDebugSymbolFile *symfile, MonoMethod *method, guint32 offset)
-{
- MonoDebugLineNumberBlock *lnb;
- const char *ptr;
-
- if (!symfile->line_number_table)
- return NULL;
-
- lnb = g_hash_table_lookup (symfile->line_number_table, method);
- if (!lnb)
- return NULL;
-
- ptr = symfile->raw_contents +
- symfile->section_offsets [MONO_DEBUG_SYMBOL_SECTION_MONO_LINE_NUMBERS].file_offset;
-
- ptr += lnb->file_offset;
-
- do {
- guint32 row, iloffset;
-
- row = * ((guint32 *) ptr)++;
- iloffset = * ((guint32 *) ptr)++;
-
- if (!row && !offset)
- return NULL;
- if (!row)
- continue;
-
- if (iloffset >= offset)
- return g_strdup_printf ("%s:%d", lnb->source_file, row);
- } while (1);
-
- return NULL;
-}
diff --git a/mono/metadata/debug-symfile.h b/mono/metadata/debug-symfile.h
deleted file mode 100644
index fe76b034cac..00000000000
--- a/mono/metadata/debug-symfile.h
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef __MONO_DEBUG_SYMFILE_H__
-#define __MONO_DEBUG_SYMFILE_H__
-
-#include <glib.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/reflection.h>
-
-typedef struct MonoDebugSymbolFile MonoDebugSymbolFile;
-typedef struct MonoDebugSymbolFileSection MonoDebugSymbolFileSection;
-typedef struct MonoDebugMethodInfo MonoDebugMethodInfo;
-typedef struct MonoDebugVarInfo MonoDebugVarInfo;
-typedef struct MonoDebugILOffsetInfo MonoDebugILOffsetInfo;
-typedef struct MonoDebugLineNumberBlock MonoDebugLineNumberBlock;
-
-/* Machine dependent information about a method.
- *
- * This structure is created by the MonoDebugMethodInfoFunc callback of
- * mono_debug_update_symbol_file (). */
-struct MonoDebugMethodInfo {
- MonoMethod *method;
- char *code_start;
- guint32 code_size;
- guint32 num_params;
- MonoDebugVarInfo *this_var;
- MonoDebugVarInfo *params;
- guint32 num_locals;
- MonoDebugVarInfo *locals;
- guint32 num_il_offsets;
- MonoDebugILOffsetInfo *il_offsets;
- guint32 prologue_end;
- guint32 epilogue_begin;
- gpointer _priv;
-};
-
-/*
- * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
- * where the variable is actually stored.
- *
- * See relocate_variable() in debug-symfile.c for more info.
- */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS 0xf0000000
-
-/* If "index" is zero, the variable is at stack offset "offset". */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_STACK 0
-
-/* The variable is in the register whose number is contained in bits 0..4 of the
- * "index" field plus an offset of "offset" (which can be zero).
- */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER 0x10000000
-
-/* The variables in in the two registers whose numbers are contained in bits 0..4
- * and 5..9 of the "index" field plus an offset of "offset" (which can be zero).
- */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS 0x20000000
-
-struct MonoDebugVarInfo {
- guint32 index;
- guint32 offset;
- guint32 begin_scope;
- guint32 end_scope;
-};
-
-struct MonoDebugILOffsetInfo {
- guint32 offset;
- guint32 address;
-};
-
-struct MonoDebugLineNumberBlock {
- guint32 token;
- const char *source_file;
- guint32 start_line;
- guint32 file_offset;
-};
-
-struct MonoDebugSymbolFile {
- int fd;
- char *file_name;
- MonoImage *image;
- /* Pointer to the mmap()ed contents of the file. */
- char *raw_contents;
- size_t raw_contents_size;
- /* Array of MONO_DEBUG_SYMBOL_SECTION_MAX elements. */
- MonoDebugSymbolFileSection *section_offsets;
- GHashTable *line_number_table;
- gpointer user_data;
-};
-
-struct MonoDebugSymbolFileSection {
- int type;
- gulong file_offset;
- gulong size;
-};
-
-#define MONO_DEBUG_SYMBOL_FILE_VERSION 12
-
-/* Keep in sync with Mono.CSharp.Debugger.MonoDwarfFileWriter.Section */
-#define MONO_DEBUG_SYMBOL_SECTION_DEBUG_INFO 0x01
-#define MONO_DEBUG_SYMBOL_SECTION_DEBUG_ABBREV 0x02
-#define MONO_DEBUG_SYMBOL_SECTION_DEBUG_LINE 0x03
-#define MONO_DEBUG_SYMBOL_SECTION_MONO_RELOC_TABLE 0x04
-#define MONO_DEBUG_SYMBOL_SECTION_MONO_LINE_NUMBERS 0x05
-
-#define MONO_DEBUG_SYMBOL_SECTION_MAX 0x06
-
-/* Tries to load `filename' as a debugging information file, if `emit_warnings" is set,
- * use g_warning() to signal error messages on failure, otherwise silently return NULL. */
-MonoDebugSymbolFile *mono_debug_open_symbol_file (MonoImage *image,
- const char *filename,
- gboolean emit_warnings);
-
-/* This callback function needs to return a MonoDebugMethodInfo structure containing the
- * machine-dependent information about method associated with the metadata_token.
- * It's highly recommended to cache the generated data since this function can be called
- * several times per method. */
-typedef MonoDebugMethodInfo * (*MonoDebugMethodInfoFunc) (MonoDebugSymbolFile *symbol_file,
- guint32 metadata_token,
- gpointer user_data);
-
-void mono_debug_update_symbol_file (MonoDebugSymbolFile *symbol_file,
- MonoDebugMethodInfoFunc method_info_func,
- gpointer user_data);
-
-void mono_debug_close_symbol_file (MonoDebugSymbolFile *symbol_file);
-
-gchar *
-mono_debug_find_source_location (MonoDebugSymbolFile *symfile, MonoMethod *method, guint32 offset);
-
-
-#endif /* __MONO_DEBUG_SYMFILE_H__ */
-
diff --git a/mono/metadata/decimal.c b/mono/metadata/decimal.c
index a2bd4b28fd5..0fff7d5b399 100644
--- a/mono/metadata/decimal.c
+++ b/mono/metadata/decimal.c
@@ -13,6 +13,7 @@
* CSharp value type System.Decimal
*/
+#include <mono/metadata/exception.h>
#include <stdio.h>
#include <memory.h>
#include <stdlib.h>
@@ -20,10 +21,14 @@
#include <math.h>
/* needed for building microsoft dll */
+#ifdef __GNUC__
#define DECINLINE __inline
+#else
+#define DECINLINE
+#endif
#define LIT_GUINT32(x) x
-#define LIT_GUINT64(x) x##L
+#define LIT_GUINT64(x) x##LL
/* we need a UInt64 type => guint64 */
@@ -89,7 +94,7 @@
#define DECIMAL_LOG_NEGINF -1000
-static guint32 constantsDecadeInt32Factors[DECIMAL_MAX_INTFACTORS+1] = {
+static const guint32 constantsDecadeInt32Factors[DECIMAL_MAX_INTFACTORS+1] = {
LIT_GUINT32(1), LIT_GUINT32(10), LIT_GUINT32(100), LIT_GUINT32(1000),
LIT_GUINT32(10000), LIT_GUINT32(100000), LIT_GUINT32(1000000),
LIT_GUINT32(10000000), LIT_GUINT32(100000000), LIT_GUINT32(1000000000)
@@ -100,7 +105,7 @@ typedef struct {
guint64 hi;
} dec128_repr;
-static dec128_repr dec128decadeFactors[DECIMAL_MAX_SCALE+1] = {
+static const dec128_repr dec128decadeFactors[DECIMAL_MAX_SCALE+1] = {
LIT_DEC128( 0, 0, 1u), /* == 1 */
LIT_DEC128( 0, 0, 10u), /* == 10 */
LIT_DEC128( 0, 0, 100u), /* == 100 */
@@ -344,7 +349,7 @@ DECINLINE static int div128by32(guint64* plo, guint64* phi, guint32 factor, guin
if (pRest) *pRest = (guint32) a;
a <<= 1;
- return (a > factor || (a == factor && (c & 1) == 1)) ? 1 : 0;
+ return (a >= factor || (a == factor && (c & 1) == 1)) ? 1 : 0;
}
/* division: x(192bit) /= factor(32bit)
@@ -740,6 +745,8 @@ gint32 mono_decimalIncr(/*[In, Out]*/decimal_repr* pA, /*[In]*/decimal_repr* pB)
int log2A, log2B, log2Result, log10Result, rc;
int subFlag, sign, scaleA, scaleB;
+ MONO_ARCH_SAVE_REGS;
+
DECTO128(pA, alo, ahi);
DECTO128(pB, blo, bhi);
@@ -1057,6 +1064,8 @@ gint32 mono_decimal2string(/*[In]*/decimal_repr* pA, gint32 digits, gint32 decim
gint32 sigDigits, d;
int i, scale, len;
+ MONO_ARCH_SAVE_REGS;
+
scale = pA->signscale.scale;
DECTO128(pA, alo, ahi);
sigDigits = calcDigits(alo, ahi); /* significant digits */
@@ -1145,6 +1154,8 @@ gint32 mono_decimal2UInt64(/*[In]*/decimal_repr* pA, guint64* pResult)
guint64 alo, ahi;
int scale;
+ MONO_ARCH_SAVE_REGS;
+
DECTO128(pA, alo, ahi);
scale = pA->signscale.scale;
if (scale > 0) {
@@ -1166,6 +1177,8 @@ gint32 mono_decimal2Int64(/*[In]*/decimal_repr* pA, gint64* pResult)
guint64 alo, ahi;
int sign, scale;
+ MONO_ARCH_SAVE_REGS;
+
DECTO128(pA, alo, ahi);
scale = pA->signscale.scale;
if (scale > 0) {
@@ -1193,6 +1206,8 @@ void mono_decimalFloorAndTrunc(/*[In, Out]*/decimal_repr* pA, gint32 floorFlag)
int scale, sign, idx;
int hasRest = 0;
+ MONO_ARCH_SAVE_REGS;
+
scale = pA->signscale.scale;
if (scale == 0) return; /* nothing to do */
@@ -1219,6 +1234,8 @@ void mono_decimalRound(/*[In, Out]*/decimal_repr* pA, gint32 decimals)
guint64 alo, ahi;
int scale, sign;
+ MONO_ARCH_SAVE_REGS;
+
DECTO128(pA, alo, ahi);
scale = pA->signscale.scale;
sign = pA->signscale.sign;
@@ -1236,6 +1253,8 @@ gint32 mono_decimalMult(/*[In, Out]*/decimal_repr* pA, /*[In]*/decimal_repr* pB)
guint32 factor;
int scale, sign, rc;
+ MONO_ARCH_SAVE_REGS;
+
mult96by96to192(pA->lo32, pA->mid32, pA->hi32, pB->lo32, pB->mid32, pB->hi32,
&low, &mid, &high);
@@ -1333,6 +1352,8 @@ gint32 mono_decimalDiv(/*[Out]*/decimal_repr* pC, /*[In]*/decimal_repr* pA, /*[I
guint64 clo, chi; /* result */
int scale, texp, rc;
+ MONO_ARCH_SAVE_REGS;
+
rc = decimalDivSub(pA, pB, &clo, &chi, &texp);
if (rc != DECIMAL_SUCCESS) {
if (rc == DECIMAL_FINISHED) rc = DECIMAL_SUCCESS;
@@ -1354,6 +1375,8 @@ gint32 mono_decimalIntDiv(/*[Out]*/decimal_repr* pC, /*[In]*/decimal_repr* pA, /
guint64 clo, chi; /* result */
int scale, texp, rc;
+ MONO_ARCH_SAVE_REGS;
+
rc = decimalDivSub(pA, pB, &clo, &chi, &texp);
if (rc != DECIMAL_SUCCESS) {
if (rc == DECIMAL_FINISHED) rc = DECIMAL_SUCCESS;
@@ -1398,6 +1421,8 @@ gint32 mono_decimalCompare(/*[In]*/decimal_repr* pA, /*[In]*/decimal_repr* pB)
int log2a, log2b, delta, sign;
decimal_repr aa;
+ MONO_ARCH_SAVE_REGS;
+
sign = (pA->signscale.sign) ? -1 : 1;
if (pA->signscale.sign ^ pB->signscale.sign) {
@@ -1438,6 +1463,8 @@ double mono_decimal2double(/*[In]*/decimal_repr* pA)
guint32 overhang, factor, roundBits;
int scale, texp, log5, i;
+ MONO_ARCH_SAVE_REGS;
+
ahi = (((guint64)(pA->hi32)) << 32) | pA->mid32;
alo = ((guint64)(pA->lo32)) << 32;
@@ -1485,7 +1512,7 @@ double mono_decimal2double(/*[In]*/decimal_repr* pA)
ahi += 0x400;
if ((ahi & LIT_GUINT64_HIGHBIT) == 0) { /* overflow ? */
ahi >>= 1;
- texp++;
+ texp--;
} else if ((roundBits & 0x400) == 0) ahi &= ~1;
/* 96 bit => 1 implizit bit and 52 explicit bits */
@@ -1503,6 +1530,8 @@ gint32 mono_decimalSetExponent(/*[In, Out]*/decimal_repr* pA, gint32 texp)
int rc;
int scale = pA->signscale.scale;
+ MONO_ARCH_SAVE_REGS;
+
scale -= texp;
if (scale < 0 || scale > DECIMAL_MAX_SCALE) {
diff --git a/mono/metadata/decimal.h b/mono/metadata/decimal.h
index a01c0ff7fa6..f587f3f6029 100644
--- a/mono/metadata/decimal.h
+++ b/mono/metadata/decimal.h
@@ -6,12 +6,21 @@ typedef struct
{
union {
guint32 ss32;
+#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+ struct {
+ unsigned int sign : 1;
+ unsigned int reserved2 : 7;
+ unsigned int scale : 8;
+ unsigned int reserved1 : 16;
+ } signscale;
+#else
struct {
unsigned int reserved1 : 16;
- unsigned int scale : 8;
+ unsigned int scale : 8;
unsigned int reserved2 : 7;
- unsigned int sign : 1;
- } signscale;
+ unsigned int sign : 1;
+ } signscale;
+#endif
} u;
guint32 hi32;
guint32 lo32;
diff --git a/mono/metadata/domain-internals.h b/mono/metadata/domain-internals.h
new file mode 100644
index 00000000000..2ba44d36e95
--- /dev/null
+++ b/mono/metadata/domain-internals.h
@@ -0,0 +1,216 @@
+/*
+ * Appdomain-related internal data structures and functions.
+ */
+#ifndef __MONO_METADATA_DOMAIN_INTERNALS_H__
+#define __MONO_METADATA_DOMAIN_INTERNALS_H__
+
+#include <mono/metadata/appdomain.h>
+#include <mono/utils/mono-codeman.h>
+#include <mono/utils/mono-hash.h>
+#include <mono/io-layer/io-layer.h>
+
+extern CRITICAL_SECTION mono_delegate_section;
+
+/* This is a copy of System.AppDomainSetup */
+typedef struct {
+ MonoObject object;
+ MonoString *application_base;
+ MonoString *application_name;
+ MonoString *cache_path;
+ MonoString *configuration_file;
+ MonoString *dynamic_base;
+ MonoString *license_file;
+ MonoString *private_bin_path;
+ MonoString *private_bin_path_probe;
+ MonoString *shadow_copy_directories;
+ MonoString *shadow_copy_files;
+ MonoBoolean publisher_policy;
+ MonoBoolean path_changed;
+ int loader_optimization;
+ MonoBoolean disallow_binding_redirects;
+ MonoBoolean disallow_code_downloads;
+} MonoAppDomainSetup;
+
+typedef GArray MonoJitInfoTable;
+
+typedef struct {
+ guint32 flags;
+ gpointer try_start;
+ gpointer try_end;
+ gpointer handler_start;
+ union {
+ MonoClass *catch_class;
+ gpointer filter;
+ } data;
+} MonoJitExceptionInfo;
+
+struct _MonoJitInfo {
+ MonoMethod *method;
+ gpointer code_start;
+ int code_size;
+ guint32 used_regs;
+ unsigned num_clauses;
+ signed exvar_offset;
+ /* Whenever the code is domain neutral or 'shared' */
+ gboolean domain_neutral:1;
+ MonoJitExceptionInfo *clauses;
+};
+
+struct _MonoAppContext {
+ MonoObject obj;
+ gint32 domain_id;
+ gint32 context_id;
+ gpointer *static_data;
+};
+
+typedef enum {
+ MONO_APPDOMAIN_CREATED,
+ MONO_APPDOMAIN_UNLOADING,
+ MONO_APPDOMAIN_UNLOADED
+} MonoAppDomainState;
+
+struct _MonoDomain {
+ MonoAppDomain *domain;
+ CRITICAL_SECTION lock;
+ MonoMemPool *mp;
+ MonoCodeManager *code_mp;
+ MonoGHashTable *env;
+ GHashTable *assemblies_by_name;
+ GList *assemblies;
+ MonoAssembly *entry_assembly;
+ MonoAppDomainSetup *setup;
+ char *friendly_name;
+ guint32 state;
+ MonoGHashTable *ldstr_table;
+ MonoGHashTable *class_vtable_hash;
+ MonoGHashTable *proxy_vtable_hash;
+ MonoGHashTable *static_data_hash;
+ GHashTable *jit_code_hash;
+ MonoJitInfoTable *jit_info_table;
+ /* hashtables for Reflection handles */
+ MonoGHashTable *type_hash;
+ MonoGHashTable *refobject_hash;
+ /* Needed by Thread:GetDomainID() */
+ gint32 domain_id;
+ /* Used when loading assemblies */
+ gchar **search_path;
+ /* Used by remoting proxies */
+ MonoMethod *create_proxy_for_type_method;
+ MonoMethod *private_invoke_method;
+ MonoAppContext *default_context;
+ MonoException *out_of_memory_ex;
+ MonoException *null_reference_ex;
+ MonoException *stack_overflow_ex;
+ /* Used to store offsets of thread and context static fields */
+ GHashTable *special_static_fields;
+ GHashTable *jump_target_hash;
+ MonoGHashTable *class_init_trampoline_hash;
+ MonoGHashTable *jump_trampoline_hash;
+ /*
+ * This must be a GHashTable, since these objects can't be finalized
+ * if the hashtable contains a GC visible reference to them.
+ */
+ GHashTable *finalizable_objects_hash;
+};
+
+#define mono_domain_lock(domain) EnterCriticalSection(&(domain)->lock)
+#define mono_domain_unlock(domain) LeaveCriticalSection(&(domain)->lock)
+
+void
+mono_jit_info_table_add (MonoDomain *domain, MonoJitInfo *ji);
+
+void
+mono_jit_info_table_remove (MonoDomain *domain, MonoJitInfo *ji);
+
+MonoAppDomain *
+ves_icall_System_AppDomain_getCurDomain (void);
+
+MonoAppDomain *
+ves_icall_System_AppDomain_getDomainByID (gint32 domain_id);
+
+MonoAppDomain *
+ves_icall_System_AppDomain_createDomain (MonoString *friendly_name,
+ MonoAppDomainSetup *setup);
+
+MonoObject *
+ves_icall_System_AppDomain_GetData (MonoAppDomain *ad,
+ MonoString *name);
+
+MonoReflectionAssembly *
+ves_icall_System_AppDomain_LoadAssemblyRaw (MonoAppDomain *ad,
+ MonoArray *raw_assembly,
+ MonoArray *raw_symbol_store,
+ MonoObject *evidence);
+
+void
+ves_icall_System_AppDomain_SetData (MonoAppDomain *ad,
+ MonoString *name,
+ MonoObject *data);
+
+MonoAppDomainSetup *
+ves_icall_System_AppDomain_getSetup (MonoAppDomain *ad);
+
+MonoString *
+ves_icall_System_AppDomain_getFriendlyName (MonoAppDomain *ad);
+
+MonoArray *
+ves_icall_System_AppDomain_GetAssemblies (MonoAppDomain *ad);
+
+MonoReflectionAssembly *
+ves_icall_System_Reflection_Assembly_LoadFrom (MonoString *fname);
+
+MonoReflectionAssembly *
+ves_icall_System_AppDomain_LoadAssembly (MonoAppDomain *ad,
+ MonoString *assRef,
+ MonoObject *evidence);
+
+gboolean
+ves_icall_System_AppDomain_InternalIsFinalizingForUnload (gint32 domain_id);
+
+void
+ves_icall_System_AppDomain_InternalUnload (gint32 domain_id);
+
+gint32
+ves_icall_System_AppDomain_ExecuteAssembly (MonoAppDomain *ad,
+ MonoString *file,
+ MonoObject *evidence,
+ MonoArray *args);
+
+MonoAppDomain *
+ves_icall_System_AppDomain_InternalSetDomain (MonoAppDomain *ad);
+
+MonoAppDomain *
+ves_icall_System_AppDomain_InternalSetDomainByID (gint32 domainid);
+
+void
+ves_icall_System_AppDomain_InternalPushDomainRef (MonoAppDomain *ad);
+
+void
+ves_icall_System_AppDomain_InternalPushDomainRefByID (gint32 domain_id);
+
+void
+ves_icall_System_AppDomain_InternalPopDomainRef (void);
+
+MonoAppContext *
+ves_icall_System_AppDomain_InternalGetContext (void);
+
+MonoAppContext *
+ves_icall_System_AppDomain_InternalGetDefaultContext (void);
+
+MonoAppContext *
+ves_icall_System_AppDomain_InternalSetContext (MonoAppContext *mc);
+
+gint32
+ves_icall_System_AppDomain_GetIDFromDomain (MonoAppDomain * ad);
+
+MonoString *
+ves_icall_System_AppDomain_InternalGetProcessGuid (MonoString* newguid);
+
+const char*
+mono_get_framework_version (void);
+
+const char*
+mono_get_runtime_version (void);
+
+
+#endif /* __MONO_METADATA_DOMAIN_INTERNALS_H__ */
diff --git a/mono/metadata/domain.c b/mono/metadata/domain.c
index 439cd6250e5..94bb993e1c1 100644
--- a/mono/metadata/domain.c
+++ b/mono/metadata/domain.c
@@ -4,6 +4,7 @@
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
*
* (C) 2001 Ximian, Inc.
*/
@@ -11,20 +12,91 @@
#include <config.h>
#include <glib.h>
#include <string.h>
+#include <sys/stat.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include <mono/metadata/object.h>
-#include <mono/metadata/appdomain.h>
+#include <mono/metadata/domain-internals.h>
+#include <mono/metadata/class-internals.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/cil-coff.h>
+#include <mono/metadata/rawbuffer.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+/* #define DEBUG_DOMAIN_UNLOAD */
+
+/* we need to use both the Tls* functions and __thread because
+ * the gc needs to see all the appcontext
+ */
+static guint32 context_thread_id = -1;
+static guint32 appdomain_thread_id = -1;
+
+#ifdef HAVE_KW_THREAD
+static __thread MonoDomain * tls_appdomain;
+static __thread MonoAppContext * tls_appcontext;
+#define GET_APPDOMAIN() tls_appdomain
+#define SET_APPDOMAIN(x) do { \
+ tls_appdomain = x; \
+ TlsSetValue (appdomain_thread_id, x); \
+} while (FALSE)
+
+#define GET_APPCONTEXT() tls_appcontext
+#define SET_APPCONTEXT(x) do { \
+ tls_appcontext = x; \
+ TlsSetValue (context_thread_id, x); \
+} while (FALSE)
+
+#else
+#define GET_APPDOMAIN() ((MonoDomain *)TlsGetValue (appdomain_thread_id))
+#define SET_APPDOMAIN(x) TlsSetValue (appdomain_thread_id, x);
+
+#define GET_APPCONTEXT() ((MonoAppContext *)TlsGetValue (context_thread_id))
+#define SET_APPCONTEXT(x) TlsSetValue (context_thread_id, x);
+#endif
+
+static gint32 appdomain_id_counter = 0;
+
+static MonoGHashTable * appdomains_list = NULL;
+
+static CRITICAL_SECTION appdomains_mutex;
+
+static MonoDomain *mono_root_domain = NULL;
+
+/* RuntimeInfo: Contains information about versions supported by this runtime */
+typedef struct {
+ const char* runtime_version;
+ const char* framework_version;
+} RuntimeInfo;
+
+/* AppConfigInfo: Information about runtime versions supported by an
+ * aplication.
+ */
+typedef struct {
+ GSList *supported_runtimes;
+ char *required_runtime;
+ int configuration_count;
+ int startup_count;
+} AppConfigInfo;
+
+static RuntimeInfo *current_runtime = NULL;
+
+/* This is the list of runtime versions supported by this JIT.
+ */
+static RuntimeInfo supported_runtimes[] = {
+ {"v1.0.3705", "1.0"}, {"v1.1.4322", "1.0"}, {"v2.0.40607","2.0"}
+};
+
+/* The stable runtime version */
+#define DEFAULT_RUNTIME_VERSION "v1.1.4322"
-static guint32 appdomain_thread_id = 0;
+static RuntimeInfo*
+get_runtime_from_exe (const char *exe_file);
-MonoDomain *mono_root_domain = NULL;
+static RuntimeInfo*
+get_runtime_by_version (const char *version);
static MonoJitInfoTable *
mono_jit_info_table_new (void)
@@ -64,8 +136,11 @@ MonoJitInfo *
mono_jit_info_table_find (MonoDomain *domain, char *addr)
{
MonoJitInfoTable *table = domain->jit_info_table;
- int left = 0, right = table->len;
+ int left = 0, right;
+
+ mono_domain_lock (domain);
+ right = table->len;
while (left < right) {
int pos = (left + right) / 2;
MonoJitInfo *ji = g_array_index (table, gpointer, pos);
@@ -76,11 +151,14 @@ mono_jit_info_table_find (MonoDomain *domain, char *addr)
right = pos;
else if (addr >= end)
left = pos + 1;
- else
+ else {
+ mono_domain_unlock (domain);
return ji;
+ }
}
+ mono_domain_unlock (domain);
- /* maybe irt is shared code, so we also search in the root domain */
+ /* maybe it is shared code, so we also search in the root domain */
if (domain != mono_root_domain)
return mono_jit_info_table_find (mono_root_domain, addr);
@@ -92,11 +170,30 @@ mono_jit_info_table_add (MonoDomain *domain, MonoJitInfo *ji)
{
MonoJitInfoTable *table = domain->jit_info_table;
gpointer start = ji->code_start;
- int pos = mono_jit_info_table_index (table, start);
+ int pos;
+
+ mono_domain_lock (domain);
+ pos = mono_jit_info_table_index (table, start);
g_array_insert_val (table, pos, ji);
+ mono_domain_unlock (domain);
}
+void
+mono_jit_info_table_remove (MonoDomain *domain, MonoJitInfo *ji)
+{
+ MonoJitInfoTable *table = domain->jit_info_table;
+ gpointer start = ji->code_start;
+ int pos;
+
+ mono_domain_lock (domain);
+ pos = mono_jit_info_table_index (table, start);
+ g_assert (g_array_index (table, gpointer, pos) == ji);
+
+ g_array_remove_index (table, pos);
+ mono_domain_unlock (domain);
+}
+
static int
ldstr_hash (const char* str)
{
@@ -104,7 +201,8 @@ ldstr_hash (const char* str)
const char *end;
len = mono_metadata_decode_blob_size (str, &str) - 1;
end = str + len;
- h = *str;
+ /* if len == 0 *str will point to the mark byte */
+ h = len? *str: 0;
/*
* FIXME: The distribution may not be so nice with lots of
* null chars in the string.
@@ -117,6 +215,8 @@ ldstr_hash (const char* str)
static gboolean
ldstr_equal (const char *str1, const char *str2) {
int len, len2;
+ if (str1 == str2)
+ return TRUE;
len = mono_metadata_decode_blob_size (str1, NULL) - 1;
len2 = mono_metadata_decode_blob_size (str2, NULL) - 1;
if (len != len2)
@@ -124,6 +224,33 @@ ldstr_equal (const char *str1, const char *str2) {
return memcmp (str1, str2, len) == 0;
}
+static gboolean
+mono_string_equal (MonoString *s1, MonoString *s2)
+{
+ int l1 = mono_string_length (s1);
+ int l2 = mono_string_length (s2);
+
+ if (l1 != l2)
+ return FALSE;
+
+ return memcmp (mono_string_chars (s1), mono_string_chars (s2), l1) == 0;
+}
+
+static guint
+mono_string_hash (MonoString *s)
+{
+ const guint16 *p = mono_string_chars (s);
+ int i, len = mono_string_length (s);
+ guint h = 0;
+
+ for (i = 0; i < len; i++) {
+ h = (h << 5) - h + *p;
+ p++;
+ }
+
+ return h;
+}
+
#if HAVE_BOEHM_GC
static void
domain_finalizer (void *obj, void *data) {
@@ -137,40 +264,56 @@ mono_domain_create (void)
MonoDomain *domain;
#if HAVE_BOEHM_GC
- domain = GC_malloc (sizeof (MonoDomain));
- GC_register_finalizer (domain, domain_finalizer, NULL, NULL, NULL);
+ domain = GC_MALLOC (sizeof (MonoDomain));
+ GC_REGISTER_FINALIZER (domain, domain_finalizer, NULL, NULL, NULL);
#else
domain = g_new0 (MonoDomain, 1);
#endif
domain->domain = NULL;
domain->setup = NULL;
domain->friendly_name = NULL;
+ domain->search_path = NULL;
domain->mp = mono_mempool_new ();
- domain->env = g_hash_table_new (g_str_hash, g_str_equal);
- domain->assemblies = g_hash_table_new (g_str_hash, g_str_equal);
+ domain->code_mp = mono_code_manager_new ();
+ domain->env = mono_g_hash_table_new ((GHashFunc)mono_string_hash, (GCompareFunc)mono_string_equal);
+ domain->assemblies_by_name = g_hash_table_new (g_str_hash, g_str_equal);
+ domain->assemblies = NULL;
domain->class_vtable_hash = mono_g_hash_table_new (NULL, NULL);
- domain->proxy_vtable_hash = mono_g_hash_table_new (NULL, NULL);
+ domain->proxy_vtable_hash = mono_g_hash_table_new ((GHashFunc)mono_string_hash, (GCompareFunc)mono_string_equal);
domain->static_data_hash = mono_g_hash_table_new (NULL, NULL);
domain->jit_code_hash = g_hash_table_new (NULL, NULL);
domain->ldstr_table = mono_g_hash_table_new ((GHashFunc)ldstr_hash, (GCompareFunc)ldstr_equal);
domain->jit_info_table = mono_jit_info_table_new ();
+ domain->class_init_trampoline_hash = mono_g_hash_table_new (NULL, NULL);
+ domain->jump_trampoline_hash = mono_g_hash_table_new (NULL, NULL);
+ domain->finalizable_objects_hash = g_hash_table_new (NULL, NULL);
+ domain->domain_id = InterlockedIncrement (&appdomain_id_counter);
InitializeCriticalSection (&domain->lock);
+
+ EnterCriticalSection (&appdomains_mutex);
+ mono_g_hash_table_insert(appdomains_list, GINT_TO_POINTER(domain->domain_id), domain);
+ LeaveCriticalSection (&appdomains_mutex);
+
return domain;
}
/**
- * mono_init:
+ * mono_init_internal:
*
* Creates the initial application domain and initializes the mono_defaults
* structure.
* This function is guaranteed to not run any IL code.
+ * If exe_filename is not NULL, the method will determine the required runtime
+ * from the exe configuration file or the version PE field.
+ * If runtime_version is not NULL, that runtime version will be used.
+ * Either exe_filename or runtime_version must be provided.
*
* Returns: the initial domain.
*/
-MonoDomain *
-mono_init (const char *filename)
+static MonoDomain *
+mono_init_internal (const char *filename, const char *exe_filename, const char *runtime_version)
{
static MonoDomain *domain = NULL;
MonoAssembly *ass;
@@ -180,27 +323,59 @@ mono_init (const char *filename)
if (domain)
g_assert_not_reached ();
+ MONO_GC_PRE_INIT ();
+
appdomain_thread_id = TlsAlloc ();
+ context_thread_id = TlsAlloc ();
+
+ InitializeCriticalSection (&appdomains_mutex);
+
+ mono_metadata_init ();
+ mono_raw_buffer_init ();
+ mono_images_init ();
+ mono_assemblies_init ();
+ mono_loader_init ();
+
+ /* FIXME: When should we release this memory? */
+ MONO_GC_REGISTER_ROOT (appdomains_list);
+ appdomains_list = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
domain = mono_domain_create ();
mono_root_domain = domain;
- TlsSetValue (appdomain_thread_id, domain);
+ SET_APPDOMAIN (domain);
+
+ if (exe_filename != NULL) {
+ current_runtime = get_runtime_from_exe (exe_filename);
+ } else if (runtime_version != NULL) {
+ current_runtime = get_runtime_by_version (runtime_version);
+ }
+
+ if (current_runtime == NULL) {
+ g_print ("WARNING: The runtime version supported by this application is unavailable.\n");
+ current_runtime = get_runtime_by_version (DEFAULT_RUNTIME_VERSION);
+ g_print ("Using default runtime: %s\n", current_runtime->runtime_version);
+ }
/* find the corlib */
- corlib_aname.name = "corlib";
+ corlib_aname.name = "mscorlib";
ass = mono_assembly_load (&corlib_aname, NULL, &status);
if ((status != MONO_IMAGE_OK) || (ass == NULL)) {
switch (status){
- case MONO_IMAGE_ERROR_ERRNO:
- g_print ("The assembly corlib.dll was not found or could not be loaded.\n");
- g_print ("It should have been installed in the `%s' directory.\n", MONO_ASSEMBLIES);
+ case MONO_IMAGE_ERROR_ERRNO: {
+ char *corlib_file = g_build_filename (mono_assembly_getrootdir (), "mono", mono_get_framework_version (), "mscorlib.dll", NULL);
+ g_print ("The assembly mscorlib.dll was not found or could not be loaded.\n");
+ g_print ("It should have been installed in the `%s' directory.\n", corlib_file);
+ g_free (corlib_file);
break;
+ }
case MONO_IMAGE_IMAGE_INVALID:
- g_print ("The file %s/corlib.dll is an invalid CIL image\n", MONO_ASSEMBLIES);
+ g_print ("The file %s/mscorlib.dll is an invalid CIL image\n",
+ mono_assembly_getrootdir ());
break;
case MONO_IMAGE_MISSING_ASSEMBLYREF:
- g_print ("Minning assembly reference in %s/corlib.dll\n", MONO_ASSEMBLIES);
+ g_print ("Missing assembly reference in %s/mscorlib.dll\n",
+ mono_assembly_getrootdir ());
break;
case MONO_IMAGE_OK:
/* to suppress compiler warning */
@@ -209,7 +384,7 @@ mono_init (const char *filename)
exit (1);
}
- mono_defaults.corlib = ass->image;
+ mono_defaults.corlib = mono_assembly_get_image (ass);
mono_defaults.object_class = mono_class_from_name (
mono_defaults.corlib, "System", "Object");
@@ -287,6 +462,10 @@ mono_init (const char *filename)
mono_defaults.corlib, "System", "Array");
g_assert (mono_defaults.array_class != 0);
+ mono_defaults.delegate_class = mono_class_from_name (
+ mono_defaults.corlib, "System", "Delegate");
+ g_assert (mono_defaults.delegate_class != 0 );
+
mono_defaults.multicastdelegate_class = mono_class_from_name (
mono_defaults.corlib, "System", "MulticastDelegate");
g_assert (mono_defaults.multicastdelegate_class != 0 );
@@ -320,6 +499,10 @@ mono_init (const char *filename)
mono_defaults.corlib, "System", "Exception");
g_assert (mono_defaults.exception_class != 0);
+ mono_defaults.threadabortexception_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Threading", "ThreadAbortException");
+ g_assert (mono_defaults.threadabortexception_class != 0);
+
mono_defaults.thread_class = mono_class_from_name (
mono_defaults.corlib, "System.Threading", "Thread");
g_assert (mono_defaults.thread_class != 0);
@@ -344,6 +527,10 @@ mono_init (const char *filename)
mono_defaults.corlib, "System.Reflection", "FieldInfo");
g_assert (mono_defaults.field_info_class != 0);
+ mono_defaults.method_info_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "MethodInfo");
+ g_assert (mono_defaults.method_info_class != 0);
+
mono_defaults.stringbuilder_class = mono_class_from_name (
mono_defaults.corlib, "System.Text", "StringBuilder");
g_assert (mono_defaults.stringbuilder_class != 0);
@@ -360,12 +547,104 @@ mono_init (const char *filename)
mono_defaults.corlib, "System.Diagnostics", "StackTrace");
g_assert (mono_defaults.stack_trace_class != 0);
+ mono_defaults.marshal_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Runtime.InteropServices", "Marshal");
+ g_assert (mono_defaults.marshal_class != 0);
+
+ mono_defaults.iserializeable_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Runtime.Serialization", "ISerializable");
+ g_assert (mono_defaults.iserializeable_class != 0);
+
+ mono_defaults.serializationinfo_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Runtime.Serialization", "SerializationInfo");
+ g_assert (mono_defaults.serializationinfo_class != 0);
+
+ mono_defaults.streamingcontext_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Runtime.Serialization", "StreamingContext");
+ g_assert (mono_defaults.streamingcontext_class != 0);
+
+ mono_defaults.typed_reference_class = mono_class_from_name (
+ mono_defaults.corlib, "System", "TypedReference");
+ g_assert (mono_defaults.typed_reference_class != 0);
+
+ mono_defaults.argumenthandle_class = mono_class_from_name (
+ mono_defaults.corlib, "System", "RuntimeArgumentHandle");
+ g_assert (mono_defaults.argumenthandle_class != 0);
+
+ mono_defaults.marshalbyrefobject_class = mono_class_from_name (
+ mono_defaults.corlib, "System", "MarshalByRefObject");
+ g_assert (mono_defaults.marshalbyrefobject_class != 0);
+
+ mono_defaults.monitor_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Threading", "Monitor");
+ g_assert (mono_defaults.monitor_class != 0);
+
+ mono_defaults.iremotingtypeinfo_class = mono_class_from_name (
+ mono_defaults.corlib, "System.Runtime.Remoting", "IRemotingTypeInfo");
+ g_assert (mono_defaults.iremotingtypeinfo_class != 0);
+
domain->friendly_name = g_path_get_basename (filename);
return domain;
}
/**
+ * mono_init:
+ *
+ * Creates the initial application domain and initializes the mono_defaults
+ * structure.
+ * This function is guaranteed to not run any IL code.
+ * The runtime is initialized using the default runtime version.
+ *
+ * Returns: the initial domain.
+ */
+MonoDomain *
+mono_init (const char *domain_name)
+{
+ return mono_init_internal (domain_name, NULL, DEFAULT_RUNTIME_VERSION);
+}
+
+/**
+ * mono_init_from_assembly:
+ *
+ * Creates the initial application domain and initializes the mono_defaults
+ * structure.
+ * This function is guaranteed to not run any IL code.
+ * The runtime is initialized using the runtime version required by the
+ * provided executable. The version is determined by looking at the exe
+ * configuration file and the version PE field)
+ *
+ * Returns: the initial domain.
+ */
+MonoDomain *
+mono_init_from_assembly (const char *domain_name, const char *filename)
+{
+ return mono_init_internal (domain_name, filename, NULL);
+}
+
+/**
+ * mono_init_version:
+ *
+ * Creates the initial application domain and initializes the mono_defaults
+ * structure.
+ * This function is guaranteed to not run any IL code.
+ * The runtime is initialized using the provided rutime version.
+ *
+ * Returns: the initial domain.
+ */
+MonoDomain *
+mono_init_version (const char *domain_name, const char *version)
+{
+ return mono_init_internal (domain_name, NULL, version);
+}
+
+MonoDomain*
+mono_get_root_domain (void)
+{
+ return mono_root_domain;
+}
+
+/**
* mono_domain_get:
*
* Returns the current domain.
@@ -373,19 +652,64 @@ mono_init (const char *filename)
inline MonoDomain *
mono_domain_get ()
{
- return ((MonoDomain *)TlsGetValue (appdomain_thread_id));
+ return GET_APPDOMAIN ();
}
/**
- * mono_domain_set:
+ * mono_domain_set_internal:
* @domain: the new domain
*
* Sets the current domain to @domain.
*/
inline void
-mono_domain_set (MonoDomain *domain)
+mono_domain_set_internal (MonoDomain *domain)
{
- TlsSetValue (appdomain_thread_id, domain);
+ SET_APPDOMAIN (domain);
+ SET_APPCONTEXT (domain->default_context);
+}
+
+typedef struct {
+ MonoDomainFunc func;
+ gpointer user_data;
+} DomainInfo;
+
+static void
+copy_hash_entry (gpointer key, gpointer data, gpointer user_data)
+{
+ MonoGHashTable *dest = (MonoGHashTable*)user_data;
+
+ mono_g_hash_table_insert (dest, key, data);
+}
+
+static void
+foreach_domain (gpointer key, gpointer data, gpointer user_data)
+{
+ DomainInfo *dom_info = user_data;
+
+ dom_info->func ((MonoDomain*)data, dom_info->user_data);
+}
+
+void
+mono_domain_foreach (MonoDomainFunc func, gpointer user_data)
+{
+ DomainInfo dom_info;
+ MonoGHashTable *copy;
+
+ /*
+ * Create a copy of the hashtable to avoid calling the user callback
+ * inside the lock because that could lead to deadlocks.
+ * We can do this because this function is not perf. critical.
+ */
+ copy = mono_g_hash_table_new (NULL, NULL);
+ EnterCriticalSection (&appdomains_mutex);
+ mono_g_hash_table_foreach (appdomains_list, copy_hash_entry, copy);
+ LeaveCriticalSection (&appdomains_mutex);
+
+ dom_info.func = func;
+ dom_info.user_data = user_data;
+ mono_g_hash_table_foreach (copy, foreach_domain, &dom_info);
+
+ mono_g_hash_table_destroy (copy);
}
/**
@@ -396,27 +720,20 @@ mono_domain_set (MonoDomain *domain)
* fixme: maybe we should integrate this with mono_assembly_open ??
*/
MonoAssembly *
-mono_domain_assembly_open (MonoDomain *domain, char *name)
+mono_domain_assembly_open (MonoDomain *domain, const char *name)
{
- MonoAssembly *ass, *tmp;
- int i;
+ MonoAssembly *ass;
- if ((ass = g_hash_table_lookup (domain->assemblies, name)))
+ mono_domain_lock (domain);
+ if ((ass = g_hash_table_lookup (domain->assemblies_by_name, name))) {
+ mono_domain_unlock (domain);
return ass;
+ }
+ mono_domain_unlock (domain);
if (!(ass = mono_assembly_open (name, NULL)))
return NULL;
- mono_domain_lock (domain);
- g_hash_table_insert (domain->assemblies, ass->aname.name, ass);
- mono_domain_unlock (domain);
-
- /* FIXME: maybe this must be recursive ? */
- for (i = 0; (tmp = ass->image->references [i]) != NULL; i++) {
- if (!g_hash_table_lookup (domain->assemblies, tmp->aname.name))
- g_hash_table_insert (domain->assemblies, tmp->aname.name, tmp);
- }
-
return ass;
}
@@ -426,28 +743,55 @@ remove_assembly (gpointer key, gpointer value, gpointer user_data)
mono_assembly_close ((MonoAssembly *)value);
}
+static void
+delete_jump_list (gpointer key, gpointer value, gpointer user_data)
+{
+ g_slist_free (value);
+}
+
void
-mono_domain_unload (MonoDomain *domain, gboolean force)
+mono_domain_free (MonoDomain *domain, gboolean force)
{
if ((domain == mono_root_domain) && !force) {
g_warning ("cant unload root domain");
return;
}
+ EnterCriticalSection (&appdomains_mutex);
+ mono_g_hash_table_remove (appdomains_list, GINT_TO_POINTER(domain->domain_id));
+ LeaveCriticalSection (&appdomains_mutex);
+
g_free (domain->friendly_name);
- g_hash_table_foreach (domain->assemblies, remove_assembly, NULL);
+ g_hash_table_foreach (domain->assemblies_by_name, remove_assembly, NULL);
- g_hash_table_destroy (domain->env);
- g_hash_table_destroy (domain->assemblies);
+ mono_g_hash_table_destroy (domain->env);
+ g_hash_table_destroy (domain->assemblies_by_name);
+ g_list_free (domain->assemblies);
mono_g_hash_table_destroy (domain->class_vtable_hash);
mono_g_hash_table_destroy (domain->proxy_vtable_hash);
mono_g_hash_table_destroy (domain->static_data_hash);
g_hash_table_destroy (domain->jit_code_hash);
mono_g_hash_table_destroy (domain->ldstr_table);
mono_jit_info_table_free (domain->jit_info_table);
+#ifdef DEBUG_DOMAIN_UNLOAD
+ mono_mempool_invalidate (domain->mp);
+ mono_code_manager_invalidate (domain->code_mp);
+#else
mono_mempool_destroy (domain->mp);
+ mono_code_manager_destroy (domain->code_mp);
+#endif
+ if (domain->jump_target_hash) {
+ g_hash_table_foreach (domain->jump_target_hash, delete_jump_list, NULL);
+ g_hash_table_destroy (domain->jump_target_hash);
+ }
+ mono_g_hash_table_destroy (domain->class_init_trampoline_hash);
+ mono_g_hash_table_destroy (domain->jump_trampoline_hash);
+ g_hash_table_destroy (domain->finalizable_objects_hash);
+ if (domain->special_static_fields)
+ g_hash_table_destroy (domain->special_static_fields);
DeleteCriticalSection (&domain->lock);
-
+ domain->setup = NULL;
+
/* FIXME: anything else required ? */
#if HAVE_BOEHM_GC
@@ -459,3 +803,370 @@ mono_domain_unload (MonoDomain *domain, gboolean force)
mono_root_domain = NULL;
}
+/**
+ * mono_domain_get_id:
+ *
+ * Returns the a domain for a specific domain id.
+ */
+MonoDomain *
+mono_domain_get_by_id (gint32 domainid)
+{
+ MonoDomain * domain;
+
+ EnterCriticalSection (&appdomains_mutex);
+ domain = mono_g_hash_table_lookup (appdomains_list, GINT_TO_POINTER(domainid));
+ LeaveCriticalSection (&appdomains_mutex);
+
+ return domain;
+}
+
+gint32
+mono_domain_get_id (MonoDomain *domain)
+{
+ return domain->domain_id;
+}
+
+void
+mono_context_set (MonoAppContext * new_context)
+{
+ SET_APPCONTEXT (new_context);
+}
+
+MonoAppContext *
+mono_context_get (void)
+{
+ return GET_APPCONTEXT ();
+}
+
+MonoImage*
+mono_get_corlib (void)
+{
+ return mono_defaults.corlib;
+}
+
+MonoClass*
+mono_get_object_class (void)
+{
+ return mono_defaults.object_class;
+}
+
+MonoClass*
+mono_get_byte_class (void)
+{
+ return mono_defaults.byte_class;
+}
+
+MonoClass*
+mono_get_void_class (void)
+{
+ return mono_defaults.void_class;
+}
+
+MonoClass*
+mono_get_boolean_class (void)
+{
+ return mono_defaults.boolean_class;
+}
+
+MonoClass*
+mono_get_sbyte_class (void)
+{
+ return mono_defaults.sbyte_class;
+}
+
+MonoClass*
+mono_get_int16_class (void)
+{
+ return mono_defaults.int16_class;
+}
+
+MonoClass*
+mono_get_uint16_class (void)
+{
+ return mono_defaults.uint16_class;
+}
+
+MonoClass*
+mono_get_int32_class (void)
+{
+ return mono_defaults.int32_class;
+}
+
+MonoClass*
+mono_get_uint32_class (void)
+{
+ return mono_defaults.uint32_class;
+}
+
+MonoClass*
+mono_get_intptr_class (void)
+{
+ return mono_defaults.int_class;
+}
+
+MonoClass*
+mono_get_uintptr_class (void)
+{
+ return mono_defaults.uint_class;
+}
+
+MonoClass*
+mono_get_int64_class (void)
+{
+ return mono_defaults.int64_class;
+}
+
+MonoClass*
+mono_get_uint64_class (void)
+{
+ return mono_defaults.uint64_class;
+}
+
+MonoClass*
+mono_get_single_class (void)
+{
+ return mono_defaults.single_class;
+}
+
+MonoClass*
+mono_get_double_class (void)
+{
+ return mono_defaults.double_class;
+}
+
+MonoClass*
+mono_get_char_class (void)
+{
+ return mono_defaults.char_class;
+}
+
+MonoClass*
+mono_get_string_class (void)
+{
+ return mono_defaults.string_class;
+}
+
+MonoClass*
+mono_get_enum_class (void)
+{
+ return mono_defaults.enum_class;
+}
+
+MonoClass*
+mono_get_array_class (void)
+{
+ return mono_defaults.array_class;
+}
+
+MonoClass*
+mono_get_thread_class (void)
+{
+ return mono_defaults.thread_class;
+}
+
+MonoClass*
+mono_get_exception_class (void)
+{
+ return mono_defaults.exception_class;
+}
+
+
+static char* get_attribute_value (const gchar **attribute_names,
+ const gchar **attribute_values,
+ const char *att_name)
+{
+ int n;
+ for (n=0; attribute_names[n] != NULL; n++) {
+ if (strcmp (attribute_names[n], att_name) == 0)
+ return g_strdup (attribute_values[n]);
+ }
+ return NULL;
+}
+
+static void start_element (GMarkupParseContext *context,
+ const gchar *element_name,
+ const gchar **attribute_names,
+ const gchar **attribute_values,
+ gpointer user_data,
+ GError **error)
+{
+ AppConfigInfo* app_config = (AppConfigInfo*) user_data;
+
+ if (strcmp (element_name, "configuration") == 0) {
+ app_config->configuration_count++;
+ return;
+ }
+ if (strcmp (element_name, "startup") == 0) {
+ app_config->startup_count++;
+ return;
+ }
+
+ if (app_config->configuration_count != 1 || app_config->startup_count != 1)
+ return;
+
+ if (strcmp (element_name, "requiredRuntime") == 0) {
+ app_config->required_runtime = get_attribute_value (attribute_names, attribute_values, "version");
+ } else if (strcmp (element_name, "supportedRuntime") == 0) {
+ char *version = get_attribute_value (attribute_names, attribute_values, "version");
+ app_config->supported_runtimes = g_slist_append (app_config->supported_runtimes, version);
+ }
+}
+
+static void end_element (GMarkupParseContext *context,
+ const gchar *element_name,
+ gpointer user_data,
+ GError **error)
+{
+ AppConfigInfo* app_config = (AppConfigInfo*) user_data;
+
+ if (strcmp (element_name, "configuration") == 0) {
+ app_config->configuration_count--;
+ } else if (strcmp (element_name, "startup") == 0) {
+ app_config->startup_count--;
+ }
+}
+
+static const GMarkupParser
+mono_parser = {
+ start_element,
+ end_element,
+ NULL,
+ NULL,
+ NULL
+};
+
+static AppConfigInfo *
+app_config_parse (const char *filename)
+{
+ AppConfigInfo *app_config;
+ GMarkupParseContext *context;
+ char *text;
+ gsize len;
+
+ struct stat buf;
+ if (stat (filename, &buf) != 0)
+ return NULL;
+
+ app_config = g_new0 (AppConfigInfo, 1);
+
+ if (!g_file_get_contents (filename, &text, &len, NULL))
+ return NULL;
+
+ context = g_markup_parse_context_new (&mono_parser, 0, app_config, NULL);
+ if (g_markup_parse_context_parse (context, text, len, NULL)) {
+ g_markup_parse_context_end_parse (context, NULL);
+ }
+ g_markup_parse_context_free (context);
+ g_free (text);
+ return app_config;
+}
+
+static void
+app_config_free (AppConfigInfo* app_config)
+{
+ char *rt;
+ GSList *list = app_config->supported_runtimes;
+ while (list != NULL) {
+ rt = (char*)list->data;
+ g_free (rt);
+ list = g_slist_next (list);
+ }
+ g_slist_free (app_config->supported_runtimes);
+ g_free (app_config->required_runtime);
+ g_free (app_config);
+}
+
+
+static RuntimeInfo*
+get_runtime_by_version (const char *version)
+{
+ int n;
+ int max = G_N_ELEMENTS (supported_runtimes);
+
+ for (n=0; n<max; n++) {
+ if (strcmp (version, supported_runtimes[n].runtime_version) == 0)
+ return &supported_runtimes[n];
+ }
+ return NULL;
+}
+
+static RuntimeInfo*
+get_runtime_from_exe (const char *exe_file)
+{
+ AppConfigInfo* app_config;
+ char *version;
+ char *config_name;
+ RuntimeInfo* runtime = NULL;
+ MonoImage *image = NULL;
+
+ config_name = g_strconcat (exe_file, ".config", NULL);
+ app_config = app_config_parse (config_name);
+ g_free (config_name);
+
+ if (app_config != NULL) {
+ /* Check supportedRuntime elements, if none is supported, fail.
+ * If there are no such elements, look for a requiredRuntime element.
+ */
+ if (app_config->supported_runtimes != NULL) {
+ GSList *list = app_config->supported_runtimes;
+ while (list != NULL && runtime == NULL) {
+ version = (char*) list->data;
+ runtime = get_runtime_by_version (version);
+ list = g_slist_next (list);
+ }
+ app_config_free (app_config);
+ return runtime;
+ }
+
+ /* Check the requiredRuntime element. This is for 1.0 apps only. */
+ if (app_config->required_runtime != NULL) {
+ runtime = get_runtime_by_version (app_config->required_runtime);
+ app_config_free (app_config);
+ return runtime;
+ }
+ app_config_free (app_config);
+ }
+
+ /* Look for a runtime with the exact version */
+ image = mono_image_open (exe_file, NULL);
+ if (image == NULL) {
+ /* The image is wrong or the file was not found. In this case return
+ * a default runtime and leave to the initialization method the work of
+ * reporting the error.
+ */
+ return get_runtime_by_version (DEFAULT_RUNTIME_VERSION);
+ }
+
+ runtime = get_runtime_by_version (image->version);
+
+ return runtime;
+}
+
+const char*
+mono_get_framework_version (void)
+{
+ return current_runtime->framework_version;
+}
+
+const char*
+mono_get_runtime_version (void)
+{
+ return current_runtime->runtime_version;
+}
+
+gchar *
+mono_debugger_check_runtime_version (const char *filename)
+{
+ RuntimeInfo *rinfo;
+
+ rinfo = get_runtime_from_exe (filename);
+ if (!rinfo)
+ return g_strdup_printf ("Cannot get runtime version from assembly `%s'", filename);
+
+ if (rinfo != current_runtime)
+ return g_strdup_printf ("The Mono Debugger is currently using the `%s' runtime, but "
+ "the assembly `%s' requires version `%s'", current_runtime->runtime_version,
+ filename, rinfo->runtime_version);
+
+ return NULL;
+}
diff --git a/mono/metadata/environment.c b/mono/metadata/environment.c
new file mode 100644
index 00000000000..d5525861fdb
--- /dev/null
+++ b/mono/metadata/environment.c
@@ -0,0 +1,66 @@
+/*
+ * environment.c: System.Environment support internal calls
+ *
+ * Authors:
+ * Dick Porter (dick@ximian.com)
+ * Sebastien Pouliot (sebastien@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ * (C) 2004 Novell (http://www.novell.com)
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/exception.h>
+#include <mono/io-layer/io-layer.h>
+
+#ifndef PLATFORM_WIN32
+#include <sys/utsname.h>
+#endif
+
+static gint32 exitcode=0;
+
+gint32 mono_environment_exitcode_get (void)
+{
+ return(exitcode);
+}
+
+void mono_environment_exitcode_set (gint32 value)
+{
+ exitcode=value;
+}
+
+/* note: we better manipulate the string in managed code (easier and safer) */
+MonoString*
+ves_icall_System_Environment_GetOSVersionString (void)
+{
+#ifdef PLATFORM_WIN32
+ OSVERSIONINFO verinfo;
+
+ MONO_ARCH_SAVE_REGS;
+
+ verinfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+ if (GetVersionEx (&verinfo)) {
+ char version [64];
+ /* maximum string length is 35 bytes
+ 3 x 10 bytes per number, 1 byte for 0, 3 x 1 byte for dots, 1 for NULL */
+ sprintf (version, "%ld.%ld.%ld.0",
+ verinfo.dwMajorVersion,
+ verinfo.dwMinorVersion,
+ verinfo.dwBuildNumber);
+ return mono_string_new (mono_domain_get (), version);
+ }
+#else
+ struct utsname name;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (uname (&name) == 0) {
+ return mono_string_new (mono_domain_get (), name.release);
+ }
+#endif
+ return mono_string_new (mono_domain_get (), "0.0.0.0");
+}
diff --git a/mono/metadata/environment.h b/mono/metadata/environment.h
new file mode 100644
index 00000000000..4749fa720f8
--- /dev/null
+++ b/mono/metadata/environment.h
@@ -0,0 +1,18 @@
+/*
+ * environment.h: System.Environment support internal calls
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc
+ */
+
+#ifndef _MONO_METADATA_ENVIRONMENT_H_
+#define _MONO_METADATA_ENVIRONMENT_H_
+
+extern gint32 mono_environment_exitcode_get (void);
+extern void mono_environment_exitcode_set (gint32 value);
+
+extern MonoString* ves_icall_System_Environment_GetOSVersionString (void);
+
+#endif /* _MONO_METADATA_ENVIRONMENT_H_ */
diff --git a/mono/metadata/exception.c b/mono/metadata/exception.c
index 3ed2b9952e8..3376e96da7b 100644
--- a/mono/metadata/exception.c
+++ b/mono/metadata/exception.c
@@ -2,22 +2,40 @@
* exception.c: Exception handling
*
* Authors:
- * Paolo Molaro (lupus@ximian.com)
- * Dietmar Maurer (dietmar@ximian.com)
- * Dick Porter (dick@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Dick Porter (dick@ximian.com)
+ * Miguel de Icaza (miguel@ximian.com)
*
- * (C) 2001 Ximian, Inc.
+ * (C) 2001, 2002 Ximian, Inc.
*/
#include <mono/metadata/exception.h>
-#include <mono/metadata/class.h>
+#include <mono/metadata/object-internals.h>
#include <mono/metadata/appdomain.h>
+#include <string.h>
+/**
+ * mono_exception_from_name:
+ * @image: the Mono image where to look for the class
+ * @name_space: the namespace for the class
+ * @name: class name
+ *
+ * Creates an exception of the given namespace/name class.
+ *
+ * Returns: the initialized exception instance.
+ */
MonoException *
mono_exception_from_name (MonoImage *image, const char *name_space,
const char *name)
{
- MonoDomain *domain = mono_domain_get ();
+ return mono_exception_from_name_domain (mono_domain_get (), image, name_space, name);
+}
+
+MonoException *
+mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image,
+ const char* name_space, const char *name)
+{
MonoClass *klass;
MonoObject *o;
@@ -31,97 +49,194 @@ mono_exception_from_name (MonoImage *image, const char *name_space,
return (MonoException *)o;
}
+/**
+ * mono_exception_from_name_two_strings:
+ * @image: the Mono image where to look for the class
+ * @name_space: the namespace for the class
+ * @name: class name
+ * @a1: first string argument to pass
+ * @a2: second string argument to pass
+ *
+ * Creates an exception from a constructor that takes two string
+ * arguments.
+ *
+ * Returns: the initialized exception instance.
+ */
+MonoException *
+mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
+ const char *name, MonoString *a1, MonoString *a2)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoClass *klass;
+ MonoMethod *method = NULL;
+ MonoObject *o;
+ int count = 1;
+ gpointer args [2];
+ gpointer iter;
+ MonoMethod *m;
+
+ if (a2 != NULL)
+ count++;
+
+ klass = mono_class_from_name (image, name_space, name);
+ o = mono_object_new (domain, klass);
+
+ iter = NULL;
+ while ((m = mono_class_get_methods (klass, &iter))) {
+ MonoMethodSignature *sig;
+
+ if (strcmp (".ctor", mono_method_get_name (m)))
+ continue;
+ sig = mono_method_signature (m);
+ if (sig->param_count != count)
+ continue;
+
+ if (sig->params [0]->type != MONO_TYPE_STRING)
+ continue;
+ if (count == 2 && sig->params [1]->type != MONO_TYPE_STRING)
+ continue;
+ method = m;
+ }
+
+ args [0] = a1;
+ args [1] = a2;
+ mono_runtime_invoke (method, o, args, NULL);
+ return (MonoException *) o;
+}
+
+/**
+ * mono_exception_from_name_msg:
+ * @image: the Mono image where to look for the class
+ * @name_space: the namespace for the class
+ * @name: class name
+ * @msg: the message to embed inside the exception
+ *
+ * Creates an exception and initializes its message field.
+ *
+ * Returns: the initialized exception instance.
+ */
+MonoException *
+mono_exception_from_name_msg (MonoImage *image, const char *name_space,
+ const char *name, const guchar *msg)
+{
+ MonoException *ex;
+
+ ex = mono_exception_from_name (image, name_space, name);
+
+ if (msg)
+ ex->message = mono_string_new (mono_object_get_domain ((MonoObject*)ex), msg);
+
+ return ex;
+}
+
MonoException *
mono_get_exception_divide_by_zero ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"DivideByZeroException");
}
MonoException *
mono_get_exception_security ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System.Security",
"SecurityException");
}
MonoException *
+mono_get_exception_thread_abort ()
+{
+ return mono_exception_from_name (mono_get_corlib (), "System.Threading",
+ "ThreadAbortException");
+}
+
+MonoException *
mono_get_exception_arithmetic ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"ArithmeticException");
}
MonoException *
mono_get_exception_overflow ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"OverflowException");
}
MonoException *
mono_get_exception_null_reference ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"NullReferenceException");
}
MonoException *
mono_get_exception_execution_engine (const guchar *msg)
{
- MonoException *ex;
- MonoDomain *domain;
-
- ex = mono_exception_from_name (mono_defaults.corlib, "System",
- "ExecutionEngineException");
-
- domain = ((MonoObject *)ex)->vtable->domain;
-
- if (msg)
- ex->message = mono_string_new (domain, msg);
+ return mono_exception_from_name_msg (mono_get_corlib (), "System",
+ "ExecutionEngineException", msg);
+}
- return ex;
+MonoException *
+mono_get_exception_serialization (const guchar *msg)
+{
+ return mono_exception_from_name_msg (mono_get_corlib (), "System.Runtime.Serialization",
+ "SerializationException", msg);
}
MonoException *
mono_get_exception_invalid_cast ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"InvalidCastException");
}
MonoException *
mono_get_exception_index_out_of_range ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"IndexOutOfRangeException");
}
MonoException *
mono_get_exception_array_type_mismatch ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"ArrayTypeMismatchException");
}
MonoException *
-mono_get_exception_type_load ()
+mono_get_exception_type_load (MonoString *type_name)
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
- "TypeLoadException");
+ MonoTypeLoadException *exc;
+
+ exc = (MonoTypeLoadException *) mono_exception_from_name (mono_get_corlib (),
+ "System",
+ "TypeLoadException");
+
+ exc->type_name = type_name;
+ return (MonoException *) exc;
}
MonoException *
-mono_get_exception_not_implemented ()
+mono_get_exception_not_implemented (const guchar *msg)
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
- "NotImplementedException");
+ MonoException *ex;
+
+ ex = mono_exception_from_name (mono_get_corlib (), "System",
+ "NotImplementedException");
+
+ if (msg)
+ ex->message = mono_string_new (mono_object_get_domain ((MonoObject*)ex), msg);
+
+ return ex;
}
MonoException *
mono_get_exception_missing_method ()
{
- return mono_exception_from_name (mono_defaults.corlib, "System",
+ return mono_exception_from_name (mono_get_corlib (), "System",
"MissingMethodException");
}
@@ -129,16 +244,13 @@ MonoException*
mono_get_exception_argument_null (const guchar *arg)
{
MonoException *ex;
- MonoDomain *domain;
-
- ex = (MonoException *)mono_exception_from_name (
- mono_defaults.corlib, "System", "ArgumentNullException");
- domain = ((MonoObject *)ex)->vtable->domain;
+ ex = mono_exception_from_name (
+ mono_get_corlib (), "System", "ArgumentNullException");
if (arg)
((MonoArgumentException *)ex)->param_name =
- mono_string_new (domain, arg);
+ mono_string_new (mono_object_get_domain ((MonoObject*)ex), arg);
return ex;
}
@@ -147,19 +259,13 @@ MonoException *
mono_get_exception_argument (const guchar *arg, const guchar *msg)
{
MonoException *ex;
- MonoDomain *domain;
-
- ex = (MonoException *)mono_exception_from_name (
- mono_defaults.corlib, "System", "ArgumentException");
- domain = ((MonoObject *)ex)->vtable->domain;
+ ex = mono_exception_from_name_msg (
+ mono_get_corlib (), "System", "ArgumentException", msg);
- if (msg)
- ex->message = mono_string_new (domain, msg);
-
if (arg)
((MonoArgumentException *)ex)->param_name =
- mono_string_new (domain, arg);
+ mono_string_new (mono_object_get_domain ((MonoObject*)ex), arg);
return ex;
}
@@ -168,34 +274,106 @@ MonoException *
mono_get_exception_argument_out_of_range (const guchar *arg)
{
MonoException *ex;
- MonoDomain *domain;
-
- ex = (MonoException *)mono_exception_from_name (
- mono_defaults.corlib, "System", "ArgumentOutOfRangeException");
- domain = ((MonoObject *)ex)->vtable->domain;
+ ex = mono_exception_from_name (
+ mono_get_corlib (), "System", "ArgumentOutOfRangeException");
if (arg)
((MonoArgumentException *)ex)->param_name =
- mono_string_new (domain, arg);
+ mono_string_new (mono_object_get_domain ((MonoObject*)ex), arg);
return ex;
}
MonoException *
+mono_get_exception_thread_state (const guchar *msg)
+{
+ return mono_exception_from_name_msg (
+ mono_get_corlib (), "System.Threading", "ThreadStateException", msg);
+}
+
+MonoException *
mono_get_exception_io (const guchar *msg)
{
- MonoException *ex;
- MonoDomain *domain;
+ return mono_exception_from_name_msg (
+ mono_get_corlib (), "System.IO", "IOException", msg);
+}
- ex=(MonoException *)mono_exception_from_name (
- mono_defaults.corlib, "System.IO", "IOException");
+MonoException *
+mono_get_exception_file_not_found (MonoString *fname)
+{
+ return mono_exception_from_name_two_strings (
+ mono_get_corlib (), "System.IO", "FileNotFoundException", fname, fname);
+}
- domain = ((MonoObject *)ex)->vtable->domain;
+MonoException *
+mono_get_exception_file_not_found2 (const guchar *msg, MonoString *fname)
+{
+ MonoString *s = mono_string_new (mono_domain_get (), msg);
- ex->message=mono_string_new (domain, msg);
-
- return(ex);
+ return mono_exception_from_name_two_strings (
+ mono_get_corlib (), "System.IO", "FileNotFoundException", s, fname);
}
+MonoException *
+mono_get_exception_type_initialization (const gchar *type_name, MonoException *inner)
+{
+ MonoClass *klass;
+ gpointer args [2];
+ MonoObject *exc;
+ MonoMethod *method;
+ gpointer iter;
+
+ klass = mono_class_from_name (mono_get_corlib (), "System", "TypeInitializationException");
+ g_assert (klass);
+ mono_class_init (klass);
+
+ /* TypeInitializationException only has 1 ctor with 2 args */
+ iter = NULL;
+ while ((method = mono_class_get_methods (klass, &iter))) {
+ if (!strcmp (".ctor", mono_method_get_name (method)) && mono_method_signature (method)->param_count == 2)
+ break;
+ method = NULL;
+ }
+
+ g_assert (method);
+
+ args [0] = mono_string_new (mono_domain_get (), type_name);
+ args [1] = inner;
+
+ exc = mono_object_new (mono_domain_get (), klass);
+ mono_runtime_invoke (method, exc, args, NULL);
+
+ return (MonoException *) exc;
+}
+
+MonoException *
+mono_get_exception_synchronization_lock (const guchar *msg)
+{
+ return mono_exception_from_name_msg (mono_get_corlib (), "System.Threading", "SynchronizationLockException", msg);
+}
+
+MonoException *
+mono_get_exception_cannot_unload_appdomain (const guchar *msg)
+{
+ return mono_exception_from_name_msg (mono_get_corlib (), "System", "CannotUnloadAppDomainException", msg);
+}
+
+MonoException *
+mono_get_exception_appdomain_unloaded (void)
+{
+ return mono_exception_from_name (mono_get_corlib (), "System", "AppDomainUnloadedException");
+}
+
+MonoException *
+mono_get_exception_bad_image_format (const guchar *msg)
+{
+ return mono_exception_from_name_msg (mono_get_corlib (), "System", "BadImageFormatException", msg);
+}
+
+MonoException *
+mono_get_exception_stack_overflow (void)
+{
+ return mono_exception_from_name (mono_get_corlib (), "System", "StackOverflowException");
+}
diff --git a/mono/metadata/exception.h b/mono/metadata/exception.h
index 81bbc2206ae..2591171e12f 100644
--- a/mono/metadata/exception.h
+++ b/mono/metadata/exception.h
@@ -1,18 +1,27 @@
#ifndef _MONO_METADATA_EXCEPTION_H_
#define _MONO_METADATA_EXCEPTION_H_
+/* here for compat: should not be used anymore */
+#define MONO_ARCH_SAVE_REGS
+
#include <mono/metadata/object.h>
#include <mono/metadata/image.h>
-typedef void (*MonoExceptionClassInitFunc)(MonoClass *klass);
-typedef void (*MonoExceptionObjectInitFunc)(MonoObject *obj, MonoClass *klass);
+extern MonoException *
+mono_exception_from_name (MonoImage *image,
+ const char* name_space,
+ const char *name);
+
+MonoException *
+mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
+ const char *name, MonoString *a1, MonoString *a2);
-extern void
-mono_exception_install_handlers (MonoExceptionClassInitFunc class_init,
- MonoExceptionObjectInitFunc obj_init);
+MonoException *
+mono_exception_from_name_msg (MonoImage *image, const char *name_space,
+ const char *name, const guchar *msg);
extern MonoException *
-mono_exception_from_name (MonoImage *image,
+mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image,
const char* name_space,
const char *name);
@@ -35,6 +44,15 @@ MonoException *
mono_get_exception_execution_engine (const guchar *msg);
MonoException *
+mono_get_exception_thread_abort (void);
+
+MonoException *
+mono_get_exception_thread_state (const guchar *msg);
+
+MonoException *
+mono_get_exception_serialization (const guchar *msg);
+
+MonoException *
mono_get_exception_invalid_cast (void);
MonoException *
@@ -44,13 +62,13 @@ MonoException *
mono_get_exception_array_type_mismatch (void);
MonoException *
-mono_get_exception_type_load (void);
+mono_get_exception_type_load (MonoString *type_name);
MonoException *
mono_get_exception_missing_method (void);
MonoException *
-mono_get_exception_not_implemented (void);
+mono_get_exception_not_implemented (const guchar *msg);
MonoException*
mono_get_exception_argument_null (const guchar *arg);
@@ -62,6 +80,30 @@ MonoException *
mono_get_exception_argument_out_of_range (const guchar *arg);
MonoException *
-mono_get_exception_io (const guchar *msg);
+mono_get_exception_io (const guchar *msg);
+
+MonoException *
+mono_get_exception_file_not_found (MonoString *fname);
+
+MonoException *
+mono_get_exception_file_not_found2 (const guchar *msg, MonoString *fname);
+
+MonoException *
+mono_get_exception_type_initialization (const gchar *type_name, MonoException *inner);
+
+MonoException *
+mono_get_exception_synchronization_lock (const guchar *msg);
+
+MonoException *
+mono_get_exception_cannot_unload_appdomain (const guchar *msg);
+
+MonoException *
+mono_get_exception_appdomain_unloaded (void);
+
+MonoException *
+mono_get_exception_bad_image_format (const guchar *msg);
+
+MonoException *
+mono_get_exception_stack_overflow (void);
#endif /* _MONO_METADATA_EXCEPTION_H_ */
diff --git a/mono/metadata/file-io.c b/mono/metadata/file-io.c
index cad73f10311..dec7f1f6282 100644
--- a/mono/metadata/file-io.c
+++ b/mono/metadata/file-io.c
@@ -9,12 +9,29 @@
#include <config.h>
#include <glib.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+
+#ifndef PLATFORM_WIN32
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#define USE_AIO 1
+#elif defined(HAVE_SYS_AIO_H)
+#include <sys/aio.h>
+#define USE_AIO 1
+#else
+#undef USE_AIO
+#endif
+#endif
#include <mono/metadata/object.h>
#include <mono/io-layer/io-layer.h>
#include <mono/metadata/file-io.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
#undef DEBUG
@@ -154,10 +171,10 @@ static guint32 convert_seekorigin(MonoSeekOrigin origin)
static gint64 convert_filetime (const FILETIME *filetime)
{
- gint64 *ticks;
-
- ticks = (gint64 *)filetime;
- return *ticks;
+ guint64 ticks = filetime->dwHighDateTime;
+ ticks <<= 32;
+ ticks += filetime->dwLowDateTime;
+ return (gint64)ticks;
}
static void convert_win32_file_attribute_data (const WIN32_FILE_ATTRIBUTE_DATA *data, const gunichar2 *name, MonoIOStat *stat)
@@ -177,321 +194,543 @@ static void convert_win32_file_attribute_data (const WIN32_FILE_ATTRIBUTE_DATA *
stat->name = mono_string_new_utf16 (mono_domain_get (), name, len);
}
-/* System.IO.MonoIO internal calls */
-
-gint32
-ves_icall_System_IO_MonoIO_GetLastError ()
+/* Managed file attributes have nearly but not quite the same values
+ * as the w32 equivalents.
+ */
+static guint32 convert_attrs(MonoFileAttributes attrs)
{
- return GetLastError ();
+ if(attrs & FileAttributes_Encrypted) {
+ attrs |= FILE_ATTRIBUTE_ENCRYPTED;
+ }
+
+ return(attrs);
}
-gboolean
-ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path)
-{
- gunichar2 *utf16_path;
- gboolean result;
+/* System.IO.MonoIO internal calls */
- utf16_path = mono_string_to_utf16 (path);
- result = CreateDirectory (utf16_path, NULL);
- g_free (utf16_path);
+MonoBoolean
+ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error)
+{
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=CreateDirectory (mono_string_chars (path), NULL);
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
-gboolean
-ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path)
+MonoBoolean
+ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error)
{
- gunichar2 *utf16_path;
- gboolean result;
-
- utf16_path = mono_string_to_utf16 (path);
- result = RemoveDirectory (utf16_path);
- g_free (utf16_path);
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=RemoveDirectory (mono_string_chars (path));
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
HANDLE
-ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path, MonoIOStat *stat)
+ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path, MonoIOStat *stat,
+ gint32 *error)
{
- gunichar2 *utf16_path;
WIN32_FIND_DATA data;
HANDLE result;
+ gboolean r = TRUE;
- utf16_path = mono_string_to_utf16 (path);
- result = FindFirstFile (utf16_path, &data);
- g_free (utf16_path);
+ MONO_ARCH_SAVE_REGS;
- /* note: WIN32_FIND_DATA is an extension of WIN32_FILE_ATTRIBUTE_DATA */
+ *error=ERROR_SUCCESS;
- if (result != INVALID_HANDLE_VALUE)
- convert_win32_file_attribute_data ((const WIN32_FILE_ATTRIBUTE_DATA *)&data,
- &data.cFileName [0], stat);
+ result = FindFirstFile (mono_string_chars (path), &data);
+
+ /* note: WIN32_FIND_DATA is an extension of WIN32_FILE_ATTRIBUTE_DATA */
+ while (result != INVALID_HANDLE_VALUE && r) {
+ if ((data.cFileName [0] == '.' && data.cFileName [1] == 0) ||
+ (data.cFileName [0] == '.' && data.cFileName [1] == '.' && data.cFileName [2] == 0)) {
+ r = FindNextFile (result, &data);
+ } else {
+ convert_win32_file_attribute_data ((const WIN32_FILE_ATTRIBUTE_DATA *)&data,
+ &data.cFileName [0], stat);
+ break;
+ }
+ }
+
+ if (result == INVALID_HANDLE_VALUE) {
+ *error=GetLastError ();
+ }
+
+ if (r == FALSE) {
+ /* No more files were found, after we discarded . and .. */
+ FindClose(result);
+ result = INVALID_HANDLE_VALUE;
+ *error = ERROR_NO_MORE_FILES;
+ }
return result;
}
-gboolean
-ves_icall_System_IO_MonoIO_FindNextFile (HANDLE find, MonoIOStat *stat)
+MonoBoolean
+ves_icall_System_IO_MonoIO_FindNextFile (HANDLE find, MonoIOStat *stat,
+ gint32 *error)
{
WIN32_FIND_DATA data;
gboolean result;
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
result = FindNextFile (find, &data);
- if (result)
- convert_win32_file_attribute_data ((const WIN32_FILE_ATTRIBUTE_DATA *)&data,
- &data.cFileName [0], stat);
+ while (result != FALSE) {
+ if ((data.cFileName [0] == '.' && data.cFileName [1] == 0) ||
+ (data.cFileName [0] == '.' && data.cFileName [1] == '.' && data.cFileName [2] == 0)) {
+ result = FindNextFile (find, &data);
+ } else {
+ convert_win32_file_attribute_data ((const WIN32_FILE_ATTRIBUTE_DATA *)&data,
+ &data.cFileName [0], stat);
+ break;
+ }
+ }
+
+ if (result == FALSE) {
+ *error=GetLastError ();
+ }
return result;
}
-gboolean
-ves_icall_System_IO_MonoIO_FindClose (HANDLE find)
+MonoBoolean
+ves_icall_System_IO_MonoIO_FindClose (HANDLE find, gint32 *error)
{
- return FindClose (find);
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
+ ret=FindClose (find);
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
MonoString *
-ves_icall_System_IO_MonoIO_GetCurrentDirectory ()
+ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *error)
{
MonoString *result;
gunichar2 *buf;
int len;
+ MONO_ARCH_SAVE_REGS;
+
len = MAX_PATH + 1;
buf = g_new (gunichar2, len);
+ *error=ERROR_SUCCESS;
result = NULL;
+
if (GetCurrentDirectory (len, buf) > 0) {
len = 0;
while (buf [len])
++ len;
result = mono_string_new_utf16 (mono_domain_get (), buf, len);
+ } else {
+ *error=GetLastError ();
}
g_free (buf);
return result;
}
-gboolean
-ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path)
+MonoBoolean
+ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path,
+ gint32 *error)
{
- gunichar2 *utf16_path;
- gboolean result;
+ gboolean ret;
- utf16_path = mono_string_to_utf16 (path);
- result = SetCurrentDirectory (utf16_path);
- g_free (utf16_path);
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=SetCurrentDirectory (mono_string_chars (path));
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
-gboolean
-ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest)
+MonoBoolean
+ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest,
+ gint32 *error)
{
- gunichar2 *utf16_path, *utf16_dest;
- gboolean result;
-
- utf16_path = mono_string_to_utf16 (path);
- utf16_dest = mono_string_to_utf16 (dest);
- result = MoveFile (utf16_path, utf16_dest);
- g_free (utf16_path);
- g_free (utf16_dest);
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=MoveFile (mono_string_chars (path), mono_string_chars (dest));
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
-gboolean
-ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest, gboolean overwrite)
+MonoBoolean
+ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest,
+ MonoBoolean overwrite, gint32 *error)
{
- gunichar2 *utf16_path, *utf16_dest;
- gboolean result;
-
- utf16_path = mono_string_to_utf16 (path);
- utf16_dest = mono_string_to_utf16 (dest);
- result = CopyFile (utf16_path, utf16_dest, !overwrite);
- g_free (utf16_path);
- g_free (utf16_dest);
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=CopyFile (mono_string_chars (path), mono_string_chars (dest), !overwrite);
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
-gboolean
-ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path)
+MonoBoolean
+ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error)
{
- gunichar2 *utf16_path;
- gboolean result;
-
- utf16_path = mono_string_to_utf16 (path);
- result = DeleteFile (utf16_path);
- g_free (utf16_path);
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=DeleteFile (mono_string_chars (path));
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
gint32
-ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path)
+ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error)
{
- gunichar2 *utf16_path;
- gint32 result;
-
- utf16_path = mono_string_to_utf16 (path);
- result = GetFileAttributes (utf16_path);
- g_free (utf16_path);
+ gint32 ret;
+
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=GetFileAttributes (mono_string_chars (path));
+
+ /*
+ * The definition of INVALID_FILE_ATTRIBUTES in the cygwin win32
+ * headers is wrong, hence this temporary workaround.
+ * See
+ * http://cygwin.com/ml/cygwin/2003-09/msg01771.html
+ */
+ if (ret==-1) {
+ /* if(ret==INVALID_FILE_ATTRIBUTES) { */
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
-gboolean
-ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs)
+MonoBoolean
+ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
+ gint32 *error)
{
- gunichar2 *utf16_path;
- gboolean result;
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
- utf16_path = mono_string_to_utf16 (path);
- result = SetFileAttributes (utf16_path, attrs);
- g_free (utf16_path);
+ *error=ERROR_SUCCESS;
+
+ ret=SetFileAttributes (mono_string_chars (path),
+ convert_attrs (attrs));
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
+}
- return result;
+gint32
+ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error)
+{
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
+ ret=GetFileType (handle);
+ if(ret==FILE_TYPE_UNKNOWN) {
+ /* Not necessarily an error, but the caller will have
+ * to decide based on the error value.
+ */
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
-gboolean
-ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat)
+MonoBoolean
+ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat,
+ gint32 *error)
{
- gunichar2 *utf16_path;
gboolean result;
WIN32_FILE_ATTRIBUTE_DATA data;
- utf16_path = mono_string_to_utf16 (path);
- result = GetFileAttributesEx (utf16_path, GetFileExInfoStandard, &data);
- g_free (utf16_path);
+ MONO_ARCH_SAVE_REGS;
- if (result)
- convert_win32_file_attribute_data (&data, utf16_path, stat);
+ *error=ERROR_SUCCESS;
+
+ result = GetFileAttributesEx (mono_string_chars (path), GetFileExInfoStandard, &data);
+
+ if (result) {
+ convert_win32_file_attribute_data (&data,
+ mono_string_chars (path),
+ stat);
+ } else {
+ *error=GetLastError ();
+ }
return result;
}
HANDLE
-ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode, gint32 access_mode, gint32 share)
+ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
+ gint32 access_mode, gint32 share,
+ MonoBoolean async, gint32 *error)
{
- gunichar2 *utf16_filename;
- HANDLE result;
-
- utf16_filename = mono_string_to_utf16 (filename);
- result = CreateFile (utf16_filename, convert_access (access_mode), convert_share (share),
- NULL, convert_mode (mode), FILE_ATTRIBUTE_NORMAL, NULL);
- g_free (utf16_filename);
+ HANDLE ret;
+
+ MONO_ARCH_SAVE_REGS;
- return result;
+ *error=ERROR_SUCCESS;
+
+ ret=CreateFile (mono_string_chars (filename),
+ convert_access (access_mode), convert_share (share),
+ NULL, convert_mode (mode),
+ FILE_ATTRIBUTE_NORMAL | ((async) ? FILE_FLAG_OVERLAPPED : 0),
+ NULL);
+ if(ret==INVALID_HANDLE_VALUE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
-gboolean
-ves_icall_System_IO_MonoIO_Close (HANDLE handle)
+MonoBoolean
+ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error)
{
- return CloseHandle (handle);
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
+ ret=CloseHandle (handle);
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
gint32
-ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest, gint32 dest_offset, gint32 count)
+ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
+ gint32 dest_offset, gint32 count,
+ gint32 *error)
{
guchar *buffer;
gboolean result;
guint32 n;
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
if (dest_offset + count > mono_array_length (dest))
return 0;
buffer = mono_array_addr (dest, guchar, dest_offset);
result = ReadFile (handle, buffer, count, &n, NULL);
- if (!result)
+ if (!result) {
+ *error=GetLastError ();
return -1;
+ }
return (gint32)n;
}
gint32
-ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src, gint32 src_offset, gint32 count)
+ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
+ gint32 src_offset, gint32 count,
+ gint32 *error)
{
guchar *buffer;
gboolean result;
guint32 n;
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
if (src_offset + count > mono_array_length (src))
return 0;
buffer = mono_array_addr (src, guchar, src_offset);
result = WriteFile (handle, buffer, count, &n, NULL);
- if (!result)
+ if (!result) {
+ *error=GetLastError ();
return -1;
+ }
return (gint32)n;
}
gint64
-ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin)
+ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
+ gint32 *error)
{
guint32 offset_hi;
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
offset_hi = offset >> 32;
offset = SetFilePointer (handle, offset & 0xFFFFFFFF, &offset_hi,
convert_seekorigin (origin));
+ if(offset==INVALID_SET_FILE_POINTER) {
+ *error=GetLastError ();
+ }
+
return offset | ((gint64)offset_hi << 32);
}
-gboolean
-ves_icall_System_IO_MonoIO_Flush (HANDLE handle)
+MonoBoolean
+ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error)
{
- return FlushFileBuffers (handle);
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
+ ret=FlushFileBuffers (handle);
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
gint64
-ves_icall_System_IO_MonoIO_GetLength (HANDLE handle)
+ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error)
{
gint64 length;
guint32 length_hi;
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
length = GetFileSize (handle, &length_hi);
+ if(length==INVALID_FILE_SIZE) {
+ *error=GetLastError ();
+ }
+
return length | ((gint64)length_hi << 32);
}
-gboolean
-ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length)
+MonoBoolean
+ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length,
+ gint32 *error)
{
- gint64 offset;
+ gint64 offset, offset_set;
gint32 offset_hi;
gint32 length_hi;
gboolean result;
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
/* save file pointer */
offset_hi = 0;
offset = SetFilePointer (handle, 0, &offset_hi, FILE_CURRENT);
+ if(offset==INVALID_SET_FILE_POINTER) {
+ *error=GetLastError ();
+ return(FALSE);
+ }
/* extend or truncate */
length_hi = length >> 32;
- SetFilePointer (handle, length & 0xFFFFFFFF, &length_hi, FILE_BEGIN);
+ offset_set=SetFilePointer (handle, length & 0xFFFFFFFF, &length_hi,
+ FILE_BEGIN);
+ if(offset_set==INVALID_SET_FILE_POINTER) {
+ *error=GetLastError ();
+ return(FALSE);
+ }
+
result = SetEndOfFile (handle);
+ if(result==FALSE) {
+ *error=GetLastError ();
+ return(FALSE);
+ }
/* restore file pointer */
- SetFilePointer (handle, offset & 0xFFFFFFFF, &offset_hi, FILE_BEGIN);
+ offset_set=SetFilePointer (handle, offset & 0xFFFFFFFF, &offset_hi,
+ FILE_BEGIN);
+ if(offset_set==INVALID_SET_FILE_POINTER) {
+ *error=GetLastError ();
+ return(FALSE);
+ }
return result;
}
-gboolean
-ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time, gint64 last_access_time, gint64 last_write_time)
+MonoBoolean
+ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
+ gint64 last_access_time,
+ gint64 last_write_time, gint32 *error)
{
+ gboolean ret;
const FILETIME *creation_filetime;
const FILETIME *last_access_filetime;
const FILETIME *last_write_filetime;
+ MONO_ARCH_SAVE_REGS;
+
+ *error=ERROR_SUCCESS;
+
if (creation_time < 0)
creation_filetime = NULL;
else
@@ -507,30 +746,65 @@ ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time, gin
else
last_write_filetime = (FILETIME *)&last_write_time;
- return SetFileTime (handle, creation_filetime, last_access_filetime, last_write_filetime);
+ ret=SetFileTime (handle, creation_filetime, last_access_filetime, last_write_filetime);
+ if(ret==FALSE) {
+ *error=GetLastError ();
+ }
+
+ return(ret);
}
HANDLE
ves_icall_System_IO_MonoIO_get_ConsoleOutput ()
{
+ MONO_ARCH_SAVE_REGS;
+
return GetStdHandle (STD_OUTPUT_HANDLE);
}
HANDLE
ves_icall_System_IO_MonoIO_get_ConsoleInput ()
{
+ MONO_ARCH_SAVE_REGS;
+
return GetStdHandle (STD_INPUT_HANDLE);
}
HANDLE
ves_icall_System_IO_MonoIO_get_ConsoleError ()
{
+ MONO_ARCH_SAVE_REGS;
+
return GetStdHandle (STD_ERROR_HANDLE);
}
+MonoBoolean
+ves_icall_System_IO_MonoIO_CreatePipe (HANDLE *read_handle,
+ HANDLE *write_handle)
+{
+ SECURITY_ATTRIBUTES attr;
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ attr.nLength=sizeof(SECURITY_ATTRIBUTES);
+ attr.bInheritHandle=TRUE;
+ attr.lpSecurityDescriptor=NULL;
+
+ ret=CreatePipe (read_handle, write_handle, &attr, 0);
+ if(ret==FALSE) {
+ /* FIXME: throw an exception? */
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
+
gunichar2
ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar ()
{
+ MONO_ARCH_SAVE_REGS;
+
#if defined (PLATFORM_WIN32)
return (gunichar2) 0x003a; /* colon */
#else
@@ -541,6 +815,8 @@ ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar ()
gunichar2
ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar ()
{
+ MONO_ARCH_SAVE_REGS;
+
#if defined (PLATFORM_WIN32)
return (gunichar2) 0x005c; /* backslash */
#else
@@ -551,6 +827,8 @@ ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar ()
gunichar2
ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar ()
{
+ MONO_ARCH_SAVE_REGS;
+
#if defined (PLATFORM_WIN32)
return (gunichar2) 0x002f; /* forward slash */
#else
@@ -561,6 +839,8 @@ ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar ()
gunichar2
ves_icall_System_IO_MonoIO_get_PathSeparator ()
{
+ MONO_ARCH_SAVE_REGS;
+
#if defined (PLATFORM_WIN32)
return (gunichar2) 0x003b; /* semicolon */
#else
@@ -570,10 +850,20 @@ ves_icall_System_IO_MonoIO_get_PathSeparator ()
static gunichar2 invalid_path_chars [] = {
#if defined (PLATFORM_WIN32)
- 0x0022, /* double quote */
+ 0x0022, /* double quote, which seems allowed in MS.NET but should be rejected */
0x003c, /* less than */
0x003e, /* greater than */
0x007c, /* pipe */
+ 0x0008,
+ 0x0010,
+ 0x0011,
+ 0x0012,
+ 0x0014,
+ 0x0015,
+ 0x0016,
+ 0x0017,
+ 0x0018,
+ 0x0019,
#endif
0x0000 /* null */
};
@@ -585,8 +875,10 @@ ves_icall_System_IO_MonoIO_get_InvalidPathChars ()
MonoDomain *domain;
int i, n;
+ MONO_ARCH_SAVE_REGS;
+
domain = mono_domain_get ();
- chars = mono_array_new (domain, mono_defaults.char_class, 5);
+ chars = mono_array_new (domain, mono_defaults.char_class, 15);
n = sizeof (invalid_path_chars) / sizeof (gunichar2);
@@ -595,3 +887,125 @@ ves_icall_System_IO_MonoIO_get_InvalidPathChars ()
return chars;
}
+
+gint32
+ves_icall_System_IO_MonoIO_GetTempPath (MonoString **mono_name)
+{
+ gunichar2 *name;
+ int ret;
+
+ name=g_new0 (gunichar2, 256);
+
+ ret=GetTempPath (256, name);
+ if(ret>255) {
+ /* Buffer was too short. Try again... */
+ g_free (name);
+ name=g_new0 (gunichar2, ret+2); /* include the terminator */
+ ret=GetTempPath (ret, name);
+ }
+
+ if(ret>0) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Temp path is [%s] (len %d)", name, ret);
+#endif
+
+ *mono_name=mono_string_new_utf16 (mono_domain_get (), name,
+ ret);
+ }
+
+ g_free (name);
+
+ return(ret);
+}
+
+/*
+ * Asynchronous IO
+ */
+MonoBoolean
+ves_icall_System_IO_MonoIO_GetSupportsAsync (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef PLATFORM_WIN32
+ /* Seems like BindIoCompletionCallback is not found when compiling...
+ * Disabling AIO support on win. Any one wants to fix this?
+ */
+ return FALSE;
+ /* return (g_getenv ("MONO_DISABLE_AIO") == NULL && WINVER >= 0x500); */
+#elif defined(USE_AIO)
+ if (aio_cancel (-1, NULL) == -1 && errno == ENOSYS)
+ return FALSE;
+
+ return (g_getenv ("MONO_DISABLE_AIO") == NULL);
+#else
+ return FALSE;
+#endif
+}
+
+static WapiOverlapped *
+get_overlapped_from_fsa (MonoFSAsyncResult *ares)
+{
+ WapiOverlapped *ovl;
+
+ ovl = g_new0 (WapiOverlapped, 1);
+ ovl->Offset = ares->offset;
+ ovl->hEvent = ares->wait_handle;
+
+ return ovl;
+}
+
+MonoBoolean
+ves_icall_System_IO_MonoIO_BeginRead (HANDLE handle, MonoFSAsyncResult *ares)
+{
+ guint32 bytesread;
+ WapiOverlapped *ovl;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ovl = get_overlapped_from_fsa (ares);
+ ovl->handle1 = ares;
+ return ReadFile (handle, mono_array_addr (ares->buffer, gchar, ares->offset), ares->count, &bytesread, ovl);
+}
+
+MonoBoolean
+ves_icall_System_IO_MonoIO_BeginWrite (HANDLE handle, MonoFSAsyncResult *ares)
+{
+ guint32 byteswritten;
+ WapiOverlapped *ovl;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ovl = get_overlapped_from_fsa (ares);
+ ovl->handle1 = ares;
+ return WriteFile (handle, mono_array_addr (ares->buffer, gchar, ares->offset), ares->count, &byteswritten, ovl);
+}
+
+void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
+ gint64 length, gint32 *error)
+{
+ gboolean ret;
+
+ *error=ERROR_SUCCESS;
+
+ ret=LockFile (handle, position & 0xFFFFFFFF, position >> 32,
+ length & 0xFFFFFFFF, length >> 32);
+ if (ret == FALSE) {
+ *error = GetLastError ();
+ }
+}
+
+void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
+ gint64 length, gint32 *error)
+{
+ gboolean ret;
+
+ *error=ERROR_SUCCESS;
+
+ ret=UnlockFile (handle, position & 0xFFFFFFFF, position >> 32,
+ length & 0xFFFFFFFF, length >> 32);
+ if (ret == FALSE) {
+ *error = GetLastError ();
+ }
+}
+
diff --git a/mono/metadata/file-io.h b/mono/metadata/file-io.h
index ec6839ee737..55ce8383087 100644
--- a/mono/metadata/file-io.h
+++ b/mono/metadata/file-io.h
@@ -14,14 +14,14 @@
#include <config.h>
#include <glib.h>
-#include <mono/metadata/object.h>
+#include <mono/metadata/object-internals.h>
#include <mono/io-layer/io-layer.h>
/* This is a copy of System.IO.FileAccess */
typedef enum {
FileAccess_Read=0x01,
FileAccess_Write=0x02,
- FileAccess_ReadWrite=FileAccess_Read|FileAccess_Write,
+ FileAccess_ReadWrite=FileAccess_Read|FileAccess_Write
} MonoFileAccess;
/* This is a copy of System.IO.FileMode */
@@ -31,7 +31,7 @@ typedef enum {
FileMode_Open=3,
FileMode_OpenOrCreate=4,
FileMode_Truncate=5,
- FileMode_Append=6,
+ FileMode_Append=6
} MonoFileMode;
/* This is a copy of System.IO.FileShare */
@@ -39,14 +39,14 @@ typedef enum {
FileShare_None=0x0,
FileShare_Read=0x01,
FileShare_Write=0x02,
- FileShare_ReadWrite=FileShare_Read|FileShare_Write,
+ FileShare_ReadWrite=FileShare_Read|FileShare_Write
} MonoFileShare;
/* This is a copy of System.IO.SeekOrigin */
typedef enum {
SeekOrigin_Begin=0,
SeekOrigin_Current=1,
- SeekOrigin_End=2,
+ SeekOrigin_End=2
} MonoSeekOrigin;
/* This is a copy of System.IO.MonoIOStat */
@@ -59,76 +59,144 @@ typedef struct _MonoIOStat {
gint64 last_write_time;
} MonoIOStat;
-/* System.IO.MonoIO */
+/* This is a copy of System.IO.FileAttributes */
+typedef enum {
+ FileAttributes_ReadOnly=0x00001,
+ FileAttributes_Hidden=0x00002,
+ FileAttributes_System=0x00004,
+ FileAttributes_Directory=0x00010,
+ FileAttributes_Archive=0x00020,
+ FileAttributes_Device=0x00040,
+ FileAttributes_Normal=0x00080,
+ FileAttributes_Temporary=0x00100,
+ FileAttributes_SparseFile=0x00200,
+ FileAttributes_ReparsePoint=0x00400,
+ FileAttributes_Compressed=0x00800,
+ FileAttributes_Offline=0x01000,
+ FileAttributes_NotContentIndexed=0x02000,
+ FileAttributes_Encrypted=0x04000,
+ FileAttributes_MonoExecutable= (int) 0x80000000
+} MonoFileAttributes;
+
+typedef struct _MonoFSAsyncResult {
+ MonoObject obj;
+ MonoObject *state;
+ MonoBoolean completed;
+ MonoBoolean done;
+ MonoException *exc;
+ MonoWaitHandle *wait_handle;
+ MonoDelegate *async_callback;
+ MonoBoolean completed_synch;
+ MonoArray *buffer;
+ gint offset;
+ gint count;
+ gint original_count;
+ gint bytes_read;
+ MonoDelegate *real_cb;
+} MonoFSAsyncResult;
+
+#ifdef PLATFORM_WIN32
+typedef struct _WapiOverlapped WapiOverlapped;
+
+struct _WapiOverlapped
+{
+ guint32 Internal;
+ guint32 InternalHigh;
+ guint32 Offset;
+ guint32 OffsetHigh;
+ gpointer hEvent;
+ gpointer handle1;
+ gpointer handle2;
+};
+#endif
-extern gint32
-ves_icall_System_IO_MonoIO_GetLastError (void);
+/* System.IO.MonoIO */
-extern gboolean
-ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_CreateDirectory (MonoString *path, gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_RemoveDirectory (MonoString *path, gint32 *error);
extern HANDLE
-ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path, MonoIOStat *stat);
+ves_icall_System_IO_MonoIO_FindFirstFile (MonoString *path, MonoIOStat *stat,
+ gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_FindNextFile (HANDLE find, MonoIOStat *stat);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_FindNextFile (HANDLE find, MonoIOStat *stat,
+ gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_FindClose (HANDLE find);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_FindClose (HANDLE find, gint32 *error);
extern MonoString *
-ves_icall_System_IO_MonoIO_GetCurrentDirectory (void);
+ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetCurrentDirectory (MonoString *path,
+ gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_MoveFile (MonoString *path, MonoString *dest,
+ gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest, gboolean overwrite);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_CopyFile (MonoString *path, MonoString *dest,
+ MonoBoolean overwrite, gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_DeleteFile (MonoString *path, gint32 *error);
extern gint32
-ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path);
+ves_icall_System_IO_MonoIO_GetFileAttributes (MonoString *path, gint32 *error);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs,
+ gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_SetFileAttributes (MonoString *path, gint32 attrs);
+extern gint32
+ves_icall_System_IO_MonoIO_GetFileType (HANDLE handle, gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_GetFileStat (MonoString *path, MonoIOStat *stat,
+ gint32 *error);
extern HANDLE
-ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode, gint32 access_mode, gint32 share);
+ves_icall_System_IO_MonoIO_Open (MonoString *filename, gint32 mode,
+ gint32 access_mode, gint32 share,
+ MonoBoolean async, gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_Close (HANDLE handle);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_Close (HANDLE handle, gint32 *error);
extern gint32
-ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest, gint32 dest_offset, gint32 count);
+ves_icall_System_IO_MonoIO_Read (HANDLE handle, MonoArray *dest,
+ gint32 dest_offset, gint32 count,
+ gint32 *error);
extern gint32
-ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src, gint32 src_offset, gint32 count);
+ves_icall_System_IO_MonoIO_Write (HANDLE handle, MonoArray *src,
+ gint32 src_offset, gint32 count,
+ gint32 *error);
extern gint64
-ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin);
+ves_icall_System_IO_MonoIO_Seek (HANDLE handle, gint64 offset, gint32 origin,
+ gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_Flush (HANDLE handle);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_Flush (HANDLE handle, gint32 *error);
extern gint64
-ves_icall_System_IO_MonoIO_GetLength (HANDLE handle);
+ves_icall_System_IO_MonoIO_GetLength (HANDLE handle, gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetLength (HANDLE handle, gint64 length,
+ gint32 *error);
-extern gboolean
-ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time, gint64 last_access_time, gint64 last_write_time);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_SetFileTime (HANDLE handle, gint64 creation_time,
+ gint64 last_access_time,
+ gint64 last_write_time, gint32 *error);
extern HANDLE
ves_icall_System_IO_MonoIO_get_ConsoleOutput (void);
@@ -139,6 +207,10 @@ ves_icall_System_IO_MonoIO_get_ConsoleInput (void);
extern HANDLE
ves_icall_System_IO_MonoIO_get_ConsoleError (void);
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_CreatePipe (HANDLE *read_handle,
+ HANDLE *write_handle);
+
extern gunichar2
ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar (void);
@@ -154,4 +226,21 @@ ves_icall_System_IO_MonoIO_get_PathSeparator (void);
extern MonoArray *
ves_icall_System_IO_MonoIO_get_InvalidPathChars (void);
+extern gint32
+ves_icall_System_IO_MonoIO_GetTempPath (MonoString **mono_name);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_GetSupportsAsync (void);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_BeginRead (HANDLE handle, MonoFSAsyncResult *ares);
+
+extern MonoBoolean
+ves_icall_System_IO_MonoIO_BeginWrite (HANDLE handle, MonoFSAsyncResult *ares);
+
+extern void ves_icall_System_IO_MonoIO_Lock (HANDLE handle, gint64 position,
+ gint64 length, gint32 *error);
+extern void ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position,
+ gint64 length, gint32 *error);
+
#endif /* _MONO_METADATA_FILEIO_H_ */
diff --git a/mono/metadata/filewatcher.c b/mono/metadata/filewatcher.c
new file mode 100644
index 00000000000..731eb3a1ad2
--- /dev/null
+++ b/mono/metadata/filewatcher.c
@@ -0,0 +1,172 @@
+/*
+ * filewatcher.c: File System Watcher internal calls
+ *
+ * Authors:
+ * Gonzalo Paniagua Javier (gonzalo@ximian.com)
+ *
+ * (C) 2004 Novell, Inc. (http://www.novell.com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/filewatcher.h>
+
+#if (defined (PLATFORM_WIN32) && WINVER >= 0x0400)
+/* Supported under windows */
+gint
+ves_icall_System_IO_FSW_SupportsFSW (void)
+{
+ return 1;
+}
+
+gpointer
+ves_icall_System_IO_FSW_OpenDirectory (MonoString *path, gpointer reserved)
+{
+ gpointer dir;
+ gchar *utf8path;
+
+ MONO_ARCH_SAVE_REGS;
+
+ utf8path = mono_string_to_utf8 (path);
+ dir = CreateFile (path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE,
+ NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ g_free (utf8path);
+
+ return dir;
+}
+
+gboolean
+ves_icall_System_IO_FSW_CloseDirectory (gpointer handle)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return CloseHandle (handle);
+}
+
+gboolean
+ves_icall_System_IO_FSW_ReadDirectoryChanges ( gpointer handle,
+ MonoArray *buffer,
+ gboolean includeSubdirs,
+ gint filters,
+ gpointer overlap,
+ gpointer callback)
+{
+ gpointer dest;
+ gint size;
+ MonoObject *delegate = (MonoObject *) callback;
+ MonoMethod *im;
+ LPOVERLAPPED_COMPLETION_ROUTINE func;
+
+ MONO_ARCH_SAVE_REGS;
+
+ size = mono_array_length (buffer);
+ dest = mono_array_addr_with_size (buffer, 1, 0);
+
+ im = mono_get_delegate_invoke (mono_object_get_class (delegate));
+ func = mono_compile_method (im);
+ return FALSE;
+ /* return ReadDirectoryChanges (handle, dest, size, includeSubdirs, filters,
+ NULL, (LPOVERLAPPED) overlap,
+ func); */
+}
+
+gboolean
+ves_icall_System_IO_FAMW_InternalFAMNextEvent (gpointer conn,
+ MonoString **filename,
+ gint *code,
+ gint *reqnum)
+{
+ return FALSE;
+}
+#else
+
+static int (*FAMNextEvent) (gpointer, gpointer);
+
+gint
+ves_icall_System_IO_FSW_SupportsFSW (void)
+{
+#if HAVE_KQUEUE
+ return 3;
+#else
+ GModule *fam_module;
+ gchar *filename;
+
+ MONO_ARCH_SAVE_REGS;
+
+ filename = g_module_build_path (NULL, "libfam.so.0");
+ fam_module = g_module_open (filename, G_MODULE_BIND_LAZY);
+ g_free (filename);
+ if (fam_module == NULL)
+ return 0;
+
+ g_module_symbol (fam_module, "FAMNextEvent", (gpointer *) &FAMNextEvent);
+ if (FAMNextEvent == NULL)
+ return 0;
+
+ return 2;
+#endif
+}
+
+gpointer
+ves_icall_System_IO_FSW_OpenDirectory (MonoString *path, gpointer reserved)
+{
+ return NULL;
+}
+
+gboolean
+ves_icall_System_IO_FSW_CloseDirectory (gpointer handle)
+{
+ return FALSE;
+}
+
+gboolean
+ves_icall_System_IO_FSW_ReadDirectoryChanges ( gpointer handle,
+ MonoArray *buffer,
+ gboolean includeSubdirs,
+ gint filters,
+ gpointer overlap,
+ gpointer callback)
+{
+ return FALSE;
+}
+
+/* Almost copied from fam.h. Weird, I know */
+typedef struct {
+ gint reqnum;
+} FAMRequest;
+
+typedef struct FAMEvent {
+ gpointer fc;
+ FAMRequest fr;
+ gchar *hostname;
+ gchar filename [PATH_MAX];
+ gpointer userdata;
+ gint code;
+} FAMEvent;
+
+gboolean
+ves_icall_System_IO_FAMW_InternalFAMNextEvent (gpointer conn,
+ MonoString **filename,
+ gint *code,
+ gint *reqnum)
+{
+ FAMEvent ev;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (FAMNextEvent (conn, &ev) == 1) {
+ *filename = mono_string_new (mono_domain_get (), ev.filename);
+ *code = ev.code;
+ *reqnum = ev.fr.reqnum;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+#endif
+
diff --git a/mono/metadata/filewatcher.h b/mono/metadata/filewatcher.h
new file mode 100644
index 00000000000..83f2dc633ff
--- /dev/null
+++ b/mono/metadata/filewatcher.h
@@ -0,0 +1,40 @@
+/*
+ * filewatcher.h: File System Watcher internal calls
+ *
+ * Authors:
+ * Gonzalo Paniagua Javier (gonzalo@ximian.com)
+ *
+ * (C) 2004 Novell, Inc. (http://www.novell.com)
+ */
+
+#ifndef _MONO_METADATA_FILEWATCHER_H
+#define _MONO_METADATA_FILEWATCHER_H
+
+#include <mono/metadata/object.h>
+#include <mono/io-layer/io-layer.h>
+
+G_BEGIN_DECLS
+
+gboolean ves_icall_System_IO_FSW_SupportsFSW (void);
+
+gpointer ves_icall_System_IO_FSW_OpenDirectory (MonoString *path, gpointer reserved);
+
+gboolean ves_icall_System_IO_FSW_CloseDirectory (gpointer handle);
+
+gboolean ves_icall_System_IO_FSW_ReadDirectoryChanges (
+ gpointer handle,
+ MonoArray *buffer,
+ gboolean includeSubdirs,
+ gint filters,
+ gpointer overlap,
+ gpointer callback);
+
+gboolean ves_icall_System_IO_FAMW_InternalFAMNextEvent (gpointer conn,
+ MonoString **filename,
+ gint *code,
+ gint *reqnum);
+
+G_END_DECLS
+
+#endif
+
diff --git a/mono/metadata/gc-internal.h b/mono/metadata/gc-internal.h
new file mode 100644
index 00000000000..7b121dcda65
--- /dev/null
+++ b/mono/metadata/gc-internal.h
@@ -0,0 +1,36 @@
+/*
+ * metadata/gc-internal.h: GC icalls.
+ *
+ * Author: Paolo Molaro <lupus@ximian.com>
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#ifndef __MONO_METADATA_GC_H__
+#define __MONO_METADATA_GC_H__
+
+#include <glib.h>
+#include <mono/metadata/object-internals.h>
+
+void mono_object_register_finalizer (MonoObject *obj);
+void ves_icall_System_GC_InternalCollect (int generation);
+gint64 ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection);
+void ves_icall_System_GC_KeepAlive (MonoObject *obj);
+void ves_icall_System_GC_ReRegisterForFinalize (MonoObject *obj);
+void ves_icall_System_GC_SuppressFinalize (MonoObject *obj);
+void ves_icall_System_GC_WaitForPendingFinalizers (void);
+
+MonoObject *ves_icall_System_GCHandle_GetTarget (guint32 handle);
+guint32 ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint32 type);
+void ves_icall_System_GCHandle_FreeHandle (guint32 handle);
+gpointer ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle);
+
+extern void mono_gc_init (void);
+extern void mono_gc_cleanup (void);
+extern void mono_gc_enable (void);
+extern void mono_gc_disable (void);
+extern gboolean mono_gc_is_finalizer_thread (MonoThread *thread);
+extern gpointer mono_gc_out_of_memory (size_t size);
+
+#endif /* __MONO_METADATA_GC_H__ */
+
diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c
index 1bf2a3590fc..065a4279870 100644
--- a/mono/metadata/gc.c
+++ b/mono/metadata/gc.c
@@ -10,18 +10,56 @@
#include <glib.h>
#include <string.h>
-#include <mono/metadata/gc.h>
+#include <mono/metadata/gc-internal.h>
#include <mono/metadata/threads.h>
-#if HAVE_BOEHM_GC
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/domain-internals.h>
+#include <mono/metadata/class-internals.h>
+#include <mono/utils/mono-logger.h>
#define GC_I_HIDE_POINTERS
-#include <gc/gc.h>
-#else
-#define HIDE_POINTER(v) (v)
-#define REVEAL_POINTER(v) (v)
+#include <mono/os/gc_wrapper.h>
+
+#ifndef HIDE_POINTER
+#define HIDE_POINTER(v) (v)
+#define REVEAL_POINTER(v) (v)
+#endif
+
+typedef struct DomainFinalizationReq {
+ MonoDomain *domain;
+ HANDLE done_event;
+} DomainFinalizationReq;
+
+#ifdef PLATFORM_WINCE /* FIXME: add accessors to gc.dll API */
+extern void (*__imp_GC_finalizer_notifier)(void);
+#define GC_finalizer_notifier __imp_GC_finalizer_notifier
+extern int __imp_GC_finalize_on_demand;
+#define GC_finalize_on_demand __imp_GC_finalize_on_demand
+#endif
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
#endif
static int finalize_slot = -1;
+static gboolean gc_disabled = FALSE;
+
+static CRITICAL_SECTION finalizer_mutex;
+
+static GSList *domains_to_finalize= NULL;
+
+static MonoThread *gc_thread;
+
+static void object_register_finalizer (MonoObject *obj, void (*callback)(void *, void*));
+
+#if HAVE_BOEHM_GC
+static void finalize_notify (void);
+static HANDLE pending_done_event;
+static HANDLE shutdown_event;
+static HANDLE thread_started_event;
+#endif
+
/*
* actually, we might want to queue the finalize requests in a separate thread,
* but we need to be careful about the execution domain of the thread...
@@ -30,22 +68,46 @@ static void
run_finalize (void *obj, void *data)
{
MonoObject *exc = NULL;
- MonoObject *o;
+ MonoObject *o, *o2;
o = (MonoObject*)((char*)obj + GPOINTER_TO_UINT (data));
if (finalize_slot < 0) {
int i;
- for (i = 0; i < mono_defaults.object_class->vtable_size; ++i) {
- MonoMethod *cm = mono_defaults.object_class->vtable [i];
+ MonoClass* obj_class = mono_get_object_class ();
+ for (i = 0; i < obj_class->vtable_size; ++i) {
+ MonoMethod *cm = obj_class->vtable [i];
- if (!strcmp (cm->name, "Finalize")) {
+ if (!strcmp (mono_method_get_name (cm), "Finalize")) {
finalize_slot = i;
break;
}
}
}
- /* speedup later... */
- /* g_print ("Finalize run on %s\n", mono_object_class (o)->name); */
+
+ mono_domain_lock (o->vtable->domain);
+
+ o2 = g_hash_table_lookup (o->vtable->domain->finalizable_objects_hash, o);
+
+ mono_domain_unlock (o->vtable->domain);
+
+ if (!o2)
+ /* Already finalized somehow */
+ return;
+
+ /* make sure the finalizer is not called again if the object is resurrected */
+ object_register_finalizer (obj, NULL);
+
+ if (o->vtable->klass == mono_get_thread_class ())
+ if (mono_gc_is_finalizer_thread ((MonoThread*)o))
+ /* Avoid finalizing ourselves */
+ return;
+
+ /* speedup later... and use a timeout */
+ /* g_print ("Finalize run on %p %s.%s\n", o, mono_object_class (o)->name_space, mono_object_class (o)->name); */
+
+ /* Use _internal here, since this thread can enter a doomed appdomain */
+ mono_domain_set_internal (mono_object_domain (o));
+
mono_runtime_invoke (o->vtable->klass->vtable [finalize_slot], o, NULL, &exc);
if (exc) {
@@ -53,6 +115,19 @@ run_finalize (void *obj, void *data)
}
}
+gpointer
+mono_gc_out_of_memory (size_t size)
+{
+ /*
+ * we could allocate at program startup some memory that we could release
+ * back to the system at this point if we're really low on memory (ie, size is
+ * lower than the memory we set apart)
+ */
+ mono_raise_exception (mono_domain_get ()->out_of_memory_ex);
+
+ return NULL;
+}
+
/*
* Some of our objects may point to a different address than the address returned by GC_malloc()
* (because of the GetHashCode hack), but we need to pass the real address to register_finalizer.
@@ -67,20 +142,101 @@ object_register_finalizer (MonoObject *obj, void (*callback)(void *, void*))
#if HAVE_BOEHM_GC
guint offset = 0;
+#ifndef GC_DEBUG
+ /* This assertion is not valid when GC_DEBUG is defined */
g_assert (GC_base (obj) == (char*)obj - offset);
- GC_register_finalizer ((char*)obj - offset, callback, GUINT_TO_POINTER (offset), NULL, NULL);
+#endif
+
+ if (mono_domain_is_unloading (obj->vtable->domain) && (callback != NULL))
+ /*
+ * Can't register finalizers in a dying appdomain, since they
+ * could be invoked after the appdomain has been unloaded.
+ */
+ return;
+
+ mono_domain_lock (obj->vtable->domain);
+
+ if (callback)
+ g_hash_table_insert (obj->vtable->domain->finalizable_objects_hash, obj,
+ obj);
+ else
+ g_hash_table_remove (obj->vtable->domain->finalizable_objects_hash, obj);
+
+ mono_domain_unlock (obj->vtable->domain);
+
+ GC_REGISTER_FINALIZER_NO_ORDER ((char*)obj - offset, callback, GUINT_TO_POINTER (offset), NULL, NULL);
#endif
}
void
mono_object_register_finalizer (MonoObject *obj)
{
+ /* g_print ("Registered finalizer on %p %s.%s\n", obj, mono_object_class (obj)->name_space, mono_object_class (obj)->name); */
object_register_finalizer (obj, run_finalize);
}
+/*
+ * mono_domain_finalize:
+ *
+ * Request finalization of all finalizable objects inside @domain. Wait
+ * @timeout msecs for the finalization to complete.
+ * Returns: TRUE if succeeded, FALSE if there was a timeout
+ */
+
+gboolean
+mono_domain_finalize (MonoDomain *domain, guint32 timeout)
+{
+ DomainFinalizationReq *req;
+ guint32 res;
+ HANDLE done_event;
+
+ /*
+ * No need to create another thread 'cause the finalizer thread
+ * is still working and will take care of running the finalizers
+ */
+
+#if HAVE_BOEHM_GC
+ if (gc_disabled)
+ return TRUE;
+
+ GC_gcollect ();
+
+ done_event = CreateEvent (NULL, TRUE, FALSE, NULL);
+
+ req = g_new0 (DomainFinalizationReq, 1);
+ req->domain = domain;
+ req->done_event = done_event;
+
+ EnterCriticalSection (&finalizer_mutex);
+
+ domains_to_finalize = g_slist_append (domains_to_finalize, req);
+
+ LeaveCriticalSection (&finalizer_mutex);
+
+ /* Tell the finalizer thread to finalize this appdomain */
+ finalize_notify ();
+
+ res = WaitForSingleObjectEx (done_event, timeout, TRUE);
+
+ /* printf ("WAIT RES: %d.\n", res); */
+ if (res == WAIT_TIMEOUT) {
+ /* We leak the handle here */
+ return FALSE;
+ }
+
+ CloseHandle (done_event);
+ return TRUE;
+#else
+ /* We don't support domain finalization without a GC */
+ return FALSE;
+#endif
+}
+
void
ves_icall_System_GC_InternalCollect (int generation)
{
+ MONO_ARCH_SAVE_REGS;
+
#if HAVE_BOEHM_GC
GC_gcollect ();
#endif
@@ -89,10 +245,12 @@ ves_icall_System_GC_InternalCollect (int generation)
gint64
ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection)
{
+ MONO_ARCH_SAVE_REGS;
+
#if HAVE_BOEHM_GC
if (forceCollection)
GC_gcollect ();
- return GC_get_heap_size ();
+ return GC_get_heap_size () - GC_get_free_bytes ();
#else
return 0;
#endif
@@ -101,6 +259,8 @@ ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection)
void
ves_icall_System_GC_KeepAlive (MonoObject *obj)
{
+ MONO_ARCH_SAVE_REGS;
+
/*
* Does nothing.
*/
@@ -109,23 +269,46 @@ ves_icall_System_GC_KeepAlive (MonoObject *obj)
void
ves_icall_System_GC_ReRegisterForFinalize (MonoObject *obj)
{
+ MONO_ARCH_SAVE_REGS;
+
object_register_finalizer (obj, run_finalize);
}
void
ves_icall_System_GC_SuppressFinalize (MonoObject *obj)
{
+ MONO_ARCH_SAVE_REGS;
+
object_register_finalizer (obj, NULL);
}
void
ves_icall_System_GC_WaitForPendingFinalizers (void)
{
+ MONO_ARCH_SAVE_REGS;
+
+#if HAVE_BOEHM_GC
+ if (!GC_should_invoke_finalizers ())
+ return;
+
+ if (mono_thread_current () == gc_thread)
+ /* Avoid deadlocks */
+ return;
+
+ ResetEvent (pending_done_event);
+ finalize_notify ();
+ /* g_print ("Waiting for pending finalizers....\n"); */
+ WaitForSingleObjectEx (pending_done_event, INFINITE, TRUE);
+ /* g_print ("Done pending....\n"); */
+#else
+#endif
}
-/*static CRITICAL_SECTION handle_section;*/
+static CRITICAL_SECTION allocator_section;
+static CRITICAL_SECTION handle_section;
static guint32 next_handle = 0;
static gpointer *gc_handles = NULL;
+static guint8 *gc_handle_types = NULL;
static guint32 array_size = 0;
/*
@@ -135,6 +318,13 @@ static guint32 array_size = 0;
* 2 -> weak
*/
+typedef enum {
+ HANDLE_WEAK,
+ HANDLE_WEAK_TRACK,
+ HANDLE_NORMAL,
+ HANDLE_PINNED
+} HandleType;
+
/*
* FIXME: make thread safe and reuse the array entries.
*/
@@ -142,12 +332,23 @@ MonoObject *
ves_icall_System_GCHandle_GetTarget (guint32 handle)
{
MonoObject *obj;
+ gint32 type;
+
+ MONO_ARCH_SAVE_REGS;
if (gc_handles) {
+ type = handle & 0x3;
+ EnterCriticalSection (&handle_section);
+ g_assert (type == gc_handle_types [handle >> 2]);
obj = gc_handles [handle >> 2];
- if ((handle & 0x3) > 1)
+ LeaveCriticalSection (&handle_section);
+ if (!obj)
+ return NULL;
+
+ if ((type == HANDLE_WEAK) || (type == HANDLE_WEAK_TRACK))
return REVEAL_POINTER (obj);
- return obj;
+ else
+ return obj;
}
return NULL;
}
@@ -156,73 +357,463 @@ guint32
ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint32 type)
{
gpointer val = obj;
- guint32 h, idx = next_handle++;
+ guint32 h, idx;
+
+ MONO_ARCH_SAVE_REGS;
+ EnterCriticalSection (&handle_section);
+ /* Indexes start from 1 since 0 means the handle is not allocated */
+ idx = ++next_handle;
if (idx >= array_size) {
-#if HAVE_BOEHM_GC
gpointer *new_array;
+ guint8 *new_type_array;
if (!array_size)
array_size = 16;
- new_array = GC_malloc (sizeof (gpointer) * (array_size * 2));
+#if HAVE_BOEHM_GC
+ new_array = GC_MALLOC (sizeof (gpointer) * (array_size * 2));
+ new_type_array = GC_MALLOC (sizeof (guint8) * (array_size * 2));
+#else
+ new_array = g_malloc0 (sizeof (gpointer) * (array_size * 2));
+ new_type_array = g_malloc0 (sizeof (guint8) * (array_size * 2));
+#endif
if (gc_handles) {
int i;
memcpy (new_array, gc_handles, sizeof (gpointer) * array_size);
+ memcpy (new_type_array, gc_handle_types, sizeof (guint8) * array_size);
/* need to re-register links for weak refs. test if GC_realloc needs the same */
for (i = 0; i < array_size; ++i) {
- if (((gulong)new_array [i]) & 0x1) { /* all and only disguised pointers have it set */
- GC_general_register_disappearing_link (&(new_array [i]), REVEAL_POINTER (new_array [i]));
+#if 0 /* This breaks the threaded finalizer, by causing segfaults deep
+ * inside libgc. I assume it will also break without the
+ * threaded finalizer, just that the stress test (bug 31333)
+ * deadlocks too early without it. Reverting to the previous
+ * version here stops the segfault.
+ */
+ if ((gc_handle_types[i] == HANDLE_WEAK) || (gc_handle_types[i] == HANDLE_WEAK_TRACK)) { /* all and only disguised pointers have it set */
+#else
+ if (((gulong)new_array [i]) & 0x1) {
+#endif
+#if HAVE_BOEHM_GC
+ if (gc_handles [i] != (gpointer)-1)
+ GC_unregister_disappearing_link (&(gc_handles [i]));
+ if (new_array [i] != (gpointer)-1)
+ GC_GENERAL_REGISTER_DISAPPEARING_LINK (&(new_array [i]), REVEAL_POINTER (new_array [i]));
+#endif
}
}
}
array_size *= 2;
- gc_handles = new_array;
-#else
- g_error ("No GCHandle support built-in");
+#ifndef HAVE_BOEHM_GC
+ g_free (gc_handles);
+ g_free (gc_handle_types);
#endif
+ gc_handles = new_array;
+ gc_handle_types = new_type_array;
}
- h = idx << 2;
/* resuse the type from the old target */
if (type == -1)
type = handle & 0x3;
+ h = (idx << 2) | type;
switch (type) {
- case 0:
- case 1:
- h |= type;
- gc_handles [idx] = val;
- break;
- default:
- h |= 2;
+ case HANDLE_WEAK:
+ case HANDLE_WEAK_TRACK:
val = (gpointer)HIDE_POINTER (val);
gc_handles [idx] = val;
+ gc_handle_types [idx] = type;
#if HAVE_BOEHM_GC
- GC_general_register_disappearing_link (&(gc_handles [idx]), obj);
-#else
- g_error ("No weakref support");
+ if (gc_handles [idx] != (gpointer)-1)
+ GC_GENERAL_REGISTER_DISAPPEARING_LINK (&(gc_handles [idx]), obj);
#endif
break;
+ default:
+ gc_handles [idx] = val;
+ gc_handle_types [idx] = type;
+ break;
}
+ LeaveCriticalSection (&handle_section);
return h;
}
void
ves_icall_System_GCHandle_FreeHandle (guint32 handle)
{
- gc_handles [handle >> 2] = (gpointer)-1;
+ int idx = handle >> 2;
+ int type = handle & 0x3;
+
+ MONO_ARCH_SAVE_REGS;
+
+ EnterCriticalSection (&handle_section);
+
+#ifdef HAVE_BOEHM_GC
+ g_assert (type == gc_handle_types [idx]);
+ if ((type == HANDLE_WEAK) || (type == HANDLE_WEAK_TRACK)) {
+ if (gc_handles [idx] != (gpointer)-1)
+ GC_unregister_disappearing_link (&(gc_handles [idx]));
+ }
+#endif
+
+ gc_handles [idx] = (gpointer)-1;
+ gc_handle_types [idx] = (guint8)-1;
+ LeaveCriticalSection (&handle_section);
}
gpointer
ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle)
{
MonoObject *obj;
+ int type = handle & 0x3;
+
+ MONO_ARCH_SAVE_REGS;
if (gc_handles) {
+ EnterCriticalSection (&handle_section);
obj = gc_handles [handle >> 2];
- if ((handle & 0x3) > 1)
- return REVEAL_POINTER (obj);
- return obj;
+ g_assert (gc_handle_types [handle >> 2] == type);
+ LeaveCriticalSection (&handle_section);
+ if ((type == HANDLE_WEAK) || (type == HANDLE_WEAK_TRACK)) {
+ obj = REVEAL_POINTER (obj);
+ if (obj == (MonoObject *) -1)
+ return NULL;
+ }
+ if (obj) {
+ MonoClass *klass = mono_object_class (obj);
+ if (klass == mono_defaults.string_class) {
+ return mono_string_chars ((MonoString*)obj);
+ } else if (klass->rank) {
+ return mono_array_addr ((MonoArray*)obj, char, 0);
+ } else {
+ /* the C# code will check and throw the exception */
+ /* FIXME: missing !klass->blittable test, see bug #61134 */
+ if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+ return (gpointer)-1;
+ return (char*)obj + sizeof (MonoObject);
+ }
+ }
}
return NULL;
}
+guint32
+mono_gchandle_new (MonoObject *obj, gboolean pinned)
+{
+ return ves_icall_System_GCHandle_GetTargetHandle (obj, 0, pinned? HANDLE_PINNED: HANDLE_NORMAL);
+}
+
+guint32
+mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection)
+{
+ return ves_icall_System_GCHandle_GetTargetHandle (obj, 0, track_resurrection? HANDLE_WEAK_TRACK: HANDLE_WEAK);
+}
+
+/* This will return NULL for a collected object if using a weakref handle */
+MonoObject*
+mono_gchandle_get_target (guint32 gchandle)
+{
+ return ves_icall_System_GCHandle_GetTarget (gchandle);
+}
+
+void
+mono_gchandle_free (guint32 gchandle)
+{
+ ves_icall_System_GCHandle_FreeHandle (gchandle);
+}
+
+#if HAVE_BOEHM_GC
+
+static HANDLE finalizer_event;
+static volatile gboolean finished=FALSE;
+
+static void finalize_notify (void)
+{
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": prodding finalizer");
+#endif
+
+ SetEvent (finalizer_event);
+}
+
+static void
+collect_objects (gpointer key, gpointer value, gpointer user_data)
+{
+ GPtrArray *arr = (GPtrArray*)user_data;
+ g_ptr_array_add (arr, key);
+}
+
+/*
+ * finalize_domain_objects:
+ *
+ * Run the finalizers of all finalizable objects in req->domain.
+ */
+static void
+finalize_domain_objects (DomainFinalizationReq *req)
+{
+ int i;
+ GPtrArray *objs;
+ MonoDomain *domain = req->domain;
+
+ while (g_hash_table_size (domain->finalizable_objects_hash) > 0) {
+ /*
+ * Since the domain is unloading, nobody is allowed to put
+ * new entries into the hash table. But finalize_object might
+ * remove entries from the hash table, so we make a copy.
+ */
+ objs = g_ptr_array_new ();
+ g_hash_table_foreach (domain->finalizable_objects_hash,
+ collect_objects, objs);
+ /* printf ("FINALIZING %d OBJECTS.\n", objs->len); */
+
+ for (i = 0; i < objs->len; ++i) {
+ MonoObject *o = (MonoObject*)g_ptr_array_index (objs, i);
+ /* FIXME: Avoid finalizing threads, etc */
+ run_finalize (o, 0);
+ }
+
+ g_ptr_array_free (objs, TRUE);
+ }
+
+ /* Process finalizers which are already in the queue */
+ GC_invoke_finalizers ();
+
+ /* printf ("DONE.\n"); */
+ SetEvent (req->done_event);
+
+ /* The event is closed in mono_domain_finalize if we get here */
+ g_free (req);
+}
+
+static guint32 finalizer_thread (gpointer unused)
+{
+ gc_thread = mono_thread_current ();
+
+ SetEvent (thread_started_event);
+
+ while(!finished) {
+ /* Wait to be notified that there's at least one
+ * finaliser to run
+ */
+ WaitForSingleObjectEx (finalizer_event, INFINITE, TRUE);
+
+ if (domains_to_finalize) {
+ EnterCriticalSection (&finalizer_mutex);
+ if (domains_to_finalize) {
+ DomainFinalizationReq *req = domains_to_finalize->data;
+ domains_to_finalize = g_slist_remove (domains_to_finalize, req);
+ LeaveCriticalSection (&finalizer_mutex);
+
+ finalize_domain_objects (req);
+ }
+ else
+ LeaveCriticalSection (&finalizer_mutex);
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": invoking finalizers");
+#endif
+
+ /* If finished == TRUE, mono_gc_cleanup has been called (from mono_runtime_cleanup),
+ * before the domain is unloaded.
+ *
+ * There is a bug in GC_invoke_finalizer () in versions <= 6.2alpha4:
+ * the 'mem_freed' variable is not initialized when there are no
+ * objects to finalize, which leads to strange behavior later on.
+ * The check is necessary to work around that bug.
+ */
+ if (GC_should_invoke_finalizers ()) {
+ GC_invoke_finalizers ();
+ }
+
+ SetEvent (pending_done_event);
+ }
+
+ SetEvent (shutdown_event);
+ return(0);
+}
+
+/*
+ * Enable or disable the separate finalizer thread.
+ * It's currently disabled because it still requires some
+ * work in the rest of the runtime.
+ */
+#define ENABLE_FINALIZER_THREAD
+
+#ifdef WITH_INCLUDED_LIBGC
+/* from threads.c */
+extern void mono_gc_stop_world (void);
+extern void mono_gc_start_world (void);
+extern void mono_gc_push_all_stacks (void);
+
+static void mono_gc_lock (void)
+{
+ EnterCriticalSection (&allocator_section);
+}
+
+static void mono_gc_unlock (void)
+{
+ LeaveCriticalSection (&allocator_section);
+}
+
+static GCThreadFunctions mono_gc_thread_vtable = {
+ NULL,
+
+ mono_gc_lock,
+ mono_gc_unlock,
+
+ mono_gc_stop_world,
+ NULL,
+ mono_gc_push_all_stacks,
+ mono_gc_start_world
+};
+#endif /* WITH_INCLUDED_LIBGC */
+
+static void
+mono_gc_warning (char *msg, GC_word arg)
+{
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_GC, msg, (unsigned long)arg);
+}
+
+static gboolean
+mono_running_on_valgrind (void)
+{
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+ if (RUNNING_ON_VALGRIND)
+ return TRUE;
+ else
+ return FALSE;
+#else
+ return FALSE;
+#endif
+}
+
+
+void mono_gc_init (void)
+{
+ InitializeCriticalSection (&handle_section);
+ InitializeCriticalSection (&allocator_section);
+
+ InitializeCriticalSection (&finalizer_mutex);
+
+#ifdef WITH_INCLUDED_LIBGC
+ gc_thread_vtable = &mono_gc_thread_vtable;
+#endif
+
+ MONO_GC_REGISTER_ROOT (gc_handles);
+ MONO_GC_REGISTER_ROOT (gc_handle_types);
+ GC_no_dls = TRUE;
+
+ GC_oom_fn = mono_gc_out_of_memory;
+
+ GC_set_warn_proc (mono_gc_warning);
+
+#ifdef ENABLE_FINALIZER_THREAD
+
+ if (g_getenv ("GC_DONT_GC")) {
+ gc_disabled = TRUE;
+ return;
+ }
+
+ /* valgrind does not play nicely with the GC,
+ * so, turn it off when we are under vg.
+ */
+ if (mono_running_on_valgrind ()) {
+ /* valgrind doesnt like g_warning for some reason... */
+ printf ("You are running under valgrind. Currently, valgrind does "
+ "not support the GC. This program will run with the GC "
+ "turned off. Your program may take up a fair amount of "
+ "memory. Also, finalizers will not be run.");
+
+ gc_disabled = TRUE;
+ return;
+ }
+
+ finalizer_event = CreateEvent (NULL, FALSE, FALSE, NULL);
+ pending_done_event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ shutdown_event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ thread_started_event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ if (finalizer_event == NULL || pending_done_event == NULL || shutdown_event == NULL || thread_started_event == NULL) {
+ g_assert_not_reached ();
+ }
+
+ GC_finalize_on_demand = 1;
+ GC_finalizer_notifier = finalize_notify;
+
+ mono_thread_create (mono_domain_get (), finalizer_thread, NULL);
+ /*
+ * Wait until the finalizer thread sets gc_thread since its value is needed
+ * by mono_thread_attach ()
+ */
+ WaitForSingleObjectEx (thread_started_event, INFINITE, FALSE);
+#endif
+}
+
+void mono_gc_cleanup (void)
+{
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": cleaning up finalizer");
+#endif
+
+#ifdef ENABLE_FINALIZER_THREAD
+ if (!gc_disabled) {
+ ResetEvent (shutdown_event);
+ finished = TRUE;
+ finalize_notify ();
+ /* Finishing the finalizer thread, so wait a little bit... */
+ /* MS seems to wait for about 2 seconds */
+ if (WaitForSingleObjectEx (shutdown_event, 2000, FALSE) == WAIT_TIMEOUT) {
+ mono_thread_stop (gc_thread);
+ }
+ }
+
+#endif
+}
+
+void
+mono_gc_disable (void)
+{
+#ifdef HAVE_GC_ENABLE
+ GC_disable ();
+#else
+ g_assert_not_reached ();
+#endif
+}
+
+void
+mono_gc_enable (void)
+{
+#ifdef HAVE_GC_ENABLE
+ GC_enable ();
+#else
+ g_assert_not_reached ();
+#endif
+}
+
+#else
+
+/* no Boehm GC support. */
+void mono_gc_init (void)
+{
+ InitializeCriticalSection (&handle_section);
+}
+
+void mono_gc_cleanup (void)
+{
+}
+
+void
+mono_gc_disable (void)
+{
+}
+
+void
+mono_gc_enable (void)
+{
+}
+
+#endif
+
+gboolean
+mono_gc_is_finalizer_thread (MonoThread *thread)
+{
+ return thread == gc_thread;
+}
+
diff --git a/mono/metadata/gc.h b/mono/metadata/gc.h
deleted file mode 100644
index 5225241447b..00000000000
--- a/mono/metadata/gc.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * metadata/gc.h: GC icalls.
- *
- * Author: Paolo Molaro <lupus@ximian.com>
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#ifndef __MONO_METADATA_GC_H__
-#define __MONO_METADATA_GC_H__
-
-#include <glib.h>
-#include <mono/metadata/object.h>
-
-void mono_object_register_finalizer (MonoObject *obj);
-void ves_icall_System_GC_InternalCollect (int generation);
-gint64 ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection);
-void ves_icall_System_GC_KeepAlive (MonoObject *obj);
-void ves_icall_System_GC_ReRegisterForFinalize (MonoObject *obj);
-void ves_icall_System_GC_SuppressFinalize (MonoObject *obj);
-void ves_icall_System_GC_WaitForPendingFinalizers (void);
-
-MonoObject *ves_icall_System_GCHandle_GetTarget (guint32 handle);
-guint32 ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint32 type);
-void ves_icall_System_GCHandle_FreeHandle (guint32 handle);
-gpointer ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle);
-
-
-#endif /* __MONO_METADATA_GC_H__ */
-
diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c
index b02ca36c799..d7d80187731 100644
--- a/mono/metadata/icall.c
+++ b/mono/metadata/icall.c
@@ -13,6 +13,7 @@
#include <glib.h>
#include <stdarg.h>
#include <string.h>
+#include <ctype.h>
#include <sys/time.h>
#include <unistd.h>
#if defined (PLATFORM_WIN32)
@@ -21,6 +22,9 @@
#include <mono/metadata/object.h>
#include <mono/metadata/threads.h>
+#include <mono/metadata/threads-types.h>
+#include <mono/metadata/threadpool.h>
+#include <mono/metadata/monitor.h>
#include <mono/metadata/reflection.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/tabledefs.h>
@@ -30,33 +34,36 @@
#include <mono/metadata/mono-endian.h>
#include <mono/metadata/tokentype.h>
#include <mono/metadata/unicode.h>
-#include <mono/metadata/appdomain.h>
+#include <mono/metadata/domain-internals.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/class-internals.h>
#include <mono/metadata/marshal.h>
-#include <mono/metadata/gc.h>
+#include <mono/metadata/gc-internal.h>
#include <mono/metadata/rand.h>
#include <mono/metadata/sysmath.h>
-#include <mono/metadata/debug-symfile.h>
#include <mono/metadata/string-icalls.h>
+#include <mono/metadata/mono-debug-debugger.h>
#include <mono/metadata/process.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/profiler-private.h>
+#include <mono/metadata/locales.h>
+#include <mono/metadata/filewatcher.h>
+#include <mono/metadata/char-conversions.h>
+#include <mono/metadata/security.h>
+#include <mono/metadata/mono-config.h>
+#include <mono/metadata/cil-coff.h>
#include <mono/io-layer/io-layer.h>
#include <mono/utils/strtod.h>
+#include <mono/utils/monobitset.h>
#if defined (PLATFORM_WIN32)
#include <windows.h>
+#include <shlobj.h>
#endif
#include "decimal.h"
-static MonoString *
-mono_double_ToStringImpl (double value)
-{
- /* FIXME: Handle formats, etc. */
- MonoString *s;
- gchar *retVal;
- retVal = g_strdup_printf ("%.15g", value);
- s = mono_string_new (mono_domain_get (), retVal);
- g_free (retVal);
- return s;
-}
+static MonoReflectionAssembly* ves_icall_System_Reflection_Assembly_GetCallingAssembly (void);
+
/*
* We expect a pointer to a char, not a string
@@ -64,13 +71,28 @@ mono_double_ToStringImpl (double value)
static double
mono_double_ParseImpl (char *ptr)
{
- return bsd_strtod (ptr, NULL);
+ gchar *endptr = NULL;
+ gdouble result = 0.0;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (*ptr)
+ result = bsd_strtod (ptr, &endptr);
+
+ if (!*ptr || (endptr && *endptr))
+ mono_raise_exception (mono_exception_from_name (mono_defaults.corlib,
+ "System",
+ "FormatException"));
+
+ return result;
}
-static MonoString *
-mono_float_ToStringImpl (float value)
+static void
+ves_icall_System_Double_AssertEndianity (double *value)
{
- return mono_double_ToStringImpl (value);
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_DOUBLE_ASSERT_ENDIANITY (value);
}
static MonoObject *
@@ -81,6 +103,8 @@ ves_icall_System_Array_GetValueImpl (MonoObject *this, guint32 pos)
gint32 esize;
gpointer *ea;
+ MONO_ARCH_SAVE_REGS;
+
ao = (MonoArray *)this;
ac = (MonoClass *)ao->obj.vtable->klass;
@@ -100,6 +124,8 @@ ves_icall_System_Array_GetValue (MonoObject *this, MonoObject *idxs)
MonoArray *ao, *io;
gint32 i, pos, *ind;
+ MONO_ARCH_SAVE_REGS;
+
MONO_CHECK_ARG_NULL (idxs);
io = (MonoArray *)idxs;
@@ -141,9 +167,11 @@ ves_icall_System_Array_SetValueImpl (MonoArray *this, MonoObject *value, guint32
gint32 esize, vsize;
gpointer *ea, *va;
- guint64 u64;
- gint64 i64;
- gdouble r64;
+ guint64 u64 = 0;
+ gint64 i64 = 0;
+ gdouble r64 = 0;
+
+ MONO_ARCH_SAVE_REGS;
if (value)
vc = value->vtable->klass;
@@ -210,6 +238,8 @@ ves_icall_System_Array_SetValueImpl (MonoArray *this, MonoObject *value, guint32
}
if (!ec->valuetype) {
+ if (!mono_object_isinst (value, ec))
+ INVALID_CAST;
*ea = (gpointer)value;
return;
}
@@ -224,12 +254,6 @@ ves_icall_System_Array_SetValueImpl (MonoArray *this, MonoObject *value, guint32
vsize = mono_class_instance_size (vc) - sizeof (MonoObject);
-#if 0
- g_message (G_STRLOC ": %d (%d) <= %d (%d)",
- ec->byval_arg.type, esize,
- vc->byval_arg.type, vsize);
-#endif
-
#define ASSIGN_UNSIGNED(etype) G_STMT_START{\
switch (vc->byval_arg.type) { \
case MONO_TYPE_U1: \
@@ -403,6 +427,8 @@ ves_icall_System_Array_SetValue (MonoArray *this, MonoObject *value,
MonoClass *ac, *ic;
gint32 i, pos, *ind;
+ MONO_ARCH_SAVE_REGS;
+
MONO_CHECK_ARG_NULL (idxs);
ic = idxs->obj.vtable->klass;
@@ -441,6 +467,9 @@ ves_icall_System_Array_CreateInstanceImpl (MonoReflectionType *type, MonoArray *
MonoClass *aklass;
MonoArray *array;
gint32 *sizes, i;
+ gboolean bounded = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
MONO_CHECK_ARG_NULL (type);
MONO_CHECK_ARG_NULL (lengths);
@@ -453,7 +482,13 @@ ves_icall_System_Array_CreateInstanceImpl (MonoReflectionType *type, MonoArray *
if (mono_array_get (lengths, gint32, i) < 0)
mono_raise_exception (mono_get_exception_argument_out_of_range (NULL));
- aklass = mono_array_class_get (type->type, mono_array_length (lengths));
+ if (bounds && (mono_array_length (bounds) == 1) && (mono_array_get (bounds, gint32, 0) != 0))
+ /* vectors are not the same as one dimensional arrays with no-zero bounds */
+ bounded = TRUE;
+ else
+ bounded = FALSE;
+
+ aklass = mono_bounded_array_class_get (mono_class_from_mono_type (type->type), mono_array_length (lengths), bounded);
sizes = alloca (aklass->rank * sizeof(guint32) * 2);
for (i = 0; i < aklass->rank; ++i) {
@@ -464,7 +499,7 @@ ves_icall_System_Array_CreateInstanceImpl (MonoReflectionType *type, MonoArray *
sizes [i + aklass->rank] = 0;
}
- array = mono_array_new_full (mono_domain_get (), aklass, sizes, sizes + aklass->rank);
+ array = mono_array_new_full (mono_object_domain (type), aklass, sizes, sizes + aklass->rank);
return array;
}
@@ -472,6 +507,8 @@ ves_icall_System_Array_CreateInstanceImpl (MonoReflectionType *type, MonoArray *
static gint32
ves_icall_System_Array_GetRank (MonoObject *this)
{
+ MONO_ARCH_SAVE_REGS;
+
return this->vtable->klass->rank;
}
@@ -479,6 +516,9 @@ static gint32
ves_icall_System_Array_GetLength (MonoArray *this, gint32 dimension)
{
gint32 rank = ((MonoObject *)this)->vtable->klass->rank;
+
+ MONO_ARCH_SAVE_REGS;
+
if ((dimension < 0) || (dimension >= rank))
mono_raise_exception (mono_get_exception_index_out_of_range ());
@@ -492,6 +532,9 @@ static gint32
ves_icall_System_Array_GetLowerBound (MonoArray *this, gint32 dimension)
{
gint32 rank = ((MonoObject *)this)->vtable->klass->rank;
+
+ MONO_ARCH_SAVE_REGS;
+
if ((dimension < 0) || (dimension >= rank))
mono_raise_exception (mono_get_exception_index_out_of_range ());
@@ -502,24 +545,96 @@ ves_icall_System_Array_GetLowerBound (MonoArray *this, gint32 dimension)
}
static void
+ves_icall_System_Array_ClearInternal (MonoArray *arr, int idx, int length)
+{
+ int sz = mono_array_element_size (mono_object_class (arr));
+ memset (mono_array_addr_with_size (arr, idx, sz), 0, length * sz);
+}
+
+static gboolean
ves_icall_System_Array_FastCopy (MonoArray *source, int source_idx, MonoArray* dest, int dest_idx, int length)
{
- int element_size = mono_array_element_size (source->obj.vtable->klass);
- void * dest_addr = mono_array_addr_with_size (dest, element_size, dest_idx);
- void * source_addr = mono_array_addr_with_size (source, element_size, source_idx);
+ int element_size;
+ void * dest_addr;
+ void * source_addr;
+ MonoClass *src_class;
+ MonoClass *dest_class;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (source->obj.vtable->klass->rank != dest->obj.vtable->klass->rank)
+ return FALSE;
+
+ if (source->bounds || dest->bounds)
+ return FALSE;
+
+ if ((dest_idx + length > mono_array_length (dest)) ||
+ (source_idx + length > mono_array_length (source)))
+ return FALSE;
+
+ element_size = mono_array_element_size (source->obj.vtable->klass);
+ dest_addr = mono_array_addr_with_size (dest, element_size, dest_idx);
+ source_addr = mono_array_addr_with_size (source, element_size, source_idx);
+
+ src_class = source->obj.vtable->klass->element_class;
+ dest_class = dest->obj.vtable->klass->element_class;
+
+ /*
+ * Handle common cases.
+ */
+
+ /* Case1: object[] -> valuetype[] (ArrayList::ToArray) */
+ if (src_class == mono_defaults.object_class && dest_class->valuetype) {
+ for (i = source_idx; i < source_idx + length; ++i) {
+ MonoObject *elem = mono_array_get (source, MonoObject*, i);
+ if (elem && !mono_object_isinst (elem, dest_class))
+ return FALSE;
+ }
+
+ element_size = mono_array_element_size (dest->obj.vtable->klass);
+ for (i = 0; i < length; ++i) {
+ MonoObject *elem = mono_array_get (source, MonoObject*, source_idx + i);
+ void *addr = mono_array_addr_with_size (dest, element_size, dest_idx + i);
+ if (!elem)
+ memset (addr, 0, element_size);
+ else
+ memcpy (addr, (char *)elem + sizeof (MonoObject), element_size);
+ }
+ return TRUE;
+ }
+
+ if (src_class != dest_class) {
+ if (dest_class->valuetype || dest_class->enumtype || src_class->valuetype || src_class->enumtype)
+ return FALSE;
+
+ if (mono_class_is_subclass_of (src_class, dest_class, FALSE))
+ ;
+ /* Case2: object[] -> reftype[] (ArrayList::ToArray) */
+ else if (mono_class_is_subclass_of (dest_class, src_class, FALSE))
+ for (i = source_idx; i < source_idx + length; ++i) {
+ MonoObject *elem = mono_array_get (source, MonoObject*, i);
+ if (elem && !mono_object_isinst (elem, dest_class))
+ return FALSE;
+ }
+ else
+ return FALSE;
+ }
- g_assert (dest_idx + length <= mono_array_length (dest));
- g_assert (source_idx + length <= mono_array_length (source));
memmove (dest_addr, source_addr, element_size * length);
+
+ return TRUE;
}
static void
-ves_icall_InitializeArray (MonoArray *array, MonoClassField *field_handle)
+ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray (MonoArray *array, MonoClassField *field_handle)
{
MonoClass *klass = array->obj.vtable->klass;
guint32 size = mono_array_element_size (klass);
int i;
+ MONO_ARCH_SAVE_REGS;
+
if (array->bounds == NULL)
size *= array->max_length;
else
@@ -561,9 +676,47 @@ ves_icall_InitializeArray (MonoArray *array, MonoClassField *field_handle)
#endif
}
+static gint
+ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetOffsetToStringData (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return offsetof (MonoString, chars);
+}
+
+static MonoObject *
+ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetObjectValue (MonoObject *obj)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if ((obj == NULL) || (! (obj->vtable->klass->valuetype)))
+ return obj;
+ else
+ return mono_object_clone (obj);
+}
+
+static void
+ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor (MonoType *handle)
+{
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (handle);
+
+ klass = mono_class_from_mono_type (handle);
+ MONO_CHECK_ARG (handle, klass);
+
+ /* This will call the type constructor */
+ if (! (klass->flags & TYPE_ATTRIBUTE_INTERFACE))
+ mono_runtime_class_init (mono_class_vtable (mono_domain_get (), klass));
+}
+
static MonoObject *
ves_icall_System_Object_MemberwiseClone (MonoObject *this)
{
+ MONO_ARCH_SAVE_REGS;
+
return mono_object_clone (this);
}
@@ -585,139 +738,297 @@ static gint32
ves_icall_System_Object_GetHashCode (MonoObject *this)
{
register guint32 key;
+
+ MONO_ARCH_SAVE_REGS;
+
key = (GPOINTER_TO_UINT (this) >> MONO_OBJECT_ALIGNMENT_SHIFT) * 2654435761u;
return key & 0x7fffffff;
}
-/*
- * A hash function for value types. I have no idea if this is a good hash
- * function (its similar to g_str_hash).
- */
static gint32
-ves_icall_System_ValueType_GetHashCode (MonoObject *this)
+ves_icall_System_ValueType_InternalGetHashCode (MonoObject *this, MonoArray **fields)
{
- gint32 i, size;
- const char *p;
- guint h = 0;
+ int i;
+ MonoClass *klass;
+ MonoObject **values = NULL;
+ MonoObject *o;
+ int count = 0;
+ gint32 result = 0;
- MONO_CHECK_ARG_NULL (this);
+ MONO_ARCH_SAVE_REGS;
- size = this->vtable->klass->instance_size - sizeof (MonoObject);
+ klass = this->vtable->klass;
- p = (const char *)this + sizeof (MonoObject);
+ if (klass->field.count == 0)
+ return ves_icall_System_Object_GetHashCode (this);
- for (i = 0; i < size; i++) {
- h = (h << 5) - h + *p;
- p++;
+ /*
+ * Compute the starting value of the hashcode for fields of primitive
+ * types, and return the remaining fields in an array to the managed side.
+ * This way, we can avoid costly reflection operations in managed code.
+ */
+ for (i = 0; i < klass->field.count; ++i) {
+ MonoClassField *field = &klass->fields [i];
+ if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+ if (mono_field_is_deleted (field))
+ continue;
+ /* FIXME: Add more types */
+ switch (field->type->type) {
+ case MONO_TYPE_I4:
+ result ^= *(gint32*)((guint8*)this + field->offset);
+ break;
+ case MONO_TYPE_STRING: {
+ MonoString *s;
+ s = *(MonoString**)((guint8*)this + field->offset);
+ if (s != NULL)
+ result ^= ves_icall_System_String_GetHashCode (s);
+ break;
+ }
+ default:
+ if (!values)
+ values = alloca (klass->field.count * sizeof (MonoObject*));
+ o = mono_field_get_value_object (mono_object_domain (this), field, this);
+ values [count++] = o;
+ }
}
- return h;
+ if (values) {
+ *fields = mono_array_new (mono_domain_get (), mono_defaults.object_class, count);
+ memcpy (mono_array_addr (*fields, MonoObject*, 0), values, count * sizeof (MonoObject*));
+ }
+ else
+ *fields = NULL;
+ return result;
}
static MonoBoolean
-ves_icall_System_ValueType_Equals (MonoObject *this, MonoObject *that)
+ves_icall_System_ValueType_Equals (MonoObject *this, MonoObject *that, MonoArray **fields)
{
- gint32 size;
- const char *p, *s;
+ int i;
+ MonoClass *klass;
+ MonoObject **values = NULL;
+ MonoObject *o;
+ int count = 0;
+
+ MONO_ARCH_SAVE_REGS;
MONO_CHECK_ARG_NULL (that);
if (this->vtable != that->vtable)
return FALSE;
- size = this->vtable->klass->instance_size - sizeof (MonoObject);
+ klass = this->vtable->klass;
- p = (const char *)this + sizeof (MonoObject);
- s = (const char *)that + sizeof (MonoObject);
+ /*
+ * Do the comparison for fields of primitive type and return a result if
+ * possible. Otherwise, return the remaining fields in an array to the
+ * managed side. This way, we can avoid costly reflection operations in
+ * managed code.
+ */
+ *fields = NULL;
+ for (i = 0; i < klass->field.count; ++i) {
+ MonoClassField *field = &klass->fields [i];
+ if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+ if (mono_field_is_deleted (field))
+ continue;
+ /* FIXME: Add more types */
+ switch (field->type->type) {
+ case MONO_TYPE_I4:
+ if (*(gint32*)((guint8*)this + field->offset) != *(gint32*)((guint8*)that + field->offset))
+ return FALSE;
+ break;
+ case MONO_TYPE_STRING: {
+ MonoString *s1, *s2;
+ guint32 s1len, s2len;
+ s1 = *(MonoString**)((guint8*)this + field->offset);
+ s2 = *(MonoString**)((guint8*)that + field->offset);
+ if (s1 == s2)
+ break;
+ if ((s1 == NULL) || (s2 == NULL))
+ return FALSE;
+ s1len = mono_string_length (s1);
+ s2len = mono_string_length (s2);
+ if (s1len != s2len)
+ return FALSE;
+
+ if (memcmp (mono_string_chars (s1), mono_string_chars (s2), s1len * sizeof (gunichar2)) != 0)
+ return FALSE;
+ break;
+ }
+ default:
+ if (!values)
+ values = alloca (klass->field.count * 2 * sizeof (MonoObject*));
+ o = mono_field_get_value_object (mono_object_domain (this), field, this);
+ values [count++] = o;
+ o = mono_field_get_value_object (mono_object_domain (this), field, that);
+ values [count++] = o;
+ }
+ }
- return memcmp (p, s, size)? FALSE: TRUE;
+ if (values) {
+ *fields = mono_array_new (mono_domain_get (), mono_defaults.object_class, count);
+ memcpy (mono_array_addr (*fields, MonoObject*, 0), values, count * sizeof (MonoObject*));
+
+ return FALSE;
+ }
+ else
+ return TRUE;
}
static MonoReflectionType *
ves_icall_System_Object_GetType (MonoObject *obj)
{
- return mono_type_get_object (mono_domain_get (), &obj->vtable->klass->byval_arg);
+ MONO_ARCH_SAVE_REGS;
+
+ if (obj->vtable->klass != mono_defaults.transparent_proxy_class)
+ return mono_type_get_object (mono_object_domain (obj), &obj->vtable->klass->byval_arg);
+ else
+ return mono_type_get_object (mono_object_domain (obj), &((MonoTransparentProxy*)obj)->remote_class->proxy_class->byval_arg);
}
static void
mono_type_type_from_obj (MonoReflectionType *mtype, MonoObject *obj)
{
+ MONO_ARCH_SAVE_REGS;
+
mtype->type = &obj->vtable->klass->byval_arg;
g_assert (mtype->type->type);
}
static gint32
-ves_icall_AssemblyBuilder_getToken (MonoReflectionAssemblyBuilder *assb, MonoObject *obj)
+ves_icall_ModuleBuilder_getToken (MonoReflectionModuleBuilder *mb, MonoObject *obj)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_image_create_token (mb->dynamic_image, obj, TRUE);
+}
+
+static gint32
+ves_icall_ModuleBuilder_getMethodToken (MonoReflectionModuleBuilder *mb,
+ MonoReflectionMethod *method,
+ MonoArray *opt_param_types)
{
- return mono_image_create_token (assb->dynamic_assembly, obj);
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_image_create_method_token (
+ mb->dynamic_image, (MonoObject *) method, opt_param_types);
}
static gint32
-ves_icall_AssemblyBuilder_getDataChunk (MonoReflectionAssemblyBuilder *assb, MonoArray *buf, gint32 offset)
+ves_icall_ModuleBuilder_getDataChunk (MonoReflectionModuleBuilder *mb, MonoArray *buf, gint32 offset)
{
int count;
- MonoDynamicAssembly *ass = assb->dynamic_assembly;
+ MonoDynamicImage *image = mb->dynamic_image;
char *p = mono_array_addr (buf, char, 0);
- mono_image_create_pefile (assb);
+ MONO_ARCH_SAVE_REGS;
+
+ mono_image_create_pefile (mb);
- if (offset >= ass->pefile.index)
+ if (offset >= image->pefile.index)
return 0;
count = mono_array_length (buf);
- count = MIN (count, ass->pefile.index - offset);
+ count = MIN (count, image->pefile.index - offset);
- memcpy (p, ass->pefile.data + offset, count);
+ memcpy (p, image->pefile.data + offset, count);
return count;
}
-static MonoReflectionType*
-ves_icall_type_from_name (MonoString *name)
+static void
+ves_icall_ModuleBuilder_build_metadata (MonoReflectionModuleBuilder *mb)
{
- MonoDomain *domain = mono_domain_get ();
- MonoType *type;
- MonoImage *image;
+ MONO_ARCH_SAVE_REGS;
+
+ mono_image_build_metadata (mb);
+}
+
+static MonoReflectionType *
+type_from_name (const char *str, MonoBoolean ignoreCase)
+{
+ MonoType *type = NULL;
+ MonoAssembly *assembly;
MonoTypeNameParse info;
- gchar *str;
-
- str = mono_string_to_utf8 (name);
- /*g_print ("requested type %s\n", str);*/
- if (!mono_reflection_parse_type (str, &info)) {
- g_free (str);
+ char *temp_str = g_strdup (str);
+ gboolean type_resolve = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* mono_reflection_parse_type() mangles the string */
+ if (!mono_reflection_parse_type (temp_str, &info)) {
g_list_free (info.modifiers);
g_list_free (info.nested);
+ g_free (temp_str);
return NULL;
}
- if (info.assembly) {
- image = mono_image_loaded (info.assembly);
- /* do we need to load if it's not already loaded? */
- if (!image) {
- g_free (str);
- g_list_free (info.modifiers);
- g_list_free (info.nested);
- return NULL;
- }
- } else
- image = mono_defaults.corlib;
+ if (info.assembly.name) {
+ assembly = mono_assembly_load (&info.assembly, NULL, NULL);
+ } else {
+ MonoReflectionAssembly *refass;
+
+ refass = ves_icall_System_Reflection_Assembly_GetCallingAssembly ();
+ assembly = refass->assembly;
+ }
+
+ if (assembly)
+ type = mono_reflection_get_type (assembly->image, &info, ignoreCase, &type_resolve);
+
+ if (!info.assembly.name && !type) /* try mscorlib */
+ type = mono_reflection_get_type (NULL, &info, ignoreCase, &type_resolve);
- type = mono_reflection_get_type (image, &info, FALSE);
- g_free (str);
g_list_free (info.modifiers);
g_list_free (info.nested);
- if (!type)
+ g_free (temp_str);
+
+ if (!type)
return NULL;
- /*g_print ("got it\n");*/
- return mono_type_get_object (domain, type);
+
+ return mono_type_get_object (mono_domain_get (), type);
+}
+
+#ifdef UNUSED
+MonoReflectionType *
+mono_type_get (const char *str)
+{
+ char *copy = g_strdup (str);
+ MonoReflectionType *type = type_from_name (copy, FALSE);
+
+ g_free (copy);
+ return type;
+}
+#endif
+
+static MonoReflectionType*
+ves_icall_type_from_name (MonoString *name,
+ MonoBoolean throwOnError,
+ MonoBoolean ignoreCase)
+{
+ char *str = mono_string_to_utf8 (name);
+ MonoReflectionType *type;
+
+ type = type_from_name (str, ignoreCase);
+ g_free (str);
+ if (type == NULL){
+ if (throwOnError)
+ mono_raise_exception (mono_get_exception_type_load (name));
+ }
+
+ return type;
}
+
static MonoReflectionType*
ves_icall_type_from_handle (MonoType *handle)
{
MonoDomain *domain = mono_domain_get ();
MonoClass *klass = mono_class_from_mono_type (handle);
+ MONO_ARCH_SAVE_REGS;
+
mono_class_init (klass);
return mono_type_get_object (domain, handle);
}
@@ -725,12 +1036,117 @@ ves_icall_type_from_handle (MonoType *handle)
static guint32
ves_icall_type_Equals (MonoReflectionType *type, MonoReflectionType *c)
{
+ MONO_ARCH_SAVE_REGS;
+
if (type->type && c->type)
return mono_metadata_type_equal (type->type, c->type);
g_print ("type equals\n");
return 0;
}
+/* System.TypeCode */
+typedef enum {
+ TYPECODE_EMPTY,
+ TYPECODE_OBJECT,
+ TYPECODE_DBNULL,
+ TYPECODE_BOOLEAN,
+ TYPECODE_CHAR,
+ TYPECODE_SBYTE,
+ TYPECODE_BYTE,
+ TYPECODE_INT16,
+ TYPECODE_UINT16,
+ TYPECODE_INT32,
+ TYPECODE_UINT32,
+ TYPECODE_INT64,
+ TYPECODE_UINT64,
+ TYPECODE_SINGLE,
+ TYPECODE_DOUBLE,
+ TYPECODE_DECIMAL,
+ TYPECODE_DATETIME,
+ TYPECODE_STRING = 18
+} TypeCode;
+
+static guint32
+ves_icall_type_GetTypeCode (MonoReflectionType *type)
+{
+ int t = type->type->type;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (type->type->byref)
+ return TYPECODE_OBJECT;
+
+handle_enum:
+ switch (t) {
+ case MONO_TYPE_VOID:
+ return TYPECODE_OBJECT;
+ case MONO_TYPE_BOOLEAN:
+ return TYPECODE_BOOLEAN;
+ case MONO_TYPE_U1:
+ return TYPECODE_BYTE;
+ case MONO_TYPE_I1:
+ return TYPECODE_SBYTE;
+ case MONO_TYPE_U2:
+ return TYPECODE_UINT16;
+ case MONO_TYPE_I2:
+ return TYPECODE_INT16;
+ case MONO_TYPE_CHAR:
+ return TYPECODE_CHAR;
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_U:
+ case MONO_TYPE_I:
+ return TYPECODE_OBJECT;
+ case MONO_TYPE_U4:
+ return TYPECODE_UINT32;
+ case MONO_TYPE_I4:
+ return TYPECODE_INT32;
+ case MONO_TYPE_U8:
+ return TYPECODE_UINT64;
+ case MONO_TYPE_I8:
+ return TYPECODE_INT64;
+ case MONO_TYPE_R4:
+ return TYPECODE_SINGLE;
+ case MONO_TYPE_R8:
+ return TYPECODE_DOUBLE;
+ case MONO_TYPE_VALUETYPE:
+ if (type->type->data.klass->enumtype) {
+ t = type->type->data.klass->enum_basetype->type;
+ goto handle_enum;
+ } else {
+ MonoClass *k = type->type->data.klass;
+ if (strcmp (k->name_space, "System") == 0) {
+ if (strcmp (k->name, "Decimal") == 0)
+ return TYPECODE_DECIMAL;
+ else if (strcmp (k->name, "DateTime") == 0)
+ return TYPECODE_DATETIME;
+ }
+ }
+ return TYPECODE_OBJECT;
+ case MONO_TYPE_STRING:
+ return TYPECODE_STRING;
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ return TYPECODE_OBJECT;
+ case MONO_TYPE_CLASS:
+ {
+ MonoClass *k = type->type->data.klass;
+ if (strcmp (k->name_space, "System") == 0) {
+ if (strcmp (k->name, "DBNull") == 0)
+ return TYPECODE_DBNULL;
+ }
+ }
+ return TYPECODE_OBJECT;
+ case MONO_TYPE_GENERICINST:
+ return TYPECODE_OBJECT;
+ default:
+ g_error ("type 0x%02x not handled in GetTypeCode()", t);
+ }
+ return 0;
+}
+
static guint32
ves_icall_type_is_subtype_of (MonoReflectionType *type, MonoReflectionType *c, MonoBoolean check_interfaces)
{
@@ -738,6 +1154,8 @@ ves_icall_type_is_subtype_of (MonoReflectionType *type, MonoReflectionType *c, M
MonoClass *klass;
MonoClass *klassc;
+ MONO_ARCH_SAVE_REGS;
+
g_assert (type != NULL);
domain = ((MonoObject *)type)->vtable->domain;
@@ -748,28 +1166,39 @@ ves_icall_type_is_subtype_of (MonoReflectionType *type, MonoReflectionType *c, M
klass = mono_class_from_mono_type (type->type);
klassc = mono_class_from_mono_type (c->type);
- /* cut&paste from mono_object_isinst (): keep in sync */
- if (check_interfaces && (klassc->flags & TYPE_ATTRIBUTE_INTERFACE) && !(klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
- MonoVTable *klass_vt = mono_class_vtable (domain, klass);
- if ((klassc->interface_id <= klass->max_interface_id) &&
- klass_vt->interface_offsets [klassc->interface_id])
- return 1;
- } else if (check_interfaces && (klassc->flags & TYPE_ATTRIBUTE_INTERFACE) && (klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
- int i;
+ if (type->type->byref)
+ return klassc == mono_defaults.object_class;
- for (i = 0; i < klass->interface_count; i ++) {
- MonoClass *ic = klass->interfaces [i];
- if (ic == klassc)
- return 1;
- }
- } else {
- /*
- * klass->baseval is 0 for interfaces
- */
- if (klass->baseval && ((klass->baseval - klassc->baseval) <= klassc->diffval))
- return 1;
- }
- return 0;
+ return mono_class_is_subclass_of (klass, klassc, check_interfaces);
+}
+
+static guint32
+ves_icall_type_is_assignable_from (MonoReflectionType *type, MonoReflectionType *c)
+{
+ MonoDomain *domain;
+ MonoClass *klass;
+ MonoClass *klassc;
+
+ MONO_ARCH_SAVE_REGS;
+
+ g_assert (type != NULL);
+
+ domain = ((MonoObject *)type)->vtable->domain;
+
+ klass = mono_class_from_mono_type (type->type);
+ klassc = mono_class_from_mono_type (c->type);
+
+ if (type->type->byref && !c->type->byref)
+ return FALSE;
+
+ return mono_class_is_assignable_from (klass, klassc);
+}
+
+static guint32
+ves_icall_type_IsInstanceOfType (MonoReflectionType *type, MonoObject *obj)
+{
+ MonoClass *klass = mono_class_from_mono_type (type->type);
+ return mono_object_isinst (obj, klass) != NULL;
}
static guint32
@@ -777,94 +1206,270 @@ ves_icall_get_attributes (MonoReflectionType *type)
{
MonoClass *klass = mono_class_from_mono_type (type->type);
+ MONO_ARCH_SAVE_REGS;
+
return klass->flags;
}
+static MonoReflectionMarshal*
+ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal (MonoReflectionField *field)
+{
+ MonoClass *klass = field->field->parent;
+ MonoMarshalType *info;
+ int i;
+
+ if (klass->generic_container ||
+ (klass->generic_inst && klass->generic_inst->is_open))
+ return NULL;
+
+ info = mono_marshal_load_type_info (klass);
+
+ for (i = 0; i < info->num_fields; ++i) {
+ if (info->fields [i].field == field->field) {
+ if (!info->fields [i].mspec)
+ return NULL;
+ else
+ return mono_reflection_marshal_from_marshal_spec (field->object.vtable->domain, klass, info->fields [i].mspec);
+ }
+ }
+
+ return NULL;
+}
+
+static MonoReflectionField*
+ves_icall_System_Reflection_FieldInfo_internal_from_handle (MonoClassField *handle)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ g_assert (handle);
+
+ return mono_field_get_object (mono_domain_get (), handle->parent, handle);
+}
+
static void
ves_icall_get_method_info (MonoMethod *method, MonoMethodInfo *info)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_domain_get ();
+
+ MONO_ARCH_SAVE_REGS;
info->parent = mono_type_get_object (domain, &method->klass->byval_arg);
info->ret = mono_type_get_object (domain, method->signature->ret);
info->attrs = method->flags;
info->implattrs = method->iflags;
+ if (method->signature->call_convention == MONO_CALL_DEFAULT)
+ info->callconv = 1;
+ else {
+ if (method->signature->call_convention == MONO_CALL_VARARG)
+ info->callconv = 2;
+ else
+ info->callconv = 0;
+ }
+ info->callconv |= (method->signature->hasthis << 5) | (method->signature->explicit_this << 6);
}
static MonoArray*
ves_icall_get_parameter_info (MonoMethod *method)
{
MonoDomain *domain = mono_domain_get ();
- MonoArray *res;
- static MonoClass *System_Reflection_ParameterInfo;
- MonoReflectionParameter** args;
- int i;
- args = mono_param_get_objects (domain, method);
- if (!System_Reflection_ParameterInfo)
- System_Reflection_ParameterInfo = mono_class_from_name (
- mono_defaults.corlib, "System.Reflection", "ParameterInfo");
- res = mono_array_new (domain, System_Reflection_ParameterInfo, method->signature->param_count);
- for (i = 0; i < method->signature->param_count; ++i) {
- mono_array_set (res, gpointer, i, args [i]);
- }
- return res;
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_param_get_objects (domain, method);
}
-static void
-ves_icall_get_field_info (MonoReflectionField *field, MonoFieldInfo *info)
+static gint32
+ves_icall_MonoField_GetFieldOffset (MonoReflectionField *field)
{
- MonoDomain *domain = mono_domain_get ();
+ return field->field->offset - sizeof (MonoObject);
+}
+
+static MonoReflectionType*
+ves_icall_MonoField_GetParentType (MonoReflectionField *field, MonoBoolean declaring)
+{
+ MonoClass *parent;
+ MONO_ARCH_SAVE_REGS;
- info->parent = mono_type_get_object (domain, &field->klass->byval_arg);
- info->type = mono_type_get_object (domain, field->field->type);
- info->name = mono_string_new (domain, field->field->name);
- info->attrs = field->field->type->attrs;
+ parent = declaring? field->field->parent: field->klass;
+
+ return mono_type_get_object (mono_object_domain (field), &parent->byval_arg);
}
static MonoObject *
-ves_icall_MonoField_GetValue (MonoReflectionField *field, MonoObject *obj) {
- MonoObject *res;
+ves_icall_MonoField_GetValueInternal (MonoReflectionField *field, MonoObject *obj)
+{
+ MonoObject *o;
+ MonoClassField *cf = field->field;
MonoClass *klass;
- MonoType *ftype = field->field->type;
- int type = ftype->type;
- char *p, *r;
- guint32 align;
+ MonoVTable *vtable;
+ MonoDomain *domain = mono_object_domain (field);
+ gchar *v;
+ gboolean is_static = FALSE;
+ gboolean is_ref = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
mono_class_init (field->klass);
- if (ftype->attrs & FIELD_ATTRIBUTE_STATIC) {
- MonoVTable *vtable;
- vtable = mono_class_vtable (mono_domain_get (), field->klass);
- p = (char*)(vtable->data) + field->field->offset;
- } else {
- p = (char*)obj + field->field->offset;
- }
- switch (type) {
- case MONO_TYPE_OBJECT:
+ switch (cf->type->type) {
case MONO_TYPE_STRING:
- case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
case MONO_TYPE_ARRAY:
- return *(MonoObject**)p;
+ case MONO_TYPE_SZARRAY:
+ is_ref = TRUE;
+ break;
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_VALUETYPE:
+ is_ref = cf->type->byref;
+ break;
+ default:
+ g_error ("type 0x%x not handled in "
+ "ves_icall_Monofield_GetValue", cf->type->type);
+ return NULL;
}
- klass = mono_class_from_mono_type (ftype);
- res = mono_object_new (mono_domain_get (), klass);
- r = (char*)res + sizeof (MonoObject);
- memcpy (r, p, mono_class_value_size (klass, &align));
- return res;
+ vtable = NULL;
+ if (cf->type->attrs & FIELD_ATTRIBUTE_STATIC) {
+ is_static = TRUE;
+ vtable = mono_class_vtable (domain, field->klass);
+ if (!vtable->initialized && !(cf->type->attrs & FIELD_ATTRIBUTE_LITERAL))
+ mono_runtime_class_init (vtable);
+ }
+
+ if (is_ref) {
+ if (is_static) {
+ mono_field_static_get_value (vtable, cf, &o);
+ } else {
+ mono_field_get_value (obj, cf, &o);
+ }
+ return o;
+ }
+
+ /* boxed value type */
+ klass = mono_class_from_mono_type (cf->type);
+ o = mono_object_new (domain, klass);
+ v = ((gchar *) o) + sizeof (MonoObject);
+ if (is_static) {
+ mono_field_static_get_value (vtable, cf, v);
+ } else {
+ mono_field_get_value (obj, cf, v);
+ }
+
+ return o;
}
static void
-ves_icall_get_property_info (MonoReflectionProperty *property, MonoPropertyInfo *info)
+ves_icall_FieldInfo_SetValueInternal (MonoReflectionField *field, MonoObject *obj, MonoObject *value)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoClassField *cf = field->field;
+ gchar *v;
- info->parent = mono_type_get_object (domain, &property->klass->byval_arg);
- info->name = mono_string_new (domain, property->property->name);
- info->attrs = property->property->attrs;
- info->get = property->property->get ? mono_method_get_object (domain, property->property->get): NULL;
- info->set = property->property->set ? mono_method_get_object (domain, property->property->set): NULL;
+ MONO_ARCH_SAVE_REGS;
+
+ v = (gchar *) value;
+ if (!cf->type->byref) {
+ switch (cf->type->type) {
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_VALUETYPE:
+ v += sizeof (MonoObject);
+ break;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ /* Do nothing */
+ break;
+ default:
+ g_error ("type 0x%x not handled in "
+ "ves_icall_FieldInfo_SetValueInternal", cf->type->type);
+ return;
+ }
+ }
+
+ if (cf->type->attrs & FIELD_ATTRIBUTE_STATIC) {
+ MonoVTable *vtable = mono_class_vtable (mono_object_domain (field), field->klass);
+ if (!vtable->initialized)
+ mono_runtime_class_init (vtable);
+ mono_field_static_set_value (vtable, cf, v);
+ } else {
+ mono_field_set_value (obj, cf, v);
+ }
+}
+
+static MonoReflectionField*
+ves_icall_MonoField_Mono_GetGenericFieldDefinition (MonoReflectionField *field)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (field->field->generic_info && field->field->generic_info->reflection_info)
+ return field->field->generic_info->reflection_info;
+
+ return field;
+}
+
+/* From MonoProperty.cs */
+typedef enum {
+ PInfo_Attributes = 1,
+ PInfo_GetMethod = 1 << 1,
+ PInfo_SetMethod = 1 << 2,
+ PInfo_ReflectedType = 1 << 3,
+ PInfo_DeclaringType = 1 << 4,
+ PInfo_Name = 1 << 5
+} PInfo;
+
+static void
+ves_icall_get_property_info (MonoReflectionProperty *property, MonoPropertyInfo *info, PInfo req_info)
+{
+ MonoDomain *domain = mono_object_domain (property);
+
+ MONO_ARCH_SAVE_REGS;
+
+ if ((req_info & PInfo_ReflectedType) != 0)
+ info->parent = mono_type_get_object (domain, &property->klass->byval_arg);
+ else if ((req_info & PInfo_DeclaringType) != 0)
+ info->parent = mono_type_get_object (domain, &property->property->parent->byval_arg);
+
+ if ((req_info & PInfo_Name) != 0)
+ info->name = mono_string_new (domain, property->property->name);
+
+ if ((req_info & PInfo_Attributes) != 0)
+ info->attrs = property->property->attrs;
+
+ if ((req_info & PInfo_GetMethod) != 0)
+ info->get = property->property->get ?
+ mono_method_get_object (domain, property->property->get, NULL): NULL;
+
+ if ((req_info & PInfo_SetMethod) != 0)
+ info->set = property->property->set ?
+ mono_method_get_object (domain, property->property->set, NULL): NULL;
/*
* There may be other methods defined for properties, though, it seems they are not exposed
* in the reflection API
@@ -874,147 +1479,985 @@ ves_icall_get_property_info (MonoReflectionProperty *property, MonoPropertyInfo
static void
ves_icall_get_event_info (MonoReflectionEvent *event, MonoEventInfo *info)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_object_domain (event);
+
+ MONO_ARCH_SAVE_REGS;
+
+ info->declaring_type = mono_type_get_object (domain, &event->klass->byval_arg);
+ info->reflected_type = mono_type_get_object (domain, &event->event->parent->byval_arg);
- info->parent = mono_type_get_object (domain, &event->klass->byval_arg);
info->name = mono_string_new (domain, event->event->name);
info->attrs = event->event->attrs;
- info->add_method = event->event->add ? mono_method_get_object (domain, event->event->add): NULL;
- info->remove_method = event->event->remove ? mono_method_get_object (domain, event->event->remove): NULL;
- info->raise_method = event->event->raise ? mono_method_get_object (domain, event->event->raise): NULL;
+ info->add_method = event->event->add ? mono_method_get_object (domain, event->event->add, NULL): NULL;
+ info->remove_method = event->event->remove ? mono_method_get_object (domain, event->event->remove, NULL): NULL;
+ info->raise_method = event->event->raise ? mono_method_get_object (domain, event->event->raise, NULL): NULL;
+
+ if (event->event->other) {
+ int i, n = 0;
+ while (event->event->other [n])
+ n++;
+ info->other_methods = mono_array_new (domain, mono_defaults.method_info_class, n);
+
+ for (i = 0; i < n; i++)
+ mono_array_set (info->other_methods, gpointer, i,
+ mono_method_get_object (domain, event->event->other [i], NULL));
+ }
}
static MonoArray*
ves_icall_Type_GetInterfaces (MonoReflectionType* type)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_object_domain (type);
MonoArray *intf;
- int ninterf, i;
+ GPtrArray *ifaces = NULL;
+ int i;
MonoClass *class = mono_class_from_mono_type (type->type);
MonoClass *parent;
+ MonoBitSet *slots = mono_bitset_new (class->max_interface_id + 1, 0);
- ninterf = 0;
- for (parent = class; parent; parent = parent->parent) {
- ninterf += parent->interface_count;
+ MONO_ARCH_SAVE_REGS;
+
+ if (class->rank) {
+ /* GetInterfaces() returns an empty array in MS.NET (this may be a bug) */
+ mono_bitset_free (slots);
+ return mono_array_new (domain, mono_defaults.monotype_class, 0);
}
- intf = mono_array_new (domain, mono_defaults.monotype_class, ninterf);
- ninterf = 0;
+
for (parent = class; parent; parent = parent->parent) {
- for (i = 0; i < parent->interface_count; ++i) {
- mono_array_set (intf, gpointer, ninterf, mono_type_get_object (domain, &parent->interfaces [i]->byval_arg));
- ++ninterf;
+ GPtrArray *tmp_ifaces = mono_class_get_implemented_interfaces (parent);
+ if (tmp_ifaces) {
+ for (i = 0; i < tmp_ifaces->len; ++i) {
+ MonoClass *ic = g_ptr_array_index (tmp_ifaces, i);
+
+ if (mono_bitset_test (slots, ic->interface_id))
+ continue;
+
+ mono_bitset_set (slots, ic->interface_id);
+ if (ifaces == NULL)
+ ifaces = g_ptr_array_new ();
+ g_ptr_array_add (ifaces, ic);
+ }
+ g_ptr_array_free (tmp_ifaces, TRUE);
}
}
+ mono_bitset_free (slots);
+
+ if (!ifaces)
+ return mono_array_new (domain, mono_defaults.monotype_class, 0);
+
+ intf = mono_array_new (domain, mono_defaults.monotype_class, ifaces->len);
+ for (i = 0; i < ifaces->len; ++i) {
+ MonoClass *ic = g_ptr_array_index (ifaces, i);
+
+ mono_array_set (intf, gpointer, i,
+ mono_type_get_object (domain, &ic->byval_arg));
+ }
+ g_ptr_array_free (ifaces, TRUE);
+
return intf;
}
+static void
+ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType *iface, MonoArray **targets, MonoArray **methods)
+{
+ MonoClass *class = mono_class_from_mono_type (type->type);
+ MonoClass *iclass = mono_class_from_mono_type (iface->type);
+ MonoReflectionMethod *member;
+ int i, len, ioffset;
+ MonoDomain *domain;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* type doesn't implement iface: the exception is thrown in managed code */
+ if ((iclass->interface_id > class->max_interface_id) || !class->interface_offsets [iclass->interface_id])
+ return;
+
+ len = iclass->method.count;
+ ioffset = class->interface_offsets [iclass->interface_id];
+ domain = mono_object_domain (type);
+ *targets = mono_array_new (domain, mono_defaults.method_info_class, len);
+ *methods = mono_array_new (domain, mono_defaults.method_info_class, len);
+ for (i = 0; i < len; ++i) {
+ member = mono_method_get_object (domain, iclass->methods [i], iclass);
+ mono_array_set (*methods, gpointer, i, member);
+ member = mono_method_get_object (domain, class->vtable [i + ioffset], class);
+ mono_array_set (*targets, gpointer, i, member);
+ }
+}
+
+static void
+ves_icall_Type_GetPacking (MonoReflectionType *type, guint32 *packing, guint32 *size)
+{
+ MonoClass *klass = mono_class_from_mono_type (type->type);
+
+ g_assert (!klass->image->dynamic);
+
+ mono_metadata_packing_from_typedef (klass->image, klass->type_token, packing, size);
+}
+
static MonoReflectionType*
ves_icall_MonoType_GetElementType (MonoReflectionType *type)
{
MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ // GelElementType should only return a type for:
+ // Array Pointer PassedByRef
+ if (type->type->byref)
+ return mono_type_get_object (mono_object_domain (type), &class->byval_arg);
if (class->enumtype && class->enum_basetype) /* types that are modifierd typebuilkders may not have enum_basetype set */
return mono_type_get_object (mono_object_domain (type), class->enum_basetype);
- else if (class->element_class)
+ else if (class->element_class && MONO_CLASS_IS_ARRAY (class))
+ return mono_type_get_object (mono_object_domain (type), &class->element_class->byval_arg);
+ else if (class->element_class && type->type->type == MONO_TYPE_PTR)
return mono_type_get_object (mono_object_domain (type), &class->element_class->byval_arg);
else
return NULL;
}
-static void
-ves_icall_get_type_info (MonoType *type, MonoTypeInfo *info)
+static MonoReflectionType*
+ves_icall_get_type_parent (MonoReflectionType *type)
+{
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return class->parent ? mono_type_get_object (mono_object_domain (type), &class->parent->byval_arg): NULL;
+}
+
+static MonoBoolean
+ves_icall_type_ispointer (MonoReflectionType *type)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return type->type->type == MONO_TYPE_PTR;
+}
+
+static MonoBoolean
+ves_icall_type_isprimitive (MonoReflectionType *type)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return (!type->type->byref && (type->type->type >= MONO_TYPE_BOOLEAN) && (type->type->type <= MONO_TYPE_R8));
+}
+
+static MonoBoolean
+ves_icall_type_isbyref (MonoReflectionType *type)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return type->type->byref;
+}
+
+static MonoReflectionModule*
+ves_icall_MonoType_get_Module (MonoReflectionType *type)
+{
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_module_get_object (mono_object_domain (type), class->image);
+}
+
+static MonoReflectionAssembly*
+ves_icall_MonoType_get_Assembly (MonoReflectionType *type)
{
MonoDomain *domain = mono_domain_get ();
- MonoClass *class = mono_class_from_mono_type (type);
-
- info->parent = class->parent ? mono_type_get_object (domain, &class->parent->byval_arg): NULL;
- info->name = mono_string_new (domain, class->name);
- info->name_space = mono_string_new (domain, class->name_space);
- info->attrs = class->flags;
- info->rank = class->rank;
- info->assembly = mono_assembly_get_object (domain, class->image->assembly);
- if (class->enumtype && class->enum_basetype) /* types that are modifierd typebuilkders may not have enum_basetype set */
- info->etype = mono_type_get_object (domain, class->enum_basetype);
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_assembly_get_object (domain, class->image->assembly);
+}
+
+static MonoReflectionType*
+ves_icall_MonoType_get_DeclaringType (MonoReflectionType *type)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return class->nested_in ? mono_type_get_object (domain, &class->nested_in->byval_arg) : NULL;
+}
+
+static MonoReflectionType*
+ves_icall_MonoType_get_UnderlyingSystemType (MonoReflectionType *type)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (class->enumtype && class->enum_basetype) /* types that are modified typebuilders may not have enum_basetype set */
+ return mono_type_get_object (domain, class->enum_basetype);
else if (class->element_class)
- info->etype = mono_type_get_object (domain, &class->element_class->byval_arg);
+ return mono_type_get_object (domain, &class->element_class->byval_arg);
+ else
+ return NULL;
+}
+
+static MonoString*
+ves_icall_MonoType_get_Name (MonoReflectionType *type)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_string_new (domain, class->name);
+}
+
+static MonoString*
+ves_icall_MonoType_get_Namespace (MonoReflectionType *type)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ while (class->nested_in)
+ class = class->nested_in;
+
+ if (class->name_space [0] == '\0')
+ return NULL;
+ else
+ return mono_string_new (domain, class->name_space);
+}
+
+static gint32
+ves_icall_MonoType_GetArrayRank (MonoReflectionType *type)
+{
+ MonoClass *class = mono_class_from_mono_type (type->type);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return class->rank;
+}
+
+static MonoArray*
+ves_icall_MonoType_GetGenericArguments (MonoReflectionType *type)
+{
+ MonoArray *res;
+ MonoClass *klass, *pklass;
+ int i;
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type);
+
+ if (klass->generic_container) {
+ MonoGenericContainer *container = klass->generic_container;
+ res = mono_array_new (mono_object_domain (type), mono_defaults.monotype_class, container->type_argc);
+ for (i = 0; i < container->type_argc; ++i) {
+ pklass = mono_class_from_generic_parameter (&container->type_params [i], klass->image, FALSE);
+ mono_array_set (res, gpointer, i, mono_type_get_object (mono_object_domain (type), &pklass->byval_arg));
+ }
+ } else if (klass->generic_inst) {
+ MonoGenericInst *inst = klass->generic_inst;
+ res = mono_array_new (mono_object_domain (type), mono_defaults.monotype_class, inst->type_argc);
+ for (i = 0; i < inst->type_argc; ++i) {
+ mono_array_set (res, gpointer, i, mono_type_get_object (mono_object_domain (type), inst->type_argv [i]));
+ }
+ } else {
+ res = mono_array_new (mono_object_domain (type), mono_defaults.monotype_class, 0);
+ }
+ return res;
+}
+
+static gboolean
+ves_icall_Type_get_IsGenericTypeDefinition (MonoReflectionType *type)
+{
+ MonoClass *klass;
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type);
+
+ return klass->generic_container != NULL;
+}
+
+static MonoReflectionType*
+ves_icall_Type_GetGenericTypeDefinition_impl (MonoReflectionType *type)
+{
+ MonoClass *klass;
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type);
+ if (klass->generic_container) {
+ return type; /* check this one */
+ }
+ if (klass->generic_inst) {
+ MonoType *generic_type = klass->generic_inst->generic_type;
+ MonoClass *generic_class = mono_class_from_mono_type (generic_type);
+
+ if (generic_class->wastypebuilder && generic_class->reflection_info)
+ return generic_class->reflection_info;
+ else
+ return mono_type_get_object (mono_object_domain (type), generic_type);
+ }
+ return NULL;
+}
+
+static MonoReflectionType*
+ves_icall_Type_BindGenericParameters (MonoReflectionType *type, MonoArray *type_array)
+{
+ MonoType *geninst, **types;
+ int i, count;
+
+ MONO_ARCH_SAVE_REGS;
+
+ count = mono_array_length (type_array);
+ types = g_new0 (MonoType *, count);
+
+ for (i = 0; i < count; i++) {
+ MonoReflectionType *t = mono_array_get (type_array, gpointer, i);
+ types [i] = t->type;
+ }
+
+ geninst = mono_reflection_bind_generic_parameters (type, count, types);
+
+ return mono_type_get_object (mono_object_domain (type), geninst);
+}
+
+static gboolean
+ves_icall_Type_get_IsGenericInstance (MonoReflectionType *type)
+{
+ MonoClass *klass;
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type);
+ return klass->generic_inst != NULL;
+}
+
+static gint32
+ves_icall_Type_GetGenericParameterPosition (MonoReflectionType *type)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (type->type->type == MONO_TYPE_VAR || type->type->type == MONO_TYPE_MVAR)
+ return type->type->data.generic_param->num;
+ return -1;
+}
+
+static GenericParameterAttributes
+ves_icall_Type_GetGenericParameterAttributes (MonoReflectionType *type)
+{
+ MONO_ARCH_SAVE_REGS;
+ return type->type->data.generic_param->flags;
+}
+
+static MonoArray *
+ves_icall_Type_GetGenericParameterConstraints (MonoReflectionType *type)
+{
+ MonoGenericParam *param;
+ MonoDomain *domain;
+ MonoClass **ptr;
+ MonoArray *res;
+ int i, count;
+
+ MONO_ARCH_SAVE_REGS;
+
+ domain = mono_object_domain (type);
+ param = type->type->data.generic_param;
+ for (count = 0, ptr = param->constraints; ptr && *ptr; ptr++, count++)
+ ;
+
+ res = mono_array_new (domain, mono_defaults.monotype_class, count);
+ for (i = 0; i < count; i++)
+ mono_array_set (res, gpointer, i,
+ mono_type_get_object (domain, &param->constraints [i]->byval_arg));
+
+
+ return res;
+}
+
+static MonoBoolean
+ves_icall_MonoType_get_HasGenericArguments (MonoReflectionType *type)
+{
+ MonoClass *klass;
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type);
+ if (klass->generic_container || klass->generic_inst)
+ return TRUE;
+ return FALSE;
+}
+
+static MonoBoolean
+ves_icall_MonoType_get_IsGenericParameter (MonoReflectionType *type)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (type->type->type == MONO_TYPE_VAR || type->type->type == MONO_TYPE_MVAR)
+ return TRUE;
+ return FALSE;
+}
+
+static MonoBoolean
+ves_icall_TypeBuilder_get_IsGenericParameter (MonoReflectionTypeBuilder *tb)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (tb->type.type->type == MONO_TYPE_VAR || tb->type.type->type == MONO_TYPE_MVAR)
+ return TRUE;
+ return FALSE;
+}
+
+static void
+ves_icall_EnumBuilder_setup_enum_type (MonoReflectionType *enumtype,
+ MonoReflectionType *t)
+{
+ enumtype->type = t->type;
+}
+
+static MonoReflectionType*
+ves_icall_MonoGenericInst_GetParentType (MonoReflectionGenericInst *type)
+{
+ MonoGenericInst *ginst;
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ginst = type->type.type->data.generic_inst;
+ if (!ginst || !ginst->parent || (ginst->parent->type != MONO_TYPE_GENERICINST))
+ return NULL;
+
+ klass = mono_class_from_mono_type (ginst->parent);
+ if (!klass->generic_inst && !klass->generic_container)
+ return NULL;
+
+ return mono_type_get_object (mono_object_domain (type), ginst->parent);
+}
+
+static MonoArray*
+ves_icall_MonoGenericInst_GetInterfaces (MonoReflectionGenericInst *type)
+{
+ static MonoClass *System_Reflection_MonoGenericInst;
+ MonoGenericInst *ginst;
+ MonoDomain *domain;
+ MonoClass *klass;
+ MonoArray *res;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!System_Reflection_MonoGenericInst) {
+ System_Reflection_MonoGenericInst = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "MonoGenericInst");
+ g_assert (System_Reflection_MonoGenericInst);
+ }
+
+ domain = mono_object_domain (type);
+
+ ginst = type->type.type->data.generic_inst;
+ if (!ginst || !ginst->ifaces)
+ return mono_array_new (domain, System_Reflection_MonoGenericInst, 0);
+
+ klass = mono_class_from_mono_type (ginst->generic_type);
+
+ res = mono_array_new (domain, System_Reflection_MonoGenericInst, ginst->count_ifaces);
+
+ for (i = 0; i < ginst->count_ifaces; i++) {
+ MonoReflectionType *iface = mono_type_get_object (domain, ginst->ifaces [i]);
+
+ mono_array_set (res, gpointer, i, iface);
+ }
+
+ return res;
+}
+
+static MonoArray*
+ves_icall_MonoGenericInst_GetMethods (MonoReflectionGenericInst *type,
+ MonoReflectionType *reflected_type)
+{
+ MonoGenericInst *ginst;
+ MonoDynamicGenericInst *dginst;
+ MonoDomain *domain;
+ MonoClass *refclass;
+ MonoArray *res;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ginst = type->type.type->data.generic_inst;
+ g_assert ((dginst = ginst->dynamic_info) != NULL);
+
+ refclass = mono_class_from_mono_type (reflected_type->type);
+
+ domain = mono_object_domain (type);
+ res = mono_array_new (domain, mono_defaults.method_info_class, dginst->count_methods);
+
+ for (i = 0; i < dginst->count_methods; i++)
+ mono_array_set (res, gpointer, i,
+ mono_method_get_object (domain, dginst->methods [i], refclass));
+
+ return res;
+}
+
+static MonoArray*
+ves_icall_MonoGenericInst_GetConstructors (MonoReflectionGenericInst *type,
+ MonoReflectionType *reflected_type)
+{
+ static MonoClass *System_Reflection_ConstructorInfo;
+ MonoGenericInst *ginst;
+ MonoDynamicGenericInst *dginst;
+ MonoDomain *domain;
+ MonoClass *refclass;
+ MonoArray *res;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!System_Reflection_ConstructorInfo)
+ System_Reflection_ConstructorInfo = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "ConstructorInfo");
+
+ ginst = type->type.type->data.generic_inst;
+ g_assert ((dginst = ginst->dynamic_info) != NULL);
+
+ refclass = mono_class_from_mono_type (reflected_type->type);
+
+ domain = mono_object_domain (type);
+ res = mono_array_new (domain, System_Reflection_ConstructorInfo, dginst->count_ctors);
+
+ for (i = 0; i < dginst->count_ctors; i++)
+ mono_array_set (res, gpointer, i,
+ mono_method_get_object (domain, dginst->ctors [i], refclass));
+
+ return res;
+}
+
+static MonoArray*
+ves_icall_MonoGenericInst_GetFields (MonoReflectionGenericInst *type,
+ MonoReflectionType *reflected_type)
+{
+ MonoGenericInst *ginst;
+ MonoDynamicGenericInst *dginst;
+ MonoDomain *domain;
+ MonoClass *refclass;
+ MonoArray *res;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ginst = type->type.type->data.generic_inst;
+ g_assert ((dginst = ginst->dynamic_info) != NULL);
+
+ refclass = mono_class_from_mono_type (reflected_type->type);
+
+ domain = mono_object_domain (type);
+ res = mono_array_new (domain, mono_defaults.field_info_class, dginst->count_fields);
+
+ for (i = 0; i < dginst->count_fields; i++)
+ mono_array_set (res, gpointer, i,
+ mono_field_get_object (domain, refclass, &dginst->fields [i]));
+
+ return res;
+}
+
+static MonoArray*
+ves_icall_MonoGenericInst_GetProperties (MonoReflectionGenericInst *type,
+ MonoReflectionType *reflected_type)
+{
+ static MonoClass *System_Reflection_PropertyInfo;
+ MonoGenericInst *ginst;
+ MonoDynamicGenericInst *dginst;
+ MonoDomain *domain;
+ MonoClass *refclass;
+ MonoArray *res;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!System_Reflection_PropertyInfo)
+ System_Reflection_PropertyInfo = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "PropertyInfo");
+
+ ginst = type->type.type->data.generic_inst;
+ g_assert ((dginst = ginst->dynamic_info) != NULL);
+
+ refclass = mono_class_from_mono_type (reflected_type->type);
+
+ domain = mono_object_domain (type);
+ res = mono_array_new (domain, System_Reflection_PropertyInfo, dginst->count_properties);
+
+ for (i = 0; i < dginst->count_properties; i++)
+ mono_array_set (res, gpointer, i,
+ mono_property_get_object (domain, refclass, &dginst->properties [i]));
+
+ return res;
+}
+
+static MonoArray*
+ves_icall_MonoGenericInst_GetEvents (MonoReflectionGenericInst *type,
+ MonoReflectionType *reflected_type)
+{
+ static MonoClass *System_Reflection_EventInfo;
+ MonoGenericInst *ginst;
+ MonoDynamicGenericInst *dginst;
+ MonoDomain *domain;
+ MonoClass *refclass;
+ MonoArray *res;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!System_Reflection_EventInfo)
+ System_Reflection_EventInfo = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "EventInfo");
+
+ ginst = type->type.type->data.generic_inst;
+ g_assert ((dginst = ginst->dynamic_info) != NULL);
+
+ refclass = mono_class_from_mono_type (reflected_type->type);
+
+ domain = mono_object_domain (type);
+ res = mono_array_new (domain, System_Reflection_EventInfo, dginst->count_events);
+
+ for (i = 0; i < dginst->count_events; i++)
+ mono_array_set (res, gpointer, i,
+ mono_event_get_object (domain, refclass, &dginst->events [i]));
+
+ return res;
+}
+
+static MonoReflectionMethod *
+ves_icall_MonoType_get_DeclaringMethod (MonoReflectionType *type)
+{
+ MonoMethod *method;
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ method = type->type->data.generic_param->method;
+ if (!method)
+ return NULL;
+
+ klass = mono_class_from_mono_type (type->type);
+ return mono_method_get_object (mono_object_domain (type), method, klass);
+}
+
+static MonoReflectionDllImportAttribute*
+ves_icall_MonoMethod_GetDllImportAttribute (MonoMethod *method)
+{
+ static MonoClass *DllImportAttributeClass = NULL;
+ MonoDomain *domain = mono_domain_get ();
+ MonoReflectionDllImportAttribute *attr;
+ MonoImage *image = method->klass->image;
+ MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)method;
+ MonoTableInfo *tables = image->tables;
+ MonoTableInfo *im = &tables [MONO_TABLE_IMPLMAP];
+ MonoTableInfo *mr = &tables [MONO_TABLE_MODULEREF];
+ guint32 im_cols [MONO_IMPLMAP_SIZE];
+ guint32 scope_token;
+ const char *import = NULL;
+ const char *scope = NULL;
+ guint32 flags;
+
+ if (!method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ return NULL;
+
+ if (!DllImportAttributeClass) {
+ DllImportAttributeClass =
+ mono_class_from_name (mono_defaults.corlib,
+ "System.Runtime.InteropServices", "DllImportAttribute");
+ g_assert (DllImportAttributeClass);
+ }
+
+ if (method->klass->image->dynamic) {
+ MonoReflectionMethodAux *method_aux =
+ mono_g_hash_table_lookup (
+ ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+ if (method_aux) {
+ import = method_aux->dllentry;
+ scope = method_aux->dll;
+ }
+ }
+ else {
+ if (piinfo->implmap_idx) {
+ mono_metadata_decode_row (im, piinfo->implmap_idx - 1, im_cols, MONO_IMPLMAP_SIZE);
+
+ piinfo->piflags = im_cols [MONO_IMPLMAP_FLAGS];
+ import = mono_metadata_string_heap (image, im_cols [MONO_IMPLMAP_NAME]);
+ scope_token = mono_metadata_decode_row_col (mr, im_cols [MONO_IMPLMAP_SCOPE] - 1, MONO_MODULEREF_NAME);
+ scope = mono_metadata_string_heap (image, scope_token);
+ }
+ }
+ flags = piinfo->piflags;
+
+ attr = (MonoReflectionDllImportAttribute*)mono_object_new (domain, DllImportAttributeClass);
+
+ attr->dll = mono_string_new (domain, scope);
+ attr->entry_point = mono_string_new (domain, import);
+ attr->call_conv = (flags & 0x700) >> 8;
+ attr->charset = ((flags & 0x6) >> 1) + 1;
+ if (attr->charset == 1)
+ attr->charset = 2;
+ attr->exact_spelling = (flags & 0x1) != 0;
+ attr->set_last_error = (flags & 0x4) != 0;
+ attr->best_fit_mapping = (flags & 0x10) != 0;
+ attr->throw_on_unmappable = (flags & 0x1000) != 0;
+ attr->preserve_sig = FALSE;
+
+ return attr;
+}
+
+static MonoReflectionMethod *
+ves_icall_MonoMethod_GetGenericMethodDefinition (MonoReflectionMethod *method)
+{
+ MonoMethodInflated *imethod;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!method->method->signature->is_inflated) {
+ if (method->method->signature->generic_param_count)
+ return method;
+
+ return NULL;
+ }
+
+ imethod = (MonoMethodInflated *) method->method;
+ if (imethod->context->gmethod && imethod->context->gmethod->reflection_info)
+ return imethod->context->gmethod->reflection_info;
else
- info->etype = NULL;
+ return mono_method_get_object (
+ mono_object_domain (method), imethod->declaring, NULL);
+}
- info->isbyref = type->byref;
- info->ispointer = type->type == MONO_TYPE_PTR;
- info->isprimitive = (type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8);
+static gboolean
+ves_icall_MonoMethod_get_HasGenericParameters (MonoReflectionMethod *method)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if ((method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+ return FALSE;
+
+ return method->method->signature->generic_param_count != 0;
+}
+
+static gboolean
+ves_icall_MonoMethod_get_Mono_IsInflatedMethod (MonoReflectionMethod *method)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if ((method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+ return FALSE;
+
+ return method->method->signature->is_inflated;
+}
+
+static gboolean
+ves_icall_MonoMethod_get_IsGenericMethodDefinition (MonoReflectionMethod *method)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if ((method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+ return FALSE;
+
+ return method->method->signature->generic_param_count != 0;
+}
+
+static MonoArray*
+ves_icall_MonoMethod_GetGenericArguments (MonoReflectionMethod *method)
+{
+ MonoArray *res;
+ MonoDomain *domain;
+ MonoMethodNormal *mn;
+ int count, i;
+ MONO_ARCH_SAVE_REGS;
+
+ domain = mono_object_domain (method);
+
+ if ((method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+ return mono_array_new (domain, mono_defaults.monotype_class, 0);
+
+ if (method->method->signature->is_inflated) {
+ MonoMethodInflated *imethod = (MonoMethodInflated *) method->method;
+ MonoGenericMethod *gmethod = imethod->context->gmethod;
+
+ if (gmethod) {
+ count = gmethod->mtype_argc;
+ res = mono_array_new (domain, mono_defaults.monotype_class, count);
+
+ for (i = 0; i < count; i++) {
+ MonoType *t = gmethod->mtype_argv [i];
+ mono_array_set (
+ res, gpointer, i, mono_type_get_object (domain, t));
+ }
+
+ return res;
+ }
+ }
+
+ mn = (MonoMethodNormal *) method->method;
+ count = method->method->signature->generic_param_count;
+ res = mono_array_new (domain, mono_defaults.monotype_class, count);
+
+ for (i = 0; i < count; i++) {
+ MonoGenericParam *param = &mn->generic_container->type_params [i];
+ MonoClass *pklass = mono_class_from_generic_parameter (
+ param, method->method->klass->image, TRUE);
+ mono_array_set (res, gpointer, i,
+ mono_type_get_object (domain, &pklass->byval_arg));
+ }
+
+ return res;
}
static MonoObject *
ves_icall_InternalInvoke (MonoReflectionMethod *method, MonoObject *this, MonoArray *params)
{
- return mono_runtime_invoke_array (method->method, this, params, NULL);
+ /*
+ * Invoke from reflection is supposed to always be a virtual call (the API
+ * is stupid), mono_runtime_invoke_*() calls the provided method, allowing
+ * greater flexibility.
+ */
+ MonoMethod *m = method->method;
+ int pcount;
+ void *obj = this;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (this) {
+ if (!mono_object_isinst (this, m->klass))
+ mono_raise_exception (mono_exception_from_name (mono_defaults.corlib, "System.Reflection", "TargetException"));
+ m = mono_object_get_virtual_method (this, m);
+ /* must pass the pointer to the value for valuetype methods */
+ if (m->klass->valuetype)
+ obj = mono_object_unbox (this);
+ } else if (!(m->flags & METHOD_ATTRIBUTE_STATIC) && strcmp (m->name, ".ctor") && !m->wrapper_type)
+ mono_raise_exception (mono_exception_from_name (mono_defaults.corlib, "System.Reflection", "TargetException"));
+
+ pcount = params? mono_array_length (params): 0;
+ if (pcount != m->signature->param_count)
+ mono_raise_exception (mono_exception_from_name (mono_defaults.corlib, "System.Reflection", "TargetParameterCountException"));
+
+ if ((m->klass->flags & TYPE_ATTRIBUTE_ABSTRACT) && !strcmp (m->name, ".ctor"))
+ mono_raise_exception (mono_exception_from_name_msg (mono_defaults.corlib, "System", "MethodAccessException", "Cannot invoke constructor of an abstract class."));
+
+ if (m->klass->rank && !strcmp (m->name, ".ctor")) {
+ int i;
+ guint32 *lengths;
+ guint32 *lower_bounds;
+ pcount = mono_array_length (params);
+ lengths = alloca (sizeof (guint32) * pcount);
+ for (i = 0; i < pcount; ++i)
+ lengths [i] = *(gint32*) ((char*)mono_array_get (params, gpointer, i) + sizeof (MonoObject));
+
+ if (m->klass->rank == pcount) {
+ /* Only lengths provided. */
+ lower_bounds = NULL;
+ } else {
+ g_assert (pcount == (m->klass->rank * 2));
+ /* lower bounds are first. */
+ lower_bounds = lengths;
+ lengths += m->klass->rank;
+ }
+
+ return (MonoObject*)mono_array_new_full (mono_object_domain (params), m->klass, lengths, lower_bounds);
+ }
+ return mono_runtime_invoke_array (m, obj, params, NULL);
}
static MonoObject *
ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this, MonoArray *params, MonoArray **outArgs)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_object_domain (method);
MonoMethod *m = method->method;
MonoMethodSignature *sig = m->signature;
MonoArray *out_args;
MonoObject *result;
int i, j, outarg_count = 0;
+ MONO_ARCH_SAVE_REGS;
+
if (m->klass == mono_defaults.object_class) {
if (!strcmp (m->name, "FieldGetter")) {
MonoClass *k = this->vtable->klass;
- MonoString *name = mono_array_get (params, MonoString *, 1);
+ MonoString *name;
char *str;
-
+
+ /* If this is a proxy, then it must be a CBO */
+ if (k == mono_defaults.transparent_proxy_class) {
+ MonoTransparentProxy *tp = (MonoTransparentProxy*) this;
+ this = tp->rp->unwrapped_server;
+ g_assert (this);
+ k = this->vtable->klass;
+ }
+
+ name = mono_array_get (params, MonoString *, 1);
str = mono_string_to_utf8 (name);
- for (i = 0; i < k->field.count; i++) {
- if (!strcmp (k->fields [i].name, str)) {
- MonoClass *field_klass = mono_class_from_mono_type (k->fields [i].type);
- if (field_klass->valuetype)
- result = mono_value_box (domain, field_klass,
- (char *)this + k->fields [i].offset);
- else
- result = *((gpointer *)((char *)this + k->fields [i].offset));
-
- g_assert (result);
- out_args = mono_array_new (domain, mono_defaults.object_class, 1);
- *outArgs = out_args;
- mono_array_set (out_args, gpointer, 0, result);
- g_free (str);
- return NULL;
+ do {
+ for (i = 0; i < k->field.count; i++) {
+ if (!strcmp (k->fields [i].name, str)) {
+ MonoClass *field_klass = mono_class_from_mono_type (k->fields [i].type);
+ if (field_klass->valuetype)
+ result = mono_value_box (domain, field_klass,
+ (char *)this + k->fields [i].offset);
+ else
+ result = *((gpointer *)((char *)this + k->fields [i].offset));
+
+ g_assert (result);
+ out_args = mono_array_new (domain, mono_defaults.object_class, 1);
+ *outArgs = out_args;
+ mono_array_set (out_args, gpointer, 0, result);
+ g_free (str);
+ return NULL;
+ }
}
- }
+ k = k->parent;
+ }
+ while (k != NULL);
g_free (str);
g_assert_not_reached ();
} else if (!strcmp (m->name, "FieldSetter")) {
MonoClass *k = this->vtable->klass;
- MonoString *name = mono_array_get (params, MonoString *, 1);
+ MonoString *name;
int size, align;
char *str;
-
+
+ /* If this is a proxy, then it must be a CBO */
+ if (k == mono_defaults.transparent_proxy_class) {
+ MonoTransparentProxy *tp = (MonoTransparentProxy*) this;
+ this = tp->rp->unwrapped_server;
+ g_assert (this);
+ k = this->vtable->klass;
+ }
+
+ name = mono_array_get (params, MonoString *, 1);
str = mono_string_to_utf8 (name);
- for (i = 0; i < k->field.count; i++) {
- if (!strcmp (k->fields [i].name, str)) {
- MonoClass *field_klass = mono_class_from_mono_type (k->fields [i].type);
- MonoObject *val = mono_array_get (params, gpointer, 2);
-
- if (field_klass->valuetype) {
- size = mono_type_size (k->fields [i].type, &align);
- memcpy ((char *)this + k->fields [i].offset,
- ((char *)val) + sizeof (MonoObject), size);
- } else
- *((gpointer *)this + k->fields [i].offset) = val;
-
- g_assert (result);
- g_free (str);
- return NULL;
+ do {
+ for (i = 0; i < k->field.count; i++) {
+ if (!strcmp (k->fields [i].name, str)) {
+ MonoClass *field_klass = mono_class_from_mono_type (k->fields [i].type);
+ MonoObject *val = mono_array_get (params, gpointer, 2);
+
+ if (field_klass->valuetype) {
+ size = mono_type_size (k->fields [i].type, &align);
+ memcpy ((char *)this + k->fields [i].offset,
+ ((char *)val) + sizeof (MonoObject), size);
+ } else
+ *(MonoObject**)((char *)this + k->fields [i].offset) = val;
+
+ out_args = mono_array_new (domain, mono_defaults.object_class, 0);
+ *outArgs = out_args;
+
+ g_free (str);
+ return NULL;
+ }
}
- }
+ k = k->parent;
+ }
+ while (k != NULL);
g_free (str);
g_assert_not_reached ();
@@ -1029,6 +2472,14 @@ ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this, MonoA
out_args = mono_array_new (domain, mono_defaults.object_class, outarg_count);
+ /* handle constructors only for objects already allocated */
+ if (!strcmp (method->method->name, ".ctor"))
+ g_assert (this);
+
+ /* This can be called only on MBR objects, so no need to unbox for valuetypes. */
+ g_assert (!method->method->klass->valuetype);
+ result = mono_runtime_invoke_array (method->method, this, params, NULL);
+
for (i = 0, j = 0; i < mono_array_length (params); i++) {
if (sig->params [i]->byref) {
gpointer arg;
@@ -1038,12 +2489,6 @@ ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this, MonoA
}
}
- /* fixme: handle constructors? */
- if (!strcmp (method->method->name, ".ctor"))
- g_assert_not_reached ();
-
- result = mono_runtime_invoke_array (method->method, this, params, NULL);
-
*outArgs = out_args;
return result;
@@ -1052,14 +2497,17 @@ ves_icall_InternalExecute (MonoReflectionMethod *method, MonoObject *this, MonoA
static MonoObject *
ves_icall_System_Enum_ToObject (MonoReflectionType *type, MonoObject *obj)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain;
MonoClass *enumc, *objc;
gint32 s1, s2;
MonoObject *res;
+ MONO_ARCH_SAVE_REGS;
+
MONO_CHECK_ARG_NULL (type);
MONO_CHECK_ARG_NULL (obj);
+ domain = mono_object_domain (type);
enumc = mono_class_from_mono_type (type->type);
objc = obj->vtable->klass;
@@ -1085,20 +2533,21 @@ ves_icall_System_Enum_ToObject (MonoReflectionType *type, MonoObject *obj)
static MonoObject *
ves_icall_System_Enum_get_value (MonoObject *this)
{
- MonoDomain *domain = mono_domain_get ();
MonoObject *res;
MonoClass *enumc;
gpointer dst;
gpointer src;
int size;
+ MONO_ARCH_SAVE_REGS;
+
if (!this)
return NULL;
g_assert (this->vtable->klass->enumtype);
enumc = mono_class_from_mono_type (this->vtable->klass->enum_basetype);
- res = mono_object_new (domain, enumc);
+ res = mono_object_new (mono_object_domain (this), enumc);
dst = (char *)res + sizeof (MonoObject);
src = (char *)this + sizeof (MonoObject);
size = mono_class_value_size (enumc, NULL);
@@ -1111,44 +2560,56 @@ ves_icall_System_Enum_get_value (MonoObject *this)
static void
ves_icall_get_enum_info (MonoReflectionType *type, MonoEnumInfo *info)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_object_domain (type);
MonoClass *enumc = mono_class_from_mono_type (type->type);
guint i, j, nvalues, crow;
MonoClassField *field;
-
+
+ MONO_ARCH_SAVE_REGS;
+
info->utype = mono_type_get_object (domain, enumc->enum_basetype);
- nvalues = enumc->field.count - 1;
+ nvalues = enumc->field.count ? enumc->field.count - 1 : 0;
info->names = mono_array_new (domain, mono_defaults.string_class, nvalues);
info->values = mono_array_new (domain, enumc, nvalues);
+ crow = -1;
for (i = 0, j = 0; i < enumc->field.count; ++i) {
+ const char *p;
+ int len;
+
field = &enumc->fields [i];
if (strcmp ("value__", field->name) == 0)
continue;
+ if (mono_field_is_deleted (field))
+ continue;
mono_array_set (info->names, gpointer, j, mono_string_new (domain, field->name));
+
if (!field->data) {
- crow = mono_metadata_get_constant_index (enumc->image, MONO_TOKEN_FIELD_DEF | (i+enumc->field.first+1));
+ crow = mono_metadata_get_constant_index (enumc->image, MONO_TOKEN_FIELD_DEF | (i+enumc->field.first+1), crow + 1);
+ field->def_type = mono_metadata_decode_row_col (&enumc->image->tables [MONO_TABLE_CONSTANT], crow-1, MONO_CONSTANT_TYPE);
crow = mono_metadata_decode_row_col (&enumc->image->tables [MONO_TABLE_CONSTANT], crow-1, MONO_CONSTANT_VALUE);
- /* 1 is the length of the blob */
- field->data = 1 + mono_metadata_blob_heap (enumc->image, crow);
+ field->data = (gpointer)mono_metadata_blob_heap (enumc->image, crow);
}
+
+ p = field->data;
+ len = mono_metadata_decode_blob_size (p, &p);
switch (enumc->enum_basetype->type) {
case MONO_TYPE_U1:
case MONO_TYPE_I1:
- mono_array_set (info->values, gchar, j, *field->data);
+ mono_array_set (info->values, gchar, j, *p);
break;
case MONO_TYPE_CHAR:
case MONO_TYPE_U2:
case MONO_TYPE_I2:
- mono_array_set (info->values, gint16, j, read16 (field->data));
+ mono_array_set (info->values, gint16, j, read16 (p));
break;
case MONO_TYPE_U4:
case MONO_TYPE_I4:
- mono_array_set (info->values, gint32, j, read32 (field->data));
+ mono_array_set (info->values, gint32, j, read32 (p));
break;
case MONO_TYPE_U8:
case MONO_TYPE_I8:
- mono_array_set (info->values, gint64, j, read64 (field->data));
+ mono_array_set (info->values, gint64, j, read64 (p));
break;
default:
g_error ("Implement type 0x%02x in get_enum_info", enumc->enum_basetype->type);
@@ -1157,93 +2618,6 @@ ves_icall_get_enum_info (MonoReflectionType *type, MonoEnumInfo *info)
}
}
-static MonoMethod*
-search_method (MonoReflectionType *type, const char *name, guint32 flags, MonoArray *args)
-{
- MonoClass *klass, *start_class;
- MonoMethod *m;
- MonoReflectionType *paramt;
- int i, j;
-
- start_class = klass = mono_class_from_mono_type (type->type);
- while (klass) {
- for (i = 0; i < klass->method.count; ++i) {
- m = klass->methods [i];
- if (!((m->flags & flags) == flags))
- continue;
- if (strcmp(m->name, name))
- continue;
- if (m->signature->param_count != mono_array_length (args))
- continue;
- for (j = 0; j < m->signature->param_count; ++j) {
- paramt = mono_array_get (args, MonoReflectionType*, j);
- if (!mono_metadata_type_equal (paramt->type, m->signature->params [j]))
- break;
- }
- if (j == m->signature->param_count)
- return m;
- }
- klass = klass->parent;
- }
- g_print ("Method %s.%s::%s (%d) not found\n", start_class->name_space, start_class->name, name, mono_array_length (args));
- return NULL;
-}
-
-static MonoReflectionMethod*
-ves_icall_get_constructor (MonoReflectionType *type, MonoArray *args)
-{
- MonoDomain *domain = mono_domain_get ();
- MonoMethod *m;
-
- m = search_method (type, ".ctor", METHOD_ATTRIBUTE_RT_SPECIAL_NAME, args);
- if (m)
- return mono_method_get_object (domain, m);
- return NULL;
-}
-
-static MonoReflectionMethod*
-ves_icall_get_method (MonoReflectionType *type, MonoString *name, MonoArray *args)
-{
- MonoDomain *domain = mono_domain_get ();
- MonoMethod *m;
- char *n = mono_string_to_utf8 (name);
-
- m = search_method (type, n, 0, args);
- g_free (n);
- if (m)
- return mono_method_get_object (domain, m);
- return NULL;
-}
-
-static MonoProperty*
-search_property (MonoClass *klass, char* name, MonoArray *args) {
- int i;
- MonoProperty *p;
-
- /* FIXME: handle args */
- for (i = 0; i < klass->property.count; ++i) {
- p = &klass->properties [i];
- if (strcmp (p->name, name) == 0)
- return p;
- }
- return NULL;
-}
-
-static MonoReflectionProperty*
-ves_icall_get_property (MonoReflectionType *type, MonoString *name, MonoArray *args)
-{
- MonoDomain *domain = mono_domain_get ();
- MonoProperty *p;
- MonoClass *class = mono_class_from_mono_type (type->type);
- char *n = mono_string_to_utf8 (name);
-
- p = search_property (class, n, args);
- g_free (n);
- if (p)
- return mono_property_get_object (domain, class, p);
- return NULL;
-}
-
enum {
BFLAGS_IgnoreCase = 1,
BFLAGS_DeclaredOnly = 2,
@@ -1251,6 +2625,7 @@ enum {
BFLAGS_Static = 8,
BFLAGS_Public = 0x10,
BFLAGS_NonPublic = 0x20,
+ BFLAGS_FlattenHierarchy = 0x40,
BFLAGS_InvokeMethod = 0x100,
BFLAGS_CreateInstance = 0x200,
BFLAGS_GetField = 0x400,
@@ -1262,7 +2637,7 @@ enum {
BFLAGS_OptionalParamBinding = 0x40000
};
-static MonoFieldInfo *
+static MonoReflectionField *
ves_icall_Type_GetField (MonoReflectionType *type, MonoString *name, guint32 bflags)
{
MonoDomain *domain;
@@ -1273,13 +2648,17 @@ ves_icall_Type_GetField (MonoReflectionType *type, MonoString *name, guint32 bfl
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
+ MONO_ARCH_SAVE_REGS;
+
if (!name)
- return NULL;
+ mono_raise_exception (mono_get_exception_argument_null ("name"));
handle_parent:
for (i = 0; i < klass->field.count; ++i) {
match = 0;
field = &klass->fields [i];
+ if (mono_field_is_deleted (field))
+ continue;
if ((field->type->attrs & FIELD_ATTRIBUTE_FIELD_ACCESS_MASK) == FIELD_ATTRIBUTE_PUBLIC) {
if (bflags & BFLAGS_Public)
match++;
@@ -1292,7 +2671,8 @@ handle_parent:
match = 0;
if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
if (bflags & BFLAGS_Static)
- match++;
+ if ((bflags & BFLAGS_FlattenHierarchy) || (klass == startklass))
+ match++;
} else {
if (bflags & BFLAGS_Instance)
match++;
@@ -1309,7 +2689,7 @@ handle_parent:
}
g_free (utf8_name);
- return mono_field_get_object (domain, klass, field);
+ return mono_field_get_object (domain, startklass, field);
}
if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
goto handle_parent;
@@ -1318,23 +2698,28 @@ handle_parent:
}
static MonoArray*
-ves_icall_Type_GetFields (MonoReflectionType *type, guint32 bflags)
+ves_icall_Type_GetFields_internal (MonoReflectionType *type, guint32 bflags, MonoReflectionType *reftype)
{
MonoDomain *domain;
GSList *l = NULL, *tmp;
- MonoClass *startklass, *klass;
+ MonoClass *startklass, *klass, *refklass;
MonoArray *res;
MonoObject *member;
int i, len, match;
MonoClassField *field;
+ MONO_ARCH_SAVE_REGS;
+
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
+ refklass = mono_class_from_mono_type (reftype->type);
handle_parent:
for (i = 0; i < klass->field.count; ++i) {
match = 0;
field = &klass->fields [i];
+ if (mono_field_is_deleted (field))
+ continue;
if ((field->type->attrs & FIELD_ATTRIBUTE_FIELD_ACCESS_MASK) == FIELD_ATTRIBUTE_PUBLIC) {
if (bflags & BFLAGS_Public)
match++;
@@ -1347,7 +2732,8 @@ handle_parent:
match = 0;
if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
if (bflags & BFLAGS_Static)
- match++;
+ if ((bflags & BFLAGS_FlattenHierarchy) || (klass == startklass))
+ match++;
} else {
if (bflags & BFLAGS_Instance)
match++;
@@ -1355,7 +2741,7 @@ handle_parent:
if (!match)
continue;
- member = (MonoObject*)mono_field_get_object (domain, klass, field);
+ member = (MonoObject*)mono_field_get_object (domain, refklass, field);
l = g_slist_prepend (l, member);
}
if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
@@ -1363,7 +2749,7 @@ handle_parent:
len = g_slist_length (l);
res = mono_array_new (domain, mono_defaults.field_info_class, len);
i = 0;
- tmp = g_slist_reverse (l);
+ tmp = l = g_slist_reverse (l);
for (; tmp; tmp = tmp->next, ++i)
mono_array_set (res, gpointer, i, tmp->data);
g_slist_free (l);
@@ -1371,19 +2757,29 @@ handle_parent:
}
static MonoArray*
-ves_icall_Type_GetMethods (MonoReflectionType *type, guint32 bflags)
+ves_icall_Type_GetMethodsByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
{
MonoDomain *domain;
GSList *l = NULL, *tmp;
- static MonoClass *System_Reflection_MethodInfo;
- MonoClass *startklass, *klass;
+ MonoClass *startklass, *klass, *refklass;
MonoArray *res;
MonoMethod *method;
MonoObject *member;
int i, len, match;
+ GHashTable *method_slots = g_hash_table_new (NULL, NULL);
+ gchar *mname = NULL;
+ int (*compare_func) (const char *s1, const char *s2) = NULL;
+ MONO_ARCH_SAVE_REGS;
+
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
+ refklass = mono_class_from_mono_type (reftype->type);
+ len = 0;
+ if (name != NULL) {
+ mname = mono_string_to_utf8 (name);
+ compare_func = (ignore_case) ? g_strcasecmp : strcmp;
+ }
handle_parent:
for (i = 0; i < klass->method.count; ++i) {
@@ -1403,7 +2799,8 @@ handle_parent:
match = 0;
if (method->flags & METHOD_ATTRIBUTE_STATIC) {
if (bflags & BFLAGS_Static)
- match++;
+ if ((bflags & BFLAGS_FlattenHierarchy) || (klass == startklass))
+ match++;
} else {
if (bflags & BFLAGS_Instance)
match++;
@@ -1411,43 +2808,58 @@ handle_parent:
if (!match)
continue;
+
+ if (name != NULL) {
+ if (compare_func (mname, method->name))
+ continue;
+ }
+
match = 0;
- member = (MonoObject*)mono_method_get_object (domain, method);
-
+ if (method->slot != -1) {
+ if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
+ continue;
+ g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), method);
+ }
+
+ member = (MonoObject*)mono_method_get_object (domain, method, refklass);
+
l = g_slist_prepend (l, member);
+ len++;
}
if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
goto handle_parent;
- len = g_slist_length (l);
- if (!System_Reflection_MethodInfo)
- System_Reflection_MethodInfo = mono_class_from_name (
- mono_defaults.corlib, "System.Reflection", "MethodInfo");
- res = mono_array_new (domain, System_Reflection_MethodInfo, len);
+
+ g_free (mname);
+ res = mono_array_new (domain, mono_defaults.method_info_class, len);
i = 0;
- tmp = l;
+
+ tmp = l = g_slist_reverse (l);
+
for (; tmp; tmp = tmp->next, ++i)
mono_array_set (res, gpointer, i, tmp->data);
g_slist_free (l);
-
+ g_hash_table_destroy (method_slots);
return res;
}
static MonoArray*
-ves_icall_Type_GetConstructors (MonoReflectionType *type, guint32 bflags)
+ves_icall_Type_GetConstructors_internal (MonoReflectionType *type, guint32 bflags, MonoReflectionType *reftype)
{
MonoDomain *domain;
GSList *l = NULL, *tmp;
static MonoClass *System_Reflection_ConstructorInfo;
- MonoClass *startklass, *klass;
+ MonoClass *startklass, *klass, *refklass;
MonoArray *res;
MonoMethod *method;
MonoObject *member;
int i, len, match;
+ MONO_ARCH_SAVE_REGS;
+
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
+ refklass = mono_class_from_mono_type (reftype->type);
-handle_parent:
for (i = 0; i < klass->method.count; ++i) {
match = 0;
method = klass->methods [i];
@@ -1465,7 +2877,8 @@ handle_parent:
match = 0;
if (method->flags & METHOD_ATTRIBUTE_STATIC) {
if (bflags & BFLAGS_Static)
- match++;
+ if ((bflags & BFLAGS_FlattenHierarchy) || (klass == startklass))
+ match++;
} else {
if (bflags & BFLAGS_Instance)
match++;
@@ -1473,19 +2886,17 @@ handle_parent:
if (!match)
continue;
- member = (MonoObject*)mono_method_get_object (domain, method);
+ member = (MonoObject*)mono_method_get_object (domain, method, refklass);
l = g_slist_prepend (l, member);
}
- if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
- goto handle_parent;
len = g_slist_length (l);
if (!System_Reflection_ConstructorInfo)
System_Reflection_ConstructorInfo = mono_class_from_name (
mono_defaults.corlib, "System.Reflection", "ConstructorInfo");
res = mono_array_new (domain, System_Reflection_ConstructorInfo, len);
i = 0;
- tmp = g_slist_reverse (l);
+ tmp = l = g_slist_reverse (l);
for (; tmp; tmp = tmp->next, ++i)
mono_array_set (res, gpointer, i, tmp->data);
g_slist_free (l);
@@ -1493,7 +2904,7 @@ handle_parent:
}
static MonoArray*
-ves_icall_Type_GetProperties (MonoReflectionType *type, guint32 bflags)
+ves_icall_Type_GetPropertiesByName (MonoReflectionType *type, MonoString *name, guint32 bflags, MonoBoolean ignore_case, MonoReflectionType *reftype)
{
MonoDomain *domain;
GSList *l = NULL, *tmp;
@@ -1502,10 +2913,21 @@ ves_icall_Type_GetProperties (MonoReflectionType *type, guint32 bflags)
MonoArray *res;
MonoMethod *method;
MonoProperty *prop;
- int i, len, match;
+ int i, match;
+ int len = 0;
+ guint32 flags;
+ GHashTable *method_slots = g_hash_table_new (NULL, NULL);
+ gchar *propname = NULL;
+ int (*compare_func) (const char *s1, const char *s2) = NULL;
+
+ MONO_ARCH_SAVE_REGS;
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
+ if (name != NULL) {
+ propname = mono_string_to_utf8 (name);
+ compare_func = (ignore_case) ? g_strcasecmp : strcmp;
+ }
handle_parent:
for (i = 0; i < klass->property.count; ++i) {
@@ -1514,7 +2936,11 @@ handle_parent:
method = prop->get;
if (!method)
method = prop->set;
- if ((method->flags & METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == METHOD_ATTRIBUTE_PUBLIC) {
+ if (method)
+ flags = method->flags;
+ else
+ flags = 0;
+ if ((flags & METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == METHOD_ATTRIBUTE_PUBLIC) {
if (bflags & BFLAGS_Public)
match++;
} else {
@@ -1524,9 +2950,10 @@ handle_parent:
if (!match)
continue;
match = 0;
- if (method->flags & METHOD_ATTRIBUTE_STATIC) {
+ if (flags & METHOD_ATTRIBUTE_STATIC) {
if (bflags & BFLAGS_Static)
- match++;
+ if ((bflags & BFLAGS_FlattenHierarchy) || (klass == startklass))
+ match++;
} else {
if (bflags & BFLAGS_Instance)
match++;
@@ -1535,25 +2962,98 @@ handle_parent:
if (!match)
continue;
match = 0;
- l = g_slist_prepend (l, mono_property_get_object (domain, klass, prop));
+
+ if (name != NULL) {
+ if (compare_func (propname, prop->name))
+ continue;
+ }
+
+ if (prop->get && prop->get->slot != -1) {
+ if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (prop->get->slot)))
+ continue;
+ g_hash_table_insert (method_slots, GUINT_TO_POINTER (prop->get->slot), prop);
+ }
+ if (prop->set && prop->set->slot != -1) {
+ if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (prop->set->slot)))
+ continue;
+ g_hash_table_insert (method_slots, GUINT_TO_POINTER (prop->set->slot), prop);
+ }
+
+ l = g_slist_prepend (l, mono_property_get_object (domain, startklass, prop));
+ len++;
}
- if (!l && (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent)))
+ if ((!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent)))
goto handle_parent;
- len = g_slist_length (l);
+
+ g_free (propname);
if (!System_Reflection_PropertyInfo)
System_Reflection_PropertyInfo = mono_class_from_name (
mono_defaults.corlib, "System.Reflection", "PropertyInfo");
res = mono_array_new (domain, System_Reflection_PropertyInfo, len);
i = 0;
- tmp = l;
+
+ tmp = l = g_slist_reverse (l);
+
for (; tmp; tmp = tmp->next, ++i)
mono_array_set (res, gpointer, i, tmp->data);
g_slist_free (l);
+ g_hash_table_destroy (method_slots);
return res;
}
+static MonoReflectionEvent *
+ves_icall_MonoType_GetEvent (MonoReflectionType *type, MonoString *name, guint32 bflags)
+{
+ MonoDomain *domain;
+ MonoClass *klass, *startklass;
+ gint i;
+ MonoEvent *event;
+ MonoMethod *method;
+ gchar *event_name;
+
+ MONO_ARCH_SAVE_REGS;
+
+ event_name = mono_string_to_utf8 (name);
+ klass = startklass = mono_class_from_mono_type (type->type);
+ domain = mono_object_domain (type);
+
+handle_parent:
+ for (i = 0; i < klass->event.count; i++) {
+ event = &klass->events [i];
+ if (strcmp (event->name, event_name))
+ continue;
+
+ method = event->add;
+ if (!method)
+ method = event->remove;
+ if (!method)
+ method = event->raise;
+ if (method) {
+ if ((method->flags & METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == METHOD_ATTRIBUTE_PUBLIC) {
+ if (!(bflags & BFLAGS_Public))
+ continue;
+ } else {
+ if (!(bflags & BFLAGS_NonPublic))
+ continue;
+ }
+ }
+ else
+ if (!(bflags & BFLAGS_NonPublic))
+ continue;
+
+ g_free (event_name);
+ return mono_event_get_object (domain, startklass, event);
+ }
+
+ if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
+ goto handle_parent;
+
+ g_free (event_name);
+ return NULL;
+}
+
static MonoArray*
-ves_icall_Type_GetEvents (MonoReflectionType *type, guint32 bflags)
+ves_icall_Type_GetEvents_internal (MonoReflectionType *type, guint32 bflags, MonoReflectionType *reftype)
{
MonoDomain *domain;
GSList *l = NULL, *tmp;
@@ -1564,6 +3064,8 @@ ves_icall_Type_GetEvents (MonoReflectionType *type, guint32 bflags)
MonoEvent *event;
int i, len, match;
+ MONO_ARCH_SAVE_REGS;
+
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
@@ -1574,24 +3076,36 @@ handle_parent:
method = event->add;
if (!method)
method = event->remove;
- if ((method->flags & METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == METHOD_ATTRIBUTE_PUBLIC) {
- if (bflags & BFLAGS_Public)
- match++;
- } else {
- if (bflags & BFLAGS_NonPublic)
- match++;
+ if (!method)
+ method = event->raise;
+ if (method) {
+ if ((method->flags & METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK) == METHOD_ATTRIBUTE_PUBLIC) {
+ if (bflags & BFLAGS_Public)
+ match++;
+ } else {
+ if (bflags & BFLAGS_NonPublic)
+ match++;
+ }
}
+ else
+ if (bflags & BFLAGS_NonPublic)
+ match ++;
if (!match)
continue;
match = 0;
- if (method->flags & METHOD_ATTRIBUTE_STATIC) {
- if (bflags & BFLAGS_Static)
- match++;
- } else {
- if (bflags & BFLAGS_Instance)
- match++;
+ if (method) {
+ if (method->flags & METHOD_ATTRIBUTE_STATIC) {
+ if (bflags & BFLAGS_Static)
+ if ((bflags & BFLAGS_FlattenHierarchy) || (klass == startklass))
+ match++;
+ } else {
+ if (bflags & BFLAGS_Instance)
+ match++;
+ }
}
-
+ else
+ if (bflags & BFLAGS_Instance)
+ match ++;
if (!match)
continue;
match = 0;
@@ -1605,13 +3119,54 @@ handle_parent:
mono_defaults.corlib, "System.Reflection", "EventInfo");
res = mono_array_new (domain, System_Reflection_EventInfo, len);
i = 0;
- tmp = l;
+
+ tmp = l = g_slist_reverse (l);
+
for (; tmp; tmp = tmp->next, ++i)
mono_array_set (res, gpointer, i, tmp->data);
g_slist_free (l);
return res;
}
+static MonoReflectionType *
+ves_icall_Type_GetNestedType (MonoReflectionType *type, MonoString *name, guint32 bflags)
+{
+ MonoDomain *domain;
+ MonoClass *startklass, *klass;
+ MonoClass *nested;
+ GList *tmpn;
+ char *str;
+
+ MONO_ARCH_SAVE_REGS;
+
+ domain = ((MonoObject *)type)->vtable->domain;
+ klass = startklass = mono_class_from_mono_type (type->type);
+ str = mono_string_to_utf8 (name);
+
+ handle_parent:
+ for (tmpn = klass->nested_classes; tmpn; tmpn = tmpn->next) {
+ int match = 0;
+ nested = tmpn->data;
+ if ((nested->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK) == TYPE_ATTRIBUTE_NESTED_PUBLIC) {
+ if (bflags & BFLAGS_Public)
+ match++;
+ } else {
+ if (bflags & BFLAGS_NonPublic)
+ match++;
+ }
+ if (!match)
+ continue;
+ if (strcmp (nested->name, str) == 0){
+ g_free (str);
+ return mono_type_get_object (domain, &nested->byval_arg);
+ }
+ }
+ if (!(bflags & BFLAGS_DeclaredOnly) && (klass = klass->parent))
+ goto handle_parent;
+ g_free (str);
+ return NULL;
+}
+
static MonoArray*
ves_icall_Type_GetNestedTypes (MonoReflectionType *type, guint32 bflags)
{
@@ -1624,6 +3179,8 @@ ves_icall_Type_GetNestedTypes (MonoReflectionType *type, guint32 bflags)
int i, len, match;
MonoClass *nested;
+ MONO_ARCH_SAVE_REGS;
+
domain = ((MonoObject *)type)->vtable->domain;
klass = startklass = mono_class_from_mono_type (type->type);
@@ -1645,194 +3202,664 @@ ves_icall_Type_GetNestedTypes (MonoReflectionType *type, guint32 bflags)
len = g_slist_length (l);
res = mono_array_new (domain, mono_defaults.monotype_class, len);
i = 0;
- tmp = g_slist_reverse (l);
+ tmp = l = g_slist_reverse (l);
for (; tmp; tmp = tmp->next, ++i)
mono_array_set (res, gpointer, i, tmp->data);
g_slist_free (l);
return res;
}
-static void
-ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (MonoArray *src, gint32 start_index,
- gpointer dest, gint32 length)
+static MonoReflectionType*
+ves_icall_System_Reflection_Assembly_InternalGetType (MonoReflectionAssembly *assembly, MonoReflectionModule *module, MonoString *name, MonoBoolean throwOnError, MonoBoolean ignoreCase)
{
- int element_size;
- void *source_addr;
+ gchar *str;
+ MonoType *type = NULL;
+ MonoTypeNameParse info;
+ gboolean type_resolve = FALSE;
- MONO_CHECK_ARG_NULL (src);
- MONO_CHECK_ARG_NULL (dest);
+ MONO_ARCH_SAVE_REGS;
- g_assert (src->obj.vtable->klass->rank == 1);
- g_assert (start_index >= 0 && start_index < mono_array_length (src));
- g_assert (start_index + length <= mono_array_length (src));
+ str = mono_string_to_utf8 (name);
+ /*g_print ("requested type %s in %s\n", str, assembly->assembly->aname.name);*/
+ if (!mono_reflection_parse_type (str, &info)) {
+ g_free (str);
+ g_list_free (info.modifiers);
+ g_list_free (info.nested);
+ if (throwOnError) /* uhm: this is a parse error, though... */
+ mono_raise_exception (mono_get_exception_type_load (name));
+ /*g_print ("failed parse\n");*/
+ return NULL;
+ }
- element_size = mono_array_element_size (src->obj.vtable->klass);
-
- source_addr = mono_array_addr_with_size (src, element_size, start_index);
+ if (module != NULL) {
+ if (module->image)
+ type = mono_reflection_get_type (module->image, &info, ignoreCase, &type_resolve);
+ else
+ type = NULL;
+ }
+ else
+ if (assembly->assembly->dynamic) {
+ /* Enumerate all modules */
+ MonoReflectionAssemblyBuilder *abuilder = (MonoReflectionAssemblyBuilder*)assembly;
+ int i;
+
+ type = NULL;
+ if (abuilder->modules) {
+ for (i = 0; i < mono_array_length (abuilder->modules); ++i) {
+ MonoReflectionModuleBuilder *mb = mono_array_get (abuilder->modules, MonoReflectionModuleBuilder*, i);
+ type = mono_reflection_get_type (&mb->dynamic_image->image, &info, ignoreCase, &type_resolve);
+ if (type)
+ break;
+ }
+ }
+
+ if (!type && abuilder->loaded_modules) {
+ for (i = 0; i < mono_array_length (abuilder->loaded_modules); ++i) {
+ MonoReflectionModule *mod = mono_array_get (abuilder->loaded_modules, MonoReflectionModule*, i);
+ type = mono_reflection_get_type (mod->image, &info, ignoreCase, &type_resolve);
+ if (type)
+ break;
+ }
+ }
+ }
+ else
+ type = mono_reflection_get_type (assembly->assembly->image, &info, ignoreCase, &type_resolve);
+ g_free (str);
+ g_list_free (info.modifiers);
+ g_list_free (info.nested);
+ if (!type) {
+ if (throwOnError)
+ mono_raise_exception (mono_get_exception_type_load (name));
+ /* g_print ("failed find\n"); */
+ return NULL;
+ }
+ /* g_print ("got it\n"); */
+ return mono_type_get_object (mono_object_domain (assembly), type);
- memcpy (dest, source_addr, length * element_size);
}
-static void
-ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (gpointer src, gint32 start_index,
- MonoArray *dest, gint32 length)
+static MonoString *
+ves_icall_System_Reflection_Assembly_get_code_base (MonoReflectionAssembly *assembly)
{
- int element_size;
- void *dest_addr;
+ MonoDomain *domain = mono_object_domain (assembly);
+ MonoAssembly *mass = assembly->assembly;
+ MonoString *res;
+ gchar *uri;
+ gchar *absolute;
+
+ MONO_ARCH_SAVE_REGS;
- MONO_CHECK_ARG_NULL (src);
- MONO_CHECK_ARG_NULL (dest);
+ absolute = g_build_filename (mass->basedir, mass->image->module_name, NULL);
+ uri = g_filename_to_uri (absolute, NULL, NULL);
+ res = mono_string_new (domain, uri);
+ g_free (uri);
+ g_free (absolute);
+ return res;
+}
- g_assert (dest->obj.vtable->klass->rank == 1);
- g_assert (start_index >= 0 && start_index < mono_array_length (dest));
- g_assert (start_index + length <= mono_array_length (dest));
+static MonoBoolean
+ves_icall_System_Reflection_Assembly_get_global_assembly_cache (MonoReflectionAssembly *assembly)
+{
+ MonoAssembly *mass = assembly->assembly;
- element_size = mono_array_element_size (dest->obj.vtable->klass);
-
- dest_addr = mono_array_addr_with_size (dest, element_size, start_index);
+ MONO_ARCH_SAVE_REGS;
- memcpy (dest_addr, src, length * element_size);
+ return mass->in_gac;
}
-static gpointer
-ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr (gpointer ptr, gint32 offset)
+static MonoReflectionAssembly*
+ves_icall_System_Reflection_Assembly_load_with_partial_name (MonoString *mname, MonoObject *evidence)
{
- char *p = ptr;
- return *(gpointer*)(p + offset);
+ gchar *name;
+ MonoAssembly *res;
+ MonoImageOpenStatus status;
+
+ MONO_ARCH_SAVE_REGS;
+
+ name = mono_string_to_utf8 (mname);
+ res = mono_assembly_load_with_partial_name (name, &status);
+
+ g_free (name);
+
+ if (res == NULL)
+ return NULL;
+ return mono_assembly_get_object (mono_domain_get (), res);
}
-static unsigned char
-ves_icall_System_Runtime_InteropServices_Marshal_ReadByte (gpointer ptr, gint32 offset)
+static MonoString *
+ves_icall_System_Reflection_Assembly_get_location (MonoReflectionAssembly *assembly)
{
- char *p = ptr;
- return *(unsigned char*)(p + offset);
+ MonoDomain *domain = mono_object_domain (assembly);
+ MonoString *res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ res = mono_string_new (domain, mono_image_get_filename (assembly->assembly->image));
+
+ return res;
}
-static gint16
-ves_icall_System_Runtime_InteropServices_Marshal_ReadInt16 (gpointer ptr, gint32 offset)
+static MonoString *
+ves_icall_System_Reflection_Assembly_InternalImageRuntimeVersion (MonoReflectionAssembly *assembly)
{
- char *p = ptr;
- return *(gint16*)(p + offset);
+ MonoDomain *domain = mono_object_domain (assembly);
+
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_string_new (domain, assembly->assembly->image->version);
}
-static gint32
-ves_icall_System_Runtime_InteropServices_Marshal_ReadInt32 (gpointer ptr, gint32 offset)
+static MonoReflectionMethod*
+ves_icall_System_Reflection_Assembly_get_EntryPoint (MonoReflectionAssembly *assembly)
{
- char *p = ptr;
- return *(gint32*)(p + offset);
+ guint32 token = mono_image_get_entry_point (assembly->assembly->image);
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!token)
+ return NULL;
+ return mono_method_get_object (mono_object_domain (assembly), mono_get_method (assembly->assembly->image, token, NULL), NULL);
}
-static gint64
-ves_icall_System_Runtime_InteropServices_Marshal_ReadInt64 (gpointer ptr, gint32 offset)
+static MonoReflectionModule*
+ves_icall_System_Reflection_Assembly_get_ManifestModule (MonoReflectionAssembly *assembly)
{
- char *p = ptr;
- return *(gint64*)(p + offset);
+ return mono_module_get_object (mono_object_domain (assembly), assembly->assembly->image);
}
-static void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteByte (gpointer ptr, gint32 offset, unsigned char val)
+static MonoArray*
+ves_icall_System_Reflection_Assembly_GetManifestResourceNames (MonoReflectionAssembly *assembly)
{
- char *p = ptr;
- *(unsigned char*)(p + offset) = val;
+ MonoTableInfo *table = &assembly->assembly->image->tables [MONO_TABLE_MANIFESTRESOURCE];
+ MonoArray *result = mono_array_new (mono_object_domain (assembly), mono_defaults.string_class, table->rows);
+ int i;
+ const char *val;
+
+ MONO_ARCH_SAVE_REGS;
+
+ for (i = 0; i < table->rows; ++i) {
+ val = mono_metadata_string_heap (assembly->assembly->image, mono_metadata_decode_row_col (table, i, MONO_MANIFEST_NAME));
+ mono_array_set (result, gpointer, i, mono_string_new (mono_object_domain (assembly), val));
+ }
+ return result;
}
-static void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteIntPtr (gpointer ptr, gint32 offset, gpointer val)
+static MonoArray*
+ves_icall_System_Reflection_Assembly_GetReferencedAssemblies (MonoReflectionAssembly *assembly)
{
- char *p = ptr;
- *(gpointer*)(p + offset) = val;
+ static MonoClass *System_Reflection_AssemblyName;
+ MonoArray *result;
+ MonoDomain *domain = mono_object_domain (assembly);
+ int i, count = 0;
+ static MonoMethod *create_culture = NULL;
+ MonoTableInfo *t;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!System_Reflection_AssemblyName)
+ System_Reflection_AssemblyName = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "AssemblyName");
+
+ t = &assembly->assembly->image->tables [MONO_TABLE_ASSEMBLYREF];
+ count = t->rows;
+
+ result = mono_array_new (domain, System_Reflection_AssemblyName, count);
+
+ if (count > 0) {
+ MonoMethodDesc *desc = mono_method_desc_new (
+ "System.Globalization.CultureInfo:CreateSpecificCulture(string)", TRUE);
+ create_culture = mono_method_desc_search_in_image (desc, mono_defaults.corlib);
+ g_assert (create_culture);
+ mono_method_desc_free (desc);
+ }
+
+ for (i = 0; i < count; i++) {
+ MonoAssembly *assem;
+ MonoReflectionAssemblyName *aname;
+ char *codebase, *absolute;
+
+ /* FIXME: There is no need to load the assemblies themselves */
+ mono_assembly_load_reference (assembly->assembly->image, i);
+
+ assem = assembly->assembly->image->references [i];
+ if (assem == (gpointer)-1) {
+ char *msg = g_strdup_printf ("Assembly %d referenced from assembly %s not found ", i, assembly->assembly->image->name);
+ MonoException *ex = mono_get_exception_file_not_found2 (msg, NULL);
+ g_free (msg);
+ mono_raise_exception (ex);
+ }
+
+ aname = (MonoReflectionAssemblyName *) mono_object_new (
+ domain, System_Reflection_AssemblyName);
+
+ aname->name = mono_string_new (domain, assem->aname.name);
+
+ aname->major = assem->aname.major;
+ aname->minor = assem->aname.minor;
+ aname->build = assem->aname.build;
+ aname->revision = assem->aname.revision;
+ aname->revision = assem->aname.revision;
+ aname->hashalg = assem->aname.hash_alg;
+ aname->flags = assem->aname.flags;
+
+ if (create_culture) {
+ gpointer args [1];
+ args [0] = mono_string_new (domain, assem->aname.culture);
+ aname->cultureInfo = mono_runtime_invoke (create_culture, NULL, args, NULL);
+ }
+
+ if (assem->aname.public_key) {
+ guint32 pkey_len;
+ const char *pkey_ptr = assem->aname.public_key;
+ pkey_len = mono_metadata_decode_blob_size (pkey_ptr, &pkey_ptr);
+
+ aname->publicKey = mono_array_new (domain, mono_defaults.byte_class, pkey_len);
+ memcpy (mono_array_addr (aname->publicKey, guint8, 0), pkey_ptr, pkey_len);
+ }
+
+ /* public key token isn't copied - the class library will
+ automatically generate it from the public key if required */
+
+ absolute = g_build_filename (assem->basedir, assem->image->module_name, NULL);
+ codebase = g_filename_to_uri (absolute, NULL, NULL);
+ aname->codebase = mono_string_new (domain, codebase);
+ g_free (codebase);
+ g_free (absolute);
+ mono_array_set (result, gpointer, i, aname);
+ }
+ return result;
}
+typedef struct {
+ MonoArray *res;
+ int idx;
+} NameSpaceInfo;
+
static void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteInt16 (gpointer ptr, gint32 offset, gint16 val)
+foreach_namespace (const char* key, gconstpointer val, NameSpaceInfo *info)
{
- char *p = ptr;
- *(gint16*)(p + offset) = val;
+ MonoString *name = mono_string_new (mono_object_domain (info->res), key);
+
+ mono_array_set (info->res, gpointer, info->idx, name);
+ info->idx++;
}
-static void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteInt32 (gpointer ptr, gint32 offset, gint32 val)
+static MonoArray*
+ves_icall_System_Reflection_Assembly_GetNamespaces (MonoReflectionAssembly *assembly)
{
- char *p = ptr;
- *(gint32*)(p + offset) = val;
+ MonoImage *img = assembly->assembly->image;
+ int n;
+ MonoArray *res;
+ NameSpaceInfo info;
+ MonoTableInfo *t = &img->tables [MONO_TABLE_EXPORTEDTYPE];
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ n = g_hash_table_size (img->name_cache);
+ res = mono_array_new (mono_object_domain (assembly), mono_defaults.string_class, n);
+ info.res = res;
+ info.idx = 0;
+ g_hash_table_foreach (img->name_cache, (GHFunc)foreach_namespace, &info);
+
+ /* Add namespaces from the EXPORTEDTYPES table as well */
+ if (t->rows) {
+ MonoArray *res2;
+ GPtrArray *nspaces = g_ptr_array_new ();
+ for (i = 0; i < t->rows; ++i) {
+ const char *nspace = mono_metadata_string_heap (img, mono_metadata_decode_row_col (t, i, MONO_EXP_TYPE_NAMESPACE));
+ if (!g_hash_table_lookup (img->name_cache, nspace)) {
+ g_ptr_array_add (nspaces, (char*)nspace);
+ }
+ }
+ if (nspaces->len > 0) {
+ res2 = mono_array_new (mono_object_domain (assembly), mono_defaults.string_class, n + nspaces->len);
+ memcpy (mono_array_addr (res2, MonoString*, 0),
+ mono_array_addr (res, MonoString*, 0),
+ n * sizeof (MonoString*));
+ for (i = 0; i < nspaces->len; ++i)
+ mono_array_set (res2, MonoString*, n + i,
+ mono_string_new (mono_object_domain (assembly),
+ g_ptr_array_index (nspaces, i)));
+ res = res2;
+ }
+ g_ptr_array_free (nspaces, TRUE);
+ }
+
+ return res;
}
-static void
-ves_icall_System_Runtime_InteropServices_Marshal_WriteInt64 (gpointer ptr, gint32 offset, gint64 val)
+/* move this in some file in mono/util/ */
+static char *
+g_concat_dir_and_file (const char *dir, const char *file)
{
- char *p = ptr;
- *(gint64*)(p + offset) = val;
+ g_return_val_if_fail (dir != NULL, NULL);
+ g_return_val_if_fail (file != NULL, NULL);
+
+ /*
+ * If the directory name doesn't have a / on the end, we need
+ * to add one so we get a proper path to the file
+ */
+ if (dir [strlen(dir) - 1] != G_DIR_SEPARATOR)
+ return g_strconcat (dir, G_DIR_SEPARATOR_S, file, NULL);
+ else
+ return g_strconcat (dir, file, NULL);
}
-static MonoString*
-ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto (gpointer ptr)
+static void *
+ves_icall_System_Reflection_Assembly_GetManifestResourceInternal (MonoReflectionAssembly *assembly, MonoString *name, gint32 *size, MonoReflectionModule **ref_module)
{
- MonoDomain *domain = mono_domain_get ();
+ char *n = mono_string_to_utf8 (name);
+ MonoTableInfo *table = &assembly->assembly->image->tables [MONO_TABLE_MANIFESTRESOURCE];
+ guint32 i;
+ guint32 cols [MONO_MANIFEST_SIZE];
+ guint32 impl, file_idx;
+ const char *val;
+ MonoImage *module;
+
+ MONO_ARCH_SAVE_REGS;
+
+ for (i = 0; i < table->rows; ++i) {
+ mono_metadata_decode_row (table, i, cols, MONO_MANIFEST_SIZE);
+ val = mono_metadata_string_heap (assembly->assembly->image, cols [MONO_MANIFEST_NAME]);
+ if (strcmp (val, n) == 0)
+ break;
+ }
+ g_free (n);
+ if (i == table->rows)
+ return NULL;
+ /* FIXME */
+ impl = cols [MONO_MANIFEST_IMPLEMENTATION];
+ if (impl) {
+ /*
+ * this code should only be called after obtaining the
+ * ResourceInfo and handling the other cases.
+ */
+ g_assert ((impl & MONO_IMPLEMENTATION_MASK) == MONO_IMPLEMENTATION_FILE);
+ file_idx = impl >> MONO_IMPLEMENTATION_BITS;
- return mono_string_new (domain, (char *)ptr);
+ module = mono_image_load_file_for_image (assembly->assembly->image, file_idx);
+ if (!module)
+ return NULL;
+ }
+ else
+ module = assembly->assembly->image;
+
+ *ref_module = mono_module_get_object (mono_domain_get (), module);
+
+ return (void*)mono_image_get_resource (module, cols [MONO_MANIFEST_OFFSET], size);
}
-static guint32 ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error(void)
+static gboolean
+ves_icall_System_Reflection_Assembly_GetManifestResourceInfoInternal (MonoReflectionAssembly *assembly, MonoString *name, MonoManifestResourceInfo *info)
{
- return(GetLastError());
+ MonoTableInfo *table = &assembly->assembly->image->tables [MONO_TABLE_MANIFESTRESOURCE];
+ int i;
+ guint32 cols [MONO_MANIFEST_SIZE];
+ guint32 file_cols [MONO_FILE_SIZE];
+ const char *val;
+ char *n;
+
+ MONO_ARCH_SAVE_REGS;
+
+ n = mono_string_to_utf8 (name);
+ for (i = 0; i < table->rows; ++i) {
+ mono_metadata_decode_row (table, i, cols, MONO_MANIFEST_SIZE);
+ val = mono_metadata_string_heap (assembly->assembly->image, cols [MONO_MANIFEST_NAME]);
+ if (strcmp (val, n) == 0)
+ break;
+ }
+ g_free (n);
+ if (i == table->rows)
+ return FALSE;
+
+ if (!cols [MONO_MANIFEST_IMPLEMENTATION]) {
+ info->location = RESOURCE_LOCATION_EMBEDDED | RESOURCE_LOCATION_IN_MANIFEST;
+ }
+ else {
+ switch (cols [MONO_MANIFEST_IMPLEMENTATION] & MONO_IMPLEMENTATION_MASK) {
+ case MONO_IMPLEMENTATION_FILE:
+ i = cols [MONO_MANIFEST_IMPLEMENTATION] >> MONO_IMPLEMENTATION_BITS;
+ table = &assembly->assembly->image->tables [MONO_TABLE_FILE];
+ mono_metadata_decode_row (table, i - 1, file_cols, MONO_FILE_SIZE);
+ val = mono_metadata_string_heap (assembly->assembly->image, file_cols [MONO_FILE_NAME]);
+ info->filename = mono_string_new (mono_object_domain (assembly), val);
+ if (file_cols [MONO_FILE_FLAGS] && FILE_CONTAINS_NO_METADATA)
+ info->location = 0;
+ else
+ info->location = RESOURCE_LOCATION_EMBEDDED;
+ break;
+
+ case MONO_IMPLEMENTATION_ASSEMBLYREF:
+ i = cols [MONO_MANIFEST_IMPLEMENTATION] >> MONO_IMPLEMENTATION_BITS;
+ mono_assembly_load_reference (assembly->assembly->image, i - 1);
+ if (assembly->assembly->image->references [i - 1] == (gpointer)-1) {
+ char *msg = g_strdup_printf ("Assembly %d referenced from assembly %s not found ", i - 1, assembly->assembly->image->name);
+ MonoException *ex = mono_get_exception_file_not_found2 (msg, NULL);
+ g_free (msg);
+ mono_raise_exception (ex);
+ }
+ info->assembly = mono_assembly_get_object (mono_domain_get (), assembly->assembly->image->references [i - 1]);
+
+ /* Obtain info recursively */
+ ves_icall_System_Reflection_Assembly_GetManifestResourceInfoInternal (info->assembly, name, info);
+ info->location |= RESOURCE_LOCATION_ANOTHER_ASSEMBLY;
+ break;
+
+ case MONO_IMPLEMENTATION_EXP_TYPE:
+ g_assert_not_reached ();
+ break;
+ }
+ }
+
+ return TRUE;
}
-static MonoReflectionType*
-ves_icall_System_Reflection_Assembly_GetType (MonoReflectionAssembly *assembly, MonoString *name, MonoBoolean throwOnError, MonoBoolean ignoreCase)
+static MonoObject*
+ves_icall_System_Reflection_Assembly_GetFilesInternal (MonoReflectionAssembly *assembly, MonoString *name, MonoBoolean resource_modules)
{
- MonoDomain *domain = mono_domain_get ();
- gchar *str;
- MonoType *type;
- MonoTypeNameParse info;
-
- str = mono_string_to_utf8 (name);
- /*g_print ("requested type %s in %s\n", str, assembly->assembly->aname.name);*/
- if (!mono_reflection_parse_type (str, &info)) {
- g_free (str);
- g_list_free (info.modifiers);
- g_list_free (info.nested);
- if (throwOnError) /* uhm: this is a parse error, though... */
- mono_raise_exception (mono_get_exception_type_load ());
- /*g_print ("failed parse\n");*/
+ MonoTableInfo *table = &assembly->assembly->image->tables [MONO_TABLE_FILE];
+ MonoArray *result = NULL;
+ int i, count;
+ const char *val;
+ char *n;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* check hash if needed */
+ if (name) {
+ n = mono_string_to_utf8 (name);
+ for (i = 0; i < table->rows; ++i) {
+ val = mono_metadata_string_heap (assembly->assembly->image, mono_metadata_decode_row_col (table, i, MONO_FILE_NAME));
+ if (strcmp (val, n) == 0) {
+ MonoString *fn;
+ g_free (n);
+ n = g_concat_dir_and_file (assembly->assembly->basedir, val);
+ fn = mono_string_new (mono_object_domain (assembly), n);
+ g_free (n);
+ return (MonoObject*)fn;
+ }
+ }
+ g_free (n);
return NULL;
}
- type = mono_reflection_get_type (assembly->assembly->image, &info, ignoreCase);
- g_free (str);
- g_list_free (info.modifiers);
- g_list_free (info.nested);
- if (!type) {
- if (throwOnError)
- mono_raise_exception (mono_get_exception_type_load ());
- /* g_print ("failed find\n"); */
- return NULL;
+ count = 0;
+ for (i = 0; i < table->rows; ++i) {
+ if (resource_modules || !(mono_metadata_decode_row_col (table, i, MONO_FILE_FLAGS) & FILE_CONTAINS_NO_METADATA))
+ count ++;
}
- /* g_print ("got it\n"); */
- return mono_type_get_object (domain, type);
+ result = mono_array_new (mono_object_domain (assembly), mono_defaults.string_class, count);
+
+ count = 0;
+ for (i = 0; i < table->rows; ++i) {
+ if (resource_modules || !(mono_metadata_decode_row_col (table, i, MONO_FILE_FLAGS) & FILE_CONTAINS_NO_METADATA)) {
+ val = mono_metadata_string_heap (assembly->assembly->image, mono_metadata_decode_row_col (table, i, MONO_FILE_NAME));
+ n = g_concat_dir_and_file (assembly->assembly->basedir, val);
+ mono_array_set (result, gpointer, count, mono_string_new (mono_object_domain (assembly), n));
+ g_free (n);
+ count ++;
+ }
+ }
+ return (MonoObject*)result;
}
-static MonoString *
-ves_icall_System_Reflection_Assembly_get_code_base (MonoReflectionAssembly *assembly)
+static MonoArray*
+ves_icall_System_Reflection_Assembly_GetModulesInternal (MonoReflectionAssembly *assembly)
{
- MonoDomain *domain = mono_domain_get ();
- MonoString *res;
- char *name = g_strconcat (
- "file://", assembly->assembly->image->name, NULL);
-
- res = mono_string_new (domain, name);
- g_free (name);
+ MonoDomain *domain = mono_domain_get();
+ MonoArray *res;
+ MonoClass *klass;
+ int i, j, file_count = 0;
+ MonoImage **modules;
+ guint32 module_count, real_module_count;
+ MonoTableInfo *table;
+
+ g_assert (assembly->assembly->image != NULL);
+
+ if (assembly->assembly->dynamic) {
+ MonoReflectionAssemblyBuilder *assemblyb = (MonoReflectionAssemblyBuilder*)assembly;
+
+ if (assemblyb->modules)
+ module_count = mono_array_length (assemblyb->modules);
+ else
+ module_count = 0;
+ real_module_count = module_count;
+
+ modules = g_new0 (MonoImage*, module_count);
+ for (i = 0; i < mono_array_length (assemblyb->modules); ++i) {
+ modules [i] =
+ mono_array_get (assemblyb->modules, MonoReflectionModuleBuilder*, i)->module.image;
+ }
+ }
+ else {
+ table = &assembly->assembly->image->tables [MONO_TABLE_FILE];
+ file_count = table->rows;
+
+ modules = assembly->assembly->image->modules;
+ module_count = assembly->assembly->image->module_count;
+
+ real_module_count = 0;
+ for (i = 0; i < module_count; ++i)
+ if (modules [i])
+ real_module_count ++;
+ }
+
+ klass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "Module");
+ res = mono_array_new (domain, klass, 1 + real_module_count + file_count);
+
+ mono_array_set (res, gpointer, 0, mono_module_get_object (domain, assembly->assembly->image));
+ j = 1;
+ for (i = 0; i < module_count; ++i)
+ if (modules [i]) {
+ mono_array_set (res, gpointer, j, mono_module_get_object (domain, modules[i]));
+ ++j;
+ }
+
+ for (i = 0; i < file_count; ++i, ++j)
+ mono_array_set (res, gpointer, j, mono_module_file_get_object (domain, assembly->assembly->image, i));
+
+ if (assembly->assembly->dynamic)
+ g_free (modules);
+
return res;
}
+static MonoReflectionMethod*
+ves_icall_GetCurrentMethod (void)
+{
+ MonoMethod *m = mono_method_get_last_managed ();
+
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_method_get_object (mono_domain_get (), m, NULL);
+}
+
+static MonoReflectionMethod*
+ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternal (MonoMethod *method)
+{
+ return mono_method_get_object (mono_domain_get (), method, NULL);
+}
+
+static MonoReflectionMethodBody*
+ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal (MonoMethod *method)
+{
+ return mono_method_body_get_object (mono_domain_get (), method);
+}
+
+static MonoReflectionAssembly*
+ves_icall_System_Reflection_Assembly_GetExecutingAssembly (void)
+{
+ MonoMethod *m = mono_method_get_last_managed ();
+
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_assembly_get_object (mono_domain_get (), m->klass->image->assembly);
+}
+
+
+static gboolean
+get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
+{
+ MonoMethod **dest = data;
+
+ /* skip unmanaged frames */
+ if (!managed)
+ return FALSE;
+
+ if (m == *dest) {
+ *dest = NULL;
+ return FALSE;
+ }
+ if (!(*dest)) {
+ *dest = m;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static MonoReflectionAssembly*
+ves_icall_System_Reflection_Assembly_GetEntryAssembly (void)
+{
+ MonoDomain* domain = mono_domain_get ();
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!domain->entry_assembly)
+ return NULL;
+
+ return mono_assembly_get_object (domain, domain->entry_assembly);
+}
+
+
+static MonoReflectionAssembly*
+ves_icall_System_Reflection_Assembly_GetCallingAssembly (void)
+{
+ MonoMethod *m = mono_method_get_last_managed ();
+ MonoMethod *dest = m;
+
+ MONO_ARCH_SAVE_REGS;
+
+ mono_stack_walk_no_il (get_caller, &dest);
+ if (!dest)
+ dest = m;
+ return mono_assembly_get_object (mono_domain_get (), dest->klass->image->assembly);
+}
+
static MonoString *
-ves_icall_System_MonoType_getFullName (MonoReflectionType *object)
+ves_icall_System_MonoType_getFullName (MonoReflectionType *object, gboolean full_name)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_object_domain (object);
MonoString *res;
gchar *name;
- name = mono_type_get_name (object->type);
+ MONO_ARCH_SAVE_REGS;
+
+ if (full_name)
+ name = mono_type_get_full_name (object->type);
+ else
+ name = mono_type_get_name (object->type);
res = mono_string_new (domain, name);
g_free (name);
@@ -1840,24 +3867,122 @@ ves_icall_System_MonoType_getFullName (MonoReflectionType *object)
}
static void
-ves_icall_System_Reflection_Assembly_FillName (MonoReflectionAssembly *assembly, MonoReflectionAssemblyName *aname)
+fill_reflection_assembly_name (MonoDomain *domain, MonoReflectionAssemblyName *aname, MonoAssemblyName *name, const char *absolute)
{
- MonoAssemblyName *name = &assembly->assembly->aname;
+ static MonoMethod *create_culture = NULL;
+ gpointer args [1];
+ guint32 pkey_len;
+ const char *pkey_ptr;
+ gchar *codebase;
- if (strcmp (name->name, "corlib") == 0)
- aname->name = mono_string_new (mono_object_domain (assembly), "mscorlib");
- else
- aname->name = mono_string_new (mono_object_domain (assembly), name->name);
+ MONO_ARCH_SAVE_REGS;
+
+ aname->name = mono_string_new (domain, name->name);
aname->major = name->major;
+ aname->minor = name->minor;
+ aname->build = name->build;
+ aname->revision = name->revision;
+ aname->hashalg = name->hash_alg;
+
+ codebase = g_filename_to_uri (absolute, NULL, NULL);
+ if (codebase) {
+ aname->codebase = mono_string_new (domain, codebase);
+ g_free (codebase);
+ }
+
+ if (!create_culture) {
+ MonoMethodDesc *desc = mono_method_desc_new ("System.Globalization.CultureInfo:CreateSpecificCulture(string)", TRUE);
+ create_culture = mono_method_desc_search_in_image (desc, mono_defaults.corlib);
+ g_assert (create_culture);
+ mono_method_desc_free (desc);
+ }
+
+ args [0] = mono_string_new (domain, name->culture);
+ aname->cultureInfo =
+ mono_runtime_invoke (create_culture, NULL, args, NULL);
+
+ if (name->public_key) {
+ pkey_ptr = name->public_key;
+ pkey_len = mono_metadata_decode_blob_size (pkey_ptr, &pkey_ptr);
+
+ aname->publicKey = mono_array_new (domain, mono_defaults.byte_class, pkey_len);
+ memcpy (mono_array_addr (aname->publicKey, guint8, 0), pkey_ptr, pkey_len);
+ }
+
+ /* MonoAssemblyName keeps the public key token as an hexadecimal string */
+ if (name->public_key_token [0]) {
+ int i, j;
+ char *p;
+
+ aname->keyToken = mono_array_new (domain, mono_defaults.byte_class, 8);
+ p = mono_array_addr (aname->keyToken, char, 0);
+
+ for (i = 0, j = 0; i < 8; i++) {
+ *p = g_ascii_xdigit_value (name->public_key_token [j++]) << 4;
+ *p |= g_ascii_xdigit_value (name->public_key_token [j++]);
+ p++;
+ }
+ }
+}
+
+static void
+ves_icall_System_Reflection_Assembly_FillName (MonoReflectionAssembly *assembly, MonoReflectionAssemblyName *aname)
+{
+ gchar *absolute;
+
+ MONO_ARCH_SAVE_REGS;
+
+ absolute = g_build_filename (assembly->assembly->basedir, assembly->assembly->image->module_name, NULL);
+
+ fill_reflection_assembly_name (mono_object_domain (assembly), aname,
+ &assembly->assembly->aname, absolute);
+
+ g_free (absolute);
+}
+
+static void
+ves_icall_System_Reflection_Assembly_InternalGetAssemblyName (MonoString *fname, MonoReflectionAssemblyName *aname)
+{
+ char *filename;
+ MonoImageOpenStatus status = MONO_IMAGE_OK;
+ gboolean res;
+ MonoImage *image;
+ MonoAssemblyName name;
+
+ MONO_ARCH_SAVE_REGS;
+
+ filename = mono_string_to_utf8 (fname);
+
+ image = mono_image_open (filename, &status);
+
+ if (!image){
+ MonoException *exc;
+
+ g_free (filename);
+ exc = mono_get_exception_file_not_found (fname);
+ mono_raise_exception (exc);
+ }
+
+ res = mono_assembly_fill_assembly_name (image, &name);
+ if (!res) {
+ mono_image_close (image);
+ g_free (filename);
+ mono_raise_exception (mono_get_exception_argument ("assemblyFile", "The file does not contain a manifest"));
+ }
+
+ fill_reflection_assembly_name (mono_domain_get (), aname, &name, filename);
+
+ g_free (filename);
+ mono_image_close (image);
}
static MonoArray*
-ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly, MonoBoolean exportedOnly)
+mono_module_get_types (MonoDomain *domain, MonoImage *image,
+ MonoBoolean exportedOnly)
{
- MonoDomain *domain = mono_domain_get ();
MonoArray *res;
MonoClass *klass;
- MonoTableInfo *tdef = &assembly->assembly->image->tables [MONO_TABLE_TYPEDEF];
+ MonoTableInfo *tdef = &image->tables [MONO_TABLE_TYPEDEF];
int i, count;
guint32 attrs, visibility;
@@ -1879,7 +4004,7 @@ ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly,
attrs = mono_metadata_decode_row_col (tdef, i, MONO_TYPEDEF_FLAGS);
visibility = attrs & TYPE_ATTRIBUTE_VISIBILITY_MASK;
if (!exportedOnly || (visibility == TYPE_ATTRIBUTE_PUBLIC || visibility == TYPE_ATTRIBUTE_NESTED_PUBLIC)) {
- klass = mono_class_get (assembly->assembly->image, (i + 1) | MONO_TOKEN_TYPE_DEF);
+ klass = mono_class_get (image, (i + 1) | MONO_TOKEN_TYPE_DEF);
mono_array_set (res, gpointer, count, mono_type_get_object (domain, &klass->byval_arg));
count++;
}
@@ -1888,6 +4013,363 @@ ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly,
return res;
}
+static MonoArray*
+ves_icall_System_Reflection_Assembly_GetTypes (MonoReflectionAssembly *assembly, MonoBoolean exportedOnly)
+{
+ MonoArray *res = NULL;
+ MonoImage *image = NULL;
+ MonoTableInfo *table = NULL;
+ MonoDomain *domain;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ domain = mono_object_domain (assembly);
+
+ if (assembly->assembly->dynamic) {
+ MonoReflectionAssemblyBuilder *abuilder = (MonoReflectionAssemblyBuilder*)assembly;
+ if (abuilder->modules) {
+ for (i = 0; i < mono_array_length(abuilder->modules); i++) {
+ MonoReflectionModuleBuilder *mb = mono_array_get (abuilder->modules, MonoReflectionModuleBuilder*, i);
+ if (res == NULL)
+ res = mb->types;
+ else {
+ MonoArray *append = mb->types;
+ if (mono_array_length (append) > 0) {
+ guint32 len1, len2;
+ MonoArray *new;
+ len1 = mono_array_length (res);
+ len2 = mono_array_length (append);
+ new = mono_array_new (domain, mono_defaults.monotype_class, len1 + len2);
+ memcpy (mono_array_addr (new, MonoReflectionType*, 0),
+ mono_array_addr (res, MonoReflectionType*, 0),
+ len1 * sizeof (MonoReflectionType*));
+ memcpy (mono_array_addr (new, MonoReflectionType*, len1),
+ mono_array_addr (append, MonoReflectionType*, 0),
+ len2 * sizeof (MonoReflectionType*));
+ res = new;
+ }
+ }
+ }
+
+ /*
+ * Replace TypeBuilders with the created types to be compatible
+ * with MS.NET.
+ */
+ if (res) {
+ for (i = 0; i < mono_array_length (res); ++i) {
+ MonoReflectionTypeBuilder *tb = mono_array_get (res, MonoReflectionTypeBuilder*, i);
+ if (tb->created)
+ mono_array_set (res, MonoReflectionType*, i, tb->created);
+ }
+ }
+ }
+
+ if (abuilder->loaded_modules)
+ for (i = 0; i < mono_array_length(abuilder->loaded_modules); i++) {
+ MonoReflectionModule *rm = mono_array_get (abuilder->loaded_modules, MonoReflectionModule*, i);
+ if (res == NULL)
+ res = mono_module_get_types (domain, rm->image, exportedOnly);
+ else {
+ MonoArray *append = mono_module_get_types (domain, rm->image, exportedOnly);
+ if (mono_array_length (append) > 0) {
+ guint32 len1, len2;
+ MonoArray *new;
+ len1 = mono_array_length (res);
+ len2 = mono_array_length (append);
+ new = mono_array_new (domain, mono_defaults.monotype_class, len1 + len2);
+ memcpy (mono_array_addr (new, MonoReflectionType*, 0),
+ mono_array_addr (res, MonoReflectionType*, 0),
+ len1 * sizeof (MonoReflectionType*));
+ memcpy (mono_array_addr (new, MonoReflectionType*, len1),
+ mono_array_addr (append, MonoReflectionType*, 0),
+ len2 * sizeof (MonoReflectionType*));
+ res = new;
+ }
+ }
+ }
+ return res;
+ }
+ image = assembly->assembly->image;
+ table = &image->tables [MONO_TABLE_FILE];
+ res = mono_module_get_types (domain, image, exportedOnly);
+
+ /* Append data from all modules in the assembly */
+ for (i = 0; i < table->rows; ++i) {
+ if (!(mono_metadata_decode_row_col (table, i, MONO_FILE_FLAGS) & FILE_CONTAINS_NO_METADATA)) {
+ MonoImage *loaded_image = mono_assembly_load_module (image->assembly, i + 1);
+ if (loaded_image) {
+ MonoArray *res2 = mono_module_get_types (domain, loaded_image, exportedOnly);
+ /* Append the new types to the end of the array */
+ if (mono_array_length (res2) > 0) {
+ guint32 len1, len2;
+ MonoArray *res3;
+
+ len1 = mono_array_length (res);
+ len2 = mono_array_length (res2);
+ res3 = mono_array_new (domain, mono_defaults.monotype_class, len1 + len2);
+ memcpy (mono_array_addr (res3, MonoReflectionType*, 0),
+ mono_array_addr (res, MonoReflectionType*, 0),
+ len1 * sizeof (MonoReflectionType*));
+ memcpy (mono_array_addr (res3, MonoReflectionType*, len1),
+ mono_array_addr (res2, MonoReflectionType*, 0),
+ len2 * sizeof (MonoReflectionType*));
+ res = res3;
+ }
+ }
+ }
+ }
+ return res;
+}
+
+static MonoReflectionType*
+ves_icall_System_Reflection_Module_GetGlobalType (MonoReflectionModule *module)
+{
+ MonoDomain *domain = mono_object_domain (module);
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ g_assert (module->image);
+
+ if (module->image->dynamic && ((MonoDynamicImage*)(module->image))->initial_image)
+ /* These images do not have a global type */
+ return NULL;
+
+ klass = mono_class_get (module->image, 1 | MONO_TOKEN_TYPE_DEF);
+ return mono_type_get_object (domain, &klass->byval_arg);
+}
+
+static void
+ves_icall_System_Reflection_Module_Close (MonoReflectionModule *module)
+{
+ if (module->image)
+ mono_image_close (module->image);
+}
+
+static MonoString*
+ves_icall_System_Reflection_Module_GetGuidInternal (MonoReflectionModule *module)
+{
+ MonoDomain *domain = mono_object_domain (module);
+
+ MONO_ARCH_SAVE_REGS;
+
+ g_assert (module->image);
+ return mono_string_new (domain, module->image->guid);
+}
+
+static void
+ves_icall_System_Reflection_Module_GetPEKind (MonoImage *image, gint32 *pe_kind, gint32 *machine)
+{
+ if (image->dynamic) {
+ MonoDynamicImage *dyn = (MonoDynamicImage*)image;
+ *pe_kind = dyn->pe_kind;
+ *machine = dyn->machine;
+ }
+ else {
+ *pe_kind = ((MonoCLIImageInfo*)(image->image_info))->cli_cli_header.ch_flags & 0x3;
+ *machine = ((MonoCLIImageInfo*)(image->image_info))->cli_header.coff.coff_machine;
+ }
+}
+
+static MonoArray*
+ves_icall_System_Reflection_Module_InternalGetTypes (MonoReflectionModule *module)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (!module->image)
+ return mono_array_new (mono_object_domain (module), mono_defaults.monotype_class, 0);
+ else
+ return mono_module_get_types (mono_object_domain (module), module->image, FALSE);
+}
+
+static gboolean
+mono_metadata_memberref_is_method (MonoImage *image, guint32 token)
+{
+ guint32 cols [MONO_MEMBERREF_SIZE];
+ const char *sig;
+ mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], mono_metadata_token_index (token) - 1, cols, MONO_MEMBERREF_SIZE);
+ sig = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]);
+ mono_metadata_decode_blob_size (sig, &sig);
+ return (*sig != 0x6);
+}
+
+static MonoType*
+ves_icall_System_Reflection_Module_ResolveTypeToken (MonoImage *image, guint32 token, MonoResolveTokenError *error)
+{
+ MonoClass *klass;
+ int table = mono_metadata_token_table (token);
+ int index = mono_metadata_token_index (token);
+
+ *error = ResolveTokenError_Other;
+
+ /* Validate token */
+ if ((table != MONO_TABLE_TYPEDEF) && (table != MONO_TABLE_TYPEREF) &&
+ (table != MONO_TABLE_TYPESPEC)) {
+ *error = ResolveTokenError_BadTable;
+ return NULL;
+ }
+
+ if (image->dynamic)
+ return mono_lookup_dynamic_token (image, token);
+
+ if ((index <= 0) || (index > image->tables [table].rows)) {
+ *error = ResolveTokenError_OutOfRange;
+ return NULL;
+ }
+
+ klass = mono_class_get (image, token);
+ if (klass)
+ return &klass->byval_arg;
+ else
+ return NULL;
+}
+
+static MonoMethod*
+ves_icall_System_Reflection_Module_ResolveMethodToken (MonoImage *image, guint32 token, MonoResolveTokenError *error)
+{
+ int table = mono_metadata_token_table (token);
+ int index = mono_metadata_token_index (token);
+
+ *error = ResolveTokenError_Other;
+
+ /* Validate token */
+ if ((table != MONO_TABLE_METHOD) && (table != MONO_TABLE_METHODSPEC) &&
+ (table != MONO_TABLE_MEMBERREF)) {
+ *error = ResolveTokenError_BadTable;
+ return NULL;
+ }
+
+ if (image->dynamic)
+ /* FIXME: validate memberref token type */
+ return mono_lookup_dynamic_token (image, token);
+
+ if ((index <= 0) || (index > image->tables [table].rows)) {
+ *error = ResolveTokenError_OutOfRange;
+ return NULL;
+ }
+ if ((table == MONO_TABLE_MEMBERREF) && (!mono_metadata_memberref_is_method (image, token))) {
+ *error = ResolveTokenError_BadTable;
+ return NULL;
+ }
+
+ return mono_get_method (image, token, NULL);
+}
+
+static MonoString*
+ves_icall_System_Reflection_Module_ResolveStringToken (MonoImage *image, guint32 token, MonoResolveTokenError *error)
+{
+ int index = mono_metadata_token_index (token);
+
+ *error = ResolveTokenError_Other;
+
+ /* Validate token */
+ if (mono_metadata_token_code (token) != MONO_TOKEN_STRING) {
+ *error = ResolveTokenError_BadTable;
+ return NULL;
+ }
+
+ if (image->dynamic)
+ return mono_lookup_dynamic_token (image, token);
+
+ if ((index <= 0) || (index >= image->heap_us.size)) {
+ *error = ResolveTokenError_OutOfRange;
+ return NULL;
+ }
+
+ /* FIXME: What to do if the index points into the middle of a string ? */
+
+ return mono_ldstr (mono_domain_get (), image, index);
+}
+
+static MonoClassField*
+ves_icall_System_Reflection_Module_ResolveFieldToken (MonoImage *image, guint32 token, MonoResolveTokenError *error)
+{
+ MonoClass *klass;
+ int table = mono_metadata_token_table (token);
+ int index = mono_metadata_token_index (token);
+
+ *error = ResolveTokenError_Other;
+
+ /* Validate token */
+ if ((table != MONO_TABLE_FIELD) && (table != MONO_TABLE_MEMBERREF)) {
+ *error = ResolveTokenError_BadTable;
+ return NULL;
+ }
+
+ if (image->dynamic)
+ /* FIXME: validate memberref token type */
+ return mono_lookup_dynamic_token (image, token);
+
+ if ((index <= 0) || (index > image->tables [table].rows)) {
+ *error = ResolveTokenError_OutOfRange;
+ return NULL;
+ }
+ if ((table == MONO_TABLE_MEMBERREF) && (mono_metadata_memberref_is_method (image, token))) {
+ *error = ResolveTokenError_BadTable;
+ return NULL;
+ }
+
+ return mono_field_from_token (image, token, &klass, NULL);
+}
+
+
+static MonoObject*
+ves_icall_System_Reflection_Module_ResolveMemberToken (MonoImage *image, guint32 token, MonoResolveTokenError *error)
+{
+ int table = mono_metadata_token_table (token);
+
+ *error = ResolveTokenError_Other;
+
+ switch (table) {
+ case MONO_TABLE_TYPEDEF:
+ case MONO_TABLE_TYPEREF:
+ case MONO_TABLE_TYPESPEC: {
+ MonoType *t = ves_icall_System_Reflection_Module_ResolveTypeToken (image, token, error);
+ if (t)
+ return (MonoObject*)mono_type_get_object (mono_domain_get (), t);
+ else
+ return NULL;
+ }
+ case MONO_TABLE_METHOD:
+ case MONO_TABLE_METHODSPEC: {
+ MonoMethod *m = ves_icall_System_Reflection_Module_ResolveMethodToken (image, token, error);
+ if (m)
+ return (MonoObject*)mono_method_get_object (mono_domain_get (), m, m->klass);
+ else
+ return NULL;
+ }
+ case MONO_TABLE_FIELD: {
+ MonoClassField *f = ves_icall_System_Reflection_Module_ResolveFieldToken (image, token, error);
+ if (f)
+ return (MonoObject*)mono_field_get_object (mono_domain_get (), f->parent, f);
+ else
+ return NULL;
+ }
+ case MONO_TABLE_MEMBERREF:
+ if (mono_metadata_memberref_is_method (image, token)) {
+ MonoMethod *m = ves_icall_System_Reflection_Module_ResolveMethodToken (image, token, error);
+ if (m)
+ return (MonoObject*)mono_method_get_object (mono_domain_get (), m, m->klass);
+ else
+ return NULL;
+ }
+ else {
+ MonoClassField *f = ves_icall_System_Reflection_Module_ResolveFieldToken (image, token, error);
+ if (f)
+ return (MonoObject*)mono_field_get_object (mono_domain_get (), f->parent, f);
+ else
+ return NULL;
+ }
+ break;
+
+ default:
+ *error = ResolveTokenError_BadTable;
+ }
+
+ return NULL;
+}
+
static MonoReflectionType*
ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, MonoString *smodifiers)
{
@@ -1896,6 +4378,8 @@ ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, Mon
char *str = mono_string_to_utf8 (smodifiers);
char *p;
+ MONO_ARCH_SAVE_REGS;
+
klass = mono_class_from_mono_type (tb->type.type);
p = str;
/* logic taken from mono_reflection_parse_type(): keep in sync */
@@ -1909,7 +4393,7 @@ ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, Mon
isbyref = 1;
p++;
g_free (str);
- return mono_type_get_object (mono_domain_get (), &klass->this_arg);
+ return mono_type_get_object (mono_object_domain (tb), &klass->this_arg);
break;
case '*':
klass = mono_ptr_class_get (&klass->byval_arg);
@@ -1935,7 +4419,7 @@ ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, Mon
return NULL;
}
p++;
- klass = mono_array_class_get (&klass->byval_arg, rank);
+ klass = mono_array_class_get (klass, rank);
mono_class_init (klass);
break;
default:
@@ -1943,15 +4427,101 @@ ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, Mon
}
}
g_free (str);
- return mono_type_get_object (mono_domain_get (), &klass->byval_arg);
+ return mono_type_get_object (mono_object_domain (tb), &klass->byval_arg);
+}
+
+static MonoBoolean
+ves_icall_Type_IsArrayImpl (MonoReflectionType *t)
+{
+ MonoType *type;
+ MonoBoolean res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ type = t->type;
+ res = !type->byref && (type->type == MONO_TYPE_ARRAY || type->type == MONO_TYPE_SZARRAY);
+
+ return res;
+}
+
+static MonoReflectionType *
+ves_icall_Type_make_array_type (MonoReflectionType *type, int rank)
+{
+ MonoClass *klass, *aklass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type);
+ aklass = mono_array_class_get (klass, rank);
+
+ return mono_type_get_object (mono_object_domain (type), &aklass->byval_arg);
+}
+
+static MonoReflectionType *
+ves_icall_Type_make_byref_type (MonoReflectionType *type)
+{
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type);
+
+ return mono_type_get_object (mono_object_domain (type), &klass->this_arg);
+}
+
+static MonoReflectionType *
+ves_icall_Type_MakePointerType (MonoReflectionType *type)
+{
+ MonoClass *pklass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ pklass = mono_ptr_class_get (type->type);
+
+ return mono_type_get_object (mono_object_domain (type), &pklass->byval_arg);
+}
+
+static MonoObject *
+ves_icall_System_Delegate_CreateDelegate_internal (MonoReflectionType *type, MonoObject *target,
+ MonoReflectionMethod *info)
+{
+ MonoClass *delegate_class = mono_class_from_mono_type (type->type);
+ MonoObject *delegate;
+ gpointer func;
+
+ MONO_ARCH_SAVE_REGS;
+
+ mono_assert (delegate_class->parent == mono_defaults.multicastdelegate_class);
+
+ delegate = mono_object_new (mono_object_domain (type), delegate_class);
+
+ func = mono_compile_method (info->method);
+
+ mono_delegate_ctor (delegate, target, func);
+
+ return delegate;
+}
+
+static void
+ves_icall_System_Delegate_FreeTrampoline (MonoDelegate *this)
+{
+ mono_delegate_free_ftnptr (this);
}
/*
* Magic number to convert a time which is relative to
* Jan 1, 1970 into a value which is relative to Jan 1, 0001.
*/
-#define EPOCH_ADJUST ((gint64)62135596800L)
+#define EPOCH_ADJUST ((guint64)62135596800LL)
+
+/*
+ * Magic number to convert FILETIME base Jan 1, 1601 to DateTime - base Jan, 1, 0001
+ */
+#define FILETIME_ADJUST ((guint64)504911232000000000LL)
+/*
+ * This returns Now in UTC
+ */
static gint64
ves_icall_System_DateTime_GetNow (void)
{
@@ -1959,14 +4529,16 @@ ves_icall_System_DateTime_GetNow (void)
SYSTEMTIME st;
FILETIME ft;
- GetLocalTime (&st);
+ GetSystemTime (&st);
SystemTimeToFileTime (&st, &ft);
- return (gint64)504911232000000000L + ((((gint64)ft.dwHighDateTime)<<32) | ft.dwLowDateTime);
+ return (gint64) FILETIME_ADJUST + ((((gint64)ft.dwHighDateTime)<<32) | ft.dwLowDateTime);
#else
/* FIXME: put this in io-layer and call it GetLocalTime */
struct timeval tv;
gint64 res;
+ MONO_ARCH_SAVE_REGS;
+
if (gettimeofday (&tv, NULL) == 0) {
res = (((gint64)tv.tv_sec + EPOCH_ADJUST)* 1000000 + tv.tv_usec)*10;
return res;
@@ -1976,6 +4548,58 @@ ves_icall_System_DateTime_GetNow (void)
#endif
}
+#ifdef PLATFORM_WIN32
+/* convert a SYSTEMTIME which is of the form "last thursday in october" to a real date */
+static void
+convert_to_absolute_date(SYSTEMTIME *date)
+{
+#define IS_LEAP(y) ((y % 4) == 0 && ((y % 100) != 0 || (y % 400) == 0))
+ static int days_in_month[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+ static int leap_days_in_month[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+ /* from the calendar FAQ */
+ int a = (14 - date->wMonth) / 12;
+ int y = date->wYear - a;
+ int m = date->wMonth + 12 * a - 2;
+ int d = (1 + y + y/4 - y/100 + y/400 + (31*m)/12) % 7;
+
+ /* d is now the day of the week for the first of the month (0 == Sunday) */
+
+ int day_of_week = date->wDayOfWeek;
+
+ /* set day_in_month to the first day in the month which falls on day_of_week */
+ int day_in_month = 1 + (day_of_week - d);
+ if (day_in_month <= 0)
+ day_in_month += 7;
+
+ /* wDay is 1 for first weekday in month, 2 for 2nd ... 5 means last - so work that out allowing for days in the month */
+ date->wDay = day_in_month + (date->wDay - 1) * 7;
+ if (date->wDay > (IS_LEAP(date->wYear) ? leap_days_in_month[date->wMonth - 1] : days_in_month[date->wMonth - 1]))
+ date->wDay -= 7;
+}
+#endif
+
+#ifndef PLATFORM_WIN32
+/*
+ * Return's the offset from GMT of a local time.
+ *
+ * tm is a local time
+ * t is the same local time as seconds.
+ */
+static int
+gmt_offset(struct tm *tm, time_t t)
+{
+#if defined (HAVE_TM_GMTOFF)
+ return tm->tm_gmtoff;
+#else
+ struct tm g;
+ time_t t2;
+ g = *gmtime(&t);
+ g.tm_isdst = tm->tm_isdst;
+ t2 = mktime(&g);
+ return (int)difftime(t, t2);
+#endif
+}
+#endif
/*
* This is heavily based on zdump.c from glibc 2.2.
*
@@ -2001,29 +4625,39 @@ ves_icall_System_CurrentTimeZone_GetTimeZoneData (guint32 year, MonoArray **data
long int gmtoff;
int is_daylight = 0, day;
+ char tzone [64];
- memset (&start, 0, sizeof (start));
-
- start.tm_mday = 1;
- start.tm_year = year-1900;
+ MONO_ARCH_SAVE_REGS;
- t = mktime (&start);
-#if defined (HAVE_TIMEZONE)
-#define gmt_offset(x) (-1 * (((timezone / 60 / 60) - daylight) * 100))
-#elif defined (HAVE_TM_GMTOFF)
-#define gmt_offset(x) x.tm_gmtoff
-#else
-#error Neither HAVE_TIMEZONE nor HAVE_TM_GMTOFF defined. Rerun autoheader, autoconf, etc.
-#endif
-
- gmtoff = gmt_offset (start);
-
MONO_CHECK_ARG_NULL (data);
MONO_CHECK_ARG_NULL (names);
(*data) = mono_array_new (domain, mono_defaults.int64_class, 4);
(*names) = mono_array_new (domain, mono_defaults.string_class, 2);
+ /*
+ * no info is better than crashing: we'll need our own tz data to make
+ * this work properly, anyway. The range is reduced to 1970 .. 2037 because
+ * that is what mktime is guaranteed to support (we get into an infinite loop
+ * otherwise).
+ */
+ if ((year < 1970) || (year > 2037)) {
+ t = time (NULL);
+ tt = *localtime (&t);
+ strftime (tzone, sizeof (tzone), "%Z", &tt);
+ mono_array_set ((*names), gpointer, 0, mono_string_new (domain, tzone));
+ mono_array_set ((*names), gpointer, 1, mono_string_new (domain, tzone));
+ return 1;
+ }
+
+ memset (&start, 0, sizeof (start));
+
+ start.tm_mday = 1;
+ start.tm_year = year-1900;
+
+ t = mktime (&start);
+ gmtoff = gmt_offset (&start, t);
+
/* For each day of the year, calculate the tm_gmtoff. */
for (day = 0; day < 365; day++) {
@@ -2031,8 +4665,7 @@ ves_icall_System_CurrentTimeZone_GetTimeZoneData (guint32 year, MonoArray **data
tt = *localtime (&t);
/* Daylight saving starts or ends here. */
- if (gmt_offset (tt) != gmtoff) {
- char tzone[10];
+ if (gmt_offset (&tt, t) != gmtoff) {
struct tm tt1;
time_t t1;
@@ -2041,15 +4674,15 @@ ves_icall_System_CurrentTimeZone_GetTimeZoneData (guint32 year, MonoArray **data
do {
t1 -= 3600;
tt1 = *localtime (&t1);
- } while (gmt_offset (tt1) != gmtoff);
+ } while (gmt_offset (&tt1, t1) != gmtoff);
/* Try to find the exact minute when daylight saving starts/ends. */
do {
t1 += 60;
tt1 = *localtime (&t1);
- } while (gmt_offset (tt1) == gmtoff);
-
- strftime (tzone, 10, "%Z", &tt);
+ } while (gmt_offset (&tt1, t1) == gmtoff);
+ t1+=gmtoff;
+ strftime (tzone, sizeof (tzone), "%Z", &tt);
/* Write data, if we're already in daylight saving, we're done. */
if (is_daylight) {
@@ -2064,21 +4697,33 @@ ves_icall_System_CurrentTimeZone_GetTimeZoneData (guint32 year, MonoArray **data
/* This is only set once when we enter daylight saving. */
mono_array_set ((*data), gint64, 2, (gint64)gmtoff * 10000000L);
- mono_array_set ((*data), gint64, 3, (gint64)(gmt_offset (tt) - gmtoff) * 10000000L);
+ mono_array_set ((*data), gint64, 3, (gint64)(gmt_offset (&tt, t) - gmtoff) * 10000000L);
- gmtoff = gmt_offset (tt);
+ gmtoff = gmt_offset (&tt, t);
}
+ }
- gmtoff = gmt_offset (tt);
+ if (!is_daylight) {
+ strftime (tzone, sizeof (tzone), "%Z", &tt);
+ mono_array_set ((*names), gpointer, 0, mono_string_new (domain, tzone));
+ mono_array_set ((*names), gpointer, 1, mono_string_new (domain, tzone));
+ mono_array_set ((*data), gint64, 0, 0);
+ mono_array_set ((*data), gint64, 1, 0);
+ mono_array_set ((*data), gint64, 2, (gint64) gmtoff * 10000000L);
+ mono_array_set ((*data), gint64, 3, 0);
}
+
return 1;
#else
MonoDomain *domain = mono_domain_get ();
TIME_ZONE_INFORMATION tz_info;
FILETIME ft;
int i;
+ int err, tz_id;
- GetTimeZoneInformation (&tz_info);
+ tz_id = GetTimeZoneInformation (&tz_info);
+ if (tz_id == TIME_ZONE_ID_INVALID)
+ return 0;
MONO_CHECK_ARG_NULL (data);
MONO_CHECK_ARG_NULL (names);
@@ -2095,90 +4740,164 @@ ves_icall_System_CurrentTimeZone_GetTimeZoneData (guint32 year, MonoArray **data
break;
mono_array_set ((*names), gpointer, 0, mono_string_new_utf16 (domain, tz_info.StandardName, i));
- SystemTimeToFileTime (&tz_info.StandardDate, &ft);
- mono_array_set ((*data), gint64, 1, ((guint64)ft.dwHighDateTime<<32) | ft.dwLowDateTime);
- SystemTimeToFileTime (&tz_info.DaylightDate, &ft);
- mono_array_set ((*data), gint64, 0, ((guint64)ft.dwHighDateTime<<32) | ft.dwLowDateTime);
- mono_array_set ((*data), gint64, 3, tz_info.Bias + tz_info.StandardBias);
- mono_array_set ((*data), gint64, 2, tz_info.Bias + tz_info.DaylightBias);
+ if ((year <= 1601) || (year > 30827)) {
+ /*
+ * According to MSDN, the MS time functions can't handle dates outside
+ * this interval.
+ */
+ return 1;
+ }
+
+ /* even if the timezone has no daylight savings it may have Bias (e.g. GMT+13 it seems) */
+ if (tz_id != TIME_ZONE_ID_UNKNOWN) {
+ tz_info.StandardDate.wYear = year;
+ convert_to_absolute_date(&tz_info.StandardDate);
+ err = SystemTimeToFileTime (&tz_info.StandardDate, &ft);
+ g_assert(err);
+ mono_array_set ((*data), gint64, 1, FILETIME_ADJUST + (((guint64)ft.dwHighDateTime<<32) | ft.dwLowDateTime));
+ tz_info.DaylightDate.wYear = year;
+ convert_to_absolute_date(&tz_info.DaylightDate);
+ err = SystemTimeToFileTime (&tz_info.DaylightDate, &ft);
+ g_assert(err);
+ mono_array_set ((*data), gint64, 0, FILETIME_ADJUST + (((guint64)ft.dwHighDateTime<<32) | ft.dwLowDateTime));
+ }
+ mono_array_set ((*data), gint64, 2, (tz_info.Bias + tz_info.StandardBias) * -600000000LL);
+ mono_array_set ((*data), gint64, 3, (tz_info.DaylightBias - tz_info.StandardBias) * -600000000LL);
return 1;
#endif
}
static gpointer
-ves_icall_System_Object_obj_address (MonoObject *this) {
+ves_icall_System_Object_obj_address (MonoObject *this)
+{
+ MONO_ARCH_SAVE_REGS;
+
return this;
}
/* System.Buffer */
-static gint32
-ves_icall_System_Buffer_ByteLengthInternal (MonoArray *array) {
+static inline gint32
+mono_array_get_byte_length (MonoArray *array)
+{
MonoClass *klass;
- MonoTypeEnum etype;
- int length, esize;
+ int length;
int i;
klass = array->obj.vtable->klass;
- etype = klass->element_class->byval_arg.type;
- if (etype < MONO_TYPE_BOOLEAN || etype > MONO_TYPE_R8)
- return -1;
if (array->bounds == NULL)
length = array->max_length;
else {
- length = 0;
+ length = 1;
for (i = 0; i < klass->rank; ++ i)
- length += array->bounds [i].length;
+ length *= array->bounds [i].length;
}
- esize = mono_array_element_size (klass);
- return length * esize;
+ switch (klass->element_class->byval_arg.type) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ return length;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ return length << 1;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_R4:
+ return length << 2;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ return length * sizeof (gpointer);
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R8:
+ return length << 3;
+ default:
+ return -1;
+ }
+}
+
+static gint32
+ves_icall_System_Buffer_ByteLengthInternal (MonoArray *array)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_array_get_byte_length (array);
}
static gint8
-ves_icall_System_Buffer_GetByteInternal (MonoArray *array, gint32 idx) {
+ves_icall_System_Buffer_GetByteInternal (MonoArray *array, gint32 idx)
+{
+ MONO_ARCH_SAVE_REGS;
+
return mono_array_get (array, gint8, idx);
}
static void
-ves_icall_System_Buffer_SetByteInternal (MonoArray *array, gint32 idx, gint8 value) {
+ves_icall_System_Buffer_SetByteInternal (MonoArray *array, gint32 idx, gint8 value)
+{
+ MONO_ARCH_SAVE_REGS;
+
mono_array_set (array, gint8, idx, value);
}
-static void
-ves_icall_System_Buffer_BlockCopyInternal (MonoArray *src, gint32 src_offset, MonoArray *dest, gint32 dest_offset, gint32 count) {
+static MonoBoolean
+ves_icall_System_Buffer_BlockCopyInternal (MonoArray *src, gint32 src_offset, MonoArray *dest, gint32 dest_offset, gint32 count)
+{
char *src_buf, *dest_buf;
+ MONO_ARCH_SAVE_REGS;
+
+ /* watch out for integer overflow */
+ if ((src_offset > mono_array_get_byte_length (src) - count) || (dest_offset > mono_array_get_byte_length (dest) - count))
+ return FALSE;
+
src_buf = (gint8 *)src->vector + src_offset;
dest_buf = (gint8 *)dest->vector + dest_offset;
- memcpy (dest_buf, src_buf, count);
+ if (src != dest)
+ memcpy (dest_buf, src_buf, count);
+ else
+ memmove (dest_buf, src_buf, count); /* Source and dest are the same array */
+
+ return TRUE;
}
static MonoObject *
-ves_icall_Remoting_RealProxy_GetTransparentProxy (MonoObject *this)
+ves_icall_Remoting_RealProxy_GetTransparentProxy (MonoObject *this, MonoString *class_name)
{
- MonoDomain *domain = mono_domain_get ();
+ MonoDomain *domain = mono_object_domain (this);
MonoObject *res;
MonoRealProxy *rp = ((MonoRealProxy *)this);
+ MonoTransparentProxy *tp;
MonoType *type;
MonoClass *klass;
+ MONO_ARCH_SAVE_REGS;
+
res = mono_object_new (domain, mono_defaults.transparent_proxy_class);
+ tp = (MonoTransparentProxy*) res;
- ((MonoTransparentProxy *)res)->rp = rp;
+ tp->rp = rp;
type = ((MonoReflectionType *)rp->class_to_proxy)->type;
klass = mono_class_from_mono_type (type);
- ((MonoTransparentProxy *)res)->klass = klass;
-
- res->vtable = mono_class_proxy_vtable (domain, klass);
+ tp->custom_type_info = (mono_object_isinst (this, mono_defaults.iremotingtypeinfo_class) != NULL);
+ tp->remote_class = mono_remote_class (domain, class_name, klass);
+ res->vtable = tp->remote_class->vtable;
return res;
}
+static MonoReflectionType *
+ves_icall_Remoting_RealProxy_InternalGetProxyType (MonoTransparentProxy *tp)
+{
+ return mono_type_get_object (mono_object_domain (tp), &tp->remote_class->proxy_class->byval_arg);
+}
+
/* System.Environment */
static MonoString *
@@ -2193,7 +4912,7 @@ ves_icall_System_Environment_get_MachineName (void)
buf = g_new (gunichar2, len);
result = NULL;
- if (GetComputerName (buf, &len))
+ if (GetComputerName (buf, (PDWORD) &len))
result = mono_string_new_utf16 (mono_domain_get (), buf, len);
g_free (buf);
@@ -2203,11 +4922,13 @@ ves_icall_System_Environment_get_MachineName (void)
int len;
MonoString *result;
+ MONO_ARCH_SAVE_REGS;
+
len = 256;
buf = g_new (gchar, len);
result = NULL;
- if (gethostname (buf, len) != 0)
+ if (gethostname (buf, len) == 0)
result = mono_string_new (mono_domain_get (), buf);
g_free (buf);
@@ -2215,9 +4936,25 @@ ves_icall_System_Environment_get_MachineName (void)
#endif
}
+static int
+ves_icall_System_Environment_get_Platform (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#if defined (PLATFORM_WIN32)
+ /* Win32NT */
+ return 2;
+#else
+ /* Unix */
+ return 128;
+#endif
+}
+
static MonoString *
ves_icall_System_Environment_get_NewLine (void)
{
+ MONO_ARCH_SAVE_REGS;
+
#if defined (PLATFORM_WIN32)
return mono_string_new (mono_domain_get (), "\r\n");
#else
@@ -2231,6 +4968,8 @@ ves_icall_System_Environment_GetEnvironmentVariable (MonoString *name)
const gchar *value;
gchar *utf8_name;
+ MONO_ARCH_SAVE_REGS;
+
if (name == NULL)
return NULL;
@@ -2247,7 +4986,10 @@ ves_icall_System_Environment_GetEnvironmentVariable (MonoString *name)
/*
* There is no standard way to get at environ.
*/
-extern char **environ;
+#ifndef _MSC_VER
+extern
+#endif
+char **environ;
static MonoArray *
ves_icall_System_Environment_GetEnvironmentVariableNames (void)
@@ -2258,6 +5000,8 @@ ves_icall_System_Environment_GetEnvironmentVariableNames (void)
gchar **e, **parts;
int n;
+ MONO_ARCH_SAVE_REGS;
+
n = 0;
for (e = environ; *e != 0; ++ e)
++ n;
@@ -2294,6 +5038,8 @@ ves_icall_System_Environment_get_TickCount (void)
struct timezone tz;
gint32 res;
+ MONO_ARCH_SAVE_REGS;
+
res = (gint32) gettimeofday (&tv, &tz);
if (res != -1)
@@ -2306,23 +5052,206 @@ ves_icall_System_Environment_get_TickCount (void)
static void
ves_icall_System_Environment_Exit (int result)
{
+ MONO_ARCH_SAVE_REGS;
+
+ mono_runtime_quit ();
+
/* we may need to do some cleanup here... */
exit (result);
}
+static MonoString*
+ves_icall_System_Environment_GetGacPath (void)
+{
+ return mono_string_new (mono_domain_get (), mono_assembly_getrootdir ());
+}
+
+static MonoString*
+ves_icall_System_Environment_GetWindowsFolderPath (int folder)
+{
+#if defined (PLATFORM_WIN32)
+ #ifndef CSIDL_FLAG_CREATE
+ #define CSIDL_FLAG_CREATE 0x8000
+ #endif
+
+ WCHAR path [MAX_PATH];
+ /* Create directory if no existing */
+ if (SUCCEEDED (SHGetFolderPathW (NULL, folder | CSIDL_FLAG_CREATE, NULL, 0, path))) {
+ int len = 0;
+ while (path [len])
+ ++ len;
+ return mono_string_new_utf16 (mono_domain_get (), path, len);
+ }
+#else
+ g_warning ("ves_icall_System_Environment_GetWindowsFolderPath should only be called on Windows!");
+#endif
+ return mono_string_new (mono_domain_get (), "");
+}
+
+static MonoArray *
+ves_icall_System_Environment_GetLogicalDrives (void)
+{
+ gunichar2 buf [128], *ptr, *dname;
+ gchar *u8;
+ gint initial_size = 127, size = 128;
+ gint ndrives;
+ MonoArray *result;
+ MonoString *drivestr;
+ MonoDomain *domain = mono_domain_get ();
+
+ MONO_ARCH_SAVE_REGS;
+
+ buf [0] = '\0';
+ ptr = buf;
+
+ while (size > initial_size) {
+ size = GetLogicalDriveStrings (initial_size, ptr);
+ if (size > initial_size) {
+ if (ptr != buf)
+ g_free (ptr);
+ ptr = g_malloc0 ((size + 1) * sizeof (gunichar2));
+ initial_size = size;
+ size++;
+ }
+ }
+
+ /* Count strings */
+ dname = ptr;
+ ndrives = 0;
+ do {
+ while (*dname++);
+ ndrives++;
+ } while (*dname);
+
+ dname = ptr;
+ result = mono_array_new (domain, mono_defaults.string_class, ndrives);
+ ndrives = 0;
+ do {
+ u8 = g_utf16_to_utf8 (dname, -1, NULL, NULL, NULL);
+ drivestr = mono_string_new (domain, u8);
+ g_free (u8);
+ mono_array_set (result, gpointer, ndrives++, drivestr);
+ while (*dname++);
+ } while (*dname);
+
+ if (ptr != buf)
+ g_free (ptr);
+
+ return result;
+}
+
+static MonoString *
+ves_icall_System_Environment_InternalGetHome (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_string_new (mono_domain_get (), g_get_home_dir ());
+}
+
+static const char *encodings [] = {
+ (char *) 1,
+ "ascii", "us_ascii", "us", "ansi_x3.4_1968",
+ "ansi_x3.4_1986", "cp367", "csascii", "ibm367",
+ "iso_ir_6", "iso646_us", "iso_646.irv:1991",
+ (char *) 2,
+ "utf_7", "csunicode11utf7", "unicode_1_1_utf_7",
+ "unicode_2_0_utf_7", "x_unicode_1_1_utf_7",
+ "x_unicode_2_0_utf_7",
+ (char *) 3,
+ "utf_8", "unicode_1_1_utf_8", "unicode_2_0_utf_8",
+ "x_unicode_1_1_utf_8", "x_unicode_2_0_utf_8",
+ (char *) 4,
+ "utf_16", "UTF_16LE", "ucs_2", "unicode",
+ "iso_10646_ucs2",
+ (char *) 5,
+ "unicodefffe", "utf_16be",
+ (char *) 6,
+ "iso_8859_1",
+ (char *) 0
+};
+
+/*
+ * Returns the internal codepage, if the value of "int_code_page" is
+ * 1 at entry, and we can not compute a suitable code page number,
+ * returns the code page as a string
+ */
+static MonoString*
+ves_icall_System_Text_Encoding_InternalCodePage (gint32 *int_code_page)
+{
+ const char *cset;
+ const char *p;
+ char *c;
+ char *codepage = NULL;
+ int code;
+ int want_name = *int_code_page;
+ int i;
+
+ *int_code_page = -1;
+ MONO_ARCH_SAVE_REGS;
+
+ g_get_charset (&cset);
+ c = codepage = strdup (cset);
+ for (c = codepage; *c; c++){
+ if (isascii (*c) && isalpha (*c))
+ *c = tolower (*c);
+ if (*c == '-')
+ *c = '_';
+ }
+ /* g_print ("charset: %s\n", cset); */
+
+ /* handle some common aliases */
+ p = encodings [0];
+ code = 0;
+ for (i = 0; p != 0; ){
+ if ((gssize) p < 7){
+ code = (gssize) p;
+ p = encodings [++i];
+ continue;
+ }
+ if (strcmp (p, codepage) == 0){
+ *int_code_page = code;
+ break;
+ }
+ p = encodings [++i];
+ }
+
+ if (strstr (codepage, "utf_8") != NULL)
+ *int_code_page |= 0x10000000;
+ free (codepage);
+
+ if (want_name && *int_code_page == -1)
+ return mono_string_new (mono_domain_get (), cset);
+ else
+ return NULL;
+}
+
+static MonoBoolean
+ves_icall_System_Environment_get_HasShutdownStarted (void)
+{
+ if (mono_runtime_is_shutting_down ())
+ return TRUE;
+
+ if (mono_domain_is_unloading (mono_domain_get ()))
+ return TRUE;
+
+ return FALSE;
+}
+
static void
ves_icall_MonoMethodMessage_InitMessage (MonoMethodMessage *this,
MonoReflectionMethod *method,
MonoArray *out_args)
{
- MonoDomain *domain = mono_domain_get ();
-
- mono_message_init (domain, this, method, out_args);
+ MONO_ARCH_SAVE_REGS;
+
+ mono_message_init (mono_object_domain (this), this, method, out_args);
}
static MonoBoolean
ves_icall_IsTransparentProxy (MonoObject *proxy)
{
+ MONO_ARCH_SAVE_REGS;
+
if (!proxy)
return 0;
@@ -2332,480 +5261,1608 @@ ves_icall_IsTransparentProxy (MonoObject *proxy)
return 0;
}
+static void
+ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation (MonoReflectionType *type, MonoBoolean enable)
+{
+ MonoClass *klass;
+ MonoVTable* vtable;
-/* icall map */
-
-static gconstpointer icall_map [] = {
- /*
- * System.Array
- */
- "System.Array::GetValue", ves_icall_System_Array_GetValue,
- "System.Array::SetValue", ves_icall_System_Array_SetValue,
- "System.Array::GetValueImpl", ves_icall_System_Array_GetValueImpl,
- "System.Array::SetValueImpl", ves_icall_System_Array_SetValueImpl,
- "System.Array::GetRank", ves_icall_System_Array_GetRank,
- "System.Array::GetLength", ves_icall_System_Array_GetLength,
- "System.Array::GetLowerBound", ves_icall_System_Array_GetLowerBound,
- "System.Array::CreateInstanceImpl", ves_icall_System_Array_CreateInstanceImpl,
- "System.Array::FastCopy", ves_icall_System_Array_FastCopy,
- "System.Array::Clone", mono_array_clone,
+ MONO_ARCH_SAVE_REGS;
- /*
- * System.Object
- */
- "System.Object::MemberwiseClone", ves_icall_System_Object_MemberwiseClone,
- "System.Object::GetType", ves_icall_System_Object_GetType,
- "System.Object::GetHashCode", ves_icall_System_Object_GetHashCode,
- "System.Object::obj_address", ves_icall_System_Object_obj_address,
+ klass = mono_class_from_mono_type (type->type);
+ vtable = mono_class_vtable (mono_domain_get (), klass);
- /*
- * System.ValueType
- */
- "System.ValueType::GetHashCode", ves_icall_System_ValueType_GetHashCode,
- "System.ValueType::Equals", ves_icall_System_ValueType_Equals,
+ if (enable) vtable->remote = 1;
+ else vtable->remote = 0;
+}
- /*
- * System.String
- */
+static MonoObject *
+ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClassInstance (MonoReflectionType *type)
+{
+ MonoClass *klass;
+ MonoDomain *domain;
- "System.String::.ctor(char*)", ves_icall_System_String_ctor_charp,
- "System.String::.ctor(char*,int,int)", ves_icall_System_String_ctor_charp_int_int,
- "System.String::.ctor(sbyte*)", ves_icall_System_String_ctor_sbytep,
- "System.String::.ctor(sbyte*,int,int)", ves_icall_System_String_ctor_sbytep_int_int,
- "System.String::.ctor(sbyte*,int,int,System.Text.Encoding)", ves_icall_System_String_ctor_encoding,
- "System.String::.ctor(char[])", ves_icall_System_String_ctor_chara,
- "System.String::.ctor(char[],int,int)", ves_icall_System_String_ctor_chara_int_int,
- "System.String::.ctor(char,int)", ves_icall_System_String_ctor_char_int,
- "System.String::InternalEquals", ves_icall_System_String_InternalEquals,
- "System.String::InternalJoin", ves_icall_System_String_InternalJoin,
- "System.String::InternalInsert", ves_icall_System_String_InternalInsert,
- "System.String::InternalReplace(char,char)", ves_icall_System_String_InternalReplace_Char,
- "System.String::InternalReplace(string,string)", ves_icall_System_String_InternalReplace_Str,
- "System.String::InternalRemove", ves_icall_System_String_InternalRemove,
- "System.String::InternalCopyTo", ves_icall_System_String_InternalCopyTo,
- "System.String::InternalSplit", ves_icall_System_String_InternalSplit,
- "System.String::InternalTrim", ves_icall_System_String_InternalTrim,
- "System.String::InternalIndexOf(char,int,int)", ves_icall_System_String_InternalIndexOf_Char,
- "System.String::InternalIndexOf(string,int,int)", ves_icall_System_String_InternalIndexOf_Str,
- "System.String::InternalIndexOfAny", ves_icall_System_String_InternalIndexOfAny,
- "System.String::InternalLastIndexOf(char,int,int)", ves_icall_System_String_InternalLastIndexOf_Char,
- "System.String::InternalLastIndexOf(string,int,int)", ves_icall_System_String_InternalLastIndexOf_Str,
- "System.String::InternalLastIndexOfAny", ves_icall_System_String_InternalLastIndexOfAny,
- "System.String::InternalPad", ves_icall_System_String_InternalPad,
- "System.String::InternalToLower", ves_icall_System_String_InternalToLower,
- "System.String::InternalToUpper", ves_icall_System_String_InternalToUpper,
- "System.String::InternalAllocateStr", ves_icall_System_String_InternalAllocateStr,
- "System.String::InternalStrcpy(string,int,string)", ves_icall_System_String_InternalStrcpy_Str,
- "System.String::InternalStrcpy(string,int,string,int,int)", ves_icall_System_String_InternalStrcpy_StrN,
- "System.String::InternalIntern", ves_icall_System_String_InternalIntern,
- "System.String::InternalIsInterned", ves_icall_System_String_InternalIsInterned,
- "System.String::InternalCompare(string,int,string,int,int,bool)", ves_icall_System_String_InternalCompareStr_N,
- "System.String::GetHashCode", ves_icall_System_String_GetHashCode,
- "System.String::get_Chars", ves_icall_System_String_get_Chars,
+ MONO_ARCH_SAVE_REGS;
- /*
- * System.AppDomain
- */
- "System.AppDomain::createDomain", ves_icall_System_AppDomain_createDomain,
- "System.AppDomain::getCurDomain", ves_icall_System_AppDomain_getCurDomain,
- "System.AppDomain::GetData", ves_icall_System_AppDomain_GetData,
- "System.AppDomain::SetData", ves_icall_System_AppDomain_SetData,
- "System.AppDomain::getSetup", ves_icall_System_AppDomain_getSetup,
- "System.AppDomain::getFriendlyName", ves_icall_System_AppDomain_getFriendlyName,
- "System.AppDomain::GetAssemblies", ves_icall_System_AppDomain_GetAssemblies,
- "System.AppDomain::LoadAssembly", ves_icall_System_AppDomain_LoadAssembly,
- "System.AppDomain::Unload", ves_icall_System_AppDomain_Unload,
- "System.AppDomain::ExecuteAssembly", ves_icall_System_AppDomain_ExecuteAssembly,
+ domain = mono_object_domain (type);
+ klass = mono_class_from_mono_type (type->type);
- /*
- * System.AppDomainSetup
- */
- "System.AppDomainSetup::InitAppDomainSetup", ves_icall_System_AppDomainSetup_InitAppDomainSetup,
+ if (klass->rank >= 1) {
+ g_assert (klass->rank == 1);
+ return (MonoObject *) mono_array_new (domain, klass->element_class, 0);
+ } else {
+ /* Bypass remoting object creation check */
+ return mono_object_new_alloc_specific (mono_class_vtable (domain, klass));
+ }
+}
- /*
- * System.Double
- */
- "System.Double::ToStringImpl", mono_double_ToStringImpl,
- "System.Double::ParseImpl", mono_double_ParseImpl,
+static MonoString *
+ves_icall_System_IO_get_temp_path (void)
+{
+ MONO_ARCH_SAVE_REGS;
- /*
- * System.Single
- */
- "System.Single::ToStringImpl", mono_float_ToStringImpl,
+ return mono_string_new (mono_domain_get (), g_get_tmp_dir ());
+}
- /*
- * System.Decimal
- */
- "System.Decimal::decimal2UInt64", mono_decimal2UInt64,
- "System.Decimal::decimal2Int64", mono_decimal2Int64,
- "System.Decimal::double2decimal", mono_double2decimal, /* FIXME: wrong signature. */
- "System.Decimal::decimalIncr", mono_decimalIncr,
- "System.Decimal::decimalSetExponent", mono_decimalSetExponent,
- "System.Decimal::decimal2double", mono_decimal2double,
- "System.Decimal::decimalFloorAndTrunc", mono_decimalFloorAndTrunc,
- "System.Decimal::decimalRound", mono_decimalRound,
- "System.Decimal::decimalMult", mono_decimalMult,
- "System.Decimal::decimalDiv", mono_decimalDiv,
- "System.Decimal::decimalIntDiv", mono_decimalIntDiv,
- "System.Decimal::decimalCompare", mono_decimalCompare,
- "System.Decimal::string2decimal", mono_string2decimal,
- "System.Decimal::decimal2string", mono_decimal2string,
+static gpointer
+ves_icall_RuntimeMethod_GetFunctionPointer (MonoMethod *method)
+{
+ MONO_ARCH_SAVE_REGS;
- /*
- * ModuleBuilder
- */
- "System.Reflection.Emit.ModuleBuilder::create_modified_type", ves_icall_ModuleBuilder_create_modified_type,
-
- /*
- * AssemblyBuilder
- */
- "System.Reflection.Emit.AssemblyBuilder::getDataChunk", ves_icall_AssemblyBuilder_getDataChunk,
- "System.Reflection.Emit.AssemblyBuilder::getUSIndex", mono_image_insert_string,
- "System.Reflection.Emit.AssemblyBuilder::getToken", ves_icall_AssemblyBuilder_getToken,
- "System.Reflection.Emit.AssemblyBuilder::basic_init", mono_image_basic_init,
+ return mono_compile_method (method);
+}
- /*
- * Reflection stuff.
- */
- "System.Reflection.MonoMethodInfo::get_method_info", ves_icall_get_method_info,
- "System.Reflection.MonoMethodInfo::get_parameter_info", ves_icall_get_parameter_info,
- "System.Reflection.MonoFieldInfo::get_field_info", ves_icall_get_field_info,
- "System.Reflection.MonoPropertyInfo::get_property_info", ves_icall_get_property_info,
- "System.Reflection.MonoEventInfo::get_event_info", ves_icall_get_event_info,
- "System.Reflection.MonoMethod::InternalInvoke", ves_icall_InternalInvoke,
- "System.Reflection.MonoCMethod::InternalInvoke", ves_icall_InternalInvoke,
- "System.MonoCustomAttrs::GetCustomAttributes", mono_reflection_get_custom_attrs,
- "System.Reflection.Emit.CustomAttributeBuilder::GetBlob", mono_reflection_get_custom_attrs_blob,
- "System.Reflection.MonoField::GetValue", ves_icall_MonoField_GetValue,
- "System.Reflection.Emit.SignatureHelper::get_signature_local", mono_reflection_sighelper_get_signature_local,
- "System.Reflection.Emit.SignatureHelper::get_signature_field", mono_reflection_sighelper_get_signature_field,
+static MonoString *
+ves_icall_System_Configuration_DefaultConfig_get_machine_config_path (void)
+{
+ MonoString *mcpath;
+ gchar *path;
-
- /* System.Enum */
+ MONO_ARCH_SAVE_REGS;
- "System.MonoEnumInfo::get_enum_info", ves_icall_get_enum_info,
- "System.Enum::get_value", ves_icall_System_Enum_get_value,
- "System.Enum::ToObject", ves_icall_System_Enum_ToObject,
+ path = g_build_path (G_DIR_SEPARATOR_S, mono_get_config_dir (), "mono", mono_get_framework_version (), "machine.config", NULL);
- /*
- * TypeBuilder
- */
- "System.Reflection.Emit.TypeBuilder::setup_internal_class", mono_reflection_setup_internal_class,
- "System.Reflection.Emit.TypeBuilder::create_internal_class", mono_reflection_create_internal_class,
+#if defined (PLATFORM_WIN32)
+ /* Avoid mixing '/' and '\\' */
+ {
+ gint i;
+ for (i = strlen (path) - 1; i >= 0; i--)
+ if (path [i] == '/')
+ path [i] = '\\';
+ }
+#endif
+ mcpath = mono_string_new (mono_domain_get (), path);
+ g_free (path);
+
+ return mcpath;
+}
+
+static MonoString *
+ves_icall_System_Web_Util_ICalls_get_machine_install_dir (void)
+{
+ MonoString *ipath;
+ gchar *path;
+
+ MONO_ARCH_SAVE_REGS;
+
+ path = g_path_get_dirname (mono_get_config_dir ());
+
+#if defined (PLATFORM_WIN32)
+ /* Avoid mixing '/' and '\\' */
+ {
+ gint i;
+ for (i = strlen (path) - 1; i >= 0; i--)
+ if (path [i] == '/')
+ path [i] = '\\';
+ }
+#endif
+ ipath = mono_string_new (mono_domain_get (), path);
+ g_free (path);
+
+ return ipath;
+}
+
+static void
+ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString (MonoString *message)
+{
+#if defined (PLATFORM_WIN32)
+ static void (*output_debug) (gchar *);
+ static gboolean tried_loading = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!tried_loading && output_debug == NULL) {
+ GModule *k32;
+
+ tried_loading = TRUE;
+ k32 = g_module_open ("kernel32", G_MODULE_BIND_LAZY);
+ if (!k32) {
+ gchar *error = g_strdup (g_module_error ());
+ g_warning ("Failed to load kernel32.dll: %s\n", error);
+ g_free (error);
+ return;
+ }
+
+ g_module_symbol (k32, "OutputDebugStringW", (gpointer *) &output_debug);
+ if (!output_debug) {
+ gchar *error = g_strdup (g_module_error ());
+ g_warning ("Failed to load OutputDebugStringW: %s\n", error);
+ g_free (error);
+ return;
+ }
+ }
+ if (output_debug == NULL)
+ return;
- /*
- * MethodBuilder
- */
+ output_debug (mono_string_chars (message));
+#else
+ g_warning ("WriteWindowsDebugString called and PLATFORM_WIN32 not defined!\n");
+#endif
+}
+
+/* Only used for value types */
+static MonoObject *
+ves_icall_System_Activator_CreateInstanceInternal (MonoReflectionType *type)
+{
+ MonoClass *klass;
+ MonoDomain *domain;
- /*
- * System.Type
- */
- "System.Type::internal_from_name", ves_icall_type_from_name,
- "System.Type::internal_from_handle", ves_icall_type_from_handle,
- "System.Type::get_constructor", ves_icall_get_constructor,
- "System.Type::get_property", ves_icall_get_property,
- "System.Type::get_method", ves_icall_get_method,
- "System.MonoType::get_attributes", ves_icall_get_attributes,
- "System.Type::type_is_subtype_of", ves_icall_type_is_subtype_of,
- "System.Type::Equals", ves_icall_type_Equals,
+ MONO_ARCH_SAVE_REGS;
- /*
- * System.Runtime.CompilerServices.RuntimeHelpers
- */
- "System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray", ves_icall_InitializeArray,
+ domain = mono_object_domain (type);
+ klass = mono_class_from_mono_type (type->type);
+
+ return mono_object_new (domain, klass);
+}
+
+static MonoReflectionMethod *
+ves_icall_MonoMethod_get_base_definition (MonoReflectionMethod *m)
+{
+ MonoClass *klass;
+ MonoMethod *method = m->method;
+ MonoMethod *result = NULL;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (!(method->flags & METHOD_ATTRIBUTE_VIRTUAL) ||
+ MONO_CLASS_IS_INTERFACE (method->klass) ||
+ method->flags & METHOD_ATTRIBUTE_NEW_SLOT)
+ return m;
+
+ if (method->klass == NULL || (klass = method->klass->parent) == NULL)
+ return m;
+
+ if (klass->generic_inst)
+ klass = mono_class_from_mono_type (klass->generic_inst->generic_type);
+
+ while (result == NULL && klass != NULL && (klass->vtable_size > method->slot))
+ {
+ result = klass->vtable [method->slot];
+ if (result == NULL) {
+ /* It is an abstract method */
+ int i;
+ for (i=0; i<klass->method.count; i++) {
+ if (klass->methods [i]->slot == method->slot) {
+ result = klass->methods [i];
+ break;
+ }
+ }
+ }
+ klass = klass->parent;
+ }
+
+ if (result == NULL)
+ return m;
+
+ return mono_method_get_object (mono_domain_get (), result, NULL);
+}
+
+static void
+mono_ArgIterator_Setup (MonoArgIterator *iter, char* argsp, char* start)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ iter->sig = *(MonoMethodSignature**)argsp;
- /*
- * System.Threading
- */
- "System.Threading.Thread::Thread_internal", ves_icall_System_Threading_Thread_Thread_internal,
- "System.Threading.Thread::Thread_free_internal", ves_icall_System_Threading_Thread_Thread_free_internal,
- "System.Threading.Thread::Start_internal", ves_icall_System_Threading_Thread_Start_internal,
- "System.Threading.Thread::Sleep_internal", ves_icall_System_Threading_Thread_Sleep_internal,
- "System.Threading.Thread::CurrentThread_internal", ves_icall_System_Threading_Thread_CurrentThread_internal,
- "System.Threading.Thread::CurrentThreadDomain_internal", ves_icall_System_Threading_Thread_CurrentThreadDomain_internal,
- "System.Threading.Thread::Join_internal", ves_icall_System_Threading_Thread_Join_internal,
- "System.Threading.Thread::SlotHash_lookup", ves_icall_System_Threading_Thread_SlotHash_lookup,
- "System.Threading.Thread::SlotHash_store", ves_icall_System_Threading_Thread_SlotHash_store,
- "System.Threading.Monitor::Monitor_exit", ves_icall_System_Threading_Monitor_Monitor_exit,
- "System.Threading.Monitor::Monitor_test_owner", ves_icall_System_Threading_Monitor_Monitor_test_owner,
- "System.Threading.Monitor::Monitor_test_synchronised", ves_icall_System_Threading_Monitor_Monitor_test_synchronised,
- "System.Threading.Monitor::Monitor_pulse", ves_icall_System_Threading_Monitor_Monitor_pulse,
- "System.Threading.Monitor::Monitor_pulse_all", ves_icall_System_Threading_Monitor_Monitor_pulse_all,
- "System.Threading.Monitor::Monitor_try_enter", ves_icall_System_Threading_Monitor_Monitor_try_enter,
- "System.Threading.Monitor::Monitor_wait", ves_icall_System_Threading_Monitor_Monitor_wait,
- "System.Threading.Mutex::CreateMutex_internal", ves_icall_System_Threading_Mutex_CreateMutex_internal,
- "System.Threading.Mutex::ReleaseMutex_internal", ves_icall_System_Threading_Mutex_ReleaseMutex_internal,
- "System.Threading.NativeEventCalls::CreateEvent_internal", ves_icall_System_Threading_Events_CreateEvent_internal,
- "System.Threading.NativeEventCalls::SetEvent_internal", ves_icall_System_Threading_Events_SetEvent_internal,
- "System.Threading.NativeEventCalls::ResetEvent_internal", ves_icall_System_Threading_Events_ResetEvent_internal,
+ g_assert (iter->sig->sentinelpos <= iter->sig->param_count);
+ g_assert (iter->sig->call_convention == MONO_CALL_VARARG);
- /*
- * System.Threading.WaitHandle
- */
- "System.Threading.WaitHandle::WaitAll_internal", ves_icall_System_Threading_WaitHandle_WaitAll_internal,
- "System.Threading.WaitHandle::WaitAny_internal", ves_icall_System_Threading_WaitHandle_WaitAny_internal,
- "System.Threading.WaitHandle::WaitOne_internal", ves_icall_System_Threading_WaitHandle_WaitOne_internal,
+ iter->next_arg = 0;
+ /* FIXME: it's not documented what start is exactly... */
+ if (start) {
+ iter->args = start;
+ } else {
+ int i, align, arg_size;
+ iter->args = argsp + sizeof (gpointer);
+ for (i = 0; i < iter->sig->sentinelpos; ++i) {
+ arg_size = mono_type_stack_size (iter->sig->params [i], &align);
+ iter->args = (char*)iter->args + arg_size;
+ }
+ }
+ iter->num_args = iter->sig->param_count - iter->sig->sentinelpos;
- /*
- * System.Runtime.InteropServices.Marshal
- */
- "System.Runtime.InteropServices.Marshal::ReadIntPtr", ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr,
- "System.Runtime.InteropServices.Marshal::ReadByte", ves_icall_System_Runtime_InteropServices_Marshal_ReadByte,
- "System.Runtime.InteropServices.Marshal::ReadInt16", ves_icall_System_Runtime_InteropServices_Marshal_ReadInt16,
- "System.Runtime.InteropServices.Marshal::ReadInt32", ves_icall_System_Runtime_InteropServices_Marshal_ReadInt32,
- "System.Runtime.InteropServices.Marshal::ReadInt64", ves_icall_System_Runtime_InteropServices_Marshal_ReadInt64,
- "System.Runtime.InteropServices.Marshal::WriteIntPtr", ves_icall_System_Runtime_InteropServices_Marshal_WriteIntPtr,
- "System.Runtime.InteropServices.Marshal::WriteByte", ves_icall_System_Runtime_InteropServices_Marshal_WriteByte,
- "System.Runtime.InteropServices.Marshal::WriteInt16", ves_icall_System_Runtime_InteropServices_Marshal_WriteInt16,
- "System.Runtime.InteropServices.Marshal::WriteInt32", ves_icall_System_Runtime_InteropServices_Marshal_WriteInt32,
- "System.Runtime.InteropServices.Marshal::WriteInt64", ves_icall_System_Runtime_InteropServices_Marshal_WriteInt64,
- "System.Runtime.InteropServices.Marshal::PtrToStringAuto", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto,
- "System.Runtime.InteropServices.Marshal::GetLastWin32Error", ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error,
- "System.Runtime.InteropServices.Marshal::AllocHGlobal", mono_marshal_alloc,
- "System.Runtime.InteropServices.Marshal::FreeHGlobal", mono_marshal_free,
- "System.Runtime.InteropServices.Marshal::ReAllocHGlobal", mono_marshal_realloc,
- "System.Runtime.InteropServices.Marshal::copy_to_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged,
- "System.Runtime.InteropServices.Marshal::copy_from_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged,
-
-
- "System.Reflection.Assembly::LoadFrom", ves_icall_System_Reflection_Assembly_LoadFrom,
- "System.Reflection.Assembly::GetType", ves_icall_System_Reflection_Assembly_GetType,
- "System.Reflection.Assembly::GetTypes", ves_icall_System_Reflection_Assembly_GetTypes,
- "System.Reflection.Assembly::FillName", ves_icall_System_Reflection_Assembly_FillName,
- "System.Reflection.Assembly::get_code_base", ves_icall_System_Reflection_Assembly_get_code_base,
+ /* g_print ("sig %p, param_count: %d, sent: %d\n", iter->sig, iter->sig->param_count, iter->sig->sentinelpos); */
+}
- /*
- * System.MonoType.
- */
- "System.MonoType::getFullName", ves_icall_System_MonoType_getFullName,
- "System.MonoType::type_from_obj", mono_type_type_from_obj,
- "System.MonoType::GetElementType", ves_icall_MonoType_GetElementType,
- "System.MonoType::get_type_info", ves_icall_get_type_info,
- "System.MonoType::GetField", ves_icall_Type_GetField,
- "System.MonoType::GetFields", ves_icall_Type_GetFields,
- "System.MonoType::GetMethods", ves_icall_Type_GetMethods,
- "System.MonoType::GetConstructors", ves_icall_Type_GetConstructors,
- "System.MonoType::GetProperties", ves_icall_Type_GetProperties,
- "System.MonoType::GetEvents", ves_icall_Type_GetEvents,
- "System.MonoType::GetInterfaces", ves_icall_Type_GetInterfaces,
- "System.MonoType::GetNestedTypes", ves_icall_Type_GetNestedTypes,
+static MonoTypedRef
+mono_ArgIterator_IntGetNextArg (MonoArgIterator *iter)
+{
+ gint i, align, arg_size;
+ MonoTypedRef res;
+ MONO_ARCH_SAVE_REGS;
- /*
- * System.Net.Sockets I/O Services
- */
- "System.Net.Sockets.Socket::Socket_internal", ves_icall_System_Net_Sockets_Socket_Socket_internal,
- "System.Net.Sockets.Socket::Close_internal", ves_icall_System_Net_Sockets_Socket_Close_internal,
- "System.Net.Sockets.SocketException::WSAGetLastError_internal", ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal,
- "System.Net.Sockets.Socket::Available_internal", ves_icall_System_Net_Sockets_Socket_Available_internal,
- "System.Net.Sockets.Socket::Blocking_internal", ves_icall_System_Net_Sockets_Socket_Blocking_internal,
- "System.Net.Sockets.Socket::Accept_internal", ves_icall_System_Net_Sockets_Socket_Accept_internal,
- "System.Net.Sockets.Socket::Listen_internal", ves_icall_System_Net_Sockets_Socket_Listen_internal,
- "System.Net.Sockets.Socket::LocalEndPoint_internal", ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal,
- "System.Net.Sockets.Socket::RemoteEndPoint_internal", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal,
- "System.Net.Sockets.Socket::Bind_internal", ves_icall_System_Net_Sockets_Socket_Bind_internal,
- "System.Net.Sockets.Socket::Connect_internal", ves_icall_System_Net_Sockets_Socket_Connect_internal,
- "System.Net.Sockets.Socket::Receive_internal", ves_icall_System_Net_Sockets_Socket_Receive_internal,
- "System.Net.Sockets.Socket::RecvFrom_internal", ves_icall_System_Net_Sockets_Socket_RecvFrom_internal,
- "System.Net.Sockets.Socket::Send_internal", ves_icall_System_Net_Sockets_Socket_Send_internal,
- "System.Net.Sockets.Socket::SendTo_internal", ves_icall_System_Net_Sockets_Socket_SendTo_internal,
- "System.Net.Sockets.Socket::Select_internal", ves_icall_System_Net_Sockets_Socket_Select_internal,
- "System.Net.Sockets.Socket::Shutdown_internal", ves_icall_System_Net_Sockets_Socket_Shutdown_internal,
- "System.Net.Sockets.Socket::GetSocketOption_obj_internal", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal,
- "System.Net.Sockets.Socket::GetSocketOption_arr_internal", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal,
- "System.Net.Sockets.Socket::SetSocketOption_internal", ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal,
- "System.Net.Dns::GetHostByName_internal", ves_icall_System_Net_Dns_GetHostByName_internal,
- "System.Net.Dns::GetHostByAddr_internal", ves_icall_System_Net_Dns_GetHostByAddr_internal,
+ i = iter->sig->sentinelpos + iter->next_arg;
- /*
- * System.Char
- */
- "System.Char::GetNumericValue", ves_icall_System_Char_GetNumericValue,
- "System.Char::GetUnicodeCategory", ves_icall_System_Char_GetUnicodeCategory,
- "System.Char::IsControl", ves_icall_System_Char_IsControl,
- "System.Char::IsDigit", ves_icall_System_Char_IsDigit,
- "System.Char::IsLetter", ves_icall_System_Char_IsLetter,
- "System.Char::IsLower", ves_icall_System_Char_IsLower,
- "System.Char::IsUpper", ves_icall_System_Char_IsUpper,
- "System.Char::IsNumber", ves_icall_System_Char_IsNumber,
- "System.Char::IsPunctuation", ves_icall_System_Char_IsPunctuation,
- "System.Char::IsSeparator", ves_icall_System_Char_IsSeparator,
- "System.Char::IsSurrogate", ves_icall_System_Char_IsSurrogate,
- "System.Char::IsSymbol", ves_icall_System_Char_IsSymbol,
- "System.Char::IsWhiteSpace", ves_icall_System_Char_IsWhiteSpace,
- "System.Char::ToLower", ves_icall_System_Char_ToLower,
- "System.Char::ToUpper", ves_icall_System_Char_ToUpper,
-
- "System.Text.Encoding::IConvNewEncoder", ves_icall_iconv_new_encoder,
- "System.Text.Encoding::IConvNewDecoder", ves_icall_iconv_new_decoder,
- "System.Text.Encoding::IConvReset", ves_icall_iconv_reset,
- "System.Text.Encoding::IConvGetByteCount", ves_icall_iconv_get_byte_count,
- "System.Text.Encoding::IConvGetBytes", ves_icall_iconv_get_bytes,
- "System.Text.Encoding::IConvGetCharCount", ves_icall_iconv_get_char_count,
- "System.Text.Encoding::IConvGetChars", ves_icall_iconv_get_chars,
-
- "System.DateTime::GetNow", ves_icall_System_DateTime_GetNow,
- "System.CurrentTimeZone::GetTimeZoneData", ves_icall_System_CurrentTimeZone_GetTimeZoneData,
+ g_assert (i < iter->sig->param_count);
- /*
- * System.GC
- */
- "System.GC::InternalCollect", ves_icall_System_GC_InternalCollect,
- "System.GC::GetTotalMemory", ves_icall_System_GC_GetTotalMemory,
- "System.GC::KeepAlive", ves_icall_System_GC_KeepAlive,
- "System.GC::ReRegisterForFinalize", ves_icall_System_GC_ReRegisterForFinalize,
- "System.GC::SuppressFinalize", ves_icall_System_GC_SuppressFinalize,
- "System.GC::WaitForPendingFinalizers", ves_icall_System_GC_WaitForPendingFinalizers,
- "System.Runtime.InteropServices.GCHandle::GetTarget", ves_icall_System_GCHandle_GetTarget,
- "System.Runtime.InteropServices.GCHandle::GetTargetHandle", ves_icall_System_GCHandle_GetTargetHandle,
- "System.Runtime.InteropServices.GCHandle::FreeHandle", ves_icall_System_GCHandle_FreeHandle,
- "System.Runtime.InteropServices.GCHandle::GetAddrOfPinnedObject", ves_icall_System_GCHandle_GetAddrOfPinnedObject,
+ res.type = iter->sig->params [i];
+ res.klass = mono_class_from_mono_type (res.type);
+ /* FIXME: endianess issue... */
+ res.value = iter->args;
+ arg_size = mono_type_stack_size (res.type, &align);
+ iter->args = (char*)iter->args + arg_size;
+ iter->next_arg++;
- /*
- * System.Security.Cryptography calls
- */
+ /* g_print ("returning arg %d, type 0x%02x of size %d at %p\n", i, res.type->type, arg_size, res.value); */
+
+ return res;
+}
+
+static MonoTypedRef
+mono_ArgIterator_IntGetNextArgT (MonoArgIterator *iter, MonoType *type)
+{
+ gint i, align, arg_size;
+ MonoTypedRef res;
+ MONO_ARCH_SAVE_REGS;
+
+ i = iter->sig->sentinelpos + iter->next_arg;
+
+ g_assert (i < iter->sig->param_count);
+
+ while (i < iter->sig->param_count) {
+ if (!mono_metadata_type_equal (type, iter->sig->params [i]))
+ continue;
+ res.type = iter->sig->params [i];
+ res.klass = mono_class_from_mono_type (res.type);
+ /* FIXME: endianess issue... */
+ res.value = iter->args;
+ arg_size = mono_type_stack_size (res.type, &align);
+ iter->args = (char*)iter->args + arg_size;
+ iter->next_arg++;
+ /* g_print ("returning arg %d, type 0x%02x of size %d at %p\n", i, res.type->type, arg_size, res.value); */
+ return res;
+ }
+ /* g_print ("arg type 0x%02x not found\n", res.type->type); */
- "System.Security.Cryptography.RNGCryptoServiceProvider::GetBytes", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes,
- "System.Security.Cryptography.RNGCryptoServiceProvider::GetNonZeroBytes", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes,
+ res.type = NULL;
+ res.value = NULL;
+ res.klass = NULL;
+ return res;
+}
+
+static MonoType*
+mono_ArgIterator_IntGetNextArgType (MonoArgIterator *iter)
+{
+ gint i;
+ MONO_ARCH_SAVE_REGS;
- /*
- * System.Buffer
- */
- "System.Buffer::ByteLengthInternal", ves_icall_System_Buffer_ByteLengthInternal,
- "System.Buffer::GetByteInternal", ves_icall_System_Buffer_GetByteInternal,
- "System.Buffer::SetByteInternal", ves_icall_System_Buffer_SetByteInternal,
- "System.Buffer::BlockCopyInternal", ves_icall_System_Buffer_BlockCopyInternal,
+ i = iter->sig->sentinelpos + iter->next_arg;
- /*
- * System.IO.MonoIO
- */
- "System.IO.MonoIO::GetLastError", ves_icall_System_IO_MonoIO_GetLastError,
- "System.IO.MonoIO::CreateDirectory", ves_icall_System_IO_MonoIO_CreateDirectory,
- "System.IO.MonoIO::RemoveDirectory", ves_icall_System_IO_MonoIO_RemoveDirectory,
- "System.IO.MonoIO::FindFirstFile", ves_icall_System_IO_MonoIO_FindFirstFile,
- "System.IO.MonoIO::FindNextFile", ves_icall_System_IO_MonoIO_FindNextFile,
- "System.IO.MonoIO::FindClose", ves_icall_System_IO_MonoIO_FindClose,
- "System.IO.MonoIO::GetCurrentDirectory", ves_icall_System_IO_MonoIO_GetCurrentDirectory,
- "System.IO.MonoIO::SetCurrentDirectory", ves_icall_System_IO_MonoIO_SetCurrentDirectory,
- "System.IO.MonoIO::MoveFile", ves_icall_System_IO_MonoIO_MoveFile,
- "System.IO.MonoIO::CopyFile", ves_icall_System_IO_MonoIO_CopyFile,
- "System.IO.MonoIO::DeleteFile", ves_icall_System_IO_MonoIO_DeleteFile,
- "System.IO.MonoIO::GetFileAttributes", ves_icall_System_IO_MonoIO_GetFileAttributes,
- "System.IO.MonoIO::SetFileAttributes", ves_icall_System_IO_MonoIO_SetFileAttributes,
- "System.IO.MonoIO::GetFileStat", ves_icall_System_IO_MonoIO_GetFileStat,
- "System.IO.MonoIO::Open", ves_icall_System_IO_MonoIO_Open,
- "System.IO.MonoIO::Close", ves_icall_System_IO_MonoIO_Close,
- "System.IO.MonoIO::Read", ves_icall_System_IO_MonoIO_Read,
- "System.IO.MonoIO::Write", ves_icall_System_IO_MonoIO_Write,
- "System.IO.MonoIO::Seek", ves_icall_System_IO_MonoIO_Seek,
- "System.IO.MonoIO::GetLength", ves_icall_System_IO_MonoIO_GetLength,
- "System.IO.MonoIO::SetLength", ves_icall_System_IO_MonoIO_SetLength,
- "System.IO.MonoIO::SetFileTime", ves_icall_System_IO_MonoIO_SetFileTime,
- "System.IO.MonoIO::Flush", ves_icall_System_IO_MonoIO_Flush,
- "System.IO.MonoIO::get_ConsoleOutput", ves_icall_System_IO_MonoIO_get_ConsoleOutput,
- "System.IO.MonoIO::get_ConsoleInput", ves_icall_System_IO_MonoIO_get_ConsoleInput,
- "System.IO.MonoIO::get_ConsoleError", ves_icall_System_IO_MonoIO_get_ConsoleError,
- "System.IO.MonoIO::get_VolumeSeparatorChar", ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar,
- "System.IO.MonoIO::get_DirectorySeparatorChar", ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar,
- "System.IO.MonoIO::get_AltDirectorySeparatorChar", ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar,
- "System.IO.MonoIO::get_PathSeparator", ves_icall_System_IO_MonoIO_get_PathSeparator,
- "System.IO.MonoIO::get_InvalidPathChars", ves_icall_System_IO_MonoIO_get_InvalidPathChars,
+ g_assert (i < iter->sig->param_count);
- /*
- * System.Math
- */
- "System.Math::Sin", ves_icall_System_Math_Sin,
- "System.Math::Cos", ves_icall_System_Math_Cos,
- "System.Math::Tan", ves_icall_System_Math_Tan,
- "System.Math::Sinh", ves_icall_System_Math_Sinh,
- "System.Math::Cosh", ves_icall_System_Math_Cosh,
- "System.Math::Tanh", ves_icall_System_Math_Tanh,
- "System.Math::Acos", ves_icall_System_Math_Acos,
- "System.Math::Asin", ves_icall_System_Math_Asin,
- "System.Math::Atan", ves_icall_System_Math_Atan,
- "System.Math::Atan2", ves_icall_System_Math_Atan2,
- "System.Math::Exp", ves_icall_System_Math_Exp,
- "System.Math::Log", ves_icall_System_Math_Log,
- "System.Math::Log10", ves_icall_System_Math_Log10,
- "System.Math::PowImpl", ves_icall_System_Math_Pow,
- "System.Math::Sqrt", ves_icall_System_Math_Sqrt,
+ return iter->sig->params [i];
+}
+
+static MonoObject*
+mono_TypedReference_ToObject (MonoTypedRef tref)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (MONO_TYPE_IS_REFERENCE (tref.type)) {
+ MonoObject** objp = tref.value;
+ return *objp;
+ }
+
+ return mono_value_box (mono_domain_get (), tref.klass, tref.value);
+}
+static void
+prelink_method (MonoMethod *method)
+{
+ const char *exc_class, *exc_arg;
+ if (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ return;
+ mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
+ if (exc_class) {
+ mono_raise_exception(
+ mono_exception_from_name_msg (mono_defaults.corlib, "System", exc_class, exc_arg ) );
+ }
+ /* create the wrapper, too? */
+}
+
+static void
+ves_icall_System_Runtime_InteropServices_Marshal_Prelink (MonoReflectionMethod *method)
+{
+ MONO_ARCH_SAVE_REGS;
+ prelink_method (method->method);
+}
+
+static void
+ves_icall_System_Runtime_InteropServices_Marshal_PrelinkAll (MonoReflectionType *type)
+{
+ MonoClass *klass = mono_class_from_mono_type (type->type);
+ int i;
+ MONO_ARCH_SAVE_REGS;
+
+ mono_class_init (klass);
+ for (i = 0; i < klass->method.count; ++i)
+ prelink_method (klass->methods [i]);
+}
+
+/* These parameters are "readonly" in corlib/System/Char.cs */
+static void
+ves_icall_System_Char_GetDataTablePointers (guint8 const **category_data,
+ guint8 const **numeric_data,
+ gdouble const **numeric_data_values,
+ guint16 const **to_lower_data_low,
+ guint16 const **to_lower_data_high,
+ guint16 const **to_upper_data_low,
+ guint16 const **to_upper_data_high)
+{
+ *category_data = CategoryData;
+ *numeric_data = NumericData;
+ *numeric_data_values = NumericDataValues;
+ *to_lower_data_low = ToLowerDataLow;
+ *to_lower_data_high = ToLowerDataHigh;
+ *to_upper_data_low = ToUpperDataLow;
+ *to_upper_data_high = ToUpperDataHigh;
+}
+
+static MonoString *
+ves_icall_MonoDebugger_check_runtime_version (MonoString *fname)
+{
+ gchar *filename, *error = NULL;
+
+ MONO_ARCH_SAVE_REGS;
+
+ filename = mono_string_to_utf8 (fname);
+ error = mono_debugger_check_runtime_version (filename);
+ g_free (filename);
+
+ if (error)
+ return mono_string_new (mono_domain_get (), error);
+ else
+ return NULL;
+}
+
+/* icall map */
+typedef struct {
+ const char *method;
+ gconstpointer func;
+} IcallEntry;
+
+typedef struct {
+ const char *klass;
+ const IcallEntry *icalls;
+ const int size;
+} IcallMap;
+
+static const IcallEntry activator_icalls [] = {
+ {"CreateInstanceInternal", ves_icall_System_Activator_CreateInstanceInternal}
+};
+static const IcallEntry appdomain_icalls [] = {
+ {"ExecuteAssembly", ves_icall_System_AppDomain_ExecuteAssembly},
+ {"GetAssemblies", ves_icall_System_AppDomain_GetAssemblies},
+ {"GetData", ves_icall_System_AppDomain_GetData},
+ {"InternalGetContext", ves_icall_System_AppDomain_InternalGetContext},
+ {"InternalGetDefaultContext", ves_icall_System_AppDomain_InternalGetDefaultContext},
+ {"InternalGetProcessGuid", ves_icall_System_AppDomain_InternalGetProcessGuid},
+ {"InternalIsFinalizingForUnload", ves_icall_System_AppDomain_InternalIsFinalizingForUnload},
+ {"InternalPopDomainRef", ves_icall_System_AppDomain_InternalPopDomainRef},
+ {"InternalPushDomainRef", ves_icall_System_AppDomain_InternalPushDomainRef},
+ {"InternalPushDomainRefByID", ves_icall_System_AppDomain_InternalPushDomainRefByID},
+ {"InternalSetContext", ves_icall_System_AppDomain_InternalSetContext},
+ {"InternalSetDomain", ves_icall_System_AppDomain_InternalSetDomain},
+ {"InternalSetDomainByID", ves_icall_System_AppDomain_InternalSetDomainByID},
+ {"InternalUnload", ves_icall_System_AppDomain_InternalUnload},
+ {"LoadAssembly", ves_icall_System_AppDomain_LoadAssembly},
+ {"LoadAssemblyRaw", ves_icall_System_AppDomain_LoadAssemblyRaw},
+ {"SetData", ves_icall_System_AppDomain_SetData},
+ {"createDomain", ves_icall_System_AppDomain_createDomain},
+ {"getCurDomain", ves_icall_System_AppDomain_getCurDomain},
+ {"getDomainByID", ves_icall_System_AppDomain_getDomainByID},
+ {"getFriendlyName", ves_icall_System_AppDomain_getFriendlyName},
+ {"getSetup", ves_icall_System_AppDomain_getSetup}
+};
+
+static const IcallEntry argiterator_icalls [] = {
+ {"IntGetNextArg()", mono_ArgIterator_IntGetNextArg},
+ {"IntGetNextArg(intptr)", mono_ArgIterator_IntGetNextArgT},
+ {"IntGetNextArgType", mono_ArgIterator_IntGetNextArgType},
+ {"Setup", mono_ArgIterator_Setup}
+};
+
+static const IcallEntry array_icalls [] = {
+ {"ClearInternal", ves_icall_System_Array_ClearInternal},
+ {"Clone", mono_array_clone},
+ {"CreateInstanceImpl", ves_icall_System_Array_CreateInstanceImpl},
+ {"FastCopy", ves_icall_System_Array_FastCopy},
+ {"GetLength", ves_icall_System_Array_GetLength},
+ {"GetLowerBound", ves_icall_System_Array_GetLowerBound},
+ {"GetRank", ves_icall_System_Array_GetRank},
+ {"GetValue", ves_icall_System_Array_GetValue},
+ {"GetValueImpl", ves_icall_System_Array_GetValueImpl},
+ {"SetValue", ves_icall_System_Array_SetValue},
+ {"SetValueImpl", ves_icall_System_Array_SetValueImpl}
+};
+
+static const IcallEntry buffer_icalls [] = {
+ {"BlockCopyInternal", ves_icall_System_Buffer_BlockCopyInternal},
+ {"ByteLengthInternal", ves_icall_System_Buffer_ByteLengthInternal},
+ {"GetByteInternal", ves_icall_System_Buffer_GetByteInternal},
+ {"SetByteInternal", ves_icall_System_Buffer_SetByteInternal}
+};
+
+static const IcallEntry char_icalls [] = {
+ {"GetDataTablePointers", ves_icall_System_Char_GetDataTablePointers},
+ {"InternalToLower(char,System.Globalization.CultureInfo)", ves_icall_System_Char_InternalToLower_Comp},
+ {"InternalToUpper(char,System.Globalization.CultureInfo)", ves_icall_System_Char_InternalToUpper_Comp}
+};
+
+static const IcallEntry defaultconf_icalls [] = {
+ {"get_machine_config_path", ves_icall_System_Configuration_DefaultConfig_get_machine_config_path}
+};
+
+static const IcallEntry timezone_icalls [] = {
+ {"GetTimeZoneData", ves_icall_System_CurrentTimeZone_GetTimeZoneData}
+};
+
+static const IcallEntry datetime_icalls [] = {
+ {"GetNow", ves_icall_System_DateTime_GetNow}
+};
+
+static const IcallEntry decimal_icalls [] = {
+ {"decimal2Int64", mono_decimal2Int64},
+ {"decimal2UInt64", mono_decimal2UInt64},
+ {"decimal2double", mono_decimal2double},
+ {"decimal2string", mono_decimal2string},
+ {"decimalCompare", mono_decimalCompare},
+ {"decimalDiv", mono_decimalDiv},
+ {"decimalFloorAndTrunc", mono_decimalFloorAndTrunc},
+ {"decimalIncr", mono_decimalIncr},
+ {"decimalIntDiv", mono_decimalIntDiv},
+ {"decimalMult", mono_decimalMult},
+ {"decimalRound", mono_decimalRound},
+ {"decimalSetExponent", mono_decimalSetExponent},
+ {"double2decimal", mono_double2decimal}, /* FIXME: wrong signature. */
+ {"string2decimal", mono_string2decimal}
+};
+
+static const IcallEntry delegate_icalls [] = {
+ {"CreateDelegate_internal", ves_icall_System_Delegate_CreateDelegate_internal},
+ {"FreeTrampoline", ves_icall_System_Delegate_FreeTrampoline}
+};
+
+static const IcallEntry tracelist_icalls [] = {
+ {"WriteWindowsDebugString", ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString}
+};
+
+static const IcallEntry fileversion_icalls [] = {
+ {"GetVersionInfo_internal(string)", ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal}
+};
+
+static const IcallEntry process_icalls [] = {
+ {"ExitCode_internal(intptr)", ves_icall_System_Diagnostics_Process_ExitCode_internal},
+ {"ExitTime_internal(intptr)", ves_icall_System_Diagnostics_Process_ExitTime_internal},
+ {"GetModules_internal()", ves_icall_System_Diagnostics_Process_GetModules_internal},
+ {"GetPid_internal()", ves_icall_System_Diagnostics_Process_GetPid_internal},
+ {"GetProcess_internal(int)", ves_icall_System_Diagnostics_Process_GetProcess_internal},
+ {"GetProcesses_internal()", ves_icall_System_Diagnostics_Process_GetProcesses_internal},
+ {"GetWorkingSet_internal(intptr,int&,int&)", ves_icall_System_Diagnostics_Process_GetWorkingSet_internal},
+ {"Kill_internal", ves_icall_System_Diagnostics_Process_Kill_internal},
+ {"ProcessName_internal(intptr)", ves_icall_System_Diagnostics_Process_ProcessName_internal},
+ {"Process_free_internal(intptr)", ves_icall_System_Diagnostics_Process_Process_free_internal},
+ {"SetWorkingSet_internal(intptr,int,int,bool)", ves_icall_System_Diagnostics_Process_SetWorkingSet_internal},
+ {"StartTime_internal(intptr)", ves_icall_System_Diagnostics_Process_StartTime_internal},
+ {"Start_internal(string,string,string,intptr,intptr,intptr,System.Diagnostics.Process/ProcInfo&)", ves_icall_System_Diagnostics_Process_Start_internal},
+ {"WaitForExit_internal(intptr,int)", ves_icall_System_Diagnostics_Process_WaitForExit_internal}
+};
+
+static const IcallEntry double_icalls [] = {
+ {"AssertEndianity", ves_icall_System_Double_AssertEndianity},
+ {"ParseImpl", mono_double_ParseImpl}
+};
+
+static const IcallEntry enum_icalls [] = {
+ {"ToObject", ves_icall_System_Enum_ToObject},
+ {"get_value", ves_icall_System_Enum_get_value}
+};
+
+static const IcallEntry environment_icalls [] = {
+ {"Exit", ves_icall_System_Environment_Exit},
+ {"GetCommandLineArgs", mono_runtime_get_main_args},
+ {"GetEnvironmentVariable", ves_icall_System_Environment_GetEnvironmentVariable},
+ {"GetEnvironmentVariableNames", ves_icall_System_Environment_GetEnvironmentVariableNames},
+ {"GetLogicalDrivesInternal", ves_icall_System_Environment_GetLogicalDrives },
+ {"GetMachineConfigPath", ves_icall_System_Configuration_DefaultConfig_get_machine_config_path},
+ {"GetOSVersionString", ves_icall_System_Environment_GetOSVersionString},
+ {"GetWindowsFolderPath", ves_icall_System_Environment_GetWindowsFolderPath},
+ {"get_ExitCode", mono_environment_exitcode_get},
+ {"get_HasShutdownStarted", ves_icall_System_Environment_get_HasShutdownStarted},
+ {"get_MachineName", ves_icall_System_Environment_get_MachineName},
+ {"get_NewLine", ves_icall_System_Environment_get_NewLine},
+ {"get_Platform", ves_icall_System_Environment_get_Platform},
+ {"get_TickCount", ves_icall_System_Environment_get_TickCount},
+ {"get_UserName", ves_icall_System_Environment_get_UserName},
+ {"internalGetGacPath", ves_icall_System_Environment_GetGacPath},
+ {"internalGetHome", ves_icall_System_Environment_InternalGetHome},
+ {"set_ExitCode", mono_environment_exitcode_set}
+};
+
+static const IcallEntry cultureinfo_icalls [] = {
+ {"construct_compareinfo(object,string)", ves_icall_System_Globalization_CompareInfo_construct_compareinfo},
+ {"construct_datetime_format", ves_icall_System_Globalization_CultureInfo_construct_datetime_format},
+ {"construct_internal_locale(string)", ves_icall_System_Globalization_CultureInfo_construct_internal_locale},
+ {"construct_internal_locale_from_current_locale", ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_current_locale},
+ {"construct_internal_locale_from_lcid", ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_lcid},
+ {"construct_internal_locale_from_name", ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name},
+ {"construct_internal_locale_from_specific_name", ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_specific_name},
+ {"construct_number_format", ves_icall_System_Globalization_CultureInfo_construct_number_format},
+ {"internal_get_cultures", ves_icall_System_Globalization_CultureInfo_internal_get_cultures},
+ {"internal_is_lcid_neutral", ves_icall_System_Globalization_CultureInfo_internal_is_lcid_neutral}
+};
+
+static const IcallEntry compareinfo_icalls [] = {
+ {"assign_sortkey(object,string,System.Globalization.CompareOptions)", ves_icall_System_Globalization_CompareInfo_assign_sortkey},
+ {"construct_compareinfo(string)", ves_icall_System_Globalization_CompareInfo_construct_compareinfo},
+ {"free_internal_collator()", ves_icall_System_Globalization_CompareInfo_free_internal_collator},
+ {"internal_compare(string,int,int,string,int,int,System.Globalization.CompareOptions)", ves_icall_System_Globalization_CompareInfo_internal_compare},
+ {"internal_index(string,int,int,char,System.Globalization.CompareOptions,bool)", ves_icall_System_Globalization_CompareInfo_internal_index_char},
+ {"internal_index(string,int,int,string,System.Globalization.CompareOptions,bool)", ves_icall_System_Globalization_CompareInfo_internal_index}
+};
+
+static const IcallEntry gc_icalls [] = {
+ {"GetTotalMemory", ves_icall_System_GC_GetTotalMemory},
+ {"InternalCollect", ves_icall_System_GC_InternalCollect},
+ {"KeepAlive", ves_icall_System_GC_KeepAlive},
+ {"ReRegisterForFinalize", ves_icall_System_GC_ReRegisterForFinalize},
+ {"SuppressFinalize", ves_icall_System_GC_SuppressFinalize},
+ {"WaitForPendingFinalizers", ves_icall_System_GC_WaitForPendingFinalizers}
+};
+
+static const IcallEntry famwatcher_icalls [] = {
+ {"InternalFAMNextEvent", ves_icall_System_IO_FAMW_InternalFAMNextEvent}
+};
+
+static const IcallEntry filewatcher_icalls [] = {
+ {"InternalCloseDirectory", ves_icall_System_IO_FSW_CloseDirectory},
+ {"InternalOpenDirectory", ves_icall_System_IO_FSW_OpenDirectory},
+ {"InternalReadDirectoryChanges", ves_icall_System_IO_FSW_ReadDirectoryChanges},
+ {"InternalSupportsFSW", ves_icall_System_IO_FSW_SupportsFSW}
+};
+
+static const IcallEntry path_icalls [] = {
+ {"get_temp_path", ves_icall_System_IO_get_temp_path}
+};
+
+static const IcallEntry monoio_icalls [] = {
+ {"BeginRead", ves_icall_System_IO_MonoIO_BeginRead },
+ {"BeginWrite", ves_icall_System_IO_MonoIO_BeginWrite },
+ {"Close(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Close},
+ {"CopyFile(string,string,bool,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_CopyFile},
+ {"CreateDirectory(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_CreateDirectory},
+ {"CreatePipe(intptr&,intptr&)", ves_icall_System_IO_MonoIO_CreatePipe},
+ {"DeleteFile(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_DeleteFile},
+ {"FindClose(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_FindClose},
+ {"FindFirstFile(string,System.IO.MonoIOStat&,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_FindFirstFile},
+ {"FindNextFile(intptr,System.IO.MonoIOStat&,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_FindNextFile},
+ {"Flush(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Flush},
+ {"GetCurrentDirectory(System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetCurrentDirectory},
+ {"GetFileAttributes(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetFileAttributes},
+ {"GetFileStat(string,System.IO.MonoIOStat&,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetFileStat},
+ {"GetFileType(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetFileType},
+ {"GetLength(intptr,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_GetLength},
+ {"GetSupportsAsync", ves_icall_System_IO_MonoIO_GetSupportsAsync},
+ {"GetTempPath(string&)", ves_icall_System_IO_MonoIO_GetTempPath},
+ {"Lock(intptr,long,long,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Lock},
+ {"MoveFile(string,string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_MoveFile},
+ {"Open(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,bool,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Open},
+ {"Read(intptr,byte[],int,int,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Read},
+ {"RemoveDirectory(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_RemoveDirectory},
+ {"Seek(intptr,long,System.IO.SeekOrigin,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Seek},
+ {"SetCurrentDirectory(string,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_SetCurrentDirectory},
+ {"SetFileAttributes(string,System.IO.FileAttributes,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_SetFileAttributes},
+ {"SetFileTime(intptr,long,long,long,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_SetFileTime},
+ {"SetLength(intptr,long,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_SetLength},
+ {"Unlock(intptr,long,long,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Unlock},
+ {"Write(intptr,byte[],int,int,System.IO.MonoIOError&)", ves_icall_System_IO_MonoIO_Write},
+ {"get_AltDirectorySeparatorChar", ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar},
+ {"get_ConsoleError", ves_icall_System_IO_MonoIO_get_ConsoleError},
+ {"get_ConsoleInput", ves_icall_System_IO_MonoIO_get_ConsoleInput},
+ {"get_ConsoleOutput", ves_icall_System_IO_MonoIO_get_ConsoleOutput},
+ {"get_DirectorySeparatorChar", ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar},
+ {"get_InvalidPathChars", ves_icall_System_IO_MonoIO_get_InvalidPathChars},
+ {"get_PathSeparator", ves_icall_System_IO_MonoIO_get_PathSeparator},
+ {"get_VolumeSeparatorChar", ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar}
+};
+
+static const IcallEntry math_icalls [] = {
+ {"Acos", ves_icall_System_Math_Acos},
+ {"Asin", ves_icall_System_Math_Asin},
+ {"Atan", ves_icall_System_Math_Atan},
+ {"Atan2", ves_icall_System_Math_Atan2},
+ {"Cos", ves_icall_System_Math_Cos},
+ {"Cosh", ves_icall_System_Math_Cosh},
+ {"Exp", ves_icall_System_Math_Exp},
+ {"Floor", ves_icall_System_Math_Floor},
+ {"Log", ves_icall_System_Math_Log},
+ {"Log10", ves_icall_System_Math_Log10},
+ {"Pow", ves_icall_System_Math_Pow},
+ {"Round", ves_icall_System_Math_Round},
+ {"Round2", ves_icall_System_Math_Round2},
+ {"Sin", ves_icall_System_Math_Sin},
+ {"Sinh", ves_icall_System_Math_Sinh},
+ {"Sqrt", ves_icall_System_Math_Sqrt},
+ {"Tan", ves_icall_System_Math_Tan},
+ {"Tanh", ves_icall_System_Math_Tanh}
+};
+
+static const IcallEntry customattrs_icalls [] = {
+ {"GetCustomAttributesInternal", mono_reflection_get_custom_attrs}
+};
+
+static const IcallEntry enuminfo_icalls [] = {
+ {"get_enum_info", ves_icall_get_enum_info}
+};
+
+static const IcallEntry fieldinfo_icalls [] = {
+ {"GetUnmanagedMarshal", ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal},
+ {"internal_from_handle", ves_icall_System_Reflection_FieldInfo_internal_from_handle}
+};
+
+static const IcallEntry memberinfo_icalls [] = {
+ {"get_MetadataToken", mono_reflection_get_token}
+};
+
+static const IcallEntry monotype_icalls [] = {
+ {"GetArrayRank", ves_icall_MonoType_GetArrayRank},
+ {"GetConstructors", ves_icall_Type_GetConstructors_internal},
+ {"GetConstructors_internal", ves_icall_Type_GetConstructors_internal},
+ {"GetElementType", ves_icall_MonoType_GetElementType},
+ {"GetEvents_internal", ves_icall_Type_GetEvents_internal},
+ {"GetField", ves_icall_Type_GetField},
+ {"GetFields_internal", ves_icall_Type_GetFields_internal},
+ {"GetGenericArguments", ves_icall_MonoType_GetGenericArguments},
+ {"GetInterfaces", ves_icall_Type_GetInterfaces},
+ {"GetMethodsByName", ves_icall_Type_GetMethodsByName},
+ {"GetNestedType", ves_icall_Type_GetNestedType},
+ {"GetNestedTypes", ves_icall_Type_GetNestedTypes},
+ {"GetPropertiesByName", ves_icall_Type_GetPropertiesByName},
+ {"InternalGetEvent", ves_icall_MonoType_GetEvent},
+ {"IsByRefImpl", ves_icall_type_isbyref},
+ {"IsPointerImpl", ves_icall_type_ispointer},
+ {"IsPrimitiveImpl", ves_icall_type_isprimitive},
+ {"getFullName", ves_icall_System_MonoType_getFullName},
+ {"get_Assembly", ves_icall_MonoType_get_Assembly},
+ {"get_BaseType", ves_icall_get_type_parent},
+ {"get_DeclaringMethod", ves_icall_MonoType_get_DeclaringMethod},
+ {"get_DeclaringType", ves_icall_MonoType_get_DeclaringType},
+ {"get_HasGenericArguments", ves_icall_MonoType_get_HasGenericArguments},
+ {"get_IsGenericParameter", ves_icall_MonoType_get_IsGenericParameter},
+ {"get_Module", ves_icall_MonoType_get_Module},
+ {"get_Name", ves_icall_MonoType_get_Name},
+ {"get_Namespace", ves_icall_MonoType_get_Namespace},
+ {"get_UnderlyingSystemType", ves_icall_MonoType_get_UnderlyingSystemType},
+ {"get_attributes", ves_icall_get_attributes},
+ {"type_from_obj", mono_type_type_from_obj}
+};
+
+static const IcallEntry assembly_icalls [] = {
+ {"FillName", ves_icall_System_Reflection_Assembly_FillName},
+ {"GetCallingAssembly", ves_icall_System_Reflection_Assembly_GetCallingAssembly},
+ {"GetEntryAssembly", ves_icall_System_Reflection_Assembly_GetEntryAssembly},
+ {"GetExecutingAssembly", ves_icall_System_Reflection_Assembly_GetExecutingAssembly},
+ {"GetFilesInternal", ves_icall_System_Reflection_Assembly_GetFilesInternal},
+ {"GetManifestResourceInfoInternal", ves_icall_System_Reflection_Assembly_GetManifestResourceInfoInternal},
+ {"GetManifestResourceInternal", ves_icall_System_Reflection_Assembly_GetManifestResourceInternal},
+ {"GetManifestResourceNames", ves_icall_System_Reflection_Assembly_GetManifestResourceNames},
+ {"GetModulesInternal", ves_icall_System_Reflection_Assembly_GetModulesInternal},
+ {"GetNamespaces", ves_icall_System_Reflection_Assembly_GetNamespaces},
+ {"GetReferencedAssemblies", ves_icall_System_Reflection_Assembly_GetReferencedAssemblies},
+ {"GetTypes", ves_icall_System_Reflection_Assembly_GetTypes},
+ {"InternalGetAssemblyName", ves_icall_System_Reflection_Assembly_InternalGetAssemblyName},
+ {"InternalGetType", ves_icall_System_Reflection_Assembly_InternalGetType},
+ {"InternalImageRuntimeVersion", ves_icall_System_Reflection_Assembly_InternalImageRuntimeVersion},
+ {"LoadFrom", ves_icall_System_Reflection_Assembly_LoadFrom},
/*
- * System.Environment
+ * Private icalls for the Mono Debugger
*/
- "System.Environment::get_MachineName", ves_icall_System_Environment_get_MachineName,
- "System.Environment::get_NewLine", ves_icall_System_Environment_get_NewLine,
- "System.Environment::GetEnvironmentVariable", ves_icall_System_Environment_GetEnvironmentVariable,
- "System.Environment::GetEnvironmentVariableNames", ves_icall_System_Environment_GetEnvironmentVariableNames,
- "System.Environment::GetCommandLineArgs", mono_runtime_get_main_args,
- "System.Environment::get_TickCount", ves_icall_System_Environment_get_TickCount,
- "System.Environment::Exit", ves_icall_System_Environment_Exit,
+ {"MonoDebugger_CheckRuntimeVersion", ves_icall_MonoDebugger_check_runtime_version},
+ {"MonoDebugger_GetLocalTypeFromSignature", ves_icall_MonoDebugger_GetLocalTypeFromSignature},
+ {"MonoDebugger_GetMethod", ves_icall_MonoDebugger_GetMethod},
+ {"MonoDebugger_GetMethodToken", ves_icall_MonoDebugger_GetMethodToken},
+ {"MonoDebugger_GetType", ves_icall_MonoDebugger_GetType},
+
+ /* normal icalls again */
+ {"get_EntryPoint", ves_icall_System_Reflection_Assembly_get_EntryPoint},
+ {"get_ManifestModule", ves_icall_System_Reflection_Assembly_get_ManifestModule},
+ {"get_MetadataToken", mono_reflection_get_token},
+ {"get_code_base", ves_icall_System_Reflection_Assembly_get_code_base},
+ {"get_global_assembly_cache", ves_icall_System_Reflection_Assembly_get_global_assembly_cache},
+ {"get_location", ves_icall_System_Reflection_Assembly_get_location},
+ {"load_with_partial_name", ves_icall_System_Reflection_Assembly_load_with_partial_name}
+};
- /*
- * System.Runtime.Remoting
- */
- "System.Runtime.Remoting.RemotingServices::InternalExecute",
- ves_icall_InternalExecute,
- "System.Runtime.Remoting.RemotingServices::IsTransparentProxy",
- ves_icall_IsTransparentProxy,
+static const IcallEntry methodbase_icalls [] = {
+ {"GetCurrentMethod", ves_icall_GetCurrentMethod},
+ {"GetMethodBodyInternal", ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal},
+ {"GetMethodFromHandleInternal", ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternal}
+};
- /*
- * System.Runtime.Remoting.Messaging
- */
- "System.Runtime.Remoting.Messaging.MonoMethodMessage::InitMessage",
- ves_icall_MonoMethodMessage_InitMessage,
+static const IcallEntry module_icalls [] = {
+ {"Close", ves_icall_System_Reflection_Module_Close},
+ {"GetGlobalType", ves_icall_System_Reflection_Module_GetGlobalType},
+ {"GetGuidInternal", ves_icall_System_Reflection_Module_GetGuidInternal},
+ {"GetPEKind", ves_icall_System_Reflection_Module_GetPEKind},
+ {"InternalGetTypes", ves_icall_System_Reflection_Module_InternalGetTypes},
+ {"ResolveFieldToken", ves_icall_System_Reflection_Module_ResolveFieldToken},
+ {"ResolveMemberToken", ves_icall_System_Reflection_Module_ResolveMemberToken},
+ {"ResolveMethodToken", ves_icall_System_Reflection_Module_ResolveMethodToken},
+ {"ResolveStringToken", ves_icall_System_Reflection_Module_ResolveStringToken},
+ {"ResolveTypeToken", ves_icall_System_Reflection_Module_ResolveTypeToken},
+ {"get_MetadataToken", mono_reflection_get_token}
+};
+
+static const IcallEntry monocmethod_icalls [] = {
+ {"GetGenericMethodDefinition_impl", ves_icall_MonoMethod_GetGenericMethodDefinition},
+ {"InternalInvoke", ves_icall_InternalInvoke},
+ {"get_Mono_IsInflatedMethod", ves_icall_MonoMethod_get_Mono_IsInflatedMethod}
+};
+
+static const IcallEntry monoeventinfo_icalls [] = {
+ {"get_event_info", ves_icall_get_event_info}
+};
+
+static const IcallEntry monofield_icalls [] = {
+ {"GetFieldOffset", ves_icall_MonoField_GetFieldOffset},
+ {"GetParentType", ves_icall_MonoField_GetParentType},
+ {"GetValueInternal", ves_icall_MonoField_GetValueInternal},
+ {"Mono_GetGenericFieldDefinition", ves_icall_MonoField_Mono_GetGenericFieldDefinition},
+ {"SetValueInternal", ves_icall_FieldInfo_SetValueInternal}
+};
+
+static const IcallEntry monogenericinst_icalls [] = {
+ {"GetConstructors_internal", ves_icall_MonoGenericInst_GetConstructors},
+ {"GetEvents_internal", ves_icall_MonoGenericInst_GetEvents},
+ {"GetFields_internal", ves_icall_MonoGenericInst_GetFields},
+ {"GetInterfaces_internal", ves_icall_MonoGenericInst_GetInterfaces},
+ {"GetMethods_internal", ves_icall_MonoGenericInst_GetMethods},
+ {"GetParentType", ves_icall_MonoGenericInst_GetParentType},
+ {"GetProperties_internal", ves_icall_MonoGenericInst_GetProperties},
+ {"initialize", mono_reflection_generic_inst_initialize}
+};
+
+static const IcallEntry generictypeparambuilder_icalls [] = {
+ {"initialize", mono_reflection_initialize_generic_parameter}
+};
+
+static const IcallEntry monomethod_icalls [] = {
+ {"BindGenericParameters", mono_reflection_bind_generic_method_parameters},
+ {"GetDllImportAttribute", ves_icall_MonoMethod_GetDllImportAttribute},
+ {"GetGenericArguments", ves_icall_MonoMethod_GetGenericArguments},
+ {"GetGenericMethodDefinition_impl", ves_icall_MonoMethod_GetGenericMethodDefinition},
+ {"InternalInvoke", ves_icall_InternalInvoke},
+ {"get_HasGenericParameters", ves_icall_MonoMethod_get_HasGenericParameters},
+ {"get_IsGenericMethodDefinition", ves_icall_MonoMethod_get_IsGenericMethodDefinition},
+ {"get_Mono_IsInflatedMethod", ves_icall_MonoMethod_get_Mono_IsInflatedMethod},
+ {"get_base_definition", ves_icall_MonoMethod_get_base_definition}
+};
+
+static const IcallEntry monomethodinfo_icalls [] = {
+ {"get_method_info", ves_icall_get_method_info},
+ {"get_parameter_info", ves_icall_get_parameter_info}
+};
+
+static const IcallEntry monopropertyinfo_icalls [] = {
+ {"get_property_info", ves_icall_get_property_info}
+};
+
+static const IcallEntry parameterinfo_icalls [] = {
+ {"get_MetadataToken", mono_reflection_get_token}
+};
+
+static const IcallEntry dns_icalls [] = {
+ {"GetHostByAddr_internal(string,string&,string[]&,string[]&)", ves_icall_System_Net_Dns_GetHostByAddr_internal},
+ {"GetHostByName_internal(string,string&,string[]&,string[]&)", ves_icall_System_Net_Dns_GetHostByName_internal},
+ {"GetHostName_internal(string&)", ves_icall_System_Net_Dns_GetHostName_internal}
+};
+
+static const IcallEntry socket_icalls [] = {
+ {"Accept_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_Accept_internal},
+ {"AsyncReceiveInternal", ves_icall_System_Net_Sockets_Socket_AsyncReceive},
+ {"AsyncSendInternal", ves_icall_System_Net_Sockets_Socket_AsyncSend},
+ {"Available_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_Available_internal},
+ {"Bind_internal(intptr,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_Bind_internal},
+ {"Blocking_internal(intptr,bool,int&)", ves_icall_System_Net_Sockets_Socket_Blocking_internal},
+ {"Close_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_Close_internal},
+ {"Connect_internal(intptr,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_Connect_internal},
+ {"GetSocketOption_arr_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,byte[]&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal},
+ {"GetSocketOption_obj_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object&,int&)", ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal},
+ {"GetSupportsAsync", ves_icall_System_IO_MonoIO_GetSupportsAsync},
+ {"Listen_internal(intptr,int,int&)", ves_icall_System_Net_Sockets_Socket_Listen_internal},
+ {"LocalEndPoint_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal},
+ {"Poll_internal", ves_icall_System_Net_Sockets_Socket_Poll_internal},
+ {"Receive_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Receive_internal},
+ {"RecvFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_RecvFrom_internal},
+ {"RemoteEndPoint_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal},
+ {"Select_internal(System.Net.Sockets.Socket[]&,System.Net.Sockets.Socket[]&,System.Net.Sockets.Socket[]&,int,int&)", ves_icall_System_Net_Sockets_Socket_Select_internal},
+ {"SendTo_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_SendTo_internal},
+ {"Send_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_internal},
+ {"SetSocketOption_internal(intptr,System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,object,byte[],int,int&)", ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal},
+ {"Shutdown_internal(intptr,System.Net.Sockets.SocketShutdown,int&)", ves_icall_System_Net_Sockets_Socket_Shutdown_internal},
+ {"Socket_internal(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.Net.Sockets.ProtocolType,int&)", ves_icall_System_Net_Sockets_Socket_Socket_internal},
+ {"WSAIoctl(intptr,int,byte[],byte[],int&)", ves_icall_System_Net_Sockets_Socket_WSAIoctl}
+};
+
+static const IcallEntry socketex_icalls [] = {
+ {"WSAGetLastError_internal", ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal}
+};
+
+static const IcallEntry object_icalls [] = {
+ {"GetType", ves_icall_System_Object_GetType},
+ {"InternalGetHashCode", ves_icall_System_Object_GetHashCode},
+ {"MemberwiseClone", ves_icall_System_Object_MemberwiseClone},
+ {"obj_address", ves_icall_System_Object_obj_address}
+};
+
+static const IcallEntry assemblybuilder_icalls[] = {
+ {"InternalAddModule", mono_image_load_module},
+ {"basic_init", mono_image_basic_init}
+};
+
+static const IcallEntry customattrbuilder_icalls [] = {
+ {"GetBlob", mono_reflection_get_custom_attrs_blob}
+};
+
+static const IcallEntry dynamicmethod_icalls [] = {
+ {"create_dynamic_method", mono_reflection_create_dynamic_method}
+};
+
+static const IcallEntry methodbuilder_icalls [] = {
+ {"BindGenericParameters", mono_reflection_bind_generic_method_parameters}
+};
+
+static const IcallEntry modulebuilder_icalls [] = {
+ {"basic_init", mono_image_module_basic_init},
+ {"build_metadata", ves_icall_ModuleBuilder_build_metadata},
+ {"create_modified_type", ves_icall_ModuleBuilder_create_modified_type},
+ {"getDataChunk", ves_icall_ModuleBuilder_getDataChunk},
+ {"getMethodToken", ves_icall_ModuleBuilder_getMethodToken},
+ {"getToken", ves_icall_ModuleBuilder_getToken},
+ {"getUSIndex", mono_image_insert_string}
+};
+
+static const IcallEntry signaturehelper_icalls [] = {
+ {"get_signature_field", mono_reflection_sighelper_get_signature_field},
+ {"get_signature_local", mono_reflection_sighelper_get_signature_local}
+};
+
+static const IcallEntry typebuilder_icalls [] = {
+ {"create_generic_class", mono_reflection_create_generic_class},
+ {"create_internal_class", mono_reflection_create_internal_class},
+ {"create_runtime_class", mono_reflection_create_runtime_class},
+ {"get_IsGenericParameter", ves_icall_TypeBuilder_get_IsGenericParameter},
+ {"get_event_info", mono_reflection_event_builder_get_event_info},
+ {"setup_generic_class", mono_reflection_setup_generic_class},
+ {"setup_internal_class", mono_reflection_setup_internal_class}
+};
+
+static const IcallEntry enumbuilder_icalls [] = {
+ {"setup_enum_type", ves_icall_EnumBuilder_setup_enum_type}
+};
+
+static const IcallEntry runtimehelpers_icalls [] = {
+ {"GetObjectValue", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetObjectValue},
+ /* REMOVEME: no longer needed, just so we dont break things when not needed */
+ {"GetOffsetToStringData", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetOffsetToStringData},
+ {"InitializeArray", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray},
+ {"RunClassConstructor", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor},
+ {"get_OffsetToStringData", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetOffsetToStringData}
+};
+
+static const IcallEntry gchandle_icalls [] = {
+ {"FreeHandle", ves_icall_System_GCHandle_FreeHandle},
+ {"GetAddrOfPinnedObject", ves_icall_System_GCHandle_GetAddrOfPinnedObject},
+ {"GetTarget", ves_icall_System_GCHandle_GetTarget},
+ {"GetTargetHandle", ves_icall_System_GCHandle_GetTargetHandle}
+};
+
+static const IcallEntry marshal_icalls [] = {
+ {"AllocCoTaskMem", ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem},
+ {"AllocHGlobal", ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal},
+ {"DestroyStructure", ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure},
+ {"FreeCoTaskMem", ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem},
+ {"FreeHGlobal", ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal},
+ {"GetDelegateForFunctionPointerInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal},
+ {"GetFunctionPointerForDelegateInternal", mono_delegate_to_ftnptr},
+ {"GetLastWin32Error", ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error},
+ {"OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf},
+ {"Prelink", ves_icall_System_Runtime_InteropServices_Marshal_Prelink},
+ {"PrelinkAll", ves_icall_System_Runtime_InteropServices_Marshal_PrelinkAll},
+ {"PtrToStringAnsi(intptr)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi},
+ {"PtrToStringAnsi(intptr,int)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len},
+ {"PtrToStringAuto(intptr)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi},
+ {"PtrToStringAuto(intptr,int)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len},
+ {"PtrToStringBSTR", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringBSTR},
+ {"PtrToStringUni(intptr)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni},
+ {"PtrToStringUni(intptr,int)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni_len},
+ {"PtrToStructure(intptr,System.Type)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type},
+ {"PtrToStructure(intptr,object)", ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure},
+ {"ReAllocHGlobal", mono_marshal_realloc},
+ {"ReadByte", ves_icall_System_Runtime_InteropServices_Marshal_ReadByte},
+ {"ReadInt16", ves_icall_System_Runtime_InteropServices_Marshal_ReadInt16},
+ {"ReadInt32", ves_icall_System_Runtime_InteropServices_Marshal_ReadInt32},
+ {"ReadInt64", ves_icall_System_Runtime_InteropServices_Marshal_ReadInt64},
+ {"ReadIntPtr", ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr},
+ {"SizeOf", ves_icall_System_Runtime_InteropServices_Marshal_SizeOf},
+ {"StringToHGlobalAnsi", ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi},
+ {"StringToHGlobalAuto", ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi},
+ {"StringToHGlobalUni", ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni},
+ {"StructureToPtr", ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr},
+ {"UnsafeAddrOfPinnedArrayElement", ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement},
+ {"WriteByte", ves_icall_System_Runtime_InteropServices_Marshal_WriteByte},
+ {"WriteInt16", ves_icall_System_Runtime_InteropServices_Marshal_WriteInt16},
+ {"WriteInt32", ves_icall_System_Runtime_InteropServices_Marshal_WriteInt32},
+ {"WriteInt64", ves_icall_System_Runtime_InteropServices_Marshal_WriteInt64},
+ {"WriteIntPtr", ves_icall_System_Runtime_InteropServices_Marshal_WriteIntPtr},
+ {"copy_from_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged},
+ {"copy_to_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged}
+};
+
+static const IcallEntry activationservices_icalls [] = {
+ {"AllocateUninitializedClassInstance", ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClassInstance},
+ {"EnableProxyActivation", ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation}
+};
+
+static const IcallEntry monomethodmessage_icalls [] = {
+ {"InitMessage", ves_icall_MonoMethodMessage_InitMessage}
+};
- /*
- * System.Runtime.Remoting.Proxies
- */
- "System.Runtime.Remoting.Proxies.RealProxy::GetTransparentProxy",
- ves_icall_Remoting_RealProxy_GetTransparentProxy,
+static const IcallEntry realproxy_icalls [] = {
+ {"InternalGetProxyType", ves_icall_Remoting_RealProxy_InternalGetProxyType},
+ {"InternalGetTransparentProxy", ves_icall_Remoting_RealProxy_GetTransparentProxy}
+};
- /*
- * System.Threading.Interlocked
- */
- "System.Threading.Interlocked::Increment(int&)", ves_icall_System_Threading_Interlocked_Increment_Int,
- "System.Threading.Interlocked::Increment(long&)", ves_icall_System_Threading_Interlocked_Increment_Long,
- "System.Threading.Interlocked::Decrement(int&)", ves_icall_System_Threading_Interlocked_Decrement_Int,
- "System.Threading.Interlocked::Decrement(long&)", ves_icall_System_Threading_Interlocked_Decrement_Long,
- "System.Threading.Interlocked::CompareExchange(int&,int,int)", ves_icall_System_Threading_Interlocked_CompareExchange_Int,
- "System.Threading.Interlocked::CompareExchange(object&,object,object)", ves_icall_System_Threading_Interlocked_CompareExchange_Object,
- "System.Threading.Interlocked::CompareExchange(single&,single,single)", ves_icall_System_Threading_Interlocked_CompareExchange_Single,
- "System.Threading.Interlocked::Exchange(int&,int)", ves_icall_System_Threading_Interlocked_Exchange_Int,
- "System.Threading.Interlocked::Exchange(object&,object)", ves_icall_System_Threading_Interlocked_Exchange_Object,
- "System.Threading.Interlocked::Exchange(single&,single)", ves_icall_System_Threading_Interlocked_Exchange_Single,
+static const IcallEntry remotingservices_icalls [] = {
+ {"InternalExecute", ves_icall_InternalExecute},
+ {"IsTransparentProxy", ves_icall_IsTransparentProxy}
+};
- /*
- * System.Diagnostics.Process
- */
- "System.Diagnostics.Process::GetCurrentProcess_internal()", ves_icall_System_Diagnostics_Process_GetCurrentProcess_internal,
- "System.Diagnostics.Process::GetPid_internal()", ves_icall_System_Diagnostics_Process_GetPid_internal,
- "System.Diagnostics.Process::Process_free_internal(intptr)", ves_icall_System_Diagnostics_Process_Process_free_internal,
- "System.Diagnostics.Process::GetModules_internal()", ves_icall_System_Diagnostics_Process_GetModules_internal,
- "System.Diagnostics.Process::Start_internal(string,string,ProcInfo&)", ves_icall_System_Diagnostics_Process_Start_internal,
- "System.Diagnostics.Process::WaitForExit_internal(intptr,int)", ves_icall_System_Diagnostics_Process_WaitForExit_internal,
- "System.Diagnostics.Process::ExitTime_internal(intptr)", ves_icall_System_Diagnostics_Process_ExitTime_internal,
- "System.Diagnostics.Process::StartTime_internal(intptr)", ves_icall_System_Diagnostics_Process_StartTime_internal,
- "System.Diagnostics.Process::ExitCode_internal(intptr)", ves_icall_System_Diagnostics_Process_ExitCode_internal,
- "System.Diagnostics.FileVersionInfo::GetVersionInfo_internal(string)", ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal,
+static const IcallEntry rng_icalls [] = {
+ {"RngClose", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose},
+ {"RngGetBytes", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngGetBytes},
+ {"RngInitialize", ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize}
+};
- /*
- * add other internal calls here
- */
- NULL, NULL
+static const IcallEntry methodhandle_icalls [] = {
+ {"GetFunctionPointer", ves_icall_RuntimeMethod_GetFunctionPointer}
+};
+
+static const IcallEntry string_icalls [] = {
+ {".ctor(char*)", ves_icall_System_String_ctor_charp},
+ {".ctor(char*,int,int)", ves_icall_System_String_ctor_charp_int_int},
+ {".ctor(char,int)", ves_icall_System_String_ctor_char_int},
+ {".ctor(char[])", ves_icall_System_String_ctor_chara},
+ {".ctor(char[],int,int)", ves_icall_System_String_ctor_chara_int_int},
+ {".ctor(sbyte*)", ves_icall_System_String_ctor_sbytep},
+ {".ctor(sbyte*,int,int)", ves_icall_System_String_ctor_sbytep_int_int},
+ {".ctor(sbyte*,int,int,System.Text.Encoding)", ves_icall_System_String_ctor_encoding},
+ {"GetHashCode", ves_icall_System_String_GetHashCode},
+ {"InternalAllocateStr", ves_icall_System_String_InternalAllocateStr},
+ {"InternalCharCopy", ves_icall_System_String_InternalCharCopy},
+ {"InternalCopyTo", ves_icall_System_String_InternalCopyTo},
+ {"InternalIndexOfAny", ves_icall_System_String_InternalIndexOfAny},
+ {"InternalInsert", ves_icall_System_String_InternalInsert},
+ {"InternalIntern", ves_icall_System_String_InternalIntern},
+ {"InternalIsInterned", ves_icall_System_String_InternalIsInterned},
+ {"InternalJoin", ves_icall_System_String_InternalJoin},
+ {"InternalLastIndexOfAny", ves_icall_System_String_InternalLastIndexOfAny},
+ {"InternalPad", ves_icall_System_String_InternalPad},
+ {"InternalRemove", ves_icall_System_String_InternalRemove},
+ {"InternalReplace(char,char)", ves_icall_System_String_InternalReplace_Char},
+ {"InternalReplace(string,string,System.Globalization.CompareInfo)", ves_icall_System_String_InternalReplace_Str_Comp},
+ {"InternalSplit", ves_icall_System_String_InternalSplit},
+ {"InternalStrcpy(string,int,char[])", ves_icall_System_String_InternalStrcpy_Chars},
+ {"InternalStrcpy(string,int,char[],int,int)", ves_icall_System_String_InternalStrcpy_CharsN},
+ {"InternalStrcpy(string,int,string)", ves_icall_System_String_InternalStrcpy_Str},
+ {"InternalStrcpy(string,int,string,int,int)", ves_icall_System_String_InternalStrcpy_StrN},
+ {"InternalToLower(System.Globalization.CultureInfo)", ves_icall_System_String_InternalToLower_Comp},
+ {"InternalToUpper(System.Globalization.CultureInfo)", ves_icall_System_String_InternalToUpper_Comp},
+ {"InternalTrim", ves_icall_System_String_InternalTrim},
+ {"get_Chars", ves_icall_System_String_get_Chars}
+};
+
+static const IcallEntry encoding_icalls [] = {
+ {"InternalCodePage", ves_icall_System_Text_Encoding_InternalCodePage}
+};
+
+static const IcallEntry monitor_icalls [] = {
+ {"Monitor_exit", ves_icall_System_Threading_Monitor_Monitor_exit},
+ {"Monitor_pulse", ves_icall_System_Threading_Monitor_Monitor_pulse},
+ {"Monitor_pulse_all", ves_icall_System_Threading_Monitor_Monitor_pulse_all},
+ {"Monitor_test_owner", ves_icall_System_Threading_Monitor_Monitor_test_owner},
+ {"Monitor_test_synchronised", ves_icall_System_Threading_Monitor_Monitor_test_synchronised},
+ {"Monitor_try_enter", ves_icall_System_Threading_Monitor_Monitor_try_enter},
+ {"Monitor_wait", ves_icall_System_Threading_Monitor_Monitor_wait}
+};
+
+static const IcallEntry interlocked_icalls [] = {
+ {"CompareExchange(int&,int,int)", ves_icall_System_Threading_Interlocked_CompareExchange_Int},
+ {"CompareExchange(object&,object,object)", ves_icall_System_Threading_Interlocked_CompareExchange_Object},
+ {"CompareExchange(single&,single,single)", ves_icall_System_Threading_Interlocked_CompareExchange_Single},
+ {"Decrement(int&)", ves_icall_System_Threading_Interlocked_Decrement_Int},
+ {"Decrement(long&)", ves_icall_System_Threading_Interlocked_Decrement_Long},
+ {"Exchange(int&,int)", ves_icall_System_Threading_Interlocked_Exchange_Int},
+ {"Exchange(object&,object)", ves_icall_System_Threading_Interlocked_Exchange_Object},
+ {"Exchange(single&,single)", ves_icall_System_Threading_Interlocked_Exchange_Single},
+ {"Increment(int&)", ves_icall_System_Threading_Interlocked_Increment_Int},
+ {"Increment(long&)", ves_icall_System_Threading_Interlocked_Increment_Long}
+};
+
+static const IcallEntry mutex_icalls [] = {
+ {"CreateMutex_internal(bool,string,bool&)", ves_icall_System_Threading_Mutex_CreateMutex_internal},
+ {"ReleaseMutex_internal(intptr)", ves_icall_System_Threading_Mutex_ReleaseMutex_internal}
+};
+
+static const IcallEntry nativeevents_icalls [] = {
+ {"CloseEvent_internal", ves_icall_System_Threading_Events_CloseEvent_internal},
+ {"CreateEvent_internal", ves_icall_System_Threading_Events_CreateEvent_internal},
+ {"ResetEvent_internal", ves_icall_System_Threading_Events_ResetEvent_internal},
+ {"SetEvent_internal", ves_icall_System_Threading_Events_SetEvent_internal}
+};
+
+static const IcallEntry thread_icalls [] = {
+ {"Abort_internal(object)", ves_icall_System_Threading_Thread_Abort},
+ {"CurrentThread_internal", mono_thread_current},
+ {"GetDomainID", ves_icall_System_Threading_Thread_GetDomainID},
+ {"GetName_internal", ves_icall_System_Threading_Thread_GetName_internal},
+ {"Join_internal", ves_icall_System_Threading_Thread_Join_internal},
+ {"ResetAbort_internal()", ves_icall_System_Threading_Thread_ResetAbort},
+ {"Resume_internal()", ves_icall_System_Threading_Thread_Resume},
+ {"SetName_internal", ves_icall_System_Threading_Thread_SetName_internal},
+ {"Sleep_internal", ves_icall_System_Threading_Thread_Sleep_internal},
+ {"SlotHash_lookup", ves_icall_System_Threading_Thread_SlotHash_lookup},
+ {"SlotHash_store", ves_icall_System_Threading_Thread_SlotHash_store},
+ {"Start_internal", ves_icall_System_Threading_Thread_Start_internal},
+ {"Suspend_internal", ves_icall_System_Threading_Thread_Suspend},
+ {"Thread_free_internal", ves_icall_System_Threading_Thread_Thread_free_internal},
+ {"Thread_internal", ves_icall_System_Threading_Thread_Thread_internal},
+ {"VolatileRead(byte&)", ves_icall_System_Threading_Thread_VolatileRead1},
+ {"VolatileRead(double&)", ves_icall_System_Threading_Thread_VolatileRead8},
+ {"VolatileRead(int&)", ves_icall_System_Threading_Thread_VolatileRead4},
+ {"VolatileRead(int16&)", ves_icall_System_Threading_Thread_VolatileRead2},
+ {"VolatileRead(intptr&)", ves_icall_System_Threading_Thread_VolatileReadIntPtr},
+ {"VolatileRead(long&)", ves_icall_System_Threading_Thread_VolatileRead8},
+ {"VolatileRead(object&)", ves_icall_System_Threading_Thread_VolatileReadIntPtr},
+ {"VolatileRead(sbyte&)", ves_icall_System_Threading_Thread_VolatileRead1},
+ {"VolatileRead(single&)", ves_icall_System_Threading_Thread_VolatileRead4},
+ {"VolatileRead(uint&)", ves_icall_System_Threading_Thread_VolatileRead2},
+ {"VolatileRead(uint16&)", ves_icall_System_Threading_Thread_VolatileRead2},
+ {"VolatileRead(uintptr&)", ves_icall_System_Threading_Thread_VolatileReadIntPtr},
+ {"VolatileRead(ulong&)", ves_icall_System_Threading_Thread_VolatileRead8},
+ {"VolatileWrite(byte&,byte)", ves_icall_System_Threading_Thread_VolatileWrite1},
+ {"VolatileWrite(double&,double)", ves_icall_System_Threading_Thread_VolatileWrite8},
+ {"VolatileWrite(int&,int)", ves_icall_System_Threading_Thread_VolatileWrite4},
+ {"VolatileWrite(int16&,int16)", ves_icall_System_Threading_Thread_VolatileWrite2},
+ {"VolatileWrite(intptr&,intptr)", ves_icall_System_Threading_Thread_VolatileWriteIntPtr},
+ {"VolatileWrite(long&,long)", ves_icall_System_Threading_Thread_VolatileWrite8},
+ {"VolatileWrite(object&,object)", ves_icall_System_Threading_Thread_VolatileWriteIntPtr},
+ {"VolatileWrite(sbyte&,sbyte)", ves_icall_System_Threading_Thread_VolatileWrite1},
+ {"VolatileWrite(single&,single)", ves_icall_System_Threading_Thread_VolatileWrite4},
+ {"VolatileWrite(uint&,uint)", ves_icall_System_Threading_Thread_VolatileWrite2},
+ {"VolatileWrite(uint16&,uint16)", ves_icall_System_Threading_Thread_VolatileWrite2},
+ {"VolatileWrite(uintptr&,uintptr)", ves_icall_System_Threading_Thread_VolatileWriteIntPtr},
+ {"VolatileWrite(ulong&,ulong)", ves_icall_System_Threading_Thread_VolatileWrite8},
+ {"current_lcid()", ves_icall_System_Threading_Thread_current_lcid}
+};
+
+static const IcallEntry threadpool_icalls [] = {
+ {"BindHandleInternal", ves_icall_System_Threading_ThreadPool_BindHandle},
+ {"GetAvailableThreads", ves_icall_System_Threading_ThreadPool_GetAvailableThreads},
+ {"GetMaxThreads", ves_icall_System_Threading_ThreadPool_GetMaxThreads},
+ {"GetMinThreads", ves_icall_System_Threading_ThreadPool_GetMinThreads},
+ {"SetMinThreads", ves_icall_System_Threading_ThreadPool_SetMinThreads}
+};
+
+static const IcallEntry waithandle_icalls [] = {
+ {"WaitAll_internal", ves_icall_System_Threading_WaitHandle_WaitAll_internal},
+ {"WaitAny_internal", ves_icall_System_Threading_WaitHandle_WaitAny_internal},
+ {"WaitOne_internal", ves_icall_System_Threading_WaitHandle_WaitOne_internal}
+};
+
+static const IcallEntry type_icalls [] = {
+ {"BindGenericParameters", ves_icall_Type_BindGenericParameters},
+ {"Equals", ves_icall_type_Equals},
+ {"GetGenericParameterAttributes", ves_icall_Type_GetGenericParameterAttributes},
+ {"GetGenericParameterConstraints_impl", ves_icall_Type_GetGenericParameterConstraints},
+ {"GetGenericParameterPosition", ves_icall_Type_GetGenericParameterPosition},
+ {"GetGenericTypeDefinition_impl", ves_icall_Type_GetGenericTypeDefinition_impl},
+ {"GetInterfaceMapData", ves_icall_Type_GetInterfaceMapData},
+ {"GetPacking", ves_icall_Type_GetPacking},
+ {"GetTypeCode", ves_icall_type_GetTypeCode},
+ {"IsArrayImpl", ves_icall_Type_IsArrayImpl},
+ {"IsInstanceOfType", ves_icall_type_IsInstanceOfType},
+ {"MakePointerType", ves_icall_Type_MakePointerType},
+ {"get_IsGenericInstance", ves_icall_Type_get_IsGenericInstance},
+ {"get_IsGenericTypeDefinition", ves_icall_Type_get_IsGenericTypeDefinition},
+ {"internal_from_handle", ves_icall_type_from_handle},
+ {"internal_from_name", ves_icall_type_from_name},
+ {"make_array_type", ves_icall_Type_make_array_type},
+ {"make_byref_type", ves_icall_Type_make_byref_type},
+ {"type_is_assignable_from", ves_icall_type_is_assignable_from},
+ {"type_is_subtype_of", ves_icall_type_is_subtype_of}
};
+static const IcallEntry typedref_icalls [] = {
+ {"ToObject", mono_TypedReference_ToObject}
+};
+
+static const IcallEntry valuetype_icalls [] = {
+ {"InternalEquals", ves_icall_System_ValueType_Equals},
+ {"InternalGetHashCode", ves_icall_System_ValueType_InternalGetHashCode}
+};
+
+static const IcallEntry web_icalls [] = {
+ {"GetMachineConfigPath", ves_icall_System_Configuration_DefaultConfig_get_machine_config_path},
+ {"GetMachineInstallDirectory", ves_icall_System_Web_Util_ICalls_get_machine_install_dir}
+};
+
+static const IcallEntry identity_icalls [] = {
+ {"GetCurrentToken", ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken},
+ {"GetTokenName", ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName},
+ {"GetUserToken", ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken},
+ {"_GetRoles", ves_icall_System_Security_Principal_WindowsIdentity_GetRoles}
+};
+
+static const IcallEntry impersonation_icalls [] = {
+ {"CloseToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken},
+ {"DuplicateToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken},
+ {"RevertToSelf", ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf},
+ {"SetCurrentToken", ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken}
+};
+
+static const IcallEntry principal_icalls [] = {
+ {"IsMemberOfGroupId", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId},
+ {"IsMemberOfGroupName", ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName}
+};
+
+static const IcallEntry keypair_icalls [] = {
+ {"_CanSecure", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure},
+ {"_IsMachineProtected", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected},
+ {"_IsUserProtected", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected},
+ {"_ProtectMachine", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine},
+ {"_ProtectUser", ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser}
+};
+
+/* proto
+static const IcallEntry array_icalls [] = {
+};
+
+*/
+
+/* keep the entries all sorted */
+static const IcallMap icall_entries [] = {
+ {"Mono.Security.Cryptography.KeyPairPersistence", keypair_icalls, G_N_ELEMENTS (keypair_icalls)},
+ {"System.Activator", activator_icalls, G_N_ELEMENTS (activator_icalls)},
+ {"System.AppDomain", appdomain_icalls, G_N_ELEMENTS (appdomain_icalls)},
+ {"System.ArgIterator", argiterator_icalls, G_N_ELEMENTS (argiterator_icalls)},
+ {"System.Array", array_icalls, G_N_ELEMENTS (array_icalls)},
+ {"System.Buffer", buffer_icalls, G_N_ELEMENTS (buffer_icalls)},
+ {"System.Char", char_icalls, G_N_ELEMENTS (char_icalls)},
+ {"System.Configuration.DefaultConfig", defaultconf_icalls, G_N_ELEMENTS (defaultconf_icalls)},
+ {"System.CurrentTimeZone", timezone_icalls, G_N_ELEMENTS (timezone_icalls)},
+ {"System.DateTime", datetime_icalls, G_N_ELEMENTS (datetime_icalls)},
+ {"System.Decimal", decimal_icalls, G_N_ELEMENTS (decimal_icalls)},
+ {"System.Delegate", delegate_icalls, G_N_ELEMENTS (delegate_icalls)},
+ {"System.Diagnostics.DefaultTraceListener", tracelist_icalls, G_N_ELEMENTS (tracelist_icalls)},
+ {"System.Diagnostics.FileVersionInfo", fileversion_icalls, G_N_ELEMENTS (fileversion_icalls)},
+ {"System.Diagnostics.Process", process_icalls, G_N_ELEMENTS (process_icalls)},
+ {"System.Double", double_icalls, G_N_ELEMENTS (double_icalls)},
+ {"System.Enum", enum_icalls, G_N_ELEMENTS (enum_icalls)},
+ {"System.Environment", environment_icalls, G_N_ELEMENTS (environment_icalls)},
+ {"System.GC", gc_icalls, G_N_ELEMENTS (gc_icalls)},
+ {"System.Globalization.CompareInfo", compareinfo_icalls, G_N_ELEMENTS (compareinfo_icalls)},
+ {"System.Globalization.CultureInfo", cultureinfo_icalls, G_N_ELEMENTS (cultureinfo_icalls)},
+ {"System.IO.FAMWatcher", famwatcher_icalls, G_N_ELEMENTS (famwatcher_icalls)},
+ {"System.IO.FileSystemWatcher", filewatcher_icalls, G_N_ELEMENTS (filewatcher_icalls)},
+ {"System.IO.MonoIO", monoio_icalls, G_N_ELEMENTS (monoio_icalls)},
+ {"System.IO.Path", path_icalls, G_N_ELEMENTS (path_icalls)},
+ {"System.Math", math_icalls, G_N_ELEMENTS (math_icalls)},
+ {"System.MonoCustomAttrs", customattrs_icalls, G_N_ELEMENTS (customattrs_icalls)},
+ {"System.MonoEnumInfo", enuminfo_icalls, G_N_ELEMENTS (enuminfo_icalls)},
+ {"System.MonoType", monotype_icalls, G_N_ELEMENTS (monotype_icalls)},
+ {"System.Net.Dns", dns_icalls, G_N_ELEMENTS (dns_icalls)},
+ {"System.Net.Sockets.Socket", socket_icalls, G_N_ELEMENTS (socket_icalls)},
+ {"System.Net.Sockets.SocketException", socketex_icalls, G_N_ELEMENTS (socketex_icalls)},
+ {"System.Object", object_icalls, G_N_ELEMENTS (object_icalls)},
+ {"System.Reflection.Assembly", assembly_icalls, G_N_ELEMENTS (assembly_icalls)},
+ {"System.Reflection.Emit.AssemblyBuilder", assemblybuilder_icalls, G_N_ELEMENTS (assemblybuilder_icalls)},
+ {"System.Reflection.Emit.CustomAttributeBuilder", customattrbuilder_icalls, G_N_ELEMENTS (customattrbuilder_icalls)},
+ {"System.Reflection.Emit.DynamicMethod", dynamicmethod_icalls, G_N_ELEMENTS (dynamicmethod_icalls)},
+ {"System.Reflection.Emit.EnumBuilder", enumbuilder_icalls, G_N_ELEMENTS (enumbuilder_icalls)},
+ {"System.Reflection.Emit.GenericTypeParameterBuilder", generictypeparambuilder_icalls, G_N_ELEMENTS (generictypeparambuilder_icalls)},
+ {"System.Reflection.Emit.MethodBuilder", methodbuilder_icalls, G_N_ELEMENTS (methodbuilder_icalls)},
+ {"System.Reflection.Emit.ModuleBuilder", modulebuilder_icalls, G_N_ELEMENTS (modulebuilder_icalls)},
+ {"System.Reflection.Emit.SignatureHelper", signaturehelper_icalls, G_N_ELEMENTS (signaturehelper_icalls)},
+ {"System.Reflection.Emit.TypeBuilder", typebuilder_icalls, G_N_ELEMENTS (typebuilder_icalls)},
+ {"System.Reflection.FieldInfo", fieldinfo_icalls, G_N_ELEMENTS (fieldinfo_icalls)},
+ {"System.Reflection.MemberInfo", memberinfo_icalls, G_N_ELEMENTS (memberinfo_icalls)},
+ {"System.Reflection.MethodBase", methodbase_icalls, G_N_ELEMENTS (methodbase_icalls)},
+ {"System.Reflection.Module", module_icalls, G_N_ELEMENTS (module_icalls)},
+ {"System.Reflection.MonoCMethod", monocmethod_icalls, G_N_ELEMENTS (monocmethod_icalls)},
+ {"System.Reflection.MonoEventInfo", monoeventinfo_icalls, G_N_ELEMENTS (monoeventinfo_icalls)},
+ {"System.Reflection.MonoField", monofield_icalls, G_N_ELEMENTS (monofield_icalls)},
+ {"System.Reflection.MonoGenericInst", monogenericinst_icalls, G_N_ELEMENTS (monogenericinst_icalls)},
+ {"System.Reflection.MonoMethod", monomethod_icalls, G_N_ELEMENTS (monomethod_icalls)},
+ {"System.Reflection.MonoMethodInfo", monomethodinfo_icalls, G_N_ELEMENTS (monomethodinfo_icalls)},
+ {"System.Reflection.MonoPropertyInfo", monopropertyinfo_icalls, G_N_ELEMENTS (monopropertyinfo_icalls)},
+ {"System.Reflection.ParameterInfo", parameterinfo_icalls, G_N_ELEMENTS (parameterinfo_icalls)},
+ {"System.Runtime.CompilerServices.RuntimeHelpers", runtimehelpers_icalls, G_N_ELEMENTS (runtimehelpers_icalls)},
+ {"System.Runtime.InteropServices.GCHandle", gchandle_icalls, G_N_ELEMENTS (gchandle_icalls)},
+ {"System.Runtime.InteropServices.Marshal", marshal_icalls, G_N_ELEMENTS (marshal_icalls)},
+ {"System.Runtime.Remoting.Activation.ActivationServices", activationservices_icalls, G_N_ELEMENTS (activationservices_icalls)},
+ {"System.Runtime.Remoting.Messaging.MonoMethodMessage", monomethodmessage_icalls, G_N_ELEMENTS (monomethodmessage_icalls)},
+ {"System.Runtime.Remoting.Proxies.RealProxy", realproxy_icalls, G_N_ELEMENTS (realproxy_icalls)},
+ {"System.Runtime.Remoting.RemotingServices", remotingservices_icalls, G_N_ELEMENTS (remotingservices_icalls)},
+ {"System.RuntimeMethodHandle", methodhandle_icalls, G_N_ELEMENTS (methodhandle_icalls)},
+ {"System.Security.Cryptography.RNGCryptoServiceProvider", rng_icalls, G_N_ELEMENTS (rng_icalls)},
+ {"System.Security.Principal.WindowsIdentity", identity_icalls, G_N_ELEMENTS (identity_icalls)},
+ {"System.Security.Principal.WindowsImpersonationContext", impersonation_icalls, G_N_ELEMENTS (impersonation_icalls)},
+ {"System.Security.Principal.WindowsPrincipal", principal_icalls, G_N_ELEMENTS (principal_icalls)},
+ {"System.String", string_icalls, G_N_ELEMENTS (string_icalls)},
+ {"System.Text.Encoding", encoding_icalls, G_N_ELEMENTS (encoding_icalls)},
+ {"System.Threading.Interlocked", interlocked_icalls, G_N_ELEMENTS (interlocked_icalls)},
+ {"System.Threading.Monitor", monitor_icalls, G_N_ELEMENTS (monitor_icalls)},
+ {"System.Threading.Mutex", mutex_icalls, G_N_ELEMENTS (mutex_icalls)},
+ {"System.Threading.NativeEventCalls", nativeevents_icalls, G_N_ELEMENTS (nativeevents_icalls)},
+ {"System.Threading.Thread", thread_icalls, G_N_ELEMENTS (thread_icalls)},
+ {"System.Threading.ThreadPool", threadpool_icalls, G_N_ELEMENTS (threadpool_icalls)},
+ {"System.Threading.WaitHandle", waithandle_icalls, G_N_ELEMENTS (waithandle_icalls)},
+ {"System.Type", type_icalls, G_N_ELEMENTS (type_icalls)},
+ {"System.TypedReference", typedref_icalls, G_N_ELEMENTS (typedref_icalls)},
+ {"System.ValueType", valuetype_icalls, G_N_ELEMENTS (valuetype_icalls)},
+ {"System.Web.Util.ICalls", web_icalls, G_N_ELEMENTS (web_icalls)}
+};
+
+static GHashTable *icall_hash = NULL;
+static GHashTable *jit_icall_hash_name = NULL;
+static GHashTable *jit_icall_hash_addr = NULL;
+
void
mono_init_icall (void)
{
- const char *name;
int i = 0;
- while ((name = icall_map [i])) {
- mono_add_internal_call (name, icall_map [i+1]);
- i += 2;
+ /* check that tables are sorted: disable in release */
+ if (TRUE) {
+ int j;
+ const IcallMap *imap;
+ const IcallEntry *ientry;
+ const char *prev_class = NULL;
+ const char *prev_method;
+
+ for (i = 0; i < G_N_ELEMENTS (icall_entries); ++i) {
+ imap = &icall_entries [i];
+ prev_method = NULL;
+ if (prev_class && strcmp (prev_class, imap->klass) >= 0)
+ g_print ("class %s should come before class %s\n", imap->klass, prev_class);
+ prev_class = imap->klass;
+ for (j = 0; j < imap->size; ++j) {
+ ientry = &imap->icalls [j];
+ if (prev_method && strcmp (prev_method, ientry->method) >= 0)
+ g_print ("method %s should come before method %s\n", ientry->method, prev_method);
+ prev_method = ientry->method;
+ }
+ }
+ }
+
+ icall_hash = g_hash_table_new (g_str_hash , g_str_equal);
+}
+
+void
+mono_add_internal_call (const char *name, gconstpointer method)
+{
+ mono_loader_lock ();
+
+ g_hash_table_insert (icall_hash, g_strdup (name), (gpointer) method);
+
+ mono_loader_unlock ();
+}
+
+static int
+compare_class_imap (const void *key, const void *elem)
+{
+ const IcallMap* imap = (const IcallMap*)elem;
+ return strcmp (key, imap->klass);
+}
+
+static const IcallMap*
+find_class_icalls (const char *name)
+{
+ return (const IcallMap*) bsearch (name, icall_entries, G_N_ELEMENTS (icall_entries), sizeof (IcallMap), compare_class_imap);
+}
+
+static int
+compare_method_imap (const void *key, const void *elem)
+{
+ const IcallEntry* ientry = (const IcallEntry*)elem;
+ return strcmp (key, ientry->method);
+}
+
+static void*
+find_method_icall (const IcallMap *imap, const char *name)
+{
+ const IcallEntry *ientry = (const IcallEntry*) bsearch (name, imap->icalls, imap->size, sizeof (IcallEntry), compare_method_imap);
+ if (ientry)
+ return (void*)ientry->func;
+ return NULL;
+}
+
+/*
+ * we should probably export this as an helper (handle nested types).
+ * Returns the number of chars written in buf.
+ */
+static int
+concat_class_name (char *buf, int bufsize, MonoClass *klass)
+{
+ int nspacelen, cnamelen;
+ nspacelen = strlen (klass->name_space);
+ cnamelen = strlen (klass->name);
+ if (nspacelen + cnamelen + 2 > bufsize)
+ return 0;
+ if (nspacelen) {
+ memcpy (buf, klass->name_space, nspacelen);
+ buf [nspacelen ++] = '.';
+ }
+ memcpy (buf + nspacelen, klass->name, cnamelen);
+ buf [nspacelen + cnamelen] = 0;
+ return nspacelen + cnamelen;
+}
+
+gpointer
+mono_lookup_internal_call (MonoMethod *method)
+{
+ char *sigstart;
+ char *tmpsig;
+ char mname [2048];
+ int typelen = 0, mlen, siglen;
+ gpointer res;
+ const IcallMap *imap;
+
+ g_assert (method != NULL);
+
+ typelen = concat_class_name (mname, sizeof (mname), method->klass);
+ if (!typelen)
+ return NULL;
+
+ imap = find_class_icalls (mname);
+
+ mname [typelen] = ':';
+ mname [typelen + 1] = ':';
+
+ mlen = strlen (method->name);
+ memcpy (mname + typelen + 2, method->name, mlen);
+ sigstart = mname + typelen + 2 + mlen;
+ *sigstart = 0;
+
+ tmpsig = mono_signature_get_desc (method->signature, TRUE);
+ siglen = strlen (tmpsig);
+ if (typelen + mlen + siglen + 6 > sizeof (mname))
+ return NULL;
+ sigstart [0] = '(';
+ memcpy (sigstart + 1, tmpsig, siglen);
+ sigstart [siglen + 1] = ')';
+ sigstart [siglen + 2] = 0;
+ g_free (tmpsig);
+
+ mono_loader_lock ();
+
+ res = g_hash_table_lookup (icall_hash, mname);
+ if (res) {
+ mono_loader_unlock ();
+ return res;
+ }
+ /* try without signature */
+ *sigstart = 0;
+ res = g_hash_table_lookup (icall_hash, mname);
+ if (res) {
+ mono_loader_unlock ();
+ return res;
+ }
+
+ /* it wasn't found in the static call tables */
+ if (!imap) {
+ mono_loader_unlock ();
+ return NULL;
}
-
+ res = find_method_icall (imap, sigstart - mlen);
+ if (res) {
+ mono_loader_unlock ();
+ return res;
+ }
+ /* try _with_ signature */
+ *sigstart = '(';
+ res = find_method_icall (imap, sigstart - mlen);
+ if (res) {
+ mono_loader_unlock ();
+ return res;
+ }
+
+ g_warning ("cant resolve internal call to \"%s\" (tested without signature also)", mname);
+ g_print ("\nYour mono runtime and class libraries are out of sync.\n");
+ g_print ("The out of sync library is: %s\n", method->klass->image->name);
+ g_print ("\nWhen you update one from cvs you need to update, compile and install\nthe other too.\n");
+ g_print ("Do not report this as a bug unless you're sure you have updated correctly:\nyou probably have a broken mono install.\n");
+ g_print ("If you see other errors or faults after this message they are probably related\n");
+ g_print ("and you need to fix your mono install first.\n");
+
+ mono_loader_unlock ();
+
+ return NULL;
+}
+
+static MonoType*
+type_from_typename (char *typename)
+{
+ MonoClass *klass = NULL; /* assignment to shut GCC warning up */
+
+ if (!strcmp (typename, "int"))
+ klass = mono_defaults.int_class;
+ else if (!strcmp (typename, "ptr"))
+ klass = mono_defaults.int_class;
+ else if (!strcmp (typename, "void"))
+ klass = mono_defaults.void_class;
+ else if (!strcmp (typename, "int32"))
+ klass = mono_defaults.int32_class;
+ else if (!strcmp (typename, "uint32"))
+ klass = mono_defaults.uint32_class;
+ else if (!strcmp (typename, "long"))
+ klass = mono_defaults.int64_class;
+ else if (!strcmp (typename, "ulong"))
+ klass = mono_defaults.uint64_class;
+ else if (!strcmp (typename, "float"))
+ klass = mono_defaults.single_class;
+ else if (!strcmp (typename, "double"))
+ klass = mono_defaults.double_class;
+ else if (!strcmp (typename, "object"))
+ klass = mono_defaults.object_class;
+ else if (!strcmp (typename, "obj"))
+ klass = mono_defaults.object_class;
+ else {
+ g_error (typename);
+ g_assert_not_reached ();
+ }
+ return &klass->byval_arg;
}
+MonoMethodSignature*
+mono_create_icall_signature (const char *sigstr)
+{
+ gchar **parts;
+ int i, len;
+ gchar **tmp;
+ MonoMethodSignature *res;
+
+ mono_loader_lock ();
+ res = g_hash_table_lookup (mono_defaults.corlib->helper_signatures, sigstr);
+ if (res) {
+ mono_loader_unlock ();
+ return res;
+ }
+
+ parts = g_strsplit (sigstr, " ", 256);
+
+ tmp = parts;
+ len = 0;
+ while (*tmp) {
+ len ++;
+ tmp ++;
+ }
+
+ res = mono_metadata_signature_alloc (mono_defaults.corlib, len - 1);
+ res->pinvoke = 1;
+
+#ifdef PLATFORM_WIN32
+ /*
+ * Under windows, the default pinvoke calling convention is STDCALL but
+ * we need CDECL.
+ */
+ res->call_convention = MONO_CALL_C;
+#endif
+
+ res->ret = type_from_typename (parts [0]);
+ for (i = 1; i < len; ++i) {
+ res->params [i - 1] = type_from_typename (parts [i]);
+ }
+
+ g_strfreev (parts);
+
+ g_hash_table_insert (mono_defaults.corlib->helper_signatures, (gpointer)sigstr, res);
+
+ mono_loader_unlock ();
+ return res;
+}
+
+MonoJitICallInfo *
+mono_find_jit_icall_by_name (const char *name)
+{
+ MonoJitICallInfo *info;
+ g_assert (jit_icall_hash_name);
+
+ mono_loader_lock ();
+ info = g_hash_table_lookup (jit_icall_hash_name, name);
+ mono_loader_unlock ();
+ return info;
+}
+
+MonoJitICallInfo *
+mono_find_jit_icall_by_addr (gconstpointer addr)
+{
+ MonoJitICallInfo *info;
+ g_assert (jit_icall_hash_addr);
+
+ mono_loader_lock ();
+ info = g_hash_table_lookup (jit_icall_hash_addr, (gpointer)addr);
+ mono_loader_unlock ();
+
+ return info;
+}
+
+void
+mono_register_jit_icall_wrapper (MonoJitICallInfo *info, gconstpointer wrapper)
+{
+ mono_loader_lock ();
+ g_hash_table_insert (jit_icall_hash_addr, (gpointer)info->wrapper, info);
+ mono_loader_unlock ();
+}
+
+MonoJitICallInfo *
+mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save)
+{
+ MonoJitICallInfo *info;
+
+ g_assert (func);
+ g_assert (name);
+
+ mono_loader_lock ();
+
+ if (!jit_icall_hash_name) {
+ jit_icall_hash_name = g_hash_table_new (g_str_hash, g_str_equal);
+ jit_icall_hash_addr = g_hash_table_new (NULL, NULL);
+ }
+
+ if (g_hash_table_lookup (jit_icall_hash_name, name)) {
+ g_warning ("jit icall already defined \"%s\"\n", name);
+ g_assert_not_reached ();
+ }
+
+ info = g_new (MonoJitICallInfo, 1);
+
+ info->name = name;
+ info->func = func;
+ info->sig = sig;
+
+ if (is_save) {
+ info->wrapper = func;
+ } else {
+ info->wrapper = NULL;
+ }
+
+ g_hash_table_insert (jit_icall_hash_name, (gpointer)info->name, info);
+ g_hash_table_insert (jit_icall_hash_addr, (gpointer)func, info);
+
+ mono_loader_unlock ();
+ return info;
+}
diff --git a/mono/metadata/image.c b/mono/metadata/image.c
index 22ac4f49045..70abd5fc6e5 100644
--- a/mono/metadata/image.c
+++ b/mono/metadata/image.c
@@ -2,13 +2,12 @@
* image.c: Routines for manipulating an image stored in an
* extended PE/COFF file.
*
- * Author:
+ * Authors:
* Miguel de Icaza (miguel@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
*
- * (C) 2001 Ximian, Inc. http://www.ximian.com
+ * (C) 2001-2003 Ximian, Inc. http://www.ximian.com
*
- * TODO:
- * Implement big-endian versions of the reading routines.
*/
#include <config.h>
#include <stdio.h>
@@ -22,6 +21,9 @@
#include "mono-endian.h"
#include "private.h"
#include "tabledefs.h"
+#include "tokentype.h"
+#include "metadata-internals.h"
+#include <mono/io-layer/io-layer.h>
#define INVALID_ADDRESS 0xffffffff
@@ -29,6 +31,9 @@
* Keeps track of the various assemblies loaded
*/
static GHashTable *loaded_images_hash;
+static GHashTable *loaded_images_guid_hash;
+
+static CRITICAL_SECTION images_mutex;
guint32
mono_cli_rva_image_map (MonoCLIImageInfo *iinfo, guint32 addr)
@@ -48,8 +53,9 @@ mono_cli_rva_image_map (MonoCLIImageInfo *iinfo, guint32 addr)
}
char *
-mono_cli_rva_map (MonoCLIImageInfo *iinfo, guint32 addr)
+mono_image_rva_map (MonoImage *image, guint32 addr)
{
+ MonoCLIImageInfo *iinfo = image->image_info;
const int top = iinfo->cli_section_count;
MonoSectionTable *tables = iinfo->cli_section_tables;
int i;
@@ -57,6 +63,10 @@ mono_cli_rva_map (MonoCLIImageInfo *iinfo, guint32 addr)
for (i = 0; i < top; i++){
if ((addr >= tables->st_virtual_address) &&
(addr < tables->st_virtual_address + tables->st_raw_data_size)){
+ if (!iinfo->cli_sections [i]) {
+ if (!mono_image_ensure_section_idx (image, i))
+ return NULL;
+ }
return (char*)iinfo->cli_sections [i] +
(addr - tables->st_virtual_address);
}
@@ -65,6 +75,62 @@ mono_cli_rva_map (MonoCLIImageInfo *iinfo, guint32 addr)
return NULL;
}
+static gchar *
+canonicalize_path (const char *path)
+{
+ gchar *abspath, *pos, *lastpos, *dest;
+ int backc;
+
+ if (g_path_is_absolute (path)) {
+ abspath = g_strdup (path);
+ } else {
+ gchar *tmpdir = g_get_current_dir ();
+ abspath = g_build_filename (tmpdir, path, NULL);
+ g_free (tmpdir);
+ }
+
+ abspath = g_strreverse (abspath);
+
+ backc = 0;
+ dest = lastpos = abspath;
+ pos = strchr (lastpos, G_DIR_SEPARATOR);
+
+ while (pos != NULL) {
+ int len = pos - lastpos;
+ if (len == 1 && lastpos [0] == '.') {
+ // nop
+ } else if (len == 2 && lastpos [0] == '.' && lastpos [1] == '.') {
+ backc++;
+ } else if (len > 0) {
+ if (backc > 0) {
+ backc--;
+ } else {
+ if (dest != lastpos) strncpy (dest, lastpos, len + 1);
+ dest += len + 1;
+ }
+ }
+ lastpos = pos + 1;
+ pos = strchr (lastpos, G_DIR_SEPARATOR);
+ }
+
+ if (dest != lastpos) strcpy (dest, lastpos);
+ return g_strreverse (abspath);
+}
+
+/**
+ * mono_images_init:
+ *
+ * Initialize the global variables used by this module.
+ */
+void
+mono_images_init (void)
+{
+ InitializeCriticalSection (&images_mutex);
+
+ loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ loaded_images_guid_hash = g_hash_table_new (g_str_hash, g_str_equal);
+}
+
/**
* mono_image_ensure_section_idx:
* @image: The image we are operating on
@@ -91,6 +157,13 @@ mono_image_ensure_section_idx (MonoImage *image, int section)
writable = sect->st_flags & SECT_FLAGS_MEM_WRITE;
+ if (!image->f) {
+ if (sect->st_raw_data_ptr + sect->st_raw_data_size > image->raw_data_len)
+ return FALSE;
+ /* FIXME: we ignore the writable flag since we don't patch the binary */
+ iinfo->cli_sections [section] = image->raw_data + sect->st_raw_data_ptr;
+ return TRUE;
+ }
iinfo->cli_sections [section] = mono_raw_buffer_load (
fileno (image->f), writable,
sect->st_raw_data_ptr, sect->st_raw_data_size);
@@ -127,7 +200,7 @@ mono_image_ensure_section (MonoImage *image, const char *section)
}
static int
-load_section_tables (MonoImage *image, MonoCLIImageInfo *iinfo)
+load_section_tables (MonoImage *image, MonoCLIImageInfo *iinfo, guint32 offset)
{
const int top = iinfo->cli_header.coff.coff_sections;
int i;
@@ -138,9 +211,16 @@ load_section_tables (MonoImage *image, MonoCLIImageInfo *iinfo)
for (i = 0; i < top; i++){
MonoSectionTable *t = &iinfo->cli_section_tables [i];
-
- if (fread (t, sizeof (MonoSectionTable), 1, image->f) != 1)
- return FALSE;
+
+ if (!image->f) {
+ if (offset + sizeof (MonoSectionTable) > image->raw_data_len)
+ return FALSE;
+ memcpy (t, image->raw_data + offset, sizeof (MonoSectionTable));
+ offset += sizeof (MonoSectionTable);
+ } else {
+ if (fread (t, sizeof (MonoSectionTable), 1, image->f) != 1)
+ return FALSE;
+ }
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
t->st_virtual_size = GUINT32_FROM_LE (t->st_virtual_size);
@@ -156,10 +236,6 @@ load_section_tables (MonoImage *image, MonoCLIImageInfo *iinfo)
/* consistency checks here */
}
- for (i = 0; i < top; i++)
- if (!mono_image_ensure_section_idx (image, i))
- return FALSE;
-
return TRUE;
}
@@ -173,11 +249,17 @@ load_cli_header (MonoImage *image, MonoCLIImageInfo *iinfo)
if (offset == INVALID_ADDRESS)
return FALSE;
- if (fseek (image->f, offset, SEEK_SET) != 0)
- return FALSE;
+ if (!image->f) {
+ if (offset + sizeof (MonoCLIHeader) > image->raw_data_len)
+ return FALSE;
+ memcpy (&iinfo->cli_cli_header, image->raw_data + offset, sizeof (MonoCLIHeader));
+ } else {
+ if (fseek (image->f, offset, SEEK_SET) != 0)
+ return FALSE;
- if ((n = fread (&iinfo->cli_cli_header, sizeof (MonoCLIHeader), 1, image->f)) != 1)
- return FALSE;
+ if ((n = fread (&iinfo->cli_cli_header, sizeof (MonoCLIHeader), 1, image->f)) != 1)
+ return FALSE;
+ }
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
#define SWAP32(x) (x) = GUINT32_FROM_LE ((x))
@@ -236,15 +318,25 @@ load_metadata_ptrs (MonoImage *image, MonoCLIImageInfo *iinfo)
guint32 offset, size;
guint16 streams;
int i;
+ guint32 pad;
char *ptr;
offset = mono_cli_rva_image_map (iinfo, iinfo->cli_cli_header.ch_metadata.rva);
- size = iinfo->cli_cli_header.ch_metadata.size;
-
- image->raw_metadata = mono_raw_buffer_load (fileno (image->f), FALSE, offset, size);
- if (image->raw_metadata == NULL)
+ if (offset == INVALID_ADDRESS)
return FALSE;
+ size = iinfo->cli_cli_header.ch_metadata.size;
+
+ if (!image->f) {
+ if (offset + size > image->raw_data_len)
+ return FALSE;
+ image->raw_metadata = image->raw_data + offset;
+ } else {
+ image->raw_metadata = mono_raw_buffer_load (fileno (image->f), FALSE, offset, size);
+ if (image->raw_metadata == NULL)
+ return FALSE;
+ }
+
ptr = image->raw_metadata;
if (strncmp (ptr, "BSJB", 4) == 0){
@@ -253,9 +345,11 @@ load_metadata_ptrs (MonoImage *image, MonoCLIImageInfo *iinfo)
ptr += 12;
version_string_len = read32 (ptr);
ptr += 4;
+ image->version = g_strndup (ptr, version_string_len);
ptr += version_string_len;
- if (((guint32) ptr) % 4)
- ptr += 4 - (((guint32) ptr) %4);
+ pad = ptr - image->raw_metadata;
+ if (pad % 4)
+ ptr += 4 - (pad % 4);
} else
return FALSE;
@@ -286,14 +380,23 @@ load_metadata_ptrs (MonoImage *image, MonoCLIImageInfo *iinfo)
image->heap_guid.data = image->raw_metadata + read32 (ptr);
image->heap_guid.size = read32 (ptr + 4);
ptr += 8 + 6;
+ } else if (strncmp (ptr + 8, "#-", 3) == 0) {
+ g_print ("Assembly '%s' has the non-standard metadata heap #-.\nRecompile it correctly (without the /incremental switch or in Release mode).", image->name);
+ return FALSE;
} else {
g_message ("Unknown heap type: %s\n", ptr + 8);
- ptr += 8 + strlen (ptr) + 1;
- }
- if (((guint32)ptr) % 4){
- ptr += 4 - (((guint32)ptr) % 4);
+ ptr += 8 + strlen (ptr + 8) + 1;
}
+ pad = ptr - image->raw_metadata;
+ if (pad % 4)
+ ptr += 4 - (pad % 4);
}
+
+ g_assert (image->heap_guid.data);
+ g_assert (image->heap_guid.size >= 16);
+
+ image->guid = mono_guid_to_string (image->heap_guid.data);
+
return TRUE;
}
@@ -323,8 +426,8 @@ load_tables (MonoImage *image)
image->tables [table].rows = 0;
continue;
}
- if (table > 0x2b) {
- g_warning("bits in valid must be zero above 0x2b (II - 23.1.6)");
+ if (table > MONO_TABLE_LAST) {
+ g_warning("bits in valid must be zero above 0x2d (II - 23.1.6)");
}
/*if ((sorted_mask & ((guint64) 1 << table)) == 0){
g_print ("table %s (0x%02x) is sorted\n", mono_meta_table_name (table), table);
@@ -352,6 +455,58 @@ load_metadata (MonoImage *image, MonoCLIImageInfo *iinfo)
return load_tables (image);
}
+void
+mono_image_add_to_name_cache (MonoImage *image, const char *nspace,
+ const char *name, guint32 index)
+{
+ GHashTable *nspace_table;
+ GHashTable *name_cache = image->name_cache;
+
+ if (!(nspace_table = g_hash_table_lookup (name_cache, nspace))) {
+ nspace_table = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (name_cache, (char *)nspace, (char *)nspace_table);
+ }
+ g_hash_table_insert (nspace_table, (char *) name, GUINT_TO_POINTER (index));
+}
+
+static void
+load_modules (MonoImage *image, MonoImageOpenStatus *status)
+{
+ MonoTableInfo *t;
+ int i;
+ char *base_dir;
+
+ if (image->modules)
+ return;
+
+ t = &image->tables [MONO_TABLE_MODULEREF];
+ image->modules = g_new0 (MonoImage *, t->rows);
+ image->module_count = t->rows;
+ base_dir = g_path_get_dirname (image->name);
+ for (i = 0; i < t->rows; i++){
+ char *module_ref;
+ const char *name;
+ guint32 cols [MONO_MODULEREF_SIZE];
+
+ mono_metadata_decode_row (t, i, cols, MONO_MODULEREF_SIZE);
+ name = mono_metadata_string_heap (image, cols [MONO_MODULEREF_NAME]);
+ module_ref = g_build_filename (base_dir, name, NULL);
+ image->modules [i] = mono_image_open (module_ref, status);
+ if (image->modules [i]) {
+ /* g_print ("loaded module %s from %s (%p)\n", module_ref, image->name, image->assembly); */
+ }
+ /*
+ * FIXME: what do we do here? it could be a native dll...
+ * We should probably do lazy-loading of modules.
+ */
+ if (status)
+ *status = MONO_IMAGE_OK;
+ g_free (module_ref);
+ }
+
+ g_free (base_dir);
+}
+
static void
load_class_names (MonoImage *image)
{
@@ -359,9 +514,11 @@ load_class_names (MonoImage *image)
guint32 cols [MONO_TYPEDEF_SIZE];
const char *name;
const char *nspace;
- GHashTable *nspace_table;
- GHashTable *name_cache = image->name_cache;
- guint32 i, visib;
+ guint32 i, visib, nspace_index;
+ GHashTable *name_cache2, *nspace_table;
+
+ /* Temporary hash table to avoid lookups in the nspace_table */
+ name_cache2 = g_hash_table_new (NULL, NULL);
for (i = 1; i <= t->rows; ++i) {
mono_metadata_decode_row (t, i - 1, cols, MONO_TYPEDEF_SIZE);
@@ -371,60 +528,141 @@ load_class_names (MonoImage *image)
continue;
name = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]);
nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]);
- if (!(nspace_table = g_hash_table_lookup (name_cache, nspace))) {
+
+ nspace_index = cols [MONO_TYPEDEF_NAMESPACE];
+ nspace_table = g_hash_table_lookup (name_cache2, GUINT_TO_POINTER (nspace_index));
+ if (!nspace_table) {
nspace_table = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (name_cache, (char *)nspace, (char *)nspace_table);
+ g_hash_table_insert (image->name_cache, (char*)nspace, nspace_table);
+ g_hash_table_insert (name_cache2, GUINT_TO_POINTER (nspace_index),
+ nspace_table);
}
g_hash_table_insert (nspace_table, (char *) name, GUINT_TO_POINTER (i));
}
+
+ /* Load type names from EXPORTEDTYPES table */
+ {
+ MonoTableInfo *t = &image->tables [MONO_TABLE_EXPORTEDTYPE];
+ guint32 cols [MONO_EXP_TYPE_SIZE];
+ int i;
+
+ for (i = 0; i < t->rows; ++i) {
+ mono_metadata_decode_row (t, i, cols, MONO_EXP_TYPE_SIZE);
+ name = mono_metadata_string_heap (image, cols [MONO_EXP_TYPE_NAME]);
+ nspace = mono_metadata_string_heap (image, cols [MONO_EXP_TYPE_NAMESPACE]);
+
+ nspace_index = cols [MONO_EXP_TYPE_NAMESPACE];
+ nspace_table = g_hash_table_lookup (name_cache2, GUINT_TO_POINTER (nspace_index));
+ if (!nspace_table) {
+ nspace_table = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (image->name_cache, (char*)nspace, nspace_table);
+ g_hash_table_insert (name_cache2, GUINT_TO_POINTER (nspace_index),
+ nspace_table);
+ }
+ g_hash_table_insert (nspace_table, (char *) name, GUINT_TO_POINTER (mono_metadata_make_token (MONO_TABLE_EXPORTEDTYPE, i + 1)));
+ }
+ }
+
+ g_hash_table_destroy (name_cache2);
+}
+
+static void
+register_guid (gpointer key, gpointer value, gpointer user_data)
+{
+ MonoImage *image = (MonoImage*)value;
+
+ if (!g_hash_table_lookup (loaded_images_guid_hash, image))
+ g_hash_table_insert (loaded_images_guid_hash, image->guid, image);
+}
+
+static void
+build_guid_table (void)
+{
+ g_hash_table_foreach (loaded_images_hash, register_guid, NULL);
+}
+
+void
+mono_image_init (MonoImage *image)
+{
+ image->method_cache = g_hash_table_new (NULL, NULL);
+ image->class_cache = g_hash_table_new (NULL, NULL);
+ image->field_cache = g_hash_table_new (NULL, NULL);
+ image->name_cache = g_hash_table_new (g_str_hash, g_str_equal);
+ image->array_cache = g_hash_table_new (NULL, NULL);
+
+ image->delegate_begin_invoke_cache =
+ g_hash_table_new ((GHashFunc)mono_signature_hash,
+ (GCompareFunc)mono_metadata_signature_equal);
+ image->delegate_end_invoke_cache =
+ g_hash_table_new ((GHashFunc)mono_signature_hash,
+ (GCompareFunc)mono_metadata_signature_equal);
+ image->delegate_invoke_cache =
+ g_hash_table_new ((GHashFunc)mono_signature_hash,
+ (GCompareFunc)mono_metadata_signature_equal);
+ image->runtime_invoke_cache =
+ g_hash_table_new ((GHashFunc)mono_signature_hash,
+ (GCompareFunc)mono_metadata_signature_equal);
+
+ image->managed_wrapper_cache = g_hash_table_new (NULL, NULL);
+ image->native_wrapper_cache = g_hash_table_new (NULL, NULL);
+ image->remoting_invoke_cache = g_hash_table_new (NULL, NULL);
+ image->synchronized_cache = g_hash_table_new (NULL, NULL);
+
+ image->typespec_cache = g_hash_table_new (NULL, NULL);
+ image->memberref_signatures = g_hash_table_new (NULL, NULL);
+ image->helper_signatures = g_hash_table_new (g_str_hash, g_str_equal);
+
+ image->generic_inst_cache =
+ g_hash_table_new ((GHashFunc)mono_metadata_generic_inst_hash,
+ (GCompareFunc)mono_metadata_generic_inst_equal);
}
static MonoImage *
-do_mono_image_open (const char *fname, MonoImageOpenStatus *status)
+do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status)
{
MonoCLIImageInfo *iinfo;
MonoDotNetHeader *header;
MonoMSDOSHeader msdos;
- MonoImage *image;
int n;
+ guint32 offset = 0;
- image = g_new0 (MonoImage, 1);
- image->ref_count = 1;
- image->f = fopen (fname, "rb");
- image->name = g_strdup (fname);
- iinfo = g_new0 (MonoCLIImageInfo, 1);
- image->image_info = iinfo;
-
- image->method_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
- image->class_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
- image->name_cache = g_hash_table_new (g_str_hash, g_str_equal);
- image->array_cache = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
+ mono_image_init (image);
+ iinfo = image->image_info;
header = &iinfo->cli_header;
- if (image->f == NULL){
- if (status)
- *status = MONO_IMAGE_ERROR_ERRNO;
- mono_image_close (image);
- return NULL;
- }
-
if (status)
*status = MONO_IMAGE_IMAGE_INVALID;
-
- if (fread (&msdos, sizeof (msdos), 1, image->f) != 1)
- goto invalid_image;
+
+ if (!image->f) {
+ if (offset + sizeof (msdos) > image->raw_data_len)
+ goto invalid_image;
+ memcpy (&msdos, image->raw_data + offset, sizeof (msdos));
+ } else {
+ if (fread (&msdos, sizeof (msdos), 1, image->f) != 1)
+ goto invalid_image;
+ }
if (!(msdos.msdos_sig [0] == 'M' && msdos.msdos_sig [1] == 'Z'))
goto invalid_image;
msdos.pe_offset = GUINT32_FROM_LE (msdos.pe_offset);
- if (msdos.pe_offset != sizeof (msdos))
- fseek (image->f, msdos.pe_offset, SEEK_SET);
-
- if ((n = fread (header, sizeof (MonoDotNetHeader), 1, image->f)) != 1)
- goto invalid_image;
+ if (msdos.pe_offset != sizeof (msdos)) {
+ if (image->f)
+ fseek (image->f, msdos.pe_offset, SEEK_SET);
+ }
+ offset = msdos.pe_offset;
+
+ if (!image->f) {
+ if (offset + sizeof (MonoDotNetHeader) > image->raw_data_len)
+ goto invalid_image;
+ memcpy (header, image->raw_data + offset, sizeof (MonoDotNetHeader));
+ offset += sizeof (MonoDotNetHeader);
+ } else {
+ if ((n = fread (header, sizeof (MonoDotNetHeader), 1, image->f)) != 1)
+ goto invalid_image;
+ }
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
#define SWAP32(x) (x) = GUINT32_FROM_LE ((x))
@@ -501,14 +739,27 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status)
if (header->pesig[0] != 'P' || header->pesig[1] != 'E' || header->pe.pe_magic != 0x10B)
goto invalid_image;
+#if 0
+ /*
+ * The spec says that this field should contain 6.0, but Visual Studio includes a new compiler,
+ * which produces binaries with 7.0. From Sergey:
+ *
+ * The reason is that MSVC7 uses traditional compile/link
+ * sequence for CIL executables, and VS.NET (and Framework
+ * SDK) includes linker version 7, that puts 7.0 in this
+ * field. That's why it's currently not possible to load VC
+ * binaries with Mono. This field is pretty much meaningless
+ * anyway (what linker?).
+ */
if (header->pe.pe_major != 6 || header->pe.pe_minor != 0)
goto invalid_image;
+#endif
/*
* FIXME: byte swap all addresses here for header.
*/
- if (!load_section_tables (image, iinfo))
+ if (!load_section_tables (image, iinfo, offset))
goto invalid_image;
/* Load the CLI header */
@@ -530,6 +781,8 @@ do_mono_image_open (const char *fname, MonoImageOpenStatus *status)
mono_metadata_decode_row_col (&image->tables [MONO_TABLE_MODULE],
0, MONO_MODULE_NAME));
+ load_modules (image, status);
+
if (status)
*status = MONO_IMAGE_OK;
@@ -542,13 +795,84 @@ invalid_image:
return NULL;
}
+static MonoImage *
+do_mono_image_open (const char *fname, MonoImageOpenStatus *status)
+{
+ MonoCLIImageInfo *iinfo;
+ MonoImage *image;
+ FILE *filed;
+
+ if ((filed = fopen (fname, "rb")) == NULL){
+ if (status)
+ *status = MONO_IMAGE_ERROR_ERRNO;
+ return NULL;
+ }
+
+ image = g_new0 (MonoImage, 1);
+ image->ref_count = 1;
+ image->f = filed;
+ iinfo = g_new0 (MonoCLIImageInfo, 1);
+ image->image_info = iinfo;
+ image->name = canonicalize_path (fname);
+
+ return do_mono_image_load (image, status);
+}
+
MonoImage *
-mono_image_loaded (const char *name) {
- if (strcmp (name, "mscorlib") == 0)
- name = "corlib";
- if (loaded_images_hash)
- return g_hash_table_lookup (loaded_images_hash, name);
- return NULL;
+mono_image_loaded (const char *name)
+{
+ MonoImage *res;
+
+ EnterCriticalSection (&images_mutex);
+ res = g_hash_table_lookup (loaded_images_hash, name);
+ LeaveCriticalSection (&images_mutex);
+ return res;
+}
+
+MonoImage *
+mono_image_loaded_by_guid (const char *guid)
+{
+ MonoImage *res;
+
+ EnterCriticalSection (&images_mutex);
+ res = g_hash_table_lookup (loaded_images_guid_hash, guid);
+ LeaveCriticalSection (&images_mutex);
+ return res;
+}
+
+MonoImage *
+mono_image_open_from_data (char *data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus *status)
+{
+ MonoCLIImageInfo *iinfo;
+ MonoImage *image;
+ char *datac;
+
+ if (!data || !data_len) {
+ if (status)
+ *status = MONO_IMAGE_IMAGE_INVALID;
+ return NULL;
+ }
+ datac = data;
+ if (need_copy) {
+ datac = g_try_malloc (data_len);
+ if (!datac) {
+ if (status)
+ *status = MONO_IMAGE_ERROR_ERRNO;
+ return NULL;
+ }
+ memcpy (datac, data, data_len);
+ }
+
+ image = g_new0 (MonoImage, 1);
+ image->ref_count = 1;
+ image->raw_data = datac;
+ image->raw_data_len = data_len;
+ image->raw_data_allocated = need_copy;
+ image->name = g_strdup_printf ("data-%p", datac);
+ iinfo = g_new0 (MonoCLIImageInfo, 1);
+ image->image_info = iinfo;
+
+ return do_mono_image_load (image, status);
}
/**
@@ -562,37 +886,77 @@ mono_image_loaded (const char *name) {
MonoImage *
mono_image_open (const char *fname, MonoImageOpenStatus *status)
{
- MonoImage *image;
+ MonoImage *image, *image2;
+ char *absfname;
g_return_val_if_fail (fname != NULL, NULL);
+
+ absfname = canonicalize_path (fname);
- if (loaded_images_hash){
- image = g_hash_table_lookup (loaded_images_hash, fname);
- if (image){
- image->ref_count++;
- return image;
- }
+ /*
+ * The easiest solution would be to do all the loading inside the mutex,
+ * but that would lead to scalability problems. So we let the loading
+ * happen outside the mutex, and if multiple threads happen to load
+ * the same image, we discard all but the first copy.
+ */
+ EnterCriticalSection (&images_mutex);
+ image = g_hash_table_lookup (loaded_images_hash, absfname);
+ g_free (absfname);
+
+ if (image){
+ image->ref_count++;
+ LeaveCriticalSection (&images_mutex);
+ return image;
}
+ LeaveCriticalSection (&images_mutex);
image = do_mono_image_open (fname, status);
if (image == NULL)
return NULL;
- if (!loaded_images_hash)
- loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ EnterCriticalSection (&images_mutex);
+ image2 = g_hash_table_lookup (loaded_images_hash, image->name);
+
+ if (image2) {
+ /* Somebody else beat us to it */
+ image2->ref_count ++;
+ LeaveCriticalSection (&images_mutex);
+ mono_image_close (image);
+ return image2;
+ }
g_hash_table_insert (loaded_images_hash, image->name, image);
- if (image->assembly_name)
- g_hash_table_insert (loaded_images_hash, (char *) image->assembly_name, image);
-
+ if (image->assembly_name && (g_hash_table_lookup (loaded_images_hash, image->assembly_name) == NULL))
+ g_hash_table_insert (loaded_images_hash, (char *) image->assembly_name, image);
+ g_hash_table_insert (loaded_images_guid_hash, image->guid, image);
+ LeaveCriticalSection (&images_mutex);
+
return image;
}
static void
-free_hash_table(gpointer key, gpointer val, gpointer user_data)
+free_hash_table (gpointer key, gpointer val, gpointer user_data)
{
g_hash_table_destroy ((GHashTable*)val);
}
+static void
+free_mr_signatures (gpointer key, gpointer val, gpointer user_data)
+{
+ mono_metadata_free_method_signature ((MonoMethodSignature*)val);
+}
+
+/**
+ * mono_image_addref:
+ * @image: The image file we wish to add a reference to
+ *
+ * Increases the reference count of an image.
+ */
+void
+mono_image_addref (MonoImage *image)
+{
+ InterlockedIncrement (&image->ref_count);
+}
+
/**
* mono_image_close:
* @image: The image file we wish to close
@@ -603,23 +967,68 @@ free_hash_table(gpointer key, gpointer val, gpointer user_data)
void
mono_image_close (MonoImage *image)
{
+ MonoImage *image2;
+
g_return_if_fail (image != NULL);
- if (--image->ref_count)
+ EnterCriticalSection (&images_mutex);
+ if (--image->ref_count) {
+ LeaveCriticalSection (&images_mutex);
return;
+ }
+ image2 = g_hash_table_lookup (loaded_images_hash, image->name);
+ if (image == image2) {
+ /* This is not true if we are called from mono_image_open () */
+ g_hash_table_remove (loaded_images_hash, image->name);
+ g_hash_table_remove (loaded_images_guid_hash, image->guid);
+ /* Multiple images might have the same guid */
+ build_guid_table ();
+ }
+ if (image->assembly_name && (g_hash_table_lookup (loaded_images_hash, image->assembly_name) == image))
+ g_hash_table_remove (loaded_images_hash, (char *) image->assembly_name);
+ LeaveCriticalSection (&images_mutex);
- g_hash_table_remove (loaded_images_hash, image->name);
-
if (image->f)
fclose (image->f);
+ if (image->raw_data_allocated) {
+ /* image->raw_metadata and cli_sections might lie inside image->raw_data */
+ MonoCLIImageInfo *ii = image->image_info;
+ int i;
+ if ((image->raw_metadata > image->raw_data) &&
+ (image->raw_metadata <= (image->raw_data + image->raw_data_len)))
+ image->raw_metadata = NULL;
+
+ for (i = 0; i < ii->cli_section_count; i++)
+ if (((char*)(ii->cli_sections [i]) > image->raw_data) &&
+ ((char*)(ii->cli_sections [i]) <= ((char*)image->raw_data + image->raw_data_len)))
+ ii->cli_sections [i] = NULL;
+
+ g_free (image->raw_data);
+ }
g_free (image->name);
+ g_free (image->guid);
+ g_free (image->files);
g_hash_table_destroy (image->method_cache);
g_hash_table_destroy (image->class_cache);
+ g_hash_table_destroy (image->field_cache);
g_hash_table_destroy (image->array_cache);
g_hash_table_foreach (image->name_cache, free_hash_table, NULL);
g_hash_table_destroy (image->name_cache);
+ g_hash_table_destroy (image->native_wrapper_cache);
+ g_hash_table_destroy (image->managed_wrapper_cache);
+ g_hash_table_destroy (image->delegate_begin_invoke_cache);
+ g_hash_table_destroy (image->delegate_end_invoke_cache);
+ g_hash_table_destroy (image->delegate_invoke_cache);
+ g_hash_table_destroy (image->remoting_invoke_cache);
+ g_hash_table_destroy (image->runtime_invoke_cache);
+ g_hash_table_destroy (image->typespec_cache);
+ g_hash_table_destroy (image->generic_inst_cache);
+ g_hash_table_foreach (image->memberref_signatures, free_mr_signatures, NULL);
+ g_hash_table_destroy (image->memberref_signatures);
+ g_hash_table_foreach (image->helper_signatures, free_mr_signatures, NULL);
+ g_hash_table_destroy (image->helper_signatures);
if (image->raw_metadata != NULL)
mono_raw_buffer_free (image->raw_metadata);
@@ -639,8 +1048,10 @@ mono_image_close (MonoImage *image)
g_free (ii->cli_sections);
g_free (image->image_info);
}
-
- g_free (image);
+
+ if (!image->dynamic)
+ /* Dynamic images are GC_MALLOCed */
+ g_free (image);
}
/**
@@ -768,7 +1179,7 @@ mono_image_lookup_resource (MonoImage *image, guint32 res_id, guint32 lang_id, g
return(NULL);
}
- resource_dir=(MonoPEResourceDir *)mono_cli_rva_map (info, rsrc->rva);
+ resource_dir=(MonoPEResourceDir *)mono_image_rva_map (image, rsrc->rva);
if(resource_dir==NULL) {
return(NULL);
}
@@ -790,3 +1201,176 @@ mono_image_lookup_resource (MonoImage *image, guint32 res_id, guint32 lang_id, g
return(NULL);
}
+
+guint32
+mono_image_get_entry_point (MonoImage *image)
+{
+ return ((MonoCLIImageInfo*)image->image_info)->cli_cli_header.ch_entry_point;
+}
+
+const char*
+mono_image_get_resource (MonoImage *image, guint32 offset, guint32 *size)
+{
+ MonoCLIImageInfo *iinfo = image->image_info;
+ MonoCLIHeader *ch = &iinfo->cli_cli_header;
+ const char* data;
+
+ if (!ch->ch_resources.rva || offset + 4 > ch->ch_resources.size)
+ return NULL;
+
+ data = mono_image_rva_map (image, ch->ch_resources.rva);
+ if (!data)
+ return NULL;
+ data += offset;
+ if (size)
+ *size = read32 (data);
+ data += 4;
+ return data;
+}
+
+MonoImage*
+mono_image_load_file_for_image (MonoImage *image, int fileidx)
+{
+ char *base_dir, *name;
+ MonoImage *res;
+ MonoTableInfo *t = &image->tables [MONO_TABLE_FILE];
+ const char *fname;
+ guint32 fname_id;
+
+ if (fileidx < 1 || fileidx > t->rows)
+ return NULL;
+
+ if (image->files && image->files [fileidx - 1])
+ return image->files [fileidx - 1];
+
+ if (!image->files)
+ image->files = g_new0 (MonoImage*, t->rows);
+
+ fname_id = mono_metadata_decode_row_col (t, fileidx - 1, MONO_FILE_NAME);
+ fname = mono_metadata_string_heap (image, fname_id);
+ base_dir = g_path_get_dirname (image->name);
+ name = g_build_filename (base_dir, fname, NULL);
+ res = mono_image_open (name, NULL);
+ if (res) {
+ int i;
+ /* g_print ("loaded file %s from %s (%p)\n", name, image->name, image->assembly); */
+ res->assembly = image->assembly;
+ for (i = 0; i < res->module_count; ++i) {
+ if (res->modules [i] && !res->modules [i]->assembly)
+ res->modules [i]->assembly = image->assembly;
+ }
+
+ image->files [fileidx - 1] = res;
+ }
+ g_free (name);
+ g_free (base_dir);
+ return res;
+}
+
+const char*
+mono_image_get_strong_name (MonoImage *image, guint32 *size)
+{
+ MonoCLIImageInfo *iinfo = image->image_info;
+ MonoPEDirEntry *de = &iinfo->cli_cli_header.ch_strong_name;
+ const char* data;
+
+ if (!de->size || !de->rva)
+ return NULL;
+ data = mono_image_rva_map (image, de->rva);
+ if (!data)
+ return NULL;
+ if (size)
+ *size = de->size;
+ return data;
+}
+
+guint32
+mono_image_strong_name_position (MonoImage *image, guint32 *size)
+{
+ MonoCLIImageInfo *iinfo = image->image_info;
+ MonoPEDirEntry *de = &iinfo->cli_cli_header.ch_strong_name;
+ const int top = iinfo->cli_section_count;
+ MonoSectionTable *tables = iinfo->cli_section_tables;
+ int i;
+ guint32 addr = de->rva;
+
+ if (size)
+ *size = de->size;
+ if (!de->size || !de->rva)
+ return 0;
+ for (i = 0; i < top; i++){
+ if ((addr >= tables->st_virtual_address) &&
+ (addr < tables->st_virtual_address + tables->st_raw_data_size)){
+ return tables->st_raw_data_ptr +
+ (addr - tables->st_virtual_address);
+ }
+ tables++;
+ }
+
+ return 0;
+}
+
+const char*
+mono_image_get_public_key (MonoImage *image, guint32 *size)
+{
+ const char *pubkey;
+ guint32 len, tok;
+ if (image->tables [MONO_TABLE_ASSEMBLY].rows != 1)
+ return NULL;
+ tok = mono_metadata_decode_row_col (&image->tables [MONO_TABLE_ASSEMBLY], 0, MONO_ASSEMBLY_PUBLIC_KEY);
+ if (!tok)
+ return NULL;
+ pubkey = mono_metadata_blob_heap (image, tok);
+ len = mono_metadata_decode_blob_size (pubkey, &pubkey);
+ if (size)
+ *size = len;
+ return pubkey;
+}
+
+const char*
+mono_image_get_name (MonoImage *image)
+{
+ return image->assembly_name;
+}
+
+const char*
+mono_image_get_filename (MonoImage *image)
+{
+ return image->name;
+}
+
+const MonoTableInfo*
+mono_image_get_table_info (MonoImage *image, int table_id)
+{
+ if (table_id < 0 || table_id >= 64)
+ return NULL;
+ return &image->tables [table_id];
+}
+
+int
+mono_image_get_table_rows (MonoImage *image, int table_id)
+{
+ if (table_id < 0 || table_id >= 64)
+ return 0;
+ return image->tables [table_id].rows;
+}
+
+int
+mono_table_info_get_rows (const MonoTableInfo *table)
+{
+ return table->rows;
+}
+
+MonoAssembly*
+mono_image_get_assembly (MonoImage *image)
+{
+ return image->assembly;
+}
+
+gboolean
+mono_image_is_dynamic (MonoImage *image)
+{
+ return image->dynamic;
+}
+
+
diff --git a/mono/metadata/image.h b/mono/metadata/image.h
index 89fb0901e84..f2127e0650a 100644
--- a/mono/metadata/image.h
+++ b/mono/metadata/image.h
@@ -3,110 +3,27 @@
#include <stdio.h>
#include <glib.h>
+#include <gmodule.h>
typedef struct _MonoImage MonoImage;
+typedef struct _MonoAssembly MonoAssembly;
+typedef struct _MonoTableInfo MonoTableInfo;
+
+#define MONO_PUBLIC_KEY_TOKEN_LENGTH 17
typedef struct {
const char *name;
const char *culture;
const char *hash_value;
+ const guint8* public_key;
+ // string of 16 hex chars + 1 NULL
+ guchar public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
+ guint32 hash_alg;
guint32 hash_len;
guint32 flags;
- gint16 major, minor, build, revision;
+ guint16 major, minor, build, revision;
} MonoAssemblyName;
-typedef struct {
- int ref_count;
- char *basedir;
- MonoAssemblyName aname;
-
- MonoImage *image;
- MonoImage **modules;
- /* Load files here */
-} MonoAssembly;
-
-typedef struct {
- const char* data;
- guint32 size;
-} MonoStreamHeader;
-
-typedef struct {
- guint32 rows, row_size;
- const char *base;
-
- /*
- * Tables contain up to 9 columns and the possible sizes of the
- * fields in the documentation are 1, 2 and 4 bytes. So we
- * can encode in 2 bits the size.
- *
- * A 32 bit value can encode the resulting size
- *
- * The top eight bits encode the number of columns in the table.
- * we only need 4, but 8 is aligned no shift required.
- */
- guint32 size_bitfield;
-} MonoTableInfo;
-
-struct _MonoImage {
- int ref_count;
- FILE *f;
- char *name;
- const char *assembly_name;
- const char *module_name;
- void *image_info;
-
- char *raw_metadata;
-
- gboolean idx_string_wide, idx_guid_wide, idx_blob_wide;
-
- MonoStreamHeader heap_strings;
- MonoStreamHeader heap_us;
- MonoStreamHeader heap_blob;
- MonoStreamHeader heap_guid;
- MonoStreamHeader heap_tables;
-
- const char *tables_base;
-
- MonoTableInfo tables [64];
-
- /*
- * references is initialized only by using the mono_assembly_open
- * function, and not by using the lowlevel mono_image_open.
- *
- * It is NULL terminated.
- */
- MonoAssembly **references;
-
- /*
- * The Assembly this image was loaded from.
- */
- MonoAssembly *assembly;
-
- /*
- * Indexed by method tokens and typedef tokens.
- */
- GHashTable *method_cache;
- GHashTable *class_cache;
- /*
- * Indexes namespaces to hash tables that map class name to typedef token.
- */
- GHashTable *name_cache;
-
- /*
- * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
- * maximal rank of 255
- */
- GHashTable *array_cache;
-
- void *reflection_info;
-
- /*
- * user_info is a public field and is not touched by the
- * metadata engine
- */
- void *user_info;
-};
-
typedef enum {
MONO_IMAGE_OK,
MONO_IMAGE_ERROR_ERRNO,
@@ -114,20 +31,49 @@ typedef enum {
MONO_IMAGE_IMAGE_INVALID
} MonoImageOpenStatus;
+void mono_images_init (void);
+
MonoImage *mono_image_open (const char *fname,
MonoImageOpenStatus *status);
+MonoImage *mono_image_open_from_data (char *data, guint32 data_len, gboolean need_copy,
+ MonoImageOpenStatus *status);
MonoImage *mono_image_loaded (const char *name);
+MonoImage *mono_image_loaded_by_guid (const char *guid);
+void mono_image_init (MonoImage *image);
void mono_image_close (MonoImage *image);
+void mono_image_addref (MonoImage *image);
const char *mono_image_strerror (MonoImageOpenStatus status);
int mono_image_ensure_section (MonoImage *image,
const char *section);
int mono_image_ensure_section_idx (MonoImage *image,
int section);
+
+guint32 mono_image_get_entry_point (MonoImage *image);
+const char *mono_image_get_resource (MonoImage *image, guint32 offset, guint32 *size);
+MonoImage* mono_image_load_file_for_image (MonoImage *image, int fileidx);
+
+const char* mono_image_get_name (MonoImage *image);
+const char* mono_image_get_filename (MonoImage *image);
+MonoAssembly* mono_image_get_assembly (MonoImage *image);
+gboolean mono_image_is_dynamic (MonoImage *image);
+char* mono_image_rva_map (MonoImage *image, guint32 rva);
+
+const MonoTableInfo *mono_image_get_table_info (MonoImage *image, int table_id);
+int mono_image_get_table_rows (MonoImage *image, int table_id);
+int mono_table_info_get_rows (const MonoTableInfo *table);
+
/* This actually returns a MonoPEResourceDataEntry *, but declaring it
* causes an include file loop.
*/
gpointer mono_image_lookup_resource (MonoImage *image, guint32 res_id,
guint32 lang_id, gunichar2 *name);
-
+
+const char* mono_image_get_public_key (MonoImage *image, guint32 *size);
+const char* mono_image_get_strong_name (MonoImage *image, guint32 *size);
+guint32 mono_image_strong_name_position (MonoImage *image, guint32 *size);
+void mono_image_add_to_name_cache (MonoImage *image,
+ const char *nspace,
+ const char *name, guint32 idx);
+
#endif
diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c
index 471db9b9a33..a07857d6451 100644
--- a/mono/metadata/loader.c
+++ b/mono/metadata/loader.c
@@ -28,84 +28,30 @@
#include <mono/metadata/tokentype.h>
#include <mono/metadata/cil-coff.h>
#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/loader.h>
-#include <mono/metadata/class.h>
+#include <mono/metadata/class-internals.h>
#include <mono/metadata/debug-helpers.h>
-
-static gboolean dummy_icall = TRUE;
+#include <mono/metadata/reflection.h>
+#include <mono/utils/mono-logger.h>
MonoDefaults mono_defaults;
-static GHashTable *icall_hash = NULL;
+/*
+ * This lock protects the hash tables inside MonoImage used by the metadata
+ * loading functions in class.c and loader.c.
+ */
+static CRITICAL_SECTION loader_mutex;
void
-mono_add_internal_call (const char *name, gconstpointer method)
-{
- if (!icall_hash) {
- dummy_icall = FALSE;
- icall_hash = g_hash_table_new (g_str_hash , g_str_equal);
- }
-
- g_hash_table_insert (icall_hash, g_strdup (name), method);
-}
-
-static void
-ves_icall_dummy (void)
+mono_loader_init ()
{
- g_warning ("the mono runtime is not initialized");
- g_assert_not_reached ();
-}
-
-gpointer
-mono_lookup_internal_call (MonoMethod *method)
-{
- char *name;
- char *tmpsig;
- gpointer res;
-
- if (dummy_icall)
- return ves_icall_dummy;
-
- if (!method) {
- g_warning ("can't resolve internal call, method is null");
- }
-
- if (!icall_hash) {
- g_warning ("icall_hash not initialized");
- g_assert_not_reached ();
- }
-
- name = g_strconcat (method->klass->name_space, ".", method->klass->name, "::", method->name, NULL);
- if (!(res = g_hash_table_lookup (icall_hash, name))) {
- /* trying to resolve with full signature */
- g_free (name);
-
- tmpsig = mono_signature_get_desc(method->signature, TRUE);
- name = g_strconcat (method->klass->name_space, ".", method->klass->name, "::", method->name, "(", tmpsig, ")", NULL);
- if (!(res = g_hash_table_lookup (icall_hash, name))) {
- g_warning ("cant resolve internal call to \"%s\" (tested without signature also)", name);
- g_print ("\nYour mono runtime and corlib are out of sync.\n");
- g_print ("When you update one from cvs you need to update, compile and install\nthe other too.\n");
- g_print ("Do not report this as a bug unless you're sure you have updated correctly:\nyou probably have a broken mono install.\n");
- g_print ("If you see other errors or faults after this message they are probably related\n");
- g_print ("and you need to fix your mono install first.\n");
-
- g_free (name);
- g_free (tmpsig);
-
- return NULL;
- }
-
- g_free(tmpsig);
- }
-
- g_free (name);
-
- return res;
+ InitializeCriticalSection (&loader_mutex);
}
-MonoClassField*
-mono_field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass)
+static MonoClassField*
+field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
+ MonoGenericContext *context)
{
MonoClass *klass;
MonoTableInfo *tables = image->tables;
@@ -115,9 +61,15 @@ mono_field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass
const char *ptr;
guint32 idx = mono_metadata_token_index (token);
+ if (image->dynamic) {
+ MonoClassField *result = mono_lookup_dynamic_token (image, token);
+ *retklass = result->parent;
+ return result;
+ }
+
mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE);
- nindex = cols [MONO_MEMBERREF_CLASS] >> MEMBERREF_PARENT_BITS;
- class = cols [MONO_MEMBERREF_CLASS] & MEMBERREF_PARENT_MASK;
+ nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS;
+ class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK;
fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
@@ -126,7 +78,7 @@ mono_field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass
/* we may want to check the signature here... */
switch (class) {
- case MEMBERREF_PARENT_TYPEREF:
+ case MONO_MEMBERREF_PARENT_TYPEREF:
klass = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | nindex);
if (!klass) {
g_warning ("Missing field %s in typeref index %d", fname, nindex);
@@ -136,82 +88,290 @@ mono_field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass
if (retklass)
*retklass = klass;
return mono_class_get_field_from_name (klass, fname);
+ case MONO_MEMBERREF_PARENT_TYPESPEC: {
+ /*guint32 bcols [MONO_TYPESPEC_SIZE];
+ guint32 len;
+ MonoType *type;
+
+ mono_metadata_decode_row (&tables [MONO_TABLE_TYPESPEC], nindex - 1,
+ bcols, MONO_TYPESPEC_SIZE);
+ ptr = mono_metadata_blob_heap (image, bcols [MONO_TYPESPEC_SIGNATURE]);
+ len = mono_metadata_decode_value (ptr, &ptr);
+ type = mono_metadata_parse_type (image, MONO_PARSE_TYPE, 0, ptr, &ptr);
+
+ klass = mono_class_from_mono_type (type);
+ mono_class_init (klass);
+ g_print ("type in sig: %s\n", klass->name);*/
+ klass = mono_class_get_full (image, MONO_TOKEN_TYPE_SPEC | nindex, context);
+ mono_class_init (klass);
+ if (retklass)
+ *retklass = klass;
+ return mono_class_get_field_from_name (klass, fname);
+ }
default:
+ g_warning ("field load from %x", class);
return NULL;
}
}
+MonoClassField*
+mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass,
+ MonoGenericContext *context)
+{
+ MonoClass *k;
+ guint32 type;
+ MonoClassField *field;
+
+ if (image->dynamic) {
+ MonoClassField *result = mono_lookup_dynamic_token (image, token);
+ *retklass = result->parent;
+ return result;
+ }
+
+ mono_loader_lock ();
+ if ((field = g_hash_table_lookup (image->field_cache, GUINT_TO_POINTER (token)))) {
+ *retklass = field->parent;
+ mono_loader_unlock ();
+ return field;
+ }
+ mono_loader_unlock ();
+
+ if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF)
+ field = field_from_memberref (image, token, retklass, context);
+ else {
+ type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
+ if (!type)
+ return NULL;
+ k = mono_class_get (image, MONO_TOKEN_TYPE_DEF | type);
+ mono_class_init (k);
+ if (!k)
+ return NULL;
+ if (retklass)
+ *retklass = k;
+ field = mono_class_get_field (k, token);
+ }
+
+ mono_loader_lock ();
+ if (!field->parent->generic_inst)
+ g_hash_table_insert (image->field_cache, GUINT_TO_POINTER (token), field);
+ mono_loader_unlock ();
+ return field;
+}
+
+static gboolean
+mono_metadata_signature_vararg_match (MonoMethodSignature *sig1, MonoMethodSignature *sig2)
+{
+ int i;
+
+ if (sig1->hasthis != sig2->hasthis ||
+ sig1->sentinelpos != sig2->sentinelpos)
+ return FALSE;
+
+ for (i = 0; i < sig1->sentinelpos; i++) {
+ MonoType *p1 = sig1->params[i];
+ MonoType *p2 = sig2->params[i];
+
+ /*if (p1->attrs != p2->attrs)
+ return FALSE;
+ */
+ if (!mono_metadata_type_equal (p1, p2))
+ return FALSE;
+ }
+
+ if (!mono_metadata_type_equal (sig1->ret, sig2->ret))
+ return FALSE;
+ return TRUE;
+}
+
static MonoMethod *
-find_method (MonoClass *klass, const char* name, MonoMethodSignature *sig)
+find_method (MonoClass *klass, MonoClass *ic, const char* name, MonoMethodSignature *sig)
{
int i;
+ MonoClass *sclass = klass;
+ char *qname, *fqname;
+
+ if (ic) {
+ qname = g_strconcat (ic->name, ".", name, NULL);
+ if (ic->name_space && ic->name_space [0])
+ fqname = g_strconcat (ic->name_space, ".", ic->name, ".", name, NULL);
+ else
+ fqname = NULL;
+ } else
+ qname = fqname = NULL;
+
while (klass) {
- /* mostly dumb search for now */
for (i = 0; i < klass->method.count; ++i) {
MonoMethod *m = klass->methods [i];
- if (!strcmp (name, m->name)) {
+
+ if (!((fqname && !strcmp (m->name, fqname)) ||
+ (qname && !strcmp (m->name, qname)) || !strcmp (m->name, name)))
+ continue;
+
+ if (sig->call_convention == MONO_CALL_VARARG) {
+ if (mono_metadata_signature_vararg_match (sig, m->signature))
+ return m;
+ } else {
if (mono_metadata_signature_equal (sig, m->signature))
return m;
}
}
+
+ if (name [0] == '.' && (strcmp (name, ".ctor") == 0 || strcmp (name, ".cctor") == 0))
+ break;
+
klass = klass->parent;
}
+
+ if (sclass->generic_inst) {
+ MonoClass *gclass;
+ MonoMethod *res;
+
+ gclass = mono_class_from_mono_type (sclass->generic_inst->generic_type);
+ mono_class_init (gclass);
+
+ res = find_method (gclass, ic, name, sig);
+ if (!res)
+ return NULL;
+ for (i = 0; i < res->klass->method.count; ++i) {
+ if (res == res->klass->methods [i]) {
+ return sclass->methods [i];
+ }
+ }
+ }
+
return NULL;
+}
+
+/*
+ * token is the method_ref or method_def token used in a call IL instruction.
+ */
+MonoMethodSignature*
+mono_method_get_signature (MonoMethod *method, MonoImage *image, guint32 token)
+{
+ int table = mono_metadata_token_table (token);
+ int idx = mono_metadata_token_index (token);
+ guint32 cols [MONO_MEMBERREF_SIZE];
+ MonoMethodSignature *sig;
+ const char *ptr;
+
+ /* !table is for wrappers: we should really assign their own token to them */
+ if (!table || table == MONO_TABLE_METHOD)
+ return method->signature;
+
+ if (table == MONO_TABLE_METHODSPEC) {
+ g_assert (!(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) &&
+ !(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) &&
+ method->signature);
+ g_assert (method->signature->is_inflated);
+
+ return method->signature;
+ }
+
+ if (method->klass->generic_inst)
+ return method->signature;
+ if (image->dynamic)
+ /* FIXME: This might be incorrect for vararg methods */
+ return method->signature;
+
+ if (!(sig = g_hash_table_lookup (image->memberref_signatures, GUINT_TO_POINTER (token)))) {
+ mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE);
+
+ ptr = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]);
+ mono_metadata_decode_blob_size (ptr, &ptr);
+ sig = mono_metadata_parse_method_signature (image, 0, ptr, NULL);
+ g_hash_table_insert (image->memberref_signatures, GUINT_TO_POINTER (token), sig);
+ }
+
+ return sig;
}
static MonoMethod *
-method_from_memberref (MonoImage *image, guint32 idx)
+method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *context)
{
- MonoClass *klass;
+ MonoClass *klass = NULL;
MonoMethod *method;
MonoTableInfo *tables = image->tables;
guint32 cols[6];
guint32 nindex, class;
+ MonoGenericContainer *container = NULL;
const char *mname;
MonoMethodSignature *sig;
const char *ptr;
mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, 3);
- nindex = cols [MONO_MEMBERREF_CLASS] >> MEMBERREF_PARENT_BITS;
- class = cols [MONO_MEMBERREF_CLASS] & MEMBERREF_PARENT_MASK;
+ nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS;
+ class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK;
/*g_print ("methodref: 0x%x 0x%x %s\n", class, nindex,
mono_metadata_string_heap (m, cols [MONO_MEMBERREF_NAME]));*/
mname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]);
-
- ptr = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]);
- mono_metadata_decode_blob_size (ptr, &ptr);
- sig = mono_metadata_parse_method_signature (image, 0, ptr, NULL);
switch (class) {
- case MEMBERREF_PARENT_TYPEREF:
+ case MONO_MEMBERREF_PARENT_TYPEREF:
klass = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | nindex);
if (!klass) {
- g_warning ("Missing method %s in typeref index %d", mname, nindex);
- mono_metadata_free_method_signature (sig);
+ g_warning ("Missing method %s in assembly %s typeref index %d", mname, image->name, nindex);
return NULL;
}
- mono_class_init (klass);
- method = find_method (klass, mname, sig);
+ break;
+ case MONO_MEMBERREF_PARENT_TYPESPEC:
+ klass = mono_class_get_full (image, MONO_TOKEN_TYPE_SPEC | nindex, context);
+ if (!klass) {
+ g_warning ("Missing method %s in assembly %s typespec index %d", mname, image->name, nindex);
+ return NULL;
+ }
+ break;
+ case MONO_MEMBERREF_PARENT_TYPEDEF:
+ klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | nindex);
+ if (!klass) {
+ g_warning ("Missing method %s in assembly %s typedef index %d", mname, image->name, nindex);
+ return NULL;
+ }
+ break;
+ case MONO_MEMBERREF_PARENT_METHODDEF:
+ return mono_get_method (image, MONO_TOKEN_METHOD_DEF | nindex, NULL);
+ default:
+ g_error ("Memberref parent unknown: class: %d, index %d", class, nindex);
+ g_assert_not_reached ();
+ }
+ g_assert (klass);
+ mono_class_init (klass);
+
+ if (klass->generic_container)
+ container = klass->generic_container;
+ else if (klass->generic_inst) {
+ g_assert (klass->generic_inst->container);
+ container = klass->generic_inst->container;
+ }
+
+ ptr = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]);
+ mono_metadata_decode_blob_size (ptr, &ptr);
+ sig = mono_metadata_parse_method_signature_full (image, container, 0, ptr, NULL);
+
+ switch (class) {
+ case MONO_MEMBERREF_PARENT_TYPEREF:
+ method = find_method (klass, NULL, mname, sig);
if (!method)
- g_warning ("Missing method %s in typeref index %d", mname, nindex);
+ g_warning ("Missing method %s in assembly %s typeref index %d", mname, image->name, nindex);
mono_metadata_free_method_signature (sig);
return method;
- case MEMBERREF_PARENT_TYPESPEC: {
- guint32 bcols [MONO_TYPESPEC_SIZE];
- guint32 len;
+ case MONO_MEMBERREF_PARENT_TYPESPEC: {
MonoType *type;
MonoMethod *result;
- mono_metadata_decode_row (&tables [MONO_TABLE_TYPESPEC], nindex - 1,
- bcols, MONO_TYPESPEC_SIZE);
- ptr = mono_metadata_blob_heap (image, bcols [MONO_TYPESPEC_SIGNATURE]);
- len = mono_metadata_decode_value (ptr, &ptr);
- type = mono_metadata_parse_type (image, MONO_PARSE_TYPE, 0, ptr, &ptr);
+ type = &klass->byval_arg;
- if (type->type != MONO_TYPE_ARRAY && type->type != MONO_TYPE_SZARRAY)
- g_assert_not_reached ();
+ if (type->type != MONO_TYPE_ARRAY && type->type != MONO_TYPE_SZARRAY) {
+ method = find_method (klass, NULL, mname, sig);
+ if (!method)
+ g_warning ("Missing method %s in assembly %s typeref index %d", mname, image->name, nindex);
+ else if (klass->generic_inst && (klass != method->klass))
+ method = mono_class_inflate_generic_method (
+ method, klass->generic_inst->context, klass);
+ mono_metadata_free_method_signature (sig);
+ return method;
+ }
result = (MonoMethod *)g_new0 (MonoMethodPInvoke, 1);
result->klass = mono_class_get (image, MONO_TOKEN_TYPE_SPEC | nindex);
@@ -221,44 +381,119 @@ method_from_memberref (MonoImage *image, guint32 idx)
if (!strcmp (mname, ".ctor")) {
/* we special-case this in the runtime. */
- result->addr = NULL;
return result;
}
if (!strcmp (mname, "Set")) {
g_assert (sig->hasthis);
g_assert (type->data.array->rank + 1 == sig->param_count);
-
- result->addr = mono_lookup_internal_call(result);
+ result->iflags |= METHOD_IMPL_ATTRIBUTE_RUNTIME;
return result;
}
if (!strcmp (mname, "Get")) {
g_assert (sig->hasthis);
g_assert (type->data.array->rank == sig->param_count);
-
- result->addr = mono_lookup_internal_call(result);
+ result->iflags |= METHOD_IMPL_ATTRIBUTE_RUNTIME;
return result;
}
if (!strcmp (mname, "Address")) {
g_assert (sig->hasthis);
g_assert (type->data.array->rank == sig->param_count);
-
- result->addr = mono_lookup_internal_call(result);
+ result->iflags |= METHOD_IMPL_ATTRIBUTE_RUNTIME;
return result;
}
g_assert_not_reached ();
break;
}
+ case MONO_MEMBERREF_PARENT_TYPEDEF:
+ method = find_method (klass, NULL, mname, sig);
+ if (!method)
+ g_warning ("Missing method %s in assembly %s typeref index %d", mname, image->name, nindex);
+ mono_metadata_free_method_signature (sig);
+ return method;
default:
+ g_error ("Memberref parent unknown: class: %d, index %d", class, nindex);
g_assert_not_reached ();
}
return NULL;
}
+static MonoMethod *
+method_from_methodspec (MonoImage *image, MonoGenericContext *context, guint32 idx)
+{
+ MonoMethod *method, *inflated;
+ MonoTableInfo *tables = image->tables;
+ MonoGenericContext *new_context = NULL;
+ MonoGenericMethod *gmethod;
+ MonoGenericContainer *container = NULL;
+ const char *ptr;
+ guint32 cols [MONO_METHODSPEC_SIZE];
+ guint32 token, param_count, i;
+
+ mono_metadata_decode_row (&tables [MONO_TABLE_METHODSPEC], idx - 1, cols, MONO_METHODSPEC_SIZE);
+ token = cols [MONO_METHODSPEC_METHOD];
+ if ((token & MONO_METHODDEFORREF_MASK) == MONO_METHODDEFORREF_METHODDEF)
+ token = MONO_TOKEN_METHOD_DEF | (token >> MONO_METHODDEFORREF_BITS);
+ else
+ token = MONO_TOKEN_MEMBER_REF | (token >> MONO_METHODDEFORREF_BITS);
+
+ method = mono_get_method (image, token, NULL);
+
+ ptr = mono_metadata_blob_heap (image, cols [MONO_METHODSPEC_SIGNATURE]);
+
+ mono_metadata_decode_value (ptr, &ptr);
+ ptr++;
+ param_count = mono_metadata_decode_value (ptr, &ptr);
+
+ g_assert (param_count);
+ if (method->signature->is_inflated)
+ container = ((MonoMethodNormal *) ((MonoMethodInflated *) method)->declaring)->generic_container;
+ else
+ container = ((MonoMethodNormal *) method)->generic_container;
+ g_assert (container && container->is_method);
+
+ if (context) {
+ if (context->ginst) {
+ g_assert (context->ginst->container);
+ container->parent = context->ginst->container;
+ } else
+ container->parent = context->container;
+ }
+
+ gmethod = g_new0 (MonoGenericMethod, 1);
+ gmethod->container = container;
+ gmethod->mtype_argc = param_count;
+ gmethod->mtype_argv = g_new0 (MonoType *, param_count);
+
+ for (i = 0; i < param_count; i++) {
+ gmethod->mtype_argv [i] = mono_metadata_parse_type_full (
+ image, container, MONO_PARSE_TYPE, 0, ptr, &ptr);
+
+ if (!gmethod->is_open)
+ gmethod->is_open = mono_class_is_open_constructed_type (gmethod->mtype_argv [i]);
+ }
+
+ if (!context) {
+ new_context = g_new0 (MonoGenericContext, 1);
+ new_context->gmethod = gmethod;
+
+ context = new_context;
+ }
+
+ mono_stats.generics_metadata_size += sizeof (MonoGenericMethod) +
+ sizeof (MonoGenericContext) + param_count * sizeof (MonoType);
+
+ inflated = mono_class_inflate_generic_method (method, context, NULL);
+
+ if (new_context)
+ context->ginst = inflated->klass->generic_inst;
+ return inflated;
+}
+
typedef struct MonoDllMap MonoDllMap;
struct MonoDllMap {
@@ -268,17 +503,24 @@ struct MonoDllMap {
MonoDllMap *next;
};
-static GHashTable *dll_map;
+static GHashTable *global_dll_map;
-int
-mono_dllmap_lookup (const char *dll, const char* func, const char **rdll, const char **rfunc) {
+static int
+mono_dllmap_lookup_hash (GHashTable *dll_map, const char *dll, const char* func, const char **rdll, const char **rfunc) {
MonoDllMap *map, *tmp;
+ *rdll = dll;
+
if (!dll_map)
return 0;
+
+ mono_loader_lock ();
+
map = g_hash_table_lookup (dll_map, dll);
- if (!map)
+ if (!map) {
+ mono_loader_unlock ();
return 0;
+ }
*rdll = map->target? map->target: dll;
for (tmp = map->next; tmp; tmp = tmp->next) {
@@ -286,19 +528,43 @@ mono_dllmap_lookup (const char *dll, const char* func, const char **rdll, const
*rfunc = tmp->name;
if (tmp->dll)
*rdll = tmp->dll;
+ mono_loader_unlock ();
return 1;
}
}
*rfunc = func;
+ mono_loader_unlock ();
return 1;
}
+static int
+mono_dllmap_lookup (MonoImage *assembly, const char *dll, const char* func, const char **rdll, const char **rfunc)
+{
+ int res;
+ if (assembly && assembly->dll_map) {
+ res = mono_dllmap_lookup_hash (assembly->dll_map, dll, func, rdll, rfunc);
+ if (res)
+ return res;
+ }
+ return mono_dllmap_lookup_hash (global_dll_map, dll, func, rdll, rfunc);
+}
+
void
-mono_dllmap_insert (const char *dll, const char *func, const char *tdll, const char *tfunc) {
+mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc) {
MonoDllMap *map, *entry;
+ GHashTable *dll_map = NULL;
- if (!dll_map)
- dll_map = g_hash_table_new (g_str_hash, g_str_equal);
+ mono_loader_lock ();
+
+ if (!assembly) {
+ if (!global_dll_map)
+ global_dll_map = g_hash_table_new (g_str_hash, g_str_equal);
+ dll_map = global_dll_map;
+ } else {
+ if (!assembly->dll_map)
+ assembly->dll_map = g_hash_table_new (g_str_hash, g_str_equal);
+ dll_map = assembly->dll_map;
+ }
map = g_hash_table_lookup (dll_map, dll);
if (!map) {
@@ -318,10 +584,12 @@ mono_dllmap_insert (const char *dll, const char *func, const char *tdll, const c
entry->next = map->next;
map->next = entry;
}
+
+ mono_loader_unlock ();
}
gpointer
-mono_lookup_pinvoke_call (MonoMethod *method)
+mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char **exc_arg)
{
MonoImage *image = method->klass->image;
MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)method;
@@ -331,67 +599,218 @@ mono_lookup_pinvoke_call (MonoMethod *method)
guint32 im_cols [MONO_IMPLMAP_SIZE];
guint32 scope_token;
const char *import = NULL;
- const char *scope = NULL;
- char *full_name;
- GModule *gmodule;
+ const char *orig_scope;
+ const char *new_scope;
+ char *full_name, *file_name;
+ int i;
+ GModule *gmodule = NULL;
g_assert (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL);
- if (method->addr)
- return method->addr;
- if (!piinfo->implmap_idx)
- return NULL;
+ if (piinfo->addr)
+ return piinfo->addr;
+
+ if (method->klass->image->dynamic) {
+ MonoReflectionMethodAux *method_aux =
+ mono_g_hash_table_lookup (
+ ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+ if (!method_aux)
+ return NULL;
+
+ import = method_aux->dllentry;
+ orig_scope = method_aux->dll;
+ }
+ else {
+ if (!piinfo->implmap_idx)
+ return NULL;
+
+ mono_metadata_decode_row (im, piinfo->implmap_idx - 1, im_cols, MONO_IMPLMAP_SIZE);
+
+ piinfo->piflags = im_cols [MONO_IMPLMAP_FLAGS];
+ import = mono_metadata_string_heap (image, im_cols [MONO_IMPLMAP_NAME]);
+ scope_token = mono_metadata_decode_row_col (mr, im_cols [MONO_IMPLMAP_SCOPE] - 1, MONO_MODULEREF_NAME);
+ orig_scope = mono_metadata_string_heap (image, scope_token);
+ }
+
+ mono_dllmap_lookup (image, orig_scope, import, &new_scope, &import);
+
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+ "DllImport attempting to load: '%s'.", new_scope);
+
+ if (exc_class) {
+ *exc_class = NULL;
+ *exc_arg = NULL;
+ }
- mono_metadata_decode_row (im, piinfo->implmap_idx - 1, im_cols, MONO_IMPLMAP_SIZE);
+ /*
+ * Try loading the module using a variety of names
+ */
+ for (i = 0; i < 3; ++i) {
+ switch (i) {
+ case 0:
+ /* Try the original name */
+ file_name = g_strdup (new_scope);
+ break;
+ case 1:
+ /* Try trimming the .dll extension */
+ if (strstr (new_scope, ".dll") == (new_scope + strlen (new_scope) - 4)) {
+ file_name = g_strdup (new_scope);
+ file_name [strlen (new_scope) - 4] = '\0';
+ }
+ else
+ continue;
+ break;
+ default:
+ if (strstr (new_scope, "lib") != new_scope) {
+ file_name = g_strdup_printf ("lib%s", new_scope);
+ }
+ else
+ continue;
+ break;
+ }
+
+ if (!gmodule) {
+ full_name = g_module_build_path (NULL, file_name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+ "DllImport loading location: '%s'.", full_name);
+ gmodule = g_module_open (full_name, G_MODULE_BIND_LAZY);
+ if (!gmodule) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+ "DllImport error loading library: '%s'.",
+ g_module_error ());
+ }
+ g_free (full_name);
+ }
- piinfo->piflags = im_cols [MONO_IMPLMAP_FLAGS];
- import = mono_metadata_string_heap (image, im_cols [MONO_IMPLMAP_NAME]);
- scope_token = mono_metadata_decode_row_col (mr, im_cols [MONO_IMPLMAP_SCOPE] - 1, MONO_MODULEREF_NAME);
- scope = mono_metadata_string_heap (image, scope_token);
+ if (!gmodule) {
+ full_name = g_module_build_path (".", file_name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+ "DllImport loading library: '%s'.", full_name);
+ gmodule = g_module_open (full_name, G_MODULE_BIND_LAZY);
+ if (!gmodule) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+ "DllImport error loading library '%s'.",
+ g_module_error ());
+ }
+ g_free (full_name);
+ }
- mono_dllmap_lookup (scope, import, &scope, &import);
+ if (!gmodule) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+ "DllImport loading: '%s'.", file_name);
+ gmodule=g_module_open (file_name, G_MODULE_BIND_LAZY);
+ if (!gmodule) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT,
+ "DllImport error loading library '%s'.",
+ g_module_error ());
+ }
+ }
- full_name = g_module_build_path (NULL, scope);
- gmodule = g_module_open (full_name, G_MODULE_BIND_LAZY);
+ g_free (file_name);
+
+ if (gmodule)
+ break;
+ }
if (!gmodule) {
- if (!(gmodule=g_module_open (scope, G_MODULE_BIND_LAZY))) {
- g_warning ("Failed to load library %s (%s)", full_name, scope);
- g_free (full_name);
- return NULL;
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_DLLIMPORT,
+ "DllImport unable to load library '%s'.",
+ g_module_error ());
+
+ if (exc_class) {
+ *exc_class = "DllNotFoundException";
+ *exc_arg = orig_scope;
}
+ return NULL;
}
- g_free (full_name);
- g_module_symbol (gmodule, import, &method->addr);
+ if (piinfo->piflags & PINVOKE_ATTRIBUTE_NO_MANGLE) {
+ g_module_symbol (gmodule, import, &piinfo->addr);
+ } else {
+ char *mangled_name;
+
+ switch (piinfo->piflags & PINVOKE_ATTRIBUTE_CHAR_SET_MASK) {
+ case PINVOKE_ATTRIBUTE_CHAR_SET_UNICODE:
+ mangled_name = g_strconcat (import, "W", NULL);
+ g_module_symbol (gmodule, mangled_name, &piinfo->addr);
+ g_free (mangled_name);
+
+ if (!piinfo->addr)
+ g_module_symbol (gmodule, import, &piinfo->addr);
+ break;
+ case PINVOKE_ATTRIBUTE_CHAR_SET_AUTO:
+ g_module_symbol (gmodule, import, &piinfo->addr);
+ break;
+ case PINVOKE_ATTRIBUTE_CHAR_SET_ANSI:
+ default:
+ mangled_name = g_strconcat (import, "A", NULL);
+ g_module_symbol (gmodule, mangled_name, &piinfo->addr);
+ g_free (mangled_name);
+
+ if (!piinfo->addr)
+ g_module_symbol (gmodule, import, &piinfo->addr);
+
+ break;
+ }
- if (!method->addr) {
- g_warning ("Failed to load function %s from %s", import, scope);
+#ifdef PLATFORM_WIN32
+ /* Try the stdcall mangled name */
+ if (!piinfo->addr) {
+ /* FIX: Compute this correctly */
+ mangled_name = g_strdup_printf ("%s@%d", import, method->signature->param_count * sizeof (gpointer));
+ g_module_symbol (gmodule, mangled_name, &piinfo->addr);
+ g_free (mangled_name);
+ }
+ if (!piinfo->addr) {
+ mangled_name = g_strdup_printf ("_%s@%d", import, method->signature->param_count * sizeof (gpointer));
+ g_module_symbol (gmodule, mangled_name, &piinfo->addr);
+ g_free (mangled_name);
+ }
+#endif
+ }
+
+ if (!piinfo->addr) {
+ if (exc_class) {
+ *exc_class = "EntryPointNotFoundException";
+ *exc_arg = import;
+ }
return NULL;
}
- return method->addr;
+ return piinfo->addr;
}
-MonoMethod *
-mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
+static MonoMethod *
+mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass,
+ MonoGenericContext *context)
{
MonoMethod *result;
int table = mono_metadata_token_table (token);
int idx = mono_metadata_token_index (token);
MonoTableInfo *tables = image->tables;
- const char *loc, *sig = NULL;
- int size;
+ MonoGenericContainer *generic_container = NULL, *container = NULL;
+ const char *sig = NULL;
+ int size, i;
guint32 cols [MONO_TYPEDEF_SIZE];
- if ((result = g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (token))))
- return result;
+ if (image->dynamic)
+ return mono_lookup_dynamic_token (image, token);
if (table != MONO_TABLE_METHOD) {
+ MonoGenericContainer *generic_container = NULL;
+ if (context) {
+ if (context->ginst) {
+ g_assert (context->ginst->container);
+ generic_container = context->ginst->container;
+ } else
+ generic_container = context->container;
+ }
+ if (table == MONO_TABLE_METHODSPEC)
+ return method_from_methodspec (image, context, idx);
if (table != MONO_TABLE_MEMBERREF)
g_print("got wrong token: 0x%08x\n", token);
g_assert (table == MONO_TABLE_MEMBERREF);
- result = method_from_memberref (image, idx);
- g_hash_table_insert (image->method_cache, GINT_TO_POINTER (token), result);
+ result = method_from_memberref (image, idx, context);
+
return result;
}
@@ -407,12 +826,26 @@ mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
result->klass = klass;
result->flags = cols [2];
result->iflags = cols [1];
+ result->token = token;
result->name = mono_metadata_string_heap (image, cols [3]);
+ if (klass)
+ container = klass->generic_container;
+
+ if (!(cols [1] & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) &&
+ (!(cols [2] & METHOD_ATTRIBUTE_PINVOKE_IMPL) || cols [1] & METHOD_IMPL_ATTRIBUTE_NATIVE)) {
+ generic_container = mono_metadata_load_generic_params (image, token);
+ if (generic_container) {
+ generic_container->parent = container;
+ generic_container->is_method = 1;
+ container = generic_container;
+ }
+ }
+
if (!sig) /* already taken from the methodref */
sig = mono_metadata_blob_heap (image, cols [4]);
size = mono_metadata_decode_blob_size (sig, &sig);
- result->signature = mono_metadata_parse_method_signature (image, 0, sig, NULL);
+ result->signature = mono_metadata_parse_method_signature_full (image, container, idx, sig, NULL);
if (!result->klass) {
guint32 type = mono_metadata_typedef_from_method (image, token);
@@ -420,34 +853,146 @@ mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
}
if (cols [1] & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
- result->addr = mono_lookup_internal_call (result);
- result->flags |= METHOD_ATTRIBUTE_PINVOKE_IMPL;
- } else if (cols [2] & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
- ((MonoMethodPInvoke *)result)->implmap_idx = mono_metadata_implmap_from_method (image, idx - 1);
+ if (result->klass == mono_defaults.string_class && !strcmp (result->name, ".ctor"))
+ result->string_ctor = 1;
+
+ result->signature->pinvoke = 1;
+ } else if ((cols [2] & METHOD_ATTRIBUTE_PINVOKE_IMPL) && (!(cols [1] & METHOD_IMPL_ATTRIBUTE_NATIVE))) {
+ MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)result;
+ MonoTableInfo *im = &tables [MONO_TABLE_IMPLMAP];
+ MonoCallConvention conv = 0;
+
+ result->signature->pinvoke = 1;
+ piinfo->implmap_idx = mono_metadata_implmap_from_method (image, idx - 1);
+ piinfo->piflags = mono_metadata_decode_row_col (im, piinfo->implmap_idx - 1, MONO_IMPLMAP_FLAGS);
+
+ switch (piinfo->piflags & PINVOKE_ATTRIBUTE_CALL_CONV_MASK) {
+ case PINVOKE_ATTRIBUTE_CALL_CONV_WINAPI:
+ conv = MONO_CALL_DEFAULT;
+ break;
+ case PINVOKE_ATTRIBUTE_CALL_CONV_CDECL:
+ conv = MONO_CALL_C;
+ break;
+ case PINVOKE_ATTRIBUTE_CALL_CONV_STDCALL:
+ conv = MONO_CALL_STDCALL;
+ break;
+ case PINVOKE_ATTRIBUTE_CALL_CONV_THISCALL:
+ conv = MONO_CALL_THISCALL;
+ break;
+ case PINVOKE_ATTRIBUTE_CALL_CONV_FASTCALL:
+ conv = MONO_CALL_FASTCALL;
+ break;
+ case PINVOKE_ATTRIBUTE_CALL_CONV_GENERIC:
+ case PINVOKE_ATTRIBUTE_CALL_CONV_GENERICINST:
+ default:
+ g_warning ("unsupported calling convention");
+ g_assert_not_reached ();
+ }
+ result->signature->call_convention = conv;
} else {
- /* if this is a methodref from another module/assembly, this fails */
- loc = mono_cli_rva_map ((MonoCLIImageInfo *)image->image_info, cols [0]);
+ if (result->signature->generic_param_count) {
+ MonoMethodSignature *sig = result->signature;
+
+ for (i = 0; i < sig->generic_param_count; i++) {
+ generic_container->type_params [i].method = result;
+
+ mono_class_from_generic_parameter (
+ &generic_container->type_params [i], image, TRUE);
+ }
+ if (sig->ret->type == MONO_TYPE_MVAR) {
+ int num = sig->ret->data.generic_param->num;
+ sig->ret->data.generic_param = &generic_container->type_params [num];
+ }
+
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *t = sig->params [i];
+ if (t->type == MONO_TYPE_MVAR) {
+ int num = t->data.generic_param->num;
+ sig->params [i]->data.generic_param = &generic_container->type_params [num];
+ }
+ }
+ }
+
+ /* FIXME: lazyness for generics too, but how? */
if (!result->klass->dummy && !(result->flags & METHOD_ATTRIBUTE_ABSTRACT) &&
- !(result->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
+ !(result->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) && container) {
+ gpointer loc = mono_image_rva_map (image, cols [0]);
g_assert (loc);
- ((MonoMethodNormal *)result)->header = mono_metadata_parse_mh (image, loc);
+ ((MonoMethodNormal *) result)->header = mono_metadata_parse_mh_full (image, container, loc);
}
+
+ ((MonoMethodNormal *) result)->generic_container = generic_container;
}
- g_hash_table_insert (image->method_cache, GINT_TO_POINTER (token), result);
+ return result;
+}
+
+MonoMethod *
+mono_get_method (MonoImage *image, guint32 token, MonoClass *klass)
+{
+ return mono_get_method_full (image, token, klass, NULL);
+}
+
+MonoMethod *
+mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass,
+ MonoGenericContext *context)
+{
+ MonoMethod *result;
+
+ /* We do everything inside the lock to prevent creation races */
+
+ mono_loader_lock ();
+
+ if ((result = g_hash_table_lookup (image->method_cache, GINT_TO_POINTER (token)))) {
+ mono_loader_unlock ();
+ return result;
+ }
+
+ result = mono_get_method_from_token (image, token, klass, context);
+
+ if (!(result && result->signature->is_inflated))
+ g_hash_table_insert (image->method_cache, GINT_TO_POINTER (token), result);
+
+ mono_loader_unlock ();
return result;
}
+MonoMethod *
+mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constrained_class,
+ MonoGenericContext *context)
+{
+ MonoMethod *method, *result;
+ MonoClass *ic = NULL;
+
+ mono_loader_lock ();
+
+ method = mono_get_method_from_token (image, token, NULL, context);
+ if (!method) {
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ mono_class_init (constrained_class);
+
+ if ((constrained_class != method->klass) && (method->klass->interface_id != 0))
+ ic = method->klass;
+
+ result = find_method (constrained_class, ic, method->name, method->signature);
+ if (!result)
+ g_warning ("Missing method %s in assembly %s token %x", method->name,
+ image->name, token);
+
+ mono_loader_unlock ();
+ return result;
+}
+
void
mono_free_method (MonoMethod *method)
{
mono_metadata_free_method_signature (method->signature);
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
- MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *)method;
- g_free (piinfo->code);
- } else if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
+ if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) && ((MonoMethodNormal *)method)->header) {
mono_metadata_free_mh (((MonoMethodNormal *)method)->header);
}
@@ -459,18 +1004,33 @@ mono_method_get_param_names (MonoMethod *method, const char **names)
{
int i, lastp;
MonoClass *klass = method->klass;
- MonoTableInfo *methodt = &klass->image->tables [MONO_TABLE_METHOD];
- MonoTableInfo *paramt = &klass->image->tables [MONO_TABLE_PARAM];
+ MonoTableInfo *methodt;
+ MonoTableInfo *paramt;
if (!method->signature->param_count)
return;
for (i = 0; i < method->signature->param_count; ++i)
names [i] = "";
+ if (klass->generic_inst) /* copy the names later */
+ return;
+
mono_class_init (klass);
- if (!klass->methods)
+
+ if (klass->image->dynamic) {
+ MonoReflectionMethodAux *method_aux =
+ mono_g_hash_table_lookup (
+ ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+ if (method_aux && method_aux->param_names) {
+ for (i = 0; i < method->signature->param_count; ++i)
+ if (method_aux->param_names [i + 1])
+ names [i] = method_aux->param_names [i + 1];
+ }
return;
+ }
+ methodt = &klass->image->tables [MONO_TABLE_METHOD];
+ paramt = &klass->image->tables [MONO_TABLE_PARAM];
for (i = 0; i < klass->method.count; ++i) {
if (method == klass->methods [i]) {
guint32 idx = klass->method.first + i;
@@ -480,7 +1040,7 @@ mono_method_get_param_names (MonoMethod *method, const char **names)
if (idx + 1 < methodt->rows)
lastp = mono_metadata_decode_row_col (methodt, idx + 1, MONO_METHOD_PARAMLIST);
else
- lastp = paramt->rows;
+ lastp = paramt->rows + 1;
for (i = param_index; i < lastp; ++i) {
mono_metadata_decode_row (paramt, i -1, cols, MONO_PARAM_SIZE);
if (cols [MONO_PARAM_SEQUENCE]) /* skip return param spec */
@@ -490,3 +1050,277 @@ mono_method_get_param_names (MonoMethod *method, const char **names)
}
}
}
+
+guint32
+mono_method_get_param_token (MonoMethod *method, int index)
+{
+ int i;
+ MonoClass *klass = method->klass;
+ MonoTableInfo *methodt;
+
+ if (klass->generic_inst)
+ g_assert_not_reached ();
+
+ mono_class_init (klass);
+
+ if (klass->image->dynamic) {
+ g_assert_not_reached ();
+ }
+
+ methodt = &klass->image->tables [MONO_TABLE_METHOD];
+ for (i = 0; i < klass->method.count; ++i) {
+ if (method == klass->methods [i]) {
+ guint32 idx = klass->method.first + i;
+ guint param_index = mono_metadata_decode_row_col (methodt, idx, MONO_METHOD_PARAMLIST);
+
+ return mono_metadata_make_token (MONO_TABLE_PARAM, param_index + index);
+ }
+ }
+
+ return 0;
+}
+
+void
+mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs)
+{
+ int i, lastp;
+ MonoClass *klass = method->klass;
+ MonoTableInfo *methodt;
+ MonoTableInfo *paramt;
+
+ for (i = 0; i < method->signature->param_count + 1; ++i)
+ mspecs [i] = NULL;
+
+ if (method->klass->image->dynamic) {
+ MonoReflectionMethodAux *method_aux =
+ mono_g_hash_table_lookup (
+ ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+ if (method_aux && method_aux->param_marshall) {
+ MonoMarshalSpec **dyn_specs = method_aux->param_marshall;
+ for (i = 0; i < method->signature->param_count + 1; ++i)
+ if (dyn_specs [i]) {
+ mspecs [i] = g_new0 (MonoMarshalSpec, 1);
+ memcpy (mspecs [i], dyn_specs [i], sizeof (MonoMarshalSpec));
+ }
+ }
+ return;
+ }
+
+ mono_class_init (klass);
+
+ methodt = &klass->image->tables [MONO_TABLE_METHOD];
+ paramt = &klass->image->tables [MONO_TABLE_PARAM];
+
+ for (i = 0; i < klass->method.count; ++i) {
+ if (method == klass->methods [i]) {
+ guint32 idx = klass->method.first + i;
+ guint32 cols [MONO_PARAM_SIZE];
+ guint param_index = mono_metadata_decode_row_col (methodt, idx, MONO_METHOD_PARAMLIST);
+
+ if (idx + 1 < methodt->rows)
+ lastp = mono_metadata_decode_row_col (methodt, idx + 1, MONO_METHOD_PARAMLIST);
+ else
+ lastp = paramt->rows + 1;
+
+ for (i = param_index; i < lastp; ++i) {
+ mono_metadata_decode_row (paramt, i -1, cols, MONO_PARAM_SIZE);
+
+ if (cols [MONO_PARAM_FLAGS] & PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL) {
+ const char *tp;
+ tp = mono_metadata_get_marshal_info (klass->image, i - 1, FALSE);
+ g_assert (tp);
+ mspecs [cols [MONO_PARAM_SEQUENCE]]= mono_metadata_parse_marshal_spec (klass->image, tp);
+ }
+ }
+
+ return;
+ }
+ }
+}
+
+gboolean
+mono_method_has_marshal_info (MonoMethod *method)
+{
+ int i, lastp;
+ MonoClass *klass = method->klass;
+ MonoTableInfo *methodt;
+ MonoTableInfo *paramt;
+
+ if (method->klass->image->dynamic) {
+ MonoReflectionMethodAux *method_aux =
+ mono_g_hash_table_lookup (
+ ((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+ MonoMarshalSpec **dyn_specs = method_aux->param_marshall;
+ if (dyn_specs) {
+ for (i = 0; i < method->signature->param_count + 1; ++i)
+ if (dyn_specs [i])
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ mono_class_init (klass);
+
+ methodt = &klass->image->tables [MONO_TABLE_METHOD];
+ paramt = &klass->image->tables [MONO_TABLE_PARAM];
+
+ for (i = 0; i < klass->method.count; ++i) {
+ if (method == klass->methods [i]) {
+ guint32 idx = klass->method.first + i;
+ guint32 cols [MONO_PARAM_SIZE];
+ guint param_index = mono_metadata_decode_row_col (methodt, idx, MONO_METHOD_PARAMLIST);
+
+ if (idx + 1 < methodt->rows)
+ lastp = mono_metadata_decode_row_col (methodt, idx + 1, MONO_METHOD_PARAMLIST);
+ else
+ lastp = paramt->rows + 1;
+
+ for (i = param_index; i < lastp; ++i) {
+ mono_metadata_decode_row (paramt, i -1, cols, MONO_PARAM_SIZE);
+
+ if (cols [MONO_PARAM_FLAGS] & PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL)
+ return TRUE;
+ }
+ return FALSE;
+ }
+ }
+ return FALSE;
+}
+
+gpointer
+mono_method_get_wrapper_data (MonoMethod *method, guint32 id)
+{
+ GList *l;
+ g_assert (method != NULL);
+ g_assert (method->wrapper_type != MONO_WRAPPER_NONE);
+
+ if (!(l = g_list_nth (((MonoMethodWrapper *)method)->data, id - 1)))
+ g_assert_not_reached ();
+
+ return l->data;
+}
+
+static void
+default_stack_walk (MonoStackWalk func, gboolean do_il_offset, gpointer user_data) {
+ g_error ("stack walk not installed");
+}
+
+static MonoStackWalkImpl stack_walk = default_stack_walk;
+
+void
+mono_stack_walk (MonoStackWalk func, gpointer user_data)
+{
+ stack_walk (func, FALSE, user_data);
+}
+
+void
+mono_stack_walk_no_il (MonoStackWalk func, gpointer user_data)
+{
+ stack_walk (func, TRUE, user_data);
+}
+
+void
+mono_install_stack_walk (MonoStackWalkImpl func)
+{
+ stack_walk = func;
+}
+
+static gboolean
+last_managed (MonoMethod *m, gint no, gint ilo, gboolean managed, gpointer data)
+{
+ MonoMethod **dest = data;
+ *dest = m;
+ /*g_print ("In %s::%s [%d] [%d]\n", m->klass->name, m->name, no, ilo);*/
+
+ return managed;
+}
+
+MonoMethod*
+mono_method_get_last_managed (void)
+{
+ MonoMethod *m = NULL;
+ stack_walk (last_managed, FALSE, &m);
+ return m;
+}
+
+void
+mono_loader_lock (void)
+{
+ EnterCriticalSection (&loader_mutex);
+}
+
+void
+mono_loader_unlock (void)
+{
+ LeaveCriticalSection (&loader_mutex);
+}
+
+MonoMethodSignature*
+mono_method_signature (MonoMethod *method)
+{
+ return method->signature;
+}
+
+const char*
+mono_method_get_name (MonoMethod *method)
+{
+ return method->name;
+}
+
+MonoClass*
+mono_method_get_class (MonoMethod *method)
+{
+ return method->klass;
+}
+
+guint32
+mono_method_get_token (MonoMethod *method)
+{
+ return method->token;
+}
+
+MonoMethodHeader*
+mono_method_get_header (MonoMethod *method)
+{
+ int idx;
+ guint32 rva;
+ MonoImage* img;
+ gpointer loc;
+ MonoMethodNormal* mn = (MonoMethodNormal*) method;
+
+ if (G_LIKELY (mn->header))
+ return mn->header;
+
+ if (method->klass->dummy || (method->flags & METHOD_ATTRIBUTE_ABSTRACT) || (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) || (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ return NULL;
+
+ mono_loader_lock ();
+
+ if (mn->header) {
+ mono_loader_unlock ();
+ return mn->header;
+ }
+
+ g_assert (mono_metadata_token_table (method->token) == MONO_TABLE_METHOD);
+ idx = mono_metadata_token_index (method->token);
+ img = method->klass->image;
+ rva = mono_metadata_decode_row_col (&img->tables [MONO_TABLE_METHOD], idx - 1, MONO_METHOD_RVA);
+ loc = mono_image_rva_map (img, rva);
+
+ g_assert (loc);
+
+ mn->header = mono_metadata_parse_mh_full (img, mn->generic_container, loc);
+
+ mono_loader_unlock ();
+ return mn->header;
+}
+
+guint32
+mono_method_get_flags (MonoMethod *method, guint32 *iflags)
+{
+ if (iflags)
+ *iflags = method->iflags;
+ return method->flags;
+}
+
+
diff --git a/mono/metadata/loader.h b/mono/metadata/loader.h
index 9820274141f..0ee7720f712 100644
--- a/mono/metadata/loader.h
+++ b/mono/metadata/loader.h
@@ -4,88 +4,43 @@
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
-typedef struct {
- guint16 flags; /* method flags */
- guint16 iflags; /* method implementation flags */
- MonoClass *klass;
- MonoMethodSignature *signature;
- gpointer addr;
- gpointer info; /* runtime info */
- gpointer remoting_tramp;
- gint slot;
- /* name is useful mostly for debugging */
- const char *name;
- /* this is used by the inlining algorithm */
- unsigned int inline_info:1;
- unsigned int uses_this:1;
- gint16 inline_count;
-} MonoMethod;
-
-typedef struct {
- MonoMethod method;
- MonoMethodHeader *header;
-} MonoMethodNormal;
-
-typedef struct {
- MonoMethod method;
- void (*code) (void);
- /* add marshal info */
- guint16 piflags; /* pinvoke flags */
- guint16 implmap_idx; /* index into IMPLMAP */
-} MonoMethodPInvoke;
-
-typedef struct {
- MonoImage *corlib;
- MonoClass *object_class;
- MonoClass *byte_class;
- MonoClass *void_class;
- MonoClass *boolean_class;
- MonoClass *sbyte_class;
- MonoClass *int16_class;
- MonoClass *uint16_class;
- MonoClass *int32_class;
- MonoClass *uint32_class;
- MonoClass *int_class;
- MonoClass *uint_class;
- MonoClass *int64_class;
- MonoClass *uint64_class;
- MonoClass *single_class;
- MonoClass *double_class;
- MonoClass *char_class;
- MonoClass *string_class;
- MonoClass *enum_class;
- MonoClass *array_class;
- MonoClass *multicastdelegate_class;
- MonoClass *asyncresult_class;
- MonoClass *waithandle_class;
- MonoClass *typehandle_class;
- MonoClass *fieldhandle_class;
- MonoClass *methodhandle_class;
- MonoClass *monotype_class;
- MonoClass *exception_class;
- MonoClass *thread_class;
- MonoClass *transparent_proxy_class;
- MonoClass *real_proxy_class;
- MonoClass *mono_method_message_class;
- MonoClass *appdomain_class;
- MonoClass *field_info_class;
- MonoClass *stringbuilder_class;
- MonoClass *math_class;
- MonoClass *stack_frame_class;
- MonoClass *stack_trace_class;
-} MonoDefaults;
-
-extern MonoDefaults mono_defaults;
-
-void
-mono_init_icall (void);
+typedef struct _MonoMethod MonoMethod;
+
+typedef gboolean (*MonoStackWalk) (MonoMethod *method, gint32 native_offset, gint32 il_offset, gboolean managed, gpointer data);
MonoMethod *
mono_get_method (MonoImage *image, guint32 token, MonoClass *klass);
+MonoMethod *
+mono_get_method_full (MonoImage *image, guint32 token, MonoClass *klass, MonoGenericContext *context);
+
+MonoMethod *
+mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constrained_class, MonoGenericContext *context);
+
void
mono_free_method (MonoMethod *method);
+MonoMethodSignature*
+mono_method_get_signature (MonoMethod *method, MonoImage *image, guint32 token);
+
+MonoMethodSignature*
+mono_method_signature (MonoMethod *method);
+
+MonoMethodHeader*
+mono_method_get_header (MonoMethod *method);
+
+const char*
+mono_method_get_name (MonoMethod *method);
+
+MonoClass*
+mono_method_get_class (MonoMethod *method);
+
+guint32
+mono_method_get_token (MonoMethod *method);
+
+guint32
+mono_method_get_flags (MonoMethod *method, guint32 *iflags);
+
MonoImage *
mono_load_image (const char *fname, MonoImageOpenStatus *status);
@@ -95,16 +50,33 @@ mono_add_internal_call (const char *name, gconstpointer method);
gpointer
mono_lookup_internal_call (MonoMethod *method);
-int
-mono_dllmap_lookup (const char *dll, const char* func, const char **rdll, const char **rfunc);
-
void
-mono_dllmap_insert (const char *dll, const char *func, const char *tdll, const char *tfunc);
+mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc);
gpointer
-mono_lookup_pinvoke_call (MonoMethod *method);
+mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char **exc_arg);
void
mono_method_get_param_names (MonoMethod *method, const char **names);
+guint32
+mono_method_get_param_token (MonoMethod *method, int index);
+
+void
+mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs);
+
+gboolean
+mono_method_has_marshal_info (MonoMethod *method);
+
+MonoMethod*
+mono_method_get_last_managed (void);
+
+void
+mono_stack_walk (MonoStackWalk func, gpointer user_data);
+
+/* Use this if the IL offset is not needed: it's faster */
+void
+mono_stack_walk_no_il (MonoStackWalk func, gpointer user_data);
+
#endif
+
diff --git a/mono/metadata/locales.c b/mono/metadata/locales.c
new file mode 100644
index 00000000000..ec5d5f922e1
--- /dev/null
+++ b/mono/metadata/locales.c
@@ -0,0 +1,2078 @@
+/*
+ * locales.c: Culture-sensitive handling
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ * Mohammad DAMT (mdamt@cdl2000.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ * (C) 2003 PT Cakram Datalingga Duaribu http://www.cdl2000.com
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/monitor.h>
+#include <mono/metadata/locales.h>
+#include <mono/metadata/culture-info.h>
+#include <mono/metadata/culture-info-tables.h>
+
+
+#include <locale.h>
+
+#undef DEBUG
+
+static gint32 string_invariant_compare_char (gunichar2 c1, gunichar2 c2,
+ gint32 options);
+static gint32 string_invariant_compare (MonoString *str1, gint32 off1,
+ gint32 len1, MonoString *str2,
+ gint32 off2, gint32 len2,
+ gint32 options);
+static MonoString *string_invariant_replace (MonoString *me,
+ MonoString *oldValue,
+ MonoString *newValue);
+static gint32 string_invariant_indexof (MonoString *source, gint32 sindex,
+ gint32 count, MonoString *value,
+ MonoBoolean first);
+static gint32 string_invariant_indexof_char (MonoString *source, gint32 sindex,
+ gint32 count, gunichar2 value,
+ MonoBoolean first);
+
+static const CultureInfoEntry* culture_info_entry_from_lcid (int lcid);
+
+static int
+culture_lcid_locator (const void *a, const void *b)
+{
+ const CultureInfoEntry *aa = a;
+ const CultureInfoEntry *bb = b;
+
+ return (aa->lcid - bb->lcid);
+}
+
+static int
+culture_name_locator (const void *a, const void *b)
+{
+ const char *aa = a;
+ const CultureInfoNameEntry *bb = b;
+ int ret;
+
+ ret = strcmp (aa, idx2string (bb->name));
+
+ return ret;
+}
+
+static MonoArray*
+create_group_sizes_array (const gint *gs, gint ml)
+{
+ MonoArray *ret;
+ int i, len = 0;
+
+ for (i = 0; i < ml; i++) {
+ if (gs [i] == -1)
+ break;
+ len++;
+ }
+
+ ret = mono_array_new (mono_domain_get (),
+ mono_get_int32_class (), len);
+
+ for(i = 0; i < len; i++)
+ mono_array_set (ret, gint32, i, gs [i]);
+
+ return ret;
+}
+
+static MonoArray*
+create_names_array_idx (const guint16 *names, int ml)
+{
+ MonoArray *ret;
+ MonoDomain *domain;
+ int i, len = 0;
+
+ if (names == NULL)
+ return NULL;
+
+ domain = mono_domain_get ();
+
+ for (i = 0; i < ml; i++) {
+ if (names [i] == 0)
+ break;
+ len++;
+ }
+
+ ret = mono_array_new (mono_domain_get (), mono_get_string_class (), len);
+
+ for(i = 0; i < len; i++)
+ mono_array_set (ret, MonoString *, i, mono_string_new (domain, idx2string (names [i])));
+
+ return ret;
+}
+
+void
+ves_icall_System_Globalization_CultureInfo_construct_datetime_format (MonoCultureInfo *this)
+{
+ MonoDomain *domain;
+ MonoDateTimeFormatInfo *datetime;
+ const DateTimeFormatEntry *dfe;
+
+ MONO_ARCH_SAVE_REGS;
+
+ g_assert (this->datetime_index >= 0);
+
+ datetime = this->datetime_format;
+ dfe = &datetime_format_entries [this->datetime_index];
+
+ domain = mono_domain_get ();
+
+ datetime->AbbreviatedDayNames = create_names_array_idx (dfe->abbreviated_day_names,
+ NUM_DAYS);
+ datetime->AbbreviatedMonthNames = create_names_array_idx (dfe->abbreviated_month_names,
+ NUM_MONTHS);
+ datetime->AMDesignator = mono_string_new (domain, idx2string (dfe->am_designator));
+ datetime->CalendarWeekRule = dfe->calendar_week_rule;
+ datetime->DateSeparator = mono_string_new (domain, idx2string (dfe->date_separator));
+ datetime->DayNames = create_names_array_idx (dfe->day_names, NUM_DAYS);
+ datetime->FirstDayOfWeek = dfe->first_day_of_week;
+ datetime->FullDateTimePattern = mono_string_new (domain, idx2string (dfe->full_date_time_pattern));
+ datetime->LongDatePattern = mono_string_new (domain, idx2string (dfe->long_date_pattern));
+ datetime->LongTimePattern = mono_string_new (domain, idx2string (dfe->long_time_pattern));
+ datetime->MonthDayPattern = mono_string_new (domain, idx2string (dfe->month_day_pattern));
+ datetime->MonthNames = create_names_array_idx (dfe->month_names, NUM_MONTHS);
+ datetime->PMDesignator = mono_string_new (domain, idx2string (dfe->pm_designator));
+ datetime->ShortDatePattern = mono_string_new (domain, idx2string (dfe->short_date_pattern));
+ datetime->ShortTimePattern = mono_string_new (domain, idx2string (dfe->short_time_pattern));
+ datetime->TimeSeparator = mono_string_new (domain, idx2string (dfe->time_separator));
+ datetime->YearMonthPattern = mono_string_new (domain, idx2string (dfe->year_month_pattern));
+ datetime->ShortDatePatterns = create_names_array_idx (dfe->short_date_patterns,
+ NUM_SHORT_DATE_PATTERNS);
+ datetime->LongDatePatterns = create_names_array_idx (dfe->long_date_patterns,
+ NUM_LONG_DATE_PATTERNS);
+ datetime->ShortTimePatterns = create_names_array_idx (dfe->short_time_patterns,
+ NUM_SHORT_TIME_PATTERNS);
+ datetime->LongTimePatterns = create_names_array_idx (dfe->long_time_patterns,
+ NUM_LONG_TIME_PATTERNS);
+
+}
+
+void
+ves_icall_System_Globalization_CultureInfo_construct_number_format (MonoCultureInfo *this)
+{
+ MonoDomain *domain;
+ MonoNumberFormatInfo *number;
+ const NumberFormatEntry *nfe;
+
+ MONO_ARCH_SAVE_REGS;
+
+ g_assert (this->number_format != 0);
+
+ number = this->number_format;
+ nfe = &number_format_entries [this->number_index];
+
+ domain = mono_domain_get ();
+
+ number->currencyDecimalDigits = nfe->currency_decimal_digits;
+ number->currencyDecimalSeparator = mono_string_new (domain,
+ idx2string (nfe->currency_decimal_separator));
+ number->currencyGroupSeparator = mono_string_new (domain,
+ idx2string (nfe->currency_group_separator));
+ number->currencyGroupSizes = create_group_sizes_array (nfe->currency_group_sizes,
+ GROUP_SIZE);
+ number->currencyNegativePattern = nfe->currency_negative_pattern;
+ number->currencyPositivePattern = nfe->currency_positive_pattern;
+ number->currencySymbol = mono_string_new (domain, idx2string (nfe->currency_symbol));
+ number->naNSymbol = mono_string_new (domain, idx2string (nfe->nan_symbol));
+ number->negativeInfinitySymbol = mono_string_new (domain,
+ idx2string (nfe->negative_infinity_symbol));
+ number->negativeSign = mono_string_new (domain, idx2string (nfe->negative_sign));
+ number->numberDecimalDigits = nfe->number_decimal_digits;
+ number->numberDecimalSeparator = mono_string_new (domain,
+ idx2string (nfe->number_decimal_separator));
+ number->numberGroupSeparator = mono_string_new (domain, idx2string (nfe->number_group_separator));
+ number->numberGroupSizes = create_group_sizes_array (nfe->number_group_sizes,
+ GROUP_SIZE);
+ number->numberNegativePattern = nfe->number_negative_pattern;
+ number->percentDecimalDigits = nfe->percent_decimal_digits;
+ number->percentDecimalSeparator = mono_string_new (domain,
+ idx2string (nfe->percent_decimal_separator));
+ number->percentGroupSeparator = mono_string_new (domain,
+ idx2string (nfe->percent_group_separator));
+ number->percentGroupSizes = create_group_sizes_array (nfe->percent_group_sizes,
+ GROUP_SIZE);
+ number->percentNegativePattern = nfe->percent_negative_pattern;
+ number->percentPositivePattern = nfe->percent_positive_pattern;
+ number->percentSymbol = mono_string_new (domain, idx2string (nfe->percent_symbol));
+ number->perMilleSymbol = mono_string_new (domain, idx2string (nfe->per_mille_symbol));
+ number->positiveInfinitySymbol = mono_string_new (domain,
+ idx2string (nfe->positive_infinity_symbol));
+ number->positiveSign = mono_string_new (domain, idx2string (nfe->positive_sign));
+}
+
+static MonoBoolean
+construct_culture (MonoCultureInfo *this, const CultureInfoEntry *ci)
+{
+ MonoDomain *domain = mono_domain_get ();
+
+ this->lcid = ci->lcid;
+ this->name = mono_string_new (domain, idx2string (ci->name));
+ this->icu_name = mono_string_new (domain, idx2string (ci->icu_name));
+ this->displayname = mono_string_new (domain, idx2string (ci->displayname));
+ this->englishname = mono_string_new (domain, idx2string (ci->englishname));
+ this->nativename = mono_string_new (domain, idx2string (ci->nativename));
+ this->win3lang = mono_string_new (domain, idx2string (ci->win3lang));
+ this->iso3lang = mono_string_new (domain, idx2string (ci->iso3lang));
+ this->iso2lang = mono_string_new (domain, idx2string (ci->iso2lang));
+ this->parent_lcid = ci->parent_lcid;
+ this->specific_lcid = ci->specific_lcid;
+ this->datetime_index = ci->datetime_format_index;
+ this->number_index = ci->number_format_index;
+ this->calendar_data = ci->calendar_data;
+
+ return TRUE;
+}
+
+static gboolean
+construct_culture_from_specific_name (MonoCultureInfo *ci, gchar *name)
+{
+ const CultureInfoEntry *entry;
+ const CultureInfoNameEntry *ne;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ne = bsearch (name, culture_name_entries, NUM_CULTURE_ENTRIES,
+ sizeof (CultureInfoNameEntry), culture_name_locator);
+
+ if (ne == NULL)
+ return FALSE;
+
+ entry = &culture_entries [ne->culture_entry_index];
+
+ /* try avoiding another lookup, often the culture is its own specific culture */
+ if (entry->lcid != entry->specific_lcid)
+ entry = culture_info_entry_from_lcid (entry->specific_lcid);
+
+ return construct_culture (ci, entry);
+}
+
+static const CultureInfoEntry*
+culture_info_entry_from_lcid (int lcid)
+{
+ const CultureInfoEntry *ci;
+ CultureInfoEntry key;
+
+ key.lcid = lcid;
+ ci = bsearch (&key, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
+
+ return ci;
+}
+
+/**
+ * The following two methods are modified from the ICU source code. (http://oss.software.ibm.com/icu)
+ * Copyright (c) 1995-2003 International Business Machines Corporation and others
+ * All rights reserved.
+ */
+static gchar*
+get_posix_locale (void)
+{
+ const gchar* posix_locale = NULL;
+
+ posix_locale = g_getenv("LC_ALL");
+ if (posix_locale == 0) {
+ posix_locale = g_getenv("LANG");
+ if (posix_locale == 0) {
+ posix_locale = setlocale(LC_ALL, NULL);
+ }
+ }
+
+ if (posix_locale == NULL)
+ return NULL;
+
+ if ((strcmp ("C", posix_locale) == 0) || (strchr (posix_locale, ' ') != NULL)
+ || (strchr (posix_locale, '/') != NULL)) {
+ /**
+ * HPUX returns 'C C C C C C C'
+ * Solaris can return /en_US/C/C/C/C/C on the second try.
+ * Maybe we got some garbage.
+ */
+ return NULL;
+ }
+
+ return g_strdup (posix_locale);
+}
+
+static gchar*
+get_current_locale_name (void)
+{
+ gchar *locale;
+ gchar *corrected = NULL;
+ const gchar *p;
+ gchar *c;
+
+#ifdef PLATFORM_WIN32
+ locale = g_win32_getlocale ();
+#else
+ locale = get_posix_locale ();
+#endif
+
+ if (locale == NULL)
+ return NULL;
+
+ if ((p = strchr (locale, '.')) != NULL) {
+ /* assume new locale can't be larger than old one? */
+ corrected = malloc (strlen (locale));
+ strncpy (corrected, locale, p - locale);
+ corrected [p - locale] = 0;
+
+ /* do not copy after the @ */
+ if ((p = strchr (corrected, '@')) != NULL)
+ corrected [p - corrected] = 0;
+ }
+
+ /* Note that we scan the *uncorrected* ID. */
+ if ((p = strrchr (locale, '@')) != NULL) {
+
+ /**
+ * In Mono we dont handle the '@' modifier because we do
+ * not have any cultures that use it. We just trim it
+ * off of the end of the name.
+ */
+
+ if (corrected == NULL) {
+ corrected = malloc (strlen (locale));
+ strncpy (corrected, locale, p - locale);
+ corrected [p - locale] = 0;
+ }
+ }
+
+ if (corrected == NULL)
+ corrected = locale;
+ else
+ g_free (locale);
+
+ if ((c = strchr (corrected, '_')) != NULL)
+ *c = '-';
+
+ g_strdown (corrected);
+
+ return corrected;
+}
+
+MonoBoolean
+ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_current_locale (MonoCultureInfo *ci)
+{
+ gchar *locale;
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ locale = get_current_locale_name ();
+ if (locale == NULL)
+ return FALSE;
+
+ ret = construct_culture_from_specific_name (ci, locale);
+ g_free (locale);
+
+ return ret;
+}
+
+MonoBoolean
+ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_lcid (MonoCultureInfo *this,
+ gint lcid)
+{
+ const CultureInfoEntry *ci;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ci = culture_info_entry_from_lcid (lcid);
+ if(ci == NULL)
+ return FALSE;
+
+ return construct_culture (this, ci);
+}
+
+MonoBoolean
+ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name (MonoCultureInfo *this,
+ MonoString *name)
+{
+ const CultureInfoNameEntry *ne;
+ char *n;
+
+ MONO_ARCH_SAVE_REGS;
+
+ n = mono_string_to_utf8 (name);
+ ne = bsearch (n, culture_name_entries, NUM_CULTURE_ENTRIES,
+ sizeof (CultureInfoNameEntry), culture_name_locator);
+
+ if (ne == NULL) {
+ g_print ("ne (%s) is null\n", n);
+ g_free (n);
+ return FALSE;
+ }
+ g_free (n);
+
+ return construct_culture (this, &culture_entries [ne->culture_entry_index]);
+}
+
+MonoBoolean
+ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_specific_name (MonoCultureInfo *ci,
+ MonoString *name)
+{
+ gchar *locale;
+ gboolean ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ locale = mono_string_to_utf8 (name);
+ ret = construct_culture_from_specific_name (ci, locale);
+ g_free (locale);
+
+ return ret;
+}
+
+MonoArray*
+ves_icall_System_Globalization_CultureInfo_internal_get_cultures (MonoBoolean neutral,
+ MonoBoolean specific, MonoBoolean installed)
+{
+ MonoArray *ret;
+ MonoClass *class;
+ MonoCultureInfo *culture;
+ MonoDomain *domain;
+ const CultureInfoEntry *ci;
+ gint i, len;
+ gboolean is_neutral;
+
+ MONO_ARCH_SAVE_REGS;
+
+ domain = mono_domain_get ();
+
+ len = 0;
+ for (i = 0; i < NUM_CULTURE_ENTRIES; i++) {
+ ci = &culture_entries [i];
+ is_neutral = ((ci->lcid & 0xff00) == 0 || ci->specific_lcid == 0);
+ if ((neutral && is_neutral) || (specific && !is_neutral))
+ len++;
+ }
+
+ class = mono_class_from_name (mono_get_corlib (),
+ "System.Globalization", "CultureInfo");
+ ret = mono_array_new (domain, class, len);
+
+ if (len == 0)
+ return ret;
+
+ len = 0;
+ for (i = 0; i < NUM_CULTURE_ENTRIES; i++) {
+ ci = &culture_entries [i];
+ is_neutral = ((ci->lcid & 0xff00) == 0 || ci->specific_lcid == 0);
+ if ((neutral && is_neutral) || (specific && !is_neutral)) {
+ culture = (MonoCultureInfo *) mono_object_new (domain, class);
+ mono_runtime_object_init ((MonoObject *) culture);
+ construct_culture (culture, ci);
+ mono_array_set (ret, MonoCultureInfo *, len++, culture);
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * Set is_neutral and return TRUE if the culture is found. If it is not found return FALSE.
+ */
+MonoBoolean
+ves_icall_System_Globalization_CultureInfo_internal_is_lcid_neutral (gint lcid, MonoBoolean *is_neutral)
+{
+ const CultureInfoEntry *entry;
+
+ MONO_ARCH_SAVE_REGS;
+
+ entry = culture_info_entry_from_lcid (lcid);
+
+ if (entry == NULL)
+ return FALSE;
+
+ *is_neutral = (entry->specific_lcid == 0);
+
+ return TRUE;
+}
+
+#ifdef HAVE_ICU
+
+#include <unicode/utypes.h>
+#include <unicode/ustring.h>
+#include <unicode/ures.h>
+#include <unicode/ucol.h>
+#include <unicode/usearch.h>
+
+static MonoString *monostring_from_resource_index (const UResourceBundle *bundle, int32_t idx)
+{
+ gunichar2 *res_str;
+ int32_t res_strlen;
+ UErrorCode ec;
+
+ ec=U_ZERO_ERROR;
+ res_str=(gunichar2 *)ures_getStringByIndex (bundle, idx, &res_strlen,
+ &ec);
+ if(U_FAILURE (ec)) {
+ return(NULL);
+ }
+
+ return(mono_string_from_utf16 (res_str));
+}
+
+static UResourceBundle *open_subbundle (const UResourceBundle *bundle,
+ const char *name, int32_t req_count)
+{
+ UResourceBundle *subbundle;
+ UErrorCode ec;
+ int32_t count;
+
+ ec=U_ZERO_ERROR;
+ subbundle=ures_getByKey (bundle, name, NULL, &ec);
+ if(U_FAILURE (ec)) {
+ /* Couldn't find the subbundle */
+ return(NULL);
+ }
+
+ count=ures_countArrayItems (bundle, name, &ec);
+ if(U_FAILURE (ec)) {
+ /* Couldn't count the subbundle */
+ ures_close (subbundle);
+ return(NULL);
+ }
+
+ if(count!=req_count) {
+ /* Bummer */
+ ures_close (subbundle);
+ return(NULL);
+ }
+
+ return(subbundle);
+}
+
+static MonoArray *build_array (const UResourceBundle *bundle,
+ const char *resname, int32_t req_count)
+{
+ MonoArray *arr=NULL;
+ UResourceBundle *subbundle;
+ int i;
+
+ subbundle=open_subbundle (bundle, resname, req_count);
+ if(subbundle!=NULL) {
+ arr=mono_array_new(mono_domain_get (),
+ mono_get_string_class (), req_count);
+
+ for(i=0; i<req_count; i++) {
+ mono_array_set(arr, MonoString *, i, monostring_from_resource_index (subbundle, i));
+ }
+
+ ures_close (subbundle);
+ }
+
+ return(arr);
+}
+
+static MonoDateTimeFormatInfo *create_DateTimeFormat (const char *locale)
+{
+ MonoDateTimeFormatInfo *new_dtf;
+ MonoClass *class;
+ UResourceBundle *bundle, *subbundle;
+ UErrorCode ec;
+
+ class=mono_class_from_name (mono_get_corlib (),
+ "System.Globalization",
+ "DateTimeFormatInfo");
+ new_dtf=(MonoDateTimeFormatInfo *)mono_object_new (mono_domain_get (),
+ class);
+ mono_runtime_object_init ((MonoObject *)new_dtf);
+
+ ec=U_ZERO_ERROR;
+
+ bundle=ures_open (NULL, locale, &ec);
+ if(U_FAILURE (ec)) {
+ goto error1;
+ }
+
+ /* AM/PM markers */
+ subbundle=open_subbundle (bundle, "AmPmMarkers", 2);
+ if(subbundle!=NULL) {
+ new_dtf->AMDesignator=monostring_from_resource_index (subbundle, 0);
+ new_dtf->PMDesignator=monostring_from_resource_index (subbundle, 1);
+
+ ures_close (subbundle);
+ }
+
+ /* Date/Time patterns. Don't set FullDateTimePattern. As it
+ * seems to always default to LongDatePattern + " " +
+ * LongTimePattern, let the property accessor deal with it.
+ */
+ subbundle=open_subbundle (bundle, "DateTimePatterns", 9);
+ if(subbundle!=NULL) {
+ new_dtf->ShortDatePattern=monostring_from_resource_index (subbundle, 7);
+ new_dtf->LongDatePattern=monostring_from_resource_index (subbundle, 5);
+ new_dtf->ShortTimePattern=monostring_from_resource_index (subbundle, 3);
+ new_dtf->LongTimePattern=monostring_from_resource_index (subbundle, 2);
+
+ /* RFC1123Pattern, SortableDateTimePattern and
+ * UniversalSortableDateTimePattern all seem to be
+ * constant, and all the same as the invariant default
+ * set in the ctor
+ */
+
+ ures_close (subbundle);
+ }
+
+#if 0
+ /* Not sure what to do with these yet, so leave them set to
+ * the invariant default
+ */
+ set_field_string (new_dtf, "_DateSeparator", str);
+ set_field_string (new_dtf, "_TimeSeparator", str);
+ set_field_string (new_dtf, "_MonthDayPattern", str);
+ set_field_string (new_dtf, "_YearMonthPattern", str);
+#endif
+
+ /* Day names. Luckily both ICU and .net start Sunday at index 0 */
+ new_dtf->DayNames=build_array (bundle, "DayNames", 7);
+
+ /* Abbreviated day names */
+ new_dtf->AbbreviatedDayNames=build_array (bundle, "DayAbbreviations",
+ 7);
+
+ /* Month names */
+ new_dtf->MonthNames=build_array (bundle, "MonthNames", 12);
+
+ /* Abbreviated month names */
+ new_dtf->AbbreviatedMonthNames=build_array (bundle,
+ "MonthAbbreviations", 12);
+
+ /* TODO: DayOfWeek _FirstDayOfWeek, Calendar _Calendar, CalendarWeekRule _CalendarWeekRule */
+
+ ures_close (bundle);
+error1:
+ return(new_dtf);
+}
+
+static MonoNumberFormatInfo *create_NumberFormat (const char *locale)
+{
+ MonoNumberFormatInfo *new_nf;
+ MonoClass *class;
+ MonoMethodDesc* methodDesc;
+ MonoMethod *method;
+ UResourceBundle *bundle, *subbundle, *table_entries;
+ UErrorCode ec;
+ int32_t count;
+ static char country [7]; /* FIXME */
+ const UChar *res_str;
+ int32_t res_strlen;
+
+ class=mono_class_from_name (mono_get_corlib (),
+ "System.Globalization",
+ "NumberFormatInfo");
+ new_nf=(MonoNumberFormatInfo *)mono_object_new (mono_domain_get (),
+ class);
+ mono_runtime_object_init ((MonoObject *)new_nf);
+
+ ec=U_ZERO_ERROR;
+
+ bundle=ures_open (NULL, locale, &ec);
+ if(U_FAILURE (ec)) {
+ goto error1;
+ }
+
+ /* Number Elements */
+ ec=U_ZERO_ERROR;
+ subbundle=ures_getByKey (bundle, "NumberElements", NULL, &ec);
+ if(U_FAILURE (ec)) {
+ /* Couldn't find the subbundle */
+ goto error1;
+ }
+
+ count=ures_countArrayItems (bundle, "NumberElements", &ec);
+ if(U_FAILURE (ec)) {
+ /* Couldn't count the subbundle */
+ ures_close (subbundle);
+ goto error1;
+ }
+
+ if(subbundle!=NULL) {
+ new_nf->numberDecimalSeparator=monostring_from_resource_index (subbundle, 0);
+ new_nf->numberGroupSeparator=monostring_from_resource_index (subbundle, 1);
+ new_nf->percentDecimalSeparator=monostring_from_resource_index (subbundle, 0);
+ new_nf->percentGroupSeparator=monostring_from_resource_index (subbundle, 1);
+ new_nf->percentSymbol=monostring_from_resource_index (subbundle, 3);
+ new_nf->zeroPattern=monostring_from_resource_index (subbundle, 4);
+ new_nf->digitPattern=monostring_from_resource_index (subbundle, 5);
+ new_nf->negativeSign=monostring_from_resource_index (subbundle, 6);
+ new_nf->perMilleSymbol=monostring_from_resource_index (subbundle, 8);
+ new_nf->positiveInfinitySymbol=monostring_from_resource_index (subbundle, 9);
+ /* we dont have this in CLDR, so copy it from positiveInfinitySymbol */
+ new_nf->negativeInfinitySymbol=monostring_from_resource_index (subbundle, 9);
+ new_nf->naNSymbol=monostring_from_resource_index (subbundle, 10);
+ new_nf->currencyDecimalSeparator=monostring_from_resource_index (subbundle, 0);
+ new_nf->currencyGroupSeparator=monostring_from_resource_index (subbundle, 1);
+
+ ures_close (subbundle);
+ }
+
+ /* get country name */
+ ec = U_ZERO_ERROR;
+ uloc_getCountry (locale, country, sizeof (country), &ec);
+ if (U_SUCCESS (ec)) {
+ ec = U_ZERO_ERROR;
+ /* find country name in root.CurrencyMap */
+ subbundle = ures_getByKey (bundle, "CurrencyMap", NULL, &ec);
+ if (U_SUCCESS (ec)) {
+ ec = U_ZERO_ERROR;
+ /* get currency id for specified country */
+ table_entries = ures_getByKey (subbundle, country, NULL, &ec);
+ if (U_SUCCESS (ec)) {
+ ures_close (subbundle);
+ ec = U_ZERO_ERROR;
+
+ res_str = ures_getStringByIndex (
+ table_entries, 0, &res_strlen, &ec);
+ if(U_SUCCESS (ec)) {
+ /* now we have currency id string */
+ ures_close (table_entries);
+ ec = U_ZERO_ERROR;
+ u_UCharsToChars (res_str, country,
+ sizeof (country));
+ if(U_SUCCESS (ec)) {
+ ec = U_ZERO_ERROR;
+ /* find currency string in locale data */
+ subbundle = ures_getByKey (
+ bundle, "Currencies",
+ NULL, &ec);
+
+ if (U_SUCCESS (ec)) {
+ ec = U_ZERO_ERROR;
+ /* find currency symbol under specified currency id */
+ table_entries = ures_getByKey (subbundle, country, NULL, &ec);
+ if (U_SUCCESS (ec)) {
+ /* get the first string only,
+ * the second is international currency symbol (not used)*/
+ new_nf->currencySymbol=monostring_from_resource_index (table_entries, 0);
+ ures_close (table_entries);
+ }
+ ures_close (subbundle);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ subbundle=open_subbundle (bundle, "NumberPatterns", 4);
+ if(subbundle!=NULL) {
+ new_nf->decimalFormats=monostring_from_resource_index (subbundle, 0);
+ new_nf->currencyFormats=monostring_from_resource_index (subbundle, 1);
+ new_nf->percentFormats=monostring_from_resource_index (subbundle, 2);
+ ures_close (subbundle);
+
+ /* calls InitPatterns to parse the patterns
+ */
+ methodDesc = mono_method_desc_new (
+ "System.Globalization.NumberFormatInfo:InitPatterns()",
+ TRUE);
+ method = mono_method_desc_search_in_class (methodDesc, class);
+ if(method!=NULL) {
+ mono_runtime_invoke (method, new_nf, NULL, NULL);
+ } else {
+ g_warning (G_GNUC_PRETTY_FUNCTION ": Runtime mismatch with class lib! (Looking for System.Globalization.NumberFormatInfo:InitPatterns())");
+ }
+ }
+
+ ures_close (bundle);
+error1:
+ return(new_nf);
+}
+
+static char *mono_string_to_icu_locale (MonoString *locale)
+{
+ UErrorCode ec;
+ char *passed_locale, *icu_locale=NULL;
+ int32_t loc_len, ret;
+
+ passed_locale=mono_string_to_utf8 (locale);
+
+ ec=U_ZERO_ERROR;
+ ret=uloc_getName (passed_locale, NULL, 0, &ec);
+ if(ec==U_BUFFER_OVERFLOW_ERROR) {
+ ec=U_ZERO_ERROR;
+ loc_len=ret+1;
+ icu_locale=(char *)g_malloc0 (sizeof(char)*loc_len);
+ ret=uloc_getName (passed_locale, icu_locale, loc_len, &ec);
+ }
+ g_free (passed_locale);
+
+ return(icu_locale);
+}
+
+void ves_icall_System_Globalization_CultureInfo_construct_internal_locale (MonoCultureInfo *this, MonoString *locale)
+{
+ UChar *ustr;
+ char *str;
+ UErrorCode ec;
+ char *icu_locale;
+ int32_t str_len, ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ icu_locale=mono_string_to_icu_locale (locale);
+ if(icu_locale==NULL) {
+ /* Something went wrong */
+ mono_raise_exception((MonoException *)mono_exception_from_name(mono_get_corlib (), "System", "SystemException"));
+ return;
+ }
+
+ /* Fill in the static fields */
+
+ /* TODO: Calendar, InstalledUICulture, OptionalCalendars,
+ * TextInfo
+ */
+
+ str_len=256; /* Should be big enough for anything */
+ str=(char *)g_malloc0 (sizeof(char)*str_len);
+ ustr=(UChar *)g_malloc0 (sizeof(UChar)*str_len);
+
+ ec=U_ZERO_ERROR;
+
+ ret=uloc_getDisplayName (icu_locale, "en", ustr, str_len, &ec);
+ if(U_SUCCESS (ec) && ret<str_len) {
+ this->englishname=mono_string_from_utf16 ((gunichar2 *)ustr);
+ }
+
+ ret=uloc_getDisplayName (icu_locale, uloc_getDefault (), ustr, str_len,
+ &ec);
+ if(U_SUCCESS (ec) && ret<str_len) {
+ this->displayname=mono_string_from_utf16 ((gunichar2 *)ustr);
+ }
+
+ ret=uloc_getDisplayName (icu_locale, icu_locale, ustr, str_len, &ec);
+ if(U_SUCCESS (ec) && ret<str_len) {
+ this->nativename=mono_string_from_utf16 ((gunichar2 *)ustr);
+ }
+
+ this->iso3lang=mono_string_new_wrapper (uloc_getISO3Language (icu_locale));
+
+ ret=uloc_getLanguage (icu_locale, str, str_len, &ec);
+ if(U_SUCCESS (ec) && ret<str_len) {
+ this->iso2lang=mono_string_new_wrapper (str);
+ }
+
+ this->datetime_format=create_DateTimeFormat (icu_locale);
+ this->number_format=create_NumberFormat (icu_locale);
+
+ g_free (str);
+ g_free (ustr);
+ g_free (icu_locale);
+}
+
+void ves_icall_System_Globalization_CompareInfo_construct_compareinfo (MonoCompareInfo *comp, MonoString *locale)
+{
+ UCollator *coll;
+ UErrorCode ec;
+ char *icu_locale;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Constructing collator for locale [%s]", mono_string_to_utf8 (locale));
+#endif
+
+ icu_locale=mono_string_to_icu_locale (locale);
+ if(icu_locale==NULL) {
+ /* Something went wrong */
+ mono_raise_exception((MonoException *)mono_exception_from_name(mono_get_corlib (), "System", "SystemException"));
+ return;
+ }
+
+ ec=U_ZERO_ERROR;
+ coll=ucol_open (icu_locale, &ec);
+ if(U_SUCCESS (ec)) {
+ comp->ICU_collator=coll;
+ } else {
+ comp->ICU_collator=NULL;
+ }
+
+ g_free (icu_locale);
+}
+
+/* Set up the collator to reflect the options required. Some of these
+ * options clash, as they adjust the collator strength level. Try to
+ * make later checks reduce the strength level, and attempt to take
+ * previous options into account.
+ *
+ * Don't bother to check the error returns when setting the
+ * attributes, as a failure here is hardly grounds to error out.
+ */
+static void set_collator_options (UCollator *coll, gint32 options)
+{
+ UErrorCode ec=U_ZERO_ERROR;
+
+ /* Set up the defaults */
+ ucol_setAttribute (coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE,
+ &ec);
+ ucol_setAttribute (coll, UCOL_CASE_LEVEL, UCOL_OFF, &ec);
+
+ /* Do this first so other options will override the quaternary
+ * level strength setting if necessary
+ */
+ if(!(options & CompareOptions_IgnoreKanaType)) {
+ ucol_setAttribute (coll, UCOL_HIRAGANA_QUATERNARY_MODE,
+ UCOL_ON, &ec);
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_QUATERNARY, &ec);
+ }
+
+ /* Word sort, the default */
+ if(!(options & CompareOptions_StringSort)) {
+ ucol_setAttribute (coll, UCOL_ALTERNATE_HANDLING,
+ UCOL_SHIFTED, &ec);
+ /* Tertiary strength is the default, but it might have
+ * been set to quaternary above. (We don't want that
+ * here, because that will order all the punctuation
+ * first instead of just ignoring it.)
+ *
+ * Unfortunately, tertiary strength with
+ * ALTERNATE_HANDLING==SHIFTED means that '/' and '@'
+ * compare to equal, which has the nasty side effect
+ * of killing mcs :-( (We can't specify a
+ * culture-insensitive compare, because
+ * String.StartsWith doesn't have that option.)
+ *
+ * ALTERNATE_HANDLING==SHIFTED is needed to accomplish
+ * the word-sorting-ignoring-punctuation feature. So
+ * we have to live with the slightly mis-ordered
+ * punctuation and a working mcs...
+ */
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_QUATERNARY, &ec);
+ }
+
+ if(options & CompareOptions_IgnoreCase) {
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_SECONDARY, &ec);
+ ucol_setAttribute (coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE, &ec);
+ }
+
+ if(options & CompareOptions_IgnoreWidth) {
+ /* Kana width is a tertiary strength difference. This
+ * will totally break the !IgnoreKanaType option
+ */
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_SECONDARY, &ec);
+ }
+
+ if(options & CompareOptions_IgnoreNonSpace) {
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_PRIMARY, &ec);
+ /* We can still compare case even when just checking
+ * primary strength
+ */
+ if(!(options & CompareOptions_IgnoreCase) ||
+ !(options & CompareOptions_IgnoreWidth)) {
+ /* Not sure if CASE_LEVEL handles kana width
+ */
+ ucol_setAttribute (coll, UCOL_CASE_LEVEL, UCOL_ON,
+ &ec);
+ }
+ }
+
+ if(options & CompareOptions_IgnoreSymbols) {
+ /* Don't know what to do here */
+ }
+
+ if(options == CompareOptions_Ordinal) {
+ /* This one is handled elsewhere */
+ }
+}
+
+gint32 ves_icall_System_Globalization_CompareInfo_internal_compare (MonoCompareInfo *this, MonoString *str1, gint32 off1, gint32 len1, MonoString *str2, gint32 off2, gint32 len2, gint32 options)
+{
+ UCollator *coll;
+ UCollationResult result;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Comparing [%s] and [%s]", mono_string_to_utf8 (str1), mono_string_to_utf8 (str2));
+#endif
+
+ coll=this->ICU_collator;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", this->lcid);
+#endif
+
+ if(coll==NULL || this->lcid==0x007F ||
+ options & CompareOptions_Ordinal) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": No collator or invariant, using shortcut");
+#endif
+
+ return(string_invariant_compare (str1, off1, len1, str2, off2,
+ len2, options));
+ }
+
+ if (!mono_monitor_enter ((MonoObject *)this))
+ return(-1);
+
+ set_collator_options (coll, options);
+
+ result=ucol_strcoll (coll, mono_string_chars (str1)+off1, len1,
+ mono_string_chars (str2)+off2, len2);
+
+ mono_monitor_exit ((MonoObject *)this);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Comparison of [%s] and [%s] returning %d", mono_string_to_utf8 (str1), mono_string_to_utf8 (str2), result);
+#endif
+
+ return(result);
+}
+
+void ves_icall_System_Globalization_CompareInfo_free_internal_collator (MonoCompareInfo *this)
+{
+ UCollator *coll;
+
+ MONO_ARCH_SAVE_REGS;
+
+ coll=this->ICU_collator;
+ if(coll!=NULL) {
+ this->ICU_collator = NULL;
+ ucol_close (coll);
+ }
+}
+
+void ves_icall_System_Globalization_CompareInfo_assign_sortkey (MonoCompareInfo *this, MonoSortKey *key, MonoString *source, gint32 options)
+{
+ UCollator *coll;
+ MonoArray *arr;
+ char *keybuf;
+ int32_t keylen, i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ coll=this->ICU_collator;
+ if(coll==NULL) {
+ mono_raise_exception((MonoException *)mono_exception_from_name(mono_get_corlib (), "System", "SystemException"));
+ return;
+ }
+
+ if (!mono_monitor_enter ((MonoObject *)this))
+ return;
+
+ set_collator_options (coll, options);
+
+ keylen=ucol_getSortKey (coll, mono_string_chars (source),
+ mono_string_length (source), NULL, 0);
+ keybuf=g_malloc (sizeof(char)* keylen);
+ ucol_getSortKey (coll, mono_string_chars (source),
+ mono_string_length (source), keybuf, keylen);
+
+ mono_monitor_exit ((MonoObject *)this);
+
+ arr=mono_array_new (mono_domain_get (), mono_get_byte_class (),
+ keylen);
+ for(i=0; i<keylen; i++) {
+ mono_array_set (arr, guint8, i, keybuf[i]);
+ }
+
+ key->key=arr;
+
+ g_free (keybuf);
+}
+
+int ves_icall_System_Globalization_CompareInfo_internal_index (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, MonoString *value, gint32 options, MonoBoolean first)
+{
+ UCollator *coll;
+ UChar *usrcstr;
+ UErrorCode ec;
+ UStringSearch *search;
+ int32_t pos= -1;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Finding %s [%s] in [%s] (sindex %d,count %d)", first?"first":"last", mono_string_to_utf8 (value), mono_string_to_utf8 (source), sindex, count);
+#endif
+
+ coll=this->ICU_collator;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", this->lcid);
+#endif
+
+ if(coll==NULL || this->lcid==0x007F ||
+ options & CompareOptions_Ordinal) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": No collator or invariant, using shortcut");
+#endif
+
+ return(string_invariant_indexof (source, sindex, count, value,
+ first));
+ }
+
+ usrcstr=g_malloc0 (sizeof(UChar)*(count+1));
+ if(first) {
+ memcpy (usrcstr, mono_string_chars (source)+sindex,
+ sizeof(UChar)*count);
+ } else {
+ memcpy (usrcstr, mono_string_chars (source)+sindex-count+1,
+ sizeof(UChar)*count);
+ }
+
+ if (!mono_monitor_enter ((MonoObject *)this))
+ return(-1);
+
+ ec=U_ZERO_ERROR;
+
+ /* Need to set the collator to a fairly weak level, so that it
+ * treats characters that can be written differently as
+ * identical (eg "ß" and "ss", "ć" and "ae" or "ä" etc.) Note
+ * that this means that the search string and the original
+ * text might have differing lengths.
+ */
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_PRIMARY, &ec);
+
+ /* Still notice case differences though (normally a tertiary
+ * difference)
+ */
+ ucol_setAttribute (coll, UCOL_CASE_LEVEL, UCOL_ON, &ec);
+
+ /* Don't ignore some codepoints */
+ ucol_setAttribute (coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE,
+ &ec);
+
+ search=usearch_openFromCollator (mono_string_chars (value),
+ mono_string_length (value),
+ usrcstr, count, coll, NULL, &ec);
+ if(U_SUCCESS (ec)) {
+ if(first) {
+ pos=usearch_first (search, &ec);
+ } else {
+ pos=usearch_last (search, &ec);
+ }
+
+ while (pos!=USEARCH_DONE) {
+ int32_t match_len;
+ UChar *match;
+ UCollationResult uret;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Got potential match at %d (sindex %d) len %d", pos, sindex, usearch_getMatchedLength (search));
+#endif
+
+ /* ICU usearch currently ignores most of the
+ * collator attributes :-(
+ *
+ * Check the returned match to see if it
+ * really does match properly...
+ */
+ match_len = usearch_getMatchedLength (search);
+ match=(UChar *)g_malloc0 (sizeof(UChar) * (match_len + 1));
+ usearch_getMatchedText (search, match, match_len, &ec);
+
+ uret = ucol_strcoll (coll, match, match_len,
+ mono_string_chars (value),
+ mono_string_length (value));
+ g_free (match);
+
+ if (uret == UCOL_EQUAL) {
+ /* OK, we really did get a match */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Got match at %d len %d", pos,
+ match_len);
+#endif
+
+ if(sindex>0) {
+ if(first) {
+ pos+=sindex;
+ } else {
+ pos+=(sindex-count+1);
+ }
+ }
+
+ break;
+ }
+
+ /* False alarm, keep looking */
+ if(first) {
+ pos=usearch_next (search, &ec);
+ } else {
+ pos=usearch_previous (search, &ec);
+ }
+ }
+ } else {
+ g_message (G_GNUC_PRETTY_FUNCTION ": usearch_open error: %s",
+ u_errorName (ec));
+ }
+
+ usearch_close (search);
+
+ mono_monitor_exit ((MonoObject *)this);
+
+ g_free (usrcstr);
+
+ return(pos);
+}
+
+int ves_icall_System_Globalization_CompareInfo_internal_index_char (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, gunichar2 value, gint32 options, MonoBoolean first)
+{
+ UCollator *coll;
+ UChar *usrcstr, uvalstr[2]={0, 0};
+ UErrorCode ec;
+ UStringSearch *search;
+ int32_t pos= -1;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Finding %s 0x%0x in [%s] (sindex %d,count %d)", first?"first":"last", value, mono_string_to_utf8 (source), sindex, count);
+#endif
+
+ coll=this->ICU_collator;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", this->lcid);
+#endif
+
+ if(coll==NULL || this->lcid==0x007F ||
+ options & CompareOptions_Ordinal) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": No collator or invariant, using shortcut");
+#endif
+
+ return(string_invariant_indexof_char (source, sindex, count,
+ value, first));
+ }
+
+ usrcstr=g_malloc0 (sizeof(UChar)*(count+1));
+ if(first) {
+ memcpy (usrcstr, mono_string_chars (source)+sindex,
+ sizeof(UChar)*count);
+ } else {
+ memcpy (usrcstr, mono_string_chars (source)+sindex-count+1,
+ sizeof(UChar)*count);
+ }
+ uvalstr[0]=value;
+
+ if (!mono_monitor_enter ((MonoObject *)this))
+ return(-1);
+
+ ec=U_ZERO_ERROR;
+
+ /* Need to set the collator to a fairly weak level, so that it
+ * treats characters that can be written differently as
+ * identical (eg "ß" and "ss", "ć" and "ae" or "ä" etc.) Note
+ * that this means that the search string and the original
+ * text might have differing lengths.
+ */
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_PRIMARY, &ec);
+
+ /* Still notice case differences though (normally a tertiary
+ * difference)
+ */
+ ucol_setAttribute (coll, UCOL_CASE_LEVEL, UCOL_ON, &ec);
+
+ /* Don't ignore some codepoints */
+ ucol_setAttribute (coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE,
+ &ec);
+
+ search=usearch_openFromCollator (uvalstr, 1, usrcstr, count, coll,
+ NULL, &ec);
+ if(U_SUCCESS (ec)) {
+ if(first) {
+ pos=usearch_first (search, &ec);
+ } else {
+ pos=usearch_last (search, &ec);
+ }
+
+ while (pos!=USEARCH_DONE) {
+ int32_t match_len;
+ UChar *match;
+ UCollationResult uret;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Got potential match at %d (sindex %d) len %d", pos, sindex, usearch_getMatchedLength (search));
+#endif
+
+ /* ICU usearch currently ignores most of the
+ * collator attributes :-(
+ *
+ * Check the returned match to see if it
+ * really does match properly...
+ */
+ match_len = usearch_getMatchedLength (search);
+ match=(UChar *)g_malloc0 (sizeof(UChar) * (match_len + 1));
+ usearch_getMatchedText (search, match, match_len, &ec);
+
+ uret = ucol_strcoll (coll, match, match_len, uvalstr,
+ 1);
+ g_free (match);
+
+ if (uret == UCOL_EQUAL) {
+ /* OK, we really did get a match */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Got match at %d len %d", pos,
+ match_len);
+#endif
+
+ if(sindex>0) {
+ if(first) {
+ pos+=sindex;
+ } else {
+ pos+=(sindex-count+1);
+ }
+ }
+
+ break;
+ }
+
+ /* False alarm, keep looking */
+ if(first) {
+ pos=usearch_next (search, &ec);
+ } else {
+ pos=usearch_previous (search, &ec);
+ }
+ }
+ } else {
+ g_message (G_GNUC_PRETTY_FUNCTION ": usearch_open error: %s",
+ u_errorName (ec));
+ }
+
+ usearch_close (search);
+
+ mono_monitor_exit ((MonoObject *)this);
+
+ g_free (usrcstr);
+
+ return(pos);
+}
+
+int ves_icall_System_Threading_Thread_current_lcid (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return(uloc_getLCID (uloc_getDefault ()));
+}
+
+MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this, MonoString *old, MonoString *new, MonoCompareInfo *comp)
+{
+ MonoString *ret=NULL;
+ UCollator *coll;
+ UErrorCode ec;
+ UStringSearch *search;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Replacing [%s] with [%s] in [%s]", mono_string_to_utf8 (old), mono_string_to_utf8 (new), mono_string_to_utf8 (this));
+#endif
+
+ coll=comp->ICU_collator;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", comp->lcid);
+#endif
+
+ if(coll==NULL || comp->lcid==0x007F) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": No collator or invariant, using shortcut");
+#endif
+
+ return(string_invariant_replace (this, old, new));
+ }
+
+ if (!mono_monitor_enter ((MonoObject *)comp))
+ return(NULL);
+
+ ec=U_ZERO_ERROR;
+
+ /* Need to set the collator to a fairly weak level, so that it
+ * treats characters that can be written differently as
+ * identical (eg "ß" and "ss", "ć" and "ae" or "ä" etc.) Note
+ * that this means that the search string and the original
+ * text might have differing lengths.
+ */
+ ucol_setAttribute (coll, UCOL_STRENGTH, UCOL_PRIMARY, &ec);
+
+ /* Still notice case differences though (normally a tertiary
+ * difference)
+ */
+ ucol_setAttribute (coll, UCOL_CASE_LEVEL, UCOL_ON, &ec);
+
+ /* Don't ignore some codepoints */
+ ucol_setAttribute (coll, UCOL_ALTERNATE_HANDLING, UCOL_NON_IGNORABLE,
+ &ec);
+
+ search=usearch_openFromCollator (mono_string_chars (old),
+ mono_string_length (old),
+ mono_string_chars (this),
+ mono_string_length (this),
+ coll, NULL, &ec);
+ if(U_SUCCESS (ec)) {
+ int pos, oldpos, len_delta=0;
+ int32_t newstr_len=mono_string_length (new), match_len;
+ UChar *uret, *match;
+
+ for(pos=usearch_first (search, &ec);
+ pos!=USEARCH_DONE;
+ pos=usearch_next (search, &ec)) {
+ /* ICU usearch currently ignores most of the collator
+ * attributes :-(
+ *
+ * Check the returned match to see if it really
+ * does match properly...
+ */
+ match_len = usearch_getMatchedLength (search);
+
+ if(match_len == 0) {
+ continue;
+ }
+
+ match=(UChar *)g_malloc0 (sizeof(UChar) * (match_len + 1));
+ usearch_getMatchedText (search, match, match_len, &ec);
+
+ if (ucol_strcoll (coll, match, match_len,
+ mono_string_chars (old),
+ mono_string_length (old)) == UCOL_EQUAL) {
+ /* OK, we really did get a match */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Got match at %d len %d", pos,
+ match_len);
+#endif
+
+ len_delta += (newstr_len - match_len);
+ } else {
+ /* False alarm */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Got false match at %d len %d",
+ pos, match_len);
+#endif
+ }
+ g_free (match);
+ }
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": New string length is %d (delta %d)",
+ mono_string_length (this)+len_delta, len_delta);
+#endif
+
+ uret=(UChar *)g_malloc0 (sizeof(UChar) * (mono_string_length (this)+len_delta+2));
+
+ for(oldpos=0, pos=usearch_first (search, &ec);
+ pos!=USEARCH_DONE;
+ pos=usearch_next (search, &ec)) {
+ match_len = usearch_getMatchedLength (search);
+
+ if (match_len == 0) {
+ continue;
+ }
+
+ match=(UChar *)g_malloc0 (sizeof(UChar) * (match_len + 1));
+ usearch_getMatchedText (search, match, match_len, &ec);
+
+ /* Add the unmatched text */
+ u_strncat (uret, mono_string_chars (this)+oldpos,
+ pos-oldpos);
+ if (ucol_strcoll (coll, match, match_len,
+ mono_string_chars (old),
+ mono_string_length (old)) == UCOL_EQUAL) {
+ /* Then the replacement */
+ u_strcat (uret, mono_string_chars (new));
+ } else {
+ /* Then the original, because this is a
+ * false match
+ */
+ u_strncat (uret, mono_string_chars (this)+pos,
+ match_len);
+ }
+ oldpos=pos+match_len;
+ g_free (match);
+ }
+
+ /* Finish off with the trailing unmatched text */
+ u_strcat (uret, mono_string_chars (this)+oldpos);
+
+ ret=mono_string_from_utf16 ((gunichar2 *)uret);
+ } else {
+ g_message (G_GNUC_PRETTY_FUNCTION ": usearch_open error: %s",
+ u_errorName (ec));
+ }
+
+ usearch_close (search);
+
+ mono_monitor_exit ((MonoObject *)comp);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Replacing [%s] with [%s] in [%s] returns [%s]", mono_string_to_utf8 (old), mono_string_to_utf8 (new), mono_string_to_utf8 (this), mono_string_to_utf8 (ret));
+#endif
+
+ return(ret);
+}
+
+MonoString *ves_icall_System_String_InternalToLower_Comp (MonoString *this, MonoCultureInfo *cult)
+{
+ MonoString *ret;
+ UChar *udest;
+ UErrorCode ec;
+ char *icu_loc;
+ int32_t len;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": [%s]",
+ mono_string_to_utf8 (this));
+#endif
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult->lcid);
+#endif
+
+ icu_loc=mono_string_to_icu_locale (cult->icu_name);
+ if(icu_loc==NULL) {
+ mono_raise_exception ((MonoException *)mono_exception_from_name (mono_get_corlib (), "System", "SystemException"));
+ return(NULL);
+ }
+
+ udest=(UChar *)g_malloc0 (sizeof(UChar)*(mono_string_length (this)+1));
+
+ /* According to the docs, this might result in a longer or
+ * shorter string than we started with...
+ */
+
+ ec=U_ZERO_ERROR;
+ len=u_strToLower (udest, mono_string_length (this)+1,
+ mono_string_chars (this), mono_string_length (this),
+ icu_loc, &ec);
+ if(ec==U_BUFFER_OVERFLOW_ERROR ||
+ ec==U_STRING_NOT_TERMINATED_WARNING) {
+ g_free (udest);
+ udest=(UChar *)g_malloc0 (sizeof(UChar)*(len+1));
+ len=u_strToLower (udest, len+1, mono_string_chars (this),
+ mono_string_length (this), icu_loc, &ec);
+ }
+
+ if(U_SUCCESS (ec)) {
+ ret=mono_string_from_utf16 ((gunichar2 *)udest);
+ } else {
+ g_message (G_GNUC_PRETTY_FUNCTION ": u_strToLower error: %s",
+ u_errorName (ec));
+ /* return something */
+ ret=this;
+ }
+
+ g_free (icu_loc);
+ g_free (udest);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": returning [%s]",
+ mono_string_to_utf8 (ret));
+#endif
+
+ return(ret);
+}
+
+MonoString *ves_icall_System_String_InternalToUpper_Comp (MonoString *this, MonoCultureInfo *cult)
+{
+ MonoString *ret;
+ UChar *udest;
+ UErrorCode ec;
+ char *icu_loc;
+ int32_t len;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": [%s]",
+ mono_string_to_utf8 (this));
+#endif
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult->lcid);
+#endif
+
+ icu_loc=mono_string_to_icu_locale (cult->icu_name);
+ if(icu_loc==NULL) {
+ mono_raise_exception ((MonoException *)mono_exception_from_name (mono_get_corlib (), "System", "SystemException"));
+ return(NULL);
+ }
+
+ udest=(UChar *)g_malloc0 (sizeof(UChar)*(mono_string_length (this)+1));
+
+ /* According to the docs, this might result in a longer or
+ * shorter string than we started with...
+ */
+
+ ec=U_ZERO_ERROR;
+ len=u_strToUpper (udest, mono_string_length (this)+1,
+ mono_string_chars (this), mono_string_length (this),
+ icu_loc, &ec);
+ if(ec==U_BUFFER_OVERFLOW_ERROR ||
+ ec==U_STRING_NOT_TERMINATED_WARNING) {
+ g_free (udest);
+ udest=(UChar *)g_malloc0 (sizeof(UChar)*(len+1));
+ len=u_strToUpper (udest, len+1, mono_string_chars (this),
+ mono_string_length (this), icu_loc, &ec);
+ }
+
+ if(U_SUCCESS (ec)) {
+ ret=mono_string_from_utf16 ((gunichar2 *)udest);
+ } else {
+ g_message (G_GNUC_PRETTY_FUNCTION ": u_strToUpper error: %s",
+ u_errorName (ec));
+ /* return something */
+ ret=this;
+ }
+
+ g_free (icu_loc);
+ g_free (udest);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": returning [%s]",
+ mono_string_to_utf8 (ret));
+#endif
+
+ return(ret);
+}
+
+gunichar2 ves_icall_System_Char_InternalToUpper_Comp (gunichar2 c, MonoCultureInfo *cult)
+{
+ UChar udest;
+ UErrorCode ec;
+ char *icu_loc;
+ int32_t len;
+
+ MONO_ARCH_SAVE_REGS;
+
+ icu_loc=mono_string_to_icu_locale (cult->icu_name);
+ if(icu_loc==NULL) {
+ mono_raise_exception ((MonoException *)mono_exception_from_name (mono_get_corlib (), "System", "SystemException"));
+ return(0);
+ }
+
+ ec=U_ZERO_ERROR;
+ len=u_strToUpper (&udest, 1, &c, 1, icu_loc, &ec);
+ g_free (icu_loc);
+
+ if(U_SUCCESS (ec) && len==1) {
+ return udest;
+ } else {
+ /* return something */
+ return c;
+ }
+}
+
+
+gunichar2 ves_icall_System_Char_InternalToLower_Comp (gunichar2 c, MonoCultureInfo *cult)
+{
+ UChar udest;
+ UErrorCode ec;
+ char *icu_loc;
+ int32_t len;
+
+ MONO_ARCH_SAVE_REGS;
+
+ icu_loc=mono_string_to_icu_locale (cult->icu_name);
+ if(icu_loc==NULL) {
+ mono_raise_exception ((MonoException *)mono_exception_from_name (mono_get_corlib (), "System", "SystemException"));
+ return(0);
+ }
+
+ ec=U_ZERO_ERROR;
+ len=u_strToLower (&udest, 1, &c, 1, icu_loc, &ec);
+ g_free (icu_loc);
+
+ if(U_SUCCESS (ec) && len==1) {
+ return udest;
+ } else {
+ /* return something */
+ return c;
+ }
+}
+
+#else /* HAVE_ICU */
+static MonoString *string_invariant_tolower (MonoString *this);
+static MonoString *string_invariant_toupper (MonoString *this);
+
+void ves_icall_System_Globalization_CultureInfo_construct_internal_locale (MonoCultureInfo *this, MonoString *locale)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* Always claim "unknown locale" if we don't have ICU (only
+ * called for non-invariant locales)
+ */
+ mono_raise_exception((MonoException *)mono_exception_from_name(mono_get_corlib (), "System", "ArgumentException"));
+}
+
+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)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* Do a normal ascii string compare, as we only know the
+ * invariant locale if we dont have ICU
+ */
+ return(string_invariant_compare (str1, off1, len1, str2, off2, len2,
+ 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;
+ gint32 keylen, i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ keylen=mono_string_length (source);
+
+ arr=mono_array_new (mono_domain_get (), mono_get_byte_class (),
+ keylen);
+ for(i=0; i<keylen; i++) {
+ mono_array_set (arr, guint8, i, mono_string_chars (source)[i]);
+ }
+
+ key->key=arr;
+}
+
+int ves_icall_System_Globalization_CompareInfo_internal_index (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, MonoString *value, gint32 options, MonoBoolean first)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return(string_invariant_indexof (source, sindex, count, value, first));
+}
+
+int ves_icall_System_Globalization_CompareInfo_internal_index_char (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, gunichar2 value, gint32 options, MonoBoolean first)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return(string_invariant_indexof_char (source, sindex, count, value,
+ first));
+}
+
+int ves_icall_System_Threading_Thread_current_lcid (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* Invariant */
+ return(0x007F);
+}
+
+MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this, MonoString *old, MonoString *new, MonoCompareInfo *comp)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* Do a normal ascii string compare and replace, as we only
+ * know the invariant locale if we dont have ICU
+ */
+ return(string_invariant_replace (this, old, new));
+}
+
+MonoString *ves_icall_System_String_InternalToLower_Comp (MonoString *this, MonoCultureInfo *cult)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return(string_invariant_tolower (this));
+}
+
+MonoString *ves_icall_System_String_InternalToUpper_Comp (MonoString *this, MonoCultureInfo *cult)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return(string_invariant_toupper (this));
+}
+
+gunichar2 ves_icall_System_Char_InternalToUpper_Comp (gunichar2 c, MonoCultureInfo *cult)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return g_unichar_toupper (c);
+}
+
+
+gunichar2 ves_icall_System_Char_InternalToLower_Comp (gunichar2 c, MonoCultureInfo *cult)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return g_unichar_tolower (c);
+}
+
+static MonoString *string_invariant_tolower (MonoString *this)
+{
+ MonoString *ret;
+ gunichar2 *src;
+ gunichar2 *dest;
+ gint32 i;
+
+ ret = mono_string_new_size(mono_domain_get (),
+ mono_string_length(this));
+
+ src = mono_string_chars (this);
+ dest = mono_string_chars (ret);
+
+ for (i = 0; i < mono_string_length (this); ++i) {
+ dest[i] = g_unichar_tolower(src[i]);
+ }
+
+ return(ret);
+}
+
+static MonoString *string_invariant_toupper (MonoString *this)
+{
+ MonoString *ret;
+ gunichar2 *src;
+ gunichar2 *dest;
+ guint32 i;
+
+ ret = mono_string_new_size(mono_domain_get (),
+ mono_string_length(this));
+
+ src = mono_string_chars (this);
+ dest = mono_string_chars (ret);
+
+ for (i = 0; i < mono_string_length (this); ++i) {
+ dest[i] = g_unichar_toupper(src[i]);
+ }
+
+ return(ret);
+}
+
+#endif /* HAVE_ICU */
+
+static gint32 string_invariant_compare_char (gunichar2 c1, gunichar2 c2,
+ gint32 options)
+{
+ gint32 result;
+ GUnicodeType c1type, c2type;
+
+ c1type = g_unichar_type (c1);
+ c2type = g_unichar_type (c2);
+
+ if (options & CompareOptions_IgnoreCase) {
+ result = (gint32) (c1type != G_UNICODE_LOWERCASE_LETTER ? g_unichar_tolower(c1) : c1) - (c2type != G_UNICODE_LOWERCASE_LETTER ? g_unichar_tolower(c2) : c2);
+ } else if (options & CompareOptions_Ordinal) {
+ /* Rotor/ms return the full value just not -1 and 1 */
+ return (gint32) c1 - c2;
+ } else {
+ /* No options. Kana, symbol and spacing options don't
+ * apply to the invariant culture.
+ */
+
+ result = (gint32) c1 - c2;
+ }
+
+ return ((result < 0) ? -1 : (result > 0) ? 1 : 0);
+}
+
+static gint32 string_invariant_compare (MonoString *str1, gint32 off1,
+ gint32 len1, MonoString *str2,
+ gint32 off2, gint32 len2,
+ gint32 options)
+{
+ /* c translation of C# code from old string.cs.. :) */
+ gint32 length;
+ gint32 charcmp;
+ gunichar2 *ustr1;
+ gunichar2 *ustr2;
+ gint32 pos;
+
+ if(len1 >= len2) {
+ length=len1;
+ } else {
+ length=len2;
+ }
+
+ ustr1 = mono_string_chars(str1)+off1;
+ ustr2 = mono_string_chars(str2)+off2;
+
+ pos = 0;
+
+ for (pos = 0; pos != length; pos++) {
+ if (pos >= len1 || pos >= len2)
+ break;
+
+ charcmp = string_invariant_compare_char(ustr1[pos], ustr2[pos],
+ options);
+ if (charcmp != 0) {
+ return(charcmp);
+ }
+ }
+
+ /* the lesser wins, so if we have looped until length we just
+ * need to check the last char
+ */
+ if (pos == length) {
+ return(string_invariant_compare_char(ustr1[pos - 1],
+ ustr2[pos - 1], options));
+ }
+
+ /* Test if one of the strings has been compared to the end */
+ if (pos >= len1) {
+ if (pos >= len2) {
+ return(0);
+ } else {
+ return(-1);
+ }
+ } else if (pos >= len2) {
+ return(1);
+ }
+
+ /* if not, check our last char only.. (can this happen?) */
+ return(string_invariant_compare_char(ustr1[pos], ustr2[pos], options));
+}
+
+static MonoString *string_invariant_replace (MonoString *me,
+ MonoString *oldValue,
+ MonoString *newValue)
+{
+ MonoString *ret;
+ gunichar2 *src;
+ gunichar2 *dest=NULL; /* shut gcc up */
+ gunichar2 *oldstr;
+ gunichar2 *newstr=NULL; /* shut gcc up here too */
+ gint32 i, destpos;
+ gint32 occurr;
+ gint32 newsize;
+ gint32 oldstrlen;
+ gint32 newstrlen;
+ gint32 srclen;
+
+ occurr = 0;
+ destpos = 0;
+
+ oldstr = mono_string_chars(oldValue);
+ oldstrlen = mono_string_length(oldValue);
+
+ if (NULL != newValue) {
+ newstr = mono_string_chars(newValue);
+ newstrlen = mono_string_length(newValue);
+ } else
+ newstrlen = 0;
+
+ src = mono_string_chars(me);
+ srclen = mono_string_length(me);
+
+ if (oldstrlen != newstrlen) {
+ i = 0;
+ while (i <= srclen - oldstrlen) {
+ if (0 == memcmp(src + i, oldstr, oldstrlen * sizeof(gunichar2))) {
+ occurr++;
+ i += oldstrlen;
+ }
+ else
+ i ++;
+ }
+ if (occurr == 0)
+ return me;
+ newsize = srclen + ((newstrlen - oldstrlen) * occurr);
+ } else
+ newsize = srclen;
+
+ ret = NULL;
+ i = 0;
+ while (i < srclen) {
+ if (0 == memcmp(src + i, oldstr, oldstrlen * sizeof(gunichar2))) {
+ if (ret == NULL) {
+ ret = mono_string_new_size( mono_domain_get (), newsize);
+ dest = mono_string_chars(ret);
+ memcpy (dest, src, i * sizeof(gunichar2));
+ }
+ if (newstrlen > 0) {
+ memcpy(dest + destpos, newstr, newstrlen * sizeof(gunichar2));
+ destpos += newstrlen;
+ }
+ i += oldstrlen;
+ continue;
+ } else if (ret != NULL) {
+ dest[destpos] = src[i];
+ }
+ destpos++;
+ i++;
+ }
+
+ if (ret == NULL)
+ return me;
+
+ return ret;
+}
+
+static gint32 string_invariant_indexof (MonoString *source, gint32 sindex,
+ gint32 count, MonoString *value,
+ MonoBoolean first)
+{
+ gint32 lencmpstr;
+ gunichar2 *src;
+ gunichar2 *cmpstr;
+ gint32 pos,i;
+
+ lencmpstr = mono_string_length(value);
+
+ src = mono_string_chars(source);
+ cmpstr = mono_string_chars(value);
+
+ if(first) {
+ count -= lencmpstr;
+ for(pos=sindex;pos <= sindex+count;pos++) {
+ for(i=0;src[pos+i]==cmpstr[i];) {
+ if(++i==lencmpstr) {
+ return(pos);
+ }
+ }
+ }
+
+ return(-1);
+ } else {
+ for(pos=sindex-lencmpstr+1;pos>sindex-count;pos--) {
+ if(memcmp (src+pos, cmpstr,
+ lencmpstr*sizeof(gunichar2))==0) {
+ return(pos);
+ }
+ }
+
+ return(-1);
+ }
+}
+
+static gint32 string_invariant_indexof_char (MonoString *source, gint32 sindex,
+ gint32 count, gunichar2 value,
+ MonoBoolean first)
+{
+ gint32 pos;
+ gunichar2 *src;
+
+ src = mono_string_chars(source);
+ if(first) {
+ for (pos = sindex; pos != count + sindex; pos++) {
+ if (src [pos] == value) {
+ return(pos);
+ }
+ }
+
+ return(-1);
+ } else {
+ for (pos = sindex; pos > sindex - count; pos--) {
+ if (src [pos] == value)
+ return(pos);
+ }
+
+ return(-1);
+ }
+}
+
diff --git a/mono/metadata/locales.h b/mono/metadata/locales.h
new file mode 100644
index 00000000000..452dff2f4f9
--- /dev/null
+++ b/mono/metadata/locales.h
@@ -0,0 +1,51 @@
+/*
+ * locales.h: Culture-sensitive handling
+ *
+ * Authors:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+#ifndef _MONO_METADATA_LOCALES_H_
+#define _MONO_METADATA_LOCALES_H_
+
+#include <glib.h>
+
+#include <mono/metadata/object-internals.h>
+
+/* This is a copy of System.Globalization.CompareOptions */
+typedef enum {
+ CompareOptions_None=0x00,
+ CompareOptions_IgnoreCase=0x01,
+ CompareOptions_IgnoreNonSpace=0x02,
+ CompareOptions_IgnoreSymbols=0x04,
+ CompareOptions_IgnoreKanaType=0x08,
+ CompareOptions_IgnoreWidth=0x10,
+ CompareOptions_StringSort=0x20000000,
+ CompareOptions_Ordinal=0x40000000
+} MonoCompareOptions;
+
+extern void ves_icall_System_Globalization_CultureInfo_construct_internal_locale (MonoCultureInfo *this, MonoString *locale);
+extern MonoBoolean ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_current_locale (MonoCultureInfo *ci);
+extern MonoBoolean ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_lcid (MonoCultureInfo *this, gint lcid);
+extern MonoBoolean ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_name (MonoCultureInfo *this, MonoString *name);
+extern MonoBoolean ves_icall_System_Globalization_CultureInfo_construct_internal_locale_from_specific_name (MonoCultureInfo *ci, MonoString *name);
+extern MonoArray *ves_icall_System_Globalization_CultureInfo_internal_get_cultures (MonoBoolean neutral, MonoBoolean specific, MonoBoolean installed);
+extern MonoBoolean ves_icall_System_Globalization_CultureInfo_internal_is_lcid_neutral (gint lcid, MonoBoolean *is_neutral);
+extern void ves_icall_System_Globalization_CultureInfo_construct_datetime_format (MonoCultureInfo *this);
+extern void ves_icall_System_Globalization_CultureInfo_construct_number_format (MonoCultureInfo *this);
+extern void ves_icall_System_Globalization_CompareInfo_construct_compareinfo (MonoCompareInfo *comp, MonoString *locale);
+extern int ves_icall_System_Globalization_CompareInfo_internal_compare (MonoCompareInfo *this, 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);
+extern void ves_icall_System_Globalization_CompareInfo_assign_sortkey (MonoCompareInfo *this, MonoSortKey *key, MonoString *source, gint32 options);
+extern int ves_icall_System_Globalization_CompareInfo_internal_index (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, MonoString *value, gint32 options, MonoBoolean first);
+extern int ves_icall_System_Globalization_CompareInfo_internal_index_char (MonoCompareInfo *this, MonoString *source, gint32 sindex, gint32 count, gunichar2 value, gint32 options, MonoBoolean first);
+extern int ves_icall_System_Threading_Thread_current_lcid (void);
+extern MonoString *ves_icall_System_String_InternalReplace_Str_Comp (MonoString *this, MonoString *old, MonoString *new, MonoCompareInfo *comp);
+extern MonoString *ves_icall_System_String_InternalToLower_Comp (MonoString *this, MonoCultureInfo *cult);
+extern MonoString *ves_icall_System_String_InternalToUpper_Comp (MonoString *this, MonoCultureInfo *cult);
+extern gunichar2 ves_icall_System_Char_InternalToUpper_Comp (gunichar2 c, MonoCultureInfo *cult);
+extern gunichar2 ves_icall_System_Char_InternalToLower_Comp (gunichar2 c, MonoCultureInfo *cult);
+
+#endif /* _MONO_METADATA_FILEIO_H_ */
diff --git a/mono/metadata/make-bundle.pl b/mono/metadata/make-bundle.pl
new file mode 100755
index 00000000000..fff9a87b9c7
--- /dev/null
+++ b/mono/metadata/make-bundle.pl
@@ -0,0 +1,104 @@
+#!/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);
+
diff --git a/mono/metadata/marshal.c b/mono/metadata/marshal.c
index 0a30c7d1a81..b4b1e78b9f9 100644
--- a/mono/metadata/marshal.c
+++ b/mono/metadata/marshal.c
@@ -13,46 +13,6366 @@
#include "loader.h"
#include "metadata/marshal.h"
#include "metadata/tabledefs.h"
+#include "metadata/exception.h"
+#include "metadata/appdomain.h"
+#include "mono/metadata/debug-helpers.h"
+#include "mono/metadata/threadpool.h"
+#include "mono/metadata/threads.h"
+#include "mono/metadata/monitor.h"
+#include "mono/metadata/metadata-internals.h"
+#include "mono/metadata/domain-internals.h"
+#include "mono/metadata/gc-internal.h"
+#include "mono/metadata/threads-types.h"
+#include <mono/os/gc_wrapper.h>
+#include <string.h>
+#include <errno.h>
+
+/* #define DEBUG_RUNTIME_CODE */
+
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
+ a = i,
+
+enum {
+#include "mono/cil/opcode.def"
+ LAST = 0xff
+};
+#undef OPDEF
+
+struct _MonoMethodBuilder {
+ MonoMethod *method;
+ GList *locals_list;
+ int locals;
+ guint32 code_size, pos;
+ unsigned char *code;
+};
+
+static void
+delegate_hash_table_add (MonoDelegate *d);
+
+static void
+emit_struct_conv (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_object);
+
+#ifdef DEBUG_RUNTIME_CODE
+static char*
+indenter (MonoDisHelper *dh, MonoMethod *method, guint32 ip_offset)
+{
+ return g_strdup (" ");
+}
+
+static MonoDisHelper marshal_dh = {
+ "\n",
+ "IL_%04x: ",
+ "IL_%04x",
+ indenter,
+ NULL,
+ NULL
+};
+#endif
+
+/* This mutex protects the various marshalling related caches in MonoImage */
+static CRITICAL_SECTION marshal_mutex;
+
+/* Maps wrapper methods to the methods they wrap */
+static MonoGHashTable *wrapper_hash;
+
+static guint32 last_error_tls_id;
+
+static void mono_struct_delete_old (MonoClass *klass, char *ptr);
+void * mono_marshal_string_to_utf16 (MonoString *s);
+
+static gpointer mono_string_to_lpstr (MonoString *string_obj);
+
+static void
+register_icall (gpointer func, const char *name, const char *sigstr, gboolean save)
+{
+ MonoMethodSignature *sig = mono_create_icall_signature (sigstr);
+
+ mono_register_jit_icall (func, name, sig, save);
+}
+
+static MonoMethodSignature*
+signature_no_pinvoke (MonoMethodSignature* sig)
+{
+ if (sig->pinvoke) {
+ sig = mono_metadata_signature_dup (sig);
+ sig->pinvoke = FALSE;
+ }
+
+ return sig;
+}
+
+void
+mono_marshal_init (void)
+{
+ static gboolean module_initialized = FALSE;
+
+ if (!module_initialized) {
+ module_initialized = TRUE;
+ InitializeCriticalSection (&marshal_mutex);
+ MONO_GC_REGISTER_ROOT (wrapper_hash);
+ wrapper_hash = mono_g_hash_table_new (NULL, NULL);
+ last_error_tls_id = TlsAlloc ();
+
+ register_icall (mono_marshal_string_to_utf16, "mono_marshal_string_to_utf16", "ptr obj", FALSE);
+ register_icall (mono_string_to_utf16, "mono_string_to_utf16", "ptr obj", FALSE);
+ register_icall (mono_string_from_utf16, "mono_string_from_utf16", "obj ptr", FALSE);
+ register_icall (mono_string_new_wrapper, "mono_string_new_wrapper", "obj ptr", FALSE);
+ register_icall (mono_string_to_utf8, "mono_string_to_utf8", "ptr obj", FALSE);
+ register_icall (mono_string_to_lpstr, "mono_string_to_lpstr", "ptr obj", FALSE);
+ register_icall (mono_string_to_bstr, "mono_string_to_bstr", "ptr obj", FALSE);
+ register_icall (mono_string_to_ansibstr, "mono_string_to_ansibstr", "ptr object", FALSE);
+ register_icall (mono_string_builder_to_utf8, "mono_string_builder_to_utf8", "ptr object", FALSE);
+ register_icall (mono_string_builder_to_utf16, "mono_string_builder_to_utf16", "ptr object", FALSE);
+ register_icall (mono_array_to_savearray, "mono_array_to_savearray", "ptr object", FALSE);
+ register_icall (mono_array_to_lparray, "mono_array_to_lparray", "ptr object", FALSE);
+ register_icall (mono_delegate_to_ftnptr, "mono_delegate_to_ftnptr", "ptr object", FALSE);
+ register_icall (mono_ftnptr_to_delegate, "mono_ftnptr_to_delegate", "object ptr ptr", FALSE);
+ register_icall (mono_marshal_asany, "mono_marshal_asany", "ptr object int32", FALSE);
+ register_icall (mono_marshal_free_asany, "mono_marshal_free_asany", "void object ptr int32", FALSE);
+ register_icall (mono_marshal_alloc, "mono_marshal_alloc", "ptr int32", FALSE);
+ register_icall (mono_marshal_free, "mono_marshal_free", "void ptr", FALSE);
+ register_icall (mono_string_utf8_to_builder, "mono_string_utf8_to_builder", "void ptr ptr", FALSE);
+ register_icall (mono_string_utf16_to_builder, "mono_string_utf16_to_builder", "void ptr ptr", FALSE);
+ register_icall (mono_marshal_free_array, "mono_marshal_free_array", "void ptr int32", FALSE);
+ register_icall (mono_string_to_byvalstr, "mono_string_to_byvalstr", "void ptr ptr int32", FALSE);
+ register_icall (mono_string_to_byvalwstr, "mono_string_to_byvalwstr", "void ptr ptr int32", FALSE);
+ register_icall (g_free, "g_free", "void ptr", FALSE);
+ register_icall (mono_object_isinst, "mono_object_isinst", "object object ptr", FALSE);
+ register_icall (mono_struct_delete_old, "mono_struct_delete_old", "void ptr ptr", FALSE);
+ }
+}
+
+gpointer
+mono_delegate_to_ftnptr (MonoDelegate *delegate)
+{
+ MonoMethod *method, *wrapper, *invoke;
+ MonoMarshalSpec **mspecs;
+ MonoClass *klass;
+ int i;
+
+ if (!delegate)
+ return NULL;
+
+ if (delegate->delegate_trampoline)
+ return delegate->delegate_trampoline;
+
+ klass = ((MonoObject *)delegate)->vtable->klass;
+ g_assert (klass->delegate);
+
+ method = delegate->method_info->method;
+ invoke = mono_find_method_by_name (klass, "Invoke", method->signature->param_count);
+
+ mspecs = g_new (MonoMarshalSpec*, invoke->signature->param_count + 1);
+ mono_method_get_marshal_info (invoke, mspecs);
+
+ wrapper = mono_marshal_get_managed_wrapper (method, delegate->target, mspecs);
+
+ for (i = invoke->signature->param_count; i >= 0; i--)
+ if (mspecs [i])
+ mono_metadata_free_marshal_spec (mspecs [i]);
+ g_free (mspecs);
+
+ delegate->delegate_trampoline = mono_compile_method (wrapper);
+
+ // Add the delegate to the delegate hash table
+ delegate_hash_table_add (delegate);
+
+ return delegate->delegate_trampoline;
+}
+
+static GHashTable *delegate_hash_table;
+
+static GHashTable *
+delegate_hash_table_new (void) {
+ return g_hash_table_new (NULL, NULL);
+}
+
+static void
+delegate_hash_table_remove (MonoDelegate *d)
+{
+ EnterCriticalSection (&marshal_mutex);
+ if (delegate_hash_table == NULL)
+ delegate_hash_table = delegate_hash_table_new ();
+ g_hash_table_remove (delegate_hash_table, d->delegate_trampoline);
+ LeaveCriticalSection (&marshal_mutex);
+}
+
+void
+delegate_hash_table_add (MonoDelegate *d)
+{
+ EnterCriticalSection (&marshal_mutex);
+ if (delegate_hash_table == NULL)
+ delegate_hash_table = delegate_hash_table_new ();
+ g_hash_table_insert (delegate_hash_table, d->delegate_trampoline, d);
+ LeaveCriticalSection (&marshal_mutex);
+}
+
+MonoDelegate*
+mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
+{
+ MonoDelegate *d;
+
+ EnterCriticalSection (&marshal_mutex);
+ if (delegate_hash_table == NULL)
+ delegate_hash_table = delegate_hash_table_new ();
+
+ d = g_hash_table_lookup (delegate_hash_table, ftn);
+ LeaveCriticalSection (&marshal_mutex);
+ if (d == NULL)
+ mono_raise_exception (mono_get_exception_argument (NULL, "Additional information: Function pointer was not created by a delegate."));
+ return d;
+}
+
+void
+mono_delegate_free_ftnptr (MonoDelegate *delegate)
+{
+ MonoJitInfo *ji;
+ void *ptr, *ptr2;
+
+ delegate_hash_table_remove (delegate);
+ ptr2 = delegate->delegate_trampoline;
+
+ ptr = InterlockedExchangePointer (&delegate->delegate_trampoline, NULL);
+ ji = mono_jit_info_table_find (mono_domain_get (), ptr);
+ g_assert (ji);
+
+ if (!delegate->target) {
+ /* The wrapper method is shared between delegates -> no need to free it */
+ return;
+ }
+
+ mono_runtime_free_method (ji->method);
+}
+
+gpointer
+mono_array_to_savearray (MonoArray *array)
+{
+ if (!array)
+ return NULL;
+
+ g_assert_not_reached ();
+ return NULL;
+}
+
+gpointer
+mono_array_to_lparray (MonoArray *array)
+{
+ if (!array)
+ return NULL;
+
+ /* fixme: maybe we need to make a copy */
+ return array->vector;
+}
+
+void
+mono_string_utf8_to_builder (MonoStringBuilder *sb, char *text)
+{
+ GError *error = NULL;
+ guint16 *ut;
+ glong items_written;
+ int l;
+
+ if (!sb || !text)
+ return;
+
+ l = strlen (text);
+
+ ut = g_utf8_to_utf16 (text, l, NULL, &items_written, &error);
+
+ if (items_written > mono_stringbuilder_capacity (sb))
+ items_written = mono_stringbuilder_capacity (sb);
+
+ if (!error) {
+ memcpy (mono_string_chars (sb->str), ut, items_written * 2);
+ sb->length = items_written;
+ } else
+ g_error_free (error);
+
+ g_free (ut);
+}
+
+void
+mono_string_utf16_to_builder (MonoStringBuilder *sb, gunichar2 *text)
+{
+ guint32 len;
+
+ if (!sb || !text)
+ return;
+
+ g_assert (mono_string_chars (sb->str) == text);
+
+ for (len = 0; text [len] != 0; ++len)
+ ;
+
+ sb->length = len;
+}
+
+gpointer
+mono_string_builder_to_utf8 (MonoStringBuilder *sb)
+{
+ GError *error = NULL;
+ glong *res;
+ gchar *tmp;
+
+ if (!sb)
+ return NULL;
+
+ res = mono_marshal_alloc (mono_stringbuilder_capacity (sb) + 1);
+
+ tmp = g_utf16_to_utf8 (mono_string_chars (sb->str), sb->length, NULL, res, &error);
+ if (error) {
+ g_error_free (error);
+ mono_raise_exception (mono_get_exception_execution_engine ("Failed to convert StringBuilder from utf16 to utf8"));
+ }
+ else {
+ memcpy (res, tmp, sb->length + 1);
+ g_free (tmp);
+ }
+
+ return res;
+}
+
+gpointer
+mono_string_builder_to_utf16 (MonoStringBuilder *sb)
+{
+ if (!sb)
+ return NULL;
+
+ return mono_string_chars (sb->str);
+}
+
+static gpointer
+mono_string_to_lpstr (MonoString *s)
+{
+#ifdef PLATFORM_WIN32
+ char *as, *tmp;
+ glong len;
+ GError *error = NULL;
+
+ if (s == NULL)
+ return NULL;
+
+ if (!s->length) {
+ as = CoTaskMemAlloc (1);
+ as [0] = '\0';
+ return as;
+ }
+
+ tmp = g_utf16_to_utf8 (mono_string_chars (s), s->length, NULL, &len, &error);
+ if (error) {
+ g_warning (error->message);
+ g_error_free (error);
+ return NULL;
+ }
+ else {
+ as = CoTaskMemAlloc (len + 1);
+ memcpy (as, tmp, len + 1);
+ return as;
+ }
+#else
+ return mono_string_to_utf8 (s);
+#endif
+}
+
+gpointer
+mono_string_to_ansibstr (MonoString *string_obj)
+{
+ g_error ("implement me");
+ return NULL;
+}
+
+gpointer
+mono_string_to_bstr (MonoString *string_obj)
+{
+ g_error ("implement me");
+ return NULL;
+}
+
+void
+mono_string_to_byvalstr (gpointer dst, MonoString *src, int size)
+{
+ char *s;
+ int len;
+
+ g_assert (dst != NULL);
+ g_assert (size > 0);
+
+ memset (dst, 0, size);
+
+ if (!src)
+ return;
+
+ s = mono_string_to_utf8 (src);
+ len = MIN (size, strlen (s));
+ memcpy (dst, s, len);
+ g_free (s);
+
+ *((char *)dst + size - 1) = 0;
+}
+
+void
+mono_string_to_byvalwstr (gpointer dst, MonoString *src, int size)
+{
+ int len;
+
+ g_assert (dst != NULL);
+ g_assert (size > 1);
+
+ if (!src) {
+ memset (dst, 0, size);
+ return;
+ }
+
+ len = MIN (size, (mono_string_length (src) * 2));
+ memcpy (dst, mono_string_chars (src), len);
+
+ *((char *)dst + size - 1) = 0;
+ *((char *)dst + size - 2) = 0;
+}
+
+void
+mono_mb_free (MonoMethodBuilder *mb)
+{
+ g_list_free (mb->locals_list);
+ g_free (mb);
+}
+
+MonoMethodBuilder *
+mono_mb_new (MonoClass *klass, const char *name, MonoWrapperType type)
+{
+ MonoMethodBuilder *mb;
+ MonoMethod *m;
+
+ g_assert (klass != NULL);
+ g_assert (name != NULL);
+
+ mb = g_new0 (MonoMethodBuilder, 1);
+
+ mb->method = m = (MonoMethod *)g_new0 (MonoMethodWrapper, 1);
+
+ m->klass = klass;
+ m->name = g_strdup (name);
+ m->inline_info = 1;
+ m->wrapper_type = type;
+
+ mb->code_size = 256;
+ mb->code = g_malloc (mb->code_size);
+
+ return mb;
+}
+
+int
+mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type)
+{
+ int res = mb->locals;
+
+ g_assert (mb != NULL);
+ g_assert (type != NULL);
+
+ mb->locals_list = g_list_append (mb->locals_list, type);
+ mb->locals++;
+
+ return res;
+}
+
+MonoMethod *
+mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack)
+{
+ MonoMethodHeader *header;
+ GList *l;
+ int i;
+
+ g_assert (mb != NULL);
+
+ ((MonoMethodNormal *)mb->method)->header = header = (MonoMethodHeader *)
+ g_malloc0 (sizeof (MonoMethodHeader) + mb->locals * sizeof (MonoType *));
+
+ if (max_stack < 8)
+ max_stack = 8;
+
+ header->max_stack = max_stack;
+
+ for (i = 0, l = mb->locals_list; l; l = l->next, i++) {
+ header->locals [i] = (MonoType *)l->data;
+ }
+
+ mb->method->signature = signature;
+ header->code = mb->code;
+ header->code_size = mb->pos;
+ header->num_locals = mb->locals;
+
+#ifdef DEBUG_RUNTIME_CODE
+ printf ("RUNTIME CODE FOR %s\n", mono_method_full_name (mb->method, TRUE));
+ printf ("%s\n", mono_disasm_code (&marshal_dh, mb->method, mb->code, mb->code + mb->pos));
+#endif
+
+ return mb->method;
+}
+
+guint32
+mono_mb_add_data (MonoMethodBuilder *mb, gpointer data)
+{
+ MonoMethodWrapper *mw;
+
+ g_assert (mb != NULL);
+
+ mw = (MonoMethodWrapper *)mb->method;
+
+ mw->data = g_list_append (mw->data, data);
+
+ return g_list_length (mw->data);
+}
+
+void
+mono_mb_patch_addr (MonoMethodBuilder *mb, int pos, int value)
+{
+ mb->code [pos] = value & 0xff;
+ mb->code [pos + 1] = (value >> 8) & 0xff;
+ mb->code [pos + 2] = (value >> 16) & 0xff;
+ mb->code [pos + 3] = (value >> 24) & 0xff;
+}
+
+void
+mono_mb_patch_addr_s (MonoMethodBuilder *mb, int pos, gint8 value)
+{
+ *((gint8 *)(&mb->code [pos])) = value;
+}
+
+void
+mono_mb_emit_byte (MonoMethodBuilder *mb, guint8 op)
+{
+ if (mb->pos >= mb->code_size) {
+ mb->code_size += 64;
+ mb->code = g_realloc (mb->code, mb->code_size);
+ }
+
+ mb->code [mb->pos++] = op;
+}
+
+void
+mono_mb_emit_ldflda (MonoMethodBuilder *mb, gint32 offset)
+{
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+
+ if (offset) {
+ mono_mb_emit_icon (mb, offset);
+ mono_mb_emit_byte (mb, CEE_ADD);
+ }
+}
+
+static int
+mono_mb_emit_proxy_check (MonoMethodBuilder *mb, int branch_code)
+{
+ int pos;
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoObject, vtable));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icon (mb, G_STRUCT_OFFSET (MonoVTable, klass));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_defaults.transparent_proxy_class));
+ mono_mb_emit_byte (mb, branch_code);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+ return pos;
+}
+
+void
+mono_mb_emit_i4 (MonoMethodBuilder *mb, gint32 data)
+{
+ if ((mb->pos + 4) >= mb->code_size) {
+ mb->code_size += 64;
+ mb->code = g_realloc (mb->code, mb->code_size);
+ }
+
+ mono_mb_patch_addr (mb, mb->pos, data);
+ mb->pos += 4;
+}
+
+void
+mono_mb_emit_i2 (MonoMethodBuilder *mb, gint16 data)
+{
+ if ((mb->pos + 2) >= mb->code_size) {
+ mb->code_size += 64;
+ mb->code = g_realloc (mb->code, mb->code_size);
+ }
+
+ mb->code [mb->pos] = data & 0xff;
+ mb->code [mb->pos + 1] = (data >> 8) & 0xff;
+ mb->pos += 2;
+}
+
+void
+mono_mb_emit_ldstr (MonoMethodBuilder *mb, char *str)
+{
+ mono_mb_emit_byte (mb, CEE_LDSTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, str));
+}
+
+
+void
+mono_mb_emit_ldarg (MonoMethodBuilder *mb, guint argnum)
+{
+ if (argnum < 4) {
+ mono_mb_emit_byte (mb, CEE_LDARG_0 + argnum);
+ } else if (argnum < 256) {
+ mono_mb_emit_byte (mb, CEE_LDARG_S);
+ mono_mb_emit_byte (mb, argnum);
+ } else {
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LDARG);
+ mono_mb_emit_i2 (mb, argnum);
+ }
+}
+
+void
+mono_mb_emit_ldarg_addr (MonoMethodBuilder *mb, guint argnum)
+{
+ if (argnum < 256) {
+ mono_mb_emit_byte (mb, CEE_LDARGA_S);
+ mono_mb_emit_byte (mb, argnum);
+ } else {
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LDARGA);
+ mono_mb_emit_i2 (mb, argnum);
+ }
+}
+
+void
+mono_mb_emit_ldloc_addr (MonoMethodBuilder *mb, guint locnum)
+{
+ if (locnum < 256) {
+ mono_mb_emit_byte (mb, CEE_LDLOCA_S);
+ mono_mb_emit_byte (mb, locnum);
+ } else {
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LDLOCA);
+ mono_mb_emit_i2 (mb, locnum);
+ }
+}
+
+void
+mono_mb_emit_ldloc (MonoMethodBuilder *mb, guint num)
+{
+ if (num < 4) {
+ mono_mb_emit_byte (mb, CEE_LDLOC_0 + num);
+ } else if (num < 256) {
+ mono_mb_emit_byte (mb, CEE_LDLOC_S);
+ mono_mb_emit_byte (mb, num);
+ } else {
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LDLOC);
+ mono_mb_emit_i2 (mb, num);
+ }
+}
+
+void
+mono_mb_emit_stloc (MonoMethodBuilder *mb, guint num)
+{
+ if (num < 4) {
+ mono_mb_emit_byte (mb, CEE_STLOC_0 + num);
+ } else if (num < 256) {
+ mono_mb_emit_byte (mb, CEE_STLOC_S);
+ mono_mb_emit_byte (mb, num);
+ } else {
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_STLOC);
+ mono_mb_emit_i2 (mb, num);
+ }
+}
+
+void
+mono_mb_emit_icon (MonoMethodBuilder *mb, gint32 value)
+{
+ if (value >= -1 && value < 8) {
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0 + value);
+ } else if (value >= -128 && value <= 127) {
+ mono_mb_emit_byte (mb, CEE_LDC_I4_S);
+ mono_mb_emit_byte (mb, value);
+ } else {
+ mono_mb_emit_byte (mb, CEE_LDC_I4);
+ mono_mb_emit_i4 (mb, value);
+ }
+}
+
+guint32
+mono_mb_emit_branch (MonoMethodBuilder *mb, guint8 op)
+{
+ guint32 res;
+ mono_mb_emit_byte (mb, op);
+ res = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+ return res;
+}
+
+static void
+mono_mb_emit_calli (MonoMethodBuilder *mb, MonoMethodSignature *sig)
+{
+ mono_mb_emit_byte (mb, CEE_CALLI);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, sig));
+}
+
+void
+mono_mb_emit_managed_call (MonoMethodBuilder *mb, MonoMethod *method, MonoMethodSignature *opt_sig)
+{
+ mono_mb_emit_byte (mb, CEE_CALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, method));
+}
+
+void
+mono_mb_emit_native_call (MonoMethodBuilder *mb, MonoMethodSignature *sig, gpointer func)
+{
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_SAVE_LMF);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, func));
+ mono_mb_emit_calli (mb, sig);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_RESTORE_LMF);
+}
+
+static void
+mono_mb_emit_icall (MonoMethodBuilder *mb, gpointer func)
+{
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_ICALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, func));
+}
+
+void
+mono_mb_emit_exception (MonoMethodBuilder *mb, const char *exc_name, const char *msg)
+{
+ /* fixme: we need a better way to throw exception,
+ * supporting several exception types and messages */
+ MonoMethod *ctor = NULL;
+
+ MonoClass *mme = mono_class_from_name (mono_defaults.corlib, "System", exc_name);
+ int i;
+ mono_class_init (mme);
+ for (i = 0; i < mme->method.count; ++i) {
+ if (strcmp (mme->methods [i]->name, ".ctor") == 0 && mme->methods [i]->signature->param_count == 0) {
+ ctor = mme->methods [i];
+ break;
+ }
+ }
+ g_assert (ctor);
+ mono_mb_emit_byte (mb, CEE_NEWOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, ctor));
+ if (msg != NULL) {
+ mono_mb_emit_byte (mb, CEE_DUP);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoException, message));
+ mono_mb_emit_ldstr (mb, (char*)msg);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ }
+ mono_mb_emit_byte (mb, CEE_THROW);
+}
+
+void
+mono_mb_emit_add_to_local (MonoMethodBuilder *mb, guint16 local, gint32 incr)
+{
+ mono_mb_emit_ldloc (mb, local);
+ mono_mb_emit_icon (mb, incr);
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_stloc (mb, local);
+}
+
+static void
+emit_ptr_to_str_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv conv,
+ int usize, int msize, MonoMarshalSpec *mspec)
+{
+ switch (conv) {
+ case MONO_MARSHAL_CONV_BOOL_I4:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ mono_mb_emit_byte (mb, CEE_BRFALSE_S);
+ mono_mb_emit_byte (mb, 3);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_1);
+ mono_mb_emit_byte (mb, CEE_BR_S);
+ mono_mb_emit_byte (mb, 1);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_byte (mb, CEE_STIND_I1);
+ break;
+ case MONO_MARSHAL_CONV_BOOL_VARIANTBOOL:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I2);
+ mono_mb_emit_byte (mb, CEE_BRFALSE_S);
+ mono_mb_emit_byte (mb, 3);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_1);
+ mono_mb_emit_byte (mb, CEE_BR_S);
+ mono_mb_emit_byte (mb, 1);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_byte (mb, CEE_STIND_I1);
+ break;
+ case MONO_MARSHAL_CONV_ARRAY_BYVALARRAY: {
+ MonoClass *eclass = NULL;
+ int esize;
+
+ if (type->type == MONO_TYPE_SZARRAY) {
+ eclass = type->data.klass;
+ } else {
+ g_assert_not_reached ();
+ }
+
+ if (eclass->valuetype)
+ esize = mono_class_instance_size (eclass) - sizeof (MonoObject);
+ else
+ esize = sizeof (gpointer);
+
+ /* create a new array */
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_icon (mb, mspec->data.array_data.num_elem);
+ mono_mb_emit_byte (mb, CEE_NEWARR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, eclass));
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+
+ /* copy the elements */
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icon (mb, G_STRUCT_OFFSET (MonoArray, vector));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_icon (mb, mspec->data.array_data.num_elem * esize);
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_CPBLK);
+
+ break;
+ }
+ case MONO_MARSHAL_CONV_STR_BYVALSTR:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_icall (mb, mono_string_new_wrapper);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ break;
+ case MONO_MARSHAL_CONV_STR_LPTSTR:
+ case MONO_MARSHAL_CONV_STR_LPSTR:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icall (mb, mono_string_new_wrapper);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ break;
+ case MONO_MARSHAL_CONV_OBJECT_STRUCT: {
+ MonoClass *klass = mono_class_from_mono_type (type);
+ int src_var, dst_var;
+
+ src_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ dst_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ /* *dst = new object */
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_NEWOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+
+ /* save the old src pointer */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_stloc (mb, src_var);
+ /* save the old dst pointer */
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_stloc (mb, dst_var);
+
+ /* dst = pointer to newly created object data */
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ emit_struct_conv (mb, klass, TRUE);
+
+ /* restore the old src pointer */
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ /* restore the old dst pointer */
+ mono_mb_emit_ldloc (mb, dst_var);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+ break;
+ }
+ case MONO_MARSHAL_CONV_DEL_FTN: {
+ /* fixme: we never convert functions back to delegates, dont
+ // know if thats the correct behaviour
+ */
+ break;
+ }
+ case MONO_MARSHAL_CONV_ARRAY_LPARRAY:
+ g_error ("Structure field of type %s can't be marshalled as LPArray", mono_class_from_mono_type (type)->name);
+ break;
+ case MONO_MARSHAL_CONV_STR_LPWSTR:
+ case MONO_MARSHAL_CONV_STR_BSTR:
+ case MONO_MARSHAL_CONV_STR_ANSIBSTR:
+ case MONO_MARSHAL_CONV_STR_TBSTR:
+ case MONO_MARSHAL_CONV_ARRAY_SAVEARRAY:
+ case MONO_MARSHAL_CONV_STR_BYVALWSTR:
+ default:
+ g_warning ("marshaling conversion %d not implemented", conv);
+ g_assert_not_reached ();
+ }
+}
+
+static gpointer
+conv_to_icall (MonoMarshalConv conv)
+{
+ switch (conv) {
+ case MONO_MARSHAL_CONV_STR_LPWSTR:
+ return mono_marshal_string_to_utf16;
+ case MONO_MARSHAL_CONV_LPWSTR_STR:
+ return mono_string_from_utf16;
+ case MONO_MARSHAL_CONV_LPSTR_STR:
+ return mono_string_new_wrapper;
+ case MONO_MARSHAL_CONV_STR_LPTSTR:
+ case MONO_MARSHAL_CONV_STR_LPSTR:
+ return mono_string_to_lpstr;
+ case MONO_MARSHAL_CONV_STR_BSTR:
+ return mono_string_to_bstr;
+ case MONO_MARSHAL_CONV_STR_TBSTR:
+ case MONO_MARSHAL_CONV_STR_ANSIBSTR:
+ return mono_string_to_ansibstr;
+ case MONO_MARSHAL_CONV_SB_LPSTR:
+ case MONO_MARSHAL_CONV_SB_LPTSTR:
+ return mono_string_builder_to_utf8;
+ case MONO_MARSHAL_CONV_SB_LPWSTR:
+ return mono_string_builder_to_utf16;
+ case MONO_MARSHAL_CONV_ARRAY_SAVEARRAY:
+ return mono_array_to_savearray;
+ case MONO_MARSHAL_CONV_ARRAY_LPARRAY:
+ return mono_array_to_lparray;
+ case MONO_MARSHAL_CONV_DEL_FTN:
+ return mono_delegate_to_ftnptr;
+ case MONO_MARSHAL_CONV_FTN_DEL:
+ return mono_ftnptr_to_delegate;
+ case MONO_MARSHAL_CONV_LPSTR_SB:
+ case MONO_MARSHAL_CONV_LPTSTR_SB:
+ return mono_string_utf8_to_builder;
+ case MONO_MARSHAL_CONV_LPWSTR_SB:
+ return mono_string_utf16_to_builder;
+ case MONO_MARSHAL_FREE_ARRAY:
+ return mono_marshal_free_array;
+ case MONO_MARSHAL_CONV_STR_BYVALSTR:
+ return mono_string_to_byvalstr;
+ case MONO_MARSHAL_CONV_STR_BYVALWSTR:
+ return mono_string_to_byvalwstr;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return NULL;
+}
+
+static void
+emit_str_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv conv, int usize, int msize,
+ MonoMarshalSpec *mspec)
+{
+ int pos;
+
+ switch (conv) {
+ case MONO_MARSHAL_CONV_BOOL_I4:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_U1);
+ mono_mb_emit_byte (mb, CEE_STIND_I4);
+ break;
+ case MONO_MARSHAL_CONV_BOOL_VARIANTBOOL:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_U1);
+ mono_mb_emit_byte (mb, CEE_NEG);
+ mono_mb_emit_byte (mb, CEE_STIND_I2);
+ break;
+ case MONO_MARSHAL_CONV_STR_LPWSTR:
+ case MONO_MARSHAL_CONV_STR_LPSTR:
+ case MONO_MARSHAL_CONV_STR_LPTSTR:
+ case MONO_MARSHAL_CONV_STR_BSTR:
+ case MONO_MARSHAL_CONV_STR_ANSIBSTR:
+ case MONO_MARSHAL_CONV_STR_TBSTR: {
+ int pos;
+
+ /* free space if free == true */
+ mono_mb_emit_byte (mb, CEE_LDLOC_2);
+ mono_mb_emit_byte (mb, CEE_BRFALSE_S);
+ pos = mb->pos;
+ mono_mb_emit_byte (mb, 0);
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icall (mb, g_free);
+ mono_mb_patch_addr_s (mb, pos, mb->pos - pos - 1);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ break;
+ }
+ case MONO_MARSHAL_CONV_ARRAY_SAVEARRAY:
+ case MONO_MARSHAL_CONV_ARRAY_LPARRAY:
+ case MONO_MARSHAL_CONV_DEL_FTN:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ break;
+ case MONO_MARSHAL_CONV_STR_BYVALSTR:
+ case MONO_MARSHAL_CONV_STR_BYVALWSTR: {
+ if (!usize)
+ break;
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_1); /* dst */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I); /* src String */
+ mono_mb_emit_icon (mb, usize);
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+ break;
+ }
+ case MONO_MARSHAL_CONV_ARRAY_BYVALARRAY: {
+ MonoClass *eclass = NULL;
+ int esize;
+
+ if (type->type == MONO_TYPE_SZARRAY) {
+ eclass = type->data.klass;
+ } else {
+ g_assert_not_reached ();
+ }
+
+ if (eclass->valuetype)
+ esize = mono_class_native_size (eclass, NULL);
+ else
+ esize = sizeof (gpointer);
+
+ if (!usize)
+ break;
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_byte (mb, CEE_BRFALSE_S);
+ pos = mb->pos;
+ mono_mb_emit_byte (mb, 0);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_icon (mb, G_STRUCT_OFFSET (MonoArray, vector));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_icon (mb, mspec->data.array_data.num_elem * esize);
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_CPBLK);
+ mono_mb_patch_addr_s (mb, pos, mb->pos - pos - 1);
+ break;
+ }
+ case MONO_MARSHAL_CONV_OBJECT_STRUCT: {
+ int src_var, dst_var;
+
+ src_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ dst_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_byte (mb, CEE_BRFALSE_S);
+ pos = mb->pos;
+ mono_mb_emit_byte (mb, 0);
+
+ /* save the old src pointer */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_stloc (mb, src_var);
+ /* save the old dst pointer */
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_stloc (mb, dst_var);
+
+ /* src = pointer to object data */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ emit_struct_conv (mb, mono_class_from_mono_type (type), FALSE);
+
+ /* restore the old src pointer */
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ /* restore the old dst pointer */
+ mono_mb_emit_ldloc (mb, dst_var);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ mono_mb_patch_addr_s (mb, pos, mb->pos - pos - 1);
+ break;
+ }
+ default: {
+ char *msg = g_strdup_printf ("marshalling conversion %d not implemented", conv);
+ MonoException *exc = mono_get_exception_not_implemented (msg);
+ g_warning (msg);
+ g_free (msg);
+ mono_raise_exception (exc);
+ }
+ }
+}
+
+static void
+emit_struct_conv (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_object)
+{
+ MonoMarshalType *info;
+ int i;
+
+ if (klass->parent)
+ emit_struct_conv(mb, klass->parent, to_object);
+
+ info = mono_marshal_load_type_info (klass);
+
+ if (info->native_size == 0)
+ return;
+
+ if (klass->blittable) {
+ int msize = mono_class_value_size (klass, NULL);
+ g_assert (msize == info->native_size);
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_icon (mb, msize);
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_CPBLK);
+
+ mono_mb_emit_add_to_local (mb, 0, msize);
+ mono_mb_emit_add_to_local (mb, 1, msize);
+ return;
+ }
+
+ for (i = 0; i < info->num_fields; i++) {
+ MonoMarshalNative ntype;
+ MonoMarshalConv conv;
+ MonoType *ftype = info->fields [i].field->type;
+ int msize = 0;
+ int usize = 0;
+ gboolean last_field = i < (info->num_fields -1) ? 0 : 1;
+
+ if (ftype->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+
+ ntype = mono_type_to_unmanaged (ftype, info->fields [i].mspec, TRUE, klass->unicode, &conv);
+
+ if (last_field) {
+ msize = klass->instance_size - info->fields [i].field->offset;
+ usize = info->native_size - info->fields [i].offset;
+ } else {
+ msize = info->fields [i + 1].field->offset - info->fields [i].field->offset;
+ usize = info->fields [i + 1].offset - info->fields [i].offset;
+ }
+ if ((msize < 0) || (usize < 0))
+ /* This happens with GC aware auto layout */
+ g_error ("Type %s which is passed to unmanaged code must have a StructLayout attribute", mono_type_full_name (&klass->byval_arg));
+
+ g_assert ((msize >= 0) && (usize >= 0));
+
+ switch (conv) {
+ case MONO_MARSHAL_CONV_NONE: {
+ int t;
+
+ if (ftype->byref || ftype->type == MONO_TYPE_I ||
+ ftype->type == MONO_TYPE_U) {
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ break;
+ }
+
+ t = ftype->type;
+ handle_enum:
+ switch (t) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+#if SIZEOF_VOID_P == 4
+ case MONO_TYPE_PTR:
+#endif
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ mono_mb_emit_byte (mb, CEE_STIND_I4);
+ break;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I1);
+ mono_mb_emit_byte (mb, CEE_STIND_I1);
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I2);
+ mono_mb_emit_byte (mb, CEE_STIND_I2);
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_PTR:
+#endif
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_I8);
+ mono_mb_emit_byte (mb, CEE_STIND_I8);
+ break;
+ case MONO_TYPE_R4:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_R4);
+ mono_mb_emit_byte (mb, CEE_STIND_R4);
+ break;
+ case MONO_TYPE_R8:
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDIND_R8);
+ mono_mb_emit_byte (mb, CEE_STIND_R8);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (ftype->data.klass->enumtype) {
+ t = ftype->data.klass->enum_basetype->type;
+ goto handle_enum;
+ }
+ emit_struct_conv (mb, ftype->data.klass, to_object);
+ continue;
+ default:
+ g_warning ("marshaling type %02x not implemented", ftype->type);
+ g_assert_not_reached ();
+ }
+ break;
+ }
+ default:
+ if (to_object)
+ emit_ptr_to_str_conv (mb, ftype, conv, usize, msize, info->fields [i].mspec);
+ else
+ emit_str_to_ptr_conv (mb, ftype, conv, usize, msize, info->fields [i].mspec);
+ }
+
+ if (to_object) {
+ mono_mb_emit_add_to_local (mb, 0, usize);
+ mono_mb_emit_add_to_local (mb, 1, msize);
+ } else {
+ mono_mb_emit_add_to_local (mb, 0, msize);
+ mono_mb_emit_add_to_local (mb, 1, usize);
+ }
+ }
+}
+
+static void
+emit_struct_free (MonoMethodBuilder *mb, MonoClass *klass, int struct_var)
+{
+ /* Call DestroyStructure */
+ /* FIXME: Only do this if needed */
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ mono_mb_emit_ldloc (mb, struct_var);
+ mono_mb_emit_icall (mb, mono_struct_delete_old);
+}
+
+static void
+emit_thread_interrupt_checkpoint_call (MonoMethodBuilder *mb, gpointer checkpoint_func)
+{
+ static MonoMethodSignature *state_check_sig = NULL;
+ int pos_noabort;
+
+ if (!state_check_sig) {
+ state_check_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 0);
+ state_check_sig->ret = &mono_defaults.void_class->byval_arg;
+ state_check_sig->pinvoke = 0;
+ }
+
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, (gpointer) mono_thread_interruption_request_flag ()));
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ pos_noabort = mono_mb_emit_branch (mb, CEE_BRFALSE);
+
+ mono_mb_emit_native_call (mb, state_check_sig, checkpoint_func);
+
+ mono_mb_patch_addr (mb, pos_noabort, mb->pos - (pos_noabort + 4));
+}
+
+static void
+emit_thread_interrupt_checkpoint (MonoMethodBuilder *mb)
+{
+ emit_thread_interrupt_checkpoint_call (mb, mono_thread_interruption_checkpoint);
+}
+
+static void
+emit_thread_force_interrupt_checkpoint (MonoMethodBuilder *mb)
+{
+ emit_thread_interrupt_checkpoint_call (mb, mono_thread_force_interruption_checkpoint);
+}
+
+static MonoAsyncResult *
+mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params)
+{
+ MonoMethodMessage *msg;
+ MonoDelegate *async_callback;
+ MonoObject *state;
+ MonoMethod *im;
+ MonoClass *klass;
+ MonoMethod *method = NULL;
+ int i;
+
+ g_assert (delegate);
+
+ if (delegate->target && mono_object_class (delegate->target) == mono_defaults.transparent_proxy_class) {
+
+ MonoTransparentProxy* tp = (MonoTransparentProxy *)delegate->target;
+ if (!tp->remote_class->proxy_class->contextbound || tp->rp->context != (MonoObject *) mono_context_get ()) {
+
+ /* If the target is a proxy, make a direct call. Is proxy's work
+ // to make the call asynchronous.
+ */
+ MonoAsyncResult *ares;
+ MonoObject *exc;
+ MonoArray *out_args;
+ HANDLE handle;
+ method = delegate->method_info->method;
+
+ msg = mono_method_call_message_new (mono_marshal_method_from_wrapper (method), params, NULL, &async_callback, &state);
+ handle = CreateEvent (NULL, TRUE, FALSE, NULL);
+ ares = mono_async_result_new (mono_domain_get (), handle, state, handle);
+ ares->async_delegate = (MonoObject *)delegate;
+ ares->async_callback = (MonoObject *)async_callback;
+ msg->async_result = ares;
+ msg->call_type = CallType_BeginInvoke;
+
+ mono_remoting_invoke ((MonoObject *)tp->rp, msg, &exc, &out_args);
+ return ares;
+ }
+ }
+
+ klass = delegate->object.vtable->klass;
+
+ method = mono_get_delegate_invoke (klass);
+ for (i = 0; i < klass->method.count; ++i) {
+ if (klass->methods [i]->name[0] == 'B' &&
+ !strcmp ("BeginInvoke", klass->methods [i]->name)) {
+ method = klass->methods [i];
+ break;
+ }
+ }
+
+ g_assert (method != NULL);
+
+ im = mono_get_delegate_invoke (method->klass);
+ msg = mono_method_call_message_new (method, params, im, &async_callback, &state);
+
+ return mono_thread_pool_add ((MonoObject *)delegate, msg, async_callback, state);
+}
+
+static int
+mono_mb_emit_save_args (MonoMethodBuilder *mb, MonoMethodSignature *sig, gboolean save_this)
+{
+ int i, params_var, tmp_var;
+
+ /* allocate local (pointer) *params[] */
+ params_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local (pointer) tmp */
+ tmp_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ /* alloate space on stack to store an array of pointers to the arguments */
+ mono_mb_emit_icon (mb, sizeof (gpointer) * (sig->param_count + 1));
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LOCALLOC);
+ mono_mb_emit_stloc (mb, params_var);
+
+ /* tmp = params */
+ mono_mb_emit_ldloc (mb, params_var);
+ mono_mb_emit_stloc (mb, tmp_var);
+
+ if (save_this && sig->hasthis) {
+ mono_mb_emit_ldloc (mb, tmp_var);
+ mono_mb_emit_ldarg_addr (mb, 0);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ /* tmp = tmp + sizeof (gpointer) */
+ if (sig->param_count)
+ mono_mb_emit_add_to_local (mb, tmp_var, sizeof (gpointer));
+
+ }
+
+ for (i = 0; i < sig->param_count; i++) {
+ mono_mb_emit_ldloc (mb, tmp_var);
+ mono_mb_emit_ldarg_addr (mb, i + sig->hasthis);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ /* tmp = tmp + sizeof (gpointer) */
+ if (i < (sig->param_count - 1))
+ mono_mb_emit_add_to_local (mb, tmp_var, sizeof (gpointer));
+ }
+
+ return params_var;
+}
+
+static char*
+mono_signature_to_name (MonoMethodSignature *sig, const char *prefix)
+{
+ int i;
+ char *result;
+ GString *res = g_string_new ("");
+
+ if (prefix) {
+ g_string_append (res, prefix);
+ g_string_append_c (res, '_');
+ }
+
+ mono_type_get_desc (res, sig->ret, FALSE);
+
+ for (i = 0; i < sig->param_count; ++i) {
+ g_string_append_c (res, '_');
+ mono_type_get_desc (res, sig->params [i], FALSE);
+ }
+ result = res->str;
+ g_string_free (res, FALSE);
+ return result;
+}
+
+/**
+ * mono_marshal_get_string_encoding:
+ *
+ * Return the string encoding which should be used for a given parameter.
+ */
+static MonoMarshalNative
+mono_marshal_get_string_encoding (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec)
+{
+ /* First try the parameter marshal info */
+ if (spec) {
+ if (spec->native == MONO_NATIVE_LPARRAY) {
+ if (spec->data.array_data.elem_type != 0)
+ return spec->data.array_data.elem_type;
+ }
+ else
+ return spec->native;
+ }
+
+ if (!piinfo)
+ return MONO_NATIVE_LPSTR;
+
+ /* Then try the method level marshal info */
+ switch (piinfo->piflags & PINVOKE_ATTRIBUTE_CHAR_SET_MASK) {
+ case PINVOKE_ATTRIBUTE_CHAR_SET_ANSI:
+ return MONO_NATIVE_LPSTR;
+ case PINVOKE_ATTRIBUTE_CHAR_SET_UNICODE:
+ return MONO_NATIVE_LPWSTR;
+ case PINVOKE_ATTRIBUTE_CHAR_SET_AUTO:
+ return MONO_NATIVE_LPTSTR;
+ default:
+ return MONO_NATIVE_LPSTR;
+ }
+}
+
+static MonoMarshalConv
+mono_marshal_get_string_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec)
+{
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec);
+
+ switch (encoding) {
+ case MONO_NATIVE_LPWSTR:
+ return MONO_MARSHAL_CONV_STR_LPWSTR;
+ case MONO_NATIVE_LPSTR:
+ return MONO_MARSHAL_CONV_STR_LPSTR;
+ case MONO_NATIVE_LPTSTR:
+ return MONO_MARSHAL_CONV_STR_LPTSTR;
+ default:
+ return -1;
+ }
+}
+
+static MonoMarshalConv
+mono_marshal_get_stringbuilder_to_ptr_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec)
+{
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec);
+
+ switch (encoding) {
+ case MONO_NATIVE_LPWSTR:
+ return MONO_MARSHAL_CONV_SB_LPWSTR;
+ break;
+ case MONO_NATIVE_LPSTR:
+ return MONO_MARSHAL_CONV_SB_LPSTR;
+ break;
+ case MONO_NATIVE_LPTSTR:
+ return MONO_MARSHAL_CONV_SB_LPTSTR;
+ break;
+ default:
+ return -1;
+ }
+}
+
+static MonoMarshalConv
+mono_marshal_get_ptr_to_stringbuilder_conv (MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec, gboolean *need_free)
+{
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (piinfo, spec);
+
+ *need_free = TRUE;
+
+ switch (encoding) {
+ case MONO_NATIVE_LPWSTR:
+ /*
+ * mono_string_builder_to_utf16 does not allocate a
+ * new buffer, so no need to free it.
+ */
+ *need_free = FALSE;
+ return MONO_MARSHAL_CONV_LPWSTR_SB;
+ case MONO_NATIVE_LPSTR:
+ return MONO_MARSHAL_CONV_LPSTR_SB;
+ break;
+ case MONO_NATIVE_LPTSTR:
+ return MONO_MARSHAL_CONV_LPTSTR_SB;
+ break;
+ default:
+ return -1;
+ }
+}
+
+/*
+ * Return whenever a field of a native structure or an array member needs to
+ * be freed.
+ */
+static gboolean
+mono_marshal_need_free (MonoType *t, MonoMethodPInvoke *piinfo, MonoMarshalSpec *spec)
+{
+ MonoMarshalNative encoding;
+ MonoMarshalConv conv;
+
+ switch (t->type) {
+ case MONO_TYPE_VALUETYPE:
+ /* FIXME: Optimize this */
+ return TRUE;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ if (t->data.klass == mono_defaults.stringbuilder_class) {
+ gboolean need_free;
+ conv = mono_marshal_get_ptr_to_stringbuilder_conv (piinfo, spec, &need_free);
+ return need_free;
+ }
+ return FALSE;
+ case MONO_TYPE_STRING:
+ encoding = mono_marshal_get_string_encoding (piinfo, spec);
+ return (encoding == MONO_NATIVE_LPWSTR) ? FALSE : TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static inline MonoMethod*
+mono_marshal_find_in_cache (GHashTable *cache, gpointer key)
+{
+ MonoMethod *res;
+
+ EnterCriticalSection (&marshal_mutex);
+ res = g_hash_table_lookup (cache, key);
+ LeaveCriticalSection (&marshal_mutex);
+ return res;
+}
+
+/* Create the method from the builder and place it in the cache */
+static inline MonoMethod*
+mono_mb_create_and_cache (GHashTable *cache, gpointer key,
+ MonoMethodBuilder *mb, MonoMethodSignature *sig,
+ int max_stack)
+{
+ MonoMethod *res;
+
+ EnterCriticalSection (&marshal_mutex);
+ res = g_hash_table_lookup (cache, key);
+ if (!res) {
+ /* This does not acquire any locks */
+ res = mono_mb_create_method (mb, sig, max_stack);
+ g_hash_table_insert (cache, key, res);
+ mono_g_hash_table_insert (wrapper_hash, res, key);
+ }
+ else
+ /* Somebody created it before us */
+ ;
+ LeaveCriticalSection (&marshal_mutex);
+
+ return res;
+}
+
+MonoMethod *
+mono_marshal_method_from_wrapper (MonoMethod *wrapper)
+{
+ MonoMethod *res;
+
+ if (wrapper->wrapper_type == MONO_WRAPPER_NONE)
+ return wrapper;
+
+ EnterCriticalSection (&marshal_mutex);
+ res = mono_g_hash_table_lookup (wrapper_hash, wrapper);
+ LeaveCriticalSection (&marshal_mutex);
+
+ if (res && wrapper->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK)
+ /* See mono_marshal_get_remoting_invoke_with_check */
+ return (MonoMethod*)((char*)res - 1);
+ else
+ return res;
+}
+
+MonoMethod *
+mono_marshal_get_delegate_begin_invoke (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ static MonoMethodSignature *csig = NULL;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ GHashTable *cache;
+ int params_var;
+ char *name;
+
+ g_assert (method && method->klass->parent == mono_defaults.multicastdelegate_class &&
+ !strcmp (method->name, "BeginInvoke"));
+
+ sig = signature_no_pinvoke (method->signature);
+
+ cache = method->klass->image->delegate_begin_invoke_cache;
+ if ((res = mono_marshal_find_in_cache (cache, sig)))
+ return res;
+
+ g_assert (sig->hasthis);
+
+ if (!csig) {
+ csig = mono_metadata_signature_alloc (method->klass->image, 2);
+
+ /* MonoAsyncResult * begin_invoke (MonoDelegate *delegate, gpointer params[]) */
+ csig->ret = &mono_defaults.object_class->byval_arg;
+ csig->params [0] = &mono_defaults.object_class->byval_arg;
+ csig->params [1] = &mono_defaults.int_class->byval_arg;
+ }
+
+ name = mono_signature_to_name (sig, "begin_invoke");
+ mb = mono_mb_new (mono_defaults.multicastdelegate_class, name, MONO_WRAPPER_DELEGATE_BEGIN_INVOKE);
+ g_free (name);
+
+ mb->method->save_lmf = 1;
+
+ params_var = mono_mb_emit_save_args (mb, sig, FALSE);
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldloc (mb, params_var);
+ mono_mb_emit_native_call (mb, csig, mono_delegate_begin_invoke);
+ emit_thread_interrupt_checkpoint (mb);
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (cache, sig, mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+ return res;
+}
+
+static MonoObject *
+mono_delegate_end_invoke (MonoDelegate *delegate, gpointer *params)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoAsyncResult *ares;
+ MonoMethod *method = NULL;
+ MonoMethodSignature *sig;
+ MonoMethodMessage *msg;
+ MonoObject *res, *exc;
+ MonoArray *out_args;
+ MonoClass *klass;
+ int i;
+
+ g_assert (delegate);
+
+ if (!delegate->method_info || !delegate->method_info->method)
+ g_assert_not_reached ();
+
+ klass = delegate->object.vtable->klass;
+
+ for (i = 0; i < klass->method.count; ++i) {
+ if (klass->methods [i]->name[0] == 'E' &&
+ !strcmp ("EndInvoke", klass->methods [i]->name)) {
+ method = klass->methods [i];
+ break;
+ }
+ }
+
+ g_assert (method != NULL);
+
+ sig = signature_no_pinvoke (method->signature);
+
+ msg = mono_method_call_message_new (method, params, NULL, NULL, NULL);
+
+ ares = mono_array_get (msg->args, gpointer, sig->param_count - 1);
+ g_assert (ares);
+
+ if (delegate->target && mono_object_class (delegate->target) == mono_defaults.transparent_proxy_class) {
+ MonoTransparentProxy* tp = (MonoTransparentProxy *)delegate->target;
+ msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
+ mono_message_init (domain, msg, delegate->method_info, NULL);
+ msg->call_type = CallType_EndInvoke;
+ msg->async_result = ares;
+ res = mono_remoting_invoke ((MonoObject *)tp->rp, msg, &exc, &out_args);
+ }
+ else
+ res = mono_thread_pool_finish (ares, &out_args, &exc);
+
+ if (exc) {
+ if (((MonoException*)exc)->stack_trace) {
+ char *strace = mono_string_to_utf8 (((MonoException*)exc)->stack_trace);
+ char *tmp;
+ tmp = g_strdup_printf ("%s\nException Rethrown at:\n", strace);
+ g_free (strace);
+ ((MonoException*)exc)->stack_trace = mono_string_new (domain, tmp);
+ g_free (tmp);
+ }
+ mono_raise_exception ((MonoException*)exc);
+ }
+
+ mono_method_return_message_restore (method, params, out_args);
+ return res;
+}
+
+static void
+mono_mb_emit_restore_result (MonoMethodBuilder *mb, MonoType *return_type)
+{
+ if (return_type->byref)
+ return_type = &mono_defaults.int_class->byval_arg;
+ else if (return_type->type == MONO_TYPE_VALUETYPE && return_type->data.klass->enumtype)
+ return_type = return_type->data.klass->enum_basetype;
+
+ switch (return_type->type) {
+ case MONO_TYPE_VOID:
+ g_assert_not_reached ();
+ break;
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ /* nothing to do */
+ break;
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_U1);
+ break;
+ case MONO_TYPE_I1:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_I1);
+ break;
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_U2);
+ break;
+ case MONO_TYPE_I2:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_I2);
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ break;
+ case MONO_TYPE_I4:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ break;
+ case MONO_TYPE_U4:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_U4);
+ break;
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_I8);
+ break;
+ case MONO_TYPE_R4:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_R4);
+ break;
+ case MONO_TYPE_R8:
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (return_type)));
+ mono_mb_emit_byte (mb, CEE_LDIND_R8);
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ int class;
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ class = mono_mb_add_data (mb, mono_class_from_mono_type (return_type));
+ mono_mb_emit_i4 (mb, class);
+ mono_mb_emit_byte (mb, CEE_LDOBJ);
+ mono_mb_emit_i4 (mb, class);
+ break;
+ }
+ default:
+ g_warning ("type 0x%x not handled", return_type->type);
+ g_assert_not_reached ();
+ }
+
+ mono_mb_emit_byte (mb, CEE_RET);
+}
+
+MonoMethod *
+mono_marshal_get_delegate_end_invoke (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ static MonoMethodSignature *csig = NULL;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ GHashTable *cache;
+ int params_var;
+ char *name;
+
+ g_assert (method && method->klass->parent == mono_defaults.multicastdelegate_class &&
+ !strcmp (method->name, "EndInvoke"));
+
+ sig = signature_no_pinvoke (method->signature);
+
+ cache = method->klass->image->delegate_end_invoke_cache;
+ if ((res = mono_marshal_find_in_cache (cache, sig)))
+ return res;
+
+ g_assert (sig->hasthis);
+
+ if (!csig) {
+ csig = mono_metadata_signature_alloc (method->klass->image, 2);
+
+ /* MonoObject *end_invoke (MonoDelegate *delegate, gpointer params[]) */
+ csig->ret = &mono_defaults.object_class->byval_arg;
+ csig->params [0] = &mono_defaults.object_class->byval_arg;
+ csig->params [1] = &mono_defaults.int_class->byval_arg;
+ }
+
+ name = mono_signature_to_name (sig, "end_invoke");
+ mb = mono_mb_new (mono_defaults.multicastdelegate_class, name, MONO_WRAPPER_DELEGATE_END_INVOKE);
+ g_free (name);
+
+ mb->method->save_lmf = 1;
+
+ params_var = mono_mb_emit_save_args (mb, sig, FALSE);
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldloc (mb, params_var);
+ mono_mb_emit_native_call (mb, csig, mono_delegate_end_invoke);
+ emit_thread_interrupt_checkpoint (mb);
+
+ if (sig->ret->type == MONO_TYPE_VOID) {
+ mono_mb_emit_byte (mb, CEE_POP);
+ mono_mb_emit_byte (mb, CEE_RET);
+ } else
+ mono_mb_emit_restore_result (mb, sig->ret);
+
+ res = mono_mb_create_and_cache (cache, sig,
+ mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+static MonoObject *
+mono_remoting_wrapper (MonoMethod *method, gpointer *params)
+{
+ MonoMethodMessage *msg;
+ MonoTransparentProxy *this;
+ MonoObject *res, *exc;
+ MonoArray *out_args;
+
+ this = *((MonoTransparentProxy **)params [0]);
+
+ g_assert (this);
+ g_assert (((MonoObject *)this)->vtable->klass == mono_defaults.transparent_proxy_class);
+
+ /* skip the this pointer */
+ params++;
+
+ if (this->remote_class->proxy_class->contextbound && this->rp->context == (MonoObject *) mono_context_get ())
+ {
+ int i;
+ MonoMethodSignature *sig = method->signature;
+ int count = sig->param_count;
+ gpointer* mparams = (gpointer*) alloca(count*sizeof(gpointer));
+
+ for (i=0; i<count; i++) {
+ MonoClass *class = mono_class_from_mono_type (sig->params [i]);
+ if (class->valuetype) {
+ if (sig->params [i]->byref)
+ mparams[i] = *((gpointer *)params [i]);
+ else
+ mparams[i] = params [i];
+ } else {
+ mparams[i] = *((gpointer**)params [i]);
+ }
+ }
+
+ return mono_runtime_invoke (method, method->klass->valuetype? mono_object_unbox ((MonoObject*)this): this, mparams, NULL);
+ }
+
+ msg = mono_method_call_message_new (method, params, NULL, NULL, NULL);
+
+ res = mono_remoting_invoke ((MonoObject *)this->rp, msg, &exc, &out_args);
+
+ if (exc)
+ mono_raise_exception ((MonoException *)exc);
+
+ mono_method_return_message_restore (method, params, out_args);
+
+ return res;
+}
+
+MonoMethod *
+mono_marshal_get_remoting_invoke (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ static MonoMethodSignature *csig = NULL;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ GHashTable *cache;
+ int params_var;
+
+ g_assert (method);
+
+ if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE)
+ return method;
+
+ sig = signature_no_pinvoke (method->signature);
+
+ /* we cant remote methods without this pointer */
+ if (!sig->hasthis)
+ return method;
+
+ cache = method->klass->image->remoting_invoke_cache;
+ if ((res = mono_marshal_find_in_cache (cache, method)))
+ return res;
+
+ if (!csig) {
+ csig = mono_metadata_signature_alloc (mono_defaults.corlib, 2);
+ csig->params [0] = &mono_defaults.int_class->byval_arg;
+ csig->params [1] = &mono_defaults.int_class->byval_arg;
+ csig->ret = &mono_defaults.object_class->byval_arg;
+ csig->pinvoke = 1;
+ }
+
+ mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_REMOTING_INVOKE);
+ mb->method->save_lmf = 1;
+
+ params_var = mono_mb_emit_save_args (mb, sig, TRUE);
+
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, method));
+ mono_mb_emit_ldloc (mb, params_var);
+ mono_mb_emit_native_call (mb, csig, mono_remoting_wrapper);
+ emit_thread_interrupt_checkpoint (mb);
+
+ if (sig->ret->type == MONO_TYPE_VOID) {
+ mono_mb_emit_byte (mb, CEE_POP);
+ mono_mb_emit_byte (mb, CEE_RET);
+ } else {
+ mono_mb_emit_restore_result (mb, sig->ret);
+ }
+
+ res = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+MonoMethod *
+mono_marshal_get_remoting_invoke_with_check (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ MonoMethodBuilder *mb;
+ MonoMethod *res, *native;
+ GHashTable *cache;
+ int i, pos;
+
+ g_assert (method);
+
+ if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK)
+ return method;
+
+ sig = signature_no_pinvoke (method->signature);
+
+ /* we cant remote methods without this pointer */
+ g_assert (sig->hasthis);
+
+ cache = method->klass->image->remoting_invoke_cache;
+ if ((res = mono_marshal_find_in_cache (cache, (char *)method + 1)))
+ return res;
+
+ mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK);
+
+ mono_mb_emit_ldarg (mb, 0);
+ pos = mono_mb_emit_proxy_check (mb, CEE_BNE_UN);
+
+ native = mono_marshal_get_remoting_invoke (method);
+
+ for (i = 0; i <= sig->param_count; i++)
+ mono_mb_emit_ldarg (mb, i);
+
+ mono_mb_emit_managed_call (mb, native, native->signature);
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+
+ for (i = 0; i <= sig->param_count; i++)
+ mono_mb_emit_ldarg (mb, i);
+
+ mono_mb_emit_managed_call (mb, method, method->signature);
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (cache, (char*)method + 1,
+ mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+/*
+ * the returned method invokes all methods in a multicast delegate
+ */
+MonoMethod *
+mono_marshal_get_delegate_invoke (MonoMethod *method)
+{
+ MonoMethodSignature *sig, *static_sig;
+ int i;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ GHashTable *cache;
+ int pos0, pos1;
+ char *name;
+
+ g_assert (method && method->klass->parent == mono_defaults.multicastdelegate_class &&
+ !strcmp (method->name, "Invoke"));
+
+ sig = signature_no_pinvoke (method->signature);
+
+ cache = method->klass->image->delegate_invoke_cache;
+ if ((res = mono_marshal_find_in_cache (cache, sig)))
+ return res;
+
+ static_sig = mono_metadata_signature_dup (sig);
+ static_sig->hasthis = 0;
+
+ name = mono_signature_to_name (sig, "invoke");
+ mb = mono_mb_new (mono_defaults.multicastdelegate_class, name, MONO_WRAPPER_DELEGATE_INVOKE);
+ g_free (name);
+
+ /* allocate local 0 (object) */
+ mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+
+ g_assert (sig->hasthis);
+
+ /*
+ * if (prev != null)
+ * prev.Invoke( args .. );
+ * return this.<target>( args .. );
+ */
+
+ /* this wrapper can be used in unmanaged-managed transitions */
+ emit_thread_interrupt_checkpoint (mb);
+
+ /* get this->prev */
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoMulticastDelegate, prev));
+ mono_mb_emit_byte (mb, CEE_LDIND_I );
+ mono_mb_emit_stloc (mb, 0);
+
+ /* if prev != null */
+ mono_mb_emit_ldloc (mb, 0);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+
+ pos0 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* then recurse */
+ mono_mb_emit_ldloc (mb, 0);
+ for (i = 0; i < sig->param_count; i++)
+ mono_mb_emit_ldarg (mb, i + 1);
+ mono_mb_emit_managed_call (mb, method, method->signature);
+ if (sig->ret->type != MONO_TYPE_VOID)
+ mono_mb_emit_byte (mb, CEE_POP);
+
+ /* continued or prev == null */
+ mono_mb_patch_addr (mb, pos0, mb->pos - (pos0 + 4));
+
+ /* get this->target */
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoDelegate, target));
+ mono_mb_emit_byte (mb, CEE_LDIND_I );
+ mono_mb_emit_stloc (mb, 0);
+
+ /* if target != null */
+ mono_mb_emit_ldloc (mb, 0);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos0 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* then call this->method_ptr nonstatic */
+ mono_mb_emit_ldloc (mb, 0);
+ for (i = 0; i < sig->param_count; ++i)
+ mono_mb_emit_ldarg (mb, i + 1);
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoDelegate, method_ptr));
+ mono_mb_emit_byte (mb, CEE_LDIND_I );
+ mono_mb_emit_byte (mb, CEE_CALLI);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, sig));
+
+ mono_mb_emit_byte (mb, CEE_BR);
+ pos1 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* else [target == null] call this->method_ptr static */
+ mono_mb_patch_addr (mb, pos0, mb->pos - (pos0 + 4));
+
+ for (i = 0; i < sig->param_count; ++i)
+ mono_mb_emit_ldarg (mb, i + 1);
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoDelegate, method_ptr));
+ mono_mb_emit_byte (mb, CEE_LDIND_I );
+ mono_mb_emit_byte (mb, CEE_CALLI);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, static_sig));
+
+ /* return */
+ mono_mb_patch_addr (mb, pos1, mb->pos - (pos1 + 4));
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (cache, sig,
+ mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+/*
+ * signature_dup_add_this:
+ *
+ * Make a copy of @sig, adding an explicit this argument.
+ */
+static MonoMethodSignature*
+signature_dup_add_this (MonoMethodSignature *sig, MonoClass *klass)
+{
+ MonoMethodSignature *res;
+ int i;
+
+ res = mono_metadata_signature_alloc (klass->image, sig->param_count + 1);
+ memcpy (res, sig, sizeof (MonoMethodSignature));
+ res->param_count = sig->param_count + 1;
+ res->hasthis = FALSE;
+ for (i = sig->param_count - 1; i >= 0; i --)
+ res->params [i + 1] = sig->params [i];
+ res->params [0] = &mono_ptr_class_get (&klass->byval_arg)->byval_arg;
+
+ return res;
+}
+
+typedef struct {
+ MonoMethod *ctor;
+ MonoMethodSignature *sig;
+} CtorSigPair;
+
+
+
+/*
+ * generates IL code for the runtime invoke function
+ * MonoObject *runtime_invoke (MonoObject *this, void **params, MonoObject **exc, void* method)
+ *
+ * we also catch exceptions if exc != null
+ */
+MonoMethod *
+mono_marshal_get_runtime_invoke (MonoMethod *method)
+{
+ MonoMethodSignature *sig, *csig, *callsig;
+ MonoExceptionClause *clause;
+ MonoMethodHeader *header;
+ MonoMethodBuilder *mb;
+ GHashTable *cache = NULL;
+ MonoClass *target_klass;
+ MonoMethod *res = NULL;
+ GSList *item;
+ static MonoString *string_dummy = NULL;
+ static MonoMethodSignature *dealy_abort_sig = NULL;
+ int i, pos, posna;
+ char *name;
+
+ g_assert (method);
+
+ target_klass = method->klass;
+
+ EnterCriticalSection (&marshal_mutex);
+
+ if (method->string_ctor) {
+ static GSList *strsig_list = NULL;
+ CtorSigPair *cs;
+
+ callsig = NULL;
+ for (item = strsig_list; item; item = item->next) {
+ cs = item->data;
+ if (mono_metadata_signature_equal (method->signature, cs->ctor->signature)) {
+ callsig = cs->sig;
+ break;
+ }
+ }
+ if (!callsig) {
+ callsig = mono_metadata_signature_dup (method->signature);
+ callsig->ret = &mono_defaults.string_class->byval_arg;
+ cs = g_new (CtorSigPair, 1);
+ cs->sig = callsig;
+ cs->ctor = method;
+ strsig_list = g_slist_prepend (strsig_list, cs);
+ }
+ } else {
+ if (method->klass->valuetype && method->signature->hasthis) {
+ /*
+ * Valuetype methods receive a managed pointer as the this argument.
+ * Create a new signature to reflect this.
+ */
+ callsig = signature_dup_add_this (method->signature, method->klass);
+ }
+ else
+ callsig = method->signature;
+ }
+
+ cache = method->klass->image->runtime_invoke_cache;
+
+ /* from mono_marshal_find_in_cache */
+ res = g_hash_table_lookup (cache, callsig);
+ LeaveCriticalSection (&marshal_mutex);
+
+ if (res) {
+ return res;
+ }
+
+ if (!dealy_abort_sig) {
+ dealy_abort_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 0);
+ dealy_abort_sig->ret = &mono_defaults.void_class->byval_arg;
+ dealy_abort_sig->pinvoke = 0;
+ }
+
+ target_klass = mono_defaults.object_class;
+
+ /* to make it work with our special string constructors */
+ if (!string_dummy) {
+ MONO_GC_REGISTER_ROOT (string_dummy);
+ string_dummy = mono_string_new_wrapper ("dummy");
+ }
+
+ sig = method->signature;
+
+ csig = mono_metadata_signature_alloc (method->klass->image, 4);
+
+ csig->ret = &mono_defaults.object_class->byval_arg;
+ if (method->klass->valuetype && method->signature->hasthis)
+ csig->params [0] = callsig->params [0];
+ else
+ csig->params [0] = &mono_defaults.object_class->byval_arg;
+ csig->params [1] = &mono_defaults.int_class->byval_arg;
+ csig->params [2] = &mono_defaults.int_class->byval_arg;
+ csig->params [3] = &mono_defaults.int_class->byval_arg;
+
+ name = mono_signature_to_name (callsig, "runtime_invoke");
+ mb = mono_mb_new (target_klass, name, MONO_WRAPPER_RUNTIME_INVOKE);
+ g_free (name);
+
+ /* allocate local 0 (object) tmp */
+ mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+ /* allocate local 1 (object) exc */
+ mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+
+ /* cond set *exc to null */
+ mono_mb_emit_byte (mb, CEE_LDARG_2);
+ mono_mb_emit_byte (mb, CEE_BRFALSE_S);
+ mono_mb_emit_byte (mb, 3);
+ mono_mb_emit_byte (mb, CEE_LDARG_2);
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+
+ if (sig->hasthis) {
+ if (method->string_ctor) {
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, string_dummy));
+ } else {
+ mono_mb_emit_ldarg (mb, 0);
+ }
+ }
+
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *t = sig->params [i];
+ int type;
+
+ mono_mb_emit_ldarg (mb, 1);
+ if (i) {
+ mono_mb_emit_icon (mb, sizeof (gpointer) * i);
+ mono_mb_emit_byte (mb, CEE_ADD);
+ }
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ if (t->byref)
+ continue;
+
+ type = sig->params [i]->type;
+handle_enum:
+ switch (type) {
+ case MONO_TYPE_I1:
+ mono_mb_emit_byte (mb, CEE_LDIND_I1);
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U1:
+ mono_mb_emit_byte (mb, CEE_LDIND_U1);
+ break;
+ case MONO_TYPE_I2:
+ mono_mb_emit_byte (mb, CEE_LDIND_I2);
+ break;
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ mono_mb_emit_byte (mb, CEE_LDIND_U2);
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ break;
+ case MONO_TYPE_I4:
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ break;
+ case MONO_TYPE_U4:
+ mono_mb_emit_byte (mb, CEE_LDIND_U4);
+ break;
+ case MONO_TYPE_R4:
+ mono_mb_emit_byte (mb, CEE_LDIND_R4);
+ break;
+ case MONO_TYPE_R8:
+ mono_mb_emit_byte (mb, CEE_LDIND_R8);
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ mono_mb_emit_byte (mb, CEE_LDIND_I8);
+ break;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ /* do nothing */
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (t->data.klass->enumtype) {
+ type = t->data.klass->enum_basetype->type;
+ goto handle_enum;
+ }
+ mono_mb_emit_byte (mb, CEE_LDOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, t->data.klass));
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
+ mono_mb_emit_ldarg (mb, 3);
+ emit_thread_force_interrupt_checkpoint (mb);
+ mono_mb_emit_calli (mb, callsig);
+
+ if (sig->ret->byref) {
+ /* fixme: */
+ g_assert_not_reached ();
+ }
+
+
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ if (!method->string_ctor)
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_VALUETYPE:
+ /* box value types */
+ mono_mb_emit_byte (mb, CEE_BOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (sig->ret)));
+ break;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ /* nothing to do */
+ break;
+ case MONO_TYPE_PTR:
+ default:
+ g_assert_not_reached ();
+ }
+
+ mono_mb_emit_stloc (mb, 0);
+
+ mono_mb_emit_byte (mb, CEE_LEAVE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ clause = g_new0 (MonoExceptionClause, 1);
+ clause->flags = MONO_EXCEPTION_CLAUSE_FILTER;
+ clause->try_len = mb->pos;
+
+ /* filter code */
+ clause->data.filter_offset = mb->pos;
+
+ mono_mb_emit_byte (mb, CEE_POP);
+ mono_mb_emit_byte (mb, CEE_LDARG_2);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_CGT_UN);
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_ENDFILTER);
+
+ clause->handler_offset = mb->pos;
+
+ /* handler code */
+ /* store exception */
+ mono_mb_emit_stloc (mb, 1);
+
+ mono_mb_emit_byte (mb, CEE_LDARG_2);
+ mono_mb_emit_ldloc (mb, 1);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_stloc (mb, 0);
+
+ /* Check for the abort exception */
+ mono_mb_emit_ldloc (mb, 1);
+ mono_mb_emit_byte (mb, CEE_ISINST);
+ mono_mb_emit_i4 (mb, mono_defaults.threadabortexception_class->type_token);
+ mono_mb_emit_byte (mb, CEE_BRFALSE_S);
+ posna = mb->pos;
+ mono_mb_emit_byte (mb, 0);
+
+ /* Delay the abort exception */
+ mono_mb_emit_native_call (mb, dealy_abort_sig, ves_icall_System_Threading_Thread_ResetAbort);
+
+ mono_mb_patch_addr_s (mb, posna, mb->pos - posna - 1);
+ mono_mb_emit_byte (mb, CEE_LEAVE);
+ mono_mb_emit_i4 (mb, 0);
+
+ clause->handler_len = mb->pos - clause->handler_offset;
+
+ /* return result */
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ mono_mb_emit_ldloc (mb, 0);
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ /* taken from mono_mb_create_and_cache */
+ EnterCriticalSection (&marshal_mutex);
+
+ res = g_hash_table_lookup (cache, callsig);
+ /* Somebody may have created it before us */
+ if (!res) {
+ res = mono_mb_create_method (mb, csig, sig->param_count + 16);
+ g_hash_table_insert (cache, callsig, res);
+ mono_g_hash_table_insert (wrapper_hash, res, callsig);
+ }
+
+ LeaveCriticalSection (&marshal_mutex);
+ /* end mono_mb_create_and_cache */
+
+ mono_mb_free (mb);
+
+ header = ((MonoMethodNormal *)res)->header;
+ header->num_clauses = 1;
+ header->clauses = clause;
+
+ return res;
+}
+
+static void
+raise_auto_layout_exception (MonoClass *klass)
+{
+ char *msg = g_strdup_printf ("The type `%s.%s' layout needs to be Sequential or Explicit",
+ klass->name_space, klass->name);
+
+ MonoException *e = mono_exception_from_name_msg (
+ mono_get_corlib (), "System.Runtime.InteropServices",
+ "MarshalDirectiveException", msg);
+ g_free (msg);
+ mono_raise_exception (e);
+}
+
+/*
+ * generates IL code to call managed methods from unmanaged code
+ */
+MonoMethod *
+mono_marshal_get_managed_wrapper (MonoMethod *method, MonoObject *this, MonoMarshalSpec **mspecs)
+{
+ MonoMethodSignature *sig, *csig;
+ MonoMethodBuilder *mb;
+ MonoClass *klass = NULL;
+ MonoMethod *res;
+ GHashTable *cache;
+ int i, pos = 0, *tmp_locals;
+ static MonoMethodSignature *alloc_sig = NULL;
+ int retobj_var = 0;
+
+ g_assert (method != NULL);
+ g_assert (!method->signature->pinvoke);
+
+ cache = method->klass->image->managed_wrapper_cache;
+ if (!this && (res = mono_marshal_find_in_cache (cache, method)))
+ return res;
+
+ /* Under MS, the allocation should be done using CoTaskMemAlloc */
+ if (!alloc_sig) {
+ alloc_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1);
+ alloc_sig->params [0] = &mono_defaults.int_class->byval_arg;
+ alloc_sig->ret = &mono_defaults.int_class->byval_arg;
+ alloc_sig->pinvoke = 1;
+ }
+
+ sig = method->signature;
+
+ mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_NATIVE_TO_MANAGED);
+
+ /* allocate local 0 (pointer) src_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local 1 (pointer) dst_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local 2 (boolean) delete_old */
+ mono_mb_add_local (mb, &mono_defaults.boolean_class->byval_arg);
+
+ if (!MONO_TYPE_IS_VOID(sig->ret)) {
+ /* allocate local 3 to store the return value */
+ mono_mb_add_local (mb, sig->ret);
+ }
+
+ mono_mb_emit_icon (mb, 0);
+ mono_mb_emit_byte (mb, CEE_STLOC_2);
+
+ /* we copy the signature, so that we can modify it */
+ csig = mono_metadata_signature_dup (sig);
+ csig->hasthis = 0;
+ csig->pinvoke = 1;
+
+#ifdef PLATFORM_WIN32
+ /*
+ * Under windows, delegates passed to native code must use the STDCALL
+ * calling convention.
+ */
+ csig->call_convention = MONO_CALL_STDCALL;
+#endif
+
+ /* fixme: howto handle this ? */
+ if (sig->hasthis) {
+
+ if (this) {
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, this));
+
+
+ } else {
+ /* fixme: */
+ g_assert_not_reached ();
+ }
+ }
+
+
+ /* we first do all conversions */
+ tmp_locals = alloca (sizeof (int) * sig->param_count);
+ for (i = 0; i < sig->param_count; i ++) {
+ MonoType *t = sig->params [i];
+ MonoMarshalSpec *spec = mspecs [i + 1];
+
+ tmp_locals [i] = 0;
+
+ /* Ensure that we have marshalling info for this param */
+ mono_marshal_load_type_info (mono_class_from_mono_type (t));
+
+ if (spec && spec->native == MONO_NATIVE_CUSTOM) {
+ MonoType *mtype;
+ MonoClass *mklass;
+ MonoMethod *marshal_native_to_managed;
+ MonoMethod *get_instance;
+
+ mtype = mono_reflection_type_from_name (spec->data.custom_data.custom_name, method->klass->image);
+ g_assert (mtype != NULL);
+ mklass = mono_class_from_mono_type (mtype);
+ g_assert (mklass != NULL);
+
+ marshal_native_to_managed = mono_find_method_by_name (mklass, "MarshalNativeToManaged", 1);
+ g_assert (marshal_native_to_managed);
+ get_instance = mono_find_method_by_name (mklass, "GetInstance", 1);
+ g_assert (get_instance);
+
+ switch (t->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ if (t->byref)
+ break;
+
+ tmp_locals [i] = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+
+ mono_mb_emit_ldstr (mb, g_strdup (spec->data.custom_data.cookie));
+
+ mono_mb_emit_byte (mb, CEE_CALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, get_instance));
+
+ mono_mb_emit_ldarg (mb, i);
+
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, marshal_native_to_managed));
+
+ mono_mb_emit_stloc (mb, tmp_locals [i]);
+ break;
+ default:
+ g_warning ("custom marshalling of type %x is currently not supported", t->type);
+ g_assert_not_reached ();
+ break;
+ }
+ continue;
+ }
+
+ switch (t->type) {
+ case MONO_TYPE_CLASS: {
+ klass = t->data.klass;
+
+ tmp_locals [i] = mono_mb_add_local (mb, &klass->byval_arg);
+
+ if (klass->delegate) {
+ g_assert (!t->byref);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ mono_mb_emit_ldarg (mb, i);
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_FTN_DEL));
+ mono_mb_emit_stloc (mb, tmp_locals [i]);
+ break;
+ }
+
+ /* The class can not have an automatic layout */
+ if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+ raise_auto_layout_exception (klass);
+
+ if (t->attrs & PARAM_ATTRIBUTE_OUT) {
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ mono_mb_emit_stloc (mb, tmp_locals [i]);
+ break;
+ }
+
+ /* Set src */
+ mono_mb_emit_ldarg (mb, i);
+ if (t->byref) {
+ int pos2;
+
+ /* Check for NULL and raise an exception */
+ mono_mb_emit_byte (mb, CEE_BRTRUE);
+ pos2 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ mono_mb_emit_exception (mb, "ArgumentNullException", NULL);
+
+ mono_mb_patch_addr (mb, pos2, mb->pos - (pos2 + 4));
+ mono_mb_emit_ldarg (mb, i);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ }
+
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_stloc (mb, tmp_locals [i]);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* Create and set dst */
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_NEWOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ mono_mb_emit_stloc (mb, tmp_locals [i]);
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, TRUE);
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ break;
+ }
+ case MONO_TYPE_VALUETYPE:
+
+ klass = sig->params [i]->data.klass;
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype)
+ break;
+
+ tmp_locals [i] = mono_mb_add_local (mb, &klass->byval_arg);
+
+ if (t->attrs & PARAM_ATTRIBUTE_OUT)
+ break;
+
+ if (t->byref)
+ mono_mb_emit_ldarg (mb, i);
+ else
+ mono_mb_emit_ldarg_addr (mb, i);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ if (t->byref) {
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+ }
+
+ mono_mb_emit_ldloc_addr (mb, tmp_locals [i]);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, TRUE);
+
+ if (t->byref)
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ break;
+ case MONO_TYPE_STRING: {
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (NULL, spec);
+
+ if (t->byref)
+ continue;
+
+ tmp_locals [i] = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+ csig->params [i] = &mono_defaults.int_class->byval_arg;
+
+ mono_mb_emit_ldarg (mb, i);
+
+ switch (encoding) {
+ case MONO_NATIVE_LPWSTR:
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_LPWSTR_STR));
+ break;
+ case MONO_NATIVE_LPSTR:
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_LPSTR_STR));
+ break;
+ default: {
+ char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
+ MonoException *exc = mono_get_exception_not_implemented (msg);
+ g_warning (msg);
+ g_free (msg);
+ mono_raise_exception (exc);
+ }
+ }
+
+ mono_mb_emit_stloc (mb, tmp_locals [i]);
+ break;
+ }
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ if (t->byref)
+ continue;
+
+ klass = mono_class_from_mono_type (t);
+
+ tmp_locals [i] = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+ csig->params [i] = &mono_defaults.int_class->byval_arg;
+
+ g_warning ("array marshaling not implemented");
+ g_assert_not_reached ();
+ break;
+ }
+ }
+
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *t = sig->params [i];
+
+ switch (t->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ mono_mb_emit_ldarg (mb, i);
+ break;
+ case MONO_TYPE_STRING:
+ if (t->byref) {
+ mono_mb_emit_ldarg (mb, i);
+ } else {
+ g_assert (tmp_locals [i]);
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ }
+ break;
+ case MONO_TYPE_CLASS:
+ if (t->byref)
+ mono_mb_emit_ldloc_addr (mb, tmp_locals [i]);
+ else
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ break;
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ if (tmp_locals [i])
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ else
+ mono_mb_emit_ldarg (mb, i);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ klass = sig->params [i]->data.klass;
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype) {
+ mono_mb_emit_ldarg (mb, i);
+ break;
+ }
+
+ g_assert (tmp_locals [i]);
+ if (t->byref)
+ mono_mb_emit_ldloc_addr (mb, tmp_locals [i]);
+ else
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ break;
+ default:
+ g_warning ("type 0x%02x unknown", t->type);
+ g_assert_not_reached ();
+ }
+ }
+
+ emit_thread_interrupt_checkpoint (mb);
+ mono_mb_emit_managed_call (mb, method, NULL);
+
+ /* Ensure that we have marshalling info for the return */
+ mono_marshal_load_type_info (mono_class_from_mono_type (sig->ret));
+
+ if (mspecs [0] && mspecs [0]->native == MONO_NATIVE_CUSTOM) {
+ MonoMarshalSpec *spec = mspecs [0];
+ MonoType *mtype;
+ MonoClass *mklass;
+ guint32 loc1;
+
+ g_assert (!sig->ret->byref);
+
+ mtype = mono_reflection_type_from_name (spec->data.custom_data.custom_name, method->klass->image);
+ g_assert (mtype);
+ mklass = mono_class_from_mono_type (mtype);
+ g_assert (mklass);
+
+ loc1 = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+
+ switch (sig->ret->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_3);
+ mono_mb_emit_stloc (mb, loc1);
+
+ mono_mb_emit_ldstr (mb, g_strdup (spec->data.custom_data.cookie));
+ mono_mb_emit_byte (mb, CEE_CALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_find_method_by_name (mklass, "GetInstance", 1)));
+ mono_mb_emit_byte (mb, CEE_DUP);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_3);
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_find_method_by_name (mklass, "MarshalManagedToNative", 1)));
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ mono_mb_emit_ldloc (mb, loc1);
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_find_method_by_name (mklass, "CleanUpManagedData", 1)));
+
+ break;
+ default:
+ g_warning ("custom marshalling of type %x is currently not supported", sig->ret->type);
+ g_assert_not_reached ();
+ break;
+ }
+ }
+ else
+ if (!sig->ret->byref) {
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_OBJECT:
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ break;
+ case MONO_TYPE_STRING:
+ csig->ret = &mono_defaults.int_class->byval_arg;
+
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_STR_LPSTR));
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ klass = sig->ret->data.klass;
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype)
+ break;
+
+ /* load pointer to returned value type */
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_VTADDR);
+
+ /* store the address of the source into local variable 0 */
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ /* allocate space for the native struct and
+ * store the address into dst_ptr */
+ retobj_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ g_assert (retobj_var);
+ mono_mb_emit_icon (mb, mono_class_native_size (klass, NULL));
+ mono_mb_emit_byte (mb, CEE_CONV_I);
+ mono_mb_emit_native_call (mb, alloc_sig, mono_marshal_alloc);
+ emit_thread_interrupt_checkpoint (mb);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_stloc (mb, retobj_var);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, FALSE);
+ break;
+ case MONO_TYPE_CLASS: {
+ int pos2;
+
+ klass = sig->ret->data.klass;
+
+ if (klass->delegate) {
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_DEL_FTN));
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ break;
+ }
+
+ /* The class can not have an automatic layout */
+ if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+ raise_auto_layout_exception (klass);
+
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ /* Check for null */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ pos = mono_mb_emit_branch (mb, CEE_BRTRUE);
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ pos2 = mono_mb_emit_branch (mb, CEE_BR);
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+
+ /* Set src */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* Allocate and set dest */
+ mono_mb_emit_icon (mb, mono_class_native_size (klass, NULL));
+ mono_mb_emit_byte (mb, CEE_CONV_I);
+ mono_mb_emit_native_call (mb, alloc_sig, mono_marshal_alloc);
+ emit_thread_interrupt_checkpoint (mb);
+ mono_mb_emit_byte (mb, CEE_DUP);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ emit_struct_conv (mb, klass, FALSE);
+
+ mono_mb_patch_addr (mb, pos2, mb->pos - (pos2 + 4));
+ break;
+ }
+ default:
+ g_warning ("return type 0x%02x unknown", sig->ret->type);
+ g_assert_not_reached ();
+ }
+ } else {
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ }
+
+ /* Convert byref arguments back */
+ for (i = 0; i < sig->param_count; i ++) {
+ MonoType *t = sig->params [i];
+ MonoMarshalSpec *spec = mspecs [i + 1];
+
+ if (spec && spec->native == MONO_NATIVE_CUSTOM) {
+ MonoType *mtype;
+ MonoClass *mklass;
+ MonoMethod *cleanup_managed;
+ MonoMethod *get_instance;
+
+ mtype = mono_reflection_type_from_name (spec->data.custom_data.custom_name, method->klass->image);
+ g_assert (mtype != NULL);
+ mklass = mono_class_from_mono_type (mtype);
+ g_assert (mklass != NULL);
+
+ get_instance = mono_find_method_by_name (mklass, "GetInstance", 1);
+ g_assert (get_instance);
+ cleanup_managed = mono_find_method_by_name (mklass, "CleanUpManagedData", 1);
+ g_assert (cleanup_managed);
+
+ switch (t->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ if (t->byref)
+ g_assert_not_reached ();
+
+ /* Call CleanUpManagedData */
+
+ mono_mb_emit_ldstr (mb, g_strdup (spec->data.custom_data.cookie));
+
+ mono_mb_emit_byte (mb, CEE_CALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, get_instance));
+
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, cleanup_managed));
+
+ break;
+ default:
+ g_warning ("custom marshalling of type %x is currently not supported", t->type);
+ g_assert_not_reached ();
+ break;
+ }
+ continue;
+ }
+
+ if (!t->byref)
+ continue;
+
+ switch (t->type) {
+ case MONO_TYPE_CLASS: {
+ int pos2;
+
+ klass = t->data.klass;
+
+ /* Check for null */
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ pos = mono_mb_emit_branch (mb, CEE_BRTRUE);
+ mono_mb_emit_ldarg (mb, i);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ pos2 = mono_mb_emit_branch (mb, CEE_BR);
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+
+ /* Set src */
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* Allocate and set dest */
+ mono_mb_emit_icon (mb, mono_class_native_size (klass, NULL));
+ mono_mb_emit_byte (mb, CEE_CONV_I);
+ mono_mb_emit_native_call (mb, alloc_sig, mono_marshal_alloc);
+ emit_thread_interrupt_checkpoint (mb);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* Update argument pointer */
+ mono_mb_emit_ldarg (mb, i);
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, FALSE);
+
+ mono_mb_patch_addr (mb, pos2, mb->pos - (pos2 + 4));
+ break;
+ }
+ case MONO_TYPE_VALUETYPE: {
+ int pos2;
+
+ klass = t->data.klass;
+
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype) {
+ break;
+ }
+
+ /* Check for null */
+ mono_mb_emit_ldarg (mb, i);
+ pos2 = mono_mb_emit_branch (mb, CEE_BRFALSE);
+
+ /* Set src */
+ mono_mb_emit_ldloc_addr (mb, tmp_locals [i]);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* Set dest */
+ mono_mb_emit_ldarg (mb, i);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, FALSE);
+
+ mono_mb_patch_addr (mb, pos2, mb->pos - (pos2 + 4));
+ break;
+ }
+ }
+ }
+
+ if (retobj_var) {
+ mono_mb_emit_ldloc (mb, retobj_var);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_RETOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ }
+ else {
+ if (!MONO_TYPE_IS_VOID(sig->ret))
+ mono_mb_emit_byte (mb, CEE_LDLOC_3);
+ mono_mb_emit_byte (mb, CEE_RET);
+ }
+
+ if (!this)
+ res = mono_mb_create_and_cache (cache, method,
+ mb, csig, sig->param_count + 16);
+ else {
+ res = mono_mb_create_method (mb, csig, sig->param_count + 16);
+ res->dynamic = 1;
+ }
+ mono_mb_free (mb);
+
+ /* printf ("CODE FOR %s: \n%s.\n", mono_method_full_name (res, TRUE), mono_disasm_code (0, res, ((MonoMethodNormal*)res)->header->code, ((MonoMethodNormal*)res)->header->code + ((MonoMethodNormal*)res)->header->code_size)); */
+
+ return res;
+}
+
+/*
+ * mono_marshal_get_ldfld_wrapper:
+ * @type: the type of the field
+ *
+ * This method generates a function which can be use to load a field with type
+ * @type from an object. The generated function has the following signature:
+ * <@type> ldfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset)
+ */
+MonoMethod *
+mono_marshal_get_ldfld_wrapper (MonoType *type)
+{
+ MonoMethodSignature *sig, *csig;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ MonoClass *klass;
+ static GHashTable *ldfld_hash = NULL;
+ char *name;
+ int t, pos0, pos1 = 0;
+
+ t = type->type;
+
+ if (!type->byref) {
+ if (type->type == MONO_TYPE_SZARRAY) {
+ klass = mono_defaults.array_class;
+ } else if (type->type == MONO_TYPE_VALUETYPE) {
+ klass = type->data.klass;
+ if (klass->enumtype) {
+ t = klass->enum_basetype->type;
+ klass = mono_class_from_mono_type (klass->enum_basetype);
+ }
+ } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING ||
+ t == MONO_TYPE_CLASS) {
+ klass = mono_defaults.object_class;
+ } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) {
+ klass = mono_defaults.int_class;
+ } else {
+ klass = mono_class_from_mono_type (type);
+ }
+ } else {
+ klass = mono_defaults.int_class;
+ }
+
+ EnterCriticalSection (&marshal_mutex);
+ if (!ldfld_hash)
+ ldfld_hash = g_hash_table_new (NULL, NULL);
+ res = g_hash_table_lookup (ldfld_hash, klass);
+ LeaveCriticalSection (&marshal_mutex);
+ if (res)
+ return res;
+
+ name = g_strdup_printf ("__ldfld_wrapper_%s.%s", klass->name_space, klass->name);
+ mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_LDFLD);
+ g_free (name);
+
+ mb->method->save_lmf = 1;
+
+ sig = mono_metadata_signature_alloc (mono_defaults.corlib, 4);
+ sig->params [0] = &mono_defaults.object_class->byval_arg;
+ sig->params [1] = &mono_defaults.int_class->byval_arg;
+ sig->params [2] = &mono_defaults.int_class->byval_arg;
+ sig->params [3] = &mono_defaults.int_class->byval_arg;
+ sig->ret = &klass->byval_arg;
+
+ mono_mb_emit_ldarg (mb, 0);
+ pos0 = mono_mb_emit_proxy_check (mb, CEE_BNE_UN);
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldarg (mb, 1);
+ mono_mb_emit_ldarg (mb, 2);
+
+ csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3);
+ csig->params [0] = &mono_defaults.object_class->byval_arg;
+ csig->params [1] = &mono_defaults.int_class->byval_arg;
+ csig->params [2] = &mono_defaults.int_class->byval_arg;
+ csig->ret = &klass->this_arg;
+ csig->pinvoke = 1;
+
+ mono_mb_emit_native_call (mb, csig, mono_load_remote_field_new);
+ emit_thread_interrupt_checkpoint (mb);
+
+ if (klass->valuetype) {
+ mono_mb_emit_byte (mb, CEE_UNBOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ mono_mb_emit_byte (mb, CEE_BR);
+ pos1 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+ } else {
+ mono_mb_emit_byte (mb, CEE_RET);
+ }
+
+
+ mono_mb_patch_addr (mb, pos0, mb->pos - (pos0 + 4));
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_ldarg (mb, 3);
+ mono_mb_emit_byte (mb, CEE_ADD);
+
+ if (klass->valuetype)
+ mono_mb_patch_addr (mb, pos1, mb->pos - (pos1 + 4));
+
+ switch (t) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ mono_mb_emit_byte (mb, CEE_LDIND_I1);
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ mono_mb_emit_byte (mb, CEE_LDIND_I2);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ mono_mb_emit_byte (mb, CEE_LDIND_I8);
+ break;
+ case MONO_TYPE_R4:
+ mono_mb_emit_byte (mb, CEE_LDIND_R4);
+ break;
+ case MONO_TYPE_R8:
+ mono_mb_emit_byte (mb, CEE_LDIND_R8);
+ break;
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ g_assert (!klass->enumtype);
+ mono_mb_emit_byte (mb, CEE_LDOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ break;
+ default:
+ g_warning ("type %x not implemented", type->type);
+ g_assert_not_reached ();
+ }
+
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (ldfld_hash, klass,
+ mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+/*
+ * mono_marshal_get_stfld_wrapper:
+ * @type: the type of the field
+ *
+ * This method generates a function which can be use to store a field with type
+ * @type. The generated function has the following signature:
+ * void stfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset, <@type> val)
+ */
+MonoMethod *
+mono_marshal_get_stfld_wrapper (MonoType *type)
+{
+ MonoMethodSignature *sig, *csig;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ MonoClass *klass;
+ static GHashTable *stfld_hash = NULL;
+ char *name;
+ int t, pos;
+
+ t = type->type;
+
+ if (!type->byref) {
+ if (type->type == MONO_TYPE_SZARRAY) {
+ klass = mono_defaults.array_class;
+ } else if (type->type == MONO_TYPE_VALUETYPE) {
+ klass = type->data.klass;
+ if (klass->enumtype) {
+ t = klass->enum_basetype->type;
+ klass = mono_class_from_mono_type (klass->enum_basetype);
+ }
+ } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING ||
+ t == MONO_TYPE_CLASS) {
+ klass = mono_defaults.object_class;
+ } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) {
+ klass = mono_defaults.int_class;
+ } else {
+ klass = mono_class_from_mono_type (type);
+ }
+ } else {
+ klass = mono_defaults.int_class;
+ }
+
+ EnterCriticalSection (&marshal_mutex);
+ if (!stfld_hash)
+ stfld_hash = g_hash_table_new (NULL, NULL);
+ res = g_hash_table_lookup (stfld_hash, klass);
+ LeaveCriticalSection (&marshal_mutex);
+ if (res)
+ return res;
+
+ name = g_strdup_printf ("__stfld_wrapper_%s.%s", klass->name_space, klass->name);
+ mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_STFLD);
+ g_free (name);
+
+ mb->method->save_lmf = 1;
+
+ sig = mono_metadata_signature_alloc (mono_defaults.corlib, 5);
+ sig->params [0] = &mono_defaults.object_class->byval_arg;
+ sig->params [1] = &mono_defaults.int_class->byval_arg;
+ sig->params [2] = &mono_defaults.int_class->byval_arg;
+ sig->params [3] = &mono_defaults.int_class->byval_arg;
+ sig->params [4] = &klass->byval_arg;
+ sig->ret = &mono_defaults.void_class->byval_arg;
+
+ mono_mb_emit_ldarg (mb, 0);
+ pos = mono_mb_emit_proxy_check (mb, CEE_BNE_UN);
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldarg (mb, 1);
+ mono_mb_emit_ldarg (mb, 2);
+ mono_mb_emit_ldarg (mb, 4);
+
+ if (klass->valuetype) {
+ mono_mb_emit_byte (mb, CEE_BOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ }
+
+ csig = mono_metadata_signature_alloc (mono_defaults.corlib, 4);
+ csig->params [0] = &mono_defaults.object_class->byval_arg;
+ csig->params [1] = &mono_defaults.int_class->byval_arg;
+ csig->params [2] = &mono_defaults.int_class->byval_arg;
+ csig->params [3] = &klass->this_arg;
+ csig->ret = &mono_defaults.void_class->byval_arg;
+ csig->pinvoke = 1;
+
+ mono_mb_emit_native_call (mb, csig, mono_store_remote_field_new);
+ emit_thread_interrupt_checkpoint (mb);
+
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_ldarg (mb, 3);
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_ldarg (mb, 4);
+
+ switch (t) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ mono_mb_emit_byte (mb, CEE_STIND_I1);
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ mono_mb_emit_byte (mb, CEE_STIND_I2);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ mono_mb_emit_byte (mb, CEE_STIND_I4);
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ mono_mb_emit_byte (mb, CEE_STIND_I8);
+ break;
+ case MONO_TYPE_R4:
+ mono_mb_emit_byte (mb, CEE_STIND_R4);
+ break;
+ case MONO_TYPE_R8:
+ mono_mb_emit_byte (mb, CEE_STIND_R8);
+ break;
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ g_assert (!klass->enumtype);
+ mono_mb_emit_byte (mb, CEE_STOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ break;
+ default:
+ g_warning ("type %x not implemented", type->type);
+ g_assert_not_reached ();
+ }
+
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (stfld_hash, klass,
+ mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+/*
+ * generates IL code for the icall wrapper (the generated method
+ * calls the unmanaged code in func)
+ */
+MonoMethod *
+mono_marshal_get_icall_wrapper (MonoMethodSignature *sig, const char *name, gconstpointer func)
+{
+ MonoMethodSignature *csig;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ int i;
+
+ g_assert (sig->pinvoke);
+
+ mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_MANAGED_TO_NATIVE);
+
+ mb->method->save_lmf = 1;
+
+ /* we copy the signature, so that we can modify it */
+
+ if (sig->hasthis)
+ mono_mb_emit_byte (mb, CEE_LDARG_0);
+
+ for (i = 0; i < sig->param_count; i++)
+ mono_mb_emit_ldarg (mb, i + sig->hasthis);
+
+ mono_mb_emit_native_call (mb, sig, (gpointer) func);
+ emit_thread_interrupt_checkpoint (mb);
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ csig = mono_metadata_signature_dup (sig);
+ csig->pinvoke = 0;
+ if (csig->call_convention == MONO_CALL_VARARG)
+ csig->call_convention = 0;
+
+ res = mono_mb_create_method (mb, csig, csig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+typedef struct {
+ MonoMethodBuilder *mb;
+ MonoMethodPInvoke *piinfo;
+ int *orig_conv_args; /* Locals containing the original values of byref args */
+} EmitMarshalContext;
+
+typedef enum {
+ MARSHAL_ACTION_CONV_IN,
+ MARSHAL_ACTION_PUSH,
+ MARSHAL_ACTION_CONV_OUT,
+ MARSHAL_ACTION_CONV_RESULT
+} MarshalAction;
+
+static int
+emit_marshal_custom (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec,
+ int conv_arg, MonoType **conv_arg_type,
+ MarshalAction action)
+{
+ MonoType *mtype;
+ MonoClass *mklass;
+ MonoMethod *get_instance, *cleanup_native;
+ MonoMethod *marshal_managed_to_native, *marshal_native_to_managed;
+ MonoMethodBuilder *mb = m->mb;
+ guint32 loc1;
+
+ mtype = mono_reflection_type_from_name (spec->data.custom_data.custom_name, mb->method->klass->image);
+ g_assert (mtype != NULL);
+ mklass = mono_class_from_mono_type (mtype);
+ g_assert (mklass != NULL);
+
+ get_instance = mono_find_method_by_name (mklass, "GetInstance", 1);
+ g_assert (get_instance);
+ cleanup_native = mono_find_method_by_name (mklass, "CleanUpNativeData", 1);
+ g_assert (cleanup_native);
+ marshal_managed_to_native = mono_find_method_by_name (mklass, "MarshalManagedToNative", 1);
+ g_assert (marshal_managed_to_native);
+ marshal_native_to_managed = mono_find_method_by_name (mklass, "MarshalNativeToManaged", 1);
+ g_assert (marshal_native_to_managed);
+
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN:
+ switch (t->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_VALUETYPE:
+ if (t->byref)
+ break;
+
+ conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ mono_mb_emit_ldstr (mb, g_strdup (spec->data.custom_data.cookie));
+
+ mono_mb_emit_byte (mb, CEE_CALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, get_instance));
+
+ mono_mb_emit_ldarg (mb, argnum);
+
+ if (t->type == MONO_TYPE_VALUETYPE) {
+ /*
+ * Since we can't determine the type of the argument, we
+ * will assume the unmanaged function takes a pointer.
+ */
+ *conv_arg_type = &mono_defaults.int_class->byval_arg;
+
+ mono_mb_emit_byte (mb, CEE_BOX);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_class_from_mono_type (t)));
+ }
+
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, marshal_managed_to_native));
+ mono_mb_emit_stloc (mb, conv_arg);
+ break;
+
+ default:
+ g_warning ("custom marshalling of type %x is currently not supported", t->type);
+ g_assert_not_reached ();
+ break;
+ }
+
+ break;
+
+ case MARSHAL_ACTION_CONV_OUT:
+ switch (t->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_VALUETYPE:
+ mono_mb_emit_ldstr (mb, g_strdup (spec->data.custom_data.cookie));
+
+ mono_mb_emit_byte (mb, CEE_CALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, get_instance));
+
+ mono_mb_emit_ldloc (mb, conv_arg);
+
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, cleanup_native));
+
+ break;
+
+ default:
+ g_warning ("custom marshalling of type %x is currently not supported", t->type);
+ g_assert_not_reached ();
+ break;
+ }
+ break;
+
+ case MARSHAL_ACTION_PUSH:
+ mono_mb_emit_ldloc (mb, conv_arg);
+ break;
+
+ case MARSHAL_ACTION_CONV_RESULT:
+ loc1 = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ switch (t->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_3);
+ mono_mb_emit_stloc (mb, loc1);
+
+ mono_mb_emit_ldstr (mb, g_strdup (spec->data.custom_data.cookie));
+
+ mono_mb_emit_byte (mb, CEE_CALL);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, get_instance));
+ mono_mb_emit_byte (mb, CEE_DUP);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_3);
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, marshal_native_to_managed));
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ mono_mb_emit_ldloc (mb, loc1);
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, cleanup_native));
+
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return conv_arg;
+}
+
+static int
+emit_marshal_asany (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec,
+ int conv_arg, MonoType **conv_arg_type,
+ MarshalAction action)
+{
+ MonoMethodBuilder *mb = m->mb;
+
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN: {
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (m->piinfo, NULL);
+
+ g_assert (t->type == MONO_TYPE_OBJECT);
+ g_assert (!t->byref);
+
+ conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_icon (mb, encoding);
+ mono_mb_emit_icall (mb, mono_marshal_asany);
+ mono_mb_emit_stloc (mb, conv_arg);
+ break;
+ }
+
+ case MARSHAL_ACTION_PUSH:
+ mono_mb_emit_ldloc (mb, conv_arg);
+ break;
+
+ case MARSHAL_ACTION_CONV_OUT: {
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (m->piinfo, NULL);
+
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_icon (mb, encoding);
+ mono_mb_emit_icall (mb, mono_marshal_free_asany);
+ break;
+ }
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return conv_arg;
+}
+
+static int
+emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec,
+ int conv_arg, MonoType **conv_arg_type,
+ MarshalAction action)
+{
+ MonoMethodBuilder *mb = m->mb;
+ MonoClass *klass;
+ int pos = 0;
+
+ klass = t->data.klass;
+
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN:
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype)
+ break;
+
+ conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ /* store the address of the source into local variable 0 */
+ if (t->byref)
+ mono_mb_emit_ldarg (mb, argnum);
+ else
+ mono_mb_emit_ldarg_addr (mb, argnum);
+
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* allocate space for the native struct and
+ * store the address into local variable 1 (dest) */
+ mono_mb_emit_icon (mb, mono_class_native_size (klass, NULL));
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LOCALLOC);
+ mono_mb_emit_stloc (mb, conv_arg);
+
+ if (t->byref) {
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+ }
+
+ /* set dst_ptr */
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, FALSE);
+
+ if (t->byref)
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ break;
+
+ case MARSHAL_ACTION_PUSH:
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype) {
+ mono_mb_emit_ldarg (mb, argnum);
+ break;
+ }
+ mono_mb_emit_ldloc (mb, conv_arg);
+ if (!t->byref) {
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDNATIVEOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ }
+ break;
+
+ case MARSHAL_ACTION_CONV_OUT:
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype)
+ break;
+
+ if (t->byref) {
+ /* dst = argument */
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* src = tmp_locals [i] */
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, TRUE);
+ }
+
+ emit_struct_free (mb, klass, conv_arg);
+
+ if (t->byref)
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ break;
+
+ case MARSHAL_ACTION_CONV_RESULT:
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable) {
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ break;
+ }
+ /* load pointer to returned value type */
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_VTADDR);
+ /* store the address of the source into local variable 0 */
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ /* set dst_ptr */
+ mono_mb_emit_ldloc_addr (mb, 3);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, TRUE);
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return conv_arg;
+}
+
+static int
+emit_marshal_string (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec,
+ int conv_arg, MonoType **conv_arg_type,
+ MarshalAction action)
+{
+ MonoMethodBuilder *mb = m->mb;
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (m->piinfo, spec);
+ MonoMarshalConv conv = mono_marshal_get_string_to_ptr_conv (m->piinfo, spec);
+
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN:
+ *conv_arg_type = &mono_defaults.int_class->byval_arg;
+ conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ if (t->byref) {
+ if (t->attrs & PARAM_ATTRIBUTE_OUT)
+ break;
+
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ } else {
+ mono_mb_emit_ldarg (mb, argnum);
+ }
+
+ if (conv == -1) {
+ char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding);
+ MonoException *exc = mono_get_exception_not_implemented (msg);
+ g_warning (msg);
+ g_free (msg);
+ mono_raise_exception (exc);
+ }
+ else
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+
+ mono_mb_emit_stloc (mb, conv_arg);
+ break;
+
+ case MARSHAL_ACTION_CONV_OUT:
+ if (t->byref && (t->attrs & PARAM_ATTRIBUTE_OUT)) {
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_LPSTR_STR));
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ } else {
+ if (mono_marshal_need_free (t, m->piinfo, spec)) {
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_icall (mb, mono_marshal_free);
+ }
+ }
+ break;
+
+ case MARSHAL_ACTION_CONV_RESULT:
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+
+ if (spec) {
+ switch (spec->native) {
+ case MONO_NATIVE_LPWSTR:
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_LPWSTR_STR));
+ break;
+ default:
+ g_warning ("marshalling conversion not implemented");
+ g_assert_not_reached ();
+ }
+ } else {
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_LPSTR_STR));
+ }
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ /* free the string */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_icall (mb, g_free);
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return conv_arg;
+}
+
+static int
+emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec,
+ int conv_arg, MonoType **conv_arg_type,
+ MarshalAction action)
+{
+ MonoMethodBuilder *mb = m->mb;
+ MonoClass *klass = t->data.klass;
+ int pos, pos2, loc;
+
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN:
+ *conv_arg_type = &mono_defaults.int_class->byval_arg;
+ conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ m->orig_conv_args [argnum] = 0;
+
+ if (klass->delegate) {
+ g_assert (!t->byref);
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_DEL_FTN));
+ mono_mb_emit_stloc (mb, conv_arg);
+ } else if (klass == mono_defaults.stringbuilder_class) {
+ MonoMarshalNative encoding = mono_marshal_get_string_encoding (m->piinfo, spec);
+ MonoMarshalConv conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec);
+
+ g_assert (!t->byref);
+ mono_mb_emit_ldarg (mb, argnum);
+
+ if (conv != -1)
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+ else {
+ char *msg = g_strdup_printf ("stringbuilder marshalling conversion %d not implemented", encoding);
+ MonoException *exc = mono_get_exception_not_implemented (msg);
+ g_warning (msg);
+ g_free (msg);
+ mono_raise_exception (exc);
+ }
+
+ mono_mb_emit_stloc (mb, conv_arg);
+ } else if (klass->blittable) {
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_stloc (mb, conv_arg);
+ break;
+ } else {
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ mono_mb_emit_stloc (mb, conv_arg);
+
+ if (t->byref) {
+ /* we dont need any conversions for out parameters */
+ if (t->attrs & PARAM_ATTRIBUTE_OUT)
+ break;
+
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ } else {
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ }
+
+ /* store the address of the source into local variable 0 */
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* allocate space for the native struct and store the address */
+ mono_mb_emit_icon (mb, mono_class_native_size (klass, NULL));
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LOCALLOC);
+ mono_mb_emit_stloc (mb, conv_arg);
+
+ if (t->byref) {
+ /* Need to store the original buffer so we can free it later */
+ m->orig_conv_args [argnum] = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_stloc (mb, m->orig_conv_args [argnum]);
+ }
+
+ /* set the src_ptr */
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* set dst_ptr */
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, klass, FALSE);
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ }
+ break;
+
+ case MARSHAL_ACTION_CONV_OUT:
+ if (klass == mono_defaults.stringbuilder_class) {
+ gboolean need_free;
+ MonoMarshalNative encoding;
+ MonoMarshalConv conv;
+
+ encoding = mono_marshal_get_string_encoding (m->piinfo, spec);
+ conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free);
+
+ g_assert (!t->byref);
+ g_assert (encoding != -1);
+
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_ldloc (mb, conv_arg);
+
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+
+ if (need_free) {
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_icall (mb, mono_marshal_free);
+ }
+ break;
+ }
+
+ if (klass->delegate)
+ break;
+
+ if (t->byref && (t->attrs & PARAM_ATTRIBUTE_OUT)) {
+ /* allocate a new object */
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_NEWOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, t->data.klass));
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ }
+
+ /* dst = *argument */
+ mono_mb_emit_ldarg (mb, argnum);
+
+ if (t->byref)
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ if (t->byref || (t->attrs & PARAM_ATTRIBUTE_OUT)) {
+ mono_mb_emit_byte (mb, CEE_LDLOC_1);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* src = tmp_locals [i] */
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, t->data.klass, TRUE);
+
+ /* Free the structure returned by the native code */
+ emit_struct_free (mb, klass, conv_arg);
+
+ if (m->orig_conv_args [argnum]) {
+ /*
+ * If the native function changed the pointer, then free
+ * the original structure plus the new pointer.
+ */
+ mono_mb_emit_ldloc (mb, m->orig_conv_args [argnum]);
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_byte (mb, CEE_BEQ);
+ pos2 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ if (!(t->attrs & PARAM_ATTRIBUTE_OUT)) {
+ g_assert (m->orig_conv_args [argnum]);
+
+ emit_struct_free (mb, klass, m->orig_conv_args [argnum]);
+ }
+
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_icall (mb, g_free);
+
+ mono_mb_patch_addr (mb, pos2, mb->pos - (pos2 + 4));
+ }
+ }
+ else
+ /* Free the original structure passed to native code */
+ emit_struct_free (mb, klass, conv_arg);
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ break;
+
+ case MARSHAL_ACTION_CONV_RESULT:
+ if (klass->delegate) {
+ g_assert (!t->byref);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_FTN_DEL));
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ } else {
+ /* set src */
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* Make a copy since emit_conv modifies local 0 */
+ loc = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_stloc (mb, loc);
+
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_0);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* allocate result object */
+
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_NEWOBJ);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ /* set dst */
+
+ mono_mb_emit_byte (mb, CEE_LDLOC_3);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_OBJADDR);
+ mono_mb_emit_icon (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit conversion code */
+ emit_struct_conv (mb, klass, TRUE);
+
+ emit_struct_free (mb, klass, loc);
+
+ /* Free the pointer allocated by unmanaged code */
+ mono_mb_emit_ldloc (mb, loc);
+ mono_mb_emit_icall (mb, g_free);
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ }
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return conv_arg;
+}
+
+static int
+emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec,
+ int conv_arg, MonoType **conv_arg_type,
+ MarshalAction action)
+{
+ MonoMethodBuilder *mb = m->mb;
+ MonoClass *klass = mono_class_from_mono_type (t);
+ gboolean need_convert, need_free;
+
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN:
+ *conv_arg_type = &mono_defaults.int_class->byval_arg;
+ conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ if (klass->element_class->blittable) {
+ mono_mb_emit_ldarg (mb, argnum);
+ if (t->byref)
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_ARRAY_LPARRAY));
+ mono_mb_emit_stloc (mb, conv_arg);
+ }
+ else {
+ MonoClass *eklass;
+ guint32 label1, label2, label3;
+ int index_var, src_var, dest_ptr, esize;
+ MonoMarshalNative encoding;
+ MonoMarshalConv conv;
+ gboolean is_string = FALSE;
+
+ dest_ptr = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ eklass = klass->element_class;
+
+ encoding = mono_marshal_get_string_encoding (m->piinfo, spec);
+ if (eklass == mono_defaults.string_class) {
+ is_string = TRUE;
+ conv = mono_marshal_get_string_to_ptr_conv (m->piinfo, spec);
+ }
+ else if (eklass == mono_defaults.stringbuilder_class) {
+ is_string = TRUE;
+ conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec);
+ }
+ else
+ conv = -1;
+
+ src_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ mono_mb_emit_ldarg (mb, argnum);
+ if (t->byref)
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_stloc (mb, src_var);
+
+ /* Check null */
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_stloc (mb, conv_arg);
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ label1 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ if (is_string) {
+ if (conv == -1) {
+ char *msg = g_strdup_printf ("string/stringbuilder marshalling conversion %d not implemented", encoding);
+ MonoException *exc = mono_get_exception_not_implemented (msg);
+ g_warning (msg);
+ g_free (msg);
+ mono_raise_exception (exc);
+ }
+ }
+
+ if (is_string)
+ esize = sizeof (gpointer);
+ else
+ esize = mono_class_native_size (eklass, NULL);
+
+ /* allocate space for the native struct and store the address */
+ mono_mb_emit_icon (mb, esize);
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_byte (mb, CEE_LDLEN);
+
+ if (eklass == mono_defaults.string_class) {
+ /* Make the array bigger for the terminating null */
+ mono_mb_emit_byte (mb, CEE_LDC_I4_1);
+ mono_mb_emit_byte (mb, CEE_ADD);
+ }
+ mono_mb_emit_byte (mb, CEE_MUL);
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LOCALLOC);
+ mono_mb_emit_stloc (mb, conv_arg);
+
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_stloc (mb, dest_ptr);
+
+ /* Emit marshalling loop */
+ index_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_stloc (mb, index_var);
+ label2 = mb->pos;
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_byte (mb, CEE_LDLEN);
+ mono_mb_emit_byte (mb, CEE_BGE);
+ label3 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* Emit marshalling code */
+
+ if (is_string) {
+ mono_mb_emit_ldloc (mb, dest_ptr);
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_byte (mb, CEE_LDELEM_REF);
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+ mono_mb_emit_byte (mb, CEE_STIND_I);
+ }
+ else {
+ /* set the src_ptr */
+ mono_mb_emit_ldloc (mb, src_var);
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_byte (mb, CEE_LDELEMA);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, eklass));
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* set dst_ptr */
+ mono_mb_emit_ldloc (mb, dest_ptr);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, eklass, FALSE);
+ }
+
+ mono_mb_emit_add_to_local (mb, index_var, 1);
+ mono_mb_emit_add_to_local (mb, dest_ptr, esize);
+
+ mono_mb_emit_byte (mb, CEE_BR);
+ mono_mb_emit_i4 (mb, label2 - (mb->pos + 4));
+
+ mono_mb_patch_addr (mb, label3, mb->pos - (label3 + 4));
+
+ if (eklass == mono_defaults.string_class) {
+ /* Null terminate */
+ mono_mb_emit_ldloc (mb, dest_ptr);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_byte (mb, CEE_STIND_REF);
+ }
+
+ mono_mb_patch_addr (mb, label1, mb->pos - (label1 + 4));
+ }
+
+ break;
+
+ case MARSHAL_ACTION_CONV_OUT:
+ /* Character arrays are implicitly marshalled as [Out] */
+ need_convert = (klass->element_class == mono_defaults.char_class) || (klass->element_class == mono_defaults.stringbuilder_class) || (t->attrs & PARAM_ATTRIBUTE_OUT);
+ need_free = mono_marshal_need_free (&klass->element_class->byval_arg,
+ m->piinfo, spec);
+
+ if (need_convert || need_free) {
+ /* FIXME: Optimize blittable case */
+ MonoClass *eklass;
+ guint32 label1, label2, label3;
+ int index_var, src_ptr, loc, esize;
+
+ eklass = klass->element_class;
+ if ((eklass == mono_defaults.stringbuilder_class) || (eklass == mono_defaults.string_class))
+ esize = sizeof (gpointer);
+ else
+ esize = mono_class_native_size (eklass, NULL);
+ src_ptr = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ loc = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ /* Check null */
+ mono_mb_emit_ldarg (mb, argnum);
+ if (t->byref)
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_byte (mb, CEE_BRFALSE);
+ label1 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_stloc (mb, src_ptr);
+
+ /* Emit marshalling loop */
+ index_var = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ mono_mb_emit_byte (mb, CEE_LDC_I4_0);
+ mono_mb_emit_stloc (mb, index_var);
+ label2 = mb->pos;
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_ldarg (mb, argnum);
+ if (t->byref)
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_byte (mb, CEE_LDLEN);
+ mono_mb_emit_byte (mb, CEE_BGE);
+ label3 = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ /* Emit marshalling code */
+
+ if (eklass == mono_defaults.stringbuilder_class) {
+ gboolean need_free2;
+ MonoMarshalConv conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free2);
+
+ g_assert (conv != -1);
+
+ /* dest */
+ mono_mb_emit_ldarg (mb, argnum);
+ if (t->byref)
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_byte (mb, CEE_LDELEM_REF);
+
+ /* src */
+ mono_mb_emit_ldloc (mb, src_ptr);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ mono_mb_emit_icall (mb, conv_to_icall (conv));
+
+ if (need_free) {
+ /* src */
+ mono_mb_emit_ldloc (mb, src_ptr);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ mono_mb_emit_icall (mb, mono_marshal_free);
+ }
+ }
+ else if (eklass == mono_defaults.string_class) {
+ if (need_free) {
+ /* src */
+ mono_mb_emit_ldloc (mb, src_ptr);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ mono_mb_emit_icall (mb, mono_marshal_free);
+ }
+ }
+ else {
+ if (need_convert) {
+ /* set the src_ptr */
+ mono_mb_emit_ldloc (mb, src_ptr);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* set dst_ptr */
+ mono_mb_emit_ldarg (mb, argnum);
+ if (t->byref)
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_ldloc (mb, index_var);
+ mono_mb_emit_byte (mb, CEE_LDELEMA);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, eklass));
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ /* emit valuetype conversion code */
+ emit_struct_conv (mb, eklass, TRUE);
+ }
+
+ if (need_free) {
+ mono_mb_emit_ldloc (mb, src_ptr);
+ mono_mb_emit_stloc (mb, loc);
+ mono_mb_emit_ldloc (mb, loc);
+
+ emit_struct_free (mb, eklass, loc);
+ }
+ }
+
+ mono_mb_emit_add_to_local (mb, index_var, 1);
+ mono_mb_emit_add_to_local (mb, src_ptr, esize);
+
+ mono_mb_emit_byte (mb, CEE_BR);
+ mono_mb_emit_i4 (mb, label2 - (mb->pos + 4));
+
+ mono_mb_patch_addr (mb, label1, mb->pos - (label1 + 4));
+ mono_mb_patch_addr (mb, label3, mb->pos - (label3 + 4));
+ }
+ break;
+
+ case MARSHAL_ACTION_CONV_RESULT:
+ /* fixme: we need conversions here */
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return conv_arg;
+}
+
+static int
+emit_marshal_boolean (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec,
+ int conv_arg, MonoType **conv_arg_type,
+ MarshalAction action)
+{
+ MonoMethodBuilder *mb = m->mb;
+
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN: {
+ MonoType *local_type;
+ int variant_bool = 0;
+ if (!t->byref)
+ break;
+ if (spec == NULL) {
+ local_type = &mono_defaults.int32_class->byval_arg;
+ } else {
+ switch (spec->native) {
+ case MONO_NATIVE_I1:
+ local_type = &mono_defaults.byte_class->byval_arg;
+ break;
+ case MONO_NATIVE_VARIANTBOOL:
+ local_type = &mono_defaults.int16_class->byval_arg;
+ variant_bool = 1;
+ break;
+ default:
+ g_warning ("marshalling bool as native type %x is currently not supported", spec->native);
+ local_type = &mono_defaults.int32_class->byval_arg;
+ break;
+ }
+ }
+ *conv_arg_type = &mono_defaults.int_class->byval_arg;
+ conv_arg = mono_mb_add_local (mb, local_type);
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, CEE_LDIND_I1);
+ if (variant_bool)
+ mono_mb_emit_byte (mb, CEE_NEG);
+ mono_mb_emit_stloc (mb, conv_arg);
+ break;
+ }
+
+ case MARSHAL_ACTION_CONV_RESULT:
+ /* maybe we need to make sure that it fits within 8 bits */
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+
+ return conv_arg;
+}
+
+static int
+emit_marshal (EmitMarshalContext *m, int argnum, MonoType *t,
+ MonoMarshalSpec *spec, int conv_arg,
+ MonoType **conv_arg_type, MarshalAction action)
+{
+ /* Ensure that we have marshalling info for this param */
+ mono_marshal_load_type_info (mono_class_from_mono_type (t));
+
+ if (spec && spec->native == MONO_NATIVE_CUSTOM)
+ return emit_marshal_custom (m, argnum, t, spec, conv_arg, conv_arg_type, action);
+
+ if (spec && spec->native == MONO_NATIVE_ASANY)
+ return emit_marshal_asany (m, argnum, t, spec, conv_arg, conv_arg_type, action);
+
+ switch (t->type) {
+ case MONO_TYPE_VALUETYPE:
+ return emit_marshal_vtype (m, argnum, t, spec, conv_arg, conv_arg_type, action);
+ case MONO_TYPE_STRING:
+ return emit_marshal_string (m, argnum, t, spec, conv_arg, conv_arg_type, action);
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ return emit_marshal_object (m, argnum, t, spec, conv_arg, conv_arg_type, action);
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ return emit_marshal_array (m, argnum, t, spec, conv_arg, conv_arg_type, action);
+ case MONO_TYPE_BOOLEAN:
+ return emit_marshal_boolean (m, argnum, t, spec, conv_arg, conv_arg_type, action);
+ }
+
+ return conv_arg;
+}
+
+/**
+ * mono_marshal_get_native_wrapper:
+ * @method: The MonoMethod to wrap.
+ *
+ * generates IL code for the pinvoke wrapper (the generated method
+ * calls the unmanaged code in piinfo->addr)
+ */
+MonoMethod *
+mono_marshal_get_native_wrapper (MonoMethod *method)
+{
+ EmitMarshalContext m;
+ MonoMethodSignature *sig, *csig;
+ MonoMethodPInvoke *piinfo = (MonoMethodPInvoke *) method;
+ MonoMethodBuilder *mb;
+ MonoMarshalSpec **mspecs;
+ MonoMethod *res;
+ GHashTable *cache;
+ MonoClass *klass;
+ gboolean pinvoke = FALSE;
+ int i, argnum, *tmp_locals;
+ int type;
+ const char *exc_class = "MissingMethodException";
+ const char *exc_arg = NULL;
+
+ g_assert (method != NULL);
+ g_assert (method->signature->pinvoke);
+
+ cache = method->klass->image->native_wrapper_cache;
+ if ((res = mono_marshal_find_in_cache (cache, method)))
+ return res;
+
+ sig = method->signature;
+
+ if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) &&
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ pinvoke = TRUE;
+
+ if (!piinfo->addr) {
+ if (pinvoke)
+ mono_lookup_pinvoke_call (method, &exc_class, &exc_arg);
+ else
+ piinfo->addr = mono_lookup_internal_call (method);
+ }
+
+ mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_MANAGED_TO_NATIVE);
+
+ mb->method->save_lmf = 1;
+
+ if (!piinfo->addr) {
+ mono_mb_emit_exception (mb, exc_class, exc_arg);
+ csig = mono_metadata_signature_dup (sig);
+ csig->pinvoke = 0;
+ res = mono_mb_create_and_cache (cache, method,
+ mb, csig, csig->param_count + 16);
+ mono_mb_free (mb);
+ return res;
+ }
+
+ m.mb = mb;
+ m.piinfo = piinfo;
+
+ /* internal calls: we simply push all arguments and call the method (no conversions) */
+ if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
+
+ /* hack - string constructors returns a value */
+ if (method->string_ctor) {
+ csig = mono_metadata_signature_dup (sig);
+ csig->ret = &mono_defaults.string_class->byval_arg;
+ } else
+ csig = sig;
+
+ if (sig->hasthis)
+ mono_mb_emit_byte (mb, CEE_LDARG_0);
+
+ for (i = 0; i < sig->param_count; i++)
+ mono_mb_emit_ldarg (mb, i + sig->hasthis);
+
+ g_assert (piinfo->addr);
+ mono_mb_emit_native_call (mb, csig, piinfo->addr);
+ emit_thread_interrupt_checkpoint (mb);
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ csig = mono_metadata_signature_dup (csig);
+ csig->pinvoke = 0;
+ res = mono_mb_create_and_cache (cache, method,
+ mb, csig, csig->param_count + 16);
+ mono_mb_free (mb);
+ return res;
+ }
+
+ g_assert (pinvoke);
+
+ mspecs = g_new (MonoMarshalSpec*, sig->param_count + 1);
+ mono_method_get_marshal_info (method, mspecs);
+
+ /* pinvoke: we need to convert the arguments if necessary */
+
+ /* we copy the signature, so that we can set pinvoke to 0 */
+ csig = mono_metadata_signature_dup (sig);
+ csig->pinvoke = 1;
+
+ /* we allocate local for use with emit_struct_conv() */
+ /* allocate local 0 (pointer) src_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local 1 (pointer) dst_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local 2 (boolean) delete_old */
+ mono_mb_add_local (mb, &mono_defaults.boolean_class->byval_arg);
+
+ /* delete_old = FALSE */
+ mono_mb_emit_icon (mb, 0);
+ mono_mb_emit_byte (mb, CEE_STLOC_2);
+
+ if (!MONO_TYPE_IS_VOID(sig->ret)) {
+ /* allocate local 3 to store the return value */
+ mono_mb_add_local (mb, sig->ret);
+ }
+
+ if (mspecs [0] && mspecs [0]->native == MONO_NATIVE_CUSTOM) {
+ /* Return type custom marshaling */
+ /*
+ * Since we can't determine the return type of the unmanaged function,
+ * we assume it returns a pointer, and pass that pointer to
+ * MarshalNativeToManaged.
+ */
+ csig->ret = &mono_defaults.int_class->byval_arg;
+ }
+
+ /* we first do all conversions */
+ tmp_locals = alloca (sizeof (int) * sig->param_count);
+ m.orig_conv_args = alloca (sizeof (int) * (sig->param_count + 1));
+
+ for (i = 0; i < sig->param_count; i ++) {
+ tmp_locals [i] = emit_marshal (&m, i + sig->hasthis, sig->params [i], mspecs [i + 1], 0, &csig->params [i], MARSHAL_ACTION_CONV_IN);
+ }
+
+ /* push all arguments */
+
+ if (sig->hasthis)
+ mono_mb_emit_byte (mb, CEE_LDARG_0);
+
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *t = sig->params [i];
+ MonoMarshalSpec *spec = mspecs [i + 1];
+
+ if (spec && ((spec->native == MONO_NATIVE_CUSTOM) || (spec->native == MONO_NATIVE_ASANY)))
+ emit_marshal (&m, i + sig->hasthis, t, spec, tmp_locals [i], NULL, MARSHAL_ACTION_PUSH);
+ else {
+ argnum = i + sig->hasthis;
+
+ switch (t->type) {
+ case MONO_TYPE_BOOLEAN:
+ if (t->byref) {
+ g_assert (tmp_locals [i]);
+ mono_mb_emit_ldloc_addr (mb, tmp_locals [i]);
+ } else
+ mono_mb_emit_ldarg (mb, argnum);
+ break;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ mono_mb_emit_ldarg (mb, argnum);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ emit_marshal (&m, i + sig->hasthis, t, spec, tmp_locals [i], NULL, MARSHAL_ACTION_PUSH);
+ break;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ g_assert (tmp_locals [i]);
+ if (t->byref)
+ mono_mb_emit_ldloc_addr (mb, tmp_locals [i]);
+ else
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ break;
+ case MONO_TYPE_CHAR:
+ /* fixme: dont know how to marshal that. We cant simply
+ * convert it to a one byte UTF8 character, because an
+ * unicode character may need more that one byte in UTF8 */
+ mono_mb_emit_ldarg (mb, argnum);
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ case MONO_TYPE_FNPTR:
+ default:
+ g_warning ("type 0x%02x unknown", t->type);
+ g_assert_not_reached ();
+ }
+ }
+ }
+
+ /* call the native method */
+ mono_mb_emit_native_call (mb, csig, piinfo->addr);
+
+ /* Set LastError if needed */
+ if (piinfo->piflags & PINVOKE_ATTRIBUTE_SUPPORTS_LAST_ERROR) {
+ MonoMethodSignature *lasterr_sig;
+
+ lasterr_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 0);
+ lasterr_sig->ret = &mono_defaults.void_class->byval_arg;
+ lasterr_sig->pinvoke = 1;
+
+ mono_mb_emit_native_call (mb, lasterr_sig, mono_marshal_set_last_error);
+ }
+
+ /* convert the result */
+ if (!sig->ret->byref) {
+ MonoMarshalSpec *spec = mspecs [0];
+ type = sig->ret->type;
+
+ if (spec && spec->native == MONO_NATIVE_CUSTOM) {
+ emit_marshal (&m, 0, sig->ret, spec, 0, NULL, MARSHAL_ACTION_CONV_RESULT);
+ } else {
+
+ handle_enum:
+ switch (type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ /* no conversions necessary */
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ klass = sig->ret->data.klass;
+ if (klass->enumtype) {
+ type = sig->ret->data.klass->enum_basetype->type;
+ goto handle_enum;
+ }
+ emit_marshal (&m, 0, sig->ret, spec, 0, NULL, MARSHAL_ACTION_CONV_RESULT);
+ break;
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ emit_marshal (&m, 0, sig->ret, spec, 0, NULL, MARSHAL_ACTION_CONV_RESULT);
+ break;
+ case MONO_TYPE_CHAR:
+ /* fixme: we need conversions here */
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ case MONO_TYPE_FNPTR:
+ default:
+ g_warning ("return type 0x%02x unknown", sig->ret->type);
+ g_assert_not_reached ();
+ }
+ }
+ } else {
+ mono_mb_emit_byte (mb, CEE_STLOC_3);
+ }
+
+ /*
+ * Need to call this after converting the result since MONO_VTADDR needs
+ * to be adjacent to the call instruction.
+ */
+ emit_thread_interrupt_checkpoint (mb);
+
+ /* we need to convert byref arguments back and free string arrays */
+ for (i = 0; i < sig->param_count; i++) {
+ MonoType *t = sig->params [i];
+ MonoMarshalSpec *spec = mspecs [i + 1];
+
+ argnum = i + sig->hasthis;
+
+ if (spec && ((spec->native == MONO_NATIVE_CUSTOM) || (spec->native == MONO_NATIVE_ASANY))) {
+ emit_marshal (&m, argnum, t, spec, tmp_locals [i], NULL, MARSHAL_ACTION_CONV_OUT);
+ continue;
+ }
+
+ switch (t->type) {
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ emit_marshal (&m, argnum, t, spec, tmp_locals [i], NULL, MARSHAL_ACTION_CONV_OUT);
+ break;
+ case MONO_TYPE_BOOLEAN:
+ if (!t->byref)
+ continue;
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_ldloc (mb, tmp_locals [i]);
+ if (mspecs [i + 1] != NULL && mspecs [i + 1]->native == MONO_NATIVE_VARIANTBOOL)
+ mono_mb_emit_byte (mb, CEE_NEG);
+ mono_mb_emit_byte (mb, CEE_STIND_I1);
+ }
+ }
+
+ if (!MONO_TYPE_IS_VOID(sig->ret))
+ mono_mb_emit_byte (mb, CEE_LDLOC_3);
+
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ csig = mono_metadata_signature_dup (sig);
+ csig->pinvoke = 0;
+ res = mono_mb_create_and_cache (cache, method,
+ mb, csig, csig->param_count + 16);
+ mono_mb_free (mb);
+
+ for (i = sig->param_count; i >= 0; i--)
+ g_free (mspecs [i]);
+ g_free (mspecs);
+
+ /* printf ("CODE FOR %s: \n%s.\n", mono_method_full_name (res, TRUE), mono_disasm_code (0, res, ((MonoMethodNormal*)res)->header->code, ((MonoMethodNormal*)res)->header->code + ((MonoMethodNormal*)res)->header->code_size)); */
+
+ return res;
+}
+
+void
+mono_upgrade_remote_class_wrapper (MonoReflectionType *rtype, MonoTransparentProxy *tproxy);
+
+static MonoReflectionType *
+type_from_handle (MonoType *handle)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoClass *klass = mono_class_from_mono_type (handle);
+
+ MONO_ARCH_SAVE_REGS;
+
+ mono_class_init (klass);
+ return mono_type_get_object (domain, handle);
+}
+
+/*
+ * mono_marshal_get_isinst:
+ * @klass: the type of the field
+ *
+ * This method generates a function which can be used to check if an object is
+ * an instance of the given type, icluding the case where the object is a proxy.
+ * The generated function has the following signature:
+ * MonoObject* __isinst_wrapper_ (MonoObject *obj)
+ */
+MonoMethod *
+mono_marshal_get_isinst (MonoClass *klass)
+{
+ static MonoMethodSignature *isint_sig = NULL;
+ static GHashTable *isinst_hash = NULL;
+ MonoMethod *res;
+ int pos_was_ok, pos_failed, pos_end, pos_end2;
+ char *name;
+ MonoMethodBuilder *mb;
+
+ EnterCriticalSection (&marshal_mutex);
+ if (!isinst_hash)
+ isinst_hash = g_hash_table_new (NULL, NULL);
+
+ res = g_hash_table_lookup (isinst_hash, klass);
+ LeaveCriticalSection (&marshal_mutex);
+ if (res)
+ return res;
+
+ if (!isint_sig) {
+ isint_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1);
+ isint_sig->params [0] = &mono_defaults.object_class->byval_arg;
+ isint_sig->ret = &mono_defaults.object_class->byval_arg;
+ isint_sig->pinvoke = 0;
+ }
+
+ name = g_strdup_printf ("__isinst_wrapper_%s", klass->name);
+ mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_ISINST);
+ g_free (name);
+
+ mb->method->save_lmf = 1;
+
+ /* check if the object is a proxy that needs special cast */
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_CISINST);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+
+ /* The result of MONO_ISINST can be:
+ 0) the type check succeeded
+ 1) the type check did not succeed
+ 2) a CanCastTo call is needed */
+
+ mono_mb_emit_byte (mb, CEE_DUP);
+ pos_was_ok = mono_mb_emit_branch (mb, CEE_BRFALSE);
+
+ mono_mb_emit_byte (mb, CEE_LDC_I4_2);
+ pos_failed = mono_mb_emit_branch (mb, CEE_BNE_UN);
+
+ /* get the real proxy from the transparent proxy*/
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_managed_call (mb, mono_marshal_get_proxy_cancast (klass), NULL);
+ pos_end = mono_mb_emit_branch (mb, CEE_BR);
+
+ /* fail */
+
+ mono_mb_patch_addr (mb, pos_failed, mb->pos - (pos_failed + 4));
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ pos_end2 = mono_mb_emit_branch (mb, CEE_BR);
+
+ /* success */
+
+ mono_mb_patch_addr (mb, pos_was_ok, mb->pos - (pos_was_ok + 4));
+ mono_mb_emit_byte (mb, CEE_POP);
+ mono_mb_emit_ldarg (mb, 0);
+
+ /* the end */
+
+ mono_mb_patch_addr (mb, pos_end, mb->pos - (pos_end + 4));
+ mono_mb_patch_addr (mb, pos_end2, mb->pos - (pos_end2 + 4));
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (isinst_hash, klass, mb, isint_sig, isint_sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+/*
+ * mono_marshal_get_castclass:
+ * @klass: the type of the field
+ *
+ * This method generates a function which can be used to cast an object to
+ * an instance of the given type, icluding the case where the object is a proxy.
+ * The generated function has the following signature:
+ * MonoObject* __castclass_wrapper_ (MonoObject *obj)
+ */
+MonoMethod *
+mono_marshal_get_castclass (MonoClass *klass)
+{
+ static MonoMethodSignature *castclass_sig = NULL;
+ static GHashTable *castclass_hash = NULL;
+ MonoMethod *res;
+ int pos_was_ok, pos_was_ok2;
+ char *name;
+ MonoMethodBuilder *mb;
+
+ EnterCriticalSection (&marshal_mutex);
+ if (!castclass_hash)
+ castclass_hash = g_hash_table_new (NULL, NULL);
+
+ res = g_hash_table_lookup (castclass_hash, klass);
+ LeaveCriticalSection (&marshal_mutex);
+ if (res)
+ return res;
+
+ if (!castclass_sig) {
+ castclass_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1);
+ castclass_sig->params [0] = &mono_defaults.object_class->byval_arg;
+ castclass_sig->ret = &mono_defaults.object_class->byval_arg;
+ castclass_sig->pinvoke = 0;
+ }
+
+ name = g_strdup_printf ("__castclass_wrapper_%s", klass->name);
+ mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_CASTCLASS);
+ g_free (name);
+
+ mb->method->save_lmf = 1;
+
+ /* check if the object is a proxy that needs special cast */
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_CCASTCLASS);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, klass));
+
+ /* The result of MONO_ISINST can be:
+ 0) the cast is valid
+ 1) cast of unknown proxy type
+ or an exception if the cast is is invalid
+ */
+
+ pos_was_ok = mono_mb_emit_branch (mb, CEE_BRFALSE);
+
+ /* get the real proxy from the transparent proxy*/
+
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_managed_call (mb, mono_marshal_get_proxy_cancast (klass), NULL);
+ pos_was_ok2 = mono_mb_emit_branch (mb, CEE_BRTRUE);
+
+ /* fail */
+ mono_mb_emit_exception (mb, "InvalidCastException", NULL);
+
+ /* success */
+ mono_mb_patch_addr (mb, pos_was_ok, mb->pos - (pos_was_ok + 4));
+ mono_mb_patch_addr (mb, pos_was_ok2, mb->pos - (pos_was_ok2 + 4));
+ mono_mb_emit_ldarg (mb, 0);
+
+ /* the end */
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (castclass_hash, klass, mb, castclass_sig, castclass_sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+MonoMethod *
+mono_marshal_get_proxy_cancast (MonoClass *klass)
+{
+ static MonoMethodSignature *from_handle_sig = NULL;
+ static MonoMethodSignature *upgrade_proxy_sig = NULL;
+ static MonoMethodSignature *isint_sig = NULL;
+ static GHashTable *proxy_isinst_hash = NULL;
+ MonoMethod *res;
+ int pos_failed, pos_end;
+ char *name;
+ MonoMethod *can_cast_to;
+ MonoMethodDesc *desc;
+ MonoMethodBuilder *mb;
+
+ EnterCriticalSection (&marshal_mutex);
+ if (!proxy_isinst_hash)
+ proxy_isinst_hash = g_hash_table_new (NULL, NULL);
+
+ res = g_hash_table_lookup (proxy_isinst_hash, klass);
+ LeaveCriticalSection (&marshal_mutex);
+ if (res)
+ return res;
+
+ if (!isint_sig) {
+ upgrade_proxy_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 2);
+ upgrade_proxy_sig->params [0] = &mono_defaults.object_class->byval_arg;
+ upgrade_proxy_sig->params [1] = &mono_defaults.object_class->byval_arg;
+ upgrade_proxy_sig->ret = &mono_defaults.void_class->byval_arg;
+ upgrade_proxy_sig->pinvoke = 1;
+
+ from_handle_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1);
+ from_handle_sig->params [0] = &mono_defaults.object_class->byval_arg;
+ from_handle_sig->ret = &mono_defaults.object_class->byval_arg;
+
+ isint_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1);
+ isint_sig->params [0] = &mono_defaults.object_class->byval_arg;
+ isint_sig->ret = &mono_defaults.object_class->byval_arg;
+ isint_sig->pinvoke = 0;
+ }
+
+ name = g_strdup_printf ("__proxy_isinst_wrapper_%s", klass->name);
+ mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_PROXY_ISINST);
+ g_free (name);
+
+ mb->method->save_lmf = 1;
+
+ /* get the real proxy from the transparent proxy*/
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoTransparentProxy, rp));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ /* get the refletion type from the type handle */
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, &klass->byval_arg));
+ mono_mb_emit_native_call (mb, from_handle_sig, type_from_handle);
+
+ mono_mb_emit_ldarg (mb, 0);
+
+ /* make the call to CanCastTo (type, ob) */
+ desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", FALSE);
+ can_cast_to = mono_method_desc_search_in_class (desc, mono_defaults.iremotingtypeinfo_class);
+ g_assert (can_cast_to);
+ mono_method_desc_free (desc);
+ mono_mb_emit_byte (mb, CEE_CALLVIRT);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, can_cast_to));
+
+
+ pos_failed = mono_mb_emit_branch (mb, CEE_BRFALSE);
+
+ /* Upgrade the proxy vtable by calling: mono_upgrade_remote_class_wrapper (type, ob)*/
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, &klass->byval_arg));
+ mono_mb_emit_native_call (mb, from_handle_sig, type_from_handle);
+ mono_mb_emit_ldarg (mb, 0);
+
+ mono_mb_emit_native_call (mb, upgrade_proxy_sig, mono_upgrade_remote_class_wrapper);
+ emit_thread_interrupt_checkpoint (mb);
+
+ mono_mb_emit_ldarg (mb, 0);
+ pos_end = mono_mb_emit_branch (mb, CEE_BR);
+
+ /* fail */
+
+ mono_mb_patch_addr (mb, pos_failed, mb->pos - (pos_failed + 4));
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+
+ /* the end */
+
+ mono_mb_patch_addr (mb, pos_end, mb->pos - (pos_end + 4));
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (proxy_isinst_hash, klass, mb, isint_sig, isint_sig->param_count + 16);
+ mono_mb_free (mb);
+
+ return res;
+}
+
+void
+mono_upgrade_remote_class_wrapper (MonoReflectionType *rtype, MonoTransparentProxy *tproxy)
+{
+ MonoClass *klass;
+ klass = mono_class_from_mono_type (rtype->type);
+ mono_upgrade_remote_class (((MonoObject*)tproxy)->vtable->domain, tproxy->remote_class, klass);
+ ((MonoObject*)tproxy)->vtable = tproxy->remote_class->vtable;
+}
+
+/**
+ * mono_marshal_get_struct_to_ptr:
+ * @klass:
+ *
+ * generates IL code for StructureToPtr (object structure, IntPtr ptr, bool fDeleteOld)
+ */
+MonoMethod *
+mono_marshal_get_struct_to_ptr (MonoClass *klass)
+{
+ MonoMethodBuilder *mb;
+ static MonoMethod *stoptr = NULL;
+ MonoMethod *res;
+
+ g_assert (klass != NULL);
+
+ if (klass->str_to_ptr)
+ return klass->str_to_ptr;
+
+ if (!stoptr)
+ stoptr = mono_find_method_by_name (mono_defaults.marshal_class, "StructureToPtr", 3);
+ g_assert (stoptr);
+
+ mb = mono_mb_new (klass, stoptr->name, MONO_WRAPPER_UNKNOWN);
+
+ if (klass->blittable) {
+ mono_mb_emit_byte (mb, CEE_LDARG_1);
+ mono_mb_emit_byte (mb, CEE_LDARG_0);
+ mono_mb_emit_ldflda (mb, sizeof (MonoObject));
+ mono_mb_emit_icon (mb, mono_class_value_size (klass, NULL));
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_CPBLK);
+ } else {
+
+ /* allocate local 0 (pointer) src_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local 1 (pointer) dst_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local 2 (boolean) delete_old */
+ mono_mb_add_local (mb, &mono_defaults.boolean_class->byval_arg);
+ mono_mb_emit_byte (mb, CEE_LDARG_2);
+ mono_mb_emit_byte (mb, CEE_STLOC_2);
+
+ /* initialize src_ptr to point to the start of object data */
+ mono_mb_emit_byte (mb, CEE_LDARG_0);
+ mono_mb_emit_ldflda (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* initialize dst_ptr */
+ mono_mb_emit_byte (mb, CEE_LDARG_1);
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ emit_struct_conv (mb, klass, FALSE);
+ }
+
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_method (mb, stoptr->signature, 0);
+ mono_mb_free (mb);
+
+ klass->str_to_ptr = res;
+ return res;
+}
+
+/**
+ * mono_marshal_get_ptr_to_struct:
+ * @klass:
+ *
+ * generates IL code for PtrToStructure (IntPtr src, object structure)
+ */
+MonoMethod *
+mono_marshal_get_ptr_to_struct (MonoClass *klass)
+{
+ MonoMethodBuilder *mb;
+ static MonoMethod *ptostr = NULL;
+ MonoMethod *res;
+
+ g_assert (klass != NULL);
+
+ if (klass->ptr_to_str)
+ return klass->ptr_to_str;
+
+ if (!ptostr)
+ ptostr = mono_find_method_by_name (mono_defaults.marshal_class, "PtrToStructure", 2);
+ g_assert (ptostr);
+
+ mb = mono_mb_new (klass, ptostr->name, MONO_WRAPPER_UNKNOWN);
+
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) || klass->blittable) {
+ mono_mb_emit_byte (mb, CEE_LDARG_1);
+ mono_mb_emit_ldflda (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_LDARG_0);
+ mono_mb_emit_icon (mb, mono_class_value_size (klass, NULL));
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_CPBLK);
+ } else {
+
+ /* allocate local 0 (pointer) src_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ /* allocate local 1 (pointer) dst_ptr */
+ mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ /* initialize src_ptr to point to the start of object data */
+ mono_mb_emit_byte (mb, CEE_LDARG_0);
+ mono_mb_emit_byte (mb, CEE_STLOC_0);
+
+ /* initialize dst_ptr */
+ mono_mb_emit_byte (mb, CEE_LDARG_1);
+ mono_mb_emit_ldflda (mb, sizeof (MonoObject));
+ mono_mb_emit_byte (mb, CEE_STLOC_1);
+
+ emit_struct_conv (mb, klass, TRUE);
+ }
+
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_method (mb, ptostr->signature, 0);
+ mono_mb_free (mb);
+
+ klass->ptr_to_str = res;
+ return res;
+}
+
+/*
+ * generates IL code for the synchronized wrapper: the generated method
+ * calls METHOD while locking 'this' or the parent type.
+ */
+MonoMethod *
+mono_marshal_get_synchronized_wrapper (MonoMethod *method)
+{
+ static MonoMethodSignature *from_handle_sig = NULL;
+ static MonoMethod *enter_method, *exit_method;
+ MonoMethodSignature *sig;
+ MonoExceptionClause *clause;
+ MonoMethodHeader *header;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ GHashTable *cache;
+ int i, pos, this_local, ret_local = 0;
+
+ g_assert (method);
+
+ if (method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED)
+ return method;
+
+ cache = method->klass->image->synchronized_cache;
+ if ((res = mono_marshal_find_in_cache (cache, method)))
+ return res;
+
+ sig = signature_no_pinvoke (method->signature);
+
+ mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_SYNCHRONIZED);
+
+ /* result */
+ if (!MONO_TYPE_IS_VOID (sig->ret))
+ ret_local = mono_mb_add_local (mb, sig->ret);
+
+ /* this */
+ this_local = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
+
+ clause = g_new0 (MonoExceptionClause, 1);
+ clause->flags = MONO_EXCEPTION_CLAUSE_FINALLY;
+
+ if (!enter_method) {
+ MonoMethodDesc *desc;
+
+ desc = mono_method_desc_new ("Monitor:Enter", FALSE);
+ enter_method = mono_method_desc_search_in_class (desc, mono_defaults.monitor_class);
+ g_assert (enter_method);
+ mono_method_desc_free (desc);
+ desc = mono_method_desc_new ("Monitor:Exit", FALSE);
+ exit_method = mono_method_desc_search_in_class (desc, mono_defaults.monitor_class);
+ g_assert (exit_method);
+ mono_method_desc_free (desc);
+
+ /*
+ * GetTypeFromHandle isn't called as a managed method because it has
+ * a funky calling sequence, e.g. ldtoken+GetTypeFromHandle gets
+ * transformed into something else by the JIT.
+ */
+ from_handle_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1);
+ from_handle_sig->params [0] = &mono_defaults.object_class->byval_arg;
+ from_handle_sig->ret = &mono_defaults.object_class->byval_arg;
+ }
+
+ /* Push this or the type object */
+ if (method->flags & METHOD_ATTRIBUTE_STATIC) {
+ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
+ mono_mb_emit_byte (mb, CEE_MONO_LDPTR);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, &method->klass->byval_arg));
+ mono_mb_emit_native_call (mb, from_handle_sig, type_from_handle);
+ }
+ else
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_stloc (mb, this_local);
+
+ /* Call Monitor::Enter() */
+ mono_mb_emit_ldloc (mb, this_local);
+ mono_mb_emit_managed_call (mb, enter_method, NULL);
+
+ clause->try_offset = mb->pos;
+
+ /* Call the method */
+ if (sig->hasthis)
+ mono_mb_emit_ldarg (mb, 0);
+ for (i = 0; i < sig->param_count; i++)
+ mono_mb_emit_ldarg (mb, i + (sig->hasthis == TRUE));
+
+ /* this is needed to avoid recursion */
+ mono_mb_emit_byte (mb, CEE_PREFIX1);
+ mono_mb_emit_byte (mb, CEE_LDFTN);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, method));
+ mono_mb_emit_calli (mb, method->signature);
+
+ if (!MONO_TYPE_IS_VOID (sig->ret))
+ mono_mb_emit_stloc (mb, ret_local);
+
+ mono_mb_emit_byte (mb, CEE_LEAVE);
+ pos = mb->pos;
+ mono_mb_emit_i4 (mb, 0);
+
+ clause->try_len = mb->pos - clause->try_offset;
+ clause->handler_offset = mb->pos;
+
+ /* Call Monitor::Exit() */
+ mono_mb_emit_ldloc (mb, this_local);
+/* mono_mb_emit_native_call (mb, exit_sig, mono_monitor_exit); */
+ mono_mb_emit_managed_call (mb, exit_method, NULL);
+ mono_mb_emit_byte (mb, CEE_ENDFINALLY);
+
+ clause->handler_len = mb->pos - clause->handler_offset;
+
+ mono_mb_patch_addr (mb, pos, mb->pos - (pos + 4));
+ if (!MONO_TYPE_IS_VOID (sig->ret))
+ mono_mb_emit_ldloc (mb, ret_local);
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ res = mono_mb_create_and_cache (cache, method,
+ mb, sig, sig->param_count + 16);
+ mono_mb_free (mb);
+
+ header = ((MonoMethodNormal *)res)->header;
+ header->num_clauses = 1;
+ header->clauses = clause;
+
+ return res;
+}
+
+MonoMethod*
+mono_marshal_get_stelemref ()
+{
+ static MonoMethod* ret = NULL;
+ MonoMethodSignature *sig;
+ MonoMethodBuilder *mb;
+
+ guint32 b1, b2, b3, b4;
+ guint32 copy_pos;
+ int aklass, vklass;
+
+ if (ret)
+ return ret;
+
+ mb = mono_mb_new (mono_defaults.object_class, "stelemref", MONO_WRAPPER_STELEMREF);
+
+
+ sig = mono_metadata_signature_alloc (mono_defaults.corlib, 3);
+
+ /* void stelemref (void* array, int idx, void* value) */
+ sig->ret = &mono_defaults.void_class->byval_arg;
+ sig->params [0] = &mono_defaults.int_class->byval_arg;
+ sig->params [1] = &mono_defaults.int_class->byval_arg; /* this is a natural sized int */
+ sig->params [2] = &mono_defaults.int_class->byval_arg;
+
+ aklass = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+ vklass = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
+
+ /*
+ the method:
+ <check ABC>
+ if (!value)
+ goto store;
+
+ aklass = array->vtable->klass->element_class;
+ vklass = value->vtable->klass;
+
+ if (vklass->idepth < aklass->idepth)
+ goto long;
+
+ if (vklass->supertypes [aklass->idepth - 1] != aklass)
+ goto long;
+
+ store:
+ array [idx] = value;
+ return;
+
+ long:
+ if (mono_object_isinst (value, aklass))
+ goto store;
+
+ throw new ArrayTypeMismatchException ();
+ */
+
+ /* ABC */
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldarg (mb, 1);
+ mono_mb_emit_byte (mb, CEE_LDELEMA);
+ mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_defaults.int_class));
+ mono_mb_emit_byte (mb, CEE_POP);
+
+ /* if (!value) goto do_store */
+ mono_mb_emit_ldarg (mb, 2);
+ b1 = mono_mb_emit_branch (mb, CEE_BRFALSE);
+
+ /* aklass = array->vtable->klass->element_class */
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoObject, vtable));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoVTable, klass));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, element_class));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_stloc (mb, aklass);
+
+ /* vklass = value->vtable->klass */
+ mono_mb_emit_ldarg (mb, 2);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoObject, vtable));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoVTable, klass));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+ mono_mb_emit_stloc (mb, vklass);
+
+ /* if (vklass->idepth < aklass->idepth) goto failue */
+ mono_mb_emit_ldloc (mb, vklass);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, idepth));
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+
+ mono_mb_emit_ldloc (mb, aklass);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, idepth));
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+
+ b2 = mono_mb_emit_branch (mb, CEE_BLT_UN);
+
+ /* if (vklass->supertypes [aklass->idepth - 1] != aklass) goto failure */
+ mono_mb_emit_ldloc (mb, vklass);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, supertypes));
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ mono_mb_emit_ldloc (mb, aklass);
+ mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, idepth));
+ mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ mono_mb_emit_icon (mb, 1);
+ mono_mb_emit_byte (mb, CEE_SUB);
+ mono_mb_emit_icon (mb, sizeof (void*));
+ mono_mb_emit_byte (mb, CEE_MUL);
+ mono_mb_emit_byte (mb, CEE_ADD);
+ mono_mb_emit_byte (mb, CEE_LDIND_I);
+
+ mono_mb_emit_ldloc (mb, aklass);
+
+ b3 = mono_mb_emit_branch (mb, CEE_BNE_UN);
+
+ copy_pos = mb->pos;
+ /* do_store */
+ mono_mb_patch_addr (mb, b1, mb->pos - (b1 + 4));
+ mono_mb_emit_ldarg (mb, 0);
+ mono_mb_emit_ldarg (mb, 1);
+ mono_mb_emit_ldarg (mb, 2);
+ mono_mb_emit_byte (mb, CEE_STELEM_I);
+
+ mono_mb_emit_byte (mb, CEE_RET);
+
+ /* the hard way */
+ mono_mb_patch_addr (mb, b2, mb->pos - (b2 + 4));
+ mono_mb_patch_addr (mb, b3, mb->pos - (b3 + 4));
+
+ mono_mb_emit_ldarg (mb, 2);
+ mono_mb_emit_ldloc (mb, aklass);
+ mono_mb_emit_icall (mb, mono_object_isinst);
+
+ b4 = mono_mb_emit_branch (mb, CEE_BRTRUE);
+ mono_mb_patch_addr (mb, b4, copy_pos - (b4 + 4));
+ mono_mb_emit_exception (mb, "ArrayTypeMismatchException", NULL);
+
+ mono_mb_emit_byte (mb, CEE_RET);
+ ret = mono_mb_create_method (mb, sig, 4);
+ mono_mb_free (mb);
+ return ret;
+}
+
+void*
+mono_marshal_alloc (gulong size)
+{
+ gpointer res;
+
+#ifdef PLATFORM_WIN32
+ res = CoTaskMemAlloc (size);
+#else
+ res = g_try_malloc ((gulong)size);
+ if (!res)
+ mono_gc_out_of_memory ((gulong)size);
+#endif
+ return res;
+}
+
+void
+mono_marshal_free (gpointer ptr)
+{
+#ifdef PLATFORM_WIN32
+ CoTaskMemFree (ptr);
+#else
+ g_free (ptr);
+#endif
+}
+
+void
+mono_marshal_free_array (gpointer *ptr, int size)
+{
+ int i;
+
+ if (!ptr)
+ return;
+
+ for (i = 0; i < size; i++)
+ if (ptr [i])
+ g_free (ptr [i]);
+}
+
+void *
+mono_marshal_realloc (gpointer ptr, gpointer size)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return g_try_realloc (ptr, (gulong)size);
+}
+
+void *
+mono_marshal_string_to_utf16 (MonoString *s)
+{
+ return s ? mono_string_chars (s) : NULL;
+}
+
+/**
+ * mono_marshal_set_last_error:
+ *
+ * This function is invoked to set the last error value from a P/Invoke call
+ * which has SetLastError set.
+ */
+void
+mono_marshal_set_last_error (void)
+{
+#ifdef WIN32
+ TlsSetValue (last_error_tls_id, (gpointer)GetLastError ());
+#else
+ TlsSetValue (last_error_tls_id, (gpointer)errno);
+#endif
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (MonoArray *src, gint32 start_index,
+ gpointer dest, gint32 length)
+{
+ int element_size;
+ void *source_addr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (src);
+ MONO_CHECK_ARG_NULL (dest);
+
+ g_assert (src->obj.vtable->klass->rank == 1);
+ g_assert (start_index >= 0);
+ g_assert (length >= 0);
+ g_assert (start_index + length <= mono_array_length (src));
+
+ element_size = mono_array_element_size (src->obj.vtable->klass);
+
+ source_addr = mono_array_addr_with_size (src, element_size, start_index);
+
+ memcpy (dest, source_addr, length * element_size);
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (gpointer src, gint32 start_index,
+ MonoArray *dest, gint32 length)
+{
+ int element_size;
+ void *dest_addr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (src);
+ MONO_CHECK_ARG_NULL (dest);
+
+ g_assert (dest->obj.vtable->klass->rank == 1);
+ g_assert (start_index >= 0);
+ g_assert (length >= 0);
+ g_assert (start_index + length <= mono_array_length (dest));
+
+ element_size = mono_array_element_size (dest->obj.vtable->klass);
+
+ dest_addr = mono_array_addr_with_size (dest, element_size, start_index);
+
+ memcpy (dest_addr, src, length * element_size);
+}
+
+#if NO_UNALIGNED_ACCESS
+#define RETURN_UNALIGNED(type, addr) \
+ { \
+ type val; \
+ memcpy(&val, p + offset, sizeof(val)); \
+ return val; \
+ }
+#define WRITE_UNALIGNED(type, addr, val) \
+ memcpy(addr, &val, sizeof(type))
+#else
+#define RETURN_UNALIGNED(type, addr) \
+ return *(type*)(p + offset);
+#define WRITE_UNALIGNED(type, addr, val) \
+ (*(type *)(addr) = (val))
+#endif
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr (gpointer ptr, gint32 offset)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ RETURN_UNALIGNED(gpointer, p + offset);
+}
+
+unsigned char
+ves_icall_System_Runtime_InteropServices_Marshal_ReadByte (gpointer ptr, gint32 offset)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ return *(unsigned char*)(p + offset);
+}
+
+gint16
+ves_icall_System_Runtime_InteropServices_Marshal_ReadInt16 (gpointer ptr, gint32 offset)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ RETURN_UNALIGNED(gint16, p + offset);
+}
+
+gint32
+ves_icall_System_Runtime_InteropServices_Marshal_ReadInt32 (gpointer ptr, gint32 offset)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ RETURN_UNALIGNED(gint32, p + offset);
+}
+
+gint64
+ves_icall_System_Runtime_InteropServices_Marshal_ReadInt64 (gpointer ptr, gint32 offset)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ RETURN_UNALIGNED(gint64, p + offset);
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteByte (gpointer ptr, gint32 offset, unsigned char val)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *(unsigned char*)(p + offset) = val;
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteIntPtr (gpointer ptr, gint32 offset, gpointer val)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ WRITE_UNALIGNED(gpointer, p + offset, val);
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteInt16 (gpointer ptr, gint32 offset, gint16 val)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ WRITE_UNALIGNED(gint16, p + offset, val);
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteInt32 (gpointer ptr, gint32 offset, gint32 val)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ WRITE_UNALIGNED(gint32, p + offset, val);
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteInt64 (gpointer ptr, gint32 offset, gint64 val)
+{
+ char *p = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ WRITE_UNALIGNED(gint64, p + offset, val);
+}
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char *ptr)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (ptr == NULL)
+ return NULL;
+ else
+ return mono_string_new (mono_domain_get (), ptr);
+}
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char *ptr, gint32 len)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (ptr == NULL) {
+ mono_raise_exception (mono_get_exception_argument_null ("ptr"));
+ g_assert_not_reached ();
+ return NULL;
+ } else
+ return mono_string_new_len (mono_domain_get (), ptr, len);
+}
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni (guint16 *ptr)
+{
+ MonoDomain *domain = mono_domain_get ();
+ int len = 0;
+ guint16 *t = ptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (ptr == NULL)
+ return NULL;
+
+ while (*t++)
+ len++;
+
+ return mono_string_new_utf16 (domain, ptr, len);
+}
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni_len (guint16 *ptr, gint32 len)
+{
+ MonoDomain *domain = mono_domain_get ();
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (ptr == NULL) {
+ mono_raise_exception (mono_get_exception_argument_null ("ptr"));
+ g_assert_not_reached ();
+ return NULL;
+ } else
+ return mono_string_new_utf16 (domain, ptr, len);
+}
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringBSTR (gpointer ptr)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ g_warning ("PtrToStringBSTR not implemented");
+ g_assert_not_reached ();
+
+ return NULL;
+}
+
+guint32
+ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return ((guint32)TlsGetValue (last_error_tls_id));
+}
+
+guint32
+ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionType *rtype)
+{
+ MonoClass *klass;
+ MonoType *type;
+ guint32 layout;
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (rtype);
+
+ type = rtype->type;
+ klass = mono_class_from_mono_type (type);
+ layout = (klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK);
+
+ if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+ gchar *msg;
+ MonoException *exc;
+
+ msg = g_strdup_printf ("Type %s cannot be marshaled as an unmanaged structure.", klass->name);
+ exc = mono_get_exception_argument ("t", msg);
+ g_free (msg);
+ mono_raise_exception (exc);
+ }
+
+
+ return mono_class_native_size (klass, NULL);
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (MonoObject *obj, gpointer dst, MonoBoolean delete_old)
+{
+ MonoMethod *method;
+ gpointer pa [3];
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (obj);
+ MONO_CHECK_ARG_NULL (dst);
+
+ method = mono_marshal_get_struct_to_ptr (obj->vtable->klass);
+
+ pa [0] = obj;
+ pa [1] = &dst;
+ pa [2] = &delete_old;
+
+ mono_runtime_invoke (method, NULL, pa, NULL);
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure (gpointer src, MonoObject *dst)
+{
+ MonoMethod *method;
+ gpointer pa [2];
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (src);
+ MONO_CHECK_ARG_NULL (dst);
+
+ method = mono_marshal_get_ptr_to_struct (dst->vtable->klass);
+
+ pa [0] = &src;
+ pa [1] = dst;
+
+ mono_runtime_invoke (method, NULL, pa, NULL);
+}
+
+MonoObject *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type (gpointer src, MonoReflectionType *type)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoObject *res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (src);
+ MONO_CHECK_ARG_NULL (type);
+
+ res = mono_object_new (domain, mono_class_from_mono_type (type->type));
+
+ ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure (src, res);
+
+ return res;
+}
+
+int
+ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionType *type, MonoString *field_name)
+{
+ MonoMarshalType *info;
+ MonoClass *klass;
+ char *fname;
+ int i, match_index = -1;
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (type);
+ MONO_CHECK_ARG_NULL (field_name);
+
+ fname = mono_string_to_utf8 (field_name);
+ klass = mono_class_from_mono_type (type->type);
+
+ while (klass && match_index == -1) {
+ for (i = 0; i < klass->field.count; ++i) {
+ if (*fname == *klass->fields [i].name && strcmp (fname, klass->fields [i].name) == 0) {
+ match_index = i;
+ break;
+ }
+ }
+
+ if (match_index == -1)
+ klass = klass->parent;
+ }
+
+ g_free (fname);
+
+ if(match_index == -1) {
+ MonoException* exc;
+ gchar *tmp;
+
+ /* Get back original class instance */
+ klass = mono_class_from_mono_type (type->type);
+
+ tmp = g_strdup_printf ("Field passed in is not a marshaled member of the type %s", klass->name);
+ exc = mono_get_exception_argument ("fieldName", tmp);
+ g_free (tmp);
+
+ mono_raise_exception ((MonoException*)exc);
+ }
+
+ info = mono_marshal_load_type_info (klass);
+ return info->fields [match_index].offset;
+}
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi (MonoString *string)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_string_to_utf8 (string);
+}
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (MonoString *string)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (string == NULL)
+ return NULL;
+ else
+ return g_memdup (mono_string_chars (string), mono_string_length (string)*2);
+}
+
+static void
+mono_struct_delete_old (MonoClass *klass, char *ptr)
+{
+ MonoMarshalType *info;
+ int i;
+
+ info = mono_marshal_load_type_info (klass);
+
+ for (i = 0; i < info->num_fields; i++) {
+ MonoMarshalNative ntype;
+ MonoMarshalConv conv;
+ MonoType *ftype = info->fields [i].field->type;
+ char *cpos;
+
+ if (ftype->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+
+ ntype = mono_type_to_unmanaged (ftype, info->fields [i].mspec, TRUE,
+ klass->unicode, &conv);
+
+ cpos = ptr + info->fields [i].offset;
+
+ switch (conv) {
+ case MONO_MARSHAL_CONV_NONE:
+ if (MONO_TYPE_ISSTRUCT (ftype)) {
+ mono_struct_delete_old (ftype->data.klass, cpos);
+ continue;
+ }
+ break;
+ case MONO_MARSHAL_CONV_STR_LPWSTR:
+ case MONO_MARSHAL_CONV_STR_LPSTR:
+ case MONO_MARSHAL_CONV_STR_LPTSTR:
+ case MONO_MARSHAL_CONV_STR_BSTR:
+ case MONO_MARSHAL_CONV_STR_ANSIBSTR:
+ case MONO_MARSHAL_CONV_STR_TBSTR:
+ mono_marshal_free (*(gpointer *)cpos);
+ break;
+ default:
+ continue;
+ }
+ }
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (gpointer src, MonoReflectionType *type)
+{
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ MONO_CHECK_ARG_NULL (src);
+ MONO_CHECK_ARG_NULL (type);
+
+ klass = mono_class_from_mono_type (type->type);
+
+ mono_struct_delete_old (klass, (char *)src);
+}
+
/* FIXME: on win32 we should probably use GlobalAlloc(). */
void*
-mono_marshal_alloc (gpointer size) {
- return g_try_malloc ((gulong)size);
+ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (int size)
+{
+ gpointer res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if ((gulong)size == 0)
+ /* This returns a valid pointer for size 0 on MS.NET */
+ size = 4;
+
+ res = g_try_malloc ((gulong)size);
+ if (!res)
+ mono_gc_out_of_memory ((gulong)size);
+
+ return res;
}
void
-mono_marshal_free (gpointer ptr) {
+ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal (void *ptr)
+{
+ MONO_ARCH_SAVE_REGS;
+
g_free (ptr);
}
void*
-mono_marshal_realloc (gpointer ptr, gpointer size) {
- return g_try_realloc (ptr, (gulong)size);
+ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef PLATFORM_WIN32
+ return CoTaskMemAlloc (size);
+#else
+ return g_try_malloc ((gulong)size);
+#endif
+}
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem (void *ptr)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef PLATFORM_WIN32
+ CoTaskMemFree (ptr);
+#else
+ g_free (ptr);
+#endif
}
void*
-mono_marshal_string_array (MonoArray *array)
+ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (MonoArray *arrayobj, int index)
{
- char **result;
- int i, len;
+ return mono_array_addr_with_size (arrayobj, mono_array_element_size (arrayobj->obj.vtable->klass), index);
+}
- if (!array)
- return NULL;
+MonoDelegate*
+ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void *ftn, MonoReflectionType *type)
+{
+ return mono_ftnptr_to_delegate (mono_type_get_class (type->type), ftn);
+}
+
+MonoMarshalType *
+mono_marshal_load_type_info (MonoClass* klass)
+{
+ int i, j, count = 0, native_size = 0, min_align = 1;
+ MonoMarshalType *info;
+ guint32 layout;
+
+ g_assert (klass != NULL);
+
+ if (klass->marshal_info)
+ return klass->marshal_info;
+
+ if (!klass->inited)
+ mono_class_init (klass);
+
+ for (i = 0; i < klass->field.count; ++i) {
+ if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+ if (mono_field_is_deleted (&klass->fields [i]))
+ continue;
+ count++;
+ }
- len = mono_array_length (array);
+ layout = klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK;
- result = g_malloc (sizeof (char*) * len);
- for (i = 0; i < len; ++i) {
- MonoString *s = (MonoString*)mono_array_get (array, gpointer, i);
- result [i] = s ? mono_string_to_utf8 (s): NULL;
+ klass->marshal_info = info = g_malloc0 (sizeof (MonoMarshalType) + sizeof (MonoMarshalField) * count);
+ info->num_fields = count;
+
+ /* Try to find a size for this type in metadata */
+ mono_metadata_packing_from_typedef (klass->image, klass->type_token, NULL, &native_size);
+
+ if (klass->parent) {
+ int parent_size = mono_class_native_size (klass->parent, NULL);
+
+ /* Add parent size to real size */
+ native_size += parent_size;
+ info->native_size = parent_size;
}
- return result;
+
+ for (j = i = 0; i < klass->field.count; ++i) {
+ int size, align;
+
+ if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+
+ if (mono_field_is_deleted (&klass->fields [i]))
+ continue;
+ if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_MARSHAL)
+ mono_metadata_field_info (klass->image, klass->field.first + i,
+ NULL, NULL, &info->fields [j].mspec);
+
+ info->fields [j].field = &klass->fields [i];
+
+ if ((klass->field.count == 1) && (klass->instance_size == sizeof (MonoObject)) &&
+ (strcmp (klass->fields [i].name, "$PRIVATE$") == 0)) {
+ /* This field is a hack inserted by MCS to empty structures */
+ continue;
+ }
+
+ switch (layout) {
+ case TYPE_ATTRIBUTE_AUTO_LAYOUT:
+ case TYPE_ATTRIBUTE_SEQUENTIAL_LAYOUT:
+ size = mono_marshal_type_size (klass->fields [i].type, info->fields [j].mspec,
+ &align, TRUE, klass->unicode);
+ align = klass->packing_size ? MIN (klass->packing_size, align): align;
+ min_align = MAX (align, min_align);
+ info->fields [j].offset = info->native_size;
+ info->fields [j].offset += align - 1;
+ info->fields [j].offset &= ~(align - 1);
+ info->native_size = info->fields [j].offset + size;
+ break;
+ case TYPE_ATTRIBUTE_EXPLICIT_LAYOUT:
+ size = mono_marshal_type_size (klass->fields [i].type, info->fields [j].mspec,
+ &align, TRUE, klass->unicode);
+ align = klass->packing_size ? MIN (klass->packing_size, align): align;
+ min_align = MAX (align, min_align);
+ info->fields [j].offset = klass->fields [i].offset - sizeof (MonoObject);
+ info->native_size = MAX (info->native_size, info->fields [j].offset + size);
+ break;
+ }
+ j++;
+ }
+
+ if(layout != TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+ info->native_size = MAX (native_size, info->native_size);
+ }
+
+ if (info->native_size & (min_align - 1)) {
+ info->native_size += min_align - 1;
+ info->native_size &= ~(min_align - 1);
+ }
+
+ /* Update the class's blittable info, if the layouts don't match */
+ if (info->native_size != mono_class_value_size (klass, NULL))
+ klass->blittable = FALSE;
+
+ /* If this is an array type, ensure that we have element info */
+ if (klass->element_class) {
+ mono_marshal_load_type_info (klass->element_class);
+ }
+
+ return klass->marshal_info;
+}
+
+/**
+ * mono_class_native_size:
+ * @klass: a class
+ *
+ * Returns: the native size of an object instance (when marshaled
+ * to unmanaged code)
+ */
+gint32
+mono_class_native_size (MonoClass *klass, guint32 *align)
+{
+
+ if (!klass->marshal_info)
+ mono_marshal_load_type_info (klass);
+
+ if (align)
+ *align = klass->min_align;
+
+ return klass->marshal_info->native_size;
+}
+
+/*
+ * mono_type_native_stack_size:
+ * @t: the type to return the size it uses on the stack
+ *
+ * Returns: the number of bytes required to hold an instance of this
+ * type on the native stack
+ */
+int
+mono_type_native_stack_size (MonoType *t, gint *align)
+{
+ int tmp;
+
+ g_assert (t != NULL);
+
+ if (!align)
+ align = &tmp;
+
+ if (t->byref) {
+ *align = 4;
+ return 4;
+ }
+
+ switch (t->type){
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_TYPEDBYREF:
+ *align = 4;
+ return 4;
+ case MONO_TYPE_R4:
+ *align = 4;
+ return 4;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R8:
+ *align = 4;
+ return 8;
+ case MONO_TYPE_VALUETYPE: {
+ guint32 size;
+
+ if (t->data.klass->enumtype)
+ return mono_type_native_stack_size (t->data.klass->enum_basetype, align);
+ else {
+ size = mono_class_native_size (t->data.klass, align);
+ *align = *align + 3;
+ *align &= ~3;
+
+ size += 3;
+ size &= ~3;
+
+ return size;
+ }
+ }
+ default:
+ g_error ("type 0x%02x unknown", t->type);
+ }
+ return 0;
}
+/* __alignof__ returns the preferred alignment of values not the actual alignment used by
+ the compiler so is wrong e.g. for Linux where doubles are aligned on a 4 byte boundary
+ but __alignof__ returns 8 - using G_STRUCT_OFFSET works better */
+#define ALIGNMENT(type) G_STRUCT_OFFSET(struct { char c; type x; }, x)
+
gint32
-mono_marshal_type_size (MonoMarshalNative type, int count, gint32 *align)
+mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, gint32 *align,
+ gboolean as_field, gboolean unicode)
{
- switch (type) {
+ MonoMarshalNative native_type = mono_type_to_unmanaged (type, mspec, as_field, unicode, NULL);
+ MonoClass *klass;
+
+ switch (native_type) {
case MONO_NATIVE_BOOLEAN:
*align = 4;
return 4;
@@ -62,122 +6382,181 @@ mono_marshal_type_size (MonoMarshalNative type, int count, gint32 *align)
return 1;
case MONO_NATIVE_I2:
case MONO_NATIVE_U2:
+ case MONO_NATIVE_VARIANTBOOL:
*align = 2;
return 2;
case MONO_NATIVE_I4:
case MONO_NATIVE_U4:
+ case MONO_NATIVE_ERROR:
*align = 4;
return 4;
case MONO_NATIVE_I8:
case MONO_NATIVE_U8:
- *align = 8;
+ *align = ALIGNMENT(guint64);
return 8;
case MONO_NATIVE_R4:
*align = 4;
return 4;
case MONO_NATIVE_R8:
- *align = 8;
+ *align = ALIGNMENT(double);
return 8;
- case MONO_NATIVE_CURRENCY:
- case MONO_NATIVE_BSTR:
+ case MONO_NATIVE_INT:
+ case MONO_NATIVE_UINT:
case MONO_NATIVE_LPSTR:
case MONO_NATIVE_LPWSTR:
case MONO_NATIVE_LPTSTR:
- case MONO_NATIVE_BYVALTSTR:
+ case MONO_NATIVE_BSTR:
+ case MONO_NATIVE_ANSIBSTR:
+ case MONO_NATIVE_TBSTR:
+ case MONO_NATIVE_LPARRAY:
+ case MONO_NATIVE_SAFEARRAY:
case MONO_NATIVE_IUNKNOWN:
case MONO_NATIVE_IDISPATCH:
- case MONO_NATIVE_STRUCT:
case MONO_NATIVE_INTERFACE:
- case MONO_NATIVE_SAFEARRAY:
- case MONO_NATIVE_BYVALARRAY:
- case MONO_NATIVE_INT:
- case MONO_NATIVE_UINT:
- case MONO_NATIVE_VBBYREFSTR:
- case MONO_NATIVE_ANSIBSTR:
- case MONO_NATIVE_TBSTR:
- case MONO_NATIVE_VARIANTBOOL:
- case MONO_NATIVE_FUNC:
case MONO_NATIVE_ASANY:
- case MONO_NATIVE_ARRAY:
+ case MONO_NATIVE_FUNC:
case MONO_NATIVE_LPSTRUCT:
+ *align = ALIGNMENT(gpointer);
+ return sizeof (gpointer);
+ case MONO_NATIVE_STRUCT:
+ klass = mono_class_from_mono_type (type);
+ return mono_class_native_size (klass, align);
+ case MONO_NATIVE_BYVALTSTR: {
+ int esize = unicode ? 2: 1;
+ g_assert (mspec);
+ *align = esize;
+ return mspec->data.array_data.num_elem * esize;
+ }
+ case MONO_NATIVE_BYVALARRAY: {
+ int esize;
+ klass = mono_class_from_mono_type (type);
+ esize = mono_class_native_size (klass->element_class, align);
+ g_assert (mspec);
+ return mspec->data.array_data.num_elem * esize;
+ }
case MONO_NATIVE_CUSTOM:
- case MONO_NATIVE_ERROR:
+ g_assert_not_reached ();
+ break;
+ case MONO_NATIVE_CURRENCY:
+ case MONO_NATIVE_VBBYREFSTR:
default:
+ g_error ("native type %02x not implemented", native_type);
break;
}
g_assert_not_reached ();
return 0;
}
-guint32
-mono_type_to_unmanaged (MonoType *type) {
- int t = type->type;
- if (type->byref)
- return MONO_NATIVE_UINT;
+gpointer
+mono_marshal_asany (MonoObject *o, MonoMarshalNative string_encoding)
+{
+ MonoType *t;
+ MonoClass *klass;
-handle_enum:
- switch (t) {
- case MONO_TYPE_BOOLEAN: return MONO_NATIVE_BOOLEAN;
- case MONO_TYPE_CHAR: return MONO_NATIVE_U2;
- case MONO_TYPE_I1: return MONO_NATIVE_I1;
- case MONO_TYPE_U1: return MONO_NATIVE_U1;
- case MONO_TYPE_I2: return MONO_NATIVE_I2;
- case MONO_TYPE_U2: return MONO_NATIVE_U2;
- case MONO_TYPE_I4: return MONO_NATIVE_I4;
- case MONO_TYPE_U4: return MONO_NATIVE_U4;
- case MONO_TYPE_I8: return MONO_NATIVE_I8;
- case MONO_TYPE_U8: return MONO_NATIVE_U8;
- case MONO_TYPE_R4: return MONO_NATIVE_R4;
- case MONO_TYPE_R8: return MONO_NATIVE_R8;
- /* the default may change according to the platform... */
- case MONO_TYPE_STRING: return MONO_NATIVE_LPSTR;
- case MONO_TYPE_PTR: return MONO_NATIVE_UINT;
- case MONO_TYPE_VALUETYPE: /*FIXME*/
- if (type->data.klass->enumtype) {
- t = type->data.klass->enum_basetype->type;
- goto handle_enum;
- }
- return MONO_NATIVE_STRUCT;
- case MONO_TYPE_ARRAY: return MONO_NATIVE_ARRAY;
- case MONO_TYPE_I: return MONO_NATIVE_INT;
- case MONO_TYPE_U: return MONO_NATIVE_UINT;
- case MONO_TYPE_FNPTR: return MONO_NATIVE_FUNC;
- case MONO_TYPE_OBJECT: return MONO_NATIVE_ASANY; /* ?? */
- case MONO_TYPE_SZARRAY: return MONO_NATIVE_ARRAY;
- case MONO_TYPE_CLASS:
- /* FIXME : we need to handle ArrayList and StringBuilder here, probably */
- case MONO_TYPE_TYPEDBYREF:
- default:
- g_error ("type 0x%02x not handled in marshal", t);
+ if (o == NULL)
+ return NULL;
+
+ t = &o->vtable->klass->byval_arg;
+ switch (t->type) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ return mono_object_unbox (o);
+ break;
+ case MONO_TYPE_STRING:
+ switch (string_encoding) {
+ case MONO_NATIVE_LPWSTR:
+ return mono_string_to_utf16 ((MonoString*)o);
+ break;
+ case MONO_NATIVE_LPSTR:
+ return mono_string_to_lpstr ((MonoString*)o);
+ break;
+ default:
+ g_warning ("marshaling conversion %d not implemented", string_encoding);
+ g_assert_not_reached ();
+ }
+ break;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_VALUETYPE: {
+ MonoMethod *method;
+ gpointer pa [3];
+ gpointer res;
+ MonoBoolean delete_old = FALSE;
+
+ klass = t->data.klass;
+
+ if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
+ break;
+
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype)
+ return mono_object_unbox (o);
+
+ res = mono_marshal_alloc (mono_class_native_size (klass, NULL));
+
+ method = mono_marshal_get_struct_to_ptr (o->vtable->klass);
+
+ pa [0] = o;
+ pa [1] = &res;
+ pa [2] = &delete_old;
+
+ mono_runtime_invoke (method, NULL, pa, NULL);
+
+ return res;
}
- return MONO_NATIVE_MAX;
+ }
+
+ mono_raise_exception (mono_get_exception_argument ("", "No PInvoke conversion exists for value passed to Object-typed parameter."));
+
+ return NULL;
}
void
-mono_marshal_load_type_info (MonoClass* klass)
+mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_encoding)
{
- int i, j, count;
- MonoMarshalType *info;
+ MonoType *t;
+ MonoClass *klass;
- if (klass->marshal_info)
+ if (o == NULL)
return;
- for (i = 0; i < klass->field.count; ++i) {
- if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
- continue;
- /* handle fields in embedded valuetypes. */
- count++;
- }
+ t = &o->vtable->klass->byval_arg;
+ switch (t->type) {
+ case MONO_TYPE_STRING:
+ switch (string_encoding) {
+ case MONO_NATIVE_LPWSTR:
+ case MONO_NATIVE_LPSTR:
+ mono_marshal_free (ptr);
+ break;
+ default:
+ g_warning ("marshaling conversion %d not implemented", string_encoding);
+ g_assert_not_reached ();
+ }
+ break;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_VALUETYPE: {
+ klass = t->data.klass;
- klass->marshal_info = info = g_malloc0 (sizeof (MonoMarshalType) + sizeof (MonoMarshalField) * count);
- info->num_fields = count;
-
- for (j = i = 0; i < klass->field.count; ++i) {
- if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
- continue;
- /* handle fields in embedded valuetypes. */
- j++;
- }
+ if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
+ klass->blittable || klass->enumtype)
+ break;
-}
+ mono_struct_delete_old (klass, ptr);
+ mono_marshal_free (ptr);
+ break;
+ }
+ default:
+ break;
+ }
+}
diff --git a/mono/metadata/marshal.h b/mono/metadata/marshal.h
index 2c7b442764b..bcfa22e0b6b 100644
--- a/mono/metadata/marshal.h
+++ b/mono/metadata/marshal.h
@@ -13,70 +13,319 @@
#define __MONO_MARSHAL_H__
#include <mono/metadata/class.h>
-#include <mono/metadata/object.h>
-
-/* ECMA lamespec: the old spec had more info... */
-typedef enum {
- MONO_NATIVE_BOOLEAN = 0x02, /* 4 bytes, 0 is false, != 0 is true */
- MONO_NATIVE_I1 = 0x03,
- MONO_NATIVE_U1 = 0x04,
- MONO_NATIVE_I2 = 0x05,
- MONO_NATIVE_U2 = 0x06,
- MONO_NATIVE_I4 = 0x07,
- MONO_NATIVE_U4 = 0x08,
- MONO_NATIVE_I8 = 0x09,
- MONO_NATIVE_U8 = 0x0a,
- MONO_NATIVE_R4 = 0x0b,
- MONO_NATIVE_R8 = 0x0c,
- MONO_NATIVE_CURRENCY = 0x0f,
- MONO_NATIVE_BSTR = 0x13,
- MONO_NATIVE_LPSTR = 0x14, /* char* */
- MONO_NATIVE_LPWSTR = 0x15, /* gunichar2* */
- MONO_NATIVE_LPTSTR = 0x16,
- MONO_NATIVE_BYVALTSTR = 0x17,
- MONO_NATIVE_IUNKNOWN = 0x19,
- MONO_NATIVE_IDISPATCH = 0x1a,
- MONO_NATIVE_STRUCT = 0x1b,
- MONO_NATIVE_INTERFACE = 0x1c,
- MONO_NATIVE_SAFEARRAY = 0x1d,
- MONO_NATIVE_BYVALARRAY = 0x1e,
- MONO_NATIVE_INT = 0x1f,
- MONO_NATIVE_UINT = 0x20,
- MONO_NATIVE_VBBYREFSTR = 0x22,
- MONO_NATIVE_ANSIBSTR = 0x23,
- MONO_NATIVE_TBSTR = 0x24,
- MONO_NATIVE_VARIANTBOOL = 0x25,
- MONO_NATIVE_FUNC = 0x26,
- MONO_NATIVE_ASANY = 0x28,
- MONO_NATIVE_ARRAY = 0x2a,
- MONO_NATIVE_LPSTRUCT = 0x2b,
- MONO_NATIVE_CUSTOM = 0x2c,
- MONO_NATIVE_ERROR = 0x2d,
- MONO_NATIVE_MAX = 0x50 /* no info */
-} MonoMarshalNative;
-
-typedef struct {
- MonoClassField *field;
- guint32 offset;
- guint32 utype;
- guint32 conv;
- guint32 count;
-} MonoMarshalField;
-
-struct MonoMarshalType {
- guint32 unmanaged_size;
- guint32 num_fields;
- MonoMarshalField fields [MONO_ZERO_LEN_ARRAY];
-};
-
-void* mono_marshal_string_array (MonoArray *array);
-
-guint32 mono_type_to_unmanaged (MonoType *type);
-void mono_marshal_load_type_info (MonoClass* klass);
-
-void* mono_marshal_alloc (gpointer size);
-void mono_marshal_free (gpointer ptr);
-void* mono_marshal_realloc (gpointer ptr, gpointer size);
+#include <mono/metadata/object-internals.h>
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/opcodes.h>
+#include <mono/metadata/reflection.h>
+
+typedef struct _MonoMethodBuilder MonoMethodBuilder;
+
+/* marshaling helper functions */
+
+void
+mono_marshal_init (void);
+
+gint32
+mono_class_native_size (MonoClass *klass, guint32 *align);
+
+MonoMarshalType *
+mono_marshal_load_type_info (MonoClass* klass);
+
+gint32
+mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, gint32 *align,
+ gboolean as_field, gboolean unicode);
+
+int
+mono_type_native_stack_size (MonoType *type, int *alignment);
+
+gpointer
+mono_array_to_savearray (MonoArray *array);
+
+gpointer
+mono_array_to_lparray (MonoArray *array);
+
+void
+mono_string_utf8_to_builder (MonoStringBuilder *sb, char *text);
+
+void
+mono_string_utf16_to_builder (MonoStringBuilder *sb, gunichar2 *text);
+
+gpointer
+mono_string_builder_to_utf8 (MonoStringBuilder *sb);
+
+gpointer
+mono_string_builder_to_utf16 (MonoStringBuilder *sb);
+
+gpointer
+mono_string_to_ansibstr (MonoString *string_obj);
+
+gpointer
+mono_string_to_bstr (MonoString *string_obj);
+
+void
+mono_string_to_byvalstr (gpointer dst, MonoString *src, int size);
+
+void
+mono_string_to_byvalwstr (gpointer dst, MonoString *src, int size);
+
+gpointer
+mono_delegate_to_ftnptr (MonoDelegate *delegate);
+
+MonoDelegate*
+mono_ftnptr_to_delegate (MonoClass *klass, gpointer ftn);
+
+void mono_delegate_free_ftnptr (MonoDelegate *delegate);
+
+void
+mono_marshal_set_last_error (void);
+
+gpointer
+mono_marshal_asany (MonoObject *obj, MonoMarshalNative string_encoding);
+
+void
+mono_marshal_free_asany (MonoObject *o, gpointer ptr, MonoMarshalNative string_encoding);
+
+/* method builder functions */
+
+void
+mono_mb_free (MonoMethodBuilder *mb);
+
+MonoMethodBuilder *
+mono_mb_new (MonoClass *klass, const char *name, MonoWrapperType type);
+
+void
+mono_mb_patch_addr (MonoMethodBuilder *mb, int pos, int value);
+
+void
+mono_mb_patch_addr_s (MonoMethodBuilder *mb, int pos, gint8 value);
+
+guint32
+mono_mb_add_data (MonoMethodBuilder *mb, gpointer data);
+
+void
+mono_mb_emit_native_call (MonoMethodBuilder *mb, MonoMethodSignature *sig, gpointer func);
+
+void
+mono_mb_emit_managed_call (MonoMethodBuilder *mb, MonoMethod *method, MonoMethodSignature *opt_sig);
+
+int
+mono_mb_add_local (MonoMethodBuilder *mb, MonoType *type);
+
+MonoMethod *
+mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack);
+
+void
+mono_mb_emit_ldarg (MonoMethodBuilder *mb, guint argnum);
+
+void
+mono_mb_emit_ldarg_addr (MonoMethodBuilder *mb, guint argnum);
+
+void
+mono_mb_emit_ldloc (MonoMethodBuilder *mb, guint num);
+
+void
+mono_mb_emit_ldloc_addr (MonoMethodBuilder *mb, guint locnum);
+
+void
+mono_mb_emit_stloc (MonoMethodBuilder *mb, guint num);
+
+void
+mono_mb_emit_exception (MonoMethodBuilder *mb, const char *exc_name, const char *msg);
+
+void
+mono_mb_emit_icon (MonoMethodBuilder *mb, gint32 value);
+
+guint32
+mono_mb_emit_branch (MonoMethodBuilder *mb, guint8 op);
+
+void
+mono_mb_emit_add_to_local (MonoMethodBuilder *mb, guint16 local, gint32 incr);
+
+void
+mono_mb_emit_ldflda (MonoMethodBuilder *mb, gint32 offset);
+
+void
+mono_mb_emit_byte (MonoMethodBuilder *mb, guint8 op);
+
+void
+mono_mb_emit_i2 (MonoMethodBuilder *mb, gint16 data);
+
+void
+mono_mb_emit_i4 (MonoMethodBuilder *mb, gint32 data);
+
+void
+mono_mb_emit_ldstr (MonoMethodBuilder *mb, char *str);
+
+/* functions to create various architecture independent helper functions */
+
+MonoMethod *
+mono_marshal_method_from_wrapper (MonoMethod *wrapper);
+
+MonoMethod *
+mono_marshal_get_remoting_invoke (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_remoting_invoke_with_check (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_delegate_begin_invoke (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_delegate_end_invoke (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_delegate_invoke (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_runtime_invoke (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_managed_wrapper (MonoMethod *method, MonoObject *this, MonoMarshalSpec **mspecs);
+
+MonoMethod *
+mono_marshal_get_icall_wrapper (MonoMethodSignature *sig, const char *name, gconstpointer func);
+
+MonoMethod *
+mono_marshal_get_native_wrapper (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_struct_to_ptr (MonoClass *klass);
+
+MonoMethod *
+mono_marshal_get_ptr_to_struct (MonoClass *klass);
+
+MonoMethod *
+mono_marshal_get_stfld_wrapper (MonoType *type);
+
+MonoMethod *
+mono_marshal_get_ldfld_wrapper (MonoType *type);
+
+MonoMethod *
+mono_marshal_get_synchronized_wrapper (MonoMethod *method);
+
+MonoMethod *
+mono_marshal_get_isinst (MonoClass *klass);
+
+MonoMethod *
+mono_marshal_get_castclass (MonoClass *klass);
+
+MonoMethod *
+mono_marshal_get_proxy_cancast (MonoClass *klass);
+
+MonoMethod *
+mono_marshal_get_stelemref (void);
+
+/* marshaling internal calls */
+
+void *
+mono_marshal_alloc (gulong size);
+
+void
+mono_marshal_free (gpointer ptr);
+
+void
+mono_marshal_free_array (gpointer *ptr, int size);
+
+void *
+mono_marshal_realloc (gpointer ptr, gpointer size);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged (MonoArray *src, gint32 start_index,
+ gpointer dest, gint32 length);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged (gpointer src, gint32 start_index,
+ MonoArray *dest, gint32 length);
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr (gpointer ptr, gint32 offset);
+
+unsigned char
+ves_icall_System_Runtime_InteropServices_Marshal_ReadByte (gpointer ptr, gint32 offset);
+
+gint16
+ves_icall_System_Runtime_InteropServices_Marshal_ReadInt16 (gpointer ptr, gint32 offset);
+
+gint32
+ves_icall_System_Runtime_InteropServices_Marshal_ReadInt32 (gpointer ptr, gint32 offset);
+
+gint64
+ves_icall_System_Runtime_InteropServices_Marshal_ReadInt64 (gpointer ptr, gint32 offset);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteByte (gpointer ptr, gint32 offset, unsigned char val);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteIntPtr (gpointer ptr, gint32 offset, gpointer val);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteInt16 (gpointer ptr, gint32 offset, gint16 val);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteInt32 (gpointer ptr, gint32 offset, gint32 val);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_WriteInt64 (gpointer ptr, gint32 offset, gint64 val);
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi (char *ptr);
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len (char *ptr, gint32 len);
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni (guint16 *ptr);
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni_len (guint16 *ptr, gint32 len);
+
+MonoString *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringBSTR (gpointer ptr);
+
+guint32
+ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error (void);
+
+guint32
+ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionType *rtype);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_StructureToPtr (MonoObject *obj, gpointer dst, MonoBoolean delete_old);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure (gpointer src, MonoObject *dst);
+
+MonoObject *
+ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type (gpointer src, MonoReflectionType *type);
+
+int
+ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf (MonoReflectionType *type, MonoString *field_name);
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi (MonoString *string);
+
+gpointer
+ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni (MonoString *string);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure (gpointer src, MonoReflectionType *type);
+
+void*
+ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem (int size);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem (void *ptr);
+
+void*
+ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal (int size);
+
+void
+ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal (void *ptr);
+
+void*
+ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (MonoArray *arrayobj, int index);
+
+MonoDelegate*
+ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (void *ftn, MonoReflectionType *type);
#endif /* __MONO_MARSHAL_H__ */
diff --git a/mono/metadata/mempool.c b/mono/metadata/mempool.c
index 2347b45b661..53c76492732 100644
--- a/mono/metadata/mempool.c
+++ b/mono/metadata/mempool.c
@@ -29,7 +29,11 @@ struct _MonoMemPool {
MonoMemPool *next;
gint rest;
gpointer pos;
- double pad; /* to assure proper alignment */
+ guint32 size;
+ union {
+ double pad; /* to assure proper alignment */
+ guint32 allocated;
+ } d;
};
/**
@@ -45,12 +49,13 @@ mono_mempool_new ()
pool->next = NULL;
pool->pos = (char *)pool + sizeof (MonoMemPool);
pool->rest = MONO_MEMPOOL_PAGESIZE - sizeof (MonoMemPool);
+ pool->d.allocated = pool->size = MONO_MEMPOOL_PAGESIZE;
return pool;
}
/**
* mono_mempool_destroy:
- * @pool: the momory pool to destroy
+ * @pool: the memory pool to destroy
*
* Free all memory associated with this pool.
*/
@@ -68,6 +73,60 @@ mono_mempool_destroy (MonoMemPool *pool)
}
/**
+ * mono_mempool_invalidate:
+ * @pool: the memory pool to invalidate
+ *
+ * Fill the memory associated with this pool to 0x2a (42). Useful for debugging.
+ */
+void
+mono_mempool_invalidate (MonoMemPool *pool)
+{
+ MonoMemPool *p, *n;
+
+ p = pool;
+ while (p) {
+ n = p->next;
+ memset (p, 42, p->size);
+ p = n;
+ }
+}
+
+void
+mono_mempool_empty (MonoMemPool *pool)
+{
+ pool->pos = (char *)pool + sizeof (MonoMemPool);
+ pool->rest = MONO_MEMPOOL_PAGESIZE - sizeof (MonoMemPool);
+}
+
+/**
+ * mono_mempool_stats:
+ * @pool: the momory pool we need stats for
+ *
+ * Print a few stats about the mempool
+ */
+void
+mono_mempool_stats (MonoMemPool *pool)
+{
+ MonoMemPool *p, *n;
+ int count = 0;
+ guint32 still_free = 0;
+
+ p = pool;
+ while (p) {
+ still_free += p->rest;
+ n = p->next;
+ p = n;
+ count++;
+ }
+ if (pool) {
+ g_print ("Mempool %p stats:\n", pool);
+ g_print ("Total mem allocated: %d\n", pool->d.allocated);
+ g_print ("Num chunks: %d\n", count);
+ g_print ("Free memory: %d\n", still_free);
+ }
+}
+
+/**
* mono_mempool_alloc:
* @pool: the momory pool to destroy
* @size: size of the momory block
@@ -91,13 +150,17 @@ mono_mempool_alloc (MonoMemPool *pool, guint size)
MonoMemPool *np = g_malloc (sizeof (MonoMemPool) + size);
np->next = pool->next;
pool->next = np;
+ np->size = sizeof (MonoMemPool) + size;
+ pool->d.allocated += sizeof (MonoMemPool) + size;
return (char *)np + sizeof (MonoMemPool);
} else {
MonoMemPool *np = g_malloc (MONO_MEMPOOL_PAGESIZE);
np->next = pool->next;
pool->next = np;
pool->pos = (char *)np + sizeof (MonoMemPool);
+ np->size = MONO_MEMPOOL_PAGESIZE;
pool->rest = MONO_MEMPOOL_PAGESIZE - sizeof (MonoMemPool);
+ pool->d.allocated += MONO_MEMPOOL_PAGESIZE;
}
}
diff --git a/mono/metadata/mempool.h b/mono/metadata/mempool.h
index 5ee9a6fc57d..125bc43c51f 100644
--- a/mono/metadata/mempool.h
+++ b/mono/metadata/mempool.h
@@ -9,6 +9,15 @@ mono_mempool_new (void);
void
mono_mempool_destroy (MonoMemPool *pool);
+void
+mono_mempool_invalidate (MonoMemPool *pool);
+
+void
+mono_mempool_empty (MonoMemPool *pool);
+
+void
+mono_mempool_stats (MonoMemPool *pool);
+
gpointer
mono_mempool_alloc (MonoMemPool *pool,
guint size);
diff --git a/mono/metadata/metadata-internals.h b/mono/metadata/metadata-internals.h
new file mode 100644
index 00000000000..0eb4fdfbdbe
--- /dev/null
+++ b/mono/metadata/metadata-internals.h
@@ -0,0 +1,273 @@
+
+#ifndef __MONO_METADATA_INTERNALS_H__
+#define __MONO_METADATA_INTERNALS_H__
+
+#include "mono/metadata/image.h"
+#include "mono/utils/mono-hash.h"
+
+struct _MonoAssembly {
+ int ref_count;
+ char *basedir;
+ gboolean in_gac;
+ MonoAssemblyName aname;
+ GModule *aot_module;
+ MonoImage *image;
+ /* Load files here */
+ gboolean dynamic;
+};
+
+typedef struct {
+ const char* data;
+ guint32 size;
+} MonoStreamHeader;
+
+struct _MonoTableInfo {
+ guint32 rows, row_size;
+ const char *base;
+
+ /*
+ * Tables contain up to 9 columns and the possible sizes of the
+ * fields in the documentation are 1, 2 and 4 bytes. So we
+ * can encode in 2 bits the size.
+ *
+ * A 32 bit value can encode the resulting size
+ *
+ * The top eight bits encode the number of columns in the table.
+ * we only need 4, but 8 is aligned no shift required.
+ */
+ guint32 size_bitfield;
+};
+
+struct _MonoImage {
+ int ref_count;
+ FILE *f;
+ /* if f is NULL the image was loaded from raw data */
+ char *raw_data;
+ guint32 raw_data_len;
+ gboolean raw_data_allocated;
+ char *name;
+ const char *assembly_name;
+ const char *module_name;
+ const char *version;
+ char *guid;
+ void *image_info;
+
+ char *raw_metadata;
+
+ gboolean idx_string_wide, idx_guid_wide, idx_blob_wide;
+
+ MonoStreamHeader heap_strings;
+ MonoStreamHeader heap_us;
+ MonoStreamHeader heap_blob;
+ MonoStreamHeader heap_guid;
+ MonoStreamHeader heap_tables;
+
+ const char *tables_base;
+
+ MonoTableInfo tables [64];
+
+ /*
+ * references is initialized only by using the mono_assembly_open
+ * function, and not by using the lowlevel mono_image_open.
+ *
+ * It is NULL terminated.
+ */
+ MonoAssembly **references;
+
+ MonoImage **modules;
+ guint32 module_count;
+
+ MonoImage **files;
+
+ /*
+ * The Assembly this image was loaded from.
+ */
+ MonoAssembly *assembly;
+
+ /*
+ * Indexed by method tokens and typedef tokens.
+ */
+ GHashTable *method_cache;
+ GHashTable *class_cache;
+ /*
+ * Indexed by fielddef and memberref tokens
+ */
+ GHashTable *field_cache;
+
+ /* indexed by typespec tokens. */
+ GHashTable *typespec_cache;
+ /* indexed by token */
+ GHashTable *memberref_signatures;
+ GHashTable *helper_signatures;
+
+ /*
+ * Indexed by MonoGenericInst.
+ */
+ GHashTable *generic_inst_cache;
+
+ /*
+ * Indexes namespaces to hash tables that map class name to typedef token.
+ */
+ GHashTable *name_cache;
+
+ /*
+ * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
+ * maximal rank of 255
+ */
+ GHashTable *array_cache;
+
+ /*
+ * indexed by MonoMethodSignature
+ */
+ GHashTable *delegate_begin_invoke_cache;
+ GHashTable *delegate_end_invoke_cache;
+ GHashTable *delegate_invoke_cache;
+
+ /*
+ * indexed by MonoMethod pointers
+ */
+ GHashTable *runtime_invoke_cache;
+ GHashTable *managed_wrapper_cache;
+ GHashTable *native_wrapper_cache;
+ GHashTable *remoting_invoke_cache;
+ GHashTable *synchronized_cache;
+
+ void *reflection_info;
+
+ /*
+ * user_info is a public field and is not touched by the
+ * metadata engine
+ */
+ void *user_info;
+
+ /* dll map entries */
+ GHashTable *dll_map;
+
+ /* Whenever this is a dynamically emitted module */
+ gboolean dynamic;
+};
+
+enum {
+ MONO_SECTION_TEXT,
+ MONO_SECTION_RSRC,
+ MONO_SECTION_RELOC,
+ MONO_SECTION_MAX
+};
+
+typedef struct {
+ GHashTable *hash;
+ char *data;
+ guint32 alloc_size; /* malloced bytes */
+ guint32 index;
+ guint32 offset; /* from start of metadata */
+} MonoDynamicStream;
+
+typedef struct {
+ guint32 alloc_rows;
+ guint32 rows;
+ guint32 row_size; /* calculated later with column_sizes */
+ guint32 columns;
+ guint32 column_sizes [9];
+ guint32 *values; /* rows * columns */
+ guint32 next_idx;
+} MonoDynamicTable;
+
+struct _MonoDynamicAssembly {
+ MonoAssembly assembly;
+ gboolean run;
+ gboolean save;
+ char *strong_name;
+ guint32 strong_name_size;
+};
+
+struct _MonoDynamicImage {
+ MonoImage image;
+ guint32 meta_size;
+ guint32 text_rva;
+ guint32 metadata_rva;
+ guint32 image_base;
+ guint32 cli_header_offset;
+ guint32 iat_offset;
+ guint32 idt_offset;
+ guint32 ilt_offset;
+ guint32 imp_names_offset;
+ struct {
+ guint32 rva;
+ guint32 size;
+ guint32 offset;
+ guint32 attrs;
+ } sections [MONO_SECTION_MAX];
+ GHashTable *typespec;
+ GHashTable *typeref;
+ GHashTable *handleref;
+ MonoGHashTable *tokens;
+ MonoGHashTable *blob_cache;
+ GList *array_methods;
+ GPtrArray *gen_params;
+ MonoGHashTable *token_fixups;
+ MonoGHashTable *method_to_table_idx;
+ MonoGHashTable *field_to_table_idx;
+ MonoGHashTable *method_aux_hash;
+ gboolean run;
+ gboolean save;
+ gboolean initial_image;
+ guint32 pe_kind, machine;
+ char *strong_name;
+ guint32 strong_name_size;
+ char *win32_res;
+ guint32 win32_res_size;
+ MonoDynamicStream pefile;
+ MonoDynamicStream sheap;
+ MonoDynamicStream code; /* used to store method headers and bytecode */
+ MonoDynamicStream resources; /* managed embedded resources */
+ MonoDynamicStream us;
+ MonoDynamicStream blob;
+ MonoDynamicStream tstream;
+ MonoDynamicStream guid;
+ MonoDynamicTable tables [64];
+};
+
+MonoClass**
+mono_metadata_interfaces_from_typedef_full (MonoImage *image,
+ guint32 table_index,
+ guint *count,
+ MonoGenericContext *context);
+
+MonoArrayType *
+mono_metadata_parse_array_full (MonoImage *image,
+ MonoGenericContainer *generic_container,
+ const char *ptr,
+ const char **rptr);
+
+MonoType *
+mono_metadata_parse_type_full (MonoImage *image,
+ MonoGenericContainer *generic_container,
+ MonoParseTypeMode mode,
+ short opt_attrs,
+ const char *ptr,
+ const char **rptr);
+
+MonoType *
+mono_type_create_from_typespec_full (MonoImage *image,
+ MonoGenericContainer *generic_container,
+ guint32 type_spec);
+
+MonoMethodSignature *
+mono_metadata_parse_signature_full (MonoImage *image,
+ MonoGenericContainer *generic_container,
+ guint32 token);
+
+MonoMethodSignature *
+mono_metadata_parse_method_signature_full (MonoImage *image,
+ MonoGenericContainer *generic_container,
+ int def,
+ const char *ptr,
+ const char **rptr);
+
+MonoMethodHeader *
+mono_metadata_parse_mh_full (MonoImage *image,
+ MonoGenericContainer *generic_container,
+ const char *ptr);
+
+#endif /* __MONO_METADATA_INTERNALS_H__ */
+
diff --git a/mono/metadata/metadata.c b/mono/metadata/metadata.c
index 2286212ab65..eb490026e1c 100644
--- a/mono/metadata/metadata.c
+++ b/mono/metadata/metadata.c
@@ -11,16 +11,22 @@
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <glib.h>
#include "metadata.h"
#include "tabledefs.h"
#include "mono-endian.h"
#include "cil-coff.h"
#include "tokentype.h"
+#include "metadata-internals.h"
+#include "class-internals.h"
#include "private.h"
#include "class.h"
-static void do_mono_metadata_parse_type (MonoType *type, MonoImage *m, const char *ptr, const char **rptr);
+static void do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer *generic_container,
+ const char *ptr, const char **rptr);
+
+static gboolean do_mono_metadata_type_equal (MonoType *t1, MonoType *t2, gboolean signature_only);
/*
* Encoding of the "description" argument:
@@ -35,7 +41,7 @@ static void do_mono_metadata_parse_type (MonoType *type, MonoImage *m, const cha
* information might refer to different tables.
*/
-static MonoMetaTable AssemblySchema [] = {
+const static MonoMetaTable AssemblySchema [] = {
{ MONO_MT_UINT32, "HashId" },
{ MONO_MT_UINT16, "Major" },
{ MONO_MT_UINT16, "Minor" },
@@ -48,19 +54,19 @@ static MonoMetaTable AssemblySchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable AssemblyOSSchema [] = {
+const static MonoMetaTable AssemblyOSSchema [] = {
{ MONO_MT_UINT32, "OSPlatformID" },
{ MONO_MT_UINT32, "OSMajor" },
{ MONO_MT_UINT32, "OSMinor" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable AssemblyProcessorSchema [] = {
+const static MonoMetaTable AssemblyProcessorSchema [] = {
{ MONO_MT_UINT32, "Processor" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable AssemblyRefSchema [] = {
+const static MonoMetaTable AssemblyRefSchema [] = {
{ MONO_MT_UINT16, "Major" },
{ MONO_MT_UINT16, "Minor" },
{ MONO_MT_UINT16, "Build" },
@@ -73,7 +79,7 @@ static MonoMetaTable AssemblyRefSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable AssemblyRefOSSchema [] = {
+const static MonoMetaTable AssemblyRefOSSchema [] = {
{ MONO_MT_UINT32, "OSPlatformID" },
{ MONO_MT_UINT32, "OSMajorVersion" },
{ MONO_MT_UINT32, "OSMinorVersion" },
@@ -81,20 +87,20 @@ static MonoMetaTable AssemblyRefOSSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable AssemblyRefProcessorSchema [] = {
+const static MonoMetaTable AssemblyRefProcessorSchema [] = {
{ MONO_MT_UINT32, "Processor" },
{ MONO_MT_TABLE_IDX, "AssemblyRef:AssemblyRef" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ClassLayoutSchema [] = {
+const static MonoMetaTable ClassLayoutSchema [] = {
{ MONO_MT_UINT16, "PackingSize" },
{ MONO_MT_UINT32, "ClassSize" },
{ MONO_MT_TABLE_IDX, "Parent:TypeDef" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ConstantSchema [] = {
+const static MonoMetaTable ConstantSchema [] = {
{ MONO_MT_UINT8, "Type" },
{ MONO_MT_UINT8, "PaddingZero" },
{ MONO_MT_CONST_IDX, "Parent" },
@@ -102,34 +108,34 @@ static MonoMetaTable ConstantSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable CustomAttributeSchema [] = {
+const static MonoMetaTable CustomAttributeSchema [] = {
{ MONO_MT_HASCAT_IDX, "Parent" },
{ MONO_MT_CAT_IDX, "Type" },
{ MONO_MT_BLOB_IDX, "Value" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable DeclSecuritySchema [] = {
+const static MonoMetaTable DeclSecuritySchema [] = {
{ MONO_MT_UINT16, "Action" },
{ MONO_MT_HASDEC_IDX, "Parent" },
{ MONO_MT_BLOB_IDX, "PermissionSet" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable EventMapSchema [] = {
+const static MonoMetaTable EventMapSchema [] = {
{ MONO_MT_TABLE_IDX, "Parent:TypeDef" },
{ MONO_MT_TABLE_IDX, "EventList:Event" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable EventSchema [] = {
+const static MonoMetaTable EventSchema [] = {
{ MONO_MT_UINT16, "EventFlags#EventAttribute" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_TABLE_IDX, "EventType" }, /* TypeDef or TypeRef */
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ExportedTypeSchema [] = {
+const static MonoMetaTable ExportedTypeSchema [] = {
{ MONO_MT_UINT32, "Flags" },
{ MONO_MT_TABLE_IDX, "TypeDefId" },
{ MONO_MT_STRING_IDX, "TypeName" },
@@ -138,37 +144,37 @@ static MonoMetaTable ExportedTypeSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable FieldSchema [] = {
+const static MonoMetaTable FieldSchema [] = {
{ MONO_MT_UINT16, "Flags" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_BLOB_IDX, "Signature" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable FieldLayoutSchema [] = {
+const static MonoMetaTable FieldLayoutSchema [] = {
{ MONO_MT_UINT32, "Offset" },
{ MONO_MT_TABLE_IDX, "Field:Field" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable FieldMarshalSchema [] = {
+const static MonoMetaTable FieldMarshalSchema [] = {
{ MONO_MT_HFM_IDX, "Parent" },
{ MONO_MT_BLOB_IDX, "NativeType" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable FieldRVASchema [] = {
+const static MonoMetaTable FieldRVASchema [] = {
{ MONO_MT_UINT32, "RVA" },
{ MONO_MT_TABLE_IDX, "Field:Field" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable FileSchema [] = {
+const static MonoMetaTable FileSchema [] = {
{ MONO_MT_UINT32, "Flags" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_BLOB_IDX, "Value" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ImplMapSchema [] = {
+const static MonoMetaTable ImplMapSchema [] = {
{ MONO_MT_UINT16, "MappingFlag" },
{ MONO_MT_MF_IDX, "MemberForwarded" },
{ MONO_MT_STRING_IDX, "ImportName" },
@@ -176,13 +182,13 @@ static MonoMetaTable ImplMapSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable InterfaceImplSchema [] = {
+const static MonoMetaTable InterfaceImplSchema [] = {
{ MONO_MT_TABLE_IDX, "Class:TypeDef" },
{ MONO_MT_TDOR_IDX, "Interface=TypeDefOrRef" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ManifestResourceSchema [] = {
+const static MonoMetaTable ManifestResourceSchema [] = {
{ MONO_MT_UINT32, "Offset" },
{ MONO_MT_UINT32, "Flags" },
{ MONO_MT_STRING_IDX, "Name" },
@@ -190,14 +196,14 @@ static MonoMetaTable ManifestResourceSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable MemberRefSchema [] = {
+const static MonoMetaTable MemberRefSchema [] = {
{ MONO_MT_MRP_IDX, "Class" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_BLOB_IDX, "Signature" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable MethodSchema [] = {
+const static MonoMetaTable MethodSchema [] = {
{ MONO_MT_UINT32, "RVA" },
{ MONO_MT_UINT16, "ImplFlags#MethodImplAttributes" },
{ MONO_MT_UINT16, "Flags#MethodAttribute" },
@@ -207,21 +213,21 @@ static MonoMetaTable MethodSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable MethodImplSchema [] = {
+const static MonoMetaTable MethodImplSchema [] = {
{ MONO_MT_TABLE_IDX, "Class:TypeDef" },
{ MONO_MT_MDOR_IDX, "MethodBody" },
{ MONO_MT_MDOR_IDX, "MethodDeclaration" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable MethodSemanticsSchema [] = {
+const static MonoMetaTable MethodSemanticsSchema [] = {
{ MONO_MT_UINT16, "MethodSemantic" },
{ MONO_MT_TABLE_IDX, "Method:Method" },
{ MONO_MT_HS_IDX, "Association" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ModuleSchema [] = {
+const static MonoMetaTable ModuleSchema [] = {
{ MONO_MT_UINT16, "Generation" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_GUID_IDX, "MVID" },
@@ -230,43 +236,43 @@ static MonoMetaTable ModuleSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ModuleRefSchema [] = {
+const static MonoMetaTable ModuleRefSchema [] = {
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable NestedClassSchema [] = {
+const static MonoMetaTable NestedClassSchema [] = {
{ MONO_MT_TABLE_IDX, "NestedClass:TypeDef" },
{ MONO_MT_TABLE_IDX, "EnclosingClass:TypeDef" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable ParamSchema [] = {
+const static MonoMetaTable ParamSchema [] = {
{ MONO_MT_UINT16, "Flags" },
{ MONO_MT_UINT16, "Sequence" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable PropertySchema [] = {
+const static MonoMetaTable PropertySchema [] = {
{ MONO_MT_UINT16, "Flags" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_BLOB_IDX, "Type" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable PropertyMapSchema [] = {
+const static MonoMetaTable PropertyMapSchema [] = {
{ MONO_MT_TABLE_IDX, "Parent:TypeDef" },
{ MONO_MT_TABLE_IDX, "PropertyList:Property" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable StandaloneSigSchema [] = {
+const static MonoMetaTable StandaloneSigSchema [] = {
{ MONO_MT_BLOB_IDX, "Signature" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable TypeDefSchema [] = {
+const static MonoMetaTable TypeDefSchema [] = {
{ MONO_MT_UINT32, "Flags" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_STRING_IDX, "Namespace" },
@@ -276,20 +282,44 @@ static MonoMetaTable TypeDefSchema [] = {
{ MONO_MT_END, NULL }
};
-static MonoMetaTable TypeRefSchema [] = {
+const static MonoMetaTable TypeRefSchema [] = {
{ MONO_MT_RS_IDX, "ResolutionScope=ResolutionScope" },
{ MONO_MT_STRING_IDX, "Name" },
{ MONO_MT_STRING_IDX, "Namespace" },
{ MONO_MT_END, NULL }
};
-static MonoMetaTable TypeSpecSchema [] = {
+const static MonoMetaTable TypeSpecSchema [] = {
{ MONO_MT_BLOB_IDX, "Signature" },
{ MONO_MT_END, NULL }
};
-static struct {
- MonoMetaTable *table;
+const static MonoMetaTable GenericParamSchema [] = {
+ { MONO_MT_UINT16, "Number" },
+ { MONO_MT_UINT16, "Flags" },
+ { MONO_MT_TABLE_IDX, "Owner" }, /* TypeDef or MethodDef */
+ { MONO_MT_STRING_IDX, "Name" },
+
+ /* soon to be removed */
+ { MONO_MT_TABLE_IDX, "Kind" },
+
+ { MONO_MT_END, NULL }
+};
+
+const static MonoMetaTable MethodSpecSchema [] = {
+ { MONO_MT_MDOR_IDX, "Method" },
+ { MONO_MT_BLOB_IDX, "Signature" },
+ { MONO_MT_END, NULL }
+};
+
+const static MonoMetaTable GenericParamConstraintSchema [] = {
+ { MONO_MT_TABLE_IDX, "GenericParam" },
+ { MONO_MT_TDOR_IDX, "Constraint" },
+ { MONO_MT_END, NULL }
+};
+
+const static struct {
+ const MonoMetaTable *table;
const char *name;
} tables [] = {
/* 0 */ { ModuleSchema, "Module" },
@@ -334,8 +364,9 @@ static struct {
/* 27 */ { ExportedTypeSchema, "ExportedType" },
/* 28 */ { ManifestResourceSchema, "ManifestResource" },
/* 29 */ { NestedClassSchema, "NestedClass" },
- /* 2A */ { NULL, NULL },
- /* 2B */ { NULL, NULL },
+ /* 2A */ { GenericParamSchema, "GenericParam" },
+ /* 2B */ { MethodSpecSchema, "MethodSpec" },
+ /* 2C */ { GenericParamConstraintSchema, "GenericParamConstraint" },
};
/**
@@ -347,7 +378,7 @@ static struct {
const char *
mono_meta_table_name (int table)
{
- if ((table < 0) || (table > 0x29))
+ if ((table < 0) || (table > 0x2c))
return "";
return tables [table].name;
@@ -383,10 +414,10 @@ int
mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bitfield)
{
guint32 bitfield = 0;
- int size = 0, field_size;
+ int size = 0, field_size = 0;
int i, n, code;
int shift = 0;
- MonoMetaTable *table = tables [tableindex].table;
+ const MonoMetaTable *table = tables [tableindex].table;
for (i = 0; (code = table [i].code) != MONO_MT_END; i++){
switch (code){
@@ -435,7 +466,8 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit
break;
case MONO_TABLE_EXPORTEDTYPE:
g_assert (i == 1);
- field_size = idx_size (MONO_TABLE_TYPEDEF); break;
+ /* the index is in another metadata file, so it must be 4 */
+ field_size = 4; break;
case MONO_TABLE_FIELDLAYOUT:
g_assert (i == 1);
field_size = idx_size (MONO_TABLE_FIELD); break;
@@ -468,12 +500,26 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit
case MONO_TABLE_TYPEDEF:
g_assert (i == 4 || i == 5);
field_size = i == 4 ? idx_size (MONO_TABLE_FIELD):
- idx_size(MONO_TABLE_METHOD);
+ idx_size(MONO_TABLE_METHOD);
+ case MONO_TABLE_GENERICPARAM:
+ g_assert (i == 2 || i == 4 || i == 5);
+ if (i == 2)
+ field_size = MAX (idx_size (MONO_TABLE_METHOD), idx_size (MONO_TABLE_TYPEDEF));
+ else if (i == 4)
+ field_size = idx_size (MONO_TABLE_TYPEDEF);
+ else if (i == 5)
+ field_size = idx_size (MONO_TABLE_TYPEDEF);
+ break;
+
+ case MONO_TABLE_GENERICPARAMCONSTRAINT:
+ g_assert (i == 0);
+ field_size = idx_size (MONO_TABLE_GENERICPARAM);
break;
+
default:
g_assert_not_reached ();
}
- if (field_size != idx_size (tableindex))
+ if (tableindex != MONO_TABLE_EXPORTEDTYPE && field_size != idx_size (tableindex))
g_warning ("size changed (%d to %d)", idx_size (tableindex), field_size);
break;
@@ -733,7 +779,7 @@ mono_metadata_locate_token (MonoImage *meta, guint32 token)
*
* Returns the MonoMetaTable structure for table @table
*/
-MonoMetaTable *
+const MonoMetaTable *
mono_metadata_get_table (MonoMetaTableEnum table)
{
int x = (int) table;
@@ -804,7 +850,11 @@ mono_metadata_guid_heap (MonoImage *meta, guint32 index)
static const char *
dword_align (const char *ptr)
{
+#if SIZEOF_VOID_P == 8
+ return (const char *) (((guint64) (ptr + 3)) & ~3);
+#else
return (const char *) (((guint32) (ptr + 3)) & ~3);
+#endif
}
/**
@@ -817,7 +867,7 @@ dword_align (const char *ptr)
* into the guint32 @res array that has res_size elements
*/
void
-mono_metadata_decode_row (MonoTableInfo *t, int idx, guint32 *res, int res_size)
+mono_metadata_decode_row (const MonoTableInfo *t, int idx, guint32 *res, int res_size)
{
guint32 bitfield = t->size_bitfield;
int i, count = mono_metadata_table_count (bitfield);
@@ -854,7 +904,7 @@ mono_metadata_decode_row (MonoTableInfo *t, int idx, guint32 *res, int res_size)
* row in the table @t.
*/
guint32
-mono_metadata_decode_row_col (MonoTableInfo *t, int idx, guint col)
+mono_metadata_decode_row_col (const MonoTableInfo *t, int idx, guint col)
{
guint32 bitfield = t->size_bitfield;
int i;
@@ -989,7 +1039,7 @@ mono_metadata_parse_custom_mod (MonoImage *m, MonoCustomMod *dest, const char *p
if (!dest)
dest = &local;
dest->required = *ptr == MONO_TYPE_CMOD_REQD ? 1 : 0;
- dest->token = mono_metadata_parse_typedef_or_ref (m, ptr + 1, &ptr);
+ dest->token = mono_metadata_parse_typedef_or_ref (m, ptr + 1, rptr);
return TRUE;
}
return FALSE;
@@ -1007,12 +1057,15 @@ mono_metadata_parse_custom_mod (MonoImage *m, MonoCustomMod *dest, const char *p
* and dimensions.
*/
MonoArrayType *
-mono_metadata_parse_array (MonoImage *m, const char *ptr, const char **rptr)
+mono_metadata_parse_array_full (MonoImage *m, MonoGenericContainer *generic_container,
+ const char *ptr, const char **rptr)
{
int i;
MonoArrayType *array = g_new0 (MonoArrayType, 1);
+ MonoType *etype;
- array->type = mono_metadata_parse_type (m, MONO_PARSE_TYPE, 0, ptr, &ptr);
+ etype = mono_metadata_parse_type_full (m, generic_container, MONO_PARSE_TYPE, 0, ptr, &ptr);
+ array->eklass = mono_class_from_mono_type (etype);
array->rank = mono_metadata_decode_value (ptr, &ptr);
array->numsizes = mono_metadata_decode_value (ptr, &ptr);
@@ -1032,6 +1085,12 @@ mono_metadata_parse_array (MonoImage *m, const char *ptr, const char **rptr)
return array;
}
+MonoArrayType *
+mono_metadata_parse_array (MonoImage *m, const char *ptr, const char **rptr)
+{
+ return mono_metadata_parse_array_full (m, NULL, ptr, rptr);
+}
+
/*
* mono_metadata_free_array:
* @array: array description
@@ -1041,7 +1100,6 @@ mono_metadata_parse_array (MonoImage *m, const char *ptr, const char **rptr)
void
mono_metadata_free_array (MonoArrayType *array)
{
- mono_metadata_free_type (array->type);
g_free (array->sizes);
g_free (array->lobounds);
g_free (array);
@@ -1086,13 +1144,13 @@ builtin_types[] = {
{{NULL}, 0, MONO_TYPE_R8, 0, 1, 0},
{{NULL}, 0, MONO_TYPE_STRING, 0, 0, 0},
{{NULL}, 0, MONO_TYPE_STRING, 0, 1, 0},
+ {{NULL}, 0, MONO_TYPE_OBJECT, 0, 0, 0},
+ {{NULL}, 0, MONO_TYPE_OBJECT, 0, 1, 0},
{{NULL}, 0, MONO_TYPE_TYPEDBYREF, 0, 0, 0},
{{NULL}, 0, MONO_TYPE_I, 0, 0, 0},
{{NULL}, 0, MONO_TYPE_I, 0, 1, 0},
{{NULL}, 0, MONO_TYPE_U, 0, 0, 0},
{{NULL}, 0, MONO_TYPE_U, 0, 1, 0},
- {{NULL}, 0, MONO_TYPE_OBJECT, 0, 0, 0},
- {{NULL}, 0, MONO_TYPE_OBJECT, 0, 1, 0}
};
#define NBUILTIN_TYPES() (sizeof (builtin_types) / sizeof (builtin_types [0]))
@@ -1121,6 +1179,22 @@ mono_type_equal (gconstpointer ka, gconstpointer kb)
return 1;
}
+/**
+ * mono_metadata_init:
+ *
+ * Initialize the global variables of this module.
+ */
+void
+mono_metadata_init (void)
+{
+ int i;
+
+ type_cache = g_hash_table_new (mono_type_hash, mono_type_equal);
+
+ for (i = 0; i < NBUILTIN_TYPES (); ++i)
+ g_hash_table_insert (type_cache, &builtin_types [i], &builtin_types [i]);
+}
+
/*
* mono_metadata_parse_type:
* @m: metadata context
@@ -1135,86 +1209,129 @@ mono_type_equal (gconstpointer ka, gconstpointer kb)
* This function can be used to decode type descriptions in method signatures,
* field signatures, locals signatures etc.
*
+ * To parse a generic type, `generic_container' points to the current class'es
+ * (the `generic_container' field in the MonoClass) or the current generic method's
+ * (the `generic_container' field in the MonoMethodNormal) generic container.
+ * When we encounter any MONO_TYPE_VAR or MONO_TYPE_MVAR's, they're looked up in
+ * this MonoGenericContainer.
+ *
* Returns: a #MonoType structure representing the decoded type.
*/
MonoType*
-mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs, const char *ptr, const char **rptr)
+mono_metadata_parse_type_full (MonoImage *m, MonoGenericContainer *generic_container, MonoParseTypeMode mode,
+ short opt_attrs, const char *ptr, const char **rptr)
{
MonoType *type, *cached;
+ MonoType stype;
+ gboolean byref = FALSE;
+ gboolean pinned = FALSE;
+ const char *tmp_ptr;
+ int count = 0;
+ gboolean found;
- if (!type_cache) {
- int i;
- type_cache = g_hash_table_new (mono_type_hash, mono_type_equal);
-
- for (i = 0; i < NBUILTIN_TYPES (); ++i)
- g_hash_table_insert (type_cache, &builtin_types [i], &builtin_types [i]);
- }
-
- switch (mode) {
- case MONO_PARSE_MOD_TYPE:
- case MONO_PARSE_PARAM:
- case MONO_PARSE_RET:
- case MONO_PARSE_FIELD: {
- /* count the modifiers */
- const char *tmp_ptr = ptr;
- int count = 0;
- while (mono_metadata_parse_custom_mod (m, NULL, tmp_ptr, &tmp_ptr))
- count++;
- if (count) {
- type = g_malloc0 (sizeof (MonoType) + (count - MONO_ZERO_LEN_ARRAY) * sizeof (MonoCustomMod));
- type->num_mods = count;
- if (count > 64)
- g_warning ("got more than 64 modifiers in type");
- /* save them this time */
- count = 0;
- while (mono_metadata_parse_custom_mod (m, &(type->modifiers [count]), ptr, &ptr))
- count++;
+ /*
+ * According to the spec, custom modifiers should come before the byref
+ * flag, but the IL produced by ilasm from the following signature:
+ * object modopt(...) &
+ * starts with a byref flag, followed by the modifiers. (bug #49802)
+ * Also, this type seems to be different from 'object & modopt(...)'. Maybe
+ * it would be better to treat byref as real type constructor instead of
+ * a modifier...
+ * Also, pinned should come before anything else, but some MSV++ produced
+ * assemblies violate this (#bug 61990).
+ */
+
+ /* Count the modifiers first */
+ tmp_ptr = ptr;
+ found = TRUE;
+ while (found) {
+ switch (*tmp_ptr) {
+ case MONO_TYPE_PINNED:
+ case MONO_TYPE_BYREF:
+ ++tmp_ptr;
+ break;
+ case MONO_TYPE_CMOD_REQD:
+ case MONO_TYPE_CMOD_OPT:
+ count ++;
+ mono_metadata_parse_custom_mod (m, NULL, tmp_ptr, &tmp_ptr);
break;
- } /* fall through */
+ default:
+ found = FALSE;
+ }
}
- case MONO_PARSE_LOCAL:
- case MONO_PARSE_TYPE:
- /*
- * Later we can avoid doing this allocation.
- */
- type = g_new0 (MonoType, 1);
- break;
- default:
- g_assert_not_reached ();
+
+ if (count) {
+ type = g_malloc0 (sizeof (MonoType) + ((gint32)count - MONO_ZERO_LEN_ARRAY) * sizeof (MonoCustomMod));
+ type->num_mods = count;
+ if (count > 64)
+ g_warning ("got more than 64 modifiers in type");
}
-
- type->attrs = opt_attrs;
- if (mode == MONO_PARSE_LOCAL) {
- /*
- * check for pinned flag
- */
- if (*ptr == MONO_TYPE_PINNED) {
- type->pinned = 1;
+ else {
+ type = &stype;
+ memset (type, 0, sizeof (MonoType));
+ }
+
+ /* Parse pinned, byref and custom modifiers */
+ found = TRUE;
+ count = 0;
+ while (found) {
+ switch (*ptr) {
+ case MONO_TYPE_PINNED:
+ pinned = TRUE;
+ ++ptr;
+ break;
+ case MONO_TYPE_BYREF:
+ byref = TRUE;
++ptr;
+ break;
+ case MONO_TYPE_CMOD_REQD:
+ case MONO_TYPE_CMOD_OPT:
+ mono_metadata_parse_custom_mod (m, &(type->modifiers [count]), ptr, &ptr);
+ count ++;
+ break;
+ default:
+ found = FALSE;
}
}
+
+ type->attrs = opt_attrs;
+ type->byref = byref;
+ type->pinned = pinned ? 1 : 0;
+
+ do_mono_metadata_parse_type (type, m, generic_container, ptr, &ptr);
- switch (*ptr) {
- case MONO_TYPE_BYREF:
- if (mode == MONO_PARSE_FIELD)
- g_warning ("A field type cannot be byref");
- type->byref = 1;
- ptr++;
- /* follow through */
- default:
- /*if (*ptr == MONO_TYPE_VOID && mode != MONO_PARSE_RET)
- g_error ("void not allowed in param");*/
- do_mono_metadata_parse_type (type, m, ptr, &ptr);
- break;
- }
if (rptr)
*rptr = ptr;
- if (mode != MONO_PARSE_PARAM && !type->num_mods && (cached = g_hash_table_lookup (type_cache, type))) {
- mono_metadata_free_type (type);
- return cached;
- } else {
- return type;
+
+
+ /* FIXME: remove the != MONO_PARSE_PARAM condition, this accounts for
+ * almost 10k (about 2/3rds) of all MonoType's we create.
+ */
+ if (mode != MONO_PARSE_PARAM && !type->num_mods) {
+ /* no need to free type here, because it is on the stack */
+ if ((type->type == MONO_TYPE_CLASS || type->type == MONO_TYPE_VALUETYPE) && !type->pinned && !type->attrs) {
+ if (type->byref)
+ return &type->data.klass->this_arg;
+ else
+ return &type->data.klass->byval_arg;
+ }
+ /* No need to use locking since nobody is modifying the hash table */
+ if ((cached = g_hash_table_lookup (type_cache, type)))
+ return cached;
}
+
+ /*printf ("%x%c %s\n", type->attrs, type->pinned ? 'p' : ' ', mono_type_full_name (type));*/
+
+ if (type == &stype)
+ type = g_memdup (&stype, sizeof (MonoType));
+ return type;
+}
+
+MonoType*
+mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs,
+ const char *ptr, const char **rptr)
+{
+ return mono_metadata_parse_type_full (m, NULL, mode, opt_attrs, ptr, rptr);
}
/*
@@ -1227,13 +1344,16 @@ mono_metadata_parse_type (MonoImage *m, MonoParseTypeMode mode, short opt_attrs,
* Returns: a MonoMethodSignature describing the signature.
*/
MonoMethodSignature *
-mono_metadata_parse_signature (MonoImage *image, guint32 token)
+mono_metadata_parse_signature_full (MonoImage *image, MonoGenericContainer *generic_container, guint32 token)
{
MonoTableInfo *tables = image->tables;
guint32 idx = mono_metadata_token_index (token);
guint32 sig;
const char *ptr;
+ if (image->dynamic)
+ return mono_lookup_dynamic_token (image, token);
+
g_assert (mono_metadata_token_table(token) == MONO_TABLE_STANDALONESIG);
sig = mono_metadata_decode_row_col (&tables [MONO_TABLE_STANDALONESIG], idx - 1, 0);
@@ -1241,13 +1361,41 @@ mono_metadata_parse_signature (MonoImage *image, guint32 token)
ptr = mono_metadata_blob_heap (image, sig);
mono_metadata_decode_blob_size (ptr, &ptr);
- return mono_metadata_parse_method_signature (image, FALSE, ptr, NULL);
+ return mono_metadata_parse_method_signature_full (image, generic_container, FALSE, ptr, NULL);
+}
+
+MonoMethodSignature *
+mono_metadata_parse_signature (MonoImage *image, guint32 token)
+{
+ return mono_metadata_parse_signature_full (image, NULL, token);
+}
+
+MonoMethodSignature*
+mono_metadata_signature_alloc (MonoImage *m, guint32 nparams)
+{
+ MonoMethodSignature *sig;
+
+ /* later we want to allocate signatures with mempools */
+ sig = g_malloc0 (sizeof (MonoMethodSignature) + ((gint32)nparams - MONO_ZERO_LEN_ARRAY) * sizeof (MonoType*));
+ sig->param_count = nparams;
+ sig->sentinelpos = -1;
+
+ return sig;
+}
+
+MonoMethodSignature*
+mono_metadata_signature_dup (MonoMethodSignature *sig)
+{
+ int sigsize;
+
+ sigsize = sizeof (MonoMethodSignature) + sig->param_count * sizeof (MonoType *);
+ return g_memdup (sig, sigsize);
}
/*
* mono_metadata_parse_method_signature:
* @m: metadata context
- * @def: use #TRUE when parsing MethodDef, #FALSE with MethodRef signatures.
+ * @def: the MethodDef index or 0 for Ref signatures.
* @ptr: pointer to the signature metadata representation
* @rptr: pointer updated to match the end of the decoded stream
*
@@ -1256,26 +1404,72 @@ mono_metadata_parse_signature (MonoImage *image, guint32 token)
* Returns: a MonoMethodSignature describing the signature.
*/
MonoMethodSignature *
-mono_metadata_parse_method_signature (MonoImage *m, int def, const char *ptr, const char **rptr)
+mono_metadata_parse_method_signature_full (MonoImage *m, MonoGenericContainer *generic_container,
+ int def, const char *ptr, const char **rptr)
{
MonoMethodSignature *method;
- int i;
+ int i, ret_attrs = 0, *pattrs = NULL;
guint32 hasthis = 0, explicit_this = 0, call_convention, param_count;
+ guint32 gen_param_count = 0;
+ MonoGenericContainer *container = NULL;
+ if (*ptr & 0x10)
+ gen_param_count = 1;
if (*ptr & 0x20)
hasthis = 1;
if (*ptr & 0x40)
explicit_this = 1;
call_convention = *ptr & 0x0F;
ptr++;
+ if (gen_param_count)
+ gen_param_count = mono_metadata_decode_value (ptr, &ptr);
param_count = mono_metadata_decode_value (ptr, &ptr);
+ pattrs = g_new0 (int, param_count);
+
+ if (def) {
+ MonoTableInfo *paramt = &m->tables [MONO_TABLE_PARAM];
+ MonoTableInfo *methodt = &m->tables [MONO_TABLE_METHOD];
+ guint32 cols [MONO_PARAM_SIZE];
+ guint lastp, param_index = mono_metadata_decode_row_col (methodt, def - 1, MONO_METHOD_PARAMLIST);
- method = g_malloc0 (sizeof (MonoMethodSignature) + (param_count - MONO_ZERO_LEN_ARRAY) * sizeof (MonoType*));
- method->param_count = param_count;
+ if (def < methodt->rows)
+ lastp = mono_metadata_decode_row_col (methodt, def, MONO_METHOD_PARAMLIST);
+ else
+ lastp = paramt->rows + 1;
+ for (i = param_index; i < lastp; ++i) {
+ mono_metadata_decode_row (paramt, i - 1, cols, MONO_PARAM_SIZE);
+ if (!cols [MONO_PARAM_SEQUENCE])
+ ret_attrs = cols [MONO_PARAM_FLAGS];
+ else
+ pattrs [cols [MONO_PARAM_SEQUENCE] - 1] = cols [MONO_PARAM_FLAGS];
+ }
+ }
+ method = mono_metadata_signature_alloc (m, param_count);
method->hasthis = hasthis;
method->explicit_this = explicit_this;
method->call_convention = call_convention;
- method->ret = mono_metadata_parse_type (m, MONO_PARSE_RET, 0, ptr, &ptr);
+ method->generic_param_count = gen_param_count;
+
+ if (gen_param_count && (!generic_container || !generic_container->is_method)) {
+ container = g_new0 (MonoGenericContainer, 1);
+ container->parent = generic_container;
+ container->is_signature = 1;
+
+ container->context = g_new0 (MonoGenericContext, 1);
+ container->context->container = container;
+
+ container->type_argc = gen_param_count;
+ container->type_params = g_new0 (MonoGenericParam, gen_param_count);
+
+ for (i = 0; i < gen_param_count; i++) {
+ container->type_params [i].owner = container;
+ container->type_params [i].num = i;
+ }
+ } else
+ container = generic_container;
+
+ if (call_convention != 0xa)
+ method->ret = mono_metadata_parse_type_full (m, container, MONO_PARSE_RET, ret_attrs, ptr, &ptr);
if (method->param_count) {
method->sentinelpos = -1;
@@ -1287,10 +1481,16 @@ mono_metadata_parse_method_signature (MonoImage *m, int def, const char *ptr, co
method->sentinelpos = i;
ptr++;
}
- method->params [i] = mono_metadata_parse_type (m, MONO_PARSE_PARAM, 0, ptr, &ptr);
+ method->params [i] = mono_metadata_parse_type_full (
+ m, container, MONO_PARSE_PARAM, pattrs [i], ptr, &ptr);
}
}
+ if (def && (method->call_convention == MONO_CALL_VARARG))
+ method->sentinelpos = method->param_count;
+
+ g_free (pattrs);
+
if (rptr)
*rptr = ptr;
/*
@@ -1299,6 +1499,12 @@ mono_metadata_parse_method_signature (MonoImage *m, int def, const char *ptr, co
return method;
}
+MonoMethodSignature *
+mono_metadata_parse_method_signature (MonoImage *m, int def, const char *ptr, const char **rptr)
+{
+ return mono_metadata_parse_method_signature_full (m, NULL, def, ptr, rptr);
+}
+
/*
* mono_metadata_free_method_signature:
* @sig: signature to destroy
@@ -1316,6 +1522,122 @@ mono_metadata_free_method_signature (MonoMethodSignature *sig)
g_free (sig);
}
+static void
+do_mono_metadata_parse_generic_inst (MonoType *type, MonoImage *m, MonoGenericContainer *generic_container,
+ const char *ptr, const char **rptr)
+{
+ MonoGenericInst *ginst = g_new0 (MonoGenericInst, 1);
+ MonoGenericInst *cached;
+ MonoClass *gklass;
+ int i, count;
+
+ type->data.generic_inst = ginst;
+
+ ginst->context = g_new0 (MonoGenericContext, 1);
+ ginst->context->ginst = ginst;
+
+ ginst->klass = g_new0 (MonoClass, 1);
+
+ ginst->generic_type = mono_metadata_parse_type_full (m, generic_container, MONO_PARSE_TYPE, 0, ptr, &ptr);
+ ginst->type_argc = count = mono_metadata_decode_value (ptr, &ptr);
+ ginst->type_argv = g_new0 (MonoType*, count);
+
+ gklass = mono_class_from_mono_type (ginst->generic_type);
+ g_assert ((ginst->container = gklass->generic_container) != NULL);
+
+ /*
+ * Create the klass before parsing the type arguments.
+ * This is required to support "recursive" definitions.
+ * See mcs/tests/gen-23.cs for an example.
+ */
+
+ ginst->init_pending = TRUE;
+
+ mono_class_create_generic (ginst);
+
+ for (i = 0; i < ginst->type_argc; i++) {
+ MonoType *t = mono_metadata_parse_type_full (m, generic_container, MONO_PARSE_TYPE, 0, ptr, &ptr);
+
+ ginst->type_argv [i] = t;
+ if (!ginst->is_open)
+ ginst->is_open = mono_class_is_open_constructed_type (t);
+ }
+
+
+ if (rptr)
+ *rptr = ptr;
+
+ /*
+ * We may be called multiple times on different metadata to create the same
+ * instantiated type. This happens for instance if we're part of a method or
+ * local variable signature.
+ *
+ * It's important to return the same MonoGenericInst * for each particualar
+ * instantiation of a generic type (ie "Stack<Int32>") to make static fields
+ * work.
+ *
+ * According to the spec ($26.1.5), a static variable in a generic class
+ * declaration is shared amongst all instances of the same closed constructed
+ * type.
+ */
+
+ cached = g_hash_table_lookup (m->generic_inst_cache, ginst);
+ if (cached) {
+ g_free (ginst->klass);
+ g_free (ginst->type_argv);
+ g_free (ginst);
+
+ type->data.generic_inst = cached;
+ return;
+ } else {
+ g_hash_table_insert (m->generic_inst_cache, ginst, ginst);
+
+ mono_stats.generic_instance_count++;
+ mono_stats.generics_metadata_size += sizeof (MonoGenericInst) +
+ sizeof (MonoGenericContext) +
+ ginst->type_argc * sizeof (MonoType);
+ }
+
+ ginst->init_pending = FALSE;
+}
+
+/*
+ * do_mono_metadata_parse_generic_param:
+ * @generic_container: Our MonoClass's or MonoMethodNormal's MonoGenericContainer;
+ * see mono_metadata_parse_type_full() for details.
+ * Internal routine to parse a generic type parameter.
+ */
+static MonoGenericParam *
+mono_metadata_parse_generic_param (MonoImage *m, MonoGenericContainer *generic_container,
+ gboolean is_mvar, const char *ptr, const char **rptr)
+{
+ int index;
+
+ index = mono_metadata_decode_value (ptr, &ptr);
+ if (rptr)
+ *rptr = ptr;
+
+ if (!is_mvar) {
+ g_assert (generic_container);
+ if (generic_container->parent) {
+ /*
+ * The current MonoGenericContainer is a generic method -> its `parent'
+ * points to the containing class'es container.
+ */
+ generic_container = generic_container->parent;
+ }
+ g_assert (generic_container && !generic_container->is_method);
+ g_assert (index < generic_container->type_argc);
+
+ return &generic_container->type_params [index];
+ } else {
+ g_assert (generic_container && (generic_container->is_method || generic_container->is_signature));
+ g_assert (index < generic_container->type_argc);
+
+ return &generic_container->type_params [index];
+ }
+}
+
/*
* do_mono_metadata_parse_type:
* @type: MonoType to be filled in with the return value
@@ -1331,7 +1653,8 @@ mono_metadata_free_method_signature (MonoMethodSignature *sig)
* This extracts a Type as specified in Partition II (22.2.12)
*/
static void
-do_mono_metadata_parse_type (MonoType *type, MonoImage *m, const char *ptr, const char **rptr)
+do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer *generic_container,
+ const char *ptr, const char **rptr)
{
type->type = mono_metadata_decode_value (ptr, &ptr);
@@ -1362,18 +1685,36 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, const char *ptr, cons
type->data.klass = mono_class_get (m, token);
break;
}
- case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_SZARRAY: {
+ MonoType *etype = mono_metadata_parse_type_full (m, generic_container, MONO_PARSE_MOD_TYPE, 0, ptr, &ptr);
+ type->data.klass = mono_class_from_mono_type (etype);
+ mono_metadata_free_type (etype);
+ break;
+ }
case MONO_TYPE_PTR:
- type->data.type = mono_metadata_parse_type (m, MONO_PARSE_MOD_TYPE, 0, ptr, &ptr);
+ type->data.type = mono_metadata_parse_type_full (m, generic_container, MONO_PARSE_MOD_TYPE, 0, ptr, &ptr);
break;
case MONO_TYPE_FNPTR:
- type->data.method = mono_metadata_parse_method_signature (m, 0, ptr, &ptr);
+ type->data.method = mono_metadata_parse_method_signature_full (m, generic_container, 0, ptr, &ptr);
break;
case MONO_TYPE_ARRAY:
- type->data.array = mono_metadata_parse_array (m, ptr, &ptr);
+ type->data.array = mono_metadata_parse_array_full (m, generic_container, ptr, &ptr);
+ break;
+
+ case MONO_TYPE_MVAR:
+ type->data.generic_param = mono_metadata_parse_generic_param (m, generic_container, TRUE, ptr, &ptr);
break;
+
+ case MONO_TYPE_VAR:
+ type->data.generic_param = mono_metadata_parse_generic_param (m, generic_container, FALSE, ptr, &ptr);
+ break;
+
+ case MONO_TYPE_GENERICINST:
+ do_mono_metadata_parse_generic_inst (type, m, generic_container, ptr, &ptr);
+ break;
+
default:
- g_error ("type 0x%02x not handled in mono_metadata_parse_type", type->type);
+ g_error ("type 0x%02x not handled in do_mono_metadata_parse_type", type->type);
}
if (rptr)
@@ -1391,8 +1732,18 @@ mono_metadata_free_type (MonoType *type)
{
if (type >= builtin_types && type < builtin_types + NBUILTIN_TYPES ())
return;
+
switch (type->type){
- case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ if (!type->data.klass)
+ break;
+ /* fall through */
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_VALUETYPE:
+ if (type == &type->data.klass->byval_arg || type == &type->data.klass->this_arg)
+ return;
+ break;
case MONO_TYPE_PTR:
mono_metadata_free_type (type->data.type);
break;
@@ -1434,7 +1785,7 @@ hex_dump (const char *buffer, int base, int count)
* @ptr: Points to the beginning of the Section Data (25.3)
*/
static void
-parse_section_data (MonoMethodHeader *mh, const unsigned char *ptr)
+parse_section_data (MonoImage *m, MonoMethodHeader *mh, const unsigned char *ptr)
{
unsigned char sect_data_flags;
const unsigned char *sptr;
@@ -1472,9 +1823,8 @@ parse_section_data (MonoMethodHeader *mh, const unsigned char *ptr)
mh->clauses = g_new0 (MonoExceptionClause, mh->num_clauses);
for (i = 0; i < mh->num_clauses; ++i) {
MonoExceptionClause *ec = &mh->clauses [i];
-
+ guint32 tof_value;
if (is_fat) {
- /* we could memcpy and byteswap */
ec->flags = read32 (p);
p += 4;
ec->try_offset = read32 (p);
@@ -1485,7 +1835,7 @@ parse_section_data (MonoMethodHeader *mh, const unsigned char *ptr)
p += 4;
ec->handler_len = read32 (p);
p += 4;
- ec->token_or_filter = read32 (p);
+ tof_value = read32 (p);
p += 4;
} else {
ec->flags = read16 (p);
@@ -1498,9 +1848,16 @@ parse_section_data (MonoMethodHeader *mh, const unsigned char *ptr)
p += 2;
ec->handler_len = *p;
++p;
- ec->token_or_filter = read32 (p);
+ tof_value = read32 (p);
p += 4;
}
+ if (ec->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ ec->data.filter_offset = tof_value;
+ } else if (ec->flags == MONO_EXCEPTION_CLAUSE_NONE) {
+ ec->data.catch_class = tof_value? mono_class_get (m, tof_value): 0;
+ } else {
+ ec->data.catch_class = NULL;
+ }
/* g_print ("try %d: %x %04x-%04x %04x\n", i, ec->flags, ec->try_offset, ec->try_offset+ec->try_len, ec->try_len); */
}
@@ -1523,7 +1880,7 @@ parse_section_data (MonoMethodHeader *mh, const unsigned char *ptr)
* Returns: a MonoMethodHeader.
*/
MonoMethodHeader *
-mono_metadata_parse_mh (MonoImage *m, const char *ptr)
+mono_metadata_parse_mh_full (MonoImage *m, MonoGenericContainer *generic_container, const char *ptr)
{
MonoMethodHeader *mh;
unsigned char flags = *(const unsigned char *) ptr;
@@ -1605,7 +1962,8 @@ mono_metadata_parse_mh (MonoImage *m, const char *ptr)
mh = g_malloc0 (sizeof (MonoMethodHeader) + (len - MONO_ZERO_LEN_ARRAY) * sizeof (MonoType*));
mh->num_locals = len;
for (i = 0; i < len; ++i)
- mh->locals [i] = mono_metadata_parse_type (m, MONO_PARSE_LOCAL, 0, locals_ptr, &locals_ptr);
+ mh->locals [i] = mono_metadata_parse_type_full (
+ m, generic_container, MONO_PARSE_LOCAL, 0, locals_ptr, &locals_ptr);
} else {
mh = g_new0 (MonoMethodHeader, 1);
}
@@ -1614,10 +1972,16 @@ mono_metadata_parse_mh (MonoImage *m, const char *ptr)
mh->max_stack = max_stack;
mh->init_locals = init_locals;
if (fat_flags & METHOD_HEADER_MORE_SECTS)
- parse_section_data (mh, (const unsigned char*)ptr);
+ parse_section_data (m, mh, (const unsigned char*)ptr);
return mh;
}
+MonoMethodHeader *
+mono_metadata_parse_mh (MonoImage *m, const char *ptr)
+{
+ return mono_metadata_parse_mh_full (m, NULL, ptr);
+}
+
/*
* mono_metadata_free_mh:
* @mh: a method header
@@ -1711,8 +2075,6 @@ typedef struct {
guint32 result;
} locator_t;
-#define CSIZE(x) (sizeof (x) / 4)
-
/*
* How the row locator works.
*
@@ -1862,7 +2224,7 @@ mono_metadata_typedef_from_method (MonoImage *meta, guint32 index)
* The number of elemnts in the array is returned in @count.
*/
MonoClass**
-mono_metadata_interfaces_from_typedef (MonoImage *meta, guint32 index, guint *count)
+mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, guint *count, MonoGenericContext *context)
{
MonoTableInfo *tdef = &meta->tables [MONO_TABLE_INTERFACEIMPL];
locator_t loc;
@@ -1899,13 +2261,20 @@ mono_metadata_interfaces_from_typedef (MonoImage *meta, guint32 index, guint *co
if (cols [MONO_INTERFACEIMPL_CLASS] != loc.idx)
break;
result = g_renew (MonoClass*, result, i + 1);
- result [i] = mono_class_get (meta, mono_metadata_token_from_dor (cols [MONO_INTERFACEIMPL_INTERFACE]));
+ result [i] = mono_class_get_full (
+ meta, mono_metadata_token_from_dor (cols [MONO_INTERFACEIMPL_INTERFACE]), context);
*count = ++i;
++start;
}
return result;
}
+MonoClass**
+mono_metadata_interfaces_from_typedef (MonoImage *meta, guint32 index, guint *count)
+{
+ return mono_metadata_interfaces_from_typedef_full (meta, index, count, NULL);
+}
+
/*
* mono_metadata_nested_in_typedef:
* @meta: metadata context
@@ -1941,37 +2310,33 @@ mono_metadata_nested_in_typedef (MonoImage *meta, guint32 index)
* @index: typedef token
*
* Returns: the 1-based index into the TypeDef table of the first type
- * that is nested inside the type described by @index.
- * Retruns 0 if @index doesn't have nested types.
+ * that is nested inside the type described by @index. The search starts at
+ * @start_index.
+ * Returns 0 if no such type is found.
*/
guint32
-mono_metadata_nesting_typedef (MonoImage *meta, guint32 index)
+mono_metadata_nesting_typedef (MonoImage *meta, guint32 index, guint32 start_index)
{
MonoTableInfo *tdef = &meta->tables [MONO_TABLE_NESTEDCLASS];
- locator_t loc;
guint32 start;
+ guint32 class_index = mono_metadata_token_index (index);
if (!tdef->base)
return 0;
- loc.idx = mono_metadata_token_index (index);
- loc.col_idx = MONO_NESTED_CLASS_ENCLOSING;
- loc.t = tdef;
-
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
- return 0;
-
- start = loc.result;
+ start = start_index;
- while (start > 0) {
- if (loc.idx == mono_metadata_decode_row_col (tdef, start - 1, MONO_NESTED_CLASS_ENCLOSING))
- start--;
- else
+ while (start <= tdef->rows) {
+ if (class_index == mono_metadata_decode_row_col (tdef, start - 1, MONO_NESTED_CLASS_ENCLOSING))
break;
+ else
+ start++;
}
- /* loc_result is 0..1, needs to be mapped to table index (that is +1) */
- return start + 1;
+ if (start > tdef->rows)
+ return 0;
+ else
+ return start;
}
/*
@@ -2010,8 +2375,58 @@ mono_metadata_packing_from_typedef (MonoImage *meta, guint32 index, guint32 *pac
return loc.result + 1;
}
+/*
+ * mono_metadata_custom_attrs_from_index:
+ * @meta: metadata context
+ * @index: token representing the parent
+ *
+ * Returns: the 1-based index into the CustomAttribute table of the first
+ * attribute which belongs to the metadata object described by @index.
+ * Returns 0 if no such attribute is found.
+ */
+guint32
+mono_metadata_custom_attrs_from_index (MonoImage *meta, guint32 index)
+{
+ MonoTableInfo *tdef = &meta->tables [MONO_TABLE_CUSTOMATTRIBUTE];
+ locator_t loc;
+
+ if (!tdef->base)
+ return 0;
+
+ loc.idx = index;
+ loc.col_idx = MONO_CUSTOM_ATTR_PARENT;
+ loc.t = tdef;
+
+ if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ return 0;
+
+ /* Find the first entry by searching backwards */
+ while ((loc.result > 0) && (mono_metadata_decode_row_col (tdef, loc.result - 1, MONO_CUSTOM_ATTR_PARENT) == index))
+ loc.result --;
+
+ /* loc_result is 0..1, needs to be mapped to table index (that is +1) */
+ return loc.result + 1;
+}
+
+#ifdef DEBUG
+static void
+mono_backtrace (int limit)
+{
+ void *array[limit];
+ char **names;
+ int i;
+ backtrace (array, limit);
+ names = backtrace_symbols (array, limit);
+ for (i =0; i < limit; ++i) {
+ g_print ("\t%s\n", names [i]);
+ }
+ g_free (names);
+}
+#endif
+
#ifndef __GNUC__
-#define __alignof__(a) sizeof(a)
+/*#define __alignof__(a) sizeof(a)*/
+#define __alignof__(type) G_STRUCT_OFFSET(struct { char c; type x; }, x)
#endif
/*
@@ -2038,23 +2453,17 @@ mono_type_size (MonoType *t, gint *align)
*align = 1;
return 0;
case MONO_TYPE_BOOLEAN:
- *align = __alignof__(char);
- return sizeof (char);
-
- case MONO_TYPE_CHAR:
- *align = __alignof__(short);
- return sizeof (short);
-
+ *align = __alignof__(gint8);
+ return 1;
case MONO_TYPE_I1:
case MONO_TYPE_U1:
- *align = __alignof__(char);
+ *align = __alignof__(gint8);
return 1;
-
+ case MONO_TYPE_CHAR:
case MONO_TYPE_I2:
case MONO_TYPE_U2:
*align = __alignof__(gint16);
- return 2;
-
+ return 2;
case MONO_TYPE_I4:
case MONO_TYPE_U4:
*align = __alignof__(gint32);
@@ -2062,50 +2471,61 @@ mono_type_size (MonoType *t, gint *align)
case MONO_TYPE_R4:
*align = __alignof__(float);
return 4;
-
case MONO_TYPE_I8:
case MONO_TYPE_U8:
*align = __alignof__(gint64);
+ return 8;
case MONO_TYPE_R8:
*align = __alignof__(double);
- return 8;
-
+ return 8;
case MONO_TYPE_I:
case MONO_TYPE_U:
*align = __alignof__(gpointer);
return sizeof (gpointer);
-
case MONO_TYPE_STRING:
*align = __alignof__(gpointer);
return sizeof (gpointer);
-
case MONO_TYPE_OBJECT:
*align = __alignof__(gpointer);
return sizeof (gpointer);
-
case MONO_TYPE_VALUETYPE: {
- guint32 size;
-
- if (!t->data.klass->size_inited)
- mono_class_init (t->data.klass);
-
- if (t->data.klass->enumtype) {
+ if (t->data.klass->enumtype)
return mono_type_size (t->data.klass->enum_basetype, align);
- } else {
- size = mono_class_value_size (t->data.klass, align);
- return size;
- }
+ else
+ return mono_class_value_size (t->data.klass, align);
}
case MONO_TYPE_CLASS:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
case MONO_TYPE_ARRAY:
- case MONO_TYPE_TYPEDBYREF: /* we may want to use a struct {MonoType* type, void *data } instead ...*/
+ *align = __alignof__(gpointer);
+ return sizeof (gpointer);
+ case MONO_TYPE_TYPEDBYREF:
+ return mono_class_value_size (mono_defaults.typed_reference_class, align);
+ case MONO_TYPE_GENERICINST: {
+ MonoGenericInst *ginst = t->data.generic_inst;
+
+ g_assert (!ginst->is_open && !ginst->klass->generic_container);
+
+ if (MONO_TYPE_ISSTRUCT (ginst->generic_type)) {
+ MonoClass *gklass = mono_class_from_mono_type (ginst->generic_type);
+
+ if (gklass->enumtype)
+ return mono_type_size (gklass->enum_basetype, align);
+ else
+ return mono_class_value_size (ginst->klass, align);
+ } else {
+ *align = __alignof__(gpointer);
+ return sizeof (gpointer);
+ }
+ }
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
*align = __alignof__(gpointer);
return sizeof (gpointer);
default:
- g_error ("type 0x%02x unknown", t->type);
+ g_error ("mono_type_size: type 0x%02x unknown", t->type);
}
return 0;
}
@@ -2120,8 +2540,13 @@ mono_type_size (MonoType *t, gint *align)
int
mono_type_stack_size (MonoType *t, gint *align)
{
+ int tmp;
+
g_assert (t != NULL);
+ if (!align)
+ align = &tmp;
+
if (t->byref) {
*align = __alignof__(gpointer);
return sizeof (gpointer);
@@ -2145,20 +2570,21 @@ mono_type_stack_size (MonoType *t, gint *align)
case MONO_TYPE_PTR:
case MONO_TYPE_FNPTR:
case MONO_TYPE_ARRAY:
- case MONO_TYPE_TYPEDBYREF:
*align = __alignof__(gpointer);
return sizeof (gpointer);
+ case MONO_TYPE_TYPEDBYREF:
+ *align = __alignof__(gpointer);
+ return sizeof (gpointer) * 3;
case MONO_TYPE_R4:
*align = __alignof__(float);
- return 4;
-
+ return sizeof (float);
case MONO_TYPE_I8:
case MONO_TYPE_U8:
*align = __alignof__(gint64);
+ return sizeof (gint64);
case MONO_TYPE_R8:
*align = __alignof__(double);
- return 8;
-
+ return sizeof (double);
case MONO_TYPE_VALUETYPE: {
guint32 size;
@@ -2166,16 +2592,82 @@ mono_type_stack_size (MonoType *t, gint *align)
return mono_type_stack_size (t->data.klass->enum_basetype, align);
else {
size = mono_class_value_size (t->data.klass, align);
- *align = __alignof__(gpointer);
+
+ *align = *align + __alignof__(gpointer) - 1;
+ *align &= ~(__alignof__(gpointer) - 1);
+
+ size += sizeof (gpointer) - 1;
+ size &= ~(sizeof (gpointer) - 1);
+
return size;
}
}
+ case MONO_TYPE_GENERICINST: {
+ MonoGenericInst *ginst = t->data.generic_inst;
+
+ g_assert (!ginst->is_open && !ginst->klass->generic_container);
+
+ if (MONO_TYPE_ISSTRUCT (ginst->generic_type)) {
+ MonoClass *gklass = mono_class_from_mono_type (ginst->generic_type);
+
+ if (gklass->enumtype)
+ return mono_type_stack_size (gklass->enum_basetype, align);
+ else {
+ guint32 size = mono_class_value_size (ginst->klass, align);
+
+ *align = *align + __alignof__(gpointer) - 1;
+ *align &= ~(__alignof__(gpointer) - 1);
+
+ size += sizeof (gpointer) - 1;
+ size &= ~(sizeof (gpointer) - 1);
+
+ return size;
+ }
+ } else {
+ *align = __alignof__(gpointer);
+ return sizeof (gpointer);
+ }
+ }
default:
g_error ("type 0x%02x unknown", t->type);
}
return 0;
}
+gboolean
+mono_metadata_generic_inst_is_valuetype (MonoGenericInst *ginst)
+{
+ return MONO_TYPE_ISSTRUCT (ginst->generic_type);
+}
+
+guint
+mono_metadata_generic_inst_hash (MonoGenericInst *ginst)
+{
+ return mono_metadata_type_hash (ginst->generic_type);
+}
+
+static gboolean
+_mono_metadata_generic_inst_equal (MonoGenericInst *g1, MonoGenericInst *g2, gboolean signature_only)
+{
+ int i;
+
+ if (g1->type_argc != g2->type_argc)
+ return FALSE;
+ if (!do_mono_metadata_type_equal (g1->generic_type, g2->generic_type, signature_only))
+ return FALSE;
+ for (i = 0; i < g1->type_argc; ++i) {
+ if (!do_mono_metadata_type_equal (g1->type_argv [i], g2->type_argv [i], signature_only))
+ return FALSE;
+ }
+ return TRUE;
+}
+
+gboolean
+mono_metadata_generic_inst_equal (MonoGenericInst *g1, MonoGenericInst *g2)
+{
+ return _mono_metadata_generic_inst_equal (g1, g2, FALSE);
+}
+
/*
* mono_metadata_type_hash:
* @t1: a type
@@ -2191,15 +2683,55 @@ mono_metadata_type_hash (MonoType *t1)
switch (t1->type) {
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
/* check if the distribution is good enough */
- return hash << 7 | g_str_hash (t1->data.klass->name);
+ return ((hash << 5) - hash) ^ g_str_hash (t1->data.klass->name);
case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- return hash << 7 | mono_metadata_type_hash (t1->data.type);
+ return ((hash << 5) - hash) ^ mono_metadata_type_hash (t1->data.type);
+ case MONO_TYPE_ARRAY:
+ return ((hash << 5) - hash) ^ mono_metadata_type_hash (&t1->data.array->eklass->byval_arg);
+ case MONO_TYPE_GENERICINST:
+ return ((hash << 5) - hash) ^ mono_metadata_generic_inst_hash (t1->data.generic_inst);
}
return hash;
}
+static gboolean
+mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2, gboolean signature_only)
+{
+ if (p1 == p2)
+ return TRUE;
+ if (p1->num != p2->num)
+ return FALSE;
+
+ g_assert (p1->owner && p2->owner);
+ if (p1->owner == p2->owner)
+ return TRUE;
+
+ /*
+ * If `signature_only' is true, we're comparing two (method) signatures.
+ * In this case, the owner of two type parameters doesn't need to match.
+ */
+
+ return signature_only;
+}
+
+static gboolean
+mono_metadata_class_equal (MonoClass *c1, MonoClass *c2, gboolean signature_only)
+{
+ if (c1 == c2)
+ return TRUE;
+ if (c1->generic_inst && c2->generic_inst)
+ return _mono_metadata_generic_inst_equal (c1->generic_inst, c2->generic_inst, signature_only);
+ if ((c1->byval_arg.type == MONO_TYPE_VAR) && (c2->byval_arg.type == MONO_TYPE_VAR))
+ return mono_metadata_generic_param_equal (
+ c1->byval_arg.data.generic_param, c2->byval_arg.data.generic_param, FALSE);
+ if ((c1->byval_arg.type == MONO_TYPE_MVAR) && (c2->byval_arg.type == MONO_TYPE_MVAR))
+ return mono_metadata_generic_param_equal (
+ c1->byval_arg.data.generic_param, c2->byval_arg.data.generic_param, signature_only);
+ return FALSE;
+}
+
/*
* mono_metadata_type_equal:
* @t1: a type
@@ -2208,8 +2740,8 @@ mono_metadata_type_hash (MonoType *t1)
* Determine if @t1 and @t2 represent the same type.
* Returns: #TRUE if @t1 and @t2 are equal.
*/
-gboolean
-mono_metadata_type_equal (MonoType *t1, MonoType *t2)
+static gboolean
+do_mono_metadata_type_equal (MonoType *t1, MonoType *t2, gboolean signature_only)
{
if (t1->type != t2->type ||
t1->byref != t2->byref)
@@ -2233,17 +2765,27 @@ mono_metadata_type_equal (MonoType *t1, MonoType *t2)
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_TYPEDBYREF:
return TRUE;
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_CLASS:
- return t1->data.klass == t2->data.klass;
- case MONO_TYPE_PTR:
case MONO_TYPE_SZARRAY:
- return mono_metadata_type_equal (t1->data.type, t2->data.type);
+ return mono_metadata_class_equal (t1->data.klass, t2->data.klass, signature_only);
+ case MONO_TYPE_PTR:
+ return do_mono_metadata_type_equal (t1->data.type, t2->data.type, signature_only);
case MONO_TYPE_ARRAY:
if (t1->data.array->rank != t2->data.array->rank)
return FALSE;
- return mono_metadata_type_equal (t1->data.array->type, t2->data.array->type);
+ return mono_metadata_class_equal (t1->data.array->eklass, t2->data.array->eklass, signature_only);
+ case MONO_TYPE_GENERICINST:
+ return _mono_metadata_generic_inst_equal (
+ t1->data.generic_inst, t2->data.generic_inst, signature_only);
+ case MONO_TYPE_VAR:
+ return mono_metadata_generic_param_equal (
+ t1->data.generic_param, t2->data.generic_param, FALSE);
+ case MONO_TYPE_MVAR:
+ return mono_metadata_generic_param_equal (
+ t1->data.generic_param, t2->data.generic_param, signature_only);
default:
g_error ("implement type compare for %0x!", t1->type);
return FALSE;
@@ -2252,6 +2794,12 @@ mono_metadata_type_equal (MonoType *t1, MonoType *t2)
return FALSE;
}
+gboolean
+mono_metadata_type_equal (MonoType *t1, MonoType *t2)
+{
+ return do_mono_metadata_type_equal (t1, t2, FALSE);
+}
+
/*
* mono_metadata_signature_equal:
* @sig1: a signature
@@ -2270,22 +2818,42 @@ mono_metadata_signature_equal (MonoMethodSignature *sig1, MonoMethodSignature *s
sig1->param_count != sig2->param_count)
return FALSE;
+ /*
+ * We're just comparing the signatures of two methods here:
+ *
+ * If we have two generic methods `void Foo<U> (U u)' and `void Bar<V> (V v)',
+ * U and V are equal here.
+ *
+ * That's what the `signature_only' argument of do_mono_metadata_type_equal() is for.
+ */
+
for (i = 0; i < sig1->param_count; i++) {
MonoType *p1 = sig1->params[i];
MonoType *p2 = sig2->params[i];
- if (p1->attrs != p2->attrs)
+ /* if (p1->attrs != p2->attrs)
return FALSE;
-
- if (!mono_metadata_type_equal (p1, p2))
+ */
+ if (!do_mono_metadata_type_equal (p1, p2, TRUE))
return FALSE;
}
- if (!mono_metadata_type_equal (sig1->ret, sig2->ret))
+ if (!do_mono_metadata_type_equal (sig1->ret, sig2->ret, TRUE))
return FALSE;
return TRUE;
}
+guint
+mono_signature_hash (MonoMethodSignature *sig)
+{
+ guint i, res = sig->ret->type;
+
+ for (i = 0; i < sig->param_count; i++)
+ res = (res << 5) - res + sig->params[i]->type;
+
+ return res;
+}
+
/*
* mono_metadata_encode_value:
* @value: value to encode
@@ -2301,9 +2869,9 @@ mono_metadata_encode_value (guint32 value, char *buf, char **endbuf)
{
char *p = buf;
- if (value <= 127)
+ if (value < 0x80)
*p++ = value;
- else if (value <= 16384) {
+ else if (value < 0x4000) {
p [0] = 0x80 | (value >> 8);
p [1] = value & 0xff;
p += 2;
@@ -2326,16 +2894,17 @@ mono_metadata_encode_value (guint32 value, char *buf, char **endbuf)
* may have been specified for the field in a FieldLayout table
* @rva: a pointer to the RVA of the field data in the image that
* may have been defined in a FieldRVA table
- * @marshal_info: a pointer to the marshal signature that may have been
+ * @marshal_spec: a pointer to the marshal spec that may have been
* defined for the field in a FieldMarshal table.
*
* Gather info for field @index that may have been defined in the FieldLayout,
* FieldRVA and FieldMarshal tables.
- * Either of offset, rva and marshal_info can be NULL if you're not interested
+ * Either of offset, rva and marshal_spec can be NULL if you're not interested
* in the data.
*/
void
-mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, const char **marshal_info)
+mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva,
+ MonoMarshalSpec **marshal_spec)
{
MonoTableInfo *tdef;
locator_t loc;
@@ -2358,7 +2927,7 @@ mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint
loc.col_idx = MONO_FIELD_RVA_FIELD;
loc.t = tdef;
-
+
if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
/*
* LAMESPEC: There is no signature, no nothing, just the raw data.
@@ -2368,6 +2937,13 @@ mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint
*rva = 0;
}
}
+ if (marshal_spec) {
+ const char *p;
+
+ if ((p = mono_metadata_get_marshal_info (meta, index, TRUE))) {
+ *marshal_spec = mono_metadata_parse_marshal_spec (meta, p);
+ }
+ }
}
@@ -2375,29 +2951,30 @@ mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint
* mono_metadata_get_constant_index:
* @meta: the Image the field is defined in
* @index: the token that may have a row defined in the constants table
+ * @hint: possible position for the row
*
* @token must be a FieldDef, ParamDef or PropertyDef token.
*
- * Returns: the index into the Constsnts table or 0 if not found.
+ * Returns: the index into the Constants table or 0 if not found.
*/
guint32
-mono_metadata_get_constant_index (MonoImage *meta, guint32 token)
+mono_metadata_get_constant_index (MonoImage *meta, guint32 token, guint32 hint)
{
MonoTableInfo *tdef;
locator_t loc;
guint32 index = mono_metadata_token_index (token);
tdef = &meta->tables [MONO_TABLE_CONSTANT];
- index <<= HASCONSTANT_BITS;
+ index <<= MONO_HASCONSTANT_BITS;
switch (mono_metadata_token_table (token)) {
case MONO_TABLE_FIELD:
- index |= HASCONSTANT_FIEDDEF;
+ index |= MONO_HASCONSTANT_FIEDDEF;
break;
case MONO_TABLE_PARAM:
- index |= HASCONSTANT_PARAM;
+ index |= MONO_HASCONSTANT_PARAM;
break;
case MONO_TABLE_PROPERTY:
- index |= HASCONSTANT_PROPERTY;
+ index |= MONO_HASCONSTANT_PROPERTY;
break;
default:
g_warning ("Not a valid token for the constant table: 0x%08x", token);
@@ -2407,6 +2984,9 @@ mono_metadata_get_constant_index (MonoImage *meta, guint32 token)
loc.col_idx = MONO_CONSTANT_PARENT;
loc.t = tdef;
+ if ((hint > 0) && (hint < tdef->rows) && (mono_metadata_decode_row_col (tdef, hint - 1, MONO_CONSTANT_PARENT) == index))
+ return hint;
+
if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
return loc.result + 1;
}
@@ -2475,7 +3055,7 @@ mono_metadata_methods_from_event (MonoImage *meta, guint32 index, guint *end_i
loc.t = msemt;
loc.col_idx = MONO_METHOD_SEMA_ASSOCIATION;
- loc.idx = ((index + 1) << HAS_SEMANTICS_BITS) | HAS_SEMANTICS_EVENT; /* Method association coded index */
+ loc.idx = ((index + 1) << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_EVENT; /* Method association coded index */
if (!bsearch (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
return 0;
@@ -2563,7 +3143,7 @@ mono_metadata_methods_from_property (MonoImage *meta, guint32 index, guint *en
loc.t = msemt;
loc.col_idx = MONO_METHOD_SEMA_ASSOCIATION;
- loc.idx = ((index + 1) << HAS_SEMANTICS_BITS) | HAS_SEMANTICS_PROPERTY; /* Method association coded index */
+ loc.idx = ((index + 1) << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_PROPERTY; /* Method association coded index */
if (!bsearch (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
return 0;
@@ -2600,7 +3180,7 @@ mono_metadata_implmap_from_method (MonoImage *meta, guint32 method_idx)
loc.t = tdef;
loc.col_idx = MONO_IMPLMAP_MEMBER;
- loc.idx = ((method_idx + 1) << MEMBERFORWD_BITS) | MEMBERFORWD_METHODDEF;
+ loc.idx = ((method_idx + 1) << MONO_MEMBERFORWD_BITS) | MONO_MEMBERFORWD_METHODDEF;
if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
@@ -2616,7 +3196,7 @@ mono_metadata_implmap_from_method (MonoImage *meta, guint32 method_idx)
* token.
*/
MonoType *
-mono_type_create_from_typespec (MonoImage *image, guint32 type_spec)
+mono_type_create_from_typespec_full (MonoImage *image, MonoGenericContainer *generic_container, guint32 type_spec)
{
guint32 idx = mono_metadata_token_index (type_spec);
MonoTableInfo *t;
@@ -2625,16 +3205,258 @@ mono_type_create_from_typespec (MonoImage *image, guint32 type_spec)
guint32 len;
MonoType *type;
+ mono_loader_lock ();
+
+ if ((type = g_hash_table_lookup (image->typespec_cache, GUINT_TO_POINTER (type_spec)))) {
+ mono_loader_unlock ();
+ return type;
+ }
+
t = &image->tables [MONO_TABLE_TYPESPEC];
mono_metadata_decode_row (t, idx-1, cols, MONO_TYPESPEC_SIZE);
ptr = mono_metadata_blob_heap (image, cols [MONO_TYPESPEC_SIGNATURE]);
len = mono_metadata_decode_value (ptr, &ptr);
- type = mono_metadata_parse_type (image, MONO_PARSE_TYPE, 0, ptr, &ptr);
+
+ type = g_new0 (MonoType, 1);
+
+ g_hash_table_insert (image->typespec_cache, GUINT_TO_POINTER (type_spec), type);
+
+ if (*ptr == MONO_TYPE_BYREF) {
+ type->byref = 1;
+ ptr++;
+ }
+
+ do_mono_metadata_parse_type (type, image, generic_container, ptr, &ptr);
+
+ mono_loader_unlock ();
return type;
}
+MonoType *
+mono_type_create_from_typespec (MonoImage *image, guint32 type_spec)
+{
+ return mono_type_create_from_typespec_full (image, NULL, type_spec);
+}
+
+MonoMarshalSpec *
+mono_metadata_parse_marshal_spec (MonoImage *image, const char *ptr)
+{
+ MonoMarshalSpec *res;
+ int len;
+ const char *start = ptr;
+
+ /* fixme: this is incomplete, but I cant find more infos in the specs */
+
+ res = g_new0 (MonoMarshalSpec, 1);
+
+ len = mono_metadata_decode_value (ptr, &ptr);
+ res->native = *ptr++;
+
+ if (res->native == MONO_NATIVE_LPARRAY) {
+ if (ptr - start <= len)
+ res->data.array_data.elem_type = *ptr++;
+ if (ptr - start <= len)
+ res->data.array_data.param_num = mono_metadata_decode_value (ptr, &ptr);
+ if (ptr - start <= len)
+ res->data.array_data.num_elem = mono_metadata_decode_value (ptr, &ptr);
+ }
+
+ if (res->native == MONO_NATIVE_BYVALTSTR) {
+ if (ptr - start <= len)
+ res->data.array_data.num_elem = mono_metadata_decode_value (ptr, &ptr);
+ }
+
+ if (res->native == MONO_NATIVE_BYVALARRAY) {
+ if (ptr - start <= len)
+ res->data.array_data.num_elem = mono_metadata_decode_value (ptr, &ptr);
+ }
+
+ if (res->native == MONO_NATIVE_CUSTOM) {
+ /* skip unused type guid */
+ len = mono_metadata_decode_value (ptr, &ptr);
+ ptr += len;
+ /* skip unused native type name */
+ len = mono_metadata_decode_value (ptr, &ptr);
+ ptr += len;
+ /* read custom marshaler type name */
+ len = mono_metadata_decode_value (ptr, &ptr);
+ res->data.custom_data.custom_name = g_strndup (ptr, len);
+ ptr += len;
+ /* read cookie string */
+ len = mono_metadata_decode_value (ptr, &ptr);
+ res->data.custom_data.cookie = g_strndup (ptr, len);
+ }
+
+ return res;
+}
+
+void
+mono_metadata_free_marshal_spec (MonoMarshalSpec *spec)
+{
+ if (spec->native == MONO_NATIVE_CUSTOM) {
+ g_free (spec->data.custom_data.custom_name);
+ g_free (spec->data.custom_data.cookie);
+ }
+ g_free (spec);
+}
+
+guint32
+mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_field,
+ gboolean unicode, MonoMarshalConv *conv)
+{
+ MonoMarshalConv dummy_conv;
+ int t = type->type;
+
+ if (!conv)
+ conv = &dummy_conv;
+
+ *conv = MONO_MARSHAL_CONV_NONE;
+
+ if (type->byref)
+ return MONO_NATIVE_UINT;
+
+handle_enum:
+ switch (t) {
+ case MONO_TYPE_BOOLEAN:
+ if (mspec) {
+ switch (mspec->native) {
+ case MONO_NATIVE_VARIANTBOOL:
+ *conv = MONO_MARSHAL_CONV_BOOL_VARIANTBOOL;
+ return MONO_NATIVE_VARIANTBOOL;
+ case MONO_NATIVE_BOOLEAN:
+ *conv = MONO_MARSHAL_CONV_BOOL_I4;
+ return MONO_NATIVE_BOOLEAN;
+ case MONO_NATIVE_I1:
+ case MONO_NATIVE_U1:
+ return mspec->native;
+ default:
+ g_error ("cant marshal bool to native type %02x", mspec->native);
+ }
+ }
+ *conv = MONO_MARSHAL_CONV_BOOL_I4;
+ return MONO_NATIVE_BOOLEAN;
+ case MONO_TYPE_CHAR: return MONO_NATIVE_U2;
+ case MONO_TYPE_I1: return MONO_NATIVE_I1;
+ case MONO_TYPE_U1: return MONO_NATIVE_U1;
+ case MONO_TYPE_I2: return MONO_NATIVE_I2;
+ case MONO_TYPE_U2: return MONO_NATIVE_U2;
+ case MONO_TYPE_I4: return MONO_NATIVE_I4;
+ case MONO_TYPE_U4: return MONO_NATIVE_U4;
+ case MONO_TYPE_I8: return MONO_NATIVE_I8;
+ case MONO_TYPE_U8: return MONO_NATIVE_U8;
+ case MONO_TYPE_R4: return MONO_NATIVE_R4;
+ case MONO_TYPE_R8: return MONO_NATIVE_R8;
+ case MONO_TYPE_STRING:
+ if (mspec) {
+ switch (mspec->native) {
+ case MONO_NATIVE_BSTR:
+ *conv = MONO_MARSHAL_CONV_STR_BSTR;
+ return MONO_NATIVE_BSTR;
+ case MONO_NATIVE_LPSTR:
+ *conv = MONO_MARSHAL_CONV_STR_LPSTR;
+ return MONO_NATIVE_LPSTR;
+ case MONO_NATIVE_LPWSTR:
+ *conv = MONO_MARSHAL_CONV_STR_LPWSTR;
+ return MONO_NATIVE_LPWSTR;
+ case MONO_NATIVE_LPTSTR:
+ *conv = MONO_MARSHAL_CONV_STR_LPTSTR;
+ return MONO_NATIVE_LPTSTR;
+ case MONO_NATIVE_ANSIBSTR:
+ *conv = MONO_MARSHAL_CONV_STR_ANSIBSTR;
+ return MONO_NATIVE_ANSIBSTR;
+ case MONO_NATIVE_TBSTR:
+ *conv = MONO_MARSHAL_CONV_STR_TBSTR;
+ return MONO_NATIVE_TBSTR;
+ case MONO_NATIVE_BYVALTSTR:
+ if (unicode)
+ *conv = MONO_MARSHAL_CONV_STR_BYVALWSTR;
+ else
+ *conv = MONO_MARSHAL_CONV_STR_BYVALSTR;
+ return MONO_NATIVE_BYVALTSTR;
+ default:
+ g_error ("cant marshal string to native type %02x", mspec->native);
+ }
+ }
+ *conv = MONO_MARSHAL_CONV_STR_LPTSTR;
+ return MONO_NATIVE_LPTSTR;
+ case MONO_TYPE_PTR: return MONO_NATIVE_UINT;
+ case MONO_TYPE_VALUETYPE: /*FIXME*/
+ if (type->data.klass->enumtype) {
+ t = type->data.klass->enum_basetype->type;
+ goto handle_enum;
+ }
+ return MONO_NATIVE_STRUCT;
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ if (mspec) {
+ switch (mspec->native) {
+ case MONO_NATIVE_BYVALARRAY:
+ *conv = MONO_MARSHAL_CONV_ARRAY_BYVALARRAY;
+ return MONO_NATIVE_BYVALARRAY;
+ case MONO_NATIVE_SAFEARRAY:
+ *conv = MONO_MARSHAL_CONV_ARRAY_SAVEARRAY;
+ return MONO_NATIVE_SAFEARRAY;
+ case MONO_NATIVE_LPARRAY:
+ *conv = MONO_MARSHAL_CONV_ARRAY_LPARRAY;
+ return MONO_NATIVE_LPARRAY;
+ default:
+ g_error ("cant marshal array as native type %02x", mspec->native);
+ }
+ }
+
+ *conv = MONO_MARSHAL_CONV_ARRAY_LPARRAY;
+ return MONO_NATIVE_LPARRAY;
+ case MONO_TYPE_I: return MONO_NATIVE_INT;
+ case MONO_TYPE_U: return MONO_NATIVE_UINT;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT: {
+ /* FIXME : we need to handle ArrayList and StringBuilder here, probably */
+ if (mspec) {
+ switch (mspec->native) {
+ case MONO_NATIVE_STRUCT:
+ return MONO_NATIVE_STRUCT;
+ case MONO_NATIVE_INTERFACE:
+ *conv = MONO_MARSHAL_CONV_OBJECT_INTERFACE;
+ return MONO_NATIVE_INTERFACE;
+ case MONO_NATIVE_IDISPATCH:
+ *conv = MONO_MARSHAL_CONV_OBJECT_IDISPATCH;
+ return MONO_NATIVE_IDISPATCH;
+ case MONO_NATIVE_IUNKNOWN:
+ *conv = MONO_MARSHAL_CONV_OBJECT_IUNKNOWN;
+ return MONO_NATIVE_IUNKNOWN;
+ case MONO_NATIVE_FUNC:
+ if (t == MONO_TYPE_CLASS && (type->data.klass == mono_defaults.multicastdelegate_class ||
+ type->data.klass == mono_defaults.delegate_class ||
+ type->data.klass->parent == mono_defaults.multicastdelegate_class)) {
+ *conv = MONO_MARSHAL_CONV_DEL_FTN;
+ return MONO_NATIVE_FUNC;
+ }
+ else
+ /* Fall through */
+ ;
+ default:
+ g_error ("cant marshal object as native type %02x", mspec->native);
+ }
+ }
+ if (t == MONO_TYPE_CLASS && (type->data.klass == mono_defaults.multicastdelegate_class ||
+ type->data.klass == mono_defaults.delegate_class ||
+ type->data.klass->parent == mono_defaults.multicastdelegate_class)) {
+ *conv = MONO_MARSHAL_CONV_DEL_FTN;
+ return MONO_NATIVE_FUNC;
+ }
+ *conv = MONO_MARSHAL_CONV_OBJECT_STRUCT;
+ return MONO_NATIVE_STRUCT;
+ }
+ case MONO_TYPE_FNPTR: return MONO_NATIVE_FUNC;
+ case MONO_TYPE_TYPEDBYREF:
+ default:
+ g_error ("type 0x%02x not handled in marshal", t);
+ }
+ return MONO_NATIVE_MAX;
+}
+
const char*
mono_metadata_get_marshal_info (MonoImage *meta, guint32 idx, gboolean is_field)
{
@@ -2646,7 +3468,7 @@ mono_metadata_get_marshal_info (MonoImage *meta, guint32 idx, gboolean is_field)
loc.t = tdef;
loc.col_idx = MONO_FIELD_MARSHAL_PARENT;
- loc.idx = ((idx + 1) << HAS_FIELD_MARSHAL_BITS) | (is_field? HAS_FIELD_MARSHAL_FIELDSREF: HAS_FIELD_MARSHAL_PARAMDEF);
+ loc.idx = ((idx + 1) << MONO_HAS_FIELD_MARSHAL_BITS) | (is_field? MONO_HAS_FIELD_MARSHAL_FIELDSREF: MONO_HAS_FIELD_MARSHAL_PARAMDEF);
if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return NULL;
@@ -2654,3 +3476,279 @@ mono_metadata_get_marshal_info (MonoImage *meta, guint32 idx, gboolean is_field)
return mono_metadata_blob_heap (meta, mono_metadata_decode_row_col (tdef, loc.result, MONO_FIELD_MARSHAL_NATIVE_TYPE));
}
+static MonoMethod*
+method_from_method_def_or_ref (MonoImage *m, guint32 tok)
+{
+ guint32 idx = tok >> MONO_METHODDEFORREF_BITS;
+ switch (tok & MONO_METHODDEFORREF_MASK) {
+ case MONO_METHODDEFORREF_METHODDEF:
+ return mono_get_method (m, MONO_TOKEN_METHOD_DEF | idx, NULL);
+ case MONO_METHODDEFORREF_METHODREF:
+ return mono_get_method (m, MONO_TOKEN_MEMBER_REF | idx, NULL);
+ }
+ g_assert_not_reached ();
+ return NULL;
+}
+
+MonoMethod**
+mono_class_get_overrides (MonoImage *image, guint32 type_token, gint32 *num_overrides)
+{
+ locator_t loc;
+ MonoTableInfo *tdef = &image->tables [MONO_TABLE_METHODIMPL];
+ guint32 start, end;
+ gint32 i, num;
+ guint32 cols [MONO_METHODIMPL_SIZE];
+ MonoMethod **result;
+
+ if (num_overrides)
+ *num_overrides = 0;
+
+ if (!tdef->base)
+ return NULL;
+
+ loc.t = tdef;
+ loc.col_idx = MONO_METHODIMPL_CLASS;
+ loc.idx = mono_metadata_token_index (type_token);
+
+ if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ return NULL;
+
+ start = loc.result;
+ end = start + 1;
+ /*
+ * We may end up in the middle of the rows...
+ */
+ while (start > 0) {
+ if (loc.idx == mono_metadata_decode_row_col (tdef, start - 1, MONO_METHODIMPL_CLASS))
+ start--;
+ else
+ break;
+ }
+ while (end < tdef->rows) {
+ if (loc.idx == mono_metadata_decode_row_col (tdef, end, MONO_METHODIMPL_CLASS))
+ end++;
+ else
+ break;
+ }
+ num = end - start;
+ result = g_new (MonoMethod*, num * 2);
+ for (i = 0; i < num; ++i) {
+ mono_metadata_decode_row (tdef, start + i, cols, MONO_METHODIMPL_SIZE);
+ result [i * 2] = method_from_method_def_or_ref (image, cols [MONO_METHODIMPL_DECLARATION]);
+ result [i * 2 + 1] = method_from_method_def_or_ref (image, cols [MONO_METHODIMPL_BODY]);
+ }
+
+ if (num_overrides)
+ *num_overrides = num;
+ return result;
+}
+
+/**
+ * mono_guid_to_string:
+ *
+ * Converts a 16 byte Microsoft GUID to the standard string representation.
+ */
+char *
+mono_guid_to_string (const guint8 *guid)
+{
+ return g_strdup_printf ("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X",
+ guid[3], guid[2], guid[1], guid[0],
+ guid[5], guid[4],
+ guid[7], guid[6],
+ guid[8], guid[9],
+ guid[10], guid[11], guid[12], guid[13], guid[14], guid[15]);
+}
+
+static MonoClass**
+get_constraints (MonoImage *image, int owner, MonoGenericContext *context)
+{
+ MonoTableInfo *tdef = &image->tables [MONO_TABLE_GENERICPARAMCONSTRAINT];
+ guint32 cols [MONO_GENPARCONSTRAINT_SIZE];
+ guint32 i, token, found;
+ MonoClass *klass, **res;
+ GList *cons = NULL, *tmp;
+
+
+ found = 0;
+ for (i = 0; i < tdef->rows; ++i) {
+ mono_metadata_decode_row (tdef, i, cols, MONO_GENPARCONSTRAINT_SIZE);
+ if (cols [MONO_GENPARCONSTRAINT_GENERICPAR] == owner) {
+ token = mono_metadata_token_from_dor (cols [MONO_GENPARCONSTRAINT_CONSTRAINT]);
+ klass = mono_class_get_full (image, token, context);
+ cons = g_list_append (cons, klass);
+ ++found;
+ } else {
+ /* contiguous list finished */
+ if (found)
+ break;
+ }
+ }
+ if (!found)
+ return NULL;
+ res = g_new0 (MonoClass*, found + 1);
+ for (i = 0, tmp = cons; i < found; ++i, tmp = tmp->next) {
+ res [i] = tmp->data;
+ }
+ g_list_free (cons);
+ return res;
+}
+
+MonoGenericContainer *
+mono_metadata_load_generic_params (MonoImage *image, guint32 token)
+{
+ MonoTableInfo *tdef = &image->tables [MONO_TABLE_GENERICPARAM];
+ guint32 cols [MONO_GENERICPARAM_SIZE];
+ guint32 i, owner = 0, last_num, n;
+ MonoGenericContainer *container;
+ MonoGenericParam *params;
+
+ if (mono_metadata_token_table (token) == MONO_TABLE_TYPEDEF)
+ owner = MONO_TYPEORMETHOD_TYPE;
+ else if (mono_metadata_token_table (token) == MONO_TABLE_METHOD)
+ owner = MONO_TYPEORMETHOD_METHOD;
+ else {
+ g_error ("wrong token %x to load_generics_params", token);
+ return NULL;
+ }
+ owner |= mono_metadata_token_index (token) << MONO_TYPEORMETHOD_BITS;
+ if (!tdef->base)
+ return NULL;
+
+ for (i = 0; i < tdef->rows; ++i) {
+ mono_metadata_decode_row (tdef, i, cols, MONO_GENERICPARAM_SIZE);
+ if (cols [MONO_GENERICPARAM_OWNER] == owner)
+ break;
+ }
+ last_num = 0;
+ if (i >= tdef->rows)
+ return NULL;
+ params = NULL;
+ n = 0;
+ container = g_new0 (MonoGenericContainer, 1);
+ do {
+ n++;
+ params = g_realloc (params, sizeof (MonoGenericParam) * n);
+ params [n - 1].owner = container;
+ params [n - 1].pklass = NULL;
+ params [n - 1].method = NULL;
+ params [n - 1].flags = cols [MONO_GENERICPARAM_FLAGS];
+ params [n - 1].num = cols [MONO_GENERICPARAM_NUMBER];
+ params [n - 1].name = mono_metadata_string_heap (image, cols [MONO_GENERICPARAM_NAME]);
+ if (++i >= tdef->rows)
+ break;
+ mono_metadata_decode_row (tdef, i, cols, MONO_GENERICPARAM_SIZE);
+ } while (cols [MONO_GENERICPARAM_OWNER] == owner);
+
+ container->type_argc = n;
+ container->type_params = params;
+
+ container->context = g_new0 (MonoGenericContext, 1);
+ container->context->container = container;
+
+ for (i = 0; i < n; i++)
+ params [i].constraints = get_constraints (image, i + 1, container->context);
+
+ return container;
+}
+
+gboolean
+mono_type_is_byref (MonoType *type)
+{
+ return type->byref;
+}
+
+int
+mono_type_get_type (MonoType *type)
+{
+ return type->type;
+}
+
+/* For MONO_TYPE_FNPTR */
+MonoMethodSignature*
+mono_type_get_signature (MonoType *type)
+{
+ return type->data.method;
+}
+
+/* For MONO_TYPE_CLASS, VALUETYPE */
+MonoClass*
+mono_type_get_class (MonoType *type)
+{
+ return type->data.klass;
+}
+
+/* For MONO_TYPE_ARRAY */
+MonoArrayType*
+mono_type_get_array_type (MonoType *type)
+{
+ return type->data.array;
+}
+
+MonoClass*
+mono_type_get_modifiers (MonoType *type, gboolean *is_required, gpointer *iter)
+{
+ /* FIXME: implement */
+ return NULL;
+}
+
+MonoType*
+mono_signature_get_return_type (MonoMethodSignature *sig)
+{
+ return sig->ret;
+}
+
+MonoType*
+mono_signature_get_params (MonoMethodSignature *sig, gpointer *iter)
+{
+ MonoType** type;
+ if (!iter)
+ return NULL;
+ if (!*iter) {
+ /* start from the first */
+ if (sig->param_count) {
+ *iter = &sig->params [0];
+ return sig->params [0];
+ } else {
+ /* no method */
+ return NULL;
+ }
+ }
+ type = *iter;
+ type++;
+ if (type < &sig->params [sig->param_count]) {
+ *iter = type;
+ return *type;
+ }
+ return NULL;
+}
+
+guint32
+mono_signature_get_param_count (MonoMethodSignature *sig)
+{
+ return sig->param_count;
+}
+
+guint32
+mono_signature_get_call_conv (MonoMethodSignature *sig)
+{
+ return sig->call_convention;
+}
+
+int
+mono_signature_vararg_start (MonoMethodSignature *sig)
+{
+ return sig->sentinelpos;
+}
+
+gboolean
+mono_signature_is_instance (MonoMethodSignature *sig)
+{
+ return sig->hasthis;
+}
+
+gboolean
+mono_signature_explicit_this (MonoMethodSignature *sig)
+{
+ return sig->explicit_this;
+}
+
diff --git a/mono/metadata/metadata.h b/mono/metadata/metadata.h
index 3d22eb2168a..90dc22dc46f 100644
--- a/mono/metadata/metadata.h
+++ b/mono/metadata/metadata.h
@@ -14,6 +14,21 @@
#define MONO_ZERO_LEN_ARRAY 1
#endif
+#define MONO_TYPE_ISSTRUCT(t) (!(t)->byref && (((t)->type == MONO_TYPE_VALUETYPE && !(t)->data.klass->enumtype) || ((t)->type == MONO_TYPE_TYPEDBYREF) || (((t)->type == MONO_TYPE_GENERICINST) && mono_metadata_generic_inst_is_valuetype ((t)->data.generic_inst))))
+#define MONO_TYPE_IS_VOID(t) ((t) && ((t)->type == MONO_TYPE_VOID) && !(t)->byref)
+#define MONO_TYPE_IS_POINTER(t) ((t) && (((t)->byref || ((t)->type == MONO_TYPE_I) || (t)->type == MONO_TYPE_STRING) || ((t)->type == MONO_TYPE_SZARRAY) || ((t)->type == MONO_TYPE_CLASS) || ((t)->type == MONO_TYPE_CLASS) || ((t)->type == MONO_TYPE_OBJECT) || ((t)->type == MONO_TYPE_ARRAY) || ((t)->type == MONO_TYPE_PTR)))
+
+#define MONO_TYPE_IS_REFERENCE(t) ((t) && \
+ ((((t)->type == MONO_TYPE_STRING) || \
+ ((t)->type == MONO_TYPE_SZARRAY) || \
+ ((t)->type == MONO_TYPE_CLASS) || \
+ ((t)->type == MONO_TYPE_OBJECT) || \
+ ((t)->type == MONO_TYPE_ARRAY)) || \
+ (((t)->type == MONO_TYPE_GENERICINST) && \
+ !mono_metadata_generic_inst_is_valuetype ((t)->data.generic_inst))))
+
+#define MONO_CLASS_IS_INTERFACE(c) ((c->flags & TYPE_ATTRIBUTE_INTERFACE) || (c->byval_arg.type == MONO_TYPE_VAR) || (c->byval_arg.type == MONO_TYPE_MVAR))
+
typedef struct _MonoClass MonoClass;
typedef struct _MonoDomain MonoDomain;
@@ -21,36 +36,36 @@ typedef enum {
MONO_TABLE_MODULE,
MONO_TABLE_TYPEREF,
MONO_TABLE_TYPEDEF,
- MONO_TABLE_UNUSED1,
+ MONO_TABLE_FIELD_POINTER,
MONO_TABLE_FIELD,
- MONO_TABLE_UNUSED2,
+ MONO_TABLE_METHOD_POINTER,
MONO_TABLE_METHOD,
- MONO_TABLE_UNUSED3,
+ MONO_TABLE_PARAM_POINTER,
MONO_TABLE_PARAM,
MONO_TABLE_INTERFACEIMPL,
- MONO_TABLE_MEMBERREF,
+ MONO_TABLE_MEMBERREF, /* 0xa */
MONO_TABLE_CONSTANT,
MONO_TABLE_CUSTOMATTRIBUTE,
MONO_TABLE_FIELDMARSHAL,
MONO_TABLE_DECLSECURITY,
MONO_TABLE_CLASSLAYOUT,
- MONO_TABLE_FIELDLAYOUT,
+ MONO_TABLE_FIELDLAYOUT, /* 0x10 */
MONO_TABLE_STANDALONESIG,
MONO_TABLE_EVENTMAP,
- MONO_TABLE_UNUSED4,
+ MONO_TABLE_EVENT_POINTER,
MONO_TABLE_EVENT,
MONO_TABLE_PROPERTYMAP,
MONO_TABLE_UNUSED5,
MONO_TABLE_PROPERTY,
MONO_TABLE_METHODSEMANTICS,
MONO_TABLE_METHODIMPL,
- MONO_TABLE_MODULEREF,
+ MONO_TABLE_MODULEREF, /* 0x1a */
MONO_TABLE_TYPESPEC,
MONO_TABLE_IMPLMAP,
MONO_TABLE_FIELDRVA,
MONO_TABLE_UNUSED6,
MONO_TABLE_UNUSED7,
- MONO_TABLE_ASSEMBLY,
+ MONO_TABLE_ASSEMBLY, /* 0x20 */
MONO_TABLE_ASSEMBLYPROCESSOR,
MONO_TABLE_ASSEMBLYOS,
MONO_TABLE_ASSEMBLYREF,
@@ -59,9 +74,12 @@ typedef enum {
MONO_TABLE_FILE,
MONO_TABLE_EXPORTEDTYPE,
MONO_TABLE_MANIFESTRESOURCE,
- MONO_TABLE_NESTEDCLASS
+ MONO_TABLE_NESTEDCLASS,
+ MONO_TABLE_GENERICPARAM, /* 0x2a */
+ MONO_TABLE_METHODSPEC,
+ MONO_TABLE_GENERICPARAMCONSTRAINT
-#define MONO_TABLE_LAST MONO_TABLE_NESTEDCLASS
+#define MONO_TABLE_LAST MONO_TABLE_GENERICPARAMCONSTRAINT
} MonoMetaTableEnum;
typedef enum {
@@ -80,12 +98,101 @@ typedef enum {
MONO_CALL_VARARG
} MonoCallConvention;
-void mono_metadata_decode_row (MonoTableInfo *t,
+/* ECMA lamespec: the old spec had more info... */
+typedef enum {
+ MONO_NATIVE_BOOLEAN = 0x02, /* 4 bytes, 0 is false, != 0 is true */
+ MONO_NATIVE_I1 = 0x03,
+ MONO_NATIVE_U1 = 0x04,
+ MONO_NATIVE_I2 = 0x05,
+ MONO_NATIVE_U2 = 0x06,
+ MONO_NATIVE_I4 = 0x07,
+ MONO_NATIVE_U4 = 0x08,
+ MONO_NATIVE_I8 = 0x09,
+ MONO_NATIVE_U8 = 0x0a,
+ MONO_NATIVE_R4 = 0x0b,
+ MONO_NATIVE_R8 = 0x0c,
+ MONO_NATIVE_CURRENCY = 0x0f,
+ MONO_NATIVE_BSTR = 0x13, /* prefixed length, Unicode */
+ MONO_NATIVE_LPSTR = 0x14, /* ANSI, null terminated */
+ MONO_NATIVE_LPWSTR = 0x15, /* UNICODE, null terminated */
+ MONO_NATIVE_LPTSTR = 0x16, /* plattform dep., null terminated */
+ MONO_NATIVE_BYVALTSTR = 0x17,
+ MONO_NATIVE_IUNKNOWN = 0x19,
+ MONO_NATIVE_IDISPATCH = 0x1a,
+ MONO_NATIVE_STRUCT = 0x1b,
+ MONO_NATIVE_INTERFACE = 0x1c,
+ MONO_NATIVE_SAFEARRAY = 0x1d,
+ MONO_NATIVE_BYVALARRAY = 0x1e,
+ MONO_NATIVE_INT = 0x1f,
+ MONO_NATIVE_UINT = 0x20,
+ MONO_NATIVE_VBBYREFSTR = 0x22,
+ MONO_NATIVE_ANSIBSTR = 0x23, /* prefixed length, ANSI */
+ MONO_NATIVE_TBSTR = 0x24, /* prefixed length, plattform dep. */
+ MONO_NATIVE_VARIANTBOOL = 0x25,
+ MONO_NATIVE_FUNC = 0x26,
+ MONO_NATIVE_ASANY = 0x28,
+ MONO_NATIVE_LPARRAY = 0x2a,
+ MONO_NATIVE_LPSTRUCT = 0x2b,
+ MONO_NATIVE_CUSTOM = 0x2c,
+ MONO_NATIVE_ERROR = 0x2d,
+ MONO_NATIVE_MAX = 0x50 /* no info */
+} MonoMarshalNative;
+
+typedef enum {
+ MONO_MARSHAL_CONV_NONE,
+ MONO_MARSHAL_CONV_BOOL_VARIANTBOOL,
+ MONO_MARSHAL_CONV_BOOL_I4,
+ MONO_MARSHAL_CONV_STR_BSTR,
+ MONO_MARSHAL_CONV_STR_LPSTR,
+ MONO_MARSHAL_CONV_LPSTR_STR,
+ MONO_MARSHAL_CONV_STR_LPWSTR,
+ MONO_MARSHAL_CONV_LPWSTR_STR,
+ MONO_MARSHAL_CONV_STR_LPTSTR,
+ MONO_MARSHAL_CONV_STR_ANSIBSTR,
+ MONO_MARSHAL_CONV_STR_TBSTR,
+ MONO_MARSHAL_CONV_STR_BYVALSTR,
+ MONO_MARSHAL_CONV_STR_BYVALWSTR,
+ MONO_MARSHAL_CONV_SB_LPSTR,
+ MONO_MARSHAL_CONV_SB_LPTSTR,
+ MONO_MARSHAL_CONV_SB_LPWSTR,
+ MONO_MARSHAL_CONV_LPSTR_SB,
+ MONO_MARSHAL_CONV_LPTSTR_SB,
+ MONO_MARSHAL_CONV_LPWSTR_SB,
+ MONO_MARSHAL_CONV_ARRAY_BYVALARRAY,
+ MONO_MARSHAL_CONV_ARRAY_SAVEARRAY,
+ MONO_MARSHAL_CONV_ARRAY_LPARRAY,
+ MONO_MARSHAL_CONV_OBJECT_INTERFACE,
+ MONO_MARSHAL_CONV_OBJECT_IDISPATCH,
+ MONO_MARSHAL_CONV_OBJECT_IUNKNOWN,
+ MONO_MARSHAL_CONV_OBJECT_STRUCT,
+ MONO_MARSHAL_CONV_DEL_FTN,
+ MONO_MARSHAL_CONV_FTN_DEL,
+ MONO_MARSHAL_FREE_ARRAY
+} MonoMarshalConv;
+
+typedef struct {
+ MonoMarshalNative native;
+ union {
+ struct {
+ MonoMarshalNative elem_type;
+ gint32 param_num;
+ gint32 num_elem;
+ } array_data;
+ struct {
+ char *custom_name;
+ char *cookie;
+ } custom_data;
+ } data;
+} MonoMarshalSpec;
+
+void mono_metadata_init (void);
+
+void mono_metadata_decode_row (const MonoTableInfo *t,
int idx,
guint32 *res,
int res_size);
-guint32 mono_metadata_decode_row_col (MonoTableInfo *t,
+guint32 mono_metadata_decode_row_col (const MonoTableInfo *t,
int idx,
guint col);
@@ -114,7 +221,7 @@ const char *mono_metadata_guid_heap (MonoImage *meta, guint32 table_index
guint32 mono_metadata_typedef_from_field (MonoImage *meta, guint32 table_index);
guint32 mono_metadata_typedef_from_method (MonoImage *meta, guint32 table_index);
guint32 mono_metadata_nested_in_typedef (MonoImage *meta, guint32 table_index);
-guint32 mono_metadata_nesting_typedef (MonoImage *meta, guint32 table_index);
+guint32 mono_metadata_nesting_typedef (MonoImage *meta, guint32 table_index, guint32 start_index);
MonoClass** mono_metadata_interfaces_from_typedef (MonoImage *meta, guint32 table_index, guint *count);
@@ -124,6 +231,11 @@ guint32 mono_metadata_properties_from_typedef (MonoImage *meta, guint32 tabl
guint32 mono_metadata_methods_from_property (MonoImage *meta, guint32 table_index, guint *end);
guint32 mono_metadata_packing_from_typedef (MonoImage *meta, guint32 table_index, guint32 *packing, guint32 *size);
const char* mono_metadata_get_marshal_info (MonoImage *meta, guint32 idx, gboolean is_field);
+guint32 mono_metadata_custom_attrs_from_index (MonoImage *meta, guint32 cattr_index);
+
+MonoMarshalSpec *mono_metadata_parse_marshal_spec (MonoImage *image, const char *ptr);
+
+void mono_metadata_free_marshal_spec (MonoMarshalSpec *spec);
guint32 mono_metadata_implmap_from_method (MonoImage *meta, guint32 method_idx);
@@ -131,9 +243,9 @@ void mono_metadata_field_info (MonoImage *meta,
guint32 table_index,
guint32 *offset,
guint32 *rva,
- const char **marshal_info);
+ MonoMarshalSpec **marshal_spec);
-guint32 mono_metadata_get_constant_index (MonoImage *meta, guint32 token);
+guint32 mono_metadata_get_constant_index (MonoImage *meta, guint32 token, guint32 hint);
/*
* Functions to extract information from the Blobs
@@ -156,10 +268,19 @@ typedef struct {
guint32 try_len;
guint32 handler_offset;
guint32 handler_len;
- guint32 token_or_filter;
+ union {
+ guint32 filter_offset;
+ MonoClass *catch_class;
+ } data;
} MonoExceptionClause;
typedef struct _MonoType MonoType;
+typedef struct _MonoGenericInst MonoGenericInst;
+typedef struct _MonoDynamicGenericInst MonoDynamicGenericInst;
+typedef struct _MonoGenericMethod MonoGenericMethod;
+typedef struct _MonoGenericContext MonoGenericContext;
+typedef struct _MonoGenericContainer MonoGenericContainer;
+typedef struct _MonoGenericParam MonoGenericParam;
typedef struct _MonoArrayType MonoArrayType;
typedef struct _MonoMethodSignature MonoMethodSignature;
@@ -169,10 +290,10 @@ typedef struct {
} MonoCustomMod;
struct _MonoArrayType {
- MonoType *type;
- int rank;
- int numsizes;
- int numlobounds;
+ MonoClass *eklass;
+ guint8 rank;
+ guint8 numsizes;
+ guint8 numlobounds;
int *sizes;
int *lobounds;
};
@@ -180,9 +301,11 @@ struct _MonoArrayType {
struct _MonoType {
union {
MonoClass *klass; /* for VALUETYPE and CLASS */
- MonoType *type; /* for PTR and SZARRAY */
+ MonoType *type; /* for PTR */
MonoArrayType *array; /* for ARRAY */
MonoMethodSignature *method;
+ MonoGenericParam *generic_param; /* for VAR and MVAR */
+ MonoGenericInst *generic_inst; /* for GENERICINST */
} data;
unsigned int attrs : 16; /* param attributes or field flags */
unsigned int type : 8; /* ElementTypeEnum */
@@ -196,9 +319,13 @@ struct _MonoMethodSignature {
unsigned int hasthis : 1;
unsigned int explicit_this : 1;
unsigned int call_convention : 6;
- unsigned int ref_count : 24;
+ unsigned int pinvoke : 1;
+ unsigned int ref_count : 23;
guint16 param_count;
- guint16 sentinelpos;
+ gint16 sentinelpos;
+ unsigned int generic_param_count : 30;
+ unsigned int is_inflated : 1;
+ unsigned int has_type_parameters : 1;
MonoType *ret;
MonoType *params [MONO_ZERO_LEN_ARRAY];
};
@@ -224,6 +351,47 @@ typedef enum {
MONO_PARSE_FIELD
} MonoParseTypeMode;
+gboolean
+mono_type_is_byref (MonoType *type);
+
+int
+mono_type_get_type (MonoType *type);
+
+/* For MONO_TYPE_FNPTR */
+MonoMethodSignature*
+mono_type_get_signature (MonoType *type);
+
+/* For MONO_TYPE_CLASS, VALUETYPE */
+MonoClass*
+mono_type_get_class (MonoType *type);
+
+MonoArrayType*
+mono_type_get_array_type (MonoType *type);
+
+MonoClass*
+mono_type_get_modifiers (MonoType *type, gboolean *is_required, gpointer *iter);
+
+MonoType*
+mono_signature_get_return_type (MonoMethodSignature *sig);
+
+MonoType*
+mono_signature_get_params (MonoMethodSignature *sig, gpointer *iter);
+
+guint32
+mono_signature_get_param_count (MonoMethodSignature *sig);
+
+guint32
+mono_signature_get_call_conv (MonoMethodSignature *sig);
+
+int
+mono_signature_vararg_start (MonoMethodSignature *sig);
+
+gboolean
+mono_signature_is_instance (MonoMethodSignature *sig);
+
+gboolean
+mono_signature_explicit_this (MonoMethodSignature *sig);
+
guint32 mono_metadata_parse_typedef_or_ref (MonoImage *m,
const char *ptr,
const char **rptr);
@@ -250,17 +418,25 @@ MonoType *mono_metadata_parse_field_type (MonoImage *m,
short field_flags,
const char *ptr,
const char **rptr);
-MonoType *mono_type_create_from_typespec (MonoImage *image,
- guint32 type_spec);
+MonoType *mono_type_create_from_typespec (MonoImage *image,
+ guint32 type_spec);
void mono_metadata_free_type (MonoType *type);
int mono_type_size (MonoType *type,
int *alignment);
int mono_type_stack_size (MonoType *type,
int *alignment);
+gboolean mono_metadata_generic_inst_is_valuetype (MonoGenericInst *ginst);
+guint mono_metadata_generic_inst_hash (MonoGenericInst *ginst);
+gboolean mono_metadata_generic_inst_equal (MonoGenericInst *g1, MonoGenericInst *g2);
+
guint mono_metadata_type_hash (MonoType *t1);
gboolean mono_metadata_type_equal (MonoType *t1, MonoType *t2);
+MonoMethodSignature *mono_metadata_signature_alloc (MonoImage *image, guint32 nparams);
+
+MonoMethodSignature *mono_metadata_signature_dup (MonoMethodSignature *sig);
+
MonoMethodSignature *mono_metadata_parse_signature (MonoImage *image,
guint32 token);
@@ -273,13 +449,19 @@ void mono_metadata_free_method_signature (MonoMethodSignature
gboolean mono_metadata_signature_equal (MonoMethodSignature *sig1,
MonoMethodSignature *sig2);
+guint mono_signature_hash (MonoMethodSignature *sig);
+
MonoMethodHeader *mono_metadata_parse_mh (MonoImage *m, const char *ptr);
void mono_metadata_free_mh (MonoMethodHeader *mh);
+guint32
+mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec,
+ gboolean as_field, gboolean unicode, MonoMarshalConv *conv);
+
/*
* Makes a token based on a table and an index
*/
-#define mono_metadata_make_token(table,idx) (((table) << 24)| idx)
+#define mono_metadata_make_token(table,idx) (((table) << 24)| (idx))
/*
* Returns the table index that this token encodes.
@@ -296,4 +478,6 @@ void mono_metadata_free_mh (MonoMethodHeader *mh);
guint32 mono_metadata_token_from_dor (guint32 dor_index);
+char *mono_guid_to_string (const guint8 *guid);
+
#endif /* __MONO_METADATA_H__ */
diff --git a/mono/metadata/monitor.c b/mono/metadata/monitor.c
new file mode 100644
index 00000000000..0d17fb50a02
--- /dev/null
+++ b/mono/metadata/monitor.c
@@ -0,0 +1,600 @@
+/*
+ * monitor.c: Monitor locking functions
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/monitor.h>
+#include <mono/metadata/threads-types.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/threads.h>
+#include <mono/io-layer/io-layer.h>
+
+#include <mono/os/gc_wrapper.h>
+
+#undef THREAD_LOCK_DEBUG
+
+/*
+ * The monitor implementation here is based on
+ * http://www.usenix.org/events/jvm01/full_papers/dice/dice.pdf and
+ * http://www.research.ibm.com/people/d/dfb/papers/Bacon98Thin.ps
+ *
+ * The Dice paper describes a technique for saving lock record space
+ * by returning records to a free list when they become unused. That
+ * sounds like unnecessary complexity to me, though if it becomes
+ * clear that unused lock records are taking up lots of space or we
+ * need to shave more time off by avoiding a malloc then we can always
+ * implement the free list idea later. The timeout parameter to
+ * try_enter voids some of the assumptions about the reference count
+ * field in Dice's implementation too. In his version, the thread
+ * attempting to lock a contended object will block until it succeeds,
+ * so the reference count will never be decremented while an object is
+ * locked.
+ *
+ * Bacon's thin locks have a fast path that doesn't need a lock record
+ * for the common case of locking an unlocked or shallow-nested
+ * object, but the technique relies on encoding the thread ID in 15
+ * bits (to avoid too much per-object space overhead.) Unfortunately
+ * I don't think it's possible to reliably encode a pthread_t into 15
+ * bits. (The JVM implementation used seems to have a 15-bit
+ * per-thread identifier available.)
+ *
+ * This implementation then combines Dice's basic lock model with
+ * Bacon's simplification of keeping a lock record for the lifetime of
+ * an object.
+ */
+
+
+static void mon_finalize (void *o, void *unused)
+{
+ MonoThreadsSync *mon=(MonoThreadsSync *)o;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Finalizing sync %p", mon);
+#endif
+
+ if(mon->entry_sem!=NULL) {
+ CloseHandle (mon->entry_sem);
+ }
+ /* If this isn't empty then something is seriously broken - it
+ * means a thread is still waiting on the object that owned
+ * this lock, but the object has been finalized.
+ */
+ g_assert (mon->wait_list==NULL);
+}
+
+static MonoThreadsSync *mon_new(guint32 id)
+{
+ MonoThreadsSync *new;
+
+#if HAVE_BOEHM_GC
+ new=(MonoThreadsSync *)GC_MALLOC (sizeof(MonoThreadsSync));
+ GC_REGISTER_FINALIZER (new, mon_finalize, NULL, NULL, NULL);
+#else
+ /* This should be freed when the object that owns it is
+ * deleted
+ */
+ new=(MonoThreadsSync *)g_new0 (MonoThreadsSync, 1);
+#endif
+ new->owner=id;
+ new->nest=1;
+
+ return(new);
+}
+
+/* If allow_interruption==TRUE, the method will be interrumped if abort or suspend
+ * is requested. In this case it returns -1.
+ */
+static gint32 mono_monitor_try_enter_internal (MonoObject *obj, guint32 ms, gboolean allow_interruption)
+{
+ MonoThreadsSync *mon;
+ guint32 id=GetCurrentThreadId ();
+ HANDLE sem;
+ guint32 then=0, now, delta;
+ guint32 waitms;
+ guint32 ret;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) Trying to lock object %p (%d ms)", id, obj, ms);
+#endif
+
+retry:
+ mon=obj->synchronisation;
+
+ /* If the object has never been locked... */
+ if(mon==NULL) {
+ mon=mon_new(id);
+ if(InterlockedCompareExchangePointer ((gpointer*)&obj->synchronisation, mon, NULL)==NULL) {
+ /* Successfully locked */
+ return(1);
+ } else {
+ /* Another thread got in first, so try again.
+ * GC will take care of the monitor record
+ */
+#ifndef HAVE_BOEHM_GC
+ mon_finalize (mon, NULL);
+#endif
+ goto retry;
+ }
+ }
+
+ /* If the object is currently locked by this thread... */
+ if(mon->owner==id) {
+ mon->nest++;
+ return(1);
+ }
+
+ /* If the object has previously been locked but isn't now... */
+
+ /* This case differs from Dice's case 3 because we don't
+ * deflate locks or cache unused lock records
+ */
+ if(mon->owner==0) {
+ /* Try to install our ID in the owner field, nest
+ * should have been left at 1 by the previous unlock
+ * operation
+ */
+ if(InterlockedCompareExchange (&mon->owner, id, 0)==0) {
+ /* Success */
+ g_assert (mon->nest==1);
+ return(1);
+ } else {
+ /* Trumped again! */
+ goto retry;
+ }
+ }
+
+ /* The object must be locked by someone else... */
+
+ /* If ms is 0 we don't block, but just fail straight away */
+ if(ms==0) {
+#ifdef THREAD_LOCK_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": (%d) timed out, returning FALSE", id);
+#endif
+
+ return(0);
+ }
+
+ /* The slow path begins here. We need to make sure theres a
+ * semaphore handle (creating it if necessary), and block on
+ * it
+ */
+ if(mon->entry_sem==NULL) {
+ /* Create the semaphore */
+ sem=CreateSemaphore (NULL, 0, 0x7fffffff, NULL);
+ if(InterlockedCompareExchangePointer ((gpointer*)&mon->entry_sem, sem, NULL)!=NULL) {
+ /* Someone else just put a handle here */
+ CloseHandle (sem);
+ }
+ }
+
+ /* If we need to time out, record a timestamp and adjust ms,
+ * because WaitForSingleObject doesn't tell us how long it
+ * waited for.
+ *
+ * Don't block forever here, because theres a chance the owner
+ * thread released the lock while we were creating the
+ * semaphore: we would not get the wakeup. Using the event
+ * handle technique from pulse/wait would involve locking the
+ * lock struct and therefore slowing down the fast path.
+ */
+ if(ms!=INFINITE) {
+ then=GetTickCount ();
+ if(ms<100) {
+ waitms=ms;
+ } else {
+ waitms=100;
+ }
+ } else {
+ waitms=100;
+ }
+
+ InterlockedIncrement (&mon->entry_count);
+ ret=WaitForSingleObjectEx (mon->entry_sem, waitms, allow_interruption);
+ InterlockedDecrement (&mon->entry_count);
+
+ if(ms!=INFINITE) {
+ now=GetTickCount ();
+
+ if(now<then) {
+ /* The counter must have wrapped around */
+#ifdef THREAD_LOCK_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": wrapped around! now=0x%x then=0x%x",
+ now, then);
+#endif
+
+ now+=(0xffffffff - then);
+ then=0;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": wrap rejig: now=0x%x then=0x%x delta=0x%x", now, then, now-then);
+#endif
+ }
+
+ delta=now-then;
+ if(delta >= ms) {
+ ms=0;
+ } else {
+ ms-=delta;
+ }
+
+ if((ret==WAIT_TIMEOUT || (ret==WAIT_IO_COMPLETION && !allow_interruption)) && ms>0) {
+ /* More time left */
+ goto retry;
+ }
+ } else {
+ if(ret==WAIT_TIMEOUT || (ret==WAIT_IO_COMPLETION && !allow_interruption)) {
+ /* Infinite wait, so just try again */
+ goto retry;
+ }
+ }
+
+ if(ret==WAIT_OBJECT_0) {
+ /* retry from the top */
+ goto retry;
+ }
+
+ /* We must have timed out */
+#ifdef THREAD_LOCK_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": (%d) timed out waiting, returning FALSE", id);
+#endif
+
+ if (ret==WAIT_IO_COMPLETION) return(-1);
+ else return(0);
+}
+
+gboolean mono_monitor_enter (MonoObject *obj)
+{
+ return mono_monitor_try_enter_internal (obj, INFINITE, FALSE) == 1;
+}
+
+gboolean mono_monitor_try_enter (MonoObject *obj, guint32 ms)
+{
+ return mono_monitor_try_enter_internal (obj, ms, FALSE) == 1;
+}
+
+void mono_monitor_exit (MonoObject *obj)
+{
+ MonoThreadsSync *mon;
+ guint32 nest;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Unlocking %p",
+ GetCurrentThreadId (), obj);
+#endif
+
+ mon=obj->synchronisation;
+
+ if(mon==NULL) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Not locked"));
+ return;
+ }
+ if(mon->owner!=GetCurrentThreadId ()) {
+ return;
+ }
+
+ nest=mon->nest-1;
+ if(nest==0) {
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) Object %p is now unlocked",
+ GetCurrentThreadId (), obj);
+#endif
+
+ /* object is now unlocked, leave nest==1 so we don't
+ * need to set it when the lock is reacquired
+ */
+ mon->owner=0;
+
+ /* Do the wakeup stuff. It's possible that the last
+ * blocking thread gave up waiting just before we
+ * release the semaphore resulting in a futile wakeup
+ * next time there's contention for this object, but
+ * it means we don't have to waste time locking the
+ * struct.
+ */
+ if(mon->entry_count>0) {
+ ReleaseSemaphore (mon->entry_sem, 1, NULL);
+ }
+ } else {
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) Object %p is now locked %d times",
+ GetCurrentThreadId (), obj,
+ nest);
+#endif
+ mon->nest=nest;
+ }
+}
+
+gboolean ves_icall_System_Threading_Monitor_Monitor_try_enter(MonoObject *obj,
+ guint32 ms)
+{
+ gint32 res;
+ MONO_ARCH_SAVE_REGS;
+
+ do {
+ res = mono_monitor_try_enter_internal (obj, ms, TRUE);
+ if (res == -1)
+ mono_thread_interruption_checkpoint ();
+ }
+ while (res == -1);
+
+ return(res == 1);
+}
+
+void ves_icall_System_Threading_Monitor_Monitor_exit(MonoObject *obj)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ mono_monitor_exit (obj);
+}
+
+gboolean ves_icall_System_Threading_Monitor_Monitor_test_owner(MonoObject *obj)
+{
+ MonoThreadsSync *mon;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": Testing if %p is owned by thread %d", obj,
+ GetCurrentThreadId());
+#endif
+
+ mon=obj->synchronisation;
+ if(mon==NULL) {
+ return(FALSE);
+ }
+
+ if(mon->owner==GetCurrentThreadId ()) {
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
+gboolean ves_icall_System_Threading_Monitor_Monitor_test_synchronised(MonoObject *obj)
+{
+ MonoThreadsSync *mon;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) Testing if %p is owned by any thread",
+ GetCurrentThreadId (), obj);
+#endif
+
+ mon=obj->synchronisation;
+ if(mon==NULL) {
+ return(FALSE);
+ }
+
+ if(mon->owner!=0) {
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
+/* All wait list manipulation in the pulse, pulseall and wait
+ * functions happens while the monitor lock is held, so we don't need
+ * any extra struct locking
+ */
+
+void ves_icall_System_Threading_Monitor_Monitor_pulse(MonoObject *obj)
+{
+ MonoThreadsSync *mon;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Pulsing %p",
+ GetCurrentThreadId (), obj);
+#endif
+
+ mon=obj->synchronisation;
+ if(mon==NULL) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Not locked"));
+ return;
+ }
+ if(mon->owner!=GetCurrentThreadId ()) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Not locked by this thread"));
+ return;
+ }
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) %d threads waiting",
+ GetCurrentThreadId (), g_slist_length (mon->wait_list));
+#endif
+
+ if(mon->wait_list!=NULL) {
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) signalling and dequeuing handle %p",
+ GetCurrentThreadId (), mon->wait_list->data);
+#endif
+
+ SetEvent (mon->wait_list->data);
+ mon->wait_list=g_slist_remove (mon->wait_list,
+ mon->wait_list->data);
+ }
+}
+
+void ves_icall_System_Threading_Monitor_Monitor_pulse_all(MonoObject *obj)
+{
+ MonoThreadsSync *mon;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Pulsing all %p",
+ GetCurrentThreadId (), obj);
+#endif
+
+ mon=obj->synchronisation;
+ if(mon==NULL) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Not locked"));
+ return;
+ }
+ if(mon->owner!=GetCurrentThreadId ()) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Not locked by this thread"));
+ return;
+ }
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) %d threads waiting",
+ GetCurrentThreadId (), g_slist_length (mon->wait_list));
+#endif
+
+ while(mon->wait_list!=NULL) {
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) signalling and dequeuing handle %p",
+ GetCurrentThreadId (), mon->wait_list->data);
+#endif
+
+ SetEvent (mon->wait_list->data);
+ mon->wait_list=g_slist_remove (mon->wait_list,
+ mon->wait_list->data);
+ }
+}
+
+gboolean ves_icall_System_Threading_Monitor_Monitor_wait(MonoObject *obj,
+ guint32 ms)
+{
+ MonoThreadsSync *mon;
+ HANDLE event;
+ guint32 nest;
+ guint32 ret;
+ gboolean success=FALSE;
+ gint32 regain;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) Trying to wait for %p with timeout %dms",
+ GetCurrentThreadId (), obj, ms);
+#endif
+
+ mon=obj->synchronisation;
+ if(mon==NULL) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Not locked"));
+ return(FALSE);
+ }
+ if(mon->owner!=GetCurrentThreadId ()) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Not locked by this thread"));
+ return(FALSE);
+ }
+
+ event=CreateEvent (NULL, FALSE, FALSE, NULL);
+ if(event==NULL) {
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Failed to set up wait event"));
+ return(FALSE);
+ }
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) queuing handle %p",
+ GetCurrentThreadId (), event);
+#endif
+
+ mon->wait_list=g_slist_append (mon->wait_list, event);
+
+ /* Save the nest count, and release the lock */
+ nest=mon->nest;
+ mon->nest=1;
+ mono_monitor_exit (obj);
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Unlocked %p lock %p",
+ GetCurrentThreadId (), obj, mon);
+#endif
+
+ /* There's no race between unlocking mon and waiting for the
+ * event, because auto reset events are sticky, and this event
+ * is private to this thread. Therefore even if the event was
+ * signalled before we wait, we still succeed.
+ */
+ ret=WaitForSingleObjectEx (event, ms, TRUE);
+
+ if (mono_thread_interruption_requested ()) {
+ CloseHandle (event);
+ return(FALSE);
+ }
+
+ /* Regain the lock with the previous nest count */
+ do {
+ regain=mono_monitor_try_enter_internal (obj, INFINITE, TRUE);
+ if (regain == -1)
+ mono_thread_interruption_checkpoint ();
+ }
+ while (regain == -1);
+
+ if(regain==0) {
+ /* Something went wrong, so throw a
+ * SynchronizationLockException
+ */
+ CloseHandle (event);
+ mono_raise_exception (mono_get_exception_synchronization_lock ("Failed to regain lock"));
+ return(FALSE);
+ }
+
+ mon->nest=nest;
+
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Regained %p lock %p",
+ GetCurrentThreadId (), obj, mon);
+#endif
+
+ if(ret==WAIT_TIMEOUT) {
+ /* Poll the event again, just in case it was signalled
+ * while we were trying to regain the monitor lock
+ */
+ ret=WaitForSingleObjectEx (event, 0, FALSE);
+ }
+
+ /* Pulse will have popped our event from the queue if it signalled
+ * us, so we only do it here if the wait timed out.
+ *
+ * This avoids a race condition where the thread holding the
+ * lock can Pulse several times before the WaitForSingleObject
+ * returns. If we popped the queue here then this event might
+ * be signalled more than once, thereby starving another
+ * thread.
+ */
+
+ if(ret==WAIT_OBJECT_0) {
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Success",
+ GetCurrentThreadId ());
+#endif
+ success=TRUE;
+ } else {
+#ifdef THREAD_LOCK_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Wait failed",
+ GetCurrentThreadId ());
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) dequeuing handle %p",
+ GetCurrentThreadId (), event);
+#endif
+ /* No pulse, so we have to remove ourself from the
+ * wait queue
+ */
+ mon->wait_list=g_slist_remove (mon->wait_list, event);
+ }
+ CloseHandle (event);
+
+ return(success);
+}
+
diff --git a/mono/metadata/monitor.h b/mono/metadata/monitor.h
new file mode 100644
index 00000000000..ba86538febe
--- /dev/null
+++ b/mono/metadata/monitor.h
@@ -0,0 +1,25 @@
+/*
+ * monitor.h: Monitor locking functions
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc
+ */
+
+#ifndef _MONO_METADATA_MONITOR_H_
+#define _MONO_METADATA_MONITOR_H_
+
+#include <glib.h>
+
+#include <mono/metadata/object.h>
+
+extern gboolean ves_icall_System_Threading_Monitor_Monitor_try_enter(MonoObject *obj, guint32 ms);
+extern void ves_icall_System_Threading_Monitor_Monitor_exit(MonoObject *obj);
+extern gboolean ves_icall_System_Threading_Monitor_Monitor_test_owner(MonoObject *obj);
+extern gboolean ves_icall_System_Threading_Monitor_Monitor_test_synchronised(MonoObject *obj);
+extern void ves_icall_System_Threading_Monitor_Monitor_pulse(MonoObject *obj);
+extern void ves_icall_System_Threading_Monitor_Monitor_pulse_all(MonoObject *obj);
+extern gboolean ves_icall_System_Threading_Monitor_Monitor_wait(MonoObject *obj, guint32 ms);
+
+#endif /* _MONO_METADATA_MONITOR_H_ */
diff --git a/mono/metadata/mono-config.c b/mono/metadata/mono-config.c
index f0553980f28..781663f1ee1 100644
--- a/mono/metadata/mono-config.c
+++ b/mono/metadata/mono-config.c
@@ -12,6 +12,8 @@
#include <string.h>
#include "mono/metadata/loader.h"
#include "mono/metadata/mono-config.h"
+#include "mono/metadata/metadata-internals.h"
+#include "mono/utils/mono-logger.h"
static void start_element (GMarkupParseContext *context,
const gchar *element_name,
@@ -57,7 +59,7 @@ typedef struct MonoParseHandler MonoParseHandler;
struct MonoParseHandler {
const char *element_name;
- void*(*init) (void);
+ void*(*init) (MonoImage *assembly);
void (*start) (gpointer user_data, const gchar *name,
const gchar **attributes,
const gchar **values);
@@ -69,6 +71,7 @@ struct MonoParseHandler {
typedef struct {
MonoParseHandler *current;
void *user_data;
+ MonoImage *assembly;
int inited;
} ParseState;
@@ -83,7 +86,7 @@ static void start_element (GMarkupParseContext *context,
if (!state->current) {
state->current = g_hash_table_lookup (config_handlers, element_name);
if (state->current && state->current->init)
- state->user_data = state->current->init ();
+ state->user_data = state->current->init (state->assembly);
}
if (state->current && state->current->start)
state->current->start (state->user_data, element_name, attribute_names, attribute_values);
@@ -136,11 +139,13 @@ static void parse_error (GMarkupParseContext *context,
typedef struct {
char *dll;
char *target;
+ MonoImage *assembly;
} DllInfo;
static void*
-dllmap_init (void) {
+dllmap_init (MonoImage *assembly) {
DllInfo *info = g_new0 (DllInfo, 1);
+ info->assembly = assembly;
return info;
}
@@ -163,7 +168,7 @@ dllmap_start (gpointer user_data,
else if (strcmp (attribute_names [i], "target") == 0)
info->target = g_strdup (attribute_values [i]);
}
- mono_dllmap_insert (info->dll, NULL, info->target, NULL);
+ mono_dllmap_insert (info->assembly, info->dll, NULL, info->target, NULL);
} else if (strcmp (element_name, "dllentry") == 0) {
const char *name = NULL, *target = NULL, *dll = NULL;
for (i = 0; attribute_names [i]; ++i) {
@@ -176,7 +181,7 @@ dllmap_start (gpointer user_data,
}
if (!dll)
dll = info->dll;
- mono_dllmap_insert (info->dll, name, dll, target);
+ mono_dllmap_insert (info->assembly, info->dll, name, dll, target);
}
}
@@ -200,7 +205,6 @@ dllmap_handler = {
dllmap_finish
};
-
static int inited = 0;
static void
@@ -208,29 +212,93 @@ mono_config_init (void)
{
inited = 1;
config_handlers = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (config_handlers, dllmap_handler.element_name, &dllmap_handler);
+ g_hash_table_insert (config_handlers, (gpointer) dllmap_handler.element_name, (gpointer) &dllmap_handler);
}
/* FIXME: error handling */
-static void
-mono_config_parse_file (const char *filename)
+/* If assembly is NULL, parse in the global context */
+static int
+mono_config_parse_file_with_context (ParseState *state, const char *filename)
{
GMarkupParseContext *context;
- ParseState state = {NULL};
char *text;
gsize len;
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_CONFIG,
+ "Config attempting to parse: '%s'.", filename);
+
if (!inited)
mono_config_init ();
if (!g_file_get_contents (filename, &text, &len, NULL))
- return;
- context = g_markup_parse_context_new (&mono_parser, 0, &state, NULL);
+ return 0;
+ context = g_markup_parse_context_new (&mono_parser, 0, state, NULL);
if (g_markup_parse_context_parse (context, text, len, NULL)) {
g_markup_parse_context_end_parse (context, NULL);
}
g_markup_parse_context_free (context);
+ g_free (text);
+ return 1;
+}
+
+static void
+mono_config_parse_file (const char *filename)
+{
+ ParseState state = {NULL};
+ mono_config_parse_file_with_context (&state, filename);
+}
+
+/*
+ * use the equivalent lookup code from the GAC when available.
+ * Depending on state, this should give something like:
+ * aname/version-pubtoken/
+ * aname/version/
+ * aname
+ */
+static char*
+get_assembly_filename (MonoImage *image, int state)
+{
+ switch (state) {
+ case 0:
+ return g_strdup (mono_image_get_name (image));
+ default:
+ return NULL;
+ }
+}
+
+void
+mono_config_for_assembly (MonoImage *assembly)
+{
+ ParseState state = {NULL};
+ int got_it = 0, i;
+ char *aname, *cfg, *cfg_name;
+ const char *home;
+
+ state.assembly = assembly;
+ cfg_name = g_strdup_printf ("%s.config", mono_image_get_filename (assembly));
+ mono_config_parse_file_with_context (&state, cfg_name);
+ g_free (cfg_name);
+
+ cfg_name = g_strdup_printf ("%s.config", mono_image_get_name (assembly));
+
+ home = g_get_home_dir ();
+
+ for (i = 0; (aname = get_assembly_filename (assembly, i)) != NULL; ++i) {
+ cfg = g_build_filename (mono_get_config_dir (), "mono", "assemblies", aname, cfg_name, NULL);
+ got_it += mono_config_parse_file_with_context (&state, cfg);
+ g_free (cfg);
+
+#ifndef PLATFORM_WIN32
+ cfg = g_build_filename (home, ".mono", "assemblies", aname, cfg_name, NULL);
+ got_it += mono_config_parse_file_with_context (&state, cfg);
+ g_free (cfg);
+#endif
+ g_free (aname);
+ if (got_it)
+ break;
+ }
+ g_free (cfg_name);
}
/*
@@ -241,6 +309,7 @@ void
mono_config_parse (const char *filename) {
const char *home;
char *user_cfg;
+ char *mono_cfg;
if (filename) {
mono_config_parse_file (filename);
@@ -252,16 +321,46 @@ mono_config_parse (const char *filename) {
mono_config_parse_file (home);
return;
}
-#if defined (PLATFORM_WIN32)
- /* maybe it's better to use a registry key or the install root from the binary */
- mono_config_parse_file (MONO_CFG_DIR "\\mono\\config");
-#else
- mono_config_parse_file (MONO_CFG_DIR "/mono/config");
+
+ mono_cfg = g_build_filename (mono_get_config_dir (), "mono", "config", NULL);
+ mono_config_parse_file (mono_cfg);
+ g_free (mono_cfg);
+
+#ifndef PLATFORM_WIN32
home = g_get_home_dir ();
user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", NULL);
mono_config_parse_file (user_cfg);
g_free (user_cfg);
#endif
-
+}
+
+static const char *mono_cfg_dir = NULL;
+
+static void
+mono_install_get_config_dir (void)
+{
+#ifdef PLATFORM_WIN32
+ gchar *prefix;
+#endif
+
+ mono_cfg_dir = g_getenv ("MONO_CFG_DIR");
+
+ if (!mono_cfg_dir) {
+#ifndef PLATFORM_WIN32
+ mono_cfg_dir = MONO_CFG_DIR;
+#else
+ prefix = g_path_get_dirname (mono_assembly_getrootdir ());
+ mono_cfg_dir = g_build_filename (prefix, "etc", NULL);
+ g_free (prefix);
+#endif
+ }
+}
+
+const char*
+mono_get_config_dir (void)
+{
+ if (!mono_cfg_dir)
+ mono_install_get_config_dir ();
+ return mono_cfg_dir;
}
diff --git a/mono/metadata/mono-config.h b/mono/metadata/mono-config.h
index e32f2e706b5..05fec033434 100644
--- a/mono/metadata/mono-config.h
+++ b/mono/metadata/mono-config.h
@@ -8,7 +8,10 @@
#ifndef __MONO_METADATA_CONFIG_H__
#define __MONO_METADATA_CONFIG_H__
+const char* mono_get_config_dir (void);
+
void mono_config_parse (const char *filename);
+void mono_config_for_assembly (MonoImage *assembly);
#endif /* __MONO_METADATA_CONFIG_H__ */
diff --git a/mono/metadata/mono-debug-debugger.c b/mono/metadata/mono-debug-debugger.c
new file mode 100644
index 00000000000..7d8bc980f1d
--- /dev/null
+++ b/mono/metadata/mono-debug-debugger.c
@@ -0,0 +1,1604 @@
+#include <config.h>
+#include <stdlib.h>
+#include <string.h>
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/metadata.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/tokentype.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/gc-internal.h>
+#include <mono/os/gc_wrapper.h>
+#include <mono/metadata/object-internals.h>
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
+#include <mono/metadata/mono-endian.h>
+
+#define SYMFILE_TABLE_CHUNK_SIZE 16
+#define RANGE_TABLE_CHUNK_SIZE 256
+#define CLASS_TABLE_CHUNK_SIZE 256
+#define TYPE_TABLE_PTR_CHUNK_SIZE 256
+#define TYPE_TABLE_CHUNK_SIZE 65536
+#define MISC_TABLE_PTR_CHUNK_SIZE 256
+#define MISC_TABLE_CHUNK_SIZE 65536
+
+static guint32 debugger_lock_level = 0;
+static CRITICAL_SECTION debugger_lock_mutex;
+static gboolean mono_debugger_initialized = FALSE;
+static MonoObject *last_exception = NULL;
+
+static gboolean must_reload_symtabs = FALSE;
+static gboolean builtin_types_initialized = FALSE;
+
+static GHashTable *images = NULL;
+static GHashTable *type_table = NULL;
+static GHashTable *misc_table = NULL;
+static GHashTable *class_table = NULL;
+static GHashTable *class_info_table = NULL;
+
+static MonoDebuggerRangeInfo *allocate_range_entry (MonoDebuggerSymbolFile *symfile);
+static MonoDebuggerClassInfo *allocate_class_entry (MonoDebuggerSymbolFile *symfile);
+static guint32 allocate_type_entry (MonoDebuggerSymbolTable *table, guint32 size, guint8 **ptr);
+static guint32 write_type (MonoDebuggerSymbolTable *table, MonoType *type);
+static guint32 do_write_class (MonoDebuggerSymbolTable *table, MonoClass *klass,
+ MonoDebuggerClassInfo *cinfo);
+static guint32 write_class (MonoDebuggerSymbolTable *table, MonoClass *klass);
+
+MonoDebuggerSymbolTable *mono_debugger_symbol_table = NULL;
+void (*mono_debugger_event_handler) (MonoDebuggerEvent event, gpointer data, guint32 arg) = NULL;
+
+#define WRITE_UINT32(ptr,value) G_STMT_START { \
+ * ((guint32 *) ptr) = value; \
+ ptr += 4; \
+} G_STMT_END
+
+#define WRITE_POINTER(ptr,value) G_STMT_START { \
+ * ((gpointer *) ptr) = (gpointer) (value); \
+ ptr += sizeof (gpointer); \
+} G_STMT_END
+
+#define WRITE_STRING(ptr,value) G_STMT_START { \
+ memcpy (ptr, value, strlen (value)+1); \
+ ptr += strlen (value)+1; \
+} G_STMT_END
+
+typedef struct {
+ gpointer stack_pointer;
+ MonoObject *exception_obj;
+ guint32 stop;
+} MonoDebuggerExceptionInfo;
+
+#ifndef PLATFORM_WIN32
+
+MonoDebuggerIOLayer mono_debugger_io_layer = {
+ InitializeCriticalSection, DeleteCriticalSection, TryEnterCriticalSection,
+ EnterCriticalSection, LeaveCriticalSection, WaitForSingleObjectEx, SignalObjectAndWait,
+ WaitForMultipleObjectsEx, CreateSemaphore, ReleaseSemaphore, CreateThread,
+ GetCurrentThreadId
+};
+
+#endif
+
+void
+mono_debugger_lock (void)
+{
+ if (!mono_debugger_initialized) {
+ debugger_lock_level++;
+ return;
+ }
+
+ EnterCriticalSection (&debugger_lock_mutex);
+ debugger_lock_level++;
+}
+
+void
+mono_debugger_unlock (void)
+{
+ g_assert (debugger_lock_level > 0);
+
+ if (!mono_debugger_initialized) {
+ debugger_lock_level--;
+ return;
+ }
+
+ if (debugger_lock_level == 1) {
+ if (must_reload_symtabs) {
+ mono_debugger_event (MONO_DEBUGGER_EVENT_RELOAD_SYMTABS, NULL, 0);
+ must_reload_symtabs = FALSE;
+ }
+ }
+
+ debugger_lock_level--;
+ LeaveCriticalSection (&debugger_lock_mutex);
+}
+
+static MonoDebuggerSymbolFile *
+allocate_symbol_file_entry (MonoDebuggerSymbolTable *table)
+{
+ MonoDebuggerSymbolFile *symfile;
+
+ if (!table->symbol_files)
+ table->symbol_files = g_new0 (MonoDebuggerSymbolFile *, SYMFILE_TABLE_CHUNK_SIZE);
+ else if (!((table->num_symbol_files + 1) % SYMFILE_TABLE_CHUNK_SIZE)) {
+ guint32 chunks = (table->num_symbol_files + 1) / SYMFILE_TABLE_CHUNK_SIZE;
+ guint32 size = sizeof (MonoDebuggerSymbolFile *) * SYMFILE_TABLE_CHUNK_SIZE * (chunks + 1);
+
+ table->symbol_files = g_realloc (table->symbol_files, size);
+ }
+
+ symfile = g_new0 (MonoDebuggerSymbolFile, 1);
+ symfile->index = table->num_symbol_files;
+ symfile->range_entry_size = sizeof (MonoDebuggerRangeInfo);
+ symfile->class_entry_size = sizeof (MonoDebuggerClassInfo);
+ symfile->class_table_size = sizeof (MonoDebuggerClassTable);
+ table->symbol_files [table->num_symbol_files++] = symfile;
+ return symfile;
+}
+
+void
+mono_debugger_initialize (void)
+{
+ MonoDebuggerSymbolTable *symbol_table;
+
+ MONO_GC_REGISTER_ROOT (last_exception);
+
+ g_assert (!mono_debugger_initialized);
+
+ InitializeCriticalSection (&debugger_lock_mutex);
+ mono_debugger_initialized = TRUE;
+
+ mono_debugger_lock ();
+
+ symbol_table = g_new0 (MonoDebuggerSymbolTable, 1);
+ symbol_table->magic = MONO_DEBUGGER_MAGIC;
+ symbol_table->version = MONO_DEBUGGER_VERSION;
+ symbol_table->total_size = sizeof (MonoDebuggerSymbolTable);
+
+ images = g_hash_table_new (g_direct_hash, g_direct_equal);
+ type_table = g_hash_table_new (g_direct_hash, g_direct_equal);
+ misc_table = g_hash_table_new (g_direct_hash, g_direct_equal);
+ class_table = g_hash_table_new (g_direct_hash, g_direct_equal);
+ class_info_table = g_hash_table_new (g_direct_hash, g_direct_equal);
+
+ mono_debugger_symbol_table = symbol_table;
+
+ mono_debugger_unlock ();
+}
+
+MonoDebuggerSymbolFile *
+mono_debugger_add_symbol_file (MonoDebugHandle *handle)
+{
+ MonoDebuggerSymbolFile *info;
+
+ g_assert (mono_debugger_initialized);
+ mono_debugger_lock ();
+
+ info = g_hash_table_lookup (images, handle->image);
+ if (info) {
+ mono_debugger_unlock ();
+ return info;
+ }
+
+ info = allocate_symbol_file_entry (mono_debugger_symbol_table);
+ info->symfile = handle->symfile;
+ info->image = handle->image;
+ info->image_file = handle->image_file;
+
+ g_hash_table_insert (images, handle->image, info);
+ mono_debugger_unlock ();
+
+ return info;
+}
+
+static void
+write_builtin_type (MonoDebuggerSymbolTable *table, MonoDebuggerSymbolFile *symfile,
+ MonoClass *klass, MonoDebuggerBuiltinTypeInfo *info)
+{
+ guint8 buffer [BUFSIZ], *ptr = buffer;
+ guint32 size;
+
+ g_assert (!klass->init_pending);
+ mono_class_init (klass);
+
+ switch (klass->byval_arg.type) {
+ case MONO_TYPE_VOID:
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_UNKNOWN;
+ WRITE_UINT32 (ptr, 0);
+ ptr += 4;
+ break;
+
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R8:
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_FUNDAMENTAL;
+ WRITE_UINT32 (ptr, klass->instance_size - sizeof (MonoObject));
+ ptr += 4;
+ break;
+
+ case MONO_TYPE_STRING: {
+ MonoString string;
+
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_STRING;
+ WRITE_UINT32 (ptr, klass->instance_size);
+ ptr += 4;
+ *ptr++ = (guint8*)&string.length - (guint8*)&string;
+ *ptr++ = sizeof (string.length);
+ *ptr++ = (guint8*)&string.chars - (guint8*)&string;
+
+ break;
+ }
+
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_FUNDAMENTAL;
+ WRITE_UINT32 (ptr, sizeof (void *));
+ ptr += 4;
+ break;
+
+ case MONO_TYPE_VALUETYPE:
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_STRUCT;
+ WRITE_UINT32 (ptr, klass->instance_size);
+ ptr += 4;
+ break;
+
+ case MONO_TYPE_CLASS:
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_CLASS;
+ WRITE_UINT32 (ptr, klass->instance_size);
+ ptr += 4;
+ break;
+
+ case MONO_TYPE_OBJECT:
+ g_assert (klass == mono_defaults.object_class);
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_OBJECT;
+ WRITE_UINT32 (ptr, klass->instance_size);
+ ptr += 4;
+ break;
+
+ default:
+ g_error (G_STRLOC ": Unknown builtin type %s.%s - %d", klass->name_space, klass->name, klass->byval_arg.type);
+ }
+
+ size = ptr - buffer;
+ info->type_info = allocate_type_entry (table, size, &info->type_data);
+ memcpy (info->type_data, buffer, size);
+
+ info->centry->info = g_new0 (MonoDebuggerClassInfo, 1); //allocate_class_entry (symfile);
+ info->centry->info->klass = klass;
+ if (klass->rank) {
+ info->centry->info->token = klass->element_class->type_token;
+ info->centry->info->rank = klass->rank;
+ } else
+ info->centry->info->token = klass->type_token;
+ info->centry->info->type_info = info->type_info;
+}
+
+static MonoDebuggerBuiltinTypeInfo *
+add_builtin_type (MonoDebuggerSymbolFile *symfile, MonoClass *klass)
+{
+ MonoDebuggerClassEntry *centry;
+ MonoDebuggerBuiltinTypeInfo *info;
+
+ centry = g_new0 (MonoDebuggerClassEntry, 1);
+
+ info = g_new0 (MonoDebuggerBuiltinTypeInfo, 1);
+ info->klass = klass;
+ info->centry = centry;
+
+ g_hash_table_insert (class_info_table, klass, centry);
+
+ write_builtin_type (mono_debugger_symbol_table, symfile, klass, info);
+ return info;
+}
+
+static void
+add_builtin_type_2 (MonoDebuggerBuiltinTypeInfo *info)
+{
+ info->class_info = do_write_class (mono_debugger_symbol_table, info->klass, NULL);
+ * (guint32 *) (info->type_data + 5) = info->class_info;
+}
+
+static void
+add_exception_class (MonoDebuggerSymbolFile *symfile, MonoException *exc)
+{
+ mono_debugger_start_add_type (symfile, ((MonoObject *) exc)->vtable->klass);
+ mono_debugger_add_type (symfile, ((MonoObject *) exc)->vtable->klass);
+}
+
+MonoDebuggerBuiltinTypes *
+mono_debugger_add_builtin_types (MonoDebuggerSymbolFile *symfile)
+{
+ MonoDebuggerBuiltinTypes *types = g_new0 (MonoDebuggerBuiltinTypes, 1);
+ MonoClass *klass;
+
+ mono_debugger_symbol_table->corlib = symfile;
+ mono_debugger_symbol_table->builtin_types = types;
+
+ types->total_size = sizeof (MonoDebuggerBuiltinTypes);
+ types->type_info_size = sizeof (MonoDebuggerBuiltinTypeInfo);
+
+ types->object_type = add_builtin_type (symfile, mono_defaults.object_class);
+ klass = mono_class_from_name (mono_defaults.corlib, "System", "ValueType");
+ g_assert (klass);
+ types->valuetype_type = add_builtin_type (symfile, klass);
+
+ types->byte_type = add_builtin_type (symfile, mono_defaults.byte_class);
+ types->void_type = add_builtin_type (symfile, mono_defaults.void_class);
+ types->boolean_type = add_builtin_type (symfile, mono_defaults.boolean_class);
+ types->sbyte_type = add_builtin_type (symfile, mono_defaults.sbyte_class);
+ types->int16_type = add_builtin_type (symfile, mono_defaults.int16_class);
+ types->uint16_type = add_builtin_type (symfile, mono_defaults.uint16_class);
+ types->int32_type = add_builtin_type (symfile, mono_defaults.int32_class);
+ types->uint32_type = add_builtin_type (symfile, mono_defaults.uint32_class);
+ types->int_type = add_builtin_type (symfile, mono_defaults.int_class);
+ types->uint_type = add_builtin_type (symfile, mono_defaults.uint_class);
+ types->int64_type = add_builtin_type (symfile, mono_defaults.int64_class);
+ types->uint64_type = add_builtin_type (symfile, mono_defaults.uint64_class);
+ types->single_type = add_builtin_type (symfile, mono_defaults.single_class);
+ types->double_type = add_builtin_type (symfile, mono_defaults.double_class);
+ types->char_type = add_builtin_type (symfile, mono_defaults.char_class);
+ types->string_type = add_builtin_type (symfile, mono_defaults.string_class);
+
+ klass = mono_class_from_name (mono_defaults.corlib, "System", "Type");
+ g_assert (klass);
+ types->type_type = add_builtin_type (symfile, klass);
+
+ types->enum_type = add_builtin_type (symfile, mono_defaults.enum_class);
+ types->array_type = add_builtin_type (symfile, mono_defaults.array_class);
+ types->exception_type = add_builtin_type (symfile, mono_defaults.exception_class);
+
+ add_builtin_type_2 (types->object_type);
+ add_builtin_type_2 (types->valuetype_type);
+
+ add_builtin_type_2 (types->byte_type);
+ add_builtin_type_2 (types->void_type);
+ add_builtin_type_2 (types->boolean_type);
+ add_builtin_type_2 (types->sbyte_type);
+ add_builtin_type_2 (types->int16_type);
+ add_builtin_type_2 (types->uint16_type);
+ add_builtin_type_2 (types->int32_type);
+ add_builtin_type_2 (types->uint32_type);
+ add_builtin_type_2 (types->int_type);
+ add_builtin_type_2 (types->uint_type);
+ add_builtin_type_2 (types->int64_type);
+ add_builtin_type_2 (types->uint64_type);
+ add_builtin_type_2 (types->single_type);
+ add_builtin_type_2 (types->double_type);
+ add_builtin_type_2 (types->char_type);
+ add_builtin_type_2 (types->string_type);
+ add_builtin_type_2 (types->type_type);
+
+ add_builtin_type_2 (types->enum_type);
+ add_builtin_type_2 (types->array_type);
+ add_builtin_type_2 (types->exception_type);
+
+ add_exception_class (symfile, mono_get_exception_divide_by_zero ());
+ add_exception_class (symfile, mono_get_exception_security ());
+ add_exception_class (symfile, mono_get_exception_arithmetic ());
+ add_exception_class (symfile, mono_get_exception_overflow ());
+ add_exception_class (symfile, mono_get_exception_null_reference ());
+ add_exception_class (symfile, mono_get_exception_thread_abort ());
+ add_exception_class (symfile, mono_get_exception_invalid_cast ());
+ add_exception_class (symfile, mono_get_exception_index_out_of_range ());
+ add_exception_class (symfile, mono_get_exception_thread_abort ());
+ add_exception_class (symfile, mono_get_exception_index_out_of_range ());
+ add_exception_class (symfile, mono_get_exception_array_type_mismatch ());
+ add_exception_class (symfile, mono_get_exception_missing_method ());
+ add_exception_class (symfile, mono_get_exception_appdomain_unloaded ());
+ add_exception_class (symfile, mono_get_exception_stack_overflow ());
+
+ builtin_types_initialized = TRUE;
+
+ return types;
+}
+
+static guint32
+write_class (MonoDebuggerSymbolTable *table, MonoClass *klass)
+{
+ MonoDebuggerClassEntry *centry;
+
+ centry = g_hash_table_lookup (class_info_table, klass);
+ if (!centry) {
+ MonoDebuggerSymbolFile *symfile = _mono_debugger_get_symfile (klass->image);
+
+ g_assert (symfile);
+ mono_debugger_start_add_type (symfile, klass);
+ centry = g_hash_table_lookup (class_info_table, klass);
+ }
+ g_assert (centry);
+
+ if (centry->info) {
+ g_assert (centry->info->type_info);
+ return centry->info->type_info;
+ }
+
+ if (!centry->type_reference) {
+ guint8 *ptr;
+
+ centry->type_reference = allocate_type_entry (table, 5, &ptr);
+
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_REFERENCE;
+ WRITE_POINTER (ptr, klass);
+ }
+
+ return centry->type_reference;
+}
+
+void
+mono_debugger_start_add_type (MonoDebuggerSymbolFile *symfile, MonoClass *klass)
+{
+ MonoDebuggerClassEntry *centry;
+
+ mono_debugger_lock ();
+ centry = g_hash_table_lookup (class_info_table, klass);
+ if (centry) {
+ mono_debugger_unlock ();
+ return;
+ }
+
+ centry = g_new0 (MonoDebuggerClassEntry, 1);
+ g_hash_table_insert (class_info_table, klass, centry);
+ mono_debugger_unlock ();
+}
+
+void
+mono_debugger_add_type (MonoDebuggerSymbolFile *symfile, MonoClass *klass)
+{
+ MonoDebuggerClassEntry *centry;
+
+ mono_debugger_lock ();
+ centry = g_hash_table_lookup (class_info_table, klass);
+ g_assert (centry);
+
+ if (centry->info) {
+ mono_debugger_unlock ();
+ return;
+ }
+
+ centry->info = allocate_class_entry (symfile);
+ centry->info->klass = klass;
+ if (klass->rank) {
+ centry->info->token = klass->element_class->type_token;
+ centry->info->rank = klass->rank;
+ } else
+ centry->info->token = klass->type_token;
+
+ do_write_class (mono_debugger_symbol_table, klass, centry->info);
+
+ g_assert (centry->info && centry->info->type_info);
+
+ symfile->generation++;
+ must_reload_symtabs = TRUE;
+
+ mono_debugger_unlock ();
+}
+
+void
+mono_debugger_add_method (MonoDebuggerSymbolFile *symfile, MonoDebugMethodInfo *minfo,
+ MonoDebugMethodJitInfo *jit)
+{
+ MonoSymbolFileMethodAddress *address;
+ MonoSymbolFileLexicalBlockEntry *block;
+ MonoDebugVarInfo *var_table;
+ MonoDebuggerRangeInfo *range;
+ MonoMethodHeader *header;
+ guint32 size, num_variables, variable_size, variable_offset;
+ guint32 type_size, type_offset, *type_index_table, has_this;
+ guint32 line_size = 0, line_offset = 0, block_offset, block_size;
+ MonoDebugLexicalBlockEntry *block_table;
+ MonoDebugLineNumberEntry *line_table;
+ guint32 *type_table;
+ guint8 *ptr;
+ int i;
+
+ if (!symfile->symfile->method_hash)
+ return;
+
+ header = mono_method_get_header (minfo->method);
+
+ symfile->generation++;
+
+ size = sizeof (MonoSymbolFileMethodAddress);
+
+ num_variables = jit->num_params + read32(&(minfo->entry->_num_locals));
+ has_this = jit->this_var != NULL;
+
+ variable_size = (num_variables + has_this) * sizeof (MonoDebugVarInfo);
+ variable_offset = size;
+ size += variable_size;
+
+ type_size = (num_variables + 1) * sizeof (gpointer);
+ type_offset = size;
+ size += type_size;
+
+ if (jit->line_numbers) {
+ line_offset = size;
+ line_size = jit->line_numbers->len * sizeof (MonoDebugLineNumberEntry);
+ size += line_size;
+ }
+
+ block_size = read32(&(minfo->entry->_num_lexical_blocks)) * sizeof (MonoSymbolFileLexicalBlockEntry);
+ block_offset = size;
+ size += block_size;
+
+ address = g_malloc0 (size);
+ ptr = (guint8 *) address;
+
+ block = (MonoSymbolFileLexicalBlockEntry *)
+ (symfile->symfile->raw_contents + read32(&(minfo->entry->_lexical_block_table_offset)));
+ block_table = (MonoDebugLexicalBlockEntry *) (ptr + block_offset);
+
+ for (i = 0; i < read32(&(minfo->entry->_num_lexical_blocks)); i++, block++) {
+ block_table [i].start_address = _mono_debug_address_from_il_offset (jit, read32(&(block->_start_offset)));
+ block_table [i].end_address = _mono_debug_address_from_il_offset (jit, read32(&(block->_end_offset)));
+ }
+
+ address->size = size;
+ address->has_this = has_this;
+ address->num_params = jit->num_params;
+ address->start_address = jit->code_start;
+ address->end_address = jit->code_start + jit->code_size;
+ address->method_start_address = address->start_address + jit->prologue_end;
+ address->method_end_address = address->start_address + jit->epilogue_begin;
+ address->wrapper_address = jit->wrapper_addr;
+ address->variable_table_offset = variable_offset;
+ address->type_table_offset = type_offset;
+ address->lexical_block_table_offset = block_offset;
+
+ if (jit->line_numbers) {
+ address->num_line_numbers = jit->line_numbers->len;
+ address->line_number_offset = line_offset;
+
+ line_table = (MonoDebugLineNumberEntry *) (ptr + line_offset);
+ memcpy (line_table, jit->line_numbers->data, line_size);
+ }
+
+ range = allocate_range_entry (symfile);
+ range->index = minfo->index;
+ range->start_address = address->start_address;
+ range->end_address = address->end_address;
+ range->dynamic_data = address;
+ range->dynamic_size = size;
+
+ if ((minfo->method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (minfo->method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (minfo->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ return;
+
+ var_table = (MonoDebugVarInfo *) (ptr + variable_offset);
+ type_table = (guint32 *) (ptr + type_offset);
+
+ type_index_table = (guint32 *)
+ (symfile->symfile->raw_contents + read32(&(minfo->entry->_type_index_table_offset)));
+
+ if (jit->this_var)
+ *var_table++ = *jit->this_var;
+ *type_table++ = write_type (mono_debugger_symbol_table, &minfo->method->klass->this_arg);
+
+ for (i = 0; i < jit->num_params; i++) {
+ *var_table++ = jit->params [i];
+ *type_table++ = write_type (mono_debugger_symbol_table, minfo->method->signature->params [i]);
+ }
+
+ if (jit->num_locals < read32(&(minfo->entry->_num_locals))) {
+ g_warning (G_STRLOC ": Method %s.%s has %d locals, but symbol file claims it has %d.",
+ minfo->method->klass->name, minfo->method->name, jit->num_locals,
+ read32(&(minfo->entry->_num_locals)));
+ var_table += read32(&(minfo->entry->_num_locals));
+ } else {
+ g_assert ((header != NULL) || (minfo->entry->_num_locals == 0));
+ for (i = 0; i < read32(&(minfo->entry->_num_locals)); i++) {
+ *var_table++ = jit->locals [i];
+ *type_table++ = write_type (mono_debugger_symbol_table, header->locals [i]);
+ }
+ }
+
+ must_reload_symtabs = TRUE;
+}
+
+static MonoDebuggerRangeInfo *
+allocate_range_entry (MonoDebuggerSymbolFile *symfile)
+{
+ MonoDebuggerRangeInfo *retval;
+ guint32 size, chunks;
+
+ if (!symfile->range_table) {
+ size = sizeof (MonoDebuggerRangeInfo) * RANGE_TABLE_CHUNK_SIZE;
+ symfile->range_table = g_malloc0 (size);
+ symfile->num_range_entries = 1;
+ return symfile->range_table;
+ }
+
+ if (!((symfile->num_range_entries + 1) % RANGE_TABLE_CHUNK_SIZE)) {
+ chunks = (symfile->num_range_entries + 1) / RANGE_TABLE_CHUNK_SIZE;
+ size = sizeof (MonoDebuggerRangeInfo) * RANGE_TABLE_CHUNK_SIZE * (chunks + 1);
+
+ symfile->range_table = g_realloc (symfile->range_table, size);
+ }
+
+ retval = symfile->range_table + symfile->num_range_entries;
+ symfile->num_range_entries++;
+ return retval;
+}
+
+static MonoDebuggerClassInfo *
+allocate_class_entry (MonoDebuggerSymbolFile *symfile)
+{
+ MonoDebuggerClassInfo *retval;
+ MonoDebuggerClassTable *table;
+ guint32 size;
+
+ if (!symfile->class_table_start) {
+ table = g_new0 (MonoDebuggerClassTable, 1);
+ symfile->class_table_start = symfile->current_class_table = table;
+
+ size = sizeof (MonoDebuggerClassInfo) * CLASS_TABLE_CHUNK_SIZE;
+ table->data = g_malloc0 (size);
+ table->size = CLASS_TABLE_CHUNK_SIZE;
+ table->index = 1;
+
+ return table->data;
+ }
+
+ table = symfile->current_class_table;
+ if (table->index >= table->size) {
+ table = g_new0 (MonoDebuggerClassTable, 1);
+
+ symfile->current_class_table->next = table;
+ symfile->current_class_table = table;
+
+ size = sizeof (MonoDebuggerClassInfo) * CLASS_TABLE_CHUNK_SIZE;
+ table->data = g_malloc0 (size);
+ table->size = CLASS_TABLE_CHUNK_SIZE;
+ table->index = 1;
+
+ return table->data;
+ }
+
+ retval = table->data + table->index;
+ table->index++;
+ return retval;
+}
+
+/*
+ * Allocate a new entry of size `size' in the type table.
+ * Returns the global offset which is to be used to reference this type and
+ * a pointer (in the `ptr' argument) which is to be used to write the type.
+ */
+static guint32
+allocate_type_entry (MonoDebuggerSymbolTable *table, guint32 size, guint8 **ptr)
+{
+ guint32 retval;
+ guint8 *data;
+
+ g_assert (size + 4 < TYPE_TABLE_CHUNK_SIZE);
+ g_assert (ptr != NULL);
+
+ /* Initialize things if necessary. */
+ if (!table->current_type_table) {
+ table->current_type_table = g_malloc0 (TYPE_TABLE_CHUNK_SIZE);
+ table->type_table_size = TYPE_TABLE_CHUNK_SIZE;
+ table->type_table_chunk_size = TYPE_TABLE_CHUNK_SIZE;
+ table->type_table_offset = MONO_DEBUGGER_TYPE_MAX + 1;
+ }
+
+ again:
+ /* First let's check whether there's still enough room in the current_type_table. */
+ if (table->type_table_offset + size + 4 < table->type_table_size) {
+ retval = table->type_table_offset;
+ table->type_table_offset += size + 4;
+ data = ((guint8 *) table->current_type_table) + retval - table->type_table_start;
+ *(gint32 *) data = size;
+ data += sizeof(gint32);
+ *ptr = data;
+ return retval;
+ }
+
+ /* Add the current_type_table to the type_tables vector and ... */
+ if (!table->type_tables) {
+ guint32 tsize = sizeof (gpointer) * TYPE_TABLE_PTR_CHUNK_SIZE;
+ table->type_tables = g_malloc0 (tsize);
+ }
+
+ if (!((table->num_type_tables + 1) % TYPE_TABLE_PTR_CHUNK_SIZE)) {
+ guint32 chunks = (table->num_type_tables + 1) / TYPE_TABLE_PTR_CHUNK_SIZE;
+ guint32 tsize = sizeof (gpointer) * TYPE_TABLE_PTR_CHUNK_SIZE * (chunks + 1);
+
+ table->type_tables = g_realloc (table->type_tables, tsize);
+ }
+
+ table->type_tables [table->num_type_tables++] = table->current_type_table;
+
+ /* .... allocate a new current_type_table. */
+ table->current_type_table = g_malloc0 (TYPE_TABLE_CHUNK_SIZE);
+ table->type_table_start = table->type_table_offset = table->type_table_size;
+ table->type_table_size += TYPE_TABLE_CHUNK_SIZE;
+
+ goto again;
+}
+
+/*
+ * Allocate a new entry of size `size' in the misc table.
+ * Returns the global offset which is to be used to reference this entry and
+ * a pointer (in the `ptr' argument) which is to be used to write the entry.
+ */
+static guint32
+allocate_misc_entry (MonoDebuggerSymbolTable *table, guint32 size, guint8 **ptr)
+{
+ guint32 retval;
+ guint8 *data;
+
+ g_assert (size + 4 < MISC_TABLE_CHUNK_SIZE);
+ g_assert (ptr != NULL);
+
+ /* Initialize things if necessary. */
+ if (!table->current_misc_table) {
+ table->current_misc_table = g_malloc0 (MISC_TABLE_CHUNK_SIZE);
+ table->misc_table_size = MISC_TABLE_CHUNK_SIZE;
+ table->misc_table_chunk_size = MISC_TABLE_CHUNK_SIZE;
+ table->misc_table_offset = 1;
+ }
+
+ again:
+ /* First let's check whether there's still enough room in the current_misc_table. */
+ if (table->misc_table_offset + size + 4 < table->misc_table_size) {
+ retval = table->misc_table_offset;
+ table->misc_table_offset += size + 4;
+ data = ((guint8 *) table->current_misc_table) + retval - table->misc_table_start;
+ *(gint32 *) data = size;
+ data += sizeof(gint32);
+ *ptr = data;
+ return retval;
+ }
+
+ /* Add the current_misc_table to the misc_tables vector and ... */
+ if (!table->misc_tables) {
+ guint32 tsize = sizeof (gpointer) * MISC_TABLE_PTR_CHUNK_SIZE;
+ table->misc_tables = g_malloc0 (tsize);
+ }
+
+ if (!((table->num_misc_tables + 1) % MISC_TABLE_PTR_CHUNK_SIZE)) {
+ guint32 chunks = (table->num_misc_tables + 1) / MISC_TABLE_PTR_CHUNK_SIZE;
+ guint32 tsize = sizeof (gpointer) * MISC_TABLE_PTR_CHUNK_SIZE * (chunks + 1);
+
+ table->misc_tables = g_realloc (table->misc_tables, tsize);
+ }
+
+ table->misc_tables [table->num_misc_tables++] = table->current_misc_table;
+
+ /* .... allocate a new current_misc_table. */
+ table->current_misc_table = g_malloc0 (MISC_TABLE_CHUNK_SIZE);
+ table->misc_table_start = table->misc_table_offset = table->misc_table_size;
+ table->misc_table_size += MISC_TABLE_CHUNK_SIZE;
+
+ goto again;
+}
+
+static gboolean
+property_is_static (MonoProperty *prop)
+{
+ MonoMethod *method;
+
+ method = prop->get;
+ if (!method)
+ method = prop->set;
+
+ return method->flags & METHOD_ATTRIBUTE_STATIC;
+}
+
+static gboolean
+event_is_static (MonoEvent *ev)
+{
+ MonoMethod *method;
+
+ method = ev->add;
+
+ return method->flags & METHOD_ATTRIBUTE_STATIC;
+}
+
+static guint32
+do_write_class (MonoDebuggerSymbolTable *table, MonoClass *klass, MonoDebuggerClassInfo *cinfo)
+{
+ guint8 buffer [BUFSIZ], *ptr = buffer, *old_ptr;
+ GPtrArray *methods = NULL, *static_methods = NULL, *ctors = NULL, *cctors = NULL;
+ int num_fields = 0, num_static_fields = 0, num_properties = 0, num_static_properties = 0;
+ int num_events = 0, num_static_events = 0;
+ int num_methods = 0, num_static_methods = 0, num_params = 0, num_static_params = 0, base_offset = 0;
+ int num_ctors = 0, num_ctor_params = 0;
+ int num_cctors = 0;
+ int field_info_size = 0, static_field_info_size = 0, property_info_size = 0, event_info_size = 0, static_event_info_size = 0;
+ int static_property_info_size = 0, method_info_size = 0, static_method_info_size = 0;
+ int ctor_info_size = 0, cctor_info_size = 0, iface_info_size = 0;
+ guint32 size, data_size, offset, data_offset;
+ GHashTable *method_slots = NULL;
+ int i;
+
+ if (klass->init_pending)
+ g_warning (G_STRLOC ": %p - %s.%s", klass, klass->name_space, klass->name);
+ g_assert (!klass->init_pending);
+ mono_class_init (klass);
+
+ offset = GPOINTER_TO_UINT (g_hash_table_lookup (class_table, klass));
+ if (offset)
+ return offset;
+
+ if (klass->enumtype) {
+ offset = allocate_type_entry (table, 13, &ptr);
+ if (cinfo)
+ cinfo->type_info = offset;
+ g_hash_table_insert (class_table, klass, GUINT_TO_POINTER (offset));
+
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_ENUM;
+ WRITE_UINT32 (ptr, klass->instance_size);
+ WRITE_UINT32 (ptr, MONO_DEBUGGER_TYPE_ENUM);
+ WRITE_UINT32 (ptr, write_type (table, klass->enum_basetype));
+ return offset;
+ }
+
+ for (i = 0; i < klass->field.count; i++)
+ if (!(klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC))
+ ++num_fields;
+ else
+ ++num_static_fields;
+
+ for (i = 0; i < klass->property.count; i++)
+ if (!property_is_static (&klass->properties [i]))
+ ++num_properties;
+ else
+ ++num_static_properties;
+
+ for (i = 0; i < klass->event.count; i++)
+ if (!event_is_static (&klass->events [i]))
+ ++num_events;
+ else
+ ++num_static_events;
+
+ method_slots = g_hash_table_new (NULL, NULL);
+ methods = g_ptr_array_new ();
+ static_methods = g_ptr_array_new ();
+ ctors = g_ptr_array_new ();
+ cctors = g_ptr_array_new ();
+
+ for (i = 0; i < klass->method.count; i++) {
+ MonoMethod *method = klass->methods [i];
+
+ if (!strcmp (method->name, ".cctor")) {
+ ++num_cctors;
+ g_ptr_array_add (cctors, method);
+ continue;
+ }
+
+ if (!strcmp (method->name, ".ctor")) {
+ ++num_ctors;
+ num_ctor_params += method->signature->param_count;
+ g_ptr_array_add (ctors, method);
+ continue;
+ }
+
+ if (method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME)
+ continue;
+
+ if (method->slot != -1) {
+ if (g_hash_table_lookup (method_slots, GUINT_TO_POINTER (method->slot)))
+ continue;
+ g_hash_table_insert (method_slots, GUINT_TO_POINTER (method->slot), method);
+ }
+
+ if (method->flags & METHOD_ATTRIBUTE_STATIC) {
+ ++num_static_methods;
+ num_static_params += method->signature->param_count;
+ g_ptr_array_add (static_methods, method);
+ } else {
+ ++num_methods;
+ num_params += method->signature->param_count;
+ g_ptr_array_add (methods, method);
+ }
+ }
+
+ g_hash_table_destroy (method_slots);
+
+ field_info_size = num_fields * 8;
+ static_field_info_size = num_static_fields * 8;
+ property_info_size = num_properties * (4 + 2 * sizeof (gpointer));
+ static_property_info_size = num_static_properties * (4 + 2 * sizeof (gpointer));
+ event_info_size = num_events * (4 + 2 * sizeof (gpointer));
+ static_event_info_size = num_static_events * (4 + 2 * sizeof (gpointer));
+ method_info_size = num_methods * (2 * 4 + sizeof (gpointer)) + num_params * 4;
+ static_method_info_size = num_static_methods * (2 * 4 + sizeof (gpointer)) +
+ num_static_params * 4;
+ ctor_info_size = num_ctors * (2 * 4 + sizeof (gpointer)) + num_ctor_params * 4;
+ cctor_info_size = num_cctors * (2 * 4 + sizeof (gpointer));
+ iface_info_size = klass->interface_count * 4;
+
+ size = 98 + sizeof (gpointer) + field_info_size + static_field_info_size +
+ property_info_size + static_property_info_size + event_info_size +
+ static_event_info_size + method_info_size + static_method_info_size +
+ ctor_info_size + cctor_info_size + iface_info_size;
+
+ data_size = size;
+
+ offset = allocate_type_entry (table, data_size, &ptr);
+ old_ptr = ptr;
+
+ if (cinfo)
+ cinfo->type_info = offset;
+
+ g_hash_table_insert (class_table, klass, GUINT_TO_POINTER (offset));
+
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_CLASS_INFO;
+
+ if (klass->valuetype)
+ base_offset = - sizeof (MonoObject);
+
+ WRITE_UINT32 (ptr, klass->instance_size + base_offset);
+ *ptr++ = klass->valuetype;
+ WRITE_POINTER (ptr, klass);
+ data_offset = 0;
+ WRITE_UINT32 (ptr, num_fields);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += field_info_size;
+ WRITE_UINT32 (ptr, num_properties);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += property_info_size;
+ WRITE_UINT32 (ptr, num_events);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += event_info_size;
+ WRITE_UINT32 (ptr, num_methods);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += method_info_size;
+ WRITE_UINT32 (ptr, num_static_fields);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += static_field_info_size;
+ WRITE_UINT32 (ptr, num_static_properties);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += static_property_info_size;
+ WRITE_UINT32 (ptr, num_static_events);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += static_event_info_size;
+ WRITE_UINT32 (ptr, num_static_methods);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += static_method_info_size;
+ WRITE_UINT32 (ptr, num_ctors);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += ctor_info_size;
+ WRITE_UINT32 (ptr, num_cctors);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += cctor_info_size;
+ WRITE_UINT32 (ptr, klass->interface_count);
+ WRITE_UINT32 (ptr, data_offset);
+ data_offset += iface_info_size;
+
+ if (klass->parent && (klass->parent != mono_defaults.object_class))
+ WRITE_UINT32 (ptr, write_class (table, klass->parent));
+ else
+ WRITE_UINT32 (ptr, 0);
+
+ for (i = 0; i < klass->field.count; i++) {
+ if (klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+
+ WRITE_UINT32 (ptr, klass->fields [i].offset + base_offset);
+ WRITE_UINT32 (ptr, write_type (table, klass->fields [i].type));
+ }
+
+ for (i = 0; i < klass->property.count; i++) {
+ if (property_is_static (&klass->properties [i]))
+ continue;
+
+ if (klass->properties [i].get)
+ WRITE_UINT32 (ptr, write_type (table, klass->properties [i].get->signature->ret));
+ else
+ WRITE_UINT32 (ptr, 0);
+ WRITE_POINTER (ptr, klass->properties [i].get);
+ WRITE_POINTER (ptr, klass->properties [i].set);
+ }
+
+ for (i = 0; i < klass->event.count; i++) {
+ if (event_is_static (&klass->events[i]))
+ continue;
+
+ if (klass->events [i].add) {
+ WRITE_UINT32 (ptr, write_type (table, klass->events [i].add->signature->params[0]));
+ }
+ else {
+ g_warning ("event add method not defined");
+ WRITE_UINT32 (ptr, 0);
+ }
+ WRITE_POINTER (ptr, klass->events [i].add);
+ WRITE_POINTER (ptr, klass->events [i].remove);
+ /* raise? other? */
+ }
+
+ for (i = 0; i < methods->len; i++) {
+ MonoMethod *method = g_ptr_array_index (methods, i);
+ int j;
+
+ WRITE_POINTER (ptr, method);
+ if ((method->signature->ret) && (method->signature->ret->type != MONO_TYPE_VOID))
+ WRITE_UINT32 (ptr, write_type (table, method->signature->ret));
+ else
+ WRITE_UINT32 (ptr, 0);
+ WRITE_UINT32 (ptr, method->signature->param_count);
+ for (j = 0; j < method->signature->param_count; j++)
+ WRITE_UINT32 (ptr, write_type (table, method->signature->params [j]));
+ }
+
+ g_ptr_array_free (methods, FALSE);
+
+ for (i = 0; i < klass->field.count; i++) {
+ if (!(klass->fields [i].type->attrs & FIELD_ATTRIBUTE_STATIC))
+ continue;
+
+ WRITE_UINT32 (ptr, klass->fields [i].offset);
+ WRITE_UINT32 (ptr, write_type (table, klass->fields [i].type));
+ }
+
+ for (i = 0; i < klass->property.count; i++) {
+ if (!property_is_static (&klass->properties [i]))
+ continue;
+
+ if (klass->properties [i].get)
+ WRITE_UINT32 (ptr, write_type (table, klass->properties [i].get->signature->ret));
+ else
+ WRITE_UINT32 (ptr, 0);
+ WRITE_POINTER (ptr, klass->properties [i].get);
+ WRITE_POINTER (ptr, klass->properties [i].set);
+ }
+
+ for (i = 0; i < klass->event.count; i++) {
+ if (!event_is_static (&klass->events[i]))
+ continue;
+
+ if (klass->events [i].add) {
+ WRITE_UINT32 (ptr, write_type (table, klass->events [i].add->signature->params[0]));
+ }
+ else {
+ g_warning ("event add method not defined");
+ WRITE_UINT32 (ptr, 0);
+ }
+ WRITE_POINTER (ptr, klass->events [i].add);
+ WRITE_POINTER (ptr, klass->events [i].remove);
+ /* raise? other? */
+ }
+
+ for (i = 0; i < static_methods->len; i++) {
+ MonoMethod *method = g_ptr_array_index (static_methods, i);
+ int j;
+
+ WRITE_POINTER (ptr, method);
+ if ((method->signature->ret) && (method->signature->ret->type != MONO_TYPE_VOID))
+ WRITE_UINT32 (ptr, write_type (table, method->signature->ret));
+ else
+ WRITE_UINT32 (ptr, 0);
+ WRITE_UINT32 (ptr, method->signature->param_count);
+ for (j = 0; j < method->signature->param_count; j++)
+ WRITE_UINT32 (ptr, write_type (table, method->signature->params [j]));
+ }
+
+ g_ptr_array_free (static_methods, FALSE);
+
+ for (i = 0; i < ctors->len; i++) {
+ MonoMethod *ctor = g_ptr_array_index (ctors, i);
+ int j;
+
+ WRITE_POINTER (ptr, ctor);
+ WRITE_UINT32 (ptr, 0);
+ WRITE_UINT32 (ptr, ctor->signature->param_count);
+ for (j = 0; j < ctor->signature->param_count; j++)
+ WRITE_UINT32 (ptr, write_type (table, ctor->signature->params [j]));
+ }
+
+ g_ptr_array_free (ctors, FALSE);
+
+ for (i = 0; i < cctors->len; i++) {
+ MonoMethod *cctor = g_ptr_array_index (cctors, i);
+
+ WRITE_POINTER (ptr, cctor);
+ WRITE_UINT32 (ptr, 0);
+ WRITE_UINT32 (ptr, 0);
+ }
+
+ g_ptr_array_free (cctors, FALSE);
+
+ for (i = 0; i < klass->interface_count; i++)
+ WRITE_UINT32 (ptr, write_class (table, klass->interfaces [i]));
+
+ if (ptr - old_ptr != data_size) {
+ g_warning (G_STRLOC ": %d,%d,%d", ptr - old_ptr, data_size, sizeof (gpointer));
+ if (klass)
+ g_warning (G_STRLOC ": %s.%s", klass->name_space, klass->name);
+ g_assert_not_reached ();
+ }
+
+ return offset;
+}
+
+/*
+ * Adds type `type' to the type table and returns its offset.
+ */
+static guint32
+write_type (MonoDebuggerSymbolTable *table, MonoType *type)
+{
+ guint8 buffer [BUFSIZ], *ptr = buffer;
+ guint32 size, offset;
+ MonoClass *klass;
+
+ offset = GPOINTER_TO_UINT (g_hash_table_lookup (type_table, type));
+ if (offset)
+ return offset;
+
+ klass = mono_class_from_mono_type (type);
+ if (type->type == MONO_TYPE_CLASS)
+ return write_class (table, klass);
+
+ // mono_class_init (klass);
+
+ switch (type->type) {
+ case MONO_TYPE_VOID:
+ return MONO_DEBUGGER_TYPE_VOID;
+
+ case MONO_TYPE_BOOLEAN:
+ return MONO_DEBUGGER_TYPE_BOOLEAN;
+
+ case MONO_TYPE_I1:
+ return MONO_DEBUGGER_TYPE_I1;
+
+ case MONO_TYPE_U1:
+ return MONO_DEBUGGER_TYPE_U1;
+
+ case MONO_TYPE_CHAR:
+ return MONO_DEBUGGER_TYPE_CHAR;
+
+ case MONO_TYPE_I2:
+ return MONO_DEBUGGER_TYPE_I2;
+
+ case MONO_TYPE_U2:
+ return MONO_DEBUGGER_TYPE_U2;
+
+ case MONO_TYPE_I4:
+ return MONO_DEBUGGER_TYPE_I4;
+
+ case MONO_TYPE_U4:
+ return MONO_DEBUGGER_TYPE_U4;
+
+ case MONO_TYPE_I8:
+ return MONO_DEBUGGER_TYPE_I8;
+
+ case MONO_TYPE_U8:
+ return MONO_DEBUGGER_TYPE_U8;
+
+ case MONO_TYPE_R4:
+ return MONO_DEBUGGER_TYPE_R4;
+
+ case MONO_TYPE_R8:
+ return MONO_DEBUGGER_TYPE_R8;
+
+ case MONO_TYPE_STRING:
+ return MONO_DEBUGGER_TYPE_STRING;
+
+ case MONO_TYPE_I:
+ return MONO_DEBUGGER_TYPE_I;
+
+ case MONO_TYPE_U:
+ return MONO_DEBUGGER_TYPE_U;
+
+ case MONO_TYPE_SZARRAY: {
+ MonoArray array;
+
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_SZARRAY;
+ WRITE_UINT32 (ptr, sizeof (MonoArray));
+ WRITE_UINT32 (ptr, MONO_DEBUGGER_TYPE_ARRAY);
+ *ptr++ = (guint8*)&array.max_length - (guint8*)&array;
+ *ptr++ = sizeof (array.max_length);
+ *ptr++ = (guint8*)&array.vector - (guint8*)&array;
+ WRITE_UINT32 (ptr, write_type (table, &type->data.klass->byval_arg));
+ break;
+ }
+
+ case MONO_TYPE_ARRAY: {
+ MonoArray array;
+ MonoArrayBounds bounds;
+
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_ARRAY;
+ WRITE_UINT32 (ptr, sizeof (MonoArray));
+ WRITE_UINT32 (ptr, MONO_DEBUGGER_TYPE_ARRAY);
+ *ptr++ = (guint8*)&array.max_length - (guint8*)&array;
+ *ptr++ = sizeof (array.max_length);
+ *ptr++ = (guint8*)&array.vector - (guint8*)&array;
+ *ptr++ = klass->rank;
+ *ptr++ = (guint8*)&array.bounds - (guint8*)&array;
+ *ptr++ = sizeof (MonoArrayBounds);
+ *ptr++ = (guint8*)&bounds.lower_bound - (guint8*)&bounds;
+ *ptr++ = sizeof (bounds.lower_bound);
+ *ptr++ = (guint8*)&bounds.length - (guint8*)&bounds;
+ *ptr++ = sizeof (bounds.length);
+ WRITE_UINT32 (ptr, write_type (table, &type->data.array->eklass->byval_arg));
+ break;
+ }
+
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_GENERICINST:
+ case MONO_TYPE_OBJECT:
+ return write_class (table, klass);
+
+ case MONO_TYPE_PTR:
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_POINTER;
+ WRITE_UINT32 (ptr, sizeof (gpointer));
+ WRITE_UINT32 (ptr, write_type (table, type->data.type));
+ break;
+
+ default:
+ /* g_message (G_STRLOC ": %s.%s - %p - %d", klass->name_space, klass->name, klass, type->type); */
+ *ptr++ = MONO_DEBUGGER_TYPE_KIND_UNKNOWN;
+ WRITE_UINT32 (ptr, klass->instance_size);
+ WRITE_UINT32 (ptr, write_class (table, klass));
+ break;
+ }
+
+ size = ptr - buffer;
+ offset = allocate_type_entry (mono_debugger_symbol_table, size, &ptr);
+ memcpy (ptr, buffer, size);
+
+ return offset;
+}
+
+MonoReflectionMethod *
+ves_icall_MonoDebugger_GetMethod (MonoReflectionAssembly *assembly, guint32 token)
+{
+ MonoMethod *method;
+
+ method = mono_get_method (mono_assembly_get_image (assembly->assembly), token, NULL);
+
+ return mono_method_get_object (mono_domain_get (), method, NULL);
+}
+
+int
+ves_icall_MonoDebugger_GetMethodToken (MonoReflectionAssembly *assembly, MonoReflectionMethod *method)
+{
+ return method->method->token;
+}
+
+MonoReflectionType *
+ves_icall_MonoDebugger_GetType (MonoReflectionAssembly *assembly, guint32 token)
+{
+ MonoClass *klass;
+
+ klass = mono_class_get (mono_assembly_get_image (assembly->assembly), token);
+ if (!klass) {
+ g_warning (G_STRLOC ": %x", token);
+ return NULL;
+ }
+
+ return mono_type_get_object (mono_domain_get (), &klass->byval_arg);
+}
+
+MonoReflectionType *
+ves_icall_MonoDebugger_GetLocalTypeFromSignature (MonoReflectionAssembly *assembly, MonoArray *signature)
+{
+ MonoDomain *domain;
+ MonoImage *image;
+ MonoType *type;
+ const char *ptr;
+ int len = 0;
+
+ MONO_CHECK_ARG_NULL (assembly);
+ MONO_CHECK_ARG_NULL (signature);
+
+ domain = mono_domain_get();
+ image = mono_assembly_get_image (assembly->assembly);
+
+ ptr = mono_array_addr (signature, char, 0);
+ g_assert (*ptr++ == 0x07);
+ len = mono_metadata_decode_value (ptr, &ptr);
+ g_assert (len == 1);
+
+ type = mono_metadata_parse_type (image, MONO_PARSE_LOCAL, 0, ptr, &ptr);
+
+ return mono_type_get_object (domain, type);
+}
+
+void
+mono_debugger_event (MonoDebuggerEvent event, gpointer data, guint32 arg)
+{
+ if (mono_debugger_event_handler)
+ (* mono_debugger_event_handler) (event, data, arg);
+}
+
+void
+mono_debugger_cleanup (void)
+{
+ /* Do nothing yet. */
+}
+
+/*
+ * Debugger breakpoint interface.
+ *
+ * This interface is used to insert breakpoints on methods which are not yet JITed.
+ * The debugging code keeps a list of all such breakpoints and automatically inserts the
+ * breakpoint when the method is JITed.
+ */
+
+static GPtrArray *breakpoints = NULL;
+
+int
+mono_debugger_insert_breakpoint_full (MonoMethodDesc *desc)
+{
+ static int last_breakpoint_id = 0;
+ MonoDebuggerBreakpointInfo *info;
+
+ info = g_new0 (MonoDebuggerBreakpointInfo, 1);
+ info->desc = desc;
+ info->index = ++last_breakpoint_id;
+
+ if (!breakpoints)
+ breakpoints = g_ptr_array_new ();
+
+ g_ptr_array_add (breakpoints, info);
+
+ return info->index;
+}
+
+int
+mono_debugger_remove_breakpoint (int breakpoint_id)
+{
+ int i;
+
+ if (!breakpoints)
+ return 0;
+
+ for (i = 0; i < breakpoints->len; i++) {
+ MonoDebuggerBreakpointInfo *info = g_ptr_array_index (breakpoints, i);
+
+ if (info->index != breakpoint_id)
+ continue;
+
+ mono_method_desc_free (info->desc);
+ g_ptr_array_remove (breakpoints, info);
+ g_free (info);
+ return 1;
+ }
+
+ return 0;
+}
+
+int
+mono_debugger_insert_breakpoint (const gchar *method_name, gboolean include_namespace)
+{
+ MonoMethodDesc *desc;
+
+ desc = mono_method_desc_new (method_name, include_namespace);
+ if (!desc)
+ return 0;
+
+ return mono_debugger_insert_breakpoint_full (desc);
+}
+
+int
+mono_debugger_method_has_breakpoint (MonoMethod *method)
+{
+ int i;
+
+ if (!breakpoints || (method->wrapper_type != MONO_WRAPPER_NONE))
+ return 0;
+
+ for (i = 0; i < breakpoints->len; i++) {
+ MonoDebuggerBreakpointInfo *info = g_ptr_array_index (breakpoints, i);
+
+ if (!mono_method_desc_full_match (info->desc, method))
+ continue;
+
+ return info->index;
+ }
+
+ return 0;
+}
+
+void
+mono_debugger_breakpoint_callback (MonoMethod *method, guint32 index)
+{
+ mono_debugger_event (MONO_DEBUGGER_EVENT_BREAKPOINT, method, index);
+}
+
+gboolean
+mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject *exc)
+{
+ if (!mono_debugger_initialized)
+ return FALSE;
+
+ // Prevent the object from being finalized.
+ last_exception = exc;
+ mono_debugger_event (MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION, exc, addr);
+ return TRUE;
+}
+
+void
+mono_debugger_handle_exception (gpointer addr, gpointer stack, MonoObject *exc)
+{
+ MonoDebuggerExceptionInfo info;
+
+ if (!mono_debugger_initialized)
+ return;
+
+ // Prevent the object from being finalized.
+ last_exception = exc;
+
+ info.stack_pointer = stack;
+ info.exception_obj = exc;
+ info.stop = 0;
+
+ mono_debugger_event (MONO_DEBUGGER_EVENT_EXCEPTION, &info, addr);
+}
+
+gboolean
+mono_debugger_throw_exception (gpointer addr, gpointer stack, MonoObject *exc)
+{
+ MonoDebuggerExceptionInfo info;
+
+ if (!mono_debugger_initialized)
+ return FALSE;
+
+ // Prevent the object from being finalized.
+ last_exception = exc;
+
+ info.stack_pointer = stack;
+ info.exception_obj = exc;
+ info.stop = 0;
+
+ mono_debugger_event (MONO_DEBUGGER_EVENT_THROW_EXCEPTION, &info, addr);
+ return info.stop != 0;
+}
+
+static gchar *
+get_exception_message (MonoObject *exc)
+{
+ char *message = NULL;
+ MonoString *str;
+ MonoMethod *method;
+ MonoClass *klass;
+ gint i;
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ klass = exc->vtable->klass;
+ method = NULL;
+ while (klass && method == NULL) {
+ for (i = 0; i < klass->method.count; ++i) {
+ method = klass->methods [i];
+ if (!strcmp ("ToString", method->name) &&
+ method->signature->param_count == 0 &&
+ method->flags & METHOD_ATTRIBUTE_VIRTUAL &&
+ method->flags & METHOD_ATTRIBUTE_PUBLIC) {
+ break;
+ }
+ method = NULL;
+ }
+
+ if (method == NULL)
+ klass = klass->parent;
+ }
+
+ g_assert (method);
+
+ str = (MonoString *) mono_runtime_invoke (method, exc, NULL, NULL);
+ if (str)
+ message = mono_string_to_utf8 (str);
+ }
+
+ return message;
+}
+
+MonoObject *
+mono_debugger_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
+{
+ MonoObject *retval;
+ gchar *message;
+
+ if (!strcmp (method->name, ".ctor")) {
+ retval = obj = mono_object_new (mono_domain_get (), method->klass);
+
+ mono_runtime_invoke (method, obj, params, exc);
+ } else
+ retval = mono_runtime_invoke (method, obj, params, exc);
+
+ if (!exc || (*exc == NULL))
+ return retval;
+
+ message = get_exception_message (*exc);
+ if (message) {
+ *exc = (MonoObject *) mono_string_new_wrapper (message);
+ g_free (message);
+ }
+
+ return retval;
+}
+
+guint32
+mono_debugger_lookup_type (const gchar *type_name)
+{
+ int i;
+
+ mono_debugger_lock ();
+
+ for (i = 0; i < mono_debugger_symbol_table->num_symbol_files; i++) {
+ MonoDebuggerSymbolFile *symfile = mono_debugger_symbol_table->symbol_files [i];
+ MonoType *type;
+ guint32 offset;
+ gchar *name;
+
+ name = g_strdup (type_name);
+ type = mono_reflection_type_from_name (name, symfile->image);
+ g_free (name);
+ if (!type)
+ continue;
+
+ offset = write_type (mono_debugger_symbol_table, type);
+
+ mono_debugger_unlock ();
+ return offset;
+ }
+
+ mono_debugger_unlock ();
+ return 0;
+}
+
+gint32
+mono_debugger_lookup_assembly (const gchar *name)
+{
+ MonoAssembly *assembly;
+ MonoImageOpenStatus status;
+ int i;
+
+ mono_debugger_lock ();
+
+ again:
+ for (i = 0; i < mono_debugger_symbol_table->num_symbol_files; i++) {
+ MonoDebuggerSymbolFile *symfile = mono_debugger_symbol_table->symbol_files [i];
+
+ if (!strcmp (symfile->image_file, name)) {
+ mono_debugger_unlock ();
+ return i;
+ }
+ }
+
+ assembly = mono_assembly_open (name, &status);
+
+ if (status != MONO_IMAGE_OK) {
+ g_warning (G_STRLOC ": Cannot open image `%s'", name);
+ mono_debugger_unlock ();
+ return -1;
+ }
+
+ must_reload_symtabs = TRUE;
+ goto again;
+}
+
+void
+mono_debugger_add_wrapper (MonoMethod *wrapper, MonoDebugMethodJitInfo *jit, gpointer addr)
+{
+ guint32 size, offset;
+ guint8 *ptr;
+
+ if (!mono_debugger_symbol_table)
+ return;
+
+ size = strlen (wrapper->name) + 5 + 5 * sizeof (gpointer);
+
+ offset = allocate_misc_entry (mono_debugger_symbol_table, size, &ptr);
+
+ WRITE_UINT32 (ptr, MONO_DEBUGGER_MISC_ENTRY_TYPE_WRAPPER);
+ WRITE_STRING (ptr, wrapper->name);
+ WRITE_POINTER (ptr, jit->code_start);
+ WRITE_POINTER (ptr, jit->code_start + jit->code_size);
+ WRITE_POINTER (ptr, addr);
+ WRITE_POINTER (ptr, jit->code_start + jit->prologue_end);
+ WRITE_POINTER (ptr, jit->code_start + jit->epilogue_begin);
+}
diff --git a/mono/metadata/mono-debug-debugger.h b/mono/metadata/mono-debug-debugger.h
new file mode 100644
index 00000000000..9388b6916b3
--- /dev/null
+++ b/mono/metadata/mono-debug-debugger.h
@@ -0,0 +1,334 @@
+/*
+ * This header is only installed for use by the debugger:
+ * the structures and the API declared here are not supported.
+ */
+
+#ifndef __MONO_DEBUG_DEBUGGER_H__
+#define __MONO_DEBUG_DEBUGGER_H__
+
+#include <glib.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/debug-mono-symfile.h>
+#include <mono/io-layer/io-layer.h>
+
+typedef struct _MonoDebuggerBreakpointInfo MonoDebuggerBreakpointInfo;
+typedef struct _MonoDebuggerBuiltinTypeInfo MonoDebuggerBuiltinTypeInfo;
+typedef struct _MonoDebuggerBuiltinTypes MonoDebuggerBuiltinTypes;
+typedef struct _MonoDebuggerSymbolTable MonoDebuggerSymbolTable;
+typedef struct _MonoDebuggerSymbolFile MonoDebuggerSymbolFile;
+typedef struct _MonoDebuggerSymbolFilePriv MonoDebuggerSymbolFilePriv;
+typedef struct _MonoDebuggerRangeInfo MonoDebuggerRangeInfo;
+typedef struct _MonoDebuggerClassEntry MonoDebuggerClassEntry;
+typedef struct _MonoDebuggerClassInfo MonoDebuggerClassInfo;
+typedef struct _MonoDebuggerClassTable MonoDebuggerClassTable;
+typedef struct _MonoDebuggerIOLayer MonoDebuggerIOLayer;
+
+typedef enum {
+ MONO_DEBUGGER_EVENT_BREAKPOINT,
+ MONO_DEBUGGER_EVENT_RELOAD_SYMTABS,
+ MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION,
+ MONO_DEBUGGER_EVENT_EXCEPTION,
+ MONO_DEBUGGER_EVENT_THROW_EXCEPTION
+} MonoDebuggerEvent;
+
+typedef enum {
+ MONO_DEBUGGER_TYPE_KIND_UNKNOWN = 1,
+ MONO_DEBUGGER_TYPE_KIND_FUNDAMENTAL,
+ MONO_DEBUGGER_TYPE_KIND_STRING,
+ MONO_DEBUGGER_TYPE_KIND_SZARRAY,
+ MONO_DEBUGGER_TYPE_KIND_ARRAY,
+ MONO_DEBUGGER_TYPE_KIND_POINTER,
+ MONO_DEBUGGER_TYPE_KIND_ENUM,
+ MONO_DEBUGGER_TYPE_KIND_OBJECT,
+ MONO_DEBUGGER_TYPE_KIND_STRUCT,
+ MONO_DEBUGGER_TYPE_KIND_CLASS,
+ MONO_DEBUGGER_TYPE_KIND_CLASS_INFO,
+ MONO_DEBUGGER_TYPE_KIND_REFERENCE
+} MonoDebuggerTypeKind;
+
+typedef enum {
+ MONO_DEBUGGER_TYPE_UNKNOWN = 0,
+ MONO_DEBUGGER_TYPE_VOID,
+ MONO_DEBUGGER_TYPE_BOOLEAN,
+ MONO_DEBUGGER_TYPE_CHAR,
+ MONO_DEBUGGER_TYPE_I1,
+ MONO_DEBUGGER_TYPE_U1,
+ MONO_DEBUGGER_TYPE_I2,
+ MONO_DEBUGGER_TYPE_U2,
+ MONO_DEBUGGER_TYPE_I4,
+ MONO_DEBUGGER_TYPE_U4,
+ MONO_DEBUGGER_TYPE_I8,
+ MONO_DEBUGGER_TYPE_U8,
+ MONO_DEBUGGER_TYPE_R4,
+ MONO_DEBUGGER_TYPE_R8,
+ MONO_DEBUGGER_TYPE_I,
+ MONO_DEBUGGER_TYPE_U,
+ MONO_DEBUGGER_TYPE_STRING,
+ MONO_DEBUGGER_TYPE_ARRAY,
+ MONO_DEBUGGER_TYPE_ENUM,
+ MONO_DEBUGGER_TYPE_MAX = 100
+} MonoDebuggerType;
+
+struct _MonoDebuggerBreakpointInfo {
+ guint32 index;
+ MonoMethodDesc *desc;
+};
+
+struct _MonoDebuggerBuiltinTypeInfo
+{
+ MonoDebuggerClassEntry *centry;
+ MonoClass *klass;
+ guint32 type_info;
+ guint32 class_info;
+ guint8 *type_data;
+};
+
+struct _MonoDebuggerBuiltinTypes {
+ guint32 total_size;
+ guint32 type_info_size;
+ MonoDebuggerBuiltinTypeInfo *object_type;
+ MonoDebuggerBuiltinTypeInfo *valuetype_type;
+ MonoDebuggerBuiltinTypeInfo *byte_type;
+ MonoDebuggerBuiltinTypeInfo *void_type;
+ MonoDebuggerBuiltinTypeInfo *boolean_type;
+ MonoDebuggerBuiltinTypeInfo *sbyte_type;
+ MonoDebuggerBuiltinTypeInfo *int16_type;
+ MonoDebuggerBuiltinTypeInfo *uint16_type;
+ MonoDebuggerBuiltinTypeInfo *int32_type;
+ MonoDebuggerBuiltinTypeInfo *uint32_type;
+ MonoDebuggerBuiltinTypeInfo *int_type;
+ MonoDebuggerBuiltinTypeInfo *uint_type;
+ MonoDebuggerBuiltinTypeInfo *int64_type;
+ MonoDebuggerBuiltinTypeInfo *uint64_type;
+ MonoDebuggerBuiltinTypeInfo *single_type;
+ MonoDebuggerBuiltinTypeInfo *double_type;
+ MonoDebuggerBuiltinTypeInfo *char_type;
+ MonoDebuggerBuiltinTypeInfo *string_type;
+ MonoDebuggerBuiltinTypeInfo *enum_type;
+ MonoDebuggerBuiltinTypeInfo *array_type;
+ MonoDebuggerBuiltinTypeInfo *exception_type;
+ MonoDebuggerBuiltinTypeInfo *type_type;
+};
+
+struct _MonoDebuggerSymbolTable {
+ guint64 magic;
+ guint32 version;
+ guint32 total_size;
+
+ /*
+ * Corlib and builtin types.
+ */
+ MonoDebuggerSymbolFile *corlib;
+ MonoDebuggerBuiltinTypes *builtin_types;
+
+ /*
+ * The symbol files.
+ */
+ guint32 num_symbol_files;
+ MonoDebuggerSymbolFile **symbol_files;
+
+ /*
+ * Type table.
+ * This is intentionally not a GPtrArray to make it more easy to
+ * read for the debugger. The `type_tables' field contains
+ * `num_type_tables' pointers to continuous memory areas of
+ * `type_table_chunk_size' bytes each.
+ *
+ * The type table is basically a big continuous blob, but we need
+ * to split it up into pieces because we don't know the total size
+ * in advance and using g_realloc() doesn't work because that may
+ * reallocate the block to a different address.
+ */
+ guint32 num_type_tables;
+ guint32 type_table_chunk_size;
+ gpointer *type_tables;
+ /*
+ * Current type table.
+ * The `current_type_table' points to a blob of `type_table_chunk_size'
+ * bytes.
+ */
+ gpointer current_type_table;
+ /*
+ * This is the total size of the type table, including all the tables
+ * in the `type_tables' vector.
+ */
+ guint32 type_table_size;
+ /*
+ * These are global offsets - the `current_type_table' starts at global
+ * offset `type_table_start' and we've already allocated stuff in it
+ * until offset `type_table_offset'.
+ */
+ guint32 type_table_offset;
+ guint32 type_table_start;
+
+ /*
+ * New in version 44.
+ */
+ guint32 num_misc_tables;
+ guint32 misc_table_chunk_size;
+ gpointer *misc_tables;
+ gpointer current_misc_table;
+ guint32 misc_table_size;
+ guint32 misc_table_offset;
+ guint32 misc_table_start;
+};
+
+struct _MonoDebuggerSymbolFile {
+ guint32 index;
+ MonoSymbolFile *symfile;
+ MonoImage *image;
+ const char *image_file;
+ guint32 class_entry_size;
+ /* Pointer to the malloced range table. */
+ guint32 locked;
+ guint32 generation;
+ MonoDebuggerRangeInfo *range_table;
+ guint32 range_entry_size;
+ guint32 num_range_entries;
+ /* Pointer to the class table. */
+ guint32 class_table_size;
+ MonoDebuggerClassTable *current_class_table;
+ MonoDebuggerClassTable *class_table_start;
+ /* Private. */
+ MonoDebuggerSymbolFilePriv *_priv;
+};
+
+struct _MonoDebuggerRangeInfo {
+ const guint8 *start_address;
+ const guint8 *end_address;
+ guint32 index;
+ gpointer dynamic_data;
+ guint32 dynamic_size;
+};
+
+struct _MonoDebuggerClassTable {
+ MonoDebuggerClassTable *next;
+ guint32 index, size;
+ MonoDebuggerClassInfo *data;
+};
+
+struct _MonoDebuggerClassInfo {
+ MonoClass *klass;
+ guint32 rank;
+ guint32 token;
+ guint32 type_info;
+};
+
+struct _MonoDebuggerClassEntry {
+ MonoDebuggerClassInfo *info;
+ guint32 type_reference;
+};
+
+enum {
+ MONO_DEBUGGER_MISC_ENTRY_TYPE_UNKNOWN = 0,
+ MONO_DEBUGGER_MISC_ENTRY_TYPE_WRAPPER
+};
+
+extern MonoDebuggerSymbolTable *mono_debugger_symbol_table;
+
+/*
+ * Address of the x86 trampoline code. This is used by the debugger to check
+ * whether a method is a trampoline.
+ */
+extern guint8 *mono_generic_trampoline_code;
+
+#ifndef PLATFORM_WIN32
+
+/*
+ * Functions we export to the debugger.
+ */
+struct _MonoDebuggerIOLayer
+{
+ void (*InitializeCriticalSection) (WapiCriticalSection *section);
+ void (*DeleteCriticalSection) (WapiCriticalSection *section);
+ gboolean (*TryEnterCriticalSection) (WapiCriticalSection *section);
+ void (*EnterCriticalSection) (WapiCriticalSection *section);
+ void (*LeaveCriticalSection) (WapiCriticalSection *section);
+
+ guint32 (*WaitForSingleObject) (gpointer handle, guint32 timeout,
+ gboolean alertable);
+ guint32 (*SignalObjectAndWait) (gpointer signal_handle, gpointer wait,
+ guint32 timeout, gboolean alertable);
+ guint32 (*WaitForMultipleObjects) (guint32 numobjects, gpointer *handles,
+ gboolean waitall, guint32 timeout, gboolean alertable);
+
+ gpointer (*CreateSemaphore) (WapiSecurityAttributes *security,
+ gint32 initial, gint32 max,
+ const gunichar2 *name);
+ gboolean (*ReleaseSemaphore) (gpointer handle, gint32 count, gint32 *prevcount);
+
+ gpointer (*CreateThread) (WapiSecurityAttributes *security,
+ guint32 stacksize, WapiThreadStart start,
+ gpointer param, guint32 create, guint32 *tid);
+ guint32 (*GetCurrentThreadId) (void);
+};
+
+extern MonoDebuggerIOLayer mono_debugger_io_layer;
+
+#endif
+
+extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, gpointer data, guint32 arg);
+
+void mono_debugger_initialize (void);
+void mono_debugger_cleanup (void);
+
+void mono_debugger_lock (void);
+void mono_debugger_unlock (void);
+void mono_debugger_event (MonoDebuggerEvent event, gpointer data, guint32 arg);
+
+MonoDebuggerSymbolFile *_mono_debugger_get_symfile (MonoImage *image);
+MonoDebuggerSymbolFile *mono_debugger_add_symbol_file (MonoDebugHandle *handle);
+void mono_debugger_start_add_type (MonoDebuggerSymbolFile *symfile,
+ MonoClass *klass);
+void mono_debugger_add_type (MonoDebuggerSymbolFile *symfile,
+ MonoClass *klass);
+MonoDebuggerBuiltinTypes *mono_debugger_add_builtin_types (MonoDebuggerSymbolFile *symfile);
+
+void mono_debugger_add_method (MonoDebuggerSymbolFile *symfile,
+ MonoDebugMethodInfo *minfo,
+ MonoDebugMethodJitInfo *jit);
+
+void mono_debugger_add_wrapper (MonoMethod *wrapper,
+ MonoDebugMethodJitInfo *jit,
+ gpointer addr);
+
+
+int mono_debugger_insert_breakpoint_full (MonoMethodDesc *desc);
+int mono_debugger_remove_breakpoint (int breakpoint_id);
+int mono_debugger_insert_breakpoint (const gchar *method_name, gboolean include_namespace);
+int mono_debugger_method_has_breakpoint (MonoMethod *method);
+void mono_debugger_breakpoint_callback (MonoMethod *method, guint32 idx);
+
+gpointer mono_debugger_create_notification_function (gpointer *notification_address);
+
+MonoObject *mono_debugger_runtime_invoke (MonoMethod *method, void *obj,
+ void **params, MonoObject **exc);
+
+guint32 mono_debugger_lookup_type (const gchar *type_name);
+gint32 mono_debugger_lookup_assembly (const gchar *name);
+gboolean mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject *exc);
+void mono_debugger_handle_exception (gpointer addr, gpointer stack, MonoObject *exc);
+gboolean mono_debugger_throw_exception (gpointer addr, gpointer stack, MonoObject *exc);
+
+
+
+void *
+mono_vtable_get_static_field_data (MonoVTable *vt);
+
+
+MonoReflectionMethod *
+ves_icall_MonoDebugger_GetMethod (MonoReflectionAssembly *assembly, guint32 token);
+
+int
+ves_icall_MonoDebugger_GetMethodToken (MonoReflectionAssembly *assembly, MonoReflectionMethod *method);
+
+MonoReflectionType *
+ves_icall_MonoDebugger_GetLocalTypeFromSignature (MonoReflectionAssembly *assembly, MonoArray *signature);
+
+MonoReflectionType *
+ves_icall_MonoDebugger_GetType (MonoReflectionAssembly *assembly, guint32 token);
+
+gchar *
+mono_debugger_check_runtime_version (const char *filename);
+
+#endif /* __MONO_DEBUG_DEBUGGER_H__ */
diff --git a/mono/metadata/mono-debug.c b/mono/metadata/mono-debug.c
new file mode 100644
index 00000000000..baa8ff2367b
--- /dev/null
+++ b/mono/metadata/mono-debug.c
@@ -0,0 +1,493 @@
+#include <config.h>
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/tokentype.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
+#include <mono/metadata/mono-endian.h>
+
+struct _MonoDebugHandlePriv
+{
+ MonoDebuggerSymbolFile *debugger_info;
+ MonoDebugDomainData *domain_table;
+};
+
+struct _MonoDebugDomainDataPriv
+{
+ GHashTable *wrapper_info;
+ MonoDebugDomainData *next;
+};
+
+MonoDebugFormat mono_debug_format = MONO_DEBUG_FORMAT_NONE;
+
+static gboolean in_the_mono_debugger = FALSE;
+static gboolean mono_debug_initialized = FALSE;
+GHashTable *mono_debug_handles = NULL;
+
+static MonoDebugHandle *mono_debug_open_image (MonoImage *image);
+static void mono_debug_close_image (MonoDebugHandle *debug);
+
+static MonoDebugHandle *_mono_debug_get_image (MonoImage *image);
+static void mono_debug_add_assembly (MonoAssembly *assembly,
+ gpointer user_data);
+static void mono_debug_start_add_type (MonoClass *klass);
+static void mono_debug_add_type (MonoClass *klass);
+static MonoDebugDomainData *mono_debug_get_domain_data (MonoDebugHandle *handle,
+ MonoDomain *domain);
+
+extern void (*mono_debugger_class_init_func) (MonoClass *klass);
+extern void (*mono_debugger_start_class_init_func) (MonoClass *klass);
+
+/*
+ * Initialize debugging support.
+ *
+ * This method must be called after loading corlib,
+ * but before opening the application's main assembly because we need to set some
+ * callbacks here.
+ */
+void
+mono_debug_init (MonoDebugFormat format)
+{
+ g_assert (!mono_debug_initialized);
+
+ mono_debug_initialized = TRUE;
+ mono_debug_format = format;
+ in_the_mono_debugger = format == MONO_DEBUG_FORMAT_DEBUGGER;
+
+ if (in_the_mono_debugger)
+ mono_debugger_initialize ();
+
+ mono_debugger_lock ();
+
+ mono_debug_handles = g_hash_table_new_full
+ (NULL, NULL, NULL, (GDestroyNotify) mono_debug_close_image);
+
+ mono_debugger_start_class_init_func = mono_debug_start_add_type;
+ mono_debugger_class_init_func = mono_debug_add_type;
+ mono_install_assembly_load_hook (mono_debug_add_assembly, NULL);
+}
+
+void
+mono_debug_init_1 (MonoDomain *domain)
+{
+ MonoDebugHandle *handle = mono_debug_open_image (mono_get_corlib ());
+
+ if (in_the_mono_debugger)
+ mono_debugger_add_builtin_types (handle->_priv->debugger_info);
+}
+
+/*
+ * Initialize debugging support - part 2.
+ *
+ * This method must be called after loading the application's main assembly.
+ */
+void
+mono_debug_init_2 (MonoAssembly *assembly)
+{
+ mono_debug_open_image (mono_assembly_get_image (assembly));
+}
+
+void
+mono_debug_cleanup (void)
+{
+ mono_debugger_cleanup ();
+
+ if (mono_debug_handles)
+ g_hash_table_destroy (mono_debug_handles);
+ mono_debug_handles = NULL;
+}
+
+static MonoDebugHandle *
+_mono_debug_get_image (MonoImage *image)
+{
+ return g_hash_table_lookup (mono_debug_handles, image);
+}
+
+static MonoDebugHandle *
+mono_debug_open_image (MonoImage *image)
+{
+ MonoDebugHandle *handle;
+
+ handle = _mono_debug_get_image (image);
+ if (handle != NULL)
+ return handle;
+
+ handle = g_new0 (MonoDebugHandle, 1);
+ handle->image = image;
+ mono_image_addref (image);
+ handle->image_file = g_strdup (mono_image_get_filename (image));
+ handle->_priv = g_new0 (MonoDebugHandlePriv, 1);
+
+ g_hash_table_insert (mono_debug_handles, image, handle);
+
+ if (mono_image_is_dynamic (image))
+ return handle;
+
+ handle->symfile = mono_debug_open_mono_symbol_file (handle, in_the_mono_debugger);
+ if (in_the_mono_debugger)
+ handle->_priv->debugger_info = mono_debugger_add_symbol_file (handle);
+
+ return handle;
+}
+
+static void
+mono_debug_close_image (MonoDebugHandle *handle)
+{
+ if (handle->symfile)
+ mono_debug_close_mono_symbol_file (handle->symfile);
+ /* decrease the refcount added with mono_image_addref () */
+ mono_image_close (handle->image);
+ /* FIXME: should also free handle->image_file? */
+ g_free (handle->_priv);
+ g_free (handle);
+}
+
+static void
+mono_debug_add_assembly (MonoAssembly *assembly, gpointer user_data)
+{
+ mono_debugger_lock ();
+ mono_debug_open_image (mono_assembly_get_image (assembly));
+ mono_debugger_unlock ();
+}
+
+/*
+ * This is called via the `mono_debugger_class_init_func' from mono_class_init() each time
+ * a new class is initialized.
+ */
+MonoDebuggerSymbolFile *
+_mono_debugger_get_symfile (MonoImage *image)
+{
+ MonoDebugHandle *handle = _mono_debug_get_image (image);
+ if (!handle)
+ return NULL;
+
+ return handle->_priv->debugger_info;
+}
+
+static void
+mono_debug_start_add_type (MonoClass *klass)
+{
+ MonoDebugHandle *handle;
+
+ handle = _mono_debug_get_image (klass->image);
+ if (!handle)
+ return;
+
+ if (handle->_priv->debugger_info)
+ mono_debugger_start_add_type (handle->_priv->debugger_info, klass);
+}
+
+static void
+mono_debug_add_type (MonoClass *klass)
+{
+ MonoDebugHandle *handle;
+
+ handle = _mono_debug_get_image (klass->image);
+ if (!handle)
+ return;
+
+ if (handle->_priv->debugger_info)
+ mono_debugger_add_type (handle->_priv->debugger_info, klass);
+}
+
+
+struct LookupMethodData
+{
+ MonoDebugMethodInfo *minfo;
+ MonoMethod *method;
+};
+
+static void
+lookup_method_func (gpointer key, gpointer value, gpointer user_data)
+{
+ MonoDebugHandle *handle = (MonoDebugHandle *) value;
+ struct LookupMethodData *data = (struct LookupMethodData *) user_data;
+
+ if (data->minfo)
+ return;
+
+ if (handle->symfile)
+ data->minfo = mono_debug_find_method (handle, data->method);
+}
+
+static MonoDebugMethodInfo *
+_mono_debug_lookup_method (MonoMethod *method)
+{
+ struct LookupMethodData data;
+
+ data.minfo = NULL;
+ data.method = method;
+
+ if (!mono_debug_handles)
+ return NULL;
+
+ g_hash_table_foreach (mono_debug_handles, lookup_method_func, &data);
+ return data.minfo;
+}
+
+/*
+ * This is called by the JIT to tell the debugging code about a newly compiled
+ * wrapper method.
+ */
+void
+mono_debug_add_wrapper (MonoMethod *method, gpointer wrapper, MonoDomain *domain)
+{
+ MonoClass *klass = method->klass;
+ MonoDebugDomainData *domain_data;
+ MonoDebugHandle *handle;
+ MonoDebugMethodJitInfo *jit;
+
+ mono_debugger_lock ();
+
+ mono_class_init (klass);
+
+ handle = _mono_debug_get_image (klass->image);
+ if (!handle || !handle->symfile || !handle->symfile->offset_table) {
+ mono_debugger_unlock ();
+ return;
+ }
+
+ domain_data = mono_debug_get_domain_data (handle, domain);
+ jit = g_hash_table_lookup (domain_data->_priv->wrapper_info, method);
+ g_assert (jit);
+
+ mono_debugger_add_wrapper (method, jit, wrapper);
+
+ mono_debugger_unlock ();
+}
+
+/*
+ * This is called by the JIT to tell the debugging code about a newly
+ * compiled method.
+ */
+void
+mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain)
+{
+ MonoClass *klass = method->klass;
+ MonoDebugDomainData *domain_data;
+ MonoDebugHandle *handle;
+ MonoDebugMethodInfo *minfo;
+
+ mono_debugger_lock ();
+
+ mono_class_init (klass);
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->flags & METHOD_ATTRIBUTE_ABSTRACT)) {
+ mono_debugger_unlock ();
+ return;
+ }
+
+ handle = _mono_debug_get_image (klass->image);
+ if (!handle || !handle->symfile || !handle->symfile->offset_table) {
+ mono_debugger_unlock ();
+ return;
+ }
+
+ domain_data = mono_debug_get_domain_data (handle, domain);
+ if (method->wrapper_type != MONO_WRAPPER_NONE) {
+ g_hash_table_insert (domain_data->_priv->wrapper_info, method, jit);
+ mono_debugger_unlock ();
+ return;
+ }
+
+ minfo = _mono_debug_lookup_method (method);
+ if (!minfo) {
+ mono_debugger_unlock ();
+ return;
+ }
+
+ if (domain_data->jit [minfo->index]) {
+ /* FIXME FIXME FIXME
+ // This is bug #48591.
+ */
+ mono_debugger_unlock ();
+ return;
+ }
+
+ domain_data->jit [minfo->index] = jit;
+
+ if (handle->_priv->debugger_info && (domain == mono_get_root_domain ()))
+ mono_debugger_add_method (handle->_priv->debugger_info, minfo, jit);
+
+ mono_debugger_unlock ();
+}
+
+static gint32
+il_offset_from_address (MonoDebugMethodJitInfo *jit, guint32 address)
+{
+ int i;
+
+ if (!jit || !jit->line_numbers)
+ return -1;
+
+ for (i = jit->line_numbers->len - 1; i >= 0; i--) {
+ MonoDebugLineNumberEntry lne = g_array_index (
+ jit->line_numbers, MonoDebugLineNumberEntry, i);
+
+ if (lne.address <= address)
+ return lne.offset;
+ }
+
+ return -1;
+}
+
+/*
+ * Used by the exception code to get a source location from a machine address.
+ *
+ * Returns a textual representation of the specified address which is suitable to be displayed to
+ * the user (for instance "/home/martin/monocvs/debugger/test/Y.cs:8").
+ *
+ * If the optional @line_number argument is not NULL, the line number is stored there and just the
+ * source file is returned (ie. it'd return "/home/martin/monocvs/debugger/test/Y.cs" and store the
+ * line number 8 in the variable pointed to by @line_number).
+ */
+gchar *
+mono_debug_source_location_from_address (MonoMethod *method, guint32 address, guint32 *line_number,
+ MonoDomain *domain)
+{
+ MonoDebugMethodInfo *minfo;
+ MonoDebugDomainData *domain_data;
+
+ mono_loader_lock ();
+ minfo = _mono_debug_lookup_method (method);
+ if (!minfo || !minfo->handle || !minfo->handle->symfile ||
+ !minfo->handle->symfile->offset_table) {
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ domain_data = mono_debug_get_domain_data (minfo->handle, domain);
+ if (!domain_data->jit [minfo->index]) {
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ if (minfo->handle && minfo->handle->symfile) {
+ gint32 offset = il_offset_from_address (domain_data->jit [minfo->index], address);
+ char *res = NULL;
+
+ if (offset >= 0)
+ res = mono_debug_find_source_location (minfo->handle->symfile, method, offset, line_number);
+ mono_loader_unlock ();
+ return res;
+ }
+
+ mono_loader_unlock ();
+ return NULL;
+}
+
+/*
+ * Used by the exception code to get a source location from an IL offset.
+ *
+ * Returns a textual representation of the specified address which is suitable to be displayed to
+ * the user (for instance "/home/martin/monocvs/debugger/test/Y.cs:8").
+ *
+ * If the optional @line_number argument is not NULL, the line number is stored there and just the
+ * source file is returned (ie. it'd return "/home/martin/monocvs/debugger/test/Y.cs" and store the
+ * line number 8 in the variable pointed to by @line_number).
+ */
+gchar *
+mono_debug_source_location_from_il_offset (MonoMethod *method, guint32 offset, guint32 *line_number)
+{
+ char *res;
+ MonoDebugMethodInfo *minfo;
+
+ mono_loader_lock ();
+ minfo = _mono_debug_lookup_method (method);
+ if (!minfo || !minfo->handle || !minfo->handle->symfile) {
+ mono_loader_unlock ();
+ return NULL;
+ }
+
+ res = mono_debug_find_source_location (minfo->handle->symfile, method, offset, line_number);
+ mono_loader_unlock ();
+ return res;
+}
+
+/*
+ * Returns the IL offset corresponding to machine address @address which is an offset
+ * relative to the beginning of the method @method.
+ */
+gint32
+mono_debug_il_offset_from_address (MonoMethod *method, gint32 address, MonoDomain *domain)
+{
+ MonoDebugMethodInfo *minfo;
+ MonoDebugDomainData *domain_data;
+ gint32 res;
+
+ if (address < 0)
+ return -1;
+
+ mono_loader_lock ();
+ minfo = _mono_debug_lookup_method (method);
+ if (!minfo || !minfo->il_offsets || !minfo->handle || !minfo->handle->symfile ||
+ !minfo->handle->symfile->offset_table) {
+ mono_loader_unlock ();
+ return -1;
+ }
+
+ domain_data = mono_debug_get_domain_data (minfo->handle, domain);
+
+ res = il_offset_from_address (domain_data->jit [minfo->index], address);
+ mono_loader_unlock ();
+ return res;
+}
+
+/*
+ * Returns the machine address corresponding to IL offset @il_offset.
+ * The returned value is an offset relative to the beginning of the method @method.
+ */
+gint32
+mono_debug_address_from_il_offset (MonoMethod *method, gint32 il_offset, MonoDomain *domain)
+{
+ MonoDebugMethodInfo *minfo;
+ MonoDebugDomainData *domain_data;
+ gint32 res;
+
+ if (il_offset < 0)
+ return -1;
+
+ mono_loader_lock ();
+ minfo = _mono_debug_lookup_method (method);
+ if (!minfo || !minfo->il_offsets || !minfo->handle || !minfo->handle->symfile ||
+ !minfo->handle->symfile->offset_table) {
+ mono_loader_unlock ();
+ return -1;
+ }
+
+ domain_data = mono_debug_get_domain_data (minfo->handle, domain);
+
+ res = _mono_debug_address_from_il_offset (domain_data->jit [minfo->index], il_offset);
+ mono_loader_unlock ();
+ return res;
+}
+
+static MonoDebugDomainData *
+mono_debug_get_domain_data (MonoDebugHandle *handle, MonoDomain *domain)
+{
+ MonoDebugDomainData *data;
+ int domain_id = mono_domain_get_id (domain);
+
+ /* We checked this earlier. */
+ g_assert (handle->symfile);
+
+ for (data = handle->_priv->domain_table; data; data = data->_priv->next)
+ if (data->domain_id == domain_id)
+ return data;
+
+ data = g_new0 (MonoDebugDomainData, 1);
+ data->domain_id = domain_id;
+ data->jit = g_new0 (MonoDebugMethodJitInfo *, read32(&(handle->symfile->offset_table->_method_count)) + 1);
+
+ data->_priv = g_new0 (MonoDebugDomainDataPriv, 1);
+ data->_priv->next = handle->_priv->domain_table;
+ data->_priv->wrapper_info = g_hash_table_new (g_direct_hash, g_direct_equal);
+ handle->_priv->domain_table = data;
+
+ return data;
+}
diff --git a/mono/metadata/mono-debug.h b/mono/metadata/mono-debug.h
new file mode 100644
index 00000000000..2bfca3d9161
--- /dev/null
+++ b/mono/metadata/mono-debug.h
@@ -0,0 +1,103 @@
+/*
+ * This header is only installed for use by the debugger:
+ * the structures and the API declared here are not supported.
+ */
+
+#ifndef __MONO_DEBUG_H__
+#define __MONO_DEBUG_H__
+
+#include <glib.h>
+#include <mono/metadata/image.h>
+#include <mono/metadata/appdomain.h>
+
+typedef struct _MonoSymbolFile MonoSymbolFile;
+typedef struct _MonoSymbolFilePriv MonoSymbolFilePriv;
+
+typedef struct _MonoDebugHandle MonoDebugHandle;
+typedef struct _MonoDebugHandlePriv MonoDebugHandlePriv;
+typedef struct _MonoDebugDomainData MonoDebugDomainData;
+typedef struct _MonoDebugDomainDataPriv MonoDebugDomainDataPriv;
+
+typedef struct _MonoDebugVarInfo MonoDebugVarInfo;
+typedef struct _MonoDebugMethodJitInfo MonoDebugMethodJitInfo;
+
+typedef enum {
+ MONO_DEBUG_FORMAT_NONE,
+ MONO_DEBUG_FORMAT_MONO,
+ MONO_DEBUG_FORMAT_DEBUGGER
+} MonoDebugFormat;
+
+struct _MonoDebugHandle {
+ const char *image_file;
+ MonoImage *image;
+ MonoSymbolFile *symfile;
+ MonoDebugHandlePriv *_priv;
+};
+
+struct _MonoDebugMethodJitInfo {
+ const guint8 *code_start;
+ guint32 code_size;
+ guint32 prologue_end;
+ guint32 epilogue_begin;
+ const guint8 *wrapper_addr;
+ /* Array of MonoDebugLineNumberEntry */
+ GArray *line_numbers;
+ guint32 num_params;
+ MonoDebugVarInfo *this_var;
+ MonoDebugVarInfo *params;
+ guint32 num_locals;
+ MonoDebugVarInfo *locals;
+};
+
+struct _MonoDebugDomainData {
+ guint32 domain_id;
+ MonoDebugMethodJitInfo **jit;
+ MonoDebugDomainDataPriv *_priv;
+};
+
+/*
+ * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
+ * where the variable is actually stored.
+ *
+ * See relocate_variable() in debug-symfile.c for more info.
+ */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS 0xf0000000
+
+/* The variable is in register "index". */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER 0
+
+/* The variable is at offset "offset" from register "index". */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET 0x10000000
+
+/* The variable is in the two registers "offset" and "index". */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS 0x20000000
+
+struct _MonoDebugVarInfo {
+ guint32 index;
+ guint32 offset;
+ guint32 size;
+ guint32 begin_scope;
+ guint32 end_scope;
+};
+
+#define MONO_DEBUGGER_VERSION 46
+#define MONO_DEBUGGER_MAGIC 0x7aff65af4253d427ULL
+
+extern MonoDebugFormat mono_debug_format;
+extern GHashTable *mono_debug_handles;
+
+void mono_debug_init (MonoDebugFormat format);
+void mono_debug_init_1 (MonoDomain *domain);
+void mono_debug_init_2 (MonoAssembly *assembly);
+void mono_debug_cleanup (void);
+void mono_debug_add_wrapper (MonoMethod *method, gpointer wrapper, MonoDomain *domain);
+
+void mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain);
+gchar *mono_debug_source_location_from_address (MonoMethod *method, guint32 address,
+ guint32 *line_number, MonoDomain *domain);
+gchar *mono_debug_source_location_from_il_offset (MonoMethod *method, guint32 offset,
+ guint32 *line_number);
+gint32 mono_debug_il_offset_from_address (MonoMethod *method, gint32 address, MonoDomain *domain);
+gint32 mono_debug_address_from_il_offset (MonoMethod *method, gint32 il_offset, MonoDomain *domain);
+
+#endif /* __MONO_DEBUG_H__ */
diff --git a/mono/metadata/mono-endian.c b/mono/metadata/mono-endian.c
index 0cd01f2fc5c..612e21df4ad 100644
--- a/mono/metadata/mono-endian.c
+++ b/mono/metadata/mono-endian.c
@@ -1,3 +1,4 @@
+#include <config.h>
#include "mono-endian.h"
#if NO_UNALIGNED_ACCESS
diff --git a/mono/metadata/mono-endian.h b/mono/metadata/mono-endian.h
index c371250f91b..6cee6415259 100644
--- a/mono/metadata/mono-endian.h
+++ b/mono/metadata/mono-endian.h
@@ -11,17 +11,31 @@ typedef union {
typedef union {
guint64 ival;
double fval;
+ unsigned char cval [8];
} mono_rdouble;
+#ifdef ARM_FPU_FPA
+#define MONO_DOUBLE_ASSERT_ENDIANITY(dbl_ptr) \
+ do { \
+ mono_rdouble r; \
+ r.fval = *dbl_ptr; \
+ r.ival = (guint64) *((guint32 *) r.cval) << 32 | \
+ *((guint32 *) (r.cval + 4)); \
+ *dbl_ptr = r.fval; \
+ } while (0)
+#else
+#define MONO_DOUBLE_ASSERT_ENDIANITY(dbl_ptr)
+#endif
+
#if NO_UNALIGNED_ACCESS
guint16 mono_read16 (const unsigned char *x);
guint32 mono_read32 (const unsigned char *x);
guint64 mono_read64 (const unsigned char *x);
-#define read16(x) (mono_read16 ((x)))
-#define read32(x) (mono_read32 ((x)))
-#define read64(x) (mono_read64 ((x)))
+#define read16(x) (mono_read16 ((const unsigned char *)(x)))
+#define read32(x) (mono_read32 ((const unsigned char *)(x)))
+#define read64(x) (mono_read64 ((const unsigned char *)(x)))
#else
@@ -42,6 +56,7 @@ guint64 mono_read64 (const unsigned char *x);
do { \
mono_rdouble mf; \
mf.ival = read64 ((x)); \
+ MONO_DOUBLE_ASSERT_ENDIANITY (&mf.fval); \
*(dest) = mf.fval; \
} while (0)
diff --git a/mono/metadata/monosn.c b/mono/metadata/monosn.c
new file mode 100644
index 00000000000..a4aeea3fe41
--- /dev/null
+++ b/mono/metadata/monosn.c
@@ -0,0 +1,551 @@
+/*
+ * monosn.c: Mono String Name Utility
+ *
+ * Author:
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ *
+ */
+#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_raw_buffer_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;
+}
+
diff --git a/mono/metadata/object-internals.h b/mono/metadata/object-internals.h
new file mode 100644
index 00000000000..d4f0e06b9e2
--- /dev/null
+++ b/mono/metadata/object-internals.h
@@ -0,0 +1,966 @@
+#ifndef __MONO_OBJECT_INTERNALS_H__
+#define __MONO_OBJECT_INTERNALS_H__
+
+#include <mono/metadata/object.h>
+#include <mono/metadata/reflection.h>
+#include <mono/io-layer/io-layer.h>
+
+#if 1
+#ifdef __GNUC__
+#define mono_assert(expr) G_STMT_START{ \
+ if (!(expr)) \
+ { \
+ MonoException *ex; \
+ char *msg = g_strdup_printf ("file %s: line %d (%s): " \
+ "assertion failed: (%s)", __FILE__, __LINE__, \
+ __PRETTY_FUNCTION__, #expr); \
+ ex = mono_get_exception_execution_engine (msg); \
+ g_free (msg); \
+ mono_raise_exception (ex); \
+ }; }G_STMT_END
+
+#define mono_assert_not_reached() G_STMT_START{ \
+ MonoException *ex; \
+ char *msg = g_strdup_printf ("file %s: line %d (%s): " \
+ "should not be reached", __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+ ex = mono_get_exception_execution_engine (msg); \
+ g_free (msg); \
+ mono_raise_exception (ex); \
+}G_STMT_END
+#else /* not GNUC */
+#define mono_assert(expr) G_STMT_START{ \
+ if (!(expr)) \
+ { \
+ MonoException *ex; \
+ char *msg = g_strdup_printf ("file %s: line %d: " \
+ "assertion failed: (%s)", __FILE__, __LINE__, \
+ #expr); \
+ ex = mono_get_exception_execution_engine (msg); \
+ g_free (msg); \
+ mono_raise_exception (ex); \
+ }; }G_STMT_END
+
+#define mono_assert_not_reached() G_STMT_START{ \
+ MonoException *ex; \
+ char *msg = g_strdup_printf ("file %s: line %d): " \
+ "should not be reached", __FILE__, __LINE__); \
+ ex = mono_get_exception_execution_engine (msg); \
+ g_free (msg); \
+ mono_raise_exception (ex); \
+}G_STMT_END
+#endif
+#else
+#define mono_assert(expr) g_assert(expr)
+#define mono_assert_not_reached() g_assert_not_reached()
+#endif
+
+#define MONO_CHECK_ARG(arg, expr) G_STMT_START{ \
+ if (!(expr)) \
+ { \
+ MonoException *ex; \
+ char *msg = g_strdup_printf ("assertion `%s' failed", \
+ #expr); \
+ if (arg) {} /* check if the name exists */ \
+ ex = mono_get_exception_argument (#arg, msg); \
+ g_free (msg); \
+ mono_raise_exception (ex); \
+ }; }G_STMT_END
+
+#define MONO_CHECK_ARG_NULL(arg) G_STMT_START{ \
+ if (arg == NULL) \
+ { \
+ MonoException *ex; \
+ if (arg) {} /* check if the name exists */ \
+ ex = mono_get_exception_argument_null (#arg); \
+ mono_raise_exception (ex); \
+ }; }G_STMT_END
+
+
+#define mono_stringbuilder_capacity(sb) ((sb)->str->length)
+
+typedef struct {
+ MonoObject obj;
+ MonoObject *identity;
+} MonoMarshalByRefObject;
+
+/* This is a copy of System.AppDomain */
+struct _MonoAppDomain {
+ MonoMarshalByRefObject mbr;
+ MonoDomain *data;
+};
+
+typedef struct {
+ MonoObject object;
+ gint32 length;
+ MonoString *str;
+} MonoStringBuilder;
+
+typedef struct {
+ MonoType *type;
+ gpointer value;
+ MonoClass *klass;
+} MonoTypedRef;
+
+typedef struct {
+ gpointer args;
+} MonoArgumentHandle;
+
+typedef struct {
+ MonoMethodSignature *sig;
+ gpointer args;
+ gint32 next_arg;
+ gint32 num_args;
+} MonoArgIterator;
+
+struct _MonoException {
+ MonoObject object;
+ MonoArray *trace_ips;
+ MonoObject *inner_ex;
+ MonoString *message;
+ MonoString *help_link;
+ MonoString *class_name;
+ MonoString *stack_trace;
+ MonoString *remote_stack_trace;
+ gint32 remote_stack_index;
+ gint32 hresult;
+ MonoString *source;
+};
+
+typedef struct {
+ MonoException base;
+} MonoSystemException;
+
+typedef struct {
+ MonoSystemException base;
+ MonoString *param_name;
+} MonoArgumentException;
+
+typedef struct {
+ MonoSystemException base;
+ MonoString *msg;
+ MonoString *type_name;
+} MonoTypeLoadException;
+
+typedef struct {
+ MonoObject object;
+ MonoObject *async_state;
+ MonoObject *handle;
+ MonoObject *async_delegate;
+ gpointer data;
+ MonoBoolean sync_completed;
+ MonoBoolean completed;
+ MonoBoolean endinvoke_called;
+ MonoObject *async_callback;
+} MonoAsyncResult;
+
+typedef struct {
+ MonoMarshalByRefObject object;
+ gpointer handle;
+ MonoBoolean disposed;
+} MonoWaitHandle;
+
+/* This is a copy of System.Runtime.Remoting.Messaging.CallType */
+typedef enum {
+ CallType_Sync = 0,
+ CallType_BeginInvoke = 1,
+ CallType_EndInvoke = 2,
+ CallType_OneWay = 3
+} MonoCallType;
+
+struct _MonoReflectionType {
+ MonoObject object;
+ MonoType *type;
+};
+
+typedef struct {
+ MonoObject object;
+ MonoReflectionType *class_to_proxy;
+ MonoObject *context;
+ MonoObject *unwrapped_server;
+} MonoRealProxy;
+
+typedef struct {
+ MonoObject object;
+ MonoRealProxy *rp;
+ MonoRemoteClass *remote_class;
+ MonoBoolean custom_type_info;
+} MonoTransparentProxy;
+
+typedef struct {
+ MonoObject obj;
+ MonoReflectionMethod *method;
+ MonoArray *args;
+ MonoArray *names;
+ MonoArray *arg_types;
+ MonoObject *ctx;
+ MonoObject *rval;
+ MonoObject *exc;
+ MonoAsyncResult *async_result;
+ guint32 call_type;
+} MonoMethodMessage;
+
+typedef struct {
+ MonoObject obj;
+ gint32 il_offset;
+ gint32 native_offset;
+ MonoReflectionMethod *method;
+ MonoString *filename;
+ gint32 line;
+ gint32 column;
+} MonoStackFrame;
+
+struct _MonoThread {
+ MonoObject obj;
+ HANDLE handle;
+ MonoObject *culture_info;
+ MonoObject *ui_culture_info;
+ MonoBoolean threadpool_thread;
+ gunichar2 *name;
+ guint32 name_len;
+ guint32 state;
+ MonoException *abort_exc;
+ MonoObject *abort_state;
+ guint32 tid;
+ HANDLE start_notify;
+ gpointer stack_ptr;
+ gpointer *static_data;
+ gpointer jit_data;
+ gpointer lock_data;
+ GSList *appdomain_refs;
+ MonoBoolean interruption_requested;
+ gpointer suspend_event;
+ gpointer resume_event;
+ MonoObject *synch_lock;
+ gboolean unmanaged;
+};
+
+typedef struct {
+ MonoString *name;
+ MonoReflectionType *type;
+ MonoObject *value;
+} MonoSerializationEntry;
+
+typedef struct {
+ guint32 state;
+ MonoObject *additional;
+} MonoStreamingContext;
+
+typedef struct {
+ MonoObject obj;
+ MonoBoolean readOnly;
+ MonoString *AMDesignator;
+ MonoString *PMDesignator;
+ MonoString *DateSeparator;
+ MonoString *TimeSeparator;
+ MonoString *ShortDatePattern;
+ MonoString *LongDatePattern;
+ MonoString *ShortTimePattern;
+ MonoString *LongTimePattern;
+ MonoString *MonthDayPattern;
+ MonoString *YearMonthPattern;
+ MonoString *FullDateTimePattern;
+ MonoString *RFC1123Pattern;
+ MonoString *SortableDateTimePattern;
+ MonoString *UniversalSortableDateTimePattern;
+ guint32 FirstDayOfWeek;
+ MonoObject *Calendar;
+ guint32 CalendarWeekRule;
+ MonoArray *AbbreviatedDayNames;
+ MonoArray *DayNames;
+ MonoArray *MonthNames;
+ MonoArray *AbbreviatedMonthNames;
+ MonoArray *ShortDatePatterns;
+ MonoArray *LongDatePatterns;
+ MonoArray *ShortTimePatterns;
+ MonoArray *LongTimePatterns;
+} MonoDateTimeFormatInfo;
+
+typedef struct
+{
+ MonoObject obj;
+ MonoBoolean readOnly;
+ MonoString *decimalFormats;
+ MonoString *currencyFormats;
+ MonoString *percentFormats;
+ MonoString *digitPattern;
+ MonoString *zeroPattern;
+ gint32 currencyDecimalDigits;
+ MonoString *currencyDecimalSeparator;
+ MonoString *currencyGroupSeparator;
+ MonoArray *currencyGroupSizes;
+ gint32 currencyNegativePattern;
+ gint32 currencyPositivePattern;
+ MonoString *currencySymbol;
+ MonoString *naNSymbol;
+ MonoString *negativeInfinitySymbol;
+ MonoString *negativeSign;
+ guint32 numberDecimalDigits;
+ MonoString *numberDecimalSeparator;
+ MonoString *numberGroupSeparator;
+ MonoArray *numberGroupSizes;
+ gint32 numberNegativePattern;
+ gint32 percentDecimalDigits;
+ MonoString *percentDecimalSeparator;
+ MonoString *percentGroupSeparator;
+ MonoArray *percentGroupSizes;
+ gint32 percentNegativePattern;
+ gint32 percentPositivePattern;
+ MonoString *percentSymbol;
+ MonoString *perMilleSymbol;
+ MonoString *positiveInfinitySymbol;
+ MonoString *positiveSign;
+} MonoNumberFormatInfo;
+
+typedef struct {
+ MonoObject obj;
+ gint32 lcid;
+ MonoString *icu_name;
+ gpointer ICU_collator;
+} MonoCompareInfo;
+
+typedef struct {
+ MonoObject obj;
+ MonoBoolean is_read_only;
+ gint32 lcid;
+ gint32 parent_lcid;
+ gint32 specific_lcid;
+ gint32 datetime_index;
+ gint32 number_index;
+ MonoBoolean use_user_override;
+ MonoNumberFormatInfo *number_format;
+ MonoDateTimeFormatInfo *datetime_format;
+ MonoObject *textinfo;
+ MonoString *name;
+ MonoString *displayname;
+ MonoString *englishname;
+ MonoString *nativename;
+ MonoString *iso3lang;
+ MonoString *iso2lang;
+ MonoString *icu_name;
+ MonoString *win3lang;
+ MonoCompareInfo *compareinfo;
+ const gint32 *calendar_data;
+} MonoCultureInfo;
+
+typedef struct {
+ MonoObject obj;
+ MonoString *str;
+ gint32 options;
+ MonoArray *key;
+ gint32 lcid;
+} MonoSortKey;
+
+/* remoting and async support */
+
+MonoAsyncResult *
+mono_async_result_new (MonoDomain *domain, HANDLE handle,
+ MonoObject *state, gpointer data);
+
+MonoWaitHandle *
+mono_wait_handle_new (MonoDomain *domain, HANDLE handle);
+
+void
+mono_message_init (MonoDomain *domain, MonoMethodMessage *this_obj,
+ MonoReflectionMethod *method, MonoArray *out_args);
+
+MonoObject *
+mono_remoting_invoke (MonoObject *real_proxy, MonoMethodMessage *msg,
+ MonoObject **exc, MonoArray **out_args);
+
+MonoObject *
+mono_message_invoke (MonoObject *target, MonoMethodMessage *msg,
+ MonoObject **exc, MonoArray **out_args);
+
+MonoMethodMessage *
+mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *invoke,
+ MonoDelegate **cb, MonoObject **state);
+
+void
+mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoArray *out_args);
+
+void
+mono_delegate_ctor (MonoObject *this_obj, MonoObject *target, gpointer addr);
+
+/* runtime initialization functions */
+typedef void (*MonoExceptionFunc) (MonoException *ex);
+
+void
+mono_install_handler (MonoExceptionFunc func);
+
+void
+mono_install_runtime_invoke (MonoInvokeFunc func);
+
+void
+mono_install_compile_method (MonoCompileFunc func);
+
+void
+mono_install_free_method (MonoFreeMethodFunc func);
+
+void
+mono_type_initialization_init (void);
+
+/* Reflection and Reflection.Emit support */
+
+/*
+ * The following structure must match the C# implementation in our corlib.
+ */
+
+struct _MonoReflectionMethod {
+ MonoObject object;
+ MonoMethod *method;
+ MonoString *name;
+ MonoReflectionType *reftype;
+};
+
+struct _MonoDelegate {
+ MonoObject object;
+ MonoObject *target_type;
+ MonoObject *target;
+ MonoString *method_name;
+ gpointer method_ptr;
+ gpointer delegate_trampoline;
+ MonoReflectionMethod *method_info;
+};
+
+typedef struct _MonoMulticastDelegate MonoMulticastDelegate;
+struct _MonoMulticastDelegate {
+ MonoDelegate delegate;
+ MonoMulticastDelegate *prev;
+};
+
+struct _MonoReflectionField {
+ MonoObject object;
+ MonoClass *klass;
+ MonoClassField *field;
+ MonoString *name;
+ MonoReflectionType *type;
+ guint32 attrs;
+};
+
+struct _MonoReflectionProperty {
+ MonoObject object;
+ MonoClass *klass;
+ MonoProperty *property;
+};
+
+struct _MonoReflectionEvent {
+ MonoObject object;
+ MonoClass *klass;
+ MonoEvent *event;
+};
+
+typedef struct {
+ MonoObject object;
+ MonoReflectionType *ClassImpl;
+ MonoObject *DefaultValueImpl;
+ MonoObject *MemberImpl;
+ MonoString *NameImpl;
+ gint32 PositionImpl;
+ guint32 AttrsImpl;
+ MonoObject *MarshalAsImpl;
+} MonoReflectionParameter;
+
+struct _MonoReflectionMethodBody {
+ MonoObject object;
+ MonoArray *clauses;
+ MonoArray *locals;
+ MonoArray *il;
+ MonoBoolean init_locals;
+ guint32 sig_token;
+ guint32 max_stack;
+};
+
+struct _MonoReflectionAssembly {
+ MonoObject object;
+ MonoAssembly *assembly;
+ MonoObject *resolve_event_holder;
+ /* CAS related */
+ MonoObject *evidence; /* Evidence */
+ MonoObject *minimum; /* PermissionSet - for SecurityAction.RequestMinimum */
+ MonoObject *optional; /* PermissionSet - for SecurityAction.RequestOptional */
+ MonoObject *refuse; /* PermissionSet - for SecurityAction.RequestRefuse */
+ MonoObject *granted; /* PermissionSet - for the resolved assembly granted permissions */
+ MonoObject *denied; /* PermissionSet - for the resolved assembly denied permissions */
+};
+
+typedef struct {
+ MonoReflectionType *utype;
+ MonoArray *values;
+ MonoArray *names;
+} MonoEnumInfo;
+
+typedef struct {
+ MonoReflectionType *parent;
+ MonoReflectionType *ret;
+ guint32 attrs;
+ guint32 implattrs;
+ guint32 callconv;
+} MonoMethodInfo;
+
+typedef struct {
+ MonoReflectionType *parent;
+ MonoString *name;
+ MonoReflectionMethod *get;
+ MonoReflectionMethod *set;
+ guint32 attrs;
+} MonoPropertyInfo;
+
+typedef struct {
+ MonoReflectionType *declaring_type;
+ MonoReflectionType *reflected_type;
+ MonoString *name;
+ MonoReflectionMethod *add_method;
+ MonoReflectionMethod *remove_method;
+ MonoReflectionMethod *raise_method;
+ guint32 attrs;
+ MonoArray *other_methods;
+} MonoEventInfo;
+
+typedef struct {
+ MonoString *name;
+ MonoString *name_space;
+ MonoReflectionType *etype;
+ MonoReflectionType *nested_in;
+ MonoReflectionAssembly *assembly;
+ guint32 rank;
+ MonoBoolean isprimitive;
+} MonoTypeInfo;
+
+typedef struct {
+ MonoObject *member;
+ gint32 code_pos;
+} MonoReflectionILTokenInfo;
+
+typedef struct {
+ MonoObject object;
+ MonoArray *code;
+ gint32 code_len;
+ gint32 max_stack;
+ gint32 cur_stack;
+ MonoArray *locals;
+ MonoArray *ex_handlers;
+ gint32 num_token_fixups;
+ MonoArray *token_fixups;
+} MonoReflectionILGen;
+
+typedef struct {
+ MonoArray *handlers;
+ gint32 start;
+ gint32 len;
+ gint32 label;
+} MonoILExceptionInfo;
+
+typedef struct {
+ MonoReflectionType *extype;
+ gint32 type;
+ gint32 start;
+ gint32 len;
+ gint32 filter_offset;
+} MonoILExceptionBlock;
+
+typedef struct {
+ MonoObject object;
+ MonoReflectionType *local_type;
+ MonoBoolean is_pinned;
+ int local_index;
+} MonoReflectionLocalVariableInfo;
+
+typedef struct {
+ /*
+ * Must have the same layout as MonoReflectionLocalVariableInfo, since
+ * LocalBuilder inherits from it under net 2.0.
+ */
+ MonoObject object;
+ MonoReflectionType *type;
+ MonoBoolean is_pinned;
+ guint16 local_index;
+ MonoString *name;
+} MonoReflectionLocalBuilder;
+
+typedef struct {
+ MonoObject object;
+ gint32 count;
+ gint32 type;
+ gint32 eltype;
+ MonoString *guid;
+ MonoString *mcookie;
+ MonoString *marshaltype;
+ MonoReflectionType *marshaltyperef;
+} MonoReflectionMarshal;
+
+typedef struct {
+ MonoObject object;
+ MonoObject* methodb;
+ MonoString *name;
+ MonoArray *cattrs;
+ MonoReflectionMarshal *marshal_info;
+ guint32 attrs;
+ int position;
+ guint32 table_idx;
+ MonoObject *def_value;
+} MonoReflectionParamBuilder;
+
+typedef struct {
+ MonoObject object;
+ MonoMethod *mhandle;
+ MonoReflectionILGen *ilgen;
+ MonoArray *parameters;
+ guint32 attrs;
+ guint32 iattrs;
+ guint32 table_idx;
+ guint32 call_conv;
+ MonoObject *type;
+ MonoArray *pinfo;
+ MonoArray *cattrs;
+ MonoBoolean init_locals;
+ MonoArray *param_modreq;
+ MonoArray *param_modopt;
+ MonoArray *permissions;
+} MonoReflectionCtorBuilder;
+
+typedef struct {
+ MonoObject object;
+ MonoMethod *mhandle;
+ MonoReflectionType *rtype;
+ MonoArray *parameters;
+ guint32 attrs;
+ guint32 iattrs;
+ MonoString *name;
+ guint32 table_idx;
+ MonoArray *code;
+ MonoReflectionILGen *ilgen;
+ MonoObject *type;
+ MonoArray *pinfo;
+ MonoArray *cattrs;
+ MonoReflectionMethod *override_method;
+ MonoString *dll;
+ MonoString *dllentry;
+ guint32 charset;
+ guint32 native_cc;
+ guint32 call_conv;
+ MonoBoolean init_locals;
+ MonoGenericContainer *generic_container;
+ MonoArray *generic_params;
+ MonoArray *return_modreq;
+ MonoArray *return_modopt;
+ MonoArray *param_modreq;
+ MonoArray *param_modopt;
+ MonoArray *permissions;
+} MonoReflectionMethodBuilder;
+
+typedef struct {
+ MonoObject object;
+ MonoMethod *mhandle;
+ MonoReflectionType *parent;
+ MonoReflectionType *ret;
+ MonoArray *parameters;
+ MonoString *name;
+ guint32 table_idx;
+ guint32 call_conv;
+} MonoReflectionArrayMethod;
+
+typedef struct {
+ MonoArray *data;
+ MonoString *name;
+ MonoString *filename;
+ guint32 attrs;
+ guint32 offset;
+} MonoReflectionResource;
+
+typedef struct {
+ guint32 res_type;
+ guint32 res_id;
+ guint32 lang_id;
+ MonoArray *res_data;
+} MonoReflectionWin32Resource;
+
+typedef struct {
+ guint32 action;
+ MonoString *pset;
+} MonoReflectionPermissionSet;
+
+typedef struct {
+ MonoReflectionAssembly assembly;
+ MonoDynamicAssembly *dynamic_assembly;
+ MonoReflectionMethod *entry_point;
+ MonoArray *modules;
+ MonoString *name;
+ MonoString *dir;
+ MonoArray *cattrs;
+ MonoArray *resources;
+ MonoArray *public_key;
+ MonoString *version;
+ MonoString *culture;
+ guint32 algid;
+ guint32 flags;
+ guint32 pekind;
+ MonoBoolean delay_sign;
+ guint32 access;
+ MonoArray *loaded_modules;
+ MonoArray *win32_resources;
+ /* CAS related */
+ MonoArray *permissions_minimum;
+ MonoArray *permissions_optional;
+ MonoArray *permissions_refused;
+ gint32 pe_kind;
+ gint32 machine;
+} MonoReflectionAssemblyBuilder;
+
+typedef struct {
+ MonoObject object;
+ guint32 attrs;
+ MonoReflectionType *type;
+ MonoString *name;
+ MonoObject *def_value;
+ gint32 offset;
+ gint32 table_idx;
+ MonoReflectionType *typeb;
+ MonoArray *rva_data;
+ MonoArray *cattrs;
+ MonoReflectionMarshal *marshal_info;
+ MonoClassField *handle;
+ MonoArray *modreq;
+ MonoArray *modopt;
+} MonoReflectionFieldBuilder;
+
+typedef struct {
+ MonoObject object;
+ guint32 attrs;
+ MonoString *name;
+ MonoReflectionType *type;
+ MonoArray *parameters;
+ MonoArray *cattrs;
+ MonoObject *def_value;
+ MonoReflectionMethodBuilder *set_method;
+ MonoReflectionMethodBuilder *get_method;
+ gint32 table_idx;
+} MonoReflectionPropertyBuilder;
+
+struct _MonoReflectionModule {
+ MonoObject obj;
+ MonoImage *image;
+ MonoReflectionAssembly *assembly;
+ MonoString *fqname;
+ MonoString *name;
+ MonoString *scopename;
+ MonoBoolean is_resource;
+ guint32 token;
+};
+
+typedef struct {
+ MonoReflectionModule module;
+ MonoDynamicImage *dynamic_image;
+ gint32 num_types;
+ MonoArray *types;
+ MonoArray *cattrs;
+ MonoArray *guid;
+ guint32 table_idx;
+ MonoReflectionAssemblyBuilder *assemblyb;
+ MonoArray *global_methods;
+ MonoArray *global_fields;
+ gboolean is_main;
+ MonoArray *resources;
+} MonoReflectionModuleBuilder;
+
+typedef struct {
+ MonoReflectionType type;
+ MonoString *name;
+ MonoString *nspace;
+ MonoReflectionType *parent;
+ MonoReflectionType *nesting_type;
+ MonoArray *interfaces;
+ gint32 num_methods;
+ MonoArray *methods;
+ MonoArray *ctors;
+ MonoArray *properties;
+ gint32 num_fields;
+ MonoArray *fields;
+ MonoArray *events;
+ MonoArray *cattrs;
+ MonoArray *subtypes;
+ guint32 attrs;
+ guint32 table_idx;
+ MonoReflectionModuleBuilder *module;
+ gint32 class_size;
+ gint32 packing_size;
+ MonoGenericContainer *generic_container;
+ MonoArray *generic_params;
+ MonoArray *permissions;
+ MonoReflectionType *created;
+} MonoReflectionTypeBuilder;
+
+typedef struct {
+ MonoReflectionType type;
+ MonoReflectionTypeBuilder *tbuilder;
+ MonoReflectionMethodBuilder *mbuilder;
+ MonoString *name;
+ guint32 index;
+ MonoReflectionType *base_type;
+ MonoArray *iface_constraints;
+ guint32 attrs;
+} MonoReflectionGenericParam;
+
+typedef struct _MonoReflectionGenericInst MonoReflectionGenericInst;
+struct _MonoReflectionGenericInst {
+ MonoReflectionType type;
+ MonoReflectionType *generic_type;
+ guint32 initialized;
+};
+
+typedef struct {
+ MonoObject obj;
+ MonoString *name;
+ MonoString *codebase;
+ gint32 major, minor, build, revision;
+ /* FIXME: add missing stuff */
+/* CultureInfo cultureinfo;
+ AssemblyNameFlags flags;
+ AssemblyHashAlgorithm hashalg;
+ StrongNameKeyPair keypair;
+ AssemblyVersionCompatibility versioncompat;*/
+ MonoObject *cultureInfo;
+ guint32 flags;
+ guint32 hashalg;
+ MonoObject *keypair;
+ MonoArray *publicKey;
+ MonoArray *keyToken;
+ MonoObject *versioncompat;
+} MonoReflectionAssemblyName;
+
+typedef struct {
+ MonoObject obj;
+ MonoString *name;
+ MonoReflectionType *type;
+ MonoReflectionTypeBuilder *typeb;
+ MonoArray *cattrs;
+ MonoReflectionMethodBuilder *add_method;
+ MonoReflectionMethodBuilder *remove_method;
+ MonoReflectionMethodBuilder *raise_method;
+ MonoArray *other_methods;
+ guint32 attrs;
+ guint32 table_idx;
+} MonoReflectionEventBuilder;
+
+typedef struct {
+ MonoObject obj;
+ MonoReflectionMethod *ctor;
+ MonoArray *data;
+} MonoReflectionCustomAttr;
+
+typedef struct {
+ MonoObject object;
+ gint32 call_conv;
+ gint32 charset;
+ MonoString *dll;
+ MonoString *entry_point;
+ MonoBoolean exact_spelling;
+ MonoBoolean preserve_sig;
+ MonoBoolean set_last_error;
+ MonoBoolean best_fit_mapping;
+ MonoBoolean throw_on_unmappable;
+} MonoReflectionDllImportAttribute;
+
+typedef struct {
+ MonoObject object;
+ MonoMethod *mhandle;
+ MonoString *name;
+ MonoReflectionType *rtype;
+ MonoArray *parameters;
+ guint32 attrs;
+ guint32 call_conv;
+ MonoReflectionModule *module;
+ MonoBoolean skip_visibility;
+ MonoBoolean init_locals;
+ MonoReflectionILGen *ilgen;
+ gint32 nrefs;
+ MonoArray *refs;
+} MonoReflectionDynamicMethod;
+
+typedef struct {
+ MonoObject object;
+ MonoReflectionModuleBuilder *module;
+ MonoArray *arguments;
+ guint32 type;
+ MonoReflectionType *return_type;
+ guint32 call_conv;
+ guint32 unmanaged_call_conv;
+} MonoReflectionSigHelper;
+
+enum {
+ RESOURCE_LOCATION_EMBEDDED = 1,
+ RESOURCE_LOCATION_ANOTHER_ASSEMBLY = 2,
+ RESOURCE_LOCATION_IN_MANIFEST = 4
+};
+
+typedef struct {
+ MonoObject object;
+ MonoReflectionAssembly *assembly;
+ MonoString *filename;
+ guint32 location;
+} MonoManifestResourceInfo;
+
+/* Keep in sync with System.GenericParameterAttributes */
+typedef enum {
+ GENERIC_PARAMETER_ATTRIBUTE_NON_VARIANT = 0,
+ GENERIC_PARAMETER_ATTRIBUTE_COVARIANT = 1,
+ GENERIC_PARAMETER_ATTRIBUTE_CONTRAVARIANT = 2,
+ GENERIC_PARAMETER_ATTRIBUTE_VARIANCE_MASK = 3,
+
+ GENERIC_PARAMETER_ATTRIBUTE_NO_SPECIAL_CONSTRAINT = 0,
+ GENERIC_PARAMETER_ATTRIBUTE_REFERENCE_TYPE_CONSTRAINT = 4,
+ GENERIC_PARAMETER_ATTRIBUTE_VALUE_TYPE_CONSTRAINT = 8,
+ GENERIC_PARAMETER_ATTRIBUTE_CONSTRUCTOR_CONSTRAINT = 16,
+ GENREIC_PARAMETER_ATTRIBUTE_SPECIAL_CONSTRAINTS_MASK = 28
+} GenericParameterAttributes;
+
+void mono_image_create_pefile (MonoReflectionModuleBuilder *module);
+void mono_image_basic_init (MonoReflectionAssemblyBuilder *assembly);
+MonoReflectionModule * mono_image_load_module (MonoReflectionAssemblyBuilder *assembly, MonoString *file_name);
+guint32 mono_image_insert_string (MonoReflectionModuleBuilder *module, MonoString *str);
+guint32 mono_image_create_token (MonoDynamicImage *assembly, MonoObject *obj, gboolean create_methodspec);
+guint32 mono_image_create_method_token (MonoDynamicImage *assembly, MonoObject *obj, MonoArray *opt_param_types);
+void mono_image_module_basic_init (MonoReflectionModuleBuilder *module);
+
+void mono_reflection_setup_internal_class (MonoReflectionTypeBuilder *tb);
+
+void mono_reflection_create_internal_class (MonoReflectionTypeBuilder *tb);
+
+void mono_reflection_setup_generic_class (MonoReflectionTypeBuilder *tb);
+
+void mono_reflection_create_generic_class (MonoReflectionTypeBuilder *tb);
+
+MonoReflectionType* mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb);
+
+void mono_reflection_create_dynamic_method (MonoReflectionDynamicMethod *m);
+
+void mono_reflection_initialize_generic_parameter (MonoReflectionGenericParam *gparam);
+
+MonoType*
+mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc, MonoType **types);
+MonoReflectionMethod*
+mono_reflection_bind_generic_method_parameters (MonoReflectionMethod *method, MonoArray *types);
+void
+mono_reflection_generic_inst_initialize (MonoReflectionGenericInst *type, MonoArray *methods, MonoArray *ctors, MonoArray *fields, MonoArray *properties, MonoArray *events);
+MonoReflectionEvent *
+mono_reflection_event_builder_get_event_info (MonoReflectionTypeBuilder *tb, MonoReflectionEventBuilder *eb);
+
+MonoArray *mono_reflection_sighelper_get_signature_local (MonoReflectionSigHelper *sig);
+
+MonoArray *mono_reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig);
+
+MonoReflectionMarshal* mono_reflection_marshal_from_marshal_spec (MonoDomain *domain, MonoClass *klass, MonoMarshalSpec *spec);
+
+gpointer
+mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token);
+
+void
+mono_image_build_metadata (MonoReflectionModuleBuilder *module);
+
+int
+mono_get_constant_value_from_blob (MonoDomain* domain, MonoTypeEnum type, const char *blob, void *value);
+
+void
+mono_release_type_locks (MonoThread *thread);
+
+#endif /* __MONO_OBJECT_INTERNALS_H__ */
+
diff --git a/mono/metadata/object.c b/mono/metadata/object.c
index a3e59df2b65..9606dcc5689 100644
--- a/mono/metadata/object.c
+++ b/mono/metadata/object.c
@@ -3,8 +3,9 @@
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
*
- * (C) 2001 Ximian, Inc.
+ * (C) 2001-2004 Ximian, Inc.
*/
#include <config.h>
#include <stdlib.h>
@@ -16,13 +17,36 @@
#include <mono/metadata/tokentype.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/object.h>
-#include <mono/metadata/gc.h>
-#include <mono/metadata/appdomain.h>
+#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/domain-internals.h>
+#include "mono/metadata/metadata-internals.h"
+#include "mono/metadata/class-internals.h"
#include <mono/metadata/assembly.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
+#include <mono/metadata/threadpool.h>
+#include <mono/metadata/marshal.h>
+#include "mono/metadata/debug-helpers.h"
+#include "mono/metadata/marshal.h"
+#include <mono/metadata/threads.h>
+#include <mono/metadata/threads-types.h>
+#include <mono/metadata/environment.h>
+#include "mono/metadata/profiler-private.h"
+#include <mono/os/gc_wrapper.h>
+#include <mono/utils/strenc.h>
+
+/*
+ * Enable typed allocation using the GC_gcj_malloc function.
+ */
+#ifdef HAVE_GC_GCJ_MALLOC
+#define CREATION_SPEEDUP 1
#endif
+static void
+get_default_field_value (MonoDomain* domain, MonoClassField *field, void *value);
+
+static MonoString*
+mono_ldstr_metdata_sig (MonoDomain *domain, const char* sig);
+
void
mono_runtime_object_init (MonoObject *this)
{
@@ -40,30 +64,230 @@ mono_runtime_object_init (MonoObject *this)
g_assert (method);
+ if (method->klass->valuetype)
+ this = mono_object_unbox (this);
mono_runtime_invoke (method, this, NULL, NULL);
}
+/* The pseudo algorithm for type initialization from the spec
+Note it doesn't say anything about domains - only threads.
+
+2. If the type is initialized you are done.
+2.1. If the type is not yet initialized, try to take an
+ initialization lock.
+2.2. If successful, record this thread as responsible for
+ initializing the type and proceed to step 2.3.
+2.2.1. If not, see whether this thread or any thread
+ waiting for this thread to complete already holds the lock.
+2.2.2. If so, return since blocking would create a deadlock. This thread
+ will now see an incompletely initialized state for the type,
+ but no deadlock will arise.
+2.2.3 If not, block until the type is initialized then return.
+2.3 Initialize the parent type and then all interfaces implemented
+ by this type.
+2.4 Execute the type initialization code for this type.
+2.5 Mark the type as initialized, release the initialization lock,
+ awaken any threads waiting for this type to be initialized,
+ and return.
+
+*/
+
+typedef struct
+{
+ guint32 initializing_tid;
+ guint32 waiting_count;
+ gboolean done;
+ CRITICAL_SECTION initialization_section;
+} TypeInitializationLock;
+
+/* for locking access to type_initialization_hash and blocked_thread_hash */
+static CRITICAL_SECTION type_initialization_section;
+
+/* from vtable to lock */
+static GHashTable *type_initialization_hash;
+
+/* from thread id to thread id being waited on */
+static GHashTable *blocked_thread_hash;
+
+/* Main thread */
+static MonoThread *main_thread;
+
+void
+mono_type_initialization_init (void)
+{
+ InitializeCriticalSection (&type_initialization_section);
+ type_initialization_hash = g_hash_table_new (NULL, NULL);
+ blocked_thread_hash = g_hash_table_new (NULL, NULL);
+}
+
/*
- * runtime_class_init:
- * @klass: klass that needs to be initialized
+ * mono_runtime_class_init:
+ * @vtable: vtable that needs to be initialized
*
- * This routine calls the class constructor for @class.
+ * This routine calls the class constructor for @vtable.
*/
void
-mono_runtime_class_init (MonoClass *klass)
+mono_runtime_class_init (MonoVTable *vtable)
{
int i;
+ MonoException *exc;
+ MonoException *exc_to_throw;
+ MonoMethod *method = NULL;
+ MonoClass *klass;
+ gchar *full_name;
+ gboolean found;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (vtable->initialized)
+ return;
+
+ exc = NULL;
+ found = FALSE;
+ klass = vtable->klass;
for (i = 0; i < klass->method.count; ++i) {
- MonoMethod *method = klass->methods [i];
+ method = klass->methods [i];
if ((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) &&
(strcmp (".cctor", method->name) == 0)) {
- mono_runtime_invoke (method, NULL, NULL, NULL);
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (found) {
+ MonoDomain *domain = vtable->domain;
+ TypeInitializationLock *lock;
+ guint32 tid = GetCurrentThreadId();
+ int do_initialization = 0;
+ MonoDomain *last_domain = NULL;
+
+ EnterCriticalSection (&type_initialization_section);
+ /* double check... */
+ if (vtable->initialized) {
+ LeaveCriticalSection (&type_initialization_section);
return;
}
+ lock = g_hash_table_lookup (type_initialization_hash, vtable);
+ if (lock == NULL) {
+ /* This thread will get to do the initialization */
+ if (mono_domain_get () != domain) {
+ /* Transfer into the target domain */
+ last_domain = mono_domain_get ();
+ if (!mono_domain_set (domain, FALSE)) {
+ vtable->initialized = 1;
+ LeaveCriticalSection (&type_initialization_section);
+ mono_raise_exception (mono_get_exception_appdomain_unloaded ());
+ }
+ }
+ lock = g_malloc (sizeof(TypeInitializationLock));
+ InitializeCriticalSection (&lock->initialization_section);
+ lock->initializing_tid = tid;
+ lock->waiting_count = 1;
+ lock->done = FALSE;
+ /* grab the vtable lock while this thread still owns type_initialization_section */
+ EnterCriticalSection (&lock->initialization_section);
+ g_hash_table_insert (type_initialization_hash, vtable, lock);
+ do_initialization = 1;
+ } else {
+ gpointer blocked;
+ TypeInitializationLock *pending_lock;
+
+ if (lock->initializing_tid == tid || lock->done) {
+ LeaveCriticalSection (&type_initialization_section);
+ return;
+ }
+ /* see if the thread doing the initialization is already blocked on this thread */
+ blocked = GUINT_TO_POINTER (lock->initializing_tid);
+ while ((pending_lock = (TypeInitializationLock*) g_hash_table_lookup (blocked_thread_hash, blocked))) {
+ if (pending_lock->initializing_tid == tid) {
+ if (!pending_lock->done) {
+ LeaveCriticalSection (&type_initialization_section);
+ return;
+ } else {
+ /* the thread doing the initialization is blocked on this thread,
+ but on a lock that has already been freed. It just hasn't got
+ time to awake */
+ break;
+ }
+ }
+ blocked = GUINT_TO_POINTER (pending_lock->initializing_tid);
+ }
+ ++lock->waiting_count;
+ /* record the fact that we are waiting on the initializing thread */
+ g_hash_table_insert (blocked_thread_hash, GUINT_TO_POINTER (tid), lock);
+ }
+ LeaveCriticalSection (&type_initialization_section);
+
+ if (do_initialization) {
+ mono_runtime_invoke (method, NULL, NULL, (MonoObject **) &exc);
+ if (last_domain)
+ mono_domain_set (last_domain, TRUE);
+ lock->done = TRUE;
+ LeaveCriticalSection (&lock->initialization_section);
+ } else {
+ /* this just blocks until the initializing thread is done */
+ EnterCriticalSection (&lock->initialization_section);
+ LeaveCriticalSection (&lock->initialization_section);
+ }
+
+ EnterCriticalSection (&type_initialization_section);
+ if (lock->initializing_tid != tid)
+ g_hash_table_remove (blocked_thread_hash, GUINT_TO_POINTER (tid));
+ --lock->waiting_count;
+ if (lock->waiting_count == 0) {
+ DeleteCriticalSection (&lock->initialization_section);
+ g_hash_table_remove (type_initialization_hash, vtable);
+ g_free (lock);
+ }
+ vtable->initialized = 1;
+ /* FIXME: if the cctor fails, the type must be marked as unusable */
+ LeaveCriticalSection (&type_initialization_section);
+ } else {
+ vtable->initialized = 1;
+ return;
+ }
+
+ if (exc == NULL ||
+ (klass->image == mono_defaults.corlib &&
+ !strcmp (klass->name_space, "System") &&
+ !strcmp (klass->name, "TypeInitializationException")))
+ return; /* No static constructor found or avoid infinite loop */
+
+ if (klass->name_space && *klass->name_space)
+ full_name = g_strdup_printf ("%s.%s", klass->name_space, klass->name);
+ else
+ full_name = g_strdup (klass->name);
+
+ exc_to_throw = mono_get_exception_type_initialization (full_name, exc);
+ g_free (full_name);
+
+ mono_raise_exception (exc_to_throw);
+}
+
+static
+gboolean release_type_locks (gpointer key, gpointer value, gpointer user)
+{
+ TypeInitializationLock *lock = (TypeInitializationLock*) value;
+ if (lock->initializing_tid == GPOINTER_TO_UINT (user)) {
+ lock->done = TRUE;
+ LeaveCriticalSection (&lock->initialization_section);
+ --lock->waiting_count;
+ if (lock->waiting_count == 0) {
+ DeleteCriticalSection (&lock->initialization_section);
+ g_free (lock);
+ return TRUE;
+ }
}
+ return FALSE;
+}
- /* No class constructor found */
+void
+mono_release_type_locks (MonoThread *thread)
+{
+ EnterCriticalSection (&type_initialization_section);
+ g_hash_table_foreach_remove (type_initialization_hash, release_type_locks, GUINT_TO_POINTER (thread->tid));
+ LeaveCriticalSection (&type_initialization_section);
}
static gpointer
@@ -94,6 +318,45 @@ mono_install_remoting_trampoline (MonoTrampoline func)
arch_create_remoting_trampoline = func? func: default_remoting_trampoline;
}
+static MonoCompileFunc default_mono_compile_method = NULL;
+
+void
+mono_install_compile_method (MonoCompileFunc func)
+{
+ default_mono_compile_method = func;
+}
+
+gpointer
+mono_compile_method (MonoMethod *method)
+{
+ if (!default_mono_compile_method) {
+ g_error ("compile method called on uninitialized runtime");
+ return NULL;
+ }
+ return default_mono_compile_method (method);
+}
+
+static MonoFreeMethodFunc default_mono_free_method = NULL;
+
+void
+mono_install_free_method (MonoFreeMethodFunc func)
+{
+ default_mono_free_method = func;
+}
+
+void
+mono_runtime_free_method (MonoMethod *method)
+{
+ if (default_mono_free_method != NULL)
+ default_mono_free_method (method);
+
+ /*
+ * FIXME: This causes crashes because the types inside signatures and
+ * locals are shared.
+ */
+ /* mono_free_method (method); */
+}
+
#if 0 && HAVE_BOEHM_GC
static void
vtable_finalizer (void *obj, void *data) {
@@ -101,6 +364,179 @@ vtable_finalizer (void *obj, void *data) {
}
#endif
+#if CREATION_SPEEDUP
+
+#define GC_NO_DESCRIPTOR ((gpointer)(0 | GC_DS_LENGTH))
+
+/*
+ * The vtables in the root appdomain are assumed to be reachable by other
+ * roots, and we don't use typed allocation in the other domains.
+ */
+
+#define GC_HEADER_BITMAP (1 << (G_STRUCT_OFFSET (MonoObject,synchronisation) / sizeof(gpointer)))
+
+static void
+mono_class_compute_gc_descriptor (MonoClass *class)
+{
+ MonoClassField *field;
+ guint64 bitmap;
+ guint32 bm [2];
+ int i;
+ static gboolean gcj_inited = FALSE;
+
+ if (!gcj_inited) {
+ gcj_inited = TRUE;
+
+ GC_init_gcj_malloc (5, NULL);
+
+ mono_register_jit_icall (mono_object_new_fast, "mono_object_new_fast", mono_create_icall_signature ("object ptr"), FALSE);
+
+#ifdef GC_REDIRECT_TO_LOCAL
+ mono_register_jit_icall (GC_local_gcj_malloc, "GC_local_gcj_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
+ mono_register_jit_icall (GC_local_gcj_fast_malloc, "GC_local_gcj_fast_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
+#endif
+ mono_register_jit_icall (GC_gcj_malloc, "GC_gcj_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
+ mono_register_jit_icall (GC_gcj_fast_malloc, "GC_gcj_fast_malloc", mono_create_icall_signature ("object int ptr"), FALSE);
+ }
+
+ if (!class->inited)
+ mono_class_init (class);
+
+ if (class->gc_descr_inited)
+ return;
+
+ class->gc_descr_inited = TRUE;
+ class->gc_descr = GC_NO_DESCRIPTOR;
+
+ if (class == mono_defaults.string_class) {
+ bitmap = GC_HEADER_BITMAP;
+ class->gc_descr = (gpointer)GC_make_descriptor ((GC_bitmap)&bitmap, 2);
+ }
+ else if (class->rank) {
+ mono_class_compute_gc_descriptor (class->element_class);
+
+ if (class->element_class->valuetype && (class->element_class->gc_descr != GC_NO_DESCRIPTOR) && (class->element_class->gc_bitmap == GC_HEADER_BITMAP)) {
+ bitmap = GC_HEADER_BITMAP;
+ if (class->rank > 1)
+ bitmap += 1 << (G_STRUCT_OFFSET (MonoArray,bounds) / sizeof(gpointer));
+ class->gc_descr = (gpointer)GC_make_descriptor ((GC_bitmap)&bitmap, 3);
+ }
+ }
+ else {
+ static int count = 0;
+ MonoClass *p;
+ guint32 pos;
+
+ /* GC 6.1 has trouble handling 64 bit descriptors... */
+ if ((class->instance_size / sizeof (gpointer)) > 30) {
+/* printf ("TOO LARGE: %s %d.\n", class->name, class->instance_size / sizeof (gpointer)); */
+ return;
+ }
+
+ bitmap = GC_HEADER_BITMAP;
+
+ count ++;
+
+/* if (count > 442) */
+/* return; */
+
+/* printf("KLASS: %s.\n", class->name); */
+
+ for (p = class; p != NULL; p = p->parent) {
+ for (i = 0; i < p->field.count; ++i) {
+ field = &p->fields [i];
+ if (field->type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+ if (field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA)
+ return;
+
+ pos = field->offset / sizeof (gpointer);
+
+ if (field->type->byref)
+ return;
+
+ switch (field->type->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+/* printf ("F: %s %s %d %lld %llx.\n", class->name, field->name, field->offset, ((guint64)1) << pos, bitmap); */
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ g_assert ((field->offset % sizeof(gpointer)) == 0);
+
+ bitmap |= ((guint64)1) << pos;
+/* printf ("F: %s %s %d %d %lld %llx.\n", class->name, field->name, field->offset, pos, ((guint64)(1)) << pos, bitmap); */
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ MonoClass *fclass = field->type->data.klass;
+ if (!fclass->enumtype) {
+ mono_class_compute_gc_descriptor (fclass);
+ bitmap |= (fclass->gc_bitmap >> (sizeof (MonoObject) / sizeof (gpointer))) << pos;
+ }
+ break;
+ }
+ default:
+ return;
+ }
+ }
+ }
+
+/* printf("CLASS: %s.%s -> %d %llx.\n", class->name_space, class->name, class->instance_size / sizeof (gpointer), bitmap); */
+ class->gc_bitmap = bitmap;
+ /* Convert to the format expected by GC_make_descriptor */
+ bm [0] = (guint32)bitmap;
+ bm [1] = (guint32)(bitmap >> 32);
+ class->gc_descr = (gpointer)GC_make_descriptor ((GC_bitmap)&bm, class->instance_size / sizeof (gpointer));
+ }
+}
+#endif /* CREATION_SPEEDUP */
+
+/**
+ * field_is_special_static:
+ *
+ * Returns SPECIAL_STATIC_THREAD if the field is thread static, SPECIAL_STATIC_CONTEXT if it is context static,
+ * SPECIAL_STATIC_NONE otherwise.
+ */
+static gint32
+field_is_special_static (MonoClass *fklass, MonoClassField *field)
+{
+ MonoCustomAttrInfo *ainfo;
+ int i;
+ ainfo = mono_custom_attrs_from_field (fklass, field);
+ if (!ainfo)
+ return FALSE;
+ for (i = 0; i < ainfo->num_attrs; ++i) {
+ MonoClass *klass = ainfo->attrs [i].ctor->klass;
+ if (klass->image == mono_defaults.corlib) {
+ if (strcmp (klass->name, "ThreadStaticAttribute") == 0) {
+ mono_custom_attrs_free (ainfo);
+ return SPECIAL_STATIC_THREAD;
+ }
+ else if (strcmp (klass->name, "ContextStaticAttribute") == 0) {
+ mono_custom_attrs_free (ainfo);
+ return SPECIAL_STATIC_CONTEXT;
+ }
+ }
+ }
+ mono_custom_attrs_free (ainfo);
+ return SPECIAL_STATIC_NONE;
+}
+
/**
* mono_class_vtable:
* @domain: the application domain
@@ -112,20 +548,19 @@ vtable_finalizer (void *obj, void *data) {
MonoVTable *
mono_class_vtable (MonoDomain *domain, MonoClass *class)
{
- MonoClass *k;
- MonoVTable *vt;
+ MonoVTable *vt = NULL;
MonoClassField *field;
- guint32 cindex;
- guint32 cols [MONO_CONSTANT_SIZE];
- const char *p;
char *t;
- int i, len;
+ int i;
+ guint32 vtable_size;
+ guint32 cindex;
+ guint32 constant_cols [MONO_CONSTANT_SIZE];
g_assert (class);
- /* can interfaces have static fields? */
- if (class->flags & TYPE_ATTRIBUTE_INTERFACE)
- g_assert_not_reached ();
+ vt = class->cached_vtable;
+ if (vt && vt->domain == domain)
+ return vt;
mono_domain_lock (domain);
if ((vt = mono_g_hash_table_lookup (domain->class_vtable_hash, class))) {
@@ -139,14 +574,36 @@ mono_class_vtable (MonoDomain *domain, MonoClass *class)
mono_stats.used_class_count++;
mono_stats.class_vtable_size += sizeof (MonoVTable) + class->vtable_size * sizeof (gpointer);
- vt = mono_mempool_alloc0 (domain->mp, sizeof (MonoVTable) +
- class->vtable_size * sizeof (gpointer));
+ vtable_size = sizeof (MonoVTable) + class->vtable_size * sizeof (gpointer);
+
+ vt = mono_mempool_alloc0 (domain->mp, vtable_size);
+
vt->klass = class;
vt->domain = domain;
+#if CREATION_SPEEDUP
+ mono_class_compute_gc_descriptor (class);
+ if (domain != mono_get_root_domain ())
+ /*
+ * We can't use typed allocation in the non-root domains, since the
+ * collector needs the GC descriptor stored in the vtable even after
+ * the mempool containing the vtable is destroyed when the domain is
+ * unloaded. An alternative might be to allocate vtables in the GC
+ * heap, but this does not seem to work (it leads to crashes inside
+ * libgc). If that approach is tried, two gc descriptors need to be
+ * allocated for each class: one for the root domain, and one for all
+ * other domains. The second descriptor should contain a bit for the
+ * vtable field in MonoObject, since we can no longer assume the
+ * vtable is reachable by other roots after the appdomain is unloaded.
+ */
+ vt->gc_descr = GC_NO_DESCRIPTOR;
+ else
+ vt->gc_descr = class->gc_descr;
+#endif
+
if (class->class_size) {
#if HAVE_BOEHM_GC
- vt->data = GC_malloc (class->class_size + 8);
+ vt->data = GC_MALLOC (class->class_size + 8);
/*vt->data = GC_debug_malloc (class->class_size + 8, class->name, 2);*/
/*GC_register_finalizer (vt->data, vtable_finalizer, class->name, NULL, NULL);*/
mono_g_hash_table_insert (domain->static_data_hash, class, vt->data);
@@ -157,75 +614,54 @@ mono_class_vtable (MonoDomain *domain, MonoClass *class)
mono_stats.class_static_data_size += class->class_size + 8;
}
+ cindex = -1;
for (i = class->field.first; i < class->field.last; ++i) {
field = &class->fields [i - class->field.first];
if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC))
continue;
+ if (mono_field_is_deleted (field))
+ continue;
+ if (!(field->type->attrs & FIELD_ATTRIBUTE_LITERAL)) {
+ gint32 special_static = field_is_special_static (class, field);
+ if (special_static != SPECIAL_STATIC_NONE) {
+ guint32 size, align, offset;
+ size = mono_type_size (field->type, &align);
+ offset = mono_alloc_special_static_data (special_static, size, align);
+ if (!domain->special_static_fields)
+ domain->special_static_fields = g_hash_table_new (NULL, NULL);
+ g_hash_table_insert (domain->special_static_fields, field, GUINT_TO_POINTER (offset));
+ continue;
+ }
+ }
if ((field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA)) {
MonoClass *fklass = mono_class_from_mono_type (field->type);
+ g_assert (!(field->type->attrs & FIELD_ATTRIBUTE_HAS_DEFAULT));
t = (char*)vt->data + field->offset;
- g_assert (fklass->valuetype);
- memcpy (t, field->data, mono_class_value_size (fklass, NULL));
+ if (fklass->valuetype) {
+ memcpy (t, field->data, mono_class_value_size (fklass, NULL));
+ } else {
+ /* it's a pointer type: add check */
+ g_assert (fklass->byval_arg.type == MONO_TYPE_PTR);
+ *t = *(char *)field->data;
+ }
continue;
}
if (!(field->type->attrs & FIELD_ATTRIBUTE_HAS_DEFAULT))
continue;
- cindex = mono_metadata_get_constant_index (class->image, MONO_TOKEN_FIELD_DEF | (i + 1));
- if (!cindex) {
- g_warning ("constant for field %s not found", field->name);
- continue;
- }
- mono_metadata_decode_row (&class->image->tables [MONO_TABLE_CONSTANT], cindex - 1, cols, MONO_CONSTANT_SIZE);
- p = mono_metadata_blob_heap (class->image, cols [MONO_CONSTANT_VALUE]);
- len = mono_metadata_decode_blob_size (p, &p);
- t = (char*)vt->data + field->offset;
- /* should we check that the type matches? */
- switch (cols [MONO_CONSTANT_TYPE]) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- *t = *p;
- break;
- case MONO_TYPE_CHAR:
- case MONO_TYPE_U2:
- case MONO_TYPE_I2: {
- guint16 *val = (guint16*)t;
- *val = read16 (p);
- break;
- }
- case MONO_TYPE_U4:
- case MONO_TYPE_I4: {
- guint32 *val = (guint32*)t;
- *val = read32 (p);
- break;
- }
- case MONO_TYPE_U8:
- case MONO_TYPE_I8: {
- guint64 *val = (guint64*)t;
- *val = read64 (p);
- break;
- }
- case MONO_TYPE_R4: {
- float *val = (float*)t;
- readr4 (p, val);
- break;
- }
- case MONO_TYPE_R8: {
- double *val = (double*)t;
- readr8 (p, val);
- break;
- }
- case MONO_TYPE_STRING: {
- /*gpointer *val = (gpointer*)t;
- *val = mono_string_new_utf16 (domain, (const guint16*)p, len/2);*/
- break;
- }
- case MONO_TYPE_CLASS:
- /* nothing to do, we malloc0 the data and the value can be 0 only */
- break;
- default:
- g_warning ("type 0x%02x should not be in constant table", cols [MONO_CONSTANT_TYPE]);
+
+
+ if (!field->data) {
+ cindex = mono_metadata_get_constant_index (class->image, MONO_TOKEN_FIELD_DEF | (i + 1), cindex + 1);
+ g_assert (cindex);
+ g_assert (!(field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA));
+
+ mono_metadata_decode_row (&class->image->tables [MONO_TABLE_CONSTANT], cindex - 1, constant_cols, MONO_CONSTANT_SIZE);
+ field->def_type = constant_cols [MONO_CONSTANT_TYPE];
+ field->data = (gpointer)mono_metadata_blob_heap (class->image, constant_cols [MONO_CONSTANT_VALUE]);
}
+
+ if (!(field->type->attrs & FIELD_ATTRIBUTE_LITERAL))
+ get_default_field_value (domain, field, (char*)vt->data + field->offset);
}
vt->max_interface_id = class->max_interface_id;
@@ -234,15 +670,20 @@ mono_class_vtable (MonoDomain *domain, MonoClass *class)
sizeof (gpointer) * (class->max_interface_id + 1));
/* initialize interface offsets */
- for (k = class; k ; k = k->parent) {
- for (i = 0; i < k->interface_count; i++) {
- int slot;
- MonoClass *ic = k->interfaces [i];
- slot = class->interface_offsets [ic->interface_id];
- vt->interface_offsets [ic->interface_id] = &vt->vtable [slot];
- }
+ for (i = 0; i <= class->max_interface_id; ++i) {
+ int slot = class->interface_offsets [i];
+ if (slot >= 0)
+ vt->interface_offsets [i] = &(vt->vtable [slot]);
}
+ /*
+ * arch_create_jit_trampoline () can recursively call this function again
+ * because it compiles icall methods right away.
+ */
+ mono_g_hash_table_insert (domain->class_vtable_hash, class, vt);
+ if (!class->cached_vtable)
+ class->cached_vtable = vt;
+
/* initialize vtable */
for (i = 0; i < class->vtable_size; ++i) {
MonoMethod *cm;
@@ -251,43 +692,62 @@ mono_class_vtable (MonoDomain *domain, MonoClass *class)
vt->vtable [i] = arch_create_jit_trampoline (cm);
}
- mono_g_hash_table_insert (domain->class_vtable_hash, class, vt);
mono_domain_unlock (domain);
/* make sure the the parent is initialized */
if (class->parent)
mono_class_vtable (domain, class->parent);
- mono_runtime_class_init (class);
-
+ vt->type = mono_type_get_object (domain, &class->byval_arg);
+ if (class->contextbound)
+ vt->remote = 1;
+ else
+ vt->remote = 0;
+
return vt;
}
/**
* mono_class_proxy_vtable:
* @domain: the application domain
- * @class: the class to proxy
+ * @remove_class: the remote class
*
* Creates a vtable for transparent proxies. It is basically
- * a copy of the real vtable of @class, but all function pointers invoke
- * the remoting functions, and vtable->klass points to the
- * transparent proxy class, and not to @class.
+ * a copy of the real vtable of the class wrapped in @remote_class,
+ * but all function pointers invoke the remoting functions, and
+ * vtable->klass points to the transparent proxy class, and not to @class.
*/
-MonoVTable *
-mono_class_proxy_vtable (MonoDomain *domain, MonoClass *class)
+static MonoVTable *
+mono_class_proxy_vtable (MonoDomain *domain, MonoRemoteClass *remote_class)
{
MonoVTable *vt, *pvt;
- int i, vtsize;
-
- if ((pvt = mono_g_hash_table_lookup (domain->proxy_vtable_hash, class)))
- return pvt;
+ int i, j, vtsize, max_interface_id, extra_interface_vtsize = 0;
+ MonoClass *k;
+ MonoClass *class = remote_class->proxy_class;
vt = mono_class_vtable (domain, class);
+ max_interface_id = vt->max_interface_id;
+
+ /* Calculate vtable space for extra interfaces */
+ for (j = 0; j < remote_class->interface_count; j++) {
+ MonoClass* iclass = remote_class->interfaces[j];
+ int method_count = iclass->method.count;
+
+ if (iclass->interface_id <= class->max_interface_id && class->interface_offsets[iclass->interface_id] != 0)
+ continue; /* interface implemented by the class */
+
+ for (i = 0; i < iclass->interface_count; i++)
+ method_count += iclass->interfaces[i]->method.count;
+
+ extra_interface_vtsize += method_count * sizeof (gpointer);
+ if (iclass->max_interface_id > max_interface_id) max_interface_id = iclass->max_interface_id;
+ }
+
vtsize = sizeof (MonoVTable) + class->vtable_size * sizeof (gpointer);
- mono_stats.class_vtable_size += vtsize;
+ mono_stats.class_vtable_size += vtsize + extra_interface_vtsize;
- pvt = mono_mempool_alloc (domain->mp, vtsize);
+ pvt = mono_mempool_alloc (domain->mp, vtsize + extra_interface_vtsize);
memcpy (pvt, vt, vtsize);
pvt->klass = mono_defaults.transparent_proxy_class;
@@ -295,28 +755,531 @@ mono_class_proxy_vtable (MonoDomain *domain, MonoClass *class)
/* initialize vtable */
for (i = 0; i < class->vtable_size; ++i) {
MonoMethod *cm;
-
+
if ((cm = class->vtable [i]))
pvt->vtable [i] = arch_create_remoting_trampoline (cm);
}
- mono_g_hash_table_insert (domain->proxy_vtable_hash, class, pvt);
+ if (class->flags & TYPE_ATTRIBUTE_ABSTRACT)
+ {
+ /* create trampolines for abstract methods */
+ for (k = class; k; k = k->parent) {
+ for (i = 0; i < k->method.count; i++) {
+ int slot = k->methods [i]->slot;
+ if (!pvt->vtable [slot])
+ pvt->vtable [slot] = arch_create_remoting_trampoline (k->methods[i]);
+ }
+ }
+ }
+
+ pvt->max_interface_id = max_interface_id;
+ pvt->interface_offsets = mono_mempool_alloc0 (domain->mp,
+ sizeof (gpointer) * (max_interface_id + 1));
+
+ /* initialize interface offsets */
+ for (i = 0; i <= class->max_interface_id; ++i) {
+ int slot = class->interface_offsets [i];
+ if (slot >= 0)
+ pvt->interface_offsets [i] = &(pvt->vtable [slot]);
+ }
+
+ if (remote_class->interface_count > 0)
+ {
+ int slot = class->vtable_size;
+ MonoClass* interf;
+ MonoClass* iclass;
+ int n;
+
+ /* Create trampolines for the methods of the interfaces */
+ for (n = 0; n < remote_class->interface_count; n++)
+ {
+ iclass = remote_class->interfaces[n];
+ if (iclass->interface_id <= class->max_interface_id && class->interface_offsets[iclass->interface_id] != 0)
+ continue; /* interface implemented by the class */
+
+ i = -1;
+ interf = iclass;
+ do {
+ pvt->interface_offsets [interf->interface_id] = &pvt->vtable [slot];
+
+ for (j = 0; j < interf->method.count; ++j) {
+ MonoMethod *cm = interf->methods [j];
+ pvt->vtable [slot + j] = arch_create_remoting_trampoline (cm);
+ }
+ slot += interf->method.count;
+ if (++i < iclass->interface_count) interf = iclass->interfaces[i];
+ else interf = NULL;
+
+ } while (interf);
+ }
+ }
return pvt;
}
-static MonoInvokeFunc default_mono_runtime_invoke = NULL;
+/**
+ * mono_remote_class:
+ * @domain: the application domain
+ * @class_name: name of the remote class
+ *
+ * Creates and initializes a MonoRemoteClass object for a remote type.
+ *
+ */
+MonoRemoteClass*
+mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_class)
+{
+ MonoRemoteClass *rc;
+
+ mono_domain_lock (domain);
+ rc = mono_g_hash_table_lookup (domain->proxy_vtable_hash, class_name);
+
+ if (rc) {
+ mono_domain_unlock (domain);
+ return rc;
+ }
+
+ rc = mono_mempool_alloc (domain->mp, sizeof(MonoRemoteClass));
+ rc->vtable = NULL;
+ rc->interface_count = 0;
+ rc->interfaces = NULL;
+ rc->proxy_class = mono_defaults.marshalbyrefobject_class;
+ rc->proxy_class_name = mono_string_to_utf8 (class_name);
+
+ mono_g_hash_table_insert (domain->proxy_vtable_hash, class_name, rc);
+ mono_upgrade_remote_class (domain, rc, proxy_class);
+
+ if (rc->vtable == NULL)
+ rc->vtable = mono_class_proxy_vtable (domain, rc);
+
+ mono_domain_unlock (domain);
+
+ return rc;
+}
+
+static void
+extend_interface_array (MonoDomain *domain, MonoRemoteClass *remote_class, int amount)
+{
+ /* Extends the array of interfaces. Memory is extended using blocks of 5 pointers */
+
+ int current_size = ((remote_class->interface_count / 5) + 1) * 5;
+ remote_class->interface_count += amount;
+
+ if (remote_class->interface_count > current_size || remote_class->interfaces == NULL)
+ {
+ int new_size = ((remote_class->interface_count / 5) + 1) * 5;
+ MonoClass **new_array = mono_mempool_alloc (domain->mp, new_size * sizeof (MonoClass*));
+
+ if (remote_class->interfaces != NULL)
+ memcpy (new_array, remote_class->interfaces, current_size * sizeof (MonoClass*));
+
+ remote_class->interfaces = new_array;
+ }
+}
+
+
+/**
+ * mono_upgrade_remote_class:
+ * @domain: the application domain
+ * @remote_class: the remote class
+ * @klass: class to which the remote class can be casted.
+ *
+ * Updates the vtable of the remote class by adding the necessary method slots
+ * and interface offsets so it can be safely casted to klass. klass can be a
+ * class or an interface.
+ */
+void mono_upgrade_remote_class (MonoDomain *domain, MonoRemoteClass *remote_class, MonoClass *klass)
+{
+ gboolean redo_vtable;
+
+ mono_domain_lock (domain);
+
+ if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ int i;
+ redo_vtable = TRUE;
+ for (i = 0; i < remote_class->interface_count; i++)
+ if (remote_class->interfaces[i] == klass) redo_vtable = FALSE;
+
+ if (redo_vtable) {
+ extend_interface_array (domain, remote_class, 1);
+ remote_class->interfaces [remote_class->interface_count-1] = klass;
+ }
+ }
+ else {
+ redo_vtable = (remote_class->proxy_class != klass);
+ remote_class->proxy_class = klass;
+ }
+
+ if (redo_vtable)
+ remote_class->vtable = mono_class_proxy_vtable (domain, remote_class);
+/*
+ int n;
+ printf ("remote class upgrade - class:%s num-interfaces:%d\n", remote_class->proxy_class_name, remote_class->interface_count);
+
+ for (n=0; n<remote_class->interface_count; n++)
+ printf (" I:%s\n", remote_class->interfaces[n]->name);
+*/
+
+ mono_domain_unlock (domain);
+}
+
+/**
+ * mono_object_get_virtual_method:
+ *
+ * Retrieve the MonoMethod that would be called on obj if obj is passed as
+ * the instance of a callvirt of method.
+ */
+MonoMethod*
+mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method) {
+ MonoClass *klass;
+ MonoMethod **vtable;
+ gboolean is_proxy;
+ MonoMethod *res = NULL;
+
+ klass = mono_object_class (obj);
+ if (klass == mono_defaults.transparent_proxy_class) {
+ klass = ((MonoTransparentProxy *)obj)->remote_class->proxy_class;
+ is_proxy = TRUE;
+ } else {
+ is_proxy = FALSE;
+ }
+
+ if (!is_proxy && ((method->flags & METHOD_ATTRIBUTE_FINAL) || !(method->flags & METHOD_ATTRIBUTE_VIRTUAL)))
+ return method;
+
+ vtable = klass->vtable;
+
+ /* check method->slot is a valid index: perform isinstance? */
+ if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ if (!is_proxy)
+ res = vtable [klass->interface_offsets [method->klass->interface_id] + method->slot];
+ } else {
+ if (method->slot != -1)
+ res = vtable [method->slot];
+ }
+
+ if (is_proxy) {
+ if (!res) res = method; /* It may be an interface or abstract class method */
+ res = mono_marshal_get_remoting_invoke (res);
+ }
+
+ g_assert (res);
+
+ return res;
+}
+
+static MonoObject*
+dummy_mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
+{
+ g_error ("runtime invoke called on uninitialized runtime");
+ return NULL;
+}
+static MonoInvokeFunc default_mono_runtime_invoke = dummy_mono_runtime_invoke;
+
+/**
+ * mono_runtime_invoke:
+ *
+ * Invokes the method represented by `method' on the object `obj'.
+ *
+ * obj is the 'this' pointer, it should be NULL for static
+ * methods, a MonoObject* for object instances and a pointer to
+ * the value type for value types.
+ *
+ * The params array contains the arguments to the method with the
+ * same convention: MonoObject* pointers for object instances and
+ * pointers to the value type otherwise.
+ *
+ * From unmanaged code you'll usually use the
+ * mono_runtime_invoke() variant.
+ *
+ * Note that this function doesn't handle virtual methods for
+ * you, it will exec the exact method you pass: we still need to
+ * expose a function to lookup the derived class implementation
+ * of a virtual method (there are examples of this in the code,
+ * though).
+ *
+ * You can pass NULL as the exc argument if you don't want to
+ * catch exceptions, otherwise, *exc will be set to the exception
+ * thrown, if any. if an exception is thrown, you can't use the
+ * MonoObject* result from the function.
+ *
+ * If the method returns a value type, it is boxed in an object
+ * reference.
+ */
MonoObject*
mono_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
{
- if (!default_mono_runtime_invoke) {
- g_error ("runtime invoke called on uninitialized runtime");
+ return default_mono_runtime_invoke (method, obj, params, exc);
+}
+
+static void
+set_value (MonoType *type, void *dest, void *value, int deref_pointer) {
+ int t;
+ if (type->byref) {
+ gpointer *p = (gpointer*)dest;
+ *p = value;
+ return;
+ }
+ t = type->type;
+handle_enum:
+ switch (t) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1: {
+ guint8 *p = (guint8*)dest;
+ *p = *(guint8*)value;
+ return;
+ }
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR: {
+ guint16 *p = (guint16*)dest;
+ *p = *(guint16*)value;
+ return;
+ }
+#if SIZEOF_VOID_P == 4
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4: {
+ gint32 *p = (gint32*)dest;
+ *p = *(gint32*)value;
+ return;
+ }
+#if SIZEOF_VOID_P == 8
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+#endif
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8: {
+ gint64 *p = (gint64*)dest;
+ *p = *(gint64*)value;
+ return;
+ }
+ case MONO_TYPE_R4: {
+ float *p = (float*)dest;
+ *p = *(float*)value;
+ return;
+ }
+ case MONO_TYPE_R8: {
+ double *p = (double*)dest;
+ *p = *(double*)value;
+ return;
+ }
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR: {
+ gpointer *p = (gpointer*)dest;
+ *p = deref_pointer? *(gpointer*)value: value;
+ return;
+ }
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ t = type->data.klass->enum_basetype->type;
+ goto handle_enum;
+ } else {
+ int size;
+ size = mono_class_value_size (type->data.klass, NULL);
+ memcpy (dest, value, size);
+ }
+ return;
+ default:
+ g_warning ("got type %x", type->type);
+ g_assert_not_reached ();
+ }
+}
+
+void
+mono_field_set_value (MonoObject *obj, MonoClassField *field, void *value)
+{
+ void *dest;
+
+ g_return_if_fail (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC));
+
+ dest = (char*)obj + field->offset;
+ set_value (field->type, dest, value, FALSE);
+}
+
+void
+mono_field_static_set_value (MonoVTable *vt, MonoClassField *field, void *value)
+{
+ void *dest;
+
+ g_return_if_fail (field->type->attrs & FIELD_ATTRIBUTE_STATIC);
+ /* you cant set a constant! */
+ g_return_if_fail (!(field->type->attrs & FIELD_ATTRIBUTE_LITERAL));
+
+ dest = (char*)vt->data + field->offset;
+ set_value (field->type, dest, value, FALSE);
+}
+
+void
+mono_field_get_value (MonoObject *obj, MonoClassField *field, void *value)
+{
+ void *src;
+
+ g_return_if_fail (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC));
+
+ src = (char*)obj + field->offset;
+ set_value (field->type, value, src, TRUE);
+}
+
+MonoObject *
+mono_field_get_value_object (MonoDomain *domain, MonoClassField *field, MonoObject *obj)
+{
+ MonoObject *o;
+ MonoClass *klass;
+ MonoVTable *vtable = NULL;
+ gchar *v;
+ gboolean is_static = FALSE;
+ gboolean is_ref = FALSE;
+
+ switch (field->type->type) {
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ is_ref = TRUE;
+ break;
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_VALUETYPE:
+ is_ref = field->type->byref;
+ break;
+ default:
+ g_error ("type 0x%x not handled in "
+ "mono_field_get_value_object", field->type->type);
return NULL;
}
- return default_mono_runtime_invoke (method, obj, params, exc);
+
+ if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
+ is_static = TRUE;
+ vtable = mono_class_vtable (domain, field->parent);
+ if (!vtable->initialized)
+ mono_runtime_class_init (vtable);
+ }
+
+ if (is_ref) {
+ if (is_static) {
+ mono_field_static_get_value (vtable, field, &o);
+ } else {
+ mono_field_get_value (obj, field, &o);
+ }
+ return o;
+ }
+
+ /* boxed value type */
+ klass = mono_class_from_mono_type (field->type);
+ o = mono_object_new (domain, klass);
+ v = ((gchar *) o) + sizeof (MonoObject);
+ if (is_static) {
+ mono_field_static_get_value (vtable, field, v);
+ } else {
+ mono_field_get_value (obj, field, v);
+ }
+
+ return o;
+}
+
+int
+mono_get_constant_value_from_blob (MonoDomain* domain, MonoTypeEnum type, const char *blob, void *value)
+{
+ int retval = 0;
+ const char *p = blob;
+ mono_metadata_decode_blob_size (p, &p);
+
+ switch (type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ *(guint8 *) value = *p;
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2:
+ *(guint16*) value = read16 (p);
+ break;
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4:
+ *(guint32*) value = read32 (p);
+ break;
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ *(guint64*) value = read64 (p);
+ break;
+ case MONO_TYPE_R4:
+ readr4 (p, (float*) value);
+ break;
+ case MONO_TYPE_R8:
+ readr8 (p, (double*) value);
+ break;
+ case MONO_TYPE_STRING:
+ *(gpointer*) value = mono_ldstr_metdata_sig (domain, blob);
+ break;
+ case MONO_TYPE_CLASS:
+ *(gpointer*) value = NULL;
+ break;
+ default:
+ retval = -1;
+ g_warning ("type 0x%02x should not be in constant table", type);
+ }
+ return retval;
+}
+
+static void
+get_default_field_value (MonoDomain* domain, MonoClassField *field, void *value)
+{
+ g_return_if_fail (field->type->attrs & FIELD_ATTRIBUTE_HAS_DEFAULT);
+ mono_get_constant_value_from_blob (domain, field->def_type, field->data, value);
+}
+
+
+void
+mono_field_static_get_value (MonoVTable *vt, MonoClassField *field, void *value)
+{
+ void *src;
+
+ g_return_if_fail (field->type->attrs & FIELD_ATTRIBUTE_STATIC);
+
+ if (field->type->attrs & FIELD_ATTRIBUTE_LITERAL) {
+ get_default_field_value (vt->domain, field, value);
+ return;
+ }
+
+ src = (char*)vt->data + field->offset;
+ set_value (field->type, value, src, TRUE);
+}
+
+void
+mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc)
+{
+ default_mono_runtime_invoke (prop->set, obj, params, exc);
}
+MonoObject*
+mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc)
+{
+ return default_mono_runtime_invoke (prop->get, obj, params, exc);
+}
+
+
MonoMethod *
mono_get_delegate_invoke (MonoClass *klass)
{
@@ -356,6 +1319,29 @@ mono_runtime_get_main_args (void)
return main_args;
}
+static void
+fire_process_exit_event (void)
+{
+ MonoClassField *field;
+ MonoDomain *domain = mono_domain_get ();
+ gpointer pa [2];
+ MonoObject *delegate, *exc;
+
+ field = mono_class_get_field_from_name (mono_defaults.appdomain_class, "ProcessExit");
+ g_assert (field);
+
+ if (domain != mono_get_root_domain ())
+ return;
+
+ delegate = *(MonoObject **)(((char *)domain->domain) + field->offset);
+ if (delegate == NULL)
+ return;
+
+ pa [0] = domain;
+ pa [1] = NULL;
+ mono_runtime_delegate_invoke (delegate, pa, &exc);
+}
+
/*
* Execute a standard Main() method (argc/argv contains the
* executable name). This method also sets the command line argument value
@@ -363,15 +1349,63 @@ mono_runtime_get_main_args (void)
*/
int
mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
- MonoObject **exc, MonoAssembly *app)
+ MonoObject **exc)
{
int i;
MonoArray *args = NULL;
MonoDomain *domain = mono_domain_get ();
+ gchar *utf8_fullpath;
+ int result;
+
+ main_thread = mono_thread_current ();
main_args = (MonoArray*)mono_array_new (domain, mono_defaults.string_class, argc);
- for (i = 0; i < argc; ++i) {
- MonoString *arg = mono_string_new (domain, argv [i]);
+
+ if (!g_path_is_absolute (argv [0])) {
+ gchar *basename = g_path_get_basename (argv [0]);
+ gchar *fullpath = g_build_filename (method->klass->image->assembly->basedir,
+ basename,
+ NULL);
+
+ utf8_fullpath = mono_utf8_from_external (fullpath);
+ if(utf8_fullpath == NULL) {
+ /* Printing the arg text will cause glib to
+ * whinge about "Invalid UTF-8", but at least
+ * its relevant, and shows the problem text
+ * string.
+ */
+ g_print ("\nCannot determine the text encoding for the assembly location: %s\n", fullpath);
+ g_print ("Please add the correct encoding to MONO_EXTERNAL_ENCODINGS and try again.\n");
+ exit (-1);
+ }
+
+ g_free (fullpath);
+ g_free (basename);
+ } else {
+ utf8_fullpath = mono_utf8_from_external (argv[0]);
+ if(utf8_fullpath == NULL) {
+ g_print ("\nCannot determine the text encoding for the assembly location: %s\n", argv[0]);
+ g_print ("Please add the correct encoding to MONO_EXTERNAL_ENCODINGS and try again.\n");
+ exit (-1);
+ }
+ }
+
+ mono_array_set (main_args, gpointer, 0, mono_string_new (domain, utf8_fullpath));
+ g_free (utf8_fullpath);
+
+ for (i = 1; i < argc; ++i) {
+ gchar *utf8_arg;
+ MonoString *arg;
+
+ utf8_arg=mono_utf8_from_external (argv[i]);
+ if(utf8_arg==NULL) {
+ /* Ditto the comment about Invalid UTF-8 here */
+ g_print ("\nCannot determine the text encoding for argument %d (%s).\n", i, argv[i]);
+ g_print ("Please add the correct encoding to MONO_EXTERNAL_ENCODINGS and try again.\n");
+ exit (-1);
+ }
+
+ arg = mono_string_new (domain, utf8_arg);
mono_array_set (main_args, gpointer, i, arg);
}
argc--;
@@ -379,19 +1413,66 @@ mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
if (method->signature->param_count) {
args = (MonoArray*)mono_array_new (domain, mono_defaults.string_class, argc);
for (i = 0; i < argc; ++i) {
- MonoString *arg = mono_string_new (domain, argv [i]);
+ /* The encodings should all work, given that
+ * we've checked all these args for the
+ * main_args array.
+ */
+ MonoString *arg = mono_string_new (domain, mono_utf8_from_external (argv [i]));
mono_array_set (args, gpointer, i, arg);
}
+ } else {
+ args = (MonoArray*)mono_array_new (domain, mono_defaults.string_class, 0);
}
- mono_assembly_set_main (app);
-
- return mono_runtime_exec_main (method, args, exc);
+ mono_assembly_set_main (method->klass->image->assembly);
+
+ result = mono_runtime_exec_main (method, args, exc);
+ fire_process_exit_event ();
+ return result;
+}
+
+/* Used in mono_unhandled_exception */
+static MonoObject *
+create_unhandled_exception_eventargs (MonoObject *exc)
+{
+ MonoClass *klass;
+ gpointer args [2];
+ MonoMethod *method = NULL;
+ MonoBoolean is_terminating = TRUE;
+ MonoObject *obj;
+ gint i;
+
+ klass = mono_class_from_name (mono_defaults.corlib, "System", "UnhandledExceptionEventArgs");
+ g_assert (klass);
+
+ mono_class_init (klass);
+
+ /* UnhandledExceptionEventArgs only has 1 public ctor with 2 args */
+ for (i = 0; i < klass->method.count; ++i) {
+ method = klass->methods [i];
+ if (!strcmp (".ctor", method->name) &&
+ method->signature->param_count == 2 &&
+ method->flags & METHOD_ATTRIBUTE_PUBLIC)
+ break;
+ method = NULL;
+ }
+
+ g_assert (method);
+
+ args [0] = exc;
+ args [1] = &is_terminating;
+
+ obj = mono_object_new (mono_domain_get (), klass);
+ mono_runtime_invoke (method, obj, args, NULL);
+
+ return obj;
}
/*
- * We call this function when we dectect an unhandled exception. It invokes the
- * UnhandledException event in AppDomain or print a warning to the console
+ * We call this function when we detect an unhandled exception
+ * in the default domain.
+ * It invokes the * UnhandledException event in AppDomain or prints
+ * a warning to the console
*/
void
mono_unhandled_exception (MonoObject *exc)
@@ -399,41 +1480,87 @@ mono_unhandled_exception (MonoObject *exc)
MonoDomain *domain = mono_domain_get ();
MonoClassField *field;
MonoObject *delegate;
-
+
field=mono_class_get_field_from_name(mono_defaults.appdomain_class,
"UnhandledException");
g_assert (field);
- delegate = *(MonoObject **)(((char *)domain->domain) + field->offset);
+ if (exc->vtable->klass != mono_defaults.threadabortexception_class) {
+ delegate = *(MonoObject **)(((char *)domain->domain) + field->offset);
- if (!delegate) {
- mono_print_unhandled_exception (exc);
- } else {
- MonoObject *e = NULL;
- gpointer pa [2];
+ /* set exitcode only in the main thread */
+ if (mono_thread_current () == main_thread)
+ mono_environment_exitcode_set (1);
+ if (domain != mono_get_root_domain () || !delegate) {
+ mono_print_unhandled_exception (exc);
+ } else {
+ MonoObject *e = NULL;
+ gpointer pa [2];
- /* fixme: pass useful arguments */
- pa [0] = NULL;
- pa [1] = NULL;
- mono_runtime_delegate_invoke (delegate, pa, &e);
-
- if (e)
- g_warning ("exception inside UnhandledException handler!");
+ pa [0] = domain->domain;
+ pa [1] = create_unhandled_exception_eventargs (exc);
+ mono_runtime_delegate_invoke (delegate, pa, &e);
+
+ if (e) {
+ gchar *msg = mono_string_to_utf8 (((MonoException *) e)->message);
+ g_warning ("exception inside UnhandledException handler: %s\n", msg);
+ g_free (msg);
+ }
+ }
}
}
/*
+ * Launch a new thread to start all setup that requires managed code
+ * to be executed.
+ *
+ * main_func is called back from the thread with main_args as the
+ * parameter. The callback function is expected to start Main()
+ * eventually. This function then waits for all managed threads to
+ * finish.
+ */
+void
+mono_runtime_exec_managed_code (MonoDomain *domain,
+ MonoMainThreadFunc main_func,
+ gpointer main_args)
+{
+ mono_thread_create (domain, main_func, main_args);
+
+ mono_thread_manage ();
+}
+
+/*
* Execute a standard Main() method (args doesn't contain the
* executable name).
*/
int
mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
{
+ MonoDomain *domain;
gpointer pa [1];
int rval;
+ g_assert (args);
+
pa [0] = args;
+ domain = mono_object_domain (args);
+ if (!domain->entry_assembly) {
+ gchar *str;
+ gchar *config_suffix;
+ MonoAssembly *assembly;
+
+ assembly = method->klass->image->assembly;
+ domain->entry_assembly = assembly;
+ domain->setup->application_base = mono_string_new (domain, assembly->basedir);
+
+ config_suffix = g_strconcat (assembly->aname.name, ".exe.config", NULL);
+ str = g_build_filename (assembly->basedir, config_suffix, NULL);
+ g_free (config_suffix);
+ domain->setup->configuration_file = mono_string_new (domain, str);
+ g_free (str);
+ }
+
/* FIXME: check signature of method */
if (method->signature->ret->type == MONO_TYPE_I4) {
MonoObject *res;
@@ -442,12 +1569,21 @@ mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
rval = *(guint32 *)((char *)res + sizeof (MonoObject));
else
rval = -1;
+
+ mono_environment_exitcode_set (rval);
} else {
mono_runtime_invoke (method, NULL, pa, exc);
if (!exc || !*exc)
rval = 0;
- else
+ else {
+ /* If the return type of Main is void, only
+ * set the exitcode if an exception was thrown
+ * (we don't want to blow away an
+ * explicitly-set exit code)
+ */
rval = -1;
+ mono_environment_exitcode_set (rval);
+ }
}
return rval;
@@ -456,9 +1592,42 @@ mono_runtime_exec_main (MonoMethod *method, MonoArray *args, MonoObject **exc)
void
mono_install_runtime_invoke (MonoInvokeFunc func)
{
- default_mono_runtime_invoke = func;
+ default_mono_runtime_invoke = func ? func: dummy_mono_runtime_invoke;
}
+/**
+ * mono_runtime_invoke:
+ *
+ * Invokes the method represented by `method' on the object `obj'.
+ *
+ * obj is the 'this' pointer, it should be NULL for static
+ * methods, a MonoObject* for object instances and a pointer to
+ * the value type for value types.
+ *
+ * The params array contains the arguments to the method with the
+ * same convention: MonoObject* pointers for object instances and
+ * pointers to the value type otherwise. The _invoke_array
+ * variant takes a C# object[] as the params argument (MonoArray
+ * *params): in this case the value types are boxed inside the
+ * respective reference representation.
+ *
+ * From unmanaged code you'll usually use the
+ * mono_runtime_invoke() variant.
+ *
+ * Note that this function doesn't handle virtual methods for
+ * you, it will exec the exact method you pass: we still need to
+ * expose a function to lookup the derived class implementation
+ * of a virtual method (there are examples of this in the code,
+ * though).
+ *
+ * You can pass NULL as the exc argument if you don't want to
+ * catch exceptions, otherwise, *exc will be set to the exception
+ * thrown, if any. if an exception is thrown, you can't use the
+ * MonoObject* result from the function.
+ *
+ * If the method returns a value type, it is boxed in an object
+ * reference.
+ */
MonoObject*
mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
MonoObject **exc)
@@ -487,14 +1656,23 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
case MONO_TYPE_I4:
case MONO_TYPE_U8:
case MONO_TYPE_I8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
case MONO_TYPE_VALUETYPE:
+ /* MS seems to create the objects if a null is passed in */
+ if (! ((gpointer *)params->vector)[i])
+ ((gpointer*)params->vector)[i] = mono_object_new (mono_domain_get (), mono_class_from_mono_type (sig->params [i]));
pa [i] = (char *)(((gpointer *)params->vector)[i]) + sizeof (MonoObject);
break;
case MONO_TYPE_STRING:
case MONO_TYPE_OBJECT:
case MONO_TYPE_CLASS:
+ case MONO_TYPE_ARRAY:
case MONO_TYPE_SZARRAY:
- pa [i] = (char *)(((gpointer *)params->vector)[i]);
+ if (sig->params [i]->byref)
+ pa [i] = &(((gpointer *)params->vector)[i]);
+ else
+ pa [i] = (char *)(((gpointer *)params->vector)[i]);
break;
default:
g_error ("type 0x%x not handled in ves_icall_InternalInvoke", sig->params [i]->type);
@@ -503,11 +1681,29 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
}
if (!strcmp (method->name, ".ctor") && method->klass != mono_defaults.string_class) {
- obj = mono_object_new (mono_domain_get (), method->klass);
- mono_runtime_invoke (method, obj, pa, exc);
+ void *o = obj;
+ if (!obj) {
+ obj = mono_object_new (mono_domain_get (), method->klass);
+ if (mono_object_class(obj) == mono_defaults.transparent_proxy_class) {
+ method = mono_marshal_get_remoting_invoke (method->slot == -1 ? method : method->klass->vtable [method->slot]);
+ }
+ if (method->klass->valuetype)
+ o = mono_object_unbox (obj);
+ else
+ o = obj;
+ }
+ mono_runtime_invoke (method, o, pa, exc);
return obj;
- } else
+ } else {
+ /* obj must be already unboxed if needed */
return mono_runtime_invoke (method, obj, pa, exc);
+ }
+}
+
+static void
+arith_overflow (void)
+{
+ mono_raise_exception (mono_get_exception_overflow ());
}
/**
@@ -519,48 +1715,47 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
*
* Returns: an allocated object of size @size, or NULL on failure.
*/
-void *
+static inline void *
mono_object_allocate (size_t size)
{
#if HAVE_BOEHM_GC
/* if this is changed to GC_debug_malloc(), we need to change also metadata/gc.c */
- void *o = GC_malloc (size);
+ void *o = GC_MALLOC (size);
#else
void *o = calloc (1, size);
+ if (!o)
+ return mono_gc_out_of_memory (size);
#endif
+ mono_stats.new_object_count++;
return o;
}
-/**
- * mono_object_free:
- *
- * Frees the memory used by the object. Debugging purposes
- * only, as we will have our GC system.
- */
-void
-mono_object_free (MonoObject *o)
+#if CREATION_SPEEDUP
+static inline void *
+mono_object_allocate_spec (size_t size, void *gcdescr)
{
-#if HAVE_BOEHM_GC
- g_error ("mono_object_free called with boehm gc.");
-#else
- MonoClass *c = o->vtable->klass;
-
- memset (o, 0, c->instance_size);
- free (o);
-#endif
+ /* if this is changed to GC_debug_malloc(), we need to change also metadata/gc.c */
+ void *o = GC_GCJ_MALLOC (size, gcdescr);
+ mono_stats.new_object_count++;
+
+ return o;
}
+#endif
/**
* mono_object_new:
* @klass: the class of the object that we want to create
*
- * Returns: A newly created object whose definition is
- * looked up using @klass
+ * Returns a newly created object whose definition is
+ * looked up using @klass. This will not invoke any constructors,
+ * so the consumer of this routine has to invoke any constructors on
+ * its own to initialize the object.
*/
MonoObject *
mono_object_new (MonoDomain *domain, MonoClass *klass)
{
+ MONO_ARCH_SAVE_REGS;
return mono_object_new_specific (mono_class_vtable (domain, klass));
}
@@ -576,16 +1771,109 @@ mono_object_new_specific (MonoVTable *vtable)
{
MonoObject *o;
- mono_stats.new_object_count++;
+ MONO_ARCH_SAVE_REGS;
+
+ if (vtable->remote)
+ {
+ gpointer pa [1];
+ MonoMethod *im = vtable->domain->create_proxy_for_type_method;
+
+ if (im == NULL) {
+ MonoClass *klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Activation", "ActivationServices");
+ int i;
+
+ if (!klass->inited)
+ mono_class_init (klass);
+
+ for (i = 0; i < klass->method.count; ++i) {
+ if (!strcmp ("CreateProxyForType", klass->methods [i]->name) &&
+ klass->methods [i]->signature->param_count == 1) {
+ im = klass->methods [i];
+ break;
+ }
+ }
+ g_assert (im);
+ vtable->domain->create_proxy_for_type_method = im;
+ }
+
+ pa [0] = mono_type_get_object (mono_domain_get (), &vtable->klass->byval_arg);
+
+ o = mono_runtime_invoke (im, NULL, pa, NULL);
+ if (o != NULL) return o;
+ }
+
+ return mono_object_new_alloc_specific (vtable);
+}
+
+MonoObject *
+mono_object_new_alloc_specific (MonoVTable *vtable)
+{
+ MonoObject *o;
+#if CREATION_SPEEDUP
+ if (vtable->gc_descr != GC_NO_DESCRIPTOR) {
+ o = mono_object_allocate_spec (vtable->klass->instance_size, vtable);
+ } else {
+/* printf("OBJECT: %s.%s.\n", vtable->klass->name_space, vtable->klass->name); */
+ o = mono_object_allocate (vtable->klass->instance_size);
+ o->vtable = vtable;
+ }
+#else
o = mono_object_allocate (vtable->klass->instance_size);
o->vtable = vtable;
+#endif
if (vtable->klass->has_finalize)
mono_object_register_finalizer (o);
+ mono_profiler_allocation (o, vtable->klass);
return o;
}
+#if CREATION_SPEEDUP
+
+MonoObject*
+mono_object_new_fast (MonoVTable *vtable)
+{
+ return GC_GCJ_MALLOC (vtable->klass->instance_size, vtable);
+}
+
+#endif
+
+/*
+ * Return the allocation function appropriate for the given class.
+ */
+
+void*
+mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean *pass_size_in_words)
+{
+ *pass_size_in_words = FALSE;
+
+ if (vtable->klass->has_finalize || vtable->klass->marshalbyref || (mono_profiler_get_events () & MONO_PROFILE_ALLOCATIONS))
+ return mono_object_new_specific;
+
+#if CREATION_SPEEDUP
+ if (vtable->gc_descr != GC_NO_DESCRIPTOR) {
+
+ return mono_object_new_fast;
+
+ /*
+ * FIXME: This is actually slower than mono_object_new_fast, because
+ * of the overhead of parameter passing.
+ */
+ /*
+ *pass_size_in_words = TRUE;
+#ifdef GC_REDIRECT_TO_LOCAL
+ return GC_local_gcj_fast_malloc;
+#else
+ return GC_gcj_fast_malloc;
+#endif
+ */
+ }
+#endif
+
+ return mono_object_new_specific;
+}
+
/**
* mono_object_new_from_token:
* @image: Context where the type_token is hosted
@@ -619,6 +1907,7 @@ mono_object_clone (MonoObject *obj)
size = obj->vtable->klass->instance_size;
o = mono_object_allocate (size);
+ mono_profiler_allocation (o, obj->vtable->klass);
memcpy (o, obj, size);
@@ -641,6 +1930,8 @@ mono_array_clone (MonoArray *array)
guint32 *sizes;
MonoClass *klass = array->obj.vtable->klass;
+ MONO_ARCH_SAVE_REGS;
+
if (array->bounds == NULL) {
size = mono_array_length (array);
o = mono_array_new_full (((MonoObject *)array)->vtable->domain,
@@ -666,6 +1957,14 @@ mono_array_clone (MonoArray *array)
return o;
}
+/* helper macros to check for overflow when calculating the size of arrays */
+#define MYGUINT32_MAX 4294967295U
+#define CHECK_ADD_OVERFLOW_UN(a,b) \
+ (guint32)(MYGUINT32_MAX) - (guint32)(b) < (guint32)(a) ? -1 : 0
+#define CHECK_MUL_OVERFLOW_UN(a,b) \
+ ((guint32)(a) == 0) || ((guint32)(b) == 0) ? 0 : \
+ (guint32)(b) > ((MYGUINT32_MAX) / (guint32)(a))
+
/*
* mono_array_new_full:
* @domain: domain where the object is created
@@ -684,6 +1983,7 @@ mono_array_new_full (MonoDomain *domain, MonoClass *array_class,
MonoObject *o;
MonoArray *array;
MonoArrayBounds *bounds;
+ MonoVTable *vtable;
int i;
if (!array_class->inited)
@@ -696,14 +1996,22 @@ mono_array_new_full (MonoDomain *domain, MonoClass *array_class,
(lower_bounds == NULL || lower_bounds [0] == 0)) {
bounds = NULL;
len = lengths [0];
+ if ((int) len < 0)
+ arith_overflow ();
} else {
#if HAVE_BOEHM_GC
- bounds = GC_malloc (sizeof (MonoArrayBounds) * array_class->rank);
+ bounds = GC_MALLOC (sizeof (MonoArrayBounds) * array_class->rank);
#else
bounds = g_malloc0 (sizeof (MonoArrayBounds) * array_class->rank);
#endif
+ for (i = 0; i < array_class->rank; ++i)
+ if ((int) lengths [i] < 0)
+ arith_overflow ();
+
for (i = 0; i < array_class->rank; ++i) {
bounds [i].length = lengths [i];
+ if (CHECK_MUL_OVERFLOW_UN (len, lengths [i]))
+ mono_gc_out_of_memory (MYGUINT32_MAX);
len *= lengths [i];
}
@@ -712,21 +2020,36 @@ mono_array_new_full (MonoDomain *domain, MonoClass *array_class,
bounds [i].lower_bound = lower_bounds [i];
}
+ if (CHECK_MUL_OVERFLOW_UN (byte_len, len))
+ mono_gc_out_of_memory (MYGUINT32_MAX);
byte_len *= len;
+ if (CHECK_ADD_OVERFLOW_UN (byte_len, sizeof (MonoArray)))
+ mono_gc_out_of_memory (MYGUINT32_MAX);
+ byte_len += sizeof (MonoArray);
/*
* Following three lines almost taken from mono_object_new ():
* they need to be kept in sync.
*/
- o = mono_object_allocate (sizeof (MonoArray) + byte_len);
- if (!o)
- G_BREAKPOINT ();
- o->vtable = mono_class_vtable (domain, array_class);
+ vtable = mono_class_vtable (domain, array_class);
+#if CREATION_SPEEDUP
+ if (vtable->gc_descr != GC_NO_DESCRIPTOR)
+ o = mono_object_allocate_spec (byte_len, vtable);
+ else {
+ o = mono_object_allocate (byte_len);
+ o->vtable = vtable;
+ }
+#else
+ o = mono_object_allocate (byte_len);
+ o->vtable = vtable;
+#endif
array = (MonoArray*)o;
array->bounds = bounds;
array->max_length = len;
+ mono_profiler_allocation (o, array_class);
+
return array;
}
@@ -743,7 +2066,9 @@ mono_array_new (MonoDomain *domain, MonoClass *eclass, guint32 n)
{
MonoClass *ac;
- ac = mono_array_class_get (&eclass->byval_arg, 1);
+ MONO_ARCH_SAVE_REGS;
+
+ ac = mono_array_class_get (eclass, 1);
g_assert (ac != NULL);
return mono_array_new_specific (mono_class_vtable (domain, ac), n);
@@ -762,17 +2087,37 @@ mono_array_new_specific (MonoVTable *vtable, guint32 n)
{
MonoObject *o;
MonoArray *ao;
- gsize byte_len;
+ guint32 byte_len, elem_size;
- byte_len = n * mono_array_element_size (vtable->klass);
- o = mono_object_allocate (sizeof (MonoArray) + byte_len);
- if (!o)
- G_BREAKPOINT ();
+ MONO_ARCH_SAVE_REGS;
+
+ if ((int) n < 0)
+ arith_overflow ();
+
+ elem_size = mono_array_element_size (vtable->klass);
+ if (CHECK_MUL_OVERFLOW_UN (n, elem_size))
+ mono_gc_out_of_memory (MYGUINT32_MAX);
+ byte_len = n * elem_size;
+ if (CHECK_ADD_OVERFLOW_UN (byte_len, sizeof (MonoArray)))
+ mono_gc_out_of_memory (MYGUINT32_MAX);
+ byte_len += sizeof (MonoArray);
+#if CREATION_SPEEDUP
+ if (vtable->gc_descr != GC_NO_DESCRIPTOR) {
+ o = mono_object_allocate_spec (byte_len, vtable);
+ } else {
+/* printf("ARRAY: %s.%s.\n", vtable->klass->name_space, vtable->klass->name); */
+ o = mono_object_allocate (byte_len);
+ o->vtable = vtable;
+ }
+#else
+ o = mono_object_allocate (byte_len);
o->vtable = vtable;
+#endif
ao = (MonoArray *)o;
ao->bounds = NULL;
ao->max_length = n;
+ mono_profiler_allocation (o, vtable->klass);
return ao;
}
@@ -808,23 +2153,29 @@ MonoString *
mono_string_new_size (MonoDomain *domain, gint32 len)
{
MonoString *s;
+ MonoVTable *vtable;
+ size_t size = (sizeof (MonoString) + ((len + 1) * 2));
- /*
- * enable to get a good speedup: we still need to figure out
- * how the sync structure is freed.
- */
-#if 0
- s = GC_malloc_atomic (sizeof (MonoString) + ((len + 1) * 2));
- s->object.synchronisation = 0;
- mono_string_chars (s) [len] = 0;
+ /* overflow ? can't fit it, can't allocate it! */
+ if (len > size)
+ mono_gc_out_of_memory (-1);
+
+ vtable = mono_class_vtable (domain, mono_defaults.string_class);
+
+#if CREATION_SPEEDUP
+ if (vtable->gc_descr != GC_NO_DESCRIPTOR)
+ s = mono_object_allocate_spec (size, vtable);
+ else {
+ s = (MonoString*)mono_object_allocate (size);
+ s->object.vtable = vtable;
+ }
#else
- s = (MonoString*)mono_object_allocate (sizeof (MonoString) + ((len + 1) * 2));
+ s = (MonoString*)mono_object_allocate (size);
+ s->object.vtable = vtable;
#endif
- if (!s)
- G_BREAKPOINT ();
- s->object.vtable = mono_class_vtable (domain, mono_defaults.string_class);
s->length = len;
+ mono_profiler_allocation ((MonoObject*)s, mono_defaults.string_class);
return s;
}
@@ -844,7 +2195,6 @@ mono_string_new_len (MonoDomain *domain, const char *text, guint length)
guint16 *ut;
glong items_written;
-
ut = g_utf8_to_utf16 (text, length, NULL, &items_written, &error);
if (!error)
@@ -897,7 +2247,12 @@ mono_string_new_wrapper (const char *text)
{
MonoDomain *domain = mono_domain_get ();
- return mono_string_new (domain, text);
+ MONO_ARCH_SAVE_REGS;
+
+ if (text)
+ return mono_string_new (domain, text);
+
+ return NULL;
}
/**
@@ -912,12 +2267,15 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
{
MonoObject *res;
int size;
+ MonoVTable *vtable;
g_assert (class->valuetype);
+ vtable = mono_class_vtable (domain, class);
size = mono_class_instance_size (class);
res = mono_object_allocate (size);
- res->vtable = mono_class_vtable (domain, class);
+ res->vtable = vtable;
+ mono_profiler_allocation (res, class);
size = size - sizeof (MonoObject);
@@ -946,6 +2304,26 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
return res;
}
+MonoDomain*
+mono_object_get_domain (MonoObject *obj)
+{
+ return mono_object_domain (obj);
+}
+
+MonoClass*
+mono_object_get_class (MonoObject *obj)
+{
+ return mono_object_class (obj);
+}
+
+gpointer
+mono_object_unbox (MonoObject *obj)
+{
+ /* add assert for valuetypes? */
+ g_assert (obj->vtable->klass->valuetype);
+ return ((char*)obj) + sizeof (MonoObject);
+}
+
/**
* mono_object_isinst:
* @obj: an object
@@ -956,40 +2334,114 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
MonoObject *
mono_object_isinst (MonoObject *obj, MonoClass *klass)
{
- MonoVTable *vt;
- MonoClass *oklass;
+ if (!klass->inited)
+ mono_class_init (klass);
+
+ if (klass->marshalbyref || klass->flags & TYPE_ATTRIBUTE_INTERFACE)
+ return mono_object_isinst_mbyref (obj, klass);
if (!obj)
return NULL;
- vt = obj->vtable;
- oklass = vt->klass;
+ return mono_class_is_assignable_from (klass, obj->vtable->klass) ? obj : NULL;
+}
- if (!klass->inited)
- mono_class_init (klass);
+MonoObject *
+mono_object_isinst_mbyref (MonoObject *obj, MonoClass *klass)
+{
+ MonoVTable *vt;
+
+ if (!obj)
+ return NULL;
+ vt = obj->vtable;
+
if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
- if ((klass->interface_id <= oklass->max_interface_id) &&
- vt->interface_offsets [klass->interface_id])
+ if ((klass->interface_id <= vt->max_interface_id) &&
+ (vt->interface_offsets [klass->interface_id] != 0))
return obj;
- } else {
- if (oklass == mono_defaults.transparent_proxy_class) {
- /* fixme: add check for IRemotingTypeInfo */
- oklass = ((MonoTransparentProxy *)obj)->klass;
+ }
+ else {
+ MonoClass *oklass = vt->klass;
+ if ((oklass == mono_defaults.transparent_proxy_class))
+ oklass = ((MonoTransparentProxy *)obj)->remote_class->proxy_class;
+
+ if ((oklass->idepth >= klass->idepth) && (oklass->supertypes [klass->idepth - 1] == klass))
+ return obj;
+ }
+
+ if (vt->klass == mono_defaults.transparent_proxy_class && ((MonoTransparentProxy *)obj)->custom_type_info)
+ {
+ MonoDomain *domain = mono_domain_get ();
+ MonoObject *res;
+ MonoObject *rp = (MonoObject *)((MonoTransparentProxy *)obj)->rp;
+ MonoClass *rpklass = mono_defaults.iremotingtypeinfo_class;
+ MonoMethod *im = NULL;
+ gpointer pa [2];
+ int i;
+
+ for (i = 0; i < rpklass->method.count; ++i) {
+ if (!strcmp ("CanCastTo", rpklass->methods [i]->name)) {
+ im = rpklass->methods [i];
+ break;
+ }
}
- if (klass->rank) {
- if (oklass->rank == klass->rank &&
- (oklass->element_class->baseval - klass->element_class->baseval) <=
- klass->element_class->diffval)
- return obj;
-
- } else if ((oklass->baseval - klass->baseval) <= klass->diffval)
+
+ im = mono_object_get_virtual_method (rp, im);
+ g_assert (im);
+
+ pa [0] = mono_type_get_object (domain, &klass->byval_arg);
+ pa [1] = obj;
+
+ res = mono_runtime_invoke (im, rp, pa, NULL);
+
+ if (*(MonoBoolean *) mono_object_unbox(res)) {
+ /* Update the vtable of the remote type, so it can safely cast to this new type */
+ mono_upgrade_remote_class (domain, ((MonoTransparentProxy *)obj)->remote_class, klass);
+ obj->vtable = ((MonoTransparentProxy *)obj)->remote_class->vtable;
return obj;
+ }
}
return NULL;
}
+/**
+ * mono_object_castclass_mbyref:
+ * @obj: an object
+ * @klass: a pointer to a class
+ *
+ * Returns: @obj if @obj is derived from @klass, throws an exception otherwise
+ */
+MonoObject *
+mono_object_castclass_mbyref (MonoObject *obj, MonoClass *klass)
+{
+ if (!obj) return NULL;
+ if (mono_object_isinst_mbyref (obj, klass)) return obj;
+
+ mono_raise_exception (mono_exception_from_name (mono_defaults.corlib,
+ "System",
+ "InvalidCastException"));
+ return NULL;
+}
+
+typedef struct {
+ MonoDomain *orig_domain;
+ char *ins;
+ MonoString *res;
+} LDStrInfo;
+
+static void
+str_lookup (MonoDomain *domain, gpointer user_data)
+{
+ LDStrInfo *info = user_data;
+ if (info->res || domain == info->orig_domain)
+ return;
+ mono_domain_lock (domain);
+ info->res = mono_g_hash_table_lookup (domain->ldstr_table, info->ins);
+ mono_domain_unlock (domain);
+}
+
static MonoString*
mono_string_is_interned_lookup (MonoString *str, int insert)
{
@@ -998,15 +2450,12 @@ mono_string_is_interned_lookup (MonoString *str, int insert)
MonoDomain *domain;
char *ins = g_malloc (4 + str->length * 2);
char *p;
- int bloblen;
/* Encode the length */
+ /* Same code as in mono_image_insert_string () */
p = ins;
- mono_metadata_encode_value (2 * str->length, p, &p);
- bloblen = p - ins;
- p = ins;
- mono_metadata_encode_value (bloblen + 2 * str->length, p, &p);
- bloblen = (p - ins) + 2 * str->length;
+ mono_metadata_encode_value (1 | (2 * str->length), p, &p);
+
/*
* ins is stored in the hash table as a key and needs to have the same
* representation as in the metadata: we swap the character bytes on big
@@ -1015,7 +2464,7 @@ mono_string_is_interned_lookup (MonoString *str, int insert)
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
{
int i;
- char *p2 = mono_string_chars (str);
+ char *p2 = (char *)mono_string_chars (str);
for (i = 0; i < str->length; ++i) {
*p++ = p2 [1];
*p++ = p2 [0];
@@ -1037,6 +2486,22 @@ mono_string_is_interned_lookup (MonoString *str, int insert)
mono_g_hash_table_insert (ldstr_table, ins, str);
mono_domain_unlock (domain);
return str;
+ } else {
+ LDStrInfo ldstr_info;
+ ldstr_info.orig_domain = domain;
+ ldstr_info.ins = ins;
+ ldstr_info.res = NULL;
+
+ mono_domain_foreach (str_lookup, &ldstr_info);
+ if (ldstr_info.res) {
+ /*
+ * the string was already interned in some other domain:
+ * intern it in the current one as well.
+ */
+ mono_g_hash_table_insert (ldstr_table, ins, str);
+ mono_domain_unlock (domain);
+ return str;
+ }
}
mono_domain_unlock (domain);
g_free (ins);
@@ -1066,12 +2531,28 @@ mono_string_intern (MonoString *str)
MonoString*
mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 idx)
{
- const char *str, *sig;
+ MONO_ARCH_SAVE_REGS;
+
+ if (image->dynamic)
+ return mono_lookup_dynamic_token (image, MONO_TOKEN_STRING | idx);
+ else
+ return mono_ldstr_metdata_sig (domain, mono_metadata_user_string (image, idx));
+}
+
+/*
+ * mono_ldstr_metdata_sig
+ * @domain: the domain for the string
+ * @sig: the signature of a metadata string
+ *
+ * returns a MonoString for a string stored in the metadata
+ */
+static MonoString*
+mono_ldstr_metdata_sig (MonoDomain *domain, const char* sig)
+{
+ const char *str = sig;
MonoString *o;
size_t len2;
-
- sig = str = mono_metadata_user_string (image, idx);
-
+
mono_domain_lock (domain);
if ((o = mono_g_hash_table_lookup (domain->ldstr_table, sig))) {
mono_domain_unlock (domain);
@@ -1111,14 +2592,17 @@ mono_string_to_utf8 (MonoString *s)
char *as;
GError *error = NULL;
- g_assert (s != NULL);
+ if (s == NULL)
+ return NULL;
if (!s->length)
return g_strdup ("");
as = g_utf16_to_utf8 (mono_string_chars (s), s->length, NULL, NULL, &error);
- if (error)
+ if (error) {
g_warning (error->message);
+ g_error_free (error);
+ }
return as;
}
@@ -1137,7 +2621,8 @@ mono_string_to_utf16 (MonoString *s)
{
char *as;
- g_assert (s != NULL);
+ if (s == NULL)
+ return NULL;
as = g_malloc ((s->length * 2) + 2);
as [(s->length * 2)] = '\0';
@@ -1148,15 +2633,32 @@ mono_string_to_utf16 (MonoString *s)
}
memcpy (as, mono_string_chars(s), s->length * 2);
-
return (gunichar2 *)(as);
}
+/*
+ * Converts a NULL terminated UTF16 string (LPWSTR) to a MonoString
+ */
+MonoString *
+mono_string_from_utf16 (gunichar2 *data)
+{
+ MonoDomain *domain = mono_domain_get ();
+ int len = 0;
+
+ if (!data)
+ return NULL;
+
+ while (data [len]) len++;
+
+ return mono_string_new_utf16 (domain, data, len);
+}
+
static void
default_ex_handler (MonoException *ex)
{
MonoObject *o = (MonoObject*)ex;
g_error ("Exception %s.%s raised in C code", o->vtable->klass->name_space, o->vtable->klass->name);
+ exit (1);
}
static MonoExceptionFunc ex_handler = default_ex_handler;
@@ -1176,6 +2678,16 @@ mono_install_handler (MonoExceptionFunc func)
void
mono_raise_exception (MonoException *ex)
{
+ /*
+ * NOTE: Do NOT annotate this function with G_GNUC_NORETURN, since
+ * that will cause gcc to omit the function epilog, causing problems when
+ * the JIT tries to walk the stack, since the return address on the stack
+ * will point into the next function in the executable, not this one.
+ */
+
+ if (((MonoObject*)ex)->vtable->klass == mono_defaults.threadabortexception_class)
+ mono_thread_current ()->abort_exc = ex;
+
ex_handler (ex);
}
@@ -1200,7 +2712,9 @@ mono_async_result_new (MonoDomain *domain, HANDLE handle, MonoObject *state, gpo
res->data = data;
res->async_state = state;
- res->handle = (MonoObject *)mono_wait_handle_new (domain, handle);
+ if (handle != NULL)
+ res->handle = (MonoObject *) mono_wait_handle_new (domain, handle);
+
res->sync_completed = FALSE;
res->completed = FALSE;
@@ -1223,6 +2737,8 @@ mono_message_init (MonoDomain *domain,
this->args = mono_array_new (domain, mono_defaults.object_class, sig->param_count);
this->arg_types = mono_array_new (domain, mono_defaults.byte_class, sig->param_count);
+ this->async_result = NULL;
+ this->call_type = CallType_Sync;
names = g_new (char *, sig->param_count);
mono_method_get_param_names (method->method, (const char **) names);
@@ -1234,7 +2750,6 @@ mono_message_init (MonoDomain *domain,
}
g_free (names);
-
for (i = 0, j = 0; i < sig->param_count; i++) {
if (sig->params [i]->byref) {
@@ -1244,12 +2759,11 @@ mono_message_init (MonoDomain *domain,
j++;
}
arg_type = 2;
- if (sig->params [i]->attrs & PARAM_ATTRIBUTE_IN)
+ if (!(sig->params [i]->attrs & PARAM_ATTRIBUTE_OUT))
arg_type |= 1;
} else {
arg_type = 1;
}
-
mono_array_set (this->arg_types, guint8, i, arg_type);
}
}
@@ -1272,12 +2786,11 @@ MonoObject *
mono_remoting_invoke (MonoObject *real_proxy, MonoMethodMessage *msg,
MonoObject **exc, MonoArray **out_args)
{
- static MonoMethod *im = NULL;
+ MonoMethod *im = real_proxy->vtable->domain->private_invoke_method;
gpointer pa [4];
/*static MonoObject *(*invoke) (gpointer, gpointer, MonoObject **, MonoArray **) = NULL;*/
- /* FIXME: make this domain dependent */
if (!im) {
MonoClass *klass;
int i;
@@ -1293,6 +2806,7 @@ mono_remoting_invoke (MonoObject *real_proxy, MonoMethodMessage *msg,
}
g_assert (im);
+ real_proxy->vtable->domain->private_invoke_method = im;
}
pa [0] = real_proxy;
@@ -1307,62 +2821,94 @@ MonoObject *
mono_message_invoke (MonoObject *target, MonoMethodMessage *msg,
MonoObject **exc, MonoArray **out_args)
{
- if (target && target->vtable->klass == mono_defaults.transparent_proxy_class) {
+ MonoDomain *domain;
+ MonoMethod *method;
+ MonoMethodSignature *sig;
+ MonoObject *ret;
+ int i, j, outarg_count = 0;
- return mono_remoting_invoke ((MonoObject *)((MonoTransparentProxy *)target)->rp,
- msg, exc, out_args);
+ if (target && target->vtable->klass == mono_defaults.transparent_proxy_class) {
- } else {
- MonoDomain *domain = mono_domain_get ();
- MonoMethod *method = msg->method->method;
- MonoMethodSignature *sig = method->signature;
- int i, j, outarg_count = 0;
-
- for (i = 0; i < sig->param_count; i++) {
- if (sig->params [i]->byref)
- outarg_count++;
+ MonoTransparentProxy* tp = (MonoTransparentProxy *)target;
+ if (tp->remote_class->proxy_class->contextbound && tp->rp->context == (MonoObject *) mono_context_get ()) {
+ target = tp->rp->unwrapped_server;
+ } else {
+ return mono_remoting_invoke ((MonoObject *)tp->rp, msg, exc, out_args);
}
+ }
- *out_args = mono_array_new (domain, mono_defaults.object_class, outarg_count);
- *exc = NULL;
+ domain = mono_domain_get ();
+ method = msg->method->method;
+ sig = method->signature;
- for (i = 0, j = 0; i < sig->param_count; i++) {
- if (sig->params [i]->byref) {
- gpointer arg;
- arg = mono_array_get (msg->args, gpointer, i);
- mono_array_set (*out_args, gpointer, j, arg);
- j++;
- }
- }
+ for (i = 0; i < sig->param_count; i++) {
+ if (sig->params [i]->byref)
+ outarg_count++;
+ }
- return mono_runtime_invoke_array (method, target, msg->args, exc);
+ *out_args = mono_array_new (domain, mono_defaults.object_class, outarg_count);
+ *exc = NULL;
+
+ ret = mono_runtime_invoke_array (method, method->klass->valuetype? mono_object_unbox (target): target, msg->args, exc);
+
+ for (i = 0, j = 0; i < sig->param_count; i++) {
+ if (sig->params [i]->byref) {
+ gpointer arg;
+ arg = mono_array_get (msg->args, gpointer, i);
+ mono_array_set (*out_args, gpointer, j, arg);
+ j++;
+ }
}
+
+ return ret;
}
void
mono_print_unhandled_exception (MonoObject *exc)
{
- char *message = g_strdup ("");
- char *trace = g_strdup ("");
+ char *message = (char *) "";
MonoString *str;
+ MonoMethod *method;
+ MonoClass *klass;
+ gboolean free_message = FALSE;
+ gint i;
if (mono_object_isinst (exc, mono_defaults.exception_class)) {
- if ((str = ((MonoException *)exc)->message))
+ klass = exc->vtable->klass;
+ method = NULL;
+ while (klass && method == NULL) {
+ for (i = 0; i < klass->method.count; ++i) {
+ method = klass->methods [i];
+ if (!strcmp ("ToString", method->name) &&
+ method->signature->param_count == 0 &&
+ method->flags & METHOD_ATTRIBUTE_VIRTUAL &&
+ method->flags & METHOD_ATTRIBUTE_PUBLIC) {
+ break;
+ }
+ method = NULL;
+ }
+
+ if (method == NULL)
+ klass = klass->parent;
+ }
+
+ g_assert (method);
+
+ str = (MonoString *) mono_runtime_invoke (method, exc, NULL, NULL);
+ if (str) {
message = mono_string_to_utf8 (str);
- if ((str = ((MonoException *)exc)->stack_trace))
- trace = mono_string_to_utf8 (str);
+ free_message = TRUE;
+ }
}
- g_warning ("unhandled exception %s.%s: \"%s\"", exc->vtable->klass->name_space,
- exc->vtable->klass->name, message);
+ /*
+ * g_printerr ("\nUnhandled Exception: %s.%s: %s\n", exc->vtable->klass->name_space,
+ * exc->vtable->klass->name, message);
+ */
+ g_printerr ("\nUnhandled Exception: %s\n", message);
- if (trace) {
- g_printerr (trace);
- g_printerr ("\n");
- }
-
- g_free (message);
- g_free (trace);
+ if (free_message)
+ g_free (message);
}
/**
@@ -1390,12 +2936,13 @@ mono_delegate_ctor (MonoObject *this, MonoObject *target, gpointer addr)
if ((ji = mono_jit_info_table_find (domain, addr))) {
method = ji->method;
- delegate->method_info = mono_method_get_object (domain, method);
+ delegate->method_info = mono_method_get_object (domain, method, NULL);
}
if (target && target->vtable->klass == mono_defaults.transparent_proxy_class) {
g_assert (method);
- delegate->method_ptr = arch_create_remoting_trampoline (method);
+ method = mono_marshal_get_remoting_invoke (method);
+ delegate->method_ptr = mono_compile_method (method);
delegate->target = target;
} else {
delegate->method_ptr = addr;
@@ -1403,6 +2950,351 @@ mono_delegate_ctor (MonoObject *this, MonoObject *target, gpointer addr)
}
}
+/**
+ * mono_method_call_message_new:
+ *
+ * Translates arguments pointers into a Message.
+ */
+MonoMethodMessage *
+mono_method_call_message_new (MonoMethod *method, gpointer *params, MonoMethod *invoke,
+ MonoDelegate **cb, MonoObject **state)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoMethodSignature *sig = method->signature;
+ MonoMethodMessage *msg;
+ int i, count, type;
+
+ msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
+
+ if (invoke) {
+ mono_message_init (domain, msg, mono_method_get_object (domain, invoke, NULL), NULL);
+ count = sig->param_count - 2;
+ } else {
+ mono_message_init (domain, msg, mono_method_get_object (domain, method, NULL), NULL);
+ count = sig->param_count;
+ }
+
+ for (i = 0; i < count; i++) {
+ gpointer vpos;
+ MonoClass *class;
+ MonoObject *arg;
+
+ if (sig->params [i]->byref)
+ vpos = *((gpointer *)params [i]);
+ else
+ vpos = params [i];
+
+ type = sig->params [i]->type;
+ class = mono_class_from_mono_type (sig->params [i]);
+
+ if (class->valuetype)
+ arg = mono_value_box (domain, class, vpos);
+ else
+ arg = *((MonoObject **)vpos);
+
+ mono_array_set (msg->args, gpointer, i, arg);
+ }
+
+ if (cb != NULL && state != NULL) {
+ *cb = *((MonoDelegate **)params [i]);
+ i++;
+ *state = *((MonoObject **)params [i]);
+ }
+
+ return msg;
+}
+
+/**
+ * mono_method_return_message_restore:
+ *
+ * Restore results from message based processing back to arguments pointers
+ */
+void
+mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoArray *out_args)
+{
+ MonoMethodSignature *sig = method->signature;
+ int i, j, type, size;
+ for (i = 0, j = 0; i < sig->param_count; i++) {
+ MonoType *pt = sig->params [i];
+
+ if (pt->byref) {
+ char *arg = mono_array_get (out_args, gpointer, j);
+ type = pt->type;
+
+ switch (type) {
+ case MONO_TYPE_VOID:
+ g_assert_not_reached ();
+ break;
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_VALUETYPE: {
+ size = mono_class_value_size (((MonoObject*)arg)->vtable->klass, NULL);
+ memcpy (*((gpointer *)params [i]), arg + sizeof (MonoObject), size);
+ break;
+ }
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_OBJECT:
+ **((MonoObject ***)params [i]) = (MonoObject *)arg;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ j++;
+ }
+ }
+}
+
+/**
+ * mono_load_remote_field:
+ * @this: pointer to an object
+ * @klass: klass of the object containing @field
+ * @field: the field to load
+ * @res: a storage to store the result
+ *
+ * This method is called by the runtime on attempts to load fields of
+ * transparent proxy objects. @this points to such TP, @klass is the class of
+ * the object containing @field. @res is a storage location which can be
+ * used to store the result.
+ *
+ * Returns: an address pointing to the value of field.
+ */
+gpointer
+mono_load_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer *res)
+{
+ static MonoMethod *getter = NULL;
+ MonoDomain *domain = mono_domain_get ();
+ MonoTransparentProxy *tp = (MonoTransparentProxy *) this;
+ MonoClass *field_class;
+ MonoMethodMessage *msg;
+ MonoArray *out_args;
+ MonoObject *exc;
+ gpointer tmp;
+
+ g_assert (this->vtable->klass == mono_defaults.transparent_proxy_class);
+
+ if (!res)
+ res = &tmp;
+
+ if (tp->remote_class->proxy_class->contextbound && tp->rp->context == (MonoObject *) mono_context_get ()) {
+ mono_field_get_value (tp->rp->unwrapped_server, field, res);
+ return res;
+ }
+
+ if (!getter) {
+ int i;
+
+ for (i = 0; i < mono_defaults.object_class->method.count; ++i) {
+ MonoMethod *cm = mono_defaults.object_class->methods [i];
+
+ if (!strcmp (cm->name, "FieldGetter")) {
+ getter = cm;
+ break;
+ }
+ }
+ g_assert (getter);
+ }
+
+ field_class = mono_class_from_mono_type (field->type);
+
+ msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
+ out_args = mono_array_new (domain, mono_defaults.object_class, 1);
+ mono_message_init (domain, msg, mono_method_get_object (domain, getter, NULL), out_args);
+
+ mono_array_set (msg->args, gpointer, 0, mono_string_new (domain, klass->name));
+ mono_array_set (msg->args, gpointer, 1, mono_string_new (domain, field->name));
+
+ mono_remoting_invoke ((MonoObject *)(tp->rp), msg, &exc, &out_args);
+
+ if (exc) mono_raise_exception ((MonoException *)exc);
+
+ *res = mono_array_get (out_args, MonoObject *, 0);
+
+ if (field_class->valuetype) {
+ return ((char *)*res) + sizeof (MonoObject);
+ } else
+ return res;
+}
+
+MonoObject *
+mono_load_remote_field_new (MonoObject *this, MonoClass *klass, MonoClassField *field)
+{
+ static MonoMethod *getter = NULL;
+ MonoDomain *domain = mono_domain_get ();
+ MonoTransparentProxy *tp = (MonoTransparentProxy *) this;
+ MonoClass *field_class;
+ MonoMethodMessage *msg;
+ MonoArray *out_args;
+ MonoObject *exc, *res;
+
+ g_assert (this->vtable->klass == mono_defaults.transparent_proxy_class);
+
+ field_class = mono_class_from_mono_type (field->type);
+
+ if (tp->remote_class->proxy_class->contextbound && tp->rp->context == (MonoObject *) mono_context_get ()) {
+ gpointer val;
+ if (field_class->valuetype) {
+ res = mono_object_new (domain, field_class);
+ val = ((gchar *) res) + sizeof (MonoObject);
+ } else {
+ val = &res;
+ }
+ mono_field_get_value (tp->rp->unwrapped_server, field, val);
+ return res;
+ }
+
+ if (!getter) {
+ int i;
+
+ for (i = 0; i < mono_defaults.object_class->method.count; ++i) {
+ MonoMethod *cm = mono_defaults.object_class->methods [i];
+
+ if (!strcmp (cm->name, "FieldGetter")) {
+ getter = cm;
+ break;
+ }
+ }
+ g_assert (getter);
+ }
+
+ msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
+ out_args = mono_array_new (domain, mono_defaults.object_class, 1);
+ mono_message_init (domain, msg, mono_method_get_object (domain, getter, NULL), out_args);
+
+ mono_array_set (msg->args, gpointer, 0, mono_string_new (domain, klass->name));
+ mono_array_set (msg->args, gpointer, 1, mono_string_new (domain, field->name));
+
+ mono_remoting_invoke ((MonoObject *)(tp->rp), msg, &exc, &out_args);
+
+ if (exc) mono_raise_exception ((MonoException *)exc);
+
+ res = mono_array_get (out_args, MonoObject *, 0);
+
+ return res;
+}
+
+/**
+ * mono_store_remote_field:
+ * @this: pointer to an object
+ * @klass: klass of the object containing @field
+ * @field: the field to load
+ * @val: the value/object to store
+ *
+ * This method is called by the runtime on attempts to store fields of
+ * transparent proxy objects. @this points to such TP, @klass is the class of
+ * the object containing @field. @val is the new value to store in @field.
+ */
+void
+mono_store_remote_field (MonoObject *this, MonoClass *klass, MonoClassField *field, gpointer val)
+{
+ static MonoMethod *setter = NULL;
+ MonoDomain *domain = mono_domain_get ();
+ MonoTransparentProxy *tp = (MonoTransparentProxy *) this;
+ MonoClass *field_class;
+ MonoMethodMessage *msg;
+ MonoArray *out_args;
+ MonoObject *exc;
+ MonoObject *arg;
+
+ g_assert (this->vtable->klass == mono_defaults.transparent_proxy_class);
+
+ field_class = mono_class_from_mono_type (field->type);
+
+ if (tp->remote_class->proxy_class->contextbound && tp->rp->context == (MonoObject *) mono_context_get ()) {
+ if (field_class->valuetype) mono_field_set_value (tp->rp->unwrapped_server, field, val);
+ else mono_field_set_value (tp->rp->unwrapped_server, field, *((MonoObject **)val));
+ return;
+ }
+
+ if (!setter) {
+ int i;
+
+ for (i = 0; i < mono_defaults.object_class->method.count; ++i) {
+ MonoMethod *cm = mono_defaults.object_class->methods [i];
+
+ if (!strcmp (cm->name, "FieldSetter")) {
+ setter = cm;
+ break;
+ }
+ }
+ g_assert (setter);
+ }
+
+ if (field_class->valuetype)
+ arg = mono_value_box (domain, field_class, val);
+ else
+ arg = *((MonoObject **)val);
+
+
+ msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
+ mono_message_init (domain, msg, mono_method_get_object (domain, setter, NULL), NULL);
+
+ mono_array_set (msg->args, gpointer, 0, mono_string_new (domain, klass->name));
+ mono_array_set (msg->args, gpointer, 1, mono_string_new (domain, field->name));
+ mono_array_set (msg->args, gpointer, 2, arg);
+
+ mono_remoting_invoke ((MonoObject *)(tp->rp), msg, &exc, &out_args);
+
+ if (exc) mono_raise_exception ((MonoException *)exc);
+}
+
+void
+mono_store_remote_field_new (MonoObject *this, MonoClass *klass, MonoClassField *field, MonoObject *arg)
+{
+ static MonoMethod *setter = NULL;
+ MonoDomain *domain = mono_domain_get ();
+ MonoTransparentProxy *tp = (MonoTransparentProxy *) this;
+ MonoClass *field_class;
+ MonoMethodMessage *msg;
+ MonoArray *out_args;
+ MonoObject *exc;
+
+ g_assert (this->vtable->klass == mono_defaults.transparent_proxy_class);
+
+ field_class = mono_class_from_mono_type (field->type);
+ if (tp->remote_class->proxy_class->contextbound && tp->rp->context == (MonoObject *) mono_context_get ()) {
+ if (field_class->valuetype) mono_field_set_value (tp->rp->unwrapped_server, field, ((gchar *) arg) + sizeof (MonoObject));
+ else mono_field_set_value (tp->rp->unwrapped_server, field, arg);
+ return;
+ }
+
+ if (!setter) {
+ int i;
+ for (i = 0; i < mono_defaults.object_class->method.count; ++i) {
+ MonoMethod *cm = mono_defaults.object_class->methods [i];
+
+ if (!strcmp (cm->name, "FieldSetter")) {
+ setter = cm;
+ break;
+ }
+ }
+ g_assert (setter);
+ }
+
+ msg = (MonoMethodMessage *)mono_object_new (domain, mono_defaults.mono_method_message_class);
+ mono_message_init (domain, msg, mono_method_get_object (domain, setter, NULL), NULL);
+
+ mono_array_set (msg->args, gpointer, 0, mono_string_new (domain, klass->name));
+ mono_array_set (msg->args, gpointer, 1, mono_string_new (domain, field->name));
+ mono_array_set (msg->args, gpointer, 2, arg);
+
+ mono_remoting_invoke ((MonoObject *)(tp->rp), msg, &exc, &out_args);
+
+ if (exc) mono_raise_exception ((MonoException *)exc);
+}
diff --git a/mono/metadata/object.h b/mono/metadata/object.h
index baf55d5bdfe..e448a74ca1f 100644
--- a/mono/metadata/object.h
+++ b/mono/metadata/object.h
@@ -2,58 +2,23 @@
#define _MONO_CLI_OBJECT_H_
#include <mono/metadata/class.h>
-#include <mono/metadata/threads-types.h>
-
-#if 1
-#define mono_assert(expr) G_STMT_START{ \
- if (!(expr)) \
- { \
- MonoException *ex; \
- char *msg = g_strdup_printf ("file %s: line %d (%s): " \
- "assertion failed: (%s)", __FILE__, __LINE__, \
- __PRETTY_FUNCTION__, #expr); \
- ex = mono_get_exception_execution_engine (msg); \
- g_free (msg); \
- mono_raise_exception (ex); \
- }; }G_STMT_END
-
-#define mono_assert_not_reached() G_STMT_START{ \
- MonoException *ex; \
- char *msg = g_strdup_printf ("file %s: line %d (%s): " \
- "should not be reached", __FILE__, __LINE__, __PRETTY_FUNCTION__); \
- ex = mono_get_exception_execution_engine (msg); \
- g_free (msg); \
- mono_raise_exception (ex); \
-}G_STMT_END
-#else
-#define mono_assert(expr) g_assert(expr)
-#define mono_assert_not_reached() g_assert_not_reached()
-#endif
-
-#define MONO_CHECK_ARG(arg, expr) G_STMT_START{ \
- if (!(expr)) \
- { \
- MonoException *ex; \
- char *msg = g_strdup_printf ("assertion `%s' failed", \
- #expr); \
- if (arg) {} /* check if the name exists */ \
- ex = mono_get_exception_argument (#arg, msg); \
- g_free (msg); \
- mono_raise_exception (ex); \
- }; }G_STMT_END
-
-#define MONO_CHECK_ARG_NULL(arg) G_STMT_START{ \
- if (arg == NULL) \
- { \
- MonoException *ex; \
- if (arg) {} /* check if the name exists */ \
- ex = mono_get_exception_argument_null (#arg); \
- mono_raise_exception (ex); \
- }; }G_STMT_END
typedef guchar MonoBoolean;
typedef struct _MonoReflectionMethod MonoReflectionMethod;
+typedef struct _MonoReflectionAssembly MonoReflectionAssembly;
+typedef struct _MonoReflectionModule MonoReflectionModule;
+typedef struct _MonoReflectionField MonoReflectionField;
+typedef struct _MonoReflectionProperty MonoReflectionProperty;
+typedef struct _MonoReflectionEvent MonoReflectionEvent;
+typedef struct _MonoReflectionType MonoReflectionType;
+typedef struct _MonoDelegate MonoDelegate;
+typedef struct _MonoException MonoException;
+typedef struct _MonoThreadsSync MonoThreadsSync;
+typedef struct _MonoThread MonoThread;
+typedef struct _MonoDynamicAssembly MonoDynamicAssembly;
+typedef struct _MonoDynamicImage MonoDynamicImage;
+typedef struct _MonoReflectionMethodBody MonoReflectionMethodBody;
typedef struct {
MonoVTable *vtable;
@@ -81,97 +46,16 @@ typedef struct {
gunichar2 chars [MONO_ZERO_LEN_ARRAY];
} MonoString;
-typedef struct {
- MonoObject object;
- gint32 capacity;
- gint32 length;
- MonoArray *chars;
-} MonoStringBuilder;
-
-typedef struct {
- MonoObject object;
- MonoType *type;
-} MonoReflectionType;
-
-typedef struct {
- MonoObject object;
- MonoArray *trace_ips;
- MonoObject *inner_ex;
- MonoString *message;
- MonoString *help_link;
- MonoString *class_name;
- MonoString *stack_trace;
- MonoString *remote_stack_trace;
- gint32 *remote_stack_index;
- gint32 hresult;
- MonoString *source;
-} MonoException;
-
-typedef struct {
- MonoException base;
-} MonoSystemException;
-
-typedef struct {
- MonoSystemException base;
- MonoString *param_name;
-} MonoArgumentException;
-
-typedef struct {
- MonoObject object;
- MonoObject *async_state;
- MonoObject *handle;
- MonoObject *async_delegate;
- gpointer data;
- MonoBoolean sync_completed;
- MonoBoolean completed;
- MonoBoolean endinvoke_called;
-} MonoAsyncResult;
-
-typedef struct {
- MonoObject object;
- gpointer handle;
- MonoBoolean disposed;
-} MonoWaitHandle;
-
-typedef struct {
- MonoObject object;
- MonoReflectionType *class_to_proxy;
-} MonoRealProxy;
-
-typedef struct {
- MonoObject object;
- MonoRealProxy *rp;
- MonoClass *klass;
-} MonoTransparentProxy;
-
-typedef struct {
- MonoObject obj;
- MonoReflectionMethod *method;
- MonoArray *args;
- MonoArray *names;
- MonoArray *arg_types;
- MonoObject *ctx;
- MonoObject *rval;
- MonoObject *exc;
-} MonoMethodMessage;
-
-typedef struct {
- MonoObject obj;
- gint32 il_offset;
- gint32 native_offset;
- MonoReflectionMethod *method;
- MonoString *filename;
- gint32 line;
- gint32 column;
-} MonoStackFrame;
-
-typedef MonoObject* (*MonoInvokeFunc) (MonoMethod *method, void *obj, void **params, MonoObject **exc);
+typedef MonoObject* (*MonoInvokeFunc) (MonoMethod *method, void *obj, void **params, MonoObject **exc);
+typedef gpointer (*MonoCompileFunc) (MonoMethod *method);
+typedef void (*MonoFreeMethodFunc) (MonoMethod *method);
+typedef void (*MonoMainThreadFunc) (gpointer user_data);
#define mono_object_class(obj) (((MonoObject*)(obj))->vtable->klass)
#define mono_object_domain(obj) (((MonoObject*)(obj))->vtable->domain)
#define mono_array_length(array) ((array)->max_length)
-#define mono_array_addr(array,type,index) ( ((char*)(array)->vector) + sizeof (type) * (index) )
+#define mono_array_addr(array,type,index) ((type*) mono_array_addr_with_size (array, sizeof (type), index))
#define mono_array_addr_with_size(array,size,index) ( ((char*)(array)->vector) + (size) * (index) )
#define mono_array_get(array,type,index) ( *(type*)mono_array_addr ((array), type, (index)) )
#define mono_array_set(array,type,index,value) \
@@ -183,92 +67,118 @@ typedef MonoObject* (*MonoInvokeFunc) (MonoMethod *method, void *obj, voi
#define mono_string_chars(s) ((gunichar2*)(s)->chars)
#define mono_string_length(s) ((s)->length)
-void *
-mono_object_allocate (size_t size);
-
MonoObject *
-mono_object_new (MonoDomain *domain, MonoClass *klass);
+mono_object_new (MonoDomain *domain, MonoClass *klass);
MonoObject *
mono_object_new_specific (MonoVTable *vtable);
+/* can be used for classes without finalizer in non-profiling mode */
+MonoObject *
+mono_object_new_fast (MonoVTable *vtable);
+
+MonoObject *
+mono_object_new_alloc_specific (MonoVTable *vtable);
+
+void*
+mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean *pass_size_in_words);
+
MonoObject *
mono_object_new_from_token (MonoDomain *domain, MonoImage *image, guint32 token);
MonoArray*
-mono_array_new (MonoDomain *domain, MonoClass *eclass, guint32 n);
+mono_array_new (MonoDomain *domain, MonoClass *eclass, guint32 n);
MonoArray*
-mono_array_new_full (MonoDomain *domain, MonoClass *array_class,
+mono_array_new_full (MonoDomain *domain, MonoClass *array_class,
guint32 *lengths, guint32 *lower_bounds);
MonoArray *
-mono_array_new_specific (MonoVTable *vtable, guint32 n);
+mono_array_new_specific (MonoVTable *vtable, guint32 n);
MonoArray*
-mono_array_clone (MonoArray *array);
+mono_array_clone (MonoArray *array);
MonoString*
-mono_string_new_utf16 (MonoDomain *domain, const guint16 *text, gint32 len);
+mono_string_new_utf16 (MonoDomain *domain, const guint16 *text, gint32 len);
MonoString*
-mono_string_new_size (MonoDomain *domain, gint32 len);
+mono_string_new_size (MonoDomain *domain, gint32 len);
MonoString*
-mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 str_index);
+mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 str_index);
MonoString*
-mono_string_is_interned (MonoString *str);
+mono_string_is_interned (MonoString *str);
MonoString*
-mono_string_intern (MonoString *str);
+mono_string_intern (MonoString *str);
MonoString*
-mono_string_new (MonoDomain *domain, const char *text);
+mono_string_new (MonoDomain *domain, const char *text);
MonoString*
-mono_string_new_wrapper (const char *text);
+mono_string_new_wrapper (const char *text);
MonoString*
-mono_string_new_len (MonoDomain *domain, const char *text, guint length);
+mono_string_new_len (MonoDomain *domain, const char *text, guint length);
char *
-mono_string_to_utf8 (MonoString *string_obj);
+mono_string_to_utf8 (MonoString *string_obj);
gunichar2 *
-mono_string_to_utf16 (MonoString *string_obj);
+mono_string_to_utf16 (MonoString *string_obj);
-void
-mono_object_free (MonoObject *o);
+MonoString *
+mono_string_from_utf16 (gunichar2 *data);
MonoObject *
-mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer val);
-
+mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer val);
+
+MonoDomain*
+mono_object_get_domain (MonoObject *obj);
+
+MonoClass*
+mono_object_get_class (MonoObject *obj);
+
+gpointer
+mono_object_unbox (MonoObject *obj);
+
MonoObject *
-mono_object_clone (MonoObject *obj);
+mono_object_clone (MonoObject *obj);
MonoObject *
-mono_object_isinst (MonoObject *obj, MonoClass *klass);
+mono_object_isinst (MonoObject *obj, MonoClass *klass);
-typedef void (*MonoExceptionFunc) (MonoException *ex);
+MonoObject *
+mono_object_isinst_mbyref (MonoObject *obj, MonoClass *klass);
-void
-mono_install_handler (MonoExceptionFunc func);
+MonoObject *
+mono_object_castclass_mbyref (MonoObject *obj, MonoClass *klass);
+
+gboolean
+mono_monitor_try_enter (MonoObject *obj, guint32 ms);
+
+gboolean
+mono_monitor_enter (MonoObject *obj);
+
+void
+mono_monitor_exit (MonoObject *obj);
void
-mono_raise_exception (MonoException *ex);
+mono_raise_exception (MonoException *ex);
void
-mono_runtime_object_init (MonoObject *this);
+mono_runtime_object_init (MonoObject *this_obj);
void
-mono_runtime_class_init (MonoClass *klass);
+mono_runtime_class_init (MonoVTable *vtable);
-void
-mono_install_runtime_invoke (MonoInvokeFunc func);
+MonoMethod*
+mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method);
MonoObject*
-mono_runtime_invoke (MonoMethod *method, void *obj, void **params,
+mono_runtime_invoke (MonoMethod *method, void *obj, void **params,
MonoObject **exc);
MonoMethod *
@@ -285,32 +195,30 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
MonoArray*
mono_runtime_get_main_args (void);
+void
+mono_runtime_exec_managed_code (MonoDomain *domain,
+ MonoMainThreadFunc main_func,
+ gpointer main_args);
+
int
-mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
- MonoObject **exc, MonoAssembly *app);
+mono_runtime_run_main (MonoMethod *method, int argc, char* argv[],
+ MonoObject **exc);
int
-mono_runtime_exec_main (MonoMethod *method, MonoArray *args,
+mono_runtime_exec_main (MonoMethod *method, MonoArray *args,
MonoObject **exc);
-MonoAsyncResult *
-mono_async_result_new (MonoDomain *domain, HANDLE handle,
- MonoObject *state, gpointer data);
+gpointer
+mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer *res);
-MonoWaitHandle *
-mono_wait_handle_new (MonoDomain *domain, HANDLE handle);
+MonoObject *
+mono_load_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field);
void
-mono_message_init (MonoDomain *domain, MonoMethodMessage *this,
- MonoReflectionMethod *method, MonoArray *out_args);
+mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, gpointer val);
-MonoObject *
-mono_remoting_invoke (MonoObject *real_proxy, MonoMethodMessage *msg,
- MonoObject **exc, MonoArray **out_args);
-
-MonoObject *
-mono_message_invoke (MonoObject *target, MonoMethodMessage *msg,
- MonoObject **exc, MonoArray **out_args);
+void
+mono_store_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg);
void
mono_unhandled_exception (MonoObject *exc);
@@ -318,9 +226,58 @@ mono_unhandled_exception (MonoObject *exc);
void
mono_print_unhandled_exception (MonoObject *exc);
+gpointer
+mono_compile_method (MonoMethod *method);
+
void
-mono_delegate_ctor (MonoObject *this, MonoObject *target, gpointer addr);
+mono_runtime_free_method (MonoMethod *method);
+
+MonoRemoteClass*
+mono_remote_class (MonoDomain *domain, MonoString *class_name, MonoClass *proxy_class);
+void
+mono_upgrade_remote_class (MonoDomain *domain, MonoRemoteClass *remote_class, MonoClass *klass);
+
+/* accessors for fields and properties */
+void
+mono_field_set_value (MonoObject *obj, MonoClassField *field, void *value);
+
+void
+mono_field_static_set_value (MonoVTable *vt, MonoClassField *field, void *value);
+
+void
+mono_field_get_value (MonoObject *obj, MonoClassField *field, void *value);
+
+void
+mono_field_static_get_value (MonoVTable *vt, MonoClassField *field, void *value);
+
+MonoObject *
+mono_field_get_value_object (MonoDomain *domain, MonoClassField *field, MonoObject *obj);
+
+void
+mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
+
+MonoObject*
+mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
+
+/* GC handles support
+ *
+ * A handle can be created to refer to a managed object and either prevent it
+ * from being garbage collected or moved or to be able to know if it has been
+ * collected or not (weak references).
+ * mono_gchandle_new () is used to prevent an object from being garbage collected
+ * until mono_gchandle_free() is called. Use a TRUE value for the pinned argument to
+ * prevent the object from being moved (this should be avoided as much as possible
+ * and this should be used only for shorts periods of time or performance will suffer).
+ * To create a weakref use mono_gchandle_new_weakref (): track_resurrection should
+ * usually be false (see the GC docs for more details).
+ * mono_gchandle_get_target () can be used to get the object referenced by both kinds
+ * of handle: for a weakref handle, if an object has been collected, it will return NULL.
+ */
+guint32 mono_gchandle_new (MonoObject *obj, gboolean pinned);
+guint32 mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection);
+MonoObject* mono_gchandle_get_target (guint32 gchandle);
+void mono_gchandle_free (guint32 gchandle);
#endif
diff --git a/mono/metadata/opcodes.c b/mono/metadata/opcodes.c
index 9718ff5ac44..f8b43023472 100644
--- a/mono/metadata/opcodes.c
+++ b/mono/metadata/opcodes.c
@@ -8,23 +8,84 @@
*/
#include <mono/metadata/opcodes.h>
#include <stddef.h> /* for NULL */
+#include <config.h>
+
+#define MONO_PREFIX1_OFFSET MONO_CEE_ARGLIST
+#define MONO_CUSTOM_PREFIX_OFFSET MONO_CEE_MONO_ICALL
#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
- { Mono ## e, MONO_FLOW_ ## j, ((g-1)<<8) | i },
+ { Mono ## e, MONO_FLOW_ ## j, MONO_ ## a },
const MonoOpcode
-mono_opcodes [MONO_N_OPCODES] = {
+mono_opcodes [MONO_CEE_LAST + 1] = {
#include "mono/cil/opcode.def"
{0}
};
#undef OPDEF
+#ifdef HAVE_ARRAY_ELEM_INIT
+#define MSGSTRFIELD(line) MSGSTRFIELD1(line)
+#define MSGSTRFIELD1(line) str##line
+static const struct msgstr_t {
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) char MSGSTRFIELD(__LINE__) [sizeof (b)];
+#include "mono/cil/opcode.def"
+#undef OPDEF
+} opstr = {
#define OPDEF(a,b,c,d,e,f,g,h,i,j) b,
+#include "mono/cil/opcode.def"
+#undef OPDEF
+};
+static const gint16 opidx [] = {
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) [MONO_ ## a] = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)),
+#include "mono/cil/opcode.def"
+#undef OPDEF
+};
+
+const char*
+mono_opcode_name (int opcode)
+{
+ return (const char*)&opstr + opidx [opcode];
+}
-const char* const
-mono_opcode_names [MONO_N_OPCODES] = {
+#else
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) b,
+static const char* const
+mono_opcode_names [MONO_CEE_LAST + 1] = {
#include "mono/cil/opcode.def"
NULL
};
+const char*
+mono_opcode_name (int opcode)
+{
+ return mono_opcode_names [opcode];
+}
+
+#endif
+
+MonoOpcodeEnum
+mono_opcode_value (const guint8 **ip, const guint8 *end)
+{
+ MonoOpcodeEnum res;
+ const guint8 *p = *ip;
+
+ if (p >= end)
+ return -1;
+ if (*p == 0xfe) {
+ ++p;
+ if (p >= end)
+ return -1;
+ res = *p + MONO_PREFIX1_OFFSET;
+ } else if (*p == MONO_CUSTOM_PREFIX) {
+ ++p;
+ if (p >= end)
+ return -1;
+ res = *p + MONO_CUSTOM_PREFIX_OFFSET;
+ } else {
+ res = *p;
+ }
+ *ip = p;
+ return res;
+}
+
diff --git a/mono/metadata/opcodes.h b/mono/metadata/opcodes.h
index c5a3e6926c7..60c6a53e036 100644
--- a/mono/metadata/opcodes.h
+++ b/mono/metadata/opcodes.h
@@ -10,6 +10,20 @@
* (C) 2002 Ximian, Inc.
*/
+#include <glib.h>
+
+#define MONO_CUSTOM_PREFIX 0xf0
+
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
+ MONO_ ## a,
+
+typedef enum {
+#include "mono/cil/opcode.def"
+ MONO_CEE_LAST
+} MonoOpcodeEnum;
+
+#undef OPDEF
+
enum {
MONO_FLOW_NEXT,
MONO_FLOW_BRANCH,
@@ -46,9 +60,12 @@ typedef struct {
unsigned short opval;
} MonoOpcode;
-#define MONO_N_OPCODES 300
+extern const MonoOpcode mono_opcodes [];
+
+const char*
+mono_opcode_name (int opcode);
-extern const MonoOpcode mono_opcodes [MONO_N_OPCODES];
-extern const char* const mono_opcode_names [MONO_N_OPCODES];
+MonoOpcodeEnum
+mono_opcode_value (const guint8 **ip, const guint8 *end);
#endif /* __MONO_METADATA_OPCODES_H__ */
diff --git a/mono/metadata/pedump.c b/mono/metadata/pedump.c
index 94ed15dffb4..eec1b6b9ef6 100644
--- a/mono/metadata/pedump.c
+++ b/mono/metadata/pedump.c
@@ -17,6 +17,14 @@
#include "mono-endian.h"
#include "verify.h"
#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/metadata/metadata-internals.h>
+#include <mono/metadata/rawbuffer.h>
+#include <mono/metadata/class-internals.h>
+#include "mono/utils/mono-digest.h"
gboolean dump_data = TRUE;
gboolean verify_pe = FALSE;
@@ -119,6 +127,45 @@ dent (const char *label, MonoPEDirEntry de)
}
static void
+dump_blob (const char *desc, const char* p, guint32 size)
+{
+ int i;
+
+ printf ("%s", desc);
+ if (!p) {
+ printf (" none\n");
+ return;
+ }
+
+ for (i = 0; i < size; ++i) {
+ if (!(i % 16))
+ printf ("\n\t");
+ printf (" %02X", p [i] & 0xFF);
+ }
+ printf ("\n");
+}
+
+static void
+dump_public_key (MonoImage *m)
+{
+ guint32 size;
+ const char *p;
+
+ p = mono_image_get_public_key (m, &size);
+ dump_blob ("\nPublic key:", p, size);
+}
+
+static void
+dump_strong_name (MonoImage *m)
+{
+ guint32 size;
+ const char *p;
+
+ p = mono_image_get_strong_name (m, &size);
+ dump_blob ("\nStrong name:", p, size);
+}
+
+static void
dump_datadir (MonoPEDatadir *dd)
{
printf ("\nData directories:\n");
@@ -192,10 +239,11 @@ dump_cli_header (MonoCLIHeader *ch)
printf ("\n");
printf (" CLI header size: %d\n", ch->ch_size);
printf (" Runtime required: %d.%d\n", ch->ch_runtime_major, ch->ch_runtime_minor);
- printf (" Flags: %s, %s, %s\n",
+ printf (" Flags: %s, %s, %s, %s\n",
(ch->ch_flags & CLI_FLAGS_ILONLY ? "ilonly" : "contains native"),
(ch->ch_flags & CLI_FLAGS_32BITREQUIRED ? "32bits" : "32/64"),
- (ch->ch_flags & CLI_FLAGS_ILONLY ? "trackdebug" : "no-trackdebug"));
+ (ch->ch_flags & CLI_FLAGS_ILONLY ? "trackdebug" : "no-trackdebug"),
+ (ch->ch_flags & CLI_FLAGS_STRONGNAMESIGNED ? "strongnamesigned" : "notsigned"));
dent (" Metadata", ch->ch_metadata);
hex32 ("Entry Point Token", ch->ch_entry_point);
dent (" Resources at", ch->ch_resources);
@@ -265,6 +313,8 @@ dump_dotnet_iinfo (MonoImage *image)
dump_dotnet_header (&iinfo->cli_header);
dump_sections (iinfo);
dump_cli_header (&iinfo->cli_cli_header);
+ dump_strong_name (image);
+ dump_public_key (image);
dump_metadata (image);
dump_methoddef (image, iinfo->cli_cli_header.ch_entry_point);
@@ -274,6 +324,7 @@ static void
dump_verify_info (MonoImage *image, int flags)
{
GSList *errors, *tmp;
+ int count = 0;
const char* desc [] = {
"Ok", "Error", "Warning", NULL, "CLS"
};
@@ -283,14 +334,46 @@ dump_verify_info (MonoImage *image, int flags)
for (tmp = errors; tmp; tmp = tmp->next) {
MonoVerifyInfo *info = tmp->data;
g_print ("%s: %s\n", desc [info->status], info->message);
+ if (info->status == MONO_VERIFY_ERROR)
+ count++;
}
mono_free_verify_list (errors);
+
+ if (flags & (MONO_VERIFY_ALL + 1)) { /* verify code */
+ int i;
+ MonoTableInfo *m = &image->tables [MONO_TABLE_METHOD];
+
+ for (i = 0; i < m->rows; ++i) {
+ MonoMethod *method;
+
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i+1), NULL);
+ errors = mono_method_verify (method, flags);
+ if (errors) {
+ char *sig;
+ MonoClass *klass = mono_method_get_class (method);
+ sig = mono_signature_get_desc (mono_method_signature (method), FALSE);
+ g_print ("In method: %s.%s::%s(%s)\n", mono_class_get_namespace (klass), mono_class_get_name (klass), mono_method_get_name (method), sig);
+ g_free (sig);
+ }
+
+ for (tmp = errors; tmp; tmp = tmp->next) {
+ MonoVerifyInfo *info = tmp->data;
+ g_print ("%s: %s\n", desc [info->status], info->message);
+ if (info->status == MONO_VERIFY_ERROR)
+ count++;
+ }
+ mono_free_verify_list (errors);
+ }
+ }
+
+ if (count)
+ g_print ("Error count: %d\n", count);
}
static void
usage (void)
{
- printf ("Usage is: pedump [--verify error,warn,cls,all] file.exe\n");
+ printf ("Usage is: pedump [--verify error,warn,cls,all,code] file.exe\n");
exit (1);
}
@@ -300,8 +383,8 @@ main (int argc, char *argv [])
MonoImage *image;
char *file = NULL;
char *flags = NULL;
- const char *flag_desc [] = {"error", "warn", "cls", "all", NULL};
- guint flag_vals [] = {MONO_VERIFY_ERROR, MONO_VERIFY_WARNING, MONO_VERIFY_CLS, MONO_VERIFY_ALL};
+ const char *flag_desc [] = {"error", "warn", "cls", "all", "code", NULL};
+ guint flag_vals [] = {MONO_VERIFY_ERROR, MONO_VERIFY_WARNING, MONO_VERIFY_CLS, MONO_VERIFY_ALL, MONO_VERIFY_ALL + 1};
int i;
for (i = 1; i < argc; i++){
@@ -325,6 +408,12 @@ main (int argc, char *argv [])
if (!file)
usage ();
+ mono_metadata_init ();
+ mono_raw_buffer_init ();
+ mono_images_init ();
+ mono_assemblies_init ();
+ mono_loader_init ();
+
image = mono_image_open (file, NULL);
if (!image){
fprintf (stderr, "Can not open image %s\n", file);
@@ -336,6 +425,7 @@ main (int argc, char *argv [])
if (verify_pe) {
int f = 0;
char *tok = strtok (flags, ",");
+ MonoAssembly *assembly;
while (tok) {
for (i = 0; flag_desc [i]; ++i) {
if (strcmp (tok, flag_desc [i]) == 0) {
@@ -347,10 +437,11 @@ main (int argc, char *argv [])
g_print ("Unknown verify flag %s\n", tok);
tok = strtok (NULL, ",");
}
- dump_verify_info (image, f);
- }
-
- mono_image_close (image);
+ mono_init (file);
+ assembly = mono_assembly_open (file, NULL);
+ dump_verify_info (assembly->image, f);
+ } else
+ mono_image_close (image);
return 0;
}
diff --git a/mono/metadata/private.h b/mono/metadata/private.h
index ce301839829..dd1de68fb18 100644
--- a/mono/metadata/private.h
+++ b/mono/metadata/private.h
@@ -72,7 +72,7 @@ const char *mono_meta_table_name (int table);
/* Internal functions */
void mono_metadata_compute_table_bases (MonoImage *meta);
-MonoMetaTable *mono_metadata_get_table (MonoMetaTableEnum table);
+const MonoMetaTable *mono_metadata_get_table (MonoMetaTableEnum table);
#endif /* __MONO_METADATA_PRIVATE_H__ */
diff --git a/mono/metadata/process.c b/mono/metadata/process.c
index d94d41045dd..f1080b3b391 100644
--- a/mono/metadata/process.c
+++ b/mono/metadata/process.c
@@ -10,6 +10,7 @@
#include <config.h>
#include <glib.h>
+#include <string.h>
#include <mono/metadata/object.h>
#include <mono/metadata/process.h>
@@ -17,18 +18,24 @@
#include <mono/metadata/appdomain.h>
#include <mono/metadata/image.h>
#include <mono/metadata/cil-coff.h>
+#include <mono/metadata/exception.h>
+#include <mono/utils/strenc.h>
#include <mono/io-layer/io-layer.h>
+/* FIXME: fix this code to not depend so much on the inetrnals */
+#include <mono/metadata/class-internals.h>
#undef DEBUG
-HANDLE ves_icall_System_Diagnostics_Process_GetCurrentProcess_internal (void)
+HANDLE ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
{
HANDLE handle;
+ MONO_ARCH_SAVE_REGS;
+
/* GetCurrentProcess returns a pseudo-handle, so use
* OpenProcess instead
*/
- handle=OpenProcess (PROCESS_ALL_ACCESS, TRUE, GetCurrentProcessId ());
+ handle=OpenProcess (PROCESS_ALL_ACCESS, TRUE, pid);
if(handle==NULL) {
/* FIXME: Throw an exception */
@@ -40,12 +47,16 @@ HANDLE ves_icall_System_Diagnostics_Process_GetCurrentProcess_internal (void)
guint32 ves_icall_System_Diagnostics_Process_GetPid_internal (void)
{
+ MONO_ARCH_SAVE_REGS;
+
return(GetCurrentProcessId ());
}
void ves_icall_System_Diagnostics_Process_Process_free_internal (MonoObject *this,
HANDLE process)
{
+ MONO_ARCH_SAVE_REGS;
+
#ifdef THREAD_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": Closing process %p, handle %p",
this, process);
@@ -181,18 +192,22 @@ typedef struct {
static gpointer process_get_versioninfo_block (gpointer data,
version_data *block)
{
- block->data_len=*(((guint16 *)data)++);
- block->value_len=*(((guint16 *)data)++);
+ block->data_len=*((guint16 *)data);
+ data = (char *)data + sizeof(guint16);
+ block->value_len=*((guint16 *)data);
+ data = (char *)data + sizeof(guint16);
/* No idea what the type is supposed to indicate */
- block->type=*(((guint16 *)data)++);
+ block->type=*((guint16 *)data);
+ data = (char *)data + sizeof(guint16);
block->key=((gunichar2 *)data);
/* skip over the key (including the terminator) */
data=((gunichar2 *)data)+(unicode_chars (block->key)+1);
/* align on a 32-bit boundary */
- data=(gpointer)(((unsigned)data+3) & (~3));
+ data=(gpointer)((char *)data + 3);
+ data=(gpointer)((char *)data - (GPOINTER_TO_INT(data) & 3));
return(data);
}
@@ -215,7 +230,11 @@ static gpointer process_read_var_block (MonoObject *filever, gpointer data_ptr,
return(data_ptr);
}
-/* Returns a pointer to the byte following the String block */
+/* Returns a pointer to the byte following the String block, or NULL
+ * if the data read hits padding. We can't recover from this because
+ * the data length does not include padding bytes, so it's not
+ * possible to just return the start position + length.
+ */
static gpointer process_read_string_block (MonoObject *filever,
gpointer data_ptr,
guint16 data_len,
@@ -290,17 +309,31 @@ static gpointer process_read_string_block (MonoObject *filever,
gunichar2 *value;
/* align on a 32-bit boundary */
- data_ptr=(gpointer)(((unsigned)data_ptr+3) & (~3));
+ data_ptr=(gpointer)((char *)data_ptr + 3);
+ data_ptr=(gpointer)((char *)data_ptr -
+ (GPOINTER_TO_INT(data_ptr) & 3));
data_ptr=process_get_versioninfo_block (data_ptr, &block);
+ if(block.data_len==0) {
+ /* We must have hit padding, so give up
+ * processing now
+ */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Hit 0-length block, giving up");
+#endif
+ return(NULL);
+ }
+
string_len=string_len+block.data_len;
value=(gunichar2 *)data_ptr;
/* Skip over the value */
data_ptr=((gunichar2 *)data_ptr)+block.value_len;
-
+
if(store==TRUE) {
if(!memcmp (block.key, &comments_key,
unicode_bytes (block.key))) {
+
process_set_field_string (filever, "comments", value, unicode_chars (value));
} else if (!memcmp (block.key, &compname_key,
unicode_bytes (block.key))) {
@@ -346,24 +379,19 @@ static gpointer process_read_string_block (MonoObject *filever,
return(data_ptr);
}
-/* returns a pointer to the byte following the Stringtable block */
+/* returns a pointer to the byte following the Stringtable block, or
+ * NULL if the data read hits padding. We can't recover from this
+ * because the data length does not include padding bytes, so it's not
+ * possible to just return the start position + length
+ */
static gpointer process_read_stringtable_block (MonoObject *filever,
gpointer data_ptr,
guint16 data_len)
{
version_data block;
+ gchar *language;
guint16 string_len=36; /* length of the StringFileInfo block */
- /* Specifies language-neutral unicode string block */
- guchar uni_key[]= {'0', '\0', '0', '\0', '0', '\0', '0', '\0',
- '0', '\0', '4', '\0', 'b', '\0', '0', '\0',
- '\0', '\0'
- };
- guchar uni_key_uc[]= {'0', '\0', '0', '\0', '0', '\0', '0', '\0',
- '0', '\0', '4', '\0', 'B', '\0', '0', '\0',
- '\0', '\0'
- };
-
/* data_ptr is pointing at an array of StringTable blocks,
* with total length (not including alignment padding) of
* data_len.
@@ -371,13 +399,26 @@ static gpointer process_read_stringtable_block (MonoObject *filever,
while(string_len<data_len) {
/* align on a 32-bit boundary */
- data_ptr=(gpointer)(((unsigned)data_ptr+3) & (~3));
+ data_ptr=(gpointer)((char *)data_ptr + 3);
+ data_ptr=(gpointer)((char *)data_ptr -
+ (GPOINTER_TO_INT(data_ptr) & 3));
data_ptr=process_get_versioninfo_block (data_ptr, &block);
+ if(block.data_len==0) {
+ /* We must have hit padding, so give up
+ * processing now
+ */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Hit 0-length block, giving up");
+#endif
+ return(NULL);
+ }
string_len=string_len+block.data_len;
-
- if(!memcmp (block.key, &uni_key, unicode_bytes (block.key)) ||
- !memcmp (block.key, &uni_key_uc, unicode_bytes (block.key))) {
+
+ language = g_utf16_to_utf8 (block.key, unicode_bytes (block.key), NULL, NULL, NULL);
+ g_strdown (language);
+ if (!strcmp (language, "007f04b0") || !strcmp (language, "000004b0")) {
/* Got the one we're interested in */
process_set_field_string_utf8 (filever, "language",
"Language Neutral");
@@ -393,6 +434,15 @@ static gpointer process_read_stringtable_block (MonoObject *filever,
block.data_len,
FALSE);
}
+ g_free (language);
+
+ if(data_ptr==NULL) {
+ /* Child block hit padding */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Child block hit 0-length block, giving up");
+#endif
+ return(NULL);
+ }
}
return(data_ptr);
@@ -470,7 +520,7 @@ static void process_get_fileversion (MonoObject *filever, MonoImage *image)
return;
}
- data=mono_cli_rva_map (image->image_info,
+ data=mono_image_rva_map (image,
version_info->rde_data_offset);
if(data==NULL) {
return;
@@ -501,7 +551,8 @@ static void process_get_fileversion (MonoObject *filever, MonoImage *image)
return;
}
- ffi=(((VS_FIXEDFILEINFO *)data_ptr)++);
+ ffi=((VS_FIXEDFILEINFO *)data_ptr);
+ data_ptr = (char *)data_ptr + sizeof(VS_FIXEDFILEINFO);
if((ffi->dwSignature!=VS_FFI_SIGNATURE) ||
(ffi->dwStrucVersion!=VS_FFI_STRUCVERSION)) {
#ifdef DEBUG
@@ -520,9 +571,22 @@ static void process_get_fileversion (MonoObject *filever, MonoImage *image)
*/
while(data_len > 0) {
/* align on a 32-bit boundary */
- data_ptr=(gpointer)(((unsigned)data_ptr+3) & (~3));
+ data_ptr=(gpointer)((char *)data_ptr + 3);
+ data_ptr=(gpointer)((char *)data_ptr -
+ (GPOINTER_TO_INT(data_ptr) & 3));
data_ptr=process_get_versioninfo_block (data_ptr, &block);
+ if(block.data_len==0) {
+ /* We must have hit padding, so give up
+ * processing now
+ */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": Hit 0-length block, giving up");
+#endif
+ return;
+ }
+
data_len=data_len-block.data_len;
if(!memcmp (block.key, &var_key, unicode_bytes (block.key))) {
@@ -539,6 +603,14 @@ static void process_get_fileversion (MonoObject *filever, MonoImage *image)
return;
#endif
}
+
+ if(data_ptr==NULL) {
+ /* Child block hit padding */
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Child block hit 0-length block, giving up");
+#endif
+ return;
+ }
}
}
@@ -548,6 +620,7 @@ static void process_add_module (GPtrArray *modules, MonoAssembly *ass)
MonoObject *item, *filever;
MonoDomain *domain=mono_domain_get ();
gchar *modulename;
+ const char* filename;
/* Build a System.Diagnostics.ProcessModule with the data.
* Leave BaseAddress and EntryPointAddress set to NULL,
@@ -569,13 +642,14 @@ static void process_add_module (GPtrArray *modules, MonoAssembly *ass)
g_message (G_GNUC_PRETTY_FUNCTION ": recording assembly: FileName [%s] FileVersionInfo [%d.%d.%d.%d], ModuleName [%s]", ass->image->name, ass->aname.major, ass->aname.minor, ass->aname.build, ass->aname.revision, ass->image->name);
#endif
- process_get_fileversion (filever, ass->image);
+ process_get_fileversion (filever, mono_assembly_get_image (ass));
- process_set_field_string_utf8 (filever, "filename", ass->image->name);
- process_set_field_string_utf8 (item, "filename", ass->image->name);
+ filename = mono_image_get_filename (mono_assembly_get_image (ass));
+ process_set_field_string_utf8 (filever, "filename", filename);
+ process_set_field_string_utf8 (item, "filename", filename);
process_set_field_object (item, "version_info", filever);
- modulename=g_path_get_basename (ass->image->name);
+ modulename=g_path_get_basename (filename);
process_set_field_string_utf8 (item, "modulename", modulename);
g_free (modulename);
@@ -608,6 +682,8 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
MonoArray *arr;
guint32 i;
+ MONO_ARCH_SAVE_REGS;
+
STASH_SYS_ASS (this);
/* Make sure the first entry is the main module */
@@ -616,7 +692,7 @@ MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject
mono_assembly_foreach (process_scan_modules, modules_list);
/* Build a MonoArray out of modules_list */
- arr=mono_array_new (mono_domain_get (), mono_defaults.object_class,
+ arr=mono_array_new (mono_domain_get (), mono_get_object_class (),
modules_list->len);
for(i=0; i<modules_list->len; i++) {
@@ -634,6 +710,8 @@ void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoO
MonoImage *image;
guchar *filename_utf8;
+ MONO_ARCH_SAVE_REGS;
+
STASH_SYS_ASS (this);
filename_utf8=mono_string_to_utf8 (filename);
@@ -650,32 +728,167 @@ void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoO
}
process_get_fileversion (this, image);
- process_set_field_string_utf8 (this, "filename", image->name);
+ process_set_field_string_utf8 (this, "filename", mono_image_get_filename (image));
mono_image_close (image);
}
-MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *filename, MonoString *args, MonoProcInfo *process_info)
+static gboolean
+complete_path (const gunichar2 *appname, gunichar2 **completed)
+{
+ gchar *utf8app;
+ gchar *found;
+
+ utf8app = g_utf16_to_utf8 (appname, -1, NULL, NULL, NULL);
+ if (g_path_is_absolute (utf8app)) {
+ g_free (utf8app);
+ return FALSE;
+ }
+
+ if (g_file_test (utf8app, G_FILE_TEST_IS_EXECUTABLE) && !g_file_test (utf8app, G_FILE_TEST_IS_DIR)) {
+ g_free (utf8app);
+ return FALSE;
+ }
+
+ found = g_find_program_in_path (utf8app);
+ if (found == NULL) {
+ *completed = NULL;
+ g_free (utf8app);
+ return FALSE;
+ }
+
+ *completed = g_utf8_to_utf16 (found, -1, NULL, NULL, NULL);
+ g_free (found);
+ g_free (utf8app);
+ return TRUE;
+}
+
+MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *appname, MonoString *cmd, MonoString *dirname, HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, MonoProcInfo *process_info)
{
gboolean ret;
- gunichar2 *utf16_filename;
- gunichar2 *utf16_args;
- STARTUPINFO startinfo;
+ gunichar2 *dir;
+ STARTUPINFO startinfo={0};
PROCESS_INFORMATION procinfo;
+ gunichar2 *shell_path = NULL;
+ gchar *env_vars = NULL;
+ gboolean free_shell_path = TRUE;
- utf16_filename=mono_string_to_utf16 (filename);
- utf16_args=mono_string_to_utf16 (args);
+ MONO_ARCH_SAVE_REGS;
+
+ startinfo.cb=sizeof(STARTUPINFO);
+ startinfo.dwFlags=STARTF_USESTDHANDLES;
+ startinfo.hStdInput=stdin_handle;
+ startinfo.hStdOutput=stdout_handle;
+ startinfo.hStdError=stderr_handle;
- ret=CreateProcess (utf16_filename, utf16_args, NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, NULL, NULL, &startinfo, &procinfo);
+ if (process_info->use_shell) {
+ const gchar *spath;
+ const gchar *shell_args;
+#ifdef PLATFORM_WIN32
+ spath = g_getenv ("COMSPEC");
+ shell_args = "/c %s";
+#else
+ spath = g_getenv ("SHELL");
+ shell_args = "-c %s";
+#endif
+ if (spath != NULL) {
+ gint dummy;
+ gchar *newcmd, *tmp;
+ gchar *quoted;
+
+ shell_path = mono_unicode_from_external (spath, &dummy);
+ tmp = mono_string_to_utf8 (cmd);
+ quoted = g_shell_quote (tmp);
+#ifdef PLATFORM_WIN32
+ {
+ gchar *q = quoted;
+ while (*q) {
+ if (*q == '\'')
+ *q = '\"';
+ q++;
+ }
+ }
+#endif
+ newcmd = g_strdup_printf (shell_args, quoted);
+ g_free (quoted);
+ g_free (tmp);
+ cmd = mono_string_new (mono_domain_get (), newcmd);
+ g_free (newcmd);
+ }
+ } else {
+ shell_path = mono_string_chars (appname);
+ free_shell_path = complete_path (shell_path, &shell_path);
+ if (shell_path == NULL) {
+ process_info->pid = -ERROR_FILE_NOT_FOUND;
+ return FALSE;
+ }
+ }
- g_free (utf16_filename);
- g_free (utf16_args);
+ if (process_info->env_keys != NULL) {
+ gint i, len;
+ MonoString *ms;
+ MonoString *key, *value;
+ gunichar2 *str, *ptr;
+ gunichar2 *equals16;
+
+ for (len = 0, i = 0; i < mono_array_length (process_info->env_keys); i++) {
+ ms = mono_array_get (process_info->env_values, MonoString *, i);
+ if (ms == NULL)
+ continue;
+
+ len += mono_string_length (ms) * sizeof (gunichar2);
+ ms = mono_array_get (process_info->env_keys, MonoString *, i);
+ len += mono_string_length (ms) * sizeof (gunichar2);
+ len += 2 * sizeof (gunichar2);
+ }
- if(ret==TRUE) {
+ equals16 = g_utf8_to_utf16 ("=", 1, NULL, NULL, NULL);
+ ptr = str = g_new0 (gunichar2, len + 1);
+ for (i = 0; i < mono_array_length (process_info->env_keys); i++) {
+ value = mono_array_get (process_info->env_values, MonoString *, i);
+ if (value == NULL)
+ continue;
+
+ key = mono_array_get (process_info->env_keys, MonoString *, i);
+ memcpy (ptr, mono_string_chars (key), mono_string_length (key) * sizeof (gunichar2));
+ ptr += mono_string_length (key);
+
+ memcpy (ptr, equals16, sizeof (gunichar2));
+ ptr++;
+
+ memcpy (ptr, mono_string_chars (value), mono_string_length (value) * sizeof (gunichar2));
+ ptr += mono_string_length (value);
+ ptr++;
+ }
+
+ g_free (equals16);
+ env_vars = (gchar *) str;
+ }
+
+ /* The default dir name is "". Turn that into NULL to mean
+ * "current directory"
+ */
+ if(mono_string_length (dirname)==0) {
+ dir=NULL;
+ } else {
+ dir=mono_string_chars (dirname);
+ }
+
+ ret=CreateProcess (shell_path, mono_string_chars (cmd), NULL, NULL, TRUE, CREATE_UNICODE_ENVIRONMENT, env_vars, dir, &startinfo, &procinfo);
+
+ g_free (env_vars);
+ if (free_shell_path)
+ g_free (shell_path);
+
+ if(ret) {
process_info->process_handle=procinfo.hProcess;
- process_info->thread_handle=procinfo.hThread;
+ /*process_info->thread_handle=procinfo.hThread;*/
+ process_info->thread_handle=NULL;
+ CloseHandle(procinfo.hThread);
process_info->pid=procinfo.dwProcessId;
process_info->tid=procinfo.dwThreadId;
+ } else {
+ process_info->pid = -GetLastError ();
}
return(ret);
@@ -685,13 +898,14 @@ MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObjec
{
guint32 ret;
+ MONO_ARCH_SAVE_REGS;
+
if(ms<0) {
/* Wait forever */
- ret=WaitForSingleObject (process, INFINITE);
+ ret=WaitForSingleObjectEx (process, INFINITE, TRUE);
} else {
- ret=WaitForSingleObject (process, ms);
+ ret=WaitForSingleObjectEx (process, ms, TRUE);
}
-
if(ret==WAIT_OBJECT_0) {
return(TRUE);
} else {
@@ -705,6 +919,8 @@ gint64 ves_icall_System_Diagnostics_Process_ExitTime_internal (HANDLE process)
gint64 ticks;
FILETIME create_time, exit_time, kernel_time, user_time;
+ MONO_ARCH_SAVE_REGS;
+
ret=GetProcessTimes (process, &create_time, &exit_time, &kernel_time,
&user_time);
if(ret==TRUE) {
@@ -723,6 +939,8 @@ gint64 ves_icall_System_Diagnostics_Process_StartTime_internal (HANDLE process)
gint64 ticks;
FILETIME create_time, exit_time, kernel_time, user_time;
+ MONO_ARCH_SAVE_REGS;
+
ret=GetProcessTimes (process, &create_time, &exit_time, &kernel_time,
&user_time);
if(ret==TRUE) {
@@ -739,6 +957,8 @@ gint32 ves_icall_System_Diagnostics_Process_ExitCode_internal (HANDLE process)
{
guint32 code;
+ MONO_ARCH_SAVE_REGS;
+
GetExitCodeProcess (process, &code);
#ifdef DEBUG
@@ -747,3 +967,109 @@ gint32 ves_icall_System_Diagnostics_Process_ExitCode_internal (HANDLE process)
return(code);
}
+
+MonoString *ves_icall_System_Diagnostics_Process_ProcessName_internal (HANDLE process)
+{
+ MonoString *string;
+ gboolean ok;
+ HMODULE mod;
+ gunichar2 name[MAX_PATH];
+ guint32 needed;
+ guint32 len;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ok=EnumProcessModules (process, &mod, sizeof(mod), &needed);
+ if(ok==FALSE) {
+ return(NULL);
+ }
+
+ len=GetModuleBaseName (process, mod, name, sizeof(name));
+ if(len==0) {
+ return(NULL);
+ }
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": process name is [%s]",
+ g_utf16_to_utf8 (name, -1, NULL, NULL, NULL));
+#endif
+
+ string=mono_string_new_utf16 (mono_domain_get (), name, len);
+
+ return(string);
+}
+
+/* Returns an array of pids */
+MonoArray *ves_icall_System_Diagnostics_Process_GetProcesses_internal (void)
+{
+ MonoArray *procs;
+ gboolean ret;
+ guint32 needed, count, i;
+ guint32 pids[1024];
+
+ MONO_ARCH_SAVE_REGS;
+
+ ret=EnumProcesses (pids, sizeof(pids), &needed);
+ if(ret==FALSE) {
+ /* FIXME: throw an exception */
+ return(NULL);
+ }
+
+ count=needed/sizeof(guint32);
+ procs=mono_array_new (mono_domain_get (), mono_get_int32_class (),
+ count);
+ for(i=0; i<count; i++) {
+ mono_array_set (procs, guint32, i, pids[i]);
+ }
+
+ return(procs);
+}
+
+MonoBoolean ves_icall_System_Diagnostics_Process_GetWorkingSet_internal (HANDLE process, guint32 *min, guint32 *max)
+{
+ gboolean ret;
+ size_t ws_min, ws_max;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ret=GetProcessWorkingSetSize (process, &ws_min, &ws_max);
+ *min=(guint32)ws_min;
+ *max=(guint32)ws_max;
+
+ return(ret);
+}
+
+MonoBoolean ves_icall_System_Diagnostics_Process_SetWorkingSet_internal (HANDLE process, guint32 min, guint32 max, MonoBoolean use_min)
+{
+ gboolean ret;
+ size_t ws_min;
+ size_t ws_max;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ret=GetProcessWorkingSetSize (process, &ws_min, &ws_max);
+ if(ret==FALSE) {
+ return(FALSE);
+ }
+
+ if(use_min==TRUE) {
+ ws_min=min;
+ } else {
+ ws_max=max;
+ }
+
+ ret=SetProcessWorkingSetSize (process, ws_min, ws_max);
+
+ return(ret);
+}
+
+MonoBoolean
+ves_icall_System_Diagnostics_Process_Kill_internal (HANDLE process, gint32 sig)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* sig == 1 -> Kill, sig == 2 -> CloseMainWindow */
+
+ return TerminateProcess (process, -sig);
+}
+
diff --git a/mono/metadata/process.h b/mono/metadata/process.h
index ceae229c81c..b04ae84ec12 100644
--- a/mono/metadata/process.h
+++ b/mono/metadata/process.h
@@ -20,19 +20,32 @@ typedef struct
{
HANDLE process_handle;
HANDLE thread_handle;
- guint32 pid;
+ guint32 pid; /* Contains GetLastError () on failure */
guint32 tid;
+ MonoArray *env_keys;
+ MonoArray *env_values;
+ MonoBoolean use_shell;
} MonoProcInfo;
-extern HANDLE ves_icall_System_Diagnostics_Process_GetCurrentProcess_internal (void);
-extern guint32 ves_icall_System_Diagnostics_Process_GetPid_internal (void);
-extern void ves_icall_System_Diagnostics_Process_Process_free_internal (MonoObject *this, HANDLE process);
-extern MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this);
-extern void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this, MonoString *filename);
-extern MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *filename, MonoString *args, MonoProcInfo *process_handle);
-extern MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObject *this, HANDLE process, gint32 ms);
-extern gint64 ves_icall_System_Diagnostics_Process_ExitTime_internal (HANDLE process);
-extern gint64 ves_icall_System_Diagnostics_Process_StartTime_internal (HANDLE process);
-extern gint32 ves_icall_System_Diagnostics_Process_ExitCode_internal (HANDLE process);
+G_BEGIN_DECLS
+
+HANDLE ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid);
+MonoArray *ves_icall_System_Diagnostics_Process_GetProcesses_internal (void);
+guint32 ves_icall_System_Diagnostics_Process_GetPid_internal (void);
+void ves_icall_System_Diagnostics_Process_Process_free_internal (MonoObject *this, HANDLE process);
+MonoArray *ves_icall_System_Diagnostics_Process_GetModules_internal (MonoObject *this);
+void ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (MonoObject *this, MonoString *filename);
+MonoBoolean ves_icall_System_Diagnostics_Process_Start_internal (MonoString *appname, MonoString *cmd, MonoString *dirname, HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle, MonoProcInfo *process_handle);
+MonoBoolean ves_icall_System_Diagnostics_Process_WaitForExit_internal (MonoObject *this, HANDLE process, gint32 ms);
+gint64 ves_icall_System_Diagnostics_Process_ExitTime_internal (HANDLE process);
+gint64 ves_icall_System_Diagnostics_Process_StartTime_internal (HANDLE process);
+gint32 ves_icall_System_Diagnostics_Process_ExitCode_internal (HANDLE process);
+MonoString *ves_icall_System_Diagnostics_Process_ProcessName_internal (HANDLE process);
+MonoBoolean ves_icall_System_Diagnostics_Process_GetWorkingSet_internal (HANDLE process, guint32 *min, guint32 *max);
+MonoBoolean ves_icall_System_Diagnostics_Process_SetWorkingSet_internal (HANDLE process, guint32 min, guint32 max, MonoBoolean use_min);
+MonoBoolean ves_icall_System_Diagnostics_Process_Kill_internal (HANDLE process, gint32 sig);
+
+G_END_DECLS
#endif /* _MONO_METADATA_PROCESS_H_ */
+
diff --git a/mono/metadata/profiler-private.h b/mono/metadata/profiler-private.h
index 2fa63e0a93f..7958c273bd4 100644
--- a/mono/metadata/profiler-private.h
+++ b/mono/metadata/profiler-private.h
@@ -13,6 +13,14 @@ enum {
MONO_PROFILE_END_UNLOAD
};
+typedef struct {
+ int entries;
+ struct {
+ guchar* cil_code;
+ int count;
+ } data [1];
+} MonoProfileCoverageInfo;
+
void mono_profiler_shutdown (void);
void mono_profiler_method_enter (MonoMethod *method);
@@ -21,8 +29,9 @@ void mono_profiler_method_jit (MonoMethod *method);
void mono_profiler_method_end_jit (MonoMethod *method, int result);
void mono_profiler_code_transition (MonoMethod *method, int result);
-void mono_profiler_thread_start (HANDLE thread);
-void mono_profiler_thread_end (HANDLE thread);
+void mono_profiler_allocation (MonoObject *obj, MonoClass *klass);
+void mono_profiler_thread_start (guint32 tid);
+void mono_profiler_thread_end (guint32 tid);
void mono_profiler_assembly_event (MonoAssembly *assembly, int code);
void mono_profiler_assembly_loaded (MonoAssembly *assembly, int result);
@@ -36,5 +45,8 @@ void mono_profiler_class_loaded (MonoClass *klass, int result);
void mono_profiler_appdomain_event (MonoDomain *domain, int code);
void mono_profiler_appdomain_loaded (MonoDomain *domain, int result);
+MonoProfileCoverageInfo* mono_profiler_coverage_alloc (MonoMethod *method, int entries);
+void mono_profiler_coverage_free (MonoMethod *method);
+
#endif /* __MONO_PROFILER_PRIVATE_H__ */
diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c
index f88579c5e07..55f2377d414 100644
--- a/mono/metadata/profiler.c
+++ b/mono/metadata/profiler.c
@@ -1,7 +1,11 @@
#include "mono/metadata/profiler-private.h"
#include "mono/metadata/debug-helpers.h"
+#include "mono/metadata/mono-debug.h"
+#include "mono/metadata/class-internals.h"
+#include "mono/io-layer/io-layer.h"
#include <string.h>
+#include <gmodule.h>
static MonoProfiler * current_profiler = NULL;
@@ -28,14 +32,19 @@ static MonoProfileClassFunc class_end_unload;
static MonoProfileMethodFunc jit_start;
static MonoProfileMethodResult jit_end;
static MonoProfileMethodResult man_unman_transition;
+static MonoProfileAllocFunc allocation_cb;
static MonoProfileMethodFunc method_enter;
static MonoProfileMethodFunc method_leave;
static MonoProfileThreadFunc thread_start;
static MonoProfileThreadFunc thread_end;
+static MonoProfileCoverageFilterFunc coverage_filter_cb;
+
static MonoProfileFunc shutdown_callback;
+static CRITICAL_SECTION profiler_coverage_mutex;
+
/* this is directly accessible to other mono libs. */
MonoProfileFlags mono_profiler_events;
@@ -46,6 +55,7 @@ mono_profiler_install (MonoProfiler *prof, MonoProfileFunc callback)
g_error ("profiler already setup");
current_profiler = prof;
shutdown_callback = callback;
+ InitializeCriticalSection (&profiler_coverage_mutex);
}
void
@@ -61,10 +71,10 @@ mono_profiler_get_events (void)
}
void
-mono_profiler_install_enter_leave (MonoProfileMethodFunc enter, MonoProfileMethodFunc leave)
+mono_profiler_install_enter_leave (MonoProfileMethodFunc enter, MonoProfileMethodFunc fleave)
{
method_enter = enter;
- method_leave = leave;
+ method_leave = fleave;
}
void
@@ -88,6 +98,18 @@ mono_profiler_install_transition (MonoProfileMethodResult callback)
}
void
+mono_profiler_install_allocation (MonoProfileAllocFunc callback)
+{
+ allocation_cb = callback;
+}
+
+void
+mono_profiler_install_coverage_filter (MonoProfileCoverageFilterFunc callback)
+{
+ coverage_filter_cb = callback;
+}
+
+void
mono_profiler_install_appdomain (MonoProfileAppDomainFunc start_load, MonoProfileAppDomainResult end_load,
MonoProfileAppDomainFunc start_unload, MonoProfileAppDomainFunc end_unload)
@@ -163,18 +185,25 @@ mono_profiler_code_transition (MonoMethod *method, int result)
man_unman_transition (current_profiler, method, result);
}
+void
+mono_profiler_allocation (MonoObject *obj, MonoClass *klass)
+{
+ if ((mono_profiler_events & MONO_PROFILE_ALLOCATIONS) && allocation_cb)
+ allocation_cb (current_profiler, obj, klass);
+}
+
void
-mono_profiler_thread_start (HANDLE thread)
+mono_profiler_thread_start (guint32 tid)
{
if ((mono_profiler_events & MONO_PROFILE_THREADS) && thread_start)
- thread_start (current_profiler, thread);
+ thread_start (current_profiler, tid);
}
void
-mono_profiler_thread_end (HANDLE thread)
+mono_profiler_thread_end (guint32 tid)
{
if ((mono_profiler_events & MONO_PROFILE_THREADS) && thread_end)
- thread_end (current_profiler, thread);
+ thread_end (current_profiler, tid);
}
void
@@ -308,6 +337,88 @@ mono_profiler_shutdown (void)
shutdown_callback (current_profiler);
}
+static GHashTable *coverage_hash = NULL;
+
+MonoProfileCoverageInfo*
+mono_profiler_coverage_alloc (MonoMethod *method, int entries)
+{
+ MonoProfileCoverageInfo *res;
+
+ if (coverage_filter_cb)
+ if (! (*coverage_filter_cb) (current_profiler, method))
+ return NULL;
+
+ EnterCriticalSection (&profiler_coverage_mutex);
+ if (!coverage_hash)
+ coverage_hash = g_hash_table_new (NULL, NULL);
+
+ res = g_malloc0 (sizeof (MonoProfileCoverageInfo) + sizeof (void*) * 2 * entries);
+
+ res->entries = entries;
+
+ g_hash_table_insert (coverage_hash, method, res);
+ LeaveCriticalSection (&profiler_coverage_mutex);
+
+ return res;
+}
+
+/* safe only when the method antive code has been unloaded */
+void
+mono_profiler_coverage_free (MonoMethod *method)
+{
+ MonoProfileCoverageInfo* info;
+
+ EnterCriticalSection (&profiler_coverage_mutex);
+ if (!coverage_hash) {
+ LeaveCriticalSection (&profiler_coverage_mutex);
+ return;
+ }
+
+ info = g_hash_table_lookup (coverage_hash, method);
+ if (info) {
+ g_free (info);
+ g_hash_table_remove (coverage_hash, method);
+ }
+ LeaveCriticalSection (&profiler_coverage_mutex);
+}
+
+void
+mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileCoverageFunc func)
+{
+ MonoProfileCoverageInfo* info;
+ int i, offset;
+ guint32 line, col;
+ unsigned char *start, *end, *cil_code;
+ MonoMethodHeader *header;
+ MonoProfileCoverageEntry entry;
+
+ EnterCriticalSection (&profiler_coverage_mutex);
+ info = g_hash_table_lookup (coverage_hash, method);
+ LeaveCriticalSection (&profiler_coverage_mutex);
+
+ if (!info)
+ return;
+
+ header = mono_method_get_header (method);
+ start = (unsigned char*)header->code;
+ end = start + header->code_size;
+ for (i = 0; i < info->entries; ++i) {
+ cil_code = info->data [i].cil_code;
+ if (cil_code && cil_code >= start && cil_code < end) {
+ offset = cil_code - start;
+ entry.iloffset = offset;
+ entry.method = method;
+ entry.counter = info->data [i].count;
+ /* the debug interface doesn't support column info, sigh */
+ col = line = 1;
+ entry.filename = mono_debug_source_location_from_il_offset (method, offset, &line);
+ entry.line = line;
+ entry.col = col;
+ func (prof, &entry);
+ }
+ }
+}
+
/*
* Small profiler extracted from mint: we should move it in a loadable module
* and improve it to do graphs and more accurate timestamping with rdtsc.
@@ -432,21 +543,34 @@ timeval_elapsed (MonoGLibTimer *t)
#define MONO_TIMER_ELAPSED(t) timeval_elapsed (&(t))
#endif
+typedef struct _AllocInfo AllocInfo;
+typedef struct _CallerInfo CallerInfo;
+typedef struct _LastCallerInfo LastCallerInfo;
+
struct _MonoProfiler {
GHashTable *methods;
- GHashTable *newobjs;
+ MonoMemPool *mempool;
+ /* info about JIT time */
MONO_TIMER_TYPE jit_timer;
double jit_time;
+ double max_jit_time;
+ MonoMethod *max_jit_method;
int methods_jitted;
+
+ GSList *per_thread;
+
+ /* chain of callers for the current thread */
+ LastCallerInfo *callers;
+ /* LastCallerInfo nodes for faster allocation */
+ LastCallerInfo *cstorage;
};
typedef struct {
- union {
- MONO_TIMER_TYPE timer;
- MonoMethod *method;
- } u;
+ MonoMethod *method;
guint64 count;
double total;
+ AllocInfo *alloc_info;
+ CallerInfo *caller_info;
} MethodProfile;
typedef struct _MethodCallProfile MethodCallProfile;
@@ -457,6 +581,63 @@ struct _MethodCallProfile {
MonoMethod *method;
};
+struct _AllocInfo {
+ AllocInfo *next;
+ MonoClass *klass;
+ guint count;
+ guint mem;
+};
+
+struct _CallerInfo {
+ CallerInfo *next;
+ MonoMethod *caller;
+ guint count;
+};
+
+struct _LastCallerInfo {
+ LastCallerInfo *next;
+ MonoMethod *method;
+ MONO_TIMER_TYPE timer;
+};
+
+static MonoProfiler*
+create_profiler (void)
+{
+ MonoProfiler *prof = g_new0 (MonoProfiler, 1);
+
+ prof->methods = g_hash_table_new (NULL, NULL);
+ MONO_TIMER_INIT (prof->jit_timer);
+ prof->mempool = mono_mempool_new ();
+ return prof;
+}
+#if 1
+
+#ifdef HAVE_KW_THREAD
+ static __thread MonoProfiler * tls_profiler;
+# define GET_PROFILER() tls_profiler
+# define SET_PROFILER(x) tls_profiler = (x)
+# define ALLOC_PROFILER() /* nop */
+#else
+ static guint32 profiler_thread_id = -1;
+# define GET_PROFILER() ((MonoProfiler *)TlsGetValue (profiler_thread_id))
+# define SET_PROFILER(x) TlsSetValue (profiler_thread_id, x);
+# define ALLOC_PROFILER() profiler_thread_id = TlsAlloc ()
+#endif
+
+#define GET_THREAD_PROF(prof) do { \
+ MonoProfiler *_tprofiler = GET_PROFILER (); \
+ if (!_tprofiler) { \
+ _tprofiler = create_profiler (); \
+ prof->per_thread = g_slist_prepend (prof->per_thread, _tprofiler); \
+ SET_PROFILER (_tprofiler); \
+ } \
+ prof = _tprofiler; \
+ } while (0)
+#else
+/* thread unsafe but faster variant */
+#define GET_THREAD_PROF(prof)
+#endif
+
static gint
compare_profile (MethodProfile *profa, MethodProfile *profb)
{
@@ -466,40 +647,55 @@ compare_profile (MethodProfile *profa, MethodProfile *profb)
static void
build_profile (MonoMethod *m, MethodProfile *prof, GList **funcs)
{
- MONO_TIMER_DESTROY (prof->u.timer);
- prof->u.method = m;
+ prof->method = m;
*funcs = g_list_insert_sorted (*funcs, prof, (GCompareFunc)compare_profile);
}
+static char*
+method_get_name (MonoMethod* method)
+{
+ char *sig, *res;
+
+ sig = mono_signature_get_desc (method->signature, FALSE);
+ res = g_strdup_printf ("%s.%s::%s(%s)", method->klass->name_space, method->klass->name,
+ method->name, sig);
+ g_free (sig);
+ return res;
+}
+
+static void output_callers (MethodProfile *p);
+
static void
output_profile (GList *funcs)
{
GList *tmp;
MethodProfile *p;
- char buf [256];
- char *sig;
+ char *m;
guint64 total_calls = 0;
if (funcs)
- g_print ("Method name\t\t\t\t\tTotal (ms) Calls Per call (ms)\n");
+ g_print ("Time(ms) Count P/call(ms) Method name\n");
for (tmp = funcs; tmp; tmp = tmp->next) {
p = tmp->data;
total_calls += p->count;
if (!(gint)(p->total*1000))
continue;
- sig = mono_signature_get_desc (p->u.method->signature, FALSE);
- g_snprintf (buf, sizeof (buf), "%s.%s::%s(%s)",
- p->u.method->klass->name_space, p->u.method->klass->name,
- p->u.method->name, sig);
- g_free (sig);
- printf ("%-52s %7d %7llu %7d\n", buf,
- (gint)(p->total*1000), p->count, (gint)((p->total*1000)/p->count));
+ m = method_get_name (p->method);
+ printf ("########################\n");
+ printf ("% 8.3f ", (double) (p->total * 1000));
+ printf ("%7llu ", p->count);
+ printf ("% 8.3f ", (double) (p->total * 1000)/(double)p->count);
+ printf (" %s\n", m);
+
+ g_free (m);
+ /* callers */
+ output_callers (p);
}
printf ("Total number of calls: %lld\n", total_calls);
}
typedef struct {
- MonoClass *klass;
+ MethodProfile *mp;
guint count;
} NewobjProfile;
@@ -510,67 +706,302 @@ compare_newobj_profile (NewobjProfile *profa, NewobjProfile *profb)
}
static void
-build_newobj_profile (MonoClass *class, gpointer count, GList **funcs)
+build_newobj_profile (MonoClass *class, MethodProfile *mprof, GList **funcs)
{
NewobjProfile *prof = g_new (NewobjProfile, 1);
- prof->klass = class;
- prof->count = GPOINTER_TO_UINT (count);
+ AllocInfo *tmp;
+ guint count = 0;
+
+ prof->mp = mprof;
+ /* we use the total amount of memory to sort */
+ for (tmp = mprof->alloc_info; tmp; tmp = tmp->next)
+ count += tmp->mem;
+ prof->count = count;
*funcs = g_list_insert_sorted (*funcs, prof, (GCompareFunc)compare_newobj_profile);
}
+static int
+compare_caller (CallerInfo *a, CallerInfo *b)
+{
+ return b->count - a->count;
+}
+
+static int
+compare_alloc (AllocInfo *a, AllocInfo *b)
+{
+ return b->mem - a->mem;
+}
+
+static GSList*
+sort_alloc_list (AllocInfo *ai)
+{
+ GSList *l = NULL;
+ AllocInfo *tmp;
+ for (tmp = ai; tmp; tmp = tmp->next) {
+ l = g_slist_insert_sorted (l, tmp, (GCompareFunc)compare_alloc);
+ }
+ return l;
+}
+
+static GSList*
+sort_caller_list (CallerInfo *ai)
+{
+ GSList *l = NULL;
+ CallerInfo *tmp;
+ for (tmp = ai; tmp; tmp = tmp->next) {
+ l = g_slist_insert_sorted (l, tmp, (GCompareFunc)compare_caller);
+ }
+ return l;
+}
+
+static void
+output_callers (MethodProfile *p) {
+ guint total_callers, percent;
+ GSList *sorted, *tmps;
+ CallerInfo *cinfo;
+ char *m;
+
+ g_print (" Callers (with count) that contribute at least for 1%%:\n");
+ total_callers = 0;
+ for (cinfo = p->caller_info; cinfo; cinfo = cinfo->next) {
+ total_callers += cinfo->count;
+ }
+ sorted = sort_caller_list (p->caller_info);
+ for (tmps = sorted; tmps; tmps = tmps->next) {
+ cinfo = tmps->data;
+ percent = (cinfo->count * 100)/total_callers;
+ if (percent < 1)
+ continue;
+ m = method_get_name (cinfo->caller);
+ g_print (" %8d % 3d %% %s\n", cinfo->count, percent, m);
+ g_free (m);
+ }
+}
+
static void
output_newobj_profile (GList *proflist)
{
GList *tmp;
NewobjProfile *p;
+ MethodProfile *mp;
+ AllocInfo *ainfo;
MonoClass *klass;
const char* isarray;
char buf [256];
+ char *m;
+ guint total = 0;
+ GSList *sorted, *tmps;
+
+ g_print ("\nAllocation profiler\n");
if (proflist)
- g_print ("\n%-52s %9s\n", "Objects created:", "count");
+ g_print ("%-9s %s\n", "Total mem", "Method");
for (tmp = proflist; tmp; tmp = tmp->next) {
p = tmp->data;
- klass = p->klass;
- if (klass->rank) {
- isarray = "[]";
- klass = klass->element_class;
- } else {
- isarray = "";
+ total += p->count;
+ if (p->count < 50000)
+ continue;
+ mp = p->mp;
+ m = method_get_name (mp->method);
+ g_print ("########################\n%8d KB %s\n", p->count / 1024, m);
+ g_free (m);
+ sorted = sort_alloc_list (mp->alloc_info);
+ for (tmps = sorted; tmps; tmps = tmps->next) {
+ ainfo = tmps->data;
+ if (ainfo->mem < 50000)
+ continue;
+ klass = ainfo->klass;
+ if (klass->rank) {
+ isarray = "[]";
+ klass = klass->element_class;
+ } else {
+ isarray = "";
+ }
+ g_snprintf (buf, sizeof (buf), "%s.%s%s",
+ klass->name_space, klass->name, isarray);
+ g_print (" %8d KB %8d %-48s\n", ainfo->mem / 1024, ainfo->count, buf);
}
- g_snprintf (buf, sizeof (buf), "%s.%s%s",
- klass->name_space, klass->name, isarray);
- g_print ("%-52s %9d\n", buf, p->count);
+ /* callers */
+ output_callers (mp);
}
+ g_print ("Total memory allocated: %d KB\n", total / 1024);
+}
+
+static void
+merge_methods (MonoMethod *method, MethodProfile *profile, MonoProfiler *prof)
+{
+ MethodProfile *mprof;
+ AllocInfo *talloc_info, *alloc_info;
+ CallerInfo *tcaller_info, *caller_info;
+
+ mprof = g_hash_table_lookup (prof->methods, method);
+ if (!mprof) {
+ /* the master thread didn't see this method, just transfer the info as is */
+ g_hash_table_insert (prof->methods, method, profile);
+ return;
+ }
+ /* merge the info from profile into mprof */
+ mprof->count += profile->count;
+ mprof->total += profile->total;
+ /* merge alloc info */
+ for (talloc_info = profile->alloc_info; talloc_info; talloc_info = talloc_info->next) {
+ for (alloc_info = mprof->alloc_info; alloc_info; alloc_info = alloc_info->next) {
+ if (alloc_info->klass == talloc_info->klass) {
+ /* mprof already has a record for the klass, merge */
+ alloc_info->count += talloc_info->count;
+ alloc_info->mem += talloc_info->mem;
+ break;
+ }
+ }
+ if (!alloc_info) {
+ /* mprof didn't have the info, just copy it over */
+ alloc_info = mono_mempool_alloc0 (prof->mempool, sizeof (AllocInfo));
+ *alloc_info = *talloc_info;
+ alloc_info->next = mprof->alloc_info;
+ mprof->alloc_info = alloc_info->next;
+ }
+ }
+ /* merge callers info */
+ for (tcaller_info = profile->caller_info; tcaller_info; tcaller_info = tcaller_info->next) {
+ for (caller_info = mprof->caller_info; caller_info; caller_info = caller_info->next) {
+ if (caller_info->caller == tcaller_info->caller) {
+ /* mprof already has a record for the caller method, merge */
+ caller_info->count += tcaller_info->count;
+ break;
+ }
+ }
+ if (!caller_info) {
+ /* mprof didn't have the info, just copy it over */
+ caller_info = mono_mempool_alloc0 (prof->mempool, sizeof (CallerInfo));
+ *caller_info = *tcaller_info;
+ caller_info->next = mprof->caller_info;
+ mprof->caller_info = caller_info;
+ }
+ }
+}
+
+static void
+merge_thread_data (MonoProfiler *master, MonoProfiler *tprof)
+{
+ master->jit_time += tprof->jit_time;
+ master->methods_jitted += tprof->methods_jitted;
+ if (master->max_jit_time < tprof->max_jit_time) {
+ master->max_jit_time = tprof->max_jit_time;
+ master->max_jit_method = tprof->max_jit_method;
+ }
+
+ g_hash_table_foreach (tprof->methods, (GHFunc)merge_methods, master);
}
static void
simple_method_enter (MonoProfiler *prof, MonoMethod *method)
{
MethodProfile *profile_info;
+ LastCallerInfo *callinfo;
+ GET_THREAD_PROF (prof);
+ /*g_print ("enter %p %s::%s in %d (%p)\n", method, method->klass->name, method->name, GetCurrentThreadId (), prof);*/
if (!(profile_info = g_hash_table_lookup (prof->methods, method))) {
- profile_info = g_new0 (MethodProfile, 1);
+ profile_info = mono_mempool_alloc0 (prof->mempool, sizeof (MethodProfile));
MONO_TIMER_INIT (profile_info->u.timer);
g_hash_table_insert (prof->methods, method, profile_info);
}
profile_info->count++;
- MONO_TIMER_START (profile_info->u.timer);
+ if (prof->callers) {
+ CallerInfo *cinfo;
+ MonoMethod *caller = prof->callers->method;
+ for (cinfo = profile_info->caller_info; cinfo; cinfo = cinfo->next) {
+ if (cinfo->caller == caller)
+ break;
+ }
+ if (!cinfo) {
+ cinfo = mono_mempool_alloc0 (prof->mempool, sizeof (CallerInfo));
+ cinfo->caller = caller;
+ cinfo->next = profile_info->caller_info;
+ profile_info->caller_info = cinfo;
+ }
+ cinfo->count++;
+ }
+ if (!(callinfo = prof->cstorage)) {
+ callinfo = mono_mempool_alloc (prof->mempool, sizeof (LastCallerInfo));
+ MONO_TIMER_INIT (callinfo->timer);
+ } else {
+ prof->cstorage = prof->cstorage->next;
+ }
+ callinfo->method = method;
+ callinfo->next = prof->callers;
+ prof->callers = callinfo;
+ MONO_TIMER_START (callinfo->timer);
}
static void
simple_method_leave (MonoProfiler *prof, MonoMethod *method)
{
MethodProfile *profile_info;
- if (!(profile_info = g_hash_table_lookup (prof->methods, method)))
- g_assert_not_reached ();
+ LastCallerInfo *callinfo, *newcallinfo = NULL;
+
+ GET_THREAD_PROF (prof);
+ /*g_print ("leave %p %s::%s in %d (%p)\n", method, method->klass->name, method->name, GetCurrentThreadId (), prof);*/
+ callinfo = prof->callers;
+ /* should really not happen, but we don't catch exceptions events, yet ... */
+ while (callinfo) {
+ MONO_TIMER_STOP (callinfo->timer);
+ profile_info = g_hash_table_lookup (prof->methods, callinfo->method);
+ if (profile_info)
+ profile_info->total += MONO_TIMER_ELAPSED (callinfo->timer);
+ newcallinfo = callinfo->next;
+ callinfo->next = prof->cstorage;
+ prof->cstorage = callinfo;
+ if (callinfo->method == method)
+ break;
+ callinfo = newcallinfo;
+ }
+ prof->callers = newcallinfo;
+}
+
+static void
+simple_allocation (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
+{
+ MethodProfile *profile_info;
+ AllocInfo *tmp;
- MONO_TIMER_STOP (profile_info->u.timer);
- profile_info->total += MONO_TIMER_ELAPSED (profile_info->u.timer);
+ GET_THREAD_PROF (prof);
+ if (prof->callers) {
+ MonoMethod *caller = prof->callers->method;
+
+ /* Otherwise all allocations are attributed to icall_wrapper_mono_object_new */
+ if (caller->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)
+ caller = prof->callers->next->method;
+
+ if (!(profile_info = g_hash_table_lookup (prof->methods, caller)))
+ g_assert_not_reached ();
+ } else {
+ return; /* fine for now */
+ }
+
+ for (tmp = profile_info->alloc_info; tmp; tmp = tmp->next) {
+ if (tmp->klass == klass)
+ break;
+ }
+ if (!tmp) {
+ tmp = mono_mempool_alloc0 (prof->mempool, sizeof (AllocInfo));
+ tmp->klass = klass;
+ tmp->next = profile_info->alloc_info;
+ profile_info->alloc_info = tmp;
+ }
+ tmp->count++;
+ if (klass == mono_defaults.string_class) {
+ tmp->mem += sizeof (MonoString) + 2 * mono_string_length ((MonoString*)obj) + 2;
+ } else if (klass->parent == mono_defaults.array_class) {
+ tmp->mem += sizeof (MonoArray) + mono_array_element_size (klass) * mono_array_length ((MonoArray*)obj);
+ } else {
+ tmp->mem += mono_class_instance_size (klass);
+ }
}
static void
simple_method_jit (MonoProfiler *prof, MonoMethod *method)
{
+ GET_THREAD_PROF (prof);
prof->methods_jitted++;
MONO_TIMER_START (prof->jit_timer);
}
@@ -578,41 +1009,127 @@ simple_method_jit (MonoProfiler *prof, MonoMethod *method)
static void
simple_method_end_jit (MonoProfiler *prof, MonoMethod *method, int result)
{
+ double jtime;
+ GET_THREAD_PROF (prof);
MONO_TIMER_STOP (prof->jit_timer);
- prof->jit_time += MONO_TIMER_ELAPSED (prof->jit_timer);
+ jtime = MONO_TIMER_ELAPSED (prof->jit_timer);
+ prof->jit_time += jtime;
+ if (jtime > prof->max_jit_time) {
+ prof->max_jit_time = jtime;
+ prof->max_jit_method = method;
+ }
}
static void
simple_shutdown (MonoProfiler *prof)
{
GList *profile = NULL;
+ MonoProfiler *tprof;
+ GSList *tmp;
+ char *str;
+
+ for (tmp = prof->per_thread; tmp; tmp = tmp->next) {
+ tprof = tmp->data;
+ merge_thread_data (prof, tprof);
+ }
printf("Total time spent compiling %d methods (sec): %.4g\n", prof->methods_jitted, prof->jit_time);
+ if (prof->max_jit_method) {
+ str = method_get_name (prof->max_jit_method);
+ printf("Slowest method to compile (sec): %.4g: %s\n", prof->max_jit_time, str);
+ g_free (str);
+ }
g_hash_table_foreach (prof->methods, (GHFunc)build_profile, &profile);
output_profile (profile);
g_list_free (profile);
profile = NULL;
- g_hash_table_foreach (prof->newobjs, (GHFunc)build_newobj_profile, &profile);
+ g_hash_table_foreach (prof->methods, (GHFunc)build_newobj_profile, &profile);
output_newobj_profile (profile);
g_list_free (profile);
}
-void
-mono_profiler_install_simple (void)
+static void
+mono_profiler_install_simple (const char *desc)
{
- MonoProfiler *prof = g_new0 (MonoProfiler, 1);
+ MonoProfiler *prof;
+ gchar **args, **ptr;
+ MonoProfileFlags flags = MONO_PROFILE_ENTER_LEAVE|MONO_PROFILE_JIT_COMPILATION|MONO_PROFILE_ALLOCATIONS;
MONO_TIMER_STARTUP;
- prof->methods = g_hash_table_new (g_direct_hash, g_direct_equal);
- prof->newobjs = g_hash_table_new (g_direct_hash, g_direct_equal);
- MONO_TIMER_INIT (prof->jit_timer);
+ if (desc) {
+ /* Parse options */
+ if (strstr (desc, ":"))
+ desc = strstr (desc, ":") + 1;
+ else
+ desc = NULL;
+ args = g_strsplit (desc ? desc : "", ",", -1);
+
+ for (ptr = args; ptr && *ptr; ptr++) {
+ const char *arg = *ptr;
+
+ if (!strcmp (arg, "-time"))
+ flags &= ~MONO_PROFILE_ENTER_LEAVE;
+ else
+ if (!strcmp (arg, "-alloc"))
+ flags &= ~MONO_PROFILE_ALLOCATIONS;
+ else {
+ fprintf (stderr, "profiler : Unknown argument '%s'.\n", arg);
+ return;
+ }
+ }
+ }
+
+ prof = create_profiler ();
+ ALLOC_PROFILER ();
+ SET_PROFILER (prof);
mono_profiler_install (prof, simple_shutdown);
/* later do also object creation */
mono_profiler_install_enter_leave (simple_method_enter, simple_method_leave);
mono_profiler_install_jit_compile (simple_method_jit, simple_method_end_jit);
- mono_profiler_set_events (MONO_PROFILE_ENTER_LEAVE|MONO_PROFILE_JIT_COMPILATION);
+ mono_profiler_install_allocation (simple_allocation);
+ mono_profiler_set_events (flags);
+}
+
+typedef void (*ProfilerInitializer) (const char*);
+#define INITIALIZER_NAME "mono_profiler_startup"
+
+void
+mono_profiler_load (const char *desc)
+{
+ if (!desc || (strcmp ("default", desc) == 0) || (strncmp (desc, "default:", 8) == 0)) {
+ mono_profiler_install_simple (desc);
+ } else {
+ GModule *pmodule;
+ const char* col = strchr (desc, ':');
+ char* libname;
+ char* path;
+ char *mname;
+ if (col != NULL) {
+ mname = g_memdup (desc, col - desc);
+ mname [col - desc] = 0;
+ } else {
+ mname = g_strdup (desc);
+ }
+ libname = g_strdup_printf ("mono-profiler-%s", mname);
+ path = g_module_build_path (NULL, libname);
+ pmodule = g_module_open (path, G_MODULE_BIND_LAZY);
+ if (pmodule) {
+ ProfilerInitializer func;
+ if (!g_module_symbol (pmodule, INITIALIZER_NAME, (gpointer *)&func)) {
+ g_warning ("Cannot find initializer function %s in profiler module: %s", INITIALIZER_NAME, libname);
+ } else {
+ func (desc);
+ }
+ } else {
+ g_warning ("Error loading profiler module '%s': %s", libname, g_module_error ());
+ }
+
+ g_free (libname);
+ g_free (mname);
+ g_free (path);
+ }
}
diff --git a/mono/metadata/profiler.h b/mono/metadata/profiler.h
index 1f6ab146bb1..0d7d981b0a7 100644
--- a/mono/metadata/profiler.h
+++ b/mono/metadata/profiler.h
@@ -3,7 +3,6 @@
#include <mono/metadata/object.h>
#include <mono/metadata/appdomain.h>
-#include <mono/io-layer/io-layer.h>
typedef enum {
MONO_PROFILE_NONE = 0,
@@ -19,7 +18,9 @@ typedef enum {
MONO_PROFILE_THREADS = 1 << 9,
MONO_PROFILE_REMOTING = 1 << 10,
MONO_PROFILE_TRANSITIONS = 1 << 11,
- MONO_PROFILE_ENTER_LEAVE = 1 << 12
+ MONO_PROFILE_ENTER_LEAVE = 1 << 12,
+ MONO_PROFILE_COVERAGE = 1 << 13,
+ MONO_PROFILE_INS_COVERAGE = 1 << 14
} MonoProfileFlags;
typedef enum {
@@ -27,6 +28,16 @@ typedef enum {
MONO_PROFILE_FAILED
} MonoProfileResult;
+/* coverage info */
+typedef struct {
+ MonoMethod *method;
+ int iloffset;
+ int counter;
+ const char *filename;
+ int line;
+ int col;
+} MonoProfileCoverageEntry;
+
typedef struct _MonoProfiler MonoProfiler;
/*
@@ -49,9 +60,13 @@ typedef void (*MonoProfileAssemblyResult) (MonoProfiler *prof, MonoAssembly *ass
typedef void (*MonoProfileMethodInline) (MonoProfiler *prof, MonoMethod *parent, MonoMethod *child, int *ok);
-typedef void (*MonoProfileThreadFunc) (MonoProfiler *prof, HANDLE thread);
+typedef void (*MonoProfileThreadFunc) (MonoProfiler *prof, guint32 tid);
typedef void (*MonoProfileAllocFunc) (MonoProfiler *prof, MonoObject *obj, MonoClass *klass);
+typedef gboolean (*MonoProfileCoverageFilterFunc) (MonoProfiler *prof, MonoMethod *method);
+
+typedef void (*MonoProfileCoverageFunc) (MonoProfiler *prof, const MonoProfileCoverageEntry *entry);
+
/*
* Function the profiler may call.
*/
@@ -70,11 +85,14 @@ void mono_profiler_install_class (MonoProfileClassFunc start_load, MonoPro
MonoProfileClassFunc start_unload, MonoProfileClassFunc end_unload);
void mono_profiler_install_jit_compile (MonoProfileMethodFunc start, MonoProfileMethodResult end);
-void mono_profiler_install_enter_leave (MonoProfileMethodFunc enter, MonoProfileMethodFunc leave);
+void mono_profiler_install_enter_leave (MonoProfileMethodFunc enter, MonoProfileMethodFunc fleave);
void mono_profiler_install_thread (MonoProfileThreadFunc start, MonoProfileThreadFunc end);
void mono_profiler_install_transition (MonoProfileMethodResult callback);
+void mono_profiler_install_allocation (MonoProfileAllocFunc callback);
+void mono_profiler_install_coverage_filter (MonoProfileCoverageFilterFunc callback);
+void mono_profiler_coverage_get (MonoProfiler *prof, MonoMethod *method, MonoProfileCoverageFunc func);
-void mono_profiler_install_simple (void);
+void mono_profiler_load (const char *desc);
#endif /* __MONO_PROFILER_H__ */
diff --git a/mono/metadata/rand.c b/mono/metadata/rand.c
index 0ccb98dd4c8..e2f78f78b7d 100644
--- a/mono/metadata/rand.c
+++ b/mono/metadata/rand.c
@@ -1,16 +1,15 @@
/*
* rand.c: System.Security.Cryptography.RNGCryptoServiceProvider support
*
- * Author:
+ * Authors:
* Mark Crichton (crichton@gimp.org)
+ * Patrik Torstensson (p@rxc.se)
+ * Sebastien Pouliot (sebastien@ximian.com)
*
* (C) 2001 Ximian, Inc.
- *
+ * (C) 2004 Novell (http://www.novell.com)
*/
-
-/* Ok, the exception handling is bogus. I need to work on that */
-
#include <config.h>
#include <glib.h>
#include <sys/types.h>
@@ -22,93 +21,228 @@
#include <mono/metadata/rand.h>
#include <mono/metadata/exception.h>
-#if defined (NAME_DEV_RANDOM) && defined (HAVE_CRYPT_RNG)
+#if !defined(PLATFORM_WIN32)
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <errno.h>
-void
-ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes (MonoObject *self, MonoArray *arry)
+static void
+get_entropy_from_server (const char *path, guchar *buf, int len)
{
- guint32 len;
- gint file;
- gint err;
- guchar *buf;
-
- len = mono_array_length(arry);
- buf = mono_array_addr(arry, guchar, 0);
+ int file;
+ gint ret;
+ guint offset = 0;
+ struct sockaddr_un egd_addr;
+
+ file = socket (PF_UNIX, SOCK_STREAM, 0);
+ if (file < 0)
+ ret = -1;
+ else {
+ egd_addr.sun_family = AF_UNIX;
+ strncpy (egd_addr.sun_path, path, MONO_SIZEOF_SUNPATH - 1);
+ egd_addr.sun_path [MONO_SIZEOF_SUNPATH-1] = '\0';
+ ret = connect (file, (struct sockaddr *)&egd_addr, sizeof(egd_addr));
+ }
+ if (ret == -1) {
+ if (file >= 0)
+ close (file);
+ g_warning ("Entropy problem! Can't create or connect to egd socket %s", path);
+ mono_raise_exception (mono_get_exception_execution_engine ("Failed to open egd socket"));
+ }
- file = open(NAME_DEV_RANDOM, O_RDONLY);
+ while (len > 0) {
+ guchar request[2];
+ gint count = 0;
+
+ request [0] = 2; /* block until daemon can return enough entropy */
+ request [1] = len < 255 ? len : 255;
+ while (count < 2) {
+ int sent = write (file, request + count, 2 - count);
+ if (sent >= 0)
+ count += sent;
+ else if (errno == EINTR)
+ continue;
+ else {
+ close (file);
+ g_warning ("Send egd request failed %d", errno);
+ mono_raise_exception (mono_get_exception_execution_engine ("Failed to send request to egd socket"));
+ }
+ }
- if (file < 0) {
- g_warning("Entropy problem! Can't open %s", NAME_DEV_RANDOM);
+ count = 0;
+ while (count != request [1]) {
+ int received;
+ received = read(file, buf + offset, request [1] - count);
+ if (received > 0) {
+ count += received;
+ offset += received;
+ } else if (received < 0 && errno == EINTR) {
+ continue;
+ } else {
+ close (file);
+ g_warning ("Receive egd request failed %d", errno);
+ mono_raise_exception (mono_get_exception_execution_engine ("Failed to get response from egd socket"));
+ }
+ }
- /* This needs to be a crypto exception */
- mono_raise_exception(mono_get_exception_not_implemented());
+ len -= request [1];
}
- /* A little optimization.... */
- err = read(file, buf, len);
+ close (file);
+}
+#endif
- if (err < 0) {
- g_warning("Entropy error! Error in read.");
- mono_raise_exception(mono_get_exception_not_implemented());
- }
+#if defined (PLATFORM_WIN32)
- if (err != len) {
- g_warning("Entropy error! Length != bytes read");
- mono_raise_exception(mono_get_exception_not_implemented());
- }
+#include <WinCrypt.h>
+
+#ifndef PROV_INTEL_SEC
+#define PROV_INTEL_SEC 22
+#endif
+#ifndef CRYPT_VERIFY_CONTEXT
+#define CRYPT_VERIFY_CONTEXT 0xF0000000
+#endif
- close(file);
+gpointer
+ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize (MonoArray *seed)
+{
+ HCRYPTPROV provider = 0;
+
+ /* There is no need to create a container for just random data,
+ so we can use CRYPT_VERIFY_CONTEXT (one call) see:
+ http://blogs.msdn.com/dangriff/archive/2003/11/19/51709.aspx */
+
+ /* We first try to use the Intel PIII RNG if drivers are present */
+ if (!CryptAcquireContext (&provider, NULL, NULL, PROV_INTEL_SEC, CRYPT_VERIFY_CONTEXT)) {
+ /* not a PIII or no drivers available, use default RSA CSP */
+ if (!CryptAcquireContext (&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFY_CONTEXT)) {
+ provider = 0;
+ /* exception will be thrown in managed code */
+ }
+ }
+
+ /* seed the CSP with the supplied buffer (if present) */
+ if ((provider != 0) && (seed)) {
+ guint32 len = mono_array_length (seed);
+ guchar *buf = mono_array_addr (seed, guchar, 0);
+ /* the call we replace the seed with random - this isn't what is
+ expected from the class library user */
+ guchar *data = g_malloc (len);
+ if (data) {
+ memcpy (data, buf, len);
+ /* add seeding material to the RNG */
+ CryptGenRandom (provider, len, data);
+ /* zeroize and free */
+ memset (data, 0, len);
+ g_free (data);
+ }
+ }
+
+ return (gpointer) provider;
}
-void
-ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes (MonoObject *self, MonoArray *arry)
+gpointer
+ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngGetBytes (gpointer handle, MonoArray *arry)
{
- guint32 len;
- gint file, i;
- gint err;
- guchar byte = 0;
+ HCRYPTPROV provider = (HCRYPTPROV) handle;
+ guint32 len = mono_array_length (arry);
+ guchar *buf = mono_array_addr (arry, guchar, 0);
+
+ if (!CryptGenRandom (provider, len, buf)) {
+ CryptReleaseContext (provider, 0);
+ /* we may have lost our context with CryptoAPI, but all hope isn't lost yet! */
+ provider = ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize (NULL);
+ if (!CryptGenRandom (provider, len, buf)) {
+ CryptReleaseContext (provider, 0);
+ provider = 0;
+ /* exception will be thrown in managed code */
+ }
+ }
+}
- len = mono_array_length(arry);
+void
+ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose (gpointer handle)
+{
+ CryptReleaseContext ((HCRYPTPROV) handle, 0);
+}
- file = open(NAME_DEV_RANDOM, O_RDONLY);
+#else
- if (file < 0) {
- g_warning("Entropy problem! Can't open %s", NAME_DEV_RANDOM);
+#ifndef NAME_DEV_URANDOM
+#define NAME_DEV_URANDOM "/dev/urandom"
+#endif
- /* This needs to be a crypto exception */
- mono_raise_exception(mono_get_exception_not_implemented());
- }
+static gboolean egd = FALSE;
- for (i = 0; i < len; i++) {
+gpointer
+ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize (MonoArray *seed)
+{
+ gint file = -1;
- do {
- err = read(file, &byte, 1);
- } while (byte == 0);
+ if (egd)
+ return (gpointer) -1;
- if (err < 0) {
- g_warning("Entropy error! Error in read.");
- mono_raise_exception(mono_get_exception_not_implemented());
- }
+#if defined (NAME_DEV_URANDOM)
+ file = open (NAME_DEV_URANDOM, O_RDONLY);
+#endif
- mono_array_set(arry, guchar, i, byte);
- }
+#if defined (NAME_DEV_RANDOM)
+ if (file < 0)
+ file = open (NAME_DEV_RANDOM, O_RDONLY);
+#endif
- close(file);
+ if (file < 0) {
+ const char *socket_path = g_getenv("MONO_EGD_SOCKET");
+ egd = (socket_path != NULL);
+ return (gpointer) -1;
+ }
+
+ /* if required exception will be thrown in managed code */
+ return ((file < 0) ? NULL : (gpointer) file);
}
-/* This needs to change when I do the Win32 support... */
-#else
-#warning "No Entropy Source Found"
-void ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes(MonoObject *self, MonoArray *arry)
+gpointer
+ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngGetBytes (gpointer handle, MonoArray *arry)
{
- g_warning("0K problem. We have no entropy. Badness will occur.");
- mono_raise_exception(mono_get_exception_not_implemented());
+ gint file = (gint) handle;
+ guint32 len = mono_array_length (arry);
+ guchar *buf = mono_array_addr (arry, guchar, 0);
+
+ if (egd) {
+ const char *socket_path = g_getenv ("MONO_EGD_SOCKET");
+ /* exception will be thrown in managed code */
+ if (socket_path == NULL)
+ return NULL;
+ get_entropy_from_server (socket_path, mono_array_addr (arry, guchar, 0), mono_array_length (arry));
+ return (gpointer) -1;
+ }
+ else {
+ /* Read until the buffer is filled. This may block if using NAME_DEV_RANDOM. */
+ gint count = 0;
+ gint err;
+
+ do {
+ err = read (file, buf + count, len - count);
+ count += err;
+ } while (err >= 0 && count < len);
+
+ if (err < 0) {
+ g_warning("Entropy error! Error in read (%s).", strerror (errno));
+ /* exception will be thrown in managed code */
+ return NULL;
+ }
+ }
+
+ /* We do not support PRNG seeding right now but the class library is this */
+
+ return handle;
}
-void ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes(MonoObject *self, MonoArray *arry)
+void
+ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose (gpointer handle)
{
- g_warning("0K problem. We have no entropy. Badness will occur.");
- mono_raise_exception(mono_get_exception_not_implemented());
+ if (!egd)
+ close ((gint) handle);
}
-#endif
+#endif /* OS definition */
diff --git a/mono/metadata/rand.h b/mono/metadata/rand.h
index 248942b13a1..f06cdd1a1f1 100644
--- a/mono/metadata/rand.h
+++ b/mono/metadata/rand.h
@@ -3,8 +3,10 @@
*
* Author:
* Mark Crichton (crichton@gimp.org)
+ * Sebastien Pouliot (sebastien@ximian.com)
*
* (C) 2001 Ximian, Inc.
+ * (C) 2004 Novell (http://www.novell.com)
*
*/
@@ -13,7 +15,8 @@
#include <mono/metadata/object.h>
-void ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes(MonoObject *self, MonoArray *arry);
-void ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes(MonoObject *self, MonoArray *arry);
+gpointer ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize (MonoArray *seed);
+gpointer ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngGetBytes (gpointer handle, MonoArray *arry);
+void ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose (gpointer handle);
#endif
diff --git a/mono/metadata/rawbuffer.c b/mono/metadata/rawbuffer.c
index ba016796f94..4ecd91abb7d 100644
--- a/mono/metadata/rawbuffer.c
+++ b/mono/metadata/rawbuffer.c
@@ -12,6 +12,7 @@
#endif
#include <unistd.h>
+#include <errno.h>
#ifdef USE_WIN32_API
#include <windows.h>
#include <io.h>
@@ -22,11 +23,19 @@
#include <glib.h>
#include "rawbuffer.h"
+#include <mono/io-layer/io-layer.h>
+
#define ROUND_DOWN(VALUE,SIZE) ((VALUE) & ~((SIZE) - 1))
#define ROUND_UP(VALUE,SIZE) (ROUND_DOWN((VALUE) + (SIZE) - 1, (SIZE)))
+#if SIZEOF_VOID_P == 8
+#define UINTPTR_TYPE guint64
+#else
+#define UINTPTR_TYPE guint32
+#endif
static GHashTable *mmap_map = NULL;
static size_t alignment = 0;
+static CRITICAL_SECTION mmap_mutex;
static void
get_alignment (void)
@@ -65,6 +74,16 @@ mono_raw_buffer_free_malloc (void *base)
g_free (base);
}
+void
+mono_raw_buffer_init (void)
+{
+ InitializeCriticalSection (&mmap_mutex);
+
+ get_alignment ();
+
+ mmap_map = g_hash_table_new (NULL, NULL);
+}
+
static void *
mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
{
@@ -76,8 +95,6 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
void *ptr;
HANDLE file, mapping;
- if (alignment == 0)
- get_alignment ();
start = ROUND_DOWN (base, alignment);
end = base + size;
@@ -101,10 +118,9 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
return 0;
}
- if (mmap_map == NULL)
- mmap_map = g_hash_table_new (g_direct_hash, g_direct_equal);
-
+ EnterCriticalSection (&mmap_mutex);
g_hash_table_insert (mmap_map, ptr, GINT_TO_POINTER (mapping));
+ LeaveCriticalSection (&mmap_mutex);
return ((char *)ptr) + (base - start);
@@ -117,8 +133,6 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
int flags = 0;
void *ptr;
- if (alignment == 0)
- get_alignment ();
start = ROUND_DOWN (base, alignment);
end = ROUND_UP (base + size, alignment);
@@ -133,11 +147,20 @@ mono_raw_buffer_load_mmap (int fd, int is_writable, guint32 base, size_t size)
if (ptr == (void *) -1)
return 0;
+
+ /*
+ * This seems to prevent segmentation faults on Fedora Linux, no
+ * idea why :). See
+ * http://bugzilla.ximian.com/show_bug.cgi?id=49499
+ * for more info.
+ */
+ if (mprotect (ptr, end - start, prot | PROT_EXEC) != 0)
+ g_warning (G_GNUC_PRETTY_FUNCTION
+ ": mprotect failed: %s", g_strerror (errno));
- if (mmap_map == NULL)
- mmap_map = g_hash_table_new (g_direct_hash, g_direct_equal);
-
+ EnterCriticalSection (&mmap_mutex);
g_hash_table_insert (mmap_map, ptr, GINT_TO_POINTER (size));
+ LeaveCriticalSection (&mmap_mutex);
return ((char *)ptr) + (base - start);
#endif
@@ -148,7 +171,9 @@ mono_raw_buffer_free_mmap (void *base)
{
int value;
+ EnterCriticalSection (&mmap_mutex);
value = GPOINTER_TO_INT (g_hash_table_lookup (mmap_map, base));
+ LeaveCriticalSection (&mmap_mutex);
#ifdef USE_WIN32_API
UnmapViewOfFile (base);
@@ -184,10 +209,14 @@ void
mono_raw_buffer_update (void *buffer, size_t size)
{
char *mmap_base;
+ gboolean exists;
- mmap_base = GINT_TO_POINTER (ROUND_DOWN (GPOINTER_TO_INT (buffer), alignment));
-
- if (mmap_map && g_hash_table_lookup (mmap_map, mmap_base))
+ mmap_base = (gpointer)(ROUND_DOWN ((UINTPTR_TYPE) (buffer), alignment));
+
+ EnterCriticalSection (&mmap_mutex);
+ exists = g_hash_table_lookup (mmap_map, mmap_base) != NULL;
+ LeaveCriticalSection (&mmap_mutex);
+ if (exists)
mono_raw_buffer_update_mmap (mmap_base, size);
}
@@ -195,10 +224,12 @@ void
mono_raw_buffer_free (void *buffer)
{
char *mmap_base;
+ gboolean exists;
- mmap_base = GINT_TO_POINTER (ROUND_DOWN (GPOINTER_TO_INT (buffer), alignment));
+ mmap_base = (gpointer)(ROUND_DOWN ((UINTPTR_TYPE) (buffer), alignment));
- if (mmap_map && g_hash_table_lookup (mmap_map, mmap_base))
+ exists = g_hash_table_lookup (mmap_map, mmap_base) != NULL;
+ if (exists)
mono_raw_buffer_free_mmap (mmap_base);
else
mono_raw_buffer_free_malloc (buffer);
diff --git a/mono/metadata/rawbuffer.h b/mono/metadata/rawbuffer.h
index 47232a2639f..6ff6aef3179 100644
--- a/mono/metadata/rawbuffer.h
+++ b/mono/metadata/rawbuffer.h
@@ -1,4 +1,10 @@
+#ifndef __MONO_RAWBUFFER_H__
+#define __MONO_RAWBUFFER_H__
+
+void mono_raw_buffer_init (void);
void *mono_raw_buffer_load (int fd, int writable, guint32 base, size_t size);
void mono_raw_buffer_update (void *buffer, size_t size);
void mono_raw_buffer_free (void *buffer);
+
+#endif /* __MONO_RAWBUFFER_H__ */
diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c
index c2287c8d20a..0cb30fdac88 100644
--- a/mono/metadata/reflection.c
+++ b/mono/metadata/reflection.c
@@ -1,4 +1,3 @@
-
/*
* reflection.c: Routines for creating an image at runtime.
*
@@ -9,24 +8,29 @@
*
*/
#include <config.h>
+#include "mono/utils/mono-digest.h"
#include "mono/metadata/reflection.h"
#include "mono/metadata/tabledefs.h"
+#include "mono/metadata/metadata-internals.h"
+#include "mono/metadata/class-internals.h"
#include "mono/metadata/tokentype.h"
-#include "mono/metadata/appdomain.h"
+#include "mono/metadata/domain-internals.h"
#include "mono/metadata/opcodes.h"
+#include "mono/metadata/assembly.h"
+#include "mono/metadata/object-internals.h"
+#include <mono/metadata/exception.h>
#include <stdio.h>
#include <glib.h>
#include <errno.h>
#include <time.h>
#include <string.h>
+#include <ctype.h>
#include "image.h"
#include "cil-coff.h"
#include "rawbuffer.h"
#include "mono-endian.h"
#include "private.h"
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#define TEXT_OFFSET 512
#define CLI_H_SIZE 136
@@ -38,7 +42,9 @@ typedef struct {
MonoReflectionILGen *ilgen;
MonoReflectionType *rtype;
MonoArray *parameters;
+ MonoArray *generic_params;
MonoArray *pinfo;
+ MonoArray *opt_types;
guint32 attrs;
guint32 iattrs;
guint32 call_conv;
@@ -47,8 +53,24 @@ typedef struct {
MonoObject *type;
MonoString *name;
MonoBoolean init_locals;
+ MonoArray *return_modreq;
+ MonoArray *return_modopt;
+ MonoArray *param_modreq;
+ MonoArray *param_modopt;
+ MonoArray *permissions;
+ MonoMethod *mhandle;
+ guint32 nrefs;
+ gpointer *refs;
+ /* for PInvoke */
+ int charset, lasterr, native_cc;
+ MonoString *dll, *dllentry;
} ReflectionMethodBuilder;
+typedef struct {
+ guint32 owner;
+ MonoReflectionGenericParam *gparam;
+} GenericParamTableEntry;
+
const unsigned char table_sizes [64] = {
MONO_MODULE_SIZE,
MONO_TYPEREF_SIZE,
@@ -92,21 +114,83 @@ const unsigned char table_sizes [64] = {
MONO_EXP_TYPE_SIZE,
MONO_MANIFEST_SIZE,
MONO_NESTED_CLASS_SIZE,
- 0 /* 0x2A */
+
+ MONO_GENERICPARAM_SIZE, /* 0x2A */
+ MONO_METHODSPEC_SIZE,
+ MONO_GENPARCONSTRAINT_SIZE,
+
+ 0 /* 0x2D */
};
-static guint32 mono_image_typedef_or_ref (MonoDynamicAssembly *assembly, MonoType *type);
-static guint32 mono_image_get_methodref_token (MonoDynamicAssembly *assembly, MonoMethod *method);
-static guint32 encode_marshal_blob (MonoDynamicAssembly *assembly, MonoReflectionMarshal *minfo);
+/**
+ * These macros can be used to allocate long living atomic data so it won't be
+ * tracked by the garbage collector. We use libgc because it's apparently faster
+ * than g_malloc.
+ */
+#ifdef HAVE_BOEHM_GC
+#define ALLOC_ATOMIC(size) GC_MALLOC_ATOMIC (size)
+#define FREE_ATOMIC(ptr)
+#define REALLOC_ATOMIC(ptr, size) GC_REALLOC ((ptr), (size))
+#else
+#define ALLOC_ATOMIC(size) g_malloc (size)
+#define FREE_ATOMIC(ptr) g_free (ptr)
+#define REALLOC_ATOMIC(ptr, size) g_realloc ((ptr), (size))
+#endif
+
+static void reflection_methodbuilder_from_method_builder (ReflectionMethodBuilder *rmb, MonoReflectionMethodBuilder *mb);
+static void reflection_methodbuilder_from_ctor_builder (ReflectionMethodBuilder *rmb, MonoReflectionCtorBuilder *mb);
+static guint32 mono_image_typedef_or_ref (MonoDynamicImage *assembly, MonoType *type);
+static guint32 mono_image_get_methodref_token (MonoDynamicImage *assembly, MonoMethod *method);
+static guint32 mono_image_get_methodbuilder_token (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb);
+static guint32 mono_image_get_ctorbuilder_token (MonoDynamicImage *assembly, MonoReflectionCtorBuilder *cb);
+static guint32 mono_image_get_sighelper_token (MonoDynamicImage *assembly, MonoReflectionSigHelper *helper);
+static void mono_image_get_generic_param_info (MonoReflectionGenericParam *gparam, guint32 owner, MonoDynamicImage *assembly);
+static guint32 encode_marshal_blob (MonoDynamicImage *assembly, MonoReflectionMarshal *minfo);
+static guint32 encode_constant (MonoDynamicImage *assembly, MonoObject *val, guint32 *ret_type);
+static char* type_get_qualified_name (MonoType *type, MonoAssembly *ass);
+static void ensure_runtime_vtable (MonoClass *klass);
+static gpointer resolve_object (MonoImage *image, MonoObject *obj);
+static void encode_type (MonoDynamicImage *assembly, MonoType *type, char *p, char **endbuf);
+static guint32 type_get_signature_size (MonoType *type);
+static void get_default_param_value_blobs (MonoMethod *method, char **blobs);
+static MonoObject *mono_get_object_from_blob (MonoDomain *domain, MonoType *type, const char *blob);
+
static void
alloc_table (MonoDynamicTable *table, guint nrows)
{
table->rows = nrows;
g_assert (table->columns);
- table->values = g_realloc (table->values, (1 + table->rows) * table->columns * sizeof (guint32));
+ if (nrows + 1 >= table->alloc_rows) {
+ while (nrows + 1 >= table->alloc_rows) {
+ if (table->alloc_rows == 0)
+ table->alloc_rows = 16;
+ else
+ table->alloc_rows *= 2;
+ }
+
+ if (table->values)
+ table->values = REALLOC_ATOMIC (table->values, (table->alloc_rows) * table->columns * sizeof (guint32));
+ else
+ table->values = ALLOC_ATOMIC ((table->alloc_rows) * table->columns * sizeof (guint32));
+ }
}
+static void
+make_room_in_stream (MonoDynamicStream *stream, int size)
+{
+ while (stream->alloc_size <= size) {
+ if (stream->alloc_size < 4096)
+ stream->alloc_size = 4096;
+ else
+ stream->alloc_size *= 2;
+ }
+ if (stream->data)
+ stream->data = REALLOC_ATOMIC (stream->data, stream->alloc_size);
+ else
+ stream->data = ALLOC_ATOMIC (stream->alloc_size);
+}
+
static guint32
string_heap_insert (MonoDynamicStream *sh, const char *str)
{
@@ -119,10 +203,9 @@ string_heap_insert (MonoDynamicStream *sh, const char *str)
len = strlen (str) + 1;
idx = sh->index;
- if (idx + len > sh->alloc_size) {
- sh->alloc_size += len + 4096;
- sh->data = g_realloc (sh->data, sh->alloc_size);
- }
+ if (idx + len > sh->alloc_size)
+ make_room_in_stream (sh, idx + len);
+
/*
* We strdup the string even if we already copy them in sh->data
* so that the string pointers in the hash remain valid even if
@@ -139,7 +222,7 @@ string_heap_init (MonoDynamicStream *sh)
{
sh->index = 0;
sh->alloc_size = 4096;
- sh->data = g_malloc (4096);
+ sh->data = ALLOC_ATOMIC (4096);
sh->hash = g_hash_table_new (g_str_hash, g_str_equal);
string_heap_insert (sh, "");
}
@@ -148,7 +231,7 @@ string_heap_init (MonoDynamicStream *sh)
static void
string_heap_free (MonoDynamicStream *sh)
{
- g_free (sh->data);
+ FREE_ATOMIC (sh->data);
g_hash_table_foreach (sh->hash, (GHFunc)g_free, NULL);
g_hash_table_destroy (sh->hash);
}
@@ -158,10 +241,8 @@ static guint32
mono_image_add_stream_data (MonoDynamicStream *stream, const char *data, guint32 len)
{
guint32 idx;
- if (stream->alloc_size < stream->index + len) {
- stream->alloc_size += len + 4096;
- stream->data = g_realloc (stream->data, stream->alloc_size);
- }
+ if (stream->alloc_size < stream->index + len)
+ make_room_in_stream (stream, stream->index + len);
memcpy (stream->data + stream->index, data, len);
idx = stream->index;
stream->index += len;
@@ -176,10 +257,8 @@ static guint32
mono_image_add_stream_zero (MonoDynamicStream *stream, guint32 len)
{
guint32 idx;
- if (stream->alloc_size < stream->index + len) {
- stream->alloc_size += len + 4096;
- stream->data = g_realloc (stream->data, stream->alloc_size);
- }
+ if (stream->alloc_size < stream->index + len)
+ make_room_in_stream (stream, stream->index + len);
memset (stream->data + stream->index, 0, len);
idx = stream->index;
stream->index += len;
@@ -197,8 +276,211 @@ stream_data_align (MonoDynamicStream *stream)
mono_image_add_stream_data (stream, buf, 4 - count);
}
+static int
+mono_blob_entry_hash (const char* str)
+{
+ guint len, h;
+ const char *end;
+ len = mono_metadata_decode_blob_size (str, &str);
+ if (len > 0) {
+ end = str + len;
+ h = *str;
+ for (str += 1; str < end; str++)
+ h = (h << 5) - h + *str;
+ return h;
+ } else {
+ return 0;
+ }
+}
+
+static gboolean
+mono_blob_entry_equal (const char *str1, const char *str2) {
+ int len, len2;
+ const char *end1;
+ const char *end2;
+ len = mono_metadata_decode_blob_size (str1, &end1);
+ len2 = mono_metadata_decode_blob_size (str2, &end2);
+ if (len != len2)
+ return 0;
+ return memcmp (end1, end2, len) == 0;
+}
+
+static guint32
+add_to_blob_cached (MonoDynamicImage *assembly, char *b1, int s1, char *b2, int s2)
+{
+ guint32 idx;
+ char *copy;
+ gpointer oldkey, oldval;
+
+ copy = ALLOC_ATOMIC (s1+s2);
+ memcpy (copy, b1, s1);
+ memcpy (copy + s1, b2, s2);
+ if (mono_g_hash_table_lookup_extended (assembly->blob_cache, copy, &oldkey, &oldval)) {
+ FREE_ATOMIC (copy);
+ idx = GPOINTER_TO_UINT (oldval);
+ } else {
+ idx = mono_image_add_stream_data (&assembly->blob, b1, s1);
+ mono_image_add_stream_data (&assembly->blob, b2, s2);
+ mono_g_hash_table_insert (assembly->blob_cache, copy, GUINT_TO_POINTER (idx));
+ }
+ return idx;
+}
+
+/*
+ * Copy len * nelem bytes from val to dest, swapping bytes to LE if necessary.
+ * dest may be misaligned.
+ */
+static void
+swap_with_size (char *dest, const char* val, int len, int nelem) {
+#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+ int elem;
+
+ for (elem = 0; elem < nelem; ++elem) {
+ switch (len) {
+ case 1:
+ *dest = *val;
+ break;
+ case 2:
+ dest [0] = val [1];
+ dest [1] = val [0];
+ break;
+ case 4:
+ dest [0] = val [3];
+ dest [1] = val [2];
+ dest [2] = val [1];
+ dest [3] = val [0];
+ break;
+ case 8:
+ dest [0] = val [7];
+ dest [1] = val [6];
+ dest [2] = val [5];
+ dest [3] = val [4];
+ dest [4] = val [3];
+ dest [5] = val [2];
+ dest [6] = val [1];
+ dest [7] = val [0];
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ dest += len;
+ val += len;
+ }
+#else
+ memcpy (dest, val, len * nelem);
+#endif
+}
+
+static guint32
+add_mono_string_to_blob_cached (MonoDynamicImage *assembly, MonoString *str)
+{
+ char blob_size [64];
+ char *b = blob_size;
+ guint32 idx = 0, len;
+
+ len = str->length * 2;
+ mono_metadata_encode_value (len, b, &b);
+#if G_BYTE_ORDER != G_LITTLE_ENDIAN
+ {
+ char *swapped = g_malloc (2 * mono_string_length (str));
+ const char *p = (const char*)mono_string_chars (str);
+
+ swap_with_size (swapped, p, 2, mono_string_length (str));
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, swapped, len);
+ g_free (swapped);
+ }
+#else
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, (char*)mono_string_chars (str), len);
+#endif
+ return idx;
+}
+
+/* modified version needed to handle building corlib */
+static MonoClass*
+my_mono_class_from_mono_type (MonoType *type) {
+ switch (type->type) {
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_GENERICINST:
+ return mono_class_from_mono_type (type);
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ g_assert (type->data.generic_param->pklass);
+ return type->data.generic_param->pklass;
+ default:
+ /* should be always valid when we reach this case... */
+ return type->data.klass;
+ }
+}
+
+static MonoClass *
+default_class_from_mono_type (MonoType *type)
+{
+ switch (type->type) {
+ case MONO_TYPE_OBJECT:
+ return mono_defaults.object_class;
+ case MONO_TYPE_VOID:
+ return mono_defaults.void_class;
+ case MONO_TYPE_BOOLEAN:
+ return mono_defaults.boolean_class;
+ case MONO_TYPE_CHAR:
+ return mono_defaults.char_class;
+ case MONO_TYPE_I1:
+ return mono_defaults.sbyte_class;
+ case MONO_TYPE_U1:
+ return mono_defaults.byte_class;
+ case MONO_TYPE_I2:
+ return mono_defaults.int16_class;
+ case MONO_TYPE_U2:
+ return mono_defaults.uint16_class;
+ case MONO_TYPE_I4:
+ return mono_defaults.int32_class;
+ case MONO_TYPE_U4:
+ return mono_defaults.uint32_class;
+ case MONO_TYPE_I:
+ return mono_defaults.int_class;
+ case MONO_TYPE_U:
+ return mono_defaults.uint_class;
+ case MONO_TYPE_I8:
+ return mono_defaults.int64_class;
+ case MONO_TYPE_U8:
+ return mono_defaults.uint64_class;
+ case MONO_TYPE_R4:
+ return mono_defaults.single_class;
+ case MONO_TYPE_R8:
+ return mono_defaults.double_class;
+ case MONO_TYPE_STRING:
+ return mono_defaults.string_class;
+ default:
+ g_warning ("implement me 0x%02x\n", type->type);
+ g_assert_not_reached ();
+ }
+
+ return NULL;
+}
+
+static void
+encode_generic_inst (MonoDynamicImage *assembly, MonoGenericInst *ginst, char *p, char **endbuf)
+{
+ int i;
+
+ if (!ginst) {
+ g_assert_not_reached ();
+ return;
+ }
+
+ mono_metadata_encode_value (MONO_TYPE_GENERICINST, p, &p);
+ encode_type (assembly, ginst->generic_type, p, &p);
+ mono_metadata_encode_value (ginst->type_argc, p, &p);
+ for (i = 0; i < ginst->type_argc; ++i)
+ encode_type (assembly, ginst->type_argv [i], p, &p);
+
+ *endbuf = p;
+}
+
static void
-encode_type (MonoDynamicAssembly *assembly, MonoType *type, char *p, char **endbuf)
+encode_type (MonoDynamicImage *assembly, MonoType *type, char *p, char **endbuf)
{
if (!type) {
g_assert_not_reached ();
@@ -230,32 +512,40 @@ encode_type (MonoDynamicAssembly *assembly, MonoType *type, char *p, char **endb
mono_metadata_encode_value (type->type, p, &p);
break;
case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
mono_metadata_encode_value (type->type, p, &p);
encode_type (assembly, type->data.type, p, &p);
break;
- case MONO_TYPE_VALUETYPE:
- case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
mono_metadata_encode_value (type->type, p, &p);
- mono_metadata_encode_value (mono_image_typedef_or_ref (assembly, type), p, &p);
+ encode_type (assembly, &type->data.klass->byval_arg, p, &p);
break;
-#if 0
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_CLASS: {
MonoClass *k = mono_class_from_mono_type (type);
mono_metadata_encode_value (type->type, p, &p);
- /* ensure only non-byref gets passed to mono_image_typedef_or_ref() */
+ /*
+ * ensure only non-byref gets passed to mono_image_typedef_or_ref(),
+ * otherwise two typerefs could point to the same type, leading to
+ * verification errors.
+ */
mono_metadata_encode_value (mono_image_typedef_or_ref (assembly, &k->byval_arg), p, &p);
break;
}
-#endif
case MONO_TYPE_ARRAY:
mono_metadata_encode_value (type->type, p, &p);
- encode_type (assembly, type->data.array->type, p, &p);
+ encode_type (assembly, &type->data.array->eklass->byval_arg, p, &p);
mono_metadata_encode_value (type->data.array->rank, p, &p);
mono_metadata_encode_value (0, p, &p); /* FIXME: set to 0 for now */
mono_metadata_encode_value (0, p, &p);
break;
+ case MONO_TYPE_GENERICINST:
+ encode_generic_inst (assembly, type->data.generic_inst, p, &p);
+ break;
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ mono_metadata_encode_value (type->type, p, &p);
+ mono_metadata_encode_value (type->data.generic_param->num, p, &p);
+ break;
default:
g_error ("need to encode type %x", type->type);
}
@@ -263,7 +553,7 @@ encode_type (MonoDynamicAssembly *assembly, MonoType *type, char *p, char **endb
}
static void
-encode_reflection_type (MonoDynamicAssembly *assembly, MonoReflectionType *type, char *p, char **endbuf)
+encode_reflection_type (MonoDynamicImage *assembly, MonoReflectionType *type, char *p, char **endbuf)
{
if (!type) {
mono_metadata_encode_value (MONO_TYPE_VOID, p, endbuf);
@@ -278,18 +568,133 @@ encode_reflection_type (MonoDynamicAssembly *assembly, MonoReflectionType *type,
}
+static void
+encode_custom_modifiers (MonoDynamicImage *assembly, MonoArray *modreq, MonoArray *modopt, char *p, char **endbuf)
+{
+ int i;
+
+ if (modreq) {
+ for (i = 0; i < mono_array_length (modreq); ++i) {
+ MonoReflectionType *mod = mono_array_get (modreq, MonoReflectionType*, i);
+ *p = MONO_TYPE_CMOD_REQD;
+ p++;
+ mono_metadata_encode_value (mono_image_typedef_or_ref (assembly, mod->type), p, &p);
+ }
+ }
+ if (modopt) {
+ for (i = 0; i < mono_array_length (modopt); ++i) {
+ MonoReflectionType *mod = mono_array_get (modopt, MonoReflectionType*, i);
+ *p = MONO_TYPE_CMOD_OPT;
+ p++;
+ mono_metadata_encode_value (mono_image_typedef_or_ref (assembly, mod->type), p, &p);
+ }
+ }
+ *endbuf = p;
+}
+
static guint32
-method_encode_signature (MonoDynamicAssembly *assembly, MonoMethodSignature *sig)
+generic_inst_get_signature_size (MonoGenericInst *ginst)
+{
+ guint32 size = 0;
+ int i;
+
+ if (!ginst) {
+ g_assert_not_reached ();
+ }
+
+ size += 1 + type_get_signature_size (ginst->generic_type);
+ size += 4;
+ for (i = 0; i < ginst->type_argc; ++i)
+ size += type_get_signature_size (ginst->type_argv [i]);
+
+ return size;
+}
+
+static guint32
+type_get_signature_size (MonoType *type)
+{
+ guint32 size = 0;
+
+ if (!type) {
+ g_assert_not_reached ();
+ }
+
+ if (type->byref)
+ size++;
+
+ switch (type->type){
+ case MONO_TYPE_VOID:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_TYPEDBYREF:
+ return size + 1;
+ case MONO_TYPE_PTR:
+ return size + 1 + type_get_signature_size (type->data.type);
+ case MONO_TYPE_SZARRAY:
+ return size + 1 + type_get_signature_size (&type->data.klass->byval_arg);
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_CLASS:
+ return size + 5;
+ case MONO_TYPE_ARRAY:
+ return size + 7 + type_get_signature_size (&type->data.array->eklass->byval_arg);
+ case MONO_TYPE_GENERICINST:
+ return size + generic_inst_get_signature_size (type->data.generic_inst);
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ return size + 5;
+ default:
+ g_error ("need to encode type %x", type->type);
+ return size;
+ }
+}
+
+static guint32
+method_get_signature_size (MonoMethodSignature *sig)
+{
+ guint32 size;
+ int i;
+
+ size = type_get_signature_size (sig->ret);
+ for (i = 0; i < sig->param_count; i++)
+ size += type_get_signature_size (sig->params [i]);
+
+ if (sig->generic_param_count)
+ size += 4;
+ if (sig->sentinelpos >= 0)
+ size++;
+
+ return size;
+}
+
+static guint32
+method_encode_signature (MonoDynamicImage *assembly, MonoMethodSignature *sig)
{
char *buf;
char *p;
int i;
guint32 nparams = sig->param_count;
- guint32 size = 10 + nparams * 10;
+ guint32 size = 11 + method_get_signature_size (sig);
guint32 idx;
char blob_size [6];
char *b = blob_size;
-
+
+ if (!assembly->save)
+ return 0;
+
p = buf = g_malloc (size);
/*
* FIXME: vararg, explicit_this, differenc call_conv values...
@@ -297,22 +702,28 @@ method_encode_signature (MonoDynamicAssembly *assembly, MonoMethodSignature *sig
*p = sig->call_convention;
if (sig->hasthis)
*p |= 0x20; /* hasthis */
+ if (sig->generic_param_count)
+ *p |= 0x10; /* generic */
p++;
+ if (sig->generic_param_count)
+ mono_metadata_encode_value (sig->generic_param_count, p, &p);
mono_metadata_encode_value (nparams, p, &p);
encode_type (assembly, sig->ret, p, &p);
- for (i = 0; i < nparams; ++i)
+ for (i = 0; i < nparams; ++i) {
+ if (i == sig->sentinelpos)
+ *p++ = MONO_TYPE_SENTINEL;
encode_type (assembly, sig->params [i], p, &p);
+ }
/* store length */
g_assert (p - buf < size);
mono_metadata_encode_value (p-buf, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, buf, p-buf);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
g_free (buf);
return idx;
}
static guint32
-method_builder_encode_signature (MonoDynamicAssembly *assembly, ReflectionMethodBuilder *mb)
+method_builder_encode_signature (MonoDynamicImage *assembly, ReflectionMethodBuilder *mb)
{
/*
* FIXME: reuse code from method_encode_signature().
@@ -321,11 +732,13 @@ method_builder_encode_signature (MonoDynamicAssembly *assembly, ReflectionMethod
char *p;
int i;
guint32 nparams = mb->parameters ? mono_array_length (mb->parameters): 0;
- guint32 size = 10 + nparams * 10;
+ guint32 ngparams = mb->generic_params ? mono_array_length (mb->generic_params): 0;
+ guint32 notypes = mb->opt_types ? mono_array_length (mb->opt_types): 0;
+ guint32 size = 21 + nparams * 20 + notypes * 20;
guint32 idx;
char blob_size [6];
char *b = blob_size;
-
+
p = buf = g_malloc (size);
/* LAMESPEC: all the call conv spec is foobared */
*p = mb->call_conv & 0x60; /* has-this, explicit-this */
@@ -333,24 +746,46 @@ method_builder_encode_signature (MonoDynamicAssembly *assembly, ReflectionMethod
*p |= 0x5; /* vararg */
if (!(mb->attrs & METHOD_ATTRIBUTE_STATIC))
*p |= 0x20; /* hasthis */
+ if (ngparams)
+ *p |= 0x10; /* generic */
p++;
- mono_metadata_encode_value (nparams, p, &p);
+ if (ngparams)
+ mono_metadata_encode_value (ngparams, p, &p);
+ mono_metadata_encode_value (nparams + notypes, p, &p);
+ encode_custom_modifiers (assembly, mb->return_modreq, mb->return_modopt, p, &p);
encode_reflection_type (assembly, mb->rtype, p, &p);
for (i = 0; i < nparams; ++i) {
- MonoReflectionType *pt = mono_array_get (mb->parameters, MonoReflectionType*, i);
+ MonoArray *modreq = NULL;
+ MonoArray *modopt = NULL;
+ MonoReflectionType *pt;
+
+ if (mb->param_modreq && (i < mono_array_length (mb->param_modreq)))
+ modreq = mono_array_get (mb->param_modreq, MonoArray*, i);
+ if (mb->param_modopt && (i < mono_array_length (mb->param_modopt)))
+ modopt = mono_array_get (mb->param_modopt, MonoArray*, i);
+ encode_custom_modifiers (assembly, modreq, modopt, p, &p);
+ pt = mono_array_get (mb->parameters, MonoReflectionType*, i);
+ encode_reflection_type (assembly, pt, p, &p);
+ }
+ if (notypes)
+ *p++ = MONO_TYPE_SENTINEL;
+ for (i = 0; i < notypes; ++i) {
+ MonoReflectionType *pt;
+
+ pt = mono_array_get (mb->opt_types, MonoReflectionType*, i);
encode_reflection_type (assembly, pt, p, &p);
}
+
/* store length */
g_assert (p - buf < size);
mono_metadata_encode_value (p-buf, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, buf, p-buf);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
g_free (buf);
return idx;
}
static guint32
-encode_locals (MonoDynamicAssembly *assembly, MonoReflectionILGen *ilgen)
+encode_locals (MonoDynamicImage *assembly, MonoReflectionILGen *ilgen)
{
MonoDynamicTable *table;
guint32 *values;
@@ -374,12 +809,15 @@ encode_locals (MonoDynamicAssembly *assembly, MonoReflectionILGen *ilgen)
mono_metadata_encode_value (nl, p, &p);
for (i = 0; i < nl; ++i) {
MonoReflectionLocalBuilder *lb = mono_array_get (ilgen->locals, MonoReflectionLocalBuilder*, i);
+
+ if (lb->is_pinned)
+ mono_metadata_encode_value (MONO_TYPE_PINNED, p, &p);
+
encode_reflection_type (assembly, lb->type, p, &p);
}
g_assert (p - buf < size);
mono_metadata_encode_value (p-buf, b, &b);
- sig_idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, buf, p-buf);
+ sig_idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
g_free (buf);
values [MONO_STAND_ALONE_SIGNATURE] = sig_idx;
@@ -388,7 +826,70 @@ encode_locals (MonoDynamicAssembly *assembly, MonoReflectionILGen *ilgen)
}
static guint32
-method_encode_code (MonoDynamicAssembly *assembly, ReflectionMethodBuilder *mb)
+method_count_clauses (MonoReflectionILGen *ilgen)
+{
+ guint32 num_clauses = 0;
+ int i;
+
+ MonoILExceptionInfo *ex_info;
+ for (i = 0; i < mono_array_length (ilgen->ex_handlers); ++i) {
+ ex_info = (MonoILExceptionInfo*)mono_array_addr (ilgen->ex_handlers, MonoILExceptionInfo, i);
+ if (ex_info->handlers)
+ num_clauses += mono_array_length (ex_info->handlers);
+ else
+ num_clauses++;
+ }
+
+ return num_clauses;
+}
+
+static MonoExceptionClause*
+method_encode_clauses (MonoDynamicImage *assembly, MonoReflectionILGen *ilgen, guint32 num_clauses)
+{
+ MonoExceptionClause *clauses;
+ MonoExceptionClause *clause;
+ MonoILExceptionInfo *ex_info;
+ MonoILExceptionBlock *ex_block;
+ guint32 finally_start;
+ int i, j, clause_index;;
+
+ clauses = g_new0 (MonoExceptionClause, num_clauses);
+
+ clause_index = 0;
+ for (i = mono_array_length (ilgen->ex_handlers) - 1; i >= 0; --i) {
+ ex_info = (MonoILExceptionInfo*)mono_array_addr (ilgen->ex_handlers, MonoILExceptionInfo, i);
+ finally_start = ex_info->start + ex_info->len;
+ g_assert (ex_info->handlers);
+ for (j = 0; j < mono_array_length (ex_info->handlers); ++j) {
+ ex_block = (MonoILExceptionBlock*)mono_array_addr (ex_info->handlers, MonoILExceptionBlock, j);
+ clause = &(clauses [clause_index]);
+
+ clause->flags = ex_block->type;
+ clause->try_offset = ex_info->start;
+
+ if (ex_block->type == MONO_EXCEPTION_CLAUSE_FINALLY)
+ clause->try_len = finally_start - ex_info->start;
+ else
+ clause->try_len = ex_info->len;
+ clause->handler_offset = ex_block->start;
+ clause->handler_len = ex_block->len;
+ if (ex_block->extype) {
+ clause->data.catch_class = mono_class_from_mono_type (ex_block->extype->type);
+ } else {
+ /* FIXME: handle filters */
+ clause->data.filter_offset = 0;
+ }
+ finally_start = ex_block->start + ex_block->len;
+
+ clause_index ++;
+ }
+ }
+
+ return clauses;
+}
+
+static guint32
+method_encode_code (MonoDynamicImage *assembly, ReflectionMethodBuilder *mb)
{
char flags = 0;
guint32 idx;
@@ -405,10 +906,8 @@ method_encode_code (MonoDynamicAssembly *assembly, ReflectionMethodBuilder *mb)
guint32 header_size = 12;
MonoArray *code;
- if ((mb->attrs & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
- (mb->iattrs & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
- (mb->iattrs & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
- (mb->attrs & METHOD_ATTRIBUTE_ABSTRACT))
+ if ((mb->attrs & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT)) ||
+ (mb->iattrs & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)))
return 0;
/*if (mb->name)
@@ -418,22 +917,25 @@ method_encode_code (MonoDynamicAssembly *assembly, ReflectionMethodBuilder *mb)
code_size = mb->ilgen->code_len;
max_stack = mb->ilgen->max_stack;
num_locals = mb->ilgen->locals ? mono_array_length (mb->ilgen->locals) : 0;
- if (mb->ilgen->ex_handlers) {
- MonoILExceptionInfo *ex_info;
- for (i = 0; i < mono_array_length (mb->ilgen->ex_handlers); ++i) {
- ex_info = (MonoILExceptionInfo*)mono_array_addr (mb->ilgen->ex_handlers, MonoILExceptionInfo, i);
- if (ex_info->handlers)
- num_exception += mono_array_length (ex_info->handlers);
- else
- num_exception++;
- }
- }
+ if (mb->ilgen->ex_handlers)
+ num_exception = method_count_clauses (mb->ilgen);
} else {
code = mb->code;
+ if (code == NULL){
+ char *name = mono_string_to_utf8 (mb->name);
+ char *str = g_strdup_printf ("Method %s does not have any IL associated", name);
+ MonoException *exception = mono_get_exception_argument (NULL, "a method does not have any IL associated");
+ g_free (str);
+ g_free (name);
+ mono_raise_exception (exception);
+ }
+
code_size = mono_array_length (code);
max_stack = 8; /* we probably need to run a verifier on the code... */
}
+ stream_data_align (&assembly->code);
+
/* check for exceptions, maxstack, locals */
maybe_small = (max_stack <= 8) && (!num_locals) && (!num_exception);
if (maybe_small) {
@@ -479,7 +981,6 @@ fat_header:
mono_image_add_stream_data (&assembly->code, mono_array_addr (code, char, 0), code_size);
if (num_exception) {
unsigned char sheader [4];
- MonoExceptionClause clause;
MonoILExceptionInfo * ex_info;
MonoILExceptionBlock * ex_block;
int j;
@@ -487,7 +988,8 @@ fat_header:
stream_data_align (&assembly->code);
/* always use fat format for now */
sheader [0] = METHOD_HEADER_SECTION_FAT_FORMAT | METHOD_HEADER_SECTION_EHTABLE;
- num_exception *= sizeof (MonoExceptionClause);
+ num_exception *= 6 * sizeof (guint32);
+ num_exception += 4; /* include the size of the header */
sheader [1] = num_exception & 0xff;
sheader [2] = (num_exception >> 8) & 0xff;
sheader [3] = (num_exception >> 16) & 0xff;
@@ -499,23 +1001,37 @@ fat_header:
if (ex_info->handlers) {
int finally_start = ex_info->start + ex_info->len;
for (j = 0; j < mono_array_length (ex_info->handlers); ++j) {
+ guint32 val;
ex_block = (MonoILExceptionBlock*)mono_array_addr (ex_info->handlers, MonoILExceptionBlock, j);
- clause.flags = GUINT32_TO_LE (ex_block->type);
- clause.try_offset = GUINT32_TO_LE (ex_info->start);
+ /* the flags */
+ val = GUINT32_TO_LE (ex_block->type);
+ mono_image_add_stream_data (&assembly->code, (char*)&val, sizeof (guint32));
+ /* try offset */
+ val = GUINT32_TO_LE (ex_info->start);
+ mono_image_add_stream_data (&assembly->code, (char*)&val, sizeof (guint32));
/* need fault, too, probably */
if (ex_block->type == MONO_EXCEPTION_CLAUSE_FINALLY)
- clause.try_len = GUINT32_TO_LE (finally_start - ex_info->start);
+ val = GUINT32_TO_LE (finally_start - ex_info->start);
else
- clause.try_len = GUINT32_TO_LE (ex_info->len);
- clause.handler_offset = GUINT32_TO_LE (ex_block->start);
- clause.handler_len = GUINT32_TO_LE (ex_block->len);
- finally_start = clause.handler_offset + clause.handler_len;
- clause.token_or_filter = ex_block->extype ? mono_metadata_token_from_dor (
- mono_image_typedef_or_ref (assembly, ex_block->extype->type)): 0;
- clause.token_or_filter = GUINT32_TO_LE (clause.token_or_filter);
+ val = GUINT32_TO_LE (ex_info->len);
+ mono_image_add_stream_data (&assembly->code, (char*)&val, sizeof (guint32));
+ /* handler offset */
+ val = GUINT32_TO_LE (ex_block->start);
+ mono_image_add_stream_data (&assembly->code, (char*)&val, sizeof (guint32));
+ /* handler len */
+ val = GUINT32_TO_LE (ex_block->len);
+ mono_image_add_stream_data (&assembly->code, (char*)&val, sizeof (guint32));
+ finally_start = ex_block->start + ex_block->len;
+ if (ex_block->extype) {
+ val = mono_metadata_token_from_dor (mono_image_typedef_or_ref (assembly, ex_block->extype->type));
+ } else {
+ /* FIXME: handle filters */
+ val = 0;
+ }
+ val = GUINT32_TO_LE (val);
+ mono_image_add_stream_data (&assembly->code, (char*)&val, sizeof (guint32));
/*g_print ("out clause %d: from %d len=%d, handler at %d, %d, finally_start=%d, ex_info->start=%d, ex_info->len=%d, ex_block->type=%d, j=%d, i=%d\n",
clause.flags, clause.try_offset, clause.try_len, clause.handler_offset, clause.handler_len, finally_start, ex_info->start, ex_info->len, ex_block->type, j, i);*/
- mono_image_add_stream_data (&assembly->code, (char*)&clause, sizeof (clause));
}
} else {
g_error ("No clauses for ex info block %d", i);
@@ -526,7 +1042,7 @@ fat_header:
}
static guint32
-find_index_in_table (MonoDynamicAssembly *assembly, int table_idx, int col, guint32 token)
+find_index_in_table (MonoDynamicImage *assembly, int table_idx, int col, guint32 token)
{
int i;
MonoDynamicTable *table;
@@ -540,16 +1056,71 @@ find_index_in_table (MonoDynamicAssembly *assembly, int table_idx, int col, guin
for (i = 1; i <= table->rows; ++i) {
if (values [col] == token)
return i;
+ values += table->columns;
}
return 0;
}
+static GHashTable *dynamic_custom_attrs = NULL;
+
+static MonoCustomAttrInfo*
+mono_custom_attrs_from_builders (MonoImage *image, MonoArray *cattrs)
+{
+ int i, count;
+ MonoCustomAttrInfo *ainfo;
+ MonoReflectionCustomAttr *cattr;
+
+ if (!cattrs)
+ return NULL;
+ /* FIXME: check in assembly the Run flag is set */
+
+ count = mono_array_length (cattrs);
+
+ ainfo = g_malloc0 (sizeof (MonoCustomAttrInfo) + sizeof (MonoCustomAttrEntry) * (count - MONO_ZERO_LEN_ARRAY));
+
+ ainfo->image = image;
+ ainfo->num_attrs = count;
+ for (i = 0; i < count; ++i) {
+ cattr = (MonoReflectionCustomAttr*)mono_array_get (cattrs, gpointer, i);
+ ainfo->attrs [i].ctor = cattr->ctor->method;
+ /* FIXME: might want to memdup the data here */
+ ainfo->attrs [i].data = mono_array_addr (cattr->data, char, 0);
+ ainfo->attrs [i].data_size = mono_array_length (cattr->data);
+ }
+
+ return ainfo;
+}
+
+static void
+mono_save_custom_attrs (MonoImage *image, void *obj, MonoArray *cattrs)
+{
+ MonoCustomAttrInfo *ainfo = mono_custom_attrs_from_builders (image, cattrs);
+
+ if (!ainfo)
+ return;
+
+ if (!dynamic_custom_attrs)
+ dynamic_custom_attrs = g_hash_table_new (NULL, NULL);
+
+ g_hash_table_insert (dynamic_custom_attrs, obj, ainfo);
+ ainfo->cached = TRUE;
+}
+
+void
+mono_custom_attrs_free (MonoCustomAttrInfo *ainfo)
+{
+ /* they are cached, so we don't free them */
+ if (dynamic_custom_attrs && g_hash_table_lookup (dynamic_custom_attrs, ainfo))
+ return;
+ g_free (ainfo);
+}
+
/*
* idx is the table index of the object
- * type is one of CUSTOM_ATTR_*
+ * type is one of MONO_CUSTOM_ATTR_*
*/
static void
-mono_image_add_cattrs (MonoDynamicAssembly *assembly, guint32 idx, guint32 type, MonoArray *cattrs)
+mono_image_add_cattrs (MonoDynamicImage *assembly, guint32 idx, guint32 type, MonoArray *cattrs)
{
MonoDynamicTable *table;
MonoReflectionCustomAttr *cattr;
@@ -566,41 +1137,86 @@ mono_image_add_cattrs (MonoDynamicAssembly *assembly, guint32 idx, guint32 type,
table->rows += count;
alloc_table (table, table->rows);
values = table->values + table->next_idx * MONO_CUSTOM_ATTR_SIZE;
- idx <<= CUSTOM_ATTR_BITS;
+ idx <<= MONO_CUSTOM_ATTR_BITS;
idx |= type;
for (i = 0; i < count; ++i) {
cattr = (MonoReflectionCustomAttr*)mono_array_get (cattrs, gpointer, i);
values [MONO_CUSTOM_ATTR_PARENT] = idx;
- token = mono_image_create_token (assembly, (MonoObject*)cattr->ctor);
+ token = mono_image_create_token (assembly, (MonoObject*)cattr->ctor, FALSE);
type = mono_metadata_token_index (token);
- type <<= CUSTOM_ATTR_TYPE_BITS;
+ type <<= MONO_CUSTOM_ATTR_TYPE_BITS;
switch (mono_metadata_token_table (token)) {
case MONO_TABLE_METHOD:
- type |= CUSTOM_ATTR_TYPE_METHODDEF;
+ type |= MONO_CUSTOM_ATTR_TYPE_METHODDEF;
break;
case MONO_TABLE_MEMBERREF:
- type |= CUSTOM_ATTR_TYPE_MEMBERREF;
+ type |= MONO_CUSTOM_ATTR_TYPE_MEMBERREF;
break;
default:
- g_error ("got wrong token in custom attr");
+ g_warning ("got wrong token in custom attr");
+ continue;
}
values [MONO_CUSTOM_ATTR_TYPE] = type;
p = blob_size;
mono_metadata_encode_value (mono_array_length (cattr->data), p, &p);
- values [MONO_CUSTOM_ATTR_VALUE] = mono_image_add_stream_data (&assembly->blob, blob_size, p - blob_size);
- mono_image_add_stream_data (&assembly->blob,
+ values [MONO_CUSTOM_ATTR_VALUE] = add_to_blob_cached (assembly, blob_size, p - blob_size,
mono_array_addr (cattr->data, char, 0), mono_array_length (cattr->data));
values += MONO_CUSTOM_ATTR_SIZE;
++table->next_idx;
}
}
+static void
+mono_image_add_decl_security (MonoDynamicImage *assembly, guint32 parent_token, MonoArray *permissions)
+{
+ MonoDynamicTable *table;
+ guint32 *values;
+ guint32 count, i, idx;
+ MonoReflectionPermissionSet *perm;
+
+ if (!permissions)
+ return;
+
+ count = mono_array_length (permissions);
+ table = &assembly->tables [MONO_TABLE_DECLSECURITY];
+ table->rows += count;
+ alloc_table (table, table->rows);
+
+ for (i = 0; i < mono_array_length (permissions); ++i) {
+ perm = (MonoReflectionPermissionSet*)mono_array_addr (permissions, MonoReflectionPermissionSet, i);
+
+ values = table->values + table->next_idx * MONO_DECL_SECURITY_SIZE;
+
+ idx = mono_metadata_token_index (parent_token);
+ idx <<= MONO_HAS_DECL_SECURITY_BITS;
+ switch (mono_metadata_token_table (parent_token)) {
+ case MONO_TABLE_TYPEDEF:
+ idx |= MONO_HAS_DECL_SECURITY_TYPEDEF;
+ break;
+ case MONO_TABLE_METHOD:
+ idx |= MONO_HAS_DECL_SECURITY_METHODDEF;
+ break;
+ case MONO_TABLE_ASSEMBLY:
+ idx |= MONO_HAS_DECL_SECURITY_ASSEMBLY;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ values [MONO_DECL_SECURITY_ACTION] = perm->action;
+ values [MONO_DECL_SECURITY_PARENT] = idx;
+ values [MONO_DECL_SECURITY_PERMISSIONSET] = add_mono_string_to_blob_cached (assembly, perm->pset);
+
+ ++table->next_idx;
+ }
+}
+
/*
* Fill in the MethodDef and ParamDef tables for a method.
* This is used for both normal methods and constructors.
*/
static void
-mono_image_basic_method (ReflectionMethodBuilder *mb, MonoDynamicAssembly *assembly)
+mono_image_basic_method (ReflectionMethodBuilder *mb, MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
guint32 *values;
@@ -610,14 +1226,11 @@ mono_image_basic_method (ReflectionMethodBuilder *mb, MonoDynamicAssembly *assem
/* room in this table is already allocated */
table = &assembly->tables [MONO_TABLE_METHOD];
*mb->table_idx = table->next_idx ++;
+ mono_g_hash_table_insert (assembly->method_to_table_idx, mb->mhandle, GUINT_TO_POINTER ((*mb->table_idx)));
values = table->values + *mb->table_idx * MONO_METHOD_SIZE;
- if (mb->name) {
- name = mono_string_to_utf8 (mb->name);
- values [MONO_METHOD_NAME] = string_heap_insert (&assembly->sheap, name);
- g_free (name);
- } else { /* a constructor */
- values [MONO_METHOD_NAME] = string_heap_insert (&assembly->sheap, mb->attrs & METHOD_ATTRIBUTE_STATIC? ".cctor": ".ctor");
- }
+ name = mono_string_to_utf8 (mb->name);
+ values [MONO_METHOD_NAME] = string_heap_insert (&assembly->sheap, name);
+ g_free (name);
values [MONO_METHOD_FLAGS] = mb->attrs;
values [MONO_METHOD_IMPLFLAGS] = mb->iattrs;
values [MONO_METHOD_SIGNATURE] = method_builder_encode_signature (assembly, mb);
@@ -626,6 +1239,9 @@ mono_image_basic_method (ReflectionMethodBuilder *mb, MonoDynamicAssembly *assem
table = &assembly->tables [MONO_TABLE_PARAM];
values [MONO_METHOD_PARAMLIST] = table->next_idx;
+ mono_image_add_decl_security (assembly,
+ mono_metadata_make_token (MONO_TABLE_METHOD, *mb->table_idx), mb->permissions);
+
if (mb->pinfo) {
MonoDynamicTable *mtable;
guint32 *mvalues;
@@ -646,53 +1262,153 @@ mono_image_basic_method (ReflectionMethodBuilder *mb, MonoDynamicAssembly *assem
if ((pb = mono_array_get (mb->pinfo, MonoReflectionParamBuilder*, i))) {
values [MONO_PARAM_FLAGS] = pb->attrs;
values [MONO_PARAM_SEQUENCE] = i;
- name = mono_string_to_utf8 (pb->name);
- values [MONO_PARAM_NAME] = string_heap_insert (&assembly->sheap, name);
- g_free (name);
+ if (pb->name != NULL) {
+ name = mono_string_to_utf8 (pb->name);
+ values [MONO_PARAM_NAME] = string_heap_insert (&assembly->sheap, name);
+ g_free (name);
+ } else {
+ values [MONO_PARAM_NAME] = 0;
+ }
values += MONO_PARAM_SIZE;
if (pb->marshal_info) {
mtable->rows++;
alloc_table (mtable, mtable->rows);
mvalues = mtable->values + mtable->rows * MONO_FIELD_MARSHAL_SIZE;
- mvalues [MONO_FIELD_MARSHAL_PARENT] = (table->next_idx << HAS_FIELD_MARSHAL_BITS) | HAS_FIELD_MARSHAL_PARAMDEF;
+ mvalues [MONO_FIELD_MARSHAL_PARENT] = (table->next_idx << MONO_HAS_FIELD_MARSHAL_BITS) | MONO_HAS_FIELD_MARSHAL_PARAMDEF;
mvalues [MONO_FIELD_MARSHAL_NATIVE_TYPE] = encode_marshal_blob (assembly, pb->marshal_info);
}
- table->next_idx++;
+ pb->table_idx = table->next_idx++;
+ if (pb->attrs & PARAM_ATTRIBUTE_HAS_DEFAULT) {
+ guint32 field_type = 0;
+ mtable = &assembly->tables [MONO_TABLE_CONSTANT];
+ mtable->rows ++;
+ alloc_table (mtable, mtable->rows);
+ mvalues = mtable->values + mtable->rows * MONO_CONSTANT_SIZE;
+ mvalues [MONO_CONSTANT_PARENT] = MONO_HASCONSTANT_PARAM | (pb->table_idx << MONO_HASCONSTANT_BITS);
+ mvalues [MONO_CONSTANT_VALUE] = encode_constant (assembly, pb->def_value, &field_type);
+ mvalues [MONO_CONSTANT_TYPE] = field_type;
+ mvalues [MONO_CONSTANT_PADDING] = 0;
+ }
}
}
}
}
static void
-mono_image_get_method_info (MonoReflectionMethodBuilder *mb, MonoDynamicAssembly *assembly)
+reflection_methodbuilder_from_method_builder (ReflectionMethodBuilder *rmb, MonoReflectionMethodBuilder *mb)
+{
+ rmb->ilgen = mb->ilgen;
+ rmb->rtype = mb->rtype;
+ rmb->parameters = mb->parameters;
+ rmb->generic_params = mb->generic_params;
+ rmb->opt_types = NULL;
+ rmb->pinfo = mb->pinfo;
+ rmb->attrs = mb->attrs;
+ rmb->iattrs = mb->iattrs;
+ rmb->call_conv = mb->call_conv;
+ rmb->code = mb->code;
+ rmb->type = mb->type;
+ rmb->name = mb->name;
+ rmb->table_idx = &mb->table_idx;
+ rmb->init_locals = mb->init_locals;
+ rmb->return_modreq = mb->return_modreq;
+ rmb->return_modopt = mb->return_modopt;
+ rmb->param_modreq = mb->param_modreq;
+ rmb->param_modopt = mb->param_modopt;
+ rmb->permissions = mb->permissions;
+ rmb->mhandle = mb->mhandle;
+ rmb->nrefs = 0;
+ rmb->refs = NULL;
+
+ if (mb->dll) {
+ rmb->charset = rmb->charset & 0xf;
+ rmb->lasterr = rmb->charset & 0x40;
+ rmb->native_cc = rmb->native_cc;
+ rmb->dllentry = mb->dllentry;
+ rmb->dll = mb->dll;
+ }
+}
+
+static void
+reflection_methodbuilder_from_ctor_builder (ReflectionMethodBuilder *rmb, MonoReflectionCtorBuilder *mb)
+{
+ const char *name = mb->attrs & METHOD_ATTRIBUTE_STATIC ? ".cctor": ".ctor";
+
+ rmb->ilgen = mb->ilgen;
+ rmb->rtype = mono_type_get_object (mono_domain_get (), &mono_defaults.void_class->byval_arg);
+ rmb->parameters = mb->parameters;
+ rmb->generic_params = NULL;
+ rmb->opt_types = NULL;
+ rmb->pinfo = mb->pinfo;
+ rmb->attrs = mb->attrs;
+ rmb->iattrs = mb->iattrs;
+ rmb->call_conv = mb->call_conv;
+ rmb->code = NULL;
+ rmb->type = mb->type;
+ rmb->name = mono_string_new (mono_domain_get (), name);
+ rmb->table_idx = &mb->table_idx;
+ rmb->init_locals = mb->init_locals;
+ rmb->return_modreq = NULL;
+ rmb->return_modopt = NULL;
+ rmb->param_modreq = mb->param_modreq;
+ rmb->param_modopt = mb->param_modopt;
+ rmb->permissions = mb->permissions;
+ rmb->mhandle = mb->mhandle;
+ rmb->nrefs = 0;
+ rmb->refs = NULL;
+}
+
+static void
+reflection_methodbuilder_from_dynamic_method (ReflectionMethodBuilder *rmb, MonoReflectionDynamicMethod *mb)
+{
+ rmb->ilgen = mb->ilgen;
+ rmb->rtype = mb->rtype;
+ rmb->parameters = mb->parameters;
+ rmb->generic_params = NULL;
+ rmb->opt_types = NULL;
+ rmb->pinfo = NULL;
+ rmb->attrs = mb->attrs;
+ rmb->iattrs = 0;
+ rmb->call_conv = mb->call_conv;
+ rmb->code = NULL;
+ rmb->type = NULL;
+ rmb->name = mb->name;
+ rmb->table_idx = NULL;
+ rmb->init_locals = mb->init_locals;
+ rmb->return_modreq = NULL;
+ rmb->return_modopt = NULL;
+ rmb->param_modreq = NULL;
+ rmb->param_modopt = NULL;
+ rmb->permissions = NULL;
+ rmb->mhandle = mb->mhandle;
+ rmb->nrefs = 0;
+ rmb->refs = NULL;
+}
+
+static void
+mono_image_get_method_info (MonoReflectionMethodBuilder *mb, MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
guint32 *values;
char *name;
ReflectionMethodBuilder rmb;
+ int i;
- rmb.ilgen = mb->ilgen;
- rmb.rtype = mb->rtype;
- rmb.parameters = mb->parameters;
- rmb.pinfo = mb->pinfo;
- rmb.attrs = mb->attrs;
- rmb.iattrs = mb->iattrs;
- rmb.call_conv = mb->call_conv;
- rmb.code = mb->code;
- rmb.type = mb->type;
- rmb.name = mb->name;
- rmb.table_idx = &mb->table_idx;
- rmb.init_locals = mb->init_locals;
+ reflection_methodbuilder_from_method_builder (&rmb, mb);
mono_image_basic_method (&rmb, assembly);
if (mb->dll) { /* It's a P/Invoke method */
guint32 moduleref;
+ int charset = mb->charset & 0xf;
+ int lasterr = mb->charset & 0x40;
table = &assembly->tables [MONO_TABLE_IMPLMAP];
table->rows ++;
alloc_table (table, table->rows);
values = table->values + table->rows * MONO_IMPLMAP_SIZE;
- values [MONO_IMPLMAP_FLAGS] = (mb->native_cc << 8) | mb->charset;
+ /* map CharSet values to on-disk values */
+
+ values [MONO_IMPLMAP_FLAGS] = (mb->native_cc << 8) | (charset ? (charset - 1) * 2: 1) | lasterr;
values [MONO_IMPLMAP_MEMBER] = (mb->table_idx << 1) | 1; /* memberforwarded: method */
name = mono_string_to_utf8 (mb->dllentry);
values [MONO_IMPLMAP_NAME] = string_heap_insert (&assembly->sheap, name);
@@ -708,6 +1424,7 @@ mono_image_get_method_info (MonoReflectionMethodBuilder *mb, MonoDynamicAssembly
values [MONO_IMPLMAP_SCOPE] = table->rows;
}
}
+
if (mb->override_method) {
MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)mb->type;
guint32 tok;
@@ -716,68 +1433,106 @@ mono_image_get_method_info (MonoReflectionMethodBuilder *mb, MonoDynamicAssembly
alloc_table (table, table->rows);
values = table->values + table->rows * MONO_METHODIMPL_SIZE;
values [MONO_METHODIMPL_CLASS] = tb->table_idx;
- values [MONO_METHODIMPL_BODY] = METHODDEFORREF_METHODDEF | (mb->table_idx << METHODDEFORREF_BITS);
- tok = mono_image_create_token (assembly, (MonoObject*)mb->override_method);
+ values [MONO_METHODIMPL_BODY] = MONO_METHODDEFORREF_METHODDEF | (mb->table_idx << MONO_METHODDEFORREF_BITS);
+
+ tok = mono_image_create_token (assembly, (MonoObject*)mb->override_method, FALSE);
switch (mono_metadata_token_table (tok)) {
case MONO_TABLE_MEMBERREF:
- tok = (mono_metadata_token_index (tok) << METHODDEFORREF_BITS ) | METHODDEFORREF_METHODREF;
+ tok = (mono_metadata_token_index (tok) << MONO_METHODDEFORREF_BITS ) | MONO_METHODDEFORREF_METHODREF;
break;
case MONO_TABLE_METHOD:
- tok = (mono_metadata_token_index (tok) << METHODDEFORREF_BITS ) | METHODDEFORREF_METHODDEF;
+ tok = (mono_metadata_token_index (tok) << MONO_METHODDEFORREF_BITS ) | MONO_METHODDEFORREF_METHODDEF;
break;
default:
g_assert_not_reached ();
}
values [MONO_METHODIMPL_DECLARATION] = tok;
}
+
+ if (mb->generic_params) {
+ table = &assembly->tables [MONO_TABLE_GENERICPARAM];
+ table->rows += mono_array_length (mb->generic_params);
+ alloc_table (table, table->rows);
+ for (i = 0; i < mono_array_length (mb->generic_params); ++i) {
+ guint32 owner = MONO_TYPEORMETHOD_METHOD | (mb->table_idx << MONO_TYPEORMETHOD_BITS);
+
+ mono_image_get_generic_param_info (
+ mono_array_get (mb->generic_params, gpointer, i), owner, assembly);
+ }
+ }
+
}
static void
-mono_image_get_ctor_info (MonoDomain *domain, MonoReflectionCtorBuilder *mb, MonoDynamicAssembly *assembly)
+mono_image_get_ctor_info (MonoDomain *domain, MonoReflectionCtorBuilder *mb, MonoDynamicImage *assembly)
{
ReflectionMethodBuilder rmb;
- rmb.ilgen = mb->ilgen;
- rmb.rtype = mono_type_get_object (domain, &mono_defaults.void_class->byval_arg);
- rmb.parameters = mb->parameters;
- rmb.pinfo = mb->pinfo;
- rmb.attrs = mb->attrs;
- rmb.iattrs = mb->iattrs;
- rmb.call_conv = mb->call_conv;
- rmb.code = NULL;
- rmb.type = mb->type;
- rmb.name = NULL;
- rmb.table_idx = &mb->table_idx;
- rmb.init_locals = mb->init_locals;
+ reflection_methodbuilder_from_ctor_builder (&rmb, mb);
mono_image_basic_method (&rmb, assembly);
+}
+
+static char*
+type_get_fully_qualified_name (MonoType *type) {
+ char *name, *result;
+ MonoClass *klass;
+ MonoAssembly *ta;
+
+ name = mono_type_get_name (type);
+ klass = my_mono_class_from_mono_type (type);
+ ta = klass->image->assembly;
+ result = g_strdup_printf ("%s, %s, Version=%d.%d.%d.%d, Culture=%s, PublicKeyToken=%s",
+ name, ta->aname.name,
+ ta->aname.major, ta->aname.minor, ta->aname.build, ta->aname.revision,
+ ta->aname.culture && *ta->aname.culture? ta->aname.culture: "neutral",
+ ta->aname.public_key_token [0] ? (char *)ta->aname.public_key_token : "null");
+ g_free (name);
+ return result;
+}
+
+static char*
+type_get_qualified_name (MonoType *type, MonoAssembly *ass) {
+ MonoClass *klass;
+ MonoAssembly *ta;
+
+ klass = my_mono_class_from_mono_type (type);
+ if (!klass)
+ return mono_type_get_name (type);
+ ta = klass->image->assembly;
+ if (ta == ass || klass->image == mono_defaults.corlib)
+ return mono_type_get_name (type);
+
+ return type_get_fully_qualified_name (type);
}
static guint32
-fieldref_encode_signature (MonoDynamicAssembly *assembly, MonoClassField *field)
+fieldref_encode_signature (MonoDynamicImage *assembly, MonoType *type)
{
char blob_size [64];
char *b = blob_size;
char *p;
char* buf;
guint32 idx;
-
+
+ if (!assembly->save)
+ return 0;
+
p = buf = g_malloc (64);
mono_metadata_encode_value (0x06, p, &p);
/* encode custom attributes before the type */
- encode_type (assembly, field->type, p, &p);
+ encode_type (assembly, type, p, &p);
g_assert (p-buf < 64);
mono_metadata_encode_value (p-buf, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, buf, p-buf);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
g_free (buf);
return idx;
}
static guint32
-field_encode_signature (MonoDynamicAssembly *assembly, MonoReflectionFieldBuilder *fb)
+field_encode_signature (MonoDynamicImage *assembly, MonoReflectionFieldBuilder *fb)
{
char blob_size [64];
char *b = blob_size;
@@ -788,73 +1543,33 @@ field_encode_signature (MonoDynamicAssembly *assembly, MonoReflectionFieldBuilde
p = buf = g_malloc (64);
mono_metadata_encode_value (0x06, p, &p);
+ encode_custom_modifiers (assembly, fb->modreq, fb->modopt, p, &p);
/* encode custom attributes before the type */
encode_reflection_type (assembly, fb->type, p, &p);
g_assert (p-buf < 64);
mono_metadata_encode_value (p-buf, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, buf, p-buf);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
g_free (buf);
return idx;
}
-/*
- * Copy len * nelem bytes from val to dest, swapping bytes to LE if necessary.
- * dest may be misaligned.
- */
-static void
-swap_with_size (char *dest, const char* val, int len, int nelem) {
-#if G_BYTE_ORDER != G_LITTLE_ENDIAN
- int elem;
-
- for (elem = 0; elem < nelem; ++elem) {
- switch (len) {
- case 1:
- *dest = *val;
- break;
- case 2:
- dest [0] = val [1];
- dest [1] = val [0];
- break;
- case 4:
- dest [0] = val [3];
- dest [1] = val [2];
- dest [2] = val [1];
- dest [3] = val [0];
- break;
- case 8:
- dest [0] = val [7];
- dest [1] = val [6];
- dest [2] = val [5];
- dest [3] = val [4];
- dest [4] = val [3];
- dest [5] = val [2];
- dest [6] = val [1];
- dest [7] = val [0];
- break;
- default:
- g_assert_not_reached ();
- }
- dest += len;
- val += len;
- }
-#else
- memcpy (dest, val, len * nelem);
-#endif
-}
-
static guint32
-encode_constant (MonoDynamicAssembly *assembly, MonoObject *val, guint32 *ret_type) {
+encode_constant (MonoDynamicImage *assembly, MonoObject *val, guint32 *ret_type) {
char blob_size [64];
char *b = blob_size;
char *p, *box_val;
char* buf;
- guint32 idx, len;
+ guint32 idx = 0, len = 0, dummy = 0;
p = buf = g_malloc (64);
-
- box_val = ((char*)val) + sizeof (MonoObject);
- *ret_type = val->vtable->klass->byval_arg.type;
+ if (!val) {
+ *ret_type = MONO_TYPE_CLASS;
+ len = 4;
+ box_val = (char*)&dummy;
+ } else {
+ box_val = ((char*)val) + sizeof (MonoObject);
+ *ret_type = val->vtable->klass->byval_arg.type;
+ }
handle_enum:
switch (*ret_type) {
case MONO_TYPE_BOOLEAN:
@@ -883,23 +1598,24 @@ handle_enum:
goto handle_enum;
} else
g_error ("we can't encode valuetypes");
+ case MONO_TYPE_CLASS:
+ break;
case MONO_TYPE_STRING: {
MonoString *str = (MonoString*)val;
/* there is no signature */
len = str->length * 2;
mono_metadata_encode_value (len, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
{
char *swapped = g_malloc (2 * mono_string_length (str));
const char *p = (const char*)mono_string_chars (str);
swap_with_size (swapped, p, 2, mono_string_length (str));
- mono_image_add_stream_data (&assembly->blob, swapped, len);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, swapped, len);
g_free (swapped);
}
#else
- mono_image_add_stream_data (&assembly->blob, (const char*)mono_string_chars (str), len);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, (char*)mono_string_chars (str), len);
#endif
g_free (buf);
@@ -911,12 +1627,12 @@ handle_enum:
/* there is no signature */
mono_metadata_encode_value (len, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
- swap_with_size (blob_size, val, len, 1);
+ idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
+ swap_with_size (blob_size, box_val, len, 1);
mono_image_add_stream_data (&assembly->blob, blob_size, len);
#else
- mono_image_add_stream_data (&assembly->blob, box_val, len);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, box_val, len);
#endif
g_free (buf);
@@ -924,30 +1640,104 @@ handle_enum:
}
static guint32
-encode_marshal_blob (MonoDynamicAssembly *assembly, MonoReflectionMarshal *minfo) {
+encode_marshal_blob (MonoDynamicImage *assembly, MonoReflectionMarshal *minfo) {
char blob_size [64];
char *b = blob_size;
- char *p, *buf;
- guint32 idx, len;
+ char *p, *buf, *str;
+ guint32 idx, len, bufsize = 256;
- p = buf = g_malloc (256);
+ p = buf = g_malloc (bufsize);
switch (minfo->type) {
- /* FIXME: handle ARRAY and other unmanaged types that need extra info */
+ case MONO_NATIVE_BYVALTSTR:
+ case MONO_NATIVE_BYVALARRAY:
+ mono_metadata_encode_value (minfo->type, p, &p);
+ mono_metadata_encode_value (minfo->count, p, &p);
+ break;
+ case MONO_NATIVE_LPARRAY:
+ mono_metadata_encode_value (minfo->type, p, &p);
+ if (minfo->eltype || (minfo->count > 0)) {
+ mono_metadata_encode_value (minfo->eltype, p, &p);
+ if (minfo->count > 0) {
+ mono_metadata_encode_value (0, p, &p);
+ mono_metadata_encode_value (minfo->count, p, &p);
+ }
+ }
+ break;
+ case MONO_NATIVE_CUSTOM:
+ mono_metadata_encode_value (minfo->type, p, &p);
+ if (minfo->guid) {
+ str = mono_string_to_utf8 (minfo->guid);
+ len = strlen (str);
+ mono_metadata_encode_value (len, p, &p);
+ memcpy (p, str, len);
+ p += len;
+ g_free (str);
+ } else {
+ mono_metadata_encode_value (0, p, &p);
+ }
+ if (minfo->marshaltype) {
+ str = mono_string_to_utf8 (minfo->marshaltype);
+ len = strlen (str);
+ mono_metadata_encode_value (len, p, &p);
+ if (p + len >= buf + bufsize) {
+ idx = p - buf;
+ bufsize *= 2;
+ buf = g_realloc (buf, bufsize);
+ p = buf + idx;
+ }
+ memcpy (p, str, len);
+ p += len;
+ g_free (str);
+ } else {
+ mono_metadata_encode_value (0, p, &p);
+ }
+ if (minfo->marshaltyperef) {
+ str = type_get_fully_qualified_name (minfo->marshaltyperef->type);
+ len = strlen (str);
+ mono_metadata_encode_value (len, p, &p);
+ if (p + len >= buf + bufsize) {
+ idx = p - buf;
+ bufsize *= 2;
+ buf = g_realloc (buf, bufsize);
+ p = buf + idx;
+ }
+ memcpy (p, str, len);
+ p += len;
+ g_free (str);
+ } else {
+ mono_metadata_encode_value (0, p, &p);
+ }
+ if (minfo->mcookie) {
+ str = mono_string_to_utf8 (minfo->mcookie);
+ len = strlen (str);
+ mono_metadata_encode_value (len, p, &p);
+ if (p + len >= buf + bufsize) {
+ idx = p - buf;
+ bufsize *= 2;
+ buf = g_realloc (buf, bufsize);
+ p = buf + idx;
+ }
+ memcpy (p, str, len);
+ p += len;
+ g_free (str);
+ } else {
+ mono_metadata_encode_value (0, p, &p);
+ }
+ break;
default:
mono_metadata_encode_value (minfo->type, p, &p);
break;
}
len = p-buf;
mono_metadata_encode_value (len, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, buf, len);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, len);
g_free (buf);
return idx;
}
static void
-mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicAssembly *assembly)
+mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
guint32 *values;
@@ -958,6 +1748,7 @@ mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicAssembly *
fb->attrs |= FIELD_ATTRIBUTE_HAS_DEFAULT;
table = &assembly->tables [MONO_TABLE_FIELD];
fb->table_idx = table->next_idx ++;
+ mono_g_hash_table_insert (assembly->field_to_table_idx, fb->handle, GUINT_TO_POINTER (fb->table_idx));
values = table->values + fb->table_idx * MONO_FIELD_SIZE;
name = mono_string_to_utf8 (fb->name);
values [MONO_FIELD_NAME] = string_heap_insert (&assembly->sheap, name);
@@ -979,12 +1770,12 @@ mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicAssembly *
table->rows ++;
alloc_table (table, table->rows);
values = table->values + table->rows * MONO_CONSTANT_SIZE;
- values [MONO_CONSTANT_PARENT] = HASCONSTANT_FIEDDEF | (fb->table_idx << HASCONSTANT_BITS);
+ values [MONO_CONSTANT_PARENT] = MONO_HASCONSTANT_FIEDDEF | (fb->table_idx << MONO_HASCONSTANT_BITS);
values [MONO_CONSTANT_VALUE] = encode_constant (assembly, fb->def_value, &field_type);
values [MONO_CONSTANT_TYPE] = field_type;
values [MONO_CONSTANT_PADDING] = 0;
}
- if (fb->rva_data) {
+ if (fb->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA) {
guint32 rva_idx;
table = &assembly->tables [MONO_TABLE_FIELDRVA];
table->rows ++;
@@ -994,7 +1785,10 @@ mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicAssembly *
/*
* We store it in the code section because it's simpler for now.
*/
- rva_idx = mono_image_add_stream_data (&assembly->code, mono_array_addr (fb->rva_data, char, 0), mono_array_length (fb->rva_data));
+ if (fb->rva_data)
+ rva_idx = mono_image_add_stream_data (&assembly->code, mono_array_addr (fb->rva_data, char, 0), mono_array_length (fb->rva_data));
+ else
+ rva_idx = mono_image_add_stream_zero (&assembly->code, mono_class_value_size (fb->handle->parent, NULL));
values [MONO_FIELD_RVA_RVA] = rva_idx + assembly->text_rva;
}
if (fb->marshal_info) {
@@ -1002,23 +1796,26 @@ mono_image_get_field_info (MonoReflectionFieldBuilder *fb, MonoDynamicAssembly *
table->rows ++;
alloc_table (table, table->rows);
values = table->values + table->rows * MONO_FIELD_MARSHAL_SIZE;
- values [MONO_FIELD_MARSHAL_PARENT] = (fb->table_idx << HAS_FIELD_MARSHAL_BITS) | HAS_FIELD_MARSHAL_FIELDSREF;
+ values [MONO_FIELD_MARSHAL_PARENT] = (fb->table_idx << MONO_HAS_FIELD_MARSHAL_BITS) | MONO_HAS_FIELD_MARSHAL_FIELDSREF;
values [MONO_FIELD_MARSHAL_NATIVE_TYPE] = encode_marshal_blob (assembly, fb->marshal_info);
}
}
static guint32
-property_encode_signature (MonoDynamicAssembly *assembly, MonoReflectionPropertyBuilder *fb)
+property_encode_signature (MonoDynamicImage *assembly, MonoReflectionPropertyBuilder *fb)
{
char *buf, *p;
char blob_size [6];
char *b = blob_size;
guint32 nparams = 0;
MonoReflectionMethodBuilder *mb = fb->get_method;
+ MonoReflectionMethodBuilder *smb = fb->set_method;
guint32 idx, i, size;
if (mb && mb->parameters)
nparams = mono_array_length (mb->parameters);
+ if (!mb && smb && smb->parameters)
+ nparams = mono_array_length (smb->parameters) - 1;
size = 24 + nparams * 10;
buf = p = g_malloc (size);
*p = 0x08;
@@ -1031,19 +1828,23 @@ property_encode_signature (MonoDynamicAssembly *assembly, MonoReflectionProperty
encode_reflection_type (assembly, pt, p, &p);
}
} else {
- *p++ = 1; /* void: a property should probably not be allowed without a getter */
+ /* the property type is the last param */
+ encode_reflection_type (assembly, mono_array_get (smb->parameters, MonoReflectionType*, nparams), p, &p);
+ for (i = 0; i < nparams; ++i) {
+ MonoReflectionType *pt = mono_array_get (smb->parameters, MonoReflectionType*, i);
+ encode_reflection_type (assembly, pt, p, &p);
+ }
}
/* store length */
g_assert (p - buf < size);
mono_metadata_encode_value (p-buf, b, &b);
- idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, buf, p-buf);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
g_free (buf);
return idx;
}
static void
-mono_image_get_property_info (MonoReflectionPropertyBuilder *pb, MonoDynamicAssembly *assembly)
+mono_image_get_property_info (MonoReflectionPropertyBuilder *pb, MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
guint32 *values;
@@ -1080,19 +1881,19 @@ mono_image_get_property_info (MonoReflectionPropertyBuilder *pb, MonoDynamicAsse
values = table->values + semaidx * MONO_METHOD_SEMA_SIZE;
values [MONO_METHOD_SEMA_SEMANTICS] = METHOD_SEMANTIC_GETTER;
values [MONO_METHOD_SEMA_METHOD] = pb->get_method->table_idx;
- values [MONO_METHOD_SEMA_ASSOCIATION] = (pb->table_idx << HAS_SEMANTICS_BITS) | HAS_SEMANTICS_PROPERTY;
+ values [MONO_METHOD_SEMA_ASSOCIATION] = (pb->table_idx << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_PROPERTY;
}
if (pb->set_method) {
semaidx = table->next_idx ++;
values = table->values + semaidx * MONO_METHOD_SEMA_SIZE;
values [MONO_METHOD_SEMA_SEMANTICS] = METHOD_SEMANTIC_SETTER;
values [MONO_METHOD_SEMA_METHOD] = pb->set_method->table_idx;
- values [MONO_METHOD_SEMA_ASSOCIATION] = (pb->table_idx << HAS_SEMANTICS_BITS) | HAS_SEMANTICS_PROPERTY;
+ values [MONO_METHOD_SEMA_ASSOCIATION] = (pb->table_idx << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_PROPERTY;
}
}
static void
-mono_image_get_event_info (MonoReflectionEventBuilder *eb, MonoDynamicAssembly *assembly)
+mono_image_get_event_info (MonoReflectionEventBuilder *eb, MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
guint32 *values;
@@ -1132,63 +1933,247 @@ mono_image_get_event_info (MonoReflectionEventBuilder *eb, MonoDynamicAssembly *
values = table->values + semaidx * MONO_METHOD_SEMA_SIZE;
values [MONO_METHOD_SEMA_SEMANTICS] = METHOD_SEMANTIC_ADD_ON;
values [MONO_METHOD_SEMA_METHOD] = eb->add_method->table_idx;
- values [MONO_METHOD_SEMA_ASSOCIATION] = (eb->table_idx << HAS_SEMANTICS_BITS) | HAS_SEMANTICS_EVENT;
+ values [MONO_METHOD_SEMA_ASSOCIATION] = (eb->table_idx << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_EVENT;
}
if (eb->remove_method) {
semaidx = table->next_idx ++;
values = table->values + semaidx * MONO_METHOD_SEMA_SIZE;
values [MONO_METHOD_SEMA_SEMANTICS] = METHOD_SEMANTIC_REMOVE_ON;
values [MONO_METHOD_SEMA_METHOD] = eb->remove_method->table_idx;
- values [MONO_METHOD_SEMA_ASSOCIATION] = (eb->table_idx << HAS_SEMANTICS_BITS) | HAS_SEMANTICS_EVENT;
+ values [MONO_METHOD_SEMA_ASSOCIATION] = (eb->table_idx << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_EVENT;
}
if (eb->raise_method) {
semaidx = table->next_idx ++;
values = table->values + semaidx * MONO_METHOD_SEMA_SIZE;
values [MONO_METHOD_SEMA_SEMANTICS] = METHOD_SEMANTIC_FIRE;
values [MONO_METHOD_SEMA_METHOD] = eb->raise_method->table_idx;
- values [MONO_METHOD_SEMA_ASSOCIATION] = (eb->table_idx << HAS_SEMANTICS_BITS) | HAS_SEMANTICS_EVENT;
+ values [MONO_METHOD_SEMA_ASSOCIATION] = (eb->table_idx << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_EVENT;
+ }
+}
+
+static void
+encode_new_constraint (MonoDynamicImage *assembly, guint32 owner)
+{
+ static MonoClass *NewConstraintAttr;
+ static MonoMethod *NewConstraintAttr_ctor;
+ MonoDynamicTable *table;
+ guint32 *values;
+ guint32 token, type;
+ char blob_size [4] = { 0x01, 0x00, 0x00, 0x00 };
+ char *buf, *p;
+
+ if (!NewConstraintAttr)
+ NewConstraintAttr = mono_class_from_name ( mono_defaults.corlib,
+ "System.Runtime.CompilerServices", "NewConstraintAttribute");
+ g_assert (NewConstraintAttr);
+
+ if (!NewConstraintAttr_ctor) {
+ int i;
+
+ for (i = 0; i < NewConstraintAttr->method.count; i++) {
+ MonoMethod *m = NewConstraintAttr->methods [i];
+
+ if (strcmp (m->name, ".ctor"))
+ continue;
+
+ NewConstraintAttr_ctor = m;
+ break;
+ }
+
+ g_assert (NewConstraintAttr_ctor);
+ }
+
+ table = &assembly->tables [MONO_TABLE_CUSTOMATTRIBUTE];
+ table->rows += 1;
+ alloc_table (table, table->rows);
+
+ values = table->values + table->next_idx * MONO_CUSTOM_ATTR_SIZE;
+ owner <<= MONO_CUSTOM_ATTR_BITS;
+ owner |= MONO_CUSTOM_ATTR_GENERICPAR;
+ values [MONO_CUSTOM_ATTR_PARENT] = owner;
+
+ token = mono_image_get_methodref_token (assembly, NewConstraintAttr_ctor);
+
+ type = mono_metadata_token_index (token);
+ type <<= MONO_CUSTOM_ATTR_TYPE_BITS;
+ switch (mono_metadata_token_table (token)) {
+ case MONO_TABLE_METHOD:
+ type |= MONO_CUSTOM_ATTR_TYPE_METHODDEF;
+ break;
+ case MONO_TABLE_MEMBERREF:
+ type |= MONO_CUSTOM_ATTR_TYPE_MEMBERREF;
+ break;
+ default:
+ g_warning ("got wrong token in custom attr");
+ return;
+ }
+ values [MONO_CUSTOM_ATTR_TYPE] = type;
+
+ buf = p = g_malloc (1);
+ mono_metadata_encode_value (4, p, &p);
+ g_assert (p-buf == 1);
+
+ values [MONO_CUSTOM_ATTR_VALUE] = add_to_blob_cached (assembly, buf, 1, blob_size, 4);
+
+ values += MONO_CUSTOM_ATTR_SIZE;
+ ++table->next_idx;
+}
+
+static void
+encode_constraints (MonoReflectionGenericParam *gparam, guint32 owner, MonoDynamicImage *assembly)
+{
+ MonoDynamicTable *table;
+ guint32 num_constraints, i;
+ guint32 *values;
+ guint32 table_idx;
+
+ table = &assembly->tables [MONO_TABLE_GENERICPARAMCONSTRAINT];
+ num_constraints = gparam->iface_constraints ?
+ mono_array_length (gparam->iface_constraints) : 0;
+ table->rows += num_constraints;
+ if (gparam->base_type)
+ table->rows++;
+ alloc_table (table, table->rows);
+
+ if (gparam->base_type) {
+ table_idx = table->next_idx ++;
+ values = table->values + table_idx * MONO_GENPARCONSTRAINT_SIZE;
+
+ values [MONO_GENPARCONSTRAINT_GENERICPAR] = owner;
+ values [MONO_GENPARCONSTRAINT_CONSTRAINT] = mono_image_typedef_or_ref (
+ assembly, gparam->base_type->type);
+ }
+
+ for (i = 0; i < num_constraints; i++) {
+ MonoReflectionType *constraint = mono_array_get (
+ gparam->iface_constraints, gpointer, i);
+
+ table_idx = table->next_idx ++;
+ values = table->values + table_idx * MONO_GENPARCONSTRAINT_SIZE;
+
+ values [MONO_GENPARCONSTRAINT_GENERICPAR] = owner;
+ values [MONO_GENPARCONSTRAINT_CONSTRAINT] = mono_image_typedef_or_ref (
+ assembly, constraint->type);
}
+
+ if (gparam->attrs & GENERIC_PARAMETER_ATTRIBUTE_CONSTRUCTOR_CONSTRAINT)
+ encode_new_constraint (assembly, owner);
+}
+
+static void
+mono_image_get_generic_param_info (MonoReflectionGenericParam *gparam, guint32 owner, MonoDynamicImage *assembly)
+{
+ GenericParamTableEntry *entry;
+
+ /*
+ * The GenericParam table must be sorted according to the `owner' field.
+ * We need to do this sorting prior to writing the GenericParamConstraint
+ * table, since we have to use the final GenericParam table indices there
+ * and they must also be sorted.
+ */
+
+ entry = g_new0 (GenericParamTableEntry, 1);
+ entry->owner = owner;
+ entry->gparam = gparam;
+
+ g_ptr_array_add (assembly->gen_params, entry);
+}
+
+static void
+write_generic_param_entry (MonoDynamicImage *assembly, GenericParamTableEntry *entry)
+{
+ MonoDynamicTable *table;
+ MonoGenericParam *param;
+ guint32 *values;
+ guint32 table_idx;
+
+ table = &assembly->tables [MONO_TABLE_GENERICPARAM];
+ table_idx = table->next_idx ++;
+ values = table->values + table_idx * MONO_GENERICPARAM_SIZE;
+
+ param = entry->gparam->type.type->data.generic_param;
+
+ values [MONO_GENERICPARAM_OWNER] = entry->owner;
+ values [MONO_GENERICPARAM_FLAGS] = entry->gparam->attrs;
+ values [MONO_GENERICPARAM_NUMBER] = param->num;
+ values [MONO_GENERICPARAM_NAME] = string_heap_insert (&assembly->sheap, param->name);
+ values [MONO_GENERICPARAM_KIND] = 0;
+
+ encode_constraints (entry->gparam, table_idx, assembly);
}
static guint32
-resolution_scope_from_image (MonoDynamicAssembly *assembly, MonoImage *image)
+resolution_scope_from_image (MonoDynamicImage *assembly, MonoImage *image)
{
MonoDynamicTable *table;
guint32 token;
guint32 *values;
guint32 cols [MONO_ASSEMBLY_SIZE];
+ const char *pubkey;
+ guint32 publen;
if ((token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, image))))
return token;
- mono_metadata_decode_row (&image->tables [MONO_TABLE_ASSEMBLY], 0, cols, MONO_ASSEMBLY_SIZE);
+ if (image->assembly->dynamic && (image->assembly == assembly->image.assembly)) {
+ table = &assembly->tables [MONO_TABLE_MODULEREF];
+ token = table->next_idx ++;
+ table->rows ++;
+ alloc_table (table, table->rows);
+ values = table->values + token * MONO_MODULEREF_SIZE;
+ values [MONO_MODULEREF_NAME] = string_heap_insert (&assembly->sheap, image->module_name);
+
+ token <<= MONO_RESOLTION_SCOPE_BITS;
+ token |= MONO_RESOLTION_SCOPE_MODULEREF;
+ g_hash_table_insert (assembly->handleref, image, GUINT_TO_POINTER (token));
+
+ return token;
+ }
+
+ if (image->assembly->dynamic)
+ /* FIXME: */
+ memset (cols, 0, sizeof (cols));
+ else {
+ /* image->assembly->image is the manifest module */
+ image = image->assembly->image;
+ mono_metadata_decode_row (&image->tables [MONO_TABLE_ASSEMBLY], 0, cols, MONO_ASSEMBLY_SIZE);
+ }
table = &assembly->tables [MONO_TABLE_ASSEMBLYREF];
token = table->next_idx ++;
table->rows ++;
alloc_table (table, table->rows);
values = table->values + token * MONO_ASSEMBLYREF_SIZE;
- if (strcmp ("corlib", image->assembly_name) == 0)
- values [MONO_ASSEMBLYREF_NAME] = string_heap_insert (&assembly->sheap, "mscorlib");
- else
- values [MONO_ASSEMBLYREF_NAME] = string_heap_insert (&assembly->sheap, image->assembly_name);
+ values [MONO_ASSEMBLYREF_NAME] = string_heap_insert (&assembly->sheap, image->assembly_name);
values [MONO_ASSEMBLYREF_MAJOR_VERSION] = cols [MONO_ASSEMBLY_MAJOR_VERSION];
values [MONO_ASSEMBLYREF_MINOR_VERSION] = cols [MONO_ASSEMBLY_MINOR_VERSION];
values [MONO_ASSEMBLYREF_BUILD_NUMBER] = cols [MONO_ASSEMBLY_BUILD_NUMBER];
values [MONO_ASSEMBLYREF_REV_NUMBER] = cols [MONO_ASSEMBLY_REV_NUMBER];
values [MONO_ASSEMBLYREF_FLAGS] = 0;
- values [MONO_ASSEMBLYREF_PUBLIC_KEY] = 0;
values [MONO_ASSEMBLYREF_CULTURE] = 0;
values [MONO_ASSEMBLYREF_HASH_VALUE] = 0;
- token <<= RESOLTION_SCOPE_BITS;
- token |= RESOLTION_SCOPE_ASSEMBLYREF;
+ if (strcmp ("", image->assembly->aname.culture)) {
+ values [MONO_ASSEMBLYREF_CULTURE] = string_heap_insert (&assembly->sheap,
+ image->assembly->aname.culture);
+ }
+
+ if ((pubkey = mono_image_get_public_key (image, &publen))) {
+ guchar pubtoken [9];
+ pubtoken [0] = 8;
+ mono_digest_get_public_token (pubtoken + 1, pubkey, publen);
+ values [MONO_ASSEMBLYREF_PUBLIC_KEY] = mono_image_add_stream_data (&assembly->blob, pubtoken, 9);
+ } else {
+ values [MONO_ASSEMBLYREF_PUBLIC_KEY] = 0;
+ }
+ token <<= MONO_RESOLTION_SCOPE_BITS;
+ token |= MONO_RESOLTION_SCOPE_ASSEMBLYREF;
g_hash_table_insert (assembly->handleref, image, GUINT_TO_POINTER (token));
return token;
}
static guint32
-create_typespec (MonoDynamicAssembly *assembly, MonoType *type)
+create_typespec (MonoDynamicImage *assembly, MonoType *type)
{
MonoDynamicTable *table;
guint32 *values;
@@ -1203,23 +2188,34 @@ create_typespec (MonoDynamicAssembly *assembly, MonoType *type)
case MONO_TYPE_PTR:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_ARRAY:
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ case MONO_TYPE_GENERICINST:
encode_type (assembly, type, p, &p);
break;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_VALUETYPE: {
+ MonoClass *k = mono_class_from_mono_type (type);
+ if (!k || !k->generic_inst)
+ return 0;
+ encode_generic_inst (assembly, k->generic_inst, p, &p);
+ break;
+ }
default:
return 0;
}
-
- g_assert (p-sig < 128);
- mono_metadata_encode_value (p-sig, b, &b);
- token = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
- mono_image_add_stream_data (&assembly->blob, sig, p-sig);
table = &assembly->tables [MONO_TABLE_TYPESPEC];
- alloc_table (table, table->rows + 1);
- values = table->values + table->next_idx * MONO_TYPESPEC_SIZE;
- values [MONO_TYPESPEC_SIGNATURE] = token;
+ if (assembly->save) {
+ g_assert (p-sig < 128);
+ mono_metadata_encode_value (p-sig, b, &b);
+ token = add_to_blob_cached (assembly, blob_size, b-blob_size, sig, p-sig);
+ alloc_table (table, table->rows + 1);
+ values = table->values + table->next_idx * MONO_TYPESPEC_SIZE;
+ values [MONO_TYPESPEC_SIGNATURE] = token;
+ }
- token = TYPEDEFORREF_TYPESPEC | (table->next_idx << TYPEDEFORREF_BITS);
+ token = MONO_TYPEDEFORREF_TYPESPEC | (table->next_idx << MONO_TYPEDEFORREF_BITS);
g_hash_table_insert (assembly->typeref, type, GUINT_TO_POINTER(token));
table->next_idx ++;
return token;
@@ -1229,7 +2225,7 @@ create_typespec (MonoDynamicAssembly *assembly, MonoType *type)
* Despite the name, we handle also TypeSpec (with the above helper).
*/
static guint32
-mono_image_typedef_or_ref (MonoDynamicAssembly *assembly, MonoType *type)
+mono_image_typedef_or_ref (MonoDynamicImage *assembly, MonoType *type)
{
MonoDynamicTable *table;
guint32 *values;
@@ -1242,32 +2238,41 @@ mono_image_typedef_or_ref (MonoDynamicAssembly *assembly, MonoType *type)
token = create_typespec (assembly, type);
if (token)
return token;
- klass = mono_class_from_mono_type (type);
+ klass = my_mono_class_from_mono_type (type);
+ if (!klass)
+ klass = mono_class_from_mono_type (type);
+
/*
- * If it's in the same module:
+ * If it's in the same module and not a generic type parameter:
*/
- if (klass->image == assembly->assembly.image) {
+ if ((klass->image == &assembly->image) && (type->type != MONO_TYPE_VAR) &&
+ (type->type != MONO_TYPE_MVAR)) {
MonoReflectionTypeBuilder *tb = klass->reflection_info;
- return TYPEDEFORREF_TYPEDEF | (tb->table_idx << TYPEDEFORREF_BITS);
+ token = MONO_TYPEDEFORREF_TYPEDEF | (tb->table_idx << MONO_TYPEDEFORREF_BITS);
+ mono_g_hash_table_insert (assembly->tokens, GUINT_TO_POINTER (token), klass->reflection_info);
+ return token;
}
if (klass->nested_in) {
enclosing = mono_image_typedef_or_ref (assembly, &klass->nested_in->byval_arg);
/* get the typeref idx of the enclosing type */
- enclosing >>= TYPEDEFORREF_BITS;
- scope = (enclosing << RESOLTION_SCOPE_BITS) | RESOLTION_SCOPE_TYPEREF;
+ enclosing >>= MONO_TYPEDEFORREF_BITS;
+ scope = (enclosing << MONO_RESOLTION_SCOPE_BITS) | MONO_RESOLTION_SCOPE_TYPEREF;
} else {
scope = resolution_scope_from_image (assembly, klass->image);
}
table = &assembly->tables [MONO_TABLE_TYPEREF];
- alloc_table (table, table->rows + 1);
- values = table->values + table->next_idx * MONO_TYPEREF_SIZE;
- values [MONO_TYPEREF_SCOPE] = scope;
- values [MONO_TYPEREF_NAME] = string_heap_insert (&assembly->sheap, klass->name);
- values [MONO_TYPEREF_NAMESPACE] = string_heap_insert (&assembly->sheap, klass->name_space);
- token = TYPEDEFORREF_TYPEREF | (table->next_idx << TYPEDEFORREF_BITS); /* typeref */
+ if (assembly->save) {
+ alloc_table (table, table->rows + 1);
+ values = table->values + table->next_idx * MONO_TYPEREF_SIZE;
+ values [MONO_TYPEREF_SCOPE] = scope;
+ values [MONO_TYPEREF_NAME] = string_heap_insert (&assembly->sheap, klass->name);
+ values [MONO_TYPEREF_NAMESPACE] = string_heap_insert (&assembly->sheap, klass->name_space);
+ }
+ token = MONO_TYPEDEFORREF_TYPEREF | (table->next_idx << MONO_TYPEDEFORREF_BITS); /* typeref */
g_hash_table_insert (assembly->typeref, type, GUINT_TO_POINTER(token));
table->next_idx ++;
+ mono_g_hash_table_insert (assembly->tokens, GUINT_TO_POINTER (token), klass->reflection_info);
return token;
}
@@ -1278,7 +2283,7 @@ mono_image_typedef_or_ref (MonoDynamicAssembly *assembly, MonoType *type)
* The sig param is an index to an already built signature.
*/
static guint32
-mono_image_get_memberref_token (MonoDynamicAssembly *assembly, MonoType *type, const char *name, guint32 sig)
+mono_image_get_memberref_token (MonoDynamicImage *assembly, MonoType *type, const char *name, guint32 sig)
{
MonoDynamicTable *table;
guint32 *values;
@@ -1286,27 +2291,33 @@ mono_image_get_memberref_token (MonoDynamicAssembly *assembly, MonoType *type, c
guint32 parent;
parent = mono_image_typedef_or_ref (assembly, type);
- switch (parent & TYPEDEFORREF_MASK) {
- case TYPEDEFORREF_TYPEREF:
- pclass = MEMBERREF_PARENT_TYPEREF;
+ switch (parent & MONO_TYPEDEFORREF_MASK) {
+ case MONO_TYPEDEFORREF_TYPEREF:
+ pclass = MONO_MEMBERREF_PARENT_TYPEREF;
break;
- case TYPEDEFORREF_TYPESPEC:
- pclass = MEMBERREF_PARENT_TYPESPEC;
+ case MONO_TYPEDEFORREF_TYPESPEC:
+ pclass = MONO_MEMBERREF_PARENT_TYPESPEC;
+ break;
+ case MONO_TYPEDEFORREF_TYPEDEF:
+ pclass = MONO_MEMBERREF_PARENT_TYPEDEF;
break;
- case TYPEDEFORREF_TYPEDEF:
- /* should never get here */
default:
- g_error ("unknow typeref or def token");
+ g_warning ("unknown typeref or def token 0x%08x for %s", parent, name);
+ return 0;
}
/* extract the index */
- parent >>= TYPEDEFORREF_BITS;
+ parent >>= MONO_TYPEDEFORREF_BITS;
table = &assembly->tables [MONO_TABLE_MEMBERREF];
- alloc_table (table, table->rows + 1);
- values = table->values + table->next_idx * MONO_MEMBERREF_SIZE;
- values [MONO_MEMBERREF_CLASS] = pclass | (parent << MEMBERREF_PARENT_BITS);
- values [MONO_MEMBERREF_NAME] = string_heap_insert (&assembly->sheap, name);
- values [MONO_MEMBERREF_SIGNATURE] = sig;
+
+ if (assembly->save) {
+ alloc_table (table, table->rows + 1);
+ values = table->values + table->next_idx * MONO_MEMBERREF_SIZE;
+ values [MONO_MEMBERREF_CLASS] = pclass | (parent << MONO_MEMBERREF_PARENT_BITS);
+ values [MONO_MEMBERREF_NAME] = string_heap_insert (&assembly->sheap, name);
+ values [MONO_MEMBERREF_SIGNATURE] = sig;
+ }
+
token = MONO_TOKEN_MEMBER_REF | table->next_idx;
table->next_idx ++;
@@ -1314,33 +2325,397 @@ mono_image_get_memberref_token (MonoDynamicAssembly *assembly, MonoType *type, c
}
static guint32
-mono_image_get_methodref_token (MonoDynamicAssembly *assembly, MonoMethod *method)
+mono_image_get_methodref_token (MonoDynamicImage *assembly, MonoMethod *method)
{
guint32 token;
+ MonoMethodSignature *sig;
token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, method));
if (token)
return token;
+
+ /*
+ * A methodref signature can't contain an unmanaged calling convention.
+ */
+ sig = mono_metadata_signature_dup (method->signature);
+ if ((sig->call_convention != MONO_CALL_DEFAULT) && (sig->call_convention != MONO_CALL_VARARG))
+ sig->call_convention = MONO_CALL_DEFAULT;
token = mono_image_get_memberref_token (assembly, &method->klass->byval_arg,
- method->name, method_encode_signature (assembly, method->signature));
+ method->name, method_encode_signature (assembly, sig));
+ g_free (sig);
g_hash_table_insert (assembly->handleref, method, GUINT_TO_POINTER(token));
return token;
}
static guint32
-mono_image_get_fieldref_token (MonoDynamicAssembly *assembly, MonoClassField *field, MonoClass *klass)
+mono_image_get_varargs_method_token (MonoDynamicImage *assembly, guint32 original,
+ const gchar *name, guint32 sig)
+{
+ MonoDynamicTable *table;
+ guint32 token;
+ guint32 *values;
+
+ table = &assembly->tables [MONO_TABLE_MEMBERREF];
+
+ if (assembly->save) {
+ alloc_table (table, table->rows + 1);
+ values = table->values + table->next_idx * MONO_MEMBERREF_SIZE;
+ values [MONO_MEMBERREF_CLASS] = original;
+ values [MONO_MEMBERREF_NAME] = string_heap_insert (&assembly->sheap, name);
+ values [MONO_MEMBERREF_SIGNATURE] = sig;
+ }
+
+ token = MONO_TOKEN_MEMBER_REF | table->next_idx;
+ table->next_idx ++;
+
+ return token;
+}
+
+static guint32
+mono_image_get_methodbuilder_token (MonoDynamicImage *assembly, MonoReflectionMethodBuilder *mb)
{
guint32 token;
+ ReflectionMethodBuilder rmb;
- token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, field));
+ token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, mb));
if (token)
return token;
- token = mono_image_get_memberref_token (assembly, &klass->byval_arg,
- field->name, fieldref_encode_signature (assembly, field));
- g_hash_table_insert (assembly->handleref, field, GUINT_TO_POINTER(token));
+
+ reflection_methodbuilder_from_method_builder (&rmb, mb);
+
+ token = mono_image_get_memberref_token (assembly, ((MonoReflectionTypeBuilder*)rmb.type)->type.type,
+ mono_string_to_utf8 (rmb.name), method_builder_encode_signature (assembly, &rmb));
+ g_hash_table_insert (assembly->handleref, mb, GUINT_TO_POINTER(token));
return token;
}
+static guint32
+mono_image_get_ctorbuilder_token (MonoDynamicImage *assembly, MonoReflectionCtorBuilder *mb)
+{
+ guint32 token;
+ ReflectionMethodBuilder rmb;
+
+ token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, mb));
+ if (token)
+ return token;
+
+ reflection_methodbuilder_from_ctor_builder (&rmb, mb);
+
+ token = mono_image_get_memberref_token (assembly, ((MonoReflectionTypeBuilder*)rmb.type)->type.type,
+ mono_string_to_utf8 (rmb.name), method_builder_encode_signature (assembly, &rmb));
+ g_hash_table_insert (assembly->handleref, mb, GUINT_TO_POINTER(token));
+ return token;
+}
+
+static guint32
+mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoReflectionField *f)
+{
+ MonoType *type;
+ guint32 token;
+
+ token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, f));
+ if (token)
+ return token;
+ g_assert (f->field->parent);
+ type = f->field->generic_info ? f->field->generic_info->generic_type : f->field->type;
+ token = mono_image_get_memberref_token (assembly, &f->klass->byval_arg,
+ f->field->name, fieldref_encode_signature (assembly, type));
+ g_hash_table_insert (assembly->handleref, f, GUINT_TO_POINTER(token));
+ return token;
+}
+
+static guint32
+encode_generic_method_sig (MonoDynamicImage *assembly, MonoGenericMethod *gmethod)
+{
+ char *buf;
+ char *p;
+ int i;
+ guint32 nparams = gmethod->mtype_argc;
+ guint32 size = 10 + nparams * 10;
+ guint32 idx;
+ char blob_size [6];
+ char *b = blob_size;
+
+ if (!assembly->save)
+ return 0;
+
+ p = buf = g_malloc (size);
+ /*
+ * FIXME: vararg, explicit_this, differenc call_conv values...
+ */
+ mono_metadata_encode_value (0xa, p, &p); /* FIXME FIXME FIXME */
+ mono_metadata_encode_value (nparams, p, &p);
+
+ for (i = 0; i < nparams; i++)
+ encode_type (assembly, gmethod->mtype_argv [i], p, &p);
+
+ /* store length */
+ g_assert (p - buf < size);
+ mono_metadata_encode_value (p-buf, b, &b);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
+ g_free (buf);
+ return idx;
+}
+
+static guint32
+method_encode_methodspec (MonoDynamicImage *assembly, MonoMethod *method)
+{
+ MonoDynamicTable *table;
+ guint32 *values;
+ guint32 token, mtoken = 0, sig;
+ MonoMethodInflated *imethod;
+ MonoMethod *declaring;
+
+ table = &assembly->tables [MONO_TABLE_METHODSPEC];
+
+ g_assert (method->signature->is_inflated);
+ imethod = (MonoMethodInflated *) method;
+ declaring = imethod->declaring;
+
+ sig = method_encode_signature (assembly, declaring->signature);
+ mtoken = mono_image_get_memberref_token (assembly, &method->klass->byval_arg, declaring->name, sig);
+
+ if (!declaring->signature->generic_param_count)
+ return mtoken;
+
+ switch (mono_metadata_token_table (mtoken)) {
+ case MONO_TABLE_MEMBERREF:
+ mtoken = (mono_metadata_token_index (mtoken) << MONO_METHODDEFORREF_BITS) | MONO_METHODDEFORREF_METHODREF;
+ break;
+ case MONO_TABLE_METHOD:
+ mtoken = (mono_metadata_token_index (mtoken) << MONO_METHODDEFORREF_BITS) | MONO_METHODDEFORREF_METHODDEF;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ sig = encode_generic_method_sig (assembly, imethod->context->gmethod);
+
+ if (assembly->save) {
+ alloc_table (table, table->rows + 1);
+ values = table->values + table->next_idx * MONO_METHODSPEC_SIZE;
+ values [MONO_METHODSPEC_METHOD] = mtoken;
+ values [MONO_METHODSPEC_SIGNATURE] = sig;
+ }
+
+ token = MONO_TOKEN_METHOD_SPEC | table->next_idx;
+ table->next_idx ++;
+
+ return token;
+}
+
+static guint32
+mono_image_get_methodspec_token (MonoDynamicImage *assembly, MonoMethod *m)
+{
+ MonoMethodInflated *imethod;
+ guint32 token;
+
+ token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, m));
+ if (token)
+ return token;
+
+ g_assert (m->signature->is_inflated);
+ imethod = (MonoMethodInflated *) m;
+
+ if (imethod->declaring->signature->generic_param_count) {
+ token = method_encode_methodspec (assembly, m);
+ } else {
+ guint32 sig = method_encode_signature (
+ assembly, imethod->declaring->signature);
+ token = mono_image_get_memberref_token (
+ assembly, &m->klass->byval_arg, m->name, sig);
+ }
+
+ g_hash_table_insert (assembly->handleref, m, GUINT_TO_POINTER(token));
+ return token;
+}
+
+static guint32
+mono_image_get_inflated_method_token (MonoDynamicImage *assembly, MonoMethod *m)
+{
+ MonoMethodInflated *imethod = (MonoMethodInflated *) m;
+ guint32 sig, token;
+
+ sig = method_encode_signature (assembly, imethod->declaring->signature);
+ token = mono_image_get_memberref_token (
+ assembly, &m->klass->byval_arg, m->name, sig);
+
+ return token;
+}
+
+static guint32
+create_generic_typespec (MonoDynamicImage *assembly, MonoReflectionTypeBuilder *tb)
+{
+ MonoDynamicTable *table;
+ MonoClass *klass;
+ guint32 *values;
+ guint32 token;
+ char sig [128];
+ char *p = sig;
+ char blob_size [6];
+ char *b = blob_size;
+ int count, i;
+
+ /*
+ * We're creating a TypeSpec for the TypeBuilder of a generic type declaration,
+ * ie. what we'd normally use as the generic type in a TypeSpec signature.
+ * Because of this, we must not insert it into the `typeref' hash table.
+ */
+
+ token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->typespec, tb->type.type));
+ if (token)
+ return token;
+
+ g_assert (tb->generic_params);
+ klass = mono_class_from_mono_type (tb->type.type);
+
+ mono_metadata_encode_value (MONO_TYPE_GENERICINST, p, &p);
+ encode_type (assembly, &klass->byval_arg, p, &p);
+
+ count = mono_array_length (tb->generic_params);
+ mono_metadata_encode_value (count, p, &p);
+ for (i = 0; i < count; i++) {
+ MonoReflectionGenericParam *gparam;
+
+ gparam = mono_array_get (tb->generic_params, MonoReflectionGenericParam *, i);
+
+ encode_type (assembly, gparam->type.type, p, &p);
+ }
+
+ table = &assembly->tables [MONO_TABLE_TYPESPEC];
+ if (assembly->save) {
+ g_assert (p-sig < 128);
+ mono_metadata_encode_value (p-sig, b, &b);
+ token = add_to_blob_cached (assembly, blob_size, b-blob_size, sig, p-sig);
+ alloc_table (table, table->rows + 1);
+ values = table->values + table->next_idx * MONO_TYPESPEC_SIZE;
+ values [MONO_TYPESPEC_SIGNATURE] = token;
+ }
+
+ token = MONO_TYPEDEFORREF_TYPESPEC | (table->next_idx << MONO_TYPEDEFORREF_BITS);
+ g_hash_table_insert (assembly->typespec, tb->type.type, GUINT_TO_POINTER(token));
+ table->next_idx ++;
+ return token;
+}
+
+static guint32
+mono_image_get_generic_field_token (MonoDynamicImage *assembly, MonoReflectionFieldBuilder *fb)
+{
+ MonoDynamicTable *table;
+ MonoClass *klass;
+ guint32 *values;
+ guint32 token, pclass, parent, sig;
+ gchar *name;
+
+ token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, fb));
+ if (token)
+ return token;
+
+ klass = mono_class_from_mono_type (fb->typeb->type);
+ name = mono_string_to_utf8 (fb->name);
+
+ sig = fieldref_encode_signature (assembly, fb->type->type);
+
+ parent = create_generic_typespec (assembly, (MonoReflectionTypeBuilder *) fb->typeb);
+ g_assert ((parent & MONO_TYPEDEFORREF_MASK) == MONO_TYPEDEFORREF_TYPESPEC);
+
+ pclass = MONO_MEMBERREF_PARENT_TYPESPEC;
+ parent >>= MONO_TYPEDEFORREF_BITS;
+
+ table = &assembly->tables [MONO_TABLE_MEMBERREF];
+
+ if (assembly->save) {
+ alloc_table (table, table->rows + 1);
+ values = table->values + table->next_idx * MONO_MEMBERREF_SIZE;
+ values [MONO_MEMBERREF_CLASS] = pclass | (parent << MONO_MEMBERREF_PARENT_BITS);
+ values [MONO_MEMBERREF_NAME] = string_heap_insert (&assembly->sheap, name);
+ values [MONO_MEMBERREF_SIGNATURE] = sig;
+ }
+
+ token = MONO_TOKEN_MEMBER_REF | table->next_idx;
+ table->next_idx ++;
+ g_hash_table_insert (assembly->handleref, fb, GUINT_TO_POINTER(token));
+ return token;
+}
+
+static guint32
+mono_reflection_encode_sighelper (MonoDynamicImage *assembly, MonoReflectionSigHelper *helper)
+{
+ char *buf;
+ char *p;
+ guint32 nargs;
+ guint32 size;
+ guint32 i, idx;
+ char blob_size [6];
+ char *b = blob_size;
+
+ if (!assembly->save)
+ return 0;
+
+ /* FIXME: */
+ g_assert (helper->type == 2);
+
+ if (helper->arguments)
+ nargs = mono_array_length (helper->arguments);
+ else
+ nargs = 0;
+
+ size = 10 + (nargs * 10);
+
+ p = buf = g_malloc (size);
+
+ /* Encode calling convention */
+ /* Change Any to Standard */
+ if ((helper->call_conv & 0x03) == 0x03)
+ helper->call_conv = 0x01;
+ /* explicit_this implies has_this */
+ if (helper->call_conv & 0x40)
+ helper->call_conv &= 0x20;
+
+ if (helper->call_conv == 0) { /* Unmanaged */
+ *p = helper->unmanaged_call_conv - 1;
+ } else {
+ /* Managed */
+ *p = helper->call_conv & 0x60; /* has_this + explicit_this */
+ if (helper->call_conv & 0x02) /* varargs */
+ *p += 0x05;
+ }
+
+ p++;
+ mono_metadata_encode_value (nargs, p, &p);
+ encode_reflection_type (assembly, helper->return_type, p, &p);
+ for (i = 0; i < nargs; ++i) {
+ MonoReflectionType *pt = mono_array_get (helper->arguments, MonoReflectionType*, i);
+ encode_reflection_type (assembly, pt, p, &p);
+ }
+ /* store length */
+ g_assert (p - buf < size);
+ mono_metadata_encode_value (p-buf, b, &b);
+ idx = add_to_blob_cached (assembly, blob_size, b-blob_size, buf, p-buf);
+ g_free (buf);
+
+ return idx;
+}
+
+static guint32
+mono_image_get_sighelper_token (MonoDynamicImage *assembly, MonoReflectionSigHelper *helper)
+{
+ guint32 idx;
+ MonoDynamicTable *table;
+ guint32 *values;
+
+ table = &assembly->tables [MONO_TABLE_STANDALONESIG];
+ idx = table->next_idx ++;
+ table->rows ++;
+ alloc_table (table, table->rows);
+ values = table->values + idx * MONO_STAND_ALONE_SIGNATURE_SIZE;
+
+ values [MONO_STAND_ALONE_SIGNATURE] =
+ mono_reflection_encode_sighelper (assembly, helper);
+
+ return idx;
+}
+
static int
reflection_cc_to_file (int call_conv) {
switch (call_conv & 0x3) {
@@ -1361,7 +2736,7 @@ typedef struct {
} ArrayMethod;
static guint32
-mono_image_get_array_token (MonoDynamicAssembly *assembly, MonoReflectionArrayMethod *m)
+mono_image_get_array_token (MonoDynamicImage *assembly, MonoReflectionArrayMethod *m)
{
guint32 nparams, i;
GList *tmp;
@@ -1373,6 +2748,7 @@ mono_image_get_array_token (MonoDynamicAssembly *assembly, MonoReflectionArrayMe
nparams = mono_array_length (m->parameters);
sig = g_malloc0 (sizeof (MonoMethodSignature) + sizeof (MonoType*) * nparams);
sig->hasthis = 1;
+ sig->sentinelpos = -1;
sig->call_convention = reflection_cc_to_file (m->call_conv);
sig->param_count = nparams;
sig->ret = m->ret? m->ret->type: &mono_defaults.void_class->byval_arg;
@@ -1388,6 +2764,7 @@ mono_image_get_array_token (MonoDynamicAssembly *assembly, MonoReflectionArrayMe
mono_metadata_signature_equal (am->sig, sig)) {
g_free (name);
g_free (sig);
+ m->table_idx = am->token & 0xffffff;
return am->token;
}
}
@@ -1395,8 +2772,8 @@ mono_image_get_array_token (MonoDynamicAssembly *assembly, MonoReflectionArrayMe
am->name = name;
am->sig = sig;
am->parent = m->parent->type;
- am->token = mono_image_get_memberref_token (assembly, am->parent,
- name, method_encode_signature (assembly, sig));
+ am->token = mono_image_get_memberref_token (assembly, am->parent, name,
+ method_encode_signature (assembly, sig));
assembly->array_methods = g_list_prepend (assembly->array_methods, am);
m->table_idx = am->token & 0xffffff;
return am->token;
@@ -1407,26 +2784,32 @@ mono_image_get_array_token (MonoDynamicAssembly *assembly, MonoReflectionArrayMe
* Data in the tables is inserted in a predefined order, since some tables need to be sorted.
*/
static void
-mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, MonoDynamicAssembly *assembly)
+mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
guint *values;
- int i;
+ int i, is_object = 0, is_system = 0;
char *n;
table = &assembly->tables [MONO_TABLE_TYPEDEF];
values = table->values + tb->table_idx * MONO_TYPEDEF_SIZE;
values [MONO_TYPEDEF_FLAGS] = tb->attrs;
- if (tb->parent) { /* interfaces don't have a parent */
- values [MONO_TYPEDEF_EXTENDS] = mono_image_typedef_or_ref (assembly, tb->parent->type);
- } else
- values [MONO_TYPEDEF_EXTENDS] = 0;
n = mono_string_to_utf8 (tb->name);
+ if (strcmp (n, "Object") == 0)
+ is_object++;
values [MONO_TYPEDEF_NAME] = string_heap_insert (&assembly->sheap, n);
g_free (n);
n = mono_string_to_utf8 (tb->nspace);
+ if (strcmp (n, "System") == 0)
+ is_system++;
values [MONO_TYPEDEF_NAMESPACE] = string_heap_insert (&assembly->sheap, n);
g_free (n);
+ if (tb->parent && !(is_system && is_object) &&
+ !(tb->attrs & TYPE_ATTRIBUTE_INTERFACE)) { /* interfaces don't have a parent */
+ values [MONO_TYPEDEF_EXTENDS] = mono_image_typedef_or_ref (assembly, tb->parent->type);
+ } else {
+ values [MONO_TYPEDEF_EXTENDS] = 0;
+ }
values [MONO_TYPEDEF_FIELD_LIST] = assembly->tables [MONO_TABLE_FIELD].next_idx;
values [MONO_TYPEDEF_METHOD_LIST] = assembly->tables [MONO_TABLE_METHOD].next_idx;
@@ -1434,7 +2817,8 @@ mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, Mon
* if we have explicitlayout or sequentiallayouts, output data in the
* ClassLayout table.
*/
- if (((tb->attrs & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_AUTO_LAYOUT) && (tb->class_size != -1)) {
+ if (((tb->attrs & TYPE_ATTRIBUTE_LAYOUT_MASK) != TYPE_ATTRIBUTE_AUTO_LAYOUT) &&
+ ((tb->class_size > 0) || (tb->packing_size > 0))) {
table = &assembly->tables [MONO_TABLE_CLASSLAYOUT];
table->rows++;
alloc_table (table, table->rows);
@@ -1462,9 +2846,9 @@ mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, Mon
/* handle fields */
if (tb->fields) {
table = &assembly->tables [MONO_TABLE_FIELD];
- table->rows += mono_array_length (tb->fields);
+ table->rows += tb->num_fields;
alloc_table (table, table->rows);
- for (i = 0; i < mono_array_length (tb->fields); ++i)
+ for (i = 0; i < tb->num_fields; ++i)
mono_image_get_field_info (
mono_array_get (tb->fields, MonoReflectionFieldBuilder*, i), assembly);
}
@@ -1482,9 +2866,9 @@ mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, Mon
/* handle methods */
if (tb->methods) {
table = &assembly->tables [MONO_TABLE_METHOD];
- table->rows += mono_array_length (tb->methods);
+ table->rows += tb->num_methods;
alloc_table (table, table->rows);
- for (i = 0; i < mono_array_length (tb->methods); ++i)
+ for (i = 0; i < tb->num_methods; ++i)
mono_image_get_method_info (
mono_array_get (tb->methods, MonoReflectionMethodBuilder*, i), assembly);
}
@@ -1518,13 +2902,26 @@ mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, Mon
mono_image_get_property_info (
mono_array_get (tb->properties, MonoReflectionPropertyBuilder*, i), assembly);
}
+
+ /* handle generic parameters */
+ if (tb->generic_params) {
+ table = &assembly->tables [MONO_TABLE_GENERICPARAM];
+ table->rows += mono_array_length (tb->generic_params);
+ alloc_table (table, table->rows);
+ for (i = 0; i < mono_array_length (tb->generic_params); ++i) {
+ guint32 owner = MONO_TYPEORMETHOD_TYPE | (tb->table_idx << MONO_TYPEORMETHOD_BITS);
+
+ mono_image_get_generic_param_info (
+ mono_array_get (tb->generic_params, MonoReflectionGenericParam*, i), owner, assembly);
+ }
+ }
+
+ mono_image_add_decl_security (assembly,
+ mono_metadata_make_token (MONO_TABLE_TYPEDEF, tb->table_idx), tb->permissions);
+
if (tb->subtypes) {
MonoDynamicTable *ntable;
- table = &assembly->tables [MONO_TABLE_TYPEDEF];
- table->rows += mono_array_length (tb->subtypes);
- alloc_table (table, table->rows);
-
ntable = &assembly->tables [MONO_TABLE_NESTEDCLASS];
ntable->rows += mono_array_length (tb->subtypes);
alloc_table (ntable, ntable->rows);
@@ -1542,30 +2939,39 @@ mono_image_get_type_info (MonoDomain *domain, MonoReflectionTypeBuilder *tb, Mon
values += MONO_NESTED_CLASS_SIZE;
ntable->next_idx++;
}
- for (i = 0; i < mono_array_length (tb->subtypes); ++i) {
- MonoReflectionTypeBuilder *subtype = mono_array_get (tb->subtypes, MonoReflectionTypeBuilder*, i);
-
- mono_image_get_type_info (domain, subtype, assembly);
- }
}
}
static void
-assign_type_idx (MonoReflectionTypeBuilder *type, MonoDynamicTable *table)
+collect_types (GPtrArray *types, MonoReflectionTypeBuilder *type)
{
- int j;
-
- type->table_idx = table->next_idx ++;
+ int i;
+
+ g_ptr_array_add (types, type);
+
if (!type->subtypes)
return;
- for (j = 0; j < mono_array_length (type->subtypes); ++j) {
- MonoReflectionTypeBuilder *subtype = mono_array_get (type->subtypes, MonoReflectionTypeBuilder*, j);
- assign_type_idx (subtype, table);
+
+ for (i = 0; i < mono_array_length (type->subtypes); ++i) {
+ MonoReflectionTypeBuilder *subtype = mono_array_get (type->subtypes, MonoReflectionTypeBuilder*, i);
+ collect_types (types, subtype);
}
}
+static gint
+compare_types_by_table_idx (MonoReflectionTypeBuilder **type1, MonoReflectionTypeBuilder **type2)
+{
+ if ((*type1)->table_idx < (*type2)->table_idx)
+ return -1;
+ else
+ if ((*type1)->table_idx > (*type2)->table_idx)
+ return 1;
+ else
+ return 0;
+}
+
static void
-params_add_cattrs (MonoDynamicAssembly *assembly, MonoArray *pinfo) {
+params_add_cattrs (MonoDynamicImage *assembly, MonoArray *pinfo) {
int i;
if (!pinfo)
@@ -1575,50 +2981,50 @@ params_add_cattrs (MonoDynamicAssembly *assembly, MonoArray *pinfo) {
pb = mono_array_get (pinfo, MonoReflectionParamBuilder *, i);
if (!pb)
continue;
- mono_image_add_cattrs (assembly, pb->table_idx, CUSTOM_ATTR_PARAMDEF, pb->cattrs);
+ mono_image_add_cattrs (assembly, pb->table_idx, MONO_CUSTOM_ATTR_PARAMDEF, pb->cattrs);
}
}
static void
-type_add_cattrs (MonoDynamicAssembly *assembly, MonoReflectionTypeBuilder *tb) {
+type_add_cattrs (MonoDynamicImage *assembly, MonoReflectionTypeBuilder *tb) {
int i;
- mono_image_add_cattrs (assembly, tb->table_idx, CUSTOM_ATTR_TYPEDEF, tb->cattrs);
+ mono_image_add_cattrs (assembly, tb->table_idx, MONO_CUSTOM_ATTR_TYPEDEF, tb->cattrs);
if (tb->fields) {
- for (i = 0; i < mono_array_length (tb->fields); ++i) {
+ for (i = 0; i < tb->num_fields; ++i) {
MonoReflectionFieldBuilder* fb;
fb = mono_array_get (tb->fields, MonoReflectionFieldBuilder*, i);
- mono_image_add_cattrs (assembly, fb->table_idx, CUSTOM_ATTR_FIELDDEF, fb->cattrs);
+ mono_image_add_cattrs (assembly, fb->table_idx, MONO_CUSTOM_ATTR_FIELDDEF, fb->cattrs);
}
}
if (tb->events) {
for (i = 0; i < mono_array_length (tb->events); ++i) {
MonoReflectionEventBuilder* eb;
eb = mono_array_get (tb->events, MonoReflectionEventBuilder*, i);
- mono_image_add_cattrs (assembly, eb->table_idx, CUSTOM_ATTR_EVENT, eb->cattrs);
+ mono_image_add_cattrs (assembly, eb->table_idx, MONO_CUSTOM_ATTR_EVENT, eb->cattrs);
}
}
if (tb->properties) {
for (i = 0; i < mono_array_length (tb->properties); ++i) {
MonoReflectionPropertyBuilder* pb;
pb = mono_array_get (tb->properties, MonoReflectionPropertyBuilder*, i);
- mono_image_add_cattrs (assembly, pb->table_idx, CUSTOM_ATTR_PROPERTY, pb->cattrs);
+ mono_image_add_cattrs (assembly, pb->table_idx, MONO_CUSTOM_ATTR_PROPERTY, pb->cattrs);
}
}
if (tb->ctors) {
for (i = 0; i < mono_array_length (tb->ctors); ++i) {
MonoReflectionCtorBuilder* cb;
cb = mono_array_get (tb->ctors, MonoReflectionCtorBuilder*, i);
- mono_image_add_cattrs (assembly, cb->table_idx, CUSTOM_ATTR_METHODDEF, cb->cattrs);
+ mono_image_add_cattrs (assembly, cb->table_idx, MONO_CUSTOM_ATTR_METHODDEF, cb->cattrs);
params_add_cattrs (assembly, cb->pinfo);
}
}
if (tb->methods) {
- for (i = 0; i < mono_array_length (tb->methods); ++i) {
+ for (i = 0; i < tb->num_methods; ++i) {
MonoReflectionMethodBuilder* mb;
mb = mono_array_get (tb->methods, MonoReflectionMethodBuilder*, i);
- mono_image_add_cattrs (assembly, mb->table_idx, CUSTOM_ATTR_METHODDEF, mb->cattrs);
+ mono_image_add_cattrs (assembly, mb->table_idx, MONO_CUSTOM_ATTR_METHODDEF, mb->cattrs);
params_add_cattrs (assembly, mb->pinfo);
}
}
@@ -1630,17 +3036,54 @@ type_add_cattrs (MonoDynamicAssembly *assembly, MonoReflectionTypeBuilder *tb) {
}
static void
-module_add_cattrs (MonoDynamicAssembly *assembly, MonoReflectionModuleBuilder *mb) {
+module_add_cattrs (MonoDynamicImage *assembly, MonoReflectionModuleBuilder *mb) {
int i;
- mono_image_add_cattrs (assembly, mb->table_idx, CUSTOM_ATTR_MODULE, mb->cattrs);
+ mono_image_add_cattrs (assembly, mb->table_idx, MONO_CUSTOM_ATTR_MODULE, mb->cattrs);
+
+ /* no types in the module */
+ if (!mb->types)
+ return;
- for (i = 0; i < mono_array_length (mb->types); ++i)
+ for (i = 0; i < mb->num_types; ++i)
type_add_cattrs (assembly, mono_array_get (mb->types, MonoReflectionTypeBuilder*, i));
}
static void
-mono_image_fill_module_table (MonoDomain *domain, MonoReflectionModuleBuilder *mb, MonoDynamicAssembly *assembly)
+mono_image_fill_file_table (MonoDomain *domain, MonoReflectionModule *module, MonoDynamicImage *assembly)
+{
+ MonoDynamicTable *table;
+ guint32 *values;
+ char blob_size [6];
+ guchar hash [20];
+ char *b = blob_size;
+ char *dir, *path;
+
+ table = &assembly->tables [MONO_TABLE_FILE];
+ table->rows++;
+ alloc_table (table, table->rows);
+ values = table->values + table->next_idx * MONO_FILE_SIZE;
+ values [MONO_FILE_FLAGS] = FILE_CONTAINS_METADATA;
+ values [MONO_FILE_NAME] = string_heap_insert (&assembly->sheap, module->image->module_name);
+ if (module->image->dynamic) {
+ /* This depends on the fact that the main module is emitted last */
+ dir = mono_string_to_utf8 (((MonoReflectionModuleBuilder*)module)->assemblyb->dir);
+ path = g_strdup_printf ("%s%c%s", dir, G_DIR_SEPARATOR, module->image->module_name);
+ } else {
+ dir = NULL;
+ path = g_strdup (module->image->name);
+ }
+ mono_sha1_get_digest_from_file (path, hash);
+ g_free (dir);
+ g_free (path);
+ mono_metadata_encode_value (20, b, &b);
+ values [MONO_FILE_HASH_VALUE] = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
+ mono_image_add_stream_data (&assembly->blob, hash, 20);
+ table->next_idx ++;
+}
+
+static void
+mono_image_fill_module_table (MonoDomain *domain, MonoReflectionModuleBuilder *mb, MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
int i;
@@ -1657,23 +3100,89 @@ mono_image_fill_module_table (MonoDomain *domain, MonoReflectionModuleBuilder *m
table->values [mb->table_idx * MONO_MODULE_SIZE + MONO_MODULE_MVID] = i;
table->values [mb->table_idx * MONO_MODULE_SIZE + MONO_MODULE_ENC] = 0;
table->values [mb->table_idx * MONO_MODULE_SIZE + MONO_MODULE_ENCBASE] = 0;
+}
- /*
- * fill-in info in other tables as well.
- */
- table = &assembly->tables [MONO_TABLE_TYPEDEF];
- table->rows += mono_array_length (mb->types);
+static guint32
+mono_image_fill_export_table_from_class (MonoDomain *domain, MonoClass *klass,
+ guint32 module_index, guint32 parent_index, MonoDynamicImage *assembly)
+{
+ MonoDynamicTable *table;
+ guint32 *values;
+ guint32 visib, res;
+
+ visib = klass->flags & TYPE_ATTRIBUTE_VISIBILITY_MASK;
+ if (! ((visib & TYPE_ATTRIBUTE_PUBLIC) || (visib & TYPE_ATTRIBUTE_NESTED_PUBLIC)))
+ return 0;
+
+ table = &assembly->tables [MONO_TABLE_EXPORTEDTYPE];
+ table->rows++;
alloc_table (table, table->rows);
- /*
- * We assign here the typedef indexes to avoid mismatches if a type that
- * has not yet been stored in the tables is referenced by another type.
+ values = table->values + table->next_idx * MONO_EXP_TYPE_SIZE;
+
+ values [MONO_EXP_TYPE_FLAGS] = klass->flags;
+ values [MONO_EXP_TYPE_TYPEDEF] = klass->type_token;
+ if (klass->nested_in)
+ values [MONO_EXP_TYPE_IMPLEMENTATION] = (parent_index << MONO_IMPLEMENTATION_BITS) + MONO_IMPLEMENTATION_EXP_TYPE;
+ else
+ values [MONO_EXP_TYPE_IMPLEMENTATION] = (module_index << MONO_IMPLEMENTATION_BITS) + MONO_IMPLEMENTATION_FILE;
+ values [MONO_EXP_TYPE_NAME] = string_heap_insert (&assembly->sheap, klass->name);
+ values [MONO_EXP_TYPE_NAMESPACE] = string_heap_insert (&assembly->sheap, klass->name_space);
+
+ res = table->next_idx;
+
+ table->next_idx ++;
+
+ /* Emit nested types */
+ if (klass->nested_classes) {
+ GList *tmp;
+
+ for (tmp = klass->nested_classes; tmp; tmp = tmp->next)
+ mono_image_fill_export_table_from_class (domain, tmp->data, module_index, table->next_idx - 1, assembly);
+ }
+
+ return res;
+}
+
+static void
+mono_image_fill_export_table (MonoDomain *domain, MonoReflectionTypeBuilder *tb,
+ guint32 module_index, guint32 parent_index, MonoDynamicImage *assembly)
+{
+ MonoClass *klass;
+ guint32 idx, i;
+
+ klass = mono_class_from_mono_type (tb->type.type);
+
+ klass->type_token = mono_metadata_make_token (MONO_TABLE_TYPEDEF, tb->table_idx);
+
+ idx = mono_image_fill_export_table_from_class (domain, klass, module_index,
+ parent_index, assembly);
+
+ /*
+ * Emit nested types
+ * We need to do this ourselves since klass->nested_classes is not set up.
*/
- for (i = 0; i < mono_array_length (mb->types); ++i) {
- MonoReflectionTypeBuilder *type = mono_array_get (mb->types, MonoReflectionTypeBuilder*, i);
- assign_type_idx (type, table);
+ if (tb->subtypes) {
+ for (i = 0; i < mono_array_length (tb->subtypes); ++i)
+ mono_image_fill_export_table (domain, mono_array_get (tb->subtypes, MonoReflectionTypeBuilder*, i), module_index, idx, assembly);
+ }
+}
+
+static void
+mono_image_fill_export_table_from_module (MonoDomain *domain, MonoReflectionModule *module,
+ guint32 module_index, MonoDynamicImage *assembly)
+{
+ MonoImage *image = module->image;
+ MonoTableInfo *t;
+ guint32 i;
+
+ t = &image->tables [MONO_TABLE_TYPEDEF];
+
+ for (i = 0; i < t->rows; ++i) {
+ MonoClass *klass = mono_class_get (image, mono_metadata_make_token (MONO_TABLE_TYPEDEF, i + 1));
+
+ if (klass->flags & TYPE_ATTRIBUTE_PUBLIC)
+ mono_image_fill_export_table_from_class (domain, klass, module_index, 0, assembly);
}
- for (i = 0; i < mono_array_length (mb->types); ++i)
- mono_image_get_type_info (domain, mono_array_get (mb->types, MonoReflectionTypeBuilder*, i), assembly);
}
#define align_pointer(base,p)\
@@ -1721,6 +3230,39 @@ compare_nested (const void *a, const void *b)
return a_values [MONO_NESTED_CLASS_NESTED] - b_values [MONO_NESTED_CLASS_NESTED];
}
+static int
+compare_genericparam (const void *a, const void *b)
+{
+ const GenericParamTableEntry **a_entry = (const GenericParamTableEntry **) a;
+ const GenericParamTableEntry **b_entry = (const GenericParamTableEntry **) b;
+
+ return (*a_entry)->owner - (*b_entry)->owner;
+}
+
+static int
+compare_declsecurity_attrs (const void *a, const void *b)
+{
+ const guint32 *a_values = a;
+ const guint32 *b_values = b;
+
+ return a_values [MONO_DECL_SECURITY_PARENT] - b_values [MONO_DECL_SECURITY_PARENT];
+}
+
+static void
+pad_heap (MonoDynamicStream *sh)
+{
+ if (sh->index & 3) {
+ int sz = 4 - (sh->index & 3);
+ memset (sh->data + sh->index, 0, sz);
+ sh->index += sz;
+ }
+}
+
+struct StreamDesc {
+ const char *name;
+ MonoDynamicStream *stream;
+};
+
/*
* build_compressed_metadata() fills in the blob of data that represents the
* raw metadata as it will be saved in the PE file. The five streams are output
@@ -1728,7 +3270,7 @@ compare_nested (const void *a, const void *b)
* to the compressed on-disk format.
*/
static void
-build_compressed_metadata (MonoDynamicAssembly *assembly)
+build_compressed_metadata (MonoDynamicImage *assembly)
{
MonoDynamicTable *table;
int i;
@@ -1743,22 +3285,24 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
guint16 *int16val;
MonoImage *meta;
unsigned char *p;
- /*
- * We need to use the current ms version or the ms runtime it won't find
- * the support dlls. D'oh!
- * const char *version = "mono-" VERSION;
- */
- const char *version = "v1.0.3705";
- struct StreamDesc {
- const char *name;
- MonoDynamicStream *stream;
- } stream_desc [] = {
- {"#~", &assembly->tstream},
- {"#Strings", &assembly->sheap},
- {"#US", &assembly->us},
- {"#Blob", &assembly->blob},
- {"#GUID", &assembly->guid}
- };
+ struct StreamDesc stream_desc [5];
+
+ qsort (assembly->gen_params->pdata, assembly->gen_params->len, sizeof (gpointer), compare_genericparam);
+ for (i = 0; i < assembly->gen_params->len; i++){
+ GenericParamTableEntry *entry = g_ptr_array_index (assembly->gen_params, i);
+ write_generic_param_entry (assembly, entry);
+ }
+
+ stream_desc [0].name = "#~";
+ stream_desc [0].stream = &assembly->tstream;
+ stream_desc [1].name = "#Strings";
+ stream_desc [1].stream = &assembly->sheap;
+ stream_desc [2].name = "#US";
+ stream_desc [2].stream = &assembly->us;
+ stream_desc [3].name = "#Blob";
+ stream_desc [3].stream = &assembly->blob;
+ stream_desc [4].name = "#GUID";
+ stream_desc [4].stream = &assembly->guid;
/* tables that are sorted */
sorted_mask = ((guint64)1 << MONO_TABLE_CONSTANT) | ((guint64)1 << MONO_TABLE_FIELDMARSHAL)
@@ -1766,12 +3310,18 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
| ((guint64)1 << MONO_TABLE_FIELDLAYOUT) | ((guint64)1 << MONO_TABLE_FIELDRVA)
| ((guint64)1 << MONO_TABLE_IMPLMAP) | ((guint64)1 << MONO_TABLE_NESTEDCLASS)
| ((guint64)1 << MONO_TABLE_METHODIMPL) | ((guint64)1 << MONO_TABLE_CUSTOMATTRIBUTE)
- | ((guint64)1 << MONO_TABLE_DECLSECURITY);
+ | ((guint64)1 << MONO_TABLE_DECLSECURITY) | ((guint64)1 << MONO_TABLE_GENERICPARAM);
/* Compute table sizes */
/* the MonoImage has already been created in mono_image_basic_init() */
- meta = assembly->assembly.image;
-
+ meta = &assembly->image;
+
+ /* sizes should be multiple of 4 */
+ pad_heap (&assembly->blob);
+ pad_heap (&assembly->guid);
+ pad_heap (&assembly->sheap);
+ pad_heap (&assembly->us);
+
/* Setup the info used by compute_sizes () */
meta->idx_blob_wide = assembly->blob.index >= 65536 ? 1 : 0;
meta->idx_guid_wide = assembly->guid.index >= 65536 ? 1 : 0;
@@ -1796,6 +3346,9 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
}
heapt_size += 24; /* #~ header size */
heapt_size += ntables * 4;
+ /* make multiple of 4 */
+ heapt_size += 3;
+ heapt_size &= ~3;
meta_size += heapt_size;
meta->raw_metadata = g_malloc0 (meta_size);
p = meta->raw_metadata;
@@ -1808,9 +3361,9 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
p += 8;
/* version string */
int32val = (guint32*)p;
- *int32val = GUINT32_TO_LE ((strlen (version) + 3) & (~3)); /* needs to be multiple of 4 */
+ *int32val = GUINT32_TO_LE ((strlen (meta->version) + 3) & (~3)); /* needs to be multiple of 4 */
p += 4;
- memcpy (p, version, GUINT32_FROM_LE (*int32val));
+ memcpy (p, meta->version, strlen (meta->version));
p += GUINT32_FROM_LE (*int32val);
align_pointer (meta->raw_metadata, p);
int16val = (guint16*)p;
@@ -1845,8 +3398,17 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
int32val = (guint32*)p;
*int32val = GUINT32_TO_LE (0); /* reserved */
p += 4;
- *p++ = 1; /* version */
- *p++ = 0;
+
+ if ((assembly->tables [MONO_TABLE_GENERICPARAM].rows > 0) ||
+ (assembly->tables [MONO_TABLE_METHODSPEC].rows > 0) ||
+ (assembly->tables [MONO_TABLE_GENERICPARAMCONSTRAINT].rows > 0)) {
+ *p++ = 1; /* version */
+ *p++ = 1;
+ } else {
+ *p++ = 1; /* version */
+ *p++ = 0;
+ }
+
if (meta->idx_string_wide)
*p |= 0x01;
if (meta->idx_guid_wide)
@@ -1854,7 +3416,7 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
if (meta->idx_blob_wide)
*p |= 0x04;
++p;
- *p++ = 0; /* reserved */
+ *p++ = 1; /* reserved */
int64val = (guint64*)p;
*int64val++ = GUINT64_TO_LE (valid_mask);
*int64val++ = GUINT64_TO_LE (valid_mask & sorted_mask); /* bitvector of sorted tables */
@@ -1880,6 +3442,10 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
table = &assembly->tables [MONO_TABLE_NESTEDCLASS];
if (table->rows)
qsort (table->values + MONO_NESTED_CLASS_SIZE, table->rows, sizeof (guint32) * MONO_NESTED_CLASS_SIZE, compare_nested);
+ /* Section 21.11 DeclSecurity in Partition II doesn't specify this to be sorted by MS implementation requires it */
+ table = &assembly->tables [MONO_TABLE_DECLSECURITY];
+ if (table->rows)
+ qsort (table->values + MONO_DECL_SECURITY_SIZE, table->rows, sizeof (guint32) * MONO_DECL_SECURITY_SIZE, compare_declsecurity_attrs);
/* compress the tables */
for (i = 0; i < 64; i++){
@@ -1899,14 +3465,14 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
*p++ = values [col];
break;
case 2:
- int16val = (guint16*)p;
- *int16val = GUINT16_TO_LE (values [col]);
- p += 2;
+ *p++ = values [col] & 0xff;
+ *p++ = (values [col] >> 8) & 0xff;
break;
case 4:
- int32val = (guint32*)p;
- *int32val = GUINT32_TO_LE (values [col]);
- p += 4;
+ *p++ = values [col] & 0xff;
+ *p++ = (values [col] >> 8) & 0xff;
+ *p++ = (values [col] >> 16) & 0xff;
+ *p++ = (values [col] >> 24) & 0xff;
break;
default:
g_assert_not_reached ();
@@ -1935,13 +3501,15 @@ build_compressed_metadata (MonoDynamicAssembly *assembly)
* tokens for the method with ILGenerator @ilgen.
*/
static void
-fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicAssembly *assembly) {
+fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicImage *assembly) {
guint32 code_idx = GPOINTER_TO_UINT (value);
MonoReflectionILTokenInfo *iltoken;
MonoReflectionFieldBuilder *field;
MonoReflectionCtorBuilder *ctor;
MonoReflectionMethodBuilder *method;
- guint32 i, idx;
+ MonoReflectionTypeBuilder *tb;
+ MonoReflectionArrayMethod *am;
+ guint32 i, idx = 0;
unsigned char *target;
for (i = 0; i < ilgen->num_token_fixups; ++i) {
@@ -1949,10 +3517,15 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicAssembly *a
target = assembly->code.data + code_idx + iltoken->code_pos;
switch (target [3]) {
case MONO_TABLE_FIELD:
- if (strcmp (iltoken->member->vtable->klass->name, "FieldBuilder"))
+ if (!strcmp (iltoken->member->vtable->klass->name, "FieldBuilder")) {
+ field = (MonoReflectionFieldBuilder *)iltoken->member;
+ idx = field->table_idx;
+ } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoField")) {
+ MonoClassField *f = ((MonoReflectionField*)iltoken->member)->field;
+ idx = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->field_to_table_idx, f));
+ } else {
g_assert_not_reached ();
- field = (MonoReflectionFieldBuilder *)iltoken->member;
- idx = field->table_idx;
+ }
break;
case MONO_TABLE_METHOD:
if (!strcmp (iltoken->member->vtable->klass->name, "MethodBuilder")) {
@@ -1961,6 +3534,46 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicAssembly *a
} else if (!strcmp (iltoken->member->vtable->klass->name, "ConstructorBuilder")) {
ctor = (MonoReflectionCtorBuilder *)iltoken->member;
idx = ctor->table_idx;
+ } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoMethod") ||
+ !strcmp (iltoken->member->vtable->klass->name, "MonoCMethod")) {
+ MonoMethod *m = ((MonoReflectionMethod*)iltoken->member)->method;
+ idx = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->method_to_table_idx, m));
+ } else {
+ g_assert_not_reached ();
+ }
+ break;
+ case MONO_TABLE_TYPEDEF:
+ if (strcmp (iltoken->member->vtable->klass->name, "TypeBuilder"))
+ g_assert_not_reached ();
+ tb = (MonoReflectionTypeBuilder *)iltoken->member;
+ idx = tb->table_idx;
+ break;
+ case MONO_TABLE_MEMBERREF:
+ if (!strcmp (iltoken->member->vtable->klass->name, "MonoArrayMethod")) {
+ am = (MonoReflectionArrayMethod*)iltoken->member;
+ idx = am->table_idx;
+ } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoMethod") ||
+ !strcmp (iltoken->member->vtable->klass->name, "MonoCMethod")) {
+ MonoMethod *m = ((MonoReflectionMethod*)iltoken->member)->method;
+ g_assert (m->klass->generic_inst);
+ continue;
+ } else if (!strcmp (iltoken->member->vtable->klass->name, "FieldBuilder")) {
+ continue;
+ } else if (!strcmp (iltoken->member->vtable->klass->name, "MonoField")) {
+ MonoClassField *f = ((MonoReflectionField*)iltoken->member)->field;
+ g_assert (f->generic_info);
+ continue;
+ } else if (!strcmp (iltoken->member->vtable->klass->name, "MethodBuilder")) {
+ continue;
+ } else {
+ g_assert_not_reached ();
+ }
+ break;
+ case MONO_TABLE_METHODSPEC:
+ if (!strcmp (iltoken->member->vtable->klass->name, "MonoMethod")) {
+ MonoMethod *m = ((MonoReflectionMethod*)iltoken->member)->method;
+ g_assert (m->signature->generic_param_count);
+ continue;
} else {
g_assert_not_reached ();
}
@@ -1975,62 +3588,278 @@ fixup_method (MonoReflectionILGen *ilgen, gpointer value, MonoDynamicAssembly *a
}
/*
- * mono_image_build_metadata() will fill the info in all the needed metadata tables
- * for the AssemblyBuilder @assemblyb: it iterates over the assembly modules
- * and recursively outputs the info for a module. Each module will output all the info
- * about it's types etc.
- * At the end of the process, method and field tokens are fixed up and the on-disk
- * compressed metadata representation is created.
+ * fixup_cattrs:
+ *
+ * The CUSTOM_ATTRIBUTE table might contain METHODDEF tokens whose final
+ * value is not known when the table is emitted.
*/
static void
-mono_image_build_metadata (MonoReflectionAssemblyBuilder *assemblyb)
+fixup_cattrs (MonoDynamicImage *assembly)
+{
+ MonoDynamicTable *table;
+ guint32 *values;
+ guint32 type, i, idx, token;
+ MonoObject *ctor;
+
+ table = &assembly->tables [MONO_TABLE_CUSTOMATTRIBUTE];
+
+ for (i = 0; i < table->rows; ++i) {
+ values = table->values + ((i + 1) * MONO_CUSTOM_ATTR_SIZE);
+
+ type = values [MONO_CUSTOM_ATTR_TYPE];
+ if ((type & MONO_CUSTOM_ATTR_TYPE_MASK) == MONO_CUSTOM_ATTR_TYPE_METHODDEF) {
+ idx = type >> MONO_CUSTOM_ATTR_TYPE_BITS;
+ token = mono_metadata_make_token (MONO_TABLE_METHOD, idx);
+ ctor = mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token));
+ g_assert (ctor);
+
+ if (!strcmp (ctor->vtable->klass->name, "MonoCMethod")) {
+ MonoMethod *m = ((MonoReflectionMethod*)ctor)->method;
+ idx = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->method_to_table_idx, m));
+ values [MONO_CUSTOM_ATTR_TYPE] = (idx << MONO_CUSTOM_ATTR_TYPE_BITS) | MONO_CUSTOM_ATTR_TYPE_METHODDEF;
+ }
+ }
+ }
+}
+
+static void
+assembly_add_resource_manifest (MonoReflectionModuleBuilder *mb, MonoDynamicImage *assembly, MonoReflectionResource *rsrc, guint32 implementation)
{
MonoDynamicTable *table;
- MonoDynamicAssembly *assembly = assemblyb->dynamic_assembly;
- MonoDomain *domain = ((MonoObject *)assemblyb)->vtable->domain;
- guint32 len;
guint32 *values;
char *name;
- int i;
+
+ table = &assembly->tables [MONO_TABLE_MANIFESTRESOURCE];
+ table->rows++;
+ alloc_table (table, table->rows);
+ values = table->values + table->next_idx * MONO_MANIFEST_SIZE;
+ values [MONO_MANIFEST_OFFSET] = rsrc->offset;
+ values [MONO_MANIFEST_FLAGS] = rsrc->attrs;
+ name = mono_string_to_utf8 (rsrc->name);
+ values [MONO_MANIFEST_NAME] = string_heap_insert (&assembly->sheap, name);
+ g_free (name);
+ values [MONO_MANIFEST_IMPLEMENTATION] = implementation;
+ table->next_idx++;
+}
+
+static void
+assembly_add_resource (MonoReflectionModuleBuilder *mb, MonoDynamicImage *assembly, MonoReflectionResource *rsrc)
+{
+ MonoDynamicTable *table;
+ guint32 *values;
+ char blob_size [6];
+ guchar hash [20];
+ char *b = blob_size;
+ char *name, *sname;
+ guint32 idx, offset;
+
+ if (rsrc->filename) {
+ name = mono_string_to_utf8 (rsrc->filename);
+ sname = g_path_get_basename (name);
- assembly->text_rva = START_TEXT_RVA;
+ table = &assembly->tables [MONO_TABLE_FILE];
+ table->rows++;
+ alloc_table (table, table->rows);
+ values = table->values + table->next_idx * MONO_FILE_SIZE;
+ values [MONO_FILE_FLAGS] = FILE_CONTAINS_NO_METADATA;
+ values [MONO_FILE_NAME] = string_heap_insert (&assembly->sheap, sname);
+ g_free (sname);
+
+ mono_sha1_get_digest_from_file (name, hash);
+ mono_metadata_encode_value (20, b, &b);
+ values [MONO_FILE_HASH_VALUE] = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
+ mono_image_add_stream_data (&assembly->blob, hash, 20);
+ g_free (name);
+ idx = table->next_idx++;
+ rsrc->offset = 0;
+ idx = MONO_IMPLEMENTATION_FILE | (idx << MONO_IMPLEMENTATION_BITS);
+ } else {
+ char sizebuf [4];
+ offset = mono_array_length (rsrc->data);
+ sizebuf [0] = offset; sizebuf [1] = offset >> 8;
+ sizebuf [2] = offset >> 16; sizebuf [3] = offset >> 24;
+ rsrc->offset = mono_image_add_stream_data (&assembly->resources, sizebuf, 4);
+ mono_image_add_stream_data (&assembly->resources, mono_array_addr (rsrc->data, char, 0), mono_array_length (rsrc->data));
+
+ if (!mb->is_main)
+ /*
+ * The entry should be emitted into the MANIFESTRESOURCE table of
+ * the main module, but that needs to reference the FILE table
+ * which isn't emitted yet.
+ */
+ return;
+ else
+ idx = 0;
+ }
+
+ assembly_add_resource_manifest (mb, assembly, rsrc, idx);
+}
+
+static void
+set_version_from_string (MonoString *version, guint32 *values)
+{
+ gchar *ver, *p, *str;
+ guint32 i;
+
+ values [MONO_ASSEMBLY_MAJOR_VERSION] = 0;
+ values [MONO_ASSEMBLY_MINOR_VERSION] = 0;
+ values [MONO_ASSEMBLY_REV_NUMBER] = 0;
+ values [MONO_ASSEMBLY_BUILD_NUMBER] = 0;
+ if (!version)
+ return;
+ ver = str = mono_string_to_utf8 (version);
+ for (i = 0; i < 4; ++i) {
+ values [MONO_ASSEMBLY_MAJOR_VERSION + i] = strtol (ver, &p, 10);
+ switch (*p) {
+ case '.':
+ p++;
+ break;
+ case '*':
+ /* handle Revision and Build */
+ p++;
+ break;
+ }
+ ver = p;
+ }
+ g_free (str);
+}
+static guint32
+load_public_key (MonoArray *pkey, MonoDynamicImage *assembly) {
+ gsize len;
+ guint32 token = 0;
+ char blob_size [6];
+ char *b = blob_size;
+
+ if (!pkey)
+ return token;
+
+ len = mono_array_length (pkey);
+ mono_metadata_encode_value (len, b, &b);
+ token = mono_image_add_stream_data (&assembly->blob, blob_size, b - blob_size);
+ mono_image_add_stream_data (&assembly->blob, mono_array_addr (pkey, guint8, 0), len);
+
+ /* need to get the actual value from the key type... */
+ assembly->strong_name_size = 128;
+ assembly->strong_name = g_malloc0 (assembly->strong_name_size);
+
+ return token;
+}
+
+static void
+mono_image_emit_manifest (MonoReflectionModuleBuilder *moduleb)
+{
+ MonoDynamicTable *table;
+ MonoDynamicImage *assembly;
+ MonoReflectionAssemblyBuilder *assemblyb;
+ MonoDomain *domain;
+ guint32 *values;
+ char *name;
+ int i;
+ guint32 module_index;
+
+ assemblyb = moduleb->assemblyb;
+ assembly = moduleb->dynamic_image;
+ domain = mono_object_domain (assemblyb);
+
+ /* Emit ASSEMBLY table */
table = &assembly->tables [MONO_TABLE_ASSEMBLY];
alloc_table (table, 1);
values = table->values + MONO_ASSEMBLY_SIZE;
- values [MONO_ASSEMBLY_HASH_ALG] = 0x8004;
+ values [MONO_ASSEMBLY_HASH_ALG] = assemblyb->algid? assemblyb->algid: ASSEMBLY_HASH_SHA1;
name = mono_string_to_utf8 (assemblyb->name);
values [MONO_ASSEMBLY_NAME] = string_heap_insert (&assembly->sheap, name);
g_free (name);
- values [MONO_ASSEMBLY_CULTURE] = string_heap_insert (&assembly->sheap, "");
- values [MONO_ASSEMBLY_PUBLIC_KEY] = 0;
- values [MONO_ASSEMBLY_MAJOR_VERSION] = 0;
- values [MONO_ASSEMBLY_MINOR_VERSION] = 0;
- values [MONO_ASSEMBLY_REV_NUMBER] = 0;
- values [MONO_ASSEMBLY_BUILD_NUMBER] = 0;
- values [MONO_ASSEMBLY_FLAGS] = 0;
+ if (assemblyb->culture) {
+ name = mono_string_to_utf8 (assemblyb->culture);
+ values [MONO_ASSEMBLY_CULTURE] = string_heap_insert (&assembly->sheap, name);
+ g_free (name);
+ } else {
+ values [MONO_ASSEMBLY_CULTURE] = string_heap_insert (&assembly->sheap, "");
+ }
+ values [MONO_ASSEMBLY_PUBLIC_KEY] = load_public_key (assemblyb->public_key, assembly);
+ values [MONO_ASSEMBLY_FLAGS] = assemblyb->flags;
+ set_version_from_string (assemblyb->version, values);
- assembly->tables [MONO_TABLE_TYPEDEF].rows = 1; /* .<Module> */
- assembly->tables [MONO_TABLE_TYPEDEF].next_idx++;
+ /* Emit FILE + EXPORTED_TYPE table */
+ module_index = 0;
+ for (i = 0; i < mono_array_length (assemblyb->modules); ++i) {
+ int j;
+ MonoReflectionModuleBuilder *file_module =
+ mono_array_get (assemblyb->modules, MonoReflectionModuleBuilder*, i);
+ if (file_module != moduleb) {
+ mono_image_fill_file_table (domain, (MonoReflectionModule*)file_module, assembly);
+ module_index ++;
+ if (file_module->types) {
+ for (j = 0; j < file_module->num_types; ++j) {
+ MonoReflectionTypeBuilder *tb = mono_array_get (file_module->types, MonoReflectionTypeBuilder*, j);
+ mono_image_fill_export_table (domain, tb, module_index, 0, assembly);
+ }
+ }
+ }
+ }
+ if (assemblyb->loaded_modules) {
+ for (i = 0; i < mono_array_length (assemblyb->loaded_modules); ++i) {
+ MonoReflectionModule *file_module =
+ mono_array_get (assemblyb->loaded_modules, MonoReflectionModule*, i);
+ mono_image_fill_file_table (domain, file_module, assembly);
+ module_index ++;
+ mono_image_fill_export_table_from_module (domain, file_module, module_index, assembly);
+ }
+ }
- if (assemblyb->modules) {
- len = mono_array_length (assemblyb->modules);
- table = &assembly->tables [MONO_TABLE_MODULE];
- alloc_table (table, len);
- for (i = 0; i < len; ++i)
- mono_image_fill_module_table (domain, mono_array_get (assemblyb->modules, MonoReflectionModuleBuilder*, i), assembly);
- } else {
- table = &assembly->tables [MONO_TABLE_MODULE];
- table->rows++;
- alloc_table (table, table->rows);
- table->values [table->next_idx * MONO_MODULE_SIZE + MONO_MODULE_NAME] = string_heap_insert (&assembly->sheap, "RefEmit_YouForgotToDefineAModule");
- table->next_idx ++;
+ /* Emit MANIFESTRESOURCE table */
+ module_index = 0;
+ for (i = 0; i < mono_array_length (assemblyb->modules); ++i) {
+ int j;
+ MonoReflectionModuleBuilder *file_module =
+ mono_array_get (assemblyb->modules, MonoReflectionModuleBuilder*, i);
+ /* The table for the main module is emitted later */
+ if (file_module != moduleb) {
+ module_index ++;
+ if (file_module->resources) {
+ int len = mono_array_length (file_module->resources);
+ for (j = 0; j < len; ++j) {
+ MonoReflectionResource* res = (MonoReflectionResource*)mono_array_addr (file_module->resources, MonoReflectionResource, j);
+ assembly_add_resource_manifest (file_module, assembly, res, MONO_IMPLEMENTATION_FILE | (module_index << MONO_IMPLEMENTATION_BITS));
+ }
+ }
+ }
+ }
+}
+
+/*
+ * mono_image_build_metadata() will fill the info in all the needed metadata tables
+ * for the modulebuilder @moduleb.
+ * At the end of the process, method and field tokens are fixed up and the
+ * on-disk compressed metadata representation is created.
+ */
+void
+mono_image_build_metadata (MonoReflectionModuleBuilder *moduleb)
+{
+ MonoDynamicTable *table;
+ MonoDynamicImage *assembly;
+ MonoReflectionAssemblyBuilder *assemblyb;
+ MonoDomain *domain;
+ guint32 *values;
+ int i;
+
+ assemblyb = moduleb->assemblyb;
+ assembly = moduleb->dynamic_image;
+ domain = mono_object_domain (assemblyb);
+
+ if (assembly->text_rva)
+ return;
+
+ assembly->text_rva = START_TEXT_RVA;
+
+ if (moduleb->is_main) {
+ mono_image_emit_manifest (moduleb);
}
table = &assembly->tables [MONO_TABLE_TYPEDEF];
- /*
- * table->rows is already set above and in mono_image_fill_module_table.
- */
+ table->rows = 1; /* .<Module> */
+ table->next_idx++;
alloc_table (table, table->rows);
/*
* Set the first entry.
@@ -2043,55 +3872,191 @@ mono_image_build_metadata (MonoReflectionAssemblyBuilder *assemblyb)
values [MONO_TYPEDEF_FIELD_LIST] = 1;
values [MONO_TYPEDEF_METHOD_LIST] = 1;
- /* add all the custom attributes at the end, once all the indexes are stable */
- mono_image_add_cattrs (assembly, 1, CUSTOM_ATTR_ASSEMBLY, assemblyb->cattrs);
+ /*
+ * handle global methods
+ * FIXME: test what to do when global methods are defined in multiple modules.
+ */
+ if (moduleb->global_methods) {
+ table = &assembly->tables [MONO_TABLE_METHOD];
+ table->rows += mono_array_length (moduleb->global_methods);
+ alloc_table (table, table->rows);
+ for (i = 0; i < mono_array_length (moduleb->global_methods); ++i)
+ mono_image_get_method_info (
+ mono_array_get (moduleb->global_methods, MonoReflectionMethodBuilder*, i), assembly);
+ }
+ if (moduleb->global_fields) {
+ table = &assembly->tables [MONO_TABLE_FIELD];
+ table->rows += mono_array_length (moduleb->global_fields);
+ alloc_table (table, table->rows);
+ for (i = 0; i < mono_array_length (moduleb->global_fields); ++i)
+ mono_image_get_field_info (
+ mono_array_get (moduleb->global_fields, MonoReflectionFieldBuilder*, i), assembly);
+ }
- if (assemblyb->modules) {
- len = mono_array_length (assemblyb->modules);
- for (i = 0; i < len; ++i)
- module_add_cattrs (assembly, mono_array_get (assemblyb->modules, MonoReflectionModuleBuilder*, i));
+ table = &assembly->tables [MONO_TABLE_MODULE];
+ alloc_table (table, 1);
+ mono_image_fill_module_table (domain, moduleb, assembly);
+
+ /* Emit types */
+ {
+ /* Collect all types into a list sorted by their table_idx */
+ GPtrArray *types = g_ptr_array_new ();
+
+ if (moduleb->types)
+ for (i = 0; i < moduleb->num_types; ++i) {
+ MonoReflectionTypeBuilder *type = mono_array_get (moduleb->types, MonoReflectionTypeBuilder*, i);
+ collect_types (types, type);
+ }
+
+ g_ptr_array_sort (types, (GCompareFunc)compare_types_by_table_idx);
+ table = &assembly->tables [MONO_TABLE_TYPEDEF];
+ table->rows += types->len;
+ alloc_table (table, table->rows);
+
+ for (i = 0; i < types->len; ++i) {
+ MonoReflectionTypeBuilder *type = g_ptr_array_index (types, i);
+ mono_image_get_type_info (domain, type, assembly);
+ }
+ g_ptr_array_free (types, TRUE);
}
-
+
+ /*
+ * table->rows is already set above and in mono_image_fill_module_table.
+ */
+ /* add all the custom attributes at the end, once all the indexes are stable */
+ mono_image_add_cattrs (assembly, 1, MONO_CUSTOM_ATTR_ASSEMBLY, assemblyb->cattrs);
+
+ /* CAS assembly permissions */
+ if (assemblyb->permissions_minimum)
+ mono_image_add_decl_security (assembly, mono_metadata_make_token (MONO_TABLE_ASSEMBLY, 1), assemblyb->permissions_minimum);
+ if (assemblyb->permissions_optional)
+ mono_image_add_decl_security (assembly, mono_metadata_make_token (MONO_TABLE_ASSEMBLY, 1), assemblyb->permissions_optional);
+ if (assemblyb->permissions_refused)
+ mono_image_add_decl_security (assembly, mono_metadata_make_token (MONO_TABLE_ASSEMBLY, 1), assemblyb->permissions_refused);
+
+ module_add_cattrs (assembly, moduleb);
+
/* fixup tokens */
mono_g_hash_table_foreach (assembly->token_fixups, (GHFunc)fixup_method, assembly);
-
- build_compressed_metadata (assembly);
+ fixup_cattrs (assembly);
}
/*
* mono_image_insert_string:
- * @assembly: assembly builder object
+ * @module: module builder object
* @str: a string
*
- * Insert @str into the user string stream of @assembly.
+ * Insert @str into the user string stream of @module.
*/
guint32
-mono_image_insert_string (MonoReflectionAssemblyBuilder *assembly, MonoString *str)
+mono_image_insert_string (MonoReflectionModuleBuilder *module, MonoString *str)
{
+ MonoDynamicImage *assembly;
guint32 idx;
char buf [16];
char *b = buf;
- if (!assembly->dynamic_assembly)
- mono_image_basic_init (assembly);
- mono_metadata_encode_value (1 | (str->length * 2), b, &b);
- idx = mono_image_add_stream_data (&assembly->dynamic_assembly->us, buf, b-buf);
+ MONO_ARCH_SAVE_REGS;
+
+ if (!module->dynamic_image)
+ mono_image_module_basic_init (module);
+
+ assembly = module->dynamic_image;
+
+ if (assembly->save) {
+ mono_metadata_encode_value (1 | (str->length * 2), b, &b);
+ idx = mono_image_add_stream_data (&assembly->us, buf, b-buf);
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
{
char *swapped = g_malloc (2 * mono_string_length (str));
const char *p = (const char*)mono_string_chars (str);
swap_with_size (swapped, p, 2, mono_string_length (str));
- mono_image_add_stream_data (&assembly->dynamic_assembly->us, swapped, str->length * 2);
+ mono_image_add_stream_data (&assembly->us, swapped, str->length * 2);
g_free (swapped);
}
#else
- mono_image_add_stream_data (&assembly->dynamic_assembly->us, (const char*)mono_string_chars (str), str->length * 2);
+ mono_image_add_stream_data (&assembly->us, (const char*)mono_string_chars (str), str->length * 2);
#endif
- mono_image_add_stream_data (&assembly->dynamic_assembly->us, "", 1);
+ mono_image_add_stream_data (&assembly->us, "", 1);
+ } else {
+ idx = assembly->us.index ++;
+ }
+
+ mono_g_hash_table_insert (assembly->tokens, GUINT_TO_POINTER (MONO_TOKEN_STRING | idx), str);
+
return MONO_TOKEN_STRING | idx;
}
+guint32
+mono_image_create_method_token (MonoDynamicImage *assembly, MonoObject *obj, MonoArray *opt_param_types)
+{
+ MonoClass *klass;
+ guint32 token = 0;
+
+ klass = obj->vtable->klass;
+ if (strcmp (klass->name, "MonoMethod") == 0) {
+ MonoMethod *method = ((MonoReflectionMethod *)obj)->method;
+ MonoMethodSignature *sig, *old;
+ guint32 sig_token, parent;
+ int nargs, i;
+
+ g_assert (opt_param_types && (method->signature->sentinelpos >= 0));
+
+ nargs = mono_array_length (opt_param_types);
+ old = method->signature;
+ sig = mono_metadata_signature_alloc ( &assembly->image, old->param_count + nargs);
+
+ sig->hasthis = old->hasthis;
+ sig->explicit_this = old->explicit_this;
+ sig->call_convention = old->call_convention;
+ sig->generic_param_count = old->generic_param_count;
+ sig->param_count = old->param_count + nargs;
+ sig->sentinelpos = old->param_count;
+ sig->ret = old->ret;
+
+ for (i = 0; i < old->param_count; i++)
+ sig->params [i] = old->params [i];
+
+ for (i = 0; i < nargs; i++) {
+ MonoReflectionType *rt = mono_array_get (opt_param_types, MonoReflectionType *, i);
+ sig->params [old->param_count + i] = rt->type;
+ }
+
+ parent = mono_image_typedef_or_ref (assembly, &method->klass->byval_arg);
+ g_assert ((parent & MONO_TYPEDEFORREF_MASK) == MONO_MEMBERREF_PARENT_TYPEREF);
+ parent >>= MONO_TYPEDEFORREF_BITS;
+
+ parent <<= MONO_MEMBERREF_PARENT_BITS;
+ parent |= MONO_MEMBERREF_PARENT_TYPEREF;
+
+ sig_token = method_encode_signature (assembly, sig);
+ token = mono_image_get_varargs_method_token (assembly, parent, method->name, sig_token);
+ } else if (strcmp (klass->name, "MethodBuilder") == 0) {
+ MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder *)obj;
+ ReflectionMethodBuilder rmb;
+ guint32 parent, sig;
+
+ reflection_methodbuilder_from_method_builder (&rmb, mb);
+ rmb.opt_types = opt_param_types;
+
+ sig = method_builder_encode_signature (assembly, &rmb);
+
+ parent = mono_image_create_token (assembly, obj, TRUE);
+ g_assert (mono_metadata_token_table (parent) == MONO_TABLE_METHOD);
+
+ parent = mono_metadata_token_index (parent) << MONO_MEMBERREF_PARENT_BITS;
+ parent |= MONO_MEMBERREF_PARENT_METHODDEF;
+
+ token = mono_image_get_varargs_method_token (
+ assembly, parent, mono_string_to_utf8 (rmb.name), sig);
+ } else {
+ g_error ("requested method token for %s\n", klass->name);
+ }
+
+ return token;
+}
+
/*
* mono_image_create_token:
* @assembly: a dynamic assembly
@@ -2109,60 +4074,103 @@ mono_image_insert_string (MonoReflectionAssemblyBuilder *assembly, MonoString *s
* TypeBuilder
*/
guint32
-mono_image_create_token (MonoDynamicAssembly *assembly, MonoObject *obj)
+mono_image_create_token (MonoDynamicImage *assembly, MonoObject *obj, gboolean create_methodspec)
{
MonoClass *klass;
- guint32 token;
+ guint32 token = 0;
- if (!obj)
- g_error ("System.Array methods not yet supported");
-
klass = obj->vtable->klass;
if (strcmp (klass->name, "MethodBuilder") == 0) {
MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder *)obj;
- token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
+
+ if (((MonoReflectionTypeBuilder*)mb->type)->module->dynamic_image == assembly)
+ token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
+ else
+ token = mono_image_get_methodbuilder_token (assembly, mb);
/*g_print ("got token 0x%08x for %s\n", token, mono_string_to_utf8 (mb->name));*/
- return token;
- }
- if (strcmp (klass->name, "ConstructorBuilder") == 0) {
+ } else if (strcmp (klass->name, "ConstructorBuilder") == 0) {
MonoReflectionCtorBuilder *mb = (MonoReflectionCtorBuilder *)obj;
- token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
+
+ if (((MonoReflectionTypeBuilder*)mb->type)->module->dynamic_image == assembly)
+ token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
+ else
+ token = mono_image_get_ctorbuilder_token (assembly, mb);
/*g_print ("got token 0x%08x for %s\n", token, mono_string_to_utf8 (mb->name));*/
- return token;
- }
- if (strcmp (klass->name, "FieldBuilder") == 0) {
- MonoReflectionFieldBuilder *mb = (MonoReflectionFieldBuilder *)obj;
- return mb->table_idx | MONO_TOKEN_FIELD_DEF;
- }
- if (strcmp (klass->name, "TypeBuilder") == 0) {
+ } else if (strcmp (klass->name, "FieldBuilder") == 0) {
+ MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder *)obj;
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)fb->typeb;
+ if (tb->generic_params) {
+ token = mono_image_get_generic_field_token (assembly, fb);
+ } else {
+ token = fb->table_idx | MONO_TOKEN_FIELD_DEF;
+ }
+ } else if (strcmp (klass->name, "TypeBuilder") == 0) {
MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)obj;
- return tb->table_idx | MONO_TOKEN_TYPE_DEF;
- }
- if (strcmp (klass->name, "MonoType") == 0) {
+ token = tb->table_idx | MONO_TOKEN_TYPE_DEF;
+ } else if (strcmp (klass->name, "MonoType") == 0 ||
+ strcmp (klass->name, "GenericTypeParameterBuilder") == 0) {
MonoReflectionType *tb = (MonoReflectionType *)obj;
- return mono_metadata_token_from_dor (
+ token = mono_metadata_token_from_dor (
mono_image_typedef_or_ref (assembly, tb->type));
- }
- if (strcmp (klass->name, "MonoCMethod") == 0 ||
+ } else if (strcmp (klass->name, "MonoGenericInst") == 0) {
+ MonoReflectionType *tb = (MonoReflectionType *)obj;
+ token = mono_metadata_token_from_dor (
+ mono_image_typedef_or_ref (assembly, tb->type));
+ } else if (strcmp (klass->name, "MonoCMethod") == 0 ||
strcmp (klass->name, "MonoMethod") == 0) {
MonoReflectionMethod *m = (MonoReflectionMethod *)obj;
- token = mono_image_get_methodref_token (assembly, m->method);
+ if (m->method->signature->is_inflated) {
+ if (create_methodspec)
+ token = mono_image_get_methodspec_token (assembly, m->method);
+ else
+ token = mono_image_get_inflated_method_token (assembly, m->method);
+ } else if (m->method->signature->generic_param_count) {
+ g_assert_not_reached ();
+ } else if ((m->method->klass->image == &assembly->image) &&
+ !m->method->klass->generic_inst) {
+ static guint32 method_table_idx = 0xffffff;
+ if (m->method->klass->wastypebuilder) {
+ /* we use the same token as the one that was assigned
+ * to the Methodbuilder.
+ * FIXME: do the equivalent for Fields.
+ */
+ token = m->method->token;
+ } else {
+ /*
+ * Each token should have a unique index, but the indexes are
+ * assigned by managed code, so we don't know about them. An
+ * easy solution is to count backwards...
+ */
+ method_table_idx --;
+ token = MONO_TOKEN_METHOD_DEF | method_table_idx;
+ }
+ } else {
+ token = mono_image_get_methodref_token (assembly, m->method);
+ }
/*g_print ("got token 0x%08x for %s\n", token, m->method->name);*/
- return token;
- }
- if (strcmp (klass->name, "MonoField") == 0) {
+ } else if (strcmp (klass->name, "MonoField") == 0) {
MonoReflectionField *f = (MonoReflectionField *)obj;
- token = mono_image_get_fieldref_token (assembly, f->field, f->klass);
+ if ((f->klass->image == &assembly->image) && !f->field->generic_info) {
+ static guint32 field_table_idx = 0xffffff;
+ field_table_idx --;
+ token = MONO_TOKEN_FIELD_DEF | field_table_idx;
+ } else {
+ token = mono_image_get_fieldref_token (assembly, f);
+ }
/*g_print ("got token 0x%08x for %s\n", token, f->field->name);*/
- return token;
- }
- if (strcmp (klass->name, "MonoArrayMethod") == 0) {
+ } else if (strcmp (klass->name, "MonoArrayMethod") == 0) {
MonoReflectionArrayMethod *m = (MonoReflectionArrayMethod *)obj;
token = mono_image_get_array_token (assembly, m);
- return token;
+ } else if (strcmp (klass->name, "SignatureHelper") == 0) {
+ MonoReflectionSigHelper *s = (MonoReflectionSigHelper*)obj;
+ token = MONO_TOKEN_SIGNATURE | mono_image_get_sighelper_token (assembly, s);
+ } else {
+ g_error ("requested token for %s\n", klass->name);
}
- g_print ("requested token for %s\n", klass->name);
- return 0;
+
+ mono_g_hash_table_insert (assembly->tokens, GUINT_TO_POINTER (token), obj);
+
+ return token;
}
typedef struct {
@@ -2178,8 +4186,77 @@ typedef struct {
guint32 flags;
} MonoILT;
+static void register_assembly (MonoDomain *domain, MonoReflectionAssembly *res, MonoAssembly *assembly);
+
+static MonoDynamicImage*
+create_dynamic_mono_image (MonoDynamicAssembly *assembly, char *assembly_name, char *module_name)
+{
+ static const guchar entrycode [16] = {0xff, 0x25, 0};
+ MonoDynamicImage *image;
+ int i;
+
+ const char *version = mono_get_runtime_version ();
+
+#if HAVE_BOEHM_GC
+ image = GC_MALLOC (sizeof (MonoDynamicImage));
+#else
+ image = g_new0 (MonoDynamicImage, 1);
+#endif
+
+ /* keep in sync with image.c */
+ image->image.name = assembly_name;
+ image->image.assembly_name = image->image.name; /* they may be different */
+ image->image.module_name = module_name;
+ image->image.version = g_strdup (version);
+ image->image.dynamic = TRUE;
+
+ image->image.references = g_new0 (MonoAssembly*, 1);
+ image->image.references [0] = NULL;
+
+ mono_image_init (&image->image);
+
+ image->token_fixups = mono_g_hash_table_new (NULL, NULL);
+ image->method_to_table_idx = mono_g_hash_table_new (NULL, NULL);
+ image->field_to_table_idx = mono_g_hash_table_new (NULL, NULL);
+ image->method_aux_hash = mono_g_hash_table_new (NULL, NULL);
+ image->handleref = g_hash_table_new (NULL, NULL);
+ image->tokens = mono_g_hash_table_new (NULL, NULL);
+ image->typespec = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
+ image->typeref = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
+ image->blob_cache = mono_g_hash_table_new ((GHashFunc)mono_blob_entry_hash, (GCompareFunc)mono_blob_entry_equal);
+ image->gen_params = g_ptr_array_new ();
+
+ string_heap_init (&image->sheap);
+ mono_image_add_stream_data (&image->us, "", 1);
+ add_to_blob_cached (image, (char*) "", 1, NULL, 0);
+ /* import tables... */
+ mono_image_add_stream_data (&image->code, entrycode, sizeof (entrycode));
+ image->iat_offset = mono_image_add_stream_zero (&image->code, 8); /* two IAT entries */
+ image->idt_offset = mono_image_add_stream_zero (&image->code, 2 * sizeof (MonoIDT)); /* two IDT entries */
+ image->imp_names_offset = mono_image_add_stream_zero (&image->code, 2); /* flags for name entry */
+ mono_image_add_stream_data (&image->code, "_CorExeMain", 12);
+ mono_image_add_stream_data (&image->code, "mscoree.dll", 12);
+ image->ilt_offset = mono_image_add_stream_zero (&image->code, 8); /* two ILT entries */
+ stream_data_align (&image->code);
+
+ image->cli_header_offset = mono_image_add_stream_zero (&image->code, sizeof (MonoCLIHeader));
+
+ for (i=0; i < 64; ++i) {
+ image->tables [i].next_idx = 1;
+ image->tables [i].columns = table_sizes [i];
+ }
+
+ image->image.assembly = (MonoAssembly*)assembly;
+ image->run = assembly->run;
+ image->save = assembly->save;
+ image->pe_kind = 0x1; /* ILOnly */
+ image->machine = 0x14c; /* I386 */
+
+ return image;
+}
+
/*
- * mono_image_basic_ini:
+ * mono_image_basic_init:
* @assembly: an assembly builder object
*
* Create the MonoImage that represents the assembly builder and setup some
@@ -2188,61 +4265,42 @@ typedef struct {
void
mono_image_basic_init (MonoReflectionAssemblyBuilder *assemblyb)
{
- static const guchar entrycode [16] = {0xff, 0x25, 0};
MonoDynamicAssembly *assembly;
- MonoImage *image;
- int i;
+ MonoDynamicImage *image;
+ MONO_ARCH_SAVE_REGS;
+
if (assemblyb->dynamic_assembly)
return;
#if HAVE_BOEHM_GC
- assembly = assemblyb->dynamic_assembly = GC_malloc (sizeof (MonoDynamicAssembly));
+ assembly = assemblyb->dynamic_assembly = GC_MALLOC (sizeof (MonoDynamicAssembly));
#else
- assembly = assemblyb->dynamic_assembly = g_new0 (MonoDynamicAssembly, 1);
+ assembly = assemblyb->dynamic_assembly = g_new0 (MonoDynamicImage, 1);
#endif
- assembly->token_fixups = mono_g_hash_table_new (g_direct_hash, g_direct_equal);
- assembly->handleref = g_hash_table_new (g_direct_hash, g_direct_equal);
- assembly->typeref = g_hash_table_new ((GHashFunc)mono_metadata_type_hash, (GCompareFunc)mono_metadata_type_equal);
-
- string_heap_init (&assembly->sheap);
- mono_image_add_stream_data (&assembly->us, "", 1);
- mono_image_add_stream_data (&assembly->blob, "", 1);
- /* import tables... */
- mono_image_add_stream_data (&assembly->code, entrycode, sizeof (entrycode));
- assembly->iat_offset = mono_image_add_stream_zero (&assembly->code, 8); /* two IAT entries */
- assembly->idt_offset = mono_image_add_stream_zero (&assembly->code, 2 * sizeof (MonoIDT)); /* two IDT entries */
- mono_image_add_stream_zero (&assembly->code, 2); /* flags for name entry */
- assembly->imp_names_offset = mono_image_add_stream_data (&assembly->code, "_CorExeMain", 12);
- mono_image_add_stream_data (&assembly->code, "mscoree.dll", 12);
- assembly->ilt_offset = mono_image_add_stream_zero (&assembly->code, 8); /* two ILT entries */
- stream_data_align (&assembly->code);
-
- assembly->cli_header_offset = mono_image_add_stream_zero (&assembly->code, sizeof (MonoCLIHeader));
-
- for (i=0; i < 64; ++i) {
- assembly->tables [i].next_idx = 1;
- assembly->tables [i].columns = table_sizes [i];
- }
+ assembly->assembly.dynamic = TRUE;
+ assemblyb->assembly.assembly = (MonoAssembly*)assembly;
+ assembly->assembly.basedir = mono_string_to_utf8 (assemblyb->dir);
+ if (assemblyb->culture)
+ assembly->assembly.aname.culture = mono_string_to_utf8 (assemblyb->culture);
+ else
+ assembly->assembly.aname.culture = g_strdup ("");
- image = g_new0 (MonoImage, 1);
-
- /* keep in sync with image.c */
- image->name = mono_string_to_utf8 (assemblyb->name);
- image->assembly_name = image->name; /* they may be different */
+ assembly->run = assemblyb->access != 2;
+ assembly->save = assemblyb->access != 1;
- image->method_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
- image->class_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
- image->name_cache = g_hash_table_new (g_str_hash, g_str_equal);
- image->array_cache = g_hash_table_new (g_direct_hash, g_direct_equal);
+ image = create_dynamic_mono_image (assembly, mono_string_to_utf8 (assemblyb->name), g_strdup ("RefEmit_YouForgotToDefineAModule"));
+ image->initial_image = TRUE;
+ assembly->assembly.aname.name = image->image.name;
+ assembly->assembly.image = &image->image;
- assembly->assembly.image = image;
-
+ register_assembly (mono_object_domain (assemblyb), &assemblyb->assembly, &assembly->assembly);
+ mono_assembly_invoke_load_hook ((MonoAssembly*)assembly);
}
static int
-calc_section_size (MonoDynamicAssembly *assembly)
+calc_section_size (MonoDynamicImage *assembly)
{
int nsections = 0;
@@ -2251,11 +4309,21 @@ calc_section_size (MonoDynamicAssembly *assembly)
assembly->code.index &= ~3;
assembly->meta_size += 3;
assembly->meta_size &= ~3;
+ assembly->resources.index += 3;
+ assembly->resources.index &= ~3;
- assembly->sections [MONO_SECTION_TEXT].size = assembly->meta_size + assembly->code.index;
+ assembly->sections [MONO_SECTION_TEXT].size = assembly->meta_size + assembly->code.index + assembly->resources.index + assembly->strong_name_size;
assembly->sections [MONO_SECTION_TEXT].attrs = SECT_FLAGS_HAS_CODE | SECT_FLAGS_MEM_EXECUTE | SECT_FLAGS_MEM_READ;
nsections++;
+ if (assembly->win32_res) {
+ guint32 res_size = (assembly->win32_res_size + 3) & ~3;
+
+ assembly->sections [MONO_SECTION_RSRC].size = res_size;
+ assembly->sections [MONO_SECTION_RSRC].attrs = SECT_FLAGS_HAS_INITIALIZED_DATA | SECT_FLAGS_MEM_READ;
+ nsections++;
+ }
+
assembly->sections [MONO_SECTION_RELOC].size = 12;
assembly->sections [MONO_SECTION_RELOC].attrs = SECT_FLAGS_MEM_READ | SECT_FLAGS_MEM_DISCARDABLE | SECT_FLAGS_HAS_INITIALIZED_DATA;
nsections++;
@@ -2263,28 +4331,249 @@ calc_section_size (MonoDynamicAssembly *assembly)
return nsections;
}
+typedef struct {
+ guint32 id;
+ guint32 offset;
+ GSList *children;
+ MonoReflectionWin32Resource *win32_res; /* Only for leaf nodes */
+} ResTreeNode;
+
+static int
+resource_tree_compare_by_id (gconstpointer a, gconstpointer b)
+{
+ ResTreeNode *t1 = (ResTreeNode*)a;
+ ResTreeNode *t2 = (ResTreeNode*)b;
+
+ return t1->id - t2->id;
+}
+
+/*
+ * resource_tree_create:
+ *
+ * Organize the resources into a resource tree.
+ */
+static ResTreeNode *
+resource_tree_create (MonoArray *win32_resources)
+{
+ ResTreeNode *tree, *res_node, *type_node, *lang_node;
+ GSList *l;
+ int i;
+
+ tree = g_new0 (ResTreeNode, 1);
+
+ for (i = 0; i < mono_array_length (win32_resources); ++i) {
+ MonoReflectionWin32Resource *win32_res =
+ (MonoReflectionWin32Resource*)mono_array_addr (win32_resources, MonoReflectionWin32Resource, i);
+
+ /* Create node */
+
+ lang_node = g_new0 (ResTreeNode, 1);
+ lang_node->id = win32_res->lang_id;
+ lang_node->win32_res = win32_res;
+
+ /* Create type node if neccesary */
+ type_node = NULL;
+ for (l = tree->children; l; l = l->next)
+ if (((ResTreeNode*)(l->data))->id == win32_res->res_type) {
+ type_node = (ResTreeNode*)l->data;
+ break;
+ }
+
+ if (!type_node) {
+ type_node = g_new0 (ResTreeNode, 1);
+ type_node->id = win32_res->res_type;
+
+ /*
+ * The resource types have to be sorted otherwise
+ * Windows Explorer can't display the version information.
+ */
+ tree->children = g_slist_insert_sorted (tree->children,
+ type_node, resource_tree_compare_by_id);
+ }
+
+ /* Create res node if neccesary */
+ res_node = NULL;
+ for (l = type_node->children; l; l = l->next)
+ if (((ResTreeNode*)(l->data))->id == win32_res->res_id) {
+ res_node = (ResTreeNode*)l->data;
+ break;
+ }
+
+ if (!res_node) {
+ res_node = g_new0 (ResTreeNode, 1);
+ res_node->id = win32_res->res_id;
+ type_node->children = g_slist_append (type_node->children, res_node);
+ }
+
+ res_node->children = g_slist_append (res_node->children, lang_node);
+ }
+
+ return tree;
+}
+
+/*
+ * resource_tree_encode:
+ *
+ * Encode the resource tree into the format used in the PE file.
+ */
+static void
+resource_tree_encode (ResTreeNode *node, char *begin, char *p, char **endbuf)
+{
+ char *entries;
+ MonoPEResourceDir dir;
+ MonoPEResourceDirEntry dir_entry;
+ MonoPEResourceDataEntry data_entry;
+ GSList *l;
+
+ /*
+ * For the format of the resource directory, see the article
+ * "An In-Depth Look into the Win32 Portable Executable File Format" by
+ * Matt Pietrek
+ */
+
+ memset (&dir, 0, sizeof (dir));
+ memset (&dir_entry, 0, sizeof (dir_entry));
+ memset (&data_entry, 0, sizeof (data_entry));
+
+ g_assert (sizeof (dir) == 16);
+ g_assert (sizeof (dir_entry) == 8);
+ g_assert (sizeof (data_entry) == 16);
+
+ node->offset = p - begin;
+
+ /* IMAGE_RESOURCE_DIRECTORY */
+ dir.res_id_entries = GUINT32_TO_LE (g_slist_length (node->children));
+
+ memcpy (p, &dir, sizeof (dir));
+ p += sizeof (dir);
+
+ /* Reserve space for entries */
+ entries = p;
+ p += sizeof (dir_entry) * dir.res_id_entries;
+
+ /* Write children */
+ for (l = node->children; l; l = l->next) {
+ ResTreeNode *child = (ResTreeNode*)l->data;
+
+ if (child->win32_res) {
+
+ child->offset = p - begin;
+
+ /* IMAGE_RESOURCE_DATA_ENTRY */
+ data_entry.rde_data_offset = GUINT32_TO_LE (p - begin + sizeof (data_entry));
+ data_entry.rde_size = mono_array_length (child->win32_res->res_data);
+
+ memcpy (p, &data_entry, sizeof (data_entry));
+ p += sizeof (data_entry);
+
+ memcpy (p, mono_array_addr (child->win32_res->res_data, char, 0), data_entry.rde_size);
+ p += data_entry.rde_size;
+ } else {
+ resource_tree_encode (child, begin, p, &p);
+ }
+ }
+
+ /* IMAGE_RESOURCE_ENTRY */
+ for (l = node->children; l; l = l->next) {
+ ResTreeNode *child = (ResTreeNode*)l->data;
+ dir_entry.name_offset = GUINT32_TO_LE (child->id);
+
+ dir_entry.is_dir = child->win32_res ? 0 : 1;
+ dir_entry.dir_offset = GUINT32_TO_LE (child->offset);
+
+ memcpy (entries, &dir_entry, sizeof (dir_entry));
+ entries += sizeof (dir_entry);
+ }
+
+ *endbuf = p;
+}
+
+static void
+assembly_add_win32_resources (MonoDynamicImage *assembly, MonoReflectionAssemblyBuilder *assemblyb)
+{
+ char *buf;
+ char *p;
+ guint32 size, i;
+ MonoReflectionWin32Resource *win32_res;
+ ResTreeNode *tree;
+
+ if (!assemblyb->win32_resources)
+ return;
+
+ /*
+ * Resources are stored in a three level tree inside the PE file.
+ * - level one contains a node for each type of resource
+ * - level two contains a node for each resource
+ * - level three contains a node for each instance of a resource for a
+ * specific language.
+ */
+
+ tree = resource_tree_create (assemblyb->win32_resources);
+
+ /* Estimate the size of the encoded tree */
+ size = 0;
+ for (i = 0; i < mono_array_length (assemblyb->win32_resources); ++i) {
+ win32_res = (MonoReflectionWin32Resource*)mono_array_addr (assemblyb->win32_resources, MonoReflectionWin32Resource, i);
+ size += mono_array_length (win32_res->res_data);
+ }
+ /* Directory structure */
+ size += mono_array_length (assemblyb->win32_resources) * 256;
+ p = buf = g_malloc (size);
+
+ resource_tree_encode (tree, p, p, &p);
+
+ g_assert (p - buf < size);
+
+ assembly->win32_res = g_malloc (p - buf);
+ assembly->win32_res_size = p - buf;
+ memcpy (assembly->win32_res, buf, p - buf);
+
+ g_free (buf);
+}
+
+static void
+fixup_resource_directory (char *res_section, char *p, guint32 rva)
+{
+ MonoPEResourceDir *dir = (MonoPEResourceDir*)p;
+ int i;
+
+ p += sizeof (MonoPEResourceDir);
+ for (i = 0; i < dir->res_named_entries + dir->res_id_entries; ++i) {
+ MonoPEResourceDirEntry *dir_entry = (MonoPEResourceDirEntry*)p;
+ char *child = res_section + (GUINT32_FROM_LE (dir_entry->dir_offset));
+ if (dir_entry->is_dir) {
+ fixup_resource_directory (res_section, child, rva);
+ } else {
+ MonoPEResourceDataEntry *data_entry = (MonoPEResourceDataEntry*)child;
+ data_entry->rde_data_offset = GUINT32_TO_LE (GUINT32_FROM_LE (data_entry->rde_data_offset) + rva);
+ }
+
+ p += sizeof (MonoPEResourceDirEntry);
+ }
+}
+
/*
* mono_image_create_pefile:
- * @assemblyb: an assembly builder object
+ * @mb: a module builder object
*
- * When we need to save an assembly, we first call this function that ensures the metadata
- * tables are built for all the modules in the assembly. This function creates the PE-COFF
- * header, the image sections, the CLI header etc. all the data is written in
+ * This function creates the PE-COFF header, the image sections, the CLI header * etc. all the data is written in
* assembly->pefile where it can be easily retrieved later in chunks.
*/
void
-mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
+mono_image_create_pefile (MonoReflectionModuleBuilder *mb) {
MonoMSDOSHeader *msdos;
MonoDotNetHeader *header;
MonoSectionTable *section;
MonoCLIHeader *cli_header;
- guint32 size, image_size, virtual_base;
+ guint32 size, image_size, virtual_base, text_offset;
guint32 header_start, section_start, file_offset, virtual_offset;
- MonoDynamicAssembly *assembly;
+ MonoDynamicImage *assembly;
+ MonoReflectionAssemblyBuilder *assemblyb;
MonoDynamicStream *pefile;
int i, nsections;
- guint32 *rva;
+ guint32 *rva, value;
guint16 *data16;
+ guchar *p;
static const unsigned char msheader[] = {
0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -2296,14 +4585,39 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x0d, 0x0d, 0x0a, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
+ assemblyb = mb->assemblyb;
+
mono_image_basic_init (assemblyb);
- assembly = assemblyb->dynamic_assembly;
+ assembly = mb->dynamic_image;
+
+ assembly->pe_kind = assemblyb->pe_kind;
+ assembly->machine = assemblyb->machine;
+ ((MonoDynamicImage*)assemblyb->dynamic_assembly->assembly.image)->pe_kind = assemblyb->pe_kind;
+ ((MonoDynamicImage*)assemblyb->dynamic_assembly->assembly.image)->machine = assemblyb->machine;
/* already created */
if (assembly->pefile.index)
return;
- mono_image_build_metadata (assemblyb);
+ mono_image_build_metadata (mb);
+
+ if (mb->is_main && assemblyb->resources) {
+ int len = mono_array_length (assemblyb->resources);
+ for (i = 0; i < len; ++i)
+ assembly_add_resource (mb, assembly, (MonoReflectionResource*)mono_array_addr (assemblyb->resources, MonoReflectionResource, i));
+ }
+
+ if (mb->resources) {
+ int len = mono_array_length (mb->resources);
+ for (i = 0; i < len; ++i)
+ assembly_add_resource (mb, assembly, (MonoReflectionResource*)mono_array_addr (mb->resources, MonoReflectionResource, i));
+ }
+
+ build_compressed_metadata (assembly);
+
+ if (mb->is_main)
+ assembly_add_win32_resources (assembly, assemblyb);
+
nsections = calc_section_size (assembly);
pefile = &assembly->pefile;
@@ -2355,14 +4669,17 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
header->pesig [0] = 'P';
header->pesig [1] = 'E';
- header->coff.coff_machine = GUINT16_FROM_LE (0x14c);
+ header->coff.coff_machine = GUINT16_FROM_LE (assemblyb->machine);
header->coff.coff_sections = GUINT16_FROM_LE (nsections);
header->coff.coff_time = GUINT32_FROM_LE (time (NULL));
header->coff.coff_opt_header_size = GUINT16_FROM_LE (sizeof (MonoDotNetHeader) - sizeof (MonoCOFFHeader) - 4);
- /* it's an exe */
- header->coff.coff_attributes = GUINT16_FROM_LE (0x010e);
- /* FIXME: it's a dll */
- /*header->coff.coff_attributes = GUINT16_FROM_LE (0x210e); */
+ if (assemblyb->pekind == 1) {
+ /* it's a dll */
+ header->coff.coff_attributes = GUINT16_FROM_LE (0x210e);
+ } else {
+ /* it's an exe */
+ header->coff.coff_attributes = GUINT16_FROM_LE (0x010e);
+ }
virtual_base = 0x400000; /* FIXME: 0x10000000 if a DLL */
@@ -2372,16 +4689,16 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
size = assembly->sections [MONO_SECTION_TEXT].size;
size += FILE_ALIGN - 1;
size &= ~(FILE_ALIGN - 1);
- header->pe.pe_code_size = size;
+ header->pe.pe_code_size = GUINT32_FROM_LE(size);
size = assembly->sections [MONO_SECTION_RSRC].size;
size += FILE_ALIGN - 1;
size &= ~(FILE_ALIGN - 1);
- header->pe.pe_data_size = size;
+ header->pe.pe_data_size = GUINT32_FROM_LE(size);
g_assert (START_TEXT_RVA == assembly->sections [MONO_SECTION_TEXT].rva);
- header->pe.pe_rva_code_base = assembly->sections [MONO_SECTION_TEXT].rva;
- header->pe.pe_rva_data_base = assembly->sections [MONO_SECTION_RSRC].rva;
+ header->pe.pe_rva_code_base = GUINT32_FROM_LE (assembly->sections [MONO_SECTION_TEXT].rva);
+ header->pe.pe_rva_data_base = GUINT32_FROM_LE (assembly->sections [MONO_SECTION_RSRC].rva);
/* pe_rva_entry_point always at the beginning of the text section */
- header->pe.pe_rva_entry_point = assembly->sections [MONO_SECTION_TEXT].rva;
+ header->pe.pe_rva_entry_point = GUINT32_FROM_LE (assembly->sections [MONO_SECTION_TEXT].rva);
header->nt.pe_image_base = GUINT32_FROM_LE (virtual_base);
header->nt.pe_section_align = GUINT32_FROM_LE (VIRT_ALIGN);
@@ -2397,7 +4714,29 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
size += VIRT_ALIGN - 1;
size &= ~(VIRT_ALIGN - 1);
header->nt.pe_image_size = GUINT32_FROM_LE (size);
- header->nt.pe_subsys_required = GUINT16_FROM_LE (3); /* 3 -> cmdline app, 2 -> GUI app */
+
+ /*
+ // Translate the PEFileKind value to the value expected by the Windows loader
+ */
+ {
+ short kind;
+
+ /*
+ // PEFileKinds.Dll == 1
+ // PEFileKinds.ConsoleApplication == 2
+ // PEFileKinds.WindowApplication == 3
+ //
+ // need to get:
+ // IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows GUI subsystem.
+ // IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows character subsystem.
+ */
+ if (assemblyb->pekind == 3)
+ kind = 2;
+ else
+ kind = 3;
+
+ header->nt.pe_subsys_required = GUINT16_FROM_LE (kind);
+ }
header->nt.pe_stack_reserve = GUINT32_FROM_LE (0x00100000);
header->nt.pe_stack_commit = GUINT32_FROM_LE (0x00001000);
header->nt.pe_heap_reserve = GUINT32_FROM_LE (0x00100000);
@@ -2417,6 +4756,11 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
header->datadir.pe_cli_header.rva = GUINT32_FROM_LE (assembly->text_rva + assembly->cli_header_offset);
header->datadir.pe_iat.size = GUINT32_FROM_LE (8);
header->datadir.pe_iat.rva = GUINT32_FROM_LE (assembly->text_rva + assembly->iat_offset);
+ /* patch entrypoint name */
+ if (assemblyb->pekind == 1)
+ memcpy (assembly->code.data + assembly->imp_names_offset + 2, "_CorDllMain", 12);
+ else
+ memcpy (assembly->code.data + assembly->imp_names_offset + 2, "_CorExeMain", 12);
/* patch imported function RVA name */
rva = (guint32*)(assembly->code.data + assembly->iat_offset);
*rva = GUINT32_FROM_LE (assembly->text_rva + assembly->imp_names_offset);
@@ -2426,26 +4770,49 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
header->datadir.pe_import_table.rva = GUINT32_FROM_LE (assembly->text_rva + assembly->idt_offset);
/* patch imported dll RVA name and other entries in the dir */
rva = (guint32*)(assembly->code.data + assembly->idt_offset + G_STRUCT_OFFSET (MonoIDT, name_rva));
- *rva = GUINT32_FROM_LE (assembly->text_rva + assembly->imp_names_offset + 12); /* 12 is strlen+1 of func name */
+ *rva = GUINT32_FROM_LE (assembly->text_rva + assembly->imp_names_offset + 14); /* 14 is hint+strlen+1 of func name */
rva = (guint32*)(assembly->code.data + assembly->idt_offset + G_STRUCT_OFFSET (MonoIDT, import_address_table_rva));
*rva = GUINT32_FROM_LE (assembly->text_rva + assembly->iat_offset);
rva = (guint32*)(assembly->code.data + assembly->idt_offset + G_STRUCT_OFFSET (MonoIDT, import_lookup_table));
*rva = GUINT32_FROM_LE (assembly->text_rva + assembly->ilt_offset);
- rva = (guint32*)(assembly->code.data + assembly->ilt_offset);
- *rva = GUINT32_FROM_LE (assembly->text_rva + assembly->imp_names_offset - 2);
+ p = (assembly->code.data + assembly->ilt_offset);
+ value = (assembly->text_rva + assembly->imp_names_offset);
+ *p++ = (value) & 0xff;
+ *p++ = (value >> 8) & (0xff);
+ *p++ = (value >> 16) & (0xff);
+ *p++ = (value >> 24) & (0xff);
/* the CLI header info */
cli_header = (MonoCLIHeader*)(assembly->code.data + assembly->cli_header_offset);
cli_header->ch_size = GUINT32_FROM_LE (72);
cli_header->ch_runtime_major = GUINT16_FROM_LE (2);
- cli_header->ch_flags = GUINT32_FROM_LE (CLI_FLAGS_ILONLY);
- if (assemblyb->entry_point)
- cli_header->ch_entry_point = GUINT32_FROM_LE (assemblyb->entry_point->table_idx | MONO_TOKEN_METHOD_DEF);
- else
+ cli_header->ch_flags = GUINT32_FROM_LE (assemblyb->pe_kind);
+ if (assemblyb->entry_point) {
+ guint32 table_idx = 0;
+ if (!strcmp (assemblyb->entry_point->object.vtable->klass->name, "MethodBuilder")) {
+ MonoReflectionMethodBuilder *methodb = (MonoReflectionMethodBuilder*)assemblyb->entry_point;
+ table_idx = methodb->table_idx;
+ } else {
+ table_idx = GPOINTER_TO_UINT (mono_g_hash_table_lookup (assembly->method_to_table_idx, assemblyb->entry_point->method));
+ }
+ cli_header->ch_entry_point = GUINT32_FROM_LE (table_idx | MONO_TOKEN_METHOD_DEF);
+ } else {
cli_header->ch_entry_point = GUINT32_FROM_LE (0);
- cli_header->ch_metadata.rva = GUINT32_FROM_LE (assembly->text_rva + assembly->code.index);
+ }
+ /* The embedded managed resources */
+ text_offset = assembly->text_rva + assembly->code.index;
+ cli_header->ch_resources.rva = GUINT32_FROM_LE (text_offset);
+ cli_header->ch_resources.size = GUINT32_FROM_LE (assembly->resources.index);
+ text_offset += assembly->resources.index;
+ cli_header->ch_metadata.rva = GUINT32_FROM_LE (text_offset);
cli_header->ch_metadata.size = GUINT32_FROM_LE (assembly->meta_size);
+ text_offset += assembly->meta_size;
+ if (assembly->strong_name_size) {
+ cli_header->ch_strong_name.rva = GUINT32_FROM_LE (text_offset);
+ cli_header->ch_strong_name.size = GUINT32_FROM_LE (assembly->strong_name_size);
+ text_offset += assembly->strong_name_size;
+ }
/* write the section tables and section content */
section = (MonoSectionTable*)(pefile->data + section_start);
@@ -2466,10 +4833,23 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
switch (i) {
case MONO_SECTION_TEXT:
/* patch entry point */
- rva = (guint32*)(assembly->code.data + 2);
- *rva = GUINT32_FROM_LE (virtual_base + assembly->text_rva + assembly->iat_offset);
- memcpy (pefile->data + assembly->sections [i].offset, assembly->code.data, assembly->code.index);
- memcpy (pefile->data + assembly->sections [i].offset + assembly->code.index, assembly->assembly.image->raw_metadata, assembly->meta_size);
+ p = (assembly->code.data + 2);
+ value = (virtual_base + assembly->text_rva + assembly->iat_offset);
+ *p++ = (value) & 0xff;
+ *p++ = (value >> 8) & 0xff;
+ *p++ = (value >> 16) & 0xff;
+ *p++ = (value >> 24) & 0xff;
+
+ text_offset = assembly->sections [i].offset;
+ memcpy (pefile->data + text_offset, assembly->code.data, assembly->code.index);
+ text_offset += assembly->code.index;
+ memcpy (pefile->data + text_offset, assembly->resources.data, assembly->resources.index);
+ text_offset += assembly->resources.index;
+ memcpy (pefile->data + text_offset, assembly->image.raw_metadata, assembly->meta_size);
+ text_offset += assembly->meta_size;
+ memcpy (pefile->data + text_offset, assembly->strong_name, assembly->strong_name_size);
+
+ g_free (assembly->image.raw_metadata);
break;
case MONO_SECTION_RELOC:
rva = (guint32*)(pefile->data + assembly->sections [i].offset);
@@ -2488,6 +4868,15 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
*data16 = 0; /* terminate */
break;
case MONO_SECTION_RSRC:
+ if (assembly->win32_res) {
+ text_offset = assembly->sections [i].offset;
+
+ /* Fixup the offsets in the IMAGE_RESOURCE_DATA_ENTRY structures */
+ fixup_resource_directory (assembly->win32_res, assembly->win32_res, assembly->sections [i].rva);
+
+ memcpy (pefile->data + text_offset, assembly->win32_res, assembly->win32_res_size);
+ }
+ break;
default:
g_assert_not_reached ();
}
@@ -2504,27 +4893,145 @@ mono_image_create_pefile (MonoReflectionAssemblyBuilder *assemblyb) {
#endif
}
+MonoReflectionModule *
+mono_image_load_module (MonoReflectionAssemblyBuilder *ab, MonoString *fileName)
+{
+ char *name;
+ MonoImage *image;
+ MonoImageOpenStatus status;
+ MonoDynamicAssembly *assembly;
+ guint32 module_count;
+ MonoImage **new_modules;
+
+ name = mono_string_to_utf8 (fileName);
+
+ image = mono_image_open (name, &status);
+ if (status) {
+ MonoException *exc;
+ if (status == MONO_IMAGE_ERROR_ERRNO)
+ exc = mono_get_exception_file_not_found (fileName);
+ else
+ exc = mono_get_exception_bad_image_format (name);
+ g_free (name);
+ mono_raise_exception (exc);
+ }
+
+ g_free (name);
+
+ assembly = ab->dynamic_assembly;
+ image->assembly = (MonoAssembly*)assembly;
+
+ module_count = image->assembly->image->module_count;
+ new_modules = g_new0 (MonoImage *, module_count + 1);
+
+ if (image->assembly->image->modules)
+ memcpy (new_modules, image->assembly->image->modules, module_count * sizeof (MonoImage *));
+ new_modules [module_count] = image;
+
+ g_free (image->assembly->image->modules);
+ image->assembly->image->modules = new_modules;
+ image->assembly->image->module_count ++;
+
+ mono_assembly_load_references (image, &status);
+ if (status) {
+ mono_image_close (image);
+ mono_raise_exception (mono_get_exception_file_not_found (fileName));
+ }
+
+ return mono_module_get_object (mono_domain_get (), image);
+}
+
/*
* We need to return always the same object for MethodInfo, FieldInfo etc..
+ * but we need to consider the reflected type.
* type uses a different hash, since it uses custom hash/equal functions.
*/
-static MonoGHashTable *object_cache = NULL;
-static MonoGHashTable *type_cache = NULL;
-#define CHECK_OBJECT(t,p) \
+typedef struct {
+ gpointer item;
+ MonoClass *refclass;
+} ReflectedEntry;
+
+static gboolean
+reflected_equal (gconstpointer a, gconstpointer b) {
+ const ReflectedEntry *ea = a;
+ const ReflectedEntry *eb = b;
+
+ return (ea->item == eb->item) && (ea->refclass == eb->refclass);
+}
+
+static guint
+reflected_hash (gconstpointer a) {
+ const ReflectedEntry *ea = a;
+ return GPOINTER_TO_UINT (ea->item);
+}
+
+#define CHECK_OBJECT(t,p,k) \
do { \
t _obj; \
- if (!object_cache) \
- object_cache = mono_g_hash_table_new (g_direct_hash, g_direct_equal); \
- if ((_obj = mono_g_hash_table_lookup (object_cache, (p)))) \
+ ReflectedEntry e; \
+ e.item = (p); \
+ e.refclass = (k); \
+ mono_domain_lock (domain); \
+ if (!domain->refobject_hash) \
+ domain->refobject_hash = mono_g_hash_table_new (reflected_hash, reflected_equal); \
+ if ((_obj = mono_g_hash_table_lookup (domain->refobject_hash, &e))) { \
+ mono_domain_unlock (domain); \
return _obj; \
+ } \
} while (0)
-#define CACHE_OBJECT(p,o) \
+#if HAVE_BOEHM_GC
+#define ALLOC_REFENTRY GC_MALLOC (sizeof (ReflectedEntry))
+#else
+#define ALLOC_REFENTRY mono_mempool_alloc (domain->mp, sizeof (ReflectedEntry))
+#endif
+
+#define CACHE_OBJECT(p,o,k) \
do { \
- mono_g_hash_table_insert (object_cache, p,o); \
+ ReflectedEntry *e = ALLOC_REFENTRY; \
+ e->item = (p); \
+ e->refclass = (k); \
+ mono_g_hash_table_insert (domain->refobject_hash, e,o); \
+ mono_domain_unlock (domain); \
} while (0)
+static void
+register_assembly (MonoDomain *domain, MonoReflectionAssembly *res, MonoAssembly *assembly)
+{
+ /* this is done only once */
+ mono_domain_lock (domain);
+ CACHE_OBJECT (assembly, res, NULL);
+}
+
+static void
+register_module (MonoDomain *domain, MonoReflectionModuleBuilder *res, MonoDynamicImage *module)
+{
+ /* this is done only once */
+ mono_domain_lock (domain);
+ CACHE_OBJECT (module, res, NULL);
+}
+
+void
+mono_image_module_basic_init (MonoReflectionModuleBuilder *moduleb)
+{
+ MonoDynamicImage *image = moduleb->dynamic_image;
+ MonoReflectionAssemblyBuilder *ab = moduleb->assemblyb;
+ if (!image) {
+ /*
+ * FIXME: we already created an image in mono_image_basic_init (), but
+ * we don't know which module it belongs to, since that is only
+ * determined at assembly save time.
+ */
+ /*image = (MonoDynamicImage*)ab->dynamic_assembly->assembly.image; */
+ image = create_dynamic_mono_image (ab->dynamic_assembly, mono_string_to_utf8 (ab->name), mono_string_to_utf8 (moduleb->module.fqname));
+
+ moduleb->module.image = &image->image;
+ moduleb->dynamic_image = image;
+ register_module (mono_object_domain (moduleb), moduleb, image);
+ }
+}
+
/*
* mono_assembly_get_object:
* @domain: an app domain
@@ -2538,13 +5045,98 @@ mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly)
static MonoClass *System_Reflection_Assembly;
MonoReflectionAssembly *res;
- CHECK_OBJECT (MonoReflectionAssembly *, assembly);
+ CHECK_OBJECT (MonoReflectionAssembly *, assembly, NULL);
if (!System_Reflection_Assembly)
System_Reflection_Assembly = mono_class_from_name (
mono_defaults.corlib, "System.Reflection", "Assembly");
res = (MonoReflectionAssembly *)mono_object_new (domain, System_Reflection_Assembly);
res->assembly = assembly;
- CACHE_OBJECT (assembly, res);
+ CACHE_OBJECT (assembly, res, NULL);
+ return res;
+}
+
+
+
+MonoReflectionModule*
+mono_module_get_object (MonoDomain *domain, MonoImage *image)
+{
+ static MonoClass *System_Reflection_Module;
+ MonoReflectionModule *res;
+ char* basename;
+
+ CHECK_OBJECT (MonoReflectionModule *, image, NULL);
+ if (!System_Reflection_Module)
+ System_Reflection_Module = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "Module");
+ res = (MonoReflectionModule *)mono_object_new (domain, System_Reflection_Module);
+
+ res->image = image;
+ res->assembly = (MonoReflectionAssembly *) mono_assembly_get_object(domain, image->assembly);
+
+ res->fqname = mono_string_new (domain, image->name);
+ res->name = mono_string_new (domain, basename = g_path_get_basename (image->name));
+ res->scopename = mono_string_new (domain, image->module_name);
+
+ g_free (basename);
+
+ if (image->assembly->image == image) {
+ res->token = mono_metadata_make_token (MONO_TABLE_MODULE, 1);
+ } else {
+ int i;
+ g_assert (image->assembly->image->modules);
+ res->token = 0;
+ for (i = 0; i < image->assembly->image->module_count; i++) {
+ if (image->assembly->image->modules [i] == image)
+ res->token = mono_metadata_make_token (MONO_TABLE_MODULEREF, i + 1);
+ }
+ g_assert (res->token);
+ }
+
+ mono_image_addref (image);
+
+ CACHE_OBJECT (image, res, NULL);
+ return res;
+}
+
+MonoReflectionModule*
+mono_module_file_get_object (MonoDomain *domain, MonoImage *image, int table_index)
+{
+ static MonoClass *System_Reflection_Module;
+ MonoReflectionModule *res;
+ MonoTableInfo *table;
+ guint32 cols [MONO_FILE_SIZE];
+ const char *name;
+ guint32 i, name_idx;
+ const char *val;
+
+ if (!System_Reflection_Module)
+ System_Reflection_Module = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "Module");
+ res = (MonoReflectionModule *)mono_object_new (domain, System_Reflection_Module);
+
+ table = &image->tables [MONO_TABLE_FILE];
+ g_assert (table_index < table->rows);
+ mono_metadata_decode_row (table, table_index, cols, MONO_FILE_SIZE);
+
+ res->image = 0;
+ res->assembly = (MonoReflectionAssembly *) mono_assembly_get_object(domain, image->assembly);
+ name = mono_metadata_string_heap (image, cols [MONO_FILE_NAME]);
+
+ /* Check whenever the row has a corresponding row in the moduleref table */
+ table = &image->tables [MONO_TABLE_MODULEREF];
+ for (i = 0; i < table->rows; ++i) {
+ name_idx = mono_metadata_decode_row_col (table, i, MONO_MODULEREF_NAME);
+ val = mono_metadata_string_heap (image, name_idx);
+ if (strcmp (val, name) == 0)
+ res->image = image->modules [i];
+ }
+
+ res->fqname = mono_string_new (domain, name);
+ res->name = mono_string_new (domain, name);
+ res->scopename = mono_string_new (domain, name);
+ res->is_resource = cols [MONO_FILE_FLAGS] && FILE_CONTAINS_NO_METADATA;
+ res->token = mono_metadata_make_token (MONO_TABLE_FILE, table_index + 1);
+
return res;
}
@@ -2573,17 +5165,33 @@ mymono_metadata_type_equal (MonoType *t1, MonoType *t2)
case MONO_TYPE_I:
case MONO_TYPE_U:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_TYPEDBYREF:
return TRUE;
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
return t1->data.klass == t2->data.klass;
case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
return mymono_metadata_type_equal (t1->data.type, t2->data.type);
case MONO_TYPE_ARRAY:
if (t1->data.array->rank != t2->data.array->rank)
return FALSE;
- return mymono_metadata_type_equal (t1->data.array->type, t2->data.array->type);
+ return t1->data.array->eklass == t2->data.array->eklass;
+ case MONO_TYPE_GENERICINST: {
+ int i;
+ if (t1->data.generic_inst->type_argc != t2->data.generic_inst->type_argc)
+ return FALSE;
+ if (!mono_metadata_type_equal (t1->data.generic_inst->generic_type, t2->data.generic_inst->generic_type))
+ return FALSE;
+ for (i = 0; i < t1->data.generic_inst->type_argc; ++i) {
+ if (!mono_metadata_type_equal (t1->data.generic_inst->type_argv [i], t2->data.generic_inst->type_argv [i]))
+ return FALSE;
+ }
+ return TRUE;
+ }
+ case MONO_TYPE_VAR:
+ case MONO_TYPE_MVAR:
+ return t1->data.generic_param == t2->data.generic_param;
default:
g_error ("implement type compare for %0x!", t1->type);
return FALSE;
@@ -2603,15 +5211,45 @@ mymono_metadata_type_hash (MonoType *t1)
switch (t1->type) {
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
/* check if the distribution is good enough */
- return hash << 7 | g_str_hash (t1->data.klass->name);
+ return ((hash << 5) - hash) ^ g_str_hash (t1->data.klass->name);
case MONO_TYPE_PTR:
- case MONO_TYPE_SZARRAY:
- return hash << 7 | mymono_metadata_type_hash (t1->data.type);
+ return ((hash << 5) - hash) ^ mymono_metadata_type_hash (t1->data.type);
}
return hash;
}
+static MonoReflectionGenericInst*
+mono_generic_inst_get_object (MonoDomain *domain, MonoType *geninst)
+{
+ static MonoClass *System_Reflection_MonoGenericInst;
+ MonoReflectionGenericInst *res;
+ MonoGenericInst *ginst;
+ MonoClass *gklass;
+
+ if (!System_Reflection_MonoGenericInst) {
+ System_Reflection_MonoGenericInst = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "MonoGenericInst");
+ g_assert (System_Reflection_MonoGenericInst);
+ }
+
+ ginst = geninst->data.generic_inst;
+ gklass = mono_class_from_mono_type (ginst->generic_type);
+
+ mono_class_init (ginst->klass);
+
+ res = (MonoReflectionGenericInst *) mono_object_new (domain, System_Reflection_MonoGenericInst);
+
+ res->type.type = geninst;
+ if (gklass->wastypebuilder && gklass->reflection_info)
+ res->generic_type = gklass->reflection_info;
+ else
+ res->generic_type = mono_type_get_object (domain, ginst->generic_type);
+
+ return res;
+}
+
/*
* mono_type_get_object:
* @domain: an app domain
@@ -2625,20 +5263,33 @@ mono_type_get_object (MonoDomain *domain, MonoType *type)
MonoReflectionType *res;
MonoClass *klass = mono_class_from_mono_type (type);
- if (!type_cache)
- type_cache = mono_g_hash_table_new ((GHashFunc)mymono_metadata_type_hash,
+ mono_domain_lock (domain);
+ if (!domain->type_hash)
+ domain->type_hash = mono_g_hash_table_new ((GHashFunc)mymono_metadata_type_hash,
(GCompareFunc)mymono_metadata_type_equal);
- if ((res = mono_g_hash_table_lookup (type_cache, type)))
+ if ((res = mono_g_hash_table_lookup (domain->type_hash, type))) {
+ mono_domain_unlock (domain);
return res;
- if (klass->reflection_info) {
+ }
+ if ((type->type == MONO_TYPE_GENERICINST) && type->data.generic_inst->is_dynamic) {
+ res = (MonoReflectionType *)mono_generic_inst_get_object (domain, type);
+ mono_g_hash_table_insert (domain->type_hash, type, res);
+ mono_domain_unlock (domain);
+ return res;
+ }
+ if (klass->reflection_info && !klass->wastypebuilder) {
+ /* g_assert_not_reached (); */
/* should this be considered an error condition? */
- if (!type->byref)
+ if (!type->byref) {
+ mono_domain_unlock (domain);
return klass->reflection_info;
+ }
}
mono_class_init (klass);
res = (MonoReflectionType *)mono_object_new (domain, mono_defaults.monotype_class);
res->type = type;
- mono_g_hash_table_insert (type_cache, type, res);
+ mono_g_hash_table_insert (domain->type_hash, type, res);
+ mono_domain_unlock (domain);
return res;
}
@@ -2646,11 +5297,12 @@ mono_type_get_object (MonoDomain *domain, MonoType *type)
* mono_method_get_object:
* @domain: an app domain
* @method: a method
+ * @refclass: the reflected type (can be NULL)
*
* Return an System.Reflection.MonoMethod object representing the method @method.
*/
MonoReflectionMethod*
-mono_method_get_object (MonoDomain *domain, MonoMethod *method)
+mono_method_get_object (MonoDomain *domain, MonoMethod *method, MonoClass *refclass)
{
/*
* We use the same C representation for methods and constructors, but the type
@@ -2660,7 +5312,10 @@ mono_method_get_object (MonoDomain *domain, MonoMethod *method)
MonoClass *klass;
MonoReflectionMethod *ret;
- CHECK_OBJECT (MonoReflectionMethod *, method);
+ if (!refclass)
+ refclass = method->klass;
+
+ CHECK_OBJECT (MonoReflectionMethod *, method, refclass);
if (*method->name == '.' && (strcmp (method->name, ".ctor") == 0 || strcmp (method->name, ".cctor") == 0))
cname = "MonoCMethod";
else
@@ -2670,7 +5325,8 @@ mono_method_get_object (MonoDomain *domain, MonoMethod *method)
ret = (MonoReflectionMethod*)mono_object_new (domain, klass);
ret->method = method;
ret->name = mono_string_new (domain, method->name);
- CACHE_OBJECT (method, ret);
+ ret->reftype = mono_type_get_object (domain, &refclass->byval_arg);
+ CACHE_OBJECT (method, ret, refclass);
return ret;
}
@@ -2689,12 +5345,18 @@ mono_field_get_object (MonoDomain *domain, MonoClass *klass, MonoClassField *fie
MonoReflectionField *res;
MonoClass *oklass;
- CHECK_OBJECT (MonoReflectionField *, field);
+ CHECK_OBJECT (MonoReflectionField *, field, klass);
oklass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoField");
res = (MonoReflectionField *)mono_object_new (domain, oklass);
res->klass = klass;
res->field = field;
- CACHE_OBJECT (field, res);
+ res->name = mono_string_new (domain, field->name);
+ if (field->generic_info)
+ res->attrs = field->generic_info->generic_type->attrs;
+ else
+ res->attrs = field->type->attrs;
+ res->type = mono_type_get_object (domain, field->type);
+ CACHE_OBJECT (field, res, klass);
return res;
}
@@ -2713,12 +5375,12 @@ mono_property_get_object (MonoDomain *domain, MonoClass *klass, MonoProperty *pr
MonoReflectionProperty *res;
MonoClass *oklass;
- CHECK_OBJECT (MonoReflectionProperty *, property);
+ CHECK_OBJECT (MonoReflectionProperty *, property, klass);
oklass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoProperty");
res = (MonoReflectionProperty *)mono_object_new (domain, oklass);
res->klass = klass;
res->property = property;
- CACHE_OBJECT (property, res);
+ CACHE_OBJECT (property, res, klass);
return res;
}
@@ -2737,12 +5399,12 @@ mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event)
MonoReflectionEvent *res;
MonoClass *oklass;
- CHECK_OBJECT (MonoReflectionEvent *, event);
+ CHECK_OBJECT (MonoReflectionEvent *, event, klass);
oklass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MonoEvent");
res = (MonoReflectionEvent *)mono_object_new (domain, oklass);
res->klass = klass;
res->event = event;
- CACHE_OBJECT (event, res);
+ CACHE_OBJECT (event, res, klass);
return res;
}
@@ -2754,47 +5416,327 @@ mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event)
* Return an System.Reflection.ParameterInfo array object representing the parameters
* in the method @method.
*/
-MonoReflectionParameter**
+MonoArray*
mono_param_get_objects (MonoDomain *domain, MonoMethod *method)
{
- MonoReflectionParameter **res;
- MonoReflectionMethod *member;
- MonoClass *oklass;
- char **names;
+ static MonoClass *System_Reflection_ParameterInfo;
+ MonoArray *res = NULL;
+ MonoReflectionMethod *member = NULL;
+ MonoReflectionParameter *param = NULL;
+ char **names, **blobs = NULL;
+ MonoObject *dbnull = mono_get_dbnull_object (domain);
+ MonoMarshalSpec **mspecs;
int i;
+ if (!System_Reflection_ParameterInfo)
+ System_Reflection_ParameterInfo = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection", "ParameterInfo");
+
if (!method->signature->param_count)
- return NULL;
+ return mono_array_new (domain, System_Reflection_ParameterInfo, 0);
- member = mono_method_get_object (domain, method);
- names = g_new (char *, method->signature->param_count);
- mono_method_get_param_names (method, (const char **) names);
-
/* Note: the cache is based on the address of the signature into the method
* since we already cache MethodInfos with the method as keys.
*/
- CHECK_OBJECT (MonoReflectionParameter**, &(method->signature));
- oklass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "ParameterInfo");
-#if HAVE_BOEHM_GC
- res = GC_malloc (sizeof (MonoReflectionParameter*) * method->signature->param_count);
-#else
- res = g_new0 (MonoReflectionParameter*, method->signature->param_count);
-#endif
+ CHECK_OBJECT (MonoArray*, &(method->signature), NULL);
+
+ member = mono_method_get_object (domain, method, NULL);
+ names = g_new (char *, method->signature->param_count);
+ mono_method_get_param_names (method, (const char **) names);
+
+ mspecs = g_new (MonoMarshalSpec*, method->signature->param_count + 1);
+ mono_method_get_marshal_info (method, mspecs);
+
+ res = mono_array_new (domain, System_Reflection_ParameterInfo, method->signature->param_count);
for (i = 0; i < method->signature->param_count; ++i) {
- res [i] = (MonoReflectionParameter *)mono_object_new (domain, oklass);
- res [i]->ClassImpl = mono_type_get_object (domain, method->signature->params [i]);
- res [i]->DefaultValueImpl = NULL; /* FIXME */
- res [i]->MemberImpl = (MonoObject*)member;
- res [i]->NameImpl = mono_string_new (domain, names [i]);
- res [i]->PositionImpl = i + 1;
- res [i]->AttrsImpl = method->signature->params [i]->attrs;
+ param = (MonoReflectionParameter *)mono_object_new (domain, System_Reflection_ParameterInfo);
+ param->ClassImpl = mono_type_get_object (domain, method->signature->params [i]);
+ param->MemberImpl = (MonoObject*)member;
+ param->NameImpl = mono_string_new (domain, names [i]);
+ param->PositionImpl = i;
+ param->AttrsImpl = method->signature->params [i]->attrs;
+
+ if (!(param->AttrsImpl & PARAM_ATTRIBUTE_HAS_DEFAULT)) {
+ param->DefaultValueImpl = dbnull;
+ } else {
+ MonoType *type = param->ClassImpl->type;
+
+ if (!blobs) {
+ blobs = g_new0 (char *, method->signature->param_count);
+ get_default_param_value_blobs (method, blobs);
+ }
+
+ param->DefaultValueImpl = mono_get_object_from_blob (domain, type, blobs [i]);
+
+ if (!param->DefaultValueImpl) {
+ param->DefaultValueImpl = dbnull;
+ }
+ }
+
+ if (mspecs [i + 1])
+ param->MarshalAsImpl = (MonoObject*)mono_reflection_marshal_from_marshal_spec (domain, method->klass, mspecs [i + 1]);
+
+ mono_array_set (res, gpointer, i, param);
}
g_free (names);
- CACHE_OBJECT (&(method->signature), res);
+ g_free (blobs);
+
+ for (i = method->signature->param_count; i >= 0; i--)
+ if (mspecs [i])
+ mono_metadata_free_marshal_spec (mspecs [i]);
+ g_free (mspecs);
+
+ CACHE_OBJECT (&(method->signature), res, NULL);
return res;
}
/*
+ * mono_method_body_get_object:
+ * @domain: an app domain
+ * @method: a method
+ *
+ * Return an System.Reflection.MethodBody object representing the method @method.
+ */
+MonoReflectionMethodBody*
+mono_method_body_get_object (MonoDomain *domain, MonoMethod *method)
+{
+ static MonoClass *System_Reflection_MethodBody = NULL;
+ static MonoClass *System_Reflection_LocalVariableInfo = NULL;
+ MonoReflectionMethodBody *ret;
+ MonoMethodNormal *mn;
+ MonoMethodHeader *header;
+ int i;
+
+ if (!System_Reflection_MethodBody)
+ System_Reflection_MethodBody = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "MethodBody");
+ if (!System_Reflection_LocalVariableInfo)
+ System_Reflection_LocalVariableInfo = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "LocalVariableInfo");
+
+ CHECK_OBJECT (MonoReflectionMethodBody *, method, NULL);
+
+ if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+ return NULL;
+ mn = (MonoMethodNormal *)method;
+ header = mono_method_get_header (method);
+
+ ret = (MonoReflectionMethodBody*)mono_object_new (domain, System_Reflection_MethodBody);
+ /* FIXME: Other fields */
+ ret->init_locals = header->init_locals;
+ ret->max_stack = header->max_stack;
+ ret->il = mono_array_new (domain, mono_defaults.byte_class, header->code_size);
+ memcpy (mono_array_addr (ret->il, guint8*, 0), header->code, header->code_size);
+ ret->locals = mono_array_new (domain, System_Reflection_LocalVariableInfo, header->num_locals);
+ for (i = 0; i < header->num_locals; ++i) {
+ MonoReflectionLocalVariableInfo *info = (MonoReflectionLocalVariableInfo*)mono_object_new (domain, System_Reflection_LocalVariableInfo);
+ info->local_type = mono_type_get_object (domain, header->locals [i]);
+ info->is_pinned = header->locals [i]->pinned;
+ info->local_index = 0;
+ }
+
+ CACHE_OBJECT (method, ret, NULL);
+ return ret;
+}
+
+MonoObject *
+mono_get_dbnull_object (MonoDomain *domain)
+{
+ MonoObject *obj;
+ MonoClass *klass;
+ static MonoClassField *dbnull_value_field = NULL;
+
+ if (!dbnull_value_field) {
+ klass = mono_class_from_name (mono_defaults.corlib, "System", "DBNull");
+ mono_class_init (klass);
+ dbnull_value_field = mono_class_get_field_from_name (klass, "Value");
+ g_assert (dbnull_value_field);
+ }
+ obj = mono_field_get_value_object (domain, dbnull_value_field, NULL);
+ g_assert (obj);
+ return obj;
+}
+
+
+static void
+get_default_param_value_blobs (MonoMethod *method, char **blobs)
+{
+ guint32 param_index, i, lastp, crow = 0;
+ guint32 param_cols [MONO_PARAM_SIZE], const_cols [MONO_CONSTANT_SIZE];
+ gint32 idx = -1;
+
+ MonoClass *klass = method->klass;
+ MonoImage *image = klass->image;
+ MonoMethodSignature *methodsig = method->signature;
+
+ MonoTableInfo *constt;
+ MonoTableInfo *methodt;
+ MonoTableInfo *paramt;
+
+ if (!methodsig->param_count)
+ return;
+
+ if (klass->generic_inst) {
+ return; /* FIXME - ??? */
+ }
+
+ mono_class_init (klass);
+
+ if (klass->image->dynamic) {
+ MonoReflectionMethodAux *aux = mono_g_hash_table_lookup (((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+ if (aux && aux->param_defaults)
+ memcpy (blobs, &(aux->param_defaults [1]), methodsig->param_count * sizeof (char*));
+ return;
+ }
+
+ methodt = &klass->image->tables [MONO_TABLE_METHOD];
+ paramt = &klass->image->tables [MONO_TABLE_PARAM];
+ constt = &image->tables [MONO_TABLE_CONSTANT];
+
+ for (i = 0; i < klass->method.count; ++i) {
+ if (method == klass->methods [i]) {
+ idx = klass->method.first + i;
+ break;
+ }
+ }
+
+ g_assert (idx != -1);
+
+ param_index = mono_metadata_decode_row_col (methodt, idx, MONO_METHOD_PARAMLIST);
+ if (idx + 1 < methodt->rows)
+ lastp = mono_metadata_decode_row_col (methodt, idx + 1, MONO_METHOD_PARAMLIST);
+ else
+ lastp = paramt->rows + 1;
+
+ for (i = param_index; i < lastp; ++i) {
+ guint32 paramseq;
+
+ mono_metadata_decode_row (paramt, i - 1, param_cols, MONO_PARAM_SIZE);
+ paramseq = param_cols [MONO_PARAM_SEQUENCE];
+
+ if (!param_cols [MONO_PARAM_FLAGS] & PARAM_ATTRIBUTE_HAS_DEFAULT)
+ continue;
+
+ crow = mono_metadata_get_constant_index (image, MONO_TOKEN_PARAM_DEF | i, crow + 1);
+ if (!crow) {
+ continue;
+ }
+
+ mono_metadata_decode_row (constt, crow - 1, const_cols, MONO_CONSTANT_SIZE);
+ blobs [paramseq - 1] = (gpointer) mono_metadata_blob_heap (image, const_cols [MONO_CONSTANT_VALUE]);
+ }
+
+ return;
+}
+
+static MonoObject *
+mono_get_object_from_blob (MonoDomain *domain, MonoType *type, const char *blob)
+{
+ void *retval;
+ MonoClass *klass;
+ MonoObject *object;
+
+ if (!blob)
+ return NULL;
+
+ klass = mono_class_from_mono_type (type);
+ if (klass->valuetype) {
+ object = mono_object_new (domain, klass);
+ retval = ((gchar *) object + sizeof (MonoObject));
+ } else {
+ retval = &object;
+ }
+
+ if (!mono_get_constant_value_from_blob (domain, type->type, blob, retval))
+ return object;
+ else
+ return NULL;
+}
+
+static int
+assembly_name_to_aname (MonoAssemblyName *assembly, char *p) {
+ int found_sep;
+ char *s;
+
+ memset (assembly, 0, sizeof (MonoAssemblyName));
+ assembly->name = p;
+ assembly->culture = "";
+ memset (assembly->public_key_token, 0, MONO_PUBLIC_KEY_TOKEN_LENGTH);
+
+ while (*p && (isalnum (*p) || *p == '.' || *p == '-' || *p == '_' || *p == '$' || *p == '@'))
+ p++;
+ found_sep = 0;
+ while (*p == ' ' || *p == ',') {
+ *p++ = 0;
+ found_sep = 1;
+ continue;
+ }
+ /* failed */
+ if (!found_sep)
+ return 1;
+ while (*p) {
+ if (*p == 'V' && g_ascii_strncasecmp (p, "Version=", 8) == 0) {
+ p += 8;
+ assembly->major = strtoul (p, &s, 10);
+ if (s == p || *s != '.')
+ return 1;
+ p = ++s;
+ assembly->minor = strtoul (p, &s, 10);
+ if (s == p || *s != '.')
+ return 1;
+ p = ++s;
+ assembly->build = strtoul (p, &s, 10);
+ if (s == p || *s != '.')
+ return 1;
+ p = ++s;
+ assembly->revision = strtoul (p, &s, 10);
+ if (s == p)
+ return 1;
+ p = s;
+ } else if (*p == 'C' && g_ascii_strncasecmp (p, "Culture=", 8) == 0) {
+ p += 8;
+ if (g_ascii_strncasecmp (p, "neutral", 7) == 0) {
+ assembly->culture = "";
+ p += 7;
+ } else {
+ assembly->culture = p;
+ while (*p && *p != ',') {
+ p++;
+ }
+ }
+ } else if (*p == 'P' && g_ascii_strncasecmp (p, "PublicKeyToken=", 15) == 0) {
+ p += 15;
+ if (strncmp (p, "null", 4) == 0) {
+ p += 4;
+ } else {
+ int len;
+ gchar *start = p;
+ while (*p && *p != ',') {
+ p++;
+ }
+ len = (p - start + 1);
+ if (len > MONO_PUBLIC_KEY_TOKEN_LENGTH)
+ len = MONO_PUBLIC_KEY_TOKEN_LENGTH;
+ g_strlcpy (assembly->public_key_token, start, len);
+ }
+ } else {
+ while (*p && *p != ',')
+ p++;
+ }
+ found_sep = 0;
+ while (*p == ' ' || *p == ',') {
+ *p++ = 0;
+ found_sep = 1;
+ continue;
+ }
+ /* failed */
+ if (!found_sep)
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
* mono_reflection_parse_type:
* @name: type name
*
@@ -2814,7 +5756,8 @@ mono_reflection_parse_type (char *name, MonoTypeNameParse *info) {
start = p = w = name;
- info->name = info->name_space = info->assembly = NULL;
+ memset (&info->assembly, 0, sizeof (MonoAssemblyName));
+ info->name = info->name_space = NULL;
info->nested = NULL;
info->modifiers = NULL;
@@ -2826,11 +5769,10 @@ mono_reflection_parse_type (char *name, MonoTypeNameParse *info) {
case '+':
*p = 0; /* NULL terminate the name */
startn = p + 1;
+ info->nested = g_list_append (info->nested, startn);
/* we have parsed the nesting namespace + name */
- if (info->name) {
- info->nested = g_list_append (info->nested, startn);
+ if (info->name)
break;
- }
if (last_point) {
info->name_space = start;
*last_point = 0;
@@ -2860,9 +5802,7 @@ mono_reflection_parse_type (char *name, MonoTypeNameParse *info) {
*w++ = *p++;
}
- if (info->name) {
- info->nested = g_list_append (info->nested, startn);
- } else {
+ if (!info->name) {
if (last_point) {
info->name_space = start;
*last_point = 0;
@@ -2912,12 +5852,14 @@ mono_reflection_parse_type (char *name, MonoTypeNameParse *info) {
}
if (!*p)
return 0; /* missing assembly name */
- info->assembly = p;
+ if (!assembly_name_to_aname (&info->assembly, p))
+ return 0;
break;
default:
+ return 0;
break;
}
- if (info->assembly)
+ if (info->assembly.name)
break;
}
*w = 0; /* terminate class name */
@@ -2927,75 +5869,8 @@ mono_reflection_parse_type (char *name, MonoTypeNameParse *info) {
return 1;
}
-static void
-mono_type_get_name_recurse (MonoType *type, GString *str)
-{
- MonoClass *klass;
-
- switch (type->type) {
- case MONO_TYPE_ARRAY: {
- int i, rank = type->data.array->rank;
-
- mono_type_get_name_recurse (type->data.array->type, str);
- g_string_append_c (str, '[');
- for (i = 1; i < rank; i++)
- g_string_append_c (str, ',');
- g_string_append_c (str, ']');
- break;
- }
- case MONO_TYPE_SZARRAY:
- mono_type_get_name_recurse (type->data.type, str);
- g_string_append (str, "[]");
- break;
- case MONO_TYPE_PTR:
- mono_type_get_name_recurse (type->data.type, str);
- g_string_append_c (str, '*');
- break;
- default:
- klass = mono_class_from_mono_type (type);
- if (klass->nested_in) {
- mono_type_get_name_recurse (&klass->nested_in->byval_arg, str);
- g_string_append_c (str, '+');
- }
- if (*klass->name_space) {
- g_string_append (str, klass->name_space);
- g_string_append_c (str, '.');
- }
- g_string_append (str, klass->name);
- break;
- }
-}
-
-/*
- * mono_type_get_name:
- * @type: a type
- *
- * Returns the string representation for type as required by System.Reflection.
- * The inverse of mono_reflection_parse_type ().
- */
-char*
-mono_type_get_name (MonoType *type)
-{
- GString* result = g_string_new ("");
- mono_type_get_name_recurse (type, result);
-
- if (type->byref)
- g_string_append_c (result, '&');
-
- return g_string_free (result, FALSE);
-}
-
-/*
- * mono_reflection_get_type:
- * @image: a metadata context
- * @info: type description structure
- * @ignorecase: flag for case-insensitive string compares
- *
- * Build a MonoType from the type description in @info.
- *
- */
-MonoType*
-mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase)
+static MonoType*
+mono_reflection_get_type_internal (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase)
{
MonoClass *klass;
GList *mod;
@@ -3041,90 +5916,437 @@ mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ig
} else if (modval == -1) {
klass = mono_ptr_class_get (&klass->byval_arg);
} else { /* array rank */
- klass = mono_array_class_get (&klass->byval_arg, modval);
+ klass = mono_array_class_get (klass, modval);
}
mono_class_init (klass);
}
+
return &klass->byval_arg;
}
/*
- * Optimization we could avoid mallocing() an little-endian archs that
- * don't crash with unaligned accesses.
+ * mono_reflection_get_type:
+ * @image: a metadata context
+ * @info: type description structure
+ * @ignorecase: flag for case-insensitive string compares
+ * @type_resolve: whenever type resolve was already tried
+ *
+ * Build a MonoType from the type description in @info.
+ *
*/
-static void
-fill_param_data (MonoImage *image, MonoMethodSignature *sig, guint32 blobidx, void **params) {
- int len, i, slen, type;
- const char *p = mono_metadata_blob_heap (image, blobidx);
- len = mono_metadata_decode_value (p, &p);
- if (len < 2 || read16 (p) != 0x0001) /* Prolog */
- return;
+MonoType*
+mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve)
+{
+ MonoType *type;
+ MonoReflectionAssembly *assembly;
+ GString *fullName;
+ GList *mod;
- /* skip prolog */
- p += 2;
- for (i = 0; i < sig->param_count; ++i) {
- type = sig->params [i]->type;
-handle_enum:
- switch (type) {
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- case MONO_TYPE_BOOLEAN: {
- MonoBoolean *bval = params [i] = g_malloc (sizeof (MonoBoolean));
- *bval = *p;
- ++p;
- break;
+ type = mono_reflection_get_type_internal (image, info, ignorecase);
+ if (type)
+ return type;
+ if (!mono_domain_has_type_resolve (mono_domain_get ()))
+ return NULL;
+
+ if (type_resolve) {
+ if (*type_resolve)
+ return NULL;
+ else
+ *type_resolve = TRUE;
+ }
+
+ /* Reconstruct the type name */
+ fullName = g_string_new ("");
+ if (info->name_space && (info->name_space [0] != '\0'))
+ g_string_printf (fullName, "%s.%s", info->name_space, info->name);
+ else
+ g_string_printf (fullName, info->name);
+ for (mod = info->nested; mod; mod = mod->next)
+ g_string_append_printf (fullName, "+%s", (char*)mod->data);
+
+ assembly = mono_domain_try_type_resolve ( mono_domain_get (), fullName->str, NULL);
+ if (assembly) {
+ if (assembly->assembly->dynamic) {
+ /* Enumerate all modules */
+ MonoReflectionAssemblyBuilder *abuilder = (MonoReflectionAssemblyBuilder*)assembly;
+ int i;
+
+ type = NULL;
+ if (abuilder->modules) {
+ for (i = 0; i < mono_array_length (abuilder->modules); ++i) {
+ MonoReflectionModuleBuilder *mb = mono_array_get (abuilder->modules, MonoReflectionModuleBuilder*, i);
+ type = mono_reflection_get_type_internal (&mb->dynamic_image->image, info, ignorecase);
+ if (type)
+ break;
+ }
+ }
+
+ if (!type && abuilder->loaded_modules) {
+ for (i = 0; i < mono_array_length (abuilder->loaded_modules); ++i) {
+ MonoReflectionModule *mod = mono_array_get (abuilder->loaded_modules, MonoReflectionModule*, i);
+ type = mono_reflection_get_type_internal (mod->image, info, ignorecase);
+ if (type)
+ break;
+ }
+ }
}
- case MONO_TYPE_CHAR:
- case MONO_TYPE_U2:
- case MONO_TYPE_I2: {
- guint16 *val = params [i] = g_malloc (sizeof (guint16));
- *val = read16 (p);
- p += 2;
- break;
+ else
+ type = mono_reflection_get_type_internal (assembly->assembly->image,
+ info, ignorecase);
+ }
+ g_string_free (fullName, TRUE);
+ return type;
+}
+
+/*
+ * mono_reflection_type_from_name:
+ * @name: type name.
+ * @image: a metadata context (can be NULL).
+ *
+ * Retrieves a MonoType from its @name. If the name is not fully qualified,
+ * it defaults to get the type from @image or, if @image is NULL or loading
+ * from it fails, uses corlib.
+ *
+ */
+MonoType*
+mono_reflection_type_from_name (char *name, MonoImage *image)
+{
+ MonoType *type;
+ MonoTypeNameParse info;
+ MonoAssembly *assembly;
+ char *tmp;
+ gboolean type_resolve = FALSE;
+
+ /* Make a copy since parse_type modifies its argument */
+ tmp = g_strdup (name);
+
+ /*g_print ("requested type %s\n", str);*/
+ if (!mono_reflection_parse_type (tmp, &info)) {
+ g_free (tmp);
+ g_list_free (info.modifiers);
+ g_list_free (info.nested);
+ return NULL;
+ }
+
+ if (info.assembly.name) {
+ assembly = mono_assembly_loaded (&info.assembly);
+ if (!assembly) {
+ /* then we must load the assembly ourselve - see #60439 */
+ assembly = mono_assembly_load (&info.assembly, NULL, NULL);
+ if (!assembly) {
+ g_free (tmp);
+ g_list_free (info.modifiers);
+ g_list_free (info.nested);
+ return NULL;
+ }
+ }
+ image = assembly->image;
+ } else if (image == NULL) {
+ image = mono_defaults.corlib;
+ }
+
+ type = mono_reflection_get_type (image, &info, FALSE, &type_resolve);
+ if (type == NULL && !info.assembly.name && image != mono_defaults.corlib) {
+ image = mono_defaults.corlib;
+ type = mono_reflection_get_type (image, &info, FALSE, &type_resolve);
+ }
+
+ g_free (tmp);
+ g_list_free (info.modifiers);
+ g_list_free (info.nested);
+ return type;
+}
+
+/*
+ * mono_reflection_get_token:
+ *
+ * Return the metadata token of OBJ which should be an object
+ * representing a metadata element.
+ */
+guint32
+mono_reflection_get_token (MonoObject *obj)
+{
+ MonoClass *klass;
+ guint32 token = 0;
+
+ klass = obj->vtable->klass;
+
+ if (strcmp (klass->name, "MethodBuilder") == 0) {
+ MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder *)obj;
+
+ token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
+ } else if (strcmp (klass->name, "ConstructorBuilder") == 0) {
+ MonoReflectionCtorBuilder *mb = (MonoReflectionCtorBuilder *)obj;
+
+ token = mb->table_idx | MONO_TOKEN_METHOD_DEF;
+ } else if (strcmp (klass->name, "FieldBuilder") == 0) {
+ MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder *)obj;
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)fb->typeb;
+ if (tb->generic_params) {
+ g_assert_not_reached ();
+ } else {
+ token = fb->table_idx | MONO_TOKEN_FIELD_DEF;
}
+ } else if (strcmp (klass->name, "TypeBuilder") == 0) {
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder *)obj;
+ token = tb->table_idx | MONO_TOKEN_TYPE_DEF;
+ } else if (strcmp (klass->name, "MonoType") == 0) {
+ MonoReflectionType *tb = (MonoReflectionType *)obj;
+ token = mono_class_from_mono_type (tb->type)->type_token;
+ } else if (strcmp (klass->name, "MonoCMethod") == 0 ||
+ strcmp (klass->name, "MonoMethod") == 0) {
+ MonoReflectionMethod *m = (MonoReflectionMethod *)obj;
+ if (m->method->signature->is_inflated) {
+ g_assert_not_reached ();
+ } else if (m->method->signature->generic_param_count) {
+ g_assert_not_reached ();
+ } else if (m->method->klass->generic_inst) {
+ g_assert_not_reached ();
+ } else {
+ token = m->method->token;
+ }
+ } else if (strcmp (klass->name, "MonoField") == 0) {
+ MonoReflectionField *f = (MonoReflectionField*)obj;
+
+ token = mono_class_get_field_token (f->field);
+ } else if (strcmp (klass->name, "MonoProperty") == 0) {
+ MonoReflectionProperty *p = (MonoReflectionProperty*)obj;
+
+ token = mono_class_get_property_token (p->property);
+ } else if (strcmp (klass->name, "MonoEvent") == 0) {
+ MonoReflectionEvent *p = (MonoReflectionEvent*)obj;
+
+ token = mono_class_get_event_token (p->event);
+ } else if (strcmp (klass->name, "ParameterInfo") == 0) {
+ MonoReflectionParameter *p = (MonoReflectionParameter*)obj;
+
+ token = mono_method_get_param_token (((MonoReflectionMethod*)p->MemberImpl)->method, p->PositionImpl);
+ } else if (strcmp (klass->name, "Module") == 0) {
+ MonoReflectionModule *m = (MonoReflectionModule*)obj;
+
+ token = m->token;
+ } else if (strcmp (klass->name, "Assembly") == 0) {
+ token = mono_metadata_make_token (MONO_TABLE_ASSEMBLY, 1);
+ } else {
+ gchar *msg = g_strdup_printf ("MetadataToken is not supported for type '%s.%s'", klass->name_space, klass->name);
+ MonoException *ex = mono_get_exception_not_implemented (msg);
+ g_free (msg);
+ mono_raise_exception (ex);
+ }
+
+ return token;
+}
+
+static void*
+load_cattr_value (MonoImage *image, MonoType *t, const char *p, const char **end)
+{
+ int slen, type = t->type;
+handle_enum:
+ switch (type) {
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_BOOLEAN: {
+ MonoBoolean *bval = g_malloc (sizeof (MonoBoolean));
+ *bval = *p;
+ *end = p + 1;
+ return bval;
+ }
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2: {
+ guint16 *val = g_malloc (sizeof (guint16));
+ *val = read16 (p);
+ *end = p + 2;
+ return val;
+ }
#if SIZEOF_VOID_P == 4
- case MONO_TYPE_U:
- case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_I:
#endif
- case MONO_TYPE_R4:
- case MONO_TYPE_U4:
- case MONO_TYPE_I4: {
- guint32 *val = params [i] = g_malloc (sizeof (guint32));
- *val = read32 (p);
- p += 4;
- break;
- }
+ case MONO_TYPE_R4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4: {
+ guint32 *val = g_malloc (sizeof (guint32));
+ *val = read32 (p);
+ *end = p + 4;
+ return val;
+ }
#if SIZEOF_VOID_P == 8
- case MONO_TYPE_U: /* error out instead? this should probably not happen */
- case MONO_TYPE_I:
+ case MONO_TYPE_U: /* error out instead? this should probably not happen */
+ case MONO_TYPE_I:
#endif
- case MONO_TYPE_R8:
- case MONO_TYPE_U8:
- case MONO_TYPE_I8: {
- guint64 *val = params [i] = g_malloc (sizeof (guint64));
- *val = read64 (p);
- p += 8;
- break;
+ case MONO_TYPE_R8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8: {
+ guint64 *val = g_malloc (sizeof (guint64));
+ *val = read64 (p);
+ *end = p + 8;
+ return val;
+ }
+ case MONO_TYPE_VALUETYPE:
+ if (t->data.klass->enumtype) {
+ type = t->data.klass->enum_basetype->type;
+ goto handle_enum;
+ } else {
+ g_error ("generic valutype %s not handled in custom attr value decoding", t->data.klass->name);
}
- case MONO_TYPE_VALUETYPE:
- if (sig->params [i]->data.klass->enumtype) {
- type = sig->params [i]->data.klass->enum_basetype->type;
- goto handle_enum;
- } else {
- g_warning ("generic valutype %s not handled in custom attr value decoding", sig->params [i]->data.klass->name);
- }
- break;
- case MONO_TYPE_STRING: {
+ break;
+ case MONO_TYPE_STRING:
+ if (*p == (char)0xFF) {
+ *end = p + 1;
+ return NULL;
+ }
+ slen = mono_metadata_decode_value (p, &p);
+ *end = p + slen;
+ return mono_string_new_len (mono_domain_get (), p, slen);
+ case MONO_TYPE_CLASS: {
+ char *n;
+ MonoType *t;
+ if (*p == (char)0xFF) {
+ *end = p + 1;
+ return NULL;
+ }
+handle_type:
+ slen = mono_metadata_decode_value (p, &p);
+ n = g_memdup (p, slen + 1);
+ n [slen] = 0;
+ t = mono_reflection_type_from_name (n, image);
+ if (!t)
+ g_warning ("Cannot load type '%s'", n);
+ g_free (n);
+ *end = p + slen;
+ if (t)
+ return mono_type_get_object (mono_domain_get (), t);
+ else
+ return NULL;
+ }
+ case MONO_TYPE_OBJECT: {
+ char subt = *p++;
+ MonoObject *obj;
+ MonoClass *subc = NULL;
+ void *val;
+
+ if (subt == 0x50) {
+ goto handle_type;
+ } else if (subt == 0x0E) {
+ type = MONO_TYPE_STRING;
+ goto handle_enum;
+ } else if (subt == 0x55) {
+ char *n;
+ MonoType *t;
slen = mono_metadata_decode_value (p, &p);
- params [i] = mono_string_new_len (mono_domain_get (), p, slen);
+ n = g_memdup (p, slen + 1);
+ n [slen] = 0;
+ t = mono_reflection_type_from_name (n, image);
+ if (!t)
+ g_warning ("Cannot load type '%s'", n);
+ g_free (n);
p += slen;
- break;
+ subc = mono_class_from_mono_type (t);
+ } else if (subt >= MONO_TYPE_BOOLEAN && subt <= MONO_TYPE_R8) {
+ MonoType simple_type = {{0}};
+ simple_type.type = subt;
+ subc = mono_class_from_mono_type (&simple_type);
+ } else {
+ g_error ("Unknown type 0x%02x for object type encoding in custom attr", subt);
}
- default:
- g_warning ("Type %02x not handled in custom attr value decoding", sig->params [i]->type);
- break;
+ val = load_cattr_value (image, &subc->byval_arg, p, end);
+ obj = mono_object_new (mono_domain_get (), subc);
+ memcpy ((char*)obj + sizeof (MonoObject), val, mono_class_value_size (subc, NULL));
+ g_free (val);
+ return obj;
+ }
+ case MONO_TYPE_SZARRAY: {
+ MonoArray *arr;
+ guint32 i, alen, basetype;
+ alen = read32 (p);
+ p += 4;
+ if (alen == 0xffffffff) {
+ *end = p;
+ return NULL;
+ }
+ arr = mono_array_new (mono_domain_get(), t->data.klass, alen);
+ basetype = t->data.klass->byval_arg.type;
+ switch (basetype)
+ {
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_BOOLEAN:
+ for (i = 0; i < alen; i++) {
+ MonoBoolean val = *p++;
+ mono_array_set (arr, MonoBoolean, i, val);
+ }
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2:
+ for (i = 0; i < alen; i++) {
+ guint16 val = read16 (p);
+ mono_array_set (arr, guint16, i, val);
+ p += 2;
+ }
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4:
+ for (i = 0; i < alen; i++) {
+ guint32 val = read32 (p);
+ mono_array_set (arr, guint32, i, val);
+ p += 4;
+ }
+ break;
+ case MONO_TYPE_R8:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ for (i = 0; i < alen; i++) {
+ guint64 val = read64 (p);
+ mono_array_set (arr, guint64, i, val);
+ p += 8;
+ }
+ break;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ for (i = 0; i < alen; i++) {
+ MonoObject *item = load_cattr_value (image, &t->data.klass->byval_arg, p, &p);
+ mono_array_set (arr, gpointer, i, item);
+ }
+ break;
+ default:
+ g_error("Type 0x%02x not handled in custom attr array decoding",t->data.type->type);
}
+ *end=p;
+ return arr;
+ }
+ default:
+ g_error ("Type 0x%02x not handled in custom attr value decoding", type);
+ }
+ return NULL;
+}
+
+static gboolean
+type_is_reference (MonoType *type)
+{
+ switch (type->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_R4:
+ case MONO_TYPE_VALUETYPE:
+ return FALSE;
+ default:
+ return TRUE;
}
}
@@ -3132,27 +6354,8 @@ static void
free_param_data (MonoMethodSignature *sig, void **params) {
int i;
for (i = 0; i < sig->param_count; ++i) {
- switch (sig->params [i]->type) {
- case MONO_TYPE_BOOLEAN:
- case MONO_TYPE_CHAR:
- case MONO_TYPE_U:
- case MONO_TYPE_I:
- case MONO_TYPE_U1:
- case MONO_TYPE_I1:
- case MONO_TYPE_U2:
- case MONO_TYPE_I2:
- case MONO_TYPE_U4:
- case MONO_TYPE_I4:
- case MONO_TYPE_U8:
- case MONO_TYPE_I8:
- case MONO_TYPE_R8:
- case MONO_TYPE_R4:
- case MONO_TYPE_VALUETYPE:
+ if (!type_is_reference (sig->params [i]))
g_free (params [i]);
- break;
- default:
- break;
- }
}
}
@@ -3214,6 +6417,311 @@ find_event_index (MonoClass *klass, MonoEvent *event) {
return 0;
}
+static MonoObject*
+create_custom_attr (MonoImage *image, MonoMethod *method, const char *data, guint32 len)
+{
+ const char *p = data;
+ const char *named;
+ guint32 i, j, num_named;
+ MonoObject *attr;
+ void **params;
+
+ mono_class_init (method->klass);
+
+ if (len == 0) {
+ attr = mono_object_new (mono_domain_get (), method->klass);
+ mono_runtime_invoke (method, attr, NULL, NULL);
+ return attr;
+ }
+
+ if (len < 2 || read16 (p) != 0x0001) /* Prolog */
+ return NULL;
+
+ /*g_print ("got attr %s\n", method->klass->name);*/
+
+ params = g_new (void*, method->signature->param_count);
+
+ /* skip prolog */
+ p += 2;
+ for (i = 0; i < method->signature->param_count; ++i) {
+ params [i] = load_cattr_value (image, method->signature->params [i], p, &p);
+ }
+
+ named = p;
+ attr = mono_object_new (mono_domain_get (), method->klass);
+ mono_runtime_invoke (method, attr, params, NULL);
+ free_param_data (method->signature, params);
+ g_free (params);
+ num_named = read16 (named);
+ named += 2;
+ for (j = 0; j < num_named; j++) {
+ gint name_len;
+ char *name, named_type, data_type;
+ named_type = *named++;
+ data_type = *named++; /* type of data */
+ if (data_type == 0x55) {
+ gint type_len;
+ char *type_name;
+ type_len = mono_metadata_decode_blob_size (named, &named);
+ type_name = g_malloc (type_len + 1);
+ memcpy (type_name, named, type_len);
+ type_name [type_len] = 0;
+ named += type_len;
+ /* FIXME: lookup the type and check type consistency */
+ } else if (data_type == MONO_TYPE_SZARRAY && (named_type == 0x54 || named_type == 0x53)) {
+ /* this seems to be the type of the element of the array */
+ /* g_print ("skipping 0x%02x after prop\n", *named); */
+ named++;
+ }
+ name_len = mono_metadata_decode_blob_size (named, &named);
+ name = g_malloc (name_len + 1);
+ memcpy (name, named, name_len);
+ name [name_len] = 0;
+ named += name_len;
+ if (named_type == 0x53) {
+ MonoClassField *field = mono_class_get_field_from_name (mono_object_class (attr), name);
+ void *val = load_cattr_value (image, field->type, named, &named);
+ mono_field_set_value (attr, field, val);
+ if (!type_is_reference (field->type))
+ g_free (val);
+ } else if (named_type == 0x54) {
+ MonoProperty *prop;
+ void *pparams [1];
+ MonoType *prop_type;
+
+ prop = mono_class_get_property_from_name (mono_object_class (attr), name);
+ /* can we have more that 1 arg in a custom attr named property? */
+ prop_type = prop->get? prop->get->signature->ret: prop->set->signature->params [prop->set->signature->param_count - 1];
+ pparams [0] = load_cattr_value (image, prop_type, named, &named);
+ mono_property_set_value (prop, attr, pparams, NULL);
+ if (!type_is_reference (prop_type))
+ g_free (pparams [0]);
+ }
+ g_free (name);
+ }
+
+ return attr;
+}
+
+MonoArray*
+mono_custom_attrs_construct (MonoCustomAttrInfo *cinfo)
+{
+ MonoArray *result;
+ MonoClass *klass;
+ MonoObject *attr;
+ int i;
+
+ klass = mono_class_from_name (mono_defaults.corlib, "System", "Attribute");
+ result = mono_array_new (mono_domain_get (), klass, cinfo->num_attrs);
+ for (i = 0; i < cinfo->num_attrs; ++i) {
+ attr = create_custom_attr (cinfo->image, cinfo->attrs [i].ctor, cinfo->attrs [i].data, cinfo->attrs [i].data_size);
+ mono_array_set (result, gpointer, i, attr);
+ }
+ return result;
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_index (MonoImage *image, guint32 idx)
+{
+ guint32 mtoken, i, len;
+ guint32 cols [MONO_CUSTOM_ATTR_SIZE];
+ MonoTableInfo *ca;
+ MonoCustomAttrInfo *ainfo;
+ GList *tmp, *list = NULL;
+ const char *data;
+
+ ca = &image->tables [MONO_TABLE_CUSTOMATTRIBUTE];
+
+ i = mono_metadata_custom_attrs_from_index (image, idx);
+ if (!i)
+ return NULL;
+ i --;
+ while (i < ca->rows) {
+ if (mono_metadata_decode_row_col (ca, i, MONO_CUSTOM_ATTR_PARENT) != idx)
+ break;
+ list = g_list_prepend (list, GUINT_TO_POINTER (i));
+ ++i;
+ }
+ len = g_list_length (list);
+ if (!len)
+ return NULL;
+ ainfo = g_malloc0 (sizeof (MonoCustomAttrInfo) + sizeof (MonoCustomAttrEntry) * (len - MONO_ZERO_LEN_ARRAY));
+ ainfo->num_attrs = len;
+ ainfo->image = image;
+ for (i = 0, tmp = list; i < len; ++i, tmp = tmp->next) {
+ mono_metadata_decode_row (ca, GPOINTER_TO_UINT (tmp->data), cols, MONO_CUSTOM_ATTR_SIZE);
+ mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> MONO_CUSTOM_ATTR_TYPE_BITS;
+ switch (cols [MONO_CUSTOM_ATTR_TYPE] & MONO_CUSTOM_ATTR_TYPE_MASK) {
+ case MONO_CUSTOM_ATTR_TYPE_METHODDEF:
+ mtoken |= MONO_TOKEN_METHOD_DEF;
+ break;
+ case MONO_CUSTOM_ATTR_TYPE_MEMBERREF:
+ mtoken |= MONO_TOKEN_MEMBER_REF;
+ break;
+ default:
+ g_error ("Unknown table for custom attr type %08x", cols [MONO_CUSTOM_ATTR_TYPE]);
+ break;
+ }
+ ainfo->attrs [i].ctor = mono_get_method (image, mtoken, NULL);
+ if (!ainfo->attrs [i].ctor)
+ g_error ("Can't find custom attr constructor image: %s mtoken: 0x%08x", image->name, mtoken);
+ data = mono_metadata_blob_heap (image, cols [MONO_CUSTOM_ATTR_VALUE]);
+ ainfo->attrs [i].data_size = mono_metadata_decode_value (data, &data);
+ ainfo->attrs [i].data = data;
+ }
+ g_list_free (list);
+
+ return ainfo;
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_method (MonoMethod *method)
+{
+ MonoCustomAttrInfo *cinfo;
+ guint32 idx;
+
+ if (dynamic_custom_attrs && (cinfo = g_hash_table_lookup (dynamic_custom_attrs, method)))
+ return cinfo;
+ idx = find_method_index (method);
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_METHODDEF;
+ return mono_custom_attrs_from_index (method->klass->image, idx);
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_class (MonoClass *klass)
+{
+ MonoCustomAttrInfo *cinfo;
+ guint32 idx;
+
+ if (dynamic_custom_attrs && (cinfo = g_hash_table_lookup (dynamic_custom_attrs, klass)))
+ return cinfo;
+ idx = mono_metadata_token_index (klass->type_token);
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_TYPEDEF;
+ return mono_custom_attrs_from_index (klass->image, idx);
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_assembly (MonoAssembly *assembly)
+{
+ MonoCustomAttrInfo *cinfo;
+ guint32 idx;
+
+ if (dynamic_custom_attrs && (cinfo = g_hash_table_lookup (dynamic_custom_attrs, assembly)))
+ return cinfo;
+ idx = 1; /* there is only one assembly */
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_ASSEMBLY;
+ return mono_custom_attrs_from_index (assembly->image, idx);
+}
+
+static MonoCustomAttrInfo*
+mono_custom_attrs_from_module (MonoImage *image)
+{
+ MonoCustomAttrInfo *cinfo;
+ guint32 idx;
+
+ if (dynamic_custom_attrs && (cinfo = g_hash_table_lookup (dynamic_custom_attrs, image)))
+ return cinfo;
+ idx = 1; /* there is only one module */
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_MODULE;
+ return mono_custom_attrs_from_index (image, idx);
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_property (MonoClass *klass, MonoProperty *property)
+{
+ MonoCustomAttrInfo *cinfo;
+ guint32 idx;
+
+ if (dynamic_custom_attrs && (cinfo = g_hash_table_lookup (dynamic_custom_attrs, property)))
+ return cinfo;
+ idx = find_property_index (klass, property);
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_PROPERTY;
+ return mono_custom_attrs_from_index (klass->image, idx);
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_event (MonoClass *klass, MonoEvent *event)
+{
+ MonoCustomAttrInfo *cinfo;
+ guint32 idx;
+
+ if (dynamic_custom_attrs && (cinfo = g_hash_table_lookup (dynamic_custom_attrs, event)))
+ return cinfo;
+ idx = find_event_index (klass, event);
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_EVENT;
+ return mono_custom_attrs_from_index (klass->image, idx);
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_field (MonoClass *klass, MonoClassField *field)
+{
+ MonoCustomAttrInfo *cinfo;
+ guint32 idx;
+
+ if (dynamic_custom_attrs && (cinfo = g_hash_table_lookup (dynamic_custom_attrs, field)))
+ return cinfo;
+ idx = find_field_index (klass, field);
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_FIELDDEF;
+ return mono_custom_attrs_from_index (klass->image, idx);
+}
+
+MonoCustomAttrInfo*
+mono_custom_attrs_from_param (MonoMethod *method, guint32 param)
+{
+ MonoTableInfo *ca;
+ guint32 i, idx, method_index;
+ guint32 param_list, param_last, param_pos, found;
+ MonoImage *image;
+ MonoReflectionMethodAux *aux;
+
+ if (method->klass->image->dynamic) {
+ aux = mono_g_hash_table_lookup (((MonoDynamicImage*)method->klass->image)->method_aux_hash, method);
+ if (!aux || !aux->param_cattr)
+ return NULL;
+ return aux->param_cattr [param];
+ }
+
+ image = method->klass->image;
+ method_index = find_method_index (method);
+ ca = &image->tables [MONO_TABLE_METHOD];
+
+ if (method->klass->generic_inst || method->klass->generic_container ||
+ method->signature->generic_param_count) {
+ /* FIXME FIXME FIXME */
+ return NULL;
+ }
+
+ param_list = mono_metadata_decode_row_col (ca, method_index - 1, MONO_METHOD_PARAMLIST);
+ if (method_index == ca->rows) {
+ ca = &image->tables [MONO_TABLE_PARAM];
+ param_last = ca->rows + 1;
+ } else {
+ param_last = mono_metadata_decode_row_col (ca, method_index, MONO_METHOD_PARAMLIST);
+ ca = &image->tables [MONO_TABLE_PARAM];
+ }
+ found = FALSE;
+ for (i = param_list; i < param_last; ++i) {
+ param_pos = mono_metadata_decode_row_col (ca, i - 1, MONO_PARAM_SEQUENCE);
+ if (param_pos == param) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found)
+ return NULL;
+ idx = i;
+ idx <<= MONO_CUSTOM_ATTR_BITS;
+ idx |= MONO_CUSTOM_ATTR_PARAMDEF;
+ return mono_custom_attrs_from_index (image, idx);
+}
+
/*
* mono_reflection_get_custom_attrs:
* @obj: a reflection object handle
@@ -3224,158 +6732,110 @@ find_event_index (MonoClass *klass, MonoEvent *event) {
MonoArray*
mono_reflection_get_custom_attrs (MonoObject *obj)
{
- guint32 idx, mtoken, i, len;
- guint32 cols [MONO_CUSTOM_ATTR_SIZE];
MonoClass *klass;
- MonoImage *image;
- MonoTableInfo *ca;
- MonoMethod *method;
- MonoObject *attr;
MonoArray *result;
- GList *list = NULL;
- void **params;
+ MonoCustomAttrInfo *cinfo = NULL;
+ MONO_ARCH_SAVE_REGS;
+
klass = obj->vtable->klass;
- /* FIXME: need to handle: Module */
if (klass == mono_defaults.monotype_class) {
MonoReflectionType *rtype = (MonoReflectionType*)obj;
klass = mono_class_from_mono_type (rtype->type);
- idx = mono_metadata_token_index (klass->type_token);
- idx <<= CUSTOM_ATTR_BITS;
- idx |= CUSTOM_ATTR_TYPEDEF;
- image = klass->image;
+ cinfo = mono_custom_attrs_from_class (klass);
} else if (strcmp ("Assembly", klass->name) == 0) {
MonoReflectionAssembly *rassembly = (MonoReflectionAssembly*)obj;
- idx = 1; /* there is only one assembly */
- idx <<= CUSTOM_ATTR_BITS;
- idx |= CUSTOM_ATTR_ASSEMBLY;
- image = rassembly->assembly->image;
+ cinfo = mono_custom_attrs_from_assembly (rassembly->assembly);
+ } else if (strcmp ("Module", klass->name) == 0) {
+ MonoReflectionModule *module = (MonoReflectionModule*)obj;
+ cinfo = mono_custom_attrs_from_module (module->image);
} else if (strcmp ("MonoProperty", klass->name) == 0) {
MonoReflectionProperty *rprop = (MonoReflectionProperty*)obj;
- idx = find_property_index (rprop->klass, rprop->property);
- idx <<= CUSTOM_ATTR_BITS;
- idx |= CUSTOM_ATTR_PROPERTY;
- image = rprop->klass->image;
+ cinfo = mono_custom_attrs_from_property (rprop->property->parent, rprop->property);
} else if (strcmp ("MonoEvent", klass->name) == 0) {
MonoReflectionEvent *revent = (MonoReflectionEvent*)obj;
- idx = find_event_index (revent->klass, revent->event);
- idx <<= CUSTOM_ATTR_BITS;
- idx |= CUSTOM_ATTR_EVENT;
- image = revent->klass->image;
+ cinfo = mono_custom_attrs_from_event (revent->event->parent, revent->event);
} else if (strcmp ("MonoField", klass->name) == 0) {
MonoReflectionField *rfield = (MonoReflectionField*)obj;
- idx = find_field_index (rfield->klass, rfield->field);
- idx <<= CUSTOM_ATTR_BITS;
- idx |= CUSTOM_ATTR_FIELDDEF;
- image = rfield->klass->image;
+ cinfo = mono_custom_attrs_from_field (rfield->field->parent, rfield->field);
} else if ((strcmp ("MonoMethod", klass->name) == 0) || (strcmp ("MonoCMethod", klass->name) == 0)) {
MonoReflectionMethod *rmethod = (MonoReflectionMethod*)obj;
- idx = find_method_index (rmethod->method);
- idx <<= CUSTOM_ATTR_BITS;
- idx |= CUSTOM_ATTR_METHODDEF;
- image = rmethod->method->klass->image;
+ cinfo = mono_custom_attrs_from_method (rmethod->method);
} else if (strcmp ("ParameterInfo", klass->name) == 0) {
MonoReflectionParameter *param = (MonoReflectionParameter*)obj;
MonoReflectionMethod *rmethod = (MonoReflectionMethod*)param->MemberImpl;
- guint32 method_index = find_method_index (rmethod->method);
- guint32 param_list, param_last, param_pos, found;
-
- image = rmethod->method->klass->image;
- ca = &image->tables [MONO_TABLE_METHOD];
-
- param_list = mono_metadata_decode_row_col (ca, method_index - 1, MONO_METHOD_PARAMLIST);
- if (method_index == ca->rows) {
- ca = &image->tables [MONO_TABLE_PARAM];
- param_last = ca->rows + 1;
- } else {
- param_last = mono_metadata_decode_row_col (ca, method_index, MONO_METHOD_PARAMLIST);
- ca = &image->tables [MONO_TABLE_PARAM];
- }
- found = 0;
- for (i = param_list; i < param_last; ++i) {
- param_pos = mono_metadata_decode_row_col (ca, i - 1, MONO_PARAM_SEQUENCE);
- if (param_pos == param->PositionImpl) {
- found = 1;
- break;
- }
- }
- if (!found)
- return mono_array_new (mono_domain_get (), mono_defaults.object_class, 0);
- idx = i;
- idx <<= CUSTOM_ATTR_BITS;
- idx |= CUSTOM_ATTR_PARAMDEF;
+ cinfo = mono_custom_attrs_from_param (rmethod->method, param->PositionImpl + 1);
+ } else if (strcmp ("AssemblyBuilder", klass->name) == 0) {
+ MonoReflectionAssemblyBuilder *assemblyb = (MonoReflectionAssemblyBuilder*)obj;
+ cinfo = mono_custom_attrs_from_builders (assemblyb->assembly.assembly->image, assemblyb->cattrs);
+ } else if (strcmp ("TypeBuilder", klass->name) == 0) {
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)obj;
+ cinfo = mono_custom_attrs_from_builders (&tb->module->dynamic_image->image, tb->cattrs);
} else { /* handle other types here... */
g_error ("get custom attrs not yet supported for %s", klass->name);
}
- /* at this point image and index are set correctly for searching the custom attr */
- ca = &image->tables [MONO_TABLE_CUSTOMATTRIBUTE];
- /* the table is not sorted */
- for (i = 0; i < ca->rows; ++i) {
- mono_metadata_decode_row (ca, i, cols, MONO_CUSTOM_ATTR_SIZE);
- if (cols [MONO_CUSTOM_ATTR_PARENT] != idx)
- continue;
- mtoken = cols [MONO_CUSTOM_ATTR_TYPE] >> CUSTOM_ATTR_TYPE_BITS;
- switch (cols [MONO_CUSTOM_ATTR_TYPE] & CUSTOM_ATTR_TYPE_MASK) {
- case CUSTOM_ATTR_TYPE_METHODDEF:
- mtoken |= MONO_TOKEN_METHOD_DEF;
- break;
- case CUSTOM_ATTR_TYPE_MEMBERREF:
- mtoken |= MONO_TOKEN_MEMBER_REF;
- break;
- default:
- g_error ("Unknown table for custom attr type %08x", cols [MONO_CUSTOM_ATTR_TYPE]);
- break;
- }
- method = mono_get_method (image, mtoken, NULL);
- if (!method)
- g_error ("Can't find custom attr constructor");
- mono_class_init (method->klass);
- /*g_print ("got attr %s\n", method->klass->name);*/
- params = g_new (void*, method->signature->param_count);
- fill_param_data (image, method->signature, cols [MONO_CUSTOM_ATTR_VALUE], params);
- attr = mono_object_new (mono_domain_get (), method->klass);
- mono_runtime_invoke (method, attr, params, NULL);
- list = g_list_prepend (list, attr);
- free_param_data (method->signature, params);
- g_free (params);
- }
-
- len = g_list_length (list);
- /*
- * The return type is really object[], but System/Attribute.cs does a cast
- * to (Attribute []) and that is not allowed: I'm lazy for now, but we should
- * probably fix that.
- */
- klass = mono_class_from_name (mono_defaults.corlib, "System", "Attribute");
- result = mono_array_new (mono_domain_get (), klass, len);
- for (i = 0; i < len; ++i) {
- mono_array_set (result, gpointer, i, list->data);
- list = list->next;
+ if (cinfo) {
+ result = mono_custom_attrs_construct (cinfo);
+ if (!cinfo->cached)
+ mono_custom_attrs_free (cinfo);
+ } else {
+ klass = mono_class_from_name (mono_defaults.corlib, "System", "Attribute");
+ result = mono_array_new (mono_domain_get (), klass, 0);
}
- g_list_free (g_list_first (list));
return result;
}
static MonoMethodSignature*
-ctor_builder_to_signature (MonoReflectionCtorBuilder *ctor) {
+parameters_to_signature (MonoArray *parameters) {
MonoMethodSignature *sig;
int count, i;
- count = ctor->parameters? mono_array_length (ctor->parameters): 0;
+ count = parameters? mono_array_length (parameters): 0;
sig = g_malloc0 (sizeof (MonoMethodSignature) + sizeof (MonoType*) * count);
- sig->hasthis = 1;
sig->param_count = count;
sig->sentinelpos = -1; /* FIXME */
for (i = 0; i < count; ++i) {
- MonoReflectionType *pt = mono_array_get (ctor->parameters, MonoReflectionType*, i);
+ MonoReflectionType *pt = mono_array_get (parameters, MonoReflectionType*, i);
sig->params [i] = pt->type;
}
return sig;
}
+static MonoMethodSignature*
+ctor_builder_to_signature (MonoReflectionCtorBuilder *ctor) {
+ MonoMethodSignature *sig;
+
+ sig = parameters_to_signature (ctor->parameters);
+ sig->hasthis = ctor->attrs & METHOD_ATTRIBUTE_STATIC? 0: 1;
+ sig->ret = &mono_defaults.void_class->byval_arg;
+ return sig;
+}
+
+static MonoMethodSignature*
+method_builder_to_signature (MonoReflectionMethodBuilder *method) {
+ MonoMethodSignature *sig;
+
+ sig = parameters_to_signature (method->parameters);
+ sig->hasthis = method->attrs & METHOD_ATTRIBUTE_STATIC? 0: 1;
+ sig->ret = method->rtype? method->rtype->type: &mono_defaults.void_class->byval_arg;
+ sig->generic_param_count = method->generic_params ? mono_array_length (method->generic_params) : 0;
+ return sig;
+}
+
+static MonoMethodSignature*
+dynamic_method_to_signature (MonoReflectionDynamicMethod *method) {
+ MonoMethodSignature *sig;
+
+ sig = parameters_to_signature (method->parameters);
+ sig->hasthis = method->attrs & METHOD_ATTRIBUTE_STATIC? 0: 1;
+ sig->ret = method->rtype? method->rtype->type: &mono_defaults.void_class->byval_arg;
+ sig->generic_param_count = 0;
+ return sig;
+}
+
static void
get_prop_name_and_type (MonoObject *prop, char **name, MonoType **type)
{
@@ -3409,31 +6869,21 @@ get_field_name_and_type (MonoObject *field, char **name, MonoType **type)
}
}
-static char*
-type_get_qualified_name (MonoType *type, MonoAssembly *ass) {
- char *name, *result;
- MonoClass *klass;
- MonoAssembly *ta;
-
- name = mono_type_get_name (type);
- klass = mono_class_from_mono_type (type);
- ta = klass->image->assembly;
- if (ta == ass || klass->image == mono_defaults.corlib)
- return name;
-
- /* missing public key */
- result = g_strdup_printf ("%s, %s, Version=%d.%d.%d.%d, Culture=%s",
- name, ta->aname.name,
- ta->aname.major, ta->aname.minor, ta->aname.build, ta->aname.revision,
- ta->aname.culture && *ta->aname.culture? ta->aname.culture: "neutral");
- g_free (name);
- return result;
-}
-
+/*
+ * Encode a value in a custom attribute stream of bytes.
+ * The value to encode is either supplied as an object in argument val
+ * (valuetypes are boxed), or as a pointer to the data in the
+ * argument argval.
+ * @type represents the type of the value
+ * @buffer is the start of the buffer
+ * @p the current position in the buffer
+ * @buflen contains the size of the buffer and is used to return the new buffer size
+ * if this needs to be realloced.
+ * @retbuffer and @retp return the start and the position of the buffer
+ */
static void
-encode_cattr_value (char *buffer, char *p, char **retbuffer, char **retp, guint32 *buflen, MonoType *type, MonoObject *arg)
+encode_cattr_value (MonoAssembly *assembly, char *buffer, char *p, char **retbuffer, char **retp, guint32 *buflen, MonoType *type, MonoObject *arg, char *argval)
{
- char *argval;
MonoTypeEnum simple_type;
if ((p-buffer) + 10 >= *buflen) {
@@ -3443,7 +6893,8 @@ encode_cattr_value (char *buffer, char *p, char **retbuffer, char **retp, guint3
p = newbuf + (p-buffer);
buffer = newbuf;
}
- argval = ((char*)arg + sizeof (MonoObject));
+ if (!argval)
+ argval = ((char*)arg + sizeof (MonoObject));
simple_type = type->type;
handle_enum:
switch (simple_type) {
@@ -3479,8 +6930,14 @@ handle_enum:
}
break;
case MONO_TYPE_STRING: {
- char *str = mono_string_to_utf8 ((MonoString*)arg);
- guint32 slen = strlen (str);
+ char *str;
+ guint32 slen;
+ if (!arg) {
+ *p++ = 0xFF;
+ break;
+ }
+ str = mono_string_to_utf8 ((MonoString*)arg);
+ slen = strlen (str);
if ((p-buffer) + 10 + slen >= *buflen) {
char *newbuf;
*buflen *= 2;
@@ -3498,7 +6955,12 @@ handle_enum:
case MONO_TYPE_CLASS: {
char *str;
guint32 slen;
- MonoClass *k = mono_object_class (arg);
+ MonoClass *k;
+ if (!arg) {
+ *p++ = 0xFF;
+ break;
+ }
+ k = mono_object_class (arg);
if (!mono_object_isinst (arg, mono_defaults.monotype_class) &&
(strcmp (k->name, "TypeBuilder") || strcmp (k->name_space, "System.Reflection.Emit")))
g_error ("only types allowed, not %s.%s", k->name_space, k->name);
@@ -3519,6 +6981,37 @@ handle_type:
g_free (str);
break;
}
+ case MONO_TYPE_SZARRAY: {
+ int len, i;
+ MonoClass *eclass, *arg_eclass;
+
+ if (!arg) {
+ *p++ = 0xff; *p++ = 0xff; *p++ = 0xff; *p++ = 0xff;
+ break;
+ }
+ len = mono_array_length ((MonoArray*)arg);
+ *p++ = len & 0xff;
+ *p++ = (len >> 8) & 0xff;
+ *p++ = (len >> 16) & 0xff;
+ *p++ = (len >> 24) & 0xff;
+ *retp = p;
+ *retbuffer = buffer;
+ eclass = type->data.klass;
+ arg_eclass = mono_object_class (arg)->element_class;
+ if (eclass->valuetype && arg_eclass->valuetype) {
+ char *elptr = mono_array_addr ((MonoArray*)arg, char, 0);
+ int elsize = mono_class_array_element_size (eclass);
+ for (i = 0; i < len; ++i) {
+ encode_cattr_value (assembly, buffer, p, &buffer, &p, buflen, &eclass->byval_arg, NULL, elptr);
+ elptr += elsize;
+ }
+ } else {
+ for (i = 0; i < len; ++i) {
+ encode_cattr_value (assembly, buffer, p, &buffer, &p, buflen, &eclass->byval_arg, mono_array_get ((MonoArray*)arg, MonoObject*, i), NULL);
+ }
+ }
+ break;
+ }
/* it may be a boxed value or a Type */
case MONO_TYPE_OBJECT: {
MonoClass *klass = mono_object_class (arg);
@@ -3530,13 +7023,17 @@ handle_type:
goto handle_type;
} else if (klass->enumtype) {
*p++ = 0x55;
+ } else if (klass == mono_defaults.string_class) {
+ simple_type = MONO_TYPE_STRING;
+ *p++ = 0x0E;
+ goto handle_enum;
} else if (klass->byval_arg.type >= MONO_TYPE_BOOLEAN && klass->byval_arg.type <= MONO_TYPE_R8) {
*p++ = simple_type = klass->byval_arg.type;
goto handle_enum;
} else {
g_error ("unhandled type in custom attr");
}
- str = type_get_qualified_name (klass->enum_basetype, NULL);
+ str = type_get_qualified_name (mono_class_get_type(klass), NULL);
slen = strlen (str);
if ((p-buffer) + 10 + slen >= *buflen) {
char *newbuf;
@@ -3574,26 +7071,30 @@ handle_type:
* Returns: a Byte array representing the blob of data.
*/
MonoArray*
-mono_reflection_get_custom_attrs_blob (MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues) {
+mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *propValues, MonoArray *fields, MonoArray* fieldValues)
+{
MonoArray *result;
MonoMethodSignature *sig;
MonoObject *arg;
char *buffer, *p;
guint32 buflen, i;
+ MONO_ARCH_SAVE_REGS;
+
if (strcmp (ctor->vtable->klass->name, "MonoCMethod")) {
sig = ctor_builder_to_signature ((MonoReflectionCtorBuilder*)ctor);
} else {
sig = ((MonoReflectionMethod*)ctor)->method->signature;
}
+ g_assert (mono_array_length (ctorArgs) == sig->param_count);
buflen = 256;
p = buffer = g_malloc (buflen);
/* write the prolog */
*p++ = 1;
*p++ = 0;
for (i = 0; i < sig->param_count; ++i) {
- arg = (MonoObject*)mono_array_get (ctorArgs, gpointer, i);
- encode_cattr_value (buffer, p, &buffer, &p, &buflen, sig->params [i], arg);
+ arg = mono_array_get (ctorArgs, MonoObject*, i);
+ encode_cattr_value (assembly->assembly, buffer, p, &buffer, &p, &buflen, sig->params [i], arg, NULL);
}
i = 0;
if (properties)
@@ -3612,11 +7113,49 @@ mono_reflection_get_custom_attrs_blob (MonoObject *ctor, MonoArray *ctorArgs, Mo
prop = mono_array_get (properties, gpointer, i);
get_prop_name_and_type (prop, &pname, &ptype);
*p++ = 0x54; /* PROPERTY signature */
+
+ /* Preallocate a large enough buffer */
+ if (ptype->type == MONO_TYPE_VALUETYPE && ptype->data.klass->enumtype) {
+ char *str = type_get_qualified_name (ptype, NULL);
+ len = strlen (str);
+ g_free (str);
+ }
+ else
+ len = 0;
+ len += strlen (pname);
+
+ if ((p-buffer) + 20 + len >= buflen) {
+ char *newbuf;
+ buflen *= 2;
+ buflen += len;
+ newbuf = g_realloc (buffer, buflen);
+ p = newbuf + (p-buffer);
+ buffer = newbuf;
+ }
+
+ if (ptype->type == MONO_TYPE_VALUETYPE && ptype->data.klass->enumtype) {
+ char *str = type_get_qualified_name (ptype, NULL);
+ int slen = strlen (str);
+
+ *p++ = 0x55;
+ /*
+ * This seems to be optional...
+ * *p++ = 0x80;
+ */
+ mono_metadata_encode_value (slen, p, &p);
+ memcpy (p, str, slen);
+ p += slen;
+ g_free (str);
+ } else {
+ mono_metadata_encode_value (ptype->type, p, &p);
+ if (ptype->type == MONO_TYPE_SZARRAY)
+ mono_metadata_encode_value (ptype->data.klass->this_arg.type, p, &p);
+ }
len = strlen (pname);
mono_metadata_encode_value (len, p, &p);
memcpy (p, pname, len);
p += len;
- encode_cattr_value (buffer, p, &buffer, &p, &buflen, ptype, (MonoObject*)mono_array_get (propValues, gpointer, i));
+ encode_cattr_value (assembly->assembly, buffer, p, &buffer, &p, &buflen, ptype, (MonoObject*)mono_array_get (propValues, gpointer, i), NULL);
g_free (pname);
}
}
@@ -3631,11 +7170,36 @@ mono_reflection_get_custom_attrs_blob (MonoObject *ctor, MonoArray *ctorArgs, Mo
field = mono_array_get (fields, gpointer, i);
get_field_name_and_type (field, &fname, &ftype);
*p++ = 0x53; /* FIELD signature */
+ if (ftype->type == MONO_TYPE_VALUETYPE && ftype->data.klass->enumtype) {
+ char *str = type_get_qualified_name (ftype, NULL);
+ int slen = strlen (str);
+ if ((p-buffer) + 10 + slen >= buflen) {
+ char *newbuf;
+ buflen *= 2;
+ buflen += slen;
+ newbuf = g_realloc (buffer, buflen);
+ p = newbuf + (p-buffer);
+ buffer = newbuf;
+ }
+ *p++ = 0x55;
+ /*
+ * This seems to be optional...
+ * *p++ = 0x80;
+ */
+ mono_metadata_encode_value (slen, p, &p);
+ memcpy (p, str, slen);
+ p += slen;
+ g_free (str);
+ } else {
+ mono_metadata_encode_value (ftype->type, p, &p);
+ if (ftype->type == MONO_TYPE_SZARRAY)
+ mono_metadata_encode_value (ftype->data.klass->this_arg.type, p, &p);
+ }
len = strlen (fname);
mono_metadata_encode_value (len, p, &p);
memcpy (p, fname, len);
p += len;
- encode_cattr_value (buffer, p, &buffer, &p, &buflen, ftype, (MonoObject*)mono_array_get (fieldValues, gpointer, i));
+ encode_cattr_value (assembly->assembly, buffer, p, &buffer, &p, &buflen, ftype, (MonoObject*)mono_array_get (fieldValues, gpointer, i), NULL);
g_free (fname);
}
}
@@ -3664,15 +7228,36 @@ mono_reflection_setup_internal_class (MonoReflectionTypeBuilder *tb)
{
MonoClass *klass, *parent;
- klass = g_new0 (MonoClass, 1);
+ MONO_ARCH_SAVE_REGS;
- klass->image = tb->module->assemblyb->dynamic_assembly->assembly.image;
-
- if (tb->parent)
- parent = mono_class_from_mono_type (tb->parent->type);
- else
+ if (tb->parent) {
+ /* check so we can compile corlib correctly */
+ if (strcmp (mono_object_class (tb->parent)->name, "TypeBuilder") == 0) {
+ /* mono_class_setup_mono_type () guaranteess type->data.klass is valid */
+ parent = tb->parent->type->data.klass;
+ } else {
+ parent = my_mono_class_from_mono_type (tb->parent->type);
+ }
+ } else {
parent = NULL;
+ }
+ /* the type has already being created: it means we just have to change the parent */
+ if (tb->type.type) {
+ klass = mono_class_from_mono_type (tb->type.type);
+ klass->parent = NULL;
+ /* fool mono_class_setup_parent */
+ g_free (klass->supertypes);
+ klass->supertypes = NULL;
+ mono_class_setup_parent (klass, parent);
+ mono_class_setup_mono_type (klass);
+ return;
+ }
+
+ klass = g_new0 (MonoClass, 1);
+
+ klass->image = &tb->module->dynamic_image->image;
+
klass->inited = 1; /* we lie to the runtime */
klass->name = mono_string_to_utf8 (tb->name);
klass->name_space = mono_string_to_utf8 (tb->nspace);
@@ -3682,20 +7267,108 @@ mono_reflection_setup_internal_class (MonoReflectionTypeBuilder *tb)
klass->element_class = klass;
klass->reflection_info = tb; /* need to pin. */
- if (parent != NULL)
+ /* Put into cache so mono_class_get () will find it */
+ mono_image_add_to_name_cache (klass->image, klass->name_space, klass->name, tb->table_idx);
+
+ mono_g_hash_table_insert (tb->module->dynamic_image->tokens,
+ GUINT_TO_POINTER (MONO_TOKEN_TYPE_DEF | tb->table_idx), tb);
+
+ if (parent != NULL) {
mono_class_setup_parent (klass, parent);
+ } else if (strcmp (klass->name, "Object") == 0 && strcmp (klass->name_space, "System") == 0) {
+ const char *old_n = klass->name;
+ /* trick to get relative numbering right when compiling corlib */
+ klass->name = "BuildingObject";
+ mono_class_setup_parent (klass, mono_defaults.object_class);
+ klass->name = old_n;
+ }
+
+ if ((!strcmp (klass->name, "ValueType") && !strcmp (klass->name_space, "System")) ||
+ (!strcmp (klass->name, "Object") && !strcmp (klass->name_space, "System")) ||
+ (!strcmp (klass->name, "Enum") && !strcmp (klass->name_space, "System"))) {
+ klass->instance_size = sizeof (MonoObject);
+ klass->size_inited = 1;
+ mono_class_setup_vtable (klass, NULL, 0);
+ }
+
mono_class_setup_mono_type (klass);
+ mono_class_setup_supertypes (klass);
+
/*
* FIXME: handle interfaces.
*/
tb->type.type = &klass->byval_arg;
+ if (tb->nesting_type) {
+ g_assert (tb->nesting_type->type);
+ klass->nested_in = mono_class_from_mono_type (tb->nesting_type->type);
+ }
+
/*g_print ("setup %s as %s (%p)\n", klass->name, ((MonoObject*)tb)->vtable->klass->name, tb);*/
}
/*
+ * mono_reflection_setup_generic_class:
+ * @tb: a TypeBuilder object
+ *
+ * Setup the generic class before adding the first generic parameter.
+ */
+void
+mono_reflection_setup_generic_class (MonoReflectionTypeBuilder *tb)
+{
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ klass = my_mono_class_from_mono_type (tb->type.type);
+ if (tb->generic_container)
+ return;
+
+ tb->generic_container = g_new0 (MonoGenericContainer, 1);
+ tb->generic_container->klass = klass;
+
+ tb->generic_container->context = g_new0 (MonoGenericContext, 1);
+ tb->generic_container->context->container = tb->generic_container;
+}
+
+/*
+ * mono_reflection_create_generic_class:
+ * @tb: a TypeBuilder object
+ *
+ * Creates the generic class after all generic parameters have been added.
+ */
+void
+mono_reflection_create_generic_class (MonoReflectionTypeBuilder *tb)
+{
+ MonoClass *klass;
+ int count, i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ klass = my_mono_class_from_mono_type (tb->type.type);
+
+ count = tb->generic_params ? mono_array_length (tb->generic_params) : 0;
+
+ if (klass->generic_container || (count == 0))
+ return;
+
+ g_assert (tb->generic_container && (tb->generic_container->klass == klass));
+
+ klass->generic_container = tb->generic_container;
+
+ klass->generic_container->type_argc = count;
+ klass->generic_container->type_params = g_new0 (MonoGenericParam, count);
+
+ for (i = 0; i < count; i++) {
+ MonoReflectionGenericParam *gparam = mono_array_get (tb->generic_params, gpointer, i);
+ klass->generic_container->type_params [i] = *gparam->type.type->data.generic_param;
+ g_assert (klass->generic_container->type_params [i].owner);
+ }
+}
+
+/*
* mono_reflection_create_internal_class:
* @tb: a TypeBuilder object
*
@@ -3706,10 +7379,13 @@ mono_reflection_create_internal_class (MonoReflectionTypeBuilder *tb)
{
MonoClass *klass;
- klass = mono_class_from_mono_type (tb->type.type);
+ MONO_ARCH_SAVE_REGS;
+
+ klass = my_mono_class_from_mono_type (tb->type.type);
if (klass->enumtype && klass->enum_basetype == NULL) {
MonoReflectionFieldBuilder *fb;
+ MonoClass *ec;
g_assert (tb->fields != NULL);
g_assert (mono_array_length (tb->fields) >= 1);
@@ -3717,19 +7393,1118 @@ mono_reflection_create_internal_class (MonoReflectionTypeBuilder *tb)
fb = mono_array_get (tb->fields, MonoReflectionFieldBuilder*, 0);
klass->enum_basetype = fb->type->type;
- klass->element_class = mono_class_from_mono_type (klass->enum_basetype);
+ klass->element_class = my_mono_class_from_mono_type (klass->enum_basetype);
+ if (!klass->element_class)
+ klass->element_class = mono_class_from_mono_type (klass->enum_basetype);
+
+ /*
+ * get the element_class from the current corlib.
+ */
+ ec = default_class_from_mono_type (klass->enum_basetype);
+ klass->instance_size = ec->instance_size;
+ klass->size_inited = 1;
+ /*
+ * this is almost safe to do with enums and it's needed to be able
+ * to create objects of the enum type (for use in SetConstant).
+ */
+ /* FIXME: Does this mean enums can't have method overrides ? */
+ mono_class_setup_vtable (klass, NULL, 0);
+ }
+}
+
+static MonoMarshalSpec*
+mono_marshal_spec_from_builder (MonoAssembly *assembly,
+ MonoReflectionMarshal *minfo)
+{
+ MonoMarshalSpec *res;
+
+ res = g_new0 (MonoMarshalSpec, 1);
+ res->native = minfo->type;
+
+ switch (minfo->type) {
+ case MONO_NATIVE_LPARRAY:
+ res->data.array_data.elem_type = minfo->eltype;
+ res->data.array_data.param_num = 0; /* Not yet */
+ res->data.array_data.num_elem = minfo->count;
+ break;
+
+ case MONO_NATIVE_BYVALTSTR:
+ case MONO_NATIVE_BYVALARRAY:
+ res->data.array_data.num_elem = minfo->count;
+ break;
+
+ case MONO_NATIVE_CUSTOM:
+ if (minfo->marshaltyperef)
+ res->data.custom_data.custom_name =
+ type_get_fully_qualified_name (minfo->marshaltyperef->type);
+ if (minfo->mcookie)
+ res->data.custom_data.cookie = mono_string_to_utf8 (minfo->mcookie);
+ break;
+
+ default:
+ break;
+ }
+
+ return res;
+}
+
+MonoReflectionMarshal*
+mono_reflection_marshal_from_marshal_spec (MonoDomain *domain, MonoClass *klass,
+ MonoMarshalSpec *spec)
+{
+ static MonoClass *System_Reflection_Emit_UnmanagedMarshalClass;
+ MonoReflectionMarshal *minfo;
+ MonoType *mtype;
+
+ if (!System_Reflection_Emit_UnmanagedMarshalClass) {
+ System_Reflection_Emit_UnmanagedMarshalClass = mono_class_from_name (
+ mono_defaults.corlib, "System.Reflection.Emit", "UnmanagedMarshal");
+ g_assert (System_Reflection_Emit_UnmanagedMarshalClass);
+ }
+
+ minfo = (MonoReflectionMarshal*)mono_object_new (domain, System_Reflection_Emit_UnmanagedMarshalClass);
+ minfo->type = spec->native;
+
+ switch (minfo->type) {
+ case MONO_NATIVE_LPARRAY:
+ minfo->eltype = spec->data.array_data.elem_type;
+ minfo->count = spec->data.array_data.num_elem;
+ break;
+
+ case MONO_NATIVE_BYVALTSTR:
+ case MONO_NATIVE_BYVALARRAY:
+ minfo->count = spec->data.array_data.num_elem;
+ break;
+
+ case MONO_NATIVE_CUSTOM:
+ if (spec->data.custom_data.custom_name) {
+ mtype = mono_reflection_type_from_name (spec->data.custom_data.custom_name, klass->image);
+ if (mtype)
+ minfo->marshaltyperef = mono_type_get_object (domain, mtype);
+
+ minfo->marshaltype = mono_string_new (domain, spec->data.custom_data.custom_name);
+ }
+ if (spec->data.custom_data.cookie)
+ minfo->mcookie = mono_string_new (domain, spec->data.custom_data.cookie);
+ break;
+
+ default:
+ break;
+ }
+
+ return minfo;
+}
+
+static MonoMethod*
+reflection_methodbuilder_to_mono_method (MonoClass *klass,
+ ReflectionMethodBuilder *rmb,
+ MonoMethodSignature *sig)
+{
+ MonoMethod *m;
+ MonoMethodNormal *pm;
+ MonoMarshalSpec **specs;
+ MonoReflectionMethodAux *method_aux;
+ int i;
+
+ if ((rmb->attrs & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (rmb->iattrs & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+ m = (MonoMethod *)g_new0 (MonoMethodPInvoke, 1);
+ else if (rmb->refs)
+ m = (MonoMethod *)g_new0 (MonoMethodWrapper, 1);
+ else
+ m = (MonoMethod *)g_new0 (MonoMethodNormal, 1);
+
+ pm = (MonoMethodNormal*)m;
+
+ m->slot = -1;
+ m->flags = rmb->attrs;
+ m->iflags = rmb->iattrs;
+ m->name = mono_string_to_utf8 (rmb->name);
+ m->klass = klass;
+ m->signature = sig;
+ if (rmb->table_idx)
+ m->token = MONO_TOKEN_METHOD_DEF | (*rmb->table_idx);
+
+ if (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
+ if (klass == mono_defaults.string_class && !strcmp (m->name, ".ctor"))
+ m->string_ctor = 1;
+
+ m->signature->pinvoke = 1;
+ } else if (m->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
+ m->signature->pinvoke = 1;
+
+ method_aux = g_new0 (MonoReflectionMethodAux, 1);
+
+ method_aux->dllentry = g_strdup (mono_string_to_utf8 (rmb->dllentry));
+ method_aux->dll = g_strdup (mono_string_to_utf8 (rmb->dll));
+
+ ((MonoMethodPInvoke*)m)->piflags = (rmb->native_cc << 8) | (rmb->charset ? (rmb->charset - 1) * 2 : 1) | rmb->lasterr;
+
+ if (klass->image->dynamic)
+ mono_g_hash_table_insert (((MonoDynamicImage*)klass->image)->method_aux_hash, m, method_aux);
+
+ return m;
+ } else if (!m->klass->dummy &&
+ !(m->flags & METHOD_ATTRIBUTE_ABSTRACT) &&
+ !(m->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
+ MonoMethodHeader *header;
+ guint32 code_size;
+ gint32 max_stack, i;
+ gint32 num_locals = 0;
+ gint32 num_clauses = 0;
+ guint8 *code;
+
+ if (rmb->ilgen) {
+ code = mono_array_addr (rmb->ilgen->code, guint8, 0);
+ code_size = rmb->ilgen->code_len;
+ max_stack = rmb->ilgen->max_stack;
+ num_locals = rmb->ilgen->locals ? mono_array_length (rmb->ilgen->locals) : 0;
+ if (rmb->ilgen->ex_handlers)
+ num_clauses = method_count_clauses (rmb->ilgen);
+ } else {
+ if (rmb->code) {
+ code = mono_array_addr (rmb->code, guint8, 0);
+ code_size = mono_array_length (rmb->code);
+ /* we probably need to run a verifier on the code... */
+ max_stack = 8;
+ }
+ else {
+ code = NULL;
+ code_size = 0;
+ max_stack = 8;
+ }
+ }
+
+ header = g_malloc0 (sizeof (MonoMethodHeader) +
+ (num_locals - MONO_ZERO_LEN_ARRAY) * sizeof (MonoType*));
+ header->code_size = code_size;
+ header->code = g_malloc (code_size);
+ memcpy ((char*)header->code, code, code_size);
+ header->max_stack = max_stack;
+ header->init_locals = rmb->init_locals;
+ header->num_locals = num_locals;
+
+ for (i = 0; i < num_locals; ++i) {
+ MonoReflectionLocalBuilder *lb =
+ mono_array_get (rmb->ilgen->locals, MonoReflectionLocalBuilder*, i);
+
+ header->locals [i] = g_new0 (MonoType, 1);
+ memcpy (header->locals [i], lb->type->type, sizeof (MonoType));
+ }
+
+ header->num_clauses = num_clauses;
+ if (num_clauses) {
+ header->clauses = method_encode_clauses ((MonoDynamicImage*)klass->image,
+ rmb->ilgen, num_clauses);
+ }
+
+ pm->header = header;
+ }
+
+ if (rmb->generic_params) {
+ int count = mono_array_length (rmb->generic_params);
+ MonoGenericContainer *container;
+
+ pm->generic_container = container = g_new0 (MonoGenericContainer, 1);
+ container->type_argc = count;
+ container->type_params = g_new0 (MonoGenericParam, count);
+
+ for (i = 0; i < count; i++) {
+ MonoReflectionGenericParam *gp =
+ mono_array_get (rmb->generic_params, MonoReflectionGenericParam*, i);
+
+ container->type_params [i] = *gp->type.type->data.generic_param;
+ }
+ }
+
+ if (rmb->refs) {
+ MonoMethodWrapper *mw = (MonoMethodWrapper*)m;
+ int i;
+
+ m->wrapper_type = MONO_WRAPPER_DYNAMIC_METHOD;
+
+ for (i = 0; i < rmb->nrefs; ++i)
+ mw->data = g_list_append (mw->data, rmb->refs [i]);
+ }
+
+ method_aux = NULL;
+
+ /* Parameter info */
+ if (rmb->pinfo) {
+ if (!method_aux)
+ method_aux = g_new0 (MonoReflectionMethodAux, 1);
+ method_aux->param_names = g_new0 (char *, m->signature->param_count + 1);
+ for (i = 0; i <= m->signature->param_count; ++i) {
+ MonoReflectionParamBuilder *pb;
+ if ((pb = mono_array_get (rmb->pinfo, MonoReflectionParamBuilder*, i))) {
+ if (i > 0)
+ m->signature->params [i - 1]->attrs = pb->attrs;
+
+ if (pb->def_value) {
+ MonoDynamicImage *assembly;
+ guint32 idx, def_type, len;
+ char *p;
+ const char *p2;
+
+ if (!method_aux->param_defaults)
+ method_aux->param_defaults = g_new0 (guint8*, m->signature->param_count + 1);
+ assembly = (MonoDynamicImage*)klass->image;
+ idx = encode_constant (assembly, pb->def_value, &def_type);
+ /* Copy the data from the blob since it might get realloc-ed */
+ p = assembly->blob.data + idx;
+ len = mono_metadata_decode_blob_size (p, &p2);
+ len += p2 - p;
+ method_aux->param_defaults [i] = g_malloc (len);
+ memcpy ((gpointer)method_aux->param_defaults [i], p, len);
+ }
+
+ if (pb->name)
+ method_aux->param_names [i] = mono_string_to_utf8 (pb->name);
+ if (pb->cattrs) {
+ if (!method_aux->param_cattr)
+ method_aux->param_cattr = g_new0 (MonoCustomAttrInfo*, m->signature->param_count + 1);
+ method_aux->param_cattr [i] = mono_custom_attrs_from_builders (klass->image, pb->cattrs);
+ }
+ }
+ }
+ }
+
+ /* Parameter marshalling */
+ specs = NULL;
+ if (rmb->pinfo)
+ for (i = 0; i < mono_array_length (rmb->pinfo); ++i) {
+ MonoReflectionParamBuilder *pb;
+ if ((pb = mono_array_get (rmb->pinfo, MonoReflectionParamBuilder*, i))) {
+ if (pb->marshal_info) {
+ if (specs == NULL)
+ specs = g_new0 (MonoMarshalSpec*, sig->param_count + 1);
+ specs [pb->position] =
+ mono_marshal_spec_from_builder (klass->image->assembly, pb->marshal_info);
+ }
+ }
+ }
+ if (specs != NULL) {
+ if (!method_aux)
+ method_aux = g_new0 (MonoReflectionMethodAux, 1);
+ method_aux->param_marshall = specs;
+ }
+
+ if (klass->image->dynamic && method_aux)
+ mono_g_hash_table_insert (((MonoDynamicImage*)klass->image)->method_aux_hash, m, method_aux);
+
+ return m;
+}
+
+static MonoMethod*
+ctorbuilder_to_mono_method (MonoClass *klass, MonoReflectionCtorBuilder* mb)
+{
+ ReflectionMethodBuilder rmb;
+ MonoMethodSignature *sig;
+
+ sig = ctor_builder_to_signature (mb);
+
+ reflection_methodbuilder_from_ctor_builder (&rmb, mb);
+
+ mb->mhandle = reflection_methodbuilder_to_mono_method (klass, &rmb, sig);
+ mono_save_custom_attrs (klass->image, mb->mhandle, mb->cattrs);
+
+ if (!((MonoDynamicImage*)(MonoDynamicImage*)klass->image)->save) {
+ /* ilgen is no longer needed */
+ mb->ilgen = NULL;
+ }
+
+ return mb->mhandle;
+}
+
+static MonoMethod*
+methodbuilder_to_mono_method (MonoClass *klass, MonoReflectionMethodBuilder* mb)
+{
+ ReflectionMethodBuilder rmb;
+ MonoMethodSignature *sig;
+
+ sig = method_builder_to_signature (mb);
+
+ reflection_methodbuilder_from_method_builder (&rmb, mb);
+
+ mb->mhandle = reflection_methodbuilder_to_mono_method (klass, &rmb, sig);
+ mono_save_custom_attrs (klass->image, mb->mhandle, mb->cattrs);
+
+ if (!((MonoDynamicImage*)(MonoDynamicImage*)klass->image)->save) {
+ /* ilgen is no longer needed */
+ mb->ilgen = NULL;
+ }
+ return mb->mhandle;
+}
+
+static MonoClassField*
+fieldbuilder_to_mono_class_field (MonoClass *klass, MonoReflectionFieldBuilder* fb)
+{
+ MonoClassField *field;
+ const char *p, *p2;
+ guint32 len, idx;
+
+ if (fb->handle)
+ return fb->handle;
+
+ field = g_new0 (MonoClassField, 1);
+
+ field->name = mono_string_to_utf8 (fb->name);
+ if (fb->attrs) {
+ /* FIXME: handle type modifiers */
+ field->type = g_memdup (fb->type->type, sizeof (MonoType));
+ field->type->attrs = fb->attrs;
+ } else {
+ field->type = fb->type->type;
+ }
+ if ((fb->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA) && fb->rva_data)
+ field->data = mono_array_addr (fb->rva_data, char, 0);
+ if (fb->offset != -1)
+ field->offset = fb->offset;
+ field->parent = klass;
+ fb->handle = field;
+ mono_save_custom_attrs (klass->image, field, fb->cattrs);
+
+ if (fb->def_value) {
+ MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image;
+ field->type->attrs |= FIELD_ATTRIBUTE_HAS_DEFAULT;
+ idx = encode_constant (assembly, fb->def_value, &field->def_type);
+ /* Copy the data from the blob since it might get realloc-ed */
+ p = assembly->blob.data + idx;
+ len = mono_metadata_decode_blob_size (p, &p2);
+ len += p2 - p;
+ field->data = g_malloc (len);
+ memcpy ((gpointer)field->data, p, len);
}
+
+ return field;
+}
+
+static MonoType*
+do_mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc, MonoType **types)
+{
+ MonoClass *klass, *gklass;
+ MonoReflectionTypeBuilder *tb = NULL;
+ MonoGenericInst *ginst, *cached;
+ MonoDomain *domain;
+ MonoType *geninst;
+ int icount, i;
+
+ klass = mono_class_from_mono_type (type->type);
+ if (!klass->generic_container && !klass->generic_inst &&
+ !(klass->nested_in && klass->nested_in->generic_container))
+ return NULL;
+
+ mono_loader_lock ();
+
+ domain = mono_object_domain (type);
+
+ ginst = g_new0 (MonoGenericInst, 1);
+
+ ginst->type_argc = type_argc;
+ ginst->type_argv = types;
+
+ for (i = 0; i < ginst->type_argc; ++i) {
+ if (!ginst->is_open)
+ ginst->is_open = mono_class_is_open_constructed_type (types [i]);
+ }
+
+ ginst->generic_type = &klass->byval_arg;
+
+ if (klass->generic_inst) {
+ MonoGenericInst *kginst = klass->generic_inst;
+ MonoGenericInst *oginst = ginst;
+
+ oginst->context = g_new0 (MonoGenericContext, 1);
+ oginst->context->ginst = oginst;
+
+ ginst = g_new0 (MonoGenericInst, 1);
+
+ ginst->type_argc = kginst->type_argc;
+ ginst->type_argv = g_new0 (MonoType *, ginst->type_argc);
+
+ for (i = 0; i < ginst->type_argc; i++) {
+ MonoType *t = kginst->type_argv [i];
+
+ t = mono_class_inflate_generic_type (t, oginst->context);
+
+ if (!ginst->is_open)
+ ginst->is_open = mono_class_is_open_constructed_type (t);
+
+ ginst->type_argv [i] = t;
+ }
+
+ ginst->generic_type = kginst->generic_type;
+ }
+
+ geninst = g_new0 (MonoType, 1);
+ geninst->type = MONO_TYPE_GENERICINST;
+
+ cached = g_hash_table_lookup (klass->image->generic_inst_cache, ginst);
+ if (cached) {
+ g_free (ginst);
+ mono_loader_unlock ();
+ geninst->data.generic_inst = cached;
+ return geninst;
+ }
+
+ gklass = mono_class_from_mono_type (ginst->generic_type);
+ g_assert ((ginst->container = gklass->generic_container) != NULL);
+
+ geninst->data.generic_inst = ginst;
+
+ ginst->context = g_new0 (MonoGenericContext, 1);
+ ginst->context->ginst = ginst;
+
+ if (!strcmp (((MonoObject *) type)->vtable->klass->name, "TypeBuilder")) {
+ tb = (MonoReflectionTypeBuilder *) type;
+
+ icount = tb->interfaces ? mono_array_length (tb->interfaces) : 0;
+ ginst->is_dynamic = TRUE;
+ } else if (!strcmp (((MonoObject *) type)->vtable->klass->name, "MonoGenericInst")) {
+ MonoReflectionGenericInst *rgi = (MonoReflectionGenericInst *) type;
+ MonoReflectionType *rgt = rgi->generic_type;
+
+ g_assert (!strcmp (((MonoObject *) rgt)->vtable->klass->name, "TypeBuilder"));
+ tb = (MonoReflectionTypeBuilder *) rgt;
+
+ icount = tb->interfaces ? mono_array_length (tb->interfaces) : 0;
+ ginst->is_dynamic = TRUE;
+ } else {
+ icount = klass->interface_count;
+ }
+
+ ginst->ifaces = g_new0 (MonoType *, icount);
+ ginst->count_ifaces = icount;
+
+ for (i = 0; i < icount; i++) {
+ MonoReflectionType *itype;
+
+ if (tb)
+ itype = mono_array_get (tb->interfaces, MonoReflectionType *, i);
+ else
+ itype = mono_type_get_object (domain, &klass->interfaces [i]->byval_arg);
+ ginst->ifaces [i] = mono_reflection_bind_generic_parameters (itype, type_argc, types);
+ if (!ginst->ifaces [i])
+ ginst->ifaces [i] = itype->type;
+ }
+
+ mono_class_create_generic (ginst);
+
+ g_hash_table_insert (klass->image->generic_inst_cache, ginst, ginst);
+
+ mono_loader_unlock ();
+
+ return geninst;
+}
+
+MonoType*
+mono_reflection_bind_generic_parameters (MonoReflectionType *type, int type_argc, MonoType **types)
+{
+ MonoClass *klass, *pklass = NULL;
+ MonoReflectionType *parent = NULL;
+ MonoType *geninst;
+ MonoReflectionTypeBuilder *tb = NULL;
+ MonoGenericInst *ginst;
+ MonoDomain *domain;
+
+ domain = mono_object_domain (type);
+ klass = mono_class_from_mono_type (type->type);
+
+ if (!strcmp (((MonoObject *) type)->vtable->klass->name, "TypeBuilder")) {
+ tb = (MonoReflectionTypeBuilder *) type;
+
+ if (tb->parent) {
+ parent = tb->parent;
+ pklass = mono_class_from_mono_type (parent->type);
+ }
+ } else {
+ pklass = klass->parent;
+ if (pklass)
+ parent = mono_type_get_object (domain, &pklass->byval_arg);
+ else if (klass->generic_inst && klass->generic_inst->parent) {
+ parent = mono_type_get_object (domain, klass->generic_inst->parent);
+ pklass = mono_class_from_mono_type (klass->generic_inst->parent);
+ }
+ }
+
+ geninst = do_mono_reflection_bind_generic_parameters (type, type_argc, types);
+ if (!geninst)
+ return NULL;
+
+ ginst = geninst->data.generic_inst;
+
+ if (pklass && pklass->generic_inst)
+ ginst->parent = mono_reflection_bind_generic_parameters (parent, type_argc, types);
+
+ return geninst;
+}
+
+MonoReflectionMethod*
+mono_reflection_bind_generic_method_parameters (MonoReflectionMethod *rmethod, MonoArray *types)
+{
+ MonoMethod *method, *inflated;
+ MonoReflectionMethodBuilder *mb = NULL;
+ MonoGenericMethod *gmethod;
+ MonoGenericContext *context;
+ int count, i;
+
+ MONO_ARCH_SAVE_REGS;
+ if (!strcmp (rmethod->object.vtable->klass->name, "MethodBuilder")) {
+ MonoReflectionTypeBuilder *tb;
+ MonoClass *klass;
+
+ mb = (MonoReflectionMethodBuilder *) rmethod;
+ tb = (MonoReflectionTypeBuilder *) mb->type;
+ klass = mono_class_from_mono_type (tb->type.type);
+
+ method = methodbuilder_to_mono_method (klass, mb);
+ } else {
+ method = rmethod->method;
+ }
+
+ count = method->signature->generic_param_count;
+ if (count != mono_array_length (types))
+ return NULL;
+
+ gmethod = g_new0 (MonoGenericMethod, 1);
+ gmethod->mtype_argc = count;
+ gmethod->mtype_argv = g_new0 (MonoType *, count);
+ for (i = 0; i < count; i++) {
+ MonoReflectionType *garg = mono_array_get (types, gpointer, i);
+ gmethod->mtype_argv [i] = garg->type;
+ }
+
+ gmethod->reflection_info = rmethod;
+
+ context = g_new0 (MonoGenericContext, 1);
+ context->ginst = method->klass->generic_inst;
+ context->gmethod = gmethod;
+
+ inflated = mono_class_inflate_generic_method (method, context, NULL);
+
+ return mono_method_get_object (
+ mono_object_domain (rmethod), inflated, NULL);
+}
+
+static MonoMethod *
+inflate_mono_method (MonoReflectionGenericInst *type, MonoMethod *method, MonoObject *obj)
+{
+ MonoGenericMethod *gmethod;
+ MonoGenericInst *ginst;
+ MonoGenericContext *context;
+ int i;
+
+ ginst = type->type.type->data.generic_inst;
+
+ gmethod = g_new0 (MonoGenericMethod, 1);
+ gmethod->reflection_info = obj;
+
+ gmethod->mtype_argc = method->signature->generic_param_count;
+ gmethod->mtype_argv = g_new0 (MonoType *, gmethod->mtype_argc);
+
+ for (i = 0; i < gmethod->mtype_argc; i++) {
+ MonoMethodNormal *mn = (MonoMethodNormal *) method;
+ MonoGenericParam *gparam = &mn->generic_container->type_params [i];
+
+ g_assert (gparam->pklass);
+ gmethod->mtype_argv [i] = &gparam->pklass->byval_arg;
+ }
+
+ context = g_new0 (MonoGenericContext, 1);
+ context->ginst = ginst;
+ context->gmethod = gmethod;
+
+ return mono_class_inflate_generic_method (method, context, ginst->klass);
+}
+
+static MonoMethod *
+inflate_method (MonoReflectionGenericInst *type, MonoObject *obj)
+{
+ MonoMethod *method;
+ MonoClass *klass;
+
+ klass = mono_class_from_mono_type (type->type.type);
+
+ if (!strcmp (obj->vtable->klass->name, "MethodBuilder"))
+ method = methodbuilder_to_mono_method (klass, (MonoReflectionMethodBuilder *) obj);
+ else if (!strcmp (obj->vtable->klass->name, "ConstructorBuilder"))
+ method = ctorbuilder_to_mono_method (klass, (MonoReflectionCtorBuilder *) obj);
+ else if (!strcmp (obj->vtable->klass->name, "MonoMethod") || !strcmp (obj->vtable->klass->name, "MonoCMethod"))
+ method = ((MonoReflectionMethod *) obj)->method;
+ else {
+ method = NULL; /* prevent compiler warning */
+ g_assert_not_reached ();
+ }
+
+ return inflate_mono_method (type, method, obj);
+}
+
+void
+mono_reflection_generic_inst_initialize (MonoReflectionGenericInst *type, MonoArray *methods,
+ MonoArray *ctors, MonoArray *fields, MonoArray *properties, MonoArray *events)
+{
+ MonoGenericInst *ginst;
+ MonoDynamicGenericInst *dginst;
+ MonoClass *klass, *gklass, *pklass;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ klass = mono_class_from_mono_type (type->type.type);
+ ginst = type->type.type->data.generic_inst;
+
+ if (ginst->initialized)
+ return;
+
+ dginst = ginst->dynamic_info = g_new0 (MonoDynamicGenericInst, 1);
+
+ gklass = mono_class_from_mono_type (ginst->generic_type);
+ mono_class_init (gklass);
+
+ if (ginst->parent)
+ pklass = mono_class_from_mono_type (ginst->parent);
+ else
+ pklass = gklass->parent;
+
+ mono_class_setup_parent (klass, pklass);
+
+ dginst->count_methods = methods ? mono_array_length (methods) : 0;
+ dginst->count_ctors = ctors ? mono_array_length (ctors) : 0;
+ dginst->count_fields = fields ? mono_array_length (fields) : 0;
+ dginst->count_properties = properties ? mono_array_length (properties) : 0;
+ dginst->count_events = events ? mono_array_length (events) : 0;
+
+ dginst->methods = g_new0 (MonoMethod *, dginst->count_methods);
+ dginst->ctors = g_new0 (MonoMethod *, dginst->count_ctors);
+ dginst->fields = g_new0 (MonoClassField, dginst->count_fields);
+ dginst->properties = g_new0 (MonoProperty, dginst->count_properties);
+ dginst->events = g_new0 (MonoEvent, dginst->count_events);
+
+ for (i = 0; i < dginst->count_methods; i++) {
+ MonoObject *obj = mono_array_get (methods, gpointer, i);
+
+ dginst->methods [i] = inflate_method (type, obj);
+ }
+
+ for (i = 0; i < dginst->count_ctors; i++) {
+ MonoObject *obj = mono_array_get (ctors, gpointer, i);
+
+ dginst->ctors [i] = inflate_method (type, obj);
+ }
+
+ for (i = 0; i < dginst->count_fields; i++) {
+ MonoObject *obj = mono_array_get (fields, gpointer, i);
+ MonoClassField *field;
+ MonoInflatedField *ifield;
+
+ if (!strcmp (obj->vtable->klass->name, "FieldBuilder"))
+ field = fieldbuilder_to_mono_class_field (klass, (MonoReflectionFieldBuilder *) obj);
+ else if (!strcmp (obj->vtable->klass->name, "MonoField"))
+ field = ((MonoReflectionField *) obj)->field;
+ else {
+ field = NULL; /* prevent compiler warning */
+ g_assert_not_reached ();
+ }
+
+ ifield = g_new0 (MonoInflatedField, 1);
+ ifield->generic_type = field->type;
+ ifield->reflection_info = obj;
+
+ dginst->fields [i] = *field;
+ dginst->fields [i].generic_info = ifield;
+ dginst->fields [i].type = mono_class_inflate_generic_type (field->type, ginst->context);
+ }
+
+ for (i = 0; i < dginst->count_properties; i++) {
+ MonoObject *obj = mono_array_get (properties, gpointer, i);
+ MonoProperty *property = &dginst->properties [i];
+
+ if (!strcmp (obj->vtable->klass->name, "PropertyBuilder")) {
+ MonoReflectionPropertyBuilder *pb = (MonoReflectionPropertyBuilder *) obj;
+
+ property->parent = klass;
+ property->attrs = pb->attrs;
+ property->name = mono_string_to_utf8 (pb->name);
+ if (pb->get_method)
+ property->get = inflate_method (type, (MonoObject *) pb->get_method);
+ if (pb->set_method)
+ property->set = inflate_method (type, (MonoObject *) pb->set_method);
+ } else if (!strcmp (obj->vtable->klass->name, "MonoProperty")) {
+ *property = *((MonoReflectionProperty *) obj)->property;
+
+ if (property->get)
+ property->get = inflate_mono_method (type, property->get, NULL);
+ if (property->set)
+ property->set = inflate_mono_method (type, property->set, NULL);
+ } else
+ g_assert_not_reached ();
+ }
+
+ for (i = 0; i < dginst->count_events; i++) {
+ MonoObject *obj = mono_array_get (events, gpointer, i);
+ MonoEvent *event = &dginst->events [i];
+
+ if (!strcmp (obj->vtable->klass->name, "EventBuilder")) {
+ MonoReflectionEventBuilder *eb = (MonoReflectionEventBuilder *) obj;
+
+ event->parent = klass;
+ event->attrs = eb->attrs;
+ event->name = mono_string_to_utf8 (eb->name);
+ if (eb->add_method)
+ event->add = inflate_method (type, (MonoObject *) eb->add_method);
+ if (eb->remove_method)
+ event->remove = inflate_method (type, (MonoObject *) eb->remove_method);
+ } else if (!strcmp (obj->vtable->klass->name, "MonoEvent")) {
+ *event = *((MonoReflectionEvent *) obj)->event;
+
+ if (event->add)
+ event->add = inflate_mono_method (type, event->add, NULL);
+ if (event->remove)
+ event->remove = inflate_mono_method (type, event->remove, NULL);
+ } else
+ g_assert_not_reached ();
+ }
+
+ ginst->initialized = TRUE;
+}
+
+static void
+ensure_runtime_vtable (MonoClass *klass)
+{
+ MonoReflectionTypeBuilder *tb = klass->reflection_info;
+ int i, num, j, onum;
+ MonoMethod **overrides;
+
+ if (!tb || klass->wastypebuilder)
+ return;
+ if (klass->parent)
+ ensure_runtime_vtable (klass->parent);
+
+ num = tb->ctors? mono_array_length (tb->ctors): 0;
+ num += tb->num_methods;
+ klass->method.count = num;
+ klass->methods = g_new (MonoMethod*, num);
+ num = tb->ctors? mono_array_length (tb->ctors): 0;
+ for (i = 0; i < num; ++i)
+ klass->methods [i] = ctorbuilder_to_mono_method (klass, mono_array_get (tb->ctors, MonoReflectionCtorBuilder*, i));
+ num = tb->num_methods;
+ j = i;
+ for (i = 0; i < num; ++i)
+ klass->methods [j++] = methodbuilder_to_mono_method (klass, mono_array_get (tb->methods, MonoReflectionMethodBuilder*, i));
+
+ if (tb->interfaces) {
+ klass->interface_count = mono_array_length (tb->interfaces);
+ klass->interfaces = g_new (MonoClass*, klass->interface_count);
+ for (i = 0; i < klass->interface_count; ++i) {
+ MonoReflectionType *iface = mono_array_get (tb->interfaces, gpointer, i);
+ klass->interfaces [i] = mono_class_from_mono_type (iface->type);
+ }
+ }
+
+ if (klass->flags & TYPE_ATTRIBUTE_INTERFACE)
+ for (i = 0; i < klass->method.count; ++i)
+ klass->methods [i]->slot = i;
+
+ /* Overrides */
+ onum = 0;
+ if (tb->methods) {
+ for (i = 0; i < tb->num_methods; ++i) {
+ MonoReflectionMethodBuilder *mb =
+ mono_array_get (tb->methods, MonoReflectionMethodBuilder*, i);
+ if (mb->override_method)
+ onum ++;
+ }
+ }
+
+ overrides = g_new0 (MonoMethod*, onum * 2);
+
+ if (tb->methods) {
+ onum = 0;
+ for (i = 0; i < tb->num_methods; ++i) {
+ MonoReflectionMethodBuilder *mb =
+ mono_array_get (tb->methods, MonoReflectionMethodBuilder*, i);
+ if (mb->override_method) {
+ /* FIXME: What if 'override_method' is a MethodBuilder ? */
+ overrides [onum * 2] =
+ mb->override_method->method;
+ overrides [onum * 2 + 1] =
+ mb->mhandle;
+
+ g_assert (mb->mhandle);
+
+ onum ++;
+ }
+ }
+ }
+
+ mono_class_setup_vtable (klass, overrides, onum);
+ g_free (overrides);
+}
+
+static void
+typebuilder_setup_fields (MonoClass *klass)
+{
+ MonoReflectionTypeBuilder *tb = klass->reflection_info;
+ MonoReflectionFieldBuilder *fb;
+ MonoClassField *field;
+ const char *p, *p2;
+ int i;
+ guint32 len, idx;
+
+ klass->field.count = tb->num_fields;
+ klass->field.first = 0;
+ klass->field.last = klass->field.count;
+
+ if (!klass->field.count)
+ return;
+
+ klass->fields = g_new0 (MonoClassField, klass->field.count);
+
+ for (i = 0; i < klass->field.count; ++i) {
+ fb = mono_array_get (tb->fields, gpointer, i);
+ field = &klass->fields [i];
+ field->name = mono_string_to_utf8 (fb->name);
+ if (fb->attrs) {
+ /* FIXME: handle type modifiers */
+ field->type = g_memdup (fb->type->type, sizeof (MonoType));
+ field->type->attrs = fb->attrs;
+ } else {
+ field->type = fb->type->type;
+ }
+ if ((fb->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA) && fb->rva_data)
+ field->data = mono_array_addr (fb->rva_data, char, 0);
+ if (fb->offset != -1)
+ field->offset = fb->offset;
+ field->parent = klass;
+ fb->handle = field;
+ mono_save_custom_attrs (klass->image, field, fb->cattrs);
+
+ if (fb->def_value) {
+ MonoDynamicImage *assembly = (MonoDynamicImage*)klass->image;
+ field->type->attrs |= FIELD_ATTRIBUTE_HAS_DEFAULT;
+ idx = encode_constant (assembly, fb->def_value, &field->def_type);
+ /* Copy the data from the blob since it might get realloc-ed */
+ p = assembly->blob.data + idx;
+ len = mono_metadata_decode_blob_size (p, &p2);
+ len += p2 - p;
+ field->data = g_malloc (len);
+ memcpy ((gpointer)field->data, p, len);
+ }
+ }
+ mono_class_layout_fields (klass);
+}
+
+static void
+typebuilder_setup_properties (MonoClass *klass)
+{
+ MonoReflectionTypeBuilder *tb = klass->reflection_info;
+ MonoReflectionPropertyBuilder *pb;
+ int i;
+
+ klass->property.count = tb->properties ? mono_array_length (tb->properties) : 0;
+ klass->property.first = 0;
+ klass->property.last = klass->property.count;
+
+ klass->properties = g_new0 (MonoProperty, klass->property.count);
+ for (i = 0; i < klass->property.count; ++i) {
+ pb = mono_array_get (tb->properties, MonoReflectionPropertyBuilder*, i);
+ klass->properties [i].parent = klass;
+ klass->properties [i].attrs = pb->attrs;
+ klass->properties [i].name = mono_string_to_utf8 (pb->name);
+ if (pb->get_method)
+ klass->properties [i].get = pb->get_method->mhandle;
+ if (pb->set_method)
+ klass->properties [i].set = pb->set_method->mhandle;
+ }
+}
+
+MonoReflectionEvent *
+mono_reflection_event_builder_get_event_info (MonoReflectionTypeBuilder *tb, MonoReflectionEventBuilder *eb)
+{
+ MonoEvent *event = g_new0 (MonoEvent, 1);
+ MonoClass *klass;
+ int j;
+
+ klass = my_mono_class_from_mono_type (tb->type.type);
+
+ event->parent = klass;
+ event->attrs = eb->attrs;
+ event->name = mono_string_to_utf8 (eb->name);
+ if (eb->add_method)
+ event->add = eb->add_method->mhandle;
+ if (eb->remove_method)
+ event->remove = eb->remove_method->mhandle;
+ if (eb->raise_method)
+ event->raise = eb->raise_method->mhandle;
+
+ if (eb->other_methods) {
+ event->other = g_new0 (MonoMethod*, mono_array_length (eb->other_methods) + 1);
+ for (j = 0; j < mono_array_length (eb->other_methods); ++j) {
+ MonoReflectionMethodBuilder *mb =
+ mono_array_get (eb->other_methods,
+ MonoReflectionMethodBuilder*, j);
+ event->other [j] = mb->mhandle;
+ }
+ }
+
+ return mono_event_get_object (mono_object_domain (tb), klass, event);
+}
+
+static void
+typebuilder_setup_events (MonoClass *klass)
+{
+ MonoReflectionTypeBuilder *tb = klass->reflection_info;
+ MonoReflectionEventBuilder *eb;
+ int i, j;
+
+ klass->event.count = tb->events ? mono_array_length (tb->events) : 0;
+ klass->event.first = 0;
+ klass->event.last = klass->event.count;
+
+ klass->events = g_new0 (MonoEvent, klass->event.count);
+ for (i = 0; i < klass->event.count; ++i) {
+ eb = mono_array_get (tb->events, MonoReflectionEventBuilder*, i);
+ klass->events [i].parent = klass;
+ klass->events [i].attrs = eb->attrs;
+ klass->events [i].name = mono_string_to_utf8 (eb->name);
+ if (eb->add_method)
+ klass->events [i].add = eb->add_method->mhandle;
+ if (eb->remove_method)
+ klass->events [i].remove = eb->remove_method->mhandle;
+ if (eb->raise_method)
+ klass->events [i].raise = eb->raise_method->mhandle;
+
+ if (eb->other_methods) {
+ klass->events [i].other = g_new0 (MonoMethod*, mono_array_length (eb->other_methods) + 1);
+ for (j = 0; j < mono_array_length (eb->other_methods); ++j) {
+ MonoReflectionMethodBuilder *mb =
+ mono_array_get (eb->other_methods,
+ MonoReflectionMethodBuilder*, j);
+ klass->events [i].other [j] = mb->mhandle;
+ }
+ }
+ }
+}
+
+MonoReflectionType*
+mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb)
+{
+ MonoClass *klass;
+ MonoReflectionType* res;
+ int i;
+
+ MONO_ARCH_SAVE_REGS;
+
+ klass = my_mono_class_from_mono_type (tb->type.type);
+
+ mono_save_custom_attrs (klass->image, klass, tb->cattrs);
+
+ /*
+ * Fields to set in klass:
+ * the various flags: delegate/unicode/contextbound etc.
+ */
+ klass->flags = tb->attrs;
+
+ if (!((MonoDynamicImage*)(MonoDynamicImage*)klass->image)->run)
+ /* No need to fully construct the type */
+ return mono_type_get_object (mono_object_domain (tb), &klass->byval_arg);
+
+ /* enums are done right away */
+ if (!klass->enumtype)
+ ensure_runtime_vtable (klass);
+
+ if (tb->subtypes) {
+ for (i = 0; i < mono_array_length (tb->subtypes); ++i) {
+ MonoReflectionTypeBuilder *subtb = mono_array_get (tb->subtypes, MonoReflectionTypeBuilder*, i);
+ klass->nested_classes = g_list_prepend (klass->nested_classes, my_mono_class_from_mono_type (subtb->type.type));
+ }
+ }
+
+ /* fields and object layout */
+ if (klass->parent) {
+ if (!klass->parent->size_inited)
+ mono_class_init (klass->parent);
+ klass->instance_size += klass->parent->instance_size;
+ klass->class_size += klass->parent->class_size;
+ klass->min_align = klass->parent->min_align;
+ } else {
+ klass->instance_size = sizeof (MonoObject);
+ klass->min_align = 1;
+ }
+
+ /* FIXME: handle packing_size and instance_size */
+ typebuilder_setup_fields (klass);
+
+ typebuilder_setup_properties (klass);
+
+ typebuilder_setup_events (klass);
+
+ klass->wastypebuilder = TRUE;
+
+ res = mono_type_get_object (mono_object_domain (tb), &klass->byval_arg);
+ g_assert (res != (MonoReflectionType*)tb);
+ return res;
+}
+
+void
+mono_reflection_initialize_generic_parameter (MonoReflectionGenericParam *gparam)
+{
+ MonoGenericParam *param;
+ MonoImage *image;
+
+ MONO_ARCH_SAVE_REGS;
+
+ param = g_new0 (MonoGenericParam, 1);
+
+ if (gparam->mbuilder) {
+ if (!gparam->mbuilder->generic_container)
+ gparam->mbuilder->generic_container = g_new0 (MonoGenericContainer, 1);
+ param->owner = gparam->mbuilder->generic_container;
+ } else if (gparam->tbuilder) {
+ MonoReflectionTypeBuilder *nesting = (MonoReflectionTypeBuilder*) gparam->tbuilder->nesting_type;
+ MonoGenericContainer *container = gparam->tbuilder->generic_container;
+
+ while (nesting) {
+ int count;
+
+ count = nesting->generic_params ? mono_array_length (nesting->generic_params) : 0;
+ if (gparam->index >= count)
+ break;
+
+ container = nesting->generic_container;
+ nesting = (MonoReflectionTypeBuilder*) nesting->nesting_type;
+ }
+
+ g_assert (container);
+ param->owner = container;
+ }
+
+ param->method = NULL;
+ param->name = mono_string_to_utf8 (gparam->name);
+ param->num = gparam->index;
+
+ image = &gparam->tbuilder->module->dynamic_image->image;
+ mono_class_from_generic_parameter (param, image, gparam->mbuilder != NULL);
+
+ param->pklass->reflection_info = gparam;
+
+ gparam->type.type = g_new0 (MonoType, 1);
+ gparam->type.type->type = gparam->mbuilder ? MONO_TYPE_MVAR : MONO_TYPE_VAR;
+ gparam->type.type->attrs = TYPE_ATTRIBUTE_PUBLIC;
+ gparam->type.type->data.generic_param = param;
}
MonoArray *
mono_reflection_sighelper_get_signature_local (MonoReflectionSigHelper *sig)
{
- MonoDynamicAssembly *assembly = sig->module->assemblyb->dynamic_assembly;
+ MonoDynamicImage *assembly = sig->module->dynamic_image;
guint32 na = mono_array_length (sig->arguments);
guint32 buflen, i;
MonoArray *result;
char *buf, *p;
+ MONO_ARCH_SAVE_REGS;
+
p = buf = g_malloc (10 + na * 10);
mono_metadata_encode_value (0x07, p, &p);
@@ -3751,12 +8526,14 @@ mono_reflection_sighelper_get_signature_local (MonoReflectionSigHelper *sig)
MonoArray *
mono_reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig)
{
- MonoDynamicAssembly *assembly = sig->module->assemblyb->dynamic_assembly;
+ MonoDynamicImage *assembly = sig->module->dynamic_image;
guint32 na = mono_array_length (sig->arguments);
guint32 buflen, i;
MonoArray *result;
char *buf, *p;
+ MONO_ARCH_SAVE_REGS;
+
p = buf = g_malloc (10 + na * 10);
mono_metadata_encode_value (0x06, p, &p);
@@ -3774,3 +8551,169 @@ mono_reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig)
return result;
}
+void
+mono_reflection_create_dynamic_method (MonoReflectionDynamicMethod *mb)
+{
+ ReflectionMethodBuilder rmb;
+ MonoMethodSignature *sig;
+ int i;
+
+ sig = dynamic_method_to_signature (mb);
+
+ reflection_methodbuilder_from_dynamic_method (&rmb, mb);
+
+ /*
+ * Resolve references.
+ */
+ rmb.nrefs = mb->nrefs;
+ rmb.refs = g_new0 (gpointer, mb->nrefs + 1);
+ for (i = 0; i < mb->nrefs; ++i) {
+ gpointer ref = resolve_object (mb->module->image,
+ mono_array_get (mb->refs, MonoObject*, i));
+ if (!ref) {
+ g_free (rmb.refs);
+ mono_raise_exception (mono_get_exception_type_load (NULL));
+ return;
+ }
+ rmb.refs [i] = ref;
+ }
+
+ /* FIXME: class */
+ mb->mhandle = reflection_methodbuilder_to_mono_method (mono_defaults.object_class, &rmb, sig);
+
+ g_free (rmb.refs);
+
+ /* ilgen is no longer needed */
+ mb->ilgen = NULL;
+}
+
+/**
+ * mono_reflection_lookup_dynamic_token:
+ *
+ * Finish the Builder object pointed to by TOKEN and return the corresponding
+ * runtime structure.
+ */
+gpointer
+mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token)
+{
+ MonoDynamicImage *assembly = (MonoDynamicImage*)image;
+ MonoObject *obj;
+
+ obj = mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token));
+ g_assert (obj);
+
+ return resolve_object (image, obj);
+}
+
+static gpointer
+resolve_object (MonoImage *image, MonoObject *obj)
+{
+ gpointer result = NULL;
+
+ if (strcmp (obj->vtable->klass->name, "String") == 0) {
+ result = mono_string_intern ((MonoString*)obj);
+ g_assert (result);
+ } else if (strcmp (obj->vtable->klass->name, "MonoType") == 0) {
+ MonoReflectionType *tb = (MonoReflectionType*)obj;
+ result = mono_class_from_mono_type (tb->type);
+ g_assert (result);
+ } else if (strcmp (obj->vtable->klass->name, "MonoMethod") == 0) {
+ result = ((MonoReflectionMethod*)obj)->method;
+ g_assert (result);
+ } else if (strcmp (obj->vtable->klass->name, "MonoCMethod") == 0) {
+ result = ((MonoReflectionMethod*)obj)->method;
+ g_assert (result);
+ } else if (strcmp (obj->vtable->klass->name, "MethodBuilder") == 0) {
+ MonoReflectionMethodBuilder *mb = (MonoReflectionMethodBuilder*)obj;
+ result = mb->mhandle;
+ if (!result) {
+ /* Type is not yet created */
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)mb->type;
+
+ mono_domain_try_type_resolve (mono_domain_get (), NULL, (MonoObject*)tb);
+
+ /*
+ * Hopefully this has been filled in by calling CreateType() on the
+ * TypeBuilder.
+ */
+ /**
+ * TODO: This won't work if the application finishes another
+ * TypeBuilder instance instead of this one.
+ */
+ result = mb->mhandle;
+ }
+ } else if (strcmp (obj->vtable->klass->name, "ConstructorBuilder") == 0) {
+ MonoReflectionCtorBuilder *cb = (MonoReflectionCtorBuilder*)obj;
+
+ result = cb->mhandle;
+ if (!result) {
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)cb->type;
+
+ mono_domain_try_type_resolve (mono_domain_get (), NULL, (MonoObject*)tb);
+ result = cb->mhandle;
+ }
+ } else if (strcmp (obj->vtable->klass->name, "MonoField") == 0) {
+ result = ((MonoReflectionField*)obj)->field;
+ g_assert (result);
+ } else if (strcmp (obj->vtable->klass->name, "FieldBuilder") == 0) {
+ MonoReflectionFieldBuilder *fb = (MonoReflectionFieldBuilder*)obj;
+ result = fb->handle;
+
+ if (!result) {
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)fb->typeb;
+
+ mono_domain_try_type_resolve (mono_domain_get (), NULL, (MonoObject*)tb);
+ result = fb->handle;
+ }
+ } else if (strcmp (obj->vtable->klass->name, "TypeBuilder") == 0) {
+ MonoReflectionTypeBuilder *tb = (MonoReflectionTypeBuilder*)obj;
+ MonoClass *klass;
+
+ klass = tb->type.type->data.klass;
+ if (klass->wastypebuilder) {
+ /* Already created */
+ result = klass;
+ }
+ else {
+ mono_domain_try_type_resolve (mono_domain_get (), NULL, (MonoObject*)tb);
+ result = tb->type.type->data.klass;
+ g_assert (result);
+ }
+ } else if (strcmp (obj->vtable->klass->name, "SignatureHelper") == 0) {
+ MonoReflectionSigHelper *helper = (MonoReflectionSigHelper*)obj;
+ MonoMethodSignature *sig;
+ int nargs, i;
+
+ if (helper->arguments)
+ nargs = mono_array_length (helper->arguments);
+ else
+ nargs = 0;
+
+ sig = mono_metadata_signature_alloc (image, nargs);
+ sig->explicit_this = helper->call_conv & 64;
+ sig->hasthis = helper->call_conv & 32;
+
+ if (helper->call_conv == 0) /* unmanaged */
+ sig->call_convention = helper->unmanaged_call_conv - 1;
+ else
+ if (helper->call_conv & 0x02)
+ sig->call_convention = MONO_CALL_VARARG;
+ else
+ sig->call_convention = MONO_CALL_DEFAULT;
+
+ sig->param_count = nargs;
+ /* TODO: Copy type ? */
+ sig->ret = helper->return_type->type;
+ for (i = 0; i < nargs; ++i) {
+ MonoReflectionType *rt = mono_array_get (helper->arguments, MonoReflectionType*, i);
+ sig->params [i] = rt->type;
+ }
+
+ result = sig;
+ } else {
+ g_print (obj->vtable->klass->name);
+ g_assert_not_reached ();
+ }
+ return result;
+}
+
diff --git a/mono/metadata/reflection.h b/mono/metadata/reflection.h
index 724d7fb2bfd..9a30b6c8f2e 100644
--- a/mono/metadata/reflection.h
+++ b/mono/metadata/reflection.h
@@ -1,430 +1,80 @@
#ifndef __METADATA_REFLECTION_H__
#define __METADATA_REFLECTION_H__
-#include <mono/metadata/image.h>
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/class.h>
#include <mono/metadata/object.h>
-#include <mono/utils/mono-hash.h>
-
-typedef struct {
- GHashTable *hash;
- char *data;
- guint32 alloc_size; /* malloced bytes */
- guint32 index;
- guint32 offset; /* from start of metadata */
-} MonoDynamicStream;
-
-typedef struct {
- guint32 rows;
- guint32 row_size; /* calculated later with column_sizes */
- guint32 columns;
- guint32 column_sizes [9];
- guint32 *values; /* rows * columns */
- guint32 next_idx;
-} MonoDynamicTable;
-
-/*
- * The followinbg structure must match the C# implementation in our corlib.
- */
-
-struct _MonoReflectionMethod {
- MonoObject object;
- MonoMethod *method;
- MonoString *name;
-};
-
-typedef struct {
- MonoObject object;
- MonoObject *target_type;
- MonoObject *target;
- MonoString *method_name;
- gpointer method_ptr;
- gpointer delegate_trampoline;
- MonoReflectionMethod *method_info;
-} MonoDelegate;
-
-typedef struct _MonoMulticastDelegate MonoMulticastDelegate;
-struct _MonoMulticastDelegate {
- MonoDelegate delegate;
- MonoMulticastDelegate *prev;
-};
-
-typedef struct {
- MonoObject object;
- MonoClass *klass;
- MonoClassField *field;
-} MonoReflectionField;
-
-typedef struct {
- MonoObject object;
- MonoClass *klass;
- MonoProperty *property;
-} MonoReflectionProperty;
-
-typedef struct {
- MonoObject object;
- MonoClass *klass;
- MonoEvent *event;
-} MonoReflectionEvent;
-
-typedef struct {
- MonoObject object;
- MonoReflectionType *ClassImpl;
- MonoObject *DefaultValueImpl;
- MonoObject *MemberImpl;
- MonoString *NameImpl;
- gint32 PositionImpl;
- guint32 AttrsImpl;
-} MonoReflectionParameter;
-
-typedef struct {
- MonoObject object;
- MonoAssembly *assembly;
-} MonoReflectionAssembly;
-
-typedef struct {
- MonoReflectionType *utype;
- MonoArray *values;
- MonoArray *names;
-} MonoEnumInfo;
-
-typedef struct {
- MonoReflectionType *parent;
- MonoReflectionType *ret;
- guint32 attrs;
- guint32 implattrs;
-} MonoMethodInfo;
-
-typedef struct {
- MonoReflectionType *parent;
- MonoString *name;
- MonoReflectionMethod *get;
- MonoReflectionMethod *set;
- guint32 attrs;
-} MonoPropertyInfo;
-
-typedef struct {
- MonoReflectionType *parent;
- MonoString *name;
- MonoReflectionMethod *add_method;
- MonoReflectionMethod *remove_method;
- MonoReflectionMethod *raise_method;
- guint32 attrs;
-} MonoEventInfo;
-
-typedef struct {
- MonoReflectionType *parent;
- MonoReflectionType *type;
- MonoString *name;
- guint32 attrs;
-} MonoFieldInfo;
-
-typedef struct {
- MonoString *name;
- MonoString *name_space;
- MonoReflectionType *parent;
- MonoReflectionType *etype;
- MonoReflectionAssembly *assembly;
- guint32 attrs;
- guint32 rank;
- MonoBoolean isbyref, ispointer, isprimitive;
-} MonoTypeInfo;
-
-typedef struct {
- MonoObject *member;
- gint32 code_pos;
-} MonoReflectionILTokenInfo;
-
-typedef struct {
- MonoObject object;
- MonoArray *code;
- MonoObject *mbuilder;
- gint32 code_len;
- gint32 max_stack;
- gint32 cur_stack;
- MonoArray *locals;
- MonoArray *ex_handlers;
- gint32 num_token_fixups;
- MonoArray *token_fixups;
-} MonoReflectionILGen;
-
-typedef struct {
- MonoArray *handlers;
- gint32 start;
- gint32 len;
- gint32 label;
-} MonoILExceptionInfo;
-
-typedef struct {
- MonoReflectionType *extype;
- gint32 type;
- gint32 start;
- gint32 len;
- gint32 filter_offset;
-} MonoILExceptionBlock;
-
-typedef struct {
- MonoObject object;
- MonoReflectionType *type;
- MonoString *name;
-} MonoReflectionLocalBuilder;
-
-typedef struct {
- MonoObject object;
- gint32 count;
- gint32 type;
- gint32 eltype;
-} MonoReflectionMarshal;
-
-typedef struct {
- MonoObject object;
- MonoObject* methodb;
- MonoString *name;
- MonoArray *cattrs;
- MonoReflectionMarshal *marshal_info;
- guint32 attrs;
- int position;
- guint32 table_idx;
-} MonoReflectionParamBuilder;
-
-typedef struct {
- MonoObject object;
- MonoReflectionILGen *ilgen;
- MonoArray *parameters;
- guint32 attrs;
- guint32 iattrs;
- guint32 table_idx;
- guint32 call_conv;
- MonoObject *type;
- MonoArray *pinfo;
- MonoArray *cattrs;
- MonoBoolean init_locals;
-} MonoReflectionCtorBuilder;
-
-typedef struct {
- MonoObject object;
- MonoMethod *mhandle;
- MonoReflectionType *rtype;
- MonoArray *parameters;
- guint32 attrs;
- guint32 iattrs;
- MonoString *name;
- guint32 table_idx;
- MonoArray *code;
- MonoReflectionILGen *ilgen;
- MonoObject *type;
- MonoArray *pinfo;
- MonoArray *cattrs;
- MonoReflectionMethod *override_method;
- MonoString *dll;
- MonoString *dllentry;
- guint32 charset;
- guint32 native_cc;
- guint32 call_conv;
- MonoBoolean init_locals;
-} MonoReflectionMethodBuilder;
-
-typedef struct {
- MonoObject object;
- MonoMethod *mhandle;
- MonoReflectionType *parent;
- MonoReflectionType *ret;
- MonoArray *parameters;
- MonoString *name;
- guint32 table_idx;
- guint32 call_conv;
-} MonoReflectionArrayMethod;
-
-enum {
- MONO_SECTION_TEXT,
- MONO_SECTION_RSRC,
- MONO_SECTION_RELOC,
- MONO_SECTION_MAX
-};
-
-typedef struct {
- MonoAssembly assembly;
- guint32 meta_size;
- guint32 text_rva;
- guint32 metadata_rva;
- guint32 image_base;
- guint32 cli_header_offset;
- guint32 iat_offset;
- guint32 idt_offset;
- guint32 ilt_offset;
- guint32 imp_names_offset;
- struct {
- guint32 rva;
- guint32 size;
- guint32 offset;
- guint32 attrs;
- } sections [MONO_SECTION_MAX];
- GHashTable *typeref;
- GHashTable *handleref;
- GList *array_methods;
- MonoGHashTable *token_fixups;
- MonoDynamicStream pefile;
- MonoDynamicStream sheap;
- MonoDynamicStream code; /* used to store method headers and bytecode */
- MonoDynamicStream us;
- MonoDynamicStream blob;
- MonoDynamicStream tstream;
- MonoDynamicStream guid;
- MonoDynamicTable tables [64];
-} MonoDynamicAssembly;
-
-typedef struct {
- MonoReflectionAssembly assembly;
- MonoDynamicAssembly *dynamic_assembly;
- MonoReflectionMethodBuilder *entry_point;
- MonoArray *modules;
- MonoString *name;
- MonoString *dir;
- MonoArray *cattrs;
-} MonoReflectionAssemblyBuilder;
-
-typedef struct {
- MonoObject object;
- guint32 attrs;
- MonoReflectionType *type;
- MonoString *name;
- MonoObject *def_value;
- gint32 offset;
- gint32 table_idx;
- MonoReflectionType *typeb;
- MonoArray *rva_data;
- MonoArray *cattrs;
- MonoReflectionMarshal *marshal_info;
-} MonoReflectionFieldBuilder;
-
-typedef struct {
- MonoObject object;
- guint32 attrs;
- MonoString *name;
- MonoReflectionType *type;
- MonoArray *parameters;
- MonoArray *cattrs;
- MonoObject *def_value;
- MonoReflectionMethodBuilder *set_method;
- MonoReflectionMethodBuilder *get_method;
- gint32 table_idx;
-} MonoReflectionPropertyBuilder;
-
-typedef struct {
- MonoObject obj;
- MonoImage *image;
- MonoObject *assembly;
- MonoString *fqname;
- MonoString *name;
- MonoString *scopename;
-} MonoReflectionModule;
-
-typedef struct {
- MonoReflectionModule module;
- MonoArray *types;
- MonoArray *cattrs;
- MonoArray *guid;
- guint32 table_idx;
- MonoReflectionAssemblyBuilder *assemblyb;
-} MonoReflectionModuleBuilder;
-
-typedef struct {
- MonoReflectionType type;
- MonoString *name;
- MonoString *nspace;
- MonoReflectionType *parent;
- MonoReflectionType *nesting_type;
- MonoArray *interfaces;
- MonoArray *methods;
- MonoArray *ctors;
- MonoArray *properties;
- MonoArray *fields;
- MonoArray *events;
- MonoArray *cattrs;
- MonoArray *subtypes;
- guint32 attrs;
- guint32 table_idx;
- MonoReflectionModuleBuilder *module;
- gint32 class_size;
- gint32 packing_size;
-} MonoReflectionTypeBuilder;
-
-typedef struct {
- MonoObject obj;
- MonoString *name;
- MonoString *codebase;
- gint32 major, minor, build, revision;
- /* FIXME: add missing stuff */
-} MonoReflectionAssemblyName;
-
-typedef struct {
- MonoObject obj;
- MonoString *name;
- MonoReflectionType *type;
- MonoReflectionTypeBuilder *typeb;
- MonoArray *cattrs;
- MonoReflectionMethodBuilder *add_method;
- MonoReflectionMethodBuilder *remove_method;
- MonoReflectionMethodBuilder *raise_method;
- MonoArray *other_methods;
- guint32 attrs;
- guint32 table_idx;
-} MonoReflectionEventBuilder;
-
-typedef struct {
- MonoObject obj;
- MonoReflectionMethod *ctor;
- MonoArray *data;
-} MonoReflectionCustomAttr;
typedef struct MonoTypeNameParse MonoTypeNameParse;
struct MonoTypeNameParse {
char *name_space;
char *name;
- char *assembly;
+ MonoAssemblyName assembly;
GList *modifiers; /* 0 -> byref, -1 -> pointer, > 0 -> array rank */
GList *nested;
};
typedef struct {
- MonoObject object;
- MonoReflectionModuleBuilder *module;
- MonoArray *arguments;
- guint32 type;
-} MonoReflectionSigHelper;
+ MonoMethod *ctor;
+ guint32 data_size;
+ const guchar* data;
+} MonoCustomAttrEntry;
+typedef struct {
+ int num_attrs;
+ int cached;
+ MonoImage *image;
+ MonoCustomAttrEntry attrs [MONO_ZERO_LEN_ARRAY];
+} MonoCustomAttrInfo;
+/*
+ * Information which isn't in the MonoMethod structure is stored here for
+ * dynamic methods.
+ */
+typedef struct {
+ char **param_names;
+ MonoMarshalSpec **param_marshall;
+ MonoCustomAttrInfo **param_cattr;
+ guint8** param_defaults;
+ char *dllentry, *dll;
+} MonoReflectionMethodAux;
-char* mono_type_get_name (MonoType *type);
-int mono_reflection_parse_type (char *name, MonoTypeNameParse *info);
-MonoType* mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase);
+typedef enum {
+ ResolveTokenError_OutOfRange,
+ ResolveTokenError_BadTable,
+ ResolveTokenError_Other
+} MonoResolveTokenError;
-void mono_image_create_pefile (MonoReflectionAssemblyBuilder *assembly);
-void mono_image_basic_init (MonoReflectionAssemblyBuilder *assembly);
-guint32 mono_image_insert_string (MonoReflectionAssemblyBuilder *assembly, MonoString *str);
-guint32 mono_image_create_token (MonoDynamicAssembly *assembly, MonoObject *obj);
+int mono_reflection_parse_type (char *name, MonoTypeNameParse *info);
+MonoType* mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve);
+MonoType* mono_reflection_type_from_name (char *name, MonoImage *image);
+guint32 mono_reflection_get_token (MonoObject *obj);
MonoReflectionAssembly* mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly);
+MonoReflectionModule* mono_module_get_object (MonoDomain *domain, MonoImage *image);
+MonoReflectionModule* mono_module_file_get_object (MonoDomain *domain, MonoImage *image, int table_index);
MonoReflectionType* mono_type_get_object (MonoDomain *domain, MonoType *type);
-MonoReflectionMethod* mono_method_get_object (MonoDomain *domain, MonoMethod *method);
+MonoReflectionMethod* mono_method_get_object (MonoDomain *domain, MonoMethod *method, MonoClass *refclass);
MonoReflectionField* mono_field_get_object (MonoDomain *domain, MonoClass *klass, MonoClassField *field);
MonoReflectionProperty* mono_property_get_object (MonoDomain *domain, MonoClass *klass, MonoProperty *property);
MonoReflectionEvent* mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event);
/* note: this one is slightly different: we keep the whole array of params in the cache */
-MonoReflectionParameter** mono_param_get_objects (MonoDomain *domain, MonoMethod *method);
+MonoArray* mono_param_get_objects (MonoDomain *domain, MonoMethod *method);
+MonoReflectionMethodBody* mono_method_body_get_object (MonoDomain *domain, MonoMethod *method);
+MonoObject* mono_get_dbnull_object (MonoDomain *domain);
MonoArray* mono_reflection_get_custom_attrs (MonoObject *obj);
-MonoArray* mono_reflection_get_custom_attrs_blob (MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
-
-void mono_reflection_setup_internal_class (MonoReflectionTypeBuilder *tb);
-
-void mono_reflection_create_internal_class (MonoReflectionTypeBuilder *tb);
-
-MonoArray *mono_reflection_sighelper_get_signature_local (MonoReflectionSigHelper *sig);
-
-MonoArray *mono_reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig);
+MonoArray* mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
+
+MonoArray* mono_custom_attrs_construct (MonoCustomAttrInfo *cinfo);
+MonoCustomAttrInfo* mono_custom_attrs_from_index (MonoImage *image, guint32 idx);
+MonoCustomAttrInfo* mono_custom_attrs_from_method (MonoMethod *method);
+MonoCustomAttrInfo* mono_custom_attrs_from_class (MonoClass *klass);
+MonoCustomAttrInfo* mono_custom_attrs_from_assembly (MonoAssembly *assembly);
+MonoCustomAttrInfo* mono_custom_attrs_from_property (MonoClass *klass, MonoProperty *property);
+MonoCustomAttrInfo* mono_custom_attrs_from_event (MonoClass *klass, MonoEvent *event);
+MonoCustomAttrInfo* mono_custom_attrs_from_field (MonoClass *klass, MonoClassField *field);
+MonoCustomAttrInfo* mono_custom_attrs_from_param (MonoMethod *method, guint32 param);
+void mono_custom_attrs_free (MonoCustomAttrInfo *ainfo);
#endif /* __METADATA_REFLECTION_H__ */
diff --git a/mono/metadata/row-indexes.h b/mono/metadata/row-indexes.h
index d611ffaa807..ef8dd498463 100644
--- a/mono/metadata/row-indexes.h
+++ b/mono/metadata/row-indexes.h
@@ -262,6 +262,30 @@ enum {
MONO_TYPESPEC_SIZE
};
+enum {
+ MONO_GENERICPARAM_NUMBER,
+ MONO_GENERICPARAM_FLAGS,
+ MONO_GENERICPARAM_OWNER,
+ MONO_GENERICPARAM_NAME,
+
+ /* Next two soon to be gone */
+ MONO_GENERICPARAM_KIND,
+
+ MONO_GENERICPARAM_SIZE
+};
+
+enum {
+ MONO_METHODSPEC_METHOD,
+ MONO_METHODSPEC_SIGNATURE,
+ MONO_METHODSPEC_SIZE
+};
+
+enum {
+ MONO_GENPARCONSTRAINT_GENERICPAR,
+ MONO_GENPARCONSTRAINT_CONSTRAINT,
+ MONO_GENPARCONSTRAINT_SIZE
+};
+
/*
* Coded Tokens
* The _BITS entry is for the bits used in the token.
@@ -269,117 +293,126 @@ enum {
*/
enum {
- TYPEDEFORREF_TYPEDEF,
- TYPEDEFORREF_TYPEREF,
- TYPEDEFORREF_TYPESPEC,
- TYPEDEFORREF_BITS = 2,
- TYPEDEFORREF_MASK = 3
+ MONO_TYPEDEFORREF_TYPEDEF,
+ MONO_TYPEDEFORREF_TYPEREF,
+ MONO_TYPEDEFORREF_TYPESPEC,
+ MONO_TYPEDEFORREF_BITS = 2,
+ MONO_TYPEDEFORREF_MASK = 3
};
enum {
- HASCONSTANT_FIEDDEF,
- HASCONSTANT_PARAM,
- HASCONSTANT_PROPERTY,
- HASCONSTANT_BITS = 2,
- HASCONSTANT_MASK = 3
+ MONO_HASCONSTANT_FIEDDEF,
+ MONO_HASCONSTANT_PARAM,
+ MONO_HASCONSTANT_PROPERTY,
+ MONO_HASCONSTANT_BITS = 2,
+ MONO_HASCONSTANT_MASK = 3
};
enum {
- CUSTOM_ATTR_METHODDEF,
- CUSTOM_ATTR_FIELDDEF,
- CUSTOM_ATTR_TYPEREF,
- CUSTOM_ATTR_TYPEDEF,
- CUSTOM_ATTR_PARAMDEF,
- CUSTOM_ATTR_INTERFACE,
- CUSTOM_ATTR_MEMBERREF,
- CUSTOM_ATTR_MODULE,
- CUSTOM_ATTR_PERMISSION,
- CUSTOM_ATTR_PROPERTY,
- CUSTOM_ATTR_EVENT,
- CUSTOM_ATTR_SIGNATURE,
- CUSTOM_ATTR_MODULEREF,
- CUSTOM_ATTR_TYPESPEC,
- CUSTOM_ATTR_ASSEMBLY,
- CUSTOM_ATTR_ASSEMBLYREF,
- CUSTOM_ATTR_FILE,
- CUSTOM_ATTR_EXP_TYPE,
- CUSTOM_ATTR_MANIFEST,
- CUSTOM_ATTR_BITS = 5,
- CUSTOM_ATTR_MASK = 0x1F
+ MONO_CUSTOM_ATTR_METHODDEF,
+ MONO_CUSTOM_ATTR_FIELDDEF,
+ MONO_CUSTOM_ATTR_TYPEREF,
+ MONO_CUSTOM_ATTR_TYPEDEF,
+ MONO_CUSTOM_ATTR_PARAMDEF,
+ MONO_CUSTOM_ATTR_INTERFACE,
+ MONO_CUSTOM_ATTR_MEMBERREF,
+ MONO_CUSTOM_ATTR_MODULE,
+ MONO_CUSTOM_ATTR_PERMISSION,
+ MONO_CUSTOM_ATTR_PROPERTY,
+ MONO_CUSTOM_ATTR_EVENT,
+ MONO_CUSTOM_ATTR_SIGNATURE,
+ MONO_CUSTOM_ATTR_MODULEREF,
+ MONO_CUSTOM_ATTR_TYPESPEC,
+ MONO_CUSTOM_ATTR_ASSEMBLY,
+ MONO_CUSTOM_ATTR_ASSEMBLYREF,
+ MONO_CUSTOM_ATTR_FILE,
+ MONO_CUSTOM_ATTR_EXP_TYPE,
+ MONO_CUSTOM_ATTR_MANIFEST,
+ MONO_CUSTOM_ATTR_GENERICPAR,
+ MONO_CUSTOM_ATTR_BITS = 5,
+ MONO_CUSTOM_ATTR_MASK = 0x1F
};
enum {
- HAS_FIELD_MARSHAL_FIELDSREF,
- HAS_FIELD_MARSHAL_PARAMDEF,
- HAS_FIELD_MARSHAL_BITS = 1,
- HAS_FIELD_MARSHAL_MASK = 1
+ MONO_HAS_FIELD_MARSHAL_FIELDSREF,
+ MONO_HAS_FIELD_MARSHAL_PARAMDEF,
+ MONO_HAS_FIELD_MARSHAL_BITS = 1,
+ MONO_HAS_FIELD_MARSHAL_MASK = 1
};
enum {
- HAS_DECL_SECURITY_TYPEDEF,
- HAS_DECL_SECURITY_METHODDEF,
- HAS_DECL_SECURITY_ASSEMBLY,
- HAS_DECL_SECURITY_BITS = 2,
- HAS_DECL_SECURITY_MASK = 3
+ MONO_HAS_DECL_SECURITY_TYPEDEF,
+ MONO_HAS_DECL_SECURITY_METHODDEF,
+ MONO_HAS_DECL_SECURITY_ASSEMBLY,
+ MONO_HAS_DECL_SECURITY_BITS = 2,
+ MONO_HAS_DECL_SECURITY_MASK = 3
};
enum {
- MEMBERREF_PARENT_TYPEDEF, /* not used */
- MEMBERREF_PARENT_TYPEREF,
- MEMBERREF_PARENT_MODULEREF,
- MEMBERREF_PARENT_METHODDEF,
- MEMBERREF_PARENT_TYPESPEC,
- MEMBERREF_PARENT_BITS = 3,
- MEMBERREF_PARENT_MASK = 7
+ MONO_MEMBERREF_PARENT_TYPEDEF, /* not used */
+ MONO_MEMBERREF_PARENT_TYPEREF,
+ MONO_MEMBERREF_PARENT_MODULEREF,
+ MONO_MEMBERREF_PARENT_METHODDEF,
+ MONO_MEMBERREF_PARENT_TYPESPEC,
+ MONO_MEMBERREF_PARENT_BITS = 3,
+ MONO_MEMBERREF_PARENT_MASK = 7
};
enum {
- HAS_SEMANTICS_EVENT,
- HAS_SEMANTICS_PROPERTY,
- HAS_SEMANTICS_BITS = 1,
- HAS_SEMANTICS_MASK = 1
+ MONO_HAS_SEMANTICS_EVENT,
+ MONO_HAS_SEMANTICS_PROPERTY,
+ MONO_HAS_SEMANTICS_BITS = 1,
+ MONO_HAS_SEMANTICS_MASK = 1
};
enum {
- METHODDEFORREF_METHODDEF,
- METHODDEFORREF_METHODREF,
- METHODDEFORREF_BITS = 1,
- METHODDEFORREF_MASK = 1
+ MONO_METHODDEFORREF_METHODDEF,
+ MONO_METHODDEFORREF_METHODREF,
+ MONO_METHODDEFORREF_BITS = 1,
+ MONO_METHODDEFORREF_MASK = 1
};
enum {
- MEMBERFORWD_FIELDDEF,
- MEMBERFORWD_METHODDEF,
- MEMBERFORWD_BITS = 1,
- MEMBERFORWD_MASK = 1
+ MONO_MEMBERFORWD_FIELDDEF,
+ MONO_MEMBERFORWD_METHODDEF,
+ MONO_MEMBERFORWD_BITS = 1,
+ MONO_MEMBERFORWD_MASK = 1
};
enum {
- IMPLEMENTATION_FILE,
- IMPLEMENTATION_ASSEMBLYREF,
- IMPLEMENTATION_EXP_TYPE,
- IMPLEMENTATION_BITS = 2,
- IMPLEMENTATION_MASK = 3
+ MONO_IMPLEMENTATION_FILE,
+ MONO_IMPLEMENTATION_ASSEMBLYREF,
+ MONO_IMPLEMENTATION_EXP_TYPE,
+ MONO_IMPLEMENTATION_BITS = 2,
+ MONO_IMPLEMENTATION_MASK = 3
};
enum {
- CUSTOM_ATTR_TYPE_TYPEREF, /* not used */
- CUSTOM_ATTR_TYPE_TYPEDEF, /* not used */
- CUSTOM_ATTR_TYPE_METHODDEF,
- CUSTOM_ATTR_TYPE_MEMBERREF,
- CUSTOM_ATTR_TYPE_STRING, /* not used */
- CUSTOM_ATTR_TYPE_BITS = 3,
- CUSTOM_ATTR_TYPE_MASK = 7
+ MONO_CUSTOM_ATTR_TYPE_TYPEREF, /* not used */
+ MONO_CUSTOM_ATTR_TYPE_TYPEDEF, /* not used */
+ MONO_CUSTOM_ATTR_TYPE_METHODDEF,
+ MONO_CUSTOM_ATTR_TYPE_MEMBERREF,
+ MONO_CUSTOM_ATTR_TYPE_STRING, /* not used */
+ MONO_CUSTOM_ATTR_TYPE_BITS = 3,
+ MONO_CUSTOM_ATTR_TYPE_MASK = 7
};
enum {
- RESOLTION_SCOPE_MODULE,
- RESOLTION_SCOPE_MODULEREF,
- RESOLTION_SCOPE_ASSEMBLYREF,
- RESOLTION_SCOPE_TYPEREF,
- RESOLTION_SCOPE_BITS = 2,
- RESOLTION_SCOPE_MASK = 3
+ MONO_RESOLTION_SCOPE_MODULE,
+ MONO_RESOLTION_SCOPE_MODULEREF,
+ MONO_RESOLTION_SCOPE_ASSEMBLYREF,
+ MONO_RESOLTION_SCOPE_TYPEREF,
+ MONO_RESOLTION_SCOPE_BITS = 2,
+ MONO_RESOLTION_SCOPE_MASK = 3
+};
+
+enum {
+ MONO_TYPEORMETHOD_TYPE,
+ MONO_TYPEORMETHOD_METHOD,
+ MONO_TYPEORMETHOD_BITS = 1,
+ MONO_TYPEORMETHOD_MASK = 1
};
#endif /* __MONO_METADATA_ROW_INDEXES_H__ */
+
diff --git a/mono/metadata/sample-bundle b/mono/metadata/sample-bundle
new file mode 100644
index 00000000000..ef8bbb380f2
--- /dev/null
+++ b/mono/metadata/sample-bundle
@@ -0,0 +1,5 @@
+# sample bundle template for use with the configure option --with-bundle=...
+
+console: ../tests/console.exe
+mscorlib: /usr/local/lib/corlib.dll
+
diff --git a/mono/metadata/security.c b/mono/metadata/security.c
new file mode 100644
index 00000000000..8620fafbca5
--- /dev/null
+++ b/mono/metadata/security.c
@@ -0,0 +1,934 @@
+/*
+ * security.c: Security internal calls
+ *
+ * Author:
+ * Sebastien Pouliot <sebastien@ximian.com>
+ *
+ * (C) 2004 Novell (http://www.novell.com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/security.h>
+#include <mono/io-layer/io-layer.h>
+#include <mono/utils/strenc.h>
+
+#ifdef PLATFORM_WIN32
+
+#include <aclapi.h>
+#include <accctrl.h>
+
+#ifndef PROTECTED_DACL_SECURITY_INFORMATION
+#define PROTECTED_DACL_SECURITY_INFORMATION 0x80000000L
+#endif
+
+#else
+
+#include <config.h>
+#include <grp.h>
+#include <pwd.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* Disclaimers */
+
+#if defined(__GNUC__)
+
+#ifndef HAVE_GETGRGID_R
+ #warning Non-thread safe getgrgid being used!
+#endif
+#ifndef HAVE_GETGRNAM_R
+ #warning Non-thread safe getgrnam being used!
+#endif
+#ifndef HAVE_GETPWNAM_R
+ #warning Non-thread safe getpwnam being used!
+#endif
+#ifndef HAVE_GETPWUID_R
+ #warning Non-thread safe getpwuid being used!
+#endif
+
+#endif /* defined(__GNUC__) */
+
+#endif /* not PLATFORM_WIN32 */
+
+
+/* internal functions - reuse driven */
+
+#ifdef PLATFORM_WIN32
+
+/* ask a server to translate a SID into a textual representation */
+static gunichar2*
+GetSidName (gunichar2 *server, PSID sid, gint32 *size)
+{
+ gunichar2 *uniname = NULL;
+ DWORD cchName = 0;
+ DWORD cchDomain = 0;
+ SID_NAME_USE peUse; /* out */
+
+ LookupAccountSid (server, sid, NULL, &cchName, NULL,
+ &cchDomain, &peUse);
+
+ if ((cchName > 0) && (cchDomain > 0)) {
+ gunichar2 *user = g_malloc0 ((cchName + 1) * 2);
+ gunichar2 *domain = g_malloc0 ((cchDomain + 1) * 2);
+
+ LookupAccountSid (server, sid, user, &cchName, domain,
+ &cchDomain, &peUse);
+
+ if (cchName > 0) {
+ if (cchDomain > 0) {
+ /* domain/machine name included (+ sepearator) */
+ *size = cchName + cchDomain + 1;
+ uniname = g_malloc0 ((*size + 1) * 2);
+ memcpy (uniname, domain, cchDomain * 2);
+ *(uniname + cchDomain) = '\\';
+ memcpy (uniname + cchDomain + 1, user, cchName * 2);
+ g_free (user);
+ }
+ else {
+ /* no domain / machine */
+ *size = cchName;
+ uniname = user;
+ }
+ }
+ else {
+ /* nothing -> return NULL */
+ g_free (user);
+ }
+
+ g_free (domain);
+ }
+
+ return uniname;
+}
+
+
+#else /* not PLATFORM_WIN32 */
+
+
+static gchar*
+GetTokenName (uid_t uid)
+{
+ gchar *uname = NULL;
+
+#ifdef HAVE_GETPWUID_R
+ struct passwd pwd;
+ size_t fbufsize;
+ gchar *fbuf;
+ gint32 retval;
+#endif
+ struct passwd *p = NULL;
+ gboolean result;
+
+#ifdef HAVE_GETPWUID_R
+#ifdef _SC_GETPW_R_SIZE_MAX
+ fbufsize = (size_t) sysconf (_SC_GETPW_R_SIZE_MAX);
+#else
+ fbufsize = (size_t) 1024;
+#endif
+ fbuf = g_malloc0 (fbufsize);
+ retval = getpwuid_r (uid, &pwd, fbuf, fbufsize, &p);
+ result = ((retval == 0) && (p == &pwd));
+#else
+ /* default to non thread-safe but posix compliant function */
+ p = getpwuid (uid);
+ result = (p != NULL);
+#endif
+
+ if (result) {
+ uname = g_strdup (p->pw_name);
+ }
+
+#ifdef HAVE_GETPWUID_R
+ g_free (fbuf);
+#endif
+
+ return uname;
+}
+
+
+static gboolean
+IsMemberInList (uid_t user, struct group *g)
+{
+ gboolean result = FALSE;
+ gchar *utf8_username = GetTokenName (user);
+
+ if (!utf8_username)
+ return FALSE;
+
+ if (g) {
+ gchar **users = g->gr_mem;
+
+ while (*users) {
+ gchar *u = *(users);
+ if (strcmp (utf8_username, u) == 0) {
+ result = TRUE;
+ break;
+ }
+ users++;
+ }
+ }
+
+ g_free (utf8_username);
+ return result;
+}
+
+
+static gboolean
+IsDefaultGroup (uid_t user, gid_t group)
+{
+#ifdef HAVE_GETPWUID_R
+ struct passwd pwd;
+ size_t fbufsize;
+ gchar *fbuf;
+ gint32 retval;
+#endif
+ struct passwd *p = NULL;
+ gboolean result;
+
+#ifdef HAVE_GETPWUID_R
+#ifdef _SC_GETPW_R_SIZE_MAX
+ fbufsize = (size_t) sysconf (_SC_GETPW_R_SIZE_MAX);
+#else
+ fbufsize = (size_t) 1024;
+#endif
+
+ fbuf = g_malloc0 (fbufsize);
+ retval = getpwuid_r (user, &pwd, fbuf, fbufsize, &p);
+ result = ((retval == 0) && (p == &pwd));
+#else
+ /* default to non thread-safe but posix compliant function */
+ p = getpwuid (user);
+ result = (p != NULL);
+#endif
+
+ if (result) {
+ result = (p->pw_gid == group);
+ }
+
+#ifdef HAVE_GETPWUID_R
+ g_free (fbuf);
+#endif
+
+ return result;
+}
+
+
+static gboolean
+IsMemberOf (gid_t user, struct group *g)
+{
+ if (!g)
+ return FALSE;
+
+ /* is it the user default group */
+ if (IsDefaultGroup (user, g->gr_gid))
+ return TRUE;
+
+ /* is the user in the group list */
+ return IsMemberInList (user, g);
+}
+
+#endif
+
+
+/* ICALLS */
+
+
+/* System.Environment */
+
+
+MonoString*
+ves_icall_System_Environment_get_UserName (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* using glib is more portable */
+ return mono_string_new (mono_domain_get (), g_get_user_name ());
+}
+
+
+/* System.Security.Principal.WindowsIdentity */
+
+
+gpointer
+ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void)
+{
+ gpointer token = NULL;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef PLATFORM_WIN32
+ /* Note: This isn't a copy of the Token - we must not close it!!!
+ * http://www.develop.com/kbrown/book/html/whatis_windowsprincipal.html
+ */
+
+ /* thread may be impersonating somebody */
+ if (OpenThreadToken (GetCurrentThread (), TOKEN_QUERY, 1, &token) == 0) {
+ /* if not take the process identity */
+ OpenProcessToken (GetCurrentProcess (), TOKEN_QUERY, &token);
+ }
+#else
+ token = (gpointer) geteuid ();
+#endif
+ return token;
+}
+
+
+MonoString*
+ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token)
+{
+ MonoString *result = NULL;
+ gunichar2 *uniname = NULL;
+ gint32 size = 0;
+
+#ifdef PLATFORM_WIN32
+ MONO_ARCH_SAVE_REGS;
+
+ GetTokenInformation (token, TokenUser, NULL, size, (PDWORD)&size);
+ if (size > 0) {
+ TOKEN_USER *tu = g_malloc0 (size);
+ if (GetTokenInformation (token, TokenUser, tu, size, (PDWORD)&size)) {
+ uniname = GetSidName (NULL, tu->User.Sid, &size);
+ }
+ g_free (tu);
+ }
+#else
+ gchar *uname = GetTokenName ((uid_t) token);
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (uname) {
+ size = strlen (uname);
+ uniname = g_utf8_to_utf16 (uname, size, NULL, NULL, NULL);
+ g_free (uname);
+ }
+#endif /* PLATFORM_WIN32 */
+
+ if (size > 0) {
+ result = mono_string_new_utf16 (mono_domain_get (), uniname, size);
+ }
+ else
+ result = mono_string_new (mono_domain_get (), "");
+
+ if (uniname)
+ g_free (uniname);
+
+ return result;
+}
+
+
+gpointer
+ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *username)
+{
+#ifdef PLATFORM_WIN32
+ gpointer token = NULL;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* TODO: MS has something like this working in Windows 2003 (client and
+ * server) but works only for domain accounts (so it's quite limiting).
+ * http://www.develop.com/kbrown/book/html/howto_logonuser.html
+ */
+ g_warning ("Unsupported on Win32 (anyway requires W2K3 minimum)");
+
+#else /* PLATFORM_WIN32*/
+
+#ifdef HAVE_GETPWNAM_R
+ struct passwd pwd;
+ size_t fbufsize;
+ gchar *fbuf;
+ gint32 retval;
+#endif
+ gpointer token = (gpointer) -2;
+ struct passwd *p;
+ gchar *utf8_name;
+ gboolean result;
+
+ MONO_ARCH_SAVE_REGS;
+
+ utf8_name = mono_unicode_to_external (mono_string_chars (username));
+
+#ifdef HAVE_GETPWNAM_R
+#ifdef _SC_GETPW_R_SIZE_MAX
+ fbufsize = (size_t) sysconf (_SC_GETPW_R_SIZE_MAX);
+#else
+ fbufsize = (size_t) 1024;
+#endif
+
+ fbuf = g_malloc0 (fbufsize);
+ retval = getpwnam_r (utf8_name, &pwd, fbuf, fbufsize, &p);
+ result = ((retval == 0) && (p == &pwd));
+#else
+ /* default to non thread-safe but posix compliant function */
+ p = getpwnam (utf8_name);
+ result = (p != NULL);
+#endif
+
+ if (result) {
+ token = (gpointer) p->pw_uid;
+ }
+
+#ifdef HAVE_GETPWNAM_R
+ g_free (fbuf);
+#endif
+ g_free (utf8_name);
+#endif
+ return token;
+}
+
+
+/* http://www.dotnet247.com/247reference/msgs/39/195403.aspx
+// internal static string[] WindowsIdentity._GetRoles (IntPtr token)
+*/
+MonoArray*
+ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token)
+{
+ MonoArray *array = NULL;
+ MonoDomain *domain = mono_domain_get ();
+#ifdef PLATFORM_WIN32
+ gint32 size = 0;
+
+ MONO_ARCH_SAVE_REGS;
+
+ GetTokenInformation (token, TokenGroups, NULL, size, (PDWORD)&size);
+ if (size > 0) {
+ TOKEN_GROUPS *tg = g_malloc0 (size);
+ if (GetTokenInformation (token, TokenGroups, tg, size, (PDWORD)&size)) {
+ int i=0;
+ int num = tg->GroupCount;
+
+ array = mono_array_new (domain, mono_get_string_class (), num);
+
+ for (i=0; i < num; i++) {
+ gint32 size = 0;
+ gunichar2 *uniname = GetSidName (NULL, tg->Groups [i].Sid, &size);
+
+ if (uniname) {
+ MonoString *str = mono_string_new_utf16 (domain, uniname, size);
+ mono_array_set (array, MonoString *, i, str);
+ g_free (uniname);
+ }
+ }
+ }
+ g_free (tg);
+ }
+#else
+ /* POSIX-compliant systems should use IsMemberOfGroupId or IsMemberOfGroupName */
+ g_warning ("WindowsIdentity._GetRoles should never be called on POSIX");
+#endif
+ if (!array) {
+ /* return empty array of string, i.e. string [0] */
+ array = mono_array_new (domain, mono_get_string_class (), 0);
+ }
+ return array;
+}
+
+
+/* System.Security.Principal.WindowsImpersonationContext */
+
+
+gboolean
+ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken (gpointer token)
+{
+ gboolean result = TRUE;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef PLATFORM_WIN32
+ result = (CloseHandle (token) != 0);
+#endif
+ return result;
+}
+
+
+gpointer
+ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token)
+{
+ gpointer dupe = NULL;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef PLATFORM_WIN32
+ if (DuplicateToken (token, SecurityImpersonation, &dupe) == 0) {
+ dupe = NULL;
+ }
+#else
+ dupe = token;
+#endif
+ return dupe;
+}
+
+
+gboolean
+ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken (gpointer token)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* Posix version implemented in /mono/mono/io-layer/security.c */
+ return (ImpersonateLoggedOnUser (token) != 0);
+}
+
+
+gboolean
+ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf (void)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ /* Posix version implemented in /mono/mono/io-layer/security.c */
+ return (RevertToSelf () != 0);
+}
+
+
+/* System.Security.Principal.WindowsPrincipal */
+
+gboolean
+ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer user, gpointer group)
+{
+ gboolean result = FALSE;
+
+#ifdef PLATFORM_WIN32
+ MONO_ARCH_SAVE_REGS;
+
+ /* The convertion from an ID to a string is done in managed code for Windows */
+ g_warning ("IsMemberOfGroupId should never be called on Win32");
+
+#else /* PLATFORM_WIN32 */
+
+#ifdef HAVE_GETGRGID_R
+ struct group grp;
+ size_t fbufsize;
+ gchar *fbuf;
+ gint32 retval;
+#endif
+ struct group *g = NULL;
+
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef HAVE_GETGRGID_R
+#ifdef _SC_GETGR_R_SIZE_MAX
+ fbufsize = (size_t) sysconf (_SC_GETGR_R_SIZE_MAX);
+#else
+ fbufsize = (size_t) 1024;
+#endif
+ fbuf = g_malloc0 (fbufsize);
+ retval = getgrgid_r ((gid_t) group, &grp, fbuf, fbufsize, &g);
+ result = ((retval == 0) && (g == &grp));
+#else
+ /* default to non thread-safe but posix compliant function */
+ g = getgrgid ((gid_t) group);
+ result = (g != NULL);
+#endif
+
+ if (result) {
+ result = IsMemberOf ((uid_t) user, g);
+ }
+
+#ifdef HAVE_GETGRGID_R
+ g_free (fbuf);
+#endif
+
+#endif /* PLATFORM_WIN32 */
+
+ return result;
+}
+
+
+gboolean
+ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpointer user, MonoString *group)
+{
+ gboolean result = FALSE;
+
+#ifdef PLATFORM_WIN32
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* Windows version use a cache built using WindowsIdentity._GetRoles */
+ g_warning ("IsMemberOfGroupName should never be called on Win32");
+
+#else /* PLATFORM_WIN32 */
+ gchar *utf8_groupname;
+
+ MONO_ARCH_SAVE_REGS;
+
+ utf8_groupname = mono_unicode_to_external (mono_string_chars (group));
+ if (utf8_groupname) {
+ struct group *g = NULL;
+#ifdef HAVE_GETGRNAM_R
+ struct group grp;
+ gchar *fbuf;
+ gint32 retval;
+#ifdef _SC_GETGR_R_SIZE_MAX
+ size_t fbufsize = (size_t) sysconf (_SC_GETGR_R_SIZE_MAX);
+#else
+ size_t fbufsize = (size_t) 1024;
+#endif
+ fbuf = g_malloc0 (fbufsize);
+ retval = getgrnam_r (utf8_groupname, &grp, fbuf, fbufsize, &g);
+ result = ((retval == 0) && (g == &grp));
+#else
+ /* default to non thread-safe but posix compliant function */
+ g = getgrnam (utf8_groupname);
+ result = (g != NULL);
+#endif
+
+ if (result) {
+ result = IsMemberOf ((uid_t) user, g);
+ }
+
+#ifdef HAVE_GETGRNAM_R
+ g_free (fbuf);
+#endif
+ g_free (utf8_groupname);
+ }
+#endif /* PLATFORM_WIN32 */
+
+ return result;
+}
+
+
+/* Mono.Security.Cryptography IO related internal calls */
+
+#ifdef PLATFORM_WIN32
+
+static PSID
+GetAdministratorsSid (void)
+{
+ SID_IDENTIFIER_AUTHORITY admins = SECURITY_NT_AUTHORITY;
+ PSID pSid = NULL;
+ if (!AllocateAndInitializeSid (&admins, 2, SECURITY_BUILTIN_DOMAIN_RID,
+ DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSid))
+ return NULL;
+ /* Note: this SID must be freed with FreeSid () */
+ return pSid;
+}
+
+
+static PSID
+GetEveryoneSid (void)
+{
+ SID_IDENTIFIER_AUTHORITY everyone = SECURITY_WORLD_SID_AUTHORITY;
+ PSID pSid = NULL;
+ if (!AllocateAndInitializeSid (&everyone, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &pSid))
+ return NULL;
+ /* Note: this SID must be freed with FreeSid () */
+ return pSid;
+}
+
+
+static PSID
+GetCurrentUserSid (void)
+{
+ PSID sid = NULL;
+ guint32 size = 0;
+ gpointer token = ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken ();
+
+ GetTokenInformation (token, TokenUser, NULL, size, (PDWORD)&size);
+ if (size > 0) {
+ TOKEN_USER *tu = g_malloc0 (size);
+ if (GetTokenInformation (token, TokenUser, tu, size, (PDWORD)&size)) {
+ DWORD length = GetLengthSid (tu->User.Sid);
+ sid = (PSID) g_malloc0 (length);
+ if (!CopySid (length, sid, tu->User.Sid)) {
+ g_free (sid);
+ sid = NULL;
+ }
+ }
+ g_free (tu);
+ }
+ /* Note: this SID must be freed with g_free () */
+ return sid;
+}
+
+
+static ACCESS_MASK
+GetRightsFromSid (PSID sid, PACL acl)
+{
+ ACCESS_MASK rights = 0;
+ TRUSTEE trustee;
+
+ BuildTrusteeWithSidW (&trustee, sid);
+ if (GetEffectiveRightsFromAcl (acl, &trustee, &rights) != ERROR_SUCCESS)
+ return 0;
+
+ return rights;
+}
+
+
+static gboolean
+IsMachineProtected (gunichar2 *path)
+{
+ gboolean success = FALSE;
+ PACL pDACL = NULL;
+ PSID pEveryoneSid = NULL;
+
+ DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, NULL);
+ if (dwRes != ERROR_SUCCESS)
+ return FALSE;
+
+ /* We check that Everyone is still limited to READ-ONLY -
+ but not if new entries have been added by an Administrator */
+
+ pEveryoneSid = GetEveryoneSid ();
+ if (pEveryoneSid) {
+ ACCESS_MASK rights = GetRightsFromSid (pEveryoneSid, pDACL);
+ /* http://msdn.microsoft.com/library/en-us/security/security/generic_access_rights.asp?frame=true */
+ success = (rights == (READ_CONTROL | SYNCHRONIZE | FILE_READ_DATA | FILE_READ_EA | FILE_READ_ATTRIBUTES));
+ FreeSid (pEveryoneSid);
+ }
+ /* Note: we don't need to check our own access -
+ we'll know soon enough when reading the file */
+
+ if (pDACL)
+ LocalFree (pDACL);
+
+ return success;
+}
+
+
+static gboolean
+IsUserProtected (gunichar2 *path)
+{
+ gboolean success = FALSE;
+ PACL pDACL = NULL;
+ PSID pEveryoneSid = NULL;
+
+ DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, NULL);
+ if (dwRes != ERROR_SUCCESS)
+ return FALSE;
+
+ /* We check that our original entries in the ACL are in place -
+ but not if new entries have been added by the user */
+
+ /* Everyone should be denied */
+ pEveryoneSid = GetEveryoneSid ();
+ if (pEveryoneSid) {
+ ACCESS_MASK rights = GetRightsFromSid (pEveryoneSid, pDACL);
+ success = (rights == 0);
+ FreeSid (pEveryoneSid);
+ }
+ /* Note: we don't need to check our own access -
+ we'll know soon enough when reading the file */
+
+ if (pDACL)
+ LocalFree (pDACL);
+
+ return success;
+}
+
+
+static gboolean
+ProtectMachine (gunichar2 *path)
+{
+ PSID pEveryoneSid = GetEveryoneSid ();
+ PSID pAdminsSid = GetAdministratorsSid ();
+ DWORD retval = -1;
+
+ if (pEveryoneSid && pAdminsSid) {
+ PACL pDACL = NULL;
+ EXPLICIT_ACCESS ea [2];
+ ZeroMemory (&ea, 2 * sizeof (EXPLICIT_ACCESS));
+
+ /* grant all access to the BUILTIN\Administrators group */
+ BuildTrusteeWithSidW (&ea [0].Trustee, pAdminsSid);
+ ea [0].grfAccessPermissions = GENERIC_ALL;
+ ea [0].grfAccessMode = SET_ACCESS;
+ ea [0].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
+ ea [0].Trustee.TrusteeForm = TRUSTEE_IS_SID;
+ ea [0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
+
+ /* read-only access everyone */
+ BuildTrusteeWithSidW (&ea [1].Trustee, pEveryoneSid);
+ ea [1].grfAccessPermissions = GENERIC_READ;
+ ea [1].grfAccessMode = SET_ACCESS;
+ ea [1].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
+ ea [1].Trustee.TrusteeForm = TRUSTEE_IS_SID;
+ ea [1].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
+
+ retval = SetEntriesInAcl (2, ea, NULL, &pDACL);
+ if (retval == ERROR_SUCCESS) {
+ /* with PROTECTED_DACL_SECURITY_INFORMATION we */
+ /* remove any existing ACL (like inherited ones) */
+ retval = SetNamedSecurityInfo (path, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION,
+ NULL, NULL, pDACL, NULL);
+ }
+ if (pDACL)
+ LocalFree (pDACL);
+ }
+
+ if (pEveryoneSid)
+ FreeSid (pEveryoneSid);
+ if (pAdminsSid)
+ FreeSid (pAdminsSid);
+ return (retval == ERROR_SUCCESS);
+}
+
+
+static gboolean
+ProtectUser (gunichar2 *path)
+{
+ DWORD retval = -1;
+
+ PSID pCurrentSid = GetCurrentUserSid ();
+ if (pCurrentSid) {
+ PACL pDACL = NULL;
+ EXPLICIT_ACCESS ea;
+ ZeroMemory (&ea, sizeof (EXPLICIT_ACCESS));
+
+ /* grant exclusive access to the current user */
+ BuildTrusteeWithSidW (&ea.Trustee, pCurrentSid);
+ ea.grfAccessPermissions = GENERIC_ALL;
+ ea.grfAccessMode = SET_ACCESS;
+ ea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
+ ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
+ ea.Trustee.TrusteeType = TRUSTEE_IS_USER;
+
+ retval = SetEntriesInAcl (1, &ea, NULL, &pDACL);
+ if (retval == ERROR_SUCCESS) {
+ /* with PROTECTED_DACL_SECURITY_INFORMATION we
+ remove any existing ACL (like inherited ones) */
+ retval = SetNamedSecurityInfo (path, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION | PROTECTED_DACL_SECURITY_INFORMATION,
+ NULL, NULL, pDACL, NULL);
+ }
+
+ if (pDACL)
+ LocalFree (pDACL);
+ g_free (pCurrentSid); /* g_malloc0 */
+ }
+
+ return (retval == ERROR_SUCCESS);
+}
+
+#else
+
+static gboolean
+IsProtected (MonoString *path, gint32 protection)
+{
+ gboolean result = FALSE;
+ gchar *utf8_name = mono_unicode_to_external (mono_string_chars (path));
+ if (utf8_name) {
+ struct stat st;
+ if (stat (utf8_name, &st) == 0) {
+ result = (((st.st_mode & 0777) & protection) == 0);
+ }
+ g_free (utf8_name);
+ }
+ return result;
+}
+
+
+static gboolean
+Protect (MonoString *path, gint32 file_mode, gint32 add_dir_mode)
+{
+ gboolean result = FALSE;
+ gchar *utf8_name = mono_unicode_to_external (mono_string_chars (path));
+ if (utf8_name) {
+ struct stat st;
+ if (stat (utf8_name, &st) == 0) {
+ int mode = file_mode;
+ if (st.st_mode & S_IFDIR)
+ mode |= add_dir_mode;
+ result = (chmod (utf8_name, mode) == 0);
+ }
+ g_free (utf8_name);
+ }
+ return result;
+}
+
+#endif /* not PLATFORM_WIN32 */
+
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (MonoString *root)
+{
+#if PLATFORM_WIN32
+ gint32 flags;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* ACL are nice... unless you have FAT or other uncivilized filesystem */
+ if (!GetVolumeInformation (mono_string_chars (root), NULL, 0, NULL, NULL, (LPDWORD)&flags, NULL, 0))
+ return FALSE;
+ return ((flags & FS_PERSISTENT_ACLS) == FS_PERSISTENT_ACLS);
+#else
+ MONO_ARCH_SAVE_REGS;
+ /* we assume some kind of security is applicable outside Windows */
+ return TRUE;
+#endif
+}
+
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (MonoString *path)
+{
+ gboolean ret = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* no one, but the owner, should have write access to the directory */
+#ifdef PLATFORM_WIN32
+ ret = IsMachineProtected (mono_string_chars (path));
+#else
+ ret = IsProtected (path, (S_IWGRP | S_IWOTH));
+#endif
+ return ret;
+}
+
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (MonoString *path)
+{
+ gboolean ret = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* no one, but the user, should have access to the directory */
+#ifdef PLATFORM_WIN32
+ ret = IsUserProtected (mono_string_chars (path));
+#else
+ ret = IsProtected (path, (S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH));
+#endif
+ return ret;
+}
+
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (MonoString *path)
+{
+ gboolean ret = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* read/write to owner, read to everyone else */
+#ifdef PLATFORM_WIN32
+ ret = ProtectMachine (mono_string_chars (path));
+#else
+ ret = Protect (path, (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), (S_IXUSR | S_IXGRP | S_IXOTH));
+#endif
+ return ret;
+}
+
+
+MonoBoolean
+ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (MonoString *path)
+{
+ gboolean ret = FALSE;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* read/write to user, no access to everyone else */
+#ifdef PLATFORM_WIN32
+ ret = ProtectUser (mono_string_chars (path));
+#else
+ ret = Protect (path, (S_IRUSR | S_IWUSR), S_IXUSR);
+#endif
+ return ret;
+}
diff --git a/mono/metadata/security.h b/mono/metadata/security.h
new file mode 100644
index 00000000000..7676b7517e6
--- /dev/null
+++ b/mono/metadata/security.h
@@ -0,0 +1,48 @@
+/*
+ * security.c: Security internal calls
+ *
+ * Author:
+ * Sebastien Pouliot <sebastien@ximian.com>
+ *
+ * (C) 2004 Novell (http://www.novell.com)
+ */
+
+
+#ifndef _MONO_METADATA_SECURITY_H_
+#define _MONO_METADATA_SECURITY_H_
+
+#include <mono/metadata/object.h>
+
+
+/* System.Environment */
+extern MonoString* ves_icall_System_Environment_get_UserName (void);
+
+
+/* System.Security.Principal.WindowsIdentity */
+extern MonoArray* ves_icall_System_Security_Principal_WindowsIdentity_GetRoles (gpointer token);
+extern gpointer ves_icall_System_Security_Principal_WindowsIdentity_GetCurrentToken (void);
+extern MonoString* ves_icall_System_Security_Principal_WindowsIdentity_GetTokenName (gpointer token);
+extern gpointer ves_icall_System_Security_Principal_WindowsIdentity_GetUserToken (MonoString *username);
+
+
+/* System.Security.Principal.WindowsImpersonationContext */
+extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_CloseToken (gpointer token);
+extern gpointer ves_icall_System_Security_Principal_WindowsImpersonationContext_DuplicateToken (gpointer token);
+extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_SetCurrentToken (gpointer token);
+extern gboolean ves_icall_System_Security_Principal_WindowsImpersonationContext_RevertToSelf (void);
+
+
+/* System.Security.Principal.WindowsPrincipal */
+extern gboolean ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupId (gpointer user, gpointer group);
+extern gboolean ves_icall_System_Security_Principal_WindowsPrincipal_IsMemberOfGroupName (gpointer user, MonoString *group);
+
+
+/* Mono.Security.Cryptography.KeyPairPersistance */
+extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (MonoString *root);
+extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (MonoString *path);
+extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (MonoString *path);
+extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (MonoString *path);
+extern MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (MonoString *path);
+
+
+#endif /* _MONO_METADATA_SECURITY_H_ */
diff --git a/mono/metadata/socket-io.c b/mono/metadata/socket-io.c
index 3a88ebd4d90..1ef49278ea9 100644
--- a/mono/metadata/socket-io.c
+++ b/mono/metadata/socket-io.c
@@ -12,18 +12,56 @@
#include <glib.h>
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#ifndef PLATFORM_WIN32
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#define USE_AIO 1
+#elif defined(HAVE_SYS_AIO_H)
+#include <sys/aio.h>
+#define USE_AIO 1
+#else
+#undef USE_AIO
+#endif
+#endif
#include <mono/metadata/object.h>
#include <mono/io-layer/io-layer.h>
#include <mono/metadata/socket-io.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/appdomain.h>
+#include <mono/metadata/threads.h>
+/* FIXME change this code to not mess so much with the internals */
+#include <mono/metadata/class-internals.h>
#include <sys/time.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h> /* defines FIONBIO and FIONREAD */
+#endif
+#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h> /* defines SIOCATMARK */
+#endif
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
+#include "mono/io-layer/socket-wrappers.h"
+
+#ifdef PLATFORM_WIN32
+/* This is a kludge to make this file build under cygwin:
+ * w32api/ws2tcpip.h has definitions for some AF_INET6 values and
+ * prototypes for some but not all required functions (notably
+ * inet_ntop() is missing), but the libws2_32 library is missing the
+ * actual implementations of these functions.
+ */
+#undef AF_INET6
+#endif
#undef DEBUG
@@ -67,7 +105,9 @@ static gint32 convert_family(MonoAddressFamily mono_family)
break;
case AddressFamily_Ipx:
+#ifdef AF_IPX
family=AF_IPX;
+#endif
break;
case AddressFamily_Sna:
@@ -83,13 +123,15 @@ static gint32 convert_family(MonoAddressFamily mono_family)
break;
case AddressFamily_InterNetworkV6:
+#ifdef AF_INET6
family=AF_INET6;
+#endif
break;
-#ifdef AF_IRDA
case AddressFamily_Irda:
+#ifdef AF_IRDA
family=AF_IRDA;
- break;
#endif
+ break;
default:
g_warning("System.Net.Sockets.AddressFamily has unknown value 0x%x", mono_family);
}
@@ -114,9 +156,11 @@ static MonoAddressFamily convert_to_mono_family(guint16 af_family)
family=AddressFamily_InterNetwork;
break;
+#ifdef AF_IPX
case AF_IPX:
family=AddressFamily_Ipx;
break;
+#endif
case AF_SNA:
family=AddressFamily_Sna;
@@ -130,9 +174,11 @@ static MonoAddressFamily convert_to_mono_family(guint16 af_family)
family=AddressFamily_AppleTalk;
break;
+#ifdef AF_INET6
case AF_INET6:
family=AddressFamily_InterNetworkV6;
break;
+#endif
#ifdef AF_IRDA
case AF_IRDA:
@@ -188,6 +234,7 @@ static gint32 convert_proto(MonoProtocolType mono_proto)
switch(mono_proto) {
case ProtocolType_IP:
+ case ProtocolType_IPv6:
case ProtocolType_Icmp:
case ProtocolType_Igmp:
case ProtocolType_Ggp:
@@ -283,6 +330,11 @@ static gint32 convert_sockopt_level_and_name(MonoSocketOptionLevel mono_level,
case SocketOptionName_Type:
*system_name = SO_TYPE;
break;
+#ifdef SO_PEERCRED
+ case SocketOptionName_PeerCred:
+ *system_name = SO_PEERCRED;
+ break;
+#endif
case SocketOptionName_ExclusiveAddressUse:
case SocketOptionName_UseLoopback:
case SocketOptionName_MaxConnections:
@@ -367,6 +419,68 @@ static gint32 convert_sockopt_level_and_name(MonoSocketOptionLevel mono_level,
return(-1);
}
break;
+
+#ifdef AF_INET6
+ case SocketOptionLevel_IPv6:
+#ifdef HAVE_SOL_IPV6
+ *system_level = SOL_IPV6;
+#else
+ if (1) {
+ static int cached = 0;
+ static int proto;
+
+ if (!cached) {
+ struct protoent *pent;
+
+ pent = getprotobyname ("IPV6");
+ proto = pent ? pent->p_proto : 41 /* 41 a good default value?? */;
+ cached = 1;
+ }
+
+ *system_level = proto;
+ }
+#endif /* HAVE_SOL_IPV6 */
+
+ switch(mono_name) {
+ case SocketOptionName_IpTimeToLive:
+ *system_name = IPV6_UNICAST_HOPS;
+ break;
+ case SocketOptionName_MulticastInterface:
+ *system_name = IPV6_MULTICAST_IF;
+ break;
+ case SocketOptionName_MulticastTimeToLive:
+ *system_name = IPV6_MULTICAST_HOPS;
+ break;
+ case SocketOptionName_MulticastLoopback:
+ *system_name = IPV6_MULTICAST_LOOP;
+ break;
+ case SocketOptionName_AddMembership:
+ *system_name = IPV6_JOIN_GROUP;
+ break;
+ case SocketOptionName_DropMembership:
+ *system_name = IPV6_LEAVE_GROUP;
+ break;
+ case SocketOptionName_PacketInformation:
+ *system_name = IPV6_PKTINFO;
+ break;
+ case SocketOptionName_HeaderIncluded:
+ case SocketOptionName_IPOptions:
+ case SocketOptionName_TypeOfService:
+ case SocketOptionName_DontFragment:
+ case SocketOptionName_AddSourceMembership:
+ case SocketOptionName_DropSourceMembership:
+ case SocketOptionName_BlockSource:
+ case SocketOptionName_UnblockSource:
+ /* Can't figure out how to map these, so fall
+ * through
+ */
+ default:
+ g_warning("System.Net.Sockets.SocketOptionName 0x%x is not supported at IPv6 level", mono_name);
+ return(-1);
+ }
+
+ break; /* SocketOptionLevel_IPv6 */
+#endif
case SocketOptionLevel_Tcp:
#ifdef HAVE_SOL_TCP
@@ -431,73 +545,116 @@ static gint32 convert_sockopt_level_and_name(MonoSocketOptionLevel mono_level,
#define STASH_SYS_ASS(this) \
if(system_assembly == NULL) { \
- system_assembly=this->vtable->klass->image; \
+ system_assembly=mono_image_loaded ("System"); \
}
static MonoImage *system_assembly=NULL;
-static MonoException *get_socket_exception(guint32 error_code)
+
+#ifdef AF_INET6
+static gint32 get_family_hint(void)
{
- /* Don't cache this exception, because we need the object
- * constructor to set up the message from the sockets error code.
- */
- MonoException *ex;
-
- /* This is a bit of a kludge. The SocketException 0-arg
- * constructor calls WSAGetLastError() to find the error code
- * to use. Until we can init objects with parameters, this
- * will have to do.
- */
- WSASetLastError(error_code);
-
- ex=(MonoException *)mono_exception_from_name(system_assembly,
- "System.Net.Sockets",
- "SocketException");
- return(ex);
+ MonoClass *socket_class;
+ MonoClassField *ipv6_field, *ipv4_field;
+ gint32 ipv6_enabled = -1, ipv4_enabled = -1;
+ MonoVTable *vtable;
+
+ socket_class = mono_class_from_name (system_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");
+ vtable = mono_class_vtable (mono_domain_get (), socket_class);
+
+ mono_field_static_get_value(vtable, ipv4_field, &ipv4_enabled);
+ mono_field_static_get_value(vtable, ipv6_field, &ipv6_enabled);
+
+ if(ipv4_enabled == 1 && ipv6_enabled == 1) {
+ return(PF_UNSPEC);
+ } else if(ipv4_enabled == 1) {
+ return(PF_INET);
+ } else {
+ return(PF_INET6);
+ }
}
+#endif
-gpointer ves_icall_System_Net_Sockets_Socket_Socket_internal(MonoObject *this, gint32 family, gint32 type, gint32 proto)
+gpointer ves_icall_System_Net_Sockets_Socket_Socket_internal(MonoObject *this, gint32 family, gint32 type, gint32 proto, gint32 *error)
{
SOCKET sock;
gint32 sock_family;
gint32 sock_proto;
gint32 sock_type;
- int ret;
- int true=1;
+ MONO_ARCH_SAVE_REGS;
+
STASH_SYS_ASS(this);
+ *error = 0;
+
sock_family=convert_family(family);
if(sock_family==-1) {
- mono_raise_exception(get_socket_exception(WSAEAFNOSUPPORT));
+ *error = WSAEAFNOSUPPORT;
return(NULL);
}
sock_proto=convert_proto(proto);
if(sock_proto==-1) {
- mono_raise_exception(get_socket_exception(WSAEPROTONOSUPPORT));
+ *error = WSAEPROTONOSUPPORT;
return(NULL);
}
sock_type=convert_type(type);
if(sock_type==-1) {
- mono_raise_exception(get_socket_exception(WSAESOCKTNOSUPPORT));
+ *error = WSAESOCKTNOSUPPORT;
return(NULL);
}
- sock=socket(sock_family, sock_type, sock_proto);
+ sock = _wapi_socket (sock_family, sock_type, sock_proto,
+ NULL, 0, WSA_FLAG_OVERLAPPED);
+
if(sock==INVALID_SOCKET) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
return(NULL);
}
- /* .net seems to set this by default */
- ret=setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &true, sizeof(true));
+ if (sock_family == AF_INET && sock_type == SOCK_DGRAM) {
+ return (GUINT_TO_POINTER (sock));
+ }
+
+#ifdef AF_INET6
+ if (sock_family == AF_INET6 && sock_type == SOCK_DGRAM) {
+ return (GUINT_TO_POINTER (sock));
+ }
+#endif
+
+#ifndef PLATFORM_WIN32
+ /* .net seems to set this by default for SOCK_STREAM,
+ * not for SOCK_DGRAM (see bug #36322)
+ *
+ * It seems winsock has a rather different idea of what
+ * SO_REUSEADDR means. If it's set, then a new socket can be
+ * bound over an existing listening socket. There's a new
+ * windows-specific option called SO_EXCLUSIVEADDRUSE but
+ * using that means the socket MUST be closed properly, or a
+ * denial of service can occur. Luckily for us, winsock
+ * behaves as though any other system would when SO_REUSEADDR
+ * is true, so we don't need to do anything else here. See
+ * bug 53992.
+ */
+ {
+ int ret, true = 1;
+
+ ret = _wapi_setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &true, sizeof (true));
if(ret==SOCKET_ERROR) {
+ *error = WSAGetLastError ();
+
closesocket(sock);
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
return(NULL);
}
+ }
+#endif
return(GUINT_TO_POINTER (sock));
}
@@ -505,24 +662,44 @@ gpointer ves_icall_System_Net_Sockets_Socket_Socket_internal(MonoObject *this, g
/* FIXME: the SOCKET parameter (here and in other functions in this
* file) is really an IntPtr which needs to be converted to a guint32.
*/
-void ves_icall_System_Net_Sockets_Socket_Close_internal(SOCKET sock)
+void ves_icall_System_Net_Sockets_Socket_Close_internal(SOCKET sock,
+ gint32 *error)
{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": closing 0x%x", sock);
+#endif
+
+ *error = 0;
+
closesocket(sock);
}
gint32 ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal(void)
{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": returning %d", WSAGetLastError());
+#endif
+
return(WSAGetLastError());
}
-gint32 ves_icall_System_Net_Sockets_Socket_Available_internal(SOCKET sock)
+gint32 ves_icall_System_Net_Sockets_Socket_Available_internal(SOCKET sock,
+ gint32 *error)
{
- int ret, amount;
+ int ret;
+ gulong amount;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
ret=ioctlsocket(sock, FIONREAD, &amount);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
return(0);
}
@@ -530,23 +707,33 @@ gint32 ves_icall_System_Net_Sockets_Socket_Available_internal(SOCKET sock)
}
void ves_icall_System_Net_Sockets_Socket_Blocking_internal(SOCKET sock,
- gboolean block)
+ gboolean block,
+ gint32 *error)
{
int ret;
- ret=ioctlsocket(sock, FIONBIO, &block);
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ ret = ioctlsocket (sock, FIONBIO, (gulong *) &block);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
}
-gpointer ves_icall_System_Net_Sockets_Socket_Accept_internal(SOCKET sock)
+gpointer ves_icall_System_Net_Sockets_Socket_Accept_internal(SOCKET sock,
+ gint32 *error)
{
SOCKET newsock;
- newsock=accept(sock, NULL, 0);
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ newsock = _wapi_accept (sock, NULL, 0);
if(newsock==INVALID_SOCKET) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
return(NULL);
}
@@ -554,18 +741,23 @@ gpointer ves_icall_System_Net_Sockets_Socket_Accept_internal(SOCKET sock)
}
void ves_icall_System_Net_Sockets_Socket_Listen_internal(SOCKET sock,
- guint32 backlog)
+ guint32 backlog,
+ gint32 *error)
{
int ret;
- ret=listen(sock, backlog);
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ ret = _wapi_listen (sock, backlog);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
}
static MonoObject *create_object_from_sockaddr(struct sockaddr *saddr,
- int sa_size)
+ int sa_size, gint32 *error)
{
MonoDomain *domain = mono_domain_get ();
MonoObject *sockaddr_obj;
@@ -582,7 +774,7 @@ static MonoObject *create_object_from_sockaddr(struct sockaddr *saddr,
field=mono_class_get_field_from_name(sockaddr_class, "data");
/* Make sure there is space for the family and size bytes */
- data=mono_array_new(domain, mono_defaults.byte_class, sa_size+2);
+ data=mono_array_new(domain, mono_get_byte_class (), sa_size+2);
/* The data buffer is laid out as follows:
* byte 0 is the address family
@@ -593,12 +785,12 @@ static MonoObject *create_object_from_sockaddr(struct sockaddr *saddr,
family=convert_to_mono_family(saddr->sa_family);
if(family==AddressFamily_Unknown) {
- mono_raise_exception(get_socket_exception(WSAEAFNOSUPPORT));
+ *error = WSAEAFNOSUPPORT;
return(NULL);
}
- mono_array_set(data, guint8, 0, family);
- mono_array_set(data, guint8, 1, sa_size+2);
+ mono_array_set(data, guint8, 0, family & 0x0FF);
+ mono_array_set(data, guint8, 1, ((family << 8) & 0x0FFFF));
if(saddr->sa_family==AF_INET) {
struct sockaddr_in *sa_in=(struct sockaddr_in *)saddr;
@@ -606,7 +798,7 @@ static MonoObject *create_object_from_sockaddr(struct sockaddr *saddr,
guint32 address=ntohl(sa_in->sin_addr.s_addr);
if(sa_size<8) {
- mono_raise_exception((MonoException *)mono_exception_from_name(mono_defaults.corlib, "System", "SystemException"));
+ mono_raise_exception((MonoException *)mono_exception_from_name(mono_get_corlib (), "System", "SystemException"));
}
mono_array_set(data, guint8, 2, (port>>8) & 0xff);
@@ -615,58 +807,114 @@ static MonoObject *create_object_from_sockaddr(struct sockaddr *saddr,
mono_array_set(data, guint8, 5, (address>>16) & 0xff);
mono_array_set(data, guint8, 6, (address>>8) & 0xff);
mono_array_set(data, guint8, 7, (address) & 0xff);
-
- *(MonoArray **)(((char *)sockaddr_obj) + field->offset)=data;
+
+ mono_field_set_value (sockaddr_obj, field, data);
return(sockaddr_obj);
+#ifdef AF_INET6
+ } else if (saddr->sa_family == AF_INET6) {
+ struct sockaddr_in6 *sa_in=(struct sockaddr_in6 *)saddr;
+ int i;
+
+ guint16 port=ntohs(sa_in->sin6_port);
+
+ if(sa_size<28) {
+ mono_raise_exception((MonoException *)mono_exception_from_name(mono_get_corlib (), "System", "SystemException"));
+ }
+
+ mono_array_set(data, guint8, 2, (port>>8) & 0xff);
+ mono_array_set(data, guint8, 3, (port) & 0xff);
+
+ for(i=0; i<16; i++) {
+ mono_array_set(data, guint8, 8+i,
+ sa_in->sin6_addr.s6_addr[i]);
+ }
+
+ mono_array_set(data, guint8, 24, sa_in->sin6_scope_id & 0xff);
+ mono_array_set(data, guint8, 25,
+ (sa_in->sin6_scope_id >> 8) & 0xff);
+ mono_array_set(data, guint8, 26,
+ (sa_in->sin6_scope_id >> 16) & 0xff);
+ mono_array_set(data, guint8, 27,
+ (sa_in->sin6_scope_id >> 24) & 0xff);
+
+ mono_field_set_value (sockaddr_obj, field, data);
+
+ return(sockaddr_obj);
+#endif
+#ifdef HAVE_SYS_UN_H
+ } else if (saddr->sa_family == AF_UNIX) {
+ int i;
+
+ for (i = 0; i < sa_size; i++) {
+ mono_array_set (data, guint8, i+2, saddr->sa_data[i]);
+ }
+
+ mono_field_set_value (sockaddr_obj, field, data);
+
+ return sockaddr_obj;
+#endif
} else {
- mono_raise_exception(get_socket_exception(WSAEAFNOSUPPORT));
+ *error = WSAEAFNOSUPPORT;
return(NULL);
}
}
-extern MonoObject *ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal(SOCKET sock)
+extern MonoObject *ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal(SOCKET sock, gint32 *error)
{
- struct sockaddr sa;
+ gchar sa[32]; /* sockaddr in not big enough for sockaddr_in6 */
int salen;
int ret;
- salen=sizeof(struct sockaddr);
- ret=getsockname(sock, &sa, &salen);
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ salen=sizeof(sa);
+ ret = _wapi_getsockname (sock, (struct sockaddr *)sa, &salen);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
+ return(NULL);
}
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": bound to %s port %d", inet_ntoa((struct sockaddr_in)sa.sin_addr), ntohs((struct sockaddr_in)sa.sin_port));
+ g_message(G_GNUC_PRETTY_FUNCTION ": bound to %s port %d", inet_ntoa(((struct sockaddr_in *)&sa)->sin_addr), ntohs(((struct sockaddr_in *)&sa)->sin_port));
#endif
- return(create_object_from_sockaddr(&sa, salen));
+ return(create_object_from_sockaddr((struct sockaddr *)sa, salen,
+ error));
}
-extern MonoObject *ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal(SOCKET sock)
+extern MonoObject *ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal(SOCKET sock, gint32 *error)
{
- struct sockaddr sa;
+ gchar sa[32]; /* sockaddr in not big enough for sockaddr_in6 */
int salen;
int ret;
- salen=sizeof(struct sockaddr);
- ret=getpeername(sock, &sa, &salen);
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ salen=sizeof(sa);
+ ret = _wapi_getpeername (sock, (struct sockaddr *)sa, &salen);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
+ return(NULL);
}
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": connected to %s port %d", inet_ntoa((struct sockaddr_in)sa.sin_addr), ntohs((struct sockaddr_in)sa.sin_port));
+ g_message(G_GNUC_PRETTY_FUNCTION ": connected to %s port %d", inet_ntoa(((struct sockaddr_in *)&sa)->sin_addr), ntohs(((struct sockaddr_in *)&sa)->sin_port));
#endif
- return(create_object_from_sockaddr(&sa, salen));
+ return(create_object_from_sockaddr((struct sockaddr *)sa, salen,
+ error));
}
static struct sockaddr *create_sockaddr_from_object(MonoObject *saddr_obj,
- int *sa_size)
+ int *sa_size,
+ gint32 *error)
{
MonoClassField *field;
MonoArray *data;
@@ -678,17 +926,20 @@ static struct sockaddr *create_sockaddr_from_object(MonoObject *saddr_obj,
data=*(MonoArray **)(((char *)saddr_obj) + field->offset);
/* The data buffer is laid out as follows:
- * byte 0 is the address family
- * byte 1 is the buffer length
- * bytes 2 and 3 are the port info
- * the rest is the address info
+ * byte 0 is the address family low byte
+ * byte 1 is the address family high byte
+ * INET:
+ * bytes 2 and 3 are the port info
+ * the rest is the address info
+ * UNIX:
+ * the rest is the file name
*/
- len=mono_array_get(data, guint8, 1);
- if((len<2) || (mono_array_length(data)!=len)) {
- mono_raise_exception((MonoException *)mono_exception_from_name(mono_defaults.corlib, "System", "SystemException"));
+ len = mono_array_length (data);
+ if (len < 2) {
+ mono_raise_exception (mono_exception_from_name(mono_get_corlib (), "System", "SystemException"));
}
- family=convert_family(mono_array_get(data, guint8, 0));
+ family = convert_family (mono_array_get (data, guint8, 0) + (mono_array_get (data, guint8, 1) << 8));
if(family==AF_INET) {
struct sockaddr_in *sa=g_new0(struct sockaddr_in, 1);
guint16 port=(mono_array_get(data, guint8, 2) << 8) +
@@ -704,59 +955,163 @@ static struct sockaddr *create_sockaddr_from_object(MonoObject *saddr_obj,
*sa_size=sizeof(struct sockaddr_in);
return((struct sockaddr *)sa);
+
+#ifdef AF_INET6
+ } else if (family == AF_INET6) {
+ struct sockaddr_in6 *sa=g_new0(struct sockaddr_in6, 1);
+ int i;
+
+ guint16 port = mono_array_get(data, guint8, 3) + (mono_array_get(data, guint8, 2) << 8);
+ guint32 scopeid = mono_array_get(data, guint8, 24) +
+ (mono_array_get(data, guint8, 25)<<8) +
+ (mono_array_get(data, guint8, 26)<<16) +
+ (mono_array_get(data, guint8, 27)<<24);
+
+ sa->sin6_family=family;
+ sa->sin6_port=htons(port);
+ sa->sin6_scope_id = scopeid;
+
+ for(i=0; i<16; i++)
+ sa->sin6_addr.s6_addr[i] = mono_array_get(data, guint8, 8+i);
+
+ *sa_size=sizeof(struct sockaddr_in6);
+ return((struct sockaddr *)sa);
+#endif
+#ifdef HAVE_SYS_UN_H
+ } else if (family == AF_UNIX) {
+ struct sockaddr_un *sock_un = g_new0 (struct sockaddr_un, 1);
+ int i;
+
+ if (len - 2 > MONO_SIZEOF_SUNPATH)
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
+
+ sock_un->sun_family = family;
+ for (i = 0; i < len - 2; i++)
+ sock_un->sun_path [i] = mono_array_get (data, guint8,
+ i + 2);
+ sock_un->sun_path [len - 2] = '\0';
+ *sa_size = sizeof (struct sockaddr_un);
+
+ return (struct sockaddr *)sock_un;
+#endif
} else {
- mono_raise_exception(get_socket_exception(WSAEAFNOSUPPORT));
+ *error = WSAEAFNOSUPPORT;
return(0);
}
}
-extern void ves_icall_System_Net_Sockets_Socket_Bind_internal(SOCKET sock, MonoObject *sockaddr)
+extern void ves_icall_System_Net_Sockets_Socket_Bind_internal(SOCKET sock, MonoObject *sockaddr, gint32 *error)
{
struct sockaddr *sa;
int sa_size;
int ret;
- sa=create_sockaddr_from_object(sockaddr, &sa_size);
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ sa=create_sockaddr_from_object(sockaddr, &sa_size, error);
+ if (*error != 0) {
+ return;
+ }
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": binding to %s port %d", inet_ntoa(sa.sin_addr), port);
+ g_message(G_GNUC_PRETTY_FUNCTION ": binding to %s port %d", inet_ntoa(((struct sockaddr_in *)sa)->sin_addr), ntohs (((struct sockaddr_in *)sa)->sin_port));
#endif
- ret=bind(sock, sa, sa_size);
- g_free(sa);
-
+ ret = _wapi_bind (sock, sa, sa_size);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
+
+ g_free(sa);
}
-extern void ves_icall_System_Net_Sockets_Socket_Connect_internal(SOCKET sock, MonoObject *sockaddr)
+enum {
+ SelectModeRead,
+ SelectModeWrite,
+ SelectModeError
+};
+
+MonoBoolean
+ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode,
+ gint timeout, gint32 *error)
+{
+ fd_set fds;
+ int ret = 0;
+ struct timeval tv;
+ struct timeval *tvptr;
+ div_t divvy;
+
+ MONO_ARCH_SAVE_REGS;
+
+ do {
+ /* FIXME: in case of extra iteration (WSAEINTR), substract time
+ * from the initial timeout */
+ *error = 0;
+ FD_ZERO (&fds);
+ _wapi_FD_SET (sock, &fds);
+ if (timeout >= 0) {
+ divvy = div (timeout, 1000000);
+ tv.tv_sec = divvy.quot;
+ tv.tv_usec = divvy.rem;
+ tvptr = &tv;
+ } else {
+ tvptr = NULL;
+ }
+
+ if (mode == SelectModeRead) {
+ ret = _wapi_select (0, &fds, NULL, NULL, tvptr);
+ } else if (mode == SelectModeWrite) {
+ ret = _wapi_select (0, NULL, &fds, NULL, tvptr);
+ } else if (mode == SelectModeError) {
+ ret = _wapi_select (0, NULL, NULL, &fds, tvptr);
+ } else {
+ g_assert_not_reached ();
+ }
+ } while ((ret == SOCKET_ERROR) && (*error == WSAGetLastError ()) == WSAEINTR);
+
+ return (ret != SOCKET_ERROR && _wapi_FD_ISSET (sock, &fds));
+}
+
+extern void ves_icall_System_Net_Sockets_Socket_Connect_internal(SOCKET sock, MonoObject *sockaddr, gint32 *error)
{
struct sockaddr *sa;
int sa_size;
int ret;
- sa=create_sockaddr_from_object(sockaddr, &sa_size);
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ sa=create_sockaddr_from_object(sockaddr, &sa_size, error);
+ if (*error != 0) {
+ return;
+ }
#ifdef DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": connecting to %s port %d", inet_ntoa(sa.sin_addr), port);
+ g_message(G_GNUC_PRETTY_FUNCTION ": connecting to %s port %d", inet_ntoa(((struct sockaddr_in *)sa)->sin_addr), ntohs (((struct sockaddr_in *)sa)->sin_port));
#endif
- ret=connect(sock, sa, sa_size);
- g_free(sa);
-
+ ret = _wapi_connect (sock, sa, sa_size);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
+
+ g_free(sa);
}
-gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags)
+gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error)
{
int ret;
guchar *buf;
gint32 alen;
int recvflags=0;
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
alen=mono_array_length(buffer);
if(offset+count>alen) {
return(0);
@@ -764,15 +1119,16 @@ gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArr
buf=mono_array_addr(buffer, guchar, offset);
- ret=recv(sock, buf, count, recvflags);
+ ret = _wapi_recv (sock, buf, count, recvflags);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
+ return(0);
}
-
+
return(ret);
}
-gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr)
+gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr, gint32 *error)
{
int ret;
guchar *buf;
@@ -781,34 +1137,54 @@ gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoAr
struct sockaddr *sa;
int sa_size;
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
alen=mono_array_length(buffer);
if(offset+count>alen) {
return(0);
}
- sa=create_sockaddr_from_object(*sockaddr, &sa_size);
+ sa=create_sockaddr_from_object(*sockaddr, &sa_size, error);
+ if (*error != 0) {
+ return(0);
+ }
buf=mono_array_addr(buffer, guchar, offset);
- ret=recvfrom(sock, buf, count, recvflags, sa, &sa_size);
- g_free(sa);
-
+ ret = _wapi_recvfrom (sock, buf, count, recvflags, sa, &sa_size);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ g_free(sa);
+ *error = WSAGetLastError ();
+ return(0);
}
- *sockaddr=create_object_from_sockaddr(sa, sa_size);
+ /* If we didn't get a socket size, then we're probably a
+ * connected connection-oriented socket and the stack hasn't
+ * returned the remote address. All we can do is return null.
+ */
+ if ( sa_size != 0 )
+ *sockaddr=create_object_from_sockaddr(sa, sa_size, error);
+ else
+ *sockaddr=NULL;
+
+ g_free(sa);
return(ret);
}
-gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags)
+gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, gint32 *error)
{
int ret;
guchar *buf;
gint32 alen;
int sendflags=0;
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
alen=mono_array_length(buffer);
if(offset+count>alen) {
return(0);
@@ -824,15 +1200,16 @@ gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray
g_message(G_GNUC_PRETTY_FUNCTION ": Sending %d bytes", count);
#endif
- ret=send(sock, buf, count, sendflags);
+ ret = _wapi_send (sock, buf, count, sendflags);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
+ return(0);
}
-
+
return(ret);
}
-gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr)
+gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *error)
{
int ret;
guchar *buf;
@@ -841,12 +1218,19 @@ gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArra
struct sockaddr *sa;
int sa_size;
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
alen=mono_array_length(buffer);
if(offset+count>alen) {
return(0);
}
- sa=create_sockaddr_from_object(sockaddr, &sa_size);
+ sa=create_sockaddr_from_object(sockaddr, &sa_size, error);
+ if(*error != 0) {
+ return(0);
+ }
#ifdef DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": alen: %d", alen);
@@ -858,12 +1242,12 @@ gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArra
g_message(G_GNUC_PRETTY_FUNCTION ": Sending %d bytes", count);
#endif
- ret=sendto(sock, buf, count, sendflags, sa, sa_size);
- g_free(sa);
-
+ ret = _wapi_sendto (sock, buf, count, sendflags, sa, sa_size);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
+
+ g_free(sa);
return(ret);
}
@@ -879,128 +1263,174 @@ static SOCKET Socket_to_SOCKET(MonoObject *sockobj)
return(sock);
}
-void ves_icall_System_Net_Sockets_Socket_Select_internal(MonoArray **read_socks, MonoArray **write_socks, MonoArray **err_socks, gint32 timeout)
+void ves_icall_System_Net_Sockets_Socket_Select_internal(MonoArray **read_socks, MonoArray **write_socks, MonoArray **err_socks, gint32 timeout, gint32 *error)
{
fd_set readfds, writefds, errfds;
+ fd_set *readptr = NULL, *writeptr = NULL, *errptr = NULL;
struct timeval tv;
div_t divvy;
int ret;
- int readarrsize, writearrsize, errarrsize;
+ int readarrsize = 0, writearrsize = 0, errarrsize = 0;
MonoDomain *domain=mono_domain_get();
MonoClass *sock_arr_class;
MonoArray *socks;
int count;
int i;
+ SOCKET handle;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (*read_socks)
+ readarrsize=mono_array_length(*read_socks);
+
+ *error = 0;
- readarrsize=mono_array_length(*read_socks);
if(readarrsize>FD_SETSIZE) {
- mono_raise_exception(get_socket_exception(WSAEFAULT));
+ *error = WSAEFAULT;
return;
}
- FD_ZERO(&readfds);
- for(i=0; i<readarrsize; i++) {
- FD_SET(Socket_to_SOCKET(mono_array_get(*read_socks, MonoObject *, i)), &readfds);
+ if (readarrsize) {
+ readptr = &readfds;
+ FD_ZERO(&readfds);
+ for(i=0; i<readarrsize; i++) {
+ handle = Socket_to_SOCKET(mono_array_get(*read_socks, MonoObject *, i));
+ _wapi_FD_SET(handle, &readfds);
+ }
}
- writearrsize=mono_array_length(*write_socks);
+ if (*write_socks)
+ writearrsize=mono_array_length(*write_socks);
+
if(writearrsize>FD_SETSIZE) {
- mono_raise_exception(get_socket_exception(WSAEFAULT));
+ *error = WSAEFAULT;
return;
}
- FD_ZERO(&writefds);
- for(i=0; i<writearrsize; i++) {
- FD_SET(Socket_to_SOCKET(mono_array_get(*write_socks, MonoObject *, i)), &writefds);
+ if (writearrsize) {
+ writeptr = &writefds;
+ FD_ZERO(&writefds);
+ for(i=0; i<writearrsize; i++) {
+ handle = Socket_to_SOCKET(mono_array_get(*write_socks, MonoObject *, i));
+ _wapi_FD_SET(handle, &writefds);
+ }
}
- errarrsize=mono_array_length(*err_socks);
+ if (*err_socks)
+ errarrsize=mono_array_length(*err_socks);
+
if(errarrsize>FD_SETSIZE) {
- mono_raise_exception(get_socket_exception(WSAEFAULT));
+ *error = WSAEFAULT;
return;
}
- FD_ZERO(&errfds);
- for(i=0; i<errarrsize; i++) {
- FD_SET(Socket_to_SOCKET(mono_array_get(*err_socks, MonoObject *, i)), &errfds);
+ if (errarrsize) {
+ errptr = &errfds;
+ FD_ZERO(&errfds);
+ for(i=0; i<errarrsize; i++) {
+ handle = Socket_to_SOCKET(mono_array_get(*err_socks, MonoObject *, i));
+ _wapi_FD_SET(handle, &errfds);
+ }
}
/* Negative timeout meaning block until ready is only
* specified in Poll, not Select
*/
- if(timeout>=0) {
- divvy=div(timeout, 1000000);
- tv.tv_sec=divvy.quot;
- tv.tv_usec=divvy.rem*1000000;
+
+ divvy = div (timeout, 1000000);
- ret=select(0, &readfds, &writefds, &errfds, &tv);
- } else {
- ret=select(0, &readfds, &writefds, &errfds, NULL);
- }
+ do {
+ if(timeout>=0) {
+ tv.tv_sec=divvy.quot;
+ tv.tv_usec=divvy.rem;
+
+ ret = _wapi_select (0, readptr, writeptr, errptr, &tv);
+ } else {
+ ret = _wapi_select (0, readptr, writeptr, errptr, NULL);
+ }
+ } while ((ret==SOCKET_ERROR) && (WSAGetLastError() == WSAEINTR));
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
return;
}
- sock_arr_class=((MonoObject *)*read_socks)->vtable->klass;
-
- count=0;
- for(i=0; i<readarrsize; i++) {
- if(FD_ISSET(Socket_to_SOCKET(mono_array_get(*read_socks, MonoObject *, i)), &readfds)) {
- count++;
- }
- }
- socks=mono_array_new_full(domain, sock_arr_class, &count, NULL);
- count=0;
- for(i=0; i<readarrsize; i++) {
- MonoObject *sock=mono_array_get(*read_socks, MonoObject *, i);
+ if (readarrsize) {
+ sock_arr_class=((MonoObject *)*read_socks)->vtable->klass;
- if(FD_ISSET(Socket_to_SOCKET(sock), &readfds)) {
- mono_array_set(socks, MonoObject *, count, sock);
- count++;
+ count=0;
+ for(i=0; i<readarrsize; i++) {
+ if(_wapi_FD_ISSET(Socket_to_SOCKET(mono_array_get(*read_socks, MonoObject *, i)), &readfds)) {
+ count++;
+ }
}
+ socks=mono_array_new_full(domain, sock_arr_class, &count, NULL);
+ count=0;
+ for(i=0; i<readarrsize; i++) {
+ MonoObject *sock=mono_array_get(*read_socks, MonoObject *, i);
+
+ if(_wapi_FD_ISSET(Socket_to_SOCKET(sock), &readfds)) {
+ mono_array_set(socks, MonoObject *, count, sock);
+ count++;
+ }
+ }
+ *read_socks=socks;
+ } else {
+ *read_socks = NULL;
}
- *read_socks=socks;
- count=0;
- for(i=0; i<writearrsize; i++) {
- if(FD_ISSET(Socket_to_SOCKET(mono_array_get(*write_socks, MonoObject *, i)), &writefds)) {
- count++;
+ if (writearrsize) {
+ sock_arr_class=((MonoObject *)*write_socks)->vtable->klass;
+ count=0;
+ for(i=0; i<writearrsize; i++) {
+ if(_wapi_FD_ISSET(Socket_to_SOCKET(mono_array_get(*write_socks, MonoObject *, i)), &writefds)) {
+ count++;
+ }
}
- }
- socks=mono_array_new_full(domain, sock_arr_class, &count, NULL);
- count=0;
- for(i=0; i<writearrsize; i++) {
- MonoObject *sock=mono_array_get(*write_socks, MonoObject *, i);
-
- if(FD_ISSET(Socket_to_SOCKET(sock), &writefds)) {
- mono_array_set(socks, MonoObject *, count, sock);
- count++;
+ socks=mono_array_new_full(domain, sock_arr_class, &count, NULL);
+ count=0;
+ for(i=0; i<writearrsize; i++) {
+ MonoObject *sock=mono_array_get(*write_socks, MonoObject *, i);
+
+ if(_wapi_FD_ISSET(Socket_to_SOCKET(sock), &writefds)) {
+ mono_array_set(socks, MonoObject *, count, sock);
+ count++;
+ }
}
+ *write_socks=socks;
+ } else {
+ *write_socks = NULL;
}
- *write_socks=socks;
- count=0;
- for(i=0; i<errarrsize; i++) {
- if(FD_ISSET(Socket_to_SOCKET(mono_array_get(*err_socks, MonoObject *, i)), &errfds)) {
- count++;
+ if (errarrsize) {
+ sock_arr_class=((MonoObject *)*err_socks)->vtable->klass;
+ count=0;
+ for(i=0; i<errarrsize; i++) {
+ if(_wapi_FD_ISSET(Socket_to_SOCKET(mono_array_get(*err_socks, MonoObject *, i)), &errfds)) {
+ count++;
+ }
}
- }
- socks=mono_array_new_full(domain, sock_arr_class, &count, NULL);
- count=0;
- for(i=0; i<errarrsize; i++) {
- MonoObject *sock=mono_array_get(*err_socks, MonoObject *, i);
-
- if(FD_ISSET(Socket_to_SOCKET(sock), &errfds)) {
- mono_array_set(socks, MonoObject *, count, sock);
- count++;
+ socks=mono_array_new_full(domain, sock_arr_class, &count, NULL);
+ count=0;
+ for(i=0; i<errarrsize; i++) {
+ MonoObject *sock=mono_array_get(*err_socks, MonoObject *, i);
+
+ if(_wapi_FD_ISSET(Socket_to_SOCKET(sock), &errfds)) {
+ mono_array_set(socks, MonoObject *, count, sock);
+ count++;
+ }
}
+ *err_socks=socks;
}
- *err_socks=socks;
}
-void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET sock, gint32 level, gint32 name, MonoObject **obj_val)
+static MonoObject* int_to_object (MonoDomain *domain, int val)
+{
+ return mono_value_box (domain, mono_get_int32_class (), &val);
+}
+
+
+void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET sock, gint32 level, gint32 name, MonoObject **obj_val, gint32 *error)
{
int system_level;
int system_name;
@@ -1009,15 +1439,25 @@ void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET soc
int valsize=sizeof(val);
struct linger linger;
int lingersize=sizeof(linger);
+ struct timeval tv;
+ int tvsize=sizeof(tv);
+#ifdef SO_PEERCRED
+ struct ucred cred;
+ int credsize = sizeof(cred);
+#endif
MonoDomain *domain=mono_domain_get();
MonoObject *obj;
MonoClass *obj_class;
MonoClassField *field;
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
ret=convert_sockopt_level_and_name(level, name, &system_level,
&system_name);
if(ret==-1) {
- mono_raise_exception(get_socket_exception(WSAENOPROTOOPT));
+ *error = WSAENOPROTOOPT;
return;
}
@@ -1028,17 +1468,30 @@ void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET soc
switch(name) {
case SocketOptionName_Linger:
case SocketOptionName_DontLinger:
- ret=getsockopt(sock, system_level, system_name, &linger,
+ ret = _wapi_getsockopt(sock, system_level, system_name, &linger,
&lingersize);
break;
+ case SocketOptionName_SendTimeout:
+ case SocketOptionName_ReceiveTimeout:
+ ret = _wapi_getsockopt (sock, system_level, system_name, &tv,
+ &tvsize);
+ break;
+
+#ifdef SO_PEERCRED
+ case SocketOptionName_PeerCred:
+ ret = _wapi_getsockopt (sock, system_level, system_name, &cred,
+ &credsize);
+ break;
+#endif
+
default:
- ret=getsockopt(sock, system_level, system_name, &val,
+ ret = _wapi_getsockopt (sock, system_level, system_name, &val,
&valsize);
}
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
return;
}
@@ -1063,24 +1516,48 @@ void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET soc
case SocketOptionName_DontLinger:
/* construct a bool int in val - true if linger is off */
- val=!linger.l_onoff;
+ obj = int_to_object (domain, !linger.l_onoff);
+ break;
- /* fall through */
+ case SocketOptionName_SendTimeout:
+ case SocketOptionName_ReceiveTimeout:
+ obj = int_to_object (domain, (tv.tv_sec * 1000) + (tv.tv_usec / 1000));
+ break;
+
+#ifdef SO_PEERCRED
+ case SocketOptionName_PeerCred:
+ {
+ /* build a Mono.Posix.PeerCred+PeerCredData if
+ * possible
+ */
+ MonoImage *mono_posix_image = mono_image_loaded ("Mono.Posix");
+ MonoPeerCredData *cred_data;
- default:
- /* construct an Int32 object to hold val */
- obj=mono_object_new(domain, mono_defaults.int32_class);
+ if (mono_posix_image == NULL) {
+ *error = WSAENOPROTOOPT;
+ return;
+ }
- /* Locate and set the "value" field */
- field=mono_class_get_field_from_name(mono_defaults.int32_class,
- "value");
- *(gint32 *)(((char *)obj)+field->offset)=val;
+ obj_class = mono_class_from_name(mono_posix_image,
+ "Mono.Posix",
+ "PeerCred/PeerCredData");
+ obj = mono_object_new(domain, obj_class);
+ cred_data = (MonoPeerCredData *)obj;
+ cred_data->pid = cred.pid;
+ cred_data->uid = cred.uid;
+ cred_data->gid = cred.gid;
+ break;
+ }
+#endif
+
+ default:
+ obj = int_to_object (domain, val);
}
*obj_val=obj;
}
-void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal(SOCKET sock, gint32 level, gint32 name, MonoArray **byte_val)
+void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal(SOCKET sock, gint32 level, gint32 name, MonoArray **byte_val, gint32 *error)
{
int system_level;
int system_name;
@@ -1088,47 +1565,109 @@ void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal(SOCKET soc
guchar *buf;
int valsize;
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
ret=convert_sockopt_level_and_name(level, name, &system_level,
&system_name);
if(ret==-1) {
- mono_raise_exception(get_socket_exception(WSAENOPROTOOPT));
+ *error = WSAENOPROTOOPT;
return;
}
valsize=mono_array_length(*byte_val);
buf=mono_array_addr(*byte_val, guchar, 0);
- ret=getsockopt(sock, system_level, system_name, buf, &valsize);
+ ret = _wapi_getsockopt (sock, system_level, system_name, buf, &valsize);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
}
+#if defined(HAVE_STRUCT_IP_MREQN) || defined(HAVE_STRUCT_IP_MREQ)
static struct in_addr ipaddress_to_struct_in_addr(MonoObject *ipaddr)
{
struct in_addr inaddr;
- guint64 addr;
MonoClassField *field;
field=mono_class_get_field_from_name(ipaddr->vtable->klass, "address");
- addr=*(guint64 *)(((char *)ipaddr)+field->offset);
- /* No idea why .net uses a 64bit type to hold a 32bit value */
- inaddr.s_addr=htonl((guint32)addr);
+ /* No idea why .net uses a 64bit type to hold a 32bit value...
+ *
+ * Internal value of IPAddess is in Network Order, there is no need
+ * to call htonl here.
+ */
+ inaddr.s_addr=(guint32)*(guint64 *)(((char *)ipaddr)+field->offset);
return(inaddr);
}
+#endif
+
+#ifdef AF_INET6
+static struct in6_addr ipaddress_to_struct_in6_addr(MonoObject *ipaddr)
+{
+ struct in6_addr in6addr;
+ MonoClassField *field;
+ MonoArray *data;
+ int i;
+
+ field=mono_class_get_field_from_name(ipaddr->vtable->klass, "_numbers");
+ data=*(MonoArray **)(((char *)ipaddr) + field->offset);
+
+/* Solaris has only the 8 bit version. */
+#ifndef s6_addr16
+ for(i=0; i<8; i++) {
+ guint16 s = mono_array_get (data, guint16, i);
+ in6addr.s6_addr[2 * i] = (s >> 8) & 0xff;
+ in6addr.s6_addr[2 * i + 1] = s & 0xff;
+ }
+#else
+ for(i=0; i<8; i++)
+ in6addr.s6_addr16[i] = mono_array_get (data, guint16, i);
+#endif
+ return(in6addr);
+}
+#endif /* AF_INET6 */
-void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, gint32 level, gint32 name, MonoObject *obj_val, MonoArray *byte_val, gint32 int_val)
+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)
{
int system_level;
int system_name;
int ret;
+#ifdef AF_INET6
+ int sol_ip;
+ int sol_ipv6;
+
+ *error = 0;
+
+#ifdef HAVE_SOL_IPV6
+ sol_ipv6 = SOL_IPV6;
+#else
+ {
+ struct protoent *pent;
+ pent = getprotobyname ("ipv6");
+ sol_ipv6 = (pent != NULL) ? pent->p_proto : 41;
+ }
+#endif
+
+#ifdef HAVE_SOL_IP
+ sol_ip = SOL_IP;
+#else
+ {
+ struct protoent *pent;
+ pent = getprotobyname ("ip");
+ sol_ip = (pent != NULL) ? pent->p_proto : 0;
+ }
+#endif
+#endif /* AF_INET6 */
+
+ MONO_ARCH_SAVE_REGS;
ret=convert_sockopt_level_and_name(level, name, &system_level,
&system_name);
if(ret==-1) {
- mono_raise_exception(get_socket_exception(WSAENOPROTOOPT));
+ *error = WSAENOPROTOOPT;
return;
}
@@ -1143,8 +1682,8 @@ void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, g
linger.l_onoff=0;
linger.l_linger=0;
valsize=sizeof(linger);
- ret=setsockopt(sock, system_level, system_name,
- &linger, valsize);
+ ret = _wapi_setsockopt (sock, system_level,
+ system_name, &linger, valsize);
break;
case SocketOptionName_Linger:
@@ -1157,74 +1696,176 @@ void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, g
linger.l_linger=*(guint32 *)(((char *)obj_val)+field->offset);
valsize=sizeof(linger);
- ret=setsockopt(sock, system_level, system_name,
- &linger, valsize);
+ ret = _wapi_setsockopt (sock, system_level,
+ system_name, &linger, valsize);
break;
case SocketOptionName_AddMembership:
case SocketOptionName_DropMembership:
+#if defined(HAVE_STRUCT_IP_MREQN) || defined(HAVE_STRUCT_IP_MREQ)
{
+ MonoObject *address = NULL;
+
+#ifdef AF_INET6
+ if(system_level == sol_ipv6) {
+ struct ipv6_mreq mreq6;
+
+ /*
+ * Get group address
+ */
+ field = mono_class_get_field_from_name (obj_val->vtable->klass, "group");
+ address = *(gpointer *)(((char *)obj_val) + field->offset);
+
+ if(address) {
+ mreq6.ipv6mr_multiaddr = ipaddress_to_struct_in6_addr (address);
+ }
+
+ field=mono_class_get_field_from_name(obj_val->vtable->klass, "ifIndex");
+ mreq6.ipv6mr_interface =*(guint64 *)(((char *)obj_val)+field->offset);
+
+ ret = _wapi_setsockopt (sock, system_level,
+ system_name, &mreq6,
+ sizeof (mreq6));
+ } else if(system_level == sol_ip)
+#endif /* AF_INET6 */
+ {
#ifdef HAVE_STRUCT_IP_MREQN
- struct ip_mreqn mreq;
+ struct ip_mreqn mreq = {{0}};
#else
- struct ip_mreq mreq;
+ struct ip_mreq mreq = {{0}};
#endif /* HAVE_STRUCT_IP_MREQN */
- /* pain! MulticastOption holds two IPAddress
- * members, so I have to dig the value out of
- * those :-(
- */
- field = mono_class_get_field_from_name (obj_val->vtable->klass, "group");
- mreq.imr_multiaddr = ipaddress_to_struct_in_addr (*(gpointer *)(((char *)obj_val) +
- field->offset));
- field = mono_class_get_field_from_name (obj_val->vtable->klass, "local");
+ /* pain! MulticastOption holds two IPAddress
+ * members, so I have to dig the value out of
+ * those :-(
+ */
+ field = mono_class_get_field_from_name (obj_val->vtable->klass, "group");
+ address = *(gpointer *)(((char *)obj_val) + field->offset);
+
+ /* address might not be defined and if so, set the address to ADDR_ANY.
+ */
+ if(address) {
+ mreq.imr_multiaddr = ipaddress_to_struct_in_addr (address);
+ }
+
+ field = mono_class_get_field_from_name (obj_val->vtable->klass, "local");
+ address = *(gpointer *)(((char *)obj_val) + field->offset);
+
#ifdef HAVE_STRUCT_IP_MREQN
- mreq.imr_address = ipaddress_to_struct_in_addr (*(gpointer *)(((char *)obj_val) +
- field->offset));
+ if(address) {
+ mreq.imr_address = ipaddress_to_struct_in_addr (address);
+ }
#else
- mreq.imr_interface = ipaddress_to_struct_in_addr (*(gpointer *)(((char *)obj_val) +
- field->offset));
+ if(address) {
+ mreq.imr_interface = ipaddress_to_struct_in_addr (address);
+ }
#endif /* HAVE_STRUCT_IP_MREQN */
- ret = setsockopt (sock, system_level, system_name,
- &mreq, sizeof (mreq));
+ ret = _wapi_setsockopt (sock, system_level,
+ system_name, &mreq,
+ sizeof (mreq));
+ }
break;
}
+#endif /* HAVE_STRUCT_IP_MREQN || HAVE_STRUCT_IP_MREQ */
default:
- /* Throw an exception */
- mono_raise_exception(get_socket_exception(WSAEINVAL));
+ /* Cause an exception to be thrown */
+ *error = WSAEINVAL;
+ return;
}
} else if (byte_val!=NULL) {
int valsize=mono_array_length(byte_val);
guchar *buf=mono_array_addr(byte_val, guchar, 0);
- ret=setsockopt(sock, system_level, system_name, buf, valsize);
+ ret = _wapi_setsockopt (sock, system_level, system_name, buf, valsize);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
+ return;
}
} else {
- ret=setsockopt(sock, system_level, system_name, &int_val,
+ switch(name) {
+ case SocketOptionName_SendTimeout:
+ case SocketOptionName_ReceiveTimeout: {
+ struct timeval tv;
+ tv.tv_sec = int_val / 1000;
+ tv.tv_usec = (int_val % 1000) * 1000;
+ ret = _wapi_setsockopt (sock, system_level, system_name, &tv, sizeof (tv));
+ break;
+ }
+ default:
+ ret = _wapi_setsockopt (sock, system_level, system_name, &int_val,
sizeof(int_val));
+ }
}
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
}
void ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock,
- gint32 how)
+ gint32 how,
+ gint32 *error)
{
int ret;
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
/* Currently, the values for how (recv=0, send=1, both=2) match
* the BSD API
*/
- ret=shutdown(sock, how);
+ ret = _wapi_shutdown (sock, how);
if(ret==SOCKET_ERROR) {
- mono_raise_exception(get_socket_exception(WSAGetLastError()));
+ *error = WSAGetLastError ();
}
}
+gint
+ves_icall_System_Net_Sockets_Socket_WSAIoctl (SOCKET sock, gint32 code,
+ MonoArray *input,
+ MonoArray *output, gint32 *error)
+{
+ gulong output_bytes = 0;
+ gchar *i_buffer, *o_buffer;
+ gint i_len, o_len;
+ gint ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *error = 0;
+
+ if (code == FIONBIO) {
+ /* Invalid command. Must use Socket.Blocking */
+ return -1;
+ }
+
+ if (input == NULL) {
+ i_buffer = NULL;
+ i_len = 0;
+ } else {
+ i_buffer = mono_array_addr (input, gchar, 0);
+ i_len = mono_array_length (input);
+ }
+
+ if (output == NULL) {
+ o_buffer = NULL;
+ o_len = 0;
+ } else {
+ o_buffer = mono_array_addr (output, gchar, 0);
+ o_len = mono_array_length (output);
+ }
+
+ ret = WSAIoctl (sock, code, i_buffer, i_len, o_buffer, o_len, &output_bytes, NULL, NULL);
+ if (ret == SOCKET_ERROR) {
+ *error = WSAGetLastError ();
+ return(-1);
+ }
+
+ return (gint) output_bytes;
+}
+
+#ifndef AF_INET6
static gboolean hostent_to_IPHostEntry(struct hostent *he, MonoString **h_name,
MonoArray **h_aliases,
MonoArray **h_addr_list)
@@ -1243,7 +1884,7 @@ static gboolean hostent_to_IPHostEntry(struct hostent *he, MonoString **h_name,
i++;
}
- *h_aliases=mono_array_new(domain, mono_defaults.string_class, i);
+ *h_aliases=mono_array_new(domain, mono_get_string_class (), i);
i=0;
while(he->h_aliases[i]!=NULL) {
MonoString *alias;
@@ -1258,7 +1899,7 @@ static gboolean hostent_to_IPHostEntry(struct hostent *he, MonoString **h_name,
i++;
}
- *h_addr_list=mono_array_new(domain, mono_defaults.string_class, i);
+ *h_addr_list=mono_array_new(domain, mono_get_string_class (), i);
i=0;
while(he->h_addr_list[i]!=NULL) {
MonoString *addr_string;
@@ -1277,22 +1918,303 @@ static gboolean hostent_to_IPHostEntry(struct hostent *he, MonoString **h_name,
return(TRUE);
}
+#endif
-extern gboolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
+#if defined(AF_INET6) && defined(HAVE_GETHOSTBYNAME2_R)
+static gboolean hostent_to_IPHostEntry2(struct hostent *he1,struct hostent *he2, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
{
+ MonoDomain *domain = mono_domain_get ();
+ int i, host_count, host_index, family_hint;
+
+ family_hint = get_family_hint ();
+
+ if(he1 == NULL && he2 == NULL) {
+ return(FALSE);
+ }
+
+ /*
+ * Check if address length and family are correct
+ */
+ if (he1 != NULL && (he1->h_length!=4 || he1->h_addrtype!=AF_INET)) {
+ return(FALSE);
+ }
+
+ if (he2 != NULL && (he2->h_length!=16 || he2->h_addrtype!=AF_INET6)) {
+ return(FALSE);
+ }
+
+ /*
+ * Get the aliases and host name from he1 or he2 whichever is
+ * not null, if he1 is not null then take aliases from he1
+ */
+ if (he1 != NULL && (family_hint == PF_UNSPEC ||
+ family_hint == PF_INET)) {
+ *h_name=mono_string_new (domain, he1->h_name);
+
+ i=0;
+ while(he1->h_aliases[i]!=NULL) {
+ i++;
+ }
+
+ *h_aliases=mono_array_new (domain, mono_get_string_class (),
+ i);
+ i=0;
+ while(he1->h_aliases[i]!=NULL) {
+ MonoString *alias;
+
+ alias=mono_string_new (domain, he1->h_aliases[i]);
+ mono_array_set (*h_aliases, MonoString *, i, alias);
+ i++;
+ }
+ } else if (family_hint == PF_UNSPEC || family_hint == PF_INET6) {
+ *h_name=mono_string_new (domain, he2->h_name);
+
+ i=0;
+ while(he2->h_aliases [i] != NULL) {
+ i++;
+ }
+
+ *h_aliases=mono_array_new (domain, mono_get_string_class (),
+ i);
+ i=0;
+ while(he2->h_aliases[i]!=NULL) {
+ MonoString *alias;
+
+ alias=mono_string_new (domain, he2->h_aliases[i]);
+ mono_array_set (*h_aliases, MonoString *, i, alias);
+ i++;
+ }
+ }
+
+ /*
+ * Count the number of addresses in he1 + he2
+ */
+ host_count = 0;
+ if (he1 != NULL && (family_hint == PF_UNSPEC ||
+ family_hint == PF_INET)) {
+ i=0;
+ while(he1->h_addr_list[i]!=NULL) {
+ i++;
+ host_count++;
+ }
+ }
+
+ if (he2 != NULL && (family_hint == PF_UNSPEC ||
+ family_hint == PF_INET6)) {
+ i=0;
+ while(he2->h_addr_list[i]!=NULL) {
+ i++;
+ host_count++;
+ }
+ }
+
+ /*
+ * Fills the array
+ */
+ *h_addr_list=mono_array_new (domain, mono_get_string_class (),
+ host_count);
+
+ host_index = 0;
+
+ if (he2 != NULL && (family_hint == PF_UNSPEC ||
+ family_hint == PF_INET6)) {
+ i = 0;
+ while(he2->h_addr_list[i] != NULL) {
+ MonoString *addr_string;
+ char addr[40];
+
+ inet_ntop (AF_INET6, he2->h_addr_list[i], addr,
+ sizeof(addr));
+
+ addr_string = mono_string_new (domain, addr);
+ mono_array_set (*h_addr_list, MonoString *, host_index,
+ addr_string);
+ i++;
+ host_index++;
+ }
+ }
+
+ if (he1 != NULL && (family_hint == PF_UNSPEC ||
+ family_hint == PF_INET)) {
+ i=0;
+ while(he1->h_addr_list[i] != NULL) {
+ MonoString *addr_string;
+ char addr[17];
+
+ inet_ntop (AF_INET, he1->h_addr_list[i], addr,
+ sizeof(addr));
+
+ addr_string=mono_string_new (domain, addr);
+ mono_array_set (*h_addr_list, MonoString *, host_index,
+ addr_string);
+ i++;
+ host_index++;
+ }
+ }
+
+ return(TRUE);
+}
+#endif
+
+#if defined(AF_INET6)
+static gboolean
+addrinfo_to_IPHostEntry(struct addrinfo *info, MonoString **h_name,
+ MonoArray **h_aliases,
+ MonoArray **h_addr_list)
+{
+ gint32 count, i;
+ struct addrinfo *ai = NULL;
+
+ MonoDomain *domain = mono_domain_get ();
+
+ for (count=0, ai=info; ai!=NULL; ai=ai->ai_next) {
+ if((ai->ai_family != PF_INET) && (ai->ai_family != PF_INET6)) {
+ continue;
+ }
+
+ count++;
+ }
+
+ *h_aliases=mono_array_new(domain, mono_get_string_class (), 0);
+ *h_addr_list=mono_array_new(domain, mono_get_string_class (), count);
+
+ for (ai=info, i=0; ai!=NULL; ai=ai->ai_next) {
+ MonoString *addr_string;
+ const char *ret;
+ char *buffer;
+ gint32 buffer_size = 0;
+
+ if((ai->ai_family != PF_INET) && (ai->ai_family != PF_INET6)) {
+ continue;
+ }
+
+ buffer_size = 256;
+ do {
+ buffer = g_malloc0(buffer_size);
+
+ if(ai->ai_family == PF_INET) {
+ ret = inet_ntop(ai->ai_family, (void*)&(((struct sockaddr_in*)ai->ai_addr)->sin_addr), buffer, buffer_size);
+ } else {
+ ret = inet_ntop(ai->ai_family, (void*)&(((struct sockaddr_in6*)ai->ai_addr)->sin6_addr), buffer, buffer_size);
+ }
+
+ if(ret == 0) {
+ g_free(buffer);
+ buffer_size += 256;
+ }
+ } while(ret == 0 && errno == ENOSPC);
+
+ if(ret) {
+ addr_string=mono_string_new(domain, buffer);
+ g_free(buffer);
+ } else {
+ addr_string=mono_string_new(domain, "");
+ }
+
+ mono_array_set(*h_addr_list, MonoString *, i, addr_string);
+
+ if(!i && ai->ai_canonname != NULL) {
+ *h_name=mono_string_new(domain, ai->ai_canonname);
+ }
+
+ i++;
+ }
+
+ if(info) {
+ freeaddrinfo(info);
+ }
+
+ return(TRUE);
+}
+#endif
+
+#ifdef AF_INET6
+MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
+{
+#if !defined(HAVE_GETHOSTBYNAME2_R)
+ struct addrinfo *info = NULL, hints;
char *hostname;
+
+ MONO_ARCH_SAVE_REGS;
+
+ hostname=mono_string_to_utf8 (host);
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = get_family_hint ();
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_CANONNAME;
+
+ if (getaddrinfo(hostname, NULL, &hints, &info) == -1) {
+ return(FALSE);
+ }
+
+ g_free(hostname);
+
+ return(addrinfo_to_IPHostEntry(info, h_name, h_aliases, h_addr_list));
+#else
+ struct hostent he1,*hp1, he2, *hp2;
+ int buffer_size1, buffer_size2;
+ char *buffer1, *buffer2;
+ int herr;
+ gboolean return_value;
+ char *hostname;
+
+ MONO_ARCH_SAVE_REGS;
+
+ hostname=mono_string_to_utf8 (host);
+
+ buffer_size1 = 512;
+ buffer_size2 = 512;
+ buffer1 = g_malloc0(buffer_size1);
+ buffer2 = g_malloc0(buffer_size2);
+
+ while (gethostbyname2_r(hostname, AF_INET, &he1, buffer1, buffer_size1,
+ &hp1, &herr) == ERANGE) {
+ buffer_size1 *= 2;
+ buffer1 = g_realloc(buffer1, buffer_size1);
+ }
+
+ if (hp1 == NULL)
+ {
+ while (gethostbyname2_r(hostname, AF_INET6, &he2, buffer2,
+ buffer_size2, &hp2, &herr) == ERANGE) {
+ buffer_size2 *= 2;
+ buffer2 = g_realloc(buffer2, buffer_size2);
+ }
+ }
+ else
+ hp2 = NULL;
+
+ return_value = hostent_to_IPHostEntry2(hp1, hp2, h_name, h_aliases,
+ h_addr_list);
+
+ g_free(buffer1);
+ g_free(buffer2);
+ g_free(hostname);
+
+ return(return_value);
+#endif /* HAVE_GETHOSTBYNAME2_R */
+}
+#else /* AF_INET6 */
+MonoBoolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
+{
struct hostent *he;
+ char *hostname;
+ MONO_ARCH_SAVE_REGS;
+
hostname=mono_string_to_utf8(host);
- he=gethostbyname(hostname);
+
+ he = _wapi_gethostbyname (hostname);
g_free(hostname);
-
+
if(he==NULL) {
return(FALSE);
}
return(hostent_to_IPHostEntry(he, h_name, h_aliases, h_addr_list));
}
+#endif /* AF_INET6 */
#ifndef HAVE_INET_PTON
static int
@@ -1333,25 +2255,185 @@ inet_pton (int family, const char *address, void *inaddrp)
}
#endif /* !HAVE_INET_PTON */
-extern gboolean 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_GetHostByAddr_internal(MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list)
{
+ char *address;
+
+#ifdef AF_INET6
+ struct sockaddr_in saddr;
+ struct sockaddr_in6 saddr6;
+ struct addrinfo *info = NULL, hints;
+ gint32 family;
+ char hostname[1024] = {0};
+#else
struct in_addr inaddr;
struct hostent *he;
- char *address;
-
+#endif
+
+ MONO_ARCH_SAVE_REGS;
+
address = mono_string_to_utf8 (addr);
+
+#ifdef AF_INET6
+ if (inet_pton (AF_INET, address, &saddr.sin_addr ) <= 0) {
+ /* Maybe an ipv6 address */
+ if (inet_pton (AF_INET6, address, &saddr6.sin6_addr) <= 0) {
+ g_free (address);
+ return FALSE;
+ }
+ else {
+ family = AF_INET6;
+ saddr6.sin6_family = AF_INET6;
+ }
+ }
+ else {
+ family = AF_INET;
+ saddr.sin_family = AF_INET;
+ }
+ g_free(address);
+
+ if(family == AF_INET) {
+ if(getnameinfo ((struct sockaddr*)&saddr, sizeof(saddr),
+ hostname, sizeof(hostname), NULL, 0,
+ NI_NAMEREQD) != 0) {
+ return(FALSE);
+ }
+ } else if(family == AF_INET6) {
+ if(getnameinfo ((struct sockaddr*)&saddr6, sizeof(saddr6),
+ hostname, sizeof(hostname), NULL, 0,
+ NI_NAMEREQD) != 0) {
+ return(FALSE);
+ }
+ }
+
+ memset (&hints, 0, sizeof(hints));
+ hints.ai_family = get_family_hint ();
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_CANONNAME;
+
+ if( getaddrinfo (hostname, NULL, &hints, &info) == -1 ) {
+ return(FALSE);
+ }
+
+ return(addrinfo_to_IPHostEntry (info, h_name, h_aliases, h_addr_list));
+#else
if (inet_pton (AF_INET, address, &inaddr) <= 0) {
g_free (address);
- return FALSE;
+ return(FALSE);
}
-
g_free (address);
- if ((he = gethostbyaddr ((char *) &inaddr, sizeof (inaddr), AF_INET)) == NULL)
- return FALSE;
+
+ if ((he = gethostbyaddr ((char *) &inaddr, sizeof (inaddr), AF_INET)) == NULL) {
+ return(FALSE);
+ }
+
+ return(hostent_to_IPHostEntry (he, h_name, h_aliases, h_addr_list));
+#endif
+}
+
+extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_name)
+{
+ guchar hostname[256];
+ int ret;
- return(hostent_to_IPHostEntry(he, h_name, h_aliases, h_addr_list));
+ MONO_ARCH_SAVE_REGS;
+
+ ret = gethostname (hostname, sizeof (hostname));
+ if(ret==-1) {
+ return(FALSE);
+ }
+
+ *h_name=mono_string_new(mono_domain_get (), hostname);
+
+ return(TRUE);
+}
+
+
+/* Async interface */
+#ifndef USE_AIO
+void
+ves_icall_System_Net_Sockets_Socket_AsyncReceive (MonoSocketAsyncResult *ares, gint *error)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ *error = ERROR_NOT_SUPPORTED;
+}
+
+void
+ves_icall_System_Net_Sockets_Socket_AsyncSend (MonoSocketAsyncResult *ares, gint *error)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ *error = ERROR_NOT_SUPPORTED;
+}
+#else
+static void
+wsa_overlapped_callback (guint32 error, guint32 numbytes, gpointer result)
+{
+ MonoSocketAsyncResult *ares = (MonoSocketAsyncResult *) result;
+ MonoThread *thread;
+
+ ares->completed = TRUE;
+ ares->error = error;
+ ares->total = numbytes;
+
+ if (ares->callback != NULL) {
+ gpointer p [1];
+
+ *p = ares;
+ thread = mono_thread_attach (mono_object_domain (ares));
+ mono_runtime_invoke (ares->callback->method_info->method, NULL, p, NULL);
+
+ mono_thread_detach (thread);
+ }
+
+ if (ares->wait_handle != NULL)
+ SetEvent (ares->wait_handle->handle);
}
+void
+ves_icall_System_Net_Sockets_Socket_AsyncReceive (MonoSocketAsyncResult *ares, gint *error)
+{
+ gint32 bytesread;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (_wapi_socket_async_read (ares->handle,
+ mono_array_addr (ares->buffer, gchar, ares->offset),
+ ares->size,
+ &bytesread,
+ ares,
+ wsa_overlapped_callback) == FALSE) {
+ *error = WSAGetLastError ();
+ } else {
+ *error = 0;
+ ares->completed_synch = TRUE;
+ wsa_overlapped_callback (0, bytesread, ares);
+ }
+}
+
+void
+ves_icall_System_Net_Sockets_Socket_AsyncSend (MonoSocketAsyncResult *ares, gint *error)
+{
+ gint32 byteswritten;
+
+ MONO_ARCH_SAVE_REGS;
+
+ if (_wapi_socket_async_write (ares->handle,
+ mono_array_addr (ares->buffer, gchar, ares->offset),
+ ares->size,
+ &byteswritten,
+ ares,
+ wsa_overlapped_callback) == FALSE) {
+ *error = WSAGetLastError ();
+ } else {
+ *error = 0;
+ ares->completed_synch = TRUE;
+ wsa_overlapped_callback (0, byteswritten, ares);
+ }
+}
+#endif /* USE_AIO */
+
void mono_network_init(void)
{
WSADATA wsadata;
@@ -1373,3 +2455,4 @@ void mono_network_cleanup(void)
{
WSACleanup();
}
+
diff --git a/mono/metadata/socket-io.h b/mono/metadata/socket-io.h
index 43499b19fed..5c2ee72181a 100644
--- a/mono/metadata/socket-io.h
+++ b/mono/metadata/socket-io.h
@@ -13,7 +13,7 @@
#include <config.h>
#include <glib.h>
-#include <mono/metadata/object.h>
+#include <mono/metadata/object-internals.h>
#include <mono/io-layer/io-layer.h>
/* This is a copy of System.Net.Sockets.SocketType */
@@ -23,7 +23,7 @@ typedef enum {
SocketType_Raw=3,
SocketType_Rdm=4,
SocketType_Seqpacket=5,
- SocketType_Unknown=-1,
+ SocketType_Unknown=-1
} MonoSocketType;
/* This is a copy of System.Net.Sockets.AddressFamily */
@@ -57,7 +57,7 @@ typedef enum {
AddressFamily_Cluster=24,
AddressFamily_Ieee12844=25,
AddressFamily_Irda=26,
- AddressFamily_NetworkDesigners=28,
+ AddressFamily_NetworkDesigners=28
} MonoAddressFamily;
/* This is a copy of System.Net.Sockets.ProtocolType */
@@ -70,21 +70,23 @@ typedef enum {
ProtocolType_Pup=12,
ProtocolType_Udp=17,
ProtocolType_Idp=22,
+ ProtocolType_IPv6=41,
ProtocolType_ND=77,
ProtocolType_Raw=255,
ProtocolType_Unspecified=0,
ProtocolType_Ipx=1000,
ProtocolType_Spx=1256,
ProtocolType_SpxII=1257,
- ProtocolType_Unknown=-1,
+ ProtocolType_Unknown=-1
} MonoProtocolType;
/* This is a copy of System.Net.Sockets.SocketOptionLevel */
typedef enum {
SocketOptionLevel_Socket=65535,
SocketOptionLevel_IP=0,
+ SocketOptionLevel_IPv6=41,
SocketOptionLevel_Tcp=6,
- SocketOptionLevel_Udp=17,
+ SocketOptionLevel_Udp=17
} MonoSocketOptionLevel;
/* This is a copy of System.Net.Sockets.SocketOptionName */
@@ -129,30 +131,70 @@ typedef enum {
SocketOptionName_Expedited=2,
SocketOptionName_NoChecksum=1,
SocketOptionName_ChecksumCoverage=20,
+
+ /* This is Mono-specific, keep it in sync with
+ * Mono.Posix/PeerCred.cs
+ */
+ SocketOptionName_PeerCred=10001
} MonoSocketOptionName;
-extern gpointer ves_icall_System_Net_Sockets_Socket_Socket_internal(MonoObject *this, gint32 family, gint32 type, gint32 proto);
-extern void ves_icall_System_Net_Sockets_Socket_Close_internal(SOCKET sock);
+typedef struct _MonoSocketAsyncResult {
+ MonoObject obj;
+ MonoObject *socket;
+ HANDLE handle;
+ MonoObject *state;
+ MonoDelegate *callback;
+ MonoWaitHandle *wait_handle;
+ MonoException *delayed_exc;
+ MonoObject *ep;
+ MonoArray *buffer;
+ gint offset;
+ gint size;
+ gint socket_flags;
+ MonoObject *acc_socket;
+ gint total;
+ MonoBoolean completed_synch;
+ MonoBoolean completed;
+ MonoDelegate *real_callback;
+ gint error;
+} MonoSocketAsyncResult;
+
+typedef struct
+{
+ MonoObject obj;
+ gint pid;
+ gint uid;
+ gint gid;
+} MonoPeerCredData;
+
+extern gpointer ves_icall_System_Net_Sockets_Socket_Socket_internal(MonoObject *this, gint32 family, gint32 type, gint32 proto, gint32 *error);
+extern void ves_icall_System_Net_Sockets_Socket_Close_internal(SOCKET sock, gint32 *error);
extern gint32 ves_icall_System_Net_Sockets_SocketException_WSAGetLastError_internal(void);
-extern gint32 ves_icall_System_Net_Sockets_Socket_Available_internal(SOCKET sock);
-extern void ves_icall_System_Net_Sockets_Socket_Blocking_internal(SOCKET sock, gboolean block);
-extern gpointer ves_icall_System_Net_Sockets_Socket_Accept_internal(SOCKET sock);
-extern void ves_icall_System_Net_Sockets_Socket_Listen_internal(SOCKET sock, guint32 backlog);
-extern MonoObject *ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal(SOCKET sock);
-extern MonoObject *ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal(SOCKET sock);
-extern void ves_icall_System_Net_Sockets_Socket_Bind_internal(SOCKET sock, MonoObject *sockaddr);
-extern void ves_icall_System_Net_Sockets_Socket_Connect_internal(SOCKET sock, MonoObject *sockaddr);
-extern gint32 ves_icall_System_Net_Sockets_Socket_Receive_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags);
-extern gint32 ves_icall_System_Net_Sockets_Socket_RecvFrom_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject **sockaddr);
-extern gint32 ves_icall_System_Net_Sockets_Socket_Send_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags);
-extern gint32 ves_icall_System_Net_Sockets_Socket_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr);
-extern void ves_icall_System_Net_Sockets_Socket_Select_internal(MonoArray **read_socks, MonoArray **write_socks, MonoArray **err_socks, gint32 timeout);
-extern void ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock, gint32 how);
-extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal(SOCKET sock, gint32 level, gint32 name, MonoObject **obj_val);
-extern void ves_icall_System_Net_Sockets_Socket_GetSocketOption_arr_internal(SOCKET sock, gint32 level, gint32 name, MonoArray **byte_val);
-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);
-extern gboolean ves_icall_System_Net_Dns_GetHostByName_internal(MonoString *host, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
-extern gboolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *addr, MonoString **h_name, MonoArray **h_aliases, MonoArray **h_addr_list);
+extern gint32 ves_icall_System_Net_Sockets_Socket_Available_internal(SOCKET sock, gint32 *error);
+extern void ves_icall_System_Net_Sockets_Socket_Blocking_internal(SOCKET sock, gboolean block, gint32 *error);
+extern gpointer ves_icall_System_Net_Sockets_Socket_Accept_internal(SOCKET sock, gint32 *error);
+extern void ves_icall_System_Net_Sockets_Socket_Listen_internal(SOCKET sock, guint32 backlog, gint32 *error);
+extern MonoObject *ves_icall_System_Net_Sockets_Socket_LocalEndPoint_internal(SOCKET sock, gint32 *error);
+extern MonoObject *ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal(SOCKET sock, gint32 *error);
+extern void ves_icall_System_Net_Sockets_Socket_Bind_internal(SOCKET sock, MonoObject *sockaddr, 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_RecvFrom_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_SendTo_internal(SOCKET sock, MonoArray *buffer, gint32 offset, gint32 count, gint32 flags, MonoObject *sockaddr, gint32 *error);
+extern void ves_icall_System_Net_Sockets_Socket_Select_internal(MonoArray **read_socks, MonoArray **write_socks, MonoArray **err_socks, gint32 timeout, gint32 *error);
+extern void ves_icall_System_Net_Sockets_Socket_Shutdown_internal(SOCKET sock, gint32 how, 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 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_AsyncReceive (MonoSocketAsyncResult *ares, gint *error);
+extern void ves_icall_System_Net_Sockets_Socket_AsyncSend (MonoSocketAsyncResult *ares, gint *error);
extern void mono_network_init(void);
extern void mono_network_cleanup(void);
diff --git a/mono/metadata/string-icalls.c b/mono/metadata/string-icalls.c
index 428036e4f52..e77fea88fef 100644
--- a/mono/metadata/string-icalls.c
+++ b/mono/metadata/string-icalls.c
@@ -13,12 +13,19 @@
#include <signal.h>
#include <string.h>
#include <mono/metadata/string-icalls.h>
+#include <mono/metadata/class-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/object.h>
#include <mono/metadata/unicode.h>
#include <mono/metadata/exception.h>
+#include <mono/metadata/debug-helpers.h>
+
+/* Internal helper methods */
+
+static gboolean
+string_icall_is_in_array (MonoArray *chars, gint32 arraylength, gunichar2 chr);
MonoString *
ves_icall_System_String_ctor_charp (gpointer dummy, gunichar2 *value)
@@ -26,6 +33,8 @@ ves_icall_System_String_ctor_charp (gpointer dummy, gunichar2 *value)
gint32 i, length;
MonoDomain *domain;
+ MONO_ARCH_SAVE_REGS;
+
domain = mono_domain_get ();
if (value == NULL)
@@ -46,6 +55,11 @@ ves_icall_System_String_ctor_char_int (gpointer dummy, gunichar2 value, gint32 c
gunichar2 *chars;
gint32 i;
+ MONO_ARCH_SAVE_REGS;
+
+ if (count < 0)
+ mono_raise_exception (mono_get_exception_argument_out_of_range ("count"));
+
domain = mono_domain_get ();
res = mono_string_new_size (domain, count);
@@ -62,6 +76,8 @@ ves_icall_System_String_ctor_charp_int_int (gpointer dummy, gunichar2 *value, gi
gunichar2 *begin;
MonoDomain * domain;
+ MONO_ARCH_SAVE_REGS;
+
domain = mono_domain_get ();
if ((value == NULL) && (length != 0))
@@ -85,6 +101,8 @@ ves_icall_System_String_ctor_sbytep (gpointer dummy, gint8 *value)
{
MonoDomain *domain;
+ MONO_ARCH_SAVE_REGS;
+
domain = mono_domain_get ();
if (NULL == value) { /* fixme: return String.Empty here */
@@ -98,9 +116,14 @@ ves_icall_System_String_ctor_sbytep (gpointer dummy, gint8 *value)
MonoString *
ves_icall_System_String_ctor_sbytep_int_int (gpointer dummy, gint8 *value, gint32 sindex, gint32 length)
{
- char *begin;
+ guchar *begin;
MonoDomain *domain;
+ MonoString *res;
+ gunichar2 *chars;
+ int i;
+ MONO_ARCH_SAVE_REGS;
+
domain = mono_domain_get ();
if ((value == NULL) && (length != 0))
@@ -109,9 +132,13 @@ ves_icall_System_String_ctor_sbytep_int_int (gpointer dummy, gint8 *value, gint3
if ((sindex < 0) || (length < 0))
mono_raise_exception (mono_get_exception_argument_out_of_range ("Out of range"));
- begin = (char *) (value + sindex);
+ begin = (guchar *) (value + sindex);
+ res = mono_string_new_size (domain, length);
+ chars = mono_string_chars (res);
+ for (i = 0; i < length; ++i)
+ chars [i] = begin [i];
- return mono_string_new_len (domain, begin, length);
+ return res;
}
MonoString *
@@ -119,11 +146,14 @@ ves_icall_System_String_ctor_chara (gpointer dummy, MonoArray *value)
{
MonoDomain *domain;
- MONO_CHECK_ARG_NULL (value);
-
+ MONO_ARCH_SAVE_REGS;
+
domain = mono_domain_get ();
-
- return mono_string_new_utf16 (domain, (gunichar2 *) mono_array_addr(value, gunichar2, 0), value->max_length);
+
+ if (value == NULL)
+ return mono_string_new_utf16 (domain, NULL, 0);
+ else
+ return mono_string_new_utf16 (domain, (gunichar2 *) mono_array_addr(value, gunichar2, 0), value->max_length);
}
MonoString *
@@ -132,7 +162,16 @@ ves_icall_System_String_ctor_chara_int_int (gpointer dummy, MonoArray *value,
{
MonoDomain *domain;
- MONO_CHECK_ARG_NULL (value);
+ MONO_ARCH_SAVE_REGS;
+
+ if (value == NULL)
+ mono_raise_exception (mono_get_exception_argument_null ("value"));
+ if (sindex < 0)
+ mono_raise_exception (mono_get_exception_argument_out_of_range ("startIndex"));
+ if (length < 0)
+ mono_raise_exception (mono_get_exception_argument_out_of_range ("length"));
+ if (sindex + length > mono_array_length (value))
+ mono_raise_exception (mono_get_exception_argument_out_of_range ("Out of range"));
domain = mono_domain_get ();
@@ -143,31 +182,40 @@ MonoString *
ves_icall_System_String_ctor_encoding (gpointer dummy, gint8 *value, gint32 sindex,
gint32 length, MonoObject *enc)
{
- g_warning("string.ctor with encoding obj unimplemented");
- g_assert_not_reached ();
- return NULL;
-}
+ MONO_ARCH_SAVE_REGS;
+ MonoArray *arr;
+ MonoString *s;
+ MonoObject *exc;
+ MonoDomain *domain = mono_domain_get ();
+ MonoMethod *get_string;
+ gpointer args [1];
-MonoBoolean
-ves_icall_System_String_InternalEquals (MonoString *str1, MonoString *str2)
-{
- gunichar2 *str1ptr;
- gunichar2 *str2ptr;
- gint32 str1len;
+ if ((value == NULL) || (length == 0))
+ return mono_string_new_size (mono_domain_get (), 0);
+ if (enc == NULL)
+ mono_raise_exception (mono_get_exception_argument_null ("enc"));
+ if (sindex < 0)
+ mono_raise_exception (mono_get_exception_argument_out_of_range ("startIndex"));
+ if (length < 0)
+ mono_raise_exception (mono_get_exception_argument_out_of_range ("length"));
- /* Length checking is done in C# */
- str1len = mono_string_length(str1);
+ arr = mono_array_new (domain, mono_defaults.byte_class, length);
+ memcpy (mono_array_addr (arr, guint8*, 0), value + sindex, length);
- str1ptr = mono_string_chars(str1);
- str2ptr = mono_string_chars(str2);
+ get_string = mono_find_method_by_name (enc->vtable->klass, "GetString", 1);
+ args [0] = arr;
+ s = (MonoString*)mono_runtime_invoke (get_string, enc, args, &exc);
+ if (!s || exc)
+ mono_raise_exception (mono_get_exception_argument ("", "Unable to decode the array into a valid string."));
- return (0 == memcmp(str1ptr, str2ptr, str1len * sizeof(gunichar2)));
+ return s;
}
MonoString *
ves_icall_System_String_InternalJoin (MonoString *separator, MonoArray * value, gint32 sindex, gint32 count)
{
MonoString * ret;
+ MonoString *current;
gint32 length;
gint32 pos;
gint32 insertlen;
@@ -177,12 +225,17 @@ ves_icall_System_String_InternalJoin (MonoString *separator, MonoArray * value,
gunichar2 *dest;
gunichar2 *src;
+ MONO_ARCH_SAVE_REGS;
+
insert = mono_string_chars(separator);
insertlen = mono_string_length(separator);
length = 0;
for (pos = sindex; pos != sindex + count; pos++) {
- length += mono_string_length(mono_array_get(value, MonoString *, pos));
+ current = mono_array_get (value, MonoString *, pos);
+ if (current != NULL)
+ length += mono_string_length (current);
+
if (pos < sindex + count - 1)
length += insertlen;
}
@@ -192,11 +245,14 @@ ves_icall_System_String_InternalJoin (MonoString *separator, MonoArray * value,
destpos = 0;
for (pos = sindex; pos != sindex + count; pos++) {
- src = mono_string_chars(mono_array_get(value, MonoString *, pos));
- srclen = mono_string_length(mono_array_get(value, MonoString *, pos));
+ current = mono_array_get (value, MonoString *, pos);
+ if (current != NULL) {
+ src = mono_string_chars (current);
+ srclen = mono_string_length (current);
- memcpy(dest + destpos, src, srclen * sizeof(gunichar2));
- destpos += srclen;
+ memcpy (dest + destpos, src, srclen * sizeof(gunichar2));
+ destpos += srclen;
+ }
if (pos < sindex + count - 1) {
memcpy(dest + destpos, insert, insertlen * sizeof(gunichar2));
@@ -217,6 +273,8 @@ ves_icall_System_String_InternalInsert (MonoString *me, gint32 sindex, MonoStrin
gint32 srclen;
gint32 insertlen;
+ MONO_ARCH_SAVE_REGS;
+
src = mono_string_chars(me);
srclen = mono_string_length(me);
@@ -241,6 +299,8 @@ ves_icall_System_String_InternalReplace_Char (MonoString *me, gunichar2 oldChar,
gunichar2 *dest;
gint32 i, srclen;
+ MONO_ARCH_SAVE_REGS;
+
src = mono_string_chars(me);
srclen = mono_string_length(me);
@@ -258,66 +318,6 @@ ves_icall_System_String_InternalReplace_Char (MonoString *me, gunichar2 oldChar,
}
MonoString *
-ves_icall_System_String_InternalReplace_Str (MonoString *me, MonoString *oldValue, MonoString *newValue)
-{
- MonoString *ret;
- gunichar2 *src;
- gunichar2 *dest;
- gunichar2 *oldstr;
- gunichar2 *newstr;
- gint32 i, destpos;
- gint32 occurr;
- gint32 newsize;
- gint32 oldstrlen;
- gint32 newstrlen;
- gint32 srclen;
-
- occurr = 0;
- destpos = 0;
-
- oldstr = mono_string_chars(oldValue);
- oldstrlen = mono_string_length(oldValue);
-
- if (NULL != newValue) {
- newstr = mono_string_chars(newValue);
- newstrlen = mono_string_length(newValue);
- } else
- newstrlen = 0;
-
- src = mono_string_chars(me);
- srclen = mono_string_length(me);
-
- if (oldstrlen != newstrlen) {
- for (i = 0; i <= srclen - oldstrlen; i++)
- if (0 == memcmp(src + i, oldstr, oldstrlen * sizeof(gunichar2)))
- occurr++;
-
- newsize = srclen + ((newstrlen - oldstrlen) * occurr);
- } else
- newsize = srclen;
-
- ret = mono_string_new_size( mono_domain_get (), newsize);
- dest = mono_string_chars(ret);
-
- i = 0;
- while (i < srclen) {
- if (0 == memcmp(src + i, oldstr, oldstrlen * sizeof(gunichar2))) {
- if (newstrlen > 0) {
- memcpy(dest + destpos, newstr, newstrlen * sizeof(gunichar2));
- destpos += newstrlen;
- }
- i += oldstrlen;
- } else {
- dest[destpos] = src[i];
- destpos++;
- i++;
- }
- }
-
- return ret;
-}
-
-MonoString *
ves_icall_System_String_InternalRemove (MonoString *me, gint32 sindex, gint32 count)
{
MonoString * ret;
@@ -325,6 +325,8 @@ ves_icall_System_String_InternalRemove (MonoString *me, gint32 sindex, gint32 co
gunichar2 *dest;
gunichar2 *src;
+ MONO_ARCH_SAVE_REGS;
+
srclen = mono_string_length(me);
ret = mono_string_new_size( mono_domain_get (), srclen - count);
@@ -343,6 +345,8 @@ ves_icall_System_String_InternalCopyTo (MonoString *me, gint32 sindex, MonoArray
gunichar2 *destptr = (gunichar2 *) mono_array_addr(dest, gunichar2, dindex);
gunichar2 *src = mono_string_chars(me);
+ MONO_ARCH_SAVE_REGS;
+
memcpy(destptr, src + sindex, sizeof(gunichar2) * count);
}
@@ -359,6 +363,8 @@ ves_icall_System_String_InternalSplit (MonoString *me, MonoArray *separator, gin
gunichar2 cmpchar;
+ MONO_ARCH_SAVE_REGS;
+
src = mono_string_chars(me);
srcsize = mono_string_length(me);
arrsize = mono_array_length(separator);
@@ -376,12 +382,8 @@ ves_icall_System_String_InternalSplit (MonoString *me, MonoArray *separator, gin
/* if no split chars found return the string */
if (splitsize == 0) {
- retarr = mono_array_new(mono_domain_get(), mono_defaults.string_class, 1);
- tmpstr = mono_string_new_size( mono_domain_get (), srcsize);
- tmpstrptr = mono_string_chars(tmpstr);
-
- memcpy(tmpstrptr, src, srcsize * sizeof(gunichar2));
- mono_array_set(retarr, MonoString *, 0, tmpstr);
+ retarr = mono_array_new(mono_domain_get(), mono_get_string_class (), 1);
+ mono_array_set(retarr, MonoString *, 0, me);
return retarr;
}
@@ -389,7 +391,7 @@ ves_icall_System_String_InternalSplit (MonoString *me, MonoArray *separator, gin
if (splitsize != count)
splitsize++;
- retarr = mono_array_new(mono_domain_get(), mono_defaults.string_class, splitsize);
+ retarr = mono_array_new(mono_domain_get(), mono_get_string_class (), splitsize);
for (i = 0; i != srcsize && arrpos != count; i++) {
if (string_icall_is_in_array(separator, arrsize, src[i])) {
if (arrpos == count - 1)
@@ -419,7 +421,7 @@ ves_icall_System_String_InternalSplit (MonoString *me, MonoArray *separator, gin
return retarr;
}
-gboolean
+static gboolean
string_icall_is_in_array (MonoArray *chars, gint32 arraylength, gunichar2 chr)
{
gunichar2 cmpchar;
@@ -442,6 +444,8 @@ ves_icall_System_String_InternalTrim (MonoString *me, MonoArray *chars, gint32 t
gint32 srclen, newlen, arrlen;
gint32 i, lenfirst, lenlast;
+ MONO_ARCH_SAVE_REGS;
+
srclen = mono_string_length(me);
src = mono_string_chars(me);
arrlen = mono_array_length(chars);
@@ -468,6 +472,8 @@ ves_icall_System_String_InternalTrim (MonoString *me, MonoArray *chars, gint32 t
}
newlen = srclen - lenfirst - lenlast;
+ if (newlen == srclen)
+ return me;
ret = mono_string_new_size( mono_domain_get (), newlen);
dest = mono_string_chars(ret);
@@ -478,45 +484,6 @@ ves_icall_System_String_InternalTrim (MonoString *me, MonoArray *chars, gint32 t
}
gint32
-ves_icall_System_String_InternalIndexOf_Char (MonoString *me, gunichar2 value, gint32 sindex, gint32 count)
-{
- gint32 pos;
- gunichar2 *src;
-
- src = mono_string_chars(me);
- for (pos = sindex; pos != count + sindex; pos++) {
- if ( src [pos] == value)
- return pos;
- }
-
- return -1;
-}
-
-gint32
-ves_icall_System_String_InternalIndexOf_Str (MonoString *me, MonoString *value, gint32 sindex, gint32 count)
-{
- gint32 lencmpstr;
- gint32 pos;
- gunichar2 *src;
- gunichar2 *cmpstr;
-
- lencmpstr = mono_string_length(value);
-
- src = mono_string_chars(me);
- cmpstr = mono_string_chars(value);
-
- for (pos = sindex; pos != count + sindex; pos++) {
- if (pos + lencmpstr > count + sindex)
- return -1;
-
- if (0 == memcmp(src + pos, cmpstr, lencmpstr * sizeof(gunichar2)))
- return pos;
- }
-
- return -1;
-}
-
-gint32
ves_icall_System_String_InternalIndexOfAny (MonoString *me, MonoArray *arr, gint32 sindex, gint32 count)
{
gint32 pos;
@@ -524,6 +491,8 @@ ves_icall_System_String_InternalIndexOfAny (MonoString *me, MonoArray *arr, gint
gint32 arraysize;
gunichar2 *src;
+ MONO_ARCH_SAVE_REGS;
+
arraysize = mono_array_length(arr);
src = mono_string_chars(me);
@@ -542,6 +511,8 @@ ves_icall_System_String_InternalLastIndexOf_Char (MonoString *me, gunichar2 valu
gint32 pos;
gunichar2 *src;
+ MONO_ARCH_SAVE_REGS;
+
src = mono_string_chars(me);
for (pos = sindex; pos > sindex - count; pos--) {
if (src [pos] == value)
@@ -559,6 +530,8 @@ ves_icall_System_String_InternalLastIndexOf_Str (MonoString *me, MonoString *val
gunichar2 *src;
gunichar2 *cmpstr;
+ MONO_ARCH_SAVE_REGS;
+
lencmpstr = mono_string_length(value);
src = mono_string_chars(me);
@@ -580,6 +553,8 @@ ves_icall_System_String_InternalLastIndexOfAny (MonoString *me, MonoArray *anyOf
gint32 arraysize;
gunichar2 *src;
+ MONO_ARCH_SAVE_REGS;
+
arraysize = mono_array_length(anyOf);
src = mono_string_chars(me);
@@ -602,6 +577,8 @@ ves_icall_System_String_InternalPad (MonoString *me, gint32 width, gunichar2 chr
gint32 srclen;
gint32 i;
+ MONO_ARCH_SAVE_REGS;
+
srclen = mono_string_length(me);
src = mono_string_chars(me);
@@ -627,135 +604,82 @@ ves_icall_System_String_InternalPad (MonoString *me, gint32 width, gunichar2 chr
}
MonoString *
-ves_icall_System_String_InternalToLower (MonoString *me)
+ves_icall_System_String_InternalAllocateStr (gint32 length)
{
- MonoString * ret;
- gunichar2 *src;
- gunichar2 *dest;
- gint32 i;
-
- ret = mono_string_new_size(mono_domain_get (), mono_string_length(me));
-
- src = mono_string_chars (me);
- dest = mono_string_chars (ret);
+ MONO_ARCH_SAVE_REGS;
- for (i = 0; i < mono_string_length (me); ++i)
- dest[i] = g_unichar_tolower(src[i]);
-
- return ret;
+ return mono_string_new_size(mono_domain_get (), length);
}
-MonoString *
-ves_icall_System_String_InternalToUpper (MonoString *me)
+void
+ves_icall_System_String_InternalStrcpy_Str (MonoString *dest, gint32 destPos, MonoString *src)
{
- int i;
- MonoString * ret;
- gunichar2 *src;
- gunichar2 *dest;
-
- ret = mono_string_new_size(mono_domain_get (), mono_string_length(me));
+ gunichar2 *srcptr;
+ gunichar2 *destptr;
- src = mono_string_chars (me);
- dest = mono_string_chars (ret);
+ MONO_ARCH_SAVE_REGS;
- for (i = 0; i < mono_string_length (me); ++i)
- dest[i] = g_unichar_toupper(src[i]);
+ srcptr = mono_string_chars (src);
+ destptr = mono_string_chars (dest);
- return ret;
+ g_memmove (destptr + destPos, srcptr, mono_string_length(src) * sizeof(gunichar2));
}
-MonoString *
-ves_icall_System_String_InternalAllocateStr (gint32 length)
+void
+ves_icall_System_String_InternalStrcpy_StrN (MonoString *dest, gint32 destPos, MonoString *src, gint32 startPos, gint32 count)
{
- return mono_string_new_size(mono_domain_get (), length);
+ gunichar2 *srcptr;
+ gunichar2 *destptr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ srcptr = mono_string_chars (src);
+ destptr = mono_string_chars (dest);
+ g_memmove (destptr + destPos, srcptr + startPos, count * sizeof(gunichar2));
}
void
-ves_icall_System_String_InternalStrcpy_Str (MonoString *dest, gint32 destPos, MonoString *src)
+ves_icall_System_String_InternalStrcpy_Chars (MonoString *dest, gint32 destPos, MonoArray *src)
{
gunichar2 *srcptr;
gunichar2 *destptr;
- srcptr = mono_string_chars (src);
+ MONO_ARCH_SAVE_REGS;
+
+ srcptr = mono_array_addr (src, gunichar2, 0);
destptr = mono_string_chars (dest);
- memcpy(destptr + destPos, srcptr, mono_string_length(src) * sizeof(gunichar2));
+ g_memmove (destptr + destPos, srcptr, mono_array_length (src) * sizeof(gunichar2));
}
void
-ves_icall_System_String_InternalStrcpy_StrN (MonoString *dest, gint32 destPos, MonoString *src, gint32 startPos, gint32 count)
+ves_icall_System_String_InternalStrcpy_CharsN (MonoString *dest, gint32 destPos, MonoArray *src, gint32 startPos, gint32 count)
{
gunichar2 *srcptr;
gunichar2 *destptr;
- srcptr = mono_string_chars (src);
+ MONO_ARCH_SAVE_REGS;
+
+ srcptr = mono_array_addr (src, gunichar2, 0);
destptr = mono_string_chars (dest);
- memcpy(destptr + destPos, srcptr + startPos, count * sizeof(gunichar2));
+
+ g_memmove (destptr + destPos, srcptr + startPos, count * sizeof(gunichar2));
}
MonoString *
ves_icall_System_String_InternalIntern (MonoString *str)
{
+ MONO_ARCH_SAVE_REGS;
+
return mono_string_intern(str);
}
MonoString *
ves_icall_System_String_InternalIsInterned (MonoString *str)
{
- return mono_string_is_interned(str);
-}
-
-gint32
-ves_icall_System_String_InternalCompareStr_N (MonoString *s1, gint32 i1, MonoString *s2, gint32 i2, gint32 length, MonoBoolean inCase)
-{
- /* c translation of C# code from old string.cs.. :) */
- gint32 lenstr1;
- gint32 lenstr2;
- gint32 charcmp;
- gunichar2 *str1;
- gunichar2 *str2;
+ MONO_ARCH_SAVE_REGS;
- gint32 pos;
- gint16 mode;
-
- if (inCase)
- mode = 1;
- else
- mode = 0;
-
- lenstr1 = mono_string_length(s1);
- lenstr2 = mono_string_length(s2);
-
- str1 = mono_string_chars(s1);
- str2 = mono_string_chars(s2);
-
- pos = 0;
-
- for (pos = 0; pos != length; pos++) {
- if (i1 + pos >= lenstr1 || i2 + pos >= lenstr2)
- break;
-
- charcmp = string_icall_cmp_char(str1[i1 + pos], str2[i2 + pos], mode);
- if (charcmp != 0)
- return charcmp;
- }
-
- /* the lesser wins, so if we have looped until length we just need to check the last char */
- if (pos == length) {
- return string_icall_cmp_char(str1[i1 + pos - 1], str2[i2 + pos - 1], mode);
- }
-
- /* Test if one the strings has been compared to the end */
- if (i1 + pos >= lenstr1) {
- if (i2 + pos >= lenstr2)
- return 0;
- else
- return -1;
- } else if (i2 + pos >= lenstr2)
- return 1;
-
- /* if not, check our last char only.. (can this happen?) */
- return string_icall_cmp_char(str1[i1 + pos], str2[i2 + pos], mode);
+ return mono_string_is_interned(str);
}
gint32
@@ -764,6 +688,8 @@ ves_icall_System_String_GetHashCode (MonoString *me)
int i, h = 0;
gunichar2 *data = mono_string_chars (me);
+ MONO_ARCH_SAVE_REGS;
+
for (i = 0; i < mono_string_length (me); ++i)
h = (h << 5) - h + data [i];
@@ -773,41 +699,17 @@ ves_icall_System_String_GetHashCode (MonoString *me)
gunichar2
ves_icall_System_String_get_Chars (MonoString *me, gint32 idx)
{
+ MONO_ARCH_SAVE_REGS;
+
+ if ((idx < 0) || (idx >= mono_string_length (me)))
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
return mono_string_chars(me)[idx];
}
-/* @mode : 0 = StringCompareModeDirect
- 1 = StringCompareModeCaseInsensitive
- 2 = StringCompareModeOrdinal
-*/
-gint32
-string_icall_cmp_char (gunichar2 c1, gunichar2 c2, gint16 mode)
+void
+ves_icall_System_String_InternalCharCopy (gunichar2 *src, gunichar2 *dest, gint32 count)
{
- gint32 result;
- GUnicodeType c1type, c2type;
-
- c1type = g_unichar_type (c1);
- c2type = g_unichar_type (c2);
-
- switch (mode) {
- case 0:
- /* TODO: compare with culture info */
- if (c1type == G_UNICODE_UPPERCASE_LETTER && c2type == G_UNICODE_LOWERCASE_LETTER)
- return 1;
-
- if (c1type == G_UNICODE_LOWERCASE_LETTER && c2type == G_UNICODE_UPPERCASE_LETTER)
- return -1;
-
- result = (gint32) c1 - c2;
- break;
- case 1:
- result = (gint32) (c1type != G_UNICODE_LOWERCASE_LETTER ? g_unichar_tolower(c1) : c1) -
- (c2type != G_UNICODE_LOWERCASE_LETTER ? g_unichar_tolower(c2) : c2);
- break;
- case 2:
- result = (gint32) c1 - c2;
- break;
- }
+ MONO_ARCH_SAVE_REGS;
- return ((result < 0) ? -1 : (result > 0) ? 1 : 0);
+ memcpy (dest, src, sizeof (gunichar2) * count);
}
diff --git a/mono/metadata/string-icalls.h b/mono/metadata/string-icalls.h
index 3cbd02094ef..a1366528482 100644
--- a/mono/metadata/string-icalls.h
+++ b/mono/metadata/string-icalls.h
@@ -37,9 +37,6 @@ ves_icall_System_String_ctor_chara_int_int (gpointer dummy, MonoArray *value, g
MonoString *
ves_icall_System_String_ctor_encoding (gpointer dummy, gint8 *value, gint32 sindex, gint32 length, MonoObject *enc);
-MonoBoolean
-ves_icall_System_String_InternalEquals (MonoString *str1, MonoString *str2);
-
MonoString *
ves_icall_System_String_InternalJoin (MonoString *separator, MonoArray * value, gint32 sindex, gint32 count);
@@ -50,9 +47,6 @@ MonoString *
ves_icall_System_String_InternalReplace_Char (MonoString *me, gunichar2 oldChar, gunichar2 newChar);
MonoString *
-ves_icall_System_String_InternalReplace_Str (MonoString *me, MonoString *oldValue, MonoString *newValue);
-
-MonoString *
ves_icall_System_String_InternalRemove (MonoString *me, gint32 sindex, gint32 count);
void
@@ -65,12 +59,6 @@ MonoString *
ves_icall_System_String_InternalTrim (MonoString *me, MonoArray *chars, gint32 typ);
gint32
-ves_icall_System_String_InternalIndexOf_Char (MonoString *me, gunichar2 value, gint32 sindex, gint32 count);
-
-gint32
-ves_icall_System_String_InternalIndexOf_Str (MonoString *me, MonoString *value, gint32 sindex, gint32 count);
-
-gint32
ves_icall_System_String_InternalIndexOfAny (MonoString *me, MonoArray *arr, gint32 sindex, gint32 count);
gint32
@@ -86,12 +74,6 @@ MonoString *
ves_icall_System_String_InternalPad (MonoString *me, gint32 width, gunichar2 chr, MonoBoolean right);
MonoString *
-ves_icall_System_String_InternalToLower (MonoString *me);
-
-MonoString *
-ves_icall_System_String_InternalToUpper (MonoString *me);
-
-MonoString *
ves_icall_System_String_InternalAllocateStr (gint32 length);
void
@@ -100,30 +82,25 @@ ves_icall_System_String_InternalStrcpy_Str (MonoString *dest, gint32 destPos, Mo
void
ves_icall_System_String_InternalStrcpy_StrN (MonoString *dest, gint32 destPos, MonoString *src, gint32 startPos, gint32 count);
+void
+ves_icall_System_String_InternalStrcpy_Chars (MonoString *dest, gint32 destPos, MonoArray *src);
+
+void
+ves_icall_System_String_InternalStrcpy_CharsN (MonoString *dest, gint32 destPos, MonoArray *src, gint32 startPos, gint32 count);
+
MonoString *
ves_icall_System_String_InternalIntern (MonoString *str);
MonoString *
ves_icall_System_String_InternalIsInterned (MonoString *str);
-gint32
-ves_icall_System_String_InternalCompareStr (MonoString *s1, MonoString *s2, MonoBoolean inCase);
-
-gint32
-ves_icall_System_String_InternalCompareStr_N (MonoString *s1, gint32 i1, MonoString *s2, gint32 i2, gint32 length, MonoBoolean inCase);
-
gint32
ves_icall_System_String_GetHashCode (MonoString *me);
gunichar2
ves_icall_System_String_get_Chars (MonoString *me, gint32 idx);
-/* Internal helper methods */
-
-gboolean
-string_icall_is_in_array (MonoArray *chars, gint32 arraylength, gunichar2 chr);
-
-gint32
-string_icall_cmp_char (gunichar2 c1, gunichar2 c2, gint16 mode);
+void
+ves_icall_System_String_InternalCharCopy (gunichar2 *src, gunichar2 *dest, gint32 count);
#endif /* _MONO_CLI_STRING_ICALLS_H_ */
diff --git a/mono/metadata/sysmath.c b/mono/metadata/sysmath.c
index 8837c16a095..645d8ed0f3c 100644
--- a/mono/metadata/sysmath.c
+++ b/mono/metadata/sysmath.c
@@ -3,6 +3,7 @@
#define __USE_ISOC99
#include <math.h>
#include <mono/metadata/sysmath.h>
+#include <mono/metadata/exception.h>
#ifndef NAN
# if G_BYTE_ORDER == G_BIG_ENDIAN
@@ -28,45 +29,98 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
# define HUGE_VAL (__huge_val.__d)
#endif
+
+gdouble ves_icall_System_Math_Floor (gdouble x) {
+ MONO_ARCH_SAVE_REGS;
+ return floor(x);
+}
+
+gdouble ves_icall_System_Math_Round (gdouble x) {
+ double int_part, dec_part;
+ MONO_ARCH_SAVE_REGS;
+ int_part = floor(x);
+ dec_part = x - int_part;
+ if (((dec_part == 0.5) &&
+ ((2.0 * ((int_part / 2.0) - floor(int_part / 2.0))) != 0.0)) ||
+ (dec_part > 0.5)) {
+ int_part++;
+ }
+ return int_part;
+}
+
+gdouble ves_icall_System_Math_Round2 (gdouble value, gint32 digits) {
+ double p, int_part, dec_part;
+ MONO_ARCH_SAVE_REGS;
+ if (value == HUGE_VAL)
+ return HUGE_VAL;
+ if (value == -HUGE_VAL)
+ return -HUGE_VAL;
+ if (digits == 0)
+ return ves_icall_System_Math_Round(value);
+ p = pow(10, digits);
+ int_part = floor(value);
+ dec_part = value - int_part;
+ dec_part *= 1000000000000000ULL;
+ dec_part = floor(dec_part);
+ dec_part /= (1000000000000000ULL / p);
+ dec_part = ves_icall_System_Math_Round(dec_part);
+ dec_part /= p;
+ return int_part + dec_part;
+}
+
gdouble
ves_icall_System_Math_Sin (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return sin (x);
}
gdouble
ves_icall_System_Math_Cos (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return cos (x);
}
gdouble
ves_icall_System_Math_Tan (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return tan (x);
}
gdouble
ves_icall_System_Math_Sinh (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return sinh (x);
}
gdouble
ves_icall_System_Math_Cosh (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return cosh (x);
}
gdouble
ves_icall_System_Math_Tanh (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return tanh (x);
}
gdouble
ves_icall_System_Math_Acos (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
if (x < -1 || x > 1)
return NAN;
@@ -76,6 +130,8 @@ ves_icall_System_Math_Acos (gdouble x)
gdouble
ves_icall_System_Math_Asin (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
if (x < -1 || x > 1)
return NAN;
@@ -85,24 +141,40 @@ ves_icall_System_Math_Asin (gdouble x)
gdouble
ves_icall_System_Math_Atan (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return atan (x);
}
gdouble
ves_icall_System_Math_Atan2 (gdouble y, gdouble x)
{
- return atan2 (y, x);
+ double result;
+ MONO_ARCH_SAVE_REGS;
+
+ if ((y == HUGE_VAL && x == HUGE_VAL) ||
+ (y == HUGE_VAL && x == -HUGE_VAL) ||
+ (y == -HUGE_VAL && x == HUGE_VAL) ||
+ (y == -HUGE_VAL && x == -HUGE_VAL)) {
+ return NAN;
+ }
+ result = atan2 (y, x);
+ return (result == -0)? 0: result;
}
gdouble
ves_icall_System_Math_Exp (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
return exp (x);
}
gdouble
ves_icall_System_Math_Log (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
if (x == 0)
return -HUGE_VAL;
else if (x < 0)
@@ -114,6 +186,8 @@ ves_icall_System_Math_Log (gdouble x)
gdouble
ves_icall_System_Math_Log10 (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
if (x == 0)
return -HUGE_VAL;
else if (x < 0)
@@ -125,12 +199,44 @@ ves_icall_System_Math_Log10 (gdouble x)
gdouble
ves_icall_System_Math_Pow (gdouble x, gdouble y)
{
- return pow (x, y);
+ double result;
+ MONO_ARCH_SAVE_REGS;
+
+ if (isnan(x) || isnan(y)) {
+ return NAN;
+ }
+
+ if ((x == 1 || x == -1) && (y == HUGE_VAL || y == -HUGE_VAL)) {
+ return NAN;
+ }
+
+ /* This code is for return the same results as MS.NET for certain
+ * limit values */
+ if (x < -9007199254740991.0) {
+ if (y > 9007199254740991.0)
+ return HUGE_VAL;
+ if (y < -9007199254740991.0)
+ return 0;
+ }
+
+ result = pow (x, y);
+
+ /* This code is for return the same results as MS.NET for certain
+ * limit values */
+ if (isnan(result) &&
+ (x == -1.0) &&
+ ((y > 9007199254740991.0) || (y < -9007199254740991.0))) {
+ return 1;
+ }
+
+ return (result == -0)? 0: result;
}
gdouble
ves_icall_System_Math_Sqrt (gdouble x)
{
+ MONO_ARCH_SAVE_REGS;
+
if (x < 0)
return NAN;
diff --git a/mono/metadata/sysmath.h b/mono/metadata/sysmath.h
index c906a5a82f3..ccca3ed5bc6 100644
--- a/mono/metadata/sysmath.h
+++ b/mono/metadata/sysmath.h
@@ -13,6 +13,10 @@
#include <config.h>
#include <glib.h>
+extern gdouble ves_icall_System_Math_Floor (gdouble x);
+extern gdouble ves_icall_System_Math_Round (gdouble x);
+extern gdouble ves_icall_System_Math_Round2 (gdouble value, gint32 digits);
+
extern gdouble
ves_icall_System_Math_Sin (gdouble x);
diff --git a/mono/metadata/tabledefs.h b/mono/metadata/tabledefs.h
index 5d5671b4a96..5e26b167d6f 100644
--- a/mono/metadata/tabledefs.h
+++ b/mono/metadata/tabledefs.h
@@ -41,6 +41,28 @@ enum {
FILE_CONTAINS_NO_METADATA = 1
};
+/* keep in synch with System.Security.Permissions.SecurityAction enum
+ (except for the special non-CAS cases) */
+enum {
+ SECURITY_ACTION_DEMAND = 2,
+ SECURITY_ACTION_ASSERT = 3,
+ SECURITY_ACTION_DENY = 4,
+ SECURITY_ACTION_PERMITONLY = 5,
+ SECURITY_ACTION_LINKDEMAND = 6,
+ SECURITY_ACTION_INHERITDEMAND = 7,
+ SECURITY_ACTION_REQMIN = 8,
+ SECURITY_ACTION_REQOPT = 9,
+ SECURITY_ACTION_REQREFUSE = 10,
+ /* Special cases (non CAS permissions) */
+ SECURITY_ACTION_NONCASDEMAND = 13,
+ SECURITY_ACTION_NONCASLINKDEMAND = 14,
+ SECURITY_ACTION_NONCASINHERITANCE = 15,
+ /* Fx 2.0 actions (for both CAS and non-CAS permissions) */
+ SECURITY_ACTION_LINKDEMANDCHOICE = 16,
+ SECURITY_ACTION_INHERITDEMANDCHOICE = 17,
+ SECURITY_ACTION_DEMANDCHOICE = 18
+};
+
/*
* Field Attributes (21.1.5).
*/
@@ -174,11 +196,11 @@ enum {
#define METHOD_SEMANTIC_FIRE 0x0020
/*
- * Flags for Params (22.1.11)
+ * Flags for Params (22.1.12)
*/
#define PARAM_ATTRIBUTE_IN 0x0001
#define PARAM_ATTRIBUTE_OUT 0x0002
-#define PARAM_ATTRIBUTE_OPTIONAL 0x0004
+#define PARAM_ATTRIBUTE_OPTIONAL 0x0010
#define PARAM_ATTRIBUTE_RESERVED_MASK 0xf000
#define PARAM_ATTRIBUTE_HAS_DEFAULT 0x1000
#define PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL 0x2000
@@ -202,6 +224,9 @@ enum {
#define PINVOKE_ATTRIBUTE_CHAR_SET_ANSI 0x0002
#define PINVOKE_ATTRIBUTE_CHAR_SET_UNICODE 0x0004
#define PINVOKE_ATTRIBUTE_CHAR_SET_AUTO 0x0006
+#define PINVOKE_ATTRIBUTE_BEST_FIT_ENABLED 0x0010
+#define PINVOKE_ATTRIBUTE_BEST_FIT_DISABLED 0x0020
+#define PINVOKE_ATTRIBUTE_BEST_FIT_MASK 0x0030
#define PINVOKE_ATTRIBUTE_SUPPORTS_LAST_ERROR 0x0040
#define PINVOKE_ATTRIBUTE_CALL_CONV_MASK 0x0700
#define PINVOKE_ATTRIBUTE_CALL_CONV_WINAPI 0x0100
@@ -209,5 +234,15 @@ enum {
#define PINVOKE_ATTRIBUTE_CALL_CONV_STDCALL 0x0300
#define PINVOKE_ATTRIBUTE_CALL_CONV_THISCALL 0x0400
#define PINVOKE_ATTRIBUTE_CALL_CONV_FASTCALL 0x0500
-
+#define PINVOKE_ATTRIBUTE_THROW_ON_UNMAPPABLE_ENABLED 0x1000
+#define PINVOKE_ATTRIBUTE_THROW_ON_UNMAPPABLE_DISABLED 0x2000
+#define PINVOKE_ATTRIBUTE_THROW_ON_UNMAPPABLE_MASK 0x3000
+#define PINVOKE_ATTRIBUTE_BEST_FIT_MASK 0x0030
+#define PINVOKE_ATTRIBUTE_CALL_CONV_GENERIC 0x0010
+#define PINVOKE_ATTRIBUTE_CALL_CONV_GENERICINST 0x000a
+
+/**
+ * 21.5 AssemblyRefs
+ */
+#define ASSEMBLYREF_FULL_PUBLIC_KEY_FLAG 0x00000001
#endif
diff --git a/mono/metadata/threadpool.c b/mono/metadata/threadpool.c
index bfdccacb168..26362ba60b2 100644
--- a/mono/metadata/threadpool.c
+++ b/mono/metadata/threadpool.c
@@ -3,37 +3,60 @@
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
+ * Gonzalo Paniagua Javier (gonzalo@ximian.com)
*
- * (C) 2001 Ximian, Inc.
+ * (C) 2001-2003 Ximian, Inc.
+ * (c) 2004 Novell, Inc. (http://www.novell.com)
*/
#include <config.h>
#include <glib.h>
-#include <mono/metadata/appdomain.h>
+#ifdef PLATFORM_WIN32
+#define WINVER 0x0500
+#define _WIN32_WINNT 0x0500
+#define THREADS_PER_CPU 25
+#else
+#define THREADS_PER_CPU 50
+#endif
+
+#include <mono/metadata/domain-internals.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/threads.h>
+#include <mono/metadata/threads-types.h>
#include <mono/metadata/exception.h>
-#ifndef PLATFORM_WIN32
-#include "mono/io-layer/wapi.h"
-#include "mono/io-layer/uglify.h"
-#endif
+#include <mono/metadata/file-io.h>
+#include <mono/metadata/monitor.h>
+#include <mono/metadata/marshal.h>
+#include <mono/io-layer/io-layer.h>
+#include <mono/os/gc_wrapper.h>
#include "threadpool.h"
-/* FIXME:
- * - worker threads need to be initialized correctly.
- * - worker threads should be domain specific
- */
-
/* maximum number of worker threads */
-int mono_worker_threads = 1;
+int mono_max_worker_threads = THREADS_PER_CPU;
+static int mono_min_worker_threads = 0;
+
+/* current number of worker threads */
+static int mono_worker_threads = 0;
-static int workers = 0;
+/* current number of busy threads */
+static int busy_worker_threads = 0;
+
+/* mono_thread_pool_init called */
+static int tp_inited;
+
+/* we use this to store a reference to the AsyncResult to avoid GC */
+static MonoGHashTable *ares_htable = NULL;
+
+static CRITICAL_SECTION ares_lock;
+
+/* we append a job */
+static HANDLE job_added;
typedef struct {
MonoMethodMessage *msg;
- HANDLE wait_semaphore;
+ HANDLE wait_event;
MonoMethod *cb_method;
MonoDelegate *cb_target;
MonoObject *state;
@@ -41,7 +64,8 @@ typedef struct {
MonoArray *out_args;
} ASyncCall;
-static void async_invoke_thread (void);
+static void async_invoke_thread (gpointer data);
+static void append_job (MonoAsyncResult *ar);
static GList *async_call_queue = NULL;
@@ -53,11 +77,8 @@ mono_async_invoke (MonoAsyncResult *ares)
ac->msg->exc = NULL;
ac->res = mono_message_invoke (ares->async_delegate, ac->msg,
&ac->msg->exc, &ac->out_args);
-
+
ares->completed = 1;
-
- /* notify listeners */
- ReleaseSemaphore (ac->wait_semaphore, 0x7fffffff, NULL);
/* call async callback if cb_method != null*/
if (ac->cb_method) {
@@ -67,6 +88,42 @@ mono_async_invoke (MonoAsyncResult *ares)
if (!ac->msg->exc)
ac->msg->exc = exc;
}
+
+ /* notify listeners */
+ mono_monitor_enter ((MonoObject *) ares);
+
+ if (ares->handle != NULL) {
+ ac->wait_event = ((MonoWaitHandle *) ares->handle)->handle;
+ SetEvent (ac->wait_event);
+ }
+ mono_monitor_exit ((MonoObject *) ares);
+
+ EnterCriticalSection (&ares_lock);
+ mono_g_hash_table_remove (ares_htable, ares);
+ LeaveCriticalSection (&ares_lock);
+}
+
+void
+mono_thread_pool_init ()
+{
+ SYSTEM_INFO info;
+ int threads_per_cpu = THREADS_PER_CPU;
+
+ if ((int) InterlockedCompareExchange (&tp_inited, 1, 0) == 1)
+ return;
+
+ MONO_GC_REGISTER_ROOT (ares_htable);
+ InitializeCriticalSection (&ares_lock);
+ ares_htable = mono_g_hash_table_new (NULL, NULL);
+ job_added = CreateSemaphore (NULL, 0, 0x7fffffff, NULL);
+ GetSystemInfo (&info);
+ if (getenv ("MONO_THREADS_PER_CPU") != NULL) {
+ threads_per_cpu = atoi (getenv ("MONO_THREADS_PER_CPU"));
+ if (threads_per_cpu <= 0)
+ threads_per_cpu = THREADS_PER_CPU;
+ }
+
+ mono_max_worker_threads = threads_per_cpu * info.dwNumberOfProcessors;
}
MonoAsyncResult *
@@ -76,9 +133,15 @@ mono_thread_pool_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *
MonoDomain *domain = mono_domain_get ();
MonoAsyncResult *ares;
ASyncCall *ac;
+ int busy, worker;
+#ifdef HAVE_BOEHM_GC
+ ac = GC_MALLOC (sizeof (ASyncCall));
+#else
+ /* We'll leak the event if creaated... */
ac = g_new0 (ASyncCall, 1);
- ac->wait_semaphore = CreateSemaphore (NULL, 0, 0x7fffffff, NULL);
+#endif
+ ac->wait_event = NULL;
ac->msg = msg;
ac->state = state;
@@ -87,20 +150,24 @@ mono_thread_pool_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *
ac->cb_target = async_callback;
}
- ares = mono_async_result_new (domain, ac->wait_semaphore, ac->state, ac);
+ ares = mono_async_result_new (domain, NULL, ac->state, ac);
ares->async_delegate = target;
- EnterCriticalSection (&mono_delegate_section);
- async_call_queue = g_list_append (async_call_queue, ares);
- ReleaseSemaphore (mono_delegate_semaphore, 1, NULL);
-
- if (workers == 0) {
- MonoObject *thread;
- workers++;
- thread = mono_thread_create (domain, async_invoke_thread);
- g_assert (thread != NULL);
+ EnterCriticalSection (&ares_lock);
+ mono_g_hash_table_insert (ares_htable, ares, ares);
+ LeaveCriticalSection (&ares_lock);
+
+ busy = (int) InterlockedCompareExchange (&busy_worker_threads, 0, -1);
+ worker = (int) InterlockedCompareExchange (&mono_worker_threads, 0, -1);
+ if (worker <= ++busy &&
+ worker < mono_max_worker_threads) {
+ InterlockedIncrement (&mono_worker_threads);
+ InterlockedIncrement (&busy_worker_threads);
+ mono_thread_create (domain, async_invoke_thread, ares);
+ } else {
+ append_job (ares);
+ ReleaseSemaphore (job_added, 1, NULL);
}
- LeaveCriticalSection (&mono_delegate_section);
return ares;
}
@@ -109,31 +176,36 @@ MonoObject *
mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc)
{
ASyncCall *ac;
- GList *l;
*exc = NULL;
*out_args = NULL;
- EnterCriticalSection (&mono_delegate_section);
/* check if already finished */
+ mono_monitor_enter ((MonoObject *) ares);
+
if (ares->endinvoke_called) {
*exc = (MonoObject *)mono_exception_from_name (mono_defaults.corlib, "System",
"InvalidOperationException");
- LeaveCriticalSection (&mono_delegate_section);
+ mono_monitor_exit ((MonoObject *) ares);
return NULL;
}
ares->endinvoke_called = 1;
ac = (ASyncCall *)ares->data;
- if ((l = g_list_find (async_call_queue, ares))) {
- async_call_queue = g_list_remove_link (async_call_queue, l);
- mono_async_invoke (ares);
- }
- LeaveCriticalSection (&mono_delegate_section);
-
+ g_assert (ac != NULL);
+
/* wait until we are really finished */
- WaitForSingleObject (ac->wait_semaphore, INFINITE);
+ if (!ares->completed) {
+ if (ares->handle == NULL) {
+ ac->wait_event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ ares->handle = (MonoObject *) mono_wait_handle_new (mono_object_domain (ares), ac->wait_event);
+ }
+ mono_monitor_exit ((MonoObject *) ares);
+ WaitForSingleObjectEx (ac->wait_event, INFINITE, TRUE);
+ } else {
+ mono_monitor_exit ((MonoObject *) ares);
+ }
*exc = ac->msg->exc;
*out_args = ac->out_args;
@@ -141,59 +213,234 @@ mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject
return ac->res;
}
+void
+mono_thread_pool_cleanup (void)
+{
+ gint release;
+
+ EnterCriticalSection (&mono_delegate_section);
+ g_list_free (async_call_queue);
+ async_call_queue = NULL;
+ release = (gint) InterlockedCompareExchange (&busy_worker_threads, 0, -1);
+ LeaveCriticalSection (&mono_delegate_section);
+ if (job_added)
+ ReleaseSemaphore (job_added, release, NULL);
+}
+
+static void
+append_job (MonoAsyncResult *ar)
+{
+ GList *tmp;
+
+ EnterCriticalSection (&mono_delegate_section);
+ if (async_call_queue == NULL) {
+ async_call_queue = g_list_append (async_call_queue, ar);
+ } else {
+ for (tmp = async_call_queue; tmp && tmp->data != NULL; tmp = tmp->next);
+ if (tmp == NULL) {
+ async_call_queue = g_list_append (async_call_queue, ar);
+ } else {
+ tmp->data = ar;
+ }
+ }
+ LeaveCriticalSection (&mono_delegate_section);
+}
+
+static MonoAsyncResult *
+dequeue_job (void)
+{
+ MonoAsyncResult *ar = NULL;
+ GList *tmp, *tmp2;
+
+ EnterCriticalSection (&mono_delegate_section);
+ tmp = async_call_queue;
+ if (tmp) {
+ ar = (MonoAsyncResult *) tmp->data;
+ tmp->data = NULL;
+ tmp2 = tmp;
+ for (tmp2 = tmp; tmp2->next != NULL; tmp2 = tmp2->next);
+ if (tmp2 != tmp) {
+ async_call_queue = tmp->next;
+ tmp->next = NULL;
+ tmp2->next = tmp;
+ tmp->prev = tmp2;
+ }
+ }
+ LeaveCriticalSection (&mono_delegate_section);
+
+ return ar;
+}
+
static void
-async_invoke_thread ()
+async_invoke_thread (gpointer data)
{
MonoDomain *domain;
-
+ MonoThread *thread;
+ int workers, min;
+
+ thread = mono_thread_current ();
+ thread->threadpool_thread = TRUE;
+ thread->state |= ThreadState_Background;
+
for (;;) {
MonoAsyncResult *ar;
- gboolean new_worker = FALSE;
- if (WaitForSingleObject (mono_delegate_semaphore, 3000) == WAIT_TIMEOUT) {
- EnterCriticalSection (&mono_delegate_section);
- workers--;
- LeaveCriticalSection (&mono_delegate_section);
- ExitThread (0);
+ ar = (MonoAsyncResult *) data;
+ if (ar) {
+ /* worker threads invokes methods in different domains,
+ * so we need to set the right domain here */
+ domain = ((MonoObject *)ar)->vtable->domain;
+ if (mono_domain_set (domain, FALSE))
+ mono_async_invoke (ar);
+ InterlockedDecrement (&busy_worker_threads);
}
-
- ar = NULL;
- EnterCriticalSection (&mono_delegate_section);
-
- if (async_call_queue) {
- if ((g_list_length (async_call_queue) > 1) &&
- (workers < mono_worker_threads)) {
- new_worker = TRUE;
- workers++;
- }
- ar = (MonoAsyncResult *)async_call_queue->data;
- async_call_queue = g_list_remove_link (async_call_queue, async_call_queue);
+ data = dequeue_job ();
+
+ if (!data) {
+ guint32 wr;
+ int timeout = 500;
+ guint32 start_time = GetTickCount ();
+
+ do {
+ wr = WaitForSingleObjectEx (job_added, (guint32)timeout, TRUE);
+ if ((thread->state & ThreadState_StopRequested)!=0)
+ mono_thread_interruption_checkpoint ();
+
+ timeout -= GetTickCount () - start_time;
+
+ if (wr != WAIT_TIMEOUT)
+ data = dequeue_job ();
+ }
+ while (!data && timeout > 0);
+ }
+ if (!data) {
+ workers = (int) InterlockedCompareExchange (&mono_worker_threads, 0, -1);
+ min = (int) InterlockedCompareExchange (&mono_min_worker_threads, 0, -1);
+
+ while (!data && workers <= min) {
+ WaitForSingleObjectEx (job_added, INFINITE, TRUE);
+ if ((thread->state & ThreadState_StopRequested)!=0)
+ mono_thread_interruption_checkpoint ();
+
+ data = dequeue_job ();
+ workers = (int) InterlockedCompareExchange (&mono_worker_threads, 0, -1);
+ min = (int) InterlockedCompareExchange (&mono_min_worker_threads, 0, -1);
+ }
+ }
+
+ if (!data) {
+ InterlockedDecrement (&mono_worker_threads);
+ return;
}
+
+ InterlockedIncrement (&busy_worker_threads);
+ }
+
+ g_assert_not_reached ();
+}
- LeaveCriticalSection (&mono_delegate_section);
+void
+ves_icall_System_Threading_ThreadPool_GetAvailableThreads (gint *workerThreads, gint *completionPortThreads)
+{
+ gint busy;
- if (mono_runtime_shutdown) {
- EnterCriticalSection (&mono_delegate_section);
- workers--;
- LeaveCriticalSection (&mono_delegate_section);
- ExitThread (0);
- }
+ MONO_ARCH_SAVE_REGS;
- if (!ar)
- continue;
-
- /* worker threads invokes methods in different domains,
- * so we need to set the right domain here */
- domain = ((MonoObject *)ar)->vtable->domain;
- mono_domain_set (domain);
+ busy = (gint) InterlockedCompareExchange (&busy_worker_threads, 0, -1);
+ *workerThreads = mono_max_worker_threads - busy;
+ *completionPortThreads = 0;
+}
- if (new_worker)
- mono_thread_create (domain, async_invoke_thread);
+void
+ves_icall_System_Threading_ThreadPool_GetMaxThreads (gint *workerThreads, gint *completionPortThreads)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ *workerThreads = mono_max_worker_threads;
+ *completionPortThreads = 0;
+}
+
+void
+ves_icall_System_Threading_ThreadPool_GetMinThreads (gint *workerThreads, gint *completionPortThreads)
+{
+ gint workers;
+
+ MONO_ARCH_SAVE_REGS;
+
+ workers = (gint) InterlockedCompareExchange (&mono_min_worker_threads, 0, -1);
+ *workerThreads = workers;
+ *completionPortThreads = 0;
+}
+
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads, gint completionPortThreads)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (workerThreads < 0 || workerThreads > mono_max_worker_threads)
+ return FALSE;
+ InterlockedExchange (&mono_min_worker_threads, workerThreads);
+ /* FIXME: should actually start the idle threads if needed */
+ return TRUE;
+}
- mono_async_invoke (ar);
+static void
+overlapped_callback (guint32 error, guint32 numbytes, WapiOverlapped *overlapped)
+{
+ MonoFSAsyncResult *ares;
+ MonoThread *thread;
+
+ MONO_ARCH_SAVE_REGS;
+
+ ares = (MonoFSAsyncResult *) overlapped->handle1;
+ ares->completed = TRUE;
+ if (ares->bytes_read != -1)
+ ares->bytes_read = numbytes;
+ else
+ ares->count = numbytes;
+
+ thread = mono_thread_attach (mono_object_domain (ares));
+ if (ares->async_callback != NULL) {
+ gpointer p [1];
+
+ *p = ares;
+ mono_runtime_invoke (ares->async_callback->method_info->method, NULL, p, NULL);
}
- g_assert_not_reached ();
+ SetEvent (ares->wait_handle->handle);
+ mono_thread_detach (thread);
+ g_free (overlapped);
+}
+
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_BindHandle (gpointer handle)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef PLATFORM_WIN32
+ return FALSE;
+#else
+ if (!BindIoCompletionCallback (handle, overlapped_callback, 0)) {
+ gint error = GetLastError ();
+ MonoException *exc;
+ gchar *msg;
+
+ if (error == ERROR_INVALID_PARAMETER) {
+ exc = mono_get_exception_argument (NULL, "Invalid parameter.");
+ } else {
+ msg = g_strdup_printf ("Win32 error %d.", error);
+ exc = mono_exception_from_name_msg (mono_defaults.corlib,
+ "System",
+ "ApplicationException", msg);
+ g_free (msg);
+ }
+
+ mono_raise_exception (exc);
+ }
+
+ return TRUE;
+#endif
}
+
diff --git a/mono/metadata/threadpool.h b/mono/metadata/threadpool.h
index b225e6b3889..c92f070bbb1 100644
--- a/mono/metadata/threadpool.h
+++ b/mono/metadata/threadpool.h
@@ -1,10 +1,13 @@
#ifndef _MONO_THREADPOOL_H_
#define _MONO_THREADPOOL_H_
-#include <mono/metadata/object.h>
+#include <mono/metadata/object-internals.h>
#include <mono/metadata/reflection.h>
-extern int mono_worker_threads;
+extern int mono_max_worker_threads;
+
+/* No managed code here */
+void mono_thread_pool_init (void);
MonoAsyncResult *
mono_thread_pool_add (MonoObject *target, MonoMethodMessage *msg,
@@ -14,4 +17,25 @@ MonoObject *
mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args,
MonoObject **exc);
+void mono_thread_pool_cleanup (void);
+
+void
+ves_icall_System_Threading_ThreadPool_GetAvailableThreads (int *workerThreads,
+ int *completionPortThreads);
+
+void
+ves_icall_System_Threading_ThreadPool_GetMaxThreads (int *workerThreads,
+ int *completionPortThreads);
+
+void
+ves_icall_System_Threading_ThreadPool_GetMinThreads (gint *workerThreads,
+ gint *completionPortThreads);
+
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads,
+ gint completionPortThreads);
+
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_BindHandle (gpointer handle);
+
#endif
diff --git a/mono/metadata/threads-types.h b/mono/metadata/threads-types.h
index aac7d5f26c4..1703fa6dab3 100644
--- a/mono/metadata/threads-types.h
+++ b/mono/metadata/threads-types.h
@@ -11,36 +11,86 @@
#ifndef _MONO_METADATA_THREADS_TYPES_H_
#define _MONO_METADATA_THREADS_TYPES_H_
-
-#include <config.h>
+#include <glib.h>
#include <mono/io-layer/io-layer.h>
-/*
- * This is bonkers. We are emulating condition variables here using
- * win32 calls, which on Linux are being emulated with condition
- * variables :-)
- *
- * See http://www.cs.wustl.edu/~schmidt/win32-cv-1.html for the design.
- */
-
-typedef struct
+struct _MonoThreadsSync
{
- HANDLE monitor;
- guint32 tid;
-
- /* Need to count how many times this monitor object has been
- * locked by the owning thread, so that we can unlock it
- * completely in Wait()
- */
- guint32 count;
-
- /* condition variable management */
- guint32 waiters_count;
- CRITICAL_SECTION waiters_count_lock;
- HANDLE sema;
- HANDLE waiters_done;
- gboolean was_broadcast;
-} MonoThreadsSync;
+ guint32 owner; /* thread ID */
+ guint32 nest;
+ volatile guint32 entry_count;
+ HANDLE entry_sem;
+ GSList *wait_list;
+};
+
+/* This is a copy of System.Threading.ThreadState */
+typedef enum {
+ ThreadState_Running = 0x00000000,
+ ThreadState_StopRequested = 0x00000001,
+ ThreadState_SuspendRequested = 0x00000002,
+ ThreadState_Background = 0x00000004,
+ ThreadState_Unstarted = 0x00000008,
+ ThreadState_Stopped = 0x00000010,
+ ThreadState_WaitSleepJoin = 0x00000020,
+ ThreadState_Suspended = 0x00000040,
+ ThreadState_AbortRequested = 0x00000080,
+ ThreadState_Aborted = 0x00000100
+} MonoThreadState;
+
+#define SPECIAL_STATIC_NONE 0
+#define SPECIAL_STATIC_THREAD 1
+#define SPECIAL_STATIC_CONTEXT 2
+
+extern HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoThread *this_obj, MonoObject *start);
+extern void ves_icall_System_Threading_Thread_Thread_free_internal(MonoThread *this_obj, HANDLE thread);
+extern void ves_icall_System_Threading_Thread_Start_internal(MonoThread *this_obj, HANDLE thread);
+extern void ves_icall_System_Threading_Thread_Sleep_internal(int ms);
+extern gboolean ves_icall_System_Threading_Thread_Join_internal(MonoThread *this_obj, int ms, HANDLE thread);
+extern gint32 ves_icall_System_Threading_Thread_GetDomainID (void);
+extern MonoString* ves_icall_System_Threading_Thread_GetName_internal (MonoThread *this_obj);
+extern void ves_icall_System_Threading_Thread_SetName_internal (MonoThread *this_obj, MonoString *name);
+extern void ves_icall_System_Threading_Thread_SlotHash_store(MonoObject *data);
+extern MonoObject *ves_icall_System_Threading_Thread_SlotHash_lookup(void);
+extern HANDLE ves_icall_System_Threading_Mutex_CreateMutex_internal(MonoBoolean owned, MonoString *name, MonoBoolean *created);
+extern void ves_icall_System_Threading_Mutex_ReleaseMutex_internal (HANDLE handle );
+extern HANDLE ves_icall_System_Threading_Events_CreateEvent_internal (MonoBoolean manual, MonoBoolean initial, MonoString *name);
+extern gboolean ves_icall_System_Threading_Events_SetEvent_internal (HANDLE handle);
+extern gboolean ves_icall_System_Threading_Events_ResetEvent_internal (HANDLE handle);
+extern void ves_icall_System_Threading_Events_CloseEvent_internal (HANDLE handle);
+
+extern gboolean ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
+extern gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
+extern gboolean ves_icall_System_Threading_WaitHandle_WaitOne_internal(MonoObject *this_obj, HANDLE handle, gint32 ms, gboolean exitContext);
+
+extern gint32 ves_icall_System_Threading_Interlocked_Increment_Int(gint32 *location);
+extern gint64 ves_icall_System_Threading_Interlocked_Increment_Long(gint64 *location);
+extern gint32 ves_icall_System_Threading_Interlocked_Decrement_Int(gint32 *location);
+extern gint64 ves_icall_System_Threading_Interlocked_Decrement_Long(gint64 * location);
+
+extern gint32 ves_icall_System_Threading_Interlocked_Exchange_Int(gint32 *location1, gint32 value);
+extern MonoObject *ves_icall_System_Threading_Interlocked_Exchange_Object(MonoObject **location1, MonoObject *value);
+extern gfloat ves_icall_System_Threading_Interlocked_Exchange_Single(gfloat *location1, gfloat value);
+
+extern gint32 ves_icall_System_Threading_Interlocked_CompareExchange_Int(gint32 *location1, gint32 value, gint32 comparand);
+extern MonoObject *ves_icall_System_Threading_Interlocked_CompareExchange_Object(MonoObject **location1, MonoObject *value, MonoObject *comparand);
+extern gfloat ves_icall_System_Threading_Interlocked_CompareExchange_Single(gfloat *location1, gfloat value, gfloat comparand);
+extern void ves_icall_System_Threading_Thread_Abort (MonoThread *thread, MonoObject *state);
+extern void ves_icall_System_Threading_Thread_ResetAbort (void);
+extern void ves_icall_System_Threading_Thread_Suspend (MonoThread *thread);
+extern void ves_icall_System_Threading_Thread_Resume (MonoThread *thread);
+
+gint8 ves_icall_System_Threading_Thread_VolatileRead1 (void *ptr);
+gint16 ves_icall_System_Threading_Thread_VolatileRead2 (void *ptr);
+gint32 ves_icall_System_Threading_Thread_VolatileRead4 (void *ptr);
+gint64 ves_icall_System_Threading_Thread_VolatileRead8 (void *ptr);
+void * ves_icall_System_Threading_Thread_VolatileReadIntPtr (void *ptr);
+
+void ves_icall_System_Threading_Thread_VolatileWrite1 (void *ptr, gint8);
+void ves_icall_System_Threading_Thread_VolatileWrite2 (void *ptr, gint16);
+void ves_icall_System_Threading_Thread_VolatileWrite4 (void *ptr, gint32);
+void ves_icall_System_Threading_Thread_VolatileWrite8 (void *ptr, gint64);
+void ves_icall_System_Threading_Thread_VolatileWriteIntPtr (void *ptr, void *);
+
#endif /* _MONO_METADATA_THREADS_TYPES_H_ */
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
index fea2883ad5c..17f3b79e760 100644
--- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c
@@ -3,33 +3,44 @@
*
* Author:
* Dick Porter (dick@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
* Patrik Torstensson (patrik.torstensson@labs2.com)
*
* (C) 2001 Ximian, Inc.
*/
#include <config.h>
+#ifdef PLATFORM_WIN32
+#define _WIN32_WINNT 0x0500
+#endif
+
#include <glib.h>
+#include <signal.h>
+#include <string.h>
#include <mono/metadata/object.h>
-#include <mono/metadata/appdomain.h>
+#include <mono/metadata/domain-internals.h>
#include <mono/metadata/profiler-private.h>
#include <mono/metadata/threads.h>
+#include <mono/metadata/threadpool.h>
#include <mono/metadata/threads-types.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/monitor.h>
+#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/marshal.h>
#include <mono/io-layer/io-layer.h>
+#include <mono/metadata/object-internals.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#undef THREAD_DEBUG
-#undef THREAD_LOCK_DEBUG
#undef THREAD_WAIT_DEBUG
struct StartInfo
{
guint32 (*func)(void *);
- MonoObject *obj;
+ MonoThread *obj;
void *this;
MonoDomain *domain;
};
@@ -39,57 +50,116 @@ typedef union {
gfloat fval;
} IntFloatUnion;
-/* Controls access to the 'threads' array */
-static CRITICAL_SECTION threads_mutex;
+typedef struct {
+ int idx;
+ int offset;
+} StaticDataInfo;
-/* Controls access to the sync field in MonoObjects, to avoid race
- * conditions when adding sync data to an object for the first time.
+/*
+ * The "os_handle" field of the WaitHandle class.
*/
-static CRITICAL_SECTION monitor_mutex;
+static MonoClassField *wait_handle_os_handle_field = NULL;
+
+/* Controls access to the 'threads' hash table */
+static CRITICAL_SECTION threads_mutex;
+
+/* Controls access to context static data */
+static CRITICAL_SECTION contexts_mutex;
-/* The array of existing threads that need joining before exit */
-static GPtrArray *threads=NULL;
+/* Holds current status of static data heap */
+static StaticDataInfo thread_static_info;
+static StaticDataInfo context_static_info;
-/* The MonoObject associated with the main thread */
-static MonoObject *main_thread;
+/* The hash of existing threads (key is thread ID) that need joining
+ * before exit
+ */
+static MonoGHashTable *threads=NULL;
/* The TLS key that holds the MonoObject assigned to each thread */
-static guint32 current_object_key;
+static guint32 current_object_key = -1;
+
+#ifdef HAVE_KW_THREAD
+/* we need to use both the Tls* functions and __thread because
+ * the gc needs to see all the threads
+ */
+static __thread MonoThread * tls_current_object;
+#define SET_CURRENT_OBJECT(x) do { \
+ tls_current_object = x; \
+ TlsSetValue (current_object_key, x); \
+} while (FALSE)
+#define GET_CURRENT_OBJECT() tls_current_object
+#else
+#define SET_CURRENT_OBJECT(x) TlsSetValue (current_object_key, x);
+#define GET_CURRENT_OBJECT() (MonoThread*) TlsGetValue (current_object_key);
+#endif
/* function called at thread start */
static MonoThreadStartCB mono_thread_start_cb = NULL;
+/* function called at thread attach */
+static MonoThreadAttachCB mono_thread_attach_cb = NULL;
+
+/* function called at thread cleanup */
+static MonoThreadCleanupFunc mono_thread_cleanup = NULL;
+
+/* function called when a new thread has been created */
+static MonoThreadCallbacks *mono_thread_callbacks = NULL;
+
/* The TLS key that holds the LocalDataStoreSlot hash in each thread */
-static guint32 slothash_key;
+static guint32 slothash_key = -1;
+
+/* The default stack size for each thread */
+static guint32 default_stacksize = 0;
+
+static void thread_adjust_static_data (MonoThread *thread);
+static void mono_init_static_data_info (StaticDataInfo *static_data);
+static guint32 mono_alloc_static_data_slot (StaticDataInfo *static_data, guint32 size, guint32 align);
/* Spin lock for InterlockedXXX 64 bit functions */
static CRITICAL_SECTION interlocked_mutex;
+/* Controls access to interruption flag */
+static CRITICAL_SECTION interruption_mutex;
+
+/* global count of thread interruptions requested */
+static gint32 thread_interruption_requested = 0;
+
+
/* handle_store() and handle_remove() manage the array of threads that
* still need to be waited for when the main thread exits.
*/
-static void handle_store(HANDLE thread)
+static void handle_store(MonoThread *thread)
{
+ EnterCriticalSection(&threads_mutex);
+
#ifdef THREAD_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": thread %p", thread);
+ g_message(G_GNUC_PRETTY_FUNCTION ": thread %p ID %d", thread,
+ thread->tid);
#endif
- EnterCriticalSection(&threads_mutex);
if(threads==NULL) {
- threads=g_ptr_array_new();
+ MONO_GC_REGISTER_ROOT (threads);
+ threads=mono_g_hash_table_new(NULL, NULL);
}
- g_ptr_array_add(threads, thread);
+
+ /* We don't need to duplicate thread->handle, because it is
+ * only closed when the thread object is finalized by the GC.
+ */
+ mono_g_hash_table_insert(threads, GUINT_TO_POINTER(thread->tid), thread);
LeaveCriticalSection(&threads_mutex);
}
-static void handle_remove(HANDLE thread)
+static void handle_remove(guint32 tid)
{
#ifdef THREAD_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": thread %p", thread);
+ g_message(G_GNUC_PRETTY_FUNCTION ": thread ID %d", tid);
#endif
EnterCriticalSection(&threads_mutex);
- g_ptr_array_remove_fast(threads, thread);
+
+ if (threads)
+ mono_g_hash_table_remove (threads, GUINT_TO_POINTER(tid));
+
LeaveCriticalSection(&threads_mutex);
/* Don't close the handle here, wait for the object finalizer
@@ -107,98 +177,283 @@ static void handle_remove(HANDLE thread)
*/
}
+static void thread_cleanup (MonoThread *thread)
+{
+ mono_release_type_locks (thread);
+
+ if (!mono_monitor_enter (thread->synch_lock))
+ return;
+
+ thread->state |= ThreadState_Stopped;
+ mono_monitor_exit (thread->synch_lock);
+
+ mono_profiler_thread_end (thread->tid);
+ handle_remove (thread->tid);
+
+ mono_thread_pop_appdomain_ref ();
+
+ if (mono_thread_cleanup)
+ mono_thread_cleanup (thread);
+}
+
static guint32 start_wrapper(void *data)
{
struct StartInfo *start_info=(struct StartInfo *)data;
guint32 (*start_func)(void *);
void *this;
- HANDLE thread;
+ guint32 tid;
+ MonoThread *thread=start_info->obj;
#ifdef THREAD_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Start wrapper");
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Start wrapper",
+ GetCurrentThreadId ());
#endif
-
- /* FIXME: GC problem here with recorded object
- * pointer!
- *
- * This is recorded so CurrentThread can return the
- * Thread object.
+
+ /* We can be sure start_info->obj->tid and
+ * start_info->obj->handle have been set, because the thread
+ * was created suspended, and these values were set before the
+ * thread resumed
*/
- TlsSetValue (current_object_key, start_info->obj);
+
+ tid=thread->tid;
+
+ SET_CURRENT_OBJECT (thread);
+
+ if (!mono_domain_set (start_info->domain, FALSE)) {
+ /* No point in raising an appdomain_unloaded exception here */
+ /* FIXME: Cleanup here */
+ return 0;
+ }
+
start_func = start_info->func;
- mono_domain_set (start_info->domain);
this = start_info->this;
- g_free (start_info);
- thread=GetCurrentThread ();
+ /* This MUST be called before any managed code can be
+ * executed, as it calls the callback function that (for the
+ * jit) sets the lmf marker.
+ */
+ mono_thread_new_init (tid, &tid, start_func);
+ thread->stack_ptr = &tid;
+
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": (%d,%d) Setting thread stack to %p",
+ GetCurrentThreadId (), getpid (), thread->stack_ptr);
+#endif
+
+#ifdef THREAD_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": (%d) Setting current_object_key to %p",
+ GetCurrentThreadId (), thread);
+#endif
+
+ mono_profiler_thread_start (tid);
+
+ if(thread->start_notify!=NULL) {
+ /* Let the thread that called Start() know we're
+ * ready
+ */
+ ReleaseSemaphore (thread->start_notify, 1, NULL);
+ }
- handle_store(thread);
- mono_profiler_thread_start (thread);
+ g_free (start_info);
+
+ /* Every thread references the appdomain which created it */
+ mono_thread_push_appdomain_ref (mono_domain_get ());
- if (mono_thread_start_cb)
- mono_thread_start_cb (&thread);
+ thread_adjust_static_data (thread);
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION "start_wrapper for %d\n", thread->tid);
+#endif
start_func (this);
+#ifdef PLATFORM_WIN32
+ /* If the thread calls ExitThread at all, this remaining code
+ * will not be executed, but the main thread will eventually
+ * call thread_cleanup() on this thread's behalf.
+ */
#ifdef THREAD_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Start wrapper terminating");
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Start wrapper terminating",
+ GetCurrentThreadId ());
+#endif
+
+ /* Remove the reference to the thread object in the TLS data,
+ * so the thread object can be finalized. This won't be
+ * reached if the thread threw an uncaught exception, so those
+ * thread handles will stay referenced :-( (This is due to
+ * missing support for scanning thread-specific data in the
+ * Boehm GC - the io-layer keeps a GC-visible hash of pointers
+ * to TLS data.)
+ */
+ SET_CURRENT_OBJECT (NULL);
#endif
- mono_profiler_thread_end (thread);
- handle_remove (thread);
+ thread_cleanup (thread);
return(0);
}
-MonoObject *
-mono_thread_create (MonoDomain *domain, gpointer func)
+void mono_thread_new_init (guint32 tid, gpointer stack_start, gpointer func)
+{
+ if (mono_thread_start_cb) {
+ mono_thread_start_cb (tid, stack_start, func);
+ }
+
+ if (mono_thread_callbacks)
+ (* mono_thread_callbacks->thread_created) (tid, stack_start, func);
+}
+
+void mono_threads_set_default_stacksize (guint32 stacksize)
+{
+ default_stacksize = stacksize;
+}
+
+guint32 mono_threads_get_default_stacksize (void)
+{
+ return default_stacksize;
+}
+
+void mono_thread_create (MonoDomain *domain, gpointer func, gpointer arg)
{
- MonoClassField *field;
- MonoObject *thread;
+ MonoThread *thread;
HANDLE thread_handle;
struct StartInfo *start_info;
guint32 tid;
- thread = mono_object_new (domain, mono_defaults.thread_class);
-
- field=mono_class_get_field_from_name(mono_defaults.thread_class, "system_thread_handle");
- g_assert (field);
+ thread=(MonoThread *)mono_object_new (domain,
+ mono_defaults.thread_class);
start_info=g_new0 (struct StartInfo, 1);
start_info->func = func;
start_info->obj = thread;
start_info->domain = domain;
- /* start_info->this needs to be set? */
-
- thread_handle = CreateThread(NULL, 0, start_wrapper, start_info, 0, &tid);
+ start_info->this = arg;
+
+ /* Create suspended, so we can do some housekeeping before the thread
+ * starts
+ */
+#if defined(PLATFORM_WIN32) && defined(HAVE_BOEHM_GC)
+ thread_handle = GC_CreateThread(NULL, default_stacksize, start_wrapper, start_info,
+ CREATE_SUSPENDED, &tid);
+#else
+ thread_handle = CreateThread(NULL, default_stacksize, start_wrapper, start_info,
+ CREATE_SUSPENDED, &tid);
+#endif
#ifdef THREAD_DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Started thread ID %d (handle %p)",
tid, thread_handle);
#endif
g_assert (thread_handle);
- *(gpointer *)(((char *)thread) + field->offset) = thread_handle;
+ thread->handle=thread_handle;
+ thread->tid=tid;
- return thread;
+ thread->synch_lock=mono_object_new (domain, mono_defaults.object_class);
+
+ handle_store(thread);
+
+ ResumeThread (thread_handle);
}
-HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoObject *this,
+MonoThread *
+mono_thread_attach (MonoDomain *domain)
+{
+ MonoThread *thread;
+ HANDLE thread_handle;
+ guint32 tid;
+
+ if ((thread = mono_thread_current ())) {
+ /* Already attached */
+ return thread;
+ }
+
+ thread = (MonoThread *)mono_object_new (domain,
+ mono_defaults.thread_class);
+
+ thread_handle = GetCurrentThread ();
+ g_assert (thread_handle);
+
+ tid=GetCurrentThreadId ();
+
+ thread->handle=thread_handle;
+ thread->tid=tid;
+ thread->synch_lock=mono_object_new (domain, mono_defaults.object_class);
+
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": Attached thread ID %d (handle %p)",
+ tid, thread_handle);
+#endif
+
+ handle_store(thread);
+
+#ifdef THREAD_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": (%d) Setting current_object_key to %p",
+ GetCurrentThreadId (), thread);
+#endif
+
+ SET_CURRENT_OBJECT (thread);
+ mono_domain_set (domain, TRUE);
+
+ thread_adjust_static_data (thread);
+
+ if (mono_thread_attach_cb) {
+ mono_thread_attach_cb (tid, &tid);
+ }
+
+ return(thread);
+}
+
+void
+mono_thread_detach (MonoThread *thread)
+{
+ g_return_if_fail (thread != NULL);
+
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION "mono_thread_detach for %d\n", thread->tid);
+#endif
+ SET_CURRENT_OBJECT (NULL);
+
+ thread_cleanup (thread);
+}
+
+void
+mono_thread_exit ()
+{
+ MonoThread *thread = mono_thread_current ();
+
+ SET_CURRENT_OBJECT (NULL);
+ thread_cleanup (thread);
+
+ ExitThread (-1);
+}
+
+HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoThread *this,
MonoObject *start)
{
MonoMulticastDelegate *delegate = (MonoMulticastDelegate*)start;
guint32 (*start_func)(void *);
struct StartInfo *start_info;
+ MonoMethod *im;
HANDLE thread;
guint32 tid;
+ MONO_ARCH_SAVE_REGS;
+
#ifdef THREAD_DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": Trying to start a new thread: this (%p) start (%p)",
this, start);
#endif
- start_func = delegate->delegate.method_ptr;
-
+ im = mono_get_delegate_invoke (start->vtable->klass);
+ im = mono_marshal_get_delegate_invoke (im);
+ if (mono_thread_callbacks)
+ start_func = (* mono_thread_callbacks->thread_start_compile_func) (im);
+ else
+ start_func = mono_compile_method (im);
+
if(start_func==NULL) {
g_warning(G_GNUC_PRETTY_FUNCTION
": Can't locate start method!");
@@ -207,30 +462,52 @@ HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoObject *this,
/* This is freed in start_wrapper */
start_info = g_new0 (struct StartInfo, 1);
start_info->func = start_func;
- start_info->this = delegate->delegate.target;
+ start_info->this = delegate;
start_info->obj = this;
start_info->domain = mono_domain_get ();
-
- thread=CreateThread(NULL, 0, start_wrapper, start_info,
+
+ this->start_notify=CreateSemaphore (NULL, 0, 0x7fffffff, NULL);
+ if(this->start_notify==NULL) {
+ g_warning (G_GNUC_PRETTY_FUNCTION ": CreateSemaphore error 0x%x", GetLastError ());
+ return(NULL);
+ }
+
+#if defined(PLATFORM_WIN32) && defined(HAVE_BOEHM_GC)
+ thread=GC_CreateThread(NULL, default_stacksize, start_wrapper, start_info,
+ CREATE_SUSPENDED, &tid);
+#else
+ thread=CreateThread(NULL, default_stacksize, start_wrapper, start_info,
CREATE_SUSPENDED, &tid);
+#endif
if(thread==NULL) {
g_warning(G_GNUC_PRETTY_FUNCTION
": CreateThread error 0x%x", GetLastError());
return(NULL);
}
+ this->handle=thread;
+ this->tid=tid;
+
+ /* Don't call handle_store() here, delay it to Start.
+ * We can't join a thread (trying to will just block
+ * forever) until it actually starts running, so don't
+ * store the handle till then.
+ */
+
#ifdef THREAD_DEBUG
g_message(G_GNUC_PRETTY_FUNCTION
": Started thread ID %d (handle %p)", tid, thread);
#endif
-
+
return(thread);
}
}
-void ves_icall_System_Threading_Thread_Thread_free_internal (MonoObject *this,
+void ves_icall_System_Threading_Thread_Thread_free_internal (MonoThread *this,
HANDLE thread)
{
+ MONO_ARCH_SAVE_REGS;
+
#ifdef THREAD_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": Closing thread %p, handle %p",
this, thread);
@@ -239,50 +516,134 @@ void ves_icall_System_Threading_Thread_Thread_free_internal (MonoObject *this,
CloseHandle (thread);
}
-void ves_icall_System_Threading_Thread_Start_internal(MonoObject *this,
+void ves_icall_System_Threading_Thread_Start_internal(MonoThread *this,
HANDLE thread)
{
+ MONO_ARCH_SAVE_REGS;
+
#ifdef THREAD_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Launching thread %p", this);
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Launching thread %p (%d)",
+ GetCurrentThreadId (), this, this->tid);
#endif
+ /* Only store the handle when the thread is about to be
+ * launched, to avoid the main thread deadlocking while trying
+ * to clean up a thread that will never be signalled.
+ */
+ handle_store(this);
+
+ if (mono_thread_callbacks)
+ (* mono_thread_callbacks->start_resume) (this->tid);
+
ResumeThread(thread);
+
+ if (mono_thread_callbacks)
+ (* mono_thread_callbacks->end_resume) (this->tid);
+
+ if(this->start_notify!=NULL) {
+ /* Wait for the thread to set up its TLS data etc, so
+ * theres no potential race condition if someone tries
+ * to look up the data believing the thread has
+ * started
+ */
+
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) waiting for thread %p (%d) to start",
+ GetCurrentThreadId (), this, this->tid);
+#endif
+
+ WaitForSingleObjectEx (this->start_notify, INFINITE, FALSE);
+ CloseHandle (this->start_notify);
+ this->start_notify=NULL;
+ }
+
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": (%d) Done launching thread %p (%d)",
+ GetCurrentThreadId (), this, this->tid);
+#endif
}
void ves_icall_System_Threading_Thread_Sleep_internal(gint32 ms)
{
+ MonoThread *thread = mono_thread_current ();
+
+ MONO_ARCH_SAVE_REGS;
+
#ifdef THREAD_DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Sleeping for %d ms", ms);
#endif
- Sleep(ms);
+ mono_monitor_enter (thread->synch_lock);
+ thread->state |= ThreadState_WaitSleepJoin;
+ mono_monitor_exit (thread->synch_lock);
+
+ SleepEx(ms,TRUE);
+
+ mono_monitor_enter (thread->synch_lock);
+ thread->state &= ~ThreadState_WaitSleepJoin;
+ mono_monitor_exit (thread->synch_lock);
}
-MonoAppDomain *ves_icall_System_Threading_Thread_CurrentThreadDomain_internal(void)
+gint32
+ves_icall_System_Threading_Thread_GetDomainID (void)
{
- /* return the current app */
- return mono_domain_get()->domain;
+ MONO_ARCH_SAVE_REGS;
+
+ return mono_domain_get()->domain_id;
}
-MonoObject *ves_icall_System_Threading_Thread_CurrentThread_internal(void)
+MonoString*
+ves_icall_System_Threading_Thread_GetName_internal (MonoThread *this_obj)
{
- MonoObject *thread;
-
- /* Find the current thread object */
- thread=TlsGetValue(current_object_key);
+ if (!this_obj->name)
+ return NULL;
+ else
+ return mono_string_new_utf16 (mono_domain_get (), this_obj->name, this_obj->name_len);
+}
+
+void
+ves_icall_System_Threading_Thread_SetName_internal (MonoThread *this_obj, MonoString *name)
+{
+ if (this_obj->name)
+ g_free (this_obj->name);
+ if (name) {
+ this_obj->name = g_new (gunichar2, mono_string_length (name));
+ memcpy (this_obj->name, mono_string_chars (name), mono_string_length (name) * 2);
+ this_obj->name_len = mono_string_length (name);
+ }
+ else
+ this_obj->name = NULL;
+}
+/* the jit may read the compiled code of this function */
+MonoThread *
+mono_thread_current (void)
+{
#ifdef THREAD_DEBUG
+ MonoThread *thread;
+ MONO_ARCH_SAVE_REGS;
+ thread = GET_CURRENT_OBJECT ();
g_message (G_GNUC_PRETTY_FUNCTION ": returning %p", thread);
+ return thread;
+#else
+ MONO_ARCH_SAVE_REGS;
+ return GET_CURRENT_OBJECT ();
#endif
-
- return(thread);
}
-gboolean ves_icall_System_Threading_Thread_Join_internal(MonoObject *this,
+gboolean ves_icall_System_Threading_Thread_Join_internal(MonoThread *this,
int ms, HANDLE thread)
{
gboolean ret;
+ MONO_ARCH_SAVE_REGS;
+
+ mono_monitor_enter (this->synch_lock);
+ this->state |= ThreadState_WaitSleepJoin;
+ mono_monitor_exit (this->synch_lock);
+
if(ms== -1) {
ms=INFINITE;
}
@@ -291,7 +652,12 @@ gboolean ves_icall_System_Threading_Thread_Join_internal(MonoObject *this,
thread, ms);
#endif
- ret=WaitForSingleObject(thread, ms);
+ ret=WaitForSingleObjectEx (thread, ms, TRUE);
+
+ mono_monitor_enter (this->synch_lock);
+ this->state &= ~ThreadState_WaitSleepJoin;
+ mono_monitor_exit (this->synch_lock);
+
if(ret==WAIT_OBJECT_0) {
#ifdef THREAD_DEBUG
g_message (G_GNUC_PRETTY_FUNCTION ": join successful");
@@ -309,6 +675,8 @@ gboolean ves_icall_System_Threading_Thread_Join_internal(MonoObject *this,
void ves_icall_System_Threading_Thread_SlotHash_store(MonoObject *data)
{
+ MONO_ARCH_SAVE_REGS;
+
#ifdef THREAD_DEBUG
g_message(G_GNUC_PRETTY_FUNCTION ": Storing key %p", data);
#endif
@@ -321,6 +689,8 @@ MonoObject *ves_icall_System_Threading_Thread_SlotHash_lookup(void)
{
MonoObject *data;
+ MONO_ARCH_SAVE_REGS;
+
data=TlsGetValue(slothash_key);
#ifdef THREAD_DEBUG
@@ -330,670 +700,1418 @@ MonoObject *ves_icall_System_Threading_Thread_SlotHash_lookup(void)
return(data);
}
-static void mon_finalize (void *o, void *unused)
+/* FIXME: exitContext isnt documented */
+gboolean ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
{
- MonoThreadsSync *mon=(MonoThreadsSync *)o;
+ HANDLE *handles;
+ guint32 numhandles;
+ guint32 ret;
+ guint32 i;
+ MonoObject *waitHandle;
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
+
+ numhandles = mono_array_length(mono_handles);
+ handles = g_new0(HANDLE, numhandles);
+
+ if (wait_handle_os_handle_field == 0) {
+ /* Get the field os_handle which will contain the actual handle */
+ klass = mono_class_from_name(mono_defaults.corlib, "System.Threading", "WaitHandle");
+ wait_handle_os_handle_field = mono_class_get_field_from_name(klass, "os_handle");
+ }
+
+ for(i = 0; i < numhandles; i++) {
+ waitHandle = mono_array_get(mono_handles, MonoObject*, i);
+ mono_field_get_value(waitHandle, wait_handle_os_handle_field, &handles[i]);
+ }
-#ifdef THREAD_LOCK_DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Finalizing sync");
-#endif
+ if(ms== -1) {
+ ms=INFINITE;
+ }
- CloseHandle (mon->monitor);
- CloseHandle (mon->sema);
- CloseHandle (mon->waiters_done);
-}
+ ret=WaitForMultipleObjectsEx(numhandles, handles, TRUE, ms, TRUE);
-static MonoThreadsSync *mon_new(void)
-{
- MonoThreadsSync *new;
-
-#if HAVE_BOEHM_GC
- new=(MonoThreadsSync *)GC_debug_malloc (sizeof(MonoThreadsSync), "sync", 1);
- GC_debug_register_finalizer (new, mon_finalize, NULL, NULL, NULL);
-#else
- /* This should be freed when the object that owns it is
- * deleted
- */
- new=(MonoThreadsSync *)g_new0 (MonoThreadsSync, 1);
+ g_free(handles);
+
+ if(ret==WAIT_FAILED) {
+#ifdef THREAD_WAIT_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Wait failed",
+ GetCurrentThreadId ());
#endif
-
- new->monitor=CreateMutex(NULL, FALSE, NULL);
- if(new->monitor==NULL) {
- /* Throw some sort of system exception? (ditto for the
- * sem and event handles below)
+ return(FALSE);
+ } else if(ret==WAIT_TIMEOUT || ret == WAIT_IO_COMPLETION) {
+ /* Do we want to try again if we get
+ * WAIT_IO_COMPLETION? The documentation for
+ * WaitHandle doesn't give any clues. (We'd have to
+ * fiddle with the timeout if we retry.)
*/
- }
-
- new->waiters_count=0;
- new->was_broadcast=FALSE;
- InitializeCriticalSection(&new->waiters_count_lock);
- new->sema=CreateSemaphore(NULL, 0, 0x7fffffff, NULL);
- new->waiters_done=CreateEvent(NULL, FALSE, FALSE, NULL);
-
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": ThreadsSync %p mutex created: %p, sem: %p, event: %p",
- new, new->monitor, new->sema, new->waiters_done);
+#ifdef THREAD_WAIT_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Wait timed out",
+ GetCurrentThreadId ());
#endif
+ return(FALSE);
+ }
- return(new);
+ return(TRUE);
}
-gboolean ves_icall_System_Threading_Monitor_Monitor_try_enter(MonoObject *obj,
- int ms)
+/* FIXME: exitContext isnt documented */
+gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
{
- MonoThreadsSync *mon;
+ HANDLE *handles;
+ guint32 numhandles;
guint32 ret;
-
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": Trying to lock object %p in thread %d", obj,
- GetCurrentThreadId());
-#endif
+ guint32 i;
+ MonoObject *waitHandle;
+ MonoClass *klass;
+
+ MONO_ARCH_SAVE_REGS;
- EnterCriticalSection(&monitor_mutex);
+ numhandles = mono_array_length(mono_handles);
+ handles = g_new0(HANDLE, numhandles);
- mon=obj->synchronisation;
- if(mon==NULL) {
- mon=mon_new();
- obj->synchronisation=mon;
+ if (wait_handle_os_handle_field == 0) {
+ /* Get the field os_handle which will contain the actual handle */
+ klass = mono_class_from_name(mono_defaults.corlib, "System.Threading", "WaitHandle");
+ wait_handle_os_handle_field = mono_class_get_field_from_name(klass, "os_handle");
+ }
+
+ for(i = 0; i < numhandles; i++) {
+ waitHandle = mono_array_get(mono_handles, MonoObject*, i);
+ mono_field_get_value(waitHandle, wait_handle_os_handle_field, &handles[i]);
}
- /* Don't hold the monitor lock while waiting to acquire the
- * object lock
+ if(ms== -1) {
+ ms=INFINITE;
+ }
+
+ ret=WaitForMultipleObjectsEx(numhandles, handles, FALSE, ms, TRUE);
+
+ g_free(handles);
+
+#ifdef THREAD_WAIT_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) returning %d",
+ GetCurrentThreadId (), ret);
+#endif
+
+ /*
+ * These need to be here. See MSDN dos on WaitForMultipleObjects.
*/
- LeaveCriticalSection(&monitor_mutex);
+ if (ret >= WAIT_OBJECT_0 && ret <= WAIT_OBJECT_0 + numhandles - 1) {
+ return ret - WAIT_OBJECT_0;
+ }
+ else if (ret >= WAIT_ABANDONED_0 && ret <= WAIT_ABANDONED_0 + numhandles - 1) {
+ return ret - WAIT_ABANDONED_0;
+ }
+ else {
+ return ret;
+ }
+}
+
+/* FIXME: exitContext isnt documented */
+gboolean ves_icall_System_Threading_WaitHandle_WaitOne_internal(MonoObject *this, HANDLE handle, gint32 ms, gboolean exitContext)
+{
+ guint32 ret;
- /* Acquire the mutex */
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Acquiring monitor mutex %p",
- mon->monitor);
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef THREAD_WAIT_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) waiting for %p, %d ms",
+ GetCurrentThreadId (), handle, ms);
#endif
- ret=WaitForSingleObject(mon->monitor, ms);
- if(ret==WAIT_OBJECT_0) {
- mon->count++;
- mon->tid=GetCurrentThreadId();
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": object %p now locked %d times", obj, mon->count);
+ if(ms== -1) {
+ ms=INFINITE;
+ }
+
+ ret=WaitForSingleObjectEx (handle, ms, TRUE);
+
+ if(ret==WAIT_FAILED) {
+#ifdef THREAD_WAIT_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Wait failed",
+ GetCurrentThreadId ());
+#endif
+ return(FALSE);
+ } else if(ret==WAIT_TIMEOUT || ret == WAIT_IO_COMPLETION) {
+ /* Do we want to try again if we get
+ * WAIT_IO_COMPLETION? The documentation for
+ * WaitHandle doesn't give any clues. (We'd have to
+ * fiddle with the timeout if we retry.)
+ */
+#ifdef THREAD_WAIT_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": (%d) Wait timed out",
+ GetCurrentThreadId ());
#endif
+ return(FALSE);
+ }
+
+ return(TRUE);
+}
- return(TRUE);
+HANDLE ves_icall_System_Threading_Mutex_CreateMutex_internal (MonoBoolean owned, MonoString *name, MonoBoolean *created)
+{
+ HANDLE mutex;
+
+ MONO_ARCH_SAVE_REGS;
+
+ *created = TRUE;
+
+ if (name == NULL) {
+ mutex = CreateMutex (NULL, owned, NULL);
+ } else {
+ mutex = CreateMutex (NULL, owned, mono_string_chars (name));
+
+ if (GetLastError () == ERROR_ALREADY_EXISTS) {
+ *created = FALSE;
+ }
}
- return(FALSE);
+ return(mutex);
+}
+
+void ves_icall_System_Threading_Mutex_ReleaseMutex_internal (HANDLE handle ) {
+ MONO_ARCH_SAVE_REGS;
+
+ ReleaseMutex(handle);
+}
+
+HANDLE ves_icall_System_Threading_Events_CreateEvent_internal (MonoBoolean manual, MonoBoolean initial, MonoString *name) {
+ MONO_ARCH_SAVE_REGS;
+
+ return(CreateEvent (NULL, manual, initial,
+ name==NULL?NULL:mono_string_chars (name)));
+}
+
+gboolean ves_icall_System_Threading_Events_SetEvent_internal (HANDLE handle) {
+ MONO_ARCH_SAVE_REGS;
+
+ return (SetEvent(handle));
+}
+
+gboolean ves_icall_System_Threading_Events_ResetEvent_internal (HANDLE handle) {
+ MONO_ARCH_SAVE_REGS;
+
+ return (ResetEvent(handle));
+}
+
+void
+ves_icall_System_Threading_Events_CloseEvent_internal (HANDLE handle) {
+ MONO_ARCH_SAVE_REGS;
+
+ CloseHandle (handle);
}
-void ves_icall_System_Threading_Monitor_Monitor_exit(MonoObject *obj)
+gint32 ves_icall_System_Threading_Interlocked_Increment_Int (gint32 *location)
{
- MonoThreadsSync *mon;
-
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Unlocking %p in thread %d", obj,
- GetCurrentThreadId());
+ MONO_ARCH_SAVE_REGS;
+
+ return InterlockedIncrement (location);
+}
+
+gint64 ves_icall_System_Threading_Interlocked_Increment_Long (gint64 *location)
+{
+ gint32 lowret;
+ gint32 highret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ EnterCriticalSection(&interlocked_mutex);
+
+ lowret = InterlockedIncrement((gint32 *) location);
+ if (0 == lowret)
+ highret = InterlockedIncrement((gint32 *) location + 1);
+ else
+ highret = *((gint32 *) location + 1);
+
+ LeaveCriticalSection(&interlocked_mutex);
+
+ return (gint64) highret << 32 | (gint64) lowret;
+}
+
+gint32 ves_icall_System_Threading_Interlocked_Decrement_Int (gint32 *location)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return InterlockedDecrement(location);
+}
+
+gint64 ves_icall_System_Threading_Interlocked_Decrement_Long (gint64 * location)
+{
+ gint32 lowret;
+ gint32 highret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ EnterCriticalSection(&interlocked_mutex);
+
+ lowret = InterlockedDecrement((gint32 *) location);
+ if (-1 == lowret)
+ highret = InterlockedDecrement((gint32 *) location + 1);
+ else
+ highret = *((gint32 *) location + 1);
+
+ LeaveCriticalSection(&interlocked_mutex);
+
+ return (gint64) highret << 32 | (gint64) lowret;
+}
+
+gint32 ves_icall_System_Threading_Interlocked_Exchange_Int (gint32 *location1, gint32 value)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return InterlockedExchange(location1, value);
+}
+
+MonoObject * ves_icall_System_Threading_Interlocked_Exchange_Object (MonoObject **location1, MonoObject *value)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return (MonoObject *) InterlockedExchangePointer((gpointer *) location1, value);
+}
+
+gfloat ves_icall_System_Threading_Interlocked_Exchange_Single (gfloat *location1, gfloat value)
+{
+ IntFloatUnion val, ret;
+
+ MONO_ARCH_SAVE_REGS;
+
+ val.fval = value;
+ ret.ival = InterlockedExchange((gint32 *) location1, val.ival);
+
+ return ret.fval;
+}
+
+gint32 ves_icall_System_Threading_Interlocked_CompareExchange_Int(gint32 *location1, gint32 value, gint32 comparand)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return InterlockedCompareExchange(location1, value, comparand);
+}
+
+MonoObject * ves_icall_System_Threading_Interlocked_CompareExchange_Object (MonoObject **location1, MonoObject *value, MonoObject *comparand)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ return (MonoObject *) InterlockedCompareExchangePointer((gpointer *) location1, value, comparand);
+}
+
+gfloat ves_icall_System_Threading_Interlocked_CompareExchange_Single (gfloat *location1, gfloat value, gfloat comparand)
+{
+ IntFloatUnion val, ret, cmp;
+
+ MONO_ARCH_SAVE_REGS;
+
+ val.fval = value;
+ cmp.fval = comparand;
+ ret.ival = InterlockedCompareExchange((gint32 *) location1, val.ival, cmp.ival);
+
+ return ret.fval;
+}
+
+int
+mono_thread_get_abort_signal (void)
+{
+#ifdef __MINGW32__
+ return -1;
+#else
+#ifndef SIGRTMIN
+ return SIGUSR1;
+#else
+ return SIGRTMIN;
#endif
+#endif /* __MINGW32__ */
+}
- /* No need to lock monitor_mutex here because we only adjust
- * the monitor state if this thread already owns the lock
- */
- mon=obj->synchronisation;
+#ifdef __MINGW32__
+static guint32 interruption_request_apc (gpointer param)
+{
+ MonoException* exc = mono_thread_request_interruption (FALSE);
+ if (exc) mono_raise_exception (exc);
+ return 0;
+}
+#endif /* __MINGW32__ */
- if(mon==NULL) {
- return;
- }
+/*
+ * signal_thread_state_change
+ *
+ * Tells the thread that his state has changed and it has to enter the new
+ * state as soon as possible.
+ */
+static void signal_thread_state_change (MonoThread *thread)
+{
+#ifdef __MINGW32__
+ QueueUserAPC (interruption_request_apc, thread->handle, NULL);
+#else
+ /* fixme: store the state somewhere */
+#ifdef PTHREAD_POINTER_ID
+ pthread_kill (GUINT_TO_POINTER(thread->tid), mono_thread_get_abort_signal ());
+#else
+ pthread_kill (thread->tid, mono_thread_get_abort_signal ());
+#endif
+#endif /* __MINGW32__ */
+}
+
+void
+ves_icall_System_Threading_Thread_Abort (MonoThread *thread, MonoObject *state)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ mono_monitor_enter (thread->synch_lock);
- if(mon->tid!=GetCurrentThreadId()) {
+ if ((thread->state & ThreadState_AbortRequested) != 0 ||
+ (thread->state & ThreadState_StopRequested) != 0)
+ {
+ mono_monitor_exit (thread->synch_lock);
return;
}
+
+ thread->state |= ThreadState_AbortRequested;
+ thread->abort_state = state;
+ thread->abort_exc = NULL;
+
+ mono_monitor_exit (thread->synch_lock);
+
+#ifdef THREAD_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": (%d) Abort requested for %p (%d)", GetCurrentThreadId (),
+ thread, thread->tid);
+#endif
- mon->count--;
+ /* Make sure the thread is awake */
+ ves_icall_System_Threading_Thread_Resume (thread);
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": %p now locked %d times", obj,
- mon->count);
-#endif
+ signal_thread_state_change (thread);
+}
- if(mon->count==0) {
- mon->tid=0; /* FIXME: check that 0 isnt a valid id */
+void
+ves_icall_System_Threading_Thread_ResetAbort (void)
+{
+ MonoThread *thread = mono_thread_current ();
+
+ MONO_ARCH_SAVE_REGS;
+
+ mono_monitor_enter (thread->synch_lock);
+
+ thread->state &= ~ThreadState_AbortRequested;
+
+ if (!thread->abort_exc) {
+ const char *msg = "Unable to reset abort because no abort was requested";
+ mono_monitor_exit (thread->synch_lock);
+ mono_raise_exception (mono_get_exception_thread_state (msg));
+ } else {
+ thread->abort_exc = NULL;
+ thread->abort_state = NULL;
}
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Releasing mutex %p", mon->monitor);
-#endif
-
- ReleaseMutex(mon->monitor);
+ mono_monitor_exit (thread->synch_lock);
}
-gboolean ves_icall_System_Threading_Monitor_Monitor_test_owner(MonoObject *obj)
+void
+ves_icall_System_Threading_Thread_Suspend (MonoThread *thread)
{
- MonoThreadsSync *mon;
- gboolean ret=FALSE;
-
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": Testing if %p is owned by thread %d", obj,
- GetCurrentThreadId());
-#endif
+ MONO_ARCH_SAVE_REGS;
- EnterCriticalSection(&monitor_mutex);
-
- mon=obj->synchronisation;
- if(mon==NULL) {
- goto finished;
+ mono_monitor_enter (thread->synch_lock);
+
+ if ((thread->state & ThreadState_Suspended) != 0 ||
+ (thread->state & ThreadState_SuspendRequested) != 0 ||
+ (thread->state & ThreadState_StopRequested) != 0)
+ {
+ mono_monitor_exit (thread->synch_lock);
+ return;
}
+
+ thread->state |= ThreadState_SuspendRequested;
+ mono_monitor_exit (thread->synch_lock);
- if(mon->tid!=GetCurrentThreadId()) {
-#ifdef THREAD_LOCK_DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION
- ": object %p is owned by thread %d", obj, mon->tid);
-#endif
+ signal_thread_state_change (thread);
+}
+
+void
+ves_icall_System_Threading_Thread_Resume (MonoThread *thread)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ mono_monitor_enter (thread->synch_lock);
- goto finished;
+ if ((thread->state & ThreadState_SuspendRequested) != 0) {
+ thread->state &= ~ThreadState_SuspendRequested;
+ mono_monitor_exit (thread->synch_lock);
+ return;
+ }
+
+ if ((thread->state & ThreadState_Suspended) == 0)
+ {
+ mono_monitor_exit (thread->synch_lock);
+ return;
}
- ret=TRUE;
+ thread->resume_event = CreateEvent (NULL, TRUE, FALSE, NULL);
-finished:
- LeaveCriticalSection(&monitor_mutex);
+ /* Awake the thread */
+ SetEvent (thread->suspend_event);
- return(ret);
+ mono_monitor_exit (thread->synch_lock);
+
+ /* Wait for the thread to awake */
+ WaitForSingleObject (thread->resume_event, INFINITE);
+ CloseHandle (thread->resume_event);
+ thread->resume_event = NULL;
}
-gboolean ves_icall_System_Threading_Monitor_Monitor_test_synchronised(MonoObject *obj)
+static gboolean
+find_wrapper (MonoMethod *m, gint no, gint ilo, gboolean managed, gpointer data)
{
- MonoThreadsSync *mon;
- gboolean ret=FALSE;
-
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": Testing if %p is owned by any thread", obj);
-#endif
+ if (managed)
+ return TRUE;
- EnterCriticalSection(&monitor_mutex);
-
- mon=obj->synchronisation;
- if(mon==NULL) {
- goto finished;
+ if (m->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE) {
+ *((gboolean*)data) = TRUE;
+ return TRUE;
}
+ return FALSE;
+}
+
+static gboolean
+is_running_protected_wrapper (void)
+{
+ gboolean found = FALSE;
+ mono_stack_walk (find_wrapper, &found);
+ return found;
+}
+
+void mono_thread_stop (MonoThread *thread)
+{
+ mono_monitor_enter (thread->synch_lock);
- if(mon->tid==0) {
- goto finished;
+ if ((thread->state & ThreadState_StopRequested) != 0 ||
+ (thread->state & ThreadState_Stopped) != 0)
+ {
+ mono_monitor_exit (thread->synch_lock);
+ return;
}
- g_assert(mon->count);
+ /* Make sure the thread is awake */
+ ves_icall_System_Threading_Thread_Resume (thread);
- ret=TRUE;
+ thread->state |= ThreadState_StopRequested;
+ thread->state &= ~ThreadState_AbortRequested;
-finished:
- LeaveCriticalSection(&monitor_mutex);
+ mono_monitor_exit (thread->synch_lock);
+
+ signal_thread_state_change (thread);
+}
- return(ret);
+gint8
+ves_icall_System_Threading_Thread_VolatileRead1 (void *ptr)
+{
+ return *((volatile gint8 *) (ptr));
}
-
-void ves_icall_System_Threading_Monitor_Monitor_pulse(MonoObject *obj)
+gint16
+ves_icall_System_Threading_Thread_VolatileRead2 (void *ptr)
+{
+ return *((volatile gint16 *) (ptr));
+}
+
+gint32
+ves_icall_System_Threading_Thread_VolatileRead4 (void *ptr)
+{
+ return *((volatile gint32 *) (ptr));
+}
+
+gint64
+ves_icall_System_Threading_Thread_VolatileRead8 (void *ptr)
+{
+ return *((volatile gint64 *) (ptr));
+}
+
+void *
+ves_icall_System_Threading_Thread_VolatileReadIntPtr (void *ptr)
+{
+ return (void *) *((volatile void **) ptr);
+}
+
+void
+ves_icall_System_Threading_Thread_VolatileWrite1 (void *ptr, gint8 value)
+{
+ *((volatile gint8 *) ptr) = value;
+}
+
+void
+ves_icall_System_Threading_Thread_VolatileWrite2 (void *ptr, gint16 value)
+{
+ *((volatile gint16 *) ptr) = value;
+}
+
+void
+ves_icall_System_Threading_Thread_VolatileWrite4 (void *ptr, gint32 value)
+{
+ *((volatile gint32 *) ptr) = value;
+}
+
+void
+ves_icall_System_Threading_Thread_VolatileWrite8 (void *ptr, gint64 value)
+{
+ *((volatile gint64 *) ptr) = value;
+}
+
+void
+ves_icall_System_Threading_Thread_VolatileWriteIntPtr (void *ptr, void *value)
{
- gboolean have_waiters;
- MonoThreadsSync *mon;
+ *((volatile void **) ptr) = value;
+}
+
+void mono_thread_init (MonoThreadStartCB start_cb,
+ MonoThreadAttachCB attach_cb)
+{
+ InitializeCriticalSection(&threads_mutex);
+ InitializeCriticalSection(&interlocked_mutex);
+ InitializeCriticalSection(&contexts_mutex);
+ InitializeCriticalSection(&interruption_mutex);
-#ifdef THREAD_LOCK_DEBUG
- g_message("Pulsing %p in thread %d", obj, GetCurrentThreadId());
+ mono_init_static_data_info (&thread_static_info);
+ mono_init_static_data_info (&context_static_info);
+
+ current_object_key=TlsAlloc();
+#ifdef THREAD_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Allocated current_object_key %d",
+ current_object_key);
#endif
- EnterCriticalSection(&monitor_mutex);
-
- mon=obj->synchronisation;
- if(mon==NULL) {
- LeaveCriticalSection(&monitor_mutex);
- return;
- }
+ mono_thread_start_cb = start_cb;
+ mono_thread_attach_cb = attach_cb;
- if(mon->tid!=GetCurrentThreadId()) {
- LeaveCriticalSection(&monitor_mutex);
- return;
- }
- LeaveCriticalSection(&monitor_mutex);
-
- EnterCriticalSection(&mon->waiters_count_lock);
- have_waiters=(mon->waiters_count>0);
- LeaveCriticalSection(&mon->waiters_count_lock);
-
- if(have_waiters==TRUE) {
- ReleaseSemaphore(mon->sema, 1, 0);
- }
+ slothash_key=TlsAlloc();
+
+ /* Get a pseudo handle to the current process. This is just a
+ * kludge so that wapi can build a process handle if needed.
+ * As a pseudo handle is returned, we don't need to clean
+ * anything up.
+ */
+ GetCurrentProcess ();
}
-void ves_icall_System_Threading_Monitor_Monitor_pulse_all(MonoObject *obj)
+void
+mono_threads_install_cleanup (MonoThreadCleanupFunc func)
{
- gboolean have_waiters=FALSE;
- MonoThreadsSync *mon;
-
-#ifdef THREAD_LOCK_DEBUG
- g_message("Pulsing all %p", obj);
+ mono_thread_cleanup = func;
+}
+
+void mono_install_thread_callbacks (MonoThreadCallbacks *callbacks)
+{
+ mono_thread_callbacks = callbacks;
+}
+
+#ifdef THREAD_DEBUG
+static void print_tids (gpointer key, gpointer value, gpointer user)
+{
+ g_message ("Waiting for: %d", GPOINTER_TO_UINT(key));
+}
#endif
- EnterCriticalSection(&monitor_mutex);
+struct wait_data
+{
+ HANDLE handles[MAXIMUM_WAIT_OBJECTS];
+ MonoThread *threads[MAXIMUM_WAIT_OBJECTS];
+ guint32 num;
+};
+
+static void wait_for_tids (struct wait_data *wait, guint32 timeout)
+{
+ guint32 i, ret;
- mon=obj->synchronisation;
- if(mon==NULL) {
- LeaveCriticalSection(&monitor_mutex);
- return;
- }
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ": %d threads to wait for in this batch", wait->num);
+#endif
- if(mon->tid!=GetCurrentThreadId()) {
- LeaveCriticalSection(&monitor_mutex);
+ ret=WaitForMultipleObjectsEx(wait->num, wait->handles, TRUE, timeout, FALSE);
+
+ if(ret==WAIT_FAILED) {
+ /* See the comment in build_wait_tids() */
+#ifdef THREAD_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Wait failed");
+#endif
return;
}
- LeaveCriticalSection(&monitor_mutex);
- EnterCriticalSection(&mon->waiters_count_lock);
- if(mon->waiters_count>0) {
- mon->was_broadcast=TRUE;
- have_waiters=TRUE;
- }
+
+ for(i=0; i<wait->num; i++) {
+ guint32 tid=wait->threads[i]->tid;
+ CloseHandle (wait->handles[i]);
+
+ if(mono_g_hash_table_lookup (threads, GUINT_TO_POINTER(tid))!=NULL) {
+ /* This thread must have been killed, because
+ * it hasn't cleaned itself up. (It's just
+ * possible that the thread exited before the
+ * parent thread had a chance to store the
+ * handle, and now there is another pointer to
+ * the already-exited thread stored. In this
+ * case, we'll just get two
+ * mono_profiler_thread_end() calls for the
+ * same thread.)
+ */
- if(have_waiters==TRUE) {
- ReleaseSemaphore(mon->sema, mon->waiters_count, 0);
+#ifdef THREAD_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION
+ ": cleaning up after thread %d", tid);
+#endif
+ thread_cleanup (wait->threads[i]);
+ }
+ }
+}
+
+static void build_wait_tids (gpointer key, gpointer value, gpointer user)
+{
+ struct wait_data *wait=(struct wait_data *)user;
+
+ if(wait->num<MAXIMUM_WAIT_OBJECTS) {
+ HANDLE handle;
+ MonoThread *thread=(MonoThread *)value;
+
+ /* Ignore background threads, we abort them later */
+ if (thread->state & ThreadState_Background)
+ return; /* just leave, ignore */
- LeaveCriticalSection(&mon->waiters_count_lock);
+ if (mono_gc_is_finalizer_thread (thread))
+ return;
+
+ if (thread == mono_thread_current ())
+ return;
+
+ handle = OpenThread (THREAD_ALL_ACCESS, TRUE, thread->tid);
+ if (handle == NULL)
+ return;
- WaitForSingleObject(mon->waiters_done, INFINITE);
- mon->was_broadcast=FALSE;
+ wait->handles[wait->num]=handle;
+ wait->threads[wait->num]=thread;
+ wait->num++;
} else {
- LeaveCriticalSection(&mon->waiters_count_lock);
+ /* Just ignore the rest, we can't do anything with
+ * them yet
+ */
}
}
-gboolean ves_icall_System_Threading_Monitor_Monitor_wait(MonoObject *obj,
- int ms)
+static gboolean
+remove_and_abort_threads (gpointer key, gpointer value, gpointer user)
{
- gboolean last_waiter;
- MonoThreadsSync *mon;
- guint32 save_count;
-
-#ifdef THREAD_LOCK_DEBUG
- g_message("Trying to wait for %p in thread %d with timeout %dms", obj,
- GetCurrentThreadId(), ms);
-#endif
+ struct wait_data *wait=(struct wait_data *)user;
+ guint32 self = GetCurrentThreadId ();
+ MonoThread *thread = (MonoThread *) value;
+ HANDLE handle;
- EnterCriticalSection(&monitor_mutex);
+ /* The finalizer thread is not a background thread */
+ if (thread->tid != self && thread->state & ThreadState_Background) {
- mon=obj->synchronisation;
- if(mon==NULL) {
- LeaveCriticalSection(&monitor_mutex);
- return(FALSE);
+ handle = OpenThread (THREAD_ALL_ACCESS, TRUE, thread->tid);
+ if (handle == NULL)
+ return FALSE;
+
+ wait->handles[wait->num]=thread->handle;
+ wait->threads[wait->num]=thread;
+ wait->num++;
+
+ if(thread->state & ThreadState_AbortRequested ||
+ thread->state & ThreadState_Aborted) {
+#ifdef THREAD_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Thread id %d already aborting", thread->tid);
+#endif
+ return(TRUE);
+ }
+
+#ifdef THREAD_DEBUG
+ g_print (G_GNUC_PRETTY_FUNCTION ": Aborting id: %d\n", thread->tid);
+#endif
+ mono_thread_stop (thread);
+ return TRUE;
}
- if(mon->tid!=GetCurrentThreadId()) {
- LeaveCriticalSection(&monitor_mutex);
- return(FALSE);
- }
- LeaveCriticalSection(&monitor_mutex);
-
- EnterCriticalSection(&mon->waiters_count_lock);
- mon->waiters_count++;
- LeaveCriticalSection(&mon->waiters_count_lock);
+ return (thread->tid != self && !mono_gc_is_finalizer_thread (thread));
+}
+
+void mono_thread_manage (void)
+{
+ struct wait_data *wait=g_new0 (struct wait_data, 1);
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": %p locked %d times", obj,
- mon->count);
+ /* join each thread that's still running */
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": Joining each running thread...");
#endif
-
- /* We need to put the lock count back afterwards */
- save_count=mon->count;
- while(mon->count>1) {
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Releasing mutex %p",
- mon->monitor);
+ EnterCriticalSection (&threads_mutex);
+ if(threads==NULL) {
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ": No threads");
#endif
-
- ReleaseMutex(mon->monitor);
- mon->count--;
+ LeaveCriticalSection (&threads_mutex);
+ return;
}
+ LeaveCriticalSection (&threads_mutex);
- /* We're releasing this mutex */
- mon->count=0;
- mon->tid=0;
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Signalling monitor mutex %p",
- mon->monitor);
+ do {
+ EnterCriticalSection (&threads_mutex);
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION
+ ":There are %d threads to join",
+ mono_g_hash_table_size (threads));
+ mono_g_hash_table_foreach (threads, print_tids, NULL);
#endif
-
- SignalObjectAndWait(mon->monitor, mon->sema, INFINITE, FALSE);
- EnterCriticalSection(&mon->waiters_count_lock);
- mon->waiters_count++;
- last_waiter=mon->was_broadcast && mon->waiters_count==0;
- LeaveCriticalSection(&mon->waiters_count_lock);
+ wait->num=0;
+ mono_g_hash_table_foreach (threads, build_wait_tids, wait);
+ LeaveCriticalSection (&threads_mutex);
+ if(wait->num>0) {
+ /* Something to wait for */
+ wait_for_tids (wait, INFINITE);
+ }
+ } while(wait->num>0);
- if(last_waiter) {
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Waiting for monitor mutex %p",
- mon->monitor);
-#endif
- SignalObjectAndWait(mon->waiters_done, mon->monitor, INFINITE, FALSE);
- } else {
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Waiting for monitor mutex %p",
- mon->monitor);
-#endif
- WaitForSingleObject(mon->monitor, INFINITE);
- }
+ mono_thread_pool_cleanup ();
- /* We've reclaimed this mutex */
- mon->count=save_count;
- mon->tid=GetCurrentThreadId();
+ EnterCriticalSection(&threads_mutex);
- /* Lock the mutex the required number of times */
- while(save_count>1) {
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": Waiting for monitor mutex %p", mon->monitor);
-#endif
- WaitForSingleObject(mon->monitor, INFINITE);
- save_count--;
+ /*
+ * Remove everything but the finalizer thread and self.
+ * Also abort all the background threads
+ * */
+ wait->num = 0;
+ mono_g_hash_table_foreach_remove (threads, remove_and_abort_threads, wait);
+
+ LeaveCriticalSection(&threads_mutex);
+
+ if(wait->num>0) {
+ /* Something to wait for */
+ wait_for_tids (wait, INFINITE);
}
-
-#ifdef THREAD_LOCK_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": %p still locked %d times", obj,
- mon->count);
+ /*
+ * give the subthreads a chance to really quit (this is mainly needed
+ * to get correct user and system times from getrusage/wait/time(1)).
+ * This could be removed if we avoid pthread_detach() and use pthread_join().
+ */
+#ifndef PLATFORM_WIN32
+ sched_yield ();
#endif
-
- return(TRUE);
+
+ g_free (wait);
}
-/* FIXME: exitContext isnt documented */
-gboolean ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
+static void terminate_thread (gpointer key, gpointer value, gpointer user)
{
- HANDLE *handles;
- guint32 numhandles;
- guint32 ret;
- guint32 i;
+ MonoThread *thread=(MonoThread *)value;
+ guint32 self=GPOINTER_TO_UINT (user);
- numhandles=mono_array_length(mono_handles);
- handles=g_new0(HANDLE, numhandles);
- for(i=0; i<numhandles; i++) {
- handles[i]=mono_array_get(mono_handles, HANDLE, i);
+ if(thread->tid!=self) {
+ /*TerminateThread (thread->handle, -1);*/
}
+}
+
+void mono_thread_abort_all_other_threads (void)
+{
+ guint32 self=GetCurrentThreadId ();
+
+ EnterCriticalSection (&threads_mutex);
+#ifdef THREAD_DEBUG
+ g_message(G_GNUC_PRETTY_FUNCTION ":There are %d threads to abort",
+ mono_g_hash_table_size (threads));
+ mono_g_hash_table_foreach (threads, print_tids, NULL);
+#endif
+
+ mono_g_hash_table_foreach (threads, terminate_thread,
+ GUINT_TO_POINTER (self));
- if(ms== -1) {
- ms=INFINITE;
+ LeaveCriticalSection (&threads_mutex);
+}
+
+/*
+ * mono_thread_push_appdomain_ref:
+ *
+ * Register that the current thread may have references to objects in domain
+ * @domain on its stack. Each call to this function should be paired with a
+ * call to pop_appdomain_ref.
+ */
+void
+mono_thread_push_appdomain_ref (MonoDomain *domain)
+{
+ MonoThread *thread = mono_thread_current ();
+
+ if (thread) {
+ /* printf ("PUSH REF: %p -> %s.\n", thread, domain->friendly_name); */
+ EnterCriticalSection (&threads_mutex);
+ thread->appdomain_refs = g_slist_prepend (thread->appdomain_refs, domain);
+ LeaveCriticalSection (&threads_mutex);
}
-
- ret=WaitForMultipleObjects(numhandles, handles, TRUE, ms);
+}
- g_free(handles);
-
- if(ret==WAIT_FAILED) {
-#ifdef THREAD_WAIT_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Wait failed");
-#endif
- return(FALSE);
- } else if(ret==WAIT_TIMEOUT) {
-#ifdef THREAD_WAIT_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Wait timed out");
-#endif
- return(FALSE);
+void
+mono_thread_pop_appdomain_ref (void)
+{
+ MonoThread *thread = mono_thread_current ();
+
+ if (thread) {
+ /* printf ("POP REF: %p -> %s.\n", thread, ((MonoDomain*)(thread->appdomain_refs->data))->friendly_name); */
+ EnterCriticalSection (&threads_mutex);
+ /* FIXME: How can the list be empty ? */
+ if (thread->appdomain_refs)
+ thread->appdomain_refs = g_slist_remove (thread->appdomain_refs, thread->appdomain_refs->data);
+ LeaveCriticalSection (&threads_mutex);
}
-
- return(TRUE);
}
-/* FIXME: exitContext isnt documented */
-gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext)
+static gboolean
+mono_thread_has_appdomain_ref (MonoThread *thread, MonoDomain *domain)
{
- HANDLE *handles;
- guint32 numhandles;
- guint32 ret;
- guint32 i;
-
- numhandles=mono_array_length(mono_handles);
- handles=g_new0(HANDLE, numhandles);
- for(i=0; i<numhandles; i++) {
- handles[i]=mono_array_get(mono_handles, HANDLE, i);
+ gboolean res;
+ EnterCriticalSection (&threads_mutex);
+ res = g_slist_find (thread->appdomain_refs, domain) != NULL;
+ LeaveCriticalSection (&threads_mutex);
+ return res;
+}
+
+typedef struct abort_appdomain_data {
+ struct wait_data wait;
+ MonoDomain *domain;
+} abort_appdomain_data;
+
+static void
+abort_appdomain_thread (gpointer key, gpointer value, gpointer user_data)
+{
+ MonoThread *thread = (MonoThread*)value;
+ abort_appdomain_data *data = (abort_appdomain_data*)user_data;
+ MonoDomain *domain = data->domain;
+
+ if (mono_thread_has_appdomain_ref (thread, domain)) {
+ /* printf ("ABORTING THREAD %p BECAUSE IT REFERENCES DOMAIN %s.\n", thread, domain->friendly_name); */
+ HANDLE handle = OpenThread (THREAD_ALL_ACCESS, TRUE, thread->tid);
+ if (handle == NULL)
+ return;
+
+ ves_icall_System_Threading_Thread_Abort (thread, NULL);
+
+ if(data->wait.num<MAXIMUM_WAIT_OBJECTS) {
+ data->wait.handles [data->wait.num] = handle;
+ data->wait.threads [data->wait.num] = thread;
+ data->wait.num++;
+ } else {
+ /* Just ignore the rest, we can't do anything with
+ * them yet
+ */
+ }
}
-
- if(ms== -1) {
- ms=INFINITE;
+}
+
+/*
+ * mono_threads_abort_appdomain_threads:
+ *
+ * Abort threads which has references to the given appdomain.
+ */
+gboolean
+mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout)
+{
+ abort_appdomain_data user_data;
+ guint32 start_time;
+
+ /* printf ("ABORT BEGIN.\n"); */
+
+ start_time = GetTickCount ();
+ do {
+ EnterCriticalSection (&threads_mutex);
+
+ user_data.domain = domain;
+ user_data.wait.num = 0;
+ mono_g_hash_table_foreach (threads, abort_appdomain_thread, &user_data);
+ LeaveCriticalSection (&threads_mutex);
+
+ if (user_data.wait.num > 0)
+ wait_for_tids (&user_data.wait, timeout);
+
+ /* Update remaining time */
+ timeout -= GetTickCount () - start_time;
+ start_time = GetTickCount ();
+
+ if (timeout < 0)
+ return FALSE;
}
+ while (user_data.wait.num > 0);
- ret=WaitForMultipleObjects(numhandles, handles, FALSE, ms);
+ /* printf ("ABORT DONE.\n"); */
- g_free(handles);
-
-#ifdef THREAD_WAIT_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": returning %d", ret);
-#endif
+ return TRUE;
+}
+
+/*
+ * mono_thread_get_pending_exception:
+ *
+ * Return an exception which needs to be raised when leaving a catch clause.
+ * This is used for undeniable exception propagation.
+ */
+MonoException*
+mono_thread_get_pending_exception (void)
+{
+ MonoThread *thread = mono_thread_current ();
+
+ MONO_ARCH_SAVE_REGS;
- return(ret);
+ if (thread && thread->abort_exc && !is_running_protected_wrapper ()) {
+ /*
+ * FIXME: Clear the abort exception and return an AppDomainUnloaded
+ * exception if the thread no longer references a dying appdomain.
+ */
+ thread->abort_exc->trace_ips = NULL;
+ thread->abort_exc->stack_trace = NULL;
+ return thread->abort_exc;
+ }
+
+ return NULL;
}
-/* FIXME: exitContext isnt documented */
-gboolean ves_icall_System_Threading_WaitHandle_WaitOne_internal(MonoObject *this, HANDLE handle, gint32 ms, gboolean exitContext)
+#define NUM_STATIC_DATA_IDX 8
+static const int static_data_size [NUM_STATIC_DATA_IDX] = {
+ 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216
+};
+
+
+/*
+ * mono_alloc_static_data
+ *
+ * Allocate memory blocks for storing threads or context static data
+ */
+static void
+mono_alloc_static_data (gpointer **static_data_ptr, guint32 offset)
{
- guint32 ret;
-
-#ifdef THREAD_WAIT_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": waiting for %p", handle);
+ guint idx = (offset >> 24) - 1;
+ int i;
+
+ gpointer* static_data = *static_data_ptr;
+ if (!static_data) {
+#if HAVE_BOEHM_GC
+ static_data = GC_MALLOC (static_data_size [0]);
+#else
+ static_data = g_malloc0 (static_data_size [0]);
#endif
-
- if(ms== -1) {
- ms=INFINITE;
+ *static_data_ptr = static_data;
+ static_data [0] = static_data;
}
- ret=WaitForSingleObject(handle, ms);
- if(ret==WAIT_FAILED) {
-#ifdef THREAD_WAIT_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Wait failed");
-#endif
- return(FALSE);
- } else if(ret==WAIT_TIMEOUT) {
-#ifdef THREAD_WAIT_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION ": Wait timed out");
+ for (i = 1; i < idx; ++i) {
+ if (static_data [i])
+ continue;
+#if HAVE_BOEHM_GC
+ static_data [i] = GC_MALLOC (static_data_size [i]);
+#else
+ static_data [i] = g_malloc0 (static_data_size [i]);
#endif
- return(FALSE);
}
-
- return(TRUE);
}
-HANDLE ves_icall_System_Threading_Mutex_CreateMutex_internal (MonoBoolean owned,char *name) {
- return(CreateMutex(NULL,owned,name));
-}
-
-void ves_icall_System_Threading_Mutex_ReleaseMutex_internal (HANDLE handle ) {
- ReleaseMutex(handle);
+/*
+ * mono_init_static_data_info
+ *
+ * Initializes static data counters
+ */
+static void mono_init_static_data_info (StaticDataInfo *static_data)
+{
+ static_data->idx = 0;
+ static_data->offset = 0;
}
-HANDLE ves_icall_System_Threading_Events_CreateEvent_internal (MonoBoolean manual,
- MonoBoolean initial,
- char *name) {
- return (CreateEvent(NULL,manual,initial,name));
-}
+/*
+ * mono_alloc_static_data_slot
+ *
+ * Generates an offset for static data. static_data contains the counters
+ * used to generate it.
+ */
+static guint32
+mono_alloc_static_data_slot (StaticDataInfo *static_data, guint32 size, guint32 align)
+{
+ guint32 offset;
-gboolean ves_icall_System_Threading_Events_SetEvent_internal (HANDLE handle) {
- return (SetEvent(handle));
+ if (!static_data->idx && !static_data->offset) {
+ /*
+ * we use the first chunk of the first allocation also as
+ * an array for the rest of the data
+ */
+ static_data->offset = sizeof (gpointer) * NUM_STATIC_DATA_IDX;
+ }
+ static_data->offset += align - 1;
+ static_data->offset &= ~(align - 1);
+ if (static_data->offset + size >= static_data_size [static_data->idx]) {
+ static_data->idx ++;
+ g_assert (size <= static_data_size [static_data->idx]);
+ /*
+ * massive unloading and reloading of domains with thread-static
+ * data may eventually exceed the allocated storage...
+ * Need to check what the MS runtime does in that case.
+ * Note that for each appdomain, we need to allocate a separate
+ * thread data slot for security reasons. We could keep track
+ * of the slots per-domain and when the domain is unloaded
+ * out the slots on a sort of free list.
+ */
+ g_assert (static_data->idx < NUM_STATIC_DATA_IDX);
+ static_data->offset = 0;
+ }
+ offset = static_data->offset | ((static_data->idx + 1) << 24);
+ static_data->offset += size;
+ return offset;
}
-gboolean ves_icall_System_Threading_Events_ResetEvent_internal (HANDLE handle) {
- return (ResetEvent(handle));
+/*
+ * ensure thread static fields already allocated are valid for thread
+ * This function is called when a thread is created or on thread attach.
+ */
+static void
+thread_adjust_static_data (MonoThread *thread)
+{
+ guint32 offset;
+
+ EnterCriticalSection (&threads_mutex);
+ if (thread_static_info.offset || thread_static_info.idx > 0) {
+ /* get the current allocated size */
+ offset = thread_static_info.offset | ((thread_static_info.idx + 1) << 24);
+ mono_alloc_static_data (&(thread->static_data), offset);
+ }
+ LeaveCriticalSection (&threads_mutex);
}
-void mono_thread_init(MonoDomain *domain, MonoThreadStartCB start_cb)
+static void
+alloc_thread_static_data_helper (gpointer key, gpointer value, gpointer user)
{
- MonoClass *thread_class;
+ MonoThread *thread = value;
+ guint32 offset = GPOINTER_TO_UINT (user);
- /* Build a System.Threading.Thread object instance to return
- * for the main line's Thread.CurrentThread property.
- */
- thread_class=mono_class_from_name(mono_defaults.corlib, "System.Threading", "Thread");
-
- /* I wonder what happens if someone tries to destroy this
- * object? In theory, I guess the whole program should act as
- * though exit() were called :-)
- */
-#ifdef THREAD_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": Starting to build main Thread object");
-#endif
- main_thread = mono_object_new (domain, thread_class);
-#ifdef THREAD_DEBUG
- g_message(G_GNUC_PRETTY_FUNCTION
- ": Finished building main Thread object: %p", main_thread);
-#endif
+ mono_alloc_static_data (&(thread->static_data), offset);
+}
- InitializeCriticalSection(&threads_mutex);
- InitializeCriticalSection(&monitor_mutex);
- InitializeCriticalSection(&interlocked_mutex);
-
- current_object_key=TlsAlloc();
-#ifdef THREAD_DEBUG
- g_message (G_GNUC_PRETTY_FUNCTION ": Allocated current_object_key %d",
- current_object_key);
-#endif
+/*
+ * The offset for a special static variable is composed of three parts:
+ * a bit that indicates the type of static data (0:thread, 1:context),
+ * an index in the array of chunks of memory for the thread (thread->static_data)
+ * and an offset in that chunk of mem. This allows allocating less memory in the
+ * common case.
+ */
- TlsSetValue(current_object_key, main_thread);
+guint32
+mono_alloc_special_static_data (guint32 static_type, guint32 size, guint32 align)
+{
+ guint32 offset;
+ if (static_type == SPECIAL_STATIC_THREAD)
+ {
+ EnterCriticalSection (&threads_mutex);
+ offset = mono_alloc_static_data_slot (&thread_static_info, size, align);
+ /* This can be called during startup */
+ if (threads != NULL)
+ mono_g_hash_table_foreach (threads, alloc_thread_static_data_helper, GUINT_TO_POINTER (offset));
+ LeaveCriticalSection (&threads_mutex);
+ }
+ else
+ {
+ g_assert (static_type == SPECIAL_STATIC_CONTEXT);
+ EnterCriticalSection (&contexts_mutex);
+ offset = mono_alloc_static_data_slot (&context_static_info, size, align);
+ LeaveCriticalSection (&contexts_mutex);
+ offset |= 0x80000000; /* Set the high bit to indicate context static data */
+ }
+ return offset;
+}
- mono_thread_start_cb = start_cb;
+gpointer
+mono_get_special_static_data (guint32 offset)
+{
+ /* The high bit means either thread (0) or static (1) data. */
- slothash_key=TlsAlloc();
+ guint32 static_type = (offset & 0x80000000);
+ int idx;
+
+ offset &= 0x7fffffff;
+ idx = (offset >> 24) - 1;
+
+ if (static_type == 0)
+ {
+ MonoThread *thread = mono_thread_current ();
+ return ((char*) thread->static_data [idx]) + (offset & 0xffffff);
+ }
+ else
+ {
+ /* Allocate static data block under demand, since we don't have a list
+ // of contexts
+ */
+ MonoAppContext *context = mono_context_get ();
+ if (!context->static_data || !context->static_data [idx]) {
+ EnterCriticalSection (&contexts_mutex);
+ mono_alloc_static_data (&(context->static_data), offset);
+ LeaveCriticalSection (&contexts_mutex);
+ }
+ return ((char*) context->static_data [idx]) + (offset & 0xffffff);
+ }
}
-void mono_thread_cleanup(void)
+static void gc_stop_world (gpointer key, gpointer value, gpointer user)
{
- HANDLE wait[MAXIMUM_WAIT_OBJECTS];
- guint32 i, j;
-
- /* join each thread that's still running */
-#ifdef THREAD_DEBUG
- g_message("Joining each running thread...");
+ MonoThread *thread=(MonoThread *)value;
+ guint32 self=GPOINTER_TO_UINT (user);
+
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %d - %d", self, thread->tid);
#endif
- if(threads==NULL) {
-#ifdef THREAD_DEBUG
- g_message("No threads");
-#endif
+ if(thread->tid==self)
return;
- }
-
- /* This isnt the right way to do it.
- *
- * The first method call should be started in its own thread,
- * and then the main thread should poll an event and wait for
- * any terminated threads, until there are none left. (This
- * loop will break if a subthread creates new threads after
- * the main thread ends.)
- */
-#ifdef THREAD_DEBUG
- g_message("There are %d threads to join", threads->len);
- for(i=0; i<threads->len; i++) {
- g_message("Waiting for: %p", g_ptr_array_index(threads, i));
- }
-#endif
- for(i=0; i<threads->len; i+=MAXIMUM_WAIT_OBJECTS) {
- for(j=0; j<MAXIMUM_WAIT_OBJECTS && i+j<threads->len; j++) {
-#ifdef THREAD_DEBUG
- g_message("Waiting for threads %d in slot %d", i+j, j);
-#endif
- wait[j]=g_ptr_array_index(threads, i+j);
- }
-#ifdef THREAD_DEBUG
- g_message("%d threads to wait for in this batch", j);
+ SuspendThread (thread->handle);
+}
+
+void mono_gc_stop_world (void)
+{
+ guint32 self=GetCurrentThreadId ();
+
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %d - %p", self, threads);
#endif
- WaitForMultipleObjects(j, wait, TRUE, INFINITE);
- }
+ EnterCriticalSection (&threads_mutex);
+
+ if (threads != NULL)
+ mono_g_hash_table_foreach (threads, gc_stop_world, GUINT_TO_POINTER (self));
- g_ptr_array_free(threads, FALSE);
- threads=NULL;
+ LeaveCriticalSection (&threads_mutex);
}
-gint32 ves_icall_System_Threading_Interlocked_Increment_Int (gint32 *location)
+static void gc_start_world (gpointer key, gpointer value, gpointer user)
{
- return InterlockedIncrement (location);
+ MonoThread *thread=(MonoThread *)value;
+ guint32 self=GPOINTER_TO_UINT (user);
+
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %d - %d", self, thread->tid);
+#endif
+
+ if(thread->tid==self)
+ return;
+
+ ResumeThread (thread->handle);
}
-gint64 ves_icall_System_Threading_Interlocked_Increment_Long (gint64 *location)
+void mono_gc_start_world (void)
{
- gint32 lowret;
- gint32 highret;
-
- EnterCriticalSection(&interlocked_mutex);
+ guint32 self=GetCurrentThreadId ();
- lowret = InterlockedIncrement((gint32 *) location);
- if (0 == lowret)
- highret = InterlockedIncrement((gint32 *) location + 1);
- else
- highret = *((gint32 *) location + 1);
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %d - %p", self, threads);
+#endif
- LeaveCriticalSection(&interlocked_mutex);
+ EnterCriticalSection (&threads_mutex);
- return (gint64) highret << 32 | (gint64) lowret;
+ if (threads != NULL)
+ mono_g_hash_table_foreach (threads, gc_start_world, GUINT_TO_POINTER (self));
+
+ LeaveCriticalSection (&threads_mutex);
}
-gint32 ves_icall_System_Threading_Interlocked_Decrement_Int (gint32 *location)
+
+static guint32 dummy_apc (gpointer param)
{
- return InterlockedDecrement(location);
+ return 0;
}
-gint64 ves_icall_System_Threading_Interlocked_Decrement_Long (gint64 * location)
+/*
+ * mono_thread_execute_interruption
+ *
+ * Performs the operation that the requested thread state requires (abort,
+ * suspend or stop)
+ */
+static MonoException* mono_thread_execute_interruption (MonoThread *thread)
{
- gint32 lowret;
- gint32 highret;
+ mono_monitor_enter (thread->synch_lock);
+
+ if (thread->interruption_requested) {
+ /* this will consume pending APC calls */
+ WaitForSingleObjectEx (GetCurrentThread(), 0, TRUE);
+ EnterCriticalSection (&interruption_mutex);
+ thread_interruption_requested--;
+ LeaveCriticalSection (&interruption_mutex);
+ thread->interruption_requested = FALSE;
+ }
- EnterCriticalSection(&interlocked_mutex);
+ if ((thread->state & ThreadState_AbortRequested) != 0) {
+ if (thread->abort_exc == NULL)
+ thread->abort_exc = mono_get_exception_thread_abort ();
+ mono_monitor_exit (thread->synch_lock);
+ return thread->abort_exc;
+ }
+ else if ((thread->state & ThreadState_SuspendRequested) != 0) {
+ thread->state &= ~ThreadState_SuspendRequested;
+ thread->state |= ThreadState_Suspended;
+ thread->suspend_event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ mono_monitor_exit (thread->synch_lock);
+
+ WaitForSingleObject (thread->suspend_event, INFINITE);
+
+ mono_monitor_enter (thread->synch_lock);
+ CloseHandle (thread->suspend_event);
+ thread->suspend_event = NULL;
+ thread->state &= ~ThreadState_Suspended;
+
+ /* The thread that requested the resume will have replaced this event
+ * and will be waiting for it
+ */
+ SetEvent (thread->resume_event);
+ mono_monitor_exit (thread->synch_lock);
+ return NULL;
+ }
+ else if ((thread->state & ThreadState_StopRequested) != 0) {
+ /* FIXME: do this through the JIT? */
+ mono_monitor_exit (thread->synch_lock);
+ mono_thread_exit ();
+ return NULL;
+ }
+
+ mono_monitor_exit (thread->synch_lock);
+ return NULL;
+}
- lowret = InterlockedDecrement((gint32 *) location);
- if (-1 == lowret)
- highret = InterlockedDecrement((gint32 *) location + 1);
- else
- highret = *((gint32 *) location + 1);
+/*
+ * mono_thread_request_interruption
+ *
+ * A signal handler can call this method to request the interruption of a
+ * thread. The result of the interruption will depend on the current state of
+ * the thread. If the result is an exception that needs to be throw, it is
+ * provided as return value.
+ */
+MonoException* mono_thread_request_interruption (gboolean running_managed)
+{
+ MonoThread *thread = mono_thread_current ();
- LeaveCriticalSection(&interlocked_mutex);
+ /* The thread may already be stopping */
+ if (thread == NULL)
+ return NULL;
+
+ mono_monitor_enter (thread->synch_lock);
+
+ if (thread->interruption_requested) {
+ mono_monitor_exit (thread->synch_lock);
+ return NULL;
+ }
- return (gint64) highret << 32 | (gint64) lowret;
+ if (!running_managed || is_running_protected_wrapper ()) {
+ /* Can't stop while in unmanaged code. Increase the global interruption
+ request count. When exiting the unmanaged method the count will be
+ checked and the thread will be interrupted. */
+
+ EnterCriticalSection (&interruption_mutex);
+ thread_interruption_requested++;
+ LeaveCriticalSection (&interruption_mutex);
+
+ thread->interruption_requested = TRUE;
+ mono_monitor_exit (thread->synch_lock);
+
+ /* this will awake the thread if it is in WaitForSingleObject
+ or similar */
+ QueueUserAPC (dummy_apc, thread->handle, NULL);
+
+ return NULL;
+ }
+ else {
+ mono_monitor_exit (thread->synch_lock);
+ return mono_thread_execute_interruption (thread);
+ }
}
-gint32 ves_icall_System_Threading_Interlocked_Exchange_Int (gint32 *location1, gint32 value)
+gboolean mono_thread_interruption_requested ()
{
- return InterlockedExchange(location1, value);
+ if (thread_interruption_requested) {
+ MonoThread *thread = mono_thread_current ();
+ /* The thread may already be stopping */
+ if (thread != NULL)
+ return (thread->interruption_requested);
+ }
+ return FALSE;
}
-MonoObject * ves_icall_System_Threading_Interlocked_Exchange_Object (MonoObject **location1, MonoObject *value)
+static void mono_thread_interruption_checkpoint_request (gboolean bypass_abort_protection)
{
- return (MonoObject *) InterlockedExchangePointer((gpointer *) location1, value);
+ MonoThread *thread = mono_thread_current ();
+
+ /* The thread may already be stopping */
+ if (thread == NULL)
+ return;
+
+ if (thread->interruption_requested && (bypass_abort_protection || !is_running_protected_wrapper ())) {
+ MonoException* exc = mono_thread_execute_interruption (thread);
+ if (exc) mono_raise_exception (exc);
+ }
}
-gfloat ves_icall_System_Threading_Interlocked_Exchange_Single (gfloat *location1, gfloat value)
+/*
+ * Performs the interruption of the current thread, if one has been requested,
+ * and the thread is not running a protected wrapper.
+ */
+void mono_thread_interruption_checkpoint ()
{
- IntFloatUnion val, ret;
-
- val.fval = value;
- ret.ival = InterlockedExchange((gint32 *) location1, val.ival);
+ mono_thread_interruption_checkpoint_request (FALSE);
+}
- return ret.fval;
+/*
+ * Performs the interruption of the current thread, if one has been requested.
+ */
+void mono_thread_force_interruption_checkpoint ()
+{
+ mono_thread_interruption_checkpoint_request (TRUE);
}
-gint32 ves_icall_System_Threading_Interlocked_CompareExchange_Int(gint32 *location1, gint32 value, gint32 comparand)
+/*
+ * Returns the address of a flag that will be non-zero if an interruption has
+ * been requested for a thread. The thread to interrupt may not be the current
+ * thread, so an additional call to mono_thread_interruption_requested() or
+ * mono_thread_interruption_checkpoint() is allways needed if the flag is not
+ * zero.
+ */
+gint32* mono_thread_interruption_request_flag ()
{
- return InterlockedCompareExchange(location1, value, comparand);
+ return &thread_interruption_requested;
}
-MonoObject * ves_icall_System_Threading_Interlocked_CompareExchange_Object (MonoObject **location1, MonoObject *value, MonoObject *comparand)
+#ifdef WITH_INCLUDED_LIBGC
+
+static void gc_push_all_stacks (gpointer key, gpointer value, gpointer user)
{
- return (MonoObject *) InterlockedCompareExchangePointer((gpointer *) location1, value, comparand);
+ MonoThread *thread=(MonoThread *)value;
+ guint32 *selfp=(guint32 *)user, self = *selfp;
+
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %d - %d - %p", self, thread->tid, thread->stack_ptr);
+#endif
+
+ if(thread->tid==self) {
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %p - %p", selfp, thread->stack_ptr);
+#endif
+ GC_push_all_stack (selfp, thread->stack_ptr);
+ return;
+ }
+
+#ifdef PLATFORM_WIN32
+ GC_win32_push_thread_stack (thread->handle, thread->stack_ptr);
+#else
+ mono_wapi_push_thread_stack (thread->handle, thread->stack_ptr);
+#endif
}
-gfloat ves_icall_System_Threading_Interlocked_CompareExchange_Single (gfloat *location1, gfloat value, gfloat comparand)
+void mono_gc_push_all_stacks (void)
{
- IntFloatUnion val, ret, cmp;
+ guint32 self=GetCurrentThreadId ();
- val.fval = value;
- cmp.fval = comparand;
- ret.ival = InterlockedCompareExchange((gint32 *) location1, val.ival, cmp.ival);
+#ifdef LIBGC_DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": %d - %p", self, threads);
+#endif
- return ret.fval;
+ EnterCriticalSection (&threads_mutex);
+
+ if (threads != NULL)
+ mono_g_hash_table_foreach (threads, gc_push_all_stacks, &self);
+
+ LeaveCriticalSection (&threads_mutex);
}
+
+#endif /* WITH_INCLUDED_LIBGC */
diff --git a/mono/metadata/threads.h b/mono/metadata/threads.h
index d1513c70084..91f8397ce2b 100644
--- a/mono/metadata/threads.h
+++ b/mono/metadata/threads.h
@@ -11,55 +11,60 @@
#ifndef _MONO_METADATA_THREADS_H_
#define _MONO_METADATA_THREADS_H_
-#include <config.h>
-
#include <mono/metadata/object.h>
#include <mono/metadata/appdomain.h>
-extern void mono_thread_init (MonoDomain *domain, MonoThreadStartCB start_cb);
-extern void mono_thread_cleanup(void);
-
-MonoObject *mono_thread_create (MonoDomain *domain, gpointer func);
-
-extern HANDLE ves_icall_System_Threading_Thread_Thread_internal(MonoObject *this, MonoObject *start);
-extern void ves_icall_System_Threading_Thread_Thread_free_internal(MonoObject *this, HANDLE thread);
-extern void ves_icall_System_Threading_Thread_Start_internal(MonoObject *this, HANDLE thread);
-extern void ves_icall_System_Threading_Thread_Sleep_internal(int ms);
-extern MonoObject *ves_icall_System_Threading_Thread_CurrentThread_internal(void);
-extern MonoAppDomain * ves_icall_System_Threading_Thread_CurrentThreadDomain_internal(void);
-extern gboolean ves_icall_System_Threading_Thread_Join_internal(MonoObject *this, int ms, HANDLE thread);
-extern void ves_icall_System_Threading_Thread_SlotHash_store(MonoObject *data);
-extern MonoObject *ves_icall_System_Threading_Thread_SlotHash_lookup(void);
-extern gboolean ves_icall_System_Threading_Monitor_Monitor_try_enter(MonoObject *obj, int ms);
-extern void ves_icall_System_Threading_Monitor_Monitor_exit(MonoObject *obj);
-extern gboolean ves_icall_System_Threading_Monitor_Monitor_test_owner(MonoObject *obj);
-extern gboolean ves_icall_System_Threading_Monitor_Monitor_test_synchronised(MonoObject *obj);
-extern void ves_icall_System_Threading_Monitor_Monitor_pulse(MonoObject *obj);
-extern void ves_icall_System_Threading_Monitor_Monitor_pulse_all(MonoObject *obj);
-extern gboolean ves_icall_System_Threading_Monitor_Monitor_wait(MonoObject *obj, int ms);
-extern HANDLE ves_icall_System_Threading_Mutex_CreateMutex_internal(MonoBoolean owned,char *name);
-extern void ves_icall_System_Threading_Mutex_ReleaseMutex_internal(HANDLE handle);
-extern void ves_icall_System_Threading_Mutex_ReleaseMutex_internal (HANDLE handle );
-extern HANDLE ves_icall_System_Threading_Events_CreateEvent_internal (MonoBoolean manual,MonoBoolean initial,char *name);
-extern gboolean ves_icall_System_Threading_Events_SetEvent_internal (HANDLE handle);
-extern gboolean ves_icall_System_Threading_Events_ResetEvent_internal (HANDLE handle);
-
-extern gboolean ves_icall_System_Threading_WaitHandle_WaitAll_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
-extern gint32 ves_icall_System_Threading_WaitHandle_WaitAny_internal(MonoArray *mono_handles, gint32 ms, gboolean exitContext);
-extern gboolean ves_icall_System_Threading_WaitHandle_WaitOne_internal(MonoObject *this, HANDLE handle, gint32 ms, gboolean exitContext);
-
-extern gint32 ves_icall_System_Threading_Interlocked_Increment_Int(gint32 *location);
-extern gint64 ves_icall_System_Threading_Interlocked_Increment_Long(gint64 *location);
-extern gint32 ves_icall_System_Threading_Interlocked_Decrement_Int(gint32 *location);
-extern gint64 ves_icall_System_Threading_Interlocked_Decrement_Long(gint64 * location);
-
-extern gint32 ves_icall_System_Threading_Interlocked_Exchange_Int(gint32 *location1, gint32 value);
-extern MonoObject *ves_icall_System_Threading_Interlocked_Exchange_Object(MonoObject **location1, MonoObject *value);
-extern gfloat ves_icall_System_Threading_Interlocked_Exchange_Single(gfloat *location1, gfloat value);
-
-extern gint32 ves_icall_System_Threading_Interlocked_CompareExchange_Int(gint32 *location1, gint32 value, gint32 comparand);
-extern MonoObject *ves_icall_System_Threading_Interlocked_CompareExchange_Object(MonoObject **location1, MonoObject *value, MonoObject *comparand);
-extern gfloat ves_icall_System_Threading_Interlocked_CompareExchange_Single(gfloat *location1, gfloat value, gfloat comparand);
+typedef void (*MonoThreadCleanupFunc) (MonoThread* thread);
+
+extern int mono_thread_get_abort_signal (void);
+
+extern void mono_thread_init (MonoThreadStartCB start_cb,
+ MonoThreadAttachCB attach_cb);
+extern void mono_thread_manage(void);
+extern void mono_thread_abort_all_other_threads (void);
+
+extern void mono_thread_push_appdomain_ref (MonoDomain *domain);
+extern void mono_thread_pop_appdomain_ref (void);
+
+extern MonoException * mono_thread_get_pending_exception (void);
+
+extern gboolean mono_threads_abort_appdomain_threads (MonoDomain *domain, int timeout);
+
+extern MonoThread *mono_thread_current (void);
+
+extern void mono_thread_stop (MonoThread *thread);
+
+typedef struct {
+ gpointer (* thread_start_compile_func) (MonoMethod *delegate);
+ void (* thread_created) (guint32 tid, gpointer stack_start, gpointer func);
+ void (* start_resume) (guint32 tid);
+ void (* end_resume) (guint32 tid);
+} MonoThreadCallbacks;
+
+extern void mono_install_thread_callbacks (MonoThreadCallbacks *callbacks);
+
+extern void mono_thread_new_init (guint32 tid, gpointer stack_start,
+ gpointer func);
+extern void mono_thread_create (MonoDomain *domain, gpointer func, gpointer arg);
+extern MonoThread *mono_thread_attach (MonoDomain *domain);
+extern void mono_thread_detach (MonoThread *thread);
+extern void mono_thread_exit (void);
+
+void mono_threads_install_cleanup (MonoThreadCleanupFunc func);
+
+extern void mono_threads_set_default_stacksize (guint32 stacksize);
+extern guint32 mono_threads_get_default_stacksize (void);
+guint32 mono_alloc_special_static_data (guint32 static_type, guint32 size, guint32 align);
+gpointer mono_get_special_static_data (guint32 offset);
+
+void mono_gc_stop_world (void);
+
+void mono_gc_start_world (void);
+extern MonoException* mono_thread_request_interruption (gboolean running_managed);
+extern gboolean mono_thread_interruption_requested (void);
+extern void mono_thread_interruption_checkpoint (void);
+extern void mono_thread_force_interruption_checkpoint (void);
+extern gint32* mono_thread_interruption_request_flag (void);
#endif /* _MONO_METADATA_THREADS_H_ */
diff --git a/mono/metadata/tokentype.h b/mono/metadata/tokentype.h
index b99b173923a..2b8de24457a 100644
--- a/mono/metadata/tokentype.h
+++ b/mono/metadata/tokentype.h
@@ -27,6 +27,7 @@ typedef enum {
MONO_TOKEN_FILE = 0x26000000,
MONO_TOKEN_EXPORTED_TYPE = 0x27000000,
MONO_TOKEN_MANIFEST_RESOURCE = 0x28000000,
+ MONO_TOKEN_METHOD_SPEC = 0x2b000000,
/*
* These do not match metadata tables directly
diff --git a/mono/metadata/unicode.c b/mono/metadata/unicode.c
index 7e43d106c5f..4b55fb58cf7 100644
--- a/mono/metadata/unicode.c
+++ b/mono/metadata/unicode.c
@@ -13,14 +13,9 @@
#include <mono/metadata/object.h>
#include <mono/metadata/unicode.h>
+#include <mono/metadata/exception.h>
-#if HAVE_ICONV_H
-#include <iconv.h>
-#elif HAVE_GICONV_H
-#include <giconv.h>
-#endif
-
-static MonoUnicodeCategory catmap[] = {
+static const MonoUnicodeCategory catmap[] = {
/* G_UNICODE_CONTROL = */ Control,
/* G_UNICODE_FORMAT = */ Format,
/* G_UNICODE_UNASSIGNED = */ OtherNotAssigned,
@@ -53,421 +48,3 @@ static MonoUnicodeCategory catmap[] = {
/* G_UNICODE_SPACE_SEPARATOR = */ SpaceSeperator,
};
-double
-ves_icall_System_Char_GetNumericValue (gunichar2 c)
-{
- return (double)g_unichar_digit_value (c);
-}
-
-MonoUnicodeCategory
-ves_icall_System_Char_GetUnicodeCategory (gunichar2 c)
-{
- return catmap [g_unichar_type (c)];
-}
-
-gboolean
-ves_icall_System_Char_IsControl (gunichar2 c)
-{
- return g_unichar_iscntrl (c);
-}
-
-gboolean
-ves_icall_System_Char_IsDigit (gunichar2 c)
-{
- return g_unichar_isdigit (c);
-}
-
-gboolean
-ves_icall_System_Char_IsLetter (gunichar2 c)
-{
- return g_unichar_isalpha (c);
-}
-
-gboolean
-ves_icall_System_Char_IsLower (gunichar2 c)
-{
- return g_unichar_islower (c);
-}
-
-gboolean
-ves_icall_System_Char_IsUpper (gunichar2 c)
-{
- return g_unichar_isupper (c);
-}
-
-gboolean
-ves_icall_System_Char_IsNumber (gunichar2 c)
-{
- GUnicodeType t = g_unichar_type (c);
- return t == G_UNICODE_DECIMAL_NUMBER ||
- t == G_UNICODE_LETTER_NUMBER ||
- t == G_UNICODE_OTHER_NUMBER;
-}
-
-gboolean
-ves_icall_System_Char_IsPunctuation (gunichar2 c)
-{
- return g_unichar_ispunct (c);
-}
-
-gboolean
-ves_icall_System_Char_IsSeparator (gunichar2 c)
-{
- GUnicodeType t = g_unichar_type (c);
-
- return (t == G_UNICODE_LINE_SEPARATOR ||
- t == G_UNICODE_PARAGRAPH_SEPARATOR ||
- t == G_UNICODE_SPACE_SEPARATOR);
-}
-
-gboolean
-ves_icall_System_Char_IsSurrogate (gunichar2 c)
-{
- return (g_unichar_type (c) == G_UNICODE_SURROGATE);
-}
-
-gboolean
-ves_icall_System_Char_IsSymbol (gunichar2 c)
-{
- GUnicodeType t = g_unichar_type (c);
-
- return (t == G_UNICODE_CURRENCY_SYMBOL ||
- t == G_UNICODE_MODIFIER_SYMBOL ||
- t == G_UNICODE_MATH_SYMBOL ||
- t == G_UNICODE_OTHER_SYMBOL);
-}
-
-gboolean
-ves_icall_System_Char_IsWhiteSpace (gunichar2 c)
-{
- return g_unichar_isspace (c);
-}
-
-gunichar2
-ves_icall_System_Char_ToLower (gunichar2 c)
-{
- return g_unichar_tolower (c);
-}
-
-gunichar2
-ves_icall_System_Char_ToUpper (gunichar2 c)
-{
- return g_unichar_toupper (c);
-}
-
-gpointer
-ves_icall_iconv_new_encoder (MonoString *name, MonoBoolean big_endian)
-{
- iconv_t cd;
- char *n;
-
- /* FIXME: don't enforce big endian, support old iconv */
-
- g_assert (name);
-
- n = mono_string_to_utf8 (name);
-
- /* force big endian before class libraries are fixed */
-#if G_BYTE_ORDER != G_LITTLE_ENDIAN
- big_endian = 1;
-#endif
-
-#ifdef HAVE_NEW_ICONV
- cd = iconv_open (n, big_endian ? "UTF-16be" : "UTF-16le");
-#else
- cd = iconv_open (n, "UTF-16");
-#endif
- g_assert (cd != (iconv_t)-1);
- g_free (n);
-
- return (gpointer)cd;
-}
-
-gpointer
-ves_icall_iconv_new_decoder (MonoString *name, MonoBoolean big_endian)
-{
- iconv_t cd;
- char *n;
-
- /* FIXME: don't enforce big endian, support old iconv */
-
- g_assert (name);
-
- n = mono_string_to_utf8 (name);
-
- /* force big endian before class libraries are fixed */
-#if G_BYTE_ORDER != G_LITTLE_ENDIAN
- big_endian = 1;
-#endif
-
-#ifdef HAVE_NEW_ICONV
- cd = iconv_open (big_endian ? "UTF-16be" : "UTF-16le", n);
-#else
- cd = iconv_open ("UTF-16", n);
-#endif
- g_assert (cd != (iconv_t)-1);
- g_free (n);
-
- return (gpointer)cd;
-}
-
-void
-ves_icall_iconv_reset (gpointer converter)
-{
- iconv_t cd = (iconv_t)converter;
-
- g_assert (cd);
-
- iconv(cd, NULL, NULL, NULL, NULL);
-}
-
-static int
-iconv_get_length (iconv_t cd, guchar *src, int len, gboolean encode)
-{
- guchar buf [512];
- int res;
- guchar *outp;
- guchar *p;
- guint inbytes_remaining;
- guint outbytes_remaining;
- guint outbuf_size;
- gboolean have_error = FALSE;
- size_t err;
-
- g_assert (cd);
- g_assert (src);
-
-#ifndef HAVE_NEW_ICONV
- if (G_BYTE_ORDER == G_LITTLE_ENDIAN && encode) {
- int i;
-
- src = g_memdup (src, len);
- for (i = 0; i < len; i += 2) {
- char t = src [i];
- src [i] = src [i + 1];
- src [i + 1] = t;
- }
- }
-#endif
-
- p = src;
- inbytes_remaining = len;
- res = 0;
-
-again:
- outbuf_size = 512;
- outbytes_remaining = outbuf_size;
- outp = buf;
-
- err = iconv (cd, (char **)&p, &inbytes_remaining,
- (char **)&outp, &outbytes_remaining);
-
- if(err == (size_t)-1) {
- switch(errno) {
- case EINVAL:
- /* Incomplete text, do not report an error */
- break;
- case E2BIG: {
- res += outp - buf;
- goto again;
- }
- case EILSEQ:
- p++;
- inbytes_remaining--;
- goto again;
- default:
- have_error = TRUE;
- break;
- }
- }
-
- res += outp - buf;
-
- if((p - src) != len) {
- if(!have_error) {
- have_error = TRUE;
- }
- }
-
-#ifndef HAVE_NEW_ICONV
- if (G_BYTE_ORDER == G_LITTLE_ENDIAN && encode)
- g_free (src);
-#endif
-
- if (have_error) {
- g_assert_not_reached ();
- return 0;
- } else {
- return res;
- }
-}
-
-int
-ves_icall_iconv_get_byte_count (gpointer converter, MonoArray *chars, gint32 idx, gint32 count)
-{
- iconv_t cd = (iconv_t)converter;
- guchar *src;
- int len;
-
- g_assert (cd);
- g_assert (chars);
- g_assert (mono_array_length (chars) > idx);
- g_assert (mono_array_length (chars) >= (idx + count));
-
- if (!(len = (mono_array_length (chars) - idx) * 2))
- return 0;
-
- src = mono_array_addr (chars, guint16, idx);
-
- return iconv_get_length (cd, src, len, TRUE);
-}
-
-static int
-iconv_convert (iconv_t cd, guchar *src, int len, guchar *dest, int max_len, gboolean encode)
-{
- guchar *p, *outp;
- guint inbytes_remaining;
- guint outbytes_remaining;
- guint outbuf_size;
- gboolean have_error = FALSE;
- size_t err;
-
- g_assert (cd);
- g_assert (src);
- g_assert (dest);
-
-#ifndef HAVE_NEW_ICONV
- if (G_BYTE_ORDER == G_LITTLE_ENDIAN && encode) {
- int i;
-
- src = g_memdup (src, len);
- for (i = 0; i < len; i += 2) {
- char t = src [i];
- src [i] = src [i + 1];
- src [i + 1] = t;
- }
- }
-#endif
-
- p = src;
- inbytes_remaining = len;
- outbuf_size = max_len;
-
- outbytes_remaining = outbuf_size;
- outp = dest;
-
- again:
- err = iconv (cd, (char **)&p, &inbytes_remaining, (char **)&outp, &outbytes_remaining);
-
- if(err == (size_t)-1) {
- if (errno == EINVAL) {
- /* Incomplete text, do not report an error */
- } else if (errno == EILSEQ) {
- p++;
- inbytes_remaining--;
- goto again;
- } else {
- have_error = TRUE;
- }
- }
-
- if ((p - src) != len) {
- if (!have_error) {
- have_error = TRUE;
- }
- }
-
-#ifndef HAVE_NEW_ICONV
- if (G_BYTE_ORDER == G_LITTLE_ENDIAN) {
- if (encode) {
- g_free (src);
- } else {
- int mb = max_len - outbytes_remaining;
- int i;
- for (i = 0; i < mb; i+=2) {
- char t = dest [i];
- dest [i] = dest [i + 1];
- dest [i + 1] = t;
- }
- }
-}
-#endif
- if (have_error) {
- g_assert_not_reached ();
- return 0;
- } else {
- /* we return the number of bytes written in dest */
- return max_len - outbytes_remaining;
- }
-}
-
-int
-ves_icall_iconv_get_bytes (gpointer converter, MonoArray *chars, gint32 charIndex, gint32 charCount,
- MonoArray *bytes, gint32 byteIndex)
-{
- iconv_t cd = (iconv_t)converter;
- guchar *src, *dest;
- int len, max_len;
-
- if (!charCount)
- return 0;
-
- g_assert (cd);
- g_assert (chars);
- g_assert (bytes);
- g_assert (mono_array_length (chars) > charIndex);
- g_assert (mono_array_length (chars) >= (charIndex + charCount));
- g_assert (mono_array_length (bytes) > byteIndex);
- g_assert (mono_array_length (chars) >= (byteIndex + charCount));
-
- if (!(len = (charCount - charIndex) * 2))
- return 0;
-
- src = mono_array_addr (chars, guint16, charIndex);
- dest = mono_array_addr (bytes, char, byteIndex);
-
- max_len = mono_array_length (bytes) - byteIndex;
-
- return iconv_convert (cd, src, len, dest, max_len, TRUE);
-}
-
-int
-ves_icall_iconv_get_char_count (gpointer converter, MonoArray *bytes, gint32 idx, gint32 count)
-{
- iconv_t cd = (iconv_t)converter;
- guchar *src;
-
- g_assert (cd);
- g_assert (bytes);
- g_assert (mono_array_length (bytes) > idx);
- g_assert (mono_array_length (bytes) >= (idx + count));
-
- src = mono_array_addr (bytes, char, idx);
-
- /* iconv_get_length () returns the number of bytes */
- return iconv_get_length (cd, src, (int) count, FALSE) / 2;
-}
-
-int
-ves_icall_iconv_get_chars (gpointer converter, MonoArray *bytes, gint32 byteIndex, gint32 byteCount,
- MonoArray *chars, gint32 charIndex)
-{
- iconv_t cd = (iconv_t)converter;
- guchar *src, *dest;
- int max_len;
-
- g_assert (cd);
- g_assert (chars);
- g_assert (bytes);
- g_assert (mono_array_length (bytes) > byteIndex);
- g_assert (mono_array_length (chars) >= (byteIndex + byteCount));
- g_assert (mono_array_length (chars) > charIndex);
-
- src = mono_array_addr (bytes, char, byteIndex);
- dest = mono_array_addr (chars, guint16, charIndex);
-
- max_len = (mono_array_length (chars) - charIndex) * 2;
-
- /* iconv_convert () returns the number of bytes */
- return iconv_convert (cd, src, (int) byteCount, dest, max_len, FALSE) / 2;
-}
diff --git a/mono/metadata/unicode.h b/mono/metadata/unicode.h
index f954e02da7c..7aa526e39f4 100644
--- a/mono/metadata/unicode.h
+++ b/mono/metadata/unicode.h
@@ -45,79 +45,7 @@ typedef enum {
CurrencySymbol = 26,
ModifierSymbol = 27,
OtherSymbol = 28,
- OtherNotAssigned = 29,
+ OtherNotAssigned = 29
} MonoUnicodeCategory;
-double
-ves_icall_System_Char_GetNumericValue (gunichar2 c);
-
-MonoUnicodeCategory
-ves_icall_System_Char_GetUnicodeCategory (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsControl (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsDigit (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsLetter (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsLower (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsUpper (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsNumber (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsPunctuation (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsSeparator (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsSurrogate (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsSymbol (gunichar2 c);
-
-gboolean
-ves_icall_System_Char_IsWhiteSpace (gunichar2 c);
-
-gunichar2
-ves_icall_System_Char_ToLower (gunichar2 c);
-
-gunichar2
-ves_icall_System_Char_ToUpper (gunichar2 c);
-
-gpointer
-ves_icall_iconv_new_encoder (MonoString *name, MonoBoolean big_endian);
-
-gpointer
-ves_icall_iconv_new_decoder (MonoString *name, MonoBoolean big_endian);
-
-void
-ves_icall_iconv_reset (gpointer converter);
-
-int
-ves_icall_iconv_get_byte_count (gpointer converter, MonoArray *chars,
- gint32 idx, gint32 count);
-
-int
-ves_icall_iconv_get_bytes (gpointer converter, MonoArray *chars,
- gint32 charIndex, gint32 charCount,
- MonoArray *bytes, gint32 byteIndex);
-
-int
-ves_icall_iconv_get_char_count (gpointer converter, MonoArray *bytes,
- gint32 idx, gint32 count);
-
-int
-ves_icall_iconv_get_chars (gpointer converter, MonoArray *bytes,
- gint32 byteIndex, gint32 byteCount,
- MonoArray *chars, gint32 charIndex);
-
#endif
diff --git a/mono/metadata/verify.c b/mono/metadata/verify.c
index 0e8967c9288..05fcfbeadd6 100644
--- a/mono/metadata/verify.c
+++ b/mono/metadata/verify.c
@@ -1,10 +1,15 @@
-#include <mono/metadata/object.h>
+#include <mono/metadata/object-internals.h>
#include <mono/metadata/verify.h>
#include <mono/metadata/opcodes.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/reflection.h>
+#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/mono-endian.h>
+#include <mono/metadata/metadata.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/tokentype.h>
#include <string.h>
#include <signal.h>
#include <ctype.h>
@@ -317,7 +322,7 @@ verify_constant_table (MonoImage *image, GSList *list, int level)
MonoTableInfo *t = &image->tables [MONO_TABLE_CONSTANT];
guint32 cols [MONO_CONSTANT_SIZE];
guint32 value, i;
- GHashTable *dups = g_hash_table_new (g_direct_hash, g_direct_equal);
+ GHashTable *dups = g_hash_table_new (NULL, NULL);
for (i = 0; i < t->rows; ++i) {
mono_metadata_decode_row (t, i, cols, MONO_CONSTANT_SIZE);
@@ -351,17 +356,17 @@ verify_constant_table (MonoImage *image, GSList *list, int level)
ADD_ERROR (list, g_strdup_printf ("Type 0x%x is invalid in Constant row %d", cols [MONO_CONSTANT_TYPE], i + 1));
}
if (level & MONO_VERIFY_ERROR) {
- value = cols [MONO_CONSTANT_PARENT] >> HASCONSTANT_BITS;
- switch (cols [MONO_CONSTANT_PARENT] & HASCONSTANT_MASK) {
- case HASCONSTANT_FIEDDEF:
+ value = cols [MONO_CONSTANT_PARENT] >> MONO_HASCONSTANT_BITS;
+ switch (cols [MONO_CONSTANT_PARENT] & MONO_HASCONSTANT_MASK) {
+ case MONO_HASCONSTANT_FIEDDEF:
if (value > image->tables [MONO_TABLE_FIELD].rows)
ADD_ERROR (list, g_strdup_printf ("Parent (field) is invalid in Constant row %d", i + 1));
break;
- case HASCONSTANT_PARAM:
+ case MONO_HASCONSTANT_PARAM:
if (value > image->tables [MONO_TABLE_PARAM].rows)
ADD_ERROR (list, g_strdup_printf ("Parent (param) is invalid in Constant row %d", i + 1));
break;
- case HASCONSTANT_PROPERTY:
+ case MONO_HASCONSTANT_PROPERTY:
if (value > image->tables [MONO_TABLE_PROPERTY].rows)
ADD_ERROR (list, g_strdup_printf ("Parent (property) is invalid in Constant row %d", i + 1));
break;
@@ -387,7 +392,7 @@ verify_event_map_table (MonoImage *image, GSList *list, int level)
MonoTableInfo *t = &image->tables [MONO_TABLE_EVENTMAP];
guint32 cols [MONO_EVENT_MAP_SIZE];
guint32 i, last_event;
- GHashTable *dups = g_hash_table_new (g_direct_hash, g_direct_equal);
+ GHashTable *dups = g_hash_table_new (NULL, NULL);
last_event = 0;
@@ -440,17 +445,17 @@ verify_event_table (MonoImage *image, GSList *list, int level)
}
if (level & MONO_VERIFY_ERROR && cols [MONO_EVENT_TYPE]) {
- value = cols [MONO_EVENT_TYPE] >> TYPEDEFORREF_BITS;
- switch (cols [MONO_EVENT_TYPE] & TYPEDEFORREF_MASK) {
- case TYPEDEFORREF_TYPEDEF:
+ value = cols [MONO_EVENT_TYPE] >> MONO_TYPEDEFORREF_BITS;
+ switch (cols [MONO_EVENT_TYPE] & MONO_TYPEDEFORREF_MASK) {
+ case MONO_TYPEDEFORREF_TYPEDEF:
if (!value || value > image->tables [MONO_TABLE_TYPEDEF].rows)
ADD_ERROR (list, g_strdup_printf ("Type invalid in Event row %d", i + 1));
break;
- case TYPEDEFORREF_TYPEREF:
+ case MONO_TYPEDEFORREF_TYPEREF:
if (!value || value > image->tables [MONO_TABLE_TYPEREF].rows)
ADD_ERROR (list, g_strdup_printf ("Type invalid in Event row %d", i + 1));
break;
- case TYPEDEFORREF_TYPESPEC:
+ case MONO_TYPEDEFORREF_TYPESPEC:
if (!value || value > image->tables [MONO_TABLE_TYPESPEC].rows)
ADD_ERROR (list, g_strdup_printf ("Type invalid in Event row %d", i + 1));
break;
@@ -670,63 +675,92 @@ mono_image_verify_tables (MonoImage *image, int level)
}
enum {
- TYPE_INVALID = 0, /* leave at 0. */
- TYPE_INT32 = 1,
- TYPE_INT64 = 2,
- TYPE_NINT = 3,
- TYPE_FLOAT = 4,
- TYPE_MANP = 5,
- TYPE_OBJREF = 6,
- TYPE_MAX = 7
+ TYPE_INV = 0, /* leave at 0. */
+ TYPE_I4 = 1,
+ TYPE_I8 = 2,
+ TYPE_PTR = 3,
+ TYPE_R8 = 4,
+ TYPE_MP = 5,
+ TYPE_OBJ = 6,
+ TYPE_VT = 7,
+ TYPE_MAX = 8
};
-const static unsigned char
-valid_binops [TYPE_MAX] [TYPE_MAX] = {
- {TYPE_INVALID},
- {TYPE_INVALID, TYPE_INT32, TYPE_INVALID, TYPE_NINT, TYPE_INVALID, TYPE_MANP},
- {TYPE_INVALID, TYPE_INVALID, TYPE_INT64, TYPE_INVALID},
- {TYPE_INVALID, TYPE_NINT, TYPE_INVALID, TYPE_NINT, TYPE_INVALID, TYPE_MANP},
- {TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_FLOAT},
- {TYPE_INVALID, TYPE_MANP, TYPE_INVALID, TYPE_MANP, TYPE_INVALID, TYPE_NINT},
- {TYPE_INVALID}
- /* int32 */ /* int64 */ /* native */ /* float */ /* managed p */ /* objref */
+static const char*
+arg_name [TYPE_MAX] = {
+ "Invalid",
+ "Int32",
+ "Int64",
+ "IntPtr",
+ "Double",
+ "Managed Pointer",
+ "ObjRef",
+ "ValueType"
};
-const static unsigned char
-valid_unnops [TYPE_MAX] = {
- TYPE_INVALID, TYPE_INT32, TYPE_INT64, TYPE_NINT, TYPE_FLOAT, TYPE_INVALID
- /* int32 */ /* int64 */ /* native */ /* float */ /* managed p */ /* objref */
+static const char
+bin_num_table [TYPE_MAX] [TYPE_MAX] = {
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_I4, TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_MP, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_I8, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_MP, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_R8, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_MP, TYPE_INV, TYPE_MP, TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV}
};
-/* note: the resulting type is always a boolean */
-const static unsigned char
-valid_bincomp [TYPE_MAX] [TYPE_MAX] = {
- {TYPE_INVALID},
- {TYPE_INVALID, TYPE_INT32, TYPE_INVALID, TYPE_INT32, TYPE_INVALID},
- {TYPE_INVALID, TYPE_INVALID, TYPE_INT32, TYPE_INVALID},
- {TYPE_INVALID, TYPE_INT32, TYPE_INVALID, TYPE_INT32, TYPE_INVALID, TYPE_INT32},
- {TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INT32},
- {TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INT32, TYPE_INVALID, TYPE_INT32},
- {TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INVALID, TYPE_INT32}
- /* int32 */ /* int64 */ /* native */ /* float */ /* managed p */ /* objref */
+static const char
+neg_table [] = {
+ TYPE_INV, TYPE_I4, TYPE_I8, TYPE_PTR, TYPE_R8, TYPE_INV, TYPE_INV, TYPE_INV
};
-const static unsigned char
-valid_intops [TYPE_MAX] [TYPE_MAX] = {
- {TYPE_INVALID},
- {TYPE_INVALID, TYPE_INT32, TYPE_INVALID, TYPE_NINT},
- {TYPE_INVALID, TYPE_INVALID, TYPE_INT64},
- {TYPE_INVALID, TYPE_NINT, TYPE_INVALID, TYPE_NINT},
- {TYPE_INVALID}
+/* reduce the size of this table */
+static const char
+bin_int_table [TYPE_MAX] [TYPE_MAX] = {
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_I4, TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_I8, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV}
};
-const static unsigned char
-valid_shiftops [TYPE_MAX] [TYPE_MAX] = {
- {TYPE_INVALID},
- {TYPE_INVALID, TYPE_INT32, TYPE_INVALID, TYPE_INT32},
- {TYPE_INVALID, TYPE_INT64, TYPE_INVALID, TYPE_INT64},
- {TYPE_INVALID, TYPE_NINT, TYPE_INVALID, TYPE_NINT},
- {TYPE_INVALID}
+static const char
+bin_comp_table [TYPE_MAX] [TYPE_MAX] = {
+ {0},
+ {0, 1, 0, 1, 0, 0, 0, 0},
+ {0, 0, 1, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 2, 0, 0},
+ {0, 0, 0, 0, 1, 0, 0, 0},
+ {0, 0, 0, 2, 0, 1, 0, 0},
+ {0, 0, 0, 0, 0, 0, 3, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0},
+};
+
+/* reduce the size of this table */
+static const char
+shift_table [TYPE_MAX] [TYPE_MAX] = {
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_I4, TYPE_INV, TYPE_I4, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_I8, TYPE_INV, TYPE_I8, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_PTR, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV},
+ {TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV, TYPE_INV}
+};
+
+static const char
+ldind_type [] = {
+ TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I8, TYPE_PTR, TYPE_R8, TYPE_R8, TYPE_OBJ
+};
+
+static const char
+ldelem_type [] = {
+ TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I4, TYPE_I8, TYPE_PTR, TYPE_R8, TYPE_R8, TYPE_OBJ
};
#define ADD_INVALID(list,msg) \
@@ -735,14 +769,14 @@ valid_shiftops [TYPE_MAX] [TYPE_MAX] = {
vinfo->status = MONO_VERIFY_ERROR; \
vinfo->message = (msg); \
(list) = g_slist_prepend ((list), vinfo); \
- G_BREAKPOINT (); \
+ /*G_BREAKPOINT ();*/ \
goto invalid_cil; \
} while (0)
#define CHECK_STACK_UNDERFLOW(num) \
do { \
if (cur_stack < (num)) \
- ADD_INVALID (list, g_strdup_printf ("Stack underflow at 0x%04x", ip_offset)); \
+ ADD_INVALID (list, g_strdup_printf ("Stack underflow at 0x%04x (%d items instead of %d)", ip_offset, cur_stack, (num))); \
} while (0)
#define CHECK_STACK_OVERFLOW() \
@@ -764,8 +798,8 @@ enum {
};
typedef struct {
- MonoClass *klass;
- int type;
+ MonoType *type;
+ int stype;
} ILStackDesc;
typedef struct {
@@ -774,6 +808,166 @@ typedef struct {
guint16 flags;
} ILCodeDesc;
+static void
+type_to_eval_stack_type (MonoType *type, ILStackDesc *stack, int take_addr) {
+ int t = type->type;
+
+ stack->type = type;
+ if (type->byref || take_addr) { /* fix double addr issue */
+ stack->stype = TYPE_MP;
+ return;
+ }
+
+handle_enum:
+ switch (t) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ stack->stype = TYPE_I4;
+ return;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ stack->stype = TYPE_PTR;
+ return;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ stack->stype = TYPE_OBJ;
+ return;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ stack->stype = TYPE_I8;
+ return;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ stack->stype = TYPE_R8;
+ return;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ t = type->data.klass->enum_basetype->type;
+ goto handle_enum;
+ } else {
+ stack->stype = TYPE_VT;
+ return;
+ }
+ default:
+ g_error ("unknown type %02x in eval stack type", type->type);
+ }
+ return;
+}
+
+static int
+type_from_op (int ins, ILStackDesc *arg) {
+ switch (ins) {
+ /* binops */
+ case CEE_ADD:
+ case CEE_SUB:
+ case CEE_MUL:
+ case CEE_DIV:
+ case CEE_REM:
+ /* FIXME: check unverifiable args for TYPE_MP */
+ return arg->stype = bin_num_table [arg->stype] [arg [1].stype];
+ case CEE_DIV_UN:
+ case CEE_REM_UN:
+ case CEE_AND:
+ case CEE_OR:
+ case CEE_XOR:
+ return arg->stype = bin_int_table [arg->stype] [arg [1].stype];
+ case CEE_SHL:
+ case CEE_SHR:
+ case CEE_SHR_UN:
+ return arg->stype = shift_table [arg->stype] [arg [1].stype];
+ case CEE_BEQ_S:
+ case CEE_BGE_S:
+ case CEE_BGT_S:
+ case CEE_BLE_S:
+ case CEE_BLT_S:
+ case CEE_BNE_UN_S:
+ case CEE_BGE_UN_S:
+ case CEE_BGT_UN_S:
+ case CEE_BLE_UN_S:
+ case CEE_BLT_UN_S:
+ case CEE_BEQ:
+ case CEE_BGE:
+ case CEE_BGT:
+ case CEE_BLE:
+ case CEE_BLT:
+ case CEE_BNE_UN:
+ case CEE_BGE_UN:
+ case CEE_BGT_UN:
+ case CEE_BLE_UN:
+ case CEE_BLT_UN:
+ /* FIXME: handle some specifics with ins->next->type */
+ return bin_comp_table [arg->stype] [arg [1].stype] ? TYPE_I4: TYPE_INV;
+ case 256+CEE_CEQ:
+ case 256+CEE_CGT:
+ case 256+CEE_CGT_UN:
+ case 256+CEE_CLT:
+ case 256+CEE_CLT_UN:
+ return arg->stype = bin_comp_table [arg->stype] [arg [1].stype] ? TYPE_I4: TYPE_INV;
+ /* unops */
+ case CEE_NEG:
+ return arg->stype = neg_table [arg->stype];
+ case CEE_NOT:
+ if (arg->stype >= TYPE_I4 && arg->stype <= TYPE_PTR)
+ return arg->stype;
+ else
+ return arg->stype = TYPE_INV;
+ case CEE_CONV_I1:
+ case CEE_CONV_U1:
+ case CEE_CONV_I2:
+ case CEE_CONV_U2:
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case CEE_CONV_OVF_I1:
+ case CEE_CONV_OVF_U1:
+ case CEE_CONV_OVF_I2:
+ case CEE_CONV_OVF_U2:
+ case CEE_CONV_OVF_I4:
+ case CEE_CONV_OVF_U4:
+ case CEE_CONV_OVF_I1_UN:
+ case CEE_CONV_OVF_U1_UN:
+ case CEE_CONV_OVF_I2_UN:
+ case CEE_CONV_OVF_U2_UN:
+ case CEE_CONV_OVF_I4_UN:
+ case CEE_CONV_OVF_U4_UN:
+ if (arg->stype == TYPE_INV || arg->stype >= TYPE_MP)
+ return arg->stype = TYPE_INV;
+ return arg->stype = TYPE_I4;
+ case CEE_CONV_I:
+ case CEE_CONV_U:
+ case CEE_CONV_OVF_I:
+ case CEE_CONV_OVF_U:
+ case CEE_CONV_OVF_I_UN:
+ case CEE_CONV_OVF_U_UN:
+ if (arg->stype == TYPE_INV || arg->stype == TYPE_VT)
+ return arg->stype = TYPE_INV;
+ return arg->stype = TYPE_PTR;
+ case CEE_CONV_I8:
+ case CEE_CONV_U8:
+ case CEE_CONV_OVF_I8:
+ case CEE_CONV_OVF_U8:
+ case CEE_CONV_OVF_I8_UN:
+ case CEE_CONV_OVF_U8_UN:
+ return arg->stype = TYPE_I8;
+ case CEE_CONV_R4:
+ case CEE_CONV_R8:
+ return arg->stype = TYPE_R8;
+ default:
+ g_error ("opcode 0x%04x not handled in type from op", ins);
+ break;
+ }
+ return FALSE;
+}
+
static int
in_any_block (MonoMethodHeader *header, guint offset)
{
@@ -841,6 +1035,97 @@ can_merge_stack (ILCodeDesc *a, ILCodeDesc *b)
return 1;
}
+static int
+is_valid_bool_arg (ILStackDesc *arg)
+{
+ switch (arg->stype) {
+ case TYPE_I4:
+ case TYPE_I8:
+ case TYPE_PTR:
+ case TYPE_MP:
+ case TYPE_OBJ:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static int
+can_store_type (ILStackDesc *arg, MonoType *type)
+{
+ int t = type->type;
+ if (type->byref && arg->stype != TYPE_MP)
+ return FALSE;
+handle_enum:
+ switch (t) {
+ case MONO_TYPE_VOID:
+ return FALSE;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ if (arg->stype == TYPE_I4 || arg->stype == TYPE_PTR)
+ return TRUE;
+ return FALSE;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ return TRUE;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return TRUE; /* FIXME */
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ if (arg->stype == TYPE_I8)
+ return TRUE;
+ return FALSE;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ if (arg->stype == TYPE_R8)
+ return TRUE;
+ return FALSE;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ t = type->data.klass->enum_basetype->type;
+ goto handle_enum;
+ } else {
+ if (arg->type->data.klass != type->data.klass)
+ return FALSE;
+ return TRUE;
+ }
+ default:
+ g_error ("unknown type %02x in store type", type->type);
+ }
+ return FALSE;
+}
+
+static int
+stind_type (int op, int type) {
+ switch (op) {
+ case CEE_STIND_REF:
+ return type == TYPE_OBJ;
+ case CEE_STIND_I1:
+ case CEE_STIND_I2:
+ case CEE_STIND_I4:
+ return type == TYPE_I4;
+ case CEE_STIND_I8:
+ return type == TYPE_I8;
+ case CEE_STIND_R4:
+ case CEE_STIND_R8:
+ return type == TYPE_R8;
+ default:
+ g_assert_not_reached ();
+ }
+ return FALSE;
+}
+
/*
* FIXME: need to distinguish between valid and verifiable.
* Need to keep track of types on the stack.
@@ -851,42 +1136,70 @@ mono_method_verify (MonoMethod *method, int level)
{
MonoMethodHeader *header;
MonoMethodSignature *signature, *csig;
+ MonoGenericContext *generic_context = NULL;
MonoMethod *cmethod;
+ MonoClassField *field;
+ MonoClass *klass;
MonoImage *image;
+ MonoType **params;
+ ILStackDesc *stack;
register const unsigned char *ip;
register const unsigned char *end;
- const unsigned char *target; /* branch target */
+ const unsigned char *target = NULL; /* branch target */
int max_args, max_stack, cur_stack, i, n, need_merge, start;
- guint32 token, ip_offset;
+ guint32 token, ip_offset = 0;
char *local_state = NULL;
GSList *list = NULL;
guint prefix = 0;
ILCodeDesc *code;
+ if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->flags & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT))) {
+ return NULL;
+ }
signature = method->signature;
- header = ((MonoMethodNormal *)method)->header;
+ header = mono_method_get_header (method);
ip = header->code;
end = ip + header->code_size;
- max_args = method->signature->param_count + method->signature->hasthis;
+ max_args = signature->param_count + signature->hasthis;
max_stack = header->max_stack;
need_merge = cur_stack = 0;
start = 1;
image = method->klass->image;
code = g_new0 (ILCodeDesc, header->code_size);
+ stack = g_new0 (ILStackDesc, max_stack);
+ if (signature->hasthis) {
+ params = g_new0 (MonoType*, max_args);
+ params [0] = &method->klass->this_arg;
+ memcpy (params + 1, signature->params, sizeof (MonoType*) * signature->param_count);
+ } else {
+ params = signature->params;
+ }
+
+ if (method->signature->is_inflated)
+ generic_context = ((MonoMethodInflated *) method)->context;
if (header->num_locals) {
local_state = g_new (char, header->num_locals);
memset (local_state, header->init_locals, header->num_locals);
}
- g_print ("Method %s.%s::%s\n", method->klass->name_space, method->klass->name, method->name);
+ /*g_print ("Method %s.%s::%s\n", method->klass->name_space, method->klass->name, method->name);*/
+
+ for (i = 0; i < header->num_clauses; ++i) {
+ MonoExceptionClause *clause = &header->clauses [i];
+ /* catch blocks have the exception on the stack. */
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE) {
+ code [clause->handler_offset].stack_count = 1;
+ code [clause->handler_offset].flags |= CODE_SEEN;
+ }
+ }
while (ip < end) {
ip_offset = ip - header->code;
- g_print ("IL_%04x: %02x %s\n", ip_offset, *ip, mono_opcode_names [*ip]);
if (start || !(code [ip_offset].flags & CODE_SEEN)) {
if (start) {
- code [ip_offset].stack_count = 0;
- start = 0;
+ /* g_print ("setting stack of IL_%04x to %d\n", ip_offset, 0); */
+ cur_stack = code [ip_offset].stack_count;
} else {
code [ip_offset].stack_count = cur_stack;
}
@@ -896,11 +1209,21 @@ mono_method_verify (MonoMethod *method, int level)
if (code [ip_offset].stack_count != cur_stack)
ADD_INVALID (list, g_strdup_printf ("Cannot merge stack states at 0x%04x", ip_offset));
}
+ start = 0;
if (need_merge) {
if (!can_merge_stack (&code [ip_offset], &code [target - header->code]))
ADD_INVALID (list, g_strdup_printf ("Cannot merge stack states at 0x%04x", ip_offset));
need_merge = 0;
}
+#if 0
+ {
+ char *discode;
+ discode = mono_disasm_code_one (NULL, method, ip, NULL);
+ discode [strlen (discode) - 1] = 0; /* no \n */
+ g_print ("%-29s (%d)\n", discode, cur_stack);
+ g_free (discode);
+ }
+#endif
switch (*ip) {
case CEE_NOP:
@@ -914,6 +1237,7 @@ mono_method_verify (MonoMethod *method, int level)
if (*ip - CEE_LDARG_0 >= max_args)
ADD_INVALID (list, g_strdup_printf ("Method doesn't have argument %d at 0x%04x", *ip - CEE_LDARG_0, ip_offset));
CHECK_STACK_OVERFLOW ();
+ type_to_eval_stack_type (params [*ip - CEE_LDARG_0], stack + cur_stack, FALSE);
++cur_stack;
++ip;
break;
@@ -923,9 +1247,10 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_LDLOC_3:
if (*ip - CEE_LDLOC_0 >= header->num_locals)
ADD_INVALID (list, g_strdup_printf ("Method doesn't have local var %d at 0x%04x", *ip - CEE_LDLOC_0, ip_offset));
- if (!local_state [*ip - CEE_LDLOC_0])
+ if (0 && !local_state [*ip - CEE_LDLOC_0])
ADD_INVALID (list, g_strdup_printf ("Local var %d is initialized at 0x%04x", *ip - CEE_LDLOC_0, ip_offset));
CHECK_STACK_OVERFLOW ();
+ type_to_eval_stack_type (header->locals [*ip - CEE_LDLOC_0], stack + cur_stack, FALSE);
++cur_stack;
++ip;
break;
@@ -938,6 +1263,8 @@ mono_method_verify (MonoMethod *method, int level)
local_state [*ip - CEE_STLOC_0] = 1;
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
+ if (!can_store_type (stack + cur_stack, header->locals [*ip - CEE_STLOC_0]))
+ ADD_INVALID (list, g_strdup_printf ("Incompatible type %s in store at 0x%04x", arg_name [stack [cur_stack].stype], ip_offset));
++ip;
break;
case CEE_LDARG_S:
@@ -945,6 +1272,7 @@ mono_method_verify (MonoMethod *method, int level)
if (ip [1] >= max_args)
ADD_INVALID (list, g_strdup_printf ("Method doesn't have argument %d at 0x%04x", ip [1], ip_offset));
CHECK_STACK_OVERFLOW ();
+ type_to_eval_stack_type (params [ip [1]], stack + cur_stack, *ip == CEE_LDARGA_S);
++cur_stack;
ip += 2;
break;
@@ -960,9 +1288,10 @@ mono_method_verify (MonoMethod *method, int level)
if (ip [1] >= header->num_locals)
ADD_INVALID (list, g_strdup_printf ("Method doesn't have local var %d at 0x%04x", ip [1], ip_offset));
/* no need to check if the var is initialized if the address is taken */
- if (*ip == CEE_LDLOC_S && !local_state [ip [1]])
+ if (0 && *ip == CEE_LDLOC_S && !local_state [ip [1]])
ADD_INVALID (list, g_strdup_printf ("Local var %d is initialized at 0x%04x", ip [1], ip_offset));
CHECK_STACK_OVERFLOW ();
+ type_to_eval_stack_type (header->locals [ip [1]], stack + cur_stack, *ip == CEE_LDLOCA_S);
++cur_stack;
ip += 2;
break;
@@ -972,10 +1301,14 @@ mono_method_verify (MonoMethod *method, int level)
local_state [ip [1]] = 1;
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
+ if (!can_store_type (stack + cur_stack, header->locals [ip [1]]))
+ ADD_INVALID (list, g_strdup_printf ("Incompatible type %s in store at 0x%04x", arg_name [stack [cur_stack].stype], ip_offset));
ip += 2;
break;
case CEE_LDNULL:
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.object_class->byval_arg;
+ stack [cur_stack].stype = TYPE_OBJ;
++cur_stack;
++ip;
break;
@@ -990,31 +1323,43 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_LDC_I4_7:
case CEE_LDC_I4_8:
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.int_class->byval_arg;
+ stack [cur_stack].stype = TYPE_I4;
++cur_stack;
++ip;
break;
case CEE_LDC_I4_S:
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.int_class->byval_arg;
+ stack [cur_stack].stype = TYPE_I4;
++cur_stack;
ip += 2;
break;
case CEE_LDC_I4:
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.int_class->byval_arg;
+ stack [cur_stack].stype = TYPE_I4;
++cur_stack;
ip += 5;
break;
case CEE_LDC_I8:
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.int64_class->byval_arg;
+ stack [cur_stack].stype = TYPE_I8;
++cur_stack;
ip += 9;
break;
case CEE_LDC_R4:
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.double_class->byval_arg;
+ stack [cur_stack].stype = TYPE_R8;
++cur_stack;
ip += 5;
break;
case CEE_LDC_R8:
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.double_class->byval_arg;
+ stack [cur_stack].stype = TYPE_R8;
++cur_stack;
ip += 9;
break;
@@ -1022,6 +1367,7 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_DUP:
CHECK_STACK_UNDERFLOW (1);
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack] = stack [cur_stack - 1];
++cur_stack;
++ip;
break;
@@ -1047,14 +1393,20 @@ mono_method_verify (MonoMethod *method, int level)
/*
* FIXME: we could just load the signature ...
*/
- cmethod = mono_get_method (image, token, NULL);
+ cmethod = mono_get_method_full (image, token, NULL, generic_context);
if (!cmethod)
ADD_INVALID (list, g_strdup_printf ("Method 0x%08x not found at 0x%04x", token, ip_offset));
- csig = cmethod->signature;
+ if (cmethod->signature->pinvoke) {
+ csig = cmethod->signature;
+ } else {
+ csig = mono_method_get_signature (cmethod, image, token);
+ }
+
CHECK_STACK_UNDERFLOW (csig->param_count + csig->hasthis);
cur_stack -= csig->param_count + csig->hasthis;
if (csig->ret->type != MONO_TYPE_VOID) {
CHECK_STACK_OVERFLOW ();
+ type_to_eval_stack_type (csig->ret, stack + cur_stack, FALSE);
++cur_stack;
}
ip += 5;
@@ -1068,17 +1420,18 @@ mono_method_verify (MonoMethod *method, int level)
break;
case CEE_RET:
if (signature->ret->type != MONO_TYPE_VOID) {
- if (cur_stack != 1)
- ADD_INVALID (list, g_strdup_printf ("Stack not empty after ret at 0x%04x", ip_offset));
+ CHECK_STACK_UNDERFLOW (1);
--cur_stack;
- } else {
- if (cur_stack)
- ADD_INVALID (list, g_strdup_printf ("Stack not empty after ret at 0x%04x", ip_offset));
- cur_stack = 0;
+ if (!can_store_type (stack + cur_stack, signature->ret))
+ ADD_INVALID (list, g_strdup_printf ("Incompatible type %s in ret at 0x%04x", arg_name [stack [cur_stack].stype], ip_offset));
}
+ if (cur_stack)
+ ADD_INVALID (list, g_strdup_printf ("Stack not empty (%d) after ret at 0x%04x", cur_stack, ip_offset));
+ cur_stack = 0;
if (in_any_block (header, ip_offset))
ADD_INVALID (list, g_strdup_printf ("ret cannot escape exception blocks at 0x%04x", ip_offset));
++ip;
+ start = 1;
break;
case CEE_BR_S:
target = ip + (signed char)ip [1] + 2;
@@ -1098,6 +1451,8 @@ mono_method_verify (MonoMethod *method, int level)
ADD_INVALID (list, g_strdup_printf ("Branch target escapes out of exception block at 0x%04x", ip_offset));
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
+ if (!is_valid_bool_arg (stack + cur_stack))
+ ADD_INVALID (list, g_strdup_printf ("Argument type %s not valid for brtrue/brfalse at 0x%04x", arg_name [stack [cur_stack].stype], ip_offset));
ip += 2;
need_merge = 1;
break;
@@ -1118,6 +1473,8 @@ mono_method_verify (MonoMethod *method, int level)
ADD_INVALID (list, g_strdup_printf ("Branch target escapes out of exception block at 0x%04x", ip_offset));
CHECK_STACK_UNDERFLOW (2);
cur_stack -= 2;
+ if (type_from_op (*ip, stack + cur_stack) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0x%02x at 0x%04x", *ip, ip_offset));
ip += 2;
need_merge = 1;
break;
@@ -1139,6 +1496,8 @@ mono_method_verify (MonoMethod *method, int level)
ADD_INVALID (list, g_strdup_printf ("Branch target escapes out of exception block at 0x%04x", ip_offset));
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
+ if (!is_valid_bool_arg (stack + cur_stack))
+ ADD_INVALID (list, g_strdup_printf ("Argument type %s not valid for brtrue/brfalse at 0x%04x", arg_name [stack [cur_stack].stype], ip_offset));
ip += 5;
need_merge = 1;
break;
@@ -1159,6 +1518,8 @@ mono_method_verify (MonoMethod *method, int level)
ADD_INVALID (list, g_strdup_printf ("Branch target escapes out of exception block at 0x%04x", ip_offset));
CHECK_STACK_UNDERFLOW (2);
cur_stack -= 2;
+ if (type_from_op (*ip, stack + cur_stack) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0x%02x at 0x%04x", *ip, ip_offset));
ip += 5;
need_merge = 1;
break;
@@ -1171,6 +1532,8 @@ mono_method_verify (MonoMethod *method, int level)
ADD_INVALID (list, g_strdup_printf ("Branch target out of code at 0x%04x", ip_offset));
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
+ if (stack [cur_stack].stype != TYPE_I4)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to switch at 0x%04x", ip_offset));
ip += 5 + sizeof (guint32) * n;
break;
case CEE_LDIND_I1:
@@ -1185,6 +1548,9 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_LDIND_R8:
case CEE_LDIND_REF:
CHECK_STACK_UNDERFLOW (1);
+ if (stack [cur_stack - 1].stype != TYPE_PTR && stack [cur_stack - 1].stype != TYPE_MP)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to ldind at 0x%04x", ip_offset));
+ stack [cur_stack - 1].stype = ldind_type [*ip - CEE_LDIND_I1];
++ip;
break;
case CEE_STIND_REF:
@@ -1196,6 +1562,10 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_STIND_R8:
CHECK_STACK_UNDERFLOW (2);
cur_stack -= 2;
+ if (stack [cur_stack].stype != TYPE_PTR && stack [cur_stack].stype != TYPE_MP)
+ ADD_INVALID (list, g_strdup_printf ("Invalid pointer argument to stind at 0x%04x", ip_offset));
+ if (!stind_type (*ip, stack [cur_stack + 1].stype))
+ ADD_INVALID (list, g_strdup_printf ("Incompatible value argument to stind at 0x%04x", ip_offset));
++ip;
break;
case CEE_ADD:
@@ -1213,6 +1583,8 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_SHR_UN:
CHECK_STACK_UNDERFLOW (2);
--cur_stack;
+ if (type_from_op (*ip, stack + cur_stack - 1) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0x%02x at 0x%04x", *ip, ip_offset));
++ip;
break;
case CEE_NEG:
@@ -1226,6 +1598,8 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_CONV_U4:
case CEE_CONV_U8:
CHECK_STACK_UNDERFLOW (1);
+ if (type_from_op (*ip, stack + cur_stack - 1) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0x%02x at 0x%04x", *ip, ip_offset));
++ip;
break;
case CEE_CPOBJ:
@@ -1237,11 +1611,22 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_LDOBJ:
token = read32 (ip + 1);
CHECK_STACK_UNDERFLOW (1);
+ if (stack [cur_stack - 1].stype != TYPE_MP)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to ldobj at 0x%04x", ip_offset));
+ klass = mono_class_get_full (image, token, generic_context);
+ if (!klass)
+ ADD_INVALID (list, g_strdup_printf ("Cannot load class from token 0x%08x at 0x%04x", token, ip_offset));
+ if (!klass->valuetype)
+ ADD_INVALID (list, g_strdup_printf ("Class is not a valuetype at 0x%04x", ip_offset));
+ stack [cur_stack - 1].stype = TYPE_VT;
+ stack [cur_stack - 1].type = &klass->byval_arg;
ip += 5;
break;
case CEE_LDSTR:
token = read32 (ip + 1);
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &mono_defaults.string_class->byval_arg;
+ stack [cur_stack].stype = TYPE_OBJ;
++cur_stack;
ip += 5;
break;
@@ -1250,13 +1635,15 @@ mono_method_verify (MonoMethod *method, int level)
/*
* FIXME: we could just load the signature ...
*/
- cmethod = mono_get_method (image, token, NULL);
+ cmethod = mono_get_method_full (image, token, NULL, generic_context);
if (!cmethod)
ADD_INVALID (list, g_strdup_printf ("Constructor 0x%08x not found at 0x%04x", token, ip_offset));
csig = cmethod->signature;
CHECK_STACK_UNDERFLOW (csig->param_count);
cur_stack -= csig->param_count;
CHECK_STACK_OVERFLOW ();
+ stack [cur_stack].type = &cmethod->klass->byval_arg;
+ stack [cur_stack].stype = cmethod->klass->valuetype? TYPE_VT: TYPE_OBJ;
++cur_stack;
ip += 5;
break;
@@ -1277,38 +1664,69 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_UNBOX:
token = read32 (ip + 1);
CHECK_STACK_UNDERFLOW (1);
+ if (stack [cur_stack - 1].stype != TYPE_OBJ)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument %s to unbox at 0x%04x", arg_name [stack [cur_stack - 1].stype], ip_offset));
+ stack [cur_stack - 1].stype = TYPE_MP;
+ stack [cur_stack - 1].type = NULL;
ip += 5;
break;
case CEE_THROW:
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
++ip;
+ start = 1;
break;
case CEE_LDFLD:
CHECK_STACK_UNDERFLOW (1);
+ if (stack [cur_stack - 1].stype != TYPE_OBJ && stack [cur_stack - 1].stype != TYPE_MP)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument %s to ldfld at 0x%04x", arg_name [stack [cur_stack].stype], ip_offset));
token = read32 (ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ if (!field)
+ ADD_INVALID (list, g_strdup_printf ("Cannot load field from token 0x%08x at 0x%04x", token, ip_offset));
+ type_to_eval_stack_type (field->type, stack + cur_stack - 1, FALSE);
ip += 5;
break;
case CEE_LDFLDA:
CHECK_STACK_UNDERFLOW (1);
+ if (stack [cur_stack - 1].stype != TYPE_OBJ && stack [cur_stack - 1].stype != TYPE_MP)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to ldflda at 0x%04x", ip_offset));
token = read32 (ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ if (!field)
+ ADD_INVALID (list, g_strdup_printf ("Cannot load field from token 0x%08x at 0x%04x", token, ip_offset));
+ type_to_eval_stack_type (field->type, stack + cur_stack - 1, TRUE);
ip += 5;
break;
case CEE_STFLD:
CHECK_STACK_UNDERFLOW (2);
cur_stack -= 2;
+ if (stack [cur_stack].stype != TYPE_OBJ && stack [cur_stack].stype != TYPE_MP)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to stfld at 0x%04x", ip_offset));
token = read32 (ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ if (!field)
+ ADD_INVALID (list, g_strdup_printf ("Cannot load field from token 0x%08x at 0x%04x", token, ip_offset));
+ /* can_store */
ip += 5;
break;
case CEE_LDSFLD:
CHECK_STACK_OVERFLOW ();
token = read32 (ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ if (!field)
+ ADD_INVALID (list, g_strdup_printf ("Cannot load field from token 0x%08x at 0x%04x", token, ip_offset));
+ type_to_eval_stack_type (field->type, stack + cur_stack, FALSE);
++cur_stack;
ip += 5;
break;
case CEE_LDSFLDA:
CHECK_STACK_OVERFLOW ();
token = read32 (ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ if (!field)
+ ADD_INVALID (list, g_strdup_printf ("Cannot load field from token 0x%08x at 0x%04x", token, ip_offset));
+ type_to_eval_stack_type (field->type, stack + cur_stack, TRUE);
++cur_stack;
ip += 5;
break;
@@ -1316,6 +1734,10 @@ mono_method_verify (MonoMethod *method, int level)
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
token = read32 (ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ if (!field)
+ ADD_INVALID (list, g_strdup_printf ("Cannot load field from token 0x%08x at 0x%04x", token, ip_offset));
+ /* can store */
ip += 5;
break;
case CEE_STOBJ:
@@ -1335,25 +1757,40 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_CONV_OVF_I_UN:
case CEE_CONV_OVF_U_UN:
CHECK_STACK_UNDERFLOW (1);
+ if (type_from_op (*ip, stack + cur_stack - 1) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0x%02x at 0x%04x", *ip, ip_offset));
++ip;
break;
case CEE_BOX:
CHECK_STACK_UNDERFLOW (1);
token = read32 (ip + 1);
+ if (stack [cur_stack - 1].stype == TYPE_OBJ)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument %s to box at 0x%04x", arg_name [stack [cur_stack - 1].stype], ip_offset));
+ stack [cur_stack - 1].stype = TYPE_OBJ;
ip += 5;
break;
case CEE_NEWARR:
CHECK_STACK_UNDERFLOW (1);
token = read32 (ip + 1);
+ stack [cur_stack - 1].stype = TYPE_OBJ;
ip += 5;
break;
case CEE_LDLEN:
CHECK_STACK_UNDERFLOW (1);
+ if (stack [cur_stack - 1].stype != TYPE_OBJ)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to ldlen at 0x%04x", ip_offset));
+ stack [cur_stack - 1].type = &mono_defaults.int_class->byval_arg; /* FIXME: use a native int type */
+ stack [cur_stack - 1].stype = TYPE_PTR;
++ip;
break;
case CEE_LDELEMA:
CHECK_STACK_UNDERFLOW (2);
--cur_stack;
+ if (stack [cur_stack - 1].stype != TYPE_OBJ)
+ ADD_INVALID (list, g_strdup_printf ("Invalid array argument to ldelema at 0x%04x", ip_offset));
+ if (stack [cur_stack].stype != TYPE_I4 && stack [cur_stack].stype != TYPE_PTR)
+ ADD_INVALID (list, g_strdup_printf ("Array index needs to be Int32 or IntPtr at 0x%04x", ip_offset));
+ stack [cur_stack - 1].stype = TYPE_MP;
token = read32 (ip + 1);
ip += 5;
break;
@@ -1370,6 +1807,11 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_LDELEM_REF:
CHECK_STACK_UNDERFLOW (2);
--cur_stack;
+ if (stack [cur_stack - 1].stype != TYPE_OBJ)
+ ADD_INVALID (list, g_strdup_printf ("Invalid array argument to ldelem at 0x%04x", ip_offset));
+ if (stack [cur_stack].stype != TYPE_I4 && stack [cur_stack].stype != TYPE_PTR)
+ ADD_INVALID (list, g_strdup_printf ("Array index needs to be Int32 or IntPtr at 0x%04x", ip_offset));
+ stack [cur_stack - 1].stype = ldelem_type [*ip - CEE_LDELEM_I1];
++ip;
break;
case CEE_STELEM_I:
@@ -1384,9 +1826,9 @@ mono_method_verify (MonoMethod *method, int level)
cur_stack -= 3;
++ip;
break;
- case CEE_UNUSED2:
- case CEE_UNUSED3:
- case CEE_UNUSED4:
+ case CEE_LDELEM_ANY:
+ case CEE_STELEM_ANY:
+ case CEE_UNBOX_ANY:
case CEE_UNUSED5:
case CEE_UNUSED6:
case CEE_UNUSED7:
@@ -1411,6 +1853,8 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_CONV_OVF_I8:
case CEE_CONV_OVF_U8:
CHECK_STACK_UNDERFLOW (1);
+ if (type_from_op (*ip, stack + cur_stack - 1) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0x%02x at 0x%04x", *ip, ip_offset));
++ip;
break;
case CEE_UNUSED50:
@@ -1462,6 +1906,8 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_CONV_OVF_I:
case CEE_CONV_OVF_U:
CHECK_STACK_UNDERFLOW (1);
+ if (type_from_op (*ip, stack + cur_stack - 1) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0x%02x at 0x%04x", *ip, ip_offset));
++ip;
break;
case CEE_ADD_OVF:
@@ -1553,17 +1999,24 @@ mono_method_verify (MonoMethod *method, int level)
case CEE_CLT_UN:
CHECK_STACK_UNDERFLOW (2);
--cur_stack;
+ if (type_from_op (256 + *ip, stack + cur_stack - 1) == TYPE_INV)
+ ADD_INVALID (list, g_strdup_printf ("Invalid arguments to opcode 0xFE 0x%02x at 0x%04x", *ip, ip_offset));
++ip;
break;
case CEE_LDFTN:
CHECK_STACK_OVERFLOW ();
token = read32 (ip + 1);
ip += 5;
+ stack [cur_stack].stype = TYPE_PTR;
+ cur_stack++;
break;
case CEE_LDVIRTFTN:
CHECK_STACK_UNDERFLOW (1);
token = read32 (ip + 1);
ip += 5;
+ if (stack [cur_stack - 1].stype != TYPE_OBJ)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to ldvirtftn at 0x%04x", ip_offset));
+ stack [cur_stack - 1].stype = TYPE_PTR;
break;
case CEE_UNUSED56:
++ip;
@@ -1585,26 +2038,34 @@ mono_method_verify (MonoMethod *method, int level)
break;
case CEE_LDLOC:
case CEE_LDLOCA:
- if (read16 (ip + 1) >= header->num_locals)
- ADD_INVALID (list, g_strdup_printf ("Method doesn't have local var %d at 0x%04x", read16 (ip + 1), ip_offset));
+ n = read16 (ip + 1);
+ if (n >= header->num_locals)
+ ADD_INVALID (list, g_strdup_printf ("Method doesn't have local var %d at 0x%04x", n, ip_offset));
/* no need to check if the var is initialized if the address is taken */
- if (*ip == CEE_LDLOC && !local_state [read16 (ip + 1)])
- ADD_INVALID (list, g_strdup_printf ("Local var %d is initialized at 0x%04x", read16 (ip + 1), ip_offset));
+ if (0 && *ip == CEE_LDLOC && !local_state [n])
+ ADD_INVALID (list, g_strdup_printf ("Local var %d is initialized at 0x%04x", n, ip_offset));
CHECK_STACK_OVERFLOW ();
+ type_to_eval_stack_type (header->locals [n], stack + cur_stack, *ip == CEE_LDLOCA);
++cur_stack;
ip += 3;
break;
case CEE_STLOC:
- if (read16 (ip + 1) >= header->num_locals)
- ADD_INVALID (list, g_strdup_printf ("Method doesn't have local var %d at 0x%04x", read16 (ip + 1), ip_offset));
- local_state [read16 (ip + 1)] = 1;
+ n = read16 (ip + 1);
+ if (n >= header->num_locals)
+ ADD_INVALID (list, g_strdup_printf ("Method doesn't have local var %d at 0x%04x", n, ip_offset));
+ local_state [n] = 1;
CHECK_STACK_UNDERFLOW (1);
--cur_stack;
+ if (!can_store_type (stack + cur_stack, header->locals [n]))
+ ADD_INVALID (list, g_strdup_printf ("Incompatible type %s in store at 0x%04x", arg_name [stack [cur_stack].stype], ip_offset));
ip += 3;
break;
case CEE_LOCALLOC:
if (cur_stack != 1)
ADD_INVALID (list, g_strdup_printf ("Stack must have only size item in localloc at 0x%04x", ip_offset));
+ if (stack [cur_stack -1].stype != TYPE_I4 && stack [cur_stack -1].stype != TYPE_PTR)
+ ADD_INVALID (list, g_strdup_printf ("Invalid argument to localloc at 0x%04x", ip_offset));
+ stack [cur_stack -1].stype = TYPE_MP;
++ip;
break;
case CEE_UNUSED57:
@@ -1633,9 +2094,11 @@ mono_method_verify (MonoMethod *method, int level)
CHECK_STACK_UNDERFLOW (1);
token = read32 (ip + 1);
ip += 5;
+ --cur_stack;
break;
- case CEE_UNUSED68:
- ++ip;
+ case CEE_CONSTRAINED_:
+ token = read32 (ip + 1);
+ ip += 5;
break;
case CEE_CPBLK:
CHECK_STACK_UNDERFLOW (3);
@@ -1645,8 +2108,8 @@ mono_method_verify (MonoMethod *method, int level)
CHECK_STACK_UNDERFLOW (3);
ip++;
break;
- case CEE_UNUSED69:
- ++ip;
+ case CEE_NO_:
+ ip += 2;
break;
case CEE_RETHROW:
++ip;
@@ -1658,12 +2121,14 @@ mono_method_verify (MonoMethod *method, int level)
CHECK_STACK_OVERFLOW ();
token = read32 (ip + 1);
ip += 5;
+ stack [cur_stack].type = &mono_defaults.uint_class->byval_arg;
+ stack [cur_stack].stype = TYPE_I4;
+ cur_stack++;
break;
case CEE_REFANYTYPE:
CHECK_STACK_UNDERFLOW (1);
++ip;
break;
- case CEE_UNUSED52:
case CEE_UNUSED53:
case CEE_UNUSED54:
case CEE_UNUSED55:
@@ -1674,12 +2139,18 @@ mono_method_verify (MonoMethod *method, int level)
}
}
/*
- * FIXME: if ip != end we overflowed: mark as error.
+ * if ip != end we overflowed: mark as error.
*/
+ if (ip != end || !start) {
+ ADD_INVALID (list, g_strdup_printf ("Run ahead of method code at 0x%04x", ip_offset));
+ }
invalid_cil:
g_free (local_state);
g_free (code);
+ g_free (stack);
+ if (signature->hasthis)
+ g_free (params);
return list;
}
@@ -1721,6 +2192,9 @@ assemblybuilder_fields[] = {
{"entry_point", G_STRUCT_OFFSET (MonoReflectionAssemblyBuilder, entry_point)},
{"modules", G_STRUCT_OFFSET (MonoReflectionAssemblyBuilder, modules)},
{"name", G_STRUCT_OFFSET (MonoReflectionAssemblyBuilder, name)},
+ {"resources", G_STRUCT_OFFSET (MonoReflectionAssemblyBuilder, resources)},
+ {"version", G_STRUCT_OFFSET (MonoReflectionAssemblyBuilder, version)},
+ {"culture", G_STRUCT_OFFSET (MonoReflectionAssemblyBuilder, culture)},
{NULL, 0}
};
@@ -1784,7 +2258,6 @@ propertybuilder_fields[] = {
static const FieldDesc
ilgenerator_fields[] = {
{"code", G_STRUCT_OFFSET (MonoReflectionILGen, code)},
- {"mbuilder", G_STRUCT_OFFSET (MonoReflectionILGen, mbuilder)},
{"code_len", G_STRUCT_OFFSET (MonoReflectionILGen, code_len)},
{"max_stack", G_STRUCT_OFFSET (MonoReflectionILGen, max_stack)},
{"cur_stack", G_STRUCT_OFFSET (MonoReflectionILGen, cur_stack)},
@@ -1868,15 +2341,6 @@ monopropertyinfo_fields[] = {
};
static const FieldDesc
-monofieldinfo_fields[] = {
- {"parent", G_STRUCT_OFFSET (MonoFieldInfo, parent)},
- {"type", G_STRUCT_OFFSET (MonoFieldInfo, type)},
- {"name", G_STRUCT_OFFSET (MonoFieldInfo, name)},
- {"attrs", G_STRUCT_OFFSET (MonoFieldInfo, attrs)},
- {NULL, 0}
-};
-
-static const FieldDesc
monomethod_fields[] = {
{"mhandle", G_STRUCT_OFFSET (MonoReflectionMethod, method)},
{NULL, 0}
@@ -1906,7 +2370,6 @@ reflection_classes_to_check [] = {
{"MonoField", monofield_fields},
{"MonoMethodInfo", monomethodinfo_fields},
{"MonoPropertyInfo", monopropertyinfo_fields},
- {"MonoFieldInfo", monofieldinfo_fields},
{"MonoMethod", monomethod_fields},
{"MonoCMethod", monocmethod_fields},
{"ParameterInfo", pinfo_fields},
@@ -1947,6 +2410,7 @@ async_result_fields[] = {
{"sync_completed", G_STRUCT_OFFSET (MonoAsyncResult, sync_completed)},
{"completed", G_STRUCT_OFFSET (MonoAsyncResult, completed)},
{"endinvoke_called", G_STRUCT_OFFSET (MonoAsyncResult, endinvoke_called)},
+ {"async_callback", G_STRUCT_OFFSET (MonoAsyncResult, async_callback)},
{NULL, 0}
};
@@ -2013,7 +2477,7 @@ messaging_classes_to_check [] = {
static FieldDesc
transparent_proxy_fields[] = {
{"_rp", G_STRUCT_OFFSET (MonoTransparentProxy, rp)},
- {"_class", G_STRUCT_OFFSET (MonoTransparentProxy, klass)},
+ {"_class", G_STRUCT_OFFSET (MonoTransparentProxy, remote_class)},
{NULL, 0}
};
@@ -2037,12 +2501,86 @@ wait_handle_fields[] = {
{NULL, 0}
};
+static FieldDesc
+thread_fields[] = {
+ {"system_thread_handle", G_STRUCT_OFFSET (MonoThread, handle)},
+ {"current_culture", G_STRUCT_OFFSET (MonoThread, culture_info)},
+ {"threadpool_thread", G_STRUCT_OFFSET (MonoThread, threadpool_thread)},
+ {"state", G_STRUCT_OFFSET (MonoThread, state)},
+ {"abort_exc", G_STRUCT_OFFSET (MonoThread, abort_exc)},
+ {"abort_state", G_STRUCT_OFFSET (MonoThread, abort_state)},
+ {"thread_id", G_STRUCT_OFFSET (MonoThread, tid)},
+ {NULL, 0}
+};
+
static const ClassDesc
threading_classes_to_check [] = {
+ {"Thread", thread_fields},
{"WaitHandle", wait_handle_fields},
{NULL, NULL}
};
+static const FieldDesc
+cinfo_fields[] = {
+ {"datetime_format", G_STRUCT_OFFSET (MonoCultureInfo, datetime_format)},
+ {"number_format", G_STRUCT_OFFSET (MonoCultureInfo, number_format)},
+ {"textinfo", G_STRUCT_OFFSET (MonoCultureInfo, textinfo)},
+ {"name", G_STRUCT_OFFSET (MonoCultureInfo, name)},
+ {"displayname", G_STRUCT_OFFSET (MonoCultureInfo, displayname)},
+ {"englishname", G_STRUCT_OFFSET (MonoCultureInfo, englishname)},
+ {"nativename", G_STRUCT_OFFSET (MonoCultureInfo, nativename)},
+ {"iso3lang", G_STRUCT_OFFSET (MonoCultureInfo, iso3lang)},
+ {"iso2lang", G_STRUCT_OFFSET (MonoCultureInfo, iso2lang)},
+ {"icu_name", G_STRUCT_OFFSET (MonoCultureInfo, icu_name)},
+ {"win3lang", G_STRUCT_OFFSET (MonoCultureInfo, win3lang)},
+ {"compareinfo", G_STRUCT_OFFSET (MonoCultureInfo, compareinfo)},
+ {NULL, 0}
+};
+
+static const FieldDesc
+dtfinfo_fields[] = {
+ {"_AMDesignator", G_STRUCT_OFFSET (MonoDateTimeFormatInfo, AMDesignator)},
+ {"_PMDesignator", G_STRUCT_OFFSET (MonoDateTimeFormatInfo, PMDesignator)},
+ {"_DayNames", G_STRUCT_OFFSET (MonoDateTimeFormatInfo, DayNames)},
+ {"_MonthNames", G_STRUCT_OFFSET (MonoDateTimeFormatInfo, MonthNames)},
+ {NULL, 0}
+};
+
+static const FieldDesc
+nfinfo_fields[] = {
+ {"decimalFormats", G_STRUCT_OFFSET (MonoNumberFormatInfo, decimalFormats)},
+ {"currencySymbol", G_STRUCT_OFFSET (MonoNumberFormatInfo, currencySymbol)},
+ {"percentSymbol", G_STRUCT_OFFSET (MonoNumberFormatInfo, percentSymbol)},
+ {"positiveSign", G_STRUCT_OFFSET (MonoNumberFormatInfo, positiveSign)},
+ {NULL, 0}
+};
+
+static const FieldDesc
+compinfo_fields[] = {
+ {"lcid", G_STRUCT_OFFSET (MonoCompareInfo, lcid)},
+ {"ICU_collator", G_STRUCT_OFFSET (MonoCompareInfo, ICU_collator)},
+ {NULL, 0}
+};
+
+static const FieldDesc
+sortkey_fields[] = {
+ {"str", G_STRUCT_OFFSET (MonoSortKey, str)},
+ {"options", G_STRUCT_OFFSET (MonoSortKey, options)},
+ {"key", G_STRUCT_OFFSET (MonoSortKey, key)},
+ {"lcid", G_STRUCT_OFFSET (MonoSortKey, lcid)},
+ {NULL, 0}
+};
+
+static const ClassDesc
+globalization_classes_to_check [] = {
+ {"CultureInfo", cinfo_fields},
+ {"DateTimeFormatInfo", dtfinfo_fields},
+ {"NumberFormatInfo", nfinfo_fields},
+ {"CompareInfo", compinfo_fields},
+ {"SortKey", sortkey_fields},
+ {NULL, NULL}
+};
+
typedef struct {
const char *name;
const ClassDesc *types;
@@ -2057,6 +2595,7 @@ namespaces_to_check[] = {
{"System.Threading", threading_classes_to_check},
{"System.Diagnostics", system_diagnostics_classes_to_check},
{"System", system_classes_to_check},
+ {"System.Globalization", globalization_classes_to_check},
{NULL, NULL}
};
@@ -2069,28 +2608,38 @@ check_corlib (MonoImage *corlib)
const ClassDesc *cdesc;
const NameSpaceDesc *ndesc;
gint struct_offset;
+ GString *result = NULL;
for (ndesc = namespaces_to_check; ndesc->name; ++ndesc) {
for (cdesc = ndesc->types; cdesc->name; ++cdesc) {
klass = mono_class_from_name (corlib, ndesc->name, cdesc->name);
- if (!klass)
- return g_strdup_printf ("Cannot find class %s", cdesc->name);
+ if (!klass) {
+ if (!result)
+ result = g_string_new ("");
+ g_string_append_printf (result, "Cannot find class %s\n", cdesc->name);
+ continue;
+ }
mono_class_init (klass);
/*
* FIXME: we should also check the size of valuetypes, or
* we're going to have trouble when we access them in arrays.
*/
if (klass->valuetype)
- struct_offset = 8;
+ struct_offset = sizeof (MonoObject);
else
struct_offset = 0;
for (fdesc = cdesc->fields; fdesc->name; ++fdesc) {
field = mono_class_get_field_from_name (klass, fdesc->name);
- if (!field || (field->offset != (fdesc->offset + struct_offset)))
- return g_strdup_printf ("field `%s' mismatch in class %s (%ld != %ld)", fdesc->name, cdesc->name, (long) fdesc->offset, (long) (field?field->offset:-1));
+ if (!field || (field->offset != (fdesc->offset + struct_offset))) {
+ if (!result)
+ result = g_string_new ("");
+ g_string_append_printf (result, "field `%s' mismatch in class %s (%ld + %ld != %ld)\n", fdesc->name, cdesc->name, (long) fdesc->offset, (long)struct_offset, (long) (field?field->offset:-1));
+ }
}
}
}
+ if (result)
+ return g_string_free (result, FALSE);
return NULL;
}
@@ -2099,3 +2648,4 @@ mono_verify_corlib () {
return check_corlib (mono_defaults.corlib);
}
+
diff --git a/mono/mini/.cvsignore b/mono/mini/.cvsignore
new file mode 100644
index 00000000000..7c942e2599a
--- /dev/null
+++ b/mono/mini/.cvsignore
@@ -0,0 +1,21 @@
+Makefile
+Makefile.in
+*.o
+*.exe
+*.dll
+*.lo
+*.loT
+*.la
+.libs
+.deps
+mini
+genmdesc
+inssel.c
+inssel.h
+mini.pc
+cpu-pentium.h
+cpu-g4.h
+mono
+cpu-sparc.h
+cpu-s390.h
+.hidden \ No newline at end of file
diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog
new file mode 100644
index 00000000000..1186fe54597
--- /dev/null
+++ b/mono/mini/ChangeLog
@@ -0,0 +1,4159 @@
+2004-11-10 Martin Baulig <martin@localhost>
+
+ * mini.c (mono_method_to_ir): Use `generic_container->context'
+ rather than creating a new one.
+
+2004-11-09 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * exceptions-s390.c, mini-s390, cpu-s390.md: Add support for OP_RETHROW.
+
+ * inssel-390.md, mini-s390.c: Correct register allocation for globals.
+
+2004-11-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_aot_init): Add MONO_AOT_CACHE env variable to turn on
+ the experimental aot cache stuff.
+
+Tue Nov 9 17:30:20 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * aot.c, mini.c, exceptions-ppc.c, exceptions-s390.c, exceptions-s390x.c,
+ mini-exceptions.c: update to exception clause structure changes.
+
+2004-11-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-x86.c (throw_exception): Fix warnings.
+
+ * mini-x86.h mini-x86.c cpu-pentium.md exceptions-x86.c: Add support
+ for OP_RETHROW.
+
+2004-11-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-sparc.c (get_throw_exception): Really fix this.
+
+2004-11-07 Ben Maurer <bmaurer@ximian.com>
+
+ * tramp-*.c: we no longer support icalls without wrappers, so
+ a bit of code can be removed here
+
+2004-11-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-sparc.c (get_throw_exception): Fix more bugs in previous
+ patch.
+
+ * cpu-sparc.md: Add op_rethrow.
+
+ * exceptions-sparc.c (get_throw_exception): Fix bug in previous patch.
+
+ * mini-sparc.h mini-sparc.c exceptions-sparc.c: Add support for OP_RETHROW.
+
+ * mini.h: Add mono_arch_get_rethrow_exception () arch specific function.
+ * mini-ops.h: Add OP_RETHROW.
+
+ * mini.c inssel.brg: Distinguish between THROW and RETHROW.
+
+ * cpu-amd64.c mini-amd64.c exceptions-amd64.c: Add support for OP_RETHROW.
+
+2004-11-05 Geoff Norton <gnorton@customerdna.com>
+
+ * helpers.c: Change otool arguments from -V -v -t to -v -t on Darwin
+ Makes the output much easier to read
+
+2004-11-05 Ben Maurer <bmaurer@ximian.com>
+
+ * ssa.c: allocate MonoMethodVar.uses from the mempool. First, this
+ prevents another huge leak when compiling with ssa. Secondly, the
+ performance of doing this rather than freeing the lists is much
+ better. GList does a lock every time you allocate a list link,
+ so that it can use a memory pool. So, it is better to just use
+ a memory pool of our own.
+
+ * ssa.c, linear-scan.c: replace g_list_remove_link with
+ g_list_delete. The remove one does not free the GList, so we were
+ leaking memory. On -O=all --compile-all with corlib, this cut down
+ 3 MB of allocations.
+
+2004-11-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-sparc.c (mono_arch_create_jit_trampoline): Fix sparc build.
+
+ * tramp-amd64.c (mono_arch_create_jit_trampoline): Fix amd64 build.
+
+ * mini.h mini.c tramp-*.c: Moved xp parts of JIT trampoline creation
+ into a new function mono_create_jit_trampoline ().
+
+2004-11-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * trace.c (get_spec): Allow tracing of classes without a namespace.
+
+2004-11-02 Sebastien Pouliot <sebastien@ximian.com>
+
+ * mini.c: Fix pointer overwrite in mini_method_compile.
+
+2004-11-2 Geoff Norton <gnorton@customerdna.com>
+
+ * inssel-ppc.brg (OP_OUTARG_VT (CEE_LDOBJ (base))):
+ The darwin ABI needs some special handling for 1 and 2 byte structs
+ Lets use lbz/lhz instead of lwz everywhere.
+ * mini-ppc.c (calculate_sizes): The Darwin ABI needs from special handling
+ for 1 and 2 byte structs and struct which are size >= 3 || size % 4 != 0.
+ Use stb/sth for the former, and put the latter always on stack instead of in
+ argument registers.
+
+2004-10-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * trace.c (is_filenamechar): Add '_'.
+
+2004-10-29 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * mini-s390.c: Fix prolog length to allow for large trace requirements.
+
+ * exceptions-s390.c: Remove dwarf unwinding stuff that was unused.
+
+2004-10-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (libgc_libs): Do some automake magic so libmono/mono
+ depends on libmonogc. Fixes #68805.
+
+2004-10-26 Miguel de Icaza <miguel@ximian.com>
+
+ * mini.c (mono_jit_free_method): Provide extra information for
+ this error. Currently this leaks, but will be turned into a
+ developer option in the future.
+
+2004-10-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c (mono_main): Applied patch from Willibald Krenn <willibald.krenn@gmx.at>. Make --graph work for icalls and pinvoke methods.
+
+2004-10-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_aot_load_method): Align PATCH_INFO_R8 on an 8 byte
+ boundary. Fixes reading of PATCH_INFO_R4 and R8.
+ (mono_aot_load_method): Do not allocate MonoAotMethod in the GC heap.
+
+2004-10-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (mono_arch_patch_code): Fix patching of class init
+ trampolines for AOT code.
+
+2004-10-22 <vargaz@freemail.hu>
+
+ * aot.c (mono_compile_assembly): Disable AOT for methods containing calls to methods of
+ constructed types. Fixes #68136.
+
+2004-10-21 Martin Baulig <martin@ximian.com>
+
+ * exceptions-x86.c (throw_exception): Call mono_debugger_throw_exception();
+ if it returns true, unwind the stack to the call instruction.
+
+2004-10-21 <vargaz@freemail.hu>
+
+ * aot.c: Reorganize the AOT file format to avoid relocations. Fix warnings.
+
+ * mini.h: Bump AOT version number.
+
+ * objects.cs: Add another test for unbox trampolines.
+
+ * tramp-amd64.c (amd64_magic_trampoline): Disable patching of trampolines for
+ valuetype methods.
+
+2004-10-20 <vargaz@freemail.hu>
+
+ * driver.c: Add SHARED to the set of optimizations tested.
+
+ * tramp-amd64.c (amd64_magic_trampoline): Patch trampoline code as well.
+
+ * mini.c (mono_method_to_ir): Mark the domainvar as volatile when it is implicitly
+ used by CEE_NEWARR.
+
+ * ssa.c (mono_ssa_deadce): Do not optimize away accesses to volatile variables.
+
+2004-10-20 Martin Baulig <martin@ximian.com>
+
+ * mini-exceptions.c (mono_handle_exception): Call
+ mono_debugger_handle_exception() to tell the debugger about
+ catch/finally clauses.
+
+2004-10-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-amd64.c (mono_arch_find_jit_info): Pop arguments of the stack.
+
+ * mini-amd64.c (mono_amd64_get_vcall_slot_addr): Handle extended registers. Fixes
+ #68447.
+
+2004-10-15 Geoff Norton <gnorton@customerdna.com>
+
+ * mini-ppc.c (calculate_sizes): Marshal valuetypes for pinvoke
+ methods as their native size, fixed bug #57543, #57545.
+ * mini-ppc.c (mono_arch_output_basic_block): Use mulli for imm16 types
+ This saves a temporary register and mullw call down into 1 (minor perf
+ increase for cases like sum = sum * 5; This use to translate into:
+ li r11,5
+ mullw r28,r28,r11
+ It now translates to
+ mulli r28,r28,5
+
+2004-10-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * trace.c (mono_trace_eval): Use mono_method_desc_full_match. Fixes
+ #68388.
+
+2004-10-11 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mono_method_to_ir): If we're a generic method, get the
+ MonoGenericContainer from our MonoMethodNormal and create a
+ MonoGenericContext from it.
+
+2004-10-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel-long32.brg (OP_LCONV_TO_OVF_I2): Fix CONV_I1 -> CONV_I2.
+
+ * basic-long.cs: Add test for checked i8->i2 cast.
+
+Wed Oct 6 12:40:28 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-ppc.brg: added a couple of speedup rules.
+
+2004-10-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (genmdesc_LDADD): Don't link this against libmetadata
+ to speed up rebuilds.
+
+2004-10-04 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * mini-s390.c: Minor fix to OP_OR_IMM.
+
+2004-10-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-sparc.c (sparc_magic_trampoline): Handle appdomain stuff
+ better. Fixes appdomain-unload.exe on sparc.
+
+2004-10-02 Massimiliano Mantione <massi@ximian.com>
+
+ * ssa.c: Fixed casts to unsigned where the value was of 64 bits in
+ simulate_long_compare, patch by will@exomi.com (Ville-Pertti Keinonen),
+ see bug 67324.
+
+2004-10-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * jit-icalls.c: Handle a nonexisting trunc function more correctly.
+
+2004-09-30 Lluis Sanchez Gual <lluis@novell.com>
+
+ * mini.c: Always generate a field read/write wrapper for members
+ of the class MarshalByRefObject since the actual instance could
+ be a CBO.
+
+2004-09-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * mini.c: Use mono_thread_exit() to stop threads, instead of ExitThread.
+
+2004-09-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c mini.h trace.c: Move the setting of the main assembly into
+ a separate function called mono_trace_set_assembly () and call it after
+ actually loading the main assembly. Fixes #66872.
+
+2004-09-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.h mini-amd64.c tramp-amd64.c: Allocate trampoline memory
+ using the code manager.
+
+2004-09-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-amd64.c mini-amd64.h: Add support for MONO_ARCH_HAVE_INVALIDATE_METHOD.
+
+2004-09-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * cpu-amd64.md: Fix bug in previous patch.
+
+ * cpu-amd64.md: Fix instruction lengths of membase opcodes. Fixes
+ #66650.
+
+Wed Sep 22 19:03:20 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, exceptions-ppc.c, exceptions-s390.c, exceptions-s390x.c,
+ mini-exceptions.c: updates for changed stack walk interface.
+
+2004-09-21 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * mini-s390.c, cpu-s390.md: Minor changes to OP_ARGLIST handling
+
+2004-09-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Fix LDSTR in dynamic methods. Fixes #66132.
+
+2004-09-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c (mini_regression_list): Do not call mono_assembly_close
+ since assemblies can't be unloaded.
+
+2004-09-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * cpu-amd64.md: Fix more instruction lengths.
+
+ * cpu-amd64.md: Fix lengths of some instructions.
+
+2004-09-11 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * inssel.brg: Make the array ldelema check aot friendly.
+
+2004-09-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (mono_arch_get_argument_info): Fix stack_unwind test.
+
+ * cpu-amd64.md inssel-long.brg inssel-amd64.brg: Small optimizations.
+
+2004-09-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c: Fix build.
+
+ * mini-sparc.c mini-x86.c mini-amd64.c: Use the new
+ mono_type_get_underlying_type () helper function to simplify code.
+
+2004-09-09 Martin Baulig <martin@ximian.com>
+
+ * mini-amd64.c: Don't access `type->data.klass' directly, call
+ mono_class_from_mono_type() instead since the type may be a
+ generic instance.
+
+2004-09-09 Martin Baulig <martin@ximian.com>
+
+ * mini-amd64.c (get_call_info): Fix support for generic instances.
+ (add_valuetype): Use mono_class_from_mono_type() to get the class
+ since we can be a generic instance.
+
+Thu Sep 9 01:43:53 PDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, mini.h, regalloc.c, regalloc.h: powerpc speedups.
+
+2004-09-07 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * liveness.c: reset spill costs on each scan: bug 62107
+
+2004-09-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * exceptions-sparc.c (mono_arch_find_jit_info): remove
+ unnecessary line that doesn't compile
+
+2004-09-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c mini.h mini-x86.h tramp-x86.c: Instead of freeing delegate
+ trampolines, make them call an error function so people can fix their
+ code.
+
+2004-09-06 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mono_method_to_ir): When initializing locals, handle a
+ generic instances like a valuetype if it's a valuetype and like a
+ class if it's a class.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-x86.c (mono_arch_find_jit_info): Pop arguments off the
+ stack. Fixes #64674.
+
+ * exceptions.cs: Add test for unwinding of call arguments.
+
+Mon Sep 6 05:50:02 PDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-*.c, mini-ops.h, inssel-long32.brg: introduced
+ OP_ADDCC_IMM and OP_SUBCC_IMM (add/sub immediate that will
+ set the carry/borrow flag). The sparc and s390 implementations
+ can now use optimized versions (and simplify the code). ppc bugfixes.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-ppc.c (mono_arch_find_jit_info): Fix memory leak.
+
+2004-09-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel-amd64.brg: Remove leftover 32 bit rule.
+
+ * mini-amd64.c (mono_arch_instrument_prolog): Fix tracing support.
+
+2004-09-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-exceptions.c (mono_find_jit_info): Refactor common code from
+ mono_arch_find_jit_info functions into a new function. Fix a memory
+ leak.
+
+ * exceptions-x86.c exceptions-amd64.c exceptions-sparc.c: Remove
+ refactored code.
+
+2004-09-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs inssel-long32.brg: Handle the OP_LCONV_TO_OVF_I2 case
+ as well.
+
+ * exceptions.cs: Add array size tests.
+
+ * mini.c: Allocate a separate icall wrapper for each arity of
+ mono_array_new_va. Fixes #59509.
+
+ * exceptions.cs: Add testcase for 64578.
+
+ * inssel-long32.brg: Fix OP_LCONV_TO_OVF_I1 rule. Fixes #64578.
+
+ * trace.c (is_filenamechar): Allow 0..9 in strings. Fixes #65094.
+
+2004-09-02 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mono_method_to_ir): When initializing the locals, call
+ handle_initobj() on the generic instance itself, not its
+ underlying type.
+
+2004-09-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h (MonoJitDynamicMethodInfo): New structure, extension of
+ MonoJitInfo for dynamic methods.
+
+ * mini.c: Rename trampoline_hash_mutex to jit_mutex.
+
+ * mini.c: Add support for freeing JIT data for dynamic methods.
+
+2004-09-01 Martin Baulig <martin@ximian.com>
+
+ * mini-x86.c (is_regsize_var): Added support for generic
+ instances.
+ (mono_arch_emit_prolog): Make this compile again, use
+ `x86_push_imm_template (code)'.
+
+2004-08-30 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mini-x86.c: make all push_imm instructions that get
+ patched always emit the long form
+
+2004-08-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_create_jump_trampoline): Store the jump trampolines
+ in a per-domain hash.
+
+ * mini-amd64.c (merge_argument_class_from_type): Handle generic
+ types.
+
+2004-08-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c cpu-amd64.md inssel-amd64.brg mini-amd64.h: Ongoing SSE
+ work.
+
+ * mini-amd64.c cpu-amd64.md inssel-amd64.brg mini-amd64.h: More SSE
+ work.
+
+ * mini-amd64.c cpu-amd64.md: Implement checked int<->uint casts.
+ Beginnings of SSE2 support.
+
+ * exceptions.cs: Add more tests for checked int<->uint casts.
+
+2004-08-28 Martin Baulig <martin@ximian.com>
+
+ * mini-x86.c (mono_arch_instrument_epilog): Added support for
+ generic instances.
+
+ * mini.c
+ (mono_type_to_ldind, mono_type_to_stind, type_to_eval_stack_type):
+ Handle generic instances recursively.
+
+2004-08-27 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * iltests.il: test for conv.u8 on a constant
+
+2004-08-27 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * inssel-long32.brg: c&p rules for LCONV_x4 (membase) and
+ LCONV_x4 (shrun_32 (membase)).
+
+2004-08-27 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * inssel-x86.brg: c&p rules for push/setret of long
+
+2004-08-26 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * inssel-x86.brg: c&p rules for compare (base, regvar) and
+ compare (regvar, base)
+
+ * inssel-x86.brg: more burg love
+
+ * inssel.brg: more cleanup
+
+ * inssel-x86.brg, inssel-long32.brg: burg cleanup.
+
+2004-08-26 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * basic-long.cs, basic-calls.cs: new tests for optimization.
+
+2004-08-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (read_tls_offset_from_method): Fix typo in previous
+ patch.
+
+2004-08-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (read_tls_offset_from_method): Add another case.
+
+2004-08-25 Bernie Solomon <bernard@ugsolutions.com>
+
+ * inssel.brg (mini_emit_memcpy): use
+ NO_UNALIGNED_ACCESS to disable memcpy optimization
+
+2004-08-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c: Handle generic types in various places.
+
+ * mini.c (mono_method_to_ir): Handle generic types in init locals.
+
+2004-08-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (handle_box): Fix warning.
+
+ * mini-amd64.c (mono_arch_local_regalloc): Fix regalloc problem.
+
+ * mini-amd64.h: Enable the emit_state optimization.
+
+ * mini-ops.h cpu-amd64.md: Add new amd64_test_null opcode.
+
+ * mini-amd64.c: Add some new 64 bit peephole opts.
+
+ * inssel.brg (mini_emit_memcpy): Optimize for 64 bit architectures.
+
+ * cpu-amd64.md: sreg1 of div instructions must be %rax.
+
+ * mini-amd64.c: Register allocator fixes.
+
+ * mini.c: Add an optimization to emit_state to avoid allocation of new
+ registers on some platforms.
+
+2004-08-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel-x86.brg inssel-amd64: Add yet another missing tree->dreg assignment.
+
+ * mini-x86.c (mono_arch_local_regalloc): Fix bug in long register
+ allocation. Fixes #63085.
+
+ * basic-long.cs: Add new regression test.
+
+ * mini-amd64.c: Register allocator improvements.
+
+2004-08-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (read_tls_offset_from_method): Add another code
+ sequence.
+
+ * tramp-amd64.c (amd64_class_init_trampoline): Use a more efficient
+ instruction sequence for nullifying class init trampolines.
+
+ * objects.cs: Add new regalloc test.
+
+ * mini-amd64.c inssel-amd64.brg: Optimize parameter passing.
+
+2004-08-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (mono_arch_call_opcode): Refactor this a little.
+
+ * mini-amd64.c (mono_arch_regalloc_cost): Adjust regalloc costs for
+ arguments.
+
+ * driver.c: Fix profiling after TLS changes.
+
+ * driver.c (mono_main): Set mono_stats.enabled if needed.
+
+ * mini.c (handle_alloc): New helper function used by CEE_NEWOBJ and
+ CEE_BOX.
+
+2004-08-20 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mini-x86.c: use a 1 op rather than a 2 op tls access
+ instruction -> faster.
+
+2004-08-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c inssel-amd64.brg cpu-amd64.md: Merge changes from
+ x86 backend.
+
+2004-08-19 Bernie Solomon <bernard@ugsolutions.com>
+
+ * exceptions-sparc.c (throw_exception): fix typo
+
+2004-08-19 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mini-x86.c, cpu-pentium.md, inssel-x86.brg:
+ set tree->dreg correctly with tls. Allow any
+ register to be used.
+
+ * mini-x86.c (read_tls_offset_from_method): add new code
+ generation pattern seen with GCC.
+
+
+Thu Aug 19 17:26:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-exceptions.c, exceptions-x86.c, exceptions-amd64.c,
+ exceptions-ppc.c, exceptions-s390.c, exceptions-s390x.c,
+ exceptions-sparc.c: fix some performance issues in exception
+ handling and setting of the stack trace for exceptions that were
+ already thrown.
+
+2004-08-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c inssel-amd64.brg cpu-amd64.md: Merge changes from
+ x86 backend.
+
+ * mini-amd64.c (mono_arch_is_int_overflow): Handle all possible
+ registers.
+
+2004-08-18 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ This patch inlines tls access, when possible.
+
+ * mini.h: new arch functions for TLS intrinsics.
+ All platforms updated with a stub.
+
+ * mini.c: use the new intrinsics
+
+ * mini-x86.c, cpu-pentium.md, inssel-x86.brg, mini-ops.h:
+ arch specific intrinsic for tls variables
+
+2004-08-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (libmono_la_LDFLAGS): Enable creating of libmono dll
+ under windows.
+
+2004-08-17 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mini.c: thread local allocation
+
+2004-08-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.h (MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS): Enable.
+
+ * Makefile.am: Link against the static version of libmonogc.
+
+ * Makefile.am: Link the static versions of the convenience libraries
+ into the mono executable.
+
+ * mini-x86.h mini-x86.c: Throw the correct exception on integer overflow.
+
+2004-08-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h mini.c mini-amd64.h mini-amd64.c: Throw the correct exception
+ on integer overflow.
+
+ * mini-amd64.c: Reorganize function call code.
+
+ * mini-amd64.c (peephole_pass): Merge changes from mini-x86.c.
+
+2004-08-14 Ben Maurer <bmaurer@ximian.com>
+
+ * inssel-x86.brg: use xor eax,eax.
+
+ * basic.cs: new tests
+
+2004-08-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (mono_arch_emit_epilog): Use RIP relative addressing
+ in exception throwing code.
+
+2004-08-14 Ben Maurer <bmaurer@ximian.com>
+
+ * inssel-x86.brg: use xor esi,esi.
+
+2004-08-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c (mono_main): Call mono_trace_parse_options earlier so it
+ can trace methods compiled during mini_init () too.
+
+ * cpu-amd64.md mini-amd64.c (mono_arch_output_basic_block): Handle
+ CEE_CONV_U4.
+
+2004-08-14 Ben Maurer <bmaurer@ximian.com>
+
+ * Makefile.am: static link on x86 (r=zoltan)
+
+2004-08-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-amd64.c (amd64_magic_trampoline): Avoid patching the trampoline
+ code since it causes some programs to fail.
+
+2004-08-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (bb_is_loop_start): Merge changes from mini-x86.c.
+
+2004-08-11 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mini.c: ovfops_op_map - add STACK_OBJ case for
+ CONV_I
+ * basic.cs: add test_0_pin_string as test
+ case for above.
+
+2004-08-11 Bernie Solomon <bernard@ugsolutions.com>
+
+ * Makefile.am: build C# if srcdir != builddir
+
+Tue Aug 10 19:23:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * dominators.c, mini.h, mini-x86.c: fix loop alignment with
+ fall-through blocks.
+
+Tue Aug 10 16:18:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: enable loop by default again and include abcrem in -O=all.
+
+2004-08-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * iltests.il: Add some localloc tests.
+
+ * mini.c (mono_method_to_ir): Set stack type of LOCALLOC correctly.
+
+ * inssel-amd64.brg inssel-x86.brg: Set dreg of LOCALLOC correctly.
+ Fixes #62574.
+
+ * inssel-amd64.brg: Add some optimizations.
+
+ * mini-amd64.c (mono_arch_setup_jit_tls_data): Add tls offset detection
+ for gcc-3.4.
+
+ * Makefile.am: Statically link mono against libmono on AMD64.
+
+ * mini-amd64.c inssel-amd64.brg: Optimizations.
+
+2004-08-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (mono_arch_emit_prolog): Optimize lmf saving a bit.
+
+ * tramp-amd64.c: Patch calling code in trampolines.
+
+2004-08-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c: pinvoke struct passing fixes.
+
+2004-08-05 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mini-sparc.c: redo change, make mono_arch_cpu_init call
+ mono_arch_cpu_optimizazions so sparcv9 is initialized when embedded
+
+2004-08-05 Duncan Mak <duncan@ximian.com>
+
+ * mini.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
+ CEE_LDELEM_ANY.
+
+2004-08-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (emit_move_return_value): Move return value for normal
+ calls too.
+
+2004-08-05 Martin Baulig <martin@ximian.com>
+
+ * mini.c (ret_type_to_call_opcode): Don't use a `t' variable for
+ `type->type'; just modify `type' itself when dealing with enums
+ and generic instances.
+ (check_call_signature): Make `simple_type' a `MonoType *'.
+
+2004-08-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Use OP_PADD to add offsets to addresses.
+
+ * mini-amd64.h: Disable SIGSEGV_ON_ALTSTACK.
+
+2004-08-04 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mini-sparc.c (mono_arch_emit_epilog): fix check
+ for folding last op into restore instruction
+
+2004-08-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-amd64.c (mono_arch_get_throw_exception_by_name): Allocate
+ helper methods using the code manager.
+
+ * exceptions-amd64.c (mono_arch_get_throw_exception): Fix maximum length.
+
+ * mini-amd64.c (mono_arch_allocate_vars): Fix tls offset detection.
+
+Tue Aug 3 23:50:00 EST 2004 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * mini-s390x.c mini-s390x.h tramp-s390x.c inssel-s390x.brg
+ cpu-s390x.md exceptions-s390x.c Makefile.am: S/390 64-bit JIT
+
+ * mini-s390.c: fix tail processing
+
+Tue Aug 3 01:35:44 PDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: mul.ovf.un exception name fix.
+
+2004-08-03 Martin Baulig <martin@ximian.com>
+
+ * mini-x86.c (mono_arch_call_opcode): Correctly handle generic
+ instances; before jumping to `handle_enum', also modify `ptype'.
+
+2004-08-02 Bernie Solomon <bernard@ugsolutions.com>
+
+ * cpu-sparc.md: fcall maximal length too small.
+
+2004-08-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c mini.h: Add initial support for passing/returning
+ structures to/from pinvoked methods.
+
+Mon Aug 2 11:59:35 PDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: reg allocator fix.
+
+2004-07-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c (mono_arch_output_basic_block): Fix OP_X86_PUSH_OBJ.
+
+ * inssel.brg: Optimize memset on 64 bit machines.
+
+ * mini-amd64.c: Fix some vararg cases.
+
+2004-07-30 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * mini-s390.c: Corrected macro in emit_float_to_int
+
+ * s390-abi.cs: Tests to exercise the s390 ABI
+
+2004-07-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-amd64.c (mono_arch_find_jit_info): Fix restoring of
+ caller saved regs.
+
+ * basic.cs: Add a test for add.ovf.un.
+
+2004-07-30 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mini-sparc.c: add case for OP_IDIV_UN
+
+2004-07-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-amd64.c mini-amd64.h mini.c: Add support for vararg pinvoke calls.
+
+ * mini-amd64.c cpu-amd64.md: Ongoing JIT work.
+
+2004-07-30 Ben Maurer <bmaurer@ximian.com>
+
+ * basic.cs: regression tests.
+
+ * inssel-x86.brg: Disable cmp BYTE PTR [eax], imm, it causes various
+ regressions.
+
+2004-07-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * basic.cs: Add a new test.
+
+ * mini-amd64.c aot.c cpu-amd64.md: Add support for tracing, profiling
+ and AOT. Various fixes and optimizations.
+
+ * inssel.brg (CALL_REG): Add 64 bit versions of call_reg rules.
+
+Fri Jul 30 15:49:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: make sure temp regs are not used for global reg
+ allocation.
+
+2004-07-29 Bernie Solomon <bernard@ugsolutions.com>
+
+ * cpu-sparc.md: conv_i8 fix for 64bits
+
+ * mini-sparc.c: add cases for OP_IXXX codes for 64bits
+
+2004-07-29 Ben Maurer <bmaurer@ximian.com>
+
+ * cpu-pentium.md, mini-x86.c, inssel-x86.brg, mini-ops.h:
+ add opcode for cmp BYTE PTR [eax], imm.
+
+ * inssel.brg: Make memcpy and memset takes bases.
+
+2004-07-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * *-amd64.*: More AMD64 work.
+
+2004-07-28 Ben Maurer <bmaurer@ximian.com>
+
+ * cpu-pentium.md, inssel-x86.brg, mini-ops.h, mini-x86.c:
+ add a compare-not-equal opcode.
+
+2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
+
+ * mini.c: Use mono_init_from_assembly instead of mono_init.
+
+2004-07-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Fix opcode mapping for STACK_MP on 64 bit platforms.
+
+ * mini.c (CEE_NEWOBJ): Call mono_array_new_va using the correct signature.
+
+ * mini.c: Use MONO_ARCH_SIGACTION on AMD64 as well.
+
+ * inssel.brg: 64 bit fixes.
+
+ * mini.h (MonoCallInst): Add some AMD64 specific data.
+
+ * mini.h: Add some OP_P opcodes.
+
+2004-07-28 Ben Maurer <bmaurer@ximian.com>
+
+ * basic.cs: tests for 61797 and 61740
+
+Tue Jul 27 16:05:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, mini-sparc.c, mini-s390.c: keep track of line
+ numbers in the debug info (spotted by Geoff Norton, <gnorton@customerdna.com>).
+
+2004-07-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c (mono_arch_output_basic_block): Add CEE_CONV_U8/I8.
+
+ * *-amd64*.*: Ongoing AMD64 work.
+
+2004-07-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel-long.brg: Implement CONV_I8/CONV_U8 in the backends.
+
+ * *-amd64*: Ongoing AMD64 work.
+
+ * mini-arch.h: Add AMD64 support.
+
+ * mini-sparc.c (mono_arch_is_inst_imm): New arch dependent function.
+
+ * mini.h: Add new arch dependent function mono_arch_is_inst_imm.
+
+ * mini-ops.h: Add new opcodes.
+
+ * Makefile.am: Add AMD64 support.
+
+ * inssel.brg inssel-long32.brg inssel-long.brg: Move mul/div and shift
+ rules into the inssel-long*.brg files.
+
+ * *-amd64.*: Add beginnings of AMD64 backend.
+
+2004-07-22 Ben Maurer <bmaurer@ximian.com>
+
+ * mini.c (print_dfn): commenting out the code that prints
+ the cil. With -O=deadce, this makes -v -v crash.
+
+ * cpu-pentium.md: make checkthis have a length of 2
+
+2004-04-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mini-sparc.h: fix implementations of __builtin
+ functions for Sun compiler for V9.
+
+2004-07-16 Ben Maurer <bmaurer@ximain.com>
+
+ * mini.c: use the new stelem.ref wrapper
+ * exceptions.cs, arrays.cs: new stelem.ref tests
+
+Wed Jul 14 19:08:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, exceptions-ppc.c: cleanups and fixes (the
+ new XSP should work with these changes).
+
+2004-07-14 Ben Maurer <bmaurer@ximain.com>
+
+ * inssel-{long32,x86,}.brg: trivial optimizations.
+
+Mon Jul 12 20:25:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: load value when emitting box operation in
+ constrained calls.
+
+2004-07-12 Ben Maurer <bmaurer@ximian.com>
+
+ * mini-x86.c (OP_CHECK_THIS): cmp DWORD PTR [eax], eax
+ is one byte shorter than cmp DWORD PTR [eax], 0.
+
+Mon Jul 12 17:47:00 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-ppc.brg: arguments on the stack are always
+ relative to the stack pointer (spotted by Neale Ferguson).
+
+2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * exceptions-x86.c: delay appending the method name to the trace until
+ after mono_jit_info_table_find is called, as this gets the real
+ MonoMethod.
+
+2004-07-09 Ben Maurer <bmaurer@ximian.com>
+
+ * aot.c: register roots
+
+2004-07-09 Atsushi Enomoto <atsushi@ximian.com>
+
+ * aot.c : I could just use PLATFORM_WIN32 flag.
+
+2004-07-09 Atsushi Enomoto <atsushi@ximian.com>
+
+ * aot.c : Reverting the previous fix. This time it broke linux build.
+
+2004-07-09 Atsushi Enomoto <atsushi@ximian.com>
+
+ * aot.c : quick cygwin build fix. mkdir() with two args does not exist.
+
+2004-07-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (handle_stack_args): Remove some more debugging code.
+
+ * mini.c (handle_stack_args): Remove debug output left in by mistake.
+
+ * driver.c mini.h aot.c: Allow additional options to be specified with
+ --aot and pass them to mono_compile_assembly.
+
+ * aot.c: Add experimental code to AOT compile all loaded assemblies
+ on demand and save the code into a cache in the filesystem.
+
+ * aot.c: Add support for more wrapper methods.
+
+ * mini.c (handle_stack_args): Handle some corner cases. Fixes
+ 58863.
+
+ * cpu-*.md: Remove removed opcodes.
+
+ * mini.h mini.c: Move JIT icall handling to icall.c. Replace usage of
+ CEE_MONO_PROC<x> with CEE_MONO_ICALL. Move registration of marshalling
+ related icalls to marshal.c.
+
+2004-07-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-ops.h: Add OP_SAVE_LMF and OP_RESTORE_LMF.
+
+ * Makefile.am (EXTRA_DIST): Add inssel-long[32].brg.
+
+ * inssel.brg: Fix warning. Add rules for SAVE_LMF and RESTORE_LMF.
+
+2004-07-06 Ben Maurer <bmaurer@ximian.com>
+ * liveness.c: If liveness is recomputated we need to reset the information
+ for each variable. This way, if the liveness range has been narrowed
+ by optimizations that happened after the last computation, we can return
+ a smaller range.
+
+ For example, if you have
+
+ {
+ int i = 0;
+
+ // Tons of code that does not affect i
+
+ i = foo ();
+ ...
+ }
+
+ i = 0 is dead code and will be removed by SSA. However, when
+ linear scan gets to the code, i will still appear to be live
+ throughout the entire block. This prevents good register allocation.
+
+2004-07-06 Martin Baulig <martin@ximian.com>
+
+ * debug-mini.c (mono_debug_init_method): Allow
+ MONO_WRAPPER_MANAGED_TO_NATIVE wrappers.
+ (mono_debug_add_icall_wrapper): New method.
+
+ * mini.c (mono_icall_get_wrapper): Call mono_debug_add_icall_wrapper().
+
+2004-07-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (optimize_branches): Fix linking of bblocks in branch->branch
+ optimization.
+
+2004-07-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_aot_load_method): Fix loading of debug info.
+
+2004-07-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c: Add logging support.
+
+2004-07-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h: Add prototype for mono_print_method_from_ip.
+
+ * mini.c: 64 bit fixes. Use LCOMPARE for comparing longs.
+
+ * inssel.brg: 64 bit fixes.
+
+ * inssel.brg inssel-long32.brg: Move 32 bit arithmetic rules to
+ inssel-long32.brg.
+
+ * Makefile.am: Add SPARC64 support.
+
+2004-07-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c: Fix alignment problems on 32 bit platforms.
+
+2004-07-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * helpers.c (mono_disassemble_code): Pass -xarch=v9 to assembler on
+ SPARC64.
+
+ * aot.c: Add SPARC64 support. Reorganize patch table to fix alignment
+ problems.
+
+ * mini.h: Bump AOT file version. Some 64 bit fixes.
+
+2004-06-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel-sparc.brg: Add new rule to avoid register moves.
+
+ * inssel.brg: Add ldind_to_load_membase helper function.
+
+2004-06-30 Ben Maurer <bmaurer@ximian.com>
+
+ * mini.c: OffsetToStringData intrinsic.
+
+2004-06-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * ssa.c: Handle OP_LCOMPARE the same as OP_COMPARE.
+
+ * objects.cs exceptions.cs basic.cs basic-long.cs basic-calls.cs: New
+ regression tests.
+
+ * mini-ops.h cpu-sparc.md mini-sparc.h mini-sparc.c exceptions-sparc.c tramp-sparc.c inssel-long.brg: Add SPARC64 support.
+Mon Jun 28 18:05:09 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: reinstated mono_compile_get_interface_var()
+ on x86, too, since the change breaks the Gtk# build there as well.
+
+Fri Jun 25 17:36:28 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: remove loop from the default optimizations: it seems to
+ interact badly with some of the other options (see bug #60613).
+
+2004-06-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c mini-x86.h mini-x86.c: Applied patch from Guenter Feldmann
+ (fld@informatik.uni-bremen.de): Add Solaris x86 support.
+
+Tue Jun 22 21:29:11 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md: small updates to be able to compile
+ vararg-using methods.
+
+2004-06-21 Martin Baulig <martin@ximian.com>
+
+ * mini/mini-exceptions.c
+ (mono_handle_exception): Added `gpointer original_ip' argument.
+ After calling mono_unhandled_exception(), call
+ mono_debugger_unhandled_exception() and if that returns true,
+ restore the context and return.
+
+Mon Jun 21 19:26:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: prefer the use of relative branches so
+ they won't need to be patched in aot code (patch from Patrick Beard).
+
+Mon Jun 21 19:03:18 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * aot.c: patch from Patrick Beard to make the output assembly
+ more correct for the MacOSX assembler. Small tweak to
+ generate sane images on Linux/PPC, too.
+
+Fri Jun 18 18:24:28 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini.h, mini-ppc.c: handle varargs methods with a special
+ case until bug #59509 is fixed (shows up in #60332).
+
+Tue Jun 15 16:36:51 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: make sure the needed wrappers are compiled, too, with
+ precomp.
+
+Mon Jun 14 18:36:08 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: remove NPTL reference in --version output.
+
+Sun Jun 13 17:25:28 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * aot.c: patch from Patrick Beard (pcbeard@mac.com) to
+ generate valid assembly for the Mach-O assembler.
+
+Sun Jun 13 15:59:38 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: don't include abcrem in the all optimization specifier
+ since it slows down jit compilation too much for now.
+
+2004-06-12 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mini.c: use BIGMUL only if both operands have the same signage.
+ * iltests.il: Test for bug 60056. (errors related to signage in
+ BIGMUL).
+
+ r=lupus.
+
+Thu Jun 10 16:06:42 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, aot.c: memory leak fixes.
+
+Tue Jun 8 16:37:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-long32.brg: implemented a few missing ulong cast opcodes.
+
+Tue Jun 8 15:36:30 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: remove the -static hack completely, it links in
+ statically glib as well.
+
+Sat Jun 5 16:32:33 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * iltests.il, mini.c: fixed bug#59580 in branch optimization.
+ * exceptions.cs: make it compile with new mcs/csc.
+
+2004-06-03 Massimiliano Mantione <massi@ximian.com>
+ * cpu-pentium.md basic-float.cs Fixed bug on fpu spills (see bug 54467),
+ and added relevant test case.
+
+Mon May 31 19:41:46 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c revert Zoltan's fix to bug#58863 on ppc, since it causes
+ regressions in gtk-sharp.
+
+2004-05-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs: New regression tests.
+
+ * jit-icalls.c (mono_llmult_ovf): Fix some boundary conditions.
+
+Sat May 29 10:45:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: emit castclass/isinst in their own trees (bug #54209/59057).
+
+2004-05-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.h (MONO_ARCH_NEED_DIV_CHECK): Define this.
+
+ * cpu-sparc.md mini-sparc.c: Add overflow detection to div opcodes.
+
+2004-05-28 Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * mini.c (mono_jit_runtime_invoke): Init class in this
+ method instead of trusting mono_jit_compile_method to
+ do the work (because wrappers can be in object class)
+
+2004-05-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c (mono_arch_output_basic_block): Fix sub.imm.
+
+ * basic-long.cs: New regression test.
+
+Thu May 27 15:50:52 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * cpu-g4.md, mini-ppc.c: fixes to long add/sub ovf opcodes
+ and div/rem checks.
+
+Thu May 27 12:36:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: fix miguel's change to build mono statically against
+ libmono (track build dependencies).
+
+2004-05-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * cfold.c: Some glib versions do not have G_MININT32.
+
+2004-05-26 Massimiliano Mantione <massi@ximian.com>
+
+ * mini-x86.c cpu-pentium.md Makefile.am basic-math.cs: Fixed problem
+ with precision of tan, atan, sin and cos, and implemented related
+ regressions tests (fixes bug 54467, but one new problem appeared and
+ is not fixed yet).
+
+2004-05-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * cfold.c (FOLD_BINOPZ): Avoid division by zero.
+
+ * exceptions.cs: Add test for constant folding && division by zero.
+
+ * driver.c mini.h mini.c mini-x86.c: Revert most of the previous patch
+ since driver.c is in libmono too, so the optimization was useless.
+
+ * driver.c mini.h mini.c mini-x86.c: Moved the mono_lmf_addr TLS
+ variable to driver.c so the compiler can emit more efficient code to
+ access them.
+
+2004-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Makefile.am: don't distribute generated inssel.[ch] files.
+
+2004-05-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_jit_compile_method_with_opt): Really emit icall wrappers
+ into the default appdomain. Fixes #58707.
+
+ * jit-icalls.c: Remove the broken approximation for truncl, doing
+ no conversion is better.
+
+ * mini.c (handle_stack_args): Avoid reusing variables for stack slots.
+ Fixes #58863.
+
+Tue May 25 14:33:56 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ops.h, mini-ppc.c, cpu-g4.md, inssel-ppc.brg: eliminate the use
+ of the mcrxr instruction which is not available on some processors
+ even if it's documented to be. Implement add and sub overflow correctly
+ (still not complete for long unsigned). Speed up icalls a bit.
+
+2004-05-25 13:01 CET Patrik Torstenson <totte@hiddenpeaks.com>
+
+ * mini.c (mono_jit_compile_method_with_opt): Make sure that
+ we run .cctor in the current domain instead of target_domain.
+
+ Fixes bug #58558, .cctor not being called in -O=shared.
+
+Tue May 25 12:46:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.h, jit-icalls.c: added explicit checks for divide by zero.
+
+2004-05-24 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mini-x86.c (EMIT_COND_BRANCH): If an OP_LABEL has an offset
+ which can be done with an imm8, do it that way.
+ (mono_arch_output_basic_block): ditto for a jmp
+ (mono_arch_emit_prolog): Computate maximum offset of a label.
+
+2004-05-24 18:18 CET Patrik Torstenson <totte@hiddenpeaks.com>
+
+ * mini-x86.c (mono_arch_local_regalloc): the reg allocator
+ now tries to allocate prefered physical reg's for virtual
+ regs. This reduces the number of emited spills/loads with
+ 20-30% on our core assemblies.
+
+Mon May 24 18:21:51 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * jit-icalls.c: truncl() is not needed and trunc() is
+ the correct thing to do anyway (bug #58287).
+
+2004-05-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c (mono_arch_flush_icache): Call sync_instruction_memory
+ if available.
+
+Mon May 24 12:49:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: enable loop optimizations by default.
+
+Mon May 24 11:13:46 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-x86.c: fix calc of max loop size when aligning loops start.
+
+2004-05-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * ssa.c (mono_ssa_cprop): Allocate carray dynamically instead of on
+ the stack.
+
+2004-05-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c (mono_arch_output_basic_block): ADD_IMM and SUB_IMM
+ should set carry.
+
+ * basic-long.cs: Add tests for add/subtract of immediates with carry.
+
+ * mini.c exceptions-x86.c: Remove MONO_USE_EXC_TABLES stuff.
+
+ * mini.c (inline_method): Allways inline some wrappers even if the cost
+ is too large. Fixes #58785.
+
+ * mini.c: Add support for MARSHAL_CONV_FTN_DEL.
+
+2004-05-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c exceptions-sparc.c: Applied patch from Mark Crichton
+ (crichton@gimp.org). Beginning of support for sparc/linux.
+
+ * mini-sparc.c: Optimize retrieval of LMF address.
+
+Fri May 21 08:00:12 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: handle alloca in methods with clauses.
+
+Fri May 21 07:35:30 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: cleanups, off-by-one fixes, avoid recursive thunks.
+
+2004-05-20 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * mini.c: Delegate most of the abort signal work to
+ mono_thread_request_interruption, which also handles Stop and Suspend
+ states.
+
+2004-05-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c mini.h: Allow inlining of icall wrappers if the backend
+ supports the save/restore lmf opcodes.
+
+2004-05-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_setup_jit_tls_data): Handle code generated
+ by gcc-3.4 as well.
+
+ * mini-x86.h mini-x86.c tramp-x86.c: Optimize lmf restoring code.
+
+2004-05-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h mini.c (mini_method_compile): Only run abc removal pass on
+ methods which contain array accesses.
+
+ * mini.c (CEE_LDTOKEN): Handle this instruction correctly on bb
+ boundaries. Fixes #58537.
+
+ * iltests.il: Add regression test for #58537.
+
+2004-05-18 Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * mini-x86.c (mono_arch_local_regalloc): Last part of
+ fix for bug #58633 (releasing register to early).
+
+2004-05-18 Miguel de Icaza <miguel@ximian.com>
+
+ * basic-long.cs: Add new regression test.
+
+2004-05-18 Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * mini-x86.c (mono_arch_local_regalloc): Avoid releasing a
+ register too early on the chain.
+
+2004-05-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (create_helper_signature): Use a helper function to reduce
+ the code which needs to be written. Also set the calling convention of
+ icalls on windows. Fixes #57840.
+
+Tue May 18 11:05:18 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, exceptions-x86.c, exceptions-sparc.c, exceptions-s390.c,
+ exceptions-ppc.c: added helper function to get the instruction address
+ from a signal handler context.
+
+2004-05-17 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * helpers.c: use g_get_tmp_dir. Invokes happyness
+ from gonzalo.
+
+2004-05-17 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * helpers.c: Add new env variable to pass args to objdump.
+ Specifically for those of us who love -Mintel. r=miguel, gonzalo.
+
+2004-05-17 Radek Doulik <rodo@ximian.com>
+
+ * Makefile.am (common_sources): added abcremoval.h so it get
+ disted and daily mono packages on go-mono.com will build again
+
+2004-05-17 Massimiliano Mantione <massi@ximian.com>
+
+ * abcremoval.c: Fixed coding style, added copyright header.
+
+ * abcremoval.h: Fixed style and moved prototype to mini.h, added copyright header.
+
+ * mini.h: Added prototype for abc removal main function.
+
+ * build_relations_propagation_table.pl: Added copyright header.
+
+2004-05-16 Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * basic-long.cs: reg test for complex ceq_long bug.
+
+2004-05-16 Patrik Torstensson <totte@hiddenpeaks.com>
+
+ * mini-x86.c (mono_arch_local_regalloc): Correctly free
+ reg in long and clob case (bug #58343). Fixed/added comments.
+
+2004-05-14 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mini.c (mono_jit_runtime_invoke): Follow new convention
+ of calling the invoke method with an function pointer.
+
+2004-05-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * ChangeLog: Fix author of memory leak patch.
+
+Fri May 14 15:13:06 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: fix make dist as well...
+
+
+2004-05-14 Massimiliano Mantione <massi@ximian.com>
+
+ * cfold.c: Made so that conversions from pointer to int4 are no-ops
+ on archs where pointers are 4 bytes long.
+
+ * Makefile.am: Added abcremoval.c source file.
+
+ * abcremoval.c: Added abcremoval.c.
+
+ * abcremoval.h: Added abcremoval.h.
+
+ * build_relations_propagation_table.pl: Added build_relations_propagation_table.pl.
+
+ * inssel.brg: Enabled bounds check removal.
+
+ * mini.c: Added support for abcrem optimization.
+
+ * mini.h: Added abcrem optimization label.
+
+ * driver.c: Added support for abcrem optimization.
+
+ * propagated_relations_table.def: Added propagated_relations_table.def.
+
+Fri May 14 14:30:13 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, cfold.c: fix style.
+
+Fri May 14 14:28:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: handle issue with the low-level implementation of
+ some long opcodes (bug #54209).
+
+2004-05-13 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * basic.cs: test for my new cmov stuff.
+
+2004-05-13 Patrik Torstensson
+
+ * mini-x86.c: added OP_X86_COMPARE_MEMBASE_IMM peephole
+ opt and added peephole documentation.
+
+Thu May 13 11:41:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * tramp-ppc.c: rewrote the generic trampoline code.
+
+2004-05-11 Patrik Torstensson
+
+ * mini-x86.c: optimize long shl/shr asm code (one less branch)
+
+2004-05-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * basic.cs basic-long.cs objects.cs: Make these compile under MS csc.
+
+ * mini.h mini.c dominators.c: Applied patch from Derek Woo
+ (derek@eecg.toronto.edu): Fix memory leaks in loop optimizations.
+
+ * mini.c: Add new icalls for AsAny marshalling.
+
+Tue May 11 16:00:38 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * tramp-ppc.c, mini-ppc.c: more cleanups.
+
+2004-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c: no warnings.
+
+Tue May 11 13:59:28 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, mini.c: use mono_resolve_patch_target ().
+
+2004-05-11 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * mini.c: In the thread abort signal handler, if the thread is in the
+ process of being stoped, don't throw the Abort exception, just stop the
+ thread.
+
+Tue May 11 12:15:24 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * tramp-ppc.c: removed old code.
+
+Tue May 11 12:02:28 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini-ppc.c, cfold.c: export mono_is_power_of_two().
+ do some simple speed optimizations on ppc.
+
+Mon May 10 17:21:00 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md: fixes to handle large stack frames
+ and large offsets in load/store.
+
+2004-05-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_local_regalloc): Remove the previous fix, since
+ it causes regressions.
+
+2004-05-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c: Fix vararg support + add beginnings of sigaltstack
+ support.
+
+Fri May 7 13:25:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * jit-icalls.c: remove warnings.
+ * inssel-x86.brg, inssel.brg, mini-x86.c, cfold.c: some simple
+ speedups for unsafe code.
+
+2004-05-07 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * inssel.brg: Optimize Stind.[ui][12]. r=zoltan.
+
+2004-05-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * basic-calls.cs: Add new regression test.
+
+ * mini.c (mono_runtime_install_handlers): Use SA_ONSTACK since it is
+ more portable.
+
+ * mini.c (mono_method_to_ir): Handle opcode emulation for *_OVF opcodes.
+
+ * mini-x86.c (mono_arch_local_regalloc): Free new_dest register when it
+ is no longer used.
+
+2004-05-06 Patrik Torstensson
+
+ * mini-x86.[c|h], inssel-x86.brg, cpu-pentium.md, mini.c: enabled
+ long reg allocation in any reg (not only eax:edx) and implemented
+ long shl/shr ops in asm instead of helpers.
+
+2004-05-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.h: Fix warnings.
+
+ * exceptions-sparc.c (mono_arch_find_jit_info): Pop unused lfm off the
+ stack.
+
+ * mini-exceptions.c (mono_handle_exception): Call the filter in a
+ separate statement for clarity.
+
+ * mini-sparc.c: Update status.
+
+2004-05-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-exceptions.c (ves_icall_get_frame_info): Flush register windows
+ here.
+
+Mon May 3 22:58:51 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-ppc.brg: another small pre-release workaround:
+ we don't do overflow detection for long_sub_un.
+
+Sun May 2 20:12:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini-ops, inssel-long32.brg: speedup ulong >> 32
+ (also works around a weird ppc bug: 57957).
+
+Sat May 1 16:56:10 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * tramp-ppc.c: trampoline fixes.
+
+Fri Apr 30 15:54:26 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: fixed typos.
+
+Thu Apr 29 20:15:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, exceptions-ppc.c: more code saves registers
+ at the top of the stack. Fixed typos. Use a frame registers
+ for all the methods with exception clauses.
+
+Thu Apr 29 18:52:09 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: restore fp registers.
+
+Thu Apr 29 18:26:56 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, exceptions-ppc.c: save the registers in reverse
+ order from the stack top (moved the stack room to save the
+ return value for trace after the param area). Fixed corruption
+ in restoring registers on unwind.
+
+Thu Apr 29 16:47:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md: fixed unisgned -> double conversion.
+
+Thu Apr 29 13:50:51 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c, mini-ppc.h, mini-ppc.c: fixed localloc
+ and prolog/epilog for methods that use it. Allow
+ enough param area room for varargs methods. Fix miguel's
+ breakage in exception handling.
+
+Thu Apr 29 12:06:51 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: run genmdesc only on current arch.
+
+2004-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * exceptions-x86.c:
+ * mini-x86.h: fix the build on windows.
+
+2004-04-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am mini.h mini-exceptions.c mini-x86.h mini-sparc.h exceptions-sparc.c: Move parts of the sparc exception handling code to XP code.
+
+ * exceptions-sparc.c exceptions-ppc.c exceptions-s390.c mini-ppc.h mini-s390.h mini-sparc.h: Fix up ports after changes.
+
+ * mini-exceptions.c: New file.
+
+ * mini.c mini-exceptions.c mini-x86.h exceptions-x86.c Makefile.am:
+ Move some parts of the x86 exception handling code to an
+ arch-independent file so it can be shared with other ports.
+
+Tue Apr 27 12:15:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * trace.c, cpu-g4.md, inssel-ppc.brg, mini-ppc.c: some fixes for FP code.
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * driver.c: remove comma from end of enumeration declaration
+
+2004-04-26 Jackson Harper <jackson@ximian.com>
+
+ * driver.c: parse config file before loading first assembly. This
+ allows the user gac to be enabled/disabled.
+
+2004-04-23 Miguel de Icaza <miguel@ximian.com>
+
+ * mini-ppc.c (ppc_patch): Replaced the branch code patching with a
+ simpler mechanism: we do not care what is encoded initially
+ (branch absolute or relative), we care about the code and its
+ target. I kept the old code for reference for now.
+
+ The new code tries first to determine if the jump is anywhere in
+ the -/+32 absolute meg range, if it succeeds, it encodes using the
+ absolute branch; If not, it tried to find something in the
+ relative range, if not, it uses the handle_thunk code.
+
+Fri Apr 23 14:20:40 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: use the correct ip register on macosx.
+
+Thu Apr 22 13:23:16 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions.c, mini.c, mini-ppc.h: adapt code to macosx.
+
+Thu Apr 22 18:08:37 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md: made the branch macros more flexible.
+ Raise exception on integer divide by zero by hand since the hw
+ doesn't support it. Handle NaNs in FP compares.
+
+Thu Apr 22 16:10:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c, mini-ppc.h, mini.c: simplified some
+ code reducing duplication between the platforms and enabled
+ signal exception handling (on linux for now).
+
+Wed Apr 21 12:27:48 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: more macosx support.
+
+Wed Apr 21 16:38:28 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.h, mini-ppc.c, cpu-g4.md: enable bigmul optimization.
+
+Wed Apr 21 16:20:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini-ppc.c, cpu-g4.md: support for implicit exceptions.
+
+2004-04-19 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * iltests.il: more tests.
+
+2004-04-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-*.c (mono_arch_get_allocatable_int_vars): Skip written-only
+ vars as well.
+
+Mon Apr 19 19:39:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: some fixes to bootstrap mcs/corlib/etc.
+
+2004-04-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * liveness.c: Mark variables as volatile in all basic blocks reachable
+ from exception clauses.
+
+2004-04-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs (test_0_rethow_stacktrace): Make this work with
+ inlining.
+
+2004-04-18 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * iltests.il, basic.cs: more tests for regalloc.
+
+2004-04-17 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * iltests.il: Some tests for register allocation modifications
+ I have locally.
+
+2004-04-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs: Add regression test for bug #56782.
+
+ * exceptions-*.c (mono_arch_handle_exception): Do not overwrite the
+ original stack trace if an exception is rethrown. Fixes #56782. Oh,
+ the beauty of fixing the same thing in 5 different files...
+
+2004-04-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Do not compute coverage for inlined
+ methods.
+
+2004-04-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Add support for STRWLPARRAY marshalling convention.
+
+Wed Apr 14 18:15:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: missing fixes in mono_jit_walk_stack (need
+ to init the context to setup the regs pointer).
+
+Wed Apr 14 17:59:09 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: more exceptions work.
+
+Wed Apr 14 17:46:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: avoid reusing the same MonoInst on multiple trees: this is
+ not allowed.
+
+2004-04-13 Miguel de Icaza <miguel@ximian.com>
+
+ * inssel-x86.brg (reg): Add new rules for add, sub and mul that
+ can use the memory directly.
+
+ * cpu-pentium.md: Update documentation from a post from Zoltan.
+
+ add x86_add_membase, x86_sub_membase, x86_mul_membase
+
+2004-04-13 Miguel de Icaza <miguel@ximian.com>
+
+ * mini-ppc.c: Remove unused definitions FLOAT_REGS and
+ GENERAL_REGS they were also hardcoded for all PPC ports.
+
+ (add_general): Use PPC_NUM_REG_ARGS instead of GENERAL_REGS.
+
+ Remove hard-coded limit for floating point registers, use
+ PPC_LAST_FPARG_REG instead in MONO_TYPE_R4 and MONO_TYPE_R8.
+
+ Notice that in MacOS X calling conventions you can fit a lot more
+ floating point values in registers, so I should update the PInvoke
+ test to excercise the passing of floating point values on the
+ stack (currently broken).
+
+2004-04-06 Miguel de Icaza <miguel@ximian.com>
+
+ * tramp-ppc.c (create_trampoline_code): Added
+ JUMP_TRAMPOLINE_SIZE.
+ (ppc_magic_trampoline): Follow the pattern from
+ x86_magic_trampoline: if code is set to zero, return.
+ (create_trampoline_code): Always pass MonoMethod to the jump
+ trampoline, before it was passing a null.
+ (mono_arch_create_jump_trampoline): Implement the jump stub, could
+ share the code with mono_arch_create_jit_trampoline.
+
+ * mini-ppc.c (mono_arch_output_basic_block): CEE_JMP opcode
+ implemented.
+ (mono_arch_patch_code): MONO_PATCH_INFO_METHOD_JUMP patch type
+ implemented.
+
+ * cpu-g4.md: Added length for jmp instruction, the worst case
+ scenario is 92 bytes (4 mandatory bytes, potential 19 registers
+ for save_lmf).
+
+2004-04-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_compile_assembly): Add back unlink removed by mistake.
+
+2004-04-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Only set bblock->real_offset when adding a new bblock, and
+ before each IL instruction.
+
+ * mini.c (CEE_BOX): Fix warnings.
+
+2004-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c: removed a few unused vars and extra whitespace.
+
+2004-04-05 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * inssel.brg (MONO_EMIT_BOUNDS_CHECK): a new macro to emit bounds
+ checks.
+ (MONO_EMIT_BOUNDS_CHECK_IMM): the above, but when you know the
+ index.
+ (OP_GETCHR): use the above
+ (CEE_LDELEMA): use the above.
+
+ * inseel-x86.brg (MONO_EMIT_BOUNDS_CHECK): a faster and smaller
+ version of the generic impl.
+ (MONO_EMIT_BOUNDS_CHECK_IMM): the same
+ (CEE_LDELEMA): use the above.
+
+2004-04-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel-long32.brg (CEE_CONV_OVF_I8): Sign extend the i4 value to i8.
+ Fixes #56317.
+
+ * iltests.il: Added new regression test for #56317.
+
+2004-04-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_setup_jit_tls_data): Use pthread_attr_get_np
+ under NetBSD. Fixes #56450.
+
+ * liveness.c (update_gen_kill_set): Fix previous patch.
+
+2004-04-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini-x86.h: SA_STACK defined as SA_ONSTACK. Fixed build under NetBSD.
+
+2004-04-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Avoid handle_loaded_temps in
+ ldsfld and ldsflda.
+
+ * inssel-sparc.brg: Add more optimizations.
+
+ * mini-sparc.c: Replace multiply/divide with shifts if possible.
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * mini.c (handle_box): New static function; moved the
+ implementation of CEE_BOX here.
+ (mono_method_to_ir): Added `constrained_call' variable.
+ (mono_method_to_ir:CEE_CONSTRAINED_): Set it.
+ (mono_method_to_ir:CEE_CALL): If `constrained_call' is set, use
+ mono_method_get_constrained() to get the method.
+
+2004-04-01 Martin Baulig <martin@ximian.com>
+
+ * mini.c (TYPE_PARAM_TO_TYPE, TYPE_PARAM_TO_CLASS): Removed.
+ (MTYPE_PARAM_TO_TYPE, MTYPE_PARAM_TO_CLASS): Removed.
+ (mono_method_to_ir): We don't need these macros anymore since
+ mono_class_get_full() already takes care of it.
+
+2004-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * aot.c: set aot_verbose to 0, fixed format string that caused sigsegv,
+ use @function (as doesn't accept #function here) and check the return
+ value of system and stop if fails.
+
+2004-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c: set the timeout to 2s when calling mono_domain_finalize.
+
+2004-03-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-ppc.c (mono_arch_patch_code): Fix ppc build.
+
+ * inssel-sparc.brg mini-sparc.c aot.c: Implement AOT support.
+
+ * inssel-long32.brg (OP_LNEG): Use ADC instead of ADD here. Fixes
+ #56223.
+
+ * basic-long.cs: Add test for negation of Int64.MinValue.
+
+2004-03-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c: Update status.
+
+ * mini-sparc.c tramp-sparc.c: Save lmf in trampolines.
+
+ * exceptions-sparc.c: Fix return value in filters.
+
+ * inssel-sparc.brg: Fix register allocation in some rules.
+
+2004-03-28 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mmono_method_to_ir): In CEE_STELEM, do a handle_stobj()
+ if neccessary.
+
+2004-03-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_patch_code): Fix warnings.
+
+ * mini-x86.c (mono_arch_output_basic_block): Fix CEE_MUL_OVF_UN if
+ dreg is not EAX. Thanks to Willibard Krenn for spotting this. Also
+ remove unused conv_u4 opcode.
+
+ * mini-x86.c: Remove valgrind workaround since it slows down things
+ even when mono is not run under valgrind.
+
+2004-03-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c: Update status.
+
+ * inssel-sparc.brg: Add some optimizations.
+
+ * inssel-sparc.brg mini-sparc.c: Rework branch instructions to allow
+ future delay slot filling. Add support for varargs, tail calls and JMP.
+
+ * inssel.brg mini-ops.h mini.c: Use OP_REFANYTYPE instead of
+ CEE_REFANYTYPE, since CEE_REFANYTYPE needs a prefix to be unique.
+
+ * inssel.brg: Fix register allocation in OP_ARGLIST.
+
+ * inssel.brg: Fix warnings.
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * mini.c (inflate_generic_field): Removed.
+ (mini_get_method): Removed, use mono_get_method_full(),
+ (mini_get_class): Removed, use mono_class_get_full().
+ (mono_method_to_ir): Pass our generic context to
+ mono_field_from_token().
+
+2004-03-25 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mini_get_class): Take a `MonoGenericContext *' instead
+ of a `MonoMethod *'.
+ (mini_get_method): Take a `MonoGenericContext *' instead
+ of a `MonoMethod *'.
+ (TYPE_PARAM_TO_TYPE, MTYPE_PARAM_TO_TYPE): mono_method_to_ir() has
+ a new local variable called `generic_context' which holds the
+ current `MonoGenericContext *'; use it to lookup things.
+
+2004-03-24 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mini_get_class): New static method; if we're inside a
+ generic instance, inflate the class if neccessary.
+ (mono_method_to_ir): Use mini_get_class() instead of mono_class_get().
+
+2004-03-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * iltests.il: New regression test for #55976.
+
+ * mini.c (mono_method_to_ir): Empty the stack in endfinally. Fixes
+ #55976.
+
+2004-03-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-sparc.c (mono_sparc_handle_exception): Remove debugging
+ output.
+
+2004-03-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * liveness.c: Consider SSA stores as well as loads when making vars
+ volatile.
+
+ * exceptions.cs: New regression tests for register allocation.
+
+2004-03-22 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * mini-ppc.c, tramp-ppc.c: Added lock for accessing the domain code manager.
+ * mini.c: Removed domain lock from mono_jit_compile_method_with_opt. Use
+ domain lock only to protect puntual access to data structures.
+ Added access lock for sighash, jit_icall_hash_name,
+ jit_icall_hash_addr and domain->code_mp.
+
+2004-03-20 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c: Print SIGSEGV handling method.
+
+ * mini-x86.c (mono_arch_free_jit_tls_data): Add missing ifdef.
+
+ * mini.c (setup_jit_tls_data): Handle case when this is called
+ multiple times for a thread.
+
+ * mini-x86.c cpu-pentium.md: Fix floating point branch opcodes so fbxx
+ is different from fbxx_un. Fixes #54303. Also use constants instead of
+ magic numbers in a lot of places.
+
+2004-03-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs: Fix cctor test when --regression is used.
+
+Thu Mar 18 19:57:56 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, exceptions-ppc.c: basic exceptions support
+ for Linux/ppc.
+
+Thu Mar 18 19:56:19 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-ppc.brg: fixed register assignments for some rules.
+
+2004-03-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs: Add test for exceptions in static constructors.
+
+ * mini.c (mono_jit_compile_method_with_out): Move the calling of
+ static constructors outside the domain lock. Fixes #55720.
+
+2004-03-17 Martin Baulig <martin@ximian.com>
+
+ * mini.c (get_generic_field_inst): Removed, this'll never happen.
+ (inflate_generic_field): Take the `MonoMethod *' instead of the
+ `MonoClass *' and added support for generic method.
+ (mono_method_to_ir): In CEE_LDSFLD and CEE_STSFLD, assert we never
+ have a `field->parent->gen_params', only inflate the field if it's
+ an open constructed type.
+
+2004-03-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-x86.c (mono_arch_handle_exception): Allocate a new
+ exception object instead of the preconstructed ones.
+
+2004-03-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c: reverted changed to sigsegv_signal_handler commited
+ accidentally in the previous patch.
+
+2004-03-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c:
+ (mono_method_to_ir): CEE_CALLVIRT, abort if no method. It hanged when
+ running --aot with an old assembly.
+
+2004-03-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c (mono_arch_instrument_epilog): Fix handling of floating
+ point values.
+
+ * mini-sparc.c: Add support for v9 branches with prediction.
+
+2004-03-15 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mini.c (mini_init): #warning is GNUC only
+
+ * mini-sparc.h: implement __builtin_frame_address
+ and __builtin_return_address for Sun C compiler
+
+2004-03-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-sparc.c (mono_arch_has_unwind_info): Add missing function.
+
+2004-03-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * basic-calls.cs: Add test for unaligned byref long argument passing.
+
+ * mini-ops.h: Add sparcv9 compare and branch instructions.
+
+ * inssel-sparc.brg mini-sparc.h mini-sparc.c cpu-sparc.md: Use some
+ v9 instructions if we have a v9 cpu.
+
+ * mini-sparc.c (mono_arch_get_global_int_regs): Use unused input
+ registers for global allocation.
+
+ * exceptions-sparc.c: Fixes.
+
+2004-03-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * liveness.c (mono_analyze_liveness): Optimized version.
+
+ * inssel-sparc.brg cpu-sparc.md: Ongoing sparc work.
+
+ * mini-sparc.h mini-sparc.c tramp-sparc.c exceptions-sparc.c: Ongoing
+ sparc work.
+
+ * basic-float.cs basic-calls.cs: New regression tests.
+
+2004-03-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.h: Define SIGSEGV_ON_ALTSTACK only if we have a working
+ sigaltstack implementation.
+
+ * mini-x86.c (mono_arch_setup_jit_tls_data): Fix previous patch.
+
+ * mini-x86.c (mono_arch_setup_jit_tls_data): Turn off the sigaltstack
+ stuff if SIGSEGV_ON_ALTSTACK is not defined.
+
+2004-03-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Fix warnings.
+
+ * mini.c (mono_resolve_patch_target): New function which contains the
+ arch independent part of the patching process.
+
+ * mini-x86.c (mono_arch_patch_code): Move arch independent parts of the
+ patching code to a separate function.
+
+2004-03-09 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mini.c (add_signal_handler): ifdef out on Windows
+
+2004-03-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.h mini-sparc.c inssel-sparc.brg exceptions-sparc.c
+ cpu-sparc.md: Add exception handling support + other fixes.
+
+ * driver.c: Print --help output to stdout. Fixes #55261. Also fix
+ typed GC detection in --version.
+
+ * basic.cs exceptions.cs: New regression tests.
+
+ * mini.h mini-x86.h mini-ppc.h: Add MonoCompileArch structure where
+ the arch specific code can store data during a compilation.
+
+ * mini-ops.h: Add OP_SETFRET.
+
+ * mini.c (mini_get_ldelema_ins): Instead of allways calling the same
+ function, register a separate icall for each arity, so the icalls can
+ get a wrapper.
+
+ * mini.c (mono_print_tree): Print negative offsets in a more readable
+ form.
+
+ * mini.c: Make signal handling work on sparc.
+
+ * mini.c (mini_init): Add emulation for lconv_to_r8_un.
+
+ * inssel-long32.brg: Fix OP_LSUB_OVF_UN rule.
+
+ * jit-icalls.c: Emulate truncl by aintl on solaris.
+
+ * jit-icalls.c (mono_lconv_to_r8_un): New icall emulation function.
+
+2004-03-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mini_init): fconv_to_ovf can raise exceptions.
+
+2004-03-04 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * mini.c: In CEE_ISINST and CEE_CASTCLASS, if the type is an interface or
+ a MarshalByRef type, inline a method that performs the check, taking into
+ account that the object can be a proxy. Also implemented tow new opcodes:
+ CEE_MONO_CISINST and CEE_MONO_CCASTCLASS.
+ * inssel.brg: Implemented two new opcodes, mini-ops.h: OP_CISINST and
+ OP_CCASTCLASS, which implement CEE_MONO_CISINST and CEE_MONO_CCASTCLASS.
+
+Tue Mar 2 17:23:48 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: if a relative branch displacement is too big
+ but it points to and area reachable with an absolute branch,
+ avoid the thunks.
+
+Tue Mar 2 16:59:40 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: optimize small copies in cpblk.
+
+2004-03-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * basic-calls.cs basic-float.cs: New regression tests.
+
+ * mini-sparc.c inssel-sparc.brg mini-ops.h: Access local variables at
+ negative offsets from %fp. Implement localloc. Fix local register
+ allocation. Fix the case when the this argument needs to be saved to
+ the stack. Implement some missing opcodes.
+
+2004-02-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mini_method_compile): Reenable global regalloc in methods
+ with exception handlers.
+
+ * linear-scan.c (mono_varlist_sort): Fix warning.
+
+ * linear-scan.c (mono_linear_scan): Fix computation of used_regs.
+
+ * mini-x86.c (mono_arch_regalloc_cost): Reenable precise computation of
+ regalloc costs.
+
+ * liveness.c: Make all variables uses in exception clauses volatile, to
+ prevent them from being allocated to registers. Fixes #42136.
+
+2004-02-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_regalloc_cost): Revert this change since it
+ causes regressions.
+
+ * mini.h linear-scan.c mini-x86.c mini-sparc.c mini-ppc.c: Add 'cfg'
+ argument to mono_arch_regalloc_cost.
+
+ * mini-x86.c (mono_arch_regalloc_cost): Compute regalloc costs
+ precisely.
+
+2004-02-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h mini-x86.c mini-ppc.c mini-sparc.c linear-scan.c:
+ Make the cost of allocating a variable to a register arch dependent.
+
+ * basic-calls.cs: Fix compilation of tests.
+
+ * mini.h mini.c tramp-x86.c mini-x86.c: Add mono_running_on_valgrind ()
+ helper function to cut back on the number of #ifdefs needed.
+
+ * mini-ppc.c: Fix compilation.
+
+ * basic-calls.cs: New regression tests.
+
+ * mini-sparc.c (mono_sparc_is_virtual_call): New helper function.
+
+ * tramp-sparc.c (create_specific_trampoline): Use g5 register instead
+ of l0 since that is callee saved.
+
+ * tramp-sparc.c (sparc_magic_trampoline): Apply unbox trampoline only
+ to virtual calls.
+
+ * mini-sparc.c: Ongoing work + flag virtual calls with a special kind
+ of delay instruction.
+
+ * inssel.brg (OP_CHECK_THIS): Set tree->sreg1 and dreg correctly.
+
+ * mini.h (MonoCallInst): Add 'virtual' flag.
+
+ * inssel.brg (mini_emit_virtual_call): Set 'virtual' flag.
+
+2004-02-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * *.cs: New regression tests.
+
+ * mini-sparc.c inssel-sparc.brg: Update after latest changes. Ongoing sparc
+ work.
+
+ * mini.c (mono_runtime_install_handlers): Fix build.
+
+ * mini.h (MonoJitTlsData): Add 'stack_size', 'signal_stack' and
+ 'signal_stack_size' members.
+
+ * mini.h mini.c mini-x86.h mini-x86.c: Run sigsegv handlers on an
+ alternate signal stack.
+
+ * exceptions-x86.c: Add stack overflow handling.
+
+ * mini.h mini.c mini-x86.c mini-ppc.c trace.h trace.c: Move tracing
+ functions to arch independent code.
+
+ * mini.c (mono_print_tree): Print more detailed info for load_membase
+ opcodes.
+
+2004-02-23 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mini_get_method): Set `gmethod->generic_inst'.
+
+Sun Feb 22 22:25:19 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-x86.c: fixed reg allocation for div/rem.
+
+2004-02-22 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.c (mono_main): Report some configuratio options on --version.
+
+Fri Feb 20 11:01:44 PST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: fixed clt.un, cgt.un. Optimized calls to functions
+ low in the address space. Correctly flush memory in thunks where we
+ output native code.
+
+2004-02-20 Martin Baulig <martin@ximian.com>
+
+ * mini.c (mini_get_method): New static method; inflate all generic
+ methods and methods in open generic instances.
+ (mono_method_to_ir): Use mini_get_method() instead of mono_get_method().
+ (ret_type_to_call_opcode): Added support for MONO_TYPE_GENERICINST.
+
+2004-02-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-sparc.c (mono_arch_patch_code): Update after domain->code_mp changes.
+
+ * tramp-sparc.c (mono_arch_create_jump_trampoline): Set ji->method.
+
+2004-02-19 Bernie Solomon <bernard@ugsolutions.com>
+
+ * helpers.c (mono_disassemble_code): use Sun's dis if not using gcc
+
+ * mini-sparc.c (flushi mono_arch_output_basic_block): make
+ it compile using Sun's compiler.
+
+2004-02-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-ops.h inssel-sparc.brg cpu-sparc.md mini-sparc.h mini-sparc.c tramp-sparc.c exceptions-sparc.c: Sparc port, part I.
+
+ * basic-calls.cs basic-float.cs basic-long.cs objects.cs: New regression tests.
+
+Tue Feb 17 21:41:20 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * aot.c, mini-x86.c, mini.c: use the code manager instead of a mempool to hold native
+ code.
+ * mini-ppc.c: handle calls outside of the allowed range with thunks
+ allocated using the code manager.
+ * tramp-ppc.c: use the code manager to hold generated native code.
+ Fixed the magic trampoline to just patch vtable entries.
+
+2004-02-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel.brg inssel-x86.brg: Move call(immediate) rules to the platform
+ independent file.
+
+2004-02-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-ppc.c (mono_arch_create_jump_trampoline): Fix compilation on
+ PPC.
+
+ * mini-x86.c: Call mono_arch_get_lmf_addr instead of mono_get_lmf_addr
+ if we have a working __thread implementation.
+
+ * mini-ops.h cpu-pentium.md mini-x86.c inssel-x86.brg: Remove
+ OP_CALL_IMM opcodes, since the CALL opcodes handles immediates as well.
+
+2004-02-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c: Fix compilation under gcc 2.
+
+2004-02-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_codegen): Avoid infinite loop when an icall wrapper
+ contains a call to the wrapped function.
+
+ * mini-ops.h cpu-pentium.md mini-x86.c inssel-x86.brg: Add
+ OP_<CALL>_IMM opcodes, and use them under X86.
+
+ * mini.c (mono_jit_find_compiled_method): Fix warning.
+
+ * cpu-pentium.md: Fix length of opcodes which use x86_alu_membase_imm.
+
+ * jit-icalls.c (mono_ldftn_nosync): New JIT icall.
+
+ * tramp-x86.c (mono_arch_create_jump_trampoline): Move arch independent
+ functionality to mini.c.
+
+ * mini.c (mono_create_jump_trampoline): New function to create a jump
+ trampoline. Return a compiled method instead of a trampoline if it
+ exists. Add a cache for jump trampolines.
+
+ * mini.c (mono_jit_find_compiled_method): New function to return a
+ compiled method if it exists.
+
+ * mini-x86.c: Call mono_create_jump_trampoline instead of
+ mono_arch_create_jit_trampoline.
+
+ * jit-icalls.c (mono_ldftn): Do not compile the method. Instead, return
+ a jump trampoline. Fixes #52092.
+
+2004-02-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * debug-mini.c (mono_init_debugger): Remove call to mono_verify_corlib,
+ which is not up-to-date. Add check_corlib_version () instead.
+
+ * mini.c (mini_init): Call mono_thread_attach () so embedders do not
+ have to call it.
+
+ * mini.c (mono_runtime_install_handlers): Remove check for valgrind
+ since newer valgrind versions do not need it.
+
+ * mini.c (mono_jit_compile_method_with_opt): New helper function to
+ compile a method with a given set of optimizations.
+
+ * mini.c: Compile icall wrappers on-demand instead of at startup.
+
+ * mini-sparc.c mini-ppc.c: Call mono_icall_get_wrapper to obtain the
+ wrapper for an icall.
+
+2004-02-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Handle switch with non-empty stack. Fixes
+ #54063.
+
+ * iltests.il: Add test for non-empty stack before switch instruction.
+
+2004-02-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Add support for new stringbuilder marshalling conventions.
+
+ * mini.c (mono_method_to_ir): Fix stack management of generic CEE_BOX.
+
+2004-02-01 Martin Baulig <martin@ximian.com>
+
+ * mini.c (MTYPE_PARAM_TO_TYPE): Method type arguments are stored
+ in `ginst->mtype_argv'.
+
+2004-01-31 Miguel de Icaza <miguel@ximian.com>
+
+ * mini.c: Add comments, replace CEE_XXX+128 with OP_XXX to
+ facilitate grepping.
+
+Wed Jan 28 14:04:58 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: fixed buglet in initobj generic implementation for references.
+
+Fri Jan 23 16:10:44 EST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: make the version script conditional.
+ * jit-icalls.c: handle missing truncl().
+
+2004-01-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs: Add more tests for double->int conversion.
+
+ * jit-icalls.c (mono_fconv_ovf_i8): Call truncl before comparison, so
+ we don't throw exceptions when converting 1.1 to a long. Fixes #53250.
+
+Fri Jan 23 17:12:08 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: make --verbose --version emit an error
+ if the loaded corlib doesn't match the runtime version.
+
+Mon Jan 19 17:44:50 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.h: export ppc_patch().
+ * mini-ppc.c: call convention fixes. Added assert in ppc_patch().
+ * tramp-ppc.c: call convention fixes: Linux/PPC support should be
+ on par or better than on MacOSX.
+
+2004-01-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c tramp-x86.c tramp-sparc.c: Updated after changes to
+ mono_lookup_pinvoke_call.
+
+ * mini-x86.c: Under windows, the default pinvoke calling convention is
+ stdcall. Fixes #52834.
+
+ * mini.c (optimize_branches): Add an upper bound to the number of
+ iterations to prevent infinite loops on strange loops. Fixes #53003.
+
+2004-01-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel.brg: Add vectors<->one dimensional array checking to CASTCLASS
+ and ISINST. Fixes #52093.
+
+ * objects.cs (test_0_vector_array_cast): New tests.
+
+2004-01-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * jit-icalls.c (helper_stelem_ref_check): New jit icall for array type
+ checking in Array.Set ().
+
+ * mini.c (method_to_ir): Add array type checking in Array.Set (). Fixes
+ #52590.
+
+ * object.cs (test_0_multi_array_cast): New regression test.
+
+Thu Jan 15 16:30:24 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: fix build on Linux/PPC.
+
+2004-01-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-x86.c (x86_magic_trampoline): Disable code patching when
+ running under valgrind.
+ (x86_magic_trampoline): Fix build bustage.
+
+ * debug-mini.c: Modify the debug info serialize/deserialize code so it handles
+ negative values as well. This is needed for the encoding of the line number
+ info, since sometimes the line numbers are not in increasing order.
+
+2004-01-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * cpu-pentium.md (localloc): Increase the size of the localloc
+ instruction since it is a loop under Win32.
+
+ * debug-mini.c (record_line_number): Get rid of unneccesary memory
+ allocation.
+
+2004-01-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-ppc.c exceptions-x86.c exceptions-sparc.c
+ tramp-x86.c tramp-ppc.c tramp-sparc.c: Applied patch from
+ Max Horn (max@quendi.de). Fix file names in comments.
+
+2004-01-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * ssa.c (mono_ssa_rename_vars): Allocate new_stack on the heap to
+ avoid stack overflow.
+ (replace_usage): Avoid uninitialized variable warnings.
+
+ * mini.c (mono_method_to_ir): Avoid disabling SSA for array operations
+ and taking the address of valuetype variables.
+
+2004-01-03 Patrik Torstensson
+
+ * mini-x86.c: renamed fpflags to flags in RegTrack, going to be used
+ for other purposes than FP later on.
+
+2004-01-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Prevent register allocation for arguments
+ of tail calls.
+
+Fri Jan 2 13:37:25 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ops.h, mini.c, inssel.brg: Object.GetType () speedup.
+
+2003-12-30 Patrik Torstensson <p@rxc.se>
+
+ * mini-x86.h: Decreased number of availiable fp regs.
+ Solves corner cases with FP spilling.
+
+2003-12-23 Patrik Torstensson <p@rxc.se>
+
+ * mini-x86.c, mini-ops.h, cpu-pentium.md: Added support
+ for floating point stack tracking / spilling on x86.
+ Fixes bug #49012.
+
+ * basic-float.cs: added float mul overflow test.
+
+2003-12-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Add workaround for bug #51126.
+
+Sun Dec 21 19:53:16 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini-ppc.c, mini-ppc.h: small cleanups and
+ supports for cond branches that overflow the immediate
+ overflow offset. mcs can compile simple programs.
+
+Fri Dec 19 21:17:16 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: exception handling support wip:
+ finally handlers get run on exception.
+
+2003-12-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_aot_get_method_inner): Avoid loading AOT code while
+ profiling.
+
+Fri Dec 19 17:58:28 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * cpu-g4.md, mini-ppc.c, exceptions-ppc.c, mini-ppc.h:
+ initial support for stack walking and unwinding.
+
+2003-12-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c (mono_main): Make corlib-out-of-sync message more
+ descriptive. Also remove verify_corlib call.
+
+Wed Dec 17 15:31:41 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: make CEE_NEWARR calls and other emulated opcodes
+ not overlap with other call's arguments, too.
+
+Wed Dec 17 12:49:23 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini.c, mini-ppc.c, mini-sparc.c, mini-x86.c:
+ move to arch-specific code the choice of arch-specific
+ intrinsics (from Laurent Morichetti (l_m@pacbell.net)).
+ * mini.c: ensure emulation calls will not interleave
+ with other calls.
+
+Wed Dec 17 12:27:26 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * tramp-ppc.c, basic-calls.cs: rework trampolines so that
+ the magic trampoline stack frame is dropped before executing
+ the new method.
+
+Mon Dec 15 18:13:57 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md, inssel-ppc.brg: fixed some opcode lengths
+ and integer to fp conversions. Added support for overflowing
+ arguments on the stack. Reserve a couple more registers as temps.
+ Added support for aot compilation (as output still needs to be
+ tweaked, though).
+
+Sat Dec 13 17:49:10 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, basic-long.cs: fix jumps to known labels.
+ Don't overwrite return register in some corner cases.
+
+2003-12-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h mini.c driver.c mini-x86.c mini-ppc.c aot.c: Do not run
+ static constructors when AOT compiling.
+
+ * driver.c (mono_main): Call mono_check_corlib_version.
+
+Sat Dec 13 10:31:12 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * cpu-g4.md, basic.cs: fixed div target register.
+
+Sat Dec 13 09:45:56 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, basic.cs: shl_imm fix with test.
+
+Fri Dec 12 21:25:14 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-ppc.brg, mini-ppc.h, mini-ppc.c: support for passing
+ structures by value. Misc fixes.
+ * objects.cs: more tests.
+
+Fri Dec 12 10:11:49 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: lconv.ovf.i implemented.
+
+2003-12-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c:
+ (mini_init): don't error out if someone already called g_thread_init.
+
+Tue Dec 9 17:27:14 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-x86.c, exceptions-ppc.c: allow the exception object
+ to be any type per the spec. Fix abnormal memory usage when
+ the same object is repeatedly thrown.
+
+Tue Dec 9 15:39:54 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: check for overruns in IL code.
+
+2003-12-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * TODO: Add/remove some todo entries.
+
+2003-12-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c (mono_main): Call mono_verify_corlib.
+
+2003-12-07 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * inssel.brg: In CEE_ISINST and CEE_CASTCLASS, removed check for proxy.
+ This has been moved to mini.c
+ * mini.c: in mono_method_to_ir, CEE_ISINST and CEE_CASTCLASS cases, if the
+ type being casted is marshalbyref it could be a proxy, so instead of
+ emitting the type check code, emit a call to a runtime method that will
+ perform the check by calling CanCastTo if needed.
+
+2003-12-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_emit_prolog): Fix stack space allocation for
+ methods with large stack frames under Win32.
+
+2003-12-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Distribute regression tests.
+
+ * mini-x86.c (mono_arch_get_allocatable_int_vars): Sort the var list
+ at the end instead of inserting each variable into the sorted list.
+
+ * linear-scan.c (mono_varlist_sort): New helper function.
+
+Wed Dec 3 20:46:28 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: ensure arguments and locals are within bounds.
+
+Wed Dec 3 17:59:10 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md, basic.cs, basic-long.cs: more tests and
+ related fixes.
+
+2003-12-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_cprop_copy_values): Fix crash.
+
+ * aot.c: Set verbosity back to 0.
+
+Wed Dec 3 15:42:27 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * regalloc.c: complete memory leak fix by Laurent Morichetti
+ (l_m@pacbell.net).
+
+2003-12-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c (main_thread_handler): Revert the previous patch.
+
+ * tramp-x86.c (x86_class_init_trampoline): Avoid patching when running
+ under valgrind.
+
+ * mini-x86.c (mono_arch_local_regalloc): Do not allocate transient
+ memory from the memory pool.
+
+ * driver.c (main_thread_handler): Turn on all optimizations when
+ --aot is used.
+
+ * mini.c (mono_find_jit_opcode_emulation): Turn emul_opcode_hash into
+ an array for better performance.
+
+ * regalloc.c (mono_regstate_assign): Fix memory leak.
+
+ * debug-mini.c (mono_debug_serialize_debug_info): New function to
+ serialize the debug info.
+
+ * debug-mini.c (mono_debug_add_aot_method): New function to load the
+ debug info from the serialized representation.
+
+ * aot.c: Save debug info into the generated file and load it when
+ loading a method.
+
+ * mini.h (MONO_AOT_FILE_VERSION): Bump version number.
+
+Mon Dec 1 16:54:05 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, tramp-ppc.c: save FP arguments in the trampoline.
+ More FP-related fixes.
+
+Sun Nov 30 19:13:52 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md, inssel-ppc.brg: fixed finally handlers
+ and register allocation buglet. Hello world now runs.
+
+Fri Nov 28 23:03:05 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * cpu-g4.md, inssel-ppc.brg, mini-ppc.c: better long return support.
+ * tramp-ppc.c: fixed class init trampoline.
+ * inssel-ppc.brg, mini.c, jit-icalls.c, mini-ppc.h: more emulation.
+
+Fri Nov 28 16:36:29 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * cpu-g4.md, inssel-ppc.brg, jit-icalls.c, mini-ppc.c, mini-ppc.h,
+ mini.c: more ppc changes/fixes.
+
+2003-11-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Fix tail calls with valuetype arguments.
+ Also optimize the case when the arguments are the same in the caller
+ and in the callee.
+
+ * iltests.il: Add tests for tail calls with valuetype arguments.
+
+Thu Nov 27 21:06:37 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: fixes for struct return type.
+
+Thu Nov 27 19:02:07 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini.c, mini-x86.c, mini-ppc.c, mini-sparc.c: move
+ mono_spillvar_offset() to arch-specific code.
+
+Thu Nov 27 18:30:42 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.h, mini-ppc.c: handle some different ABI call convention issues.
+
+2003-11-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions-x86.c: Fix stack space leaks.
+
+ * exceptions-x86.c (mono_arch_find_jit_info): Restore callee saved
+ registers from the lmf if the method has save_lmf set.
+
+2003-11-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-x86.c (x86_magic_trampoline): Avoid patching in the addresses
+ of icall wrappers into InvokeInDomain, since these are now per-domain.
+
+Wed Nov 26 20:15:04 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.h, mini-x86.h, mini.c, inssel-ppc.brg, jit-icalls.c:
+ make some opcode emulation and intrinsic ops enabled/disabled
+ according to the architecture. More fixes.
+
+Wed Nov 26 19:59:09 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, mini-sparc.c, cpu-g4.md: more bug fixes.
+
+Wed Nov 26 19:18:29 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, inssel.brg, mini-x86.c, mini-ppc.c, mini-sparc.c: move
+ arch-specific handling for 'this' and struct return type to
+ arch-specific code.
+
+2003-11-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * aot.c: prevent divide by zero error when reporting (it happened with
+ Accessibility.dll).
+
+2003-11-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h (inst_switch): Remove unused macro.
+
+2003-11-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * aot.c:
+ (load_aot_module): free 'info->methods' and 'info' properly. No more
+ "free(): invalid pointer blah" messages when you have an old aot
+ compiled assembly.
+
+2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * jit-icalls.c, mini.c: Added support for context static fields.
+
+2003-11-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_blittable): Methods which set LastError are not
+ blittable either. Fixes #51108.
+
+Tue Nov 18 16:41:37 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: flush icache.
+ * cpu-g4.md, mini-ppc.c, inssel.brg: more fixes. Trace support.
+
+2003-11-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_type_blittable): OBJECT is not blittable. Fixes #47842.
+
+2003-11-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-x86.c (x86_class_init_trampoline): Make code patching thread
+ safe on IA32.
+
+ * mini-x86.c (mono_arch_call_opcode): Disable AOT for methods with
+ vararg calls.
+
+ * inssel.brg (CEE_MKREFANY): Fix AOT case.
+
+2003-11-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_local_regalloc): Fix regalloc for div
+ instruction when the result is discarded.
+
+ * iltests.il (test_0_div_regalloc): New regression test.
+
+ * arrays.cs: Fix compilation error.
+
+Fri Nov 14 21:34:06 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-x86.brg, inssel-float.brg, mini-ops.h: move x86-specific
+ float rules to inssel-x86.brg: sane architectures with FP registers
+ don't need to implement these rules.
+
+Fri Nov 14 20:52:12 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md, inssel-ppc.brg: updates and fixes to the ppc port.
+
+Fri Nov 14 17:58:27 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, inssel-long32.brg: fixed endianess issues in int64
+ implementation of 32 bit systems.
+
+Thu Nov 13 16:14:41 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * exceptions-ppc.c: fix build on Linux/ppc from Jeroen@xs4all.nl
+ (Jeroen Zwartepoorte).
+
+2003-11-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Use CEE_JMP only if the signature of
+ the caller and the callee matches.
+
+ * mini.c (mono_method_to_ir): Add comment.
+
+ * mini-x86.c (mono_arch_output_basic_block): Use mono_signbit, since
+ signbit is missing on some platforms.
+
+2003-11-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h (mono_arch_setup_jit_tls_data): New arch specific function.
+
+ * mini.c (setup_jit_tls_data): Call the new function.
+
+ * mini-x86.c mini-ppc.c mini-sparc.c: Define the new function.
+
+ * mini-x86.c: Add experimental support for fast access to the lmf
+ structure under NPTL/Linux 2.6.x.
+
+2003-11-06 Martin Baulig <martin@ximian.com>
+
+ * ldscript: Make `GC_push_all_stack', `GC_start_blocking',
+ `GC_end_blocking' and 'gc_thread_vtable' public; they're used by
+ the debugger.
+
+2003-11-02 Martin Baulig <martin@ximian.com>
+
+ * mini.c (inflate_generic_field): New static method.
+ (mono_method_to_ir): In CEE_LDFLD and CEE_LDSFLD: if we're a
+ generic instance and the field is declared in a generic type, call
+ inflate_generic_field() to inflate it. Fixes gen-28.cs.
+
+2003-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h mini.c (mono_method_same_domain): New function to return
+ whenever the caller and the callee are in the same domain.
+
+ * tramp-x86.c (x86_magic_trampoline): Use the new function.
+
+2003-10-30 Martin Baulig <martin@ximian.com>
+
+ * mini.c (MTYPE_PARAM_TO_TYPE, MTYPE_PARAM_TO_CLASS): New macros;
+ similar to TYPE_PARAM_TO_TYPE and TYPE_PARAM_TO_CLASS, but for
+ method parameters.
+ (mono_method_to_ir): Added support for MONO_TYPE_MVAR; similar to
+ MONO_TYPE_VAR, we the actual types from MTYPE_PARAM_TO_CLASS().
+
+2003-10-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c mini-ops.h inssel.brg: Implement undeniable exception
+ propagation.
+
+ * mini.c (sigusr1_signal_handler): Move creation of the thread abort
+ object here, so it is in the correct appdomain etc.
+
+2003-10-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_jit_compile_method_inner): Lookup icalls here if not
+ already done.
+ (mono_method_to_ir): Avoid freeing the type created returned from
+ mono_type_create_from_typespec, since it is put into an internal cache
+ by the function. Fixes pointer.exe.
+
+ * mini.c tramp-x86.c tramp-sparc.c tramp-ppc.c: Use the normal
+ trampolines for icalls and pinvokes as well. Fixes #33569.
+
+2003-10-24 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Update after appdomain changes.
+
+ * mini.c (mono_jit_compile_method_inner): Allways compile native
+ method wrappers in the root domain, since there can only be one
+ instance of them, whose address is stored in method->info.
+
+2003-10-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_runtime_install_handlers): Get rid of the MONO_VALGRIND
+ environment variable. Instead detect automatically whenever running
+ under valgrind using the magic macro RUNNING_ON_VALGRIND from
+ valgrind.h.
+
+2003-10-16 Miguel de Icaza <miguel@ximian.com>
+
+ * trace.c, trace.h: New files that implement the new trace option
+ parsing.
+
+ * driver.c: Document new --trace options.
+
+ * exceptions-ppc.c, exceptions-x86.c, mini-ppc.c, mini-sparc.c,
+ mini-x86.c: Apply:
+
+ - if (mono_jit_trace_calls)
+ + if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+
+ * mini.h: prototypes.
+
+2003-10-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Fix initialization of typedbyref locals.
+
+ * mini.c inssel.brg: Implement typedefbyref opcodes.
+
+ * mini.c (mono_jit_compile_method): Remove unused local variable.
+
+ * mini.c (mono_jit_compile_method_inner): Ditto.
+
+2003-10-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-x86.c (x86_class_init_trampoline): Fix build.
+
+ * tramp-x86.c (x86_class_init_trampoline): Thread safety fixes.
+
+2003-10-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_no_aot): Remove unused global variable.
+
+ * mini.c: Thread safety fixes.
+
+2003-10-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_create_class_init_trampoline): Add a lock around
+ class_init_hash_addr.
+
+ * arrays.cs (test_0_newarr_emulation): Add new regression test for
+ #30073.
+
+ * mini.c: Decompose the NEWARR instruction before decomposing its
+ arguments. Fixes #30073.
+
+2003-10-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_emit_epilog): Add support for stdcall calling
+ convention.
+
+2003-10-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_method_to_ir): Allow wrapper data for CEE_LDELEMA.
+
+ * inssel-x86.brg (OP_LOCALLOC): Fix register assignment for localloc.
+
+ * driver.c: Add support for compiling icall wrappers to --compile.
+
+2003-10-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel.brg: The empty value in class->interface_offsets is -1, not
+ 0. Fixes #49287.
+
+2003-10-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * objects.cs: New test for 'is' operator on an array of interfaces.
+
+Wed Oct 1 19:40:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * tramp-ppc.c: update trampoline code to support jumps
+ and class initialization.
+
+2003-09-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_jit_compile_method): Fix reading of freed memory.
+
+ * inssel.brg (OP_UNBOXCAST): Fix #46027.
+
+ * inssel.brg (OP_UNBOX): Remove unused rule.
+
+ * mini.h mini.c inssel-x86.brg: Allocate one SP variable for each
+ region instead of one for each method. Fixes #47813.
+
+2003-09-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * exceptions.cs (test_0_nested_finally): New regression test for
+ nested exception handlers.
+
+ * mini.c (mono_jit_runtime_invoke): Fix for the previous fix.
+
+ * mini.c (mono_method_to_ir): Avoid inlining tail calls.
+
+ * mini.c (mono_method_to_ir): Fix tail recursion in the presence of
+ inlining.
+
+ * mini.c (mono_method_check_inlining): Make the inlining limit
+ configurable by an environment variable.
+
+ * mini.c (mono_jit_runtime_invoke): Add Gonzalo's fix for #36545.
+
+ * mini.h: Bump AOT file version.
+
+ * mini.h mini.c aot.c mini-x86.c: For relocations which refer to a
+ token, store the image along with the token, since the token might not
+ refer to the same image as the method containing the relocation,
+ because of inlining.
+
+2003-09-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_precompile_assemblies): New function to compile
+ all methods in all loaded assemblies.
+
+ * mini.h driver.c: Added new optimization flag MONO_OPT_PRECOMP.
+
+ * regalloc.h regalloc.c (MonoRegState): Change the type of
+ iassign and fassign to int*, since they can contain large negative
+ values if the register is spilled. Also added some comments. Fixes
+ #45817.
+
+ * exceptions-x86.c (seh_handler): Fix handling of system exceptions
+ under Win32. Fixes #42964.
+
+2003-09-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h (MONO_PATCH_INFO_WRAPPER): New patch type.
+
+ * aot.c: Added support for AOT compiling methods which contain calls
+ to wrappers. Currently, only remoting-invoke-with-check wrappers are
+ handled.
+
+ * driver.c (compile_all_methods): Run the compilation in a thread
+ managed by mono. Fixes #44023.
+
+ * mini.c (mono_codegen): Print full method name in verbose output.
+
+ * mini-x86.c (mono_arch_patch_code): Fix warning.
+
+ * mini-x86.c (mono_arch_patch_code): Allways create a trampoline for
+ jumps, since the method we are jumping to might be domain-specific.
+
+ * aot.c: Added support for MONO_PATCH_INFO_METHOD_JUMP.
+
+Tue Sep 23 10:50:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel.brg: string chars are unsigned.
+
+2003-09-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * TODO: New todo item.
+
+ * tramp-x86.c (x86_class_init_trampoline): New trampoline function
+ which calls mono_runtime_class_init and patches the call site to
+ avoid further calls.
+ (mono_arch_create_class_init_trampoline): New arch specific function
+ to create a class init trampoline.
+ (create_trampoline_code): Generalized so it can create
+ class init trampolines as well.
+
+ * mini.c (helper_sig_class_init_trampoline): New helper variable.
+ (mono_create_class_init_trampoline): New function to create and cache
+ class init trampolines.
+ (mono_find_class_init_trampoline_by_addr): New function to lookup the
+ vtable given the address of a class init trampoline. Used by the
+ patching process.
+ (mono_codegen): Generate a call to a trampoline instead of
+ mono_runtime_class_init in LDSFLD[A].
+ (mono_codegen): Add relocations for the new trampoline.
+
+ * mini.h mini-x86.c aot.c: Added a new relocation type:
+ MONO_PATCH_INFO_CLASS_INIT.
+
+ * mini.h: Bump AOT version number.
+
+ * aot.c: Create a copy of the loaded code instead of using the original
+ so methods which call each other will be close in memory, improving
+ cache behaviour.
+
+ * exceptions-x86.c (mono_arch_has_unwind_info): Back out the previous
+ patch since it breaks the regression tests.
+
+ * exceptions-x86.c (mono_arch_has_unwind_info): Added explicit check
+ for the register saving instruction sequence since the
+ frame_state_for function in glibc 2.3.2 don't seem to detect it.
+
+2003-09-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * TODO: Fix todo item && remove another.
+
+2003-09-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_patch_code): Fix tail calls broken by a
+ previous checkin.
+
+ * aot.c: Moved the check for MONO_LASTAOT into the initialization
+ function of the module.
+
+ * mini.h mini.c aot.c: Added a new optimization flag OPT_AOT for
+ turning on/off the usage of AOT code. Got rid of mono_no_aot and the
+ --no-aot command line option.
+
+2003-09-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * helpers.c (mono_disassemble_code): Make this work under cygwin. Patch
+ by Bernie Solomon (bernard@ugsolutions.com).
+
+ * inssel.brg: Refactor the interface offset table related code into
+ its separate functions and add support for the AOT case.
+
+2003-09-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_aot_get_method_inner): Fix memory leak.
+
+ * aot.c: Added mono_aot_verbose variable and made all debugging
+ output depend on the value of this variable.
+
+ * aot.c (mono_aot_get_method_inner): Avoid dynamic allocation of
+ method_label and info_label.
+
+ * mini.h mini-x86.c aot.c: Added a new relocation type
+ MONO_PATCH_INFO_IID for klass->interface_id.
+
+ * mini.h mini.c driver.c aot.c: Changed mono_aot_get_method to return
+ the MonoJitInfo structure.
+
+ * mini.c (mono_jit_compile_method): Avoid using non-shared AOT in
+ a non-root appdomain in shared mode.
+
+Tue Sep 9 16:33:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * aot.c: make aot loader less verbose. Remove free of unused variable.
+
+2003-09-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_aot_get_method_inner): Fix MONO_PATCH_INFO_IMAGE.
+
+ * .cvsignore: Added *.dll.
+
+ * mini.c (mono_print_tree_nl): New function callable while debugging.
+
+ * mini.c (mono_print_code): Export this.
+
+ * tramp-x86.c (x86_magic_trampoline): Tell valgrind to recompile the
+ patched code.
+
+2003-09-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h (MonoCompile): Added 'jit_info' field.
+
+ * mini.c (mini_method_compile): Save the generated MonoJitInfo into
+ the cfg structure, since it is needed by the AOT compiler.
+
+ * mini.h (MONO_AOT_FILE_VERSION): Bump version number.
+
+ * aot.c: A major rewrite. Changes include:
+ - save exception tables for methods which have them.
+ - cache failed lookups in aot_get_method () to avoid the (slow) calls
+ to g_module_symbol.
+ - reworked the file format so it is now much smaller and needs
+ fewer relocation entries.
+
+2003-09-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (load_aot_module): Fix build bustage on platforms without
+ Boehm GC.
+
+2003-09-04 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am (INCLUDES): Added $(LIBGC_CFLAGS).
+
+2003-09-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * TODO: Some new optimization ideas.
+
+ * aot.c: Move AOT module loading logic here from mono_assembly_open.
+
+ * aot.c: Save the optimization flags used to compile the code into
+ the AOT module.
+
+ * mini.h mini-x86.c mini.c aot.c: Added new types of relocations to
+ support emitting domain specific code.
+
+ * mini.h mini.c aot.c: Modified the JIT so the generated AOT code is
+ no longer domain neutral. It can be made domain neutral by compiling
+ with --optimize=shared.
+
+ * aot.c (mono_aot_get_method_inner): Allow sharing of AOT methods
+ between appdomains.
+
+ * driver.c mini.h mini.c: New --no-aot debugging option which disables
+ loading of AOT code.
+
+ * inssel-x86.brg: Added missing AOTCONST -> OUTARG_VT rule.
+
+ * tramp-x86.c (x86_magic_trampoline): Avoid patching the calling method
+ if there is no domain neutrality information.
+
+2003-09-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_compile_assembly): Emit a symbol containing the file
+ format version into the generated library.
+
+ * mini-x86.c (mono_arch_patch_code): Do not emit the address of the
+ callee method into the caller since one of them could be shared.
+
+ * mini.h mini-x86.c aot.c: Added two new relocations so throwing
+ system exceptions from AOT code now works.
+
+ * tramp-x86.c (x86_magic_trampoline): Avoid patching the calling
+ method if it is domain neutral and the callee is not.
+
+ * graph.c (cfg_emit_one_loop_level): Fix warning.
+
+2003-08-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * aot.c (mono_compile_assembly): Oops. Remove debugging cruft from
+ last checkin.
+
+2003-08-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mini_init): Call mono_marshal_init () explicitly since it
+ is needed by code which is executed before mono_runtime_init ().
+ Thanks to Bernie Solomon (bernard@ugsolutions.com) for noticing this.
+
+ * mini.c (mono_thread_abort): Fix warning.
+ (mono_jit_compile_method): Call static constructor in the AOT case too.
+
+ * aot.c (mono_compile_assembly): Fix warning.
+
+2003-08-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c: register a SIGINT handler if MONO_DEBUG is defined.
+
+2003-08-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * inssel.brg (OP_UNBOXCAST): Add support for the AOT case.
+
+ * cpu-pentium.md: Fix the length of call opcodes so they include the
+ ESP restoring instruction. Fixes #47968.
+
+2003-08-28 Martin Baulig <martin@ximian.com>
+
+ * mini-x86.c (mono_arch_call_opcode): Added support for
+ MONO_TYPE_GENERICINST.
+
+ * mini.c (check_call_signature): Added support for MONO_TYPE_GENERICINST.
+
+2003-08-27 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (BUILT_SOURCES): Fix compilation on platforms without
+ a JIT. Patch by Bernie Solomon (bernard@ugsolutions.com).
+
+ * mini.c jit-icalls.c tramp-x86.c tramp-ppc.c tramp-sparc.c: Get rid of
+ metadata_section.
+
+2003-08-26 Martin Baulig <martin@ximian.com>
+
+ * mini.c (get_basic_blocks): Added `unsigned char **pos' argument;
+ when reporting an error, set this to the actual error location.
+ (mono_method_to_ir): Report the correct error location if
+ get_basic_blocks() returned an error.
+
+2003-08-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_type_blittable): OBJECT is not blittable.
+ (mono_method_blittable): Methods which have marshalling descriptors
+ are not blittable either. Fixes #47842.
+
+2003-08-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c mini.c: Use an environment variable instead of a global
+ variable. Also fix the build.
+
+ * mini.c (mini_init): Call g_thread_init () to make glib thread-safe.
+ Fixes #47682. Thanks to Laurent Morichetti (l_m@pacbell.net) for
+ reporting this.
+
+ * driver.c mini.c: Added --with-valgrind option to turn off some
+ code which prevents mono from running under valgrind.
+
+ * mini.c (mono_emit_call_args): Fixed warning.
+
+ * mini.c (mono_emulate_opcode): Fixed warning.
+
+Thu Aug 21 19:10:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel.brg: 64bit fixes from Laurent Morichetti <l_m@pacbell.net>.
+ * linear-scan.c, mini-ppc.h, mini-sparc.h, mini-x86.h, mini.h,
+ regalloc.c, regalloc.h: specify available registers in arch-specific
+ code and support floats in the regallocator (patch by Laurent Morichetti
+ <l_m@pacbell.net>)
+
+Wed Aug 20 19:02:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: mono_thread_current() can be called only after
+ mono_runtime_init(): rearrange code to not call it early on.
+
+Wed Aug 20 13:14:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: allocate jump tables in the code mempools.
+
+Wed Aug 20 13:04:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini.h: make sure per-thread data allocated by the jit is
+ freed.
+
+2003-08-10 Miguel de Icaza <miguel@ximian.com>
+
+ * cpu-pentium.md (ldtoken): Change the length for mul.ovf.un from
+ 12 to 16. This fixes bug #47453.
+
+
+Thu Aug 7 15:59:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c: fixed indexed load and unsigned compares.
+
+2003-08-06 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * mini.c: reenabled installation of handler for
+ thread abort signal.
+
+Tue Aug 5 12:21:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * cprop.c, mini-x86.c, cpu-pentium.md: fix buglets spotted
+ by Laurent Morichetti <l_m@pacbell.net>. Disabled local cprop
+ until it's fixed and actually useful.
+
+Mon Aug 4 12:12:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-long32.brg: couple more opcodes implemented.
+
+Thu Jul 31 22:43:02 EDT 2003 Mark Crichton <crichton@gimp.org>
+
+ * mini-sparc.c: Even more opcodes implemeted.
+
+Thu Jul 31 19:36:03 EDT 2003 Mark Crichton <crichton@gimp.org>
+
+ * mini-sparc.c: More opcodes implemented.
+
+Thu Jul 31 15:16:26 EDT 2003 Mark Crichton <crichton@gimp.org>
+
+ * mini-sparc.c: More opcodes implemented.
+
+Wed Jul 30 22:31:02 EDT 2003 Mark Crichton <crichton@gimp.org>
+
+ * inssel-sparc.brg: Add some needed rules. Direct
+ copy from PPC.
+ * Makefile.am: Use inssel-sparc.brg
+ * exceptions-sparc.c: 0xdeadbeef/0xdecafbad to keep
+ an assert happy for now.
+
+Wed Jul 30 20:44:07 EDT 2003 Mark Crichton <crichton@gimp.org>
+
+ * mini-sparc.c: Fixed compile errors.
+ * exceptions-sparc.c: Same. We now produce a mono binary
+ on sparc-linux. Yea.
+
+Wed Jul 30 14:10:12 EDT 2003 Mark Crichton <crichton@gimp.org>
+
+ * mini-sparc.c: Renamed registers. Also some macro cleanups.
+ * exceptions-sparc.c, tramp-sparc.c: Various compile fixes.
+ They compile, but do not work.
+
+Wed Jul 30 17:52:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am, cpu-sparc.md, exceptions-sparc.c, mini-sparc.c,
+ mini-sparc.h, tramp-sparc.c: Beginning of sparc support
+ from Mark Crichton <crichton@gimp.org> and Christopher Taylor
+ (ct@gentoo.org).
+
+Tue Jul 29 12:43:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: more opcodes implemented and better support for generics.
+
+Fri Jul 25 18:51:45 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * cpu-g4.md, cpu-pentium.md: updates for new instructions.
+ * mini.c, mini.h: first cut at generics support: some new instructions
+ added and changed the behaviour of some of the existing ones.
+
+2003-07-21 Miguel de Icaza <miguel@ximian.com>
+
+ * mini.c: Removed definition of metadata_shared mutex here.
+
+Tue Jul 22 15:21:24 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-x86.c: make vararg calls work for instance methods.
+
+Fri Jul 18 19:26:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini.h, mini-x86.c, mini-ppc.c: mono_arch_call_opcode()
+ returns the arguments in a separte list, now.
+
+Fri Jul 18 13:16:18 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * aot.c, mini.c: updates for array type representation changes.
+
+Fri Jul 18 11:28:28 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: register function to perform jit shutdown.
+
+Thu Jul 17 16:02:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: use a faster allocator if possible.
+
+Thu Jul 17 16:00:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * aot.c: some cleanups and portability changes.
+
+Wed Jul 2 11:08:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: use faster allocation for CEE_BOX if possible.
+
+Mon Jun 30 19:16:33 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini-ops.h, inssel.brg, mini-x86.c: optimized access to fields.
+ Moved inlined mempcy code to its own function so that is can be
+ reused. Added an inline memset function as well (optimized initobj).
+ * cpu-pentium.md, inssel-x86.brg: add and use lea_membase.
+
+Fri Jun 27 11:19:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini-ops.h, inssel.brg: optimized a couple of Array methods.
+
+Wed Jun 25 13:19:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini.h, mini.x86.c, mini-ppc.c: added facility so that
+ arch code can setup the cpu for CLR execution, if needed.
+ We use it on x86 to set the precision of FP operations.
+
+Tue Jun 17 19:02:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: disable some optimizations if we can guess they'll cost too
+ much for a given method.
+
+2003-06-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.h mini.c: Rework last patch based on suggestions by Paolo.
+
+2003-06-17 Zoltan Varga <vargaz@freemail.hu>
+ * mini.h mini.c mini-x86.c: Added instruction level coverage
+ info collection support.
+
+Mon Jun 16 18:13:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c, mini-ppc.c, mini-x86.c, mini.c, mini.h: the coverage stuff
+ is now implemented in the profiling API. Get rid of a couple of
+ unnecessary global variables.
+
+2003-06-15 Nick Drochak <ndrochak@gol.com>
+
+ * basic-long.cs: tests for negative values for bigmul, and unsigned.
+ * cpu-g4.md: add op_bigmul and op_bigmul_un
+ * cpu_pentium.md: add op_bigmul_un
+ * inssel-long32.brg: add rule for unsigned bigmul
+ * mini-ops.h: define OP_BIGMUL_UN
+ * mini-x86.c: THE BUG: handle (un)signed properly
+ * mini.c: choose unsigned opcode if needed.
+ This set of patches fixes bug #44291
+
+2003-06-13 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (optimize_branches): improved to handle all kinds of
+ conditional branches.
+
+Wed Jun 11 18:01:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini.h, jit-icalls.c: speedup emulation of opcodes that
+ don't raise exceptions.
+
+Tue Jun 10 19:00:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * tramp-x86.c, tramp-ppc.c, debug-mini.c: move arch-specific code
+ to arch-specific files.
+
+2003-06-09 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am (libs): Added $(LIBGC_LIBS).
+
+Mon Jun 9 20:21:47 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * cpu-pentium.md, mini-x86.c: fix (well, actually implement) OP_TAN
+ and OP_ATAN (fixes bug#44293).
+
+Mon Jun 9 19:00:56 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am, mini-x86.c: rename cpu description array to
+ pentium_desc, since some compilers define the 'pentium' preprocessor
+ symbol.
+
+2003-05-28 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mini_select_instructions): add explicit branch if the
+ following block is not the false target of a conditional branch -
+ we need this with any optimization that reorder or remove bblocks
+
+ * mini.c (optimize_branches): bug fixes
+
+2003-06-06 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_method_to_ir): inline static readonly fields
+
+ * ssa.c (fold_tree): start cfold support for long (very simple
+ cases only)
+
+ * cfold.c (mono_constant_fold_inst): opt. CEE_CONV_I8 (OP_ICONST)
+
+Fri Jun 6 11:41:18 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel.brg: fixed memcpy (bug #44219).
+
+2003-06-05 Dick Porter <dick@ximian.com>
+
+ * driver.c: Set the glib log levels to not abort if g_message
+ recurses.
+
+ g_set_prgname() has to happen before mini_init() so that the
+ process handle gets the info.
+
+Thu Jun 5 20:11:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: add intrins to the default optimizations to get wider
+ exposure.
+
+Wed Jun 4 19:47:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h: some large basic blocks will overflow a 16-bit
+ integers for symbolic registers.
+
+2003-06-04 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini-x86.c (mono_arch_output_basic_block): revert previous fprem changes.
+ (mono_arch_output_basic_block): fix bug 43499
+
+Wed Jun 4 13:13:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: kill duplicated definition of mono_debug_format.
+
+Wed Jun 4 13:09:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-x86.c, arrays.cs: fixed register allocation bug.
+
+2003-06-04 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini-x86.c (mono_arch_output_basic_block): use IEEE compatible fprem1
+
+ * mini.c (mini_get_opcode_for_method): inline IEEERemainder
+
+2003-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c:
+ (print_method_from_ip): also print source location information if
+ available.
+
+2003-06-02 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_find_block_region): bug fix in region code
+ (mini_method_compile): enable removing unreachable code again, but
+ only in methods without exception clauses.
+
+Fri May 30 18:40:24 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini-ops.h, cpu-pentium.md, inssel.brg, mini-x86.c, mini.h:
+ Implemented arglist opcode and handling of TypedReference type.
+ Fixed x86 call convention when a structure is returned.
+ Minimal support for calling static vararg methods.
+
+2003-05-30 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mini_method_compile): always remove unreachable code,
+ because the code in them may be inconsistent (access to dead
+ variables for example).
+
+Thu May 29 11:44:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c, debug-mini.c: warning fixes.
+
+Wed May 28 11:19:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am, jit.h, mini.h: install header for embedding mono.
+
+Tue May 27 17:56:12 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: thread-static fields are registered in mono_class_vtable(),
+ so ensure the function is called before checking for them.
+
+2003-05-27 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (optimize_branches): fix for bug 43586
+
+ * jit-icalls.c (mono_llmult_ovf): added an additional check for
+ overflow (fixes Bug #43639)
+
+Tue May 27 11:33:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, objects.cs: allow the use of stobj for primitive types.
+
+Tue May 27 10:33:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: be less strict about argument checking until we support
+ running the verifier.
+
+2003-05-27 Nick Drochak <ndrochak@gol.com>
+
+ * basic-long.cs: tests for (ulong)int * (ulong)int also
+ * mini.c: use the same trick for (ulong)int * (ulong)int
+
+2003-05-27 Nick Drochak <ndrochak@gol.com>
+
+ * basic-long.cs: add regression test for (long)int * (long)int
+ * cpu-pentium.md: add op_bigmul specification
+ * inssel-long32.brg: add OP_BIGMUL rule
+ * mini-ops.h: add OP_BIGMUL
+ * mini-x86.c: register allocator: handle case where src1 needs to be
+ in EAX.
+ * mini.c: substitute special BIGMUL opcode in the tree for
+ (long)int * (long)int
+
+Mon May 26 20:20:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * jit-icalls.c: call the type ctor on field access if needed.
+
+Mon May 26 15:21:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ops.h, mini.c, inssel.brg, exceptions.cs: validate arguments passed
+ to a method (including results of ldelema, bug#43207).
+
+2003-05-26 Dietmar Maurer <dietmar@ximian.com>
+
+ * graph.c (cfg_emit_one_loop_level): loop over all blocks. use
+ colors to show exception handler blocks.
+
+ * inssel-x86.brg (OP_OUTARG_VT): dont push zero sized structures
+ (fix for pinvoke7.cs).
+
+Mon May 26 12:11:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini.c: ensure correct initialization order for types that
+ require it. Prepare for lazy compilation of jit icall wrappers.
+ Provide a name for opcode emulation to reduce unneeded mallocing.
+
+Fri May 23 16:08:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-x86.c: better register restoring code and profiling
+ support for tail calls.
+
+Fri May 23 15:30:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, driver.c: prepare for leaf methods optimization.
+
+Fri May 23 15:28:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: get targets of branches before converting a method.
+
+2003-05-23 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (optimize_branches): added some experimental code (disbaled)
+
+2003-05-22 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (optimize_branches): fix branch to branch optimization
+
+ * exceptions-x86.c (mono_arch_handle_exception): bug fix.
+
+ * mini-x86.c (mono_arch_output_basic_block): cleanup up exception code
+
+ * inssel-x86.brg: added OP_START_HANDLER, CEE_ENDFINALLY, OP_ENDFILTER
+
+ * mini-x86.c (mono_arch_allocate_vars): only reserve space for lmf
+ if needed.
+
+2003-05-21 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_method_to_ir): call handle_loaded_temps before inlining.
+ enable use of interface variables again.
+
+ * mini-x86.c (mono_arch_get_allocatable_int_vars): dont allocate
+ I1 to registers because there is no simply way to sign extend 8bit
+ quantities in caller saved registers on x86.
+
+ * inssel-float.brg: set costs of some rules to 2 so
+ that monobure always select the arch. specific ones if supplied,
+ regardless of the order we pass the files to monoburg.
+
+Tue May 20 17:19:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini-x86.c: since the magic trampoline for jumps
+ can't patch the code directly, we do it as soon as the
+ method gets compiled.
+
+Tue May 20 16:02:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-x86.c, mini.h: introduce a new patching method
+ to support CEE_JMP and tail calls.
+ * mini.c: obey tail.call. Don't precompile methods target
+ of CEE_JMP.
+ * tramp-x86.c: new trampoline code to handle methods
+ reached through a jump.
+
+2003-05-20 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini-x86.c (mono_arch_get_allocatable_int_vars): allocate 8/16
+ bit values to registers
+
+2003-05-19 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_compile_get_interface_var): share interface
+ variables if possible.
+
+2003-05-16 Martin Baulig <martin@ximian.com>
+
+ * debug-mini.c (mono_init_debugger): New function to initialize
+ the debugger. This is not in the debugger since it needs to
+ access some of mini's internals.
+
+2003-05-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_method_to_ir): inlining fixes/cleanups
+
+Fri May 16 13:27:23 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, mini-opts.h, inssel.brg: inline small memcpy
+ for value type handling.
+
+2003-05-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_method_to_ir): inline LDFLD/STFLD wrappers
+ (mono_method_check_inlining): enable inlining of all kinds of wrappers
+
+2003-05-15 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * mini.c: fixed little bug in CEE_NEWOBJ case when calling
+ the constructor through a proxy.
+
+Thu May 15 17:17:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * jit-icalls.c, inssel.brg: fixes to array element address
+ calculations.
+
+2003-05-15 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini-x86.c (is_regsize_var): allocate pointer to registers
+
+Thu May 15 13:04:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: fixed typo, added intrins to the set of optimizations
+ tested with regressions.
+
+Thu May 15 11:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ops.h, mini.c, inssel.brg: optimize access to 2D arrays.
+ * jit-icalls.c, exceptions.cs: fixed index out of range checks, added
+ test case.
+
+2003-05-14 Dietmar Maurer <dietmar@ximian.com>
+
+ * inssel.brg: remove some common pop instructions without side effects
+
+Wed May 14 12:40:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-x86.brg: fixed thinko in int to double conversions.
+
+Wed May 14 12:01:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, jit-icalls.c: added runtime thread-static variable support.
+
+Tue May 13 22:02:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-long32.brg: two more missing instructions.
+
+2003-05-13 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_emit_call_args): set the cil_code for all arguments
+ if not already set.
+
+2003-05-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini-x86.c (mono_arch_output_basic_block): Handle negative zero
+ correctly.
+
+ * basic-float.cs: Added tests for negative zero.
+
+Sun May 11 14:56:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-long32.brg, basic-long.cs, exceptions.cs: handle
+ a couple of missing operations for long casts, with test cases.
+
+2003-05-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * exceptions-x86.c: fixed small leaks in mono_arch_handle_exception.
+
+2003-05-09 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini-x86.c (mono_arch_emit_prolog): avoid reallocs with better
+ code size estimation.
+
+2003-05-08 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_jit_create_remoting_trampoline): make it work with
+ abstract methods (fix bug 42542)
+
+ * aot.c: add ability to handle array types
+
+2003-05-08 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c: Call the _specific versions of the object allocation
+ functions if possible.
+
+Tue May 6 17:18:33 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: call setlocale ().
+
+Tue May 6 14:38:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini.c, aot.c, debug-mini.c, exceptions.c: build fixes for
+ windows build.
+
+2003-05-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (optimize_branches): dont touch code inside exception clauses (fix bug 38136)
+
+ * exceptions-x86.c (ves_icall_get_frame_info): also skip remoting
+ wrappers (fix bug 42122)
+
+2003-05-04 Martin Baulig <martin@ximian.com>
+
+ * mini.h (mono_jit_init, mono_jit_cleanup): Added prototypes.
+
+ * driver.c: s/MONO_OPT_SAHRED/MONO_OPT_SHARED/g.
+ s/mini_set_defaults/mono_set_defaults/g.
+
+2003-05-04 Martin Baulig <martin@ximian.com>
+
+ * driver.c: s/mini_parse_default_optimizations/mono_parse_default_optimizations/g.
+
+Sun May 4 11:48:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-long32.brg: add missing lreg: OP_LCONV_TO_U8 (lreg) rule
+ (reported by Don Roberts).
+
+Fri May 2 18:36:45 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: temporarily work around two bugs for this release.
+
+Fri May 2 17:37:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: avoid linking libmono with GMODULE_LIBS, because
+ that contains -export-dynamic and it makes using the ld script
+ useless.
+ * mini.h, main.c, driver.c: s/mini_main/mono_main/g.
+
+Fri May 2 12:52:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini-x86.c, driver.c: disable optimizations not available on a
+ specific cpu.
+
+Thu May 1 15:28:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: make sure leave calls all the needed finally blocks,
+ even when the target jumps out of multiple exception clauses.
+
+Thu May 1 15:18:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * ldscript, Makefile.am: add linker script to reduce the number of
+ exported symbols (should also fix the issues with libwine defining
+ some of the same symbols in io-layer).
+
+2003-05-01 Zoltan Varga <vargaz@freemail.hu>
+
+ * driver.c (mini_main): Avoid assertion when no file name is given on
+ the command line.
+
+Wed Apr 30 15:33:11 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: added --version/-V command line option.
+ Added the inline optimization in the regression tests.
+
+Wed Apr 30 15:16:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c, basic-calls.cs: when inlining, save arguments to locals according
+ to the type in the method signature (fixes bug#42134).
+
+Wed Apr 30 12:38:44 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: when inlining, check this is not null only when needed (bug #42135).
+
+Wed Apr 30 11:44:36 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.h, tramp-pcc.c: type fixes from Max Horn <max@quendi.de>.
+
+2003-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * driver.c: fixed bug #42100.
+
+2003-04-29 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_method_to_ir): UNBOX need to CAST objects first
+
+Mon Apr 28 17:03:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: moved most of the code required to do inlining to its own
+ function so it can be reused. Inline also ctors if appropriate.
+
+2003-04-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Link with -export-dynamic so shared libs loaded by
+ the runtime can call mono API functions.
+
+2003-04-27 Martin Baulig <martin@ximian.com>
+
+ * debug-mini.c (mono_debug_init_method): Added
+ `guint32 breakpoint_id' argument; if the method has a breakpoint,
+ send a notification to the debugger.
+
+ * mini.c (mono_method_to_ir): Don't insert a breakpoint if we're
+ running in the Mono Debugger, just pass the breakpoint number to
+ mono_debug_init_method().
+
+ * tramp-x86.c, tramp-ppc.c: Removed the breakpoint trampolines.
+
+Sun Apr 27 13:18:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: allow some more unsafe compares.
+
+Sat Apr 26 11:55:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-x86.c, Makefile.am: make distcheck works (partially from
+ a patch by Richard Lee <r.h.lee@attbi.com>).
+ * regset.c, regset.h: removed, they are unused.
+
+2003-04-25 Dick Porter <dick@ximian.com>
+
+ * driver.c: Usage reports the name as 'mono' not 'mini'
+ * exceptions-x86.c: Build and run on freebsd
+
+Thu Apr 24 17:09:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: install the program with the 'mono' name and
+ the library as libmono instead of mini and libmini.
+
+Thu Apr 24 17:08:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: provide the APIs for the embedding interface of the old jit.
+
+2003-04-23 Dietmar Maurer <dietmar@ximian.com>
+
+ * jit-icalls.c (helper_stelem_ref): impl. (fix bug 41775)
+
+2003-04-23 Martin Baulig <martin@ximian.com>
+
+ * tramp-x86.c, tramp-ppc.c: Reenable the debugger breakpoint interface.
+
+ * driver.c: Added `--debug' command line argument to enable
+ debugging support.
+
+2003-04-23 Martin Baulig <martin@ximian.com>
+
+ * debug.[ch]: Removed. The code is now in
+ ../metadata/mono-debug.[ch] and mono-debug-debugger.[ch].
+
+ * debug-stabs.c, debug-dwarf2.c: Removed; nobody used this for the
+ last six months.
+
+2003-04-22 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_method_to_ir): set the cil_code address (fix bug 41525)
+
+2003-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * mini.c:
+ (mini_cleanup): moved mono_runtime_cleanup call after the call to
+ mono_domain_finalize.
+ (mini_method_compile): use mono_method_profile* if the the option is
+ enabled.
+
+2003-04-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * tramp-x86.c (mono_arch_create_jit_trampoline): Subsitute synchronized
+ methods with their wrapper.
+
+ * tramp-ppc.c (mono_arch_create_jit_trampoline): Subsitute synchronized
+ methods with their wrapper.
+
+ * jit-icalls.c (mono_ldvirtfn): Subsitute synchronized methods with
+ their wrapper.
+
+ * mini.c (mono_method_to_ir): Subsitute synchronized methods with their
+ wrapper.
+
+ * mini.c (mono_method_check_inlining): Avoid inlining synchronized
+ methods.
+
+2003-04-17 Dietmar Maurer <dietmar@ximian.com>
+
+ * exceptions-x86.c (mono_arch_handle_exception): fix for bug 36252
+
+2003-04-16 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mono_compile_create_var): use g_malloc/g_realloc instead
+ of the mempool. This is slightly faster and uses less memory
+
+Wed Apr 16 12:53:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: avoid O(n) allocation for variables.
+
+Tue Apr 15 19:13:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: handle items on the stack after inlining methods.
+
+Tue Apr 15 14:17:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: make the method->opcode optimization dependent
+ on MONO_OPT_INSTRINS and do it lazily.
+
+Tue Apr 15 14:15:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: print overall results at the end of regression run.
+
+Tue Apr 15 11:18:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel.brg: don't overwrite symbolic registers.
+
+Mon Apr 14 17:41:34 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-x86.brg: fix conversion from long to float.
+
+2003-04-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * mini.c (mini_init): use an opcode for get_Chars (OP_GETCHR)
+
+2003-04-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c (mono_type_blittable): MONO_TYPE_OBJECT is blittable.
+
+ * driver.c: Added --print-vtable option as in the old JIT.
+
+Thu Apr 10 17:43:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel-long32.brg, exceptions.cs: fix conversions from long, too.
+
+Thu Apr 10 16:27:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * inssel.brg, basic.cs: fixed checked conversions to byte and short.
+
+2003-04-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * mini.c regalloc.c regalloc.h: Fix memory leak.
+
+2003-04-09 Dietmar Maurer <dietmar@ximian.com>
+
+ * aot.c (mono_aot_get_method): register all used strings
+
+Wed Apr 9 15:22:18 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: always intern strings references with ldstr at compile time.
+
+Tue Apr 8 11:41:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: add BUILT_SOURCES.
+
+Mon Apr 7 16:31:34 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * driver.c: give a better error message when the assembly to execute
+ doesn't have an entry point.
+
+2003-04-07 Dietmar Maurer <dietmar@ximian.com>
+
+ * Makefile.am: added hack for automake
+
+ * mono/mini/mini.c (mono_save_args): always copy arguments to keep
+ correct sematics.
+
+ * mono/mini/ssa.c (mono_ssa_avoid_copies): don't optimize calls
+
+22003-04-07 Martin Baulig <martin@ximian.com>
+
+ * Makefile.am: Added Makefile.am.
+
+ * debugger-main.c: Removed, this is now in the debugger where it
+ belongs.
+
+ * mini.pc.in: Call this package `mini' for the moment.
+
+
+
+
diff --git a/mono/mini/Makefile.am b/mono/mini/Makefile.am
new file mode 100644
index 00000000000..749d36c5c76
--- /dev/null
+++ b/mono/mini/Makefile.am
@@ -0,0 +1,342 @@
+count=100000
+mtest=for_loop
+monodir=$(top_builddir)
+
+# This is needed for automake dependency generation
+if INCLUDED_LIBGC
+libgc_libs=$(monodir)/libgc/libmonogc.la
+libgc_static_libs=$(monodir)/libgc/libmonogc-static.la
+else
+libgc_libs=$(LIBGC_LIBS)
+libgc_static_libs=$(LIBGC_STATIC_LIBS)
+endif
+
+libs= \
+ $(monodir)/mono/metadata/libmonoruntime.la \
+ $(monodir)/mono/metadata/libmetadata.la \
+ $(monodir)/mono/io-layer/libwapi.la \
+ $(monodir)/mono/utils/libmonoutils.la \
+ $(GMODULE_LIBS) \
+ $(GLIB_LIBS) \
+ $(libgc_libs) \
+ $(ICU_LIBS)
+
+static_libs= \
+ $(monodir)/mono/metadata/libmonoruntime-static.la \
+ $(monodir)/mono/metadata/libmetadata-static.la \
+ $(monodir)/mono/io-layer/libwapi.la \
+ $(monodir)/mono/utils/libmonoutils.la \
+ $(GMODULE_LIBS) \
+ $(GLIB_LIBS) \
+ $(libgc_static_libs) \
+ $(ICU_LIBS)
+
+MCS=mcs
+RUNTIME=mono
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ $(LIBGC_CFLAGS) \
+ $(GMODULE_CFLAGS) \
+ $(GLIB_CFLAGS)
+
+if PLATFORM_WIN32
+export HOST_CC
+# The mingw math.h has "extern inline" functions that dont appear in libs, so
+# optimisation is required to actually inline them
+AM_CFLAGS = -O
+endif
+
+# hack for automake to have the same source file in a library and a bin
+genmdesc_CFLAGS = $(AM_CFLAGS)
+
+if NO_VERSION_SCRIPT
+monoldflags=
+else
+monoldflags=-Wl,-version-script=$(srcdir)/ldscript
+endif
+
+if PLATFORM_WIN32
+libmono_la_LDFLAGS=-no-undefined -version-info 1:0:0 $(monoldflags)
+else
+libmono_la_LDFLAGS=$(monoldflags)
+endif
+
+if JIT_SUPPORTED
+bin_PROGRAMS = mono
+
+noinst_PROGRAMS = genmdesc
+
+lib_LTLIBRARIES = libmono.la
+noinst_LTLIBRARIES = libmono-static.la
+endif
+
+mono_SOURCES = \
+ main.c
+
+if AMD64
+# Link libmono into mono statically on platforms where it is possible
+# This leads to higher performance, especially with TLS
+MONO_LIB=libmono-static.la
+else
+if X86
+MONO_LIB=libmono-static.la
+else
+MONO_LIB=libmono.la
+endif
+endif
+
+mono_LDADD = \
+ $(MONO_LIB) \
+ $(GLIB_LIBS) \
+ $(GMODULE_LIBS) -lm \
+ $(ICU_LIBS)
+
+mono_LDFLAGS = \
+ $(static_flags) -export-dynamic $(monoldflags)
+
+genmdesc_SOURCES = \
+ mini.h \
+ genmdesc.c \
+ helpers.c
+
+# Don't link this against libmetadata to speed up rebuilds
+genmdesc_LDADD = \
+ $(monodir)/mono/utils/libmonoutils.la $(monodir)/mono/metadata/opcodes.lo -lm \
+ $(GLIB_LIBS) \
+ $(GMODULE_LIBS)
+
+x86_sources = \
+ mini-exceptions.c \
+ mini-x86.c \
+ mini-x86.h \
+ exceptions-x86.c \
+ tramp-x86.c
+
+amd64_sources = \
+ mini-exceptions.c \
+ mini-amd64.c \
+ mini-amd64.h \
+ exceptions-amd64.c \
+ tramp-amd64.c
+
+ppc_sources = \
+ mini-ppc.c \
+ mini-ppc.h \
+ exceptions-ppc.c \
+ tramp-ppc.c
+
+sparc_sources = \
+ mini-sparc.c \
+ mini-sparc.h \
+ mini-exceptions.c \
+ exceptions-sparc.c \
+ tramp-sparc.c
+
+s390_sources = \
+ mini-s390.c \
+ mini-s390.h \
+ exceptions-s390.c \
+ tramp-s390.c
+
+s390x_sources = \
+ mini-s390x.c \
+ mini-s390x.h \
+ exceptions-s390x.c \
+ tramp-s390x.c
+
+common_sources = \
+ mini.c \
+ mini.h \
+ trace.c \
+ trace.h \
+ mini-ops.h \
+ mini-arch.h \
+ dominators.c \
+ cfold.c \
+ regalloc.c \
+ regalloc.h \
+ helpers.c \
+ liveness.c \
+ ssa.c \
+ abcremoval.c \
+ abcremoval.h \
+ driver.c \
+ debug-mini.c \
+ linear-scan.c \
+ aot.c \
+ graph.c
+
+test_sources = \
+ basic-calls.cs \
+ basic-long.cs \
+ bench.cs \
+ objects.cs \
+ arrays.cs \
+ basic-float.cs \
+ basic-math.cs \
+ basic.cs \
+ exceptions.cs \
+ iltests.il \
+ test.cs
+
+regtests=basic.exe arrays.exe basic-float.exe basic-math.exe basic-long.exe objects.exe basic-calls.exe iltests.exe exceptions.exe bench.exe
+
+common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
+
+if X86
+libmono_la_SOURCES = \
+ $(common_sources) $(x86_sources)
+
+arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
+arch_built=cpu-pentium.h
+endif
+
+if AMD64
+libmono_la_SOURCES = \
+ $(common_sources) $(amd64_sources)
+arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
+arch_built=cpu-amd64.h
+endif
+
+if POWERPC
+libmono_la_SOURCES = \
+ $(common_sources) $(ppc_sources)
+
+arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
+arch_built=cpu-g4.h
+endif
+
+if SPARC
+libmono_la_SOURCES = \
+ $(common_sources) $(sparc_sources)
+
+arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
+arch_built=cpu-sparc.h
+endif
+
+if SPARC64
+libmono_la_SOURCES = \
+ $(common_sources) $(sparc_sources)
+
+arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
+arch_built=cpu-sparc.h
+endif
+
+if S390
+libmono_la_SOURCES = \
+ $(common_sources) $(s390_sources)
+
+arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
+arch_built=cpu-s390.h
+endif
+
+if S390x
+libmono_la_SOURCES = \
+ $(common_sources) $(s390x_sources)
+
+arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
+arch_built=cpu-s390x.h
+endif
+
+nodist_libmono_la_SOURCES = inssel.c inssel.h
+
+libmono_static_la_SOURCES = $(libmono_la_SOURCES)
+nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
+libmono_static_la_LDFLAGS = -static
+libmono_static_la_LIBADD = $(static_libs)
+
+BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
+
+libmonoincludedir = $(includedir)/mono/jit
+
+libmonoinclude_HEADERS = jit.h
+
+libmono_la_LIBADD = \
+ $(libs)
+
+%.exe: %.cs TestDriver.dll
+ $(MCS) /out:$*.exe /unsafe $< /r:TestDriver.dll
+
+%.exe: %.il
+ ilasm /output=$*.exe $<
+
+TestDriver.dll: $(srcdir)/TestDriver.cs
+ $(MCS) /out:TestDriver.dll /target:library $(srcdir)/TestDriver.cs
+
+cpu-pentium.h: cpu-pentium.md genmdesc$(EXEEXT)
+ ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium_desc
+
+cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
+ ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
+
+cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
+ ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
+
+cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
+ ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
+
+cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
+ ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390
+
+cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
+ ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x
+
+inssel.c inssel.h: $(BURGSRC)
+ $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
+
+testi: mono test.exe
+ ./mono -v -v --ncompile 1 --compile Test:$(mtest) test.exe
+
+# ensure the tests are actually correct
+checktests: $(regtests)
+ for i in $(regtests); do $(RUNTIME) $$i; done
+
+rcheck: mono $(regtests)
+ ./mono --regression $(regtests)
+
+aotcheck: mono $(regtests)
+ for i in $(regtests); do ./mono --aot $$i; done
+ ./mono --verbose --regression $(regtests)
+ rm -f *.exe.so
+
+bench: mono test.exe
+ time ./mono --ncompile $(count) --compile Test:$(mtest) test.exe
+
+mbench: test.exe
+ time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
+
+stat1: mono bench.exe
+ ./mono --verbose --statfile stats.pl --regression bench.exe
+ perl viewstat.pl stats.pl
+
+stat2: mono basic.exe
+ ./mono --verbose --statfile stats.pl --regression basic.exe
+ perl viewstat.pl -e stats.pl
+
+stat3: mono bench.exe
+ ./mono --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe
+ perl viewstat.pl stats.pl
+
+docu: mini.sgm
+ docbook2txt mini.sgm
+
+clean:
+ rm -f mono a.out gmon.out *.o test.exe
+
+pkgconfigdir = $(libdir)/pkgconfig
+
+if JIT_SUPPORTED
+BUILT_SOURCES= inssel.c inssel.h $(arch_built)
+endif
+
+CLEANFILES= $(BUILT_SOURCES)
+EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript $(test_sources) \
+ inssel-long.brg inssel-long32.brg \
+ $(x86_sources) inssel-x86.brg cpu-pentium.md \
+ $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
+ $(ppc_sources) inssel-ppc.brg cpu-g4.md \
+ $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
+ $(s390_sources) inssel-s390.brg cpu-s390.md \
+ $(s390x_sources) inssel-s390x.brg cpu-s390x.md
+
diff --git a/mono/mini/README b/mono/mini/README
new file mode 100644
index 00000000000..7a64e0aae0e
--- /dev/null
+++ b/mono/mini/README
@@ -0,0 +1 @@
+Mini is the new JIT compiler for Mono.
diff --git a/mono/mini/TODO b/mono/mini/TODO
new file mode 100644
index 00000000000..a36a9a7da80
--- /dev/null
+++ b/mono/mini/TODO
@@ -0,0 +1,51 @@
+* 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
+* the managed/unmanaged boundary is quite slow:
+ - it calls mono_get_lmf_addr, which calls TlsGetValue, which calls
+ pthread_getspecific (). This means that 3 function calls are needed for
+ each native function call.
+
+* 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.
+
+* the frame_state_for function in glibc 2.3.2 can't correctly decipher the
+ unwind tables generated by gcc 3.3. It allways tells the runtime that not all
+ callee saved registers are saved, even when the icall is marked with
+ MONO_ARCH_SAVE_REGS. This forces the runtime to generate wrapper functions
+ for all icalls, slowing things down greatly.
+
+* 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.
+
diff --git a/mono/mini/TestDriver.cs b/mono/mini/TestDriver.cs
new file mode 100644
index 00000000000..7854bcb2816
--- /dev/null
+++ b/mono/mini/TestDriver.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Reflection;
+
+
+public class TestDriver {
+
+ static public int RunTests (Type type, string[] args) {
+ int failed = 0, ran = 0;
+ int result, expected, elen;
+ int i, j;
+ string name;
+ MethodInfo[] methods;
+ bool do_timings = false;
+ int tms = 0;
+ DateTime start, end = DateTime.Now;
+
+ if (args != null && args.Length > 0) {
+ for (j = 0; j < args.Length; j++) {
+ if (args [j] == "--time") {
+ do_timings = true;
+ string[] new_args = new string [args.Length - 1];
+ for (i = 0; i < j; ++i)
+ new_args [i] = args [i];
+ j++;
+ for (; j < args.Length; ++i, ++j)
+ new_args [i] = args [j];
+ args = new_args;
+ break;
+ }
+ }
+ }
+ methods = type.GetMethods (BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Static);
+ for (i = 0; i < methods.Length; ++i) {
+ name = methods [i].Name;
+ if (!name.StartsWith ("test_"))
+ continue;
+ if (args != null && args.Length > 0) {
+ bool found = false;
+ for (j = 0; j < args.Length; j++) {
+ if (name.EndsWith (args [j])) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ continue;
+ }
+ for (j = 5; j < name.Length; ++j)
+ if (!Char.IsDigit (name [j]))
+ break;
+ expected = Int32.Parse (name.Substring (5, j - 5));
+ start = DateTime.Now;
+ result = (int)methods [i].Invoke (null, null);
+ if (do_timings) {
+ end = DateTime.Now;
+ long tdiff = end.Ticks - start.Ticks;
+ int mdiff = (int)tdiff/10000;
+ tms += mdiff;
+ Console.WriteLine ("{0} took {1} ms", name, mdiff);
+ }
+ ran++;
+ if (result != expected) {
+ failed++;
+ Console.WriteLine ("{0} failed: got {1}, expected {2}", name, result, expected);
+ }
+ }
+
+ if (do_timings) {
+ Console.WriteLine ("Total ms: {0}", tms);
+ }
+ Console.WriteLine ("Regression tests: {0} ran, {1} failed in {2}", ran, failed, type);
+ //Console.WriteLine ("Regression tests: {0} ran, {1} failed in [{2}]{3}", ran, failed, type.Assembly.GetName().Name, type);
+ return failed;
+ }
+ static public int RunTests (Type type) {
+ return RunTests (type, null);
+ }
+}
+
diff --git a/mono/mini/abcremoval.c b/mono/mini/abcremoval.c
new file mode 100644
index 00000000000..d76915db77f
--- /dev/null
+++ b/mono/mini/abcremoval.c
@@ -0,0 +1,1123 @@
+/*
+ * abcremoval.c: Array bounds check removal
+ *
+ * Author:
+ * Massimiliano Mantione (massi@ximian.com)
+ *
+ * (C) 2004 Ximian, Inc. http://www.ximian.com
+ */
+#include <string.h>
+#include <stdio.h>
+
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/mempool.h>
+#include <mono/metadata/opcodes.h>
+
+#include "inssel.h"
+
+#include "abcremoval.h"
+
+extern guint8 mono_burg_arity [];
+
+#define TRACE_ABC_REMOVAL (verbose_level > 2)
+#define REPORT_ABC_REMOVAL (verbose_level > 0)
+
+/*
+ * A little hack for the verbosity level.
+ * The verbosity level is stored in the cfg, but not all functions that must
+ * print something see the cfg, so we store the verbosity level here at the
+ * beginning of the algorithm.
+ * This is not thread safe (does not handle correctly different verbosity
+ * levels in different threads), and is not exact in case of dynamic changes
+ * of the verbosity level...
+ * Anyway, this is not needed, all that can happen is that something more
+ * (or less) is logged, the result is in any case correct.
+ */
+static int verbose_level;
+
+
+#define RELATION_BETWEEN_VALUES(value,related_value) (\
+ ((value) > (related_value))? MONO_GT_RELATION :\
+ (((value) < (related_value))? MONO_LT_RELATION : MONO_EQ_RELATION))
+
+#define MAKE_VALUE_ANY(v) do{\
+ (v).type = MONO_ANY_SUMMARIZED_VALUE;\
+ } while (0)
+
+#define MAKE_VALUE_RELATION_ANY(r) do{\
+ (r)->relation = MONO_ANY_RELATION;\
+ MAKE_VALUE_ANY((r)->related_value);\
+ } while (0)
+
+#define INITIALIZE_VALUE_RELATION(r) do{\
+ MAKE_VALUE_RELATION_ANY((r));\
+ (r)->next = NULL;\
+ } while (0)
+
+#define MONO_NEGATED_RELATION(r) ((~(r))&MONO_ANY_RELATION)
+#define MONO_SYMMETRIC_RELATION(r) (((r)&MONO_EQ_RELATION)|(((r)&MONO_LT_RELATION)<<1)|((r&MONO_GT_RELATION)>>1))
+
+
+
+static void
+print_relation (int relation) {
+ int print_or = 0;
+ printf ("(");
+ if (relation & MONO_LT_RELATION) {
+ printf ("LT");
+ print_or = 1;
+ }
+ if (relation & MONO_EQ_RELATION) {
+ if (print_or) {
+ printf ("|");
+ }
+ printf ("EQ");
+ print_or = 1;
+ }
+ if (relation & MONO_GT_RELATION) {
+ if (print_or) {
+ printf ("|");
+ }
+ printf ("GT");
+ print_or = 1;
+ }
+ printf (")");
+}
+
+static void
+print_summarized_value (MonoSummarizedValue *value) {
+ switch (value->type) {
+ case MONO_ANY_SUMMARIZED_VALUE:
+ printf ("ANY");
+ break;
+ case MONO_CONSTANT_SUMMARIZED_VALUE:
+ printf ("CONSTANT %d", value->value.constant.value);
+ break;
+ case MONO_VARIABLE_SUMMARIZED_VALUE:
+ printf ("VARIABLE %d, delta %d", value->value.variable.variable, value->value.variable.delta);
+ break;
+ case MONO_PHI_SUMMARIZED_VALUE: {
+ int phi;
+ printf ("PHI (");
+ for (phi = 0; phi < value->value.phi.number_of_alternatives; phi++) {
+ if (phi) printf (",");
+ printf ("%d", value->value.phi.phi_alternatives [phi]);
+ }
+ printf (")");
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+static void
+print_summarized_value_relation (MonoSummarizedValueRelation *relation) {
+ printf ("Relation ");
+ print_relation (relation->relation);
+ printf (" with value ");
+ print_summarized_value (&(relation->related_value));
+}
+
+#if 0
+static void
+print_summarized_value_relation_chain (MonoSummarizedValueRelation *relation) {
+ printf ("Relations:\n");
+ while (relation) {
+ print_summarized_value_relation (relation);
+ printf ("\n");
+ relation = relation->next;
+ }
+}
+#endif
+
+static void
+print_evaluation_context_status (MonoRelationsEvaluationStatus status) {
+ if (status == MONO_RELATIONS_EVALUATION_NOT_STARTED) {
+ printf ("EVALUATION_NOT_STARTED");
+ } else {
+ gboolean print_or = FALSE;
+
+ printf ("(");
+ if (status & MONO_RELATIONS_EVALUATION_IN_PROGRESS) {
+ if (print_or) printf ("|");
+ printf ("EVALUATION_IN_PROGRESS");
+ print_or = TRUE;
+ }
+ if (status & MONO_RELATIONS_EVALUATION_COMPLETED) {
+ if (print_or) printf ("|");
+ printf ("EVALUATION_COMPLETED");
+ print_or = TRUE;
+ }
+ if (status & MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_ASCENDING) {
+ if (print_or) printf ("|");
+ printf ("RECURSIVELY_ASCENDING");
+ print_or = TRUE;
+ }
+ if (status & MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_DESCENDING) {
+ if (print_or) printf ("|");
+ printf ("RECURSIVELY_DESCENDING");
+ print_or = TRUE;
+ }
+ if (status & MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_INDEFINITE) {
+ if (print_or) printf ("|");
+ printf ("RECURSIVELY_INDEFINITE");
+ print_or = TRUE;
+ }
+ printf (")");
+ }
+}
+
+
+static void
+print_evaluation_context_ranges (MonoRelationsEvaluationRanges *ranges) {
+ printf ("(ranges: zero [%d,%d], variable [%d,%d])", ranges->zero.lower, ranges->zero.upper, ranges->variable.lower, ranges->variable.upper);
+}
+
+static void
+print_evaluation_context (MonoRelationsEvaluationContext *context) {
+ printf ("Context status: ");
+ print_evaluation_context_status (context->status);
+ if (context->status & (MONO_RELATIONS_EVALUATION_IN_PROGRESS|MONO_RELATIONS_EVALUATION_COMPLETED)) {
+ print_evaluation_context_ranges (&(context->ranges));
+ }
+ printf ("\n");
+}
+
+#if 0
+static void
+print_evaluation_area (MonoVariableRelationsEvaluationArea *area) {
+ int i;
+ printf ("Dump of evaluation area (%d variables):\n", area->cfg->num_varinfo);
+ for (i = 0; i < area->cfg->num_varinfo; i++) {
+ printf ("Variable %d: ", i);
+ print_evaluation_context (&(area->contexts [i]));
+ print_summarized_value_relation_chain (&(area->relations [i]));
+ }
+}
+
+static void
+print_evaluation_area_contexts (MonoVariableRelationsEvaluationArea *area) {
+ int i;
+ printf ("Dump of evaluation area contexts (%d variables):\n", area->cfg->num_varinfo);
+ for (i = 0; i < area->cfg->num_varinfo; i++) {
+ printf ("Variable %d: ", i);
+ print_evaluation_context (&(area->contexts [i]));
+ }
+}
+#endif
+
+/**
+ * Given a MonoInst, if it is a store to a variable return the MonoInst that
+ * represents the stored value.
+ * If anything goes wrong, return NULL.
+ * store: the MonoInst that should be a store
+ * expected_variable_index: the variable where the value should be stored
+ * return: either the stored value, or NULL
+ */
+static MonoInst *
+get_variable_value_from_store_instruction (MonoInst *store, int expected_variable_index) {
+ switch (store->opcode) {
+ case CEE_STIND_REF:
+ case CEE_STIND_I:
+ case CEE_STIND_I4:
+ case CEE_STIND_I1:
+ case CEE_STIND_I2:
+ case CEE_STIND_I8:
+ case CEE_STIND_R4:
+ case CEE_STIND_R8:
+ if (TRACE_ABC_REMOVAL) {
+ printf ("[store instruction found]");
+ }
+ if (store->inst_left->opcode == OP_LOCAL) {
+ int variable_index = store->inst_left->inst_c0;
+ if (TRACE_ABC_REMOVAL) {
+ printf ("[value put in local %d (expected %d)]", variable_index, expected_variable_index);
+ }
+ if (variable_index == expected_variable_index) {
+ return store->inst_right;
+ } else {
+ return NULL;
+ }
+ }
+ else
+ {
+ return NULL;
+ }
+ break;
+ default:
+ return NULL;
+ }
+}
+
+/**
+ * Given a MonoInst representing a value, store it in "summarized" form.
+ * result: the "summarized" value
+ */
+static void
+summarize_value (MonoInst *value, MonoSummarizedValue *result) {
+ switch (value->opcode) {
+ case OP_ICONST:
+ result->type = MONO_CONSTANT_SUMMARIZED_VALUE;
+ result->value.constant.value = value->inst_c0;
+ break;
+ case OP_LOCAL:
+ case OP_ARG:
+ result->type = MONO_VARIABLE_SUMMARIZED_VALUE;
+ result->value.variable.variable = value->inst_c0;
+ result->value.variable.delta = 0;
+ break;
+ case CEE_LDIND_I1:
+ case CEE_LDIND_U1:
+ case CEE_LDIND_I2:
+ case CEE_LDIND_U2:
+ case CEE_LDIND_I4:
+ case CEE_LDIND_U4:
+ case CEE_LDIND_REF:
+ if ((value->inst_left->opcode == OP_LOCAL) || (value->inst_left->opcode == OP_ARG)) {
+ summarize_value (value->inst_left, result);
+ } else {
+ MAKE_VALUE_ANY (*result);
+ }
+ break;
+ case CEE_ADD: {
+ MonoSummarizedValue left_value;
+ MonoSummarizedValue right_value;
+ summarize_value (value->inst_left, &left_value);
+ summarize_value (value->inst_right, &right_value);
+
+ if (left_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) {
+ if (right_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) {
+ result->type = MONO_VARIABLE_SUMMARIZED_VALUE;
+ result->value.variable.variable = left_value.value.variable.variable;
+ result->value.variable.delta = left_value.value.variable.delta + right_value.value.constant.value;
+ } else {
+ MAKE_VALUE_ANY (*result);
+ }
+ } else if (right_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) {
+ if (left_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) {
+ result->type = MONO_VARIABLE_SUMMARIZED_VALUE;
+ result->value.variable.variable = right_value.value.variable.variable;
+ result->value.variable.delta = left_value.value.constant.value + right_value.value.variable.delta;
+ } else {
+ MAKE_VALUE_ANY (*result);
+ }
+ } else if ((right_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) && (left_value.type == MONO_CONSTANT_SUMMARIZED_VALUE)) {
+ /* This should not happen if constant folding has been done */
+ result->type = MONO_CONSTANT_SUMMARIZED_VALUE;
+ result->value.constant.value = left_value.value.constant.value + right_value.value.constant.value;
+ } else {
+ MAKE_VALUE_ANY (*result);
+ }
+ break;
+ }
+ case CEE_SUB: {
+ MonoSummarizedValue left_value;
+ MonoSummarizedValue right_value;
+ summarize_value (value->inst_left, &left_value);
+ summarize_value (value->inst_right, &right_value);
+
+ if (left_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) {
+ if (right_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) {
+ result->type = MONO_VARIABLE_SUMMARIZED_VALUE;
+ result->value.variable.variable = left_value.value.variable.variable;
+ result->value.variable.delta = left_value.value.variable.delta - right_value.value.constant.value;
+ } else {
+ MAKE_VALUE_ANY (*result);
+ }
+ } else if ((right_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) && (left_value.type == MONO_CONSTANT_SUMMARIZED_VALUE)) {
+ /* This should not happen if constant folding has been done */
+ result->type = MONO_CONSTANT_SUMMARIZED_VALUE;
+ result->value.constant.value = left_value.value.constant.value - right_value.value.constant.value;
+ } else {
+ MAKE_VALUE_ANY (*result);
+ }
+ break;
+ }
+ case CEE_NEWARR:
+ summarize_value (value->inst_newa_len, result);
+ break;
+ case CEE_LDLEN:
+ summarize_value (value->inst_left, result);
+ break;
+ case OP_PHI:
+ result->type = MONO_PHI_SUMMARIZED_VALUE;
+ result->value.phi.number_of_alternatives = *(value->inst_phi_args);
+ result->value.phi.phi_alternatives = value->inst_phi_args + 1;
+ break;
+ default:
+ MAKE_VALUE_ANY (*result);
+ }
+}
+
+static MonoValueRelation
+get_relation_from_branch_instruction (int opcode) {
+ switch (opcode) {
+ case CEE_BEQ:
+ return MONO_EQ_RELATION;
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ return MONO_LT_RELATION;
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ return MONO_LE_RELATION;
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ return MONO_GT_RELATION;
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ return MONO_GE_RELATION;
+ case CEE_BNE_UN:
+ return MONO_NE_RELATION;
+ default:
+ return MONO_ANY_RELATION;
+ }
+}
+
+/**
+ * Given a BB, find its entry condition and put its relations in a
+ * "MonoAdditionalVariableRelationsForBB" structure.
+ * bb: the BB
+ * relations: the resulting relations (entry condition of the given BB)
+ */
+static void
+get_relations_from_previous_bb (MonoBasicBlock *bb, MonoAdditionalVariableRelationsForBB *relations) {
+ MonoBasicBlock *in_bb;
+ MonoInst *branch;
+ MonoValueRelation branch_relation;
+ MonoValueRelation symmetric_relation;
+
+ INITIALIZE_VALUE_RELATION (&(relations->relation1.relation));
+ relations->relation1.relation.relation_is_static_definition = FALSE;
+ relations->relation1.insertion_point = NULL;
+ relations->relation1.variable = -1;
+ INITIALIZE_VALUE_RELATION (&(relations->relation2.relation));
+ relations->relation2.relation.relation_is_static_definition = FALSE;
+ relations->relation2.insertion_point = NULL;
+ relations->relation2.variable = -1;
+
+
+ if (bb->in_count == 1) { /* Should write the code to "sum" conditions... */
+ in_bb = bb->in_bb [0];
+ branch = in_bb->last_ins;
+ if (branch == NULL) return;
+ branch_relation = get_relation_from_branch_instruction (branch->opcode);
+ if ((branch_relation != MONO_ANY_RELATION) && (branch->inst_left->opcode == OP_COMPARE)) {
+ MonoSummarizedValue left_value;
+ MonoSummarizedValue right_value;
+ gboolean code_path;
+
+ if (branch->inst_true_bb == bb) {
+ code_path = TRUE;
+ } else if (branch->inst_false_bb == bb) {
+ code_path = FALSE;
+ } else {
+ code_path = TRUE;
+ g_assert_not_reached ();
+ }
+
+ if (!code_path) {
+ branch_relation = MONO_NEGATED_RELATION (branch_relation);
+ }
+ symmetric_relation = MONO_SYMMETRIC_RELATION (branch_relation);
+
+ summarize_value (branch->inst_left->inst_left, &left_value);
+ summarize_value (branch->inst_left->inst_right, &right_value);
+
+ if ((left_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) && ((right_value.type == MONO_VARIABLE_SUMMARIZED_VALUE)||(right_value.type == MONO_CONSTANT_SUMMARIZED_VALUE))) {
+ relations->relation1.variable = left_value.value.variable.variable;
+ relations->relation1.relation.relation = branch_relation;
+ relations->relation1.relation.related_value = right_value;
+ if (right_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) {
+ relations->relation1.relation.related_value.value.constant.value -= left_value.value.variable.delta;
+ } else {
+ relations->relation1.relation.related_value.value.variable.delta -= left_value.value.variable.delta;
+ }
+ }
+ if ((right_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) && ((left_value.type == MONO_VARIABLE_SUMMARIZED_VALUE)||(left_value.type == MONO_CONSTANT_SUMMARIZED_VALUE))) {
+ relations->relation2.variable = right_value.value.variable.variable;
+ relations->relation2.relation.relation = symmetric_relation;
+ relations->relation2.relation.related_value = left_value;
+ if (left_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) {
+ relations->relation2.relation.related_value.value.constant.value -= right_value.value.variable.delta;
+ } else {
+ relations->relation2.relation.related_value.value.variable.delta -= right_value.value.variable.delta;
+ }
+ }
+ }
+ }
+}
+
+
+/**
+ * Add the given relations to the evaluation area.
+ * area: the evaluation area
+ * change: the relations that must be added
+ */
+static void
+apply_change_to_evaluation_area (MonoVariableRelationsEvaluationArea *area, MonoAdditionalVariableRelation *change) {
+ MonoSummarizedValueRelation *base_relation;
+
+ if (change->relation.relation != MONO_ANY_RELATION) {
+ base_relation = &(area->relations [change->variable]);
+ while ((base_relation->next != NULL) && (base_relation->next->relation_is_static_definition)) {
+ base_relation = base_relation->next;
+ }
+ change->insertion_point = base_relation;
+ change->relation.next = base_relation->next;
+ base_relation->next = &(change->relation);
+ }
+}
+
+/**
+ * Remove the given relation from the evaluation area.
+ * change: the relation that must be removed
+ */
+static void
+remove_change_from_evaluation_area (MonoAdditionalVariableRelation *change) {
+ if (change->insertion_point != NULL) {
+ change->insertion_point->next = change->relation.next;
+ change->relation.next = NULL;
+ }
+}
+
+
+static void
+clean_contexts (MonoRelationsEvaluationContext *contexts, int number) {
+ int i;
+ for (i = 0; i < number; i++) {
+ contexts [i].status = MONO_RELATIONS_EVALUATION_NOT_STARTED;
+ }
+}
+
+
+/**
+ * Perform the intersection of a range and a constant value (taking into
+ * account the relation that the value has with the range).
+ * range: the range that will be intersected with the value
+ * value: the value that will be intersected with the range
+ * relation: the relation between the range and the value
+ */
+static void
+intersect_value( MonoRelationsEvaluationRange *range, int value, MonoValueRelation relation ) {
+ switch (relation) {
+ case MONO_NO_RELATION:
+ MONO_MAKE_RELATIONS_EVALUATION_RANGE_IMPOSSIBLE (*range);
+ break;
+ case MONO_ANY_RELATION:
+ break;
+ case MONO_EQ_RELATION:
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, value);
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, value);
+ break;
+ case MONO_NE_RELATION: {
+ /* IMPROVEMENT Figure this out! (ignoring it is safe anyway) */
+ break;
+ }
+ case MONO_LT_RELATION:
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, MONO_UPPER_EVALUATION_RANGE_NOT_EQUAL (value));
+ break;
+ case MONO_LE_RELATION:
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION (range->upper, value);
+ break;
+ case MONO_GT_RELATION:
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, MONO_LOWER_EVALUATION_RANGE_NOT_EQUAL (value));
+ break;
+ case MONO_GE_RELATION:
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION (range->lower, value);
+ break;
+ default:
+ g_assert_not_reached();
+ }
+}
+
+
+/**
+ * Perform the intersection of two pairs of ranges (taking into account the
+ * relation between the ranges and a given delta).
+ * ranges: the ranges that will be intersected
+ * other_ranges the other ranges that will be intersected
+ * delta: the delta between the pairs of ranges
+ * relation: the relation between the pairs of ranges
+ */
+static void
+intersect_ranges( MonoRelationsEvaluationRanges *ranges, MonoRelationsEvaluationRanges *other_ranges, int delta, MonoValueRelation relation ) {
+ if (delta == 0) {
+ switch (relation) {
+ case MONO_NO_RELATION:
+ MONO_MAKE_RELATIONS_EVALUATION_RANGES_IMPOSSIBLE (*ranges);
+ break;
+ case MONO_ANY_RELATION:
+ break;
+ case MONO_EQ_RELATION:
+ MONO_RELATIONS_EVALUATION_RANGES_INTERSECTION (*ranges, *other_ranges);
+ break;
+ case MONO_NE_RELATION: {
+ /* FIXME Figure this out! (ignoring it is safe anyway) */
+ break;
+ }
+ case MONO_LT_RELATION:
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION (ranges->zero.upper, MONO_UPPER_EVALUATION_RANGE_NOT_EQUAL (other_ranges->zero.upper));
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION (ranges->variable.upper, MONO_UPPER_EVALUATION_RANGE_NOT_EQUAL (other_ranges->variable.upper));
+ break;
+ case MONO_LE_RELATION:
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION (ranges->zero.upper, other_ranges->zero.upper);
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION (ranges->variable.upper, other_ranges->variable.upper);
+ break;
+ case MONO_GT_RELATION:
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION (ranges->zero.lower, MONO_LOWER_EVALUATION_RANGE_NOT_EQUAL (other_ranges->zero.lower));
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION (ranges->variable.lower, MONO_LOWER_EVALUATION_RANGE_NOT_EQUAL (other_ranges->variable.lower));
+ break;
+ case MONO_GE_RELATION:
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION (ranges->zero.lower, other_ranges->zero.lower);
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION (ranges->variable.lower, other_ranges->variable.lower);
+ break;
+ default:
+ g_assert_not_reached();
+ }
+ } else {
+ MonoRelationsEvaluationRanges translated_ranges = *other_ranges;
+ MONO_ADD_DELTA_SAFELY_TO_RANGES (translated_ranges, delta);
+ intersect_ranges( ranges, &translated_ranges, FALSE, relation );
+ }
+}
+
+/**
+ * Recursive method that traverses the relation graph to evaluate the
+ * relation between two variables.
+ * At the end of the execution, the resulting ranges are in the context of
+ * the "starting" variable.
+ * area: the current evaluation area (it contains the relation graph and
+ * memory for all the evaluation contexts is already allocated)
+ * variable: starting variable (the value ranges in its context are the result
+ * of the execution of this procedure)
+ * target_variable: the variable with respect to which the starting variable
+ * is evaluated (tipically the starting variable is the index
+ * and the target one is the array (which means its length))
+ * father_context: the previous evaluation context in recursive invocations
+ * (or NULL for the first invocation)
+ */
+static void
+evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *area, int variable, int target_variable, MonoRelationsEvaluationContext *father_context) {
+ MonoRelationsEvaluationContext *context = &(area->contexts [variable]);
+
+ // First of all, we check the evaluation status
+ // (what must be done is *very* different in each case)
+ switch (context->status) {
+ case MONO_RELATIONS_EVALUATION_NOT_STARTED: {
+ MonoSummarizedValueRelation *relation = &(area->relations [variable]);
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Evaluating varible %d (target variable %d)\n", variable, target_variable);
+ print_summarized_value_relation (relation);
+ printf ("\n");
+ }
+
+ // We properly inizialize the context
+ context->status = MONO_RELATIONS_EVALUATION_IN_PROGRESS;
+ context->father = father_context;
+ MONO_MAKE_RELATIONS_EVALUATION_RANGES_WEAK (context->ranges);
+
+ // If we have found the target variable, we can set the range
+ // related to it in the context to "equal" (which is [0,0])
+ if (variable == target_variable) {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Target variable reached (%d), continuing to evaluate relations with constants\n", variable);
+ }
+ context->ranges.variable.lower = 0;
+ context->ranges.variable.upper = 0;
+ }
+
+ // Examine all relations for this variable (scan the list)
+ // The contribute of each relation will be intersected (logical and)
+ while (relation != NULL) {
+ context->current_relation = relation;
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Processing (%d): ", variable);
+ print_summarized_value_relation (relation);
+ printf ("\n");
+ }
+
+ // We decie what to do according the the type of the related value
+ switch (relation->related_value.type) {
+ case MONO_ANY_SUMMARIZED_VALUE:
+ // No added information, skip it
+ break;
+ case MONO_CONSTANT_SUMMARIZED_VALUE:
+ // Intersect range with constant (taking into account the relation)
+ intersect_value (&(context->ranges.zero), relation->related_value.value.constant.value, relation->relation);
+ break;
+ case MONO_VARIABLE_SUMMARIZED_VALUE:
+ // Generally, evaluate related variable and intersect ranges.
+ // However, some check is necessary...
+
+ // If the relation is "ANY", nothing to do (no added information)
+ if (relation->relation != MONO_ANY_RELATION) {
+ gssize related_variable = relation->related_value.value.variable.variable;
+ MonoRelationsEvaluationContext *related_context = &(area->contexts [related_variable]);
+
+ // The second condition in the "or" avoids messing with "back edges" in the graph traversal
+ // (they are simply ignored instead of triggering the handling of recursion)
+ if ( (related_context->status == MONO_RELATIONS_EVALUATION_NOT_STARTED) || !
+ ((related_context->current_relation->related_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) &&
+ (related_context->current_relation->related_value.value.variable.variable == variable))) {
+ // Evaluate the related variable
+ evaluate_relation_with_target_variable (area, related_variable, target_variable, context);
+
+ // Check if we are part of a recursive loop
+ if (context->status & MONO_RELATIONS_EVALUATION_IS_RECURSIVE) {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Recursivity detected for varible %d (target variable %d), status ", variable, target_variable);
+ print_evaluation_context_status (context->status);
+ }
+
+ // If we are, check if the evaluation of the related variable is complete
+ if (related_context->status == MONO_RELATIONS_EVALUATION_COMPLETED) {
+ // If it is complete, we are part of a recursive definition.
+ // Since it is a *definition* (and definitions are evaluated *before*
+ // conditions because they are first in the list), intersection is not
+ // strictly necessary, we simply copy the ranges and apply the delta
+ context->ranges = related_context->ranges;
+ MONO_ADD_DELTA_SAFELY_TO_RANGES (context->ranges, relation->related_value.value.variable.delta);
+ context->status = MONO_RELATIONS_EVALUATION_COMPLETED;
+ if (TRACE_ABC_REMOVAL) {
+ printf (", ranges already computed, result: \n");
+ print_evaluation_context_ranges (&(context->ranges));
+ printf (" (delta is %d)\n", relation->related_value.value.variable.delta);
+ }
+ } else {
+ // If it is not complete, do nothing (we do not have enough information)
+ if (TRACE_ABC_REMOVAL) {
+ printf (", ranges not computed\n");
+ }
+ }
+ } else {
+ // If we are not (the common case) intersect the result
+ intersect_ranges( &(context->ranges), &(related_context->ranges), relation->related_value.value.variable.delta, relation->relation );
+ }
+ } else {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Relation is a back-edge in this traversal, skipping\n");
+ }
+ }
+ }
+ break;
+ case MONO_PHI_SUMMARIZED_VALUE: {
+ // We must compute all PHI alternatives, combining the results (with a union, which is a logical "or"),
+ // and intersect this result with the ranges in the context; we must also take into account recursions
+ // (with loops that can be ascending, descending, or indefinite)
+ MonoRelationsEvaluationRanges phi_ranges;
+ int phi;
+ gboolean is_ascending = FALSE;
+ gboolean is_descending = FALSE;
+
+ MONO_MAKE_RELATIONS_EVALUATION_RANGES_IMPOSSIBLE (phi_ranges);
+ for (phi = 0; phi < relation->related_value.value.phi.number_of_alternatives; phi++) {
+ int phi_alternative = relation->related_value.value.phi.phi_alternatives [phi];
+ evaluate_relation_with_target_variable (area, phi_alternative, target_variable, context);
+
+ // This means we are part of a recursive loop
+ if (context->status & MONO_RELATIONS_EVALUATION_IS_RECURSIVE) {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Recursivity detected for varible %d (target variable %d), status ", variable, target_variable);
+ print_evaluation_context_status (context->status);
+ printf ("\n");
+ }
+ if (context->status & MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_ASCENDING) {
+ is_ascending = TRUE;
+ }
+ if (context->status & MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_DESCENDING) {
+ is_descending = TRUE;
+ }
+ if (context->status & MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_INDEFINITE) {
+ is_ascending = TRUE;
+ is_descending = TRUE;
+ }
+
+ // Clear "recursivity" bits in the status (recursion has been handled)
+ context->status = MONO_RELATIONS_EVALUATION_IN_PROGRESS;
+ } else {
+ MONO_RELATIONS_EVALUATION_RANGES_UNION (phi_ranges, area->contexts [phi_alternative].ranges);
+ }
+ }
+
+ // Apply the effects of all recursive loops
+ if (is_ascending) {
+ phi_ranges.zero.upper = INT_MAX;
+ phi_ranges.variable.upper = INT_MAX;
+ }
+ if (is_descending) {
+ phi_ranges.zero.lower = INT_MIN;
+ phi_ranges.variable.lower = INT_MIN;
+ }
+
+ // Intersect final result
+ MONO_RELATIONS_EVALUATION_RANGES_INTERSECTION (context->ranges, phi_ranges);
+ break;
+ }
+ default:
+ g_assert_not_reached();
+ }
+
+ // Pass to next relation
+ relation = relation->next;
+ }
+
+ // Check if any recursivity bits are still in the status, and in any case clear them
+ if (context->status & MONO_RELATIONS_EVALUATION_IS_RECURSIVE) {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Recursivity for varible %d (target variable %d) discards computation, status ", variable, target_variable);
+ print_evaluation_context_status (context->status);
+ printf ("\n");
+ }
+ // If yes, we did not have enough information (most likely we were evaluated inside a PHI, but we also
+ // depended on the same PHI, which was still in evaluation...), so clear the status to "NOT_STARTED"
+ // (if we will be evaluated again, the PHI will be already done, so our evaluation will succeed)
+ context->status = MONO_RELATIONS_EVALUATION_NOT_STARTED;
+ } else {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Ranges for varible %d (target variable %d) computated: ", variable, target_variable);
+ print_evaluation_context_ranges (&(context->ranges));
+ printf ("\n");
+ }
+ // If not (the common case) the evaluation is complete, and the result is in the context
+ context->status = MONO_RELATIONS_EVALUATION_COMPLETED;
+ }
+ break;
+ }
+ case MONO_RELATIONS_EVALUATION_IN_PROGRESS: {
+ // This means we are in a recursive loop
+ MonoRelationsEvaluationContext *current_context = father_context;
+ MonoRelationsEvaluationContext *last_context = context->father;
+ gboolean evaluation_can_be_recursive = TRUE;
+ gboolean evaluation_is_definition = TRUE;
+ int path_value = 0;
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Evaluation of varible %d (target variable %d) already in progress\n", variable, target_variable);
+ print_evaluation_context (context);
+ print_summarized_value_relation (context->current_relation);
+ printf ("\n");
+ }
+
+ // We must check if the loop can be a recursive definition (we scan the whole loop)
+ while (current_context != last_context) {
+ if (current_context == NULL) {
+ printf ("Broken recursive ring in ABC removal\n");
+ g_assert_not_reached ();
+ }
+
+ if (current_context->current_relation->relation_is_static_definition) {
+ if (current_context->current_relation->related_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) {
+ path_value += current_context->current_relation->related_value.value.variable.delta;
+ } else if (current_context->current_relation->related_value.type != MONO_PHI_SUMMARIZED_VALUE) {
+ evaluation_can_be_recursive = FALSE;
+ }
+ } else {
+ evaluation_is_definition = FALSE;
+ evaluation_can_be_recursive = FALSE;
+ }
+
+ current_context = current_context->father;
+ }
+
+ // If this is a recursive definition, we properly flag the status in all the involved contexts
+ if (evaluation_is_definition) {
+ MonoRelationsEvaluationStatus recursive_status;
+ if (evaluation_can_be_recursive) {
+ if (path_value > 0) {
+ recursive_status = MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_ASCENDING;
+ } else if (path_value < 0) {
+ recursive_status = MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_DESCENDING;
+ } else {
+ recursive_status = MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_INDEFINITE;
+ }
+ } else {
+ recursive_status = MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_INDEFINITE;
+ }
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Recursivity accepted (");
+ print_evaluation_context_status (recursive_status);
+ printf (")\n");
+ }
+
+ current_context = father_context;
+ while (current_context != last_context) {
+ current_context->status |= recursive_status;
+ current_context = current_context->father;
+ }
+ } else {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Recursivity rejected (some relation in the cycle is not a defintion)\n");
+ }
+ }
+ break;
+ }
+ case MONO_RELATIONS_EVALUATION_COMPLETED: {
+ return;
+ }
+ default:
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Varible %d (target variable %d) already in a recursive ring, skipping\n", variable, target_variable);
+ print_evaluation_context (context);
+ print_summarized_value_relation (context->current_relation);
+ printf ("\n");
+ }
+ break;
+ }
+
+}
+
+
+/**
+ * Attempt the removal of bounds checks from a MonoInst.
+ * inst: the MonoInst
+ * area: the current evaluation area (it contains the relation graph and
+ * memory for all the evaluation contexts is already allocated)
+ */
+static void
+remove_abc_from_inst (MonoInst *inst, MonoVariableRelationsEvaluationArea *area) {
+ if (inst->opcode == CEE_LDELEMA) {
+ MonoInst *array_inst = inst->inst_left;
+ MonoInst *index_inst = inst->inst_right;
+
+ // The array must be a local variable and the index must be a properly summarized value
+ if ((array_inst->opcode == CEE_LDIND_REF) &&
+ ((array_inst->inst_left->opcode == OP_LOCAL)||(array_inst->inst_left->opcode == OP_ARG))) {
+ gssize array_variable = array_inst->inst_left->inst_c0;
+ MonoRelationsEvaluationContext *array_context = &(area->contexts [array_variable]);
+ MonoSummarizedValue index_value;
+
+ summarize_value (index_inst, &index_value);
+ if (index_value.type == MONO_CONSTANT_SUMMARIZED_VALUE) {
+ // The easiest case: we just evaluate the array length, to see if it has some relation
+ // with the index constant, and act accordingly
+
+ clean_contexts (area->contexts, area->cfg->num_varinfo);
+ evaluate_relation_with_target_variable (area, array_variable, array_variable, NULL);
+
+ if ((index_value.value.constant.value >= 0) && (index_value.value.constant.value < array_context->ranges.zero.lower)) {
+ if (REPORT_ABC_REMOVAL) {
+ printf ("ARRAY-ACCESS: removed bounds check on array %d with constant index %d in method %s\n",
+ array_variable, index_value.value.constant.value, mono_method_full_name (area->cfg->method, TRUE));
+ }
+ inst->flags |= (MONO_INST_NORANGECHECK);
+ }
+ } else if (index_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) {
+ // The common case: we must evaluate both the index and the array length, and check for relevant
+ // relations both through variable definitions and as constant definitions
+
+ gssize index_variable = index_value.value.variable.variable;
+ MonoRelationsEvaluationContext *index_context = &(area->contexts [index_variable]);
+
+ clean_contexts (area->contexts, area->cfg->num_varinfo);
+
+ evaluate_relation_with_target_variable (area, index_variable, array_variable, NULL);
+ evaluate_relation_with_target_variable (area, array_variable, array_variable, NULL);
+
+ MONO_SUB_DELTA_SAFELY_FROM_RANGES (index_context->ranges, index_value.value.variable.delta);
+
+ if (index_context->ranges.zero.lower >= 0) {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("ARRAY-ACCESS: Removed lower bound check on array %d with index %d\n", array_variable, index_variable);
+ }
+ if ((index_context->ranges.variable.upper < 0)||(index_context->ranges.zero.upper < array_context->ranges.zero.lower)) {
+ if (REPORT_ABC_REMOVAL) {
+ printf ("ARRAY-ACCESS: removed bounds check on array %d with index %d in method %s\n",
+ array_variable, index_variable, mono_method_full_name (area->cfg->method, TRUE));
+ }
+ inst->flags |= (MONO_INST_NORANGECHECK);
+ }
+ }
+ if (TRACE_ABC_REMOVAL) {
+ if (index_context->ranges.variable.upper < 0) {
+ printf ("ARRAY-ACCESS: Removed upper bound check (through variable) on array %d with index %d\n", array_variable, index_variable);
+ }
+ if (index_context->ranges.zero.upper < array_context->ranges.zero.lower) {
+ printf ("ARRAY-ACCESS: Removed upper bound check (through constant) on array %d with index %d\n", array_variable, index_variable);
+ }
+ }
+ }
+
+ }
+ }
+}
+
+/**
+ * Recursively scan a tree of MonoInst looking for array accesses.
+ * inst: the root of the MonoInst tree
+ * area: the current evaluation area (it contains the relation graph and
+ * memory for all the evaluation contexts is already allocated)
+ */
+static void
+process_inst (MonoInst *inst, MonoVariableRelationsEvaluationArea *area) {
+ if (inst->opcode == CEE_LDELEMA) { /* Handle OP_LDELEMA2D, too */
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Attempting check removal...\n");
+ }
+
+ remove_abc_from_inst (inst, area);
+ }
+
+ if (mono_burg_arity [inst->opcode]) {
+ process_inst (inst->inst_left, area);
+ if (mono_burg_arity [inst->opcode] > 1) {
+ process_inst (inst->inst_right, area);
+ }
+ }
+}
+
+
+
+
+/**
+ * Process a BB removing bounds checks from array accesses.
+ * It does the following (in sequence):
+ * - Get the BB entry condition
+ * - Add its relations to the relation graph in the evaluation area
+ * - Process all the MonoInst trees in the BB
+ * - Recursively process all the children BBs in the dominator tree
+ * - Remove the relations previously added to the relation graph
+ *
+ * bb: the BB that must be processed
+ * area: the current evaluation area (it contains the relation graph and
+ * memory for all the evaluation contexts is already allocated)
+ */
+static void
+process_block (MonoBasicBlock *bb, MonoVariableRelationsEvaluationArea *area) {
+ int inst_index;
+ MonoInst *current_inst;
+ MonoAdditionalVariableRelationsForBB additional_relations;
+ GList *dominated_bb;
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Processing block %d [dfn %d]...\n", bb->block_num, bb->dfn);
+ }
+
+ get_relations_from_previous_bb (bb, &additional_relations);
+ if (TRACE_ABC_REMOVAL) {
+ if (additional_relations.relation1.relation.relation != MONO_ANY_RELATION) {
+ printf ("Adding relation 1 on variable %d: ", additional_relations.relation1.variable);
+ print_summarized_value_relation (&(additional_relations.relation1.relation));
+ printf ("\n");
+ }
+ if (additional_relations.relation2.relation.relation != MONO_ANY_RELATION) {
+ printf ("Adding relation 2 on variable %d: ", additional_relations.relation2.variable);
+ print_summarized_value_relation (&(additional_relations.relation2.relation));
+ printf ("\n");
+ }
+ }
+ apply_change_to_evaluation_area (area, &(additional_relations.relation1));
+ apply_change_to_evaluation_area (area, &(additional_relations.relation2));
+
+ inst_index = 0;
+ current_inst = bb->code;
+ while (current_inst != NULL) {
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Processing instruction %d\n", inst_index);
+ inst_index++;
+ }
+
+ process_inst (current_inst, area);
+
+ current_inst = current_inst->next;
+ }
+
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Processing block %d [dfn %d] done.\n", bb->block_num, bb->dfn);
+ }
+
+ for (dominated_bb = g_list_first (bb->dominated); dominated_bb != NULL; dominated_bb = g_list_next (dominated_bb)) {
+ process_block ((MonoBasicBlock*) (dominated_bb->data), area);
+ }
+
+ remove_change_from_evaluation_area (&(additional_relations.relation1));
+ remove_change_from_evaluation_area (&(additional_relations.relation2));
+}
+
+
+
+/**
+ * Performs the ABC removal from a cfg in SSA form.
+ * It does the following:
+ * - Prepare the evaluation area
+ * - Allocate memory for the relation graph in the evaluation area
+ * (of course, only for variable definitions) and summarize there all
+ * variable definitions
+ * - Allocate memory for the evaluation contexts in the evaluation area
+ * - Recursively process all the BBs in the dominator tree (it is enough
+ * to invoke the processing on the entry BB)
+ *
+ * cfg: the method code
+ */
+void
+mono_perform_abc_removal (MonoCompile *cfg)
+{
+ MonoVariableRelationsEvaluationArea area;
+ int i;
+
+ verbose_level = cfg->verbose_level;
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Removing array bound checks in %s\n", mono_method_full_name (cfg->method, TRUE));
+ }
+
+ area.cfg = cfg;
+ area.relations = (MonoSummarizedValueRelation *)
+ alloca (sizeof (MonoSummarizedValueRelation) * (cfg->num_varinfo) * 2);
+ area.contexts = (MonoRelationsEvaluationContext *)
+ alloca (sizeof (MonoRelationsEvaluationContext) * (cfg->num_varinfo));
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ area.relations [i].relation = MONO_EQ_RELATION;
+ area.relations [i].relation_is_static_definition = TRUE;
+ area.relations [i].next = NULL;
+ if (cfg->vars [i]->def != NULL) {
+ MonoInst *value = get_variable_value_from_store_instruction (cfg->vars [i]->def, i);
+ if (value != NULL) {
+ summarize_value (value, &(area.relations [i].related_value));
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Summarized variable %d: ", i);
+ print_summarized_value (&(area.relations [i].related_value));
+ printf ("\n");
+ }
+ } else {
+ MAKE_VALUE_ANY (area.relations [i].related_value);
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Definition of variable %d is not a proper store\n", i);
+ }
+ }
+ } else {
+ MAKE_VALUE_ANY (area.relations [i].related_value);
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Variable %d has no definition, probably it is an argument\n", i);
+ }
+ }
+ }
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ if (area.relations [i].related_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) {
+ int related_index = cfg->num_varinfo + i;
+ int related_variable = area.relations [i].related_value.value.variable.variable;
+
+ area.relations [related_index].relation = MONO_EQ_RELATION;
+ area.relations [related_index].relation_is_static_definition = TRUE;
+ area.relations [related_index].related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE;
+ area.relations [related_index].related_value.value.variable.variable = i;
+ area.relations [related_index].related_value.value.variable.delta = - area.relations [i].related_value.value.variable.delta;
+
+ area.relations [related_index].next = area.relations [related_variable].next;
+ area.relations [related_variable].next = &(area.relations [related_index]);
+
+ if (TRACE_ABC_REMOVAL) {
+ printf ("Added symmetric summarized value for variable variable %d (to %d): ", i, related_variable);
+ print_summarized_value (&(area.relations [related_index].related_value));
+ printf ("\n");
+ }
+ }
+ }
+
+ process_block (cfg->bblocks [0], &area);
+}
+
diff --git a/mono/mini/abcremoval.h b/mono/mini/abcremoval.h
new file mode 100644
index 00000000000..e514eaa9d94
--- /dev/null
+++ b/mono/mini/abcremoval.h
@@ -0,0 +1,315 @@
+/*
+ * abcremoval.h: Array bounds check removal
+ *
+ * Author:
+ * Massimiliano Mantione (massi@ximian.com)
+ *
+ * (C) 2004 Ximian, Inc. http://www.ximian.com
+ */
+
+#ifndef __MONO_ABCREMOVAL_H__
+#define __MONO_ABCREMOVAL_H__
+
+#include <limits.h>
+
+#include "mini.h"
+
+
+/**
+ * All handled value types (expressions) in variable definitions and branch
+ * contitions:
+ * ANY: not handled
+ * CONSTANT: an integer constant
+ * VARIABLE: a reference to a variable, with an optional delta (can be zero)
+ * PHI: a PHI definition of the SSA representation
+ */
+typedef enum {
+ MONO_ANY_SUMMARIZED_VALUE,
+ MONO_CONSTANT_SUMMARIZED_VALUE,
+ MONO_VARIABLE_SUMMARIZED_VALUE,
+ MONO_PHI_SUMMARIZED_VALUE
+} MonoSummarizedValueType;
+
+/**
+ * A MONO_CONSTANT_SUMMARIZED_VALUE value.
+ * value: the value
+ */
+typedef struct MonoSummarizedConstantValue {
+ int value;
+} MonoSummarizedConstantValue;
+
+/**
+ * A MONO_VARIABLE_SUMMARIZED_VALUE value
+ * variable: the variable index in the cfg
+ * delta: the delta (can be zero)
+ */
+typedef struct MonoSummarizedVariableValue {
+ gssize variable;
+ int delta;
+} MonoSummarizedVariableValue;
+
+/**
+ * A MONO_PHI_SUMMARIZED_VALUE value.
+ * number_of_alternatives: the number of alternatives in the PHI definition
+ * phi_alternatives: an array of integers with the indexes of the variables
+ * which are the alternatives in this PHI definition
+ */
+typedef struct MonoSummarizedPhiValue {
+ int number_of_alternatives;
+ int *phi_alternatives;
+} MonoSummarizedPhiValue;
+
+/**
+ * A summarized value.
+ * In practice it is a "tagged union".
+ */
+typedef struct MonoSummarizedValue {
+ MonoSummarizedValueType type;
+ union {
+ MonoSummarizedConstantValue constant;
+ MonoSummarizedVariableValue variable;
+ MonoSummarizedPhiValue phi;
+ } value;
+} MonoSummarizedValue;
+
+/**
+ * A "relation" between two values.
+ * The enumeration is used as a bit field, with three significant bits.
+ * The degenerated cases are meaningful:
+ * MONO_ANY_RELATION: we know nothing of this relation
+ * MONO_NO_RELATION: no relation is possible (this code is unreachable)
+ */
+typedef enum {
+ MONO_EQ_RELATION = 1,
+ MONO_LT_RELATION = 2,
+ MONO_GT_RELATION = 4,
+ MONO_NE_RELATION = (MONO_LT_RELATION|MONO_GT_RELATION),
+ MONO_LE_RELATION = (MONO_LT_RELATION|MONO_EQ_RELATION),
+ MONO_GE_RELATION = (MONO_GT_RELATION|MONO_EQ_RELATION),
+ MONO_ANY_RELATION = (MONO_EQ_RELATION|MONO_LT_RELATION|MONO_GT_RELATION),
+ MONO_NO_RELATION = 0
+} MonoValueRelation;
+
+/**
+ * A relation between variables (or a variable and a constant).
+ * The first variable (the one "on the left of the expression") is implicit.
+ * relation: the relation between the variable and the value
+ * related_value: the related value
+ * relation_is_static_definition: TRUE if the relation comes from a veriable
+ * definition, FALSE if it comes from a branch
+ * condition
+ * next: pointer to the next relation of this variable in the evaluation area
+ * (relations are always kept in the evaluation area, one list for each
+ * variable)
+ */
+typedef struct MonoSummarizedValueRelation {
+ MonoValueRelation relation;
+ MonoSummarizedValue related_value;
+ gboolean relation_is_static_definition;
+ struct MonoSummarizedValueRelation *next;
+} MonoSummarizedValueRelation;
+
+/**
+ * The evaluation status for one variable.
+ * The enumeration is used as a bit field, because the status has two
+ * distinct sections.
+ * The first is the "main" one (bits 0, 1 and 2), which is actually a proper
+ * enumeration (the bits are mutually exclusive, and their meaning is obvious).
+ * The other section (the bits in the MONO_RELATIONS_EVALUATION_IS_RECURSIVE
+ * set) is used to mark an evaluation as recursive (while backtracking through
+ * the evaluation contexts), to state if the graph loop gives a value that is
+ * ascending, descending or indefinite.
+ * The bits are handled separately because the same evaluation context could
+ * belong to more than one loop, so that each loop would set its bits.
+ * After the backtracking, the bits are examined and a decision is taken.
+ *
+ */
+typedef enum {
+ MONO_RELATIONS_EVALUATION_NOT_STARTED = 0,
+ MONO_RELATIONS_EVALUATION_IN_PROGRESS = 1,
+ MONO_RELATIONS_EVALUATION_COMPLETED = 2,
+ MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_ASCENDING = 4,
+ MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_DESCENDING = 8,
+ MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_INDEFINITE = 16,
+ MONO_RELATIONS_EVALUATION_IS_RECURSIVE = (MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_ASCENDING|MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_DESCENDING|MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_INDEFINITE)
+} MonoRelationsEvaluationStatus;
+
+/**
+ * A range of values (ranges include their limits).
+ * A range from MIN_INT to MAX_INT is "indefinite" (any value).
+ * A range where upper < lower means unreachable code (some of the relations
+ * that generated the range is incompatible, like x = 0 and x > 0).
+ * lower: the lower limit
+ * upper: the upper limit
+ */
+typedef struct MonoRelationsEvaluationRange {
+ int lower;
+ int upper;
+} MonoRelationsEvaluationRange;
+
+/**
+ * The two ranges that contain the result of a variable evaluation.
+ * zero: the range with respect to zero
+ * variable: the range with respect to the target variable in this evaluation
+ */
+typedef struct MonoRelationsEvaluationRanges {
+ MonoRelationsEvaluationRange zero;
+ MonoRelationsEvaluationRange variable;
+} MonoRelationsEvaluationRanges;
+
+/**
+ * The context of a variable evaluation.
+ * status: the evaluation status
+ * current_relation: the relation that is currently evaluated.
+ * ranges: the result of the evaluation.
+ * father: the context of the evaluation that invoked this one (used to
+ * perform the backtracking when loops are detected.
+ */
+typedef struct MonoRelationsEvaluationContext {
+ MonoRelationsEvaluationStatus status;
+ MonoSummarizedValueRelation *current_relation;
+ MonoRelationsEvaluationRanges ranges;
+ struct MonoRelationsEvaluationContext *father;
+} MonoRelationsEvaluationContext;
+
+/*
+ * Basic macros to initialize and check ranges.
+ */
+#define MONO_MAKE_RELATIONS_EVALUATION_RANGE_WEAK(r) do{\
+ (r).lower = INT_MIN;\
+ (r).upper = INT_MAX;\
+ } while (0)
+#define MONO_MAKE_RELATIONS_EVALUATION_RANGES_WEAK(rs) do{\
+ MONO_MAKE_RELATIONS_EVALUATION_RANGE_WEAK ((rs).zero); \
+ MONO_MAKE_RELATIONS_EVALUATION_RANGE_WEAK ((rs).variable); \
+ } while (0)
+#define MONO_MAKE_RELATIONS_EVALUATION_RANGE_IMPOSSIBLE(r) do{\
+ (r).lower = INT_MAX;\
+ (r).upper = INT_MIN;\
+ } while (0)
+#define MONO_MAKE_RELATIONS_EVALUATION_RANGES_IMPOSSIBLE(rs) do{\
+ MONO_MAKE_RELATIONS_EVALUATION_RANGE_IMPOSSIBLE ((rs).zero); \
+ MONO_MAKE_RELATIONS_EVALUATION_RANGE_IMPOSSIBLE ((rs).variable); \
+ } while (0)
+#define MONO_RELATIONS_EVALUATION_RANGE_IS_IMPOSSIBLE(r) (((r).lower==INT_MAX)&&((r).upper==INT_MIN))
+#define MONO_RELATIONS_EVALUATION_RANGES_IS_IMPOSSIBLE(rs) \
+ (MONO_RELATIONS_EVALUATION_RANGE_IS_IMPOSSIBLE((rs).zero) && \
+ MONO_RELATIONS_EVALUATION_RANGE_IS_IMPOSSIBLE((rs).variable))
+
+/*
+ * The following macros are needed because ranges include theit limits, but
+ * some relations explicitly exclude them (GT and LT).
+ */
+#define MONO_UPPER_EVALUATION_RANGE_NOT_EQUAL(ur) ((((ur)==INT_MIN)||((ur)==INT_MAX))?(ur):((ur)-1))
+#define MONO_LOWER_EVALUATION_RANGE_NOT_EQUAL(lr) ((((lr)==INT_MIN)||((lr)==INT_MAX))?(lr):((lr)+1))
+#define MONO_APPLY_INEQUALITY_TO_EVALUATION_RANGE(r) do{\
+ (r).lower = MONO_LOWER_EVALUATION_RANGE_NOT_EQUAL ((r).lower);\
+ (r).upper = MONO_UPPER_EVALUATION_RANGE_NOT_EQUAL ((r).upper);\
+ } while (0)
+#define MONO_APPLY_INEQUALITY_TO_EVALUATION_RANGES(rs) do{\
+ MONO_APPLY_INEQUALITY_TO_EVALUATION_RANGE ((rs).zero); \
+ MONO_APPLY_INEQUALITY_TO_EVALUATION_RANGE ((rs).variable); \
+ } while (0)
+
+/*
+ * The following macros perform union and intersection operations on ranges.
+ */
+#define MONO_LOWER_EVALUATION_RANGE_UNION(lr,other_lr) ((lr)=MIN(lr,other_lr))
+#define MONO_UPPER_EVALUATION_RANGE_UNION(ur,other_ur) ((ur)=MAX(ur,other_ur))
+#define MONO_LOWER_EVALUATION_RANGE_INTERSECTION(lr,other_lr) ((lr)=MAX(lr,other_lr))
+#define MONO_UPPER_EVALUATION_RANGE_INTERSECTION(ur,other_ur) ((ur)=MIN(ur,other_ur))
+#define MONO_RELATIONS_EVALUATION_RANGE_UNION(r,other_r) do{\
+ MONO_LOWER_EVALUATION_RANGE_UNION((r).lower,(other_r).lower);\
+ MONO_UPPER_EVALUATION_RANGE_UNION((r).upper,(other_r).upper);\
+ } while (0)
+#define MONO_RELATIONS_EVALUATION_RANGE_INTERSECTION(r,other_r) do{\
+ MONO_LOWER_EVALUATION_RANGE_INTERSECTION((r).lower,(other_r).lower);\
+ MONO_UPPER_EVALUATION_RANGE_INTERSECTION((r).upper,(other_r).upper);\
+ } while (0)
+#define MONO_RELATIONS_EVALUATION_RANGES_UNION(rs,other_rs) do{\
+ MONO_RELATIONS_EVALUATION_RANGE_UNION ((rs).zero,(other_rs).zero); \
+ MONO_RELATIONS_EVALUATION_RANGE_UNION ((rs).variable,(other_rs).variable); \
+ } while (0)
+#define MONO_RELATIONS_EVALUATION_RANGES_INTERSECTION(rs,other_rs) do{\
+ MONO_RELATIONS_EVALUATION_RANGE_INTERSECTION ((rs).zero,(other_rs).zero); \
+ MONO_RELATIONS_EVALUATION_RANGE_INTERSECTION ((rs).variable,(other_rs).variable); \
+ } while (0)
+
+/*
+ * The following macros add or subtract "safely" (without over/under-flow) a
+ * delta (constant) value to a range.
+ */
+#define MONO_ADD_DELTA_SAFELY(v,d) do{\
+ if (((d) > 0) && ((v) != INT_MIN)) {\
+ (v) = (((v)+(d))>(v))?((v)+(d)):INT_MAX;\
+ } else if (((d) < 0) && ((v) != INT_MAX)) {\
+ (v) = (((v)+(d))<(v))?((v)+(d)):INT_MIN;\
+ }\
+ } while (0)
+#define MONO_SUB_DELTA_SAFELY(v,d) do{\
+ if (((d) < 0) && ((v) != INT_MIN)) {\
+ (v) = (((v)-(d))>(v))?((v)-(d)):INT_MAX;\
+ } else if (((d) > 0) && ((v) != INT_MAX)) {\
+ (v) = (((v)-(d))<(v))?((v)-(d)):INT_MIN;\
+ }\
+ } while (0)
+#define MONO_ADD_DELTA_SAFELY_TO_RANGE(r,d) do{\
+ MONO_ADD_DELTA_SAFELY((r).lower,(d));\
+ MONO_ADD_DELTA_SAFELY((r).upper,(d));\
+ } while (0)
+#define MONO_SUB_DELTA_SAFELY_FROM_RANGE(r,d) do{\
+ MONO_SUB_DELTA_SAFELY((r).lower,(d));\
+ MONO_SUB_DELTA_SAFELY((r).upper,(d));\
+ } while (0)
+#define MONO_ADD_DELTA_SAFELY_TO_RANGES(rs,d) do{\
+ MONO_ADD_DELTA_SAFELY_TO_RANGE((rs).zero,(d));\
+ MONO_ADD_DELTA_SAFELY_TO_RANGE((rs).variable,(d));\
+ } while (0)
+#define MONO_SUB_DELTA_SAFELY_FROM_RANGES(rs,d) do{\
+ MONO_SUB_DELTA_SAFELY_FROM_RANGE((rs).zero,(d));\
+ MONO_SUB_DELTA_SAFELY_FROM_RANGE((rs).variable,(d));\
+ } while (0)
+
+
+/**
+ * The main evaluation area.
+ * cfg: the cfg of the method that is being examined.
+ * relations: and array of relations, one for each method variable (each
+ * relation is the head of a list); this is the evaluation graph
+ * contexts: an array of evaluation contexts (one for each method variable)
+ */
+typedef struct MonoVariableRelationsEvaluationArea {
+ MonoCompile *cfg;
+ MonoSummarizedValueRelation *relations;
+ MonoRelationsEvaluationContext *contexts;
+} MonoVariableRelationsEvaluationArea;
+
+/**
+ * Convenience structure to define an "additional" relation for the main
+ * evaluation graph.
+ * variable: the variable to which the relation is applied
+ * relation: the relation
+ * insertion_point: the point in the graph where the relation is inserted
+ * (useful for removing it from the list when backtracking
+ * in the traversal of the dominator tree)
+ */
+typedef struct MonoAdditionalVariableRelation {
+ gssize variable;
+ MonoSummarizedValueRelation relation;
+ MonoSummarizedValueRelation *insertion_point;
+} MonoAdditionalVariableRelation;
+
+/**
+ * Convenience structure that stores two additional relations.
+ * In the current code, each BB can add at most two relations to the main
+ * evaluation graph, so one of these structures is enough to hold all the
+ * modifications to the graph made examining one BB.
+ */
+typedef struct MonoAdditionalVariableRelationsForBB {
+ MonoAdditionalVariableRelation relation1;
+ MonoAdditionalVariableRelation relation2;
+} MonoAdditionalVariableRelationsForBB;
+
+
+#endif /* __MONO_ABCREMOVAL_H__ */
+
diff --git a/mono/mini/aot.c b/mono/mini/aot.c
new file mode 100644
index 00000000000..e26b74d184d
--- /dev/null
+++ b/mono/mini/aot.c
@@ -0,0 +1,1581 @@
+/*
+ * aot.c: mono Ahead of Time compiler
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#ifndef PLATFORM_WIN32
+#include <sys/mman.h>
+#else
+#include <windows.h>
+#endif
+
+#include <errno.h>
+#include <sys/stat.h>
+#include <limits.h> /* for PAGESIZE */
+#ifndef PAGESIZE
+#define PAGESIZE 4096
+#endif
+
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/class.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/tokentype.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/metadata-internals.h>
+#include <mono/metadata/marshal.h>
+#include <mono/utils/mono-logger.h>
+#include <mono/os/gc_wrapper.h>
+
+#include "mini.h"
+
+#ifdef PLATFORM_WIN32
+#define SHARED_EXT ".dll"
+#elif defined(__ppc__) && defined(__MACH__)
+#define SHARED_EXT ".dylib"
+#else
+#define SHARED_EXT ".so"
+#endif
+
+#if defined(sparc) || defined(__ppc__)
+#define AS_STRING_DIRECTIVE ".asciz"
+#else
+/* GNU as */
+#define AS_STRING_DIRECTIVE ".string"
+#endif
+
+#define ALIGN_PTR_TO(ptr,align) (gpointer)((((gssize)(ptr)) + (align - 1)) & (~(align - 1)))
+
+typedef struct MonoAotMethod {
+ MonoJitInfo *info;
+ MonoJumpInfo *patch_info;
+ MonoDomain *domain;
+} MonoAotMethod;
+
+typedef struct MonoAotModule {
+ /* Optimization flags used to compile the module */
+ guint32 opts;
+ /* Maps MonoMethods to MonoAotMethodInfos */
+ MonoGHashTable *methods;
+ char **icall_table;
+ MonoImage **image_table;
+ guint32* methods_present_table;
+} MonoAotModule;
+
+typedef struct MonoAotCompile {
+ FILE *fp;
+ GHashTable *ref_hash;
+ GHashTable *icall_hash;
+ GPtrArray *icall_table;
+ GHashTable *image_hash;
+ GPtrArray *image_table;
+} MonoAotCompile;
+
+typedef struct MonoAotOptions {
+ char *outfile;
+} MonoAotOptions;
+
+static MonoGHashTable *aot_modules;
+
+static CRITICAL_SECTION aot_mutex;
+
+/*
+ * Disabling this will make a copy of the loaded code and use the copy instead
+ * of the original. This will place the caller and the callee close to each
+ * other in memory, possibly improving cache behavior. Since the original
+ * code is in copy-on-write memory, this will not increase the memory usage
+ * of the runtime.
+ */
+static gboolean use_loaded_code = FALSE;
+
+/*
+ * Whenever to AOT compile loaded assemblies on demand and store them in
+ * a cache under $HOME/.mono/aot-cache.
+ */
+static gboolean use_aot_cache = FALSE;
+
+/* For debugging */
+static gint32 mono_last_aot_method = -1;
+
+static MonoJitInfo*
+mono_aot_load_method (MonoDomain *domain, MonoAotModule *aot_module, MonoMethod *method, guint8 *code, guint8 *info);
+
+static MonoClass*
+decode_klass_info (MonoAotModule *module, guint32 *info, guint32 **out_info)
+{
+ MonoImage *image;
+ MonoClass *klass;
+ guint32 token, rank;
+
+ image = module->image_table [info [0]];
+ token = info [1];
+ info += 2;
+ if (token) {
+ klass = mono_class_get (image, token);
+ } else {
+ token = info [0];
+ rank = info [1];
+ info += 2;
+ klass = mono_class_get (image, token);
+ g_assert (klass);
+ klass = mono_array_class_get (klass, rank);
+ }
+ g_assert (klass);
+ mono_class_init (klass);
+
+ *out_info = info;
+ return klass;
+}
+
+static MonoClassField*
+decode_field_info (MonoAotModule *module, guint32 *info, guint32 **out_info)
+{
+ MonoClass *klass = decode_klass_info (module, info, &info);
+ guint32 token;
+
+ token = info [0];
+ info ++;
+ *out_info = info;
+
+ return mono_class_get_field (klass, token);
+}
+
+static void
+create_cache_structure (void)
+{
+ const char *home;
+ char *tmp;
+ int err;
+
+ home = g_get_home_dir ();
+ if (!home)
+ return;
+
+ tmp = g_build_filename (home, ".mono", NULL);
+ if (!g_file_test (tmp, G_FILE_TEST_IS_DIR)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT creating directory %s", tmp);
+#ifdef PLATFORM_WIN32
+ err = mkdir (tmp);
+#else
+ err = mkdir (tmp, 0777);
+#endif
+ if (err) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT failed: %s", g_strerror (errno));
+ g_free (tmp);
+ return;
+ }
+ }
+ g_free (tmp);
+ tmp = g_build_filename (home, ".mono", "aot-cache", NULL);
+ if (!g_file_test (tmp, G_FILE_TEST_IS_DIR)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT creating directory %s", tmp);
+#ifdef PLATFORM_WIN32
+ err = mkdir (tmp);
+#else
+ err = mkdir (tmp, 0777);
+#endif
+ if (err) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT failed: %s", g_strerror (errno));
+ g_free (tmp);
+ return;
+ }
+ }
+ g_free (tmp);
+}
+
+/*
+ * load_aot_module_from_cache:
+ *
+ * Experimental code to AOT compile loaded assemblies on demand.
+ *
+ * FIXME:
+ * - Add environment variable MONO_AOT_CACHE_OPTIONS
+ * - Add options for controlling the cache size
+ * - Handle full cache by deleting old assemblies lru style
+ * - Add options for excluding assemblies during development
+ * - Maybe add a threshold after an assembly is AOT compiled
+ * - invoking a new mono process is a security risk
+ */
+static GModule*
+load_aot_module_from_cache (MonoAssembly *assembly, char **aot_name)
+{
+ char *fname, *cmd, *tmp2;
+ const char *home;
+ GModule *module;
+ gboolean res;
+ gchar *out, *err;
+
+ *aot_name = NULL;
+
+ if (assembly->image->dynamic)
+ return NULL;
+
+ create_cache_structure ();
+
+ home = g_get_home_dir ();
+
+ tmp2 = g_strdup_printf ("%s-%s%s", assembly->image->assembly_name, assembly->image->guid, SHARED_EXT);
+ fname = g_build_filename (home, ".mono", "aot-cache", tmp2, NULL);
+ *aot_name = fname;
+ g_free (tmp2);
+
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT trying to load from cache: '%s'.", fname);
+ module = g_module_open (fname, G_MODULE_BIND_LAZY);
+
+ if (!module) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT not found.");
+
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT precompiling assembly '%s'... ", assembly->image->name);
+
+ /* FIXME: security */
+ cmd = g_strdup_printf ("mono -O=all --aot=outfile=%s %s", fname, assembly->image->name);
+
+ res = g_spawn_command_line_sync (cmd, &out, &err, NULL, NULL);
+ g_free (cmd);
+ if (!res) {
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT failed.");
+ return NULL;
+ }
+
+ mono_trace (G_LOG_LEVEL_MESSAGE, MONO_TRACE_AOT, "AOT succeeded.");
+
+ module = g_module_open (fname, G_MODULE_BIND_LAZY);
+ }
+
+ return module;
+}
+
+static void
+load_aot_module (MonoAssembly *assembly, gpointer user_data)
+{
+ char *aot_name;
+ MonoAotModule *info;
+ gboolean usable = TRUE;
+ char *saved_guid = NULL;
+ char *aot_version = NULL;
+ char *opt_flags = NULL;
+
+ if (mono_compile_aot)
+ return;
+
+ if (use_aot_cache)
+ assembly->aot_module = load_aot_module_from_cache (assembly, &aot_name);
+ else {
+ aot_name = g_strdup_printf ("%s%s", assembly->image->name, SHARED_EXT);
+
+ assembly->aot_module = g_module_open (aot_name, G_MODULE_BIND_LAZY);
+
+ if (!assembly->aot_module) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT failed to load AOT module %s: %s\n", aot_name, g_module_error ());
+ }
+ }
+
+ if (!assembly->aot_module) {
+ g_free (aot_name);
+ return;
+ }
+
+ g_module_symbol (assembly->aot_module, "mono_assembly_guid", (gpointer *) &saved_guid);
+ g_module_symbol (assembly->aot_module, "mono_aot_version", (gpointer *) &aot_version);
+ g_module_symbol (assembly->aot_module, "mono_aot_opt_flags", (gpointer *)&opt_flags);
+
+ if (!aot_version || strcmp (aot_version, MONO_AOT_FILE_VERSION)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module %s has wrong file format version (expected %s got %s)\n", aot_name, MONO_AOT_FILE_VERSION, aot_version);
+ usable = FALSE;
+ }
+ else
+ if (!saved_guid || strcmp (assembly->image->guid, saved_guid)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module %s is out of date.\n", aot_name);
+ usable = FALSE;
+ }
+
+ if (!usable) {
+ g_free (aot_name);
+ g_module_close (assembly->aot_module);
+ assembly->aot_module = NULL;
+ return;
+ }
+
+ /*
+ * It seems that MonoGHashTables are in the GC heap, so structures
+ * containing them must be in the GC heap as well :(
+ */
+#ifdef HAVE_BOEHM_GC
+ info = GC_MALLOC (sizeof (MonoAotModule));
+#else
+ info = g_new0 (MonoAotModule, 1);
+#endif
+ info->methods = mono_g_hash_table_new (NULL, NULL);
+ sscanf (opt_flags, "%d", &info->opts);
+
+ /* Read image table */
+ {
+ guint32 table_len, i;
+ char *table = NULL;
+
+ g_module_symbol (assembly->aot_module, "mono_image_table", (gpointer *)&table);
+ g_assert (table);
+
+ table_len = *(guint32*)table;
+ table += sizeof (guint32);
+ info->image_table = g_new0 (MonoImage*, table_len);
+ for (i = 0; i < table_len; ++i) {
+ info->image_table [i] = mono_image_loaded_by_guid (table);
+ if (!info->image_table [i]) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module %s is out of date.\n", aot_name);
+ mono_g_hash_table_destroy (info->methods);
+ g_free (info->image_table);
+#ifndef HAVE_BOEHM_GC
+ g_free (info);
+#endif
+ g_free (aot_name);
+ g_module_close (assembly->aot_module);
+ assembly->aot_module = NULL;
+ return;
+ }
+ table += strlen (table) + 1;
+ }
+ }
+
+ /* Read icall table */
+ {
+ guint32 table_len, i;
+ char *table = NULL;
+
+ g_module_symbol (assembly->aot_module, "mono_icall_table", (gpointer *)&table);
+ g_assert (table);
+
+ table_len = *(guint32*)table;
+ table += sizeof (guint32);
+ info->icall_table = g_new0 (char*, table_len);
+ for (i = 0; i < table_len; ++i) {
+ info->icall_table [i] = table;
+ table += strlen (table) + 1;
+ }
+ }
+
+ /* Read methods present table */
+ g_module_symbol (assembly->aot_module, "mono_methods_present_table", (gpointer *)&info->methods_present_table);
+ g_assert (info->methods_present_table);
+
+ EnterCriticalSection (&aot_mutex);
+ mono_g_hash_table_insert (aot_modules, assembly, info);
+ LeaveCriticalSection (&aot_mutex);
+
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT loaded AOT Module for %s.\n", assembly->image->name);
+}
+
+void
+mono_aot_init (void)
+{
+ InitializeCriticalSection (&aot_mutex);
+
+ MONO_GC_REGISTER_ROOT (aot_modules);
+ aot_modules = mono_g_hash_table_new (NULL, NULL);
+
+ mono_install_assembly_load_hook (load_aot_module, NULL);
+
+ if (getenv ("MONO_LASTAOT"))
+ mono_last_aot_method = atoi (getenv ("MONO_LASTAOT"));
+ if (getenv ("MONO_AOT_CACHE"))
+ use_aot_cache = TRUE;
+}
+
+static MonoJitInfo *
+mono_aot_get_method_inner (MonoDomain *domain, MonoMethod *method)
+{
+ MonoClass *klass = method->klass;
+ MonoAssembly *ass = klass->image->assembly;
+ GModule *module = ass->aot_module;
+ char method_label [256];
+ char info_label [256];
+ guint8 *code = NULL;
+ guint8 *info;
+ MonoAotModule *aot_module;
+ MonoAotMethod *minfo;
+ MonoJitInfo *jinfo;
+ MonoMethodHeader *header;
+ int i;
+
+ if (!module)
+ return NULL;
+
+ if (!method->token)
+ return NULL;
+
+ if (mono_profiler_get_events () & MONO_PROFILE_ENTER_LEAVE)
+ return NULL;
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->flags & METHOD_ATTRIBUTE_ABSTRACT))
+ return NULL;
+
+ header = mono_method_get_header (method);
+
+ aot_module = (MonoAotModule*)mono_g_hash_table_lookup (aot_modules, ass);
+
+ g_assert (klass->inited);
+
+ minfo = mono_g_hash_table_lookup (aot_module->methods, method);
+ /* Can't use code from non-root domains since they can be unloaded */
+ if (minfo && (minfo->domain == mono_get_root_domain ())) {
+ /* This method was already loaded in another appdomain */
+
+ /* Duplicate jinfo */
+ jinfo = mono_mempool_alloc0 (domain->mp, sizeof (MonoJitInfo));
+ memcpy (jinfo, minfo->info, sizeof (MonoJitInfo));
+ if (jinfo->clauses) {
+ jinfo->clauses =
+ mono_mempool_alloc0 (domain->mp, sizeof (MonoJitExceptionInfo) * header->num_clauses);
+ memcpy (jinfo->clauses, minfo->info->clauses, sizeof (MonoJitExceptionInfo) * header->num_clauses);
+ }
+
+ if (aot_module->opts & MONO_OPT_SHARED)
+ /* Use the same method in the new appdomain */
+ ;
+ else if (!minfo->patch_info)
+ /* Use the same method in the new appdomain */
+ ;
+ else {
+ /* Create a copy of the original method and apply relocations */
+
+ code = mono_code_manager_reserve (domain->code_mp, minfo->info->code_size);
+ memcpy (code, minfo->info->code_start, minfo->info->code_size);
+
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT REUSE METHOD: %s %p - %p.\n", mono_method_full_name (method, TRUE), code, (char*)code + minfo->info->code_size);
+
+ /* Do this outside the lock to avoid deadlocks */
+ LeaveCriticalSection (&aot_mutex);
+ mono_arch_patch_code (method, domain, code, minfo->patch_info, TRUE);
+ EnterCriticalSection (&aot_mutex);
+ mono_arch_flush_icache (code, minfo->info->code_size);
+
+ /* Relocate jinfo */
+ jinfo->code_start = code;
+ if (jinfo->clauses) {
+ for (i = 0; i < header->num_clauses; ++i) {
+ MonoJitExceptionInfo *ei = &jinfo->clauses [i];
+ gint32 offset = code - (guint8*)minfo->info->code_start;
+
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)
+ ei->data.filter = (guint8*)ei->data.filter + offset;
+ else
+ ei->data.catch_class = header->clauses [i].data.catch_class;
+ ei->try_start = (guint8*)ei->try_start + offset;
+ ei->try_end = (guint8*)ei->try_end + offset;
+ ei->handler_start = (guint8*)ei->handler_start + offset;
+ }
+ }
+ }
+
+ return jinfo;
+ }
+
+ /* Do a fast check to see whenever the method exists */
+ {
+ guint32 index = mono_metadata_token_index (method->token) - 1;
+ guint32 w;
+ w = aot_module->methods_present_table [index / 32];
+ if (! (w & (1 << (index % 32)))) {
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT NOT FOUND: %s.\n", mono_method_full_name (method, TRUE));
+ return NULL;
+ }
+ }
+
+ sprintf (method_label, "m_%x", mono_metadata_token_index (method->token));
+
+ if (!g_module_symbol (module, method_label, (gpointer *)&code))
+ return NULL;
+
+ sprintf (info_label, "%s_p", method_label);
+
+ if (!g_module_symbol (module, info_label, (gpointer *)&info))
+ return NULL;
+
+ if (mono_last_aot_method != -1) {
+ if (mono_jit_stats.methods_aot > mono_last_aot_method)
+ return NULL;
+ else
+ if (mono_jit_stats.methods_aot == mono_last_aot_method)
+ printf ("LAST AOT METHOD: %s.%s.%s.\n", klass->name_space, klass->name, method->name);
+ }
+
+ return mono_aot_load_method (domain, aot_module, method, code, info);
+}
+
+static MonoJitInfo*
+mono_aot_load_method (MonoDomain *domain, MonoAotModule *aot_module, MonoMethod *method, guint8 *code, guint8 *info)
+{
+ MonoClass *klass = method->klass;
+ MonoJumpInfo *patch_info = NULL;
+ guint code_len, used_int_regs, used_strings;
+ MonoAotMethod *minfo;
+ MonoJitInfo *jinfo;
+ MonoMethodHeader *header = mono_method_get_header (method);
+ GPtrArray *patches;
+ int i, pindex;
+
+ minfo = g_new0 (MonoAotMethod, 1);
+
+ minfo->domain = domain;
+ jinfo = mono_mempool_alloc0 (domain->mp, sizeof (MonoJitInfo));
+
+ code_len = *(guint32*)info;
+ info += 4;
+ used_int_regs = *(guint32*)info;
+ info += 4;
+
+ if (!use_loaded_code) {
+ guint8 *code2;
+ code2 = mono_code_manager_reserve (domain->code_mp, code_len);
+ memcpy (code2, code, code_len);
+ mono_arch_flush_icache (code2, code_len);
+ code = code2;
+ }
+
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT FOUND AOT compiled code for %s %p - %p %p\n", mono_method_full_name (method, TRUE), code, code + code_len, info);
+
+ /* Exception table */
+ if (header->num_clauses) {
+ jinfo->clauses =
+ mono_mempool_alloc0 (domain->mp, sizeof (MonoJitExceptionInfo) * header->num_clauses);
+ jinfo->num_clauses = header->num_clauses;
+
+ jinfo->exvar_offset = *(guint32*)info;
+ info += 4;
+
+ for (i = 0; i < header->num_clauses; ++i) {
+ MonoExceptionClause *ec = &header->clauses [i];
+ MonoJitExceptionInfo *ei = &jinfo->clauses [i];
+
+ ei->flags = ec->flags;
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)
+ ei->data.filter = code + *(guint32*)info;
+ else
+ ei->data.catch_class = ec->data.catch_class;
+ info += 4;
+ ei->try_start = code + *(guint32*)info;
+ info += 4;
+ ei->try_end = code + *(guint32*)info;
+ info += 4;
+ ei->handler_start = code + *(guint32*)info;
+ info += 4;
+ }
+ }
+
+ if (aot_module->opts & MONO_OPT_SHARED) {
+ used_strings = *(guint32*)info;
+ info += 4;
+ }
+ else
+ used_strings = 0;
+
+ for (i = 0; i < used_strings; i++) {
+ guint token = *(guint32*)info;
+ info += 4;
+ mono_ldstr (mono_get_root_domain (), klass->image, mono_metadata_token_index (token));
+ }
+
+ if (*info) {
+ MonoMemPool *mp;
+ MonoImage *image;
+ guint8 *page_start;
+ gpointer *table;
+ int pages;
+ int i, err;
+ guint32 last_offset, buf_len;
+ guint32 *info32;
+
+ if (aot_module->opts & MONO_OPT_SHARED)
+ mp = mono_mempool_new ();
+ else
+ mp = domain->mp;
+
+ /* First load the type + offset table */
+ last_offset = 0;
+ patches = g_ptr_array_new ();
+ while (*info) {
+ MonoJumpInfo *ji = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo));
+
+ guint8 b1, b2;
+
+ b1 = *(guint8*)info;
+ b2 = *((guint8*)info + 1);
+
+ info += 2;
+
+ ji->type = b1 >> 2;
+
+ if (((b1 & (1 + 2)) == 3) && (b2 == 255)) {
+ info = ALIGN_PTR_TO (info, 4);
+ ji->ip.i = *(guint32*)info;
+ info += 4;
+ }
+ else
+ ji->ip.i = (((guint32)(b1 & (1 + 2))) << 8) + b2;
+
+ ji->ip.i += last_offset;
+ last_offset = ji->ip.i;
+ //printf ("T: %d O: %d.\n", ji->type, ji->ip.i);
+
+ ji->next = patch_info;
+ patch_info = ji;
+
+ g_ptr_array_add (patches, ji);
+ }
+ info ++;
+
+ info = ALIGN_PTR_TO (info, sizeof (gpointer));
+
+ info32 = (guint32*)info;
+
+ /* Then load the other data */
+ for (pindex = 0; pindex < patches->len; ++pindex) {
+ MonoJumpInfo *ji = g_ptr_array_index (patches, pindex);
+
+ switch (ji->type) {
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IID:
+ case MONO_PATCH_INFO_VTABLE:
+ case MONO_PATCH_INFO_CLASS_INIT:
+ ji->data.klass = decode_klass_info (aot_module, info32, &info32);
+ break;
+ case MONO_PATCH_INFO_IMAGE:
+ ji->data.image = aot_module->image_table [info32 [0]];
+ g_assert (ji->data.image);
+ info32 ++;
+ break;
+ case MONO_PATCH_INFO_METHOD:
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_METHOD_JUMP: {
+ guint32 image_index, token;
+
+ image_index = info32 [0] >> 24;
+ token = MONO_TOKEN_METHOD_DEF | (info32 [0] & 0xffffff);
+
+ image = aot_module->image_table [image_index];
+ ji->data.method = mono_get_method (image, token, NULL);
+ g_assert (ji->data.method);
+ mono_class_init (ji->data.method->klass);
+ info32 ++;
+
+ break;
+ }
+ case MONO_PATCH_INFO_WRAPPER: {
+ guint32 wrapper_type;
+
+ wrapper_type = info32 [0];
+ info32 ++;
+
+ switch (wrapper_type) {
+ case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK: {
+ guint32 image_index, token;
+
+ image_index = info32 [0] >> 24;
+ token = MONO_TOKEN_METHOD_DEF | (info32 [0] & 0xffffff);
+
+ image = aot_module->image_table [image_index];
+ ji->data.method = mono_get_method (image, token, NULL);
+ g_assert (ji->data.method);
+ mono_class_init (ji->data.method->klass);
+
+ ji->type = MONO_PATCH_INFO_METHOD;
+ ji->data.method = mono_marshal_get_remoting_invoke_with_check (ji->data.method);
+ info32 ++;
+ break;
+ }
+ case MONO_WRAPPER_PROXY_ISINST: {
+ MonoClass *klass = decode_klass_info (aot_module, info32, &info32);
+
+ ji->type = MONO_PATCH_INFO_METHODCONST;
+ ji->data.method = mono_marshal_get_proxy_cancast (klass);
+ break;
+ }
+ case MONO_WRAPPER_LDFLD:
+ case MONO_WRAPPER_STFLD: {
+ MonoClass *klass = decode_klass_info (aot_module, info32, &info32);
+
+ ji->type = MONO_PATCH_INFO_METHOD;
+ if (wrapper_type == MONO_WRAPPER_LDFLD)
+ ji->data.method = mono_marshal_get_ldfld_wrapper (&klass->byval_arg);
+ else
+ ji->data.method = mono_marshal_get_stfld_wrapper (&klass->byval_arg);
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ }
+ break;
+ }
+ case MONO_PATCH_INFO_FIELD:
+ case MONO_PATCH_INFO_SFLDA:
+ ji->data.field = decode_field_info (aot_module, info32, &info32);
+ break;
+ case MONO_PATCH_INFO_INTERNAL_METHOD:
+ ji->data.name = aot_module->icall_table [info32 [0]];
+ g_assert (ji->data.name);
+ info32 ++;
+ //printf ("A: %s.\n", ji->data.name);
+ break;
+ case MONO_PATCH_INFO_SWITCH:
+ ji->table_size = info32 [0];
+ table = g_new (gpointer, ji->table_size);
+ ji->data.target = table;
+ for (i = 0; i < ji->table_size; i++) {
+ table [i] = (gpointer)(gssize)info32 [i + 1];
+ }
+ info32 += (ji->table_size + 1);
+ break;
+ case MONO_PATCH_INFO_R4:
+ ji->data.target = info32;
+ info32 ++;
+ break;
+ case MONO_PATCH_INFO_R8:
+ info32 = ALIGN_PTR_TO (info32, 8);
+ ji->data.target = info32;
+ info32 += 2;
+ break;
+ case MONO_PATCH_INFO_LDSTR:
+ case MONO_PATCH_INFO_LDTOKEN:
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE:
+ image = aot_module->image_table [info32 [0]];
+ ji->data.token = mono_jump_info_token_new (mp, image, info32 [1]);
+ info32 += 2;
+ break;
+ case MONO_PATCH_INFO_EXC_NAME:
+ ji->data.klass = decode_klass_info (aot_module, info32, &info32);
+ ji->data.name = ji->data.klass->name;
+ break;
+ case MONO_PATCH_INFO_METHOD_REL:
+ ji->data.offset = info32 [0];
+ info32 ++;
+ break;
+ default:
+ g_warning ("unhandled type %d", ji->type);
+ g_assert_not_reached ();
+ }
+ }
+
+ info = (guint8*)info32;
+
+ g_ptr_array_free (patches, TRUE);
+
+ buf_len = *(guint32*)info;
+ info += 4;
+ mono_debug_add_aot_method (domain, method, code, info, buf_len);
+
+ if (use_loaded_code) {
+ /* disable write protection */
+#ifndef PLATFORM_WIN32
+ page_start = (char *) (((gssize) (code)) & ~ (PAGESIZE - 1));
+ pages = (code + code_len - page_start + PAGESIZE - 1) / PAGESIZE;
+ err = mprotect (page_start, pages * PAGESIZE, PROT_READ | PROT_WRITE | PROT_EXEC);
+ g_assert (err == 0);
+#else
+ {
+ DWORD oldp;
+ g_assert (VirtualProtect (code, code_len, PAGE_EXECUTE_READWRITE, &oldp) != 0);
+ }
+#endif
+ }
+
+ /* Do this outside the lock to avoid deadlocks */
+ LeaveCriticalSection (&aot_mutex);
+ mono_arch_patch_code (method, domain, code, patch_info, TRUE);
+ EnterCriticalSection (&aot_mutex);
+
+ if (aot_module->opts & MONO_OPT_SHARED)
+ /* No need to cache patches */
+ mono_mempool_destroy (mp);
+ else
+ minfo->patch_info = patch_info;
+ }
+
+ mono_jit_stats.methods_aot++;
+
+ {
+ jinfo->code_size = code_len;
+ jinfo->used_regs = used_int_regs;
+ jinfo->method = method;
+ jinfo->code_start = code;
+ jinfo->domain_neutral = (aot_module->opts & MONO_OPT_SHARED) != 0;
+
+ minfo->info = jinfo;
+ mono_g_hash_table_insert (aot_module->methods, method, minfo);
+
+ return jinfo;
+ }
+}
+
+MonoJitInfo*
+mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
+{
+ MonoJitInfo *info;
+
+ EnterCriticalSection (&aot_mutex);
+ info = mono_aot_get_method_inner (domain, method);
+ LeaveCriticalSection (&aot_mutex);
+
+ /* Do this outside the lock */
+ if (info) {
+ mono_jit_info_table_add (domain, info);
+ return info;
+ }
+ else
+ return NULL;
+}
+
+static void
+emit_section_change (FILE *fp, const char *section_name, int subsection_index)
+{
+#if defined(sparc)
+ /* For solaris as, GNU as should accept the same */
+ fprintf (fp, ".section \"%s\"\n", section_name);
+#elif defined(__ppc__) && defined(__MACH__)
+ /* This needs to be made more precise on mach. */
+ fprintf (fp, "%s\n", subsection_index == 0 ? ".text" : ".data");
+#else
+ fprintf (fp, "%s %d\n", section_name, subsection_index);
+#endif
+}
+
+static void
+emit_global (FILE *fp, const char *name)
+{
+#if defined(__ppc__) && defined(__MACH__)
+ // mach-o always uses a '_' prefix.
+ fprintf (fp, ".globl _%s\n", name);
+#else
+ fprintf (fp, ".globl %s\n", name);
+#endif
+}
+
+static void
+emit_label (FILE *fp, const char *name)
+{
+#if defined(__ppc__) && defined(__MACH__)
+ // mach-o always uses a '_' prefix.
+ fprintf (fp, "_%s:\n", name);
+#else
+ fprintf (fp, "%s:\n", name);
+#endif
+}
+
+#if 0
+static void
+write_data_symbol (FILE *fp, const char *name, guint8 *buf, int size, int align)
+{
+ int i;
+
+ emit_section_change (fp, ".text", 1);
+
+ fprintf (fp, ".globl %s\n", name);
+ fprintf (fp, "\t.align %d\n", align);
+ fprintf (fp, "\t.type %s,#object\n", name);
+ fprintf (fp, "\t.size %s,%d\n", name, size);
+ fprintf (fp, "%s:\n", name);
+ for (i = 0; i < size; i++) {
+ fprintf (fp, ".byte %d\n", buf [i]);
+ }
+
+}
+#endif
+
+static void
+write_string_symbol (FILE *fp, const char *name, const char *value)
+{
+ emit_section_change (fp, ".text", 1);
+ emit_global(fp, name);
+ emit_label(fp, name);
+ fprintf (fp, "\t%s \"%s\"\n", AS_STRING_DIRECTIVE, value);
+}
+
+static guint32
+mono_get_field_token (MonoClassField *field)
+{
+ MonoClass *klass = field->parent;
+ int i;
+
+ for (i = 0; i < klass->field.count; ++i) {
+ if (field == &klass->fields [i])
+ return MONO_TOKEN_FIELD_DEF | (klass->field.first + 1 + i);
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+static guint32
+get_image_index (MonoAotCompile *cfg, MonoImage *image)
+{
+ guint32 index;
+
+ index = GPOINTER_TO_UINT (g_hash_table_lookup (cfg->image_hash, image));
+ if (index)
+ return index - 1;
+ else {
+ index = g_hash_table_size (cfg->image_hash);
+ g_hash_table_insert (cfg->image_hash, image, GUINT_TO_POINTER (index + 1));
+ g_ptr_array_add (cfg->image_table, image);
+ return index;
+ }
+}
+
+static void
+emit_klass_info (MonoAotCompile *cfg, MonoClass *klass)
+{
+ fprintf (cfg->fp, "\t.long 0x%08x\n", get_image_index (cfg, klass->image));
+ fprintf (cfg->fp, "\t.long 0x%08x\n", klass->type_token);
+ if (!klass->type_token) {
+ /* Array class */
+ g_assert (klass->rank > 0);
+ g_assert (klass->element_class->type_token);
+ fprintf (cfg->fp, "\t.long 0x%08x\n", klass->element_class->type_token);
+ fprintf (cfg->fp, "\t.long 0x%08x\n", klass->rank);
+ }
+}
+
+static void
+emit_field_info (MonoAotCompile *cfg, MonoClassField *field)
+{
+ emit_klass_info (cfg, field->parent);
+ fprintf (cfg->fp, "\t.long 0x%08x\n", mono_get_field_token (field));
+}
+
+#if defined(__ppc__) && defined(__MACH__)
+static int
+ilog2(register int value)
+{
+ int count = -1;
+ while (value & ~0xf) count += 4, value >>= 4;
+ while (value) count++, value >>= 1;
+ return count;
+}
+#endif
+
+static void
+emit_alignment(FILE *fp, int size)
+{
+#if defined(__ppc__) && defined(__MACH__)
+ // the mach-o assembler specifies alignments as powers of 2.
+ fprintf (fp, "\t.align %d\t; ilog2\n", ilog2(size));
+#elif defined(__powerpc__)
+ /* ignore on linux/ppc */
+#else
+ fprintf (fp, "\t.align %d\n", size);
+#endif
+}
+
+G_GNUC_UNUSED static void
+emit_pointer (FILE *fp, const char *target)
+{
+ emit_alignment (fp, sizeof (gpointer));
+#if defined(__x86_64__)
+ fprintf (fp, "\t.quad %s\n", target);
+#elif defined(sparc) && SIZEOF_VOID_P == 8
+ fprintf (fp, "\t.xword %s\n", target);
+#else
+ fprintf (fp, "\t.long %s\n", target);
+#endif
+}
+
+static gint
+compare_patches (gconstpointer a, gconstpointer b)
+{
+ int i, j;
+
+ i = (*(MonoJumpInfo**)a)->ip.i;
+ j = (*(MonoJumpInfo**)b)->ip.i;
+
+ if (i < j)
+ return -1;
+ else
+ if (i > j)
+ return 1;
+ else
+ return 0;
+}
+
+static void
+emit_method (MonoAotCompile *acfg, MonoCompile *cfg)
+{
+ MonoMethod *method;
+ GList *l;
+ FILE *tmpfp;
+ int i, j, k, pindex;
+ guint8 *code, *mname, *mname_p;
+ int func_alignment = 16;
+ GPtrArray *patches;
+ MonoJumpInfo *patch_info;
+ MonoMethodHeader *header;
+ guint32 last_offset;
+
+ tmpfp = acfg->fp;
+ method = cfg->method;
+ code = cfg->native_code;
+ header = mono_method_get_header (method);
+
+ emit_section_change (tmpfp, ".text", 0);
+ mname = g_strdup_printf ("m_%x", mono_metadata_token_index (method->token));
+ mname_p = g_strdup_printf ("%s_p", mname);
+ emit_alignment(tmpfp, func_alignment);
+ emit_global(tmpfp, mname);
+#if defined(sparc)
+ fprintf (tmpfp, "\t.type %s,#function\n", mname);
+#elif !(defined(__ppc__) && defined(__MACH__))
+ fprintf (tmpfp, "\t.type %s,@function\n", mname);
+#endif
+ emit_label(tmpfp, mname);
+
+ for (i = 0; i < cfg->code_len; i++)
+ fprintf (tmpfp, ".byte %d\n", (unsigned int) code [i]);
+
+ emit_section_change (tmpfp, ".text", 1);
+
+ /* Sort relocations */
+ patches = g_ptr_array_new ();
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next)
+ g_ptr_array_add (patches, patch_info);
+ g_ptr_array_sort (patches, compare_patches);
+
+ emit_global (tmpfp, mname_p);
+ emit_alignment (tmpfp, sizeof (gpointer));
+ emit_label (tmpfp, mname_p);
+
+ fprintf (tmpfp, "\t.long %d\n", cfg->code_len);
+ fprintf (tmpfp, "\t.long %ld\n", (long)cfg->used_int_regs);
+
+ /* Exception table */
+ if (header->num_clauses) {
+ MonoJitInfo *jinfo = cfg->jit_info;
+
+ fprintf (tmpfp, "\t.long %d\n", jinfo->exvar_offset);
+
+ for (k = 0; k < header->num_clauses; ++k) {
+ MonoJitExceptionInfo *ei = &jinfo->clauses [k];
+
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)
+ fprintf (tmpfp, "\t.long %d\n", (gint)((guint8*)ei->data.filter - code));
+ else
+ /* the class is loaded from the header: optimize away later */
+ fprintf (tmpfp, "\t.long %d\n", 0);
+
+ fprintf (tmpfp, "\t.long %d\n", (gint)((guint8*)ei->try_start - code));
+ fprintf (tmpfp, "\t.long %d\n", (gint)((guint8*)ei->try_end - code));
+ fprintf (tmpfp, "\t.long %d\n", (gint)((guint8*)ei->handler_start - code));
+ }
+ }
+
+ /* String table */
+ if (cfg->opt & MONO_OPT_SHARED) {
+ fprintf (tmpfp, "\t.long %d\n", g_list_length (cfg->ldstr_list));
+ for (l = cfg->ldstr_list; l; l = l->next) {
+ fprintf (tmpfp, "\t.long 0x%08lx\n", (long)l->data);
+ }
+ }
+ else
+ /* Used only in shared mode */
+ g_assert (!cfg->ldstr_list);
+
+ //printf ("M: %s (%s).\n", mono_method_full_name (method, TRUE), mname);
+
+ /* First emit the type+position table */
+ last_offset = 0;
+ j = 0;
+ for (pindex = 0; pindex < patches->len; ++pindex) {
+ guint32 offset;
+ patch_info = g_ptr_array_index (patches, pindex);
+
+ if ((patch_info->type == MONO_PATCH_INFO_LABEL) ||
+ (patch_info->type == MONO_PATCH_INFO_BB))
+ /* Nothing to do */
+ continue;
+
+ j ++;
+ //printf ("T: %d O: %d.\n", patch_info->type, patch_info->ip.i);
+ offset = patch_info->ip.i - last_offset;
+ last_offset = patch_info->ip.i;
+
+ /* Encode type+position compactly */
+ g_assert (patch_info->type < 64);
+ if (offset < 1024 - 1) {
+ fprintf (tmpfp, "\t.byte %d\n", (patch_info->type << 2) + (offset >> 8));
+ fprintf (tmpfp, "\t.byte %d\n", offset & ((1 << 8) - 1));
+ }
+ else {
+ fprintf (tmpfp, "\t.byte %d\n", (patch_info->type << 2) + 3);
+ fprintf (tmpfp, "\t.byte %d\n", 255);
+ emit_alignment(tmpfp, 4);
+ fprintf (tmpfp, "\t.long %d\n", offset);
+ }
+ }
+
+ if (j) {
+ /*
+ * 0 is PATCH_INFO_BB, which can't be in the file.
+ */
+ /* NULL terminated array */
+ fprintf (tmpfp, "\t.byte 0\n");
+
+ emit_alignment (tmpfp, sizeof (gpointer));
+
+ /* Then emit the other info */
+ for (pindex = 0; pindex < patches->len; ++pindex) {
+ patch_info = g_ptr_array_index (patches, pindex);
+
+ if ((patch_info->type == MONO_PATCH_INFO_LABEL) ||
+ (patch_info->type == MONO_PATCH_INFO_BB))
+ /* Nothing to do */
+ continue;
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_LABEL:
+ case MONO_PATCH_INFO_BB:
+ break;
+ case MONO_PATCH_INFO_IMAGE:
+ fprintf (tmpfp, "\t.long 0x%08x\n", get_image_index (acfg, patch_info->data.image));
+ break;
+ case MONO_PATCH_INFO_METHOD_REL:
+ fprintf (tmpfp, "\t.long 0x%08x\n", (gint)patch_info->data.offset);
+ break;
+ case MONO_PATCH_INFO_SWITCH: {
+ gpointer *table = (gpointer *)patch_info->data.target;
+ int k;
+
+ fprintf (tmpfp, "\t.long %d\n", patch_info->table_size);
+
+ for (k = 0; k < patch_info->table_size; k++) {
+ fprintf (tmpfp, "\t.long %d\n", (int)(gssize)table [k]);
+ }
+ break;
+ }
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_METHOD:
+ case MONO_PATCH_INFO_METHOD_JUMP: {
+ guint32 image_index = get_image_index (acfg, patch_info->data.method->klass->image);
+ guint32 token = patch_info->data.method->token;
+ g_assert (image_index < 256);
+ g_assert (mono_metadata_token_table (token) == MONO_TABLE_METHOD);
+
+ fprintf (tmpfp, "\t.long 0x%08x\n", (image_index << 24) + (mono_metadata_token_index (token)));
+ break;
+ }
+ case MONO_PATCH_INFO_INTERNAL_METHOD: {
+ guint32 icall_index;
+
+ icall_index = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->icall_hash, patch_info->data.name));
+ if (!icall_index) {
+ icall_index = g_hash_table_size (acfg->icall_hash) + 1;
+ g_hash_table_insert (acfg->icall_hash, (gpointer)patch_info->data.name,
+ GUINT_TO_POINTER (icall_index));
+ g_ptr_array_add (acfg->icall_table, (gpointer)patch_info->data.name);
+ }
+ fprintf (tmpfp, "\t.long 0x%08x\n", icall_index - 1);
+ break;
+ }
+ case MONO_PATCH_INFO_LDSTR:
+ case MONO_PATCH_INFO_LDTOKEN:
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE:
+ fprintf (tmpfp, "\t.long 0x%08x\n", get_image_index (acfg, patch_info->data.token->image));
+ fprintf (tmpfp, "\t.long 0x%08x\n", patch_info->data.token->token);
+ break;
+ case MONO_PATCH_INFO_EXC_NAME: {
+ MonoClass *ex_class;
+
+ ex_class =
+ mono_class_from_name (mono_defaults.exception_class->image,
+ "System", patch_info->data.target);
+ g_assert (ex_class);
+ emit_klass_info (acfg, ex_class);
+ break;
+ }
+ case MONO_PATCH_INFO_R4:
+ fprintf (tmpfp, "\t.long 0x%08x\n", *((guint32 *)patch_info->data.target));
+ break;
+ case MONO_PATCH_INFO_R8:
+ emit_alignment (tmpfp, 8);
+ fprintf (tmpfp, "\t.long 0x%08x\n", *((guint32 *)patch_info->data.target));
+ fprintf (tmpfp, "\t.long 0x%08x\n", *(((guint32 *)patch_info->data.target) + 1));
+ break;
+ case MONO_PATCH_INFO_VTABLE:
+ case MONO_PATCH_INFO_CLASS_INIT:
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IID:
+ emit_klass_info (acfg, patch_info->data.klass);
+ break;
+ case MONO_PATCH_INFO_FIELD:
+ case MONO_PATCH_INFO_SFLDA:
+ emit_field_info (acfg, patch_info->data.field);
+ break;
+ case MONO_PATCH_INFO_WRAPPER: {
+ fprintf (tmpfp, "\t.long %d\n", patch_info->data.method->wrapper_type);
+
+ switch (patch_info->data.method->wrapper_type) {
+ case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK: {
+ MonoMethod *m;
+ guint32 image_index;
+ guint32 token;
+
+ m = mono_marshal_method_from_wrapper (patch_info->data.method);
+ image_index = get_image_index (acfg, m->klass->image);
+ token = m->token;
+ g_assert (image_index < 256);
+ g_assert (mono_metadata_token_table (token) == MONO_TABLE_METHOD);
+
+ fprintf (tmpfp, "\t.long %d\n", (image_index << 24) + (mono_metadata_token_index (token)));
+ break;
+ }
+ case MONO_WRAPPER_PROXY_ISINST:
+ case MONO_WRAPPER_LDFLD:
+ case MONO_WRAPPER_STFLD: {
+ MonoClass *proxy_class = (MonoClass*)mono_marshal_method_from_wrapper (patch_info->data.method);
+ emit_klass_info (acfg, proxy_class);
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ }
+ break;
+ }
+ default:
+ g_warning ("unable to handle jump info %d", patch_info->type);
+ g_assert_not_reached ();
+ }
+ }
+ }
+
+ {
+ guint8 *buf;
+ guint32 buf_len;
+
+ mono_debug_serialize_debug_info (cfg, &buf, &buf_len);
+
+ fprintf (tmpfp, "\t.long %d\n", buf_len);
+
+ for (i = 0; i < buf_len; ++i)
+ fprintf (tmpfp, ".byte %d\n", (unsigned int) buf [i]);
+
+ if (buf_len > 0)
+ g_free (buf);
+ }
+
+ /* fixme: save the rest of the required infos */
+
+ g_free (mname);
+ g_free (mname_p);
+}
+
+static gboolean
+str_begins_with (const char *str1, const char *str2)
+{
+ int len = strlen (str2);
+ return strncmp (str1, str2, len) == 0;
+}
+
+static void
+mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts)
+{
+ gchar **args, **ptr;
+
+ memset (opts, 0, sizeof (*opts));
+
+ args = g_strsplit (aot_options ? aot_options : "", ",", -1);
+ for (ptr = args; ptr && *ptr; ptr ++) {
+ const char *arg = *ptr;
+
+ if (str_begins_with (arg, "outfile=")) {
+ opts->outfile = g_strdup (arg + strlen ("outfile="));
+ }
+ else {
+ fprintf (stderr, "AOT : Unknown argument '%s'.\n", arg);
+ exit (1);
+ }
+ }
+}
+
+int
+mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
+{
+ MonoCompile *cfg;
+ MonoImage *image = ass->image;
+ MonoMethod *method;
+ char *com, *tmpfname, *opts_str;
+ FILE *tmpfp;
+ int i;
+ guint8 *symbol;
+ int ccount = 0, mcount = 0, lmfcount = 0, abscount = 0, wrappercount = 0, ocount = 0;
+ GHashTable *ref_hash;
+ MonoAotCompile *acfg;
+ gboolean *emitted;
+ MonoAotOptions aot_opts;
+ char *outfile_name, *tmp_outfile_name;
+
+ printf ("Mono Ahead of Time compiler - compiling assembly %s\n", image->name);
+
+ mono_aot_parse_options (aot_options, &aot_opts);
+
+ i = g_file_open_tmp ("mono_aot_XXXXXX", &tmpfname, NULL);
+ tmpfp = fdopen (i, "w+");
+ g_assert (tmpfp);
+
+ ref_hash = g_hash_table_new (NULL, NULL);
+
+ acfg = g_new0 (MonoAotCompile, 1);
+ acfg->fp = tmpfp;
+ acfg->ref_hash = ref_hash;
+ acfg->icall_hash = g_hash_table_new (NULL, NULL);
+ acfg->icall_table = g_ptr_array_new ();
+ acfg->image_hash = g_hash_table_new (NULL, NULL);
+ acfg->image_table = g_ptr_array_new ();
+
+ write_string_symbol (tmpfp, "mono_assembly_guid" , image->guid);
+
+ write_string_symbol (tmpfp, "mono_aot_version", MONO_AOT_FILE_VERSION);
+
+ opts_str = g_strdup_printf ("%d", opts);
+ write_string_symbol (tmpfp, "mono_aot_opt_flags", opts_str);
+ g_free (opts_str);
+
+ emitted = g_new0 (gboolean, image->tables [MONO_TABLE_METHOD].rows);
+
+ for (i = 0; i < image->tables [MONO_TABLE_METHOD].rows; ++i) {
+ MonoJumpInfo *patch_info;
+ gboolean skip;
+ guint32 token = MONO_TOKEN_METHOD_DEF | (i + 1);
+ method = mono_get_method (image, token, NULL);
+
+ /* fixme: maybe we can also precompile wrapper methods */
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->flags & METHOD_ATTRIBUTE_ABSTRACT)) {
+ //printf ("Skip (impossible): %s\n", mono_method_full_name (method, TRUE));
+ continue;
+ }
+
+ mcount++;
+
+ /* fixme: we need to patch the IP for the LMF in that case */
+ if (method->save_lmf) {
+ //printf ("Skip (needs lmf): %s\n", mono_method_full_name (method, TRUE));
+ lmfcount++;
+ continue;
+ }
+
+ //printf ("START: %s\n", mono_method_full_name (method, TRUE));
+ //mono_compile_method (method);
+
+ cfg = mini_method_compile (method, opts, mono_get_root_domain (), FALSE, 0);
+ g_assert (cfg);
+
+ if (cfg->disable_aot) {
+ printf ("Skip (other): %s\n", mono_method_full_name (method, TRUE));
+ ocount++;
+ continue;
+ }
+
+ skip = FALSE;
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_ABS) {
+ /* unable to handle this */
+ //printf ("Skip (abs addr): %s %d\n", mono_method_full_name (method, TRUE), patch_info->type);
+ skip = TRUE;
+ break;
+ }
+ }
+
+ if (skip) {
+ abscount++;
+ continue;
+ }
+
+ /* some wrappers are very common */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_METHODCONST) {
+ switch (patch_info->data.method->wrapper_type) {
+ case MONO_WRAPPER_PROXY_ISINST:
+ patch_info->type = MONO_PATCH_INFO_WRAPPER;
+ }
+ }
+
+ if (patch_info->type == MONO_PATCH_INFO_METHOD) {
+ switch (patch_info->data.method->wrapper_type) {
+ case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK:
+ case MONO_WRAPPER_STFLD:
+ case MONO_WRAPPER_LDFLD:
+ patch_info->type = MONO_PATCH_INFO_WRAPPER;
+ break;
+ }
+ }
+ }
+
+ skip = FALSE;
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if ((patch_info->type == MONO_PATCH_INFO_METHOD ||
+ patch_info->type == MONO_PATCH_INFO_METHODCONST)) {
+ if (patch_info->data.method->wrapper_type) {
+ /* unable to handle this */
+ //printf ("Skip (wrapper call): %s %d -> %s\n", mono_method_full_name (method, TRUE), patch_info->type, mono_method_full_name (patch_info->data.method, TRUE));
+ skip = TRUE;
+ break;
+ }
+ if (!patch_info->data.method->token) {
+ /*
+ * The method is part of a constructed type like Int[,].Set (). It doesn't
+ * have a token, and we can't make one, since the parent type is part of
+ * assembly which contains the element type, and not the assembly which
+ * referenced this type.
+ */
+ skip = TRUE;
+ break;
+ }
+ }
+ }
+
+ if (skip) {
+ wrappercount++;
+ continue;
+ }
+
+ //printf ("Compile: %s\n", mono_method_full_name (method, TRUE));
+
+ emitted [i] = TRUE;
+ emit_method (acfg, cfg);
+
+ mono_destroy_compile (cfg);
+
+ ccount++;
+ }
+
+ /*
+ * The icall and image tables are small but referenced in a lot of places.
+ * So we emit them at once, and reference their elements by an index
+ * instead of an assembly label to cut back on the number of relocations.
+ */
+
+ /* Emit icall table */
+
+ symbol = g_strdup_printf ("mono_icall_table");
+ emit_section_change (tmpfp, ".text", 1);
+ emit_global(tmpfp, symbol);
+ emit_alignment(tmpfp, 8);
+ emit_label(tmpfp, symbol);
+ fprintf (tmpfp, ".long %d\n", acfg->icall_table->len);
+ for (i = 0; i < acfg->icall_table->len; i++)
+ fprintf (tmpfp, "%s \"%s\"\n", AS_STRING_DIRECTIVE, (char*)g_ptr_array_index (acfg->icall_table, i));
+
+ /* Emit image table */
+
+ symbol = g_strdup_printf ("mono_image_table");
+ emit_section_change (tmpfp, ".text", 1);
+ emit_global(tmpfp, symbol);
+ emit_alignment(tmpfp, 8);
+ emit_label(tmpfp, symbol);
+ fprintf (tmpfp, ".long %d\n", acfg->image_table->len);
+ for (i = 0; i < acfg->image_table->len; i++)
+ fprintf (tmpfp, "%s \"%s\"\n", AS_STRING_DIRECTIVE, ((MonoImage*)g_ptr_array_index (acfg->image_table, i))->guid);
+
+ /*
+ * g_module_symbol takes a lot of time for failed lookups, so we emit
+ * a table which contains one bit for each method. This bit specifies
+ * whenever the method is emitted or not.
+ */
+
+ symbol = g_strdup_printf ("mono_methods_present_table");
+ emit_section_change (tmpfp, ".text", 1);
+ emit_global(tmpfp, symbol);
+ emit_alignment(tmpfp, 8);
+ emit_label(tmpfp, symbol);
+ {
+ guint32 k, nrows;
+ guint32 w;
+
+ nrows = image->tables [MONO_TABLE_METHOD].rows;
+ for (i = 0; i < nrows / 32 + 1; ++i) {
+ w = 0;
+ for (k = 0; k < 32; ++k) {
+ if (emitted [(i * 32) + k])
+ w += (1 << k);
+ }
+ //printf ("EMITTED [%d] = %d.\n", i, b);
+ fprintf (tmpfp, "\t.long %d\n", w);
+ }
+ }
+
+ fclose (tmpfp);
+
+#if defined(__x86_64__)
+ com = g_strdup_printf ("as --64 %s -o %s.o", tmpfname, tmpfname);
+#elif defined(sparc) && SIZEOF_VOID_P == 8
+ com = g_strdup_printf ("as -xarch=v9 %s -o %s.o", tmpfname, tmpfname);
+#else
+ com = g_strdup_printf ("as %s -o %s.o", tmpfname, tmpfname);
+#endif
+ printf ("Executing the native assembler: %s\n", com);
+ if (system (com) != 0) {
+ g_free (com);
+ return 1;
+ }
+
+ g_free (com);
+
+ if (aot_opts.outfile)
+ outfile_name = g_strdup_printf ("%s", aot_opts.outfile);
+ else
+ outfile_name = g_strdup_printf ("%s%s", image->name, SHARED_EXT);
+
+ tmp_outfile_name = g_strdup_printf ("%s.tmp", outfile_name);
+
+#if defined(sparc)
+ com = g_strdup_printf ("ld -shared -G -o %s %s.o", outfile_name, tmpfname);
+#elif defined(__ppc__) && defined(__MACH__)
+ com = g_strdup_printf ("gcc -dynamiclib -o %s %s.o", outfile_name, tmpfname);
+#else
+ com = g_strdup_printf ("ld -shared -o %s %s.o", outfile_name, tmpfname);
+#endif
+ printf ("Executing the native linker: %s\n", com);
+ if (system (com) != 0) {
+ g_free (tmp_outfile_name);
+ g_free (outfile_name);
+ g_free (com);
+ return 1;
+ }
+
+ g_free (com);
+ com = g_strdup_printf ("%s.o", tmpfname);
+ unlink (com);
+ g_free (com);
+ /*com = g_strdup_printf ("strip --strip-unneeded %s%s", image->name, SHARED_EXT);
+ printf ("Stripping the binary: %s\n", com);
+ system (com);
+ g_free (com);*/
+
+ rename (tmp_outfile_name, outfile_name);
+
+ g_free (tmp_outfile_name);
+ g_free (outfile_name);
+
+ printf ("Compiled %d out of %d methods (%d%%)\n", ccount, mcount, mcount ? (ccount*100)/mcount : 100);
+ printf ("%d methods contain absolute addresses (%d%%)\n", abscount, mcount ? (abscount*100)/mcount : 100);
+ printf ("%d methods contain wrapper references (%d%%)\n", wrappercount, mcount ? (wrappercount*100)/mcount : 100);
+ printf ("%d methods contain lmf pointers (%d%%)\n", lmfcount, mcount ? (lmfcount*100)/mcount : 100);
+ printf ("%d methods have other problems (%d%%)\n", ocount, mcount ? (ocount*100)/mcount : 100);
+ //printf ("Retained input file.\n");
+ unlink (tmpfname);
+
+ return 0;
+}
+
+
diff --git a/mono/mini/arrays.cs b/mono/mini/arrays.cs
new file mode 100644
index 00000000000..cf31e02a7e4
--- /dev/null
+++ b/mono/mini/arrays.cs
@@ -0,0 +1,191 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static int test_10_create () {
+ int[] a = new int [10];
+ return a.Length;
+ }
+
+ static int test_0_unset_value () {
+ int[] a = new int [10];
+ return a [5];
+ }
+
+ static int test_3_set_value () {
+ int[] a = new int [10];
+ a [5] = 3;
+ return a [5];
+ }
+
+ static int test_0_char_array_1 () {
+ int value = -30;
+ char[] tmp = new char [20];
+ char[] digitLowerTable = new char[16];
+ tmp[0] = digitLowerTable[-(value % 10)];
+ return 0;
+ }
+
+ static int test_0_char_array_2 () {
+ int value = 5;
+ char[] tmp = new char [20];
+ char[] digitLowerTable = new char[16];
+ tmp[0] = digitLowerTable[value % 10];
+ return 0;
+ }
+
+ static int test_0_char_array_3 () {
+ int value = -1;
+ char[] tmp = new char [20];
+ char[] digitLowerTable = new char[16];
+ tmp [0] = digitLowerTable[value & 15];
+ return 0;
+ }
+
+ unsafe static int test_0_byte_array () {
+ byte [] src = new byte [8];
+ double ret;
+ byte *dst = (byte *)&ret;
+ int start = 0;
+
+ dst[0] = src[4 + start];
+
+ return 0;
+ }
+
+ public static int test_0_set_after_shift () {
+ int [] n = new int [1];
+ int b = 16;
+
+ n [0] = 100 + (1 << (16 - b));
+
+ if (n [0] != 101)
+ return 1;
+
+ return 0;
+ }
+
+ /* Regression test for #30073 */
+ public static int test_0_newarr_emulation () {
+ double d = 500;
+ checked {
+ double [] arr = new double [(int)d];
+ }
+ return 0;
+ }
+
+ private Int32[] m_array = new int [10];
+
+ void setBit (int bitIndex, bool value) {
+ int index = bitIndex/32;
+ int shift = bitIndex%32;
+
+ Int32 theBit = 1 << shift;
+ if (value)
+ m_array[index] |= theBit;
+ else
+ m_array[index] &= ~theBit;
+ }
+
+ bool getBit (int bitIndex) {
+ int index = bitIndex/32;
+ int shift = bitIndex%32;
+
+ Int32 theBit = m_array[index] & (1 << shift);
+ return (theBit == 0) ? false : true;
+
+ }
+
+ public static int test_1_bit_index () {
+ Tests t = new Tests ();
+ t.setBit (0, true);
+ t.setBit (3, true);
+ if (t.getBit (1))
+ return 4;
+ if (!t.getBit (0))
+ return 5;
+ if (!t.getBit (3))
+ return 6;
+ return 1;
+ }
+
+ class helper1 {
+
+ int [] ma = new int [56];
+ const int MBIG = int.MaxValue;
+
+ public helper1 () {
+ for (int k = 1; k < 5; k++) {
+ for (int i = 1; i < 56; i++) {
+ ma [i] -= ma [1 + (i + 30) % 55];
+ if (ma [i] < 0)
+ ma [i] += MBIG;
+ }
+ }
+ }
+ }
+
+ public static int test_2_regalloc () {
+ helper1 h = new helper1 ();
+ return 2;
+ }
+
+ public static int test_0_stelemref_1 () {
+ object [] o = new object [1];
+ o [0] = null;
+
+ return 0;
+ }
+
+ public static int test_0_stelemref_2 () {
+ object [] o = new object [1];
+ o [0] = 1;
+
+ return 0;
+ }
+
+ interface IFace {}
+ class Face : IFace {}
+
+ public static int test_0_stelemref_3 () {
+ object [] o = new IFace [1];
+ o [0] = new Face ();
+
+ return 0;
+ }
+
+ public static int test_0_stelemref_4 () {
+ object [][] o = new object [5] [];
+ o [0] = new object [5];
+
+ return 0;
+ }
+}
+
diff --git a/mono/mini/basic-calls.cs b/mono/mini/basic-calls.cs
new file mode 100644
index 00000000000..879d4851223
--- /dev/null
+++ b/mono/mini/basic-calls.cs
@@ -0,0 +1,290 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static void dummy () {
+ }
+
+ static int test_0_return () {
+ dummy ();
+ return 0;
+ }
+
+ static int dummy1 () {
+ return 1;
+ }
+
+ static int test_2_int_return () {
+ int r = dummy1 ();
+ if (r == 1)
+ return 2;
+ return 0;
+ }
+
+ static int add1 (int val) {
+ return val + 1;
+ }
+
+ static int test_1_int_pass () {
+ int r = add1 (5);
+ if (r == 6)
+ return 1;
+ return 0;
+ }
+
+ static int add_many (int val, short t, byte b, int da) {
+ return val + t + b + da;
+ }
+
+ static int test_1_int_pass_many () {
+ byte b = 6;
+ int r = add_many (5, 2, b, 1);
+ if (r == 14)
+ return 1;
+ return 0;
+ }
+
+ unsafe static float GetFloat (byte *ptr) {
+ return *(float*)ptr;
+ }
+
+ unsafe public static float GetFloat(float value)
+ {
+ return GetFloat((byte *)&value);
+ }
+
+ /* bug #42134 */
+ static int test_2_inline_saved_arg_type () {
+ float f = 100.0f;
+ return GetFloat (f) == f? 2: 1;
+ }
+
+ static int pass_many_types (int a, long b, int c, long d) {
+ return a + (int)b + c + (int)d;
+ }
+
+ static int test_5_pass_longs () {
+ return pass_many_types (1, 2, -5, 7);
+ }
+
+ static int overflow_registers (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j) {
+ return a+b+c+d+e+f+g+h+i+j;
+ }
+
+ static int test_55_pass_even_more () {
+ return overflow_registers (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ }
+
+ static int pass_ints_longs (int a, long b, long c, long d, long e, int f, long g) {
+ return (int)(a + b + c + d + e + f + g);
+ }
+
+ static int test_1_sparc_argument_passing () {
+ // The 4. argument tests split reg/mem argument passing
+ // The 5. argument tests mem argument passing
+ // The 7. argument tests passing longs in misaligned memory
+ // The MaxValues are needed so the MS word of the long is not 0
+ return pass_ints_longs (1, 2, System.Int64.MaxValue, System.Int64.MinValue, System.Int64.MaxValue, 0, System.Int64.MinValue);
+ }
+
+ static int pass_bytes (byte a, byte b, byte c, byte d, byte e, byte f, byte g) {
+ return (int)(a + b + c + d + e + f + g);
+ }
+
+ static int test_21_sparc_byte_argument_passing () {
+ return pass_bytes (0, 1, 2, 3, 4, 5, 6);
+ }
+
+ static int pass_sbytes (sbyte a, sbyte b, sbyte c, sbyte d, sbyte e, sbyte f, sbyte g) {
+ return (int)(a + b + c + d + e + f + g);
+ }
+
+ static int test_21_sparc_sbyte_argument_passing () {
+ return pass_sbytes (0, 1, 2, 3, 4, 5, 6);
+ }
+
+ static int pass_shorts (short a, short b, short c, short d, short e, short f, short g) {
+ return (int)(a + b + c + d + e + f + g);
+ }
+
+ static int test_21_sparc_short_argument_passing () {
+ return pass_shorts (0, 1, 2, 3, 4, 5, 6);
+ }
+
+ static int pass_floats_doubles (float a, double b, double c, double d, double e, float f, double g) {
+ return (int)(a + b + c + d + e + f + g);
+ }
+
+ static int test_721_sparc_float_argument_passing () {
+ return pass_floats_doubles (100.0f, 101.0, 102.0, 103.0, 104.0, 105.0f, 106.0);
+ }
+
+ static float pass_floats (float a, float b, float c, float d, float e, float f, float g, float h, float i, float j) {
+ return a + b + c + d + e + f + g + h + i + j;
+ }
+
+ static int test_55_sparc_float_argument_passing2 () {
+ return (int)pass_floats (1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
+ }
+
+ // The first argument must be passed on a dword aligned stack location
+ static int pass_byref_ints_longs (ref long a, ref int b, ref byte c, ref short d, ref long e, ref int f, ref long g) {
+ return (int)(a + b + c + d + e + f + g);
+ }
+
+ static int pass_takeaddr_ints_longs (long a, int b, byte c, short d, long e, int f, long g) {
+ return pass_byref_ints_longs (ref a, ref b, ref c, ref d, ref e, ref f, ref g);
+ }
+
+ // Test that arguments are moved to the stack from incoming registers
+ // when the argument must reside in the stack because its address is taken
+ static int test_2_sparc_takeaddr_argument_passing () {
+ return pass_takeaddr_ints_longs (1, 2, 253, -253, System.Int64.MaxValue, 0, System.Int64.MinValue);
+ }
+
+ static int pass_byref_floats_doubles (ref float a, ref double b, ref double c, ref double d, ref double e, ref float f, ref double g) {
+ return (int)(a + b + c + d + e + f + g);
+ }
+
+ static int pass_takeaddr_floats_doubles (float a, double b, double c, double d, double e, float f, double g) {
+ return pass_byref_floats_doubles (ref a, ref b, ref c, ref d, ref e, ref f, ref g);
+ }
+
+ static int test_721_sparc_takeaddr_argument_passing2 () {
+ return pass_takeaddr_floats_doubles (100.0f, 101.0, 102.0, 103.0, 104.0, 105.0f, 106.0);
+ }
+
+ static void pass_byref_double (out double d) {
+ d = 5.0;
+ }
+
+ // Test byref double argument passing
+ static int test_0_sparc_byref_double_argument_passing () {
+ double d;
+ pass_byref_double (out d);
+ return (d == 5.0) ? 0 : 1;
+ }
+
+ static void shift_un_arg (ulong value) {
+ do {
+ value = value >> 4;
+ } while (value != 0);
+ }
+
+ // Test that assignment to long arguments work
+ static int test_0_long_arg_assign ()
+ {
+ ulong c = 0x800000ff00000000;
+
+ shift_un_arg (c >> 4);
+
+ return 0;
+ }
+
+ static unsafe void* ptr_return (void *ptr)
+ {
+ return ptr;
+ }
+
+ static unsafe int test_0_ptr_return ()
+ {
+ void *ptr = new IntPtr (55).ToPointer ();
+
+ if (ptr_return (ptr) == ptr)
+ return 0;
+ else
+ return 1;
+ }
+
+ static bool isnan (float f) {
+ return (f != f);
+ }
+
+ static int test_0_isnan () {
+ float f = 1.0f;
+ return isnan (f) ? 1 : 0;
+ }
+
+ struct FooStruct {
+
+ public FooStruct (long l) {
+ }
+ }
+
+ static int test_0_calls_opcode_emulation () {
+ // Test that emulated opcodes do not clobber arguments already in
+ // out registers
+ checked {
+ long val = 10000;
+ new FooStruct (val * 10000);
+ }
+ return 0;
+ }
+
+ static uint dum_de_dum = 1;
+ static int test_0_long_arg_opt ()
+ {
+ return Foo (0x1234567887654321, dum_de_dum);
+ }
+
+ static int Foo (ulong x, ulong y)
+ {
+ if (x != 0x1234567887654321)
+ return 1;
+
+ if (y != 1)
+ return 2;
+
+ return 0;
+ }
+
+ static int test_0_long_ret_opt ()
+ {
+ ulong x = X ();
+ if (x != 0x1234567887654321)
+ return 1;
+ ulong y = Y ();
+ if (y != 1)
+ return 2;
+
+ return 0;
+ }
+
+ static ulong X ()
+ {
+ return 0x1234567887654321;
+ }
+
+ static ulong Y ()
+ {
+ return dum_de_dum;
+ }
+}
+
diff --git a/mono/mini/basic-float.cs b/mono/mini/basic-float.cs
new file mode 100644
index 00000000000..b2aff5dad30
--- /dev/null
+++ b/mono/mini/basic-float.cs
@@ -0,0 +1,518 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static int test_0_beq () {
+ double a = 2.0;
+ if (a != 2.0)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_bne_un () {
+ double a = 2.0;
+ if (a == 1.0)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_conv_r8 () {
+ double a = 2;
+ if (a != 2.0)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_conv_i () {
+ double a = 2.0;
+ int i = (int)a;
+ if (i != 2)
+ return 1;
+ uint ui = (uint)a;
+ if (ui != 2)
+ return 2;
+ short s = (short)a;
+ if (s != 2)
+ return 3;
+ ushort us = (ushort)a;
+ if (us != 2)
+ return 4;
+ byte b = (byte)a;
+ if (b != 2)
+ return 5;
+ return 0;
+ }
+
+ static int test_5_conv_r4 () {
+ int i = 5;
+ float f = (float)i;
+ return (int)f;
+ }
+
+ static int test_5_double_conv_r4 () {
+ double d = 5.0;
+ float f = (float)d;
+ return (int)f;
+ }
+
+ static int test_5_float_conv_r8 () {
+ float f = 5.0F;
+ double d = (double)f;
+ return (int)d;
+ }
+
+ static int test_5_conv_r8 () {
+ int i = 5;
+ double f = (double)i;
+ return (int)f;
+ }
+
+ static int test_5_add () {
+ double a = 2.0;
+ double b = 3.0;
+ return (int)(a + b);
+ }
+
+ static int test_5_sub () {
+ double a = 8.0;
+ double b = 3.0;
+ return (int)(a - b);
+ }
+
+ static int test_24_mul () {
+ double a = 8.0;
+ double b = 3.0;
+ return (int)(a * b);
+ }
+
+ static int test_4_div () {
+ double a = 8.0;
+ double b = 2.0;
+ return (int)(a / b);
+ }
+
+ static int test_2_rem () {
+ double a = 8.0;
+ double b = 3.0;
+ return (int)(a % b);
+ }
+
+ static int test_2_neg () {
+ double a = -2.0;
+ return (int)(-a);
+ }
+
+ static int test_46_float_add_spill () {
+ // we overflow the FP stack
+ double a = 1;
+ double b = 2;
+ double c = 3;
+ double d = 4;
+ double e = 5;
+ double f = 6;
+ double g = 7;
+ double h = 8;
+ double i = 9;
+
+ return (int)(1.0 + (a + (b + (c + (d + (e + (f + (g + (h + i)))))))));
+ }
+
+ static int test_4_float_sub_spill () {
+ // we overflow the FP stack
+ double a = 1;
+ double b = 2;
+ double c = 3;
+ double d = 4;
+ double e = 5;
+ double f = 6;
+ double g = 7;
+ double h = 8;
+ double i = 9;
+
+ return -(int)(1.0 - (a - (b - (c - (d - (e - (f - (g - (h - i)))))))));
+ ////// -(int)(1.0 - (1 - (2 - (3 - (4 - (5 - (6 - (7 - (8 - 9)))))))));
+ }
+
+ static int test_362880_float_mul_spill () {
+ // we overflow the FP stack
+ double a = 1;
+ double b = 2;
+ double c = 3;
+ double d = 4;
+ double e = 5;
+ double f = 6;
+ double g = 7;
+ double h = 8;
+ double i = 9;
+
+ return (int)(1.0 * (a * (b * (c * (d * (e * (f * (g * (h * i)))))))));
+ }
+
+ static int test_4_long_cast () {
+ long a = 1000;
+ double d = (double)a;
+ long b = (long)d;
+ if (b != 1000)
+ return 0;
+ return 4;
+ }
+
+ /* FIXME: This only works on little-endian machines */
+ /*
+ static unsafe int test_2_negative_zero () {
+ int result = 0;
+ double d = -0.0;
+ float f = -0.0f;
+
+ byte *ptr = (byte*)&d;
+ if (ptr [7] == 0)
+ return result;
+ result ++;
+
+ ptr = (byte*)&f;
+ if (ptr [3] == 0)
+ return result;
+ result ++;
+
+ return result;
+ }
+ */
+
+ static int test_16_float_cmp () {
+ double a = 2.0;
+ double b = 1.0;
+ int result = 0;
+ bool val;
+
+ val = a == a;
+ if (!val)
+ return result;
+ result++;
+
+ val = (a != a);
+ if (val)
+ return result;
+ result++;
+
+ val = a < a;
+ if (val)
+ return result;
+ result++;
+
+ val = a > a;
+ if (val)
+ return result;
+ result++;
+
+ val = a <= a;
+ if (!val)
+ return result;
+ result++;
+
+ val = a >= a;
+ if (!val)
+ return result;
+ result++;
+
+ val = b == a;
+ if (val)
+ return result;
+ result++;
+
+ val = b < a;
+ if (!val)
+ return result;
+ result++;
+
+ val = b > a;
+ if (val)
+ return result;
+ result++;
+
+ val = b <= a;
+ if (!val)
+ return result;
+ result++;
+
+ val = b >= a;
+ if (val)
+ return result;
+ result++;
+
+ val = a == b;
+ if (val)
+ return result;
+ result++;
+
+ val = a < b;
+ if (val)
+ return result;
+ result++;
+
+ val = a > b;
+ if (!val)
+ return result;
+ result++;
+
+ val = a <= b;
+ if (val)
+ return result;
+ result++;
+
+ val = a >= b;
+ if (!val)
+ return result;
+ result++;
+
+ return result;
+ }
+
+ static int test_15_float_cmp_un () {
+ double a = Double.NaN;
+ double b = 1.0;
+ int result = 0;
+ bool val;
+
+ val = a == a;
+ if (val)
+ return result;
+ result++;
+
+ val = a < a;
+ if (val)
+ return result;
+ result++;
+
+ val = a > a;
+ if (val)
+ return result;
+ result++;
+
+ val = a <= a;
+ if (val)
+ return result;
+ result++;
+
+ val = a >= a;
+ if (val)
+ return result;
+ result++;
+
+ val = b == a;
+ if (val)
+ return result;
+ result++;
+
+ val = b < a;
+ if (val)
+ return result;
+ result++;
+
+ val = b > a;
+ if (val)
+ return result;
+ result++;
+
+ val = b <= a;
+ if (val)
+ return result;
+ result++;
+
+ val = b >= a;
+ if (val)
+ return result;
+ result++;
+
+ val = a == b;
+ if (val)
+ return result;
+ result++;
+
+ val = a < b;
+ if (val)
+ return result;
+ result++;
+
+ val = a > b;
+ if (val)
+ return result;
+ result++;
+
+ val = a <= b;
+ if (val)
+ return result;
+ result++;
+
+ val = a >= b;
+ if (val)
+ return result;
+ result++;
+
+ return result;
+ }
+
+ static int test_15_float_branch () {
+ double a = 2.0;
+ double b = 1.0;
+ int result = 0;
+
+ if (!(a == a))
+ return result;
+ result++;
+
+ if (a < a)
+ return result;
+ result++;
+
+ if (a > a)
+ return result;
+ result++;
+
+ if (!(a <= a))
+ return result;
+ result++;
+
+ if (!(a >= a))
+ return result;
+ result++;
+
+ if (b == a)
+ return result;
+ result++;
+
+ if (!(b < a))
+ return result;
+ result++;
+
+ if (b > a)
+ return result;
+ result++;
+
+ if (!(b <= a))
+ return result;
+ result++;
+
+ if (b >= a)
+ return result;
+ result++;
+
+ if (a == b)
+ return result;
+ result++;
+
+ if (a < b)
+ return result;
+ result++;
+
+ if (!(a > b))
+ return result;
+ result++;
+
+ if (a <= b)
+ return result;
+ result++;
+
+ if (!(a >= b))
+ return result;
+ result++;
+
+ return result;
+ }
+
+ static int test_15_float_branch_un () {
+ double a = Double.NaN;
+ double b = 1.0;
+ int result = 0;
+
+ if (a == a)
+ return result;
+ result++;
+
+ if (a < a)
+ return result;
+ result++;
+
+ if (a > a)
+ return result;
+ result++;
+
+ if (a <= a)
+ return result;
+ result++;
+
+ if (a >= a)
+ return result;
+ result++;
+
+ if (b == a)
+ return result;
+ result++;
+
+ if (b < a)
+ return result;
+ result++;
+
+ if (b > a)
+ return result;
+ result++;
+
+ if (b <= a)
+ return result;
+ result++;
+
+ if (b >= a)
+ return result;
+ result++;
+
+ if (a == b)
+ return result;
+ result++;
+
+ if (a < b)
+ return result;
+ result++;
+
+ if (a > b)
+ return result;
+ result++;
+
+ if (a <= b)
+ return result;
+ result++;
+
+ if (a >= b)
+ return result;
+ result++;
+
+ return result;
+ }
+
+}
+
diff --git a/mono/mini/basic-long.cs b/mono/mini/basic-long.cs
new file mode 100644
index 00000000000..a09442ccc23
--- /dev/null
+++ b/mono/mini/basic-long.cs
@@ -0,0 +1,840 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static int test_10_simple_cast () {
+ long a = 10;
+ return (int)a;
+ }
+
+ static int test_1_bigmul1 () {
+ int a;
+ int b;
+ long c;
+ a = 10;
+ b = 10;
+ c = (long)a * (long)b;
+ if (c == 100)
+ return 1;
+ return 0;
+ }
+
+ static int test_1_bigmul2 () {
+ int a = System.Int32.MaxValue, b = System.Int32.MaxValue;
+ long s = System.Int64.MinValue;
+ long c;
+ c = s + (long) a * (long) b;
+ if (c == -4611686022722355199)
+ return 1;
+ return 0;
+ }
+
+ static int test_1_bigmul3 () {
+ int a = 10, b = 10;
+ ulong c;
+ c = (ulong) a * (ulong) b;
+ if (c == 100)
+ return 1;
+ return 0;
+ }
+
+ static int test_1_bigmul4 () {
+ int a = System.Int32.MaxValue, b = System.Int32.MaxValue;
+ ulong c;
+ c = (ulong) a * (ulong) b;
+ if (c == 4611686014132420609)
+ return 1;
+ return 0;
+ }
+
+ static int test_1_bigmul5 () {
+ int a = System.Int32.MaxValue, b = System.Int32.MinValue;
+ long c;
+ c = (long) a * (long) b;
+ if (c == -4611686016279904256)
+ return 1;
+ return 0;
+ }
+
+ static int test_1_bigmul6 () {
+ uint a = System.UInt32.MaxValue, b = System.UInt32.MaxValue/(uint)2;
+ ulong c;
+ c = (ulong) a * (ulong) b;
+ if (c == 9223372030412324865)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_beq () {
+ long a = 0xffffffffff;
+ if (a != 0xffffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_bne_un () {
+ long a = 0xffffffffff;
+ if (a == 0xfffffffffe)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_ble () {
+ long a = 0xffffffffff;
+ if (a > 0xffffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_ble_un () {
+ ulong a = 0xffffffffff;
+ if (a > 0xffffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_bge () {
+ long a = 0xffffffffff;
+ if (a < 0xffffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_bge_un () {
+ ulong a = 0xffffffffff;
+ if (a < 0xffffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_blt () {
+ long a = 0xfffffffffe;
+ if (a >= 0xffffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_blt_un () {
+ ulong a = 0xfffffffffe;
+ if (a >= 0xffffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_bgt () {
+ long a = 0xffffffffff;
+ if (a <= 0xfffffffffe)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_conv_to_i4 () {
+ long a = 0;
+
+ return (int)a;
+ }
+ static int test_0_conv_from_i4 () {
+ long a = 2;
+ if (a != 2)
+ return 1;
+
+ int b = 2;
+
+ if (a != b)
+ return 2;
+ return 0;
+ }
+
+ static int test_0_conv_from_i4_negative () {
+ long a = -2;
+ if (a != -2)
+ return 1;
+
+ int b = -2;
+
+ if (a != b)
+ return 2;
+ return 0;
+ }
+
+ /*
+ static int test_0_conv_from_r8 () {
+ double b = 2.0;
+ long a = (long)b;
+
+ if (a != 2)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_conv_from_r4 () {
+ float b = 2.0F;
+ long a = (long)b;
+
+ if (a != 2)
+ return 1;
+ return 0;
+ }
+ */
+
+ static int test_8_and () {
+ long a = 0xffffffffff;
+ long b = 8;
+ return (int)(a & b);
+ }
+
+ static int test_8_and_imm () {
+ long a = 0xffffffffff;
+ return (int)(a & 8);
+ }
+
+ static int test_10_or () {
+ long a = 8;
+ long b = 2;
+ return (int)(a | b);
+ }
+
+ static int test_10_or_imm () {
+ long a = 8;
+ return (int)(a | 2);
+ }
+
+ static int test_5_xor () {
+ long a = 7;
+ long b = 2;
+ return (int)(a ^ b);
+ }
+
+ static int test_5_xor_imm () {
+ long a = 7;
+ return (int)(a ^ 2);
+ }
+
+ static int test_5_add () {
+ long a = 2;
+ long b = 3;
+ return (int)(a + b);
+ }
+
+ static int test_5_add_imm () {
+ long a = 2;
+ return (int)(a + 3);
+ }
+
+ static int test_0_add_imm_carry () {
+ long a = -1;
+ return (int)(a + 1);
+ }
+
+ static int test_0_add_imm_no_inc () {
+ // we can't blindly convert an add x, 1 to an inc x
+ long a = 0x1ffffffff;
+ long c;
+ c = a + 2;
+ if (c == ((a + 1) + 1))
+ return 0;
+ return 1;
+ }
+
+ static int test_4_addcc_imm () {
+ long a = 3;
+ long b = 0;
+ return (int)(a - b + 1);
+ }
+
+ static int test_5_sub () {
+ long a = 8;
+ long b = 3;
+ return (int)(a - b);
+ }
+
+ static int test_5_sub_imm () {
+ long a = 8;
+ return (int)(a - 3);
+ }
+
+ static int test_0_sub_imm_carry () {
+ long a = 0;
+ return (int)((a - 1) + 1);
+ }
+
+ static int test_2_neg () {
+ long a = -2;
+ return (int)(-a);
+ }
+
+ static int test_0_neg_large () {
+ long min = -9223372036854775808;
+ unchecked {
+ ulong ul = (ulong)min;
+ return (min == -(long)ul) ? 0 : 1;
+ }
+ }
+
+ static int test_0_shl () {
+ long a = 9;
+ int b = 1;
+
+ if ((a >> b) != 4)
+ return 1;
+
+
+ return 0;
+ }
+
+ static int test_1_rshift ()
+ {
+ long a = 9;
+ int b = 1;
+ a = -9;
+ if ((a >> b) != -5)
+ return 0;
+ return 1;
+ }
+
+ static int test_5_shift ()
+ {
+ long a = 9;
+ int b = 1;
+ int count = 0;
+
+ if ((a >> b) != 4)
+ return count;
+ count++;
+
+ if ((a >> 63) != 0)
+ return count;
+ count++;
+
+ if ((a << 1) != 18)
+ return count;
+ count++;
+
+ if ((a << b) != 18)
+ return count;
+ count++;
+
+ a = -9;
+ if ((a >> b) != -5)
+ return count;
+ count++;
+
+ return count;
+ }
+
+ static int test_1_shift_u ()
+ {
+ ulong a;
+ int b;
+ int count = 0;
+
+ // The JIT optimizes this
+ a = 8589934592UL;
+ if ((a >> 32) != 2)
+ return 0;
+ count ++;
+
+ return count;
+ }
+
+ static int test_1_simple_neg () {
+ long a = 9;
+
+ if (-a != -9)
+ return 0;
+ return 1;
+ }
+
+ static int test_2_compare () {
+ long a = 1;
+ long b = 1;
+
+ if (a != b)
+ return 0;
+ return 2;
+ }
+
+ static int test_9_alu ()
+ {
+ long a = 9, b = 6;
+ int count = 0;
+
+ if ((a + b) != 15)
+ return count;
+ count++;
+
+ if ((a - b) != 3)
+ return count;
+ count++;
+
+ if ((a & 8) != 8)
+ return count;
+ count++;
+
+ if ((a | 2) != 11)
+ return count;
+ count++;
+
+ if ((a * b) != 54)
+ return count;
+ count++;
+
+ if ((a / 4) != 2)
+ return count;
+ count++;
+
+ if ((a % 4) != 1)
+ return count;
+ count++;
+
+ if (-a != -9)
+ return count;
+ count++;
+
+ b = -1;
+ if (~b != 0)
+ return count;
+ count++;
+
+ return count;
+ }
+
+ static int test_24_mul () {
+ long a = 8;
+ long b = 3;
+ return (int)(a * b);
+ }
+
+ static int test_24_mul_ovf () {
+ long a = 8;
+ long b = 3;
+ long res;
+
+ checked {
+ res = a * b;
+ }
+ return (int)res;
+ }
+
+ static int test_24_mul_un () {
+ ulong a = 8;
+ ulong b = 3;
+ return (int)(a * b);
+ }
+
+ static int test_24_mul_ovf_un () {
+ ulong a = 8;
+ ulong b = 3;
+ ulong res;
+
+ checked {
+ res = a * b;
+ }
+ return (int)res;
+ }
+
+ static int test_4_divun () {
+ uint b = 12;
+ int a = 3;
+ return (int)(b / a);
+ }
+
+ static int test_1431655764_bigdivun_imm () {
+ unchecked {
+ uint b = (uint)-2;
+ return (int)(b / 3);
+ }
+ }
+
+ static int test_1431655764_bigdivun () {
+ unchecked {
+ uint b = (uint)-2;
+ int a = 3;
+ return (int)(b / a);
+ }
+ }
+
+ static int test_1_remun () {
+ uint b = 13;
+ int a = 3;
+ return (int)(b % a);
+ }
+
+ static int test_2_bigremun () {
+ unchecked {
+ uint b = (uint)-2;
+ int a = 3;
+ return (int)(b % a);
+ }
+ }
+
+ static int test_0_ceq () {
+ long a = 2;
+ long b = 2;
+ long c = 3;
+ long d = 0xff00000002;
+
+ bool val = (a == b); // this should produce a ceq
+ if (!val)
+ return 1;
+
+ val = (a == c); // this should produce a ceq
+ if (val)
+ return 2;
+
+ val = (a == d); // this should produce a ceq
+ if (val)
+ return 3;
+
+ return 0;
+ }
+
+ static int test_0_ceq_complex () {
+ long l = 1, ll = 2;
+
+ if (l < 0 != ll < 0)
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_clt () {
+ long a = 2;
+ long b = 2;
+ long c = 3;
+ long d = 0xff00000002L;
+ long e = -1;
+
+ bool val = (a < b); // this should produce a clt
+ if (val)
+ return 1;
+
+ val = (a < c); // this should produce a clt
+ if (!val)
+ return 2;
+
+ val = (c < a); // this should produce a clt
+ if (val)
+ return 3;
+
+ val = (e < d); // this should produce a clt
+ if (!val)
+ return 4;
+
+ val = (d < e); // this should produce a clt
+ if (val)
+ return 5;
+
+ return 0;
+ }
+
+ static int test_0_clt_un () {
+ ulong a = 2;
+ ulong b = 2;
+ ulong c = 3;
+ ulong d = 0xff00000002;
+ ulong e = 0xffffffffffffffff;
+
+ bool val = (a < b); // this should produce a clt_un
+ if (val)
+ return 1;
+
+ val = (a < c); // this should produce a clt_un
+ if (!val)
+ return 1;
+
+ val = (d < e); // this should produce a clt_un
+ if (!val)
+ return 1;
+
+ val = (e < d); // this should produce a clt_un
+ if (val)
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_cgt () {
+ long a = 2;
+ long b = 2;
+ long c = 3;
+ long d = 0xff00000002L;
+ long e = -1;
+
+ bool val = (a > b); // this should produce a cgt
+ if (val)
+ return 1;
+
+ val = (a > c); // this should produce a cgt
+ if (val)
+ return 2;
+
+ val = (c > a); // this should produce a cgt
+ if (!val)
+ return 3;
+
+ val = (e > d); // this should produce a cgt
+ if (val)
+ return 4;
+
+ val = (d > e); // this should produce a cgt
+ if (!val)
+ return 5;
+
+ return 0;
+ }
+
+ static int test_0_cgt_un () {
+ ulong a = 2;
+ ulong b = 2;
+ ulong c = 3;
+ ulong d = 0xff00000002;
+ ulong e = 0xffffffffffffffff;
+
+ bool val = (a > b); // this should produce a cgt_un
+ if (val)
+ return 1;
+
+ val = (a > c); // this should produce a cgt_un
+ if (val)
+ return 1;
+
+ val = (d > e); // this should produce a cgt_un
+ if (val)
+ return 1;
+
+ val = (e > d); // this should produce a cgt_un
+ if (!val)
+ return 1;
+
+ return 0;
+ }
+
+ static long return_5low () {
+ return 5;
+ }
+
+ static long return_5high () {
+ return 0x500000000;
+ }
+
+ static int test_3_long_ret () {
+ long val = return_5low ();
+ return (int) (val - 2);
+ }
+
+ static int test_1_long_ret2 () {
+ long val = return_5high ();
+ if (val > 0xffffffff)
+ return 1;
+ return 0;
+ }
+
+ static int test_3_byte_cast () {
+ ulong val = 0xff00ff00f0f0f0f0;
+ byte b;
+ b = (byte) (val & 0xFF);
+ if (b != 0xf0)
+ return 1;
+
+ return 3;
+ }
+
+ static int test_4_ushort_cast () {
+ ulong val = 0xff00ff00f0f0f0f0;
+ ushort b;
+ b = (ushort) (val & 0xFFFF);
+ if (b != 0xf0f0)
+ return 1;
+ return 4;
+ }
+
+ static int test_500_mul_div () {
+ long val = 1000;
+ long exp = 10;
+ long maxexp = 20;
+ long res = val * exp / maxexp;
+
+ return (int)res;
+ }
+
+ static long position = 0;
+
+ static int test_4_static_inc_long () {
+
+ int count = 4;
+
+ position = 0;
+
+ position += count;
+
+ return (int)position;
+ }
+
+ static void doit (double value, out long m) {
+ m = (long) value;
+ }
+
+ static int test_3_checked_cast_un () {
+ ulong i = 2;
+ long j;
+
+ checked { j = (long)i; }
+
+ if (j != 2)
+ return 0;
+ return 3;
+ }
+
+ static int test_4_checked_cast () {
+ long i = 3;
+ ulong j;
+
+ checked { j = (ulong)i; }
+
+ if (j != 3)
+ return 0;
+ return 4;
+ }
+
+ static int test_1234_checked_i2_cast () {
+ long l = 1234;
+
+ checked {
+ return (short)l;
+ }
+ }
+
+ static int test_10_int_uint_compare () {
+ uint size = 10;
+ int j = 0;
+ for (int i = 0; i < size; ++i) {
+ j++;
+ }
+ return j;
+ }
+
+ static int test_0_ftol_clobber () {
+ long m;
+ doit (1.3, out m);
+ if (m != 1)
+ return 2;
+ return 0;
+ }
+
+ static int test_71_long_shift_right () {
+ ulong value = 38654838087;
+ int x = 0;
+ byte [] buffer = new byte [1];
+ buffer [x] = ((byte)(value >> x));
+ return buffer [x];
+ }
+
+ static int test_0_ulong_regress () {
+ ulong u = 4257145737;
+ u --;
+ return (u == 4257145736) ? 0 : 1;
+ }
+
+ static long x;
+ static int test_0_addsub_mem ()
+ {
+ x = 0;
+ x += 5;
+
+ if (x != 5)
+ return 1;
+
+ x -= 10;
+
+ if (x != -5)
+ return 2;
+
+ return 0;
+ }
+
+ static ulong y;
+ static int test_0_sh32_mem ()
+ {
+ y = 0x0102130405060708;
+ y >>= 32;
+
+ if (y != 0x01021304)
+ return 1;
+
+ y = 0x0102130405060708;
+ y <<= 32;
+
+ if (y != 0x0506070800000000)
+ return 2;
+
+ x = 0x0102130405060708;
+ x <<= 32;
+
+ if (x != 0x0506070800000000)
+ return 2;
+
+ return 0;
+ }
+
+ static int test_0_assemble_long ()
+ {
+ uint a = 5;
+ ulong x = 0x12345678;
+ ulong y = 1;
+
+
+ ulong z = ((x - y) << 32) | a;
+
+ if (z != 0x1234567700000005)
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_hash ()
+ {
+ ulong x = 0x1234567887654321;
+ int h = (int)(x & 0xffffffff) ^ (int)(x >> 32);
+ if (h != unchecked ((int)(0x87654321 ^ 0x12345678)))
+ return h;
+ return 0;
+
+ }
+
+ static int test_0_shift_regress () {
+ long a = 0;
+ int b = 6;
+ UInt16 c = 3;
+
+ return ((a >> (b - c)) == 0) ? 0 : 1;
+ }
+}
+
diff --git a/mono/mini/basic-math.cs b/mono/mini/basic-math.cs
new file mode 100644
index 00000000000..05c39cd803e
--- /dev/null
+++ b/mono/mini/basic-math.cs
@@ -0,0 +1,158 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static int test_0_sin_precision () {
+ double d1 = Math.Sin (1);
+ double d2 = Math.Sin (1) - d1;
+ return (d2 == 0) ? 0 : 1;
+ }
+
+ static int test_0_cos_precision () {
+ double d1 = Math.Cos (1);
+ double d2 = Math.Cos (1) - d1;
+ return (d2 == 0) ? 0 : 1;
+ }
+
+ static int test_0_tan_precision () {
+ double d1 = Math.Tan (1);
+ double d2 = Math.Tan (1) - d1;
+ return (d2 == 0) ? 0 : 1;
+ }
+
+ static int test_0_atan_precision () {
+ double d1 = Math.Atan (double.NegativeInfinity);
+ double d2 = Math.Atan (double.NegativeInfinity) - d1;
+ return (d2 == 0) ? 0 : 1;
+ }
+
+ static int test_0_sqrt_precision () {
+ double d1 = Math.Sqrt (2);
+ double d2 = Math.Sqrt (2) - d1;
+ return (d2 == 0) ? 0 : 1;
+ }
+
+ static int test_2_sqrt () {
+ return (int) Math.Sqrt (4);
+ }
+ static int test_0_sqrt_precision_and_not_spill () {
+ double expected = 0;
+ double[] operands = new double[3];
+ double[] temporaries = new double[3];
+ for (int i = 0; i < 3; i++) {
+ operands [i] = (i+1) * (i+1) * (i+1);
+ if (i == 0) {
+ expected = operands [0];
+ } else {
+ temporaries [i] = operands [i] / expected;
+ temporaries [i] = Math.Sqrt (temporaries [i]);
+ expected = temporaries [i];
+ }
+
+ //Console.Write( "{0}: {1}\n", i, temporaries [i] );
+ }
+ expected = temporaries [2];
+
+ double result = Math.Sqrt (operands [2] / Math.Sqrt (operands [1] / operands [0]));
+
+ //Console.Write( "result: {0,20:G}\n", result );
+
+ return (result == expected) ? 0 : 1;
+ }
+
+ static int test_0_sqrt_precision_and_spill () {
+ double expected = 0;
+ double[] operands = new double[9];
+ double[] temporaries = new double[9];
+ for (int i = 0; i < 9; i++) {
+ operands [i] = (i+1) * (i+1) * (i+1);
+ if (i == 0) {
+ expected = operands [0];
+ } else {
+ temporaries [i] = operands [i] / expected;
+ temporaries [i] = Math.Sqrt (temporaries [i]);
+ expected = temporaries [i];
+ }
+
+ //Console.Write( "{0}: {1}\n", i, temporaries [i] );
+ }
+ expected = temporaries [8];
+
+ double result = Math.Sqrt (operands [8] / Math.Sqrt (operands [7] / Math.Sqrt (operands [6] / Math.Sqrt (operands [5] / Math.Sqrt (operands [4] / Math.Sqrt (operands [3] / Math.Sqrt (operands [2] / Math.Sqrt (operands [1] / operands [0]))))))));
+
+ //Console.Write( "result: {0,20:G}\n", result );
+
+ return (result == expected) ? 0 : 1;
+ }
+
+ static int test_0_div_precision_and_spill () {
+ double expected = 0;
+ double[] operands = new double[9];
+ double[] temporaries = new double[9];
+ for (int i = 0; i < 9; i++) {
+ operands [i] = (i+1) * (i+1);
+ if (i == 0) {
+ expected = operands [0];
+ } else {
+ temporaries [i] = operands [i] / expected;
+ expected = temporaries [i];
+ }
+
+ //Console.Write( "{0}: {1}\n", i, temporaries [i] );
+ }
+ expected = temporaries [8];
+
+ double result = (operands [8] / (operands [7] / (operands [6] / (operands [5] / (operands [4] / (operands [3] / (operands [2] / (operands [1] / operands [0]))))))));
+
+ //Console.Write( "result: {0,20:G}\n", result );
+
+ return (result == expected) ? 0 : 1;
+ }
+
+ static int test_0_sqrt_nan () {
+ return Double.IsNaN (Math.Sqrt (Double.NaN)) ? 0 : 1;
+ }
+
+ static int test_0_sin_nan () {
+ return Double.IsNaN (Math.Sin (Double.NaN)) ? 0 : 1;
+ }
+
+ static int test_0_cos_nan () {
+ return Double.IsNaN (Math.Cos (Double.NaN)) ? 0 : 1;
+ }
+
+ static int test_0_tan_nan () {
+ return Double.IsNaN (Math.Tan (Double.NaN)) ? 0 : 1;
+ }
+
+ static int test_0_atan_nan () {
+ return Double.IsNaN (Math.Atan (Double.NaN)) ? 0 : 1;
+ }
+}
diff --git a/mono/mini/basic.cs b/mono/mini/basic.cs
new file mode 100644
index 00000000000..1846cf5f8df
--- /dev/null
+++ b/mono/mini/basic.cs
@@ -0,0 +1,939 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static int test_0_return () {
+ return 0;
+ }
+
+ static int test_100000_return_large () {
+ return 100000;
+ }
+
+ static int test_1_load_bool () {
+ bool a = true;
+ return a? 1: 0;
+ }
+
+ static int test_0_load_bool_false () {
+ bool a = false;
+ return a? 1: 0;
+ }
+
+ static int test_200_load_byte () {
+ byte a = 200;
+ return a;
+ }
+
+ static int test_100_load_sbyte () {
+ sbyte a = 100;
+ return a;
+ }
+
+ static int test_200_load_short () {
+ short a = 200;
+ return a;
+ }
+
+ static int test_100_load_ushort () {
+ ushort a = 100;
+ return a;
+ }
+
+ static int test_3_add_simple () {
+ int a = 1;
+ int b = 2;
+ return a + b;
+ }
+
+ static int test_3_add_imm () {
+ int a = 1;
+ return a + 2;
+ }
+
+ static int test_13407573_add_largeimm () {
+ int a = 1;
+ return a + 13407572;
+ }
+
+ static int test_1_sub_simple () {
+ int a = 1;
+ int b = 2;
+ return b - a;
+ }
+
+ static int test_1_sub_simple_un () {
+ uint a = 1;
+ uint b = 2;
+ return (int)(b - a);
+ }
+
+ static int test_1_sub_imm () {
+ int b = 2;
+ return b - 1;
+ }
+
+ static int test_2_sub_large_imm () {
+ int b = 0xff0f0f;
+ return b - 0xff0f0d;
+ }
+
+ static int test_0_sub_inv_imm () {
+ int b = 2;
+ return 2 - b;
+ }
+
+ static int test_2_and () {
+ int b = 2;
+ int a = 3;
+ return b & a;
+ }
+
+ static int test_0_and_imm () {
+ int b = 2;
+ return b & 0x10;
+ }
+
+ static int test_0_and_large_imm () {
+ int b = 2;
+ return b & 0x10000000;
+ }
+
+ static int test_0_and_large_imm2 () {
+ int b = 2;
+ return b & 0x100000f0;
+ }
+
+ static int test_2_div () {
+ int b = 6;
+ int a = 3;
+ return b / a;
+ }
+
+ static int test_4_div_imm () {
+ int b = 12;
+ return b / 3;
+ }
+
+ static int test_4_divun_imm () {
+ uint b = 12;
+ return (int)(b / 3);
+ }
+
+ static int test_0_div_fold () {
+ int b = -1;
+ return b / 2;
+ }
+
+ static int test_719177_div_destreg () {
+ int year = 1970;
+ return ((365* (year-1)) + ((year-1)/4));
+ }
+
+ static int test_1_remun_imm () {
+ uint b = 13;
+ return (int)(b % 3);
+ }
+
+ static int test_2_bigremun_imm () {
+ unchecked {
+ uint b = (uint)-2;
+ return (int)(b % 3);
+ }
+ }
+
+ static int test_2_rem () {
+ int b = 5;
+ int a = 3;
+ return b % a;
+ }
+
+ static int test_4_rem_imm () {
+ int b = 12;
+ return b % 8;
+ }
+
+ static int test_4_rem_big_imm () {
+ int b = 10004;
+ return b % 10000;
+ }
+
+ static int test_9_mul () {
+ int b = 3;
+ int a = 3;
+ return b * a;
+ }
+
+ static int test_15_mul_imm () {
+ int b = 3;
+ return b * 5;
+ }
+
+ static int test_24_mul () {
+ int a = 3;
+ int b = 8;
+ int res;
+
+ res = a * b;
+
+ return res;
+ }
+
+ static int test_24_mul_ovf () {
+ int a = 3;
+ int b = 8;
+ int res;
+
+ checked {
+ res = a * b;
+ }
+
+ return res;
+ }
+
+ static int test_24_mul_un () {
+ uint a = 3;
+ uint b = 8;
+ uint res;
+
+ res = a * b;
+
+ return (int)res;
+ }
+
+ static int test_24_mul_ovf_un () {
+ uint a = 3;
+ uint b = 8;
+ uint res;
+
+ checked {
+ res = a * b;
+ }
+
+ return (int)res;
+ }
+
+ static int test_0_add_un_ovf () {
+ uint n = (uint)134217728 * 16;
+ uint number = checked (n + (uint)0);
+
+ return number == n ? 0 : 1;
+ }
+
+ static int test_3_or () {
+ int b = 2;
+ int a = 3;
+ return b | a;
+ }
+
+ static int test_3_or_un () {
+ uint b = 2;
+ uint a = 3;
+ return (int)(b | a);
+ }
+
+ static int test_3_or_short_un () {
+ ushort b = 2;
+ ushort a = 3;
+ return (int)(b | a);
+ }
+
+ static int test_18_or_imm () {
+ int b = 2;
+ return b | 0x10;
+ }
+
+ static int test_268435458_or_large_imm () {
+ int b = 2;
+ return b | 0x10000000;
+ }
+
+ static int test_268435459_or_large_imm2 () {
+ int b = 2;
+ return b | 0x10000001;
+ }
+
+ static int test_1_xor () {
+ int b = 2;
+ int a = 3;
+ return b ^ a;
+ }
+
+ static int test_1_xor_imm () {
+ int b = 2;
+ return b ^ 3;
+ }
+
+ static int test_983041_xor_imm_large () {
+ int b = 2;
+ return b ^ 0xf0003;
+ }
+
+ static int test_1_neg () {
+ int b = -2;
+ b++;
+ return -b;
+ }
+
+ static int test_2_not () {
+ int b = ~2;
+ b = ~b;
+ return b;
+ }
+
+ static int test_16_shift () {
+ int b = 2;
+ int a = 3;
+ return b << a;
+ }
+
+ static int test_16_shift_add () {
+ int b = 2;
+ int a = 3;
+ int c = 0;
+ return b << (a + c);
+ }
+
+ static int test_16_shift_add2 () {
+ int b = 2;
+ int a = 3;
+ int c = 0;
+ return (b + c) << a;
+ }
+
+ static int test_16_shift_imm () {
+ int b = 2;
+ return b << 3;
+ }
+
+ static int test_524288_shift_imm_large () {
+ int b = 2;
+ return b << 18;
+ }
+
+ static int test_12_shift_imm_inv () {
+ int b = 2;
+ return 3 << 2;
+ }
+
+ static int test_12_shift_imm_inv_sbyte () {
+ sbyte b = 2;
+ return 3 << 2;
+ }
+
+ static int test_1_rshift_imm () {
+ int b = 8;
+ return b >> 3;
+ }
+
+ static int test_2_unrshift_imm () {
+ uint b = 16;
+ return (int)(b >> 3);
+ }
+
+ static int test_0_bigunrshift_imm () {
+ unchecked {
+ uint b = (uint)-1;
+ b = b >> 1;
+ if (b != 0x7fffffff)
+ return 1;
+ return 0;
+ }
+ }
+
+ static int test_0_bigrshift_imm () {
+ int b = -1;
+ b = b >> 1;
+ if (b != -1)
+ return 1;
+ return 0;
+ }
+
+ static int test_1_rshift () {
+ int b = 8;
+ int a = 3;
+ return b >> a;
+ }
+
+ static int test_2_unrshift () {
+ uint b = 16;
+ int a = 3;
+ return (int)(b >> a);
+ }
+
+ static int test_0_bigunrshift () {
+ unchecked {
+ uint b = (uint)-1;
+ int a = 1;
+ b = b >> a;
+ if (b != 0x7fffffff)
+ return 1;
+ return 0;
+ }
+ }
+
+ static int test_0_bigrshift () {
+ int b = -1;
+ int a = 1;
+ b = b >> a;
+ if (b != -1)
+ return 1;
+ return 0;
+ }
+
+ static int test_2_cond () {
+ int b = 2, a = 3, c;
+ if (a == b)
+ return 0;
+ return 2;
+ }
+
+ static int test_2_cond_short () {
+ short b = 2, a = 3, c;
+ if (a == b)
+ return 0;
+ return 2;
+ }
+
+ static int test_2_cond_sbyte () {
+ sbyte b = 2, a = 3, c;
+ if (a == b)
+ return 0;
+ return 2;
+ }
+
+ static int test_6_cascade_cond () {
+ int b = 2, a = 3, c;
+ if (a == b)
+ return 0;
+ else if (b > a)
+ return 1;
+ else if (b != b)
+ return 2;
+ else {
+ c = 1;
+ }
+ return a + b + c;
+ }
+
+ static int test_6_cascade_short () {
+ short b = 2, a = 3, c;
+ if (a == b)
+ return 0;
+ else if (b > a)
+ return 1;
+ else if (b != b)
+ return 2;
+ else {
+ c = 1;
+ }
+ return a + b + c;
+ }
+
+ static int test_0_short_sign_extend () {
+ int t1 = 0xffeedd;
+ short s1 = (short)t1;
+ int t2 = s1;
+
+ if ((uint)t2 != 0xffffeedd)
+ return 1;
+ else
+ return 0;
+ }
+
+ static int test_15_for_loop () {
+ int i;
+ for (i = 0; i < 15; ++i) {
+ }
+ return i;
+ }
+
+ static int test_11_nested_for_loop () {
+ int i, j = 0; /* mcs bug here if j not set */
+ for (i = 0; i < 15; ++i) {
+ for (j = 200; j >= 5; --j) ;
+ }
+ return i - j;
+ }
+
+ static int test_11_several_nested_for_loops () {
+ int i, j = 0; /* mcs bug here if j not set */
+ for (i = 0; i < 15; ++i) {
+ for (j = 200; j >= 5; --j) ;
+ }
+ i = j = 0;
+ for (i = 0; i < 15; ++i) {
+ for (j = 200; j >= 5; --j) ;
+ }
+ return i - j;
+ }
+
+ static int test_0_conv_ovf_i1 () {
+ int c;
+
+ //for (int j = 0; j < 10000000; j++)
+ checked {
+ c = 127;
+ sbyte b = (sbyte)c;
+ c = -128;
+ b = (sbyte)c;
+ }
+
+ return 0;
+ }
+
+ static int test_0_conv_ovf_i1_un () {
+ uint c;
+
+ checked {
+ c = 127;
+ sbyte b = (sbyte)c;
+ }
+
+ return 0;
+ }
+
+ static int test_0_conv_ovf_i2 () {
+ int c;
+
+ checked {
+ c = 32767;
+ Int16 b = (Int16)c;
+ c = -32768;
+ b = (Int16)c;
+ unchecked {
+ uint u = 0xfffffffd;
+ c = (int)u;
+ }
+ b = (Int16)c;
+ }
+
+ return 0;
+ }
+
+ static int test_0_conv_ovf_i2_un () {
+ uint c;
+
+ checked {
+ c = 32767;
+ Int16 b = (Int16)c;
+ }
+
+ return 0;
+ }
+
+ static int test_0_conv_ovf_u2 () {
+ int c;
+
+ checked {
+ c = 65535;
+ UInt16 b = (UInt16)c;
+ }
+
+ return 0;
+ }
+
+ static int test_0_conv_ovf_u2_un () {
+ uint c;
+
+ checked {
+ c = 65535;
+ UInt16 b = (UInt16)c;
+ }
+
+ return 0;
+ }
+
+ static int test_0_conv_ovf_u4 () {
+ int c;
+
+ checked {
+ c = 0x7fffffff;
+ uint b = (uint)c;
+ }
+
+ return 0;
+ }
+
+ static int test_0_bool () {
+ bool val = true;
+ if (val)
+ return 0;
+ return 1;
+ }
+
+ static int test_1_bool_inverted () {
+ bool val = true;
+ if (!val)
+ return 0;
+ return 1;
+ }
+
+ static int test_1_bool_assign () {
+ bool val = true;
+ val = !val; // this should produce a ceq
+ if (val)
+ return 0;
+ return 1;
+ }
+
+ static int test_1_bool_multi () {
+ bool val = true;
+ bool val2 = true;
+ val = !val;
+ if ((val && !val2) && (!val2 && val))
+ return 0;
+ return 1;
+ }
+
+ static int test_16_spill () {
+ int a = 1;
+ int b = 2;
+ int c = 3;
+ int d = 4;
+ int e = 5;
+
+ return (1 + (a + (b + (c + (d + e)))));
+ }
+
+ static int test_1_switch () {
+ int n = 0;
+
+ switch (n) {
+ case 0: return 1;
+ case 1: return 2;
+ case -1: return 3;
+ default:
+ return 4;
+ }
+ return 1;
+ }
+
+
+ static int test_0_while_loop_1 () {
+
+ int value = 255;
+
+ do {
+ value = value >> 4;
+ } while (value != 0);
+
+ return 0;
+ }
+
+ static int test_0_while_loop_2 () {
+ int value = 255;
+ int position = 5;
+
+ do {
+ value = value >> 4;
+ } while (value != 0 && position > 1);
+
+ return 0;
+ }
+
+ static int test_0_char_conv () {
+ int i = 1;
+
+ char tc = (char) ('0' + i);
+
+ if (tc != '1')
+ return 1;
+
+ return 0;
+ }
+
+ static unsafe int test_0_pin_string () {
+ string x = "xxx";
+ fixed (char *c = x) {
+ if (*c != 'x')
+ return 1;
+ }
+ return 0;
+ }
+
+ static int test_3_shift_regalloc () {
+ int shift = 8;
+ int orig = 1;
+ byte value = 0xfe;
+
+ orig &= ~(0xff << shift);
+ orig |= value << shift;
+
+ if (orig == 0xfe01)
+ return 3;
+ return 0;
+ }
+
+ enum E {A, B};
+
+ static int test_2_optimize_branches () {
+ switch (E.A) {
+ case E.A:
+ if (E.A == E.B) {
+ }
+ break;
+ }
+ return 2;
+ }
+
+ static int test_0_checked_byte_cast () {
+ int v = 250;
+ int b = checked ((byte) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_checked_byte_cast_un () {
+ uint v = 250;
+ uint b = checked ((byte) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_checked_short_cast () {
+ int v = 250;
+ int b = checked ((ushort) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
+ static int test_0_checked_short_cast_un () {
+ uint v = 250;
+ uint b = checked ((ushort) (v));
+
+ if (b != 250)
+ return 1;
+ return 0;
+ }
+
+ static int test_1_a_eq_b_plus_a () {
+ int a = 0, b = 1;
+ a = b + a;
+ return a;
+ }
+
+ static int test_0_comp () {
+ int a = 0;
+ int b = -1;
+ int error = 1;
+ bool val;
+
+ val = a < b;
+ if (val)
+ return error;
+ error++;
+
+ val = a > b;
+ if (!val)
+ return error;
+ error ++;
+
+ val = a == b;
+ if (val)
+ return error;
+ error ++;
+
+ val = a == a;
+ if (!val)
+ return error;
+ error ++;
+
+ return 0;
+ }
+
+ static int test_0_comp_unsigned () {
+ uint a = 1;
+ uint b = 0xffffffff;
+ int error = 1;
+ bool val;
+
+ val = a < b;
+ if (!val)
+ return error;
+ error++;
+
+ val = a <= b;
+ if (!val)
+ return error;
+ error++;
+
+ val = a == b;
+ if (val)
+ return error;
+ error++;
+
+ val = a >= b;
+ if (val)
+ return error;
+ error++;
+
+ val = a > b;
+ if (val)
+ return error;
+ error++;
+
+ val = b < a;
+ if (val)
+ return error;
+ error++;
+
+ val = b <= a;
+ if (val)
+ return error;
+ error++;
+
+ val = b == a;
+ if (val)
+ return error;
+ error++;
+
+ val = b > a;
+ if (!val)
+ return error;
+ error++;
+
+ val = b >= a;
+ if (!val)
+ return error;
+ error++;
+
+ return 0;
+ }
+
+ static int test_16_cmov ()
+ {
+ int n = 0;
+ if (n == 0)
+ n = 16;
+
+ return n;
+ }
+
+ static int my_flags;
+ static int test_0_and_cmp ()
+ {
+
+ /* various forms of test [mem], imm */
+
+ my_flags = 0x01020304;
+
+ if ((my_flags & 0x01020304) == 0)
+ return 1;
+
+ if ((my_flags & 0x00000304) == 0)
+ return 2;
+
+ if ((my_flags & 0x00000004) == 0)
+ return 3;
+
+ if ((my_flags & 0x00000300) == 0)
+ return 4;
+
+ if ((my_flags & 0x00020000) == 0)
+ return 5;
+
+ if ((my_flags & 0x01000000) == 0)
+ return 6;
+
+ /* test esi, imm */
+ int local = 0x01020304;
+
+ if ((local & 0x01020304) == 0)
+ return 7;
+
+ if ((local & 0x00000304) == 0)
+ return 8;
+
+ if ((local & 0x00000004) == 0)
+ return 9;
+
+ if ((local & 0x00000300) == 0)
+ return 10;
+
+ if ((local & 0x00020000) == 0)
+ return 11;
+
+ if ((local & 0x01000000) == 0)
+ return 12;
+
+ return 0;
+ }
+
+ static int test_0_cne ()
+ {
+ int x = 0;
+ int y = 1;
+
+ bool b = x != y;
+ bool bb = x != x;
+
+ if (!b)
+ return 1;
+ if (bb)
+ return 2;
+
+ return 0;
+ }
+
+ static byte b;
+ static int test_0_byte_compares ()
+ {
+ b = 0xff;
+ if (b == -1)
+ return 1;
+ b = 0;
+ if (!(b < System.Byte.MaxValue))
+ return 2;
+
+ if (!(b <= System.Byte.MaxValue))
+ return 3;
+
+ return 0;
+ }
+ static int test_0_cmp_regvar_zero ()
+ {
+ int n = 10;
+
+ if (!(n > 0 && n >= 0 && n != 0))
+ return 1;
+ if (n < 0 || n <= 0 || n == 0)
+ return 1;
+
+ return 0;
+ }
+
+}
diff --git a/mono/mini/bench.cs b/mono/mini/bench.cs
new file mode 100644
index 00000000000..c6a23620c56
--- /dev/null
+++ b/mono/mini/bench.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main (string[] args) {
+ return TestDriver.RunTests (typeof (Tests), args);
+ }
+
+ static public int test_0_many_nested_loops () {
+ // we do the loop a few times otherwise it's too fast
+ for (int i = 0; i < 5; ++i) {
+ int n = 16;
+ int x = 0;
+ int a = n;
+ while (a-- != 0) {
+ int b = n;
+ while (b-- != 0) {
+ int c = n;
+ while (c-- != 0) {
+ int d = n;
+ while (d-- != 0) {
+ int e = n;
+ while (e-- != 0) {
+ int f = n;
+ while (f-- != 0) {
+ x++;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (x != 16777216)
+ return 1;
+ }
+ return 0;
+ }
+
+ public static int test_0_logic_run ()
+ {
+ // GPL: Copyright (C) 2001 Southern Storm Software, Pty Ltd.
+ int iter, i = 0;
+
+ while (i++ < 10) {
+ // Initialize.
+ bool flag1 = true;
+ bool flag2 = true;
+ bool flag3 = true;
+ bool flag4 = true;
+ bool flag5 = true;
+ bool flag6 = true;
+ bool flag7 = true;
+ bool flag8 = true;
+ bool flag9 = true;
+ bool flag10 = true;
+ bool flag11 = true;
+ bool flag12 = true;
+ bool flag13 = true;
+
+ // First set of tests.
+ for(iter = 0; iter < 2000000; ++iter) {
+ if((flag1 || flag2) && (flag3 || flag4) &&
+ (flag5 || flag6 || flag7))
+ {
+ flag8 = !flag8;
+ flag9 = !flag9;
+ flag10 = !flag10;
+ flag11 = !flag11;
+ flag12 = !flag12;
+ flag13 = !flag13;
+ flag1 = !flag1;
+ flag2 = !flag2;
+ flag3 = !flag3;
+ flag4 = !flag4;
+ flag5 = !flag5;
+ flag6 = !flag6;
+ flag1 = !flag1;
+ flag2 = !flag2;
+ flag3 = !flag3;
+ flag4 = !flag4;
+ flag5 = !flag5;
+ flag6 = !flag6;
+ }
+ }
+ }
+ return 0;
+ }
+ static public int test_1028_sieve () {
+ //int NUM = ((argc == 2) ? atoi(argv[1]) : 1);
+ int NUM = 2000;
+ byte[] flags = new byte[8192 + 1];
+ int i, k;
+ int count = 0;
+
+ while (NUM-- != 0) {
+ count = 0;
+ for (i=2; i <= 8192; i++) {
+ flags[i] = 1;
+ }
+ for (i=2; i <= 8192; i++) {
+ if (flags[i] != 0) {
+ // remove all multiples of prime: i
+ for (k=i+i; k <= 8192; k+=i) {
+ flags[k] = 0;
+ }
+ count++;
+ }
+ }
+ }
+ //printf("Count: %d\n", count);
+ return(count);
+ }
+
+ public static int fib (int n) {
+ if (n < 2)
+ return 1;
+ return fib(n-2)+fib(n-1);
+ }
+
+ public static int test_3524578_fib () {
+ for (int i = 0; i < 10; i++)
+ fib (32);
+
+ return fib (32);
+ }
+
+ private static ulong numMoves;
+
+ static void movetower (int disc, int from, int to, int use) {
+ if (disc > 0) {
+ numMoves++;
+ movetower (disc-1, from, use, to);
+ movetower (disc-1, use, to, from);
+ }
+ }
+
+ public static int test_0_hanoi () {
+ int iterations = 5000;
+ int numdiscs = 12;
+
+ numMoves = 0;
+ while (iterations > 0) {
+ iterations--;
+ movetower (numdiscs, 1, 3, 2);
+ }
+ if (numMoves != 20475000)
+ return 1;
+ return 0;
+ }
+
+ public static int test_0_castclass () {
+ object a = "a";
+
+ for (int i = 0; i < 100000000; i++) {
+ string b = (string)a;
+ if ((object)a != (object)b)
+ return 1;
+ }
+ return 0;
+ }
+
+ public static int test_23005000_float () {
+ double a, b, c, d;
+ bool val;
+ int loops = 0;
+ a = 0.0;
+ b = 0.0001;
+ c = 2300.5;
+ d = 1000.0;
+
+ while (a < c) {
+ if (a == d)
+ b *= 2;
+ a += b;
+ val = b >= c;
+ if (val) break;
+ loops++;
+ }
+ return loops;
+ }
+
+ /*
+ /// Gaussian blur of a generated grayscale picture
+ private int test_0_blur(int size) {
+ const int num = 5; // Number of time to blur
+ byte[,] arr1 = new byte[size, size];
+ byte[,] arr2 = new byte[size, size];
+
+ int iterations = 1;
+
+ while(iterations-- > 0) {
+
+ // Draw fake picture
+ for(int i = 0; i < size; i++) {
+ for(int j = 0; j < size; j++) {
+ arr1[i, j] = (byte) (i%255);
+ }
+ }
+
+ for(int n = 0; n < num; n++) { // num rounds of blurring
+ for(int i = 3; i < size-3; i++) // vertical blur arr1 -> arr2
+ for(int j = 0; j < size; j++)
+ arr2[i, j] = (byte)((arr1[i-3, j] + arr1[i+3, j]
+ + 6*(arr1[i-2, j]+arr1[i+2, j])
+ + 15*(arr1[i-1, j]+arr1[i+1, j])
+ + 20*arr1[i, j] + 32)>>6);
+
+ for(int j = 3; j < size-3; j++) // horizontal blur arr1 -> arr2
+ for(int i = 0; i < size; i++)
+ arr1[i, j] = (byte)((arr2[i, j-3] + arr2[i, j+3]
+ + 6*(arr2[i, j-2]+arr2[i, j+2])
+ + 15*(arr2[i, j-1]+arr2[i, j+1])
+ + 20*arr2[i, j] + 32)>>6);
+ }
+ }
+
+ return 0;
+ }
+ */
+}
+
diff --git a/mono/mini/cfold.c b/mono/mini/cfold.c
new file mode 100644
index 00000000000..086447e0726
--- /dev/null
+++ b/mono/mini/cfold.c
@@ -0,0 +1,250 @@
+/*
+ * cfold.c: Constant folding support
+ *
+ * Author:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc. http://www.ximian.com
+ */
+#include "mini.h"
+
+int
+mono_is_power_of_two (guint32 val)
+{
+ int i, j, k;
+
+ for (i = 0, j = 1, k = 0xfffffffe; i < 32; ++i, j = j << 1, k = k << 1) {
+ if (val & j)
+ break;
+ }
+ if (i == 32 || val & k)
+ return -1;
+ return i;
+}
+
+#define FOLD_BINOP(name,op) \
+ case name: \
+ if (inst->inst_i0->opcode != OP_ICONST) \
+ return; \
+ if (inst->inst_i1->opcode == OP_ICONST) { \
+ inst->opcode = OP_ICONST; \
+ inst->inst_c0 = inst->inst_i0->inst_c0 op inst->inst_i1->inst_c0; \
+ } \
+ return;
+
+/*
+ * We try to put constants on the left side of a commutative operation
+ * because it reduces register pressure and it matches the usual cpu
+ * instructions with immediates.
+ */
+#define FOLD_BINOPCOMM(name,op) \
+ case name: \
+ if (inst->inst_i0->opcode == OP_ICONST) {\
+ if (inst->inst_i1->opcode == OP_ICONST) { \
+ inst->opcode = OP_ICONST; \
+ inst->inst_c0 = inst->inst_i0->inst_c0 op inst->inst_i1->inst_c0; \
+ return; \
+ } else { \
+ MonoInst *tmp = inst->inst_i0; \
+ inst->inst_i0 = inst->inst_i1; \
+ inst->inst_i1 = tmp; \
+ } \
+ } \
+ if (inst->inst_i1->opcode == OP_ICONST && inst->opcode == CEE_MUL) { \
+ int power2; \
+ if (inst->inst_i1->inst_c0 == 1) { \
+ *inst = *(inst->inst_i0); \
+ return; \
+ } else if (inst->inst_i1->inst_c0 == -1) { \
+ inst->opcode = CEE_NEG; \
+ return; \
+ } \
+ power2 = mono_is_power_of_two (inst->inst_i1->inst_c0); \
+ if (power2 < 0) return; \
+ inst->opcode = CEE_SHL; \
+ inst->inst_i1->inst_c0 = power2; \
+ } \
+ return;
+
+#ifndef G_MININT32
+#define MYGINT32_MAX 2147483647
+#define G_MININT32 (-MYGINT32_MAX -1)
+#endif
+
+/*
+ * We can't let this cause a division by zero exception since the division
+ * might not be executed during runtime.
+ */
+#define FOLD_BINOPZ(name,op,cast) \
+ case name: \
+ if (inst->inst_i1->opcode == OP_ICONST && inst->opcode == CEE_REM_UN && inst->inst_i1->inst_c0 == 2) { \
+ inst->opcode = CEE_AND; \
+ inst->inst_i1->inst_c0 = 1; \
+ return; \
+ } \
+ if (inst->inst_i1->opcode == OP_ICONST) { \
+ if (!inst->inst_i1->inst_c0) return; \
+ if (inst->inst_i0->opcode == OP_ICONST) { \
+ if ((inst->inst_i0->inst_c0 == G_MININT32) && (inst->inst_i1->inst_c0 == -1)) \
+ return; \
+ inst->inst_c0 = (cast)inst->inst_i0->inst_c0 op (cast)inst->inst_i1->inst_c0; \
+ inst->opcode = OP_ICONST; \
+ } else { \
+ int power2 = mono_is_power_of_two (inst->inst_i1->inst_c0); \
+ if (power2 < 0) return; \
+ if (inst->opcode == CEE_REM_UN) { \
+ inst->opcode = CEE_AND; \
+ inst->inst_i1->inst_c0 = (1 << power2) - 1; \
+ } else if (inst->opcode == CEE_DIV_UN) { \
+ inst->opcode = CEE_SHR_UN; \
+ inst->inst_i1->inst_c0 = power2; \
+ } \
+ } \
+ } \
+ return;
+
+#define FOLD_BINOPA(name,op,cast) \
+ case name: \
+ if (inst->inst_i0->opcode != OP_ICONST) \
+ return; \
+ if (inst->inst_i1->opcode == OP_ICONST) { \
+ inst->opcode = OP_ICONST; \
+ inst->inst_c0 = (cast)inst->inst_i0->inst_c0 op (cast)inst->inst_i1->inst_c0; \
+ } \
+ return;
+
+#define FOLD_CXX(name,op,cast) \
+ case name: \
+ if (inst->inst_i0->opcode != OP_COMPARE) \
+ return; \
+ if (inst->inst_i0->inst_i0->opcode != OP_ICONST) \
+ return; \
+ if (inst->inst_i0->inst_i1->opcode == OP_ICONST) { \
+ inst->opcode = OP_ICONST; \
+ inst->inst_c0 = (cast)inst->inst_i0->inst_i0->inst_c0 op (cast)inst->inst_i0->inst_i1->inst_c0; \
+ } \
+ return;
+
+#define FOLD_UNOP(name,op) \
+ case name: \
+ if (inst->inst_i0->opcode == OP_ICONST) { \
+ inst->opcode = OP_ICONST; \
+ inst->inst_c0 = op inst->inst_i0->inst_c0; \
+ } else if (inst->inst_i0->opcode == OP_I8CONST) { \
+ inst->opcode = OP_I8CONST; \
+ inst->inst_l = op inst->inst_i0->inst_l; \
+ } return;
+
+#define FOLD_BRBINOP(name,op,cast) \
+ case name: \
+ if (inst->inst_i0->opcode != OP_COMPARE) \
+ return; \
+ if (inst->inst_i0->inst_i0->opcode != OP_ICONST) \
+ return; \
+ if (inst->inst_i0->inst_i1->opcode == OP_ICONST) { \
+ if ((cast)inst->inst_i0->inst_i0->inst_c0 op (cast)inst->inst_i0->inst_i1->inst_c0) \
+ inst->opcode = CEE_BR; \
+ else \
+ inst->opcode = CEE_NOP; \
+ } \
+ return;
+
+/*
+ * Helper function to do constant expression evaluation.
+ * We do constant folding of integers only, FP stuff is much more tricky,
+ * int64 probably not worth it.
+ */
+void
+mono_constant_fold_inst (MonoInst *inst, gpointer data)
+{
+ switch (inst->opcode) {
+
+ /* FIXME: the CEE_B* don't contain operands, need to use the OP_COMPARE instruction */
+ /*FOLD_BRBINOP (CEE_BEQ,==,gint32)
+ FOLD_BRBINOP (CEE_BGE,>=,gint32)
+ FOLD_BRBINOP (CEE_BGT,>,gint32)
+ FOLD_BRBINOP (CEE_BLE,<=,gint32)
+ FOLD_BRBINOP (CEE_BLT,<,gint32)
+ FOLD_BRBINOP (CEE_BNE_UN,!=,guint32)
+ FOLD_BRBINOP (CEE_BGE_UN,>=,guint32)
+ FOLD_BRBINOP (CEE_BGT_UN,>,guint32)
+ FOLD_BRBINOP (CEE_BLE_UN,<=,guint32)
+ FOLD_BRBINOP (CEE_BLT_UN,<,guint32)*/
+
+ FOLD_BINOPCOMM (CEE_MUL,*)
+
+ FOLD_BINOPCOMM (CEE_ADD,+)
+ FOLD_BINOP (CEE_SUB,-)
+ FOLD_BINOPZ (CEE_DIV,/,gint32)
+ FOLD_BINOPZ (CEE_DIV_UN,/,guint32)
+ FOLD_BINOPZ (CEE_REM,%,gint32)
+ FOLD_BINOPZ (CEE_REM_UN,%,guint32)
+ FOLD_BINOPCOMM (CEE_AND,&)
+ FOLD_BINOPCOMM (CEE_OR,|)
+ FOLD_BINOPCOMM (CEE_XOR,^)
+ FOLD_BINOP (CEE_SHL,<<)
+ FOLD_BINOP (CEE_SHR,>>)
+ case CEE_SHR_UN:
+ if (inst->inst_i0->opcode != OP_ICONST)
+ return;
+ if (inst->inst_i1->opcode == OP_ICONST) {
+ inst->opcode = OP_ICONST;
+ inst->inst_c0 = (guint32)inst->inst_i0->inst_c0 >> (guint32)inst->inst_i1->inst_c0;
+ }
+ return;
+ FOLD_UNOP (CEE_NEG,-)
+ FOLD_UNOP (CEE_NOT,~)
+ FOLD_CXX (OP_CEQ,==,gint32)
+ FOLD_CXX (OP_CGT,>,gint32)
+ FOLD_CXX (OP_CGT_UN,>,guint32)
+ FOLD_CXX (OP_CLT,<,gint32)
+ FOLD_CXX (OP_CLT_UN,<,guint32)
+ case CEE_CONV_I8:
+ if (inst->inst_i0->opcode == OP_ICONST) {
+ inst->opcode = OP_I8CONST;
+ inst->inst_l = inst->inst_i0->inst_c0;
+ }
+ return;
+ case CEE_CONV_I:
+ case CEE_CONV_U:
+ if (inst->inst_i0->opcode == OP_ICONST) {
+ inst->opcode = OP_ICONST;
+ inst->inst_c0 = inst->inst_i0->inst_c0;
+ } else if (inst->inst_i0->opcode == CEE_LDIND_I) {
+ *inst = *inst->inst_i0;
+ }
+ return;
+ /* we should be able to handle isinst and castclass as well */
+ case CEE_ISINST:
+ case CEE_CASTCLASS:
+ /*
+ * TODO:
+ * conv.* opcodes.
+ * *ovf* opcodes? I'ts slow and hard to do in C.
+ * switch can be replaced by a simple jump
+ */
+#if SIZEOF_VOID_P == 4
+ case CEE_CONV_I4:
+ if ((inst->inst_left->type == STACK_I4) || (inst->inst_left->type == STACK_PTR)) {
+ *inst = *inst->inst_left;
+ }
+ break;
+#endif
+ default:
+ return;
+ }
+}
+
+void
+mono_constant_fold (MonoCompile *cfg)
+{
+ MonoBasicBlock *bb;
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *ins;
+ for (ins = bb->code; ins; ins = ins->next)
+ mono_inst_foreach (ins, mono_constant_fold_inst, NULL);
+ }
+}
+
diff --git a/mono/mini/cprop.c b/mono/mini/cprop.c
new file mode 100644
index 00000000000..1696e947303
--- /dev/null
+++ b/mono/mini/cprop.c
@@ -0,0 +1,130 @@
+/*
+ * cprop.c: Constant propagation.
+ *
+ * Author:
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+/* dumb list-based implementation for now */
+
+typedef struct _MiniACP MiniACP;
+
+struct _MiniACP {
+ MiniACP *next;
+ short dreg;
+ short sreg;
+ int type;
+};
+
+static int
+copy_value (MiniACP *acp, int reg, int type)
+{
+ MiniACP *tmp = acp;
+
+ //g_print ("search reg %d '%c'\n", reg, type);
+ while (tmp) {
+ // g_print ("considering dreg %d, sreg %d '%c'\n", tmp->dreg, tmp->sreg, tmp->type);
+ if (tmp->type == type && tmp->dreg == reg) {
+ // g_print ("copy prop from %d to %d\n", tmp->sreg, tmp->dreg);
+ return tmp->sreg;
+ }
+ tmp = tmp->next;
+ }
+ return reg;
+}
+
+static MiniACP*
+remove_acp (MiniACP *acp, int reg, int type)
+{
+ MiniACP *tmp = acp;
+ MiniACP *prev = NULL;
+
+ while (tmp) {
+ if (tmp->type == type && (tmp->dreg == reg || tmp->sreg == reg)) {
+ if (prev)
+ prev->next = tmp->next;
+ else
+ acp = tmp->next;
+ } else {
+ prev = tmp;
+ }
+ tmp = tmp->next;
+ }
+ return acp;
+}
+
+static MiniACP*
+add_acp (MonoCompile *cfg, MiniACP *acp, int sreg, int dreg, int type)
+{
+ MiniACP *newacp = mono_mempool_alloc (cfg->mempool, sizeof (MiniACP));;
+ newacp->type = type;
+ newacp->sreg = sreg;
+ newacp->dreg = dreg;
+
+ newacp->next = acp;
+ return newacp;
+}
+
+static void
+local_copy_prop (MonoCompile *cfg, MonoInst *code)
+{
+ MiniACP *acp = NULL;
+ const char *spec;
+ MonoInst *ins = code;
+
+ //g_print ("starting BB\n");
+
+ while (ins) {
+ spec = ins_spec [ins->opcode];
+ //print_ins (0, ins);
+
+ if (spec [MONO_INST_CLOB] != 's' && spec [MONO_INST_CLOB] != '1' && spec [MONO_INST_CLOB] != 'd' && spec [MONO_INST_CLOB] != 'a' && spec [MONO_INST_CLOB] != 'c') {
+ if (spec [MONO_INST_SRC1] == 'f') {
+ ins->sreg1 = copy_value (acp, ins->sreg1, 'f');
+ } else if (spec [MONO_INST_SRC1]) {
+ ins->sreg1 = copy_value (acp, ins->sreg1, 'i');
+ }
+ }
+
+ if (spec [MONO_INST_CLOB] != 's') {
+ if (spec [MONO_INST_SRC2] == 'f') {
+ ins->sreg2 = copy_value (acp, ins->sreg2, 'f');
+ } else if (spec [MONO_INST_SRC2]) {
+ ins->sreg2 = copy_value (acp, ins->sreg2, 'i');
+ }
+ }
+
+ /* invalidate pairs */
+ if (spec [MONO_INST_DEST] == 'f') {
+ acp = remove_acp (acp, ins->dreg, 'f');
+ } else if (spec [MONO_INST_DEST]) {
+ acp = remove_acp (acp, ins->dreg, 'i');
+ }
+
+ /* insert pairs */
+ /*
+ * Later copy-propagate also immediate values and memory stores.
+ */
+ if (ins->opcode == OP_MOVE && ins->sreg1 != ins->dreg) {
+ // g_print ("added acp of %d <- %d '%c'\n", ins->dreg, ins->sreg1, spec [MONO_INST_SRC1]);
+ acp = add_acp (cfg, acp, ins->sreg1, ins->dreg, spec [MONO_INST_SRC1]);
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ /* this is a call, invalidate all the pairs */
+ acp = NULL;
+ } else if ((ins->opcode) == CEE_BR || (ins->opcode >= CEE_BEQ && ins->opcode <= CEE_BLT) ||
+ (ins->opcode >= CEE_BNE_UN && ins->opcode <= CEE_BLT_UN)) {
+ acp = NULL; /* invalidate all pairs */
+ /* it's not enough to invalidate the pairs, because we don't always
+ * generate extended basic blocks (the BRANCH_LABEL stuff in the burg rules)
+ * This issue is going to reduce a lot the possibilities for optimization!
+ */
+ return;
+ }
+ ins = ins->next;
+ }
+}
+
diff --git a/mono/mini/cpu-amd64.md b/mono/mini/cpu-amd64.md
new file mode 100644
index 00000000000..f4f8d25c926
--- /dev/null
+++ b/mono/mini/cpu-amd64.md
@@ -0,0 +1,581 @@
+# x86-class cpu description file
+# this file is read by genmdesc to pruduce a table with all the relevant information
+# about the cpu instructions that may be used by the regsiter allocator, the scheduler
+# and other parts of the arch-dependent part of mini.
+#
+# An opcode name is followed by a colon and optional specifiers.
+# A specifier has a name, a colon and a value. Specifiers are separated by white space.
+# Here is a description of the specifiers valid for this file and their possible values.
+#
+# dest:register describes the destination register of an instruction
+# src1:register describes the first source register of an instruction
+# src2:register describes the second source register of an instruction
+#
+# register may have the following values:
+# i integer register
+# b base register (used in address references)
+# f floating point register
+# a EAX register
+# d EDX register
+# l long reg (forced eax:edx)
+#
+# len:number describe the maximun length in bytes of the instruction
+# number is a positive integer. If the length is not specified
+# it defaults to zero. But lengths are only checked if the given opcode
+# is encountered during compilation. Some opcodes, like CONV_U4 are
+# transformed into other opcodes in the brg files, so they do not show up
+# during code generation.
+#
+# cost:number describe how many cycles are needed to complete the instruction (unused)
+#
+# clob:spec describe if the instruction clobbers registers or has special needs
+#
+# spec can be one of the following characters:
+# c clobbers caller-save registers
+# 1 clobbers the first source register
+# a EAX is clobbered
+# d EAX and EDX are clobbered
+# s the src2 operand needs to be in ECX (shift opcodes)
+# x both the source operands are clobbered (xchg)
+# m sets an XMM reg
+#
+# flags:spec describe if the instruction uses or sets the flags (unused)
+#
+# spec can be one of the following chars:
+# s sets the flags
+# u uses the flags
+# m uses and modifies the flags
+#
+# res:spec describe what units are used in the processor (unused)
+#
+# delay: describe delay slots (unused)
+#
+# the required specifiers are: len, clob (if registers are clobbered), the registers
+# specifiers if the registers are actually used, flags (when scheduling is implemented).
+#
+# See the code in mini-x86.c for more details on how the specifiers are used.
+#
+nop:
+break: len:2
+jmp: len:42
+br.s:
+brfalse.s:
+brtrue.s:
+br: len:6
+brfalse:
+brtrue:
+beq: len:8
+bge: len:8
+bgt: len:8
+ble: len:8
+blt: len:8
+bne.un: len:8
+bge.un: len:8
+bgt.un: len:8
+ble.un: len:8
+blt.un: len:8
+switch:
+ldind.i1: dest:i len:8
+ldind.u1: dest:i len:8
+ldind.i2: dest:i len:8
+ldind.u2: dest:i len:8
+ldind.i4: dest:i len:9
+ldind.u4: dest:i len:8
+ldind.i8:
+ldind.i: dest:i len:8
+ldind.r4:
+ldind.r8:
+ldind.ref: dest:i len:8
+stind.ref: src1:b src2:i
+stind.i1: src1:b src2:i
+stind.i2: src1:b src2:i
+stind.i4: src1:b src2:i
+stind.i8:
+stind.r4: dest:f src1:b
+stind.r8: dest:f src1:b
+add: dest:i src1:i src2:i len:3 clob:1
+sub: dest:i src1:i src2:i len:3 clob:1
+mul: dest:i src1:i src2:i len:4 clob:1
+div: dest:a src1:a src2:i len:16 clob:d
+div.un: dest:a src1:a src2:i len:16 clob:d
+rem: dest:d src1:a src2:i len:16 clob:d
+rem.un: dest:d src1:a src2:i len:16 clob:d
+and: dest:i src1:i src2:i len:3 clob:1
+or: dest:i src1:i src2:i len:3 clob:1
+xor: dest:i src1:i src2:i len:3 clob:1
+shl: dest:i src1:i src2:i clob:s len:3
+shr: dest:i src1:i src2:i clob:s len:3
+shr.un: dest:i src1:i src2:i clob:s len:3
+neg: dest:i src1:i len:3 clob:1
+not: dest:i src1:i len:3 clob:1
+conv.i1: dest:i src1:i len:4
+conv.i2: dest:i src1:i len:4
+conv.i4: dest:i src1:i len:3
+conv.i8: dest:i src1:i len:3
+conv.r4: dest:f src1:i len:9
+conv.r8: dest:f src1:i len:9
+conv.u4: dest:i src1:i len:3
+conv.u8: dest:i src1:i len:3
+callvirt:
+cpobj:
+ldobj:
+ldstr:
+castclass:
+isinst:
+conv.r.un: dest:f src1:i len:8
+unbox:
+throw: src1:i len:18
+op_rethrow: src1:i len:18
+ldfld:
+ldflda:
+stfld:
+ldsfld:
+ldsflda:
+stsfld:
+stobj:
+conv.ovf.i1.un:
+conv.ovf.i2.un:
+conv.ovf.i4.un: dest:i src1:i len:16
+conv.ovf.i8.un:
+conv.ovf.u1.un:
+conv.ovf.u2.un:
+conv.ovf.u4.un:
+conv.ovf.u8.un:
+conv.ovf.i.un:
+conv.ovf.u.un:
+box:
+newarr:
+ldlen:
+ldelema:
+ldelem.i1:
+ldelem.u1:
+ldelem.i2:
+ldelem.u2:
+ldelem.i4:
+ldelem.u4:
+ldelem.i8:
+ldelem.i:
+ldelem.r4:
+ldelem.r8:
+ldelem.ref:
+stelem.i:
+stelem.i1:
+stelem.i2:
+stelem.i4:
+stelem.i8:
+stelem.r4:
+stelem.r8:
+stelem.ref:
+conv.ovf.i1:
+conv.ovf.u1:
+conv.ovf.i2:
+conv.ovf.u2:
+conv.ovf.i4:
+conv.ovf.u4: dest:i src1:i len:15
+conv.ovf.i8:
+conv.ovf.u8:
+refanyval:
+ckfinite: dest:f src1:f len:39
+mkrefany:
+ldtoken:
+conv.u2: dest:i src1:i len:4
+conv.u1: dest:i src1:i len:4
+conv.i: dest:i src1:i len:4
+conv.ovf.i:
+conv.ovf.u:
+add.ovf:
+add.ovf.un:
+mul.ovf: dest:i src1:i src2:i clob:1 len:10
+# this opcode is handled specially in the code generator
+mul.ovf.un: dest:i src1:i src2:i len:18
+sub.ovf:
+sub.ovf.un:
+endfinally:
+leave:
+leave.s:
+stind.i:
+conv.u: dest:i src1:i len:4
+prefix7:
+prefix6:
+prefix5:
+prefix4:
+prefix3:
+prefix2:
+prefix1:
+prefixref:
+arglist:
+ceq: dest:i len:8
+cgt: dest:i len:8
+cgt.un: dest:i len:8
+clt: dest:i len:8
+clt.un: dest:i len:8
+ldftn:
+ldvirtftn:
+ldarg:
+ldarga:
+starg:
+ldloc:
+ldloca:
+stloc:
+localloc: dest:i src1:i len:84
+endfilter:
+unaligned.:
+volatile.:
+tail.:
+initobj:
+cpblk:
+initblk:
+sizeof:
+refanytype:
+illegal:
+endmac:
+mono_objaddr:
+mono_ldptr:
+mono_vtaddr:
+mono_newobj:
+mono_retobj:
+load:
+ldaddr:
+store:
+phi:
+rename:
+compare: src1:i src2:i len:3
+lcompare: src1:i src2:i len:3
+icompare: src1:i src2:i len:3
+compare_imm: src1:i len:13
+icompare_imm: src1:i len:8
+fcompare: src1:f src2:f clob:a len:13
+local:
+arg:
+oparglist: src1:b len:11
+outarg: src1:i len:2
+outarg_imm: len:6
+retarg:
+setret: dest:a src1:i len:3
+setlret: dest:i src1:i src2:i len:5
+checkthis: src1:b len:5
+call: dest:a clob:c len:64
+ret: len:2
+voidcall: clob:c len:64
+voidcall_reg: src1:i clob:c len:64
+voidcall_membase: src1:b clob:c len:64
+fcall: dest:f len:64 clob:c
+fcall_reg: dest:f src1:i len:64 clob:c
+fcall_membase: dest:f src1:b len:64 clob:c
+lcall: dest:i len:64 clob:c
+lcall_reg: dest:i src1:i len:64 clob:c
+lcall_membase: dest:i src1:b len:64 clob:c
+vcall: len:64 clob:c
+vcall_reg: src1:i len:64 clob:c
+vcall_membase: src1:b len:64 clob:c
+call_reg: dest:a src1:i len:64 clob:c
+call_membase: dest:a src1:b len:64 clob:c
+trap:
+iconst: dest:i len:10
+i8const: dest:i len:18
+r4const: dest:f len:13
+r8const: dest:f len:9
+regvar:
+reg:
+regoffset:
+label:
+store_membase_imm: dest:b len:15
+store_membase_reg: dest:b src1:i len:9
+storei8_membase_reg: dest:b src1:i len:9
+storei1_membase_imm: dest:b len:11
+storei1_membase_reg: dest:b src1:i len:9
+storei2_membase_imm: dest:b len:13
+storei2_membase_reg: dest:b src1:i len:9
+storei4_membase_imm: dest:b len:13
+storei4_membase_reg: dest:b src1:i len:9
+storei8_membase_imm: dest:b len:18
+storer4_membase_reg: dest:b src1:f len:14
+storer8_membase_reg: dest:b src1:f len:9
+load_membase: dest:i src1:b len:14
+loadi1_membase: dest:i src1:b len:9
+loadu1_membase: dest:i src1:b len:9
+loadi2_membase: dest:i src1:b len:9
+loadu2_membase: dest:i src1:b len:9
+loadi4_membase: dest:i src1:b len:9
+loadu4_membase: dest:i src1:b len:9
+loadi8_membase: dest:i src1:b len:18
+loadr4_membase: dest:f src1:b len:13
+loadr8_membase: dest:f src1:b len:9
+loadr8_spill_membase: src1:b len:9
+loadu4_mem: dest:i len:10
+move: dest:i src1:i len:4
+setreg: dest:i src1:i len:4
+add_imm: dest:i src1:i len:8 clob:1
+sub_imm: dest:i src1:i len:8 clob:1
+mul_imm: dest:i src1:i len:8
+# there is no actual support for division or reminder by immediate
+# we simulate them, though (but we need to change the burg rules
+# to allocate a symbolic reg for src2)
+div_imm: dest:a src1:i src2:i len:16 clob:d
+div_un_imm: dest:a src1:i src2:i len:16 clob:d
+rem_imm: dest:d src1:i src2:i len:16 clob:d
+rem_un_imm: dest:d src1:i src2:i len:16 clob:d
+and_imm: dest:i src1:i len:8 clob:1
+or_imm: dest:i src1:i len:8 clob:1
+xor_imm: dest:i src1:i len:8 clob:1
+shl_imm: dest:i src1:i len:8 clob:1
+shr_imm: dest:i src1:i len:8 clob:1
+shr_un_imm: dest:i src1:i len:8 clob:1
+cond_exc_eq: len:8
+cond_exc_ne_un: len:8
+cond_exc_lt: len:8
+cond_exc_lt_un: len:8
+cond_exc_gt: len:8
+cond_exc_gt_un: len:8
+cond_exc_ge: len:8
+cond_exc_ge_un: len:8
+cond_exc_le: len:8
+cond_exc_le_un: len:8
+cond_exc_ov: len:8
+cond_exc_no: len:8
+cond_exc_c: len:8
+cond_exc_nc: len:8
+cond_exc_iov: len:8
+cond_exc_ic: len:8
+long_add:
+long_sub:
+long_mul:
+long_div:
+long_div_un:
+long_rem:
+long_rem_un:
+long_and:
+long_or:
+long_xor:
+long_shl: dest:i src1:i src2:i clob:s len:31
+long_shr: dest:i src1:i src2:i clob:s len:32
+long_shr_un: dest:i src1:i src2:i clob:s len:32
+long_neg:
+long_not:
+long_conv_to_i1:
+long_conv_to_i2:
+long_conv_to_i4:
+long_conv_to_i8:
+long_conv_to_r4: dest:f src1:i len:8
+long_conv_to_r8: dest:f src1:i len:8
+long_conv_to_u4:
+long_conv_to_u8:
+long_conv_to_u2:
+long_conv_to_u1:
+long_conv_to_i:
+long_conv_to_ovf_i: dest:i src1:i src2:i len:40
+long_conv_to_ovf_u:
+long_add_ovf:
+long_add_ovf_un:
+long_mul_ovf:
+long_mul_ovf_un:
+long_sub_ovf:
+long_sub_ovf_un:
+long_conv_to_ovf_i1_un:
+long_conv_to_ovf_i2_un:
+long_conv_to_ovf_i4_un:
+long_conv_to_ovf_i8_un:
+long_conv_to_ovf_u1_un:
+long_conv_to_ovf_u2_un:
+long_conv_to_ovf_u4_un:
+long_conv_to_ovf_u8_un:
+long_conv_to_ovf_i_un:
+long_conv_to_ovf_u_un:
+long_conv_to_ovf_i1:
+long_conv_to_ovf_u1:
+long_conv_to_ovf_i2:
+long_conv_to_ovf_u2:
+long_conv_to_ovf_i4:
+long_conv_to_ovf_u4:
+long_conv_to_ovf_i8:
+long_conv_to_ovf_u8:
+long_ceq:
+long_cgt:
+long_cgt_un:
+long_clt:
+long_clt_un:
+long_conv_to_r_un: dest:f src1:i src2:i len:48
+long_conv_to_u:
+long_shr_imm: dest:i src1:i len:11
+long_shr_un_imm: dest:i src1:i len:11
+long_shl_imm: dest:i src1:i len:11
+long_add_imm:
+long_sub_imm:
+long_beq:
+long_bne_un:
+long_blt:
+long_blt_un:
+long_bgt:
+long_btg_un:
+long_bge:
+long_bge_un:
+long_ble:
+long_ble_un:
+float_beq: len:13
+float_bne_un: len:18
+float_blt: len:13
+float_blt_un: len:30
+float_bgt: len:13
+float_btg_un: len:30
+float_bge: len:32
+float_bge_un: len:13
+float_ble: len:32
+float_ble_un: len:13
+float_add: dest:f src1:f src2:f len:5
+float_sub: dest:f src1:f src2:f len:5
+float_mul: dest:f src1:f src2:f len:5
+float_div: dest:f src1:f src2:f len:5
+float_div_un: dest:f src1:f src2:f len:5
+float_rem: dest:f src1:f src2:f len:19
+float_rem_un: dest:f src1:f src2:f len:19
+float_neg: dest:f src1:f len:19
+float_not: dest:f src1:f len:3
+float_conv_to_i1: dest:i src1:f len:49
+float_conv_to_i2: dest:i src1:f len:49
+float_conv_to_i4: dest:i src1:f len:49
+float_conv_to_i8: dest:i src1:f len:49
+float_conv_to_r4:
+float_conv_to_r8:
+float_conv_to_u4: dest:i src1:f len:49
+float_conv_to_u8: dest:i src1:f len:49
+float_conv_to_u2: dest:i src1:f len:49
+float_conv_to_u1: dest:i src1:f len:49
+float_conv_to_i: dest:i src1:f len:49
+float_conv_to_ovf_i: dest:a src1:f len:40
+float_conv_to_ovd_u: dest:a src1:f len:40
+float_add_ovf:
+float_add_ovf_un:
+float_mul_ovf:
+float_mul_ovf_un:
+float_sub_ovf:
+float_sub_ovf_un:
+float_conv_to_ovf_i1_un:
+float_conv_to_ovf_i2_un:
+float_conv_to_ovf_i4_un:
+float_conv_to_ovf_i8_un:
+float_conv_to_ovf_u1_un:
+float_conv_to_ovf_u2_un:
+float_conv_to_ovf_u4_un:
+float_conv_to_ovf_u8_un:
+float_conv_to_ovf_i_un:
+float_conv_to_ovf_u_un:
+float_conv_to_ovf_i1:
+float_conv_to_ovf_u1:
+float_conv_to_ovf_i2:
+float_conv_to_ovf_u2:
+float_conv_to_ovf_i4:
+float_conv_to_ovf_u4:
+float_conv_to_ovf_i8:
+float_conv_to_ovf_u8:
+float_ceq: dest:i src1:f src2:f len:35
+float_cgt: dest:i src1:f src2:f len:35
+float_cgt_un: dest:i src1:f src2:f len:48
+float_clt: dest:i src1:f src2:f len:35
+float_clt_un: dest:i src1:f src2:f len:42
+float_conv_to_u: dest:i src1:f len:46
+fmove: dest:f src1:f len:8
+call_handler: len:14
+aot_const: dest:i len:10
+x86_test_null: src1:i len:5
+x86_compare_membase_reg: src1:b src2:i len:9
+x86_compare_membase_imm: src1:b len:13
+x86_compare_reg_membase: src1:i src2:b len:8
+x86_inc_reg: dest:i src1:i clob:1 len:3
+x86_inc_membase: src1:b len:8
+x86_dec_reg: dest:i src1:i clob:1 len:3
+x86_dec_membase: src1:b len:8
+x86_add_membase_imm: src1:b len:13
+x86_sub_membase_imm: src1:b len:13
+x86_push: src1:i len:3
+x86_push_imm: len:6
+x86_push_membase: src1:b len:8
+x86_push_obj: src1:b len:40
+x86_lea: dest:i src1:i src2:i len:8
+x86_lea_membase: dest:i src1:i len:11
+x86_xchg: src1:i src2:i clob:x len:2
+x86_fpop: src1:f len:3
+x86_fp_load_i8: dest:f src1:b len:8
+x86_fp_load_i4: dest:f src1:b len:8
+x86_seteq_membase: src1:b len:9
+x86_add_membase: dest:i src1:i src2:b clob:1 len:13
+x86_sub_membase: dest:i src1:i src2:b clob:1 len:13
+x86_mul_membase: dest:i src1:i src2:b clob:1 len:14
+x86_tls_get: dest:i len:13
+amd64_test_null: src1:i len:5
+amd64_icompare_membase_reg: src1:b src2:i len:8
+amd64_icompare_membase_imm: src1:b len:13
+amd64_icompare_reg_membase: src1:i src2:b len:8
+amd64_set_xmmreg_r4: dest:f src1:f len:14 clob:m
+amd64_set_xmmreg_r8: dest:f src1:f len:14 clob:m
+adc: dest:i src1:i src2:i len:3 clob:1
+addcc: dest:i src1:i src2:i len:3 clob:1
+subcc: dest:i src1:i src2:i len:3 clob:1
+adc_imm: dest:i src1:i len:8 clob:1
+sbb: dest:i src1:i src2:i len:3 clob:1
+sbb_imm: dest:i src1:i len:8 clob:1
+br_reg: src1:i len:3
+sin: dest:f src1:f len:8
+cos: dest:f src1:f len:8
+abs: dest:f src1:f len:3
+tan: dest:f src1:f len:59
+atan: dest:f src1:f len:9
+sqrt: dest:f src1:f len:3
+op_bigmul: len:3 dest:i src1:a src2:i
+op_bigmul_un: len:3 dest:i src1:a src2:i
+sext_i1: dest:i src1:i len:4
+sext_i2: dest:i src1:i len:4
+
+# 32 bit opcodes
+# FIXME: fix sizes
+int_add: dest:i src1:i src2:i clob:1 len:64
+int_sub: dest:i src1:i src2:i clob:1 len:64
+int_mul: dest:i src1:i src2:i clob:1 len:64
+int_mul_ovf: dest:i src1:i src2:i clob:1 len:64
+int_mul_ovf_un: dest:i src1:i src2:i clob:1 len:64
+int_div: dest:a src1:a src2:i clob:d len:64
+int_div_un: dest:a src1:a src2:i clob:d len:64
+int_rem: dest:d src1:a src2:i clob:d len:64
+int_rem_un: dest:d src1:a src2:i clob:d len:64
+int_and: dest:i src1:i src2:i clob:1 len:64
+int_or: dest:i src1:i src2:i clob:1 len:64
+int_xor: dest:i src1:i src2:i clob:1 len:64
+int_shl: dest:i src1:i src2:i clob:s len:64
+int_shr: dest:i src1:i src2:i clob:s len:64
+int_shr_un: dest:i src1:i src2:i clob:s len:64
+int_adc: dest:i src1:i src2:i clob:1 len:64
+int_adc_imm: dest:i src1:i clob:1 len:64
+int_sbb: dest:i src1:i src2:i clob:1 len:64
+int_sbb_imm: dest:i src1:i clob:1 len:64
+int_addcc: dest:i src1:i src2:i clob:1 len:64
+int_subcc: dest:i src1:i src2:i clob:1 len:64
+int_add_imm: dest:i src1:i clob:1 len:64
+int_sub_imm: dest:i src1:i clob:1 len:64
+int_mul_imm: dest:i src1:i clob:1 len:64
+int_div_imm: dest:a src1:i clob:d len:64
+int_div_un_imm: dest:a src1:i clob:d len:64
+int_rem_imm: dest:d src1:i clob:d len:64
+int_rem_un_imm: dest:d src1:i clob:d len:64
+int_and_imm: dest:i src1:i clob:1 len:64
+int_or_imm: dest:i src1:i clob:1 len:64
+int_xor_imm: dest:i src1:i clob:1 len:64
+int_shl_imm: dest:i src1:i clob:1 len:64
+int_shr_imm: dest:i src1:i clob:1 len:64
+int_shr_un_imm: dest:i src1:i clob:1 len:64
+int_neg: dest:i src1:i clob:1 len:64
+int_not: dest:i src1:i clob:1 len:64
+int_ceq: dest:i len:64
+int_cgt: dest:i len:64
+int_cgt_un: dest:i len:64
+int_clt: dest:i len:64
+int_clt_un: dest:i len:64
+int_beq: len:64
+int_bne_un: len:64
+int_blt: len:64
+int_blt_un: len:64
+int_bgt: len:64
+int_bgt_un: len:64
+int_bge: len:64
+int_bge_un: len:64
+int_ble: len:64
+int_ble_un: len:64
+
diff --git a/mono/mini/cpu-g4.md b/mono/mini/cpu-g4.md
new file mode 100644
index 00000000000..d98263d2aae
--- /dev/null
+++ b/mono/mini/cpu-g4.md
@@ -0,0 +1,552 @@
+# powerpc cpu description file
+# this file is read by genmdesc to pruduce a table with all the relevant information
+# about the cpu instructions that may be used by the regsiter allocator, the scheduler
+# and other parts of the arch-dependent part of mini.
+#
+# An opcode name is followed by a colon and optional specifiers.
+# A specifier has a name, a colon and a value. Specifiers are separated by white space.
+# Here is a description of the specifiers valid for this file and their possible values.
+#
+# dest:register describes the destination register of an instruction
+# src1:register describes the first source register of an instruction
+# src2:register describes the second source register of an instruction
+#
+# register may have the following values:
+# i integer register
+# a r3 register (output from calls)
+# b base register (used in address references)
+# f floating point register
+#
+# len:number describe the maximun length in bytes of the instruction
+# number is a positive integer
+#
+# cost:number describe how many cycles are needed to complete the instruction (unused)
+#
+# clob:spec describe if the instruction clobbers registers or has special needs
+#
+# spec can be one of the following characters:
+# c clobbers caller-save registers
+# r 'reserves' the destination register until a later instruction unreserves it
+# used mostly to set output registers in function calls
+#
+# flags:spec describe if the instruction uses or sets the flags (unused)
+#
+# spec can be one of the following chars:
+# s sets the flags
+# u uses the flags
+# m uses and modifies the flags
+#
+# res:spec describe what units are used in the processor (unused)
+#
+# delay: describe delay slots (unused)
+#
+# the required specifiers are: len, clob (if registers are clobbered), the registers
+# specifiers if the registers are actually used, flags (when scheduling is implemented).
+#
+# See the code in mini-x86.c for more details on how the specifiers are used.
+#
+nop: len:4
+break: len:4
+ldarg.0:
+ldarg.1:
+ldarg.2:
+ldarg.3:
+ldloc.0:
+ldloc.1:
+ldloc.2:
+ldloc.3:
+stloc.0:
+stloc.1:
+stloc.2:
+stloc.3:
+ldarg.s:
+ldarga.s:
+starg.s:
+ldloc.s:
+ldloca.s:
+stloc.s:
+ldnull:
+ldc.i4.m1:
+ldc.i4.0:
+ldc.i4.1:
+ldc.i4.2:
+ldc.i4.3:
+ldc.i4.4:
+ldc.i4.5:
+ldc.i4.6:
+ldc.i4.7:
+ldc.i4.8:
+ldc.i4.s:
+ldc.i4:
+ldc.i8:
+ldc.r4:
+ldc.r8:
+dup:
+pop:
+jmp: len:92
+call: dest:a clob:c len:4
+calli:
+ret:
+br.s:
+brfalse.s:
+brtrue.s:
+beq.s:
+bge.s:
+bgt.s:
+ble.s:
+blt.s:
+bne.un.s:
+bge.un.s:
+bgt.un.s:
+ble.un.s:
+blt.un.s:
+br: len:4
+brfalse:
+brtrue:
+beq: len:8
+bge: len:8
+bgt: len:8
+ble: len:8
+blt: len:8
+bne.un: len:8
+bge.un: len:8
+bgt.un: len:8
+ble.un: len:8
+blt.un: len:8
+switch:
+ldind.i1: dest:i len:8
+ldind.u1: dest:i len:8
+ldind.i2: dest:i len:8
+ldind.u2: dest:i len:8
+ldind.i4: dest:i len:8
+ldind.u4: dest:i len:8
+ldind.i8:
+ldind.i: dest:i len:8
+ldind.r4:
+ldind.r8:
+ldind.ref: dest:i len:8
+stind.ref: src1:b src2:i
+stind.i1: src1:b src2:i
+stind.i2: src1:b src2:i
+stind.i4: src1:b src2:i
+stind.i8:
+stind.r4: src1:b src2:f
+stind.r8: src1:b src2:f
+add: dest:i src1:i src2:i len:4
+sub: dest:i src1:i src2:i len:4
+mul: dest:i src1:i src2:i len:4
+div: dest:i src1:i src2:i len:16
+div.un: dest:i src1:i src2:i len:16
+rem: dest:i src1:i src2:i len:24
+rem.un: dest:i src1:i src2:i len:24
+and: dest:i src1:i src2:i len:4
+or: dest:i src1:i src2:i len:4
+xor: dest:i src1:i src2:i len:4
+shl: dest:i src1:i src2:i len:4
+shr: dest:i src1:i src2:i len:4
+shr.un: dest:i src1:i src2:i len:4
+neg: dest:i src1:i len:4
+not: dest:i src1:i len:4
+conv.i1: dest:i src1:i len:4
+conv.i2: dest:i src1:i len:4
+conv.i4: dest:i src1:i len:4
+conv.i8:
+conv.r4: dest:f src1:i len:36
+conv.r8: dest:f src1:i len:36
+conv.u4: dest:i src1:i
+conv.u8:
+callvirt:
+cpobj:
+ldobj:
+ldstr:
+newobj:
+castclass:
+isinst:
+conv.r.un: dest:f src1:i len:32
+unbox:
+throw: src1:i len:8
+ldfld:
+ldflda:
+stfld:
+ldsfld:
+ldsflda:
+stsfld:
+stobj:
+conv.ovf.i1.un:
+conv.ovf.i2.un:
+conv.ovf.i4.un:
+conv.ovf.i8.un:
+conv.ovf.u1.un:
+conv.ovf.u2.un:
+conv.ovf.u4.un:
+conv.ovf.u8.un:
+conv.ovf.i.un:
+conv.ovf.u.un:
+box:
+newarr:
+ldlen:
+ldelema:
+ldelem.i1:
+ldelem.u1:
+ldelem.i2:
+ldelem.u2:
+ldelem.i4:
+ldelem.u4:
+ldelem.i8:
+ldelem.i:
+ldelem.r4:
+ldelem.r8:
+ldelem.ref:
+stelem.i:
+stelem.i1:
+stelem.i2:
+stelem.i4:
+stelem.i8:
+stelem.r4:
+stelem.r8:
+stelem.ref:
+conv.ovf.i1:
+conv.ovf.u1:
+conv.ovf.i2:
+conv.ovf.u2:
+conv.ovf.i4:
+conv.ovf.u4:
+conv.ovf.i8:
+conv.ovf.u8:
+refanyval:
+ckfinite: dest:f src1:f len:24
+mkrefany:
+ldtoken:
+conv.u2: dest:i src1:i len:4
+conv.u1: dest:i src1:i len:4
+conv.i: dest:i src1:i len:4
+conv.ovf.i:
+conv.ovf.u:
+add.ovf: dest:i src1:i src2:i len:16
+add.ovf.un: dest:i src1:i src2:i len:16
+mul.ovf: dest:i src1:i src2:i len:16
+# this opcode is handled specially in the code generator
+mul.ovf.un: dest:i src1:i src2:i len:16
+sub.ovf: dest:i src1:i src2:i len:16
+sub.ovf.un: dest:i src1:i src2:i len:16
+add_ovf_carry: dest:i src1:i src2:i len:16
+sub_ovf_carry: dest:i src1:i src2:i len:16
+add_ovf_un_carry: dest:i src1:i src2:i len:16
+sub_ovf_un_carry: dest:i src1:i src2:i len:16
+start_handler: len:8
+endfinally: len:12
+leave:
+leave.s:
+stind.i:
+conv.u: dest:i src1:i len:4
+prefix7:
+prefix6:
+prefix5:
+prefix4:
+prefix3:
+prefix2:
+prefix1:
+prefixref:
+arglist:
+ceq: dest:i len:12
+cgt: dest:i len:12
+cgt.un: dest:i len:12
+clt: dest:i len:12
+clt.un: dest:i len:12
+ldftn:
+ldvirtftn:
+ldarg:
+ldarga:
+starg:
+ldloc:
+ldloca:
+stloc:
+localloc: dest:i src1:i len:30
+endfilter: len:12
+unaligned.:
+volatile.:
+tail.:
+initobj:
+cpblk:
+initblk:
+rethrow:
+sizeof:
+refanytype:
+illegal:
+endmac:
+mono_objaddr:
+mono_ldptr:
+mono_vtaddr:
+mono_newobj:
+mono_retobj:
+load:
+ldaddr:
+store:
+phi:
+rename:
+compare: src1:i src2:i len:4
+compare_imm: src1:i len:12
+fcompare: src1:f src2:f len:12
+lcompare:
+local:
+arg:
+oparglist: src1:i len:12
+outarg: src1:i len:1
+outarg_imm: len:5
+retarg:
+setret: dest:a src1:i len:4
+setlret: src1:i src2:i len:12
+setreg: dest:i src1:i len:4 clob:r
+setregimm: dest:i len:8 clob:r
+setfreg: dest:f src1:f len:4 clob:r
+checkthis: src1:b len:4
+voidcall: len:8 clob:c
+voidcall_reg: src1:i len:8 clob:c
+voidcall_membase: src1:b len:12 clob:c
+fcall: dest:f len:8 clob:c
+fcall_reg: dest:f src1:i len:8 clob:c
+fcall_membase: dest:f src1:b len:12 clob:c
+lcall: dest:l len:8 clob:c
+lcall_reg: dest:l src1:i len:8 clob:c
+lcall_membase: dest:l src1:b len:12 clob:c
+vcall: len:8 clob:c
+vcall_reg: src1:i len:8 clob:c
+vcall_membase: src1:b len:12 clob:c
+call_reg: dest:a src1:i len:8 clob:c
+call_membase: dest:a src1:b len:12 clob:c
+trap:
+iconst: dest:i len:12
+i8const:
+r4const: dest:f len:12
+r8const: dest:f len:12
+regvar:
+reg:
+regoffset:
+label:
+store_membase_imm: dest:b len:20
+store_membase_reg: dest:b src1:i len:12
+storei1_membase_imm: dest:b len:20
+storei1_membase_reg: dest:b src1:i len:12
+storei2_membase_imm: dest:b len:20
+storei2_membase_reg: dest:b src1:i len:12
+storei4_membase_imm: dest:b len:20
+storei4_membase_reg: dest:b src1:i len:12
+storei8_membase_imm: dest:b
+storei8_membase_reg: dest:b src1:i
+storer4_membase_reg: dest:b src1:f len:12
+storer8_membase_reg: dest:b src1:f len:12
+load_membase: dest:i src1:b len:12
+loadi1_membase: dest:i src1:b len:12
+loadu1_membase: dest:i src1:b len:12
+loadi2_membase: dest:i src1:b len:12
+loadu2_membase: dest:i src1:b len:12
+loadi4_membase: dest:i src1:b len:12
+loadu4_membase: dest:i src1:b len:12
+loadi8_membase: dest:i src1:b
+loadr4_membase: dest:f src1:b len:12
+loadr8_membase: dest:f src1:b len:12
+loadu4_mem: dest:i len:8
+move: dest:i src1:i len:4
+fmove: dest:f src1:f len:4
+add_imm: dest:i src1:i len:12
+sub_imm: dest:i src1:i len:12
+mul_imm: dest:i src1:i len:12
+# there is no actual support for division or reminder by immediate
+# we simulate them, though (but we need to change the burg rules
+# to allocate a symbolic reg for src2)
+div_imm: dest:i src1:i src2:i len:20
+div_un_imm: dest:i src1:i src2:i len:12
+rem_imm: dest:i src1:i src2:i len:28
+rem_un_imm: dest:i src1:i src2:i len:16
+and_imm: dest:i src1:i len:12
+or_imm: dest:i src1:i len:12
+xor_imm: dest:i src1:i len:12
+shl_imm: dest:i src1:i len:8
+shr_imm: dest:i src1:i len:8
+shr_un_imm: dest:i src1:i len:8
+cond_exc_eq: len:8
+cond_exc_ne_un: len:8
+cond_exc_lt: len:8
+cond_exc_lt_un: len:8
+cond_exc_gt: len:8
+cond_exc_gt_un: len:8
+cond_exc_ge: len:8
+cond_exc_ge_un: len:8
+cond_exc_le: len:8
+cond_exc_le_un: len:8
+cond_exc_ov: len:12
+cond_exc_no: len:8
+cond_exc_c: len:12
+cond_exc_nc: len:8
+long_add:
+long_sub:
+long_mul:
+long_div:
+long_div_un:
+long_rem:
+long_rem_un:
+long_and:
+long_or:
+long_xor:
+long_shl:
+long_shr:
+long_shr_un:
+long_neg:
+long_not:
+long_conv_to_i1:
+long_conv_to_i2:
+long_conv_to_i4:
+long_conv_to_i8:
+long_conv_to_r4:
+long_conv_to_r8:
+long_conv_to_u4:
+long_conv_to_u8:
+long_conv_to_u2:
+long_conv_to_u1:
+long_conv_to_i:
+long_conv_to_ovf_i: dest:i src1:i src2:i len:30
+long_conv_to_ovf_u:
+long_add_ovf:
+long_add_ovf_un:
+long_mul_ovf:
+long_mul_ovf_un:
+long_sub_ovf:
+long_sub_ovf_un:
+long_conv_to_ovf_i1_un:
+long_conv_to_ovf_i2_un:
+long_conv_to_ovf_i4_un:
+long_conv_to_ovf_i8_un:
+long_conv_to_ovf_u1_un:
+long_conv_to_ovf_u2_un:
+long_conv_to_ovf_u4_un:
+long_conv_to_ovf_u8_un:
+long_conv_to_ovf_i_un:
+long_conv_to_ovf_u_un:
+long_conv_to_ovf_i1:
+long_conv_to_ovf_u1:
+long_conv_to_ovf_i2:
+long_conv_to_ovf_u2:
+long_conv_to_ovf_i4:
+long_conv_to_ovf_u4:
+long_conv_to_ovf_i8:
+long_conv_to_ovf_u8:
+long_ceq:
+long_cgt:
+long_cgt_un:
+long_clt:
+long_clt_un:
+long_conv_to_r_un: dest:f src1:i src2:i len:37
+long_conv_to_u:
+long_shr_imm:
+long_shr_un_imm:
+long_shl_imm:
+long_add_imm:
+long_sub_imm:
+long_beq:
+long_bne_un:
+long_blt:
+long_blt_un:
+long_bgt:
+long_btg_un:
+long_bge:
+long_bge_un:
+long_ble:
+long_ble_un:
+float_beq: len:8
+float_bne_un: len:8
+float_blt: len:8
+float_blt_un: len:8
+float_bgt: len:8
+float_btg_un: len:8
+float_bge: len:8
+float_bge_un: len:8
+float_ble: len:8
+float_ble_un: len:8
+float_add: dest:f src1:f src2:f len:4
+float_sub: dest:f src1:f src2:f len:4
+float_mul: dest:f src1:f src2:f len:4
+float_div: dest:f src1:f src2:f len:4
+float_div_un: dest:f src1:f src2:f len:4
+float_rem: dest:f src1:f src2:f len:16
+float_rem_un: dest:f src1:f src2:f len:16
+float_neg: dest:f src1:f len:4
+float_not: dest:f src1:f len:4
+float_conv_to_i1: dest:i src1:f len:40
+float_conv_to_i2: dest:i src1:f len:40
+float_conv_to_i4: dest:i src1:f len:40
+float_conv_to_i8: dest:l src1:f len:40
+float_conv_to_r4: dest:f src1:f len:4
+float_conv_to_r8:
+float_conv_to_u4: dest:i src1:f len:40
+float_conv_to_u8: dest:l src1:f len:40
+float_conv_to_u2: dest:i src1:f len:40
+float_conv_to_u1: dest:i src1:f len:40
+float_conv_to_i: dest:i src1:f len:40
+float_conv_to_ovf_i:
+float_conv_to_ovd_u:
+float_add_ovf:
+float_add_ovf_un:
+float_mul_ovf:
+float_mul_ovf_un:
+float_sub_ovf:
+float_sub_ovf_un:
+float_conv_to_ovf_i1_un:
+float_conv_to_ovf_i2_un:
+float_conv_to_ovf_i4_un:
+float_conv_to_ovf_i8_un:
+float_conv_to_ovf_u1_un:
+float_conv_to_ovf_u2_un:
+float_conv_to_ovf_u4_un:
+float_conv_to_ovf_u8_un:
+float_conv_to_ovf_i_un:
+float_conv_to_ovf_u_un:
+float_conv_to_ovf_i1:
+float_conv_to_ovf_u1:
+float_conv_to_ovf_i2:
+float_conv_to_ovf_u2:
+float_conv_to_ovf_i4:
+float_conv_to_ovf_u4:
+float_conv_to_ovf_i8:
+float_conv_to_ovf_u8:
+float_ceq: dest:i src1:f src2:f len:16
+float_cgt: dest:i src1:f src2:f len:16
+float_cgt_un: dest:i src1:f src2:f len:20
+float_clt: dest:i src1:f src2:f len:16
+float_clt_un: dest:i src1:f src2:f len:20
+float_conv_to_u: dest:i src1:f len:36
+call_handler: len:12
+op_endfilter: src1:i len:16
+aot_const: dest:i len:8
+x86_test_null: src1:i len:4
+x86_compare_membase_reg: src1:b src2:i len:8
+x86_compare_membase_imm: src1:b len:8
+x86_compare_reg_membase: src1:i src2:b len:8
+x86_inc_reg: dest:i src1:i clob:1 len:1
+x86_inc_membase: src1:b len:6
+x86_dec_reg: dest:i src1:i clob:1 len:1
+x86_dec_membase: src1:b len:6
+x86_add_membase_imm: src1:b len:8
+x86_sub_membase_imm: src1:b len:8
+x86_push: src1:i len:1
+x86_push_imm: len:5
+x86_push_membase: src1:b len:6
+x86_push_obj: src1:b len:30
+x86_lea: dest:i src1:i src2:i len:7
+x86_xchg: src1:i src2:i clob:x len:1
+x86_fpop: src1:f len:2
+x86_fp_load_i8: dest:f src1:b len:7
+x86_fp_load_i4: dest:f src1:b len:7
+sqrt: dest:f src1:f len:4
+adc: dest:i src1:i src2:i len:4
+addcc: dest:i src1:i src2:i len:4
+subcc: dest:i src1:i src2:i len:4
+adc_imm: dest:i src1:i len:12
+addcc_imm: dest:i src1:i len:12
+subcc_imm: dest:i src1:i len:12
+sbb: dest:i src1:i src2:i len:4
+sbb_imm: dest:i src1:i len:12
+br_reg: src1:i len:8
+ppc_subfic: dest:i src1:i len:4
+ppc_subfze: dest:i src1:i len:4
+op_bigmul: len:8 dest:l src1:i src2:i
+op_bigmul_un: len:8 dest:l src1:i src2:i
diff --git a/mono/mini/cpu-pentium.md b/mono/mini/cpu-pentium.md
new file mode 100644
index 00000000000..8dff976d6cc
--- /dev/null
+++ b/mono/mini/cpu-pentium.md
@@ -0,0 +1,567 @@
+# x86-class cpu description file
+# this file is read by genmdesc to pruduce a table with all the relevant information
+# about the cpu instructions that may be used by the regsiter allocator, the scheduler
+# and other parts of the arch-dependent part of mini.
+#
+# An opcode name is followed by a colon and optional specifiers.
+# A specifier has a name, a colon and a value. Specifiers are separated by white space.
+# Here is a description of the specifiers valid for this file and their possible values.
+#
+# dest:register describes the destination register of an instruction
+# src1:register describes the first source register of an instruction
+# src2:register describes the second source register of an instruction
+#
+# register may have the following values:
+# i integer register
+# b base register (used in address references)
+# f floating point register
+# a EAX register
+# d EDX register
+# l long reg (forced eax:edx)
+# L long reg (dynamic)
+#
+# len:number describe the maximun length in bytes of the instruction
+# number is a positive integer. If the length is not specified
+# it defaults to zero. But lengths are only checked if the given opcode
+# is encountered during compilation. Some opcodes, like CONV_U4 are
+# transformed into other opcodes in the brg files, so they do not show up
+# during code generation.
+#
+# cost:number describe how many cycles are needed to complete the instruction (unused)
+#
+# clob:spec describe if the instruction clobbers registers or has special needs
+#
+# spec can be one of the following characters:
+# c clobbers caller-save registers
+# 1 clobbers the first source register
+# a EAX is clobbered
+# d EAX and EDX are clobbered
+# s the src2 operand needs to be in ECX (shift opcodes)
+# x both the source operands are clobbered (xchg)
+#
+# flags:spec describe if the instruction uses or sets the flags (unused)
+#
+# spec can be one of the following chars:
+# s sets the flags
+# u uses the flags
+# m uses and modifies the flags
+#
+# res:spec describe what units are used in the processor (unused)
+#
+# delay: describe delay slots (unused)
+#
+# the required specifiers are: len, clob (if registers are clobbered), the registers
+# specifiers if the registers are actually used, flags (when scheduling is implemented).
+#
+# See the code in mini-x86.c for more details on how the specifiers are used.
+#
+nop:
+break: len:1
+ldarg.0:
+ldarg.1:
+ldarg.2:
+ldarg.3:
+ldloc.0:
+ldloc.1:
+ldloc.2:
+ldloc.3:
+stloc.0:
+stloc.1:
+stloc.2:
+stloc.3:
+ldarg.s:
+ldarga.s:
+starg.s:
+ldloc.s:
+ldloca.s:
+stloc.s:
+ldnull:
+ldc.i4.m1:
+ldc.i4.0:
+ldc.i4.1:
+ldc.i4.2:
+ldc.i4.3:
+ldc.i4.4:
+ldc.i4.5:
+ldc.i4.6:
+ldc.i4.7:
+ldc.i4.8:
+ldc.i4.s:
+ldc.i4:
+ldc.i8:
+ldc.r4:
+ldc.r8:
+dup:
+pop:
+jmp: len:32
+call: dest:a clob:c len:11
+calli:
+ret: len:1
+br.s:
+brfalse.s:
+brtrue.s:
+beq.s:
+bge.s:
+bgt.s:
+ble.s:
+blt.s:
+bne.un.s:
+bge.un.s:
+bgt.un.s:
+ble.un.s:
+blt.un.s:
+br: len:5
+brfalse:
+brtrue:
+beq: len:6
+bge: len:6
+bgt: len:6
+ble: len:6
+blt: len:6
+bne.un: len:6
+bge.un: len:6
+bgt.un: len:6
+ble.un: len:6
+blt.un: len:6
+switch:
+ldind.i1: dest:i len:6
+ldind.u1: dest:i len:6
+ldind.i2: dest:i len:6
+ldind.u2: dest:i len:6
+ldind.i4: dest:i len:6
+ldind.u4: dest:i len:6
+ldind.i8:
+ldind.i: dest:i len:6
+ldind.r4:
+ldind.r8:
+ldind.ref: dest:i len:6
+stind.ref: src1:b src2:i
+stind.i1: src1:b src2:i
+stind.i2: src1:b src2:i
+stind.i4: src1:b src2:i
+stind.i8:
+stind.r4: dest:f src1:b
+stind.r8: dest:f src1:b
+add: dest:i src1:i src2:i len:2 clob:1
+sub: dest:i src1:i src2:i len:2 clob:1
+mul: dest:i src1:i src2:i len:3 clob:1
+div: dest:a src1:i src2:i len:15 clob:d
+div.un: dest:a src1:i src2:i len:15 clob:d
+rem: dest:d src1:i src2:i len:15 clob:d
+rem.un: dest:d src1:i src2:i len:15 clob:d
+and: dest:i src1:i src2:i len:2 clob:1
+or: dest:i src1:i src2:i len:2 clob:1
+xor: dest:i src1:i src2:i len:2 clob:1
+shl: dest:i src1:i src2:i clob:s len:2
+shr: dest:i src1:i src2:i clob:s len:2
+shr.un: dest:i src1:i src2:i clob:s len:2
+neg: dest:i src1:i len:2 clob:1
+not: dest:i src1:i len:2 clob:1
+conv.i1: dest:i src1:i len:3
+conv.i2: dest:i src1:i len:3
+conv.i4: dest:i src1:i len:2
+conv.i8:
+conv.r4: dest:f src1:i len:7
+conv.r8: dest:f src1:i len:7
+conv.u4: dest:i src1:i
+conv.u8:
+callvirt:
+cpobj:
+ldobj:
+ldstr:
+newobj:
+castclass:
+isinst:
+conv.r.un:
+unbox:
+throw: src1:i len:6
+op_rethrow: src1:i len:6
+ldfld:
+ldflda:
+stfld:
+ldsfld:
+ldsflda:
+stsfld:
+stobj:
+conv.ovf.i1.un:
+conv.ovf.i2.un:
+conv.ovf.i4.un:
+conv.ovf.i8.un:
+conv.ovf.u1.un:
+conv.ovf.u2.un:
+conv.ovf.u4.un:
+conv.ovf.u8.un:
+conv.ovf.i.un:
+conv.ovf.u.un:
+box:
+newarr:
+ldlen:
+ldelema:
+ldelem.i1:
+ldelem.u1:
+ldelem.i2:
+ldelem.u2:
+ldelem.i4:
+ldelem.u4:
+ldelem.i8:
+ldelem.i:
+ldelem.r4:
+ldelem.r8:
+ldelem.ref:
+stelem.i:
+stelem.i1:
+stelem.i2:
+stelem.i4:
+stelem.i8:
+stelem.r4:
+stelem.r8:
+stelem.ref:
+conv.ovf.i1:
+conv.ovf.u1:
+conv.ovf.i2:
+conv.ovf.u2:
+conv.ovf.i4:
+conv.ovf.u4:
+conv.ovf.i8:
+conv.ovf.u8:
+refanyval:
+ckfinite: dest:f src1:f len:22
+mkrefany:
+ldtoken:
+conv.u2: dest:i src1:i len:3
+conv.u1: dest:i src1:i len:3
+conv.i: dest:i src1:i len:3
+conv.ovf.i:
+conv.ovf.u:
+add.ovf:
+add.ovf.un:
+mul.ovf: dest:i src1:i src2:i clob:1 len:9
+# this opcode is handled specially in the code generator
+mul.ovf.un: dest:i src1:i src2:i len:16
+sub.ovf:
+sub.ovf.un:
+endfinally:
+leave:
+leave.s:
+stind.i:
+conv.u: dest:i src1:i len:3
+prefix7:
+prefix6:
+prefix5:
+prefix4:
+prefix3:
+prefix2:
+prefix1:
+prefixref:
+arglist:
+ceq: dest:i len:6
+cgt: dest:i len:6
+cgt.un: dest:i len:6
+clt: dest:i len:6
+clt.un: dest:i len:6
+cne: dest:i len:6
+ldftn:
+ldvirtftn:
+ldarg:
+ldarga:
+starg:
+ldloc:
+ldloca:
+stloc:
+localloc: dest:i src1:i len:64
+endfilter:
+unaligned.:
+volatile.:
+tail.:
+initobj:
+cpblk:
+initblk:
+sizeof:
+refanytype:
+illegal:
+endmac:
+mono_objaddr:
+mono_ldptr:
+mono_vtaddr:
+mono_newobj:
+mono_retobj:
+load:
+ldaddr:
+store:
+phi:
+rename:
+compare: src1:i src2:i len:2
+compare_imm: src1:i len:6
+fcompare: src1:f src2:f clob:a len:9
+lcompare:
+local:
+arg:
+oparglist: src1:b len:10
+outarg: src1:i len:1
+outarg_imm: len:5
+retarg:
+setret: dest:a src1:i len:2
+setlret: dest:l src1:i src2:i len:4
+checkthis: src1:b len:2
+voidcall: len:11 clob:c
+voidcall_reg: src1:i len:11 clob:c
+voidcall_membase: src1:b len:16 clob:c
+fcall: dest:f len:11 clob:c
+fcall_reg: dest:f src1:i len:11 clob:c
+fcall_membase: dest:f src1:b len:16 clob:c
+lcall: dest:l len:11 clob:c
+lcall_reg: dest:l src1:i len:11 clob:c
+lcall_membase: dest:l src1:b len:16 clob:c
+vcall: len:11 clob:c
+vcall_reg: src1:i len:11 clob:c
+vcall_membase: src1:b len:16 clob:c
+call_reg: dest:a src1:i len:11 clob:c
+call_membase: dest:a src1:b len:16 clob:c
+trap:
+iconst: dest:i len:5
+i8const:
+r4const: dest:f len:6
+r8const: dest:f len:6
+regvar:
+reg:
+regoffset:
+label:
+store_membase_imm: dest:b len:10
+store_membase_reg: dest:b src1:i len:7
+storei1_membase_imm: dest:b len:10
+storei1_membase_reg: dest:b src1:i len:7
+storei2_membase_imm: dest:b len:11
+storei2_membase_reg: dest:b src1:i len:7
+storei4_membase_imm: dest:b len:10
+storei4_membase_reg: dest:b src1:i len:7
+storei8_membase_imm: dest:b
+storei8_membase_reg: dest:b src1:i
+storer4_membase_reg: dest:b src1:f len:7
+storer8_membase_reg: dest:b src1:f len:6
+load_membase: dest:i src1:b len:6
+loadi1_membase: dest:i src1:b len:7
+loadu1_membase: dest:i src1:b len:7
+loadi2_membase: dest:i src1:b len:7
+loadu2_membase: dest:i src1:b len:7
+loadi4_membase: dest:i src1:b len:6
+loadu4_membase: dest:i src1:b len:6
+loadi8_membase: dest:i src1:b
+loadr4_membase: dest:f src1:b len:6
+loadr8_membase: dest:f src1:b len:6
+loadr8_spill_membase: src1:b len:8
+loadu4_mem: dest:i len:9
+move: dest:i src1:i len:2
+addcc_imm: dest:i src1:i len:6 clob:1
+add_imm: dest:i src1:i len:6 clob:1
+subcc_imm: dest:i src1:i len:6 clob:1
+sub_imm: dest:i src1:i len:6 clob:1
+mul_imm: dest:i src1:i len:6
+# there is no actual support for division or reminder by immediate
+# we simulate them, though (but we need to change the burg rules
+# to allocate a symbolic reg for src2)
+div_imm: dest:a src1:i src2:i len:15 clob:d
+div_un_imm: dest:a src1:i src2:i len:15 clob:d
+rem_imm: dest:d src1:i src2:i len:15 clob:d
+rem_un_imm: dest:d src1:i src2:i len:15 clob:d
+and_imm: dest:i src1:i len:6 clob:1
+or_imm: dest:i src1:i len:6 clob:1
+xor_imm: dest:i src1:i len:6 clob:1
+shl_imm: dest:i src1:i len:6 clob:1
+shr_imm: dest:i src1:i len:6 clob:1
+shr_un_imm: dest:i src1:i len:6 clob:1
+cond_exc_eq: len:6
+cond_exc_ne_un: len:6
+cond_exc_lt: len:6
+cond_exc_lt_un: len:6
+cond_exc_gt: len:6
+cond_exc_gt_un: len:6
+cond_exc_ge: len:6
+cond_exc_ge_un: len:6
+cond_exc_le: len:6
+cond_exc_le_un: len:6
+cond_exc_ov: len:6
+cond_exc_no: len:6
+cond_exc_c: len:6
+cond_exc_nc: len:6
+long_add:
+long_sub:
+long_mul:
+long_div:
+long_div_un:
+long_rem:
+long_rem_un:
+long_and:
+long_or:
+long_xor:
+long_shl: dest:L src1:L src2:i clob:s len:21
+long_shr: dest:L src1:L src2:i clob:s len:22
+long_shr_un: dest:L src1:L src2:i clob:s len:22
+long_neg:
+long_not:
+long_conv_to_i1:
+long_conv_to_i2:
+long_conv_to_i4:
+long_conv_to_i8:
+long_conv_to_r4:
+long_conv_to_r8:
+long_conv_to_u4:
+long_conv_to_u8:
+long_conv_to_u2:
+long_conv_to_u1:
+long_conv_to_i:
+long_conv_to_ovf_i: dest:i src1:i src2:i len:30
+long_conv_to_ovf_u:
+long_add_ovf:
+long_add_ovf_un:
+long_mul_ovf:
+long_mul_ovf_un:
+long_sub_ovf:
+long_sub_ovf_un:
+long_conv_to_ovf_i1_un:
+long_conv_to_ovf_i2_un:
+long_conv_to_ovf_i4_un:
+long_conv_to_ovf_i8_un:
+long_conv_to_ovf_u1_un:
+long_conv_to_ovf_u2_un:
+long_conv_to_ovf_u4_un:
+long_conv_to_ovf_u8_un:
+long_conv_to_ovf_i_un:
+long_conv_to_ovf_u_un:
+long_conv_to_ovf_i1:
+long_conv_to_ovf_u1:
+long_conv_to_ovf_i2:
+long_conv_to_ovf_u2:
+long_conv_to_ovf_i4:
+long_conv_to_ovf_u4:
+long_conv_to_ovf_i8:
+long_conv_to_ovf_u8:
+long_ceq:
+long_cgt:
+long_cgt_un:
+long_clt:
+long_clt_un:
+long_conv_to_r_un: dest:f src1:i src2:i len:37
+long_conv_to_u:
+long_shr_imm: dest:L src1:L len:10
+long_shr_un_imm: dest:L src1:L len:10
+long_shl_imm: dest:L src1:L len:10
+long_add_imm:
+long_sub_imm:
+long_beq:
+long_bne_un:
+long_blt:
+long_blt_un:
+long_bgt:
+long_btg_un:
+long_bge:
+long_bge_un:
+long_ble:
+long_ble_un:
+float_beq: len:12
+float_bne_un: len:18
+float_blt: len:12
+float_blt_un: len:20
+float_bgt: len:12
+float_btg_un: len:20
+float_bge: len:22
+float_bge_un: len:12
+float_ble: len:22
+float_ble_un: len:12
+float_add: dest:f src1:f src2:f len:2
+float_sub: dest:f src1:f src2:f len:2
+float_mul: dest:f src1:f src2:f len:2
+float_div: dest:f src1:f src2:f len:2
+float_div_un: dest:f src1:f src2:f len:2
+float_rem: dest:f src1:f src2:f len:17
+float_rem_un: dest:f src1:f src2:f len:17
+float_neg: dest:f src1:f len:2
+float_not: dest:f src1:f len:2
+float_conv_to_i1: dest:i src1:f len:39
+float_conv_to_i2: dest:i src1:f len:39
+float_conv_to_i4: dest:i src1:f len:39
+float_conv_to_i8: dest:L src1:f len:39
+float_conv_to_r4:
+float_conv_to_r8:
+float_conv_to_u4: dest:i src1:f len:39
+float_conv_to_u8: dest:L src1:f len:39
+float_conv_to_u2: dest:i src1:f len:39
+float_conv_to_u1: dest:i src1:f len:39
+float_conv_to_i: dest:i src1:f len:39
+float_conv_to_ovf_i: dest:a src1:f len:30
+float_conv_to_ovd_u: dest:a src1:f len:30
+float_add_ovf:
+float_add_ovf_un:
+float_mul_ovf:
+float_mul_ovf_un:
+float_sub_ovf:
+float_sub_ovf_un:
+float_conv_to_ovf_i1_un:
+float_conv_to_ovf_i2_un:
+float_conv_to_ovf_i4_un:
+float_conv_to_ovf_i8_un:
+float_conv_to_ovf_u1_un:
+float_conv_to_ovf_u2_un:
+float_conv_to_ovf_u4_un:
+float_conv_to_ovf_u8_un:
+float_conv_to_ovf_i_un:
+float_conv_to_ovf_u_un:
+float_conv_to_ovf_i1:
+float_conv_to_ovf_u1:
+float_conv_to_ovf_i2:
+float_conv_to_ovf_u2:
+float_conv_to_ovf_i4:
+float_conv_to_ovf_u4:
+float_conv_to_ovf_i8:
+float_conv_to_ovf_u8:
+float_ceq: dest:i src1:f src2:f len:25
+float_cgt: dest:i src1:f src2:f len:25
+float_cgt_un: dest:i src1:f src2:f len:37
+float_clt: dest:i src1:f src2:f len:25
+float_clt_un: dest:i src1:f src2:f len:32
+float_conv_to_u: dest:i src1:f len:36
+call_handler: len:10
+aot_const: dest:i len:5
+x86_test_null: src1:i len:2
+x86_compare_membase_reg: src1:b src2:i len:6
+x86_compare_membase_imm: src1:b len:11
+x86_compare_membase8_imm: src1:b len:8
+x86_compare_reg_membase: src1:i src2:b len:6
+x86_inc_reg: dest:i src1:i clob:1 len:1
+x86_inc_membase: src1:b len:6
+x86_dec_reg: dest:i src1:i clob:1 len:1
+x86_dec_membase: src1:b len:6
+x86_add_membase_imm: src1:b len:11
+x86_sub_membase_imm: src1:b len:11
+x86_push: src1:i len:1
+x86_push_imm: len:5
+x86_push_membase: src1:b len:6
+x86_push_obj: src1:b len:30
+x86_lea: dest:i src1:i src2:i len:7
+x86_lea_membase: dest:i src1:i len:10
+x86_xchg: src1:i src2:i clob:x len:1
+x86_fpop: src1:f len:2
+x86_fp_load_i8: dest:f src1:b len:7
+x86_fp_load_i4: dest:f src1:b len:7
+x86_seteq_membase: src1:b len:7
+x86_setne_membase: src1:b len:7
+x86_add_membase: dest:i src1:i src2:b clob:1 len:11
+x86_sub_membase: dest:i src1:i src2:b clob:1 len:11
+x86_mul_membase: dest:i src1:i src2:b clob:1 len:13
+adc: dest:i src1:i src2:i len:2 clob:1
+addcc: dest:i src1:i src2:i len:2 clob:1
+subcc: dest:i src1:i src2:i len:2 clob:1
+adc_imm: dest:i src1:i len:6 clob:1
+sbb: dest:i src1:i src2:i len:2 clob:1
+sbb_imm: dest:i src1:i len:6 clob:1
+br_reg: src1:i len:2
+sin: dest:f src1:f len:6
+cos: dest:f src1:f len:6
+abs: dest:f src1:f len:2
+tan: dest:f src1:f len:49
+atan: dest:f src1:f len:8
+sqrt: dest:f src1:f len:2
+op_bigmul: len:2 dest:l src1:a src2:i
+op_bigmul_un: len:2 dest:l src1:a src2:i
+sext_i1: dest:i src1:i len:3
+sext_i2: dest:i src1:i len:3
+x86_tls_get: dest:i len:20
diff --git a/mono/mini/cpu-s390.md b/mono/mini/cpu-s390.md
new file mode 100644
index 00000000000..e5256040458
--- /dev/null
+++ b/mono/mini/cpu-s390.md
@@ -0,0 +1,530 @@
+# S/390 64-bit cpu description file
+# this file is read by genmdesc to pruduce a table with all the relevant information
+# about the cpu instructions that may be used by the regsiter allocator, the scheduler
+# and other parts of the arch-dependent part of mini.
+#
+# An opcode name is followed by a colon and optional specifiers.
+# A specifier has a name, a colon and a value. Specifiers are separated by white space.
+# Here is a description of the specifiers valid for this file and their possible values.
+#
+# dest:register describes the destination register of an instruction
+# src1:register describes the first source register of an instruction
+# src2:register describes the second source register of an instruction
+#
+# register may have the following values:
+# i integer register
+# a r3 register (output from calls)
+# b base register (used in address references)
+# f floating point register
+#
+# len:number describe the maximun length in bytes of the instruction
+# number is a positive integer
+#
+# cost:number describe how many cycles are needed to complete the instruction (unused)
+#
+# clob:spec describe if the instruction clobbers registers or has special needs
+#
+# spec can be one of the following characters:
+# c clobbers caller-save registers
+# r 'reserves' the destination register until a later instruction unreserves it
+# used mostly to set output registers in function calls
+#
+# flags:spec describe if the instruction uses or sets the flags (unused)
+#
+# spec can be one of the following chars:
+# s sets the flags
+# u uses the flags
+# m uses and modifies the flags
+#
+# res:spec describe what units are used in the processor (unused)
+#
+# delay: describe delay slots (unused)
+#
+# the required specifiers are: len, clob (if registers are clobbered), the registers
+# specifiers if the registers are actually used, flags (when scheduling is implemented).
+#
+# See the code in mini-x86.c for more details on how the specifiers are used.
+#
+
+adc: dest:i src1:i src2:i len:6
+adc_imm: dest:i src1:i len:14
+add.ovf.un: len: 8 dest:i src1:i src2:i
+add.ovf: len: 24 dest:i src1:i src2:i
+add: dest:i src1:i src2:i len:4 clob:1
+add_imm: dest:i src1:i len:18
+addcc_imm: dest:i src1:i len:18
+add_ovf_carry: dest:i src1:1 src2:i len:28
+add_ovf_un_carry: dest:i src1:1 src2:i len:12
+addcc: dest:i src1:i src2:i len:6
+and: dest:i src1:i src2:i len:6 clob:1
+and_imm: dest:i src1:i len:16
+aot_const: dest:i len:8
+arg:
+arglist:
+beq.s:
+beq: len:8
+bge.s:
+bge.un.s:
+bge.un: len:8
+bge: len:8
+bgt.s:
+bgt.un.s:
+bgt.un: len:8
+bgt: len:8
+ble.s:
+ble.un.s:
+ble.un: len:8
+ble: len:8
+blt.s:
+blt.un.s:
+blt.un: len:8
+blt: len:8
+bne.un.s:
+bne.un: len:8
+box:
+br.s:
+br: len:6
+br_reg: src1:i len:8
+break: len:4
+brfalse.s:
+brfalse:
+brtrue.s:
+brtrue:
+call: dest:a clob:c len:6
+call_handler: len:12
+call_membase: dest:a src1:b len:12 clob:c
+call_reg: dest:a src1:i len:8 clob:c
+calli:
+callvirt:
+castclass:
+ceq: dest:i len:12
+cgt.un: dest:i len:12
+cgt: dest:i len:12
+checkthis: src1:b len:4
+ckfinite: dest:f src1:f len:22
+clt.un: dest:i len:12
+clt: dest:i len:12
+compare: src1:i src2:i len:4
+compare_imm: src1:i len:14
+cond_exc_c: len:8
+cond_exc_eq: len:8
+cond_exc_ge: len:8
+cond_exc_ge_un: len:8
+cond_exc_gt: len:8
+cond_exc_gt_un: len:8
+cond_exc_le: len:8
+cond_exc_le_un: len:8
+cond_exc_lt: len:8
+cond_exc_lt_un: len:8
+cond_exc_nc: len:8
+cond_exc_ne_un: len:8
+cond_exc_no: len:8
+cond_exc_ov: len:8
+conv.i1: dest:i src1:i len:24
+conv.i2: dest:i src1:i len:24
+conv.i4: dest:i src1:i len:2
+conv.i8:
+conv.i: dest:i src1:i len:2
+conv.ovf.i.un:
+conv.ovf.i1.un:
+conv.ovf.i1:
+conv.ovf.i2.un:
+conv.ovf.i2:
+conv.ovf.i4.un:
+conv.ovf.i4:
+conv.ovf.i8.un:
+conv.ovf.i8:
+conv.ovf.i:
+conv.ovf.u.un:
+conv.ovf.u1.un:
+conv.ovf.u1:
+conv.ovf.u2.un:
+conv.ovf.u2:
+conv.ovf.u4.un:
+conv.ovf.u4:
+conv.ovf.u8.un:
+conv.ovf.u8:
+conv.ovf.u:
+conv.r.un: dest:f src1:i len:30
+conv.r4: dest:f src1:i len:4
+conv.r8: dest:f src1:i len:4
+conv.u1: dest:i src1:i len:8
+conv.u2: dest:i src1:i len:14
+conv.u4: dest:i src1:i
+conv.u8:
+conv.u: dest:i src1:i len:4
+cpblk:
+cpobj:
+div.un: dest:a src1:i src2:i len:12 clob:d
+div: dest:a src1:i src2:i len:10 clob:d
+div_imm: dest:i src1:i src2:i len:24
+div_un_imm: dest:i src1:i src2:i len:24
+dup:
+endfilter: len:20
+endfinally: len: 20
+endmac:
+fcall: dest:f len:10 clob:c
+fcall_membase: dest:f src1:b len:14 clob:c
+fcall_reg: dest:f src1:i len:10 clob:c
+fcompare: src1:f src2:f len:14
+float_add: dest:f src1:f src2:f len:6
+float_add_ovf:
+float_add_ovf_un:
+float_beq: len:8
+float_bge: len:8
+float_bge_un: len:8
+float_bgt: len:8
+float_ble: len:8
+float_ble_un: len:8
+float_blt: len:8
+float_blt_un: len:8
+float_bne_un: len:8
+float_btg_un: len:8
+float_ceq: dest:i src1:f src2:f len:16
+float_cgt: dest:i src1:f src2:f len:16
+float_cgt_un: dest:i src1:f src2:f len:16
+float_clt: dest:i src1:f src2:f len:16
+float_clt_un: dest:i src1:f src2:f len:16
+float_conv_to_i1: dest:i src1:f len:50
+float_conv_to_i2: dest:i src1:f len:50
+float_conv_to_i4: dest:i src1:f len:50
+float_conv_to_i8: dest:l src1:f len:50
+float_conv_to_i: dest:i src1:f len:52
+float_conv_to_ovd_u:
+float_conv_to_ovf_i1:
+float_conv_to_ovf_i1_un:
+float_conv_to_ovf_i2:
+float_conv_to_ovf_i2_un:
+float_conv_to_ovf_i4:
+float_conv_to_ovf_i4_un:
+float_conv_to_ovf_i8:
+float_conv_to_ovf_i8_un:
+float_conv_to_ovf_i:
+float_conv_to_ovf_i_un:
+float_conv_to_ovf_u1:
+float_conv_to_ovf_u1_un:
+float_conv_to_ovf_u2:
+float_conv_to_ovf_u2_un:
+float_conv_to_ovf_u4:
+float_conv_to_ovf_u4_un:
+float_conv_to_ovf_u8:
+float_conv_to_ovf_u8_un:
+float_conv_to_ovf_u_un:
+float_conv_to_r4: dest:f src1:f len:4
+float_conv_to_r8:
+float_conv_to_u1: dest:i src1:f len:62
+float_conv_to_u2: dest:i src1:f len:62
+float_conv_to_u4: dest:i src1:f len:62
+float_conv_to_u8: dest:l src1:f len:62
+float_conv_to_u: dest:i src1:f len:36
+float_div: dest:f src1:f src2:f len:6
+float_div_un: dest:f src1:f src2:f len:6
+float_mul: dest:f src1:f src2:f len:6
+float_mul_ovf:
+float_mul_ovf_un:
+float_neg: dest:f src1:f len:6
+float_not: dest:f src1:f len:6
+float_rem: dest:f src1:f src2:f len:16
+float_rem_un: dest:f src1:f src2:f len:16
+float_sub: dest:f src1:f src2:f len:6
+float_sub_ovf:
+float_sub_ovf_un:
+fmove: dest:f src1:f len:4
+i8const:
+iconst: dest:i len:16
+illegal:
+initblk:
+initobj:
+isinst:
+jmp: len:40
+label:
+lcall: dest:l len:8 clob:c
+lcall_membase: dest:l src1:b len:12 clob:c
+lcall_reg: dest:l src1:i len:8 clob:c
+lcompare:
+ldaddr:
+ldarg.0:
+ldarg.1:
+ldarg.2:
+ldarg.3:
+ldarg.s:
+ldarg:
+ldarga.s:
+ldarga:
+ldc.i4.0:
+ldc.i4.1:
+ldc.i4.2:
+ldc.i4.3:
+ldc.i4.4:
+ldc.i4.5:
+ldc.i4.6:
+ldc.i4.7:
+ldc.i4.8:
+ldc.i4.m1:
+ldc.i4.s:
+ldc.i4:
+ldc.i8:
+ldc.r4:
+ldc.r8:
+ldelem.i1:
+ldelem.i2:
+ldelem.i4:
+ldelem.i8:
+ldelem.i:
+ldelem.r4:
+ldelem.r8:
+ldelem.ref:
+ldelem.u1:
+ldelem.u2:
+ldelem.u4:
+ldelema:
+ldfld:
+ldflda:
+ldftn:
+ldind.i1: dest:i len:8
+ldind.i2: dest:i len:8
+ldind.i4: dest:i len:8
+ldind.i8:
+ldind.i: dest:i len:8
+ldind.r4:
+ldind.r8:
+ldind.ref: dest:i len:8
+ldind.u1: dest:i len:8
+ldind.u2: dest:i len:8
+ldind.u4: dest:i len:8
+ldlen:
+ldloc.0:
+ldloc.1:
+ldloc.2:
+ldloc.3:
+ldloc.s:
+ldloc:
+ldloca.s:
+ldloca:
+ldnull:
+ldobj:
+ldsfld:
+ldsflda:
+ldstr:
+ldtoken:
+ldvirtftn:
+leave.s:
+leave:
+load:
+load_membase: dest:i src1:b len:18
+loadi1_membase: dest:i src1:b len:40
+loadi2_membase: dest:i src1:b len:24
+loadi4_membase: dest:i src1:b len:18
+loadi8_membase: dest:i src1:b
+loadr4_membase: dest:f src1:b len:20
+loadr8_membase: dest:f src1:b len:18
+loadu1_membase: dest:i src1:b len:26
+loadu2_membase: dest:i src1:b len:26
+loadu4_mem: dest:i len:8
+loadu4_membase: dest:i src1:b len:18
+local:
+localloc: dest:i src1:i len:40
+long_add:
+long_add_imm:
+long_add_ovf:
+long_add_ovf_un:
+long_and:
+long_beq:
+long_bge:
+long_bge_un:
+long_bgt:
+long_ble:
+long_ble_un:
+long_blt:
+long_blt_un:
+long_bne_un:
+long_btg_un:
+long_ceq:
+long_cgt:
+long_cgt_un:
+long_clt:
+long_clt_un:
+long_conv_to_i1:
+long_conv_to_i2:
+long_conv_to_i4:
+long_conv_to_i8:
+long_conv_to_i:
+long_conv_to_ovf_i1:
+long_conv_to_ovf_i1_un:
+long_conv_to_ovf_i2:
+long_conv_to_ovf_i2_un:
+long_conv_to_ovf_i4:
+long_conv_to_ovf_i4_un:
+long_conv_to_ovf_i8:
+long_conv_to_ovf_i8_un:
+long_conv_to_ovf_i: dest:i src1:i src2:i len:44
+long_conv_to_ovf_i_un:
+long_conv_to_ovf_u1:
+long_conv_to_ovf_u1_un:
+long_conv_to_ovf_u2:
+long_conv_to_ovf_u2_un:
+long_conv_to_ovf_u4:
+long_conv_to_ovf_u4_un:
+long_conv_to_ovf_u8:
+long_conv_to_ovf_u8_un:
+long_conv_to_ovf_u:
+long_conv_to_ovf_u_un:
+long_conv_to_r4:
+long_conv_to_r8:
+long_conv_to_r_un: dest:f src1:i src2:i len:37
+long_conv_to_u1:
+long_conv_to_u2:
+long_conv_to_u4:
+long_conv_to_u8:
+long_conv_to_u:
+long_div:
+long_div_un:
+long_mul:
+long_mul_ovf: len: 18
+long_mul_ovf_un: len: 18
+long_neg:
+long_not:
+long_or:
+long_rem:
+long_rem_un:
+long_shl:
+long_shl_imm:
+long_shr:
+long_shr_imm:
+long_shr_un:
+long_shr_un_imm:
+long_sub:
+long_sub_imm:
+long_sub_ovf:
+long_sub_ovf_un:
+long_xor:
+mkrefany:
+mono_ldptr:
+mono_newobj:
+mono_objaddr:
+mono_retobj:
+mono_vtaddr:
+move: dest:i src1:i len:4
+mul.ovf.un: dest:i src1:i src2:i len:20 clob:1
+mul.ovf: dest:i src1:i src2:i len:42 clob:1
+mul: dest:i src1:i src2:i len:4 clob:1
+mul_imm: dest:i src1:i len:18
+neg: dest:i src1:i len:4 clob:1
+newarr:
+newobj:
+nop: len:4
+not: dest:i src1:i len:8 clob:1
+op_bigmul: len:2 dest:l src1:a src2:i
+op_bigmul_un: len:2 dest:l src1:a src2:i
+op_endfilter: src1:i len:12
+oparglist: src1:i len:18
+or: dest:i src1:i src2:i len:4 clob:1
+or_imm: dest:i src1:i len:16
+outarg: src1:i len:1
+outarg_imm: len:5
+phi:
+pop:
+prefix1:
+prefix2:
+prefix3:
+prefix4:
+prefix5:
+prefix6:
+prefix7:
+prefixref:
+r4const: dest:f len:22
+r8const: dest:f len:18
+refanytype:
+refanyval:
+reg:
+regoffset:
+regvar:
+rem.un: dest:d src1:i src2:i len:12 clob:d
+rem: dest:d src1:i src2:i len:10 clob:d
+rem_imm: dest:i src1:i src2:i len:24
+rem_un_imm: dest:i src1:i src2:i len:24
+rename:
+ret:
+retarg:
+rethrow: src1:i len:8
+s390_move: len:48 dest:b src1:b
+s390_setf4ret: dest:f src1:f len:4 clob:r
+sbb: dest:i src1:i src2:i len:6
+sbb_imm: dest:i src1:i len:14
+setfreg: dest:f src1:f len:4 clob:r
+setlret: src1:i src2:i len:12
+setreg: dest:i src1:i len:4 clob:r
+setregimm: dest:i len:18 clob:r
+setret: dest:a src1:i len:6
+shl: dest:i src1:i src2:i clob:s len:6
+shl_imm: dest:i src1:i len:8
+shr.un: dest:i src1:i src2:i clob:s len:6
+shr: dest:i src1:i src2:i clob:s len:6
+shr_imm: dest:i src1:i len:8
+shr_un_imm: dest:i src1:i len:8
+sizeof:
+sqrt: dest:f src1:f len:4
+starg.s:
+starg:
+start_handler: len:18
+stelem.i1:
+stelem.i2:
+stelem.i4:
+stelem.i8:
+stelem.i:
+stelem.r4:
+stelem.r8:
+stelem.ref:
+stfld:
+stind.i1: src1:b src2:i
+stind.i2: src1:b src2:i
+stind.i4: src1:b src2:i
+stind.i8:
+stind.i:
+stind.r4: src1:b src2:f
+stind.r8: src1:b src2:f
+stind.ref: src1:b src2:i
+stloc.0:
+stloc.1:
+stloc.2:
+stloc.3:
+stloc.s:
+stloc:
+stobj:
+store:
+store_membase_imm: dest:b len:32
+store_membase_reg: dest:b src1:i len:18
+storei1_membase_imm: dest:b len:32
+storei1_membase_reg: dest:b src1:i len:18
+storei2_membase_imm: dest:b len:32
+storei2_membase_reg: dest:b src1:i len:18
+storei4_membase_imm: dest:b len:32
+storei4_membase_reg: dest:b src1:i len:18
+storei8_membase_imm: dest:b
+storei8_membase_reg: dest:b src1:i
+storer4_membase_reg: dest:b src1:f len:22
+storer8_membase_reg: dest:b src1:f len:22
+stsfld:
+sub.ovf.un: len:10 dest:i src1:i src2:i
+sub.ovf: len:24 dest:i src1:i src2:i
+sub: dest:i src1:i src2:i len:4 clob:1
+sub_imm: dest:i src1:i len:18
+subcc_imm: dest:i src1:i len:18
+sub_ovf_carry: dest:i src1:1 src2:i len:28
+sub_ovf_un_carry: dest:i src1:1 src2:i len:12
+subcc: dest:i src1:i src2:i len:6
+switch:
+tail.:
+throw: src1:i len:8
+trap:
+unaligned.:
+unbox:
+vcall: len:8 clob:c
+vcall_membase: src1:b len:12 clob:c
+vcall_reg: src1:i len:8 clob:c
+voidcall: len:8 clob:c
+voidcall_membase: src1:b len:12 clob:c
+voidcall_reg: src1:i len:8 clob:c
+volatile.:
+xor: dest:i src1:i src2:i len:4 clob:1
+xor_imm: dest:i src1:i len:16
diff --git a/mono/mini/cpu-s390x.md b/mono/mini/cpu-s390x.md
new file mode 100644
index 00000000000..17df1941a03
--- /dev/null
+++ b/mono/mini/cpu-s390x.md
@@ -0,0 +1,579 @@
+# S/390 cpu description file
+# this file is read by genmdesc to pruduce a table with all the relevant information
+# about the cpu instructions that may be used by the regsiter allocator, the scheduler
+# and other parts of the arch-dependent part of mini.
+#
+# An opcode name is followed by a colon and optional specifiers.
+# A specifier has a name, a colon and a value. Specifiers are separated by white space.
+# Here is a description of the specifiers valid for this file and their possible values.
+#
+# dest:register describes the destination register of an instruction
+# src1:register describes the first source register of an instruction
+# src2:register describes the second source register of an instruction
+#
+# register may have the following values:
+# i integer register
+# a r3 register (output from calls)
+# b base register (used in address references)
+# f floating point register
+#
+# len:number describe the maximun length in bytes of the instruction
+# number is a positive integer
+#
+# cost:number describe how many cycles are needed to complete the instruction (unused)
+#
+# clob:spec describe if the instruction clobbers registers or has special needs
+#
+# spec can be one of the following characters:
+# c clobbers caller-save registers
+# r 'reserves' the destination register until a later instruction unreserves it
+# used mostly to set output registers in function calls
+#
+# flags:spec describe if the instruction uses or sets the flags (unused)
+#
+# spec can be one of the following chars:
+# s sets the flags
+# u uses the flags
+# m uses and modifies the flags
+#
+# res:spec describe what units are used in the processor (unused)
+#
+# delay: describe delay slots (unused)
+#
+# the required specifiers are: len, clob (if registers are clobbered), the registers
+# specifiers if the registers are actually used, flags (when scheduling is implemented).
+#
+# See the code in mini-x86.c for more details on how the specifiers are used.
+#
+
+adc: dest:i src1:i src2:i len:6
+adc_imm: dest:i src1:i len:14
+add.ovf.un: len: 8 dest:i src1:i src2:i
+add.ovf: len: 24 dest:i src1:i src2:i
+add: dest:i src1:i src2:i len:6 clob:1
+add_imm: dest:i src1:i len:18
+add_ovf_carry: dest:i src1:1 src2:i len:28
+add_ovf_un_carry: dest:i src1:1 src2:i len:12
+addcc: dest:i src1:i src2:i len:6
+and: dest:i src1:i src2:i len:6 clob:1
+and_imm: dest:i src1:i len:20
+aot_const: dest:i len:8
+arg:
+arglist:
+beq.s:
+beq: len:8
+bge.s:
+bge.un.s:
+bge.un: len:8
+bge: len:8
+bgt.s:
+bgt.un.s:
+bgt.un: len:8
+bgt: len:8
+ble.s:
+ble.un.s:
+ble.un: len:8
+ble: len:8
+blt.s:
+blt.un.s:
+blt.un: len:8
+blt: len:8
+bne.un.s:
+bne.un: len:8
+box:
+br.s:
+br: len:6
+br_reg: src1:i len:8
+break: len:4
+brfalse.s:
+brfalse:
+brtrue.s:
+brtrue:
+call: dest:a clob:c len:26
+call_handler: len:12
+call_membase: dest:a src1:b len:12 clob:c
+call_reg: dest:a src1:i len:8 clob:c
+calli:
+callvirt:
+castclass:
+ceq: dest:i len:12
+cgt.un: dest:i len:12
+cgt: dest:i len:12
+checkthis: src1:b len:10
+ckfinite: dest:f src1:f len:22
+clt.un: dest:i len:12
+clt: dest:i len:12
+compare: src1:i src2:i len:4
+compare_imm: src1:i len:14
+cond_exc_c: len:8
+cond_exc_eq: len:8
+cond_exc_ge: len:8
+cond_exc_ge_un: len:8
+cond_exc_gt: len:8
+cond_exc_gt_un: len:8
+cond_exc_le: len:8
+cond_exc_le_un: len:8
+cond_exc_lt: len:8
+cond_exc_lt_un: len:8
+cond_exc_nc: len:8
+cond_exc_ne_un: len:8
+cond_exc_no: len:8
+cond_exc_ov: len:8
+conv.i1: dest:i src1:i len:26
+conv.i2: dest:i src1:i len:32
+conv.i4: dest:i src1:i len:4
+conv.i8: dest:i src1:i len:4
+conv.i: dest:i src1:i len:2
+conv.ovf.i.un:
+conv.ovf.i1.un:
+conv.ovf.i1:
+conv.ovf.i2.un:
+conv.ovf.i2:
+conv.ovf.i4.un:
+conv.ovf.i4:
+conv.ovf.i8.un:
+conv.ovf.i8:
+conv.ovf.i:
+conv.ovf.u.un:
+conv.ovf.u1.un:
+conv.ovf.u1:
+conv.ovf.u2.un:
+conv.ovf.u2:
+conv.ovf.u4.un:
+conv.ovf.u4:
+conv.ovf.u8.un:
+conv.ovf.u8:
+conv.ovf.u:
+conv.r.un: dest:f src1:i len:30
+conv.r4: dest:f src1:i len:4
+conv.r8: dest:f src1:i len:4
+conv.u1: dest:i src1:i len:8
+conv.u2: dest:i src1:i len:14
+conv.u4: dest:i src1:i
+conv.u8: dest:i src1:i
+conv.u: dest:i src1:i len:4
+cpblk:
+cpobj:
+div.un: dest:a src1:i src2:i len:12 clob:d
+div: dest:a src1:i src2:i len:10 clob:d
+div_imm: dest:i src1:i src2:i len:24
+div_un_imm: dest:i src1:i src2:i len:24
+dup:
+endfilter: len:20
+endfinally: len: 20
+endmac:
+fcall: dest:f len:26 clob:c
+fcall_membase: dest:f src1:b len:14 clob:c
+fcall_reg: dest:f src1:i len:10 clob:c
+fcompare: src1:f src2:f len:14
+float_add: dest:f src1:f src2:f len:6
+float_add_ovf:
+float_add_ovf_un:
+float_beq: len:8
+float_bge: len:8
+float_bge_un: len:8
+float_bgt: len:8
+float_ble: len:8
+float_ble_un: len:8
+float_blt: len:8
+float_blt_un: len:8
+float_bne_un: len:8
+float_btg_un: len:8
+float_ceq: dest:i src1:f src2:f len:16
+float_cgt: dest:i src1:f src2:f len:16
+float_cgt_un: dest:i src1:f src2:f len:16
+float_clt: dest:i src1:f src2:f len:16
+float_clt_un: dest:i src1:f src2:f len:16
+float_conv_to_i1: dest:i src1:f len:50
+float_conv_to_i2: dest:i src1:f len:50
+float_conv_to_i4: dest:i src1:f len:50
+float_conv_to_i8: dest:l src1:f len:50
+float_conv_to_i: dest:i src1:f len:52
+float_conv_to_ovd_u:
+float_conv_to_ovf_i1:
+float_conv_to_ovf_i1_un:
+float_conv_to_ovf_i2:
+float_conv_to_ovf_i2_un:
+float_conv_to_ovf_i4:
+float_conv_to_ovf_i4_un:
+float_conv_to_ovf_i8:
+float_conv_to_ovf_i8_un:
+float_conv_to_ovf_i:
+float_conv_to_ovf_i_un:
+float_conv_to_ovf_u1:
+float_conv_to_ovf_u1_un:
+float_conv_to_ovf_u2:
+float_conv_to_ovf_u2_un:
+float_conv_to_ovf_u4:
+float_conv_to_ovf_u4_un:
+float_conv_to_ovf_u8:
+float_conv_to_ovf_u8_un:
+float_conv_to_ovf_u_un:
+float_conv_to_r4: dest:f src1:f len:4
+float_conv_to_r8:
+float_conv_to_u1: dest:i src1:f len:66
+float_conv_to_u2: dest:i src1:f len:66
+float_conv_to_u4: dest:i src1:f len:66
+float_conv_to_u8: dest:l src1:f len:66
+float_conv_to_u: dest:i src1:f len:36
+float_div: dest:f src1:f src2:f len:6
+float_div_un: dest:f src1:f src2:f len:6
+float_mul: dest:f src1:f src2:f len:6
+float_mul_ovf:
+float_mul_ovf_un:
+float_neg: dest:f src1:f len:6
+float_not: dest:f src1:f len:6
+float_rem: dest:f src1:f src2:f len:16
+float_rem_un: dest:f src1:f src2:f len:16
+float_sub: dest:f src1:f src2:f len:6
+float_sub_ovf:
+float_sub_ovf_un:
+fmove: dest:f src1:f len:4
+i8const: dest:i len:20
+icompare: src1:i src2:i len:4
+icompare_imm: src1:i src2:i len:14
+iconst: dest:i len:20
+illegal:
+initblk:
+initobj:
+int_adc: dest:i src1:i src2:i clob:1 len:6
+int_adc_imm: dest:i src1:i clob:1 len:14
+int_addcc: dest:i src1:i src2:i clob:1 len:6
+int_add: dest:i src1:i src2:i clob:1 len:4
+int_add_imm: dest:i src1:i clob:1 len:18
+int_and: dest:i src1:i src2:i clob:1 len:6
+int_and_imm: dest:i src1:i clob:1 len:16
+int_beq: len:8
+int_bge: len:8
+int_bge_un: len:8
+int_bgt: len:8
+int_bgt_un: len:8
+int_ble: len:8
+int_ble_un: len:8
+int_blt: len:8
+int_blt_un: len:8
+int_bne_un: len:8
+int_ceq: dest:i len:12
+int_cgt: dest:i len:12
+int_cgt_un: dest:i len:12
+int_clt: dest:i len:12
+int_clt_un: dest:i len:12
+int_div: dest:a src1:i src2:i clob:d len:10
+int_div_imm: dest:a src1:i clob:d len:24
+int_div_un: dest:a src1:i src2:i clob:d len:12
+int_div_un_imm: dest:a src1:i clob:d len:24
+int_mul: dest:i src1:i src2:i clob:1 len:4
+int_mul_imm: dest:i src1:i clob:1 len:18
+int_mul_ovf: dest:i src1:i src2:i clob:1 len:42
+int_mul_ovf_un: dest:i src1:i src2:i clob:1 len:20
+int_neg: dest:i src1:i clob:1 len:4
+int_not: dest:i src1:i clob:1 len:8
+int_or: dest:i src1:i src2:i clob:1 len:4
+int_or_imm: dest:i src1:i clob:1 len:16
+int_rem: dest:d src1:i src2:i clob:d len:10
+int_rem_imm: dest:d src1:i clob:d len:24
+int_rem_un: dest:d src1:i src2:i clob:d len:12
+int_rem_un_imm: dest:d src1:i clob:d len:24
+int_sbb: dest:i src1:i src2:i clob:1 len:6
+int_sbb_imm: dest:i src1:i clob:1 len:14
+int_shl: dest:i src1:i src2:i clob:s len:6
+int_shl_imm: dest:i src1:i clob:1 len:8
+int_shr: dest:i src1:i src2:i clob:s len:6
+int_shr_imm: dest:i src1:i clob:1 len:8
+int_shr_un: dest:i src1:i src2:i clob:s len:6
+int_shr_un_imm: dest:i src1:i clob:1 len:8
+int_subcc: dest:i src1:i src2:i clob:1 len:6
+int_sub: dest:i src1:i src2:i clob:1 len:4
+int_sub_imm: dest:i src1:i clob:1 len:18
+int_xor: dest:i src1:i src2:i clob:1 len:4
+int_xor_imm: dest:i src1:i clob:1 len:16
+isinst:
+jmp: len:40
+label:
+lcall: dest:l len:22 clob:c
+lcall_membase: dest:l src1:b len:12 clob:c
+lcall_reg: dest:l src1:i len:8 clob:c
+lcompare: src1:i src2:i len:4
+ldaddr:
+ldarg.0:
+ldarg.1:
+ldarg.2:
+ldarg.3:
+ldarg.s:
+ldarg:
+ldarga.s:
+ldarga:
+ldc.i4.0:
+ldc.i4.1:
+ldc.i4.2:
+ldc.i4.3:
+ldc.i4.4:
+ldc.i4.5:
+ldc.i4.6:
+ldc.i4.7:
+ldc.i4.8:
+ldc.i4.m1:
+ldc.i4.s:
+ldc.i4:
+ldc.i8:
+ldc.r4:
+ldc.r8:
+ldelem.i1:
+ldelem.i2:
+ldelem.i4:
+ldelem.i8:
+ldelem.i:
+ldelem.r4:
+ldelem.r8:
+ldelem.ref:
+ldelem.u1:
+ldelem.u2:
+ldelem.u4:
+ldelema:
+ldfld:
+ldflda:
+ldftn:
+ldind.i1: dest:i len:8
+ldind.i2: dest:i len:8
+ldind.i4: dest:i len:8
+ldind.i8:
+ldind.i: dest:i len:8
+ldind.r4:
+ldind.r8:
+ldind.ref: dest:i len:8
+ldind.u1: dest:i len:8
+ldind.u2: dest:i len:8
+ldind.u4: dest:i len:8
+ldlen:
+ldloc.0:
+ldloc.1:
+ldloc.2:
+ldloc.3:
+ldloc.s:
+ldloc:
+ldloca.s:
+ldloca:
+ldnull:
+ldobj:
+ldsfld:
+ldsflda:
+ldstr:
+ldtoken:
+ldvirtftn:
+leave.s:
+leave:
+load:
+load_membase: dest:i src1:b len:26
+loadi1_membase: dest:i src1:b len:40
+loadi2_membase: dest:i src1:b len:24
+loadi4_membase: dest:i src1:b len:26
+loadi8_membase: dest:i src1:b len:26
+loadr4_membase: dest:f src1:b len:20
+loadr8_membase: dest:f src1:b len:26
+loadu1_membase: dest:i src1:b len:26
+loadu2_membase: dest:i src1:b len:26
+loadu4_mem: dest:i len:8
+loadu4_membase: dest:i src1:b len:18
+local:
+localloc: dest:i src1:i len:40
+long_add:
+long_add_imm:
+long_add_ovf:
+long_add_ovf_un:
+long_and:
+long_beq:
+long_bge:
+long_bge_un:
+long_bgt:
+long_ble:
+long_ble_un:
+long_blt:
+long_blt_un:
+long_bne_un:
+long_btg_un:
+long_ceq:
+long_cgt:
+long_cgt_un:
+long_clt:
+long_clt_un:
+long_conv_to_i1:
+long_conv_to_i2:
+long_conv_to_i4:
+long_conv_to_i8:
+long_conv_to_i:
+long_conv_to_ovf_i1:
+long_conv_to_ovf_i1_un:
+long_conv_to_ovf_i2:
+long_conv_to_ovf_i2_un:
+long_conv_to_ovf_i4:
+long_conv_to_ovf_i4_un:
+long_conv_to_ovf_i8:
+long_conv_to_ovf_i8_un:
+long_conv_to_ovf_i: dest:i src1:i src2:i len:44
+long_conv_to_ovf_i_un:
+long_conv_to_ovf_u1:
+long_conv_to_ovf_u1_un:
+long_conv_to_ovf_u2:
+long_conv_to_ovf_u2_un:
+long_conv_to_ovf_u4:
+long_conv_to_ovf_u4_un:
+long_conv_to_ovf_u8:
+long_conv_to_ovf_u8_un:
+long_conv_to_ovf_u:
+long_conv_to_ovf_u_un:
+long_conv_to_r4:
+long_conv_to_r8:
+long_conv_to_r_un: dest:f src1:i src2:i len:37
+long_conv_to_u1:
+long_conv_to_u2:
+long_conv_to_u4:
+long_conv_to_u8:
+long_conv_to_u:
+long_div:
+long_div_un:
+long_mul:
+long_mul_ovf: len: 18
+long_mul_ovf_un: len: 18
+long_neg:
+long_not:
+long_or:
+long_rem:
+long_rem_un:
+long_shl: dest:i src1:i src2:i clob:s len:6
+long_shl_imm: dest:i src1:i len:8
+long_shr_un: dest:i src1:i src2:i clob:s len:6
+long_shr: dest:i src1:i src2:i clob:s len:6
+long_shr_imm: dest:i src1:i len:8
+long_shr_un_imm: dest:i src1:i len:8
+long_sub:
+long_sub_imm:
+long_sub_ovf:
+long_sub_ovf_un:
+long_xor:
+mkrefany:
+mono_ldptr:
+mono_newobj:
+mono_objaddr:
+mono_retobj:
+mono_vtaddr:
+move: dest:i src1:i len:4
+mul.ovf.un: dest:i src1:i src2:i len:20 clob:1
+mul.ovf: dest:i src1:i src2:i len:42 clob:1
+mul: dest:i src1:i src2:i len:6 clob:1
+mul_imm: dest:i src1:i len:18
+neg: dest:i src1:i len:6 clob:1
+newarr:
+newobj:
+nop: len:4
+not: dest:i src1:i len:8 clob:1
+op_bigmul: len:2 dest:l src1:a src2:i
+op_bigmul_un: len:2 dest:l src1:a src2:i
+op_endfilter: src1:i len:12
+or: dest:i src1:i src2:i len:6 clob:1
+or_imm: dest:i src1:i len:16
+outarg: src1:i len:1
+outarg_imm: len:5
+phi:
+pop:
+prefix1:
+prefix2:
+prefix3:
+prefix4:
+prefix5:
+prefix6:
+prefix7:
+prefixref:
+r4const: dest:f len:26
+r8const: dest:f len:24
+refanytype:
+refanyval:
+reg:
+regoffset:
+regvar:
+rem.un: dest:d src1:i src2:i len:12 clob:d
+rem: dest:d src1:i src2:i len:10 clob:d
+rem_imm: dest:i src1:i src2:i len:24
+rem_un_imm: dest:i src1:i src2:i len:24
+rename:
+ret:
+retarg:
+rethrow:
+s390_move: len:48 dest:b src1:b
+s390_setf4ret: dest:f src1:f len:4 clob:r
+sbb: dest:i src1:i src2:i len:6
+sbb_imm: dest:i src1:i len:14
+setfreg: dest:f src1:f len:4 clob:r
+setreg: dest:i src1:i len:4 clob:r
+setregimm: dest:i len:20 clob:r
+setret: dest:a src1:i len:4
+shl: dest:i src1:i src2:i clob:s len:6
+shl_imm: dest:i src1:i len:8
+shr.un: dest:i src1:i src2:i clob:s len:6
+shr: dest:i src1:i src2:i clob:s len:6
+shr_imm: dest:i src1:i len:8
+shr_un_imm: dest:i src1:i len:8
+sizeof:
+sqrt: dest:f src1:f len:4
+starg.s:
+starg:
+start_handler: len:18
+stelem.i1:
+stelem.i2:
+stelem.i4:
+stelem.i8:
+stelem.i:
+stelem.r4:
+stelem.r8:
+stelem.ref:
+stfld:
+stind.i1: src1:b src2:i
+stind.i2: src1:b src2:i
+stind.i4: src1:b src2:i
+stind.i8:
+stind.i:
+stind.r4: src1:b src2:f
+stind.r8: src1:b src2:f
+stind.ref: src1:b src2:i
+stloc.0:
+stloc.1:
+stloc.2:
+stloc.3:
+stloc.s:
+stloc:
+stobj:
+store:
+store_membase_imm: dest:b len:32
+store_membase_reg: dest:b src1:i len:18
+storei1_membase_imm: dest:b len:32
+storei1_membase_reg: dest:b src1:i len:18
+storei2_membase_imm: dest:b len:32
+storei2_membase_reg: dest:b src1:i len:18
+storei4_membase_imm: dest:b len:32
+storei4_membase_reg: dest:b src1:i len:18
+storei8_membase_imm: dest:b len:38
+storei8_membase_reg: dest:b src1:i len:26
+storer4_membase_reg: dest:b src1:f len:22
+storer8_membase_reg: dest:b src1:f len:22
+stsfld:
+sub.ovf.un: len:10 dest:i src1:i src2:i
+sub.ovf: len:24 dest:i src1:i src2:i
+sub: dest:i src1:i src2:i len:6 clob:1
+sub_imm: dest:i src1:i len:18
+sub_ovf_carry: dest:i src1:1 src2:i len:28
+sub_ovf_un_carry: dest:i src1:1 src2:i len:12
+subcc: dest:i src1:i src2:i len:6
+switch:
+tail.:
+throw: src1:i len:26
+trap:
+unaligned.:
+unbox:
+vcall: len:22 clob:c
+vcall_membase: src1:b len:12 clob:c
+vcall_reg: src1:i len:8 clob:c
+voidcall: len:22 clob:c
+voidcall_membase: src1:b len:12 clob:c
+voidcall_reg: src1:i len:8 clob:c
+volatile.:
+xor: dest:i src1:i src2:i len:6 clob:1
+xor_imm: dest:i src1:i len:16
diff --git a/mono/mini/cpu-sparc.md b/mono/mini/cpu-sparc.md
new file mode 100644
index 00000000000..d026edda088
--- /dev/null
+++ b/mono/mini/cpu-sparc.md
@@ -0,0 +1,591 @@
+# sparc32 cpu description file
+# this file is read by genmdesc to pruduce a table with all the relevant information
+# about the cpu instructions that may be used by the register allocator, the scheduler
+# and other parts of the arch-dependent part of mini.
+#
+# An opcode name is followed by a colon and optional specifiers.
+# A specifier has a name, a colon and a value. Specifiers are separated by white space.
+# Here is a description of the specifiers valid for this file and their possible values.
+#
+# dest:register describes the destination register of an instruction
+# src1:register describes the first source register of an instruction
+# src2:register describes the second source register of an instruction
+#
+# register may have the following values:
+# i integer register
+# b base register (used in address references)
+# f floating point register
+# l register pair (same as 'i' on v9)
+#
+# len:number describe the maximun length in bytes of the instruction
+# number is a positive integer
+#
+# cost:number describe how many cycles are needed to complete the instruction (unused)
+#
+# clob:spec describe if the instruction clobbers registers or has special needs
+#
+# spec can be one of the following characters:
+# c clobbers caller-save registers
+# r 'reserves' the destination register until a later instruction unreserves it
+# used mostly to set output registers in function calls
+#
+# flags:spec describe if the instruction uses or sets the flags (unused)
+#
+# spec can be one of the following chars:
+# s sets the flags
+# u uses the flags
+# m uses and modifies the flags
+#
+# res:spec describe what units are used in the processor (unused)
+#
+# delay: describe delay slots (unused)
+#
+# the required specifiers are: len, clob (if registers are clobbered), the registers
+# specifiers if the registers are actually used, flags (when scheduling is implemented).
+#
+# See the code in mini-sparc32.c for more details on how the specifiers are used.
+#
+nop: len:4
+break: len:64
+ldarg.0:
+ldarg.1:
+ldarg.2:
+ldarg.3:
+ldloc.0:
+ldloc.1:
+ldloc.2:
+ldloc.3:
+stloc.0:
+stloc.1:
+stloc.2:
+stloc.3:
+ldarg.s:
+ldarga.s:
+starg.s:
+ldloc.s:
+ldloca.s:
+stloc.s:
+ldnull:
+ldc.i4.m1:
+ldc.i4.0:
+ldc.i4.1:
+ldc.i4.2:
+ldc.i4.3:
+ldc.i4.4:
+ldc.i4.5:
+ldc.i4.6:
+ldc.i4.7:
+ldc.i4.8:
+ldc.i4.s:
+ldc.i4:
+ldc.i8:
+ldc.r4:
+ldc.r8:
+dup:
+pop:
+jmp: len:64
+call: dest:i clob:c len:40
+calli:
+ret:
+br.s:
+brfalse.s:
+brtrue.s:
+beq.s:
+bge.s:
+bgt.s:
+ble.s:
+blt.s:
+bne.un.s:
+bge.un.s:
+bgt.un.s:
+ble.un.s:
+blt.un.s:
+br: len:8
+brfalse:
+brtrue:
+beq: len:8
+bge: len:8
+bgt: len:8
+ble: len:8
+blt: len:8
+bne.un: len:64
+bge.un: len:64
+bgt.un: len:64
+ble.un: len:64
+blt.un: len:64
+sparc_brz: src1:i len: 8
+sparc_brlez: src1:i len: 8
+sparc_brlz: src1:i len: 8
+sparc_brnz: src1:i len: 8
+sparc_brgz: src1:i len: 8
+sparc_brgez: src1:i len: 8
+sparc_cond_exc_eqz: src1:i len:64
+sparc_cond_exc_nez: src1:i len:64
+sparc_cond_exc_ltz: src1:i len:64
+sparc_cond_exc_gtz: src1:i len:64
+sparc_cond_exc_gez: src1:i len:64
+sparc_cond_exc_lez: src1:i len:64
+switch:
+ldind.i1: dest:i len:4
+ldind.u1: dest:i len:4
+ldind.i2: dest:i len:4
+ldind.u2: dest:i len:4
+ldind.i4: dest:i len:4
+ldind.u4: dest:i len:4
+ldind.i8:
+ldind.i: dest:i len:4
+ldind.r4:
+ldind.r8:
+ldind.ref: dest:i len:4
+stind.ref: src1:b src2:i
+stind.i1: src1:b src2:i
+stind.i2: src1:b src2:i
+stind.i4: src1:b src2:i
+stind.i8:
+stind.r4: src1:b src2:f
+stind.r8: src1:b src2:f
+add: dest:i src1:i src2:i len:64
+sub: dest:i src1:i src2:i len:4
+mul: dest:i src1:i src2:i len:4
+div: dest:i src1:i src2:i len:64
+div.un: dest:i src1:i src2:i len:8
+rem: dest:d src1:i src2:i len:64
+rem.un: dest:d src1:i src2:i len:64
+and: dest:i src1:i src2:i len:4
+or: dest:i src1:i src2:i len:4
+xor: dest:i src1:i src2:i len:4
+shl: dest:i src1:i src2:i len:4
+shr: dest:i src1:i src2:i len:4
+shr.un: dest:i src1:i src2:i len:4
+neg: dest:i src1:i len:4
+not: dest:i src1:i len:4
+conv.i1: dest:i src1:i len:8
+conv.i2: dest:i src1:i len:8
+conv.i4: dest:i src1:i len:4
+conv.i8: dest:i src1:i len:4
+conv.r4: dest:f src1:i len:64
+conv.r8: dest:f src1:i len:64
+conv.u4: dest:i src1:i len:
+conv.u8: dest:i src1:i len:4
+callvirt:
+cpobj:
+ldobj:
+ldstr:
+newobj:
+castclass:
+isinst:
+conv.r.un:
+unbox:
+throw: src1:i len:64
+op_rethrow: src1:i len:64
+ldfld:
+ldflda:
+stfld:
+ldsfld:
+ldsflda:
+stsfld:
+stobj:
+conv.ovf.i1.un:
+conv.ovf.i2.un:
+conv.ovf.i4.un:
+conv.ovf.i8.un:
+conv.ovf.u1.un:
+conv.ovf.u2.un:
+conv.ovf.u4.un:
+conv.ovf.u8.un:
+conv.ovf.i.un:
+conv.ovf.u.un:
+box:
+newarr:
+ldlen:
+ldelema:
+ldelem.i1:
+ldelem.u1:
+ldelem.i2:
+ldelem.u2:
+ldelem.i4:
+ldelem.u4:
+ldelem.i8:
+ldelem.i:
+ldelem.r4:
+ldelem.r8:
+ldelem.ref:
+stelem.i:
+stelem.i1:
+stelem.i2:
+stelem.i4:
+stelem.i8:
+stelem.r4:
+stelem.r8:
+stelem.ref:
+conv.ovf.i1:
+conv.ovf.u1:
+conv.ovf.i2:
+conv.ovf.u2:
+conv.ovf.i4:
+conv.ovf.u4: dest:i src1:i len:64
+conv.ovf.i8:
+conv.ovf.u8:
+refanyval:
+ckfinite: dest:f src1:f len:40
+mkrefany:
+ldtoken:
+conv.u2: dest:i src1:i len:8
+conv.u1: dest:i src1:i len:4
+conv.i: dest:i src1:i len:4
+conv.ovf.i:
+conv.ovf.u:
+add.ovf:
+add.ovf.un:
+mul.ovf: dest:i src1:i src2:i len:64
+mul.ovf.un: dest:i src1:i src2:i len:64
+sub.ovf:
+sub.ovf.un:
+start_handler: len:64
+endfinally: len:64
+endfilter: len:64
+leave:
+leave.s:
+stind.i:
+conv.u: dest:i src1:i len:4
+prefix7:
+prefix6:
+prefix5:
+prefix4:
+prefix3:
+prefix2:
+prefix1:
+prefixref:
+arglist: src1:i
+ceq: dest:i len:64
+cgt: dest:i len:64
+cgt.un: dest:i len:64
+clt: dest:i len:64
+clt.un: dest:i len:64
+ldftn:
+ldvirtftn:
+ldarg:
+ldarga:
+starg:
+ldloc:
+ldloca:
+stloc:
+localloc: dest:i src1:i len:64
+sparc_localloc_imm: dest:i len:64
+unaligned.:
+volatile.:
+tail.:
+initobj:
+cpblk:
+initblk:
+sizeof:
+refanytype:
+illegal:
+endmac:
+mono_objaddr:
+mono_ldptr:
+mono_vtaddr:
+mono_newobj:
+mono_retobj:
+load:
+ldaddr:
+store:
+phi:
+rename:
+compare: src1:i src2:i len:4
+icompare: src1:i src2:i len:4
+compare_imm: src1:i len:64
+icompare_imm: src1:i len:64
+fcompare: src1:f src2:f len:64
+lcompare: src1:i src2:i len:4
+local:
+arg:
+setfret: dest:f src1:f len:8
+outarg: src1:i len:1
+outarg_imm: len:5
+retarg:
+setret: dest:a src1:i len:4
+setlret: dest:l src1:i src2:i len:8
+setreg: dest:i src1:i len:4 clob:r
+setregimm: dest:i len:64 clob:r
+setfreg: dest:f src1:f len:4 clob:r
+sparc_setfreg_float: dest:f src1:f len:4 clob:r
+checkthis: src1:b len:4
+oparglist: src1:i len:64
+voidcall: len:64 clob:c
+voidcall_reg: src1:i len:64 clob:c
+voidcall_membase: src1:b len:64 clob:c
+fcall: dest:f len:64 clob:c
+fcall_reg: dest:f src1:i len:64 clob:c
+fcall_membase: dest:f src1:b len:64 clob:c
+lcall: dest:l len:42 clob:c
+lcall_reg: dest:l src1:i len:64 clob:c
+lcall_membase: dest:l src1:b len:64 clob:c
+vcall: len:40 clob:c
+vcall_reg: src1:i len:64 clob:c
+vcall_membase: src1:b len:64 clob:c
+call_reg: dest:i src1:i len:64 clob:c
+call_membase: dest:i src1:b len:64 clob:c
+trap:
+iconst: dest:i len:64
+i8const: dest:i len:64
+r4const: dest:f len:64
+r8const: dest:f len:64
+regvar:
+reg:
+regoffset:
+label:
+store_membase_imm: dest:b len:64
+store_membase_reg: dest:b src1:i len:64
+storei1_membase_imm: dest:b len:64
+storei1_membase_reg: dest:b src1:i len:64
+storei2_membase_imm: dest:b len:64
+storei2_membase_reg: dest:b src1:i len:64
+storei4_membase_imm: dest:b len:64
+storei4_membase_reg: dest:b src1:i len:64
+storei8_membase_imm: dest:b len:64 len:64
+storei8_membase_reg: dest:b src1:i len:64
+storer4_membase_reg: dest:b src1:f len:64
+storer8_membase_reg: dest:b src1:f len:64
+load_membase: dest:i src1:b len:64
+loadi1_membase: dest:i src1:b len:64
+loadu1_membase: dest:i src1:b len:64
+loadi2_membase: dest:i src1:b len:64
+loadu2_membase: dest:i src1:b len:64
+loadi4_membase: dest:i src1:b len:64
+loadu4_membase: dest:i src1:b len:64
+loadi8_membase: dest:i src1:b len:64
+loadr4_membase: dest:f src1:b len:64
+loadr8_membase: dest:f src1:b len:64
+loadu4_mem: dest:i len:8
+move: dest:i src1:i len:4
+add_imm: dest:i src1:i len:64
+addcc_imm: dest:i src1:i len:64
+sub_imm: dest:i src1:i len:64
+subcc_imm: dest:i src1:i len:64
+mul_imm: dest:i src1:i len:64
+div_imm: dest:a src1:i src2:i len:64
+div_un_imm: dest:a src1:i src2:i len:64
+rem_imm: dest:d src1:i src2:i len:64
+rem_un_imm: dest:d src1:i src2:i len:64
+and_imm: dest:i src1:i len:64
+or_imm: dest:i src1:i len:64
+xor_imm: dest:i src1:i len:64
+shl_imm: dest:i src1:i len:64
+shr_imm: dest:i src1:i len:64
+shr_un_imm: dest:i src1:i len:64
+cond_exc_eq: len:64
+cond_exc_ne_un: len:64
+cond_exc_lt: len:64
+cond_exc_lt_un: len:64
+cond_exc_gt: len:64
+cond_exc_gt_un: len:64
+cond_exc_ge: len:64
+cond_exc_ge_un: len:64
+cond_exc_le: len:64
+cond_exc_le_un: len:64
+cond_exc_ov: len:64
+cond_exc_no: len:64
+cond_exc_c: len:64
+cond_exc_nc: len:64
+long_add:
+long_sub:
+long_mul:
+long_div:
+long_div_un:
+long_rem:
+long_rem_un:
+long_and:
+long_or:
+long_xor:
+long_shl: dest:i src1:i src2:i len:64
+long_shr: dest:i src1:i src2:i len:64
+long_shr_un: dest:i src1:i src2:i len:64
+long_neg:
+long_not:
+long_conv_to_i1:
+long_conv_to_i2:
+long_conv_to_i4:
+long_conv_to_i8:
+long_conv_to_r4:
+long_conv_to_r8:
+long_conv_to_u4:
+long_conv_to_u8:
+long_conv_to_u2:
+long_conv_to_u1:
+long_conv_to_i:
+long_conv_to_ovf_i: dest:i src1:i src2:i len:44
+long_conv_to_ovf_u:
+long_add_ovf:
+long_add_ovf_un:
+long_mul_ovf:
+long_mul_ovf_un:
+long_sub_ovf:
+long_sub_ovf_un:
+long_conv_to_ovf_i1_un:
+long_conv_to_ovf_i2_un:
+long_conv_to_ovf_i4_un:
+long_conv_to_ovf_i8_un:
+long_conv_to_ovf_u1_un:
+long_conv_to_ovf_u2_un:
+long_conv_to_ovf_u4_un:
+long_conv_to_ovf_u8_un:
+long_conv_to_ovf_i_un:
+long_conv_to_ovf_u_un:
+long_conv_to_ovf_i1:
+long_conv_to_ovf_u1:
+long_conv_to_ovf_i2:
+long_conv_to_ovf_u2:
+long_conv_to_ovf_i4:
+long_conv_to_ovf_u4:
+long_conv_to_ovf_i8:
+long_conv_to_ovf_u8:
+long_ceq:
+long_cgt:
+long_cgt_un:
+long_clt:
+long_clt_un:
+long_conv_to_r_un: dest:f src1:i src2:i len:64
+long_conv_to_u:
+long_shr_imm: dest:i src1:i len:64
+long_shr_un_imm: dest:i src1:i len:64
+long_shl_imm: dest:i src1:i len:64
+long_add_imm:
+long_sub_imm:
+long_beq:
+long_bne_un:
+long_blt:
+long_blt_un:
+long_bgt:
+long_btg_un:
+long_bge:
+long_bge_un:
+long_ble:
+long_ble_un:
+float_beq: len:8
+float_bne_un: len:64
+float_blt: len:8
+float_blt_un: len:64
+float_bgt: len:8
+float_btg_un: len:64
+float_bge: len:64
+float_bge_un: len:64
+float_ble: len:64
+float_ble_un: len:64
+float_add: dest:f src1:f src2:f len:4
+float_sub: dest:f src1:f src2:f len:4
+float_mul: dest:f src1:f src2:f len:4
+float_div: dest:f src1:f src2:f len:4
+float_div_un: dest:f src1:f src2:f len:4
+float_rem: dest:f src1:f src2:f len:64
+float_rem_un: dest:f src1:f src2:f len:64
+float_neg: dest:f src1:f len:4
+float_not: dest:f src1:f len:4
+float_conv_to_i1: dest:i src1:f len:40
+float_conv_to_i2: dest:i src1:f len:40
+float_conv_to_i4: dest:i src1:f len:40
+float_conv_to_i8: dest:l src1:f len:40
+float_conv_to_r4: dest:f src1:f len:8
+float_conv_to_r8:
+float_conv_to_u4: dest:i src1:f len:40
+float_conv_to_u8: dest:l src1:f len:40
+float_conv_to_u2: dest:i src1:f len:40
+float_conv_to_u1: dest:i src1:f len:40
+float_conv_to_i: dest:i src1:f len:40
+float_conv_to_ovf_i:
+float_conv_to_ovd_u:
+float_add_ovf:
+float_add_ovf_un:
+float_mul_ovf:
+float_mul_ovf_un:
+float_sub_ovf:
+float_sub_ovf_un:
+float_conv_to_ovf_i1_un:
+float_conv_to_ovf_i2_un:
+float_conv_to_ovf_i4_un:
+float_conv_to_ovf_i8_un:
+float_conv_to_ovf_u1_un:
+float_conv_to_ovf_u2_un:
+float_conv_to_ovf_u4_un:
+float_conv_to_ovf_u8_un:
+float_conv_to_ovf_i_un:
+float_conv_to_ovf_u_un:
+float_conv_to_ovf_i1:
+float_conv_to_ovf_u1:
+float_conv_to_ovf_i2:
+float_conv_to_ovf_u2:
+float_conv_to_ovf_i4:
+float_conv_to_ovf_u4:
+float_conv_to_ovf_i8:
+float_conv_to_ovf_u8:
+float_ceq: dest:i src1:f src2:f len:64
+float_cgt: dest:i src1:f src2:f len:64
+float_cgt_un: dest:i src1:f src2:f len:64
+float_clt: dest:i src1:f src2:f len:64
+float_clt_un: dest:i src1:f src2:f len:64
+float_conv_to_u: dest:i src1:f len:64
+call_handler: len:64
+op_endfilter: src1:i len:64
+aot_const: dest:i len:64
+adc: dest:i src1:i src2:i len:4
+addcc: dest:i src1:i src2:i len:4
+subcc: dest:i src1:i src2:i len:4
+adc_imm: dest:i src1:i len:64
+sbb: dest:i src1:i src2:i len:4
+sbb_imm: dest:i src1:i len:64
+br_reg: src1:i len:8
+op_bigmul: len:2 dest:l src1:a src2:i
+op_bigmul_un: len:2 dest:l src1:a src2:i
+fmove: dest:f src1:f len:8
+
+# 32 bit opcodes
+int_add: dest:i src1:i src2:i len:64
+int_sub: dest:i src1:i src2:i len:64
+int_mul: dest:i src1:i src2:i len:64
+int_div: dest:i src1:i src2:i len:64
+int_div_un: dest:i src1:i src2:i len:64
+int_rem: dest:i src1:i src2:i len:64
+int_rem_un: dest:i src1:i src2:i len:64
+int_and: dest:i src1:i src2:i len:64
+int_or: dest:i src1:i src2:i len:64
+int_xor: dest:i src1:i src2:i len:64
+int_shl: dest:i src1:i src2:i len:64
+int_shr: dest:i src1:i src2:i len:64
+int_shr_un: dest:i src1:i src2:i len:64
+int_adc: dest:i src1:i src2:i len:64
+int_adc_imm: dest:i src1:i len:64
+int_sbb: dest:i src1:i src2:i len:64
+int_sbb_imm: dest:i src1:i len:64
+int_addcc: dest:i src1:i src2:i len:64
+int_subcc: dest:i src1:i src2:i len:64
+int_add_imm: dest:i src1:i len:64
+int_sub_imm: dest:i src1:i len:64
+int_mul_imm: dest:i src1:i len:64
+int_div_imm: dest:i src1:i len:64
+int_div_un_imm: dest:i src1:i len:64
+int_rem_imm: dest:i src1:i len:64
+int_rem_un_imm: dest:i src1:i len:64
+int_and_imm: dest:i src1:i len:64
+int_or_imm: dest:i src1:i len:64
+int_xor_imm: dest:i src1:i len:64
+int_shl_imm: dest:i src1:i len:64
+int_shr_imm: dest:i src1:i len:64
+int_shr_un_imm: dest:i src1:i len:64
+int_neg: dest:i src1:i len:64
+int_not: dest:i src1:i len:64
+int_ceq: dest:i len:64
+int_cgt: dest:i len:64
+int_cgt_un: dest:i len:64
+int_clt: dest:i len:64
+int_clt_un: dest:i len:64
+int_beq: len:64
+int_bne_un: len:64
+int_blt: len:64
+int_blt_un: len:64
+int_bgt: len:64
+int_bgt_un: len:64
+int_bge: len:64
+int_bge_un: len:64
+int_ble: len:64
+int_ble_un: len:64
+
diff --git a/mono/mini/debug-mini.c b/mono/mini/debug-mini.c
new file mode 100644
index 00000000000..a294caa1a12
--- /dev/null
+++ b/mono/mini/debug-mini.c
@@ -0,0 +1,541 @@
+/*
+ * debug-mini.c: Mini-specific debugging stuff.
+ *
+ * Author:
+ * Martin Baulig (martin@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+#include "mini.h"
+#include "jit.h"
+#include <mono/metadata/verify.h>
+#include <mono/metadata/mono-config.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/appdomain.h>
+/* mono-debug-debugger.h needs config.h to work... */
+#include "config.h"
+#include <mono/metadata/mono-debug-debugger.h>
+
+#ifdef HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
+
+static inline void
+record_line_number (MonoDebugMethodJitInfo *jit, guint32 address, guint32 offset)
+{
+ MonoDebugLineNumberEntry lne;
+
+ lne.address = address;
+ lne.offset = offset;
+
+ g_array_append_val (jit->line_numbers, lne);
+}
+
+typedef struct
+{
+ MonoDebugMethodJitInfo *jit;
+ guint32 has_line_numbers;
+ guint32 breakpoint_id;
+} MiniDebugMethodInfo;
+
+void
+mono_debug_init_method (MonoCompile *cfg, MonoBasicBlock *start_block, guint32 breakpoint_id)
+{
+ MonoMethod *method = cfg->method;
+ MiniDebugMethodInfo *info;
+
+ if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+ return;
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->flags & METHOD_ATTRIBUTE_ABSTRACT))
+ return;
+ if ((method->wrapper_type != MONO_WRAPPER_NONE) &&
+ (method->wrapper_type != MONO_WRAPPER_MANAGED_TO_NATIVE))
+ return;
+
+ info = g_new0 (MiniDebugMethodInfo, 1);
+ info->breakpoint_id = breakpoint_id;
+
+ cfg->debug_info = info;
+}
+
+void
+mono_debug_open_method (MonoCompile *cfg)
+{
+ MiniDebugMethodInfo *info;
+ MonoDebugMethodJitInfo *jit;
+ MonoMethodHeader *header;
+
+ info = (MiniDebugMethodInfo *) cfg->debug_info;
+ if (!info)
+ return;
+
+ mono_class_init (cfg->method->klass);
+
+ header = mono_method_get_header (cfg->method);
+ g_assert (header);
+
+ info->jit = jit = g_new0 (MonoDebugMethodJitInfo, 1);
+ jit->line_numbers = g_array_new (FALSE, TRUE, sizeof (MonoDebugLineNumberEntry));
+ jit->num_locals = header->num_locals;
+ jit->locals = g_new0 (MonoDebugVarInfo, jit->num_locals);
+}
+
+static void
+write_variable (MonoInst *inst, MonoDebugVarInfo *var)
+{
+ if (inst->opcode == OP_REGVAR)
+ var->index = inst->dreg | MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER;
+ else {
+ /* the debug interface needs fixing to allow 0(%base) address */
+ var->index = inst->inst_basereg | MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET;
+ var->offset = inst->inst_offset;
+ }
+}
+
+/*
+ * mono_debug_add_vg_method:
+ *
+ * Register symbol information for the method with valgrind
+ */
+static void
+mono_debug_add_vg_method (MonoMethod *method, MonoDebugMethodJitInfo *jit)
+{
+#ifdef VALGRIND_ADD_LINE_INFO
+ MonoMethodHeader *header;
+ int i;
+ char *filename = NULL;
+ guint32 address, line_number;
+ const char *full_name;
+ guint32 *addresses;
+ guint32 *lines;
+
+ if (!RUNNING_ON_VALGRIND)
+ return;
+
+ header = mono_method_get_header (method);
+
+ full_name = mono_method_full_name (method, TRUE);
+
+ addresses = g_new0 (guint32, header->code_size + 1);
+ lines = g_new0 (guint32, header->code_size + 1);
+
+ /*
+ * Very simple code to convert the addr->offset mappings that mono has
+ * into [addr-addr] ->line number mappings.
+ */
+
+ /* Create offset->line number mapping */
+ for (i = 0; i < header->code_size; ++i) {
+ char *fname;
+
+ fname = mono_debug_source_location_from_il_offset (method, i, &lines [i]);
+ if (!filename)
+ filename = fname;
+ }
+
+ /* Create address->offset mapping */
+ for (i = 0; i < jit->line_numbers->len; ++i) {
+ MonoDebugLineNumberEntry *lne = &g_array_index (jit->line_numbers, MonoDebugLineNumberEntry, i);
+
+ g_assert (lne->offset <= header->code_size);
+
+ if ((addresses [lne->offset] == 0) || (lne->address < addresses [lne->offset]))
+ addresses [lne->offset] = lne->address;
+ }
+ /* Fill out missing addresses */
+ address = 0;
+ for (i = 0; i < header->code_size; ++i) {
+ if (addresses [i] == 0)
+ addresses [i] = address;
+ else
+ address = addresses [i];
+ }
+
+ address = 0;
+ line_number = 0;
+ i = 0;
+ while (i < header->code_size) {
+ if (lines [i] == line_number)
+ i ++;
+ else {
+ if (line_number > 0) {
+ //g_assert (addresses [i] - 1 >= address);
+
+ if (addresses [i] - 1 >= address) {
+ VALGRIND_ADD_LINE_INFO (jit->code_start + address, jit->code_start + addresses [i] - 1, filename, line_number);
+ //printf ("[%d-%d] -> %d.\n", address, addresses [i] - 1, line_number);
+ }
+ }
+ address = addresses [i];
+ line_number = lines [i];
+ }
+ }
+
+ if (line_number > 0) {
+ VALGRIND_ADD_LINE_INFO (jit->code_start + address, jit->code_start + jit->code_size - 1, filename, line_number);
+ //printf ("[%d-%d] -> %d.\n", address, jit->code_size - 1, line_number);
+ }
+
+ VALGRIND_ADD_SYMBOL (jit->code_start, jit->code_size, full_name);
+
+ g_free (addresses);
+ g_free (lines);
+#endif /* VALGRIND_ADD_LINE_INFO */
+}
+
+void
+mono_debug_close_method (MonoCompile *cfg)
+{
+ MiniDebugMethodInfo *info;
+ MonoDebugMethodJitInfo *jit;
+ MonoMethodHeader *header;
+ MonoMethod *method;
+ int i;
+
+ info = (MiniDebugMethodInfo *) cfg->debug_info;
+ if (!info || !info->jit)
+ return;
+
+ method = cfg->method;
+ header = mono_method_get_header (method);
+
+ jit = info->jit;
+ jit->code_start = cfg->native_code;
+ jit->epilogue_begin = cfg->epilog_begin;
+ jit->code_size = cfg->code_len;
+
+ record_line_number (jit, jit->epilogue_begin, header->code_size);
+
+ jit->num_params = method->signature->param_count;
+ jit->params = g_new0 (MonoDebugVarInfo, jit->num_params);
+
+ for (i = 0; i < jit->num_locals; i++)
+ write_variable (cfg->varinfo [cfg->locals_start + i], &jit->locals [i]);
+
+ if (method->signature->hasthis) {
+ jit->this_var = g_new0 (MonoDebugVarInfo, 1);
+ write_variable (cfg->varinfo [0], jit->this_var);
+ }
+
+ for (i = 0; i < jit->num_params; i++)
+ write_variable (cfg->varinfo [i + method->signature->hasthis], &jit->params [i]);
+
+ mono_debug_add_method (method, jit, cfg->domain);
+
+ mono_debug_add_vg_method (method, jit);
+
+ if (info->breakpoint_id)
+ mono_debugger_breakpoint_callback (method, info->breakpoint_id);
+}
+
+void
+mono_debug_record_line_number (MonoCompile *cfg, MonoInst *ins, guint32 address)
+{
+ MiniDebugMethodInfo *info;
+ MonoMethodHeader *header;
+ guint32 offset;
+
+ info = (MiniDebugMethodInfo *) cfg->debug_info;
+ if (!info || !info->jit || !ins->cil_code)
+ return;
+
+ header = mono_method_get_header (cfg->method);
+ g_assert (header);
+
+ if ((ins->cil_code < header->code) ||
+ (ins->cil_code > header->code + header->code_size))
+ return;
+
+ offset = ins->cil_code - header->code;
+ if (!info->has_line_numbers) {
+ info->jit->prologue_end = address;
+ info->has_line_numbers = TRUE;
+ }
+
+ record_line_number (info->jit, address, offset);
+}
+
+static inline void
+encode_value (gint32 value, char *buf, char **endbuf)
+{
+ char *p = buf;
+
+ //printf ("ENCODE: %d 0x%x.\n", value, value);
+
+ /*
+ * Same encoding as the one used in the metadata, extended to handle values
+ * greater than 0x1fffffff.
+ */
+ if ((value >= 0) && (value <= 127))
+ *p++ = value;
+ else if ((value >= 0) && (value <= 16384)) {
+ p [0] = 0x80 | (value >> 8);
+ p [1] = value & 0xff;
+ p += 2;
+ } else if ((value >= 0) && (value <= 0x1fffffff)) {
+ p [0] = (value >> 24) | 0xc0;
+ p [1] = (value >> 16) & 0xff;
+ p [2] = (value >> 8) & 0xff;
+ p [3] = value & 0xff;
+ p += 4;
+ }
+ else {
+ p [0] = 0xff;
+ p [1] = (value >> 24) & 0xff;
+ p [2] = (value >> 16) & 0xff;
+ p [3] = (value >> 8) & 0xff;
+ p [4] = value & 0xff;
+ p += 5;
+ }
+ if (endbuf)
+ *endbuf = p;
+}
+
+static inline gint32
+decode_value (char *_ptr, char **rptr)
+{
+ unsigned char *ptr = (unsigned char *) _ptr;
+ unsigned char b = *ptr;
+ gint32 len;
+
+ if ((b & 0x80) == 0){
+ len = b;
+ ++ptr;
+ } else if ((b & 0x40) == 0){
+ len = ((b & 0x3f) << 8 | ptr [1]);
+ ptr += 2;
+ } else if (b != 0xff) {
+ len = ((b & 0x1f) << 24) |
+ (ptr [1] << 16) |
+ (ptr [2] << 8) |
+ ptr [3];
+ ptr += 4;
+ }
+ else {
+ len = (ptr [1] << 24) | (ptr [2] << 16) | (ptr [3] << 8) | ptr [4];
+ ptr += 5;
+ }
+ if (rptr)
+ *rptr = ptr;
+
+ //printf ("DECODE: %d.\n", len);
+ return len;
+}
+
+static void
+serialize_variable (MonoDebugVarInfo *var, char *p, char **endbuf)
+{
+ guint32 flags = var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+
+ switch (flags) {
+ case MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER:
+ encode_value (var->index, p, &p);
+ break;
+ case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET:
+ encode_value (var->index, p, &p);
+ encode_value (var->offset, p, &p);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ *endbuf = p;
+}
+
+void
+mono_debug_serialize_debug_info (MonoCompile *cfg,
+ guint8 **out_buf, guint32 *buf_len)
+{
+ MiniDebugMethodInfo *info;
+ MonoDebugMethodJitInfo *jit;
+ guint32 size, prev_offset, prev_native_offset;
+ char *buf;
+ char *p;
+ int i;
+
+ info = (MiniDebugMethodInfo *) cfg->debug_info;
+ if (!info || !info->jit) {
+ *buf_len = 0;
+ return;
+ }
+ jit = info->jit;
+
+ size = ((jit->num_params + jit->num_locals + 1) * 10) + (jit->line_numbers->len * 10) + 64;
+ p = buf = g_malloc (size);
+ encode_value (jit->epilogue_begin, p, &p);
+ encode_value (jit->prologue_end, p, &p);
+ encode_value (jit->code_size, p, &p);
+
+ for (i = 0; i < jit->num_params; ++i)
+ serialize_variable (&jit->params [i], p, &p);
+
+ if (cfg->method->signature->hasthis)
+ serialize_variable (jit->this_var, p, &p);
+
+ for (i = 0; i < jit->num_locals; i++)
+ serialize_variable (&jit->locals [i], p, &p);
+
+ encode_value (jit->line_numbers->len, p, &p);
+
+ prev_offset = 0;
+ prev_native_offset = 0;
+ for (i = 0; i < jit->line_numbers->len; ++i) {
+ /* Sometimes, the offset values are not in increasing order */
+ MonoDebugLineNumberEntry *lne = &g_array_index (jit->line_numbers,
+ MonoDebugLineNumberEntry,
+ i);
+ encode_value (lne->offset - prev_offset, p, &p);
+ encode_value (lne->address - prev_native_offset, p, &p);
+ prev_offset = lne->offset;
+ prev_native_offset = lne->address;
+ }
+
+ g_assert (p - buf < size);
+
+ *out_buf = buf;
+ *buf_len = p - buf;
+}
+
+static void
+deserialize_variable (MonoDebugVarInfo *var, char *p, char **endbuf)
+{
+ guint32 flags;
+
+ var->index = decode_value (p, &p);
+
+ flags = var->index & MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS;
+
+ switch (flags) {
+ case MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER:
+ break;
+ case MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET:
+ var->offset = decode_value (p, &p);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ *endbuf = p;
+}
+
+static MonoDebugMethodJitInfo *
+deserialize_debug_info (MonoMethod *method,
+ guint8 *code_start,
+ guint8 *buf, guint32 buf_len)
+{
+ MonoMethodHeader *header;
+ MonoDebugMethodJitInfo *jit;
+ gint32 offset, native_offset, prev_offset, prev_native_offset, len;
+ char *p;
+ int i;
+
+ header = mono_method_get_header (method);
+ g_assert (header);
+
+ jit = g_new0 (MonoDebugMethodJitInfo, 1);
+ jit->code_start = code_start;
+ jit->line_numbers = g_array_new (FALSE, TRUE, sizeof (MonoDebugLineNumberEntry));
+ jit->num_locals = header->num_locals;
+ jit->locals = g_new0 (MonoDebugVarInfo, jit->num_locals);
+ jit->num_params = method->signature->param_count;
+ jit->params = g_new0 (MonoDebugVarInfo, jit->num_params);
+
+ p = buf;
+ jit->epilogue_begin = decode_value (p, &p);
+ jit->prologue_end = decode_value (p, &p);
+ jit->code_size = decode_value (p, &p);
+
+ for (i = 0; i < jit->num_params; ++i)
+ deserialize_variable (&jit->params [i], p, &p);
+
+ if (method->signature->hasthis) {
+ jit->this_var = g_new0 (MonoDebugVarInfo, 1);
+ deserialize_variable (jit->this_var, p, &p);
+ }
+
+ for (i = 0; i < jit->num_locals; i++)
+ deserialize_variable (&jit->locals [i], p, &p);
+
+ len = decode_value (p, &p);
+
+ prev_offset = 0;
+ prev_native_offset = 0;
+ for (i = 0; i < len; ++i) {
+ offset = prev_offset + decode_value (p, &p);
+ native_offset = prev_native_offset + decode_value (p, &p);
+ record_line_number (jit, native_offset, offset);
+ prev_offset = offset;
+ prev_native_offset = native_offset;
+ }
+
+ return jit;
+}
+
+void
+mono_debug_add_aot_method (MonoDomain *domain,
+ MonoMethod *method, guint8 *code_start,
+ guint8 *debug_info, guint32 debug_info_len)
+{
+ MonoDebugMethodJitInfo *jit;
+
+ if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+ return;
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->flags & METHOD_ATTRIBUTE_ABSTRACT) ||
+ (method->wrapper_type != MONO_WRAPPER_NONE))
+ return;
+
+ if (debug_info_len == 0)
+ return;
+
+ jit = deserialize_debug_info (method, code_start,
+ debug_info,
+ debug_info_len);
+
+ mono_debug_add_method (method, jit, domain);
+
+ mono_debug_add_vg_method (method, jit);
+}
+
+MonoDomain *
+mono_init_debugger (const char *file, const char *opt_flags)
+{
+ MonoDomain *domain;
+ const guchar *error;
+ int opt;
+
+ g_set_prgname (file);
+
+ opt = mono_parse_default_optimizations (opt_flags);
+ opt |= MONO_OPT_SHARED;
+
+ mono_set_defaults (0, opt);
+
+ domain = mono_jit_init (file);
+
+ mono_config_parse (NULL);
+
+ error = mono_check_corlib_version ();
+ if (error) {
+ fprintf (stderr, "Corlib not in sync with this runtime: %s\n", error);
+ fprintf (stderr, "Download a newer corlib or a newer runtime at http://www.go-mono.com/daily.\n");
+ exit (1);
+ }
+
+ return domain;
+}
+
+void
+mono_debug_add_icall_wrapper (MonoMethod *method, MonoJitICallInfo* callinfo)
+{
+ if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
+ return;
+
+ mono_debug_add_wrapper (method, callinfo->func, mono_get_root_domain ());
+}
diff --git a/mono/mini/dominators.c b/mono/mini/dominators.c
new file mode 100644
index 00000000000..e8df3c2c136
--- /dev/null
+++ b/mono/mini/dominators.c
@@ -0,0 +1,521 @@
+/*
+ * dominators.c: Dominator computation on the control flow graph
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include <string.h>
+#include <mono/metadata/debug-helpers.h>
+
+#include "mini.h"
+
+//#define DEBUG_DOMINATORS
+
+/* the simpler, dumber algorithm */
+static void
+compute_dominators (MonoCompile *m) {
+ int change = TRUE;
+ int i, j, bitsize;
+ MonoBasicBlock *bb;
+ MonoBitSet *T;
+ char* mem;
+
+ g_assert (!(m->comp_done & MONO_COMP_DOM));
+
+ bitsize = mono_bitset_alloc_size (m->num_bblocks, 0);
+ /* the first is always the entry */
+ bb = m->bblocks [0];
+ mem = mono_mempool_alloc0 (m->mempool, bitsize * (m->num_bblocks + 1));
+ bb->dominators = mono_bitset_mem_new (mem, m->num_bblocks, 0);
+
+ mem += bitsize;
+ mono_bitset_set (bb->dominators, 0);
+
+ T = mono_bitset_mem_new (mem, m->num_bblocks, 0);
+ mem += bitsize;
+
+
+ for (i = 1; i < m->num_bblocks; ++i) {
+ bb = m->bblocks [i];
+ bb->dominators = mono_bitset_mem_new (mem, m->num_bblocks, 0);
+ mem += bitsize;
+ mono_bitset_invert (bb->dominators);
+
+#ifdef DEBUG_DOMINATORS
+ printf ("BB%d IN: ", bb->block_num);
+ for (j = 0; j < bb->in_count; ++j)
+ printf ("%d ", bb->in_bb [j]->block_num);
+ printf ("\n");
+#endif
+ }
+
+ do {
+ change = FALSE;
+ for (i = 1; i < m->num_bblocks; ++i) {
+ bb = m->bblocks [i];
+ mono_bitset_set_all (T);
+ for (j = 0; j < bb->in_count; ++j) {
+ if (bb->in_bb [j]->dominators)
+ mono_bitset_intersection (T, bb->in_bb [j]->dominators);
+ }
+ mono_bitset_set (T, i);
+ if (!mono_bitset_equal (T, bb->dominators)) {
+ change = TRUE;
+ mono_bitset_copyto (T, bb->dominators);
+ }
+ }
+ } while (change);
+
+ m->comp_done |= MONO_COMP_DOM;
+
+#ifdef DEBUG_DOMINATORS
+ printf ("DTREE %s %d\n", mono_method_full_name (m->method, TRUE),
+ mono_method_get_header (m->method)->num_clauses);
+ for (i = 0; i < m->num_bblocks; ++i) {
+ bb = m->bblocks [i];
+ printf ("BB%d: ", bb->block_num);
+ mono_blockset_print (m, bb->dominators, NULL, -1);
+ }
+#endif
+}
+
+static void
+compute_idominators (MonoCompile* m) {
+ char *mem;
+ int bitsize, i, s, t;
+ MonoBitSet **T, *temp;
+ MonoBasicBlock *bb;
+
+ g_assert (!(m->comp_done & MONO_COMP_IDOM));
+
+ bitsize = mono_bitset_alloc_size (m->num_bblocks, 0);
+ mem = mono_mempool_alloc (m->mempool, bitsize * (m->num_bblocks + 1));
+ T = mono_mempool_alloc (m->mempool, sizeof (MonoBitSet*) * m->num_bblocks);
+
+ for (i = 0; i < m->num_bblocks; ++i) {
+ bb = m->bblocks [i];
+ T [i] = mono_bitset_mem_new (mem, m->num_bblocks, 0);
+ mono_bitset_copyto (bb->dominators, T [i]);
+ mono_bitset_clear (T [i], i);
+ if (mono_bitset_count (bb->dominators) - 1 != mono_bitset_count (T [i])) {
+ mono_blockset_print (m, bb->dominators, "dominators", -1);
+ mono_blockset_print (m, T [i], "T [i]", -1);
+ g_error ("problem at %d (%d)\n", i, bb->dfn);
+ }
+ mem += bitsize;
+ }
+ temp = mono_bitset_mem_new (mem, m->num_bblocks, 0);
+
+ for (i = 1; i < m->num_bblocks; ++i) {
+
+ temp = T [i];
+
+ mono_bitset_foreach_bit_rev (temp, s, m->num_bblocks) {
+
+ mono_bitset_foreach_bit_rev (temp, t, m->num_bblocks) {
+
+ if (t == s)
+ continue;
+
+ //if (mono_bitset_test_fast (T [s], t))
+ if (mono_bitset_test_fast (m->bblocks [s]->dominators, t))
+ mono_bitset_clear (temp, t);
+ }
+ }
+
+#ifdef DEBUG_DOMINATORS
+ printf ("IDOMSET BB%d %d: ", m->bblocks [i]->block_num, m->num_bblocks);
+ mono_blockset_print (m, T [i], NULL, -1);
+#endif
+ }
+
+ for (i = 1; i < m->num_bblocks; ++i) {
+ bb = m->bblocks [i];
+ s = mono_bitset_find_start (T [i]);
+ g_assert (s != -1);
+ /*fixme:mono_bitset_count does not really work */
+ //g_assert (mono_bitset_count (T [i]) == 1);
+ t = mono_bitset_find_first (T [i], s);
+ g_assert (t == -1 || t >= m->num_bblocks);
+ bb->idom = m->bblocks [s];
+ bb->idom->dominated = g_list_prepend (bb->idom->dominated, bb);
+ }
+
+ m->comp_done |= MONO_COMP_IDOM;
+}
+
+static void
+postorder_visit (MonoBasicBlock *start, int *idx, MonoBasicBlock **array)
+{
+ int i;
+
+ /* we assume the flag was already cleared by the caller. */
+ start->flags |= BB_VISITED;
+ /*g_print ("visit %d at %p\n", *dfn, start->cil_code);*/
+ for (i = 0; i < start->out_count; ++i) {
+ if (start->out_bb [i]->flags & BB_VISITED)
+ continue;
+ postorder_visit (start->out_bb [i], idx, array);
+ }
+ array [*idx] = start;
+ (*idx)++;
+}
+
+static void
+check_dominance_frontier (MonoBasicBlock *x, MonoBasicBlock *t)
+{
+ int i, j;
+
+ t->flags |= BB_VISITED;
+
+ if (mono_bitset_test_fast (t->dominators, x->dfn)) {
+ for (i = 0; i < t->out_count; ++i) {
+ if (!(t->flags & BB_VISITED)) {
+ int found = FALSE;
+ check_dominance_frontier (x, t->out_bb [i]);
+
+ for (j = 0; j < t->out_bb [i]->in_count; j++) {
+ if (t->out_bb [i]->in_bb [j] == t)
+ found = TRUE;
+ }
+ g_assert (found);
+ }
+ }
+ } else {
+ if (!mono_bitset_test_fast (x->dfrontier, t->dfn)) {
+ printf ("BB%d not in frontier of BB%d\n", t->block_num, x->block_num);
+ g_assert_not_reached ();
+ }
+ }
+}
+
+#if 0
+/* there is a bug in this code */
+static void
+compute_dominance_frontier_old (MonoCompile *m) {
+ int i, j, bitsize;
+ MonoBasicBlock **postorder;
+ MonoBasicBlock *bb, *z;
+ char *mem;
+
+ g_assert (!(m->comp_done & MONO_COMP_DFRONTIER));
+
+ postorder = mono_mempool_alloc (m->mempool, sizeof (MonoBasicBlock*) * m->num_bblocks);
+ i = 0;
+ postorder_visit (m->bb_entry, &i, postorder);
+ /*g_print ("postorder traversal:");
+ for (i = 0; i < m->num_bblocks; ++i)
+ g_print (" B%d", postorder [i]->dfn);
+ g_print ("\n");*/
+
+ /* we could reuse the bitsets allocated in compute_idominators() */
+ bitsize = mono_bitset_alloc_size (m->num_bblocks, 0);
+ mem = mono_mempool_alloc0 (m->mempool, bitsize * m->num_bblocks);
+
+ for (i = 0; i < m->num_bblocks; ++i) {
+ bb = postorder [i];
+ bb->dfrontier = mono_bitset_mem_new (mem, m->num_bblocks, 0);
+ mem += bitsize;
+ }
+ for (i = 0; i < m->num_bblocks; ++i) {
+ bb = postorder [i];
+ /* the local component */
+ for (j = 0; j < bb->out_count; ++j) {
+ //if (bb->out_bb [j] != bb->idom)
+ if (bb->out_bb [j]->idom != bb)
+ mono_bitset_set (bb->dfrontier, bb->out_bb [j]->dfn);
+ }
+ }
+ for (i = 0; i < m->num_bblocks; ++i) {
+ bb = postorder [i];
+ /* the up component */
+ if (bb->idom) {
+ z = bb->idom;
+ mono_bitset_foreach_bit (z->dfrontier, j, m->num_bblocks) {
+ //if (m->bblocks [j] != bb->idom)
+ if (m->bblocks [j]->idom != bb)
+ mono_bitset_set (bb->dfrontier, m->bblocks [j]->dfn);
+ }
+ }
+ }
+
+ /* this is a check for the dominator frontier */
+ for (i = 0; i < m->num_bblocks; ++i) {
+ MonoBasicBlock *x = m->bblocks [i];
+
+ mono_bitset_foreach_bit ((x->dfrontier), j, (m->num_bblocks)) {
+ MonoBasicBlock *w = m->bblocks [j];
+ int k;
+ /* x must not strictly dominates w */
+ if (mono_bitset_test_fast (w->dominators, x->dfn) && w != x)
+ g_assert_not_reached ();
+
+ for (k = 0; k < m->num_bblocks; ++k)
+ m->bblocks [k]->flags &= ~BB_VISITED;
+
+ check_dominance_frontier (x, x);
+ }
+ }
+
+ m->comp_done |= MONO_COMP_DFRONTIER;
+}
+#endif
+
+/* this is an implementation of the dominance frontier algorithm described in
+ * "modern compiler implementation in C" written by Andrew W. Appel
+ */
+static void
+compute_dominance_frontier_appel (MonoCompile *m, int n)
+{
+ int i, j;
+ MonoBasicBlock *bb;
+
+ bb = m->bblocks [n];
+ g_assert (!(bb->flags & BB_VISITED));
+ bb->flags |= BB_VISITED;
+
+ for (i = 0; i < bb->out_count; ++i) {
+ MonoBasicBlock *y = bb->out_bb [i];
+ if (y->idom != bb) {
+ g_assert (!(mono_bitset_test_fast (y->dominators, bb->dfn) && bb->dfn != y->dfn));
+ mono_bitset_set (bb->dfrontier, y->dfn);
+ }
+ }
+
+
+ for (i = 0; i < m->num_bblocks; ++i) {
+ MonoBasicBlock *c = m->bblocks [i];
+ if (c->idom == bb) {
+ if (!(c->flags & BB_VISITED))
+ compute_dominance_frontier_appel (m, c->dfn);
+ mono_bitset_foreach_bit (c->dfrontier, j, m->num_bblocks) {
+ MonoBasicBlock *w = m->bblocks [j];
+ if (!(mono_bitset_test_fast (w->dominators, bb->dfn) && bb->dfn != w->dfn))
+ mono_bitset_set (bb->dfrontier, w->dfn);
+ }
+ }
+ }
+}
+
+static void
+compute_dominance_frontier (MonoCompile *m)
+{
+ MonoBasicBlock *bb;
+ char *mem;
+ int i, j, bitsize;
+
+ g_assert (!(m->comp_done & MONO_COMP_DFRONTIER));
+
+ for (i = 0; i < m->num_bblocks; ++i)
+ m->bblocks [i]->flags &= ~BB_VISITED;
+
+ /* we could reuse the bitsets allocated in compute_idominators() */
+ bitsize = mono_bitset_alloc_size (m->num_bblocks, 0);
+ mem = mono_mempool_alloc0 (m->mempool, bitsize * m->num_bblocks);
+
+ for (i = 0; i < m->num_bblocks; ++i) {
+ bb = m->bblocks [i];
+ bb->dfrontier = mono_bitset_mem_new (mem, m->num_bblocks, 0);
+ mem += bitsize;
+ }
+
+ compute_dominance_frontier_appel (m, 0);
+
+#if 0
+ for (i = 0; i < m->num_bblocks; ++i) {
+ MonoBasicBlock *x = m->bblocks [i];
+
+ printf ("DFRONT %s BB%d: ", mono_method_full_name (m->method, TRUE), x->block_num);
+ mono_blockset_print (m, x->dfrontier, NULL, -1);
+ }
+#endif
+
+#if 1
+ /* this is a check for the dominator frontier */
+ for (i = 0; i < m->num_bblocks; ++i) {
+ MonoBasicBlock *x = m->bblocks [i];
+
+ mono_bitset_foreach_bit ((x->dfrontier), j, (m->num_bblocks)) {
+ MonoBasicBlock *w = m->bblocks [j];
+ int k;
+ /* x must not strictly dominates w */
+ if (mono_bitset_test_fast (w->dominators, x->dfn) && w != x)
+ g_assert_not_reached ();
+
+ for (k = 0; k < m->num_bblocks; ++k)
+ m->bblocks [k]->flags &= ~BB_VISITED;
+
+ check_dominance_frontier (x, x);
+ }
+ }
+#endif
+
+ m->comp_done |= MONO_COMP_DFRONTIER;
+}
+
+void
+mono_compile_dominator_info (MonoCompile *cfg, int dom_flags)
+{
+ if ((dom_flags & MONO_COMP_DOM) && !(cfg->comp_done & MONO_COMP_DOM))
+ compute_dominators (cfg);
+ if ((dom_flags & MONO_COMP_IDOM) && !(cfg->comp_done & MONO_COMP_IDOM))
+ compute_idominators (cfg);
+ if ((dom_flags & MONO_COMP_DFRONTIER) && !(cfg->comp_done & MONO_COMP_DFRONTIER))
+ compute_dominance_frontier (cfg);
+}
+
+static void
+df_set (MonoCompile *m, MonoBitSet* dest, MonoBitSet *set)
+{
+ int i;
+
+ mono_bitset_clear_all (dest);
+ mono_bitset_foreach_bit (set, i, m->num_bblocks) {
+ mono_bitset_union (dest, m->bblocks [i]->dfrontier);
+ }
+}
+
+/* TODO: alloc tmp and D on the stack */
+MonoBitSet*
+mono_compile_iterated_dfrontier (MonoCompile *m, MonoBitSet *set)
+{
+ MonoBitSet *result, *D;
+ int bitsize, change = TRUE;
+
+ bitsize = mono_bitset_alloc_size (m->num_bblocks, 0);
+ result = mono_bitset_mem_new (mono_mempool_alloc (m->mempool, bitsize), m->num_bblocks, 0);
+ D = mono_bitset_mem_new (mono_mempool_alloc (m->mempool, bitsize), m->num_bblocks, 0);
+
+ df_set (m, result, set);
+ do {
+ change = FALSE;
+ df_set (m, D, result);
+ mono_bitset_union (D, result);
+
+ if (!mono_bitset_equal (D, result)) {
+ mono_bitset_copyto (D, result);
+ change = TRUE;
+ }
+ } while (change);
+
+ return result;
+}
+
+//#define DEBUG_NATURAL_LOOPS
+
+/*
+ * code to detect loops and loop nesting level
+ */
+void
+mono_compute_natural_loops (MonoCompile *cfg)
+{
+ int i, j, k;
+
+ g_assert (!(cfg->comp_done & MONO_COMP_LOOPS));
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ MonoBasicBlock *n = cfg->bblocks [i];
+
+ for (j = 0; j < n->out_count; j++) {
+ MonoBasicBlock *h = n->out_bb [j];
+ /* check for back-edge from n to h */
+ if (n != h && mono_bitset_test (n->dominators, h->dfn)) {
+ GList *todo;
+
+ n->loop_body_start = 1;
+
+ /* already in loop_blocks? */
+ if (h->loop_blocks && g_list_find (h->loop_blocks, n))
+ continue;
+
+ todo = g_list_prepend (NULL, n);
+
+ while (todo) {
+ MonoBasicBlock *cb = (MonoBasicBlock *)todo->data;
+ todo = g_list_delete_link (todo, todo);
+
+ if (g_list_find (h->loop_blocks, cb))
+ continue;
+
+ h->loop_blocks = g_list_prepend (h->loop_blocks, cb);
+ cb->nesting++;
+
+ for (k = 0; k < cb->in_count; k++) {
+ MonoBasicBlock *prev = cb->in_bb [k];
+ /* add all previous blocks */
+ if (prev != h && !g_list_find (h->loop_blocks, prev)) {
+ todo = g_list_prepend (todo, prev);
+ }
+ }
+ }
+
+ /* add the header if not already there */
+ if (!g_list_find (h->loop_blocks, h)) {
+ h->loop_blocks = g_list_prepend (h->loop_blocks, h);
+ h->nesting++;
+ }
+ }
+ }
+ }
+
+ cfg->comp_done |= MONO_COMP_LOOPS;
+
+#ifdef DEBUG_NATURAL_LOOPS
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ if (cfg->bblocks [i]->loop_blocks) {
+ MonoBasicBlock *h = (MonoBasicBlock *)cfg->bblocks [i]->loop_blocks->data;
+ GList *l;
+ printf ("LOOP START %d\n", h->block_num);
+ for (l = h->loop_blocks; l; l = l->next) {
+ MonoBasicBlock *cb = (MonoBasicBlock *)l->data;
+ printf (" BB%d %d %p\n", cb->block_num, cb->nesting, cb->loop_blocks);
+ }
+ }
+ }
+#endif
+
+}
+
+static void
+clear_idominators (MonoCompile *cfg)
+{
+ guint i;
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ if (cfg->bblocks[i]->dominated) {
+ g_list_free (cfg->bblocks[i]->dominated);
+ cfg->bblocks[i]->dominated = NULL;
+ }
+ }
+
+ cfg->comp_done &= ~MONO_COMP_IDOM;
+}
+
+static void
+clear_loops (MonoCompile *cfg)
+{
+ guint i;
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ cfg->bblocks[i]->nesting = 0;
+ if (cfg->bblocks[i]->loop_blocks) {
+ g_list_free (cfg->bblocks[i]->loop_blocks);
+ cfg->bblocks[i]->loop_blocks = NULL;
+ }
+ }
+
+ cfg->comp_done &= ~MONO_COMP_LOOPS;
+}
+
+void
+mono_free_loop_info (MonoCompile *cfg)
+{
+ if (cfg->comp_done & MONO_COMP_IDOM)
+ clear_idominators (cfg);
+ if (cfg->comp_done & MONO_COMP_LOOPS)
+ clear_loops (cfg);
+}
+
diff --git a/mono/mini/driver.c b/mono/mini/driver.c
new file mode 100644
index 00000000000..e07095aac46
--- /dev/null
+++ b/mono/mini/driver.c
@@ -0,0 +1,962 @@
+/*
+ * driver.c: The new mono JIT compiler.
+ *
+ * Author:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2002-2003 Ximian, Inc.
+ * (C) 2003-2004 Novell, Inc.
+ */
+
+#include <config.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/loader.h>
+#include <mono/metadata/cil-coff.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/class.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/opcodes.h>
+#include <mono/metadata/mono-endian.h>
+#include <mono/metadata/tokentype.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/socket-io.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/io-layer/io-layer.h>
+#include "mono/metadata/profiler.h"
+#include <mono/metadata/profiler-private.h>
+#include <mono/metadata/mono-config.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/verify.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
+#include <mono/os/gc_wrapper.h>
+
+#include "mini.h"
+#include "jit.h"
+#include <string.h>
+#include <ctype.h>
+#include "inssel.h"
+#include <locale.h>
+
+static FILE *mini_stats_fd = NULL;
+
+static void mini_usage (void);
+
+typedef void (*OptFunc) (const char *p);
+
+/* keep in sync with enum in mini.h */
+typedef struct {
+ const char* name;
+ const char* desc;
+ const OptFunc func;
+} OptName;
+
+static const OptName
+opt_names [] = {
+ {"peephole", "Peephole postpass"},
+ {"branch", "Branch optimizations"},
+ {"inline", "Inline method calls"},
+ {"cfold", "Constant folding"},
+ {"consprop", "Constant propagation"},
+ {"copyprop", "Copy propagation"},
+ {"deadce", "Dead code elimination"},
+ {"linears", "Linear scan global reg allocation"},
+ {"cmov", "Conditional moves"},
+ {"shared", "Emit per-domain code"},
+ {"sched", "Instruction scheduling"},
+ {"intrins", "Intrinsic method implementations"},
+ {"tailc", "Tail recursion and tail calls"},
+ {"loop", "Loop related optimizations"},
+ {"fcmov", "Fast x86 FP compares"},
+ {"leaf", "Leaf procedures optimizations"},
+ {"aot", "Usage of Ahead Of Time compiled code"},
+ {"precomp", "Precompile all methods before executing Main"},
+ {"abcrem", "Array bound checks removal"}
+};
+
+#define DEFAULT_OPTIMIZATIONS ( \
+ MONO_OPT_PEEPHOLE | \
+ MONO_OPT_CFOLD | \
+ MONO_OPT_BRANCH | \
+ MONO_OPT_LINEARS | \
+ MONO_OPT_INTRINS | \
+ MONO_OPT_LOOP | \
+ MONO_OPT_AOT)
+
+#define EXCLUDED_FROM_ALL (MONO_OPT_SHARED | MONO_OPT_PRECOMP)
+
+static guint32
+parse_optimizations (const char* p)
+{
+ /* the default value */
+ guint32 opt = DEFAULT_OPTIMIZATIONS;
+ guint32 exclude = 0;
+ const char *n;
+ int i, invert, len;
+
+ /* call out to cpu detection code here that sets the defaults ... */
+ opt |= mono_arch_cpu_optimizazions (&exclude);
+ opt &= ~exclude;
+ if (!p)
+ return opt;
+
+ while (*p) {
+ if (*p == '-') {
+ p++;
+ invert = TRUE;
+ } else {
+ invert = FALSE;
+ }
+ for (i = 0; i < G_N_ELEMENTS (opt_names); ++i) {
+ n = opt_names [i].name;
+ len = strlen (n);
+ if (strncmp (p, n, len) == 0) {
+ if (invert)
+ opt &= ~ (1 << i);
+ else
+ opt |= 1 << i;
+ p += len;
+ if (*p == ',') {
+ p++;
+ break;
+ } else if (*p == '=') {
+ p++;
+ if (opt_names [i].func)
+ opt_names [i].func (p);
+ while (*p && *p++ != ',');
+ break;
+ }
+ /* error out */
+ break;
+ }
+ }
+ if (i == G_N_ELEMENTS (opt_names)) {
+ if (strncmp (p, "all", 3) == 0) {
+ if (invert)
+ opt = 0;
+ else
+ opt = ~(EXCLUDED_FROM_ALL | exclude);
+ p += 3;
+ if (*p == ',')
+ p++;
+ } else {
+ fprintf (stderr, "Invalid optimization name `%s'\n", p);
+ exit (1);
+ }
+ }
+ }
+ return opt;
+}
+
+typedef struct {
+ const char* name;
+ const char* desc;
+ MonoGraphOptions value;
+} GraphName;
+
+static const GraphName
+graph_names [] = {
+ {"cfg", "Control Flow Graph (CFG)" , MONO_GRAPH_CFG},
+ {"dtree", "Dominator Tree", MONO_GRAPH_DTREE},
+ {"code", "CFG showing code", MONO_GRAPH_CFG_CODE},
+ {"ssa", "CFG showing code after SSA translation", MONO_GRAPH_CFG_SSA},
+ {"optcode", "CFG showing code after IR optimizations", MONO_GRAPH_CFG_OPTCODE}
+};
+
+static MonoGraphOptions
+mono_parse_graph_options (const char* p)
+{
+ const char *n;
+ int i, len;
+
+ for (i = 0; i < G_N_ELEMENTS (graph_names); ++i) {
+ n = graph_names [i].name;
+ len = strlen (n);
+ if (strncmp (p, n, len) == 0)
+ return graph_names [i].value;
+ }
+
+ fprintf (stderr, "Invalid graph name provided: %s\n", p);
+ exit (1);
+}
+
+int
+mono_parse_default_optimizations (const char* p)
+{
+ guint32 opt;
+
+ opt = parse_optimizations (p);
+ return opt;
+}
+
+static char*
+opt_descr (guint32 flags) {
+ GString *str = g_string_new ("");
+ int i, need_comma;
+
+ need_comma = 0;
+ for (i = 0; i < G_N_ELEMENTS (opt_names); ++i) {
+ if (flags & (1 << i)) {
+ if (need_comma)
+ g_string_append_c (str, ',');
+ g_string_append (str, opt_names [i].name);
+ need_comma = 1;
+ }
+ }
+ return g_string_free (str, FALSE);
+}
+
+static const guint32
+opt_sets [] = {
+ 0,
+ MONO_OPT_PEEPHOLE,
+ MONO_OPT_BRANCH,
+ MONO_OPT_CFOLD,
+ MONO_OPT_FCMOV,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_INTRINS,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_CFOLD,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_ABCREM,
+ MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_ABCREM | MONO_OPT_SHARED
+};
+
+typedef int (*TestMethod) (void);
+
+#if 0
+static void
+domain_dump_native_code (MonoDomain *domain) {
+ // need to poke into the domain, move to metadata/domain.c
+ // need to empty jit_info_table and code_mp
+}
+#endif
+
+static int
+mini_regression (MonoImage *image, int verbose, int *total_run) {
+ guint32 i, opt, opt_flags;
+ MonoMethod *method;
+ MonoCompile *cfg;
+ char *n;
+ int result, expected, failed, cfailed, run, code_size, total;
+ TestMethod func;
+ GTimer *timer = g_timer_new ();
+
+ if (mini_stats_fd) {
+ fprintf (mini_stats_fd, "$stattitle = \'Mono Benchmark Results (various optimizations)\';\n");
+
+ fprintf (mini_stats_fd, "$graph->set_legend(qw(");
+ for (opt = 0; opt < G_N_ELEMENTS (opt_sets); opt++) {
+ opt_flags = opt_sets [opt];
+ n = opt_descr (opt_flags);
+ if (!n [0])
+ n = (char *)"none";
+ if (opt)
+ fprintf (mini_stats_fd, " ");
+ fprintf (mini_stats_fd, "%s", n);
+
+
+ }
+ fprintf (mini_stats_fd, "));\n");
+
+ fprintf (mini_stats_fd, "@data = (\n");
+ fprintf (mini_stats_fd, "[");
+ }
+
+ /* load the metadata */
+ for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
+ mono_class_init (method->klass);
+
+ if (!strncmp (method->name, "test_", 5) && mini_stats_fd) {
+ fprintf (mini_stats_fd, "\"%s\",", method->name);
+ }
+ }
+ if (mini_stats_fd)
+ fprintf (mini_stats_fd, "],\n");
+
+
+ total = 0;
+ *total_run = 0;
+ for (opt = 0; opt < G_N_ELEMENTS (opt_sets); ++opt) {
+ double elapsed, comp_time, start_time;
+ MonoJitInfo *jinfo;
+
+ opt_flags = opt_sets [opt];
+ mono_set_defaults (verbose, opt_flags);
+ n = opt_descr (opt_flags);
+ g_print ("Test run: image=%s, opts=%s\n", mono_image_get_filename (image), n);
+ g_free (n);
+ cfailed = failed = run = code_size = 0;
+ comp_time = elapsed = 0.0;
+
+ /* fixme: ugly hack - delete all previously compiled methods */
+ for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
+ method->info = NULL;
+ }
+
+ g_timer_start (timer);
+ if (mini_stats_fd)
+ fprintf (mini_stats_fd, "[");
+ for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
+ if (strncmp (method->name, "test_", 5) == 0) {
+ expected = atoi (method->name + 5);
+ run++;
+ start_time = g_timer_elapsed (timer, NULL);
+ comp_time -= start_time;
+ cfg = mini_method_compile (method, opt_flags, mono_get_root_domain (), TRUE, 0);
+ comp_time += g_timer_elapsed (timer, NULL);
+ if (cfg) {
+ if (verbose >= 2)
+ g_print ("Running '%s' ...\n", method->name);
+#ifdef MONO_USE_AOT_COMPILER
+ if ((jinfo = mono_aot_get_method (mono_get_root_domain (), method)))
+ func = jinfo->code_start;
+ else
+#endif
+ func = (TestMethod)cfg->native_code;
+ result = func ();
+ if (result != expected) {
+ failed++;
+ if (verbose)
+ g_print ("Test '%s' failed result (got %d, expected %d).\n", method->name, result, expected);
+ }
+ code_size += cfg->code_len;
+ mono_destroy_compile (cfg);
+
+ } else {
+ cfailed++;
+ if (verbose)
+ g_print ("Test '%s' failed compilation.\n", method->name);
+ }
+ if (mini_stats_fd)
+ fprintf (mini_stats_fd, "%f, ",
+ g_timer_elapsed (timer, NULL) - start_time);
+ }
+ }
+ if (mini_stats_fd)
+ fprintf (mini_stats_fd, "],\n");
+ g_timer_stop (timer);
+ elapsed = g_timer_elapsed (timer, NULL);
+ g_print ("Results: total tests: %d, failed: %d, cfailed: %d (pass: %.2f%%)\n",
+ run, failed, cfailed, 100.0*(run-failed-cfailed)/run);
+ g_print ("Elapsed time: %f secs (%f, %f), Code size: %d\n\n", elapsed,
+ elapsed - comp_time, comp_time, code_size);
+ total += failed + cfailed;
+ *total_run += run;
+ }
+
+ if (mini_stats_fd) {
+ fprintf (mini_stats_fd, ");\n");
+ fflush (mini_stats_fd);
+ }
+
+ g_timer_destroy (timer);
+ return total;
+}
+
+static int
+mini_regression_list (int verbose, int count, char *images [])
+{
+ int i, total, total_run, run;
+ MonoAssembly *ass;
+
+ total_run = total = 0;
+ for (i = 0; i < count; ++i) {
+ ass = mono_assembly_open (images [i], NULL);
+ if (!ass) {
+ g_warning ("failed to load assembly: %s", images [i]);
+ continue;
+ }
+ total += mini_regression (mono_assembly_get_image (ass), verbose, &run);
+ total_run += run;
+ }
+ g_print ("Overall results: tests: %d, failed: %d, opt combinations: %d (pass: %.2f%%)\n",
+ total_run, total, (int)G_N_ELEMENTS (opt_sets), 100.0*(total_run-total)/total_run);
+ return total;
+}
+
+enum {
+ DO_BENCH,
+ DO_REGRESSION,
+ DO_COMPILE,
+ DO_EXEC,
+ DO_DRAW
+};
+
+typedef struct CompileAllThreadArgs {
+ MonoAssembly *ass;
+ int verbose;
+} CompileAllThreadArgs;
+
+static void
+compile_all_methods_thread_main (CompileAllThreadArgs *args)
+{
+ MonoAssembly *ass = args->ass;
+ int verbose = args->verbose;
+ MonoImage *image = mono_assembly_get_image (ass);
+ MonoMethod *method;
+ int i, count = 0;
+
+ for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
+ if (method->flags & METHOD_ATTRIBUTE_ABSTRACT)
+ continue;
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
+ continue;
+
+ count++;
+ if (verbose) {
+ char * desc = mono_method_full_name (method, TRUE);
+ g_print ("Compiling %d %s\n", count, desc);
+ g_free (desc);
+ }
+ mono_compile_method (method);
+ }
+
+}
+
+static void
+compile_all_methods (MonoAssembly *ass, int verbose)
+{
+ CompileAllThreadArgs args;
+
+ args.ass = ass;
+ args.verbose = verbose;
+
+ /*
+ * Need to create a mono thread since compilation might trigger
+ * running of managed code.
+ */
+ mono_thread_create (mono_domain_get (), compile_all_methods_thread_main, &args);
+
+ mono_thread_manage ();
+}
+
+/**
+ * mono_jit_exec:
+ * @assembly: reference to an assembly
+ * @argc: argument count
+ * @argv: argument vector
+ *
+ * Start execution of a program.
+ */
+int
+mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[])
+{
+ MonoImage *image = mono_assembly_get_image (assembly);
+ MonoMethod *method;
+ guint32 entry = mono_image_get_entry_point (image);
+
+ if (!entry) {
+ g_print ("Assembly '%s' doesn't have an entry point.\n", mono_image_get_filename (image));
+ /* FIXME: remove this silly requirement. */
+ mono_environment_exitcode_set (1);
+ return 1;
+ }
+
+ method = mono_get_method (image, entry, NULL);
+
+ return mono_runtime_run_main (method, argc, argv, NULL);
+}
+
+typedef struct
+{
+ MonoDomain *domain;
+ const char *file;
+ int argc;
+ char **argv;
+ guint32 opts;
+ char *aot_options;
+} MainThreadArgs;
+
+static void main_thread_handler (gpointer user_data)
+{
+ MainThreadArgs *main_args = user_data;
+ MonoAssembly *assembly;
+
+ assembly = mono_domain_assembly_open (main_args->domain, main_args->file);
+ if (!assembly){
+ fprintf (stderr, "Can not open image %s\n", main_args->file);
+ exit (1);
+ }
+
+ if (mono_compile_aot) {
+ int res = mono_compile_assembly (assembly, main_args->opts, main_args->aot_options);
+ printf ("AOT RESULT %d\n", res);
+ } else {
+ /*
+ * This must be done in a thread managed by mono since it can invoke
+ * managed code.
+ */
+ if (main_args->opts & MONO_OPT_PRECOMP)
+ mono_precompile_assemblies ();
+
+ mono_jit_exec (main_args->domain, assembly, main_args->argc, main_args->argv);
+ }
+}
+
+static void
+mini_usage (void)
+{
+ int i;
+
+ fprintf (stdout,
+ "Usage is: mono [options] assembly\n\n"
+ "Runtime and JIT debugging:\n"
+ " --compile METHOD Just compile METHOD in assembly\n"
+ " --ncompile N Number of times to compile METHOD (default: 1)\n"
+ " --regression Runs the regression test contained in the assembly\n"
+ " --print-vtable Print the vtable of all used classes\n"
+ " --trace[=EXPR] Enable tracing, use --help-trace for details\n"
+ " --compile-all Compiles all the methods in the assembly\n"
+ " --breakonex Inserts a breakpoint on exceptions\n"
+ " --break METHOD Inserts a breakpoint at METHOD entry\n"
+ " --debug Enable debugging support\n"
+ " --stats Print statistics about the JIT operations\n"
+ "\n"
+ "Development:\n"
+ " --statfile FILE Sets the stat file to FILE\n"
+ " --aot Compiles the assembly to native code\n"
+ " --profile[=profiler] Runs in profiling mode with the specified profiler module\n"
+ " --graph[=TYPE] METHOD Draws a graph of the specified method:\n");
+
+ for (i = 0; i < G_N_ELEMENTS (graph_names); ++i) {
+ fprintf (stdout, " %-10s %s\n", graph_names [i].name, graph_names [i].desc);
+ }
+
+ fprintf (stdout,
+ "\n"
+ "Runtime:\n"
+ " --config FILE Loads FILE as the Mono config\n"
+ " --verbose, -v Increases the verbosity level\n"
+ " --help, -h Show usage information\n"
+ " --version, -V Show version information\n"
+ " --optimize=OPT Turns on a specific optimization:\n");
+
+ for (i = 0; i < G_N_ELEMENTS (opt_names); ++i)
+ fprintf (stdout, " %-10s %s\n", opt_names [i].name, opt_names [i].desc);
+}
+
+static void
+mini_trace_usage (void)
+{
+ fprintf (stdout,
+ "Tracing options:\n"
+ " --trace[=EXPR] Trace every call, optional EXPR controls the scope\n"
+ "\n"
+ "EXPR is composed of:\n"
+ " all All assemblies\n"
+ " none No assemblies\n"
+ " program Entry point assembly\n"
+ " assembly Specifies an assembly\n"
+ " M:Type:Method Specifies a method\n"
+ " N:Namespace Specifies a namespace\n"
+ " T:Type Specifies a type\n"
+ " +EXPR Includes expression\n"
+ " -EXPR Excludes expression\n");
+}
+
+static const char *info = ""
+#ifdef HAVE_KW_THREAD
+ "\tTLS: __thread\n"
+#else
+ "\tTLS: normal\n"
+#endif /* HAVE_KW_THREAD */
+#ifdef HAVE_BOEHM_GC
+#ifdef USE_INCLUDED_LIBGC
+ "\tGC: Included Boehm (with typed GC)\n"
+#else
+#if HAVE_GC_GCJ_MALLOC
+ "\tGC: System Boehm (with typed GC)\n"
+#else
+ "\tGC: System Boehm (no typed GC available)\n"
+#endif
+#endif
+#else
+ "\tGC: none\n"
+#endif /* HAVE_BOEHM_GC */
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ "\tSIGSEGV : altstack\n"
+#else
+ "\tSIGSEGV : normal\n"
+#endif
+#ifdef HAVE_ICU
+ "\tGlobalization: ICU\n"
+#else
+ "\tGlobalization: none\n"
+#endif /* HAVE_ICU */
+ "";
+
+int
+mono_main (int argc, char* argv[])
+{
+ MainThreadArgs main_args;
+ MonoAssembly *assembly;
+ MonoMethodDesc *desc;
+ MonoMethod *method;
+ MonoCompile *cfg;
+ MonoDomain *domain;
+ const char* aname, *mname = NULL;
+ char *config_file = NULL;
+ int i, count = 1;
+ int enable_debugging = FALSE;
+ guint32 opt, action = DO_EXEC;
+ MonoGraphOptions mono_graph_options = 0;
+ int mini_verbose = 0;
+ gboolean enable_profile = FALSE;
+ char *trace_options = NULL;
+ char *profile_options = NULL;
+ char *aot_options = NULL;
+
+ setlocale (LC_ALL, "");
+
+ g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
+ g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
+
+ opt = parse_optimizations (NULL);
+
+ for (i = 1; i < argc; ++i) {
+ if (argv [i] [0] != '-')
+ break;
+ if (strcmp (argv [i], "--regression") == 0) {
+ action = DO_REGRESSION;
+ } else if (strcmp (argv [i], "--verbose") == 0 || strcmp (argv [i], "-v") == 0) {
+ mini_verbose++;
+ } else if (strcmp (argv [i], "--version") == 0 || strcmp (argv [i], "-V") == 0) {
+ g_print ("Mono JIT compiler version %s, (C) 2002-2004 Novell, Inc and Contributors. www.go-mono.com\n", VERSION);
+ g_print (info);
+ if (mini_verbose) {
+ const guchar *cerror;
+ const guchar *clibpath;
+ mono_init ("mono");
+ cerror = mono_check_corlib_version ();
+ clibpath = mono_defaults.corlib? mono_image_get_filename (mono_defaults.corlib): "unknown";
+ if (cerror) {
+ g_print ("The currently installed mscorlib doesn't match this runtime version.\n");
+ g_print ("The error is: %s\n", cerror);
+ g_print ("mscorlib.dll loaded at: %s\n", clibpath);
+ return 1;
+ }
+ }
+ return 0;
+ } else if (strcmp (argv [i], "--help") == 0 || strcmp (argv [i], "-h") == 0) {
+ mini_usage ();
+ return 0;
+ } else if (strcmp (argv [i], "--help-trace") == 0){
+ mini_trace_usage ();
+ return 0;
+ } else if (strncmp (argv [i], "--statfile", 10) == 0) {
+ mini_stats_fd = fopen (argv [++i], "w+");
+ } else if (strncmp (argv [i], "--optimize=", 11) == 0) {
+ opt = parse_optimizations (argv [i] + 11);
+ } else if (strncmp (argv [i], "-O=", 3) == 0) {
+ opt = parse_optimizations (argv [i] + 3);
+ } else if (strcmp (argv [i], "--config") == 0) {
+ config_file = argv [++i];
+ } else if (strcmp (argv [i], "--ncompile") == 0) {
+ count = atoi (argv [++i]);
+ action = DO_BENCH;
+ } else if (strcmp (argv [i], "--trace") == 0) {
+ trace_options = (char*)"";
+ } else if (strncmp (argv [i], "--trace=", 8) == 0) {
+ trace_options = &argv [i][8];
+ } else if (strcmp (argv [i], "--breakonex") == 0) {
+ mono_break_on_exc = TRUE;
+ } else if (strcmp (argv [i], "--break") == 0) {
+ if (!mono_debugger_insert_breakpoint (argv [++i], FALSE))
+ g_error ("Invalid method name '%s'", argv [i]);
+ } else if (strcmp (argv [i], "--print-vtable") == 0) {
+ mono_print_vtable = TRUE;
+ } else if (strcmp (argv [i], "--stats") == 0) {
+ mono_stats.enabled = TRUE;
+ mono_jit_stats.enabled = TRUE;
+ } else if (strcmp (argv [i], "--aot") == 0) {
+ mono_compile_aot = TRUE;
+ } else if (strncmp (argv [i], "--aot=", 6) == 0) {
+ mono_compile_aot = TRUE;
+ aot_options = &argv [i][6];
+ } else if (strcmp (argv [i], "--compile-all") == 0) {
+ action = DO_COMPILE;
+ } else if (strcmp (argv [i], "--profile") == 0) {
+ enable_profile = TRUE;
+ profile_options = NULL;
+ } else if (strncmp (argv [i], "--profile=", 10) == 0) {
+ enable_profile = TRUE;
+ profile_options = argv [i] + 10;
+ } else if (strcmp (argv [i], "--compile") == 0) {
+ mname = argv [++i];
+ action = DO_BENCH;
+ } else if (strncmp (argv [i], "--graph=", 8) == 0) {
+ mono_graph_options = mono_parse_graph_options (argv [i] + 8);
+ mname = argv [++i];
+ action = DO_DRAW;
+ } else if (strcmp (argv [i], "--graph") == 0) {
+ mname = argv [++i];
+ mono_graph_options = MONO_GRAPH_CFG;
+ action = DO_DRAW;
+ } else if (strcmp (argv [i], "--debug") == 0) {
+ enable_debugging = TRUE;
+ } else {
+ fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
+ return 1;
+ }
+ }
+
+ if (!argv [i]) {
+ mini_usage ();
+ return 1;
+ }
+
+ if (mono_compile_aot || action == DO_EXEC) {
+ g_set_prgname (argv[i]);
+ }
+
+ if (enable_profile) {
+ /* Needed because of TLS accesses in mono_profiler_load () */
+ MONO_GC_PRE_INIT ();
+ mono_profiler_load (profile_options);
+ }
+
+ if (trace_options != NULL){
+ /*
+ * Need to call this before mini_init () so we can trace methods
+ * compiled there too.
+ */
+ mono_jit_trace_calls = mono_trace_parse_options (trace_options);
+ if (mono_jit_trace_calls == NULL)
+ exit (1);
+ }
+
+ mono_set_defaults (mini_verbose, opt);
+ domain = mini_init (argv [i]);
+
+ switch (action) {
+ case DO_REGRESSION:
+ if (mini_regression_list (mini_verbose, argc -i, argv + i)) {
+ g_print ("Regression ERRORS!\n");
+ mini_cleanup (domain);
+ return 1;
+ }
+ mini_cleanup (domain);
+ return 0;
+ case DO_BENCH:
+ if (argc - i != 1 || mname == NULL) {
+ g_print ("Usage: mini --ncompile num --compile method assembly\n");
+ mini_cleanup (domain);
+ return 1;
+ }
+ aname = argv [i];
+ break;
+ case DO_COMPILE:
+ if (argc - i != 1) {
+ mini_usage ();
+ mini_cleanup (domain);
+ return 1;
+ }
+ aname = argv [i];
+ break;
+ case DO_DRAW:
+ if (argc - i != 1 || mname == NULL) {
+ mini_usage ();
+ mini_cleanup (domain);
+ return 1;
+ }
+ aname = argv [i];
+ break;
+ default:
+ if (argc - i < 1) {
+ mini_usage ();
+ mini_cleanup (domain);
+ return 1;
+ }
+ aname = argv [i];
+ break;
+ }
+
+ if (enable_debugging) {
+ mono_debug_init (MONO_DEBUG_FORMAT_MONO);
+ mono_debug_init_1 (domain);
+ }
+
+ /* Parse gac loading options before loading assemblies. */
+ if (mono_compile_aot || action == DO_EXEC) {
+ mono_config_parse (config_file);
+ }
+
+ assembly = mono_assembly_open (aname, NULL);
+ if (!assembly) {
+ fprintf (stderr, "cannot open assembly %s\n", aname);
+ mini_cleanup (domain);
+ return 2;
+ }
+
+ if (trace_options != NULL)
+ mono_trace_set_assembly (assembly);
+
+ if (enable_debugging)
+ mono_debug_init_2 (assembly);
+
+ if (mono_compile_aot || action == DO_EXEC) {
+ const guchar *error;
+
+ //mono_set_rootdir ();
+
+ error = mono_check_corlib_version ();
+ if (error) {
+ fprintf (stderr, "Corlib not in sync with this runtime: %s\n", error);
+ fprintf (stderr, "Download a newer corlib or a newer runtime at http://www.go-mono.com/daily.\n");
+ exit (1);
+ }
+
+ main_args.domain = domain;
+ main_args.file = aname;
+ main_args.argc = argc - i;
+ main_args.argv = argv + i;
+ main_args.opts = opt;
+ main_args.aot_options = aot_options;
+
+ mono_runtime_exec_managed_code (domain, main_thread_handler, &main_args);
+ mini_cleanup (domain);
+
+ /* Look up return value from System.Environment.ExitCode */
+ i = mono_environment_exitcode_get ();
+ return i;
+ } else if (action == DO_COMPILE) {
+ compile_all_methods (assembly, mini_verbose);
+ mini_cleanup (domain);
+ return 0;
+ }
+ desc = mono_method_desc_new (mname, 0);
+ if (!desc) {
+ g_print ("Invalid method name %s\n", mname);
+ mini_cleanup (domain);
+ return 3;
+ }
+ method = mono_method_desc_search_in_image (desc, mono_assembly_get_image (assembly));
+ if (!method) {
+ g_print ("Cannot find method %s\n", mname);
+ mini_cleanup (domain);
+ return 3;
+ }
+
+ if (action == DO_DRAW) {
+ int part = 0;
+
+ switch (mono_graph_options) {
+ case MONO_GRAPH_DTREE:
+ part = 1;
+ opt |= MONO_OPT_LOOP;
+ break;
+ case MONO_GRAPH_CFG_CODE:
+ part = 1;
+ break;
+ case MONO_GRAPH_CFG_SSA:
+ part = 2;
+ break;
+ case MONO_GRAPH_CFG_OPTCODE:
+ part = 3;
+ break;
+ default:
+ break;
+ }
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
+ MonoMethod *nm;
+ nm = mono_marshal_get_native_wrapper (method);
+ cfg = mini_method_compile (nm, opt, mono_get_root_domain (), FALSE, part);
+ }
+ else
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, part);
+ if ((mono_graph_options & MONO_GRAPH_CFG_SSA) && !(cfg->comp_done & MONO_COMP_SSA)) {
+ g_warning ("no SSA info available (use -O=deadce)");
+ return 1;
+ }
+ mono_draw_graph (cfg, mono_graph_options);
+ mono_destroy_compile (cfg);
+
+ } else if (action == DO_BENCH) {
+ if (mini_stats_fd) {
+ const char *n;
+ double no_opt_time = 0.0;
+ GTimer *timer = g_timer_new ();
+ fprintf (mini_stats_fd, "$stattitle = \'Compilations times for %s\';\n",
+ mono_method_full_name (method, TRUE));
+ fprintf (mini_stats_fd, "@data = (\n");
+ fprintf (mini_stats_fd, "[");
+ for (i = 0; i < G_N_ELEMENTS (opt_sets); i++) {
+ opt = opt_sets [i];
+ n = opt_descr (opt);
+ if (!n [0])
+ n = "none";
+ fprintf (mini_stats_fd, "\"%s\",", n);
+ }
+ fprintf (mini_stats_fd, "],\n[");
+
+ for (i = 0; i < G_N_ELEMENTS (opt_sets); i++) {
+ int j;
+ double elapsed;
+ opt = opt_sets [i];
+ g_timer_start (timer);
+ for (j = 0; j < count; ++j) {
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, 0);
+ mono_destroy_compile (cfg);
+ }
+ g_timer_stop (timer);
+ elapsed = g_timer_elapsed (timer, NULL);
+ if (!opt)
+ no_opt_time = elapsed;
+ fprintf (mini_stats_fd, "%f, ", elapsed);
+ }
+ fprintf (mini_stats_fd, "]");
+ if (no_opt_time > 0.0) {
+ fprintf (mini_stats_fd, ", \n[");
+ for (i = 0; i < G_N_ELEMENTS (opt_sets); i++)
+ fprintf (mini_stats_fd, "%f,", no_opt_time);
+ fprintf (mini_stats_fd, "]");
+ }
+ fprintf (mini_stats_fd, ");\n");
+ } else {
+ for (i = 0; i < count; ++i) {
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
+ method = mono_marshal_get_native_wrapper (method);
+
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, 0);
+ mono_destroy_compile (cfg);
+ }
+ }
+ } else {
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), FALSE, 0);
+ mono_destroy_compile (cfg);
+ }
+
+ mini_cleanup (domain);
+ return 0;
+}
+
+MonoDomain *
+mono_jit_init (const char *file)
+{
+ return mini_init (file);
+}
+
+void
+mono_jit_cleanup (MonoDomain *domain)
+{
+ mini_cleanup (domain);
+}
+
+
diff --git a/mono/mini/emullong.brg b/mono/mini/emullong.brg
new file mode 100644
index 00000000000..fe65083e86b
--- /dev/null
+++ b/mono/mini/emullong.brg
@@ -0,0 +1,86 @@
+%%
+
+#
+# emullong.brg: emulate 64 bit instructions with 32bit instructions
+#
+# we dont use this, its just a prototype!
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+lreg: OP_I8CONST {
+ MonoInst *inst;
+
+ MONO_INST_NEW (s, inst, OP_ICONST);
+ inst->dreg = state->reg1;
+ inst->inst_c0 = tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, inst);
+
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->reg2;
+ tree->inst_c0 = tree->inst_c1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: CEE_CONV_I8 (OP_ICONST) {
+ MonoInst *inst;
+
+ inst = state->left->tree;
+ inst->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, inst);
+
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->reg2;
+
+ if (inst->inst_c0 >= 0)
+ tree->inst_c0 = 0;
+ else
+ tree->inst_c0 = -1;
+
+ mono_bblock_add_inst (s->cbb, inst);
+}
+
+lreg: CEE_CONV_U8 (OP_ICONST) {
+ MonoInst *inst;
+
+ inst = state->left->tree;
+ inst->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, inst);
+
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->reg2;
+ tree->inst_c0 = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: CEE_CONV_U8 (reg) {
+ MonoInst *inst;
+
+ if (state->reg1 != state->left->reg1) {
+ MONO_INST_NEW (s, inst, OP_MOVE);
+ inst->dreg = state->reg1;
+ inst->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, inst);
+ }
+
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->reg2;
+ tree->inst_c0 = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: CONV_OVF_I8_UN (OP_ICONST) {
+ state->left->tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, state->left->tree);
+
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->reg2;
+ tree->inst_c0 = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+
+%%
diff --git a/mono/mini/exceptions-amd64.c b/mono/mini/exceptions-amd64.c
new file mode 100644
index 00000000000..1359595427c
--- /dev/null
+++ b/mono/mini/exceptions-amd64.c
@@ -0,0 +1,621 @@
+/*
+ * exceptions-amd64.c: exception support for AMD64
+ *
+ * Authors:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/ucontext.h>
+
+#include <mono/arch/amd64/amd64-codegen.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/mono-debug.h>
+
+#include "mini.h"
+#include "mini-amd64.h"
+
+#define ALIGN_TO(val,align) (((val) + ((align) - 1)) & ~((align) - 1))
+
+#ifdef PLATFORM_WIN32
+static MonoW32ExceptionHandler fpe_handler;
+static MonoW32ExceptionHandler ill_handler;
+static MonoW32ExceptionHandler segv_handler;
+
+static LPTOP_LEVEL_EXCEPTION_FILTER old_handler;
+
+#define W32_SEH_HANDLE_EX(_ex) \
+ if (_ex##_handler) _ex##_handler((int)sctx)
+
+/*
+ * Unhandled Exception Filter
+ * Top-level per-process exception handler.
+ */
+LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep)
+{
+ EXCEPTION_RECORD* er;
+ CONTEXT* ctx;
+ MonoContext* sctx;
+ LONG res;
+
+ res = EXCEPTION_CONTINUE_EXECUTION;
+
+ er = ep->ExceptionRecord;
+ ctx = ep->ContextRecord;
+ sctx = g_malloc(sizeof(MonoContext));
+
+ /* Copy Win32 context to UNIX style context */
+ sctx->eax = ctx->Eax;
+ sctx->ebx = ctx->Ebx;
+ sctx->ecx = ctx->Ecx;
+ sctx->edx = ctx->Edx;
+ sctx->ebp = ctx->Ebp;
+ sctx->esp = ctx->Esp;
+ sctx->esi = ctx->Esi;
+ sctx->edi = ctx->Edi;
+ sctx->eip = ctx->Eip;
+
+ switch (er->ExceptionCode) {
+ case EXCEPTION_ACCESS_VIOLATION:
+ W32_SEH_HANDLE_EX(segv);
+ break;
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ W32_SEH_HANDLE_EX(ill);
+ break;
+ case EXCEPTION_INT_DIVIDE_BY_ZERO:
+ case EXCEPTION_INT_OVERFLOW:
+ case EXCEPTION_FLT_DIVIDE_BY_ZERO:
+ case EXCEPTION_FLT_OVERFLOW:
+ case EXCEPTION_FLT_UNDERFLOW:
+ case EXCEPTION_FLT_INEXACT_RESULT:
+ W32_SEH_HANDLE_EX(fpe);
+ break;
+ default:
+ break;
+ }
+
+ /* Copy context back */
+ ctx->Eax = sctx->eax;
+ ctx->Ebx = sctx->ebx;
+ ctx->Ecx = sctx->ecx;
+ ctx->Edx = sctx->edx;
+ ctx->Ebp = sctx->ebp;
+ ctx->Esp = sctx->esp;
+ ctx->Esi = sctx->esi;
+ ctx->Edi = sctx->edi;
+ ctx->Eip = sctx->eip;
+
+ return res;
+}
+
+void win32_seh_init()
+{
+ old_handler = SetUnhandledExceptionFilter(seh_handler);
+}
+
+void win32_seh_cleanup()
+{
+ if (old_handler) SetUnhandledExceptionFilter(old_handler);
+}
+
+void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler)
+{
+ switch (type) {
+ case SIGFPE:
+ fpe_handler = handler;
+ break;
+ case SIGILL:
+ ill_handler = handler;
+ break;
+ case SIGSEGV:
+ segv_handler = handler;
+ break;
+ default:
+ break;
+ }
+}
+
+#endif /* PLATFORM_WIN32 */
+
+/*
+ * Can't allocate the helper methods in static arrays as on other platforms.
+ */
+static MonoCodeManager *code_manager = NULL;
+static CRITICAL_SECTION code_manager_mutex;
+
+void
+mono_amd64_exceptions_init ()
+{
+ InitializeCriticalSection (&code_manager_mutex);
+ code_manager = mono_code_manager_new ();
+}
+
+/*
+ * mono_arch_get_restore_context:
+ *
+ * Returns a pointer to a method which restores a previously saved sigcontext.
+ */
+gpointer
+mono_arch_get_restore_context (void)
+{
+ static guint8 *start = NULL;
+ static gboolean inited = FALSE;
+ guint8 *code;
+
+ if (inited)
+ return start;
+
+ /* restore_contect (MonoContext *ctx) */
+
+ EnterCriticalSection (&code_manager_mutex);
+ start = code = mono_code_manager_reserve (code_manager, 1024);
+ LeaveCriticalSection (&code_manager_mutex);
+
+ /* get return address */
+ amd64_mov_reg_membase (code, AMD64_RAX, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, rip), 8);
+
+ /* Restore registers */
+ amd64_mov_reg_membase (code, AMD64_RBP, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, rbp), 8);
+ amd64_mov_reg_membase (code, AMD64_RBX, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, rbx), 8);
+ amd64_mov_reg_membase (code, AMD64_R12, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r12), 8);
+ amd64_mov_reg_membase (code, AMD64_R13, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r13), 8);
+ amd64_mov_reg_membase (code, AMD64_R14, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r14), 8);
+ amd64_mov_reg_membase (code, AMD64_R15, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r15), 8);
+
+ amd64_mov_reg_membase (code, AMD64_RSP, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, rsp), 8);
+
+ /* jump to the saved IP */
+ amd64_jump_reg (code, AMD64_RAX);
+
+ inited = TRUE;
+
+ return start;
+}
+
+/*
+ * mono_arch_get_call_filter:
+ *
+ * Returns a pointer to a method which calls an exception filter. We
+ * also use this function to call finally handlers (we pass NULL as
+ * @exc object in this case).
+ */
+gpointer
+mono_arch_get_call_filter (void)
+{
+ static guint8 *start;
+ static gboolean inited = FALSE;
+ int i;
+ guint8 *code;
+ guint32 pos;
+
+ if (inited)
+ return start;
+
+ EnterCriticalSection (&code_manager_mutex);
+ start = code = mono_code_manager_reserve (code_manager, 64);
+ LeaveCriticalSection (&code_manager_mutex);
+
+ /* call_filter (MonoContext *ctx, unsigned long eip) */
+ code = start;
+
+ /* Alloc new frame */
+ amd64_push_reg (code, AMD64_RBP);
+ amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, 8);
+
+ /* Save callee saved regs */
+ pos = 0;
+ for (i = 0; i < AMD64_NREG; ++i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i)) {
+ amd64_push_reg (code, i);
+ pos += 8;
+ }
+
+ /* Save EBP */
+ pos += 8;
+ amd64_push_reg (code, AMD64_RBP);
+
+ /* Make stack misaligned, the call will make it aligned again */
+ if (! (pos & 8))
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+
+ /* set new EBP */
+ amd64_mov_reg_membase (code, AMD64_RBP, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, rbp), 8);
+ /* load callee saved regs */
+ amd64_mov_reg_membase (code, AMD64_RBX, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, rbx), 8);
+ amd64_mov_reg_membase (code, AMD64_R12, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r12), 8);
+ amd64_mov_reg_membase (code, AMD64_R13, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r13), 8);
+ amd64_mov_reg_membase (code, AMD64_R14, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r14), 8);
+ amd64_mov_reg_membase (code, AMD64_R15, AMD64_RDI, G_STRUCT_OFFSET (MonoContext, r15), 8);
+
+ /* call the handler */
+ amd64_call_reg (code, AMD64_RSI);
+
+ if (! (pos & 8))
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+
+ /* restore RBP */
+ amd64_pop_reg (code, AMD64_RBP);
+
+ /* Restore callee saved regs */
+ for (i = AMD64_NREG; i >= 0; --i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i))
+ amd64_pop_reg (code, i);
+
+ amd64_leave (code);
+ amd64_ret (code);
+
+ g_assert ((code - start) < 64);
+
+ inited = TRUE;
+
+ return start;
+}
+
+static void
+throw_exception (MonoObject *exc, guint64 rip, guint64 rsp,
+ guint64 rbx, guint64 rbp, guint64 r12, guint64 r13,
+ guint64 r14, guint64 r15, guint64 rethrow)
+{
+ static void (*restore_context) (MonoContext *);
+ MonoContext ctx;
+
+ if (!restore_context)
+ restore_context = mono_arch_get_restore_context ();
+
+ /* adjust eip so that it point into the call instruction */
+ rip -= 1;
+
+ ctx.rsp = rsp;
+ ctx.rip = rip;
+ ctx.rbx = rbx;
+ ctx.rbp = rbp;
+ ctx.r12 = r12;
+ ctx.r13 = r13;
+ ctx.r14 = r14;
+ ctx.r15 = r15;
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ MonoException *mono_ex = (MonoException*)exc;
+ if (!rethrow)
+ mono_ex->stack_trace = NULL;
+ }
+ mono_handle_exception (&ctx, exc, (gpointer)(rip + 1), FALSE);
+ restore_context (&ctx);
+
+ g_assert_not_reached ();
+}
+
+static gpointer
+get_throw_trampoline (gboolean rethrow)
+{
+ guint8* start;
+ guint8 *code;
+
+ EnterCriticalSection (&code_manager_mutex);
+ start = code = mono_code_manager_reserve (code_manager, 64);
+ LeaveCriticalSection (&code_manager_mutex);
+
+ code = start;
+
+ /* Exception */
+ amd64_mov_reg_reg (code, AMD64_RDI, AMD64_RDI, 8);
+ /* IP */
+ amd64_mov_reg_membase (code, AMD64_RSI, AMD64_RSP, 0, 8);
+ /* SP */
+ amd64_lea_membase (code, AMD64_RDX, AMD64_RSP, 8);
+ /* Callee saved regs */
+ amd64_mov_reg_reg (code, AMD64_RCX, AMD64_RBX, 8);
+ amd64_mov_reg_reg (code, AMD64_R8, AMD64_RBP, 8);
+ amd64_mov_reg_reg (code, AMD64_R9, AMD64_R12, 8);
+ /* reverse order */
+ amd64_push_imm (code, rethrow);
+ amd64_push_reg (code, AMD64_R15);
+ amd64_push_reg (code, AMD64_R14);
+ amd64_push_reg (code, AMD64_R13);
+
+ amd64_mov_reg_imm (code, AMD64_R11, throw_exception);
+ amd64_call_reg (code, AMD64_R11);
+ amd64_breakpoint (code);
+
+ g_assert ((code - start) < 64);
+
+ return start;
+}
+
+/**
+ * mono_arch_get_throw_exception:
+ *
+ * Returns a function pointer which can be used to raise
+ * exceptions. The returned function has the following
+ * signature: void (*func) (MonoException *exc);
+ *
+ */
+gpointer
+mono_arch_get_throw_exception (void)
+{
+ static guint8* start;
+ static gboolean inited = FALSE;
+
+ if (inited)
+ return start;
+
+ start = get_throw_trampoline (FALSE);
+
+ inited = TRUE;
+
+ return start;
+}
+
+gpointer
+mono_arch_get_rethrow_exception (void)
+{
+ static guint8* start;
+ static gboolean inited = FALSE;
+
+ if (inited)
+ return start;
+
+ start = get_throw_trampoline (TRUE);
+
+ inited = TRUE;
+
+ return start;
+}
+
+/**
+ * mono_arch_get_throw_exception_by_name:
+ *
+ * Returns a function pointer which can be used to raise
+ * corlib exceptions. The returned function has the following
+ * signature: void (*func) (char *exc_name);
+ */
+gpointer
+mono_arch_get_throw_exception_by_name (void)
+{
+ static guint8* start;
+ static gboolean inited = FALSE;
+ guint8 *code;
+ guint64 throw_ex;
+
+ if (inited)
+ return start;
+
+ EnterCriticalSection (&code_manager_mutex);
+ start = code = mono_code_manager_reserve (code_manager, 64);
+ LeaveCriticalSection (&code_manager_mutex);
+
+ code = start;
+
+ /* Push return address */
+ amd64_push_reg (code, AMD64_RSI);
+
+ /* Call exception_from_name */
+ amd64_mov_reg_reg (code, AMD64_RDX, AMD64_RDI, 8);
+ amd64_mov_reg_imm (code, AMD64_RSI, "System");
+ amd64_mov_reg_imm (code, AMD64_RDI, mono_defaults.exception_class->image);
+
+ amd64_mov_reg_imm (code, AMD64_R11, mono_exception_from_name);
+ amd64_call_reg (code, AMD64_R11);
+
+ /* Put the original return address at the top of the misaligned stack */
+ amd64_pop_reg (code, AMD64_RSI);
+ amd64_push_reg (code, AMD64_R11);
+ amd64_push_reg (code, AMD64_RSI);
+
+ throw_ex = (guint64)mono_arch_get_throw_exception ();
+
+ /* Call throw_exception */
+ amd64_mov_reg_reg (code, AMD64_RDI, AMD64_RAX, 8);
+ amd64_mov_reg_imm (code, AMD64_R11, throw_ex);
+ /* The original IP is on the stack */
+ amd64_jump_reg (code, AMD64_R11);
+
+ g_assert ((code - start) < 64);
+
+ inited = TRUE;
+
+ return start;
+}
+
+/* mono_arch_find_jit_info:
+ *
+ * This function is used to gather information from @ctx. It return the
+ * MonoJitInfo of the corresponding function, unwinds one stack frame and
+ * stores the resulting context into @new_ctx. It also stores a string
+ * describing the stack location into @trace (if not NULL), and modifies
+ * the @lmf if necessary. @native_offset return the IP offset from the
+ * start of the function or -1 if that info is not available.
+ */
+MonoJitInfo *
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx,
+ MonoContext *new_ctx, char **trace, MonoLMF **lmf, int *native_offset,
+ gboolean *managed)
+{
+ MonoJitInfo *ji;
+ int i;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+
+ /* Avoid costly table lookup during stack overflow */
+ if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
+ ji = prev_ji;
+ else
+ ji = mono_jit_info_table_find (domain, ip);
+
+ if (managed)
+ *managed = FALSE;
+
+ if (ji != NULL) {
+ int offset;
+
+ *new_ctx = *ctx;
+
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ /*
+ * Some managed methods like pinvoke wrappers might have save_lmf set.
+ * In this case, register save/restore code is not generated by the
+ * JIT, so we have to restore callee saved registers from the lmf.
+ */
+ if (ji->method->save_lmf) {
+ /*
+ * We only need to do this if the exception was raised in managed
+ * code, since otherwise the lmf was already popped of the stack.
+ */
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ new_ctx->rbx = (*lmf)->rbx;
+ new_ctx->r12 = (*lmf)->r12;
+ new_ctx->r13 = (*lmf)->r13;
+ new_ctx->r14 = (*lmf)->r14;
+ new_ctx->r15 = (*lmf)->r15;
+ }
+ }
+ else {
+ offset = -1;
+ /* restore caller saved registers */
+ for (i = 0; i < AMD64_NREG; i ++)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (ji->used_regs & (1 << i))) {
+ guint64 reg = *((guint64 *)ctx->SC_EBP + offset);
+ offset --;
+ switch (i) {
+ case AMD64_RBX:
+ new_ctx->rbx = reg;
+ break;
+ case AMD64_R12:
+ new_ctx->r12 = reg;
+ break;
+ case AMD64_R13:
+ new_ctx->r13 = reg;
+ break;
+ case AMD64_R14:
+ new_ctx->r14 = reg;
+ break;
+ case AMD64_R15:
+ new_ctx->r15 = reg;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+ }
+
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
+
+ /* Pop EBP and the return address */
+ new_ctx->SC_ESP = ctx->SC_EBP + (2 * sizeof (gpointer));
+ /* we substract 1, so that the IP points into the call instruction */
+ new_ctx->SC_EIP = *((guint64 *)ctx->SC_EBP + 1) - 1;
+ new_ctx->SC_EBP = *((guint64 *)ctx->SC_EBP);
+
+ /* Pop arguments off the stack */
+ {
+ MonoJitArgumentInfo *arg_info = alloca (sizeof (MonoJitArgumentInfo) * (ji->method->signature->param_count + 1));
+
+ guint32 stack_to_pop = mono_arch_get_argument_info (ji->method->signature, ji->method->signature->param_count, arg_info);
+ new_ctx->SC_ESP += stack_to_pop;
+ }
+
+ *res = *ji;
+ return res;
+ } else if (*lmf) {
+
+ *new_ctx = *ctx;
+
+ if (!(*lmf)->method)
+ return (gpointer)-1;
+
+ if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->rip))) {
+ *res = *ji;
+ } else {
+ memset (res, 0, sizeof (MonoJitInfo));
+ res->method = (*lmf)->method;
+ }
+
+ new_ctx->SC_RIP = (*lmf)->rip;
+ new_ctx->SC_RBP = (*lmf)->ebp;
+
+ new_ctx->SC_RBX = (*lmf)->rbx;
+ new_ctx->SC_R12 = (*lmf)->r12;
+ new_ctx->SC_R13 = (*lmf)->r13;
+ new_ctx->SC_R14 = (*lmf)->r14;
+ new_ctx->SC_R15 = (*lmf)->r15;
+
+ /* the lmf is always stored on the stack, so the following
+ * expression points to a stack location which can be used as ESP */
+ new_ctx->SC_ESP = ALIGN_TO ((guint64)&((*lmf)->rip), 16);
+
+ *lmf = (*lmf)->previous_lmf;
+
+ return res;
+
+ }
+
+ return NULL;
+}
+
+/**
+ * mono_arch_handle_exception:
+ *
+ * @ctx: saved processor state
+ * @obj: the exception object
+ */
+gboolean
+mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
+{
+ ucontext_t *ctx = (ucontext_t*)sigctx;
+ MonoContext mctx;
+
+ mctx.rax = ctx->uc_mcontext.gregs [REG_RAX];
+ mctx.rbx = ctx->uc_mcontext.gregs [REG_RBX];
+ mctx.rcx = ctx->uc_mcontext.gregs [REG_RCX];
+ mctx.rdx = ctx->uc_mcontext.gregs [REG_RDX];
+ mctx.rbp = ctx->uc_mcontext.gregs [REG_RBP];
+ mctx.rsp = ctx->uc_mcontext.gregs [REG_RSP];
+ mctx.rsi = ctx->uc_mcontext.gregs [REG_RSI];
+ mctx.rdi = ctx->uc_mcontext.gregs [REG_RDI];
+ mctx.rip = ctx->uc_mcontext.gregs [REG_RIP];
+ mctx.r12 = ctx->uc_mcontext.gregs [REG_R12];
+ mctx.r13 = ctx->uc_mcontext.gregs [REG_R13];
+ mctx.r14 = ctx->uc_mcontext.gregs [REG_R14];
+ mctx.r15 = ctx->uc_mcontext.gregs [REG_R15];
+
+ mono_handle_exception (&mctx, obj, (gpointer)mctx.rip, test_only);
+
+ ctx->uc_mcontext.gregs [REG_RAX] = mctx.rax;
+ ctx->uc_mcontext.gregs [REG_RBX] = mctx.rbx;
+ ctx->uc_mcontext.gregs [REG_RCX] = mctx.rcx;
+ ctx->uc_mcontext.gregs [REG_RDX] = mctx.rdx;
+ ctx->uc_mcontext.gregs [REG_RBP] = mctx.rbp;
+ ctx->uc_mcontext.gregs [REG_RSP] = mctx.rsp;
+ ctx->uc_mcontext.gregs [REG_RSI] = mctx.rsi;
+ ctx->uc_mcontext.gregs [REG_RDI] = mctx.rdi;
+ ctx->uc_mcontext.gregs [REG_RIP] = mctx.rip;
+ ctx->uc_mcontext.gregs [REG_R12] = mctx.r12;
+ ctx->uc_mcontext.gregs [REG_R13] = mctx.r13;
+ ctx->uc_mcontext.gregs [REG_R14] = mctx.r14;
+ ctx->uc_mcontext.gregs [REG_R15] = mctx.r15;
+
+ return TRUE;
+}
+
+gpointer
+mono_arch_ip_from_context (void *sigctx)
+{
+ ucontext_t *ctx = (ucontext_t*)sigctx;
+ return (gpointer)ctx->uc_mcontext.gregs [REG_RIP];
+}
+
diff --git a/mono/mini/exceptions-ppc.c b/mono/mini/exceptions-ppc.c
new file mode 100644
index 00000000000..1e174f67e61
--- /dev/null
+++ b/mono/mini/exceptions-ppc.c
@@ -0,0 +1,1010 @@
+/*
+ * exceptions-ppc.c: exception support for PowerPC
+ *
+ * Authors:
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+#include <ucontext.h>
+
+#include <mono/arch/ppc/ppc-codegen.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/mono-debug.h>
+
+#include "mini.h"
+#include "mini-ppc.h"
+
+static gboolean arch_handle_exception (MonoContext *ctx, gpointer obj, gboolean test_only);
+
+/*
+
+struct sigcontext {
+ int sc_onstack; // sigstack state to restore
+ int sc_mask; // signal mask to restore
+ int sc_ir; // pc
+ int sc_psw; // processor status word
+ int sc_sp; // stack pointer if sc_regs == NULL
+ void *sc_regs; // (kernel private) saved state
+};
+
+struct ucontext {
+ int uc_onstack;
+ sigset_t uc_sigmask; // signal mask used by this context
+ stack_t uc_stack; // stack used by this context
+ struct ucontext *uc_link; // pointer to resuming context
+ size_t uc_mcsize; // size of the machine context passed in
+ mcontext_t uc_mcontext; // machine specific context
+};
+
+typedef struct ppc_exception_state {
+ unsigned long dar; // Fault registers for coredump
+ unsigned long dsisr;
+ unsigned long exception;// number of powerpc exception taken
+ unsigned long pad0; // align to 16 bytes
+
+ unsigned long pad1[4]; // space in PCB "just in case"
+} ppc_exception_state_t;
+
+typedef struct ppc_vector_state {
+ unsigned long save_vr[32][4];
+ unsigned long save_vscr[4];
+ unsigned int save_pad5[4];
+ unsigned int save_vrvalid; // VRs that have been saved
+ unsigned int save_pad6[7];
+} ppc_vector_state_t;
+
+typedef struct ppc_float_state {
+ double fpregs[32];
+
+ unsigned int fpscr_pad; // fpscr is 64 bits, 32 bits of rubbish
+ unsigned int fpscr; // floating point status register
+} ppc_float_state_t;
+
+typedef struct ppc_thread_state {
+ unsigned int srr0; // Instruction address register (PC)
+ unsigned int srr1; // Machine state register (supervisor)
+ unsigned int r0;
+ unsigned int r1;
+ unsigned int r2;
+ ...
+ unsigned int r31;
+ unsigned int cr; // Condition register
+ unsigned int xer; // User's integer exception register
+ unsigned int lr; // Link register
+ unsigned int ctr; // Count register
+ unsigned int mq; // MQ register (601 only)
+
+ unsigned int vrsave; // Vector Save Register
+} ppc_thread_state_t;
+
+struct mcontext {
+ ppc_exception_state_t es;
+ ppc_thread_state_t ss;
+ ppc_float_state_t fs;
+ ppc_vector_state_t vs;
+};
+
+typedef struct mcontext * mcontext_t;
+
+Linux/PPC instead has:
+struct sigcontext {
+ unsigned long _unused[4];
+ int signal;
+ unsigned long handler;
+ unsigned long oldmask;
+ struct pt_regs *regs;
+};
+struct pt_regs {
+ unsigned long gpr[32];
+ unsigned long nip;
+ unsigned long msr;
+ unsigned long orig_gpr3; // Used for restarting system calls
+ unsigned long ctr;
+ unsigned long link;
+ unsigned long xer;
+ unsigned long ccr;
+ unsigned long mq; // 601 only (not used at present)
+ // Used on APUS to hold IPL value.
+ unsigned long trap; // Reason for being here
+ // N.B. for critical exceptions on 4xx, the dar and dsisr
+ // fields are overloaded to hold srr0 and srr1.
+ unsigned long dar; // Fault registers
+ unsigned long dsisr; // on 4xx/Book-E used for ESR
+ unsigned long result; // Result of a system call
+};
+struct mcontext {
+ elf_gregset_t mc_gregs;
+ elf_fpregset_t mc_fregs;
+ unsigned long mc_pad[2];
+ elf_vrregset_t mc_vregs __attribute__((__aligned__(16)));
+};
+
+struct ucontext {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ int uc_pad[7];
+ struct mcontext *uc_regs; // points to uc_mcontext field
+ sigset_t uc_sigmask;
+ // glibc has 1024-bit signal masks, ours are 64-bit
+ int uc_maskext[30];
+ int uc_pad2[3];
+ struct mcontext uc_mcontext;
+};
+
+#define ELF_NGREG 48 // includes nip, msr, lr, etc.
+#define ELF_NFPREG 33 // includes fpscr
+
+// General registers
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+// Floating point registers
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+
+*/
+
+/* we have the stack pointer, not the base pointer in sigcontext */
+#define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->sc_ir = (int)ip; } while (0);
+#define MONO_CONTEXT_SET_BP(ctx,bp) do { (ctx)->sc_sp = (int)bp; } while (0);
+
+#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->sc_ir))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->sc_sp))
+
+#ifdef __APPLE__
+
+typedef struct {
+ unsigned long sp;
+ unsigned long unused1;
+ unsigned long lr;
+} MonoPPCStackFrame;
+
+#else
+
+typedef struct {
+ unsigned long sp;
+ unsigned long lr;
+} MonoPPCStackFrame;
+
+#endif
+
+
+#define restore_regs_from_context(ctx_reg,ip_reg,tmp_reg) do { \
+ int reg; \
+ ppc_lwz (code, ip_reg, G_STRUCT_OFFSET (MonoContext, sc_ir), ctx_reg); \
+ ppc_lmw (code, ppc_r13, ctx_reg, G_STRUCT_OFFSET (MonoContext, regs)); \
+ for (reg = 0; reg < MONO_SAVED_FREGS; ++reg) { \
+ ppc_lfd (code, (14 + reg), G_STRUCT_OFFSET(MonoLMF, fregs) + reg * sizeof (gdouble), ctx_reg); \
+ } \
+ } while (0)
+
+/* nothing to do */
+#define setup_context(ctx)
+
+/*
+ * arch_get_restore_context:
+ *
+ * Returns a pointer to a method which restores a previously saved sigcontext.
+ * The first argument in r3 is the pointer to the context.
+ */
+static gpointer
+arch_get_restore_context (void)
+{
+ guint8 *code;
+ static guint8 start [128];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ inited = 1;
+
+ code = start;
+ restore_regs_from_context (ppc_r3, ppc_r4, ppc_r5);
+ /* restore also the stack pointer */
+ ppc_lwz (code, ppc_sp, G_STRUCT_OFFSET (MonoContext, sc_sp), ppc_r3);
+ //ppc_break (code);
+ /* jump to the saved IP */
+ ppc_mtctr (code, ppc_r4);
+ ppc_bcctr (code, PPC_BR_ALWAYS, 0);
+ /* never reached */
+ ppc_break (code);
+
+ g_assert ((code - start) < sizeof(start));
+ return start;
+}
+
+/*
+ * arch_get_call_filter:
+ *
+ * Returns a pointer to a method which calls an exception filter. We
+ * also use this function to call finally handlers (we pass NULL as
+ * @exc object in this case).
+ */
+static gpointer
+arch_get_call_filter (void)
+{
+ static guint8 start [320];
+ static int inited = 0;
+ guint8 *code;
+ int alloc_size, pos, i;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ /* call_filter (MonoContext *ctx, unsigned long eip, gpointer exc) */
+ code = start;
+
+ /* save all the regs on the stack */
+ pos = 0;
+ for (i = 31; i >= 14; --i) {
+ pos += sizeof (gdouble);
+ ppc_stfd (code, i, -pos, ppc_sp);
+ }
+ pos += sizeof (gulong) * MONO_SAVED_GREGS;
+ ppc_stmw (code, ppc_r13, ppc_sp, -pos);
+
+ ppc_mflr (code, ppc_r0);
+ ppc_stw (code, ppc_r0, PPC_RET_ADDR_OFFSET, ppc_sp);
+
+ alloc_size = PPC_MINIMAL_STACK_SIZE + pos + 64;
+ // align to PPC_STACK_ALIGNMENT bytes
+ alloc_size += PPC_STACK_ALIGNMENT - 1;
+ alloc_size &= ~(PPC_STACK_ALIGNMENT - 1);
+
+ g_assert ((alloc_size & (PPC_STACK_ALIGNMENT-1)) == 0);
+ ppc_stwu (code, ppc_sp, -alloc_size, ppc_sp);
+
+ /* restore all the regs from ctx (in r3), but not r1, the stack pointer */
+ restore_regs_from_context (ppc_r3, ppc_r6, ppc_r7);
+ /* call handler at eip (r4) and set the first arg with the exception (r5) */
+ ppc_mtctr (code, ppc_r4);
+ ppc_mr (code, ppc_r3, ppc_r5);
+ ppc_bcctrl (code, PPC_BR_ALWAYS, 0);
+
+ /* epilog */
+ ppc_lwz (code, ppc_r0, alloc_size + PPC_RET_ADDR_OFFSET, ppc_sp);
+ ppc_mtlr (code, ppc_r0);
+ ppc_addic (code, ppc_sp, ppc_sp, alloc_size);
+
+ /* restore all the regs from the stack */
+ pos = 0;
+ for (i = 31; i >= 14; --i) {
+ pos += sizeof (double);
+ ppc_lfd (code, i, -pos, ppc_sp);
+ }
+ pos += sizeof (gulong) * MONO_SAVED_GREGS;
+ ppc_lmw (code, ppc_r13, ppc_sp, -pos);
+
+ ppc_blr (code);
+
+ g_assert ((code - start) < sizeof(start));
+ return start;
+}
+
+static void
+throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, gulong *int_regs, gdouble *fp_regs)
+{
+ static void (*restore_context) (MonoContext *);
+ MonoContext ctx;
+
+ if (!restore_context)
+ restore_context = arch_get_restore_context ();
+
+ /* adjust eip so that it point into the call instruction */
+ eip -= 4;
+
+ setup_context (&ctx);
+
+ /*printf ("stack in throw: %p\n", esp);*/
+ MONO_CONTEXT_SET_BP (&ctx, esp);
+ MONO_CONTEXT_SET_IP (&ctx, eip);
+ memcpy (&ctx.regs, int_regs, sizeof (gulong) * MONO_SAVED_GREGS);
+ memcpy (&ctx.fregs, fp_regs, sizeof (double) * MONO_SAVED_FREGS);
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ MonoException *mono_ex = (MonoException*)exc;
+ mono_ex->stack_trace = NULL;
+ }
+ arch_handle_exception (&ctx, exc, FALSE);
+ restore_context (&ctx);
+
+ g_assert_not_reached ();
+}
+
+/**
+ * arch_get_throw_exception_generic:
+ *
+ * Returns a function pointer which can be used to raise
+ * exceptions. The returned function has the following
+ * signature: void (*func) (MonoException *exc); or
+ * void (*func) (char *exc_name);
+ *
+ */
+static gpointer
+mono_arch_get_throw_exception_generic (guint8 *start, int size, int by_name)
+{
+ guint8 *code;
+ int alloc_size, pos, i;
+
+ code = start;
+
+ /* save all the regs on the stack */
+ pos = 0;
+ for (i = 31; i >= 14; --i) {
+ pos += sizeof (gdouble);
+ ppc_stfd (code, i, -pos, ppc_sp);
+ }
+ pos += sizeof (gulong) * MONO_SAVED_GREGS;
+ ppc_stmw (code, ppc_r13, ppc_sp, -pos);
+
+ ppc_mflr (code, ppc_r0);
+ ppc_stw (code, ppc_r0, PPC_RET_ADDR_OFFSET, ppc_sp);
+
+ alloc_size = PPC_MINIMAL_STACK_SIZE + pos + 64;
+ // align to PPC_STACK_ALIGNMENT bytes
+ alloc_size += PPC_STACK_ALIGNMENT - 1;
+ alloc_size &= ~(PPC_STACK_ALIGNMENT - 1);
+
+ g_assert ((alloc_size & (PPC_STACK_ALIGNMENT-1)) == 0);
+ ppc_stwu (code, ppc_sp, -alloc_size, ppc_sp);
+
+ //ppc_break (code);
+ if (by_name) {
+ ppc_mr (code, ppc_r5, ppc_r3);
+ ppc_load (code, ppc_r3, mono_defaults.corlib);
+ ppc_load (code, ppc_r4, "System");
+ ppc_bl (code, 0);
+ ppc_patch (code - 4, mono_exception_from_name);
+ }
+
+ /* call throw_exception (exc, ip, sp, int_regs, fp_regs) */
+ /* caller sp */
+ ppc_lwz (code, ppc_r5, 0, ppc_sp);
+ /* exc is already in place in r3 */
+ if (by_name)
+ ppc_lwz (code, ppc_r4, PPC_RET_ADDR_OFFSET, ppc_r5);
+ else
+ ppc_mr (code, ppc_r4, ppc_r0); /* caller ip */
+ /* pointer to the saved fp regs */
+ pos = alloc_size - sizeof (double) * MONO_SAVED_FREGS;
+ ppc_addi (code, ppc_r7, ppc_sp, pos);
+ /* pointer to the saved int regs */
+ pos -= sizeof (gulong) * MONO_SAVED_GREGS;
+ ppc_addi (code, ppc_r6, ppc_sp, pos);
+
+ ppc_bl (code, 0);
+ ppc_patch (code - 4, throw_exception);
+ /* we should never reach this breakpoint */
+ ppc_break (code);
+ g_assert ((code - start) < size);
+ return start;
+}
+
+/**
+ * arch_get_throw_exception:
+ *
+ * Returns a function pointer which can be used to raise
+ * exceptions. The returned function has the following
+ * signature: void (*func) (MonoException *exc);
+ * For example to raise an arithmetic exception you can use:
+ *
+ * x86_push_imm (code, mono_get_exception_arithmetic ());
+ * x86_call_code (code, arch_get_throw_exception ());
+ *
+ */
+gpointer
+mono_arch_get_throw_exception (void)
+{
+ static guint8 start [128];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ mono_arch_get_throw_exception_generic (start, sizeof (start), FALSE);
+ inited = 1;
+ return start;
+}
+
+/**
+ * arch_get_throw_exception_by_name:
+ *
+ * Returns a function pointer which can be used to raise
+ * corlib exceptions. The returned function has the following
+ * signature: void (*func) (char *exc_name);
+ * For example to raise an arithmetic exception you can use:
+ *
+ * x86_push_imm (code, "ArithmeticException");
+ * x86_call_code (code, arch_get_throw_exception_by_name ());
+ *
+ */
+gpointer
+mono_arch_get_throw_exception_by_name (void)
+{
+ static guint8 start [160];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ mono_arch_get_throw_exception_generic (start, sizeof (start), TRUE);
+ inited = 1;
+ return start;
+}
+
+static MonoArray *
+glist_to_array (GList *list)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ int len, i;
+
+ if (!list)
+ return NULL;
+
+ len = g_list_length (list);
+ res = mono_array_new (domain, mono_defaults.int_class, len);
+
+ for (i = 0; list; list = list->next, i++)
+ mono_array_set (res, gpointer, i, list->data);
+
+ return res;
+}
+
+/* mono_arch_find_jit_info:
+ *
+ * This function is used to gather information from @ctx. It return the
+ * MonoJitInfo of the corresponding function, unwinds one stack frame and
+ * stores the resulting context into @new_ctx. It also stores a string
+ * describing the stack location into @trace (if not NULL), and modifies
+ * the @lmf if necessary. @native_offset return the IP offset from the
+ * start of the function or -1 if that info is not available.
+ */
+MonoJitInfo *
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji,
+ MonoContext *ctx, MonoContext *new_ctx, char **trace, MonoLMF **lmf,
+ int *native_offset, gboolean *managed)
+{
+ MonoJitInfo *ji;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+ unsigned long *ptr;
+ char *p;
+ MonoPPCStackFrame *sframe;
+
+ /* Avoid costly table lookup during stack overflow */
+ if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
+ ji = prev_ji;
+ else
+ ji = mono_jit_info_table_find (domain, ip);
+
+ if (trace)
+ *trace = NULL;
+
+ if (native_offset)
+ *native_offset = -1;
+
+ if (managed)
+ *managed = FALSE;
+
+ if (ji != NULL) {
+ char *source_location, *tmpaddr, *fname;
+ gint32 address, iloffset;
+ int offset, i;
+ gulong *ctx_regs;
+
+ *new_ctx = *ctx;
+ setup_context (new_ctx);
+
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
+
+ address = (char *)ip - (char *)ji->code_start;
+
+ if (native_offset)
+ *native_offset = address;
+
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ if (trace) {
+ source_location = mono_debug_source_location_from_address (ji->method, address, NULL, domain);
+ iloffset = mono_debug_il_offset_from_address (ji->method, address, domain);
+
+ if (iloffset < 0)
+ tmpaddr = g_strdup_printf ("<0x%05x>", address);
+ else
+ tmpaddr = g_strdup_printf ("[0x%05x]", iloffset);
+
+ fname = mono_method_full_name (ji->method, TRUE);
+
+ if (source_location)
+ *trace = g_strdup_printf ("in %s (at %s) %s", tmpaddr, source_location, fname);
+ else
+ *trace = g_strdup_printf ("in %s %s", tmpaddr, fname);
+
+ g_free (fname);
+ g_free (source_location);
+ g_free (tmpaddr);
+ }
+ sframe = (MonoPPCStackFrame*)MONO_CONTEXT_GET_BP (ctx);
+ MONO_CONTEXT_SET_BP (new_ctx, sframe->sp);
+ if (ji->method->save_lmf) {
+ memcpy (&new_ctx->fregs, (char*)sframe->sp - sizeof (double) * MONO_SAVED_FREGS, sizeof (double) * MONO_SAVED_FREGS);
+ memcpy (&new_ctx->regs, (char*)sframe->sp - sizeof (double) * MONO_SAVED_FREGS - sizeof (gulong) * MONO_SAVED_GREGS, sizeof (gulong) * MONO_SAVED_GREGS);
+ } else if (ji->used_regs) {
+ /* keep updated with emit_prolog in mini-ppc.c */
+ offset = 0;
+ /* FIXME handle floating point args
+ for (i = 31; i >= 14; --i) {
+ if (ji->used_fregs & (1 << i)) {
+ offset += sizeof (double);
+ new_ctx->fregs [i - 14] = *(gulong*)((char*)sframe->sp - offset);
+ }
+ }*/
+ for (i = 31; i >= 13; --i) {
+ if (ji->used_regs & (1 << i)) {
+ offset += sizeof (gulong);
+ new_ctx->regs [i - 13] = *(gulong*)((char*)sframe->sp - offset);
+ }
+ }
+ }
+ /* the calling IP is in the parent frame */
+ sframe = (MonoPPCStackFrame*)sframe->sp;
+ /* we substract 4, so that the IP points into the call instruction */
+ MONO_CONTEXT_SET_IP (new_ctx, sframe->lr - 4);
+
+ *res = *ji;
+ return res;
+ } else if (*lmf) {
+
+ *new_ctx = *ctx;
+ setup_context (new_ctx);
+
+ if (!(*lmf)->method)
+ return (gpointer)-1;
+
+ if (trace) {
+ char *fname = mono_method_full_name ((*lmf)->method, TRUE);
+ *trace = g_strdup_printf ("in (unmanaged) %s", fname);
+ g_free (fname);
+ }
+
+ if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+ *res = *ji;
+ } else {
+ memset (res, 0, sizeof (MonoJitInfo));
+ res->method = (*lmf)->method;
+ }
+
+ /*sframe = (MonoPPCStackFrame*)MONO_CONTEXT_GET_BP (ctx);
+ MONO_CONTEXT_SET_BP (new_ctx, sframe->sp);
+ MONO_CONTEXT_SET_IP (new_ctx, sframe->lr);*/
+ MONO_CONTEXT_SET_BP (new_ctx, (*lmf)->ebp);
+ MONO_CONTEXT_SET_IP (new_ctx, (*lmf)->eip);
+ memcpy (&new_ctx->regs, (*lmf)->iregs, sizeof (gulong) * MONO_SAVED_GREGS);
+ memcpy (&new_ctx->fregs, (*lmf)->fregs, sizeof (double) * MONO_SAVED_FREGS);
+ *lmf = (*lmf)->previous_lmf;
+
+ return res;
+
+ }
+
+ return NULL;
+}
+
+MonoArray *
+ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ MonoArray *ta = exc->trace_ips;
+ int i, len;
+
+ len = mono_array_length (ta);
+
+ res = mono_array_new (domain, mono_defaults.stack_frame_class, len > skip ? len - skip : 0);
+
+ for (i = skip; i < len; i++) {
+ MonoJitInfo *ji;
+ MonoStackFrame *sf = (MonoStackFrame *)mono_object_new (domain, mono_defaults.stack_frame_class);
+ gpointer ip = mono_array_get (ta, gpointer, i);
+
+ ji = mono_jit_info_table_find (domain, ip);
+ if (!ji) {
+ sf->method = mono_method_get_object (domain, mono_defaults.object_class->methods [0], NULL);
+ mono_array_set (res, gpointer, i, sf);
+ continue;
+ }
+ //g_assert (ji != NULL);
+
+ sf->method = mono_method_get_object (domain, ji->method, NULL);
+ sf->native_offset = (char *)ip - (char *)ji->code_start;
+
+ sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, sf->native_offset, &sf->line, domain);
+
+ sf->filename = filename? mono_string_new (domain, filename): NULL;
+ sf->column = 0;
+
+ g_free (filename);
+ }
+
+ mono_array_set (res, gpointer, i, sf);
+ }
+
+ return res;
+}
+
+void
+mono_jit_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data) {
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ gint native_offset, il_offset;
+ gboolean managed;
+ MonoPPCStackFrame *sframe;
+
+ MonoContext ctx, new_ctx;
+
+ setup_context (&ctx);
+ setup_context (&new_ctx);
+
+#ifdef __APPLE__
+ __asm__ volatile("lwz %0,0(r1)" : "=r" (sframe));
+#else
+ __asm__ volatile("lwz %0,0(1)" : "=r" (sframe));
+#endif
+ //MONO_CONTEXT_SET_IP (&ctx, sframe->lr);
+ MONO_CONTEXT_SET_BP (&ctx, sframe->sp);
+ sframe = (MonoPPCStackFrame*)sframe->sp;
+ MONO_CONTEXT_SET_IP (&ctx, sframe->lr);
+
+ while (MONO_CONTEXT_GET_BP (&ctx) < jit_tls->end_of_stack) {
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, NULL, &ctx, &new_ctx, NULL, &lmf, &native_offset, &managed);
+ g_assert (ji);
+
+ if (ji == (gpointer)-1)
+ return;
+
+ il_offset = do_il_offset ? mono_debug_il_offset_from_address (ji->method, native_offset, domain): -1;
+
+ if (func (ji->method, native_offset, il_offset, managed, user_data))
+ return;
+
+ ctx = new_ctx;
+ setup_context (&ctx);
+ }
+}
+
+MonoBoolean
+ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
+ MonoReflectionMethod **method,
+ gint32 *iloffset, gint32 *native_offset,
+ MonoString **file, gint32 *line, gint32 *column)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ MonoContext ctx, new_ctx;
+ MonoPPCStackFrame *sframe;
+
+#ifdef __APPLE__
+ __asm__ volatile("lwz %0,0(r1)" : "=r" (sframe));
+#else
+ __asm__ volatile("lwz %0,0(1)" : "=r" (sframe));
+#endif
+ MONO_CONTEXT_SET_BP (&ctx, sframe->sp);
+ sframe = (MonoPPCStackFrame*)sframe->sp;
+ MONO_CONTEXT_SET_IP (&ctx, sframe->lr);
+ /*MONO_CONTEXT_SET_IP (&ctx, ves_icall_get_frame_info);
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (0));*/
+
+ skip++;
+
+ do {
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, NULL, &ctx, &new_ctx, NULL, &lmf, native_offset, NULL);
+
+ ctx = new_ctx;
+
+ if (!ji || ji == (gpointer)-1 || MONO_CONTEXT_GET_BP (&ctx) >= jit_tls->end_of_stack)
+ return FALSE;
+
+ /* skip all wrappers ??*/
+ if (ji->method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE)
+ continue;
+
+ skip--;
+
+ } while (skip >= 0);
+
+ *method = mono_method_get_object (domain, ji->method, NULL);
+ *iloffset = mono_debug_il_offset_from_address (ji->method, *native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, *native_offset, line, domain);
+
+ *file = filename? mono_string_new (domain, filename): NULL;
+ *column = 0;
+
+ g_free (filename);
+ }
+
+ return TRUE;
+}
+
+/*
+ * This is the function called from the signal handler
+ */
+#ifdef __APPLE__
+gboolean
+mono_arch_handle_exception (void *ctx, gpointer obj, gboolean test_only)
+{
+ struct ucontext *uc = ctx;
+ MonoContext mctx;
+ gboolean result;
+
+ mctx.sc_ir = uc->uc_mcontext->ss.srr0;
+ mctx.sc_sp = uc->uc_mcontext->ss.r1;
+ memcpy (&mctx.regs, &uc->uc_mcontext->ss.r13, sizeof (gulong) * MONO_SAVED_GREGS);
+ memcpy (&mctx.fregs, &uc->uc_mcontext->fs.fpregs [14], sizeof (double) * MONO_SAVED_FREGS);
+
+ result = arch_handle_exception (&mctx, obj, test_only);
+ /* restore the context so that returning from the signal handler will invoke
+ * the catch clause
+ */
+ uc->uc_mcontext->ss.srr0 = mctx.sc_ir;
+ uc->uc_mcontext->ss.r1 = mctx.sc_sp;
+ memcpy (&uc->uc_mcontext->ss.r13, &mctx.regs, sizeof (gulong) * MONO_SAVED_GREGS);
+ memcpy (&uc->uc_mcontext->fs.fpregs [14], &mctx.fregs, sizeof (double) * MONO_SAVED_FREGS);
+ return result;
+}
+
+gpointer
+mono_arch_ip_from_context (void *sigctx)
+{
+ struct ucontext *uc = sigctx;
+ return (gpointer)uc->uc_mcontext->ss.srr0;
+}
+
+#else
+/* Linux */
+gboolean
+mono_arch_handle_exception (void *ctx, gpointer obj, gboolean test_only)
+{
+ struct ucontext *uc = ctx;
+ MonoContext mctx;
+ gboolean result;
+
+ mctx.sc_ir = uc->uc_mcontext.uc_regs->gregs [PT_NIP];
+ mctx.sc_sp = uc->uc_mcontext.uc_regs->gregs [PT_R1];
+ memcpy (&mctx.regs, &uc->uc_mcontext.uc_regs->gregs [PT_R13], sizeof (gulong) * MONO_SAVED_GREGS);
+ memcpy (&mctx.fregs, &uc->uc_mcontext.uc_regs->fpregs.fpregs [14], sizeof (double) * MONO_SAVED_FREGS);
+
+ result = arch_handle_exception (&mctx, obj, test_only);
+ /* restore the context so that returning from the signal handler will invoke
+ * the catch clause
+ */
+ uc->uc_mcontext.uc_regs->gregs [PT_NIP] = mctx.sc_ir;
+ uc->uc_mcontext.uc_regs->gregs [PT_R1] = mctx.sc_sp;
+ memcpy (&uc->uc_mcontext.uc_regs->gregs [PT_R13], &mctx.regs, sizeof (gulong) * MONO_SAVED_GREGS);
+ memcpy (&uc->uc_mcontext.uc_regs->fpregs.fpregs [14], &mctx.fregs, sizeof (double) * MONO_SAVED_FREGS);
+ return result;
+}
+
+gpointer
+mono_arch_ip_from_context (void *sigctx)
+{
+ struct ucontext *uc = sigctx;
+ return (gpointer)uc->uc_mcontext.uc_regs->gregs [PT_NIP];
+}
+
+#endif
+
+/**
+ * arch_handle_exception:
+ * @ctx: saved processor state
+ * @obj: the exception object
+ * @test_only: only test if the exception is caught, but dont call handlers
+ *
+ *
+ */
+static gboolean
+arch_handle_exception (MonoContext *ctx, gpointer obj, gboolean test_only)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitInfo *ji, rji;
+ static int (*call_filter) (MonoContext *, gpointer, gpointer) = NULL;
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ GList *trace_ips = NULL;
+ MonoException *mono_ex;
+ MonoString *initial_stack_trace = NULL;
+ GString *trace_str = NULL;
+ int frame_count = 0;
+
+ g_assert (ctx != NULL);
+ if (!obj) {
+ MonoException *ex = mono_get_exception_null_reference ();
+ ex->message = mono_string_new (domain,
+ "Object reference not set to an instance of an object");
+ obj = (MonoObject *)ex;
+ }
+
+ if (mono_object_isinst (obj, mono_defaults.exception_class)) {
+ mono_ex = (MonoException*)obj;
+ initial_stack_trace = mono_ex->stack_trace;
+ } else {
+ mono_ex = NULL;
+ }
+
+
+ if (!call_filter)
+ call_filter = arch_get_call_filter ();
+
+ g_assert (jit_tls->end_of_stack);
+ g_assert (jit_tls->abort_func);
+
+ if (!test_only) {
+ MonoContext ctx_cp = *ctx;
+ setup_context (&ctx_cp);
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION handling: %s\n", mono_object_class (obj)->name);
+ if (!arch_handle_exception (&ctx_cp, obj, TRUE)) {
+ if (mono_break_on_exc)
+ G_BREAKPOINT ();
+ mono_unhandled_exception (obj);
+ }
+ }
+
+ memset (&rji, 0, sizeof (rji));
+
+ while (1) {
+ MonoContext new_ctx;
+ char *trace = NULL;
+ gboolean need_trace = FALSE;
+
+ if (test_only && (frame_count < 1000)) {
+ need_trace = TRUE;
+ if (!trace_str)
+ trace_str = g_string_new ("");
+ }
+ setup_context (&new_ctx);
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, &rji, ctx, &new_ctx,
+ need_trace ? &trace : NULL, &lmf, NULL, NULL);
+ if (!ji) {
+ g_warning ("Exception inside function without unwind info");
+ g_assert_not_reached ();
+ }
+
+ if (ji != (gpointer)-1) {
+ frame_count ++;
+
+ if (test_only && ji->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE && mono_ex) {
+ if (!initial_stack_trace && (frame_count < 1000)) {
+ trace_ips = g_list_prepend (trace_ips, MONO_CONTEXT_GET_IP (ctx));
+
+ g_string_append (trace_str, trace);
+ g_string_append_c (trace_str, '\n');
+ }
+ }
+
+ if (ji->num_clauses) {
+ int i;
+
+ g_assert (ji->clauses);
+
+ for (i = 0; i < ji->num_clauses; i++) {
+ MonoJitExceptionInfo *ei = &ji->clauses [i];
+ gboolean filtered = FALSE;
+
+ if (ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) <= ei->try_end) {
+ /* catch block */
+
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE) || (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)) {
+ /* store the exception object int cfg->excvar */
+ g_assert (ji->exvar_offset);
+ /* need to use the frame pointer (ppc_r31), not r1 (regs start from register r13): methods with clauses always have r31 */
+ *((gpointer *)((char *)(ctx->regs [ppc_r31-13]) + ji->exvar_offset)) = obj;
+ if (!initial_stack_trace && trace_str) {
+ mono_ex->stack_trace = mono_string_new (domain, trace_str->str);
+ }
+ }
+
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)
+ filtered = call_filter (ctx, ei->data.filter, mono_ex);
+
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE &&
+ mono_object_isinst (obj, ei->data.catch_class)) || filtered) {
+ if (test_only) {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ g_free (trace);
+ if (trace_str)
+ g_string_free (trace_str, TRUE);
+ return TRUE;
+ }
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION: catch found at clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
+ /*printf ("stack for catch: %p\n", MONO_CONTEXT_GET_BP (ctx));*/
+ MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
+ jit_tls->lmf = lmf;
+ g_free (trace);
+ if (trace_str)
+ g_string_free (trace_str, TRUE);
+ return 0;
+ }
+ if (!test_only && ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) < ei->try_end &&
+ (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION: finally clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
+ call_filter (ctx, ei->handler_start, NULL);
+ }
+
+ }
+ }
+ }
+ }
+
+ g_free (trace);
+
+ *ctx = new_ctx;
+ setup_context (ctx);
+
+ if ((ji == (gpointer)-1) || MONO_CONTEXT_GET_BP (ctx) >= jit_tls->end_of_stack) {
+ if (!test_only) {
+ jit_tls->lmf = lmf;
+ jit_tls->abort_func (obj);
+ g_assert_not_reached ();
+ } else {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ if (trace_str)
+ g_string_free (trace_str, TRUE);
+ return FALSE;
+ }
+ }
+ }
+
+ g_assert_not_reached ();
+}
+
+gboolean
+mono_arch_has_unwind_info (gconstpointer addr)
+{
+ return FALSE;
+}
+
diff --git a/mono/mini/exceptions-s390.c b/mono/mini/exceptions-s390.c
new file mode 100644
index 00000000000..198d585bce5
--- /dev/null
+++ b/mono/mini/exceptions-s390.c
@@ -0,0 +1,992 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - exceptions-s390.c */
+/* */
+/* Function - Exception support for S/390. */
+/* */
+/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
+/* */
+/* Date - January, 2004 */
+/* */
+/* Derivation - From exceptions-x86 & exceptions-ppc */
+/* Paolo Molaro (lupus@ximian.com) */
+/* Dietmar Maurer (dietmar@ximian.com) */
+/* */
+/* Copyright - 2001 Ximian, Inc. */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define MONO_CONTEXT_SET_IP(ctx,ip) \
+ do { \
+ (ctx)->uc_mcontext.gregs[14] = (unsigned long)ip; \
+ (ctx)->uc_mcontext.psw.addr = (unsigned long)ip; \
+ } while (0);
+
+#define MONO_CONTEXT_SET_BP(ctx,bp) \
+ do { \
+ (ctx)->uc_mcontext.gregs[15] = (unsigned long)bp; \
+ (ctx)->uc_stack.ss_sp = (unsigned long)bp; \
+ } while (0);
+
+#define MONO_CONTEXT_GET_IP(ctx) context_get_ip ((ctx))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->uc_mcontext.gregs[15]))
+
+#define S390_CALLFILTER_INTREGS S390_MINIMAL_STACK_SIZE
+#define S390_CALLFILTER_FLTREGS S390_CALLFILTER_INTREGS+(16*sizeof(gulong))
+#define S390_CALLFILTER_ACCREGS S390_CALLFILTER_FLTREGS+(16*sizeof(gdouble))
+#define S390_CALLFILTER_SIZE (S390_CALLFILTER_ACCREGS+(16*sizeof(gulong)))
+
+#define S390_THROWSTACK_ACCPRM S390_MINIMAL_STACK_SIZE
+#define S390_THROWSTACK_FPCPRM S390_THROWSTACK_ACCPRM+sizeof(gpointer)
+#define S390_THROWSTACK_RETHROW S390_THROWSTACK_FPCPRM+sizeof(gulong)
+#define S390_THROWSTACK_INTREGS S390_THROWSTACK_RETHROW+sizeof(gboolean)
+#define S390_THROWSTACK_FLTREGS S390_THROWSTACK_INTREGS+(16*sizeof(gulong))
+#define S390_THROWSTACK_ACCREGS S390_THROWSTACK_FLTREGS+(16*sizeof(gdouble))
+#define S390_THROWSTACK_SIZE (S390_THROWSTACK_ACCREGS+(16*sizeof(gulong)))
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#include <config.h>
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+#include <ucontext.h>
+
+#include <mono/arch/s390/s390-codegen.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/mono-debug.h>
+
+#include "mini.h"
+#include "mini-s390.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+typedef struct
+{
+ void *prev;
+ void *unused[5];
+ void *regs[8];
+ void *return_address;
+} MonoS390StackFrame;
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* P r o t o t y p e s */
+/*------------------------------------------------------------------*/
+
+gboolean mono_arch_handle_exception (void *ctx,
+ gpointer obj,
+ gboolean test_only);
+
+/*========================= End of Prototypes ======================*/
+
+/*------------------------------------------------------------------*/
+/* G l o b a l V a r i a b l e s */
+/*------------------------------------------------------------------*/
+
+/*====================== End of Global Variables ===================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - context_get_ip */
+/* */
+/* Function - Extract the current instruction address from the */
+/* context. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline gpointer
+context_get_ip (MonoContext *ctx)
+{
+ gpointer ip;
+
+ ip = (gpointer) ((gint32) (ctx->uc_mcontext.psw.addr) & 0x7fffffff);
+ return ip;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_has_unwind_info */
+/* */
+/* Function - Tests if a function has a DWARF exception table */
+/* that is able to restore all caller saved registers*/
+/* */
+/*------------------------------------------------------------------*/
+
+gboolean
+mono_arch_has_unwind_info (gconstpointer addr)
+{
+ return FALSE;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_call_filter */
+/* */
+/* Function - Return a pointer to a method which calls an */
+/* exception filter. We also use this function to */
+/* call finally handlers (we pass NULL as @exc */
+/* object in this case). */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+arch_get_call_filter (void)
+{
+ static guint8 start [512];
+ static int inited = 0;
+ guint8 *code;
+ int alloc_size, pos, i;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ /* call_filter (MonoContext *ctx, unsigned long eip, gpointer exc) */
+ code = start;
+
+ s390_stm (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_lr (code, s390_r14, STK_BASE);
+ alloc_size = S390_ALIGN(S390_CALLFILTER_SIZE, S390_STACK_ALIGNMENT);
+ s390_ahi (code, STK_BASE, -alloc_size);
+ s390_st (code, s390_r14, 0, STK_BASE, 0);
+
+ /*------------------------------------------------------*/
+ /* save general registers on stack */
+ /*------------------------------------------------------*/
+ s390_stm (code, s390_r0, s390_r13, STK_BASE, S390_CALLFILTER_INTREGS);
+
+ /*------------------------------------------------------*/
+ /* save floating point registers on stack */
+ /*------------------------------------------------------*/
+// pos = S390_CALLFILTER_FLTREGS;
+// for (i = 0; i < 16; ++i) {
+// s390_std (code, i, 0, STK_BASE, pos);
+// pos += sizeof (gdouble);
+// }
+
+ /*------------------------------------------------------*/
+ /* save access registers on stack */
+ /*------------------------------------------------------*/
+// s390_stam (code, s390_a0, s390_a15, STK_BASE, S390_CALLFILTER_ACCREGS);
+
+ /*------------------------------------------------------*/
+ /* Get A(Context) */
+ /*------------------------------------------------------*/
+ s390_lr (code, s390_r13, s390_r2);
+
+ /*------------------------------------------------------*/
+ /* Get A(Handler Entry Point) */
+ /*------------------------------------------------------*/
+ s390_lr (code, s390_r0, s390_r3);
+
+ /*------------------------------------------------------*/
+ /* Set parameter register with Exception */
+ /*------------------------------------------------------*/
+ s390_lr (code, s390_r2, s390_r4);
+
+ /*------------------------------------------------------*/
+ /* Load all registers with values from the context */
+ /*------------------------------------------------------*/
+ s390_lm (code, s390_r3, s390_r12, s390_r13, G_STRUCT_OFFSET(MonoContext, uc_mcontext.gregs[3]));
+ pos = G_STRUCT_OFFSET(MonoContext, uc_mcontext.fpregs.fprs[0]);
+ for (i = 0; i < 16; ++i) {
+ s390_ld (code, i, 0, s390_r13, pos);
+ pos += sizeof(gdouble);
+ }
+
+ /*------------------------------------------------------*/
+ /* Point at the copied stack frame and call the filter */
+ /*------------------------------------------------------*/
+ s390_lr (code, s390_r1, s390_r0);
+ s390_basr (code, s390_r14, s390_r1);
+
+ /*------------------------------------------------------*/
+ /* Save return value */
+ /*------------------------------------------------------*/
+ s390_lr (code, s390_r14, s390_r2);
+
+ /*------------------------------------------------------*/
+ /* Restore all the regs from the stack */
+ /*------------------------------------------------------*/
+ s390_lm (code, s390_r0, s390_r13, STK_BASE, S390_CALLFILTER_INTREGS);
+// pos = S390_CALLFILTER_FLTREGS;
+// for (i = 0; i < 16; ++i) {
+// s390_ld (code, i, 0, STK_BASE, pos);
+// pos += sizeof (gdouble);
+// }
+
+ s390_lr (code, s390_r2, s390_r14);
+// s390_lam (code, s390_a0, s390_a15, STK_BASE, S390_CALLFILTER_ACCREGS);
+ s390_ahi (code, s390_r15, alloc_size);
+ s390_lm (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (code, s390_r14);
+
+ g_assert ((code - start) < sizeof(start));
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - throw_exception. */
+/* */
+/* Function - Raise an exception based on the parameters passed.*/
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+throw_exception (MonoObject *exc, unsigned long ip, unsigned long sp,
+ gulong *int_regs, gdouble *fp_regs, gulong *acc_regs,
+ guint fpc, gboolean rethrow)
+{
+ static void (*restore_context) (MonoContext *);
+ MonoContext ctx;
+ int iReg;
+
+ memset(&ctx, 0, sizeof(ctx));
+
+ getcontext(&ctx);
+
+ /* adjust eip so that it point into the call instruction */
+ ip -= 6;
+
+ for (iReg = 0; iReg < 16; iReg++) {
+ ctx.uc_mcontext.gregs[iReg] = int_regs[iReg];
+ ctx.uc_mcontext.fpregs.fprs[iReg].d = fp_regs[iReg];
+ ctx.uc_mcontext.aregs[iReg] = acc_regs[iReg];
+ }
+
+ ctx.uc_mcontext.fpregs.fpc = fpc;
+
+ MONO_CONTEXT_SET_BP (&ctx, sp);
+ MONO_CONTEXT_SET_IP (&ctx, ip);
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ MonoException *mono_ex = (MonoException*)exc;
+ if (!rethrow)
+ mono_ex->stack_trace = NULL;
+ }
+ mono_arch_handle_exception (&ctx, exc, FALSE);
+ setcontext(&ctx);
+
+ g_assert_not_reached ();
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_throw_exception_generic */
+/* */
+/* Function - Return a function pointer which can be used to */
+/* raise exceptions. The returned function has the */
+/* following signature: */
+/* void (*func) (MonoException *exc); or, */
+/* void (*func) (char *exc_name); */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+get_throw_exception_generic (guint8 *start, int size,
+ int by_name, gboolean rethrow)
+{
+ guint8 *code;
+ int alloc_size, pos, i, offset;
+
+ code = start;
+
+ s390_stm (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ alloc_size = S390_ALIGN(S390_THROWSTACK_SIZE, S390_STACK_ALIGNMENT);
+ s390_lr (code, s390_r14, STK_BASE);
+ s390_ahi (code, STK_BASE, -alloc_size);
+ s390_st (code, s390_r14, 0, STK_BASE, 0);
+ if (by_name) {
+ s390_lr (code, s390_r4, s390_r2);
+ s390_bras (code, s390_r13, 6);
+ s390_word (code, mono_defaults.corlib);
+ s390_word (code, "System");
+ s390_l (code, s390_r2, 0, s390_r13, 0);
+ s390_l (code, s390_r3, 0, s390_r13, 4);
+ offset = (guint32) S390_RELATIVE(mono_exception_from_name, code);
+ s390_brasl(code, s390_r14, offset);
+ }
+ /*------------------------------------------------------*/
+ /* save the general registers on the stack */
+ /*------------------------------------------------------*/
+ s390_stm (code, s390_r0, s390_r13, STK_BASE, S390_THROWSTACK_INTREGS);
+
+ s390_lr (code, s390_r1, STK_BASE);
+ s390_ahi (code, s390_r1, alloc_size);
+ /*------------------------------------------------------*/
+ /* save the return address in the parameter register */
+ /*------------------------------------------------------*/
+ s390_l (code, s390_r3, 0, s390_r1, S390_RET_ADDR_OFFSET);
+
+ /*------------------------------------------------------*/
+ /* save the floating point registers */
+ /*------------------------------------------------------*/
+ pos = S390_THROWSTACK_FLTREGS;
+ for (i = 0; i < 16; ++i) {
+ s390_std (code, i, 0,STK_BASE, pos);
+ pos += sizeof (gdouble);
+ }
+ /*------------------------------------------------------*/
+ /* save the access registers */
+ /*------------------------------------------------------*/
+ s390_stam (code, s390_r0, s390_r15, STK_BASE, S390_THROWSTACK_ACCREGS);
+
+ /*------------------------------------------------------*/
+ /* call throw_exception (exc, ip, sp, gr, fr, ar) */
+ /* exc is already in place in r2 */
+ /*------------------------------------------------------*/
+ s390_lr (code, s390_r4, s390_r1); /* caller sp */
+ /*------------------------------------------------------*/
+ /* pointer to the saved int regs */
+ /*------------------------------------------------------*/
+ s390_la (code, s390_r5, 0, STK_BASE, S390_THROWSTACK_INTREGS);
+ s390_la (code, s390_r6, 0, STK_BASE, S390_THROWSTACK_FLTREGS);
+ s390_la (code, s390_r7, 0, STK_BASE, S390_THROWSTACK_ACCREGS);
+ s390_st (code, s390_r7, 0, STK_BASE, S390_THROWSTACK_ACCPRM);
+ s390_stfpc(code, STK_BASE, S390_THROWSTACK_FPCPRM);
+ s390_lhi (code, s390_r7, rethrow);
+ s390_st (code, s390_r7, 0, STK_BASE, S390_THROWSTACK_RETHROW);
+ offset = (guint32) S390_RELATIVE(throw_exception, code);
+ s390_brasl(code, s390_r14, offset);
+ /* we should never reach this breakpoint */
+ s390_break (code);
+ g_assert ((code - start) < size);
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_throw_exception */
+/* */
+/* Function - Return a function pointer which can be used to */
+/* raise exceptions. The returned function has the */
+/* following signature: */
+/* void (*func) (MonoException *exc); */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_get_throw_exception (void)
+{
+ static guint8 start [384];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ get_throw_exception_generic (start, sizeof (start), FALSE, FALSE);
+ inited = 1;
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_rethrow_exception */
+/* */
+/* Function - Return a function pointer which can be used to */
+/* raise exceptions. The returned function has the */
+/* following signature: */
+/* void (*func) (MonoException *exc); */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_get_rethrow_exception (void)
+{
+ static guint8 start [384];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ get_throw_exception_generic (start, sizeof (start), FALSE, TRUE);
+ inited = 1;
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_throw_exception_by_name */
+/* */
+/* Function - Return a function pointer which can be used to */
+/* raise corlib exceptions. The return function has */
+/* the following signature: */
+/* void (*func) (char *exc_name); */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_get_throw_exception_by_name (void)
+{
+ static guint8 start [384];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ get_throw_exception_generic (start, sizeof (start), TRUE, FALSE);
+ inited = 1;
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - glist_to_array */
+/* */
+/* Function - Convert a list to a mono array. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoArray *
+glist_to_array (GList *list)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ int len, i;
+
+ if (!list)
+ return NULL;
+
+ len = g_list_length (list);
+ res = mono_array_new (domain, mono_defaults.int_class, len);
+
+ for (i = 0; list; list = list->next, i++)
+ mono_array_set (res, gpointer, i, list->data);
+
+ return res;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_find_jit_info */
+/* */
+/* Function - This function is used to gather informatoin from */
+/* @ctx. It returns the MonoJitInfo of the corres- */
+/* ponding function, unwinds one stack frame and */
+/* stores the resulting context into @new_ctx. It */
+/* also stores a string describing the stack location*/
+/* into @trace (if not NULL), and modifies the @lmf */
+/* if necessary. @native_offset returns the IP off- */
+/* set from the start of the function or -1 if that */
+/* informatoin is not available. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoJitInfo *
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
+ MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx,
+ MonoContext *new_ctx, char **trace, MonoLMF **lmf,
+ int *native_offset, gboolean *managed)
+{
+ MonoJitInfo *ji;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+ unsigned long *ptr;
+ char *p;
+ MonoS390StackFrame *sframe;
+
+ if (prev_ji &&
+ (ip > prev_ji->code_start &&
+ ((guint8 *) ip < ((guint8 *) prev_ji->code_start) + prev_ji->code_size)))
+ ji = prev_ji;
+ else
+ ji = mono_jit_info_table_find (domain, ip);
+
+ if (trace)
+ *trace = NULL;
+
+ if (native_offset)
+ *native_offset = -1;
+
+ if (managed)
+ *managed = FALSE;
+
+ if (ji != NULL) {
+ char *source_location, *tmpaddr, *fname;
+ gint32 address, iloffset;
+ int offset;
+
+ *new_ctx = *ctx;
+
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
+
+ address = (char *)ip - (char *)ji->code_start;
+
+ if (native_offset)
+ *native_offset = address;
+
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ if (trace) {
+ source_location = mono_debug_source_location_from_address (ji->method, address, NULL, domain);
+ iloffset = mono_debug_il_offset_from_address (ji->method, address, domain);
+
+ if (iloffset < 0)
+ tmpaddr = g_strdup_printf ("<0x%08x>", address);
+ else
+ tmpaddr = g_strdup_printf ("[0x%08x]", iloffset);
+
+ fname = mono_method_full_name (ji->method, TRUE);
+
+ if (source_location)
+ *trace = g_strdup_printf ("in %s (at %s) %s", tmpaddr, source_location, fname);
+ else
+ *trace = g_strdup_printf ("in %s %s", tmpaddr, fname);
+
+ g_free (fname);
+ g_free (source_location);
+ g_free (tmpaddr);
+ }
+ sframe = (MonoS390StackFrame *) MONO_CONTEXT_GET_BP (ctx);
+ MONO_CONTEXT_SET_BP (new_ctx, sframe->prev);
+ sframe = (MonoS390StackFrame *) sframe->prev;
+ MONO_CONTEXT_SET_IP (new_ctx, sframe->return_address);
+ memcpy (&new_ctx->uc_mcontext.gregs[6], sframe->regs, (8*sizeof(gint32)));
+ *res = *ji;
+ return res;
+ } else if (*lmf) {
+
+ *new_ctx = *ctx;
+
+ if (!(*lmf)->method)
+ return (gpointer)-1;
+
+ if (trace)
+ *trace = g_strdup_printf ("in (unmanaged) %s", mono_method_full_name ((*lmf)->method, TRUE));
+
+ if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+ *res = *ji;
+ } else {
+ memset (res, 0, sizeof (MonoJitInfo));
+ res->method = (*lmf)->method;
+ }
+
+ memcpy(new_ctx->uc_mcontext.gregs, (*lmf)->gregs, sizeof((*lmf)->gregs));
+ memcpy(new_ctx->uc_mcontext.fpregs.fprs, (*lmf)->fregs, sizeof((*lmf)->fregs));
+
+ MONO_CONTEXT_SET_BP (new_ctx, (*lmf)->ebp);
+ MONO_CONTEXT_SET_IP (new_ctx, (*lmf)->eip);
+ *lmf = (*lmf)->previous_lmf;
+
+ return res;
+
+ }
+
+ return NULL;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - ves_icall_get_trace */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoArray *
+ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ MonoArray *ta = exc->trace_ips;
+ int i, len;
+
+ if (ta == NULL) {
+ return mono_array_new (domain, mono_defaults.stack_frame_class, 0);
+ }
+
+ len = mono_array_length (ta);
+
+ res = mono_array_new (domain, mono_defaults.stack_frame_class,
+ len > skip ? len - skip : 0);
+
+ for (i = skip; i < len; i++) {
+ MonoJitInfo *ji;
+ MonoStackFrame *sf = (MonoStackFrame *)mono_object_new (domain, mono_defaults.stack_frame_class);
+ gpointer ip = mono_array_get (ta, gpointer, i);
+
+ ji = mono_jit_info_table_find (domain, ip);
+ if (ji == NULL) {
+ mono_array_set (res, gpointer, i, sf);
+ continue;
+ }
+
+ sf->method = mono_method_get_object (domain, ji->method, NULL);
+ sf->native_offset = (char *)ip - (char *)ji->code_start;
+
+ sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, sf->native_offset, &sf->line, domain);
+
+ sf->filename = filename? mono_string_new (domain, filename): NULL;
+ sf->column = 0;
+
+ g_free (filename);
+ }
+
+ mono_array_set (res, gpointer, i, sf);
+ }
+
+ return res;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_jit_walk_stack */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_jit_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data) {
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ gint native_offset, il_offset;
+ gboolean managed;
+ MonoContext ctx, new_ctx;
+
+ MONO_CONTEXT_SET_IP (&ctx, __builtin_return_address (0));
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (1));
+
+ while (MONO_CONTEXT_GET_BP (&ctx) < jit_tls->end_of_stack) {
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, NULL,
+ &ctx, &new_ctx, NULL, &lmf,
+ &native_offset, &managed);
+ g_assert (ji);
+
+ if (ji == (gpointer)-1)
+ return;
+
+ il_offset = do_il_offset ? mono_debug_il_offset_from_address (ji->method, native_offset, domain): -1;
+
+ if (func (ji->method, native_offset, il_offset, managed, user_data))
+ return;
+
+ ctx = new_ctx;
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - ves_icall_get_frame_info */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoBoolean
+ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
+ MonoReflectionMethod **method,
+ gint32 *iloffset, gint32 *native_offset,
+ MonoString **file, gint32 *line, gint32 *column)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ MonoContext ctx, new_ctx;
+
+ MONO_CONTEXT_SET_IP (&ctx, ves_icall_get_frame_info);
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (0));
+
+ skip++;
+
+ do {
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, NULL,
+ &ctx, &new_ctx, NULL, &lmf,
+ native_offset, NULL);
+
+ ctx = new_ctx;
+
+ if (!ji || ji == (gpointer)-1 || MONO_CONTEXT_GET_BP (&ctx) >= jit_tls->end_of_stack)
+ return FALSE;
+
+ /* skip all wrappers ??*/
+ if (ji->method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE)
+ continue;
+
+ skip--;
+
+ } while (skip >= 0);
+
+ *method = mono_method_get_object (domain, ji->method, NULL);
+ *iloffset = mono_debug_il_offset_from_address (ji->method, *native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, *native_offset, line, domain);
+
+ *file = filename? mono_string_new (domain, filename): NULL;
+ *column = 0;
+
+ g_free (filename);
+ }
+
+ return TRUE;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_handle_exception */
+/* */
+/* Function - Handle an exception raised by the JIT code. */
+/* */
+/* Parameters - ctx - Saved processor state */
+/* obj - The exception object */
+/* test_only - Only test if the exception is caught, */
+/* but don't call handlers */
+/* */
+/*------------------------------------------------------------------*/
+
+gboolean
+mono_arch_handle_exception (void *uc, gpointer obj, gboolean test_only)
+{
+ MonoContext *ctx = uc;
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitInfo *ji, rji;
+ static int (*call_filter) (MonoContext *, gpointer, gpointer) = NULL;
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ GList *trace_ips = NULL;
+ GString *traceStr = NULL;
+ MonoException *mono_ex;
+ MonoString *initialStackTrace = NULL;
+ int frameCount = 0;
+
+ g_assert (ctx != NULL);
+ memset(&rji, 0, sizeof(rji));
+ if (!obj) {
+ MonoException *ex = mono_get_exception_null_reference ();
+ ex->message = mono_string_new (domain,
+ "Object reference not set to an instance of an object");
+ obj = (MonoObject *)ex;
+ }
+
+ if (mono_object_isinst (obj, mono_defaults.exception_class)) {
+ mono_ex = (MonoException*)obj;
+ mono_ex->stack_trace = NULL;
+ } else {
+ mono_ex = NULL;
+ }
+
+
+ if (!call_filter)
+ call_filter = arch_get_call_filter ();
+
+ g_assert (jit_tls->end_of_stack);
+ g_assert (jit_tls->abort_func);
+
+ if (!test_only) {
+ MonoContext ctx_cp = *ctx;
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION handling: %s\n", mono_object_class (obj)->name);
+ if (!mono_arch_handle_exception (&ctx_cp, obj, TRUE)) {
+ if (mono_break_on_exc)
+ G_BREAKPOINT ();
+ mono_unhandled_exception (obj);
+ }
+ }
+
+ memset (&rji, 0, sizeof(rji));
+
+ while (1) {
+ MonoContext new_ctx;
+ char *trace = NULL;
+ gboolean needTrace = FALSE;
+
+ if (test_only && (frameCount < 1000)) {
+ needTrace = TRUE;
+ if (!traceStr)
+ traceStr = g_string_new ("");
+ }
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, &rji, ctx, &new_ctx,
+ test_only ? &trace : NULL, &lmf, NULL, NULL);
+ if (!ji) {
+ g_warning ("Exception inside function without unwind info");
+ g_assert_not_reached ();
+ }
+
+ if (ji != (gpointer)-1) {
+ frameCount++;
+
+ if ((test_only) &&
+ (ji->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE) &&
+ (mono_ex)) {
+ if (!initialStackTrace && (frameCount < 1000)) {
+ trace_ips = g_list_prepend (trace_ips, MONO_CONTEXT_GET_IP (ctx));
+ g_string_append (traceStr, trace);
+ g_string_append_c (traceStr, '\n');
+ }
+ }
+
+ if (ji->num_clauses) {
+ int i;
+
+ g_assert (ji->clauses);
+
+ for (i = 0; i < ji->num_clauses; i++) {
+ MonoJitExceptionInfo *ei = &ji->clauses [i];
+ gboolean filtered = FALSE;
+
+ if (ei->try_start < MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) <= ei->try_end) {
+ /* catch block */
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE) ||
+ (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)) {
+ g_assert (ji->exvar_offset);
+ *((gpointer *)((char *)MONO_CONTEXT_GET_BP (ctx) + ji->exvar_offset)) = obj;
+ if (!initialStackTrace &&
+ traceStr) {
+ mono_ex->stack_trace = mono_string_new (domain, traceStr->str);
+ }
+ }
+
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)
+ filtered = call_filter (ctx, ei->data.filter, obj);
+
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE) &&
+ (mono_object_isinst (obj, ei->data.catch_class)) ||
+ (filtered)) {
+ if (test_only) {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ g_free (trace);
+ if (traceStr)
+ g_string_free (traceStr, TRUE);
+
+ return TRUE;
+ }
+
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION: catch found at clause %d of %s - caught at %p with sp %p\n",
+ i, mono_method_full_name (ji->method, TRUE),
+ ei->handler_start,
+ MONO_CONTEXT_GET_BP(ctx));
+ MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
+ jit_tls->lmf = lmf;
+ g_free (trace);
+ if (traceStr)
+ g_string_free (traceStr, TRUE);
+ return FALSE;
+ }
+
+ if (!test_only && ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) < ei->try_end &&
+ (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION: finally clause %d of %s handled at: %p using sp: %p\n",
+ i, mono_method_full_name (ji->method, TRUE),
+ ei->handler_start,
+ MONO_CONTEXT_GET_BP(ctx));
+ call_filter (ctx, ei->handler_start, NULL);
+ }
+
+ }
+ }
+ }
+ }
+
+ g_free (trace);
+
+ *ctx = new_ctx;
+
+ if ((ji == (gpointer)-1) ||
+ (MONO_CONTEXT_GET_BP (ctx) >= jit_tls->end_of_stack)) {
+ if (!test_only) {
+ jit_tls->lmf = lmf;
+ jit_tls->abort_func (obj);
+ g_assert_not_reached ();
+ } else {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ if (traceStr)
+ g_string_free (traceStr, TRUE);
+ return FALSE;
+ }
+ }
+ }
+
+ g_assert_not_reached ();
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_ip_from_context */
+/* */
+/* Function - Return the instruction pointer from the context. */
+/* */
+/* Parameters - sigctx - Saved processor state */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_ip_from_context (void *sigctx)
+{
+ return context_get_ip (sigctx);
+}
+
diff --git a/mono/mini/exceptions-s390x.c b/mono/mini/exceptions-s390x.c
new file mode 100644
index 00000000000..a25373c0ddd
--- /dev/null
+++ b/mono/mini/exceptions-s390x.c
@@ -0,0 +1,1113 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - exceptions-s390.c */
+/* */
+/* Function - Exception support for S/390. */
+/* */
+/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
+/* */
+/* Date - January, 2004 */
+/* */
+/* Derivation - From exceptions-x86 & exceptions-ppc */
+/* Paolo Molaro (lupus@ximian.com) */
+/* Dietmar Maurer (dietmar@ximian.com) */
+/* */
+/* Copyright - 2001 Ximian, Inc. */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define MONO_CONTEXT_SET_IP(ctx,ip) \
+ do { \
+ (ctx)->uc_mcontext.gregs[14] = (unsigned long)ip; \
+ (ctx)->uc_mcontext.psw.addr = (unsigned long)ip; \
+ } while (0);
+
+#define MONO_CONTEXT_SET_BP(ctx,bp) \
+ do { \
+ (ctx)->uc_mcontext.gregs[15] = (unsigned long)bp; \
+ (ctx)->uc_stack.ss_sp = (unsigned long)bp; \
+ } while (0);
+
+#define MONO_CONTEXT_GET_IP(ctx) context_get_ip ((ctx))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->uc_mcontext.gregs[15]))
+
+/* disable this for now */
+#undef MONO_USE_EXC_TABLES
+
+#define S390_CALLFILTER_INTREGS S390_MINIMAL_STACK_SIZE
+#define S390_CALLFILTER_FLTREGS S390_CALLFILTER_INTREGS+(16*sizeof(gulong))
+#define S390_CALLFILTER_ACCREGS S390_CALLFILTER_FLTREGS+(16*sizeof(gdouble))
+#define S390_CALLFILTER_SIZE (S390_CALLFILTER_ACCREGS+(16*sizeof(gulong)))
+
+#define S390_THROWSTACK_ACCPRM S390_MINIMAL_STACK_SIZE
+#define S390_THROWSTACK_FPCPRM S390_THROWSTACK_ACCPRM+sizeof(gpointer)
+#define S390_THROWSTACK_INTREGS S390_THROWSTACK_FPCPRM+sizeof(gulong)
+#define S390_THROWSTACK_FLTREGS S390_THROWSTACK_INTREGS+(16*sizeof(gulong))
+#define S390_THROWSTACK_ACCREGS S390_THROWSTACK_FLTREGS+(16*sizeof(gdouble))
+#define S390_THROWSTACK_SIZE (S390_THROWSTACK_ACCREGS+(16*sizeof(gulong)))
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#include <config.h>
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+#include <ucontext.h>
+
+#include <mono/arch/s390x/s390x-codegen.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/mono-debug.h>
+
+#include "mini.h"
+#include "mini-s390x.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+typedef struct
+{
+ void *prev;
+ void *unused[5];
+ void *regs[8];
+ void *return_address;
+} MonoS390StackFrame;
+
+#ifdef MONO_USE_EXC_TABLES
+
+/*************************************/
+/* STACK UNWINDING STUFF */
+/*************************************/
+
+/* These definitions are from unwind-dw2.c in glibc 2.2.5 */
+
+/* For x86 */
+#define DWARF_FRAME_REGISTERS 17
+
+typedef struct frame_state
+{
+ void *cfa;
+ void *eh_ptr;
+ long cfa_offset;
+ long args_size;
+ long reg_or_offset[DWARF_FRAME_REGISTERS+1];
+ unsigned short cfa_reg;
+ unsigned short retaddr_column;
+ char saved[DWARF_FRAME_REGISTERS+1];
+} frame_state;
+
+typedef struct frame_state * (*framesf) (void *, struct frame_state *);
+
+#endif
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* P r o t o t y p e s */
+/*------------------------------------------------------------------*/
+
+gboolean mono_arch_handle_exception (void *ctx,
+ gpointer obj,
+ gboolean test_only);
+
+/*========================= End of Prototypes ======================*/
+
+/*------------------------------------------------------------------*/
+/* G l o b a l V a r i a b l e s */
+/*------------------------------------------------------------------*/
+
+#ifdef MONO_USE_EXC_TABLES
+
+static framesf frame_state_for = NULL;
+
+static gboolean inited = FALSE;
+
+typedef char ** (*get_backtrace_symbols_type) (void *__const *__array, int __size);
+
+static get_backtrace_symbols_type get_backtrace_symbols = NULL;
+
+#endif
+
+/*====================== End of Global Variables ===================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - context_get_ip */
+/* */
+/* Function - Extract the current instruction address from the */
+/* context. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline gpointer
+context_get_ip (MonoContext *ctx)
+{
+ gpointer ip;
+
+ ip = (gpointer) ((gint32) (ctx->uc_mcontext.psw.addr) & 0x7fffffff);
+ return ip;
+}
+
+/*========================= End of Function ========================*/
+
+#ifdef MONO_USE_EXC_TABLES
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - init_frame_state_for */
+/* */
+/* Function - Load the __frame_state_for from libc. */
+/* There are two versions of __frame_state_for: one */
+/* in libgcc.a and the other in glibc.so. We need */
+/* the version from glibc. For more information, see:*/
+/* http://gcc.gnu.org/ml/gcc/2002-08/msg00192.html */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+init_frame_state_for (void)
+{
+ GModule *module;
+
+ if ((module = g_module_open ("libc.so.6", G_MODULE_BIND_LAZY))) {
+
+ if (!g_module_symbol (module, "__frame_state_for", (gpointer*)&frame_state_for))
+ frame_state_for = NULL;
+
+ if (!g_module_symbol (module, "backtrace_symbols", (gpointer*)&get_backtrace_symbols)) {
+ get_backtrace_symbols = NULL;
+ frame_state_for = NULL;
+ }
+
+ g_module_close (module);
+ }
+
+ inited = TRUE;
+}
+
+/*========================= End of Function ========================*/
+
+#endif
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_has_unwind_info */
+/* */
+/* Function - Tests if a function has a DWARF exception table */
+/* that is able to restore all caller saved registers*/
+/* */
+/*------------------------------------------------------------------*/
+
+gboolean
+mono_arch_has_unwind_info (gconstpointer addr)
+{
+ return FALSE;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - s390_unwind_native_frame */
+/* */
+/* Function - Use the context to unwind a stack frame. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoJitInfo *
+s390_unwind_native_frame (MonoDomain *domain, MonoJitTlsData *jit_tls,
+ struct sigcontext *ctx, struct sigcontext *new_ctx,
+ MonoLMF *lmf, char **trace)
+{
+#if 0
+ struct stack_frame *frame;
+ gpointer max_stack;
+ MonoJitInfo *ji;
+ struct frame_state state_in;
+ struct frame_state *res;
+
+ if (trace)
+ *trace = NULL;
+
+ if (!inited)
+ init_frame_state_for ();
+
+ if (!frame_state_for)
+ return FALSE;
+
+ frame = MONO_CONTEXT_GET_BP (ctx);
+
+ max_stack = lmf && lmf->method ? lmf : jit_tls->end_of_stack;
+
+ *new_ctx = *ctx;
+
+ memset (&state_in, 0, sizeof (state_in));
+
+ while ((gpointer)frame->next < (gpointer)max_stack) {
+ gpointer ip, addr = frame->return_address;
+ void *cfa;
+ char *tmp, **symbols;
+
+ if (trace) {
+ ip = MONO_CONTEXT_GET_IP (new_ctx);
+ symbols = get_backtrace_symbols (&ip, 1);
+ if (*trace)
+ tmp = g_strdup_printf ("%s\nin (unmanaged) %s", *trace, symbols [0]);
+ else
+ tmp = g_strdup_printf ("in (unmanaged) %s", symbols [0]);
+
+ free (symbols);
+ g_free (*trace);
+ *trace = tmp;
+ }
+
+ if ((res = frame_state_for (addr, &state_in))) {
+ int i;
+
+ cfa = (gint8*) (get_sigcontext_reg (new_ctx, res->cfa_reg) + res->cfa_offset);
+ frame = (struct stack_frame *)((gint8*)cfa - 8);
+ for (i = 0; i < DWARF_FRAME_REGISTERS + 1; i++) {
+ int how = res->saved[i];
+ long val;
+ g_assert ((how == 0) || (how == 1));
+
+ if (how == 1) {
+ val = * (long*) ((gint8*)cfa + res->reg_or_offset[i]);
+ set_sigcontext_reg (new_ctx, i, val);
+ }
+ }
+ new_ctx->SC_ESP = (long)cfa;
+
+ if (res->saved [X86_EBX] == 1 &&
+ res->saved [X86_EDI] == 1 &&
+ res->saved [X86_EBP] == 1 &&
+ res->saved [X86_ESI] == 1 &&
+ (ji = mono_jit_info_table_find (domain, frame->return_address))) {
+ //printf ("FRAME CFA %s\n", mono_method_full_name (ji->method, TRUE));
+ return ji;
+ }
+
+ } else {
+
+ MONO_CONTEXT_SET_IP (new_ctx, frame->return_address);
+ frame = frame->next;
+ MONO_CONTEXT_SET_BP (new_ctx, frame);
+
+ /* stop if !frame or when we detect an unexpected managed frame */
+ if (!frame || mono_jit_info_table_find (domain, frame->return_address)) {
+ if (trace) {
+ g_free (*trace);
+ *trace = NULL;
+ }
+ return NULL;
+ }
+ }
+ }
+
+ if (trace) {
+ g_free (*trace);
+ *trace = NULL;
+ }
+#endif
+ return NULL;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_call_filter */
+/* */
+/* Function - Return a pointer to a method which calls an */
+/* exception filter. We also use this function to */
+/* call finally handlers (we pass NULL as @exc */
+/* object in this case). */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+arch_get_call_filter (void)
+{
+ static guint8 start [512];
+ static int inited = 0;
+ guint8 *code;
+ int alloc_size, pos, i;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ /* call_filter (MonoContext *ctx, unsigned long eip, gpointer exc) */
+ code = start;
+
+ s390_stmg(code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_lgr (code, s390_r14, STK_BASE);
+ alloc_size = S390_ALIGN(S390_CALLFILTER_SIZE, S390_STACK_ALIGNMENT);
+ s390_aghi(code, STK_BASE, -alloc_size);
+ s390_stg (code, s390_r14, 0, STK_BASE, 0);
+
+ /*------------------------------------------------------*/
+ /* save general registers on stack */
+ /*------------------------------------------------------*/
+ s390_stmg(code, s390_r0, s390_r13, STK_BASE, S390_CALLFILTER_INTREGS);
+
+ /*------------------------------------------------------*/
+ /* Get A(Context) */
+ /*------------------------------------------------------*/
+ s390_lgr (code, s390_r13, s390_r2);
+
+ /*------------------------------------------------------*/
+ /* Get A(Handler Entry Point) */
+ /*------------------------------------------------------*/
+ s390_lgr (code, s390_r0, s390_r3);
+
+ /*------------------------------------------------------*/
+ /* Set parameter register with Exception */
+ /*------------------------------------------------------*/
+ s390_lgr (code, s390_r2, s390_r4);
+
+ /*------------------------------------------------------*/
+ /* Load all registers with values from the context */
+ /*------------------------------------------------------*/
+ s390_lmg (code, s390_r3, s390_r12, s390_r13, G_STRUCT_OFFSET(MonoContext, uc_mcontext.gregs[3]));
+ pos = G_STRUCT_OFFSET(MonoContext, uc_mcontext.fpregs.fprs[0]);
+ for (i = 0; i < 16; ++i) {
+ s390_ld (code, i, 0, s390_r13, pos);
+ pos += sizeof(gdouble);
+ }
+
+ /*------------------------------------------------------*/
+ /* Point at the copied stack frame and call the filter */
+ /*------------------------------------------------------*/
+ s390_lgr (code, s390_r1, s390_r0);
+ s390_basr (code, s390_r14, s390_r1);
+
+ /*------------------------------------------------------*/
+ /* Save return value */
+ /*------------------------------------------------------*/
+ s390_lgr (code, s390_r14, s390_r2);
+
+ /*------------------------------------------------------*/
+ /* Restore all the regs from the stack */
+ /*------------------------------------------------------*/
+ s390_lmg (code, s390_r0, s390_r13, STK_BASE, S390_CALLFILTER_INTREGS);
+
+ s390_lgr (code, s390_r2, s390_r14);
+ s390_aghi (code, s390_r15, alloc_size);
+ s390_lmg (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (code, s390_r14);
+
+ g_assert ((code - start) < sizeof(start));
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - throw_exception. */
+/* */
+/* Function - Raise an exception based on the parameters passed.*/
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+throw_exception (MonoObject *exc, unsigned long ip, unsigned long sp,
+ gulong *int_regs, gdouble *fp_regs, gulong *acc_regs, guint fpc)
+{
+ static void (*restore_context) (MonoContext *);
+ MonoContext ctx;
+ int iReg;
+
+ memset(&ctx, 0, sizeof(ctx));
+
+ getcontext(&ctx);
+
+ /* adjust eip so that it point into the call instruction */
+ ip -= 6;
+
+ for (iReg = 0; iReg < 16; iReg++) {
+ ctx.uc_mcontext.gregs[iReg] = int_regs[iReg];
+ ctx.uc_mcontext.fpregs.fprs[iReg].d = fp_regs[iReg];
+ ctx.uc_mcontext.aregs[iReg] = acc_regs[iReg];
+ }
+
+ ctx.uc_mcontext.fpregs.fpc = fpc;
+
+ MONO_CONTEXT_SET_BP (&ctx, sp);
+ MONO_CONTEXT_SET_IP (&ctx, ip);
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ MonoException *mono_ex = (MonoException*)exc;
+ mono_ex->stack_trace = NULL;
+ }
+ mono_arch_handle_exception (&ctx, exc, FALSE);
+ setcontext(&ctx);
+
+ g_assert_not_reached ();
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_throw_exception_generic */
+/* */
+/* Function - Return a function pointer which can be used to */
+/* raise exceptions. The returned function has the */
+/* following signature: */
+/* void (*func) (MonoException *exc); or, */
+/* void (*func) (char *exc_name); */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+mono_arch_get_throw_exception_generic (guint8 *start, int size, int by_name)
+{
+ guint8 *code;
+ int alloc_size, pos, i, offset;
+
+ code = start;
+
+ s390_stmg(code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ alloc_size = S390_ALIGN(S390_THROWSTACK_SIZE, S390_STACK_ALIGNMENT);
+ s390_lgr (code, s390_r14, STK_BASE);
+ s390_aghi (code, STK_BASE, -alloc_size);
+ s390_stg (code, s390_r14, 0, STK_BASE, 0);
+ if (by_name) {
+ s390_lgr (code, s390_r4, s390_r2);
+ s390_bras (code, s390_r13, 6);
+ s390_llong(code, mono_defaults.corlib);
+ s390_llong(code, "System");
+ s390_lg (code, s390_r2, 0, s390_r13, 0);
+ s390_lg (code, s390_r3, 0, s390_r13, 4);
+ offset = (guint32) S390_RELATIVE(mono_exception_from_name, code);
+ s390_brasl(code, s390_r14, offset);
+ }
+ /*------------------------------------------------------*/
+ /* save the general registers on the stack */
+ /*------------------------------------------------------*/
+ s390_stmg(code, s390_r0, s390_r13, STK_BASE, S390_THROWSTACK_INTREGS);
+
+ s390_lgr (code, s390_r1, STK_BASE);
+ s390_aghi(code, s390_r1, alloc_size);
+ /*------------------------------------------------------*/
+ /* save the return address in the parameter register */
+ /*------------------------------------------------------*/
+ s390_lg (code, s390_r3, 0, s390_r1, S390_RET_ADDR_OFFSET);
+
+ /*------------------------------------------------------*/
+ /* save the floating point registers */
+ /*------------------------------------------------------*/
+ pos = S390_THROWSTACK_FLTREGS;
+ for (i = 0; i < 16; ++i) {
+ s390_std (code, i, 0,STK_BASE, pos);
+ pos += sizeof (gdouble);
+ }
+ /*------------------------------------------------------*/
+ /* save the access registers */
+ /*------------------------------------------------------*/
+ s390_stam (code, s390_r0, s390_r15, STK_BASE, S390_THROWSTACK_ACCREGS);
+
+ /*------------------------------------------------------*/
+ /* call throw_exception (exc, ip, sp, gr, fr, ar) */
+ /* exc is already in place in r2 */
+ /*------------------------------------------------------*/
+ s390_lgr (code, s390_r4, s390_r1); /* caller sp */
+ /*------------------------------------------------------*/
+ /* pointer to the saved int regs */
+ /*------------------------------------------------------*/
+ s390_la (code, s390_r5, 0, STK_BASE, S390_THROWSTACK_INTREGS);
+ s390_la (code, s390_r6, 0, STK_BASE, S390_THROWSTACK_FLTREGS);
+ s390_la (code, s390_r7, 0, STK_BASE, S390_THROWSTACK_ACCREGS);
+ s390_stg (code, s390_r7, 0, STK_BASE, S390_THROWSTACK_ACCPRM);
+ s390_stfpc(code, STK_BASE, S390_THROWSTACK_FPCPRM);
+ offset = (guint32) S390_RELATIVE(throw_exception, code);
+ s390_brasl(code, s390_r14, offset);
+ /* we should never reach this breakpoint */
+ s390_break (code);
+ g_assert ((code - start) < size);
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_throw_exception */
+/* */
+/* Function - Return a function pointer which can be used to */
+/* raise exceptions. The returned function has the */
+/* following signature: */
+/* void (*func) (MonoException *exc); */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_get_throw_exception (void)
+{
+ static guint8 start [384];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ mono_arch_get_throw_exception_generic (start, sizeof (start), FALSE);
+ inited = 1;
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_throw_exception_by_name */
+/* */
+/* Function - Return a function pointer which can be used to */
+/* raise corlib exceptions. The return function has */
+/* the following signature: */
+/* void (*func) (char *exc_name); */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_get_throw_exception_by_name (void)
+{
+ static guint8 start [384];
+ static int inited = 0;
+
+ if (inited)
+ return start;
+ mono_arch_get_throw_exception_generic (start, sizeof (start), TRUE);
+ inited = 1;
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - glist_to_array */
+/* */
+/* Function - Convert a list to a mono array. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoArray *
+glist_to_array (GList *list)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ int len, i;
+
+ if (!list)
+ return NULL;
+
+ len = g_list_length (list);
+ res = mono_array_new (domain, mono_defaults.int_class, len);
+
+ for (i = 0; list; list = list->next, i++)
+ mono_array_set (res, gpointer, i, list->data);
+
+ return res;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_find_jit_info */
+/* */
+/* Function - This function is used to gather informatoin from */
+/* @ctx. It returns the MonoJitInfo of the corres- */
+/* ponding function, unwinds one stack frame and */
+/* stores the resulting context into @new_ctx. It */
+/* also stores a string describing the stack location*/
+/* into @trace (if not NULL), and modifies the @lmf */
+/* if necessary. @native_offset returns the IP off- */
+/* set from the start of the function or -1 if that */
+/* informatoin is not available. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoJitInfo *
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
+ MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx,
+ MonoContext *new_ctx, char **trace, MonoLMF **lmf,
+ int *native_offset, gboolean *managed)
+{
+ MonoJitInfo *ji;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+ unsigned long *ptr;
+ char *p;
+ MonoS390StackFrame *sframe;
+
+ if (prev_ji &&
+ (ip > prev_ji->code_start &&
+ ((guint8 *) ip < ((guint8 *) prev_ji->code_start) + prev_ji->code_size)))
+ ji = prev_ji;
+ else
+ ji = mono_jit_info_table_find (domain, ip);
+
+ if (trace)
+ *trace = NULL;
+
+ if (native_offset)
+ *native_offset = -1;
+
+ if (managed)
+ *managed = FALSE;
+
+ if (ji != NULL) {
+ char *source_location, *tmpaddr, *fname;
+ gint32 address, iloffset;
+ int offset;
+
+ *new_ctx = *ctx;
+// memcpy(new_ctx, ctx, sizeof(*new_ctx));
+
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
+
+ address = (char *)ip - (char *)ji->code_start;
+
+ if (native_offset)
+ *native_offset = address;
+
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ if (trace) {
+ source_location = mono_debug_source_location_from_address (ji->method, address, NULL, domain);
+ iloffset = mono_debug_il_offset_from_address (ji->method, address, domain);
+
+ if (iloffset < 0)
+ tmpaddr = g_strdup_printf ("<0x%08x>", address);
+ else
+ tmpaddr = g_strdup_printf ("[0x%08x]", iloffset);
+
+ fname = mono_method_full_name (ji->method, TRUE);
+
+ if (source_location)
+ *trace = g_strdup_printf ("in %s (at %s) %s", tmpaddr, source_location, fname);
+ else
+ *trace = g_strdup_printf ("in %s %s", tmpaddr, fname);
+
+ g_free (fname);
+ g_free (source_location);
+ g_free (tmpaddr);
+ }
+ sframe = (MonoS390StackFrame *) MONO_CONTEXT_GET_BP (ctx);
+ MONO_CONTEXT_SET_BP (new_ctx, sframe->prev);
+ sframe = (MonoS390StackFrame *) sframe->prev;
+ MONO_CONTEXT_SET_IP (new_ctx, sframe->return_address);
+ memcpy (&new_ctx->uc_mcontext.gregs[6], sframe->regs, (8*sizeof(gint32)));
+ *res = *ji;
+ return res;
+#ifdef MONO_USE_EXC_TABLES
+ } else if ((ji = s390_unwind_native_frame (domain, jit_tls, ctx, new_ctx, *lmf, trace))) {
+ *res = *ji;
+ return res;
+#endif
+ } else if (*lmf) {
+
+ *new_ctx = *ctx;
+
+ if (!(*lmf)->method)
+ return (gpointer)-1;
+
+ if (trace)
+ *trace = g_strdup_printf ("in (unmanaged) %s", mono_method_full_name ((*lmf)->method, TRUE));
+
+ if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+ *res = *ji;
+ } else {
+ memset (res, 0, sizeof (MonoJitInfo));
+ res->method = (*lmf)->method;
+ }
+
+/*
+ MONO_CONTEXT_SET_BP (ctx, (*lmf)->ebp);
+ MONO_CONTEXT_SET_IP (ctx, (*lmf)->eip);
+*/
+ memcpy(new_ctx->uc_mcontext.gregs, (*lmf)->gregs, sizeof((*lmf)->gregs));
+ memcpy(new_ctx->uc_mcontext.fpregs.fprs, (*lmf)->fregs, sizeof((*lmf)->fregs));
+
+ MONO_CONTEXT_SET_BP (new_ctx, (*lmf)->ebp);
+ MONO_CONTEXT_SET_IP (new_ctx, (*lmf)->eip);
+ *lmf = (*lmf)->previous_lmf;
+
+ return res;
+
+ }
+
+ return NULL;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - ves_icall_get_trace */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoArray *
+ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ MonoArray *ta = exc->trace_ips;
+ int i, len;
+
+ if (ta == NULL) {
+ return mono_array_new (domain, mono_defaults.stack_frame_class, 0);
+ }
+
+ len = mono_array_length (ta);
+
+ res = mono_array_new (domain, mono_defaults.stack_frame_class,
+ len > skip ? len - skip : 0);
+
+ for (i = skip; i < len; i++) {
+ MonoJitInfo *ji;
+ MonoStackFrame *sf = (MonoStackFrame *)mono_object_new (domain, mono_defaults.stack_frame_class);
+ gpointer ip = mono_array_get (ta, gpointer, i);
+
+ ji = mono_jit_info_table_find (domain, ip);
+ if (ji == NULL) {
+ mono_array_set (res, gpointer, i, sf);
+ continue;
+ }
+
+ sf->method = mono_method_get_object (domain, ji->method, NULL);
+ sf->native_offset = (char *)ip - (char *)ji->code_start;
+
+ sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, sf->native_offset, &sf->line, domain);
+
+ sf->filename = filename? mono_string_new (domain, filename): NULL;
+ sf->column = 0;
+
+ g_free (filename);
+ }
+
+ mono_array_set (res, gpointer, i, sf);
+ }
+
+ return res;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_jit_walk_stack */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_jit_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data) {
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ gint native_offset, il_offset;
+ gboolean managed;
+ MonoContext ctx, new_ctx;
+
+ MONO_CONTEXT_SET_IP (&ctx, __builtin_return_address (0));
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (1));
+
+ while (MONO_CONTEXT_GET_BP (&ctx) < jit_tls->end_of_stack) {
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, NULL,
+ &ctx, &new_ctx, NULL, &lmf,
+ &native_offset, &managed);
+ g_assert (ji);
+
+ if (ji == (gpointer)-1)
+ return;
+
+ il_offset = do_il_offset ? mono_debug_il_offset_from_address (ji->method, native_offset, domain): -1;
+
+ if (func (ji->method, native_offset, il_offset, managed, user_data))
+ return;
+
+ ctx = new_ctx;
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - ves_icall_get_frame_info */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoBoolean
+ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
+ MonoReflectionMethod **method,
+ gint32 *iloffset, gint32 *native_offset,
+ MonoString **file, gint32 *line, gint32 *column)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ MonoContext ctx, new_ctx;
+
+ MONO_CONTEXT_SET_IP (&ctx, ves_icall_get_frame_info);
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (0));
+
+ skip++;
+
+ do {
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, NULL,
+ &ctx, &new_ctx, NULL, &lmf,
+ native_offset, NULL);
+
+ ctx = new_ctx;
+
+ if (!ji || ji == (gpointer)-1 || MONO_CONTEXT_GET_BP (&ctx) >= jit_tls->end_of_stack)
+ return FALSE;
+
+ /* skip all wrappers ??*/
+ if (ji->method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE)
+ continue;
+
+ skip--;
+
+ } while (skip >= 0);
+
+ *method = mono_method_get_object (domain, ji->method, NULL);
+ *iloffset = mono_debug_il_offset_from_address (ji->method, *native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, *native_offset, line, domain);
+
+ *file = filename? mono_string_new (domain, filename): NULL;
+ *column = 0;
+
+ g_free (filename);
+ }
+
+ return TRUE;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_handle_exception */
+/* */
+/* Function - Handle an exception raised by the JIT code. */
+/* */
+/* Parameters - ctx - Saved processor state */
+/* obj - The exception object */
+/* test_only - Only test if the exception is caught, */
+/* but don't call handlers */
+/* */
+/*------------------------------------------------------------------*/
+
+gboolean
+mono_arch_handle_exception (void *uc, gpointer obj, gboolean test_only)
+{
+ MonoContext *ctx = uc;
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitInfo *ji, rji;
+ static int (*call_filter) (MonoContext *, gpointer, gpointer) = NULL;
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ GList *trace_ips = NULL;
+ MonoException *mono_ex;
+
+ g_assert (ctx != NULL);
+ memset(&rji, 0, sizeof(rji));
+ if (!obj) {
+ MonoException *ex = mono_get_exception_null_reference ();
+ ex->message = mono_string_new (domain,
+ "Object reference not set to an instance of an object");
+ obj = (MonoObject *)ex;
+ }
+
+ if (mono_object_isinst (obj, mono_defaults.exception_class)) {
+ mono_ex = (MonoException*)obj;
+ mono_ex->stack_trace = NULL;
+ } else {
+ mono_ex = NULL;
+ }
+
+
+ if (!call_filter)
+ call_filter = arch_get_call_filter ();
+
+ g_assert (jit_tls->end_of_stack);
+ g_assert (jit_tls->abort_func);
+
+ if (!test_only) {
+ MonoContext ctx_cp = *ctx;
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION handling: %s\n", mono_object_class (obj)->name);
+ if (!mono_arch_handle_exception (&ctx_cp, obj, TRUE)) {
+ if (mono_break_on_exc)
+ G_BREAKPOINT ();
+ mono_unhandled_exception (obj);
+ }
+ }
+
+ while (1) {
+ MonoContext new_ctx;
+ char *trace = NULL;
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, &rji, &rji, ctx, &new_ctx,
+ test_only ? &trace : NULL, &lmf, NULL, NULL);
+ if (!ji) {
+ g_warning ("Exception inside function without unwind info");
+ g_assert_not_reached ();
+ }
+
+ if (ji != (gpointer)-1) {
+
+ if (test_only && ji->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE && mono_ex) {
+ char *tmp, *strace;
+
+ trace_ips = g_list_prepend (trace_ips, MONO_CONTEXT_GET_IP (ctx));
+
+ if (!mono_ex->stack_trace)
+ strace = g_strdup ("");
+ else
+ strace = mono_string_to_utf8 (mono_ex->stack_trace);
+
+ tmp = g_strdup_printf ("%s%s\n", strace, trace);
+ g_free (strace);
+
+ mono_ex->stack_trace = mono_string_new (domain, tmp);
+
+ g_free (tmp);
+ }
+
+ if (ji->num_clauses) {
+ int i;
+
+ g_assert (ji->clauses);
+
+ for (i = 0; i < ji->num_clauses; i++) {
+ MonoJitExceptionInfo *ei = &ji->clauses [i];
+
+ if (ei->try_start < MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) <= ei->try_end) {
+ /* catch block */
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE &&
+ mono_object_isinst (obj, ei->data.catch_class)) ||
+ ((ei->flags == MONO_EXCEPTION_CLAUSE_FILTER &&
+ call_filter (ctx, ei->data.filter, obj)))) {
+ if (test_only) {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ g_free (trace);
+ return TRUE;
+ }
+// memcpy(ctx, &new_ctx, sizeof(new_ctx));
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION: catch found at clause %d of %s - caught at %p with sp %p\n",
+ i, mono_method_full_name (ji->method, TRUE),
+ ei->handler_start,
+ MONO_CONTEXT_GET_BP(ctx));
+ MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
+ *((gpointer *)((char *)MONO_CONTEXT_GET_BP (ctx) + ji->exvar_offset)) = obj;
+ jit_tls->lmf = lmf;
+ g_free (trace);
+ return 0;
+ }
+ if (!test_only && ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) < ei->try_end &&
+ (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION: finally clause %d of %s handled at: %p using sp: %p\n",
+ i, mono_method_full_name (ji->method, TRUE),
+ ei->handler_start,
+ MONO_CONTEXT_GET_BP(ctx));
+ call_filter (ctx, ei->handler_start, NULL);
+ }
+
+ }
+ }
+ }
+ }
+
+ g_free (trace);
+
+ *ctx = new_ctx;
+
+ if ((ji == (gpointer)-1) || MONO_CONTEXT_GET_BP (ctx) >= jit_tls->end_of_stack) {
+ if (!test_only) {
+ jit_tls->lmf = lmf;
+ jit_tls->abort_func (obj);
+ g_assert_not_reached ();
+ } else {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ return FALSE;
+ }
+ }
+ }
+
+ g_assert_not_reached ();
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_ip_from_context */
+/* */
+/* Function - Return the instruction pointer from the context. */
+/* */
+/* Parameters - sigctx - Saved processor state */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_ip_from_context (void *sigctx)
+{
+ return context_get_ip (sigctx);
+}
+
diff --git a/mono/mini/exceptions-sparc.c b/mono/mini/exceptions-sparc.c
new file mode 100644
index 00000000000..a89db5df0dc
--- /dev/null
+++ b/mono/mini/exceptions-sparc.c
@@ -0,0 +1,414 @@
+/*
+ * exceptions-sparc.c: exception support for sparc
+ *
+ * Authors:
+ * Mark Crichton (crichton@gimp.org)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/ucontext.h>
+
+#include <mono/arch/sparc/sparc-codegen.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/gc-internal.h>
+
+#include "mini.h"
+#include "mini-sparc.h"
+
+#ifndef REG_SP
+#define REG_SP REG_O6
+#endif
+
+#define MONO_SPARC_WINDOW_ADDR(sp) ((gpointer*)(((guint8*)(sp)) + MONO_SPARC_STACK_BIAS))
+
+/*
+ * mono_arch_get_restore_context:
+ *
+ * Returns a pointer to a method which restores a previously saved sigcontext.
+ */
+gpointer
+mono_arch_get_restore_context (void)
+{
+ static guint32 start [32];
+ static int inited = 0;
+ guint32 *code;
+
+ if (inited)
+ return start;
+
+ code = start;
+
+ sparc_ldi_imm (code, sparc_o0, G_STRUCT_OFFSET (MonoContext, ip), sparc_i7);
+ sparc_ldi_imm (code, sparc_o0, G_STRUCT_OFFSET (MonoContext, sp), sparc_i6);
+
+ sparc_jmpl_imm (code, sparc_i7, 0, sparc_g0);
+ /* FIXME: This does not return to the correct window */
+ sparc_restore_imm (code, sparc_g0, 0, sparc_g0);
+
+ g_assert ((code - start) < 32);
+
+ inited = 1;
+
+ return start;
+}
+
+/*
+ * mono_arch_get_call_filter:
+ *
+ * Returns a pointer to a method which calls an exception filter. We
+ * also use this function to call finally handlers (we pass NULL as
+ * @exc object in this case).
+ *
+ * call_filter (MonoContext *ctx, gpointer ip)
+ */
+gpointer
+mono_arch_get_call_filter (void)
+{
+ static guint32 start [64];
+ static int inited = 0;
+ guint32 *code;
+ int i;
+
+ if (inited)
+ return start;
+
+ code = start;
+
+ /*
+ * There are two frames here:
+ * - the first frame is used by call_filter
+ * - the second frame is used to run the filter code
+ */
+
+ /* Create first frame */
+ sparc_save_imm (code, sparc_sp, -256, sparc_sp);
+
+ sparc_mov_reg_reg (code, sparc_i1, sparc_o0);
+ sparc_ldi_imm (code, sparc_i0, G_STRUCT_OFFSET (MonoContext, sp), sparc_o1);
+
+ /* Create second frame */
+ sparc_save_imm (code, sparc_sp, -256, sparc_sp);
+
+ sparc_mov_reg_reg (code, sparc_i0, sparc_o0);
+ sparc_mov_reg_reg (code, sparc_i1, sparc_o1);
+
+ /*
+ * We need to change %fp to point to the stack frame of the method
+ * containing the filter. But changing %fp also changes the %sp of
+ * the parent frame (the first frame), so if the OS saves the first frame,
+ * it saves it to the stack frame of the method, which is not good.
+ * So flush all register windows to memory before changing %fp.
+ */
+ sparc_flushw (code);
+
+ sparc_mov_reg_reg (code, sparc_fp, sparc_o7);
+
+ /*
+ * Modify the second frame so it is identical to the one used in the
+ * method containing the filter.
+ */
+ for (i = 0; i < 16; ++i)
+ sparc_ldi_imm (code, sparc_o1, MONO_SPARC_STACK_BIAS + i * sizeof (gpointer), sparc_l0 + i);
+
+ /* Save %fp to a location reserved in mono_arch_allocate_vars */
+ sparc_sti_imm (code, sparc_o7, sparc_fp, MONO_SPARC_STACK_BIAS - sizeof (gpointer));
+
+ /* Call the filter code, after this returns, %o0 will hold the result */
+ sparc_call_imm (code, sparc_o0, 0);
+ sparc_nop (code);
+
+ /* Restore original %fp */
+ sparc_ldi_imm (code, sparc_fp, MONO_SPARC_STACK_BIAS - sizeof (gpointer), sparc_fp);
+
+ sparc_mov_reg_reg (code, sparc_o0, sparc_i0);
+
+ /* Return to first frame */
+ sparc_restore (code, sparc_g0, sparc_g0, sparc_g0);
+
+ /* FIXME: Save locals to the stack */
+
+ /* Return to caller */
+ sparc_ret (code);
+ /* Return result in delay slot */
+ sparc_restore (code, sparc_o0, sparc_g0, sparc_o0);
+
+ g_assert ((code - start) < 64);
+
+ inited = 1;
+
+ return start;
+}
+
+static void
+throw_exception (MonoObject *exc, gpointer sp, gpointer ip, gboolean rethrow)
+{
+ MonoContext ctx;
+ static void (*restore_context) (MonoContext *);
+ gpointer *window;
+
+ if (!restore_context)
+ restore_context = mono_arch_get_restore_context ();
+
+ window = MONO_SPARC_WINDOW_ADDR (sp);
+ ctx.sp = (gpointer*)sp;
+ ctx.ip = ip;
+ ctx.fp = (gpointer*)(MONO_SPARC_WINDOW_ADDR (sp) [sparc_i6 - 16]);
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ MonoException *mono_ex = (MonoException*)exc;
+ if (!rethrow)
+ mono_ex->stack_trace = NULL;
+ }
+ mono_handle_exception (&ctx, exc, ip, FALSE);
+ restore_context (&ctx);
+
+ g_assert_not_reached ();
+}
+
+static gpointer
+get_throw_exception (gboolean rethrow)
+{
+ guint32 *start, *code;
+
+ code = start = g_malloc (16 * sizeof (guint32));
+
+ sparc_save_imm (code, sparc_sp, -512, sparc_sp);
+
+ sparc_flushw (code);
+ sparc_mov_reg_reg (code, sparc_i0, sparc_o0);
+ sparc_mov_reg_reg (code, sparc_fp, sparc_o1);
+ sparc_mov_reg_reg (code, sparc_i7, sparc_o2);
+ sparc_set (code, rethrow, sparc_o3);
+ sparc_set (code, throw_exception, sparc_o7);
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_callsite);
+ sparc_nop (code);
+
+ g_assert ((code - start) <= 16);
+
+ return start;
+}
+
+/**
+ * mono_arch_get_throw_exception:
+ *
+ * Returns a function pointer which can be used to raise exceptions.
+ * The returned function has the following
+ * signature: void (*func) (MonoException *exc);
+ */
+gpointer
+mono_arch_get_throw_exception (void)
+{
+ static guint32* start;
+ static int inited = 0;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+
+ start = get_throw_exception (FALSE);
+
+ return start;
+}
+
+gpointer
+mono_arch_get_rethrow_exception (void)
+{
+ static guint32* start;
+ static int inited = 0;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+
+ start = get_throw_exception (TRUE);
+
+ return start;
+}
+
+/**
+ * mono_arch_get_throw_exception_by_name:
+ *
+ * Returns a function pointer which can be used to raise
+ * corlib exceptions. The returned function has the following
+ * signature: void (*func) (char *exc_name, gpointer ip);
+ */
+gpointer
+mono_arch_get_throw_exception_by_name (void)
+{
+ static guint32 start [64];
+ static int inited = 0;
+ guint32 *code;
+ int reg;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ code = start;
+
+#ifdef SPARCV9
+ reg = sparc_g4;
+#else
+ reg = sparc_g1;
+#endif
+
+ sparc_save_imm (code, sparc_sp, -160, sparc_sp);
+
+ sparc_mov_reg_reg (code, sparc_i0, sparc_o2);
+ sparc_set (code, mono_defaults.corlib, sparc_o0);
+ sparc_set (code, "System", sparc_o1);
+ sparc_set (code, mono_exception_from_name, sparc_o7);
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_callsite);
+ sparc_nop (code);
+
+ /* Return to the caller, so exception handling does not see this frame */
+ sparc_restore (code, sparc_o0, sparc_g0, sparc_o0);
+
+ /* Put original return address into %o7 */
+ sparc_mov_reg_reg (code, sparc_o1, sparc_o7);
+ sparc_set (code, mono_arch_get_throw_exception (), reg);
+ /* Use a jmp instead of a call so o7 is preserved */
+ sparc_jmpl_imm (code, reg, 0, sparc_g0);
+ sparc_nop (code);
+
+ g_assert ((code - start) < 32);
+
+ return start;
+}
+
+/* mono_arch_find_jit_info:
+ *
+ * This function is used to gather information from @ctx. It return the
+ * MonoJitInfo of the corresponding function, unwinds one stack frame and
+ * stores the resulting context into @new_ctx. It also stores a string
+ * describing the stack location into @trace (if not NULL), and modifies
+ * the @lmf if necessary. @native_offset return the IP offset from the
+ * start of the function or -1 if that info is not available.
+ */
+MonoJitInfo *
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx,
+ MonoContext *new_ctx, char **trace, MonoLMF **lmf, int *native_offset,
+ gboolean *managed)
+{
+ MonoJitInfo *ji;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+ gpointer *window;
+
+ /* Avoid costly table lookup during stack overflow */
+ if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
+ ji = prev_ji;
+ else
+ ji = mono_jit_info_table_find (domain, ip);
+
+ if (managed)
+ *managed = FALSE;
+
+ if (ji != NULL) {
+ *new_ctx = *ctx;
+
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
+
+ /* Restore ip and sp from the saved register window */
+ window = MONO_SPARC_WINDOW_ADDR (ctx->sp);
+ new_ctx->ip = window [sparc_i7 - 16];
+ new_ctx->sp = (gpointer*)(window [sparc_i6 - 16]);
+ new_ctx->fp = (gpointer*)(MONO_SPARC_WINDOW_ADDR (new_ctx->sp) [sparc_i6 - 16]);
+
+ *res = *ji;
+ return res;
+ }
+ else {
+ if (!(*lmf))
+ return NULL;
+
+ *new_ctx = *ctx;
+
+ if (!(*lmf)->method)
+ return (gpointer)-1;
+
+ if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->ip))) {
+ *res = *ji;
+ } else {
+ memset (res, 0, sizeof (MonoJitInfo));
+ res->method = (*lmf)->method;
+ }
+
+ new_ctx->ip = (*lmf)->ip;
+ new_ctx->sp = (*lmf)->sp;
+ new_ctx->fp = (*lmf)->ebp;
+
+ *lmf = (*lmf)->previous_lmf;
+
+ return res;
+ }
+}
+
+gboolean
+mono_arch_has_unwind_info (gconstpointer addr)
+{
+ return FALSE;
+}
+
+gboolean
+mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
+{
+ MonoContext mctx;
+ ucontext_t *ctx = (ucontext_t*)sigctx;
+ gpointer *window;
+
+ /*
+ * Access to the machine state using the ucontext_t parameter is somewhat
+ * under documented under solaris. The code below seems to work under
+ * Solaris 9.
+ */
+#ifndef __linux__
+ g_assert (!ctx->uc_mcontext.gwins);
+#else
+ /* better, but doesn't work all the time. need to rethink! */
+ g_assert (!ctx->uc_mcontext.gregs);
+#endif
+
+ mctx.ip = ctx->uc_mcontext.gregs [REG_PC];
+ mctx.sp = ctx->uc_mcontext.gregs [REG_SP];
+ window = (gpointer*)(((guint8*)mctx.sp) + MONO_SPARC_STACK_BIAS);
+ mctx.fp = window [sparc_fp - 16];
+
+ mono_handle_exception (&mctx, obj, mctx.ip, test_only);
+
+ /* We can't use restore_context to return from a signal handler */
+ ctx->uc_mcontext.gregs [REG_PC] = mctx.ip;
+ ctx->uc_mcontext.gregs [REG_nPC] = mctx.ip + 4;
+ ctx->uc_mcontext.gregs [REG_SP] = mctx.sp;
+ window = (gpointer*)(((guint8*)mctx.sp) + MONO_SPARC_STACK_BIAS);
+ window [sparc_fp - 16] = mctx.fp;
+
+ return TRUE;
+}
+
+gpointer
+mono_arch_ip_from_context (void *sigctx)
+{
+ ucontext_t *ctx = (ucontext_t*)sigctx;
+ return (gpointer)ctx->uc_mcontext.gregs [REG_PC];
+}
+
diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c
new file mode 100644
index 00000000000..00cf4f8b99b
--- /dev/null
+++ b/mono/mini/exceptions-x86.c
@@ -0,0 +1,527 @@
+/*
+ * exceptions-x86.c: exception support for x86
+ *
+ * Authors:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+
+#include <mono/arch/x86/x86-codegen.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#include "mini.h"
+#include "mini-x86.h"
+
+#ifdef PLATFORM_WIN32
+static MonoW32ExceptionHandler fpe_handler;
+static MonoW32ExceptionHandler ill_handler;
+static MonoW32ExceptionHandler segv_handler;
+
+static LPTOP_LEVEL_EXCEPTION_FILTER old_handler;
+
+#define W32_SEH_HANDLE_EX(_ex) \
+ if (_ex##_handler) _ex##_handler((int)sctx)
+
+/*
+ * Unhandled Exception Filter
+ * Top-level per-process exception handler.
+ */
+LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep)
+{
+ EXCEPTION_RECORD* er;
+ CONTEXT* ctx;
+ struct sigcontext* sctx;
+ LONG res;
+
+ res = EXCEPTION_CONTINUE_EXECUTION;
+
+ er = ep->ExceptionRecord;
+ ctx = ep->ContextRecord;
+ sctx = g_malloc(sizeof(struct sigcontext));
+
+ /* Copy Win32 context to UNIX style context */
+ sctx->eax = ctx->Eax;
+ sctx->ebx = ctx->Ebx;
+ sctx->ecx = ctx->Ecx;
+ sctx->edx = ctx->Edx;
+ sctx->ebp = ctx->Ebp;
+ sctx->esp = ctx->Esp;
+ sctx->esi = ctx->Esi;
+ sctx->edi = ctx->Edi;
+ sctx->eip = ctx->Eip;
+
+ switch (er->ExceptionCode) {
+ case EXCEPTION_ACCESS_VIOLATION:
+ W32_SEH_HANDLE_EX(segv);
+ break;
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ W32_SEH_HANDLE_EX(ill);
+ break;
+ case EXCEPTION_INT_DIVIDE_BY_ZERO:
+ case EXCEPTION_INT_OVERFLOW:
+ case EXCEPTION_FLT_DIVIDE_BY_ZERO:
+ case EXCEPTION_FLT_OVERFLOW:
+ case EXCEPTION_FLT_UNDERFLOW:
+ case EXCEPTION_FLT_INEXACT_RESULT:
+ W32_SEH_HANDLE_EX(fpe);
+ break;
+ default:
+ break;
+ }
+
+ /* Copy context back */
+ ctx->Eax = sctx->eax;
+ ctx->Ebx = sctx->ebx;
+ ctx->Ecx = sctx->ecx;
+ ctx->Edx = sctx->edx;
+ ctx->Ebp = sctx->ebp;
+ ctx->Esp = sctx->esp;
+ ctx->Esi = sctx->esi;
+ ctx->Edi = sctx->edi;
+ ctx->Eip = sctx->eip;
+
+ return res;
+}
+
+void win32_seh_init()
+{
+ old_handler = SetUnhandledExceptionFilter(seh_handler);
+}
+
+void win32_seh_cleanup()
+{
+ if (old_handler) SetUnhandledExceptionFilter(old_handler);
+}
+
+void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler)
+{
+ switch (type) {
+ case SIGFPE:
+ fpe_handler = handler;
+ break;
+ case SIGILL:
+ ill_handler = handler;
+ break;
+ case SIGSEGV:
+ segv_handler = handler;
+ break;
+ default:
+ break;
+ }
+}
+
+#endif /* PLATFORM_WIN32 */
+
+/*
+ * mono_arch_get_restore_context:
+ *
+ * Returns a pointer to a method which restores a previously saved sigcontext.
+ */
+gpointer
+mono_arch_get_restore_context (void)
+{
+ static guint8 *start = NULL;
+ guint8 *code;
+
+ if (start)
+ return start;
+
+ /* restore_contect (struct sigcontext *ctx) */
+ /* we do not restore X86_EAX, X86_EDX */
+
+ start = code = g_malloc (1024);
+
+ /* load ctx */
+ x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4);
+
+ /* get return address, stored in EDX */
+ x86_mov_reg_membase (code, X86_EDX, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EIP), 4);
+ /* restore EBX */
+ x86_mov_reg_membase (code, X86_EBX, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EBX), 4);
+ /* restore EDI */
+ x86_mov_reg_membase (code, X86_EDI, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EDI), 4);
+ /* restore ESI */
+ x86_mov_reg_membase (code, X86_ESI, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_ESI), 4);
+ /* restore ESP */
+ x86_mov_reg_membase (code, X86_ESP, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_ESP), 4);
+ /* restore EBP */
+ x86_mov_reg_membase (code, X86_EBP, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EBP), 4);
+
+ /* jump to the saved IP */
+ x86_jump_reg (code, X86_EDX);
+
+ return start;
+}
+
+/*
+ * mono_arch_get_call_filter:
+ *
+ * Returns a pointer to a method which calls an exception filter. We
+ * also use this function to call finally handlers (we pass NULL as
+ * @exc object in this case).
+ */
+gpointer
+mono_arch_get_call_filter (void)
+{
+ static guint8 start [64];
+ static int inited = 0;
+ guint8 *code;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ /* call_filter (struct sigcontext *ctx, unsigned long eip) */
+ code = start;
+
+ x86_push_reg (code, X86_EBP);
+ x86_mov_reg_reg (code, X86_EBP, X86_ESP, 4);
+ x86_push_reg (code, X86_EBX);
+ x86_push_reg (code, X86_EDI);
+ x86_push_reg (code, X86_ESI);
+
+ /* load ctx */
+ x86_mov_reg_membase (code, X86_EAX, X86_EBP, 8, 4);
+ /* load eip */
+ x86_mov_reg_membase (code, X86_ECX, X86_EBP, 12, 4);
+ /* save EBP */
+ x86_push_reg (code, X86_EBP);
+
+ /* set new EBP */
+ x86_mov_reg_membase (code, X86_EBP, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EBP), 4);
+ /* restore registers used by global register allocation (EBX & ESI) */
+ x86_mov_reg_membase (code, X86_EBX, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EBX), 4);
+ x86_mov_reg_membase (code, X86_ESI, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_ESI), 4);
+ x86_mov_reg_membase (code, X86_EDI, X86_EAX, G_STRUCT_OFFSET (struct sigcontext, SC_EDI), 4);
+
+ /* call the handler */
+ x86_call_reg (code, X86_ECX);
+
+ /* restore EBP */
+ x86_pop_reg (code, X86_EBP);
+
+ /* restore saved regs */
+ x86_pop_reg (code, X86_ESI);
+ x86_pop_reg (code, X86_EDI);
+ x86_pop_reg (code, X86_EBX);
+ x86_leave (code);
+ x86_ret (code);
+
+ g_assert ((code - start) < 64);
+ return start;
+}
+
+static void
+throw_exception (unsigned long eax, unsigned long ecx, unsigned long edx, unsigned long ebx,
+ unsigned long esi, unsigned long edi, unsigned long ebp, MonoObject *exc,
+ unsigned long eip, unsigned long esp, gboolean rethrow)
+{
+ static void (*restore_context) (struct sigcontext *);
+ struct sigcontext ctx;
+
+ if (!restore_context)
+ restore_context = mono_arch_get_restore_context ();
+
+ /* Pop argument and return address */
+ ctx.SC_ESP = esp + (2 * sizeof (gpointer));
+ ctx.SC_EIP = eip;
+ ctx.SC_EBP = ebp;
+ ctx.SC_EDI = edi;
+ ctx.SC_ESI = esi;
+ ctx.SC_EBX = ebx;
+ ctx.SC_EDX = edx;
+ ctx.SC_ECX = ecx;
+ ctx.SC_EAX = eax;
+
+ if (mono_debugger_throw_exception ((gpointer)(eip - 5), (gpointer)esp, exc)) {
+ /*
+ * The debugger wants us to stop on the `throw' instruction.
+ * By the time we get here, it already inserted a breakpoint on
+ * eip - 5 (which is the address of the call).
+ */
+ ctx.SC_EIP = eip - 5;
+ ctx.SC_ESP = esp + sizeof (gpointer);
+ restore_context (&ctx);
+ g_assert_not_reached ();
+ }
+
+ /* adjust eip so that it point into the call instruction */
+ ctx.SC_EIP -= 1;
+
+ if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+ MonoException *mono_ex = (MonoException*)exc;
+ if (!rethrow)
+ mono_ex->stack_trace = NULL;
+ }
+ mono_handle_exception (&ctx, exc, (gpointer)eip, FALSE);
+ restore_context (&ctx);
+
+ g_assert_not_reached ();
+}
+
+static guint8*
+get_throw_exception (gboolean rethrow)
+{
+ guint8 *start, *code;
+
+ start = code = g_malloc (64);
+
+ x86_push_reg (code, X86_ESP);
+ x86_push_membase (code, X86_ESP, 4); /* IP */
+ x86_push_membase (code, X86_ESP, 12); /* exception */
+ x86_push_reg (code, X86_EBP);
+ x86_push_reg (code, X86_EDI);
+ x86_push_reg (code, X86_ESI);
+ x86_push_reg (code, X86_EBX);
+ x86_push_reg (code, X86_EDX);
+ x86_push_reg (code, X86_ECX);
+ x86_push_reg (code, X86_EAX);
+ x86_call_code (code, throw_exception);
+ /* we should never reach this breakpoint */
+ x86_breakpoint (code);
+
+ g_assert ((code - start) < 64);
+
+ return start;
+}
+
+/**
+ * mono_arch_get_throw_exception:
+ *
+ * Returns a function pointer which can be used to raise
+ * exceptions. The returned function has the following
+ * signature: void (*func) (MonoException *exc);
+ * For example to raise an arithmetic exception you can use:
+ *
+ * x86_push_imm (code, mono_get_exception_arithmetic ());
+ * x86_call_code (code, arch_get_throw_exception ());
+ *
+ */
+gpointer
+mono_arch_get_throw_exception (void)
+{
+ static guint8 *start;
+ static int inited = 0;
+
+ if (inited)
+ return start;
+
+ start = get_throw_exception (FALSE);
+
+ inited = 1;
+
+ return start;
+}
+
+gpointer
+mono_arch_get_rethrow_exception (void)
+{
+ static guint8 *start;
+ static int inited = 0;
+
+ if (inited)
+ return start;
+
+ start = get_throw_exception (TRUE);
+
+ inited = 1;
+
+ return start;
+}
+
+/**
+ * mono_arch_get_throw_exception_by_name:
+ *
+ * Returns a function pointer which can be used to raise
+ * corlib exceptions. The returned function has the following
+ * signature: void (*func) (char *exc_name);
+ * For example to raise an arithmetic exception you can use:
+ *
+ * x86_push_imm (code, "ArithmeticException");
+ * x86_call_code (code, arch_get_throw_exception_by_name ());
+ *
+ */
+gpointer
+mono_arch_get_throw_exception_by_name (void)
+{
+ static guint8 start [32];
+ static int inited = 0;
+ guint8 *code;
+
+ if (inited)
+ return start;
+
+ inited = 1;
+ code = start;
+
+ x86_push_membase (code, X86_ESP, 4); /* exception name */
+ x86_push_imm (code, "System");
+ x86_push_imm (code, mono_defaults.exception_class->image);
+ x86_call_code (code, mono_exception_from_name);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 12);
+ /* save the newly create object (overwrite exception name)*/
+ x86_mov_membase_reg (code, X86_ESP, 4, X86_EAX, 4);
+ x86_jump_code (code, mono_arch_get_throw_exception ());
+
+ g_assert ((code - start) < 32);
+
+ return start;
+}
+
+/* mono_arch_find_jit_info:
+ *
+ * This function is used to gather information from @ctx. It return the
+ * MonoJitInfo of the corresponding function, unwinds one stack frame and
+ * stores the resulting context into @new_ctx. It also stores a string
+ * describing the stack location into @trace (if not NULL), and modifies
+ * the @lmf if necessary. @native_offset return the IP offset from the
+ * start of the function or -1 if that info is not available.
+ */
+MonoJitInfo *
+mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx,
+ MonoContext *new_ctx, char **trace, MonoLMF **lmf, int *native_offset,
+ gboolean *managed)
+{
+ MonoJitInfo *ji;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+
+ /* Avoid costly table lookup during stack overflow */
+ if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
+ ji = prev_ji;
+ else
+ ji = mono_jit_info_table_find (domain, ip);
+
+ if (managed)
+ *managed = FALSE;
+
+ if (ji != NULL) {
+ int offset;
+
+ *new_ctx = *ctx;
+
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ /*
+ * Some managed methods like pinvoke wrappers might have save_lmf set.
+ * In this case, register save/restore code is not generated by the
+ * JIT, so we have to restore callee saved registers from the lmf.
+ */
+ if (ji->method->save_lmf) {
+ /*
+ * We only need to do this if the exception was raised in managed
+ * code, since otherwise the lmf was already popped of the stack.
+ */
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ new_ctx->SC_ESI = (*lmf)->esi;
+ new_ctx->SC_EDI = (*lmf)->edi;
+ new_ctx->SC_EBX = (*lmf)->ebx;
+ }
+ }
+ else {
+ offset = -1;
+ /* restore caller saved registers */
+ if (ji->used_regs & X86_EBX_MASK) {
+ new_ctx->SC_EBX = *((int *)ctx->SC_EBP + offset);
+ offset--;
+ }
+ if (ji->used_regs & X86_EDI_MASK) {
+ new_ctx->SC_EDI = *((int *)ctx->SC_EBP + offset);
+ offset--;
+ }
+ if (ji->used_regs & X86_ESI_MASK) {
+ new_ctx->SC_ESI = *((int *)ctx->SC_EBP + offset);
+ }
+ }
+
+ if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+ /* remove any unused lmf */
+ *lmf = (*lmf)->previous_lmf;
+ }
+
+ /* Pop EBP and the return address */
+ new_ctx->SC_ESP = ctx->SC_EBP + (2 * sizeof (gpointer));
+ /* we substract 1, so that the IP points into the call instruction */
+ new_ctx->SC_EIP = *((int *)ctx->SC_EBP + 1) - 1;
+ new_ctx->SC_EBP = *((int *)ctx->SC_EBP);
+
+ /* Pop arguments off the stack */
+ {
+ MonoJitArgumentInfo *arg_info = alloca (sizeof (MonoJitArgumentInfo) * (ji->method->signature->param_count + 1));
+
+ guint32 stack_to_pop = mono_arch_get_argument_info (ji->method->signature, ji->method->signature->param_count, arg_info);
+ new_ctx->SC_ESP += stack_to_pop;
+ }
+
+ *res = *ji;
+ return res;
+#ifdef MONO_USE_EXC_TABLES
+ } else if ((ji = x86_unwind_native_frame (domain, jit_tls, ctx, new_ctx, *lmf, trace))) {
+ *res = *ji;
+ return res;
+#endif
+ } else if (*lmf) {
+
+ *new_ctx = *ctx;
+
+ if (!(*lmf)->method)
+ return (gpointer)-1;
+
+ if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+ *res = *ji;
+ } else {
+ memset (res, 0, sizeof (MonoJitInfo));
+ res->method = (*lmf)->method;
+ }
+
+ new_ctx->SC_ESI = (*lmf)->esi;
+ new_ctx->SC_EDI = (*lmf)->edi;
+ new_ctx->SC_EBX = (*lmf)->ebx;
+ new_ctx->SC_EBP = (*lmf)->ebp;
+ new_ctx->SC_EIP = (*lmf)->eip;
+ /* the lmf is always stored on the stack, so the following
+ * expression points to a stack location which can be used as ESP */
+ new_ctx->SC_ESP = (unsigned long)&((*lmf)->eip);
+
+ *lmf = (*lmf)->previous_lmf;
+
+ return res;
+
+ }
+
+ return NULL;
+}
+
+/**
+ * mono_arch_handle_exception:
+ *
+ * @ctx: saved processor state
+ * @obj: the exception object
+ */
+gboolean
+mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
+{
+ return mono_handle_exception (sigctx, obj, mono_arch_ip_from_context (sigctx), test_only);
+}
+
+gpointer
+mono_arch_ip_from_context (void *sigctx)
+{
+ struct sigcontext *ctx = sigctx;
+ return (gpointer)ctx->SC_EIP;
+}
+
diff --git a/mono/mini/exceptions.cs b/mono/mini/exceptions.cs
new file mode 100644
index 00000000000..4dfd149ec3f
--- /dev/null
+++ b/mono/mini/exceptions.cs
@@ -0,0 +1,2168 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static int test_0_catch () {
+ Exception x = new Exception ();
+
+ try {
+ throw x;
+ } catch (Exception e) {
+ if (e == x)
+ return 0;
+ }
+ return 1;
+ }
+
+ static int test_0_finally_without_exc () {
+ int x;
+
+ try {
+ x = 1;
+ } catch (Exception e) {
+ x = 2;
+ } finally {
+ x = 0;
+ }
+
+ return x;
+ }
+
+ static int test_0_finally () {
+ int x = 1;
+
+ try {
+ throw new Exception ();
+ } catch (Exception e) {
+ x = 2;
+ } finally {
+ x = 0;
+ }
+ return x;
+ }
+
+ static int test_0_nested_finally () {
+ int a;
+
+ try {
+ a = 1;
+ } finally {
+ try {
+ a = 2;
+ } finally {
+ a = 0;
+ }
+ }
+ return a;
+ }
+
+ static int test_0_byte_cast () {
+ int a;
+ long l;
+ ulong ul;
+ byte b = 0;
+ bool failed;
+
+ try {
+ a = 255;
+ failed = false;
+ checked {
+ b = (byte)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 1;
+ if (b != 255)
+ return -1;
+
+ try {
+ a = 0;
+ failed = false;
+ checked {
+ b = (byte)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+ if (b != 0)
+ return -2;
+
+
+ try {
+ a = 256;
+ failed = true;
+ checked {
+ b = (byte)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 3;
+ if (b != 0)
+ return -3;
+
+ try {
+ a = -1;
+ failed = true;
+ checked {
+ b = (byte)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+ if (b != 0)
+ return -4;
+
+ try {
+ double d = 0;
+ failed = false;
+ checked {
+ b = (byte)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 5;
+ if (b != 0)
+ return -5;
+
+ try {
+ double d = -1;
+ failed = true;
+ checked {
+ b = (byte)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 6;
+ if (b != 0)
+ return -6;
+
+ try {
+ double d = 255;
+ failed = false;
+ checked {
+ b = (byte)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 7;
+ if (b != 255)
+ return -7;
+
+ try {
+ double d = 256;
+ failed = true;
+ checked {
+ b = (byte)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 8;
+ if (b != 255)
+ return -8;
+
+ try {
+ l = 255;
+ failed = false;
+ checked {
+ b = (byte)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 9;
+ if (b != 255)
+ return -9;
+
+ try {
+ l = 0;
+ failed = false;
+ checked {
+ b = (byte)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 10;
+ if (b != 0)
+ return -10;
+
+ try {
+ l = 256;
+ failed = true;
+ checked {
+ b = (byte)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 11;
+ if (b != 0)
+ return -11;
+
+ try {
+ l = -1;
+ failed = true;
+ checked {
+ b = (byte)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 12;
+ if (b != 0)
+ return -12;
+
+ try {
+ ul = 256;
+ failed = true;
+ checked {
+ b = (byte)ul;
+ }
+ }
+ catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 13;
+ if (b != 0)
+ return -13;
+
+ return 0;
+ }
+
+ static int test_0_sbyte_cast () {
+ int a;
+ long l;
+ sbyte b = 0;
+ bool failed;
+
+ try {
+ a = 255;
+ failed = true;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+ if (b != 0)
+ return -1;
+
+ try {
+ a = 0;
+ failed = false;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+ if (b != 0)
+ return -2;
+
+ try {
+ a = 256;
+ failed = true;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 3;
+ if (b != 0)
+ return -3;
+
+ try {
+ a = -129;
+ failed = true;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+ if (b != 0)
+ return -4;
+
+ try {
+ a = -1;
+ failed = false;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 5;
+ if (b != -1)
+ return -5;
+
+ try {
+ a = -128;
+ failed = false;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 6;
+ if (b != -128)
+ return -6;
+
+ try {
+ a = 127;
+ failed = false;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 7;
+ if (b != 127)
+ return -7;
+
+ try {
+ a = 128;
+ failed = true;
+ checked {
+ b = (sbyte)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 8;
+ if (b != 127)
+ return -8;
+
+ try {
+ double d = 127;
+ failed = false;
+ checked {
+ b = (sbyte)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 9;
+ if (b != 127)
+ return -9;
+
+ try {
+ double d = -128;
+ failed = false;
+ checked {
+ b = (sbyte)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 10;
+ if (b != -128)
+ return -10;
+
+ try {
+ double d = 128;
+ failed = true;
+ checked {
+ b = (sbyte)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 11;
+ if (b != -128)
+ return -11;
+
+ try {
+ double d = -129;
+ failed = true;
+ checked {
+ b = (sbyte)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 12;
+ if (b != -128)
+ return -12;
+
+ try {
+ l = 255;
+ failed = true;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 13;
+ if (b != -128)
+ return -13;
+
+ try {
+ l = 0;
+ failed = false;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 14;
+ if (b != 0)
+ return -14;
+
+ try {
+ l = 256;
+ failed = true;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 15;
+ if (b != 0)
+ return -15;
+
+ try {
+ l = -129;
+ failed = true;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 16;
+ if (b != 0)
+ return -16;
+
+ try {
+ l = -1;
+ failed = false;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 17;
+ if (b != -1)
+ return -17;
+
+ try {
+ l = -128;
+ failed = false;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 18;
+ if (b != -128)
+ return -18;
+
+ try {
+ l = 127;
+ failed = false;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 19;
+ if (b != 127)
+ return -19;
+
+ try {
+ l = 128;
+ failed = true;
+ checked {
+ b = (sbyte)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 20;
+ if (b != 127)
+ return -20;
+
+ return 0;
+ }
+
+ static int test_0_ushort_cast () {
+ int a;
+ long l;
+ ulong ul;
+ ushort b;
+ bool failed;
+
+ try {
+ a = System.UInt16.MaxValue;
+ failed = false;
+ checked {
+ b = (ushort)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ a = 0;
+ failed = false;
+ checked {
+ b = (ushort)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+
+ try {
+ a = System.UInt16.MaxValue + 1;
+ failed = true;
+ checked {
+ b = (ushort)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 3;
+
+ try {
+ a = -1;
+ failed = true;
+ checked {
+ b = (ushort)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ try {
+ double d = 0;
+ failed = false;
+ checked {
+ b = (ushort)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 5;
+
+ try {
+ double d = System.UInt16.MaxValue;
+ failed = false;
+ checked {
+ b = (ushort)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 6;
+
+ try {
+ double d = -1;
+ failed = true;
+ checked {
+ b = (ushort)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 7;
+
+ try {
+ double d = System.UInt16.MaxValue + 1.0;
+ failed = true;
+ checked {
+ b = (ushort)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 8;
+
+ try {
+ l = System.UInt16.MaxValue;
+ failed = false;
+ checked {
+ b = (ushort)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 9;
+
+ try {
+ l = 0;
+ failed = false;
+ checked {
+ b = (ushort)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 10;
+
+ try {
+ l = System.UInt16.MaxValue + 1;
+ failed = true;
+ checked {
+ b = (ushort)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 11;
+
+ try {
+ l = -1;
+ failed = true;
+ checked {
+ b = (ushort)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 12;
+
+ try {
+ ul = 0xfffff;
+ failed = true;
+ checked {
+ b = (ushort)ul;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 13;
+
+ return 0;
+ }
+
+ static int test_0_short_cast () {
+ int a;
+ long l;
+ short b;
+ bool failed;
+
+ try {
+ a = System.UInt16.MaxValue;
+ failed = true;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ a = 0;
+ failed = false;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+
+ try {
+ a = System.Int16.MaxValue + 1;
+ failed = true;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 3;
+
+ try {
+ a = System.Int16.MinValue - 1;
+ failed = true;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ try {
+ a = -1;
+ failed = false;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 5;
+
+ try {
+ a = System.Int16.MinValue;
+ failed = false;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 6;
+
+ try {
+ a = System.Int16.MaxValue;
+ failed = false;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 7;
+
+ try {
+ a = System.Int16.MaxValue + 1;
+ failed = true;
+ checked {
+ b = (short)a;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 8;
+
+ try {
+ double d = System.Int16.MaxValue;
+ failed = false;
+ checked {
+ b = (short)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 9;
+
+ try {
+ double d = System.Int16.MinValue;
+ failed = false;
+ checked {
+ b = (short)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 10;
+
+ try {
+ double d = System.Int16.MaxValue + 1.0;
+ failed = true;
+ checked {
+ b = (short)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 11;
+
+ try {
+ double d = System.Int16.MinValue - 1.0;
+ failed = true;
+ checked {
+ b = (short)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 12;
+
+ try {
+ l = System.Int16.MaxValue + 1;
+ failed = true;
+ checked {
+ b = (short)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 13;
+
+ try {
+ l = System.Int16.MaxValue;
+ failed = false;
+ checked {
+ b = (short)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 14;
+
+ try {
+ l = System.Int16.MinValue - 1;
+ failed = true;
+ checked {
+ b = (short)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 15;
+
+
+ try {
+ l = System.Int16.MinValue;
+ failed = false;
+ checked {
+ b = (short)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 16;
+
+ try {
+ l = 0x00000000ffffffff;
+ failed = true;
+ checked {
+ b = (short)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 17;
+
+ return 0;
+ }
+
+ static int test_0_int_cast () {
+ int a;
+ long l;
+ bool failed;
+
+ try {
+ double d = System.Int32.MaxValue + 1.0;
+ failed = true;
+ checked {
+ a = (int)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ double d = System.Int32.MaxValue;
+ failed = false;
+ checked {
+ a = (int)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+
+
+ try {
+ double d = System.Int32.MinValue;
+ failed = false;
+ checked {
+ a = (int)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 3;
+
+
+ try {
+ double d = System.Int32.MinValue - 1.0;
+ failed = true;
+ checked {
+ a = (int)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ try {
+ l = System.Int32.MaxValue + (long)1;
+ failed = true;
+ checked {
+ a = (int)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 5;
+
+ try {
+ l = System.Int32.MaxValue;
+ failed = false;
+ checked {
+ a = (int)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 6;
+
+
+ try {
+ l = System.Int32.MinValue;
+ failed = false;
+ checked {
+ a = (int)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 7;
+
+
+ try {
+ l = System.Int32.MinValue - (long)1;
+ failed = true;
+ checked {
+ a = (int)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 8;
+
+ try {
+ uint ui = System.UInt32.MaxValue;
+ failed = true;
+ checked {
+ a = (int)ui;
+ }
+ }
+ catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 9;
+
+ {
+ int i;
+ float f = 1.1f;
+ checked {
+ i = (int) f;
+ }
+ }
+
+ return 0;
+ }
+
+ static int test_0_uint_cast () {
+ uint a;
+ long l;
+ bool failed;
+
+ try {
+ double d = System.UInt32.MaxValue;
+ failed = false;
+ checked {
+ a = (uint)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ double d = System.UInt32.MaxValue + 1.0;
+ failed = true;
+ checked {
+ a = (uint)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 2;
+
+ try {
+ double d = System.UInt32.MinValue;
+ failed = false;
+ checked {
+ a = (uint)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 3;
+
+ try {
+ double d = System.UInt32.MinValue - 1.0;
+ failed = true;
+ checked {
+ a = (uint)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ try {
+ l = System.UInt32.MaxValue;
+ failed = false;
+ checked {
+ a = (uint)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 5;
+
+ try {
+ l = System.UInt32.MaxValue + (long)1;
+ failed = true;
+ checked {
+ a = (uint)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 6;
+
+ try {
+ l = System.UInt32.MinValue;
+ failed = false;
+ checked {
+ a = (uint)l;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 7;
+
+ try {
+ l = System.UInt32.MinValue - (long)1;
+ failed = true;
+ checked {
+ a = (uint)l;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 8;
+
+ try {
+ int i = -1;
+ failed = true;
+ checked {
+ a = (uint)i;
+ }
+ }
+ catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 9;
+
+ {
+ uint i;
+ float f = 1.1f;
+ checked {
+ i = (uint) f;
+ }
+ }
+
+ return 0;
+ }
+
+ static int test_0_long_cast () {
+ long a;
+ bool failed;
+
+ try {
+ double d = System.Int64.MaxValue - 512.0;
+ failed = true;
+ checked {
+ a = (long)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ double d = System.Int64.MaxValue - 513.0;
+ failed = false;
+ checked {
+ a = (long)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+
+
+ try {
+ double d = System.Int64.MinValue - 1024.0;
+ failed = false;
+ checked {
+ a = (long)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 3;
+
+ try {
+ double d = System.Int64.MinValue - 1025.0;
+ failed = true;
+ checked {
+ a = (long)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ {
+ long i;
+ float f = 1.1f;
+ checked {
+ i = (long) f;
+ }
+ }
+
+ return 0;
+ }
+
+ static int test_0_ulong_cast () {
+ ulong a;
+ bool failed;
+
+ try {
+ double d = System.UInt64.MaxValue - 1024.0;
+ failed = true;
+ checked {
+ a = (ulong)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ double d = System.UInt64.MaxValue - 1025.0;
+ failed = false;
+ checked {
+ a = (ulong)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+
+
+ try {
+ double d = 0;
+ failed = false;
+ checked {
+ a = (ulong)d;
+ }
+ } catch (OverflowException) {
+ failed = true;
+ }
+ if (failed)
+ return 3;
+
+ try {
+ double d = -1;
+ failed = true;
+ checked {
+ a = (ulong)d;
+ }
+ } catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ {
+ ulong i;
+ float f = 1.1f;
+ checked {
+ i = (ulong) f;
+ }
+ }
+
+ try {
+ int i = -1;
+ failed = true;
+ checked {
+ a = (ulong)i;
+ }
+ }
+ catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 5;
+
+ try {
+ int i = Int32.MinValue;
+ failed = true;
+ checked {
+ a = (ulong)i;
+ }
+ }
+ catch (OverflowException) {
+ failed = false;
+ }
+ if (failed)
+ return 6;
+
+ return 0;
+ }
+
+ static int test_0_simple_double_casts () {
+
+ double d = 0xffffffff;
+
+ if ((uint)d != 4294967295)
+ return 1;
+
+ d = 0xffffffffffffffff;
+
+ if ((ulong)d != 0)
+ return 2;
+
+ if ((ushort)d != 0)
+ return 3;
+
+ if ((byte)d != 0)
+ return 4;
+
+ d = 0xffff;
+
+ if ((ushort)d != 0xffff)
+ return 5;
+
+ if ((byte)d != 0xff)
+ return 6;
+
+ return 0;
+ }
+
+ static int test_0_div_zero () {
+ int d = 1;
+ int q = 0;
+ int val;
+ bool failed;
+
+ try {
+ failed = true;
+ val = d / q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ failed = true;
+ val = d % q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 2;
+
+ try {
+ failed = true;
+ q = -1;
+ d = Int32.MinValue;
+ val = d / q;
+ } catch (DivideByZeroException) {
+ /* wrong exception */
+ } catch (ArithmeticException) {
+ failed = false;
+ }
+ if (failed)
+ return 3;
+
+ try {
+ failed = true;
+ q = -1;
+ d = Int32.MinValue;
+ val = d % q;
+ } catch (DivideByZeroException) {
+ /* wrong exception */
+ } catch (ArithmeticException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ return 0;
+ }
+
+ static int return_55 () {
+ return 55;
+ }
+
+ static int test_0_cfold_div_zero () {
+ // Test that constant folding doesn't cause division by zero exceptions
+ if (return_55 () != return_55 ()) {
+ int d = 1;
+ int q = 0;
+ int val;
+
+ val = d / q;
+ val = d % q;
+
+ q = -1;
+ d = Int32.MinValue;
+ val = d / q;
+
+ q = -1;
+ val = d % q;
+ }
+
+ return 0;
+ }
+
+ static int test_0_udiv_zero () {
+ uint d = 1;
+ uint q = 0;
+ uint val;
+ bool failed;
+
+ try {
+ failed = true;
+ val = d / q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ failed = true;
+ val = d % q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 2;
+
+ return 0;
+ }
+
+ static int test_0_long_div_zero () {
+ long d = 1;
+ long q = 0;
+ long val;
+ bool failed;
+
+ try {
+ failed = true;
+ val = d / q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ failed = true;
+ val = d % q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 2;
+
+ try {
+ failed = true;
+ q = -1;
+ d = Int64.MinValue;
+ val = d / q;
+ } catch (DivideByZeroException) {
+ /* wrong exception */
+ } catch (ArithmeticException) {
+ failed = false;
+ }
+ if (failed)
+ return 3;
+
+ try {
+ failed = true;
+ q = -1;
+ d = Int64.MinValue;
+ val = d % q;
+ } catch (DivideByZeroException) {
+ /* wrong exception */
+ } catch (ArithmeticException) {
+ failed = false;
+ }
+ if (failed)
+ return 4;
+
+ return 0;
+ }
+
+ static int test_0_ulong_div_zero () {
+ ulong d = 1;
+ ulong q = 0;
+ ulong val;
+ bool failed;
+
+ try {
+ failed = true;
+ val = d / q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ failed = true;
+ val = d % q;
+ } catch (DivideByZeroException) {
+ failed = false;
+ }
+ if (failed)
+ return 2;
+
+ return 0;
+ }
+
+ static int test_0_float_div_zero () {
+ double d = 1;
+ double q = 0;
+ double val;
+ bool failed;
+
+ try {
+ failed = false;
+ val = d / q;
+ } catch (DivideByZeroException) {
+ failed = true;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ failed = false;
+ val = d % q;
+ } catch (DivideByZeroException) {
+ failed = true;
+ }
+ if (failed)
+ return 2;
+
+ return 0;
+ }
+
+ static int test_0_invalid_unbox () {
+
+ int i = 123;
+ object o = "Some string";
+ int res = 1;
+
+ try {
+ // Illegal conversion; o contains a string not an int
+ i = (int) o;
+ } catch (Exception e) {
+ if (i ==123)
+ res = 0;
+ }
+
+ return res;
+ }
+
+ // Test that double[] can't be cast to double (bug #46027)
+ static int test_0_invalid_unbox_arrays () {
+ double[] d1 = { 1.0 };
+ double[][] d2 = { d1 };
+ Array a = d2;
+
+ try {
+ foreach (double d in a) {
+ }
+ return 1;
+ }
+ catch (InvalidCastException e) {
+ return 0;
+ }
+ }
+
+ /* bug# 42190, at least mcs generates a leave for the return that
+ * jumps out of multiple exception clauses: we used to execute just
+ * one enclosing finally block.
+ */
+ static int finally_level;
+ static void do_something () {
+ int a = 0;
+ try {
+ try {
+ return;
+ } finally {
+ a = 1;
+ }
+ } finally {
+ finally_level++;
+ }
+ }
+
+ static int test_2_multiple_finally_clauses () {
+ finally_level = 0;
+ do_something ();
+ if (finally_level == 1)
+ return 2;
+ return 0;
+ }
+
+ static int test_3_checked_cast_un () {
+ ulong i = 0x8000000034000000;
+ long j;
+
+ try {
+ checked { j = (long)i; }
+ } catch (OverflowException) {
+ j = 2;
+ }
+
+ if (j != 2)
+ return 0;
+ return 3;
+ }
+
+ static int test_4_checked_cast () {
+ long i;
+ ulong j;
+
+ unchecked { i = (long)0x8000000034000000;};
+ try {
+ checked { j = (ulong)i; }
+ } catch (OverflowException) {
+ j = 3;
+ }
+
+ if (j != 3)
+ return 0;
+ return 4;
+ }
+
+ static readonly int[] mul_dim_results = new int[] {
+ 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8,
+ 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8,
+ 2, 0, 2, 1, 2, 8,
+ 3, 0, 3, 1, 3, 8,
+ 4, 0, 4, 1, 4, 8,
+ 5, 0, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5, 5, 6, 5, 7, 5, 8,
+ 6, 0, 6, 1, 6, 2, 6, 3, 6, 4, 6, 5, 6, 6, 6, 7, 6, 8,
+ 7, 0, 7, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7, 7, 7, 8,
+ };
+
+ static int test_0_multi_dim_array_access () {
+ int [,] a = System.Array.CreateInstance (typeof (int),
+ new int [] {3,6}, new int [] {2,2 }) as int[,];
+ int x, y;
+ int result_idx = 0;
+ for (x = 0; x < 8; ++x) {
+ for (y = 0; y < 9; ++y) {
+ bool got_ex = false;
+ try {
+ a [x, y] = 1;
+ } catch {
+ got_ex = true;
+ }
+ if (got_ex) {
+ if (result_idx >= mul_dim_results.Length)
+ return -1;
+ if (mul_dim_results [result_idx] != x || mul_dim_results [result_idx + 1] != y) {
+ return result_idx + 1;
+ }
+ result_idx += 2;
+ }
+ }
+ }
+ if (result_idx == mul_dim_results.Length)
+ return 0;
+ return 200;
+ }
+
+ static void helper_out_obj (out object o) {
+ o = (object)"buddy";
+ }
+
+ static void helper_out_string (out string o) {
+ o = "buddy";
+ }
+
+ static int test_2_array_mismatch () {
+ string[] a = { "hello", "world" };
+ object[] b = a;
+ bool passed = false;
+
+ try {
+ helper_out_obj (out b [1]);
+ } catch (ArrayTypeMismatchException) {
+ passed = true;
+ }
+ if (!passed)
+ return 0;
+ helper_out_string (out a [1]);
+ if (a [1] != "buddy")
+ return 1;
+ return 2;
+ }
+
+ static int test_0_ovf () {
+ int ocount = 0;
+
+ checked {
+
+ ocount = 0;
+ try {
+ ulong a = UInt64.MaxValue - 1;
+ ulong t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 1;
+
+ ocount = 0;
+ try {
+ ulong a = UInt64.MaxValue;
+ ulong t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 2;
+
+ ocount = 0;
+ try {
+ long a = Int64.MaxValue - 1;
+ long t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 3;
+
+ try {
+ long a = Int64.MaxValue;
+ long t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 4;
+
+ ocount = 0;
+ try {
+ ulong a = UInt64.MaxValue - 1;
+ ulong t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 5;
+
+ try {
+ ulong a = UInt64.MaxValue;
+ ulong t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 6;
+
+ ocount = 0;
+ try {
+ long a = Int64.MinValue + 1;
+ long t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 7;
+
+ ocount = 0;
+ try {
+ long a = Int64.MinValue;
+ long t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 8;
+
+ ocount = 0;
+ try {
+ ulong a = UInt64.MinValue + 1;
+ ulong t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 9;
+
+ ocount = 0;
+ try {
+ ulong a = UInt64.MinValue;
+ ulong t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 10;
+
+ ocount = 0;
+ try {
+ int a = Int32.MinValue + 1;
+ int t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 11;
+
+ ocount = 0;
+ try {
+ int a = Int32.MinValue;
+ int t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 12;
+
+ ocount = 0;
+ try {
+ uint a = 1;
+ uint t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 13;
+
+ ocount = 0;
+ try {
+ uint a = 0;
+ uint t = a--;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 14;
+
+ ocount = 0;
+ try {
+ sbyte a = 126;
+ sbyte t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 15;
+
+ ocount = 0;
+ try {
+ sbyte a = 127;
+ sbyte t = a++;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 16;
+
+ ocount = 0;
+ try {
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 17;
+
+ ocount = 0;
+ try {
+ int a = 1 << 29;
+ int t = a*2;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 18;
+
+ ocount = 0;
+ try {
+ int a = 1 << 30;
+ int t = a*2;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 19;
+
+ ocount = 0;
+ try {
+ ulong a = 0xffffffffff;
+ ulong t = a*0x0ffffff;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 0)
+ return 20;
+
+ ocount = 0;
+ try {
+ ulong a = 0xffffffffff;
+ ulong t = a*0x0fffffff;
+ } catch {
+ ocount++;
+ }
+ if (ocount != 1)
+ return 21;
+
+ ocount = 0;
+ try {
+ long a = Int64.MinValue;
+ long b = 10;
+ long v = a * b;
+ } catch {
+ ocount ++;
+ }
+ if (ocount != 1)
+ return 22;
+
+ ocount = 0;
+ try {
+ long a = 10;
+ long b = Int64.MinValue;
+ long v = a * b;
+ } catch {
+ ocount ++;
+ }
+ if (ocount != 1)
+ return 23;
+ }
+
+ return 0;
+ }
+
+ class Broken {
+ static int i;
+
+ static Broken () {
+ throw new Exception ("Ugh!");
+ }
+
+ public static int DoSomething () {
+ return i;
+ }
+ }
+
+ static int test_0_exception_in_cctor () {
+ try {
+ Broken.DoSomething ();
+ }
+ catch (TypeInitializationException) {
+ // This will only happen once even if --regression is used
+ }
+ return 0;
+ }
+
+ static int test_5_regalloc () {
+ int i = 0;
+
+ try {
+ for (i = 0; i < 10; ++i) {
+ if (i == 5)
+ throw new Exception ();
+ }
+ }
+ catch (Exception) {
+ if (i != 5)
+ return i;
+ }
+
+ // Check that variables written in catch clauses are volatile
+ int j = 0;
+ try {
+ throw new Exception ();
+ }
+ catch (Exception) {
+ j = 5;
+ }
+ if (j != 5)
+ return 6;
+
+ int k = 0;
+ try {
+ try {
+ throw new Exception ();
+ }
+ finally {
+ k = 5;
+ }
+ }
+ catch (Exception) {
+ }
+ if (k != 5)
+ return 7;
+
+ return i;
+ }
+
+ /* MarshalByRefObject prevents the methods from being inlined */
+ class ThrowClass : MarshalByRefObject {
+ public static void rethrow1 () {
+ throw new Exception ();
+ }
+
+ public static void rethrow2 () {
+ rethrow1 ();
+ }
+ }
+
+ static int test_0_rethrow_stacktrace () {
+ // Check that rethrowing an exception preserves the original stack trace
+ try {
+ try {
+ ThrowClass.rethrow2 ();
+ }
+ catch (Exception ex) {
+ throw;
+ }
+ }
+ catch (Exception ex) {
+ if (ex.StackTrace.IndexOf ("rethrow2") != -1)
+ return 0;
+ }
+
+ return 1;
+ }
+
+ interface IFace {}
+ class Face : IFace {}
+
+ static int test_1_array_mismatch_2 () {
+ try {
+ object [] o = new Face [1];
+ o [0] = 1;
+ return 0;
+ } catch (ArrayTypeMismatchException) {
+ return 1;
+ }
+ }
+
+ static int test_1_array_mismatch_3 () {
+ try {
+ object [] o = new IFace [1];
+ o [0] = 1;
+ return 0;
+ } catch (ArrayTypeMismatchException) {
+ return 1;
+ }
+ }
+
+ static int test_1_array_mismatch_4 () {
+ try {
+ object [][] o = new Face [5] [];
+ o [0] = new object [5];
+
+ return 0;
+ } catch (ArrayTypeMismatchException) {
+ return 1;
+ }
+ }
+
+ static int test_0_array_size () {
+ bool failed;
+
+ try {
+ failed = true;
+ int[] mem1 = new int [Int32.MaxValue];
+ }
+ catch (OutOfMemoryException e) {
+ failed = false;
+ }
+ if (failed)
+ return 1;
+
+ try {
+ failed = true;
+ int[,] mem2 = new int [Int32.MaxValue, Int32.MaxValue];
+ }
+ catch (OutOfMemoryException e) {
+ failed = false;
+ }
+ if (failed)
+ return 2;
+
+ return 0;
+ }
+
+ struct S {
+ int i, j, k, l, m, n;
+ }
+
+ static IntPtr[] addr;
+
+ static unsafe void throw_func (int i, S s) {
+ addr [i] = new IntPtr (&i);
+ throw new Exception ();
+ }
+
+ /* Test that arguments are correctly popped off the stack during unwinding */
+ static int test_0_stack_unwind () {
+ addr = new IntPtr [1000];
+ S s = new S ();
+ for (int j = 0; j < 1000; j++) {
+ try {
+ throw_func (j, s);
+ }
+ catch (Exception) {
+ }
+ }
+ return (addr [0].ToInt64 () - addr [100].ToInt64 () < 100) ? 0 : 1;
+ }
+}
+
diff --git a/mono/mini/genmdesc.c b/mono/mini/genmdesc.c
new file mode 100644
index 00000000000..e7496983ec1
--- /dev/null
+++ b/mono/mini/genmdesc.c
@@ -0,0 +1,236 @@
+/*
+ * genmdesc: Generates the machine description
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include "mini.h"
+#include <ctype.h>
+#include <string.h>
+#include <mono/metadata/opcodes.h>
+
+typedef struct {
+ int num;
+ const char *name;
+ char *desc;
+ char *comment;
+ char spec [MONO_INST_MAX];
+} OpDesc;
+
+static GHashTable *table;
+
+#define eat_whitespace(s) while (*(s) && isspace (*(s))) s++;
+
+static int
+load_file (const char *name) {
+ FILE *f;
+ char buf [256];
+ char *str, *p;
+ int line;
+ OpDesc *desc;
+ GString *comment;
+
+ if (!(f = fopen (name, "r")))
+ g_error ("Cannot open file '%s'", name);
+
+ comment = g_string_new ("");
+ /*
+ * The format of the lines are:
+ * # comment
+ * opcode: [dest:format] [src1:format] [src2:format] [flags:format] [clob:format]
+ * [cost:num] [res:format] [delay:num] [len:num]
+ * format is a single letter that depends on the field
+ * NOTE: no space between the field name and the ':'
+ *
+ * len: maximum instruction length
+ */
+ line = 0;
+ while ((str = fgets (buf, sizeof (buf), f))) {
+ ++line;
+ eat_whitespace (str);
+ if (!str [0])
+ continue;
+ if (str [0] == '#') {
+ g_string_append (comment, str);
+ continue;
+ }
+ p = strchr (str, ':');
+ if (!p)
+ g_error ("Invalid format at line %d in %s\n", line, name);
+ *p++ = 0;
+ eat_whitespace (p);
+ desc = g_hash_table_lookup (table, str);
+ if (!desc)
+ g_error ("Invalid opcode '%s' at line %d in %s\n", str, line, name);
+ if (desc->desc)
+ g_error ("Duplicated opcode '%s' at line %d in %s\n", str, line, name);
+ desc->desc = g_strdup (p);
+ desc->comment = g_strdup (comment->str);
+ g_string_truncate (comment, 0);
+ while (*p) {
+ if (strncmp (p, "dest:", 5) == 0) {
+ desc->spec [MONO_INST_DEST] = p [5];
+ p += 6;
+ } else if (strncmp (p, "src1:", 5) == 0) {
+ desc->spec [MONO_INST_SRC1] = p [5];
+ p += 6;
+ } else if (strncmp (p, "src2:", 5) == 0) {
+ desc->spec [MONO_INST_SRC2] = p [5];
+ p += 6;
+ } else if (strncmp (p, "cost:", 5) == 0) {
+ desc->spec [MONO_INST_COST] = p [5];
+ p += 6;
+ } else if (strncmp (p, "clob:", 5) == 0) {
+ desc->spec [MONO_INST_CLOB] = p [5];
+ p += 6;
+ } else if (strncmp (p, "res:", 4) == 0) {
+ desc->spec [MONO_INST_RES] = p [4];
+ p += 5;
+ } else if (strncmp (p, "flags:", 6) == 0) {
+ desc->spec [MONO_INST_FLAGS] = p [6];
+ p += 7;
+ } else if (strncmp (p, "delay:", 6) == 0) {
+ desc->spec [MONO_INST_DELAY] = p [6];
+ p += 7;
+ } else if (strncmp (p, "len:", 4) == 0) {
+ p += 4;
+ desc->spec [MONO_INST_LEN] = strtoul (p, &p, 10);
+ } else {
+ g_error ("Parse error at '%s' at line %d in %s\n", p, line, name);
+ }
+ eat_whitespace (p);
+ }
+ }
+ fclose (f);
+ return 0;
+}
+
+static OpDesc *opcodes = NULL;
+
+static void
+init_table (void) {
+ int i;
+ OpDesc *desc;
+
+ table = g_hash_table_new (g_str_hash, g_str_equal);
+
+ opcodes = g_new0 (OpDesc, OP_LAST);
+ for (i = 0; i < MONO_CEE_LAST; ++i) {
+ desc = opcodes + i;
+ desc->num = i;
+ desc->name = mono_inst_name (i);
+ g_hash_table_insert (table, (char *)desc->name, desc);
+ }
+ for (i = OP_LOAD; i < OP_LAST; ++i) {
+ desc = opcodes + i;
+ desc->num = i;
+ desc->name = mono_inst_name (i);
+ g_hash_table_insert (table, (char *)desc->name, desc);
+ }
+}
+
+static void
+output_char (FILE *f, char c) {
+ if (isalnum (c))
+ fprintf (f, "%c", c);
+ else
+ fprintf (f, "\\x%x\" \"", c);
+}
+
+static void
+build_table (const char *fname, const char *name) {
+ FILE *f;
+ int i, j;
+ OpDesc *desc;
+
+ if (!(f = fopen (fname, "w")))
+ g_error ("Cannot open file '%s'", fname);
+ fprintf (f, "/* File automatically generated by genmdesc, don't change */\n\n");
+ fprintf (f, "static const char * const %s [OP_LAST] = {\n", name);
+
+ for (i = 0; i < MONO_CEE_LAST; ++i) {
+ desc = opcodes + i;
+ if (!desc->desc)
+ fprintf (f, "\tNULL,\t/* %s */\n", desc->name);
+ else {
+ fprintf (f, "\t\"");
+ for (j = 0; j < MONO_INST_MAX; ++j)
+ output_char (f, desc->spec [j]);
+ fprintf (f, "\",\t/* %s */\n", desc->name);
+ }
+ }
+ for (i = MONO_CEE_LAST; i < OP_LOAD; ++i) {
+ fprintf (f, "\tNULL, /* unassigned */\n");
+ }
+ for (i = OP_LOAD; i < OP_LAST; ++i) {
+ desc = opcodes + i;
+ if (!desc->desc)
+ fprintf (f, "\tNULL,\t/* %s */\n", desc->name);
+ else {
+ fprintf (f, "\t\"");
+ for (j = 0; j < MONO_INST_MAX; ++j)
+ output_char (f, desc->spec [j]);
+ fprintf (f, "\",\t/* %s */\n", desc->name);
+ }
+ }
+ fprintf (f, "};\n\n");
+ fclose (f);
+}
+
+static void
+dump (void) {
+ int i;
+ OpDesc *desc;
+
+ for (i = 0; i < MONO_CEE_LAST; ++i) {
+ desc = opcodes + i;
+ if (desc->comment)
+ g_print ("%s", desc->comment);
+ if (!desc->desc)
+ g_print ("%s:\n", desc->name);
+ else {
+ g_print ("%s: %s", desc->name, desc->desc);
+ if (!strchr (desc->desc, '\n'))
+ g_print ("\n");
+ }
+ }
+ for (i = OP_LOAD; i < OP_LAST; ++i) {
+ desc = opcodes + i;
+ if (!desc->desc)
+ g_print ("%s:\n", desc->name);
+ else {
+ g_print ("%s: %s", desc->name, desc->desc);
+ if (!strchr (desc->desc, '\n'))
+ g_print ("\n");
+ }
+ }
+}
+
+/*
+ * TODO: output the table (possibly merged), in the input format
+ */
+int
+main (int argc, char* argv [])
+{
+ init_table ();
+ switch (argc) {
+ case 2:
+ /* useful to get a new file when some opcodes are added: looses the comments, though */
+ load_file (argv [1]);
+ dump ();
+ break;
+ case 4:
+ load_file (argv [1]);
+ build_table (argv [2], argv [3]);
+ break;
+ default:
+ g_print ("Usage: genmdesc arguments\n");
+ g_print ("\tgenmdesc desc Output to stdout the description file.\n");
+ g_print ("\tgenmdesc desc output name Write to output the description in a table named 'name'.\n");
+ return 1;
+ }
+ return 0;
+}
+
diff --git a/mono/mini/graph.c b/mono/mini/graph.c
new file mode 100644
index 00000000000..45168cf7a7f
--- /dev/null
+++ b/mono/mini/graph.c
@@ -0,0 +1,339 @@
+/*
+ * graph.c: Helper routines to graph various internal states of the code generator
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include <string.h>
+#include <mono/metadata/debug-helpers.h>
+
+#include "mini.h"
+
+extern guint8 mono_burg_arity [];
+
+static char *
+convert_name (const char *str)
+{
+ int i, j, len = strlen (str);
+ char *res = g_malloc (len * 2);
+
+ j = 0;
+ for (i = 0; i < len; i++) {
+ char c = str [i];
+
+ switch (c) {
+ case '.':
+ res [j++] = '_';
+ break;
+ default:
+ res [j++] = c;
+ }
+ }
+
+ res [j] = 0;
+
+ return res;
+}
+
+static void
+dtree_emit_one_loop_level (MonoCompile *cfg, FILE *fp, MonoBasicBlock *h)
+{
+ MonoBasicBlock *bb;
+ int i, level = 0;
+
+ if (h) {
+ level = h->nesting;
+ fprintf (fp, "subgraph cluster_%d {\n", h->block_num);
+ fprintf (fp, "label=\"loop_%d\"\n", h->block_num);
+ }
+
+ for (i = 1; i < cfg->num_bblocks; ++i) {
+ bb = cfg->bblocks [i];
+
+ if (!h || (g_list_find (h->loop_blocks, bb) && bb != h)) {
+ if (bb->nesting == level) {
+ fprintf (fp, "BB%d -> BB%d;\n", bb->idom->block_num, bb->block_num);
+ }
+
+ if (bb->nesting == (level + 1) && bb->loop_blocks) {
+ fprintf (fp, "BB%d -> BB%d;\n", bb->idom->block_num, bb->block_num);
+ dtree_emit_one_loop_level (cfg, fp, bb);
+ }
+ }
+ }
+
+ if (h) {
+ fprintf (fp, "}\n");
+ }
+}
+
+static void
+cfg_emit_one_loop_level (MonoCompile *cfg, FILE *fp, MonoBasicBlock *h)
+{
+ MonoBasicBlock *bb;
+ int j, level = 0;
+
+ if (h) {
+ level = h->nesting;
+ fprintf (fp, "subgraph cluster_%d {\n", h->block_num);
+ fprintf (fp, "label=\"loop_%d\"\n", h->block_num);
+ }
+
+ for (bb = cfg->bb_entry->next_bb; bb; bb = bb->next_bb) {
+ if (bb->region != -1) {
+ switch (bb->region & (MONO_REGION_FINALLY|MONO_REGION_CATCH|MONO_REGION_FAULT|MONO_REGION_FILTER)) {
+ case MONO_REGION_CATCH:
+ fprintf (fp, "BB%d [color=blue];\n", bb->block_num);;
+ break;
+ case MONO_REGION_FINALLY:
+ fprintf (fp, "BB%d [color=green];\n", bb->block_num);;
+ break;
+ case MONO_REGION_FAULT:
+ case MONO_REGION_FILTER:
+ fprintf (fp, "BB%d [color=yellow];\n", bb->block_num);;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!h || (g_list_find (h->loop_blocks, bb) && bb != h)) {
+
+ if (bb->nesting == level) {
+ for (j = 0; j < bb->in_count; j++)
+ fprintf (fp, "BB%d -> BB%d;\n", bb->in_bb [j]->block_num, bb->block_num);
+ }
+
+ if (bb->nesting == (level + 1) && bb->loop_blocks) {
+ for (j = 0; j < bb->in_count; j++)
+ fprintf (fp, "BB%d -> BB%d;\n", bb->in_bb [j]->block_num, bb->block_num);
+ cfg_emit_one_loop_level (cfg, fp, bb);
+ }
+ }
+ }
+
+ if (h) {
+ fprintf (fp, "}\n");
+ }
+}
+
+static void
+mono_draw_dtree (MonoCompile *cfg, FILE *fp)
+{
+ g_assert ((cfg->comp_done & MONO_COMP_IDOM));
+
+ fprintf (fp, "digraph %s {\n", convert_name (cfg->method->name));
+ fprintf (fp, "node [fontsize=12.0]\nedge [len=1,color=red]\n");
+ fprintf (fp, "label=\"Dominator tree for %s\";\n", mono_method_full_name (cfg->method, TRUE));
+
+ fprintf (fp, "BB0 [shape=doublecircle];\n");
+ fprintf (fp, "BB1 [color=red];\n");
+
+ dtree_emit_one_loop_level (cfg, fp, NULL);
+
+ fprintf (fp, "}\n");
+}
+
+static void
+mono_draw_cfg (MonoCompile *cfg, FILE *fp)
+{
+ fprintf (fp, "digraph %s {\n", convert_name (cfg->method->name));
+ fprintf (fp, "node [fontsize=12.0]\nedge [len=1,color=red]\n");
+ fprintf (fp, "label=\"CFG for %s\";\n", mono_method_full_name (cfg->method, TRUE));
+
+ fprintf (fp, "BB0 [shape=doublecircle];\n");
+ fprintf (fp, "BB1 [color=red];\n");
+
+ cfg_emit_one_loop_level (cfg, fp, NULL);
+
+ fprintf (fp, "}\n");
+}
+
+static void
+mono_print_label (FILE *fp, MonoInst *tree) {
+ int arity;
+
+ if (!tree)
+ return;
+
+ arity = mono_burg_arity [tree->opcode];
+
+ fprintf (fp, "\\ %s%s", arity? "(": "", mono_inst_name (tree->opcode));
+
+ switch (tree->opcode) {
+ case OP_ICONST:
+ fprintf (fp, "[%d]", tree->inst_c0);
+ break;
+ case OP_I8CONST:
+ fprintf (fp, "[%lld]", tree->inst_l);
+ break;
+ case OP_R8CONST:
+ fprintf (fp, "[%f]", *(double*)tree->inst_p0);
+ break;
+ case OP_R4CONST:
+ fprintf (fp, "[%f]", *(float*)tree->inst_p0);
+ break;
+ case OP_ARG:
+ case OP_LOCAL:
+ fprintf (fp, "[%d]", tree->inst_c0);
+ break;
+ case OP_REGOFFSET:
+ fprintf (fp, "[0x%x(%s)]", tree->inst_offset, mono_arch_regname (tree->inst_basereg));
+ break;
+ case OP_REGVAR:
+ fprintf (fp, "[%s]", mono_arch_regname (tree->dreg));
+ break;
+ case CEE_NEWARR:
+ fprintf (fp, "[%s]", tree->inst_newa_class->name);
+ mono_print_label (fp, tree->inst_newa_len);
+ break;
+ case CEE_CALL:
+ case CEE_CALLVIRT:
+ case OP_FCALL:
+ case OP_FCALLVIRT:
+ case OP_LCALL:
+ case OP_LCALLVIRT:
+ case OP_VCALL:
+ case OP_VCALLVIRT:
+ case OP_VOIDCALL:
+ case OP_VOIDCALLVIRT: {
+ MonoCallInst *call = (MonoCallInst*)tree;
+ if (call->method) {
+ if (call->method->signature->hasthis && tree->inst_left) {
+ mono_print_label (fp, tree->inst_left);
+ }
+ fprintf (fp, "[%s]", call->method->name);
+ }
+ break;
+ }
+ case OP_PHI: {
+ int i;
+ fprintf (fp, "[%d\\ (", tree->inst_c0);
+ for (i = 0; i < tree->inst_phi_args [0]; i++) {
+ if (i)
+ fprintf (fp, ",\\ ");
+ fprintf (fp, "%d", tree->inst_phi_args [i + 1]);
+ }
+ fprintf (fp, ")]");
+ break;
+ }
+ case OP_RENAME:
+ case OP_RETARG:
+ case CEE_NOP:
+ case CEE_JMP:
+ case CEE_BREAK:
+ break;
+ case CEE_BR:
+ fprintf (fp, "[B%d]", tree->inst_target_bb->block_num);
+ break;
+ case CEE_SWITCH:
+ case CEE_ISINST:
+ case CEE_CASTCLASS:
+ case OP_OUTARG:
+ case OP_CALL_REG:
+ case OP_FCALL_REG:
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ mono_print_label (fp, tree->inst_left);
+ break;
+ case CEE_BNE_UN:
+ case CEE_BEQ:
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ fprintf (fp, "[B%dB%d]", tree->inst_true_bb->block_num, tree->inst_false_bb->block_num);
+ mono_print_label (fp, tree->inst_left);
+ break;
+ default:
+ if (arity) {
+ mono_print_label (fp, tree->inst_left);
+ if (arity > 1)
+ mono_print_label (fp, tree->inst_right);
+ }
+ break;
+ }
+
+ if (arity)
+ fprintf (fp, ")");
+}
+
+static void
+mono_draw_code_cfg (MonoCompile *cfg, FILE *fp)
+{
+ MonoBasicBlock *bb;
+
+ fprintf (fp, "digraph %s {\n", convert_name (cfg->method->name));
+ fprintf (fp, "node [fontsize=12.0]\nedge [len=1,color=red]\n");
+ fprintf (fp, "label=\"CFG for %s\";\n", mono_method_full_name (cfg->method, TRUE));
+
+ fprintf (fp, "BB0 [shape=doublecircle];\n");
+ fprintf (fp, "BB1 [color=red];\n");
+
+ for (bb = cfg->bb_entry->next_bb; bb; bb = bb->next_bb) {
+ MonoInst *inst;
+ const char *color;
+
+ if (bb == cfg->bb_exit)
+ continue;
+
+ if ((cfg->comp_done & MONO_COMP_REACHABILITY) && (bb->flags & BB_REACHABLE))
+ color = "color=red,";
+ else
+ color = "";
+
+ fprintf (fp, "BB%d [%sshape=record,labeljust=l,label=\"{BB%d|", bb->block_num, color, bb->block_num);
+
+ for (inst = bb->code; inst; inst = inst->next) {
+ mono_print_label (fp, inst);
+ fprintf (fp, "\\n");
+ }
+
+ fprintf (fp, "}\"];\n");
+ }
+
+ cfg_emit_one_loop_level (cfg, fp, NULL);
+
+ fprintf (fp, "}\n");
+}
+
+void
+mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options)
+{
+ char *com;
+ const char *fn;
+ FILE *fp;
+
+ fn = "/tmp/minidtree.graph";
+ fp = fopen (fn, "w+");
+ g_assert (fp);
+
+ switch (draw_options) {
+ case MONO_GRAPH_DTREE:
+ mono_draw_dtree (cfg, fp);
+ break;
+ case MONO_GRAPH_CFG:
+ mono_draw_cfg (cfg, fp);
+ break;
+ case MONO_GRAPH_CFG_CODE:
+ case MONO_GRAPH_CFG_OPTCODE:
+ case MONO_GRAPH_CFG_SSA:
+ mono_draw_code_cfg (cfg, fp);
+ break;
+ }
+
+ fclose (fp);
+
+ //com = g_strdup_printf ("dot %s -Tpng -o %s.png; eog %s.png", fn, fn, fn);
+ com = g_strdup_printf ("dot %s -Tps -o %s.ps;gv %s.ps", fn, fn, fn);
+ system (com);
+ g_free (com);
+}
+
diff --git a/mono/mini/helpers.c b/mono/mini/helpers.c
new file mode 100644
index 00000000000..778a3b3b08a
--- /dev/null
+++ b/mono/mini/helpers.c
@@ -0,0 +1,113 @@
+/*
+ * helpers.c: Assorted routines
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include "mini.h"
+#include <ctype.h>
+#include <mono/metadata/opcodes.h>
+
+#ifdef MINI_OP
+#undef MINI_OP
+#endif
+#define MINI_OP(a,b) b,
+/* keep in sync with the enum in mini.h */
+static const char* const
+opnames[] = {
+#include "mini-ops.h"
+};
+#undef MINI_OP
+
+const char*
+mono_inst_name (int op) {
+ if (op >= OP_LOAD && op <= OP_LAST)
+ return opnames [op - OP_LOAD];
+ if (op < OP_LOAD)
+ return mono_opcode_name (op);
+ g_error ("unknown opcode name for %d", op);
+ return NULL;
+}
+
+void
+mono_blockset_print (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom)
+{
+ int i;
+
+ if (name)
+ g_print ("%s:", name);
+
+ mono_bitset_foreach_bit (set, i, cfg->num_bblocks) {
+ if (idom == i)
+ g_print (" [BB%d]", cfg->bblocks [i]->block_num);
+ else
+ g_print (" BB%d", cfg->bblocks [i]->block_num);
+
+ }
+ g_print ("\n");
+}
+
+/**
+ * mono_disassemble_code:
+ * @code: a pointer to the code
+ * @size: the code size in bytes
+ *
+ * Disassemble to code to stdout.
+ */
+void
+mono_disassemble_code (guint8 *code, int size, char *id)
+{
+ int i;
+ FILE *ofd;
+ const char *tmp = g_get_tmp_dir ();
+ const char *objdump_args = g_getenv ("MONO_OBJDUMP_ARGS");
+ char *as_file;
+ char *o_file;
+ char *cmd;
+
+ as_file = g_strdup_printf ("%s/test.s", tmp);
+
+ if (!(ofd = fopen (as_file, "w")))
+ g_assert_not_reached ();
+
+ for (i = 0; id [i]; ++i) {
+ if (!isalnum (id [i]))
+ fprintf (ofd, "_");
+ else
+ fprintf (ofd, "%c", id [i]);
+ }
+ fprintf (ofd, ":\n");
+
+ for (i = 0; i < size; ++i)
+ fprintf (ofd, ".byte %d\n", (unsigned int) code [i]);
+
+ fclose (ofd);
+#ifdef __APPLE__
+#define DIS_CMD "otool -v -t"
+#else
+#if defined(sparc) && !defined(__GNUC__)
+#define DIS_CMD "dis"
+#else
+#define DIS_CMD "objdump -d"
+#endif
+#endif
+#if defined(sparc)
+#define AS_CMD "as -xarch=v9"
+#else
+#define AS_CMD "as"
+#endif
+
+ o_file = g_strdup_printf ("%s/test.o", tmp);
+ cmd = g_strdup_printf (AS_CMD " %s -o %s", as_file, o_file);
+ system (cmd);
+ g_free (cmd);
+ if (!objdump_args)
+ objdump_args = "";
+
+ cmd = g_strdup_printf (DIS_CMD " %s %s", objdump_args, o_file);
+ system (cmd);
+ g_free (cmd);
+
+ g_free (o_file);
+ g_free (as_file);
+}
+
diff --git a/mono/mini/iltests.il b/mono/mini/iltests.il
new file mode 100644
index 00000000000..76df62091a4
--- /dev/null
+++ b/mono/mini/iltests.il
@@ -0,0 +1,527 @@
+.assembly iltests {}
+.assembly extern TestDriver {}
+.assembly extern mscorlib {}
+
+.class public auto ansi sealed beforefieldinit Tests {
+
+ .method static public int32 Main() il managed {
+ .entrypoint
+
+ ldtoken Tests
+ call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ call int32 [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type)
+ ret
+ }
+
+ // make sure the register allocator works when the return value of
+ // 'div' is discarded
+ .method static public int32 test_0_div_regalloc () il managed {
+ .locals init (
+ int32 i
+ )
+
+ ldloc 0
+ ldc.i4.s 0xa
+ div
+ pop
+ ldc.i4.0
+ ret
+ }
+
+
+ .method static public int32 test_1_ceq_to_i4 () il managed {
+ .locals init (
+ int32 foo
+ )
+ ldc.i4 500
+ stloc foo
+ ldloc foo
+ ldc.i4 500
+ ceq
+ stloc foo
+ ldloc foo
+ ret
+ }
+
+ .method static public int32 test_3_shl_regvars () il managed {
+ .locals init (
+ int32 a,
+ int32 b,
+ int32 r1,
+ int32 r2,
+ int32 r3
+ )
+
+ ldc.i4.2
+ stloc a
+ ldc.i4.1
+ stloc b
+
+ ldloc a
+ ldloc b
+ shl
+ stloc r1
+
+ ldloc a
+ ldloc b
+ shl
+ stloc r2
+
+ ldloc a
+ ldloc b
+ shl
+ stloc r3
+
+ ldloc r1
+ ldc.i4.4
+ ceq
+
+ ldloc r2
+ ldc.i4.4
+ ceq
+
+ ldloc r3
+ ldc.i4.4
+ ceq
+
+ add
+ add
+
+ ret
+ }
+
+ .method static public int32 test_1_fceq_to_i4 () il managed {
+
+ .locals init (
+ float64 foo,
+ int32 val
+ )
+
+ ldc.r8 2
+ stloc foo
+
+ ldloc foo
+ ldc.r8 2
+ ceq
+ stloc val
+
+ ldloc val
+ ret
+ }
+
+ //
+ // This should be manually checked. Basically under -O=linears,
+ // you should not see tons of register spilling.
+ //
+ .method static public int32 test_1_bytedreg_free () il managed {
+ .locals init (
+ int32 foo
+ )
+ ldc.i4 500
+ stloc foo
+ ldloc foo
+ ldc.i4 500
+ ceq
+ stloc foo
+
+ ldloc foo
+ ldc.i4 1
+ ceq
+ stloc foo
+
+ ldloc foo
+ ldc.i4 1
+ ceq
+ stloc foo
+
+ ldloc foo
+ ldc.i4 1
+ ceq
+ stloc foo
+
+ ldloc foo
+ ldc.i4 1
+ ceq
+ stloc foo
+
+ ldloc foo
+ ret
+ }
+
+ //
+ // This should be manually checked. Basically under -O=linears,
+ // you should not see tons of register spilling.
+ //
+ .method static public int32 test_0_bytesreg1_free () il managed {
+ .locals init (
+ unsigned int8 dest,
+ int32 src,
+ unsigned int8& pdest
+ )
+
+ ldloca dest
+ stloc pdest
+
+ ldloc pdest
+ ldloc src
+ stind.i1
+
+ ldloc pdest
+ ldloc src
+ stind.i1
+
+ ldloc pdest
+ ldloc src
+ stind.i1
+
+ ldloc pdest
+ ldloc src
+ stind.i1
+
+ ldloc pdest
+ ldloc src
+ stind.i1
+
+ ldloc pdest
+ ldloc src
+ stind.i1
+
+ ldloc pdest
+ ldind.i1
+ ret
+ }
+
+ .method static public int32 test_1_shift_regvar () il managed {
+
+ .locals init (
+ int32 v7FFFFFFF,
+ int32 v1
+ )
+
+ ldc.i4 0x7FFFFFFF
+ stloc v7FFFFFFF
+
+ ldc.i4.1
+ stloc v1
+
+ ldloc v7FFFFFFF
+ ldloc v1
+ shl
+ ldc.i4 0xFFFFFFFE
+ ceq
+ ret
+ }
+
+ // this only happens with the managed pointer, not an unmanaged one.
+ .method static public int32 test_0_foo () il managed {
+
+ .locals init (
+ int32& buf
+ )
+
+ ldc.i4.5
+ localloc
+
+ stloc buf
+ ldloc buf
+
+ ldind.i4
+
+ ret
+ }
+
+ .method static public int32 test_0_localloc () cil managed {
+ .locals init (native int, native int, native int)
+
+ ldc.i4 6
+ localloc
+ conv.i
+ stloc.0
+
+ ldc.i4 6
+ localloc
+ conv.i
+ stloc.1
+
+ ldc.i4 6
+ localloc
+ conv.i
+ stloc.2
+
+ // br OK1
+ ldloc.1
+ ldc.i4 999999
+ stind.i4
+ ldloc.1
+ ldind.i4
+ ldc.i4 999999
+ beq OK1
+ br FAIL
+
+OK1:
+ ldloc.0
+ ldc.i4 999999
+ stind.i4
+ ldloc.0
+ ldind.i4
+ ldc.i4 999999
+ beq PASS
+
+FAIL: ldc.i4.1
+ ret
+
+PASS: ldc.i4.0
+ ret
+ }
+
+ .method static public int32 test_3_copy_used_bug () il managed {
+
+ .locals init (
+ int32 size,
+ int32 res
+ )
+
+ ldc.i4 0
+ stloc res
+
+ ldc.i4 1
+ stloc size
+
+ ldloc size
+ ldloc size
+ ldloc size
+ add
+ stloc size
+ ldloc size
+ add
+ stloc res
+
+ ldloc res
+ ret
+ }
+
+ // demonstrate that the copy_used_var is not a fix for the above bug
+ .method static public int32 test_3_copy_used_indir_bug () il managed {
+
+ .locals init (
+ int32 size,
+ int32 res
+ )
+
+ ldc.i4 0
+ stloc res
+
+ ldc.i4 1
+ stloc size
+
+ ldloc size
+ ldloca size
+ ldloc size
+ ldloc size
+ add
+ stind.i4
+ ldloc size
+ add
+ stloc res
+
+ ldloc res
+ ret
+ }
+
+ .method static public void do_nothing (int32 a) il managed {
+ ret
+ }
+
+ // demonstrate the block_split failure: needs -O=inline
+ // mini -O=inline --compile Tests:test_0_split_block_bug iltests.exe
+ .method static public int32 test_0_split_block_bug () il managed {
+
+ .locals init (
+ int32 i1
+ )
+
+ ldc.i4 1
+ stloc i1
+ test_label:
+ ldloc i1
+ call void class Tests::do_nothing (int32)
+ ldc.i4 0
+ brtrue test_label
+
+ ldc.i4 0
+ ret
+ }
+
+ .method public void inline_do_nothing () il managed {
+ ret
+ }
+ .method static public int32 test_1_checkthis_inlining () il managed {
+ ldnull
+ call instance void class Tests::inline_do_nothing ()
+ ldc.i4 1
+ ret
+ }
+
+ .class nested private auto ansi sealed beforefieldinit TailCallStruct
+ extends [mscorlib]System.ValueType {
+ .field public int32 a
+ .field public int32 b
+ }
+
+ .method static valuetype Tests/TailCallStruct tail1 (valuetype Tests/TailCallStruct arg) {
+ ldarga 0
+ ldarga 0
+ ldfld int32 Tests/TailCallStruct::a
+ ldc.i4.1
+ add
+ stfld int32 Tests/TailCallStruct::a
+ ldarga 0
+ ldarga 0
+ ldfld int32 Tests/TailCallStruct::a
+ ldc.i4.2
+ add
+ stfld int32 Tests/TailCallStruct::a
+ ldarg.0
+ ret
+ }
+
+ .method static valuetype Tests/TailCallStruct tail2 (valuetype Tests/TailCallStruct arg) {
+ ldarg.0
+ tail.
+ call valuetype Tests/TailCallStruct Tests::tail1 (valuetype Tests/TailCallStruct)
+ ret
+ }
+
+ .method static public int32 test_0_tail_calls () il managed {
+ .maxstack 16
+ .locals init (
+ valuetype Tests/TailCallStruct arg
+ )
+ ldloca 0
+ ldc.i4.2
+ stfld int32 Tests/TailCallStruct::a
+ ldloca 0
+ ldc.i4.4
+ stfld int32 Tests/TailCallStruct::b
+ ldloc.0
+ call valuetype Tests/TailCallStruct Tests::tail2 (valuetype Tests/TailCallStruct)
+ stloc.0
+ ldloca 0
+ ldfld int32 Tests/TailCallStruct::a
+ ldloca 0
+ ldfld int32 Tests/TailCallStruct::b
+ add
+ ldc.i4 9
+ sub
+ ret
+ }
+
+ .method static public int32 test_11_switch_with_nonempty_stack () il managed {
+ .maxstack 16
+
+ ldc.i4.5
+ ldc.i4.6
+ ldc.i4.1
+ switch (L0, L1)
+ L0:
+ add
+ ret
+ L1:
+ add
+ ret
+ }
+
+ .method public static int32 test_5_endfinally_with_nonempty_stack () il managed {
+ .maxstack 16
+
+ .try {
+ leave IL_0
+ }
+ finally {
+ ldc.i4.0
+ endfinally
+ }
+ IL_0: ldc.i4.5
+ ret
+ }
+
+ .method public static int32 test_0_conv_ovf_i8_neg () il managed {
+ .maxstack 16
+
+ ldc.i4.m1
+ conv.ovf.i8
+ conv.i4
+ ldc.i4.m1
+ beq L_OK
+ ldc.i4.1
+ ret
+ L_OK:
+ ldc.i4.0
+ ret
+ }
+
+ .method public static int32 test_0_get_type_from_handle_on_bblock_boundary () cil managed
+ {
+ .entrypoint
+ .maxstack 16
+
+ ldc.i4.1
+ brfalse OBJECT
+
+ ldtoken [mscorlib]System.String
+ br AFTER
+ OBJECT:
+ ldtoken [mscorlib]System.Object
+ AFTER:
+ call class [mscorlib]'System.Type' class [mscorlib]'System.Type'::'GetTypeFromHandle'(valuetype [mscorlib]'System.RuntimeTypeHandle')
+ callvirt string class [mscorlib]System.Type::get_FullName ()
+ ldstr "System.String"
+ callvirt bool class [mscorlib]System.Object::Equals(object)
+ ldc.i4.0
+ ceq
+ ret
+ }
+
+ .method public static int32 test_0_bug59580 ()
+ {
+ ldc.r4 float32(0x7FC00000)
+ ldc.r4 float32(0x7FC00000)
+ bge.un pass
+ br fail
+ pass:
+ ldc.i4.0
+ ret
+ fail:
+ ldc.i4.1
+ ret
+ }
+
+ .method public static int32 test_1_bug60056 () {
+ .locals init (int32 m5)
+
+ ldc.i4.m1
+ stloc.0
+
+ ldc.i4.1
+ conv.u8
+
+ ldloc.0
+ conv.i8
+ mul
+
+ ldc.i4.m1
+ conv.i8
+ ceq
+ ret
+ }
+
+ .method public static int32 test_1_conv_u8_cfold () {
+ ldc.i4.m1
+ conv.u8
+
+ ldc.i8 0x00000000ffffffff
+
+ ceq
+ ret
+ }
+}
diff --git a/mono/mini/inssel-amd64.brg b/mono/mini/inssel-amd64.brg
new file mode 100644
index 00000000000..f5bb85c3a8f
--- /dev/null
+++ b/mono/mini/inssel-amd64.brg
@@ -0,0 +1,755 @@
+#define MONO_EMIT_NEW_X86_COMPARE_MEMBASE_REG(cfg,basereg,offset,operand) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_X86_COMPARE_MEMBASE_REG; \
+ inst->inst_basereg = basereg; \
+ inst->inst_offset = offset; \
+ inst->sreg2 = operand; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_X86_COMPARE_MEMBASE_IMM(cfg,basereg,offset,operand) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_X86_COMPARE_MEMBASE_IMM; \
+ inst->inst_basereg = basereg; \
+ inst->inst_offset = offset; \
+ inst->inst_imm = operand; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+/* override the arch independant versions with fast x86 versions */
+
+#undef MONO_EMIT_BOUNDS_CHECK
+#undef MONO_EMIT_BOUNDS_CHECK_IMM
+
+#define MONO_EMIT_BOUNDS_CHECK(cfg, array_reg, array_type, array_length_field, index_reg) do { \
+ if (! (state->tree->flags & MONO_INST_NORANGECHECK)) { \
+ MONO_EMIT_NEW_X86_COMPARE_MEMBASE_REG (cfg, array_reg, G_STRUCT_OFFSET (array_type, array_length_field), index_reg); \
+ MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \
+ } \
+ } while (0)
+
+#define MONO_EMIT_BOUNDS_CHECK_IMM(cfg, array_reg, array_type, array_length_field, index_imm) do { \
+ if (! (state->tree->flags & MONO_INST_NORANGECHECK)) { \
+ MONO_EMIT_NEW_X86_COMPARE_MEMBASE_IMM (cfg, array_reg, G_STRUCT_OFFSET (array_type, array_length_field), index_imm); \
+ MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \
+ } \
+ } while (0)
+
+
+%%
+
+#
+# inssel-amd64.brg: burg file for special AMD64 instructions
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+# Paolo Molaro (lupus@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+stmt: OP_START_HANDLER {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, spvar->inst_basereg, spvar->inst_offset, X86_ESP);
+}
+
+stmt: CEE_ENDFINALLY {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, X86_ESP, spvar->inst_basereg, spvar->inst_offset);
+ tree->opcode = CEE_RET;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, X86_EAX, state->left->reg1);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, X86_ESP, spvar->inst_basereg, spvar->inst_offset);
+ tree->opcode = CEE_RET;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_LCONV_TO_R8 (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_LCONV_TO_R4 (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_I4 (base), reg) {
+ tree->opcode = OP_AMD64_ICOMPARE_MEMBASE_REG;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_I4 (base), OP_ICONST) {
+ tree->opcode = OP_AMD64_ICOMPARE_MEMBASE_IMM;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (reg, CEE_LDIND_I4 (base)) {
+ tree->opcode = OP_AMD64_ICOMPARE_REG_MEMBASE;
+ tree->sreg2 = state->right->left->tree->inst_basereg;
+ tree->inst_offset = state->right->left->tree->inst_offset;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I1 (base, OP_CEQ (cflags)) {
+ tree->opcode = OP_X86_SETEQ_MEMBASE;
+ tree->inst_offset = state->left->tree->inst_offset;
+ tree->inst_basereg = state->left->tree->inst_basereg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LOCALLOC (OP_ICONST) {
+ if (tree->flags & MONO_INST_INIT) {
+ /* microcoded in mini-x86.c */
+ tree->sreg1 = mono_regstate_next_int (s->rs);
+ tree->dreg = state->reg1;
+ MONO_EMIT_NEW_ICONST (s, tree->sreg1, state->left->tree->inst_c0);
+ mono_bblock_add_inst (s->cbb, tree);
+ } else {
+ guint32 size = state->left->tree->inst_c0;
+ size = (size + (MONO_ARCH_FRAME_ALIGNMENT - 1)) & ~ (MONO_ARCH_FRAME_ALIGNMENT - 1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, size);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, X86_ESP);
+ }
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->sreg1 = state->left->tree->dreg;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (reg) {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = X86_EAX;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (reg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, X86_EDX, state->left->reg2);
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = X86_EAX;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_LDIND_REF (OP_REGVAR),
+reg: CEE_LDIND_I (OP_REGVAR),
+reg: CEE_LDIND_I4 (OP_REGVAR),
+reg: CEE_LDIND_U4 (OP_REGVAR) "0" {
+ /* This rule might not work on all archs */
+ state->reg1 = state->left->tree->dreg;
+ tree->dreg = state->reg1;
+}
+
+stmt: OP_SETRET (CEE_LDIND_REF (OP_REGVAR)),
+stmt: OP_SETRET (CEE_LDIND_I4 (OP_REGVAR)),
+stmt: OP_SETRET (CEE_LDIND_U4 (OP_REGVAR)),
+stmt: OP_SETRET (CEE_LDIND_I (OP_REGVAR)) {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->dreg = X86_EAX;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (freg) {
+ if (s->method->signature->ret->type == MONO_TYPE_R4)
+ tree->opcode = OP_AMD64_SET_XMMREG_R4;
+ else
+ tree->opcode = OP_AMD64_SET_XMMREG_R8;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = 0; /* %xmm0 */
+ mono_bblock_add_inst (s->cbb, tree);
+ /* nothing to do */
+}
+
+stmt: OP_SETRET (OP_ICONST) {
+ if (state->left->tree->inst_c0 == 0) {
+ MONO_EMIT_BIALU (s, tree, CEE_XOR, AMD64_RAX, AMD64_RAX, AMD64_RAX);
+ }
+ else {
+ tree->opcode = OP_ICONST;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = X86_EAX;
+ mono_bblock_add_inst (s->cbb, tree);
+ }
+}
+
+stmt: OP_OUTARG (reg) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_REG (reg) {
+ MonoCallInst *call = (MonoCallInst*)tree->inst_right;
+ guint64 regpair;
+
+ tree->opcode = OP_SETREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = mono_regstate_next_int (s->rs);
+ mono_bblock_add_inst (s->cbb, tree);
+
+ regpair = (((guint64)tree->unused) << 32) + tree->dreg;
+ call->out_ireg_args = g_slist_append (call->out_ireg_args, (gpointer)(regpair));
+}
+
+stmt: OP_OUTARG_REG (OP_I8CONST),
+stmt: OP_OUTARG_REG (OP_ICONST) {
+ MonoCallInst *call = (MonoCallInst*)tree->inst_right;
+ guint64 regpair;
+
+ tree->opcode = OP_ICONST;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = mono_regstate_next_int (s->rs);
+ mono_bblock_add_inst (s->cbb, tree);
+
+ regpair = (((guint64)tree->unused) << 32) + tree->dreg;
+ call->out_ireg_args = g_slist_append (call->out_ireg_args, (gpointer)(regpair));
+}
+
+stmt: OP_OUTARG_REG (CEE_LDIND_I (OP_REGVAR)),
+stmt: OP_OUTARG_REG (CEE_LDIND_I8 (OP_REGVAR)),
+stmt: OP_OUTARG_REG (CEE_LDIND_I4 (OP_REGVAR)),
+stmt: OP_OUTARG_REG (CEE_LDIND_U4 (OP_REGVAR)),
+stmt: OP_OUTARG_REG (CEE_LDIND_REF (OP_REGVAR)) {
+ MonoCallInst *call = (MonoCallInst*)tree->inst_right;
+ guint64 regpair;
+
+ tree->opcode = OP_SETREG;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->dreg = mono_regstate_next_int (s->rs);
+ mono_bblock_add_inst (s->cbb, tree);
+
+ regpair = (((guint64)tree->unused) << 32) + tree->dreg;
+ call->out_ireg_args = g_slist_append (call->out_ireg_args, (gpointer)(regpair));
+}
+
+# we need to reduce this code duplication with some burg syntax extension
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I4 (OP_REGVAR)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_U4 (OP_REGVAR)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I (OP_REGVAR)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I4 (base)) {
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_U4 (base)) {
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I (base)) {
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (base)) {
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDOBJ (reg)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (freg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
+ tree->opcode = OP_STORER8_MEMBASE_REG;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_destbasereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R4 (freg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
+ tree->opcode = OP_STORER4_MEMBASE_REG;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_destbasereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R8 (freg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
+ tree->opcode = OP_STORER8_MEMBASE_REG;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_destbasereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_AMD64_OUTARG_XMMREG_R4 (freg) {
+ MonoCallInst *call = (MonoCallInst*)tree->inst_right;
+ guint64 regpair;
+
+ tree->opcode = OP_AMD64_SET_XMMREG_R4;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = mono_regstate_next_float (s->rs);
+ mono_bblock_add_inst (s->cbb, tree);
+
+ regpair = (((guint64)tree->unused) << 32) + tree->dreg;
+ call->out_freg_args = g_slist_append (call->out_freg_args, (gpointer)(regpair));
+}
+
+stmt: OP_AMD64_OUTARG_XMMREG_R8 (freg) {
+ MonoCallInst *call = (MonoCallInst*)tree->inst_right;
+ guint64 regpair;
+
+ tree->opcode = OP_AMD64_SET_XMMREG_R8;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = mono_regstate_next_float (s->rs);
+ mono_bblock_add_inst (s->cbb, tree);
+
+ regpair = (((guint64)tree->unused) << 32) + tree->dreg;
+ call->out_freg_args = g_slist_append (call->out_freg_args, (gpointer)(regpair));
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (base)) {
+ MonoInst *vt = state->left->left->tree;
+ //g_print ("vt size: %d at R%d + %d\n", tree->inst_imm, vt->inst_basereg, vt->inst_offset);
+
+ if (!tree->inst_imm)
+ return;
+
+ if (tree->inst_imm <= 8) {
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = vt->inst_basereg;
+ tree->inst_offset = vt->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+ } else if (tree->inst_imm <= 20) {
+ int sz = tree->inst_imm;
+ sz += 8;
+ sz &= ~8;
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, sz);
+ mini_emit_memcpy (s, X86_ESP, 0, vt->inst_basereg, vt->inst_offset, tree->inst_imm, 0);
+ } else {
+ tree->opcode = OP_X86_PUSH_OBJ;
+ tree->inst_basereg = vt->inst_basereg;
+ tree->inst_offset = vt->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+ }
+}
+
+stmt: OP_OUTARG_VT (OP_ICONST) {
+ tree->opcode = OP_X86_PUSH_IMM;
+ tree->inst_imm = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_VT (reg) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_AMD64_OUTARG_ALIGN_STACK {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
+}
+
+base: OP_INARG_VT (base) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset);
+}
+
+reg: OP_LDADDR (OP_INARG_VT (base)) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+}
+
+reg: CEE_LDOBJ (OP_INARG_VT (base)) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+}
+
+reg: OP_LDADDR (OP_REGOFFSET) "1" {
+ if (state->left->tree->inst_offset) {
+ tree->opcode = OP_X86_LEA_MEMBASE;
+ tree->sreg1 = state->left->tree->inst_basereg;
+ tree->inst_imm = state->left->tree->inst_offset;
+ tree->dreg = state->reg1;
+ } else {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->tree->inst_basereg;
+ tree->dreg = state->reg1;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_LDOBJ (OP_REGOFFSET) "1" {
+ if (state->left->tree->inst_offset) {
+ tree->opcode = OP_X86_LEA_MEMBASE;
+ tree->sreg1 = state->left->tree->inst_basereg;
+ tree->inst_imm = state->left->tree->inst_offset;
+ tree->dreg = state->reg1;
+ } else {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->tree->inst_basereg;
+ tree->dreg = state->reg1;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_LDELEMA (reg, reg) "15" {
+ guint32 size = mono_class_array_element_size (tree->klass);
+
+ MONO_EMIT_BOUNDS_CHECK (s, state->left->reg1, MonoArray, max_length, state->right->reg1);
+
+ if (size == 1 || size == 2 || size == 4 || size == 8) {
+ static const int fast_log2 [] = { 1, 0, 1, -1, 2, -1, -1, -1, 3 };
+ tree->opcode = OP_X86_LEA;
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->right->reg1;
+ tree->inst_imm = G_STRUCT_OFFSET (MonoArray, vector);
+ tree->unused = fast_log2 [size];
+ mono_bblock_add_inst (s->cbb, tree);
+ } else {
+ int mult_reg = mono_regstate_next_int (s->rs);
+ int add_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_MUL_IMM, mult_reg, state->right->reg1, size);
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, add_reg, mult_reg, state->left->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, add_reg, G_STRUCT_OFFSET (MonoArray, vector));
+ }
+}
+
+stmt: CEE_STIND_R8 (OP_REGVAR, freg) {
+ /* nothing to do: the value is already on the FP stack */
+}
+
+stmt: CEE_STIND_I4 (base, CEE_ADD (CEE_LDIND_I4 (base), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+
+ if (con == 1) {
+ tree->opcode = OP_X86_INC_MEMBASE;
+ } else {
+ tree->opcode = OP_X86_ADD_MEMBASE_IMM;
+ tree->inst_imm = con;
+ }
+
+ tree->inst_basereg = state->left->tree->inst_basereg;
+ tree->inst_offset = state->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBTREE_TYPE *t1 = state->right->left->left->tree;
+ MBTREE_TYPE *t2 = state->left->tree;
+ MBCOND (t1->inst_basereg == t2->inst_basereg &&
+ t1->inst_offset == t2->inst_offset);
+ return 2;
+}
+
+stmt: CEE_STIND_I4 (base, CEE_SUB (CEE_LDIND_I4 (base), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+
+ if (con == 1) {
+ tree->opcode = OP_X86_DEC_MEMBASE;
+ } else {
+ tree->opcode = OP_X86_SUB_MEMBASE_IMM;
+ tree->inst_imm = con;
+ }
+
+ tree->inst_basereg = state->left->tree->inst_basereg;
+ tree->inst_offset = state->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBTREE_TYPE *t1 = state->right->left->left->tree;
+ MBTREE_TYPE *t2 = state->left->tree;
+ MBCOND (t1->inst_basereg == t2->inst_basereg &&
+ t1->inst_offset == t2->inst_offset);
+ return 2;
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_SUB (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+ int dreg = state->left->tree->dreg;
+ int sreg = state->right->left->left->tree->dreg;
+
+ if (con == 1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_DEC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else if (con == -1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_INC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else {
+ tree->opcode = OP_SUB_IMM;
+ tree->inst_imm = con;
+ tree->sreg1 = sreg;
+ tree->dreg = dreg;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I (OP_REGVAR, CEE_ADD (CEE_LDIND_I (OP_REGVAR), OP_ICONST)),
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_ADD (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+ int dreg = state->left->tree->dreg;
+ int sreg = state->right->left->left->tree->dreg;
+
+ if (con == 1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_INC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else if (con == -1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_DEC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else {
+ tree->opcode = OP_ADD_IMM;
+ tree->inst_imm = con;
+ tree->sreg1 = sreg;
+ tree->dreg = dreg;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_LDIND_I2 (OP_REGVAR) {
+ MONO_EMIT_UNALU (s, tree, OP_SEXT_I2, state->reg1, state->left->tree->dreg);
+}
+
+# The XOR rule
+stmt: CEE_STIND_I8 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I4 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I2 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I1 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_REF (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I8 (OP_REGVAR, OP_I8CONST),
+stmt: CEE_STIND_I4 (OP_REGVAR, OP_I8CONST),
+stmt: CEE_STIND_I2 (OP_REGVAR, OP_I8CONST),
+stmt: CEE_STIND_I1 (OP_REGVAR, OP_I8CONST),
+stmt: CEE_STIND_REF (OP_REGVAR, OP_I8CONST),
+stmt: CEE_STIND_I (OP_REGVAR, OP_I8CONST) {
+ int r = state->left->tree->dreg;
+ MONO_EMIT_BIALU (s, tree, CEE_XOR, r, r, r);
+} cost {
+ MBCOND (!state->right->tree->inst_c0);
+
+ return 0;
+}
+
+# on x86, fp compare overwrites EAX, so we must
+# either improve the local register allocator or
+# emit coarse opcodes which saves EAX for us.
+
+reg: OP_CEQ (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCEQ, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+# fpcflags overwrites EAX, but this does not matter for statements
+# because we are the last operation in the tree.
+
+stmt: CEE_BNE_UN (fpcflags) {
+ tree->opcode = OP_FBNE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (fpcflags) {
+ tree->opcode = OP_FBEQ;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (fpcflags) {
+ tree->opcode = OP_FBLT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (fpcflags) {
+ tree->opcode = OP_FBLT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (fpcflags) {
+ tree->opcode = OP_FBGT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (fpcflags) {
+ tree->opcode = OP_FBGT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (fpcflags) {
+ tree->opcode = OP_FBGE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (fpcflags) {
+ tree->opcode = OP_FBGE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (fpcflags) {
+ tree->opcode = OP_FBLE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (fpcflags) {
+ tree->opcode = OP_FBLE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_POP (freg) "0" {
+ /* we need to pop the value from the x86 FP stack */
+ MONO_EMIT_UNALU (s, tree, OP_X86_FPOP, -1, state->left->reg1);
+}
+
+# override the rules in inssel-float.brg that work for machines with FP registers
+
+freg: OP_FCONV_TO_R8 (freg) "0" {
+ tree->opcode = OP_FMOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_FCONV_TO_R4 (freg) "0" {
+ tree->opcode = OP_FMOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_ADD(reg, CEE_LDIND_I4 (base)) {
+ MonoInst *base = state->right->left->tree;
+
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = base->inst_basereg;
+ tree->inst_offset = base->inst_offset;
+ tree->opcode = OP_X86_ADD_MEMBASE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_SUB(reg, CEE_LDIND_I4 (base)) {
+ MonoInst *base = state->right->left->tree;
+
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = base->inst_basereg;
+ tree->inst_offset = base->inst_offset;
+ tree->opcode = OP_X86_SUB_MEMBASE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_MUL(reg, CEE_LDIND_I4 (base)) {
+ MonoInst *base = state->right->left->tree;
+
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = base->inst_basereg;
+ tree->inst_offset = base->inst_offset;
+ tree->opcode = OP_X86_MUL_MEMBASE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LSHL (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LSHL (reg, OP_ICONST) "0" {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHL_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: OP_LSHR (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LSHR (reg, OP_ICONST) "0" {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: OP_LSHR_UN (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LSHR_UN (reg, OP_ICONST) "0" {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHR_UN_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: OP_X86_TLS_GET {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+%%
diff --git a/mono/mini/inssel-float.brg b/mono/mini/inssel-float.brg
new file mode 100644
index 00000000000..cc9bc579dcb
--- /dev/null
+++ b/mono/mini/inssel-float.brg
@@ -0,0 +1,233 @@
+%%
+
+#
+# inssel-float.brg: burg file for floating point instructions
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+#
+# load/store
+#
+
+freg: CEE_LDIND_R4 (base) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADR4_MEMBASE, state->reg1,
+ state->left->tree->inst_basereg, state->left->tree->inst_offset);
+}
+
+freg: CEE_LDIND_R8 (base) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADR8_MEMBASE, state->reg1,
+ state->left->tree->inst_basereg, state->left->tree->inst_offset);
+}
+
+stmt: CEE_STIND_R4 (base, freg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STORER4_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+stmt: CEE_STIND_R8 (base, freg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STORER8_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+freg: OP_R4CONST {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_R8CONST {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#
+# fp alu operations
+
+
+freg: OP_FADD (freg, freg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+freg: OP_FSUB (freg, freg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+freg: OP_FMUL (freg, freg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+freg: OP_FDIV (freg, freg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+freg: OP_FREM (freg, freg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+freg: OP_FNEG (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: CEE_CKFINITE (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: OP_SIN (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: OP_COS (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: OP_ABS (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: OP_TAN (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: OP_ATAN (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: OP_SQRT (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+#
+# floating point conversions
+#
+
+reg: OP_FCONV_TO_I4 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_U4 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_OVF_I4 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_OVF_U4 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_OVF_I8 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_OVF_U8 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_OVF_I (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_OVF_U (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_I (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_U (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_I2 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_U2 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_I1 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_U1 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: OP_FCONV_TO_R8 (freg) {
+ MONO_EMIT_UNALU (s, tree, OP_FMOVE, state->reg1, state->left->reg1);
+}
+
+freg: OP_FCONV_TO_R4 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: CEE_CONV_R4 (reg) "2" {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: CEE_CONV_R8 (reg) "2" {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+freg: CEE_CONV_R_UN (reg) "2" {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+#
+# control flow
+#
+
+# CPUs using the same condition flags for integers and float
+# can use the following chain rule:
+# cflags: fpcflags "0"
+# that way all branches are handled by inssel.brg
+
+fpcflags: OP_COMPARE (freg, freg) {
+ tree->opcode = OP_FCOMPARE;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#
+# miscellaneous fp operations
+#
+
+stmt: CEE_POP (freg) {
+ /* do nothing */
+}
+
+
+freg: CEE_CKFINITE (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%%
diff --git a/mono/mini/inssel-long.brg b/mono/mini/inssel-long.brg
new file mode 100644
index 00000000000..5c87129a692
--- /dev/null
+++ b/mono/mini/inssel-long.brg
@@ -0,0 +1,762 @@
+%%
+
+#
+# inssel-long.brg: burg file for 64bit architectures
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+reg: OP_I8CONST {
+ MONO_EMIT_NEW_I8CONST (s, state->reg1, tree->inst_l);
+}
+
+reg: CEE_LDIND_I8 (base) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI8_MEMBASE, state->reg1,
+ state->left->tree->inst_basereg, state->left->tree->inst_offset);
+}
+
+stmt: CEE_STIND_I8 (base, reg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STOREI8_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+stmt: CEE_STIND_REF (base, OP_I8CONST),
+stmt: CEE_STIND_I (base, OP_I8CONST),
+stmt: CEE_STIND_I8 (base, OP_I8CONST),
+stmt: CEE_STIND_REF (base, OP_ICONST),
+stmt: CEE_STIND_I (base, OP_ICONST),
+stmt: CEE_STIND_I8 (base, OP_ICONST) {
+ MONO_EMIT_STORE_MEMBASE_IMM (s, tree, OP_STOREI8_MEMBASE_IMM, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->tree->inst_l);
+}
+
+stmt: CEE_STIND_I8 (reg, reg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STOREI8_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+base: OP_LADD (base, OP_ICONST) "0" {
+ tree->inst_offset = state->left->tree->inst_offset + state->right->tree->inst_c0;
+ tree->inst_basereg = state->left->tree->inst_basereg;
+}
+
+base: OP_LADD (CEE_LDIND_REF (OP_REGVAR), OP_ICONST),
+base: OP_LADD (CEE_LDIND_I (OP_REGVAR), OP_ICONST) "0" {
+ tree->inst_offset = state->right->tree->inst_c0;
+ tree->inst_basereg = state->left->left->tree->dreg;
+}
+
+reg: OP_LADD (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LSUB (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_SUB, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LNEG (reg) {
+ MONO_EMIT_NEW_UNALU (s, CEE_NEG, state->reg1, state->left->reg1);
+}
+
+reg: OP_LNOT (reg) {
+ MONO_EMIT_NEW_UNALU (s, CEE_NOT, state->reg1, state->left->reg1);
+}
+
+reg: OP_LAND (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_AND, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LOR (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_OR, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LXOR (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_XOR, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+
+reg: OP_LADD_OVF (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, OV, "OverflowException");
+}
+
+reg: OP_LADD_OVF_UN (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, C, "OverflowException");
+}
+
+reg: OP_LSUB_OVF (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, OV, "OverflowException");
+}
+
+reg: OP_LSUB_OVF_UN (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, C, "OverflowException");
+}
+
+reg: OP_LONG_SHRUN_32 (reg) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHR_UN_IMM, state->reg1, state->left->reg1, 32);
+}
+
+#
+# shift operations
+#
+
+reg: OP_LSHL (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LSHL (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHL_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: OP_LSHR (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LSHR_IMM (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: OP_LSHR_UN (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: OP_LSHR_UN (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHR_UN_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+#
+# Conversions
+#
+
+reg: CEE_CONV_I8 (reg) {
+ /* Sign extend the value in the lower word into the upper word */
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_CONV_U8 (reg) {
+ /* Clean out the upper word */
+ /* Sign extend the value in the lower word into the upper word */
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+i8con: CEE_CONV_U8 (OP_ICONST) "0" {
+ /*
+ * This is needed since constant propagation eliminates some
+ * stind.i4/ldind.i4 pairs, along with the conversions done by them.
+ */
+ int data = state->left->tree->inst_c0;
+ tree->opcode = OP_I8CONST;
+ tree->inst_ls_word = data;
+ tree->inst_ms_word = 0;
+}
+
+reg: OP_LCONV_TO_I4 (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_I8 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_FCONV_TO_U8 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I4 (i8con) {
+ MONO_EMIT_NEW_ICONST (s, state->reg1, state->left->tree->inst_ls_word);
+}
+
+reg: OP_LCONV_TO_I4 (reg) {
+ /* Sign extend the value in the lower word into the upper word */
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SHR_IMM, state->reg1, state->left->reg1, 0);
+}
+
+reg: OP_LCONV_TO_U4 (reg) {
+ /* Clean out the upper word */
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SHR_UN_IMM, state->reg1, state->left->reg1, 0);
+}
+
+reg: OP_LCONV_TO_U8 (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I8 (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_U (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I1 (reg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_U1 (reg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_U1, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I2 (reg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_U2 (reg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_U2, state->reg1, state->left->reg1);
+}
+
+
+reg: OP_LCONV_TO_OVF_I1 (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 127);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -128);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U1 (reg) {
+ /* probe value to be within 0 to 255 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 255);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xff);
+}
+
+reg: OP_LCONV_TO_OVF_U1_UN (reg) {
+ /* probe value to be within 0 to 255 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 255);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xff);
+}
+
+reg: OP_LCONV_TO_OVF_I2 (reg) {
+ /* Probe value to be within -32768 and 32767 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 32767);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -32768);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U2 (reg) {
+ /* Probe value to be within 0 and 65535 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffff);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xffff);
+}
+
+reg: OP_LCONV_TO_OVF_U2_UN (reg) {
+ /* Probe value to be within 0 and 65535 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffff);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xffff);
+}
+
+reg: OP_LCONV_TO_OVF_I4 (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0x7fffffff);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -2147483648);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U4_UN (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffffffff);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U4 (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffffffffUL);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg1, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I_UN (reg),
+reg: OP_LCONV_TO_OVF_I8_UN (reg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg1, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U8 (reg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg1, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I8 (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U8_UN (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+freg: OP_LCONV_TO_R_UN (lreg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_OVF_I8 (reg) {
+ /* Sign extend the value in the lower word into the upper word */
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SHR_IMM, state->reg1, state->left->reg1, 0);
+}
+
+reg: CEE_CONV_OVF_I8_UN (reg) {
+ /* an unsigned 32 bit num always fits in a signed 64 bit one */
+ /* Clean out the upper word */
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SHR_UN_IMM, state->reg1, state->left->reg1, 0);
+}
+
+reg: CEE_CONV_OVF_U8 (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_OVF_U8_UN (reg) {
+ g_assert_not_reached ();
+}
+
+
+
+
+reg: OP_LCALLVIRT (reg) {
+ mini_emit_virtual_call (s, state, tree, OP_LCALL, OP_LCALL_MEMBASE);
+}
+
+reg: OP_LCALL {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LCALL_REG (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LCALL_REG (OP_ICONST) {
+ tree->opcode = OP_LCALL;
+ ((MonoCallInst*)tree)->fptr = state->left->tree->inst_p0;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+
+
+stmt: CEE_STIND_I4 (OP_REGVAR, OP_ICONST) {
+ tree->inst_c0 = state->right->tree->inst_c0;
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->left->tree->dreg, state->right->reg1);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_LDIND_I4 (OP_REGVAR)) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->left->tree->dreg, state->right->left->tree->dreg);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_LDIND_I4 (base)) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE, state->left->tree->dreg,
+ state->right->left->tree->inst_basereg,
+ state->right->left->tree->inst_offset);
+}
+
+cflags: OP_LCOMPARE (reg, reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_LCOMPARE (CEE_LDIND_I8 (OP_REGVAR), reg) {
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_LCOMPARE (CEE_LDIND_I (OP_REGVAR), CEE_LDIND_I (OP_REGVAR)) {
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->sreg2 = state->right->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_LCOMPARE (CEE_LDIND_I8 (OP_REGVAR), OP_ICONST) {
+ tree->opcode = OP_COMPARE_IMM;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBCOND (mono_arch_is_inst_imm (state->right->tree->inst_c0));
+
+ return 0;
+}
+
+cflags: OP_LCOMPARE (reg, OP_ICONST) {
+ tree->opcode = OP_COMPARE_IMM;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBCOND (mono_arch_is_inst_imm (state->right->tree->inst_c0));
+
+ return 0;
+}
+
+cflags: OP_LCOMPARE (reg, OP_I8CONST) {
+ tree->opcode = OP_COMPARE_IMM;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_imm = state->right->tree->inst_l;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBCOND (mono_arch_is_inst_imm (state->right->tree->inst_l));
+
+ return 0;
+}
+
+stmt: CEE_BNE_UN (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#
+# 32 bit rules
+#
+
+#
+# basic alu operations
+#
+
+reg: CEE_AND (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IAND, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_AND (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_IAND_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_OR (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IOR, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_OR (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_IOR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_XOR (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IXOR, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_XOR (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_IXOR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_NEG (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_INEG, state->reg1, state->left->reg1);
+}
+
+reg: CEE_NOT (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_INOT, state->reg1, state->left->reg1);
+}
+
+reg: CEE_ADD (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IADD, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_ADD (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_IADD_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_ADD_OVF (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_IADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, IOV, "OverflowException");
+}
+
+reg: CEE_ADD_OVF_UN (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_IADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, IC, "OverflowException");
+}
+
+reg: CEE_SUB (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_ISUB, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SUB (reg, CEE_LDIND_I4 (OP_REGVAR)) {
+ MONO_EMIT_BIALU (s, tree, OP_ISUB, state->reg1, state->left->reg1, state->right->left->tree->dreg);
+}
+
+reg: CEE_SUB (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ISUB_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_SUB_OVF (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_ISUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, IOV, "OverflowException");
+}
+
+reg: CEE_SUB_OVF_UN (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_ISUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, IC, "OverflowException");
+}
+
+#
+# shift operations
+#
+
+reg: CEE_SHL (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_ISHL, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SHL (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ISHL_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_SHR (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_ISHR, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SHR (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ISHR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_SHR_UN (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_ISHR_UN, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SHR_UN (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ISHR_UN_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+#
+# mult/div operations
+#
+
+reg: CEE_MUL (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IMUL, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_MUL (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_IMUL_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_MUL_OVF (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IMUL_OVF, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_MUL_OVF_UN (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IMUL_OVF_UN, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_DIV (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IDIV, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+#reg: CEE_DIV (reg, OP_ICONST) {
+# MONO_EMIT_BIALU_IMM (s, tree, OP_IDIV_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+#}
+
+reg: CEE_DIV_UN (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IDIV_UN, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+#reg: CEE_DIV_UN (reg, OP_ICONST) {
+# MONO_EMIT_BIALU_IMM (s, tree, OP_IDIV_UN_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+#}
+
+reg: CEE_REM (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IREM, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+#reg: CEE_REM (reg, OP_ICONST) {
+# MONO_EMIT_BIALU_IMM (s, tree, OP_IREM_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+#}
+
+reg: CEE_REM_UN (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, OP_IREM_UN, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+#reg: CEE_REM_UN (reg, OP_ICONST) {
+# MONO_EMIT_BIALU_IMM (s, tree, OP_IREM_UN_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+#}
+
+c32flags: OP_COMPARE (reg, reg) {
+ tree->opcode = OP_ICOMPARE;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+c32flags: OP_COMPARE (CEE_LDIND_I (OP_REGVAR), CEE_LDIND_I (OP_REGVAR)) {
+ tree->opcode = OP_ICOMPARE;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->sreg2 = state->right->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+c32flags: OP_COMPARE (CEE_LDIND_I (OP_REGVAR), OP_ICONST) {
+ tree->opcode = OP_ICOMPARE_IMM;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+c32flags: OP_COMPARE (CEE_LDIND_I4 (OP_REGVAR), reg) {
+ tree->opcode = OP_ICOMPARE;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+c32flags: OP_COMPARE (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST) {
+ tree->opcode = OP_ICOMPARE_IMM;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+c32flags: OP_COMPARE (reg, OP_ICONST) {
+ tree->opcode = OP_ICOMPARE_IMM;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BNE_UN (c32flags) {
+ tree->opcode = OP_IBNE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (c32flags) {
+ tree->opcode = OP_IBEQ;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (c32flags) {
+ tree->opcode = OP_IBLT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (c32flags) {
+ tree->opcode = OP_IBLT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (c32flags) {
+ tree->opcode = OP_IBGT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (c32flags) {
+ tree->opcode = OP_IBGT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (c32flags) {
+ tree->opcode = OP_IBGE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (c32flags) {
+ tree->opcode = OP_IBGE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (c32flags) {
+ tree->opcode = OP_IBLE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (c32flags) {
+ tree->opcode = OP_IBLE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_CEQ (c32flags) {
+ tree->opcode = OP_ICEQ;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_CLT (c32flags) {
+ tree->opcode = OP_ICLT;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_CLT_UN (c32flags) {
+ tree->opcode = OP_ICLT_UN;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_CGT (c32flags) {
+ tree->opcode = OP_ICGT;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_CGT_UN (c32flags) {
+ tree->opcode = OP_ICGT_UN;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+%%
diff --git a/mono/mini/inssel-long32.brg b/mono/mini/inssel-long32.brg
new file mode 100644
index 00000000000..404ce75e6f3
--- /dev/null
+++ b/mono/mini/inssel-long32.brg
@@ -0,0 +1,924 @@
+%%
+
+#
+# inssel-long32.brg: burg file for integer instructions on 32bit architectures
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+#
+# 32 bit rules
+#
+
+#
+# basic alu operations
+#
+
+reg: CEE_AND (reg, reg),
+reg: CEE_OR (reg, reg),
+reg: CEE_XOR (reg, reg),
+reg: CEE_ADD (reg, reg),
+reg: CEE_SUB (reg, reg),
+reg: CEE_MUL (reg, reg),
+reg: CEE_MUL_OVF (reg, reg),
+reg: CEE_MUL_OVF_UN (reg, reg),
+reg: CEE_DIV (reg, reg),
+reg: CEE_DIV_UN (reg, reg),
+reg: CEE_REM (reg, reg),
+reg: CEE_REM_UN (reg, reg),
+reg: CEE_SHL (reg, reg),
+reg: CEE_SHR (reg, reg),
+reg: CEE_SHR_UN (reg, reg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_NEG (reg),
+reg: CEE_NOT (reg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+
+reg: CEE_AND (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_OR (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_OR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_XOR (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_XOR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_ADD (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADD_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_SUB (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SUB_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_MUL (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_MUL_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_SHL (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SHL_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_SHR (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SHR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_SHR_UN (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SHR_UN_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: CEE_ADD_OVF (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, OV, "OverflowException");
+}
+
+reg: CEE_ADD_OVF_UN (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, C, "OverflowException");
+}
+
+reg: CEE_SUB (reg, CEE_LDIND_I4 (OP_REGVAR)) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->left->tree->dreg);
+}
+
+reg: CEE_SUB_OVF (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, OV, "OverflowException");
+}
+
+reg: CEE_SUB_OVF_UN (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_COND_EXC (s, C, "OverflowException");
+}
+
+cflags: OP_COMPARE (reg, reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_REF (OP_REGVAR), reg),
+cflags: OP_COMPARE (CEE_LDIND_I (OP_REGVAR), reg),
+cflags: OP_COMPARE (CEE_LDIND_I4 (OP_REGVAR), reg),
+cflags: OP_COMPARE (CEE_LDIND_U4 (OP_REGVAR), reg) {
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_REF (OP_REGVAR), CEE_LDIND_REF (OP_REGVAR)),
+cflags: OP_COMPARE (CEE_LDIND_I (OP_REGVAR), CEE_LDIND_I (OP_REGVAR)),
+cflags: OP_COMPARE (CEE_LDIND_I4 (OP_REGVAR), CEE_LDIND_I4 (OP_REGVAR)),
+cflags: OP_COMPARE (CEE_LDIND_U4 (OP_REGVAR), CEE_LDIND_U4 (OP_REGVAR)) {
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->sreg2 = state->right->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_REF (OP_REGVAR), OP_ICONST),
+cflags: OP_COMPARE (CEE_LDIND_I (OP_REGVAR), OP_ICONST),
+cflags: OP_COMPARE (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST),
+cflags: OP_COMPARE (CEE_LDIND_U4 (OP_REGVAR), OP_ICONST) {
+ tree->opcode = OP_COMPARE_IMM;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (reg, OP_ICONST) {
+ tree->opcode = OP_COMPARE_IMM;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BNE_UN (cflags),
+stmt: CEE_BEQ (cflags),
+stmt: CEE_BLT (cflags),
+stmt: CEE_BLT_UN (cflags),
+stmt: CEE_BGT (cflags),
+stmt: CEE_BGT_UN (cflags),
+stmt: CEE_BGE (cflags),
+stmt: CEE_BGE_UN (cflags),
+stmt: CEE_BLE (cflags),
+stmt: CEE_BLE_UN (cflags) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_CEQ (cflags),
+reg: OP_CLT (cflags),
+reg: OP_CLT_UN (cflags),
+reg: OP_CGT (cflags),
+reg: OP_CGT_UN (cflags) {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#
+# 64 bit rules
+#
+
+#
+# We use a new non-terminal called "lreg" for 64bit registers, and
+# emulate lreg with 2 32bit registers.
+#
+
+stmt: CEE_POP (lreg) {
+ /* do nothing */
+}
+
+i8con: CEE_CONV_I8 (OP_ICONST) "0" {
+ int data = state->left->tree->inst_c0;
+ tree->opcode = OP_I8CONST;
+ tree->inst_ls_word = data;
+ if (data < 0)
+ tree->inst_ms_word = -1;
+ else
+ tree->inst_ms_word = 0;
+}
+
+i8con: CEE_CONV_U8 (OP_ICONST) "0" {
+ int data = state->left->tree->inst_c0;
+ tree->opcode = OP_I8CONST;
+ tree->inst_ls_word = data;
+ tree->inst_ms_word = 0;
+}
+
+i8con: OP_I8CONST "0"
+
+lreg: OP_ICONST {
+ int data = state->tree->inst_c0;
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, data);
+
+ if (data >= 0)
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+ else
+ MONO_EMIT_NEW_ICONST (s, state->reg2, -1);
+}
+
+lreg: OP_I8CONST {
+ MONO_EMIT_NEW_ICONST (s, state->reg1, tree->inst_ls_word);
+ MONO_EMIT_NEW_ICONST (s, state->reg2, tree->inst_ms_word);
+}
+
+lreg: CEE_LDIND_I8 (base) {
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, state->reg1,
+ state->left->tree->inst_basereg, state->left->tree->inst_offset + MINI_LS_WORD_OFFSET);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, state->reg2,
+ state->left->tree->inst_basereg, state->left->tree->inst_offset + MINI_MS_WORD_OFFSET);
+}
+
+stmt: CEE_STIND_I8 (base, lreg) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset + MINI_MS_WORD_OFFSET, state->right->reg2);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset + MINI_LS_WORD_OFFSET, state->right->reg1);
+}
+
+stmt: CEE_STIND_I8 (base, i8con) {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STOREI4_MEMBASE_IMM, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset + MINI_MS_WORD_OFFSET, state->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STOREI4_MEMBASE_IMM, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset + MINI_LS_WORD_OFFSET, state->right->tree->inst_ls_word);
+}
+
+lreg: OP_BIGMUL (reg, reg),
+lreg: OP_BIGMUL_UN (reg, reg) {
+ MONO_EMIT_NEW_BIALU (s, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+lreg: OP_LONG_SHRUN_32 (lreg) {
+ /* just move the upper half to the lower and zero the high word */
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg2);
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+}
+
+reg: OP_LCONV_TO_I4 (OP_LONG_SHRUN_32 (lreg)),
+reg: OP_LCONV_TO_U4 (OP_LONG_SHRUN_32 (lreg)) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->left->reg2);
+}
+
+
+lreg: OP_LONG_SHRUN_32 (CEE_LDIND_I8 (base)) {
+ /* just move the upper half to the lower and zero the high word */
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, state->reg1,
+ state->left->left->tree->inst_basereg, state->left->left->tree->inst_offset + MINI_MS_WORD_OFFSET);
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+}
+
+reg: OP_LCONV_TO_I4 (OP_LONG_SHRUN_32 (CEE_LDIND_I8 (base))),
+reg: OP_LCONV_TO_U4 (OP_LONG_SHRUN_32 (CEE_LDIND_I8 (base))) {
+ /* just move the upper half to the lower and zero the high word */
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, state->reg1,
+ state->left->left->left->tree->inst_basereg,
+ state->left->left->left->tree->inst_offset + MINI_MS_WORD_OFFSET);
+}
+
+lreg: OP_LADD (lreg, lreg) {
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_BIALU (s, tree, OP_ADC, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LADD_OVF (lreg, lreg) {
+ /* ADC sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_ADC, state->reg2, state->left->reg2, state->right->reg2);
+ MONO_EMIT_NEW_COND_EXC (s, OV, "OverflowException");
+}
+
+lreg: OP_LADD_OVF_UN (lreg, lreg) {
+ /* ADC sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_ADC, state->reg2, state->left->reg2, state->right->reg2);
+ MONO_EMIT_NEW_COND_EXC (s, C, "OverflowException");
+}
+
+lreg: OP_LADD (lreg, i8con) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADDCC_IMM, state->reg1, state->left->reg1, state->right->tree->inst_ls_word);
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADC_IMM, state->reg2, state->left->reg2, state->right->tree->inst_ms_word);
+}
+
+lreg: OP_LSUB (lreg, lreg) {
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_BIALU (s, tree, OP_SBB, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LSUB (lreg, i8con) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUBCC_IMM, state->reg1, state->left->reg1, state->right->tree->inst_ls_word);
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SBB_IMM, state->reg2, state->left->reg2, state->right->tree->inst_ms_word);
+}
+
+lreg: OP_LSUB_OVF (lreg, lreg) {
+ /* SBB sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_SBB, state->reg2, state->left->reg2, state->right->reg2);
+ MONO_EMIT_NEW_COND_EXC (s, OV, "OverflowException");
+}
+
+lreg: OP_LSUB_OVF_UN (lreg, lreg) {
+ /* SBB sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_SBB, state->reg2, state->left->reg2, state->right->reg2);
+ MONO_EMIT_NEW_COND_EXC (s, C, "OverflowException");
+}
+
+lreg: OP_LAND (lreg, lreg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_AND, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_BIALU (s, tree, CEE_AND, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LAND (lreg, i8con) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_AND_IMM, state->reg1, state->left->reg1, state->right->tree->inst_ls_word);
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg2, state->left->reg2, state->right->tree->inst_ms_word);
+}
+
+lreg: OP_LOR (lreg, lreg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_OR, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_BIALU (s, tree, CEE_OR, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LOR (lreg, i8con) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_OR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_ls_word);
+ MONO_EMIT_BIALU_IMM (s, tree, OP_OR_IMM, state->reg2, state->left->reg2, state->right->tree->inst_ms_word);
+}
+
+lreg: OP_LXOR (lreg, lreg) {
+ MONO_EMIT_NEW_BIALU (s, CEE_XOR, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_BIALU (s, tree, CEE_XOR, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LXOR (lreg, i8con) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_XOR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_ls_word);
+ MONO_EMIT_BIALU_IMM (s, tree, OP_XOR_IMM, state->reg2, state->left->reg2, state->right->tree->inst_ms_word);
+}
+
+lreg: OP_LNOT (lreg) {
+ MONO_EMIT_NEW_UNALU (s, CEE_NOT, state->reg1, state->left->reg1);
+ MONO_EMIT_UNALU (s, tree, CEE_NOT, state->reg2, state->left->reg2);
+}
+
+lreg: OP_LNEG (lreg) "4" {
+ MONO_EMIT_NEW_UNALU (s, CEE_NOT, state->reg1, state->left->reg1);
+ MONO_EMIT_NEW_UNALU (s, CEE_NOT, state->reg2, state->left->reg2);
+ /* ADC sets the condition codes */
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADC_IMM, state->reg1, state->reg1, 1);
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADC_IMM, state->reg2, state->reg2, 0);
+}
+
+reg: OP_CEQ (OP_LCOMPARE (lreg, lreg)) {
+ MonoInst *word_differs;
+
+ MONO_NEW_LABEL (s, word_differs);
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, word_differs);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, word_differs);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+
+ mono_bblock_add_inst (s->cbb, word_differs);
+}
+
+reg: OP_CLT (OP_LCOMPARE (lreg, lreg)) {
+ MonoInst *set_to_0, *set_to_1;
+
+ MONO_NEW_LABEL (s, set_to_0);
+ MONO_NEW_LABEL (s, set_to_1);
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGT, set_to_0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, set_to_1);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGE_UN, set_to_0);
+ mono_bblock_add_inst (s->cbb, set_to_1);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+ mono_bblock_add_inst (s->cbb, set_to_0);
+}
+
+reg: OP_CLT_UN (OP_LCOMPARE (lreg, lreg)) {
+ MonoInst *set_to_0, *set_to_1;
+
+ MONO_NEW_LABEL (s, set_to_0);
+ MONO_NEW_LABEL (s, set_to_1);
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGT_UN, set_to_0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, set_to_1);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGE_UN, set_to_0);
+ mono_bblock_add_inst (s->cbb, set_to_1);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+ mono_bblock_add_inst (s->cbb, set_to_0);
+}
+
+reg: OP_CGT (OP_LCOMPARE (lreg, lreg)) {
+ MonoInst *set_to_0, *set_to_1;
+
+ MONO_NEW_LABEL (s, set_to_0);
+ MONO_NEW_LABEL (s, set_to_1);
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->right->reg2, state->left->left->reg2);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGT, set_to_0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, set_to_1);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->right->reg1, state->left->left->reg1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGE_UN, set_to_0);
+ mono_bblock_add_inst (s->cbb, set_to_1);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+ mono_bblock_add_inst (s->cbb, set_to_0);
+}
+
+reg: OP_CGT_UN (OP_LCOMPARE (lreg, lreg)) {
+ MonoInst *set_to_0, *set_to_1;
+
+ MONO_NEW_LABEL (s, set_to_0);
+ MONO_NEW_LABEL (s, set_to_1);
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->right->reg2, state->left->left->reg2);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGT_UN, set_to_0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, set_to_1);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->right->reg1, state->left->left->reg1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGE_UN, set_to_0);
+ mono_bblock_add_inst (s->cbb, set_to_1);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+ mono_bblock_add_inst (s->cbb, set_to_0);
+}
+
+stmt: CEE_BNE_UN (OP_LCOMPARE (lreg, lreg)) {
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BNE_UN (OP_LCOMPARE (lreg, i8con)) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BLE (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BLE_UN (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BLE_UN (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGE (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGE (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGE_UN (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGE_UN (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGE_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BLT (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BLT (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BLT_UN (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BLT_UN (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BLT_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGT (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGT (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGT_UN (OP_LCOMPARE (lreg, lreg)) {
+
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg2, state->left->right->reg2);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, state->left->left->reg1, state->left->right->reg1);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+}
+
+stmt: CEE_BGT_UN (OP_LCOMPARE (lreg, i8con)) {
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg2, state->left->right->tree->inst_ms_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BNE_UN, tree->inst_false_bb);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->left->reg1, state->left->right->tree->inst_ls_word);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGT_UN, tree->inst_true_bb);
+}
+
+lreg: CEE_CONV_I8 (OP_ICONST) {
+ int data = state->left->tree->inst_c0;
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, data);
+
+ if (data >= 0)
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+ else
+ MONO_EMIT_NEW_ICONST (s, state->reg2, -1);
+}
+
+lreg: CEE_CONV_I8 (reg) {
+ MonoInst *is_negative, *end_label;
+ int tmpreg = mono_regstate_next_int (s->rs);
+
+ MONO_NEW_LABEL (s, is_negative);
+ MONO_NEW_LABEL (s, end_label);
+
+ /* branchless code:
+ * low = reg;
+ * tmp = low > -1 ? 1: 0;
+ * high = tmp - 1; if low is zero or pos high becomes 0, else -1
+ * not sure why it doesn't work in practice
+ */
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg1);
+ /*MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->reg1, -1);
+ tree->dreg = tmpreg;
+ tree->opcode = OP_CGT;
+ mono_bblock_add_inst (s->cbb, tree);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, state->reg2, tmpreg, -1);*/
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->reg1, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT, is_negative);
+ MONO_EMIT_NEW_ICONST (s, tmpreg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+ mono_bblock_add_inst (s->cbb, is_negative);
+ MONO_EMIT_NEW_ICONST (s, tmpreg, -1);
+ mono_bblock_add_inst (s->cbb, end_label);
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg2, tmpreg);
+}
+
+lreg: CEE_CONV_U8 (reg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg1);
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+}
+
+lreg: CEE_CONV_OVF_U8 (reg) {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+lreg: CEE_CONV_OVF_I8 (reg) {
+ /* a signed 32 bit num always fits in a signed 64 bit one */
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SHR_IMM, state->reg2, state->left->reg1, 31);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+lreg: CEE_CONV_OVF_I8_UN (reg) {
+ /* an unsigned 32 bit num always fits in a signed 64 bit one */
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+lreg: CEE_CONV_OVF_U8_UN (reg) {
+ MONO_EMIT_NEW_ICONST (s, state->reg2, 0);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+freg: OP_LCONV_TO_R_UN (lreg) {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->left->reg2);
+}
+
+lreg: OP_FCONV_TO_I8 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+lreg: OP_FCONV_TO_U8 (freg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I4 (i8con) {
+ MONO_EMIT_NEW_ICONST (s, state->reg1, state->left->tree->inst_ls_word);
+}
+
+reg: OP_LCONV_TO_I4 (lreg),
+reg: OP_LCONV_TO_U4 (lreg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I4 (CEE_LDIND_I8 (base)),
+reg: OP_LCONV_TO_U4 (CEE_LDIND_I8 (base)) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE, state->reg1,
+ state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset + MINI_LS_WORD_OFFSET);
+}
+
+lreg: OP_LCONV_TO_U8 (lreg),
+lreg: OP_LCONV_TO_I8 (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg1);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg2, state->left->reg2);
+}
+
+reg: OP_LCONV_TO_U (lreg),
+reg: OP_LCONV_TO_I (lreg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I1 (lreg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_U1 (lreg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_U1, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_I2 (lreg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_U2 (lreg) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_U2, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I1_UN (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "OverflowException");
+
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 127);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -128);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I1 (lreg) {
+ MonoInst *is_negative, *end_label;
+
+ MONO_NEW_LABEL (s, is_negative);
+ MONO_NEW_LABEL (s, end_label);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, -1);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT, is_negative);
+
+ /* Positive */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 127);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+
+ /* Negative */
+ mono_bblock_add_inst (s->cbb, is_negative);
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -128);
+ MONO_EMIT_NEW_COND_EXC (s, LT_UN, "OverflowException");
+ mono_bblock_add_inst (s->cbb, end_label);
+
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U1_UN (lreg),
+reg: OP_LCONV_TO_OVF_U1 (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "OverflowException");
+
+ /* probe value to be within 0 to 255 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 255);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xff);
+}
+
+reg: OP_LCONV_TO_OVF_I2 (lreg) {
+ MonoInst *is_negative, *end_label;
+
+ MONO_NEW_LABEL (s, is_negative);
+ MONO_NEW_LABEL (s, end_label);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, -1);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT, is_negative);
+
+ /* Positive */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 32767);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+
+ /* Negative */
+ mono_bblock_add_inst (s->cbb, is_negative);
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -32768);
+ MONO_EMIT_NEW_COND_EXC (s, LT_UN, "OverflowException");
+ mono_bblock_add_inst (s->cbb, end_label);
+
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I2_UN (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "OverflowException");
+
+ /* Probe value to be within -32768 and 32767 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 32767);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, -32768);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U2_UN (lreg),
+reg: OP_LCONV_TO_OVF_U2 (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "OverflowException");
+
+ /* Probe value to be within 0 and 65535 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0xffff);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xffff);
+}
+
+
+reg: OP_LCONV_TO_OVF_U4_UN (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I_UN (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_U4 (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: OP_LCONV_TO_OVF_I (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LCONV_TO_OVF_I4_UN (lreg),
+reg: OP_LCONV_TO_OVF_I4 (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ tree->opcode = OP_LCONV_TO_OVF_I;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: OP_LCONV_TO_OVF_I8_UN (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg1);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg2, state->left->reg2);
+}
+
+lreg: OP_LCONV_TO_OVF_U8 (lreg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg2, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg1);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg2, state->left->reg2);
+}
+
+lreg: OP_LCONV_TO_OVF_I8 (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg1);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg2, state->left->reg2);
+}
+
+lreg: OP_LCONV_TO_OVF_U8_UN (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->reg1);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg2, state->left->reg2);
+}
+
+lreg: OP_LCALLVIRT (reg) {
+ mini_emit_virtual_call (s, state, tree, OP_LCALL, OP_LCALL_MEMBASE);
+}
+
+lreg: OP_LCALL {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: OP_LCALL_REG (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: OP_LCALL_REG (OP_ICONST) {
+ tree->opcode = OP_LCALL;
+ ((MonoCallInst*)tree)->fptr = state->left->tree->inst_p0;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+%%
diff --git a/mono/mini/inssel-ppc.brg b/mono/mini/inssel-ppc.brg
new file mode 100644
index 00000000000..b9830dc38b9
--- /dev/null
+++ b/mono/mini/inssel-ppc.brg
@@ -0,0 +1,452 @@
+%%
+
+#
+# inssel-ppc.brg: burg file for special ppc instructions
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+# Paolo Molaro (lupus@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+stmt: OP_START_HANDLER {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ /*MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, spvar->inst_basereg, spvar->inst_offset, ppc_sp);
+ */
+ tree->inst_left = spvar;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_ENDFINALLY {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: OP_LADD_OVF (lreg, lreg) "0" {
+ /* ADC sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_ADD_OVF_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LADD_OVF_UN (lreg, lreg) "0" {
+ /* ADC sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_ADD_OVF_UN_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LSUB_OVF (lreg, lreg) "0" {
+ /* SBB sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_SUB_OVF_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LSUB_OVF_UN (lreg, lreg) "0" {
+ /* SBB sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_SUB_OVF_UN_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+stmt: CEE_STIND_I8 (OP_REGVAR, lreg) {
+ /* this should only happen for methods returning a long */
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, ppc_r3, state->right->reg1);
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, ppc_r4, state->right->reg2);
+}
+
+lreg: OP_LNEG (lreg) "2" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_PPC_SUBFIC, state->reg1, state->left->reg1, 0);
+ MONO_EMIT_UNALU (s, tree, OP_PPC_SUBFZE, state->reg2, state->left->reg2);
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: CEE_CONV_R_UN (reg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LOCALLOC (OP_ICONST) {
+ /* microcoded in mini-ppc.c */
+ tree->sreg1 = mono_regstate_next_int (s->rs);
+ tree->dreg = state->reg1;
+ MONO_EMIT_NEW_ICONST (s, tree->sreg1, state->left->tree->inst_c0);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (reg) {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = ppc_r3;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (lreg) {
+ tree->opcode = OP_SETLRET;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ tree->dreg = ppc_r3;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (freg) {
+ tree->opcode = OP_FMOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = ppc_f1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (OP_ICONST) {
+ tree->opcode = OP_ICONST;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = ppc_r3;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I (OP_REGVAR, CEE_SUB (CEE_LDIND_I (OP_REGVAR), OP_ICONST)),
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_SUB (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST)),
+stmt: CEE_STIND_I (OP_REGVAR, CEE_ADD (CEE_LDIND_I (OP_REGVAR), OP_ICONST)),
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_ADD (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+ int dreg = state->left->tree->dreg;
+ int sreg = state->right->left->left->tree->dreg;
+
+ if (state->right->op == CEE_ADD)
+ tree->opcode = OP_ADD_IMM;
+ else if (state->right->op == CEE_SUB)
+ tree->opcode = OP_SUB_IMM;
+ else
+ g_assert_not_reached ();
+ tree->inst_imm = con;
+ tree->sreg1 = sreg;
+ tree->dreg = dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (reg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_REGVAR) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->tree->dreg);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (lreg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg2);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm + 4, state->left->reg1);
+ return;
+ }
+ MONO_EMIT_NEW_UNALU (s, OP_SETREG, tree->unused, state->left->reg2);
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused + 1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_ICONST) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STORE_MEMBASE_IMM, ppc_r1, tree->inst_imm, state->left->tree->inst_c0);
+ return;
+ }
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = tree->unused;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#stmt: OP_OUTARG (CEE_LDIND_I4 (base)) {
+# tree->opcode = OP_X86_PUSH_MEMBASE;
+# tree->inst_basereg = state->left->left->tree->inst_basereg;
+# tree->inst_offset = state->left->left->tree->inst_offset;
+# mono_bblock_add_inst (s->cbb, tree);
+#}
+
+#stmt: OP_OUTARG (CEE_LDIND_U4 (base)) {
+# tree->opcode = OP_X86_PUSH_MEMBASE;
+# tree->inst_basereg = state->left->left->tree->inst_basereg;
+# tree->inst_offset = state->left->left->tree->inst_offset;
+# mono_bblock_add_inst (s->cbb, tree);
+#}
+
+#stmt: OP_OUTARG (CEE_LDIND_I (base)) {
+# tree->opcode = OP_X86_PUSH_MEMBASE;
+# tree->inst_basereg = state->left->left->tree->inst_basereg;
+# tree->inst_offset = state->left->left->tree->inst_offset;
+# mono_bblock_add_inst (s->cbb, tree);
+#}
+
+#stmt: OP_OUTARG (CEE_LDIND_REF (base)) {
+# tree->opcode = OP_X86_PUSH_MEMBASE;
+# tree->inst_basereg = state->left->left->tree->inst_basereg;
+# tree->inst_offset = state->left->left->tree->inst_offset;
+# mono_bblock_add_inst (s->cbb, tree);
+#}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->left->tree->dreg);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#stmt: OP_OUTARG (CEE_LDOBJ (reg)) {
+# tree->opcode = OP_X86_PUSH;
+# tree->sreg1 = state->left->reg1;
+# mono_bblock_add_inst (s->cbb, tree);
+#}
+
+stmt: OP_OUTARG (freg) {
+ if (tree->inst_imm) {
+ int opcode = (tree->unused & 0xff00) == 0x0400? OP_STORER4_MEMBASE_REG: OP_STORER8_MEMBASE_REG;
+ MONO_EMIT_NEW_STORE_MEMBASE (s, opcode, ppc_r1, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused & 0xff;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R4 (freg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R8 (freg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, ppc_r1, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (base)) {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->unused & 0xff;
+ int nregs = (tree->unused >> 8) & 0xff;
+ int ovf_size = (tree->unused >> 16) & 0xffff;
+ int i, tmpr, soffset;
+ int size = 0;
+ soffset = vt->inst_offset;
+/*
+ Darwin needs some special handling for 1 and 2 byte arguments
+*/
+#ifdef __APPLE__
+ if (vt->inst_vtype && MONO_TYPE_ISSTRUCT (vt->inst_vtype) && vt->inst_vtype->type != MONO_TYPE_TYPEDBYREF)
+ size = mono_class_native_size (vt->inst_vtype->data.klass, NULL);
+ if (size == 2 || size == 1) {
+ tmpr = mono_regstate_next_int (s->rs);
+ if (size == 1)
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI1_MEMBASE, tmpr, vt->inst_basereg, soffset);
+ else
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI2_MEMBASE, tmpr, vt->inst_basereg, soffset);
+ MONO_EMIT_NEW_UNALU (s, OP_SETREG, start_reg, tmpr);
+ } else
+#endif
+ for (i = 0; i < nregs; ++i) {
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmpr, vt->inst_basereg, soffset);
+ MONO_EMIT_NEW_UNALU (s, OP_SETREG, start_reg + i, tmpr);
+ soffset += sizeof (gpointer);
+ }
+ //g_print ("vt size: %d at R%d + %d\n", tree->inst_imm, vt->inst_basereg, vt->inst_offset);
+ if (ovf_size != 0) {
+ mini_emit_memcpy (s, ppc_r1, tree->inst_imm + (soffset - vt->inst_offset), vt->inst_basereg, soffset, ovf_size * sizeof (gpointer), 0);
+ }
+}
+
+stmt: OP_OUTARG_VT (OP_ICONST) {
+ int start_reg = tree->unused & 0xff;
+ int nregs = (tree->unused >> 8) & 0xff;
+ if (nregs) {
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = start_reg;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+ } else {
+ g_assert_not_reached ();
+ }
+}
+
+stmt: OP_OUTARG_VT (reg) {
+ int start_reg = tree->unused & 0xff;
+ int nregs = (tree->unused >> 8) & 0xff;
+ if (nregs) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = start_reg;
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+ } else {
+ g_assert_not_reached ();
+ }
+}
+
+stmt: CEE_STIND_R8 (OP_REGVAR, freg) {
+ /* nothing to do: the value is already on the FP stack */
+}
+
+stmt: CEE_BNE_UN (fpcflags) {
+ tree->opcode = OP_FBNE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (fpcflags) {
+ tree->opcode = OP_FBEQ;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (fpcflags) {
+ tree->opcode = OP_FBLT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (fpcflags) {
+ tree->opcode = OP_FBLT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (fpcflags) {
+ tree->opcode = OP_FBGT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (fpcflags) {
+ tree->opcode = OP_FBGT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (fpcflags) {
+ tree->opcode = OP_FBGE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (fpcflags) {
+ tree->opcode = OP_FBGE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (fpcflags) {
+ tree->opcode = OP_FBLE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (fpcflags) {
+ tree->opcode = OP_FBLE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_POP (freg) "0" {
+ /* nothing to do */
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_LCONV_TO_R_UN (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_FREM (freg, freg) {
+ /* nothing to do - emulated */
+}
+
+reg: OP_CEQ (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCEQ, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: CEE_ADD_OVF (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_ADD_OVF_UN (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SUB_OVF (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SUB_OVF_UN (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+%%
diff --git a/mono/mini/inssel-s390.brg b/mono/mini/inssel-s390.brg
new file mode 100644
index 00000000000..4a1daf4ad5b
--- /dev/null
+++ b/mono/mini/inssel-s390.brg
@@ -0,0 +1,692 @@
+%%
+
+#
+# inssel-s390.brg: burg file for special s390 instructions
+#
+# Author:
+# Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+# Dietmar Maurer (dietmar@ximian.com)
+# Paolo Molaro (lupus@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+stmt: OP_START_HANDLER {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_ENDFINALLY {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: OP_LADD_OVF (lreg, lreg) "0" {
+ /* ADC sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_ADD_OVF_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LADD_OVF_UN (lreg, lreg) "0" {
+ /* ADC sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_ADDCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_ADD_OVF_UN_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LSUB_OVF (lreg, lreg) "0" {
+ /* SBB sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_SUB_OVF_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+lreg: OP_LSUB_OVF_UN (lreg, lreg) "0" {
+ /* SBB sets the condition code */
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_SUB_OVF_UN_CARRY, state->reg2, state->left->reg2, state->right->reg2);
+}
+
+reg: CEE_ADD_OVF (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_ADD_OVF_UN (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SUB_OVF (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SUB_OVF_UN (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+stmt: CEE_STIND_I8 (OP_REGVAR, lreg) {
+ /*------------------------------------------------------*/
+ /* this should only happen for methods returning a long */
+ /* S/390 ABI uses r2/r3 for returning 64-bit integers */
+ /*------------------------------------------------------*/
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, s390_r2, state->right->reg1);
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, s390_r3, state->right->reg2);
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: CEE_CONV_R_UN (reg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: CEE_CONV_R_UN (reg) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_MEMCPY (reg, reg) "0" {
+ int size = tree->unused;
+ if (size > 0)
+ MONO_EMIT_NEW_MOVE (s, state->left->reg1, 0,
+ state->right->reg1, 0, size);
+}
+
+stmt: OP_MEMCPY (base, base) "0" {
+ int size = tree->unused;
+ if (size > 0)
+ MONO_EMIT_NEW_MOVE (s, state->left->tree->sreg1,
+ state->left->tree->inst_offset,
+ state->right->tree->sreg1,
+ state->right->tree->inst_offset,
+ size);
+}
+
+reg: OP_LOCALLOC (OP_ICONST) {
+ /* microcoded in mini-s390.c */
+ tree->sreg1 = mono_regstate_next_int (s->rs);
+ tree->dreg = state->reg1;
+ MONO_EMIT_NEW_ICONST (s, tree->sreg1, state->left->tree->inst_c0);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (reg) {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = s390_r2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (lreg) {
+ tree->opcode = OP_SETLRET;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (freg) {
+ if (s->method->signature->ret->type == MONO_TYPE_R4) {
+ tree->opcode = OP_S390_SETF4RET;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = s390_f0;
+ } else {
+ tree->opcode = OP_FMOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = s390_f0;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (OP_ICONST) {
+ tree->opcode = OP_ICONST;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = s390_r2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: OP_LSUB_OVF_UN (lreg, lreg) "0" {
+ /*----------------------------------------------------------------------*/
+ /* SBB sets the condition code - CC 0 or 1 indicates Borrow == Overflow */
+ /*----------------------------------------------------------------------*/
+ MONO_EMIT_NEW_BIALU (s, OP_SUBCC, state->reg1, state->left->reg1, state->right->reg1);
+ MONO_EMIT_NEW_BIALU (s, OP_SBB, state->reg2, state->left->reg2, state->right->reg2);
+ MONO_EMIT_NEW_COND_EXC (s, NC, "OverflowException");
+}
+
+stmt: OP_OUTARG (reg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_REGVAR) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->tree->dreg);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (lreg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->reg2);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm + 4, state->left->reg1);
+ return;
+ }
+ MONO_EMIT_NEW_UNALU (s, OP_SETREG, tree->unused, state->left->reg2);
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused + 1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_ICONST) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STORE_MEMBASE_IMM, STK_BASE, tree->inst_imm, state->left->tree->inst_c0);
+ return;
+ }
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = tree->unused;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->left->tree->dreg);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_LDADDR (OP_S390_LOADARG)) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->left->tree->dreg);
+ return;
+ }
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADD_IMM, tree->unused,
+ state->left->left->tree->sreg1,
+ state->left->left->tree->inst_offset);
+}
+
+stmt: OP_OUTARG (freg) {
+ if (tree->inst_imm) {
+ /*----------------------------------------------*/
+ /* The length stored in unused tells us whether */
+ /* we need to store a float or a double */
+ /*----------------------------------------------*/
+ if ((tree->unused & 0xff00) == 0x0400) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ state->left->reg1);
+ } else {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ state->left->reg1);
+ }
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R4 (freg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R8 (freg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (base)) {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(base))\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE(s, STK_BASE, tree->sreg2,
+ vt->inst_basereg, soffset, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE(s, STK_BASE, tree->sreg2+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->sreg2+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->sreg2, tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR (s, size, start_reg, vt->inst_basereg, soffset);
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE, tree->inst_imm,
+ vt->inst_basereg, soffset);
+ }
+ }
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (OP_S390_ARGPTR)) {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(OP_S390_ARGPTR))\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, tree->inst_imm,
+ vt->inst_basereg, soffset, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ tree->inst_imm+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->inst_imm+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR (s, size, start_reg, vt->inst_basereg, soffset);
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE,
+ tree->inst_imm,
+ vt->inst_basereg, soffset);
+ }
+ }
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (OP_REGOFFSET)) "0" {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(OP_REGOFFSET))\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, tree->sreg2,
+ vt->inst_basereg, soffset, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ tree->sreg2+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->sreg2+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->sreg2,
+ tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR(s, size, start_reg, vt->inst_basereg, soffset);
+ } else {
+ MONO_OUTPUT_VTS(s, size, STK_BASE, tree->inst_imm,
+ vt->inst_basereg, soffset);
+ }
+ }
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (OP_S390_LOADARG)) {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = -tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(OP_S390_LOADARG))\n");
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg, STK_BASE, soffset);
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, tree->sreg2, start_reg, 0, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ tree->inst_imm+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->inst_imm+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ tmpr);
+ }
+}
+
+stmt: OP_OUTARG_VT (OP_ICONST) {
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int nregs = size / 4;
+
+//printf("OP_OUTARG_VT(OP_ICONST)\n");
+ if (start_reg != STK_BASE) {
+ if (nregs) {
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = start_reg;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+ }
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE, tree->inst_c0,
+ s->frame_reg, tree->inst_offset);
+ }
+}
+
+stmt: OP_OUTARG_VT (reg) {
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = tree->sreg2;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(reg)\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, soffset,
+ state->left->tree->sreg1,
+ tree->inst_imm, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, soffset);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ soffset+sizeof(gpointer),
+ state->left->tree->sreg1,
+ tree->inst_imm, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ soffset+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR (s, size, start_reg, STK_BASE,
+ state->left->tree->inst_offset);
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE, soffset, tmpr,
+ state->left->tree->inst_offset);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ s->stack_offset);
+ }
+ }
+}
+
+stmt: CEE_STIND_R8 (OP_REGVAR, freg) {
+ /* nothing to do: the value is already on the FP stack */
+}
+
+stmt: CEE_BNE_UN (fpcflags) {
+ tree->opcode = OP_FBNE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (fpcflags) {
+ tree->opcode = OP_FBEQ;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (fpcflags) {
+ tree->opcode = OP_FBLT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (fpcflags) {
+ tree->opcode = OP_FBLT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (fpcflags) {
+ tree->opcode = OP_FBGT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (fpcflags) {
+ tree->opcode = OP_FBGT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (fpcflags) {
+ tree->opcode = OP_FBGE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (fpcflags) {
+ tree->opcode = OP_FBGE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (fpcflags) {
+ tree->opcode = OP_FBLE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (fpcflags) {
+ tree->opcode = OP_FBLE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_POP (freg) "0" {
+ /* nothing to do */
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_LCONV_TO_R_UN (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_FREM (freg, freg) {
+ /* nothing to do - emulated */
+}
+
+reg: OP_CEQ (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCEQ, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+base: OP_S390_STKARG "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+// MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+// (s->stack_offset+state->tree->unused));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmpr, s->frame_reg, 0);
+ tree->inst_offset = state->tree->inst_offset;
+ tree->inst_basereg = tmpr;
+}
+
+base: OP_LDADDR (OP_S390_LOADARG) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+base: OP_LDADDR (OP_S390_ARGPTR) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+base: OP_LDADDR (OP_S390_STKARG) "0" {
+ int tmpr;
+
+printf("OP_LDADDR (OP_S390_STKARG)\n");
+ tmpr = mono_regstate_next_int (s->rs);
+// MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+// (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmpr, s->frame_reg, 0);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, tmpr,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+reg: OP_LDADDR (OP_S390_LOADARG) "2" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->reg1;
+}
+
+reg: OP_LDADDR (OP_S390_ARGPTR) "2" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->reg1;
+}
+
+reg: OP_LDADDR (OP_S390_STKARG) "2" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, state->reg1,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->reg1;
+}
+
+reg: CEE_LDOBJ (OP_S390_LOADARG) "1" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+}
+
+reg: CEE_LDOBJ (OP_S390_ARGPTR) "1" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+}
+
+reg: CEE_LDOBJ (OP_S390_STKARG) "1" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, state->reg1,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->reg1;
+}
+
+base: CEE_LDOBJ (OP_S390_ARGPTR) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+base: CEE_LDOBJ (OP_S390_STKARG) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmpr, tmpr, state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+%%
diff --git a/mono/mini/inssel-s390x.brg b/mono/mini/inssel-s390x.brg
new file mode 100644
index 00000000000..b0ef5c04349
--- /dev/null
+++ b/mono/mini/inssel-s390x.brg
@@ -0,0 +1,684 @@
+%%
+
+#
+# inssel-s390x.brg: burg file for special s390 instructions
+#
+# Author:
+# Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+# Dietmar Maurer (dietmar@ximian.com)
+# Paolo Molaro (lupus@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+stmt: OP_START_HANDLER {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_ENDFINALLY {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ tree->inst_left = spvar;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_ADD_OVF (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_ADD_OVF_UN (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SUB_OVF (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+reg: CEE_SUB_OVF_UN (reg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+stmt: CEE_STIND_I8 (OP_REGVAR, reg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->left->tree->dreg, state->right->reg1);
+// MONO_EMIT_NEW_UNALU (s, OP_MOVE, s390_r2, state->right->reg1);
+}
+
+reg: CEE_LDIND_I8 (OP_REGVAR) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->tree->dreg);
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->left->reg2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: CEE_CONV_R_UN (reg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: CEE_CONV_R_UN (reg) {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_MEMCPY (reg, reg) "0" {
+ int size = tree->unused;
+ if (size > 0)
+ MONO_EMIT_NEW_MOVE (s, state->left->reg1, 0, state->right->reg1, 0, size);
+}
+
+reg: OP_LOCALLOC (OP_ICONST) {
+ /* microcoded in mini-s390.c */
+ tree->sreg1 = mono_regstate_next_int (s->rs);
+ tree->dreg = state->reg1;
+ MONO_EMIT_NEW_ICONST (s, tree->sreg1, state->left->tree->inst_c0);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (reg) {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = s390_r2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+# stmt: OP_SETRET (lreg) {
+# tree->opcode = OP_MOVE;
+# tree->sreg1 = state->left->reg1;
+# tree->dreg = s390_r2;
+# mono_bblock_add_inst (s->cbb, tree);
+# }
+
+stmt: OP_SETRET (freg) {
+ if (s->method->signature->ret->type == MONO_TYPE_R4) {
+ tree->opcode = OP_S390_SETF4RET;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = s390_f0;
+ } else {
+ tree->opcode = OP_FMOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = s390_f0;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (OP_ICONST) {
+ tree->opcode = OP_ICONST;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = s390_r2;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (reg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_REGVAR) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->tree->dreg);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_I8CONST) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STORE_MEMBASE_IMM,
+ STK_BASE, tree->inst_imm,
+ state->left->tree->inst_c0);
+ return;
+ }
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = tree->unused;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_ICONST) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STOREI4_MEMBASE_IMM,
+ STK_BASE, tree->inst_imm,
+ state->left->tree->inst_c0);
+ return;
+ }
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = tree->unused;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->left->tree->dreg);
+ return;
+ }
+ tree->opcode = OP_SETREG;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I (OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I8 (OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I4 (OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I (base)) {
+ MONO_EMIT_LOAD_MEMBASE (s, tree, tree->unused,
+ state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I4 (base)) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE,
+ tree->unused, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_LDADDR (OP_S390_LOADARG)) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, STK_BASE,
+ tree->inst_imm,
+ state->left->left->tree->dreg);
+ return;
+ }
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADD_IMM, tree->unused,
+ state->left->left->tree->sreg1,
+ state->left->left->tree->inst_offset);
+}
+
+stmt: OP_OUTARG (freg) {
+ if (tree->inst_imm) {
+ /*----------------------------------------------*/
+ /* The length stored in unused tells us whether */
+ /* we need to store a float or a double */
+ /*----------------------------------------------*/
+ if ((tree->unused & 0xff00) == 0x0400) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ state->left->reg1);
+ } else {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ state->left->reg1);
+ }
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R4 (freg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R8 (freg) {
+ if (tree->inst_imm) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, STK_BASE, tree->inst_imm, state->left->reg1);
+ return;
+ }
+ tree->opcode = OP_SETFREG;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (base)) {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(base))\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE(s, STK_BASE, tree->sreg2,
+ vt->inst_basereg, soffset, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE(s, STK_BASE, tree->sreg2+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->sreg2+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->sreg2, tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR (s, size, start_reg, vt->inst_basereg, soffset);
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE, tree->inst_imm,
+ vt->inst_basereg, soffset);
+ }
+ }
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (OP_S390_ARGPTR)) {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(OP_S390_ARGPTR))\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, tree->inst_imm,
+ vt->inst_basereg, soffset, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ tree->inst_imm+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->inst_imm+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR (s, size, start_reg, vt->inst_basereg, soffset);
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE,
+ tree->inst_imm,
+ vt->inst_basereg, soffset);
+ }
+ }
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (OP_REGOFFSET)) "0" {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(OP_REGOFFSET))\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, tree->sreg2,
+ vt->inst_basereg, soffset, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ tree->sreg2+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->sreg2+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->sreg2,
+ tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR(s, size, start_reg, vt->inst_basereg, soffset);
+ } else {
+ MONO_OUTPUT_VTS(s, size, STK_BASE, tree->inst_imm,
+ vt->inst_basereg, soffset);
+ }
+ }
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (OP_S390_LOADARG)) {
+ MonoInst *vt = state->left->left->tree;
+ int start_reg = tree->sreg1;
+ int size = -tree->unused;
+ int soffset = vt->inst_offset;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(CEE_LDOBJ(OP_S390_LOADARG))\n");
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg, STK_BASE, soffset);
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, tree->sreg2, start_reg, 0, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, tree->sreg2);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ tree->inst_imm+sizeof(gpointer),
+ vt->inst_basereg, soffset, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ tree->inst_imm+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ tmpr);
+ }
+}
+
+stmt: OP_OUTARG_VT (OP_ICONST) {
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int nregs = size / 4;
+
+//printf("OP_OUTARG_VT(OP_ICONST)\n");
+ if (start_reg != STK_BASE) {
+ if (nregs) {
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = start_reg;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+ }
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE, tree->inst_c0,
+ s->frame_reg, tree->inst_offset);
+ }
+}
+
+stmt: OP_OUTARG_VT (reg) {
+ int start_reg = tree->sreg1;
+ int size = tree->unused;
+ int soffset = tree->sreg2;
+ int tmpr;
+
+//printf("OP_OUTARG_VT(reg)\n");
+ if (size < 0) {
+ size = -size;
+ if (start_reg != STK_BASE) {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE, soffset,
+ state->left->tree->sreg1,
+ tree->inst_imm, size);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, start_reg,
+ STK_BASE, soffset);
+ } else {
+ MONO_EMIT_NEW_MOVE (s, STK_BASE,
+ soffset+sizeof(gpointer),
+ state->left->tree->sreg1,
+ tree->inst_imm, size);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ soffset+sizeof(gpointer));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG,
+ STK_BASE, tree->inst_imm,
+ tmpr);
+ }
+ } else {
+ if (start_reg != STK_BASE) {
+ MONO_OUTPUT_VTR (s, size, start_reg, STK_BASE,
+ state->left->tree->inst_offset);
+ } else {
+ MONO_OUTPUT_VTS (s, size, STK_BASE, soffset, tmpr,
+ state->left->tree->inst_offset);
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, STK_BASE,
+ s->stack_offset);
+ }
+ }
+}
+
+stmt: CEE_STIND_R8 (OP_REGVAR, freg) {
+ /* nothing to do: the value is already on the FP stack */
+}
+
+stmt: CEE_BNE_UN (fpcflags) {
+ tree->opcode = OP_FBNE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (fpcflags) {
+ tree->opcode = OP_FBEQ;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (fpcflags) {
+ tree->opcode = OP_FBLT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (fpcflags) {
+ tree->opcode = OP_FBLT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (fpcflags) {
+ tree->opcode = OP_FBGT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (fpcflags) {
+ tree->opcode = OP_FBGT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (fpcflags) {
+ tree->opcode = OP_FBGE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (fpcflags) {
+ tree->opcode = OP_FBGE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (fpcflags) {
+ tree->opcode = OP_FBLE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (fpcflags) {
+ tree->opcode = OP_FBLE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_POP (freg) "0" {
+ /* nothing to do */
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_LCONV_TO_R_UN (lreg) {
+ /* nothing to do - emulated */
+}
+
+freg: OP_FREM (freg, freg) {
+ /* nothing to do - emulated */
+}
+
+reg: OP_CEQ (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCEQ, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+base: OP_S390_STKARG "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ (s->stack_offset+state->tree->unused));
+ tree->inst_offset = state->tree->inst_offset;
+ tree->inst_basereg = tmpr;
+}
+
+base: OP_LDADDR (OP_S390_LOADARG) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+base: OP_LDADDR (OP_S390_ARGPTR) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+base: OP_LDADDR (OP_S390_STKARG) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, tmpr,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+reg: OP_LDADDR (OP_S390_LOADARG) "2" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->reg1;
+}
+
+reg: OP_LDADDR (OP_S390_ARGPTR) "2" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->reg1;
+}
+
+reg: OP_LDADDR (OP_S390_STKARG) "2" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, state->reg1,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->reg1;
+}
+
+reg: CEE_LDOBJ (OP_S390_LOADARG) "1" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+}
+
+reg: CEE_LDOBJ (OP_S390_ARGPTR) "1" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ state->left->tree->inst_offset);
+}
+
+reg: CEE_LDOBJ (OP_S390_STKARG) "1" {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, s->frame_reg,
+ (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, state->reg1,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->dreg = state->reg1;
+}
+
+base: CEE_LDOBJ (OP_S390_ARGPTR) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmpr, s->frame_reg,
+ state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->dreg = tmpr;
+}
+
+base: CEE_LDOBJ (OP_S390_STKARG) "0" {
+ int tmpr;
+
+ tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tmpr, s->frame_reg,
+ (s->stack_offset + state->left->tree->unused));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmpr, tmpr, state->left->tree->inst_offset);
+ tree->inst_offset = 0;
+ tree->inst_basereg = tmpr;
+}
+
+%%
diff --git a/mono/mini/inssel-sparc.brg b/mono/mini/inssel-sparc.brg
new file mode 100644
index 00000000000..f9bae7b5954
--- /dev/null
+++ b/mono/mini/inssel-sparc.brg
@@ -0,0 +1,710 @@
+%%
+
+#
+# inssel-sparc.brg: burg file for special sparc instructions
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+# Paolo Molaro (lupus@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+stmt: CEE_STIND_I8 (OP_REGVAR, reg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->left->tree->dreg, state->right->reg1);
+}
+
+reg: CEE_LDIND_I8 (OP_REGVAR) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg1, state->left->tree->dreg);
+}
+
+stmt: CEE_STIND_I8 (OP_REGVAR, lreg) {
+ /* this should only happen for methods returning a long */
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->left->tree->dreg, state->right->reg2);
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->left->tree->dreg + 1, state->right->reg1);
+}
+
+lreg: CEE_LDIND_I8 (OP_REGVAR) {
+ /* reg2 contains the most significant word */
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, state->reg2, state->left->tree->dreg);
+ tree->opcode = OP_SETREG;
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->tree->dreg + 1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ /* Dummy rule */
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: CEE_CONV_R_UN (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_FCONV_TO_R4 (freg) "0" {
+ /* The conversion is done elsewhere */
+ MONO_EMIT_UNALU (s, tree, OP_FMOVE, state->reg1, state->left->reg1);
+}
+
+freg: CEE_LDIND_R8 (OP_REGVAR) {
+ MONO_EMIT_UNALU (s, tree, OP_FMOVE, state->reg1, state->left->tree->dreg);
+}
+
+freg: CEE_LDIND_R4 (OP_REGVAR) {
+ MONO_EMIT_UNALU (s, tree, OP_FMOVE, state->reg1, state->left->tree->dreg);
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+base: OP_SPARC_INARG_VT (base) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset);
+}
+
+reg: OP_LDADDR (OP_SPARC_INARG_VT (base)) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+}
+
+reg: CEE_LDOBJ (OP_SPARC_INARG_VT (base)) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+}
+
+base: OP_LDADDR (reg) {
+/*
+ tree->inst_basereg = mono_regstate_next_int (s->rs);
+ tree->inst_offset = 0;
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tree->inst_basereg, state->left->tree->dreg, 0);
+*/
+ tree->inst_basereg = state->left->tree->dreg;
+ tree->inst_offset = 0;
+}
+
+stmt: OP_OUTARG (OP_LDADDR (reg)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (reg) {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = sparc_i0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, sparc_i0, state->left->reg2);
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = sparc_i1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (freg) {
+ tree->opcode = OP_SETFRET;
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = sparc_f0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (OP_ICONST) {
+ tree->opcode = OP_ICONST;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = sparc_i0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (reg) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_REGVAR) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (freg) {
+ /* floating-point <-> integer transfer must go through memory */
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, tree->inst_basereg,
+ tree->inst_imm, state->left->reg1);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tree->unused, tree->inst_basereg, tree->inst_imm);
+}
+
+stmt: OP_OUTARG (OP_ICONST) {
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = tree->unused;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_I8CONST) {
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = tree->unused;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBCOND (sizeof (gpointer) == 8);
+
+ return 0;
+}
+
+stmt: OP_OUTARG (CEE_LDIND_R4 (base)) {
+ tree->opcode = OP_LOADI4_MEMBASE;
+ tree->dreg = tree->unused;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SPARC_OUTARG_REGPAIR (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_SETREG, tree->unused, state->left->reg2);
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused + 1;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SPARC_OUTARG_REGPAIR (freg) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, tree->inst_basereg,
+ tree->inst_imm, state->left->reg1);
+ /* floating-point <-> integer transfer must go through memory */
+ /* Load into a register pair */
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tree->unused, tree->inst_basereg, tree->inst_imm);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tree->unused + 1, tree->inst_basereg, tree->inst_imm + 4);
+}
+
+stmt: OP_SPARC_OUTARG_MEM (reg) {
+ guint32 offset = tree->inst_imm;
+ if (mono_sparc_is_sparc64 ()) {
+ guint32 real_offset = tree->inst_imm - MONO_SPARC_STACK_BIAS;
+ /* Correct for the additions in get_call_info () */
+ offset = MONO_SPARC_STACK_BIAS + (real_offset & ~(7));
+ tree->opcode = OP_STOREI8_MEMBASE_REG;
+ }
+ else {
+ if (tree->inst_imm & 0x1)
+ tree->opcode = OP_STOREI1_MEMBASE_REG;
+ else if (tree->inst_imm & 0x2)
+ tree->opcode = OP_STOREI2_MEMBASE_REG;
+ else
+ tree->opcode = OP_STOREI4_MEMBASE_REG;
+ }
+ tree->inst_destbasereg = tree->inst_basereg;
+ tree->inst_offset = offset;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SPARC_OUTARG_MEM (freg) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, tree->inst_basereg,
+ tree->inst_imm, state->left->reg1);
+}
+
+stmt: OP_SPARC_OUTARG_MEMPAIR (lreg) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, tree->inst_basereg,
+ tree->inst_imm, state->left->reg2);
+ tree->opcode = OP_STOREI4_MEMBASE_REG;
+ tree->inst_destbasereg = tree->inst_basereg;
+ tree->inst_offset = tree->inst_imm + 4;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SPARC_OUTARG_MEMPAIR (freg) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, tree->inst_basereg,
+ tree->inst_imm, state->left->reg1);
+}
+
+stmt: OP_SPARC_OUTARG_SPLIT_REG_STACK (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_SETREG, tree->unused, state->left->reg2);
+ tree->opcode = OP_STOREI4_MEMBASE_REG;
+ tree->inst_destbasereg = tree->inst_basereg;
+ tree->inst_offset = tree->inst_imm + 4;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SPARC_OUTARG_SPLIT_REG_STACK (freg) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER8_MEMBASE_REG, tree->inst_basereg,
+ tree->inst_imm, state->left->reg1);
+ /* floating-point <-> integer transfer must go through memory */
+ /* Load most significant word into register */
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tree->unused, tree->inst_basereg, tree->inst_imm);
+}
+
+stmt: OP_SPARC_OUTARG_FLOAT_REG (freg) {
+ tree->opcode = OP_SPARC_SETFREG_FLOAT;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SPARC_OUTARG_DOUBLE_REG (freg) {
+ tree->opcode = OP_SETFREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+# Handles scalar valuetypes like RuntimeTypeHandle
+reg: OP_OUTARG_VT (OP_ICONST) {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STOREI4_MEMBASE_IMM, sparc_sp, tree->inst_c1, state->left->tree->inst_c0);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, sparc_sp, tree->inst_c1);
+}
+
+reg: OP_OUTARG_VT (OP_AOTCONST) {
+ MONO_EMIT_NEW_AOTCONST (s, state->reg1, state->left->tree->inst_p0, state->left->tree->inst_c1);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, sparc_sp, tree->inst_c1, state->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, sparc_sp, tree->inst_c1);
+}
+
+# FIXME: Unify this with the previous rule
+reg: OP_OUTARG_VT (OP_REFANYTYPE (reg)) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->left->reg1, G_STRUCT_OFFSET (MonoTypedRef, type));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, sparc_sp, tree->inst_c1, state->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, sparc_sp, tree->inst_c1);
+}
+
+reg: OP_OUTARG_VT (base) {
+ int size = tree->unused;
+ mini_emit_memcpy (s, sparc_sp, tree->inst_c1, state->left->tree->inst_basereg, state->left->tree->inst_offset, size, 0);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, sparc_sp, tree->inst_c1);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->sreg1 = state->left->left->tree->dreg;
+ tree->dreg = tree->unused;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGOFFSET)) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tree->unused, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+}
+
+stmt: OP_OUTARG_VT (OP_ICONST) {
+ tree->opcode = OP_SETREGIMM;
+ tree->dreg = tree->unused;
+ tree->inst_imm = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_R8 (OP_REGVAR, freg) {
+ /* nothing to do: the value is already on the FP stack */
+}
+
+reg: CEE_LDIND_I1 (OP_REGVAR) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->tree->dreg);
+}
+
+reg: CEE_LDIND_I2 (OP_REGVAR) {
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->tree->dreg);
+}
+
+stmt: CEE_BNE_UN (fpcflags) {
+ tree->opcode = OP_FBNE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (fpcflags) {
+ tree->opcode = OP_FBEQ;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (fpcflags) {
+ tree->opcode = OP_FBLT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (fpcflags) {
+ tree->opcode = OP_FBLT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (fpcflags) {
+ tree->opcode = OP_FBGT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (fpcflags) {
+ tree->opcode = OP_FBGT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (fpcflags) {
+ tree->opcode = OP_FBGE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (fpcflags) {
+ tree->opcode = OP_FBGE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (fpcflags) {
+ tree->opcode = OP_FBLE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (fpcflags) {
+ tree->opcode = OP_FBLE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_POP (freg) "0" {
+ /* nothing to do */
+}
+
+stmt: OP_START_HANDLER {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_ENDFINALLY {
+ //MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ //MONO_EMIT_NEW_LOAD_MEMBASE (s, sparc_o7, spvar->inst_basereg, spvar->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) {
+ //MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ //MONO_EMIT_NEW_LOAD_MEMBASE (s, sparc_o7, spvar->inst_basereg, spvar->inst_offset);
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_START_HANDLER {
+}
+
+stmt: CEE_ENDFINALLY {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_CEQ (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCEQ, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#
+# Optimizations
+#
+
+reg: CEE_LDIND_REF (OP_REGVAR),
+reg: CEE_LDIND_I (OP_REGVAR),
+reg: CEE_LDIND_I4 (OP_REGVAR),
+reg: CEE_LDIND_U4 (OP_REGVAR) "0" {
+ /* This rule might not work on all archs, hence it is sparc only */
+ state->reg1 = state->left->tree->dreg;
+ tree->dreg = state->reg1;
+}
+
+stmt: CEE_STIND_I1 (OP_REGVAR, OP_ICONST) {
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->left->tree->dreg;
+ tree->inst_c0 = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I2 (OP_REGVAR, OP_ICONST) {
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->left->tree->dreg;
+ tree->inst_c0 = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_ADD (reg, OP_ICONST)) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADD_IMM, state->left->tree->dreg, state->right->left->reg1, state->right->right->tree->inst_c0);
+}
+
+stmt: CEE_STIND_REF (OP_REGVAR, CEE_ADD (reg, OP_ICONST)) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADD_IMM, state->left->tree->dreg, state->right->left->reg1, state->right->right->tree->inst_c0);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_SUB (reg, OP_ICONST)) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SUB_IMM, state->left->tree->dreg, state->right->left->reg1, state->right->right->tree->inst_c0);
+}
+
+stmt: CEE_STIND_REF (OP_REGVAR, CEE_SUB (reg, OP_ICONST)) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_SUB_IMM, state->left->tree->dreg, state->right->left->reg1, state->right->right->tree->inst_c0);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_ADD (reg, reg)) {
+ MONO_EMIT_BIALU (s, tree, CEE_ADD, state->left->tree->dreg, state->right->left->reg1, state->right->right->reg1);
+}
+
+stmt: CEE_STIND_REF (OP_REGVAR, CEE_ADD (reg, reg)) {
+ MONO_EMIT_BIALU (s, tree, CEE_ADD, state->left->tree->dreg, state->right->left->reg1, state->right->right->reg1);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_LDIND_I4(base)) {
+ MONO_EMIT_LOAD_MEMBASE (s, tree, state->left->tree->dreg, state->right->left->tree->inst_basereg,
+ state->right->left->tree->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_REF (OP_REGVAR, CEE_LDIND_REF(base)) {
+ MONO_EMIT_LOAD_MEMBASE (s, tree, state->left->tree->dreg, state->right->left->tree->inst_basereg,
+ state->right->left->tree->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (CEE_LDIND_I1(base)),
+stmt: OP_SETRET (CEE_LDIND_U1(base)),
+stmt: OP_SETRET (CEE_LDIND_I2(base)),
+stmt: OP_SETRET (CEE_LDIND_U2(base)),
+stmt: OP_SETRET (CEE_LDIND_I(base)),
+stmt: OP_SETRET (CEE_LDIND_REF(base)),
+stmt: OP_SETRET (CEE_LDIND_I4(base)),
+stmt: OP_SETRET (CEE_LDIND_U4(base)) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, ldind_to_load_membase (state->left->tree->opcode),
+ sparc_i0, state->left->left->tree->inst_basereg, state->left->left->tree->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (CEE_LDIND_I4(OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = sparc_i0;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (CEE_LDIND_I(OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = sparc_i0;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I (OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I4 (OP_REGVAR)) {
+ tree->opcode = OP_SETREG;
+ tree->dreg = tree->unused;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF(base)) {
+ MONO_EMIT_LOAD_MEMBASE (s, tree, tree->unused, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I4(base)) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE, tree->unused, state->left->left->tree->inst_basereg,
+ state->left->left->tree->inst_offset);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LDADDR (OP_REGOFFSET) "1" {
+ if (state->left->tree->inst_offset) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADD_IMM, state->reg1, state->left->tree->inst_basereg, state->left->tree->inst_offset);
+ } else {
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->tree->inst_basereg;
+ tree->dreg = state->reg1;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+# FIXME: This rule was commented out in inssel.brg, why ?
+reg: CEE_REM (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_REM_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+# This one too
+reg: CEE_DIV (reg, OP_ICONST) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_DIV_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: OP_LOCALLOC (OP_ICONST) {
+ tree->opcode = OP_SPARC_LOCALLOC_IMM;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+# FIXME: Optimized MEMCPY for copying valuetypes
+
+# Optimized version for initializing valuetypes on the stack
+stmt: OP_MEMSET (OP_LDADDR(OP_REGOFFSET)) "0" {
+ int size = tree->unused;
+ int offset = state->left->left->tree->inst_offset;
+ int destreg = state->left->left->tree->inst_basereg;
+ int val_reg;
+
+ if (tree->inst_imm) {
+ val_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_ICONST (s, val_reg, tree->inst_imm);
+ }
+ else
+ val_reg = sparc_g0;
+
+ /* Target address must be dword aligned */
+ if ((tree->inst_imm == 0) && (size >= 8) &&
+ (destreg == sparc_fp) && (((offset - MONO_SPARC_STACK_BIAS) % 8) == 0)) {
+ if (!mono_sparc_is_v9 ()) {
+ /* Use STD */
+ MONO_EMIT_NEW_ICONST (s, sparc_g1, 0);
+
+ while (size >= 8) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI8_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 8;
+ size -= 8;
+ }
+ }
+ else {
+ /* Use STX imm */
+ while (size >= 8) {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STOREI8_MEMBASE_IMM, destreg, offset, 0);
+ offset += 8;
+ size -= 8;
+ }
+ }
+ }
+
+ while (size >= 4) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 4;
+ size -= 4;
+ }
+ while (size >= 2) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI2_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 2;
+ size -= 2;
+ }
+ while (size >= 1) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI1_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 1;
+ size -= 1;
+ }
+}
+
+stmt: OP_MEMSET (reg) "0" {
+ int size = tree->unused;
+ int offset = 0;
+ int destreg = state->left->reg1;
+ int val_reg;
+
+ if (tree->inst_imm) {
+ val_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_ICONST (s, val_reg, tree->inst_imm);
+ }
+ else
+ val_reg = sparc_g0;
+
+ /* FIXME: This assumes the destination is dword aligned */
+ /*
+ if ((tree->inst_imm == 0) && (size >= 8)) {
+ while (size >= 8) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI8_MEMBASE_IMM, destreg, offset, sparc_g0);
+ offset += 8;
+ size -= 8;
+ }
+ }
+ */
+
+ while (size >= 4) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 4;
+ size -= 4;
+ }
+ while (size >= 2) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI2_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 2;
+ size -= 2;
+ }
+ while (size >= 1) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI1_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 1;
+ size -= 1;
+ }
+}
+
+
+stmt: CEE_STIND_R8 (base, OP_R8CONST) {
+ /* fp constants are pricy on SPARC */
+ guint64 d = *(guint64*)state->right->tree->inst_p0;
+
+ if (d == 0) {
+ if (sizeof (gpointer) == 8) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STOREI8_MEMBASE_REG, state->left->tree->inst_basereg, state->left->tree->inst_offset, sparc_g0);
+ }
+ else {
+ /* STOREI8 would write %g1 as well */
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, state->left->tree->inst_basereg, state->left->tree->inst_offset, sparc_g0);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, state->left->tree->inst_basereg, state->left->tree->inst_offset + 4, sparc_g0);
+ }
+ }
+ else {
+ state->right->tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, state->right->tree);
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STORER8_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->reg1);
+ }
+}
+
+%%
diff --git a/mono/mini/inssel-x86.brg b/mono/mini/inssel-x86.brg
new file mode 100644
index 00000000000..ad694bc889a
--- /dev/null
+++ b/mono/mini/inssel-x86.brg
@@ -0,0 +1,708 @@
+#define MONO_EMIT_NEW_X86_COMPARE_MEMBASE_REG(cfg,basereg,offset,operand) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_X86_COMPARE_MEMBASE_REG; \
+ inst->inst_basereg = basereg; \
+ inst->inst_offset = offset; \
+ inst->sreg2 = operand; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_X86_COMPARE_MEMBASE_IMM(cfg,basereg,offset,operand) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_X86_COMPARE_MEMBASE_IMM; \
+ inst->inst_basereg = basereg; \
+ inst->inst_offset = offset; \
+ inst->inst_imm = operand; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+/* override the arch independant versions with fast x86 versions */
+
+#undef MONO_EMIT_BOUNDS_CHECK
+#undef MONO_EMIT_BOUNDS_CHECK_IMM
+
+#define MONO_EMIT_BOUNDS_CHECK(cfg, array_reg, array_type, array_length_field, index_reg) do { \
+ if (! (state->tree->flags & MONO_INST_NORANGECHECK)) { \
+ MONO_EMIT_NEW_X86_COMPARE_MEMBASE_REG (cfg, array_reg, G_STRUCT_OFFSET (array_type, array_length_field), index_reg); \
+ MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \
+ } \
+ } while (0)
+
+#define MONO_EMIT_BOUNDS_CHECK_IMM(cfg, array_reg, array_type, array_length_field, index_imm) do { \
+ if (! (state->tree->flags & MONO_INST_NORANGECHECK)) { \
+ MONO_EMIT_NEW_X86_COMPARE_MEMBASE_IMM (cfg, array_reg, G_STRUCT_OFFSET (array_type, array_length_field), index_imm); \
+ MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \
+ } \
+ } while (0)
+
+
+%%
+
+#
+# inssel-x86.brg: burg file for special x86 instructions
+#
+# Author:
+# Dietmar Maurer (dietmar@ximian.com)
+# Paolo Molaro (lupus@ximian.com)
+#
+# (C) 2002 Ximian, Inc.
+#
+
+stmt: OP_START_HANDLER {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORE_MEMBASE_REG, spvar->inst_basereg, spvar->inst_offset, X86_ESP);
+}
+
+stmt: CEE_ENDFINALLY {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, X86_ESP, spvar->inst_basereg, spvar->inst_offset);
+ tree->opcode = CEE_RET;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) {
+ MonoInst *spvar = mono_find_spvar_for_region (s, s->cbb->region);
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, X86_EAX, state->left->reg1);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, X86_ESP, spvar->inst_basereg, spvar->inst_offset);
+ tree->opcode = CEE_RET;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I8 (OP_REGVAR, lreg) {
+ /* this should only happen for methods returning a long */
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, X86_EAX, state->right->reg1);
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, X86_EDX, state->right->reg2);
+}
+
+lreg: OP_LNEG (lreg) "3" {
+ int tmpr = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_UNALU (s, CEE_NEG, state->reg1, state->left->reg1);
+ MONO_EMIT_BIALU_IMM (s, tree, OP_ADC_IMM, tmpr, state->left->reg2, 0);
+ MONO_EMIT_NEW_UNALU (s, CEE_NEG, state->reg2, tmpr);
+}
+
+freg: OP_LCONV_TO_R8 (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_X86_PUSH, -1, state->left->reg2);
+ MONO_EMIT_NEW_UNALU (s, OP_X86_PUSH, -1, state->left->reg1);
+ tree->opcode = OP_X86_FP_LOAD_I8;
+ tree->inst_basereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, X86_ESP, X86_ESP, 8);
+}
+
+freg: OP_LCONV_TO_R4 (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_X86_PUSH, -1, state->left->reg2);
+ MONO_EMIT_NEW_UNALU (s, OP_X86_PUSH, -1, state->left->reg1);
+ tree->opcode = OP_X86_FP_LOAD_I8;
+ tree->inst_basereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+ /* change precision */
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STORER4_MEMBASE_REG, X86_ESP, 0, state->reg1);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADR4_MEMBASE, state->reg1, X86_ESP, 0);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, X86_ESP, X86_ESP, 8);
+}
+
+freg: CEE_CONV_R_UN (reg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_X86_PUSH_IMM, -1, -1, 0);
+ MONO_EMIT_NEW_UNALU (s, OP_X86_PUSH, -1, state->left->reg1);
+ tree->opcode = OP_X86_FP_LOAD_I8;
+ tree->inst_basereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, X86_ESP, X86_ESP, 8);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_REF (base), reg),
+cflags: OP_COMPARE (CEE_LDIND_I (base), reg),
+cflags: OP_COMPARE (CEE_LDIND_I4 (base), reg),
+cflags: OP_COMPARE (CEE_LDIND_U4 (base), reg) {
+ tree->opcode = OP_X86_COMPARE_MEMBASE_REG;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ tree->sreg2 = state->right->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_REF (base), CEE_LDIND_REF (OP_REGVAR)),
+cflags: OP_COMPARE (CEE_LDIND_I (base), CEE_LDIND_REF (OP_REGVAR)),
+cflags: OP_COMPARE (CEE_LDIND_I4 (base), CEE_LDIND_REF (OP_REGVAR)),
+cflags: OP_COMPARE (CEE_LDIND_U4 (base), CEE_LDIND_REF (OP_REGVAR)) {
+ tree->opcode = OP_X86_COMPARE_MEMBASE_REG;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ tree->sreg2 = state->right->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_REF (base), OP_ICONST),
+cflags: OP_COMPARE (CEE_LDIND_I (base), OP_ICONST),
+cflags: OP_COMPARE (CEE_LDIND_I4 (base), OP_ICONST),
+cflags: OP_COMPARE (CEE_LDIND_U4 (base), OP_ICONST) {
+ tree->opcode = OP_X86_COMPARE_MEMBASE_IMM;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ tree->inst_imm = state->right->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (reg, CEE_LDIND_REF (base)),
+cflags: OP_COMPARE (reg, CEE_LDIND_I (base)),
+cflags: OP_COMPARE (reg, CEE_LDIND_I4 (base)),
+cflags: OP_COMPARE (reg, CEE_LDIND_U4 (base)) {
+ tree->opcode = OP_X86_COMPARE_REG_MEMBASE;
+ tree->sreg2 = state->right->left->tree->inst_basereg;
+ tree->inst_offset = state->right->left->tree->inst_offset;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags: OP_COMPARE (CEE_LDIND_REF (OP_REGVAR), CEE_LDIND_REF (base)),
+cflags: OP_COMPARE (CEE_LDIND_I (OP_REGVAR), CEE_LDIND_I (base)),
+cflags: OP_COMPARE (CEE_LDIND_I4 (OP_REGVAR), CEE_LDIND_I4 (base)),
+cflags: OP_COMPARE (CEE_LDIND_U4 (OP_REGVAR), CEE_LDIND_U4 (base)) {
+ tree->opcode = OP_X86_COMPARE_REG_MEMBASE;
+ tree->sreg2 = state->right->left->tree->inst_basereg;
+ tree->inst_offset = state->right->left->tree->inst_offset;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+cflags : OP_CEQ (OP_COMPARE (OP_CEQ (cflags), OP_ICONST)) {
+ tree->opcode = OP_CNE;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBCOND (!state->left->right->tree->inst_c0);
+ return 1;
+}
+
+stmt: CEE_STIND_I1 (base, OP_CEQ (OP_COMPARE (OP_CEQ (cflags), OP_ICONST))) {
+ tree->opcode = OP_X86_SETNE_MEMBASE;
+ tree->inst_offset = state->left->tree->inst_offset;
+ tree->inst_basereg = state->left->tree->inst_basereg;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBCOND (!state->right->left->right->tree->inst_c0);
+ return 1;
+}
+
+stmt: CEE_STIND_I1 (base, OP_CEQ (cflags)) {
+ tree->opcode = OP_X86_SETEQ_MEMBASE;
+ tree->inst_offset = state->left->tree->inst_offset;
+ tree->inst_basereg = state->left->tree->inst_basereg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LOCALLOC (OP_ICONST) {
+ if (tree->flags & MONO_INST_INIT) {
+ /* microcoded in mini-x86.c */
+ tree->sreg1 = mono_regstate_next_int (s->rs);
+ tree->dreg = state->reg1;
+ MONO_EMIT_NEW_ICONST (s, tree->sreg1, state->left->tree->inst_c0);
+ mono_bblock_add_inst (s->cbb, tree);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, state->left->tree->inst_c0);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, X86_ESP);
+ }
+}
+
+reg: OP_LOCALLOC (reg) {
+ tree->sreg1 = state->left->tree->dreg;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, X86_EAX, state->left->reg1);
+}
+
+stmt: OP_SETRET (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, X86_EDX, state->left->reg2);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, X86_EAX, state->left->reg1);
+}
+
+stmt: OP_SETRET (CEE_LDIND_REF (OP_REGVAR)),
+stmt: OP_SETRET (CEE_LDIND_I (OP_REGVAR)),
+stmt: OP_SETRET (CEE_LDIND_I4 (OP_REGVAR)),
+stmt: OP_SETRET (CEE_LDIND_U4 (OP_REGVAR)) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, X86_EAX, state->left->left->tree->dreg);
+}
+
+stmt: OP_SETRET (freg) {
+ /* nothing to do */
+}
+
+stmt: OP_SETRET (OP_ICONST) {
+ tree->opcode = OP_ICONST;
+ tree->inst_c0 = state->left->tree->inst_c0;
+ tree->dreg = X86_EAX;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SETRET (i8con) {
+ MONO_EMIT_NEW_ICONST (s, X86_EAX, state->left->tree->inst_ls_word);
+ MONO_EMIT_NEW_ICONST (s, X86_EDX, state->left->tree->inst_ms_word);
+}
+
+stmt: OP_OUTARG (reg) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_REF (OP_REGVAR)),
+stmt: OP_OUTARG (CEE_LDIND_I4 (OP_REGVAR)),
+stmt: OP_OUTARG (CEE_LDIND_U4 (OP_REGVAR)),
+stmt: OP_OUTARG (CEE_LDIND_I (OP_REGVAR)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (lreg) {
+ MONO_EMIT_NEW_UNALU (s, OP_X86_PUSH, -1, state->left->reg2);
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I8 (base)) {
+ MonoInst *ins;
+ ins = mono_mempool_alloc0 (s->mempool, sizeof (MonoInst));
+ ins->opcode = OP_X86_PUSH_MEMBASE;
+ ins->inst_basereg = state->left->left->tree->inst_basereg;
+ ins->inst_offset = state->left->left->tree->inst_offset + 4;
+ mono_bblock_add_inst (s->cbb, ins);
+
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (OP_ICONST) {
+ tree->opcode = OP_X86_PUSH_IMM;
+ tree->inst_imm = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (i8con) {
+ MonoInst *ins;
+ ins = mono_mempool_alloc0 (s->mempool, sizeof (MonoInst));
+ ins->opcode = OP_X86_PUSH_IMM;
+ ins->inst_imm = state->left->tree->inst_ms_word;
+ mono_bblock_add_inst (s->cbb, ins);
+
+ tree->opcode = OP_X86_PUSH_IMM;
+ tree->inst_imm = state->left->tree->inst_ls_word;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDIND_I4 (base)),
+stmt: OP_OUTARG (CEE_LDIND_U4 (base)),
+stmt: OP_OUTARG (CEE_LDIND_I (base)),
+stmt: OP_OUTARG (CEE_LDIND_REF (base)) {
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = state->left->left->tree->inst_basereg;
+ tree->inst_offset = state->left->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (CEE_LDOBJ (reg)) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG (freg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
+ tree->opcode = OP_STORER8_MEMBASE_REG;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_destbasereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R4 (freg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, 4);
+ tree->opcode = OP_STORER4_MEMBASE_REG;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_destbasereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_R8 (freg) {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
+ tree->opcode = OP_STORER8_MEMBASE_REG;
+ tree->sreg1 = state->left->reg1;
+ tree->inst_destbasereg = X86_ESP;
+ tree->inst_offset = 0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_VT (CEE_LDOBJ (base)) {
+ MonoInst *vt = state->left->left->tree;
+ //g_print ("vt size: %d at R%d + %d\n", tree->inst_imm, vt->inst_basereg, vt->inst_offset);
+
+ if (!tree->inst_imm)
+ return;
+
+ if (tree->inst_imm <= 4) {
+ tree->opcode = OP_X86_PUSH_MEMBASE;
+ tree->inst_basereg = vt->inst_basereg;
+ tree->inst_offset = vt->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+ } else if (tree->inst_imm <= 20) {
+ int sz = tree->inst_imm;
+ sz += 3;
+ sz &= ~3;
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SUB_IMM, X86_ESP, X86_ESP, sz);
+ mini_emit_memcpy (s, X86_ESP, 0, vt->inst_basereg, vt->inst_offset, tree->inst_imm, 0);
+ } else {
+ tree->opcode = OP_X86_PUSH_OBJ;
+ tree->inst_basereg = vt->inst_basereg;
+ tree->inst_offset = vt->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+ }
+}
+
+stmt: OP_OUTARG_VT (OP_ICONST) {
+ tree->opcode = OP_X86_PUSH_IMM;
+ tree->inst_imm = state->left->tree->inst_c0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_OUTARG_VT (reg) {
+ tree->opcode = OP_X86_PUSH;
+ tree->sreg1 = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: OP_LDADDR (OP_REGOFFSET),
+reg: CEE_LDOBJ (OP_REGOFFSET) {
+ if (state->left->tree->inst_offset) {
+ tree->opcode = OP_X86_LEA_MEMBASE;
+ tree->inst_imm = state->left->tree->inst_offset;
+ } else
+ tree->opcode = OP_MOVE;
+
+ tree->sreg1 = state->left->tree->inst_basereg;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_LDELEMA (reg, reg) "15" {
+ guint32 size = mono_class_array_element_size (tree->klass);
+
+ MONO_EMIT_BOUNDS_CHECK (s, state->left->reg1, MonoArray, max_length, state->right->reg1);
+
+ if (size == 1 || size == 2 || size == 4 || size == 8) {
+ static const int fast_log2 [] = { 1, 0, 1, -1, 2, -1, -1, -1, 3 };
+ tree->opcode = OP_X86_LEA;
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = state->right->reg1;
+ tree->inst_imm = G_STRUCT_OFFSET (MonoArray, vector);
+ tree->unused = fast_log2 [size];
+ mono_bblock_add_inst (s->cbb, tree);
+ } else {
+ int mult_reg = mono_regstate_next_int (s->rs);
+ int add_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_MUL_IMM, mult_reg, state->right->reg1, size);
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, add_reg, mult_reg, state->left->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, add_reg, G_STRUCT_OFFSET (MonoArray, vector));
+ }
+}
+
+stmt: CEE_STIND_R8 (OP_REGVAR, freg) {
+ /* nothing to do: the value is already on the FP stack */
+}
+
+stmt: CEE_STIND_I4 (base, CEE_ADD (CEE_LDIND_I4 (base), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+
+ if (con == 1) {
+ tree->opcode = OP_X86_INC_MEMBASE;
+ } else {
+ tree->opcode = OP_X86_ADD_MEMBASE_IMM;
+ tree->inst_imm = con;
+ }
+
+ tree->inst_basereg = state->left->tree->inst_basereg;
+ tree->inst_offset = state->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBTREE_TYPE *t1 = state->right->left->left->tree;
+ MBTREE_TYPE *t2 = state->left->tree;
+ MBCOND (t1->inst_basereg == t2->inst_basereg &&
+ t1->inst_offset == t2->inst_offset);
+ return 2;
+}
+
+stmt: CEE_STIND_I4 (base, CEE_SUB (CEE_LDIND_I4 (base), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+
+ if (con == 1) {
+ tree->opcode = OP_X86_DEC_MEMBASE;
+ } else {
+ tree->opcode = OP_X86_SUB_MEMBASE_IMM;
+ tree->inst_imm = con;
+ }
+
+ tree->inst_basereg = state->left->tree->inst_basereg;
+ tree->inst_offset = state->left->tree->inst_offset;
+ mono_bblock_add_inst (s->cbb, tree);
+} cost {
+ MBTREE_TYPE *t1 = state->right->left->left->tree;
+ MBTREE_TYPE *t2 = state->left->tree;
+ MBCOND (t1->inst_basereg == t2->inst_basereg &&
+ t1->inst_offset == t2->inst_offset);
+ return 2;
+}
+
+#
+# this rules is incorrect, it needs to do an indirect inc (inc_membase)
+#stmt: CEE_STIND_I4 (reg, CEE_ADD (reg, OP_ICONST)) {
+# tree->opcode = OP_X86_INC_REG;
+# tree->dreg = state->left->reg1;
+# mono_bblock_add_inst (s->cbb, tree);
+#} cost {
+# MBState *s1 = state->left;
+# MBState *s2 = state->right->left;
+# int con = state->right->right->tree->inst_c0;
+# MBCOND (con == 1 && s1->reg1 == s2->reg1);
+# return 1;
+#}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_SUB (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+ int dreg = state->left->tree->dreg;
+ int sreg = state->right->left->left->tree->dreg;
+
+ if (con == 1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_DEC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else if (con == -1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_INC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else {
+ tree->opcode = OP_SUB_IMM;
+ tree->inst_imm = con;
+ tree->sreg1 = sreg;
+ tree->dreg = dreg;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I (OP_REGVAR, CEE_ADD (CEE_LDIND_I (OP_REGVAR), OP_ICONST)),
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_ADD (CEE_LDIND_I4 (OP_REGVAR), OP_ICONST)) {
+ int con = state->right->right->tree->inst_c0;
+ int dreg = state->left->tree->dreg;
+ int sreg = state->right->left->left->tree->dreg;
+
+ if (con == 1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_INC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else if (con == -1) {
+ if (dreg != sreg)
+ MONO_EMIT_NEW_UNALU (s, OP_MOVE, dreg, sreg);
+ tree->opcode = OP_X86_DEC_REG;
+ tree->dreg = tree->sreg1 = dreg;
+ } else {
+ tree->opcode = OP_ADD_IMM;
+ tree->inst_imm = con;
+ tree->sreg1 = sreg;
+ tree->dreg = dreg;
+ }
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_LDIND_I2 (OP_REGVAR) {
+ MONO_EMIT_UNALU (s, tree, OP_SEXT_I2, state->reg1, state->left->tree->dreg);
+}
+
+# The XOR rule
+stmt: CEE_STIND_I4 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I2 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I1 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_REF (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I (OP_REGVAR, OP_ICONST) {
+ int r = state->left->tree->dreg;
+ MONO_EMIT_BIALU (s, tree, CEE_XOR, r, r, r);
+} cost {
+ MBCOND (!state->right->tree->inst_c0);
+
+ return 0;
+}
+
+# on x86, fp compare overwrites EAX, so we must
+# either improve the local register allocator or
+# emit coarse opcodes which saves EAX for us.
+
+reg: OP_CEQ (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCEQ, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CLT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCLT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+reg: OP_CGT_UN (OP_COMPARE (freg, freg)) {
+ MONO_EMIT_BIALU (s, tree, OP_FCGT_UN, state->reg1, state->left->left->reg1,
+ state->left->right->reg1);
+}
+
+# fpcflags overwrites EAX, but this does not matter for statements
+# because we are the last operation in the tree.
+
+stmt: CEE_BNE_UN (fpcflags) {
+ tree->opcode = OP_FBNE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BEQ (fpcflags) {
+ tree->opcode = OP_FBEQ;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT (fpcflags) {
+ tree->opcode = OP_FBLT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLT_UN (fpcflags) {
+ tree->opcode = OP_FBLT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT (fpcflags) {
+ tree->opcode = OP_FBGT;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGT_UN (fpcflags) {
+ tree->opcode = OP_FBGT_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE (fpcflags) {
+ tree->opcode = OP_FBGE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BGE_UN (fpcflags) {
+ tree->opcode = OP_FBGE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE (fpcflags) {
+ tree->opcode = OP_FBLE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_BLE_UN (fpcflags) {
+ tree->opcode = OP_FBLE_UN;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_POP (freg) "0" {
+ /* we need to pop the value from the x86 FP stack */
+ MONO_EMIT_UNALU (s, tree, OP_X86_FPOP, -1, state->left->reg1);
+}
+
+# override the rules in inssel-float.brg that work for machines with FP registers
+
+freg: OP_FCONV_TO_R8 (freg) "0" {
+ /* nothing to do */
+}
+
+freg: OP_FCONV_TO_R4 (freg) "0" {
+ /* fixme: nothing to do ??*/
+}
+
+reg: CEE_ADD(reg, CEE_LDIND_I4 (base)) {
+ MonoInst *base = state->right->left->tree;
+
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = base->inst_basereg;
+ tree->inst_offset = base->inst_offset;
+ tree->opcode = OP_X86_ADD_MEMBASE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_SUB(reg, CEE_LDIND_I4 (base)) {
+ MonoInst *base = state->right->left->tree;
+
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = base->inst_basereg;
+ tree->inst_offset = base->inst_offset;
+ tree->opcode = OP_X86_SUB_MEMBASE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_MUL(reg, CEE_LDIND_I4 (base)) {
+ MonoInst *base = state->right->left->tree;
+
+ tree->dreg = state->reg1;
+ tree->sreg1 = state->left->reg1;
+ tree->sreg2 = base->inst_basereg;
+ tree->inst_offset = base->inst_offset;
+ tree->opcode = OP_X86_MUL_MEMBASE;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+lreg: OP_LSHL (lreg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+lreg: OP_LSHL (lreg, OP_ICONST) "0" {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHL_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+lreg: OP_LSHR (lreg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+lreg: OP_LSHR (lreg, OP_ICONST) "0" {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHR_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+lreg: OP_LSHR_UN (lreg, reg) "0" {
+ MONO_EMIT_BIALU (s, tree, tree->opcode, state->reg1, state->left->reg1, state->right->reg1);
+}
+
+lreg: OP_LSHR_UN (lreg, OP_ICONST) "0" {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_LSHR_UN_IMM, state->reg1, state->left->reg1, state->right->tree->inst_c0);
+}
+
+reg: OP_X86_TLS_GET {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+%%
diff --git a/mono/mini/inssel.brg b/mono/mini/inssel.brg
new file mode 100644
index 00000000000..26eae106253
--- /dev/null
+++ b/mono/mini/inssel.brg
@@ -0,0 +1,1775 @@
+/*
+ * inssel.brg: instruction selection
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ *
+ */
+#include <config.h>
+#include <string.h>
+
+#include "mini.h"
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/debug-helpers.h>
+
+#define MBTREE_TYPE MonoInst
+#define MBCGEN_TYPE MonoCompile
+#define MBCOST_DATA MonoCompile
+#define MBALLOC_STATE mono_mempool_alloc (data->state_pool, sizeof (MBState))
+#define MBMAX_OPCODES OP_LAST
+#define MBGET_OP_NAME(op) mono_inst_name (op)
+
+#define MBTREE_OP(t) ((t)->opcode)
+#define MBTREE_LEFT(t) ((t)->inst_left)
+#define MBTREE_RIGHT(t) ((t)->inst_right)
+
+#define MONO_EMIT_UNALU(cfg,inst,op,dr,sr1) do { \
+ (inst)->opcode = op; \
+ (inst)->dreg = dr; \
+ (inst)->sreg1 = sr1; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_UNALU(cfg,op,dr,sr1) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->dreg = dr; \
+ inst->sreg1 = sr1; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_BIALU(cfg,inst,op,dr,sr1,sr2) do { \
+ (inst)->opcode = op; \
+ (inst)->dreg = dr; \
+ (inst)->sreg1 = sr1; \
+ (inst)->sreg2 = sr2; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_BIALU(cfg,op,dr,sr1,sr2) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->dreg = dr; \
+ inst->sreg1 = sr1; \
+ inst->sreg2 = sr2; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_BIALU_IMM(cfg,inst,op,dr,sr,imm) do { \
+ (inst)->opcode = op; \
+ (inst)->dreg = dr; \
+ (inst)->sreg1 = sr; \
+ (inst)->inst_p1 = (gpointer)imm; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_BIALU_IMM(cfg,op,dr,sr,imm) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->dreg = dr; \
+ inst->sreg1 = sr; \
+ inst->inst_p1 = (gpointer)imm; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_LOAD_MEMBASE(cfg,inst,dr,base,offset) do { \
+ (inst)->opcode = OP_LOAD_MEMBASE; \
+ (inst)->dreg = dr; \
+ (inst)->inst_basereg = base; \
+ (inst)->inst_offset = offset; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_LOAD_MEMBASE_OP(cfg,inst,op,dr,base,offset) do { \
+ (inst)->opcode = op; \
+ (inst)->dreg = dr; \
+ (inst)->inst_basereg = base; \
+ (inst)->inst_offset = offset; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_LOAD_MEM(cfg,dr,addr) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_LOADU4_MEM; \
+ inst->dreg = dr; \
+ inst->inst_p0 = addr; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_LOAD_MEMBASE(cfg,dr,base,offset) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_LOAD_MEMBASE; \
+ inst->dreg = dr; \
+ inst->inst_basereg = base; \
+ inst->inst_offset = offset; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg,op,dr,base,offset) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->dreg = dr; \
+ inst->inst_basereg = base; \
+ inst->inst_offset = offset; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_STORE_MEMBASE(cfg,inst,op,base,offset,sr) do { \
+ (inst)->opcode = op; \
+ (inst)->sreg1 = sr; \
+ (inst)->inst_destbasereg = base; \
+ (inst)->inst_offset = offset; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_STORE_MEMBASE(cfg,op,base,offset,sr) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->sreg1 = sr; \
+ inst->inst_destbasereg = base; \
+ inst->inst_offset = offset; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_STORE_MEMBASE_IMM(cfg,inst,op,base,offset,imm) do { \
+ (inst)->opcode = op; \
+ (inst)->inst_destbasereg = base; \
+ (inst)->inst_offset = offset; \
+ (inst)->inst_p1 = (gpointer)imm; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_STORE_MEMBASE_IMM(cfg,op,base,offset,imm) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->inst_destbasereg = base; \
+ inst->inst_offset = offset; \
+ inst->inst_p1 = (gpointer)imm; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_COMPARE_IMM(cfg,sr1,imm) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_COMPARE_IMM; \
+ inst->sreg1 = sr1; \
+ inst->inst_p1 = (gpointer)imm; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_ICOMPARE_IMM(cfg,sr1,imm) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = sizeof (void*) == 8 ? OP_ICOMPARE_IMM : OP_COMPARE_IMM; \
+ inst->sreg1 = sr1; \
+ inst->inst_p1 = (gpointer)imm; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_COND_EXC(cfg,cond,name) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_COND_EXC_##cond; \
+ inst->inst_p1 = (char*)name; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_ICONST(cfg,dr,imm) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_ICONST; \
+ inst->dreg = dr; \
+ inst->inst_c0 = imm; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_I8CONST(cfg,dr,imm) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_I8CONST; \
+ inst->dreg = dr; \
+ inst->inst_l = imm; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_PCONST(cfg,dr,imm) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_ICONST; \
+ inst->dreg = dr; \
+ inst->inst_p0 = (gpointer) imm; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_AOTCONST(cfg,dr,imm,type) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = OP_AOTCONST; \
+ inst->dreg = dr; \
+ inst->inst_p0 = imm; \
+ inst->inst_c1 = type; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_CLASSCONST(cfg,dr,imm) MONO_EMIT_NEW_AOTCONST(cfg,dr,imm,MONO_PATCH_INFO_CLASS)
+
+#define MONO_EMIT_NEW_BRANCH_BLOCK(cfg,op,targetbb) do { \
+ MonoInst *inst; \
+ MonoInst *target_label; \
+ target_label = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ target_label->opcode = OP_LABEL; \
+ target_label->next = (targetbb)->code; \
+ target_label->inst_c0 = (targetbb)->native_offset; \
+ (targetbb)->code = target_label; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->inst_i0 = target_label; \
+ inst->flags = MONO_INST_BRLABEL; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_EMIT_NEW_BRANCH_LABEL(cfg,op,label) do { \
+ MonoInst *inst; \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ inst->opcode = op; \
+ inst->inst_i0 = label; \
+ inst->flags = MONO_INST_BRLABEL; \
+ mono_bblock_add_inst ((cfg)->cbb, inst); \
+ } while (0)
+
+#define MONO_NEW_LABEL(cfg,inst) do { \
+ (inst) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (inst)->opcode = OP_LABEL; \
+ } while (0)
+
+#define MONO_EMIT_BOUNDS_CHECK(cfg, array_reg, array_type, array_length_field, index_reg) do { \
+ if (! (state->tree->flags & MONO_INST_NORANGECHECK)) { \
+ int _length_reg = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, _length_reg, array_reg, G_STRUCT_OFFSET (array_type, array_length_field)); \
+ MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, _length_reg, index_reg); \
+ MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \
+ } \
+ } while (0)
+
+#define MONO_EMIT_BOUNDS_CHECK_IMM(cfg, array_reg, array_type, array_length_field, index_imm) do { \
+ if (! (state->tree->flags & MONO_INST_NORANGECHECK)) { \
+ int _length_reg = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, _length_reg, array_reg, G_STRUCT_OFFSET (array_type, array_length_field)); \
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, _length_reg, index_imm); \
+ MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); \
+ } \
+ } while (0)
+
+/* we need to kludge state because monoburg puts this stuff before the definition of MBState */
+void mini_emit_virtual_call (MonoCompile *s, void *state, MonoInst *tree, int novirt_op, int virtop);
+void mini_emit_isninst_cast (MonoCompile *s, int klass_reg, MonoClass *klass, MonoInst *false_target, MonoInst *true_target);
+void mini_emit_isninst_iface_cast (MonoCompile *s, int vtable_reg, MonoClass *klass, MonoInst *false_target, MonoInst *true_target);
+void mini_emit_isninst_iface_class_cast (MonoCompile *s, int klass_reg, MonoClass *klass, MonoInst *false_target, MonoInst *true_target);
+void mini_emit_castclass (MonoCompile *s, int klass_reg, MonoClass *klass);
+void mini_emit_castclass_iface (MonoCompile *s, int vtable_reg, MonoClass *klass);
+void mini_emit_castclass_iface_class (MonoCompile *s, int klass_reg, MonoClass *klass);
+
+void mini_emit_memcpy (MonoCompile *s, int destreg, int doffset, int srcreg, int soffset, int size, int align);
+void mini_emit_memset (MonoCompile *s, int destreg, int offset, int size, int val, int align);
+
+int ldind_to_load_membase (int opcode);
+
+%%
+
+%termprefix OP_ CEE_
+
+%start stmt
+
+#
+# base addressing mode
+#
+
+base: reg "0" {
+ /* we create a new MonoInst in chain rules and set state->tree to it
+ * since a MBState (and hence state->tree) is reused in chain rules and
+ * normal rules.
+ */
+ MonoInst *inst;
+ inst = mono_mempool_alloc0 (s->mempool, sizeof (MonoInst));
+ inst->opcode = OP_ICONST; /* doesn't matter */
+ inst->inst_basereg = state->reg1;
+ inst->inst_offset = 0;
+ state->tree = inst;
+ //g_print ("mybase: (assigned R%d from R%d - R%d)\n", state->reg1, tree->dreg, state->reg2);
+ //tree->inst_offset = 0;
+ //tree->inst_basereg = state->reg1;
+}
+
+base: CEE_LDIND_I (OP_REGVAR) "0" {
+ tree->inst_offset = 0;
+ tree->inst_basereg = state->left->tree->dreg;
+}
+
+base: OP_REGOFFSET "0" {
+ /* nothing to do */
+}
+
+base: OP_LDADDR (OP_REGOFFSET),
+base: CEE_LDOBJ (OP_REGOFFSET) "0" {
+ tree->inst_offset = state->left->tree->inst_offset;
+ tree->inst_basereg = state->left->tree->inst_basereg;
+}
+
+base: CEE_ADD (base, OP_ICONST) "0" {
+ tree->inst_offset = state->left->tree->inst_offset + state->right->tree->inst_c0;
+ tree->inst_basereg = state->left->tree->inst_basereg;
+}
+
+base: CEE_ADD (CEE_LDIND_REF (OP_REGVAR), OP_ICONST),
+base: CEE_ADD (CEE_LDIND_I (OP_REGVAR), OP_ICONST) "0" {
+ tree->inst_offset = state->right->tree->inst_c0;
+ tree->inst_basereg = state->left->left->tree->dreg;
+}
+
+#
+# helpers
+#
+
+reg: OP_ICONST {
+ MONO_EMIT_NEW_ICONST (s, state->reg1, tree->inst_c0);
+}
+
+reg: OP_AOTCONST {
+ MONO_EMIT_NEW_AOTCONST (s, state->reg1, tree->inst_p0, tree->inst_c1);
+}
+
+#
+# load/store operations
+#
+
+reg: CEE_LDIND_I (base),
+reg: CEE_LDIND_REF (base),
+reg: CEE_LDIND_I1 (base),
+reg: CEE_LDIND_U1 (base),
+reg: CEE_LDIND_I2 (base),
+reg: CEE_LDIND_U2 (base),
+reg: CEE_LDIND_I4 (base),
+reg: CEE_LDIND_U4 (base) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, ldind_to_load_membase (tree->opcode),
+ state->reg1, state->left->tree->inst_basereg, state->left->tree->inst_offset);
+}
+
+reg: OP_LDADDR (OP_REGOFFSET),
+reg: CEE_LDOBJ (OP_REGOFFSET) "2" {
+ /* use LEA */
+ tree->opcode = OP_MOVE;
+ tree->sreg1 = state->left->tree->inst_basereg;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+ if (state->left->tree->inst_offset)
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, tree->dreg, tree->dreg, state->left->tree->inst_offset);
+}
+
+reg: CEE_LDOBJ (reg),
+reg: OP_OBJADDR (reg),
+reg: OP_VTADDR (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: CEE_LDIND_U1 (OP_REGVAR) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->tree->dreg, 0xff);
+}
+
+reg: CEE_LDIND_U2 (OP_REGVAR) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->tree->dreg, 0xffff);
+}
+
+stmt: CEE_STIND_REF (base, CEE_LDIND_REF (OP_REGVAR)),
+stmt: CEE_STIND_REF (base, CEE_LDIND_I (OP_REGVAR)),
+stmt: CEE_STIND_I (base, CEE_LDIND_REF (OP_REGVAR)),
+stmt: CEE_STIND_I (base, CEE_LDIND_I (OP_REGVAR)) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STORE_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->left->tree->dreg);
+}
+
+stmt: CEE_STIND_REF (OP_REGVAR, CEE_LDIND_REF (OP_REGVAR)),
+stmt: CEE_STIND_REF (OP_REGVAR, CEE_LDIND_I (OP_REGVAR)),
+stmt: CEE_STIND_I (OP_REGVAR, CEE_LDIND_REF (OP_REGVAR)),
+stmt: CEE_STIND_I (OP_REGVAR, CEE_LDIND_I (OP_REGVAR)),
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_LDIND_I4 (OP_REGVAR)) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->left->tree->dreg, state->right->left->tree->dreg);
+}
+
+
+stmt: CEE_STIND_I (base, reg),
+stmt: CEE_STIND_REF (base, reg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STORE_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+stmt: CEE_STIND_I (base, OP_ICONST),
+stmt: CEE_STIND_REF (base, OP_ICONST) {
+ MONO_EMIT_STORE_MEMBASE_IMM (s, tree, OP_STORE_MEMBASE_IMM, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->tree->inst_c0);
+}
+
+reg: CEE_LDIND_REF (OP_REGVAR),
+reg: CEE_LDIND_I (OP_REGVAR),
+reg: CEE_LDIND_I4 (OP_REGVAR),
+reg: CEE_LDIND_U4 (OP_REGVAR) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->tree->dreg);
+}
+
+stmt: CEE_STIND_I4 (base, reg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STOREI4_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+stmt: CEE_STIND_I4 (base, CEE_LDIND_I4 (OP_REGVAR)) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STOREI4_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->left->tree->dreg);
+}
+
+stmt: CEE_STIND_I4 (base, OP_ICONST) {
+ MONO_EMIT_STORE_MEMBASE_IMM (s, tree, OP_STOREI4_MEMBASE_IMM, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->tree->inst_c0);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, CEE_LDIND_I4 (base)) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE, state->left->tree->dreg,
+ state->right->left->tree->inst_basereg,
+ state->right->left->tree->inst_offset);
+}
+
+stmt: CEE_STIND_I1 (base, reg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STOREI1_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+stmt: CEE_STIND_I1 (base, OP_ICONST) {
+ MONO_EMIT_STORE_MEMBASE_IMM (s, tree, OP_STOREI1_MEMBASE_IMM, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->tree->inst_c0);
+}
+
+stmt: CEE_STIND_I2 (base, reg) {
+ MONO_EMIT_STORE_MEMBASE (s, tree, OP_STOREI2_MEMBASE_REG, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->reg1);
+}
+
+stmt: CEE_STIND_I2 (base, OP_ICONST) {
+ MONO_EMIT_STORE_MEMBASE_IMM (s, tree, OP_STOREI2_MEMBASE_IMM, state->left->tree->inst_basereg,
+ state->left->tree->inst_offset, state->right->tree->inst_c0);
+}
+
+stmt: CEE_STIND_I2 (OP_REGVAR, reg) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->left->tree->dreg, state->right->reg1, 0xffff);
+}
+
+stmt: CEE_STIND_I1 (OP_REGVAR, reg) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->left->tree->dreg, state->right->reg1, 0xff);
+}
+
+stmt: CEE_STIND_I1 (OP_REGVAR, CEE_LDIND_U1 (OP_REGVAR)),
+stmt: CEE_STIND_I1 (OP_REGVAR, CEE_LDIND_I1 (OP_REGVAR)) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->left->tree->dreg, state->right->left->tree->dreg, 0xff);
+}
+
+stmt: CEE_STIND_I2 (OP_REGVAR, CEE_LDIND_U2 (OP_REGVAR)),
+stmt: CEE_STIND_I2 (OP_REGVAR, CEE_LDIND_I2 (OP_REGVAR)) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->left->tree->dreg, state->right->left->tree->dreg, 0xffff);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I2 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I1 (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_REF (OP_REGVAR, OP_ICONST),
+stmt: CEE_STIND_I (OP_REGVAR, OP_ICONST) {
+ tree->inst_c0 = state->right->tree->inst_c0;
+ if (tree->opcode == CEE_STIND_I2)
+ tree->inst_c0 &= 0xffff;
+ if (tree->opcode == CEE_STIND_I1)
+ tree->inst_c0 &= 0xff;
+
+ tree->opcode = OP_ICONST;
+ tree->dreg = state->left->tree->dreg;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_STIND_I4 (OP_REGVAR, reg),
+stmt: CEE_STIND_REF (OP_REGVAR, reg),
+stmt: CEE_STIND_I (OP_REGVAR, reg) {
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->left->tree->dreg, state->right->reg1);
+}
+
+stmt: OP_MEMCPY (base, base) {
+ int size = tree->unused;
+ if (size > 0)
+ mini_emit_memcpy (s, state->left->tree->inst_basereg, state->left->tree->inst_offset,
+ state->right->tree->inst_basereg, state->right->tree->inst_offset, size, 0);
+}
+
+stmt: OP_MEMSET (base) {
+ int size = tree->unused;
+ if (size > 0)
+ mini_emit_memset (s, state->left->tree->inst_basereg, state->left->tree->inst_offset, size, tree->inst_imm, 0);
+}
+
+reg: OP_LDELEMA2D (reg, OP_GROUP (reg, reg)) "20" {
+ int bounds_reg = mono_regstate_next_int (s->rs);
+ int add_reg = mono_regstate_next_int (s->rs);
+ int mult_reg = mono_regstate_next_int (s->rs);
+ int mult2_reg = mono_regstate_next_int (s->rs);
+ int low1_reg = mono_regstate_next_int (s->rs);
+ int low2_reg = mono_regstate_next_int (s->rs);
+ int high1_reg = mono_regstate_next_int (s->rs);
+ int high2_reg = mono_regstate_next_int (s->rs);
+ int realidx1_reg = mono_regstate_next_int (s->rs);
+ int realidx2_reg = mono_regstate_next_int (s->rs);
+ int sum_reg = mono_regstate_next_int (s->rs);
+ int index1, index2;
+ guint32 size = mono_array_element_size (tree->klass);
+
+ index1 = state->right->left->reg1;
+ index2 = state->right->right->reg1;
+
+ /* range checking */
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, bounds_reg,
+ state->left->reg1, G_STRUCT_OFFSET (MonoArray, bounds));
+
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, low1_reg,
+ bounds_reg, G_STRUCT_OFFSET (MonoArrayBounds, lower_bound));
+ MONO_EMIT_NEW_BIALU (s, CEE_SUB, realidx1_reg, index1, low1_reg);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, high1_reg,
+ bounds_reg, G_STRUCT_OFFSET (MonoArrayBounds, length));
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, high1_reg, realidx1_reg);
+ MONO_EMIT_NEW_COND_EXC (s, LE_UN, "IndexOutOfRangeException");
+
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, low2_reg,
+ bounds_reg, sizeof (MonoArrayBounds) + G_STRUCT_OFFSET (MonoArrayBounds, lower_bound));
+ MONO_EMIT_NEW_BIALU (s, CEE_SUB, realidx2_reg, index2, low2_reg);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, high2_reg,
+ bounds_reg, sizeof (MonoArrayBounds) + G_STRUCT_OFFSET (MonoArrayBounds, length));
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, high2_reg, realidx2_reg);
+ MONO_EMIT_NEW_COND_EXC (s, LE_UN, "IndexOutOfRangeException");
+
+ MONO_EMIT_NEW_BIALU (s, CEE_MUL, mult_reg, high2_reg, realidx1_reg);
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, sum_reg, mult_reg, realidx2_reg);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_MUL_IMM, mult2_reg, sum_reg, size);
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, add_reg, mult2_reg, state->left->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, add_reg, G_STRUCT_OFFSET (MonoArray, vector));
+}
+
+#
+# conversions: conv_u can be implemented with AND, also all _ovf conversions?
+#
+
+reg: CEE_CONV_I1 (reg),
+reg: CEE_CONV_I2 (reg),
+reg: CEE_CONV_I4 (reg) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_U1 (reg) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xff);
+}
+
+reg: CEE_CONV_U2 (reg) {
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xffff);
+}
+
+reg: CEE_CONV_U4 (reg),
+reg: CEE_CONV_U (reg),
+reg: CEE_CONV_I (reg),
+reg: CEE_CONV_OVF_I4 (reg) {
+ if (sizeof (void *) == 8)
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+ else
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_OVF_U4 (reg),
+reg: CEE_CONV_OVF_I4_UN (reg) {
+ if (sizeof (void *) == 8) {
+ MONO_EMIT_UNALU (s, tree, tree->opcode, state->reg1, state->left->reg1);
+ } else {
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 0);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+ }
+}
+
+reg: CEE_CONV_OVF_I1 (reg) {
+ MONO_EMIT_NEW_ICOMPARE_IMM (s, state->left->reg1, 127);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_ICOMPARE_IMM (s, state->left->reg1, -128);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_OVF_I1_UN (reg) {
+ /* probe values between 0 to 127 */
+ MONO_EMIT_NEW_ICOMPARE_IMM (s, state->left->reg1, 127);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I1, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_OVF_U1 (reg),
+reg: CEE_CONV_OVF_U1_UN (reg) {
+ /* probe value to be within 0 to 255 */
+ MONO_EMIT_NEW_COMPARE_IMM (s, state->left->reg1, 255);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xff);
+}
+
+reg: CEE_CONV_OVF_I2 (reg) {
+ /* Probe value to be within -32768 and 32767 */
+ MONO_EMIT_NEW_ICOMPARE_IMM (s, state->left->reg1, 32767);
+ MONO_EMIT_NEW_COND_EXC (s, GT, "OverflowException");
+ MONO_EMIT_NEW_ICOMPARE_IMM (s, state->left->reg1, -32768);
+ MONO_EMIT_NEW_COND_EXC (s, LT, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_OVF_I2_UN (reg) {
+ /* Convert uint value into short, value within 0 and 32767 */
+ MONO_EMIT_NEW_ICOMPARE_IMM (s, state->left->reg1, 32767);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_UNALU (s, tree, CEE_CONV_I2, state->reg1, state->left->reg1);
+}
+
+reg: CEE_CONV_OVF_U2 (reg),
+reg: CEE_CONV_OVF_U2_UN (reg) {
+ /* Probe value to be within 0 and 65535 */
+ MONO_EMIT_NEW_ICOMPARE_IMM (s, state->left->reg1, 0xffff);
+ MONO_EMIT_NEW_COND_EXC (s, GT_UN, "OverflowException");
+ MONO_EMIT_BIALU_IMM (s, tree, OP_AND_IMM, state->reg1, state->left->reg1, 0xffff);
+}
+
+#
+# other alu operations
+#
+
+reg: OP_CEQ (cflags),
+reg: OP_CLT (cflags),
+reg: OP_CLT_UN (cflags),
+reg: OP_CGT (cflags),
+reg: OP_CGT_UN (cflags) {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#
+# control flow commands
+#
+
+stmt: OP_LABEL {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_NOP "0" {
+}
+
+stmt: CEE_BREAK "0" {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_SWITCH (reg) {
+ MonoInst *label;
+ int offset_reg = mono_regstate_next_int (s->rs);
+ int target_reg = mono_regstate_next_int (s->rs);
+ int n = GPOINTER_TO_INT (tree->klass);
+
+ MONO_NEW_LABEL (s, label);
+ mono_create_jump_table (s, label, tree->inst_many_bb, n);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, state->left->reg1, n);
+ MONO_EMIT_NEW_BRANCH_BLOCK (s, CEE_BGE_UN, tree->inst_many_bb [n]);
+ if (sizeof (gpointer) == 8)
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SHL_IMM, offset_reg, state->left->reg1, 3);
+ else
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SHL_IMM, offset_reg, state->left->reg1, 2);
+ mono_bblock_add_inst (s->cbb, label);
+ /* the backend must patch the address. we use 0xf0f0f0f0 to avoid the usage
+ * of special (short) opcodes on x86 */
+ if (sizeof (gpointer) == 8) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, target_reg, offset_reg, (long)0xf0f0f0f0f0f0f0f1LL);
+ }
+ else {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, target_reg, offset_reg, 0xf0f0f0f0);
+ }
+ MONO_EMIT_UNALU (s, tree, OP_BR_REG, -1, target_reg);
+}
+
+stmt: CEE_BR "0" {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ARGLIST (reg) {
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_CALL {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+reg: CEE_CALLVIRT (reg) {
+ mini_emit_virtual_call (s, state, tree, CEE_CALL, OP_CALL_MEMBASE);
+}
+
+stmt: OP_VOIDCALLVIRT (reg) {
+ mini_emit_virtual_call (s, state, tree, OP_VOIDCALL, OP_VOIDCALL_MEMBASE);
+}
+
+freg: OP_FCALLVIRT (reg) {
+ mini_emit_virtual_call (s, state, tree, OP_FCALL, OP_FCALL_MEMBASE);
+}
+
+stmt: OP_VCALLVIRT (reg, reg) {
+ mini_emit_virtual_call (s, state, tree, OP_VCALL, OP_VCALL_MEMBASE);
+}
+
+reg: OP_CALL_REG (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_VOIDCALL {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_VOIDCALL_REG (reg) {
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_FCALL {
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_FCALL_REG (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_VCALL (reg) {
+ mono_arch_emit_this_vret_args (s, (MonoCallInst*)tree, -1, -1, state->left->reg1);
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_VCALL_REG (reg, reg) {
+ mono_arch_emit_this_vret_args (s, (MonoCallInst*)tree, -1, -1, state->right->reg1);
+
+ tree->sreg1 = state->left->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_SAVE_LMF,
+stmt: OP_RESTORE_LMF {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+#
+# Optimized call instructions
+#
+
+reg: OP_CALL_REG (OP_ICONST),
+reg: OP_CALL_REG (OP_I8CONST) {
+ tree->opcode = CEE_CALL;
+ ((MonoCallInst*)tree)->fptr = state->left->tree->inst_p0;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_VOIDCALL_REG (OP_ICONST),
+stmt: OP_VOIDCALL_REG (OP_I8CONST) {
+ tree->opcode = OP_VOIDCALL;
+ ((MonoCallInst*)tree)->fptr = state->left->tree->inst_p0;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+freg: OP_FCALL_REG (OP_ICONST),
+freg: OP_FCALL_REG (OP_I8CONST) {
+ tree->opcode = OP_FCALL;
+ ((MonoCallInst*)tree)->fptr = state->left->tree->inst_p0;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_RET "0" {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_POP (reg)
+
+# remove some common pops without side effects
+stmt: CEE_POP (OP_ICONST)
+stmt: CEE_POP (CEE_LDIND_I1 (base))
+stmt: CEE_POP (CEE_LDIND_U1 (base))
+stmt: CEE_POP (CEE_LDIND_I2 (base))
+stmt: CEE_POP (CEE_LDIND_U2 (base))
+stmt: CEE_POP (CEE_LDIND_I4 (base))
+stmt: CEE_POP (CEE_LDIND_U4 (base))
+stmt: CEE_POP (CEE_LDIND_I (base))
+stmt: CEE_POP (CEE_LDIND_REF (base))
+stmt: CEE_POP (CEE_LDIND_I1 (OP_REGVAR))
+stmt: CEE_POP (CEE_LDIND_U1 (OP_REGVAR))
+stmt: CEE_POP (CEE_LDIND_I2 (OP_REGVAR))
+stmt: CEE_POP (CEE_LDIND_U2 (OP_REGVAR))
+stmt: CEE_POP (CEE_LDIND_I4 (OP_REGVAR))
+stmt: CEE_POP (CEE_LDIND_U4 (OP_REGVAR))
+stmt: CEE_POP (CEE_LDIND_I (OP_REGVAR))
+stmt: CEE_POP (CEE_LDIND_REF (OP_REGVAR))
+
+stmt: CEE_JMP "0" {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+# exception handling
+
+stmt: CEE_THROW (reg) {
+ MONO_EMIT_UNALU (s, tree, CEE_THROW, -1, state->left->reg1);
+}
+
+stmt: OP_RETHROW (reg) {
+ MONO_EMIT_UNALU (s, tree, OP_RETHROW, -1, state->left->reg1);
+}
+
+stmt: OP_THROW_OR_NULL (reg) {
+ MonoInst *object_is_null;
+
+ MONO_NEW_LABEL (s, object_is_null);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, 0, state->left->reg1, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+ MONO_EMIT_UNALU (s, tree, CEE_THROW, -1, state->left->reg1);
+ mono_bblock_add_inst (s->cbb, object_is_null);
+}
+
+stmt: CEE_THROW (CEE_LDIND_REF (OP_REGVAR)) {
+ MONO_EMIT_UNALU (s, tree, CEE_THROW, -1, state->left->left->tree->dreg);
+}
+
+stmt: OP_CALL_HANDLER {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_START_HANDLER "2" {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: CEE_ENDFINALLY "2" {
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+stmt: OP_ENDFILTER (reg) "2" {
+ MONO_EMIT_UNALU (s, tree, OP_ENDFILTER, -1, state->left->reg1);
+}
+
+stmt: OP_CHECK_THIS (reg) {
+ tree->sreg1 = state->left->reg1;
+ tree->dreg = state->reg1;
+ mono_bblock_add_inst (s->cbb, tree);
+}
+
+# object related opcodes
+
+reg: CEE_ISINST (reg) {
+ MonoClass *klass = tree->inst_newa_class;
+ MonoInst *object_is_null, *end_label, *false_label;
+ int obj_reg = state->left->reg1;
+ int vtable_reg = mono_regstate_next_int (s->rs);
+
+ MONO_NEW_LABEL (s, object_is_null);
+ MONO_NEW_LABEL (s, end_label);
+ MONO_NEW_LABEL (s, false_label);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, obj_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+
+ if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, vtable_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ /* the object_is_null target simply copies the input register to the output */
+ mini_emit_isninst_iface_cast (s, vtable_reg, klass, false_label, object_is_null);
+ } else {
+ int klass_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, vtable_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+
+ if (klass->rank) {
+ int rank_reg = mono_regstate_next_int (s->rs);
+ int eclass_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, rank_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, rank));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, rank_reg, klass->rank);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, false_label);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, eclass_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, cast_class));
+ if (klass->cast_class == mono_defaults.object_class) {
+ int parent_reg = mono_regstate_next_int (s->rs);
+ int const_reg;
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, parent_reg, eclass_reg, G_STRUCT_OFFSET (MonoClass, parent));
+ if (mono_compile_aot) {
+ const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class->parent);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, parent_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, parent_reg, mono_defaults.enum_class->parent);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, object_is_null);
+ if (mono_compile_aot) {
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, false_label);
+ } else if (klass->cast_class == mono_defaults.enum_class->parent) {
+ int const_reg;
+
+ if (mono_compile_aot) {
+ const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class->parent);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class->parent);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+ if (mono_compile_aot) {
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, false_label);
+ } else if (klass->cast_class == mono_defaults.enum_class) {
+ if (mono_compile_aot) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, false_label);
+ } else if (klass->cast_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ mini_emit_isninst_iface_class_cast (s, eclass_reg, klass->cast_class, false_label, object_is_null);
+ } else {
+ if ((klass->rank == 1) && (klass->byval_arg.type == MONO_TYPE_SZARRAY)) {
+ /* Check that the object is a vector too */
+ int bounds_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, bounds_reg, obj_reg, G_STRUCT_OFFSET (MonoArray, bounds));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, bounds_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, false_label);
+ }
+
+ /* the object_is_null target simply copies the input register to the output */
+ mini_emit_isninst_cast (s, eclass_reg, klass->cast_class, false_label, object_is_null);
+ }
+ } else {
+ /* the object_is_null target simply copies the input register to the output */
+ mini_emit_isninst_cast (s, klass_reg, klass, false_label, object_is_null);
+ }
+ }
+
+ mono_bblock_add_inst (s->cbb, false_label);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+ mono_bblock_add_inst (s->cbb, object_is_null);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, obj_reg);
+ mono_bblock_add_inst (s->cbb, end_label);
+}
+
+reg: OP_CISINST (reg) {
+ /* This opcode takes as input an object reference and a class, and returns:
+ 0) if the object is an instance of the class,
+ 1) if the object is not instance of the class,
+ 2) if the object is a proxy whose type cannot be determined */
+
+ MonoClass *klass = tree->inst_newa_class;
+ MonoInst *end_label, *true_label, *false_label, *false2_label;
+ MonoInst *no_proxy_label, *interface_fail_label;
+ int obj_reg = state->left->reg1;
+ int tmp_reg = mono_regstate_next_int (s->rs);
+ int klass_reg = mono_regstate_next_int (s->rs);
+
+ MONO_NEW_LABEL (s, end_label);
+ MONO_NEW_LABEL (s, true_label);
+ MONO_NEW_LABEL (s, false_label);
+ MONO_NEW_LABEL (s, false2_label);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, obj_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, false_label);
+
+ if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ MONO_NEW_LABEL (s, interface_fail_label);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ mini_emit_isninst_iface_cast (s, tmp_reg, klass, interface_fail_label, true_label);
+
+ mono_bblock_add_inst (s->cbb, interface_fail_label);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+
+ if (mono_compile_aot) {
+ int tproxy_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, tproxy_reg, mono_defaults.transparent_proxy_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, klass_reg, tproxy_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, klass_reg, mono_defaults.transparent_proxy_class);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, false_label);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, tmp_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, false2_label);
+
+ } else {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+
+ MONO_NEW_LABEL (s, no_proxy_label);
+
+ if (mono_compile_aot) {
+ int tproxy_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, tproxy_reg, mono_defaults.transparent_proxy_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, klass_reg, tproxy_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, klass_reg, mono_defaults.transparent_proxy_class);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, no_proxy_label);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, remote_class));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoRemoteClass, proxy_class));
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, tmp_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, no_proxy_label);
+
+ mini_emit_isninst_cast (s, klass_reg, klass, false2_label, true_label);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, false2_label);
+
+ mono_bblock_add_inst (s->cbb, no_proxy_label);
+ mini_emit_isninst_cast (s, klass_reg, klass, false_label, true_label);
+ }
+
+ mono_bblock_add_inst (s->cbb, false_label);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+ mono_bblock_add_inst (s->cbb, false2_label);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 2);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+ mono_bblock_add_inst (s->cbb, true_label);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ mono_bblock_add_inst (s->cbb, end_label);
+}
+
+reg: OP_UNBOXCAST (reg) {
+ MonoClass *klass = tree->inst_newa_class;
+ int obj_reg = state->left->reg1;
+ int vtable_reg = mono_regstate_next_int (s->rs);
+ int klass_reg = mono_regstate_next_int (s->rs);
+ int eclass_reg = mono_regstate_next_int (s->rs);
+ int rank_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, vtable_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, rank_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, rank));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, eclass_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, element_class));
+
+ /* FIXME: generics */
+ g_assert (klass->rank == 0);
+
+ // Check rank == 0
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, rank_reg, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+
+ if (mono_compile_aot) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, klass->element_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ }
+ else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, klass->element_class);
+ }
+
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, obj_reg);
+}
+
+reg: CEE_CASTCLASS (reg) {
+ MonoClass *klass = tree->inst_newa_class;
+ MonoInst *object_is_null;
+ int obj_reg = state->left->reg1;
+ int vtable_reg = mono_regstate_next_int (s->rs);
+
+ MONO_NEW_LABEL (s, object_is_null);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, obj_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+
+ if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, vtable_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ mini_emit_castclass_iface (s, vtable_reg, klass);
+ } else {
+ int klass_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, vtable_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+
+ if (klass->rank) {
+ int rank_reg = mono_regstate_next_int (s->rs);
+ int eclass_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, rank_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, rank));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, rank_reg, klass->rank);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, eclass_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, cast_class));
+ if (klass->cast_class == mono_defaults.object_class) {
+ int parent_reg = mono_regstate_next_int (s->rs);
+ int const_reg;
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, parent_reg, eclass_reg, G_STRUCT_OFFSET (MonoClass, parent));
+ if (mono_compile_aot) {
+ const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class->parent);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, parent_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, parent_reg, mono_defaults.enum_class->parent);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, object_is_null);
+ if (mono_compile_aot) {
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class);
+ }
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+ } else if (klass->cast_class == mono_defaults.enum_class->parent) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ if (mono_compile_aot) {
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class->parent);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class->parent);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, object_is_null);
+ if (mono_compile_aot) {
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class);
+ }
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+ } else if (klass->cast_class == mono_defaults.enum_class) {
+ if (mono_compile_aot) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, mono_defaults.enum_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, eclass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, eclass_reg, mono_defaults.enum_class);
+ }
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+ } else if (klass->cast_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ mini_emit_castclass_iface_class (s, eclass_reg, klass->cast_class);
+ } else {
+ mini_emit_castclass (s, eclass_reg, klass->cast_class);
+ }
+
+ if ((klass->rank == 1) && (klass->byval_arg.type == MONO_TYPE_SZARRAY)) {
+ /* Check that the object is a vector too */
+ int bounds_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, bounds_reg, obj_reg, G_STRUCT_OFFSET (MonoArray, bounds));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, bounds_reg, 0);
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+ }
+ } else {
+ mini_emit_castclass (s, klass_reg, klass);
+ }
+ }
+
+ mono_bblock_add_inst (s->cbb, object_is_null);
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, obj_reg);
+}
+
+reg: OP_CCASTCLASS (reg) {
+ /* This opcode takes as input an object reference and a class, and returns:
+ 0) if the object is an instance of the class,
+ 1) if the object is a proxy whose type cannot be determined
+ an InvalidCastException exception is thrown otherwhise*/
+
+ MonoClass *klass = tree->inst_newa_class;
+ MonoInst *end_label, *fail_label, *no_proxy_label, *ok_result_label;
+ int obj_reg = state->left->reg1;
+ int tmp_reg = mono_regstate_next_int (s->rs);
+ int klass_reg = mono_regstate_next_int (s->rs);
+
+ MONO_NEW_LABEL (s, end_label);
+ MONO_NEW_LABEL (s, ok_result_label);
+
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, obj_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, ok_result_label);
+
+ if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+
+ MONO_NEW_LABEL (s, fail_label);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ mini_emit_isninst_iface_cast (s, tmp_reg, klass, fail_label, ok_result_label);
+
+ mono_bblock_add_inst (s->cbb, fail_label);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+
+ if (mono_compile_aot) {
+ int tproxy_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, tproxy_reg, mono_defaults.transparent_proxy_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, klass_reg, tproxy_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, klass_reg, mono_defaults.transparent_proxy_class);
+ }
+
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, remote_class));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoRemoteClass, proxy_class));
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, tmp_reg, 0);
+ MONO_EMIT_NEW_COND_EXC (s, EQ, "InvalidCastException");
+
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+
+ } else {
+
+ MONO_NEW_LABEL (s, no_proxy_label);
+ MONO_NEW_LABEL (s, fail_label);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+
+ if (mono_compile_aot) {
+ int tproxy_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, tproxy_reg, mono_defaults.transparent_proxy_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, klass_reg, tproxy_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, klass_reg, mono_defaults.transparent_proxy_class);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, no_proxy_label);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, remote_class));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, tmp_reg, G_STRUCT_OFFSET (MonoRemoteClass, proxy_class));
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, tmp_reg, obj_reg, G_STRUCT_OFFSET (MonoTransparentProxy, custom_type_info));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, tmp_reg, 0);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, no_proxy_label);
+
+ mini_emit_isninst_cast (s, klass_reg, klass, fail_label, ok_result_label);
+ mono_bblock_add_inst (s->cbb, fail_label);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 1);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BR, end_label);
+
+ mono_bblock_add_inst (s->cbb, no_proxy_label);
+ mini_emit_castclass (s, klass_reg, klass);
+ }
+
+ mono_bblock_add_inst (s->cbb, ok_result_label);
+ MONO_EMIT_NEW_ICONST (s, state->reg1, 0);
+ mono_bblock_add_inst (s->cbb, end_label);
+}
+
+stmt: CEE_STELEM_REF (OP_GROUP (reg, reg), reg),
+reg: OP_GROUP (reg, reg),
+reg: CEE_NEWARR (reg),
+lreg: OP_LMUL (lreg, lreg),
+lreg: OP_LMUL_OVF (lreg, lreg),
+lreg: OP_LMUL_OVF_UN (lreg, lreg),
+lreg: OP_LDIV (lreg, lreg),
+lreg: OP_LDIV_UN (lreg, lreg),
+lreg: OP_LREM (lreg, lreg),
+lreg: OP_LREM_UN (lreg, lreg),
+lreg: OP_LSHL (lreg, reg),
+lreg: OP_LSHR (lreg, reg),
+lreg: OP_LSHR_UN (lreg, reg) {
+ g_assert_not_reached ();
+}
+
+#
+# string support
+#
+reg: OP_GETCHR (reg, reg) {
+ int mult_reg = mono_regstate_next_int (s->rs);
+ int add_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_BOUNDS_CHECK (s, state->left->reg1, MonoString, length, state->right->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SHL_IMM, mult_reg, state->right->reg1, 1);
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, add_reg, mult_reg, state->left->reg1);
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADU2_MEMBASE, state->reg1,
+ add_reg, G_STRUCT_OFFSET (MonoString, chars));
+}
+
+reg: OP_GETCHR (reg, OP_ICONST) {
+ int ind = 2 * state->right->tree->inst_c0 + G_STRUCT_OFFSET (MonoString, chars);
+
+ MONO_EMIT_BOUNDS_CHECK_IMM (s, state->left->reg1, MonoString, length, state->right->tree->inst_c0);
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADU2_MEMBASE, state->reg1, state->left->reg1, ind);
+}
+
+reg: OP_STRLEN (reg) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE, state->reg1,
+ state->left->reg1, G_STRUCT_OFFSET (MonoString, length));
+}
+
+reg: OP_GETTYPE (reg) {
+ int vt_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, vt_reg, state->left->reg1, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOAD_MEMBASE, state->reg1, vt_reg, G_STRUCT_OFFSET (MonoVTable, type));
+}
+
+#
+# array support
+#
+reg: CEE_LDLEN (reg) {
+ MONO_EMIT_LOAD_MEMBASE_OP (s, tree, OP_LOADI4_MEMBASE, state->reg1,
+ state->left->reg1, G_STRUCT_OFFSET (MonoArray, max_length));
+}
+
+reg: OP_ARRAY_RANK (reg) {
+ int vtable_reg = mono_regstate_next_int (s->rs);
+ int class_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOAD_MEMBASE, vtable_reg,
+ state->left->reg1, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOAD_MEMBASE, class_reg,
+ vtable_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, state->reg1,
+ class_reg, G_STRUCT_OFFSET (MonoClass, rank));
+}
+
+reg: OP_CHECK_ARRAY_TYPE (reg) {
+ int vtable_reg = mono_regstate_next_int (s->rs);
+ int class_reg = mono_regstate_next_int (s->rs);
+ int elclass_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOAD_MEMBASE, vtable_reg,
+ state->left->reg1, G_STRUCT_OFFSET (MonoObject, vtable));
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOAD_MEMBASE, class_reg,
+ vtable_reg, G_STRUCT_OFFSET (MonoVTable, klass));
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOAD_MEMBASE, elclass_reg,
+ class_reg, G_STRUCT_OFFSET (MonoClass, element_class));
+ if (mono_compile_aot) {
+ int klass_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, klass_reg, tree->klass);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, elclass_reg, klass_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, elclass_reg, tree->klass);
+ }
+
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "ArrayTypeMismatchException");
+ MONO_EMIT_UNALU (s, tree, OP_MOVE, state->reg1, state->left->reg1);
+}
+
+reg: CEE_LDELEMA (reg, OP_ICONST) "15" {
+ guint32 size = mono_class_array_element_size (tree->klass);
+
+ int ind = size * state->right->tree->inst_c0 + G_STRUCT_OFFSET (MonoArray, vector);
+
+ MONO_EMIT_BOUNDS_CHECK_IMM (s, state->left->reg1, MonoArray, max_length, state->right->tree->inst_c0);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, state->left->reg1, ind);
+}
+
+reg: CEE_LDELEMA (reg, reg) "20" {
+ int mult_reg = mono_regstate_next_int (s->rs);
+ int add_reg = mono_regstate_next_int (s->rs);
+ guint32 size = mono_class_array_element_size (tree->klass);
+
+ MONO_EMIT_BOUNDS_CHECK (s, state->left->reg1, MonoArray, max_length, state->right->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_MUL_IMM, mult_reg, state->right->reg1, size);
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, add_reg, mult_reg, state->left->reg1);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, state->reg1, add_reg, G_STRUCT_OFFSET (MonoArray, vector));
+}
+
+reg: CEE_REFANYVAL (reg) {
+ int klass_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, klass_reg, state->left->reg1, G_STRUCT_OFFSET (MonoTypedRef, klass));
+ if (mono_compile_aot) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, tree->inst_newa_class);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, klass_reg, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, klass_reg, tree->inst_newa_class);
+ }
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->reg1, G_STRUCT_OFFSET (MonoTypedRef, value));
+}
+
+reg: OP_REFANYTYPE (reg) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, state->reg1, state->left->reg1, G_STRUCT_OFFSET (MonoTypedRef, type));
+}
+
+stmt: CEE_MKREFANY (OP_GROUP (reg, OP_ICONST), reg),
+stmt: CEE_MKREFANY (OP_GROUP (reg, OP_I8CONST), reg) {
+ MonoClass *klass = (MonoClass*)(tree->inst_left->inst_right->inst_p0);
+ if (mono_compile_aot) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ int type_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, klass);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREP_MEMBASE_REG, state->right->reg1, G_STRUCT_OFFSET (MonoTypedRef, klass), const_reg);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_ADD_IMM, type_reg, const_reg, G_STRUCT_OFFSET (MonoClass, byval_arg));
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREP_MEMBASE_REG, state->right->reg1, G_STRUCT_OFFSET (MonoTypedRef, type), type_reg);
+ }
+ else {
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STOREP_MEMBASE_IMM, state->right->reg1, G_STRUCT_OFFSET (MonoTypedRef, type), &klass->byval_arg);
+ MONO_EMIT_NEW_STORE_MEMBASE_IMM (s, OP_STOREP_MEMBASE_IMM, state->right->reg1, G_STRUCT_OFFSET (MonoTypedRef, klass), klass);
+ }
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREP_MEMBASE_REG, state->right->reg1, G_STRUCT_OFFSET (MonoTypedRef, value), state->left->left->reg1);
+}
+
+%%
+
+/*
+ * Emit code which checks whenever the interface id of @klass is smaller than
+ * than the value given by max_iid_reg.
+*/
+static void
+mini_emit_max_iid_check (MonoCompile *s, int max_iid_reg, MonoClass *klass,
+ MonoInst *false_target)
+{
+ if (mono_compile_aot) {
+ int iid_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_AOTCONST (s, iid_reg, klass, MONO_PATCH_INFO_IID);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, max_iid_reg, iid_reg);
+ }
+ else
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, max_iid_reg, klass->interface_id);
+ if (false_target)
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT_UN, false_target);
+ else
+ MONO_EMIT_NEW_COND_EXC (s, LT_UN, "InvalidCastException");
+}
+
+/* Same as above, but obtains max_iid from a vtable */
+static void
+mini_emit_max_iid_check_vtable (MonoCompile *s, int vtable_reg, MonoClass *klass,
+ MonoInst *false_target)
+{
+ int max_iid_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, max_iid_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, max_interface_id));
+ mini_emit_max_iid_check (s, max_iid_reg, klass, false_target);
+}
+
+/* Same as above, but obtains max_iid from a klass */
+static void
+mini_emit_max_iid_check_class (MonoCompile *s, int klass_reg, MonoClass *klass,
+ MonoInst *false_target)
+{
+ int max_iid_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, max_iid_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, max_interface_id));
+ mini_emit_max_iid_check (s, max_iid_reg, klass, false_target);
+}
+
+static void
+mini_emit_load_intf_reg (MonoCompile *s, int intf_reg, int ioffset_reg, MonoClass *klass)
+{
+ if (mono_compile_aot) {
+ int iid_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_AOTCONST (s, iid_reg, klass, MONO_PATCH_INFO_IID);
+ /* FIXME: Do a shift instead */
+#if SIZEOF_VOID_P == 8
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SHL_IMM, iid_reg, iid_reg, 3);
+#else
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_SHL_IMM, iid_reg, iid_reg, 2);
+#endif
+ MONO_EMIT_NEW_BIALU (s, CEE_ADD, ioffset_reg, ioffset_reg, iid_reg);
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, 0);
+ }
+ else
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, intf_reg, ioffset_reg, klass->interface_id * SIZEOF_VOID_P);
+}
+
+/* Emit code which loads <vtable_reg>->interface_offsets [klass->interface_id] */
+static void
+mini_emit_load_intf_reg_vtable (MonoCompile *s, int intf_reg, int vtable_reg, MonoClass *klass)
+{
+ int ioffset_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, ioffset_reg, vtable_reg, G_STRUCT_OFFSET (MonoVTable, interface_offsets));
+ mini_emit_load_intf_reg (s, intf_reg, ioffset_reg, klass);
+}
+
+/* Emit code which loads <klass_reg>->interface_offsets [klass->interface_id] */
+static void
+mini_emit_load_intf_reg_class (MonoCompile *s, int intf_reg, int klass_reg, MonoClass *klass)
+{
+ int ioffset_reg = mono_regstate_next_int (s->rs);
+
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, ioffset_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, interface_offsets));
+ mini_emit_load_intf_reg (s, intf_reg, ioffset_reg, klass);
+}
+
+void
+mini_emit_virtual_call (MonoCompile *cfg, void *st, MonoInst *tree, int novirtop, int virtop)
+{
+ MonoMethod *method = ((MonoCallInst*)tree)->method;
+ int vtable_reg, slot_reg, this_reg;
+ MBState *state = st;
+
+ this_reg = state->left->reg1;
+ mono_arch_emit_this_vret_args (cfg, (MonoCallInst*)tree, this_reg, state->left->tree->type, novirtop == OP_VCALL? state->right->reg1: -1);
+
+ if (!(method->flags & METHOD_ATTRIBUTE_VIRTUAL) ||
+ ((method->flags & METHOD_ATTRIBUTE_FINAL) &&
+ method->wrapper_type != MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK)) {
+ /*
+ * the method is not virtual, we just need to ensure this is not null
+ * and then we can call the method directly.
+ */
+ if (method->klass->marshalbyref || method->klass == mono_defaults.object_class) {
+ method = ((MonoCallInst*)tree)->method = mono_marshal_get_remoting_invoke_with_check (method);
+ }
+
+ if (!method->string_ctor)
+ MONO_EMIT_NEW_UNALU (cfg, OP_CHECK_THIS, -1, this_reg);
+
+ tree->dreg = state->reg1;
+ tree->opcode = novirtop;
+ mono_bblock_add_inst (cfg->cbb, tree);
+ return;
+ }
+
+ vtable_reg = mono_regstate_next_int (cfg->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE (cfg, vtable_reg, this_reg, G_STRUCT_OFFSET (MonoObject, vtable));
+ if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ slot_reg = mono_regstate_next_int (cfg->rs);
+ mini_emit_load_intf_reg_vtable (cfg, slot_reg, vtable_reg, method->klass);
+ tree->inst_offset = method->slot * SIZEOF_VOID_P;
+ } else {
+ slot_reg = vtable_reg;
+ tree->inst_offset = G_STRUCT_OFFSET (MonoVTable, vtable) + (method->slot * SIZEOF_VOID_P);
+ }
+
+ tree->dreg = state->reg1;
+ tree->opcode = virtop;
+ tree->sreg1 = slot_reg;
+ ((MonoCallInst*)tree)->virtual = TRUE;
+ mono_bblock_add_inst (cfg->cbb, tree);
+}
+
+void
+mini_emit_isninst_cast (MonoCompile *s, int klass_reg, MonoClass *klass, MonoInst *false_target, MonoInst *true_target)
+{
+ int idepth_reg = mono_regstate_next_int (s->rs);
+ int stypes_reg = mono_regstate_next_int (s->rs);
+ int stype = mono_regstate_next_int (s->rs);
+
+ if (klass->idepth > MONO_DEFAULT_SUPERTABLE_SIZE) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, idepth_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, idepth));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, idepth_reg, klass->idepth);
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BLT_UN, false_target);
+ }
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, stypes_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, supertypes));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, stype, stypes_reg, ((klass->idepth - 1) * SIZEOF_VOID_P));
+ if (mono_compile_aot) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, klass);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, stype, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, stype, klass);
+ }
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BEQ, true_target);
+}
+
+void
+mini_emit_isninst_iface_cast (MonoCompile *s, int vtable_reg, MonoClass *klass, MonoInst *false_target, MonoInst *true_target)
+{
+ int intf_reg = mono_regstate_next_int (s->rs);
+
+ mini_emit_max_iid_check_vtable (s, vtable_reg, klass, false_target);
+ mini_emit_load_intf_reg_vtable (s, intf_reg, vtable_reg, klass);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, 0);
+ /* the object_is_null target simply copies the input register to the output */
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BNE_UN, true_target);
+}
+
+/*
+ * Variant of the above that takes a register to the class, not the vtable.
+ * Note that inside interfaces_offsets the empty value is -1, not NULL, in this case.
+ */
+void
+mini_emit_isninst_iface_class_cast (MonoCompile *s, int klass_reg, MonoClass *klass, MonoInst *false_target, MonoInst *true_target)
+{
+ int intf_reg = mono_regstate_next_int (s->rs);
+
+ mini_emit_max_iid_check_class (s, klass_reg, klass, false_target);
+ mini_emit_load_intf_reg_class (s, intf_reg, klass_reg, klass);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, -1);
+ /* the object_is_null target simply copies the input register to the output */
+ MONO_EMIT_NEW_BRANCH_LABEL (s, CEE_BGE, true_target);
+}
+
+void
+mini_emit_castclass (MonoCompile *s, int klass_reg, MonoClass *klass)
+{
+ int idepth_reg = mono_regstate_next_int (s->rs);
+ int stypes_reg = mono_regstate_next_int (s->rs);
+ int stype = mono_regstate_next_int (s->rs);
+
+ if (klass->idepth > MONO_DEFAULT_SUPERTABLE_SIZE) {
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, idepth_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, idepth));
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, idepth_reg, klass->idepth);
+ MONO_EMIT_NEW_COND_EXC (s, LT_UN, "InvalidCastException");
+ }
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, stypes_reg, klass_reg, G_STRUCT_OFFSET (MonoClass, supertypes));
+ MONO_EMIT_NEW_LOAD_MEMBASE (s, stype, stypes_reg, ((klass->idepth - 1) * SIZEOF_VOID_P));
+ if (mono_compile_aot) {
+ int const_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_CLASSCONST (s, const_reg, klass);
+ MONO_EMIT_NEW_BIALU (s, OP_COMPARE, -1, stype, const_reg);
+ } else {
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, stype, klass);
+ }
+ MONO_EMIT_NEW_COND_EXC (s, NE_UN, "InvalidCastException");
+}
+
+void
+mini_emit_castclass_iface (MonoCompile *s, int vtable_reg, MonoClass *klass)
+{
+ int intf_reg = mono_regstate_next_int (s->rs);
+
+ mini_emit_max_iid_check_vtable (s, vtable_reg, klass, NULL);
+ mini_emit_load_intf_reg_vtable (s, intf_reg, vtable_reg, klass);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, 0);
+ MONO_EMIT_NEW_COND_EXC (s, EQ, "InvalidCastException");
+}
+
+/*
+ * Variant of the aboce that takes a register to the class, not the vtable.
+ * Note that inside interfaces_offsets the empty value is -1, not NULL, in this case.
+ */
+void
+mini_emit_castclass_iface_class (MonoCompile *s, int klass_reg, MonoClass *klass)
+{
+ int intf_reg = mono_regstate_next_int (s->rs);
+
+ mini_emit_max_iid_check_class (s, klass_reg, klass, NULL);
+ mini_emit_load_intf_reg_class (s, intf_reg, klass_reg, klass);
+ MONO_EMIT_NEW_BIALU_IMM (s, OP_COMPARE_IMM, -1, intf_reg, -1);
+ MONO_EMIT_NEW_COND_EXC (s, EQ, "InvalidCastException");
+}
+
+void
+mini_emit_memcpy (MonoCompile *s, int destreg, int doffset, int srcreg, int soffset, int size, int align)
+{
+ int cur_reg;
+
+ /* FIXME: consider alignment for archs that need it. */
+#if !NO_UNALIGNED_ACCESS
+ if (sizeof (gpointer) == 8) {
+ while (size >= 8) {
+ cur_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI8_MEMBASE, cur_reg, srcreg, soffset);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI8_MEMBASE_REG, destreg, doffset, cur_reg);
+ doffset += 8;
+ soffset += 8;
+ size -= 8;
+ }
+ }
+#endif
+
+ while (size >= 4) {
+ cur_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI4_MEMBASE, cur_reg, srcreg, soffset);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, destreg, doffset, cur_reg);
+ doffset += 4;
+ soffset += 4;
+ size -= 4;
+ }
+ while (size >= 2) {
+ cur_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI2_MEMBASE, cur_reg, srcreg, soffset);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI2_MEMBASE_REG, destreg, doffset, cur_reg);
+ doffset += 2;
+ soffset += 2;
+ size -= 2;
+ }
+ while (size >= 1) {
+ cur_reg = mono_regstate_next_int (s->rs);
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP (s, OP_LOADI1_MEMBASE, cur_reg, srcreg, soffset);
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI1_MEMBASE_REG, destreg, doffset, cur_reg);
+ doffset += 1;
+ soffset += 1;
+ size -= 1;
+ }
+}
+
+void
+mini_emit_memset (MonoCompile *s, int destreg, int offset, int size, int val, int alignl)
+{
+ int val_reg = mono_regstate_next_int (s->rs);
+
+ if (sizeof (gpointer) == 8)
+ MONO_EMIT_NEW_I8CONST (s, val_reg, val);
+ else
+ MONO_EMIT_NEW_ICONST (s, val_reg, val);
+
+ if (sizeof (gpointer) == 8) {
+ while (size >= 8) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI8_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 8;
+ size -= 8;
+ }
+ }
+
+ while (size >= 4) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI4_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 4;
+ size -= 4;
+ }
+ while (size >= 2) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI2_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 2;
+ size -= 2;
+ }
+ while (size >= 1) {
+ MONO_EMIT_NEW_STORE_MEMBASE (s, OP_STOREI1_MEMBASE_REG, destreg, offset, val_reg);
+ offset += 1;
+ size -= 1;
+ }
+}
+
+int
+ldind_to_load_membase (int opcode)
+{
+ switch (opcode) {
+ case CEE_LDIND_I1:
+ return OP_LOADI1_MEMBASE;
+ case CEE_LDIND_U1:
+ return OP_LOADU1_MEMBASE;
+ case CEE_LDIND_I2:
+ return OP_LOADI2_MEMBASE;
+ case CEE_LDIND_U2:
+ return OP_LOADU2_MEMBASE;
+ case CEE_LDIND_I4:
+ return OP_LOADI4_MEMBASE;
+ case CEE_LDIND_U4:
+ return OP_LOADU4_MEMBASE;
+ case CEE_LDIND_I:
+ return OP_LOAD_MEMBASE;
+ case CEE_LDIND_REF:
+ return OP_LOAD_MEMBASE;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return -1;
+}
+
diff --git a/mono/mini/jit-icalls.c b/mono/mini/jit-icalls.c
new file mode 100644
index 00000000000..870bf20b4e3
--- /dev/null
+++ b/mono/mini/jit-icalls.c
@@ -0,0 +1,556 @@
+/*
+ * jit-icalls.c: internal calls used by the JIT
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#include <math.h>
+
+static void*
+mono_ldftn (MonoMethod *method)
+{
+ gpointer addr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ addr = mono_create_jump_trampoline (mono_domain_get (), method, TRUE);
+
+ return addr;
+}
+
+/*
+ * Same as mono_ldftn, but do not add a synchronized wrapper. Used in the
+ * synchronized wrappers to avoid infinite recursion.
+ */
+static void*
+mono_ldftn_nosync (MonoMethod *method)
+{
+ gpointer addr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ addr = mono_create_jump_trampoline (mono_domain_get (), method, FALSE);
+
+ return addr;
+}
+
+static void*
+mono_ldvirtfn (MonoObject *obj, MonoMethod *method)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ method = mono_object_get_virtual_method (obj, method);
+
+ return mono_ldftn (method);
+}
+
+static void
+helper_initobj (void *addr, int size)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ memset (addr, 0, size);
+}
+
+static void
+helper_memcpy (void *addr, void *src, int size)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ memcpy (addr, src, size);
+}
+
+static void
+helper_memset (void *addr, int val, int size)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ memset (addr, val, size);
+}
+
+static void
+helper_stelem_ref (MonoArray *array, int index, MonoObject *val)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (index >= array->max_length)
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
+
+ if (val && !mono_object_isinst (val, array->obj.vtable->klass->element_class))
+ mono_raise_exception (mono_get_exception_array_type_mismatch ());
+
+ mono_array_set (array, gpointer, index, val);
+}
+
+static void
+helper_stelem_ref_check (MonoArray *array, MonoObject *val)
+{
+ MONO_ARCH_SAVE_REGS;
+
+ if (val && !mono_object_isinst (val, array->obj.vtable->klass->element_class))
+ mono_raise_exception (mono_get_exception_array_type_mismatch ());
+}
+
+static gint64
+mono_llmult (gint64 a, gint64 b)
+{
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
+ return a * b;
+}
+
+static guint64
+mono_llmult_ovf_un (guint64 a, guint64 b)
+{
+ guint32 al = a;
+ guint32 ah = a >> 32;
+ guint32 bl = b;
+ guint32 bh = b >> 32;
+ guint64 res, t1;
+
+ MONO_ARCH_SAVE_REGS;
+
+ // fixme: this is incredible slow
+
+ if (ah && bh)
+ goto raise_exception;
+
+ res = (guint64)al * (guint64)bl;
+
+ t1 = (guint64)ah * (guint64)bl + (guint64)al * (guint64)bh;
+
+ if (t1 > 0xffffffff)
+ goto raise_exception;
+
+ res += ((guint64)t1) << 32;
+
+ return res;
+
+ raise_exception:
+ mono_raise_exception (mono_get_exception_overflow ());
+ return 0;
+}
+
+
+static guint64
+mono_llmult_ovf (gint64 a, gint64 b)
+{
+ guint32 al = a;
+ gint32 ah = a >> 32;
+ guint32 bl = b;
+ gint32 bh = b >> 32;
+ /*
+ Use Karatsuba algorithm where:
+ a*b is: AhBh(R^2+R)+(Ah-Al)(Bl-Bh)R+AlBl(R+1)
+ where Ah is the "high half" (most significant 32 bits) of a and
+ where Al is the "low half" (least significant 32 bits) of a and
+ where Bh is the "high half" of b and Bl is the "low half" and
+ where R is the Radix or "size of the half" (in our case 32 bits)
+
+ Note, for the product of two 64 bit numbers to fit into a 64
+ result, ah and/or bh must be 0. This will save us from doing
+ the AhBh term at all.
+
+ Also note that we refactor so that we don't overflow 64 bits with
+ intermediate results. So we use [(Ah-Al)(Bl-Bh)+AlBl]R+AlBl
+ */
+
+ gint64 res, t1;
+ gint32 sign;
+
+ MONO_ARCH_SAVE_REGS;
+
+ /* need to work with absoulte values, so find out what the
+ resulting sign will be and convert any negative numbers
+ from two's complement
+ */
+ sign = ah ^ bh;
+ if (ah < 0) {
+ if (((guint32)ah == 0x80000000) && (al == 0)) {
+ /* This has no two's complement */
+ if (b == 0)
+ return 0;
+ else if (b == 1)
+ return a;
+ else
+ goto raise_exception;
+ }
+
+ /* flip the bits and add 1 */
+ ah ^= ~0;
+ if (al == 0)
+ ah += 1;
+ else {
+ al ^= ~0;
+ al +=1;
+ }
+ }
+
+ if (bh < 0) {
+ if (((guint32)bh == 0x80000000) && (bl == 0)) {
+ /* This has no two's complement */
+ if (a == 0)
+ return 0;
+ else if (a == 1)
+ return b;
+ else
+ goto raise_exception;
+ }
+
+ /* flip the bits and add 1 */
+ bh ^= ~0;
+ if (bl == 0)
+ bh += 1;
+ else {
+ bl ^= ~0;
+ bl +=1;
+ }
+ }
+
+ /* we overflow for sure if both upper halves are greater
+ than zero because we would need to shift their
+ product 64 bits to the left and that will not fit
+ in a 64 bit result */
+ if (ah && bh)
+ goto raise_exception;
+
+ /* do the AlBl term first */
+ t1 = (gint64)al * (gint64)bl;
+
+ res = t1;
+
+ /* now do the [(Ah-Al)(Bl-Bh)+AlBl]R term */
+ t1 += (gint64)(ah - al) * (gint64)(bl - bh);
+ t1 <<= 32;
+ /* check for overflow */
+ if (t1 > (0x7FFFFFFFFFFFFFFFLL - res))
+ goto raise_exception;
+
+ res += t1;
+
+ if (res < 0)
+ goto raise_exception;
+
+ if (sign < 0)
+ return -res;
+ else
+ return res;
+
+ raise_exception:
+ mono_raise_exception (mono_get_exception_overflow ());
+ return 0;
+}
+
+static gint64
+mono_lldiv (gint64 a, gint64 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+ else if (b == -1 && a == (-9223372036854775807LL - 1LL))
+ mono_raise_exception (mono_get_exception_arithmetic ());
+#endif
+ return a / b;
+}
+
+static gint64
+mono_llrem (gint64 a, gint64 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+ else if (b == -1 && a == (-9223372036854775807LL - 1LL))
+ mono_raise_exception (mono_get_exception_arithmetic ());
+#endif
+ return a % b;
+}
+
+static guint64
+mono_lldiv_un (guint64 a, guint64 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+#endif
+ return a / b;
+}
+
+static guint64
+mono_llrem_un (guint64 a, guint64 b)
+{
+ MONO_ARCH_SAVE_REGS;
+
+#ifdef MONO_ARCH_NEED_DIV_CHECK
+ if (!b)
+ mono_raise_exception (mono_get_exception_divide_by_zero ());
+#endif
+ return a % b;
+}
+
+#ifndef MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
+
+static guint64
+mono_lshl (guint64 a, gint32 shamt)
+{
+ guint64 res;
+
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
+ res = a << shamt;
+
+ /*printf ("TESTL %lld << %d = %lld\n", a, shamt, res);*/
+
+ return res;
+}
+
+static guint64
+mono_lshr_un (guint64 a, gint32 shamt)
+{
+ guint64 res;
+
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
+ res = a >> shamt;
+
+ /*printf ("TESTR %lld >> %d = %lld\n", a, shamt, res);*/
+
+ return res;
+}
+
+static gint64
+mono_lshr (gint64 a, gint32 shamt)
+{
+ gint64 res;
+
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
+ res = a >> shamt;
+
+ /*printf ("TESTR %lld >> %d = %lld\n", a, shamt, res);*/
+
+ return res;
+}
+
+#endif
+
+/**
+ * ves_array_element_address:
+ * @this: a pointer to the array object
+ *
+ * Returns: the address of an array element.
+ */
+static gpointer
+ves_array_element_address (MonoArray *this, ...)
+{
+ MonoClass *class;
+ va_list ap;
+ int i, ind, esize, realidx;
+ gpointer ea;
+
+ MONO_ARCH_SAVE_REGS;
+
+ g_assert (this != NULL);
+
+ va_start(ap, this);
+
+ class = this->obj.vtable->klass;
+
+ g_assert (this->bounds != NULL);
+
+ esize = mono_array_element_size (class);
+ ind = va_arg(ap, int);
+ ind -= (int)this->bounds [0].lower_bound;
+ if ((guint32)ind >= (guint32)this->bounds [0].length)
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
+ for (i = 1; i < class->rank; i++) {
+ realidx = va_arg(ap, int) - (int)this->bounds [i].lower_bound;
+ if ((guint32)realidx >= (guint32)this->bounds [i].length)
+ mono_raise_exception (mono_get_exception_index_out_of_range ());
+ ind *= this->bounds [i].length;
+ ind += realidx;
+ }
+ esize *= ind;
+
+ ea = (gpointer*)((char*)this->vector + esize);
+
+ va_end(ap);
+
+ return ea;
+}
+
+static MonoArray *
+mono_array_new_va (MonoMethod *cm, ...)
+{
+ MonoDomain *domain = mono_domain_get ();
+ va_list ap;
+ guint32 *lengths;
+ guint32 *lower_bounds;
+ int pcount;
+ int rank;
+ int i, d;
+
+ MONO_ARCH_SAVE_REGS;
+
+ pcount = cm->signature->param_count;
+ rank = cm->klass->rank;
+
+ va_start (ap, cm);
+
+ lengths = alloca (sizeof (guint32) * pcount);
+ for (i = 0; i < pcount; ++i)
+ lengths [i] = d = va_arg(ap, int);
+
+ if (rank == pcount) {
+ /* Only lengths provided. */
+ lower_bounds = NULL;
+ } else {
+ g_assert (pcount == (rank * 2));
+ /* lower bounds are first. */
+ lower_bounds = lengths;
+ lengths += rank;
+ }
+ va_end(ap);
+
+ return mono_array_new_full (domain, cm->klass, lengths, lower_bounds);
+}
+
+static gpointer
+mono_class_static_field_address (MonoDomain *domain, MonoClassField *field)
+{
+ MonoVTable *vtable;
+ gpointer addr;
+
+ MONO_ARCH_SAVE_REGS;
+
+ //printf ("SFLDA0 %s.%s::%s %d\n", field->parent->name_space, field->parent->name, field->name, field->offset, field->parent->inited);
+
+ mono_class_init (field->parent);
+
+ vtable = mono_class_vtable (domain, field->parent);
+ if (!vtable->initialized)
+ mono_runtime_class_init (vtable);
+
+ //printf ("SFLDA1 %p\n", (char*)vtable->data + field->offset);
+
+ if (domain->special_static_fields && (addr = g_hash_table_lookup (domain->special_static_fields, field)))
+ addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
+ else
+ addr = (char*)vtable->data + field->offset;
+
+ return addr;
+}
+
+static gpointer
+mono_ldtoken_wrapper (MonoImage *image, int token)
+{
+ MonoClass *handle_class;
+ gpointer res;
+
+ MONO_ARCH_SAVE_REGS;
+ res = mono_ldtoken (image, token, &handle_class, NULL);
+ mono_class_init (handle_class);
+
+ return res;
+}
+
+static guint64
+mono_fconv_u8 (double v)
+{
+ return (guint64)v;
+}
+
+#ifdef MONO_ARCH_EMULATE_FCONV_TO_I8
+static gint64
+mono_fconv_i8 (double v)
+{
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
+ return (gint64)v;
+}
+#endif
+
+static guint32
+mono_fconv_u4 (double v)
+{
+ /* no need, no exceptions: MONO_ARCH_SAVE_REGS;*/
+ return (guint32)v;
+}
+
+#ifndef HAVE_TRUNC
+/* Solaris doesn't have trunc */
+#ifdef HAVE_AINTL
+extern long double aintl (long double);
+#define trunc aintl
+#else
+/* FIXME: This means we will never throw overflow exceptions */
+#define trunc(v) res
+#endif
+#endif /* HAVE_TRUNC */
+
+static gint64
+mono_fconv_ovf_i8 (double v)
+{
+ gint64 res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ res = (gint64)v;
+
+ if (isnan(v) || trunc (v) != res) {
+ mono_raise_exception (mono_get_exception_overflow ());
+ }
+ return res;
+}
+
+static guint64
+mono_fconv_ovf_u8 (double v)
+{
+ guint64 res;
+
+ MONO_ARCH_SAVE_REGS;
+
+ res = (guint64)v;
+
+ if (isnan(v) || trunc (v) != res) {
+ mono_raise_exception (mono_get_exception_overflow ());
+ }
+ return res;
+}
+
+#ifdef MONO_ARCH_EMULATE_LCONV_TO_R8
+static double
+mono_lconv_to_r8 (gint64 a)
+{
+ return (double)a;
+}
+#endif
+
+#ifdef MONO_ARCH_EMULATE_LCONV_TO_R4
+static float
+mono_lconv_to_r4 (gint64 a)
+{
+ return (float)a;
+}
+#endif
+
+#ifdef MONO_ARCH_EMULATE_CONV_R8_UN
+static double
+mono_conv_to_r8_un (guint32 a)
+{
+ return (double)a;
+}
+#endif
+
+#ifdef MONO_ARCH_EMULATE_LCONV_TO_R8_UN
+static double
+mono_lconv_to_r8_un (guint64 a)
+{
+ return (double)a;
+}
+#endif
+
diff --git a/mono/mini/jit.h b/mono/mini/jit.h
new file mode 100644
index 00000000000..e9cbf055bc3
--- /dev/null
+++ b/mono/mini/jit.h
@@ -0,0 +1,23 @@
+/*
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2001, 2002, 2003 Ximian, Inc.
+ */
+
+#ifndef _MONO_JIT_JIT_H_
+#define _MONO_JIT_JIT_H_
+
+#include <mono/metadata/appdomain.h>
+
+MonoDomain *
+mono_jit_init (const char *file);
+
+int
+mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly,
+ int argc, char *argv[]);
+void
+mono_jit_cleanup (MonoDomain *domain);
+
+#endif
+
diff --git a/mono/mini/ldscript b/mono/mini/ldscript
new file mode 100644
index 00000000000..c1d5cc45e8c
--- /dev/null
+++ b/mono/mini/ldscript
@@ -0,0 +1,10 @@
+VER_1 {
+ global:
+ mono_*;
+ GC_push_all_stack;
+ GC_start_blocking;
+ GC_end_blocking;
+ gc_thread_vtable;
+ local:
+ *;
+};
diff --git a/mono/mini/linear-scan.c b/mono/mini/linear-scan.c
new file mode 100644
index 00000000000..f38d02d2e7e
--- /dev/null
+++ b/mono/mini/linear-scan.c
@@ -0,0 +1,221 @@
+/*
+ * liveness.c: liveness analysis
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#include "mini.h"
+
+GList *
+mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, int sort_type)
+{
+ GList *l;
+
+ if (!list)
+ return g_list_prepend (NULL, mv);
+
+ for (l = list; l; l = l->next) {
+ MonoMethodVar *v1 = l->data;
+
+ if (sort_type == 2) {
+ if (mv->spill_costs >= v1->spill_costs) {
+ list = g_list_insert_before (list, l, mv);
+ break;
+ }
+ } else if (sort_type == 1) {
+ if (mv->range.last_use.abs_pos <= v1->range.last_use.abs_pos) {
+ list = g_list_insert_before (list, l, mv);
+ break;
+ }
+ } else {
+ if (mv->range.first_use.abs_pos <= v1->range.first_use.abs_pos) {
+ list = g_list_insert_before (list, l, mv);
+ break;
+ }
+ }
+ }
+ if (!l)
+ list = g_list_append (list, mv);
+
+ return list;
+}
+
+static gint
+compare_by_first_use_func (gconstpointer a, gconstpointer b)
+{
+ MonoMethodVar *v1 = (MonoMethodVar*)a;
+ MonoMethodVar *v2 = (MonoMethodVar*)b;
+
+ return v1->range.first_use.abs_pos - v2->range.first_use.abs_pos;
+}
+
+GList *
+mono_varlist_sort (MonoCompile *cfg, GList *list, int sort_type)
+{
+ if (sort_type == 0)
+ return g_list_sort (list, compare_by_first_use_func);
+ else
+ g_assert_not_reached ();
+
+ return NULL;
+}
+
+// #define DEBUG_LSCAN
+
+void
+mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask)
+{
+ GList *l, *a, *active = NULL;
+ MonoMethodVar *vmv, *amv;
+ int max_regs, gains [sizeof (regmask_t) * 8];
+ regmask_t used_regs = 0;
+ gboolean cost_driven;
+
+ cost_driven = (cfg->comp_done & MONO_COMP_LOOPS);
+
+#ifdef DEBUG_LSCAN
+ printf ("Linears scan for %s\n", mono_method_full_name (cfg->method, TRUE));
+#endif
+
+#ifdef DEBUG_LSCAN
+ for (l = vars; l; l = l->next) {
+ vmv = l->data;
+ printf ("VAR %d %08x %08x C%d\n", vmv->idx, vmv->range.first_use.abs_pos,
+ vmv->range.last_use.abs_pos, vmv->spill_costs);
+ }
+#endif
+ max_regs = g_list_length (regs);
+
+ for (l = regs; l; l = l->next) {
+ int regnum = (int)l->data;
+ g_assert (regnum < G_N_ELEMENTS (gains));
+ gains [regnum] = 0;
+ }
+
+ /* linear scan */
+ for (l = vars; l; l = l->next) {
+ vmv = l->data;
+
+#ifdef DEBUG_LSCAN
+ printf ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos,
+ vmv->range.last_use.abs_pos);
+#endif
+ /* expire old intervals in active */
+ while (active) {
+ amv = (MonoMethodVar *)active->data;
+
+ if (amv->range.last_use.abs_pos >= vmv->range.first_use.abs_pos)
+ break;
+
+#ifdef DEBUG_LSCAN
+ printf ("EXPIR %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos,
+ amv->range.last_use.abs_pos, amv->spill_costs, amv->reg);
+#endif
+ active = g_list_delete_link (active, active);
+ regs = g_list_prepend (regs, (gpointer)amv->reg);
+ gains [amv->reg] += amv->spill_costs;
+ }
+
+ if (active && g_list_length (active) == max_regs) {
+ /* Spill */
+
+ a = g_list_nth (active, max_regs - 1);
+ amv = (MonoMethodVar *)a->data;
+
+ if ((cost_driven && amv->spill_costs < vmv->spill_costs) ||
+ (!cost_driven && amv->range.last_use.abs_pos > vmv->range.last_use.abs_pos)) {
+ vmv->reg = amv->reg;
+ amv->reg = -1;
+ active = g_list_delete_link (active, a);
+
+ if (cost_driven)
+ active = mono_varlist_insert_sorted (cfg, active, vmv, 2);
+ else
+ active = mono_varlist_insert_sorted (cfg, active, vmv, 1);
+
+#ifdef DEBUG_LSCAN
+ printf ("SPILL0 %2d %08x %08x C%d\n", amv->idx,
+ amv->range.first_use.abs_pos, amv->range.last_use.abs_pos,
+ amv->spill_costs);
+#endif
+ } else {
+#ifdef DEBUG_LSCAN
+ printf ("SPILL1 %2d %08x %08x C%d\n", vmv->idx,
+ vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos,
+ vmv->spill_costs);
+#endif
+ vmv->reg = -1;
+ }
+ } else {
+ /* assign register */
+
+ g_assert (regs);
+
+ vmv->reg = (int)regs->data;
+
+ used_regs |= 1LL << vmv->reg;
+
+ regs = g_list_delete_link (regs, regs);
+
+#ifdef DEBUG_LSCAN
+ printf ("ADD %2d %08x %08x C%d R%d\n", vmv->idx,
+ vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos,
+ vmv->spill_costs, vmv->reg);
+#endif
+ active = mono_varlist_insert_sorted (cfg, active, vmv, TRUE);
+ }
+
+
+#ifdef DEBUG_LSCAN
+ for (a = active; a; a = a->next) {
+ amv = (MonoMethodVar *)a->data;
+ printf ("ACT %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos,
+ amv->range.last_use.abs_pos, amv->spill_costs, amv->reg);
+ }
+ printf ("NEXT\n");
+#endif
+ }
+
+ for (a = active; a; a = a->next) {
+ amv = (MonoMethodVar *)a->data;
+ gains [amv->reg] += amv->spill_costs;
+ }
+
+ for (l = vars; l; l = l->next) {
+ vmv = l->data;
+
+ if (vmv->reg >= 0) {
+ if (gains [vmv->reg] > mono_arch_regalloc_cost (cfg, vmv)) {
+ cfg->varinfo [vmv->idx]->opcode = OP_REGVAR;
+ cfg->varinfo [vmv->idx]->dreg = vmv->reg;
+ if (cfg->verbose_level > 2)
+ printf ("REGVAR %d C%d R%d\n", vmv->idx, vmv->spill_costs, vmv->reg);
+ } else
+ vmv->reg = -1;
+ }
+ }
+
+ /* Compute used regs */
+ used_regs = 0;
+ for (l = vars; l; l = l->next) {
+ vmv = l->data;
+
+ if (vmv->reg >= 0)
+ used_regs |= 1LL << vmv->reg;
+ }
+
+ *used_mask |= used_regs;
+
+#ifdef DEBUG_LSCAN
+ if (cfg->verbose_level > 2)
+ printf ("EXIT: final used mask: %08x\n", *used_mask);
+#endif
+
+ g_list_free (regs);
+ g_list_free (active);
+ g_list_free (vars);
+}
+
diff --git a/mono/mini/liveness.c b/mono/mini/liveness.c
new file mode 100644
index 00000000000..88d681d1b17
--- /dev/null
+++ b/mono/mini/liveness.c
@@ -0,0 +1,375 @@
+/*
+ * liveness.c: liveness analysis
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#include "mini.h"
+#include "inssel.h"
+
+//#define DEBUG_LIVENESS
+
+extern guint8 mono_burg_arity [];
+
+/* mono_bitset_mp_new:
+ *
+ * allocates a MonoBitSet inside a memory pool
+ */
+static MonoBitSet*
+mono_bitset_mp_new (MonoMemPool *mp, guint32 max_size)
+{
+ int size = mono_bitset_alloc_size (max_size, 0);
+ gpointer mem;
+
+ mem = mono_mempool_alloc0 (mp, size);
+ return mono_bitset_mem_new (mem, max_size, MONO_BITSET_DONT_FREE);
+}
+
+G_GNUC_UNUSED static void
+mono_bitset_print (MonoBitSet *set)
+{
+ int i;
+
+ printf ("{");
+ for (i = 0; i < mono_bitset_size (set); i++) {
+
+ if (mono_bitset_test (set, i))
+ printf ("%d, ", i);
+
+ }
+ printf ("}\n");
+}
+
+static inline void
+update_live_range (MonoCompile *cfg, int idx, int block_dfn, int tree_pos)
+{
+ MonoLiveRange *range = &MONO_VARINFO (cfg, idx)->range;
+ guint32 abs_pos = (block_dfn << 16) | tree_pos;
+
+ if (range->first_use.abs_pos > abs_pos)
+ range->first_use.abs_pos = abs_pos;
+
+ if (range->last_use.abs_pos < abs_pos)
+ range->last_use.abs_pos = abs_pos;
+}
+
+static void
+update_gen_kill_set (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *inst, int inst_num)
+{
+ int arity = mono_burg_arity [inst->opcode];
+ int max_vars = cfg->num_varinfo;
+
+ if (arity)
+ update_gen_kill_set (cfg, bb, inst->inst_i0, inst_num);
+
+ if (arity > 1)
+ update_gen_kill_set (cfg, bb, inst->inst_i1, inst_num);
+
+ if (inst->ssa_op == MONO_SSA_LOAD) {
+ int idx = inst->inst_i0->inst_c0;
+ MonoMethodVar *vi = MONO_VARINFO (cfg, idx);
+ g_assert (idx < max_vars);
+ if (bb->region != -1) {
+ /*
+ * Variables used in exception regions can't be allocated to
+ * registers.
+ */
+ cfg->varinfo [vi->idx]->flags |= MONO_INST_VOLATILE;
+ }
+ update_live_range (cfg, idx, bb->dfn, inst_num);
+ if (!mono_bitset_test (bb->kill_set, idx))
+ mono_bitset_set (bb->gen_set, idx);
+ vi->spill_costs += 1 + (bb->nesting * 2);
+ } else if (inst->ssa_op == MONO_SSA_STORE) {
+ int idx = inst->inst_i0->inst_c0;
+ MonoMethodVar *vi = MONO_VARINFO (cfg, idx);
+ g_assert (idx < max_vars);
+ g_assert (inst->inst_i1->opcode != OP_PHI);
+ if (bb->region != -1) {
+ /*
+ * Variables used in exception regions can't be allocated to
+ * registers.
+ */
+ cfg->varinfo [vi->idx]->flags |= MONO_INST_VOLATILE;
+ }
+ update_live_range (cfg, idx, bb->dfn, inst_num);
+ mono_bitset_set (bb->kill_set, idx);
+ vi->spill_costs += 1 + (bb->nesting * 2);
+ }
+}
+
+static void
+update_volatile (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *inst, int inst_num)
+{
+ int arity = mono_burg_arity [inst->opcode];
+ int max_vars = cfg->num_varinfo;
+
+ if (arity)
+ update_volatile (cfg, bb, inst->inst_i0, inst_num);
+
+ if (arity > 1)
+ update_volatile (cfg, bb, inst->inst_i1, inst_num);
+
+ if ((inst->ssa_op == MONO_SSA_LOAD) || (inst->ssa_op == MONO_SSA_STORE)) {
+ int idx = inst->inst_i0->inst_c0;
+ MonoMethodVar *vi = MONO_VARINFO (cfg, idx);
+ g_assert (idx < max_vars);
+ cfg->varinfo [vi->idx]->flags |= MONO_INST_VOLATILE;
+ }
+}
+
+static void
+visit_bb (MonoCompile *cfg, MonoBasicBlock *bb, GSList **visited)
+{
+ int i, tree_num;
+ MonoInst *inst;
+
+ if (g_slist_find (*visited, bb))
+ return;
+
+ for (tree_num = 0, inst = bb->code; inst; inst = inst->next, tree_num++) {
+ update_volatile (cfg, bb, inst, tree_num);
+ }
+
+ *visited = g_slist_append (*visited, bb);
+
+ /*
+ * Need to visit all bblocks reachable from this one since they can be
+ * reached during exception handling.
+ */
+ for (i = 0; i < bb->out_count; ++i) {
+ visit_bb (cfg, bb->out_bb [i], visited);
+ }
+}
+
+static void
+handle_exception_clauses (MonoCompile *cfg)
+{
+ MonoBasicBlock *bb;
+ GSList *visited = NULL;
+
+ /*
+ * Variables in exception handler register cannot be allocated to registers
+ * so make them volatile. See bug #42136. This will not be neccessary when
+ * the back ends could guarantee that the variables will be in the
+ * correct registers when a handler is called.
+ */
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ if (bb->region == -1)
+ continue;
+
+ visit_bb (cfg, bb, &visited);
+ }
+ g_slist_free (visited);
+}
+
+/* generic liveness analysis code. CFG specific parts are
+ * in update_gen_kill_set()
+ */
+void
+mono_analyze_liveness (MonoCompile *cfg)
+{
+ MonoBitSet *old_live_in_set, *old_live_out_set, *tmp_in_set;
+ gboolean changes;
+ int i, j, max_vars = cfg->num_varinfo;
+ int iterations, out_iter, in_iter;
+ gboolean *changed_in, *changed_out, *new_changed_in, *in_worklist;
+ MonoBasicBlock **worklist;
+ guint32 l_begin, l_end;
+ static int count = 0;
+
+#ifdef DEBUG_LIVENESS
+ printf ("LIVENESS %s\n", mono_method_full_name (cfg->method, TRUE));
+#endif
+
+ g_assert (!(cfg->comp_done & MONO_COMP_LIVENESS));
+
+ cfg->comp_done |= MONO_COMP_LIVENESS;
+
+ if (max_vars == 0)
+ return;
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+
+ bb->gen_set = mono_bitset_mp_new (cfg->mempool, max_vars);
+ bb->kill_set = mono_bitset_mp_new (cfg->mempool, max_vars);
+ bb->live_in_set = mono_bitset_mp_new (cfg->mempool, max_vars);
+ bb->live_out_set = mono_bitset_mp_new (cfg->mempool, max_vars);
+ }
+ for (i = 0; i < max_vars; i ++) {
+ MONO_VARINFO (cfg, i)->range.first_use.abs_pos = ~ 0;
+ MONO_VARINFO (cfg, i)->range.last_use .abs_pos = 0;
+ MONO_VARINFO (cfg, i)->spill_costs = 0;
+ }
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+ MonoInst *inst;
+ int tree_num;
+
+ for (tree_num = 0, inst = bb->code; inst; inst = inst->next, tree_num++) {
+ //mono_print_tree (inst); printf ("\n");
+ update_gen_kill_set (cfg, bb, inst, tree_num);
+ }
+
+#ifdef DEBUG_LIVENESS
+ printf ("BLOCK BB%d (", bb->block_num);
+ for (j = 0; j < bb->out_count; j++)
+ printf ("BB%d, ", bb->out_bb [j]->block_num);
+
+ printf (")\n");
+ printf ("GEN BB%d: ", bb->block_num); mono_bitset_print (bb->gen_set);
+ printf ("KILL BB%d: ", bb->block_num); mono_bitset_print (bb->kill_set);
+#endif
+ }
+
+ old_live_in_set = mono_bitset_new (max_vars, 0);
+ old_live_out_set = mono_bitset_new (max_vars, 0);
+ tmp_in_set = mono_bitset_new (max_vars, 0);
+ changed_in = g_new0 (gboolean, cfg->num_bblocks + 1);
+ changed_out = g_new0 (gboolean, cfg->num_bblocks + 1);
+ in_worklist = g_new0 (gboolean, cfg->num_bblocks + 1);
+ new_changed_in = g_new0 (gboolean, cfg->num_bblocks + 1);
+
+ for (i = 0; i < cfg->num_bblocks + 1; ++i) {
+ changed_in [i] = TRUE;
+ changed_out [i] = TRUE;
+ }
+
+ count ++;
+
+ worklist = g_new0 (MonoBasicBlock *, cfg->num_bblocks + 1);
+ l_begin = 0;
+ l_end = 0;
+
+ for (i = cfg->num_bblocks - 1; i >= 0; i--) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+
+ worklist [l_end ++] = bb;
+ in_worklist [bb->dfn] = TRUE;
+ }
+
+ iterations = 0;
+ out_iter = 0;
+ in_iter = 0;
+ do {
+ changes = FALSE;
+ iterations ++;
+
+ while (l_begin != l_end) {
+ MonoBasicBlock *bb = worklist [l_begin ++];
+
+ in_worklist [bb->dfn] = FALSE;
+
+ if (l_begin == cfg->num_bblocks + 1)
+ l_begin = 0;
+
+ if (bb->out_count > 0) {
+ out_iter ++;
+ mono_bitset_copyto (bb->live_out_set, old_live_out_set);
+
+ for (j = 0; j < bb->out_count; j++) {
+ MonoBasicBlock *out_bb = bb->out_bb [j];
+
+ mono_bitset_copyto (out_bb->live_out_set, tmp_in_set);
+ mono_bitset_sub (tmp_in_set, out_bb->kill_set);
+ mono_bitset_union (tmp_in_set, out_bb->gen_set);
+
+ mono_bitset_union (bb->live_out_set, tmp_in_set);
+
+ }
+
+ changed_out [bb->dfn] = !mono_bitset_equal (old_live_out_set, bb->live_out_set);
+ if (changed_out [bb->dfn]) {
+ for (j = 0; j < bb->in_count; j++) {
+ MonoBasicBlock *in_bb = bb->in_bb [j];
+ /*
+ * Some basic blocks do not seem to be in the
+ * cfg->bblocks array...
+ */
+ if (in_bb->live_in_set)
+ if (!in_worklist [in_bb->dfn]) {
+ worklist [l_end ++] = in_bb;
+ if (l_end == cfg->num_bblocks + 1)
+ l_end = 0;
+ in_worklist [in_bb->dfn] = TRUE;
+ }
+ }
+
+ changes = TRUE;
+ }
+ }
+ }
+ } while (changes);
+
+ //printf ("IT: %d %d %d.\n", iterations, in_iter, out_iter);
+
+ mono_bitset_free (old_live_in_set);
+ mono_bitset_free (old_live_out_set);
+ mono_bitset_free (tmp_in_set);
+
+ g_free (changed_in);
+ g_free (changed_out);
+ g_free (new_changed_in);
+ g_free (worklist);
+ g_free (in_worklist);
+
+ for (i = cfg->num_bblocks - 1; i >= 0; i--) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+
+ mono_bitset_copyto (bb->live_out_set, bb->live_in_set);
+ mono_bitset_sub (bb->live_in_set, bb->kill_set);
+ mono_bitset_union (bb->live_in_set, bb->gen_set);
+ }
+
+ /*
+ * This code can be slow for large methods so inline the calls to
+ * mono_bitset_test.
+ */
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+ guint32 rem;
+
+ rem = max_vars % 32;
+ for (j = 0; j < (max_vars / 32) + 1; ++j) {
+ guint32 bits_in;
+ guint32 bits_out;
+ int k, nbits;
+
+ if (j > (max_vars / 32))
+ break;
+ else
+ if (j == (max_vars / 32))
+ nbits = rem;
+ else
+ nbits = 32;
+
+ bits_in = mono_bitset_test_bulk (bb->live_in_set, j * 32);
+ bits_out = mono_bitset_test_bulk (bb->live_out_set, j * 32);
+ for (k = 0; k < nbits; ++k) {
+ if (bits_in & (1 << k))
+ update_live_range (cfg, (j * 32) + k, bb->dfn, 0);
+ if (bits_out & (1 << k))
+ update_live_range (cfg, (j * 32) + k, bb->dfn, 0xffff);
+ }
+ }
+ }
+
+ handle_exception_clauses (cfg);
+
+#ifdef DEBUG_LIVENESS
+ for (i = cfg->num_bblocks - 1; i >= 0; i--) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+
+ printf ("LIVE IN BB%d: ", bb->block_num);
+ mono_bitset_print (bb->live_in_set);
+ printf ("LIVE OUT BB%d: ", bb->block_num);
+ mono_bitset_print (bb->live_out_set);
+ }
+#endif
+}
+
diff --git a/mono/mini/main.c b/mono/mini/main.c
new file mode 100644
index 00000000000..4c5ae3ea052
--- /dev/null
+++ b/mono/mini/main.c
@@ -0,0 +1,8 @@
+#include "mini.h"
+
+int
+main (int argc, char* argv[])
+{
+ return mono_main (argc, argv);
+}
+
diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c
new file mode 100644
index 00000000000..805ba7a6464
--- /dev/null
+++ b/mono/mini/mini-amd64.c
@@ -0,0 +1,5593 @@
+/*
+ * mini-amd64.c: AMD64 backend for the Mono code generator
+ *
+ * Based on mini-x86.c.
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include "mini.h"
+#include <string.h>
+#include <math.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/profiler-private.h>
+#include <mono/utils/mono-math.h>
+
+#include "trace.h"
+#include "mini-amd64.h"
+#include "inssel.h"
+#include "cpu-amd64.h"
+
+static gint lmf_tls_offset = -1;
+static gint appdomain_tls_offset = -1;
+static gint thread_tls_offset = -1;
+
+/* Use SSE2 instructions for fp arithmetic */
+static gboolean use_sse2 = FALSE;
+
+/* xmm15 is reserved for use by some opcodes */
+#define AMD64_CALLEE_FREGS 0xef
+
+#define FPSTACK_SIZE 6
+
+#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
+
+#define IS_IMM32(val) ((((guint64)val) >> 32) == 0)
+
+#ifdef PLATFORM_WIN32
+/* Under windows, the default pinvoke calling convention is stdcall */
+#define CALLCONV_IS_STDCALL(call_conv) (((call_conv) == MONO_CALL_STDCALL) || ((call_conv) == MONO_CALL_DEFAULT))
+#else
+#define CALLCONV_IS_STDCALL(call_conv) ((call_conv) == MONO_CALL_STDCALL)
+#endif
+
+#define SIGNAL_STACK_SIZE (64 * 1024)
+
+#define ARGS_OFFSET 16
+#define GP_SCRATCH_REG AMD64_R11
+
+/*
+ * AMD64 register usage:
+ * - callee saved registers are used for global register allocation
+ * - %r11 is used for materializing 64 bit constants in opcodes
+ * - the rest is used for local allocation
+ */
+
+/*
+ * FIXME:
+ * - Use xmm registers instead of the x87 stack
+ * - Allocate arguments to global registers
+ * - implement emulated opcodes
+ * - (all archs) do not store trampoline addresses in method->info since they
+ * are domain specific.
+ */
+
+#define NOT_IMPLEMENTED g_assert_not_reached ()
+
+const char*
+mono_arch_regname (int reg) {
+ switch (reg) {
+ case AMD64_RAX: return "%rax";
+ case AMD64_RBX: return "%rbx";
+ case AMD64_RCX: return "%rcx";
+ case AMD64_RDX: return "%rdx";
+ case AMD64_RSP: return "%rsp";
+ case AMD64_RBP: return "%rbp";
+ case AMD64_RDI: return "%rdi";
+ case AMD64_RSI: return "%rsi";
+ case AMD64_R8: return "%r8";
+ case AMD64_R9: return "%r9";
+ case AMD64_R10: return "%r10";
+ case AMD64_R11: return "%r11";
+ case AMD64_R12: return "%r12";
+ case AMD64_R13: return "%r13";
+ case AMD64_R14: return "%r14";
+ case AMD64_R15: return "%r15";
+ }
+ return "unknown";
+}
+
+static const char * xmmregs [] = {
+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm8",
+ "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
+};
+
+static const char*
+mono_arch_fregname (int reg)
+{
+ if (reg < AMD64_XMM_NREG)
+ return xmmregs [reg];
+ else
+ return "unknown";
+}
+
+static const char*
+mono_amd64_regname (int reg, gboolean fp)
+{
+ if (fp)
+ return mono_arch_fregname (reg);
+ else
+ return mono_arch_regname (reg);
+}
+
+static inline void
+amd64_patch (unsigned char* code, gpointer target)
+{
+ /* Skip REX */
+ if ((code [0] >= 0x40) && (code [0] <= 0x4f))
+ code += 1;
+
+ if (code [0] == 0xbb) {
+ /* amd64_set_reg_template */
+ *(guint64*)(code + 1) = (guint64)target;
+ }
+ else
+ x86_patch (code, (unsigned char*)target);
+}
+
+typedef enum {
+ ArgInIReg,
+ ArgInFloatSSEReg,
+ ArgInDoubleSSEReg,
+ ArgOnStack,
+ ArgValuetypeInReg,
+ ArgNone /* only in pair_storage */
+} ArgStorage;
+
+typedef struct {
+ gint16 offset;
+ gint8 reg;
+ ArgStorage storage;
+
+ /* Only if storage == ArgValuetypeInReg */
+ ArgStorage pair_storage [2];
+ gint8 pair_regs [2];
+} ArgInfo;
+
+typedef struct {
+ int nargs;
+ guint32 stack_usage;
+ guint32 reg_usage;
+ guint32 freg_usage;
+ gboolean need_stack_align;
+ ArgInfo ret;
+ ArgInfo sig_cookie;
+ ArgInfo args [1];
+} CallInfo;
+
+#define DEBUG(a) if (cfg->verbose_level > 1) a
+
+#define NEW_ICONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_ICONST; \
+ (dest)->inst_c0 = (val); \
+ (dest)->type = STACK_I4; \
+ } while (0)
+
+#define PARAM_REGS 6
+
+static AMD64_Reg_No param_regs [] = { AMD64_RDI, AMD64_RSI, AMD64_RDX, AMD64_RCX, AMD64_R8, AMD64_R9 };
+
+static AMD64_Reg_No return_regs [] = { AMD64_RAX, AMD64_RDX };
+
+static void inline
+add_general (guint32 *gr, guint32 *stack_size, ArgInfo *ainfo)
+{
+ ainfo->offset = *stack_size;
+
+ if (*gr >= PARAM_REGS) {
+ ainfo->storage = ArgOnStack;
+ (*stack_size) += sizeof (gpointer);
+ }
+ else {
+ ainfo->storage = ArgInIReg;
+ ainfo->reg = param_regs [*gr];
+ (*gr) ++;
+ }
+}
+
+#define FLOAT_PARAM_REGS 8
+
+static void inline
+add_float (guint32 *gr, guint32 *stack_size, ArgInfo *ainfo, gboolean is_double)
+{
+ ainfo->offset = *stack_size;
+
+ if (*gr >= FLOAT_PARAM_REGS) {
+ ainfo->storage = ArgOnStack;
+ (*stack_size) += sizeof (gpointer);
+ }
+ else {
+ /* A double register */
+ if (is_double)
+ ainfo->storage = ArgInDoubleSSEReg;
+ else
+ ainfo->storage = ArgInFloatSSEReg;
+ ainfo->reg = *gr;
+ (*gr) += 1;
+ }
+}
+
+typedef enum ArgumentClass {
+ ARG_CLASS_NO_CLASS,
+ ARG_CLASS_MEMORY,
+ ARG_CLASS_INTEGER,
+ ARG_CLASS_SSE
+} ArgumentClass;
+
+static ArgumentClass
+merge_argument_class_from_type (MonoType *type, ArgumentClass class1)
+{
+ ArgumentClass class2;
+ MonoType *ptype;
+
+ ptype = mono_type_get_underlying_type (type);
+ switch (ptype->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ class2 = ARG_CLASS_INTEGER;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ class2 = ARG_CLASS_SSE;
+ break;
+
+ case MONO_TYPE_TYPEDBYREF:
+ g_assert_not_reached ();
+
+ case MONO_TYPE_VALUETYPE: {
+ MonoMarshalType *info = mono_marshal_load_type_info (ptype->data.klass);
+ int i;
+
+ for (i = 0; i < info->num_fields; ++i) {
+ class2 = class1;
+ class2 = merge_argument_class_from_type (info->fields [i].field->type, class2);
+ }
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ }
+
+ /* Merge */
+ if (class1 == class2)
+ ;
+ else if (class1 == ARG_CLASS_NO_CLASS)
+ class1 = class2;
+ else if ((class1 == ARG_CLASS_MEMORY) || (class2 == ARG_CLASS_MEMORY))
+ class1 = ARG_CLASS_MEMORY;
+ else if ((class1 == ARG_CLASS_INTEGER) || (class2 == ARG_CLASS_INTEGER))
+ class1 = ARG_CLASS_INTEGER;
+ else
+ class1 = ARG_CLASS_SSE;
+
+ return class1;
+}
+
+static void
+add_valuetype (MonoMethodSignature *sig, ArgInfo *ainfo, MonoType *type,
+ gboolean is_return,
+ guint32 *gr, guint32 *fr, guint32 *stack_size)
+{
+ guint32 size, quad, nquads, i;
+ ArgumentClass args [2];
+ MonoMarshalType *info;
+ MonoClass *klass;
+
+ klass = mono_class_from_mono_type (type);
+ if (sig->pinvoke)
+ size = mono_type_native_stack_size (&klass->byval_arg, NULL);
+ else
+ size = mono_type_stack_size (&klass->byval_arg, NULL);
+
+ if (!sig->pinvoke || (size == 0) || (size > 16)) {
+ /* Allways pass in memory */
+ ainfo->offset = *stack_size;
+ *stack_size += ALIGN_TO (size, 8);
+ ainfo->storage = ArgOnStack;
+
+ return;
+ }
+
+ /* FIXME: Handle structs smaller than 8 bytes */
+ //if ((size % 8) != 0)
+ // NOT_IMPLEMENTED;
+
+ if (size > 8)
+ nquads = 2;
+ else
+ nquads = 1;
+
+ /*
+ * Implement the algorithm from section 3.2.3 of the X86_64 ABI.
+ * The X87 and SSEUP stuff is left out since there are no such types in
+ * the CLR.
+ */
+ info = mono_marshal_load_type_info (klass);
+ g_assert (info);
+ if (info->native_size > 16) {
+ ainfo->offset = *stack_size;
+ *stack_size += ALIGN_TO (info->native_size, 8);
+ ainfo->storage = ArgOnStack;
+
+ return;
+ }
+
+ for (quad = 0; quad < nquads; ++quad) {
+ int size, align;
+ ArgumentClass class1;
+
+ class1 = ARG_CLASS_NO_CLASS;
+ for (i = 0; i < info->num_fields; ++i) {
+ size = mono_marshal_type_size (info->fields [i].field->type,
+ info->fields [i].mspec,
+ &align, TRUE, klass->unicode);
+ if ((info->fields [i].offset < 8) && (info->fields [i].offset + size) > 8) {
+ /* Unaligned field */
+ NOT_IMPLEMENTED;
+ }
+
+ /* Skip fields in other quad */
+ if ((quad == 0) && (info->fields [i].offset >= 8))
+ continue;
+ if ((quad == 1) && (info->fields [i].offset < 8))
+ continue;
+
+ class1 = merge_argument_class_from_type (info->fields [i].field->type, class1);
+ }
+ g_assert (class1 != ARG_CLASS_NO_CLASS);
+ args [quad] = class1;
+ }
+
+ /* Post merger cleanup */
+ if ((args [0] == ARG_CLASS_MEMORY) || (args [1] == ARG_CLASS_MEMORY))
+ args [0] = args [1] = ARG_CLASS_MEMORY;
+
+ /* Allocate registers */
+ {
+ int orig_gr = *gr;
+ int orig_fr = *fr;
+
+ ainfo->storage = ArgValuetypeInReg;
+ ainfo->pair_storage [0] = ainfo->pair_storage [1] = ArgNone;
+ for (quad = 0; quad < nquads; ++quad) {
+ switch (args [quad]) {
+ case ARG_CLASS_INTEGER:
+ if (*gr >= PARAM_REGS)
+ args [quad] = ARG_CLASS_MEMORY;
+ else {
+ ainfo->pair_storage [quad] = ArgInIReg;
+ if (is_return)
+ ainfo->pair_regs [quad] = return_regs [*gr];
+ else
+ ainfo->pair_regs [quad] = param_regs [*gr];
+ (*gr) ++;
+ }
+ break;
+ case ARG_CLASS_SSE:
+ if (*fr >= FLOAT_PARAM_REGS)
+ args [quad] = ARG_CLASS_MEMORY;
+ else {
+ ainfo->pair_storage [quad] = ArgInDoubleSSEReg;
+ ainfo->pair_regs [quad] = *fr;
+ (*fr) ++;
+ }
+ break;
+ case ARG_CLASS_MEMORY:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
+ if ((args [0] == ARG_CLASS_MEMORY) || (args [1] == ARG_CLASS_MEMORY)) {
+ /* Revert possible register assignments */
+ *gr = orig_gr;
+ *fr = orig_fr;
+
+ ainfo->offset = *stack_size;
+ *stack_size += ALIGN_TO (info->native_size, 8);
+ ainfo->storage = ArgOnStack;
+ }
+ }
+}
+
+/*
+ * get_call_info:
+ *
+ * Obtain information about a call according to the calling convention.
+ * For AMD64, see the "System V ABI, x86-64 Architecture Processor Supplement
+ * Draft Version 0.23" document for more information.
+ */
+static CallInfo*
+get_call_info (MonoMethodSignature *sig, gboolean is_pinvoke)
+{
+ guint32 i, gr, fr;
+ MonoType *ret_type;
+ int n = sig->hasthis + sig->param_count;
+ guint32 stack_size = 0;
+ CallInfo *cinfo;
+
+ cinfo = g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n));
+
+ gr = 0;
+ fr = 0;
+
+ /* return value */
+ {
+ ret_type = mono_type_get_underlying_type (sig->ret);
+ switch (ret_type->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ cinfo->ret.storage = ArgInIReg;
+ cinfo->ret.reg = AMD64_RAX;
+ break;
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ cinfo->ret.storage = ArgInIReg;
+ cinfo->ret.reg = AMD64_RAX;
+ break;
+ case MONO_TYPE_R4:
+ cinfo->ret.storage = ArgInFloatSSEReg;
+ cinfo->ret.reg = AMD64_XMM0;
+ break;
+ case MONO_TYPE_R8:
+ cinfo->ret.storage = ArgInDoubleSSEReg;
+ cinfo->ret.reg = AMD64_XMM0;
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ guint32 tmp_gr = 0, tmp_fr = 0, tmp_stacksize = 0;
+
+ add_valuetype (sig, &cinfo->ret, sig->ret, TRUE, &tmp_gr, &tmp_fr, &tmp_stacksize);
+ if (cinfo->ret.storage == ArgOnStack)
+ /* The caller passes the address where the value is stored */
+ add_general (&gr, &stack_size, &cinfo->ret);
+ break;
+ }
+ case MONO_TYPE_TYPEDBYREF:
+ /* Same as a valuetype with size 24 */
+ add_general (&gr, &stack_size, &cinfo->ret);
+ ;
+ break;
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+ }
+
+ /* this */
+ if (sig->hasthis)
+ add_general (&gr, &stack_size, cinfo->args + 0);
+
+ if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (n == 0)) {
+ gr = PARAM_REGS;
+ fr = FLOAT_PARAM_REGS;
+
+ /* Emit the signature cookie just before the implicit arguments */
+ add_general (&gr, &stack_size, &cinfo->sig_cookie);
+ }
+
+ for (i = 0; i < sig->param_count; ++i) {
+ ArgInfo *ainfo = &cinfo->args [sig->hasthis + i];
+ MonoType *ptype;
+
+ if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) {
+ /* We allways pass the sig cookie on the stack for simplicity */
+ /*
+ * Prevent implicit arguments + the sig cookie from being passed
+ * in registers.
+ */
+ gr = PARAM_REGS;
+ fr = FLOAT_PARAM_REGS;
+
+ /* Emit the signature cookie just before the implicit arguments */
+ add_general (&gr, &stack_size, &cinfo->sig_cookie);
+ }
+
+ if (sig->params [i]->byref) {
+ add_general (&gr, &stack_size, ainfo);
+ continue;
+ }
+ ptype = mono_type_get_underlying_type (sig->params [i]);
+ switch (ptype->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ add_general (&gr, &stack_size, ainfo);
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ add_general (&gr, &stack_size, ainfo);
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ add_general (&gr, &stack_size, ainfo);
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ add_general (&gr, &stack_size, ainfo);
+ break;
+ case MONO_TYPE_VALUETYPE:
+ add_valuetype (sig, ainfo, sig->params [i], FALSE, &gr, &fr, &stack_size);
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ stack_size += sizeof (MonoTypedRef);
+ ainfo->storage = ArgOnStack;
+ break;
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ add_general (&gr, &stack_size, ainfo);
+ break;
+ case MONO_TYPE_R4:
+ add_float (&fr, &stack_size, ainfo, FALSE);
+ break;
+ case MONO_TYPE_R8:
+ add_float (&fr, &stack_size, ainfo, TRUE);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
+ if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (n > 0) && (sig->sentinelpos == sig->param_count)) {
+ gr = PARAM_REGS;
+ fr = FLOAT_PARAM_REGS;
+
+ /* Emit the signature cookie just before the implicit arguments */
+ add_general (&gr, &stack_size, &cinfo->sig_cookie);
+ }
+
+ if (stack_size & 0x8) {
+ /* The AMD64 ABI requires each stack frame to be 16 byte aligned */
+ cinfo->need_stack_align = TRUE;
+ stack_size += 8;
+ }
+
+ cinfo->stack_usage = stack_size;
+ cinfo->reg_usage = gr;
+ cinfo->freg_usage = fr;
+ return cinfo;
+}
+
+/*
+ * mono_arch_get_argument_info:
+ * @csig: a method signature
+ * @param_count: the number of parameters to consider
+ * @arg_info: an array to store the result infos
+ *
+ * Gathers information on parameters such as size, alignment and
+ * padding. arg_info should be large enought to hold param_count + 1 entries.
+ *
+ * Returns the size of the argument area on the stack.
+ */
+int
+mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+{
+ int k;
+ CallInfo *cinfo = get_call_info (csig, FALSE);
+ guint32 args_size = cinfo->stack_usage;
+
+ /* The arguments are saved to a stack area in mono_arch_instrument_prolog */
+ if (csig->hasthis) {
+ arg_info [0].offset = 0;
+ }
+
+ for (k = 0; k < param_count; k++) {
+ arg_info [k + 1].offset = ((k + csig->hasthis) * 8);
+ /* FIXME: */
+ arg_info [k + 1].size = 0;
+ }
+
+ g_free (cinfo);
+
+ return args_size;
+}
+
+static int
+cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx)
+{
+ return 0;
+}
+
+/*
+ * Initialize the cpu to execute managed code.
+ */
+void
+mono_arch_cpu_init (void)
+{
+ guint16 fpcw;
+
+ /* spec compliance requires running with double precision */
+ __asm__ __volatile__ ("fnstcw %0\n": "=m" (fpcw));
+ fpcw &= ~X86_FPCW_PRECC_MASK;
+ fpcw |= X86_FPCW_PREC_DOUBLE;
+ __asm__ __volatile__ ("fldcw %0\n": : "m" (fpcw));
+ __asm__ __volatile__ ("fnstcw %0\n": "=m" (fpcw));
+
+ mono_amd64_exceptions_init ();
+ mono_amd64_tramp_init ();
+}
+
+/*
+ * This function returns the optimizations supported on this cpu.
+ */
+guint32
+mono_arch_cpu_optimizazions (guint32 *exclude_mask)
+{
+ int eax, ebx, ecx, edx;
+ guint32 opts = 0;
+
+ /* FIXME: AMD64 */
+
+ *exclude_mask = 0;
+ /* Feature Flags function, flags returned in EDX. */
+ if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
+ if (edx & (1 << 15)) {
+ opts |= MONO_OPT_CMOV;
+ if (edx & 1)
+ opts |= MONO_OPT_FCMOV;
+ else
+ *exclude_mask |= MONO_OPT_FCMOV;
+ } else
+ *exclude_mask |= MONO_OPT_CMOV;
+ }
+ return opts;
+}
+
+static gboolean
+is_regsize_var (MonoType *t) {
+ if (t->byref)
+ return TRUE;
+ t = mono_type_get_underlying_type (t);
+ switch (t->type) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ return TRUE;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return TRUE;
+ case MONO_TYPE_VALUETYPE:
+ return FALSE;
+ }
+ return FALSE;
+}
+
+GList *
+mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
+{
+ GList *vars = NULL;
+ int i;
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoInst *ins = cfg->varinfo [i];
+ MonoMethodVar *vmv = MONO_VARINFO (cfg, i);
+
+ /* unused vars */
+ if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos)
+ continue;
+
+ if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) ||
+ (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG))
+ continue;
+
+ /* we dont allocate I1 to registers because there is no simply way to sign extend
+ * 8bit quantities in caller saved registers on x86 */
+ if (is_regsize_var (ins->inst_vtype) || (ins->inst_vtype->type == MONO_TYPE_BOOLEAN) ||
+ (ins->inst_vtype->type == MONO_TYPE_U1) || (ins->inst_vtype->type == MONO_TYPE_U2)||
+ (ins->inst_vtype->type == MONO_TYPE_I2) || (ins->inst_vtype->type == MONO_TYPE_CHAR)) {
+ g_assert (MONO_VARINFO (cfg, i)->reg == -1);
+ g_assert (i == vmv->idx);
+ vars = g_list_prepend (vars, vmv);
+ }
+ }
+
+ vars = mono_varlist_sort (cfg, vars, 0);
+
+ return vars;
+}
+
+GList *
+mono_arch_get_global_int_regs (MonoCompile *cfg)
+{
+ GList *regs = NULL;
+
+ /* We use the callee saved registers for global allocation */
+ regs = g_list_prepend (regs, (gpointer)AMD64_RBX);
+ regs = g_list_prepend (regs, (gpointer)AMD64_R12);
+ regs = g_list_prepend (regs, (gpointer)AMD64_R13);
+ regs = g_list_prepend (regs, (gpointer)AMD64_R14);
+ regs = g_list_prepend (regs, (gpointer)AMD64_R15);
+
+ return regs;
+}
+
+/*
+ * mono_arch_regalloc_cost:
+ *
+ * Return the cost, in number of memory references, of the action of
+ * allocating the variable VMV into a register during global register
+ * allocation.
+ */
+guint32
+mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv)
+{
+ MonoInst *ins = cfg->varinfo [vmv->idx];
+
+ if (cfg->method->save_lmf)
+ /* The register is already saved */
+ /* substract 1 for the invisible store in the prolog */
+ return (ins->opcode == OP_ARG) ? 0 : 1;
+ else
+ /* push+pop */
+ return (ins->opcode == OP_ARG) ? 1 : 2;
+}
+
+void
+mono_arch_allocate_vars (MonoCompile *m)
+{
+ MonoMethodSignature *sig;
+ MonoMethodHeader *header;
+ MonoInst *inst;
+ int i, offset, size, align, curinst;
+ CallInfo *cinfo;
+
+ header = mono_method_get_header (m->method);
+
+ sig = m->method->signature;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ /*
+ * We use the ABI calling conventions for managed code as well.
+ * Exception: valuetypes are never passed or returned in registers.
+ */
+
+ /* Locals are allocated backwards from %fp */
+ m->frame_reg = AMD64_RBP;
+ offset = 0;
+
+ /* Reserve space for caller saved registers */
+ for (i = 0; i < AMD64_NREG; ++i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (m->used_int_regs & (1 << i))) {
+ offset += sizeof (gpointer);
+ }
+
+ if (m->method->save_lmf) {
+ /* Reserve stack space for saving LMF + argument regs */
+ offset += sizeof (MonoLMF);
+ if (lmf_tls_offset == -1)
+ /* Need to save argument regs too */
+ offset += (AMD64_NREG * 8) + (8 * 8);
+ m->arch.lmf_offset = offset;
+ }
+
+ if (sig->ret->type != MONO_TYPE_VOID) {
+ switch (cinfo->ret.storage) {
+ case ArgInIReg:
+ case ArgInFloatSSEReg:
+ case ArgInDoubleSSEReg:
+ if ((MONO_TYPE_ISSTRUCT (sig->ret) && !mono_class_from_mono_type (sig->ret)->enumtype) || (sig->ret->type == MONO_TYPE_TYPEDBYREF)) {
+ /* The register is volatile */
+ m->ret->opcode = OP_REGOFFSET;
+ m->ret->inst_basereg = AMD64_RBP;
+ offset += 8;
+ m->ret->inst_offset = - offset;
+ }
+ else {
+ m->ret->opcode = OP_REGVAR;
+ m->ret->inst_c0 = cinfo->ret.reg;
+ }
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ m->ret->dreg = m->ret->inst_c0;
+ }
+
+ curinst = m->locals_start;
+ for (i = curinst; i < m->num_varinfo; ++i) {
+ inst = m->varinfo [i];
+
+ if (inst->opcode == OP_REGVAR) {
+ //g_print ("allocating local %d to %s\n", i, mono_arch_regname (inst->dreg));
+ continue;
+ }
+
+ /* inst->unused indicates native sized value types, this is used by the
+ * pinvoke wrappers when they call functions returning structure */
+ if (inst->unused && MONO_TYPE_ISSTRUCT (inst->inst_vtype) && inst->inst_vtype->type != MONO_TYPE_TYPEDBYREF)
+ size = mono_class_native_size (mono_class_from_mono_type (inst->inst_vtype), &align);
+ else
+ size = mono_type_stack_size (inst->inst_vtype, &align);
+
+ /*
+ * variables are accessed as negative offsets from %fp, so increase
+ * the offset before assigning it to a variable
+ */
+ offset += size;
+
+ offset += align - 1;
+ offset &= ~(align - 1);
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = AMD64_RBP;
+ inst->inst_offset = - offset;
+
+ //g_print ("allocating local %d to [%s - %d]\n", i, mono_arch_regname (inst->inst_basereg), - inst->inst_offset);
+ }
+
+ if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG)) {
+ g_assert (cinfo->sig_cookie.storage == ArgOnStack);
+ m->sig_cookie = cinfo->sig_cookie.offset + ARGS_OFFSET;
+ }
+
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ inst = m->varinfo [i];
+ if (inst->opcode != OP_REGVAR) {
+ ArgInfo *ainfo = &cinfo->args [i];
+ gboolean inreg = TRUE;
+ MonoType *arg_type;
+
+ if (sig->hasthis && (i == 0))
+ arg_type = &mono_defaults.object_class->byval_arg;
+ else
+ arg_type = sig->params [i - sig->hasthis];
+
+ /* FIXME: Allocate volatile arguments to registers */
+ if (inst->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT))
+ inreg = FALSE;
+
+ /*
+ * Under AMD64, all registers used to pass arguments to functions
+ * are volatile across calls.
+ * FIXME: Optimize this.
+ */
+ if ((ainfo->storage == ArgInIReg) || (ainfo->storage == ArgInFloatSSEReg) || (ainfo->storage == ArgInDoubleSSEReg))
+ inreg = FALSE;
+
+ inst->opcode = OP_REGOFFSET;
+
+ switch (ainfo->storage) {
+ case ArgInIReg:
+ case ArgInFloatSSEReg:
+ case ArgInDoubleSSEReg:
+ inst->opcode = OP_REGVAR;
+ inst->dreg = ainfo->reg;
+ break;
+ case ArgOnStack:
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = AMD64_RBP;
+ inst->inst_offset = ainfo->offset + ARGS_OFFSET;
+ break;
+ default:
+ NOT_IMPLEMENTED;
+ }
+
+ if (!inreg && (ainfo->storage != ArgOnStack)) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = AMD64_RBP;
+ /* These arguments are saved to the stack in the prolog */
+ offset += 8;
+ inst->inst_offset = - offset;
+ }
+ }
+ }
+
+ m->stack_offset = offset;
+
+ g_free (cinfo);
+}
+
+static void
+add_outarg_reg (MonoCompile *cfg, MonoCallInst *call, MonoInst *arg, ArgStorage storage, int reg, MonoInst *tree)
+{
+ switch (storage) {
+ case ArgInIReg:
+ arg->opcode = OP_OUTARG_REG;
+ arg->inst_left = tree;
+ arg->inst_right = (MonoInst*)call;
+ arg->unused = reg;
+ call->used_iregs |= 1 << reg;
+ break;
+ case ArgInFloatSSEReg:
+ arg->opcode = OP_AMD64_OUTARG_XMMREG_R4;
+ arg->inst_left = tree;
+ arg->inst_right = (MonoInst*)call;
+ arg->unused = reg;
+ call->used_fregs |= 1 << reg;
+ break;
+ case ArgInDoubleSSEReg:
+ arg->opcode = OP_AMD64_OUTARG_XMMREG_R8;
+ arg->inst_left = tree;
+ arg->inst_right = (MonoInst*)call;
+ arg->unused = reg;
+ call->used_fregs |= 1 << reg;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+/* Fixme: we need an alignment solution for enter_method and mono_arch_call_opcode,
+ * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info
+ */
+
+static int
+arg_storage_to_ldind (ArgStorage storage)
+{
+ switch (storage) {
+ case ArgInIReg:
+ return CEE_LDIND_I;
+ case ArgInDoubleSSEReg:
+ return CEE_LDIND_R8;
+ case ArgInFloatSSEReg:
+ return CEE_LDIND_R4;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return -1;
+}
+
+/*
+ * take the arguments and generate the arch-specific
+ * instructions to properly call the function in call.
+ * This includes pushing, moving arguments to the right register
+ * etc.
+ * Issue: who does the spilling if needed, and when?
+ */
+MonoCallInst*
+mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb, MonoCallInst *call, int is_virtual) {
+ MonoInst *arg, *in;
+ MonoMethodSignature *sig;
+ int i, n, stack_size;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+
+ stack_size = 0;
+
+ sig = call->signature;
+ n = sig->param_count + sig->hasthis;
+
+ cinfo = get_call_info (sig, sig->pinvoke);
+
+ for (i = 0; i < n; ++i) {
+ ainfo = cinfo->args + i;
+
+ if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) {
+ MonoMethodSignature *tmp_sig;
+
+ /* Emit the signature cookie just before the implicit arguments */
+ MonoInst *sig_arg;
+ /* FIXME: Add support for signature tokens to AOT */
+ cfg->disable_aot = TRUE;
+
+ g_assert (cinfo->sig_cookie.storage == ArgOnStack);
+
+ /*
+ * mono_ArgIterator_Setup assumes the signature cookie is
+ * passed first and all the arguments which were before it are
+ * passed on the stack after the signature. So compensate by
+ * passing a different signature.
+ */
+ tmp_sig = mono_metadata_signature_dup (call->signature);
+ tmp_sig->param_count -= call->signature->sentinelpos;
+ tmp_sig->sentinelpos = 0;
+ memcpy (tmp_sig->params, call->signature->params + call->signature->sentinelpos, tmp_sig->param_count * sizeof (MonoType*));
+
+ MONO_INST_NEW (cfg, sig_arg, OP_ICONST);
+ sig_arg->inst_p0 = tmp_sig;
+
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ arg->inst_left = sig_arg;
+ arg->type = STACK_PTR;
+
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ }
+
+ if (is_virtual && i == 0) {
+ /* the argument will be attached to the call instruction */
+ in = call->args [i];
+ } else {
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ in = call->args [i];
+ arg->cil_code = in->cil_code;
+ arg->inst_left = in;
+ arg->type = in->type;
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+
+ if ((i >= sig->hasthis) && (MONO_TYPE_ISSTRUCT(sig->params [i - sig->hasthis]))) {
+ gint align;
+ guint32 size;
+
+ if (sig->params [i - sig->hasthis]->type == MONO_TYPE_TYPEDBYREF) {
+ size = sizeof (MonoTypedRef);
+ align = sizeof (gpointer);
+ }
+ else
+ if (sig->pinvoke)
+ size = mono_type_native_stack_size (&in->klass->byval_arg, &align);
+ else
+ size = mono_type_stack_size (&in->klass->byval_arg, &align);
+ if (ainfo->storage == ArgValuetypeInReg) {
+ if (ainfo->pair_storage [1] == ArgNone) {
+ MonoInst *load;
+
+ /* Simpler case */
+
+ MONO_INST_NEW (cfg, load, arg_storage_to_ldind (ainfo->pair_storage [0]));
+ load->inst_left = in;
+
+ add_outarg_reg (cfg, call, arg, ainfo->pair_storage [0], ainfo->pair_regs [0], load);
+ }
+ else {
+ /* Trees can't be shared so make a copy */
+ MonoInst *vtaddr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ MonoInst *load, *load2, *offset_ins;
+
+ /* Reg1 */
+ MONO_INST_NEW (cfg, load, CEE_LDIND_I);
+ load->inst_i0 = (cfg)->varinfo [vtaddr->inst_c0];
+
+ NEW_ICONST (cfg, offset_ins, 0);
+ MONO_INST_NEW (cfg, load2, CEE_ADD);
+ load2->inst_left = load;
+ load2->inst_right = offset_ins;
+
+ MONO_INST_NEW (cfg, load, arg_storage_to_ldind (ainfo->pair_storage [0]));
+ load->inst_left = load2;
+
+ add_outarg_reg (cfg, call, arg, ainfo->pair_storage [0], ainfo->pair_regs [0], load);
+
+ /* Reg2 */
+ MONO_INST_NEW (cfg, load, CEE_LDIND_I);
+ load->inst_i0 = (cfg)->varinfo [vtaddr->inst_c0];
+
+ NEW_ICONST (cfg, offset_ins, 8);
+ MONO_INST_NEW (cfg, load2, CEE_ADD);
+ load2->inst_left = load;
+ load2->inst_right = offset_ins;
+
+ MONO_INST_NEW (cfg, load, arg_storage_to_ldind (ainfo->pair_storage [1]));
+ load->inst_left = load2;
+
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ arg->cil_code = in->cil_code;
+ arg->type = in->type;
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+
+ add_outarg_reg (cfg, call, arg, ainfo->pair_storage [1], ainfo->pair_regs [1], load);
+
+ /* Prepend a copy inst */
+ MONO_INST_NEW (cfg, arg, CEE_STIND_I);
+ arg->cil_code = in->cil_code;
+ arg->inst_left = vtaddr;
+ arg->inst_right = in;
+ arg->type = in->type;
+
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ }
+ }
+ else {
+ arg->opcode = OP_OUTARG_VT;
+ arg->klass = in->klass;
+ arg->unused = sig->pinvoke;
+ arg->inst_imm = size;
+ }
+ }
+ else {
+ switch (ainfo->storage) {
+ case ArgInIReg:
+ add_outarg_reg (cfg, call, arg, ainfo->storage, ainfo->reg, in);
+ break;
+ case ArgInFloatSSEReg:
+ case ArgInDoubleSSEReg:
+ add_outarg_reg (cfg, call, arg, ainfo->storage, ainfo->reg, in);
+ break;
+ case ArgOnStack:
+ arg->opcode = OP_OUTARG;
+ if (!sig->params [i - sig->hasthis]->byref) {
+ if (sig->params [i - sig->hasthis]->type == MONO_TYPE_R4)
+ arg->opcode = OP_OUTARG_R4;
+ else
+ if (sig->params [i - sig->hasthis]->type == MONO_TYPE_R8)
+ arg->opcode = OP_OUTARG_R8;
+ }
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+ }
+ }
+
+ if (cinfo->need_stack_align) {
+ MONO_INST_NEW (cfg, arg, OP_AMD64_OUTARG_ALIGN_STACK);
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ }
+
+ call->stack_usage = cinfo->stack_usage;
+ cfg->param_area = MAX (cfg->param_area, call->stack_usage);
+ cfg->flags |= MONO_CFG_HAS_CALLS;
+
+ g_free (cinfo);
+
+ return call;
+}
+
+#define EMIT_COND_BRANCH(ins,cond,sign) \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (ins->inst_i0->inst_c0) { \
+ x86_branch (code, cond, cfg->native_code + ins->inst_i0->inst_c0, sign); \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ if ((cfg->opt & MONO_OPT_BRANCH) && \
+ x86_is_imm8 (ins->inst_i0->inst_c1 - cpos)) \
+ x86_branch8 (code, cond, 0, sign); \
+ else \
+ x86_branch32 (code, cond, 0, sign); \
+ } \
+} else { \
+ if (ins->inst_true_bb->native_offset) { \
+ x86_branch (code, cond, cfg->native_code + ins->inst_true_bb->native_offset, sign); \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_true_bb); \
+ if ((cfg->opt & MONO_OPT_BRANCH) && \
+ x86_is_imm8 (ins->inst_true_bb->max_offset - cpos)) \
+ x86_branch8 (code, cond, 0, sign); \
+ else \
+ x86_branch32 (code, cond, 0, sign); \
+ } \
+}
+
+/* emit an exception if condition is fail */
+#define EMIT_COND_SYSTEM_EXCEPTION(cond,signed,exc_name) \
+ do { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_EXC, exc_name); \
+ x86_branch32 (code, cond, 0, signed); \
+ } while (0);
+
+#define EMIT_FPCOMPARE(code) do { \
+ amd64_fcompp (code); \
+ amd64_fnstsw (code); \
+} while (0);
+
+/*
+ * Emitting a call and patching it later is expensive on amd64, so try to
+ * determine the patch target immediately, and emit more efficient code if
+ * possible.
+ */
+static guint8*
+emit_call (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer data)
+{
+ /* FIXME: */
+ mono_add_patch_info (cfg, code - cfg->native_code, patch_type, data);
+ amd64_set_reg_template (code, GP_SCRATCH_REG);
+ amd64_call_reg (code, GP_SCRATCH_REG);
+
+ return code;
+}
+
+#define EMIT_CALL() do { \
+ amd64_set_reg_template (code, GP_SCRATCH_REG); \
+ amd64_call_reg (code, GP_SCRATCH_REG); \
+} while (0);
+
+/* FIXME: Add more instructions */
+#define INST_IGNORES_CFLAGS(ins) (((ins)->opcode == CEE_BR) || ((ins)->opcode == OP_STORE_MEMBASE_IMM) || ((ins)->opcode == OP_STOREI8_MEMBASE_REG))
+
+static void
+peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins, *last_ins = NULL;
+ ins = bb->code;
+
+ while (ins) {
+
+ switch (ins->opcode) {
+ case OP_ICONST:
+ case OP_I8CONST:
+ /* reg = 0 -> XOR (reg, reg) */
+ /* XOR sets cflags on x86, so we cant do it always */
+ if (ins->inst_c0 == 0 && ins->next && INST_IGNORES_CFLAGS (ins->next)) {
+ ins->opcode = CEE_XOR;
+ ins->sreg1 = ins->dreg;
+ ins->sreg2 = ins->dreg;
+ }
+ break;
+ case OP_MUL_IMM:
+ /* remove unnecessary multiplication with 1 */
+ if (ins->inst_imm == 1) {
+ if (ins->dreg != ins->sreg1) {
+ ins->opcode = OP_MOVE;
+ } else {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ }
+ break;
+ case OP_COMPARE_IMM:
+ /* OP_COMPARE_IMM (reg, 0)
+ * -->
+ * OP_AMD64_TEST_NULL (reg)
+ */
+ if (!ins->inst_imm)
+ ins->opcode = OP_AMD64_TEST_NULL;
+ break;
+ case OP_ICOMPARE_IMM:
+ if (!ins->inst_imm)
+ ins->opcode = OP_X86_TEST_NULL;
+ break;
+ case OP_X86_COMPARE_MEMBASE_IMM:
+ /*
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_X86_COMPARE_MEMBASE_IMM offset(basereg), imm
+ * -->
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_COMPARE_IMM reg, imm
+ *
+ * Note: if imm = 0 then OP_COMPARE_IMM replaced with OP_X86_TEST_NULL
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ ins->opcode = OP_COMPARE_IMM;
+ ins->sreg1 = last_ins->sreg1;
+
+ /* check if we can remove cmp reg,0 with test null */
+ if (!ins->inst_imm)
+ ins->opcode = OP_X86_TEST_NULL;
+ }
+
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ /*
+ * Note: if reg1 = reg2 the load op is removed
+ *
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_MOVE reg1, reg2
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG
+ || last_ins->opcode == OP_STORE_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+
+ /*
+ * Note: reg1 must be different from the basereg in the second load
+ * Note: if reg1 = reg2 is equal then second load is removed
+ *
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_MOVE reg1, reg2
+ */
+ } if (last_ins && (last_ins->opcode == OP_LOADI4_MEMBASE
+ || last_ins->opcode == OP_LOAD_MEMBASE) &&
+ ins->inst_basereg != last_ins->dreg &&
+ ins->inst_basereg == last_ins->inst_basereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+
+ if (ins->dreg == last_ins->dreg) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->dreg;
+ }
+
+ //g_assert_not_reached ();
+
+#if 0
+ /*
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ * -->
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_ICONST reg, imm
+ */
+ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM
+ || last_ins->opcode == OP_STORE_MEMBASE_IMM) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_ICONST;
+ ins->inst_c0 = last_ins->inst_imm;
+ g_assert_not_reached (); // check this rule
+#endif
+ }
+ break;
+ case OP_LOADU1_MEMBASE:
+ case OP_LOADI1_MEMBASE:
+ /*
+ * Note: if reg1 = reg2 the load op is removed
+ *
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_MOVE reg1, reg2
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI1_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case OP_LOADU2_MEMBASE:
+ case OP_LOADI2_MEMBASE:
+ /*
+ * Note: if reg1 = reg2 the load op is removed
+ *
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_MOVE reg1, reg2
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI2_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ /*
+ * Removes:
+ *
+ * OP_MOVE reg, reg
+ */
+ if (ins->dreg == ins->sreg1) {
+ if (last_ins)
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ /*
+ * Removes:
+ *
+ * OP_MOVE sreg, dreg
+ * OP_MOVE dreg, sreg
+ */
+ if (last_ins && last_ins->opcode == OP_MOVE &&
+ ins->sreg1 == last_ins->dreg &&
+ ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ break;
+ }
+ last_ins = ins;
+ ins = ins->next;
+ }
+ bb->last_ins = last_ins;
+}
+
+static const int
+branch_cc_table [] = {
+ X86_CC_EQ, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT,
+ X86_CC_NE, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT,
+ X86_CC_O, X86_CC_NO, X86_CC_C, X86_CC_NC
+};
+
+static int
+opcode_to_x86_cond (int opcode)
+{
+ switch (opcode) {
+ case OP_IBEQ:
+ return X86_CC_EQ;
+ case OP_IBNE_UN:
+ return X86_CC_NE;
+ case OP_IBLT:
+ return X86_CC_LT;
+ case OP_IBLT_UN:
+ return X86_CC_LT;
+ case OP_IBGT:
+ return X86_CC_GT;
+ case OP_IBGT_UN:
+ return X86_CC_GT;
+ case OP_IBGE:
+ return X86_CC_GE;
+ case OP_IBGE_UN:
+ return X86_CC_GE;
+ case OP_IBLE:
+ return X86_CC_LE;
+ case OP_IBLE_UN:
+ return X86_CC_LE;
+ case OP_COND_EXC_IOV:
+ return X86_CC_O;
+ case OP_COND_EXC_IC:
+ return X86_CC_C;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return -1;
+}
+
+/*
+ * returns the offset used by spillvar. It allocates a new
+ * spill variable if necessary.
+ */
+static int
+mono_spillvar_offset (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset += sizeof (gpointer);
+ info->offset = - cfg->stack_offset;
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*
+ * returns the offset used by spillvar. It allocates a new
+ * spill float variable if necessary.
+ * (same as mono_spillvar_offset but for float)
+ */
+static int
+mono_spillvar_offset_float (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info_float;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset += sizeof (double);
+ info->offset = - cfg->stack_offset;
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*
+ * Creates a store for spilled floating point items
+ */
+static MonoInst*
+create_spilled_store_float (MonoCompile *cfg, int spill, int reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORER8_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = AMD64_RBP;
+ store->inst_offset = mono_spillvar_offset_float (cfg, spill);
+
+ DEBUG (g_print ("SPILLED FLOAT STORE (%d at 0x%08lx(%%sp)) (from %d)\n", spill, (long)store->inst_offset, reg));
+ return store;
+}
+
+/*
+ * Creates a load for spilled floating point items
+ */
+static MonoInst*
+create_spilled_load_float (MonoCompile *cfg, int spill, int reg, MonoInst *ins)
+{
+ MonoInst *load;
+ MONO_INST_NEW (cfg, load, OP_LOADR8_SPILL_MEMBASE);
+ load->dreg = reg;
+ load->inst_basereg = AMD64_RBP;
+ load->inst_offset = mono_spillvar_offset_float (cfg, spill);
+
+ DEBUG (g_print ("SPILLED FLOAT LOAD (%d at 0x%08lx(%%sp)) (from %d)\n", spill, (long)load->inst_offset, reg));
+ return load;
+}
+
+#define ireg_is_freeable(r) ((r) >= 0 && (r) <= 7 && AMD64_IS_CALLEE_REG ((r)))
+#define freg_is_freeable(r) ((r) >= 0 && (r) <= AMD64_XMM_NREG)
+
+#define reg_is_freeable(r,fp) ((fp) ? freg_is_freeable ((r)) : ireg_is_freeable ((r)))
+#define reg_is_hard(r,fp) ((fp) ? ((r) < MONO_MAX_FREGS) : ((r) < MONO_MAX_IREGS))
+#define reg_is_soft(r,fp) (!reg_is_hard((r),(fp)))
+#define rassign(cfg,reg,fp) ((fp) ? (cfg)->rs->fassign [(reg)] : (cfg)->rs->iassign [(reg)])
+#define sreg1_is_fp(ins) (ins_spec [(ins)->opcode] [MONO_INST_SRC1] == 'f')
+#define sreg2_is_fp(ins) (ins_spec [(ins)->opcode] [MONO_INST_SRC2] == 'f')
+#define dreg_is_fp(ins) (ins_spec [(ins)->opcode] [MONO_INST_DEST] == 'f')
+
+typedef struct {
+ int born_in;
+ int killed_in;
+ int last_use;
+ int prev_use;
+ int flags; /* used to track fp spill/load */
+} RegTrack;
+
+static const char*const * ins_spec = amd64_desc;
+
+static void
+print_ins (int i, MonoInst *ins)
+{
+ const char *spec = ins_spec [ins->opcode];
+ g_print ("\t%-2d %s", i, mono_inst_name (ins->opcode));
+ if (!spec)
+ g_error ("Unknown opcode: %s\n", mono_inst_name (ins->opcode));
+ if (spec [MONO_INST_DEST]) {
+ gboolean fp = (spec [MONO_INST_DEST] == 'f');
+ if (reg_is_soft (ins->dreg, fp))
+ g_print (" R%d <-", ins->dreg);
+ else
+ g_print (" %s <-", mono_amd64_regname (ins->dreg, fp));
+ }
+ if (spec [MONO_INST_SRC1]) {
+ gboolean fp = (spec [MONO_INST_SRC1] == 'f');
+ if (reg_is_soft (ins->sreg1, fp))
+ g_print (" R%d", ins->sreg1);
+ else
+ g_print (" %s", mono_amd64_regname (ins->sreg1, fp));
+ }
+ if (spec [MONO_INST_SRC2]) {
+ gboolean fp = (spec [MONO_INST_SRC2] == 'f');
+ if (reg_is_soft (ins->sreg2, fp))
+ g_print (" R%d", ins->sreg2);
+ else
+ g_print (" %s", mono_amd64_regname (ins->sreg2, fp));
+ }
+ if (spec [MONO_INST_CLOB])
+ g_print (" clobbers: %c", spec [MONO_INST_CLOB]);
+ g_print ("\n");
+}
+
+static void
+print_regtrack (RegTrack *t, int num)
+{
+ int i;
+ char buf [32];
+ const char *r;
+
+ for (i = 0; i < num; ++i) {
+ if (!t [i].born_in)
+ continue;
+ if (i >= MONO_MAX_IREGS) {
+ g_snprintf (buf, sizeof(buf), "R%d", i);
+ r = buf;
+ } else
+ r = mono_arch_regname (i);
+ g_print ("liveness: %s [%d - %d]\n", r, t [i].born_in, t[i].last_use);
+ }
+}
+
+typedef struct InstList InstList;
+
+struct InstList {
+ InstList *prev;
+ InstList *next;
+ MonoInst *data;
+};
+
+static inline InstList*
+inst_list_prepend (MonoMemPool *pool, InstList *list, MonoInst *data)
+{
+ InstList *item = mono_mempool_alloc (pool, sizeof (InstList));
+ item->data = data;
+ item->prev = NULL;
+ item->next = list;
+ if (list)
+ list->prev = item;
+ return item;
+}
+
+/*
+ * Force the spilling of the variable in the symbolic register 'reg'.
+ */
+static int
+get_register_force_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, int reg, gboolean fp)
+{
+ MonoInst *load;
+ int i, sel, spill;
+ int *assign, *symbolic;
+
+ if (fp) {
+ assign = cfg->rs->fassign;
+ symbolic = cfg->rs->fsymbolic;
+ }
+ else {
+ assign = cfg->rs->iassign;
+ symbolic = cfg->rs->isymbolic;
+ }
+
+ sel = assign [reg];
+ /*i = cfg->rs->isymbolic [sel];
+ g_assert (i == reg);*/
+ i = reg;
+ spill = ++cfg->spill_count;
+ assign [i] = -spill - 1;
+ if (fp)
+ mono_regstate_free_float (cfg->rs, sel);
+ else
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ if (fp)
+ MONO_INST_NEW (cfg, load, OP_LOADR8_MEMBASE);
+ else
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = AMD64_RBP;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08lx(%%ebp)) R%d (freed %s)\n", spill, (long)load->inst_offset, i, mono_amd64_regname (sel, fp)));
+ if (fp)
+ i = mono_regstate_alloc_float (cfg->rs, 1 << sel);
+ else
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static int
+get_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg, gboolean fp)
+{
+ MonoInst *load;
+ int i, sel, spill;
+ int *assign, *symbolic;
+
+ if (fp) {
+ assign = cfg->rs->fassign;
+ symbolic = cfg->rs->fsymbolic;
+ }
+ else {
+ assign = cfg->rs->iassign;
+ symbolic = cfg->rs->isymbolic;
+ }
+
+ DEBUG (g_print ("\tstart regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if ((sreg1_is_fp (ins) == fp) && (reg != ins->sreg1) && (reg_is_freeable (ins->sreg1, fp) || (reg_is_soft (ins->sreg1, fp) && rassign (cfg, ins->sreg1, fp) >= 0))) {
+ if (reg_is_soft (ins->sreg1, fp))
+ regmask &= ~ (1 << rassign (cfg, ins->sreg1, fp));
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("\t\texcluding sreg1 %s\n", mono_amd64_regname (ins->sreg1, fp)));
+ }
+ if ((sreg2_is_fp (ins) == fp) && (reg != ins->sreg2) && (reg_is_freeable (ins->sreg2, fp) || (reg_is_soft (ins->sreg2, fp) && rassign (cfg, ins->sreg2, fp) >= 0))) {
+ if (reg_is_soft (ins->sreg2, fp))
+ regmask &= ~ (1 << rassign (cfg, ins->sreg2, fp));
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("\t\texcluding sreg2 %s %d\n", mono_amd64_regname (ins->sreg2, fp), ins->sreg2));
+ }
+ if ((dreg_is_fp (ins) == fp) && (reg != ins->dreg) && reg_is_freeable (ins->dreg, fp)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("\t\texcluding dreg %s\n", mono_amd64_regname (ins->dreg, fp)));
+ }
+
+ DEBUG (g_print ("\t\tavailable regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ if (fp) {
+ for (i = 0; i < MONO_MAX_FREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("\t\tselected register %s has assignment %d\n", mono_arch_fregname (sel), cfg->rs->fassign [sel]));
+ break;
+ }
+ }
+
+ i = cfg->rs->fsymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->fassign [i] = -spill - 1;
+ mono_regstate_free_float (cfg->rs, sel);
+ }
+ else {
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("\t\tselected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->iassign [sel]));
+ break;
+ }
+ }
+
+ i = cfg->rs->isymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ }
+
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, fp ? OP_LOADR8_MEMBASE : OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = AMD64_RBP;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("\tSPILLED LOAD (%d at 0x%08lx(%%ebp)) R%d (freed %s)\n", spill, (long)load->inst_offset, i, mono_amd64_regname (sel, fp)));
+ if (fp)
+ i = mono_regstate_alloc_float (cfg->rs, 1 << sel);
+ else
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static MonoInst*
+create_copy_ins (MonoCompile *cfg, int dest, int src, MonoInst *ins, gboolean fp)
+{
+ MonoInst *copy;
+
+ if (fp)
+ MONO_INST_NEW (cfg, copy, OP_FMOVE);
+ else
+ MONO_INST_NEW (cfg, copy, OP_MOVE);
+
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n", mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+static MonoInst*
+create_spilled_store (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins, gboolean fp)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, fp ? OP_STORER8_MEMBASE_REG : OP_STORE_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = AMD64_RBP;
+ store->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("\tSPILLED STORE (%d at 0x%08lx(%%ebp)) R%d (from %s)\n", spill, (long)store->inst_offset, prev_reg, mono_amd64_regname (reg, fp)));
+ return store;
+}
+
+static void
+insert_before_ins (MonoInst *ins, InstList *item, MonoInst* to_insert)
+{
+ MonoInst *prev;
+ if (item->next) {
+ prev = item->next->data;
+
+ while (prev->next != ins)
+ prev = prev->next;
+ to_insert->next = ins;
+ prev->next = to_insert;
+ } else {
+ to_insert->next = ins;
+ }
+ /*
+ * needed otherwise in the next instruction we can add an ins to the
+ * end and that would get past this instruction.
+ */
+ item->data = to_insert;
+}
+
+/* flags used in reginfo->flags */
+enum {
+ MONO_X86_FP_NEEDS_LOAD_SPILL = 1 << 0,
+ MONO_X86_FP_NEEDS_SPILL = 1 << 1,
+ MONO_X86_FP_NEEDS_LOAD = 1 << 2,
+ MONO_X86_REG_NOT_ECX = 1 << 3,
+ MONO_X86_REG_EAX = 1 << 4,
+ MONO_X86_REG_EDX = 1 << 5,
+ MONO_X86_REG_ECX = 1 << 6
+};
+
+static int
+mono_amd64_alloc_int_reg (MonoCompile *cfg, InstList *tmp, MonoInst *ins, guint32 dest_mask, int sym_reg, int flags)
+{
+ int val;
+ int test_mask = dest_mask;
+
+ if (flags & MONO_X86_REG_EAX)
+ test_mask &= (1 << AMD64_RAX);
+ else if (flags & MONO_X86_REG_EDX)
+ test_mask &= (1 << AMD64_RDX);
+ else if (flags & MONO_X86_REG_ECX)
+ test_mask &= (1 << AMD64_RCX);
+ else if (flags & MONO_X86_REG_NOT_ECX)
+ test_mask &= ~ (1 << AMD64_RCX);
+
+ val = mono_regstate_alloc_int (cfg->rs, test_mask);
+ if (val >= 0 && test_mask != dest_mask)
+ DEBUG(g_print ("\tUsed flag to allocate reg %s for R%u\n", mono_arch_regname (val), sym_reg));
+
+ if (val < 0 && (flags & MONO_X86_REG_NOT_ECX)) {
+ DEBUG(g_print ("\tFailed to allocate flag suggested mask (%u) but exluding ECX\n", test_mask));
+ val = mono_regstate_alloc_int (cfg->rs, (dest_mask & (~1 << AMD64_RCX)));
+ }
+
+ if (val < 0) {
+ val = mono_regstate_alloc_int (cfg->rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, sym_reg, FALSE);
+ }
+
+ return val;
+}
+
+static int
+mono_amd64_alloc_float_reg (MonoCompile *cfg, InstList *tmp, MonoInst *ins, guint32 dest_mask, int sym_reg)
+{
+ int val;
+
+ val = mono_regstate_alloc_float (cfg->rs, dest_mask);
+
+ if (val < 0) {
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, sym_reg, TRUE);
+ }
+
+ return val;
+}
+
+
+/*#include "cprop.c"*/
+
+/*
+ * Local register allocation.
+ * We first scan the list of instructions and we save the liveness info of
+ * each register (when the register is first used, when it's value is set etc.).
+ * We also reverse the list of instructions (in the InstList list) because assigning
+ * registers backwards allows for more tricks to be used.
+ */
+void
+mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoRegState *rs = cfg->rs;
+ int i, val, fpcount;
+ RegTrack *reginfo, *reginfof;
+ RegTrack *reginfo1, *reginfo2, *reginfod;
+ InstList *tmp, *reversed = NULL;
+ const char *spec;
+ guint32 src1_mask, src2_mask, dest_mask;
+ GList *fspill_list = NULL;
+ int fspill = 0;
+
+ if (!bb->code)
+ return;
+ rs->next_vireg = bb->max_ireg;
+ rs->next_vfreg = bb->max_freg;
+ mono_regstate_assign (rs);
+ reginfo = g_malloc0 (sizeof (RegTrack) * rs->next_vireg);
+ reginfof = g_malloc0 (sizeof (RegTrack) * rs->next_vfreg);
+ rs->ifree_mask = AMD64_CALLEE_REGS;
+ rs->ffree_mask = AMD64_CALLEE_FREGS;
+
+ if (!use_sse2)
+ /* The fp stack is 6 entries deep */
+ rs->ffree_mask = 0x3f;
+
+ ins = bb->code;
+
+ /*if (cfg->opt & MONO_OPT_COPYPROP)
+ local_copy_prop (cfg, ins);*/
+
+ i = 1;
+ fpcount = 0;
+ DEBUG (g_print ("LOCAL regalloc: basic block: %d\n", bb->block_num));
+ /* forward pass on the instructions to collect register liveness info */
+ while (ins) {
+ spec = ins_spec [ins->opcode];
+
+ DEBUG (print_ins (i, ins));
+
+ if (spec [MONO_INST_SRC1]) {
+ if (spec [MONO_INST_SRC1] == 'f') {
+ reginfo1 = reginfof;
+
+ if (!use_sse2) {
+ GList *spill;
+
+ spill = g_list_first (fspill_list);
+ if (spill && fpcount < FPSTACK_SIZE) {
+ reginfo1 [ins->sreg1].flags |= MONO_X86_FP_NEEDS_LOAD;
+ fspill_list = g_list_remove (fspill_list, spill->data);
+ } else
+ fpcount--;
+ }
+ }
+ else
+ reginfo1 = reginfo;
+ reginfo1 [ins->sreg1].prev_use = reginfo1 [ins->sreg1].last_use;
+ reginfo1 [ins->sreg1].last_use = i;
+ if (spec [MONO_INST_SRC1] == 'L') {
+ /* The virtual register is allocated sequentially */
+ reginfo1 [ins->sreg1 + 1].prev_use = reginfo1 [ins->sreg1 + 1].last_use;
+ reginfo1 [ins->sreg1 + 1].last_use = i;
+ if (reginfo1 [ins->sreg1 + 1].born_in == 0 || reginfo1 [ins->sreg1 + 1].born_in > i)
+ reginfo1 [ins->sreg1 + 1].born_in = i;
+
+ reginfo1 [ins->sreg1].flags |= MONO_X86_REG_EAX;
+ reginfo1 [ins->sreg1 + 1].flags |= MONO_X86_REG_EDX;
+ }
+ } else {
+ ins->sreg1 = -1;
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (spec [MONO_INST_SRC2] == 'f') {
+ reginfo2 = reginfof;
+
+ if (!use_sse2) {
+ GList *spill;
+
+ spill = g_list_first (fspill_list);
+ if (spill) {
+ reginfo2 [ins->sreg2].flags |= MONO_X86_FP_NEEDS_LOAD;
+ fspill_list = g_list_remove (fspill_list, spill->data);
+ if (fpcount >= FPSTACK_SIZE) {
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ reginfo2 [ins->sreg2].flags |= MONO_X86_FP_NEEDS_LOAD_SPILL;
+ }
+ } else
+ fpcount--;
+ }
+ }
+ else
+ reginfo2 = reginfo;
+ reginfo2 [ins->sreg2].prev_use = reginfo2 [ins->sreg2].last_use;
+ reginfo2 [ins->sreg2].last_use = i;
+ if (spec [MONO_INST_SRC2] == 'L') {
+ /* The virtual register is allocated sequentially */
+ reginfo2 [ins->sreg2 + 1].prev_use = reginfo2 [ins->sreg2 + 1].last_use;
+ reginfo2 [ins->sreg2 + 1].last_use = i;
+ if (reginfo2 [ins->sreg2 + 1].born_in == 0 || reginfo2 [ins->sreg2 + 1].born_in > i)
+ reginfo2 [ins->sreg2 + 1].born_in = i;
+ }
+ if (spec [MONO_INST_CLOB] == 's') {
+ reginfo2 [ins->sreg1].flags |= MONO_X86_REG_NOT_ECX;
+ reginfo2 [ins->sreg2].flags |= MONO_X86_REG_ECX;
+ }
+ } else {
+ ins->sreg2 = -1;
+ }
+ if (spec [MONO_INST_DEST]) {
+ if (spec [MONO_INST_DEST] == 'f') {
+ reginfod = reginfof;
+ if (!use_sse2 && (spec [MONO_INST_CLOB] != 'm')) {
+ if (fpcount >= FPSTACK_SIZE) {
+ reginfod [ins->dreg].flags |= MONO_X86_FP_NEEDS_SPILL;
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ fpcount--;
+ }
+ fpcount++;
+ }
+ }
+ else
+ reginfod = reginfo;
+ if (spec [MONO_INST_DEST] != 'b') /* it's not just a base register */
+ reginfod [ins->dreg].killed_in = i;
+ reginfod [ins->dreg].prev_use = reginfod [ins->dreg].last_use;
+ reginfod [ins->dreg].last_use = i;
+ if (reginfod [ins->dreg].born_in == 0 || reginfod [ins->dreg].born_in > i)
+ reginfod [ins->dreg].born_in = i;
+ if (spec [MONO_INST_DEST] == 'l' || spec [MONO_INST_DEST] == 'L') {
+ /* The virtual register is allocated sequentially */
+ reginfod [ins->dreg + 1].prev_use = reginfod [ins->dreg + 1].last_use;
+ reginfod [ins->dreg + 1].last_use = i;
+ if (reginfod [ins->dreg + 1].born_in == 0 || reginfod [ins->dreg + 1].born_in > i)
+ reginfod [ins->dreg + 1].born_in = i;
+
+ reginfod [ins->dreg].flags |= MONO_X86_REG_EAX;
+ reginfod [ins->dreg + 1].flags |= MONO_X86_REG_EDX;
+ }
+ } else {
+ ins->dreg = -1;
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ /* A call instruction implicitly uses all registers in call->out_ireg_args */
+
+ MonoCallInst *call = (MonoCallInst*)ins;
+ GSList *list;
+
+ list = call->out_ireg_args;
+ if (list) {
+ while (list) {
+ guint64 regpair;
+ int reg, hreg;
+
+ regpair = (guint64) (list->data);
+ hreg = regpair >> 32;
+ reg = regpair & 0xffffffff;
+
+ reginfo [reg].prev_use = reginfo [reg].last_use;
+ reginfo [reg].last_use = i;
+
+ list = g_slist_next (list);
+ }
+ }
+
+ list = call->out_freg_args;
+ if (use_sse2 && list) {
+ while (list) {
+ guint64 regpair;
+ int reg, hreg;
+
+ regpair = (guint64) (list->data);
+ hreg = regpair >> 32;
+ reg = regpair & 0xffffffff;
+
+ reginfof [reg].prev_use = reginfof [reg].last_use;
+ reginfof [reg].last_use = i;
+
+ list = g_slist_next (list);
+ }
+ }
+ }
+
+ reversed = inst_list_prepend (cfg->mempool, reversed, ins);
+ ++i;
+ ins = ins->next;
+ }
+
+ // todo: check if we have anything left on fp stack, in verify mode?
+ fspill = 0;
+
+ DEBUG (print_regtrack (reginfo, rs->next_vireg));
+ DEBUG (print_regtrack (reginfof, rs->next_vfreg));
+ tmp = reversed;
+ while (tmp) {
+ int prev_dreg, prev_sreg1, prev_sreg2, clob_dreg;
+ dest_mask = src1_mask = src2_mask = AMD64_CALLEE_REGS;
+ --i;
+ ins = tmp->data;
+ spec = ins_spec [ins->opcode];
+ prev_dreg = -1;
+ clob_dreg = -1;
+ DEBUG (g_print ("processing:"));
+ DEBUG (print_ins (i, ins));
+ if (spec [MONO_INST_CLOB] == 's') {
+ if (rs->ifree_mask & (1 << AMD64_RCX)) {
+ DEBUG (g_print ("\tshortcut assignment of R%d to ECX\n", ins->sreg2));
+ if (ins->sreg2 < MONO_MAX_IREGS) {
+ /* Argument already in hard reg, need to copy */
+ MonoInst *copy = create_copy_ins (cfg, AMD64_RCX, ins->sreg2, NULL, FALSE);
+ insert_before_ins (ins, tmp, copy);
+ }
+ rs->iassign [ins->sreg2] = AMD64_RCX;
+ rs->isymbolic [AMD64_RCX] = ins->sreg2;
+ ins->sreg2 = AMD64_RCX;
+ rs->ifree_mask &= ~ (1 << AMD64_RCX);
+ } else {
+ int need_ecx_spill = TRUE;
+ /*
+ * we first check if src1/dreg is already assigned a register
+ * and then we force a spill of the var assigned to ECX.
+ */
+ /* the destination register can't be ECX */
+ dest_mask &= ~ (1 << AMD64_RCX);
+ src1_mask &= ~ (1 << AMD64_RCX);
+ val = rs->iassign [ins->dreg];
+ /*
+ * the destination register is already assigned to ECX:
+ * we need to allocate another register for it and then
+ * copy from this to ECX.
+ */
+ if (val == AMD64_RCX && ins->dreg != ins->sreg2) {
+ int new_dest;
+ new_dest = mono_amd64_alloc_int_reg (cfg, tmp, ins, dest_mask, ins->dreg, reginfo [ins->dreg].flags);
+ g_assert (new_dest >= 0);
+ DEBUG (g_print ("\tclob:s changing dreg R%d to %s from ECX\n", ins->dreg, mono_arch_regname (new_dest)));
+
+ rs->isymbolic [new_dest] = ins->dreg;
+ rs->iassign [ins->dreg] = new_dest;
+ clob_dreg = ins->dreg;
+ ins->dreg = new_dest;
+ create_copy_ins (cfg, AMD64_RCX, new_dest, ins, FALSE);
+ need_ecx_spill = FALSE;
+ /*DEBUG (g_print ("\tforced spill of R%d\n", ins->dreg));
+ val = get_register_force_spilling (cfg, tmp, ins, ins->dreg);
+ rs->iassign [ins->dreg] = val;
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;*/
+ }
+ val = rs->iassign [ins->sreg2];
+ if (val >= 0 && val != AMD64_RCX) {
+ MonoInst *move = create_copy_ins (cfg, AMD64_RCX, val, NULL, FALSE);
+ DEBUG (g_print ("\tmoved arg from R%d (%d) to ECX\n", val, ins->sreg2));
+ move->next = ins;
+ g_assert_not_reached ();
+ /* FIXME: where is move connected to the instruction list? */
+ //tmp->prev->data->next = move;
+ }
+ else
+ if (val == AMD64_RCX) {
+ if (ins->sreg2 < MONO_MAX_IREGS) {
+ /* sreg2 is already assigned to a hard reg, need to copy */
+ MonoInst *copy = create_copy_ins (cfg, AMD64_RCX, ins->sreg2, NULL, FALSE);
+ insert_before_ins (ins, tmp, copy);
+ }
+ need_ecx_spill = FALSE;
+ }
+ if (need_ecx_spill && !(rs->ifree_mask & (1 << AMD64_RCX))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [AMD64_RCX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [AMD64_RCX], FALSE);
+ mono_regstate_free_int (rs, AMD64_RCX);
+ }
+ /* force-set sreg2 */
+ rs->iassign [ins->sreg2] = AMD64_RCX;
+ rs->isymbolic [AMD64_RCX] = ins->sreg2;
+ ins->sreg2 = AMD64_RCX;
+ rs->ifree_mask &= ~ (1 << AMD64_RCX);
+ }
+ } else if (spec [MONO_INST_CLOB] == 'd') { /* division */
+ int dest_reg = AMD64_RAX;
+ int clob_reg = AMD64_RDX;
+ if (spec [MONO_INST_DEST] == 'd') {
+ dest_reg = AMD64_RDX; /* reminder */
+ clob_reg = AMD64_RAX;
+ }
+ val = rs->iassign [ins->dreg];
+ if (0 && val >= 0 && val != dest_reg && !(rs->ifree_mask & (1 << dest_reg))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [dest_reg]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [dest_reg], FALSE);
+ mono_regstate_free_int (rs, dest_reg);
+ }
+ if (val < 0) {
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ int spill = -val -1;
+ dest_mask = 1 << clob_reg;
+ prev_dreg = ins->dreg;
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg, FALSE);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins, FALSE);
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (val != dest_reg) { /* force a copy */
+ create_copy_ins (cfg, val, dest_reg, ins, FALSE);
+ }
+ } else {
+ DEBUG (g_print ("\tshortcut assignment of R%d to %s\n", ins->dreg, mono_arch_regname (dest_reg)));
+ prev_dreg = ins->dreg;
+ rs->iassign [ins->dreg] = dest_reg;
+ rs->isymbolic [dest_reg] = ins->dreg;
+ ins->dreg = dest_reg;
+ rs->ifree_mask &= ~ (1 << dest_reg);
+ }
+ } else {
+ //DEBUG (g_print ("dest reg in div assigned: %s\n", mono_arch_regname (val)));
+ if (val != dest_reg) { /* force a copy */
+ create_copy_ins (cfg, val, dest_reg, ins, FALSE);
+ if (!(rs->ifree_mask & (1 << dest_reg)) && rs->isymbolic [dest_reg] >= MONO_MAX_IREGS) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [dest_reg]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [dest_reg], FALSE);
+ mono_regstate_free_int (rs, dest_reg);
+ }
+ }
+ }
+ if (!(rs->ifree_mask & (1 << clob_reg)) && (clob_reg != val) && (rs->isymbolic [clob_reg] >= 8)) {
+ DEBUG (g_print ("\tforced spill of clobbered reg R%d\n", rs->isymbolic [clob_reg]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [clob_reg], FALSE);
+ mono_regstate_free_int (rs, clob_reg);
+ }
+ src1_mask = 1 << AMD64_RAX;
+ src2_mask = 1 << AMD64_RCX;
+ }
+ if (spec [MONO_INST_DEST] == 'l') {
+ int hreg;
+ val = rs->iassign [ins->dreg];
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ if (spec [MONO_INST_CLOB] == 's' && clob_dreg != -1)
+ hreg = clob_dreg + 1;
+ else
+ hreg = ins->dreg + 1;
+
+ /* base prev_dreg on fixed hreg, handle clob case */
+ val = hreg - 1;
+
+ if (val != rs->isymbolic [AMD64_RAX] && !(rs->ifree_mask & (1 << AMD64_RAX))) {
+ DEBUG (g_print ("\t(long-low) forced spill of R%d\n", rs->isymbolic [AMD64_RAX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [AMD64_RAX], FALSE);
+ mono_regstate_free_int (rs, AMD64_RAX);
+ }
+ if (hreg != rs->isymbolic [AMD64_RDX] && !(rs->ifree_mask & (1 << AMD64_RDX))) {
+ DEBUG (g_print ("\t(long-high) forced spill of R%d\n", rs->isymbolic [AMD64_RDX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [AMD64_RDX], FALSE);
+ mono_regstate_free_int (rs, AMD64_RDX);
+ }
+ }
+
+ /*
+ * TRACK DREG
+ */
+ if (spec [MONO_INST_DEST] == 'f') {
+ if (use_sse2) {
+ /* Allocate an XMM reg the same way as an int reg */
+ if (reg_is_soft (ins->dreg, TRUE)) {
+ val = rs->fassign [ins->dreg];
+ prev_dreg = ins->dreg;
+
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_float_reg (cfg, tmp, ins, AMD64_CALLEE_FREGS, ins->dreg);
+ rs->fassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins, TRUE);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_amd64_regname (val, TRUE), ins->dreg));
+ rs->fsymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ }
+ }
+ else if (spec [MONO_INST_CLOB] != 'm') {
+ if (reginfof [ins->dreg].flags & MONO_X86_FP_NEEDS_SPILL) {
+ GList *spill_node;
+ MonoInst *store;
+ spill_node = g_list_first (fspill_list);
+ g_assert (spill_node);
+
+ store = create_spilled_store_float (cfg, GPOINTER_TO_INT (spill_node->data), ins->dreg, ins);
+ insert_before_ins (ins, tmp, store);
+ fspill_list = g_list_remove (fspill_list, spill_node->data);
+ fspill--;
+ }
+ }
+ } else if (spec [MONO_INST_DEST] == 'L') {
+ int hreg;
+ val = rs->iassign [ins->dreg];
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ if (spec [MONO_INST_CLOB] == 's' && clob_dreg != -1)
+ hreg = clob_dreg + 1;
+ else
+ hreg = ins->dreg + 1;
+
+ /* base prev_dreg on fixed hreg, handle clob case */
+ prev_dreg = hreg - 1;
+
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_int_reg (cfg, tmp, ins, dest_mask, ins->dreg, reginfo [ins->dreg].flags);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins, FALSE);
+ }
+
+ DEBUG (g_print ("\tassigned dreg (long) %s to dest R%d\n", mono_arch_regname (val), hreg - 1));
+
+ rs->isymbolic [val] = hreg - 1;
+ ins->dreg = val;
+
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_int_reg (cfg, tmp, ins, dest_mask, hreg, reginfo [hreg].flags);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins, FALSE);
+ }
+
+ DEBUG (g_print ("\tassigned hreg (long-high) %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+ /* save reg allocating into unused */
+ ins->unused = val;
+
+ /* check if we can free our long reg */
+ if (reg_is_freeable (val, FALSE) && hreg >= 0 && reginfo [hreg].born_in >= i) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (val), hreg, reginfo [hreg].born_in));
+ mono_regstate_free_int (rs, val);
+ }
+ }
+ else if (ins->dreg >= MONO_MAX_IREGS) {
+ int hreg;
+ val = rs->iassign [ins->dreg];
+ if (spec [MONO_INST_DEST] == 'l') {
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ if (spec [MONO_INST_CLOB] == 's' && clob_dreg != -1)
+ hreg = clob_dreg + 1;
+ else
+ hreg = ins->dreg + 1;
+
+ /* base prev_dreg on fixed hreg, handle clob case */
+ prev_dreg = hreg - 1;
+ } else
+ prev_dreg = ins->dreg;
+
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_int_reg (cfg, tmp, ins, dest_mask, ins->dreg, reginfo [ins->dreg].flags);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins, FALSE);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ /* handle cases where lreg needs to be eax:edx */
+ if (spec [MONO_INST_DEST] == 'l') {
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ int hreg = prev_dreg + 1;
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_int_reg (cfg, tmp, ins, dest_mask, hreg, reginfo [hreg].flags);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins, FALSE);
+ }
+ DEBUG (g_print ("\tassigned hreg %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+ if (ins->dreg == AMD64_RAX) {
+ if (val != AMD64_RDX)
+ create_copy_ins (cfg, val, AMD64_RDX, ins, FALSE);
+ } else if (ins->dreg == AMD64_RDX) {
+ if (val == AMD64_RAX) {
+ /* swap */
+ g_assert_not_reached ();
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, val, AMD64_RDX, ins, FALSE);
+ create_copy_ins (cfg, ins->dreg, AMD64_RAX, ins, FALSE);
+ }
+ } else {
+ if (val == AMD64_RDX) {
+ create_copy_ins (cfg, ins->dreg, AMD64_RAX, ins, FALSE);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, val, AMD64_RDX, ins, FALSE);
+ create_copy_ins (cfg, ins->dreg, AMD64_RAX, ins, FALSE);
+ }
+ }
+ if (reg_is_freeable (val, FALSE) && hreg >= 0 && reginfo [hreg].born_in >= i) {
+ DEBUG (g_print ("\tfreeable %s (R%d)\n", mono_arch_regname (val), hreg));
+ mono_regstate_free_int (rs, val);
+ }
+ } else if (spec [MONO_INST_DEST] == 'a' && ins->dreg != AMD64_RAX && spec [MONO_INST_CLOB] != 'd') {
+ /* this instruction only outputs to EAX, need to copy */
+ create_copy_ins (cfg, ins->dreg, AMD64_RAX, ins, FALSE);
+ } else if (spec [MONO_INST_DEST] == 'd' && ins->dreg != AMD64_RDX && spec [MONO_INST_CLOB] != 'd') {
+ create_copy_ins (cfg, ins->dreg, AMD64_RDX, ins, FALSE);
+ }
+ }
+
+ if (use_sse2 && spec [MONO_INST_DEST] == 'f' && reg_is_freeable (ins->dreg, TRUE) && prev_dreg >= 0 && reginfof [prev_dreg].born_in >= i) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_fregname (ins->dreg), prev_dreg, reginfof [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ }
+ if (spec [MONO_INST_DEST] != 'f' && reg_is_freeable (ins->dreg, FALSE) && prev_dreg >= 0 && reginfo [prev_dreg].born_in >= i) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_int (rs, ins->dreg);
+ }
+
+ /* put src1 in EAX if it needs to be */
+ if (spec [MONO_INST_SRC1] == 'a') {
+ if (!(rs->ifree_mask & (1 << AMD64_RAX))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [AMD64_RAX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [AMD64_RAX], FALSE);
+ mono_regstate_free_int (rs, AMD64_RAX);
+ }
+ if (ins->sreg1 < MONO_MAX_IREGS) {
+ /* The argument is already in a hard reg, need to copy */
+ MonoInst *copy = create_copy_ins (cfg, AMD64_RAX, ins->sreg1, NULL, FALSE);
+ insert_before_ins (ins, tmp, copy);
+ }
+ /* force-set sreg1 */
+ rs->iassign [ins->sreg1] = AMD64_RAX;
+ rs->isymbolic [AMD64_RAX] = ins->sreg1;
+ ins->sreg1 = AMD64_RAX;
+ rs->ifree_mask &= ~ (1 << AMD64_RAX);
+ }
+
+ /*
+ * TRACK SREG1
+ */
+ if (spec [MONO_INST_SRC1] == 'f') {
+ if (use_sse2) {
+ if (reg_is_soft (ins->sreg1, TRUE)) {
+ val = rs->fassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_float_reg (cfg, tmp, ins, AMD64_CALLEE_FREGS, ins->sreg1);
+ rs->fassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_fregname (val), ins->sreg1));
+ if (spill) {
+ MonoInst *store = create_spilled_store (cfg, spill, val, prev_sreg1, NULL, TRUE);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->fsymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ }
+ else
+ if (reginfof [ins->sreg1].flags & MONO_X86_FP_NEEDS_LOAD) {
+ MonoInst *load;
+ MonoInst *store = NULL;
+
+ if (reginfof [ins->sreg1].flags & MONO_X86_FP_NEEDS_LOAD_SPILL) {
+ GList *spill_node;
+ spill_node = g_list_first (fspill_list);
+ g_assert (spill_node);
+
+ store = create_spilled_store_float (cfg, GPOINTER_TO_INT (spill_node->data), ins->sreg1, ins);
+ fspill_list = g_list_remove (fspill_list, spill_node->data);
+ }
+
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ load = create_spilled_load_float (cfg, fspill, ins->sreg1, ins);
+ insert_before_ins (ins, tmp, load);
+ if (store)
+ insert_before_ins (load, tmp, store);
+ }
+ } else if ((spec [MONO_INST_DEST] == 'L') && (spec [MONO_INST_SRC1] == 'L')) {
+ /* force source to be same as dest */
+ rs->iassign [ins->sreg1] = ins->dreg;
+ rs->iassign [ins->sreg1 + 1] = ins->unused;
+
+ DEBUG (g_print ("\tassigned sreg1 (long) %s to sreg1 R%d\n", mono_arch_regname (ins->dreg), ins->sreg1));
+ DEBUG (g_print ("\tassigned sreg1 (long-high) %s to sreg1 R%d\n", mono_arch_regname (ins->unused), ins->sreg1 + 1));
+
+ ins->sreg1 = ins->dreg;
+ /*
+ * No need for saving the reg, we know that src1=dest in this cases
+ * ins->inst_c0 = ins->unused;
+ */
+
+ /* make sure that we remove them from free mask */
+ rs->ifree_mask &= ~ (1 << ins->dreg);
+ rs->ifree_mask &= ~ (1 << ins->unused);
+ }
+ else if (ins->sreg1 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ if (0 && (ins->opcode == OP_MOVE)) {
+ /*
+ * small optimization: the dest register is already allocated
+ * but the src one is not: we can simply assign the same register
+ * here and peephole will get rid of the instruction later.
+ * This optimization may interfere with the clobbering handling:
+ * it removes a mov operation that will be added again to handle clobbering.
+ * There are also some other issues that should with make testjit.
+ */
+ mono_regstate_alloc_int (rs, 1 << ins->dreg);
+ val = rs->iassign [ins->sreg1] = ins->dreg;
+ //g_assert (val >= 0);
+ DEBUG (g_print ("\tfast assigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ } else {
+ //g_assert (val == -1); /* source cannot be spilled */
+ val = mono_amd64_alloc_int_reg (cfg, tmp, ins, src1_mask, ins->sreg1, reginfo [ins->sreg1].flags);
+ rs->iassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ }
+ if (spill) {
+ MonoInst *store = create_spilled_store (cfg, spill, val, prev_sreg1, NULL, FALSE);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->isymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+
+ /* handle clobbering of sreg1 */
+ if (((spec [MONO_INST_DEST] == 'f' && spec [MONO_INST_SRC1] == 'f' && use_sse2) || spec [MONO_INST_CLOB] == '1' || spec [MONO_INST_CLOB] == 's') && ins->dreg != ins->sreg1) {
+ MonoInst *sreg2_copy = NULL;
+
+ gboolean fp = (spec [MONO_INST_SRC1] == 'f');
+
+ if (ins->dreg == ins->sreg2) {
+ /*
+ * copying sreg1 to dreg could clobber sreg2, so allocate a new
+ * register for it.
+ */
+ int reg2 = 0;
+
+ if (fp)
+ reg2 = mono_amd64_alloc_float_reg (cfg, tmp, ins, AMD64_CALLEE_FREGS, ins->sreg2);
+ else
+ reg2 = mono_amd64_alloc_int_reg (cfg, tmp, ins, dest_mask, ins->sreg2, 0);
+
+ DEBUG (g_print ("\tneed to copy sreg2 %s to reg %s\n", mono_amd64_regname (ins->sreg2, fp), mono_amd64_regname (reg2, fp)));
+ sreg2_copy = create_copy_ins (cfg, reg2, ins->sreg2, NULL, fp);
+ prev_sreg2 = ins->sreg2 = reg2;
+ }
+
+ MonoInst *copy = create_copy_ins (cfg, ins->dreg, ins->sreg1, NULL, fp);
+ DEBUG (g_print ("\tneed to copy sreg1 %s to dreg %s\n", mono_amd64_regname (ins->sreg1, fp), mono_amd64_regname (ins->dreg, fp)));
+ insert_before_ins (ins, tmp, copy);
+
+ if (sreg2_copy)
+ insert_before_ins (copy, tmp, sreg2_copy);
+
+ /* we set sreg1 to dest as well */
+ prev_sreg1 = ins->sreg1 = ins->dreg;
+ src2_mask &= ~ (1 << ins->dreg);
+ }
+
+ /*
+ * TRACK SREG2
+ */
+ if (spec [MONO_INST_SRC2] == 'f') {
+ if (use_sse2) {
+ if (reg_is_soft (ins->sreg2, TRUE)) {
+ val = rs->fassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_float_reg (cfg, tmp, ins, AMD64_CALLEE_FREGS, ins->sreg2);
+ rs->fassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_fregname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_sreg2, ins, TRUE);
+ }
+ rs->fsymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+ }
+ else
+ if (reginfof [ins->sreg2].flags & MONO_X86_FP_NEEDS_LOAD) {
+ MonoInst *load;
+ MonoInst *store = NULL;
+
+ if (reginfof [ins->sreg2].flags & MONO_X86_FP_NEEDS_LOAD_SPILL) {
+ GList *spill_node;
+
+ spill_node = g_list_first (fspill_list);
+ g_assert (spill_node);
+ if (spec [MONO_INST_SRC1] == 'f' && (reginfof [ins->sreg1].flags & MONO_X86_FP_NEEDS_LOAD_SPILL))
+ spill_node = g_list_next (spill_node);
+
+ store = create_spilled_store_float (cfg, GPOINTER_TO_INT (spill_node->data), ins->sreg2, ins);
+ fspill_list = g_list_remove (fspill_list, spill_node->data);
+ }
+
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ load = create_spilled_load_float (cfg, fspill, ins->sreg2, ins);
+ insert_before_ins (ins, tmp, load);
+ if (store)
+ insert_before_ins (load, tmp, store);
+ }
+ }
+ else if (ins->sreg2 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_amd64_alloc_int_reg (cfg, tmp, ins, src2_mask, ins->sreg2, reginfo [ins->sreg2].flags);
+ rs->iassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_sreg2, ins, FALSE);
+ }
+ rs->isymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ if (spec [MONO_INST_CLOB] == 's' && ins->sreg2 != AMD64_RCX) {
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d, but ECX is needed (R%d)\n", mono_arch_regname (val), ins->sreg2, rs->iassign [AMD64_RCX]));
+ }
+ } else {
+ prev_sreg2 = -1;
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ int j, s;
+ MonoCallInst *call = (MonoCallInst*)ins;
+ GSList *list;
+ guint32 clob_mask = AMD64_CALLEE_REGS;
+
+ for (j = 0; j < MONO_MAX_IREGS; ++j) {
+ s = 1 << j;
+ if ((clob_mask & s) && !(rs->ifree_mask & s) && j != ins->sreg1) {
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [j], FALSE);
+ mono_regstate_free_int (rs, j);
+ //g_warning ("register %s busy at call site\n", mono_arch_regname (j));
+ }
+ }
+
+ if (use_sse2) {
+ clob_mask = AMD64_CALLEE_FREGS;
+
+ for (j = 0; j < MONO_MAX_FREGS; ++j) {
+ s = 1 << j;
+ if ((clob_mask & s) && !(rs->ffree_mask & s) && j != ins->sreg1) {
+ get_register_force_spilling (cfg, tmp, ins, rs->fsymbolic [j], TRUE);
+ mono_regstate_free_float (rs, j);
+ //g_warning ("register %s busy at call site\n", mono_arch_regname (j));
+ }
+ }
+ }
+
+ /*
+ * Assign all registers in call->out_reg_args to the proper
+ * argument registers.
+ */
+
+ list = call->out_ireg_args;
+ if (list) {
+ while (list) {
+ guint64 regpair;
+ int reg, hreg;
+
+ regpair = (guint64) (list->data);
+ hreg = regpair >> 32;
+ reg = regpair & 0xffffffff;
+
+ rs->iassign [reg] = hreg;
+ rs->isymbolic [hreg] = reg;
+ rs->ifree_mask &= ~ (1 << hreg);
+
+ list = g_slist_next (list);
+ }
+ g_slist_free (call->out_ireg_args);
+ }
+
+ list = call->out_freg_args;
+ if (list && use_sse2) {
+ while (list) {
+ guint64 regpair;
+ int reg, hreg;
+
+ regpair = (guint64) (list->data);
+ hreg = regpair >> 32;
+ reg = regpair & 0xffffffff;
+
+ rs->fassign [reg] = hreg;
+ rs->fsymbolic [hreg] = reg;
+ rs->ffree_mask &= ~ (1 << hreg);
+
+ list = g_slist_next (list);
+ }
+ }
+ if (call->out_freg_args)
+ g_slist_free (call->out_freg_args);
+ }
+
+ /*if (reg_is_freeable (ins->sreg1) && prev_sreg1 >= 0 && reginfo [prev_sreg1].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg1)));
+ mono_regstate_free_int (rs, ins->sreg1);
+ }
+ if (reg_is_freeable (ins->sreg2) && prev_sreg2 >= 0 && reginfo [prev_sreg2].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg2)));
+ mono_regstate_free_int (rs, ins->sreg2);
+ }*/
+
+ DEBUG (print_ins (i, ins));
+ /* this may result from a insert_before call */
+ if (!tmp->next)
+ bb->code = tmp->data;
+ tmp = tmp->next;
+ }
+
+ g_free (reginfo);
+ g_free (reginfof);
+ g_list_free (fspill_list);
+}
+
+static unsigned char*
+emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size, gboolean is_signed)
+{
+ if (use_sse2) {
+ amd64_sse_cvtsd2si_reg_reg (code, dreg, sreg);
+ }
+ else {
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+ x86_fnstcw_membase(code, AMD64_RSP, 0);
+ amd64_mov_reg_membase (code, dreg, AMD64_RSP, 0, 2);
+ amd64_alu_reg_imm (code, X86_OR, dreg, 0xc00);
+ amd64_mov_membase_reg (code, AMD64_RSP, 2, dreg, 2);
+ amd64_fldcw_membase (code, AMD64_RSP, 2);
+ amd64_push_reg (code, AMD64_RAX); // SP = SP - 8
+ amd64_fist_pop_membase (code, AMD64_RSP, 0, size == 8);
+ amd64_pop_reg (code, dreg);
+ amd64_fldcw_membase (code, AMD64_RSP, 0);
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ }
+
+ if (size == 1)
+ amd64_widen_reg (code, dreg, dreg, is_signed, FALSE);
+ else if (size == 2)
+ amd64_widen_reg (code, dreg, dreg, is_signed, TRUE);
+ return code;
+}
+
+static unsigned char*
+mono_emit_stack_alloc (guchar *code, MonoInst* tree)
+{
+ int sreg = tree->sreg1;
+#ifdef PLATFORM_WIN32
+ guint8* br[5];
+
+ NOT_IMPLEMENTED;
+
+ /*
+ * Under Windows:
+ * If requested stack size is larger than one page,
+ * perform stack-touch operation
+ */
+ /*
+ * Generate stack probe code.
+ * Under Windows, it is necessary to allocate one page at a time,
+ * "touching" stack after each successful sub-allocation. This is
+ * because of the way stack growth is implemented - there is a
+ * guard page before the lowest stack page that is currently commited.
+ * Stack normally grows sequentially so OS traps access to the
+ * guard page and commits more pages when needed.
+ */
+ amd64_test_reg_imm (code, sreg, ~0xFFF);
+ br[0] = code; x86_branch8 (code, X86_CC_Z, 0, FALSE);
+
+ br[2] = code; /* loop */
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 0x1000);
+ amd64_test_membase_reg (code, AMD64_RSP, 0, AMD64_RSP);
+ amd64_alu_reg_imm (code, X86_SUB, sreg, 0x1000);
+ amd64_alu_reg_imm (code, X86_CMP, sreg, 0x1000);
+ br[3] = code; x86_branch8 (code, X86_CC_AE, 0, FALSE);
+ amd64_patch (br[3], br[2]);
+ amd64_test_reg_reg (code, sreg, sreg);
+ br[4] = code; x86_branch8 (code, X86_CC_Z, 0, FALSE);
+ amd64_alu_reg_reg (code, X86_SUB, AMD64_RSP, sreg);
+
+ br[1] = code; x86_jump8 (code, 0);
+
+ amd64_patch (br[0], code);
+ amd64_alu_reg_reg (code, X86_SUB, AMD64_RSP, sreg);
+ amd64_patch (br[1], code);
+ amd64_patch (br[4], code);
+#else /* PLATFORM_WIN32 */
+ amd64_alu_reg_reg (code, X86_SUB, AMD64_RSP, tree->sreg1);
+#endif
+ if (tree->flags & MONO_INST_INIT) {
+ int offset = 0;
+ if (tree->dreg != AMD64_RAX && sreg != AMD64_RAX) {
+ amd64_push_reg (code, AMD64_RAX);
+ offset += 8;
+ }
+ if (tree->dreg != AMD64_RCX && sreg != AMD64_RCX) {
+ amd64_push_reg (code, AMD64_RCX);
+ offset += 8;
+ }
+ if (tree->dreg != AMD64_RDI && sreg != AMD64_RDI) {
+ amd64_push_reg (code, AMD64_RDI);
+ offset += 8;
+ }
+
+ amd64_shift_reg_imm (code, X86_SHR, sreg, 4);
+ if (sreg != AMD64_RCX)
+ amd64_mov_reg_reg (code, AMD64_RCX, sreg, 8);
+ amd64_alu_reg_reg (code, X86_XOR, AMD64_RAX, AMD64_RAX);
+
+ amd64_lea_membase (code, AMD64_RDI, AMD64_RSP, offset);
+ amd64_cld (code);
+ amd64_prefix (code, X86_REP_PREFIX);
+ amd64_stosl (code);
+
+ if (tree->dreg != AMD64_RDI && sreg != AMD64_RDI)
+ amd64_pop_reg (code, AMD64_RDI);
+ if (tree->dreg != AMD64_RCX && sreg != AMD64_RCX)
+ amd64_pop_reg (code, AMD64_RCX);
+ if (tree->dreg != AMD64_RAX && sreg != AMD64_RAX)
+ amd64_pop_reg (code, AMD64_RAX);
+ }
+ return code;
+}
+
+static guint8*
+emit_move_return_value (MonoCompile *cfg, MonoInst *ins, guint8 *code)
+{
+ CallInfo *cinfo;
+ guint32 offset, quad;
+
+ /* Move return value to the target register */
+ /* FIXME: do this in the local reg allocator */
+ switch (ins->opcode) {
+ case CEE_CALL:
+ case OP_CALL_REG:
+ case OP_CALL_MEMBASE:
+ case OP_LCALL:
+ case OP_LCALL_REG:
+ case OP_LCALL_MEMBASE:
+ if (ins->dreg != AMD64_RAX)
+ amd64_mov_reg_reg (code, ins->dreg, AMD64_RAX, 8);
+ break;
+ case OP_FCALL:
+ case OP_FCALL_REG:
+ case OP_FCALL_MEMBASE:
+ /* FIXME: optimize this */
+ offset = mono_spillvar_offset_float (cfg, 0);
+ if (((MonoCallInst*)ins)->signature->ret->type == MONO_TYPE_R4) {
+ if (use_sse2)
+ amd64_sse_cvtss2sd_reg_reg (code, ins->dreg, AMD64_XMM0);
+ else {
+ amd64_movss_membase_reg (code, AMD64_RBP, offset, AMD64_XMM0);
+ amd64_fld_membase (code, AMD64_RBP, offset, FALSE);
+ }
+ }
+ else {
+ if (use_sse2) {
+ if (ins->dreg != AMD64_XMM0)
+ amd64_sse_movsd_reg_reg (code, ins->dreg, AMD64_XMM0);
+ }
+ else {
+ amd64_movsd_membase_reg (code, AMD64_RBP, offset, AMD64_XMM0);
+ amd64_fld_membase (code, AMD64_RBP, offset, TRUE);
+ }
+ }
+ break;
+ case OP_VCALL:
+ case OP_VCALL_REG:
+ case OP_VCALL_MEMBASE:
+ cinfo = get_call_info (((MonoCallInst*)ins)->signature, FALSE);
+ if (cinfo->ret.storage == ArgValuetypeInReg) {
+ /* Pop the destination address from the stack */
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ amd64_pop_reg (code, AMD64_RCX);
+
+ for (quad = 0; quad < 2; quad ++) {
+ switch (cinfo->ret.pair_storage [quad]) {
+ case ArgInIReg:
+ amd64_mov_membase_reg (code, AMD64_RCX, (quad * 8), cinfo->ret.pair_regs [quad], 8);
+ break;
+ case ArgInFloatSSEReg:
+ amd64_movss_membase_reg (code, AMD64_RCX, (quad * 8), cinfo->ret.pair_regs [quad]);
+ break;
+ case ArgInDoubleSSEReg:
+ amd64_movsd_membase_reg (code, AMD64_RCX, (quad * 8), cinfo->ret.pair_regs [quad]);
+ break;
+ case ArgNone:
+ break;
+ default:
+ NOT_IMPLEMENTED;
+ }
+ }
+ }
+ break;
+ }
+
+ return code;
+}
+
+/*
+ * emit_load_volatile_arguments:
+ *
+ * Load volatile arguments from the stack to the original input registers.
+ * Required before a tail call.
+ */
+static guint8*
+emit_load_volatile_arguments (MonoCompile *cfg, guint8 *code)
+{
+ MonoMethod *method = cfg->method;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ CallInfo *cinfo;
+ guint32 i;
+
+ /* FIXME: Generate intermediate code instead */
+
+ sig = method->signature;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ /* This is the opposite of the code in emit_prolog */
+
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ MonoType *arg_type;
+ inst = cfg->varinfo [i];
+
+ if (sig->hasthis && (i == 0))
+ arg_type = &mono_defaults.object_class->byval_arg;
+ else
+ arg_type = sig->params [i - sig->hasthis];
+
+ if (inst->opcode != OP_REGVAR) {
+ switch (ainfo->storage) {
+ case ArgInIReg: {
+ guint32 size = 8;
+
+ /* FIXME: I1 etc */
+ amd64_mov_reg_membase (code, ainfo->reg, inst->inst_basereg, inst->inst_offset, size);
+ break;
+ }
+ case ArgInFloatSSEReg:
+ amd64_movss_reg_membase (code, ainfo->reg, inst->inst_basereg, inst->inst_offset);
+ break;
+ case ArgInDoubleSSEReg:
+ amd64_movsd_reg_membase (code, ainfo->reg, inst->inst_basereg, inst->inst_offset);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ g_free (cinfo);
+
+ return code;
+}
+
+#define REAL_PRINT_REG(text,reg) \
+mono_assert (reg >= 0); \
+amd64_push_reg (code, AMD64_RAX); \
+amd64_push_reg (code, AMD64_RDX); \
+amd64_push_reg (code, AMD64_RCX); \
+amd64_push_reg (code, reg); \
+amd64_push_imm (code, reg); \
+amd64_push_imm (code, text " %d %p\n"); \
+amd64_mov_reg_imm (code, AMD64_RAX, printf); \
+amd64_call_reg (code, AMD64_RAX); \
+amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 3*4); \
+amd64_pop_reg (code, AMD64_RCX); \
+amd64_pop_reg (code, AMD64_RDX); \
+amd64_pop_reg (code, AMD64_RAX);
+
+/* benchmark and set based on cpu */
+#define LOOP_ALIGNMENT 8
+#define bb_is_loop_start(bb) ((bb)->loop_body_start && (bb)->nesting)
+
+void
+mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoCallInst *call;
+ guint offset;
+ guint8 *code = cfg->native_code + cfg->code_len;
+ MonoInst *last_ins = NULL;
+ guint last_offset = 0;
+ int max_len, cpos;
+
+ if (cfg->opt & MONO_OPT_PEEPHOLE)
+ peephole_pass (cfg, bb);
+
+ if (cfg->opt & MONO_OPT_LOOP) {
+ int pad, align = LOOP_ALIGNMENT;
+ /* set alignment depending on cpu */
+ if (bb_is_loop_start (bb) && (pad = (cfg->code_len & (align - 1)))) {
+ pad = align - pad;
+ /*g_print ("adding %d pad at %x to loop in %s\n", pad, cfg->code_len, cfg->method->name);*/
+ amd64_padding (code, pad);
+ cfg->code_len += pad;
+ bb->native_offset = cfg->code_len;
+ }
+ }
+
+ if (cfg->verbose_level > 2)
+ g_print ("Basic block %d starting at offset 0x%x\n", bb->block_num, bb->native_offset);
+
+ cpos = bb->max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE) {
+ MonoProfileCoverageInfo *cov = cfg->coverage_info;
+ g_assert (!mono_compile_aot);
+ cpos += 6;
+
+ cov->data [bb->dfn].cil_code = bb->cil_code;
+ /* this is not thread save, but good enough */
+ amd64_inc_mem (code, (guint64)&cov->data [bb->dfn].count);
+ }
+
+ offset = code - cfg->native_code;
+
+ ins = bb->code;
+ while (ins) {
+ offset = code - cfg->native_code;
+
+ max_len = ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+
+ if (offset > (cfg->code_size - max_len - 16)) {
+ cfg->code_size *= 2;
+ cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
+ code = cfg->native_code + offset;
+ mono_jit_stats.code_reallocs++;
+ }
+
+ mono_debug_record_line_number (cfg, ins, offset);
+
+ switch (ins->opcode) {
+ case OP_BIGMUL:
+ amd64_mul_reg (code, ins->sreg2, TRUE);
+ break;
+ case OP_BIGMUL_UN:
+ amd64_mul_reg (code, ins->sreg2, FALSE);
+ break;
+ case OP_X86_SETEQ_MEMBASE:
+ amd64_set_membase (code, X86_CC_EQ, ins->inst_basereg, ins->inst_offset, TRUE);
+ break;
+ case OP_STOREI1_MEMBASE_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_mov_membase_imm (code, ins->inst_destbasereg, ins->inst_offset, ins->inst_imm, 1);
+ break;
+ case OP_STOREI2_MEMBASE_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_mov_membase_imm (code, ins->inst_destbasereg, ins->inst_offset, ins->inst_imm, 2);
+ break;
+ case OP_STOREI4_MEMBASE_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_mov_membase_imm (code, ins->inst_destbasereg, ins->inst_offset, ins->inst_imm, 4);
+ break;
+ case OP_STOREI1_MEMBASE_REG:
+ amd64_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1, 1);
+ break;
+ case OP_STOREI2_MEMBASE_REG:
+ amd64_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1, 2);
+ break;
+ case OP_STORE_MEMBASE_REG:
+ case OP_STOREI8_MEMBASE_REG:
+ amd64_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1, 8);
+ break;
+ case OP_STOREI4_MEMBASE_REG:
+ amd64_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1, 4);
+ break;
+ case OP_STORE_MEMBASE_IMM:
+ case OP_STOREI8_MEMBASE_IMM:
+ if (amd64_is_imm32 (ins->inst_imm))
+ amd64_mov_membase_imm (code, ins->inst_destbasereg, ins->inst_offset, ins->inst_imm, 8);
+ else {
+ amd64_mov_reg_imm (code, GP_SCRATCH_REG, ins->inst_imm);
+ amd64_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, GP_SCRATCH_REG, 8);
+ }
+ break;
+ case CEE_LDIND_I:
+ amd64_mov_reg_mem (code, ins->dreg, (gssize)ins->inst_p0, sizeof (gpointer));
+ break;
+ case CEE_LDIND_I4:
+ amd64_mov_reg_mem (code, ins->dreg, (gssize)ins->inst_p0, 4);
+ break;
+ case CEE_LDIND_U4:
+ amd64_mov_reg_mem (code, ins->dreg, (gssize)ins->inst_p0, 4);
+ break;
+ case OP_LOADU4_MEM:
+ amd64_mov_reg_imm (code, ins->dreg, ins->inst_p0);
+ amd64_mov_reg_membase (code, ins->dreg, ins->dreg, 0, 4);
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI8_MEMBASE:
+ if (amd64_is_imm32 (ins->inst_offset)) {
+ amd64_mov_reg_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, sizeof (gpointer));
+ }
+ else {
+ amd64_mov_reg_imm_size (code, GP_SCRATCH_REG, ins->inst_offset, 8);
+ amd64_mov_reg_memindex_size (code, ins->dreg, ins->inst_basereg, 0, GP_SCRATCH_REG, 0, 8);
+ }
+ break;
+ case OP_LOADI4_MEMBASE:
+ amd64_movsxd_reg_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset);
+ break;
+ case OP_LOADU4_MEMBASE:
+ amd64_mov_reg_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, 4);
+ break;
+ case OP_LOADU1_MEMBASE:
+ amd64_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, FALSE, FALSE);
+ break;
+ case OP_LOADI1_MEMBASE:
+ amd64_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, TRUE, FALSE);
+ break;
+ case OP_LOADU2_MEMBASE:
+ amd64_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, FALSE, TRUE);
+ break;
+ case OP_LOADI2_MEMBASE:
+ amd64_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, TRUE, TRUE);
+ break;
+ case CEE_CONV_I1:
+ amd64_widen_reg (code, ins->dreg, ins->sreg1, TRUE, FALSE);
+ break;
+ case CEE_CONV_I2:
+ amd64_widen_reg (code, ins->dreg, ins->sreg1, TRUE, TRUE);
+ break;
+ case CEE_CONV_U1:
+ amd64_widen_reg (code, ins->dreg, ins->sreg1, FALSE, FALSE);
+ break;
+ case CEE_CONV_U2:
+ amd64_widen_reg (code, ins->dreg, ins->sreg1, FALSE, TRUE);
+ break;
+ case CEE_CONV_U8:
+ case CEE_CONV_U:
+ /* Clean out the upper word */
+ amd64_mov_reg_reg_size (code, ins->dreg, ins->sreg1, 4);
+ break;
+ case CEE_CONV_I8:
+ case CEE_CONV_I:
+ amd64_movsxd_reg_reg (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_COMPARE:
+ case OP_LCOMPARE:
+ amd64_alu_reg_reg (code, X86_CMP, ins->sreg1, ins->sreg2);
+ break;
+ case OP_COMPARE_IMM:
+ if (!amd64_is_imm32 (ins->inst_imm)) {
+ amd64_mov_reg_imm (code, AMD64_R11, ins->inst_imm);
+ amd64_alu_reg_reg (code, X86_CMP, ins->sreg1, AMD64_R11);
+ } else {
+ amd64_alu_reg_imm (code, X86_CMP, ins->sreg1, ins->inst_imm);
+ }
+ break;
+ case OP_X86_COMPARE_MEMBASE_REG:
+ amd64_alu_membase_reg (code, X86_CMP, ins->inst_basereg, ins->inst_offset, ins->sreg2);
+ break;
+ case OP_X86_COMPARE_MEMBASE_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_membase_imm (code, X86_CMP, ins->inst_basereg, ins->inst_offset, ins->inst_imm);
+ break;
+ case OP_X86_COMPARE_REG_MEMBASE:
+ amd64_alu_reg_membase (code, X86_CMP, ins->sreg1, ins->sreg2, ins->inst_offset);
+ break;
+ case OP_X86_TEST_NULL:
+ amd64_test_reg_reg_size (code, ins->sreg1, ins->sreg1, 4);
+ break;
+ case OP_AMD64_TEST_NULL:
+ amd64_test_reg_reg (code, ins->sreg1, ins->sreg1);
+ break;
+ case OP_X86_ADD_MEMBASE_IMM:
+ /* FIXME: Make a 64 version too */
+ amd64_alu_membase_imm_size (code, X86_ADD, ins->inst_basereg, ins->inst_offset, ins->inst_imm, 4);
+ break;
+ case OP_X86_ADD_MEMBASE:
+ amd64_alu_reg_membase_size (code, X86_ADD, ins->sreg1, ins->sreg2, ins->inst_offset, 4);
+ break;
+ case OP_X86_SUB_MEMBASE_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_membase_imm_size (code, X86_SUB, ins->inst_basereg, ins->inst_offset, ins->inst_imm, 4);
+ break;
+ case OP_X86_SUB_MEMBASE:
+ amd64_alu_reg_membase_size (code, X86_SUB, ins->sreg1, ins->sreg2, ins->inst_offset, 4);
+ break;
+ case OP_X86_INC_MEMBASE:
+ amd64_inc_membase_size (code, ins->inst_basereg, ins->inst_offset, 4);
+ break;
+ case OP_X86_INC_REG:
+ amd64_inc_reg_size (code, ins->dreg, 4);
+ break;
+ case OP_X86_DEC_MEMBASE:
+ amd64_dec_membase_size (code, ins->inst_basereg, ins->inst_offset, 4);
+ break;
+ case OP_X86_DEC_REG:
+ amd64_dec_reg_size (code, ins->dreg, 4);
+ break;
+ case OP_X86_MUL_MEMBASE:
+ amd64_imul_reg_membase_size (code, ins->sreg1, ins->sreg2, ins->inst_offset, 4);
+ break;
+ case OP_AMD64_ICOMPARE_MEMBASE_REG:
+ amd64_alu_membase_reg_size (code, X86_CMP, ins->inst_basereg, ins->inst_offset, ins->sreg2, 4);
+ break;
+ case OP_AMD64_ICOMPARE_MEMBASE_IMM:
+ amd64_alu_membase_imm_size (code, X86_CMP, ins->inst_basereg, ins->inst_offset, ins->inst_imm, 4);
+ break;
+ case OP_AMD64_ICOMPARE_REG_MEMBASE:
+ amd64_alu_reg_membase_size (code, X86_CMP, ins->sreg1, ins->sreg2, ins->inst_offset, 4);
+ break;
+ case CEE_BREAK:
+ amd64_breakpoint (code);
+ break;
+
+ case OP_ADDCC:
+ case CEE_ADD:
+ amd64_alu_reg_reg (code, X86_ADD, ins->sreg1, ins->sreg2);
+ break;
+ case OP_ADC:
+ amd64_alu_reg_reg (code, X86_ADC, ins->sreg1, ins->sreg2);
+ break;
+ case OP_ADD_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_reg_imm (code, X86_ADD, ins->dreg, ins->inst_imm);
+ break;
+ case OP_ADC_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_reg_imm (code, X86_ADC, ins->dreg, ins->inst_imm);
+ break;
+ case OP_SUBCC:
+ case CEE_SUB:
+ amd64_alu_reg_reg (code, X86_SUB, ins->sreg1, ins->sreg2);
+ break;
+ case OP_SBB:
+ amd64_alu_reg_reg (code, X86_SBB, ins->sreg1, ins->sreg2);
+ break;
+ case OP_SUB_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_reg_imm (code, X86_SUB, ins->dreg, ins->inst_imm);
+ break;
+ case OP_SBB_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_reg_imm (code, X86_SBB, ins->dreg, ins->inst_imm);
+ break;
+ case CEE_AND:
+ amd64_alu_reg_reg (code, X86_AND, ins->sreg1, ins->sreg2);
+ break;
+ case OP_AND_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_reg_imm (code, X86_AND, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_MUL:
+ amd64_imul_reg_reg (code, ins->sreg1, ins->sreg2);
+ break;
+ case OP_MUL_IMM:
+ amd64_imul_reg_reg_imm (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_DIV:
+ amd64_cdq (code);
+ amd64_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_DIV_UN:
+ amd64_alu_reg_reg (code, X86_XOR, AMD64_RDX, AMD64_RDX);
+ amd64_div_reg (code, ins->sreg2, FALSE);
+ break;
+ case OP_DIV_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_mov_reg_imm (code, ins->sreg2, ins->inst_imm);
+ amd64_cdq (code);
+ amd64_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_REM:
+ amd64_cdq (code);
+ amd64_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_REM_UN:
+ amd64_alu_reg_reg (code, X86_XOR, AMD64_RDX, AMD64_RDX);
+ amd64_div_reg (code, ins->sreg2, FALSE);
+ break;
+ case OP_REM_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_mov_reg_imm (code, ins->sreg2, ins->inst_imm);
+ amd64_cdq (code);
+ amd64_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_OR:
+ amd64_alu_reg_reg (code, X86_OR, ins->sreg1, ins->sreg2);
+ break;
+ case OP_OR_IMM
+: g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_reg_imm (code, X86_OR, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_XOR:
+ amd64_alu_reg_reg (code, X86_XOR, ins->sreg1, ins->sreg2);
+ break;
+ case OP_XOR_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_alu_reg_imm (code, X86_XOR, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_SHL:
+ case OP_LSHL:
+ g_assert (ins->sreg2 == AMD64_RCX);
+ amd64_shift_reg (code, X86_SHL, ins->dreg);
+ break;
+ case CEE_SHR:
+ case OP_LSHR:
+ g_assert (ins->sreg2 == AMD64_RCX);
+ amd64_shift_reg (code, X86_SAR, ins->dreg);
+ break;
+ case OP_SHR_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_shift_reg_imm_size (code, X86_SAR, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_LSHR_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_shift_reg_imm (code, X86_SAR, ins->dreg, ins->inst_imm);
+ break;
+ case OP_SHR_UN_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_shift_reg_imm_size (code, X86_SHR, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_LSHR_UN_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_shift_reg_imm (code, X86_SHR, ins->dreg, ins->inst_imm);
+ break;
+ case CEE_SHR_UN:
+ g_assert (ins->sreg2 == AMD64_RCX);
+ amd64_shift_reg_size (code, X86_SHR, ins->dreg, 4);
+ break;
+ case OP_LSHR_UN:
+ g_assert (ins->sreg2 == AMD64_RCX);
+ amd64_shift_reg (code, X86_SHR, ins->dreg);
+ break;
+ case OP_SHL_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_shift_reg_imm_size (code, X86_SHL, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_LSHL_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_shift_reg_imm (code, X86_SHL, ins->dreg, ins->inst_imm);
+ break;
+
+ case OP_IADDCC:
+ case OP_IADD:
+ amd64_alu_reg_reg_size (code, X86_ADD, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_IADC:
+ amd64_alu_reg_reg_size (code, X86_ADC, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_IADD_IMM:
+ amd64_alu_reg_imm_size (code, X86_ADD, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_IADC_IMM:
+ amd64_alu_reg_imm_size (code, X86_ADC, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_ISUBCC:
+ case OP_ISUB:
+ amd64_alu_reg_reg_size (code, X86_SUB, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_ISBB:
+ amd64_alu_reg_reg_size (code, X86_SBB, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_ISUB_IMM:
+ amd64_alu_reg_imm_size (code, X86_SUB, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_ISBB_IMM:
+ amd64_alu_reg_imm_size (code, X86_SBB, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_IAND:
+ amd64_alu_reg_reg_size (code, X86_AND, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_IAND_IMM:
+ amd64_alu_reg_imm_size (code, X86_AND, ins->sreg1, ins->inst_imm, 4);
+ break;
+ case OP_IOR:
+ amd64_alu_reg_reg_size (code, X86_OR, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_IOR_IMM:
+ amd64_alu_reg_imm_size (code, X86_OR, ins->sreg1, ins->inst_imm, 4);
+ break;
+ case OP_IXOR:
+ amd64_alu_reg_reg_size (code, X86_XOR, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_IXOR_IMM:
+ amd64_alu_reg_imm_size (code, X86_XOR, ins->sreg1, ins->inst_imm, 4);
+ break;
+ case OP_INEG:
+ amd64_neg_reg_size (code, ins->sreg1, 4);
+ break;
+ case OP_INOT:
+ amd64_not_reg_size (code, ins->sreg1, 4);
+ break;
+ case OP_ISHL:
+ g_assert (ins->sreg2 == AMD64_RCX);
+ amd64_shift_reg_size (code, X86_SHL, ins->dreg, 4);
+ break;
+ case OP_ISHR:
+ g_assert (ins->sreg2 == AMD64_RCX);
+ amd64_shift_reg_size (code, X86_SAR, ins->dreg, 4);
+ break;
+ case OP_ISHR_IMM:
+ amd64_shift_reg_imm_size (code, X86_SAR, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_ISHR_UN_IMM:
+ amd64_shift_reg_imm_size (code, X86_SHR, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_ISHR_UN:
+ g_assert (ins->sreg2 == AMD64_RCX);
+ amd64_shift_reg_size (code, X86_SHR, ins->dreg, 4);
+ break;
+ case OP_ISHL_IMM:
+ amd64_shift_reg_imm_size (code, X86_SHL, ins->dreg, ins->inst_imm, 4);
+ break;
+ case OP_IMUL:
+ amd64_imul_reg_reg_size (code, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_IMUL_IMM:
+ amd64_imul_reg_reg_imm_size (code, ins->dreg, ins->sreg1, ins->inst_imm, 4);
+ break;
+ case OP_IMUL_OVF:
+ amd64_imul_reg_reg_size (code, ins->sreg1, ins->sreg2, 4);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_O, FALSE, "OverflowException");
+ break;
+ case OP_IMUL_OVF_UN: {
+ /* the mul operation and the exception check should most likely be split */
+ int non_eax_reg, saved_eax = FALSE, saved_edx = FALSE;
+ /*g_assert (ins->sreg2 == X86_EAX);
+ g_assert (ins->dreg == X86_EAX);*/
+ if (ins->sreg2 == X86_EAX) {
+ non_eax_reg = ins->sreg1;
+ } else if (ins->sreg1 == X86_EAX) {
+ non_eax_reg = ins->sreg2;
+ } else {
+ /* no need to save since we're going to store to it anyway */
+ if (ins->dreg != X86_EAX) {
+ saved_eax = TRUE;
+ amd64_push_reg (code, X86_EAX);
+ }
+ amd64_mov_reg_reg (code, X86_EAX, ins->sreg1, 4);
+ non_eax_reg = ins->sreg2;
+ }
+ if (ins->dreg == X86_EDX) {
+ if (!saved_eax) {
+ saved_eax = TRUE;
+ amd64_push_reg (code, X86_EAX);
+ }
+ } else if (ins->dreg != X86_EAX) {
+ saved_edx = TRUE;
+ amd64_push_reg (code, X86_EDX);
+ }
+ amd64_mul_reg_size (code, non_eax_reg, FALSE, 4);
+ /* save before the check since pop and mov don't change the flags */
+ if (ins->dreg != X86_EAX)
+ amd64_mov_reg_reg (code, ins->dreg, X86_EAX, 4);
+ if (saved_edx)
+ amd64_pop_reg (code, X86_EDX);
+ if (saved_eax)
+ amd64_pop_reg (code, X86_EAX);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_O, FALSE, "OverflowException");
+ break;
+ }
+ case OP_IDIV:
+ amd64_cdq_size (code, 4);
+ amd64_div_reg_size (code, ins->sreg2, 4, TRUE);
+ break;
+ case OP_IDIV_UN:
+ amd64_alu_reg_reg (code, X86_XOR, AMD64_RDX, AMD64_RDX);
+ amd64_div_reg_size (code, ins->sreg2, 4, FALSE);
+ break;
+ case OP_IDIV_IMM:
+ amd64_mov_reg_imm (code, ins->sreg2, ins->inst_imm);
+ amd64_cdq_size (code, 4);
+ amd64_div_reg_size (code, ins->sreg2, 4, TRUE);
+ break;
+ case OP_IREM:
+ amd64_cdq_size (code, 4);
+ amd64_div_reg_size (code, ins->sreg2, 4, TRUE);
+ break;
+ case OP_IREM_UN:
+ amd64_alu_reg_reg (code, X86_XOR, AMD64_RDX, AMD64_RDX);
+ amd64_div_reg_size (code, ins->sreg2, 4, FALSE);
+ break;
+ case OP_IREM_IMM:
+ amd64_mov_reg_imm (code, ins->sreg2, ins->inst_imm);
+ amd64_cdq_size (code, 4);
+ amd64_div_reg_size (code, ins->sreg2, 4, TRUE);
+ break;
+
+ case OP_ICOMPARE:
+ amd64_alu_reg_reg_size (code, X86_CMP, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_ICOMPARE_IMM:
+ amd64_alu_reg_imm_size (code, X86_CMP, ins->sreg1, ins->inst_imm, 4);
+ break;
+
+ case OP_IBEQ:
+ case OP_IBLT:
+ case OP_IBGT:
+ case OP_IBGE:
+ case OP_IBLE:
+ EMIT_COND_BRANCH (ins, opcode_to_x86_cond (ins->opcode), TRUE);
+ break;
+ case OP_IBNE_UN:
+ case OP_IBLT_UN:
+ case OP_IBGT_UN:
+ case OP_IBGE_UN:
+ case OP_IBLE_UN:
+ EMIT_COND_BRANCH (ins, opcode_to_x86_cond (ins->opcode), FALSE);
+ break;
+ case OP_COND_EXC_IOV:
+ EMIT_COND_SYSTEM_EXCEPTION (opcode_to_x86_cond (ins->opcode),
+ TRUE, ins->inst_p1);
+ break;
+ case OP_COND_EXC_IC:
+ EMIT_COND_SYSTEM_EXCEPTION (opcode_to_x86_cond (ins->opcode),
+ FALSE, ins->inst_p1);
+ break;
+ case CEE_NOT:
+ amd64_not_reg (code, ins->sreg1);
+ break;
+ case CEE_NEG:
+ amd64_neg_reg (code, ins->sreg1);
+ break;
+ case OP_SEXT_I1:
+ amd64_widen_reg (code, ins->dreg, ins->sreg1, TRUE, FALSE);
+ break;
+ case OP_SEXT_I2:
+ amd64_widen_reg (code, ins->dreg, ins->sreg1, TRUE, TRUE);
+ break;
+ case OP_ICONST:
+ case OP_I8CONST:
+ if ((((guint64)ins->inst_c0) >> 32) == 0)
+ amd64_mov_reg_imm_size (code, ins->dreg, ins->inst_c0, 4);
+ else
+ amd64_mov_reg_imm_size (code, ins->dreg, ins->inst_c0, 8);
+ break;
+ case OP_AOTCONST:
+ mono_add_patch_info (cfg, offset, (MonoJumpInfoType)ins->inst_i1, ins->inst_p0);
+ amd64_set_reg_template (code, ins->dreg);
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ case OP_SETREG:
+ amd64_mov_reg_reg (code, ins->dreg, ins->sreg1, sizeof (gpointer));
+ break;
+ case OP_AMD64_SET_XMMREG_R4: {
+ if (use_sse2) {
+ amd64_sse_cvtsd2ss_reg_reg (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ amd64_fst_membase (code, AMD64_RSP, -8, FALSE, TRUE);
+ /* ins->dreg is set to -1 by the reg allocator */
+ amd64_movss_reg_membase (code, ins->unused, AMD64_RSP, -8);
+ }
+ break;
+ }
+ case OP_AMD64_SET_XMMREG_R8: {
+ if (use_sse2) {
+ if (ins->dreg != ins->sreg1)
+ amd64_sse_movsd_reg_reg (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ amd64_fst_membase (code, AMD64_RSP, -8, TRUE, TRUE);
+ /* ins->dreg is set to -1 by the reg allocator */
+ amd64_movsd_reg_membase (code, ins->unused, AMD64_RSP, -8);
+ }
+ break;
+ }
+ case CEE_JMP: {
+ /*
+ * Note: this 'frame destruction' logic is useful for tail calls, too.
+ * Keep in sync with the code in emit_epilog.
+ */
+ int pos = 0, i;
+
+ /* FIXME: no tracing support... */
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ code = mono_arch_instrument_epilog (cfg, mono_profiler_method_leave, code, FALSE);
+
+ g_assert (!cfg->method->save_lmf);
+
+ code = emit_load_volatile_arguments (cfg, code);
+
+ for (i = 0; i < AMD64_NREG; ++i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (cfg->used_int_regs & (1 << i)))
+ pos -= sizeof (gpointer);
+
+ if (pos)
+ amd64_lea_membase (code, AMD64_RSP, AMD64_RBP, pos);
+
+ /* Pop registers in reverse order */
+ for (i = AMD64_NREG - 1; i > 0; --i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (cfg->used_int_regs & (1 << i))) {
+ amd64_pop_reg (code, i);
+ }
+
+ amd64_leave (code);
+ offset = code - cfg->native_code;
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_METHOD_JUMP, ins->inst_p0);
+ amd64_set_reg_template (code, AMD64_R11);
+ amd64_jump_reg (code, AMD64_R11);
+ break;
+ }
+ case OP_CHECK_THIS:
+ /* ensure ins->sreg1 is not NULL */
+ amd64_alu_membase_imm (code, X86_CMP, ins->sreg1, 0, 0);
+ break;
+ case OP_ARGLIST: {
+ amd64_lea_membase (code, AMD64_R11, AMD64_RBP, cfg->sig_cookie);
+ amd64_mov_membase_reg (code, ins->sreg1, 0, AMD64_R11, 8);
+ break;
+ }
+ case OP_FCALL:
+ case OP_LCALL:
+ case OP_VCALL:
+ case OP_VOIDCALL:
+ case CEE_CALL:
+ call = (MonoCallInst*)ins;
+ /*
+ * The AMD64 ABI forces callers to know about varargs.
+ */
+ if ((call->signature->call_convention == MONO_CALL_VARARG) && (call->signature->pinvoke))
+ amd64_alu_reg_reg (code, X86_XOR, AMD64_RAX, AMD64_RAX);
+
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ code = emit_call (cfg, code, MONO_PATCH_INFO_METHOD, call->method);
+ else
+ code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, call->fptr);
+ if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention))
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, call->stack_usage);
+ code = emit_move_return_value (cfg, ins, code);
+ break;
+ case OP_FCALL_REG:
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ case OP_CALL_REG:
+ call = (MonoCallInst*)ins;
+
+ if (AMD64_IS_ARGUMENT_REG (ins->sreg1)) {
+ amd64_mov_reg_reg (code, AMD64_R11, ins->sreg1, 8);
+ ins->sreg1 = AMD64_R11;
+ }
+
+ /*
+ * The AMD64 ABI forces callers to know about varargs.
+ */
+ if ((call->signature->call_convention == MONO_CALL_VARARG) && (call->signature->pinvoke)) {
+ if (ins->sreg1 == AMD64_RAX) {
+ amd64_mov_reg_reg (code, AMD64_R11, AMD64_RAX, 8);
+ ins->sreg1 = AMD64_R11;
+ }
+ amd64_alu_reg_reg (code, X86_XOR, AMD64_RAX, AMD64_RAX);
+ }
+ amd64_call_reg (code, ins->sreg1);
+ if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention))
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, call->stack_usage);
+ code = emit_move_return_value (cfg, ins, code);
+ break;
+ case OP_FCALL_MEMBASE:
+ case OP_LCALL_MEMBASE:
+ case OP_VCALL_MEMBASE:
+ case OP_VOIDCALL_MEMBASE:
+ case OP_CALL_MEMBASE:
+ call = (MonoCallInst*)ins;
+
+ if (AMD64_IS_ARGUMENT_REG (ins->sreg1)) {
+ amd64_mov_reg_reg (code, AMD64_R11, ins->sreg1, 8);
+ ins->sreg1 = AMD64_R11;
+ }
+
+ amd64_call_membase (code, ins->sreg1, ins->inst_offset);
+ if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention))
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, call->stack_usage);
+ code = emit_move_return_value (cfg, ins, code);
+ break;
+ case OP_OUTARG:
+ case OP_X86_PUSH:
+ amd64_push_reg (code, ins->sreg1);
+ break;
+ case OP_X86_PUSH_IMM:
+ g_assert (amd64_is_imm32 (ins->inst_imm));
+ amd64_push_imm (code, ins->inst_imm);
+ break;
+ case OP_X86_PUSH_MEMBASE:
+ amd64_push_membase (code, ins->inst_basereg, ins->inst_offset);
+ break;
+ case OP_X86_PUSH_OBJ:
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, ins->inst_imm);
+ amd64_push_reg (code, AMD64_RDI);
+ amd64_push_reg (code, AMD64_RSI);
+ amd64_push_reg (code, AMD64_RCX);
+ if (ins->inst_offset)
+ amd64_lea_membase (code, AMD64_RSI, ins->inst_basereg, ins->inst_offset);
+ else
+ amd64_mov_reg_reg (code, AMD64_RSI, ins->inst_basereg, 8);
+ amd64_lea_membase (code, AMD64_RDI, AMD64_RSP, 3 * 8);
+ amd64_mov_reg_imm (code, AMD64_RCX, (ins->inst_imm >> 3));
+ amd64_cld (code);
+ amd64_prefix (code, X86_REP_PREFIX);
+ amd64_movsd (code);
+ amd64_pop_reg (code, AMD64_RCX);
+ amd64_pop_reg (code, AMD64_RSI);
+ amd64_pop_reg (code, AMD64_RDI);
+ break;
+ case OP_X86_LEA:
+ amd64_lea_memindex (code, ins->dreg, ins->sreg1, ins->inst_imm, ins->sreg2, ins->unused);
+ break;
+ case OP_X86_LEA_MEMBASE:
+ amd64_lea_membase (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ break;
+ case OP_X86_XCHG:
+ amd64_xchg_reg_reg (code, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_LOCALLOC:
+ /* keep alignment */
+ amd64_alu_reg_imm (code, X86_ADD, ins->sreg1, MONO_ARCH_FRAME_ALIGNMENT - 1);
+ amd64_alu_reg_imm (code, X86_AND, ins->sreg1, ~(MONO_ARCH_FRAME_ALIGNMENT - 1));
+ code = mono_emit_stack_alloc (code, ins);
+ amd64_mov_reg_reg (code, ins->dreg, AMD64_RSP, 8);
+ break;
+ case CEE_RET:
+ amd64_ret (code);
+ break;
+ case CEE_THROW: {
+ amd64_mov_reg_reg (code, AMD64_RDI, ins->sreg1, 8);
+ code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_throw_exception");
+ break;
+ }
+ case OP_RETHROW: {
+ amd64_mov_reg_reg (code, AMD64_RDI, ins->sreg1, 8);
+ code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_rethrow_exception");
+ break;
+ }
+ case OP_CALL_HANDLER:
+ /* Align stack */
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ amd64_call_imm (code, 0);
+ /* Restore stack alignment */
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ break;
+ case OP_LABEL:
+ ins->inst_c0 = code - cfg->native_code;
+ break;
+ case CEE_BR:
+ //g_print ("target: %p, next: %p, curr: %p, last: %p\n", ins->inst_target_bb, bb->next_bb, ins, bb->last_ins);
+ //if ((ins->inst_target_bb == bb->next_bb) && ins == bb->last_ins)
+ //break;
+ if (ins->flags & MONO_INST_BRLABEL) {
+ if (ins->inst_i0->inst_c0) {
+ amd64_jump_code (code, cfg->native_code + ins->inst_i0->inst_c0);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_LABEL, ins->inst_i0);
+ if ((cfg->opt & MONO_OPT_BRANCH) &&
+ x86_is_imm8 (ins->inst_i0->inst_c1 - cpos))
+ x86_jump8 (code, 0);
+ else
+ x86_jump32 (code, 0);
+ }
+ } else {
+ if (ins->inst_target_bb->native_offset) {
+ amd64_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ if ((cfg->opt & MONO_OPT_BRANCH) &&
+ x86_is_imm8 (ins->inst_target_bb->max_offset - cpos))
+ x86_jump8 (code, 0);
+ else
+ x86_jump32 (code, 0);
+ }
+ }
+ break;
+ case OP_BR_REG:
+ amd64_jump_reg (code, ins->sreg1);
+ break;
+ case OP_CEQ:
+ case OP_ICEQ:
+ amd64_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CLT:
+ case OP_ICLT:
+ amd64_set_reg (code, X86_CC_LT, ins->dreg, TRUE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CLT_UN:
+ case OP_ICLT_UN:
+ amd64_set_reg (code, X86_CC_LT, ins->dreg, FALSE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CGT:
+ case OP_ICGT:
+ amd64_set_reg (code, X86_CC_GT, ins->dreg, TRUE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CGT_UN:
+ case OP_ICGT_UN:
+ amd64_set_reg (code, X86_CC_GT, ins->dreg, FALSE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_COND_EXC_EQ:
+ case OP_COND_EXC_NE_UN:
+ case OP_COND_EXC_LT:
+ case OP_COND_EXC_LT_UN:
+ case OP_COND_EXC_GT:
+ case OP_COND_EXC_GT_UN:
+ case OP_COND_EXC_GE:
+ case OP_COND_EXC_GE_UN:
+ case OP_COND_EXC_LE:
+ case OP_COND_EXC_LE_UN:
+ case OP_COND_EXC_OV:
+ case OP_COND_EXC_NO:
+ case OP_COND_EXC_C:
+ case OP_COND_EXC_NC:
+ EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_EQ],
+ (ins->opcode < OP_COND_EXC_NE_UN), ins->inst_p1);
+ break;
+ case CEE_BEQ:
+ case CEE_BNE_UN:
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ EMIT_COND_BRANCH (ins, branch_cc_table [ins->opcode - CEE_BEQ], (ins->opcode < CEE_BNE_UN));
+ break;
+
+ /* floating point opcodes */
+ case OP_R8CONST: {
+ double d = *(double *)ins->inst_p0;
+
+ if (use_sse2) {
+ if ((d == 0.0) && (mono_signbit (d) == 0)) {
+ amd64_sse_xorpd_reg_reg (code, ins->dreg, ins->dreg);
+ }
+ else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R8, ins->inst_p0);
+ amd64_sse_movsd_reg_membase (code, ins->dreg, AMD64_RIP, 0);
+ }
+ }
+ else if ((d == 0.0) && (mono_signbit (d) == 0)) {
+ amd64_fldz (code);
+ } else if (d == 1.0) {
+ x86_fld1 (code);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R8, ins->inst_p0);
+ amd64_fld_membase (code, AMD64_RIP, 0, TRUE);
+ }
+ break;
+ }
+ case OP_R4CONST: {
+ float f = *(float *)ins->inst_p0;
+
+ if (use_sse2) {
+ if ((f == 0.0) && (mono_signbit (f) == 0)) {
+ amd64_sse_xorpd_reg_reg (code, ins->dreg, ins->dreg);
+ }
+ else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R4, ins->inst_p0);
+ amd64_sse_movss_reg_membase (code, ins->dreg, AMD64_RIP, 0);
+ amd64_sse_cvtss2sd_reg_reg (code, ins->dreg, ins->dreg);
+ }
+ }
+ else if ((f == 0.0) && (mono_signbit (f) == 0)) {
+ amd64_fldz (code);
+ } else if (f == 1.0) {
+ x86_fld1 (code);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R4, ins->inst_p0);
+ amd64_fld_membase (code, AMD64_RIP, 0, FALSE);
+ }
+ break;
+ }
+ case OP_STORER8_MEMBASE_REG:
+ if (use_sse2)
+ amd64_sse_movsd_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1);
+ else
+ amd64_fst_membase (code, ins->inst_destbasereg, ins->inst_offset, TRUE, TRUE);
+ break;
+ case OP_LOADR8_SPILL_MEMBASE:
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_fld_membase (code, ins->inst_basereg, ins->inst_offset, TRUE);
+ amd64_fxch (code, 1);
+ break;
+ case OP_LOADR8_MEMBASE:
+ if (use_sse2)
+ amd64_sse_movsd_reg_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset);
+ else
+ amd64_fld_membase (code, ins->inst_basereg, ins->inst_offset, TRUE);
+ break;
+ case OP_STORER4_MEMBASE_REG:
+ if (use_sse2) {
+ /* This requires a double->single conversion */
+ amd64_sse_cvtsd2ss_reg_reg (code, AMD64_XMM15, ins->sreg1);
+ amd64_sse_movss_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, AMD64_XMM15);
+ }
+ else
+ amd64_fst_membase (code, ins->inst_destbasereg, ins->inst_offset, FALSE, TRUE);
+ break;
+ case OP_LOADR4_MEMBASE:
+ if (use_sse2) {
+ amd64_sse_movss_reg_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset);
+ amd64_sse_cvtss2sd_reg_reg (code, ins->dreg, ins->dreg);
+ }
+ else
+ amd64_fld_membase (code, ins->inst_basereg, ins->inst_offset, FALSE);
+ break;
+ case CEE_CONV_R4: /* FIXME: change precision */
+ case CEE_CONV_R8:
+ if (use_sse2)
+ amd64_sse_cvtsi2sd_reg_reg (code, ins->dreg, ins->sreg1);
+ else {
+ amd64_push_reg (code, ins->sreg1);
+ amd64_fild_membase (code, AMD64_RSP, 0, FALSE);
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ }
+ break;
+ case CEE_CONV_R_UN:
+ /* Emulated */
+ g_assert_not_reached ();
+ break;
+ case OP_LCONV_TO_R4: /* FIXME: change precision */
+ case OP_LCONV_TO_R8:
+ if (use_sse2)
+ amd64_sse_cvtsi2sd_reg_reg (code, ins->dreg, ins->sreg1);
+ else {
+ amd64_push_reg (code, ins->sreg1);
+ amd64_fild_membase (code, AMD64_RSP, 0, TRUE);
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ }
+ break;
+ case OP_X86_FP_LOAD_I8:
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_fild_membase (code, ins->inst_basereg, ins->inst_offset, TRUE);
+ break;
+ case OP_X86_FP_LOAD_I4:
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_fild_membase (code, ins->inst_basereg, ins->inst_offset, FALSE);
+ break;
+ case OP_FCONV_TO_I1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, TRUE);
+ break;
+ case OP_FCONV_TO_U1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, FALSE);
+ break;
+ case OP_FCONV_TO_I2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, TRUE);
+ break;
+ case OP_FCONV_TO_U2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, FALSE);
+ break;
+ case OP_FCONV_TO_I4:
+ case OP_FCONV_TO_I:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
+ break;
+ case OP_FCONV_TO_I8:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 8, TRUE);
+ break;
+ case OP_LCONV_TO_R_UN: {
+ static guint8 mn[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x40 };
+ guint8 *br;
+
+ if (use_sse2)
+ g_assert_not_reached ();
+
+ /* load 64bit integer to FP stack */
+ amd64_push_imm (code, 0);
+ amd64_push_reg (code, ins->sreg2);
+ amd64_push_reg (code, ins->sreg1);
+ amd64_fild_membase (code, AMD64_RSP, 0, TRUE);
+ /* store as 80bit FP value */
+ x86_fst80_membase (code, AMD64_RSP, 0);
+
+ /* test if lreg is negative */
+ amd64_test_reg_reg (code, ins->sreg2, ins->sreg2);
+ br = code; x86_branch8 (code, X86_CC_GEZ, 0, TRUE);
+
+ /* add correction constant mn */
+ x86_fld80_mem (code, mn);
+ x86_fld80_membase (code, AMD64_RSP, 0);
+ amd64_fp_op_reg (code, X86_FADD, 1, TRUE);
+ x86_fst80_membase (code, AMD64_RSP, 0);
+
+ amd64_patch (br, code);
+
+ x86_fld80_membase (code, AMD64_RSP, 0);
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 12);
+
+ break;
+ }
+ case OP_LCONV_TO_OVF_I: {
+ guint8 *br [3], *label [1];
+
+ if (use_sse2)
+ g_assert_not_reached ();
+
+ /*
+ * Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000
+ */
+ amd64_test_reg_reg (code, ins->sreg1, ins->sreg1);
+
+ /* If the low word top bit is set, see if we are negative */
+ br [0] = code; x86_branch8 (code, X86_CC_LT, 0, TRUE);
+ /* We are not negative (no top bit set, check for our top word to be zero */
+ amd64_test_reg_reg (code, ins->sreg2, ins->sreg2);
+ br [1] = code; x86_branch8 (code, X86_CC_EQ, 0, TRUE);
+ label [0] = code;
+
+ /* throw exception */
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC, "OverflowException");
+ x86_jump32 (code, 0);
+
+ amd64_patch (br [0], code);
+ /* our top bit is set, check that top word is 0xfffffff */
+ amd64_alu_reg_imm (code, X86_CMP, ins->sreg2, 0xffffffff);
+
+ amd64_patch (br [1], code);
+ /* nope, emit exception */
+ br [2] = code; x86_branch8 (code, X86_CC_NE, 0, TRUE);
+ amd64_patch (br [2], label [0]);
+
+ if (ins->dreg != ins->sreg1)
+ amd64_mov_reg_reg (code, ins->dreg, ins->sreg1, 4);
+ break;
+ }
+ case CEE_CONV_OVF_U4:
+ amd64_alu_reg_imm (code, X86_CMP, ins->sreg1, 0);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_LT, TRUE, "OverflowException");
+ amd64_mov_reg_reg (code, ins->dreg, ins->sreg1, 8);
+ break;
+ case CEE_CONV_OVF_I4_UN:
+ amd64_alu_reg_imm (code, X86_CMP, ins->sreg1, 0x7fffffff);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_GT, FALSE, "OverflowException");
+ amd64_mov_reg_reg (code, ins->dreg, ins->sreg1, 8);
+ break;
+ case OP_FMOVE:
+ if (use_sse2 && (ins->dreg != ins->sreg1))
+ amd64_sse_movsd_reg_reg (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_FADD:
+ if (use_sse2)
+ amd64_sse_addsd_reg_reg (code, ins->dreg, ins->sreg2);
+ else
+ amd64_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_FSUB:
+ if (use_sse2)
+ amd64_sse_subsd_reg_reg (code, ins->dreg, ins->sreg2);
+ else
+ amd64_fp_op_reg (code, X86_FSUB, 1, TRUE);
+ break;
+ case OP_FMUL:
+ if (use_sse2)
+ amd64_sse_mulsd_reg_reg (code, ins->dreg, ins->sreg2);
+ else
+ amd64_fp_op_reg (code, X86_FMUL, 1, TRUE);
+ break;
+ case OP_FDIV:
+ if (use_sse2)
+ amd64_sse_divsd_reg_reg (code, ins->dreg, ins->sreg2);
+ else
+ amd64_fp_op_reg (code, X86_FDIV, 1, TRUE);
+ break;
+ case OP_FNEG:
+ if (use_sse2) {
+ amd64_mov_reg_imm_size (code, AMD64_R11, 0x8000000000000000, 8);
+ amd64_push_reg (code, AMD64_R11);
+ amd64_push_reg (code, AMD64_R11);
+ amd64_sse_xorpd_reg_membase (code, ins->dreg, AMD64_RSP, 0);
+ }
+ else
+ amd64_fchs (code);
+ break;
+ case OP_SIN:
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_fsin (code);
+ amd64_fldz (code);
+ amd64_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_COS:
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_fcos (code);
+ amd64_fldz (code);
+ amd64_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_ABS:
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_fabs (code);
+ break;
+ case OP_TAN: {
+ /*
+ * it really doesn't make sense to inline all this code,
+ * it's here just to show that things may not be as simple
+ * as they appear.
+ */
+ guchar *check_pos, *end_tan, *pop_jump;
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_push_reg (code, AMD64_RAX);
+ amd64_fptan (code);
+ amd64_fnstsw (code);
+ amd64_test_reg_imm (code, AMD64_RAX, X86_FP_C2);
+ check_pos = code;
+ x86_branch8 (code, X86_CC_NE, 0, FALSE);
+ amd64_fstp (code, 0); /* pop the 1.0 */
+ end_tan = code;
+ x86_jump8 (code, 0);
+ amd64_fldpi (code);
+ amd64_fp_op (code, X86_FADD, 0);
+ amd64_fxch (code, 1);
+ x86_fprem1 (code);
+ amd64_fstsw (code);
+ amd64_test_reg_imm (code, AMD64_RAX, X86_FP_C2);
+ pop_jump = code;
+ x86_branch8 (code, X86_CC_NE, 0, FALSE);
+ amd64_fstp (code, 1);
+ amd64_fptan (code);
+ amd64_patch (pop_jump, code);
+ amd64_fstp (code, 0); /* pop the 1.0 */
+ amd64_patch (check_pos, code);
+ amd64_patch (end_tan, code);
+ amd64_fldz (code);
+ amd64_fp_op_reg (code, X86_FADD, 1, TRUE);
+ amd64_pop_reg (code, AMD64_RAX);
+ break;
+ }
+ case OP_ATAN:
+ if (use_sse2)
+ g_assert_not_reached ();
+ x86_fld1 (code);
+ amd64_fpatan (code);
+ amd64_fldz (code);
+ amd64_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_SQRT:
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_fsqrt (code);
+ break;
+ case OP_X86_FPOP:
+ if (!use_sse2)
+ amd64_fstp (code, 0);
+ break;
+ case OP_FREM: {
+ guint8 *l1, *l2;
+
+ if (use_sse2)
+ g_assert_not_reached ();
+ amd64_push_reg (code, AMD64_RAX);
+ /* we need to exchange ST(0) with ST(1) */
+ amd64_fxch (code, 1);
+
+ /* this requires a loop, because fprem somtimes
+ * returns a partial remainder */
+ l1 = code;
+ /* looks like MS is using fprem instead of the IEEE compatible fprem1 */
+ /* x86_fprem1 (code); */
+ amd64_fprem (code);
+ amd64_fnstsw (code);
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, X86_FP_C2);
+ l2 = code + 2;
+ x86_branch8 (code, X86_CC_NE, l1 - l2, FALSE);
+
+ /* pop result */
+ amd64_fstp (code, 1);
+
+ amd64_pop_reg (code, AMD64_RAX);
+ break;
+ }
+ case OP_FCOMPARE:
+ if (use_sse2) {
+ amd64_sse_comisd_reg_reg (code, ins->sreg1, ins->sreg2);
+ break;
+ }
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ amd64_fcomip (code, 1);
+ amd64_fstp (code, 0);
+ break;
+ }
+ /* this overwrites EAX */
+ EMIT_FPCOMPARE(code);
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, X86_FP_CC_MASK);
+ break;
+ case OP_FCEQ:
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ /* zeroing the register at the start results in
+ * shorter and faster code (we can also remove the widening op)
+ */
+ guchar *unordered_check;
+ amd64_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg);
+
+ if (use_sse2)
+ amd64_sse_comisd_reg_reg (code, ins->sreg1, ins->sreg2);
+ else {
+ amd64_fcomip (code, 1);
+ amd64_fstp (code, 0);
+ }
+ unordered_check = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ amd64_set_reg (code, X86_CC_EQ, ins->dreg, FALSE);
+ amd64_patch (unordered_check, code);
+ break;
+ }
+ if (ins->dreg != AMD64_RAX)
+ amd64_push_reg (code, AMD64_RAX);
+
+ EMIT_FPCOMPARE(code);
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, X86_FP_CC_MASK);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, 0x4000);
+ amd64_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+
+ if (ins->dreg != AMD64_RAX)
+ amd64_pop_reg (code, AMD64_RAX);
+ break;
+ case OP_FCLT:
+ case OP_FCLT_UN:
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ /* zeroing the register at the start results in
+ * shorter and faster code (we can also remove the widening op)
+ */
+ amd64_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg);
+ if (use_sse2)
+ amd64_sse_comisd_reg_reg (code, ins->sreg1, ins->sreg2);
+ else {
+ amd64_fcomip (code, 1);
+ amd64_fstp (code, 0);
+ }
+ if (ins->opcode == OP_FCLT_UN) {
+ guchar *unordered_check = code;
+ guchar *jump_to_end;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ amd64_set_reg (code, X86_CC_GT, ins->dreg, FALSE);
+ jump_to_end = code;
+ x86_jump8 (code, 0);
+ amd64_patch (unordered_check, code);
+ amd64_inc_reg (code, ins->dreg);
+ amd64_patch (jump_to_end, code);
+ } else {
+ amd64_set_reg (code, X86_CC_GT, ins->dreg, FALSE);
+ }
+ break;
+ }
+ if (ins->dreg != AMD64_RAX)
+ amd64_push_reg (code, AMD64_RAX);
+
+ EMIT_FPCOMPARE(code);
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, X86_FP_CC_MASK);
+ if (ins->opcode == OP_FCLT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ amd64_patch (is_not_zero_check, code);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_CC_MASK);
+
+ amd64_patch (end_jump, code);
+ }
+ amd64_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+
+ if (ins->dreg != AMD64_RAX)
+ amd64_pop_reg (code, AMD64_RAX);
+ break;
+ case OP_FCGT:
+ case OP_FCGT_UN:
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ /* zeroing the register at the start results in
+ * shorter and faster code (we can also remove the widening op)
+ */
+ guchar *unordered_check;
+ amd64_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg);
+ if (use_sse2)
+ amd64_sse_comisd_reg_reg (code, ins->sreg1, ins->sreg2);
+ else {
+ amd64_fcomip (code, 1);
+ amd64_fstp (code, 0);
+ }
+ if (ins->opcode == OP_FCGT) {
+ unordered_check = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ amd64_set_reg (code, X86_CC_LT, ins->dreg, FALSE);
+ amd64_patch (unordered_check, code);
+ } else {
+ amd64_set_reg (code, X86_CC_LT, ins->dreg, FALSE);
+ }
+ break;
+ }
+ if (ins->dreg != AMD64_RAX)
+ amd64_push_reg (code, AMD64_RAX);
+
+ EMIT_FPCOMPARE(code);
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, X86_FP_CC_MASK);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_C0);
+ if (ins->opcode == OP_FCGT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ amd64_patch (is_not_zero_check, code);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_CC_MASK);
+
+ amd64_patch (end_jump, code);
+ }
+ amd64_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+
+ if (ins->dreg != AMD64_RAX)
+ amd64_pop_reg (code, AMD64_RAX);
+ break;
+ case OP_FBEQ:
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ guchar *jump = code;
+ x86_branch8 (code, X86_CC_P, 0, TRUE);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ amd64_patch (jump, code);
+ break;
+ }
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, 0x4000);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, TRUE);
+ break;
+ case OP_FBNE_UN:
+ /* Branch if C013 != 100 */
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ /* branch if !ZF or (PF|CF) */
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_P, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_B, FALSE);
+ break;
+ }
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_C3);
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ break;
+ case OP_FBLT:
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ EMIT_COND_BRANCH (ins, X86_CC_GT, FALSE);
+ break;
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBLT_UN:
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ EMIT_COND_BRANCH (ins, X86_CC_P, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_GT, FALSE);
+ break;
+ }
+ if (ins->opcode == OP_FBLT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ amd64_patch (is_not_zero_check, code);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_CC_MASK);
+
+ amd64_patch (end_jump, code);
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBGT:
+ case OP_FBGT_UN:
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ EMIT_COND_BRANCH (ins, X86_CC_LT, FALSE);
+ break;
+ }
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_C0);
+ if (ins->opcode == OP_FBGT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ amd64_patch (is_not_zero_check, code);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_CC_MASK);
+
+ amd64_patch (end_jump, code);
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBGE:
+ /* Branch if C013 == 100 or 001 */
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ guchar *br1;
+
+ /* skip branch if C1=1 */
+ br1 = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ /* branch if (C0 | C3) = 1 */
+ EMIT_COND_BRANCH (ins, X86_CC_BE, FALSE);
+ amd64_patch (br1, code);
+ break;
+ }
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_C0);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_C3);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBGE_UN:
+ /* Branch if C013 == 000 */
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ EMIT_COND_BRANCH (ins, X86_CC_LE, FALSE);
+ break;
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ break;
+ case OP_FBLE:
+ /* Branch if C013=000 or 100 */
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ guchar *br1;
+
+ /* skip branch if C1=1 */
+ br1 = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ /* branch if C0=0 */
+ EMIT_COND_BRANCH (ins, X86_CC_NB, FALSE);
+ amd64_patch (br1, code);
+ break;
+ }
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, (X86_FP_C0|X86_FP_C1));
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, 0);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBLE_UN:
+ /* Branch if C013 != 001 */
+ if (use_sse2 || (cfg->opt & MONO_OPT_FCMOV)) {
+ EMIT_COND_BRANCH (ins, X86_CC_P, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_GE, FALSE);
+ break;
+ }
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_C0);
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ break;
+ case CEE_CKFINITE: {
+ if (use_sse2) {
+ /* Transfer value to the fp stack */
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+ amd64_movsd_membase_reg (code, AMD64_RSP, 0, ins->sreg1);
+ amd64_fld_membase (code, AMD64_RSP, 0, TRUE);
+ }
+ amd64_push_reg (code, AMD64_RAX);
+ amd64_fxam (code);
+ amd64_fnstsw (code);
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, 0x4100);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, X86_FP_C0);
+ amd64_pop_reg (code, AMD64_RAX);
+ if (use_sse2) {
+ amd64_fstp (code, 0);
+ }
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_EQ, FALSE, "ArithmeticException");
+ break;
+ }
+ case OP_X86_TLS_GET: {
+ x86_prefix (code, X86_FS_PREFIX);
+ amd64_mov_reg_mem (code, ins->dreg, ins->inst_offset, 8);
+ break;
+ }
+ default:
+ g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
+ g_assert_not_reached ();
+ }
+
+ if ((code - cfg->native_code - offset) > max_len) {
+ g_warning ("wrong maximal instruction length of instruction %s (expected %d, got %ld)",
+ mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset);
+ g_assert_not_reached ();
+ }
+
+ cpos += max_len;
+
+ last_ins = ins;
+ last_offset = offset;
+
+ ins = ins->next;
+ }
+
+ cfg->code_len = code - cfg->native_code;
+}
+
+void
+mono_arch_register_lowlevel_calls (void)
+{
+}
+
+void
+mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
+{
+ MonoJumpInfo *patch_info;
+
+ for (patch_info = ji; patch_info; patch_info = patch_info->next) {
+ unsigned char *ip = patch_info->ip.i + code;
+ const unsigned char *target;
+
+ target = mono_resolve_patch_target (method, domain, code, patch_info, run_cctors);
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_METHOD_REL:
+ case MONO_PATCH_INFO_METHOD_JUMP:
+ *((gconstpointer *)(ip + 2)) = target;
+ continue;
+ case MONO_PATCH_INFO_SWITCH: {
+ *((gconstpointer *)(ip + 2)) = target;
+ continue;
+ }
+ case MONO_PATCH_INFO_IID:
+ *((guint32 *)(ip + 2)) = (guint32)(guint64)target;
+ continue;
+ case MONO_PATCH_INFO_CLASS_INIT: {
+ /* Might already been changed to a nop */
+ guint8* ip2 = ip;
+ amd64_set_reg_template (ip2, GP_SCRATCH_REG);
+ amd64_call_reg (ip2, GP_SCRATCH_REG);
+ *((gconstpointer *)(ip + 2)) = target;
+ continue;
+ }
+ case MONO_PATCH_INFO_R8:
+ case MONO_PATCH_INFO_R4:
+ g_assert_not_reached ();
+ continue;
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IMAGE:
+ case MONO_PATCH_INFO_FIELD:
+ case MONO_PATCH_INFO_VTABLE:
+ case MONO_PATCH_INFO_SFLDA:
+ case MONO_PATCH_INFO_EXC_NAME:
+ case MONO_PATCH_INFO_LDSTR:
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE:
+ case MONO_PATCH_INFO_LDTOKEN:
+ case MONO_PATCH_INFO_IP:
+ *((gconstpointer *)(ip + 2)) = target;
+ continue;
+ case MONO_PATCH_INFO_METHOD:
+ *((gconstpointer *)(ip + 2)) = target;
+ continue;
+ case MONO_PATCH_INFO_ABS:
+ case MONO_PATCH_INFO_INTERNAL_METHOD:
+ break;
+ default:
+ break;
+ }
+ amd64_patch (ip, (gpointer)target);
+ }
+}
+
+guint8 *
+mono_arch_emit_prolog (MonoCompile *cfg)
+{
+ MonoMethod *method = cfg->method;
+ MonoBasicBlock *bb;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ int alloc_size, pos, max_offset, i;
+ guint8 *code;
+ CallInfo *cinfo;
+
+ cfg->code_size = MAX (((MonoMethodNormal *)method)->header->code_size * 4, 512);
+ code = cfg->native_code = g_malloc (cfg->code_size);
+
+ amd64_push_reg (code, AMD64_RBP);
+ amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, sizeof (gpointer));
+
+ /* Stack alignment check */
+#if 0
+ {
+ amd64_mov_reg_reg (code, AMD64_RAX, AMD64_RSP, 8);
+ amd64_alu_reg_imm (code, X86_AND, AMD64_RAX, 0xf);
+ amd64_alu_reg_imm (code, X86_CMP, AMD64_RAX, 0);
+ x86_branch8 (code, X86_CC_EQ, 2, FALSE);
+ amd64_breakpoint (code);
+ }
+#endif
+
+ alloc_size = ALIGN_TO (cfg->stack_offset, MONO_ARCH_FRAME_ALIGNMENT);
+ pos = 0;
+
+ if (method->save_lmf) {
+
+ pos = ALIGN_TO (pos + sizeof (MonoLMF), 16);
+
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, pos);
+
+ gint32 lmf_offset = - cfg->arch.lmf_offset;
+
+ /* Save ip */
+ amd64_lea_membase (code, AMD64_R11, AMD64_RIP, 0);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, rip), AMD64_R11, 8);
+ /* Save fp */
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, ebp), AMD64_RBP, 8);
+ /* Save method */
+ /* FIXME: add a relocation for this */
+ if (IS_IMM32 (cfg->method))
+ amd64_mov_membase_imm (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, method), (guint64)cfg->method, 8);
+ else {
+ amd64_mov_reg_imm (code, AMD64_R11, cfg->method);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, method), AMD64_R11, 8);
+ }
+ /* Save callee saved regs */
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, rbx), AMD64_RBX, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r12), AMD64_R12, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r13), AMD64_R13, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r14), AMD64_R14, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r15), AMD64_R15, 8);
+ } else {
+
+ for (i = 0; i < AMD64_NREG; ++i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (cfg->used_int_regs & (1 << i))) {
+ amd64_push_reg (code, i);
+ pos += sizeof (gpointer);
+ }
+ }
+
+ alloc_size -= pos;
+
+ if (alloc_size) {
+ /* See mono_emit_stack_alloc */
+#ifdef PLATFORM_WIN32
+ guint32 remaining_size = alloc_size;
+ while (remaining_size >= 0x1000) {
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 0x1000);
+ amd64_test_membase_reg (code, AMD64_RSP, 0, AMD64_RSP);
+ remaining_size -= 0x1000;
+ }
+ if (remaining_size)
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, remaining_size);
+#else
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, alloc_size);
+#endif
+ }
+
+ /* compute max_offset in order to use short forward jumps */
+ max_offset = 0;
+ if (cfg->opt & MONO_OPT_BRANCH) {
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *ins = bb->code;
+ bb->max_offset = max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE)
+ max_offset += 6;
+ /* max alignment for loops */
+ if ((cfg->opt & MONO_OPT_LOOP) && bb_is_loop_start (bb))
+ max_offset += LOOP_ALIGNMENT;
+
+ while (ins) {
+ if (ins->opcode == OP_LABEL)
+ ins->inst_c1 = max_offset;
+
+ max_offset += ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+ ins = ins->next;
+ }
+ }
+ }
+
+ sig = method->signature;
+ pos = 0;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ if (sig->ret->type != MONO_TYPE_VOID) {
+ if ((cinfo->ret.storage == ArgInIReg) && (cfg->ret->opcode != OP_REGVAR)) {
+ /* Save volatile arguments to the stack */
+ amd64_mov_membase_reg (code, cfg->ret->inst_basereg, cfg->ret->inst_offset, cinfo->ret.reg, 8);
+ }
+ }
+
+ /* Keep this in sync with emit_load_volatile_arguments */
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ gint32 stack_offset;
+ MonoType *arg_type;
+ inst = cfg->varinfo [i];
+
+ if (sig->hasthis && (i == 0))
+ arg_type = &mono_defaults.object_class->byval_arg;
+ else
+ arg_type = sig->params [i - sig->hasthis];
+
+ stack_offset = ainfo->offset + ARGS_OFFSET;
+
+ /* Save volatile arguments to the stack */
+ if (inst->opcode != OP_REGVAR) {
+ switch (ainfo->storage) {
+ case ArgInIReg: {
+ guint32 size = 8;
+
+ /* FIXME: I1 etc */
+ /*
+ if (stack_offset & 0x1)
+ size = 1;
+ else if (stack_offset & 0x2)
+ size = 2;
+ else if (stack_offset & 0x4)
+ size = 4;
+ else
+ size = 8;
+ */
+ amd64_mov_membase_reg (code, inst->inst_basereg, inst->inst_offset, ainfo->reg, size);
+ break;
+ }
+ case ArgInFloatSSEReg:
+ amd64_movss_membase_reg (code, inst->inst_basereg, inst->inst_offset, ainfo->reg);
+ break;
+ case ArgInDoubleSSEReg:
+ amd64_movsd_membase_reg (code, inst->inst_basereg, inst->inst_offset, ainfo->reg);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (inst->opcode == OP_REGVAR) {
+ /* Argument allocated to (non-volatile) register */
+ switch (ainfo->storage) {
+ case ArgInIReg:
+ amd64_mov_reg_reg (code, inst->dreg, ainfo->reg, 8);
+ break;
+ case ArgOnStack:
+ amd64_mov_reg_membase (code, inst->dreg, AMD64_RBP, ARGS_OFFSET + ainfo->offset, 8);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+ }
+
+ if (method->save_lmf) {
+ if (lmf_tls_offset != -1) {
+ /* Load lmf quicky using the FS register */
+ x86_prefix (code, X86_FS_PREFIX);
+ amd64_mov_reg_mem (code, AMD64_RAX, lmf_tls_offset, 8);
+ }
+ else {
+ /*
+ * The call might clobber argument registers, but they are already
+ * saved to the stack/global regs.
+ */
+
+ code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_get_lmf_addr");
+ }
+
+ gint32 lmf_offset = - cfg->arch.lmf_offset;
+
+ /* Save lmf_addr */
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, lmf_addr), AMD64_RAX, 8);
+ /* Save previous_lmf */
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RAX, 0, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, previous_lmf), AMD64_R11, 8);
+ /* Set new lmf */
+ amd64_lea_membase (code, AMD64_R11, AMD64_RBP, lmf_offset);
+ amd64_mov_membase_reg (code, AMD64_RAX, 0, AMD64_R11, 8);
+ }
+
+
+ g_free (cinfo);
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ code = mono_arch_instrument_prolog (cfg, mono_trace_enter_method, code, TRUE);
+
+ cfg->code_len = code - cfg->native_code;
+
+ g_assert (cfg->code_len < cfg->code_size);
+
+ return code;
+}
+
+void
+mono_arch_emit_epilog (MonoCompile *cfg)
+{
+ MonoJumpInfo *patch_info;
+ MonoMethod *method = cfg->method;
+ int pos, i;
+ guint8 *code;
+
+ code = cfg->native_code + cfg->code_len;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ code = mono_arch_instrument_epilog (cfg, mono_trace_leave_method, code, TRUE);
+
+ /* the code restoring the registers must be kept in sync with CEE_JMP */
+ pos = 0;
+
+ if (method->save_lmf) {
+ gint32 lmf_offset = - cfg->arch.lmf_offset;
+
+ /* Restore previous lmf */
+ amd64_mov_reg_membase (code, AMD64_RCX, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, previous_lmf), 8);
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, lmf_addr), 8);
+ amd64_mov_membase_reg (code, AMD64_R11, 0, AMD64_RCX, 8);
+
+ /* Restore caller saved regs */
+ if (cfg->used_int_regs & (1 << AMD64_RBX)) {
+ amd64_mov_reg_membase (code, AMD64_RBX, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, rbx), 8);
+ }
+ if (cfg->used_int_regs & (1 << AMD64_R12)) {
+ amd64_mov_reg_membase (code, AMD64_R12, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r12), 8);
+ }
+ if (cfg->used_int_regs & (1 << AMD64_R13)) {
+ amd64_mov_reg_membase (code, AMD64_R13, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r13), 8);
+ }
+ if (cfg->used_int_regs & (1 << AMD64_R14)) {
+ amd64_mov_reg_membase (code, AMD64_R14, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r14), 8);
+ }
+ if (cfg->used_int_regs & (1 << AMD64_R15)) {
+ amd64_mov_reg_membase (code, AMD64_R15, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r15), 8);
+ }
+ } else {
+
+ for (i = 0; i < AMD64_NREG; ++i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (cfg->used_int_regs & (1 << i)))
+ pos -= sizeof (gpointer);
+
+ if (pos) {
+ if (pos == - sizeof (gpointer)) {
+ /* Only one register, so avoid lea */
+ for (i = AMD64_NREG - 1; i > 0; --i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (cfg->used_int_regs & (1 << i))) {
+ amd64_mov_reg_membase (code, i, AMD64_RBP, pos, 8);
+ }
+ }
+ else {
+ amd64_lea_membase (code, AMD64_RSP, AMD64_RBP, pos);
+
+ /* Pop registers in reverse order */
+ for (i = AMD64_NREG - 1; i > 0; --i)
+ if (AMD64_IS_CALLEE_SAVED_REG (i) && (cfg->used_int_regs & (1 << i))) {
+ amd64_pop_reg (code, i);
+ }
+ }
+ }
+ }
+
+ amd64_leave (code);
+ amd64_ret (code);
+
+ /* add code to raise exceptions */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_EXC: {
+ guint64 offset;
+
+ amd64_patch (patch_info->ip.i + cfg->native_code, code);
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC_NAME, patch_info->data.target);
+ amd64_set_reg_template (code, AMD64_RDI);
+ /* 7 is the length of the lea */
+ offset = (((guint64)code + 7) - (guint64)cfg->native_code) - (guint64)patch_info->ip.i;
+ amd64_lea_membase (code, AMD64_RSI, AMD64_RIP, - offset);
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->data.name = "mono_arch_throw_exception_by_name";
+ patch_info->ip.i = code - cfg->native_code;
+ EMIT_CALL ();
+ break;
+ }
+ default:
+ /* do nothing */
+ break;
+ }
+ }
+
+ /* Handle relocations with RIP relative addressing */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ gboolean remove = FALSE;
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_R8: {
+ code = (guint8*)ALIGN_TO (code, 8);
+
+ guint8* pos = cfg->native_code + patch_info->ip.i;
+
+ *(double*)code = *(double*)patch_info->data.target;
+
+ if (use_sse2)
+ *(guint32*)(pos + 4) = (guint8*)code - pos - 8;
+ else
+ *(guint32*)(pos + 3) = (guint8*)code - pos - 7;
+ code += 8;
+
+ remove = TRUE;
+ break;
+ }
+ case MONO_PATCH_INFO_R4: {
+ code = (guint8*)ALIGN_TO (code, 8);
+
+ guint8* pos = cfg->native_code + patch_info->ip.i;
+
+ *(float*)code = *(float*)patch_info->data.target;
+
+ if (use_sse2)
+ *(guint32*)(pos + 4) = (guint8*)code - pos - 8;
+ else
+ *(guint32*)(pos + 3) = (guint8*)code - pos - 7;
+ code += 4;
+
+ remove = TRUE;
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (remove) {
+ if (patch_info == cfg->patch_info)
+ cfg->patch_info = patch_info->next;
+ else {
+ MonoJumpInfo *tmp;
+
+ for (tmp = cfg->patch_info; tmp->next != patch_info; tmp = tmp->next)
+ ;
+ tmp->next = patch_info->next;
+ }
+ }
+ }
+
+ cfg->code_len = code - cfg->native_code;
+
+ g_assert (cfg->code_len < cfg->code_size);
+
+}
+
+/*
+ * Allow tracing to work with this interface (with an optional argument)
+ */
+
+/*
+ * This may be needed on some archs or for debugging support.
+ */
+void
+mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code)
+{
+ /* no stack room needed now (may be needed for FASTCALL-trace support) */
+ *stack = 0;
+ /* split prolog-epilog requirements? */
+ *code = 50; /* max bytes needed: check this number */
+}
+
+void*
+mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+ CallInfo *cinfo;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ int i, n, stack_area = 0;
+
+ /* Keep this in sync with mono_arch_get_argument_info */
+
+ if (enable_arguments) {
+ /* Allocate a new area on the stack and save arguments there */
+ sig = cfg->method->signature;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ n = sig->param_count + sig->hasthis;
+
+ stack_area = ALIGN_TO (n * 8, 16);
+
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, stack_area);
+
+ for (i = 0; i < n; ++i) {
+ inst = cfg->varinfo [i];
+
+ if (inst->opcode == OP_REGVAR)
+ amd64_mov_membase_reg (code, AMD64_RSP, (i * 8), inst->dreg, 8);
+ else {
+ amd64_mov_reg_membase (code, AMD64_R11, inst->inst_basereg, inst->inst_offset, 8);
+ amd64_mov_membase_reg (code, AMD64_RSP, (i * 8), AMD64_R11, 8);
+ }
+ }
+ }
+
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_METHODCONST, cfg->method);
+ amd64_set_reg_template (code, AMD64_RDI);
+ amd64_mov_reg_reg (code, AMD64_RSI, AMD64_RSP, 8);
+ code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, (gpointer)func);
+
+ if (enable_arguments) {
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, stack_area);
+
+ g_free (cinfo);
+ }
+
+ return code;
+}
+
+enum {
+ SAVE_NONE,
+ SAVE_STRUCT,
+ SAVE_EAX,
+ SAVE_EAX_EDX,
+ SAVE_XMM
+};
+
+void*
+mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+ int save_mode = SAVE_NONE;
+ MonoMethod *method = cfg->method;
+ int rtype = mono_type_get_underlying_type (method->signature->ret)->type;
+
+ switch (rtype) {
+ case MONO_TYPE_VOID:
+ /* special case string .ctor icall */
+ if (strcmp (".ctor", method->name) && method->klass == mono_defaults.string_class)
+ save_mode = SAVE_EAX;
+ else
+ save_mode = SAVE_NONE;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ save_mode = SAVE_EAX;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ save_mode = SAVE_XMM;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ save_mode = SAVE_STRUCT;
+ break;
+ default:
+ save_mode = SAVE_EAX;
+ break;
+ }
+
+ /* Save the result and copy it into the proper argument register */
+ switch (save_mode) {
+ case SAVE_EAX:
+ amd64_push_reg (code, AMD64_RAX);
+ /* Align stack */
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+ if (enable_arguments)
+ amd64_mov_reg_reg (code, AMD64_RSI, AMD64_RAX, 8);
+ break;
+ case SAVE_STRUCT:
+ /* FIXME: */
+ if (enable_arguments)
+ amd64_mov_reg_imm (code, AMD64_RSI, 0);
+ break;
+ case SAVE_XMM:
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+ amd64_movsd_membase_reg (code, AMD64_RSP, 0, AMD64_XMM0);
+ /* Align stack */
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8);
+ /*
+ * The result is already in the proper argument register so no copying
+ * needed.
+ */
+ break;
+ case SAVE_NONE:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ /* Set %al since this is a varargs call */
+ if (save_mode == SAVE_XMM)
+ amd64_mov_reg_imm (code, AMD64_RAX, 1);
+ else
+ amd64_mov_reg_imm (code, AMD64_RAX, 0);
+
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_METHODCONST, method);
+ amd64_set_reg_template (code, AMD64_RDI);
+ code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, (gpointer)func);
+
+ /* Restore result */
+ switch (save_mode) {
+ case SAVE_EAX:
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ amd64_pop_reg (code, AMD64_RAX);
+ break;
+ case SAVE_STRUCT:
+ /* FIXME: */
+ break;
+ case SAVE_XMM:
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ amd64_movsd_reg_membase (code, AMD64_XMM0, AMD64_RSP, 0);
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ break;
+ case SAVE_NONE:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return code;
+}
+
+int
+mono_arch_max_epilog_size (MonoCompile *cfg)
+{
+ int max_epilog_size = 16;
+ MonoJumpInfo *patch_info;
+
+ if (cfg->method->save_lmf)
+ max_epilog_size += 256;
+
+ if (mono_jit_trace_calls != NULL)
+ max_epilog_size += 50;
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ max_epilog_size += 50;
+
+ max_epilog_size += (AMD64_NREG * 2);
+
+ /*
+ * make sure we have enough space for exceptions
+ */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_EXC)
+ max_epilog_size += 40;
+ if (patch_info->type == MONO_PATCH_INFO_R8)
+ max_epilog_size += 8 + 7; /* sizeof (double) + alignment */
+ if (patch_info->type == MONO_PATCH_INFO_R4)
+ max_epilog_size += 4 + 7; /* sizeof (float) + alignment */
+ }
+
+ return max_epilog_size;
+}
+
+void
+mono_arch_flush_icache (guint8 *code, gint size)
+{
+ /* Not needed */
+}
+
+void
+mono_arch_flush_register_windows (void)
+{
+}
+
+gboolean
+mono_arch_is_inst_imm (gint64 imm)
+{
+ return amd64_is_imm32 (imm);
+}
+
+#define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
+
+static int reg_to_ucontext_reg [] = {
+ REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI,
+ REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15,
+ REG_RIP
+};
+
+/*
+ * Determine whenever the trap whose info is in SIGINFO is caused by
+ * integer overflow.
+ */
+gboolean
+mono_arch_is_int_overflow (void *sigctx)
+{
+ ucontext_t *ctx = (ucontext_t*)sigctx;
+ guint8* rip;
+ int reg;
+
+ rip = (guint8*)ctx->uc_mcontext.gregs [REG_RIP];
+
+ if (IS_REX (rip [0])) {
+ reg = amd64_rex_r (rip [0]);
+ rip ++;
+ }
+ else
+ reg = 0;
+
+ if ((rip [0] == 0xf7) && (x86_modrm_mod (rip [1]) == 0x3) && (x86_modrm_reg (rip [1]) == 0x7)) {
+ /* idiv REG */
+ reg += x86_modrm_rm (rip [1]);
+
+ if (ctx->uc_mcontext.gregs [reg_to_ucontext_reg [reg]] == -1)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+gpointer*
+mono_amd64_get_vcall_slot_addr (guint8* code, guint64 *regs)
+{
+ guint32 reg;
+ guint32 disp;
+ guint8 rex = 0;
+
+ /* go to the start of the call instruction
+ *
+ * address_byte = (m << 6) | (o << 3) | reg
+ * call opcode: 0xff address_byte displacement
+ * 0xff m=1,o=2 imm8
+ * 0xff m=2,o=2 imm32
+ */
+ code -= 7;
+
+ if (IS_REX (code [4]) && (code [5] == 0xff) && (amd64_modrm_reg (code [6]) == 0x2) && (amd64_modrm_mod (code [6]) == 0x3)) {
+ /* call *%reg */
+ return NULL;
+ }
+ else if ((code [1] == 0xff) && (amd64_modrm_reg (code [2]) == 0x2) && (amd64_modrm_mod (code [2]) == 0x2)) {
+ /* call *[reg+disp32] */
+ if (IS_REX (code [0]))
+ rex = code [0];
+ reg = amd64_modrm_rm (code [2]);
+ disp = *(guint32*)(code + 3);
+ //printf ("B: [%%r%d+0x%x]\n", reg, disp);
+ }
+ else if ((code [4] == 0xff) && (amd64_modrm_reg (code [5]) == 0x2) && (amd64_modrm_mod (code [5]) == 0x1)) {
+ /* call *[reg+disp8] */
+ if (IS_REX (code [3]))
+ rex = code [3];
+ reg = amd64_modrm_rm (code [5]);
+ disp = *(guint8*)(code + 6);
+ //printf ("B: [%%r%d+0x%x]\n", reg, disp);
+ }
+ else if ((code [5] == 0xff) && (amd64_modrm_reg (code [6]) == 0x2) && (amd64_modrm_mod (code [6]) == 0x0)) {
+ /*
+ * This is a interface call: should check the above code can't catch it earlier
+ * 8b 40 30 mov 0x30(%eax),%eax
+ * ff 10 call *(%eax)
+ */
+ if (IS_REX (code [4]))
+ rex = code [4];
+ reg = amd64_modrm_rm (code [6]);
+ disp = 0;
+ }
+ else
+ g_assert_not_reached ();
+
+ reg += amd64_rex_b (rex);
+
+ return (gpointer)((regs [reg]) + disp);
+}
+
+/*
+ * Support for fast access to the thread-local lmf structure using the GS
+ * segment register on NPTL + kernel 2.6.x.
+ */
+
+static gboolean tls_offset_inited = FALSE;
+
+/* code should be simply return <tls var>; */
+static int
+read_tls_offset_from_method (void* method)
+{
+ guint8 *code = (guint8*)method;
+
+ /*
+ * Determine the offset of mono_lfm_addr inside the TLS structures
+ * by disassembling the function above.
+ */
+ /* This is generated by gcc 3.3.2 */
+ if ((code [0] == 0x55) && (code [1] == 0x48) && (code [2] == 0x89) &&
+ (code [3] == 0xe5) && (code [4] == 0x64) && (code [5] == 0x48) &&
+ (code [6] == 0x8b) && (code [7] == 0x04) && (code [8] == 0x25) &&
+ (code [9] == 0x00) && (code [10] == 0x00) && (code [11] == 0x00) &&
+ (code [12] == 0x0) && (code [13] == 0x48) && (code [14] == 0x8b) &&
+ (code [15] == 0x80)) {
+ return *(gint32*)&(code [16]);
+ } else if
+ /* This is generated by gcc-3.3.2 with -O=2 */
+ /* mov fs:0, %rax ; mov <offset>(%rax), %rax ; retq */
+ ((code [0] == 0x64) && (code [1] == 0x48) && (code [2] == 0x8b) &&
+ (code [3] == 0x04) && (code [4] == 0x25) &&
+ (code [9] == 0x48) && (code [10] == 0x8b) && (code [11] == 0x80) &&
+ (code [16] == 0xc3)) {
+ return *(gint32*)&(code [12]);
+ } else if
+ /* This is generated by gcc-3.4.1 */
+ ((code [0] == 0x55) && (code [1] == 0x48) && (code [2] == 0x89) &&
+ (code [3] == 0xe5) && (code [4] == 0x64) && (code [5] == 0x48) &&
+ (code [6] == 0x8b) && (code [7] == 0x04) && (code [8] == 0x25) &&
+ (code [13] == 0xc9) && (code [14] == 0xc3)) {
+ return *(gint32*)&(code [9]);
+ } else if
+ /* This is generated by gcc-3.4.1 with -O=2 */
+ ((code [0] == 0x64) && (code [1] == 0x48) && (code [2] == 0x8b) &&
+ (code [3] == 0x04) && (code [4] == 0x25)) {
+ return *(gint32*)&(code [5]);
+ }
+
+ return -1;
+}
+
+void
+mono_arch_setup_jit_tls_data (MonoJitTlsData *tls)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ pthread_t self = pthread_self();
+ pthread_attr_t attr;
+ void *staddr = NULL;
+ size_t stsize = 0;
+ struct sigaltstack sa;
+#endif
+
+ if (!tls_offset_inited) {
+ tls_offset_inited = TRUE;
+
+ lmf_tls_offset = read_tls_offset_from_method (mono_get_lmf_addr);
+ appdomain_tls_offset = read_tls_offset_from_method (mono_domain_get);
+ //thread_tls_offset = read_tls_offset_from_method (mono_thread_current);
+ }
+
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+
+ /* Determine stack boundaries */
+ if (!mono_running_on_valgrind ()) {
+#ifdef HAVE_PTHREAD_GETATTR_NP
+ pthread_getattr_np( self, &attr );
+#else
+#ifdef HAVE_PTHREAD_ATTR_GET_NP
+ pthread_attr_get_np( self, &attr );
+#elif defined(sun)
+ pthread_attr_init( &attr );
+ pthread_attr_getstacksize( &attr, &stsize );
+#else
+#error "Not implemented"
+#endif
+#endif
+#ifndef sun
+ pthread_attr_getstack( &attr, &staddr, &stsize );
+#endif
+ }
+
+ /*
+ * staddr seems to be wrong for the main thread, so we keep the value in
+ * tls->end_of_stack
+ */
+ tls->stack_size = stsize;
+
+ /* Setup an alternate signal stack */
+ tls->signal_stack = g_malloc (SIGNAL_STACK_SIZE);
+ tls->signal_stack_size = SIGNAL_STACK_SIZE;
+
+ sa.ss_sp = tls->signal_stack;
+ sa.ss_size = SIGNAL_STACK_SIZE;
+ sa.ss_flags = SS_ONSTACK;
+ sigaltstack (&sa, NULL);
+#endif
+}
+
+void
+mono_arch_free_jit_tls_data (MonoJitTlsData *tls)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ struct sigaltstack sa;
+
+ sa.ss_sp = tls->signal_stack;
+ sa.ss_size = SIGNAL_STACK_SIZE;
+ sa.ss_flags = SS_DISABLE;
+ sigaltstack (&sa, NULL);
+
+ if (tls->signal_stack)
+ g_free (tls->signal_stack);
+#endif
+}
+
+void
+mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg)
+{
+ int out_reg = param_regs [0];
+
+ /* FIXME: RDI and RSI might get clobbered */
+
+ if (vt_reg != -1) {
+ CallInfo * cinfo = get_call_info (inst->signature, FALSE);
+ MonoInst *vtarg;
+
+ if (cinfo->ret.storage == ArgValuetypeInReg) {
+ /*
+ * The valuetype is in RAX:RDX after the call, need to be copied to
+ * the stack. Push the address here, so the call instruction can
+ * access it.
+ */
+ MONO_INST_NEW (cfg, vtarg, OP_X86_PUSH);
+ vtarg->sreg1 = vt_reg;
+ mono_bblock_add_inst (cfg->cbb, vtarg);
+
+ /* Align stack */
+ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SUB_IMM, X86_ESP, X86_ESP, 8);
+ }
+ else {
+ MONO_INST_NEW (cfg, vtarg, OP_SETREG);
+ vtarg->sreg1 = vt_reg;
+ vtarg->dreg = out_reg;
+ out_reg = param_regs [1];
+ mono_bblock_add_inst (cfg->cbb, vtarg);
+ }
+
+ g_free (cinfo);
+ }
+
+ /* add the this argument */
+ if (this_reg != -1) {
+ MonoInst *this;
+ MONO_INST_NEW (cfg, this, OP_SETREG);
+ this->type = this_type;
+ this->sreg1 = this_reg;
+ this->dreg = out_reg;
+ mono_bblock_add_inst (cfg->cbb, this);
+ }
+}
+
+gint
+mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
+{
+ if (use_sse2)
+ return -1;
+
+ if (cmethod->klass == mono_defaults.math_class) {
+ if (strcmp (cmethod->name, "Sin") == 0)
+ return OP_SIN;
+ else if (strcmp (cmethod->name, "Cos") == 0)
+ return OP_COS;
+ else if (strcmp (cmethod->name, "Tan") == 0)
+ return OP_TAN;
+ else if (strcmp (cmethod->name, "Atan") == 0)
+ return OP_ATAN;
+ else if (strcmp (cmethod->name, "Sqrt") == 0)
+ return OP_SQRT;
+ else if (strcmp (cmethod->name, "Abs") == 0 && fsig->params [0]->type == MONO_TYPE_R8)
+ return OP_ABS;
+#if 0
+ /* OP_FREM is not IEEE compatible */
+ else if (strcmp (cmethod->name, "IEEERemainder") == 0)
+ return OP_FREM;
+#endif
+ else
+ return -1;
+ } else {
+ return -1;
+ }
+ return -1;
+}
+
+
+gboolean
+mono_arch_print_tree (MonoInst *tree, int arity)
+{
+ return 0;
+}
+
+MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg)
+{
+ MonoInst* ins;
+
+ if (appdomain_tls_offset == -1)
+ return NULL;
+
+ MONO_INST_NEW (cfg, ins, OP_X86_TLS_GET);
+ ins->inst_offset = appdomain_tls_offset;
+ return ins;
+}
+
+MonoInst* mono_arch_get_thread_intrinsic (MonoCompile* cfg)
+{
+ MonoInst* ins;
+
+ if (thread_tls_offset == -1)
+ return NULL;
+
+ MONO_INST_NEW (cfg, ins, OP_X86_TLS_GET);
+ ins->inst_offset = thread_tls_offset;
+ return ins;
+}
diff --git a/mono/mini/mini-amd64.h b/mono/mini/mini-amd64.h
new file mode 100644
index 00000000000..3d0afd44f1b
--- /dev/null
+++ b/mono/mini/mini-amd64.h
@@ -0,0 +1,229 @@
+#ifndef __MONO_MINI_AMD64_H__
+#define __MONO_MINI_AMD64_H__
+
+#include <mono/arch/amd64/amd64-codegen.h>
+#include <glib.h>
+
+#ifdef PLATFORM_WIN32
+#include <windows.h>
+/* use SIG* defines if possible */
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+/* sigcontext surrogate */
+struct sigcontext {
+ guint64 eax;
+ guint64 ebx;
+ guint64 ecx;
+ guint64 edx;
+ guint64 ebp;
+ guint64 esp;
+ guint64 esi;
+ guint64 edi;
+ guint64 eip;
+};
+
+typedef void (* MonoW32ExceptionHandler) (int);
+void win32_seh_init(void);
+void win32_seh_cleanup(void);
+void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler);
+
+#ifndef SIGFPE
+#define SIGFPE 4
+#endif
+
+#ifndef SIGILL
+#define SIGILL 8
+#endif
+
+#ifndef SIGSEGV
+#define SIGSEGV 11
+#endif
+
+LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep);
+
+#endif /* PLATFORM_WIN32 */
+
+#ifdef sun // Solaris x86
+# undef SIGSEGV_ON_ALTSTACK
+# define MONO_ARCH_USE_SIGACTION 1
+struct sigcontext {
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned long edi;
+ unsigned long esi;
+ unsigned long ebp;
+ unsigned long esp;
+ unsigned long ebx;
+ unsigned long edx;
+ unsigned long ecx;
+ unsigned long eax;
+ unsigned long trapno;
+ unsigned long err;
+ unsigned long eip;
+ unsigned short cs, __csh;
+ unsigned long eflags;
+ unsigned long esp_at_signal;
+ unsigned short ss, __ssh;
+ unsigned long fpstate[95];
+ unsigned long filler[5];
+};
+#endif // sun, Solaris x86
+
+/* Enables OP_LSHL, OP_LSHL_IMM, OP_LSHR, OP_LSHR_IMM, OP_LSHR_UN, OP_LSHR_UN_IMM */
+#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
+
+#define MONO_MAX_IREGS 16
+
+#define MONO_MAX_FREGS AMD64_XMM_NREG
+
+#define MONO_ARCH_FRAME_ALIGNMENT 16
+
+/* fixme: align to 16byte instead of 32byte (we align to 32byte to get
+ * reproduceable results for benchmarks */
+#define MONO_ARCH_CODE_ALIGNMENT 32
+
+#define MONO_ARCH_BASEREG X86_EBP
+#define MONO_ARCH_RETREG1 X86_EAX
+#define MONO_ARCH_RETREG2 X86_EDX
+
+#define MONO_ARCH_ENCODE_LREG(r1,r2) (r1 | (r2<<3))
+
+#define inst_dreg_low dreg&7
+#define inst_dreg_high dreg>>3
+#define inst_sreg1_low sreg1&7
+#define inst_sreg1_high sreg1>>3
+#define inst_sreg2_low sreg2&7
+#define inst_sreg2_high sreg2>>3
+
+struct MonoLMF {
+ gpointer previous_lmf;
+ gpointer lmf_addr;
+ MonoMethod *method;
+ guint64 rip;
+ guint64 rbx;
+ guint64 ebp;
+ guint64 r12;
+ guint64 r13;
+ guint64 r14;
+ guint64 r15;
+};
+
+typedef struct MonoCompileArch {
+ gint32 lmf_offset;
+ gint32 localloc_offset;
+} MonoCompileArch;
+
+typedef struct {
+ guint64 rax;
+ guint64 rbx;
+ guint64 rcx;
+ guint64 rdx;
+ guint64 rbp;
+ guint64 rsp;
+ guint64 rsi;
+ guint64 rdi;
+ guint64 rip;
+ guint64 r12;
+ guint64 r13;
+ guint64 r14;
+ guint64 r15;
+} MonoContext;
+
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+# define SC_EAX sc_eax
+# define SC_EBX sc_ebx
+# define SC_ECX sc_ecx
+# define SC_EDX sc_edx
+# define SC_EBP sc_ebp
+# define SC_EIP sc_eip
+# define SC_ESP sc_esp
+# define SC_EDI sc_edi
+# define SC_ESI sc_esi
+#else
+# define SC_EAX rax
+# define SC_EBX rbx
+# define SC_ECX rcx
+# define SC_EDX rdx
+# define SC_EBP rbp
+# define SC_EIP rip
+# define SC_ESP rsp
+# define SC_EDI rdi
+# define SC_ESI rsi
+
+# define SC_RIP rip
+# define SC_RSP rsp
+# define SC_RBP rbp
+# define SC_RBX rbx
+# define SC_R12 r12
+# define SC_R13 r13
+# define SC_R14 r14
+# define SC_R15 r15
+
+#endif
+
+#define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->rip = (long)(ip); } while (0);
+#define MONO_CONTEXT_SET_BP(ctx,bp) do { (ctx)->rbp = (long)(bp); } while (0);
+#define MONO_CONTEXT_SET_SP(ctx,esp) do { (ctx)->rsp = (long)(esp); } while (0);
+
+#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->rip))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->rbp))
+#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->rsp))
+
+#define MONO_ARCH_USE_SIGACTION 1
+
+/*
+ * some icalls like mono_array_new_va needs to be called using a different
+ * calling convention.
+ */
+#define MONO_ARCH_VARARG_ICALLS 1
+
+#ifndef PLATFORM_WIN32
+
+#ifdef HAVE_WORKING_SIGALTSTACK
+
+/*
+ * FIXME: For some reason, when sigaltstack is enabled, the uc_mcontext member
+ * in ucontext_t is not at the offset indicated by the definition of ucontext_t.
+ */
+
+//#define MONO_ARCH_SIGSEGV_ON_ALTSTACK
+
+/* NetBSD doesn't define SA_STACK */
+#ifndef SA_STACK
+#define SA_STACK SA_ONSTACK
+#endif
+#endif
+
+#endif
+
+/* Enables OP_LSHL, OP_LSHL_IMM, OP_LSHR, OP_LSHR_IMM, OP_LSHR_UN, OP_LSHR_UN_IMM */
+#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
+
+#define MONO_ARCH_EMULATE_CONV_R8_UN 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
+#define MONO_ARCH_EMULATE_FREM 1
+#define MONO_ARCH_NEED_DIV_CHECK 1
+#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
+
+#define MONO_ARCH_ENABLE_EMIT_STATE_OPT 1
+#define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
+#define MONO_ARCH_HAVE_RETHROW 1
+
+gpointer*
+mono_amd64_get_vcall_slot_addr (guint8* code, guint64 *regs);
+
+void
+mono_amd64_exceptions_init (void);
+
+void
+mono_amd64_tramp_init (void);
+
+/* FIXME: */
+//#define MONO_ARCH_BIGMUL_INTRINS 1
+
+#endif /* __MONO_MINI_AMD64_H__ */
+
diff --git a/mono/mini/mini-arch.h b/mono/mini/mini-arch.h
new file mode 100644
index 00000000000..4661c0b4180
--- /dev/null
+++ b/mono/mini/mini-arch.h
@@ -0,0 +1,22 @@
+#ifndef __MONO_MINI_ARCH_H__
+#define __MONO_MINI_ARCH_H__
+
+#ifdef __i386__
+#include "mini-x86.h"
+#elif defined(__x86_64__)
+#include "mini-amd64.h"
+#elif defined(__ppc__) || defined(__powerpc__)
+#include "mini-ppc.h"
+#elif defined(__sparc__) || defined(sparc)
+#include "mini-sparc.h"
+#elif defined(__s390__) || defined(s390)
+# if defined(__s390x__)
+# include "mini-s390x.h"
+# else
+# include "mini-s390.h"
+# endif
+#else
+#error add arch specific include file in mini-arch.h
+#endif
+
+#endif /* __MONO_MINI_ARCH_H__ */
diff --git a/mono/mini/mini-exceptions.c b/mono/mini/mini-exceptions.c
new file mode 100644
index 00000000000..2bdc60c90f0
--- /dev/null
+++ b/mono/mini/mini-exceptions.c
@@ -0,0 +1,521 @@
+/*
+ * mini-exceptions.c: generic exception support
+ *
+ * Authors:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <signal.h>
+#include <string.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/mono-debug.h>
+
+#include "mini.h"
+
+#define IS_ON_SIGALTSTACK(jit_tls) ((jit_tls) && ((guint8*)&(jit_tls) > (guint8*)(jit_tls)->signal_stack) && ((guint8*)&(jit_tls) < ((guint8*)(jit_tls)->signal_stack + (jit_tls)->signal_stack_size)))
+
+/* mono_find_jit_info:
+ *
+ * This function is used to gather information from @ctx. It return the
+ * MonoJitInfo of the corresponding function, unwinds one stack frame and
+ * stores the resulting context into @new_ctx. It also stores a string
+ * describing the stack location into @trace (if not NULL), and modifies
+ * the @lmf if necessary. @native_offset return the IP offset from the
+ * start of the function or -1 if that info is not available.
+ */
+static MonoJitInfo *
+mono_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx,
+ MonoContext *new_ctx, char **trace, MonoLMF **lmf, int *native_offset,
+ gboolean *managed)
+{
+ gboolean managed2;
+ gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+ MonoJitInfo *ji;
+
+ if (trace)
+ *trace = NULL;
+
+ if (native_offset)
+ *native_offset = -1;
+
+ if (managed)
+ *managed = FALSE;
+
+ ji = mono_arch_find_jit_info (domain, jit_tls, res, prev_ji, ctx, new_ctx, NULL, lmf, NULL, &managed2);
+
+ if (ji == (gpointer)-1)
+ return ji;
+
+ if (managed2 || ji->method->wrapper_type) {
+ char *source_location, *tmpaddr, *fname;
+ gint32 address, iloffset;
+
+ address = (char *)ip - (char *)ji->code_start;
+
+ if (native_offset)
+ *native_offset = address;
+
+ if (managed)
+ if (!ji->method->wrapper_type)
+ *managed = TRUE;
+
+ if (trace) {
+ source_location = mono_debug_source_location_from_address (ji->method, address, NULL, domain);
+ iloffset = mono_debug_il_offset_from_address (ji->method, address, domain);
+
+ if (iloffset < 0)
+ tmpaddr = g_strdup_printf ("<0x%05x>", address);
+ else
+ tmpaddr = g_strdup_printf ("[0x%05x]", iloffset);
+
+ fname = mono_method_full_name (ji->method, TRUE);
+
+ if (source_location)
+ *trace = g_strdup_printf ("in %s (at %s) %s", tmpaddr, source_location, fname);
+ else
+ *trace = g_strdup_printf ("in %s %s", tmpaddr, fname);
+
+ g_free (fname);
+ g_free (source_location);
+ g_free (tmpaddr);
+ }
+ }
+ else {
+ if (trace) {
+ char *fname = mono_method_full_name (res->method, TRUE);
+ *trace = g_strdup_printf ("in (unmanaged) %s", fname);
+ g_free (fname);
+ }
+ }
+
+ return ji;
+}
+
+MonoArray *
+ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ MonoArray *ta = exc->trace_ips;
+ int i, len;
+
+ if (ta == NULL) {
+ /* Exception is not thrown yet */
+ return mono_array_new (domain, mono_defaults.stack_frame_class, 0);
+ }
+
+ len = mono_array_length (ta);
+
+ res = mono_array_new (domain, mono_defaults.stack_frame_class, len > skip ? len - skip : 0);
+
+ for (i = skip; i < len; i++) {
+ MonoJitInfo *ji;
+ MonoStackFrame *sf = (MonoStackFrame *)mono_object_new (domain, mono_defaults.stack_frame_class);
+ gpointer ip = mono_array_get (ta, gpointer, i);
+
+ ji = mono_jit_info_table_find (domain, ip);
+ if (ji == NULL) {
+ /* Unmanaged frame */
+ mono_array_set (res, gpointer, i, sf);
+ continue;
+ }
+
+ g_assert (ji != NULL);
+
+ sf->method = mono_method_get_object (domain, ji->method, NULL);
+ sf->native_offset = (char *)ip - (char *)ji->code_start;
+
+ sf->il_offset = mono_debug_il_offset_from_address (ji->method, sf->native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, sf->native_offset, &sf->line, domain);
+
+ sf->filename = filename? mono_string_new (domain, filename): NULL;
+ sf->column = 0;
+
+ g_free (filename);
+ }
+
+ mono_array_set (res, gpointer, i, sf);
+ }
+
+ return res;
+}
+
+void
+mono_jit_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data) {
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ gint native_offset, il_offset;
+ gboolean managed;
+
+ MonoContext ctx, new_ctx;
+
+ mono_arch_flush_register_windows ();
+
+ MONO_CONTEXT_SET_IP (&ctx, __builtin_return_address (0));
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (1));
+
+ while (MONO_CONTEXT_GET_BP (&ctx) < jit_tls->end_of_stack) {
+
+ ji = mono_find_jit_info (domain, jit_tls, &rji, NULL, &ctx, &new_ctx, NULL, &lmf, &native_offset, &managed);
+ g_assert (ji);
+
+ if (ji == (gpointer)-1)
+ return;
+
+ il_offset = do_il_offset ? mono_debug_il_offset_from_address (ji->method, native_offset, domain): -1;
+
+ if (func (ji->method, native_offset, il_offset, managed, user_data))
+ return;
+
+ ctx = new_ctx;
+ }
+}
+
+MonoBoolean
+ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
+ MonoReflectionMethod **method,
+ gint32 *iloffset, gint32 *native_offset,
+ MonoString **file, gint32 *line, gint32 *column)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ MonoJitInfo *ji, rji;
+ MonoContext ctx, new_ctx;
+
+ mono_arch_flush_register_windows ();
+
+ MONO_CONTEXT_SET_IP (&ctx, ves_icall_get_frame_info);
+ MONO_CONTEXT_SET_BP (&ctx, __builtin_frame_address (0));
+
+ skip++;
+
+ do {
+ ji = mono_find_jit_info (domain, jit_tls, &rji, NULL, &ctx, &new_ctx, NULL, &lmf, native_offset, NULL);
+
+ ctx = new_ctx;
+
+ if (!ji || ji == (gpointer)-1 || MONO_CONTEXT_GET_BP (&ctx) >= jit_tls->end_of_stack)
+ return FALSE;
+
+ /* skip all wrappers ??*/
+ if (ji->method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK ||
+ ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE)
+ continue;
+
+ skip--;
+
+ } while (skip >= 0);
+
+ *method = mono_method_get_object (domain, ji->method, NULL);
+ *iloffset = mono_debug_il_offset_from_address (ji->method, *native_offset, domain);
+
+ if (need_file_info) {
+ gchar *filename;
+
+ filename = mono_debug_source_location_from_address (ji->method, *native_offset, line, domain);
+
+ *file = filename? mono_string_new (domain, filename): NULL;
+ *column = 0;
+
+ g_free (filename);
+ }
+
+ return TRUE;
+}
+
+static MonoArray *
+glist_to_array (GList *list)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoArray *res;
+ int len, i;
+
+ if (!list)
+ return NULL;
+
+ len = g_list_length (list);
+ res = mono_array_new (domain, mono_defaults.int_class, len);
+
+ for (i = 0; list; list = list->next, i++)
+ mono_array_set (res, gpointer, i, list->data);
+
+ return res;
+}
+
+/**
+ * mono_handle_exception:
+ * @ctx: saved processor state
+ * @obj: the exception object
+ * @test_only: only test if the exception is caught, but dont call handlers
+ *
+ */
+gboolean
+mono_handle_exception (MonoContext *ctx, gpointer obj, gpointer original_ip, gboolean test_only)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoJitInfo *ji, rji;
+ static int (*call_filter) (MonoContext *, gpointer) = NULL;
+ static void (*restore_context) (void *);
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ MonoLMF *lmf = jit_tls->lmf;
+ GList *trace_ips = NULL;
+ MonoException *mono_ex;
+ gboolean stack_overflow = FALSE;
+ MonoContext initial_ctx;
+ int frame_count = 0;
+ gboolean gc_disabled = FALSE;
+ MonoString *initial_stack_trace = NULL;
+ GString *trace_str = NULL;
+
+ /*
+ * This function might execute on an alternate signal stack, and Boehm GC
+ * can't handle that.
+ * Also, since the altstack is small, stack space intensive operations like
+ * JIT compilation should be avoided.
+ */
+ if (IS_ON_SIGALTSTACK (jit_tls)) {
+ /*
+ * FIXME: disabling/enabling GC while already on a signal stack might
+ * not be safe either.
+ */
+ /* Have to reenable it later */
+ gc_disabled = TRUE;
+ mono_gc_disable ();
+ }
+
+ g_assert (ctx != NULL);
+ if (!obj) {
+ MonoException *ex = mono_get_exception_null_reference ();
+ ex->message = mono_string_new (domain, "Object reference not set to an instance of an object");
+ obj = (MonoObject *)ex;
+ }
+
+ /*
+ * Allocate a new exception object instead of the preconstructed ones.
+ * We can't do this in sigsegv_signal_handler, since GC is not yet
+ * disabled.
+ */
+ if (obj == domain->stack_overflow_ex) {
+ obj = mono_get_exception_stack_overflow ();
+ }
+ else if (obj == domain->null_reference_ex) {
+ obj = mono_get_exception_null_reference ();
+ }
+
+ if (mono_object_isinst (obj, mono_defaults.exception_class)) {
+ mono_ex = (MonoException*)obj;
+ initial_stack_trace = mono_ex->stack_trace;
+ } else {
+ mono_ex = NULL;
+ }
+
+ if (obj == domain->stack_overflow_ex)
+ stack_overflow = TRUE;
+
+ if (!call_filter)
+ call_filter = mono_arch_get_call_filter ();
+
+ if (!restore_context)
+ restore_context = mono_arch_get_restore_context ();
+
+ g_assert (jit_tls->end_of_stack);
+ g_assert (jit_tls->abort_func);
+
+ if (!test_only) {
+ MonoContext ctx_cp = *ctx;
+ if (mono_jit_trace_calls != NULL)
+ g_print ("EXCEPTION handling: %s\n", mono_object_class (obj)->name);
+ if (!mono_handle_exception (&ctx_cp, obj, original_ip, TRUE)) {
+ if (mono_break_on_exc)
+ G_BREAKPOINT ();
+ mono_unhandled_exception (obj);
+
+ if (mono_debugger_unhandled_exception (original_ip, MONO_CONTEXT_GET_SP (ctx), obj)) {
+ /*
+ * If this returns true, then we're running inside the
+ * Mono Debugger and the debugger wants us to restore the
+ * context and continue (normally, the debugger inserts
+ * a breakpoint on the `original_ip', so it regains control
+ * immediately after restoring the context).
+ */
+ MONO_CONTEXT_SET_IP (ctx, original_ip);
+ restore_context (ctx);
+ g_assert_not_reached ();
+ }
+ }
+ }
+
+ initial_ctx = *ctx;
+ memset (&rji, 0, sizeof (rji));
+
+ while (1) {
+ MonoContext new_ctx;
+ char *trace = NULL;
+ gboolean need_trace = FALSE;
+ guint32 free_stack;
+
+ if (test_only && (frame_count < 1000)) {
+ need_trace = TRUE;
+ if (!trace_str)
+ trace_str = g_string_new ("");
+ }
+
+ ji = mono_find_jit_info (domain, jit_tls, &rji, &rji, ctx, &new_ctx,
+ need_trace ? &trace : NULL, &lmf, NULL, NULL);
+ if (!ji) {
+ g_warning ("Exception inside function without unwind info");
+ g_assert_not_reached ();
+ }
+
+ if (ji != (gpointer)-1) {
+ frame_count ++;
+ //printf ("M: %s %d %d.\n", mono_method_full_name (ji->method, TRUE), frame_count, test_only);
+
+ if (test_only && ji->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE && mono_ex) {
+ /*
+ * Avoid overwriting the stack trace if the exception is
+ * rethrown. Also avoid giant stack traces during a stack
+ * overflow.
+ */
+ if (!initial_stack_trace && (frame_count < 1000)) {
+ trace_ips = g_list_prepend (trace_ips, MONO_CONTEXT_GET_IP (ctx));
+
+ g_string_append (trace_str, trace);
+ g_string_append_c (trace_str, '\n');
+ }
+ }
+
+ if (stack_overflow)
+ free_stack = (guint8*)(MONO_CONTEXT_GET_BP (ctx)) - (guint8*)(MONO_CONTEXT_GET_BP (&initial_ctx));
+ else
+ free_stack = 0xffffff;
+
+ /*
+ * During stack overflow, wait till the unwinding frees some stack
+ * space before running handlers/finalizers.
+ */
+ if ((free_stack > (64 * 1024)) && ji->num_clauses) {
+ int i;
+
+ g_assert (ji->clauses);
+
+ for (i = 0; i < ji->num_clauses; i++) {
+ MonoJitExceptionInfo *ei = &ji->clauses [i];
+ gboolean filtered = FALSE;
+
+ if (ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) <= ei->try_end) {
+ /* catch block */
+
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE) || (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)) {
+ /* store the exception object int cfg->excvar */
+ g_assert (ji->exvar_offset);
+ *((gpointer *)((char *)MONO_CONTEXT_GET_BP (ctx) + ji->exvar_offset)) = obj;
+ if (!initial_stack_trace && trace_str) {
+ mono_ex->stack_trace = mono_string_new (domain, trace_str->str);
+ }
+ }
+
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ mono_debugger_handle_exception (ei->data.filter, MONO_CONTEXT_GET_SP (ctx), obj);
+ filtered = call_filter (ctx, ei->data.filter);
+ }
+
+ if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE &&
+ mono_object_isinst (obj, ei->data.catch_class)) || filtered) {
+ if (test_only) {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ g_free (trace);
+
+ if (gc_disabled)
+ mono_gc_enable ();
+ if (trace_str)
+ g_string_free (trace_str, TRUE);
+ return TRUE;
+ }
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (ji->method))
+ g_print ("EXCEPTION: catch found at clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
+ mono_debugger_handle_exception (ei->handler_start, MONO_CONTEXT_GET_SP (ctx), obj);
+ MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
+ jit_tls->lmf = lmf;
+ g_free (trace);
+
+ if (gc_disabled)
+ mono_gc_enable ();
+ if (trace_str)
+ g_string_free (trace_str, TRUE);
+ return 0;
+ }
+ if (!test_only && ei->try_start <= MONO_CONTEXT_GET_IP (ctx) &&
+ MONO_CONTEXT_GET_IP (ctx) < ei->try_end &&
+ (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (ji->method))
+ g_print ("EXCEPTION: finally clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
+ mono_debugger_handle_exception (ei->handler_start, MONO_CONTEXT_GET_SP (ctx), obj);
+ call_filter (ctx, ei->handler_start);
+ }
+
+ }
+ }
+ }
+ }
+
+ g_free (trace);
+
+ *ctx = new_ctx;
+
+ if ((ji == (gpointer)-1) || MONO_CONTEXT_GET_BP (ctx) >= jit_tls->end_of_stack) {
+ if (gc_disabled)
+ mono_gc_enable ();
+
+ if (!test_only) {
+ jit_tls->lmf = lmf;
+
+ if (IS_ON_SIGALTSTACK (jit_tls)) {
+ /* Switch back to normal stack */
+ if (stack_overflow)
+ /* Free up some stack space */
+ MONO_CONTEXT_SET_SP (&initial_ctx, (guint32)(MONO_CONTEXT_GET_SP (&initial_ctx)) + (64 * 1024));
+ MONO_CONTEXT_SET_IP (&initial_ctx, (unsigned int)jit_tls->abort_func);
+ restore_context (&initial_ctx);
+ }
+ else
+ jit_tls->abort_func (obj);
+ g_assert_not_reached ();
+ } else {
+ if (mono_ex) {
+ trace_ips = g_list_reverse (trace_ips);
+ mono_ex->trace_ips = glist_to_array (trace_ips);
+ }
+ g_list_free (trace_ips);
+ if (trace_str)
+ g_string_free (trace_str, TRUE);
+ return FALSE;
+ }
+ }
+ }
+
+ g_assert_not_reached ();
+}
diff --git a/mono/mini/mini-ops.h b/mono/mini/mini-ops.h
new file mode 100644
index 00000000000..5e66c8f1e31
--- /dev/null
+++ b/mono/mini/mini-ops.h
@@ -0,0 +1,474 @@
+
+MINI_OP(OP_LOAD, "load")
+MINI_OP(OP_LDADDR, "ldaddr")
+MINI_OP(OP_STORE, "store")
+MINI_OP(OP_OBJADDR, "objaddr")
+MINI_OP(OP_VTADDR, "vtaddr")
+MINI_OP(OP_PHI, "phi")
+MINI_OP(OP_RENAME, "rename")
+MINI_OP(OP_COMPARE, "compare")
+MINI_OP(OP_COMPARE_IMM, "compare_imm")
+MINI_OP(OP_FCOMPARE, "fcompare")
+MINI_OP(OP_LCOMPARE, "lcompare")
+MINI_OP(OP_ICOMPARE, "icompare")
+MINI_OP(OP_ICOMPARE_IMM, "icompare_imm")
+MINI_OP(OP_LOCAL, "local")
+MINI_OP(OP_ARG, "arg")
+MINI_OP(OP_ARGLIST, "oparglist")
+MINI_OP(OP_OUTARG, "outarg")
+MINI_OP(OP_OUTARG_REG, "outarg_reg")
+MINI_OP(OP_OUTARG_IMM, "outarg_imm")
+MINI_OP(OP_OUTARG_R4, "outarg_r4")
+MINI_OP(OP_OUTARG_R8, "outarg_r8")
+MINI_OP(OP_OUTARG_VT, "outarg_vt")
+MINI_OP(OP_INARG_VT, "inarg_vt")
+MINI_OP(OP_RETARG, "retarg")
+MINI_OP(OP_SETRET, "setret")
+MINI_OP(OP_SETFRET, "setfret")
+MINI_OP(OP_SETLRET, "setlret")
+MINI_OP(OP_SETREG, "setreg")
+MINI_OP(OP_SETREGIMM, "setregimm")
+MINI_OP(OP_SETFREG, "setfreg")
+MINI_OP(OP_CHECK_THIS, "checkthis")
+MINI_OP(OP_VOIDCALL, "voidcall")
+MINI_OP(OP_VOIDCALLVIRT, "voidcallvirt")
+MINI_OP(OP_VOIDCALL_REG, "voidcall_reg")
+MINI_OP(OP_VOIDCALL_MEMBASE, "voidcall_membase")
+MINI_OP(OP_FCALL, "fcall")
+MINI_OP(OP_FCALLVIRT, "fcallvirt")
+MINI_OP(OP_FCALL_REG, "fcall_reg")
+MINI_OP(OP_FCALL_MEMBASE, "fcall_membase")
+MINI_OP(OP_LCALL, "lcall")
+MINI_OP(OP_LCALLVIRT, "lcallvirt")
+MINI_OP(OP_LCALL_REG, "lcall_reg")
+MINI_OP(OP_LCALL_MEMBASE, "lcall_membase")
+MINI_OP(OP_VCALL, "vcall")
+MINI_OP(OP_VCALLVIRT, "vcallvirt")
+MINI_OP(OP_VCALL_REG, "vcall_reg")
+MINI_OP(OP_VCALL_MEMBASE, "vcall_membase")
+MINI_OP(OP_CALL_REG, "call_reg")
+MINI_OP(OP_CALL_MEMBASE, "call_membase")
+MINI_OP(OP_TRAP, "trap")
+MINI_OP(OP_ICONST, "iconst")
+MINI_OP(OP_I8CONST, "i8const")
+MINI_OP(OP_R4CONST, "r4const")
+MINI_OP(OP_R8CONST, "r8const")
+MINI_OP(OP_REGVAR, "regvar")
+MINI_OP(OP_REG, "reg")
+MINI_OP(OP_REGOFFSET, "regoffset")
+MINI_OP(OP_LABEL, "label")
+MINI_OP(OP_CHECK_ARRAY_TYPE, "check_array_type")
+MINI_OP(OP_ARRAY_RANK, "array_rank")
+MINI_OP(OP_THROW_OR_NULL, "throw_or_null")
+MINI_OP(OP_RETHROW, "op_rethrow")
+MINI_OP(OP_REFANYTYPE, "refanytype")
+MINI_OP(OP_NEWOBJ, "op_newobj")
+
+MINI_OP(OP_STORE_MEMBASE_IMM,"store_membase_imm")
+MINI_OP(OP_STORE_MEMBASE_REG,"store_membase_reg")
+MINI_OP(OP_STOREI1_MEMBASE_IMM, "storei1_membase_imm")
+MINI_OP(OP_STOREI1_MEMBASE_REG, "storei1_membase_reg")
+MINI_OP(OP_STOREI2_MEMBASE_IMM, "storei2_membase_imm")
+MINI_OP(OP_STOREI2_MEMBASE_REG, "storei2_membase_reg")
+MINI_OP(OP_STOREI4_MEMBASE_IMM, "storei4_membase_imm")
+MINI_OP(OP_STOREI4_MEMBASE_REG, "storei4_membase_reg")
+MINI_OP(OP_STOREI8_MEMBASE_IMM, "storei8_membase_imm")
+MINI_OP(OP_STOREI8_MEMBASE_REG, "storei8_membase_reg")
+MINI_OP(OP_STORER4_MEMBASE_REG, "storer4_membase_reg")
+MINI_OP(OP_STORER8_MEMBASE_REG, "storer8_membase_reg")
+MINI_OP(OP_LOAD_MEMBASE, "load_membase")
+MINI_OP(OP_LOADI1_MEMBASE,"loadi1_membase")
+MINI_OP(OP_LOADU1_MEMBASE,"loadu1_membase")
+MINI_OP(OP_LOADI2_MEMBASE,"loadi2_membase")
+MINI_OP(OP_LOADU2_MEMBASE,"loadu2_membase")
+MINI_OP(OP_LOADI4_MEMBASE,"loadi4_membase")
+MINI_OP(OP_LOADU4_MEMBASE,"loadu4_membase")
+MINI_OP(OP_LOADI8_MEMBASE,"loadi8_membase")
+MINI_OP(OP_LOADR4_MEMBASE,"loadr4_membase")
+MINI_OP(OP_LOADR8_MEMBASE,"loadr8_membase")
+MINI_OP(OP_LOADR8_SPILL_MEMBASE,"loadr8_spill_membase")
+MINI_OP(OP_LOADU4_MEM,"loadu4_mem")
+MINI_OP(OP_MOVE, "move")
+MINI_OP(OP_FMOVE, "fmove")
+
+MINI_OP(OP_ADD_IMM, "add_imm")
+MINI_OP(OP_SUB_IMM, "sub_imm")
+MINI_OP(OP_MUL_IMM, "mul_imm")
+MINI_OP(OP_DIV_IMM, "div_imm")
+MINI_OP(OP_DIV_UN_IMM, "div_un_imm")
+MINI_OP(OP_REM_IMM, "rem_imm")
+MINI_OP(OP_REM_UN_IMM, "rem_un_imm")
+MINI_OP(OP_AND_IMM, "and_imm")
+MINI_OP(OP_OR_IMM, "or_imm")
+MINI_OP(OP_XOR_IMM, "xor_imm")
+MINI_OP(OP_SHL_IMM, "shl_imm")
+MINI_OP(OP_SHR_IMM, "shr_imm")
+MINI_OP(OP_SHR_UN_IMM, "shr_un_imm")
+
+/* exceptions: must be in the same order as the matching CEE_ branch opcodes */
+MINI_OP(OP_COND_EXC_EQ, "cond_exc_eq")
+MINI_OP(OP_COND_EXC_GE, "cond_exc_ge")
+MINI_OP(OP_COND_EXC_GT, "cond_exc_gt")
+MINI_OP(OP_COND_EXC_LE, "cond_exc_le")
+MINI_OP(OP_COND_EXC_LT, "cond_exc_lt")
+MINI_OP(OP_COND_EXC_NE_UN, "cond_exc_ne_un")
+MINI_OP(OP_COND_EXC_GE_UN, "cond_exc_ge_un")
+MINI_OP(OP_COND_EXC_GT_UN, "cond_exc_gt_un")
+MINI_OP(OP_COND_EXC_LE_UN, "cond_exc_le_un")
+MINI_OP(OP_COND_EXC_LT_UN, "cond_exc_lt_un")
+
+MINI_OP(OP_COND_EXC_OV, "cond_exc_ov")
+MINI_OP(OP_COND_EXC_NO, "cond_exc_no")
+MINI_OP(OP_COND_EXC_C, "cond_exc_c")
+MINI_OP(OP_COND_EXC_NC, "cond_exc_nc")
+
+/* 64 bit opcodes: must be in the same order as the matching CEE_ opcodes: binops_op_map */
+MINI_OP(OP_LADD, "long_add")
+MINI_OP(OP_LSUB, "long_sub")
+MINI_OP(OP_LMUL, "long_mul")
+MINI_OP(OP_LDIV, "long_div")
+MINI_OP(OP_LDIV_UN, "long_div_un")
+MINI_OP(OP_LREM, "long_rem")
+MINI_OP(OP_LREM_UN, "long_rem_un")
+MINI_OP(OP_LAND, "long_and")
+MINI_OP(OP_LOR, "long_or")
+MINI_OP(OP_LXOR, "long_xor")
+MINI_OP(OP_LSHL, "long_shl")
+MINI_OP(OP_LSHR, "long_shr")
+MINI_OP(OP_LSHR_UN, "long_shr_un")
+
+/* 64 bit opcodes: must be in the same order as the matching CEE_ opcodes: unops_op_map */
+MINI_OP(OP_LNEG, "long_neg")
+MINI_OP(OP_LNOT, "long_not")
+MINI_OP(OP_LCONV_TO_I1,"long_conv_to_i1")
+MINI_OP(OP_LCONV_TO_I2,"long_conv_to_i2")
+MINI_OP(OP_LCONV_TO_I4,"long_conv_to_i4")
+MINI_OP(OP_LCONV_TO_I8,"long_conv_to_i8")
+MINI_OP(OP_LCONV_TO_R4,"long_conv_to_r4")
+MINI_OP(OP_LCONV_TO_R8,"long_conv_to_r8")
+MINI_OP(OP_LCONV_TO_U4,"long_conv_to_u4")
+MINI_OP(OP_LCONV_TO_U8,"long_conv_to_u8")
+
+MINI_OP(OP_LCONV_TO_U2, "long_conv_to_u2")
+MINI_OP(OP_LCONV_TO_U1, "long_conv_to_u1")
+MINI_OP(OP_LCONV_TO_I, "long_conv_to_i")
+MINI_OP(OP_LCONV_TO_OVF_I,"long_conv_to_ovf_i")
+MINI_OP(OP_LCONV_TO_OVF_U,"long_conv_to_ovf_u")
+MINI_OP(OP_LADD_OVF, "long_add_ovf")
+MINI_OP(OP_LADD_OVF_UN, "long_add_ovf_un")
+MINI_OP(OP_LMUL_OVF, "long_mul_ovf")
+MINI_OP(OP_LMUL_OVF_UN, "long_mul_ovf_un")
+MINI_OP(OP_LSUB_OVF, "long_sub_ovf")
+MINI_OP(OP_LSUB_OVF_UN, "long_sub_ovf_un")
+
+MINI_OP(OP_LCONV_TO_OVF_I1_UN,"long_conv_to_ovf_i1_un")
+MINI_OP(OP_LCONV_TO_OVF_I2_UN,"long_conv_to_ovf_i2_un")
+MINI_OP(OP_LCONV_TO_OVF_I4_UN,"long_conv_to_ovf_i4_un")
+MINI_OP(OP_LCONV_TO_OVF_I8_UN,"long_conv_to_ovf_i8_un")
+MINI_OP(OP_LCONV_TO_OVF_U1_UN,"long_conv_to_ovf_u1_un")
+MINI_OP(OP_LCONV_TO_OVF_U2_UN,"long_conv_to_ovf_u2_un")
+MINI_OP(OP_LCONV_TO_OVF_U4_UN,"long_conv_to_ovf_u4_un")
+MINI_OP(OP_LCONV_TO_OVF_U8_UN,"long_conv_to_ovf_u8_un")
+MINI_OP(OP_LCONV_TO_OVF_I_UN, "long_conv_to_ovf_i_un")
+MINI_OP(OP_LCONV_TO_OVF_U_UN, "long_conv_to_ovf_u_un")
+
+MINI_OP(OP_LCONV_TO_OVF_I1,"long_conv_to_ovf_i1")
+MINI_OP(OP_LCONV_TO_OVF_U1,"long_conv_to_ovf_u1")
+MINI_OP(OP_LCONV_TO_OVF_I2,"long_conv_to_ovf_i2")
+MINI_OP(OP_LCONV_TO_OVF_U2,"long_conv_to_ovf_u2")
+MINI_OP(OP_LCONV_TO_OVF_I4,"long_conv_to_ovf_i4")
+MINI_OP(OP_LCONV_TO_OVF_U4,"long_conv_to_ovf_u4")
+MINI_OP(OP_LCONV_TO_OVF_I8,"long_conv_to_ovf_i8")
+MINI_OP(OP_LCONV_TO_OVF_U8,"long_conv_to_ovf_u8")
+
+MINI_OP(OP_LCEQ, "long_ceq")
+MINI_OP(OP_LCGT, "long_cgt")
+MINI_OP(OP_LCGT_UN,"long_cgt_un")
+MINI_OP(OP_LCLT, "long_clt")
+MINI_OP(OP_LCLT_UN,"long_clt_un")
+
+MINI_OP(OP_LCONV_TO_R_UN,"long_conv_to_r_un")
+MINI_OP(OP_LCONV_TO_U, "long_conv_to_u")
+MINI_OP(OP_LSHR_IMM, "long_shr_imm")
+MINI_OP(OP_LSHR_UN_IMM, "long_shr_un_imm")
+MINI_OP(OP_LSHL_IMM, "long_shl_imm")
+MINI_OP(OP_LADD_IMM, "long_add_imm")
+MINI_OP(OP_LSUB_IMM, "long_sub_imm")
+
+MINI_OP(OP_LBEQ, "long_beq")
+MINI_OP(OP_LBNE_UN, "long_bne_un")
+MINI_OP(OP_LBLT, "long_blt")
+MINI_OP(OP_LBLT_UN, "long_blt_un")
+MINI_OP(OP_LBGT, "long_bgt")
+MINI_OP(OP_LBGT_UN, "long_btg_un")
+MINI_OP(OP_LBGE, "long_bge")
+MINI_OP(OP_LBGE_UN, "long_bge_un")
+MINI_OP(OP_LBLE, "long_ble")
+MINI_OP(OP_LBLE_UN, "long_ble_un")
+
+/* 32 bit opcodes on 64 bit machines */
+MINI_OP(OP_IADD, "int_add")
+MINI_OP(OP_ISUB, "int_sub")
+MINI_OP(OP_IMUL, "int_mul")
+MINI_OP(OP_IMUL_OVF, "int_mul_ovf")
+MINI_OP(OP_IMUL_OVF_UN, "int_mul_ovf_un")
+MINI_OP(OP_IDIV, "int_div")
+MINI_OP(OP_IDIV_UN, "int_div_un")
+MINI_OP(OP_IREM, "int_rem")
+MINI_OP(OP_IREM_UN, "int_rem_un")
+MINI_OP(OP_IAND, "int_and")
+MINI_OP(OP_IOR, "int_or")
+MINI_OP(OP_IXOR, "int_xor")
+MINI_OP(OP_ISHL, "int_shl")
+MINI_OP(OP_ISHR, "int_shr")
+MINI_OP(OP_ISHR_UN, "int_shr_un")
+MINI_OP(OP_IADC, "int_adc")
+MINI_OP(OP_IADC_IMM, "int_adc_imm")
+MINI_OP(OP_ISBB, "int_sbb")
+MINI_OP(OP_ISBB_IMM, "int_sbb_imm")
+MINI_OP(OP_IADDCC, "int_addcc")
+MINI_OP(OP_ISUBCC, "int_subcc")
+
+MINI_OP(OP_IADD_IMM, "int_add_imm")
+MINI_OP(OP_ISUB_IMM, "int_sub_imm")
+MINI_OP(OP_IMUL_IMM, "int_mul_imm")
+MINI_OP(OP_IDIV_IMM, "int_div_imm")
+MINI_OP(OP_IDIV_UN_IMM, "int_div_un_imm")
+MINI_OP(OP_IREM_IMM, "int_rem_imm")
+MINI_OP(OP_IREM_UN_IMM, "int_rem_un_imm")
+MINI_OP(OP_IAND_IMM, "int_and_imm")
+MINI_OP(OP_IOR_IMM, "int_or_imm")
+MINI_OP(OP_IXOR_IMM, "int_xor_imm")
+MINI_OP(OP_ISHL_IMM, "int_shl_imm")
+MINI_OP(OP_ISHR_IMM, "int_shr_imm")
+MINI_OP(OP_ISHR_UN_IMM, "int_shr_un_imm")
+
+MINI_OP(OP_INEG, "int_neg")
+MINI_OP(OP_INOT, "int_not")
+
+MINI_OP(OP_ICEQ, "int_ceq")
+MINI_OP(OP_ICGT, "int_cgt")
+MINI_OP(OP_ICGT_UN,"int_cgt_un")
+MINI_OP(OP_ICLT, "int_clt")
+MINI_OP(OP_ICLT_UN,"int_clt_un")
+
+MINI_OP(OP_IBEQ, "int_beq")
+MINI_OP(OP_IBNE_UN, "int_bne_un")
+MINI_OP(OP_IBLT, "int_blt")
+MINI_OP(OP_IBLT_UN, "int_blt_un")
+MINI_OP(OP_IBGT, "int_bgt")
+MINI_OP(OP_IBGT_UN, "int_bgt_un")
+MINI_OP(OP_IBGE, "int_bge")
+MINI_OP(OP_IBGE_UN, "int_bge_un")
+MINI_OP(OP_IBLE, "int_ble")
+MINI_OP(OP_IBLE_UN, "int_ble_un")
+
+MINI_OP(OP_COND_EXC_IOV, "cond_exc_iov")
+MINI_OP(OP_COND_EXC_IC, "cond_exc_ic")
+
+MINI_OP(OP_FBEQ, "float_beq")
+MINI_OP(OP_FBNE_UN,"float_bne_un")
+MINI_OP(OP_FBLT, "float_blt")
+MINI_OP(OP_FBLT_UN,"float_blt_un")
+MINI_OP(OP_FBGT, "float_bgt")
+MINI_OP(OP_FBGT_UN,"float_btg_un")
+MINI_OP(OP_FBGE, "float_bge")
+MINI_OP(OP_FBGE_UN,"float_bge_un")
+MINI_OP(OP_FBLE, "float_ble")
+MINI_OP(OP_FBLE_UN,"float_ble_un")
+
+MINI_OP(OP_LONG_SHRUN_32, "long_shr_un_32")
+
+/* float opcodes: must be in the same order as the matching CEE_ opcodes: binops_op_map */
+MINI_OP(OP_FADD, "float_add")
+MINI_OP(OP_FSUB, "float_sub")
+MINI_OP(OP_FMUL, "float_mul")
+MINI_OP(OP_FDIV, "float_div")
+MINI_OP(OP_FDIV_UN,"float_div_un")
+MINI_OP(OP_FREM, "float_rem")
+MINI_OP(OP_FREM_UN,"float_rem_un")
+
+/* float opcodes: must be in the same order as the matching CEE_ opcodes: unops_op_map */
+MINI_OP(OP_FNEG, "float_neg")
+MINI_OP(OP_FNOT, "float_not")
+MINI_OP(OP_FCONV_TO_I1,"float_conv_to_i1")
+MINI_OP(OP_FCONV_TO_I2,"float_conv_to_i2")
+MINI_OP(OP_FCONV_TO_I4,"float_conv_to_i4")
+MINI_OP(OP_FCONV_TO_I8,"float_conv_to_i8")
+MINI_OP(OP_FCONV_TO_R4,"float_conv_to_r4")
+MINI_OP(OP_FCONV_TO_R8,"float_conv_to_r8")
+MINI_OP(OP_FCONV_TO_U4,"float_conv_to_u4")
+MINI_OP(OP_FCONV_TO_U8,"float_conv_to_u8")
+
+MINI_OP(OP_FCONV_TO_U2, "float_conv_to_u2")
+MINI_OP(OP_FCONV_TO_U1, "float_conv_to_u1")
+MINI_OP(OP_FCONV_TO_I, "float_conv_to_i")
+MINI_OP(OP_FCONV_TO_OVF_I,"float_conv_to_ovf_i")
+MINI_OP(OP_FCONV_TO_OVF_U,"float_conv_to_ovd_u")
+MINI_OP(OP_FADD_OVF, "float_add_ovf")
+MINI_OP(OP_FADD_OVF_UN, "float_add_ovf_un")
+MINI_OP(OP_FMUL_OVF, "float_mul_ovf")
+MINI_OP(OP_FMUL_OVF_UN, "float_mul_ovf_un")
+MINI_OP(OP_FSUB_OVF, "float_sub_ovf")
+MINI_OP(OP_FSUB_OVF_UN, "float_sub_ovf_un")
+
+MINI_OP(OP_FCONV_TO_OVF_I1_UN,"float_conv_to_ovf_i1_un")
+MINI_OP(OP_FCONV_TO_OVF_I2_UN,"float_conv_to_ovf_i2_un")
+MINI_OP(OP_FCONV_TO_OVF_I4_UN,"float_conv_to_ovf_i4_un")
+MINI_OP(OP_FCONV_TO_OVF_I8_UN,"float_conv_to_ovf_i8_un")
+MINI_OP(OP_FCONV_TO_OVF_U1_UN,"float_conv_to_ovf_u1_un")
+MINI_OP(OP_FCONV_TO_OVF_U2_UN,"float_conv_to_ovf_u2_un")
+MINI_OP(OP_FCONV_TO_OVF_U4_UN,"float_conv_to_ovf_u4_un")
+MINI_OP(OP_FCONV_TO_OVF_U8_UN,"float_conv_to_ovf_u8_un")
+MINI_OP(OP_FCONV_TO_OVF_I_UN, "float_conv_to_ovf_i_un")
+MINI_OP(OP_FCONV_TO_OVF_U_UN, "float_conv_to_ovf_u_un")
+
+MINI_OP(OP_FCONV_TO_OVF_I1,"float_conv_to_ovf_i1")
+MINI_OP(OP_FCONV_TO_OVF_U1,"float_conv_to_ovf_u1")
+MINI_OP(OP_FCONV_TO_OVF_I2,"float_conv_to_ovf_i2")
+MINI_OP(OP_FCONV_TO_OVF_U2,"float_conv_to_ovf_u2")
+MINI_OP(OP_FCONV_TO_OVF_I4,"float_conv_to_ovf_i4")
+MINI_OP(OP_FCONV_TO_OVF_U4,"float_conv_to_ovf_u4")
+MINI_OP(OP_FCONV_TO_OVF_I8,"float_conv_to_ovf_i8")
+MINI_OP(OP_FCONV_TO_OVF_U8,"float_conv_to_ovf_u8")
+
+MINI_OP(OP_FCEQ, "float_ceq")
+MINI_OP(OP_FCGT, "float_cgt")
+MINI_OP(OP_FCGT_UN,"float_cgt_un")
+MINI_OP(OP_FCLT, "float_clt")
+MINI_OP(OP_FCLT_UN,"float_clt_un")
+
+MINI_OP(OP_FCONV_TO_U, "float_conv_to_u")
+
+MINI_OP(OP_GROUP, "group")
+
+/* aot compiler */
+MINI_OP(OP_AOTCONST, "aot_const")
+
+/* used to impl unbox */
+MINI_OP(OP_UNBOXCAST , "unboxcast")
+
+/* exception related opcodes */
+MINI_OP(OP_CALL_HANDLER , "call_handler")
+MINI_OP(OP_START_HANDLER , "start_handler")
+MINI_OP(OP_ENDFILTER, "op_endfilter")
+
+/* inline (long)int * (long)int */
+MINI_OP(OP_BIGMUL, "op_bigmul")
+MINI_OP(OP_BIGMUL_UN, "op_bigmul_un")
+
+/* opcodes most architecture have */
+MINI_OP(OP_ADC, "adc")
+MINI_OP(OP_ADC_IMM, "adc_imm")
+MINI_OP(OP_SBB, "sbb")
+MINI_OP(OP_SBB_IMM, "sbb_imm")
+MINI_OP(OP_ADDCC, "addcc")
+MINI_OP(OP_ADDCC_IMM, "addcc_imm")
+MINI_OP(OP_SUBCC, "subcc")
+MINI_OP(OP_SUBCC_IMM, "subcc_imm")
+MINI_OP(OP_BR_REG, "br_reg")
+MINI_OP(OP_SEXT_I1, "sext_i1")
+MINI_OP(OP_SEXT_I2, "sext_i2")
+MINI_OP(OP_CNE, "cne")
+/* to implement the upper half of long32 add and sub */
+MINI_OP(OP_ADD_OVF_CARRY, "add_ovf_carry")
+MINI_OP(OP_SUB_OVF_CARRY, "sub_ovf_carry")
+MINI_OP(OP_ADD_OVF_UN_CARRY, "add_ovf_un_carry")
+MINI_OP(OP_SUB_OVF_UN_CARRY, "sub_ovf_un_carry")
+
+/* FP functions usually done by the CPU */
+MINI_OP(OP_SIN, "sin")
+MINI_OP(OP_COS, "cos")
+MINI_OP(OP_ABS, "abs")
+MINI_OP(OP_TAN, "tan")
+MINI_OP(OP_ATAN, "atan")
+MINI_OP(OP_SQRT, "sqrt")
+/* to optimize strings */
+MINI_OP(OP_GETCHR, "getchar")
+MINI_OP(OP_STRLEN, "strlen")
+MINI_OP(OP_GETTYPE, "gettype")
+/* get adrress of element in a 2D array */
+MINI_OP(OP_LDELEMA2D, "getldelema2")
+/* inlined small memcpy with constant length */
+MINI_OP(OP_MEMCPY, "memcpy")
+/* inlined small memset with constant length */
+MINI_OP(OP_MEMSET, "memset")
+/* type check that support custom remoting types */
+MINI_OP(OP_CISINST, "cisinst")
+MINI_OP(OP_CCASTCLASS, "ccastclass")
+MINI_OP(OP_SAVE_LMF, "save_lmf")
+MINI_OP(OP_RESTORE_LMF, "restore_lmf")
+
+
+
+/* x86 specific */
+MINI_OP(OP_X86_TEST_NULL, "x86_test_null")
+MINI_OP(OP_X86_COMPARE_MEMBASE_REG,"x86_compare_membase_reg")
+MINI_OP(OP_X86_COMPARE_MEMBASE_IMM,"x86_compare_membase_imm")
+MINI_OP(OP_X86_COMPARE_MEMBASE8_IMM,"x86_compare_membase8_imm")
+MINI_OP(OP_X86_COMPARE_REG_MEMBASE,"x86_compare_reg_membase")
+MINI_OP(OP_X86_INC_REG, "x86_inc_reg")
+MINI_OP(OP_X86_INC_MEMBASE, "x86_inc_membase")
+MINI_OP(OP_X86_DEC_REG, "x86_dec_reg")
+MINI_OP(OP_X86_DEC_MEMBASE, "x86_dec_membase")
+MINI_OP(OP_X86_ADD_MEMBASE_IMM, "x86_add_membase_imm")
+MINI_OP(OP_X86_SUB_MEMBASE_IMM, "x86_sub_membase_imm")
+MINI_OP(OP_X86_PUSH_MEMBASE, "x86_push_membase")
+MINI_OP(OP_X86_PUSH_IMM, "x86_push_imm")
+MINI_OP(OP_X86_PUSH, "x86_push")
+MINI_OP(OP_X86_PUSH_FP, "x86_push_fp")
+MINI_OP(OP_X86_PUSH_OBJ, "x86_push_obj")
+MINI_OP(OP_X86_LEA, "x86_lea")
+MINI_OP(OP_X86_LEA_MEMBASE, "x86_lea_membase")
+MINI_OP(OP_X86_XCHG, "x86_xchg")
+MINI_OP(OP_X86_FPOP, "x86_fpop")
+MINI_OP(OP_X86_FP_LOAD_I8, "x86_fp_load_i8")
+MINI_OP(OP_X86_FP_LOAD_I4, "x86_fp_load_i4")
+MINI_OP(OP_X86_SETEQ_MEMBASE, "x86_seteq_membase")
+MINI_OP(OP_X86_SETNE_MEMBASE, "x86_setne_membase")
+MINI_OP(OP_X86_ADD_MEMBASE, "x86_add_membase")
+MINI_OP(OP_X86_SUB_MEMBASE, "x86_sub_membase")
+MINI_OP(OP_X86_MUL_MEMBASE, "x86_mul_membase")
+MINI_OP(OP_X86_TLS_GET, "x86_tls_get")
+
+MINI_OP(OP_AMD64_TEST_NULL, "amd64_test_null")
+MINI_OP(OP_AMD64_SET_XMMREG_R4, "amd64_set_xmmreg_r4")
+MINI_OP(OP_AMD64_SET_XMMREG_R8, "amd64_set_xmmreg_r8")
+MINI_OP(OP_AMD64_OUTARG_XMMREG_R4, "amd64_outarg_xmmreg_r4")
+MINI_OP(OP_AMD64_OUTARG_XMMREG_R8, "amd64_outarg_xmmreg_r8")
+MINI_OP(OP_AMD64_ICOMPARE_MEMBASE_REG, "amd64_icompare_membase_reg")
+MINI_OP(OP_AMD64_ICOMPARE_MEMBASE_IMM, "amd64_icompare_membase_imm")
+MINI_OP(OP_AMD64_ICOMPARE_REG_MEMBASE, "amd64_icompare_reg_membase")
+MINI_OP(OP_AMD64_OUTARG_ALIGN_STACK, "amd64_outarg_align_stack")
+
+MINI_OP(OP_PPC_SUBFIC, "ppc_subfic")
+MINI_OP(OP_PPC_SUBFZE, "ppc_subfze")
+
+MINI_OP(OP_SPARC_OUTARG_REGPAIR, "sparc_outarg_regpair")
+MINI_OP(OP_SPARC_OUTARG_MEM, "sparc_outarg_mem")
+MINI_OP(OP_SPARC_OUTARG_MEMPAIR, "sparc_outarg_mempair")
+MINI_OP(OP_SPARC_OUTARG_SPLIT_REG_STACK, "sparc_outarg_split_reg_stack")
+MINI_OP(OP_SPARC_OUTARG_FLOAT_REG, "sparc_outarg_float_reg")
+MINI_OP(OP_SPARC_OUTARG_DOUBLE_REG, "sparc_outarg_double_reg")
+MINI_OP(OP_SPARC_INARG_VT, "sparc_inarg_vt")
+MINI_OP(OP_SPARC_LOCALLOC_IMM, "sparc_localloc_imm")
+MINI_OP(OP_SPARC_SETFREG_FLOAT, "sparc_setfreg_float")
+MINI_OP(OP_SPARC_BRZ, "sparc_brz")
+MINI_OP(OP_SPARC_BRLEZ, "sparc_brlez")
+MINI_OP(OP_SPARC_BRLZ, "sparc_brlz")
+MINI_OP(OP_SPARC_BRNZ, "sparc_brnz")
+MINI_OP(OP_SPARC_BRGZ, "sparc_brgz")
+MINI_OP(OP_SPARC_BRGEZ, "sparc_brgez")
+MINI_OP(OP_SPARC_COND_EXC_EQZ, "sparc_cond_exc_eqz")
+MINI_OP(OP_SPARC_COND_EXC_GEZ, "sparc_cond_exc_gez")
+MINI_OP(OP_SPARC_COND_EXC_GTZ, "sparc_cond_exc_gtz")
+MINI_OP(OP_SPARC_COND_EXC_LEZ, "sparc_cond_exc_lez")
+MINI_OP(OP_SPARC_COND_EXC_LTZ, "sparc_cond_exc_ltz")
+MINI_OP(OP_SPARC_COND_EXC_NEZ, "sparc_cond_exc_nez")
+
+
+MINI_OP(OP_S390_LOADARG, "s390_loadarg")
+MINI_OP(OP_S390_ARGPTR, "s390_argptr")
+MINI_OP(OP_S390_STKARG, "s390_stkarg")
+MINI_OP(OP_S390_MOVE, "s390_move")
+MINI_OP(OP_S390_SETF4RET, "s390_setf4ret")
diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c
new file mode 100644
index 00000000000..c6218e03436
--- /dev/null
+++ b/mono/mini/mini-ppc.c
@@ -0,0 +1,3821 @@
+/*
+ * mini-ppc.c: PowerPC backend for the Mono code generator
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include "mini.h"
+#include <string.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+
+#include "mini-ppc.h"
+#include "inssel.h"
+#include "cpu-g4.h"
+#include "trace.h"
+
+int mono_exc_esp_offset = 0;
+
+const char*
+mono_arch_regname (int reg) {
+ static const char * rnames[] = {
+ "ppc_r0", "ppc_sp", "ppc_r2", "ppc_r3", "ppc_r4",
+ "ppc_r5", "ppc_r6", "ppc_r7", "ppc_r8", "ppc_r9",
+ "ppc_r10", "ppc_r11", "ppc_r12", "ppc_r13", "ppc_r14",
+ "ppc_r15", "ppc_r16", "ppc_r17", "ppc_r18", "ppc_r19",
+ "ppc_r20", "ppc_r21", "ppc_r22", "ppc_r23", "ppc_r24",
+ "ppc_r25", "ppc_r26", "ppc_r27", "ppc_r28", "ppc_r29",
+ "ppc_r30", "ppc_r31"
+ };
+ if (reg >= 0 && reg < 32)
+ return rnames [reg];
+ return "unknown";
+}
+
+/* this function overwrites r0 */
+static guint8*
+emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffset)
+{
+ /* unrolled, use the counter in big */
+ while (size >= 4) {
+ ppc_lwz (code, ppc_r0, soffset, sreg);
+ ppc_stw (code, ppc_r0, doffset, dreg);
+ size -= 4;
+ soffset += 4;
+ doffset += 4;
+ }
+ while (size >= 2) {
+ ppc_lhz (code, ppc_r0, soffset, sreg);
+ ppc_sth (code, ppc_r0, doffset, dreg);
+ size -= 2;
+ soffset += 2;
+ doffset += 2;
+ }
+ while (size >= 1) {
+ ppc_lbz (code, ppc_r0, soffset, sreg);
+ ppc_stb (code, ppc_r0, doffset, dreg);
+ size -= 1;
+ soffset += 1;
+ doffset += 1;
+ }
+ return code;
+}
+
+/*
+ * mono_arch_get_argument_info:
+ * @csig: a method signature
+ * @param_count: the number of parameters to consider
+ * @arg_info: an array to store the result infos
+ *
+ * Gathers information on parameters such as size, alignment and
+ * padding. arg_info should be large enought to hold param_count + 1 entries.
+ *
+ * Returns the size of the activation frame.
+ */
+int
+mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+{
+ int k, frame_size = 0;
+ int size, align, pad;
+ int offset = 8;
+
+ if (MONO_TYPE_ISSTRUCT (csig->ret)) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].offset = offset;
+
+ if (csig->hasthis) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].size = frame_size;
+
+ for (k = 0; k < param_count; k++) {
+
+ if (csig->pinvoke)
+ size = mono_type_native_stack_size (csig->params [k], &align);
+ else
+ size = mono_type_stack_size (csig->params [k], &align);
+
+ /* ignore alignment for now */
+ align = 1;
+
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+ frame_size += size;
+ arg_info [k + 1].pad = 0;
+ arg_info [k + 1].size = size;
+ offset += pad;
+ arg_info [k + 1].offset = offset;
+ offset += size;
+ }
+
+ align = MONO_ARCH_FRAME_ALIGNMENT;
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+
+ return frame_size;
+}
+
+/*
+ * Initialize the cpu to execute managed code.
+ */
+void
+mono_arch_cpu_init (void)
+{
+}
+
+/*
+ * This function returns the optimizations supported on this cpu.
+ */
+guint32
+mono_arch_cpu_optimizazions (guint32 *exclude_mask)
+{
+ guint32 opts = 0;
+
+ /* no ppc-specific optimizations yet */
+ *exclude_mask = MONO_OPT_INLINE;
+ return opts;
+}
+
+static gboolean
+is_regsize_var (MonoType *t) {
+ if (t->byref)
+ return TRUE;
+ switch (t->type) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ return TRUE;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return TRUE;
+ case MONO_TYPE_VALUETYPE:
+ if (t->data.klass->enumtype)
+ return is_regsize_var (t->data.klass->enum_basetype);
+ return FALSE;
+ }
+ return FALSE;
+}
+
+GList *
+mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
+{
+ GList *vars = NULL;
+ int i;
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoInst *ins = cfg->varinfo [i];
+ MonoMethodVar *vmv = MONO_VARINFO (cfg, i);
+
+ /* unused vars */
+ if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos)
+ continue;
+
+ if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) || (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG))
+ continue;
+
+ /* we can only allocate 32 bit values */
+ if (is_regsize_var (ins->inst_vtype)) {
+ g_assert (MONO_VARINFO (cfg, i)->reg == -1);
+ g_assert (i == vmv->idx);
+ vars = mono_varlist_insert_sorted (cfg, vars, vmv, FALSE);
+ }
+ }
+
+ return vars;
+}
+
+#define USE_EXTRA_TEMPS ((1<<30) | (1<<29))
+//#define USE_EXTRA_TEMPS 0
+
+GList *
+mono_arch_get_global_int_regs (MonoCompile *cfg)
+{
+ GList *regs = NULL;
+ int i, top = 32;
+ if (cfg->frame_reg != ppc_sp)
+ top = 31;
+#if USE_EXTRA_TEMPS
+ top = 29;
+#endif
+ for (i = 13; i < top; ++i)
+ regs = g_list_prepend (regs, GUINT_TO_POINTER (i));
+
+ return regs;
+}
+
+/*
+ * mono_arch_regalloc_cost:
+ *
+ * Return the cost, in number of memory references, of the action of
+ * allocating the variable VMV into a register during global register
+ * allocation.
+ */
+guint32
+mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv)
+{
+ /* FIXME: */
+ return 2;
+}
+
+// code from ppc/tramp.c, try to keep in sync
+#define MIN_CACHE_LINE 8
+
+void
+mono_arch_flush_icache (guint8 *code, gint size)
+{
+ guint i;
+ guint8 *p;
+
+ p = code;
+ for (i = 0; i < size; i += MIN_CACHE_LINE, p += MIN_CACHE_LINE) {
+ asm ("dcbst 0,%0;" : : "r"(p) : "memory");
+ }
+ asm ("sync");
+ p = code;
+ for (i = 0; i < size; i += MIN_CACHE_LINE, p += MIN_CACHE_LINE) {
+ asm ("icbi 0,%0; sync;" : : "r"(p) : "memory");
+ }
+ asm ("sync");
+ asm ("isync");
+}
+
+#define NOT_IMPLEMENTED(x) \
+ g_error ("FIXME: %s is not yet implemented. (trampoline)", x);
+
+#ifdef __APPLE__
+#define ALWAYS_ON_STACK(s) s
+#define FP_ALSO_IN_REG(s) s
+#else
+#define ALWAYS_ON_STACK(s)
+#define FP_ALSO_IN_REG(s) s
+#define ALIGN_DOUBLES
+#endif
+
+enum {
+ RegTypeGeneral,
+ RegTypeBase,
+ RegTypeFP,
+ RegTypeStructByVal,
+ RegTypeStructByAddr
+};
+
+typedef struct {
+ gint32 offset;
+ guint16 vtsize; /* in param area */
+ guint8 reg;
+ guint8 regtype : 4; /* 0 general, 1 basereg, 2 floating point register, see RegType* */
+ guint8 size : 4; /* 1, 2, 4, 8, or regs used by RegTypeStructByVal */
+} ArgInfo;
+
+typedef struct {
+ int nargs;
+ guint32 stack_usage;
+ guint32 struct_ret;
+ ArgInfo ret;
+ ArgInfo args [1];
+} CallInfo;
+
+#define DEBUG(a)
+
+static void inline
+add_general (guint *gr, guint *stack_size, ArgInfo *ainfo, gboolean simple)
+{
+ if (simple) {
+ if (*gr >= 3 + PPC_NUM_REG_ARGS) {
+ ainfo->offset = PPC_STACK_PARAM_OFFSET + *stack_size;
+ ainfo->reg = ppc_sp; /* in the caller */
+ ainfo->regtype = RegTypeBase;
+ *stack_size += 4;
+ } else {
+ ALWAYS_ON_STACK (*stack_size += 4);
+ ainfo->reg = *gr;
+ }
+ } else {
+ if (*gr >= 3 + PPC_NUM_REG_ARGS - 1) {
+#ifdef ALIGN_DOUBLES
+ //*stack_size += (*stack_size % 8);
+#endif
+ ainfo->offset = PPC_STACK_PARAM_OFFSET + *stack_size;
+ ainfo->reg = ppc_sp; /* in the caller */
+ ainfo->regtype = RegTypeBase;
+ *stack_size += 8;
+ } else {
+#ifdef ALIGN_DOUBLES
+ if (!((*gr) & 1))
+ (*gr) ++;
+#endif
+ ALWAYS_ON_STACK (*stack_size += 8);
+ ainfo->reg = *gr;
+ }
+ (*gr) ++;
+ }
+ (*gr) ++;
+}
+
+static CallInfo*
+calculate_sizes (MonoMethodSignature *sig, gboolean is_pinvoke)
+{
+ guint i, fr, gr;
+ int n = sig->hasthis + sig->param_count;
+ guint32 simpletype;
+ guint32 stack_size = 0;
+ CallInfo *cinfo = g_malloc0 (sizeof (CallInfo) + sizeof (ArgInfo) * n);
+
+ fr = PPC_FIRST_FPARG_REG;
+ gr = PPC_FIRST_ARG_REG;
+
+ /* FIXME: handle returning a struct */
+ if (MONO_TYPE_ISSTRUCT (sig->ret)) {
+ add_general (&gr, &stack_size, &cinfo->ret, TRUE);
+ cinfo->struct_ret = PPC_FIRST_ARG_REG;
+ }
+
+ n = 0;
+ if (sig->hasthis) {
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ n++;
+ }
+ DEBUG(printf("params: %d\n", sig->param_count));
+ for (i = 0; i < sig->param_count; ++i) {
+ DEBUG(printf("param %d: ", i));
+ if (sig->params [i]->byref) {
+ DEBUG(printf("byref\n"));
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ n++;
+ continue;
+ }
+ simpletype = sig->params [i]->type;
+ enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ cinfo->args [n].size = 1;
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ n++;
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ cinfo->args [n].size = 2;
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ n++;
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ cinfo->args [n].size = 4;
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ n++;
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ cinfo->args [n].size = sizeof (gpointer);
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ n++;
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ gint size;
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ if (is_pinvoke)
+ size = mono_class_native_size (sig->params [i]->data.klass, NULL);
+ else
+ size = mono_class_value_size (sig->params [i]->data.klass, NULL);
+ DEBUG(printf ("load %d bytes struct\n",
+ mono_class_native_size (sig->params [i]->data.klass, NULL)));
+#if PPC_PASS_STRUCTS_BY_VALUE
+ {
+ int align_size = size;
+ int nwords = 0;
+ align_size += (sizeof (gpointer) - 1);
+ align_size &= ~(sizeof (gpointer) - 1);
+ nwords = (align_size + sizeof (gpointer) -1 ) / sizeof (gpointer);
+ cinfo->args [n].regtype = RegTypeStructByVal;
+ if (gr > PPC_LAST_ARG_REG || (size >= 3 && size % 4 != 0)) {
+ cinfo->args [n].size = 0;
+ cinfo->args [n].vtsize = nwords;
+ } else {
+ int rest = PPC_LAST_ARG_REG - gr + 1;
+ int n_in_regs = rest >= nwords? nwords: rest;
+ cinfo->args [n].size = n_in_regs;
+ cinfo->args [n].vtsize = nwords - n_in_regs;
+ cinfo->args [n].reg = gr;
+ gr += n_in_regs;
+ }
+ cinfo->args [n].offset = PPC_STACK_PARAM_OFFSET + stack_size;
+ /*g_print ("offset for arg %d at %d\n", n, PPC_STACK_PARAM_OFFSET + stack_size);*/
+ stack_size += nwords * sizeof (gpointer);
+ }
+#else
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ cinfo->args [n].regtype = RegTypeStructByAddr;
+#endif
+ n++;
+ break;
+ }
+ case MONO_TYPE_TYPEDBYREF: {
+ int size = sizeof (MonoTypedRef);
+ /* keep in sync or merge with the valuetype case */
+#if PPC_PASS_STRUCTS_BY_VALUE
+ {
+ int nwords = (size + sizeof (gpointer) -1 ) / sizeof (gpointer);
+ cinfo->args [n].regtype = RegTypeStructByVal;
+ if (gr <= PPC_LAST_ARG_REG) {
+ int rest = PPC_LAST_ARG_REG - gr + 1;
+ int n_in_regs = rest >= nwords? nwords: rest;
+ cinfo->args [n].size = n_in_regs;
+ cinfo->args [n].vtsize = nwords - n_in_regs;
+ cinfo->args [n].reg = gr;
+ gr += n_in_regs;
+ } else {
+ cinfo->args [n].size = 0;
+ cinfo->args [n].vtsize = nwords;
+ }
+ cinfo->args [n].offset = PPC_STACK_PARAM_OFFSET + stack_size;
+ /*g_print ("offset for arg %d at %d\n", n, PPC_STACK_PARAM_OFFSET + stack_size);*/
+ stack_size += nwords * sizeof (gpointer);
+ }
+#else
+ add_general (&gr, &stack_size, cinfo->args + n, TRUE);
+ cinfo->args [n].regtype = RegTypeStructByAddr;
+#endif
+ n++;
+ break;
+ }
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ cinfo->args [n].size = 8;
+ add_general (&gr, &stack_size, cinfo->args + n, FALSE);
+ n++;
+ break;
+ case MONO_TYPE_R4:
+ cinfo->args [n].size = 4;
+
+ /* It was 7, now it is 8 in LinuxPPC */
+ if (fr <= PPC_LAST_FPARG_REG) {
+ cinfo->args [n].regtype = RegTypeFP;
+ cinfo->args [n].reg = fr;
+ fr ++;
+ FP_ALSO_IN_REG (gr ++);
+ ALWAYS_ON_STACK (stack_size += 4);
+ } else {
+ cinfo->args [n].offset = PPC_STACK_PARAM_OFFSET + stack_size;
+ cinfo->args [n].regtype = RegTypeBase;
+ cinfo->args [n].reg = ppc_sp; /* in the caller*/
+ stack_size += 4;
+ }
+ n++;
+ break;
+ case MONO_TYPE_R8:
+ cinfo->args [n].size = 8;
+ /* It was 7, now it is 8 in LinuxPPC */
+ if (fr <= PPC_LAST_FPARG_REG) {
+ cinfo->args [n].regtype = RegTypeFP;
+ cinfo->args [n].reg = fr;
+ fr ++;
+ FP_ALSO_IN_REG (gr += 2);
+ ALWAYS_ON_STACK (stack_size += 8);
+ } else {
+ cinfo->args [n].offset = PPC_STACK_PARAM_OFFSET + stack_size;
+ cinfo->args [n].regtype = RegTypeBase;
+ cinfo->args [n].reg = ppc_sp; /* in the caller*/
+ stack_size += 8;
+ }
+ n++;
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+ {
+ simpletype = sig->ret->type;
+enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ cinfo->ret.reg = ppc_r3;
+ break;
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+ cinfo->ret.reg = ppc_r3;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ cinfo->ret.reg = ppc_f1;
+ cinfo->ret.regtype = RegTypeFP;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+ }
+
+ /* align stack size to 16 */
+ DEBUG (printf (" stack size: %d (%d)\n", (stack_size + 15) & ~15, stack_size));
+ stack_size = (stack_size + 15) & ~15;
+
+ cinfo->stack_usage = stack_size;
+ return cinfo;
+}
+
+
+/*
+ * Set var information according to the calling convention. ppc version.
+ * The locals var stuff should most likely be split in another method.
+ */
+void
+mono_arch_allocate_vars (MonoCompile *m)
+{
+ MonoMethodSignature *sig;
+ MonoMethodHeader *header;
+ MonoInst *inst;
+ int i, offset, size, align, curinst;
+ int frame_reg = ppc_sp;
+
+ /* allow room for the vararg method args: void* and long/double */
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (m->method))
+ m->param_area = MAX (m->param_area, sizeof (gpointer)*8);
+ /* this is bug #60332: remove when #59509 is fixed, so no weird vararg
+ * call convs needs to be handled this way.
+ */
+ if (m->flags & MONO_CFG_HAS_VARARGS)
+ m->param_area = MAX (m->param_area, sizeof (gpointer)*8);
+
+ header = mono_method_get_header (m->method);
+
+ /*
+ * We use the frame register also for any method that has
+ * exception clauses. This way, when the handlers are called,
+ * the code will reference local variables using the frame reg instead of
+ * the stack pointer: if we had to restore the stack pointer, we'd
+ * corrupt the method frames that are already on the stack (since
+ * filters get called before stack unwinding happens) when the filter
+ * code would call any method (this also applies to finally etc.).
+ */
+ if ((m->flags & MONO_CFG_HAS_ALLOCA) || header->num_clauses)
+ frame_reg = ppc_r31;
+ m->frame_reg = frame_reg;
+ if (frame_reg != ppc_sp) {
+ m->used_int_regs |= 1 << frame_reg;
+ }
+
+ sig = m->method->signature;
+
+ offset = 0;
+ curinst = 0;
+ if (MONO_TYPE_ISSTRUCT (sig->ret)) {
+ m->ret->opcode = OP_REGVAR;
+ m->ret->inst_c0 = ppc_r3;
+ } else {
+ /* FIXME: handle long and FP values */
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ m->ret->opcode = OP_REGVAR;
+ m->ret->inst_c0 = ppc_r3;
+ break;
+ }
+ }
+ /* local vars are at a positive offset from the stack pointer */
+ /*
+ * also note that if the function uses alloca, we use ppc_r31
+ * to point at the local variables.
+ */
+ offset = PPC_MINIMAL_STACK_SIZE; /* linkage area */
+ /* align the offset to 16 bytes: not sure this is needed here */
+ //offset += 16 - 1;
+ //offset &= ~(16 - 1);
+
+ /* add parameter area size for called functions */
+ offset += m->param_area;
+ offset += 16 - 1;
+ offset &= ~(16 - 1);
+
+ /* allow room to save the return value */
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (m->method))
+ offset += 8;
+
+ /* the MonoLMF structure is stored just below the stack pointer */
+
+#if 0
+ /* this stuff should not be needed on ppc and the new jit,
+ * because a call on ppc to the handlers doesn't change the
+ * stack pointer and the jist doesn't manipulate the stack pointer
+ * for operations involving valuetypes.
+ */
+ /* reserve space to store the esp */
+ offset += sizeof (gpointer);
+
+ /* this is a global constant */
+ mono_exc_esp_offset = offset;
+#endif
+
+ if (MONO_TYPE_ISSTRUCT (sig->ret)) {
+ inst = m->ret;
+ offset += sizeof(gpointer) - 1;
+ offset &= ~(sizeof(gpointer) - 1);
+ inst->inst_offset = offset;
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset += sizeof(gpointer);
+ }
+ curinst = m->locals_start;
+ for (i = curinst; i < m->num_varinfo; ++i) {
+ inst = m->varinfo [i];
+ if ((inst->flags & MONO_INST_IS_DEAD) || inst->opcode == OP_REGVAR)
+ continue;
+
+ /* inst->unused indicates native sized value types, this is used by the
+ * pinvoke wrappers when they call functions returning structure */
+ if (inst->unused && MONO_TYPE_ISSTRUCT (inst->inst_vtype) && inst->inst_vtype->type != MONO_TYPE_TYPEDBYREF)
+ size = mono_class_native_size (inst->inst_vtype->data.klass, &align);
+ else
+ size = mono_type_size (inst->inst_vtype, &align);
+
+ offset += align - 1;
+ offset &= ~(align - 1);
+ inst->inst_offset = offset;
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset += size;
+ //g_print ("allocating local %d to %d\n", i, inst->inst_offset);
+ }
+
+ curinst = 0;
+ if (sig->hasthis) {
+ inst = m->varinfo [curinst];
+ if (inst->opcode != OP_REGVAR) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset += sizeof (gpointer) - 1;
+ offset &= ~(sizeof (gpointer) - 1);
+ inst->inst_offset = offset;
+ offset += sizeof (gpointer);
+ }
+ curinst++;
+ }
+
+ for (i = 0; i < sig->param_count; ++i) {
+ inst = m->varinfo [curinst];
+ if (inst->opcode != OP_REGVAR) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ size = mono_type_size (sig->params [i], &align);
+ offset += align - 1;
+ offset &= ~(align - 1);
+ inst->inst_offset = offset;
+ offset += size;
+ }
+ curinst++;
+ }
+
+ /* align the offset to 16 bytes */
+ offset += 16 - 1;
+ offset &= ~(16 - 1);
+
+ /* change sign? */
+ m->stack_offset = offset;
+
+}
+
+/* Fixme: we need an alignment solution for enter_method and mono_arch_call_opcode,
+ * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info
+ */
+
+/*
+ * take the arguments and generate the arch-specific
+ * instructions to properly call the function in call.
+ * This includes pushing, moving arguments to the right register
+ * etc.
+ * Issue: who does the spilling if needed, and when?
+ */
+MonoCallInst*
+mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb, MonoCallInst *call, int is_virtual) {
+ MonoInst *arg, *in;
+ MonoMethodSignature *sig;
+ int i, n;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+
+ sig = call->signature;
+ n = sig->param_count + sig->hasthis;
+
+ cinfo = calculate_sizes (sig, sig->pinvoke);
+ if (cinfo->struct_ret)
+ call->used_iregs |= 1 << cinfo->struct_ret;
+
+ for (i = 0; i < n; ++i) {
+ ainfo = cinfo->args + i;
+ if (is_virtual && i == 0) {
+ /* the argument will be attached to the call instrucion */
+ in = call->args [i];
+ call->used_iregs |= 1 << ainfo->reg;
+ } else {
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ in = call->args [i];
+ arg->cil_code = in->cil_code;
+ arg->inst_left = in;
+ arg->type = in->type;
+ /* prepend, we'll need to reverse them later */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ if (ainfo->regtype == RegTypeGeneral) {
+ arg->unused = ainfo->reg;
+ call->used_iregs |= 1 << ainfo->reg;
+ if (arg->type == STACK_I8)
+ call->used_iregs |= 1 << (ainfo->reg + 1);
+ } else if (ainfo->regtype == RegTypeStructByAddr) {
+ /* FIXME: where si the data allocated? */
+ arg->unused = ainfo->reg;
+ call->used_iregs |= 1 << ainfo->reg;
+ } else if (ainfo->regtype == RegTypeStructByVal) {
+ int cur_reg;
+ /* mark the used regs */
+ for (cur_reg = 0; cur_reg < ainfo->size; ++cur_reg) {
+ call->used_iregs |= 1 << (ainfo->reg + cur_reg);
+ }
+ arg->opcode = OP_OUTARG_VT;
+ arg->unused = ainfo->reg | (ainfo->size << 8) | (ainfo->vtsize << 16);
+ arg->inst_imm = ainfo->offset;
+ } else if (ainfo->regtype == RegTypeBase) {
+ arg->opcode = OP_OUTARG;
+ arg->unused = ainfo->reg | (ainfo->size << 8);
+ arg->inst_imm = ainfo->offset;
+ } else if (ainfo->regtype == RegTypeFP) {
+ arg->opcode = OP_OUTARG_R8;
+ arg->unused = ainfo->reg;
+ call->used_fregs |= 1 << ainfo->reg;
+ if (ainfo->size == 4) {
+ arg->opcode = OP_OUTARG_R8;
+ /* we reduce the precision */
+ /*MonoInst *conv;
+ MONO_INST_NEW (cfg, conv, OP_FCONV_TO_R4);
+ conv->inst_left = arg->inst_left;
+ arg->inst_left = conv;*/
+ }
+ } else {
+ g_assert_not_reached ();
+ }
+ }
+ }
+ /*
+ * Reverse the call->out_args list.
+ */
+ {
+ MonoInst *prev = NULL, *list = call->out_args, *next;
+ while (list) {
+ next = list->next;
+ list->next = prev;
+ prev = list;
+ list = next;
+ }
+ call->out_args = prev;
+ }
+ call->stack_usage = cinfo->stack_usage;
+ cfg->param_area = MAX (cfg->param_area, cinfo->stack_usage);
+ cfg->flags |= MONO_CFG_HAS_CALLS;
+ /*
+ * should set more info in call, such as the stack space
+ * used by the args that needs to be added back to esp
+ */
+
+ g_free (cinfo);
+ return call;
+}
+
+/*
+ * Allow tracing to work with this interface (with an optional argument)
+ */
+
+/*
+ * This may be needed on some archs or for debugging support.
+ */
+void
+mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code)
+{
+ /* no stack room needed now (may be needed for FASTCALL-trace support) */
+ *stack = 0;
+ /* split prolog-epilog requirements? */
+ *code = 50; /* max bytes needed: check this number */
+}
+
+void*
+mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+
+ ppc_load (code, ppc_r3, cfg->method);
+ ppc_li (code, ppc_r4, 0); /* NULL ebp for now */
+ ppc_load (code, ppc_r0, func);
+ ppc_mtlr (code, ppc_r0);
+ ppc_blrl (code);
+ return code;
+}
+
+enum {
+ SAVE_NONE,
+ SAVE_STRUCT,
+ SAVE_ONE,
+ SAVE_TWO,
+ SAVE_FP
+};
+
+void*
+mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+ int save_mode = SAVE_NONE;
+ MonoMethod *method = cfg->method;
+ int rtype = method->signature->ret->type;
+ int save_offset = PPC_STACK_PARAM_OFFSET + cfg->param_area;
+ save_offset += 15;
+ save_offset &= ~15;
+
+handle_enum:
+ switch (rtype) {
+ case MONO_TYPE_VOID:
+ /* special case string .ctor icall */
+ if (strcmp (".ctor", method->name) && method->klass == mono_defaults.string_class)
+ save_mode = SAVE_ONE;
+ else
+ save_mode = SAVE_NONE;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ save_mode = SAVE_TWO;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ save_mode = SAVE_FP;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (method->signature->ret->data.klass->enumtype) {
+ rtype = method->signature->ret->data.klass->enum_basetype->type;
+ goto handle_enum;
+ }
+ save_mode = SAVE_STRUCT;
+ break;
+ default:
+ save_mode = SAVE_ONE;
+ break;
+ }
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ ppc_stw (code, ppc_r3, save_offset, cfg->frame_reg);
+ ppc_stw (code, ppc_r4, save_offset + 4, cfg->frame_reg);
+ if (enable_arguments) {
+ ppc_mr (code, ppc_r5, ppc_r4);
+ ppc_mr (code, ppc_r4, ppc_r3);
+ }
+ break;
+ case SAVE_ONE:
+ ppc_stw (code, ppc_r3, save_offset, cfg->frame_reg);
+ if (enable_arguments) {
+ ppc_mr (code, ppc_r4, ppc_r3);
+ }
+ break;
+ case SAVE_FP:
+ ppc_stfd (code, ppc_f1, save_offset, cfg->frame_reg);
+ if (enable_arguments) {
+ /* FIXME: what reg? */
+ ppc_fmr (code, ppc_f3, ppc_f1);
+ ppc_lwz (code, ppc_r4, save_offset, cfg->frame_reg);
+ ppc_lwz (code, ppc_r5, save_offset + 4, cfg->frame_reg);
+ }
+ break;
+ case SAVE_STRUCT:
+ if (enable_arguments) {
+ /* FIXME: get the actual address */
+ ppc_mr (code, ppc_r4, ppc_r3);
+ }
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ ppc_load (code, ppc_r3, cfg->method);
+ ppc_load (code, ppc_r0, func);
+ ppc_mtlr (code, ppc_r0);
+ ppc_blrl (code);
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ ppc_lwz (code, ppc_r3, save_offset, cfg->frame_reg);
+ ppc_lwz (code, ppc_r4, save_offset + 4, cfg->frame_reg);
+ break;
+ case SAVE_ONE:
+ ppc_lwz (code, ppc_r3, save_offset, cfg->frame_reg);
+ break;
+ case SAVE_FP:
+ ppc_lfd (code, ppc_f1, save_offset, cfg->frame_reg);
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ return code;
+}
+/*
+ * Conditional branches have a small offset, so if it is likely overflowed,
+ * we do a branch to the end of the method (uncond branches have much larger
+ * offsets) where we perform the conditional and jump back unconditionally.
+ * It's slightly slower, since we add two uncond branches, but it's very simple
+ * with the current patch implementation and such large methods are likely not
+ * going to be perf critical anyway.
+ */
+typedef struct {
+ MonoBasicBlock *bb;
+ void *ip;
+ guint16 b0_cond;
+ guint16 b1_cond;
+} MonoOvfJump;
+
+#define EMIT_COND_BRANCH_FLAGS(ins,b0,b1) \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (0 && ins->inst_i0->inst_c0) { \
+ ppc_bc (code, (b0), (b1), (code - cfg->native_code + ins->inst_i0->inst_c0) & 0xffff); \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ ppc_bc (code, (b0), (b1), 0); \
+ } \
+} else { \
+ if (0 && ins->inst_true_bb->native_offset) { \
+ ppc_bc (code, (b0), (b1), (code - cfg->native_code + ins->inst_true_bb->native_offset) & 0xffff); \
+ } else { \
+ int br_disp = ins->inst_true_bb->max_offset - offset; \
+ if (!ppc_is_imm16 (br_disp + 1024) || ! ppc_is_imm16 (ppc_is_imm16 (br_disp - 1024))) { \
+ MonoOvfJump *ovfj = mono_mempool_alloc (cfg->mempool, sizeof (MonoOvfJump)); \
+ ovfj->bb = ins->inst_true_bb; \
+ ovfj->ip = NULL; \
+ ovfj->b0_cond = (b0); \
+ ovfj->b1_cond = (b1); \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB_OVF, ovfj); \
+ ppc_b (code, 0); \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_true_bb); \
+ ppc_bc (code, (b0), (b1), 0); \
+ } \
+ } \
+}
+
+#define EMIT_COND_BRANCH(ins,cond) EMIT_COND_BRANCH_FLAGS(ins, branch_b0_table [(cond)], branch_b1_table [(cond)])
+
+/* emit an exception if condition is fail
+ *
+ * We assign the extra code used to throw the implicit exceptions
+ * to cfg->bb_exit as far as the big branch handling is concerned
+ */
+#define EMIT_COND_SYSTEM_EXCEPTION_FLAGS(b0,b1,exc_name) \
+ do { \
+ int br_disp = cfg->bb_exit->max_offset - offset; \
+ if (!ppc_is_imm16 (br_disp + 1024) || ! ppc_is_imm16 (ppc_is_imm16 (br_disp - 1024))) { \
+ MonoOvfJump *ovfj = mono_mempool_alloc (cfg->mempool, sizeof (MonoOvfJump)); \
+ ovfj->bb = NULL; \
+ ovfj->ip = code; \
+ ovfj->b0_cond = (b0); \
+ ovfj->b1_cond = (b1); \
+ /* FIXME: test this code */ \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC_OVF, ovfj); \
+ ppc_b (code, 0); \
+ cfg->bb_exit->max_offset += 24; \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_EXC, exc_name); \
+ ppc_bc (code, (b0), (b1), 0); \
+ } \
+ } while (0);
+
+#define EMIT_COND_SYSTEM_EXCEPTION(cond,exc_name) EMIT_COND_SYSTEM_EXCEPTION_FLAGS(branch_b0_table [(cond)], branch_b1_table [(cond)], (exc_name))
+
+static void
+peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins, *last_ins = NULL;
+ ins = bb->code;
+
+ while (ins) {
+
+ switch (ins->opcode) {
+ case OP_MUL_IMM:
+ /* remove unnecessary multiplication with 1 */
+ if (ins->inst_imm == 1) {
+ if (ins->dreg != ins->sreg1) {
+ ins->opcode = OP_MOVE;
+ } else {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ } else {
+ int power2 = mono_is_power_of_two (ins->inst_imm);
+ if (power2 > 0) {
+ ins->opcode = OP_SHL_IMM;
+ ins->inst_imm = power2;
+ }
+ }
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ /*
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG
+ || last_ins->opcode == OP_STORE_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+
+ /*
+ * Note: reg1 must be different from the basereg in the second load
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_MOVE reg1, reg2
+ */
+ } if (last_ins && (last_ins->opcode == OP_LOADI4_MEMBASE
+ || last_ins->opcode == OP_LOAD_MEMBASE) &&
+ ins->inst_basereg != last_ins->dreg &&
+ ins->inst_basereg == last_ins->inst_basereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+
+ if (ins->dreg == last_ins->dreg) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->dreg;
+ }
+
+ //g_assert_not_reached ();
+
+#if 0
+ /*
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ * -->
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_ICONST reg, imm
+ */
+ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM
+ || last_ins->opcode == OP_STORE_MEMBASE_IMM) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_ICONST;
+ ins->inst_c0 = last_ins->inst_imm;
+ g_assert_not_reached (); // check this rule
+#endif
+ }
+ break;
+ case OP_LOADU1_MEMBASE:
+ case OP_LOADI1_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI1_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case OP_LOADU2_MEMBASE:
+ case OP_LOADI2_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI2_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ case OP_SETREG:
+ ins->opcode = OP_MOVE;
+ /*
+ * OP_MOVE reg, reg
+ */
+ if (ins->dreg == ins->sreg1) {
+ if (last_ins)
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ /*
+ * OP_MOVE sreg, dreg
+ * OP_MOVE dreg, sreg
+ */
+ if (last_ins && last_ins->opcode == OP_MOVE &&
+ ins->sreg1 == last_ins->dreg &&
+ ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ break;
+ }
+ last_ins = ins;
+ ins = ins->next;
+ }
+ bb->last_ins = last_ins;
+}
+
+/*
+ * the branch_b0_table should maintain the order of these
+ * opcodes.
+case CEE_BEQ:
+case CEE_BGE:
+case CEE_BGT:
+case CEE_BLE:
+case CEE_BLT:
+case CEE_BNE_UN:
+case CEE_BGE_UN:
+case CEE_BGT_UN:
+case CEE_BLE_UN:
+case CEE_BLT_UN:
+ */
+static const guchar
+branch_b0_table [] = {
+ PPC_BR_TRUE,
+ PPC_BR_FALSE,
+ PPC_BR_TRUE,
+ PPC_BR_FALSE,
+ PPC_BR_TRUE,
+
+ PPC_BR_FALSE,
+ PPC_BR_FALSE,
+ PPC_BR_TRUE,
+ PPC_BR_FALSE,
+ PPC_BR_TRUE
+};
+
+static const guchar
+branch_b1_table [] = {
+ PPC_BR_EQ,
+ PPC_BR_LT,
+ PPC_BR_GT,
+ PPC_BR_GT,
+ PPC_BR_LT,
+
+ PPC_BR_EQ,
+ PPC_BR_LT,
+ PPC_BR_GT,
+ PPC_BR_GT,
+ PPC_BR_LT
+};
+
+/*
+ * returns the offset used by spillvar. It allocates a new
+ * spill variable if necessary.
+ */
+static int
+mono_spillvar_offset (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ info->offset = cfg->stack_offset;
+ cfg->stack_offset += sizeof (gpointer);
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+static int
+mono_spillvar_offset_float (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info_float;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset += 7;
+ cfg->stack_offset &= ~7;
+ info->offset = cfg->stack_offset;
+ cfg->stack_offset += sizeof (double);
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+#undef DEBUG
+#define DEBUG(a) if (cfg->verbose_level > 1) a
+//#define DEBUG(a)
+/* use ppc_r3-ppc_10,ppc_r12 as temp registers, f1-f13 for FP registers */
+#define PPC_CALLER_REGS ((0xff<<3) | (1<<12) | USE_EXTRA_TEMPS)
+#define PPC_CALLER_FREGS (0x3ffe)
+
+#define reg_is_freeable(r) (PPC_CALLER_REGS & 1 << (r))
+#define freg_is_freeable(r) ((r) >= 1 && (r) <= 13)
+
+typedef struct {
+ int born_in;
+ int killed_in;
+ int last_use;
+ int prev_use;
+} RegTrack;
+
+static const char*const * ins_spec = ppcg4;
+
+static void
+print_ins (int i, MonoInst *ins)
+{
+ const char *spec = ins_spec [ins->opcode];
+ g_print ("\t%-2d %s", i, mono_inst_name (ins->opcode));
+ if (spec [MONO_INST_DEST]) {
+ if (ins->dreg >= MONO_MAX_IREGS)
+ g_print (" R%d <-", ins->dreg);
+ else
+ g_print (" %s <-", mono_arch_regname (ins->dreg));
+ }
+ if (spec [MONO_INST_SRC1]) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg1);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg1));
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg2);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg2));
+ }
+ if (spec [MONO_INST_CLOB])
+ g_print (" clobbers: %c", spec [MONO_INST_CLOB]);
+ g_print ("\n");
+}
+
+static void
+print_regtrack (RegTrack *t, int num)
+{
+ int i;
+ char buf [32];
+ const char *r;
+
+ for (i = 0; i < num; ++i) {
+ if (!t [i].born_in)
+ continue;
+ if (i >= MONO_MAX_IREGS) {
+ g_snprintf (buf, sizeof(buf), "R%d", i);
+ r = buf;
+ } else
+ r = mono_arch_regname (i);
+ g_print ("liveness: %s [%d - %d]\n", r, t [i].born_in, t[i].last_use);
+ }
+}
+
+typedef struct InstList InstList;
+
+struct InstList {
+ InstList *prev;
+ InstList *next;
+ MonoInst *data;
+};
+
+static inline InstList*
+inst_list_prepend (MonoMemPool *pool, InstList *list, MonoInst *data)
+{
+ InstList *item = mono_mempool_alloc (pool, sizeof (InstList));
+ item->data = data;
+ item->prev = NULL;
+ item->next = list;
+ if (list)
+ list->prev = item;
+ return item;
+}
+
+/*
+ * Force the spilling of the variable in the symbolic register 'reg'.
+ */
+static int
+get_register_force_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ sel = cfg->rs->iassign [reg];
+ /*i = cfg->rs->isymbolic [sel];
+ g_assert (i == reg);*/
+ i = reg;
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static int
+get_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 && (reg_is_freeable (ins->sreg1) || (ins->sreg1 >= MONO_MAX_IREGS && cfg->rs->iassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 && (reg_is_freeable (ins->sreg2) || (ins->sreg2 >= MONO_MAX_IREGS && cfg->rs->iassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && reg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->iassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->isymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static int
+get_float_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 && (freg_is_freeable (ins->sreg1) || (ins->sreg1 >= MONO_MAX_FREGS && cfg->rs->fassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 && (freg_is_freeable (ins->sreg2) || (ins->sreg2 >= MONO_MAX_FREGS && cfg->rs->fassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && freg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_FREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->fassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->fsymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->fassign [i] = -spill - 1;
+ mono_regstate_free_float(cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOADR8_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD FP (%d at 0x%08x(%%sp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_float (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static MonoInst*
+create_copy_ins (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n", mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+static MonoInst*
+create_copy_ins_float (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_FMOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n", mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+static MonoInst*
+create_spilled_store (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORE_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE (%d at 0x%08x(%%sp)) R%d (from %s)\n", spill, store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+static MonoInst*
+create_spilled_store_float (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORER8_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE FP (%d at 0x%08x(%%sp)) R%d (from %s)\n", spill, store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+static void
+insert_before_ins (MonoInst *ins, InstList *item, MonoInst* to_insert)
+{
+ MonoInst *prev;
+ g_assert (item->next);
+ prev = item->next->data;
+
+ while (prev->next != ins)
+ prev = prev->next;
+ to_insert->next = ins;
+ prev->next = to_insert;
+ /*
+ * needed otherwise in the next instruction we can add an ins to the
+ * end and that would get past this instruction.
+ */
+ item->data = to_insert;
+}
+
+static int
+alloc_int_reg (MonoCompile *cfg, InstList *curinst, MonoInst *ins, int sym_reg, guint32 allow_mask)
+{
+ int val = cfg->rs->iassign [sym_reg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (cfg->rs, allow_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, curinst, ins, allow_mask, sym_reg);
+ cfg->rs->iassign [sym_reg] = val;
+ /* add option to store before the instruction for src registers */
+ if (spill)
+ create_spilled_store (cfg, spill, val, sym_reg, ins);
+ }
+ cfg->rs->isymbolic [val] = sym_reg;
+ return val;
+}
+
+/*
+ * Local register allocation.
+ * We first scan the list of instructions and we save the liveness info of
+ * each register (when the register is first used, when it's value is set etc.).
+ * We also reverse the list of instructions (in the InstList list) because assigning
+ * registers backwards allows for more tricks to be used.
+ */
+void
+mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoRegState *rs = cfg->rs;
+ int i, val;
+ RegTrack *reginfo, *reginfof;
+ RegTrack *reginfo1, *reginfo2, *reginfod;
+ InstList *tmp, *reversed = NULL;
+ const char *spec;
+ guint32 src1_mask, src2_mask, dest_mask;
+ guint32 cur_iregs, cur_fregs;
+
+ if (!bb->code)
+ return;
+ rs->next_vireg = bb->max_ireg;
+ rs->next_vfreg = bb->max_freg;
+ mono_regstate_assign (rs);
+ reginfo = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vireg);
+ reginfof = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vfreg);
+ rs->ifree_mask = PPC_CALLER_REGS;
+ rs->ffree_mask = PPC_CALLER_FREGS;
+
+ ins = bb->code;
+ i = 1;
+ DEBUG (g_print ("LOCAL regalloc: basic block: %d\n", bb->block_num));
+ /* forward pass on the instructions to collect register liveness info */
+ while (ins) {
+ spec = ins_spec [ins->opcode];
+ DEBUG (print_ins (i, ins));
+ /*if (spec [MONO_INST_CLOB] == 'c') {
+ MonoCallInst * call = (MonoCallInst*)ins;
+ int j;
+ }*/
+ if (spec [MONO_INST_SRC1]) {
+ if (spec [MONO_INST_SRC1] == 'f')
+ reginfo1 = reginfof;
+ else
+ reginfo1 = reginfo;
+ reginfo1 [ins->sreg1].prev_use = reginfo1 [ins->sreg1].last_use;
+ reginfo1 [ins->sreg1].last_use = i;
+ } else {
+ ins->sreg1 = -1;
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (spec [MONO_INST_SRC2] == 'f')
+ reginfo2 = reginfof;
+ else
+ reginfo2 = reginfo;
+ reginfo2 [ins->sreg2].prev_use = reginfo2 [ins->sreg2].last_use;
+ reginfo2 [ins->sreg2].last_use = i;
+ } else {
+ ins->sreg2 = -1;
+ }
+ if (spec [MONO_INST_DEST]) {
+ if (spec [MONO_INST_DEST] == 'f')
+ reginfod = reginfof;
+ else
+ reginfod = reginfo;
+ if (spec [MONO_INST_DEST] != 'b') /* it's not just a base register */
+ reginfod [ins->dreg].killed_in = i;
+ reginfod [ins->dreg].prev_use = reginfod [ins->dreg].last_use;
+ reginfod [ins->dreg].last_use = i;
+ if (reginfod [ins->dreg].born_in == 0 || reginfod [ins->dreg].born_in > i)
+ reginfod [ins->dreg].born_in = i;
+ if (spec [MONO_INST_DEST] == 'l') {
+ /* result in eax:edx, the virtual register is allocated sequentially */
+ reginfod [ins->dreg + 1].prev_use = reginfod [ins->dreg + 1].last_use;
+ reginfod [ins->dreg + 1].last_use = i;
+ if (reginfod [ins->dreg + 1].born_in == 0 || reginfod [ins->dreg + 1].born_in > i)
+ reginfod [ins->dreg + 1].born_in = i;
+ }
+ } else {
+ ins->dreg = -1;
+ }
+ reversed = inst_list_prepend (cfg->mempool, reversed, ins);
+ ++i;
+ ins = ins->next;
+ }
+
+ cur_iregs = PPC_CALLER_REGS;
+ cur_fregs = PPC_CALLER_FREGS;
+
+ DEBUG (print_regtrack (reginfo, rs->next_vireg));
+ DEBUG (print_regtrack (reginfof, rs->next_vfreg));
+ tmp = reversed;
+ while (tmp) {
+ int prev_dreg, prev_sreg1, prev_sreg2;
+ --i;
+ ins = tmp->data;
+ spec = ins_spec [ins->opcode];
+ DEBUG (g_print ("processing:"));
+ DEBUG (print_ins (i, ins));
+ /* make the register available for allocation: FIXME add fp reg */
+ if (ins->opcode == OP_SETREG || ins->opcode == OP_SETREGIMM) {
+ cur_iregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_iregs\n", ins->dreg));
+ } else if (ins->opcode == OP_SETFREG) {
+ cur_fregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_fregs\n", ins->dreg));
+ } else if (spec [MONO_INST_CLOB] == 'c') {
+ MonoCallInst *cinst = (MonoCallInst*)ins;
+ DEBUG (g_print ("excluding regs 0x%x from cur_iregs (0x%x)\n", cinst->used_iregs, cur_iregs));
+ DEBUG (g_print ("excluding fpregs 0x%x from cur_fregs (0x%x)\n", cinst->used_fregs, cur_fregs));
+ cur_iregs &= ~cinst->used_iregs;
+ cur_fregs &= ~cinst->used_fregs;
+ DEBUG (g_print ("available cur_iregs: 0x%x\n", cur_iregs));
+ DEBUG (g_print ("available cur_fregs: 0x%x\n", cur_fregs));
+ /* registers used by the calling convention are excluded from
+ * allocation: they will be selectively enabled when they are
+ * assigned by the special SETREG opcodes.
+ */
+ }
+ dest_mask = src1_mask = src2_mask = cur_iregs;
+ /* update for use with FP regs... */
+ if (spec [MONO_INST_DEST] == 'f') {
+ dest_mask = cur_fregs;
+ if (ins->dreg >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_float (rs, dest_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->fassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->fsymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (spec [MONO_INST_CLOB] == 'c' && ins->dreg != ppc_f1) {
+ /* this instruction only outputs to ppc_f1, need to copy */
+ create_copy_ins_float (cfg, ins->dreg, ppc_f1, ins);
+ }
+ } else {
+ prev_dreg = -1;
+ }
+ if (freg_is_freeable (ins->dreg) && prev_dreg >= 0 && (reginfof [prev_dreg].born_in >= i || !(cur_fregs & (1 << ins->dreg)))) {
+ DEBUG (g_print ("\tfreeable float %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfof [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ }
+ } else if (ins->dreg >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (spec [MONO_INST_DEST] == 'l') {
+ int hreg = prev_dreg + 1;
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, hreg);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins);
+ }
+ DEBUG (g_print ("\tassigned hreg %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+ /* FIXME:? ins->dreg = val; */
+ if (ins->dreg == ppc_r4) {
+ if (val != ppc_r3)
+ create_copy_ins (cfg, val, ppc_r3, ins);
+ } else if (ins->dreg == ppc_r3) {
+ if (val == ppc_r4) {
+ /* swap */
+ create_copy_ins (cfg, ppc_r4, ppc_r0, ins);
+ create_copy_ins (cfg, ppc_r3, ppc_r4, ins);
+ create_copy_ins (cfg, ppc_r0, ppc_r3, ins);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, ins->dreg, ppc_r4, ins);
+ create_copy_ins (cfg, val, ppc_r3, ins);
+ }
+ } else {
+ if (val == ppc_r3) {
+ create_copy_ins (cfg, ins->dreg, ppc_r4, ins);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, val, ppc_r3, ins);
+ create_copy_ins (cfg, ins->dreg, ppc_r4, ins);
+ }
+ }
+ if (reg_is_freeable (val) && hreg >= 0 && (reginfo [hreg].born_in >= i && !(cur_iregs & (1 << val)))) {
+ DEBUG (g_print ("\tfreeable %s (R%d)\n", mono_arch_regname (val), hreg));
+ mono_regstate_free_int (rs, val);
+ }
+ } else if (spec [MONO_INST_DEST] == 'a' && ins->dreg != ppc_r3 && spec [MONO_INST_CLOB] != 'd') {
+ /* this instruction only outputs to ppc_r3, need to copy */
+ create_copy_ins (cfg, ins->dreg, ppc_r3, ins);
+ }
+ } else {
+ prev_dreg = -1;
+ }
+ if (spec [MONO_INST_DEST] == 'f' && freg_is_freeable (ins->dreg) && prev_dreg >= 0 && (reginfof [prev_dreg].born_in >= i)) {
+ DEBUG (g_print ("\tfreeable float %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfof [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ } else if (spec [MONO_INST_DEST] != 'f' && reg_is_freeable (ins->dreg) && prev_dreg >= 0 && (reginfo [prev_dreg].born_in >= i)) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_int (rs, ins->dreg);
+ }
+ if (spec [MONO_INST_SRC1] == 'f') {
+ src1_mask = cur_fregs;
+ if (ins->sreg1 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ //g_assert (val == -1); /* source cannot be spilled */
+ val = mono_regstate_alloc_float (rs, src1_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src1_mask, ins->sreg1);
+ rs->fassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ if (spill) {
+ MonoInst *store = create_spilled_store_float (cfg, spill, val, prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->fsymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ } else if (ins->sreg1 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ if (0 && ins->opcode == OP_MOVE) {
+ /*
+ * small optimization: the dest register is already allocated
+ * but the src one is not: we can simply assign the same register
+ * here and peephole will get rid of the instruction later.
+ * This optimization may interfere with the clobbering handling:
+ * it removes a mov operation that will be added again to handle clobbering.
+ * There are also some other issues that should with make testjit.
+ */
+ mono_regstate_alloc_int (rs, 1 << ins->dreg);
+ val = rs->iassign [ins->sreg1] = ins->dreg;
+ //g_assert (val >= 0);
+ DEBUG (g_print ("\tfast assigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ } else {
+ //g_assert (val == -1); /* source cannot be spilled */
+ val = mono_regstate_alloc_int (rs, src1_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, src1_mask, ins->sreg1);
+ rs->iassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ }
+ if (spill) {
+ MonoInst *store = create_spilled_store (cfg, spill, val, prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->isymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ if (spec [MONO_INST_SRC2] == 'f') {
+ src2_mask = cur_fregs;
+ if (ins->sreg2 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_float (rs, src2_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->fassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->fsymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+ } else if (ins->sreg2 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, src2_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->iassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->isymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ int j, s;
+ guint32 clob_mask = PPC_CALLER_REGS;
+ for (j = 0; j < MONO_MAX_IREGS; ++j) {
+ s = 1 << j;
+ if ((clob_mask & s) && !(rs->ifree_mask & s) && j != ins->sreg1) {
+ //g_warning ("register %s busy at call site\n", mono_arch_regname (j));
+ }
+ }
+ }
+ /*if (reg_is_freeable (ins->sreg1) && prev_sreg1 >= 0 && reginfo [prev_sreg1].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg1)));
+ mono_regstate_free_int (rs, ins->sreg1);
+ }
+ if (reg_is_freeable (ins->sreg2) && prev_sreg2 >= 0 && reginfo [prev_sreg2].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg2)));
+ mono_regstate_free_int (rs, ins->sreg2);
+ }*/
+
+ //DEBUG (print_ins (i, ins));
+ tmp = tmp->next;
+ }
+ cfg->max_ireg = MAX (cfg->max_ireg, rs->max_ireg);
+}
+
+static guchar*
+emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size, gboolean is_signed)
+{
+ /* sreg is a float, dreg is an integer reg. ppc_f0 is used a scratch */
+ ppc_fctiwz (code, ppc_f0, sreg);
+ ppc_stfd (code, ppc_f0, -8, ppc_sp);
+ ppc_lwz (code, dreg, -4, ppc_sp);
+ if (!is_signed) {
+ if (size == 1)
+ ppc_andid (code, dreg, dreg, 0xff);
+ else if (size == 2)
+ ppc_andid (code, dreg, dreg, 0xffff);
+ } else {
+ if (size == 1)
+ ppc_extsb (code, dreg, dreg);
+ else if (size == 2)
+ ppc_extsh (code, dreg, dreg);
+ }
+ return code;
+}
+
+static unsigned char*
+mono_emit_stack_alloc (guchar *code, MonoInst* tree)
+{
+#if 0
+ int sreg = tree->sreg1;
+ x86_alu_reg_reg (code, X86_SUB, X86_ESP, tree->sreg1);
+ if (tree->flags & MONO_INST_INIT) {
+ int offset = 0;
+ if (tree->dreg != X86_EAX && sreg != X86_EAX) {
+ x86_push_reg (code, X86_EAX);
+ offset += 4;
+ }
+ if (tree->dreg != X86_ECX && sreg != X86_ECX) {
+ x86_push_reg (code, X86_ECX);
+ offset += 4;
+ }
+ if (tree->dreg != X86_EDI && sreg != X86_EDI) {
+ x86_push_reg (code, X86_EDI);
+ offset += 4;
+ }
+
+ x86_shift_reg_imm (code, X86_SHR, sreg, 2);
+ if (sreg != X86_ECX)
+ x86_mov_reg_reg (code, X86_ECX, sreg, 4);
+ x86_alu_reg_reg (code, X86_XOR, X86_EAX, X86_EAX);
+
+ x86_lea_membase (code, X86_EDI, X86_ESP, offset);
+ x86_cld (code);
+ x86_prefix (code, X86_REP_PREFIX);
+ x86_stosl (code);
+
+ if (tree->dreg != X86_EDI && sreg != X86_EDI)
+ x86_pop_reg (code, X86_EDI);
+ if (tree->dreg != X86_ECX && sreg != X86_ECX)
+ x86_pop_reg (code, X86_ECX);
+ if (tree->dreg != X86_EAX && sreg != X86_EAX)
+ x86_pop_reg (code, X86_EAX);
+ }
+#endif
+ return code;
+}
+
+typedef struct {
+ guchar *code;
+ guchar *target;
+ int absolute;
+ int found;
+} PatchData;
+
+#define is_call_imm(diff) ((gint)(diff) >= -33554432 && (gint)(diff) <= 33554431)
+
+static int
+search_thunk_slot (void *data, int csize, int bsize, void *user_data) {
+ PatchData *pdata = (PatchData*)user_data;
+ guchar *code = data;
+ guint32 *thunks = data;
+ guint32 *endthunks = (guint32*)(code + bsize);
+ guint32 load [2];
+ guchar *templ;
+ int i, count = 0;
+ int difflow, diffhigh;
+
+ /* always ensure a call from pdata->code can reach to the thunks without further thunks */
+ difflow = (char*)pdata->code - (char*)thunks;
+ diffhigh = (char*)pdata->code - (char*)endthunks;
+ if (!((is_call_imm (thunks) && is_call_imm (endthunks)) || (is_call_imm (difflow) && is_call_imm (diffhigh))))
+ return 0;
+
+ templ = (guchar*)load;
+ ppc_lis (templ, ppc_r0, (guint32)(pdata->target) >> 16);
+ ppc_ori (templ, ppc_r0, ppc_r0, (guint32)(pdata->target) & 0xffff);
+
+ //g_print ("thunk nentries: %d\n", ((char*)endthunks - (char*)thunks)/16);
+ if ((pdata->found == 2) || (pdata->code >= code && pdata->code <= code + csize)) {
+ while (thunks < endthunks) {
+ //g_print ("looking for target: %p at %p (%08x-%08x)\n", pdata->target, thunks, thunks [0], thunks [1]);
+ if ((thunks [0] == load [0]) && (thunks [1] == load [1])) {
+ ppc_patch (pdata->code, (guchar*)thunks);
+ mono_arch_flush_icache (pdata->code, 4);
+ pdata->found = 1;
+ return 1;
+ } else if ((thunks [0] == 0) && (thunks [1] == 0)) {
+ /* found a free slot instead: emit thunk */
+ code = (guchar*)thunks;
+ ppc_lis (code, ppc_r0, (guint32)(pdata->target) >> 16);
+ ppc_ori (code, ppc_r0, ppc_r0, (guint32)(pdata->target) & 0xffff);
+ ppc_mtctr (code, ppc_r0);
+ ppc_bcctr (code, PPC_BR_ALWAYS, 0);
+ mono_arch_flush_icache ((guchar*)thunks, 16);
+
+ ppc_patch (pdata->code, (guchar*)thunks);
+ mono_arch_flush_icache (pdata->code, 4);
+ pdata->found = 1;
+ return 1;
+ }
+ /* skip 16 bytes, the size of the thunk */
+ thunks += 4;
+ count++;
+ }
+ //g_print ("failed thunk lookup for %p from %p at %p (%d entries)\n", pdata->target, pdata->code, data, count);
+ }
+ return 0;
+}
+
+static void
+handle_thunk (int absolute, guchar *code, guchar *target) {
+ MonoDomain *domain = mono_domain_get ();
+ PatchData pdata;
+
+ pdata.code = code;
+ pdata.target = target;
+ pdata.absolute = absolute;
+ pdata.found = 0;
+
+ mono_domain_lock (domain);
+ mono_code_manager_foreach (domain->code_mp, search_thunk_slot, &pdata);
+
+ if (!pdata.found) {
+ /* this uses the first available slot */
+ pdata.found = 2;
+ mono_code_manager_foreach (domain->code_mp, search_thunk_slot, &pdata);
+ }
+ mono_domain_unlock (domain);
+
+ if (pdata.found != 1)
+ g_print ("thunk failed for %p from %p\n", target, code);
+ g_assert (pdata.found == 1);
+}
+
+void
+ppc_patch (guchar *code, guchar *target)
+{
+ guint32 ins = *(guint32*)code;
+ guint32 prim = ins >> 26;
+ guint32 ovf;
+
+ //g_print ("patching 0x%08x (0x%08x) to point to 0x%08x\n", code, ins, target);
+ if (prim == 18) {
+ // prefer relative branches, they are more position independent (e.g. for AOT compilation).
+ gint diff = target - code;
+ if (diff >= 0){
+ if (diff <= 33554431){
+ ins = (18 << 26) | (diff) | (ins & 1);
+ *(guint32*)code = ins;
+ return;
+ }
+ } else {
+ /* diff between 0 and -33554432 */
+ if (diff >= -33554432){
+ ins = (18 << 26) | (diff & ~0xfc000000) | (ins & 1);
+ *(guint32*)code = ins;
+ return;
+ }
+ }
+
+ if ((glong)target >= 0){
+ if ((glong)target <= 33554431){
+ ins = (18 << 26) | ((guint32) target) | (ins & 1) | 2;
+ *(guint32*)code = ins;
+ return;
+ }
+ } else {
+ if ((glong)target >= -33554432){
+ ins = (18 << 26) | (((guint32)target) & ~0xfc000000) | (ins & 1) | 2;
+ *(guint32*)code = ins;
+ return;
+ }
+ }
+
+ handle_thunk (TRUE, code, target);
+ return;
+
+ g_assert_not_reached ();
+ }
+
+
+ if (prim == 16) {
+ // absolute address
+ if (ins & 2) {
+ guint32 li = (guint32)target;
+ ins = (ins & 0xffff0000) | (ins & 3);
+ ovf = li & 0xffff0000;
+ if (ovf != 0 && ovf != 0xffff0000)
+ g_assert_not_reached ();
+ li &= 0xffff;
+ ins |= li;
+ // FIXME: assert the top bits of li are 0
+ } else {
+ gint diff = target - code;
+ ins = (ins & 0xffff0000) | (ins & 3);
+ ovf = diff & 0xffff0000;
+ if (ovf != 0 && ovf != 0xffff0000)
+ g_assert_not_reached ();
+ diff &= 0xffff;
+ ins |= diff;
+ }
+ *(guint32*)code = ins;
+ } else {
+ g_assert_not_reached ();
+ }
+// g_print ("patched with 0x%08x\n", ins);
+}
+
+void
+mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoCallInst *call;
+ guint offset;
+ guint8 *code = cfg->native_code + cfg->code_len;
+ MonoInst *last_ins = NULL;
+ guint last_offset = 0;
+ int max_len, cpos;
+
+ if (cfg->opt & MONO_OPT_PEEPHOLE)
+ peephole_pass (cfg, bb);
+
+ /* we don't align basic blocks of loops on ppc */
+
+ if (cfg->verbose_level > 2)
+ g_print ("Basic block %d starting at offset 0x%x\n", bb->block_num, bb->native_offset);
+
+ cpos = bb->max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE) {
+ //MonoCoverageInfo *cov = mono_get_coverage_info (cfg->method);
+ //g_assert (!mono_compile_aot);
+ //cpos += 6;
+ //if (bb->cil_code)
+ // cov->data [bb->dfn].iloffset = bb->cil_code - cfg->cil_code;
+ /* this is not thread save, but good enough */
+ /* fixme: howto handle overflows? */
+ //x86_inc_mem (code, &cov->data [bb->dfn].count);
+ }
+
+ ins = bb->code;
+ while (ins) {
+ offset = code - cfg->native_code;
+
+ max_len = ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+
+ if (offset > (cfg->code_size - max_len - 16)) {
+ cfg->code_size *= 2;
+ cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
+ code = cfg->native_code + offset;
+ }
+ // if (ins->cil_code)
+ // g_print ("cil code\n");
+ mono_debug_record_line_number (cfg, ins, offset);
+
+ switch (ins->opcode) {
+ case OP_BIGMUL:
+ ppc_mullw (code, ppc_r4, ins->sreg1, ins->sreg2);
+ ppc_mulhw (code, ppc_r3, ins->sreg1, ins->sreg2);
+ break;
+ case OP_BIGMUL_UN:
+ ppc_mullw (code, ppc_r4, ins->sreg1, ins->sreg2);
+ ppc_mulhwu (code, ppc_r3, ins->sreg1, ins->sreg2);
+ break;
+ case OP_STOREI1_MEMBASE_IMM:
+ ppc_li (code, ppc_r0, ins->inst_imm);
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_stb (code, ppc_r0, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_stbx (code, ppc_r0, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case OP_STOREI2_MEMBASE_IMM:
+ ppc_li (code, ppc_r0, ins->inst_imm);
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_sth (code, ppc_r0, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_sthx (code, ppc_r0, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case OP_STORE_MEMBASE_IMM:
+ case OP_STOREI4_MEMBASE_IMM:
+ ppc_load (code, ppc_r0, ins->inst_imm);
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_stw (code, ppc_r0, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_stwx (code, ppc_r0, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case OP_STOREI1_MEMBASE_REG:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_stb (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_stbx (code, ins->sreg1, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case OP_STOREI2_MEMBASE_REG:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_sth (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_sthx (code, ins->sreg1, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case OP_STORE_MEMBASE_REG:
+ case OP_STOREI4_MEMBASE_REG:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_stw (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_stwx (code, ins->sreg1, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case CEE_LDIND_I:
+ case CEE_LDIND_I4:
+ case CEE_LDIND_U4:
+ g_assert_not_reached ();
+ //x86_mov_reg_mem (code, ins->dreg, ins->inst_p0, 4);
+ break;
+ case OP_LOADU4_MEM:
+ g_assert_not_reached ();
+ //x86_mov_reg_imm (code, ins->dreg, ins->inst_p0);
+ //x86_mov_reg_membase (code, ins->dreg, ins->dreg, 0, 4);
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ case OP_LOADU4_MEMBASE:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_lwz (code, ins->dreg, ins->inst_offset, ins->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_lwzx (code, ins->dreg, ppc_r11, ins->inst_basereg);
+ }
+ break;
+ case OP_LOADI1_MEMBASE:
+ case OP_LOADU1_MEMBASE:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_lbz (code, ins->dreg, ins->inst_offset, ins->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_lbzx (code, ins->dreg, ppc_r11, ins->inst_basereg);
+ }
+ if (ins->opcode == OP_LOADI1_MEMBASE)
+ ppc_extsb (code, ins->dreg, ins->dreg);
+ break;
+ case OP_LOADU2_MEMBASE:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_lhz (code, ins->dreg, ins->inst_offset, ins->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_lhzx (code, ins->dreg, ppc_r11, ins->inst_basereg);
+ }
+ break;
+ case OP_LOADI2_MEMBASE:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_lha (code, ins->dreg, ins->inst_basereg, ins->inst_offset);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_lhax (code, ins->dreg, ppc_r11, ins->inst_basereg);
+ }
+ break;
+ case CEE_CONV_I1:
+ ppc_extsb (code, ins->dreg, ins->sreg1);
+ break;
+ case CEE_CONV_I2:
+ ppc_extsh (code, ins->dreg, ins->sreg1);
+ break;
+ case CEE_CONV_U1:
+ ppc_rlwinm (code, ins->dreg, ins->sreg1, 0, 24, 31);
+ break;
+ case CEE_CONV_U2:
+ ppc_rlwinm (code, ins->dreg, ins->sreg1, 0, 16, 31);
+ break;
+ case OP_COMPARE:
+ if (ins->next &&
+ ((ins->next->opcode >= CEE_BNE_UN && ins->next->opcode <= CEE_BLT_UN) ||
+ (ins->next->opcode >= OP_COND_EXC_NE_UN && ins->next->opcode <= OP_COND_EXC_LT_UN) ||
+ (ins->next->opcode == OP_CLT_UN || ins->next->opcode == OP_CGT_UN)))
+ ppc_cmpl (code, 0, 0, ins->sreg1, ins->sreg2);
+ else
+ ppc_cmp (code, 0, 0, ins->sreg1, ins->sreg2);
+ break;
+ case OP_COMPARE_IMM:
+ if (ins->next &&
+ ((ins->next->opcode >= CEE_BNE_UN && ins->next->opcode <= CEE_BLT_UN) ||
+ (ins->next->opcode >= OP_COND_EXC_NE_UN && ins->next->opcode <= OP_COND_EXC_LT_UN) ||
+ (ins->next->opcode == OP_CLT_UN || ins->next->opcode == OP_CGT_UN))) {
+ if (ppc_is_uimm16 (ins->inst_imm)) {
+ ppc_cmpli (code, 0, 0, ins->sreg1, (ins->inst_imm & 0xffff));
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_cmpl (code, 0, 0, ins->sreg1, ppc_r11);
+ }
+ } else {
+ if (ppc_is_imm16 (ins->inst_imm)) {
+ ppc_cmpi (code, 0, 0, ins->sreg1, (ins->inst_imm & 0xffff));
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_cmp (code, 0, 0, ins->sreg1, ppc_r11);
+ }
+ }
+ break;
+ case OP_X86_TEST_NULL:
+ ppc_cmpi (code, 0, 0, ins->sreg1, 0);
+ break;
+ case CEE_BREAK:
+ ppc_break (code);
+ break;
+ case OP_ADDCC:
+ ppc_addc (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case CEE_ADD:
+ ppc_add (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_ADC:
+ ppc_adde (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_ADDCC_IMM:
+ if (ppc_is_imm16 (ins->inst_imm)) {
+ ppc_addic (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_addc (code, ins->dreg, ins->sreg1, ppc_r11);
+ }
+ break;
+ case OP_ADD_IMM:
+ if (ppc_is_imm16 (ins->inst_imm)) {
+ ppc_addi (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_add (code, ins->dreg, ins->sreg1, ppc_r11);
+ }
+ break;
+ case OP_ADC_IMM:
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_adde (code, ins->dreg, ins->sreg1, ppc_r11);
+ break;
+ case CEE_ADD_OVF:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_addo (code, ins->dreg, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;
+ case CEE_ADD_OVF_UN:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_addco (code, ins->dreg, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<13));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;
+ case CEE_SUB_OVF:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_subfo (code, ins->dreg, ins->sreg2, ins->sreg1);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;
+ case CEE_SUB_OVF_UN:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_subfc (code, ins->dreg, ins->sreg2, ins->sreg1);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<13));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_TRUE, PPC_BR_EQ, "OverflowException");
+ break;
+ case OP_ADD_OVF_CARRY:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_addeo (code, ins->dreg, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;
+ case OP_ADD_OVF_UN_CARRY:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_addeo (code, ins->dreg, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<13));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;
+ case OP_SUB_OVF_CARRY:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_subfeo (code, ins->dreg, ins->sreg2, ins->sreg1);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;
+ case OP_SUB_OVF_UN_CARRY:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ ppc_subfeo (code, ins->dreg, ins->sreg2, ins->sreg1);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<13));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_TRUE, PPC_BR_EQ, "OverflowException");
+ break;
+ case OP_SUBCC:
+ ppc_subfc (code, ins->dreg, ins->sreg2, ins->sreg1);
+ break;
+ case OP_SUBCC_IMM:
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_subfc (code, ins->dreg, ppc_r11, ins->sreg1);
+ break;
+ case CEE_SUB:
+ ppc_subf (code, ins->dreg, ins->sreg2, ins->sreg1);
+ break;
+ case OP_SBB:
+ ppc_subfe (code, ins->dreg, ins->sreg2, ins->sreg1);
+ break;
+ case OP_SUB_IMM:
+ // we add the negated value
+ if (ppc_is_imm16 (-ins->inst_imm))
+ ppc_addi (code, ins->dreg, ins->sreg1, -ins->inst_imm);
+ else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_sub (code, ins->dreg, ins->sreg1, ppc_r11);
+ }
+ break;
+ case OP_SBB_IMM:
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_subfe (code, ins->dreg, ppc_r11, ins->sreg1);
+ break;
+ case OP_PPC_SUBFIC:
+ g_assert (ppc_is_imm16 (ins->inst_imm));
+ ppc_subfic (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ break;
+ case OP_PPC_SUBFZE:
+ ppc_subfze (code, ins->dreg, ins->sreg1);
+ break;
+ case CEE_AND:
+ /* FIXME: the ppc macros as inconsistent here: put dest as the first arg! */
+ ppc_and (code, ins->sreg1, ins->dreg, ins->sreg2);
+ break;
+ case OP_AND_IMM:
+ if (!(ins->inst_imm & 0xffff0000)) {
+ ppc_andid (code, ins->sreg1, ins->dreg, ins->inst_imm);
+ } else if (!(ins->inst_imm & 0xffff)) {
+ ppc_andisd (code, ins->sreg1, ins->dreg, ((guint32)ins->inst_imm >> 16));
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_and (code, ins->sreg1, ins->dreg, ppc_r11);
+ }
+ break;
+ case CEE_DIV:
+ /* XER format: SO, OV, CA, reserved [21 bits], count [8 bits]
+ */
+ ppc_divwod (code, ins->dreg, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ /* FIXME: use OverflowException for 0x80000000/-1 */
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "DivideByZeroException");
+ break;
+ case CEE_DIV_UN:
+ ppc_divwuod (code, ins->dreg, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "DivideByZeroException");
+ break;
+ case OP_DIV_IMM:
+ g_assert_not_reached ();
+#if 0
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_divwod (code, ins->dreg, ins->sreg1, ppc_r11);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ /* FIXME: use OverflowException for 0x80000000/-1 */
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "DivideByZeroException");
+ break;
+#endif
+ case CEE_REM:
+ ppc_divwod (code, ppc_r11, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ /* FIXME: use OverflowException for 0x80000000/-1 */
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "DivideByZeroException");
+ ppc_mullw (code, ppc_r11, ppc_r11, ins->sreg2);
+ ppc_subf (code, ins->dreg, ppc_r11, ins->sreg1);
+ break;
+ case CEE_REM_UN:
+ ppc_divwuod (code, ppc_r11, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "DivideByZeroException");
+ ppc_mullw (code, ppc_r11, ppc_r11, ins->sreg2);
+ ppc_subf (code, ins->dreg, ppc_r11, ins->sreg1);
+ break;
+ case OP_REM_IMM:
+ g_assert_not_reached ();
+ case CEE_OR:
+ ppc_or (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_OR_IMM:
+ if (!(ins->inst_imm & 0xffff0000)) {
+ ppc_ori (code, ins->sreg1, ins->dreg, ins->inst_imm);
+ } else if (!(ins->inst_imm & 0xffff)) {
+ ppc_oris (code, ins->sreg1, ins->dreg, ((guint32)(ins->inst_imm) >> 16));
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_or (code, ins->sreg1, ins->dreg, ppc_r11);
+ }
+ break;
+ case CEE_XOR:
+ ppc_xor (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_XOR_IMM:
+ if (!(ins->inst_imm & 0xffff0000)) {
+ ppc_xori (code, ins->sreg1, ins->dreg, ins->inst_imm);
+ } else if (!(ins->inst_imm & 0xffff)) {
+ ppc_xoris (code, ins->sreg1, ins->dreg, ((guint32)(ins->inst_imm) >> 16));
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_xor (code, ins->sreg1, ins->dreg, ppc_r11);
+ }
+ break;
+ case CEE_SHL:
+ ppc_slw (code, ins->sreg1, ins->dreg, ins->sreg2);
+ break;
+ case OP_SHL_IMM:
+ ppc_rlwinm (code, ins->dreg, ins->sreg1, (ins->inst_imm & 0x1f), 0, (31 - (ins->inst_imm & 0x1f)));
+ //ppc_load (code, ppc_r11, ins->inst_imm);
+ //ppc_slw (code, ins->sreg1, ins->dreg, ppc_r11);
+ break;
+ case CEE_SHR:
+ ppc_sraw (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_SHR_IMM:
+ // there is also ppc_srawi
+ //ppc_load (code, ppc_r11, ins->inst_imm);
+ //ppc_sraw (code, ins->dreg, ins->sreg1, ppc_r11);
+ ppc_srawi (code, ins->dreg, ins->sreg1, (ins->inst_imm & 0x1f));
+ break;
+ case OP_SHR_UN_IMM:
+ /*ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_srw (code, ins->dreg, ins->sreg1, ppc_r11);*/
+ ppc_rlwinm (code, ins->dreg, ins->sreg1, (32 - (ins->inst_imm & 0x1f)), (ins->inst_imm & 0x1f), 31);
+ break;
+ case CEE_SHR_UN:
+ ppc_srw (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case CEE_NOT:
+ ppc_not (code, ins->dreg, ins->sreg1);
+ break;
+ case CEE_NEG:
+ ppc_neg (code, ins->dreg, ins->sreg1);
+ break;
+ case CEE_MUL:
+ ppc_mullw (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_MUL_IMM:
+ if (ppc_is_imm16 (ins->inst_imm)) {
+ ppc_mulli (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_imm);
+ ppc_mullw (code, ins->dreg, ins->sreg1, ppc_r11);
+ }
+ break;
+ case CEE_MUL_OVF:
+ /* we annot use mcrxr, since it's not implemented on some processors
+ * XER format: SO, OV, CA, reserved [21 bits], count [8 bits]
+ */
+ ppc_mullwo (code, ins->dreg, ins->sreg1, ins->sreg2);
+ ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;
+ case CEE_MUL_OVF_UN:
+ /* we first multiply to get the high word and compare to 0
+ * to set the flags, then the result is discarded and then
+ * we multiply to get the lower * bits result
+ */
+ ppc_mulhwu (code, ppc_r0, ins->sreg1, ins->sreg2);
+ ppc_cmpi (code, 0, 0, ppc_r0, 0);
+ EMIT_COND_SYSTEM_EXCEPTION (CEE_BNE_UN - CEE_BEQ, "OverflowException");
+ ppc_mullw (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_ICONST:
+ case OP_SETREGIMM:
+ ppc_load (code, ins->dreg, ins->inst_c0);
+ break;
+ case OP_AOTCONST:
+ mono_add_patch_info (cfg, offset, (MonoJumpInfoType)ins->inst_i1, ins->inst_p0);
+ ppc_lis (code, ins->dreg, 0);
+ ppc_ori (code, ins->dreg, ins->dreg, 0);
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ case OP_SETREG:
+ ppc_mr (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_SETLRET: {
+ int saved = ins->sreg1;
+ if (ins->sreg1 == ppc_r3) {
+ ppc_mr (code, ppc_r0, ins->sreg1);
+ saved = ppc_r0;
+ }
+ if (ins->sreg2 != ppc_r3)
+ ppc_mr (code, ppc_r3, ins->sreg2);
+ if (saved != ppc_r4)
+ ppc_mr (code, ppc_r4, saved);
+ break;
+ }
+ case OP_SETFREG:
+ case OP_FMOVE:
+ ppc_fmr (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_FCONV_TO_R4:
+ ppc_frsp (code, ins->dreg, ins->sreg1);
+ break;
+ case CEE_JMP: {
+ int i, pos = 0;
+
+ /*
+ * Keep in sync with mono_arch_emit_epilog
+ */
+ g_assert (!cfg->method->save_lmf);
+ if (1 || cfg->flags & MONO_CFG_HAS_CALLS) {
+ if (ppc_is_imm16 (cfg->stack_usage + PPC_RET_ADDR_OFFSET)) {
+ ppc_lwz (code, ppc_r0, cfg->stack_usage + PPC_RET_ADDR_OFFSET, cfg->frame_reg);
+ } else {
+ ppc_load (code, ppc_r11, cfg->stack_usage + PPC_RET_ADDR_OFFSET);
+ ppc_lwzx (code, ppc_r0, cfg->frame_reg, ppc_r11);
+ }
+ ppc_mtlr (code, ppc_r0);
+ }
+ if (ppc_is_imm16 (cfg->stack_usage)) {
+ ppc_addic (code, ppc_sp, cfg->frame_reg, cfg->stack_usage);
+ } else {
+ ppc_load (code, ppc_r11, cfg->stack_usage);
+ ppc_add (code, ppc_sp, cfg->frame_reg, ppc_r11);
+ }
+ if (!cfg->method->save_lmf) {
+ /*for (i = 31; i >= 14; --i) {
+ if (cfg->used_float_regs & (1 << i)) {
+ pos += sizeof (double);
+ ppc_lfd (code, i, -pos, cfg->frame_reg);
+ }
+ }*/
+ for (i = 31; i >= 13; --i) {
+ if (cfg->used_int_regs & (1 << i)) {
+ pos += sizeof (gulong);
+ ppc_lwz (code, i, -pos, cfg->frame_reg);
+ }
+ }
+ } else {
+ /* FIXME restore from MonoLMF: though this can't happen yet */
+ }
+ mono_add_patch_info (cfg, (guint8*) code - cfg->native_code, MONO_PATCH_INFO_METHOD_JUMP, ins->inst_p0);
+ ppc_b (code, 0);
+ break;
+ }
+ case OP_CHECK_THIS:
+ /* ensure ins->sreg1 is not NULL */
+ ppc_lwz (code, ppc_r0, 0, ins->sreg1);
+ break;
+ case OP_ARGLIST:
+ /* FIXME: implement */
+ break;
+ case OP_FCALL:
+ case OP_LCALL:
+ case OP_VCALL:
+ case OP_VOIDCALL:
+ case CEE_CALL:
+ call = (MonoCallInst*)ins;
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_METHOD, call->method);
+ else
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS, call->fptr);
+ ppc_bl (code, 0);
+ break;
+ case OP_FCALL_REG:
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ case OP_CALL_REG:
+ ppc_mtlr (code, ins->sreg1);
+ ppc_blrl (code);
+ break;
+ case OP_FCALL_MEMBASE:
+ case OP_LCALL_MEMBASE:
+ case OP_VCALL_MEMBASE:
+ case OP_VOIDCALL_MEMBASE:
+ case OP_CALL_MEMBASE:
+ ppc_lwz (code, ppc_r0, ins->inst_offset, ins->sreg1);
+ ppc_mtlr (code, ppc_r0);
+ ppc_blrl (code);
+ break;
+ case OP_OUTARG:
+ g_assert_not_reached ();
+ break;
+ case OP_LOCALLOC: {
+ /* keep alignment */
+ int alloca_waste = PPC_STACK_PARAM_OFFSET + cfg->param_area + 31;
+ int area_offset = alloca_waste;
+ area_offset &= ~31;
+ ppc_addi (code, ppc_r11, ins->sreg1, alloca_waste + 31);
+ ppc_rlwinm (code, ppc_r11, ppc_r11, 0, 0, 27);
+ ppc_lwz (code, ppc_r0, 0, ppc_sp);
+ ppc_neg (code, ppc_r11, ppc_r11);
+ ppc_stwux (code, ppc_r0, ppc_sp, ppc_r11);
+ ppc_addi (code, ins->dreg, ppc_sp, area_offset);
+ break;
+ }
+ case CEE_RET:
+ ppc_blr (code);
+ break;
+ case CEE_THROW: {
+ //ppc_break (code);
+ ppc_mr (code, ppc_r3, ins->sreg1);
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_throw_exception");
+ ppc_bl (code, 0);
+ break;
+ }
+ case OP_START_HANDLER:
+ ppc_mflr (code, ppc_r0);
+ if (ppc_is_imm16 (ins->inst_left->inst_offset)) {
+ ppc_stw (code, ppc_r0, ins->inst_left->inst_offset, ins->inst_left->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_left->inst_offset);
+ ppc_stwx (code, ppc_r0, ppc_r11, ins->inst_left->inst_basereg);
+ }
+ break;
+ case OP_ENDFILTER:
+ if (ins->sreg1 != ppc_r3)
+ ppc_mr (code, ppc_r3, ins->sreg1);
+ if (ppc_is_imm16 (ins->inst_left->inst_offset)) {
+ ppc_lwz (code, ppc_r0, ins->inst_left->inst_offset, ins->inst_left->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_left->inst_offset);
+ ppc_lwzx (code, ppc_r0, ins->inst_left->inst_basereg, ppc_r11);
+ }
+ ppc_mtlr (code, ppc_r0);
+ ppc_blr (code);
+ break;
+ case CEE_ENDFINALLY:
+ ppc_lwz (code, ppc_r0, ins->inst_left->inst_offset, ins->inst_left->inst_basereg);
+ ppc_mtlr (code, ppc_r0);
+ ppc_blr (code);
+ break;
+ case OP_CALL_HANDLER:
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ ppc_bl (code, 0);
+ break;
+ case OP_LABEL:
+ ins->inst_c0 = code - cfg->native_code;
+ break;
+ case CEE_BR:
+ //g_print ("target: %p, next: %p, curr: %p, last: %p\n", ins->inst_target_bb, bb->next_bb, ins, bb->last_ins);
+ //if ((ins->inst_target_bb == bb->next_bb) && ins == bb->last_ins)
+ //break;
+ if (ins->flags & MONO_INST_BRLABEL) {
+ /*if (ins->inst_i0->inst_c0) {
+ ppc_b (code, 0);
+ //x86_jump_code (code, cfg->native_code + ins->inst_i0->inst_c0);
+ } else*/ {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_LABEL, ins->inst_i0);
+ ppc_b (code, 0);
+ }
+ } else {
+ /*if (ins->inst_target_bb->native_offset) {
+ ppc_b (code, 0);
+ //x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset);
+ } else*/ {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ ppc_b (code, 0);
+ }
+ }
+ break;
+ case OP_BR_REG:
+ ppc_mtctr (code, ins->sreg1);
+ ppc_bcctr (code, PPC_BR_ALWAYS, 0);
+ break;
+ case OP_CEQ:
+ ppc_li (code, ins->dreg, 0);
+ ppc_bc (code, PPC_BR_FALSE, PPC_BR_EQ, 2);
+ ppc_li (code, ins->dreg, 1);
+ break;
+ case OP_CLT:
+ case OP_CLT_UN:
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_LT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
+ case OP_CGT:
+ case OP_CGT_UN:
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_GT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
+ case OP_COND_EXC_EQ:
+ case OP_COND_EXC_NE_UN:
+ case OP_COND_EXC_LT:
+ case OP_COND_EXC_LT_UN:
+ case OP_COND_EXC_GT:
+ case OP_COND_EXC_GT_UN:
+ case OP_COND_EXC_GE:
+ case OP_COND_EXC_GE_UN:
+ case OP_COND_EXC_LE:
+ case OP_COND_EXC_LE_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (ins->opcode - OP_COND_EXC_EQ, ins->inst_p1);
+ break;
+ case OP_COND_EXC_C:
+ /* check XER [0-3] (SO, OV, CA): we can't use mcrxr
+ */
+ /*ppc_mfspr (code, ppc_r0, ppc_xer);
+ ppc_andisd (code, ppc_r0, ppc_r0, (1<<14));
+ EMIT_COND_SYSTEM_EXCEPTION_FLAGS (PPC_BR_FALSE, PPC_BR_EQ, "OverflowException");
+ break;*/
+ case OP_COND_EXC_OV:
+ /*ppc_mcrxr (code, 0);
+ EMIT_COND_SYSTEM_EXCEPTION (CEE_BGT - CEE_BEQ, ins->inst_p1);
+ break;*/
+ case OP_COND_EXC_NC:
+ case OP_COND_EXC_NO:
+ g_assert_not_reached ();
+ break;
+ case CEE_BEQ:
+ case CEE_BNE_UN:
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ EMIT_COND_BRANCH (ins, ins->opcode - CEE_BEQ);
+ break;
+
+ /* floating point opcodes */
+ case OP_R8CONST:
+ ppc_load (code, ppc_r11, ins->inst_p0);
+ ppc_lfd (code, ins->dreg, 0, ppc_r11);
+ break;
+ case OP_R4CONST:
+ ppc_load (code, ppc_r11, ins->inst_p0);
+ ppc_lfs (code, ins->dreg, 0, ppc_r11);
+ break;
+ case OP_STORER8_MEMBASE_REG:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_stfd (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_stfdx (code, ins->sreg1, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case OP_LOADR8_MEMBASE:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_lfd (code, ins->dreg, ins->inst_offset, ins->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_lfdx (code, ins->dreg, ppc_r11, ins->inst_basereg);
+ }
+ break;
+ case OP_STORER4_MEMBASE_REG:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_stfs (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_stfsx (code, ins->sreg1, ppc_r11, ins->inst_destbasereg);
+ }
+ break;
+ case OP_LOADR4_MEMBASE:
+ if (ppc_is_imm16 (ins->inst_offset)) {
+ ppc_lfs (code, ins->dreg, ins->inst_offset, ins->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, ins->inst_offset);
+ ppc_lfsx (code, ins->dreg, ppc_r11, ins->inst_basereg);
+ }
+ break;
+ case CEE_CONV_R_UN: {
+ static const guint64 adjust_val = 0x4330000000000000ULL;
+ ppc_addis (code, ppc_r0, ppc_r0, 0x4330);
+ ppc_stw (code, ppc_r0, -8, ppc_sp);
+ ppc_stw (code, ins->sreg1, -4, ppc_sp);
+ ppc_load (code, ppc_r11, &adjust_val);
+ ppc_lfd (code, ins->dreg, -8, ppc_sp);
+ ppc_lfd (code, ppc_f0, 0, ppc_r11);
+ ppc_fsub (code, ins->dreg, ins->dreg, ppc_f0);
+ break;
+ }
+ case CEE_CONV_R4: /* FIXME: change precision */
+ case CEE_CONV_R8: {
+ static const guint64 adjust_val = 0x4330000080000000ULL;
+ // addis is special for ppc_r0
+ ppc_addis (code, ppc_r0, ppc_r0, 0x4330);
+ ppc_stw (code, ppc_r0, -8, ppc_sp);
+ ppc_xoris (code, ins->sreg1, ppc_r11, 0x8000);
+ ppc_stw (code, ppc_r11, -4, ppc_sp);
+ ppc_lfd (code, ins->dreg, -8, ppc_sp);
+ ppc_load (code, ppc_r11, &adjust_val);
+ ppc_lfd (code, ppc_f0, 0, ppc_r11);
+ ppc_fsub (code, ins->dreg, ins->dreg, ppc_f0);
+ break;
+ }
+ case OP_X86_FP_LOAD_I8:
+ g_assert_not_reached ();
+ /*x86_fild_membase (code, ins->inst_basereg, ins->inst_offset, TRUE);*/
+ break;
+ case OP_X86_FP_LOAD_I4:
+ g_assert_not_reached ();
+ /*x86_fild_membase (code, ins->inst_basereg, ins->inst_offset, FALSE);*/
+ break;
+ case OP_FCONV_TO_I1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, TRUE);
+ break;
+ case OP_FCONV_TO_U1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, FALSE);
+ break;
+ case OP_FCONV_TO_I2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, TRUE);
+ break;
+ case OP_FCONV_TO_U2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, FALSE);
+ break;
+ case OP_FCONV_TO_I4:
+ case OP_FCONV_TO_I:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
+ break;
+ case OP_FCONV_TO_U4:
+ case OP_FCONV_TO_U:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE);
+ break;
+ case OP_FCONV_TO_I8:
+ case OP_FCONV_TO_U8:
+ g_assert_not_reached ();
+ /* Implemented as helper calls */
+ break;
+ case OP_LCONV_TO_R_UN:
+ g_assert_not_reached ();
+ /* Implemented as helper calls */
+ break;
+ case OP_LCONV_TO_OVF_I: {
+ ppc_mr (code, ins->dreg, ins->sreg1);
+ /* FIXME: emit exception if needed */
+ break;
+ }
+ case OP_SQRT:
+ ppc_fsqrtd (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_FADD:
+ ppc_fadd (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_FSUB:
+ ppc_fsub (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_FMUL:
+ ppc_fmul (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_FDIV:
+ ppc_fdiv (code, ins->dreg, ins->sreg1, ins->sreg2);
+ break;
+ case OP_FNEG:
+ ppc_fneg (code, ins->dreg, ins->sreg1);
+ break;
+ case OP_FREM:
+ /* emulated */
+ g_assert_not_reached ();
+ break;
+ case OP_FCOMPARE:
+ ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
+ break;
+ case OP_FCEQ:
+ ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
+ ppc_li (code, ins->dreg, 0);
+ ppc_bc (code, PPC_BR_FALSE, PPC_BR_EQ, 2);
+ ppc_li (code, ins->dreg, 1);
+ break;
+ case OP_FCLT:
+ ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_LT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
+ case OP_FCLT_UN:
+ ppc_fcmpu (code, 0, ins->sreg1, ins->sreg2);
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_SO, 3);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_LT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
+ case OP_FCGT:
+ ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_GT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
+ case OP_FCGT_UN:
+ ppc_fcmpu (code, 0, ins->sreg1, ins->sreg2);
+ ppc_li (code, ins->dreg, 1);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_SO, 3);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_GT, 2);
+ ppc_li (code, ins->dreg, 0);
+ break;
+ case OP_FBEQ:
+ EMIT_COND_BRANCH (ins, CEE_BEQ - CEE_BEQ);
+ break;
+ case OP_FBNE_UN:
+ EMIT_COND_BRANCH (ins, CEE_BNE_UN - CEE_BEQ);
+ break;
+ case OP_FBLT:
+ EMIT_COND_BRANCH (ins, CEE_BLT - CEE_BEQ);
+ break;
+ case OP_FBLT_UN:
+ EMIT_COND_BRANCH_FLAGS (ins, PPC_BR_TRUE, PPC_BR_SO);
+ EMIT_COND_BRANCH (ins, CEE_BLT_UN - CEE_BEQ);
+ break;
+ case OP_FBGT:
+ EMIT_COND_BRANCH (ins, CEE_BGT - CEE_BEQ);
+ break;
+ case OP_FBGT_UN:
+ EMIT_COND_BRANCH_FLAGS (ins, PPC_BR_TRUE, PPC_BR_SO);
+ EMIT_COND_BRANCH (ins, CEE_BGT_UN - CEE_BEQ);
+ break;
+ case OP_FBGE:
+ EMIT_COND_BRANCH (ins, CEE_BGE - CEE_BEQ);
+ break;
+ case OP_FBGE_UN:
+ EMIT_COND_BRANCH (ins, CEE_BGE_UN - CEE_BEQ);
+ break;
+ case OP_FBLE:
+ EMIT_COND_BRANCH (ins, CEE_BLE - CEE_BEQ);
+ break;
+ case OP_FBLE_UN:
+ EMIT_COND_BRANCH (ins, CEE_BLE_UN - CEE_BEQ);
+ break;
+ case CEE_CKFINITE: {
+ ppc_stfd (code, ins->sreg1, -8, ppc_sp);
+ ppc_lwz (code, ppc_r11, -8, ppc_sp);
+ ppc_rlwinm (code, ppc_r11, ppc_r11, 0, 1, 31);
+ ppc_addis (code, ppc_r11, ppc_r11, -32752);
+ ppc_rlwinmd (code, ppc_r11, ppc_r11, 1, 31, 31);
+ EMIT_COND_SYSTEM_EXCEPTION (CEE_BEQ - CEE_BEQ, "ArithmeticException");
+ break;
+ }
+ default:
+ g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
+ g_assert_not_reached ();
+ }
+
+ if ((cfg->opt & MONO_OPT_BRANCH) && ((code - cfg->native_code - offset) > max_len)) {
+ g_warning ("wrong maximal instruction length of instruction %s (expected %d, got %d)",
+ mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset);
+ g_assert_not_reached ();
+ }
+
+ cpos += max_len;
+
+ last_ins = ins;
+ last_offset = offset;
+
+ ins = ins->next;
+ }
+
+ cfg->code_len = code - cfg->native_code;
+}
+
+void
+mono_arch_register_lowlevel_calls (void)
+{
+}
+
+#define patch_lis_ori(ip,val) do {\
+ guint16 *__lis_ori = (guint16*)(ip); \
+ __lis_ori [1] = (((guint32)(val)) >> 16) & 0xffff; \
+ __lis_ori [3] = ((guint32)(val)) & 0xffff; \
+ } while (0)
+
+void
+mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
+{
+ MonoJumpInfo *patch_info;
+
+ for (patch_info = ji; patch_info; patch_info = patch_info->next) {
+ unsigned char *ip = patch_info->ip.i + code;
+ const unsigned char *target;
+
+ target = mono_resolve_patch_target (method, domain, code, patch_info, run_cctors);
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_IP:
+ patch_lis_ori (ip, ip);
+ continue;
+ case MONO_PATCH_INFO_METHOD_REL:
+ g_assert_not_reached ();
+ *((gpointer *)(ip)) = code + patch_info->data.offset;
+ continue;
+ case MONO_PATCH_INFO_SWITCH: {
+ gpointer *table = (gpointer *)patch_info->data.target;
+ int i;
+
+ // FIXME: inspect code to get the register
+ ppc_load (ip, ppc_r11, patch_info->data.target);
+ //*((gconstpointer *)(ip + 2)) = patch_info->data.target;
+
+ for (i = 0; i < patch_info->table_size; i++) {
+ table [i] = (int)patch_info->data.table [i] + code;
+ }
+ /* we put into the table the absolute address, no need for ppc_patch in this case */
+ continue;
+ }
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IMAGE:
+ case MONO_PATCH_INFO_FIELD:
+ case MONO_PATCH_INFO_VTABLE:
+ case MONO_PATCH_INFO_IID:
+ case MONO_PATCH_INFO_SFLDA:
+ case MONO_PATCH_INFO_LDSTR:
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE:
+ case MONO_PATCH_INFO_LDTOKEN:
+ /* from OP_AOTCONST : lis + ori */
+ patch_lis_ori (ip, target);
+ continue;
+ case MONO_PATCH_INFO_R4:
+ case MONO_PATCH_INFO_R8:
+ g_assert_not_reached ();
+ *((gconstpointer *)(ip + 2)) = patch_info->data.target;
+ continue;
+ case MONO_PATCH_INFO_EXC_NAME:
+ g_assert_not_reached ();
+ *((gconstpointer *)(ip + 1)) = patch_info->data.name;
+ continue;
+ case MONO_PATCH_INFO_BB_OVF:
+ case MONO_PATCH_INFO_EXC_OVF:
+ /* everything is dealt with at epilog output time */
+ continue;
+ default:
+ break;
+ }
+ ppc_patch (ip, target);
+ }
+}
+
+int
+mono_arch_max_epilog_size (MonoCompile *cfg)
+{
+ int max_epilog_size = 16 + 20*4;
+ MonoJumpInfo *patch_info;
+
+ if (cfg->method->save_lmf)
+ max_epilog_size += 128;
+
+ if (mono_jit_trace_calls != NULL)
+ max_epilog_size += 50;
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ max_epilog_size += 50;
+
+ /* count the number of exception infos */
+
+ /*
+ * make sure we have enough space for exceptions
+ * 24 is the simulated call to throw_exception_by_name
+ */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_EXC)
+ max_epilog_size += 24;
+ else if (patch_info->type == MONO_PATCH_INFO_BB_OVF)
+ max_epilog_size += 12;
+ else if (patch_info->type == MONO_PATCH_INFO_EXC_OVF)
+ max_epilog_size += 12;
+ }
+
+ return max_epilog_size;
+}
+
+/*
+ * Stack frame layout:
+ *
+ * ------------------- sp
+ * MonoLMF structure or saved registers
+ * -------------------
+ * spilled regs
+ * -------------------
+ * locals
+ * -------------------
+ * optional 8 bytes for tracing
+ * -------------------
+ * param area size is cfg->param_area
+ * -------------------
+ * linkage area size is PPC_STACK_PARAM_OFFSET
+ * ------------------- sp
+ * red zone
+ */
+guint8 *
+mono_arch_emit_prolog (MonoCompile *cfg)
+{
+ MonoMethod *method = cfg->method;
+ MonoBasicBlock *bb;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ int alloc_size, pos, max_offset, i;
+ guint8 *code;
+ CallInfo *cinfo;
+ int tracing = 0;
+ int lmf_offset = 0;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ tracing = 1;
+
+ cfg->code_size = 256;
+ code = cfg->native_code = g_malloc (cfg->code_size);
+
+ if (1 || cfg->flags & MONO_CFG_HAS_CALLS) {
+ ppc_mflr (code, ppc_r0);
+ ppc_stw (code, ppc_r0, PPC_RET_ADDR_OFFSET, ppc_sp);
+ }
+ if (cfg->max_ireg >= 29)
+ cfg->used_int_regs |= USE_EXTRA_TEMPS;
+
+ alloc_size = cfg->stack_offset;
+ pos = 0;
+
+ if (!method->save_lmf) {
+ /*for (i = 31; i >= 14; --i) {
+ if (cfg->used_float_regs & (1 << i)) {
+ pos += sizeof (gdouble);
+ ppc_stfd (code, i, -pos, ppc_sp);
+ }
+ }*/
+ for (i = 31; i >= 13; --i) {
+ if (cfg->used_int_regs & (1 << i)) {
+ pos += sizeof (gulong);
+ ppc_stw (code, i, -pos, ppc_sp);
+ }
+ }
+ } else {
+ int ofs;
+ pos += sizeof (MonoLMF);
+ lmf_offset = pos;
+ ofs = -pos + G_STRUCT_OFFSET(MonoLMF, iregs);
+ ppc_stmw (code, ppc_r13, ppc_r1, ofs);
+ for (i = 14; i < 32; i++) {
+ ppc_stfd (code, i, (-pos + G_STRUCT_OFFSET(MonoLMF, fregs) + ((i-14) * sizeof (gdouble))), ppc_r1);
+ }
+ }
+ alloc_size += pos;
+ // align to PPC_STACK_ALIGNMENT bytes
+ if (alloc_size & (PPC_STACK_ALIGNMENT - 1)) {
+ alloc_size += PPC_STACK_ALIGNMENT - 1;
+ alloc_size &= ~(PPC_STACK_ALIGNMENT - 1);
+ }
+
+ cfg->stack_usage = alloc_size;
+ g_assert ((alloc_size & (PPC_STACK_ALIGNMENT-1)) == 0);
+ if (alloc_size) {
+ if (ppc_is_imm16 (-alloc_size)) {
+ ppc_stwu (code, ppc_sp, -alloc_size, ppc_sp);
+ } else {
+ ppc_load (code, ppc_r11, -alloc_size);
+ ppc_stwux (code, ppc_sp, ppc_sp, ppc_r11);
+ }
+ }
+ if (cfg->frame_reg != ppc_sp)
+ ppc_mr (code, cfg->frame_reg, ppc_sp);
+
+ /* compute max_offset in order to use short forward jumps
+ * we always do it on ppc because the immediate displacement
+ * for jumps is too small
+ */
+ max_offset = 0;
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *ins = bb->code;
+ bb->max_offset = max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE)
+ max_offset += 6;
+
+ while (ins) {
+ max_offset += ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+ ins = ins->next;
+ }
+ }
+
+ /* load arguments allocated to register from the stack */
+ sig = method->signature;
+ pos = 0;
+
+ cinfo = calculate_sizes (sig, sig->pinvoke);
+
+ if (MONO_TYPE_ISSTRUCT (sig->ret)) {
+ ArgInfo *ainfo = &cinfo->ret;
+ inst = cfg->ret;
+ if (ppc_is_imm16 (inst->inst_offset)) {
+ ppc_stw (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_stwx (code, ainfo->reg, ppc_r11, inst->inst_basereg);
+ }
+ }
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ inst = cfg->varinfo [pos];
+
+ if (cfg->verbose_level > 2)
+ g_print ("Saving argument %d (type: %d)\n", i, ainfo->regtype);
+ if (inst->opcode == OP_REGVAR) {
+ if (ainfo->regtype == RegTypeGeneral)
+ ppc_mr (code, inst->dreg, ainfo->reg);
+ else if (ainfo->regtype == RegTypeFP)
+ ppc_fmr (code, inst->dreg, ainfo->reg);
+ else if (ainfo->regtype == RegTypeBase) {
+ ppc_lwz (code, ppc_r11, 0, ppc_sp);
+ ppc_lwz (code, inst->dreg, ainfo->offset, ppc_r11);
+ } else
+ g_assert_not_reached ();
+
+ if (cfg->verbose_level > 2)
+ g_print ("Argument %d assigned to register %s\n", pos, mono_arch_regname (inst->dreg));
+ } else {
+ /* the argument should be put on the stack: FIXME handle size != word */
+ if (ainfo->regtype == RegTypeGeneral) {
+ switch (ainfo->size) {
+ case 1:
+ if (ppc_is_imm16 (inst->inst_offset)) {
+ ppc_stb (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_stbx (code, ainfo->reg, ppc_r11, inst->inst_basereg);
+ }
+ break;
+ case 2:
+ if (ppc_is_imm16 (inst->inst_offset)) {
+ ppc_sth (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_sthx (code, ainfo->reg, ppc_r11, inst->inst_basereg);
+ }
+ break;
+ case 8:
+ if (ppc_is_imm16 (inst->inst_offset + 4)) {
+ ppc_stw (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
+ ppc_stw (code, ainfo->reg + 1, inst->inst_offset + 4, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_add (code, ppc_r11, ppc_r11, inst->inst_basereg);
+ ppc_stw (code, ainfo->reg, 0, ppc_r11);
+ ppc_stw (code, ainfo->reg + 1, 4, ppc_r11);
+ }
+ break;
+ default:
+ if (ppc_is_imm16 (inst->inst_offset)) {
+ ppc_stw (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_stwx (code, ainfo->reg, ppc_r11, inst->inst_basereg);
+ }
+ break;
+ }
+ } else if (ainfo->regtype == RegTypeBase) {
+ /* load the previous stack pointer in r11 */
+ ppc_lwz (code, ppc_r11, 0, ppc_sp);
+ ppc_lwz (code, ppc_r0, ainfo->offset, ppc_r11);
+ switch (ainfo->size) {
+ case 1:
+ if (ppc_is_imm16 (inst->inst_offset)) {
+ ppc_stb (code, ppc_r0, inst->inst_offset, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_stbx (code, ppc_r0, ppc_r11, inst->inst_basereg);
+ }
+ break;
+ case 2:
+ if (ppc_is_imm16 (inst->inst_offset)) {
+ ppc_sth (code, ppc_r0, inst->inst_offset, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_sthx (code, ppc_r0, ppc_r11, inst->inst_basereg);
+ }
+ break;
+ case 8:
+ if (ppc_is_imm16 (inst->inst_offset + 4)) {
+ ppc_stw (code, ppc_r0, inst->inst_offset, inst->inst_basereg);
+ ppc_lwz (code, ppc_r0, ainfo->offset + 4, ppc_r11);
+ ppc_stw (code, ppc_r0, inst->inst_offset + 4, inst->inst_basereg);
+ } else {
+ /* FIXME */
+ g_assert_not_reached ();
+ }
+ break;
+ default:
+ if (ppc_is_imm16 (inst->inst_offset)) {
+ ppc_stw (code, ppc_r0, inst->inst_offset, inst->inst_basereg);
+ } else {
+ ppc_load (code, ppc_r11, inst->inst_offset);
+ ppc_stwx (code, ppc_r0, ppc_r11, inst->inst_basereg);
+ }
+ break;
+ }
+ } else if (ainfo->regtype == RegTypeFP) {
+ g_assert (ppc_is_imm16 (inst->inst_offset));
+ if (ainfo->size == 8)
+ ppc_stfd (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
+ else if (ainfo->size == 4)
+ ppc_stfs (code, ainfo->reg, inst->inst_offset, inst->inst_basereg);
+ else
+ g_assert_not_reached ();
+ } else if (ainfo->regtype == RegTypeStructByVal) {
+ int doffset = inst->inst_offset;
+ int soffset = 0;
+ int cur_reg;
+ int size = 0;
+ g_assert (ppc_is_imm16 (inst->inst_offset));
+ g_assert (ppc_is_imm16 (inst->inst_offset + ainfo->size * sizeof (gpointer)));
+ if (inst->inst_vtype->data.klass)
+ size = mono_class_native_size (inst->inst_vtype->data.klass, NULL);
+ for (cur_reg = 0; cur_reg < ainfo->size; ++cur_reg) {
+/*
+Darwin handles 1 and 2 byte structs specially by loading h/b into the arg
+register. Should this case include linux/ppc?
+*/
+#if __APPLE__
+ if (size == 2)
+ ppc_sth (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
+ else if (size == 1)
+ ppc_stb (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
+ else
+#endif
+ ppc_stw (code, ainfo->reg + cur_reg, doffset, inst->inst_basereg);
+ soffset += sizeof (gpointer);
+ doffset += sizeof (gpointer);
+ }
+ if (ainfo->vtsize) {
+ /* load the previous stack pointer in r11 (r0 gets overwritten by the memcpy) */
+ ppc_lwz (code, ppc_r11, 0, ppc_sp);
+ /* FIXME: handle overrun! with struct sizes not multiple of 4 */
+ code = emit_memcpy (code, ainfo->vtsize * sizeof (gpointer), inst->inst_basereg, doffset, ppc_r11, ainfo->offset + soffset);
+ }
+ } else if (ainfo->regtype == RegTypeStructByAddr) {
+ g_assert (ppc_is_imm16 (inst->inst_offset));
+ /* FIXME: handle overrun! with struct sizes not multiple of 4 */
+ code = emit_memcpy (code, ainfo->vtsize * sizeof (gpointer), inst->inst_basereg, inst->inst_offset, ainfo->reg, 0);
+ } else
+ g_assert_not_reached ();
+ }
+ pos++;
+ }
+
+ if (method->save_lmf) {
+
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_get_lmf_addr");
+ ppc_bl (code, 0);
+ /* we build the MonoLMF structure on the stack - see mini-ppc.h */
+ /* lmf_offset is the offset from the previous stack pointer,
+ * alloc_size is the total stack space allocated, so the offset
+ * of MonoLMF from the current stack ptr is alloc_size - lmf_offset.
+ * The pointer to the struct is put in ppc_r11 (new_lmf).
+ * The callee-saved registers are already in the MonoLMF structure
+ */
+ ppc_addi (code, ppc_r11, ppc_sp, alloc_size - lmf_offset);
+ /* ppc_r3 is the result from mono_get_lmf_addr () */
+ ppc_stw (code, ppc_r3, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11);
+ /* new_lmf->previous_lmf = *lmf_addr */
+ ppc_lwz (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3);
+ ppc_stw (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11);
+ /* *(lmf_addr) = r11 */
+ ppc_stw (code, ppc_r11, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3);
+ /* save method info */
+ ppc_load (code, ppc_r0, method);
+ ppc_stw (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, method), ppc_r11);
+ ppc_stw (code, ppc_sp, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r11);
+ /* save the current IP */
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_IP, NULL);
+ ppc_load (code, ppc_r0, 0x01010101);
+ ppc_stw (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, eip), ppc_r11);
+ }
+
+ if (tracing)
+ code = mono_arch_instrument_prolog (cfg, mono_trace_enter_method, code, TRUE);
+
+ cfg->code_len = code - cfg->native_code;
+ g_free (cinfo);
+
+ return code;
+}
+
+void
+mono_arch_emit_epilog (MonoCompile *cfg)
+{
+ MonoJumpInfo *patch_info;
+ MonoMethod *method = cfg->method;
+ int pos, i;
+ guint8 *code;
+
+ /*
+ * Keep in sync with CEE_JMP
+ */
+ code = cfg->native_code + cfg->code_len;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method)) {
+ code = mono_arch_instrument_epilog (cfg, mono_trace_leave_method, code, TRUE);
+ }
+ pos = 0;
+
+ if (method->save_lmf) {
+ int lmf_offset;
+ pos += sizeof (MonoLMF);
+ lmf_offset = pos;
+ /* save the frame reg in r8 */
+ ppc_mr (code, ppc_r8, cfg->frame_reg);
+ ppc_addi (code, ppc_r11, cfg->frame_reg, cfg->stack_usage - lmf_offset);
+ /* r5 = previous_lmf */
+ ppc_lwz (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11);
+ /* r6 = lmf_addr */
+ ppc_lwz (code, ppc_r6, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11);
+ /* *(lmf_addr) = previous_lmf */
+ ppc_stw (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r6);
+ /* FIXME: speedup: there is no actual need to restore the registers if
+ * we didn't actually change them (idea from Zoltan).
+ */
+ /* restore iregs */
+ ppc_lmw (code, ppc_r13, ppc_r11, G_STRUCT_OFFSET(MonoLMF, iregs));
+ /* restore fregs */
+ /*for (i = 14; i < 32; i++) {
+ ppc_lfd (code, i, G_STRUCT_OFFSET(MonoLMF, fregs) + ((i-14) * sizeof (gdouble)), ppc_r11);
+ }*/
+ g_assert (ppc_is_imm16 (cfg->stack_usage + PPC_RET_ADDR_OFFSET));
+ /* use the saved copy of the frame reg in r8 */
+ if (1 || cfg->flags & MONO_CFG_HAS_CALLS) {
+ ppc_lwz (code, ppc_r0, cfg->stack_usage + PPC_RET_ADDR_OFFSET, ppc_r8);
+ ppc_mtlr (code, ppc_r0);
+ }
+ ppc_addic (code, ppc_sp, ppc_r8, cfg->stack_usage);
+ } else {
+ if (1 || cfg->flags & MONO_CFG_HAS_CALLS) {
+ if (ppc_is_imm16 (cfg->stack_usage + PPC_RET_ADDR_OFFSET)) {
+ ppc_lwz (code, ppc_r0, cfg->stack_usage + PPC_RET_ADDR_OFFSET, cfg->frame_reg);
+ } else {
+ ppc_load (code, ppc_r11, cfg->stack_usage + PPC_RET_ADDR_OFFSET);
+ ppc_lwzx (code, ppc_r0, cfg->frame_reg, ppc_r11);
+ }
+ ppc_mtlr (code, ppc_r0);
+ }
+ if (ppc_is_imm16 (cfg->stack_usage)) {
+ ppc_addic (code, ppc_sp, cfg->frame_reg, cfg->stack_usage);
+ } else {
+ ppc_load (code, ppc_r11, cfg->stack_usage);
+ ppc_add (code, ppc_sp, cfg->frame_reg, ppc_r11);
+ }
+
+ /*for (i = 31; i >= 14; --i) {
+ if (cfg->used_float_regs & (1 << i)) {
+ pos += sizeof (double);
+ ppc_lfd (code, i, -pos, ppc_sp);
+ }
+ }*/
+ for (i = 31; i >= 13; --i) {
+ if (cfg->used_int_regs & (1 << i)) {
+ pos += sizeof (gulong);
+ ppc_lwz (code, i, -pos, ppc_sp);
+ }
+ }
+ }
+ ppc_blr (code);
+
+ /* add code to raise exceptions */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_BB_OVF: {
+ MonoOvfJump *ovfj = patch_info->data.target;
+ unsigned char *ip = patch_info->ip.i + cfg->native_code;
+ /* patch the initial jump */
+ ppc_patch (ip, code);
+ ppc_bc (code, ovfj->b0_cond, ovfj->b1_cond, 2);
+ ppc_b (code, 0);
+ ppc_patch (code - 4, ip + 4); /* jump back after the initiali branch */
+ /* jump back to the true target */
+ ppc_b (code, 0);
+ ip = ovfj->bb->native_offset + cfg->native_code;
+ ppc_patch (code - 4, ip);
+ break;
+ }
+ case MONO_PATCH_INFO_EXC_OVF: {
+ MonoOvfJump *ovfj = patch_info->data.target;
+ unsigned char *ip = patch_info->ip.i + cfg->native_code;
+ /* patch the initial jump */
+ ppc_patch (ip, code);
+ ppc_bc (code, ovfj->b0_cond, ovfj->b1_cond, 2);
+ ppc_b (code, 0);
+ ppc_patch (code - 4, ip + 4); /* jump back after the initiali branch */
+ /* jump back to the true target */
+ ppc_b (code, 0);
+ ip = (char*)ovfj->ip + 4;
+ ppc_patch (code - 4, ip);
+ break;
+ }
+ case MONO_PATCH_INFO_EXC: {
+ unsigned char *ip = patch_info->ip.i + cfg->native_code;
+ ppc_patch (ip, code);
+ /*mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC_NAME, patch_info->data.target);*/
+ ppc_load (code, ppc_r3, patch_info->data.target);
+ /* simulate a call from ip */
+ ppc_load (code, ppc_r0, ip + 4);
+ ppc_mtlr (code, ppc_r0);
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->data.name = "mono_arch_throw_exception_by_name";
+ patch_info->ip.i = code - cfg->native_code;
+ ppc_b (code, 0);
+ break;
+ }
+ default:
+ /* do nothing */
+ break;
+ }
+ }
+
+ cfg->code_len = code - cfg->native_code;
+
+ g_assert (cfg->code_len < cfg->code_size);
+
+}
+
+void
+mono_arch_setup_jit_tls_data (MonoJitTlsData *tls)
+{
+}
+
+void
+mono_arch_free_jit_tls_data (MonoJitTlsData *tls)
+{
+}
+
+void
+mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg)
+{
+ int this_dreg = ppc_r3;
+
+ if (vt_reg != -1)
+ this_dreg = ppc_r4;
+
+ /* add the this argument */
+ if (this_reg != -1) {
+ MonoInst *this;
+ MONO_INST_NEW (cfg, this, OP_SETREG);
+ this->type = this_type;
+ this->sreg1 = this_reg;
+ this->dreg = this_dreg;
+ mono_bblock_add_inst (cfg->cbb, this);
+ }
+
+ if (vt_reg != -1) {
+ MonoInst *vtarg;
+ MONO_INST_NEW (cfg, vtarg, OP_SETREG);
+ vtarg->type = STACK_MP;
+ vtarg->sreg1 = vt_reg;
+ vtarg->dreg = ppc_r3;
+ mono_bblock_add_inst (cfg->cbb, vtarg);
+ }
+}
+
+gint
+mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
+{
+ /* optional instruction, need to detect it
+ if (cmethod->klass == mono_defaults.math_class) {
+ if (strcmp (cmethod->name, "Sqrt") == 0)
+ return OP_SQRT;
+ }*/
+ return -1;
+}
+
+
+gboolean
+mono_arch_print_tree (MonoInst *tree, int arity)
+{
+ return 0;
+}
+
+MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+}
+
+MonoInst* mono_arch_get_thread_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+}
diff --git a/mono/mini/mini-ppc.h b/mono/mini/mini-ppc.h
new file mode 100644
index 00000000000..65573e5a838
--- /dev/null
+++ b/mono/mini/mini-ppc.h
@@ -0,0 +1,87 @@
+#ifndef __MONO_MINI_PPC_H__
+#define __MONO_MINI_PPC_H__
+
+#include <mono/arch/ppc/ppc-codegen.h>
+#include <glib.h>
+
+#define MONO_MAX_IREGS 32
+#define MONO_MAX_FREGS 32
+
+#define MONO_SAVED_GREGS 19
+#define MONO_SAVED_FREGS 18
+
+#define MONO_ARCH_FRAME_ALIGNMENT 4
+
+/* fixme: align to 16byte instead of 32byte (we align to 32byte to get
+ * reproduceable results for benchmarks */
+#define MONO_ARCH_CODE_ALIGNMENT 32
+
+void ppc_patch (guchar *code, guchar *target);
+
+struct MonoLMF {
+ gpointer previous_lmf;
+ gpointer lmf_addr;
+ MonoMethod *method;
+ gulong ebp;
+ gulong eip;
+ gulong iregs [MONO_SAVED_GREGS]; /* 13..31 */
+ gdouble fregs [MONO_SAVED_FREGS]; /* 14..31 */
+};
+
+/* we define our own structure and we'll copy the data
+ * from sigcontext/ucontext/mach when we need it.
+ * This also makes us save stack space and time when copying
+ * We might also want to add an additional field to propagate
+ * the original context from the signal handler.
+ */
+typedef struct {
+ gulong sc_ir; // pc
+ gulong sc_sp; // r1
+ gulong regs [MONO_SAVED_GREGS];
+ double fregs [MONO_SAVED_FREGS];
+} MonoContext;
+
+typedef struct MonoCompileArch {
+} MonoCompileArch;
+
+#define MONO_ARCH_EMULATE_FCONV_TO_I8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R4 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
+#define MONO_ARCH_EMULATE_FREM 1
+#define MONO_ARCH_BIGMUL_INTRINS 1
+
+/* deal with some of the ABI differences here */
+#ifdef __APPLE__
+#define PPC_RET_ADDR_OFFSET 8
+#define PPC_STACK_ALIGNMENT 16
+#define PPC_STACK_PARAM_OFFSET 24
+#define PPC_MINIMAL_STACK_SIZE 24
+#define PPC_FIRST_ARG_REG ppc_r3
+#define PPC_LAST_ARG_REG ppc_r10
+#define PPC_FIRST_FPARG_REG ppc_f1
+#define PPC_LAST_FPARG_REG ppc_f13
+#define PPC_PASS_STRUCTS_BY_VALUE 1
+#else
+/* Linux */
+#define PPC_RET_ADDR_OFFSET 4
+#define PPC_STACK_ALIGNMENT 16
+#define PPC_STACK_PARAM_OFFSET 8
+#define PPC_MINIMAL_STACK_SIZE 8
+#define PPC_FIRST_ARG_REG ppc_r3
+#define PPC_LAST_ARG_REG ppc_r10
+#define PPC_FIRST_FPARG_REG ppc_f1
+#define PPC_LAST_FPARG_REG ppc_f8
+/* set the next to 0 once inssel-ppc.brg is updated */
+#define PPC_PASS_STRUCTS_BY_VALUE 1
+#define PPC_SMALL_RET_STRUCT_IN_REG 1
+
+#endif
+
+#define MONO_ARCH_USE_SIGACTION 1
+#define MONO_ARCH_NEED_DIV_CHECK 1
+
+#define PPC_NUM_REG_ARGS (PPC_LAST_ARG_REG-PPC_FIRST_ARG_REG+1)
+#define PPC_NUM_REG_FPARGS (PPC_LAST_FPARG_REG-PPC_FIRST_FPARG_REG+1)
+
+#endif /* __MONO_MINI_PPC_H__ */
diff --git a/mono/mini/mini-s390.c b/mono/mini/mini-s390.c
new file mode 100644
index 00000000000..c4b1f3555c1
--- /dev/null
+++ b/mono/mini/mini-s390.c
@@ -0,0 +1,5337 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mini-s390.c */
+/* */
+/* Function - S/390 backend for the Mono code generator. */
+/* */
+/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
+/* */
+/* Date - January, 2004 */
+/* */
+/* Derivation - From mini-x86 & mini-ppc by - */
+/* Paolo Molaro (lupus@ximian.com) */
+/* Dietmar Maurer (dietmar@ximian.com) */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define NOT_IMPLEMENTED(x) \
+ g_error ("FIXME: %s is not yet implemented.", x);
+
+#define EMIT_COND_BRANCH(ins,cond) \
+{ \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (ins->inst_i0->inst_c0) { \
+ int displace; \
+ displace = ((cfg->native_code + ins->inst_i0->inst_c0) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, cond, displace); \
+ } else { \
+ s390_jcl (code, cond, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ s390_jcl (code, cond, 0); \
+ } \
+} else { \
+ if (ins->inst_true_bb->native_offset) { \
+ int displace; \
+ displace = ((cfg->native_code + \
+ ins->inst_true_bb->native_offset) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, cond, displace); \
+ } else { \
+ s390_jcl (code, cond, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_BB, ins->inst_true_bb); \
+ s390_jcl (code, cond, 0); \
+ } \
+} \
+}
+
+#define EMIT_UNCOND_BRANCH(ins) \
+{ \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (ins->inst_i0->inst_c0) { \
+ int displace; \
+ displace = ((cfg->native_code + ins->inst_i0->inst_c0) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, S390_CC_UN, displace); \
+ } else { \
+ s390_jcl (code, S390_CC_UN, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ s390_jcl (code, S390_CC_UN, 0); \
+ } \
+} else { \
+ if (ins->inst_target_bb->native_offset) { \
+ int displace; \
+ displace = ((cfg->native_code + \
+ ins->inst_target_bb->native_offset) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, S390_CC_UN, displace); \
+ } else { \
+ s390_jcl (code, S390_CC_UN, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_BB, ins->inst_target_bb); \
+ s390_jcl (code, S390_CC_UN, 0); \
+ } \
+} \
+}
+
+#define EMIT_COND_SYSTEM_EXCEPTION(cond,exc_name) \
+ do { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_EXC, exc_name); \
+ s390_jcl (code, cond, 0); \
+ } while (0);
+
+#undef DEBUG
+#define DEBUG(a) if (cfg->verbose_level > 1) a
+
+/*----------------------------------------*/
+/* use s390_r2-s390_r5 as temp registers */
+/*----------------------------------------*/
+#define S390_CALLER_REGS (0x10fc)
+#define reg_is_freeable(r) (S390_CALLER_REGS & 1 << (r))
+
+/*----------------------------------------*/
+/* use s390_f1/s390_f3-s390_f15 as temps */
+/*----------------------------------------*/
+#define S390_CALLER_FREGS (0xfffa)
+#define freg_is_freeable(r) ((r) >= 1 && (r) <= 14)
+
+#define S390_TRACE_STACK_SIZE (5*sizeof(gint32)+3*sizeof(gdouble))
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#include "mini.h"
+#include <string.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/profiler-private.h>
+#include <mono/utils/mono-math.h>
+
+#include "mini-s390.h"
+#include "inssel.h"
+#include "cpu-s390.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+typedef struct {
+ guint stack_size,
+ local_size,
+ code_size,
+ retStruct;
+} size_data;
+
+/*------------------------------------------------------------------*/
+/* Used by the instrument_emit_epilog */
+/*------------------------------------------------------------------*/
+
+enum {
+ SAVE_NONE,
+ SAVE_STRUCT,
+ SAVE_ONE,
+ SAVE_TWO,
+ SAVE_FP
+};
+
+typedef struct {
+ int born_in;
+ int killed_in;
+ int last_use;
+ int prev_use;
+} RegTrack;
+
+typedef struct InstList InstList;
+
+struct InstList {
+ InstList *prev;
+ InstList *next;
+ MonoInst *data;
+};
+
+enum {
+ RegTypeGeneral,
+ RegTypeBase,
+ RegTypeFP,
+ RegTypeStructByVal,
+ RegTypeStructByAddr
+};
+
+typedef struct {
+ gint32 offset; /* offset from caller's stack */
+ gint32 offparm; /* offset on callee's stack */
+ guint16 vtsize; /* in param area */
+ guint8 reg;
+ guint8 regtype; /* See RegType* */
+ guint32 size; /* Size of structure used by RegTypeStructByVal */
+} ArgInfo;
+
+typedef struct {
+ int nargs;
+ guint32 stack_usage;
+ guint32 struct_ret;
+ ArgInfo ret;
+ ArgInfo args [1];
+} CallInfo;
+
+typedef struct {
+ gint32 gr[5]; /* R2-R6 */
+ gdouble fp[3]; /* F0-F2 */
+} __attribute__ ((packed)) RegParm;
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* P r o t o t y p e s */
+/*------------------------------------------------------------------*/
+
+static guint32 * emit_memcpy (guint8 *, int, int, int, int, int);
+static void indent (int);
+static guint8 * restoreLMF(MonoCompile *, guint8 *);
+static guint8 * backUpStackPtr(MonoCompile *, guint8 *);
+static void decodeParm (MonoType *, void *, int);
+static void enter_method (MonoMethod *, RegParm *, char *);
+static void leave_method (MonoMethod *, ...);
+static gboolean is_regsize_var (MonoType *);
+static void add_general (guint *, size_data *, ArgInfo *, gboolean);
+static CallInfo * calculate_sizes (MonoMethodSignature *, size_data *, gboolean);
+static void peephole_pass (MonoCompile *, MonoBasicBlock *);
+static int mono_spillvar_offset (MonoCompile *, int);
+static int mono_spillvar_offset_float (MonoCompile *, int);
+static void print_ins (int, MonoInst *);
+static void print_regtrack (RegTrack *, int);
+static InstList * inst_list_prepend (MonoMemPool *, InstList *, MonoInst *);
+static int get_register_force_spilling (MonoCompile *, InstList *, MonoInst *, int);
+static int get_register_spilling (MonoCompile *, InstList *, MonoInst *, guint32, int);
+static int get_float_register_spilling (MonoCompile *, InstList *, MonoInst *, guint32, int);
+static MonoInst * create_copy_ins (MonoCompile *, int, int, MonoInst *);
+static MonoInst * create_copy_ins_float (MonoCompile *, int, int, MonoInst *);
+static MonoInst * create_spilled_store (MonoCompile *, int, int, int, MonoInst *);
+static MonoInst * create_spilled_store_float (MonoCompile *, int, int, int, MonoInst *);
+static void insert_before_ins (MonoInst *, InstList *, MonoInst *);
+static int alloc_int_reg (MonoCompile *, InstList *, MonoInst *, int, guint32);
+static guchar * emit_float_to_int (MonoCompile *, guchar *, int, int, int, gboolean);
+static unsigned char * mono_emit_stack_alloc (guchar *, MonoInst *);
+
+/*========================= End of Prototypes ======================*/
+
+/*------------------------------------------------------------------*/
+/* G l o b a l V a r i a b l e s */
+/*------------------------------------------------------------------*/
+
+int mono_exc_esp_offset = 0;
+
+static int indent_level = 0;
+
+static const char*const * ins_spec = s390;
+
+static gboolean tls_offset_inited = FALSE;
+
+/*====================== End of Global Variables ===================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_regname */
+/* */
+/* Function - Returns the name of the register specified by */
+/* the input parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+const char*
+mono_arch_regname (int reg) {
+ static const char * rnames[] = {
+ "s390_r0", "s390_sp", "s390_r2", "s390_r3", "s390_r4",
+ "s390_r5", "s390_r6", "s390_r7", "s390_r8", "s390_r9",
+ "s390_r10", "s390_r11", "s390_r12", "s390_r13", "s390_r14",
+ "s390_r15"
+ };
+ if (reg >= 0 && reg < 16)
+ return rnames [reg];
+ return "unknown";
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_memcpy */
+/* */
+/* Function - Emit code to move from memory-to-memory based on */
+/* the size of the variable. r0 is overwritten. */
+/* */
+/*------------------------------------------------------------------*/
+
+static guint32*
+emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffset)
+{
+ switch (size) {
+ case 4 :
+ s390_l (code, s390_r0, 0, sreg, soffset);
+ s390_st (code, s390_r0, 0, dreg, doffset);
+ break;
+
+ case 3 :
+ s390_icm (code, s390_r0, 14, sreg, soffset);
+ s390_stcm (code, s390_r0, 14, dreg, doffset);
+ break;
+
+ case 2 :
+ s390_lh (code, s390_r0, 0, sreg, soffset);
+ s390_sth (code, s390_r0, 0, dreg, doffset);
+ break;
+
+ case 1 :
+ s390_ic (code, s390_r0, 0, sreg, soffset);
+ s390_stc (code, s390_r0, 0, dreg, doffset);
+ break;
+
+ default :
+ while (size > 0) {
+ int len;
+
+ if (size > 256)
+ len = 256;
+ else
+ len = size;
+ s390_mvc (code, len, dreg, doffset, sreg, soffset);
+ size -= len;
+ }
+ }
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_argument_info */
+/* */
+/* Function - Gathers information on parameters such as size, */
+/* alignment, and padding. arg_info should be large */
+/* enough to hold param_count + 1 entries. */
+/* */
+/* Parameters - @csig - Method signature */
+/* @param_count - No. of parameters to consider */
+/* @arg_info - An array to store the result info */
+/* */
+/* Returns - Size of the activation frame */
+/* */
+/*------------------------------------------------------------------*/
+
+int
+mono_arch_get_argument_info (MonoMethodSignature *csig,
+ int param_count,
+ MonoJitArgumentInfo *arg_info)
+{
+ int k, frame_size = 0;
+ int size, align, pad;
+ int offset = 8;
+
+ if (MONO_TYPE_ISSTRUCT (csig->ret)) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].offset = offset;
+
+ if (csig->hasthis) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].size = frame_size;
+
+ for (k = 0; k < param_count; k++) {
+
+ if (csig->pinvoke)
+ size = mono_type_native_stack_size (csig->params [k], &align);
+ else
+ size = mono_type_stack_size (csig->params [k], &align);
+
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+ frame_size += size;
+ arg_info [k + 1].pad = 0;
+ arg_info [k + 1].size = size;
+ offset += pad;
+ arg_info [k + 1].offset = offset;
+ offset += size;
+ }
+
+ align = MONO_ARCH_FRAME_ALIGNMENT;
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+
+ return frame_size;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - restoreLMF */
+/* */
+/* Function - Restore the LMF state prior to exiting a method. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+restoreLMF(MonoCompile *cfg, guint8 *code)
+{
+ int lmfOffset = 0;
+
+ s390_lr (code, s390_r13, cfg->frame_reg);
+
+ lmfOffset = cfg->stack_usage - sizeof(MonoLMF);
+
+ /*-------------------------------------------------*/
+ /* r13 = my lmf */
+ /*-------------------------------------------------*/
+ s390_ahi (code, s390_r13, lmfOffset);
+
+ /*-------------------------------------------------*/
+ /* r6 = &jit_tls->lmf */
+ /*-------------------------------------------------*/
+ s390_l (code, s390_r6, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, lmf_addr));
+
+ /*-------------------------------------------------*/
+ /* r0 = lmf.previous_lmf */
+ /*-------------------------------------------------*/
+ s390_l (code, s390_r0, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, previous_lmf));
+
+ /*-------------------------------------------------*/
+ /* jit_tls->lmf = previous_lmf */
+ /*-------------------------------------------------*/
+ s390_l (code, s390_r13, 0, s390_r6, 0);
+ s390_st (code, s390_r0, 0, s390_r6, 0);
+ return (code);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - backStackPtr. */
+/* */
+/* Function - Restore Stack Pointer to previous frame. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+backUpStackPtr(MonoCompile *cfg, guint8 *code)
+{
+ int stackSize = cfg->stack_usage;
+
+ if (s390_is_imm16 (cfg->stack_usage)) {
+ s390_ahi (code, STK_BASE, cfg->stack_usage);
+ } else {
+ while (stackSize > 32767) {
+ s390_ahi (code, STK_BASE, 32767);
+ stackSize -= 32767;
+ }
+ s390_ahi (code, STK_BASE, stackSize);
+ }
+ return (code);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - indent */
+/* */
+/* Function - Perform nice indenting to current level */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+indent (int diff) {
+ int v;
+ if (diff < 0)
+ indent_level += diff;
+ v = indent_level;
+ printf("[%3d] ",v);
+ while (v-- > 0) {
+ printf (". ");
+ }
+ if (diff > 0)
+ indent_level += diff;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - decodeParm */
+/* */
+/* Function - Decode a parameter for the trace. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+decodeParm(MonoType *type, void *curParm, int size)
+{
+ guint32 simpleType;
+
+ if (type->byref) {
+ printf("[BYREF:%p], ", *((char **) curParm));
+ } else {
+ simpleType = type->type;
+enum_parmtype:
+ switch (simpleType) {
+ case MONO_TYPE_I :
+ printf ("[INTPTR:%p], ", *((int **) curParm));
+ break;
+ case MONO_TYPE_U :
+ printf ("[UINTPTR:%p], ", *((int **) curParm));
+ break;
+ case MONO_TYPE_BOOLEAN :
+ printf ("[BOOL:%p], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_CHAR :
+ printf ("[CHAR:%p], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_I1 :
+ printf ("[INT1:%d], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_I2 :
+ printf ("[INT2:%d], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_I4 :
+ printf ("[INT4:%d], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_U1 :
+ printf ("[UINT1:%ud], ", *((unsigned int *) curParm));
+ break;
+ case MONO_TYPE_U2 :
+ printf ("[UINT2:%ud], ", *((guint16 *) curParm));
+ break;
+ case MONO_TYPE_U4 :
+ printf ("[UINT4:%ud], ", *((guint32 *) curParm));
+ break;
+ case MONO_TYPE_U8 :
+ printf ("[UINT8:%ul], ", *((guint64 *) curParm));
+ break;
+ case MONO_TYPE_STRING : {
+ MonoString *s = *((MonoString **) curParm);
+ if (s) {
+ g_assert (((MonoObject *) s)->vtable->klass == mono_defaults.string_class);
+ printf("[STRING:%p:%s], ", s, mono_string_to_utf8(s));
+ } else {
+ printf("[STRING:null], ");
+ }
+ break;
+ }
+ case MONO_TYPE_CLASS :
+ case MONO_TYPE_OBJECT : {
+ MonoObject *obj = *((MonoObject **) curParm);
+ MonoClass *class;
+ if (obj) {
+ printf("[CLASS/OBJ:");
+ class = obj->vtable->klass;
+ if (class == mono_defaults.string_class) {
+ printf("[STRING:%p:%s]",
+ *obj, mono_string_to_utf8 (obj));
+ } else if (class == mono_defaults.int32_class) {
+ printf("[INT32:%p:%d]",
+ obj, *(gint32 *)((char *)obj + sizeof (MonoObject)));
+ } else
+ printf("[%s.%s:%p]",
+ class->name_space, class->name, obj);
+ printf("], ");
+ } else {
+ printf("[OBJECT:null], ");
+ }
+ break;
+ }
+ case MONO_TYPE_PTR :
+ printf("[PTR:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_FNPTR :
+ printf("[FNPTR:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_ARRAY :
+ printf("[ARRAY:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_SZARRAY :
+ printf("[SZARRAY:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_I8 :
+ printf("[INT8:%lld], ", *((gint64 *) (curParm)));
+ break;
+ case MONO_TYPE_R4 :
+ printf("[FLOAT4:%f], ", *((float *) (curParm)));
+ break;
+ case MONO_TYPE_R8 :
+ printf("[FLOAT8:%g], ", *((double *) (curParm)));
+ break;
+ case MONO_TYPE_VALUETYPE : {
+ int i;
+ if (type->data.klass->enumtype) {
+ simpleType = type->data.klass->enum_basetype->type;
+ printf("{VALUETYPE} - ");
+ goto enum_parmtype;
+ }
+ printf("[VALUETYPE:");
+ for (i = 0; i < size; i++)
+ printf("%02x,", *((guint8 *)curParm+i));
+ printf("]");
+ break;
+ }
+ default :
+ printf("[?? - %d], ",simpleType);
+ }
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - enter_method */
+/* */
+/* Function - Perform tracing of the entry to the current */
+/* method. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+enter_method (MonoMethod *method, RegParm *rParm, char *sp)
+{
+ int i, oParm = 0, iParm = 0;
+ MonoClass *class;
+ MonoObject *obj;
+ MonoJitArgumentInfo *arg_info;
+ MonoMethodSignature *sig;
+ char *fname;
+ guint32 ip;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+ size_data sz;
+ void *curParm;
+
+ fname = mono_method_full_name (method, TRUE);
+ indent (1);
+ printf ("ENTER: %s(", fname);
+ g_free (fname);
+
+ ip = (*(guint32 *) (sp+S390_RET_ADDR_OFFSET)) & 0x7fffffff;
+ printf (") ip: %p sp: %p - ", ip, sp);
+
+ if (rParm == NULL)
+ return;
+
+ sig = method->signature;
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ if (cinfo->struct_ret) {
+ printf ("[VALUERET:%p], ", rParm->gr[0]);
+ iParm = 1;
+ }
+
+ if (sig->hasthis) {
+ gpointer *this = (gpointer *) rParm->gr[iParm];
+ obj = (MonoObject *) this;
+ if (method->klass->valuetype) {
+ if (obj) {
+ printf("this:[value:%p:%08x], ",
+ this, *((guint32 *)(this+sizeof(MonoObject))));
+ } else
+ printf ("this:[NULL], ");
+ } else {
+ if (obj) {
+ class = obj->vtable->klass;
+ if (class == mono_defaults.string_class) {
+ printf ("this:[STRING:%p:%s], ",
+ obj, mono_string_to_utf8 ((MonoString *)obj));
+ } else {
+ printf ("this:%p[%s.%s], ",
+ obj, class->name_space, class->name);
+ }
+ } else
+ printf ("this:NULL, ");
+ }
+ oParm++;
+ }
+
+ for (i = 0; i < sig->param_count; ++i) {
+ ainfo = cinfo->args + (i + oParm);
+ switch (ainfo->regtype) {
+ case RegTypeGeneral :
+ decodeParm(sig->params[i], &(rParm->gr[ainfo->reg-2]), ainfo->size);
+ break;
+ case RegTypeFP :
+ decodeParm(sig->params[i], &(rParm->fp[ainfo->reg]), ainfo->size);
+ break;
+ case RegTypeBase :
+ decodeParm(sig->params[i], sp+ainfo->offset, ainfo->size);
+ break;
+ case RegTypeStructByVal :
+ if (ainfo->reg != STK_BASE)
+ curParm = &(rParm->gr[ainfo->reg-2]);
+ else
+ curParm = sp+ainfo->offset;
+
+ switch (ainfo->vtsize) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ decodeParm(sig->params[i],
+ curParm,
+ ainfo->size);
+ break;
+ default:
+ decodeParm(sig->params[i],
+ *((char **) curParm),
+ ainfo->vtsize);
+ }
+ break;
+ case RegTypeStructByAddr :
+ if (ainfo->reg != STK_BASE)
+ curParm = &(rParm->gr[ainfo->reg-2]);
+ else
+ curParm = sp+ainfo->offset;
+
+ decodeParm(sig->params[i],
+ *((char **) curParm),
+ ainfo->vtsize);
+ break;
+
+ default :
+ printf("???, ");
+ }
+ }
+ printf("\n");
+ g_free(cinfo);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - leave_method */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+leave_method (MonoMethod *method, ...)
+{
+ MonoType *type;
+ char *fname;
+ guint32 ip;
+ va_list ap;
+
+ va_start(ap, method);
+
+ fname = mono_method_full_name (method, TRUE);
+ indent (-1);
+ printf ("LEAVE: %s", fname);
+ g_free (fname);
+
+ type = method->signature->ret;
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN: {
+ int val = va_arg (ap, int);
+ if (val)
+ printf ("[TRUE:%d]", val);
+ else
+ printf ("[FALSE]");
+
+ break;
+ }
+ case MONO_TYPE_CHAR: {
+ int val = va_arg (ap, int);
+ printf ("[CHAR:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I1: {
+ int val = va_arg (ap, int);
+ printf ("[INT1:%d]", val);
+ break;
+ }
+ case MONO_TYPE_U1: {
+ int val = va_arg (ap, int);
+ printf ("[UINT1:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I2: {
+ int val = va_arg (ap, int);
+ printf ("[INT2:%d]", val);
+ break;
+ }
+ case MONO_TYPE_U2: {
+ int val = va_arg (ap, int);
+ printf ("[UINT2:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I4: {
+ int val = va_arg (ap, int);
+ printf ("[INT4:%d]", val);
+ break;
+ }
+ case MONO_TYPE_U4: {
+ int val = va_arg (ap, int);
+ printf ("[UINT4:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I: {
+ int *val = va_arg (ap, int*);
+ printf ("[INT:%d]", val);
+ printf("]");
+ break;
+ }
+ case MONO_TYPE_U: {
+ int *val = va_arg (ap, int*);
+ printf ("[UINT:%d]", val);
+ printf("]");
+ break;
+ }
+ case MONO_TYPE_STRING: {
+ MonoString *s = va_arg (ap, MonoString *);
+;
+ if (s) {
+ g_assert (((MonoObject *)s)->vtable->klass == mono_defaults.string_class);
+ printf ("[STRING:%p:%s]", s, mono_string_to_utf8 (s));
+ } else
+ printf ("[STRING:null], ");
+ break;
+ }
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT: {
+ MonoObject *o = va_arg (ap, MonoObject *);
+
+ if (o) {
+ if (o->vtable->klass == mono_defaults.boolean_class) {
+ printf ("[BOOLEAN:%p:%d]", o, *((guint8 *)o + sizeof (MonoObject)));
+ } else if (o->vtable->klass == mono_defaults.int32_class) {
+ printf ("[INT32:%p:%d]", o, *((gint32 *)((char *)o + sizeof (MonoObject))));
+ } else if (o->vtable->klass == mono_defaults.int64_class) {
+ printf ("[INT64:%p:%lld]", o, *((gint64 *)((char *)o + sizeof (MonoObject))));
+ } else
+ printf ("[%s.%s:%p]", o->vtable->klass->name_space, o->vtable->klass->name, o);
+ } else
+ printf ("[OBJECT:%p]", o);
+
+ break;
+ }
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY: {
+ gpointer p = va_arg (ap, gpointer);
+ printf ("[result=%p]", p);
+ break;
+ }
+ case MONO_TYPE_I8: {
+ gint64 l = va_arg (ap, gint64);
+ printf ("[LONG:%lld]", l);
+ break;
+ }
+ case MONO_TYPE_R4: {
+ double f = va_arg (ap, double);
+ printf ("[FLOAT4:%f]\n", (float) f);
+ break;
+ }
+ case MONO_TYPE_R8: {
+ double f = va_arg (ap, double);
+ printf ("[FLOAT8:%g]\n", f);
+ break;
+ }
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto handle_enum;
+ } else {
+ guint8 *p = va_arg (ap, gpointer);
+ int j, size, align;
+ size = mono_type_size (type, &align);
+ printf ("[");
+ for (j = 0; p && j < size; j++)
+ printf ("%02x,", p [j]);
+ printf ("]");
+ }
+ break;
+ default:
+ printf ("(unknown return type %x)",
+ method->signature->ret->type);
+ }
+
+ ip = ((gint32) __builtin_return_address (0)) & 0x7fffffff;
+ printf (" ip: %p\n", ip);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_cpu_init */
+/* */
+/* Function - Perform CPU specific initialization to execute */
+/* managed code. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_cpu_init (void)
+{
+ guint mode = 1;
+
+ /*--------------------------------------*/
+ /* Set default rounding mode for FP */
+ /*--------------------------------------*/
+ __asm__ ("SRNM\t%0\n\t"
+ : : "m" (mode));
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_cpu_optimizazions */
+/* */
+/* Function - Returns the optimizations supported on this CPU */
+/* */
+/*------------------------------------------------------------------*/
+
+guint32
+mono_arch_cpu_optimizazions (guint32 *exclude_mask)
+{
+ guint32 opts = 0;
+
+ /*----------------------------------------------------------*/
+ /* no s390-specific optimizations yet */
+ /*----------------------------------------------------------*/
+ *exclude_mask = MONO_OPT_INLINE|MONO_OPT_LINEARS;
+// *exclude_mask = MONO_OPT_INLINE;
+ return opts;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static gboolean
+is_regsize_var (MonoType *t) {
+ if (t->byref)
+ return TRUE;
+ switch (t->type) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ return TRUE;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return FALSE;
+ case MONO_TYPE_VALUETYPE:
+ if (t->data.klass->enumtype)
+ return is_regsize_var (t->data.klass->enum_basetype);
+ return FALSE;
+ }
+ return FALSE;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_allocatable_int_vars */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+GList *
+mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
+{
+ GList *vars = NULL;
+ int i;
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoInst *ins = cfg->varinfo [i];
+ MonoMethodVar *vmv = MONO_VARINFO (cfg, i);
+
+ /* unused vars */
+ if (vmv->range.first_use.abs_pos > vmv->range.last_use.abs_pos)
+ continue;
+
+ if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) || (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG))
+ continue;
+
+ /* we can only allocate 32 bit values */
+ if (is_regsize_var (ins->inst_vtype)) {
+ g_assert (MONO_VARINFO (cfg, i)->reg == -1);
+ g_assert (i == vmv->idx);
+ vars = mono_varlist_insert_sorted (cfg, vars, vmv, FALSE);
+ }
+ }
+
+ return vars;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_global_int_regs */
+/* */
+/* Function - Return a list of usable integer registers. */
+/* */
+/*------------------------------------------------------------------*/
+
+GList *
+mono_arch_get_global_int_regs (MonoCompile *cfg)
+{
+ GList *regs = NULL;
+ int i, top = 13;
+
+ for (i = 8; i < top; ++i) {
+ if (cfg->frame_reg != i)
+ regs = g_list_prepend (regs, GUINT_TO_POINTER (i));
+ }
+
+ return regs;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_flush_icache */
+/* */
+/* Function - Flush the CPU icache. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_flush_icache (guint8 *code, gint size)
+{
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - add_general */
+/* */
+/* Function - Determine code and stack size incremements for a */
+/* parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void inline
+add_general (guint *gr, size_data *sz, ArgInfo *ainfo, gboolean simple)
+{
+ if (simple) {
+ if (*gr > S390_LAST_ARG_REG) {
+ sz->stack_size = S390_ALIGN(sz->stack_size, sizeof(long));
+ ainfo->offset = sz->stack_size;
+ ainfo->reg = STK_BASE;
+ ainfo->regtype = RegTypeBase;
+ sz->stack_size += sizeof(int);
+ sz->code_size += 12;
+ } else {
+ ainfo->reg = *gr;
+ sz->code_size += 8;
+ }
+ } else {
+ if (*gr > S390_LAST_ARG_REG - 1) {
+ sz->stack_size = S390_ALIGN(sz->stack_size, S390_STACK_ALIGNMENT);
+ ainfo->offset = sz->stack_size;
+ ainfo->reg = STK_BASE;
+ ainfo->regtype = RegTypeBase;
+ sz->stack_size += sizeof(long long);
+ sz->code_size += 10;
+ } else {
+ ainfo->reg = *gr;
+ sz->code_size += 8;
+ }
+ (*gr) ++;
+ }
+ (*gr) ++;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - calculate_sizes */
+/* */
+/* Function - Determine the amount of space required for code */
+/* and stack. In addition determine starting points */
+/* for stack-based parameters, and area for struct- */
+/* ures being returned on the stack. */
+/* */
+/*------------------------------------------------------------------*/
+
+static CallInfo *
+calculate_sizes (MonoMethodSignature *sig, size_data *sz,
+ gboolean string_ctor)
+{
+ guint i, fr, gr, size, nWords;
+ int nParm = sig->hasthis + sig->param_count;
+ guint32 simpletype, align;
+ CallInfo *cinfo = g_malloc0 (sizeof (CallInfo) + sizeof (ArgInfo) * nParm);
+
+ fr = 0;
+ gr = s390_r2;
+ nParm = 0;
+ cinfo->struct_ret = 0;
+ sz->retStruct = 0;
+ sz->stack_size = S390_MINIMAL_STACK_SIZE;
+ sz->code_size = 0;
+ sz->local_size = 0;
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the return code/stack in case we*/
+ /* need to reserve a register to be used to address a stack */
+ /* area that the callee will use. */
+ /*----------------------------------------------------------*/
+
+// if (sig->ret->byref || string_ctor) {
+// sz->code_size += 8;
+// add_general (&gr, sz, cinfo->args+nParm, TRUE);
+// cinfo->args[nParm].size = sizeof(gpointer);
+// nParm++;
+// } else {
+ {
+ simpletype = sig->ret->type;
+enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_STRING:
+ cinfo->ret.reg = s390_r2;
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ cinfo->ret.reg = s390_f0;
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ cinfo->ret.reg = s390_r2;
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->ret->data.klass, &align);
+ cinfo->ret.reg = s390_r2;
+ cinfo->struct_ret = 1;
+ cinfo->ret.size = size;
+ cinfo->ret.vtsize = size;
+ cinfo->ret.offset = sz->stack_size;
+ sz->stack_size += S390_ALIGN(size, align);
+ gr++;
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+ }
+
+ if (sig->hasthis) {
+ add_general (&gr, sz, cinfo->args+nParm, TRUE);
+ cinfo->args[nParm].size = sizeof(gpointer);
+ nParm++;
+ }
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the parameter code and stack */
+ /* requirements by checking the types and sizes of the */
+ /* parameters. */
+ /*----------------------------------------------------------*/
+
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref) {
+ add_general (&gr, sz, cinfo->args+nParm, TRUE);
+ cinfo->args[nParm].size = sizeof(gpointer);
+ nParm++;
+ continue;
+ }
+ simpletype = sig->params [i]->type;
+ enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ cinfo->args[nParm].size = sizeof(char);
+ add_general (&gr, sz, cinfo->args+nParm, TRUE);
+ nParm++;
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ cinfo->args[nParm].size = sizeof(short);
+ add_general (&gr, sz, cinfo->args+nParm, TRUE);
+ nParm++;
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ cinfo->args[nParm].size = sizeof(int);
+ add_general (&gr, sz, cinfo->args+nParm, TRUE);
+ nParm++;
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ cinfo->args[nParm].size = sizeof(gpointer);
+ add_general (&gr, sz, cinfo->args+nParm, TRUE);
+ nParm++;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->params [i]->data.klass, &align);
+ nWords = (size + sizeof(gpointer) - 1) /
+ sizeof(gpointer);
+
+ cinfo->args[nParm].vtsize = 0;
+ cinfo->args[nParm].size = 0;
+ cinfo->args[nParm].offparm = sz->local_size;
+
+ switch (size) {
+ /*----------------------------------*/
+ /* On S/390, structures of size 1, */
+ /* 2, 4, and 8 bytes are passed in */
+ /* (a) register(s). */
+ /*----------------------------------*/
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ add_general(&gr, sz, cinfo->args+nParm, TRUE);
+ cinfo->args[nParm].size = size;
+ cinfo->args[nParm].regtype = RegTypeStructByVal;
+ nParm++;
+ sz->local_size += sizeof(long);
+ break;
+ case 8:
+ add_general(&gr, sz, cinfo->args+nParm, FALSE);
+ cinfo->args[nParm].size = sizeof(long long);
+ cinfo->args[nParm].regtype = RegTypeStructByVal;
+ nParm++;
+ sz->local_size += sizeof(long);
+ break;
+ default:
+ add_general(&gr, sz, cinfo->args+nParm, TRUE);
+ cinfo->args[nParm].size = sizeof(int);
+ cinfo->args[nParm].regtype = RegTypeStructByAddr;
+ cinfo->args[nParm].vtsize = size;
+ sz->code_size += 40;
+ sz->local_size += size;
+ if (cinfo->args[nParm].reg == STK_BASE)
+ sz->local_size += sizeof(gpointer);
+ nParm++;
+ }
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ cinfo->args[nParm].size = sizeof(long long);
+ add_general (&gr, sz, cinfo->args+nParm, FALSE);
+ nParm++;
+ break;
+ case MONO_TYPE_R4:
+ cinfo->args[nParm].size = sizeof(float);
+ if (fr <= S390_LAST_FPARG_REG) {
+ cinfo->args[nParm].regtype = RegTypeFP;
+ cinfo->args[nParm].reg = fr;
+ sz->code_size += 4;
+ fr += 2;
+ }
+ else {
+ cinfo->args[nParm].offset = sz->stack_size;
+ cinfo->args[nParm].reg = STK_BASE;
+ cinfo->args[nParm].regtype = RegTypeBase;
+ sz->code_size += 4;
+ sz->stack_size += sizeof(float);
+ }
+ nParm++;
+ break;
+ case MONO_TYPE_R8:
+ cinfo->args[nParm].size = sizeof(double);
+ if (fr <= S390_LAST_FPARG_REG) {
+ cinfo->args[nParm].regtype = RegTypeFP;
+ cinfo->args[nParm].reg = fr;
+ sz->code_size += 4;
+ fr += 2;
+ } else {
+ cinfo->args[nParm].offset = sz->stack_size;
+ cinfo->args[nParm].reg = STK_BASE;
+ cinfo->args[nParm].regtype = RegTypeBase;
+ sz->code_size += 4;
+ sz->stack_size += sizeof(double);
+ }
+ nParm++;
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+ cinfo->stack_usage = S390_ALIGN(sz->stack_size+sz->local_size,
+ S390_STACK_ALIGNMENT);
+ return (cinfo);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_allocate_vars */
+/* */
+/* Function - Set var information according to the calling */
+/* convention for S/390. The local var stuff should */
+/* most likely be split in another method. */
+/* */
+/* Parameter - @m - Compile unit. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_allocate_vars (MonoCompile *cfg)
+{
+ MonoMethodSignature *sig;
+ MonoMethodHeader *header;
+ MonoInst *inst;
+ CallInfo *cinfo;
+ size_data sz;
+ int iParm, iVar, offset, size, align, curinst;
+ int frame_reg = STK_BASE;
+ int sArg, eArg;
+
+ header = mono_method_get_header (cfg->method);
+
+ /*---------------------------------------------------------*/
+ /* We use the frame register also for any method that has */
+ /* filter clauses. This way, when the handlers are called, */
+ /* the code will reference local variables using the frame */
+ /* reg instead of the stack pointer: if we had to restore */
+ /* the stack pointer, we'd corrupt the method frames that */
+ /* are already on the stack (since filters get called */
+ /* before stack unwinding happens) when the filter code */
+ /* would call any method. */
+ /*---------------------------------------------------------*/
+ if ((cfg->flags & MONO_CFG_HAS_ALLOCA) || header->num_clauses)
+ frame_reg = s390_r11;
+
+ cfg->frame_reg = frame_reg;
+
+ if (frame_reg != STK_BASE)
+ cfg->used_int_regs |= 1 << frame_reg;
+
+ sig = cfg->method->signature;
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ if (cinfo->struct_ret) {
+ cfg->ret->opcode = OP_REGVAR;
+ cfg->ret->inst_c0 = s390_r2;
+ } else {
+ /* FIXME: handle long and FP values */
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ cfg->ret->opcode = OP_REGVAR;
+ cfg->ret->dreg = s390_r2;
+ break;
+ }
+ }
+
+ /*--------------------------------------------------------------*/
+ /* local vars are at a positive offset from the stack pointer */
+ /* */
+ /* also note that if the function uses alloca, we use s390_r11 */
+ /* to point at the local variables. */
+ /* add parameter area size for called functions */
+ /*--------------------------------------------------------------*/
+ offset = (cfg->param_area + S390_MINIMAL_STACK_SIZE);
+
+ if (cinfo->struct_ret) {
+ inst = cfg->ret;
+ offset = S390_ALIGN(offset, sizeof(gpointer));
+ inst->inst_offset = offset;
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset += sizeof(gpointer);
+ }
+
+ if (sig->hasthis) {
+ inst = cfg->varinfo [0];
+ if (inst->opcode != OP_REGVAR) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset = S390_ALIGN(offset, sizeof(gpointer));
+ inst->inst_offset = offset;
+ offset += sizeof (gpointer);
+ }
+ curinst = sArg = 1;
+ } else {
+ curinst = sArg = 0;
+ }
+
+ eArg = sig->param_count + sArg;
+
+ for (iParm = sArg; iParm < eArg; ++iParm) {
+ inst = cfg->varinfo [curinst];
+ if (inst->opcode != OP_REGVAR) {
+ switch (cinfo->args[iParm].regtype) {
+ case RegTypeStructByAddr :
+ inst->opcode = OP_S390_LOADARG;
+ inst->inst_basereg = frame_reg;
+ size = abs(cinfo->args[iParm].vtsize);
+ offset = S390_ALIGN(offset, size);
+ inst->inst_offset = offset;
+ break;
+ case RegTypeStructByVal :
+ inst->opcode = OP_S390_ARGPTR;
+ inst->inst_basereg = frame_reg;
+ size = cinfo->args[iParm].size;
+ offset = S390_ALIGN(offset, size);
+ inst->inst_offset = offset;
+ break;
+ default :
+ if (cinfo->args[iParm].reg != STK_BASE) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ size = (cinfo->args[iParm].size < 8
+ ? sizeof(long)
+ : sizeof(long long));
+ offset = S390_ALIGN(offset, size);
+ inst->inst_offset = offset;
+ } else {
+ inst->opcode = OP_S390_STKARG;
+ inst->inst_basereg = frame_reg;
+ size = (cinfo->args[iParm].size < 4
+ ? 4 - cinfo->args[iParm].size
+ : 0);
+ inst->inst_offset = cinfo->args[iParm].offset +
+ size;
+ inst->unused = 0;
+ size = sizeof(long);
+ }
+ }
+ offset += size;
+ }
+ curinst++;
+ }
+
+ curinst = cfg->locals_start;
+ for (iVar = curinst; iVar < cfg->num_varinfo; ++iVar) {
+ inst = cfg->varinfo [iVar];
+ if ((inst->flags & MONO_INST_IS_DEAD) ||
+ (inst->opcode == OP_REGVAR))
+ continue;
+
+ /*--------------------------------------------------*/
+ /* inst->unused indicates native sized value types, */
+ /* this is used by the pinvoke wrappers when they */
+ /* call functions returning structure */
+ /*--------------------------------------------------*/
+ if (inst->unused && MONO_TYPE_ISSTRUCT (inst->inst_vtype))
+ size = mono_class_native_size (inst->inst_vtype->data.klass, &align);
+ else
+ size = mono_type_size (inst->inst_vtype, &align);
+
+ offset = S390_ALIGN(offset, align);
+ inst->inst_offset = offset;
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset += size;
+ DEBUG (g_print("allocating local %d to %d\n", iVar, inst->inst_offset));
+ }
+
+ /*------------------------------------------------------*/
+ /* Allow space for the trace method stack area if needed*/
+ /*------------------------------------------------------*/
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (cfg))
+ offset += S390_TRACE_STACK_SIZE;
+
+ /*------------------------------------------------------*/
+ /* Reserve space to save LMF and caller saved registers */
+ /*------------------------------------------------------*/
+ if (cfg->method->save_lmf)
+ offset += sizeof (MonoLMF);
+
+ /*------------------------------------------------------*/
+ /* align the offset */
+ /*------------------------------------------------------*/
+ cfg->stack_offset = S390_ALIGN(offset, S390_STACK_ALIGNMENT);
+
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_call_opcode */
+/* */
+/* Function - Take the arguments and generate the arch-specific */
+/* instructions to properly call the function. This */
+/* includes pushing, moving argments to the correct */
+/* etc. */
+/* */
+/* Note - FIXME: We need an alignment solution for */
+/* enter_method and mono_arch_call_opcode, currently */
+/* alignment in mono_arch_call_opcode is computed */
+/* without arch_get_argument_info. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoCallInst*
+mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
+ MonoCallInst *call, int is_virtual) {
+ MonoInst *arg, *in;
+ MonoMethodSignature *sig;
+ int i, n, lParamArea;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+ size_data sz;
+
+ sig = call->signature;
+ n = sig->param_count + sig->hasthis;
+ DEBUG (g_print ("Call requires: %d parameters\n",n));
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ call->stack_usage = cinfo->stack_usage;
+ lParamArea = cinfo->stack_usage - S390_MINIMAL_STACK_SIZE;
+ cfg->param_area = MAX (cfg->param_area, lParamArea);
+ cfg->flags |= MONO_CFG_HAS_CALLS;
+
+ if (cinfo->struct_ret)
+ call->used_iregs |= 1 << cinfo->ret.reg;
+
+ for (i = 0; i < n; ++i) {
+ ainfo = cinfo->args + i;
+ DEBUG (g_print ("Parameter %d - Register: %d Type: %d\n",
+ i+1,ainfo->reg,ainfo->regtype));
+ if (is_virtual && i == 0) {
+ /* the argument will be attached to the call instrucion */
+ in = call->args [i];
+ call->used_iregs |= 1 << ainfo->reg;
+ } else {
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ in = call->args [i];
+ arg->cil_code = in->cil_code;
+ arg->inst_left = in;
+ arg->type = in->type;
+ /* prepend, we'll need to reverse them later */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ if (ainfo->regtype == RegTypeGeneral) {
+ arg->unused = ainfo->reg;
+ call->used_iregs |= 1 << ainfo->reg;
+ if (arg->type == STACK_I8)
+ call->used_iregs |= 1 << (ainfo->reg + 1);
+ } else if (ainfo->regtype == RegTypeStructByAddr) {
+ call->used_iregs |= 1 << ainfo->reg;
+ arg->sreg1 = ainfo->reg;
+ arg->opcode = OP_OUTARG_VT;
+ arg->unused = -ainfo->vtsize;
+ arg->inst_imm = ainfo->offset;
+ arg->sreg2 = ainfo->offparm + S390_MINIMAL_STACK_SIZE;
+ } else if (ainfo->regtype == RegTypeStructByVal) {
+ if (ainfo->reg != STK_BASE) {
+ switch (ainfo->size) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ call->used_iregs |= 1 << ainfo->reg;
+ break;
+ case 8:
+ call->used_iregs |= 1 << ainfo->reg;
+ call->used_iregs |= 1 << (ainfo->reg+1);
+ break;
+ default:
+ call->used_iregs |= 1 << ainfo->reg;
+ }
+ }
+ arg->sreg1 = ainfo->reg;
+ arg->opcode = OP_OUTARG_VT;
+ arg->unused = ainfo->size;
+ arg->inst_imm = ainfo->offset;
+ arg->sreg2 = ainfo->offparm + S390_MINIMAL_STACK_SIZE;
+ } else if (ainfo->regtype == RegTypeBase) {
+ arg->opcode = OP_OUTARG;
+ arg->unused = ainfo->reg | (ainfo->size << 8);
+ arg->inst_imm = ainfo->offset;
+ call->used_fregs |= 1 << ainfo->reg;
+ } else if (ainfo->regtype == RegTypeFP) {
+ arg->unused = ainfo->reg;
+ call->used_fregs |= 1 << ainfo->reg;
+ if (ainfo->size == 4) {
+ MonoInst *conv;
+ arg->opcode = OP_OUTARG_R4;
+ MONO_INST_NEW (cfg, conv, OP_FCONV_TO_R4);
+ conv->inst_left = arg->inst_left;
+ arg->inst_left = conv;
+ }
+ else
+ arg->opcode = OP_OUTARG_R8;
+ } else {
+ g_assert_not_reached ();
+ }
+ }
+ }
+ /*
+ * Reverse the call->out_args list.
+ */
+ {
+ MonoInst *prev = NULL, *list = call->out_args, *next;
+ while (list) {
+ next = list->next;
+ list->next = prev;
+ prev = list;
+ list = next;
+ }
+ call->out_args = prev;
+ }
+
+ g_free (cinfo);
+ return call;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_instrument_mem_needs */
+/* */
+/* Function - Allow tracing to work with this interface (with */
+/* an optional argument). */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code)
+{
+ /* no stack room needed now (may be needed for FASTCALL-trace support) */
+ *stack = 0;
+ /* split prolog-epilog requirements? */
+ *code = 50; /* max bytes needed: check this number */
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_instrument_prolog */
+/* */
+/* Function - Create an "instrumented" prolog. */
+/* */
+/*------------------------------------------------------------------*/
+
+void*
+mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p,
+ gboolean enable_arguments)
+{
+ guchar *code = p;
+ int parmOffset,
+ fpOffset;
+
+ parmOffset = cfg->stack_usage - S390_TRACE_STACK_SIZE;
+ if (cfg->method->save_lmf)
+ parmOffset -= sizeof(MonoLMF);
+ fpOffset = parmOffset + (5*sizeof(gint32));
+
+ s390_stm (code, s390_r2, s390_r6, STK_BASE, parmOffset);
+ s390_std (code, s390_f0, 0, STK_BASE, fpOffset);
+ s390_std (code, s390_f1, 0, STK_BASE, fpOffset+sizeof(gdouble));
+ s390_std (code, s390_f2, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_word (code, cfg->method);
+ s390_word (code, func);
+ s390_l (code, s390_r2, 0, s390_r13, 4);
+ s390_la (code, s390_r3, 0, STK_BASE, parmOffset);
+ s390_lr (code, s390_r4, STK_BASE);
+ s390_ahi (code, s390_r4, cfg->stack_usage);
+ s390_l (code, s390_r1, 0, s390_r13, 8);
+ s390_basr (code, s390_r14, s390_r1);
+ s390_ld (code, s390_f2, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
+ s390_ld (code, s390_f1, 0, STK_BASE, fpOffset+sizeof(gdouble));
+ s390_ld (code, s390_f0, 0, STK_BASE, fpOffset);
+ s390_lm (code, s390_r2, s390_r6, STK_BASE, parmOffset);
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_instrument_epilog */
+/* */
+/* Function - Create an epilog that will handle the returned */
+/* values used in instrumentation. */
+/* */
+/*------------------------------------------------------------------*/
+
+void*
+mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+ int save_mode = SAVE_NONE,
+ saveOffset;
+ MonoMethod *method = cfg->method;
+ int rtype = method->signature->ret->type;
+
+ saveOffset = cfg->stack_usage - S390_TRACE_STACK_SIZE;
+ if (method->save_lmf)
+ saveOffset -= sizeof(MonoLMF);
+
+handle_enum:
+ switch (rtype) {
+ case MONO_TYPE_VOID:
+ /* special case string .ctor icall */
+ if (strcmp (".ctor", method->name) && method->klass == mono_defaults.string_class)
+ save_mode = SAVE_ONE;
+ else
+ save_mode = SAVE_NONE;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ save_mode = SAVE_TWO;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ save_mode = SAVE_FP;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (method->signature->ret->data.klass->enumtype) {
+ rtype = method->signature->ret->data.klass->enum_basetype->type;
+ goto handle_enum;
+ }
+ save_mode = SAVE_STRUCT;
+ break;
+ default:
+ save_mode = SAVE_ONE;
+ break;
+ }
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ s390_stm (code, s390_r2, s390_r3, cfg->frame_reg, saveOffset);
+ if (enable_arguments) {
+ s390_lr (code, s390_r4, s390_r3);
+ s390_lr (code, s390_r3, s390_r2);
+ }
+ break;
+ case SAVE_ONE:
+ s390_st (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ if (enable_arguments) {
+ s390_lr (code, s390_r3, s390_r2);
+ }
+ break;
+ case SAVE_FP:
+ s390_std (code, s390_f0, 0, cfg->frame_reg, saveOffset);
+ if (enable_arguments) {
+ /* FIXME: what reg? */
+ s390_ldr (code, s390_f2, s390_f0);
+ s390_lm (code, s390_r3, s390_r4, cfg->frame_reg, saveOffset);
+ }
+ break;
+ case SAVE_STRUCT:
+ s390_st (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ if (enable_arguments) {
+ s390_l (code, s390_r3, 0, cfg->frame_reg,
+ S390_MINIMAL_STACK_SIZE+cfg->param_area);
+ }
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_word (code, cfg->method);
+ s390_word (code, func);
+ s390_l (code, s390_r2, 0, s390_r13, 4);
+ s390_l (code, s390_r1, 0, s390_r13, 8);
+ s390_basr (code, s390_r14, s390_r1);
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ s390_lm (code, s390_r2, s390_r3, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_ONE:
+ s390_l (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_FP:
+ s390_ld (code, s390_f0, 0, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_STRUCT:
+ s390_l (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - peephole_pass */
+/* */
+/* Function - Form a peephole pass at the code looking for */
+/* simple optimizations. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins, *last_ins = NULL;
+ ins = bb->code;
+
+ while (ins) {
+
+ switch (ins->opcode) {
+ case OP_MUL_IMM:
+ /* remove unnecessary multiplication with 1 */
+ if (ins->inst_imm == 1) {
+ if (ins->dreg != ins->sreg1) {
+ ins->opcode = OP_MOVE;
+ } else {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ }
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ /*
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG
+ || last_ins->opcode == OP_STORE_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+
+ /*
+ * Note: reg1 must be different from the basereg in the second load
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_MOVE reg1, reg2
+ */
+ } if (last_ins && (last_ins->opcode == OP_LOADI4_MEMBASE
+ || last_ins->opcode == OP_LOAD_MEMBASE) &&
+ ins->inst_basereg != last_ins->dreg &&
+ ins->inst_basereg == last_ins->inst_basereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+
+ if (ins->dreg == last_ins->dreg) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->dreg;
+ }
+
+ //g_assert_not_reached ();
+
+#if 0
+ /*
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ * -->
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_ICONST reg, imm
+ */
+ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM
+ || last_ins->opcode == OP_STORE_MEMBASE_IMM) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_ICONST;
+ ins->inst_c0 = last_ins->inst_imm;
+ g_assert_not_reached (); // check this rule
+#endif
+ }
+ break;
+ case OP_LOADU1_MEMBASE:
+ case OP_LOADI1_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI1_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case OP_LOADU2_MEMBASE:
+ case OP_LOADI2_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI2_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ /*
+ * OP_MOVE reg, reg
+ */
+ if (ins->dreg == ins->sreg1) {
+ if (last_ins)
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ /*
+ * OP_MOVE sreg, dreg
+ * OP_MOVE dreg, sreg
+ */
+ if (last_ins && last_ins->opcode == OP_MOVE &&
+ ins->sreg1 == last_ins->dreg &&
+ ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ break;
+ }
+ last_ins = ins;
+ ins = ins->next;
+ }
+ bb->last_ins = last_ins;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_spillvar_offset */
+/* */
+/* Function - Returns the offset used by spillvar. It allocates */
+/* a new spill variable if necessary. */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+mono_spillvar_offset (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ info->offset = cfg->stack_offset;
+ cfg->stack_offset += sizeof (gpointer);
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_spillvar_offset_float */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+mono_spillvar_offset_float (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info_float;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset = S390_ALIGN(cfg->stack_offset, S390_STACK_ALIGNMENT);
+ info->offset = cfg->stack_offset;
+ cfg->stack_offset += sizeof (double);
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - print_ins */
+/* */
+/* Function - Decode and print the instruction for tracing. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+print_ins (int i, MonoInst *ins)
+{
+ const char *spec = ins_spec [ins->opcode];
+ g_print ("\t%-2d %s", i, mono_inst_name (ins->opcode));
+ if (spec [MONO_INST_DEST]) {
+ if (ins->dreg >= MONO_MAX_IREGS)
+ g_print (" R%d <-", ins->dreg);
+ else
+ g_print (" %s <-", mono_arch_regname (ins->dreg));
+ }
+ if (spec [MONO_INST_SRC1]) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg1);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg1));
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg2);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg2));
+ }
+ if (spec [MONO_INST_CLOB])
+ g_print (" clobbers: %c", spec [MONO_INST_CLOB]);
+ g_print ("\n");
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - print_regtrack. */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+print_regtrack (RegTrack *t, int num)
+{
+ int i;
+ char buf [32];
+ const char *r;
+
+ for (i = 0; i < num; ++i) {
+ if (!t [i].born_in)
+ continue;
+ if (i >= MONO_MAX_IREGS) {
+ g_snprintf (buf, sizeof(buf), "R%d", i);
+ r = buf;
+ } else
+ r = mono_arch_regname (i);
+ g_print ("liveness: %s [%d - %d]\n", r, t [i].born_in, t[i].last_use);
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - inst_list_prepend */
+/* */
+/* Function - Prepend an instruction to the list. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline InstList*
+inst_list_prepend (MonoMemPool *pool, InstList *list, MonoInst *data)
+{
+ InstList *item = mono_mempool_alloc (pool, sizeof (InstList));
+ item->data = data;
+ item->prev = NULL;
+ item->next = list;
+ if (list)
+ list->prev = item;
+ return item;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_register_force_spilling */
+/* */
+/* Function - Force the spilling of the variable in the */
+/* symbolic register 'reg'. */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+get_register_force_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ sel = cfg->rs->iassign [reg];
+ i = reg;
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /*----------------------------------------------------------*/
+ /* we need to create a spill var and insert a load to sel */
+ /* after the current instruction */
+ /*----------------------------------------------------------*/
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n",
+ spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_register_spilling */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+get_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 &&
+ (reg_is_freeable (ins->sreg1) ||
+ (ins->sreg1 >= MONO_MAX_IREGS &&
+ cfg->rs->iassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 &&
+ (reg_is_freeable (ins->sreg2) ||
+ (ins->sreg2 >= MONO_MAX_IREGS &&
+ cfg->rs->iassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && reg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->iassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->isymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_float_register_spilling */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+get_float_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 &&
+ (freg_is_freeable (ins->sreg1) ||
+ (ins->sreg1 >= MONO_MAX_FREGS &&
+ cfg->rs->fassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 &&
+ (freg_is_freeable (ins->sreg2) ||
+ (ins->sreg2 >= MONO_MAX_FREGS &&
+ cfg->rs->fassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && freg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_FREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n",
+ mono_arch_regname (sel), cfg->rs->fassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->fsymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->fassign [i] = -spill - 1;
+ mono_regstate_free_float(cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOADR8_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_float (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_copy_ins */
+/* */
+/* Function - Create an instruction to copy from reg to reg. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_copy_ins (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n",
+ mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_copy_ins_float */
+/* */
+/* Function - Create an instruction to copy from float reg to */
+/* float reg. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_copy_ins_float (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_FMOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n",
+ mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_spilled_store */
+/* */
+/* Function - Spill register to storage. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_spilled_store (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORE_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE (%d at 0x%08x(%%sp)) R%d (from %s)\n",
+ spill, store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_spilled_store_float */
+/* */
+/* Function - Spill floating point register to storage. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_spilled_store_float (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORER8_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE (%d at 0x%08x(%%sp)) R%d (from %s)\n",
+ spill, store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - insert_before_ins */
+/* */
+/* Function - Insert an instruction before another. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+insert_before_ins (MonoInst *ins, InstList *item, MonoInst* to_insert)
+{
+ MonoInst *prev;
+ g_assert (item->next);
+ prev = item->next->data;
+
+ while (prev->next != ins)
+ prev = prev->next;
+ to_insert->next = ins;
+ prev->next = to_insert;
+ /*
+ * needed otherwise in the next instruction we can add an ins to the
+ * end and that would get past this instruction.
+ */
+ item->data = to_insert;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - alloc_int_reg */
+/* */
+/* Function - Allocate a general register. */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+alloc_int_reg (MonoCompile *cfg, InstList *curinst, MonoInst *ins, int sym_reg, guint32 allow_mask)
+{
+ int val = cfg->rs->iassign [sym_reg];
+ DEBUG (g_print ("Allocating a general register for %d (%d) with mask %08x\n",val,sym_reg,allow_mask));
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (cfg->rs, allow_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, curinst, ins, allow_mask, sym_reg);
+ cfg->rs->iassign [sym_reg] = val;
+ /* add option to store before the instruction for src registers */
+ if (spill)
+ create_spilled_store (cfg, spill, val, sym_reg, ins);
+ }
+ DEBUG (g_print ("Allocated %d for %d\n",val,sym_reg));
+ cfg->rs->isymbolic [val] = sym_reg;
+ return val;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_local_regalloc. */
+/* */
+/* Function - We first scan the list of instructions and we */
+/* save the liveness information of each register */
+/* (when the register is first used, when its value */
+/* is set etc.). We also reverse the list of instr- */
+/* uctions (in the InstList list) because assigning */
+/* registers backwards allows for more tricks to be */
+/* used. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoRegState *rs = cfg->rs;
+ int i, val;
+ RegTrack *reginfo, *reginfof;
+ RegTrack *reginfo1, *reginfo2, *reginfod;
+ InstList *tmp, *reversed = NULL;
+ const char *spec;
+ guint32 src1_mask, src2_mask, dest_mask;
+ guint32 cur_iregs, cur_fregs;
+
+ if (!bb->code)
+ return;
+ rs->next_vireg = bb->max_ireg;
+ rs->next_vfreg = bb->max_freg;
+ mono_regstate_assign (rs);
+ reginfo = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vireg);
+ reginfof = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vfreg);
+ rs->ifree_mask = S390_CALLER_REGS;
+ rs->ffree_mask = S390_CALLER_FREGS;
+
+ ins = bb->code;
+ i = 1;
+ DEBUG (g_print ("LOCAL regalloc: basic block: %d\n", bb->block_num));
+ /* forward pass on the instructions to collect register liveness info */
+ while (ins) {
+ spec = ins_spec [ins->opcode];
+ DEBUG (print_ins (i, ins));
+// if (spec [MONO_INST_CLOB] == 'c') {
+// MonoCallInst * call = (MonoCallInst*)ins;
+// int j;
+// }
+ if (spec [MONO_INST_SRC1]) {
+ if (spec [MONO_INST_SRC1] == 'f')
+ reginfo1 = reginfof;
+ else
+ reginfo1 = reginfo;
+ reginfo1 [ins->sreg1].prev_use = reginfo1 [ins->sreg1].last_use;
+ reginfo1 [ins->sreg1].last_use = i;
+ } else {
+ ins->sreg1 = -1;
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (spec [MONO_INST_SRC2] == 'f')
+ reginfo2 = reginfof;
+ else
+ reginfo2 = reginfo;
+ reginfo2 [ins->sreg2].prev_use = reginfo2 [ins->sreg2].last_use;
+ reginfo2 [ins->sreg2].last_use = i;
+ } else {
+ ins->sreg2 = -1;
+ }
+ if (spec [MONO_INST_DEST]) {
+ if (spec [MONO_INST_DEST] == 'f')
+ reginfod = reginfof;
+ else
+ reginfod = reginfo;
+ if (spec [MONO_INST_DEST] != 'b') /* it's not just a base register */
+ reginfod [ins->dreg].killed_in = i;
+ reginfod [ins->dreg].prev_use = reginfod [ins->dreg].last_use;
+ reginfod [ins->dreg].last_use = i;
+ if (reginfod [ins->dreg].born_in == 0 || reginfod [ins->dreg].born_in > i)
+ reginfod [ins->dreg].born_in = i;
+ if (spec [MONO_INST_DEST] == 'l') {
+ /* result in R2/R3, the virtual register is allocated sequentially */
+ reginfod [ins->dreg + 1].prev_use = reginfod [ins->dreg + 1].last_use;
+ reginfod [ins->dreg + 1].last_use = i;
+ if (reginfod [ins->dreg + 1].born_in == 0 || reginfod [ins->dreg + 1].born_in > i)
+ reginfod [ins->dreg + 1].born_in = i;
+ }
+ } else {
+ ins->dreg = -1;
+ }
+ reversed = inst_list_prepend (cfg->mempool, reversed, ins);
+ ++i;
+ ins = ins->next;
+ }
+
+ cur_iregs = S390_CALLER_REGS;
+ cur_fregs = S390_CALLER_FREGS;
+
+ DEBUG (print_regtrack (reginfo, rs->next_vireg));
+ DEBUG (print_regtrack (reginfof, rs->next_vfreg));
+ tmp = reversed;
+ while (tmp) {
+ int prev_dreg, prev_sreg1, prev_sreg2;
+ --i;
+ ins = tmp->data;
+ spec = ins_spec [ins->opcode];
+ DEBUG (g_print ("processing:"));
+ DEBUG (print_ins (i, ins));
+ /* make the register available for allocation: FIXME add fp reg */
+ if (ins->opcode == OP_SETREG || ins->opcode == OP_SETREGIMM) {
+ cur_iregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_iregs\n", ins->dreg));
+ } else if (ins->opcode == OP_SETFREG) {
+ cur_fregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_fregs\n", ins->dreg));
+ } else if (spec [MONO_INST_CLOB] == 'c') {
+ MonoCallInst *cinst = (MonoCallInst*)ins;
+ DEBUG (g_print ("excluding regs 0x%x from cur_iregs (0x%x)\n",
+ cinst->used_iregs, cur_iregs));
+ DEBUG (g_print ("excluding fpregs 0x%x from cur_fregs (0x%x)\n",
+ cinst->used_fregs, cur_fregs));
+ cur_iregs &= ~cinst->used_iregs;
+ cur_fregs &= ~cinst->used_fregs;
+ DEBUG (g_print ("available cur_iregs: 0x%x\n", cur_iregs));
+ DEBUG (g_print ("available cur_fregs: 0x%x\n", cur_fregs));
+ /*------------------------------------------------------------*/
+ /* registers used by the calling convention are excluded from */
+ /* allocation: they will be selectively enabled when they are */
+ /* assigned by the special SETREG opcodes. */
+ /*------------------------------------------------------------*/
+ }
+ dest_mask = src1_mask = src2_mask = cur_iregs;
+ /*------------------------------------------------------*/
+ /* update for use with FP regs... */
+ /*------------------------------------------------------*/
+ if (spec [MONO_INST_DEST] == 'f') {
+ dest_mask = cur_fregs;
+ if (ins->dreg >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_float (rs, dest_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->fassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n",
+ mono_arch_regname (val), ins->dreg));
+ rs->fsymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (spec [MONO_INST_CLOB] == 'c' && ins->dreg != s390_f0) {
+ /* this instruction only outputs to s390_f0, need to copy */
+ create_copy_ins_float (cfg, ins->dreg, s390_f0, ins);
+ }
+ } else {
+ prev_dreg = -1;
+ }
+ if (freg_is_freeable (ins->dreg) && prev_dreg >= 0 && (reginfof [prev_dreg].born_in >= i || !(cur_fregs & (1 << ins->dreg)))) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ }
+ } else if (ins->dreg >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d (prev: R%d)\n",
+ mono_arch_regname (val), ins->dreg, prev_dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (spec [MONO_INST_DEST] == 'l') {
+ int hreg = prev_dreg + 1;
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, hreg);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins);
+ }
+ DEBUG (g_print ("\tassigned hreg %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+ /* FIXME:? ins->dreg = val; */
+ if (ins->dreg == s390_r3) {
+ if (val != s390_r2)
+ create_copy_ins (cfg, val, s390_r2, ins);
+ } else if (ins->dreg == s390_r2) {
+ if (val == s390_r3) {
+ /* swap */
+ create_copy_ins (cfg, s390_r3, s390_r0, ins);
+ create_copy_ins (cfg, s390_r2, s390_r3, ins);
+ create_copy_ins (cfg, s390_r0, s390_r2, ins);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, ins->dreg, s390_r3, ins);
+ create_copy_ins (cfg, val, s390_r2, ins);
+ }
+ } else {
+ if (val == s390_r2) {
+ create_copy_ins (cfg, ins->dreg, s390_r2, ins);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, val, s390_r2, ins);
+ create_copy_ins (cfg, ins->dreg, s390_r3, ins);
+ }
+ }
+ if (reg_is_freeable (val) &&
+ hreg >= 0 &&
+ (reginfo [hreg].born_in >= i &&
+ !(cur_iregs & (1 << val)))) {
+ DEBUG (g_print ("\tfreeable %s (R%d)\n", mono_arch_regname (val), hreg));
+ mono_regstate_free_int (rs, val);
+ }
+ } else if (spec [MONO_INST_DEST] == 'a' && ins->dreg != s390_r2 && spec [MONO_INST_CLOB] != 'd') {
+ /* this instruction only outputs to s390_r2, need to copy */
+ create_copy_ins (cfg, ins->dreg, s390_r2, ins);
+ }
+ } else {
+ prev_dreg = -1;
+ }
+ if (spec [MONO_INST_DEST] == 'f' &&
+ freg_is_freeable (ins->dreg) &&
+ prev_dreg >= 0 && (reginfof [prev_dreg].born_in >= i)) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ } else if (spec [MONO_INST_DEST] != 'f' &&
+ reg_is_freeable (ins->dreg) &&
+ prev_dreg >= 0 && (reginfo [prev_dreg].born_in >= i)) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_int (rs, ins->dreg);
+ }
+ if (spec [MONO_INST_SRC1] == 'f') {
+ src1_mask = cur_fregs;
+ if (ins->sreg1 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_float (rs, src1_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src1_mask, ins->sreg1);
+ rs->fassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ if (spill) {
+ MonoInst *store = create_spilled_store_float (cfg, spill, val, prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->fsymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ } else if (ins->sreg1 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, src1_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins,
+ src1_mask,
+ ins->sreg1);
+ rs->iassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n",
+ mono_arch_regname (val), ins->sreg1));
+ if (spill) {
+ MonoInst *store;
+ store = create_spilled_store (cfg, spill, val,
+ prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->isymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ /*----------------------------------------------*/
+ /* handle clobbering of sreg1 */
+ /*----------------------------------------------*/
+ if ((spec [MONO_INST_CLOB] == '1' ||
+ spec [MONO_INST_CLOB] == 's') &&
+ ins->dreg != ins->sreg1) {
+ MonoInst *copy;
+ copy = create_copy_ins (cfg, ins->dreg, ins->sreg1, NULL);
+ DEBUG (g_print ("\tneed to copy sreg1 %s to dreg %s\n",
+ mono_arch_regname (ins->sreg1),
+ mono_arch_regname (ins->dreg)));
+ if (ins->sreg2 == -1 || spec [MONO_INST_CLOB] == 's') {
+ /* note: the copy is inserted before the current instruction! */
+ insert_before_ins (ins, tmp, copy);
+ /* we set sreg1 to dest as well */
+ prev_sreg1 = ins->sreg1 = ins->dreg;
+ } else {
+ /* inserted after the operation */
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ }
+
+ if (spec [MONO_INST_SRC2] == 'f') {
+ src2_mask = cur_fregs;
+ if (ins->sreg2 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_float (rs, src2_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->fassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->fsymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+ } else if (ins->sreg2 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, src2_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->iassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->isymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ int j, s;
+ guint32 clob_mask = S390_CALLER_REGS;
+ for (j = 0; j < MONO_MAX_IREGS; ++j) {
+ s = 1 << j;
+ if ((clob_mask & s) && !(rs->ifree_mask & s) && j != ins->sreg1) {
+ //g_warning ("register %s busy at call site\n", mono_arch_regname (j));
+ }
+ }
+ }
+ tmp = tmp->next;
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_float_to_int */
+/* */
+/* Function - Create instructions which will convert a floating */
+/* point value to integer. */
+/* */
+/*------------------------------------------------------------------*/
+
+static guchar*
+emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size, gboolean is_signed)
+{
+ /* sreg is a float, dreg is an integer reg. */
+ if (is_signed) {
+ s390_cfdbr (code, dreg, 5, sreg);
+ switch (size) {
+ case 1:
+ s390_lhi (code, s390_r0, 0);
+ s390_lhi (code, s390_r13, 0xff);
+ s390_ltr (code, dreg, dreg);
+ s390_jnl (code, 4);
+ s390_lhi (code, s390_r0, 0x80);
+ s390_nr (code, dreg, s390_r13);
+ s390_or (code, dreg, s390_r0);
+ break;
+ }
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 10);
+ s390_llong (code, 0x41e0000000000000);
+ s390_llong (code, 0x41f0000000000000);
+ s390_ldr (code, s390_f15, sreg);
+ s390_cdb (code, s390_f15, 0, s390_r13, 0);
+ s390_jl (code, 10);
+ s390_sdb (code, s390_f15, 0, s390_r13, 8);
+ s390_cfdbr (code, dreg, 7, s390_f15);
+ s390_j (code, 4);
+ s390_cfdbr (code, dreg, 5, sreg);
+ switch (size) {
+ case 1:
+ s390_lhi (code, s390_r0, 0xff);
+ s390_nr (code, dreg, s390_r0);
+ break;
+ case 2:
+ s390_lhi (code, s390_r0, -1);
+ s390_srl (code, s390_r0, 0, 16);
+ s390_nr (code, dreg, s390_r0);
+ break;
+ }
+ }
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_emit_stack_alloc */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static unsigned char*
+mono_emit_stack_alloc (guchar *code, MonoInst* tree)
+{
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_output_basic_block */
+/* */
+/* Function - Perform the "real" work of emitting instructions */
+/* that will do the work of in the basic block. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoCallInst *call;
+ guint offset;
+ guint8 *code = cfg->native_code + cfg->code_len;
+ MonoInst *last_ins = NULL;
+ guint last_offset = 0;
+ int max_len, cpos;
+guint8 cond;
+
+ if (cfg->opt & MONO_OPT_PEEPHOLE)
+ peephole_pass (cfg, bb);
+
+ /* we don't align basic blocks of loops on s390 */
+
+ if (cfg->verbose_level > 2)
+ g_print ("Basic block %d starting at offset 0x%x\n", bb->block_num, bb->native_offset);
+
+ cpos = bb->max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE) {
+ //MonoCoverageInfo *cov = mono_get_coverage_info (cfg->method);
+ //g_assert (!mono_compile_aot);
+ //cpos += 6;
+ //if (bb->cil_code)
+ // cov->data [bb->dfn].iloffset = bb->cil_code - cfg->cil_code;
+ /* this is not thread save, but good enough */
+ /* fixme: howto handle overflows? */
+ //x86_inc_mem (code, &cov->data [bb->dfn].count);
+ }
+
+ ins = bb->code;
+ while (ins) {
+ offset = code - cfg->native_code;
+
+ max_len = ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+
+ if (offset > (cfg->code_size - max_len - 16)) {
+ cfg->code_size *= 2;
+ cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
+ code = cfg->native_code + offset;
+ }
+
+ mono_debug_record_line_number (cfg, ins, offset);
+
+ switch (ins->opcode) {
+ case OP_STOREI1_MEMBASE_IMM: {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_stc (code, s390_r0, 0, ins->inst_destbasereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_stc (code, s390_r0, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI2_MEMBASE_IMM: {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_sth (code, s390_r0, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_sth (code, s390_r0, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STORE_MEMBASE_IMM:
+ case OP_STOREI4_MEMBASE_IMM: {
+ if (s390_is_imm16(ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_l (code, s390_r0, 0, s390_r13, 4);
+ }
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_st (code, s390_r0, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_st (code, s390_r0, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI1_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_stc (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_stc (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI2_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_sth (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_sth (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STORE_MEMBASE_REG:
+ case OP_STOREI4_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_st (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_st (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case CEE_LDIND_I:
+ case CEE_LDIND_I4:
+ case CEE_LDIND_U4: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_p0);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_l (code, ins->dreg, 0, s390_r13, 0);
+ }
+ break;
+ case OP_LOADU4_MEM:
+ g_assert_not_reached ();
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ case OP_LOADU4_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_l (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ if (s390_is_imm16(ins->inst_offset)) {
+ s390_lhi (code, s390_r13, ins->inst_offset);
+ s390_l (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_l (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ }
+ break;
+ case OP_LOADU1_MEMBASE: {
+ s390_lhi (code, s390_r0, 0);
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_ic (code, s390_r0, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ic (code, s390_r0, s390_r13, ins->inst_basereg, 0);
+ }
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_LOADI1_MEMBASE: {
+ s390_lhi (code, s390_r0, 0);
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_ic (code, s390_r0, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ic (code, s390_r0, s390_r13, ins->inst_basereg, 0);
+ }
+ s390_lhi (code, s390_r13, 0x80);
+ s390_nr (code, s390_r13, s390_r0);
+ s390_jz (code, 5);
+ s390_lhi (code, s390_r13, 0xff00);
+ s390_or (code, s390_r0, s390_r13);
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_LOADU2_MEMBASE: {
+ s390_lhi (code, s390_r0, 0);
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_icm (code, s390_r0, 3, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ar (code, s390_r13, ins->inst_basereg);
+ s390_icm (code, s390_r0, 3, s390_r13, 0);
+ }
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_LOADI2_MEMBASE: {
+ s390_lhi (code, s390_r0, 0);
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_lh (code, s390_r0, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_lh (code, s390_r0, s390_r13, ins->inst_basereg, 0);
+ }
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case CEE_CONV_I1: {
+ s390_lhi (code, s390_r0, 0x80);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_nr (code, s390_r0, ins->sreg1);
+ s390_jz (code, 7);
+ s390_lhi (code, s390_r13, -1);
+ s390_sll (code, s390_r13, 0, 8);
+ s390_or (code, ins->dreg, s390_r13);
+ }
+ break;
+ case CEE_CONV_I2: {
+ s390_lhi (code, s390_r0, 0x80);
+ s390_sll (code, s390_r0, 0, 8);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_nr (code, s390_r0, ins->sreg1);
+ s390_jz (code, 7);
+ s390_lhi (code, s390_r13, -1);
+ s390_sll (code, s390_r13, 0, 16);
+ s390_or (code, ins->dreg, s390_r13);
+ }
+ break;
+ case CEE_CONV_U1: {
+ s390_lhi (code, s390_r0, 0xff);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_nr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case CEE_CONV_U2: {
+ s390_lhi (code, s390_r0, -1);
+ s390_sll (code, s390_r0, 0, 16);
+ s390_srl (code, s390_r0, 0, 16);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_nr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_COMPARE: {
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) ||
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_clr (code, ins->sreg1, ins->sreg2);
+ else
+ s390_cr (code, ins->sreg1, ins->sreg2);
+ }
+ break;
+ case OP_COMPARE_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) ||
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_clr (code, ins->sreg1, s390_r0);
+ else
+ s390_cr (code, ins->sreg1, s390_r0);
+ }
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) &&
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_cl (code, ins->sreg1, 0, s390_r13, 4);
+ else
+ s390_c (code, ins->sreg1, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_X86_TEST_NULL: {
+ s390_ltr (code, ins->sreg1, ins->sreg1);
+ }
+ break;
+ case CEE_BREAK: {
+ s390_break (code);
+ }
+ break;
+ case OP_ADDCC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case CEE_ADD: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ar (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_ADC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alcr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_ADDCC_IMM:
+ case OP_ADD_IMM: {
+ if ((ins->next) &&
+ (ins->next->opcode == OP_ADC_IMM)) {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_al (code, ins->dreg, 0, s390_r13, 4);
+ } else {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ahi (code, ins->dreg, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_a (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ }
+ break;
+ case OP_ADC_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ s390_alcr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_alcr (code, ins->dreg, s390_r13);
+ }
+ }
+ break;
+ case CEE_ADD_OVF: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ar (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case CEE_ADD_OVF_UN: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_CY, "OverflowException");
+ }
+ break;
+ case OP_ADD_OVF_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lhi (code, s390_r0, 0);
+ s390_lr (code, s390_r1, s390_r0);
+ s390_alcr (code, s390_r0, s390_r1);
+ s390_ar (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ s390_ar (code, ins->dreg, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case OP_ADD_OVF_UN_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alcr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_CY, "OverflowException");
+ }
+ break;
+ case OP_SUBCC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case CEE_SUB: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_SBB: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slbr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_SUBCC_IMM:
+ case OP_SUB_IMM: {
+ if (s390_is_imm16 (-ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ahi (code, ins->dreg, -ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_s (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_SBB_IMM: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_sl (code, ins->dreg, 0, s390_r13, 4);
+ }
+ break;
+ case CEE_SUB_OVF: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case CEE_SUB_OVF_UN: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NC, "OverflowException");
+ }
+ break;
+ case OP_SUB_OVF_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lhi (code, s390_r0, 0);
+ s390_lr (code, s390_r1, s390_r0);
+ s390_slbr (code, s390_r0, s390_r1);
+ s390_sr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ s390_ar (code, ins->dreg, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case OP_SUB_OVF_UN_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slbr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NC, "OverflowException");
+ }
+ break;
+ case CEE_AND: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_nr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_nr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_nr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_AND_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_nr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_n (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case CEE_DIV: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case CEE_DIV_UN: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srdl (code, s390_r0, 0, 32);
+ s390_dlr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_DIV_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r13, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, s390_r13);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case CEE_REM: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r0);
+ break;
+ case CEE_REM_UN:
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srdl (code, s390_r0, 0, 32);
+ s390_dlr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_REM_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r13, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, s390_r13);
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case CEE_OR: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_or (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_or (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_or (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_OR_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_or (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_o (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case CEE_XOR: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_xr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_xr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_xr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_XOR_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_xr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_x (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case CEE_SHL: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sll (code, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case OP_SHL_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sll (code, ins->dreg, 0, (ins->inst_imm & 0x1f));
+ }
+ break;
+ case CEE_SHR: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sra (code, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case OP_SHR_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sra (code, ins->dreg, 0, (ins->inst_imm & 0x1f));
+ }
+ break;
+ case OP_SHR_UN_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srl (code, ins->dreg, 0, (ins->inst_imm & 0x1f));
+ }
+ break;
+ case CEE_SHR_UN: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srl (code, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case CEE_NOT: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lhi (code, s390_r0, -1);
+ s390_xr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case CEE_NEG: {
+ s390_lcr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case CEE_MUL: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_msr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_msr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_msr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_MUL_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r13, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_msr (code, ins->dreg, s390_r13);
+ }
+ break;
+ case CEE_MUL_OVF: {
+ short int *o[2];
+ s390_ltr (code, s390_r1, ins->sreg1);
+ s390_jz (code, 0); CODEPTR(code, o[0]);
+ s390_ltr (code, s390_r0, ins->sreg2);
+ s390_jnz (code, 6);
+ s390_lhi (code, s390_r1, 0);
+ s390_j (code, 0); CODEPTR(code, o[1]);
+ s390_xr (code, s390_r0, s390_r1);
+ s390_msr (code, s390_r1, ins->sreg2);
+ s390_xr (code, s390_r0, s390_r1);
+ s390_srl (code, s390_r0, 0, 31);
+ s390_ltr (code, s390_r0, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NZ, "OverflowException");
+ PTRSLOT (code, o[0]);
+ PTRSLOT (code, o[1]);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case CEE_MUL_OVF_UN: {
+ s390_lhi (code, s390_r0, 0);
+ s390_lr (code, s390_r1, ins->sreg1);
+ s390_mlr (code, s390_r0, ins->sreg2);
+ s390_ltr (code, s390_r0, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NZ, "OverflowException");
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_LMUL: {
+ s390_l (code, s390_r0, 0, ins->sreg1, 4);
+ s390_srda (code, s390_r0, 0, 32);
+ s390_m (code, s390_r0, 0, ins->sreg2, 4);
+ s390_l (code, s390_r0, 0, ins->sreg1, 4);
+ s390_srl (code, s390_r0, 0, 31);
+ s390_a (code, s390_r0, 0, ins->sreg1, 0);
+ s390_l (code, s390_r13, 0, ins->sreg2, 0);
+ s390_srl (code, s390_r13, 0, 31);
+ s390_ms (code, s390_r13, 0, ins->sreg1, 4);
+ s390_ar (code, s390_r0, s390_r13);
+ s390_st (code, s390_r0, 0, ins->dreg, 0);
+ s390_st (code, s390_r1, 0, ins->dreg, 4);
+ }
+ break;
+ case OP_ICONST:
+ case OP_SETREGIMM: {
+ if (s390_is_imm16(ins->inst_c0)) {
+ s390_lhi (code, ins->dreg, ins->inst_c0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_c0);
+ s390_l (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_AOTCONST: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ (MonoJumpInfoType)ins->inst_i1, ins->inst_p0);
+ s390_word (code, 0);
+ s390_l (code,ins->dreg, 0, s390_r13, 4);
+ }
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ case OP_SETREG: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ }
+ break;
+ case OP_SETLRET: {
+ int saved = ins->sreg1;
+ if (ins->sreg1 == s390_r2) {
+ s390_lr (code, s390_r0, ins->sreg1);
+ saved = s390_r0;
+ }
+ if (ins->sreg2 != s390_r2)
+ s390_lr (code, s390_r2, ins->sreg2);
+ if (saved != s390_r3)
+ s390_lr (code, s390_r3, saved);
+ break;
+ }
+ case OP_SETFREG:
+ case OP_FMOVE: {
+ if (ins->dreg != ins->sreg1) {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ }
+ }
+ break;
+ case OP_S390_SETF4RET: {
+ s390_ledbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FCONV_TO_R4: {
+ if ((ins->next) &&
+ (ins->next->opcode != OP_STORER4_MEMBASE_REG))
+ s390_ledbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case CEE_JMP: {
+ int fParm;
+ if (cfg->method->save_lmf)
+ code = restoreLMF(cfg, code);
+
+ if (cfg->flags & MONO_CFG_HAS_TAIL) {
+ s390_lm (code, s390_r2, s390_r5, STK_BASE,
+ S390_PARM_SAVE_OFFSET);
+ for (fParm = 0; fParm < 4; fParm++)
+ s390_ld (code, fParm, 0, STK_BASE,
+ S390_FLOAT_SAVE_OFFSET+fParm*sizeof(double));
+ }
+
+ code = backUpStackPtr(cfg, code);
+ s390_l (code, s390_r14, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_METHOD_JUMP,
+ ins->inst_p0);
+ s390_jcl (code, S390_CC_UN, 0);
+ }
+ break;
+ case OP_CHECK_THIS: {
+ /* ensure ins->sreg1 is not NULL */
+ s390_icm (code, s390_r0, 15, ins->sreg1, 0);
+ }
+ break;
+ case OP_ARGLIST: {
+ NOT_IMPLEMENTED("OP_ARGLIST");
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, cfg->sig_cookie);
+ s390_mvc (code, 4, ins->sreg1, 0, s390_r13, 4);
+ }
+ break;
+ case OP_FCALL: {
+ call = (MonoCallInst*)ins;
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_METHOD,
+ call->method);
+ else
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS,
+ call->fptr);
+ s390_brasl (code, s390_r14, 0);
+ if (call->signature->ret->type == MONO_TYPE_R4)
+ s390_ldebr (code, s390_f0, s390_f0);
+ }
+ break;
+ case OP_LCALL:
+ case OP_VCALL:
+ case OP_VOIDCALL:
+ case CEE_CALL: {
+ call = (MonoCallInst*)ins;
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_METHOD, call->method);
+ else
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS, call->fptr);
+ s390_brasl (code, s390_r14, 0);
+ }
+ break;
+ case OP_FCALL_REG: {
+ call = (MonoCallInst*)ins;
+ s390_lr (code, s390_r1, ins->sreg1);
+ s390_basr (code, s390_r14, s390_r1);
+ if (call->signature->ret->type == MONO_TYPE_R4)
+ s390_ldebr (code, s390_f0, s390_f0);
+ }
+ break;
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ case OP_CALL_REG: {
+ s390_lr (code, s390_r1, ins->sreg1);
+ s390_basr (code, s390_r14, s390_r1);
+ }
+ break;
+ case OP_FCALL_MEMBASE: {
+ call = (MonoCallInst*)ins;
+ s390_l (code, s390_r1, 0, ins->sreg1, ins->inst_offset);
+ s390_basr (code, s390_r14, s390_r1);
+ if (call->signature->ret->type == MONO_TYPE_R4)
+ s390_ldebr (code, s390_f0, s390_f0);
+ }
+ break;
+ case OP_LCALL_MEMBASE:
+ case OP_VCALL_MEMBASE:
+ case OP_VOIDCALL_MEMBASE:
+ case OP_CALL_MEMBASE: {
+ s390_l (code, s390_r1, 0, ins->sreg1, ins->inst_offset);
+ s390_basr (code, s390_r14, s390_r1);
+ }
+ break;
+ case OP_OUTARG:
+ g_assert_not_reached ();
+ break;
+ case OP_LOCALLOC: {
+ int alloca_skip = S390_MINIMAL_STACK_SIZE + cfg->param_area +
+ S390_STACK_ALIGNMENT - 1;
+ int area_offset = S390_ALIGN(alloca_skip, S390_STACK_ALIGNMENT);
+ s390_lr (code, s390_r1, ins->sreg1);
+ s390_ahi (code, s390_r1, 14);
+ s390_srl (code, s390_r1, 0, 3);
+ s390_sll (code, s390_r1, 0, 3);
+ s390_l (code, s390_r13, 0, STK_BASE, 0);
+ s390_lcr (code, s390_r1, s390_r1);
+ s390_la (code, STK_BASE, STK_BASE, s390_r1, 0);
+ s390_st (code, s390_r13, 0, STK_BASE, 0);
+ s390_la (code, ins->dreg, 0, STK_BASE, area_offset);
+ s390_srl (code, ins->dreg, 0, 3);
+ s390_sll (code, ins->dreg, 0, 3);
+ }
+ break;
+ case CEE_RET: {
+ s390_br (code, s390_r14);
+ }
+ break;
+ case CEE_THROW: {
+ s390_lr (code, s390_r2, ins->sreg1);
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_throw_exception");
+ s390_brasl (code, s390_r14, 0);
+ }
+ break;
+ case CEE_RETHROW: {
+ s390_lr (code, s390_r2, ins->sreg1);
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_rethrow_exception");
+ s390_brasl (code, s390_r14, 0);
+ }
+ break;
+ case OP_START_HANDLER: {
+ if (s390_is_uimm12 (ins->inst_left->inst_offset)) {
+ s390_st (code, s390_r14, 0,
+ ins->inst_left->inst_basereg,
+ ins->inst_left->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_left->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_st (code, s390_r14, s390_r13,
+ ins->inst_left->inst_basereg, 0);
+ }
+ }
+ break;
+ case OP_ENDFILTER: {
+ if (ins->sreg1 != s390_r2)
+ s390_lr (code, s390_r2, ins->sreg1);
+ if (s390_is_uimm12 (ins->inst_left->inst_offset)) {
+ s390_l (code, s390_r14, 0, ins->inst_left->inst_basereg,
+ ins->inst_left->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_left->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_l (code, s390_r14, s390_r13,
+ ins->inst_left->inst_basereg, 0);
+ }
+ s390_br (code, s390_r14);
+ }
+ break;
+ case CEE_ENDFINALLY: {
+ if (s390_is_uimm12 (ins->inst_left->inst_offset)) {
+ s390_l (code, s390_r14, 0, ins->inst_left->inst_basereg,
+ ins->inst_left->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_left->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_l (code, s390_r14, s390_r13,
+ ins->inst_left->inst_basereg, 0);
+ }
+ s390_br (code, s390_r14);
+ }
+ break;
+ case OP_CALL_HANDLER: {
+ mono_add_patch_info (cfg, code-cfg->native_code,
+ MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ s390_brasl (code, s390_r14, 0);
+ }
+ break;
+ case OP_LABEL: {
+ ins->inst_c0 = code - cfg->native_code;
+ }
+ break;
+ case CEE_BR:
+ EMIT_UNCOND_BRANCH(ins);
+ break;
+ case OP_BR_REG: {
+ s390_br (code, ins->sreg1);
+ }
+ break;
+ case OP_CEQ: {
+ s390_lhi (code, ins->dreg, 1);
+ s390_jz (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_CLT: {
+ s390_lhi (code, ins->dreg, 1);
+ s390_jl (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_CLT_UN: {
+ s390_lhi (code, ins->dreg, 1);
+ s390_jlo (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_CGT: {
+ s390_lhi (code, ins->dreg, 1);
+ s390_jh (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_CGT_UN: {
+ s390_lhi (code, ins->dreg, 1);
+ s390_jho (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_COND_EXC_EQ:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_EQ, ins->inst_p1);
+ break;
+ case OP_COND_EXC_NE_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NE, ins->inst_p1);
+ break;
+ case OP_COND_EXC_LT:
+ case OP_COND_EXC_LT_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_LT, ins->inst_p1);
+ break;
+ case OP_COND_EXC_GT:
+ case OP_COND_EXC_GT_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_GT, ins->inst_p1);
+ break;
+ case OP_COND_EXC_GE:
+ case OP_COND_EXC_GE_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_GE, ins->inst_p1);
+ break;
+ case OP_COND_EXC_LE:
+ case OP_COND_EXC_LE_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_LE, ins->inst_p1);
+ break;
+ case OP_COND_EXC_OV:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, ins->inst_p1);
+ break;
+ case OP_COND_EXC_NO:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NO, ins->inst_p1);
+ break;
+ case OP_COND_EXC_C:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_CY, ins->inst_p1);
+ break;
+ case OP_COND_EXC_NC:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NC, ins->inst_p1);
+ break;
+ case CEE_BEQ:
+ EMIT_COND_BRANCH (ins, S390_CC_EQ);
+ break;
+ case CEE_BNE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_NE);
+ break;
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LT);
+ break;
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GT);
+ break;
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GE);
+ break;
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LE);
+ break;
+
+ /* floating point opcodes */
+ case OP_R8CONST: {
+ if (*((float *) ins->inst_p0) == 0) {
+ s390_lzdr (code, ins->dreg);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_p0);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ld (code, ins->dreg, 0, s390_r13, 0);
+ }
+ }
+ break;
+ case OP_R4CONST: {
+ if (*((float *) ins->inst_p0) == 0) {
+ s390_lzdr (code, ins->dreg);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_p0);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ldeb (code, ins->dreg, 0, s390_r13, 0);
+ }
+ }
+ break;
+ case OP_STORER8_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_std (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_std (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_LOADR8_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_ld (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ld (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case OP_STORER4_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_ledbr(code, s390_f15, ins->sreg1);
+ s390_ste (code, s390_f15, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ledbr(code, s390_f15, ins->sreg1);
+ s390_ste (code, s390_f15, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_LOADR4_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_ldeb (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_ldeb (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case CEE_CONV_R_UN: {
+ s390_cdfbr (code, ins->dreg, ins->sreg1);
+ s390_ltr (code, ins->sreg1, ins->sreg1);
+ s390_jnl (code, 12);
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_word (code, 0x41f00000);
+ s390_word (code, 0);
+ s390_adb (code, ins->dreg, 0, s390_r13, 4);
+ }
+ break;
+ case CEE_CONV_R4: {
+ s390_cdfbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case CEE_CONV_R8: {
+ s390_cdfbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FCONV_TO_I1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, TRUE);
+ break;
+ case OP_FCONV_TO_U1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, FALSE);
+ break;
+ case OP_FCONV_TO_I2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, TRUE);
+ break;
+ case OP_FCONV_TO_U2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, FALSE);
+ break;
+ case OP_FCONV_TO_I4:
+ case OP_FCONV_TO_I:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
+ break;
+ case OP_FCONV_TO_U4:
+ case OP_FCONV_TO_U:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE);
+ break;
+ case OP_FCONV_TO_I8:
+ case OP_FCONV_TO_U8:
+ g_assert_not_reached ();
+ /* Implemented as helper calls */
+ break;
+ case OP_LCONV_TO_R_UN:
+ g_assert_not_reached ();
+ /* Implemented as helper calls */
+ break;
+ case OP_LCONV_TO_OVF_I: {
+ /* Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000 */
+ short int *o[5];
+ s390_ltr (code, ins->sreg2, ins->sreg2);
+ s390_jnl (code, 0); CODEPTR(code, o[0]);
+ s390_ltr (code, ins->sreg1, ins->sreg1);
+ s390_jnl (code, 0); CODEPTR(code, o[1]);
+ s390_lhi (code, s390_r13, -1);
+ s390_cr (code, ins->sreg1, s390_r13);
+ s390_jnz (code, 0); CODEPTR(code, o[2]);
+ if (ins->dreg != ins->sreg2)
+ s390_lr (code, ins->dreg, ins->sreg2);
+ s390_j (code, 0); CODEPTR(code, o[3]);
+ PTRSLOT(code, o[0]);
+ s390_jz (code, 0); CODEPTR(code, o[4]);
+ PTRSLOT(code, o[1]);
+ PTRSLOT(code, o[2]);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_EXC, "OverflowException");
+ s390_brasl (code, s390_r14, 0);
+ PTRSLOT(code, o[3]);
+ PTRSLOT(code, o[4]);
+ }
+ break;
+ case OP_SQRT: {
+ s390_sqdbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FADD: {
+ if (ins->dreg == ins->sreg1)
+ s390_adbr (code, ins->dreg, ins->sreg2);
+ else {
+ if (ins->dreg == ins->sreg2)
+ s390_adbr (code, ins->dreg, ins->sreg1);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_adbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_FSUB: {
+ if (ins->dreg == ins->sreg1)
+ s390_sdbr (code, ins->dreg, ins->sreg2);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_sdbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ break;
+ case OP_FMUL: {
+ if (ins->dreg == ins->sreg1)
+ s390_mdbr (code, ins->dreg, ins->sreg2);
+ else {
+ if (ins->dreg == ins->sreg2)
+ s390_mdbr (code, ins->dreg, ins->sreg1);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_mdbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_FDIV: {
+ if (ins->dreg == ins->sreg1)
+ s390_ddbr (code, ins->dreg, ins->sreg2);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_ddbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ break;
+ case OP_FNEG: {
+ s390_lcdbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FREM: {
+ if (ins->dreg != ins->sreg1) {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ }
+ s390_didbr (code, ins->dreg, ins->sreg2, 5, s390_f15);
+ }
+ break;
+ case OP_FCOMPARE: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ }
+ break;
+ case OP_FCEQ: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lhi (code, ins->dreg, 1);
+ s390_je (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCLT: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lhi (code, ins->dreg, 1);
+ s390_jl (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCLT_UN: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lhi (code, ins->dreg, 1);
+ s390_jlo (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCGT: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lhi (code, ins->dreg, 1);
+ s390_jh (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCGT_UN: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lhi (code, ins->dreg, 1);
+ s390_jho (code, 4);
+ s390_lhi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FBEQ:
+ EMIT_COND_BRANCH (ins, S390_CC_EQ|S390_CC_OV);
+ break;
+ case OP_FBNE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_NE|S390_CC_OV);
+ break;
+ case OP_FBLT:
+ EMIT_COND_BRANCH (ins, S390_CC_LT);
+ break;
+ case OP_FBLT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LT|S390_CC_OV);
+ break;
+ case OP_FBGT:
+ EMIT_COND_BRANCH (ins, S390_CC_GT);
+ break;
+ case OP_FBGT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GT|S390_CC_OV);
+ break;
+ case OP_FBGE:
+ EMIT_COND_BRANCH (ins, S390_CC_GE);
+ break;
+ case OP_FBGE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GE|S390_CC_OV);
+ break;
+ case OP_FBLE:
+ EMIT_COND_BRANCH (ins, S390_CC_LE);
+ break;
+ case OP_FBLE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LE|S390_CC_OV);
+ break;
+ case CEE_CKFINITE: {
+ short *o;
+ s390_lhi (code, s390_r13, 0x7f);
+ s390_tcdb (code, ins->sreg1, 0, s390_r13, 0);
+ s390_jz (code, 0); CODEPTR(code, o);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_EXC, "ArithmeticException");
+ s390_brasl (code, s390_r14,0);
+ PTRSLOT(code, o);
+ }
+ break;
+ case OP_S390_MOVE: {
+ if (ins->unused > 0) {
+ if (ins->unused <= 256) {
+ s390_mvc (code, ins->unused, ins->dreg,
+ ins->inst_offset, ins->sreg1, ins->inst_imm);
+ } else {
+ s390_lr (code, s390_r0, ins->dreg);
+ if (s390_is_imm16 (ins->inst_offset)) {
+ s390_ahi (code, s390_r0, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_offset);
+ s390_a (code, s390_r0, 0, s390_r13, 4);
+ }
+ s390_lr (code, s390_r14, s390_r12);
+ s390_lr (code, s390_r12, ins->sreg1);
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_ahi (code, s390_r12, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_a (code, s390_r12, 0, s390_r13, 4);
+ }
+ s390_lr (code, s390_r1, ins->sreg1);
+ s390_lr (code, s390_r13, s390_r1);
+ s390_mvcle(code, s390_r0, s390_r12, 0, 0);
+ s390_jo (code, -2);
+ s390_lr (code, s390_r12, s390_r14);
+ }
+ }
+ }
+ break;
+ default:
+ g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
+ g_assert_not_reached ();
+ }
+
+ if ((cfg->opt & MONO_OPT_BRANCH) && ((code - cfg->native_code - offset) > max_len)) {
+ g_warning ("wrong maximal instruction length of instruction %s (expected %d, got %d)",
+ mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset);
+ g_assert_not_reached ();
+ }
+
+ cpos += max_len;
+
+ last_ins = ins;
+ last_offset = offset;
+
+ ins = ins->next;
+ }
+
+ cfg->code_len = code - cfg->native_code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_register_lowlevel_calls */
+/* */
+/* Function - Register routines to help with --trace operation. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_register_lowlevel_calls (void)
+{
+ mono_register_jit_icall (enter_method, "mono_enter_method", NULL, TRUE);
+ mono_register_jit_icall (leave_method, "mono_leave_method", NULL, TRUE);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_patch_code */
+/* */
+/* Function - Process the patch data created during the */
+/* instruction build process. This resolves jumps, */
+/* calls, variables etc. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
+{
+ MonoJumpInfo *patch_info;
+
+ for (patch_info = ji; patch_info; patch_info = patch_info->next) {
+ unsigned char *ip = patch_info->ip.i + code;
+ gint32 target = 0;
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_BB:
+ target = S390_RELATIVE((patch_info->data.bb->native_offset+code),
+ ip);
+ ip += 2; /* Skip over op-code */
+ break;
+ case MONO_PATCH_INFO_ABS:
+ target = S390_RELATIVE(patch_info->data.target, ip);
+ ip += 2; /* Skip over op-code */
+ break;
+ case MONO_PATCH_INFO_LABEL:
+ target = S390_RELATIVE((patch_info->data.inst->inst_c0+code),ip);
+ ip += 2; /* Skip over op-code */
+ break;
+ case MONO_PATCH_INFO_IP:
+ target = ip;
+ continue;
+ case MONO_PATCH_INFO_METHOD_REL:
+ g_assert_not_reached ();
+ *((gpointer *)(ip)) = code + patch_info->data.offset;
+ continue;
+ case MONO_PATCH_INFO_INTERNAL_METHOD: {
+ MonoJitICallInfo *mi = mono_find_jit_icall_by_name (patch_info->data.name);
+ if (!mi) {
+ g_warning ("unknown MONO_PATCH_INFO_INTERNAL_METHOD %s", patch_info->data.name);
+ g_assert_not_reached ();
+ }
+ target = S390_RELATIVE(mono_icall_get_wrapper (mi), ip);
+ ip += 2; /* Skip over op-code */
+ break;
+ }
+ case MONO_PATCH_INFO_METHOD_JUMP: {
+ GSList *list;
+
+ /*------------------------------------------------------*/
+ /* get the trampoline to the method from the domain */
+ /*------------------------------------------------------*/
+ target = mono_create_jump_trampoline (domain,
+ patch_info->data.method,
+ TRUE);
+ target = S390_RELATIVE(target, ip);
+ if (!domain->jump_target_hash)
+ domain->jump_target_hash = g_hash_table_new (NULL, NULL);
+ list = g_hash_table_lookup (domain->jump_target_hash,
+ patch_info->data.method);
+ list = g_slist_prepend (list, ip);
+ g_hash_table_insert (domain->jump_target_hash,
+ patch_info->data.method, list);
+ ip +=2;
+ break;
+ }
+ case MONO_PATCH_INFO_METHOD:
+ if (patch_info->data.method == method) {
+ target = S390_RELATIVE(code, ip);
+ } else {
+ /* get the trampoline to the method from the domain */
+ target = S390_RELATIVE(mono_arch_create_jit_trampoline (patch_info->data.method), ip);
+ target = mono_arch_create_jit_trampoline(patch_info->data.method);
+ target = S390_RELATIVE(target, ip);
+ }
+ ip += 2; /* Skip over op-code */
+ break;
+ case MONO_PATCH_INFO_SWITCH: {
+ gpointer *table = (gpointer *)patch_info->data.target;
+ int i;
+ /*------------------------------------------------------*/
+ /* ip is pointing at the basr r13,0/j +4 instruction */
+ /* the vtable value follows this (i.e. ip+6) */
+ /*------------------------------------------------------*/
+ *((gconstpointer *)(ip+6)) = table;
+
+ for (i = 0; i < patch_info->table_size; i++) {
+ table [i] = (int)patch_info->data.table [i] + code;
+ }
+ continue;
+ }
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IMAGE:
+ case MONO_PATCH_INFO_FIELD:
+ target = S390_RELATIVE(patch_info->data.target, ip);
+ continue;
+ case MONO_PATCH_INFO_R4:
+ case MONO_PATCH_INFO_R8:
+ g_assert_not_reached ();
+ *((gconstpointer *)(ip + 2)) = patch_info->data.target;
+ continue;
+ case MONO_PATCH_INFO_IID:
+ mono_class_init (patch_info->data.klass);
+ target = S390_RELATIVE(patch_info->data.klass->interface_id, ip);
+ continue;
+ case MONO_PATCH_INFO_VTABLE:
+ target = S390_RELATIVE(mono_class_vtable (domain, patch_info->data.klass),ip);
+ ip += 2;
+ continue;
+ case MONO_PATCH_INFO_CLASS_INIT:
+ target = S390_RELATIVE(mono_create_class_init_trampoline (mono_class_vtable (domain, patch_info->data.klass)), ip);
+ ip += 2;
+ break;
+ case MONO_PATCH_INFO_SFLDA: {
+ MonoVTable *vtable = mono_class_vtable (domain, patch_info->data.field->parent);
+ if (!vtable->initialized && !(vtable->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) && mono_class_needs_cctor_run (vtable->klass, method))
+ /* Done by the generated code */
+ ;
+ else {
+ if (run_cctors)
+ mono_runtime_class_init (vtable);
+ }
+ target = S390_RELATIVE((char*)vtable->data + patch_info->data.field->offset, ip);
+ ip += 2;
+ continue;
+ }
+ case MONO_PATCH_INFO_EXC_NAME:
+ *((gconstpointer *)(ip)) = patch_info->data.name;
+ continue;
+ case MONO_PATCH_INFO_LDSTR:
+ target = mono_ldstr (domain, patch_info->data.token->image,
+ mono_metadata_token_index (patch_info->data.token->token));
+ continue;
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE: {
+ gpointer handle;
+ MonoClass *handle_class;
+
+ handle = mono_ldtoken (patch_info->data.token->image,
+ patch_info->data.token->token,
+ &handle_class, NULL);
+ mono_class_init (handle_class);
+ mono_class_init (mono_class_from_mono_type (handle));
+
+ target = handle;
+ continue;
+ }
+ case MONO_PATCH_INFO_LDTOKEN: {
+ gpointer handle;
+ MonoClass *handle_class;
+
+ handle = mono_ldtoken (patch_info->data.token->image,
+ patch_info->data.token->token,
+ &handle_class, NULL);
+ mono_class_init (handle_class);
+
+ target = handle;
+ continue;
+ }
+ case MONO_PATCH_INFO_EXC:
+ /* everything is dealt with at epilog output time */
+ continue;
+ default:
+ g_assert_not_reached ();
+ }
+ s390_patch (ip, target);
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_max_epilog_size */
+/* */
+/* Function - Determine the maximum size of the epilog code. */
+/* */
+/*------------------------------------------------------------------*/
+
+int
+mono_arch_max_epilog_size (MonoCompile *cfg)
+{
+ int max_epilog_size = 96;
+ MonoJumpInfo *patch_info;
+
+ if (cfg->method->save_lmf)
+ max_epilog_size += 128;
+
+ if (mono_jit_trace_calls != NULL)
+ max_epilog_size += 128;
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ max_epilog_size += 128;
+
+ /* count the number of exception infos */
+
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_EXC)
+ max_epilog_size += 26;
+ }
+
+ return max_epilog_size;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_emit_prolog */
+/* */
+/* Function - Create the instruction sequence for a function */
+/* prolog. */
+/* */
+/*------------------------------------------------------------------*/
+
+guint8 *
+mono_arch_emit_prolog (MonoCompile *cfg)
+{
+ MonoMethod *method = cfg->method;
+ MonoBasicBlock *bb;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ int alloc_size, pos, max_offset, i, lmfOffset;
+ guint8 *code;
+ CallInfo *cinfo;
+ size_data sz;
+ int tracing = 0;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ tracing = 1;
+
+ cfg->code_size = 512;
+ cfg->native_code = code = g_malloc (cfg->code_size);
+
+ if (cfg->flags & MONO_CFG_HAS_TAIL) {
+ s390_stm (code, s390_r2, s390_r14, STK_BASE, S390_PARM_SAVE_OFFSET);
+ for (pos = 0; pos < 4; pos++)
+ s390_std (code, pos, 0, STK_BASE,
+ S390_FLOAT_SAVE_OFFSET+pos*sizeof(double));
+ } else {
+ s390_stm (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ }
+
+ if (cfg->flags & MONO_CFG_HAS_ALLOCA) {
+ cfg->used_int_regs |= 1 << 11;
+ }
+
+ alloc_size = cfg->stack_offset;
+
+ cfg->stack_usage = alloc_size;
+ s390_lr (code, s390_r11, STK_BASE);
+ if (s390_is_imm16 (-alloc_size)) {
+ s390_ahi (code, STK_BASE, -alloc_size);
+ } else {
+ int stackSize = alloc_size;
+ while (stackSize > 32767) {
+ s390_ahi (code, STK_BASE, -32767);
+ stackSize -= 32767;
+ }
+ s390_ahi (code, STK_BASE, -stackSize);
+ }
+ s390_st (code, s390_r11, 0, STK_BASE, 0);
+
+ if (cfg->frame_reg != STK_BASE)
+ s390_lr (code, s390_r11, STK_BASE);
+
+ /* compute max_offset in order to use short forward jumps
+ * we always do it on s390 because the immediate displacement
+ * for jumps is too small
+ */
+ max_offset = 0;
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *ins = bb->code;
+ bb->max_offset = max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE)
+ max_offset += 6;
+
+ while (ins) {
+ max_offset += ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+ ins = ins->next;
+ }
+ }
+
+ /* load arguments allocated to register from the stack */
+ sig = method->signature;
+ pos = 0;
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ if (cinfo->struct_ret) {
+ ArgInfo *ainfo = &cinfo->ret;
+ inst = cfg->ret;
+ inst->unused = ainfo->vtsize;
+ s390_st (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ }
+
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ inst = cfg->varinfo [pos];
+
+ if (inst->opcode == OP_REGVAR) {
+ if (ainfo->regtype == RegTypeGeneral)
+ s390_lr (code, inst->dreg, ainfo->reg);
+ else if (ainfo->regtype == RegTypeFP) {
+ if (inst->dreg != ainfo->reg) {
+ if (ainfo->size == 4) {
+ s390_ledbr (code, inst->dreg, ainfo->reg);
+ } else {
+ s390_ldr (code, inst->dreg, ainfo->reg);
+ }
+ }
+ }
+ else if (ainfo->regtype == RegTypeBase) {
+ s390_lr (code, s390_r13, STK_BASE);
+ s390_ahi (code, s390_r13, alloc_size);
+ s390_l (code, inst->dreg, 0, s390_r13, ainfo->offset);
+ } else
+ g_assert_not_reached ();
+
+ if (cfg->verbose_level > 2)
+ g_print ("Argument %d assigned to register %s\n",
+ pos, mono_arch_regname (inst->dreg));
+ } else {
+ if (ainfo->regtype == RegTypeGeneral) {
+ if (!((ainfo->reg >= 2) && (ainfo->reg <= 6)))
+ g_assert_not_reached();
+ switch (ainfo->size) {
+ case 1:
+ s390_stc (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ break;
+ case 2:
+ s390_sth (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ break;
+ case 8:
+ s390_stm (code, ainfo->reg, ainfo->reg + 1,
+ inst->inst_basereg, inst->inst_offset);
+ break;
+ default:
+ s390_st (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ }
+ } else if (ainfo->regtype == RegTypeBase) {
+ } else if (ainfo->regtype == RegTypeFP) {
+ if (ainfo->size == 8)
+ s390_std (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ else if (ainfo->size == 4)
+ s390_ste (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ else
+ g_assert_not_reached ();
+ } else if (ainfo->regtype == RegTypeStructByVal) {
+ int doffset = inst->inst_offset;
+ int reg;
+ if (ainfo->reg != STK_BASE)
+ reg = ainfo->reg;
+ else {
+ reg = s390_r0;
+ s390_lr (code, s390_r13, STK_BASE);
+ s390_ahi (code, s390_r13, alloc_size);
+ }
+ switch (ainfo->size) {
+ case 1:
+ if (ainfo->reg == STK_BASE)
+ s390_ic (code, reg, 0, s390_r13, ainfo->offset+3);
+ s390_stc (code, reg, 0, inst->inst_basereg, doffset);
+ break;
+ case 2:
+ if (ainfo->reg == STK_BASE)
+ s390_lh (code, reg, 0, s390_r13, ainfo->offset+2);
+ s390_sth (code, reg, 0, inst->inst_basereg, doffset);
+ break;
+ case 4:
+ if (ainfo->reg == STK_BASE)
+ s390_l (code, reg, 0, s390_r13, ainfo->offset);
+ s390_st (code, reg, 0, inst->inst_basereg, doffset);
+ break;
+ case 8:
+ if (ainfo->reg == STK_BASE)
+ s390_lm (code, s390_r0, s390_r1, s390_r13, ainfo->offset);
+ s390_stm (code, reg, reg+1, inst->inst_basereg, doffset);
+ break;
+ }
+ } else if (ainfo->regtype == RegTypeStructByAddr) {
+ if (ainfo->reg == STK_BASE) {
+ s390_lr (code, s390_r13, ainfo->reg);
+ s390_ahi (code, s390_r13, alloc_size);
+ s390_l (code, s390_r13, 0, s390_r13,
+ ainfo->offparm + S390_MINIMAL_STACK_SIZE);
+ code = emit_memcpy (code, abs(ainfo->vtsize),
+ inst->inst_basereg,
+ inst->inst_offset, s390_r13, 0);
+ } else {
+ code = emit_memcpy (code, abs(ainfo->vtsize),
+ inst->inst_basereg,
+ inst->inst_offset,
+ ainfo->reg, 0);
+ }
+ } else
+ g_assert_not_reached ();
+ }
+ pos++;
+ }
+
+ if (method->save_lmf) {
+ /*---------------------------------------------------------------*/
+ /* Preserve the parameter registers while we fix up the lmf */
+ /*---------------------------------------------------------------*/
+ s390_lr (code, s390_r7, s390_r2);
+ s390_lr (code, s390_r8, s390_r3);
+ s390_lr (code, s390_r9, s390_r4);
+ s390_lr (code, s390_r10, s390_r5);
+
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_get_lmf_addr");
+ /*---------------------------------------------------------------*/
+ /* On return from this call r2 have the address of the &lmf */
+ /*---------------------------------------------------------------*/
+ s390_brasl (code, s390_r14, 0);
+
+ /*---------------------------------------------------------------*/
+ /* we build the MonoLMF structure on the stack - see mini-s390.h */
+ /*---------------------------------------------------------------*/
+ lmfOffset = alloc_size - sizeof(MonoLMF);
+
+ s390_lr (code, s390_r13, cfg->frame_reg);
+ s390_ahi (code, s390_r13, lmfOffset);
+
+ /*---------------------------------------------------------------*/
+ /* Set lmf.lmf_addr = jit_tls->lmf */
+ /*---------------------------------------------------------------*/
+ s390_st (code, s390_r2, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, lmf_addr));
+
+ /*---------------------------------------------------------------*/
+ /* Get current lmf */
+ /*---------------------------------------------------------------*/
+ s390_l (code, s390_r0, 0, s390_r2, 0);
+
+ /*---------------------------------------------------------------*/
+ /* Set our lmf as the current lmf */
+ /*---------------------------------------------------------------*/
+ s390_st (code, s390_r13, 0, s390_r2, 0);
+
+ /*---------------------------------------------------------------*/
+ /* Have our lmf.previous_lmf point to the last lmf */
+ /*---------------------------------------------------------------*/
+ s390_st (code, s390_r0, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, previous_lmf));
+
+ /*---------------------------------------------------------------*/
+ /* save method info */
+ /*---------------------------------------------------------------*/
+ s390_basr (code, s390_r1, 0);
+ s390_j (code, 4);
+ s390_word (code, method);
+ s390_l (code, s390_r1, 0, s390_r1, 4);
+ s390_st (code, s390_r1, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, method));
+
+ /*---------------------------------------------------------------*/
+ /* save the current IP */
+ /*---------------------------------------------------------------*/
+ s390_lr (code, s390_r1, cfg->frame_reg);
+ s390_st (code, s390_r1, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, ebp));
+ s390_l (code, s390_r1, 0, s390_r1, S390_RET_ADDR_OFFSET);
+ s390_la (code, s390_r1, 0, s390_r1, 0);
+ s390_st (code, s390_r1, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, eip));
+
+ /*---------------------------------------------------------------*/
+ /* Save general and floating point registers */
+ /*---------------------------------------------------------------*/
+ s390_stm (code, s390_r2, s390_r12, s390_r13, G_STRUCT_OFFSET(MonoLMF, gregs[2]));
+ for (i = 0; i < 16; i++) {
+ s390_std (code, i, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, fregs[i]));
+ }
+
+ /*---------------------------------------------------------------*/
+ /* Restore the parameter registers now that we've set up the lmf */
+ /*---------------------------------------------------------------*/
+ s390_lr (code, s390_r2, s390_r7);
+ s390_lr (code, s390_r3, s390_r8);
+ s390_lr (code, s390_r4, s390_r9);
+ s390_lr (code, s390_r5, s390_r10);
+ }
+
+ if (tracing)
+ code = mono_arch_instrument_prolog (cfg, enter_method, code, TRUE);
+
+ cfg->code_len = code - cfg->native_code;
+ g_free (cinfo);
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_emit_epilog */
+/* */
+/* Function - Emit the instructions for a function epilog. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_emit_epilog (MonoCompile *cfg)
+{
+ MonoJumpInfo *patch_info;
+ MonoMethod *method = cfg->method;
+ MonoMethodSignature *sig = method->signature;
+ MonoInst *inst;
+ int i, tracing = 0;
+ guint8 *code;
+
+ code = cfg->native_code + cfg->code_len;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method)) {
+ code = mono_arch_instrument_epilog (cfg, leave_method, code, TRUE);
+ tracing = 1;
+ }
+
+ if (method->save_lmf)
+ code = restoreLMF(cfg, code);
+
+ if (cfg->flags & MONO_CFG_HAS_ALLOCA)
+ s390_l (code, STK_BASE, 0, STK_BASE, 0);
+ else
+ code = backUpStackPtr(cfg, code);
+
+ s390_lm (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (code, s390_r14);
+
+ /* add code to raise exceptions */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_EXC: {
+ /*-----------------------------------------------------*/
+ /* Patch the branch in epilog to come here */
+ /*-----------------------------------------------------*/
+ s390_patch (patch_info->ip.i+cfg->native_code+2,
+ S390_RELATIVE(code,patch_info->ip.i+cfg->native_code));
+ /*-----------------------------------------------------*/
+ /* Patch the parameter passed to the handler */
+ /*-----------------------------------------------------*/
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_EXC_NAME,
+ patch_info->data.target);
+ s390_word (code, 0);
+ /*-----------------------------------------------------*/
+ /* Load the return address and the parameter register */
+ /*-----------------------------------------------------*/
+ s390_larl (code, s390_r14, S390_RELATIVE((patch_info->ip.i +
+ cfg->native_code + 8), code));
+ s390_l (code, s390_r2, 0, s390_r13, 4);
+ /*-----------------------------------------------------*/
+ /* Reuse the current patch to set the jump */
+ /*-----------------------------------------------------*/
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->data.name = "mono_arch_throw_exception_by_name";
+ patch_info->ip.i = code - cfg->native_code;
+ s390_jcl (code, S390_CC_UN, 0);
+ break;
+ }
+ default:
+ /* do nothing */
+ break;
+ }
+ }
+
+ cfg->code_len = code - cfg->native_code;
+
+ g_assert (cfg->code_len < cfg->code_size);
+
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_setup_jit_tls_data */
+/* */
+/* Function - Setup the JIT's Thread Level Specific Data. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_setup_jit_tls_data (MonoJitTlsData *tls)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ pthread_t self = pthread_self();
+ pthread_attr_t attr;
+ void *stAddr = NULL;
+ size_t stSize = 0;
+ struct sigaltstack sa;
+#endif
+
+ if (!tls_offset_inited) {
+ tls_offset_inited = TRUE;
+
+// lmf_tls_offset = read_tls_offset_from_method (mono_get_lmf_addr);
+// appdomain_tls_offset = read_tls_offset_from_method (mono_domain_get);
+// thread_tls_offset = read_tls_offset_from_method (mono_thread_current);
+ }
+
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+
+ /*----------------------------------------------------------*/
+ /* Determine stack boundaries */
+ /*----------------------------------------------------------*/
+ if (!mono_running_on_valgrind ()) {
+#ifdef HAVE_PTHREAD_GETATTR_NP
+ pthread_getattr_np( self, &attr );
+#elif HAVE_PTHREAD_ATTR_GET_NP
+ pthread_attr_get_np( self, &attr );
+#endif
+ pthread_attr_getstack( &attr, &stAddr, &stSize );
+ }
+
+
+ /*----------------------------------------------------------*/
+ /* Setup an alternate signal stack */
+ /*----------------------------------------------------------*/
+ tls->stack_size = stSize;
+ tls->signal_stack = g_malloc (SIGNAL_STACK_SIZE);
+ tls->signal_stack_size = SIGNAL_STACK_SIZE;
+
+ sa.ss_sp = tls->signal_stack;
+ sa.ss_size = SIGNAL_STACK_SIZE;
+ sa.ss_flags = SS_ONSTACK;
+ sigaltstack (&sa, NULL);
+#endif
+
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_free_jit_tls_data */
+/* */
+/* Function - Free tls data. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_free_jit_tls_data (MonoJitTlsData *tls)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ struct sigaltstack sa;
+
+ sa.ss_sp = tls->signal_stack;
+ sa.ss_size = SIGNAL_STACK_SIZE;
+ sa.ss_flags = SS_DISABLE;
+ sigaltstack (&sa, NULL);
+
+ if (tls->signal_stack)
+ g_free (tls->signal_stack);
+#endif
+
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_emit_this_vret_args */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg)
+{
+ int this_dreg = s390_r2;
+
+ if (vt_reg != -1)
+ this_dreg = s390_r3;
+
+ /* add the this argument */
+ if (this_reg != -1) {
+ MonoInst *this;
+ MONO_INST_NEW (cfg, this, OP_SETREG);
+ this->type = this_type;
+ this->sreg1 = this_reg;
+ this->dreg = this_dreg;
+ mono_bblock_add_inst (cfg->cbb, this);
+ }
+
+ if (vt_reg != -1) {
+ MonoInst *vtarg;
+ MONO_INST_NEW (cfg, vtarg, OP_SETREG);
+ vtarg->type = STACK_MP;
+ vtarg->sreg1 = vt_reg;
+ vtarg->dreg = s390_r2;
+ mono_bblock_add_inst (cfg->cbb, vtarg);
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_opcode_for_method */
+/* */
+/* Function - Check for opcodes we can handle directly in */
+/* hardware. */
+/* */
+/*------------------------------------------------------------------*/
+
+gint
+mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
+{
+ if (cmethod->klass == mono_defaults.math_class) {
+ if (strcmp (cmethod->name, "Sqrt") == 0)
+ return OP_SQRT;
+ }
+ return -1;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_print_tree */
+/* */
+/* Function - Print platform-specific opcode details. */
+/* */
+/* Returns - 1 - opcode details have been printed */
+/* 0 - opcode details have not been printed */
+/* */
+/*------------------------------------------------------------------*/
+
+gboolean
+mono_arch_print_tree (MonoInst *tree, int arity)
+{
+ gboolean done;
+
+ switch (tree->opcode) {
+ case OP_S390_LOADARG:
+ case OP_S390_ARGPTR:
+ printf ("[0x%x(%s)]", tree->inst_offset,
+ mono_arch_regname (tree->inst_basereg));
+ done = 1;
+ break;
+ case OP_S390_STKARG:
+ printf ("[0x%x(previous_frame)]",
+ tree->inst_offset);
+ done = 1;
+ break;
+ case OP_S390_MOVE:
+ printf ("[0x%x(%d,%s),0x%x(%s)]",
+ tree->inst_offset, tree->unused,
+ tree->dreg, tree->inst_imm,
+ tree->sreg1);
+ done = 1;
+ break;
+ case OP_S390_SETF4RET:
+ printf ("[f%d,f%d]",
+ mono_arch_regname (tree->dreg),
+ mono_arch_regname (tree->sreg1));
+ default:
+ done = 0;
+ }
+ return (done);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_regalloc_cost */
+/* */
+/* Function - Determine the cost, in the number of memory */
+/* references, of the action of allocating the var- */
+/* iable VMV into a register during global register */
+/* allocation. */
+/* */
+/* Returns - Cost */
+/* */
+/*------------------------------------------------------------------*/
+
+guint32
+mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv)
+{
+ /* FIXME: */
+ return 2;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_domain_intrinsic */
+/* */
+/* Function - */
+/* */
+/* Returns - */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_thread_intrinsic */
+/* */
+/* Function - */
+/* */
+/* Returns - */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoInst* mono_arch_get_thread_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+}
+
+/*========================= End of Function ========================*/
diff --git a/mono/mini/mini-s390.h b/mono/mini/mini-s390.h
new file mode 100644
index 00000000000..8a400e0299f
--- /dev/null
+++ b/mono/mini/mini-s390.h
@@ -0,0 +1,158 @@
+#ifndef __MONO_MINI_S390_H__
+#define __MONO_MINI_S390_H__
+
+#include <mono/arch/s390/s390-codegen.h>
+#include <signal.h>
+
+#define MONO_MAX_IREGS 16
+#define MONO_MAX_FREGS 16
+
+#define MONO_ARCH_FRAME_ALIGNMENT 8
+
+#define MONO_EMIT_NEW_MOVE(cfg,dest,offset,src,imm,size) do { \
+ MonoInst *inst; \
+ int tmpr = 0; \
+ int sReg, dReg; \
+ \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ if (size > 256) { \
+ tmpr = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_ICONST(cfg,tmpr,size); \
+ inst->dreg = dest; \
+ inst->inst_offset = offset; \
+ inst->sreg1 = src; \
+ inst->inst_imm = imm; \
+ inst->sreg2 = tmpr; \
+ } else { \
+ if (s390_is_uimm12(offset)) { \
+ inst->dreg = dest; \
+ inst->inst_offset = offset; \
+ } else { \
+ dReg = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_BIALU_IMM(cfg, OP_ADD_IMM, \
+ dReg, dest, offset); \
+ inst->dreg = dReg; \
+ inst->inst_offset = 0; \
+ } \
+ if (s390_is_uimm12(imm)) { \
+ inst->sreg1 = src; \
+ inst->inst_imm = imm; \
+ } else { \
+ sReg = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_BIALU_IMM(cfg, OP_ADD_IMM, \
+ sReg, src, imm); \
+ inst->sreg1 = sReg; \
+ inst->inst_imm = 0; \
+ } \
+ } \
+ inst->opcode = OP_S390_MOVE; \
+ inst->unused = size; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_OUTPUT_VTR(cfg, size, dr, sr, so) do { \
+ switch (size) { \
+ case 1: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU1_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ case 2: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU2_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ case 4: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOAD_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ case 8: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOAD_MEMBASE, \
+ dr, sr, so); \
+ dr++; so += sizeof(guint32); \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOAD_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ } \
+} while (0)
+
+#define MONO_OUTPUT_VTS(cfg, size, dr, dx, sr, so) do { \
+ int tmpr; \
+ switch (size) { \
+ case 1: \
+ tmpr = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU1_MEMBASE, \
+ tmpr, sr, so); \
+ MONO_EMIT_NEW_STORE_MEMBASE(cfg, OP_STORE_MEMBASE_REG, \
+ tmpr, dr, dx); \
+ break; \
+ case 2: \
+ tmpr = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU2_MEMBASE, \
+ tmpr, sr, so); \
+ MONO_EMIT_NEW_STORE_MEMBASE(cfg, OP_STORE_MEMBASE_REG, \
+ tmpr, dr, dx); \
+ break; \
+ case 4: \
+ case 8: \
+ MONO_EMIT_NEW_MOVE (cfg, dr, dx, sr, so, size); \
+ break; \
+ } \
+} while (0)
+
+/* fixme: align to 16byte instead of 32byte (we align to 32byte to get
+ * reproduceable results for benchmarks */
+#define MONO_ARCH_CODE_ALIGNMENT 32
+
+struct MonoLMF {
+ gpointer previous_lmf;
+ gpointer lmf_addr;
+ MonoMethod *method;
+ gulong ebp;
+ gulong eip;
+ gulong gregs[16];
+ gdouble fregs[16];
+};
+
+typedef struct ucontext MonoContext;
+
+typedef struct MonoCompileArch {
+} MonoCompileArch;
+
+#define MONO_ARCH_EMULATE_FCONV_TO_I8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R4 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
+#define MONO_ARCH_EMULATE_LMUL 1
+
+#define MONO_ARCH_USE_SIGACTION 1
+
+#define S390_STACK_ALIGNMENT 8
+#define S390_FIRST_ARG_REG s390_r2
+#define S390_LAST_ARG_REG s390_r6
+#define S390_FIRST_FPARG_REG s390_f0
+#define S390_LAST_FPARG_REG s390_f2
+#define S390_PASS_STRUCTS_BY_VALUE 1
+#define S390_SMALL_RET_STRUCT_IN_REG 1
+
+#define S390_NUM_REG_ARGS (S390_LAST_ARG_REG-S390_FIRST_ARG_REG+1)
+#define S390_NUM_REG_FPARGS (S390_LAST_FPARG_REG-S390_FIRST_FPARG_REG)
+
+#define S390_OFFSET(b, t) (guchar *) ((gint32) (b) - (gint32) (t))
+#define S390_RELATIVE(b, t) (guchar *) ((((gint32) (b) - (gint32) (t))) / 2)
+
+#define CODEPTR(c, o) (o) = (short *) ((guint32) c - 2)
+#define PTRSLOT(c, o) *(o) = (short) ((guint32) c - (guint32) (o) + 2)/2
+
+#define S390_CC_EQ 8
+#define S390_ALIGN(v, a) (((a) > 0 ? (((v) + ((a) - 1)) & ~((a) - 1)) : (v)))
+
+static void inline
+s390_patch (guchar *code, gint32 target)
+{
+ gint32 *offset = (gint32 *) code;
+
+ if (target != 00) {
+ *offset = target;
+ }
+}
+
+#endif /* __MONO_MINI_S390_H__ */
diff --git a/mono/mini/mini-s390x.c b/mono/mini/mini-s390x.c
new file mode 100644
index 00000000000..8a5d50ec9a6
--- /dev/null
+++ b/mono/mini/mini-s390x.c
@@ -0,0 +1,5685 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mini-s390.c */
+/* */
+/* Function - S/390 backend for the Mono code generator. */
+/* */
+/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
+/* */
+/* Date - January, 2004 */
+/* */
+/* Derivation - From mini-x86 & mini-ppc by - */
+/* Paolo Molaro (lupus@ximian.com) */
+/* Dietmar Maurer (dietmar@ximian.com) */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define NOT_IMPLEMENTED(x) \
+ g_error ("FIXME: %s is not yet implemented. (trampoline)", x);
+
+#define EMIT_COND_BRANCH(ins,cond) \
+{ \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (ins->inst_i0->inst_c0) { \
+ int displace; \
+ displace = ((cfg->native_code + ins->inst_i0->inst_c0) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, cond, displace); \
+ } else { \
+ s390_jcl (code, cond, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ s390_jcl (code, cond, 0); \
+ } \
+} else { \
+ if (ins->inst_true_bb->native_offset) { \
+ int displace; \
+ displace = ((cfg->native_code + \
+ ins->inst_true_bb->native_offset) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, cond, displace); \
+ } else { \
+ s390_jcl (code, cond, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_BB, ins->inst_true_bb); \
+ s390_jcl (code, cond, 0); \
+ } \
+} \
+}
+
+#define EMIT_UNCOND_BRANCH(ins) \
+{ \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (ins->inst_i0->inst_c0) { \
+ int displace; \
+ displace = ((cfg->native_code + ins->inst_i0->inst_c0) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, S390_CC_UN, displace); \
+ } else { \
+ s390_jcl (code, S390_CC_UN, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ s390_jcl (code, S390_CC_UN, 0); \
+ } \
+} else { \
+ if (ins->inst_target_bb->native_offset) { \
+ int displace; \
+ displace = ((cfg->native_code + \
+ ins->inst_target_bb->native_offset) - code) / 2; \
+ if (s390_is_uimm16(displace)) { \
+ s390_brc (code, S390_CC_UN, displace); \
+ } else { \
+ s390_jcl (code, S390_CC_UN, displace); \
+ } \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_BB, ins->inst_target_bb); \
+ s390_jcl (code, S390_CC_UN, 0); \
+ } \
+} \
+}
+
+#define EMIT_COND_SYSTEM_EXCEPTION(cond,exc_name) \
+ do { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_EXC, exc_name); \
+ s390_jcl (code, cond, 0); \
+ } while (0);
+
+#undef DEBUG
+#define DEBUG(a) if (cfg->verbose_level > 1) a
+#define reg_is_freeable(r) ((r) >= 3 && (r) <= 10)
+#define freg_is_freeable(r) ((r) >= 1 && (r) <= 14)
+
+/*----------------------------------------*/
+/* use s390_r3-s390_r10 as temp registers */
+/*----------------------------------------*/
+#define S390_CALLER_REGS (0x03f8)
+
+/*----------------------------------------*/
+/* use s390_f2-s390_f14 as temp registers */
+/*----------------------------------------*/
+#define S390_CALLER_FREGS (0x73f8)
+
+#define S390_TRACE_STACK_SIZE (5*sizeof(gint64)+3*sizeof(gdouble))
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#include "mini.h"
+#include <string.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/profiler-private.h>
+#include <mono/utils/mono-math.h>
+
+#include "mini-s390x.h"
+#include "inssel.h"
+#include "cpu-s390x.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+typedef struct {
+ guint stack_size,
+ local_size,
+ code_size,
+ retStruct;
+} size_data;
+
+/*------------------------------------------------------------------*/
+/* Used by the instrument_emit_epilog */
+/*------------------------------------------------------------------*/
+
+enum {
+ SAVE_NONE,
+ SAVE_STRUCT,
+ SAVE_ONE,
+ SAVE_TWO,
+ SAVE_FP
+};
+
+typedef struct {
+ int born_in;
+ int killed_in;
+ int last_use;
+ int prev_use;
+} RegTrack;
+
+typedef struct InstList InstList;
+
+struct InstList {
+ InstList *prev;
+ InstList *next;
+ MonoInst *data;
+};
+
+enum {
+ RegTypeGeneral,
+ RegTypeBase,
+ RegTypeFP,
+ RegTypeStructByVal,
+ RegTypeStructByAddr
+};
+
+typedef struct {
+ gint32 offset; /* offset from caller's stack */
+ gint32 offparm; /* offset on callee's stack */
+ guint16 vtsize; /* in param area */
+ guint8 reg;
+ guint8 regtype; /* See RegType* */
+ guint32 size; /* Size of structure used by RegTypeStructByVal */
+} ArgInfo;
+
+typedef struct {
+ int nargs;
+ guint32 stack_usage;
+ guint32 struct_ret;
+ ArgInfo ret;
+ ArgInfo args [1];
+} CallInfo;
+
+typedef struct {
+ gint64 gr[5]; /* R2-R6 */
+ gdouble fp[3]; /* F0-F2 */
+} __attribute__ ((packed)) RegParm;
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* P r o t o t y p e s */
+/*------------------------------------------------------------------*/
+
+static guint8 * emit_memcpy (guint8 *, int, int, int, int, int);
+static void indent (int);
+static guint8 * restoreLMF(MonoCompile *, guint8 *);
+static guint8 * backUpStackPtr(MonoCompile *, guint8 *);
+static void decodeParm (MonoType *, void *, int);
+static void enter_method (MonoMethod *, RegParm *, char *);
+static void leave_method (MonoMethod *, ...);
+static gboolean is_regsize_var (MonoType *);
+static void add_general (guint *, size_data *, ArgInfo *);
+static CallInfo * calculate_sizes (MonoMethodSignature *, size_data *, gboolean);
+static void peephole_pass (MonoCompile *, MonoBasicBlock *);
+static int mono_spillvar_offset (MonoCompile *, int);
+static int mono_spillvar_offset_float (MonoCompile *, int);
+static void print_ins (int, MonoInst *);
+static void print_regtrack (RegTrack *, int);
+static InstList * inst_list_prepend (MonoMemPool *, InstList *, MonoInst *);
+static int get_register_force_spilling (MonoCompile *, InstList *, MonoInst *, int);
+static int get_register_spilling (MonoCompile *, InstList *, MonoInst *, guint32, int);
+static int get_float_register_spilling (MonoCompile *, InstList *, MonoInst *, guint32, int);
+static MonoInst * create_copy_ins (MonoCompile *, int, int, MonoInst *);
+static MonoInst * create_copy_ins_float (MonoCompile *, int, int, MonoInst *);
+static MonoInst * create_spilled_store (MonoCompile *, int, int, int, MonoInst *);
+static MonoInst * create_spilled_store_float (MonoCompile *, int, int, int, MonoInst *);
+static void insert_before_ins (MonoInst *, InstList *, MonoInst *);
+static int alloc_int_reg (MonoCompile *, InstList *, MonoInst *, int, guint32);
+static guchar * emit_float_to_int (MonoCompile *, guchar *, int, int, int, gboolean);
+static unsigned char * mono_emit_stack_alloc (guchar *, MonoInst *);
+
+/*========================= End of Prototypes ======================*/
+
+/*------------------------------------------------------------------*/
+/* G l o b a l V a r i a b l e s */
+/*------------------------------------------------------------------*/
+
+int mono_exc_esp_offset = 0;
+
+static int indent_level = 0;
+
+static const char*const * ins_spec = s390x;
+
+/*====================== End of Global Variables ===================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_regname */
+/* */
+/* Function - Returns the name of the register specified by */
+/* the input parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+const char*
+mono_arch_regname (int reg) {
+ static const char * rnames[] = {
+ "s390_r0", "s390_sp", "s390_r2", "s390_r3", "s390_r4",
+ "s390_r5", "s390_r6", "s390_r7", "s390_r8", "s390_r9",
+ "s390_r10", "s390_r11", "s390_r12", "s390_r13", "s390_r14",
+ "s390_r15"
+ };
+ if (reg >= 0 && reg < 16)
+ return rnames [reg];
+ return "unknown";
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_is_inst_imm */
+/* */
+/* Function - Determine whether an instruction qualifies as an */
+/* immediate. */
+/* */
+/*------------------------------------------------------------------*/
+
+gboolean
+mono_arch_is_inst_imm (gint64 imm)
+{
+ return s390_is_imm16 (imm);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_memcpy */
+/* */
+/* Function - Emit code to move from memory-to-memory based on */
+/* the size of the variable. r0 is overwritten. */
+/* */
+/*------------------------------------------------------------------*/
+
+static guint8 *
+emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffset)
+{
+ switch (size) {
+ case 4 :
+ s390_l (code, s390_r0, 0, sreg, soffset);
+ s390_st (code, s390_r0, 0, dreg, doffset);
+ break;
+
+ case 3 :
+ s390_icm (code, s390_r0, 14, sreg, soffset);
+ s390_stcm (code, s390_r0, 14, dreg, doffset);
+ break;
+
+ case 2 :
+ s390_lh (code, s390_r0, 0, sreg, soffset);
+ s390_sth (code, s390_r0, 0, dreg, doffset);
+ break;
+
+ case 1 :
+ s390_ic (code, s390_r0, 0, sreg, soffset);
+ s390_stc (code, s390_r0, 0, dreg, doffset);
+ break;
+
+ default :
+ while (size > 0) {
+ int len;
+
+ if (size > 256)
+ len = 256;
+ else
+ len = size;
+ s390_mvc (code, len, dreg, doffset, sreg, soffset);
+ size -= len;
+ }
+ }
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - arch_get_argument_info */
+/* */
+/* Function - Gathers information on parameters such as size, */
+/* alignment, and padding. arg_info should be large */
+/* enough to hold param_count + 1 entries. */
+/* */
+/* Parameters - @csig - Method signature */
+/* @param_count - No. of parameters to consider */
+/* @arg_info - An array to store the result info */
+/* */
+/* Returns - Size of the activation frame */
+/* */
+/*------------------------------------------------------------------*/
+
+int
+mono_arch_get_argument_info (MonoMethodSignature *csig,
+ int param_count,
+ MonoJitArgumentInfo *arg_info)
+{
+ int k, frame_size = 0;
+ int size, align, pad;
+ int offset = 8;
+
+ if (MONO_TYPE_ISSTRUCT (csig->ret)) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].offset = offset;
+
+ if (csig->hasthis) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].size = frame_size;
+
+ for (k = 0; k < param_count; k++) {
+
+ if (csig->pinvoke)
+ size = mono_type_native_stack_size (csig->params [k], &align);
+ else
+ size = mono_type_stack_size (csig->params [k], &align);
+
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+ frame_size += size;
+ arg_info [k + 1].pad = 0;
+ arg_info [k + 1].size = size;
+ offset += pad;
+ arg_info [k + 1].offset = offset;
+ offset += size;
+ }
+
+ align = MONO_ARCH_FRAME_ALIGNMENT;
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+
+ return frame_size;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - restoreLMF */
+/* */
+/* Function - Restore the LMF state prior to exiting a method. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+restoreLMF(MonoCompile *cfg, guint8 *code)
+{
+ int lmfOffset = 0;
+
+ s390_lgr (code, s390_r13, cfg->frame_reg);
+
+ lmfOffset = cfg->stack_usage - sizeof(MonoLMF);
+
+ /*-------------------------------------------------*/
+ /* r13 = my lmf */
+ /*-------------------------------------------------*/
+ s390_aghi (code, s390_r13, lmfOffset);
+
+ /*-------------------------------------------------*/
+ /* r6 = &jit_tls->lmf */
+ /*-------------------------------------------------*/
+ s390_lg (code, s390_r6, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, lmf_addr));
+
+ /*-------------------------------------------------*/
+ /* r0 = lmf.previous_lmf */
+ /*-------------------------------------------------*/
+ s390_lg (code, s390_r0, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, previous_lmf));
+
+ /*-------------------------------------------------*/
+ /* jit_tls->lmf = previous_lmf */
+ /*-------------------------------------------------*/
+ s390_lg (code, s390_r13, 0, s390_r6, 0);
+ s390_stg (code, s390_r0, 0, s390_r6, 0);
+ return (code);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - backStackPtr. */
+/* */
+/* Function - Restore Stack Pointer to previous frame. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline guint8 *
+backUpStackPtr(MonoCompile *cfg, guint8 *code)
+{
+ int stackSize = cfg->stack_usage;
+
+ if (s390_is_imm16 (cfg->stack_usage)) {
+ s390_aghi (code, STK_BASE, cfg->stack_usage);
+ } else {
+ while (stackSize > 32767) {
+ s390_aghi (code, STK_BASE, 32767);
+ stackSize -= 32767;
+ }
+ s390_aghi (code, STK_BASE, stackSize);
+ }
+ return (code);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - indent */
+/* */
+/* Function - Perform nice indenting to current level */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+indent (int diff) {
+ int v;
+ if (diff < 0)
+ indent_level += diff;
+ v = indent_level;
+ printf("[%3d] ",v);
+ while (v-- > 0) {
+ printf (". ");
+ }
+ if (diff > 0)
+ indent_level += diff;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - decodeParm */
+/* */
+/* Function - Decode a parameter for the trace. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+decodeParm(MonoType *type, void *curParm, int size)
+{
+ guint32 simpleType;
+
+ if (type->byref) {
+ printf("[BYREF:%p], ", *((char **) curParm));
+ } else {
+ simpleType = type->type;
+enum_parmtype:
+ switch (simpleType) {
+ case MONO_TYPE_I :
+ printf ("[INTPTR:%p], ", *((int **) curParm));
+ break;
+ case MONO_TYPE_U :
+ printf ("[UINTPTR:%p], ", *((int **) curParm));
+ break;
+ case MONO_TYPE_BOOLEAN :
+ printf ("[BOOL:%p], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_CHAR :
+ printf ("[CHAR:%p], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_I1 :
+ printf ("[INT1:%d], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_I2 :
+ printf ("[INT2:%d], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_I4 :
+ printf ("[INT4:%d], ", *((int *) curParm));
+ break;
+ case MONO_TYPE_U1 :
+ printf ("[UINT1:%ud], ", *((unsigned int *) curParm));
+ break;
+ case MONO_TYPE_U2 :
+ printf ("[UINT2:%ud], ", *((guint16 *) curParm));
+ break;
+ case MONO_TYPE_U4 :
+ printf ("[UINT4:%ud], ", *((guint32 *) curParm));
+ break;
+ case MONO_TYPE_U8 :
+ printf ("[UINT8:%ul], ", *((guint64 *) curParm));
+ break;
+ case MONO_TYPE_STRING : {
+ MonoString *s = *((MonoString **) curParm);
+ if (s) {
+ g_assert (((MonoObject *) s)->vtable->klass == mono_defaults.string_class);
+ printf("[STRING:%p:%s], ", s, mono_string_to_utf8(s));
+ } else {
+ printf("[STRING:null], ");
+ }
+ break;
+ }
+ case MONO_TYPE_CLASS :
+ case MONO_TYPE_OBJECT : {
+ MonoObject *obj = *((MonoObject **) curParm);
+ MonoClass *class;
+ if (obj) {
+ printf("[CLASS/OBJ:");
+ class = obj->vtable->klass;
+ if (class == mono_defaults.string_class) {
+ printf("[STRING:%p:%s]",
+ *obj, mono_string_to_utf8 (obj));
+ } else if (class == mono_defaults.int32_class) {
+ printf("[INT32:%p:%d]",
+ obj, *(gint32 *)((char *)obj + sizeof (MonoObject)));
+ } else
+ printf("[%s.%s:%p]",
+ class->name_space, class->name, obj);
+ printf("], ");
+ } else {
+ printf("[OBJECT:null], ");
+ }
+ break;
+ }
+ case MONO_TYPE_PTR :
+ printf("[PTR:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_FNPTR :
+ printf("[FNPTR:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_ARRAY :
+ printf("[ARRAY:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_SZARRAY :
+ printf("[SZARRAY:%p], ", *((gpointer **) (curParm)));
+ break;
+ case MONO_TYPE_I8 :
+ printf("[INT8:%lld], ", *((gint64 *) (curParm)));
+ break;
+ case MONO_TYPE_R4 :
+ printf("[FLOAT4:%f], ", *((float *) (curParm)));
+ break;
+ case MONO_TYPE_R8 :
+ printf("[FLOAT8:%g], ", *((double *) (curParm)));
+ break;
+ case MONO_TYPE_VALUETYPE : {
+ int i;
+ if (type->data.klass->enumtype) {
+ simpleType = type->data.klass->enum_basetype->type;
+ printf("{VALUETYPE} - ");
+ goto enum_parmtype;
+ }
+ printf("[VALUETYPE:");
+ for (i = 0; i < size; i++)
+ printf("%02x,", *((guint8 *)curParm+i));
+ printf("]");
+ break;
+ }
+ default :
+ printf("[?? - %d], ",simpleType);
+ }
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - enter_method */
+/* */
+/* Function - Perform tracing of the entry to the current */
+/* method. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+enter_method (MonoMethod *method, RegParm *rParm, char *sp)
+{
+ int i, oParm = 0, iParm = 0;
+ MonoClass *class;
+ MonoObject *obj;
+ MonoJitArgumentInfo *arg_info;
+ MonoMethodSignature *sig;
+ char *fname;
+ guint64 ip;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+ size_data sz;
+ void *curParm;
+
+ fname = mono_method_full_name (method, TRUE);
+ indent (1);
+ printf ("ENTER: %s(", fname);
+ g_free (fname);
+
+ ip = (*(guint64 *) (sp+S390_RET_ADDR_OFFSET));
+ printf (") ip: %p sp: %p - ", ip, sp);
+
+ if (rParm == NULL)
+ return;
+
+ sig = method->signature;
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ if (cinfo->struct_ret) {
+ printf ("[VALUERET:%p], ", rParm->gr[0]);
+ iParm = 1;
+ }
+
+ if (sig->hasthis) {
+ gpointer *this = (gpointer *) rParm->gr[iParm];
+ obj = (MonoObject *) this;
+ if (method->klass->valuetype) {
+ if (obj) {
+ printf("this:[value:%p:%08x], ",
+ this, *((guint64 *)(this+sizeof(MonoObject))));
+ } else
+ printf ("this:[NULL], ");
+ } else {
+ if (obj) {
+ class = obj->vtable->klass;
+ if (class == mono_defaults.string_class) {
+ printf ("this:[STRING:%p:%s], ",
+ obj, mono_string_to_utf8 ((MonoString *)obj));
+ } else {
+ printf ("this:%p[%s.%s], ",
+ obj, class->name_space, class->name);
+ }
+ } else
+ printf ("this:NULL, ");
+ }
+ oParm++;
+ }
+
+ for (i = 0; i < sig->param_count; ++i) {
+ ainfo = cinfo->args + (i + oParm);
+ switch (ainfo->regtype) {
+ case RegTypeGeneral :
+ decodeParm(sig->params[i], &(rParm->gr[ainfo->reg-2]), ainfo->size);
+ break;
+ case RegTypeFP :
+ decodeParm(sig->params[i], &(rParm->fp[ainfo->reg]), ainfo->size);
+ break;
+ case RegTypeBase :
+ decodeParm(sig->params[i], sp+ainfo->offset, ainfo->size);
+ break;
+ case RegTypeStructByVal :
+ if (ainfo->reg != STK_BASE)
+ curParm = &(rParm->gr[ainfo->reg-2]);
+ else
+ curParm = sp+ainfo->offset;
+
+ switch (ainfo->vtsize) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ decodeParm(sig->params[i],
+ curParm,
+ ainfo->size);
+ break;
+ default:
+ decodeParm(sig->params[i],
+ *((char **) curParm),
+ ainfo->vtsize);
+ }
+ break;
+ case RegTypeStructByAddr :
+ if (ainfo->reg != STK_BASE)
+ curParm = &(rParm->gr[ainfo->reg-2]);
+ else
+ curParm = sp+ainfo->offset;
+
+ decodeParm(sig->params[i],
+ *((char **) curParm),
+ ainfo->vtsize);
+ break;
+
+ default :
+ printf("???, ");
+ }
+ }
+ printf("\n");
+ g_free (cinfo);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - leave_method */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+leave_method (MonoMethod *method, ...)
+{
+ MonoType *type;
+ char *fname;
+ guint64 ip;
+ va_list ap;
+
+ va_start(ap, method);
+
+ fname = mono_method_full_name (method, TRUE);
+ indent (-1);
+ printf ("LEAVE: %s", fname);
+ g_free (fname);
+
+ type = method->signature->ret;
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN: {
+ int val = va_arg (ap, int);
+ if (val)
+ printf ("[TRUE:%d]", val);
+ else
+ printf ("[FALSE]");
+
+ break;
+ }
+ case MONO_TYPE_CHAR: {
+ int val = va_arg (ap, int);
+ printf ("[CHAR:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I1: {
+ int val = va_arg (ap, int);
+ printf ("[INT1:%d]", val);
+ break;
+ }
+ case MONO_TYPE_U1: {
+ int val = va_arg (ap, int);
+ printf ("[UINT1:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I2: {
+ int val = va_arg (ap, int);
+ printf ("[INT2:%d]", val);
+ break;
+ }
+ case MONO_TYPE_U2: {
+ int val = va_arg (ap, int);
+ printf ("[UINT2:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I4: {
+ int val = va_arg (ap, int);
+ printf ("[INT4:%d]", val);
+ break;
+ }
+ case MONO_TYPE_U4: {
+ int val = va_arg (ap, int);
+ printf ("[UINT4:%d]", val);
+ break;
+ }
+ case MONO_TYPE_I: {
+ int *val = va_arg (ap, int*);
+ printf ("[INT:%d]", val);
+ printf("]");
+ break;
+ }
+ case MONO_TYPE_U: {
+ int *val = va_arg (ap, int*);
+ printf ("[UINT:%d]", val);
+ printf("]");
+ break;
+ }
+ case MONO_TYPE_STRING: {
+ MonoString *s = va_arg (ap, MonoString *);
+;
+ if (s) {
+ g_assert (((MonoObject *)s)->vtable->klass == mono_defaults.string_class);
+ printf ("[STRING:%p:%s]", s, mono_string_to_utf8 (s));
+ } else
+ printf ("[STRING:null], ");
+ break;
+ }
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT: {
+ MonoObject *o = va_arg (ap, MonoObject *);
+
+ if (o) {
+ if (o->vtable->klass == mono_defaults.boolean_class) {
+ printf ("[BOOLEAN:%p:%d]", o, *((guint8 *)o + sizeof (MonoObject)));
+ } else if (o->vtable->klass == mono_defaults.int32_class) {
+ printf ("[INT32:%p:%d]", o, *((gint32 *)((char *)o + sizeof (MonoObject))));
+ } else if (o->vtable->klass == mono_defaults.int64_class) {
+ printf ("[INT64:%p:%lld]", o, *((gint64 *)((char *)o + sizeof (MonoObject))));
+ } else
+ printf ("[%s.%s:%p]", o->vtable->klass->name_space, o->vtable->klass->name, o);
+ } else
+ printf ("[OBJECT:%p]", o);
+
+ break;
+ }
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY: {
+ gpointer p = va_arg (ap, gpointer);
+ printf ("[result=%p]", p);
+ break;
+ }
+ case MONO_TYPE_I8: {
+ gint64 l = va_arg (ap, gint64);
+ printf ("[LONG:%lld]", l);
+ break;
+ }
+ case MONO_TYPE_R4: {
+ double f = va_arg (ap, double);
+ printf ("[FLOAT4:%f]\n", (float) f);
+ break;
+ }
+ case MONO_TYPE_R8: {
+ double f = va_arg (ap, double);
+ printf ("[FLOAT8:%g]\n", f);
+ break;
+ }
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto handle_enum;
+ } else {
+ guint8 *p = va_arg (ap, gpointer);
+ int j, size, align;
+ size = mono_type_size (type, &align);
+ printf ("[");
+ for (j = 0; p && j < size; j++)
+ printf ("%02x,", p [j]);
+ printf ("]");
+ }
+ break;
+ default:
+ printf ("(unknown return type %x)",
+ method->signature->ret->type);
+ }
+
+ ip = ((gint64) __builtin_return_address (0));
+ printf (" ip: %p\n", ip);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_cpu_init */
+/* */
+/* Function - Perform CPU specific initialization to execute */
+/* managed code. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_cpu_init (void)
+{
+ guint mode = 1;
+
+ /*--------------------------------------*/
+ /* Set default rounding mode for FP */
+ /*--------------------------------------*/
+ __asm__ ("SRNM\t%0\n\t"
+ : : "m" (mode));
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_cpu_optimizazions */
+/* */
+/* Function - Returns the optimizations supported on this CPU */
+/* */
+/*------------------------------------------------------------------*/
+
+guint32
+mono_arch_cpu_optimizazions (guint32 *exclude_mask)
+{
+ guint32 opts = 0;
+
+ /* no s390-specific optimizations yet */
+ *exclude_mask = MONO_OPT_INLINE|MONO_OPT_LINEARS;
+ return opts;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static gboolean
+is_regsize_var (MonoType *t) {
+ if (t->byref)
+ return TRUE;
+ switch (t->type) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U:
+ case MONO_TYPE_U8:
+ return TRUE;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return FALSE;
+ case MONO_TYPE_VALUETYPE:
+ if (t->data.klass->enumtype)
+ return is_regsize_var (t->data.klass->enum_basetype);
+ return FALSE;
+ }
+ return FALSE;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_allocatable_int_vars */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+GList *
+mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
+{
+ GList *vars = NULL;
+ int i;
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoInst *ins = cfg->varinfo [i];
+ MonoMethodVar *vmv = MONO_VARINFO (cfg, i);
+
+ /* unused vars */
+ if (vmv->range.first_use.abs_pos > vmv->range.last_use.abs_pos)
+ continue;
+
+ if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) ||
+ (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG))
+ continue;
+
+ /* we can only allocate 32 bit values */
+ if (is_regsize_var (ins->inst_vtype)) {
+ g_assert (MONO_VARINFO (cfg, i)->reg == -1);
+ g_assert (i == vmv->idx);
+ vars = mono_varlist_insert_sorted (cfg, vars, vmv, FALSE);
+ }
+ }
+
+ return vars;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_global_int_regs */
+/* */
+/* Function - Return a list of usable integer registers. */
+/* */
+/*------------------------------------------------------------------*/
+
+GList *
+mono_arch_get_global_int_regs (MonoCompile *cfg)
+{
+ GList *regs = NULL;
+ int i, top = 12;
+
+ for (i = 3; i < top; ++i)
+ regs = g_list_prepend (regs, GUINT_TO_POINTER (i));
+
+ return regs;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_flush_icache */
+/* */
+/* Function - Flush the CPU icache. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_flush_icache (guint8 *code, gint size)
+{
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - add_general */
+/* */
+/* Function - Determine code and stack size incremements for a */
+/* parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void inline
+add_general (guint *gr, size_data *sz, ArgInfo *ainfo)
+{
+ if (*gr > S390_LAST_ARG_REG) {
+ sz->stack_size = S390_ALIGN(sz->stack_size, sizeof(long));
+ ainfo->offset = sz->stack_size;
+ ainfo->reg = STK_BASE;
+ ainfo->regtype = RegTypeBase;
+ sz->stack_size += sizeof(int);
+ sz->code_size += 12;
+ } else {
+ ainfo->reg = *gr;
+ sz->code_size += 8;
+ }
+ (*gr) ++;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - calculate_sizes */
+/* */
+/* Function - Determine the amount of space required for code */
+/* and stack. In addition determine starting points */
+/* for stack-based parameters, and area for struct- */
+/* ures being returned on the stack. */
+/* */
+/*------------------------------------------------------------------*/
+
+static CallInfo *
+calculate_sizes (MonoMethodSignature *sig, size_data *sz,
+ gboolean string_ctor)
+{
+ guint i, fr, gr, size, nWords;
+ int nParm = sig->hasthis + sig->param_count;
+ guint32 simpletype, align;
+ CallInfo *cinfo = g_malloc0 (sizeof (CallInfo) + sizeof (ArgInfo) * nParm);
+
+ fr = 0;
+ gr = s390_r2;
+ nParm = 0;
+ cinfo->struct_ret = 0;
+ sz->retStruct = 0;
+ sz->stack_size = S390_MINIMAL_STACK_SIZE;
+ sz->code_size = 0;
+ sz->local_size = 0;
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the return code/stack in case we*/
+ /* need to reserve a register to be used to address a stack */
+ /* area that the callee will use. */
+ /*----------------------------------------------------------*/
+
+ simpletype = sig->ret->type;
+enum_retvalue:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_STRING:
+ cinfo->ret.reg = s390_r2;
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ cinfo->ret.reg = s390_f0;
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ cinfo->ret.reg = s390_r2;
+ sz->code_size += 4;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->ret->data.klass->enumtype) {
+ simpletype = sig->ret->data.klass->enum_basetype->type;
+ goto enum_retvalue;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->ret->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->ret->data.klass, &align);
+ cinfo->ret.reg = s390_r2;
+ cinfo->struct_ret = 1;
+ cinfo->ret.size = size;
+ cinfo->ret.vtsize = size;
+ cinfo->ret.offset = sz->stack_size;
+ sz->stack_size += S390_ALIGN(size, align);
+ gr++;
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+
+ if (sig->hasthis) {
+ add_general (&gr, sz, cinfo->args+nParm);
+ cinfo->args[nParm].size = sizeof(gpointer);
+ nParm++;
+ }
+
+ /*----------------------------------------------------------*/
+ /* We determine the size of the parameter code and stack */
+ /* requirements by checking the types and sizes of the */
+ /* parameters. */
+ /*----------------------------------------------------------*/
+
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref) {
+ add_general (&gr, sz, cinfo->args+nParm);
+ cinfo->args[nParm].size = sizeof(gpointer);
+ nParm++;
+ continue;
+ }
+ simpletype = sig->params [i]->type;
+ enum_calc_size:
+ switch (simpletype) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ cinfo->args[nParm].size = sizeof(char);
+ add_general (&gr, sz, cinfo->args+nParm);
+ nParm++;
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ cinfo->args[nParm].size = sizeof(short);
+ add_general (&gr, sz, cinfo->args+nParm);
+ nParm++;
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ cinfo->args[nParm].size = sizeof(int);
+ add_general (&gr, sz, cinfo->args+nParm);
+ nParm++;
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ cinfo->args[nParm].size = sizeof(gpointer);
+ add_general (&gr, sz, cinfo->args+nParm);
+ nParm++;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (sig->params [i]->data.klass->enumtype) {
+ simpletype = sig->params [i]->data.klass->enum_basetype->type;
+ goto enum_calc_size;
+ }
+ if (sig->pinvoke)
+ size = mono_class_native_size (sig->params [i]->data.klass, &align);
+ else
+ size = mono_class_value_size (sig->params [i]->data.klass, &align);
+ nWords = (size + sizeof(gpointer) - 1) /
+ sizeof(gpointer);
+
+ cinfo->args[nParm].vtsize = 0;
+ cinfo->args[nParm].size = 0;
+ cinfo->args[nParm].offparm = sz->local_size;
+
+ switch (size) {
+ /*----------------------------------*/
+ /* On S/390, structures of size 1, */
+ /* 2, 4, and 8 bytes are passed in */
+ /* (a) register(s). */
+ /*----------------------------------*/
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ add_general(&gr, sz, cinfo->args+nParm);
+ cinfo->args[nParm].size = size;
+ cinfo->args[nParm].regtype = RegTypeStructByVal;
+ nParm++;
+ sz->local_size += sizeof(long);
+ break;
+ case 8:
+ add_general(&gr, sz, cinfo->args+nParm);
+ cinfo->args[nParm].size = sizeof(long long);
+ cinfo->args[nParm].regtype = RegTypeStructByVal;
+ nParm++;
+ sz->local_size += sizeof(long);
+ break;
+ default:
+ add_general(&gr, sz, cinfo->args+nParm);
+ cinfo->args[nParm].size = sizeof(gpointer);
+ cinfo->args[nParm].regtype = RegTypeStructByAddr;
+ cinfo->args[nParm].vtsize = size;
+ sz->code_size += 40;
+ sz->local_size += size;
+ if (cinfo->args[nParm].reg == STK_BASE)
+ sz->local_size += sizeof(gpointer);
+ nParm++;
+ }
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ cinfo->args[nParm].size = sizeof(long long);
+ add_general (&gr, sz, cinfo->args+nParm);
+ nParm++;
+ break;
+ case MONO_TYPE_R4:
+ cinfo->args[nParm].size = sizeof(float);
+ if (fr <= S390_LAST_FPARG_REG) {
+ cinfo->args[nParm].regtype = RegTypeFP;
+ cinfo->args[nParm].reg = fr;
+ sz->code_size += 4;
+ fr += 2;
+ }
+ else {
+ cinfo->args[nParm].offset = sz->stack_size;
+ cinfo->args[nParm].reg = STK_BASE;
+ cinfo->args[nParm].regtype = RegTypeBase;
+ sz->code_size += 4;
+ sz->stack_size += sizeof(float);
+ }
+ nParm++;
+ break;
+ case MONO_TYPE_R8:
+ cinfo->args[nParm].size = sizeof(double);
+ if (fr <= S390_LAST_FPARG_REG) {
+ cinfo->args[nParm].regtype = RegTypeFP;
+ cinfo->args[nParm].reg = fr;
+ sz->code_size += 4;
+ fr += 2;
+ } else {
+ cinfo->args[nParm].offset = sz->stack_size;
+ cinfo->args[nParm].reg = STK_BASE;
+ cinfo->args[nParm].regtype = RegTypeBase;
+ sz->code_size += 4;
+ sz->stack_size += sizeof(double);
+ }
+ nParm++;
+ break;
+ default:
+ g_error ("Can't trampoline 0x%x", sig->params [i]->type);
+ }
+ }
+
+ cinfo->stack_usage = S390_ALIGN(sz->stack_size+sz->local_size,
+ S390_STACK_ALIGNMENT);
+ return (cinfo);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_allocate_vars */
+/* */
+/* Function - Set var information according to the calling */
+/* convention for S/390. The local var stuff should */
+/* most likely be split in another method. */
+/* */
+/* Parameter - @m - Compile unit. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_allocate_vars (MonoCompile *m)
+{
+ MonoMethodSignature *sig;
+ MonoMethodHeader *header;
+ MonoInst *inst;
+ CallInfo *cinfo;
+ size_data sz;
+ int iParm, iVar, offset, size, align, curinst;
+ int frame_reg = STK_BASE;
+ int sArg, eArg;
+
+ header = mono_method_get_header (m->method);
+
+ /*---------------------------------------------------------*/
+ /* We use the frame register also for any method that has */
+ /* filter clauses. This way, when the handlers are called, */
+ /* the code will reference local variables using the frame */
+ /* reg instead of the stack pointer: if we had to restore */
+ /* the stack pointer, we'd corrupt the method frames that */
+ /* are already on the stack (since filters get called */
+ /* before stack unwinding happens) when the filter code */
+ /* would call any method. */
+ /*---------------------------------------------------------*/
+ if ((m->flags & MONO_CFG_HAS_ALLOCA) || header->num_clauses)
+ frame_reg = s390_r11;
+
+ m->frame_reg = frame_reg;
+
+ if (frame_reg != STK_BASE)
+ m->used_int_regs |= 1 << frame_reg;
+
+ sig = m->method->signature;
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ if (cinfo->struct_ret) {
+ m->ret->opcode = OP_REGVAR;
+ m->ret->inst_c0 = s390_r2;
+ } else {
+ /* FIXME: handle long and FP values */
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ m->ret->opcode = OP_REGVAR;
+ m->ret->dreg = s390_r2;
+ break;
+ }
+ }
+
+ /*--------------------------------------------------------------*/
+ /* local vars are at a positive offset from the stack pointer */
+ /* */
+ /* also note that if the function uses alloca, we use s390_r11 */
+ /* to point at the local variables. */
+ /* add parameter area size for called functions */
+ /*--------------------------------------------------------------*/
+ offset = (m->param_area + S390_MINIMAL_STACK_SIZE);
+
+ if (cinfo->struct_ret) {
+ inst = m->ret;
+ offset = S390_ALIGN(offset, sizeof(gpointer));
+ inst->inst_offset = offset;
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset += sizeof(gpointer);
+ }
+
+ if (sig->hasthis) {
+ inst = m->varinfo [0];
+ if (inst->opcode != OP_REGVAR) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset = S390_ALIGN(offset, sizeof(gpointer));
+ inst->inst_offset = offset;
+ offset += sizeof (gpointer);
+ }
+ curinst = sArg = 1;
+ } else {
+ curinst = sArg = 0;
+ }
+
+ eArg = sig->param_count + sArg;
+
+ for (iParm = sArg; iParm < eArg; ++iParm) {
+ inst = m->varinfo [curinst];
+ if (inst->opcode != OP_REGVAR) {
+ switch (cinfo->args[iParm].regtype) {
+ case RegTypeStructByAddr :
+ inst->opcode = OP_S390_LOADARG;
+ inst->inst_basereg = frame_reg;
+ size = abs(cinfo->args[iParm].vtsize);
+ offset = S390_ALIGN(offset, size);
+ inst->inst_offset = offset;
+ break;
+ case RegTypeStructByVal :
+ inst->opcode = OP_S390_ARGPTR;
+ inst->inst_basereg = frame_reg;
+ size = cinfo->args[iParm].size;
+ offset = S390_ALIGN(offset, size);
+ inst->inst_offset = offset;
+ break;
+ default :
+ if (cinfo->args[iParm].reg != STK_BASE) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ size = (cinfo->args[iParm].size < 8
+ ? sizeof(long)
+ : sizeof(long long));
+ offset = S390_ALIGN(offset, size);
+ inst->inst_offset = offset;
+ } else {
+ inst->opcode = OP_S390_STKARG;
+ inst->inst_basereg = frame_reg;
+ size = (cinfo->args[iParm].size < 4
+ ? 4 - cinfo->args[iParm].size
+ : 0);
+ inst->inst_offset = cinfo->args[iParm].offset +
+ size;
+ inst->unused = 0;
+ size = sizeof(long);
+ }
+ }
+ offset += size;
+ }
+ curinst++;
+ }
+
+ curinst = m->locals_start;
+ for (iVar = curinst; iVar < m->num_varinfo; ++iVar) {
+ inst = m->varinfo [iVar];
+ if (inst->opcode == OP_REGVAR)
+ continue;
+
+ /*--------------------------------------------------*/
+ /* inst->unused indicates native sized value types, */
+ /* this is used by the pinvoke wrappers when they */
+ /* call functions returning structure */
+ /*--------------------------------------------------*/
+ if (inst->unused && MONO_TYPE_ISSTRUCT (inst->inst_vtype))
+ size = mono_class_native_size (inst->inst_vtype->data.klass, &align);
+ else
+ size = mono_type_size (inst->inst_vtype, &align);
+
+ offset = S390_ALIGN(offset, align);
+ inst->inst_offset = offset;
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = frame_reg;
+ offset += size;
+ //DEBUG (g_print("allocating local %d to %d\n", iVar, inst->inst_offset));
+ }
+
+ /*------------------------------------------------------*/
+ /* Allow space for the trace method stack area if needed*/
+ /*------------------------------------------------------*/
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (m))
+ offset += S390_TRACE_STACK_SIZE;
+
+ /*------------------------------------------------------*/
+ /* Reserve space to save LMF and caller saved registers */
+ /*------------------------------------------------------*/
+ if (m->method->save_lmf)
+ offset += sizeof (MonoLMF);
+
+ /*------------------------------------------------------*/
+ /* align the offset */
+ /*------------------------------------------------------*/
+ m->stack_offset = S390_ALIGN(offset, S390_STACK_ALIGNMENT);
+ g_free(cinfo);
+
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_call_opcode */
+/* */
+/* Function - Take the arguments and generate the arch-specific */
+/* instructions to properly call the function. This */
+/* includes pushing, moving argments to the correct */
+/* etc. */
+/* */
+/* Note - FIXME: We need an alignment solution for */
+/* enter_method and mono_arch_call_opcode, currently */
+/* alignment in mono_arch_call_opcode is computed */
+/* without arch_get_argument_info. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoCallInst*
+mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
+ MonoCallInst *call, int is_virtual) {
+ MonoInst *arg, *in;
+ MonoMethodSignature *sig;
+ int i, n, lParamArea;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+ size_data sz;
+
+ sig = call->signature;
+ n = sig->param_count + sig->hasthis;
+ DEBUG (g_print ("Call requires: %d parameters\n",n));
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ call->stack_usage = cinfo->stack_usage;
+ lParamArea = cinfo->stack_usage - S390_MINIMAL_STACK_SIZE;
+ cfg->param_area = MAX (cfg->param_area, lParamArea);
+ cfg->flags |= MONO_CFG_HAS_CALLS;
+
+ if (cinfo->struct_ret)
+ call->used_iregs |= 1 << cinfo->struct_ret;
+
+ for (i = 0; i < n; ++i) {
+ ainfo = cinfo->args + i;
+ DEBUG (g_print ("Parameter %d - Register: %d Type: %d\n",
+ i+1,ainfo->reg,ainfo->regtype));
+ if (is_virtual && i == 0) {
+ /* the argument will be attached to the call instrucion */
+ in = call->args [i];
+ call->used_iregs |= 1 << ainfo->reg;
+ } else {
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ in = call->args [i];
+ arg->cil_code = in->cil_code;
+ arg->inst_left = in;
+ arg->type = in->type;
+ /* prepend, we'll need to reverse them later */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ if (ainfo->regtype == RegTypeGeneral) {
+ arg->unused = ainfo->reg;
+ call->used_iregs |= 1 << ainfo->reg;
+ } else if (ainfo->regtype == RegTypeStructByAddr) {
+ call->used_iregs |= 1 << ainfo->reg;
+ arg->sreg1 = ainfo->reg;
+ arg->opcode = OP_OUTARG_VT;
+ arg->unused = -ainfo->vtsize;
+ arg->inst_imm = ainfo->offset;
+ arg->sreg2 = ainfo->offparm + S390_MINIMAL_STACK_SIZE;
+ } else if (ainfo->regtype == RegTypeStructByVal) {
+ if (ainfo->reg != STK_BASE) {
+ call->used_iregs |= 1 << ainfo->reg;
+ }
+ arg->sreg1 = ainfo->reg;
+ arg->opcode = OP_OUTARG_VT;
+ arg->unused = ainfo->size;
+ arg->inst_imm = ainfo->offset;
+ arg->sreg2 = ainfo->offparm + S390_MINIMAL_STACK_SIZE;
+ } else if (ainfo->regtype == RegTypeBase) {
+ arg->opcode = OP_OUTARG;
+ arg->unused = ainfo->reg | (ainfo->size << 8);
+ arg->inst_imm = ainfo->offset;
+ call->used_fregs |= 1 << ainfo->reg;
+ } else if (ainfo->regtype == RegTypeFP) {
+ arg->unused = ainfo->reg;
+ call->used_fregs |= 1 << ainfo->reg;
+ if (ainfo->size == 4) {
+ MonoInst *conv;
+ arg->opcode = OP_OUTARG_R4;
+ MONO_INST_NEW (cfg, conv, OP_FCONV_TO_R4);
+ conv->inst_left = arg->inst_left;
+ arg->inst_left = conv;
+ }
+ else
+ arg->opcode = OP_OUTARG_R8;
+ } else {
+ g_assert_not_reached ();
+ }
+ }
+ }
+ /*
+ * Reverse the call->out_args list.
+ */
+ {
+ MonoInst *prev = NULL, *list = call->out_args, *next;
+ while (list) {
+ next = list->next;
+ list->next = prev;
+ prev = list;
+ list = next;
+ }
+ call->out_args = prev;
+ }
+
+ g_free (cinfo);
+ return call;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_instrument_mem_needs */
+/* */
+/* Function - Allow tracing to work with this interface (with */
+/* an optional argument). */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code)
+{
+ /* no stack room needed now (may be needed for FASTCALL-trace support) */
+ *stack = 0;
+ /* split prolog-epilog requirements? */
+ *code = 50; /* max bytes needed: check this number */
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_instrument_prolog */
+/* */
+/* Function - Create an "instrumented" prolog. */
+/* */
+/*------------------------------------------------------------------*/
+
+void*
+mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p,
+ gboolean enable_arguments)
+{
+ guchar *code = p;
+ int parmOffset,
+ fpOffset;
+
+ parmOffset = cfg->stack_usage - S390_TRACE_STACK_SIZE;
+ if (cfg->method->save_lmf)
+ parmOffset -= sizeof(MonoLMF);
+ fpOffset = parmOffset + (5*sizeof(long));
+
+ s390_stmg (code, s390_r2, s390_r6, STK_BASE, parmOffset);
+ s390_std (code, s390_f0, 0, STK_BASE, fpOffset);
+ s390_std (code, s390_f1, 0, STK_BASE, fpOffset+sizeof(gdouble));
+ s390_std (code, s390_f2, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 10);
+ s390_llong(code, cfg->method);
+ s390_llong(code, func);
+ s390_lg (code, s390_r2, 0, s390_r13, 4);
+ s390_la (code, s390_r3, 0, STK_BASE, parmOffset);
+ s390_lgr (code, s390_r4, STK_BASE);
+ s390_aghi (code, s390_r4, cfg->stack_usage);
+ s390_lg (code, s390_r1, 0, s390_r13, 12);
+ s390_basr (code, s390_r14, s390_r1);
+ s390_ld (code, s390_f2, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
+ s390_ld (code, s390_f1, 0, STK_BASE, fpOffset+sizeof(gdouble));
+ s390_ld (code, s390_f0, 0, STK_BASE, fpOffset);
+ s390_lmg (code, s390_r2, s390_r6, STK_BASE, parmOffset);
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_instrument_epilog */
+/* */
+/* Function - Create an epilog that will handle the returned */
+/* values used in instrumentation. */
+/* */
+/*------------------------------------------------------------------*/
+
+void*
+mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+ int save_mode = SAVE_NONE,
+ saveOffset;
+ MonoMethod *method = cfg->method;
+ int rtype = method->signature->ret->type;
+
+ saveOffset = cfg->stack_usage - S390_TRACE_STACK_SIZE;
+ if (method->save_lmf)
+ saveOffset -= sizeof(MonoLMF);
+
+handle_enum:
+ switch (rtype) {
+ case MONO_TYPE_VOID:
+ /* special case string .ctor icall */
+ if (strcmp (".ctor", method->name) && method->klass == mono_defaults.string_class)
+ save_mode = SAVE_ONE;
+ else
+ save_mode = SAVE_NONE;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ save_mode = SAVE_TWO;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ save_mode = SAVE_FP;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (method->signature->ret->data.klass->enumtype) {
+ rtype = method->signature->ret->data.klass->enum_basetype->type;
+ goto handle_enum;
+ }
+ save_mode = SAVE_STRUCT;
+ break;
+ default:
+ save_mode = SAVE_ONE;
+ break;
+ }
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ s390_stg (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ if (enable_arguments)
+ s390_lgr (code, s390_r3, s390_r2);
+ break;
+ case SAVE_ONE:
+ s390_stg (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ if (enable_arguments)
+ s390_lgr (code, s390_r3, s390_r2);
+ break;
+ case SAVE_FP:
+ s390_std (code, s390_f0, 0, cfg->frame_reg, saveOffset);
+ if (enable_arguments) {
+ /* FIXME: what reg? */
+ s390_ldr (code, s390_f2, s390_f0);
+ s390_lg (code, s390_r3, 0, cfg->frame_reg, saveOffset);
+ }
+ break;
+ case SAVE_STRUCT:
+ s390_stg (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ if (enable_arguments)
+ s390_lg (code, s390_r3, 0, cfg->frame_reg,
+ S390_MINIMAL_STACK_SIZE+cfg->param_area);
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 10);
+ s390_llong(code, cfg->method);
+ s390_llong(code, func);
+ s390_lg (code, s390_r2, 0, s390_r13, 4);
+ s390_lg (code, s390_r1, 0, s390_r13, 12);
+ s390_basr (code, s390_r14, s390_r1);
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ s390_lg (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_ONE:
+ s390_lg (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_FP:
+ s390_ld (code, s390_f0, 0, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_STRUCT:
+ s390_lg (code, s390_r2, 0, cfg->frame_reg, saveOffset);
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - peephole_pass */
+/* */
+/* Function - Form a peephole pass at the code looking for */
+/* simple optimizations. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins, *last_ins = NULL;
+ ins = bb->code;
+
+ while (ins) {
+
+ switch (ins->opcode) {
+ case OP_MUL_IMM:
+ /* remove unnecessary multiplication with 1 */
+ if (ins->inst_imm == 1) {
+ if (ins->dreg != ins->sreg1) {
+ ins->opcode = OP_MOVE;
+ } else {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ }
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ /*
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG
+ || last_ins->opcode == OP_STORE_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+
+ /*
+ * Note: reg1 must be different from the basereg in the second load
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_MOVE reg1, reg2
+ */
+ } if (last_ins && (last_ins->opcode == OP_LOADI4_MEMBASE
+ || last_ins->opcode == OP_LOAD_MEMBASE) &&
+ ins->inst_basereg != last_ins->dreg &&
+ ins->inst_basereg == last_ins->inst_basereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+
+ if (ins->dreg == last_ins->dreg) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->dreg;
+ }
+ }
+ break;
+ case OP_LOADU1_MEMBASE:
+ case OP_LOADI1_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI1_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case OP_LOADU2_MEMBASE:
+ case OP_LOADI2_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI2_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case CEE_CONV_OVF_U4:
+ case OP_MOVE:
+ /*
+ * OP_MOVE reg, reg
+ */
+ if (ins->dreg == ins->sreg1) {
+ if (last_ins)
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ /*
+ * OP_MOVE sreg, dreg
+ * OP_MOVE dreg, sreg
+ */
+ if (last_ins && last_ins->opcode == OP_MOVE &&
+ ins->sreg1 == last_ins->dreg &&
+ ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ break;
+ }
+ last_ins = ins;
+ ins = ins->next;
+ }
+ bb->last_ins = last_ins;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_spillvar_offset */
+/* */
+/* Function - Returns the offset used by spillvar. It allocates */
+/* a new spill variable if necessary. */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+mono_spillvar_offset (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ info->offset = cfg->stack_offset;
+ cfg->stack_offset += sizeof (gpointer);
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_spillvar_offset_float */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+mono_spillvar_offset_float (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info_float;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset = S390_ALIGN(cfg->stack_offset, S390_STACK_ALIGNMENT);
+ info->offset = cfg->stack_offset;
+ cfg->stack_offset += sizeof (double);
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - print_ins */
+/* */
+/* Function - Decode and print the instruction for tracing. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+print_ins (int i, MonoInst *ins)
+{
+ const char *spec = ins_spec [ins->opcode];
+ g_print ("\t%-2d %s", i, mono_inst_name (ins->opcode));
+ if (spec [MONO_INST_DEST]) {
+ if (ins->dreg >= MONO_MAX_IREGS)
+ g_print (" R%d <-", ins->dreg);
+ else
+ g_print (" %s <-", mono_arch_regname (ins->dreg));
+ }
+ if (spec [MONO_INST_SRC1]) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg1);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg1));
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg2);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg2));
+ }
+ if (spec [MONO_INST_CLOB])
+ g_print (" clobbers: %c", spec [MONO_INST_CLOB]);
+ g_print ("\n");
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - print_regtrack. */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+print_regtrack (RegTrack *t, int num)
+{
+ int i;
+ char buf [32];
+ const char *r;
+
+ for (i = 0; i < num; ++i) {
+ if (!t [i].born_in)
+ continue;
+ if (i >= MONO_MAX_IREGS) {
+ g_snprintf (buf, sizeof(buf), "R%d", i);
+ r = buf;
+ } else
+ r = mono_arch_regname (i);
+ g_print ("liveness: %s [%d - %d]\n", r, t [i].born_in, t[i].last_use);
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - inst_list_prepend */
+/* */
+/* Function - Prepend an instruction to the list. */
+/* */
+/*------------------------------------------------------------------*/
+
+static inline InstList*
+inst_list_prepend (MonoMemPool *pool, InstList *list, MonoInst *data)
+{
+ InstList *item = mono_mempool_alloc (pool, sizeof (InstList));
+ item->data = data;
+ item->prev = NULL;
+ item->next = list;
+ if (list)
+ list->prev = item;
+ return item;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_register_force_spilling */
+/* */
+/* Function - Force the spilling of the variable in the */
+/* symbolic register 'reg'. */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+get_register_force_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ sel = cfg->rs->iassign [reg];
+ i = reg;
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /*----------------------------------------------------------*/
+ /* we need to create a spill var and insert a load to sel */
+ /* after the current instruction */
+ /*----------------------------------------------------------*/
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n",
+ spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_register_spilling */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+get_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 &&
+ (reg_is_freeable (ins->sreg1) ||
+ (ins->sreg1 >= MONO_MAX_IREGS &&
+ cfg->rs->iassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 &&
+ (reg_is_freeable (ins->sreg2) ||
+ (ins->sreg2 >= MONO_MAX_IREGS &&
+ cfg->rs->iassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && reg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->iassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->isymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_float_register_spilling */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+get_float_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 &&
+ (freg_is_freeable (ins->sreg1) ||
+ (ins->sreg1 >= MONO_MAX_FREGS &&
+ cfg->rs->fassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 &&
+ (freg_is_freeable (ins->sreg2) ||
+ (ins->sreg2 >= MONO_MAX_FREGS &&
+ cfg->rs->fassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && freg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_FREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n",
+ mono_arch_regname (sel), cfg->rs->fassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->fsymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->fassign [i] = -spill - 1;
+ mono_regstate_free_float(cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOADR8_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%sp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_float (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_copy_ins */
+/* */
+/* Function - Create an instruction to copy from reg to reg. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_copy_ins (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n",
+ mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_copy_ins_float */
+/* */
+/* Function - Create an instruction to copy from float reg to */
+/* float reg. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_copy_ins_float (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_FMOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n",
+ mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_spilled_store */
+/* */
+/* Function - Spill register to storage. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_spilled_store (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORE_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE (%d at 0x%08x(%%sp)) R%d (from %s)\n",
+ spill, store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_spilled_store_float */
+/* */
+/* Function - Spill floating point register to storage. */
+/* */
+/*------------------------------------------------------------------*/
+
+static MonoInst*
+create_spilled_store_float (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORER8_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE (%d at 0x%08x(%%sp)) R%d (from %s)\n",
+ spill, store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - insert_before_ins */
+/* */
+/* Function - Insert an instruction before another. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+insert_before_ins (MonoInst *ins, InstList *item, MonoInst* to_insert)
+{
+ MonoInst *prev;
+ g_assert (item->next);
+ prev = item->next->data;
+
+ while (prev->next != ins)
+ prev = prev->next;
+ to_insert->next = ins;
+ prev->next = to_insert;
+ /*
+ * needed otherwise in the next instruction we can add an ins to the
+ * end and that would get past this instruction.
+ */
+ item->data = to_insert;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - alloc_int_reg */
+/* */
+/* Function - Allocate a general register. */
+/* */
+/*------------------------------------------------------------------*/
+
+static int
+alloc_int_reg (MonoCompile *cfg, InstList *curinst, MonoInst *ins, int sym_reg, guint32 allow_mask)
+{
+ int val = cfg->rs->iassign [sym_reg];
+ DEBUG (g_print ("Allocating a general register for %d (%d) with mask %08x\n",val,sym_reg,allow_mask));
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (cfg->rs, allow_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, curinst, ins, allow_mask, sym_reg);
+ cfg->rs->iassign [sym_reg] = val;
+ /* add option to store before the instruction for src registers */
+ if (spill)
+ create_spilled_store (cfg, spill, val, sym_reg, ins);
+ }
+ DEBUG (g_print ("Allocated %d for %d\n",val,sym_reg));
+ cfg->rs->isymbolic [val] = sym_reg;
+ return val;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_local_regalloc. */
+/* */
+/* Function - We first scan the list of instructions and we */
+/* save the liveness information of each register */
+/* (when the register is first used, when its value */
+/* is set etc.). We also reverse the list of instr- */
+/* uctions (in the InstList list) because assigning */
+/* registers backwards allows for more tricks to be */
+/* used. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoRegState *rs = cfg->rs;
+ int i, val;
+ RegTrack *reginfo, *reginfof;
+ RegTrack *reginfo1, *reginfo2, *reginfod;
+ InstList *tmp, *reversed = NULL;
+ const char *spec;
+ guint32 src1_mask, src2_mask, dest_mask;
+ guint32 cur_iregs, cur_fregs;
+
+ if (!bb->code)
+ return;
+ rs->next_vireg = bb->max_ireg;
+ rs->next_vfreg = bb->max_freg;
+ mono_regstate_assign (rs);
+ reginfo = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vireg);
+ reginfof = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vfreg);
+ rs->ifree_mask = S390_CALLER_REGS;
+ rs->ffree_mask = S390_CALLER_FREGS;
+
+ ins = bb->code;
+ i = 1;
+ DEBUG (g_print ("LOCAL regalloc: basic block: %d\n", bb->block_num));
+ /* forward pass on the instructions to collect register liveness info */
+ while (ins) {
+ spec = ins_spec [ins->opcode];
+ DEBUG (print_ins (i, ins));
+ if (spec [MONO_INST_CLOB] == 'c') {
+ MonoCallInst * call = (MonoCallInst*)ins;
+ int j;
+ }
+ if (spec [MONO_INST_SRC1]) {
+ if (spec [MONO_INST_SRC1] == 'f')
+ reginfo1 = reginfof;
+ else
+ reginfo1 = reginfo;
+ reginfo1 [ins->sreg1].prev_use = reginfo1 [ins->sreg1].last_use;
+ reginfo1 [ins->sreg1].last_use = i;
+ } else {
+ ins->sreg1 = -1;
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (spec [MONO_INST_SRC2] == 'f')
+ reginfo2 = reginfof;
+ else
+ reginfo2 = reginfo;
+ reginfo2 [ins->sreg2].prev_use = reginfo2 [ins->sreg2].last_use;
+ reginfo2 [ins->sreg2].last_use = i;
+ } else {
+ ins->sreg2 = -1;
+ }
+ if (spec [MONO_INST_DEST]) {
+ if (spec [MONO_INST_DEST] == 'f')
+ reginfod = reginfof;
+ else
+ reginfod = reginfo;
+ if (spec [MONO_INST_DEST] != 'b') /* it's not just a base register */
+ reginfod [ins->dreg].killed_in = i;
+ reginfod [ins->dreg].prev_use = reginfod [ins->dreg].last_use;
+ reginfod [ins->dreg].last_use = i;
+ if (reginfod [ins->dreg].born_in == 0 || reginfod [ins->dreg].born_in > i)
+ reginfod [ins->dreg].born_in = i;
+#if 0
+ if (spec [MONO_INST_DEST] == 'l') {
+ /* result in eax:edx, the virtual register is allocated sequentially */
+ reginfod [ins->dreg + 1].prev_use = reginfod [ins->dreg + 1].last_use;
+ reginfod [ins->dreg + 1].last_use = i;
+ if (reginfod [ins->dreg + 1].born_in == 0 || reginfod [ins->dreg + 1].born_in > i)
+ reginfod [ins->dreg + 1].born_in = i;
+ }
+#endif
+ } else {
+ ins->dreg = -1;
+ }
+ reversed = inst_list_prepend (cfg->mempool, reversed, ins);
+ ++i;
+ ins = ins->next;
+ }
+
+ cur_iregs = S390_CALLER_REGS;
+ cur_fregs = S390_CALLER_FREGS;
+
+ DEBUG (print_regtrack (reginfo, rs->next_vireg));
+ DEBUG (print_regtrack (reginfof, rs->next_vfreg));
+ tmp = reversed;
+ while (tmp) {
+ int prev_dreg, prev_sreg1, prev_sreg2;
+ --i;
+ ins = tmp->data;
+ spec = ins_spec [ins->opcode];
+ DEBUG (g_print ("processing:"));
+ DEBUG (print_ins (i, ins));
+ /* make the register available for allocation: FIXME add fp reg */
+ if (ins->opcode == OP_SETREG || ins->opcode == OP_SETREGIMM) {
+ cur_iregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_iregs\n", ins->dreg));
+ } else if (ins->opcode == OP_SETFREG) {
+ cur_fregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_fregs\n", ins->dreg));
+ } else if (spec [MONO_INST_CLOB] == 'c') {
+ MonoCallInst *cinst = (MonoCallInst*)ins;
+ DEBUG (g_print ("excluding regs 0x%x from cur_iregs (0x%x)\n",
+ cinst->used_iregs, cur_iregs));
+ DEBUG (g_print ("excluding fpregs 0x%x from cur_fregs (0x%x)\n",
+ cinst->used_fregs, cur_fregs));
+ cur_iregs &= ~cinst->used_iregs;
+ cur_fregs &= ~cinst->used_fregs;
+ DEBUG (g_print ("available cur_iregs: 0x%x\n", cur_iregs));
+ DEBUG (g_print ("available cur_fregs: 0x%x\n", cur_fregs));
+ /*------------------------------------------------------------*/
+ /* registers used by the calling convention are excluded from */
+ /* allocation: they will be selectively enabled when they are */
+ /* assigned by the special SETREG opcodes. */
+ /*------------------------------------------------------------*/
+ }
+ dest_mask = src1_mask = src2_mask = cur_iregs;
+ /*------------------------------------------------------*/
+ /* update for use with FP regs... */
+ /*------------------------------------------------------*/
+ if (spec [MONO_INST_DEST] == 'f') {
+ dest_mask = cur_fregs;
+ if (ins->dreg >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_float (rs, dest_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->fassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n",
+ mono_arch_regname (val), ins->dreg));
+ rs->fsymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (spec [MONO_INST_CLOB] == 'c' && ins->dreg != s390_f0) {
+ /* this instruction only outputs to s390_f0, need to copy */
+ create_copy_ins_float (cfg, ins->dreg, s390_f0, ins);
+ }
+ } else {
+ prev_dreg = -1;
+ }
+ if (freg_is_freeable (ins->dreg) && prev_dreg >= 0 && (reginfof [prev_dreg].born_in >= i || !(cur_fregs & (1 << ins->dreg)))) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ }
+ } else if (ins->dreg >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d (prev: R%d)\n",
+ mono_arch_regname (val), ins->dreg, prev_dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (spec [MONO_INST_DEST] == 'l') {
+ if (ins->dreg != s390_r2)
+ create_copy_ins (cfg, ins->dreg, s390_r2, ins);
+#if 0
+ int hreg = prev_dreg + 1;
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, hreg);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins);
+ }
+ DEBUG (g_print ("\tassigned hreg %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+// #if 0
+ /* FIXME:? ins->dreg = val; */
+ if (ins->dreg == s390_r3) {
+ if (val != s390_r2)
+ create_copy_ins (cfg, val, s390_r2, ins);
+ } else if (ins->dreg == s390_r2) {
+ if (val == s390_r3) {
+ /* swap */
+ create_copy_ins (cfg, s390_r3, s390_r0, ins);
+ create_copy_ins (cfg, s390_r2, s390_r3, ins);
+ create_copy_ins (cfg, s390_r0, s390_r2, ins);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, ins->dreg, s390_r3, ins);
+ create_copy_ins (cfg, val, s390_r2, ins);
+ }
+ } else {
+ if (val == s390_r2) {
+ create_copy_ins (cfg, ins->dreg, s390_r2, ins);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, val, s390_r2, ins);
+ create_copy_ins (cfg, ins->dreg, s390_r3, ins);
+ }
+ }
+// #endif
+ if (reg_is_freeable (val) && !(cur_iregs & (1 << val))) {
+ DEBUG (g_print ("\tfreeable %s (R%d)\n", mono_arch_regname (val), val));
+ mono_regstate_free_int (rs, val);
+ }
+#endif
+ } else if (spec [MONO_INST_DEST] == 'a' && ins->dreg != s390_r2 && spec [MONO_INST_CLOB] != 'd') {
+ /* this instruction only outputs to s390_r2, need to copy */
+ create_copy_ins (cfg, ins->dreg, s390_r2, ins);
+ }
+ } else {
+ prev_dreg = -1;
+ }
+ if (spec [MONO_INST_DEST] == 'f' &&
+ freg_is_freeable (ins->dreg) &&
+ prev_dreg >= 0 && (reginfof [prev_dreg].born_in >= i)) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ } else if (spec [MONO_INST_DEST] != 'f' &&
+ reg_is_freeable (ins->dreg) &&
+ prev_dreg >= 0 && (reginfo [prev_dreg].born_in >= i)) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_int (rs, ins->dreg);
+ }
+ if (spec [MONO_INST_SRC1] == 'f') {
+ src1_mask = cur_fregs;
+ if (ins->sreg1 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ //g_assert (val == -1); /* source cannot be spilled */
+ val = mono_regstate_alloc_float (rs, src1_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src1_mask, ins->sreg1);
+ rs->fassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ if (spill) {
+ MonoInst *store = create_spilled_store_float (cfg, spill, val, prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->fsymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ } else if (ins->sreg1 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, src1_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins,
+ src1_mask,
+ ins->sreg1);
+ rs->iassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n",
+ mono_arch_regname (val), ins->sreg1));
+ if (spill) {
+ MonoInst *store;
+ store = create_spilled_store (cfg, spill, val,
+ prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->isymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ /*----------------------------------------------*/
+ /* handle clobbering of sreg1 */
+ /*----------------------------------------------*/
+ if ((spec [MONO_INST_CLOB] == '1' ||
+ spec [MONO_INST_CLOB] == 's') &&
+ ins->dreg != ins->sreg1) {
+ MonoInst *copy;
+ copy = create_copy_ins (cfg, ins->dreg, ins->sreg1, NULL);
+ DEBUG (g_print ("\tneed to copy sreg1 %s to dreg %s\n",
+ mono_arch_regname (ins->sreg1),
+ mono_arch_regname (ins->dreg)));
+ if (ins->sreg2 == -1 || spec [MONO_INST_CLOB] == 's') {
+ /* note: the copy is inserted before the current instruction! */
+ insert_before_ins (ins, tmp, copy);
+ /* we set sreg1 to dest as well */
+ prev_sreg1 = ins->sreg1 = ins->dreg;
+ } else {
+ /* inserted after the operation */
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ }
+
+ if (spec [MONO_INST_SRC2] == 'f') {
+ src2_mask = cur_fregs;
+ if (ins->sreg2 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_float (rs, src2_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->fassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->fsymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+ } else if (ins->sreg2 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, src2_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->iassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->isymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ int j, s;
+ guint32 clob_mask = S390_CALLER_REGS;
+ for (j = 0; j < MONO_MAX_IREGS; ++j) {
+ s = 1 << j;
+ if ((clob_mask & s) && !(rs->ifree_mask & s) && j != ins->sreg1) {
+ }
+ }
+ }
+ tmp = tmp->next;
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - emit_float_to_int */
+/* */
+/* Function - Create instructions which will convert a floating */
+/* point value to integer. */
+/* */
+/*------------------------------------------------------------------*/
+
+static guchar*
+emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size, gboolean is_signed)
+{
+ /* sreg is a float, dreg is an integer reg. */
+ if (is_signed) {
+ s390_cfdbr (code, dreg, 5, sreg);
+ switch (size) {
+ case 1:
+ s390_lghi (code, s390_r0, 0);
+ s390_lghi (code, s390_r13, 0xff);
+ s390_ltgr (code, dreg, dreg);
+ s390_jnl (code, 6);
+ s390_lhi (code, s390_r0, 0x80);
+ s390_ngr (code, dreg, s390_r13);
+ s390_ogr (code, dreg, s390_r0);
+ break;
+ }
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 10);
+ s390_llong (code, 0x41e0000000000000);
+ s390_llong (code, 0x41f0000000000000);
+ s390_ldr (code, s390_f15, sreg);
+ s390_cdb (code, s390_f15, 0, s390_r13, 0);
+ s390_jl (code, 10);
+ s390_sdb (code, s390_f15, 0, s390_r13, 8);
+ s390_cfdbr (code, dreg, 7, s390_f15);
+ s390_j (code, 6);
+ s390_cfdbr (code, dreg, 5, sreg);
+ switch (size) {
+ case 1:
+ s390_lghi (code, s390_r0, 0xff);
+ s390_ngr (code, dreg, s390_r0);
+ break;
+ case 2:
+ s390_lghi (code, s390_r0, -1);
+ s390_srlg (code, s390_r0, s390_r0, 0, 16);
+ s390_ngr (code, dreg, s390_r0);
+ break;
+ }
+ }
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_emit_stack_alloc */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+static unsigned char*
+mono_emit_stack_alloc (guchar *code, MonoInst* tree)
+{
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_output_basic_block */
+/* */
+/* Function - Perform the "real" work of emitting instructions */
+/* that will do the work of in the basic block. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoCallInst *call;
+ guint offset;
+ guint8 *code = cfg->native_code + cfg->code_len;
+ MonoInst *last_ins = NULL;
+ guint last_offset = 0;
+ int max_len, cpos;
+guint8 cond;
+
+ if (cfg->opt & MONO_OPT_PEEPHOLE)
+ peephole_pass (cfg, bb);
+
+ /* we don't align basic blocks of loops on s390 */
+
+ if (cfg->verbose_level > 2)
+ g_print ("Basic block %d starting at offset 0x%x\n", bb->block_num, bb->native_offset);
+
+ cpos = bb->max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE) {
+ //MonoCoverageInfo *cov = mono_get_coverage_info (cfg->method);
+ //g_assert (!mono_compile_aot);
+ //cpos += 6;
+ //if (bb->cil_code)
+ // cov->data [bb->dfn].iloffset = bb->cil_code - cfg->cil_code;
+ /* this is not thread save, but good enough */
+ /* fixme: howto handle overflows? */
+ //x86_inc_mem (code, &cov->data [bb->dfn].count);
+ }
+
+ ins = bb->code;
+ while (ins) {
+ offset = code - cfg->native_code;
+
+ max_len = ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+
+ if (offset > (cfg->code_size - max_len - 16)) {
+ cfg->code_size *= 2;
+ cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
+ code = cfg->native_code + offset;
+ }
+
+ mono_debug_record_line_number (cfg, ins, offset);
+
+ switch (ins->opcode) {
+ case OP_STOREI1_MEMBASE_IMM: {
+ s390_lghi (code, s390_r14, ins->inst_imm);
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_stc (code, s390_r14, 0, ins->inst_destbasereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_stc (code, s390_r14, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI2_MEMBASE_IMM: {
+ s390_lghi (code, s390_r14, ins->inst_imm);
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_sth (code, s390_r14, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_sth (code, s390_r14, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STORE_MEMBASE_IMM:
+ case OP_STOREI8_MEMBASE_IMM: {
+ if (s390_is_imm16(ins->inst_imm)) {
+ s390_lghi (code, s390_r14, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ s390_lg (code, s390_r14, 0, s390_r13, 4);
+ }
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_stg (code, s390_r14, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_stg (code, s390_r14, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI4_MEMBASE_IMM: {
+ if (s390_is_imm16(ins->inst_imm)) {
+ s390_lghi (code, s390_r14, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ s390_lg (code, s390_r14, 0, s390_r13, 4);
+ }
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_st (code, s390_r14, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_st (code, s390_r14, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI1_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_stc (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_stc (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI2_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_sth (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_sth (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STORE_MEMBASE_REG:
+ case OP_STOREI8_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_stg (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_stg (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_STOREI4_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_st (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_st (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case CEE_LDIND_I:
+ case CEE_LDIND_I4: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_word (code, ins->inst_p0);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_lgf (code, ins->dreg, 0, s390_r13, 0);
+ }
+ break;
+ case CEE_LDIND_U4: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_word (code, ins->inst_p0);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_llgf (code, ins->dreg, 0, s390_r13, 0);
+ }
+ break;
+ case OP_LOADU4_MEM:
+ g_assert_not_reached ();
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI8_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_lg (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ if (s390_is_imm16(ins->inst_offset)) {
+ s390_lghi(code, s390_r13, ins->inst_offset);
+ s390_lg (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_lg (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ }
+ break;
+ case OP_LOADI4_MEMBASE:
+ case OP_LOADU4_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_lgf (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ if (s390_is_imm16(ins->inst_offset)) {
+ s390_lghi(code, s390_r13, ins->inst_offset);
+ s390_lgf (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_lgf (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ }
+ break;
+ case OP_LOADU1_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_llgc (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_llgc (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case OP_LOADI1_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_lgb (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_lgb (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case OP_LOADU2_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_llgh (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_llgh (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case OP_LOADI2_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset))
+ s390_lh (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_lh (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case CEE_CONV_I1: {
+ s390_lghi (code, s390_r0, 0x80);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ngr (code, s390_r0, ins->sreg1);
+ s390_jz (code, 7);
+ s390_lghi (code, s390_r13, -1);
+ s390_sllg (code, s390_r13, s390_r13, 0, 8);
+ s390_ogr (code, ins->dreg, s390_r13);
+ }
+ break;
+ case CEE_CONV_I2: {
+ s390_lghi (code, s390_r0, 0x80);
+ s390_sllg (code, s390_r0, s390_r0, 0, 8);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ngr (code, s390_r0, ins->sreg1);
+ s390_jz (code, 7);
+ s390_lghi (code, s390_r13, -1);
+ s390_sllg (code, s390_r13, s390_r13, 0, 16);
+ s390_ogr (code, ins->dreg, s390_r13);
+ }
+ break;
+ case CEE_CONV_U1: {
+ s390_lghi (code, s390_r0, 0xff);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ngr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case CEE_CONV_U2: {
+ s390_lghi (code, s390_r0, -1);
+ s390_sllg (code, s390_r0, s390_r0, 0, 48);
+ s390_srlg (code, s390_r0, s390_r0, 0, 48);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ngr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_COMPARE:
+ case OP_LCOMPARE: {
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) ||
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_clgr (code, ins->sreg1, ins->sreg2);
+ else
+ s390_cgr (code, ins->sreg1, ins->sreg2);
+ }
+ break;
+ case OP_COMPARE_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r0, ins->inst_imm);
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) ||
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_clgr (code, ins->sreg1, s390_r0);
+ else
+ s390_cgr (code, ins->sreg1, s390_r0);
+ }
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) &&
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_clg (code, ins->sreg1, 0, s390_r13, 4);
+ else
+ s390_cg (code, ins->sreg1, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_ICOMPARE: {
+ if (((ins->next) &&
+ (((ins->next->opcode >= OP_IBNE_UN) &&
+ (ins->next->opcode <= OP_IBLT_UN)) ||
+ ((ins->next->opcode == OP_ICLT_UN) ||
+ (ins->next->opcode == OP_ICGT_UN)))))
+ s390_clr (code, ins->sreg1, ins->sreg2);
+ else
+ s390_cr (code, ins->sreg1, ins->sreg2);
+ }
+ break;
+ case OP_ICOMPARE_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r0, ins->inst_imm);
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) ||
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_clr (code, ins->sreg1, s390_r0);
+ else
+ s390_cr (code, ins->sreg1, s390_r0);
+ }
+ else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if ((ins->next) &&
+ ((ins->next->opcode >= CEE_BNE_UN) &&
+ (ins->next->opcode <= CEE_BLT_UN)) ||
+ ((ins->next->opcode >= OP_COND_EXC_NE_UN) &&
+ (ins->next->opcode <= OP_COND_EXC_LT_UN)) ||
+ ((ins->next->opcode == OP_CLT_UN) &&
+ (ins->next->opcode == OP_CGT_UN)))
+ s390_cl (code, ins->sreg1, 0, s390_r13, 4);
+ else
+ s390_c (code, ins->sreg1, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_X86_TEST_NULL: {
+ s390_ltgr(code, ins->sreg1, ins->sreg1);
+ }
+ break;
+ case CEE_BREAK: {
+ s390_break (code);
+ }
+ break;
+ case OP_ADDCC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_algr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case CEE_ADD: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_agr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_ADC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alcgr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_ADD_IMM: {
+ if ((ins->next) &&
+ (ins->next->opcode == OP_ADC_IMM)) {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alg (code, ins->dreg, 0, s390_r13, 4);
+ } else {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_aghi (code, ins->dreg, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ag (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ }
+ break;
+ case OP_ADC_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lghi (code, s390_r0, ins->inst_imm);
+ s390_alcgr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_alcgr(code, ins->dreg, s390_r13);
+ }
+ }
+ break;
+ case CEE_ADD_OVF: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ar (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case CEE_ADD_OVF_UN: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_algr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_CY, "OverflowException");
+ }
+ break;
+ case OP_ADD_OVF_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lghi (code, s390_r0, 0);
+ s390_lgr (code, s390_r1, s390_r0);
+ s390_alcgr(code, s390_r0, s390_r1);
+ s390_agr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ s390_agr (code, ins->dreg, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case OP_ADD_OVF_UN_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alcgr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_CY, "OverflowException");
+ }
+ break;
+ case OP_SUBCC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slgr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case CEE_SUB: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sgr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_SBB: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slbgr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_SUB_IMM: {
+ if (s390_is_imm16 (-ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_aghi (code, ins->dreg, -ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sg (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_SBB_IMM: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ s390_slg (code, ins->dreg, 0, s390_r13, 4);
+ }
+ break;
+ case CEE_SUB_OVF: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sgr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case CEE_SUB_OVF_UN: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NC, "OverflowException");
+ }
+ break;
+ case OP_SUB_OVF_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lghi (code, s390_r0, 0);
+ s390_lgr (code, s390_r1, s390_r0);
+ s390_slbr (code, s390_r0, s390_r1);
+ s390_sr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ s390_agr (code, ins->dreg, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException");
+ }
+ break;
+ case OP_SUB_OVF_UN_CARRY: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slbgr (code, ins->dreg, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NC, "OverflowException");
+ }
+ break;
+ case CEE_AND: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_ngr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_ngr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ s390_ngr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_AND_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ngr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ng (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case CEE_DIV: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lgfr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case CEE_DIV_UN: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srdl (code, s390_r0, 0, 32);
+ s390_dlr (code, s390_r0, ins->sreg2);
+ s390_lgfr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_DIV_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r13, ins->inst_imm);
+ s390_lgr (code, s390_r0, ins->sreg1);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ s390_lgr (code, s390_r0, ins->sreg1);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lgfr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case CEE_REM: {
+ s390_lgr (code, s390_r0, ins->sreg1);
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lgfr (code, ins->dreg, s390_r0);
+ break;
+ case CEE_REM_UN:
+ s390_lgr (code, s390_r0, ins->sreg1);
+ s390_srdl (code, s390_r0, 0, 32);
+ s390_dlr (code, s390_r0, ins->sreg2);
+ s390_lgfr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_REM_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r13, ins->inst_imm);
+ s390_lgr (code, s390_r0, ins->sreg1);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ s390_lgr (code, s390_r0, ins->sreg1);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lgfr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case CEE_OR: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_ogr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_ogr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_ogr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_OR_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ogr (code, ins->dreg, s390_r0);
+ } else {
+ s390_bras (code, s390_r13, 4);
+ s390_llong(code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_og (code, ins->dreg, 0, s390_r13, 0);
+ }
+ }
+ break;
+ case CEE_XOR: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_xgr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_xgr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ s390_xgr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_XOR_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_xgr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_xg (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case CEE_SHL:
+ case OP_LSHL: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sllg (code, ins->dreg, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case OP_SHL_IMM:
+ case OP_LSHL_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sllg (code, ins->dreg, ins->dreg, 0,
+ (ins->inst_imm & 0x1f));
+ }
+ break;
+ case CEE_SHR:
+ case OP_LSHR: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srag (code, ins->dreg, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case OP_SHR_IMM:
+ case OP_LSHR_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srag (code, ins->dreg, ins->dreg, 0,
+ (ins->inst_imm & 0x1f));
+ }
+ break;
+ case OP_SHR_UN_IMM:
+ case OP_LSHR_UN_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srlg (code, ins->dreg, ins->dreg, 0,
+ (ins->inst_imm & 0x1f));
+ }
+ break;
+ case CEE_SHR_UN:
+ case OP_LSHR_UN: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srlg (code, ins->dreg, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case CEE_NOT: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lghi (code, s390_r0, -1);
+ s390_xgr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case CEE_NEG: {
+ s390_lcgr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case CEE_MUL: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_msgr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_msgr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ s390_msgr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_MUL_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lghi (code, s390_r13, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_msgr (code, ins->dreg, s390_r13);
+ }
+ break;
+ case CEE_MUL_OVF: {
+ short int *o[2];
+ s390_ltgr (code, s390_r1, ins->sreg1);
+ s390_jz (code, 0); CODEPTR(code, o[0]);
+ s390_ltgr (code, s390_r0, ins->sreg2);
+ s390_jnz (code, 6);
+ s390_lghi (code, s390_r1, 0);
+ s390_j (code, 0); CODEPTR(code, o[1]);
+ s390_xgr (code, s390_r0, s390_r1);
+ s390_msgr (code, s390_r1, ins->sreg2);
+ s390_xgr (code, s390_r0, s390_r1);
+ s390_srlg (code, s390_r0, s390_r0, 0, 64);
+ s390_ltgr (code, s390_r0, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NZ, "OverflowException");
+ PTRSLOT (code, o[0]);
+ PTRSLOT (code, o[1]);
+ s390_lgr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case CEE_MUL_OVF_UN: {
+ s390_lghi (code, s390_r0, 0);
+ s390_lgr (code, s390_r1, ins->sreg1);
+ s390_mlgr (code, s390_r0, ins->sreg2);
+ s390_ltgr (code, s390_r0, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NZ, "OverflowException");
+ s390_lgr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_IADDCC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_IADD: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ar (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_IADC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_alcr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_IADD_IMM: {
+ if ((ins->next) &&
+ (ins->next->opcode == OP_ADC_IMM)) {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_al (code, ins->dreg, 0, s390_r13, 4);
+ } else {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ahi (code, ins->dreg, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_a (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ }
+ break;
+ case OP_IADC_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ s390_alcr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ s390_alcr (code, ins->dreg, s390_r13);
+ }
+ }
+ break;
+ case OP_ISUBCC: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_ISUB: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_ISBB: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_slbr (code, ins->dreg, ins->sreg2);
+ }
+ break;
+ case OP_ISUB_IMM: {
+ if (s390_is_imm16 (-ins->inst_imm)) {
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_ahi (code, ins->dreg, -ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_s (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_ISBB_IMM: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_sl (code, ins->dreg, 0, s390_r13, 4);
+ }
+ break;
+ case OP_IAND: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_nr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_nr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_nr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_IAND_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_nr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_n (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_IDIV: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_IDIV_UN: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srdl (code, s390_r0, 0, 32);
+ s390_dlr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_IDIV_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r13, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_IREM: {
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r0);
+ break;
+ case OP_IREM_UN:
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_srdl (code, s390_r0, 0, 32);
+ s390_dlr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_IREM_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r13, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ s390_lr (code, s390_r0, ins->sreg1);
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_srda (code, s390_r0, 0, 32);
+ s390_dr (code, s390_r0, ins->sreg2);
+ s390_lr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_IOR: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_or (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_or (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_or (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_IOR_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_or (code, ins->dreg, s390_r0);
+ } else {
+ s390_bras (code, s390_r13, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_o (code, ins->dreg, 0, s390_r13, 0);
+ }
+ }
+ break;
+ case OP_IXOR: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_xr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_xr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_xr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_IXOR_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r0, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_xr (code, ins->dreg, s390_r0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_x (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_ISHL: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sll (code, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case OP_ISHL_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sll (code, ins->dreg, 0, (ins->inst_imm & 0x1f));
+ }
+ break;
+ case OP_ISHR: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sra (code, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case OP_ISHR_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_sra (code, ins->dreg, 0, (ins->inst_imm & 0x1f));
+ }
+ break;
+ case OP_ISHR_UN_IMM: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srl (code, ins->dreg, 0, (ins->inst_imm & 0x1f));
+ }
+ break;
+ case OP_ISHR_UN: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_srl (code, ins->dreg, ins->sreg2, 0);
+ }
+ break;
+ case OP_INOT: {
+ if (ins->sreg1 != ins->dreg) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_lhi (code, s390_r0, -1);
+ s390_xr (code, ins->dreg, s390_r0);
+ }
+ break;
+ case OP_INEG: {
+ s390_lcr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_IMUL: {
+ if (ins->sreg1 == ins->dreg) {
+ s390_msr (code, ins->dreg, ins->sreg2);
+ }
+ else {
+ if (ins->sreg2 == ins->dreg) {
+ s390_msr (code, ins->dreg, ins->sreg1);
+ }
+ else {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ s390_msr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_IMUL_IMM: {
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_lhi (code, s390_r13, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, ins->inst_imm);
+ if (ins->dreg != ins->sreg1) {
+ s390_lr (code, ins->dreg, ins->sreg1);
+ }
+ s390_l (code, s390_r13, 0, s390_r13, 4);
+ }
+ s390_msr (code, ins->dreg, s390_r13);
+ }
+ break;
+ case OP_IMUL_OVF: {
+ short int *o[2];
+ s390_ltr (code, s390_r1, ins->sreg1);
+ s390_jz (code, 0); CODEPTR(code, o[0]);
+ s390_ltr (code, s390_r0, ins->sreg2);
+ s390_jnz (code, 6);
+ s390_lhi (code, s390_r1, 0);
+ s390_j (code, 0); CODEPTR(code, o[1]);
+ s390_xr (code, s390_r0, s390_r1);
+ s390_msr (code, s390_r1, ins->sreg2);
+ s390_xr (code, s390_r0, s390_r1);
+ s390_srl (code, s390_r0, 0, 31);
+ s390_ltr (code, s390_r0, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NZ, "OverflowException");
+ PTRSLOT (code, o[0]);
+ PTRSLOT (code, o[1]);
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_IMUL_OVF_UN: {
+ s390_lhi (code, s390_r0, 0);
+ s390_lr (code, s390_r1, ins->sreg1);
+ s390_mlr (code, s390_r0, ins->sreg2);
+ s390_ltr (code, s390_r0, s390_r0);
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NZ, "OverflowException");
+ s390_lr (code, ins->dreg, s390_r1);
+ }
+ break;
+ case OP_ICONST:
+ case OP_I8CONST:
+ case OP_SETREGIMM: {
+ if (s390_is_imm16(ins->inst_c0)) {
+ s390_lghi (code, ins->dreg, ins->inst_c0);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_c0);
+ s390_lg (code, ins->dreg, 0, s390_r13, 4);
+ }
+ }
+ break;
+ case OP_AOTCONST: {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ (MonoJumpInfoType)ins->inst_i1, ins->inst_p0);
+ s390_llong(code, 0);
+ s390_lg (code,ins->dreg, 0, s390_r13, 4);
+ }
+ break;
+ case CEE_CONV_I:
+ case CEE_CONV_I4:
+ case CEE_CONV_I8:
+ case CEE_CONV_U:
+ case CEE_CONV_U4:
+ case CEE_CONV_OVF_U4:
+ case CEE_CONV_U8:
+ case OP_MOVE:
+ case OP_SETREG: {
+ if (ins->dreg != ins->sreg1) {
+ s390_lgr(code, ins->dreg, ins->sreg1);
+ }
+ }
+ break;
+ case OP_SETFREG:
+ case OP_FMOVE: {
+ if (ins->dreg != ins->sreg1) {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ }
+ }
+ break;
+ case OP_S390_SETF4RET: {
+ s390_ledbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FCONV_TO_R4: {
+ if ((ins->next) &&
+ (ins->next->opcode != OP_STORER4_MEMBASE_REG))
+ s390_ledbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case CEE_JMP: {
+ int fParm;
+ if (cfg->method->save_lmf)
+ code = restoreLMF(cfg, code);
+
+ if (cfg->flags & MONO_CFG_HAS_TAIL) {
+ s390_lmg(code, s390_r2, s390_r5, STK_BASE,
+ S390_PARM_SAVE_OFFSET);
+ for (fParm = 0; fParm < 4; fParm ++)
+ s390_ld (code, fParm, 0, STK_BASE,
+ S390_FLOAT_SAVE_OFFSET+fParm*sizeof(double));
+ }
+
+ code = backUpStackPtr(cfg, code);
+ s390_lg (code, s390_r14, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_basr (code, s390_r10, 0);
+ s390_j (code, 6);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_METHOD_JUMP,
+ ins->inst_p0);
+ s390_llong(code, 0);
+ s390_lg (code, s390_r1, 0, s390_r10, 4);
+ s390_basr (code, s390_r0, s390_r1);
+ }
+ break;
+ case OP_CHECK_THIS: {
+ /* ensure ins->sreg1 is not NULL */
+ s390_lg (code, s390_r0, 0, ins->sreg1, 0);
+ s390_ltgr (code, s390_r0, s390_r0);
+ }
+ break;
+ case OP_FCALL: {
+ s390_basr (code, s390_r10, 0);
+ s390_j (code, 6);
+ call = (MonoCallInst*)ins;
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ mono_add_patch_info (cfg, code-cfg->native_code,
+ MONO_PATCH_INFO_METHOD,
+ call->method);
+ else
+ mono_add_patch_info (cfg, code-cfg->native_code,
+ MONO_PATCH_INFO_ABS,
+ call->fptr);
+ s390_llong(code, 0);
+ s390_lg (code, s390_r1, 0, s390_r10, 4);
+ s390_basr (code, s390_r14, s390_r1);
+ if (call->signature->ret->type == MONO_TYPE_R4)
+ s390_ldebr (code, s390_f0, s390_f0);
+ }
+ break;
+ case OP_LCALL:
+ case OP_VCALL:
+ case OP_VOIDCALL:
+ case CEE_CALL: {
+ s390_basr (code, s390_r10, 0);
+ s390_j (code, 6);
+ call = (MonoCallInst*)ins;
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ mono_add_patch_info (cfg, code-cfg->native_code,
+ MONO_PATCH_INFO_METHOD,
+ call->method);
+ else
+ mono_add_patch_info (cfg, code-cfg->native_code,
+ MONO_PATCH_INFO_ABS,
+ call->fptr);
+ s390_llong(code, 0);
+ s390_lg (code, s390_r1, 0, s390_r10, 4);
+ s390_basr (code, s390_r14, s390_r1);
+ }
+ break;
+ case OP_FCALL_REG: {
+ call = (MonoCallInst*)ins;
+ s390_lgr (code, s390_r1, ins->sreg1);
+ s390_basr (code, s390_r14, s390_r1);
+ if (call->signature->ret->type == MONO_TYPE_R4)
+ s390_ldebr (code, s390_f0, s390_f0);
+ }
+ break;
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ case OP_CALL_REG: {
+ s390_lgr (code, s390_r1, ins->sreg1);
+ s390_basr (code, s390_r14, s390_r1);
+ }
+ break;
+ case OP_FCALL_MEMBASE: {
+ call = (MonoCallInst*)ins;
+ s390_lg (code, s390_r1, 0, ins->sreg1, ins->inst_offset);
+ s390_basr (code, s390_r14, s390_r1);
+ if (call->signature->ret->type == MONO_TYPE_R4)
+ s390_ldebr (code, s390_f0, s390_f0);
+ }
+ break;
+ case OP_LCALL_MEMBASE:
+ case OP_VCALL_MEMBASE:
+ case OP_VOIDCALL_MEMBASE:
+ case OP_CALL_MEMBASE: {
+ s390_lg (code, s390_r1, 0, ins->sreg1, ins->inst_offset);
+ s390_basr (code, s390_r14, s390_r1);
+ }
+ break;
+ case OP_OUTARG:
+ g_assert_not_reached ();
+ break;
+ case OP_LOCALLOC: {
+ int alloca_skip = S390_MINIMAL_STACK_SIZE + cfg->param_area +
+ S390_STACK_ALIGNMENT - 1;
+ int area_offset = S390_ALIGN(alloca_skip, S390_STACK_ALIGNMENT);
+ s390_lgr (code, s390_r1, ins->sreg1);
+ s390_aghi (code, s390_r1, 14);
+ s390_srlg (code, s390_r1, s390_r1, 0, 3);
+ s390_sllg (code, s390_r1, s390_r1, 0, 3);
+ s390_lg (code, s390_r13, 0, STK_BASE, 0);
+ s390_lcgr (code, s390_r1, s390_r1);
+ s390_la (code, STK_BASE, STK_BASE, s390_r1, 0);
+ s390_stg (code, s390_r13, 0, STK_BASE, 0);
+ s390_la (code, ins->dreg, 0, STK_BASE, area_offset);
+ s390_srlg (code, ins->dreg, ins->dreg, 0, 3);
+ s390_sllg (code, ins->dreg, ins->dreg, 0, 3);
+ }
+ break;
+ case CEE_RET: {
+ s390_br (code, s390_r14);
+ }
+ break;
+ case CEE_THROW: {
+ s390_lgr (code, s390_r2, ins->sreg1);
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_throw_exception");
+ s390_llong(code, 0);
+ s390_lg (code, s390_r1, 0, s390_r13, 4);
+ s390_basr (code, s390_r14, s390_r1);
+ }
+ break;
+ case OP_START_HANDLER: {
+ if (s390_is_uimm12 (ins->inst_left->inst_offset)) {
+ s390_stg (code, s390_r14, 0,
+ ins->inst_left->inst_basereg,
+ ins->inst_left->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_left->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_stg (code, s390_r14, s390_r13,
+ ins->inst_left->inst_basereg, 0);
+ }
+ }
+ break;
+ case OP_ENDFILTER: {
+ if (ins->sreg1 != s390_r2)
+ s390_lgr(code, s390_r2, ins->sreg1);
+ if (s390_is_uimm12 (ins->inst_left->inst_offset)) {
+ s390_l (code, s390_r14, 0, ins->inst_left->inst_basereg,
+ ins->inst_left->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_left->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_lg (code, s390_r14, s390_r13,
+ ins->inst_left->inst_basereg, 0);
+ }
+ s390_br (code, s390_r14);
+ }
+ break;
+ case CEE_ENDFINALLY: {
+ if (s390_is_uimm12 (ins->inst_left->inst_offset)) {
+ s390_lg (code, s390_r14, 0, ins->inst_left->inst_basereg,
+ ins->inst_left->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_left->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_lg (code, s390_r14, s390_r13,
+ ins->inst_left->inst_basereg, 0);
+ }
+ s390_br (code, s390_r14);
+ }
+ break;
+ case OP_CALL_HANDLER: {
+ mono_add_patch_info (cfg, code-cfg->native_code,
+ MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ s390_brasl (code, s390_r14, 0);
+ }
+ break;
+ case OP_LABEL: {
+ ins->inst_c0 = code - cfg->native_code;
+ }
+ break;
+ case CEE_BR:
+ EMIT_UNCOND_BRANCH(ins);
+ break;
+ case OP_BR_REG: {
+ s390_br (code, ins->sreg1);
+ }
+ break;
+ case OP_CEQ:
+ case OP_ICEQ: {
+ s390_lghi(code, ins->dreg, 1);
+ s390_jz (code, 4);
+ s390_lghi(code, ins->dreg, 0);
+ }
+ break;
+ case OP_CLT:
+ case OP_ICLT: {
+ s390_lghi(code, ins->dreg, 1);
+ s390_jl (code, 4);
+ s390_lghi(code, ins->dreg, 0);
+ }
+ break;
+ case OP_CLT_UN:
+ case OP_ICLT_UN: {
+ s390_lghi(code, ins->dreg, 1);
+ s390_jlo (code, 4);
+ s390_lghi(code, ins->dreg, 0);
+ }
+ break;
+ case OP_CGT:
+ case OP_ICGT: {
+ s390_lghi(code, ins->dreg, 1);
+ s390_jh (code, 4);
+ s390_lghi(code, ins->dreg, 0);
+ }
+ break;
+ case OP_CGT_UN:
+ case OP_ICGT_UN: {
+ s390_lghi(code, ins->dreg, 1);
+ s390_jho (code, 4);
+ s390_lghi(code, ins->dreg, 0);
+ }
+ break;
+ case OP_COND_EXC_EQ:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_EQ, ins->inst_p1);
+ break;
+ case OP_COND_EXC_NE_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NE, ins->inst_p1);
+ break;
+ case OP_COND_EXC_LT:
+ case OP_COND_EXC_LT_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_LT, ins->inst_p1);
+ break;
+ case OP_COND_EXC_GT:
+ case OP_COND_EXC_GT_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_GT, ins->inst_p1);
+ break;
+ case OP_COND_EXC_GE:
+ case OP_COND_EXC_GE_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_GE, ins->inst_p1);
+ break;
+ case OP_COND_EXC_LE:
+ case OP_COND_EXC_LE_UN:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_LE, ins->inst_p1);
+ break;
+ case OP_COND_EXC_OV:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, ins->inst_p1);
+ break;
+ case OP_COND_EXC_NO:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NO, ins->inst_p1);
+ break;
+ case OP_COND_EXC_C:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_CY, ins->inst_p1);
+ break;
+ case OP_COND_EXC_NC:
+ EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NC, ins->inst_p1);
+ break;
+ case CEE_BEQ:
+ case OP_IBEQ:
+ EMIT_COND_BRANCH (ins, S390_CC_EQ);
+ break;
+ case CEE_BNE_UN:
+ case OP_IBNE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_NE);
+ break;
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ case OP_IBLT:
+ case OP_IBLT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LT);
+ break;
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ case OP_IBGT:
+ case OP_IBGT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GT);
+ break;
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ case OP_IBGE:
+ case OP_IBGE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GE);
+ break;
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ case OP_IBLE:
+ case OP_IBLE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LE);
+ break;
+
+ /* floating point opcodes */
+ case OP_R8CONST: {
+ if (*((float *) ins->inst_p0) == 0) {
+ s390_lzdr (code, ins->dreg);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong (code, ins->inst_p0);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_ld (code, ins->dreg, 0, s390_r13, 0);
+ }
+ }
+ break;
+ case OP_R4CONST: {
+ if (*((float *) ins->inst_p0) == 0) {
+ s390_lzdr (code, ins->dreg);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_p0);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_ldeb (code, ins->dreg, 0, s390_r13, 0);
+ }
+ }
+ break;
+ case OP_STORER8_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_std (code, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_std (code, ins->sreg1, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_LOADR8_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_ld (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_ld (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case OP_STORER4_MEMBASE_REG: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_ledbr(code, s390_f15, ins->sreg1);
+ s390_ste (code, s390_f15, 0, ins->inst_destbasereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_ledbr(code, s390_f15, ins->sreg1);
+ s390_ste (code, s390_f15, s390_r13, ins->inst_destbasereg, 0);
+ }
+ }
+ break;
+ case OP_LOADR4_MEMBASE: {
+ if (s390_is_uimm12(ins->inst_offset)) {
+ s390_ldeb (code, ins->dreg, 0, ins->inst_basereg, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_lg (code, s390_r13, 0, s390_r13, 4);
+ s390_ldeb (code, ins->dreg, s390_r13, ins->inst_basereg, 0);
+ }
+ }
+ break;
+ case CEE_CONV_R_UN: {
+ s390_cdfbr (code, ins->dreg, ins->sreg1);
+ s390_ltgr (code, ins->sreg1, ins->sreg1);
+ s390_jnl (code, 12);
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_word (code, 0x41f00000);
+ s390_word (code, 0);
+ s390_adb (code, ins->dreg, 0, s390_r13, 4);
+ }
+ break;
+ case CEE_CONV_R4: {
+ s390_cdfbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case CEE_CONV_R8: {
+ s390_cdfbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FCONV_TO_I1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, TRUE);
+ break;
+ case OP_FCONV_TO_U1:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, FALSE);
+ break;
+ case OP_FCONV_TO_I2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, TRUE);
+ break;
+ case OP_FCONV_TO_U2:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, FALSE);
+ break;
+ case OP_FCONV_TO_I4:
+ case OP_FCONV_TO_I:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, TRUE);
+ break;
+ case OP_FCONV_TO_U4:
+ case OP_FCONV_TO_U:
+ code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE);
+ break;
+ case OP_FCONV_TO_I8:
+ case OP_FCONV_TO_U8:
+ g_assert_not_reached ();
+ /* Implemented as helper calls */
+ break;
+ case OP_LCONV_TO_R_UN:
+ g_assert_not_reached ();
+ /* Implemented as helper calls */
+ break;
+ case OP_LCONV_TO_OVF_I: {
+ /* Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000 */
+ short int *o[5];
+ s390_ltgr (code, ins->sreg2, ins->sreg2);
+ s390_jnl (code, 0); CODEPTR(code, o[0]);
+ s390_ltgr (code, ins->sreg1, ins->sreg1);
+ s390_jnl (code, 0); CODEPTR(code, o[1]);
+ s390_lhi (code, s390_r13, -1);
+ s390_cgr (code, ins->sreg1, s390_r13);
+ s390_jnz (code, 0); CODEPTR(code, o[2]);
+ if (ins->dreg != ins->sreg2)
+ s390_lgr (code, ins->dreg, ins->sreg2);
+ s390_j (code, 0); CODEPTR(code, o[3]);
+ PTRSLOT(code, o[0]);
+ s390_jz (code, 0); CODEPTR(code, o[4]);
+ PTRSLOT(code, o[1]);
+ PTRSLOT(code, o[2]);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_EXC, "OverflowException");
+ s390_brasl (code, s390_r14, 0);
+ PTRSLOT(code, o[3]);
+ PTRSLOT(code, o[4]);
+ }
+ break;
+ case OP_SQRT: {
+ s390_sqdbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FADD: {
+ if (ins->dreg == ins->sreg1)
+ s390_adbr (code, ins->dreg, ins->sreg2);
+ else {
+ if (ins->dreg == ins->sreg2)
+ s390_adbr (code, ins->dreg, ins->sreg1);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_adbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_FSUB: {
+ if (ins->dreg == ins->sreg1)
+ s390_sdbr (code, ins->dreg, ins->sreg2);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_sdbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ break;
+ case OP_FMUL: {
+ if (ins->dreg == ins->sreg1)
+ s390_mdbr (code, ins->dreg, ins->sreg2);
+ else {
+ if (ins->dreg == ins->sreg2)
+ s390_mdbr (code, ins->dreg, ins->sreg1);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_mdbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ }
+ break;
+ case OP_FDIV: {
+ if (ins->dreg == ins->sreg1)
+ s390_ddbr (code, ins->dreg, ins->sreg2);
+ else {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ s390_ddbr (code, ins->dreg, ins->sreg2);
+ }
+ }
+ break;
+ case OP_FNEG: {
+ s390_lcdbr (code, ins->dreg, ins->sreg1);
+ }
+ break;
+ case OP_FREM: {
+ if (ins->dreg != ins->sreg1) {
+ s390_ldr (code, ins->dreg, ins->sreg1);
+ }
+ s390_didbr (code, ins->dreg, ins->sreg2, 5, s390_f15);
+ }
+ break;
+ case OP_FCOMPARE: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ }
+ break;
+ case OP_FCEQ: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lghi (code, ins->dreg, 1);
+ s390_je (code, 6);
+ s390_lghi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCLT: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lghi (code, ins->dreg, 1);
+ s390_jl (code, 4);
+ s390_lghi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCLT_UN: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lghi (code, ins->dreg, 1);
+ s390_jlo (code, 4);
+ s390_lghi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCGT: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lghi (code, ins->dreg, 1);
+ s390_jh (code, 4);
+ s390_lghi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FCGT_UN: {
+ s390_cdbr (code, ins->sreg1, ins->sreg2);
+ s390_lghi (code, ins->dreg, 1);
+ s390_jho (code, 4);
+ s390_lghi (code, ins->dreg, 0);
+ }
+ break;
+ case OP_FBEQ:
+ EMIT_COND_BRANCH (ins, S390_CC_EQ|S390_CC_OV);
+ break;
+ case OP_FBNE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_NE|S390_CC_OV);
+ break;
+ case OP_FBLT:
+ EMIT_COND_BRANCH (ins, S390_CC_LT);
+ break;
+ case OP_FBLT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LT|S390_CC_OV);
+ break;
+ case OP_FBGT:
+ EMIT_COND_BRANCH (ins, S390_CC_GT);
+ break;
+ case OP_FBGT_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GT|S390_CC_OV);
+ break;
+ case OP_FBGE:
+ EMIT_COND_BRANCH (ins, S390_CC_GE);
+ break;
+ case OP_FBGE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_GE|S390_CC_OV);
+ break;
+ case OP_FBLE:
+ EMIT_COND_BRANCH (ins, S390_CC_LE);
+ break;
+ case OP_FBLE_UN:
+ EMIT_COND_BRANCH (ins, S390_CC_LE|S390_CC_OV);
+ break;
+ case CEE_CKFINITE: {
+ short *o;
+ s390_lhi (code, s390_r13, 0x7f);
+ s390_tcdb (code, ins->sreg1, 0, s390_r13, 0);
+ s390_jz (code, 0); CODEPTR(code, o);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_EXC, "ArithmeticException");
+ s390_brasl (code, s390_r14,0);
+ PTRSLOT(code, o);
+ }
+ break;
+ case OP_S390_MOVE: {
+ if (ins->unused > 0) {
+ if (ins->unused <= 256) {
+ s390_mvc (code, ins->unused, ins->dreg,
+ ins->inst_offset, ins->sreg1, ins->inst_imm);
+ } else {
+ s390_lr (code, s390_r0, ins->dreg);
+ if (s390_is_imm16 (ins->inst_offset)) {
+ s390_aghi (code, s390_r0, ins->inst_offset);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_offset);
+ s390_a (code, s390_r0, 0, s390_r13, 4);
+ }
+ s390_lr (code, s390_r12, ins->sreg1);
+ if (s390_is_imm16 (ins->inst_imm)) {
+ s390_aghi (code, s390_r12, ins->inst_imm);
+ } else {
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, ins->inst_imm);
+ s390_ag (code, s390_r12, 0, s390_r13, 4);
+ }
+ s390_lgr (code, s390_r1, ins->sreg1);
+ s390_lgr (code, s390_r13, s390_r1);
+ s390_mvcle(code, s390_r0, s390_r12, 0, 0);
+ s390_jo (code, -2);
+ }
+ }
+ }
+ break;
+ default:
+ g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
+ g_assert_not_reached ();
+ }
+
+ if ((cfg->opt & MONO_OPT_BRANCH) && ((code - cfg->native_code - offset) > max_len)) {
+ g_warning ("wrong maximal instruction length of instruction %s (expected %d, got %d)",
+ mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset);
+// g_assert_not_reached ();
+ }
+
+ cpos += max_len;
+
+ last_ins = ins;
+ last_offset = offset;
+
+ ins = ins->next;
+ }
+
+ cfg->code_len = code - cfg->native_code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_register_lowlevel_calls */
+/* */
+/* Function - Register routines to help with --trace operation. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_register_lowlevel_calls (void)
+{
+ mono_register_jit_icall (enter_method, "mono_enter_method", NULL, TRUE);
+ mono_register_jit_icall (leave_method, "mono_leave_method", NULL, TRUE);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_patch_code */
+/* */
+/* Function - Process the patch data created during the */
+/* instruction build process. This resolves jumps, */
+/* calls, variables etc. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
+{
+ MonoJumpInfo *patch_info;
+
+ for (patch_info = ji; patch_info; patch_info = patch_info->next) {
+ unsigned char *ip = patch_info->ip.i + code;
+ guint64 target = 0;
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_BB:
+ target = S390_RELATIVE((patch_info->data.bb->native_offset+code),
+ ip);
+ ip += 2; /* Skip over op-code */
+ break;
+ case MONO_PATCH_INFO_ABS:
+ *((gpointer *)(ip)) = patch_info->data.target;
+ break;
+ case MONO_PATCH_INFO_LABEL:
+ target = S390_RELATIVE((patch_info->data.inst->inst_c0+code),ip);
+ ip += 2; /* Skip over op-code */
+ break;
+ case MONO_PATCH_INFO_IP:
+ target = ip;
+ continue;
+ case MONO_PATCH_INFO_METHOD_REL:
+ g_assert_not_reached ();
+ *((gpointer *)(ip)) = code + patch_info->data.offset;
+ continue;
+ case MONO_PATCH_INFO_INTERNAL_METHOD: {
+ MonoJitICallInfo *mi = mono_find_jit_icall_by_name (patch_info->data.name);
+ if (!mi) {
+ g_warning ("unknown MONO_PATCH_INFO_INTERNAL_METHOD %s", patch_info->data.name);
+ g_assert_not_reached ();
+ }
+ *((gpointer *)(ip)) = mono_icall_get_wrapper (mi);
+ break;
+ }
+ case MONO_PATCH_INFO_METHOD_JUMP: {
+ GSList *list;
+
+ /*------------------------------------------------------*/
+ /* get the trampoline to the method from the domain */
+ /*------------------------------------------------------*/
+ *((gpointer *)(ip)) = mono_create_jump_trampoline (
+ domain,
+ patch_info->data.method,
+ TRUE);
+
+
+ list = g_hash_table_lookup (domain->jump_target_hash,
+ patch_info->data.method);
+ list = g_slist_prepend (list, ip);
+ g_hash_table_insert (domain->jump_target_hash,
+ patch_info->data.method, list);
+ break;
+ }
+ case MONO_PATCH_INFO_METHOD:
+ if (patch_info->data.method == method) {
+ *((gpointer *)(ip)) = code;
+ } else {
+ /* get the trampoline to the method from the domain */
+ *((gpointer *)(ip)) = mono_arch_create_jit_trampoline(patch_info->data.method);
+ }
+ break;
+ case MONO_PATCH_INFO_SWITCH: {
+ gpointer *table = (gpointer *)patch_info->data.target;
+ int i;
+ /*------------------------------------------------------*/
+ /* ip is pointing at the basr r13,0/j +4 instruction */
+ /* the vtable value follows this (i.e. ip+6) */
+ /*------------------------------------------------------*/
+ *((gconstpointer *)(ip+6)) = table;
+
+ for (i = 0; i < patch_info->table_size; i++) {
+ table [i] = (int)patch_info->data.table [i] + code;
+ }
+ continue;
+ }
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IMAGE:
+ case MONO_PATCH_INFO_FIELD:
+ target = S390_RELATIVE(patch_info->data.target, ip);
+ continue;
+ case MONO_PATCH_INFO_R4:
+ case MONO_PATCH_INFO_R8:
+ g_assert_not_reached ();
+ *((gconstpointer *)(ip + 2)) = patch_info->data.target;
+ continue;
+ case MONO_PATCH_INFO_IID:
+ mono_class_init (patch_info->data.klass);
+ target = S390_RELATIVE(patch_info->data.klass->interface_id, ip);
+ continue;
+ case MONO_PATCH_INFO_VTABLE:
+ target = S390_RELATIVE(mono_class_vtable (domain, patch_info->data.klass),ip);
+ ip += 2;
+ continue;
+ case MONO_PATCH_INFO_CLASS_INIT:
+ target = S390_RELATIVE(mono_create_class_init_trampoline (mono_class_vtable (domain, patch_info->data.klass)), ip);
+ ip += 2;
+ break;
+ case MONO_PATCH_INFO_SFLDA: {
+ MonoVTable *vtable = mono_class_vtable (domain, patch_info->data.field->parent);
+ if (!vtable->initialized && !(vtable->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) && mono_class_needs_cctor_run (vtable->klass, method))
+ /* Done by the generated code */
+ ;
+ else {
+ if (run_cctors)
+ mono_runtime_class_init (vtable);
+ }
+ target = S390_RELATIVE((char*)vtable->data + patch_info->data.field->offset, ip);
+ ip += 2;
+ continue;
+ }
+ case MONO_PATCH_INFO_EXC_NAME:
+ *((gconstpointer *)(ip)) = patch_info->data.name;
+ continue;
+ case MONO_PATCH_INFO_LDSTR:
+ target = mono_ldstr (domain, patch_info->data.token->image,
+ mono_metadata_token_index (patch_info->data.token->token));
+ continue;
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE: {
+ gpointer handle;
+ MonoClass *handle_class;
+
+ handle = mono_ldtoken (patch_info->data.token->image,
+ patch_info->data.token->token,
+ &handle_class, NULL);
+ mono_class_init (handle_class);
+ mono_class_init (mono_class_from_mono_type (handle));
+
+ target = handle;
+ continue;
+ }
+ case MONO_PATCH_INFO_LDTOKEN: {
+ gpointer handle;
+ MonoClass *handle_class;
+
+ handle = mono_ldtoken (patch_info->data.token->image,
+ patch_info->data.token->token,
+ &handle_class, NULL);
+ mono_class_init (handle_class);
+
+ target = handle;
+ continue;
+ }
+ case MONO_PATCH_INFO_EXC:
+ /* everything is dealt with at epilog output time */
+ continue;
+ default:
+ g_assert_not_reached ();
+ }
+ s390_patch (ip, target);
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_max_epilog_size */
+/* */
+/* Function - Determine the maximum size of the epilog code. */
+/* */
+/*------------------------------------------------------------------*/
+
+int
+mono_arch_max_epilog_size (MonoCompile *cfg)
+{
+ int max_epilog_size = 256;
+ MonoJumpInfo *patch_info;
+
+ if (cfg->method->save_lmf)
+ max_epilog_size += 128;
+
+ if (mono_jit_trace_calls != NULL)
+ max_epilog_size += 128;
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ max_epilog_size += 128;
+
+ /* count the number of exception infos */
+
+ for (patch_info = cfg->patch_info;
+ patch_info;
+ patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_EXC)
+ max_epilog_size += 48;
+ }
+
+ return max_epilog_size;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_emit_prolog */
+/* */
+/* Function - Create the instruction sequence for a function */
+/* prolog. */
+/* */
+/*------------------------------------------------------------------*/
+
+guint8 *
+mono_arch_emit_prolog (MonoCompile *cfg)
+{
+ MonoMethod *method = cfg->method;
+ MonoBasicBlock *bb;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ int alloc_size, pos, max_offset, i, lmfOffset;
+ guint8 *code;
+ CallInfo *cinfo;
+ size_data sz;
+ int tracing = 0;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ tracing = 1;
+
+ cfg->code_size = 384;
+ cfg->native_code = code = g_malloc (cfg->code_size);
+
+ if (cfg->flags & MONO_CFG_HAS_TAIL) {
+ s390_stmg (code, s390_r2, s390_r14, STK_BASE, S390_PARM_SAVE_OFFSET);
+ for (pos = 0; pos < 4; pos++)
+ s390_std (code, pos*2, 0, STK_BASE,
+ S390_FLOAT_SAVE_OFFSET+pos*sizeof(double));
+ } else {
+ s390_stmg (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ }
+
+ if (cfg->flags & MONO_CFG_HAS_ALLOCA) {
+ cfg->used_int_regs |= 1 << 11;
+ }
+
+ alloc_size = cfg->stack_offset;
+
+ cfg->stack_usage = alloc_size;
+ s390_lgr (code, s390_r11, STK_BASE);
+ if (s390_is_imm16 (-alloc_size)) {
+ s390_aghi (code, STK_BASE, -alloc_size);
+ } else {
+ int stackSize = alloc_size;
+ while (stackSize > 32767) {
+ s390_aghi (code, STK_BASE, -32767);
+ stackSize -= 32767;
+ }
+ s390_aghi (code, STK_BASE, -stackSize);
+ }
+ s390_stg (code, s390_r11, 0, STK_BASE, 0);
+
+ if (cfg->frame_reg != STK_BASE)
+ s390_lgr (code, s390_r11, STK_BASE);
+
+ /* compute max_offset in order to use short forward jumps
+ * we always do it on s390 because the immediate displacement
+ * for jumps is too small
+ */
+ max_offset = 0;
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *ins = bb->code;
+ bb->max_offset = max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE)
+ max_offset += 6;
+
+ while (ins) {
+ max_offset += ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+ ins = ins->next;
+ }
+ }
+
+ /* load arguments allocated to register from the stack */
+ sig = method->signature;
+ pos = 0;
+
+ cinfo = calculate_sizes (sig, &sz, sig->pinvoke);
+
+ if (cinfo->struct_ret) {
+ ArgInfo *ainfo = &cinfo->ret;
+ inst = cfg->ret;
+ inst->unused = ainfo->vtsize;
+ s390_stg (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ }
+
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ inst = cfg->varinfo [pos];
+
+ if (inst->opcode == OP_REGVAR) {
+ if (ainfo->regtype == RegTypeGeneral)
+ s390_lgr (code, inst->dreg, ainfo->reg);
+ else if (ainfo->regtype == RegTypeFP) {
+ if (inst->dreg != ainfo->reg) {
+ if (ainfo->size == 4) {
+ s390_ledbr (code, inst->dreg, ainfo->reg);
+ } else {
+ s390_ldr (code, inst->dreg, ainfo->reg);
+ }
+ }
+ }
+ else if (ainfo->regtype == RegTypeBase) {
+ s390_lgr (code, s390_r13, STK_BASE);
+ s390_aghi(code, s390_r13, alloc_size);
+ s390_lg (code, inst->dreg, 0, s390_r13, ainfo->offset);
+ } else
+ g_assert_not_reached ();
+
+ if (cfg->verbose_level > 2)
+ g_print ("Argument %d assigned to register %s\n",
+ pos, mono_arch_regname (inst->dreg));
+ } else {
+ if (ainfo->regtype == RegTypeGeneral) {
+ if (!((ainfo->reg >= 2) && (ainfo->reg <= 6)))
+ g_assert_not_reached();
+ switch (ainfo->size) {
+ case 1:
+ s390_stc (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ break;
+ case 2:
+ s390_sth (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ break;
+ case 8:
+ s390_stg (code, ainfo->reg, 0,
+ inst->inst_basereg, inst->inst_offset);
+ break;
+ default:
+ s390_st (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ }
+ } else if (ainfo->regtype == RegTypeBase) {
+ } else if (ainfo->regtype == RegTypeFP) {
+ if (ainfo->size == 8)
+ s390_std (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ else if (ainfo->size == 4)
+ s390_ste (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
+ else
+ g_assert_not_reached ();
+ } else if (ainfo->regtype == RegTypeStructByVal) {
+ int doffset = inst->inst_offset;
+ int reg;
+ if (ainfo->reg != STK_BASE)
+ reg = ainfo->reg;
+ else {
+ reg = s390_r0;
+ s390_lgr (code, s390_r13, STK_BASE);
+ s390_aghi(code, s390_r13, alloc_size);
+ }
+ switch (ainfo->size) {
+ case 1:
+ if (ainfo->reg == STK_BASE)
+ s390_ic (code, reg, 0, s390_r13, ainfo->offset+3);
+ s390_stc (code, reg, 0, inst->inst_basereg, doffset);
+ break;
+ case 2:
+ if (ainfo->reg == STK_BASE)
+ s390_lh (code, reg, 0, s390_r13, ainfo->offset+2);
+ s390_sth (code, reg, 0, inst->inst_basereg, doffset);
+ break;
+ case 4:
+ if (ainfo->reg == STK_BASE)
+ s390_l (code, reg, 0, s390_r13, ainfo->offset);
+ s390_st (code, reg, 0, inst->inst_basereg, doffset);
+ break;
+ case 8:
+ if (ainfo->reg == STK_BASE)
+ s390_lg (code, s390_r0, 0, s390_r13, ainfo->offset);
+ s390_stg (code, reg, 0, inst->inst_basereg, doffset);
+ break;
+ }
+ } else if (ainfo->regtype == RegTypeStructByAddr) {
+ if (ainfo->reg == STK_BASE) {
+ s390_lgr (code, s390_r13, ainfo->reg);
+ s390_aghi(code, s390_r13, alloc_size);
+ s390_lg (code, s390_r13, 0, s390_r13,
+ ainfo->offparm + S390_MINIMAL_STACK_SIZE);
+ code = emit_memcpy (code, abs(ainfo->vtsize),
+ inst->inst_basereg,
+ inst->inst_offset, s390_r13, 0);
+ } else {
+ code = emit_memcpy (code, abs(ainfo->vtsize),
+ inst->inst_basereg,
+ inst->inst_offset,
+ ainfo->reg, 0);
+ }
+ } else
+ g_assert_not_reached ();
+ }
+ pos++;
+ }
+
+ if (method->save_lmf) {
+ /*---------------------------------------------------------------*/
+ /* Preserve the parameter registers while we fix up the lmf */
+ /*---------------------------------------------------------------*/
+ s390_lgr (code, s390_r7, s390_r2);
+ s390_lgr (code, s390_r8, s390_r3);
+ s390_lgr (code, s390_r9, s390_r4);
+ s390_lgr (code, s390_r10, s390_r5);
+
+ /*---------------------------------------------------------------*/
+ /* On return from this call r2 have the address of the &lmf */
+ /*---------------------------------------------------------------*/
+ s390_basr(code, s390_r13, 0);
+ s390_j (code, 6);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_get_lmf_addr");
+ s390_llong(code, 0);
+ s390_lg (code, s390_r1, 0, s390_r13, 4);
+ s390_basr (code, s390_r14, s390_r1);
+
+ /*---------------------------------------------------------------*/
+ /* we build the MonoLMF structure on the stack - see mini-s390.h */
+ /*---------------------------------------------------------------*/
+ lmfOffset = alloc_size - sizeof(MonoLMF);
+
+ s390_lgr (code, s390_r13, cfg->frame_reg);
+ s390_aghi (code, s390_r13, lmfOffset);
+
+ /*---------------------------------------------------------------*/
+ /* Set lmf.lmf_addr = jit_tls->lmf */
+ /*---------------------------------------------------------------*/
+ s390_stg (code, s390_r2, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, lmf_addr));
+
+ /*---------------------------------------------------------------*/
+ /* Get current lmf */
+ /*---------------------------------------------------------------*/
+ s390_lg (code, s390_r0, 0, s390_r2, 0);
+
+ /*---------------------------------------------------------------*/
+ /* Set our lmf as the current lmf */
+ /*---------------------------------------------------------------*/
+ s390_stg (code, s390_r13, 0, s390_r2, 0);
+
+ /*---------------------------------------------------------------*/
+ /* Have our lmf.previous_lmf point to the last lmf */
+ /*---------------------------------------------------------------*/
+ s390_stg (code, s390_r0, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, previous_lmf));
+
+ /*---------------------------------------------------------------*/
+ /* save method info */
+ /*---------------------------------------------------------------*/
+ s390_basr (code, s390_r1, 0);
+ s390_j (code, 6);
+ s390_llong (code, method);
+ s390_lg (code, s390_r1, 0, s390_r1, 4);
+ s390_stg (code, s390_r1, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, method));
+
+ /*---------------------------------------------------------------*/
+ /* save the current IP */
+ /*---------------------------------------------------------------*/
+ s390_lgr (code, s390_r1, cfg->frame_reg);
+ s390_stg (code, s390_r1, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, ebp));
+ s390_lg (code, s390_r1, 0, s390_r1, S390_RET_ADDR_OFFSET);
+ s390_la (code, s390_r1, 0, s390_r1, 0);
+ s390_stg (code, s390_r1, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, eip));
+
+ /*---------------------------------------------------------------*/
+ /* Save general and floating point registers */
+ /*---------------------------------------------------------------*/
+ s390_stmg (code, s390_r2, s390_r12, s390_r13, G_STRUCT_OFFSET(MonoLMF, gregs[2]));
+ for (i = 0; i < 16; i++) {
+ s390_std (code, i, 0, s390_r13, G_STRUCT_OFFSET(MonoLMF, fregs[i]));
+ }
+
+ /*---------------------------------------------------------------*/
+ /* Restore the parameter registers now that we've set up the lmf */
+ /*---------------------------------------------------------------*/
+ s390_lgr (code, s390_r2, s390_r7);
+ s390_lgr (code, s390_r3, s390_r8);
+ s390_lgr (code, s390_r4, s390_r9);
+ s390_lgr (code, s390_r5, s390_r10);
+ }
+
+ if (tracing)
+ code = mono_arch_instrument_prolog (cfg, enter_method, code, TRUE);
+
+ cfg->code_len = code - cfg->native_code;
+
+ g_assert(cfg->code_len < cfg->code_size);
+ g_free (cinfo);
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_emit_epilog */
+/* */
+/* Function - Emit the instructions for a function epilog. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_emit_epilog (MonoCompile *cfg)
+{
+ MonoJumpInfo *patch_info;
+ MonoMethod *method = cfg->method;
+ MonoMethodSignature *sig = method->signature;
+ MonoInst *inst;
+ int i, tracing = 0;
+ guint8 *code;
+
+ code = cfg->native_code + cfg->code_len;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method)) {
+ code = mono_arch_instrument_epilog (cfg, leave_method, code, TRUE);
+ tracing = 1;
+ }
+
+ if (method->save_lmf)
+ code = restoreLMF(cfg, code);
+
+ if (cfg->flags & MONO_CFG_HAS_ALLOCA)
+ s390_lg (code, STK_BASE, 0, STK_BASE, 0);
+ else
+ code = backUpStackPtr(cfg, code);
+
+ s390_lmg (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (code, s390_r14);
+
+ /* add code to raise exceptions */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_EXC: {
+ /*---------------------------------------------*/
+ /* Patch the branch in epilog to come here */
+ /*---------------------------------------------*/
+ s390_patch (patch_info->ip.i+cfg->native_code+2,
+ S390_RELATIVE(code,patch_info->ip.i+cfg->native_code));
+ /*---------------------------------------------*/
+ /* Patch the parameter passed to the handler */
+ /*---------------------------------------------*/
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ mono_add_patch_info (cfg, code - cfg->native_code,
+ MONO_PATCH_INFO_EXC_NAME,
+ patch_info->data.target);
+ s390_llong(code, 0);
+ /*-----------------------------------------------------*/
+ /* Load the return address and the parameter register */
+ /*-----------------------------------------------------*/
+ s390_larl (code, s390_r14, S390_RELATIVE((patch_info->ip.i +
+ cfg->native_code + 8), code));
+ s390_lg (code, s390_r2, 0, s390_r13, 4);
+ /*-----------------------------------------------------*/
+ /* Reuse the current patch to set the jump */
+ /*-----------------------------------------------------*/
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->data.name = "mono_arch_throw_exception_by_name";
+ patch_info->ip.i = code - cfg->native_code;
+ s390_llong(code, 0);
+ s390_lg (code, s390_r1, 0, s390_r13, 4);
+ s390_br (code, s390_r1);
+ break;
+ }
+ default:
+ /* do nothing */
+ break;
+ }
+ }
+
+ cfg->code_len = code - cfg->native_code;
+
+ g_assert (cfg->code_len < cfg->code_size);
+
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_setup_jit_tls_data */
+/* */
+/* Function - Setup the JIT's Thread Level Specific Data. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_setup_jit_tls_data (MonoJitTlsData *tls)
+{
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_free_jit_tls_data */
+/* */
+/* Function - Free tls data. */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_free_jit_tls_data (MonoJitTlsData *tls)
+{
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_emit_this_vret_args */
+/* */
+/* Function - */
+/* */
+/*------------------------------------------------------------------*/
+
+void
+mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg)
+{
+ int this_dreg = s390_r2;
+
+ if (vt_reg != -1)
+ this_dreg = s390_r3;
+
+ /* add the this argument */
+ if (this_reg != -1) {
+ MonoInst *this;
+ MONO_INST_NEW (cfg, this, OP_SETREG);
+ this->type = this_type;
+ this->sreg1 = this_reg;
+ this->dreg = this_dreg;
+ mono_bblock_add_inst (cfg->cbb, this);
+ }
+
+ if (vt_reg != -1) {
+ MonoInst *vtarg;
+ MONO_INST_NEW (cfg, vtarg, OP_SETREG);
+ vtarg->type = STACK_MP;
+ vtarg->sreg1 = vt_reg;
+ vtarg->dreg = s390_r2;
+ mono_bblock_add_inst (cfg->cbb, vtarg);
+ }
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_opcode_for_method */
+/* */
+/* Function - Check for opcodes we can handle directly in */
+/* hardware. */
+/* */
+/*------------------------------------------------------------------*/
+
+gint
+mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
+{
+ if (cmethod->klass == mono_defaults.math_class) {
+ if (strcmp (cmethod->name, "Sqrt") == 0)
+ return OP_SQRT;
+ }
+ return -1;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_print_tree */
+/* */
+/* Function - Print platform-specific opcode details. */
+/* */
+/* Returns - 1 - opcode details have been printed */
+/* 0 - opcode details have not been printed */
+/* */
+/*------------------------------------------------------------------*/
+
+gboolean
+mono_arch_print_tree (MonoInst *tree, int arity)
+{
+ gboolean done;
+
+ switch (tree->opcode) {
+ case OP_S390_LOADARG:
+ case OP_S390_ARGPTR:
+ case OP_S390_STKARG:
+ printf ("[0x%x(%s)]", tree->inst_offset,
+ mono_arch_regname (tree->inst_basereg));
+ done = 1;
+ break;
+ case OP_S390_MOVE:
+ printf ("[0x%x(%d,%s),0x%x(%s)]",
+ tree->inst_offset, tree->unused,
+ tree->dreg, tree->inst_imm,
+ tree->sreg1);
+ done = 1;
+ break;
+ case OP_S390_SETF4RET:
+ printf ("[f%d,f%d]",
+ mono_arch_regname (tree->dreg),
+ mono_arch_regname (tree->sreg1));
+ default:
+ done = 0;
+ }
+ return (done);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_regalloc_cost */
+/* */
+/* Function - Determine the cost, in the number of memory */
+/* references, of the action of allocating the var- */
+/* iable VMV into a register during global register */
+/* allocation. */
+/* */
+/* Returns - Cost */
+/* */
+/*------------------------------------------------------------------*/
+
+guint32
+mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv)
+{
+ /* FIXME: */
+ return 3;
+}
+
+/*========================= End of Function ========================*/
+
+MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+}
+
+MonoInst* mono_arch_get_thread_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+} \ No newline at end of file
diff --git a/mono/mini/mini-s390x.h b/mono/mini/mini-s390x.h
new file mode 100644
index 00000000000..77c190b571c
--- /dev/null
+++ b/mono/mini/mini-s390x.h
@@ -0,0 +1,156 @@
+#ifndef __MONO_MINI_S390X_H__
+#define __MONO_MINI_S390X_H__
+
+#include <mono/arch/s390x/s390x-codegen.h>
+#include <signal.h>
+
+#define MONO_MAX_IREGS 16
+#define MONO_MAX_FREGS 16
+
+#define MONO_ARCH_FRAME_ALIGNMENT 8
+
+#define MONO_EMIT_NEW_MOVE(cfg,dest,offset,src,imm,size) do { \
+ MonoInst *inst; \
+ int tmpr = 0; \
+ int sReg, dReg; \
+ \
+ inst = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ if (size > 256) { \
+ tmpr = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_ICONST(cfg,tmpr,size); \
+ inst->dreg = dest; \
+ inst->inst_offset = offset; \
+ inst->sreg1 = src; \
+ inst->inst_imm = imm; \
+ inst->sreg2 = tmpr; \
+ } else { \
+ if (s390_is_uimm12(offset)) { \
+ inst->dreg = dest; \
+ inst->inst_offset = offset; \
+ } else { \
+ dReg = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_BIALU_IMM(cfg, OP_ADD_IMM, \
+ dReg, dest, offset); \
+ inst->dreg = dReg; \
+ inst->inst_offset = 0; \
+ } \
+ if (s390_is_uimm12(imm)) { \
+ inst->sreg1 = src; \
+ inst->inst_imm = imm; \
+ } else { \
+ sReg = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_BIALU_IMM(cfg, OP_ADD_IMM, \
+ sReg, src, imm); \
+ inst->sreg1 = sReg; \
+ inst->inst_imm = 0; \
+ } \
+ } \
+ inst->opcode = OP_S390_MOVE; \
+ inst->unused = size; \
+ mono_bblock_add_inst (cfg->cbb, inst); \
+ } while (0)
+
+#define MONO_OUTPUT_VTR(cfg, size, dr, sr, so) do { \
+ switch (size) { \
+ case 1: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU1_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ case 2: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU2_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ case 4: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU4_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ case 8: \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOAD_MEMBASE, \
+ dr, sr, so); \
+ break; \
+ } \
+} while (0)
+
+#define MONO_OUTPUT_VTS(cfg, size, dr, dx, sr, so) do { \
+ int tmpr; \
+ switch (size) { \
+ case 1: \
+ tmpr = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU1_MEMBASE, \
+ tmpr, sr, so); \
+ MONO_EMIT_NEW_STORE_MEMBASE(cfg, OP_STORE_MEMBASE_REG, \
+ tmpr, dr, dx); \
+ break; \
+ case 2: \
+ tmpr = mono_regstate_next_int (cfg->rs); \
+ MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADU2_MEMBASE, \
+ tmpr, sr, so); \
+ MONO_EMIT_NEW_STORE_MEMBASE(cfg, OP_STORE_MEMBASE_REG, \
+ tmpr, dr, dx); \
+ break; \
+ case 4: \
+ case 8: \
+ MONO_EMIT_NEW_MOVE (cfg, dr, dx, sr, so, size); \
+ break; \
+ } \
+} while (0)
+
+/* fixme: align to 16byte instead of 32byte (we align to 32byte to get
+ * reproduceable results for benchmarks */
+#define MONO_ARCH_CODE_ALIGNMENT 32
+
+struct MonoLMF {
+ gpointer previous_lmf;
+ gpointer lmf_addr;
+ MonoMethod *method;
+ gulong ebp;
+ gulong eip;
+ gulong gregs[16];
+ gdouble fregs[16];
+};
+
+typedef struct ucontext MonoContext;
+
+typedef struct MonoCompileArch {
+} MonoCompileArch;
+
+#define MONO_ARCH_EMULATE_FCONV_TO_I8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R4 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
+#define MONO_ARCH_EMULATE_LMUL 1
+#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS 1
+
+#define MONO_ARCH_USE_SIGACTION 1
+
+#define S390_STACK_ALIGNMENT 8
+#define S390_FIRST_ARG_REG s390_r2
+#define S390_LAST_ARG_REG s390_r6
+#define S390_FIRST_FPARG_REG s390_f0
+#define S390_LAST_FPARG_REG s390_f2
+#define S390_PASS_STRUCTS_BY_VALUE 1
+#define S390_SMALL_RET_STRUCT_IN_REG 1
+
+#define S390_NUM_REG_ARGS (S390_LAST_ARG_REG-S390_FIRST_ARG_REG+1)
+#define S390_NUM_REG_FPARGS (S390_LAST_FPARG_REG-S390_FIRST_FPARG_REG)
+
+#define S390_OFFSET(b, t) (gint32) ((gint64) (b) - (gint64) (t))
+#define S390_RELATIVE(b, t) (gint32) ((((gint64) (b) - (gint64) (t))) / 2)
+
+#define CODEPTR(c, o) (o) = (short *) ((gint64) c - 2)
+#define PTRSLOT(c, o) *(o) = (short) ((gint64) c - (gint64) (o) + 2)/2
+
+#define S390_CC_EQ 8
+#define S390_ALIGN(v, a) (((a) > 0 ? (((v) + ((a) - 1)) & ~((a) - 1)) : (v)))
+
+static void inline
+s390_patch (guchar *code, gint32 target)
+{
+ gint32 *offset = (gint32 *) code;
+
+ if (target != 00) {
+ *offset = target;
+ }
+}
+
+#endif /* __MONO_MINI_S390_H__ */
diff --git a/mono/mini/mini-sparc.c b/mono/mini/mini-sparc.c
new file mode 100644
index 00000000000..a13567d3702
--- /dev/null
+++ b/mono/mini/mini-sparc.c
@@ -0,0 +1,4780 @@
+/*
+ * mini-sparc.c: Sparc backend for the Mono code generator
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * Modified for SPARC:
+ * Christopher Taylor (ct@gentoo.org)
+ * Mark Crichton (crichton@gimp.org)
+ * Zoltan Varga (vargaz@freemail.hu)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include "mini.h"
+#include <string.h>
+#include <pthread.h>
+#include <unistd.h>
+
+#ifndef __linux__
+#include <sys/systeminfo.h>
+#include <thread.h>
+#endif
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/utils/mono-math.h>
+
+#include "mini-sparc.h"
+#include "inssel.h"
+#include "trace.h"
+#include "cpu-sparc.h"
+
+/*
+ * Sparc V9 means two things:
+ * - the instruction set
+ * - the ABI
+ *
+ * V9 instructions are only usable if the underlying processor is 64 bit. Most Sparc
+ * processors in use are 64 bit processors. The V9 ABI is only usable if the
+ * mono executable is a 64 bit executable. So it would make sense to use the 64 bit
+ * instructions without using the 64 bit ABI.
+ */
+
+/*
+ * Register usage:
+ * - %i0..%i<n> hold the incoming arguments, these are never written by JITted
+ * code. Unused input registers are used for global register allocation.
+ * - %l0..%l7 is used for local register allocation
+ * - %o0..%o6 is used for outgoing arguments
+ * - %o7 and %g1 is used as scratch registers in opcodes
+ * - all floating point registers are used for local register allocation except %f0.
+ * Only double precision registers are used.
+ * In 64 bit mode:
+ * - fp registers %d0..%d30 are used for parameter passing, and %d32..%d62 are
+ * used for local allocation.
+ */
+
+/*
+ * Alignment:
+ * - doubles and longs must be stored in dword aligned locations
+ */
+
+/*
+ * The following things are not implemented or do not work:
+ * - some fp arithmetic corner cases
+ * The following tests in mono/mini are expected to fail:
+ * - test_0_simple_double_casts
+ * This test casts (guint64)-1 to double and then back to guint64 again.
+ * Under x86, it returns 0, while under sparc it returns -1.
+ *
+ * In addition to this, the runtime requires the trunc function, or its
+ * solaris counterpart, aintl, to do some double->int conversions. If this
+ * function is not available, it is emulated somewhat, but the results can be
+ * strange.
+ */
+
+/*
+ * SPARCV9 FIXME:
+ * - optimize sparc_set according to the memory model
+ * - when non-AOT compiling, compute patch targets immediately so we don't
+ * have to emit the 6 byte template.
+ * - varags
+ * - struct arguments/returns
+ */
+
+/*
+ * SPARCV9 ISSUES:
+ * - sparc_call_simple can't be used in a lot of places since the displacement
+ * might not fit into an imm30.
+ * - g1 can't be used in a lot of places since it is used as a scratch reg in
+ * sparc_set.
+ * - sparc_f0 can't be used as a scratch register on V9
+ * - the %d34..%d62 fp registers are encoded as: %dx = %f(x - 32 + 1), ie.
+ * %d36 = %f5.
+ * - ldind.i4/u4 needs to sign extend/clear out upper word -> slows things down
+ * - ins->dreg can't be used as a scatch register in r4 opcodes since it might
+ * be a double precision register which has no single precision part.
+ * - passing/returning structs is hard to implement, because:
+ * - the spec is very hard to understand
+ * - it requires knowledge about the fields of structure, needs to handle
+ * nested structures etc.
+ */
+
+/*
+ * Possible optimizations:
+ * - delay slot scheduling
+ * - allocate large constants to registers
+ * - use %o registers for local allocation
+ * - implement unwinding through native frames
+ * - add more mul/div/rem optimizations
+ */
+
+#ifndef __linux__
+#define MONO_SPARC_THR_TLS 1
+#endif
+
+/*
+ * There was a 64 bit bug in glib-2.2: g_bit_nth_msf (0, -1) would return 32,
+ * causing infinite loops in dominator computation. So glib-2.4 is required.
+ */
+#ifdef SPARCV9
+#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 4
+#error "glib 2.4 or later is required for 64 bit mode."
+#endif
+#endif
+
+#define NOT_IMPLEMENTED do { g_assert_not_reached (); } while (0)
+
+#define ALIGN_TO(val,align) (((val) + ((align) - 1)) & ~((align) - 1))
+
+#define SIGNAL_STACK_SIZE (64 * 1024)
+
+#define STACK_BIAS MONO_SPARC_STACK_BIAS
+
+#ifdef SPARCV9
+
+/* %g1 is used by sparc_set */
+#define GP_SCRATCH_REG sparc_g4
+/* %f0 is used for parameter passing */
+#define FP_SCRATCH_REG sparc_f30
+#define ARGS_OFFSET (STACK_BIAS + 128)
+
+#else
+
+#define FP_SCRATCH_REG sparc_f0
+#define ARGS_OFFSET 68
+#define GP_SCRATCH_REG sparc_g1
+
+#endif
+
+/* Whenever the CPU supports v9 instructions */
+static gboolean sparcv9 = FALSE;
+
+/* Whenever this is a 64bit executable */
+#if SPARCV9
+static gboolean v64 = TRUE;
+#else
+static gboolean v64 = FALSE;
+#endif
+
+static gpointer mono_arch_get_lmf_addr (void);
+
+static int
+mono_spillvar_offset_float (MonoCompile *cfg, int spillvar);
+
+const char*
+mono_arch_regname (int reg) {
+ static const char * rnames[] = {
+ "sparc_g0", "sparc_g1", "sparc_g2", "sparc_g3", "sparc_g4",
+ "sparc_g5", "sparc_g6", "sparc_g7", "sparc_o0", "sparc_o1",
+ "sparc_o2", "sparc_o3", "sparc_o4", "sparc_o5", "sparc_sp",
+ "sparc_call", "sparc_l0", "sparc_l1", "sparc_l2", "sparc_l3",
+ "sparc_l4", "sparc_l5", "sparc_l6", "sparc_l7", "sparc_i0",
+ "sparc_i1", "sparc_i2", "sparc_i3", "sparc_i4", "sparc_i5",
+ "sparc_fp", "sparc_retadr"
+ };
+ if (reg >= 0 && reg < 32)
+ return rnames [reg];
+ return "unknown";
+}
+
+/*
+ * Initialize the cpu to execute managed code.
+ */
+void
+mono_arch_cpu_init (void)
+{
+ guint32 dummy;
+ /* make sure sparcv9 is initialized for embedded use */
+ mono_arch_cpu_optimizazions(&dummy);
+}
+
+/*
+ * This function returns the optimizations supported on this cpu.
+ */
+guint32
+mono_arch_cpu_optimizazions (guint32 *exclude_mask)
+{
+ char buf [1024];
+ guint32 opts = 0;
+
+ *exclude_mask = 0;
+
+#ifndef __linux__
+ if (!sysinfo (SI_ISALIST, buf, 1024))
+ g_assert_not_reached ();
+#else
+ /* From glibc. If the getpagesize is 8192, we're on sparc64, which
+ * (in)directly implies that we're a v9 or better.
+ * Improvements to this are greatly accepted...
+ * Also, we don't differentiate between v7 and v8. I sense SIGILL
+ * sniffing in my future.
+ */
+ if (getpagesize() == 8192)
+ strcpy (buf, "sparcv9");
+ else
+ strcpy (buf, "sparcv8");
+#endif
+
+ /*
+ * On some processors, the cmov instructions are even slower than the
+ * normal ones...
+ */
+ if (strstr (buf, "sparcv9")) {
+ opts |= MONO_OPT_CMOV | MONO_OPT_FCMOV;
+ sparcv9 = TRUE;
+ }
+ else
+ *exclude_mask |= MONO_OPT_CMOV | MONO_OPT_FCMOV;
+
+ return opts;
+}
+
+static void
+mono_sparc_break (void)
+{
+}
+
+#ifdef __GNUC__
+#define flushi(addr) __asm__ __volatile__ ("iflush %0"::"r"(addr):"memory")
+#else /* assume Sun's compiler */
+static void flushi(void *addr)
+{
+ asm("flush %i0");
+}
+#endif
+
+#ifndef __linux__
+void sync_instruction_memory(caddr_t addr, int len);
+#endif
+
+void
+mono_arch_flush_icache (guint8 *code, gint size)
+{
+#ifndef __linux__
+ /* Hopefully this is optimized based on the actual CPU */
+ sync_instruction_memory (code, size);
+#else
+ guint64 *p = (guint64*)code;
+ guint64 *end = (guint64*)(code + ((size + 8) /8));
+
+ /*
+ * FIXME: Flushing code in dword chunks in _slow_.
+ */
+ while (p < end)
+#ifdef __GNUC__
+ __asm__ __volatile__ ("iflush %0"::"r"(p++));
+#else
+ flushi (p ++);
+#endif
+#endif
+}
+
+/*
+ * mono_sparc_flushw:
+ *
+ * Flush all register windows to memory. Every register window is saved to
+ * a 16 word area on the stack pointed to by its %sp register.
+ */
+void
+mono_sparc_flushw (void)
+{
+ static guint32 start [64];
+ static int inited = 0;
+ guint32 *code;
+ static void (*flushw) (void);
+
+ if (!inited) {
+ code = start;
+
+ sparc_save_imm (code, sparc_sp, -160, sparc_sp);
+ sparc_flushw (code);
+ sparc_ret (code);
+ sparc_restore_simple (code);
+
+ g_assert ((code - start) < 64);
+
+ flushw = (gpointer)start;
+
+ inited = 1;
+ }
+
+ flushw ();
+}
+
+void
+mono_arch_flush_register_windows (void)
+{
+ mono_sparc_flushw ();
+}
+
+gboolean
+mono_arch_is_inst_imm (gint64 imm)
+{
+ return sparc_is_imm13 (imm);
+}
+
+gboolean
+mono_sparc_is_v9 (void) {
+ return sparcv9;
+}
+
+gboolean
+mono_sparc_is_sparc64 (void) {
+ return v64;
+}
+
+typedef enum {
+ ArgInIReg,
+ ArgInIRegPair,
+ ArgInSplitRegStack,
+ ArgInFReg,
+ ArgInFRegPair,
+ ArgOnStack,
+ ArgOnStackPair,
+ ArgInFloatReg, /* V9 only */
+ ArgInDoubleReg /* V9 only */
+} ArgStorage;
+
+typedef struct {
+ gint16 offset;
+ /* This needs to be offset by %i0 or %o0 depending on caller/callee */
+ gint8 reg;
+ ArgStorage storage;
+ guint32 vt_offset; /* for valuetypes */
+} ArgInfo;
+
+typedef struct {
+ int nargs;
+ guint32 stack_usage;
+ guint32 reg_usage;
+ ArgInfo ret;
+ ArgInfo sig_cookie;
+ ArgInfo args [1];
+} CallInfo;
+
+#define DEBUG(a)
+
+/* %o0..%o5 */
+#define PARAM_REGS 6
+
+static void inline
+add_general (guint32 *gr, guint32 *stack_size, ArgInfo *ainfo, gboolean pair)
+{
+ ainfo->offset = *stack_size;
+
+ if (!pair) {
+ if (*gr >= PARAM_REGS) {
+ ainfo->storage = ArgOnStack;
+ }
+ else {
+ ainfo->storage = ArgInIReg;
+ ainfo->reg = *gr;
+ (*gr) ++;
+ }
+
+ /* Allways reserve stack space for parameters passed in registers */
+ (*stack_size) += sizeof (gpointer);
+ }
+ else {
+ if (*gr < PARAM_REGS - 1) {
+ /* A pair of registers */
+ ainfo->storage = ArgInIRegPair;
+ ainfo->reg = *gr;
+ (*gr) += 2;
+ }
+ else if (*gr >= PARAM_REGS) {
+ /* A pair of stack locations */
+ ainfo->storage = ArgOnStackPair;
+ }
+ else {
+ ainfo->storage = ArgInSplitRegStack;
+ ainfo->reg = *gr;
+ (*gr) ++;
+ }
+
+ (*stack_size) += 2 * sizeof (gpointer);
+ }
+}
+
+#ifdef SPARCV9
+
+#define FLOAT_PARAM_REGS 32
+
+static void inline
+add_float (guint32 *gr, guint32 *stack_size, ArgInfo *ainfo, gboolean single)
+{
+ ainfo->offset = *stack_size;
+
+ if (single) {
+ if (*gr >= FLOAT_PARAM_REGS) {
+ ainfo->storage = ArgOnStack;
+ }
+ else {
+ /* A single is passed in an even numbered fp register */
+ ainfo->storage = ArgInFloatReg;
+ ainfo->reg = *gr + 1;
+ (*gr) += 2;
+ }
+ }
+ else {
+ if (*gr < FLOAT_PARAM_REGS) {
+ /* A double register */
+ ainfo->storage = ArgInDoubleReg;
+ ainfo->reg = *gr;
+ (*gr) += 2;
+ }
+ else {
+ ainfo->storage = ArgOnStack;
+ }
+ }
+
+ (*stack_size) += sizeof (gpointer);
+}
+
+#endif
+
+/*
+ * get_call_info:
+ *
+ * Obtain information about a call according to the calling convention.
+ * For V8, see the "System V ABI, Sparc Processor Supplement" Sparc V8 version
+ * document for more information.
+ * For V9, see the "Low Level System Information (64-bit psABI)" chapter in
+ * the 'Sparc Compliance Definition 2.4' document.
+ */
+static CallInfo*
+get_call_info (MonoMethodSignature *sig, gboolean is_pinvoke)
+{
+ guint32 i, gr, fr;
+ int n = sig->hasthis + sig->param_count;
+ guint32 stack_size = 0;
+ CallInfo *cinfo;
+
+ cinfo = g_malloc0 (sizeof (CallInfo) + (sizeof (ArgInfo) * n));
+
+ gr = 0;
+ fr = 0;
+
+#ifdef SPARCV9
+ if (MONO_TYPE_ISSTRUCT ((sig->ret))) {
+ /* The address of the return value is passed in %o0 */
+ add_general (&gr, &stack_size, &cinfo->ret, FALSE);
+ cinfo->ret.reg += sparc_i0;
+ }
+#endif
+
+ /* this */
+ if (sig->hasthis)
+ add_general (&gr, &stack_size, cinfo->args + 0, FALSE);
+
+ for (i = 0; i < sig->param_count; ++i) {
+ ArgInfo *ainfo = &cinfo->args [sig->hasthis + i];
+
+ if ((sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) {
+ /* Emit the signature cookie just before the implicit arguments */
+ add_general (&gr, &stack_size, &cinfo->sig_cookie, FALSE);
+ /* Prevent implicit arguments from being passed in registers */
+ gr = PARAM_REGS;
+ }
+
+ DEBUG(printf("param %d: ", i));
+ if (sig->params [i]->byref) {
+ DEBUG(printf("byref\n"));
+
+ add_general (&gr, &stack_size, ainfo, FALSE);
+ continue;
+ }
+ switch (mono_type_get_underlying_type (sig->params [i])->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ add_general (&gr, &stack_size, ainfo, FALSE);
+ /* the value is in the ls byte */
+ ainfo->offset += sizeof (gpointer) - 1;
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ add_general (&gr, &stack_size, ainfo, FALSE);
+ /* the value is in the ls word */
+ ainfo->offset += sizeof (gpointer) - 2;
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ add_general (&gr, &stack_size, ainfo, FALSE);
+ /* the value is in the ls dword */
+ ainfo->offset += sizeof (gpointer) - 4;
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ add_general (&gr, &stack_size, ainfo, FALSE);
+ break;
+ case MONO_TYPE_VALUETYPE:
+#ifdef SPARCV9
+ if (sig->pinvoke)
+ NOT_IMPLEMENTED;
+#endif
+ add_general (&gr, &stack_size, ainfo, FALSE);
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ add_general (&gr, &stack_size, ainfo, FALSE);
+ break;
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+#ifdef SPARCV9
+ add_general (&gr, &stack_size, ainfo, FALSE);
+#else
+ add_general (&gr, &stack_size, ainfo, TRUE);
+#endif
+ break;
+ case MONO_TYPE_R4:
+#ifdef SPARCV9
+ add_float (&fr, &stack_size, ainfo, TRUE);
+ gr ++;
+#else
+ /* single precision values are passed in integer registers */
+ add_general (&gr, &stack_size, ainfo, FALSE);
+#endif
+ break;
+ case MONO_TYPE_R8:
+#ifdef SPARCV9
+ add_float (&fr, &stack_size, ainfo, FALSE);
+ gr ++;
+#else
+ /* double precision values are passed in a pair of registers */
+ add_general (&gr, &stack_size, ainfo, TRUE);
+#endif
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
+ /* return value */
+ {
+ switch (mono_type_get_underlying_type (sig->ret)->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_STRING:
+ cinfo->ret.storage = ArgInIReg;
+ cinfo->ret.reg = sparc_i0;
+ if (gr < 1)
+ gr = 1;
+ break;
+ case MONO_TYPE_U8:
+ case MONO_TYPE_I8:
+#ifdef SPARCV9
+ cinfo->ret.storage = ArgInIReg;
+ cinfo->ret.reg = sparc_i0;
+ if (gr < 1)
+ gr = 1;
+#else
+ cinfo->ret.storage = ArgInIRegPair;
+ cinfo->ret.reg = sparc_i0;
+ if (gr < 2)
+ gr = 2;
+#endif
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ cinfo->ret.storage = ArgInFReg;
+ cinfo->ret.reg = sparc_f0;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ if (v64) {
+ if (sig->pinvoke)
+ NOT_IMPLEMENTED;
+ else
+ /* Already done */
+ ;
+ }
+ else
+ cinfo->ret.storage = ArgOnStack;
+ break;
+ case MONO_TYPE_TYPEDBYREF:
+ if (v64) {
+ if (sig->pinvoke)
+ /* Same as a valuetype with size 24 */
+ NOT_IMPLEMENTED;
+ else
+ /* Already done */
+ ;
+ }
+ else
+ cinfo->ret.storage = ArgOnStack;
+ break;
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ g_error ("Can't handle as return value 0x%x", sig->ret->type);
+ }
+ }
+
+ cinfo->stack_usage = stack_size;
+ cinfo->reg_usage = gr;
+ return cinfo;
+}
+
+static gboolean
+is_regsize_var (MonoType *t) {
+ if (t->byref)
+ return TRUE;
+ switch (mono_type_get_underlying_type (t)->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ return TRUE;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return TRUE;
+ case MONO_TYPE_VALUETYPE:
+ return FALSE;
+#ifdef SPARCV9
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ return TRUE;
+#endif
+ }
+ return FALSE;
+}
+
+GList *
+mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
+{
+ GList *vars = NULL;
+ int i;
+
+ /*
+ * FIXME: If an argument is allocated to a register, then load it from the
+ * stack in the prolog.
+ */
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoInst *ins = cfg->varinfo [i];
+ MonoMethodVar *vmv = MONO_VARINFO (cfg, i);
+
+ /* unused vars */
+ if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos)
+ continue;
+
+ /* FIXME: Make arguments on stack allocateable to registers */
+ if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) || (ins->opcode == OP_REGVAR) || (ins->opcode == OP_ARG))
+ continue;
+
+ if (is_regsize_var (ins->inst_vtype)) {
+ g_assert (MONO_VARINFO (cfg, i)->reg == -1);
+ g_assert (i == vmv->idx);
+
+ vars = mono_varlist_insert_sorted (cfg, vars, vmv, FALSE);
+ }
+ }
+
+ return vars;
+}
+
+GList *
+mono_arch_get_global_int_regs (MonoCompile *cfg)
+{
+ GList *regs = NULL;
+ int i;
+ MonoMethodSignature *sig;
+ CallInfo *cinfo;
+
+ sig = cfg->method->signature;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ /* Use unused input registers */
+ for (i = cinfo->reg_usage; i < 6; ++i)
+ regs = g_list_prepend (regs, GUINT_TO_POINTER (sparc_i0 + i));
+
+ /* Use %l0..%l3 as global registers */
+ for (i = sparc_l0; i < sparc_l4; ++i)
+ regs = g_list_prepend (regs, GUINT_TO_POINTER (i));
+
+ g_free (cinfo);
+
+ return regs;
+}
+
+/*
+ * mono_arch_regalloc_cost:
+ *
+ * Return the cost, in number of memory references, of the action of
+ * allocating the variable VMV into a register during global register
+ * allocation.
+ */
+guint32
+mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv)
+{
+ return 0;
+}
+
+/*
+ * Set var information according to the calling convention. sparc version.
+ * The locals var stuff should most likely be split in another method.
+ */
+void
+mono_arch_allocate_vars (MonoCompile *m)
+{
+ MonoMethodSignature *sig;
+ MonoMethodHeader *header;
+ MonoInst *inst;
+ int i, offset, size, align, curinst;
+ CallInfo *cinfo;
+
+ header = mono_method_get_header (m->method);
+
+ sig = m->method->signature;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ if (sig->ret->type != MONO_TYPE_VOID) {
+ switch (cinfo->ret.storage) {
+ case ArgInIReg:
+ case ArgInFReg:
+ case ArgInIRegPair:
+ m->ret->opcode = OP_REGVAR;
+ m->ret->inst_c0 = cinfo->ret.reg;
+ break;
+ case ArgOnStack:
+#ifdef SPARCV9
+ g_assert_not_reached ();
+#else
+ /* valuetypes */
+ m->ret->opcode = OP_REGOFFSET;
+ m->ret->inst_basereg = sparc_fp;
+ m->ret->inst_offset = 64;
+#endif
+ break;
+ default:
+ NOT_IMPLEMENTED;
+ }
+ m->ret->dreg = m->ret->inst_c0;
+ }
+
+ /*
+ * We use the ABI calling conventions for managed code as well.
+ * Exception: valuetypes are never returned in registers on V9.
+ * FIXME: Use something more optimized.
+ */
+
+ /* Locals are allocated backwards from %fp */
+ m->frame_reg = sparc_fp;
+ offset = 0;
+
+ /*
+ * Reserve a stack slot for holding information used during exception
+ * handling.
+ */
+ if (header->num_clauses)
+ offset += sizeof (gpointer) * 2;
+
+ if (m->method->save_lmf) {
+ offset += sizeof (MonoLMF);
+ m->arch.lmf_offset = offset;
+ }
+
+ curinst = m->locals_start;
+ for (i = curinst; i < m->num_varinfo; ++i) {
+ inst = m->varinfo [i];
+
+ if (inst->opcode == OP_REGVAR) {
+ //g_print ("allocating local %d to %s\n", i, mono_arch_regname (inst->dreg));
+ continue;
+ }
+
+ /* inst->unused indicates native sized value types, this is used by the
+ * pinvoke wrappers when they call functions returning structure */
+ if (inst->unused && MONO_TYPE_ISSTRUCT (inst->inst_vtype) && inst->inst_vtype->type != MONO_TYPE_TYPEDBYREF)
+ size = mono_class_native_size (inst->inst_vtype->data.klass, &align);
+ else
+ size = mono_type_stack_size (inst->inst_vtype, &align);
+
+ /*
+ * This is needed since structures containing doubles must be doubleword
+ * aligned.
+ * FIXME: Do this only if needed.
+ */
+ if (MONO_TYPE_ISSTRUCT (inst->inst_vtype))
+ align = 8;
+
+ /*
+ * variables are accessed as negative offsets from %fp, so increase
+ * the offset before assigning it to a variable
+ */
+ offset += size;
+
+ offset += align - 1;
+ offset &= ~(align - 1);
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = sparc_fp;
+ inst->inst_offset = STACK_BIAS + -offset;
+
+ //g_print ("allocating local %d to [%s - %d]\n", i, mono_arch_regname (inst->inst_basereg), - inst->inst_offset);
+ }
+
+ if (sig->call_convention == MONO_CALL_VARARG) {
+ m->sig_cookie = cinfo->sig_cookie.offset + ARGS_OFFSET;
+ }
+
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ inst = m->varinfo [i];
+ if (inst->opcode != OP_REGVAR) {
+ ArgInfo *ainfo = &cinfo->args [i];
+ gboolean inreg = TRUE;
+ MonoType *arg_type;
+ ArgStorage storage;
+
+ if (sig->hasthis && (i == 0))
+ arg_type = &mono_defaults.object_class->byval_arg;
+ else
+ arg_type = sig->params [i - sig->hasthis];
+
+#ifndef SPARCV9
+ if (!arg_type->byref && ((arg_type->type == MONO_TYPE_R4)
+ || (arg_type->type == MONO_TYPE_R8)))
+ /*
+ * Since float arguments are passed in integer registers, we need to
+ * save them to the stack in the prolog.
+ */
+ inreg = FALSE;
+#endif
+
+ /* FIXME: Allocate volatile arguments to registers */
+ if (inst->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT))
+ inreg = FALSE;
+
+ if (MONO_TYPE_ISSTRUCT (arg_type))
+ /* FIXME: this isn't needed */
+ inreg = FALSE;
+
+ inst->opcode = OP_REGOFFSET;
+
+ if (!inreg)
+ storage = ArgOnStack;
+ else
+ storage = ainfo->storage;
+
+ switch (storage) {
+ case ArgInIReg:
+ case ArgInIRegPair:
+ inst->opcode = OP_REGVAR;
+ inst->dreg = sparc_i0 + ainfo->reg;
+ break;
+ case ArgInFloatReg:
+ case ArgInDoubleReg:
+ /*
+ * Since float regs are volatile, we save the arguments to
+ * the stack in the prolog.
+ * FIXME: Avoid this if the method contains no calls.
+ */
+ case ArgOnStack:
+ case ArgOnStackPair:
+ case ArgInSplitRegStack:
+ /* Split arguments are saved to the stack in the prolog */
+ inst->opcode = OP_REGOFFSET;
+ /* in parent frame */
+ inst->inst_basereg = sparc_fp;
+ inst->inst_offset = ainfo->offset + ARGS_OFFSET;
+
+ if (!arg_type->byref && (arg_type->type == MONO_TYPE_R8)) {
+ /*
+ * It is very hard to load doubles from non-doubleword aligned
+ * memory locations. So if the offset is misaligned, we copy the
+ * argument to a stack location in the prolog.
+ */
+ if ((inst->inst_offset - STACK_BIAS) % 8) {
+ inst->inst_basereg = sparc_fp;
+ offset += 8;
+ align = 8;
+ offset += align - 1;
+ offset &= ~(align - 1);
+ inst->inst_offset = STACK_BIAS + -offset;
+
+ }
+ }
+ break;
+ default:
+ NOT_IMPLEMENTED;
+ }
+
+ if (MONO_TYPE_ISSTRUCT (arg_type)) {
+ /* Add a level of indirection */
+ /*
+ * It would be easier to add OP_LDIND_I here, but ldind_i instructions
+ * are destructively modified in a lot of places in inssel.brg.
+ */
+ MonoInst *indir;
+ MONO_INST_NEW (m, indir, 0);
+ *indir = *inst;
+ inst->opcode = OP_SPARC_INARG_VT;
+ inst->inst_left = indir;
+ }
+ }
+ }
+
+ /*
+ * spillvars are stored between the normal locals and the storage reserved
+ * by the ABI.
+ */
+
+ m->stack_offset = offset;
+
+ /* Add a properly aligned dword for use by int<->float conversion opcodes */
+ m->spill_count ++;
+ mono_spillvar_offset_float (m, 0);
+
+ g_free (cinfo);
+}
+
+/*
+ * take the arguments and generate the arch-specific
+ * instructions to properly call the function in call.
+ * This includes pushing, moving arguments to the right register
+ * etc.
+ */
+MonoCallInst*
+mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb, MonoCallInst *call, int is_virtual) {
+ MonoInst *arg, *in;
+ MonoMethodSignature *sig;
+ int i, n;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+ guint32 extra_space = 0;
+
+ sig = call->signature;
+ n = sig->param_count + sig->hasthis;
+
+ cinfo = get_call_info (sig, sig->pinvoke);
+
+ for (i = 0; i < n; ++i) {
+ ainfo = cinfo->args + i;
+ if (is_virtual && i == 0) {
+ /* the argument will be attached to the call instruction */
+ in = call->args [i];
+ } else {
+ if ((sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) {
+ /* FIXME: Test varargs with 0 implicit args */
+ /* FIXME: Test interaction with hasthis */
+ /* Emit the signature cookie just before the first implicit argument */
+ MonoInst *sig_arg;
+ /* FIXME: Add support for signature tokens to AOT */
+ cfg->disable_aot = TRUE;
+ /* We allways pass the signature on the stack for simplicity */
+ MONO_INST_NEW (cfg, arg, OP_SPARC_OUTARG_MEM);
+ arg->inst_basereg = sparc_sp;
+ arg->inst_imm = ARGS_OFFSET + cinfo->sig_cookie.offset;
+ MONO_INST_NEW (cfg, sig_arg, OP_ICONST);
+ sig_arg->inst_p0 = call->signature;
+ arg->inst_left = sig_arg;
+ arg->type = STACK_PTR;
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ }
+
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ in = call->args [i];
+ arg->cil_code = in->cil_code;
+ arg->inst_left = in;
+ arg->type = in->type;
+ /* prepend, we'll need to reverse them later */
+ arg->next = call->out_args;
+ call->out_args = arg;
+
+ if ((i >= sig->hasthis) && (MONO_TYPE_ISSTRUCT(sig->params [i - sig->hasthis]))) {
+ MonoInst *inst;
+ gint align;
+ guint32 offset, pad;
+ guint32 size;
+
+#ifdef SPARCV9
+ if (sig->pinvoke)
+ NOT_IMPLEMENTED;
+#endif
+
+ if (sig->params [i - sig->hasthis]->type == MONO_TYPE_TYPEDBYREF) {
+ size = sizeof (MonoTypedRef);
+ align = sizeof (gpointer);
+ }
+ else
+ if (sig->pinvoke)
+ size = mono_type_native_stack_size (&in->klass->byval_arg, &align);
+ else
+ size = mono_type_stack_size (&in->klass->byval_arg, &align);
+
+ /*
+ * We use OP_OUTARG_VT to copy the valuetype to a stack location, then
+ * use the normal OUTARG opcodes to pass the address of the location to
+ * the callee.
+ */
+ MONO_INST_NEW (cfg, inst, OP_OUTARG_VT);
+ inst->inst_left = in;
+
+ /* The first 6 argument locations are reserved */
+ if (cinfo->stack_usage < 6 * sizeof (gpointer))
+ cinfo->stack_usage = 6 * sizeof (gpointer);
+
+ offset = ALIGN_TO ((ARGS_OFFSET - STACK_BIAS) + cinfo->stack_usage, align);
+ pad = offset - ((ARGS_OFFSET - STACK_BIAS) + cinfo->stack_usage);
+
+ inst->inst_c1 = STACK_BIAS + offset;
+ inst->unused = size;
+ arg->inst_left = inst;
+
+ cinfo->stack_usage += size;
+ cinfo->stack_usage += pad;
+ }
+
+ switch (ainfo->storage) {
+ case ArgInIReg:
+ case ArgInFReg:
+ case ArgInIRegPair:
+ if (ainfo->storage == ArgInIRegPair)
+ arg->opcode = OP_SPARC_OUTARG_REGPAIR;
+ arg->unused = sparc_o0 + ainfo->reg;
+ call->used_iregs |= 1 << ainfo->reg;
+
+ if ((i >= sig->hasthis) && (sig->params [i - sig->hasthis]->type == MONO_TYPE_R8)) {
+ /*
+ * The OUTARG (freg) implementation needs an extra dword to store
+ * the temporary value.
+ */
+ extra_space += 8;
+ }
+ break;
+ case ArgOnStack:
+ arg->opcode = OP_SPARC_OUTARG_MEM;
+ break;
+ case ArgOnStackPair:
+ arg->opcode = OP_SPARC_OUTARG_MEMPAIR;
+ break;
+ case ArgInSplitRegStack:
+ arg->opcode = OP_SPARC_OUTARG_SPLIT_REG_STACK;
+ arg->unused = sparc_o0 + ainfo->reg;
+ call->used_iregs |= 1 << ainfo->reg;
+ break;
+ case ArgInFloatReg:
+ arg->opcode = OP_SPARC_OUTARG_FLOAT_REG;
+ arg->unused = sparc_f0 + ainfo->reg;
+ break;
+ case ArgInDoubleReg:
+ arg->opcode = OP_SPARC_OUTARG_DOUBLE_REG;
+ arg->unused = sparc_f0 + ainfo->reg;
+ break;
+ default:
+ NOT_IMPLEMENTED;
+ }
+
+ arg->inst_basereg = sparc_sp;
+ arg->inst_imm = ARGS_OFFSET + ainfo->offset;
+ }
+ }
+
+ /*
+ * Reverse the call->out_args list.
+ */
+ {
+ MonoInst *prev = NULL, *list = call->out_args, *next;
+ while (list) {
+ next = list->next;
+ list->next = prev;
+ prev = list;
+ list = next;
+ }
+ call->out_args = prev;
+ }
+ call->stack_usage = cinfo->stack_usage + extra_space;
+ cfg->param_area = MAX (cfg->param_area, call->stack_usage);
+ cfg->flags |= MONO_CFG_HAS_CALLS;
+
+ g_free (cinfo);
+ return call;
+}
+
+/* Map opcode to the sparc condition codes */
+static inline SparcCond
+opcode_to_sparc_cond (int opcode)
+{
+ switch (opcode) {
+ case OP_FBGE:
+ return sparc_fbge;
+ case OP_FBLE:
+ return sparc_fble;
+ case OP_FBEQ:
+ case OP_FCEQ:
+ return sparc_fbe;
+ case OP_FBLT:
+ case OP_FCLT:
+ case OP_FCLT_UN:
+ return sparc_fbl;
+ case OP_FBGT:
+ case OP_FCGT:
+ case OP_FCGT_UN:
+ return sparc_fbg;
+ case CEE_BEQ:
+ case OP_IBEQ:
+ case OP_CEQ:
+ case OP_ICEQ:
+ case OP_COND_EXC_EQ:
+ return sparc_be;
+ case CEE_BNE_UN:
+ case OP_COND_EXC_NE_UN:
+ case OP_IBNE_UN:
+ return sparc_bne;
+ case CEE_BLT:
+ case OP_IBLT:
+ case OP_CLT:
+ case OP_ICLT:
+ case OP_COND_EXC_LT:
+ return sparc_bl;
+ case CEE_BLT_UN:
+ case OP_IBLT_UN:
+ case OP_CLT_UN:
+ case OP_ICLT_UN:
+ case OP_COND_EXC_LT_UN:
+ return sparc_blu;
+ case CEE_BGT:
+ case OP_IBGT:
+ case OP_CGT:
+ case OP_ICGT:
+ case OP_COND_EXC_GT:
+ return sparc_bg;
+ case CEE_BGT_UN:
+ case OP_IBGT_UN:
+ case OP_CGT_UN:
+ case OP_ICGT_UN:
+ case OP_COND_EXC_GT_UN:
+ return sparc_bgu;
+ case CEE_BGE:
+ case OP_IBGE:
+ case OP_COND_EXC_GE:
+ return sparc_bge;
+ case CEE_BGE_UN:
+ case OP_IBGE_UN:
+ case OP_COND_EXC_GE_UN:
+ return sparc_beu;
+ case CEE_BLE:
+ case OP_IBLE:
+ case OP_COND_EXC_LE:
+ return sparc_ble;
+ case CEE_BLE_UN:
+ case OP_IBLE_UN:
+ case OP_COND_EXC_LE_UN:
+ return sparc_bleu;
+ case OP_COND_EXC_OV:
+ case OP_COND_EXC_IOV:
+ return sparc_bvs;
+ case OP_COND_EXC_C:
+ case OP_COND_EXC_IC:
+ return sparc_bcs;
+ case OP_COND_EXC_NO:
+ case OP_COND_EXC_NC:
+ NOT_IMPLEMENTED;
+ default:
+ g_assert_not_reached ();
+ return sparc_be;
+ }
+}
+
+#define COMPUTE_DISP(ins) \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (ins->inst_i0->inst_c0) \
+ disp = (ins->inst_i0->inst_c0 - ((guint8*)code - cfg->native_code)) >> 2; \
+ else { \
+ disp = 0; \
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ } \
+} else { \
+ if (ins->inst_true_bb->native_offset) \
+ disp = (ins->inst_true_bb->native_offset - ((guint8*)code - cfg->native_code)) >> 2; \
+ else { \
+ disp = 0; \
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_true_bb); \
+ } \
+}
+
+#ifdef SPARCV9
+#define DEFAULT_ICC sparc_xcc_short
+#else
+#define DEFAULT_ICC sparc_icc_short
+#endif
+
+#ifdef SPARCV9
+#define EMIT_COND_BRANCH_ICC(ins,cond,annul,filldelay,icc) \
+ do { \
+ gint32 disp; \
+ guint32 predict; \
+ COMPUTE_DISP(ins); \
+ predict = (disp != 0) ? 1 : 0; \
+ g_assert (sparc_is_imm19 (disp)); \
+ sparc_branchp (code, (annul), cond, icc, (predict), disp); \
+ if (filldelay) sparc_nop (code); \
+ } while (0)
+#define EMIT_COND_BRANCH(ins,cond,annul,filldelay) EMIT_COND_BRANCH_ICC ((ins), (cond), (annul), (filldelay), (sparc_xcc_short))
+#define EMIT_FLOAT_COND_BRANCH(ins,cond,annul,filldelay) \
+ do { \
+ gint32 disp; \
+ guint32 predict; \
+ COMPUTE_DISP(ins); \
+ predict = (disp != 0) ? 1 : 0; \
+ g_assert (sparc_is_imm19 (disp)); \
+ sparc_fbranch (code, (annul), cond, disp); \
+ if (filldelay) sparc_nop (code); \
+ } while (0)
+#else
+#define EMIT_COND_BRANCH_ICC(ins,cond,annul,filldelay,icc) g_assert_not_reached ()
+#define EMIT_COND_BRANCH_GENERAL(ins,bop,cond,annul,filldelay) \
+ do { \
+ gint32 disp; \
+ COMPUTE_DISP(ins); \
+ g_assert (sparc_is_imm22 (disp)); \
+ sparc_ ## bop (code, (annul), cond, disp); \
+ if (filldelay) sparc_nop (code); \
+ } while (0)
+#define EMIT_COND_BRANCH(ins,cond,annul,filldelay) EMIT_COND_BRANCH_GENERAL((ins),branch,(cond),annul,filldelay)
+#define EMIT_FLOAT_COND_BRANCH(ins,cond,annul,filldelay) EMIT_COND_BRANCH_GENERAL((ins),fbranch,(cond),annul,filldelay)
+#endif
+
+#define EMIT_COND_BRANCH_PREDICTED(ins,cond,annul,filldelay) \
+ do { \
+ gint32 disp; \
+ guint32 predict; \
+ COMPUTE_DISP(ins); \
+ predict = (disp != 0) ? 1 : 0; \
+ g_assert (sparc_is_imm19 (disp)); \
+ sparc_branchp (code, (annul), (cond), DEFAULT_ICC, (predict), disp); \
+ if (filldelay) sparc_nop (code); \
+ } while (0)
+
+#define EMIT_COND_BRANCH_BPR(ins,bop,predict,annul,filldelay) \
+ do { \
+ gint32 disp; \
+ COMPUTE_DISP(ins); \
+ g_assert (sparc_is_imm22 (disp)); \
+ sparc_ ## bop (code, (annul), (predict), ins->sreg1, disp); \
+ if (filldelay) sparc_nop (code); \
+ } while (0)
+
+/* emit an exception if condition is fail */
+/*
+ * We put the exception throwing code out-of-line, at the end of the method
+ */
+#define EMIT_COND_SYSTEM_EXCEPTION_GENERAL(ins,cond,sexc_name,filldelay,icc) do { \
+ mono_add_patch_info (cfg, (guint8*)(code) - (cfg)->native_code, \
+ MONO_PATCH_INFO_EXC, sexc_name); \
+ if (sparcv9) { \
+ sparc_branchp (code, 0, (cond), (icc), 0, 0); \
+ } \
+ else { \
+ sparc_branch (code, 0, cond, 0); \
+ } \
+ if (filldelay) sparc_nop (code); \
+ } while (0);
+
+#define EMIT_COND_SYSTEM_EXCEPTION(ins,cond,sexc_name) EMIT_COND_SYSTEM_EXCEPTION_GENERAL(ins,cond,sexc_name,TRUE,DEFAULT_ICC)
+
+#define EMIT_COND_SYSTEM_EXCEPTION_BPR(ins,bop,sexc_name) do { \
+ mono_add_patch_info (cfg, (guint8*)(code) - (cfg)->native_code, \
+ MONO_PATCH_INFO_EXC, sexc_name); \
+ sparc_ ## bop (code, FALSE, FALSE, ins->sreg1, 0); \
+ sparc_nop (code); \
+} while (0);
+
+#define EMIT_ALU_IMM(ins,op,setcc) do { \
+ if (sparc_is_imm13 ((ins)->inst_imm)) \
+ sparc_ ## op ## _imm (code, (setcc), (ins)->sreg1, ins->inst_imm, (ins)->dreg); \
+ else { \
+ sparc_set (code, ins->inst_imm, sparc_o7); \
+ sparc_ ## op (code, (setcc), (ins)->sreg1, sparc_o7, (ins)->dreg); \
+ } \
+} while (0);
+
+#define EMIT_LOAD_MEMBASE(ins,op) do { \
+ if (sparc_is_imm13 (ins->inst_offset)) \
+ sparc_ ## op ## _imm (code, ins->inst_basereg, ins->inst_offset, ins->dreg); \
+ else { \
+ sparc_set (code, ins->inst_offset, sparc_o7); \
+ sparc_ ## op (code, ins->inst_basereg, sparc_o7, ins->dreg); \
+ } \
+} while (0);
+
+/* max len = 5 */
+#define EMIT_STORE_MEMBASE_IMM(ins,op) do { \
+ guint32 sreg; \
+ if (ins->inst_imm == 0) \
+ sreg = sparc_g0; \
+ else { \
+ sparc_set (code, ins->inst_imm, sparc_o7); \
+ sreg = sparc_o7; \
+ } \
+ if (!sparc_is_imm13 (ins->inst_offset)) { \
+ sparc_set (code, ins->inst_offset, GP_SCRATCH_REG); \
+ sparc_ ## op (code, sreg, ins->inst_destbasereg, GP_SCRATCH_REG); \
+ } \
+ else \
+ sparc_ ## op ## _imm (code, sreg, ins->inst_destbasereg, ins->inst_offset); \
+ } while (0);
+
+#define EMIT_STORE_MEMBASE_REG(ins,op) do { \
+ if (!sparc_is_imm13 (ins->inst_offset)) { \
+ sparc_set (code, ins->inst_offset, sparc_o7); \
+ sparc_ ## op (code, ins->sreg1, ins->inst_destbasereg, sparc_o7); \
+ } \
+ else \
+ sparc_ ## op ## _imm (code, ins->sreg1, ins->inst_destbasereg, ins->inst_offset); \
+ } while (0);
+
+#define EMIT_CALL() do { \
+ if (v64) { \
+ sparc_set_template (code, sparc_o7); \
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_o7); \
+ } \
+ else { \
+ sparc_call_simple (code, 0); \
+ } \
+ sparc_nop (code); \
+} while (0);
+
+extern gboolean mono_compile_aot;
+
+/*
+ * A call template is 7 instructions long, so we want to avoid it if possible.
+ */
+static guint32*
+emit_call (MonoCompile *cfg, guint32 *code, guint32 patch_type, gconstpointer data)
+{
+ gpointer target;
+
+ /* FIXME: This only works if the target method is already compiled */
+ if (0 && v64 && !mono_compile_aot) {
+ MonoJumpInfo patch_info;
+
+ patch_info.type = patch_type;
+ patch_info.data.target = data;
+
+ target = mono_resolve_patch_target (cfg->method, cfg->domain, NULL, &patch_info, FALSE);
+
+ /* FIXME: Add optimizations if the target is close enough */
+ sparc_set (code, target, sparc_o7);
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_o7);
+ sparc_nop (code);
+ }
+ else {
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, patch_type, data);
+ EMIT_CALL ();
+ }
+
+ return code;
+}
+
+static void
+peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins, *last_ins = NULL;
+ ins = bb->code;
+
+ while (ins) {
+
+ switch (ins->opcode) {
+ case OP_MUL_IMM:
+ /* remove unnecessary multiplication with 1 */
+ if (ins->inst_imm == 1) {
+ if (ins->dreg != ins->sreg1) {
+ ins->opcode = OP_MOVE;
+ } else {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ }
+ break;
+#ifndef SPARCV9
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ /*
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG
+ || last_ins->opcode == OP_STORE_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+
+ /*
+ * Note: reg1 must be different from the basereg in the second load
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_MOVE reg1, reg2
+ */
+ } if (last_ins && (last_ins->opcode == OP_LOADI4_MEMBASE
+ || last_ins->opcode == OP_LOAD_MEMBASE) &&
+ ins->inst_basereg != last_ins->dreg &&
+ ins->inst_basereg == last_ins->inst_basereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+
+ if (ins->dreg == last_ins->dreg) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->dreg;
+ }
+
+ //g_assert_not_reached ();
+
+#if 0
+ /*
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ * -->
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_ICONST reg, imm
+ */
+ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM
+ || last_ins->opcode == OP_STORE_MEMBASE_IMM) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_ICONST;
+ ins->inst_c0 = last_ins->inst_imm;
+ g_assert_not_reached (); // check this rule
+#endif
+ }
+ break;
+#endif
+ case OP_LOADU1_MEMBASE:
+ case OP_LOADI1_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI1_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case OP_LOADU2_MEMBASE:
+ case OP_LOADI2_MEMBASE:
+ if (last_ins && (last_ins->opcode == OP_STOREI2_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case OP_STOREI4_MEMBASE_IMM:
+ /* Convert pairs of 0 stores to a dword 0 store */
+ /* Used when initializing temporaries */
+ /* We know sparc_fp is dword aligned */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM) &&
+ (ins->inst_destbasereg == last_ins->inst_destbasereg) &&
+ (ins->inst_destbasereg == sparc_fp) &&
+ (ins->inst_offset < 0) &&
+ ((ins->inst_offset % 8) == 0) &&
+ ((ins->inst_offset == last_ins->inst_offset - 4)) &&
+ (ins->inst_imm == 0) &&
+ (last_ins->inst_imm == 0)) {
+ if (sparcv9) {
+ last_ins->opcode = OP_STOREI8_MEMBASE_IMM;
+ last_ins->inst_offset = ins->inst_offset;
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ }
+ break;
+ case CEE_BEQ:
+ case CEE_BNE_UN:
+ case CEE_BLT:
+ case CEE_BGT:
+ case CEE_BGE:
+ case CEE_BLE:
+ case OP_COND_EXC_EQ:
+ case OP_COND_EXC_GE:
+ case OP_COND_EXC_GT:
+ case OP_COND_EXC_LE:
+ case OP_COND_EXC_LT:
+ case OP_COND_EXC_NE_UN:
+ /*
+ * Convert compare with zero+branch to BRcc
+ */
+ /*
+ * This only works in 64 bit mode, since it examines all 64
+ * bits of the register.
+ * Only do this if the method is small since BPr only has a 16bit
+ * displacement.
+ */
+ if (v64 && (mono_method_get_header (cfg->method)->code_size < 10000) && last_ins &&
+ (last_ins->opcode == OP_COMPARE_IMM) &&
+ (last_ins->inst_imm == 0)) {
+ MonoInst *next = ins->next;
+ switch (ins->opcode) {
+ case CEE_BEQ:
+ ins->opcode = OP_SPARC_BRZ;
+ break;
+ case CEE_BNE_UN:
+ ins->opcode = OP_SPARC_BRNZ;
+ break;
+ case CEE_BLT:
+ ins->opcode = OP_SPARC_BRLZ;
+ break;
+ case CEE_BGT:
+ ins->opcode = OP_SPARC_BRGZ;
+ break;
+ case CEE_BGE:
+ ins->opcode = OP_SPARC_BRGEZ;
+ break;
+ case CEE_BLE:
+ ins->opcode = OP_SPARC_BRLEZ;
+ break;
+ case OP_COND_EXC_EQ:
+ ins->opcode = OP_SPARC_COND_EXC_EQZ;
+ break;
+ case OP_COND_EXC_GE:
+ ins->opcode = OP_SPARC_COND_EXC_GEZ;
+ break;
+ case OP_COND_EXC_GT:
+ ins->opcode = OP_SPARC_COND_EXC_GTZ;
+ break;
+ case OP_COND_EXC_LE:
+ ins->opcode = OP_SPARC_COND_EXC_LEZ;
+ break;
+ case OP_COND_EXC_LT:
+ ins->opcode = OP_SPARC_COND_EXC_LTZ;
+ break;
+ case OP_COND_EXC_NE_UN:
+ ins->opcode = OP_SPARC_COND_EXC_NEZ;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ ins->sreg1 = last_ins->sreg1;
+ *last_ins = *ins;
+ last_ins->next = next;
+ ins = next;
+ continue;
+ }
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ /*
+ * OP_MOVE reg, reg
+ */
+ if (ins->dreg == ins->sreg1) {
+ if (last_ins)
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ /*
+ * OP_MOVE sreg, dreg
+ * OP_MOVE dreg, sreg
+ */
+ if (last_ins && last_ins->opcode == OP_MOVE &&
+ ins->sreg1 == last_ins->dreg &&
+ ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ break;
+ }
+ last_ins = ins;
+ ins = ins->next;
+ }
+ bb->last_ins = last_ins;
+}
+
+/* Parameters used by the register allocator */
+
+/* Use %l4..%l7 as local registers */
+#define ARCH_CALLER_REGS (0xf0<<16)
+
+#ifdef SPARCV9
+/* Use %d34..%d62 as the double precision floating point local registers */
+/* %d32 has the same encoding as %f1, so %d36%d38 == 0b1010 == 0xa */
+#define ARCH_CALLER_FREGS (0xaaaaaaa8)
+#else
+/* Use %f2..%f30 as the double precision floating point local registers */
+#define ARCH_CALLER_FREGS (0x55555554)
+#endif
+
+#undef DEBUG
+#define DEBUG(a) if (cfg->verbose_level > 1) a
+//#define DEBUG(a)
+#define reg_is_freeable(r) ((1 << (r)) & ARCH_CALLER_REGS)
+#define freg_is_freeable(r) (((1) << (r)) & ARCH_CALLER_FREGS)
+
+typedef struct {
+ int born_in;
+ int killed_in;
+ int last_use;
+ int prev_use;
+} RegTrack;
+
+static const char*const * ins_spec = sparc_desc;
+
+static inline const char*
+get_ins_spec (int opcode)
+{
+ if (ins_spec [opcode])
+ return ins_spec [opcode];
+ else
+ return ins_spec [CEE_ADD];
+}
+
+static void
+print_ins (int i, MonoInst *ins)
+{
+ const char *spec = get_ins_spec (ins->opcode);
+ g_print ("\t%-2d %s", i, mono_inst_name (ins->opcode));
+ if (spec [MONO_INST_DEST]) {
+ if (ins->dreg >= MONO_MAX_IREGS)
+ g_print (" R%d <-", ins->dreg);
+ else
+ if (spec [MONO_INST_DEST] == 'b')
+ g_print (" [%s + 0x%lx] <-", mono_arch_regname (ins->dreg), (long)ins->inst_offset);
+ else
+ g_print (" %s <-", mono_arch_regname (ins->dreg));
+ }
+ if (spec [MONO_INST_SRC1]) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg1);
+ else
+ if (spec [MONO_INST_SRC1] == 'b')
+ g_print (" [%s + 0x%lx]", mono_arch_regname (ins->sreg1), (long)ins->inst_offset);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg1));
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg2);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg2));
+ }
+ if (spec [MONO_INST_CLOB])
+ g_print (" clobbers: %c", spec [MONO_INST_CLOB]);
+ g_print ("\n");
+}
+
+static void
+print_regtrack (RegTrack *t, int num)
+{
+ int i;
+ char buf [32];
+ const char *r;
+
+ for (i = 0; i < num; ++i) {
+ if (!t [i].born_in)
+ continue;
+ if (i >= MONO_MAX_IREGS) {
+ g_snprintf (buf, sizeof(buf), "R%d", i);
+ r = buf;
+ } else
+ r = mono_arch_regname (i);
+ g_print ("liveness: %s [%d - %d]\n", r, t [i].born_in, t[i].last_use);
+ }
+}
+
+typedef struct InstList InstList;
+
+struct InstList {
+ InstList *prev;
+ InstList *next;
+ MonoInst *data;
+};
+
+static inline InstList*
+inst_list_prepend (MonoMemPool *pool, InstList *list, MonoInst *data)
+{
+ InstList *item = mono_mempool_alloc (pool, sizeof (InstList));
+ item->data = data;
+ item->prev = NULL;
+ item->next = list;
+ if (list)
+ list->prev = item;
+ return item;
+}
+
+#define STACK_OFFSETS_POSITIVE
+
+/*
+ * returns the offset used by spillvar. It allocates a new
+ * spill variable if necessary.
+ */
+static int
+mono_spillvar_offset (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset += sizeof (gpointer);
+ info->offset = - cfg->stack_offset;
+ }
+
+ if (i == spillvar)
+ return MONO_SPARC_STACK_BIAS + (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+static int
+mono_spillvar_offset_float (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info_float;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset += sizeof (double);
+ cfg->stack_offset = ALIGN_TO (cfg->stack_offset, 8);
+ info->offset = - cfg->stack_offset;
+ }
+
+ if (i == spillvar)
+ return MONO_SPARC_STACK_BIAS + (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*
+ * Force the spilling of the variable in the symbolic register 'reg'.
+ */
+G_GNUC_UNUSED static int
+get_register_force_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ sel = cfg->rs->iassign [reg];
+ /*i = cfg->rs->isymbolic [sel];
+ g_assert (i == reg);*/
+ i = reg;
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08lx(%%sp)) R%d (freed %s)\n", spill, (long)load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static int
+get_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 && (reg_is_freeable (ins->sreg1) || (ins->sreg1 >= MONO_MAX_IREGS && cfg->rs->iassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 && (reg_is_freeable (ins->sreg2) || (ins->sreg2 >= MONO_MAX_IREGS && cfg->rs->iassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && reg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->iassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->isymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08lx(%%sp)) R%d (freed %s)\n", spill, (long)load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static int
+get_float_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("start regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 && (freg_is_freeable (ins->sreg1) || (ins->sreg1 >= MONO_MAX_FREGS && cfg->rs->fassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("excluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 && (freg_is_freeable (ins->sreg2) || (ins->sreg2 >= MONO_MAX_FREGS && cfg->rs->fassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_FREGS)
+ regmask &= ~ (1 << cfg->rs->fassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("excluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && freg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("excluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("available regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_FREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("selected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->fassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->fsymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->fassign [i] = -spill - 1;
+ mono_regstate_free_float(cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOADR8_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = cfg->frame_reg;
+ load->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08lx(%%sp)) R%d (freed %s)\n", spill, (long)load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_float (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static MonoInst*
+create_copy_ins (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n", mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+G_GNUC_UNUSED static MonoInst*
+create_copy_ins_float (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_FMOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n", mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+static MonoInst*
+create_spilled_store (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORE_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE (%d at 0x%08lx(%%sp)) R%d (from %s)\n", spill, (long)store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+static MonoInst*
+create_spilled_store_float (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORER8_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = cfg->frame_reg;
+ store->inst_offset = mono_spillvar_offset_float (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("SPILLED STORE (%d at 0x%08lx(%%sp)) R%d (from %s)\n", spill, (long)store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+static void
+insert_before_ins (MonoInst *ins, InstList *item, MonoInst* to_insert)
+{
+ MonoInst *prev;
+ g_assert (item->next);
+ prev = item->next->data;
+
+ while (prev->next != ins)
+ prev = prev->next;
+ to_insert->next = ins;
+ prev->next = to_insert;
+ /*
+ * needed otherwise in the next instruction we can add an ins to the
+ * end and that would get past this instruction.
+ */
+ item->data = to_insert;
+}
+
+G_GNUC_UNUSED static int
+alloc_int_reg (MonoCompile *cfg, InstList *curinst, MonoInst *ins, int sym_reg, guint32 allow_mask)
+{
+ int val = cfg->rs->iassign [sym_reg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (cfg->rs, allow_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, curinst, ins, allow_mask, sym_reg);
+ cfg->rs->iassign [sym_reg] = val;
+ /* add option to store before the instruction for src registers */
+ if (spill)
+ create_spilled_store (cfg, spill, val, sym_reg, ins);
+ }
+ cfg->rs->isymbolic [val] = sym_reg;
+ return val;
+}
+
+/* FIXME: Strange loads from the stack in basic-float.cs:test_2_rem */
+
+/*
+ * Local register allocation.
+ * We first scan the list of instructions and we save the liveness info of
+ * each register (when the register is first used, when it's value is set etc.).
+ * We also reverse the list of instructions (in the InstList list) because assigning
+ * registers backwards allows for more tricks to be used.
+ */
+void
+mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoRegState *rs = cfg->rs;
+ int i, val;
+ RegTrack *reginfo, *reginfof;
+ RegTrack *reginfo1, *reginfo2, *reginfod;
+ InstList *tmp, *reversed = NULL;
+ const char *spec;
+ guint32 src1_mask, src2_mask, dest_mask;
+ guint32 cur_iregs, cur_fregs;
+
+ /* FIXME: Use caller saved regs and %i1-%2 for allocation */
+
+ if (!bb->code)
+ return;
+ rs->next_vireg = bb->max_ireg;
+ rs->next_vfreg = bb->max_freg;
+ mono_regstate_assign (rs);
+ reginfo = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vireg);
+ reginfof = mono_mempool_alloc0 (cfg->mempool, sizeof (RegTrack) * rs->next_vfreg);
+ rs->ifree_mask = ARCH_CALLER_REGS;
+ rs->ffree_mask = ARCH_CALLER_FREGS;
+
+ ins = bb->code;
+ i = 1;
+ DEBUG (g_print ("LOCAL regalloc: basic block: %d\n", bb->block_num));
+ /* forward pass on the instructions to collect register liveness info */
+ while (ins) {
+ spec = ins_spec [ins->opcode];
+ if (!spec) {
+ /* Use a default */
+ spec = ins_spec [CEE_ADD];
+ }
+ DEBUG (print_ins (i, ins));
+
+ if (spec [MONO_INST_SRC1]) {
+ if (spec [MONO_INST_SRC1] == 'f')
+ reginfo1 = reginfof;
+ else
+ reginfo1 = reginfo;
+ reginfo1 [ins->sreg1].prev_use = reginfo1 [ins->sreg1].last_use;
+ reginfo1 [ins->sreg1].last_use = i;
+ } else {
+ ins->sreg1 = -1;
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (spec [MONO_INST_SRC2] == 'f')
+ reginfo2 = reginfof;
+ else
+ reginfo2 = reginfo;
+ reginfo2 [ins->sreg2].prev_use = reginfo2 [ins->sreg2].last_use;
+ reginfo2 [ins->sreg2].last_use = i;
+ } else {
+ ins->sreg2 = -1;
+ }
+ if (spec [MONO_INST_DEST]) {
+ if (spec [MONO_INST_DEST] == 'f')
+ reginfod = reginfof;
+ else
+ reginfod = reginfo;
+ if (spec [MONO_INST_DEST] != 'b') /* it's not just a base register */
+ reginfod [ins->dreg].killed_in = i;
+ reginfod [ins->dreg].prev_use = reginfod [ins->dreg].last_use;
+ reginfod [ins->dreg].last_use = i;
+ if (reginfod [ins->dreg].born_in == 0 || reginfod [ins->dreg].born_in > i)
+ reginfod [ins->dreg].born_in = i;
+ if (!v64 && (spec [MONO_INST_DEST] == 'l')) {
+ /* result in a regpair, the virtual register is allocated sequentially */
+ reginfod [ins->dreg + 1].prev_use = reginfod [ins->dreg + 1].last_use;
+ reginfod [ins->dreg + 1].last_use = i;
+ if (reginfod [ins->dreg + 1].born_in == 0 || reginfod [ins->dreg + 1].born_in > i)
+ reginfod [ins->dreg + 1].born_in = i;
+ }
+ } else {
+ ins->dreg = -1;
+ }
+ reversed = inst_list_prepend (cfg->mempool, reversed, ins);
+ ++i;
+ ins = ins->next;
+ }
+
+ cur_iregs = ARCH_CALLER_REGS;
+ cur_fregs = ARCH_CALLER_FREGS;
+
+ DEBUG (print_regtrack (reginfo, rs->next_vireg));
+ DEBUG (print_regtrack (reginfof, rs->next_vfreg));
+ tmp = reversed;
+ while (tmp) {
+ int prev_dreg, prev_sreg1, prev_sreg2;
+ --i;
+ ins = tmp->data;
+ spec = ins_spec [ins->opcode];
+ if (!spec)
+ spec = ins_spec [CEE_ADD];
+ DEBUG (g_print ("processing:"));
+ DEBUG (print_ins (i, ins));
+
+ /* make the register available for allocation: FIXME add fp reg */
+ if (ins->opcode == OP_SETREG || ins->opcode == OP_SETREGIMM) {
+ /* Dont free register which can't be allocated */
+ if (reg_is_freeable (ins->dreg)) {
+ cur_iregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_iregs\n", ins->dreg));
+ }
+ } else if (ins->opcode == OP_SETFREG) {
+ if (freg_is_freeable (ins->dreg)) {
+ cur_fregs |= 1 << ins->dreg;
+ DEBUG (g_print ("adding %d to cur_fregs\n", ins->dreg));
+ }
+ } else if (spec [MONO_INST_CLOB] == 'c') {
+ MonoCallInst *cinst = (MonoCallInst*)ins;
+ DEBUG (g_print ("excluding regs 0x%lx from cur_iregs (0x%x)\n", (long)cinst->used_iregs, cur_iregs));
+ cur_iregs &= ~cinst->used_iregs;
+ cur_fregs &= ~cinst->used_fregs;
+ DEBUG (g_print ("available cur_iregs: 0x%x\n", cur_iregs));
+ /* registers used by the calling convention are excluded from
+ * allocation: they will be selectively enabled when they are
+ * assigned by the special SETREG opcodes.
+ */
+ }
+ dest_mask = src1_mask = src2_mask = cur_iregs;
+
+ /*
+ * DEST
+ */
+ /* update for use with FP regs... */
+ if (spec [MONO_INST_DEST] == 'f') {
+ if (ins->dreg >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ dest_mask = cur_fregs;
+ val = mono_regstate_alloc_float (rs, dest_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->fassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->fsymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ } else {
+ prev_dreg = -1;
+ }
+ if (freg_is_freeable (ins->dreg) && prev_dreg >= 0 && (reginfo [prev_dreg].born_in >= i || !(cur_fregs & (1 << ins->dreg)))) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_float (rs, ins->dreg);
+ }
+ } else if (ins->dreg >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->dreg];
+ prev_dreg = ins->dreg;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (!v64 && spec [MONO_INST_DEST] == 'l') {
+ int hreg = prev_dreg + 1;
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ /* The second register must be a pair of the first */
+ dest_mask = 1 << (rs->iassign [prev_dreg] + 1);
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, hreg);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins);
+ }
+ else {
+ /* The second register must be a pair of the first */
+ if (val != rs->iassign [prev_dreg] + 1) {
+ dest_mask = 1 << (rs->iassign [prev_dreg] + 1);
+
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, hreg);
+
+ create_copy_ins (cfg, rs->iassign [hreg], val, ins);
+
+ rs->iassign [hreg] = val;
+ }
+ }
+
+ DEBUG (g_print ("\tassigned hreg %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+
+ if (reg_is_freeable (val) && hreg >= 0 && (reginfo [hreg].born_in >= i && !(cur_iregs & (1 << val)))) {
+ DEBUG (g_print ("\tfreeable %s (R%d)\n", mono_arch_regname (val), hreg));
+ mono_regstate_free_int (rs, val);
+ }
+ }
+ } else {
+ prev_dreg = -1;
+ }
+ if (spec [MONO_INST_DEST] != 'f' && reg_is_freeable (ins->dreg) && prev_dreg >= 0 && (reginfo [prev_dreg].born_in >= i)) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_int (rs, ins->dreg);
+ }
+
+ /**
+ * SRC1
+ */
+ if (spec [MONO_INST_SRC1] == 'f') {
+ if (ins->sreg1 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ //g_assert (val == -1); /* source cannot be spilled */
+ src1_mask = cur_fregs;
+ val = mono_regstate_alloc_float (rs, src1_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src1_mask, ins->sreg1);
+ rs->fassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ if (spill) {
+ MonoInst *store = create_spilled_store_float (cfg, spill, val, prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->fsymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ } else if (ins->sreg1 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ if (0 && (ins->opcode == OP_MOVE) && reg_is_freeable (ins->dreg)) {
+ /*
+ * small optimization: the dest register is already allocated
+ * but the src one is not: we can simply assign the same register
+ * here and peephole will get rid of the instruction later.
+ * This optimization may interfere with the clobbering handling:
+ * it removes a mov operation that will be added again to handle clobbering.
+ * There are also some other issues that should with make testjit.
+ */
+ mono_regstate_alloc_int (rs, 1 << ins->dreg);
+ val = rs->iassign [ins->sreg1] = ins->dreg;
+ //g_assert (val >= 0);
+ DEBUG (g_print ("\tfast assigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ } else {
+ //g_assert (val == -1); /* source cannot be spilled */
+ val = mono_regstate_alloc_int (rs, src1_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, src1_mask, ins->sreg1);
+ rs->iassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ }
+ if (spill) {
+ MonoInst *store = create_spilled_store (cfg, spill, val, prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->isymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+
+ /*
+ * SRC2
+ */
+ if (spec [MONO_INST_SRC2] == 'f') {
+ if (ins->sreg2 >= MONO_MAX_FREGS) {
+ val = rs->fassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ src2_mask = cur_fregs;
+ val = mono_regstate_alloc_float (rs, src2_mask);
+ if (val < 0)
+ val = get_float_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->fassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store_float (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->fsymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+ } else if (ins->sreg2 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (rs, src2_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, src2_mask, ins->sreg2);
+ rs->iassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->isymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ } else {
+ prev_sreg2 = -1;
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ int j, s;
+ guint32 clob_mask = ARCH_CALLER_REGS;
+ for (j = 0; j < MONO_MAX_IREGS; ++j) {
+ s = 1 << j;
+ if ((clob_mask & s) && !(rs->ifree_mask & s) && j != ins->sreg1) {
+ //g_warning ("register %s busy at call site\n", mono_arch_regname (j));
+ }
+ }
+ }
+ /*if (reg_is_freeable (ins->sreg1) && prev_sreg1 >= 0 && reginfo [prev_sreg1].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg1)));
+ mono_regstate_free_int (rs, ins->sreg1);
+ }
+ if (reg_is_freeable (ins->sreg2) && prev_sreg2 >= 0 && reginfo [prev_sreg2].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg2)));
+ mono_regstate_free_int (rs, ins->sreg2);
+ }*/
+
+ //DEBUG (print_ins (i, ins));
+
+ tmp = tmp->next;
+ }
+}
+
+static void
+sparc_patch (guint32 *code, const gpointer target)
+{
+ guint32 *c = code;
+ guint32 ins = *code;
+ guint32 op = ins >> 30;
+ guint32 op2 = (ins >> 22) & 0x7;
+ guint32 rd = (ins >> 25) & 0x1f;
+ guint8* target8 = (guint8*)target;
+ gint64 disp = (target8 - (guint8*)code) >> 2;
+ int reg;
+
+// g_print ("patching 0x%08x (0x%08x) to point to 0x%08x\n", code, ins, target);
+
+ if ((op == 0) && (op2 == 2)) {
+ if (!sparc_is_imm22 (disp))
+ NOT_IMPLEMENTED;
+ /* Bicc */
+ *code = ((ins >> 22) << 22) | (disp & 0x3fffff);
+ }
+ else if ((op == 0) && (op2 == 1)) {
+ if (!sparc_is_imm19 (disp))
+ NOT_IMPLEMENTED;
+ /* BPcc */
+ *code = ((ins >> 19) << 19) | (disp & 0x7ffff);
+ }
+ else if ((op == 0) && (op2 == 3)) {
+ if (!sparc_is_imm16 (disp))
+ NOT_IMPLEMENTED;
+ /* BPr */
+ *code &= ~(0x180000 | 0x3fff);
+ *code |= ((disp << 21) & (0x180000)) | (disp & 0x3fff);
+ }
+ else if ((op == 0) && (op2 == 6)) {
+ if (!sparc_is_imm22 (disp))
+ NOT_IMPLEMENTED;
+ /* FBicc */
+ *code = ((ins >> 22) << 22) | (disp & 0x3fffff);
+ }
+ else if ((op == 0) && (op2 == 4)) {
+ guint32 ins2 = code [1];
+
+ if (((ins2 >> 30) == 2) && (((ins2 >> 19) & 0x3f) == 2)) {
+ /* sethi followed by or */
+ guint32 *p = code;
+ sparc_set (p, target8, rd);
+ while (p <= (code + 1))
+ sparc_nop (p);
+ }
+ else if (ins2 == 0x01000000) {
+ /* sethi followed by nop */
+ guint32 *p = code;
+ sparc_set (p, target8, rd);
+ while (p <= (code + 1))
+ sparc_nop (p);
+ }
+ else if ((sparc_inst_op (ins2) == 3) && (sparc_inst_imm (ins2))) {
+ /* sethi followed by load/store */
+#ifndef SPARCV9
+ guint32 t = (guint32)target8;
+ *code &= ~(0x3fffff);
+ *code |= (t >> 10);
+ *(code + 1) &= ~(0x3ff);
+ *(code + 1) |= (t & 0x3ff);
+#endif
+ }
+ else if (v64 &&
+ (sparc_inst_rd (ins) == sparc_g1) &&
+ (sparc_inst_op (c [1]) == 0) && (sparc_inst_op2 (c [1]) == 4) &&
+ (sparc_inst_op (c [2]) == 2) && (sparc_inst_op3 (c [2]) == 2) &&
+ (sparc_inst_op (c [3]) == 2) && (sparc_inst_op3 (c [3]) == 2))
+ {
+ /* sparc_set */
+ guint32 *p = c;
+ reg = sparc_inst_rd (c [1]);
+ sparc_set (p, target8, reg);
+ while (p < (c + 6))
+ sparc_nop (p);
+ }
+ else if ((sparc_inst_op (ins2) == 2) && (sparc_inst_op3 (ins2) == 0x38) &&
+ (sparc_inst_imm (ins2))) {
+ /* sethi followed by jmpl */
+#ifndef SPARCV9
+ guint32 t = (guint32)target8;
+ *code &= ~(0x3fffff);
+ *code |= (t >> 10);
+ *(code + 1) &= ~(0x3ff);
+ *(code + 1) |= (t & 0x3ff);
+#endif
+ }
+ else
+ NOT_IMPLEMENTED;
+ }
+ else if (op == 01) {
+ gint64 disp = (target8 - (guint8*)code) >> 2;
+
+ if (!sparc_is_imm30 (disp))
+ NOT_IMPLEMENTED;
+ sparc_call_simple (code, target8 - (guint8*)code);
+ }
+ else if ((op == 2) && (sparc_inst_op3 (ins) == 0x2) && sparc_inst_imm (ins)) {
+ /* mov imm, reg */
+ g_assert (sparc_is_imm13 (target8));
+ *code &= ~(0x1fff);
+ *code |= (guint32)target8;
+ }
+ else if ((sparc_inst_op (ins) == 2) && (sparc_inst_op3 (ins) == 0x7)) {
+ /* sparc_set case 5. */
+ guint32 *p = c;
+
+ g_assert (v64);
+ reg = sparc_inst_rd (c [3]);
+ sparc_set (p, target, reg);
+ while (p < (c + 6))
+ sparc_nop (p);
+ }
+ else
+ NOT_IMPLEMENTED;
+
+// g_print ("patched with 0x%08x\n", ins);
+}
+
+/*
+ * mono_sparc_emit_save_lmf:
+ *
+ * Emit the code neccesary to push a new entry onto the lmf stack. Used by
+ * trampolines as well.
+ */
+guint32*
+mono_sparc_emit_save_lmf (guint32 *code, guint32 lmf_offset)
+{
+ /* Save lmf_addr */
+ sparc_sti_imm (code, sparc_o0, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, lmf_addr));
+ /* Save previous_lmf */
+ sparc_ldi (code, sparc_o0, sparc_g0, sparc_o7);
+ sparc_sti_imm (code, sparc_o7, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, previous_lmf));
+ /* Set new lmf */
+ sparc_add_imm (code, FALSE, sparc_fp, lmf_offset, sparc_o7);
+ sparc_sti (code, sparc_o7, sparc_o0, sparc_g0);
+
+ return code;
+}
+
+guint32*
+mono_sparc_emit_restore_lmf (guint32 *code, guint32 lmf_offset)
+{
+ /* Load previous_lmf */
+ sparc_ldi_imm (code, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, previous_lmf), sparc_l0);
+ /* Load lmf_addr */
+ sparc_ldi_imm (code, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, lmf_addr), sparc_l1);
+ /* *(lmf) = previous_lmf */
+ sparc_sti (code, sparc_l0, sparc_l1, sparc_g0);
+ return code;
+}
+
+static guint32*
+emit_save_sp_to_lmf (MonoCompile *cfg, guint32 *code)
+{
+ /*
+ * Since register windows are saved to the current value of %sp, we need to
+ * set the sp field in the lmf before the call, not in the prolog.
+ */
+ if (cfg->method->save_lmf) {
+ gint32 lmf_offset = MONO_SPARC_STACK_BIAS - cfg->arch.lmf_offset;
+
+ /* Save sp */
+ sparc_sti_imm (code, sparc_sp, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, sp));
+ }
+
+ return code;
+}
+
+static guint32*
+emit_vret_token (MonoInst *ins, guint32 *code)
+{
+ MonoCallInst *call = (MonoCallInst*)ins;
+ guint32 size;
+
+ /*
+ * The sparc ABI requires that calls to functions which return a structure
+ * contain an additional unimpl instruction which is checked by the callee.
+ */
+ if (call->signature->pinvoke && MONO_TYPE_ISSTRUCT(call->signature->ret)) {
+ if (call->signature->ret->type == MONO_TYPE_TYPEDBYREF)
+ size = mono_type_stack_size (call->signature->ret, NULL);
+ else
+ size = mono_class_native_size (call->signature->ret->data.klass, NULL);
+ sparc_unimp (code, size & 0xfff);
+ }
+
+ return code;
+}
+
+static guint32*
+emit_move_return_value (MonoInst *ins, guint32 *code)
+{
+ /* Move return value to the target register */
+ /* FIXME: do this in the local reg allocator */
+ switch (ins->opcode) {
+ case OP_VOIDCALL:
+ case OP_VOIDCALL_REG:
+ case OP_VOIDCALL_MEMBASE:
+ break;
+ case CEE_CALL:
+ case OP_CALL_REG:
+ case OP_CALL_MEMBASE:
+ sparc_mov_reg_reg (code, sparc_o0, ins->dreg);
+ break;
+ case OP_LCALL:
+ case OP_LCALL_REG:
+ case OP_LCALL_MEMBASE:
+ /*
+ * ins->dreg is the least significant reg due to the lreg: LCALL rule
+ * in inssel.brg.
+ */
+#ifdef SPARCV9
+ sparc_mov_reg_reg (code, sparc_o0, ins->dreg);
+#else
+ sparc_mov_reg_reg (code, sparc_o0, ins->dreg + 1);
+ sparc_mov_reg_reg (code, sparc_o1, ins->dreg);
+#endif
+ break;
+ case OP_FCALL:
+ case OP_FCALL_REG:
+ case OP_FCALL_MEMBASE:
+#ifdef SPARCV9
+ if (((MonoCallInst*)ins)->signature->ret->type == MONO_TYPE_R4) {
+ sparc_fmovs (code, sparc_f0, ins->dreg);
+ sparc_fstod (code, ins->dreg, ins->dreg);
+ }
+ else
+ sparc_fmovd (code, sparc_f0, ins->dreg);
+#else
+ sparc_fmovs (code, sparc_f0, ins->dreg);
+ if (((MonoCallInst*)ins)->signature->ret->type == MONO_TYPE_R4)
+ sparc_fstod (code, ins->dreg, ins->dreg);
+ else
+ sparc_fmovs (code, sparc_f1, ins->dreg + 1);
+#endif
+ break;
+ case OP_VCALL:
+ case OP_VCALL_REG:
+ case OP_VCALL_MEMBASE:
+ break;
+ default:
+ NOT_IMPLEMENTED;
+ }
+
+ return code;
+}
+
+/*
+ * emit_load_volatile_arguments:
+ *
+ * Load volatile arguments from the stack to the original input registers.
+ * Required before a tail call.
+ */
+static guint32*
+emit_load_volatile_arguments (MonoCompile *cfg, guint32 *code)
+{
+ MonoMethod *method = cfg->method;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ CallInfo *cinfo;
+ guint32 i, ireg;
+
+ /* FIXME: Generate intermediate code instead */
+
+ sig = method->signature;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ /* This is the opposite of the code in emit_prolog */
+
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ gint32 stack_offset;
+ MonoType *arg_type;
+ inst = cfg->varinfo [i];
+
+ if (sig->hasthis && (i == 0))
+ arg_type = &mono_defaults.object_class->byval_arg;
+ else
+ arg_type = sig->params [i - sig->hasthis];
+
+ stack_offset = ainfo->offset + ARGS_OFFSET;
+ ireg = sparc_i0 + ainfo->reg;
+
+ if (ainfo->storage == ArgInSplitRegStack) {
+ g_assert (inst->opcode == OP_REGOFFSET);
+
+ if (!sparc_is_imm13 (stack_offset))
+ NOT_IMPLEMENTED;
+ sparc_st_imm (code, inst->inst_basereg, stack_offset, sparc_i5);
+ }
+
+ if (!v64 && !arg_type->byref && (arg_type->type == MONO_TYPE_R8)) {
+ if (ainfo->storage == ArgInIRegPair) {
+ if (!sparc_is_imm13 (inst->inst_offset + 4))
+ NOT_IMPLEMENTED;
+ sparc_ld_imm (code, inst->inst_basereg, inst->inst_offset, ireg);
+ sparc_ld_imm (code, inst->inst_basereg, inst->inst_offset + 4, ireg + 1);
+ }
+ else
+ if (ainfo->storage == ArgInSplitRegStack) {
+ if (stack_offset != inst->inst_offset) {
+ sparc_ld_imm (code, inst->inst_basereg, inst->inst_offset, sparc_i5);
+ sparc_ld_imm (code, inst->inst_basereg, inst->inst_offset + 4, sparc_o7);
+ sparc_st_imm (code, sparc_o7, sparc_fp, stack_offset + 4);
+
+ }
+ }
+ else
+ if (ainfo->storage == ArgOnStackPair) {
+ if (stack_offset != inst->inst_offset) {
+ /* stack_offset is not dword aligned, so we need to make a copy */
+ sparc_ld_imm (code, inst->inst_basereg, inst->inst_offset, sparc_o7);
+ sparc_st_imm (code, sparc_o7, sparc_fp, stack_offset);
+
+ sparc_ld_imm (code, inst->inst_basereg, inst->inst_offset + 4, sparc_o7);
+ sparc_st_imm (code, sparc_o7, sparc_fp, stack_offset + 4);
+
+ }
+ }
+ else
+ g_assert_not_reached ();
+ }
+ else
+ if ((ainfo->storage == ArgInIReg) && (inst->opcode != OP_REGVAR)) {
+ /* Argument in register, but need to be saved to stack */
+ if (!sparc_is_imm13 (stack_offset))
+ NOT_IMPLEMENTED;
+ if ((stack_offset - ARGS_OFFSET) & 0x1)
+ /* FIXME: Is this ldsb or ldub ? */
+ sparc_ldsb_imm (code, inst->inst_basereg, stack_offset, ireg);
+ else
+ if ((stack_offset - ARGS_OFFSET) & 0x2)
+ sparc_ldsh_imm (code, inst->inst_basereg, stack_offset, ireg);
+ else
+ if ((stack_offset - ARGS_OFFSET) & 0x4)
+ sparc_ld_imm (code, inst->inst_basereg, stack_offset, ireg);
+ else {
+ if (v64)
+ sparc_ldx_imm (code, inst->inst_basereg, stack_offset, ireg);
+ else
+ sparc_ld_imm (code, inst->inst_basereg, stack_offset, ireg);
+ }
+ }
+ else if ((ainfo->storage == ArgInIRegPair) && (inst->opcode != OP_REGVAR)) {
+ /* Argument in regpair, but need to be saved to stack */
+ if (!sparc_is_imm13 (inst->inst_offset + 4))
+ NOT_IMPLEMENTED;
+ sparc_ld_imm (code, inst->inst_basereg, inst->inst_offset, ireg);
+ sparc_st_imm (code, inst->inst_basereg, inst->inst_offset + 4, ireg + 1);
+ }
+ else if ((ainfo->storage == ArgInFloatReg) && (inst->opcode != OP_REGVAR)) {
+ NOT_IMPLEMENTED;
+ }
+ else if ((ainfo->storage == ArgInDoubleReg) && (inst->opcode != OP_REGVAR)) {
+ NOT_IMPLEMENTED;
+ }
+
+ if ((ainfo->storage == ArgInSplitRegStack) || (ainfo->storage == ArgOnStack))
+ if (inst->opcode == OP_REGVAR)
+ /* FIXME: Load the argument into memory */
+ NOT_IMPLEMENTED;
+ }
+
+ g_free (cinfo);
+
+ return code;
+}
+
+/*
+ * mono_sparc_is_virtual_call:
+ *
+ * Determine whenever the instruction at CODE is a virtual call.
+ */
+gboolean
+mono_sparc_is_virtual_call (guint32 *code)
+{
+ guint32 buf[1];
+ guint32 *p;
+
+ p = buf;
+
+ if ((sparc_inst_op (*code) == 0x2) && (sparc_inst_op3 (*code) == 0x38)) {
+ /*
+ * Register indirect call. If it is a virtual call, then the
+ * instruction in the delay slot is a special kind of nop.
+ */
+
+ /* Construct special nop */
+ sparc_or_imm (p, FALSE, sparc_g0, 0xca, sparc_g0);
+ p --;
+
+ if (code [1] == p [0])
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*
+ * mono_sparc_get_vcall_slot_addr:
+ *
+ * Determine the vtable slot used by a virtual call.
+ */
+gpointer*
+mono_sparc_get_vcall_slot_addr (guint32 *code, gpointer *fp)
+{
+ guint32 ins = code [0];
+ guint32 prev_ins = code [-1];
+
+ mono_sparc_flushw ();
+
+ fp = (gpointer*)((guint8*)fp + MONO_SPARC_STACK_BIAS);
+
+ if ((sparc_inst_op (ins) == 0x2) && (sparc_inst_op3 (ins) == 0x38)) {
+ if ((sparc_inst_op (prev_ins) == 0x3) && (sparc_inst_op3 (prev_ins) == 0 || sparc_inst_op3 (prev_ins) == 0xb)) {
+ /* ld [r1 + CONST ], r2; call r2 */
+ guint32 base = sparc_inst_rs1 (prev_ins);
+ guint32 disp = sparc_inst_imm13 (prev_ins);
+ gpointer base_val;
+
+ g_assert (sparc_inst_rd (prev_ins) == sparc_inst_rs1 (ins));
+
+ g_assert ((base >= sparc_o0) && (base <= sparc_i7));
+
+ base_val = fp [base - 16];
+
+ return (gpointer)((guint8*)base_val + disp);
+ }
+ else
+ g_assert_not_reached ();
+ }
+ else
+ g_assert_not_reached ();
+
+ return FALSE;
+}
+
+/*
+ * Some conventions used in the following code.
+ * 2) The only scratch registers we have are o7 and g1. We try to
+ * stick to o7 when we can, and use g1 when necessary.
+ */
+
+void
+mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoCallInst *call;
+ guint offset;
+ guint32 *code = (guint32*)(cfg->native_code + cfg->code_len);
+ MonoInst *last_ins = NULL;
+ int max_len, cpos;
+ const char *spec;
+
+ if (cfg->opt & MONO_OPT_PEEPHOLE)
+ peephole_pass (cfg, bb);
+
+ if (cfg->verbose_level > 2)
+ g_print ("Basic block %d starting at offset 0x%x\n", bb->block_num, bb->native_offset);
+
+ cpos = bb->max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE) {
+ NOT_IMPLEMENTED;
+ }
+
+ ins = bb->code;
+ while (ins) {
+ guint8* code_start;
+
+ offset = (guint8*)code - cfg->native_code;
+
+ spec = ins_spec [ins->opcode];
+ if (!spec)
+ spec = ins_spec [CEE_ADD];
+
+ max_len = ((guint8 *)spec)[MONO_INST_LEN];
+
+ if (offset > (cfg->code_size - max_len - 16)) {
+ cfg->code_size *= 2;
+ cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
+ code = (guint32*)(cfg->native_code + offset);
+ }
+ code_start = (guint8*)code;
+ // if (ins->cil_code)
+ // g_print ("cil code\n");
+ mono_debug_record_line_number (cfg, ins, offset);
+
+ switch (ins->opcode) {
+ case OP_STOREI1_MEMBASE_IMM:
+ EMIT_STORE_MEMBASE_IMM (ins, stb);
+ break;
+ case OP_STOREI2_MEMBASE_IMM:
+ EMIT_STORE_MEMBASE_IMM (ins, sth);
+ break;
+ case OP_STORE_MEMBASE_IMM:
+ EMIT_STORE_MEMBASE_IMM (ins, sti);
+ break;
+ case OP_STOREI4_MEMBASE_IMM:
+ EMIT_STORE_MEMBASE_IMM (ins, st);
+ break;
+ case OP_STOREI8_MEMBASE_IMM:
+#ifdef SPARCV9
+ EMIT_STORE_MEMBASE_IMM (ins, stx);
+#else
+ /* Only generated by peephole opts */
+ g_assert ((ins->inst_offset % 8) == 0);
+ g_assert (ins->inst_imm == 0);
+ EMIT_STORE_MEMBASE_IMM (ins, stx);
+#endif
+ break;
+ case OP_STOREI1_MEMBASE_REG:
+ EMIT_STORE_MEMBASE_REG (ins, stb);
+ break;
+ case OP_STOREI2_MEMBASE_REG:
+ EMIT_STORE_MEMBASE_REG (ins, sth);
+ break;
+ case OP_STOREI4_MEMBASE_REG:
+ EMIT_STORE_MEMBASE_REG (ins, st);
+ break;
+ case OP_STOREI8_MEMBASE_REG:
+#ifdef SPARCV9
+ EMIT_STORE_MEMBASE_REG (ins, stx);
+#else
+ /* Only used by OP_MEMSET */
+ EMIT_STORE_MEMBASE_REG (ins, std);
+#endif
+ break;
+ case OP_STORE_MEMBASE_REG:
+ EMIT_STORE_MEMBASE_REG (ins, sti);
+ break;
+ case CEE_LDIND_I:
+#ifdef SPARCV9
+ sparc_ldx (code, ins->inst_c0, sparc_g0, ins->dreg);
+#else
+ sparc_ld (code, ins->inst_c0, sparc_g0, ins->dreg);
+#endif
+ break;
+ case CEE_LDIND_I4:
+#ifdef SPARCV9
+ sparc_ldsw (code, ins->inst_c0, sparc_g0, ins->dreg);
+#else
+ sparc_ld (code, ins->inst_c0, sparc_g0, ins->dreg);
+#endif
+ break;
+ case CEE_LDIND_U4:
+ sparc_ld (code, ins->inst_c0, sparc_g0, ins->dreg);
+ break;
+ case OP_LOADU4_MEM:
+ sparc_set (code, ins->inst_c0, ins->dreg);
+ sparc_ld (code, ins->dreg, sparc_g0, ins->dreg);
+ break;
+ case OP_LOADI4_MEMBASE:
+#ifdef SPARCV9
+ EMIT_LOAD_MEMBASE (ins, ldsw);
+#else
+ EMIT_LOAD_MEMBASE (ins, ld);
+#endif
+ break;
+ case OP_LOADU4_MEMBASE:
+ EMIT_LOAD_MEMBASE (ins, ld);
+ break;
+ case OP_LOADU1_MEMBASE:
+ EMIT_LOAD_MEMBASE (ins, ldub);
+ break;
+ case OP_LOADI1_MEMBASE:
+ EMIT_LOAD_MEMBASE (ins, ldsb);
+ break;
+ case OP_LOADU2_MEMBASE:
+ EMIT_LOAD_MEMBASE (ins, lduh);
+ break;
+ case OP_LOADI2_MEMBASE:
+ EMIT_LOAD_MEMBASE (ins, ldsh);
+ break;
+ case OP_LOAD_MEMBASE:
+#ifdef SPARCV9
+ EMIT_LOAD_MEMBASE (ins, ldx);
+#else
+ EMIT_LOAD_MEMBASE (ins, ld);
+#endif
+ break;
+#ifdef SPARCV9
+ case OP_LOADI8_MEMBASE:
+ EMIT_LOAD_MEMBASE (ins, ldx);
+ break;
+#endif
+ case CEE_CONV_I1:
+ sparc_sll_imm (code, ins->sreg1, 24, sparc_o7);
+ sparc_sra_imm (code, sparc_o7, 24, ins->dreg);
+ break;
+ case CEE_CONV_I2:
+ sparc_sll_imm (code, ins->sreg1, 16, sparc_o7);
+ sparc_sra_imm (code, sparc_o7, 16, ins->dreg);
+ break;
+ case CEE_CONV_U1:
+ sparc_and_imm (code, FALSE, ins->sreg1, 0xff, ins->dreg);
+ break;
+ case CEE_CONV_U2:
+ sparc_sll_imm (code, ins->sreg1, 16, sparc_o7);
+ sparc_srl_imm (code, sparc_o7, 16, ins->dreg);
+ break;
+ case CEE_CONV_OVF_U4:
+ /* Only used on V9 */
+ sparc_cmp_imm (code, ins->sreg1, 0);
+ mono_add_patch_info (cfg, (guint8*)(code) - (cfg)->native_code,
+ MONO_PATCH_INFO_EXC, "OverflowException");
+ sparc_branchp (code, 0, sparc_bl, sparc_xcc_short, 0, 0);
+ /* Delay slot */
+ sparc_set (code, 1, sparc_o7);
+ sparc_sllx_imm (code, sparc_o7, 32, sparc_o7);
+ sparc_cmp (code, ins->sreg1, sparc_o7);
+ mono_add_patch_info (cfg, (guint8*)(code) - (cfg)->native_code,
+ MONO_PATCH_INFO_EXC, "OverflowException");
+ sparc_branchp (code, 0, sparc_bge, sparc_xcc_short, 0, 0);
+ sparc_nop (code);
+ sparc_mov_reg_reg (code, ins->sreg1, ins->dreg);
+ break;
+ case CEE_CONV_OVF_I4_UN:
+ /* Only used on V9 */
+ NOT_IMPLEMENTED;
+ break;
+ case CEE_CONV_U:
+ case CEE_CONV_U8:
+ /* Only used on V9 */
+ sparc_srl_imm (code, ins->sreg1, 0, ins->dreg);
+ break;
+ case CEE_CONV_I:
+ case CEE_CONV_I8:
+ /* Only used on V9 */
+ sparc_sra_imm (code, ins->sreg1, 0, ins->dreg);
+ break;
+ case OP_COMPARE:
+ case OP_LCOMPARE:
+ case OP_ICOMPARE:
+ sparc_cmp (code, ins->sreg1, ins->sreg2);
+ break;
+ case OP_COMPARE_IMM:
+ case OP_ICOMPARE_IMM:
+ if (sparc_is_imm13 (ins->inst_imm))
+ sparc_cmp_imm (code, ins->sreg1, ins->inst_imm);
+ else {
+ sparc_set (code, ins->inst_imm, sparc_o7);
+ sparc_cmp (code, ins->sreg1, sparc_o7);
+ }
+ break;
+ case OP_X86_TEST_NULL:
+ sparc_cmp_imm (code, ins->sreg1, 0);
+ break;
+ case CEE_BREAK:
+ /*
+ * gdb does not like encountering 'ta 1' in the debugged code. So
+ * instead of emitting a trap, we emit a call a C function and place a
+ * breakpoint there.
+ */
+ //sparc_ta (code, 1);
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS, mono_sparc_break);
+ EMIT_CALL();
+ break;
+ case OP_ADDCC:
+ case OP_IADDCC:
+ sparc_add (code, TRUE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case CEE_ADD:
+ case OP_IADD:
+ sparc_add (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_ADDCC_IMM:
+ case OP_ADD_IMM:
+ case OP_IADD_IMM:
+ /* according to inssel-long32.brg, this should set cc */
+ EMIT_ALU_IMM (ins, add, TRUE);
+ break;
+ case OP_ADC:
+ case OP_IADC:
+ /* according to inssel-long32.brg, this should set cc */
+ sparc_addx (code, TRUE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_ADC_IMM:
+ case OP_IADC_IMM:
+ EMIT_ALU_IMM (ins, addx, TRUE);
+ break;
+ case OP_SUBCC:
+ case OP_ISUBCC:
+ sparc_sub (code, TRUE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case CEE_SUB:
+ case OP_ISUB:
+ sparc_sub (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_SUBCC_IMM:
+ case OP_SUB_IMM:
+ case OP_ISUB_IMM:
+ /* according to inssel-long32.brg, this should set cc */
+ EMIT_ALU_IMM (ins, sub, TRUE);
+ break;
+ case OP_SBB:
+ case OP_ISBB:
+ /* according to inssel-long32.brg, this should set cc */
+ sparc_subx (code, TRUE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_SBB_IMM:
+ case OP_ISBB_IMM:
+ EMIT_ALU_IMM (ins, subx, TRUE);
+ break;
+ case CEE_AND:
+ case OP_IAND:
+ sparc_and (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_AND_IMM:
+ case OP_IAND_IMM:
+ EMIT_ALU_IMM (ins, and, FALSE);
+ break;
+ case CEE_DIV:
+ case OP_IDIV:
+ /* Sign extend sreg1 into %y */
+ sparc_sra_imm (code, ins->sreg1, 31, sparc_o7);
+ sparc_wry (code, sparc_o7, sparc_g0);
+ sparc_sdiv (code, TRUE, ins->sreg1, ins->sreg2, ins->dreg);
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (code, sparc_boverflow, "ArithmeticException", TRUE, sparc_icc_short);
+ break;
+ case CEE_DIV_UN:
+ case OP_IDIV_UN:
+ sparc_wry (code, sparc_g0, sparc_g0);
+ sparc_udiv (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_DIV_IMM: {
+ int i, imm;
+
+ /* Transform division into a shift */
+ for (i = 1; i < 30; ++i) {
+ imm = (1 << i);
+ if (ins->inst_imm == imm)
+ break;
+ }
+ if (i < 30) {
+ if (i == 1) {
+ /* gcc 2.95.3 */
+ sparc_srl_imm (code, ins->sreg1, 31, sparc_o7);
+ sparc_add (code, FALSE, ins->sreg1, sparc_o7, ins->dreg);
+ sparc_sra_imm (code, ins->dreg, 1, ins->dreg);
+ }
+ else {
+ /* http://compilers.iecc.com/comparch/article/93-04-079 */
+ sparc_sra_imm (code, ins->sreg1, 31, sparc_o7);
+ sparc_srl_imm (code, sparc_o7, 32 - i, sparc_o7);
+ sparc_add (code, FALSE, ins->sreg1, sparc_o7, ins->dreg);
+ sparc_sra_imm (code, ins->dreg, i, ins->dreg);
+ }
+ }
+ else {
+ /* Sign extend sreg1 into %y */
+ sparc_sra_imm (code, ins->sreg1, 31, sparc_o7);
+ sparc_wry (code, sparc_o7, sparc_g0);
+ EMIT_ALU_IMM (ins, sdiv, TRUE);
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (code, sparc_boverflow, "ArithmeticException", TRUE, sparc_icc_short);
+ }
+ break;
+ }
+ case CEE_REM:
+ case OP_IREM:
+ /* Sign extend sreg1 into %y */
+ sparc_sra_imm (code, ins->sreg1, 31, sparc_o7);
+ sparc_wry (code, sparc_o7, sparc_g0);
+ sparc_sdiv (code, TRUE, ins->sreg1, ins->sreg2, sparc_o7);
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (code, sparc_boverflow, "ArithmeticException", TRUE, sparc_icc_short);
+ sparc_smul (code, FALSE, ins->sreg2, sparc_o7, sparc_o7);
+ sparc_sub (code, FALSE, ins->sreg1, sparc_o7, ins->dreg);
+ break;
+ case CEE_REM_UN:
+ case OP_IREM_UN:
+ sparc_wry (code, sparc_g0, sparc_g0);
+ sparc_udiv (code, FALSE, ins->sreg1, ins->sreg2, sparc_o7);
+ sparc_umul (code, FALSE, ins->sreg2, sparc_o7, sparc_o7);
+ sparc_sub (code, FALSE, ins->sreg1, sparc_o7, ins->dreg);
+ break;
+ case OP_REM_IMM:
+ case OP_IREM_IMM:
+ /* Sign extend sreg1 into %y */
+ sparc_sra_imm (code, ins->sreg1, 31, sparc_o7);
+ sparc_wry (code, sparc_o7, sparc_g0);
+ if (!sparc_is_imm13 (ins->inst_imm)) {
+ sparc_set (code, ins->inst_imm, GP_SCRATCH_REG);
+ sparc_sdiv (code, TRUE, ins->sreg1, GP_SCRATCH_REG, sparc_o7);
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (code, sparc_boverflow, "ArithmeticException", TRUE, sparc_icc_short);
+ sparc_smul (code, FALSE, sparc_o7, GP_SCRATCH_REG, sparc_o7);
+ }
+ else {
+ sparc_sdiv_imm (code, TRUE, ins->sreg1, ins->inst_imm, sparc_o7);
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (code, sparc_boverflow, "ArithmeticException", TRUE, sparc_icc_short);
+ sparc_smul_imm (code, FALSE, sparc_o7, ins->inst_imm, sparc_o7);
+ }
+ sparc_sub (code, FALSE, ins->sreg1, sparc_o7, ins->dreg);
+ break;
+ case CEE_OR:
+ case OP_IOR:
+ sparc_or (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_OR_IMM:
+ case OP_IOR_IMM:
+ EMIT_ALU_IMM (ins, or, FALSE);
+ break;
+ case CEE_XOR:
+ case OP_IXOR:
+ sparc_xor (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_XOR_IMM:
+ case OP_IXOR_IMM:
+ EMIT_ALU_IMM (ins, xor, FALSE);
+ break;
+ case CEE_SHL:
+ case OP_ISHL:
+ sparc_sll (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_SHL_IMM:
+ case OP_ISHL_IMM:
+ if (ins->inst_imm < (1 << 5))
+ sparc_sll_imm (code, ins->sreg1, ins->inst_imm, ins->dreg);
+ else {
+ sparc_set (code, ins->inst_imm, sparc_o7);
+ sparc_sll (code, ins->sreg1, sparc_o7, ins->dreg);
+ }
+ break;
+ case CEE_SHR:
+ case OP_ISHR:
+ sparc_sra (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_ISHR_IMM:
+ case OP_SHR_IMM:
+ if (ins->inst_imm < (1 << 5))
+ sparc_sra_imm (code, ins->sreg1, ins->inst_imm, ins->dreg);
+ else {
+ sparc_set (code, ins->inst_imm, sparc_o7);
+ sparc_sra (code, ins->sreg1, sparc_o7, ins->dreg);
+ }
+ break;
+ case OP_SHR_UN_IMM:
+ case OP_ISHR_UN_IMM:
+ if (ins->inst_imm < (1 << 5))
+ sparc_srl_imm (code, ins->sreg1, ins->inst_imm, ins->dreg);
+ else {
+ sparc_set (code, ins->inst_imm, sparc_o7);
+ sparc_srl (code, ins->sreg1, sparc_o7, ins->dreg);
+ }
+ break;
+ case CEE_SHR_UN:
+ case OP_ISHR_UN:
+ sparc_srl (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_LSHL:
+ sparc_sllx (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_LSHL_IMM:
+ if (ins->inst_imm < (1 << 6))
+ sparc_sllx_imm (code, ins->sreg1, ins->inst_imm, ins->dreg);
+ else {
+ sparc_set (code, ins->inst_imm, sparc_o7);
+ sparc_sllx (code, ins->sreg1, sparc_o7, ins->dreg);
+ }
+ break;
+ case OP_LSHR:
+ sparc_srax (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_LSHR_IMM:
+ if (ins->inst_imm < (1 << 6))
+ sparc_srax_imm (code, ins->sreg1, ins->inst_imm, ins->dreg);
+ else {
+ sparc_set (code, ins->inst_imm, sparc_o7);
+ sparc_srax (code, ins->sreg1, sparc_o7, ins->dreg);
+ }
+ break;
+ case OP_LSHR_UN:
+ sparc_srlx (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_LSHR_UN_IMM:
+ if (ins->inst_imm < (1 << 6))
+ sparc_srlx_imm (code, ins->sreg1, ins->inst_imm, ins->dreg);
+ else {
+ sparc_set (code, ins->inst_imm, sparc_o7);
+ sparc_srlx (code, ins->sreg1, sparc_o7, ins->dreg);
+ }
+ break;
+ case CEE_NOT:
+ case OP_INOT:
+ /* can't use sparc_not */
+ sparc_xnor (code, FALSE, ins->sreg1, sparc_g0, ins->dreg);
+ break;
+ case CEE_NEG:
+ case OP_INEG:
+ /* can't use sparc_neg */
+ sparc_sub (code, FALSE, sparc_g0, ins->sreg1, ins->dreg);
+ break;
+ case CEE_MUL:
+ case OP_IMUL:
+ sparc_smul (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_IMUL_IMM:
+ case OP_MUL_IMM: {
+ int i, imm;
+
+ if ((ins->inst_imm == 1) && (ins->sreg1 == ins->dreg))
+ break;
+
+ /* Transform multiplication into a shift */
+ for (i = 0; i < 30; ++i) {
+ imm = (1 << i);
+ if (ins->inst_imm == imm)
+ break;
+ }
+ if (i < 30)
+ sparc_sll_imm (code, ins->sreg1, i, ins->dreg);
+ else
+ EMIT_ALU_IMM (ins, smul, FALSE);
+ break;
+ }
+ case CEE_MUL_OVF:
+ case OP_IMUL_OVF:
+ sparc_smul (code, TRUE, ins->sreg1, ins->sreg2, ins->dreg);
+ sparc_rdy (code, sparc_g1);
+ sparc_sra_imm (code, ins->dreg, 31, sparc_o7);
+ sparc_cmp (code, sparc_g1, sparc_o7);
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (ins, sparc_bne, "OverflowException", TRUE, sparc_icc_short);
+ break;
+ case CEE_MUL_OVF_UN:
+ case OP_IMUL_OVF_UN:
+ sparc_umul (code, TRUE, ins->sreg1, ins->sreg2, ins->dreg);
+ sparc_rdy (code, sparc_o7);
+ sparc_cmp (code, sparc_o7, sparc_g0);
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (ins, sparc_bne, "OverflowException", TRUE, sparc_icc_short);
+ break;
+ case OP_ICONST:
+ case OP_SETREGIMM:
+ sparc_set (code, ins->inst_c0, ins->dreg);
+ break;
+ case OP_I8CONST:
+ sparc_set (code, ins->inst_l, ins->dreg);
+ break;
+ case OP_AOTCONST:
+ mono_add_patch_info (cfg, offset, (MonoJumpInfoType)ins->inst_i1, ins->inst_p0);
+ sparc_set_template (code, ins->dreg);
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ case OP_SETREG:
+ if (ins->sreg1 != ins->dreg)
+ sparc_mov_reg_reg (code, ins->sreg1, ins->dreg);
+ break;
+ case OP_SETFREG:
+ /* Only used on V9 */
+ if (ins->sreg1 != ins->dreg)
+ sparc_fmovd (code, ins->sreg1, ins->dreg);
+ break;
+ case OP_SPARC_SETFREG_FLOAT:
+ /* Only used on V9 */
+ sparc_fdtos (code, ins->sreg1, ins->dreg);
+ break;
+ case CEE_JMP:
+ if (cfg->method->save_lmf)
+ NOT_IMPLEMENTED;
+
+ code = emit_load_volatile_arguments (cfg, code);
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_METHOD_JUMP, ins->inst_p0);
+ sparc_set_template (code, sparc_o7);
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_g0);
+ /* Restore parent frame in delay slot */
+ sparc_restore_imm (code, sparc_g0, 0, sparc_g0);
+ break;
+ case OP_CHECK_THIS:
+ /* ensure ins->sreg1 is not NULL */
+ sparc_ld_imm (code, ins->sreg1, 0, sparc_g0);
+ break;
+ case OP_ARGLIST:
+ sparc_add_imm (code, FALSE, sparc_fp, cfg->sig_cookie, sparc_o7);
+ sparc_sti_imm (code, sparc_o7, ins->sreg1, 0);
+ break;
+ case OP_FCALL:
+ case OP_LCALL:
+ case OP_VCALL:
+ case OP_VOIDCALL:
+ case CEE_CALL:
+ call = (MonoCallInst*)ins;
+ g_assert (!call->virtual);
+ code = emit_save_sp_to_lmf (cfg, code);
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ code = emit_call (cfg, code, MONO_PATCH_INFO_METHOD, call->method);
+ else
+ code = emit_call (cfg, code, MONO_PATCH_INFO_ABS, call->fptr);
+
+ code = emit_vret_token (ins, code);
+ code = emit_move_return_value (ins, code);
+ break;
+ case OP_FCALL_REG:
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ case OP_CALL_REG:
+ call = (MonoCallInst*)ins;
+ code = emit_save_sp_to_lmf (cfg, code);
+ sparc_jmpl (code, ins->sreg1, sparc_g0, sparc_callsite);
+ /*
+ * We emit a special kind of nop in the delay slot to tell the
+ * trampoline code that this is a virtual call, thus an unbox
+ * trampoline might need to be called.
+ */
+ if (call->virtual)
+ sparc_or_imm (code, FALSE, sparc_g0, 0xca, sparc_g0);
+ else
+ sparc_nop (code);
+
+ code = emit_vret_token (ins, code);
+ code = emit_move_return_value (ins, code);
+ break;
+ case OP_FCALL_MEMBASE:
+ case OP_LCALL_MEMBASE:
+ case OP_VCALL_MEMBASE:
+ case OP_VOIDCALL_MEMBASE:
+ case OP_CALL_MEMBASE:
+ call = (MonoCallInst*)ins;
+ g_assert (sparc_is_imm13 (ins->inst_offset));
+ code = emit_save_sp_to_lmf (cfg, code);
+ sparc_ldi_imm (code, ins->inst_basereg, ins->inst_offset, sparc_o7);
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_callsite);
+ if (call->virtual)
+ sparc_or_imm (code, FALSE, sparc_g0, 0xca, sparc_g0);
+ else
+ sparc_nop (code);
+
+ code = emit_vret_token (ins, code);
+ code = emit_move_return_value (ins, code);
+ break;
+ case OP_SETFRET:
+ if (cfg->method->signature->ret->type == MONO_TYPE_R4)
+ sparc_fdtos (code, ins->sreg1, sparc_f0);
+ else {
+#ifdef SPARCV9
+ sparc_fmovd (code, ins->sreg1, ins->dreg);
+#else
+ /* FIXME: Why not use fmovd ? */
+ sparc_fmovs (code, ins->sreg1, ins->dreg);
+ sparc_fmovs (code, ins->sreg1 + 1, ins->dreg + 1);
+#endif
+ }
+ break;
+ case OP_OUTARG:
+ g_assert_not_reached ();
+ break;
+ case OP_LOCALLOC:
+ /* Keep alignment */
+ sparc_add_imm (code, FALSE, ins->sreg1, MONO_ARCH_FRAME_ALIGNMENT - 1, ins->dreg);
+ sparc_set (code, ~(MONO_ARCH_FRAME_ALIGNMENT - 1), sparc_o7);
+ sparc_and (code, FALSE, ins->dreg, sparc_o7, ins->dreg);
+ sparc_sub (code, FALSE, sparc_sp, ins->dreg, ins->dreg);
+ /* Keep %sp valid at all times */
+ sparc_mov_reg_reg (code, ins->dreg, sparc_sp);
+ g_assert (sparc_is_imm13 (cfg->arch.localloc_offset));
+ sparc_add_imm (code, FALSE, ins->dreg, MONO_SPARC_STACK_BIAS + cfg->arch.localloc_offset, ins->dreg);
+ break;
+ case OP_SPARC_LOCALLOC_IMM: {
+ gint32 offset = ins->inst_c0;
+ offset = ALIGN_TO (offset, MONO_ARCH_FRAME_ALIGNMENT);
+ if (sparc_is_imm13 (offset))
+ sparc_sub_imm (code, FALSE, sparc_sp, offset, sparc_sp);
+ else {
+ sparc_set (code, offset, sparc_o7);
+ sparc_sub (code, FALSE, sparc_sp, sparc_o7, sparc_sp);
+ }
+ sparc_mov_reg_reg (code, sparc_sp, ins->dreg);
+ g_assert (sparc_is_imm13 (cfg->arch.localloc_offset));
+ sparc_add_imm (code, FALSE, ins->dreg, MONO_SPARC_STACK_BIAS + cfg->arch.localloc_offset, ins->dreg);
+ break;
+ }
+ case CEE_RET:
+ /* The return is done in the epilog */
+ g_assert_not_reached ();
+ break;
+ case CEE_THROW:
+ sparc_mov_reg_reg (code, ins->sreg1, sparc_o0);
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_throw_exception");
+ EMIT_CALL ();
+ break;
+ case OP_RETHROW:
+ sparc_mov_reg_reg (code, ins->sreg1, sparc_o0);
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_rethrow_exception");
+ EMIT_CALL ();
+ break;
+ case OP_START_HANDLER: {
+ /*
+ * The START_HANDLER instruction marks the beginning of a handler
+ * block. It is called using a call instruction, so %o7 contains
+ * the return address. Since the handler executes in the same stack
+ * frame as the method itself, we can't use save/restore to save
+ * the return address. Instead, we save it into a dedicated
+ * variable.
+ */
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ if (!sparc_is_imm13 (spvar->inst_offset)) {
+ sparc_set (code, spvar->inst_offset, GP_SCRATCH_REG);
+ sparc_sti (code, sparc_o7, spvar->inst_basereg, GP_SCRATCH_REG);
+ }
+ else
+ sparc_sti_imm (code, sparc_o7, spvar->inst_basereg, spvar->inst_offset);
+ break;
+ }
+ case OP_ENDFILTER: {
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ if (!sparc_is_imm13 (spvar->inst_offset)) {
+ sparc_set (code, spvar->inst_offset, GP_SCRATCH_REG);
+ sparc_ldi (code, spvar->inst_basereg, GP_SCRATCH_REG, sparc_o7);
+ }
+ else
+ sparc_ldi_imm (code, spvar->inst_basereg, spvar->inst_offset, sparc_o7);
+ sparc_jmpl_imm (code, sparc_o7, 8, sparc_g0);
+ /* Delay slot */
+ sparc_mov_reg_reg (code, ins->sreg1, sparc_o0);
+ break;
+ }
+ case CEE_ENDFINALLY: {
+ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+ if (!sparc_is_imm13 (spvar->inst_offset)) {
+ sparc_set (code, spvar->inst_offset, GP_SCRATCH_REG);
+ sparc_ldi (code, spvar->inst_basereg, GP_SCRATCH_REG, sparc_o7);
+ }
+ else
+ sparc_ldi_imm (code, spvar->inst_basereg, spvar->inst_offset, sparc_o7);
+ sparc_jmpl_imm (code, sparc_o7, 8, sparc_g0);
+ sparc_nop (code);
+ break;
+ }
+ case OP_CALL_HANDLER:
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ /* This is a jump inside the method, so call_simple works even on V9 */
+ sparc_call_simple (code, 0);
+ sparc_nop (code);
+ break;
+ case OP_LABEL:
+ ins->inst_c0 = (guint8*)code - cfg->native_code;
+ break;
+ case CEE_BR:
+ //g_print ("target: %p, next: %p, curr: %p, last: %p\n", ins->inst_target_bb, bb->next_bb, ins, bb->last_ins);
+ if ((ins->inst_target_bb == bb->next_bb) && ins == bb->last_ins)
+ break;
+ if (ins->flags & MONO_INST_BRLABEL) {
+ if (ins->inst_i0->inst_c0) {
+ gint32 disp = (ins->inst_i0->inst_c0 - ((guint8*)code - cfg->native_code)) >> 2;
+ g_assert (sparc_is_imm22 (disp));
+ sparc_branch (code, 1, sparc_ba, disp);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_LABEL, ins->inst_i0);
+ sparc_branch (code, 1, sparc_ba, 0);
+ }
+ } else {
+ if (ins->inst_target_bb->native_offset) {
+ gint32 disp = (ins->inst_target_bb->native_offset - ((guint8*)code - cfg->native_code)) >> 2;
+ g_assert (sparc_is_imm22 (disp));
+ sparc_branch (code, 1, sparc_ba, disp);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ sparc_branch (code, 1, sparc_ba, 0);
+ }
+ }
+ sparc_nop (code);
+ break;
+ case OP_BR_REG:
+ sparc_jmp (code, ins->sreg1, sparc_g0);
+ sparc_nop (code);
+ break;
+ case OP_CEQ:
+ case OP_CLT:
+ case OP_CLT_UN:
+ case OP_CGT:
+ case OP_CGT_UN:
+ if (v64 && (cfg->opt & MONO_OPT_CMOV)) {
+ sparc_clr_reg (code, ins->dreg);
+ sparc_movcc_imm (code, sparc_xcc, opcode_to_sparc_cond (ins->opcode), 1, ins->dreg);
+ }
+ else {
+ sparc_clr_reg (code, ins->dreg);
+#ifdef SPARCV9
+ sparc_branchp (code, 1, opcode_to_sparc_cond (ins->opcode), DEFAULT_ICC, 0, 2);
+#else
+ sparc_branch (code, 1, opcode_to_sparc_cond (ins->opcode), 2);
+#endif
+ /* delay slot */
+ sparc_set (code, 1, ins->dreg);
+ }
+ break;
+ case OP_ICEQ:
+ case OP_ICLT:
+ case OP_ICLT_UN:
+ case OP_ICGT:
+ case OP_ICGT_UN:
+ if (v64 && (cfg->opt & MONO_OPT_CMOV)) {
+ sparc_clr_reg (code, ins->dreg);
+ sparc_movcc_imm (code, sparc_icc, opcode_to_sparc_cond (ins->opcode), 1, ins->dreg);
+ }
+ else {
+ sparc_clr_reg (code, ins->dreg);
+ sparc_branchp (code, 1, opcode_to_sparc_cond (ins->opcode), sparc_icc_short, 0, 2);
+ /* delay slot */
+ sparc_set (code, 1, ins->dreg);
+ }
+ break;
+ case OP_COND_EXC_EQ:
+ case OP_COND_EXC_NE_UN:
+ case OP_COND_EXC_LT:
+ case OP_COND_EXC_LT_UN:
+ case OP_COND_EXC_GT:
+ case OP_COND_EXC_GT_UN:
+ case OP_COND_EXC_GE:
+ case OP_COND_EXC_GE_UN:
+ case OP_COND_EXC_LE:
+ case OP_COND_EXC_LE_UN:
+ case OP_COND_EXC_OV:
+ case OP_COND_EXC_NO:
+ case OP_COND_EXC_C:
+ case OP_COND_EXC_NC:
+ EMIT_COND_SYSTEM_EXCEPTION (ins, opcode_to_sparc_cond (ins->opcode), ins->inst_p1);
+ break;
+ case OP_SPARC_COND_EXC_EQZ:
+ EMIT_COND_SYSTEM_EXCEPTION_BPR (ins, brz, ins->inst_p1);
+ break;
+ case OP_SPARC_COND_EXC_GEZ:
+ EMIT_COND_SYSTEM_EXCEPTION_BPR (ins, brgez, ins->inst_p1);
+ break;
+ case OP_SPARC_COND_EXC_GTZ:
+ EMIT_COND_SYSTEM_EXCEPTION_BPR (ins, brgz, ins->inst_p1);
+ break;
+ case OP_SPARC_COND_EXC_LEZ:
+ EMIT_COND_SYSTEM_EXCEPTION_BPR (ins, brlez, ins->inst_p1);
+ break;
+ case OP_SPARC_COND_EXC_LTZ:
+ EMIT_COND_SYSTEM_EXCEPTION_BPR (ins, brlz, ins->inst_p1);
+ break;
+ case OP_SPARC_COND_EXC_NEZ:
+ EMIT_COND_SYSTEM_EXCEPTION_BPR (ins, brnz, ins->inst_p1);
+ break;
+ case OP_COND_EXC_IOV:
+ case OP_COND_EXC_IC:
+ EMIT_COND_SYSTEM_EXCEPTION_GENERAL (ins, opcode_to_sparc_cond (ins->opcode), ins->inst_p1, TRUE, sparc_icc_short);
+ break;
+ case CEE_BEQ:
+ case CEE_BNE_UN:
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ case CEE_BLE:
+ case CEE_BLE_UN: {
+ if (sparcv9)
+ EMIT_COND_BRANCH_PREDICTED (ins, opcode_to_sparc_cond (ins->opcode), 1, 1);
+ else
+ EMIT_COND_BRANCH (ins, opcode_to_sparc_cond (ins->opcode), 1, 1);
+ break;
+ }
+
+ case OP_IBEQ:
+ case OP_IBNE_UN:
+ case OP_IBLT:
+ case OP_IBLT_UN:
+ case OP_IBGT:
+ case OP_IBGT_UN:
+ case OP_IBGE:
+ case OP_IBGE_UN:
+ case OP_IBLE:
+ case OP_IBLE_UN: {
+ /* Only used on V9 */
+ EMIT_COND_BRANCH_ICC (ins, opcode_to_sparc_cond (ins->opcode), 1, 1, sparc_icc_short);
+ break;
+ }
+
+ case OP_SPARC_BRZ:
+ EMIT_COND_BRANCH_BPR (ins, brz, 1, 1, 1);
+ break;
+ case OP_SPARC_BRLEZ:
+ EMIT_COND_BRANCH_BPR (ins, brlez, 1, 1, 1);
+ break;
+ case OP_SPARC_BRLZ:
+ EMIT_COND_BRANCH_BPR (ins, brlz, 1, 1, 1);
+ break;
+ case OP_SPARC_BRNZ:
+ EMIT_COND_BRANCH_BPR (ins, brnz, 1, 1, 1);
+ break;
+ case OP_SPARC_BRGZ:
+ EMIT_COND_BRANCH_BPR (ins, brgz, 1, 1, 1);
+ break;
+ case OP_SPARC_BRGEZ:
+ EMIT_COND_BRANCH_BPR (ins, brgez, 1, 1, 1);
+ break;
+
+ /* floating point opcodes */
+ case OP_R8CONST:
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R8, ins->inst_p0);
+#ifdef SPARCV9
+ sparc_set_template (code, sparc_o7);
+#else
+ sparc_sethi (code, 0, sparc_o7);
+#endif
+ sparc_lddf_imm (code, sparc_o7, 0, ins->dreg);
+ break;
+ case OP_R4CONST:
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R4, ins->inst_p0);
+#ifdef SPARCV9
+ sparc_set_template (code, sparc_o7);
+#else
+ sparc_sethi (code, 0, sparc_o7);
+#endif
+ sparc_ldf_imm (code, sparc_o7, 0, FP_SCRATCH_REG);
+
+ /* Extend to double */
+ sparc_fstod (code, FP_SCRATCH_REG, ins->dreg);
+ break;
+ case OP_STORER8_MEMBASE_REG:
+ if (!sparc_is_imm13 (ins->inst_offset + 4)) {
+ sparc_set (code, ins->inst_offset, sparc_o7);
+ /* SPARCV9 handles misaligned fp loads/stores */
+ if (!v64 && (ins->inst_offset % 8)) {
+ /* Misaligned */
+ sparc_add (code, FALSE, ins->inst_destbasereg, sparc_o7, sparc_o7);
+ sparc_stf (code, ins->sreg1, sparc_o7, sparc_g0);
+ sparc_stf_imm (code, ins->sreg1 + 1, sparc_o7, 4);
+ } else
+ sparc_stdf (code, ins->sreg1, ins->inst_destbasereg, sparc_o7);
+ }
+ else {
+ if (!v64 && (ins->inst_offset % 8)) {
+ /* Misaligned */
+ sparc_stf_imm (code, ins->sreg1, ins->inst_destbasereg, ins->inst_offset);
+ sparc_stf_imm (code, ins->sreg1 + 1, ins->inst_destbasereg, ins->inst_offset + 4);
+ } else
+ sparc_stdf_imm (code, ins->sreg1, ins->inst_destbasereg, ins->inst_offset);
+ }
+ break;
+ case OP_LOADR8_MEMBASE:
+ EMIT_LOAD_MEMBASE (ins, lddf);
+ break;
+ case OP_STORER4_MEMBASE_REG:
+ /* This requires a double->single conversion */
+ sparc_fdtos (code, ins->sreg1, FP_SCRATCH_REG);
+ if (!sparc_is_imm13 (ins->inst_offset)) {
+ sparc_set (code, ins->inst_offset, sparc_o7);
+ sparc_stf (code, FP_SCRATCH_REG, ins->inst_destbasereg, sparc_o7);
+ }
+ else
+ sparc_stf_imm (code, FP_SCRATCH_REG, ins->inst_destbasereg, ins->inst_offset);
+ break;
+ case OP_LOADR4_MEMBASE: {
+ /* ldf needs a single precision register */
+ int dreg = ins->dreg;
+ ins->dreg = FP_SCRATCH_REG;
+ EMIT_LOAD_MEMBASE (ins, ldf);
+ ins->dreg = dreg;
+ /* Extend to double */
+ sparc_fstod (code, FP_SCRATCH_REG, ins->dreg);
+ break;
+ }
+ case OP_FMOVE:
+#ifdef SPARCV9
+ sparc_fmovd (code, ins->sreg1, ins->dreg);
+#else
+ sparc_fmovs (code, ins->sreg1, ins->dreg);
+ sparc_fmovs (code, ins->sreg1 + 1, ins->dreg + 1);
+#endif
+ break;
+ case CEE_CONV_R4: {
+ gint32 offset = mono_spillvar_offset_float (cfg, 0);
+ if (!sparc_is_imm13 (offset))
+ NOT_IMPLEMENTED;
+#ifdef SPARCV9
+ sparc_stx_imm (code, ins->sreg1, sparc_sp, offset);
+ sparc_lddf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+ sparc_fxtos (code, FP_SCRATCH_REG, FP_SCRATCH_REG);
+#else
+ sparc_st_imm (code, ins->sreg1, sparc_sp, offset);
+ sparc_ldf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+ sparc_fitos (code, FP_SCRATCH_REG, FP_SCRATCH_REG);
+#endif
+ sparc_fstod (code, FP_SCRATCH_REG, ins->dreg);
+ break;
+ }
+ case CEE_CONV_R8: {
+ gint32 offset = mono_spillvar_offset_float (cfg, 0);
+ if (!sparc_is_imm13 (offset))
+ NOT_IMPLEMENTED;
+#ifdef SPARCV9
+ sparc_stx_imm (code, ins->sreg1, sparc_sp, offset);
+ sparc_lddf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+ sparc_fxtod (code, FP_SCRATCH_REG, ins->dreg);
+#else
+ sparc_st_imm (code, ins->sreg1, sparc_sp, offset);
+ sparc_ldf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+ sparc_fitod (code, FP_SCRATCH_REG, ins->dreg);
+#endif
+ break;
+ }
+ case OP_FCONV_TO_I1:
+ case OP_FCONV_TO_U1:
+ case OP_FCONV_TO_I2:
+ case OP_FCONV_TO_U2:
+#ifndef SPARCV9
+ case OP_FCONV_TO_I:
+ case OP_FCONV_TO_U:
+#endif
+ case OP_FCONV_TO_I4:
+ case OP_FCONV_TO_U4: {
+ gint32 offset = mono_spillvar_offset_float (cfg, 0);
+ if (!sparc_is_imm13 (offset))
+ NOT_IMPLEMENTED;
+ /* FIXME: Is having the same code for all of these ok ? */
+ sparc_fdtoi (code, ins->sreg1, FP_SCRATCH_REG);
+ sparc_stdf_imm (code, FP_SCRATCH_REG, sparc_sp, offset);
+ sparc_ld_imm (code, sparc_sp, offset, ins->dreg);
+ break;
+ }
+ case OP_FCONV_TO_I8:
+ case OP_FCONV_TO_U8:
+ /* Emulated */
+ g_assert_not_reached ();
+ break;
+ case CEE_CONV_R_UN:
+ /* Emulated */
+ g_assert_not_reached ();
+ break;
+ case OP_LCONV_TO_R_UN: {
+ /* Emulated */
+ g_assert_not_reached ();
+ break;
+ }
+ case OP_LCONV_TO_OVF_I: {
+ guint32 *br [3], *label [1];
+
+ /*
+ * Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000
+ */
+ sparc_cmp_imm (code, ins->sreg1, 0);
+ br [0] = code;
+ sparc_branch (code, 1, sparc_bneg, 0);
+ sparc_nop (code);
+
+ /* positive */
+ /* ms word must be 0 */
+ sparc_cmp_imm (code, ins->sreg2, 0);
+ br [1] = code;
+ sparc_branch (code, 1, sparc_be, 0);
+ sparc_nop (code);
+
+ label [0] = code;
+
+ EMIT_COND_SYSTEM_EXCEPTION (ins, sparc_ba, "OverflowException");
+
+ /* negative */
+ sparc_patch (br [0], code);
+
+ /* ms word must 0xfffffff */
+ sparc_cmp_imm (code, ins->sreg2, -1);
+ br [2] = code;
+ sparc_branch (code, 1, sparc_bne, 0);
+ sparc_patch (br [2], label [0]);
+
+ /* Ok */
+ sparc_patch (br [1], code);
+ if (ins->sreg1 != ins->dreg)
+ sparc_mov_reg_reg (code, ins->sreg1, ins->dreg);
+ break;
+ }
+ case OP_FADD:
+ sparc_faddd (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_FSUB:
+ sparc_fsubd (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_FMUL:
+ sparc_fmuld (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_FDIV:
+ sparc_fdivd (code, ins->sreg1, ins->sreg2, ins->dreg);
+ break;
+ case OP_FNEG:
+#ifdef SPARCV9
+ sparc_fnegd (code, ins->sreg1, ins->dreg);
+#else
+ /* FIXME: why don't use fnegd ? */
+ sparc_fnegs (code, ins->sreg1, ins->dreg);
+#endif
+ break;
+ case OP_FREM:
+ sparc_fdivd (code, ins->sreg1, ins->sreg2, FP_SCRATCH_REG);
+ sparc_fmuld (code, ins->sreg2, FP_SCRATCH_REG, FP_SCRATCH_REG);
+ sparc_fsubd (code, ins->sreg1, FP_SCRATCH_REG, ins->dreg);
+ break;
+ case OP_FCOMPARE:
+ sparc_fcmpd (code, ins->sreg1, ins->sreg2);
+ break;
+ case OP_FCEQ:
+ case OP_FCLT:
+ case OP_FCLT_UN:
+ case OP_FCGT:
+ case OP_FCGT_UN:
+ sparc_fcmpd (code, ins->sreg1, ins->sreg2);
+ sparc_clr_reg (code, ins->dreg);
+ switch (ins->opcode) {
+ case OP_FCLT_UN:
+ case OP_FCGT_UN:
+ sparc_fbranch (code, 1, opcode_to_sparc_cond (ins->opcode), 4);
+ /* delay slot */
+ sparc_set (code, 1, ins->dreg);
+ sparc_fbranch (code, 1, sparc_fbu, 2);
+ /* delay slot */
+ sparc_set (code, 1, ins->dreg);
+ break;
+ default:
+ sparc_fbranch (code, 1, opcode_to_sparc_cond (ins->opcode), 2);
+ /* delay slot */
+ sparc_set (code, 1, ins->dreg);
+ }
+ break;
+ case OP_FBEQ:
+ case OP_FBLT:
+ case OP_FBGT:
+ EMIT_FLOAT_COND_BRANCH (ins, opcode_to_sparc_cond (ins->opcode), 1, 1);
+ break;
+ case OP_FBGE: {
+ /* clt.un + brfalse */
+ guint32 *p = code;
+ sparc_fbranch (code, 1, sparc_fbul, 0);
+ /* delay slot */
+ sparc_nop (code);
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fba, 1, 1);
+ sparc_patch (p, (guint8*)code);
+ break;
+ }
+ case OP_FBLE: {
+ /* cgt.un + brfalse */
+ guint32 *p = code;
+ sparc_fbranch (code, 1, sparc_fbug, 0);
+ /* delay slot */
+ sparc_nop (code);
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fba, 1, 1);
+ sparc_patch (p, (guint8*)code);
+ break;
+ }
+ case OP_FBNE_UN:
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbne, 1, 1);
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbu, 1, 1);
+ break;
+ case OP_FBLT_UN:
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbl, 1, 1);
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbu, 1, 1);
+ break;
+ case OP_FBGT_UN:
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbg, 1, 1);
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbu, 1, 1);
+ break;
+ case OP_FBGE_UN:
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbge, 1, 1);
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbu, 1, 1);
+ break;
+ case OP_FBLE_UN:
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fble, 1, 1);
+ EMIT_FLOAT_COND_BRANCH (ins, sparc_fbu, 1, 1);
+ break;
+ case CEE_CKFINITE: {
+ gint32 offset = mono_spillvar_offset_float (cfg, 0);
+ if (!sparc_is_imm13 (offset))
+ NOT_IMPLEMENTED;
+ sparc_stdf_imm (code, ins->sreg1, sparc_sp, offset);
+ sparc_lduh_imm (code, sparc_sp, offset, sparc_o7);
+ sparc_srl_imm (code, sparc_o7, 4, sparc_o7);
+ sparc_and_imm (code, FALSE, sparc_o7, 2047, sparc_o7);
+ sparc_cmp_imm (code, sparc_o7, 2047);
+ EMIT_COND_SYSTEM_EXCEPTION (ins, sparc_be, "ArithmeticException");
+#ifdef SPARCV9
+ sparc_fmovd (code, ins->sreg1, ins->dreg);
+#else
+ sparc_fmovs (code, ins->sreg1, ins->dreg);
+ sparc_fmovs (code, ins->sreg1 + 1, ins->dreg + 1);
+#endif
+ break;
+ }
+ default:
+#ifdef __GNUC__
+ g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
+#else
+ g_warning ("%s:%d: unknown opcode %s\n", __FILE__, __LINE__, mono_inst_name (ins->opcode));
+#endif
+ g_assert_not_reached ();
+ }
+
+ if ((((guint8*)code) - code_start) > max_len) {
+ g_warning ("wrong maximal instruction length of instruction %s (expected %d, got %d)",
+ mono_inst_name (ins->opcode), max_len, ((guint8*)code) - code_start);
+ g_assert_not_reached ();
+ }
+
+ cpos += max_len;
+
+ last_ins = ins;
+
+ ins = ins->next;
+ }
+
+ cfg->code_len = (guint8*)code - cfg->native_code;
+}
+
+void
+mono_arch_register_lowlevel_calls (void)
+{
+ mono_register_jit_icall (mono_sparc_break, "mono_sparc_break", NULL, TRUE);
+ mono_register_jit_icall (mono_arch_get_lmf_addr, "mono_arch_get_lmf_addr", NULL, TRUE);
+}
+
+void
+mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
+{
+ MonoJumpInfo *patch_info;
+
+ /* FIXME: Move part of this to arch independent code */
+ for (patch_info = ji; patch_info; patch_info = patch_info->next) {
+ unsigned char *ip = patch_info->ip.i + code;
+ gpointer target;
+
+ target = mono_resolve_patch_target (method, domain, code, patch_info, run_cctors);
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_CLASS_INIT: {
+ guint32 *ip2 = (guint32*)ip;
+ /* Might already been changed to a nop */
+#ifdef SPARCV9
+ sparc_set_template (ip2, sparc_o7);
+ sparc_jmpl (ip2, sparc_o7, sparc_g0, sparc_o7);
+#else
+ sparc_call_simple (ip2, 0);
+#endif
+ break;
+ }
+ case MONO_PATCH_INFO_METHOD_JUMP: {
+ guint32 *ip2 = (guint32*)ip;
+ /* Might already been patched */
+ sparc_set_template (ip2, sparc_o7);
+ break;
+ }
+ default:
+ break;
+ }
+ sparc_patch ((guint32*)ip, target);
+ }
+}
+
+void
+mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code)
+{
+ *stack = 0;
+ *code = 512;
+}
+
+void*
+mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ int i, stack, code_size;
+ guint32 *code = (guint32*)p;
+ MonoMethodSignature *sig = cfg->method->signature;
+ CallInfo *cinfo;
+
+ /* Save registers to stack */
+ for (i = 0; i < 6; ++i)
+ sparc_sti_imm (code, sparc_i0 + i, sparc_fp, ARGS_OFFSET + (i * sizeof (gpointer)));
+
+ cinfo = get_call_info (sig, FALSE);
+
+ /* Save float regs on V9, since they are caller saved */
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ gint32 stack_offset;
+
+ stack_offset = ainfo->offset + ARGS_OFFSET;
+
+ if (ainfo->storage == ArgInFloatReg) {
+ if (!sparc_is_imm13 (stack_offset))
+ NOT_IMPLEMENTED;
+ sparc_stf_imm (code, ainfo->reg, sparc_fp, stack_offset);
+ }
+ else if (ainfo->storage == ArgInDoubleReg) {
+ /* The offset is guaranteed to be aligned by the ABI rules */
+ sparc_stdf_imm (code, ainfo->reg, sparc_fp, stack_offset);
+ }
+ }
+
+ sparc_set (code, cfg->method, sparc_o0);
+ sparc_add_imm (code, FALSE, sparc_fp, MONO_SPARC_STACK_BIAS, sparc_o1);
+
+ mono_add_patch_info (cfg, (guint8*)code-cfg->native_code, MONO_PATCH_INFO_ABS, func);
+ EMIT_CALL ();
+
+ /* Restore float regs on V9 */
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ gint32 stack_offset;
+
+ stack_offset = ainfo->offset + ARGS_OFFSET;
+
+ if (ainfo->storage == ArgInFloatReg) {
+ if (!sparc_is_imm13 (stack_offset))
+ NOT_IMPLEMENTED;
+ sparc_ldf_imm (code, sparc_fp, stack_offset, ainfo->reg);
+ }
+ else if (ainfo->storage == ArgInDoubleReg) {
+ /* The offset is guaranteed to be aligned by the ABI rules */
+ sparc_lddf_imm (code, sparc_fp, stack_offset, ainfo->reg);
+ }
+ }
+
+ mono_arch_instrument_mem_needs (cfg->method, &stack, &code_size);
+
+ g_assert ((code - (guint32*)p) <= (code_size * 4));
+
+ g_free (cinfo);
+
+ return code;
+}
+
+enum {
+ SAVE_NONE,
+ SAVE_STRUCT,
+ SAVE_ONE,
+ SAVE_TWO,
+ SAVE_FP
+};
+
+void*
+mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guint32 *code = (guint32*)p;
+ int save_mode = SAVE_NONE;
+ MonoMethod *method = cfg->method;
+
+ switch (mono_type_get_underlying_type (method->signature->ret)->type) {
+ case MONO_TYPE_VOID:
+ /* special case string .ctor icall */
+ if (strcmp (".ctor", method->name) && method->klass == mono_defaults.string_class)
+ save_mode = SAVE_ONE;
+ else
+ save_mode = SAVE_NONE;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+#ifdef SPARCV9
+ save_mode = SAVE_ONE;
+#else
+ save_mode = SAVE_TWO;
+#endif
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ save_mode = SAVE_FP;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ save_mode = SAVE_STRUCT;
+ break;
+ default:
+ save_mode = SAVE_ONE;
+ break;
+ }
+
+ /* Save the result to the stack and also put it into the output registers */
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ /* V8 only */
+ sparc_st_imm (code, sparc_i0, sparc_fp, 68);
+ sparc_st_imm (code, sparc_i0, sparc_fp, 72);
+ sparc_mov_reg_reg (code, sparc_i0, sparc_o1);
+ sparc_mov_reg_reg (code, sparc_i1, sparc_o2);
+ break;
+ case SAVE_ONE:
+ sparc_sti_imm (code, sparc_i0, sparc_fp, ARGS_OFFSET);
+ sparc_mov_reg_reg (code, sparc_i0, sparc_o1);
+ break;
+ case SAVE_FP:
+#ifdef SPARCV9
+ sparc_stdf_imm (code, sparc_f0, sparc_fp, ARGS_OFFSET);
+#else
+ sparc_stdf_imm (code, sparc_f0, sparc_fp, 72);
+ sparc_ld_imm (code, sparc_fp, 72, sparc_o1);
+ sparc_ld_imm (code, sparc_fp, 72 + 4, sparc_o2);
+#endif
+ break;
+ case SAVE_STRUCT:
+#ifdef SPARCV9
+ sparc_mov_reg_reg (code, sparc_i0, sparc_o1);
+#else
+ sparc_ld_imm (code, sparc_fp, 64, sparc_o1);
+#endif
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ sparc_set (code, cfg->method, sparc_o0);
+
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_ABS, func);
+ EMIT_CALL ();
+
+ /* Restore result */
+
+ switch (save_mode) {
+ case SAVE_TWO:
+ sparc_ld_imm (code, sparc_fp, 68, sparc_i0);
+ sparc_ld_imm (code, sparc_fp, 72, sparc_i0);
+ break;
+ case SAVE_ONE:
+ sparc_ldi_imm (code, sparc_fp, ARGS_OFFSET, sparc_i0);
+ break;
+ case SAVE_FP:
+ sparc_lddf_imm (code, sparc_fp, ARGS_OFFSET, sparc_f0);
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ return code;
+}
+
+int
+mono_arch_max_epilog_size (MonoCompile *cfg)
+{
+ int exc_count = 0, max_epilog_size = 16 + 20*4;
+ MonoJumpInfo *patch_info;
+
+ if (cfg->method->save_lmf)
+ max_epilog_size += 128;
+
+ if (mono_jit_trace_calls != NULL)
+ max_epilog_size += 50;
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ max_epilog_size += 50;
+
+ /* count the number of exception infos */
+
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_EXC)
+ exc_count++;
+ }
+
+ /*
+ * make sure we have enough space for exceptions
+ */
+#ifdef SPARCV9
+ max_epilog_size += exc_count * (20 * 4);
+#else
+ max_epilog_size += exc_count * 24;
+#endif
+
+ return max_epilog_size;
+}
+
+guint8 *
+mono_arch_emit_prolog (MonoCompile *cfg)
+{
+ MonoMethod *method = cfg->method;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ guint32 *code;
+ CallInfo *cinfo;
+ guint32 i, offset;
+
+ cfg->code_size = 256;
+ cfg->native_code = g_malloc (cfg->code_size);
+ code = (guint32*)cfg->native_code;
+
+ /* FIXME: Generate intermediate code instead */
+
+ offset = cfg->stack_offset;
+ offset += (16 * sizeof (gpointer)); /* register save area */
+#ifndef SPARCV9
+ offset += 4; /* struct/union return pointer */
+#endif
+
+ /* add parameter area size for called functions */
+ if (cfg->param_area < (6 * sizeof (gpointer)))
+ /* Reserve space for the first 6 arguments even if it is unused */
+ offset += 6 * sizeof (gpointer);
+ else
+ offset += cfg->param_area;
+
+ /* align the stack size */
+ offset = ALIGN_TO (offset, MONO_ARCH_FRAME_ALIGNMENT);
+
+ /*
+ * localloc'd memory is stored between the local variables (whose
+ * size is given by cfg->stack_offset), and between the space reserved
+ * by the ABI.
+ */
+ cfg->arch.localloc_offset = offset - cfg->stack_offset;
+
+ cfg->stack_offset = offset;
+
+ if (!sparc_is_imm13 (- cfg->stack_offset)) {
+ /* Can't use sparc_o7 here, since we're still in the caller's frame */
+ sparc_set (code, (- cfg->stack_offset), GP_SCRATCH_REG);
+ sparc_save (code, sparc_sp, GP_SCRATCH_REG, sparc_sp);
+ }
+ else
+ sparc_save_imm (code, sparc_sp, - cfg->stack_offset, sparc_sp);
+
+/*
+ if (strstr (cfg->method->name, "test_marshal_struct")) {
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_ABS, mono_sparc_break);
+ sparc_call_simple (code, 0);
+ sparc_nop (code);
+ }
+*/
+
+ sig = method->signature;
+
+ cinfo = get_call_info (sig, FALSE);
+
+ /* Keep in sync with emit_load_volatile_arguments */
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ ArgInfo *ainfo = cinfo->args + i;
+ gint32 stack_offset;
+ MonoType *arg_type;
+ inst = cfg->varinfo [i];
+
+ if (sig->hasthis && (i == 0))
+ arg_type = &mono_defaults.object_class->byval_arg;
+ else
+ arg_type = sig->params [i - sig->hasthis];
+
+ stack_offset = ainfo->offset + ARGS_OFFSET;
+
+ /* Save the split arguments so they will reside entirely on the stack */
+ if (ainfo->storage == ArgInSplitRegStack) {
+ /* Save the register to the stack */
+ g_assert (inst->opcode == OP_REGOFFSET);
+ if (!sparc_is_imm13 (stack_offset))
+ NOT_IMPLEMENTED;
+ sparc_st_imm (code, sparc_i5, inst->inst_basereg, stack_offset);
+ }
+
+ if (!v64 && !arg_type->byref && (arg_type->type == MONO_TYPE_R8)) {
+ /* Save the argument to a dword aligned stack location */
+ /*
+ * stack_offset contains the offset of the argument on the stack.
+ * inst->inst_offset contains the dword aligned offset where the value
+ * should be stored.
+ */
+ if (ainfo->storage == ArgInIRegPair) {
+ if (!sparc_is_imm13 (inst->inst_offset + 4))
+ NOT_IMPLEMENTED;
+ sparc_st_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, inst->inst_offset);
+ sparc_st_imm (code, sparc_i0 + ainfo->reg + 1, inst->inst_basereg, inst->inst_offset + 4);
+ }
+ else
+ if (ainfo->storage == ArgInSplitRegStack) {
+#ifdef SPARCV9
+ g_assert_not_reached ();
+#endif
+ if (stack_offset != inst->inst_offset) {
+ /* stack_offset is not dword aligned, so we need to make a copy */
+ sparc_st_imm (code, sparc_i5, inst->inst_basereg, inst->inst_offset);
+ sparc_ld_imm (code, sparc_fp, stack_offset + 4, sparc_o7);
+ sparc_st_imm (code, sparc_o7, inst->inst_basereg, inst->inst_offset + 4);
+ }
+ }
+ else
+ if (ainfo->storage == ArgOnStackPair) {
+#ifdef SPARCV9
+ g_assert_not_reached ();
+#endif
+ if (stack_offset != inst->inst_offset) {
+ /* stack_offset is not dword aligned, so we need to make a copy */
+ sparc_ld_imm (code, sparc_fp, stack_offset, sparc_o7);
+ sparc_st_imm (code, sparc_o7, inst->inst_basereg, inst->inst_offset);
+ sparc_ld_imm (code, sparc_fp, stack_offset + 4, sparc_o7);
+ sparc_st_imm (code, sparc_o7, inst->inst_basereg, inst->inst_offset + 4);
+ }
+ }
+ else
+ g_assert_not_reached ();
+ }
+ else
+ if ((ainfo->storage == ArgInIReg) && (inst->opcode != OP_REGVAR)) {
+ /* Argument in register, but need to be saved to stack */
+ if (!sparc_is_imm13 (stack_offset))
+ NOT_IMPLEMENTED;
+ if ((stack_offset - ARGS_OFFSET) & 0x1)
+ sparc_stb_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset);
+ else
+ if ((stack_offset - ARGS_OFFSET) & 0x2)
+ sparc_sth_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset);
+ else
+ if ((stack_offset - ARGS_OFFSET) & 0x4)
+ sparc_st_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset);
+ else {
+ if (v64)
+ sparc_stx_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset);
+ else
+ sparc_st_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset);
+ }
+ }
+ else
+ if ((ainfo->storage == ArgInIRegPair) && (inst->opcode != OP_REGVAR)) {
+#ifdef SPARCV9
+ NOT_IMPLEMENTED;
+#endif
+ /* Argument in regpair, but need to be saved to stack */
+ if (!sparc_is_imm13 (inst->inst_offset + 4))
+ NOT_IMPLEMENTED;
+ sparc_st_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, inst->inst_offset);
+ sparc_st_imm (code, sparc_i0 + ainfo->reg + 1, inst->inst_basereg, inst->inst_offset + 4);
+ }
+ else if ((ainfo->storage == ArgInFloatReg) && (inst->opcode != OP_REGVAR)) {
+ if (!sparc_is_imm13 (stack_offset))
+ NOT_IMPLEMENTED;
+ sparc_stf_imm (code, ainfo->reg, inst->inst_basereg, inst->inst_offset);
+ }
+ else if ((ainfo->storage == ArgInDoubleReg) && (inst->opcode != OP_REGVAR)) {
+ /* The offset is guaranteed to be aligned by the ABI rules */
+ sparc_stdf_imm (code, ainfo->reg, inst->inst_basereg, inst->inst_offset);
+ }
+
+ if ((ainfo->storage == ArgInFloatReg) && (inst->opcode == OP_REGVAR)) {
+ /* Need to move into the a double precision register */
+ sparc_fstod (code, ainfo->reg, ainfo->reg - 1);
+ }
+
+ if ((ainfo->storage == ArgInSplitRegStack) || (ainfo->storage == ArgOnStack))
+ if (inst->opcode == OP_REGVAR)
+ /* FIXME: Load the argument into memory */
+ NOT_IMPLEMENTED;
+ }
+
+ g_free (cinfo);
+
+ if (cfg->method->save_lmf) {
+ gint32 lmf_offset = STACK_BIAS - cfg->arch.lmf_offset;
+
+ /* Save ip */
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_IP, NULL);
+ sparc_set_template (code, sparc_o7);
+ sparc_sti_imm (code, sparc_o7, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, ip));
+ /* Save sp */
+ sparc_sti_imm (code, sparc_sp, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, sp));
+ /* Save fp */
+ sparc_sti_imm (code, sparc_fp, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, ebp));
+ /* Save method */
+ /* FIXME: add a relocation for this */
+ sparc_set (code, cfg->method, sparc_o7);
+ sparc_sti_imm (code, sparc_o7, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, method));
+
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_get_lmf_addr");
+ EMIT_CALL ();
+
+ code = (guint32*)mono_sparc_emit_save_lmf (code, lmf_offset);
+ }
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ code = mono_arch_instrument_prolog (cfg, mono_trace_enter_method, code, TRUE);
+
+ cfg->code_len = (guint8*)code - cfg->native_code;
+
+ g_assert (cfg->code_len <= cfg->code_size);
+
+ return (guint8*)code;
+}
+
+void
+mono_arch_emit_epilog (MonoCompile *cfg)
+{
+ MonoJumpInfo *patch_info;
+ MonoMethod *method = cfg->method;
+ guint32 *code;
+ int can_fold = 0;
+
+ code = (guint32*)(cfg->native_code + cfg->code_len);
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ code = mono_arch_instrument_epilog (cfg, mono_trace_leave_method, code, TRUE);
+
+ if (cfg->method->save_lmf) {
+ gint32 lmf_offset = STACK_BIAS - cfg->arch.lmf_offset;
+
+ code = mono_sparc_emit_restore_lmf (code, lmf_offset);
+ }
+
+ /*
+ * The V8 ABI requires that calls to functions which return a structure
+ * return to %i7+12
+ */
+ if (!v64 && cfg->method->signature->pinvoke && MONO_TYPE_ISSTRUCT(cfg->method->signature->ret))
+ sparc_jmpl_imm (code, sparc_i7, 12, sparc_g0);
+ else
+ sparc_ret (code);
+
+ /* Only fold last instruction into the restore if the exit block has an in count of 1
+ and the previous block hasn't been optimized away since it may have an in count > 1 */
+ if (cfg->bb_exit->in_count == 1 && cfg->bb_exit->in_bb[0]->native_offset != cfg->bb_exit->native_offset)
+ can_fold = 1;
+
+ /* Try folding last instruction into the restore */
+ if (can_fold && (sparc_inst_op (code [-2]) == 0x2) && (sparc_inst_op3 (code [-2]) == 0x2) && sparc_inst_imm (code [-2]) && (sparc_inst_rd (code [-2]) == sparc_i0)) {
+ /* or reg, imm, %i0 */
+ int reg = sparc_inst_rs1 (code [-2]);
+ int imm = sparc_inst_imm13 (code [-2]);
+ code [-2] = code [-1];
+ code --;
+ sparc_restore_imm (code, reg, imm, sparc_o0);
+ }
+ else
+ if (can_fold && (sparc_inst_op (code [-2]) == 0x2) && (sparc_inst_op3 (code [-2]) == 0x2) && (!sparc_inst_imm (code [-2])) && (sparc_inst_rd (code [-2]) == sparc_i0)) {
+ /* or reg, reg, %i0 */
+ int reg1 = sparc_inst_rs1 (code [-2]);
+ int reg2 = sparc_inst_rs2 (code [-2]);
+ code [-2] = code [-1];
+ code --;
+ sparc_restore (code, reg1, reg2, sparc_o0);
+ }
+ else
+ sparc_restore_imm (code, sparc_g0, 0, sparc_g0);
+
+ /* add code to raise exceptions */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ glong offset = patch_info->ip.i;
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_EXC:
+ sparc_patch ((guint32*)(cfg->native_code + patch_info->ip.i), code);
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_EXC_NAME, patch_info->data.target);
+ sparc_set_template (code, sparc_o0);
+ mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, MONO_PATCH_INFO_METHOD_REL, (gpointer)offset);
+ sparc_set_template (code, sparc_o1);
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->data.name = "mono_arch_throw_exception_by_name";
+ patch_info->ip.i = (guint8*)code - cfg->native_code;
+ EMIT_CALL ();
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
+ }
+
+ cfg->code_len = (guint8*)code - cfg->native_code;
+
+ g_assert (cfg->code_len < cfg->code_size);
+
+}
+
+gboolean lmf_addr_key_inited = FALSE;
+
+#ifdef MONO_SPARC_THR_TLS
+thread_key_t lmf_addr_key;
+#else
+pthread_key_t lmf_addr_key;
+#endif
+
+gpointer
+mono_arch_get_lmf_addr (void)
+{
+ /* This is perf critical so we bypass the IO layer */
+ /* The thr_... functions seem to be somewhat faster */
+#ifdef MONO_SPARC_THR_TLS
+ gpointer res;
+ thr_getspecific (lmf_addr_key, &res);
+ return res;
+#else
+ return pthread_getspecific (lmf_addr_key);
+#endif
+}
+
+void
+mono_arch_setup_jit_tls_data (MonoJitTlsData *tls)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+#ifdef __linux__
+ struct sigaltstack sa;
+#else
+ stack_t sigstk;
+#endif
+
+ printf ("SIGALT!\n");
+ /* Setup an alternate signal stack */
+ tls->signal_stack = g_malloc (SIGNAL_STACK_SIZE);
+ tls->signal_stack_size = SIGNAL_STACK_SIZE;
+
+#ifdef __linux__
+ sa.ss_sp = tls->signal_stack;
+ sa.ss_size = SIGNAL_STACK_SIZE;
+ sa.ss_flags = 0;
+ g_assert (sigaltstack (&sa, NULL) == 0);
+#else
+ sigstk.ss_sp = tls->signal_stack;
+ sigstk.ss_size = SIGNAL_STACK_SIZE;
+ sigstk.ss_flags = 0;
+ g_assert (sigaltstack (&sigstk, NULL) == 0);
+#endif
+#endif
+
+ if (!lmf_addr_key_inited) {
+ int res;
+
+ lmf_addr_key_inited = TRUE;
+
+#ifdef MONO_SPARC_THR_TLS
+ res = thr_keycreate (&lmf_addr_key, NULL);
+#else
+ res = pthread_key_create (&lmf_addr_key, NULL);
+#endif
+ g_assert (res == 0);
+
+ }
+
+#ifdef MONO_SPARC_THR_TLS
+ thr_setspecific (lmf_addr_key, &tls->lmf);
+#else
+ pthread_setspecific (lmf_addr_key, &tls->lmf);
+#endif
+}
+
+void
+mono_arch_free_jit_tls_data (MonoJitTlsData *tls)
+{
+}
+
+void
+mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg)
+{
+ int this_out_reg = sparc_o0;
+
+ if (vt_reg != -1) {
+#ifdef SPARCV9
+ MonoInst *ins;
+ MONO_INST_NEW (cfg, ins, OP_SETREG);
+ ins->sreg1 = vt_reg;
+ ins->dreg = sparc_o0;
+ mono_bblock_add_inst (cfg->cbb, ins);
+ this_out_reg = sparc_o1;
+#else
+ /* Set the 'struct/union return pointer' location on the stack */
+ MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREI4_MEMBASE_REG, sparc_sp, 64, vt_reg);
+#endif
+ }
+
+ /* add the this argument */
+ if (this_reg != -1) {
+ MonoInst *this;
+ MONO_INST_NEW (cfg, this, OP_SETREG);
+ this->type = this_type;
+ this->sreg1 = this_reg;
+ this->dreg = this_out_reg;
+ mono_bblock_add_inst (cfg->cbb, this);
+ }
+}
+
+
+gint
+mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
+{
+ return -1;
+}
+
+/*
+ * mono_arch_get_argument_info:
+ * @csig: a method signature
+ * @param_count: the number of parameters to consider
+ * @arg_info: an array to store the result infos
+ *
+ * Gathers information on parameters such as size, alignment and
+ * padding. arg_info should be large enought to hold param_count + 1 entries.
+ *
+ * Returns the size of the activation frame.
+ */
+int
+mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+{
+ int k, align;
+ CallInfo *cinfo;
+ ArgInfo *ainfo;
+
+ cinfo = get_call_info (csig, FALSE);
+
+ if (csig->hasthis) {
+ ainfo = &cinfo->args [0];
+ arg_info [0].offset = ARGS_OFFSET - MONO_SPARC_STACK_BIAS + ainfo->offset;
+ }
+
+ for (k = 0; k < param_count; k++) {
+ ainfo = &cinfo->args [k + csig->hasthis];
+
+ arg_info [k + 1].offset = ARGS_OFFSET - MONO_SPARC_STACK_BIAS + ainfo->offset;
+ arg_info [k + 1].size = mono_type_size (csig->params [k], &align);
+ }
+
+ g_free (cinfo);
+
+ return 0;
+}
+
+gboolean
+mono_arch_print_tree (MonoInst *tree, int arity)
+{
+ return 0;
+}
+
+MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+}
+
+MonoInst* mono_arch_get_thread_intrinsic (MonoCompile* cfg)
+{
+ return NULL;
+}
diff --git a/mono/mini/mini-sparc.h b/mono/mini/mini-sparc.h
new file mode 100644
index 00000000000..f22f314d32c
--- /dev/null
+++ b/mono/mini/mini-sparc.h
@@ -0,0 +1,130 @@
+#ifndef __MONO_MINI_SPARC_H__
+#define __MONO_MINI_SPARC_H__
+
+#include <mono/arch/sparc/sparc-codegen.h>
+
+#include <glib.h>
+
+#define MONO_MAX_IREGS 32
+#define MONO_MAX_FREGS 32
+
+#define MONO_ARCH_FRAME_ALIGNMENT (sizeof (gpointer) * 2)
+
+#define MONO_ARCH_CODE_ALIGNMENT 32
+
+#define MONO_ARCH_BASEREG sparc_fp
+#define MONO_ARCH_RETREG1 sparc_i0
+
+#ifdef SPARCV9
+#define MONO_SPARC_STACK_BIAS 2047
+#else
+#define MONO_SPARC_STACK_BIAS 0
+#endif
+
+struct MonoLMF {
+ gpointer previous_lmf;
+ gpointer lmf_addr;
+ MonoMethod *method;
+ gpointer ip;
+ gpointer sp;
+ gpointer ebp;
+};
+
+typedef struct MonoContext {
+ guint8 *ip;
+ gpointer *sp;
+ gpointer *fp;
+} MonoContext;
+
+typedef struct MonoCompileArch {
+ gint32 lmf_offset;
+ gint32 localloc_offset;
+} MonoCompileArch;
+
+#define MONO_CONTEXT_SET_IP(ctx,eip) do { (ctx)->ip = (gpointer)(eip); } while (0);
+#define MONO_CONTEXT_SET_BP(ctx,ebp) do { (ctx)->fp = (gpointer*)(ebp); } while (0);
+#define MONO_CONTEXT_SET_SP(ctx,esp) do { (ctx)->sp = (gpointer*)(esp); } while (0);
+
+#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->ip))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->fp))
+#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->sp))
+
+#define MONO_ARCH_USE_SIGACTION 1
+
+//#define MONO_ARCH_SIGSEGV_ON_ALTSTACK
+
+#define MONO_ARCH_EMULATE_FCONV_TO_I8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R4 1
+#define MONO_ARCH_EMULATE_CONV_R8_UN 1
+#define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
+#define MONO_ARCH_EMULATE_FREM 1
+#define MONO_ARCH_NEED_DIV_CHECK 1
+#define MONO_ARCH_HAVE_RETHROW 1
+
+#ifdef SPARCV9
+#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
+#endif
+
+#ifndef __GNUC__
+/* assume Sun compiler if not GCC */
+static void * __builtin_return_address(int depth)
+{
+ asm("ta 3");
+ asm("tst %i0");
+ asm("be retAddr_End");
+ asm("mov %fp, %l0");
+ asm("retAddr_Start:");
+ asm("sub %i0, 1, %i0");
+ asm("tst %i0");
+ asm("bne retAddr_Start");
+#if SPARCV9
+ asm("ldx [%l0+2159], %l0");
+ asm("retAddr_End:");
+ asm("ldx [%l0+2167], %i0");
+#else
+ asm("ld [%l0+56], %l0");
+ asm("retAddr_End:");
+ asm("ld [%l0+60], %i0");
+#endif
+}
+
+static void * __builtin_frame_address(int depth)
+{
+ asm("ta 3");
+ asm("tst %i0");
+ asm("be frameAddr_End");
+ asm("mov %fp, %l0");
+ asm("frameAddr_Start:");
+ asm("sub %i0, 1, %i0");
+ asm("tst %i0");
+ asm("bne frameAddr_Start");
+#if SPARCV9
+ asm("ldx [%l0+2159], %l0");
+ asm("frameAddr_End:");
+ asm("ldx [%l0+2159], %i0");
+#else
+ asm("ld [%l0+56], %l0");
+ asm("frameAddr_End:");
+ asm("ld [%l0+56], %i0");
+#endif
+}
+#endif
+
+gboolean mono_sparc_is_virtual_call (guint32 *code);
+
+gpointer* mono_sparc_get_vcall_slot_addr (guint32 *code, gpointer *fp);
+
+void mono_sparc_flushw (void);
+
+gboolean mono_sparc_is_v9 (void);
+
+gboolean mono_sparc_is_sparc64 (void);
+
+struct MonoCompile;
+
+guint32* mono_sparc_emit_save_lmf (guint32* code, guint32 lmf_offset);
+
+guint32* mono_sparc_emit_restore_lmf (guint32 *code, guint32 lmf_offset);
+
+#endif /* __MONO_MINI_SPARC_H__ */
diff --git a/mono/mini/mini-x86.c b/mono/mini/mini-x86.c
new file mode 100644
index 00000000000..8fe4bfbf341
--- /dev/null
+++ b/mono/mini/mini-x86.c
@@ -0,0 +1,3934 @@
+/*
+ * mini-x86.c: x86 backend for the Mono code generator
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Patrik Torstensson
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include "mini.h"
+#include <string.h>
+#include <math.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/profiler-private.h>
+#include <mono/utils/mono-math.h>
+
+#include "trace.h"
+#include "mini-x86.h"
+#include "inssel.h"
+#include "cpu-pentium.h"
+
+static gint lmf_tls_offset = -1;
+static gint appdomain_tls_offset = -1;
+static gint thread_tls_offset = -1;
+
+#ifdef PLATFORM_WIN32
+/* Under windows, the default pinvoke calling convention is stdcall */
+#define CALLCONV_IS_STDCALL(call_conv) (((call_conv) == MONO_CALL_STDCALL) || ((call_conv) == MONO_CALL_DEFAULT))
+#else
+#define CALLCONV_IS_STDCALL(call_conv) ((call_conv) == MONO_CALL_STDCALL)
+#endif
+
+#define SIGNAL_STACK_SIZE (64 * 1024)
+
+const char*
+mono_arch_regname (int reg) {
+ switch (reg) {
+ case X86_EAX: return "%eax";
+ case X86_EBX: return "%ebx";
+ case X86_ECX: return "%ecx";
+ case X86_EDX: return "%edx";
+ case X86_ESP: return "%esp"; case X86_EBP: return "%ebp";
+ case X86_EDI: return "%edi";
+ case X86_ESI: return "%esi";
+ }
+ return "unknown";
+}
+
+/*
+ * mono_arch_get_argument_info:
+ * @csig: a method signature
+ * @param_count: the number of parameters to consider
+ * @arg_info: an array to store the result infos
+ *
+ * Gathers information on parameters such as size, alignment and
+ * padding. arg_info should be large enought to hold param_count + 1 entries.
+ *
+ * Returns the size of the activation frame.
+ */
+int
+mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info)
+{
+ int k, frame_size = 0;
+ int size, align, pad;
+ int offset = 8;
+
+ if (MONO_TYPE_ISSTRUCT (csig->ret)) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].offset = offset;
+
+ if (csig->hasthis) {
+ frame_size += sizeof (gpointer);
+ offset += 4;
+ }
+
+ arg_info [0].size = frame_size;
+
+ for (k = 0; k < param_count; k++) {
+
+ if (csig->pinvoke)
+ size = mono_type_native_stack_size (csig->params [k], &align);
+ else
+ size = mono_type_stack_size (csig->params [k], &align);
+
+ /* ignore alignment for now */
+ align = 1;
+
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+ frame_size += size;
+ arg_info [k + 1].pad = 0;
+ arg_info [k + 1].size = size;
+ offset += pad;
+ arg_info [k + 1].offset = offset;
+ offset += size;
+ }
+
+ align = MONO_ARCH_FRAME_ALIGNMENT;
+ frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1);
+ arg_info [k].pad = pad;
+
+ return frame_size;
+}
+
+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;
+ __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"
+ );
+
+ 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;
+}
+
+/*
+ * Initialize the cpu to execute managed code.
+ */
+void
+mono_arch_cpu_init (void)
+{
+ guint16 fpcw;
+
+ /* spec compliance requires running with double precision */
+ __asm__ __volatile__ ("fnstcw %0\n": "=m" (fpcw));
+ fpcw &= ~X86_FPCW_PRECC_MASK;
+ fpcw |= X86_FPCW_PREC_DOUBLE;
+ __asm__ __volatile__ ("fldcw %0\n": : "m" (fpcw));
+ __asm__ __volatile__ ("fnstcw %0\n": "=m" (fpcw));
+
+}
+
+/*
+ * This function returns the optimizations supported on this cpu.
+ */
+guint32
+mono_arch_cpu_optimizazions (guint32 *exclude_mask)
+{
+ int eax, ebx, ecx, edx;
+ guint32 opts = 0;
+
+ *exclude_mask = 0;
+ /* Feature Flags function, flags returned in EDX. */
+ if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
+ if (edx & (1 << 15)) {
+ opts |= MONO_OPT_CMOV;
+ if (edx & 1)
+ opts |= MONO_OPT_FCMOV;
+ else
+ *exclude_mask |= MONO_OPT_FCMOV;
+ } else
+ *exclude_mask |= MONO_OPT_CMOV;
+ }
+ return opts;
+}
+
+/*
+ * Determine whenever the trap whose info is in SIGINFO is caused by
+ * integer overflow.
+ */
+gboolean
+mono_arch_is_int_overflow (void *sigctx)
+{
+ struct sigcontext *ctx = (struct sigcontext*)sigctx;
+ guint8* ip;
+
+ ip = (guint8*)ctx->SC_EIP;
+
+ if ((ip [0] == 0xf7) && (x86_modrm_mod (ip [1]) == 0x3) && (x86_modrm_reg (ip [1]) == 0x7)) {
+ gint32 reg;
+
+ /* idiv REG */
+ switch (x86_modrm_rm (ip [1])) {
+ case X86_ECX:
+ reg = ctx->SC_ECX;
+ break;
+ case X86_EBX:
+ reg = ctx->SC_EBX;
+ break;
+ default:
+ g_assert_not_reached ();
+ reg = -1;
+ }
+
+ if (reg == -1)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gboolean
+is_regsize_var (MonoType *t) {
+ if (t->byref)
+ return TRUE;
+ switch (mono_type_get_underlying_type (t)->type) {
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ return TRUE;
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return TRUE;
+ case MONO_TYPE_VALUETYPE:
+ return FALSE;
+ }
+ return FALSE;
+}
+
+GList *
+mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
+{
+ GList *vars = NULL;
+ int i;
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoInst *ins = cfg->varinfo [i];
+ MonoMethodVar *vmv = MONO_VARINFO (cfg, i);
+
+ /* unused vars */
+ if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos)
+ continue;
+
+ if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) ||
+ (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG))
+ continue;
+
+ /* we dont allocate I1 to registers because there is no simply way to sign extend
+ * 8bit quantities in caller saved registers on x86 */
+ if (is_regsize_var (ins->inst_vtype) || (ins->inst_vtype->type == MONO_TYPE_BOOLEAN) ||
+ (ins->inst_vtype->type == MONO_TYPE_U1) || (ins->inst_vtype->type == MONO_TYPE_U2)||
+ (ins->inst_vtype->type == MONO_TYPE_I2) || (ins->inst_vtype->type == MONO_TYPE_CHAR)) {
+ g_assert (MONO_VARINFO (cfg, i)->reg == -1);
+ g_assert (i == vmv->idx);
+ vars = g_list_prepend (vars, vmv);
+ }
+ }
+
+ vars = mono_varlist_sort (cfg, vars, 0);
+
+ return vars;
+}
+
+GList *
+mono_arch_get_global_int_regs (MonoCompile *cfg)
+{
+ GList *regs = NULL;
+
+ /* we can use 3 registers for global allocation */
+ regs = g_list_prepend (regs, (gpointer)X86_EBX);
+ regs = g_list_prepend (regs, (gpointer)X86_ESI);
+ regs = g_list_prepend (regs, (gpointer)X86_EDI);
+
+ return regs;
+}
+
+/*
+ * mono_arch_regalloc_cost:
+ *
+ * Return the cost, in number of memory references, of the action of
+ * allocating the variable VMV into a register during global register
+ * allocation.
+ */
+guint32
+mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv)
+{
+ MonoInst *ins = cfg->varinfo [vmv->idx];
+
+ if (cfg->method->save_lmf)
+ /* The register is already saved */
+ return (ins->opcode == OP_ARG) ? 1 : 0;
+ else
+ /* push+pop+possible load if it is an argument */
+ return (ins->opcode == OP_ARG) ? 3 : 2;
+}
+
+/*
+ * Set var information according to the calling convention. X86 version.
+ * The locals var stuff should most likely be split in another method.
+ */
+void
+mono_arch_allocate_vars (MonoCompile *m)
+{
+ MonoMethodSignature *sig;
+ MonoMethodHeader *header;
+ MonoInst *inst;
+ int i, offset, size, align, curinst;
+
+ header = mono_method_get_header (m->method);
+
+ sig = m->method->signature;
+
+ offset = 8;
+ curinst = 0;
+ if (MONO_TYPE_ISSTRUCT (sig->ret)) {
+ m->ret->opcode = OP_REGOFFSET;
+ m->ret->inst_basereg = X86_EBP;
+ m->ret->inst_offset = offset;
+ offset += sizeof (gpointer);
+ } else {
+ /* FIXME: handle long and FP values */
+ switch (sig->ret->type) {
+ case MONO_TYPE_VOID:
+ break;
+ default:
+ m->ret->opcode = OP_REGVAR;
+ m->ret->inst_c0 = X86_EAX;
+ break;
+ }
+ }
+ if (sig->hasthis) {
+ inst = m->varinfo [curinst];
+ if (inst->opcode != OP_REGVAR) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = X86_EBP;
+ }
+ inst->inst_offset = offset;
+ offset += sizeof (gpointer);
+ curinst++;
+ }
+
+ if (sig->call_convention == MONO_CALL_VARARG) {
+ m->sig_cookie = offset;
+ offset += sizeof (gpointer);
+ }
+
+ for (i = 0; i < sig->param_count; ++i) {
+ inst = m->varinfo [curinst];
+ if (inst->opcode != OP_REGVAR) {
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = X86_EBP;
+ }
+ inst->inst_offset = offset;
+ size = mono_type_size (sig->params [i], &align);
+ size += 4 - 1;
+ size &= ~(4 - 1);
+ offset += size;
+ curinst++;
+ }
+
+ offset = 0;
+
+ /* reserve space to save LMF and caller saved registers */
+
+ if (m->method->save_lmf) {
+ offset += sizeof (MonoLMF);
+ } else {
+ if (m->used_int_regs & (1 << X86_EBX)) {
+ offset += 4;
+ }
+
+ if (m->used_int_regs & (1 << X86_EDI)) {
+ offset += 4;
+ }
+
+ if (m->used_int_regs & (1 << X86_ESI)) {
+ offset += 4;
+ }
+ }
+
+ for (i = curinst; i < m->num_varinfo; ++i) {
+ inst = m->varinfo [i];
+
+ if ((inst->flags & MONO_INST_IS_DEAD) || inst->opcode == OP_REGVAR)
+ continue;
+
+ /* inst->unused indicates native sized value types, this is used by the
+ * pinvoke wrappers when they call functions returning structure */
+ if (inst->unused && MONO_TYPE_ISSTRUCT (inst->inst_vtype) && inst->inst_vtype->type != MONO_TYPE_TYPEDBYREF)
+ size = mono_class_native_size (inst->inst_vtype->data.klass, &align);
+ else
+ size = mono_type_size (inst->inst_vtype, &align);
+
+ offset += size;
+ offset += align - 1;
+ offset &= ~(align - 1);
+ inst->opcode = OP_REGOFFSET;
+ inst->inst_basereg = X86_EBP;
+ inst->inst_offset = -offset;
+ //g_print ("allocating local %d to %d\n", i, -offset);
+ }
+ offset += (MONO_ARCH_FRAME_ALIGNMENT - 1);
+ offset &= ~(MONO_ARCH_FRAME_ALIGNMENT - 1);
+
+ /* change sign? */
+ m->stack_offset = -offset;
+}
+
+/* Fixme: we need an alignment solution for enter_method and mono_arch_call_opcode,
+ * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info
+ */
+
+/*
+ * take the arguments and generate the arch-specific
+ * instructions to properly call the function in call.
+ * This includes pushing, moving arguments to the right register
+ * etc.
+ * Issue: who does the spilling if needed, and when?
+ */
+MonoCallInst*
+mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb, MonoCallInst *call, int is_virtual) {
+ MonoInst *arg, *in;
+ MonoMethodSignature *sig;
+ int i, n, stack_size, type;
+ MonoType *ptype;
+
+ stack_size = 0;
+ /* add the vararg cookie before the non-implicit args */
+ if (call->signature->call_convention == MONO_CALL_VARARG) {
+ MonoInst *sig_arg;
+ /* FIXME: Add support for signature tokens to AOT */
+ cfg->disable_aot = TRUE;
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ MONO_INST_NEW (cfg, sig_arg, OP_ICONST);
+ sig_arg->inst_p0 = call->signature;
+ arg->inst_left = sig_arg;
+ arg->type = STACK_PTR;
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ stack_size += sizeof (gpointer);
+ }
+ sig = call->signature;
+ n = sig->param_count + sig->hasthis;
+
+ if (sig->ret && MONO_TYPE_ISSTRUCT (sig->ret))
+ stack_size += sizeof (gpointer);
+ for (i = 0; i < n; ++i) {
+ if (is_virtual && i == 0) {
+ /* the argument will be attached to the call instrucion */
+ in = call->args [i];
+ stack_size += 4;
+ } else {
+ MONO_INST_NEW (cfg, arg, OP_OUTARG);
+ in = call->args [i];
+ arg->cil_code = in->cil_code;
+ arg->inst_left = in;
+ arg->type = in->type;
+ /* prepend, so they get reversed */
+ arg->next = call->out_args;
+ call->out_args = arg;
+ if (i >= sig->hasthis) {
+ ptype = mono_type_get_underlying_type (sig->params [i - sig->hasthis]);
+ if (ptype->byref)
+ type = MONO_TYPE_U;
+ else
+ type = ptype->type;
+ /* FIXME: validate arguments... */
+ switch (type) {
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ stack_size += 4;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ stack_size += 8;
+ break;
+ case MONO_TYPE_R4:
+ stack_size += 4;
+ arg->opcode = OP_OUTARG_R4;
+ break;
+ case MONO_TYPE_R8:
+ stack_size += 8;
+ arg->opcode = OP_OUTARG_R8;
+ break;
+ case MONO_TYPE_VALUETYPE: {
+ int size;
+ if (sig->pinvoke)
+ size = mono_type_native_stack_size (&in->klass->byval_arg, NULL);
+ else
+ size = mono_type_stack_size (&in->klass->byval_arg, NULL);
+
+ stack_size += size;
+ arg->opcode = OP_OUTARG_VT;
+ arg->klass = in->klass;
+ arg->unused = sig->pinvoke;
+ arg->inst_imm = size;
+ break;
+ }
+ case MONO_TYPE_TYPEDBYREF:
+ stack_size += sizeof (MonoTypedRef);
+ arg->opcode = OP_OUTARG_VT;
+ arg->klass = in->klass;
+ arg->unused = sig->pinvoke;
+ arg->inst_imm = sizeof (MonoTypedRef);
+ break;
+ default:
+ g_error ("unknown type 0x%02x in mono_arch_call_opcode\n", type);
+ }
+ } else {
+ /* the this argument */
+ stack_size += 4;
+ }
+ }
+ }
+ /* if the function returns a struct, the called method already does a ret $0x4 */
+ if (sig->ret && MONO_TYPE_ISSTRUCT (sig->ret))
+ stack_size -= 4;
+ call->stack_usage = stack_size;
+ /*
+ * should set more info in call, such as the stack space
+ * used by the args that needs to be added back to esp
+ */
+
+ return call;
+}
+
+/*
+ * Allow tracing to work with this interface (with an optional argument)
+ */
+
+/*
+ * This may be needed on some archs or for debugging support.
+ */
+void
+mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code)
+{
+ /* no stack room needed now (may be needed for FASTCALL-trace support) */
+ *stack = 0;
+ /* split prolog-epilog requirements? */
+ *code = 50; /* max bytes needed: check this number */
+}
+
+void*
+mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+
+ /* if some args are passed in registers, we need to save them here */
+ x86_push_reg (code, X86_EBP);
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_METHODCONST, cfg->method);
+ x86_push_imm (code, cfg->method);
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_ABS, func);
+ x86_call_code (code, 0);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 8);
+
+ return code;
+}
+
+enum {
+ SAVE_NONE,
+ SAVE_STRUCT,
+ SAVE_EAX,
+ SAVE_EAX_EDX,
+ SAVE_FP
+};
+
+void*
+mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments)
+{
+ guchar *code = p;
+ int arg_size = 0, save_mode = SAVE_NONE;
+ MonoMethod *method = cfg->method;
+
+ switch (mono_type_get_underlying_type (method->signature->ret)->type) {
+ case MONO_TYPE_VOID:
+ /* special case string .ctor icall */
+ if (strcmp (".ctor", method->name) && method->klass == mono_defaults.string_class)
+ save_mode = SAVE_EAX;
+ else
+ save_mode = SAVE_NONE;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ save_mode = SAVE_EAX_EDX;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ save_mode = SAVE_FP;
+ break;
+ case MONO_TYPE_VALUETYPE:
+ save_mode = SAVE_STRUCT;
+ break;
+ default:
+ save_mode = SAVE_EAX;
+ break;
+ }
+
+ switch (save_mode) {
+ case SAVE_EAX_EDX:
+ x86_push_reg (code, X86_EDX);
+ x86_push_reg (code, X86_EAX);
+ if (enable_arguments) {
+ x86_push_reg (code, X86_EDX);
+ x86_push_reg (code, X86_EAX);
+ arg_size = 8;
+ }
+ break;
+ case SAVE_EAX:
+ x86_push_reg (code, X86_EAX);
+ if (enable_arguments) {
+ x86_push_reg (code, X86_EAX);
+ arg_size = 4;
+ }
+ break;
+ case SAVE_FP:
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 8);
+ x86_fst_membase (code, X86_ESP, 0, TRUE, TRUE);
+ if (enable_arguments) {
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 8);
+ x86_fst_membase (code, X86_ESP, 0, TRUE, TRUE);
+ arg_size = 8;
+ }
+ break;
+ case SAVE_STRUCT:
+ if (enable_arguments) {
+ x86_push_membase (code, X86_EBP, 8);
+ arg_size = 4;
+ }
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_METHODCONST, method);
+ x86_push_imm (code, method);
+ mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_ABS, func);
+ x86_call_code (code, 0);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, arg_size + 4);
+
+ switch (save_mode) {
+ case SAVE_EAX_EDX:
+ x86_pop_reg (code, X86_EAX);
+ x86_pop_reg (code, X86_EDX);
+ break;
+ case SAVE_EAX:
+ x86_pop_reg (code, X86_EAX);
+ break;
+ case SAVE_FP:
+ x86_fld_membase (code, X86_ESP, 0, TRUE);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 8);
+ break;
+ case SAVE_NONE:
+ default:
+ break;
+ }
+
+ return code;
+}
+
+#define EMIT_COND_BRANCH(ins,cond,sign) \
+if (ins->flags & MONO_INST_BRLABEL) { \
+ if (ins->inst_i0->inst_c0) { \
+ x86_branch (code, cond, cfg->native_code + ins->inst_i0->inst_c0, sign); \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_LABEL, ins->inst_i0); \
+ if ((cfg->opt & MONO_OPT_BRANCH) && \
+ x86_is_imm8 (ins->inst_i0->inst_c1 - cpos)) \
+ x86_branch8 (code, cond, 0, sign); \
+ else \
+ x86_branch32 (code, cond, 0, sign); \
+ } \
+} else { \
+ if (ins->inst_true_bb->native_offset) { \
+ x86_branch (code, cond, cfg->native_code + ins->inst_true_bb->native_offset, sign); \
+ } else { \
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_true_bb); \
+ if ((cfg->opt & MONO_OPT_BRANCH) && \
+ x86_is_imm8 (ins->inst_true_bb->max_offset - cpos)) \
+ x86_branch8 (code, cond, 0, sign); \
+ else \
+ x86_branch32 (code, cond, 0, sign); \
+ } \
+}
+
+/* emit an exception if condition is fail */
+#define EMIT_COND_SYSTEM_EXCEPTION(cond,signed,exc_name) \
+ do { \
+ mono_add_patch_info (cfg, code - cfg->native_code, \
+ MONO_PATCH_INFO_EXC, exc_name); \
+ x86_branch32 (code, cond, 0, signed); \
+ } while (0);
+
+#define EMIT_FPCOMPARE(code) do { \
+ x86_fcompp (code); \
+ x86_fnstsw (code); \
+} while (0);
+
+/* FIXME: Add more instructions */
+#define INST_IGNORES_CFLAGS(ins) (((ins)->opcode == CEE_BR) || ((ins)->opcode == OP_STORE_MEMBASE_IMM))
+
+static void
+peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins, *last_ins = NULL;
+ ins = bb->code;
+
+ while (ins) {
+
+ switch (ins->opcode) {
+ case OP_ICONST:
+ /* reg = 0 -> XOR (reg, reg) */
+ /* XOR sets cflags on x86, so we cant do it always */
+ if (ins->inst_c0 == 0 && ins->next && INST_IGNORES_CFLAGS (ins->next)) {
+ ins->opcode = CEE_XOR;
+ ins->sreg1 = ins->dreg;
+ ins->sreg2 = ins->dreg;
+ }
+ break;
+ case OP_MUL_IMM:
+ /* remove unnecessary multiplication with 1 */
+ if (ins->inst_imm == 1) {
+ if (ins->dreg != ins->sreg1) {
+ ins->opcode = OP_MOVE;
+ } else {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ }
+ break;
+ case OP_COMPARE_IMM:
+ /* OP_COMPARE_IMM (reg, 0)
+ * -->
+ * OP_X86_TEST_NULL (reg)
+ */
+ if (!ins->inst_imm)
+ ins->opcode = OP_X86_TEST_NULL;
+ break;
+ case OP_X86_COMPARE_MEMBASE_IMM:
+ /*
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_X86_COMPARE_MEMBASE_IMM offset(basereg), imm
+ * -->
+ * OP_STORE_MEMBASE_REG reg, offset(basereg)
+ * OP_COMPARE_IMM reg, imm
+ *
+ * Note: if imm = 0 then OP_COMPARE_IMM replaced with OP_X86_TEST_NULL
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ ins->opcode = OP_COMPARE_IMM;
+ ins->sreg1 = last_ins->sreg1;
+
+ /* check if we can remove cmp reg,0 with test null */
+ if (!ins->inst_imm)
+ ins->opcode = OP_X86_TEST_NULL;
+ }
+
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ /*
+ * Note: if reg1 = reg2 the load op is removed
+ *
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_MOVE reg1, reg2
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG
+ || last_ins->opcode == OP_STORE_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+
+ /*
+ * Note: reg1 must be different from the basereg in the second load
+ * Note: if reg1 = reg2 is equal then second load is removed
+ *
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_LOAD_MEMBASE offset(basereg), reg1
+ * OP_MOVE reg1, reg2
+ */
+ } if (last_ins && (last_ins->opcode == OP_LOADI4_MEMBASE
+ || last_ins->opcode == OP_LOAD_MEMBASE) &&
+ ins->inst_basereg != last_ins->dreg &&
+ ins->inst_basereg == last_ins->inst_basereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+
+ if (ins->dreg == last_ins->dreg) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->dreg;
+ }
+
+ //g_assert_not_reached ();
+
+#if 0
+ /*
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg
+ * -->
+ * OP_STORE_MEMBASE_IMM imm, offset(basereg)
+ * OP_ICONST reg, imm
+ */
+ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM
+ || last_ins->opcode == OP_STORE_MEMBASE_IMM) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_ICONST;
+ ins->inst_c0 = last_ins->inst_imm;
+ g_assert_not_reached (); // check this rule
+#endif
+ }
+ break;
+ case OP_LOADU1_MEMBASE:
+ case OP_LOADI1_MEMBASE:
+ /*
+ * Note: if reg1 = reg2 the load op is removed
+ *
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_MOVE reg1, reg2
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI1_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case OP_LOADU2_MEMBASE:
+ case OP_LOADI2_MEMBASE:
+ /*
+ * Note: if reg1 = reg2 the load op is removed
+ *
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_LOAD_MEMBASE offset(basereg), reg2
+ * -->
+ * OP_STORE_MEMBASE_REG reg1, offset(basereg)
+ * OP_MOVE reg1, reg2
+ */
+ if (last_ins && (last_ins->opcode == OP_STOREI2_MEMBASE_REG) &&
+ ins->inst_basereg == last_ins->inst_destbasereg &&
+ ins->inst_offset == last_ins->inst_offset) {
+ if (ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ } else {
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
+ ins->opcode = OP_MOVE;
+ ins->sreg1 = last_ins->sreg1;
+ }
+ }
+ break;
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ case OP_MOVE:
+ /*
+ * Removes:
+ *
+ * OP_MOVE reg, reg
+ */
+ if (ins->dreg == ins->sreg1) {
+ if (last_ins)
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ /*
+ * Removes:
+ *
+ * OP_MOVE sreg, dreg
+ * OP_MOVE dreg, sreg
+ */
+ if (last_ins && last_ins->opcode == OP_MOVE &&
+ ins->sreg1 == last_ins->dreg &&
+ ins->dreg == last_ins->sreg1) {
+ last_ins->next = ins->next;
+ ins = ins->next;
+ continue;
+ }
+ break;
+ }
+ last_ins = ins;
+ ins = ins->next;
+ }
+ bb->last_ins = last_ins;
+}
+
+static const int
+branch_cc_table [] = {
+ X86_CC_EQ, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT,
+ X86_CC_NE, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT,
+ X86_CC_O, X86_CC_NO, X86_CC_C, X86_CC_NC
+};
+
+#define DEBUG(a) if (cfg->verbose_level > 1) a
+//#define DEBUG(a)
+
+/*
+ * returns the offset used by spillvar. It allocates a new
+ * spill variable if necessary.
+ */
+static int
+mono_spillvar_offset (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset -= sizeof (gpointer);
+ info->offset = cfg->stack_offset;
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*
+ * returns the offset used by spillvar. It allocates a new
+ * spill float variable if necessary.
+ * (same as mono_spillvar_offset but for float)
+ */
+static int
+mono_spillvar_offset_float (MonoCompile *cfg, int spillvar)
+{
+ MonoSpillInfo **si, *info;
+ int i = 0;
+
+ si = &cfg->spill_info_float;
+
+ while (i <= spillvar) {
+
+ if (!*si) {
+ *si = info = mono_mempool_alloc (cfg->mempool, sizeof (MonoSpillInfo));
+ info->next = NULL;
+ cfg->stack_offset -= sizeof (double);
+ info->offset = cfg->stack_offset;
+ }
+
+ if (i == spillvar)
+ return (*si)->offset;
+
+ i++;
+ si = &(*si)->next;
+ }
+
+ g_assert_not_reached ();
+ return 0;
+}
+
+/*
+ * Creates a store for spilled floating point items
+ */
+static MonoInst*
+create_spilled_store_float (MonoCompile *cfg, int spill, int reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORER8_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = X86_EBP;
+ store->inst_offset = mono_spillvar_offset_float (cfg, spill);
+
+ DEBUG (g_print ("SPILLED FLOAT STORE (%d at 0x%08x(%%sp)) (from %d)\n", spill, store->inst_offset, reg));
+ return store;
+}
+
+/*
+ * Creates a load for spilled floating point items
+ */
+static MonoInst*
+create_spilled_load_float (MonoCompile *cfg, int spill, int reg, MonoInst *ins)
+{
+ MonoInst *load;
+ MONO_INST_NEW (cfg, load, OP_LOADR8_SPILL_MEMBASE);
+ load->dreg = reg;
+ load->inst_basereg = X86_EBP;
+ load->inst_offset = mono_spillvar_offset_float (cfg, spill);
+
+ DEBUG (g_print ("SPILLED FLOAT LOAD (%d at 0x%08x(%%sp)) (from %d)\n", spill, load->inst_offset, reg));
+ return load;
+}
+
+#define reg_is_freeable(r) ((r) >= 0 && (r) <= 7 && X86_IS_CALLEE ((r)))
+
+typedef struct {
+ int born_in;
+ int killed_in;
+ int last_use;
+ int prev_use;
+ int flags; /* used to track fp spill/load */
+} RegTrack;
+
+static const char*const * ins_spec = pentium_desc;
+
+static void
+print_ins (int i, MonoInst *ins)
+{
+ const char *spec = ins_spec [ins->opcode];
+ g_print ("\t%-2d %s", i, mono_inst_name (ins->opcode));
+ if (spec [MONO_INST_DEST]) {
+ if (ins->dreg >= MONO_MAX_IREGS)
+ g_print (" R%d <-", ins->dreg);
+ else
+ g_print (" %s <-", mono_arch_regname (ins->dreg));
+ }
+ if (spec [MONO_INST_SRC1]) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg1);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg1));
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ g_print (" R%d", ins->sreg2);
+ else
+ g_print (" %s", mono_arch_regname (ins->sreg2));
+ }
+ if (spec [MONO_INST_CLOB])
+ g_print (" clobbers: %c", spec [MONO_INST_CLOB]);
+ g_print ("\n");
+}
+
+static void
+print_regtrack (RegTrack *t, int num)
+{
+ int i;
+ char buf [32];
+ const char *r;
+
+ for (i = 0; i < num; ++i) {
+ if (!t [i].born_in)
+ continue;
+ if (i >= MONO_MAX_IREGS) {
+ g_snprintf (buf, sizeof(buf), "R%d", i);
+ r = buf;
+ } else
+ r = mono_arch_regname (i);
+ g_print ("liveness: %s [%d - %d]\n", r, t [i].born_in, t[i].last_use);
+ }
+}
+
+typedef struct InstList InstList;
+
+struct InstList {
+ InstList *prev;
+ InstList *next;
+ MonoInst *data;
+};
+
+static inline InstList*
+inst_list_prepend (MonoMemPool *pool, InstList *list, MonoInst *data)
+{
+ InstList *item = mono_mempool_alloc (pool, sizeof (InstList));
+ item->data = data;
+ item->prev = NULL;
+ item->next = list;
+ if (list)
+ list->prev = item;
+ return item;
+}
+
+/*
+ * Force the spilling of the variable in the symbolic register 'reg'.
+ */
+static int
+get_register_force_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ sel = cfg->rs->iassign [reg];
+ /*i = cfg->rs->isymbolic [sel];
+ g_assert (i == reg);*/
+ i = reg;
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = X86_EBP;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("SPILLED LOAD (%d at 0x%08x(%%ebp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static int
+get_register_spilling (MonoCompile *cfg, InstList *item, MonoInst *ins, guint32 regmask, int reg)
+{
+ MonoInst *load;
+ int i, sel, spill;
+
+ DEBUG (g_print ("\tstart regmask to assign R%d: 0x%08x (R%d <- R%d R%d)\n", reg, regmask, ins->dreg, ins->sreg1, ins->sreg2));
+ /* exclude the registers in the current instruction */
+ if (reg != ins->sreg1 && (reg_is_freeable (ins->sreg1) || (ins->sreg1 >= MONO_MAX_IREGS && cfg->rs->iassign [ins->sreg1] >= 0))) {
+ if (ins->sreg1 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg1]);
+ else
+ regmask &= ~ (1 << ins->sreg1);
+ DEBUG (g_print ("\t\texcluding sreg1 %s\n", mono_arch_regname (ins->sreg1)));
+ }
+ if (reg != ins->sreg2 && (reg_is_freeable (ins->sreg2) || (ins->sreg2 >= MONO_MAX_IREGS && cfg->rs->iassign [ins->sreg2] >= 0))) {
+ if (ins->sreg2 >= MONO_MAX_IREGS)
+ regmask &= ~ (1 << cfg->rs->iassign [ins->sreg2]);
+ else
+ regmask &= ~ (1 << ins->sreg2);
+ DEBUG (g_print ("\t\texcluding sreg2 %s %d\n", mono_arch_regname (ins->sreg2), ins->sreg2));
+ }
+ if (reg != ins->dreg && reg_is_freeable (ins->dreg)) {
+ regmask &= ~ (1 << ins->dreg);
+ DEBUG (g_print ("\t\texcluding dreg %s\n", mono_arch_regname (ins->dreg)));
+ }
+
+ DEBUG (g_print ("\t\tavailable regmask: 0x%08x\n", regmask));
+ g_assert (regmask); /* need at least a register we can free */
+ sel = -1;
+ /* we should track prev_use and spill the register that's farther */
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ if (regmask & (1 << i)) {
+ sel = i;
+ DEBUG (g_print ("\t\tselected register %s has assignment %d\n", mono_arch_regname (sel), cfg->rs->iassign [sel]));
+ break;
+ }
+ }
+ i = cfg->rs->isymbolic [sel];
+ spill = ++cfg->spill_count;
+ cfg->rs->iassign [i] = -spill - 1;
+ mono_regstate_free_int (cfg->rs, sel);
+ /* we need to create a spill var and insert a load to sel after the current instruction */
+ MONO_INST_NEW (cfg, load, OP_LOAD_MEMBASE);
+ load->dreg = sel;
+ load->inst_basereg = X86_EBP;
+ load->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (item->prev) {
+ while (ins->next != item->prev->data)
+ ins = ins->next;
+ }
+ load->next = ins->next;
+ ins->next = load;
+ DEBUG (g_print ("\tSPILLED LOAD (%d at 0x%08x(%%ebp)) R%d (freed %s)\n", spill, load->inst_offset, i, mono_arch_regname (sel)));
+ i = mono_regstate_alloc_int (cfg->rs, 1 << sel);
+ g_assert (i == sel);
+
+ return sel;
+}
+
+static MonoInst*
+create_copy_ins (MonoCompile *cfg, int dest, int src, MonoInst *ins)
+{
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MOVE);
+ copy->dreg = dest;
+ copy->sreg1 = src;
+ if (ins) {
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ DEBUG (g_print ("\tforced copy from %s to %s\n", mono_arch_regname (src), mono_arch_regname (dest)));
+ return copy;
+}
+
+static MonoInst*
+create_spilled_store (MonoCompile *cfg, int spill, int reg, int prev_reg, MonoInst *ins)
+{
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, OP_STORE_MEMBASE_REG);
+ store->sreg1 = reg;
+ store->inst_destbasereg = X86_EBP;
+ store->inst_offset = mono_spillvar_offset (cfg, spill);
+ if (ins) {
+ store->next = ins->next;
+ ins->next = store;
+ }
+ DEBUG (g_print ("\tSPILLED STORE (%d at 0x%08x(%%ebp)) R%d (from %s)\n", spill, store->inst_offset, prev_reg, mono_arch_regname (reg)));
+ return store;
+}
+
+static void
+insert_before_ins (MonoInst *ins, InstList *item, MonoInst* to_insert)
+{
+ MonoInst *prev;
+ if (item->next) {
+ prev = item->next->data;
+
+ while (prev->next != ins)
+ prev = prev->next;
+ to_insert->next = ins;
+ prev->next = to_insert;
+ } else {
+ to_insert->next = ins;
+ }
+ /*
+ * needed otherwise in the next instruction we can add an ins to the
+ * end and that would get past this instruction.
+ */
+ item->data = to_insert;
+}
+
+
+#if 0
+static int
+alloc_int_reg (MonoCompile *cfg, InstList *curinst, MonoInst *ins, int sym_reg, guint32 allow_mask)
+{
+ int val = cfg->rs->iassign [sym_reg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_regstate_alloc_int (cfg->rs, allow_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, curinst, ins, allow_mask, sym_reg);
+ cfg->rs->iassign [sym_reg] = val;
+ /* add option to store before the instruction for src registers */
+ if (spill)
+ create_spilled_store (cfg, spill, val, sym_reg, ins);
+ }
+ cfg->rs->isymbolic [val] = sym_reg;
+ return val;
+}
+#endif
+
+/* flags used in reginfo->flags */
+enum {
+ MONO_X86_FP_NEEDS_LOAD_SPILL = 1 << 0,
+ MONO_X86_FP_NEEDS_SPILL = 1 << 1,
+ MONO_X86_FP_NEEDS_LOAD = 1 << 2,
+ MONO_X86_REG_NOT_ECX = 1 << 3,
+ MONO_X86_REG_EAX = 1 << 4,
+ MONO_X86_REG_EDX = 1 << 5,
+ MONO_X86_REG_ECX = 1 << 6
+};
+
+static int
+mono_x86_alloc_int_reg (MonoCompile *cfg, InstList *tmp, MonoInst *ins, guint32 dest_mask, int sym_reg, int flags)
+{
+ int val;
+ int test_mask = dest_mask;
+
+ if (flags & MONO_X86_REG_EAX)
+ test_mask &= (1 << X86_EAX);
+ else if (flags & MONO_X86_REG_EDX)
+ test_mask &= (1 << X86_EDX);
+ else if (flags & MONO_X86_REG_ECX)
+ test_mask &= (1 << X86_ECX);
+ else if (flags & MONO_X86_REG_NOT_ECX)
+ test_mask &= ~ (1 << X86_ECX);
+
+ val = mono_regstate_alloc_int (cfg->rs, test_mask);
+ if (val >= 0 && test_mask != dest_mask)
+ DEBUG(g_print ("\tUsed flag to allocate reg %s for R%u\n", mono_arch_regname (val), sym_reg));
+
+ if (val < 0 && (flags & MONO_X86_REG_NOT_ECX)) {
+ DEBUG(g_print ("\tFailed to allocate flag suggested mask (%u) but exluding ECX\n", test_mask));
+ val = mono_regstate_alloc_int (cfg->rs, (dest_mask & (~1 << X86_ECX)));
+ }
+
+ if (val < 0) {
+ val = mono_regstate_alloc_int (cfg->rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, sym_reg);
+ }
+
+ return val;
+}
+
+
+/*#include "cprop.c"*/
+
+/*
+ * Local register allocation.
+ * We first scan the list of instructions and we save the liveness info of
+ * each register (when the register is first used, when it's value is set etc.).
+ * We also reverse the list of instructions (in the InstList list) because assigning
+ * registers backwards allows for more tricks to be used.
+ */
+void
+mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoRegState *rs = cfg->rs;
+ int i, val, fpcount;
+ RegTrack *reginfo, *reginfof;
+ RegTrack *reginfo1, *reginfo2, *reginfod;
+ InstList *tmp, *reversed = NULL;
+ const char *spec;
+ guint32 src1_mask, src2_mask, dest_mask;
+ GList *fspill_list = NULL;
+ int fspill = 0;
+
+ if (!bb->code)
+ return;
+ rs->next_vireg = bb->max_ireg;
+ rs->next_vfreg = bb->max_freg;
+ mono_regstate_assign (rs);
+ reginfo = g_malloc0 (sizeof (RegTrack) * rs->next_vireg);
+ reginfof = g_malloc0 (sizeof (RegTrack) * rs->next_vfreg);
+ rs->ifree_mask = X86_CALLEE_REGS;
+
+ ins = bb->code;
+
+ /*if (cfg->opt & MONO_OPT_COPYPROP)
+ local_copy_prop (cfg, ins);*/
+
+ i = 1;
+ fpcount = 0;
+ DEBUG (g_print ("LOCAL regalloc: basic block: %d\n", bb->block_num));
+ /* forward pass on the instructions to collect register liveness info */
+ while (ins) {
+ spec = ins_spec [ins->opcode];
+
+ DEBUG (print_ins (i, ins));
+
+ if (spec [MONO_INST_SRC1]) {
+ if (spec [MONO_INST_SRC1] == 'f') {
+ GList *spill;
+ reginfo1 = reginfof;
+
+ spill = g_list_first (fspill_list);
+ if (spill && fpcount < MONO_MAX_FREGS) {
+ reginfo1 [ins->sreg1].flags |= MONO_X86_FP_NEEDS_LOAD;
+ fspill_list = g_list_remove (fspill_list, spill->data);
+ } else
+ fpcount--;
+ }
+ else
+ reginfo1 = reginfo;
+ reginfo1 [ins->sreg1].prev_use = reginfo1 [ins->sreg1].last_use;
+ reginfo1 [ins->sreg1].last_use = i;
+ if (spec [MONO_INST_SRC1] == 'L') {
+ /* The virtual register is allocated sequentially */
+ reginfo1 [ins->sreg1 + 1].prev_use = reginfo1 [ins->sreg1 + 1].last_use;
+ reginfo1 [ins->sreg1 + 1].last_use = i;
+ if (reginfo1 [ins->sreg1 + 1].born_in == 0 || reginfo1 [ins->sreg1 + 1].born_in > i)
+ reginfo1 [ins->sreg1 + 1].born_in = i;
+
+ reginfo1 [ins->sreg1].flags |= MONO_X86_REG_EAX;
+ reginfo1 [ins->sreg1 + 1].flags |= MONO_X86_REG_EDX;
+ }
+ } else {
+ ins->sreg1 = -1;
+ }
+ if (spec [MONO_INST_SRC2]) {
+ if (spec [MONO_INST_SRC2] == 'f') {
+ GList *spill;
+ reginfo2 = reginfof;
+ spill = g_list_first (fspill_list);
+ if (spill) {
+ reginfo2 [ins->sreg2].flags |= MONO_X86_FP_NEEDS_LOAD;
+ fspill_list = g_list_remove (fspill_list, spill->data);
+ if (fpcount >= MONO_MAX_FREGS) {
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ reginfo2 [ins->sreg2].flags |= MONO_X86_FP_NEEDS_LOAD_SPILL;
+ }
+ } else
+ fpcount--;
+ }
+ else
+ reginfo2 = reginfo;
+ reginfo2 [ins->sreg2].prev_use = reginfo2 [ins->sreg2].last_use;
+ reginfo2 [ins->sreg2].last_use = i;
+ if (spec [MONO_INST_SRC2] == 'L') {
+ /* The virtual register is allocated sequentially */
+ reginfo2 [ins->sreg2 + 1].prev_use = reginfo2 [ins->sreg2 + 1].last_use;
+ reginfo2 [ins->sreg2 + 1].last_use = i;
+ if (reginfo2 [ins->sreg2 + 1].born_in == 0 || reginfo2 [ins->sreg2 + 1].born_in > i)
+ reginfo2 [ins->sreg2 + 1].born_in = i;
+ }
+ if (spec [MONO_INST_CLOB] == 's') {
+ reginfo2 [ins->sreg1].flags |= MONO_X86_REG_NOT_ECX;
+ reginfo2 [ins->sreg2].flags |= MONO_X86_REG_ECX;
+ }
+ } else {
+ ins->sreg2 = -1;
+ }
+ if (spec [MONO_INST_DEST]) {
+ if (spec [MONO_INST_DEST] == 'f') {
+ reginfod = reginfof;
+ if (fpcount >= MONO_MAX_FREGS) {
+ reginfod [ins->dreg].flags |= MONO_X86_FP_NEEDS_SPILL;
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ fpcount--;
+ }
+ fpcount++;
+ }
+ else
+ reginfod = reginfo;
+ if (spec [MONO_INST_DEST] != 'b') /* it's not just a base register */
+ reginfod [ins->dreg].killed_in = i;
+ reginfod [ins->dreg].prev_use = reginfod [ins->dreg].last_use;
+ reginfod [ins->dreg].last_use = i;
+ if (reginfod [ins->dreg].born_in == 0 || reginfod [ins->dreg].born_in > i)
+ reginfod [ins->dreg].born_in = i;
+ if (spec [MONO_INST_DEST] == 'l' || spec [MONO_INST_DEST] == 'L') {
+ /* The virtual register is allocated sequentially */
+ reginfod [ins->dreg + 1].prev_use = reginfod [ins->dreg + 1].last_use;
+ reginfod [ins->dreg + 1].last_use = i;
+ if (reginfod [ins->dreg + 1].born_in == 0 || reginfod [ins->dreg + 1].born_in > i)
+ reginfod [ins->dreg + 1].born_in = i;
+
+ reginfod [ins->dreg].flags |= MONO_X86_REG_EAX;
+ reginfod [ins->dreg + 1].flags |= MONO_X86_REG_EDX;
+ }
+ } else {
+ ins->dreg = -1;
+ }
+
+ reversed = inst_list_prepend (cfg->mempool, reversed, ins);
+ ++i;
+ ins = ins->next;
+ }
+
+ // todo: check if we have anything left on fp stack, in verify mode?
+ fspill = 0;
+
+ DEBUG (print_regtrack (reginfo, rs->next_vireg));
+ DEBUG (print_regtrack (reginfof, rs->next_vfreg));
+ tmp = reversed;
+ while (tmp) {
+ int prev_dreg, prev_sreg1, prev_sreg2, clob_dreg;
+ dest_mask = src1_mask = src2_mask = X86_CALLEE_REGS;
+ --i;
+ ins = tmp->data;
+ spec = ins_spec [ins->opcode];
+ prev_dreg = -1;
+ clob_dreg = -1;
+ DEBUG (g_print ("processing:"));
+ DEBUG (print_ins (i, ins));
+ if (spec [MONO_INST_CLOB] == 's') {
+ if (rs->ifree_mask & (1 << X86_ECX)) {
+ DEBUG (g_print ("\tshortcut assignment of R%d to ECX\n", ins->sreg2));
+ rs->iassign [ins->sreg2] = X86_ECX;
+ rs->isymbolic [X86_ECX] = ins->sreg2;
+ ins->sreg2 = X86_ECX;
+ rs->ifree_mask &= ~ (1 << X86_ECX);
+ } else {
+ int need_ecx_spill = TRUE;
+ /*
+ * we first check if src1/dreg is already assigned a register
+ * and then we force a spill of the var assigned to ECX.
+ */
+ /* the destination register can't be ECX */
+ dest_mask &= ~ (1 << X86_ECX);
+ src1_mask &= ~ (1 << X86_ECX);
+ val = rs->iassign [ins->dreg];
+ /*
+ * the destination register is already assigned to ECX:
+ * we need to allocate another register for it and then
+ * copy from this to ECX.
+ */
+ if (val == X86_ECX && ins->dreg != ins->sreg2) {
+ int new_dest;
+ new_dest = mono_x86_alloc_int_reg (cfg, tmp, ins, dest_mask, ins->dreg, reginfo [ins->dreg].flags);
+ g_assert (new_dest >= 0);
+ DEBUG (g_print ("\tclob:s changing dreg R%d to %s from ECX\n", ins->dreg, mono_arch_regname (new_dest)));
+
+ rs->isymbolic [new_dest] = ins->dreg;
+ rs->iassign [ins->dreg] = new_dest;
+ clob_dreg = ins->dreg;
+ ins->dreg = new_dest;
+ create_copy_ins (cfg, X86_ECX, new_dest, ins);
+ need_ecx_spill = FALSE;
+ /*DEBUG (g_print ("\tforced spill of R%d\n", ins->dreg));
+ val = get_register_force_spilling (cfg, tmp, ins, ins->dreg);
+ rs->iassign [ins->dreg] = val;
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;*/
+ }
+ val = rs->iassign [ins->sreg1];
+ if (val == X86_ECX) {
+ g_assert_not_reached ();
+ } else if (val >= 0) {
+ /*
+ * the first src reg was already assigned to a register,
+ * we need to copy it to the dest register because the
+ * shift instruction clobbers the first operand.
+ */
+ MonoInst *copy = create_copy_ins (cfg, ins->dreg, val, NULL);
+ DEBUG (g_print ("\tclob:s moved sreg1 from R%d to R%d\n", val, ins->dreg));
+ insert_before_ins (ins, tmp, copy);
+ }
+ val = rs->iassign [ins->sreg2];
+ if (val >= 0 && val != X86_ECX) {
+ MonoInst *move = create_copy_ins (cfg, X86_ECX, val, NULL);
+ DEBUG (g_print ("\tmoved arg from R%d (%d) to ECX\n", val, ins->sreg2));
+ move->next = ins;
+ g_assert_not_reached ();
+ /* FIXME: where is move connected to the instruction list? */
+ //tmp->prev->data->next = move;
+ }
+ if (need_ecx_spill && !(rs->ifree_mask & (1 << X86_ECX))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [X86_ECX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [X86_ECX]);
+ mono_regstate_free_int (rs, X86_ECX);
+ }
+ /* force-set sreg2 */
+ rs->iassign [ins->sreg2] = X86_ECX;
+ rs->isymbolic [X86_ECX] = ins->sreg2;
+ ins->sreg2 = X86_ECX;
+ rs->ifree_mask &= ~ (1 << X86_ECX);
+ }
+ } else if (spec [MONO_INST_CLOB] == 'd') { /* division */
+ int dest_reg = X86_EAX;
+ int clob_reg = X86_EDX;
+ if (spec [MONO_INST_DEST] == 'd') {
+ dest_reg = X86_EDX; /* reminder */
+ clob_reg = X86_EAX;
+ }
+ val = rs->iassign [ins->dreg];
+ if (0 && val >= 0 && val != dest_reg && !(rs->ifree_mask & (1 << dest_reg))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [dest_reg]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [dest_reg]);
+ mono_regstate_free_int (rs, dest_reg);
+ }
+ if (val < 0) {
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ int spill = -val -1;
+ dest_mask = 1 << clob_reg;
+ prev_dreg = ins->dreg;
+ val = mono_regstate_alloc_int (rs, dest_mask);
+ if (val < 0)
+ val = get_register_spilling (cfg, tmp, ins, dest_mask, ins->dreg);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins);
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ if (val != dest_reg) { /* force a copy */
+ create_copy_ins (cfg, val, dest_reg, ins);
+ }
+ } else {
+ DEBUG (g_print ("\tshortcut assignment of R%d to %s\n", ins->dreg, mono_arch_regname (dest_reg)));
+ prev_dreg = ins->dreg;
+ rs->iassign [ins->dreg] = dest_reg;
+ rs->isymbolic [dest_reg] = ins->dreg;
+ ins->dreg = dest_reg;
+ rs->ifree_mask &= ~ (1 << dest_reg);
+ }
+ } else {
+ //DEBUG (g_print ("dest reg in div assigned: %s\n", mono_arch_regname (val)));
+ if (val != dest_reg) { /* force a copy */
+ create_copy_ins (cfg, val, dest_reg, ins);
+ if (!(rs->ifree_mask & (1 << dest_reg)) && rs->isymbolic [dest_reg] >= MONO_MAX_IREGS) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [dest_reg]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [dest_reg]);
+ mono_regstate_free_int (rs, dest_reg);
+ }
+ }
+ }
+ if (!(rs->ifree_mask & (1 << clob_reg)) && (clob_reg != val) && (rs->isymbolic [clob_reg] >= 8)) {
+ DEBUG (g_print ("\tforced spill of clobbered reg R%d\n", rs->isymbolic [clob_reg]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [clob_reg]);
+ mono_regstate_free_int (rs, clob_reg);
+ }
+ src1_mask = 1 << X86_EAX;
+ src2_mask = 1 << X86_ECX;
+ }
+ if (spec [MONO_INST_DEST] == 'l') {
+ int hreg;
+ val = rs->iassign [ins->dreg];
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ if (spec [MONO_INST_CLOB] == 's' && clob_dreg != -1)
+ hreg = clob_dreg + 1;
+ else
+ hreg = ins->dreg + 1;
+
+ /* base prev_dreg on fixed hreg, handle clob case */
+ val = hreg - 1;
+
+ if (val != rs->isymbolic [X86_EAX] && !(rs->ifree_mask & (1 << X86_EAX))) {
+ DEBUG (g_print ("\t(long-low) forced spill of R%d\n", rs->isymbolic [X86_EAX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [X86_EAX]);
+ mono_regstate_free_int (rs, X86_EAX);
+ }
+ if (hreg != rs->isymbolic [X86_EDX] && !(rs->ifree_mask & (1 << X86_EDX))) {
+ DEBUG (g_print ("\t(long-high) forced spill of R%d\n", rs->isymbolic [X86_EDX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [X86_EDX]);
+ mono_regstate_free_int (rs, X86_EDX);
+ }
+ }
+
+ /* Track dreg */
+ if (spec [MONO_INST_DEST] == 'f') {
+ if (reginfof [ins->dreg].flags & MONO_X86_FP_NEEDS_SPILL) {
+ GList *spill_node;
+ MonoInst *store;
+ spill_node = g_list_first (fspill_list);
+ g_assert (spill_node);
+
+ store = create_spilled_store_float (cfg, GPOINTER_TO_INT (spill_node->data), ins->dreg, ins);
+ insert_before_ins (ins, tmp, store);
+ fspill_list = g_list_remove (fspill_list, spill_node->data);
+ fspill--;
+ }
+ } else if (spec [MONO_INST_DEST] == 'L') {
+ int hreg;
+ val = rs->iassign [ins->dreg];
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ if (spec [MONO_INST_CLOB] == 's' && clob_dreg != -1)
+ hreg = clob_dreg + 1;
+ else
+ hreg = ins->dreg + 1;
+
+ /* base prev_dreg on fixed hreg, handle clob case */
+ prev_dreg = hreg - 1;
+
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_x86_alloc_int_reg (cfg, tmp, ins, dest_mask, ins->dreg, reginfo [ins->dreg].flags);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins);
+ }
+
+ DEBUG (g_print ("\tassigned dreg (long) %s to dest R%d\n", mono_arch_regname (val), hreg - 1));
+
+ rs->isymbolic [val] = hreg - 1;
+ ins->dreg = val;
+
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_x86_alloc_int_reg (cfg, tmp, ins, dest_mask, hreg, reginfo [hreg].flags);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins);
+ }
+
+ DEBUG (g_print ("\tassigned hreg (long-high) %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+ /* save reg allocating into unused */
+ ins->unused = val;
+
+ /* check if we can free our long reg */
+ if (reg_is_freeable (val) && hreg >= 0 && reginfo [hreg].born_in >= i) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (val), hreg, reginfo [hreg].born_in));
+ mono_regstate_free_int (rs, val);
+ }
+ }
+ else if (ins->dreg >= MONO_MAX_IREGS) {
+ int hreg;
+ val = rs->iassign [ins->dreg];
+ if (spec [MONO_INST_DEST] == 'l') {
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ if (spec [MONO_INST_CLOB] == 's' && clob_dreg != -1)
+ hreg = clob_dreg + 1;
+ else
+ hreg = ins->dreg + 1;
+
+ /* base prev_dreg on fixed hreg, handle clob case */
+ prev_dreg = hreg - 1;
+ } else
+ prev_dreg = ins->dreg;
+
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_x86_alloc_int_reg (cfg, tmp, ins, dest_mask, ins->dreg, reginfo [ins->dreg].flags);
+ rs->iassign [ins->dreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_dreg, ins);
+ }
+ DEBUG (g_print ("\tassigned dreg %s to dest R%d\n", mono_arch_regname (val), ins->dreg));
+ rs->isymbolic [val] = prev_dreg;
+ ins->dreg = val;
+ /* handle cases where lreg needs to be eax:edx */
+ if (spec [MONO_INST_DEST] == 'l') {
+ /* check special case when dreg have been moved from ecx (clob shift) */
+ int hreg = prev_dreg + 1;
+ val = rs->iassign [hreg];
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_x86_alloc_int_reg (cfg, tmp, ins, dest_mask, hreg, reginfo [hreg].flags);
+ rs->iassign [hreg] = val;
+ if (spill)
+ create_spilled_store (cfg, spill, val, hreg, ins);
+ }
+ DEBUG (g_print ("\tassigned hreg %s to dest R%d\n", mono_arch_regname (val), hreg));
+ rs->isymbolic [val] = hreg;
+ if (ins->dreg == X86_EAX) {
+ if (val != X86_EDX)
+ create_copy_ins (cfg, val, X86_EDX, ins);
+ } else if (ins->dreg == X86_EDX) {
+ if (val == X86_EAX) {
+ /* swap */
+ g_assert_not_reached ();
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, val, X86_EDX, ins);
+ create_copy_ins (cfg, ins->dreg, X86_EAX, ins);
+ }
+ } else {
+ if (val == X86_EDX) {
+ create_copy_ins (cfg, ins->dreg, X86_EAX, ins);
+ } else {
+ /* two forced copies */
+ create_copy_ins (cfg, val, X86_EDX, ins);
+ create_copy_ins (cfg, ins->dreg, X86_EAX, ins);
+ }
+ }
+ if (reg_is_freeable (val) && hreg >= 0 && reginfo [hreg].born_in >= i) {
+ DEBUG (g_print ("\tfreeable %s (R%d)\n", mono_arch_regname (val), hreg));
+ mono_regstate_free_int (rs, val);
+ }
+ } else if (spec [MONO_INST_DEST] == 'a' && ins->dreg != X86_EAX && spec [MONO_INST_CLOB] != 'd') {
+ /* this instruction only outputs to EAX, need to copy */
+ create_copy_ins (cfg, ins->dreg, X86_EAX, ins);
+ } else if (spec [MONO_INST_DEST] == 'd' && ins->dreg != X86_EDX && spec [MONO_INST_CLOB] != 'd') {
+ create_copy_ins (cfg, ins->dreg, X86_EDX, ins);
+ }
+ }
+ if (spec [MONO_INST_DEST] != 'f' && reg_is_freeable (ins->dreg) && prev_dreg >= 0 && reginfo [prev_dreg].born_in >= i) {
+ DEBUG (g_print ("\tfreeable %s (R%d) (born in %d)\n", mono_arch_regname (ins->dreg), prev_dreg, reginfo [prev_dreg].born_in));
+ mono_regstate_free_int (rs, ins->dreg);
+ }
+ /* put src1 in EAX if it needs to be */
+ if (spec [MONO_INST_SRC1] == 'a') {
+ if (!(rs->ifree_mask & (1 << X86_EAX))) {
+ DEBUG (g_print ("\tforced spill of R%d\n", rs->isymbolic [X86_EAX]));
+ get_register_force_spilling (cfg, tmp, ins, rs->isymbolic [X86_EAX]);
+ mono_regstate_free_int (rs, X86_EAX);
+ }
+ /* force-set sreg1 */
+ rs->iassign [ins->sreg1] = X86_EAX;
+ rs->isymbolic [X86_EAX] = ins->sreg1;
+ ins->sreg1 = X86_EAX;
+ rs->ifree_mask &= ~ (1 << X86_EAX);
+ }
+
+ /* Track sreg1 */
+ if (spec [MONO_INST_SRC1] == 'f') {
+ if (reginfof [ins->sreg1].flags & MONO_X86_FP_NEEDS_LOAD) {
+ MonoInst *load;
+ MonoInst *store = NULL;
+
+ if (reginfof [ins->sreg1].flags & MONO_X86_FP_NEEDS_LOAD_SPILL) {
+ GList *spill_node;
+ spill_node = g_list_first (fspill_list);
+ g_assert (spill_node);
+
+ store = create_spilled_store_float (cfg, GPOINTER_TO_INT (spill_node->data), ins->sreg1, ins);
+ fspill_list = g_list_remove (fspill_list, spill_node->data);
+ }
+
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ load = create_spilled_load_float (cfg, fspill, ins->sreg1, ins);
+ insert_before_ins (ins, tmp, load);
+ if (store)
+ insert_before_ins (load, tmp, store);
+ }
+ } else if ((spec [MONO_INST_DEST] == 'L') && (spec [MONO_INST_SRC1] == 'L')) {
+ /* force source to be same as dest */
+ rs->iassign [ins->sreg1] = ins->dreg;
+ rs->iassign [ins->sreg1 + 1] = ins->unused;
+ rs->isymbolic [ins->dreg] = ins->sreg1;
+ rs->isymbolic [ins->unused] = ins->sreg1 + 1;
+
+ DEBUG (g_print ("\tassigned sreg1 (long) %s to sreg1 R%d\n", mono_arch_regname (ins->dreg), ins->sreg1));
+ DEBUG (g_print ("\tassigned sreg1 (long-high) %s to sreg1 R%d\n", mono_arch_regname (ins->unused), ins->sreg1 + 1));
+
+ ins->sreg1 = ins->dreg;
+ /*
+ * No need for saving the reg, we know that src1=dest in this cases
+ * ins->inst_c0 = ins->unused;
+ */
+
+ /* make sure that we remove them from free mask */
+ rs->ifree_mask &= ~ (1 << ins->dreg);
+ rs->ifree_mask &= ~ (1 << ins->unused);
+ }
+ else if (ins->sreg1 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg1];
+ prev_sreg1 = ins->sreg1;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ if (0 && ins->opcode == OP_MOVE) {
+ /*
+ * small optimization: the dest register is already allocated
+ * but the src one is not: we can simply assign the same register
+ * here and peephole will get rid of the instruction later.
+ * This optimization may interfere with the clobbering handling:
+ * it removes a mov operation that will be added again to handle clobbering.
+ * There are also some other issues that should with make testjit.
+ */
+ mono_regstate_alloc_int (rs, 1 << ins->dreg);
+ val = rs->iassign [ins->sreg1] = ins->dreg;
+ //g_assert (val >= 0);
+ DEBUG (g_print ("\tfast assigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ } else {
+ //g_assert (val == -1); /* source cannot be spilled */
+ val = mono_x86_alloc_int_reg (cfg, tmp, ins, src1_mask, ins->sreg1, reginfo [ins->sreg1].flags);
+ rs->iassign [ins->sreg1] = val;
+ DEBUG (g_print ("\tassigned sreg1 %s to R%d\n", mono_arch_regname (val), ins->sreg1));
+ }
+ if (spill) {
+ MonoInst *store = create_spilled_store (cfg, spill, val, prev_sreg1, NULL);
+ insert_before_ins (ins, tmp, store);
+ }
+ }
+ rs->isymbolic [val] = prev_sreg1;
+ ins->sreg1 = val;
+ } else {
+ prev_sreg1 = -1;
+ }
+ /* handle clobbering of sreg1 */
+ if ((spec [MONO_INST_CLOB] == '1' || spec [MONO_INST_CLOB] == 's') && ins->dreg != ins->sreg1) {
+ MonoInst *copy = create_copy_ins (cfg, ins->dreg, ins->sreg1, NULL);
+ DEBUG (g_print ("\tneed to copy sreg1 %s to dreg %s\n", mono_arch_regname (ins->sreg1), mono_arch_regname (ins->dreg)));
+ if (ins->sreg2 == -1 || spec [MONO_INST_CLOB] == 's') {
+ /* note: the copy is inserted before the current instruction! */
+ insert_before_ins (ins, tmp, copy);
+ /* we set sreg1 to dest as well */
+ prev_sreg1 = ins->sreg1 = ins->dreg;
+ } else {
+ /* inserted after the operation */
+ copy->next = ins->next;
+ ins->next = copy;
+ }
+ }
+ /* track sreg2 */
+ if (spec [MONO_INST_SRC2] == 'f') {
+ if (reginfof [ins->sreg2].flags & MONO_X86_FP_NEEDS_LOAD) {
+ MonoInst *load;
+ MonoInst *store = NULL;
+
+ if (reginfof [ins->sreg2].flags & MONO_X86_FP_NEEDS_LOAD_SPILL) {
+ GList *spill_node;
+
+ spill_node = g_list_first (fspill_list);
+ g_assert (spill_node);
+ if (spec [MONO_INST_SRC1] == 'f' && (reginfof [ins->sreg1].flags & MONO_X86_FP_NEEDS_LOAD_SPILL))
+ spill_node = g_list_next (spill_node);
+
+ store = create_spilled_store_float (cfg, GPOINTER_TO_INT (spill_node->data), ins->sreg2, ins);
+ fspill_list = g_list_remove (fspill_list, spill_node->data);
+ }
+
+ fspill++;
+ fspill_list = g_list_prepend (fspill_list, GINT_TO_POINTER(fspill));
+ load = create_spilled_load_float (cfg, fspill, ins->sreg2, ins);
+ insert_before_ins (ins, tmp, load);
+ if (store)
+ insert_before_ins (load, tmp, store);
+ }
+ }
+ else if (ins->sreg2 >= MONO_MAX_IREGS) {
+ val = rs->iassign [ins->sreg2];
+ prev_sreg2 = ins->sreg2;
+ if (val < 0) {
+ int spill = 0;
+ if (val < -1) {
+ /* the register gets spilled after this inst */
+ spill = -val -1;
+ }
+ val = mono_x86_alloc_int_reg (cfg, tmp, ins, src2_mask, ins->sreg2, reginfo [ins->sreg2].flags);
+ rs->iassign [ins->sreg2] = val;
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d\n", mono_arch_regname (val), ins->sreg2));
+ if (spill)
+ create_spilled_store (cfg, spill, val, prev_sreg2, ins);
+ }
+ rs->isymbolic [val] = prev_sreg2;
+ ins->sreg2 = val;
+ if (spec [MONO_INST_CLOB] == 's' && ins->sreg2 != X86_ECX) {
+ DEBUG (g_print ("\tassigned sreg2 %s to R%d, but ECX is needed (R%d)\n", mono_arch_regname (val), ins->sreg2, rs->iassign [X86_ECX]));
+ }
+ } else {
+ prev_sreg2 = -1;
+ }
+
+ if (spec [MONO_INST_CLOB] == 'c') {
+ int j, s;
+ guint32 clob_mask = X86_CALLEE_REGS;
+ for (j = 0; j < MONO_MAX_IREGS; ++j) {
+ s = 1 << j;
+ if ((clob_mask & s) && !(rs->ifree_mask & s) && j != ins->sreg1) {
+ //g_warning ("register %s busy at call site\n", mono_arch_regname (j));
+ }
+ }
+ }
+ /*if (reg_is_freeable (ins->sreg1) && prev_sreg1 >= 0 && reginfo [prev_sreg1].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg1)));
+ mono_regstate_free_int (rs, ins->sreg1);
+ }
+ if (reg_is_freeable (ins->sreg2) && prev_sreg2 >= 0 && reginfo [prev_sreg2].born_in >= i) {
+ DEBUG (g_print ("freeable %s\n", mono_arch_regname (ins->sreg2)));
+ mono_regstate_free_int (rs, ins->sreg2);
+ }*/
+
+ //DEBUG (print_ins (i, ins));
+ /* this may result from a insert_before call */
+ if (!tmp->next)
+ bb->code = tmp->data;
+ tmp = tmp->next;
+ }
+
+ g_free (reginfo);
+ g_free (reginfof);
+ g_list_free (fspill_list);
+}
+
+static unsigned char*
+emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int size, gboolean is_signed)
+{
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 4);
+ x86_fnstcw_membase(code, X86_ESP, 0);
+ x86_mov_reg_membase (code, dreg, X86_ESP, 0, 2);
+ x86_alu_reg_imm (code, X86_OR, dreg, 0xc00);
+ x86_mov_membase_reg (code, X86_ESP, 2, dreg, 2);
+ x86_fldcw_membase (code, X86_ESP, 2);
+ if (size == 8) {
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 8);
+ x86_fist_pop_membase (code, X86_ESP, 0, TRUE);
+ x86_pop_reg (code, dreg);
+ /* FIXME: need the high register
+ * x86_pop_reg (code, dreg_high);
+ */
+ } else {
+ x86_push_reg (code, X86_EAX); // SP = SP - 4
+ x86_fist_pop_membase (code, X86_ESP, 0, FALSE);
+ x86_pop_reg (code, dreg);
+ }
+ x86_fldcw_membase (code, X86_ESP, 0);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
+
+ if (size == 1)
+ x86_widen_reg (code, dreg, dreg, is_signed, FALSE);
+ else if (size == 2)
+ x86_widen_reg (code, dreg, dreg, is_signed, TRUE);
+ return code;
+}
+
+static unsigned char*
+mono_emit_stack_alloc (guchar *code, MonoInst* tree)
+{
+ int sreg = tree->sreg1;
+#ifdef PLATFORM_WIN32
+ guint8* br[5];
+
+ /*
+ * Under Windows:
+ * If requested stack size is larger than one page,
+ * perform stack-touch operation
+ */
+ /*
+ * Generate stack probe code.
+ * Under Windows, it is necessary to allocate one page at a time,
+ * "touching" stack after each successful sub-allocation. This is
+ * because of the way stack growth is implemented - there is a
+ * guard page before the lowest stack page that is currently commited.
+ * Stack normally grows sequentially so OS traps access to the
+ * guard page and commits more pages when needed.
+ */
+ x86_test_reg_imm (code, sreg, ~0xFFF);
+ br[0] = code; x86_branch8 (code, X86_CC_Z, 0, FALSE);
+
+ br[2] = code; /* loop */
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 0x1000);
+ x86_test_membase_reg (code, X86_ESP, 0, X86_ESP);
+ x86_alu_reg_imm (code, X86_SUB, sreg, 0x1000);
+ x86_alu_reg_imm (code, X86_CMP, sreg, 0x1000);
+ br[3] = code; x86_branch8 (code, X86_CC_AE, 0, FALSE);
+ x86_patch (br[3], br[2]);
+ x86_test_reg_reg (code, sreg, sreg);
+ br[4] = code; x86_branch8 (code, X86_CC_Z, 0, FALSE);
+ x86_alu_reg_reg (code, X86_SUB, X86_ESP, sreg);
+
+ br[1] = code; x86_jump8 (code, 0);
+
+ x86_patch (br[0], code);
+ x86_alu_reg_reg (code, X86_SUB, X86_ESP, sreg);
+ x86_patch (br[1], code);
+ x86_patch (br[4], code);
+#else /* PLATFORM_WIN32 */
+ x86_alu_reg_reg (code, X86_SUB, X86_ESP, tree->sreg1);
+#endif
+ if (tree->flags & MONO_INST_INIT) {
+ int offset = 0;
+ if (tree->dreg != X86_EAX && sreg != X86_EAX) {
+ x86_push_reg (code, X86_EAX);
+ offset += 4;
+ }
+ if (tree->dreg != X86_ECX && sreg != X86_ECX) {
+ x86_push_reg (code, X86_ECX);
+ offset += 4;
+ }
+ if (tree->dreg != X86_EDI && sreg != X86_EDI) {
+ x86_push_reg (code, X86_EDI);
+ offset += 4;
+ }
+
+ x86_shift_reg_imm (code, X86_SHR, sreg, 2);
+ if (sreg != X86_ECX)
+ x86_mov_reg_reg (code, X86_ECX, sreg, 4);
+ x86_alu_reg_reg (code, X86_XOR, X86_EAX, X86_EAX);
+
+ x86_lea_membase (code, X86_EDI, X86_ESP, offset);
+ x86_cld (code);
+ x86_prefix (code, X86_REP_PREFIX);
+ x86_stosl (code);
+
+ if (tree->dreg != X86_EDI && sreg != X86_EDI)
+ x86_pop_reg (code, X86_EDI);
+ if (tree->dreg != X86_ECX && sreg != X86_ECX)
+ x86_pop_reg (code, X86_ECX);
+ if (tree->dreg != X86_EAX && sreg != X86_EAX)
+ x86_pop_reg (code, X86_EAX);
+ }
+ return code;
+}
+
+#define REAL_PRINT_REG(text,reg) \
+mono_assert (reg >= 0); \
+x86_push_reg (code, X86_EAX); \
+x86_push_reg (code, X86_EDX); \
+x86_push_reg (code, X86_ECX); \
+x86_push_reg (code, reg); \
+x86_push_imm (code, reg); \
+x86_push_imm (code, text " %d %p\n"); \
+x86_mov_reg_imm (code, X86_EAX, printf); \
+x86_call_reg (code, X86_EAX); \
+x86_alu_reg_imm (code, X86_ADD, X86_ESP, 3*4); \
+x86_pop_reg (code, X86_ECX); \
+x86_pop_reg (code, X86_EDX); \
+x86_pop_reg (code, X86_EAX);
+
+/* benchmark and set based on cpu */
+#define LOOP_ALIGNMENT 8
+#define bb_is_loop_start(bb) ((bb)->loop_body_start && (bb)->nesting)
+
+void
+mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
+{
+ MonoInst *ins;
+ MonoCallInst *call;
+ guint offset;
+ guint8 *code = cfg->native_code + cfg->code_len;
+ MonoInst *last_ins = NULL;
+ guint last_offset = 0;
+ int max_len, cpos;
+
+ if (cfg->opt & MONO_OPT_PEEPHOLE)
+ peephole_pass (cfg, bb);
+
+ if (cfg->opt & MONO_OPT_LOOP) {
+ int pad, align = LOOP_ALIGNMENT;
+ /* set alignment depending on cpu */
+ if (bb_is_loop_start (bb) && (pad = (cfg->code_len & (align - 1)))) {
+ pad = align - pad;
+ /*g_print ("adding %d pad at %x to loop in %s\n", pad, cfg->code_len, cfg->method->name);*/
+ x86_padding (code, pad);
+ cfg->code_len += pad;
+ bb->native_offset = cfg->code_len;
+ }
+ }
+
+ if (cfg->verbose_level > 2)
+ g_print ("Basic block %d starting at offset 0x%x\n", bb->block_num, bb->native_offset);
+
+ cpos = bb->max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE) {
+ MonoProfileCoverageInfo *cov = cfg->coverage_info;
+ g_assert (!mono_compile_aot);
+ cpos += 6;
+
+ cov->data [bb->dfn].cil_code = bb->cil_code;
+ /* this is not thread save, but good enough */
+ x86_inc_mem (code, &cov->data [bb->dfn].count);
+ }
+
+ offset = code - cfg->native_code;
+
+ ins = bb->code;
+ while (ins) {
+ offset = code - cfg->native_code;
+
+ max_len = ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+
+ if (offset > (cfg->code_size - max_len - 16)) {
+ cfg->code_size *= 2;
+ cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
+ code = cfg->native_code + offset;
+ mono_jit_stats.code_reallocs++;
+ }
+
+ mono_debug_record_line_number (cfg, ins, offset);
+
+ switch (ins->opcode) {
+ case OP_BIGMUL:
+ x86_mul_reg (code, ins->sreg2, TRUE);
+ break;
+ case OP_BIGMUL_UN:
+ x86_mul_reg (code, ins->sreg2, FALSE);
+ break;
+ case OP_X86_SETEQ_MEMBASE:
+ case OP_X86_SETNE_MEMBASE:
+ x86_set_membase (code, ins->opcode == OP_X86_SETEQ_MEMBASE ? X86_CC_EQ : X86_CC_NE,
+ ins->inst_basereg, ins->inst_offset, TRUE);
+ break;
+ case OP_STOREI1_MEMBASE_IMM:
+ x86_mov_membase_imm (code, ins->inst_destbasereg, ins->inst_offset, ins->inst_imm, 1);
+ break;
+ case OP_STOREI2_MEMBASE_IMM:
+ x86_mov_membase_imm (code, ins->inst_destbasereg, ins->inst_offset, ins->inst_imm, 2);
+ break;
+ case OP_STORE_MEMBASE_IMM:
+ case OP_STOREI4_MEMBASE_IMM:
+ x86_mov_membase_imm (code, ins->inst_destbasereg, ins->inst_offset, ins->inst_imm, 4);
+ break;
+ case OP_STOREI1_MEMBASE_REG:
+ x86_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1, 1);
+ break;
+ case OP_STOREI2_MEMBASE_REG:
+ x86_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1, 2);
+ break;
+ case OP_STORE_MEMBASE_REG:
+ case OP_STOREI4_MEMBASE_REG:
+ x86_mov_membase_reg (code, ins->inst_destbasereg, ins->inst_offset, ins->sreg1, 4);
+ break;
+ case CEE_LDIND_I:
+ case CEE_LDIND_I4:
+ case CEE_LDIND_U4:
+ x86_mov_reg_mem (code, ins->dreg, ins->inst_p0, 4);
+ break;
+ case OP_LOADU4_MEM:
+ x86_mov_reg_imm (code, ins->dreg, ins->inst_p0);
+ x86_mov_reg_membase (code, ins->dreg, ins->dreg, 0, 4);
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ case OP_LOADU4_MEMBASE:
+ x86_mov_reg_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, 4);
+ break;
+ case OP_LOADU1_MEMBASE:
+ x86_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, FALSE, FALSE);
+ break;
+ case OP_LOADI1_MEMBASE:
+ x86_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, TRUE, FALSE);
+ break;
+ case OP_LOADU2_MEMBASE:
+ x86_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, FALSE, TRUE);
+ break;
+ case OP_LOADI2_MEMBASE:
+ x86_widen_membase (code, ins->dreg, ins->inst_basereg, ins->inst_offset, TRUE, TRUE);
+ break;
+ case CEE_CONV_I1:
+ x86_widen_reg (code, ins->dreg, ins->sreg1, TRUE, FALSE);
+ break;
+ case CEE_CONV_I2:
+ x86_widen_reg (code, ins->dreg, ins->sreg1, TRUE, TRUE);
+ break;
+ case CEE_CONV_U1:
+ x86_widen_reg (code, ins->dreg, ins->sreg1, FALSE, FALSE);
+ break;
+ case CEE_CONV_U2:
+ x86_widen_reg (code, ins->dreg, ins->sreg1, FALSE, TRUE);
+ break;
+ case OP_COMPARE:
+ x86_alu_reg_reg (code, X86_CMP, ins->sreg1, ins->sreg2);
+ break;
+ case OP_COMPARE_IMM:
+ x86_alu_reg_imm (code, X86_CMP, ins->sreg1, ins->inst_imm);
+ break;
+ case OP_X86_COMPARE_MEMBASE_REG:
+ x86_alu_membase_reg (code, X86_CMP, ins->inst_basereg, ins->inst_offset, ins->sreg2);
+ break;
+ case OP_X86_COMPARE_MEMBASE_IMM:
+ x86_alu_membase_imm (code, X86_CMP, ins->inst_basereg, ins->inst_offset, ins->inst_imm);
+ break;
+ case OP_X86_COMPARE_MEMBASE8_IMM:
+ x86_alu_membase8_imm (code, X86_CMP, ins->inst_basereg, ins->inst_offset, ins->inst_imm);
+ break;
+ case OP_X86_COMPARE_REG_MEMBASE:
+ x86_alu_reg_membase (code, X86_CMP, ins->sreg1, ins->sreg2, ins->inst_offset);
+ break;
+ case OP_X86_TEST_NULL:
+ x86_test_reg_reg (code, ins->sreg1, ins->sreg1);
+ break;
+ case OP_X86_ADD_MEMBASE_IMM:
+ x86_alu_membase_imm (code, X86_ADD, ins->inst_basereg, ins->inst_offset, ins->inst_imm);
+ break;
+ case OP_X86_ADD_MEMBASE:
+ x86_alu_reg_membase (code, X86_ADD, ins->sreg1, ins->sreg2, ins->inst_offset);
+ break;
+ case OP_X86_SUB_MEMBASE_IMM:
+ x86_alu_membase_imm (code, X86_SUB, ins->inst_basereg, ins->inst_offset, ins->inst_imm);
+ break;
+ case OP_X86_SUB_MEMBASE:
+ x86_alu_reg_membase (code, X86_SUB, ins->sreg1, ins->sreg2, ins->inst_offset);
+ break;
+ case OP_X86_INC_MEMBASE:
+ x86_inc_membase (code, ins->inst_basereg, ins->inst_offset);
+ break;
+ case OP_X86_INC_REG:
+ x86_inc_reg (code, ins->dreg);
+ break;
+ case OP_X86_DEC_MEMBASE:
+ x86_dec_membase (code, ins->inst_basereg, ins->inst_offset);
+ break;
+ case OP_X86_DEC_REG:
+ x86_dec_reg (code, ins->dreg);
+ break;
+ case OP_X86_MUL_MEMBASE:
+ x86_imul_reg_membase (code, ins->sreg1, ins->sreg2, ins->inst_offset);
+ break;
+ case CEE_BREAK:
+ x86_breakpoint (code);
+ break;
+ case OP_ADDCC:
+ case CEE_ADD:
+ x86_alu_reg_reg (code, X86_ADD, ins->sreg1, ins->sreg2);
+ break;
+ case OP_ADC:
+ x86_alu_reg_reg (code, X86_ADC, ins->sreg1, ins->sreg2);
+ break;
+ case OP_ADDCC_IMM:
+ case OP_ADD_IMM:
+ x86_alu_reg_imm (code, X86_ADD, ins->dreg, ins->inst_imm);
+ break;
+ case OP_ADC_IMM:
+ x86_alu_reg_imm (code, X86_ADC, ins->dreg, ins->inst_imm);
+ break;
+ case OP_SUBCC:
+ case CEE_SUB:
+ x86_alu_reg_reg (code, X86_SUB, ins->sreg1, ins->sreg2);
+ break;
+ case OP_SBB:
+ x86_alu_reg_reg (code, X86_SBB, ins->sreg1, ins->sreg2);
+ break;
+ case OP_SUBCC_IMM:
+ case OP_SUB_IMM:
+ x86_alu_reg_imm (code, X86_SUB, ins->dreg, ins->inst_imm);
+ break;
+ case OP_SBB_IMM:
+ x86_alu_reg_imm (code, X86_SBB, ins->dreg, ins->inst_imm);
+ break;
+ case CEE_AND:
+ x86_alu_reg_reg (code, X86_AND, ins->sreg1, ins->sreg2);
+ break;
+ case OP_AND_IMM:
+ x86_alu_reg_imm (code, X86_AND, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_DIV:
+ x86_cdq (code);
+ x86_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_DIV_UN:
+ x86_alu_reg_reg (code, X86_XOR, X86_EDX, X86_EDX);
+ x86_div_reg (code, ins->sreg2, FALSE);
+ break;
+ case OP_DIV_IMM:
+ x86_mov_reg_imm (code, ins->sreg2, ins->inst_imm);
+ x86_cdq (code);
+ x86_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_REM:
+ x86_cdq (code);
+ x86_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_REM_UN:
+ x86_alu_reg_reg (code, X86_XOR, X86_EDX, X86_EDX);
+ x86_div_reg (code, ins->sreg2, FALSE);
+ break;
+ case OP_REM_IMM:
+ x86_mov_reg_imm (code, ins->sreg2, ins->inst_imm);
+ x86_cdq (code);
+ x86_div_reg (code, ins->sreg2, TRUE);
+ break;
+ case CEE_OR:
+ x86_alu_reg_reg (code, X86_OR, ins->sreg1, ins->sreg2);
+ break;
+ case OP_OR_IMM:
+ x86_alu_reg_imm (code, X86_OR, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_XOR:
+ x86_alu_reg_reg (code, X86_XOR, ins->sreg1, ins->sreg2);
+ break;
+ case OP_XOR_IMM:
+ x86_alu_reg_imm (code, X86_XOR, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_SHL:
+ g_assert (ins->sreg2 == X86_ECX);
+ x86_shift_reg (code, X86_SHL, ins->dreg);
+ break;
+ case CEE_SHR:
+ g_assert (ins->sreg2 == X86_ECX);
+ x86_shift_reg (code, X86_SAR, ins->dreg);
+ break;
+ case OP_SHR_IMM:
+ x86_shift_reg_imm (code, X86_SAR, ins->dreg, ins->inst_imm);
+ break;
+ case OP_SHR_UN_IMM:
+ x86_shift_reg_imm (code, X86_SHR, ins->dreg, ins->inst_imm);
+ break;
+ case CEE_SHR_UN:
+ g_assert (ins->sreg2 == X86_ECX);
+ x86_shift_reg (code, X86_SHR, ins->dreg);
+ break;
+ case OP_SHL_IMM:
+ x86_shift_reg_imm (code, X86_SHL, ins->dreg, ins->inst_imm);
+ break;
+ case OP_LSHL: {
+ guint8 *jump_to_end;
+
+ /* handle shifts below 32 bits */
+ x86_shld_reg (code, ins->unused, ins->sreg1);
+ x86_shift_reg (code, X86_SHL, ins->sreg1);
+
+ x86_test_reg_imm (code, X86_ECX, 32);
+ jump_to_end = code; x86_branch8 (code, X86_CC_EQ, 0, TRUE);
+
+ /* handle shift over 32 bit */
+ x86_mov_reg_reg (code, ins->unused, ins->sreg1, 4);
+ x86_clear_reg (code, ins->sreg1);
+
+ x86_patch (jump_to_end, code);
+ }
+ break;
+ case OP_LSHR: {
+ guint8 *jump_to_end;
+
+ /* handle shifts below 32 bits */
+ x86_shrd_reg (code, ins->sreg1, ins->unused);
+ x86_shift_reg (code, X86_SAR, ins->unused);
+
+ x86_test_reg_imm (code, X86_ECX, 32);
+ jump_to_end = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
+
+ /* handle shifts over 31 bits */
+ x86_mov_reg_reg (code, ins->sreg1, ins->unused, 4);
+ x86_shift_reg_imm (code, X86_SAR, ins->unused, 31);
+
+ x86_patch (jump_to_end, code);
+ }
+ break;
+ case OP_LSHR_UN: {
+ guint8 *jump_to_end;
+
+ /* handle shifts below 32 bits */
+ x86_shrd_reg (code, ins->sreg1, ins->unused);
+ x86_shift_reg (code, X86_SHR, ins->unused);
+
+ x86_test_reg_imm (code, X86_ECX, 32);
+ jump_to_end = code; x86_branch8 (code, X86_CC_EQ, 0, FALSE);
+
+ /* handle shifts over 31 bits */
+ x86_mov_reg_reg (code, ins->sreg1, ins->unused, 4);
+ x86_shift_reg_imm (code, X86_SHR, ins->unused, 31);
+
+ x86_patch (jump_to_end, code);
+ }
+ break;
+ case OP_LSHL_IMM:
+ if (ins->inst_imm >= 32) {
+ x86_mov_reg_reg (code, ins->unused, ins->sreg1, 4);
+ x86_clear_reg (code, ins->sreg1);
+ x86_shift_reg_imm (code, X86_SHL, ins->unused, ins->inst_imm - 32);
+ } else {
+ x86_shld_reg_imm (code, ins->unused, ins->sreg1, ins->inst_imm);
+ x86_shift_reg_imm (code, X86_SHL, ins->sreg1, ins->inst_imm);
+ }
+ break;
+ case OP_LSHR_IMM:
+ if (ins->inst_imm >= 32) {
+ x86_mov_reg_reg (code, ins->sreg1, ins->unused, 4);
+ x86_shift_reg_imm (code, X86_SAR, ins->unused, 0x1f);
+ x86_shift_reg_imm (code, X86_SAR, ins->sreg1, ins->inst_imm - 32);
+ } else {
+ x86_shrd_reg_imm (code, ins->sreg1, ins->unused, ins->inst_imm);
+ x86_shift_reg_imm (code, X86_SAR, ins->unused, ins->inst_imm);
+ }
+ break;
+ case OP_LSHR_UN_IMM:
+ if (ins->inst_imm >= 32) {
+ x86_mov_reg_reg (code, ins->sreg1, ins->unused, 4);
+ x86_clear_reg (code, ins->unused);
+ x86_shift_reg_imm (code, X86_SHR, ins->sreg1, ins->inst_imm - 32);
+ } else {
+ x86_shrd_reg_imm (code, ins->sreg1, ins->unused, ins->inst_imm);
+ x86_shift_reg_imm (code, X86_SHR, ins->unused, ins->inst_imm);
+ }
+ break;
+ case CEE_NOT:
+ x86_not_reg (code, ins->sreg1);
+ break;
+ case CEE_NEG:
+ x86_neg_reg (code, ins->sreg1);
+ break;
+ case OP_SEXT_I1:
+ x86_widen_reg (code, ins->dreg, ins->sreg1, TRUE, FALSE);
+ break;
+ case OP_SEXT_I2:
+ x86_widen_reg (code, ins->dreg, ins->sreg1, TRUE, TRUE);
+ break;
+ case CEE_MUL:
+ x86_imul_reg_reg (code, ins->sreg1, ins->sreg2);
+ break;
+ case OP_MUL_IMM:
+ x86_imul_reg_reg_imm (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ break;
+ case CEE_MUL_OVF:
+ x86_imul_reg_reg (code, ins->sreg1, ins->sreg2);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_O, FALSE, "OverflowException");
+ break;
+ case CEE_MUL_OVF_UN: {
+ /* the mul operation and the exception check should most likely be split */
+ int non_eax_reg, saved_eax = FALSE, saved_edx = FALSE;
+ /*g_assert (ins->sreg2 == X86_EAX);
+ g_assert (ins->dreg == X86_EAX);*/
+ if (ins->sreg2 == X86_EAX) {
+ non_eax_reg = ins->sreg1;
+ } else if (ins->sreg1 == X86_EAX) {
+ non_eax_reg = ins->sreg2;
+ } else {
+ /* no need to save since we're going to store to it anyway */
+ if (ins->dreg != X86_EAX) {
+ saved_eax = TRUE;
+ x86_push_reg (code, X86_EAX);
+ }
+ x86_mov_reg_reg (code, X86_EAX, ins->sreg1, 4);
+ non_eax_reg = ins->sreg2;
+ }
+ if (ins->dreg == X86_EDX) {
+ if (!saved_eax) {
+ saved_eax = TRUE;
+ x86_push_reg (code, X86_EAX);
+ }
+ } else if (ins->dreg != X86_EAX) {
+ saved_edx = TRUE;
+ x86_push_reg (code, X86_EDX);
+ }
+ x86_mul_reg (code, non_eax_reg, FALSE);
+ /* save before the check since pop and mov don't change the flags */
+ if (ins->dreg != X86_EAX)
+ x86_mov_reg_reg (code, ins->dreg, X86_EAX, 4);
+ if (saved_edx)
+ x86_pop_reg (code, X86_EDX);
+ if (saved_eax)
+ x86_pop_reg (code, X86_EAX);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_O, FALSE, "OverflowException");
+ break;
+ }
+ case OP_ICONST:
+ x86_mov_reg_imm (code, ins->dreg, ins->inst_c0);
+ break;
+ case OP_AOTCONST:
+ mono_add_patch_info (cfg, offset, (MonoJumpInfoType)ins->inst_i1, ins->inst_p0);
+ x86_mov_reg_imm (code, ins->dreg, 0);
+ break;
+ case CEE_CONV_I4:
+ case OP_MOVE:
+ x86_mov_reg_reg (code, ins->dreg, ins->sreg1, 4);
+ break;
+ case CEE_CONV_U4:
+ g_assert_not_reached ();
+ case CEE_JMP: {
+ /*
+ * Note: this 'frame destruction' logic is useful for tail calls, too.
+ * Keep in sync with the code in emit_epilog.
+ */
+ int pos = 0;
+
+ /* FIXME: no tracing support... */
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ code = mono_arch_instrument_epilog (cfg, mono_profiler_method_leave, code, FALSE);
+ /* reset offset to make max_len work */
+ offset = code - cfg->native_code;
+
+ g_assert (!cfg->method->save_lmf);
+
+ if (cfg->used_int_regs & (1 << X86_EBX))
+ pos -= 4;
+ if (cfg->used_int_regs & (1 << X86_EDI))
+ pos -= 4;
+ if (cfg->used_int_regs & (1 << X86_ESI))
+ pos -= 4;
+ if (pos)
+ x86_lea_membase (code, X86_ESP, X86_EBP, pos);
+
+ if (cfg->used_int_regs & (1 << X86_ESI))
+ x86_pop_reg (code, X86_ESI);
+ if (cfg->used_int_regs & (1 << X86_EDI))
+ x86_pop_reg (code, X86_EDI);
+ if (cfg->used_int_regs & (1 << X86_EBX))
+ x86_pop_reg (code, X86_EBX);
+
+ /* restore ESP/EBP */
+ x86_leave (code);
+ offset = code - cfg->native_code;
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_METHOD_JUMP, ins->inst_p0);
+ x86_jump32 (code, 0);
+ break;
+ }
+ case OP_CHECK_THIS:
+ /* ensure ins->sreg1 is not NULL
+ * note that cmp DWORD PTR [eax], eax is one byte shorter than
+ * cmp DWORD PTR [eax], 0
+ */
+ x86_alu_membase_reg (code, X86_CMP, ins->sreg1, 0, ins->sreg1);
+ break;
+ case OP_ARGLIST: {
+ int hreg = ins->sreg1 == X86_EAX? X86_ECX: X86_EAX;
+ x86_push_reg (code, hreg);
+ x86_lea_membase (code, hreg, X86_EBP, cfg->sig_cookie);
+ x86_mov_membase_reg (code, ins->sreg1, 0, hreg, 4);
+ x86_pop_reg (code, hreg);
+ break;
+ }
+ case OP_FCALL:
+ case OP_LCALL:
+ case OP_VCALL:
+ case OP_VOIDCALL:
+ case CEE_CALL:
+ call = (MonoCallInst*)ins;
+ if (ins->flags & MONO_INST_HAS_METHOD)
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_METHOD, call->method);
+ else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS, call->fptr);
+ }
+ x86_call_code (code, 0);
+ if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention))
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, call->stack_usage);
+ break;
+ case OP_FCALL_REG:
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ case OP_CALL_REG:
+ call = (MonoCallInst*)ins;
+ x86_call_reg (code, ins->sreg1);
+ if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention))
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, call->stack_usage);
+ break;
+ case OP_FCALL_MEMBASE:
+ case OP_LCALL_MEMBASE:
+ case OP_VCALL_MEMBASE:
+ case OP_VOIDCALL_MEMBASE:
+ case OP_CALL_MEMBASE:
+ call = (MonoCallInst*)ins;
+ x86_call_membase (code, ins->sreg1, ins->inst_offset);
+ if (call->stack_usage && !CALLCONV_IS_STDCALL (call->signature->call_convention))
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, call->stack_usage);
+ break;
+ case OP_OUTARG:
+ case OP_X86_PUSH:
+ x86_push_reg (code, ins->sreg1);
+ break;
+ case OP_X86_PUSH_IMM:
+ x86_push_imm (code, ins->inst_imm);
+ break;
+ case OP_X86_PUSH_MEMBASE:
+ x86_push_membase (code, ins->inst_basereg, ins->inst_offset);
+ break;
+ case OP_X86_PUSH_OBJ:
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, ins->inst_imm);
+ x86_push_reg (code, X86_EDI);
+ x86_push_reg (code, X86_ESI);
+ x86_push_reg (code, X86_ECX);
+ if (ins->inst_offset)
+ x86_lea_membase (code, X86_ESI, ins->inst_basereg, ins->inst_offset);
+ else
+ x86_mov_reg_reg (code, X86_ESI, ins->inst_basereg, 4);
+ x86_lea_membase (code, X86_EDI, X86_ESP, 12);
+ x86_mov_reg_imm (code, X86_ECX, (ins->inst_imm >> 2));
+ x86_cld (code);
+ x86_prefix (code, X86_REP_PREFIX);
+ x86_movsd (code);
+ x86_pop_reg (code, X86_ECX);
+ x86_pop_reg (code, X86_ESI);
+ x86_pop_reg (code, X86_EDI);
+ break;
+ case OP_X86_LEA:
+ x86_lea_memindex (code, ins->dreg, ins->sreg1, ins->inst_imm, ins->sreg2, ins->unused);
+ break;
+ case OP_X86_LEA_MEMBASE:
+ x86_lea_membase (code, ins->dreg, ins->sreg1, ins->inst_imm);
+ break;
+ case OP_X86_XCHG:
+ x86_xchg_reg_reg (code, ins->sreg1, ins->sreg2, 4);
+ break;
+ case OP_LOCALLOC:
+ /* keep alignment */
+ x86_alu_reg_imm (code, X86_ADD, ins->sreg1, MONO_ARCH_FRAME_ALIGNMENT - 1);
+ x86_alu_reg_imm (code, X86_AND, ins->sreg1, ~(MONO_ARCH_FRAME_ALIGNMENT - 1));
+ code = mono_emit_stack_alloc (code, ins);
+ x86_mov_reg_reg (code, ins->dreg, X86_ESP, 4);
+ break;
+ case CEE_RET:
+ x86_ret (code);
+ break;
+ case CEE_THROW: {
+ x86_push_reg (code, ins->sreg1);
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_throw_exception");
+ x86_call_code (code, 0);
+ break;
+ }
+ case OP_RETHROW: {
+ x86_push_reg (code, ins->sreg1);
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_arch_rethrow_exception");
+ x86_call_code (code, 0);
+ break;
+ }
+ case OP_CALL_HANDLER:
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ x86_call_imm (code, 0);
+ break;
+ case OP_LABEL:
+ ins->inst_c0 = code - cfg->native_code;
+ break;
+ case CEE_BR:
+ //g_print ("target: %p, next: %p, curr: %p, last: %p\n", ins->inst_target_bb, bb->next_bb, ins, bb->last_ins);
+ //if ((ins->inst_target_bb == bb->next_bb) && ins == bb->last_ins)
+ //break;
+ if (ins->flags & MONO_INST_BRLABEL) {
+ if (ins->inst_i0->inst_c0) {
+ x86_jump_code (code, cfg->native_code + ins->inst_i0->inst_c0);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_LABEL, ins->inst_i0);
+ if ((cfg->opt & MONO_OPT_BRANCH) &&
+ x86_is_imm8 (ins->inst_i0->inst_c1 - cpos))
+ x86_jump8 (code, 0);
+ else
+ x86_jump32 (code, 0);
+ }
+ } else {
+ if (ins->inst_target_bb->native_offset) {
+ x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb);
+ if ((cfg->opt & MONO_OPT_BRANCH) &&
+ x86_is_imm8 (ins->inst_target_bb->max_offset - cpos))
+ x86_jump8 (code, 0);
+ else
+ x86_jump32 (code, 0);
+ }
+ }
+ break;
+ case OP_BR_REG:
+ x86_jump_reg (code, ins->sreg1);
+ break;
+ case OP_CEQ:
+ x86_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CLT:
+ x86_set_reg (code, X86_CC_LT, ins->dreg, TRUE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CLT_UN:
+ x86_set_reg (code, X86_CC_LT, ins->dreg, FALSE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CGT:
+ x86_set_reg (code, X86_CC_GT, ins->dreg, TRUE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CGT_UN:
+ x86_set_reg (code, X86_CC_GT, ins->dreg, FALSE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_CNE:
+ x86_set_reg (code, X86_CC_NE, ins->dreg, TRUE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+ break;
+ case OP_COND_EXC_EQ:
+ case OP_COND_EXC_NE_UN:
+ case OP_COND_EXC_LT:
+ case OP_COND_EXC_LT_UN:
+ case OP_COND_EXC_GT:
+ case OP_COND_EXC_GT_UN:
+ case OP_COND_EXC_GE:
+ case OP_COND_EXC_GE_UN:
+ case OP_COND_EXC_LE:
+ case OP_COND_EXC_LE_UN:
+ case OP_COND_EXC_OV:
+ case OP_COND_EXC_NO:
+ case OP_COND_EXC_C:
+ case OP_COND_EXC_NC:
+ EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_EQ],
+ (ins->opcode < OP_COND_EXC_NE_UN), ins->inst_p1);
+ break;
+ case CEE_BEQ:
+ case CEE_BNE_UN:
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ EMIT_COND_BRANCH (ins, branch_cc_table [ins->opcode - CEE_BEQ], (ins->opcode < CEE_BNE_UN));
+ break;
+
+ /* floating point opcodes */
+ case OP_R8CONST: {
+ double d = *(double *)ins->inst_p0;
+
+ if ((d == 0.0) && (mono_signbit (d) == 0)) {
+ x86_fldz (code);
+ } else if (d == 1.0) {
+ x86_fld1 (code);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R8, ins->inst_p0);
+ x86_fld (code, NULL, TRUE);
+ }
+ break;
+ }
+ case OP_R4CONST: {
+ float f = *(float *)ins->inst_p0;
+
+ if ((f == 0.0) && (mono_signbit (f) == 0)) {
+ x86_fldz (code);
+ } else if (f == 1.0) {
+ x86_fld1 (code);
+ } else {
+ mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R4, ins->inst_p0);
+ x86_fld (code, NULL, FALSE);
+ }
+ break;
+ }
+ case OP_STORER8_MEMBASE_REG:
+ x86_fst_membase (code, ins->inst_destbasereg, ins->inst_offset, TRUE, TRUE);
+ break;
+ case OP_LOADR8_SPILL_MEMBASE:
+ x86_fld_membase (code, ins->inst_basereg, ins->inst_offset, TRUE);
+ x86_fxch (code, 1);
+ break;
+ case OP_LOADR8_MEMBASE:
+ x86_fld_membase (code, ins->inst_basereg, ins->inst_offset, TRUE);
+ break;
+ case OP_STORER4_MEMBASE_REG:
+ x86_fst_membase (code, ins->inst_destbasereg, ins->inst_offset, FALSE, TRUE);
+ break;
+ case OP_LOADR4_MEMBASE:
+ x86_fld_membase (code, ins->inst_basereg, ins->inst_offset, FALSE);
+ break;
+ case CEE_CONV_R4: /* FIXME: change precision */
+ case CEE_CONV_R8:
+ x86_push_reg (code, ins->sreg1);
+ x86_fild_membase (code, X86_ESP, 0, FALSE);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
+ break;
+ case OP_X86_FP_LOAD_I8:
+ x86_fild_membase (code, ins->inst_basereg, ins->inst_offset, TRUE);
+ break;
+ case OP_X86_FP_LOAD_I4:
+ x86_fild_membase (code, ins->inst_basereg, ins->inst_offset, FALSE);
+ break;
+ case OP_FCONV_TO_I1:
+ code = emit_float_to_int (cfg, code, ins->dreg, 1, TRUE);
+ break;
+ case OP_FCONV_TO_U1:
+ code = emit_float_to_int (cfg, code, ins->dreg, 1, FALSE);
+ break;
+ case OP_FCONV_TO_I2:
+ code = emit_float_to_int (cfg, code, ins->dreg, 2, TRUE);
+ break;
+ case OP_FCONV_TO_U2:
+ code = emit_float_to_int (cfg, code, ins->dreg, 2, FALSE);
+ break;
+ case OP_FCONV_TO_I4:
+ case OP_FCONV_TO_I:
+ code = emit_float_to_int (cfg, code, ins->dreg, 4, TRUE);
+ break;
+ case OP_FCONV_TO_I8:
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 4);
+ x86_fnstcw_membase(code, X86_ESP, 0);
+ x86_mov_reg_membase (code, ins->dreg, X86_ESP, 0, 2);
+ x86_alu_reg_imm (code, X86_OR, ins->dreg, 0xc00);
+ x86_mov_membase_reg (code, X86_ESP, 2, ins->dreg, 2);
+ x86_fldcw_membase (code, X86_ESP, 2);
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 8);
+ x86_fist_pop_membase (code, X86_ESP, 0, TRUE);
+ x86_pop_reg (code, ins->dreg);
+ x86_pop_reg (code, ins->unused);
+ x86_fldcw_membase (code, X86_ESP, 0);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4);
+ break;
+ case OP_LCONV_TO_R_UN: {
+ static guint8 mn[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x40 };
+ guint8 *br;
+
+ /* load 64bit integer to FP stack */
+ x86_push_imm (code, 0);
+ x86_push_reg (code, ins->sreg2);
+ x86_push_reg (code, ins->sreg1);
+ x86_fild_membase (code, X86_ESP, 0, TRUE);
+ /* store as 80bit FP value */
+ x86_fst80_membase (code, X86_ESP, 0);
+
+ /* test if lreg is negative */
+ x86_test_reg_reg (code, ins->sreg2, ins->sreg2);
+ br = code; x86_branch8 (code, X86_CC_GEZ, 0, TRUE);
+
+ /* add correction constant mn */
+ x86_fld80_mem (code, mn);
+ x86_fld80_membase (code, X86_ESP, 0);
+ x86_fp_op_reg (code, X86_FADD, 1, TRUE);
+ x86_fst80_membase (code, X86_ESP, 0);
+
+ x86_patch (br, code);
+
+ x86_fld80_membase (code, X86_ESP, 0);
+ x86_alu_reg_imm (code, X86_ADD, X86_ESP, 12);
+
+ break;
+ }
+ case OP_LCONV_TO_OVF_I: {
+ guint8 *br [3], *label [1];
+
+ /*
+ * Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000
+ */
+ x86_test_reg_reg (code, ins->sreg1, ins->sreg1);
+
+ /* If the low word top bit is set, see if we are negative */
+ br [0] = code; x86_branch8 (code, X86_CC_LT, 0, TRUE);
+ /* We are not negative (no top bit set, check for our top word to be zero */
+ x86_test_reg_reg (code, ins->sreg2, ins->sreg2);
+ br [1] = code; x86_branch8 (code, X86_CC_EQ, 0, TRUE);
+ label [0] = code;
+
+ /* throw exception */
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC, "OverflowException");
+ x86_jump32 (code, 0);
+
+ x86_patch (br [0], code);
+ /* our top bit is set, check that top word is 0xfffffff */
+ x86_alu_reg_imm (code, X86_CMP, ins->sreg2, 0xffffffff);
+
+ x86_patch (br [1], code);
+ /* nope, emit exception */
+ br [2] = code; x86_branch8 (code, X86_CC_NE, 0, TRUE);
+ x86_patch (br [2], label [0]);
+
+ if (ins->dreg != ins->sreg1)
+ x86_mov_reg_reg (code, ins->dreg, ins->sreg1, 4);
+ break;
+ }
+ case OP_FADD:
+ x86_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_FSUB:
+ x86_fp_op_reg (code, X86_FSUB, 1, TRUE);
+ break;
+ case OP_FMUL:
+ x86_fp_op_reg (code, X86_FMUL, 1, TRUE);
+ break;
+ case OP_FDIV:
+ x86_fp_op_reg (code, X86_FDIV, 1, TRUE);
+ break;
+ case OP_FNEG:
+ x86_fchs (code);
+ break;
+ case OP_SIN:
+ x86_fsin (code);
+ x86_fldz (code);
+ x86_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_COS:
+ x86_fcos (code);
+ x86_fldz (code);
+ x86_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_ABS:
+ x86_fabs (code);
+ break;
+ case OP_TAN: {
+ /*
+ * it really doesn't make sense to inline all this code,
+ * it's here just to show that things may not be as simple
+ * as they appear.
+ */
+ guchar *check_pos, *end_tan, *pop_jump;
+ x86_push_reg (code, X86_EAX);
+ x86_fptan (code);
+ x86_fnstsw (code);
+ x86_test_reg_imm (code, X86_EAX, X86_FP_C2);
+ check_pos = code;
+ x86_branch8 (code, X86_CC_NE, 0, FALSE);
+ x86_fstp (code, 0); /* pop the 1.0 */
+ end_tan = code;
+ x86_jump8 (code, 0);
+ x86_fldpi (code);
+ x86_fp_op (code, X86_FADD, 0);
+ x86_fxch (code, 1);
+ x86_fprem1 (code);
+ x86_fstsw (code);
+ x86_test_reg_imm (code, X86_EAX, X86_FP_C2);
+ pop_jump = code;
+ x86_branch8 (code, X86_CC_NE, 0, FALSE);
+ x86_fstp (code, 1);
+ x86_fptan (code);
+ x86_patch (pop_jump, code);
+ x86_fstp (code, 0); /* pop the 1.0 */
+ x86_patch (check_pos, code);
+ x86_patch (end_tan, code);
+ x86_fldz (code);
+ x86_fp_op_reg (code, X86_FADD, 1, TRUE);
+ x86_pop_reg (code, X86_EAX);
+ break;
+ }
+ case OP_ATAN:
+ x86_fld1 (code);
+ x86_fpatan (code);
+ x86_fldz (code);
+ x86_fp_op_reg (code, X86_FADD, 1, TRUE);
+ break;
+ case OP_SQRT:
+ x86_fsqrt (code);
+ break;
+ case OP_X86_FPOP:
+ x86_fstp (code, 0);
+ break;
+ case OP_FREM: {
+ guint8 *l1, *l2;
+
+ x86_push_reg (code, X86_EAX);
+ /* we need to exchange ST(0) with ST(1) */
+ x86_fxch (code, 1);
+
+ /* this requires a loop, because fprem somtimes
+ * returns a partial remainder */
+ l1 = code;
+ /* looks like MS is using fprem instead of the IEEE compatible fprem1 */
+ /* x86_fprem1 (code); */
+ x86_fprem (code);
+ x86_fnstsw (code);
+ x86_alu_reg_imm (code, X86_AND, X86_EAX, X86_FP_C2);
+ l2 = code + 2;
+ x86_branch8 (code, X86_CC_NE, l1 - l2, FALSE);
+
+ /* pop result */
+ x86_fstp (code, 1);
+
+ x86_pop_reg (code, X86_EAX);
+ break;
+ }
+ case OP_FCOMPARE:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ x86_fcomip (code, 1);
+ x86_fstp (code, 0);
+ break;
+ }
+ /* this overwrites EAX */
+ EMIT_FPCOMPARE(code);
+ x86_alu_reg_imm (code, X86_AND, X86_EAX, X86_FP_CC_MASK);
+ break;
+ case OP_FCEQ:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ /* zeroing the register at the start results in
+ * shorter and faster code (we can also remove the widening op)
+ */
+ guchar *unordered_check;
+ x86_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg);
+ x86_fcomip (code, 1);
+ x86_fstp (code, 0);
+ unordered_check = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ x86_set_reg (code, X86_CC_EQ, ins->dreg, FALSE);
+ x86_patch (unordered_check, code);
+ break;
+ }
+ if (ins->dreg != X86_EAX)
+ x86_push_reg (code, X86_EAX);
+
+ EMIT_FPCOMPARE(code);
+ x86_alu_reg_imm (code, X86_AND, X86_EAX, X86_FP_CC_MASK);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, 0x4000);
+ x86_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+
+ if (ins->dreg != X86_EAX)
+ x86_pop_reg (code, X86_EAX);
+ break;
+ case OP_FCLT:
+ case OP_FCLT_UN:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ /* zeroing the register at the start results in
+ * shorter and faster code (we can also remove the widening op)
+ */
+ x86_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg);
+ x86_fcomip (code, 1);
+ x86_fstp (code, 0);
+ if (ins->opcode == OP_FCLT_UN) {
+ guchar *unordered_check = code;
+ guchar *jump_to_end;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ x86_set_reg (code, X86_CC_GT, ins->dreg, FALSE);
+ jump_to_end = code;
+ x86_jump8 (code, 0);
+ x86_patch (unordered_check, code);
+ x86_inc_reg (code, ins->dreg);
+ x86_patch (jump_to_end, code);
+ } else {
+ x86_set_reg (code, X86_CC_GT, ins->dreg, FALSE);
+ }
+ break;
+ }
+ if (ins->dreg != X86_EAX)
+ x86_push_reg (code, X86_EAX);
+
+ EMIT_FPCOMPARE(code);
+ x86_alu_reg_imm (code, X86_AND, X86_EAX, X86_FP_CC_MASK);
+ if (ins->opcode == OP_FCLT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ x86_patch (is_not_zero_check, code);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_CC_MASK);
+
+ x86_patch (end_jump, code);
+ }
+ x86_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+
+ if (ins->dreg != X86_EAX)
+ x86_pop_reg (code, X86_EAX);
+ break;
+ case OP_FCGT:
+ case OP_FCGT_UN:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ /* zeroing the register at the start results in
+ * shorter and faster code (we can also remove the widening op)
+ */
+ guchar *unordered_check;
+ x86_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg);
+ x86_fcomip (code, 1);
+ x86_fstp (code, 0);
+ if (ins->opcode == OP_FCGT) {
+ unordered_check = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ x86_set_reg (code, X86_CC_LT, ins->dreg, FALSE);
+ x86_patch (unordered_check, code);
+ } else {
+ x86_set_reg (code, X86_CC_LT, ins->dreg, FALSE);
+ }
+ break;
+ }
+ if (ins->dreg != X86_EAX)
+ x86_push_reg (code, X86_EAX);
+
+ EMIT_FPCOMPARE(code);
+ x86_alu_reg_imm (code, X86_AND, X86_EAX, X86_FP_CC_MASK);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_C0);
+ if (ins->opcode == OP_FCGT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ x86_patch (is_not_zero_check, code);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_CC_MASK);
+
+ x86_patch (end_jump, code);
+ }
+ x86_set_reg (code, X86_CC_EQ, ins->dreg, TRUE);
+ x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE);
+
+ if (ins->dreg != X86_EAX)
+ x86_pop_reg (code, X86_EAX);
+ break;
+ case OP_FBEQ:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ guchar *jump = code;
+ x86_branch8 (code, X86_CC_P, 0, TRUE);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ x86_patch (jump, code);
+ break;
+ }
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, 0x4000);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, TRUE);
+ break;
+ case OP_FBNE_UN:
+ /* Branch if C013 != 100 */
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ /* branch if !ZF or (PF|CF) */
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_P, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_B, FALSE);
+ break;
+ }
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_C3);
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ break;
+ case OP_FBLT:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ EMIT_COND_BRANCH (ins, X86_CC_GT, FALSE);
+ break;
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBLT_UN:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ EMIT_COND_BRANCH (ins, X86_CC_P, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_GT, FALSE);
+ break;
+ }
+ if (ins->opcode == OP_FBLT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ x86_patch (is_not_zero_check, code);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_CC_MASK);
+
+ x86_patch (end_jump, code);
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBGT:
+ case OP_FBGT_UN:
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ EMIT_COND_BRANCH (ins, X86_CC_LT, FALSE);
+ break;
+ }
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_C0);
+ if (ins->opcode == OP_FBGT_UN) {
+ guchar *is_not_zero_check, *end_jump;
+ is_not_zero_check = code;
+ x86_branch8 (code, X86_CC_NZ, 0, TRUE);
+ end_jump = code;
+ x86_jump8 (code, 0);
+ x86_patch (is_not_zero_check, code);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_CC_MASK);
+
+ x86_patch (end_jump, code);
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBGE:
+ /* Branch if C013 == 100 or 001 */
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ guchar *br1;
+
+ /* skip branch if C1=1 */
+ br1 = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ /* branch if (C0 | C3) = 1 */
+ EMIT_COND_BRANCH (ins, X86_CC_BE, FALSE);
+ x86_patch (br1, code);
+ break;
+ }
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_C0);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_C3);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBGE_UN:
+ /* Branch if C013 == 000 */
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ EMIT_COND_BRANCH (ins, X86_CC_LE, FALSE);
+ break;
+ }
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ break;
+ case OP_FBLE:
+ /* Branch if C013=000 or 100 */
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ guchar *br1;
+
+ /* skip branch if C1=1 */
+ br1 = code;
+ x86_branch8 (code, X86_CC_P, 0, FALSE);
+ /* branch if C0=0 */
+ EMIT_COND_BRANCH (ins, X86_CC_NB, FALSE);
+ x86_patch (br1, code);
+ break;
+ }
+ x86_alu_reg_imm (code, X86_AND, X86_EAX, (X86_FP_C0|X86_FP_C1));
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, 0);
+ EMIT_COND_BRANCH (ins, X86_CC_EQ, FALSE);
+ break;
+ case OP_FBLE_UN:
+ /* Branch if C013 != 001 */
+ if (cfg->opt & MONO_OPT_FCMOV) {
+ EMIT_COND_BRANCH (ins, X86_CC_P, FALSE);
+ EMIT_COND_BRANCH (ins, X86_CC_GE, FALSE);
+ break;
+ }
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_C0);
+ EMIT_COND_BRANCH (ins, X86_CC_NE, FALSE);
+ break;
+ case CEE_CKFINITE: {
+ x86_push_reg (code, X86_EAX);
+ x86_fxam (code);
+ x86_fnstsw (code);
+ x86_alu_reg_imm (code, X86_AND, X86_EAX, 0x4100);
+ x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_C0);
+ x86_pop_reg (code, X86_EAX);
+ EMIT_COND_SYSTEM_EXCEPTION (X86_CC_EQ, FALSE, "ArithmeticException");
+ break;
+ }
+
+ case OP_X86_TLS_GET: {
+ x86_prefix (code, X86_GS_PREFIX);
+ x86_mov_reg_mem (code, ins->dreg, ins->inst_offset, 4);
+ break;
+ }
+ default:
+ g_warning ("unknown opcode %s in %s()\n", mono_inst_name (ins->opcode), __FUNCTION__);
+ g_assert_not_reached ();
+ }
+
+ if ((code - cfg->native_code - offset) > max_len) {
+ g_warning ("wrong maximal instruction length of instruction %s (expected %d, got %d)",
+ mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset);
+ g_assert_not_reached ();
+ }
+
+ cpos += max_len;
+
+ last_ins = ins;
+ last_offset = offset;
+
+ ins = ins->next;
+ }
+
+ cfg->code_len = code - cfg->native_code;
+}
+
+void
+mono_arch_register_lowlevel_calls (void)
+{
+}
+
+void
+mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
+{
+ MonoJumpInfo *patch_info;
+
+ for (patch_info = ji; patch_info; patch_info = patch_info->next) {
+ unsigned char *ip = patch_info->ip.i + code;
+ const unsigned char *target;
+
+ target = mono_resolve_patch_target (method, domain, code, patch_info, run_cctors);
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_IP:
+ *((gconstpointer *)(ip)) = target;
+ continue;
+ case MONO_PATCH_INFO_METHOD_REL:
+ *((gconstpointer *)(ip)) = target;
+ continue;
+ case MONO_PATCH_INFO_SWITCH: {
+ *((gconstpointer *)(ip + 2)) = target;
+ /* we put into the table the absolute address, no need for x86_patch in this case */
+ continue;
+ }
+ case MONO_PATCH_INFO_IID:
+ *((guint32 *)(ip + 1)) = (guint32)target;
+ continue;
+ case MONO_PATCH_INFO_CLASS_INIT: {
+ guint8 *code = ip;
+ /* Might already been changed to a nop */
+ x86_call_code (code, 0);
+ break;
+ }
+ case MONO_PATCH_INFO_R4:
+ case MONO_PATCH_INFO_R8:
+ *((gconstpointer *)(ip + 2)) = target;
+ continue;
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IMAGE:
+ case MONO_PATCH_INFO_FIELD:
+ case MONO_PATCH_INFO_VTABLE:
+ case MONO_PATCH_INFO_SFLDA:
+ case MONO_PATCH_INFO_EXC_NAME:
+ case MONO_PATCH_INFO_LDSTR:
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE:
+ case MONO_PATCH_INFO_LDTOKEN:
+ *((gconstpointer *)(ip + 1)) = target;
+ continue;
+ default:
+ break;
+ }
+ x86_patch (ip, target);
+ }
+}
+
+int
+mono_arch_max_epilog_size (MonoCompile *cfg)
+{
+ int exc_count = 0, max_epilog_size = 16;
+ MonoJumpInfo *patch_info;
+
+ if (cfg->method->save_lmf)
+ max_epilog_size += 128;
+
+ if (mono_jit_trace_calls != NULL)
+ max_epilog_size += 50;
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ max_epilog_size += 50;
+
+ /* count the number of exception infos */
+
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ if (patch_info->type == MONO_PATCH_INFO_EXC)
+ exc_count++;
+ }
+
+ /*
+ * make sure we have enough space for exceptions
+ * 16 is the size of two push_imm instructions and a call
+ */
+ max_epilog_size += exc_count*16;
+
+ return max_epilog_size;
+}
+
+guint8 *
+mono_arch_emit_prolog (MonoCompile *cfg)
+{
+ MonoMethod *method = cfg->method;
+ MonoBasicBlock *bb;
+ MonoMethodSignature *sig;
+ MonoInst *inst;
+ int alloc_size, pos, max_offset, i;
+ guint8 *code;
+
+ cfg->code_size = MAX (mono_method_get_header (method)->code_size * 4, 256);
+ code = cfg->native_code = g_malloc (cfg->code_size);
+
+ x86_push_reg (code, X86_EBP);
+ x86_mov_reg_reg (code, X86_EBP, X86_ESP, 4);
+
+ alloc_size = - cfg->stack_offset;
+ pos = 0;
+
+ if (method->save_lmf) {
+ pos += sizeof (MonoLMF);
+
+ /* save the current IP */
+ mono_add_patch_info (cfg, code + 1 - cfg->native_code, MONO_PATCH_INFO_IP, NULL);
+ x86_push_imm_template (code);
+
+ /* save all caller saved regs */
+ x86_push_reg (code, X86_EBP);
+ x86_push_reg (code, X86_ESI);
+ x86_push_reg (code, X86_EDI);
+ x86_push_reg (code, X86_EBX);
+
+ /* save method info */
+ x86_push_imm (code, method);
+
+ /* get the address of lmf for the current thread */
+ /*
+ * This is performance critical so we try to use some tricks to make
+ * it fast.
+ */
+ if (lmf_tls_offset != -1) {
+ /* Load lmf quicky using the GS register */
+ x86_prefix (code, X86_GS_PREFIX);
+ x86_mov_reg_mem (code, X86_EAX, lmf_tls_offset, 4);
+ }
+ else {
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD,
+ (gpointer)"mono_get_lmf_addr");
+ x86_call_code (code, 0);
+ }
+
+ /* push lmf */
+ x86_push_reg (code, X86_EAX);
+ /* push *lfm (previous_lmf) */
+ x86_push_membase (code, X86_EAX, 0);
+ /* *(lmf) = ESP */
+ x86_mov_membase_reg (code, X86_EAX, 0, X86_ESP, 4);
+ } else {
+
+ if (cfg->used_int_regs & (1 << X86_EBX)) {
+ x86_push_reg (code, X86_EBX);
+ pos += 4;
+ }
+
+ if (cfg->used_int_regs & (1 << X86_EDI)) {
+ x86_push_reg (code, X86_EDI);
+ pos += 4;
+ }
+
+ if (cfg->used_int_regs & (1 << X86_ESI)) {
+ x86_push_reg (code, X86_ESI);
+ pos += 4;
+ }
+ }
+
+ alloc_size -= pos;
+
+ if (alloc_size) {
+ /* See mono_emit_stack_alloc */
+#ifdef PLATFORM_WIN32
+ guint32 remaining_size = alloc_size;
+ while (remaining_size >= 0x1000) {
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, 0x1000);
+ x86_test_membase_reg (code, X86_ESP, 0, X86_ESP);
+ remaining_size -= 0x1000;
+ }
+ if (remaining_size)
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, remaining_size);
+#else
+ x86_alu_reg_imm (code, X86_SUB, X86_ESP, alloc_size);
+#endif
+ }
+
+ /* compute max_offset in order to use short forward jumps */
+ max_offset = 0;
+ if (cfg->opt & MONO_OPT_BRANCH) {
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *ins = bb->code;
+ bb->max_offset = max_offset;
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE)
+ max_offset += 6;
+ /* max alignment for loops */
+ if ((cfg->opt & MONO_OPT_LOOP) && bb_is_loop_start (bb))
+ max_offset += LOOP_ALIGNMENT;
+
+ while (ins) {
+ if (ins->opcode == OP_LABEL)
+ ins->inst_c1 = max_offset;
+
+ max_offset += ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+ ins = ins->next;
+ }
+ }
+ }
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ code = mono_arch_instrument_prolog (cfg, mono_trace_enter_method, code, TRUE);
+
+ /* load arguments allocated to register from the stack */
+ sig = method->signature;
+ pos = 0;
+
+ for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
+ inst = cfg->varinfo [pos];
+ if (inst->opcode == OP_REGVAR) {
+ x86_mov_reg_membase (code, inst->dreg, X86_EBP, inst->inst_offset, 4);
+ if (cfg->verbose_level > 2)
+ g_print ("Argument %d assigned to register %s\n", pos, mono_arch_regname (inst->dreg));
+ }
+ pos++;
+ }
+
+ cfg->code_len = code - cfg->native_code;
+
+ return code;
+}
+
+void
+mono_arch_emit_epilog (MonoCompile *cfg)
+{
+ MonoJumpInfo *patch_info;
+ MonoMethod *method = cfg->method;
+ MonoMethodSignature *sig = method->signature;
+ int pos;
+ guint32 stack_to_pop;
+ guint8 *code;
+
+ code = cfg->native_code + cfg->code_len;
+
+ if (mono_jit_trace_calls != NULL && mono_trace_eval (method))
+ code = mono_arch_instrument_epilog (cfg, mono_trace_leave_method, code, TRUE);
+
+ /* the code restoring the registers must be kept in sync with CEE_JMP */
+ pos = 0;
+
+ if (method->save_lmf) {
+ gint32 prev_lmf_reg;
+
+ /* Find a spare register */
+ switch (sig->ret->type) {
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ prev_lmf_reg = X86_EDI;
+ cfg->used_int_regs |= (1 << X86_EDI);
+ break;
+ default:
+ prev_lmf_reg = X86_EDX;
+ break;
+ }
+
+ /* reg = previous_lmf */
+ x86_mov_reg_membase (code, prev_lmf_reg, X86_EBP, -32, 4);
+
+ /* ecx = lmf */
+ x86_mov_reg_membase (code, X86_ECX, X86_EBP, -28, 4);
+
+ /* *(lmf) = previous_lmf */
+ x86_mov_membase_reg (code, X86_ECX, 0, prev_lmf_reg, 4);
+
+ /* restore caller saved regs */
+ if (cfg->used_int_regs & (1 << X86_EBX)) {
+ x86_mov_reg_membase (code, X86_EBX, X86_EBP, -20, 4);
+ }
+
+ if (cfg->used_int_regs & (1 << X86_EDI)) {
+ x86_mov_reg_membase (code, X86_EDI, X86_EBP, -16, 4);
+ }
+ if (cfg->used_int_regs & (1 << X86_ESI)) {
+ x86_mov_reg_membase (code, X86_ESI, X86_EBP, -12, 4);
+ }
+
+ /* EBP is restored by LEAVE */
+ } else {
+ if (cfg->used_int_regs & (1 << X86_EBX)) {
+ pos -= 4;
+ }
+ if (cfg->used_int_regs & (1 << X86_EDI)) {
+ pos -= 4;
+ }
+ if (cfg->used_int_regs & (1 << X86_ESI)) {
+ pos -= 4;
+ }
+
+ if (pos)
+ x86_lea_membase (code, X86_ESP, X86_EBP, pos);
+
+ if (cfg->used_int_regs & (1 << X86_ESI)) {
+ x86_pop_reg (code, X86_ESI);
+ }
+ if (cfg->used_int_regs & (1 << X86_EDI)) {
+ x86_pop_reg (code, X86_EDI);
+ }
+ if (cfg->used_int_regs & (1 << X86_EBX)) {
+ x86_pop_reg (code, X86_EBX);
+ }
+ }
+
+ x86_leave (code);
+
+ if (CALLCONV_IS_STDCALL (sig->call_convention)) {
+ MonoJitArgumentInfo *arg_info = alloca (sizeof (MonoJitArgumentInfo) * (sig->param_count + 1));
+
+ stack_to_pop = mono_arch_get_argument_info (sig, sig->param_count, arg_info);
+ } else if (MONO_TYPE_ISSTRUCT (cfg->method->signature->ret))
+ stack_to_pop = 4;
+ else
+ stack_to_pop = 0;
+
+ if (stack_to_pop)
+ x86_ret_imm (code, stack_to_pop);
+ else
+ x86_ret (code);
+
+ /* add code to raise exceptions */
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_EXC:
+ x86_patch (patch_info->ip.i + cfg->native_code, code);
+ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC_NAME, patch_info->data.target);
+ x86_push_imm (code, patch_info->data.target);
+ mono_add_patch_info (cfg, code + 1 - cfg->native_code, MONO_PATCH_INFO_METHOD_REL, (gpointer)patch_info->ip.i);
+ x86_push_imm (code, patch_info->ip.i + cfg->native_code);
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->data.name = "mono_arch_throw_exception_by_name";
+ patch_info->ip.i = code - cfg->native_code;
+ x86_jump_code (code, 0);
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
+ }
+
+ cfg->code_len = code - cfg->native_code;
+
+ g_assert (cfg->code_len < cfg->code_size);
+
+}
+
+void
+mono_arch_flush_icache (guint8 *code, gint size)
+{
+ /* not needed */
+}
+
+void
+mono_arch_flush_register_windows (void)
+{
+}
+
+/*
+ * Support for fast access to the thread-local lmf structure using the GS
+ * segment register on NPTL + kernel 2.6.x.
+ */
+
+static gboolean tls_offset_inited = FALSE;
+
+/* code should be simply return <tls var>; */
+static int read_tls_offset_from_method (void* method)
+{
+ guint8* code = (guint8*) method;
+ /*
+ * Determine the offset of the variable inside the TLS structures
+ * by disassembling the function.
+ */
+
+ /* gcc-3.3.2
+ *
+ * push ebp
+ * mov ebp, esp
+ * mov eax, gs:0
+ * mov eax, DWORD PTR [eax+<offset>]
+ */
+ if (
+ (code [0] == 0x55) && (code [1] == 0x89) && (code [2] == 0xe5) &&
+ (code [3] == 0x65) && (code [4] == 0xa1) && (code [5] == 0x00) &&
+ (code [6] == 0x00) && (code [7] == 0x00) && (code [8] == 0x00) &&
+ (code [9] == 0x8b) && (code [10] == 0x80)) {
+ return *(int*)&(code [11]);
+ }
+
+ /* gcc-3.4
+ *
+ * push ebp
+ * mov ebp, esp
+ * mov eax, gs:<offset>
+ */
+ if (
+ (code [0] == 0x55) && (code [1] == 0x89) && (code [2] == 0xe5) &&
+ (code [3] == 0x65) && (code [4] == 0xa1)) {
+ return *(int*)&(code [5]);
+ }
+
+ /* 3.2.2 with -march=athlon
+ *
+ * push ebp
+ * mov eax, gs:<offset>
+ * mov ebp, esp
+ */
+ if (
+ (code [0] == 0x55) && (code [1] == 0x65) && (code [2] == 0xa1)) {
+ return *(int*)&(code [3]);
+ }
+
+ return -1;
+}
+void
+mono_arch_setup_jit_tls_data (MonoJitTlsData *tls)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ pthread_t self = pthread_self();
+ pthread_attr_t attr;
+ void *staddr = NULL;
+ size_t stsize = 0;
+ struct sigaltstack sa;
+#endif
+
+ if (!tls_offset_inited) {
+ tls_offset_inited = TRUE;
+ if (getenv ("MONO_NPTL")) {
+ lmf_tls_offset = read_tls_offset_from_method (mono_get_lmf_addr);
+ appdomain_tls_offset = read_tls_offset_from_method (mono_domain_get);
+ thread_tls_offset = read_tls_offset_from_method (mono_thread_current);
+ }
+ }
+
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+
+ /* Determine stack boundaries */
+ if (!mono_running_on_valgrind ()) {
+#ifdef HAVE_PTHREAD_GETATTR_NP
+ pthread_getattr_np( self, &attr );
+#else
+#ifdef HAVE_PTHREAD_ATTR_GET_NP
+ pthread_attr_get_np( self, &attr );
+#elif defined(sun)
+ pthread_attr_init( &attr );
+ pthread_attr_getstacksize( &attr, &stsize );
+#else
+#error "Not implemented"
+#endif
+#endif
+#ifndef sun
+ pthread_attr_getstack( &attr, &staddr, &stsize );
+#endif
+ }
+
+ /*
+ * staddr seems to be wrong for the main thread, so we keep the value in
+ * tls->end_of_stack
+ */
+ tls->stack_size = stsize;
+
+ /* Setup an alternate signal stack */
+ tls->signal_stack = g_malloc (SIGNAL_STACK_SIZE);
+ tls->signal_stack_size = SIGNAL_STACK_SIZE;
+
+ sa.ss_sp = tls->signal_stack;
+ sa.ss_size = SIGNAL_STACK_SIZE;
+ sa.ss_flags = SS_ONSTACK;
+ sigaltstack (&sa, NULL);
+#endif
+}
+
+void
+mono_arch_free_jit_tls_data (MonoJitTlsData *tls)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ struct sigaltstack sa;
+
+ sa.ss_sp = tls->signal_stack;
+ sa.ss_size = SIGNAL_STACK_SIZE;
+ sa.ss_flags = SS_DISABLE;
+ sigaltstack (&sa, NULL);
+
+ if (tls->signal_stack)
+ g_free (tls->signal_stack);
+#endif
+}
+
+void
+mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg)
+{
+
+ /* add the this argument */
+ if (this_reg != -1) {
+ MonoInst *this;
+ MONO_INST_NEW (cfg, this, OP_OUTARG);
+ this->type = this_type;
+ this->sreg1 = this_reg;
+ mono_bblock_add_inst (cfg->cbb, this);
+ }
+
+ if (vt_reg != -1) {
+ MonoInst *vtarg;
+ MONO_INST_NEW (cfg, vtarg, OP_OUTARG);
+ vtarg->type = STACK_MP;
+ vtarg->sreg1 = vt_reg;
+ mono_bblock_add_inst (cfg->cbb, vtarg);
+ }
+}
+
+
+gint
+mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
+{
+ if (cmethod->klass == mono_defaults.math_class) {
+ if (strcmp (cmethod->name, "Sin") == 0)
+ return OP_SIN;
+ else if (strcmp (cmethod->name, "Cos") == 0)
+ return OP_COS;
+ else if (strcmp (cmethod->name, "Tan") == 0)
+ return OP_TAN;
+ else if (strcmp (cmethod->name, "Atan") == 0)
+ return OP_ATAN;
+ else if (strcmp (cmethod->name, "Sqrt") == 0)
+ return OP_SQRT;
+ else if (strcmp (cmethod->name, "Abs") == 0 && fsig->params [0]->type == MONO_TYPE_R8)
+ return OP_ABS;
+#if 0
+ /* OP_FREM is not IEEE compatible */
+ else if (strcmp (cmethod->name, "IEEERemainder") == 0)
+ return OP_FREM;
+#endif
+ else
+ return -1;
+ } else {
+ return -1;
+ }
+ return -1;
+}
+
+
+gboolean
+mono_arch_print_tree (MonoInst *tree, int arity)
+{
+ return 0;
+}
+
+MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg)
+{
+ MonoInst* ins;
+
+ if (appdomain_tls_offset == -1)
+ return NULL;
+
+ MONO_INST_NEW (cfg, ins, OP_X86_TLS_GET);
+ ins->inst_offset = appdomain_tls_offset;
+ return ins;
+}
+
+MonoInst* mono_arch_get_thread_intrinsic (MonoCompile* cfg)
+{
+ MonoInst* ins;
+
+ if (thread_tls_offset == -1)
+ return NULL;
+
+ MONO_INST_NEW (cfg, ins, OP_X86_TLS_GET);
+ ins->inst_offset = thread_tls_offset;
+ return ins;
+}
diff --git a/mono/mini/mini-x86.h b/mono/mini/mini-x86.h
new file mode 100644
index 00000000000..a2c004d2a8d
--- /dev/null
+++ b/mono/mini/mini-x86.h
@@ -0,0 +1,163 @@
+#ifndef __MONO_MINI_X86_H__
+#define __MONO_MINI_X86_H__
+
+#include <mono/arch/x86/x86-codegen.h>
+#ifdef PLATFORM_WIN32
+#include <windows.h>
+/* use SIG* defines if possible */
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+/* sigcontext surrogate */
+struct sigcontext {
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
+ unsigned int ebp;
+ unsigned int esp;
+ unsigned int esi;
+ unsigned int edi;
+ unsigned int eip;
+};
+
+typedef void (* MonoW32ExceptionHandler) (int);
+void win32_seh_init(void);
+void win32_seh_cleanup(void);
+void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler);
+
+#ifndef SIGFPE
+#define SIGFPE 4
+#endif
+
+#ifndef SIGILL
+#define SIGILL 8
+#endif
+
+#ifndef SIGSEGV
+#define SIGSEGV 11
+#endif
+
+LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep);
+
+#endif /* PLATFORM_WIN32 */
+
+#ifdef sun // Solaris x86
+# undef SIGSEGV_ON_ALTSTACK
+# define MONO_ARCH_USE_SIGACTION 1
+struct sigcontext {
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned long edi;
+ unsigned long esi;
+ unsigned long ebp;
+ unsigned long esp;
+ unsigned long ebx;
+ unsigned long edx;
+ unsigned long ecx;
+ unsigned long eax;
+ unsigned long trapno;
+ unsigned long err;
+ unsigned long eip;
+ unsigned short cs, __csh;
+ unsigned long eflags;
+ unsigned long esp_at_signal;
+ unsigned short ss, __ssh;
+ unsigned long fpstate[95];
+ unsigned long filler[5];
+};
+#endif // sun, Solaris x86
+
+/* Enables OP_LSHL, OP_LSHL_IMM, OP_LSHR, OP_LSHR_IMM, OP_LSHR_UN, OP_LSHR_UN_IMM */
+#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
+
+#define MONO_MAX_IREGS 8
+#define MONO_MAX_FREGS 6
+
+#define MONO_ARCH_FRAME_ALIGNMENT 4
+
+/* fixme: align to 16byte instead of 32byte (we align to 32byte to get
+ * reproduceable results for benchmarks */
+#define MONO_ARCH_CODE_ALIGNMENT 32
+
+#define MONO_ARCH_BASEREG X86_EBP
+#define MONO_ARCH_RETREG1 X86_EAX
+#define MONO_ARCH_RETREG2 X86_EDX
+
+#define MONO_ARCH_ENCODE_LREG(r1,r2) (r1 | (r2<<3))
+
+#define inst_dreg_low dreg&7
+#define inst_dreg_high dreg>>3
+#define inst_sreg1_low sreg1&7
+#define inst_sreg1_high sreg1>>3
+#define inst_sreg2_low sreg2&7
+#define inst_sreg2_high sreg2>>3
+
+struct MonoLMF {
+ gpointer previous_lmf;
+ gpointer lmf_addr;
+ MonoMethod *method;
+ guint32 ebx;
+ guint32 edi;
+ guint32 esi;
+ guint32 ebp;
+ guint32 eip;
+};
+
+typedef struct MonoCompileArch {
+} MonoCompileArch;
+
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+# define SC_EAX sc_eax
+# define SC_EBX sc_ebx
+# define SC_ECX sc_ecx
+# define SC_EDX sc_edx
+# define SC_EBP sc_ebp
+# define SC_EIP sc_eip
+# define SC_ESP sc_esp
+# define SC_EDI sc_edi
+# define SC_ESI sc_esi
+#else
+# define SC_EAX eax
+# define SC_EBX ebx
+# define SC_ECX ecx
+# define SC_EDX edx
+# define SC_EBP ebp
+# define SC_EIP eip
+# define SC_ESP esp
+# define SC_EDI edi
+# define SC_ESI esi
+#endif
+
+typedef struct sigcontext MonoContext;
+
+#define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->SC_EIP = (long)(ip); } while (0);
+#define MONO_CONTEXT_SET_BP(ctx,bp) do { (ctx)->SC_EBP = (long)(bp); } while (0);
+#define MONO_CONTEXT_SET_SP(ctx,esp) do { (ctx)->SC_ESP = (long)(esp); } while (0);
+
+#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->SC_EIP))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->SC_EBP))
+#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->SC_ESP))
+
+#ifndef PLATFORM_WIN32
+#ifdef HAVE_WORKING_SIGALTSTACK
+#define MONO_ARCH_SIGSEGV_ON_ALTSTACK
+/* NetBSD doesn't define SA_STACK */
+#ifndef SA_STACK
+#define SA_STACK SA_ONSTACK
+#endif
+#endif
+
+#endif
+
+#define MONO_ARCH_BIGMUL_INTRINS 1
+#define MONO_ARCH_NEED_DIV_CHECK 1
+#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
+#define MONO_ARCH_HAVE_RETHROW 1
+#define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
+
+#endif /* __MONO_MINI_X86_H__ */
+
diff --git a/mono/mini/mini.c b/mono/mini/mini.c
new file mode 100644
index 00000000000..77e099becf0
--- /dev/null
+++ b/mono/mini/mini.c
@@ -0,0 +1,8640 @@
+/*
+ * mini.c: The new Mono code generator.
+ *
+ * Author:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <signal.h>
+#include <unistd.h>
+#include <math.h>
+
+#ifdef sun // Solaris x86
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#endif
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
+
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/loader.h>
+#include <mono/metadata/cil-coff.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/class.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/exception.h>
+#include <mono/metadata/opcodes.h>
+#include <mono/metadata/mono-endian.h>
+#include <mono/metadata/tokentype.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/threads.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/socket-io.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/debug-helpers.h>
+#include <mono/io-layer/io-layer.h>
+#include "mono/metadata/profiler.h"
+#include <mono/metadata/profiler-private.h>
+#include <mono/metadata/mono-config.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-debug-debugger.h>
+#include <mono/metadata/monitor.h>
+#include <mono/os/gc_wrapper.h>
+
+#include "mini.h"
+#include <string.h>
+#include <ctype.h>
+#include "inssel.h"
+#include "trace.h"
+
+#include "jit-icalls.c"
+
+/*
+ * this is used to determine when some branch optimizations are possible: we exclude FP compares
+ * because they have weird semantics with NaNs.
+ */
+#define MONO_IS_COND_BRANCH_OP(ins) (((ins)->opcode >= CEE_BEQ && (ins)->opcode <= CEE_BLT_UN) || ((ins)->opcode >= OP_LBEQ && (ins)->opcode <= OP_LBLT_UN) || ((ins)->opcode >= OP_FBEQ && (ins)->opcode <= OP_FBLT_UN) || ((ins)->opcode >= OP_IBEQ && (ins)->opcode <= OP_IBLT_UN))
+#define MONO_IS_COND_BRANCH_NOFP(ins) (MONO_IS_COND_BRANCH_OP(ins) && (ins)->inst_left->inst_left->type != STACK_R8)
+
+#define MONO_CHECK_THIS(ins) (cfg->method->signature->hasthis && (ins)->ssa_op == MONO_SSA_LOAD && (ins)->inst_left->inst_c0 == 0)
+
+gboolean mono_arch_print_tree(MonoInst *tree, int arity);
+static gpointer mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt);
+static gpointer mono_jit_compile_method (MonoMethod *method);
+static gpointer mono_jit_find_compiled_method (MonoDomain *domain, MonoMethod *method);
+
+static void handle_stobj (MonoCompile *cfg, MonoBasicBlock *bblock, MonoInst *dest, MonoInst *src,
+ const unsigned char *ip, MonoClass *klass, gboolean to_end, gboolean native);
+
+static void dec_foreach (MonoInst *tree, MonoCompile *cfg);
+
+static int mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock,
+ int locals_offset, MonoInst *return_var, GList *dont_inline, MonoInst **inline_args,
+ guint inline_offset, gboolean is_virtual_call);
+
+extern guint8 mono_burg_arity [];
+/* helper methods signature */
+static MonoMethodSignature *helper_sig_long_long_long = NULL;
+static MonoMethodSignature *helper_sig_long_long_int = NULL;
+static MonoMethodSignature *helper_sig_newarr = NULL;
+static MonoMethodSignature *helper_sig_newarr_specific = NULL;
+static MonoMethodSignature *helper_sig_ldstr = NULL;
+static MonoMethodSignature *helper_sig_domain_get = NULL;
+static MonoMethodSignature *helper_sig_object_new = NULL;
+static MonoMethodSignature *helper_sig_object_new_specific = NULL;
+static MonoMethodSignature *helper_sig_compile = NULL;
+static MonoMethodSignature *helper_sig_compile_virt = NULL;
+static MonoMethodSignature *helper_sig_obj_ptr = NULL;
+static MonoMethodSignature *helper_sig_obj_ptr_ptr = NULL;
+static MonoMethodSignature *helper_sig_obj_obj_ptr_ptr = NULL;
+static MonoMethodSignature *helper_sig_obj_void = NULL;
+static MonoMethodSignature *helper_sig_ptr_void = NULL;
+static MonoMethodSignature *helper_sig_void_void = NULL;
+static MonoMethodSignature *helper_sig_void_ptr = NULL;
+static MonoMethodSignature *helper_sig_void_obj = NULL;
+static MonoMethodSignature *helper_sig_void_obj_ptr_int = NULL;
+static MonoMethodSignature *helper_sig_void_obj_ptr_ptr_obj = NULL;
+static MonoMethodSignature *helper_sig_void_ptr_ptr = NULL;
+static MonoMethodSignature *helper_sig_void_ptr_ptr_ptr = NULL;
+static MonoMethodSignature *helper_sig_ptr_ptr_ptr = NULL;
+static MonoMethodSignature *helper_sig_ptr_obj = NULL;
+static MonoMethodSignature *helper_sig_ptr_obj_int = NULL;
+static MonoMethodSignature *helper_sig_ptr_int = NULL;
+static MonoMethodSignature *helper_sig_initobj = NULL;
+static MonoMethodSignature *helper_sig_memcpy = NULL;
+static MonoMethodSignature *helper_sig_memset = NULL;
+static MonoMethodSignature *helper_sig_ulong_double = NULL;
+static MonoMethodSignature *helper_sig_long_double = NULL;
+static MonoMethodSignature *helper_sig_double_long = NULL;
+static MonoMethodSignature *helper_sig_double_int = NULL;
+static MonoMethodSignature *helper_sig_float_long = NULL;
+static MonoMethodSignature *helper_sig_double_double_double = NULL;
+static MonoMethodSignature *helper_sig_uint_double = NULL;
+static MonoMethodSignature *helper_sig_int_double = NULL;
+static MonoMethodSignature *helper_sig_stelem_ref = NULL;
+static MonoMethodSignature *helper_sig_stelem_ref_check = NULL;
+static MonoMethodSignature *helper_sig_class_init_trampoline = NULL;
+
+static guint32 default_opt = MONO_OPT_PEEPHOLE;
+
+guint32 mono_jit_tls_id = -1;
+MonoTraceSpec *mono_jit_trace_calls = NULL;
+gboolean mono_break_on_exc = FALSE;
+gboolean mono_compile_aot = FALSE;
+
+static int mini_verbose = 0;
+
+static CRITICAL_SECTION jit_mutex;
+
+static GHashTable *class_init_hash_addr = NULL;
+
+/* MonoMethod -> MonoJitDynamicMethodInfo */
+static GHashTable *dynamic_code_hash = NULL;
+
+gboolean
+mono_running_on_valgrind (void)
+{
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+ if (RUNNING_ON_VALGRIND)
+ return TRUE;
+ else
+ return FALSE;
+#else
+ return FALSE;
+#endif
+}
+
+/* debug function */
+G_GNUC_UNUSED static void
+print_method_from_ip (void *ip)
+{
+ MonoJitInfo *ji;
+ char *method;
+ char *source;
+ MonoDomain *domain = mono_domain_get ();
+
+ ji = mono_jit_info_table_find (domain, ip);
+ if (!ji) {
+ g_print ("No method at %p\n", ip);
+ return;
+ }
+ method = mono_method_full_name (ji->method, TRUE);
+ source = mono_debug_source_location_from_address (ji->method, (int) ip, NULL, domain);
+
+ g_print ("IP %p at offset 0x%x of method %s (%p %p)\n", ip, (char*)ip - (char*)ji->code_start, method, ji->code_start, (char*)ji->code_start + ji->code_size);
+
+ if (source)
+ g_print ("%s\n", source);
+
+ g_free (source);
+ g_free (method);
+
+}
+
+G_GNUC_UNUSED void
+mono_print_method_from_ip (void *ip)
+{
+ print_method_from_ip (ip);
+}
+
+/*
+ * mono_method_same_domain:
+ *
+ * Determine whenever two compiled methods are in the same domain, thus
+ * the address of the callee can be embedded in the caller.
+ */
+gboolean mono_method_same_domain (MonoJitInfo *caller, MonoJitInfo *callee)
+{
+ if (!caller || !callee)
+ return FALSE;
+
+ /*
+ * If the call was made from domain-neutral to domain-specific
+ * code, we can't patch the call site.
+ */
+ if (caller->domain_neutral && !callee->domain_neutral)
+ return FALSE;
+
+ if ((caller->method->klass == mono_defaults.appdomain_class) &&
+ (strstr (caller->method->name, "InvokeInDomain"))) {
+ /* The InvokeInDomain methods change the current appdomain */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+MonoJumpInfoToken *
+mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token)
+{
+ MonoJumpInfoToken *res = mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoToken));
+ res->image = image;
+ res->token = token;
+
+ return res;
+}
+
+#define MONO_INIT_VARINFO(vi,id) do { \
+ (vi)->range.first_use.pos.bid = 0xffff; \
+ (vi)->reg = -1; \
+ (vi)->idx = (id); \
+} while (0)
+
+/*
+ * Basic blocks have two numeric identifiers:
+ * dfn: Depth First Number
+ * block_num: unique ID assigned at bblock creation
+ */
+#define NEW_BBLOCK(cfg) (mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)))
+#define ADD_BBLOCK(cfg,bbhash,b) do { \
+ g_hash_table_insert (bbhash, (b)->cil_code, (b)); \
+ (b)->block_num = cfg->num_bblocks++; \
+ (b)->real_offset = real_offset; \
+ } while (0)
+
+#define GET_BBLOCK(cfg,bbhash,tblock,ip) do { \
+ (tblock) = g_hash_table_lookup (bbhash, (ip)); \
+ if (!(tblock)) { \
+ if ((ip) >= end || (ip) < header->code) goto unverified; \
+ (tblock) = NEW_BBLOCK (cfg); \
+ (tblock)->cil_code = (ip); \
+ ADD_BBLOCK (cfg, (bbhash), (tblock)); \
+ } \
+ } while (0)
+
+#define CHECK_BBLOCK(target,ip,tblock) do { \
+ if ((target) < (ip) && !(tblock)->code) { \
+ bb_recheck = g_list_prepend (bb_recheck, (tblock)); \
+ if (cfg->verbose_level > 2) g_print ("queued block %d for check at IL%04x from IL%04x\n", (tblock)->block_num, (target) - header->code, (ip) - header->code); \
+ } \
+ } while (0)
+
+#define NEW_ICONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_ICONST; \
+ (dest)->inst_c0 = (val); \
+ (dest)->type = STACK_I4; \
+ } while (0)
+
+#if SIZEOF_VOID_P == 8
+#define NEW_PCONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_I8CONST; \
+ (dest)->inst_p0 = (val); \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+#else
+#define NEW_PCONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_ICONST; \
+ (dest)->inst_p0 = (val); \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+#endif
+
+#if SIZEOF_VOID_P == 8
+#define OP_PCONST OP_I8CONST
+#else
+#define OP_PCONST OP_ICONST
+#endif
+
+#define NEW_CLASSCONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_compile_aot ? OP_AOTCONST : OP_PCONST; \
+ (dest)->inst_p0 = (val); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_CLASS; \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+
+#define NEW_IMAGECONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_compile_aot ? OP_AOTCONST : OP_PCONST; \
+ (dest)->inst_p0 = (val); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_IMAGE; \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+
+#define NEW_FIELDCONST(cfg,dest,field) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_compile_aot ? OP_AOTCONST : OP_PCONST; \
+ (dest)->inst_p0 = (field); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_FIELD; \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+
+#define NEW_METHODCONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_compile_aot ? OP_AOTCONST : OP_PCONST; \
+ (dest)->inst_p0 = (val); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_METHODCONST; \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+
+#define NEW_VTABLECONST(cfg,dest,vtable) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_compile_aot ? OP_AOTCONST : OP_PCONST; \
+ (dest)->inst_p0 = mono_compile_aot ? (gpointer)((vtable)->klass) : (vtable); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_VTABLE; \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+
+#define NEW_SFLDACONST(cfg,dest,field) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_compile_aot ? OP_AOTCONST : OP_PCONST; \
+ (dest)->inst_p0 = (field); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_SFLDA; \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+
+#define NEW_LDSTRCONST(cfg,dest,image,token) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_AOTCONST; \
+ (dest)->inst_p0 = mono_jump_info_token_new ((cfg)->mempool, (image), (token)); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_LDSTR; \
+ (dest)->type = STACK_OBJ; \
+ } while (0)
+
+#define NEW_TYPE_FROM_HANDLE_CONST(cfg,dest,image,token) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_AOTCONST; \
+ (dest)->inst_p0 = mono_jump_info_token_new ((cfg)->mempool, (image), (token)); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_TYPE_FROM_HANDLE; \
+ (dest)->type = STACK_OBJ; \
+ } while (0)
+
+#define NEW_LDTOKENCONST(cfg,dest,image,token) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_AOTCONST; \
+ (dest)->inst_p0 = mono_jump_info_token_new ((cfg)->mempool, (image), (token)); \
+ (dest)->inst_i1 = (gpointer)MONO_PATCH_INFO_LDTOKEN; \
+ (dest)->type = STACK_PTR; \
+ } while (0)
+
+#define NEW_DOMAINCONST(cfg,dest) do { \
+ if (cfg->opt & MONO_OPT_SHARED) { \
+ NEW_TEMPLOAD (cfg, dest, mono_get_domainvar (cfg)->inst_c0); \
+ } else { \
+ NEW_PCONST (cfg, dest, (cfg)->domain); \
+ } \
+ } while (0)
+
+#define GET_VARINFO_INST(cfg,num) ((cfg)->varinfo [(num)]->inst)
+
+#define NEW_ARGLOAD(cfg,dest,num) do { \
+ if (arg_array [(num)]->opcode == OP_ICONST) (dest) = arg_array [(num)]; else { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_LOAD; \
+ (dest)->inst_i0 = arg_array [(num)]; \
+ (dest)->opcode = mono_type_to_ldind ((dest)->inst_i0->inst_vtype); \
+ type_to_eval_stack_type (param_types [(num)], (dest)); \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ }} while (0)
+
+#define NEW_LOCLOAD(cfg,dest,num) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_LOAD; \
+ (dest)->inst_i0 = (cfg)->varinfo [locals_offset + (num)]; \
+ (dest)->opcode = mono_type_to_ldind ((dest)->inst_i0->inst_vtype); \
+ type_to_eval_stack_type (header->locals [(num)], (dest)); \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ } while (0)
+
+#define NEW_LOCLOADA(cfg,dest,num) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_MAYBE_LOAD; \
+ (dest)->inst_i0 = (cfg)->varinfo [locals_offset + (num)]; \
+ (dest)->inst_i0->flags |= MONO_INST_INDIRECT; \
+ (dest)->opcode = OP_LDADDR; \
+ (dest)->type = STACK_MP; \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ if (!MONO_TYPE_ISSTRUCT (header->locals [(num)])) \
+ (cfg)->disable_ssa = TRUE; \
+ } while (0)
+
+#define NEW_RETLOADA(cfg,dest) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_MAYBE_LOAD; \
+ (dest)->inst_i0 = (cfg)->ret; \
+ (dest)->inst_i0->flags |= MONO_INST_INDIRECT; \
+ (dest)->opcode = CEE_LDIND_I; \
+ (dest)->type = STACK_MP; \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ (cfg)->disable_ssa = TRUE; \
+ } while (0)
+
+#define NEW_ARGLOADA(cfg,dest,num) do { \
+ if (arg_array [(num)]->opcode == OP_ICONST) goto inline_failure; \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_MAYBE_LOAD; \
+ (dest)->inst_i0 = arg_array [(num)]; \
+ (dest)->inst_i0->flags |= MONO_INST_INDIRECT; \
+ (dest)->opcode = OP_LDADDR; \
+ (dest)->type = STACK_MP; \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ (cfg)->disable_ssa = TRUE; \
+ } while (0)
+
+#define NEW_TEMPLOAD(cfg,dest,num) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_LOAD; \
+ (dest)->inst_i0 = (cfg)->varinfo [(num)]; \
+ (dest)->opcode = mono_type_to_ldind ((dest)->inst_i0->inst_vtype); \
+ type_to_eval_stack_type ((dest)->inst_i0->inst_vtype, (dest)); \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ } while (0)
+
+#define NEW_TEMPLOADA(cfg,dest,num) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_MAYBE_LOAD; \
+ (dest)->inst_i0 = (cfg)->varinfo [(num)]; \
+ (dest)->inst_i0->flags |= MONO_INST_INDIRECT; \
+ (dest)->opcode = OP_LDADDR; \
+ (dest)->type = STACK_MP; \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ if (!MONO_TYPE_ISSTRUCT (cfg->varinfo [(num)]->inst_vtype)) \
+ (cfg)->disable_ssa = TRUE; \
+ } while (0)
+
+
+#define NEW_INDLOAD(cfg,dest,addr,vtype) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->inst_left = addr; \
+ (dest)->opcode = mono_type_to_ldind (vtype); \
+ type_to_eval_stack_type (vtype, (dest)); \
+ /* FIXME: (dest)->klass = (dest)->inst_i0->klass;*/ \
+ } while (0)
+
+#define NEW_INDSTORE(cfg,dest,addr,value,vtype) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->inst_i0 = addr; \
+ (dest)->opcode = mono_type_to_stind (vtype); \
+ (dest)->inst_i1 = (value); \
+ /* FIXME: (dest)->klass = (dest)->inst_i0->klass;*/ \
+ } while (0)
+
+#define NEW_TEMPSTORE(cfg,dest,num,inst) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->ssa_op = MONO_SSA_STORE; \
+ (dest)->inst_i0 = (cfg)->varinfo [(num)]; \
+ (dest)->opcode = mono_type_to_stind ((dest)->inst_i0->inst_vtype); \
+ (dest)->inst_i1 = (inst); \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ } while (0)
+
+#define NEW_LOCSTORE(cfg,dest,num,inst) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_type_to_stind (header->locals [(num)]); \
+ (dest)->ssa_op = MONO_SSA_STORE; \
+ (dest)->inst_i0 = (cfg)->varinfo [locals_offset + (num)]; \
+ (dest)->inst_i1 = (inst); \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ } while (0)
+
+#define NEW_ARGSTORE(cfg,dest,num,inst) do { \
+ if (arg_array [(num)]->opcode == OP_ICONST) goto inline_failure; \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = mono_type_to_stind (param_types [(num)]); \
+ (dest)->ssa_op = MONO_SSA_STORE; \
+ (dest)->inst_i0 = arg_array [(num)]; \
+ (dest)->inst_i1 = (inst); \
+ (dest)->klass = (dest)->inst_i0->klass; \
+ } while (0)
+
+#define ADD_BINOP(op) do { \
+ MONO_INST_NEW (cfg, ins, (op)); \
+ ins->cil_code = ip; \
+ sp -= 2; \
+ ins->inst_i0 = sp [0]; \
+ ins->inst_i1 = sp [1]; \
+ *sp++ = ins; \
+ type_from_op (ins); \
+ CHECK_TYPE (ins); \
+ } while (0)
+
+#define ADD_UNOP(op) do { \
+ MONO_INST_NEW (cfg, ins, (op)); \
+ ins->cil_code = ip; \
+ sp--; \
+ ins->inst_i0 = sp [0]; \
+ *sp++ = ins; \
+ type_from_op (ins); \
+ CHECK_TYPE (ins); \
+ } while (0)
+
+#define ADD_BINCOND(next_block) do { \
+ MonoInst *cmp; \
+ sp -= 2; \
+ MONO_INST_NEW(cfg, cmp, OP_COMPARE); \
+ cmp->inst_i0 = sp [0]; \
+ cmp->inst_i1 = sp [1]; \
+ cmp->cil_code = ins->cil_code; \
+ type_from_op (cmp); \
+ CHECK_TYPE (cmp); \
+ ins->inst_i0 = cmp; \
+ MONO_ADD_INS (bblock, ins); \
+ ins->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \
+ GET_BBLOCK (cfg, bbhash, tblock, target); \
+ link_bblock (cfg, bblock, tblock); \
+ ins->inst_true_bb = tblock; \
+ CHECK_BBLOCK (target, ip, tblock); \
+ if ((next_block)) { \
+ link_bblock (cfg, bblock, (next_block)); \
+ ins->inst_false_bb = (next_block); \
+ start_new_bblock = 1; \
+ } else { \
+ GET_BBLOCK (cfg, bbhash, tblock, ip); \
+ link_bblock (cfg, bblock, tblock); \
+ ins->inst_false_bb = tblock; \
+ start_new_bblock = 2; \
+ } \
+ } while (0)
+
+/* FIXME: handle float, long ... */
+#define ADD_UNCOND(istrue) do { \
+ MonoInst *cmp; \
+ sp--; \
+ MONO_INST_NEW(cfg, cmp, OP_COMPARE); \
+ cmp->inst_i0 = sp [0]; \
+ switch (cmp->inst_i0->type) { \
+ case STACK_I8: \
+ cmp->inst_i1 = zero_int64; break; \
+ case STACK_R8: \
+ cmp->inst_i1 = zero_r8; break; \
+ case STACK_PTR: \
+ case STACK_MP: \
+ cmp->inst_i1 = zero_ptr; break; \
+ case STACK_OBJ: \
+ cmp->inst_i1 = zero_obj; break; \
+ default: \
+ cmp->inst_i1 = zero_int32; \
+ } \
+ cmp->cil_code = ins->cil_code; \
+ type_from_op (cmp); \
+ CHECK_TYPE (cmp); \
+ ins->inst_i0 = cmp; \
+ ins->opcode = (istrue)? CEE_BNE_UN: CEE_BEQ; \
+ MONO_ADD_INS (bblock, ins); \
+ ins->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof(gpointer)*2); \
+ GET_BBLOCK (cfg, bbhash, tblock, target); \
+ link_bblock (cfg, bblock, tblock); \
+ ins->inst_true_bb = tblock; \
+ CHECK_BBLOCK (target, ip, tblock); \
+ GET_BBLOCK (cfg, bbhash, tblock, ip); \
+ link_bblock (cfg, bblock, tblock); \
+ ins->inst_false_bb = tblock; \
+ start_new_bblock = 2; \
+ } while (0)
+
+#define NEW_LDELEMA(cfg,dest,sp,k) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = CEE_LDELEMA; \
+ (dest)->inst_left = (sp) [0]; \
+ (dest)->inst_right = (sp) [1]; \
+ (dest)->type = STACK_MP; \
+ (dest)->klass = (k); \
+ (cfg)->flags |= MONO_CFG_HAS_LDELEMA; \
+ } while (0)
+
+#define NEW_GROUP(cfg,dest,el1,el2) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_GROUP; \
+ (dest)->inst_left = (el1); \
+ (dest)->inst_right = (el2); \
+ } while (0)
+
+#if 0
+static gint
+compare_bblock (gconstpointer a, gconstpointer b)
+{
+ const MonoBasicBlock *b1 = a;
+ const MonoBasicBlock *b2 = b;
+
+ return b2->cil_code - b1->cil_code;
+}
+#endif
+
+/* *
+ * link_bblock: Links two basic blocks
+ *
+ * links two basic blocks in the control flow graph, the 'from'
+ * argument is the starting block and the 'to' argument is the block
+ * the control flow ends to after 'from'.
+ */
+static void
+link_bblock (MonoCompile *cfg, MonoBasicBlock *from, MonoBasicBlock* to)
+{
+ MonoBasicBlock **newa;
+ int i, found;
+
+#if 0
+ if (from->cil_code) {
+ if (to->cil_code)
+ g_print ("edge from IL%04x to IL_%04x\n", from->cil_code - cfg->cil_code, to->cil_code - cfg->cil_code);
+ else
+ g_print ("edge from IL%04x to exit\n", from->cil_code - cfg->cil_code);
+ } else {
+ if (to->cil_code)
+ g_print ("edge from entry to IL_%04x\n", to->cil_code - cfg->cil_code);
+ else
+ g_print ("edge from entry to exit\n");
+ }
+#endif
+ found = FALSE;
+ for (i = 0; i < from->out_count; ++i) {
+ if (to == from->out_bb [i]) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ newa = mono_mempool_alloc (cfg->mempool, sizeof (gpointer) * (from->out_count + 1));
+ for (i = 0; i < from->out_count; ++i) {
+ newa [i] = from->out_bb [i];
+ }
+ newa [i] = to;
+ from->out_count++;
+ from->out_bb = newa;
+ }
+
+ found = FALSE;
+ for (i = 0; i < to->in_count; ++i) {
+ if (from == to->in_bb [i]) {
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ newa = mono_mempool_alloc (cfg->mempool, sizeof (gpointer) * (to->in_count + 1));
+ for (i = 0; i < to->in_count; ++i) {
+ newa [i] = to->in_bb [i];
+ }
+ newa [i] = from;
+ to->in_count++;
+ to->in_bb = newa;
+ }
+}
+
+/**
+ * mono_find_block_region:
+ *
+ * We mark each basic block with a region ID. We use that to avoid BB
+ * optimizations when blocks are in different regions.
+ *
+ * Returns:
+ * A region token that encodes where this region is, and information
+ * about the clause owner for this block.
+ *
+ * The region encodes the try/catch/filter clause that owns this block
+ * as well as the type. -1 is a special value that represents a block
+ * that is in none of try/catch/filter.
+ */
+static int
+mono_find_block_region (MonoCompile *cfg, int offset, int *filter_lengths)
+{
+ MonoMethod *method = cfg->method;
+ MonoMethodHeader *header = mono_method_get_header (method);
+ MonoExceptionClause *clause;
+ int i;
+
+ /* first search for handlers and filters */
+ for (i = 0; i < header->num_clauses; ++i) {
+ clause = &header->clauses [i];
+ if ((clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) && (offset >= clause->data.filter_offset) &&
+ (offset < (clause->data.filter_offset + filter_lengths [i])))
+ return ((i + 1) << 8) | MONO_REGION_FILTER | clause->flags;
+
+ if (MONO_OFFSET_IN_HANDLER (clause, offset)) {
+ if (clause->flags & MONO_EXCEPTION_CLAUSE_FINALLY)
+ return ((i + 1) << 8) | MONO_REGION_FINALLY | clause->flags;
+ else
+ return ((i + 1) << 8) | MONO_REGION_CATCH | clause->flags;
+ }
+ }
+
+ /* search the try blocks */
+ 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;
+ }
+
+ return -1;
+}
+
+static GList*
+mono_find_final_block (MonoCompile *cfg, unsigned char *ip, unsigned char *target, int type)
+{
+ MonoMethod *method = cfg->method;
+ MonoMethodHeader *header = mono_method_get_header (method);
+ MonoExceptionClause *clause;
+ MonoBasicBlock *handler;
+ int i;
+ GList *res = NULL;
+
+ for (i = 0; i < header->num_clauses; ++i) {
+ clause = &header->clauses [i];
+ if (MONO_OFFSET_IN_CLAUSE (clause, (ip - header->code)) &&
+ (!MONO_OFFSET_IN_CLAUSE (clause, (target - header->code)))) {
+ if (clause->flags == type) {
+ handler = g_hash_table_lookup (cfg->bb_hash, header->code + clause->handler_offset);
+ g_assert (handler);
+ res = g_list_append (res, handler);
+ }
+ }
+ }
+ return res;
+}
+
+MonoInst *
+mono_find_spvar_for_region (MonoCompile *cfg, int region)
+{
+ return g_hash_table_lookup (cfg->spvars, GINT_TO_POINTER (region));
+}
+
+static void
+mono_create_spvar_for_region (MonoCompile *cfg, int region)
+{
+ MonoInst *var;
+
+ var = g_hash_table_lookup (cfg->spvars, GINT_TO_POINTER (region));
+ if (var)
+ return;
+
+ var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ /* prevent it from being register allocated */
+ var->flags |= MONO_INST_INDIRECT;
+
+ g_hash_table_insert (cfg->spvars, GINT_TO_POINTER (region), var);
+}
+
+static void
+df_visit (MonoBasicBlock *start, int *dfn, MonoBasicBlock **array)
+{
+ int i;
+
+ array [*dfn] = start;
+ /*g_print ("visit %d at %p\n", *dfn, start->cil_code);*/
+ for (i = 0; i < start->out_count; ++i) {
+ if (start->out_bb [i]->dfn)
+ continue;
+ (*dfn)++;
+ start->out_bb [i]->dfn = *dfn;
+ start->out_bb [i]->df_parent = start;
+ array [*dfn] = start->out_bb [i];
+ df_visit (start->out_bb [i], dfn, array);
+ }
+}
+
+typedef struct {
+ const guchar *code;
+ MonoBasicBlock *best;
+} PrevStruct;
+
+static void
+previous_foreach (gconstpointer key, gpointer val, gpointer data)
+{
+ PrevStruct *p = data;
+ MonoBasicBlock *bb = val;
+ //printf ("FIDPREV %d %p %p %p %p %p %d %d %d\n", bb->block_num, p->code, bb, p->best, bb->cil_code, p->best->cil_code,
+ //bb->method == p->best->method, bb->cil_code < p->code, bb->cil_code > p->best->cil_code);
+
+ if (bb->cil_code && bb->cil_code < p->code && bb->cil_code > p->best->cil_code)
+ p->best = bb;
+}
+
+static MonoBasicBlock*
+find_previous (GHashTable *bb_hash, MonoBasicBlock *start, const guchar *code) {
+ PrevStruct p;
+
+ p.code = code;
+ p.best = start;
+
+ g_hash_table_foreach (bb_hash, (GHFunc)previous_foreach, &p);
+ return p.best;
+}
+
+static void
+split_bblock (MonoCompile *cfg, MonoBasicBlock *first, MonoBasicBlock *second) {
+ int i, j;
+ MonoInst *inst;
+ MonoBasicBlock *bb;
+
+ if (second->code)
+ return;
+
+ /*
+ * FIXME: take into account all the details:
+ * second may have been the target of more than one bblock
+ */
+ second->out_count = first->out_count;
+ second->out_bb = first->out_bb;
+
+ for (i = 0; i < first->out_count; ++i) {
+ bb = first->out_bb [i];
+ for (j = 0; j < bb->in_count; ++j) {
+ if (bb->in_bb [j] == first)
+ bb->in_bb [j] = second;
+ }
+ }
+
+ first->out_count = 0;
+ first->out_bb = NULL;
+ link_bblock (cfg, first, second);
+
+ second->last_ins = first->last_ins;
+
+ /*g_print ("start search at %p for %p\n", first->cil_code, second->cil_code);*/
+ for (inst = first->code; inst && inst->next; inst = inst->next) {
+ /*char *code = mono_disasm_code_one (NULL, cfg->method, inst->next->cil_code, NULL);
+ g_print ("found %p: %s", inst->next->cil_code, code);
+ g_free (code);*/
+ if (inst->cil_code < second->cil_code && inst->next->cil_code >= second->cil_code) {
+ second->code = inst->next;
+ inst->next = NULL;
+ first->last_ins = inst;
+ second->next_bb = first->next_bb;
+ first->next_bb = second;
+ return;
+ }
+ }
+ if (!second->code) {
+ g_warning ("bblock split failed in %s::%s\n", cfg->method->klass->name, cfg->method->name);
+ //G_BREAKPOINT ();
+ }
+}
+
+guint
+mono_type_to_ldind (MonoType *type)
+{
+ if (type->byref)
+ return CEE_LDIND_I;
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_I1:
+ return CEE_LDIND_I1;
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ return CEE_LDIND_U1;
+ case MONO_TYPE_I2:
+ return CEE_LDIND_I2;
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ return CEE_LDIND_U2;
+ case MONO_TYPE_I4:
+ return CEE_LDIND_I4;
+ case MONO_TYPE_U4:
+ return CEE_LDIND_U4;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ return CEE_LDIND_I;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return CEE_LDIND_REF;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ return CEE_LDIND_I8;
+ case MONO_TYPE_R4:
+ return CEE_LDIND_R4;
+ case MONO_TYPE_R8:
+ return CEE_LDIND_R8;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto handle_enum;
+ }
+ return CEE_LDOBJ;
+ case MONO_TYPE_TYPEDBYREF:
+ return CEE_LDOBJ;
+ case MONO_TYPE_GENERICINST:
+ type = type->data.generic_inst->generic_type;
+ goto handle_enum;
+ default:
+ g_error ("unknown type 0x%02x in type_to_ldind", type->type);
+ }
+ return -1;
+}
+
+guint
+mono_type_to_stind (MonoType *type)
+{
+ if (type->byref)
+ return CEE_STIND_I;
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ return CEE_STIND_I1;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ return CEE_STIND_I2;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ return CEE_STIND_I4;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ return CEE_STIND_I;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return CEE_STIND_REF;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ return CEE_STIND_I8;
+ case MONO_TYPE_R4:
+ return CEE_STIND_R4;
+ case MONO_TYPE_R8:
+ return CEE_STIND_R8;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto handle_enum;
+ }
+ return CEE_STOBJ;
+ case MONO_TYPE_TYPEDBYREF:
+ return CEE_STOBJ;
+ case MONO_TYPE_GENERICINST:
+ type = type->data.generic_inst->generic_type;
+ goto handle_enum;
+ default:
+ g_error ("unknown type 0x%02x in type_to_stind", type->type);
+ }
+ return -1;
+}
+
+/*
+ * Returns the type used in the eval stack when @type is loaded.
+ * FIXME: return a MonoType/MonoClass for the byref and VALUETYPE cases.
+ */
+static void
+type_to_eval_stack_type (MonoType *type, MonoInst *inst) {
+ if (type->byref) {
+ inst->type = STACK_MP;
+ return;
+ }
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ inst->type = STACK_I4;
+ return;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ inst->type = STACK_PTR;
+ return;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ inst->type = STACK_OBJ;
+ return;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ inst->type = STACK_I8;
+ return;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ inst->type = STACK_R8;
+ return;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto handle_enum;
+ } else {
+ inst->klass = type->data.klass;
+ inst->type = STACK_VTYPE;
+ return;
+ }
+ case MONO_TYPE_TYPEDBYREF:
+ inst->klass = mono_defaults.typed_reference_class;
+ inst->type = STACK_VTYPE;
+ return;
+ case MONO_TYPE_GENERICINST:
+ type = type->data.generic_inst->generic_type;
+ goto handle_enum;
+ default:
+ g_error ("unknown type 0x%02x in eval stack type", type->type);
+ }
+}
+
+/*
+ * The following tables are used to quickly validate the IL code in type_from_op ().
+ */
+static const char
+bin_num_table [STACK_MAX] [STACK_MAX] = {
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_I4, STACK_INV, STACK_PTR, STACK_INV, STACK_MP, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_I8, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_PTR, STACK_INV, STACK_PTR, STACK_INV, STACK_MP, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_R8, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_MP, STACK_INV, STACK_MP, STACK_INV, STACK_PTR, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV}
+};
+
+static const char
+neg_table [] = {
+ STACK_INV, STACK_I4, STACK_I8, STACK_PTR, STACK_R8, STACK_INV, STACK_INV, STACK_INV
+};
+
+/* reduce the size of this table */
+static const char
+bin_int_table [STACK_MAX] [STACK_MAX] = {
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_I4, STACK_INV, STACK_PTR, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_I8, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_PTR, STACK_INV, STACK_PTR, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV}
+};
+
+static const char
+bin_comp_table [STACK_MAX] [STACK_MAX] = {
+ {0},
+ {0, 1, 0, 1, 0, 0, 4, 0},
+ {0, 0, 1, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 2, 4, 0},
+ {0, 0, 0, 0, 1, 0, 0, 0},
+ {0, 0, 0, 2, 0, 1, 0, 0},
+ {0, 4, 0, 4, 0, 0, 3, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0},
+};
+
+/* reduce the size of this table */
+static const char
+shift_table [STACK_MAX] [STACK_MAX] = {
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_I4, STACK_INV, STACK_I4, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_I8, STACK_INV, STACK_I8, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_PTR, STACK_INV, STACK_PTR, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV},
+ {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_INV}
+};
+
+/*
+ * Tables to map from the non-specific opcode to the matching
+ * type-specific opcode.
+ */
+/* handles from CEE_ADD to CEE_SHR_UN (CEE_REM_UN for floats) */
+static const guint16
+binops_op_map [STACK_MAX] = {
+ 0, 0, OP_LADD-CEE_ADD, OP_PADD-CEE_ADD, OP_FADD-CEE_ADD, OP_PADD-CEE_ADD
+};
+
+/* handles from CEE_NEG to CEE_CONV_U8 */
+static const guint16
+unops_op_map [STACK_MAX] = {
+ 0, 0, OP_LNEG-CEE_NEG, OP_PNEG-CEE_NEG, OP_FNEG-CEE_NEG, OP_PNEG-CEE_NEG
+};
+
+/* handles from CEE_CONV_U2 to CEE_SUB_OVF_UN */
+static const guint16
+ovfops_op_map [STACK_MAX] = {
+ 0, 0, OP_LCONV_TO_U2-CEE_CONV_U2, OP_PCONV_TO_U2-CEE_CONV_U2, OP_FCONV_TO_U2-CEE_CONV_U2, OP_PCONV_TO_U2-CEE_CONV_U2, OP_PCONV_TO_U2-CEE_CONV_U2
+};
+
+/* handles from CEE_CONV_OVF_I1_UN to CEE_CONV_OVF_U_UN */
+static const guint16
+ovf2ops_op_map [STACK_MAX] = {
+ 0, 0, OP_LCONV_TO_OVF_I1_UN-CEE_CONV_OVF_I1_UN, OP_PCONV_TO_OVF_I1_UN-CEE_CONV_OVF_I1_UN, OP_FCONV_TO_OVF_I1_UN-CEE_CONV_OVF_I1_UN, OP_PCONV_TO_OVF_I1_UN-CEE_CONV_OVF_I1_UN
+};
+
+/* handles from CEE_CONV_OVF_I1 to CEE_CONV_OVF_U8 */
+static const guint16
+ovf3ops_op_map [STACK_MAX] = {
+ 0, 0, OP_LCONV_TO_OVF_I1-CEE_CONV_OVF_I1, OP_PCONV_TO_OVF_I1-CEE_CONV_OVF_I1, OP_FCONV_TO_OVF_I1-CEE_CONV_OVF_I1, OP_PCONV_TO_OVF_I1-CEE_CONV_OVF_I1
+};
+
+/* handles from CEE_CEQ to CEE_CLT_UN */
+static const guint16
+ceqops_op_map [STACK_MAX] = {
+ 0, 0, OP_LCEQ-CEE_CEQ, OP_PCEQ-CEE_CEQ, OP_FCEQ-CEE_CEQ, OP_LCEQ-CEE_CEQ
+};
+
+/*
+ * Sets ins->type (the type on the eval stack) according to the
+ * type of the opcode and the arguments to it.
+ * Invalid IL code is marked by setting ins->type to the invalid value STACK_INV.
+ *
+ * FIXME: this function sets ins->type unconditionally in some cases, but
+ * it should set it to invalid for some types (a conv.x on an object)
+ */
+static void
+type_from_op (MonoInst *ins) {
+ switch (ins->opcode) {
+ /* binops */
+ case CEE_ADD:
+ case CEE_SUB:
+ case CEE_MUL:
+ case CEE_DIV:
+ case CEE_REM:
+ /* FIXME: check unverifiable args for STACK_MP */
+ ins->type = bin_num_table [ins->inst_i0->type] [ins->inst_i1->type];
+ ins->opcode += binops_op_map [ins->type];
+ return;
+ case CEE_DIV_UN:
+ case CEE_REM_UN:
+ case CEE_AND:
+ case CEE_OR:
+ case CEE_XOR:
+ ins->type = bin_int_table [ins->inst_i0->type] [ins->inst_i1->type];
+ ins->opcode += binops_op_map [ins->type];
+ return;
+ case CEE_SHL:
+ case CEE_SHR:
+ case CEE_SHR_UN:
+ ins->type = shift_table [ins->inst_i0->type] [ins->inst_i1->type];
+ ins->opcode += binops_op_map [ins->type];
+ return;
+ case OP_COMPARE:
+ case OP_LCOMPARE:
+ /* FIXME: handle some specifics with ins->next->type */
+ ins->type = bin_comp_table [ins->inst_i0->type] [ins->inst_i1->type] ? STACK_I4: STACK_INV;
+ if ((ins->inst_i0->type == STACK_I8) || ((sizeof (gpointer) == 8) && ((ins->inst_i0->type == STACK_PTR) || (ins->inst_i0->type == STACK_OBJ) || (ins->inst_i0->type == STACK_MP))))
+ ins->opcode = OP_LCOMPARE;
+ return;
+ case OP_CEQ:
+ case OP_CGT:
+ case OP_CGT_UN:
+ case OP_CLT:
+ case OP_CLT_UN:
+ ins->type = bin_comp_table [ins->inst_i0->type] [ins->inst_i1->type] ? STACK_I4: STACK_INV;
+ ins->opcode += ceqops_op_map [ins->inst_i0->type];
+ return;
+ /* unops */
+ case CEE_NEG:
+ ins->type = neg_table [ins->inst_i0->type];
+ ins->opcode += unops_op_map [ins->type];
+ return;
+ case CEE_NOT:
+ if (ins->inst_i0->type >= STACK_I4 && ins->inst_i0->type <= STACK_PTR)
+ ins->type = ins->inst_i0->type;
+ else
+ ins->type = STACK_INV;
+ ins->opcode += unops_op_map [ins->type];
+ return;
+ case CEE_CONV_I1:
+ case CEE_CONV_I2:
+ case CEE_CONV_I4:
+ case CEE_CONV_U4:
+ ins->type = STACK_I4;
+ ins->opcode += unops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CONV_R_UN:
+ ins->type = STACK_R8;
+ switch (ins->inst_i0->type) {
+ case STACK_I4:
+ case STACK_PTR:
+ break;
+ case STACK_I8:
+ ins->opcode = OP_LCONV_TO_R_UN;
+ break;
+ }
+ return;
+ case CEE_CONV_OVF_I1:
+ case CEE_CONV_OVF_U1:
+ case CEE_CONV_OVF_I2:
+ case CEE_CONV_OVF_U2:
+ case CEE_CONV_OVF_I4:
+ case CEE_CONV_OVF_U4:
+ ins->type = STACK_I4;
+ ins->opcode += ovf3ops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CONV_OVF_I_UN:
+ case CEE_CONV_OVF_U_UN:
+ ins->type = STACK_PTR;
+ ins->opcode += ovf2ops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CONV_OVF_I1_UN:
+ case CEE_CONV_OVF_I2_UN:
+ case CEE_CONV_OVF_I4_UN:
+ case CEE_CONV_OVF_U1_UN:
+ case CEE_CONV_OVF_U2_UN:
+ case CEE_CONV_OVF_U4_UN:
+ ins->type = STACK_I4;
+ ins->opcode += ovf2ops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CONV_U:
+ ins->type = STACK_PTR;
+ switch (ins->inst_i0->type) {
+ case STACK_I4:
+ case STACK_PTR:
+ case STACK_MP:
+ break;
+ case STACK_I8:
+ ins->opcode = OP_LCONV_TO_U;
+ break;
+ case STACK_R8:
+ ins->opcode = OP_FCONV_TO_U;
+ break;
+ }
+ return;
+ case CEE_CONV_I8:
+ case CEE_CONV_U8:
+ ins->type = STACK_I8;
+ ins->opcode += unops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CONV_OVF_I8:
+ case CEE_CONV_OVF_U8:
+ ins->type = STACK_I8;
+ ins->opcode += ovf3ops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CONV_OVF_U8_UN:
+ case CEE_CONV_OVF_I8_UN:
+ ins->type = STACK_I8;
+ ins->opcode += ovf2ops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CONV_R4:
+ case CEE_CONV_R8:
+ ins->type = STACK_R8;
+ ins->opcode += unops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_CKFINITE:
+ ins->type = STACK_R8;
+ return;
+ case CEE_CONV_U2:
+ case CEE_CONV_U1:
+ ins->type = STACK_I4;
+ ins->opcode += ovfops_op_map [ins->inst_i0->type];
+ break;
+ case CEE_CONV_I:
+ case CEE_CONV_OVF_I:
+ case CEE_CONV_OVF_U:
+ ins->type = STACK_PTR;
+ ins->opcode += ovfops_op_map [ins->inst_i0->type];
+ return;
+ case CEE_ADD_OVF:
+ case CEE_ADD_OVF_UN:
+ case CEE_MUL_OVF:
+ case CEE_MUL_OVF_UN:
+ case CEE_SUB_OVF:
+ case CEE_SUB_OVF_UN:
+ ins->type = bin_num_table [ins->inst_i0->type] [ins->inst_i1->type];
+ ins->opcode += ovfops_op_map [ins->inst_i0->type];
+ return;
+ default:
+ g_error ("opcode 0x%04x not handled in type from op", ins->opcode);
+ break;
+ }
+}
+
+static const char
+ldind_type [] = {
+ STACK_I4, STACK_I4, STACK_I4, STACK_I4, STACK_I4, STACK_I4, STACK_I8, STACK_MP, STACK_R8, STACK_R8, STACK_OBJ
+};
+
+/* map ldelem.x to the matching ldind.x opcode */
+static const guchar
+ldelem_to_ldind [] = {
+ CEE_LDIND_I1,
+ CEE_LDIND_U1,
+ CEE_LDIND_I2,
+ CEE_LDIND_U2,
+ CEE_LDIND_I4,
+ CEE_LDIND_U4,
+ CEE_LDIND_I8,
+ CEE_LDIND_I,
+ CEE_LDIND_R4,
+ CEE_LDIND_R8,
+ CEE_LDIND_REF
+};
+
+/* map stelem.x to the matching stind.x opcode */
+static const guchar
+stelem_to_stind [] = {
+ CEE_STIND_I,
+ CEE_STIND_I1,
+ CEE_STIND_I2,
+ CEE_STIND_I4,
+ CEE_STIND_I8,
+ CEE_STIND_R4,
+ CEE_STIND_R8,
+ CEE_STIND_REF
+};
+
+#if 0
+
+static const char
+param_table [STACK_MAX] [STACK_MAX] = {
+ {0},
+};
+
+static int
+check_values_to_signature (MonoInst *args, MonoType *this, MonoMethodSignature *sig) {
+ int i;
+
+ if (sig->hasthis) {
+ switch (args->type) {
+ case STACK_I4:
+ case STACK_I8:
+ case STACK_R8:
+ case STACK_VTYPE:
+ case STACK_INV:
+ return 0;
+ }
+ args++;
+ }
+ for (i = 0; i < sig->param_count; ++i) {
+ switch (args [i].type) {
+ case STACK_INV:
+ return 0;
+ case STACK_MP:
+ if (!sig->params [i]->byref)
+ return 0;
+ continue;
+ case STACK_OBJ:
+ if (sig->params [i]->byref)
+ return 0;
+ switch (sig->params [i]->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ break;
+ default:
+ return 0;
+ }
+ continue;
+ case STACK_R8:
+ if (sig->params [i]->byref)
+ return 0;
+ if (sig->params [i]->type != MONO_TYPE_R4 && sig->params [i]->type != MONO_TYPE_R8)
+ return 0;
+ continue;
+ case STACK_PTR:
+ case STACK_I4:
+ case STACK_I8:
+ case STACK_VTYPE:
+ break;
+ }
+ /*if (!param_table [args [i].type] [sig->params [i]->type])
+ return 0;*/
+ }
+ return 1;
+}
+#endif
+
+/*
+ * When we need a pointer to the current domain many times in a method, we
+ * call mono_domain_get() once and we store the result in a local variable.
+ * This function returns the variable that represents the MonoDomain*.
+ */
+inline static MonoInst *
+mono_get_domainvar (MonoCompile *cfg)
+{
+ if (!cfg->domainvar)
+ cfg->domainvar = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ return cfg->domainvar;
+}
+
+MonoInst*
+mono_compile_create_var (MonoCompile *cfg, MonoType *type, int opcode)
+{
+ MonoInst *inst;
+ int num = cfg->num_varinfo;
+
+ if ((num + 1) >= cfg->varinfo_count) {
+ cfg->varinfo_count = (cfg->varinfo_count + 2) * 2;
+ cfg->varinfo = (MonoInst **)g_realloc (cfg->varinfo, sizeof (MonoInst*) * cfg->varinfo_count);
+ cfg->vars = (MonoMethodVar **)g_realloc (cfg->vars, sizeof (MonoMethodVar*) * cfg->varinfo_count);
+ }
+
+ /*g_print ("created temp %d of type 0x%x\n", num, type->type);*/
+ mono_jit_stats.allocate_var++;
+
+ MONO_INST_NEW (cfg, inst, opcode);
+ inst->inst_c0 = num;
+ inst->inst_vtype = type;
+ inst->klass = mono_class_from_mono_type (type);
+ /* if set to 1 the variable is native */
+ inst->unused = 0;
+
+ cfg->varinfo [num] = inst;
+
+ cfg->vars [num] = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoMethodVar));
+ MONO_INIT_VARINFO (cfg->vars [num], num);
+
+ cfg->num_varinfo++;
+ //g_print ("created temp %d of type %s\n", num, mono_type_get_name (type));
+ return inst;
+}
+
+static MonoType*
+type_from_stack_type (MonoInst *ins) {
+ switch (ins->type) {
+ case STACK_I4: return &mono_defaults.int32_class->byval_arg;
+ case STACK_I8: return &mono_defaults.int64_class->byval_arg;
+ case STACK_PTR: return &mono_defaults.int_class->byval_arg;
+ case STACK_R8: return &mono_defaults.double_class->byval_arg;
+ case STACK_MP: return &mono_defaults.int_class->byval_arg;
+ case STACK_OBJ: return &mono_defaults.object_class->byval_arg;
+ case STACK_VTYPE: return &ins->klass->byval_arg;
+ default:
+ g_error ("stack type %d to montype not handled\n", ins->type);
+ }
+ return NULL;
+}
+
+static MonoClass*
+array_access_to_klass (int opcode)
+{
+ switch (opcode) {
+ case CEE_LDELEM_U1:
+ return mono_defaults.byte_class;
+ case CEE_LDELEM_U2:
+ return mono_defaults.uint16_class;
+ case CEE_LDELEM_I:
+ case CEE_STELEM_I:
+ return mono_defaults.int_class;
+ case CEE_LDELEM_I1:
+ case CEE_STELEM_I1:
+ return mono_defaults.sbyte_class;
+ case CEE_LDELEM_I2:
+ case CEE_STELEM_I2:
+ return mono_defaults.int16_class;
+ case CEE_LDELEM_I4:
+ case CEE_STELEM_I4:
+ return mono_defaults.int32_class;
+ case CEE_LDELEM_U4:
+ return mono_defaults.uint32_class;
+ case CEE_LDELEM_I8:
+ case CEE_STELEM_I8:
+ return mono_defaults.int64_class;
+ case CEE_LDELEM_R4:
+ case CEE_STELEM_R4:
+ return mono_defaults.single_class;
+ case CEE_LDELEM_R8:
+ case CEE_STELEM_R8:
+ return mono_defaults.double_class;
+ case CEE_LDELEM_REF:
+ case CEE_STELEM_REF:
+ return mono_defaults.object_class;
+ default:
+ g_assert_not_reached ();
+ }
+ return NULL;
+}
+
+static void
+mono_add_ins_to_end (MonoBasicBlock *bb, MonoInst *inst)
+{
+ MonoInst *prev;
+ if (!bb->code) {
+ MONO_ADD_INS (bb, inst);
+ return;
+ }
+ switch (bb->last_ins->opcode) {
+ case CEE_BEQ:
+ case CEE_BGE:
+ case CEE_BGT:
+ case CEE_BLE:
+ case CEE_BLT:
+ case CEE_BNE_UN:
+ case CEE_BGE_UN:
+ case CEE_BGT_UN:
+ case CEE_BLE_UN:
+ case CEE_BLT_UN:
+ case CEE_BR:
+ case CEE_SWITCH:
+ prev = bb->code;
+ while (prev->next && prev->next != bb->last_ins)
+ prev = prev->next;
+ if (prev == bb->code) {
+ if (bb->last_ins == bb->code) {
+ inst->next = bb->code;
+ bb->code = inst;
+ } else {
+ inst->next = prev->next;
+ prev->next = inst;
+ }
+ } else {
+ inst->next = bb->last_ins;
+ prev->next = inst;
+ }
+ break;
+ // g_warning ("handle conditional jump in add_ins_to_end ()\n");
+ default:
+ MONO_ADD_INS (bb, inst);
+ break;
+ }
+}
+
+void
+mono_add_varcopy_to_end (MonoCompile *cfg, MonoBasicBlock *bb, int src, int dest)
+{
+ MonoInst *inst, *load;
+
+ NEW_TEMPLOAD (cfg, load, src);
+
+ NEW_TEMPSTORE (cfg, inst, dest, load);
+ if (inst->opcode == CEE_STOBJ) {
+ NEW_TEMPLOADA (cfg, inst, dest);
+ handle_stobj (cfg, bb, inst, load, NULL, inst->klass, TRUE, FALSE);
+ } else {
+ inst->cil_code = NULL;
+ mono_add_ins_to_end (bb, inst);
+ }
+}
+
+/*
+ * We try to share variables when possible
+ */
+static MonoInst *
+mono_compile_get_interface_var (MonoCompile *cfg, int slot, MonoInst *ins)
+{
+ MonoInst *res;
+ int pos, vnum;
+
+ /* inlining can result in deeper stacks */
+ if (slot >= mono_method_get_header (cfg->method)->max_stack)
+ return mono_compile_create_var (cfg, type_from_stack_type (ins), OP_LOCAL);
+
+ pos = ins->type - 1 + slot * STACK_MAX;
+
+ switch (ins->type) {
+ case STACK_I4:
+ case STACK_I8:
+ case STACK_R8:
+ case STACK_PTR:
+ case STACK_MP:
+ case STACK_OBJ:
+ if ((vnum = cfg->intvars [pos]))
+ return cfg->varinfo [vnum];
+ res = mono_compile_create_var (cfg, type_from_stack_type (ins), OP_LOCAL);
+ cfg->intvars [pos] = res->inst_c0;
+ break;
+ default:
+ res = mono_compile_create_var (cfg, type_from_stack_type (ins), OP_LOCAL);
+ }
+ return res;
+}
+
+/*
+ * This function is called to handle items that are left on the evaluation stack
+ * at basic block boundaries. What happens is that we save the values to local variables
+ * and we reload them later when first entering the target basic block (with the
+ * handle_loaded_temps () function).
+ * It is also used to handle items on the stack in store opcodes, since it is
+ * possible that the variable to be stored into is already on the stack, in
+ * which case its old value should be used.
+ * A single joint point will use the same variables (stored in the array bb->out_stack or
+ * bb->in_stack, if the basic block is before or after the joint point).
+ */
+static int
+handle_stack_args (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **sp, int count) {
+ int i, bindex;
+ MonoBasicBlock *outb;
+ MonoInst *inst, **locals;
+ gboolean found;
+
+ if (!count)
+ return 0;
+ if (cfg->verbose_level > 3)
+ g_print ("%d item(s) on exit from B%d\n", count, bb->block_num);
+ if (!bb->out_scount) {
+ bb->out_scount = count;
+ //g_print ("bblock %d has out:", bb->block_num);
+ found = FALSE;
+ for (i = 0; i < bb->out_count; ++i) {
+ outb = bb->out_bb [i];
+ //g_print (" %d", outb->block_num);
+ if (outb->in_stack) {
+ found = TRUE;
+ bb->out_stack = outb->in_stack;
+ break;
+ }
+ }
+ //g_print ("\n");
+ if (!found) {
+ bb->out_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * count);
+ for (i = 0; i < count; ++i) {
+ /*
+ * try to reuse temps already allocated for this purpouse, if they occupy the same
+ * stack slot and if they are of the same type.
+ * This won't cause conflicts since if 'local' is used to
+ * store one of the values in the in_stack of a bblock, then
+ * the same variable will be used for the same outgoing stack
+ * slot as well.
+ * This doesn't work when inlining methods, since the bblocks
+ * in the inlined methods do not inherit their in_stack from
+ * the bblock they are inlined to. See bug #58863 for an
+ * example.
+ */
+ if (cfg->inlined_method)
+ bb->out_stack [i] = mono_compile_create_var (cfg, type_from_stack_type (sp [i]), OP_LOCAL);
+ else
+ bb->out_stack [i] = mono_compile_get_interface_var (cfg, i, sp [i]);
+ }
+ }
+ }
+
+ for (i = 0; i < bb->out_count; ++i) {
+ outb = bb->out_bb [i];
+ if (outb->in_scount)
+ continue; /* check they are the same locals */
+ outb->in_scount = count;
+ outb->in_stack = bb->out_stack;
+ }
+
+ locals = bb->out_stack;
+ for (i = 0; i < count; ++i) {
+ /* add store ops at the end of the bb, before the branch */
+ NEW_TEMPSTORE (cfg, inst, locals [i]->inst_c0, sp [i]);
+ if (inst->opcode == CEE_STOBJ) {
+ NEW_TEMPLOADA (cfg, inst, locals [i]->inst_c0);
+ handle_stobj (cfg, bb, inst, sp [i], sp [i]->cil_code, inst->klass, TRUE, FALSE);
+ } else {
+ inst->cil_code = sp [i]->cil_code;
+ mono_add_ins_to_end (bb, inst);
+ }
+ if (cfg->verbose_level > 3)
+ g_print ("storing %d to temp %d\n", i, locals [i]->inst_c0);
+ }
+
+ /*
+ * It is possible that the out bblocks already have in_stack assigned, and
+ * the in_stacks differ. In this case, we will store to all the different
+ * in_stacks.
+ */
+
+ found = TRUE;
+ bindex = 0;
+ while (found) {
+ /* Find a bblock which has a different in_stack */
+ found = FALSE;
+ while (bindex < bb->out_count) {
+ outb = bb->out_bb [bindex];
+ if (outb->in_stack != locals) {
+ /*
+ * Instead of storing sp [i] to locals [i], we need to store
+ * locals [i] to <new locals>[i], since the sp [i] tree can't
+ * be shared between trees.
+ */
+ for (i = 0; i < count; ++i)
+ mono_add_varcopy_to_end (cfg, bb, locals [i]->inst_c0, outb->in_stack [i]->inst_c0);
+ locals = outb->in_stack;
+ found = TRUE;
+ break;
+ }
+ bindex ++;
+ }
+ }
+
+ return 0;
+}
+
+static int
+ret_type_to_call_opcode (MonoType *type, int calli, int virt)
+{
+ if (type->byref)
+ return calli? OP_CALL_REG: virt? CEE_CALLVIRT: CEE_CALL;
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_VOID:
+ return calli? OP_VOIDCALL_REG: virt? OP_VOIDCALLVIRT: OP_VOIDCALL;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ return calli? OP_CALL_REG: virt? CEE_CALLVIRT: CEE_CALL;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ return calli? OP_CALL_REG: virt? CEE_CALLVIRT: CEE_CALL;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ return calli? OP_CALL_REG: virt? CEE_CALLVIRT: CEE_CALL;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ return calli? OP_LCALL_REG: virt? OP_LCALLVIRT: OP_LCALL;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ return calli? OP_FCALL_REG: virt? OP_FCALLVIRT: OP_FCALL;
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto handle_enum;
+ } else
+ return calli? OP_VCALL_REG: virt? OP_VCALLVIRT: OP_VCALL;
+ case MONO_TYPE_TYPEDBYREF:
+ return calli? OP_VCALL_REG: virt? OP_VCALLVIRT: OP_VCALL;
+ case MONO_TYPE_GENERICINST:
+ type = type->data.generic_inst->generic_type;
+ goto handle_enum;
+ default:
+ g_error ("unknown type 0x%02x in ret_type_to_call_opcode", type->type);
+ }
+ return -1;
+}
+
+void
+mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks)
+{
+ MonoJumpInfo *ji = mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfo));
+
+ ji->ip.label = label;
+ ji->type = MONO_PATCH_INFO_SWITCH;
+ ji->data.table = bbs;
+ ji->next = cfg->patch_info;
+ ji->table_size = num_blocks;
+ cfg->patch_info = ji;
+}
+
+/*
+ * When we add a tree of instructions, we need to ensure the instructions currently
+ * on the stack are executed before (like, if we load a value from a local).
+ * We ensure this by saving the currently loaded values to temps and rewriting the
+ * instructions to load the values.
+ * This is not done for opcodes that terminate a basic block (because it's handled already
+ * by handle_stack_args ()) and for opcodes that can't change values, like POP.
+ */
+static void
+handle_loaded_temps (MonoCompile *cfg, MonoBasicBlock *bblock, MonoInst **stack, MonoInst **sp)
+{
+ MonoInst *load, *store, *temp, *ins;
+
+ while (stack < sp) {
+ ins = *stack;
+ /* handle also other constants */
+ if (ins->opcode != OP_ICONST) {
+ temp = mono_compile_create_var (cfg, type_from_stack_type (ins), OP_LOCAL);
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, ins);
+ store->cil_code = ins->cil_code;
+ if (store->opcode == CEE_STOBJ) {
+ NEW_TEMPLOADA (cfg, store, temp->inst_c0);
+ handle_stobj (cfg, bblock, store, ins, ins->cil_code, temp->klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, load, temp->inst_c0);
+ load->cil_code = ins->cil_code;
+ *stack = load;
+ }
+ stack++;
+ }
+}
+
+/*
+ * Prepare arguments for passing to a function call.
+ * Return a non-zero value if the arguments can't be passed to the given
+ * signature.
+ * The type checks are not yet complete and some conversions may need
+ * casts on 32 or 64 bit architectures.
+ */
+static int
+check_call_signature (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **args)
+{
+ MonoType *simple_type;
+ int i;
+
+ if (sig->hasthis) {
+ if (args [0]->type != STACK_OBJ && args [0]->type != STACK_MP && args [0]->type != STACK_PTR)
+ return 1;
+ args++;
+ }
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sig->params [i]->byref) {
+ /*
+ * check the result of ldelema is only passed as an argument if the byref
+ * type matches exactly the array element type.
+ * FIXME: if the argument as been saved on the stack as part of the
+ * interface variable code (the value was on the stack at a basic block boundary)
+ * we need to add the check in that case, too.
+ */
+ if (args [i]->opcode == CEE_LDELEMA) {
+ MonoInst *check;
+ MonoClass *exact_class = mono_class_from_mono_type (sig->params [i]);
+ if (!exact_class->valuetype) {
+ MONO_INST_NEW (cfg, check, OP_CHECK_ARRAY_TYPE);
+ check->cil_code = args [i]->cil_code;
+ check->klass = exact_class;
+ check->inst_left = args [i]->inst_left;
+ check->type = STACK_OBJ;
+ args [i]->inst_left = check;
+ }
+ }
+ if (args [i]->type != STACK_MP && args [i]->type != STACK_PTR)
+ return 1;
+ continue;
+ }
+ simple_type = sig->params [i];
+handle_enum:
+ switch (simple_type->type) {
+ case MONO_TYPE_VOID:
+ return 1;
+ continue;
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ if (args [i]->type != STACK_I4 && args [i]->type != STACK_PTR)
+ return 1;
+ continue;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_PTR:
+ if (args [i]->type != STACK_I4 && args [i]->type != STACK_PTR && args [i]->type != STACK_MP && args [i]->type != STACK_OBJ)
+ return 1;
+ continue;
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_ARRAY:
+ if (args [i]->type != STACK_OBJ)
+ return 1;
+ continue;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ if (args [i]->type != STACK_I8)
+ return 1;
+ continue;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ if (args [i]->type != STACK_R8)
+ return 1;
+ continue;
+ case MONO_TYPE_VALUETYPE:
+ if (simple_type->data.klass->enumtype) {
+ simple_type = simple_type->data.klass->enum_basetype;
+ goto handle_enum;
+ }
+ if (args [i]->type != STACK_VTYPE)
+ return 1;
+ continue;
+ case MONO_TYPE_TYPEDBYREF:
+ if (args [i]->type != STACK_VTYPE)
+ return 1;
+ continue;
+ case MONO_TYPE_GENERICINST:
+ simple_type = simple_type->data.generic_inst->generic_type;
+ goto handle_enum;
+
+ default:
+ g_error ("unknown type 0x%02x in check_call_signature",
+ simple_type->type);
+ }
+ }
+ return 0;
+}
+
+inline static int
+mono_spill_call (MonoCompile *cfg, MonoBasicBlock *bblock, MonoCallInst *call, MonoMethodSignature *sig, gboolean ret_object,
+ const guint8 *ip, gboolean to_end)
+{
+ MonoInst *temp, *store, *ins = (MonoInst*)call;
+ MonoType *ret = sig->ret;
+
+ if (!MONO_TYPE_IS_VOID (ret) || ret_object) {
+ if (ret_object) {
+ call->inst.type = STACK_OBJ;
+ call->inst.opcode = CEE_CALL;
+ temp = mono_compile_create_var (cfg, &mono_defaults.string_class->byval_arg, OP_LOCAL);
+ } else {
+ type_to_eval_stack_type (ret, ins);
+ temp = mono_compile_create_var (cfg, ret, OP_LOCAL);
+ }
+
+ if (MONO_TYPE_ISSTRUCT (ret)) {
+ MonoInst *loada;
+
+ /* we use this to allocate native sized structs */
+ temp->unused = sig->pinvoke;
+
+ NEW_TEMPLOADA (cfg, loada, temp->inst_c0);
+ if (call->inst.opcode == OP_VCALL)
+ ins->inst_left = loada;
+ else
+ ins->inst_right = loada; /* a virtual or indirect call */
+
+ if (to_end)
+ mono_add_ins_to_end (bblock, ins);
+ else
+ MONO_ADD_INS (bblock, ins);
+ } else {
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, ins);
+ store->cil_code = ip;
+ if (to_end)
+ mono_add_ins_to_end (bblock, store);
+ else
+ MONO_ADD_INS (bblock, store);
+ }
+ return temp->inst_c0;
+ } else {
+ if (to_end)
+ mono_add_ins_to_end (bblock, ins);
+ else
+ MONO_ADD_INS (bblock, ins);
+ return -1;
+ }
+}
+
+inline static MonoCallInst *
+mono_emit_call_args (MonoCompile *cfg, MonoBasicBlock *bblock, MonoMethodSignature *sig,
+ MonoInst **args, int calli, int virtual, const guint8 *ip, gboolean to_end)
+{
+ MonoCallInst *call;
+ MonoInst *arg;
+
+ MONO_INST_NEW_CALL (cfg, call, ret_type_to_call_opcode (sig->ret, calli, virtual));
+
+ call->inst.cil_code = ip;
+ call->args = args;
+ call->signature = sig;
+ call = mono_arch_call_opcode (cfg, bblock, call, virtual);
+
+ for (arg = call->out_args; arg;) {
+ MonoInst *narg = arg->next;
+ arg->next = NULL;
+ if (!arg->cil_code)
+ arg->cil_code = ip;
+ if (to_end)
+ mono_add_ins_to_end (bblock, arg);
+ else
+ MONO_ADD_INS (bblock, arg);
+ arg = narg;
+ }
+ return call;
+}
+
+inline static int
+mono_emit_calli (MonoCompile *cfg, MonoBasicBlock *bblock, MonoMethodSignature *sig,
+ MonoInst **args, MonoInst *addr, const guint8 *ip)
+{
+ MonoCallInst *call = mono_emit_call_args (cfg, bblock, sig, args, TRUE, FALSE, ip, FALSE);
+
+ call->inst.inst_i0 = addr;
+
+ return mono_spill_call (cfg, bblock, call, sig, FALSE, ip, FALSE);
+}
+
+static MonoCallInst*
+mono_emit_method_call (MonoCompile *cfg, MonoBasicBlock *bblock, MonoMethod *method, MonoMethodSignature *sig,
+ MonoInst **args, const guint8 *ip, MonoInst *this)
+{
+ gboolean virtual = this != NULL;
+ MonoCallInst *call;
+
+ call = mono_emit_call_args (cfg, bblock, sig, args, FALSE, virtual, ip, FALSE);
+
+ if (this && sig->hasthis &&
+ (method->klass->marshalbyref || method->klass == mono_defaults.object_class) &&
+ !(method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !MONO_CHECK_THIS (this)) {
+ call->method = mono_marshal_get_remoting_invoke_with_check (method);
+ } else {
+ call->method = method;
+ }
+ call->inst.flags |= MONO_INST_HAS_METHOD;
+ call->inst.inst_left = this;
+
+ return call;
+}
+
+inline static int
+mono_emit_method_call_spilled (MonoCompile *cfg, MonoBasicBlock *bblock, MonoMethod *method,
+ MonoMethodSignature *signature, MonoInst **args, const guint8 *ip, MonoInst *this)
+{
+ MonoCallInst *call = mono_emit_method_call (cfg, bblock, method, signature, args, ip, this);
+
+ return mono_spill_call (cfg, bblock, call, signature, method->string_ctor, ip, FALSE);
+}
+
+inline static int
+mono_emit_native_call (MonoCompile *cfg, MonoBasicBlock *bblock, gconstpointer func, MonoMethodSignature *sig,
+ MonoInst **args, const guint8 *ip, gboolean ret_object, gboolean to_end)
+{
+ MonoCallInst *call;
+
+ g_assert (sig);
+
+ call = mono_emit_call_args (cfg, bblock, sig, args, FALSE, FALSE, ip, to_end);
+ call->fptr = func;
+ return mono_spill_call (cfg, bblock, call, sig, ret_object, ip, to_end);
+}
+
+inline static int
+mono_emit_jit_icall (MonoCompile *cfg, MonoBasicBlock *bblock, gconstpointer func, MonoInst **args, const guint8 *ip)
+{
+ MonoJitICallInfo *info = mono_find_jit_icall_by_addr (func);
+
+ if (!info) {
+ g_warning ("unregistered JIT ICall");
+ g_assert_not_reached ();
+ }
+
+ return mono_emit_native_call (cfg, bblock, mono_icall_get_wrapper (info), info->sig, args, ip, FALSE, FALSE);
+}
+
+static void
+mono_emulate_opcode (MonoCompile *cfg, MonoInst *tree, MonoInst **iargs, MonoJitICallInfo *info)
+{
+ MonoInst *ins, *temp = NULL, *store, *load, *begin;
+ MonoInst *last_arg = NULL;
+ int nargs;
+ MonoCallInst *call;
+
+ //g_print ("emulating: ");
+ //mono_print_tree_nl (tree);
+ MONO_INST_NEW_CALL (cfg, call, ret_type_to_call_opcode (info->sig->ret, FALSE, FALSE));
+ ins = (MonoInst*)call;
+
+ call->inst.cil_code = tree->cil_code;
+ call->args = iargs;
+ call->signature = info->sig;
+
+ call = mono_arch_call_opcode (cfg, cfg->cbb, call, FALSE);
+
+ if (!MONO_TYPE_IS_VOID (info->sig->ret)) {
+ temp = mono_compile_create_var (cfg, info->sig->ret, OP_LOCAL);
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, ins);
+ store->cil_code = tree->cil_code;
+ } else {
+ store = ins;
+ }
+
+ nargs = info->sig->param_count + info->sig->hasthis;
+
+ for (last_arg = call->out_args; last_arg && last_arg->next; last_arg = last_arg->next) ;
+
+ if (nargs)
+ last_arg->next = store;
+
+ if (nargs)
+ begin = call->out_args;
+ else
+ begin = store;
+
+ if (cfg->prev_ins) {
+ /*
+ * This assumes that that in a tree, emulate_opcode is called for a
+ * node before it is called for its children. dec_foreach needs to
+ * take this into account.
+ */
+ store->next = cfg->prev_ins->next;
+ cfg->prev_ins->next = begin;
+ } else {
+ store->next = cfg->cbb->code;
+ cfg->cbb->code = begin;
+ }
+
+ call->fptr = mono_icall_get_wrapper (info);
+
+ if (!MONO_TYPE_IS_VOID (info->sig->ret)) {
+ NEW_TEMPLOAD (cfg, load, temp->inst_c0);
+ *tree = *load;
+ }
+}
+
+static MonoMethodSignature *
+mono_get_element_address_signature (int arity)
+{
+ static GHashTable *sighash = NULL;
+ MonoMethodSignature *res;
+ int i;
+
+ EnterCriticalSection (&jit_mutex);
+ if (!sighash) {
+ sighash = g_hash_table_new (NULL, NULL);
+ }
+ else if ((res = g_hash_table_lookup (sighash, (gpointer)arity))) {
+ LeaveCriticalSection (&jit_mutex);
+ return res;
+ }
+
+ res = mono_metadata_signature_alloc (mono_defaults.corlib, arity + 1);
+
+ res->pinvoke = 1;
+#ifdef MONO_ARCH_VARARG_ICALLS
+ /* Only set this only some archs since not all backends can handle varargs+pinvoke */
+ res->call_convention = MONO_CALL_VARARG;
+#endif
+ res->params [0] = &mono_defaults.array_class->byval_arg;
+
+ for (i = 1; i <= arity; i++)
+ res->params [i] = &mono_defaults.int_class->byval_arg;
+
+ res->ret = &mono_defaults.int_class->byval_arg;
+
+ g_hash_table_insert (sighash, (gpointer)arity, res);
+ LeaveCriticalSection (&jit_mutex);
+
+ return res;
+}
+
+static MonoMethodSignature *
+mono_get_array_new_va_signature (int arity)
+{
+ static GHashTable *sighash = NULL;
+ MonoMethodSignature *res;
+ int i;
+
+ EnterCriticalSection (&jit_mutex);
+ if (!sighash) {
+ sighash = g_hash_table_new (NULL, NULL);
+ }
+ else if ((res = g_hash_table_lookup (sighash, (gpointer)arity))) {
+ LeaveCriticalSection (&jit_mutex);
+ return res;
+ }
+
+ res = mono_metadata_signature_alloc (mono_defaults.corlib, arity + 1);
+
+ res->pinvoke = 1;
+#ifdef MONO_ARCH_VARARG_ICALLS
+ /* Only set this only some archs since not all backends can handle varargs+pinvoke */
+ res->call_convention = MONO_CALL_VARARG;
+#endif
+
+ res->params [0] = &mono_defaults.int_class->byval_arg;
+ for (i = 0; i < arity; i++)
+ res->params [i + 1] = &mono_defaults.int_class->byval_arg;
+
+ res->ret = &mono_defaults.int_class->byval_arg;
+
+ g_hash_table_insert (sighash, (gpointer)arity, res);
+ LeaveCriticalSection (&jit_mutex);
+
+ return res;
+}
+
+static void
+handle_stobj (MonoCompile *cfg, MonoBasicBlock *bblock, MonoInst *dest, MonoInst *src, const unsigned char *ip, MonoClass *klass, gboolean to_end, gboolean native) {
+ MonoInst *iargs [3];
+ int n;
+ guint32 align = 0;
+
+ g_assert (klass);
+ /*
+ * This check breaks with spilled vars... need to handle it during verification anyway.
+ * g_assert (klass && klass == src->klass && klass == dest->klass);
+ */
+
+ if (native)
+ n = mono_class_native_size (klass, &align);
+ else
+ n = mono_class_value_size (klass, &align);
+
+ if ((cfg->opt & MONO_OPT_INTRINS) && !to_end && n <= sizeof (gpointer) * 5) {
+ MonoInst *inst;
+ MONO_INST_NEW (cfg, inst, OP_MEMCPY);
+ inst->inst_left = dest;
+ inst->inst_right = src;
+ inst->cil_code = ip;
+ inst->unused = n;
+ MONO_ADD_INS (bblock, inst);
+ return;
+ }
+ iargs [0] = dest;
+ iargs [1] = src;
+ NEW_ICONST (cfg, iargs [2], n);
+
+ mono_emit_native_call (cfg, bblock, helper_memcpy, helper_sig_memcpy, iargs, ip, FALSE, to_end);
+}
+
+static void
+handle_initobj (MonoCompile *cfg, MonoBasicBlock *bblock, MonoInst *dest, const guchar *ip, MonoClass *klass, MonoInst **stack_start, MonoInst **sp)
+{
+ MonoInst *iargs [2];
+ MonoInst *ins, *zero_int32;
+ int n;
+
+ NEW_ICONST (cfg, zero_int32, 0);
+
+ mono_class_init (klass);
+ n = mono_class_value_size (klass, NULL);
+ MONO_INST_NEW (cfg, ins, 0);
+ ins->cil_code = ip;
+ ins->inst_left = dest;
+ ins->inst_right = zero_int32;
+ switch (n) {
+ case 1:
+ ins->opcode = CEE_STIND_I1;
+ MONO_ADD_INS (bblock, ins);
+ break;
+ case 2:
+ ins->opcode = CEE_STIND_I2;
+ MONO_ADD_INS (bblock, ins);
+ break;
+ case 4:
+ ins->opcode = CEE_STIND_I4;
+ MONO_ADD_INS (bblock, ins);
+ break;
+ default:
+ if (n <= sizeof (gpointer) * 5) {
+ ins->opcode = OP_MEMSET;
+ ins->inst_imm = 0;
+ ins->unused = n;
+ MONO_ADD_INS (bblock, ins);
+ break;
+ }
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ NEW_ICONST (cfg, ins, n);
+ iargs [0] = dest;
+ iargs [1] = ins;
+ mono_emit_jit_icall (cfg, bblock, helper_initobj, iargs, ip);
+ break;
+ }
+}
+
+static int
+handle_alloc (MonoCompile *cfg, MonoBasicBlock *bblock, MonoClass *klass, const guchar *ip)
+{
+ MonoInst *iargs [2];
+ void *alloc_ftn;
+
+ if (cfg->opt & MONO_OPT_SHARED) {
+ NEW_DOMAINCONST (cfg, iargs [0]);
+ NEW_CLASSCONST (cfg, iargs [1], klass);
+
+ alloc_ftn = mono_object_new;
+ } else {
+ MonoVTable *vtable = mono_class_vtable (cfg->domain, klass);
+ gboolean pass_lw;
+
+ alloc_ftn = mono_class_get_allocation_ftn (vtable, &pass_lw);
+ if (pass_lw) {
+ guint32 lw = vtable->klass->instance_size;
+ lw = ((lw + (sizeof (gpointer) - 1)) & ~(sizeof (gpointer) - 1)) / sizeof (gpointer);
+ NEW_ICONST (cfg, iargs [0], lw);
+ NEW_VTABLECONST (cfg, iargs [1], vtable);
+ }
+ else
+ NEW_VTABLECONST (cfg, iargs [0], vtable);
+ }
+
+ return mono_emit_jit_icall (cfg, bblock, alloc_ftn, iargs, ip);
+}
+
+static MonoInst *
+handle_box (MonoCompile *cfg, MonoBasicBlock *bblock, MonoInst *val, const guchar *ip, MonoClass *klass)
+{
+ MonoInst *dest, *vtoffset, *add, *vstore;
+ int temp;
+
+ temp = handle_alloc (cfg, bblock, klass, ip);
+ NEW_TEMPLOAD (cfg, dest, temp);
+ NEW_ICONST (cfg, vtoffset, sizeof (MonoObject));
+ MONO_INST_NEW (cfg, add, OP_PADD);
+ add->inst_left = dest;
+ add->inst_right = vtoffset;
+ add->cil_code = ip;
+ add->klass = klass;
+ MONO_INST_NEW (cfg, vstore, CEE_STIND_I);
+ vstore->opcode = mono_type_to_stind (&klass->byval_arg);
+ vstore->cil_code = ip;
+ vstore->inst_left = add;
+ vstore->inst_right = val;
+
+ if (vstore->opcode == CEE_STOBJ) {
+ handle_stobj (cfg, bblock, add, val, ip, klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, vstore);
+
+ NEW_TEMPLOAD (cfg, dest, temp);
+ return dest;
+}
+
+static int
+handle_array_new (MonoCompile *cfg, MonoBasicBlock *bblock, int rank, MonoInst **sp, unsigned char *ip)
+{
+ MonoMethodSignature *esig;
+ char icall_name [256];
+ MonoJitICallInfo *info;
+
+ /* Need to register the icall so it gets an icall wrapper */
+ sprintf (icall_name, "ves_array_new_va_%d", rank);
+
+ info = mono_find_jit_icall_by_name (icall_name);
+ if (info == NULL) {
+ esig = mono_get_array_new_va_signature (rank);
+ info = mono_register_jit_icall (mono_array_new_va, g_strdup (icall_name), esig, FALSE);
+ }
+
+ cfg->flags |= MONO_CFG_HAS_VARARGS;
+
+ return mono_emit_native_call (cfg, bblock, mono_icall_get_wrapper (info), info->sig, sp, ip, TRUE, FALSE);
+}
+
+#define CODE_IS_STLOC(ip) (((ip) [0] >= CEE_STLOC_0 && (ip) [0] <= CEE_STLOC_3) || ((ip) [0] == CEE_STLOC_S))
+
+static gboolean
+mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method)
+{
+ MonoMethodHeader *header = mono_method_get_header (method);
+ MonoMethodSignature *signature = method->signature;
+ MonoVTable *vtable;
+ int i;
+
+#ifdef MONO_ARCH_HAVE_LMF_OPS
+ if (((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) &&
+ !MONO_TYPE_ISSTRUCT (signature->ret) && (method->klass->parent != mono_defaults.array_class))
+ return TRUE;
+#endif
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_NOINLINING) ||
+ (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) ||
+ (method->klass->marshalbyref) ||
+ !header || header->num_clauses ||
+ /* fixme: why cant we inline valuetype returns? */
+ MONO_TYPE_ISSTRUCT (signature->ret))
+ return FALSE;
+
+ /* its not worth to inline methods with valuetype arguments?? */
+ for (i = 0; i < signature->param_count; i++) {
+ if (MONO_TYPE_ISSTRUCT (signature->params [i])) {
+ return FALSE;
+ }
+ }
+
+ /*
+ * if we can initialize the class of the method right away, we do,
+ * otherwise we don't allow inlining if the class needs initialization,
+ * since it would mean inserting a call to mono_runtime_class_init()
+ * inside the inlined code
+ */
+ if (!(cfg->opt & MONO_OPT_SHARED)) {
+ vtable = mono_class_vtable (cfg->domain, method->klass);
+ if (method->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) {
+ if (cfg->run_cctors)
+ mono_runtime_class_init (vtable);
+ }
+ else if (!vtable->initialized && mono_class_needs_cctor_run (method->klass, NULL))
+ return FALSE;
+ } else {
+ /*
+ * If we're compiling for shared code
+ * the cctor will need to be run at aot method load time, for example,
+ * or at the end of the compilation of the inlining method.
+ */
+ if (mono_class_needs_cctor_run (method->klass, NULL) && !((method->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT)))
+ return FALSE;
+ }
+ //if (!MONO_TYPE_IS_VOID (signature->ret)) return FALSE;
+
+ /* also consider num_locals? */
+ if (getenv ("MONO_INLINELIMIT")) {
+ if (header->code_size < atoi (getenv ("MONO_INLINELIMIT"))) {
+ return TRUE;
+ }
+ } else if (header->code_size < 20)
+ return TRUE;
+
+ return FALSE;
+}
+
+static MonoInst*
+mini_get_ldelema_ins (MonoCompile *cfg, MonoBasicBlock *bblock, MonoMethod *cmethod, MonoInst **sp, unsigned char *ip, gboolean is_set)
+{
+ int temp, rank;
+ MonoInst *addr;
+ MonoMethodSignature *esig;
+ char icall_name [256];
+ MonoJitICallInfo *info;
+
+ rank = cmethod->signature->param_count - (is_set? 1: 0);
+
+ if (rank == 2 && (cfg->opt & MONO_OPT_INTRINS)) {
+ MonoInst *indexes;
+ NEW_GROUP (cfg, indexes, sp [1], sp [2]);
+ MONO_INST_NEW (cfg, addr, OP_LDELEMA2D);
+ addr->inst_left = sp [0];
+ addr->inst_right = indexes;
+ addr->cil_code = ip;
+ addr->type = STACK_MP;
+ addr->klass = cmethod->klass;
+ return addr;
+ }
+
+ /* Need to register the icall so it gets an icall wrapper */
+ sprintf (icall_name, "ves_array_element_address_%d", rank);
+
+ info = mono_find_jit_icall_by_name (icall_name);
+ if (info == NULL) {
+ esig = mono_get_element_address_signature (rank);
+ info = mono_register_jit_icall (ves_array_element_address, g_strdup (icall_name), esig, FALSE);
+ }
+
+ temp = mono_emit_native_call (cfg, bblock, mono_icall_get_wrapper (info), info->sig, sp, ip, FALSE, FALSE);
+ cfg->flags |= MONO_CFG_HAS_VARARGS;
+
+ NEW_TEMPLOAD (cfg, addr, temp);
+ return addr;
+}
+
+static MonoJitICallInfo **emul_opcode_map = NULL;
+
+static inline MonoJitICallInfo *
+mono_find_jit_opcode_emulation (int opcode)
+{
+ if (emul_opcode_map)
+ return emul_opcode_map [opcode];
+ else
+ return NULL;
+}
+
+static MonoInst*
+mini_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
+{
+ int pc, op;
+ MonoInst *ins;
+
+ static MonoClass *runtime_helpers_class = NULL;
+ if (! runtime_helpers_class)
+ runtime_helpers_class = mono_class_from_name (mono_defaults.corlib,
+ "System.Runtime.CompilerServices", "RuntimeHelpers");
+
+ if (cmethod->klass == mono_defaults.string_class) {
+ if (cmethod->name [0] != 'g')
+ return NULL;
+
+ if (strcmp (cmethod->name, "get_Chars") == 0)
+ op = OP_GETCHR;
+ else if (strcmp (cmethod->name, "get_Length") == 0)
+ op = OP_STRLEN;
+ else return NULL;
+ } else if (cmethod->klass == mono_defaults.object_class) {
+ if (strcmp (cmethod->name, "GetType") == 0)
+ op = OP_GETTYPE;
+ else
+ return NULL;
+ } else if (cmethod->klass == mono_defaults.array_class) {
+ if (strcmp (cmethod->name, "get_Rank") == 0)
+ op = OP_ARRAY_RANK;
+ else if (strcmp (cmethod->name, "get_Length") == 0)
+ op = CEE_LDLEN;
+ else
+ return NULL;
+ } else if (cmethod->klass == runtime_helpers_class) {
+ if (strcmp (cmethod->name, "get_OffsetToStringData") == 0) {
+ NEW_ICONST (cfg, ins, G_STRUCT_OFFSET (MonoString, chars));
+ return ins;
+ } else
+ return NULL;
+ } else if (cmethod->klass == mono_defaults.thread_class) {
+ if (strcmp (cmethod->name, "get_CurrentThread") == 0 && (ins = mono_arch_get_thread_intrinsic (cfg)))
+ return ins;
+ return NULL;
+ } else {
+ op = mono_arch_get_opcode_for_method (cfg, cmethod, fsig, args);
+ if (op < 0)
+ return NULL;
+ }
+ pc = fsig->param_count + fsig->hasthis;
+ MONO_INST_NEW (cfg, ins, op);
+
+ if (pc > 0) {
+ ins->inst_i0 = args [0];
+ if (pc > 1)
+ ins->inst_i1 = args [1];
+ }
+
+ return ins;
+}
+
+static void
+mono_save_args (MonoCompile *cfg, MonoBasicBlock *bblock, MonoMethodSignature *sig, MonoInst **sp, MonoInst **args)
+{
+ MonoInst *store, *temp;
+ int i;
+
+ g_assert (!MONO_TYPE_ISSTRUCT (sig->ret));
+
+ if (!sig->hasthis && sig->param_count == 0)
+ return;
+
+ if (sig->hasthis) {
+ if (sp [0]->opcode == OP_ICONST) {
+ *args++ = sp [0];
+ } else {
+ temp = mono_compile_create_var (cfg, type_from_stack_type (*sp), OP_LOCAL);
+ *args++ = temp;
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, *sp);
+ store->cil_code = sp [0]->cil_code;
+ MONO_ADD_INS (bblock, store);
+ }
+ sp++;
+ }
+
+ for (i = 0; i < sig->param_count; ++i) {
+ if (sp [0]->opcode == OP_ICONST) {
+ *args++ = sp [0];
+ } else {
+ temp = mono_compile_create_var (cfg, sig->params [i], OP_LOCAL);
+ *args++ = temp;
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, *sp);
+ store->cil_code = sp [0]->cil_code;
+ if (store->opcode == CEE_STOBJ) {
+ NEW_TEMPLOADA (cfg, store, temp->inst_c0);
+ handle_stobj (cfg, bblock, store, *sp, sp [0]->cil_code, temp->klass, FALSE, FALSE);
+ } else {
+ MONO_ADD_INS (bblock, store);
+ }
+ }
+ sp++;
+ }
+}
+
+static int
+inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoBasicBlock *bblock, MonoInst **sp,
+ guchar *ip, guint real_offset, GList *dont_inline, MonoBasicBlock **last_b, gboolean inline_allways)
+{
+ MonoInst *ins, *rvar = NULL;
+ MonoMethodHeader *cheader;
+ MonoBasicBlock *ebblock, *sbblock;
+ int i, costs, new_locals_offset;
+ MonoMethod *prev_inlined_method;
+
+ if (cfg->verbose_level > 2)
+ g_print ("INLINE START %p %s -> %s\n", cmethod, mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+
+ if (!cmethod->inline_info) {
+ mono_jit_stats.inlineable_methods++;
+ cmethod->inline_info = 1;
+ }
+ /* allocate space to store the return value */
+ if (!MONO_TYPE_IS_VOID (fsig->ret)) {
+ rvar = mono_compile_create_var (cfg, fsig->ret, OP_LOCAL);
+ }
+
+ /* allocate local variables */
+ cheader = mono_method_get_header (cmethod);
+ new_locals_offset = cfg->num_varinfo;
+ for (i = 0; i < cheader->num_locals; ++i)
+ mono_compile_create_var (cfg, cheader->locals [i], OP_LOCAL);
+
+ /* allocate starte and end blocks */
+ sbblock = NEW_BBLOCK (cfg);
+ sbblock->block_num = cfg->num_bblocks++;
+ sbblock->real_offset = real_offset;
+
+ ebblock = NEW_BBLOCK (cfg);
+ ebblock->block_num = cfg->num_bblocks++;
+ ebblock->real_offset = real_offset;
+
+ prev_inlined_method = cfg->inlined_method;
+ cfg->inlined_method = cmethod;
+
+ costs = mono_method_to_ir (cfg, cmethod, sbblock, ebblock, new_locals_offset, rvar, dont_inline, sp, real_offset, *ip == CEE_CALLVIRT);
+
+ cfg->inlined_method = prev_inlined_method;
+
+ if ((costs >= 0 && costs < 60) || inline_allways) {
+ if (cfg->verbose_level > 2)
+ g_print ("INLINE END %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+
+ mono_jit_stats.inlined_methods++;
+
+ /* always add some code to avoid block split failures */
+ MONO_INST_NEW (cfg, ins, CEE_NOP);
+ MONO_ADD_INS (bblock, ins);
+ ins->cil_code = ip;
+
+ bblock->next_bb = sbblock;
+ link_bblock (cfg, bblock, sbblock);
+
+ if (rvar) {
+ NEW_TEMPLOAD (cfg, ins, rvar->inst_c0);
+ *sp++ = ins;
+ }
+ *last_b = ebblock;
+ return costs + 1;
+ } else {
+ if (cfg->verbose_level > 2)
+ g_print ("INLINE ABORTED %s\n", mono_method_full_name (cmethod, TRUE));
+ }
+ return 0;
+}
+
+/*
+ * Some of these comments may well be out-of-date.
+ * Design decisions: we do a single pass over the IL code (and we do bblock
+ * splitting/merging in the few cases when it's required: a back jump to an IL
+ * address that was not already seen as bblock starting point).
+ * Code is validated as we go (full verification is still better left to metadata/verify.c).
+ * Complex operations are decomposed in simpler ones right away. We need to let the
+ * arch-specific code peek and poke inside this process somehow (except when the
+ * optimizations can take advantage of the full semantic info of coarse opcodes).
+ * All the opcodes of the form opcode.s are 'normalized' to opcode.
+ * MonoInst->opcode initially is the IL opcode or some simplification of that
+ * (OP_LOAD, OP_STORE). The arch-specific code may rearrange it to an arch-specific
+ * opcode with value bigger than OP_LAST.
+ * At this point the IR can be handed over to an interpreter, a dumb code generator
+ * or to the optimizing code generator that will translate it to SSA form.
+ *
+ * Profiling directed optimizations.
+ * We may compile by default with few or no optimizations and instrument the code
+ * or the user may indicate what methods to optimize the most either in a config file
+ * or through repeated runs where the compiler applies offline the optimizations to
+ * each method and then decides if it was worth it.
+ *
+ * TODO:
+ * * consider using an array instead of an hash table (bb_hash)
+ */
+
+#define CHECK_TYPE(ins) if (!(ins)->type) goto unverified
+#define CHECK_STACK(num) if ((sp - stack_start) < (num)) goto unverified
+#define CHECK_STACK_OVF(num) if (((sp - stack_start) + (num)) > header->max_stack) goto unverified
+#define CHECK_ARG(num) if ((unsigned)(num) >= (unsigned)num_args) goto unverified
+#define CHECK_LOCAL(num) if ((unsigned)(num) >= (unsigned)header->num_locals) goto unverified
+#define CHECK_OPSIZE(size) if (ip + size > end) goto unverified
+
+
+/* offset from br.s -> br like opcodes */
+#define BIG_BRANCH_OFFSET 13
+
+static int
+get_basic_blocks (MonoCompile *cfg, GHashTable *bbhash, MonoMethodHeader* header, guint real_offset, unsigned char *start, unsigned char *end, unsigned char **pos)
+{
+ unsigned char *ip = start;
+ unsigned char *target;
+ int i;
+ guint cli_addr;
+ MonoBasicBlock *bblock;
+ const MonoOpcode *opcode;
+
+ while (ip < end) {
+ cli_addr = ip - start;
+ i = mono_opcode_value ((const guint8 **)&ip, end);
+ if (i < 0)
+ goto unverified;
+ opcode = &mono_opcodes [i];
+ switch (opcode->argument) {
+ case MonoInlineNone:
+ ip++;
+ break;
+ case MonoInlineString:
+ case MonoInlineType:
+ case MonoInlineField:
+ case MonoInlineMethod:
+ case MonoInlineTok:
+ case MonoInlineSig:
+ case MonoShortInlineR:
+ case MonoInlineI:
+ ip += 5;
+ break;
+ case MonoInlineVar:
+ ip += 3;
+ break;
+ case MonoShortInlineVar:
+ case MonoShortInlineI:
+ ip += 2;
+ break;
+ case MonoShortInlineBrTarget:
+ target = start + cli_addr + 2 + (signed char)ip [1];
+ GET_BBLOCK (cfg, bbhash, bblock, target);
+ ip += 2;
+ break;
+ case MonoInlineBrTarget:
+ target = start + cli_addr + 5 + (gint32)read32 (ip + 1);
+ GET_BBLOCK (cfg, bbhash, bblock, target);
+ ip += 5;
+ break;
+ case MonoInlineSwitch: {
+ guint32 n = read32 (ip + 1);
+ guint32 j;
+ ip += 5;
+ cli_addr += 5 + 4 * n;
+ target = start + cli_addr;
+ GET_BBLOCK (cfg, bbhash, bblock, target);
+
+ for (j = 0; j < n; ++j) {
+ target = start + cli_addr + (gint32)read32 (ip);
+ GET_BBLOCK (cfg, bbhash, bblock, target);
+ ip += 4;
+ }
+ break;
+ }
+ case MonoInlineR:
+ case MonoInlineI8:
+ ip += 9;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+ return 0;
+unverified:
+ *pos = ip;
+ return 1;
+}
+
+static MonoInst*
+emit_tree (MonoCompile *cfg, MonoBasicBlock *bblock, MonoInst *ins)
+{
+ MonoInst *store, *temp, *load;
+ temp = mono_compile_create_var (cfg, type_from_stack_type (ins), OP_LOCAL);
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, ins);
+ store->cil_code = ins->cil_code;
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, load, temp->inst_c0);
+ load->cil_code = ins->cil_code;
+ return load;
+}
+
+/*
+ * mono_method_to_ir: translates IL into basic blocks containing trees
+ */
+static int
+mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock,
+ int locals_offset, MonoInst *return_var, GList *dont_inline, MonoInst **inline_args,
+ guint inline_offset, gboolean is_virtual_call)
+{
+ MonoInst *zero_int32, *zero_int64, *zero_ptr, *zero_obj, *zero_r8;
+ MonoInst *ins, **sp, **stack_start;
+ MonoBasicBlock *bblock, *tblock = NULL, *init_localsbb = NULL;
+ GHashTable *bbhash;
+ MonoMethod *cmethod;
+ MonoInst **arg_array;
+ MonoMethodHeader *header;
+ MonoImage *image;
+ guint32 token, ins_flag;
+ MonoClass *klass;
+ MonoClass *constrained_call = NULL;
+ unsigned char *ip, *end, *target, *err_pos;
+ static double r8_0 = 0.0;
+ MonoMethodSignature *sig;
+ MonoGenericContext *generic_context = NULL;
+ MonoGenericContainer *generic_container = NULL;
+ MonoType **param_types;
+ GList *bb_recheck = NULL, *tmp;
+ int i, n, start_new_bblock, align;
+ int num_calls = 0, inline_costs = 0;
+ int *filter_lengths = NULL;
+ int breakpoint_id = 0;
+ guint real_offset, num_args;
+
+ image = method->klass->image;
+ header = mono_method_get_header (method);
+ generic_container = ((MonoMethodNormal *)method)->generic_container;
+ sig = method->signature;
+ num_args = sig->hasthis + sig->param_count;
+ ip = (unsigned char*)header->code;
+ end = ip + header->code_size;
+ mono_jit_stats.cil_code_size += header->code_size;
+
+ if (method->signature->is_inflated)
+ generic_context = ((MonoMethodInflated *) method)->context;
+ else if (generic_container)
+ generic_context = generic_container->context;
+
+ if (cfg->method == method) {
+ real_offset = 0;
+ bbhash = cfg->bb_hash;
+ } else {
+ real_offset = inline_offset;
+ bbhash = g_hash_table_new (g_direct_hash, NULL);
+ }
+
+ if (cfg->verbose_level > 2)
+ g_print ("method to IR %s\n", mono_method_full_name (method, TRUE));
+
+ dont_inline = g_list_prepend (dont_inline, method);
+ if (cfg->method == method) {
+
+ if (cfg->prof_options & MONO_PROFILE_INS_COVERAGE)
+ cfg->coverage_info = mono_profiler_coverage_alloc (cfg->method, header->code_size);
+
+ /* ENTRY BLOCK */
+ cfg->bb_entry = start_bblock = NEW_BBLOCK (cfg);
+ start_bblock->cil_code = NULL;
+ start_bblock->cil_length = 0;
+ start_bblock->block_num = cfg->num_bblocks++;
+
+ /* EXIT BLOCK */
+ cfg->bb_exit = end_bblock = NEW_BBLOCK (cfg);
+ end_bblock->cil_code = NULL;
+ end_bblock->cil_length = 0;
+ end_bblock->block_num = cfg->num_bblocks++;
+ g_assert (cfg->num_bblocks == 2);
+
+ arg_array = alloca (sizeof (MonoInst *) * num_args);
+ for (i = num_args - 1; i >= 0; i--)
+ arg_array [i] = cfg->varinfo [i];
+
+ if (header->num_clauses) {
+ int size = sizeof (int) * header->num_clauses;
+ filter_lengths = alloca (size);
+ memset (filter_lengths, 0, size);
+
+ cfg->spvars = g_hash_table_new (NULL, NULL);
+ }
+ /* handle exception clauses */
+ for (i = 0; i < header->num_clauses; ++i) {
+ //unsigned char *p = ip;
+ MonoExceptionClause *clause = &header->clauses [i];
+ GET_BBLOCK (cfg, bbhash, tblock, ip + clause->try_offset);
+ tblock->real_offset = clause->try_offset;
+ GET_BBLOCK (cfg, bbhash, tblock, ip + clause->handler_offset);
+ tblock->real_offset = clause->handler_offset;
+
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY ||
+ clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ MONO_INST_NEW (cfg, ins, OP_START_HANDLER);
+ MONO_ADD_INS (tblock, ins);
+ }
+
+ /*g_print ("clause try IL_%04x to IL_%04x handler %d at IL_%04x to IL_%04x\n", clause->try_offset, clause->try_offset + clause->try_len, clause->flags, clause->handler_offset, clause->handler_offset + clause->handler_len);
+ while (p < end) {
+ g_print ("%s", mono_disasm_code_one (NULL, method, p, &p));
+ }*/
+ /* catch and filter blocks get the exception object on the stack */
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE ||
+ clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ /* mostly like handle_stack_args (), but just sets the input args */
+ /* g_print ("handling clause at IL_%04x\n", clause->handler_offset); */
+ if (!cfg->exvar) {
+ cfg->exvar = mono_compile_create_var (cfg, &mono_defaults.object_class->byval_arg, OP_LOCAL);
+ /* prevent it from being register allocated */
+ cfg->exvar->flags |= MONO_INST_INDIRECT;
+ }
+ tblock->in_scount = 1;
+ tblock->in_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*));
+ tblock->in_stack [0] = cfg->exvar;
+
+ if (clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ GET_BBLOCK (cfg, bbhash, tblock, ip + clause->data.filter_offset);
+ tblock->real_offset = clause->data.filter_offset;
+ tblock->in_scount = 1;
+ tblock->in_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*));
+ tblock->in_stack [0] = cfg->exvar;
+ MONO_INST_NEW (cfg, ins, OP_START_HANDLER);
+ MONO_ADD_INS (tblock, ins);
+ }
+ }
+ }
+
+ } else {
+ arg_array = alloca (sizeof (MonoInst *) * num_args);
+ mono_save_args (cfg, start_bblock, sig, inline_args, arg_array);
+ }
+
+ /* FIRST CODE BLOCK */
+ bblock = NEW_BBLOCK (cfg);
+ bblock->cil_code = ip;
+
+ ADD_BBLOCK (cfg, bbhash, bblock);
+
+ if (cfg->method == method) {
+ breakpoint_id = mono_debugger_method_has_breakpoint (method);
+ if (breakpoint_id && (mono_debug_format != MONO_DEBUG_FORMAT_DEBUGGER)) {
+ MONO_INST_NEW (cfg, ins, CEE_BREAK);
+ MONO_ADD_INS (bblock, ins);
+ }
+ }
+
+ if ((header->init_locals || (cfg->method == method && (cfg->opt & MONO_OPT_SHARED))) || mono_compile_aot) {
+ /* we use a separate basic block for the initialization code */
+ cfg->bb_init = init_localsbb = NEW_BBLOCK (cfg);
+ init_localsbb->real_offset = real_offset;
+ start_bblock->next_bb = init_localsbb;
+ init_localsbb->next_bb = bblock;
+ link_bblock (cfg, start_bblock, init_localsbb);
+ link_bblock (cfg, init_localsbb, bblock);
+ init_localsbb->block_num = cfg->num_bblocks++;
+ } else {
+ start_bblock->next_bb = bblock;
+ link_bblock (cfg, start_bblock, bblock);
+ }
+
+ if (get_basic_blocks (cfg, bbhash, header, real_offset, ip, end, &err_pos)) {
+ ip = err_pos;
+ goto unverified;
+ }
+
+ mono_debug_init_method (cfg, bblock, breakpoint_id);
+
+ param_types = mono_mempool_alloc (cfg->mempool, sizeof (MonoType*) * num_args);
+ if (sig->hasthis)
+ param_types [0] = method->klass->valuetype?&method->klass->this_arg:&method->klass->byval_arg;
+ for (n = 0; n < sig->param_count; ++n)
+ param_types [n + sig->hasthis] = sig->params [n];
+
+ /* do this somewhere outside - not here */
+ NEW_ICONST (cfg, zero_int32, 0);
+ NEW_ICONST (cfg, zero_int64, 0);
+ zero_int64->type = STACK_I8;
+ NEW_PCONST (cfg, zero_ptr, 0);
+ NEW_PCONST (cfg, zero_obj, 0);
+ zero_obj->type = STACK_OBJ;
+
+ MONO_INST_NEW (cfg, zero_r8, OP_R8CONST);
+ zero_r8->type = STACK_R8;
+ zero_r8->inst_p0 = &r8_0;
+
+ /* add a check for this != NULL to inlined methods */
+ if (is_virtual_call) {
+ MONO_INST_NEW (cfg, ins, OP_CHECK_THIS);
+ NEW_ARGLOAD (cfg, ins->inst_left, 0);
+ ins->cil_code = ip;
+ MONO_ADD_INS (bblock, ins);
+ }
+
+ /* we use a spare stack slot in SWITCH and NEWOBJ and others */
+ stack_start = sp = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst*) * (header->max_stack + 1));
+
+ ins_flag = 0;
+ start_new_bblock = 0;
+ while (ip < end) {
+
+ if (cfg->method == method)
+ real_offset = ip - header->code;
+ else
+ real_offset = inline_offset;
+
+ if (start_new_bblock) {
+ bblock->cil_length = ip - bblock->cil_code;
+ if (start_new_bblock == 2) {
+ g_assert (ip == tblock->cil_code);
+ } else {
+ GET_BBLOCK (cfg, bbhash, tblock, ip);
+ }
+ bblock->next_bb = tblock;
+ bblock = tblock;
+ start_new_bblock = 0;
+ for (i = 0; i < bblock->in_scount; ++i) {
+ if (cfg->verbose_level > 3)
+ g_print ("loading %d from temp %d\n", i, bblock->in_stack [i]->inst_c0);
+ NEW_TEMPLOAD (cfg, ins, bblock->in_stack [i]->inst_c0);
+ *sp++ = ins;
+ }
+ } else {
+ if ((tblock = g_hash_table_lookup (bbhash, ip)) && (tblock != bblock)) {
+ link_bblock (cfg, bblock, tblock);
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ bblock->next_bb = tblock;
+ bblock = tblock;
+ for (i = 0; i < bblock->in_scount; ++i) {
+ if (cfg->verbose_level > 3)
+ g_print ("loading %d from temp %d\n", i, bblock->in_stack [i]->inst_c0);
+ NEW_TEMPLOAD (cfg, ins, bblock->in_stack [i]->inst_c0);
+ *sp++ = ins;
+ }
+ }
+ }
+
+ bblock->real_offset = real_offset;
+
+ if ((cfg->method == method) && cfg->coverage_info) {
+ MonoInst *store, *one;
+ guint32 cil_offset = ip - header->code;
+ cfg->coverage_info->data [cil_offset].cil_code = ip;
+
+ /* TODO: Use an increment here */
+ NEW_ICONST (cfg, one, 1);
+ one->cil_code = ip;
+
+ NEW_PCONST (cfg, ins, &(cfg->coverage_info->data [cil_offset].count));
+ ins->cil_code = ip;
+
+ MONO_INST_NEW (cfg, store, CEE_STIND_I);
+ store->cil_code = ip;
+ store->inst_left = ins;
+ store->inst_right = one;
+
+ MONO_ADD_INS (bblock, store);
+ }
+
+ if (cfg->verbose_level > 3)
+ g_print ("converting (in B%d: stack: %d) %s", bblock->block_num, sp-stack_start, mono_disasm_code_one (NULL, method, ip, NULL));
+
+ switch (*ip) {
+ case CEE_NOP:
+ ++ip;
+ break;
+ case CEE_BREAK:
+ MONO_INST_NEW (cfg, ins, CEE_BREAK);
+ ins->cil_code = ip++;
+ MONO_ADD_INS (bblock, ins);
+ break;
+ case CEE_LDARG_0:
+ case CEE_LDARG_1:
+ case CEE_LDARG_2:
+ case CEE_LDARG_3:
+ CHECK_STACK_OVF (1);
+ n = (*ip)-CEE_LDARG_0;
+ CHECK_ARG (n);
+ NEW_ARGLOAD (cfg, ins, n);
+ ins->cil_code = ip++;
+ *sp++ = ins;
+ break;
+ case CEE_LDLOC_0:
+ case CEE_LDLOC_1:
+ case CEE_LDLOC_2:
+ case CEE_LDLOC_3:
+ CHECK_STACK_OVF (1);
+ n = (*ip)-CEE_LDLOC_0;
+ CHECK_LOCAL (n);
+ NEW_LOCLOAD (cfg, ins, n);
+ ins->cil_code = ip++;
+ *sp++ = ins;
+ break;
+ case CEE_STLOC_0:
+ case CEE_STLOC_1:
+ case CEE_STLOC_2:
+ case CEE_STLOC_3:
+ CHECK_STACK (1);
+ n = (*ip)-CEE_STLOC_0;
+ CHECK_LOCAL (n);
+ --sp;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ NEW_LOCSTORE (cfg, ins, n, *sp);
+ ins->cil_code = ip;
+ if (ins->opcode == CEE_STOBJ) {
+ NEW_LOCLOADA (cfg, ins, n);
+ handle_stobj (cfg, bblock, ins, *sp, ip, ins->klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, ins);
+ ++ip;
+ inline_costs += 1;
+ break;
+ case CEE_LDARG_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK_OVF (1);
+ CHECK_ARG (ip [1]);
+ NEW_ARGLOAD (cfg, ins, ip [1]);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 2;
+ break;
+ case CEE_LDARGA_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK_OVF (1);
+ CHECK_ARG (ip [1]);
+ NEW_ARGLOADA (cfg, ins, ip [1]);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 2;
+ break;
+ case CEE_STARG_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK (1);
+ --sp;
+ CHECK_ARG (ip [1]);
+ NEW_ARGSTORE (cfg, ins, ip [1], *sp);
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ ins->cil_code = ip;
+ if (ins->opcode == CEE_STOBJ) {
+ NEW_ARGLOADA (cfg, ins, ip [1]);
+ handle_stobj (cfg, bblock, ins, *sp, ip, ins->klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, ins);
+ ip += 2;
+ break;
+ case CEE_LDLOC_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK_OVF (1);
+ CHECK_LOCAL (ip [1]);
+ NEW_LOCLOAD (cfg, ins, ip [1]);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 2;
+ break;
+ case CEE_LDLOCA_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK_OVF (1);
+ CHECK_LOCAL (ip [1]);
+ NEW_LOCLOADA (cfg, ins, ip [1]);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 2;
+ break;
+ case CEE_STLOC_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK (1);
+ --sp;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ CHECK_LOCAL (ip [1]);
+ NEW_LOCSTORE (cfg, ins, ip [1], *sp);
+ ins->cil_code = ip;
+ if (ins->opcode == CEE_STOBJ) {
+ NEW_LOCLOADA (cfg, ins, ip [1]);
+ handle_stobj (cfg, bblock, ins, *sp, ip, ins->klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, ins);
+ ip += 2;
+ inline_costs += 1;
+ break;
+ case CEE_LDNULL:
+ CHECK_STACK_OVF (1);
+ NEW_PCONST (cfg, ins, NULL);
+ ins->cil_code = ip;
+ ins->type = STACK_OBJ;
+ ++ip;
+ *sp++ = ins;
+ break;
+ case CEE_LDC_I4_M1:
+ CHECK_STACK_OVF (1);
+ NEW_ICONST (cfg, ins, -1);
+ ins->cil_code = ip;
+ ++ip;
+ *sp++ = ins;
+ break;
+ case CEE_LDC_I4_0:
+ case CEE_LDC_I4_1:
+ case CEE_LDC_I4_2:
+ case CEE_LDC_I4_3:
+ case CEE_LDC_I4_4:
+ case CEE_LDC_I4_5:
+ case CEE_LDC_I4_6:
+ case CEE_LDC_I4_7:
+ case CEE_LDC_I4_8:
+ CHECK_STACK_OVF (1);
+ NEW_ICONST (cfg, ins, (*ip) - CEE_LDC_I4_0);
+ ins->cil_code = ip;
+ ++ip;
+ *sp++ = ins;
+ break;
+ case CEE_LDC_I4_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK_OVF (1);
+ ++ip;
+ NEW_ICONST (cfg, ins, *((signed char*)ip));
+ ins->cil_code = ip;
+ ++ip;
+ *sp++ = ins;
+ break;
+ case CEE_LDC_I4:
+ CHECK_OPSIZE (5);
+ CHECK_STACK_OVF (1);
+ NEW_ICONST (cfg, ins, (gint32)read32 (ip + 1));
+ ins->cil_code = ip;
+ ip += 5;
+ *sp++ = ins;
+ break;
+ case CEE_LDC_I8:
+ CHECK_OPSIZE (9);
+ CHECK_STACK_OVF (1);
+ MONO_INST_NEW (cfg, ins, OP_I8CONST);
+ ins->cil_code = ip;
+ ins->type = STACK_I8;
+ ++ip;
+ ins->inst_l = (gint64)read64 (ip);
+ ip += 8;
+ *sp++ = ins;
+ break;
+ case CEE_LDC_R4: {
+ float *f = mono_mempool_alloc (cfg->domain->mp, sizeof (float));
+ CHECK_OPSIZE (5);
+ CHECK_STACK_OVF (1);
+ MONO_INST_NEW (cfg, ins, OP_R4CONST);
+ ins->type = STACK_R8;
+ ++ip;
+ readr4 (ip, f);
+ ins->inst_p0 = f;
+ ip += 4;
+ *sp++ = ins;
+ break;
+ }
+ case CEE_LDC_R8: {
+ double *d = mono_mempool_alloc (cfg->domain->mp, sizeof (double));
+ CHECK_OPSIZE (9);
+ CHECK_STACK_OVF (1);
+ MONO_INST_NEW (cfg, ins, OP_R8CONST);
+ ins->type = STACK_R8;
+ ++ip;
+ readr8 (ip, d);
+ ins->inst_p0 = d;
+ ip += 8;
+ *sp++ = ins;
+ break;
+ }
+ case CEE_DUP: {
+ MonoInst *temp, *store;
+ CHECK_STACK (1);
+ CHECK_STACK_OVF (1);
+ sp--;
+ ins = *sp;
+
+ /*
+ * small optimization: if the loaded value was from a local already,
+ * just load it twice.
+ */
+ if (ins->ssa_op == MONO_SSA_LOAD &&
+ (ins->inst_i0->opcode == OP_LOCAL || ins->inst_i0->opcode == OP_ARG)) {
+ sp++;
+ MONO_INST_NEW (cfg, temp, 0);
+ *temp = *ins;
+ temp->cil_code = ip;
+ *sp++ = temp;
+ } else {
+ temp = mono_compile_create_var (cfg, type_from_stack_type (ins), OP_LOCAL);
+ temp->cil_code = ip;
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, ins);
+ store->cil_code = ip;
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, ins, temp->inst_c0);
+ *sp++ = ins;
+ ins->cil_code = ip;
+ NEW_TEMPLOAD (cfg, ins, temp->inst_c0);
+ *sp++ = ins;
+ ins->cil_code = ip;
+ }
+ ++ip;
+ inline_costs += 2;
+ break;
+ }
+ case CEE_POP:
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, CEE_POP);
+ MONO_ADD_INS (bblock, ins);
+ ins->cil_code = ip++;
+ --sp;
+ ins->inst_i0 = *sp;
+ break;
+ case CEE_JMP:
+ CHECK_OPSIZE (5);
+ if (stack_start != sp)
+ goto unverified;
+ MONO_INST_NEW (cfg, ins, CEE_JMP);
+ token = read32 (ip + 1);
+ /* FIXME: check the signature matches */
+ cmethod = mono_get_method_full (image, token, NULL, generic_context);
+ ins->inst_p0 = cmethod;
+ MONO_ADD_INS (bblock, ins);
+ ip += 5;
+ start_new_bblock = 1;
+ break;
+ case CEE_CALLI:
+ case CEE_CALL:
+ case CEE_CALLVIRT: {
+ MonoInst *addr = NULL;
+ MonoMethodSignature *fsig = NULL;
+ int temp, array_rank = 0;
+ int virtual = *ip == CEE_CALLVIRT;
+
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+
+ if (*ip == CEE_CALLI) {
+ cmethod = NULL;
+ CHECK_STACK (1);
+ --sp;
+ addr = *sp;
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ fsig = (MonoMethodSignature *)mono_method_get_wrapper_data (method, token);
+ else
+ fsig = mono_metadata_parse_signature (image, token);
+
+ n = fsig->param_count + fsig->hasthis;
+ } else {
+ if (method->wrapper_type != MONO_WRAPPER_NONE) {
+ cmethod = (MonoMethod *)mono_method_get_wrapper_data (method, token);
+ } else if (constrained_call) {
+ cmethod = mono_get_method_constrained (image, token, constrained_call, generic_context);
+ } else {
+ cmethod = mono_get_method_full (image, token, NULL, generic_context);
+ }
+
+ g_assert (cmethod);
+
+ if (!cmethod->klass->inited)
+ mono_class_init (cmethod->klass);
+
+ if (cmethod->signature->pinvoke) {
+ MonoMethod *wrapper = mono_marshal_get_native_wrapper (cmethod);
+ fsig = wrapper->signature;
+ } else {
+ fsig = mono_method_get_signature (cmethod, image, token);
+ }
+
+ n = fsig->param_count + fsig->hasthis;
+
+ if (cmethod->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL &&
+ cmethod->klass->parent == mono_defaults.array_class) {
+ array_rank = cmethod->klass->rank;
+ }
+
+ if (cmethod->string_ctor)
+ g_assert_not_reached ();
+
+ }
+
+ CHECK_STACK (n);
+
+ //g_assert (!virtual || fsig->hasthis);
+
+ sp -= n;
+
+ if (constrained_call) {
+ /*
+ * We have the `constrained.' prefix opcode.
+ */
+ if (constrained_call->valuetype && !cmethod->klass->valuetype) {
+ MonoInst *load;
+ /*
+ * The type parameter is instantiated as a valuetype,
+ * but that type doesn't override the method we're
+ * calling, so we need to box `this'.
+ * sp [0] is a pointer to the data: we need the value
+ * in handle_box (), so load it here.
+ */
+ MONO_INST_NEW (cfg, load, mono_type_to_ldind (&constrained_call->byval_arg));
+ type_to_eval_stack_type (&constrained_call->byval_arg, load);
+ load->cil_code = ip;
+ load->inst_left = sp [0];
+ sp [0] = handle_box (cfg, bblock, load, ip, constrained_call);
+ } else if (!constrained_call->valuetype) {
+ MonoInst *ins;
+
+ /*
+ * The type parameter is instantiated as a reference
+ * type. We have a managed pointer on the stack, so
+ * we need to dereference it here.
+ */
+
+ MONO_INST_NEW (cfg, ins, CEE_LDIND_REF);
+ ins->cil_code = ip;
+ ins->inst_i0 = sp [0];
+ ins->type = STACK_OBJ;
+ sp [0] = ins;
+ } else if (cmethod->klass->valuetype)
+ virtual = 0;
+ constrained_call = NULL;
+ }
+
+ if (*ip != CEE_CALLI && check_call_signature (cfg, fsig, sp))
+ goto unverified;
+
+ if ((ins_flag & MONO_INST_TAILCALL) && cmethod && (*ip == CEE_CALL) && (mono_metadata_signature_equal (method->signature, cmethod->signature))) {
+ int i;
+ /* FIXME: This assumes the two methods has the same number and type of arguments */
+ for (i = 0; i < n; ++i) {
+ /* Check if argument is the same */
+ NEW_ARGLOAD (cfg, ins, i);
+ if ((ins->opcode == sp [i]->opcode) && (ins->inst_i0 == sp [i]->inst_i0))
+ continue;
+
+ /* Prevent argument from being register allocated */
+ arg_array [i]->flags |= MONO_INST_VOLATILE;
+ NEW_ARGSTORE (cfg, ins, i, sp [i]);
+ ins->cil_code = ip;
+ if (ins->opcode == CEE_STOBJ) {
+ NEW_ARGLOADA (cfg, ins, i);
+ handle_stobj (cfg, bblock, ins, sp [i], sp [i]->cil_code, ins->klass, FALSE, FALSE);
+ }
+ else
+ MONO_ADD_INS (bblock, ins);
+ }
+ MONO_INST_NEW (cfg, ins, CEE_JMP);
+ ins->cil_code = ip;
+ ins->inst_p0 = cmethod;
+ ins->inst_p1 = arg_array [0];
+ MONO_ADD_INS (bblock, ins);
+ start_new_bblock = 1;
+ /* skip CEE_RET as well */
+ ip += 6;
+ ins_flag = 0;
+ break;
+ }
+ if (cmethod && (cfg->opt & MONO_OPT_INTRINS) && (ins = mini_get_opcode_for_method (cfg, cmethod, fsig, sp))) {
+ ins->cil_code = ip;
+
+ if (MONO_TYPE_IS_VOID (fsig->ret)) {
+ MONO_ADD_INS (bblock, ins);
+ } else {
+ type_to_eval_stack_type (fsig->ret, ins);
+ *sp = ins;
+ sp++;
+ }
+
+ ip += 5;
+ break;
+ }
+
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+ if ((cfg->opt & MONO_OPT_INLINE) && cmethod &&
+ (!virtual || !(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) || (cmethod->flags & METHOD_ATTRIBUTE_FINAL)) &&
+ mono_method_check_inlining (cfg, cmethod) &&
+ !g_list_find (dont_inline, cmethod)) {
+ int costs;
+ MonoBasicBlock *ebblock;
+ gboolean allways = FALSE;
+
+ if ((cmethod->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (cmethod->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
+ cmethod = mono_marshal_get_native_wrapper (cmethod);
+ allways = TRUE;
+ }
+
+ if ((costs = inline_method (cfg, cmethod, fsig, bblock, sp, ip, real_offset, dont_inline, &ebblock, allways))) {
+ ip += 5;
+ real_offset += 5;
+
+ GET_BBLOCK (cfg, bbhash, bblock, ip);
+ ebblock->next_bb = bblock;
+ link_bblock (cfg, ebblock, bblock);
+
+ if (!MONO_TYPE_IS_VOID (fsig->ret))
+ sp++;
+
+ /* indicates start of a new block, and triggers a load of all
+ stack arguments at bb boundarie */
+ bblock = ebblock;
+
+ inline_costs += costs;
+ break;
+ }
+ }
+
+ inline_costs += 10 * num_calls++;
+
+ /* tail recursion elimination */
+ if ((cfg->opt & MONO_OPT_TAILC) && *ip == CEE_CALL && cmethod == method && ip [5] == CEE_RET) {
+ gboolean has_vtargs = FALSE;
+ int i;
+
+ /* keep it simple */
+ for (i = fsig->param_count - 1; i >= 0; i--) {
+ if (MONO_TYPE_ISSTRUCT (cmethod->signature->params [i]))
+ has_vtargs = TRUE;
+ }
+
+ if (!has_vtargs) {
+ for (i = 0; i < n; ++i) {
+ NEW_ARGSTORE (cfg, ins, i, sp [i]);
+ ins->cil_code = ip;
+ MONO_ADD_INS (bblock, ins);
+ }
+ MONO_INST_NEW (cfg, ins, CEE_BR);
+ ins->cil_code = ip;
+ MONO_ADD_INS (bblock, ins);
+ tblock = start_bblock->out_bb [0];
+ link_bblock (cfg, bblock, tblock);
+ ins->inst_target_bb = tblock;
+ start_new_bblock = 1;
+ ip += 5;
+
+ if (!MONO_TYPE_IS_VOID (fsig->ret)) {
+ /* just create a dummy - the value is never used */
+ ins = mono_compile_create_var (cfg, fsig->ret, OP_LOCAL);
+ NEW_TEMPLOAD (cfg, *sp, ins->inst_c0);
+ sp++;
+ }
+
+ break;
+ }
+ }
+
+ if (*ip == CEE_CALLI) {
+
+ if ((temp = mono_emit_calli (cfg, bblock, fsig, sp, addr, ip)) != -1) {
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp++;
+ }
+
+ } else if (array_rank) {
+ MonoInst *addr;
+
+ if (strcmp (cmethod->name, "Set") == 0) { /* array Set */
+ if (sp [fsig->param_count]->type == STACK_OBJ) {
+ MonoInst *iargs [2];
+ MonoInst *array, *to_store, *store;
+
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+ array = mono_compile_create_var (cfg, type_from_stack_type (sp [0]), OP_LOCAL);
+ NEW_TEMPSTORE (cfg, store, array->inst_c0, sp [0]);
+ store->cil_code = ip;
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, iargs [0], array->inst_c0);
+
+ to_store = mono_compile_create_var (cfg, type_from_stack_type (sp [fsig->param_count]), OP_LOCAL);
+ NEW_TEMPSTORE (cfg, store, to_store->inst_c0, sp [fsig->param_count]);
+ store->cil_code = ip;
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, iargs [1], to_store->inst_c0);
+
+ /*
+ * We first save the args for the call so that the args are copied to the stack
+ * and a new instruction tree for them is created. If we don't do this,
+ * the same MonoInst is added to two different trees and this is not
+ * allowed by burg.
+ */
+ mono_emit_jit_icall (cfg, bblock, helper_stelem_ref_check, iargs, ip);
+
+ NEW_TEMPLOAD (cfg, sp [0], array->inst_c0);
+ NEW_TEMPLOAD (cfg, sp [fsig->param_count], to_store->inst_c0);
+ }
+
+ addr = mini_get_ldelema_ins (cfg, bblock, cmethod, sp, ip, TRUE);
+ NEW_INDSTORE (cfg, ins, addr, sp [fsig->param_count], fsig->params [fsig->param_count - 1]);
+ ins->cil_code = ip;
+ if (ins->opcode == CEE_STOBJ) {
+ handle_stobj (cfg, bblock, addr, sp [fsig->param_count], ip, mono_class_from_mono_type (fsig->params [fsig->param_count-1]), FALSE, FALSE);
+ } else {
+ MONO_ADD_INS (bblock, ins);
+ }
+
+ } else if (strcmp (cmethod->name, "Get") == 0) { /* array Get */
+ addr = mini_get_ldelema_ins (cfg, bblock, cmethod, sp, ip, FALSE);
+ NEW_INDLOAD (cfg, ins, addr, fsig->ret);
+ ins->cil_code = ip;
+
+ *sp++ = ins;
+ } else if (strcmp (cmethod->name, "Address") == 0) { /* array Address */
+ addr = mini_get_ldelema_ins (cfg, bblock, cmethod, sp, ip, FALSE);
+ *sp++ = addr;
+ } else {
+ g_assert_not_reached ();
+ }
+
+ } else {
+ if (0 && CODE_IS_STLOC (ip + 5) && (!MONO_TYPE_ISSTRUCT (fsig->ret)) && (!MONO_TYPE_IS_VOID (fsig->ret) || cmethod->string_ctor)) {
+ /* no need to spill */
+ ins = (MonoInst*)mono_emit_method_call (cfg, bblock, cmethod, fsig, sp, ip, virtual ? sp [0] : NULL);
+ *sp++ = ins;
+ } else {
+ if ((temp = mono_emit_method_call_spilled (cfg, bblock, cmethod, fsig, sp, ip, virtual ? sp [0] : NULL)) != -1) {
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp++;
+ }
+ }
+ }
+
+ ip += 5;
+ break;
+ }
+ case CEE_RET:
+ if (cfg->method != method) {
+ /* return from inlined methode */
+ if (return_var) {
+ MonoInst *store;
+ CHECK_STACK (1);
+ --sp;
+ //g_assert (returnvar != -1);
+ NEW_TEMPSTORE (cfg, store, return_var->inst_c0, *sp);
+ store->cil_code = sp [0]->cil_code;
+ if (store->opcode == CEE_STOBJ) {
+ g_assert_not_reached ();
+ NEW_TEMPLOADA (cfg, store, return_var->inst_c0);
+ handle_stobj (cfg, bblock, store, *sp, sp [0]->cil_code, return_var->klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, store);
+ }
+ } else {
+ if (cfg->ret) {
+ g_assert (!return_var);
+ CHECK_STACK (1);
+ --sp;
+ MONO_INST_NEW (cfg, ins, CEE_NOP);
+ ins->opcode = mono_type_to_stind (method->signature->ret);
+ if (ins->opcode == CEE_STOBJ) {
+ NEW_RETLOADA (cfg, ins);
+ handle_stobj (cfg, bblock, ins, *sp, ip, ins->klass, FALSE, FALSE);
+ } else {
+ ins->opcode = OP_SETRET;
+ ins->cil_code = ip;
+ ins->inst_i0 = *sp;;
+ ins->inst_i1 = NULL;
+ MONO_ADD_INS (bblock, ins);
+ }
+ }
+ }
+ if (sp != stack_start)
+ goto unverified;
+ MONO_INST_NEW (cfg, ins, CEE_BR);
+ ins->cil_code = ip++;
+ ins->inst_target_bb = end_bblock;
+ MONO_ADD_INS (bblock, ins);
+ link_bblock (cfg, bblock, end_bblock);
+ start_new_bblock = 1;
+ break;
+ case CEE_BR_S:
+ CHECK_OPSIZE (2);
+ MONO_INST_NEW (cfg, ins, CEE_BR);
+ ins->cil_code = ip++;
+ MONO_ADD_INS (bblock, ins);
+ target = ip + 1 + (signed char)(*ip);
+ ++ip;
+ GET_BBLOCK (cfg, bbhash, tblock, target);
+ link_bblock (cfg, bblock, tblock);
+ CHECK_BBLOCK (target, ip, tblock);
+ ins->inst_target_bb = tblock;
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ start_new_bblock = 1;
+ inline_costs += 10;
+ break;
+ case CEE_BRFALSE_S:
+ case CEE_BRTRUE_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip + BIG_BRANCH_OFFSET);
+ ins->cil_code = ip++;
+ target = ip + 1 + *(signed char*)ip;
+ ip++;
+ ADD_UNCOND (ins->opcode == CEE_BRTRUE);
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ inline_costs += 10;
+ break;
+ case CEE_BEQ_S:
+ case CEE_BGE_S:
+ case CEE_BGT_S:
+ case CEE_BLE_S:
+ case CEE_BLT_S:
+ case CEE_BNE_UN_S:
+ case CEE_BGE_UN_S:
+ case CEE_BGT_UN_S:
+ case CEE_BLE_UN_S:
+ case CEE_BLT_UN_S:
+ CHECK_OPSIZE (2);
+ CHECK_STACK (2);
+ MONO_INST_NEW (cfg, ins, *ip + BIG_BRANCH_OFFSET);
+ ins->cil_code = ip++;
+ target = ip + 1 + *(signed char*)ip;
+ ip++;
+ ADD_BINCOND (NULL);
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ inline_costs += 10;
+ break;
+ case CEE_BR:
+ CHECK_OPSIZE (5);
+ MONO_INST_NEW (cfg, ins, CEE_BR);
+ ins->cil_code = ip++;
+ MONO_ADD_INS (bblock, ins);
+ target = ip + 4 + (gint32)read32(ip);
+ ip += 4;
+ GET_BBLOCK (cfg, bbhash, tblock, target);
+ link_bblock (cfg, bblock, tblock);
+ CHECK_BBLOCK (target, ip, tblock);
+ ins->inst_target_bb = tblock;
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ start_new_bblock = 1;
+ inline_costs += 10;
+ break;
+ case CEE_BRFALSE:
+ case CEE_BRTRUE:
+ CHECK_OPSIZE (5);
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->cil_code = ip++;
+ target = ip + 4 + (gint32)read32(ip);
+ ip += 4;
+ ADD_UNCOND(ins->opcode == CEE_BRTRUE);
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ inline_costs += 10;
+ break;
+ case CEE_BEQ:
+ case CEE_BGE:
+ case CEE_BGT:
+ case CEE_BLE:
+ case CEE_BLT:
+ case CEE_BNE_UN:
+ case CEE_BGE_UN:
+ case CEE_BGT_UN:
+ case CEE_BLE_UN:
+ case CEE_BLT_UN:
+ CHECK_OPSIZE (5);
+ CHECK_STACK (2);
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->cil_code = ip++;
+ target = ip + 4 + (gint32)read32(ip);
+ ip += 4;
+ ADD_BINCOND(NULL);
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ inline_costs += 10;
+ break;
+ case CEE_SWITCH:
+ CHECK_OPSIZE (5);
+ CHECK_STACK (1);
+ n = read32 (ip + 1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ --sp;
+ ins->inst_left = *sp;
+ if (ins->inst_left->type != STACK_I4) goto unverified;
+ ins->cil_code = ip;
+ ip += 5;
+ CHECK_OPSIZE (n * sizeof (guint32));
+ target = ip + n * sizeof (guint32);
+ MONO_ADD_INS (bblock, ins);
+ GET_BBLOCK (cfg, bbhash, tblock, target);
+ link_bblock (cfg, bblock, tblock);
+ ins->klass = GUINT_TO_POINTER (n);
+ ins->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * (n + 1));
+ ins->inst_many_bb [n] = tblock;
+
+ for (i = 0; i < n; ++i) {
+ GET_BBLOCK (cfg, bbhash, tblock, target + (gint32)read32(ip));
+ link_bblock (cfg, bblock, tblock);
+ ins->inst_many_bb [i] = tblock;
+ ip += 4;
+ }
+ if (sp != stack_start) {
+ handle_stack_args (cfg, bblock, stack_start, sp - stack_start);
+ sp = stack_start;
+ }
+ inline_costs += 20;
+ break;
+ case CEE_LDIND_I1:
+ case CEE_LDIND_U1:
+ case CEE_LDIND_I2:
+ case CEE_LDIND_U2:
+ case CEE_LDIND_I4:
+ case CEE_LDIND_U4:
+ case CEE_LDIND_I8:
+ case CEE_LDIND_I:
+ case CEE_LDIND_R4:
+ case CEE_LDIND_R8:
+ case CEE_LDIND_REF:
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->cil_code = ip;
+ --sp;
+ ins->inst_i0 = *sp;
+ *sp++ = ins;
+ ins->type = ldind_type [*ip - CEE_LDIND_I1];
+ ins->flags |= ins_flag;
+ ins_flag = 0;
+ ++ip;
+ break;
+ case CEE_STIND_REF:
+ case CEE_STIND_I1:
+ case CEE_STIND_I2:
+ case CEE_STIND_I4:
+ case CEE_STIND_I8:
+ case CEE_STIND_R4:
+ case CEE_STIND_R8:
+ CHECK_STACK (2);
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->cil_code = ip++;
+ sp -= 2;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ MONO_ADD_INS (bblock, ins);
+ ins->inst_i0 = sp [0];
+ ins->inst_i1 = sp [1];
+ ins->flags |= ins_flag;
+ ins_flag = 0;
+ inline_costs += 1;
+ break;
+ case CEE_ADD:
+ case CEE_SUB:
+ case CEE_MUL:
+ case CEE_DIV:
+ case CEE_DIV_UN:
+ case CEE_REM:
+ case CEE_REM_UN:
+ case CEE_AND:
+ case CEE_OR:
+ case CEE_XOR:
+ case CEE_SHL:
+ case CEE_SHR:
+ case CEE_SHR_UN:
+ CHECK_STACK (2);
+ ADD_BINOP (*ip);
+ /* special case that gives a nice speedup and happens to workaorund a ppc jit but (for the release)
+ * later apply the speedup to the left shift as well
+ * See BUG# 57957.
+ */
+ if ((ins->opcode == OP_LSHR_UN) && (ins->type == STACK_I8)
+ && (ins->inst_right->opcode == OP_ICONST) && (ins->inst_right->inst_c0 == 32)) {
+ ins->opcode = OP_LONG_SHRUN_32;
+ /*g_print ("applied long shr speedup to %s\n", cfg->method->name);*/
+ ip++;
+ break;
+ }
+ if (mono_find_jit_opcode_emulation (ins->opcode)) {
+ --sp;
+ *sp++ = emit_tree (cfg, bblock, ins);
+ }
+ ip++;
+ break;
+ case CEE_NEG:
+ case CEE_NOT:
+ case CEE_CONV_I1:
+ case CEE_CONV_I2:
+ case CEE_CONV_I4:
+ case CEE_CONV_R4:
+ case CEE_CONV_R8:
+ case CEE_CONV_U4:
+ case CEE_CONV_I8:
+ case CEE_CONV_U8:
+ case CEE_CONV_OVF_I8:
+ case CEE_CONV_OVF_U8:
+ case CEE_CONV_R_UN:
+ CHECK_STACK (1);
+ ADD_UNOP (*ip);
+ if (mono_find_jit_opcode_emulation (ins->opcode)) {
+ --sp;
+ *sp++ = emit_tree (cfg, bblock, ins);
+ }
+ ip++;
+ break;
+ case CEE_CONV_OVF_I4:
+ case CEE_CONV_OVF_I1:
+ case CEE_CONV_OVF_I2:
+ case CEE_CONV_OVF_I:
+ case CEE_CONV_OVF_U:
+ CHECK_STACK (1);
+
+ if (sp [-1]->type == STACK_R8) {
+ ADD_UNOP (CEE_CONV_OVF_I8);
+ ADD_UNOP (*ip);
+ } else {
+ ADD_UNOP (*ip);
+ }
+
+ ip++;
+ break;
+ case CEE_CONV_OVF_U1:
+ case CEE_CONV_OVF_U2:
+ case CEE_CONV_OVF_U4:
+ CHECK_STACK (1);
+
+ if (sp [-1]->type == STACK_R8) {
+ ADD_UNOP (CEE_CONV_OVF_U8);
+ ADD_UNOP (*ip);
+ } else {
+ ADD_UNOP (*ip);
+ }
+
+ ip++;
+ break;
+ case CEE_CONV_OVF_I1_UN:
+ case CEE_CONV_OVF_I2_UN:
+ case CEE_CONV_OVF_I4_UN:
+ case CEE_CONV_OVF_I8_UN:
+ case CEE_CONV_OVF_U1_UN:
+ case CEE_CONV_OVF_U2_UN:
+ case CEE_CONV_OVF_U4_UN:
+ case CEE_CONV_OVF_U8_UN:
+ case CEE_CONV_OVF_I_UN:
+ case CEE_CONV_OVF_U_UN:
+ CHECK_STACK (1);
+ ADD_UNOP (*ip);
+ ip++;
+ break;
+ case CEE_CPOBJ:
+ CHECK_OPSIZE (5);
+ CHECK_STACK (2);
+ token = read32 (ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ mono_class_init (klass);
+ sp -= 2;
+ if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg)) {
+ MonoInst *store, *load;
+ MONO_INST_NEW (cfg, load, CEE_LDIND_REF);
+ load->cil_code = ip;
+ load->inst_i0 = sp [1];
+ load->type = ldind_type [CEE_LDIND_REF];
+ load->flags |= ins_flag;
+ MONO_INST_NEW (cfg, store, CEE_STIND_REF);
+ store->cil_code = ip;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ MONO_ADD_INS (bblock, store);
+ store->inst_i0 = sp [0];
+ store->inst_i1 = load;
+ store->flags |= ins_flag;
+ } else {
+ n = mono_class_value_size (klass, NULL);
+ if ((cfg->opt & MONO_OPT_INTRINS) && n <= sizeof (gpointer) * 5) {
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MEMCPY);
+ copy->inst_left = sp [0];
+ copy->inst_right = sp [1];
+ copy->cil_code = ip;
+ copy->unused = n;
+ MONO_ADD_INS (bblock, copy);
+ } else {
+ MonoInst *iargs [3];
+ iargs [0] = sp [0];
+ iargs [1] = sp [1];
+ NEW_ICONST (cfg, iargs [2], n);
+ iargs [2]->cil_code = ip;
+
+ mono_emit_jit_icall (cfg, bblock, helper_memcpy, iargs, ip);
+ }
+ }
+ ins_flag = 0;
+ ip += 5;
+ break;
+ case CEE_LDOBJ: {
+ MonoInst *iargs [3];
+ CHECK_OPSIZE (5);
+ CHECK_STACK (1);
+ --sp;
+ token = read32 (ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ mono_class_init (klass);
+ if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg)) {
+ MONO_INST_NEW (cfg, ins, CEE_LDIND_REF);
+ ins->cil_code = ip;
+ ins->inst_i0 = sp [0];
+ ins->type = ldind_type [CEE_LDIND_REF];
+ ins->flags |= ins_flag;
+ ins_flag = 0;
+ *sp++ = ins;
+ ip += 5;
+ break;
+ }
+ n = mono_class_value_size (klass, NULL);
+ ins = mono_compile_create_var (cfg, &klass->byval_arg, OP_LOCAL);
+ NEW_TEMPLOADA (cfg, iargs [0], ins->inst_c0);
+ if ((cfg->opt & MONO_OPT_INTRINS) && n <= sizeof (gpointer) * 5) {
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MEMCPY);
+ copy->inst_left = iargs [0];
+ copy->inst_right = *sp;
+ copy->cil_code = ip;
+ copy->unused = n;
+ MONO_ADD_INS (bblock, copy);
+ } else {
+ iargs [1] = *sp;
+ NEW_ICONST (cfg, iargs [2], n);
+ iargs [2]->cil_code = ip;
+
+ mono_emit_jit_icall (cfg, bblock, helper_memcpy, iargs, ip);
+ }
+ NEW_TEMPLOAD (cfg, *sp, ins->inst_c0);
+ ++sp;
+ ip += 5;
+ ins_flag = 0;
+ inline_costs += 1;
+ break;
+ }
+ case CEE_LDSTR:
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (5);
+ n = read32 (ip + 1);
+
+ if (method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD) {
+ NEW_PCONST (cfg, ins, mono_method_get_wrapper_data (method, n));
+ ins->cil_code = ip;
+ ins->type = STACK_OBJ;
+ *sp = ins;
+ }
+ else if (method->wrapper_type != MONO_WRAPPER_NONE) {
+ int temp;
+ MonoInst *iargs [1];
+
+ NEW_PCONST (cfg, iargs [0], mono_method_get_wrapper_data (method, n));
+ temp = mono_emit_jit_icall (cfg, bblock, mono_string_new_wrapper, iargs, ip);
+ NEW_TEMPLOAD (cfg, *sp, temp);
+
+ } else {
+
+ if (cfg->opt & MONO_OPT_SHARED) {
+ int temp;
+ MonoInst *iargs [3];
+
+ if (mono_compile_aot) {
+ cfg->ldstr_list = g_list_prepend (cfg->ldstr_list, (gpointer)n);
+ }
+
+ NEW_TEMPLOAD (cfg, iargs [0], mono_get_domainvar (cfg)->inst_c0);
+ NEW_IMAGECONST (cfg, iargs [1], image);
+ NEW_ICONST (cfg, iargs [2], mono_metadata_token_index (n));
+ temp = mono_emit_jit_icall (cfg, bblock, mono_ldstr, iargs, ip);
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ mono_ldstr (cfg->domain, image, mono_metadata_token_index (n));
+ } else {
+ if (mono_compile_aot)
+ NEW_LDSTRCONST (cfg, ins, image, n);
+ else {
+ NEW_PCONST (cfg, ins, NULL);
+ ins->cil_code = ip;
+ ins->type = STACK_OBJ;
+ ins->inst_p0 = mono_ldstr (cfg->domain, image, mono_metadata_token_index (n));
+ }
+ *sp = ins;
+ }
+ }
+
+ sp++;
+ ip += 5;
+ break;
+ case CEE_NEWOBJ: {
+ MonoInst *iargs [2];
+ MonoMethodSignature *fsig;
+ int temp;
+
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE) {
+ cmethod = mono_method_get_wrapper_data (method, token);
+ } else
+ cmethod = mono_get_method_full (image, token, NULL, generic_context);
+ fsig = mono_method_get_signature (cmethod, image, token);
+
+ mono_class_init (cmethod->klass);
+
+ n = fsig->param_count;
+ CHECK_STACK (n);
+
+ /* move the args to allow room for 'this' in the first position */
+ while (n--) {
+ --sp;
+ sp [1] = sp [0];
+ }
+
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+
+ if (cmethod->klass->parent == mono_defaults.array_class) {
+ NEW_METHODCONST (cfg, *sp, cmethod);
+ temp = handle_array_new (cfg, bblock, fsig->param_count, sp, ip);
+ } else if (cmethod->string_ctor) {
+ /* we simply pass a null pointer */
+ NEW_PCONST (cfg, *sp, NULL);
+ /* now call the string ctor */
+ temp = mono_emit_method_call_spilled (cfg, bblock, cmethod, fsig, sp, ip, NULL);
+ } else {
+ if (cmethod->klass->valuetype) {
+ iargs [0] = mono_compile_create_var (cfg, &cmethod->klass->byval_arg, OP_LOCAL);
+ temp = iargs [0]->inst_c0;
+ NEW_TEMPLOADA (cfg, *sp, temp);
+ } else {
+ temp = handle_alloc (cfg, bblock, cmethod->klass, ip);
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ }
+
+ if ((cfg->opt & MONO_OPT_INLINE) && cmethod &&
+ mono_method_check_inlining (cfg, cmethod) &&
+ !mono_class_is_subclass_of (cmethod->klass, mono_defaults.exception_class, FALSE) &&
+ !g_list_find (dont_inline, cmethod)) {
+ int costs;
+ MonoBasicBlock *ebblock;
+ if ((costs = inline_method (cfg, cmethod, fsig, bblock, sp, ip, real_offset, dont_inline, &ebblock, FALSE))) {
+
+ ip += 5;
+ real_offset += 5;
+
+ GET_BBLOCK (cfg, bbhash, bblock, ip);
+ ebblock->next_bb = bblock;
+ link_bblock (cfg, ebblock, bblock);
+
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp++;
+
+ /* indicates start of a new block, and triggers a load
+ of all stack arguments at bb boundarie */
+ bblock = ebblock;
+
+ inline_costs += costs;
+ break;
+
+ } else {
+ mono_emit_method_call_spilled (cfg, bblock, cmethod, fsig, sp, ip, sp[0]);
+ }
+ } else {
+ /* now call the actual ctor */
+ mono_emit_method_call_spilled (cfg, bblock, cmethod, fsig, sp, ip, sp[0]);
+ }
+ }
+
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp++;
+
+ ip += 5;
+ inline_costs += 5;
+ break;
+ }
+ case CEE_ISINST:
+ CHECK_STACK (1);
+ --sp;
+ CHECK_OPSIZE (5);
+ klass = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ mono_class_init (klass);
+
+ if (klass->marshalbyref || klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+
+ MonoMethod *mono_isinst;
+ MonoInst *iargs [1];
+ MonoBasicBlock *ebblock;
+ int costs;
+ int temp;
+
+ mono_isinst = mono_marshal_get_isinst (klass);
+ iargs [0] = sp [0];
+
+ costs = inline_method (cfg, mono_isinst, mono_isinst->signature, bblock,
+ iargs, ip, real_offset, dont_inline, &ebblock, TRUE);
+
+ g_assert (costs > 0);
+
+ ip += 5;
+ real_offset += 5;
+
+ GET_BBLOCK (cfg, bbhash, bblock, ip);
+ ebblock->next_bb = bblock;
+ link_bblock (cfg, ebblock, bblock);
+
+ temp = iargs [0]->inst_i0->inst_c0;
+ NEW_TEMPLOAD (cfg, *sp, temp);
+
+ sp++;
+ bblock = ebblock;
+ inline_costs += costs;
+
+ }
+ else {
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->type = STACK_OBJ;
+ ins->inst_left = *sp;
+ ins->inst_newa_class = klass;
+ ins->cil_code = ip;
+ *sp++ = emit_tree (cfg, bblock, ins);
+ ip += 5;
+ }
+ break;
+ case CEE_UNBOX_ANY: {
+ MonoInst *add, *vtoffset;
+ MonoInst *iargs [3];
+
+ CHECK_STACK (1);
+ --sp;
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (klass);
+
+ if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg)) {
+ /* CASTCLASS */
+ if (klass->marshalbyref || klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ MonoMethod *mono_castclass;
+ MonoInst *iargs [1];
+ MonoBasicBlock *ebblock;
+ int costs;
+ int temp;
+
+ mono_castclass = mono_marshal_get_castclass (klass);
+ iargs [0] = sp [0];
+
+ costs = inline_method (cfg, mono_castclass, mono_castclass->signature, bblock,
+ iargs, ip, real_offset, dont_inline, &ebblock, TRUE);
+
+ g_assert (costs > 0);
+
+ ip += 5;
+ real_offset += 5;
+
+ GET_BBLOCK (cfg, bbhash, bblock, ip);
+ ebblock->next_bb = bblock;
+ link_bblock (cfg, ebblock, bblock);
+
+ temp = iargs [0]->inst_i0->inst_c0;
+ NEW_TEMPLOAD (cfg, *sp, temp);
+
+ sp++;
+ bblock = ebblock;
+ inline_costs += costs;
+ }
+ else {
+ MONO_INST_NEW (cfg, ins, CEE_CASTCLASS);
+ ins->type = STACK_OBJ;
+ ins->inst_left = *sp;
+ ins->klass = klass;
+ ins->inst_newa_class = klass;
+ ins->cil_code = ip;
+ *sp++ = ins;
+ }
+ ip += 5;
+ break;
+ }
+
+ MONO_INST_NEW (cfg, ins, OP_UNBOXCAST);
+ ins->type = STACK_OBJ;
+ ins->inst_left = *sp;
+ ins->klass = klass;
+ ins->inst_newa_class = klass;
+ ins->cil_code = ip;
+
+ MONO_INST_NEW (cfg, add, OP_PADD);
+ NEW_ICONST (cfg, vtoffset, sizeof (MonoObject));
+ add->inst_left = ins;
+ add->inst_right = vtoffset;
+ add->type = STACK_MP;
+ *sp = add;
+ ip += 5;
+ /* LDOBJ impl */
+ n = mono_class_value_size (klass, NULL);
+ ins = mono_compile_create_var (cfg, &klass->byval_arg, OP_LOCAL);
+ NEW_TEMPLOADA (cfg, iargs [0], ins->inst_c0);
+ if ((cfg->opt & MONO_OPT_INTRINS) && n <= sizeof (gpointer) * 5) {
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MEMCPY);
+ copy->inst_left = iargs [0];
+ copy->inst_right = *sp;
+ copy->cil_code = ip;
+ copy->unused = n;
+ MONO_ADD_INS (bblock, copy);
+ } else {
+ iargs [1] = *sp;
+ NEW_ICONST (cfg, iargs [2], n);
+ iargs [2]->cil_code = ip;
+
+ mono_emit_jit_icall (cfg, bblock, helper_memcpy, iargs, ip);
+ }
+ NEW_TEMPLOAD (cfg, *sp, ins->inst_c0);
+ ++sp;
+ inline_costs += 2;
+ break;
+ }
+ case CEE_UNBOX: {
+ MonoInst *add, *vtoffset;
+
+ CHECK_STACK (1);
+ --sp;
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (klass);
+
+ MONO_INST_NEW (cfg, ins, OP_UNBOXCAST);
+ ins->type = STACK_OBJ;
+ ins->inst_left = *sp;
+ ins->klass = klass;
+ ins->inst_newa_class = klass;
+ ins->cil_code = ip;
+
+ MONO_INST_NEW (cfg, add, OP_PADD);
+ NEW_ICONST (cfg, vtoffset, sizeof (MonoObject));
+ add->inst_left = ins;
+ add->inst_right = vtoffset;
+ add->type = STACK_MP;
+ *sp++ = add;
+ ip += 5;
+ inline_costs += 2;
+ break;
+ }
+ case CEE_CASTCLASS:
+ CHECK_STACK (1);
+ --sp;
+ CHECK_OPSIZE (5);
+ klass = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ mono_class_init (klass);
+
+ if (klass->marshalbyref || klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+
+ MonoMethod *mono_castclass;
+ MonoInst *iargs [1];
+ MonoBasicBlock *ebblock;
+ int costs;
+ int temp;
+
+ mono_castclass = mono_marshal_get_castclass (klass);
+ iargs [0] = sp [0];
+
+ costs = inline_method (cfg, mono_castclass, mono_castclass->signature, bblock,
+ iargs, ip, real_offset, dont_inline, &ebblock, TRUE);
+
+ g_assert (costs > 0);
+
+ ip += 5;
+ real_offset += 5;
+
+ GET_BBLOCK (cfg, bbhash, bblock, ip);
+ ebblock->next_bb = bblock;
+ link_bblock (cfg, ebblock, bblock);
+
+ temp = iargs [0]->inst_i0->inst_c0;
+ NEW_TEMPLOAD (cfg, *sp, temp);
+
+ sp++;
+ bblock = ebblock;
+ inline_costs += costs;
+ }
+ else {
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->type = STACK_OBJ;
+ ins->inst_left = *sp;
+ ins->klass = klass;
+ ins->inst_newa_class = klass;
+ ins->cil_code = ip;
+ *sp++ = emit_tree (cfg, bblock, ins);
+ ip += 5;
+ }
+ break;
+ case CEE_THROW:
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ --sp;
+ ins->inst_left = *sp;
+ ins->cil_code = ip++;
+ MONO_ADD_INS (bblock, ins);
+ sp = stack_start;
+ start_new_bblock = 1;
+ break;
+ case CEE_LDFLD:
+ case CEE_LDFLDA:
+ case CEE_STFLD: {
+ MonoInst *offset_ins;
+ MonoClassField *field;
+ MonoBasicBlock *ebblock;
+ int costs;
+ guint foffset;
+
+ if (*ip == CEE_STFLD) {
+ CHECK_STACK (2);
+ sp -= 2;
+ } else {
+ CHECK_STACK (1);
+ --sp;
+ }
+ // FIXME: enable this test later.
+ //if (sp [0]->type != STACK_OBJ && sp [0]->type != STACK_MP)
+ // goto unverified;
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ mono_class_init (klass);
+
+ foffset = klass->valuetype? field->offset - sizeof (MonoObject): field->offset;
+ /* FIXME: mark instructions for use in SSA */
+ if (*ip == CEE_STFLD) {
+ if ((klass->marshalbyref && !MONO_CHECK_THIS (sp [0])) || klass->contextbound || klass == mono_defaults.marshalbyrefobject_class) {
+ MonoMethod *stfld_wrapper = mono_marshal_get_stfld_wrapper (field->type);
+ MonoInst *iargs [5];
+
+ iargs [0] = sp [0];
+ NEW_CLASSCONST (cfg, iargs [1], klass);
+ NEW_FIELDCONST (cfg, iargs [2], field);
+ NEW_ICONST (cfg, iargs [3], klass->valuetype ? field->offset - sizeof (MonoObject) :
+ field->offset);
+ iargs [4] = sp [1];
+
+ if (cfg->opt & MONO_OPT_INLINE) {
+ costs = inline_method (cfg, stfld_wrapper, stfld_wrapper->signature, bblock,
+ iargs, ip, real_offset, dont_inline, &ebblock, TRUE);
+ g_assert (costs > 0);
+
+ ip += 5;
+ real_offset += 5;
+
+ GET_BBLOCK (cfg, bbhash, bblock, ip);
+ ebblock->next_bb = bblock;
+ link_bblock (cfg, ebblock, bblock);
+
+ /* indicates start of a new block, and triggers a load
+ of all stack arguments at bb boundarie */
+ bblock = ebblock;
+
+ inline_costs += costs;
+ break;
+ } else {
+ mono_emit_method_call_spilled (cfg, bblock, stfld_wrapper, stfld_wrapper->signature, iargs, ip, NULL);
+ }
+ } else {
+ MonoInst *store;
+ NEW_ICONST (cfg, offset_ins, foffset);
+ MONO_INST_NEW (cfg, ins, OP_PADD);
+ ins->cil_code = ip;
+ ins->inst_left = *sp;
+ ins->inst_right = offset_ins;
+ ins->type = STACK_MP;
+
+ MONO_INST_NEW (cfg, store, mono_type_to_stind (field->type));
+ store->cil_code = ip;
+ store->inst_left = ins;
+ store->inst_right = sp [1];
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ store->flags |= ins_flag;
+ ins_flag = 0;
+ if (store->opcode == CEE_STOBJ) {
+ handle_stobj (cfg, bblock, ins, sp [1], ip,
+ mono_class_from_mono_type (field->type), FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, store);
+ }
+ } else {
+ if ((klass->marshalbyref && !MONO_CHECK_THIS (sp [0])) || klass->contextbound || klass == mono_defaults.marshalbyrefobject_class) {
+ /* fixme: we need to inline that call somehow */
+ MonoMethod *ldfld_wrapper = mono_marshal_get_ldfld_wrapper (field->type);
+ MonoInst *iargs [4];
+ int temp;
+
+ iargs [0] = sp [0];
+ NEW_CLASSCONST (cfg, iargs [1], klass);
+ NEW_FIELDCONST (cfg, iargs [2], field);
+ NEW_ICONST (cfg, iargs [3], klass->valuetype ? field->offset - sizeof (MonoObject) : field->offset);
+ if (cfg->opt & MONO_OPT_INLINE) {
+ costs = inline_method (cfg, ldfld_wrapper, ldfld_wrapper->signature, bblock,
+ iargs, ip, real_offset, dont_inline, &ebblock, TRUE);
+ g_assert (costs > 0);
+
+ ip += 5;
+ real_offset += 5;
+
+ GET_BBLOCK (cfg, bbhash, bblock, ip);
+ ebblock->next_bb = bblock;
+ link_bblock (cfg, ebblock, bblock);
+
+ temp = iargs [0]->inst_i0->inst_c0;
+
+ if (*ip == CEE_LDFLDA) {
+ /* not sure howto handle this */
+ NEW_TEMPLOADA (cfg, *sp, temp);
+ } else {
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ }
+ sp++;
+
+ /* indicates start of a new block, and triggers a load of
+ all stack arguments at bb boundarie */
+ bblock = ebblock;
+
+ inline_costs += costs;
+ break;
+ } else {
+ temp = mono_emit_method_call_spilled (cfg, bblock, ldfld_wrapper, ldfld_wrapper->signature, iargs, ip, NULL);
+ if (*ip == CEE_LDFLDA) {
+ /* not sure howto handle this */
+ NEW_TEMPLOADA (cfg, *sp, temp);
+ } else {
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ }
+ sp++;
+ }
+ } else {
+ NEW_ICONST (cfg, offset_ins, foffset);
+ MONO_INST_NEW (cfg, ins, OP_PADD);
+ ins->cil_code = ip;
+ ins->inst_left = *sp;
+ ins->inst_right = offset_ins;
+ ins->type = STACK_MP;
+
+ if (*ip == CEE_LDFLDA) {
+ *sp++ = ins;
+ } else {
+ MonoInst *load;
+ MONO_INST_NEW (cfg, load, mono_type_to_ldind (field->type));
+ type_to_eval_stack_type (field->type, load);
+ load->cil_code = ip;
+ load->inst_left = ins;
+ load->flags |= ins_flag;
+ ins_flag = 0;
+ *sp++ = load;
+ }
+ }
+ }
+ ip += 5;
+ break;
+ }
+ case CEE_LDSFLD:
+ case CEE_LDSFLDA:
+ case CEE_STSFLD: {
+ MonoClassField *field;
+ gpointer addr = NULL;
+
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+
+ field = mono_field_from_token (image, token, &klass, generic_context);
+ mono_class_init (klass);
+
+ if ((*ip) == CEE_STSFLD)
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+ if (cfg->domain->special_static_fields)
+ addr = g_hash_table_lookup (cfg->domain->special_static_fields, field);
+
+ if ((cfg->opt & MONO_OPT_SHARED) || (mono_compile_aot && addr)) {
+ int temp;
+ MonoInst *iargs [2];
+ g_assert (field->parent);
+ NEW_TEMPLOAD (cfg, iargs [0], mono_get_domainvar (cfg)->inst_c0);
+ NEW_FIELDCONST (cfg, iargs [1], field);
+ temp = mono_emit_jit_icall (cfg, bblock, mono_class_static_field_address, iargs, ip);
+ NEW_TEMPLOAD (cfg, ins, temp);
+ } else {
+ MonoVTable *vtable;
+ vtable = mono_class_vtable (cfg->domain, klass);
+ if (!addr) {
+ if ((!vtable->initialized || mono_compile_aot) && !(klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) && mono_class_needs_cctor_run (klass, method)) {
+ guint8 *tramp = mono_create_class_init_trampoline (vtable);
+ mono_emit_native_call (cfg, bblock, tramp,
+ helper_sig_class_init_trampoline,
+ NULL, ip, FALSE, FALSE);
+ if (cfg->verbose_level > 2)
+ g_print ("class %s.%s needs init call for %s\n", klass->name_space, klass->name, field->name);
+ } else {
+ if (cfg->run_cctors)
+ mono_runtime_class_init (vtable);
+ }
+ addr = (char*)vtable->data + field->offset;
+
+ if (mono_compile_aot)
+ NEW_SFLDACONST (cfg, ins, field);
+ else
+ NEW_PCONST (cfg, ins, addr);
+ ins->cil_code = ip;
+ } else {
+ /*
+ * insert call to mono_threads_get_static_data (GPOINTER_TO_UINT (addr))
+ * This could be later optimized to do just a couple of
+ * memory dereferences with constant offsets.
+ */
+ int temp;
+ MonoInst *iargs [1];
+ NEW_ICONST (cfg, iargs [0], GPOINTER_TO_UINT (addr));
+ temp = mono_emit_jit_icall (cfg, bblock, mono_get_special_static_data, iargs, ip);
+ NEW_TEMPLOAD (cfg, ins, temp);
+ }
+ }
+
+ /* FIXME: mark instructions for use in SSA */
+ if (*ip == CEE_LDSFLDA) {
+ *sp++ = ins;
+ } else if (*ip == CEE_STSFLD) {
+ MonoInst *store;
+ CHECK_STACK (1);
+ sp--;
+ MONO_INST_NEW (cfg, store, mono_type_to_stind (field->type));
+ store->cil_code = ip;
+ store->inst_left = ins;
+ store->inst_right = sp [0];
+ store->flags |= ins_flag;
+ ins_flag = 0;
+
+ if (store->opcode == CEE_STOBJ) {
+ handle_stobj (cfg, bblock, ins, sp [0], ip, mono_class_from_mono_type (field->type), FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, store);
+ } else {
+ gboolean is_const = FALSE;
+ MonoVTable *vtable = mono_class_vtable (cfg->domain, klass);
+ if (!((cfg->opt & MONO_OPT_SHARED) || mono_compile_aot) &&
+ vtable->initialized && (field->type->attrs & FIELD_ATTRIBUTE_INIT_ONLY)) {
+ gpointer addr = (char*)vtable->data + field->offset;
+ /* g_print ("RO-FIELD %s.%s:%s\n", klass->name_space, klass->name, field->name);*/
+ is_const = TRUE;
+ switch (field->type->type) {
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_U1:
+ NEW_ICONST (cfg, *sp, *((guint8 *)addr));
+ sp++;
+ break;
+ case MONO_TYPE_I1:
+ NEW_ICONST (cfg, *sp, *((gint8 *)addr));
+ sp++;
+ break;
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_U2:
+ NEW_ICONST (cfg, *sp, *((guint16 *)addr));
+ sp++;
+ break;
+ case MONO_TYPE_I2:
+ NEW_ICONST (cfg, *sp, *((gint16 *)addr));
+ sp++;
+ break;
+ break;
+ case MONO_TYPE_I4:
+ NEW_ICONST (cfg, *sp, *((gint32 *)addr));
+ sp++;
+ break;
+ case MONO_TYPE_U4:
+ NEW_ICONST (cfg, *sp, *((guint32 *)addr));
+ sp++;
+ break;
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ NEW_PCONST (cfg, *sp, *((gpointer *)addr));
+ type_to_eval_stack_type (field->type, *sp);
+ sp++;
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ MONO_INST_NEW (cfg, *sp, OP_I8CONST);
+ sp [0]->type = STACK_I8;
+ sp [0]->inst_l = *((gint64 *)addr);
+ sp++;
+ break;
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8:
+ case MONO_TYPE_VALUETYPE:
+ default:
+ is_const = FALSE;
+ break;
+ }
+ }
+
+ if (!is_const) {
+ MonoInst *load;
+ CHECK_STACK_OVF (1);
+ MONO_INST_NEW (cfg, load, mono_type_to_ldind (field->type));
+ type_to_eval_stack_type (field->type, load);
+ load->cil_code = ip;
+ load->inst_left = ins;
+ *sp++ = load;
+ load->flags |= ins_flag;
+ ins_flag = 0;
+ /* fixme: dont see the problem why this does not work */
+ //cfg->disable_aot = TRUE;
+ }
+ }
+ ip += 5;
+ break;
+ }
+ case CEE_STOBJ:
+ CHECK_STACK (2);
+ sp -= 2;
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (klass);
+ n = mono_type_to_stind (&klass->byval_arg);
+ if (n == CEE_STOBJ) {
+ handle_stobj (cfg, bblock, sp [0], sp [1], ip, klass, FALSE, FALSE);
+ } else {
+ /* FIXME: should check item at sp [1] is compatible with the type of the store. */
+ MonoInst *store;
+ MONO_INST_NEW (cfg, store, n);
+ store->cil_code = ip;
+ store->inst_left = sp [0];
+ store->inst_right = sp [1];
+ store->flags |= ins_flag;
+ MONO_ADD_INS (bblock, store);
+ }
+ ins_flag = 0;
+ ip += 5;
+ inline_costs += 1;
+ break;
+ case CEE_BOX: {
+ MonoInst *val;
+ CHECK_STACK (1);
+ --sp;
+ val = *sp;
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (klass);
+
+ if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg)) {
+ *sp++ = val;
+ ip += 5;
+ break;
+ }
+ *sp++ = handle_box (cfg, bblock, val, ip, klass);
+ ip += 5;
+ inline_costs += 1;
+ break;
+ }
+ case CEE_NEWARR:
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->cil_code = ip;
+ --sp;
+
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+
+ /* allocate the domainvar - becaus this is used in decompose_foreach */
+ if (cfg->opt & MONO_OPT_SHARED) {
+ mono_get_domainvar (cfg);
+ /* LAME-IR: Mark it as used since otherwise it will be optimized away */
+ cfg->domainvar->flags |= MONO_INST_VOLATILE;
+ }
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+
+ mono_class_init (klass);
+ ins->inst_newa_class = klass;
+ ins->inst_newa_len = *sp;
+ ins->type = STACK_OBJ;
+ ip += 5;
+ *sp++ = ins;
+ /*
+ * we store the object so calls to create the array are not interleaved
+ * with the arguments of other calls.
+ */
+ if (1) {
+ MonoInst *store, *temp, *load;
+ --sp;
+ temp = mono_compile_create_var (cfg, type_from_stack_type (ins), OP_LOCAL);
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, ins);
+ store->cil_code = ins->cil_code;
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, load, temp->inst_c0);
+ load->cil_code = ins->cil_code;
+ *sp++ = load;
+ }
+ inline_costs += 1;
+ break;
+ case CEE_LDLEN:
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ ins->cil_code = ip++;
+ --sp;
+ ins->inst_left = *sp;
+ ins->type = STACK_PTR;
+ *sp++ = ins;
+ break;
+ case CEE_LDELEMA:
+ CHECK_STACK (2);
+ sp -= 2;
+ CHECK_OPSIZE (5);
+
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = (MonoClass*)mono_method_get_wrapper_data (method, read32 (ip + 1));
+ else
+ klass = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ mono_class_init (klass);
+ NEW_LDELEMA (cfg, ins, sp, klass);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 5;
+ break;
+ case CEE_LDELEM_ANY: {
+ MonoInst *load;
+ CHECK_STACK (2);
+ sp -= 2;
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ klass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (klass);
+ NEW_LDELEMA (cfg, load, sp, klass);
+ load->cil_code = ip;
+ MONO_INST_NEW (cfg, ins, mono_type_to_ldind (&klass->byval_arg));
+ ins->cil_code = ip;
+ ins->inst_left = load;
+ *sp++ = ins;
+ type_to_eval_stack_type (&klass->byval_arg, ins);
+ ip += 5;
+ break;
+ }
+ case CEE_LDELEM_I1:
+ case CEE_LDELEM_U1:
+ case CEE_LDELEM_I2:
+ case CEE_LDELEM_U2:
+ case CEE_LDELEM_I4:
+ case CEE_LDELEM_U4:
+ case CEE_LDELEM_I8:
+ case CEE_LDELEM_I:
+ case CEE_LDELEM_R4:
+ case CEE_LDELEM_R8:
+ case CEE_LDELEM_REF: {
+ MonoInst *load;
+ /*
+ * translate to:
+ * ldind.x (ldelema (array, index))
+ * ldelema does the bounds check
+ */
+ CHECK_STACK (2);
+ sp -= 2;
+ klass = array_access_to_klass (*ip);
+ NEW_LDELEMA (cfg, load, sp, klass);
+ load->cil_code = ip;
+ MONO_INST_NEW (cfg, ins, ldelem_to_ldind [*ip - CEE_LDELEM_I1]);
+ ins->cil_code = ip;
+ ins->inst_left = load;
+ *sp++ = ins;
+ ins->type = ldind_type [ins->opcode - CEE_LDIND_I1];
+ ++ip;
+ break;
+ }
+ case CEE_STELEM_I:
+ case CEE_STELEM_I1:
+ case CEE_STELEM_I2:
+ case CEE_STELEM_I4:
+ case CEE_STELEM_I8:
+ case CEE_STELEM_R4:
+ case CEE_STELEM_R8: {
+ MonoInst *load;
+ /*
+ * translate to:
+ * stind.x (ldelema (array, index), val)
+ * ldelema does the bounds check
+ */
+ CHECK_STACK (3);
+ sp -= 3;
+ klass = array_access_to_klass (*ip);
+ NEW_LDELEMA (cfg, load, sp, klass);
+ load->cil_code = ip;
+ MONO_INST_NEW (cfg, ins, stelem_to_stind [*ip - CEE_STELEM_I]);
+ ins->cil_code = ip;
+ ins->inst_left = load;
+ ins->inst_right = sp [2];
+ ++ip;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ MONO_ADD_INS (bblock, ins);
+ inline_costs += 1;
+ break;
+ }
+ case CEE_STELEM_ANY: {
+ MonoInst *load;
+ /*
+ * translate to:
+ * stind.x (ldelema (array, index), val)
+ * ldelema does the bounds check
+ */
+ CHECK_STACK (3);
+ sp -= 3;
+ CHECK_OPSIZE (5);
+ token = read32 (ip + 1);
+ klass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (klass);
+ if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg)) {
+ MonoMethod* helper = mono_marshal_get_stelemref ();
+ MonoInst *iargs [3];
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+ iargs [2] = sp [2];
+ iargs [1] = sp [1];
+ iargs [0] = sp [0];
+
+ mono_emit_method_call_spilled (cfg, bblock, helper, helper->signature, iargs, ip, NULL);
+ } else {
+ NEW_LDELEMA (cfg, load, sp, klass);
+ load->cil_code = ip;
+
+ n = mono_type_to_stind (&klass->byval_arg);
+ if (n == CEE_STOBJ)
+ handle_stobj (cfg, bblock, load, sp [2], ip, klass, FALSE, FALSE);
+ else {
+ MONO_INST_NEW (cfg, ins, n);
+ ins->cil_code = ip;
+ ins->inst_left = load;
+ ins->inst_right = sp [2];
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ MONO_ADD_INS (bblock, ins);
+ }
+ }
+ ip += 5;
+ inline_costs += 1;
+ break;
+ }
+ case CEE_STELEM_REF: {
+ MonoInst *iargs [3];
+ MonoMethod* helper = mono_marshal_get_stelemref ();
+
+ CHECK_STACK (3);
+ sp -= 3;
+
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+ iargs [2] = sp [2];
+ iargs [1] = sp [1];
+ iargs [0] = sp [0];
+
+ mono_emit_method_call_spilled (cfg, bblock, helper, helper->signature, iargs, ip, NULL);
+
+ /*
+ MonoInst *group;
+ NEW_GROUP (cfg, group, sp [0], sp [1]);
+ MONO_INST_NEW (cfg, ins, CEE_STELEM_REF);
+ ins->cil_code = ip;
+ ins->inst_left = group;
+ ins->inst_right = sp [2];
+ MONO_ADD_INS (bblock, ins);
+ */
+
+ ++ip;
+ inline_costs += 1;
+ break;
+ }
+ case CEE_CKFINITE: {
+ MonoInst *store, *temp;
+ CHECK_STACK (1);
+
+ /* this instr. can throw exceptions as side effect,
+ * so we cant eliminate dead code which contains CKFINITE opdodes.
+ * Spilling to memory makes sure that we always perform
+ * this check */
+
+
+ MONO_INST_NEW (cfg, ins, CEE_CKFINITE);
+ ins->cil_code = ip;
+ ins->inst_left = sp [-1];
+ temp = mono_compile_create_var (cfg, &mono_defaults.double_class->byval_arg, OP_LOCAL);
+
+ NEW_TEMPSTORE (cfg, store, temp->inst_c0, ins);
+ store->cil_code = ip;
+ MONO_ADD_INS (bblock, store);
+
+ NEW_TEMPLOAD (cfg, sp [-1], temp->inst_c0);
+
+ ++ip;
+ break;
+ }
+ case CEE_REFANYVAL:
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ --sp;
+ CHECK_OPSIZE (5);
+ klass = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ mono_class_init (klass);
+ ins->type = STACK_MP;
+ ins->inst_left = *sp;
+ ins->klass = klass;
+ ins->inst_newa_class = klass;
+ ins->cil_code = ip;
+ ip += 5;
+ *sp++ = ins;
+ break;
+ case CEE_MKREFANY: {
+ MonoInst *loc, *klassconst;
+
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, *ip);
+ --sp;
+ CHECK_OPSIZE (5);
+ klass = mono_class_get_full (image, read32 (ip + 1), generic_context);
+ mono_class_init (klass);
+ ins->cil_code = ip;
+
+ loc = mono_compile_create_var (cfg, &mono_defaults.typed_reference_class->byval_arg, OP_LOCAL);
+ NEW_TEMPLOADA (cfg, ins->inst_right, loc->inst_c0);
+
+ NEW_PCONST (cfg, klassconst, klass);
+ NEW_GROUP (cfg, ins->inst_left, *sp, klassconst);
+
+ MONO_ADD_INS (bblock, ins);
+
+ NEW_TEMPLOAD (cfg, *sp, loc->inst_c0);
+ ++sp;
+ ip += 5;
+ break;
+ }
+ case CEE_LDTOKEN: {
+ gpointer handle;
+ MonoClass *handle_class;
+
+ CHECK_STACK_OVF (1);
+
+ CHECK_OPSIZE (5);
+ n = read32 (ip + 1);
+
+ handle = mono_ldtoken (image, n, &handle_class, generic_context);
+ mono_class_init (handle_class);
+
+ if (cfg->opt & MONO_OPT_SHARED) {
+ int temp;
+ MonoInst *res, *store, *addr, *vtvar, *iargs [2];
+
+ vtvar = mono_compile_create_var (cfg, &handle_class->byval_arg, OP_LOCAL);
+
+ NEW_IMAGECONST (cfg, iargs [0], image);
+ NEW_ICONST (cfg, iargs [1], n);
+ temp = mono_emit_jit_icall (cfg, bblock, mono_ldtoken_wrapper, iargs, ip);
+ NEW_TEMPLOAD (cfg, res, temp);
+ NEW_TEMPLOADA (cfg, addr, vtvar->inst_c0);
+ NEW_INDSTORE (cfg, store, addr, res, &mono_defaults.int_class->byval_arg);
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, ins, vtvar->inst_c0);
+ } else {
+ if ((ip [5] == CEE_CALL) && (cmethod = mono_get_method_full (image, read32 (ip + 6), NULL, generic_context)) &&
+ (cmethod->klass == mono_defaults.monotype_class->parent) &&
+ (strcmp (cmethod->name, "GetTypeFromHandle") == 0) &&
+ ((g_hash_table_lookup (bbhash, ip + 5) == NULL) ||
+ (g_hash_table_lookup (bbhash, ip + 5) == bblock))) {
+ MonoClass *tclass = mono_class_from_mono_type (handle);
+ mono_class_init (tclass);
+ if (mono_compile_aot)
+ NEW_TYPE_FROM_HANDLE_CONST (cfg, ins, image, n);
+ else
+ NEW_PCONST (cfg, ins, mono_type_get_object (cfg->domain, handle));
+ ins->type = STACK_OBJ;
+ ins->klass = cmethod->klass;
+ ip += 5;
+ } else {
+ MonoInst *store, *addr, *vtvar;
+
+ if (mono_compile_aot)
+ NEW_LDTOKENCONST (cfg, ins, image, n);
+ else
+ NEW_PCONST (cfg, ins, handle);
+ vtvar = mono_compile_create_var (cfg, &handle_class->byval_arg, OP_LOCAL);
+ NEW_TEMPLOADA (cfg, addr, vtvar->inst_c0);
+ NEW_INDSTORE (cfg, store, addr, ins, &mono_defaults.int_class->byval_arg);
+ MONO_ADD_INS (bblock, store);
+ NEW_TEMPLOAD (cfg, ins, vtvar->inst_c0);
+ }
+ }
+
+ *sp++ = ins;
+ ip += 5;
+ break;
+ }
+ case CEE_CONV_U2:
+ case CEE_CONV_U1:
+ case CEE_CONV_I:
+ CHECK_STACK (1);
+ ADD_UNOP (*ip);
+ ip++;
+ break;
+ case CEE_ADD_OVF:
+ case CEE_ADD_OVF_UN:
+ case CEE_MUL_OVF:
+ case CEE_MUL_OVF_UN:
+ case CEE_SUB_OVF:
+ case CEE_SUB_OVF_UN:
+ CHECK_STACK (2);
+ ADD_BINOP (*ip);
+ if (mono_find_jit_opcode_emulation (ins->opcode)) {
+ --sp;
+ *sp++ = emit_tree (cfg, bblock, ins);
+ }
+ ip++;
+ break;
+ case CEE_ENDFINALLY:
+ MONO_INST_NEW (cfg, ins, *ip);
+ MONO_ADD_INS (bblock, ins);
+ ins->cil_code = ip++;
+ start_new_bblock = 1;
+
+ /*
+ * Control will leave the method so empty the stack, otherwise
+ * the next basic block will start with a nonempty stack.
+ */
+ while (sp != stack_start) {
+ MONO_INST_NEW (cfg, ins, CEE_POP);
+ ins->cil_code = ip;
+ sp--;
+ ins->inst_i0 = *sp;
+ MONO_ADD_INS (bblock, ins);
+ }
+ break;
+ case CEE_LEAVE:
+ case CEE_LEAVE_S: {
+ GList *handlers;
+ if (*ip == CEE_LEAVE) {
+ CHECK_OPSIZE (5);
+ target = ip + 5 + (gint32)read32(ip + 1);
+ } else {
+ CHECK_OPSIZE (2);
+ target = ip + 2 + (signed char)(ip [1]);
+ }
+
+ /* empty the stack */
+ while (sp != stack_start) {
+ MONO_INST_NEW (cfg, ins, CEE_POP);
+ ins->cil_code = ip;
+ sp--;
+ ins->inst_i0 = *sp;
+ MONO_ADD_INS (bblock, ins);
+ }
+
+ /*
+ * If this leave statement is in a catch block, check for a
+ * pending exception, and rethrow it if necessary.
+ */
+ for (i = 0; i < header->num_clauses; ++i) {
+ MonoExceptionClause *clause = &header->clauses [i];
+ if (MONO_OFFSET_IN_HANDLER (clause, ip - header->code)) {
+ int temp;
+
+ temp = mono_emit_jit_icall (cfg, bblock, mono_thread_get_pending_exception, NULL, ip);
+ NEW_TEMPLOAD (cfg, *sp, temp);
+
+ MONO_INST_NEW (cfg, ins, OP_THROW_OR_NULL);
+ ins->inst_left = *sp;
+ ins->cil_code = ip;
+ MONO_ADD_INS (bblock, ins);
+ }
+ }
+
+ /* fixme: call fault handler ? */
+
+ if ((handlers = mono_find_final_block (cfg, ip, target, MONO_EXCEPTION_CLAUSE_FINALLY))) {
+ GList *tmp;
+ for (tmp = handlers; tmp; tmp = tmp->next) {
+ tblock = tmp->data;
+ link_bblock (cfg, bblock, tblock);
+ MONO_INST_NEW (cfg, ins, OP_CALL_HANDLER);
+ ins->cil_code = ip;
+ ins->inst_target_bb = tblock;
+ MONO_ADD_INS (bblock, ins);
+ }
+ g_list_free (handlers);
+ }
+
+ MONO_INST_NEW (cfg, ins, CEE_BR);
+ ins->cil_code = ip;
+ MONO_ADD_INS (bblock, ins);
+ GET_BBLOCK (cfg, bbhash, tblock, target);
+ link_bblock (cfg, bblock, tblock);
+ CHECK_BBLOCK (target, ip, tblock);
+ ins->inst_target_bb = tblock;
+ start_new_bblock = 1;
+
+ if (*ip == CEE_LEAVE)
+ ip += 5;
+ else
+ ip += 2;
+
+ break;
+ }
+ case CEE_STIND_I:
+ CHECK_STACK (2);
+ MONO_INST_NEW (cfg, ins, *ip);
+ sp -= 2;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ MONO_ADD_INS (bblock, ins);
+ ins->cil_code = ip++;
+ ins->inst_i0 = sp [0];
+ ins->inst_i1 = sp [1];
+ inline_costs += 1;
+ break;
+ case CEE_CONV_U:
+ CHECK_STACK (1);
+ ADD_UNOP (*ip);
+ ip++;
+ break;
+ /* trampoline mono specific opcodes */
+ case MONO_CUSTOM_PREFIX: {
+
+ g_assert (method->wrapper_type != MONO_WRAPPER_NONE);
+
+ CHECK_OPSIZE (2);
+ switch (ip [1]) {
+
+ case CEE_MONO_ICALL: {
+ int temp;
+ gpointer func;
+ MonoJitICallInfo *info;
+
+ token = read32 (ip + 2);
+ func = mono_method_get_wrapper_data (method, token);
+ info = mono_find_jit_icall_by_addr (func);
+ g_assert (info);
+
+ CHECK_STACK (info->sig->param_count);
+ sp -= info->sig->param_count;
+
+ temp = mono_emit_jit_icall (cfg, bblock, info->func, sp, ip);
+ if (!MONO_TYPE_IS_VOID (info->sig->ret)) {
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp++;
+ }
+
+ ip += 6;
+ inline_costs += 10 * num_calls++;
+
+ break;
+ }
+ case CEE_MONO_LDPTR:
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ NEW_PCONST (cfg, ins, mono_method_get_wrapper_data (method, token));
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 6;
+ inline_costs += 10 * num_calls++;
+ break;
+ case CEE_MONO_VTADDR:
+ CHECK_STACK (1);
+ --sp;
+ MONO_INST_NEW (cfg, ins, OP_VTADDR);
+ ins->cil_code = ip;
+ ins->type = STACK_MP;
+ ins->inst_left = *sp;
+ *sp++ = ins;
+ ip += 2;
+ break;
+ case CEE_MONO_NEWOBJ: {
+ MonoInst *iargs [2];
+ int temp;
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ mono_class_init (klass);
+ NEW_DOMAINCONST (cfg, iargs [0]);
+ NEW_CLASSCONST (cfg, iargs [1], klass);
+ temp = mono_emit_jit_icall (cfg, bblock, mono_object_new, iargs, ip);
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp++;
+ ip += 6;
+ inline_costs += 10 * num_calls++;
+ break;
+ }
+ case CEE_MONO_OBJADDR:
+ CHECK_STACK (1);
+ --sp;
+ MONO_INST_NEW (cfg, ins, OP_OBJADDR);
+ ins->cil_code = ip;
+ ins->type = STACK_MP;
+ ins->inst_left = *sp;
+ *sp++ = ins;
+ ip += 2;
+ break;
+ case CEE_MONO_LDNATIVEOBJ:
+ CHECK_STACK (1);
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ klass = mono_method_get_wrapper_data (method, token);
+ g_assert (klass->valuetype);
+ mono_class_init (klass);
+ NEW_INDLOAD (cfg, ins, sp [-1], &klass->byval_arg);
+ sp [-1] = ins;
+ ip += 6;
+ break;
+ case CEE_MONO_RETOBJ:
+ g_assert (cfg->ret);
+ g_assert (method->signature->pinvoke);
+ CHECK_STACK (1);
+ --sp;
+
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+
+ NEW_RETLOADA (cfg, ins);
+ handle_stobj (cfg, bblock, ins, *sp, ip, klass, FALSE, TRUE);
+
+ if (sp != stack_start)
+ goto unverified;
+
+ MONO_INST_NEW (cfg, ins, CEE_BR);
+ ins->cil_code = ip;
+ ins->inst_target_bb = end_bblock;
+ MONO_ADD_INS (bblock, ins);
+ link_bblock (cfg, bblock, end_bblock);
+ start_new_bblock = 1;
+ ip += 6;
+ break;
+ case CEE_MONO_CISINST:
+ case CEE_MONO_CCASTCLASS: {
+ int token;
+ CHECK_STACK (1);
+ --sp;
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ klass = (MonoClass *)mono_method_get_wrapper_data (method, token);
+ MONO_INST_NEW (cfg, ins, (ip [1] == CEE_MONO_CISINST) ? OP_CISINST : OP_CCASTCLASS);
+ ins->type = STACK_I4;
+ ins->inst_left = *sp;
+ ins->inst_newa_class = klass;
+ ins->cil_code = ip;
+ *sp++ = emit_tree (cfg, bblock, ins);
+ ip += 6;
+ break;
+ }
+ case CEE_MONO_SAVE_LMF:
+ case CEE_MONO_RESTORE_LMF:
+#ifdef MONO_ARCH_HAVE_LMF_OPS
+ MONO_INST_NEW (cfg, ins, (ip [1] == CEE_MONO_SAVE_LMF) ? OP_SAVE_LMF : OP_RESTORE_LMF);
+ MONO_ADD_INS (bblock, ins);
+ cfg->need_lmf_area = TRUE;
+#endif
+ ip += 2;
+ break;
+ default:
+ g_error ("opcode 0x%02x 0x%02x not handled", MONO_CUSTOM_PREFIX, ip [1]);
+ break;
+ }
+ break;
+ }
+ case CEE_PREFIX1: {
+ CHECK_OPSIZE (2);
+ switch (ip [1]) {
+ case CEE_ARGLIST: {
+ /* somewhat similar to LDTOKEN */
+ MonoInst *addr, *vtvar;
+ CHECK_STACK_OVF (1);
+ vtvar = mono_compile_create_var (cfg, &mono_defaults.argumenthandle_class->byval_arg, OP_LOCAL);
+
+ NEW_TEMPLOADA (cfg, addr, vtvar->inst_c0);
+ addr->cil_code = ip;
+ MONO_INST_NEW (cfg, ins, OP_ARGLIST);
+ ins->cil_code = ip;
+ ins->inst_left = addr;
+ MONO_ADD_INS (bblock, ins);
+ NEW_TEMPLOAD (cfg, ins, vtvar->inst_c0);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 2;
+ break;
+ }
+ case CEE_CEQ:
+ case CEE_CGT:
+ case CEE_CGT_UN:
+ case CEE_CLT:
+ case CEE_CLT_UN: {
+ MonoInst *cmp;
+ CHECK_STACK (2);
+ /*
+ * The following transforms:
+ * CEE_CEQ into OP_CEQ
+ * CEE_CGT into OP_CGT
+ * CEE_CGT_UN into OP_CGT_UN
+ * CEE_CLT into OP_CLT
+ * CEE_CLT_UN into OP_CLT_UN
+ */
+ MONO_INST_NEW (cfg, cmp, 256 + ip [1]);
+
+ MONO_INST_NEW (cfg, ins, cmp->opcode);
+ sp -= 2;
+ cmp->inst_i0 = sp [0];
+ cmp->inst_i1 = sp [1];
+ cmp->cil_code = ip;
+ type_from_op (cmp);
+ CHECK_TYPE (cmp);
+ if ((sp [0]->type == STACK_I8) || ((sizeof (gpointer) == 8) && ((sp [0]->type == STACK_PTR) || (sp [0]->type == STACK_OBJ) || (sp [0]->type == STACK_MP))))
+ cmp->opcode = OP_LCOMPARE;
+ else
+ cmp->opcode = OP_COMPARE;
+ ins->cil_code = ip;
+ ins->type = STACK_I4;
+ ins->inst_i0 = cmp;
+ *sp++ = ins;
+ /* spill it to reduce the expression complexity
+ * and workaround bug 54209
+ */
+ if (cmp->inst_left->type == STACK_I8) {
+ --sp;
+ *sp++ = emit_tree (cfg, bblock, ins);
+ }
+ ip += 2;
+ break;
+ }
+ case CEE_LDFTN: {
+ MonoInst *argconst;
+ int temp;
+
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (6);
+ n = read32 (ip + 2);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ cmethod = mono_method_get_wrapper_data (method, n);
+ else {
+ cmethod = mono_get_method_full (image, n, NULL, generic_context);
+ }
+
+ mono_class_init (cmethod->klass);
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+ NEW_METHODCONST (cfg, argconst, cmethod);
+ if (method->wrapper_type != MONO_WRAPPER_SYNCHRONIZED)
+ temp = mono_emit_jit_icall (cfg, bblock, mono_ldftn, &argconst, ip);
+ else
+ temp = mono_emit_jit_icall (cfg, bblock, mono_ldftn_nosync, &argconst, ip);
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp ++;
+
+ ip += 6;
+ inline_costs += 10 * num_calls++;
+ break;
+ }
+ case CEE_LDVIRTFTN: {
+ MonoInst *args [2];
+ int temp;
+
+ CHECK_STACK (1);
+ CHECK_OPSIZE (6);
+ n = read32 (ip + 2);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ cmethod = mono_method_get_wrapper_data (method, n);
+ else
+ cmethod = mono_get_method_full (image, n, NULL, generic_context);
+
+ mono_class_init (cmethod->klass);
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+
+ --sp;
+ args [0] = *sp;
+ NEW_METHODCONST (cfg, args [1], cmethod);
+ temp = mono_emit_jit_icall (cfg, bblock, mono_ldvirtfn, args, ip);
+ NEW_TEMPLOAD (cfg, *sp, temp);
+ sp ++;
+
+ ip += 6;
+ inline_costs += 10 * num_calls++;
+ break;
+ }
+ case CEE_LDARG:
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (4);
+ n = read16 (ip + 2);
+ CHECK_ARG (n);
+ NEW_ARGLOAD (cfg, ins, n);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 4;
+ break;
+ case CEE_LDARGA:
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (4);
+ n = read16 (ip + 2);
+ CHECK_ARG (n);
+ NEW_ARGLOADA (cfg, ins, n);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 4;
+ break;
+ case CEE_STARG:
+ CHECK_STACK (1);
+ --sp;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ CHECK_OPSIZE (4);
+ n = read16 (ip + 2);
+ CHECK_ARG (n);
+ NEW_ARGSTORE (cfg, ins, n, *sp);
+ ins->cil_code = ip;
+ if (ins->opcode == CEE_STOBJ) {
+ NEW_ARGLOADA (cfg, ins, n);
+ handle_stobj (cfg, bblock, ins, *sp, ip, ins->klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, ins);
+ ip += 4;
+ break;
+ case CEE_LDLOC:
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (4);
+ n = read16 (ip + 2);
+ CHECK_LOCAL (n);
+ NEW_LOCLOAD (cfg, ins, n);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 4;
+ break;
+ case CEE_LDLOCA:
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (4);
+ n = read16 (ip + 2);
+ CHECK_LOCAL (n);
+ NEW_LOCLOADA (cfg, ins, n);
+ ins->cil_code = ip;
+ *sp++ = ins;
+ ip += 4;
+ break;
+ case CEE_STLOC:
+ CHECK_STACK (1);
+ --sp;
+ CHECK_OPSIZE (4);
+ n = read16 (ip + 2);
+ CHECK_LOCAL (n);
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ NEW_LOCSTORE (cfg, ins, n, *sp);
+ ins->cil_code = ip;
+ if (ins->opcode == CEE_STOBJ) {
+ NEW_LOCLOADA (cfg, ins, n);
+ handle_stobj (cfg, bblock, ins, *sp, ip, ins->klass, FALSE, FALSE);
+ } else
+ MONO_ADD_INS (bblock, ins);
+ ip += 4;
+ inline_costs += 1;
+ break;
+ case CEE_LOCALLOC:
+ CHECK_STACK (1);
+ --sp;
+ if (sp != stack_start)
+ goto unverified;
+ MONO_INST_NEW (cfg, ins, OP_LOCALLOC);
+ ins->inst_left = *sp;
+ ins->cil_code = ip;
+ ins->type = STACK_MP;
+
+ cfg->flags |= MONO_CFG_HAS_ALLOCA;
+ if (header->init_locals)
+ ins->flags |= MONO_INST_INIT;
+
+ *sp++ = ins;
+ ip += 2;
+ /* FIXME: set init flag if locals init is set in this method */
+ break;
+ case CEE_ENDFILTER: {
+ MonoExceptionClause *clause, *nearest;
+ int cc, nearest_num;
+
+ CHECK_STACK (1);
+ --sp;
+ if ((sp != stack_start) || (sp [0]->type != STACK_I4))
+ goto unverified;
+ MONO_INST_NEW (cfg, ins, OP_ENDFILTER);
+ ins->inst_left = *sp;
+ ins->cil_code = ip;
+ MONO_ADD_INS (bblock, ins);
+ start_new_bblock = 1;
+ ip += 2;
+
+ nearest = NULL;
+ nearest_num = 0;
+ for (cc = 0; cc < header->num_clauses; ++cc) {
+ clause = &header->clauses [cc];
+ if ((clause->flags & MONO_EXCEPTION_CLAUSE_FILTER) &&
+ (!nearest || (clause->data.filter_offset > nearest->data.filter_offset))) {
+ nearest = clause;
+ nearest_num = cc;
+ }
+ }
+ g_assert (nearest);
+ filter_lengths [nearest_num] = (ip - header->code) - nearest->data.filter_offset;
+
+ break;
+ }
+ case CEE_UNALIGNED_:
+ ins_flag |= MONO_INST_UNALIGNED;
+ /* FIXME: record alignment? we can assume 1 for now */
+ CHECK_OPSIZE (3);
+ ip += 3;
+ break;
+ case CEE_VOLATILE_:
+ ins_flag |= MONO_INST_VOLATILE;
+ ip += 2;
+ break;
+ case CEE_TAIL_:
+ ins_flag |= MONO_INST_TAILCALL;
+ cfg->flags |= MONO_CFG_HAS_TAIL;
+ /* Can't inline tail calls at this time */
+ inline_costs += 100000;
+ ip += 2;
+ break;
+ case CEE_INITOBJ:
+ CHECK_STACK (1);
+ --sp;
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ if (method->wrapper_type != MONO_WRAPPER_NONE)
+ klass = mono_method_get_wrapper_data (method, token);
+ else
+ klass = mono_class_get_full (image, token, generic_context);
+ if (MONO_TYPE_IS_REFERENCE (&klass->byval_arg)) {
+ MonoInst *store, *load;
+ NEW_PCONST (cfg, load, NULL);
+ load->cil_code = ip;
+ load->type = STACK_OBJ;
+ MONO_INST_NEW (cfg, store, CEE_STIND_REF);
+ store->cil_code = ip;
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ MONO_ADD_INS (bblock, store);
+ store->inst_i0 = sp [0];
+ store->inst_i1 = load;
+ } else {
+ handle_initobj (cfg, bblock, *sp, NULL, klass, stack_start, sp);
+ }
+ ip += 6;
+ inline_costs += 1;
+ break;
+ case CEE_CONSTRAINED_:
+ /* FIXME: implement */
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ constrained_call = mono_class_get_full (image, token, generic_context);
+ ip += 6;
+ break;
+ case CEE_CPBLK:
+ case CEE_INITBLK: {
+ MonoInst *iargs [3];
+ CHECK_STACK (3);
+ sp -= 3;
+ if ((cfg->opt & MONO_OPT_INTRINS) && (ip [1] == CEE_CPBLK) && (sp [2]->opcode == OP_ICONST) && ((n = sp [2]->inst_c0) <= sizeof (gpointer) * 5)) {
+ MonoInst *copy;
+ MONO_INST_NEW (cfg, copy, OP_MEMCPY);
+ copy->inst_left = sp [0];
+ copy->inst_right = sp [1];
+ copy->cil_code = ip;
+ copy->unused = n;
+ MONO_ADD_INS (bblock, copy);
+ ip += 2;
+ break;
+ }
+ iargs [0] = sp [0];
+ iargs [1] = sp [1];
+ iargs [2] = sp [2];
+ handle_loaded_temps (cfg, bblock, stack_start, sp);
+ if (ip [1] == CEE_CPBLK) {
+ mono_emit_jit_icall (cfg, bblock, helper_memcpy, iargs, ip);
+ } else {
+ mono_emit_jit_icall (cfg, bblock, helper_memset, iargs, ip);
+ }
+ ip += 2;
+ inline_costs += 1;
+ break;
+ }
+ case CEE_NO_:
+ CHECK_OPSIZE (3);
+ if (ip [2] & 0x1)
+ ins_flag |= MONO_INST_NOTYPECHECK;
+ if (ip [2] & 0x2)
+ ins_flag |= MONO_INST_NORANGECHECK;
+ /* we ignore the no-nullcheck for now since we
+ * really do it explicitly only when doing callvirt->call
+ */
+ ip += 3;
+ break;
+ case CEE_RETHROW: {
+ MonoInst *load;
+ /* FIXME: check we are in a catch handler */
+ NEW_TEMPLOAD (cfg, load, cfg->exvar->inst_c0);
+ load->cil_code = ip;
+#ifdef MONO_ARCH_HAVE_RETHROW
+ MONO_INST_NEW (cfg, ins, OP_RETHROW);
+#else
+ MONO_INST_NEW (cfg, ins, CEE_THROW);
+#endif
+ ins->inst_left = load;
+ ins->cil_code = ip;
+ MONO_ADD_INS (bblock, ins);
+ sp = stack_start;
+ start_new_bblock = 1;
+ ip += 2;
+ break;
+ }
+ case CEE_SIZEOF:
+ CHECK_STACK_OVF (1);
+ CHECK_OPSIZE (6);
+ token = read32 (ip + 2);
+ /* FIXXME: handle generics. */
+ if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC) {
+ MonoType *type = mono_type_create_from_typespec (image, token);
+ token = mono_type_size (type, &align);
+ } else {
+ MonoClass *szclass = mono_class_get_full (image, token, generic_context);
+ mono_class_init (szclass);
+ token = mono_class_value_size (szclass, &align);
+ }
+ NEW_ICONST (cfg, ins, token);
+ ins->cil_code = ip;
+ *sp++= ins;
+ ip += 6;
+ break;
+ case CEE_REFANYTYPE:
+ CHECK_STACK (1);
+ MONO_INST_NEW (cfg, ins, OP_REFANYTYPE);
+ --sp;
+ ins->type = STACK_MP;
+ ins->inst_left = *sp;
+ ins->type = STACK_VTYPE;
+ ins->klass = mono_defaults.typehandle_class;
+ ins->cil_code = ip;
+ ip += 2;
+ *sp++ = ins;
+ break;
+ case CEE_READONLY_:
+ ip += 2;
+ break;
+ default:
+ g_error ("opcode 0xfe 0x%02x not handled", ip [1]);
+ }
+ break;
+ }
+ default:
+ g_error ("opcode 0x%02x not handled", *ip);
+ }
+ }
+ if (start_new_bblock != 1)
+ goto unverified;
+
+ bblock->cil_length = ip - bblock->cil_code;
+ bblock->next_bb = end_bblock;
+ link_bblock (cfg, bblock, end_bblock);
+
+ if (cfg->method == method && cfg->domainvar) {
+
+
+ MonoInst *store;
+ MonoInst *get_domain;
+
+ if (! (get_domain = mono_arch_get_domain_intrinsic (cfg))) {
+ MonoCallInst *call;
+
+ MONO_INST_NEW_CALL (cfg, call, CEE_CALL);
+ call->signature = helper_sig_domain_get;
+ call->inst.type = STACK_PTR;
+ call->fptr = mono_domain_get;
+ get_domain = (MonoInst*)call;
+ }
+
+ NEW_TEMPSTORE (cfg, store, cfg->domainvar->inst_c0, get_domain);
+ MONO_ADD_INS (init_localsbb, store);
+ }
+
+ if (header->init_locals) {
+ MonoInst *store;
+ for (i = 0; i < header->num_locals; ++i) {
+ MonoType *ptype = header->locals [i];
+ int t = ptype->type;
+ if (t == MONO_TYPE_VALUETYPE && ptype->data.klass->enumtype)
+ t = ptype->data.klass->enum_basetype->type;
+ /* FIXME: use initobj for valuetypes, handle pointers, long, float. */
+ if (t >= MONO_TYPE_BOOLEAN && t <= MONO_TYPE_U4) {
+ NEW_ICONST (cfg, ins, 0);
+ NEW_LOCSTORE (cfg, store, i, ins);
+ MONO_ADD_INS (init_localsbb, store);
+ } else if (t == MONO_TYPE_I8 || t == MONO_TYPE_U8) {
+ MONO_INST_NEW (cfg, ins, OP_I8CONST);
+ ins->type = STACK_I8;
+ ins->inst_l = 0;
+ NEW_LOCSTORE (cfg, store, i, ins);
+ MONO_ADD_INS (init_localsbb, store);
+ } else if (t == MONO_TYPE_R4 || t == MONO_TYPE_R8) {
+ MONO_INST_NEW (cfg, ins, OP_R8CONST);
+ ins->type = STACK_R8;
+ ins->inst_p0 = (void*)&r8_0;
+ NEW_LOCSTORE (cfg, store, i, ins);
+ MONO_ADD_INS (init_localsbb, store);
+ } else if ((t == MONO_TYPE_VALUETYPE) || (t == MONO_TYPE_TYPEDBYREF) ||
+ ((t == MONO_TYPE_GENERICINST) && mono_metadata_generic_inst_is_valuetype (ptype->data.generic_inst))) {
+ NEW_LOCLOADA (cfg, ins, i);
+ handle_initobj (cfg, init_localsbb, ins, NULL, mono_class_from_mono_type (ptype), NULL, NULL);
+ break;
+ } else {
+ NEW_PCONST (cfg, ins, NULL);
+ NEW_LOCSTORE (cfg, store, i, ins);
+ MONO_ADD_INS (init_localsbb, store);
+ }
+ }
+ }
+
+
+ /* resolve backward branches in the middle of an existing basic block */
+ for (tmp = bb_recheck; tmp; tmp = tmp->next) {
+ bblock = tmp->data;
+ /*g_print ("need recheck in %s at IL_%04x\n", method->name, bblock->cil_code - header->code);*/
+ tblock = find_previous (bbhash, start_bblock, bblock->cil_code);
+ if (tblock != start_bblock) {
+ int l;
+ split_bblock (cfg, tblock, bblock);
+ l = bblock->cil_code - header->code;
+ bblock->cil_length = tblock->cil_length - l;
+ tblock->cil_length = l;
+ } else {
+ g_print ("recheck failed.\n");
+ }
+ }
+
+ /*
+ * we compute regions here, because the length of filter clauses is not known in advance.
+ * It is computed in the CEE_ENDFILTER case in the above switch statement
+ */
+ if (cfg->method == method) {
+ MonoBasicBlock *bb;
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ bb->region = mono_find_block_region (cfg, bb->real_offset, filter_lengths);
+ if (cfg->spvars)
+ mono_create_spvar_for_region (cfg, bb->region);
+ if (cfg->verbose_level > 2)
+ g_print ("REGION BB%d IL_%04x ID_%08X\n", bb->block_num, bb->real_offset, bb->region);
+ }
+ } else {
+ g_hash_table_destroy (bbhash);
+ }
+
+ dont_inline = g_list_remove (dont_inline, method);
+ return inline_costs;
+
+ inline_failure:
+ if (cfg->method != method)
+ g_hash_table_destroy (bbhash);
+ dont_inline = g_list_remove (dont_inline, method);
+ return -1;
+
+ unverified:
+ if (cfg->method != method)
+ g_hash_table_destroy (bbhash);
+ g_error ("Invalid IL code at IL%04x in %s: %s\n", ip - header->code,
+ mono_method_full_name (method, TRUE), mono_disasm_code_one (NULL, method, ip, NULL));
+ dont_inline = g_list_remove (dont_inline, method);
+ return -1;
+}
+
+void
+mono_print_tree (MonoInst *tree) {
+ int arity;
+
+ if (!tree)
+ return;
+
+ arity = mono_burg_arity [tree->opcode];
+
+ printf (" %s%s", arity?"(":"", mono_inst_name (tree->opcode));
+
+ switch (tree->opcode) {
+ case OP_ICONST:
+ printf ("[%d]", tree->inst_c0);
+ break;
+ case OP_I8CONST:
+ printf ("[%lld]", tree->inst_l);
+ break;
+ case OP_R8CONST:
+ printf ("[%f]", *(double*)tree->inst_p0);
+ break;
+ case OP_R4CONST:
+ printf ("[%f]", *(float*)tree->inst_p0);
+ break;
+ case OP_ARG:
+ case OP_LOCAL:
+ printf ("[%d]", tree->inst_c0);
+ break;
+ case OP_REGOFFSET:
+ if (tree->inst_offset < 0)
+ printf ("[-0x%x(%s)]", -tree->inst_offset, mono_arch_regname (tree->inst_basereg));
+ else
+ printf ("[0x%x(%s)]", tree->inst_offset, mono_arch_regname (tree->inst_basereg));
+ break;
+ case OP_REGVAR:
+ printf ("[%s]", mono_arch_regname (tree->dreg));
+ break;
+ case CEE_NEWARR:
+ printf ("[%s]", tree->inst_newa_class->name);
+ mono_print_tree (tree->inst_newa_len);
+ break;
+ case CEE_CALL:
+ case CEE_CALLVIRT:
+ case OP_FCALL:
+ case OP_FCALLVIRT:
+ case OP_LCALL:
+ case OP_LCALLVIRT:
+ case OP_VCALL:
+ case OP_VCALLVIRT:
+ case OP_VOIDCALL:
+ case OP_VOIDCALLVIRT: {
+ MonoCallInst *call = (MonoCallInst*)tree;
+ if (call->method)
+ printf ("[%s]", call->method->name);
+ break;
+ }
+ case OP_PHI: {
+ int i;
+ printf ("[%d (", tree->inst_c0);
+ for (i = 0; i < tree->inst_phi_args [0]; i++) {
+ if (i)
+ printf (", ");
+ printf ("%d", tree->inst_phi_args [i + 1]);
+ }
+ printf (")]");
+ break;
+ }
+ case OP_RENAME:
+ case OP_RETARG:
+ case CEE_NOP:
+ case CEE_JMP:
+ case CEE_BREAK:
+ break;
+ case OP_LOAD_MEMBASE:
+ case OP_LOADI4_MEMBASE:
+ case OP_LOADU4_MEMBASE:
+ case OP_LOADU1_MEMBASE:
+ case OP_LOADI1_MEMBASE:
+ case OP_LOADU2_MEMBASE:
+ case OP_LOADI2_MEMBASE:
+ printf ("[%s] <- [%s + 0x%x]", mono_arch_regname (tree->dreg), mono_arch_regname (tree->inst_basereg), tree->inst_offset);
+ break;
+ case CEE_BR:
+ printf ("[B%d]", tree->inst_target_bb->block_num);
+ break;
+ case CEE_SWITCH:
+ case CEE_ISINST:
+ case CEE_CASTCLASS:
+ case OP_OUTARG:
+ case OP_CALL_REG:
+ case OP_FCALL_REG:
+ case OP_LCALL_REG:
+ case OP_VCALL_REG:
+ case OP_VOIDCALL_REG:
+ mono_print_tree (tree->inst_left);
+ break;
+ case CEE_BNE_UN:
+ case CEE_BEQ:
+ case CEE_BLT:
+ case CEE_BLT_UN:
+ case CEE_BGT:
+ case CEE_BGT_UN:
+ case CEE_BGE:
+ case CEE_BGE_UN:
+ case CEE_BLE:
+ case CEE_BLE_UN:
+ printf ("[B%dB%d]", tree->inst_true_bb->block_num, tree->inst_false_bb->block_num);
+ mono_print_tree (tree->inst_left);
+ break;
+ default:
+ if (!mono_arch_print_tree(tree, arity)) {
+ if (arity) {
+ mono_print_tree (tree->inst_left);
+ if (arity > 1)
+ mono_print_tree (tree->inst_right);
+ }
+ }
+ break;
+ }
+
+ if (arity)
+ printf (")");
+}
+
+void
+mono_print_tree_nl (MonoInst *tree)
+{
+ mono_print_tree (tree);
+ printf ("\n");
+}
+
+#define make_icall_sig mono_create_icall_signature
+
+static void
+create_helper_signature (void)
+{
+ /* MonoArray * mono_array_new (MonoDomain *domain, MonoClass *klass, gint32 len) */
+ helper_sig_newarr = make_icall_sig ("object ptr ptr int32");
+
+ /* MonoArray * mono_array_new_specific (MonoVTable *vtable, guint32 len) */
+ helper_sig_newarr_specific = make_icall_sig ("object ptr int32");
+
+ /* MonoObject * mono_object_new (MonoDomain *domain, MonoClass *klass) */
+ helper_sig_object_new = make_icall_sig ("object ptr ptr");
+
+ /* MonoObject * mono_object_new_specific (MonoVTable *vtable) */
+ helper_sig_object_new_specific = make_icall_sig ("object ptr");
+
+ /* void* mono_method_compile (MonoMethod*) */
+ helper_sig_compile = make_icall_sig ("ptr ptr");
+
+ /* void* mono_ldvirtfn (MonoObject *, MonoMethod*) */
+ helper_sig_compile_virt = make_icall_sig ("ptr object ptr");
+
+ /* MonoString* mono_ldstr (MonoDomain *domain, MonoImage *image, guint32 str_index) */
+ helper_sig_ldstr = make_icall_sig ("object ptr ptr int32");
+
+ /* MonoDomain *mono_domain_get (void) */
+ helper_sig_domain_get = make_icall_sig ("ptr");
+
+ /* void stelem_ref (MonoArray *, int index, MonoObject *) */
+ helper_sig_stelem_ref = make_icall_sig ("void ptr int32 object");
+
+ /* void stelem_ref_check (MonoArray *, MonoObject *) */
+ helper_sig_stelem_ref_check = make_icall_sig ("void object object");
+
+ /* long amethod (long, long) */
+ helper_sig_long_long_long = make_icall_sig ("long long long");
+
+ /* object amethod (intptr) */
+ helper_sig_obj_ptr = make_icall_sig ("object ptr");
+
+ helper_sig_obj_ptr_ptr = make_icall_sig ("object ptr ptr");
+
+ helper_sig_obj_obj_ptr_ptr = make_icall_sig ("object object ptr ptr");
+
+ helper_sig_void_void = make_icall_sig ("void");
+
+ /* void amethod (intptr) */
+ helper_sig_void_ptr = make_icall_sig ("void ptr");
+
+ /* void amethod (MonoObject *obj) */
+ helper_sig_void_obj = make_icall_sig ("void object");
+
+ /* void amethod (MonoObject *obj, void *ptr, int i) */
+ helper_sig_void_obj_ptr_int = make_icall_sig ("void object ptr int");
+
+ helper_sig_void_obj_ptr_ptr_obj = make_icall_sig ("void object ptr ptr object");
+
+ /* intptr amethod (void) */
+ helper_sig_ptr_void = make_icall_sig ("ptr");
+
+ /* object amethod (void) */
+ helper_sig_obj_void = make_icall_sig ("object");
+
+ /* void amethod (intptr, intptr) */
+ helper_sig_void_ptr_ptr = make_icall_sig ("void ptr ptr");
+
+ /* void amethod (intptr, intptr, intptr) */
+ helper_sig_void_ptr_ptr_ptr = make_icall_sig ("void ptr ptr ptr");
+
+ /* intptr amethod (intptr, intptr) */
+ helper_sig_ptr_ptr_ptr = make_icall_sig ("ptr ptr ptr");
+
+ /* IntPtr amethod (object) */
+ helper_sig_ptr_obj = make_icall_sig ("ptr object");
+
+ /* IntPtr amethod (object, int) */
+ helper_sig_ptr_obj_int = make_icall_sig ("ptr object int");
+
+ /* IntPtr amethod (int) */
+ helper_sig_ptr_int = make_icall_sig ("ptr int32");
+
+ /* long amethod (long, guint32) */
+ helper_sig_long_long_int = make_icall_sig ("long long int32");
+
+ /* ulong amethod (double) */
+ helper_sig_ulong_double = make_icall_sig ("ulong double");
+
+ /* long amethod (double) */
+ helper_sig_long_double = make_icall_sig ("long double");
+
+ /* double amethod (long) */
+ helper_sig_double_long = make_icall_sig ("double long");
+
+ /* double amethod (int) */
+ helper_sig_double_int = make_icall_sig ("double int32");
+
+ /* float amethod (long) */
+ helper_sig_float_long = make_icall_sig ("float long");
+
+ /* double amethod (double, double) */
+ helper_sig_double_double_double = make_icall_sig ("double double double");
+
+ /* uint amethod (double) */
+ helper_sig_uint_double = make_icall_sig ("uint32 double");
+
+ /* int amethod (double) */
+ helper_sig_int_double = make_icall_sig ("int32 double");
+
+ /* void initobj (intptr, int size) */
+ helper_sig_initobj = make_icall_sig ("void ptr int32");
+
+ /* void memcpy (intptr, intptr, int size) */
+ helper_sig_memcpy = make_icall_sig ("void ptr ptr int32");
+
+ /* void memset (intptr, int val, int size) */
+ helper_sig_memset = make_icall_sig ("void ptr int32 int32");
+
+ helper_sig_class_init_trampoline = make_icall_sig ("void");
+}
+
+gconstpointer
+mono_icall_get_wrapper (MonoJitICallInfo* callinfo)
+{
+ char *name;
+ MonoMethod *wrapper;
+ gconstpointer code;
+
+ if (callinfo->wrapper)
+ return callinfo->wrapper;
+
+ name = g_strdup_printf ("__icall_wrapper_%s", callinfo->name);
+ wrapper = mono_marshal_get_icall_wrapper (callinfo->sig, name, callinfo->func);
+ /* Must be domain neutral since there is only one copy */
+ code = mono_jit_compile_method_with_opt (wrapper, default_opt | MONO_OPT_SHARED);
+
+ if (!callinfo->wrapper) {
+ callinfo->wrapper = code;
+ mono_register_jit_icall_wrapper (callinfo, code);
+ mono_debug_add_icall_wrapper (wrapper, callinfo);
+ }
+
+ g_free (name);
+ return callinfo->wrapper;
+}
+
+gpointer
+mono_create_class_init_trampoline (MonoVTable *vtable)
+{
+ gpointer code;
+
+ /* previously created trampoline code */
+ mono_domain_lock (vtable->domain);
+ code =
+ mono_g_hash_table_lookup (vtable->domain->class_init_trampoline_hash,
+ vtable);
+ mono_domain_unlock (vtable->domain);
+ if (code)
+ return code;
+
+ code = mono_arch_create_class_init_trampoline (vtable);
+
+ /* store trampoline address */
+ mono_domain_lock (vtable->domain);
+ mono_g_hash_table_insert (vtable->domain->class_init_trampoline_hash,
+ vtable, code);
+ mono_domain_unlock (vtable->domain);
+
+ EnterCriticalSection (&jit_mutex);
+ if (!class_init_hash_addr)
+ class_init_hash_addr = g_hash_table_new (NULL, NULL);
+ g_hash_table_insert (class_init_hash_addr, code, vtable);
+ LeaveCriticalSection (&jit_mutex);
+
+ return code;
+}
+
+gpointer
+mono_create_jump_trampoline (MonoDomain *domain, MonoMethod *method,
+ gboolean add_sync_wrapper)
+{
+ MonoJitInfo *ji;
+ gpointer code;
+
+ if (add_sync_wrapper && method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ return mono_create_jump_trampoline (domain, mono_marshal_get_synchronized_wrapper (method), FALSE);
+
+ code = mono_jit_find_compiled_method (domain, method);
+ if (code)
+ return code;
+
+ mono_domain_lock (domain);
+ code = mono_g_hash_table_lookup (domain->jump_trampoline_hash, method);
+ mono_domain_unlock (domain);
+ if (code)
+ return code;
+
+ ji = mono_arch_create_jump_trampoline (method);
+
+ /*
+ * mono_delegate_ctor needs to find the method metadata from the
+ * trampoline address, so we save it here.
+ */
+
+ mono_jit_info_table_add (mono_get_root_domain (), ji);
+
+ mono_domain_lock (domain);
+ mono_g_hash_table_insert (domain->jump_trampoline_hash, method, ji->code_start);
+ mono_domain_unlock (domain);
+
+ return ji->code_start;
+}
+
+gpointer
+mono_create_jit_trampoline (MonoMethod *method)
+{
+ MonoDomain *domain = mono_domain_get ();
+ gpointer tramp;
+
+ /* Trampoline are domain specific, so cache only the one used in the root domain */
+ if ((domain == mono_get_root_domain ()) && method->info)
+ return method->info;
+
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ return mono_create_jit_trampoline (mono_marshal_get_synchronized_wrapper (method));
+
+ tramp = mono_arch_create_jit_trampoline (method);
+ if (domain == mono_get_root_domain ())
+ method->info = tramp;
+
+ return tramp;
+}
+
+MonoVTable*
+mono_find_class_init_trampoline_by_addr (gconstpointer addr)
+{
+ MonoVTable *res;
+
+ EnterCriticalSection (&jit_mutex);
+ if (class_init_hash_addr)
+ res = g_hash_table_lookup (class_init_hash_addr, addr);
+ else
+ res = NULL;
+ LeaveCriticalSection (&jit_mutex);
+ return res;
+}
+
+static void
+mono_dynamic_code_hash_insert (MonoMethod *method, MonoJitDynamicMethodInfo *ji)
+{
+ EnterCriticalSection (&jit_mutex);
+ if (!dynamic_code_hash)
+ dynamic_code_hash = g_hash_table_new (NULL, NULL);
+ g_hash_table_insert (dynamic_code_hash, method, ji);
+ LeaveCriticalSection (&jit_mutex);
+}
+
+static MonoJitDynamicMethodInfo*
+mono_dynamic_code_hash_lookup (MonoMethod *method)
+{
+ MonoJitDynamicMethodInfo *res;
+
+ EnterCriticalSection (&jit_mutex);
+ if (dynamic_code_hash)
+ res = g_hash_table_lookup (dynamic_code_hash, method);
+ else
+ res = NULL;
+ LeaveCriticalSection (&jit_mutex);
+ return res;
+}
+
+void
+mono_register_opcode_emulation (int opcode, const char *name, MonoMethodSignature *sig, gpointer func, gboolean no_throw)
+{
+ MonoJitICallInfo *info;
+
+ if (!emul_opcode_map)
+ emul_opcode_map = g_new0 (MonoJitICallInfo*, OP_LAST + 1);
+
+ g_assert (!sig->hasthis);
+ g_assert (sig->param_count < 3);
+
+ info = mono_register_jit_icall (func, name, sig, no_throw);
+
+ emul_opcode_map [opcode] = info;
+}
+
+static void
+decompose_foreach (MonoInst *tree, gpointer data)
+{
+ static MonoJitICallInfo *newarr_info = NULL;
+ static MonoJitICallInfo *newarr_specific_info = NULL;
+ MonoJitICallInfo *info;
+ int i;
+
+ switch (tree->opcode) {
+ case CEE_NEWARR: {
+ MonoCompile *cfg = data;
+ MonoInst *iargs [3];
+
+ if (!newarr_info) {
+ newarr_info = mono_find_jit_icall_by_addr (mono_array_new);
+ g_assert (newarr_info);
+ newarr_specific_info = mono_find_jit_icall_by_addr (mono_array_new_specific);
+ g_assert (newarr_specific_info);
+ }
+
+ if (cfg->opt & MONO_OPT_SHARED) {
+ NEW_DOMAINCONST (cfg, iargs [0]);
+ NEW_CLASSCONST (cfg, iargs [1], tree->inst_newa_class);
+ iargs [2] = tree->inst_newa_len;
+
+ info = newarr_info;
+ }
+ else {
+ MonoVTable *vtable = mono_class_vtable (cfg->domain, mono_array_class_get (tree->inst_newa_class, 1));
+
+ NEW_VTABLECONST (cfg, iargs [0], vtable);
+ iargs [1] = tree->inst_newa_len;
+
+ info = newarr_specific_info;
+ }
+
+ mono_emulate_opcode (cfg, tree, iargs, info);
+
+ /* Need to decompose arguments after the the opcode is decomposed */
+ for (i = 0; i < info->sig->param_count; ++i)
+ dec_foreach (iargs [i], cfg);
+ break;
+ }
+
+ default:
+ break;
+ }
+}
+
+void
+mono_inst_foreach (MonoInst *tree, MonoInstFunc func, gpointer data) {
+
+ switch (mono_burg_arity [tree->opcode]) {
+ case 0: break;
+ case 1:
+ mono_inst_foreach (tree->inst_left, func, data);
+ break;
+ case 2:
+ mono_inst_foreach (tree->inst_left, func, data);
+ mono_inst_foreach (tree->inst_right, func, data);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ func (tree, data);
+}
+
+G_GNUC_UNUSED
+static void
+mono_print_bb_code (MonoBasicBlock *bb) {
+ if (bb->code) {
+ MonoInst *c = bb->code;
+ while (c) {
+ mono_print_tree (c);
+ g_print ("\n");
+ c = c->next;
+ }
+ }
+}
+
+static void
+print_dfn (MonoCompile *cfg) {
+ int i, j;
+ char *code;
+ MonoBasicBlock *bb;
+
+ g_print ("IR code for method %s\n", mono_method_full_name (cfg->method, TRUE));
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ bb = cfg->bblocks [i];
+ /*if (bb->cil_code) {
+ char* code1, *code2;
+ code1 = mono_disasm_code_one (NULL, cfg->method, bb->cil_code, NULL);
+ if (bb->last_ins->cil_code)
+ code2 = mono_disasm_code_one (NULL, cfg->method, bb->last_ins->cil_code, NULL);
+ else
+ code2 = g_strdup ("");
+
+ code1 [strlen (code1) - 1] = 0;
+ code = g_strdup_printf ("%s -> %s", code1, code2);
+ g_free (code1);
+ g_free (code2);
+ } else*/
+ code = g_strdup ("\n");
+ g_print ("\nBB%d DFN%d (len: %d): %s", bb->block_num, i, bb->cil_length, code);
+ if (bb->code) {
+ MonoInst *c = bb->code;
+ while (c) {
+ mono_print_tree (c);
+ g_print ("\n");
+ c = c->next;
+ }
+ } else {
+
+ }
+
+ g_print ("\tprev:");
+ for (j = 0; j < bb->in_count; ++j) {
+ g_print (" BB%d", bb->in_bb [j]->block_num);
+ }
+ g_print ("\t\tsucc:");
+ for (j = 0; j < bb->out_count; ++j) {
+ g_print (" BB%d", bb->out_bb [j]->block_num);
+ }
+ g_print ("\n\tidom: BB%d\n", bb->idom? bb->idom->block_num: -1);
+
+ if (bb->idom)
+ g_assert (mono_bitset_test_fast (bb->dominators, bb->idom->dfn));
+
+ if (bb->dominators)
+ mono_blockset_print (cfg, bb->dominators, "\tdominators", bb->idom? bb->idom->dfn: -1);
+ if (bb->dfrontier)
+ mono_blockset_print (cfg, bb->dfrontier, "\tdfrontier", -1);
+ g_free (code);
+ }
+
+ g_print ("\n");
+}
+
+void
+mono_bblock_add_inst (MonoBasicBlock *bb, MonoInst *inst)
+{
+ inst->next = NULL;
+ if (bb->last_ins) {
+ g_assert (bb->code);
+ bb->last_ins->next = inst;
+ bb->last_ins = inst;
+ } else {
+ bb->last_ins = bb->code = inst;
+ }
+}
+
+void
+mono_destroy_compile (MonoCompile *cfg)
+{
+ //mono_mempool_stats (cfg->mempool);
+ g_hash_table_destroy (cfg->bb_hash);
+ mono_free_loop_info (cfg);
+ if (cfg->rs)
+ mono_regstate_free (cfg->rs);
+ if (cfg->spvars)
+ g_hash_table_destroy (cfg->spvars);
+ mono_mempool_destroy (cfg->mempool);
+ g_list_free (cfg->ldstr_list);
+
+ g_free (cfg->varinfo);
+ g_free (cfg->vars);
+ g_free (cfg);
+}
+
+#ifdef HAVE_KW_THREAD
+static __thread gpointer mono_lmf_addr;
+#endif
+
+MonoLMF **
+mono_get_lmf_addr (void)
+{
+#ifdef HAVE_KW_THREAD
+ return mono_lmf_addr;
+#else
+ MonoJitTlsData *jit_tls;
+
+ if ((jit_tls = TlsGetValue (mono_jit_tls_id)))
+ return &jit_tls->lmf;
+
+ g_assert_not_reached ();
+ return NULL;
+#endif
+}
+
+/**
+ * mono_thread_abort:
+ * @obj: exception object
+ *
+ * abort the thread, print exception information and stack trace
+ */
+static void
+mono_thread_abort (MonoObject *obj)
+{
+ /* MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id); */
+
+ /* handle_remove should be eventually called for this thread, too
+ g_free (jit_tls);*/
+
+ mono_thread_exit ();
+}
+
+static void*
+setup_jit_tls_data (gpointer stack_start, gpointer abort_func)
+{
+ MonoJitTlsData *jit_tls;
+ MonoLMF *lmf;
+
+ jit_tls = TlsGetValue (mono_jit_tls_id);
+ if (jit_tls)
+ return jit_tls;
+
+ jit_tls = g_new0 (MonoJitTlsData, 1);
+
+ TlsSetValue (mono_jit_tls_id, jit_tls);
+
+ jit_tls->abort_func = abort_func;
+ jit_tls->end_of_stack = stack_start;
+
+ lmf = g_new0 (MonoLMF, 1);
+ lmf->ebp = -1;
+
+ jit_tls->lmf = jit_tls->first_lmf = lmf;
+
+#ifdef HAVE_KW_THREAD
+ mono_lmf_addr = &jit_tls->lmf;
+#endif
+
+ mono_arch_setup_jit_tls_data (jit_tls);
+
+ return jit_tls;
+}
+
+static void
+mono_thread_start_cb (guint32 tid, gpointer stack_start, gpointer func)
+{
+ MonoThread *thread;
+ void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort);
+ thread = mono_thread_current ();
+ if (thread)
+ thread->jit_data = jit_tls;
+}
+
+void (*mono_thread_attach_aborted_cb ) (MonoObject *obj) = NULL;
+
+static void
+mono_thread_abort_dummy (MonoObject *obj)
+{
+ if (mono_thread_attach_aborted_cb)
+ mono_thread_attach_aborted_cb (obj);
+ else
+ mono_thread_abort (obj);
+}
+
+static void
+mono_thread_attach_cb (guint32 tid, gpointer stack_start)
+{
+ MonoThread *thread;
+ void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort_dummy);
+ thread = mono_thread_current ();
+ if (thread)
+ thread->jit_data = jit_tls;
+}
+
+static void
+mini_thread_cleanup (MonoThread *thread)
+{
+ MonoJitTlsData *jit_tls = thread->jit_data;
+
+ if (jit_tls) {
+ mono_arch_free_jit_tls_data (jit_tls);
+ g_free (jit_tls->first_lmf);
+ g_free (jit_tls);
+ thread->jit_data = NULL;
+ }
+}
+
+void
+mono_add_patch_info (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target)
+{
+ MonoJumpInfo *ji = mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfo));
+
+ ji->ip.i = ip;
+ ji->type = type;
+ ji->data.target = target;
+ ji->next = cfg->patch_info;
+
+ cfg->patch_info = ji;
+}
+
+void
+mono_remove_patch_info (MonoCompile *cfg, int ip)
+{
+ MonoJumpInfo **ji = &cfg->patch_info;
+
+ while (*ji) {
+ if ((*ji)->ip.i == ip)
+ *ji = (*ji)->next;
+ else
+ ji = &((*ji)->next);
+ }
+}
+
+gpointer
+mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors)
+{
+ unsigned char *ip = patch_info->ip.i + code;
+ gconstpointer target = NULL;
+
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_BB:
+ target = patch_info->data.bb->native_offset + code;
+ break;
+ case MONO_PATCH_INFO_ABS:
+ target = patch_info->data.target;
+ break;
+ case MONO_PATCH_INFO_LABEL:
+ target = patch_info->data.inst->inst_c0 + code;
+ break;
+ case MONO_PATCH_INFO_IP:
+ target = ip;
+ break;
+ case MONO_PATCH_INFO_METHOD_REL:
+ target = code + patch_info->data.offset;
+ break;
+ case MONO_PATCH_INFO_INTERNAL_METHOD: {
+ MonoJitICallInfo *mi = mono_find_jit_icall_by_name (patch_info->data.name);
+ if (!mi) {
+ g_warning ("unknown MONO_PATCH_INFO_INTERNAL_METHOD %s", patch_info->data.name);
+ g_assert_not_reached ();
+ }
+ target = mono_icall_get_wrapper (mi);
+ break;
+ }
+ case MONO_PATCH_INFO_METHOD_JUMP: {
+ GSList *list;
+
+ /* get the trampoline to the method from the domain */
+ target = mono_create_jump_trampoline (domain, patch_info->data.method, TRUE);
+ if (!domain->jump_target_hash)
+ domain->jump_target_hash = g_hash_table_new (NULL, NULL);
+ list = g_hash_table_lookup (domain->jump_target_hash, patch_info->data.method);
+ list = g_slist_prepend (list, ip);
+ g_hash_table_insert (domain->jump_target_hash, patch_info->data.method, list);
+ break;
+ }
+ case MONO_PATCH_INFO_METHOD:
+ if (patch_info->data.method == method) {
+ target = code;
+ } else
+ /* get the trampoline to the method from the domain */
+ target = mono_create_jit_trampoline (patch_info->data.method);
+ break;
+ case MONO_PATCH_INFO_SWITCH: {
+ gpointer *jump_table;
+ int i;
+
+ if (method->dynamic) {
+ jump_table = mono_code_manager_reserve (mono_dynamic_code_hash_lookup (method)->code_mp, sizeof (gpointer) * patch_info->table_size);
+ }
+ else {
+ mono_domain_lock (domain);
+ jump_table = mono_code_manager_reserve (domain->code_mp, sizeof (gpointer) * patch_info->table_size);
+ mono_domain_unlock (domain);
+ }
+
+ for (i = 0; i < patch_info->table_size; i++) {
+ jump_table [i] = code + (int)patch_info->data.table [i];
+ }
+ target = jump_table;
+ break;
+ }
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_CLASS:
+ case MONO_PATCH_INFO_IMAGE:
+ case MONO_PATCH_INFO_FIELD:
+ target = patch_info->data.target;
+ break;
+ case MONO_PATCH_INFO_IID:
+ mono_class_init (patch_info->data.klass);
+ target = (gpointer)patch_info->data.klass->interface_id;
+ break;
+ case MONO_PATCH_INFO_VTABLE:
+ target = mono_class_vtable (domain, patch_info->data.klass);
+ break;
+ case MONO_PATCH_INFO_CLASS_INIT:
+ target = mono_create_class_init_trampoline (mono_class_vtable (domain, patch_info->data.klass));
+ break;
+ case MONO_PATCH_INFO_SFLDA: {
+ MonoVTable *vtable = mono_class_vtable (domain, patch_info->data.field->parent);
+ if (!vtable->initialized && !(vtable->klass->flags & TYPE_ATTRIBUTE_BEFORE_FIELD_INIT) && mono_class_needs_cctor_run (vtable->klass, method))
+ /* Done by the generated code */
+ ;
+ else {
+ if (run_cctors)
+ mono_runtime_class_init (vtable);
+ }
+ target = (char*)vtable->data + patch_info->data.field->offset;
+ break;
+ }
+ case MONO_PATCH_INFO_R4:
+ case MONO_PATCH_INFO_R8:
+ target = patch_info->data.target;
+ break;
+ case MONO_PATCH_INFO_EXC_NAME:
+ target = patch_info->data.name;
+ break;
+ case MONO_PATCH_INFO_LDSTR:
+ target =
+ mono_ldstr (domain, patch_info->data.token->image,
+ mono_metadata_token_index (patch_info->data.token->token));
+ break;
+ case MONO_PATCH_INFO_TYPE_FROM_HANDLE: {
+ gpointer handle;
+ MonoClass *handle_class;
+
+ handle = mono_ldtoken (patch_info->data.token->image,
+ patch_info->data.token->token, &handle_class, NULL);
+ mono_class_init (handle_class);
+ mono_class_init (mono_class_from_mono_type (handle));
+
+ target =
+ mono_type_get_object (domain, handle);
+ break;
+ }
+ case MONO_PATCH_INFO_LDTOKEN: {
+ gpointer handle;
+ MonoClass *handle_class;
+
+ handle = mono_ldtoken (patch_info->data.token->image,
+ patch_info->data.token->token, &handle_class, NULL);
+ mono_class_init (handle_class);
+
+ target = handle;
+ break;
+ }
+ case MONO_PATCH_INFO_BB_OVF:
+ case MONO_PATCH_INFO_EXC_OVF:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return (gpointer)target;
+}
+
+static void
+dec_foreach (MonoInst *tree, MonoCompile *cfg) {
+ MonoJitICallInfo *info;
+
+ decompose_foreach (tree, cfg);
+
+ switch (mono_burg_arity [tree->opcode]) {
+ case 0: break;
+ case 1:
+ dec_foreach (tree->inst_left, cfg);
+
+ if ((info = mono_find_jit_opcode_emulation (tree->opcode))) {
+ MonoInst *iargs [2];
+
+ iargs [0] = tree->inst_left;
+
+ mono_emulate_opcode (cfg, tree, iargs, info);
+ return;
+ }
+
+ break;
+ case 2:
+#ifdef MONO_ARCH_BIGMUL_INTRINS
+ if (tree->opcode == OP_LMUL
+ && (cfg->opt & MONO_OPT_INTRINS)
+ && (tree->inst_left->opcode == CEE_CONV_I8
+ || tree->inst_left->opcode == CEE_CONV_U8)
+ && tree->inst_left->inst_left->type == STACK_I4
+ && (tree->inst_right->opcode == CEE_CONV_I8
+ || tree->inst_right->opcode == CEE_CONV_U8)
+ && tree->inst_right->inst_left->type == STACK_I4
+ && tree->inst_left->opcode == tree->inst_right->opcode) {
+ tree->opcode = (tree->inst_left->opcode == CEE_CONV_I8 ? OP_BIGMUL: OP_BIGMUL_UN);
+ tree->inst_left = tree->inst_left->inst_left;
+ tree->inst_right = tree->inst_right->inst_left;
+ dec_foreach (tree, cfg);
+ } else
+#endif
+ if ((info = mono_find_jit_opcode_emulation (tree->opcode))) {
+ MonoInst *iargs [2];
+
+ iargs [0] = tree->inst_i0;
+ iargs [1] = tree->inst_i1;
+
+ mono_emulate_opcode (cfg, tree, iargs, info);
+
+ dec_foreach (iargs [0], cfg);
+ dec_foreach (iargs [1], cfg);
+ return;
+ } else {
+ dec_foreach (tree->inst_left, cfg);
+ dec_foreach (tree->inst_right, cfg);
+ }
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+static void
+decompose_pass (MonoCompile *cfg) {
+ MonoBasicBlock *bb;
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *tree;
+ cfg->cbb = bb;
+ cfg->prev_ins = NULL;
+ for (tree = cfg->cbb->code; tree; tree = tree->next) {
+ dec_foreach (tree, cfg);
+ cfg->prev_ins = tree;
+ }
+ }
+}
+
+static void
+nullify_basic_block (MonoBasicBlock *bb)
+{
+ bb->in_count = 0;
+ bb->out_count = 0;
+ bb->in_bb = NULL;
+ bb->out_bb = NULL;
+ bb->next_bb = NULL;
+ bb->code = bb->last_ins = NULL;
+ bb->cil_code = NULL;
+}
+
+static void
+replace_out_block (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl)
+{
+ int i;
+
+ for (i = 0; i < bb->out_count; i++) {
+ MonoBasicBlock *ob = bb->out_bb [i];
+ if (ob == orig) {
+ if (!repl) {
+ if (bb->out_count > 1) {
+ bb->out_bb [i] = bb->out_bb [bb->out_count - 1];
+ }
+ bb->out_count--;
+ } else {
+ bb->out_bb [i] = repl;
+ }
+ }
+ }
+}
+
+static void
+replace_in_block (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl)
+{
+ int i;
+
+ for (i = 0; i < bb->in_count; i++) {
+ MonoBasicBlock *ib = bb->in_bb [i];
+ if (ib == orig) {
+ if (!repl) {
+ if (bb->in_count > 1) {
+ bb->in_bb [i] = bb->in_bb [bb->in_count - 1];
+ }
+ bb->in_count--;
+ } else {
+ bb->in_bb [i] = repl;
+ }
+ }
+ }
+}
+
+static void
+replace_basic_block (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl)
+{
+ int i, j;
+
+ for (i = 0; i < bb->out_count; i++) {
+ MonoBasicBlock *ob = bb->out_bb [i];
+ for (j = 0; j < ob->in_count; j++) {
+ if (ob->in_bb [j] == orig) {
+ ob->in_bb [j] = repl;
+ }
+ }
+ }
+
+}
+
+
+static void
+merge_basic_blocks (MonoBasicBlock *bb, MonoBasicBlock *bbn)
+{
+ bb->out_count = bbn->out_count;
+ bb->out_bb = bbn->out_bb;
+
+ replace_basic_block (bb, bbn, bb);
+
+ if (bb->last_ins) {
+ if (bbn->code) {
+ bb->last_ins->next = bbn->code;
+ bb->last_ins = bbn->last_ins;
+ }
+ } else {
+ bb->code = bbn->code;
+ bb->last_ins = bbn->last_ins;
+ }
+ bb->next_bb = bbn->next_bb;
+ nullify_basic_block (bbn);
+}
+
+/*
+ * Optimizes the branches on the Control Flow Graph
+ *
+ */
+static void
+optimize_branches (MonoCompile *cfg)
+{
+ int i, changed = FALSE;
+ MonoBasicBlock *bb, *bbn;
+ guint32 niterations;
+
+ /*
+ * Some crazy loops could cause the code below to go into an infinite
+ * loop, see bug #53003 for an example. To prevent this, we put an upper
+ * bound on the number of iterations.
+ */
+ niterations = 1000;
+ do {
+ changed = FALSE;
+ niterations --;
+
+ /* we skip the entry block (exit is handled specially instead ) */
+ for (bb = cfg->bb_entry->next_bb; bb; bb = bb->next_bb) {
+
+ /* dont touch code inside exception clauses */
+ if (bb->region != -1)
+ continue;
+
+ if ((bbn = bb->next_bb) && bbn->in_count == 0 && bb->region == bbn->region) {
+ if (cfg->verbose_level > 2)
+ g_print ("nullify block triggered %d\n", bbn->block_num);
+
+ bb->next_bb = bbn->next_bb;
+
+ for (i = 0; i < bbn->out_count; i++)
+ replace_in_block (bbn->out_bb [i], bbn, NULL);
+
+ nullify_basic_block (bbn);
+ changed = TRUE;
+ }
+
+ if (bb->out_count == 1) {
+ bbn = bb->out_bb [0];
+
+ /* conditional branches where true and false targets are the same can be also replaced with CEE_BR */
+ if (bb->last_ins && MONO_IS_COND_BRANCH_OP (bb->last_ins)) {
+ bb->last_ins->opcode = CEE_BR;
+ bb->last_ins->inst_target_bb = bb->last_ins->inst_true_bb;
+ changed = TRUE;
+ if (cfg->verbose_level > 2)
+ g_print ("cond branch removal triggered in %d %d\n", bb->block_num, bb->out_count);
+ }
+
+ if (bb->region == bbn->region && bb->next_bb == bbn) {
+ /* the block are in sequence anyway ... */
+
+ /* branches to the following block can be removed */
+ if (bb->last_ins && bb->last_ins->opcode == CEE_BR) {
+ bb->last_ins->opcode = CEE_NOP;
+ changed = TRUE;
+ if (cfg->verbose_level > 2)
+ g_print ("br removal triggered %d -> %d\n", bb->block_num, bbn->block_num);
+ }
+
+ if (bbn->in_count == 1) {
+
+ if (bbn != cfg->bb_exit) {
+ if (cfg->verbose_level > 2)
+ g_print ("block merge triggered %d -> %d\n", bb->block_num, bbn->block_num);
+ merge_basic_blocks (bb, bbn);
+ changed = TRUE;
+ }
+
+ //mono_print_bb_code (bb);
+ }
+ }
+ }
+ }
+ } while (changed && (niterations > 0));
+
+ niterations = 1000;
+ do {
+ changed = FALSE;
+ niterations --;
+
+ /* we skip the entry block (exit is handled specially instead ) */
+ for (bb = cfg->bb_entry->next_bb; bb; bb = bb->next_bb) {
+
+ /* dont touch code inside exception clauses */
+ if (bb->region != -1)
+ continue;
+
+ if ((bbn = bb->next_bb) && bbn->in_count == 0 && bb->region == bbn->region) {
+ if (cfg->verbose_level > 2) {
+ g_print ("nullify block triggered %d\n", bbn->block_num);
+ }
+ bb->next_bb = bbn->next_bb;
+
+ for (i = 0; i < bbn->out_count; i++)
+ replace_in_block (bbn->out_bb [i], bbn, NULL);
+
+ nullify_basic_block (bbn);
+ changed = TRUE;
+ break;
+ }
+
+
+ if (bb->out_count == 1) {
+ bbn = bb->out_bb [0];
+
+ if (bb->last_ins && bb->last_ins->opcode == CEE_BR) {
+ bbn = bb->last_ins->inst_target_bb;
+ if (bb->region == bbn->region && bbn->code && bbn->code->opcode == CEE_BR &&
+ bbn->code->inst_target_bb->region == bb->region) {
+
+ if (cfg->verbose_level > 2)
+ g_print ("in %s branch to branch triggered %d -> %d -> %d\n", cfg->method->name,
+ bb->block_num, bbn->block_num, bbn->code->inst_target_bb->block_num);
+
+ replace_in_block (bbn, bb, NULL);
+ replace_out_block (bb, bbn, bbn->code->inst_target_bb);
+ link_bblock (cfg, bb, bbn->code->inst_target_bb);
+ bb->last_ins->inst_target_bb = bbn->code->inst_target_bb;
+ changed = TRUE;
+ break;
+ }
+ }
+ } else if (bb->out_count == 2) {
+ if (bb->last_ins && MONO_IS_COND_BRANCH_NOFP (bb->last_ins)) {
+ bbn = bb->last_ins->inst_true_bb;
+ if (bb->region == bbn->region && bbn->code && bbn->code->opcode == CEE_BR &&
+ bbn->code->inst_target_bb->region == bb->region) {
+ if (cfg->verbose_level > 2)
+ g_print ("cbranch1 to branch triggered %d -> (%d) %d (0x%02x)\n",
+ bb->block_num, bbn->block_num, bbn->code->inst_target_bb->block_num,
+ bbn->code->opcode);
+
+ bb->last_ins->inst_true_bb = bbn->code->inst_target_bb;
+
+ replace_in_block (bbn, bb, NULL);
+ if (!bbn->in_count)
+ replace_in_block (bbn->code->inst_target_bb, bbn, bb);
+ replace_out_block (bb, bbn, bbn->code->inst_target_bb);
+
+ link_bblock (cfg, bb, bbn->code->inst_target_bb);
+
+ changed = TRUE;
+ break;
+ }
+
+ bbn = bb->last_ins->inst_false_bb;
+ if (bb->region == bbn->region && bbn->code && bbn->code->opcode == CEE_BR &&
+ bbn->code->inst_target_bb->region == bb->region) {
+ if (cfg->verbose_level > 2)
+ g_print ("cbranch2 to branch triggered %d -> (%d) %d (0x%02x)\n",
+ bb->block_num, bbn->block_num, bbn->code->inst_target_bb->block_num,
+ bbn->code->opcode);
+
+ bb->last_ins->inst_false_bb = bbn->code->inst_target_bb;
+
+ replace_in_block (bbn, bb, NULL);
+ if (!bbn->in_count)
+ replace_in_block (bbn->code->inst_target_bb, bbn, bb);
+ replace_out_block (bb, bbn, bbn->code->inst_target_bb);
+
+ link_bblock (cfg, bb, bbn->code->inst_target_bb);
+
+ changed = TRUE;
+ break;
+ }
+ }
+ }
+ }
+ } while (changed && (niterations > 0));
+
+}
+
+static void
+mono_compile_create_vars (MonoCompile *cfg)
+{
+ MonoMethodSignature *sig;
+ MonoMethodHeader *header;
+ int i;
+
+ header = mono_method_get_header (cfg->method);
+
+ sig = cfg->method->signature;
+
+ if (!MONO_TYPE_IS_VOID (sig->ret)) {
+ cfg->ret = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst));
+ cfg->ret->opcode = OP_RETARG;
+ cfg->ret->inst_vtype = sig->ret;
+ cfg->ret->klass = mono_class_from_mono_type (sig->ret);
+ }
+ if (cfg->verbose_level > 2)
+ g_print ("creating vars\n");
+
+ if (sig->hasthis)
+ mono_compile_create_var (cfg, &cfg->method->klass->this_arg, OP_ARG);
+
+ for (i = 0; i < sig->param_count; ++i)
+ mono_compile_create_var (cfg, sig->params [i], OP_ARG);
+
+ cfg->locals_start = cfg->num_varinfo;
+
+ if (cfg->verbose_level > 2)
+ g_print ("creating locals\n");
+ for (i = 0; i < header->num_locals; ++i)
+ mono_compile_create_var (cfg, header->locals [i], OP_LOCAL);
+ if (cfg->verbose_level > 2)
+ g_print ("locals done\n");
+}
+
+void
+mono_print_code (MonoCompile *cfg)
+{
+ MonoBasicBlock *bb;
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *tree = bb->code;
+
+ if (!tree)
+ continue;
+
+ g_print ("CODE BLOCK %d (nesting %d):\n", bb->block_num, bb->nesting);
+
+ for (; tree; tree = tree->next) {
+ mono_print_tree (tree);
+ g_print ("\n");
+ }
+
+ if (bb->last_ins)
+ bb->last_ins->next = NULL;
+ }
+}
+
+extern const char * const mono_burg_rule_string [];
+
+static void
+emit_state (MonoCompile *cfg, MBState *state, int goal)
+{
+ MBState *kids [10];
+ int ern = mono_burg_rule (state, goal);
+ const guint16 *nts = mono_burg_nts [ern];
+ MBEmitFunc emit;
+
+ //g_print ("rule: %s\n", mono_burg_rule_string [ern]);
+ switch (goal) {
+ case MB_NTERM_reg:
+ //if (state->reg2)
+ // state->reg1 = state->reg2; /* chain rule */
+ //else
+#ifdef MONO_ARCH_ENABLE_EMIT_STATE_OPT
+ if (!state->reg1)
+#endif
+ state->reg1 = mono_regstate_next_int (cfg->rs);
+ //g_print ("alloc symbolic R%d (reg2: R%d) in block %d\n", state->reg1, state->reg2, cfg->cbb->block_num);
+ break;
+ case MB_NTERM_lreg:
+ state->reg1 = mono_regstate_next_int (cfg->rs);
+ state->reg2 = mono_regstate_next_int (cfg->rs);
+ break;
+ case MB_NTERM_freg:
+ state->reg1 = mono_regstate_next_float (cfg->rs);
+ break;
+ default:
+#ifdef MONO_ARCH_ENABLE_EMIT_STATE_OPT
+ /*
+ * Enabling this might cause bugs to surface in the local register
+ * allocators on some architectures like x86.
+ */
+ if ((state->tree->ssa_op == MONO_SSA_STORE) && (state->left->tree->opcode == OP_REGVAR)) {
+ /* Do not optimize away reg-reg moves */
+ if (! ((state->right->tree->ssa_op == MONO_SSA_LOAD) && (state->right->left->tree->opcode == OP_REGVAR))) {
+ state->right->reg1 = state->left->tree->dreg;
+ }
+ }
+#endif
+
+ /* do nothing */
+ break;
+ }
+ if (nts [0]) {
+ mono_burg_kids (state, ern, kids);
+
+ emit_state (cfg, kids [0], nts [0]);
+ if (nts [1]) {
+ emit_state (cfg, kids [1], nts [1]);
+ if (nts [2]) {
+ g_assert (!nts [3]);
+ emit_state (cfg, kids [2], nts [2]);
+ }
+ }
+ }
+
+// g_print ("emit: %s (%p)\n", mono_burg_rule_string [ern], state);
+ if ((emit = mono_burg_func [ern]))
+ emit (state, state->tree, cfg);
+}
+
+#define DEBUG_SELECTION
+
+static void
+mini_select_instructions (MonoCompile *cfg)
+{
+ static const int reverse_map [] = {
+ CEE_BNE_UN, CEE_BLT, CEE_BLE, CEE_BGT, CEE_BGE,
+ CEE_BEQ, CEE_BLT_UN, CEE_BLE_UN, CEE_BGT_UN, CEE_BGE_UN
+ };
+ static const int reverse_fmap [] = {
+ OP_FBNE_UN, OP_FBLT, OP_FBLE, OP_FBGT, OP_FBGE,
+ OP_FBEQ, OP_FBLT_UN, OP_FBLE_UN, OP_FBGT_UN, OP_FBGE_UN
+ };
+ static const int reverse_lmap [] = {
+ OP_LBNE_UN, OP_LBLT, OP_LBLE, OP_LBGT, OP_LBGE,
+ OP_LBEQ, OP_LBLT_UN, OP_LBLE_UN, OP_LBGT_UN, OP_LBGE_UN
+ };
+ static const int reverse_imap [] = {
+ OP_IBNE_UN, OP_IBLT, OP_IBLE, OP_IBGT, OP_IBGE,
+ OP_IBEQ, OP_IBLT_UN, OP_IBLE_UN, OP_IBGT_UN, OP_IBGE_UN
+ };
+
+ MonoBasicBlock *bb;
+
+ cfg->state_pool = mono_mempool_new ();
+ cfg->rs = mono_regstate_new ();
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ if (bb->last_ins && MONO_IS_COND_BRANCH_OP (bb->last_ins) &&
+ bb->next_bb != bb->last_ins->inst_false_bb) {
+
+ /* we are careful when inverting, since bugs like #59580
+ * could show up when dealing with NaNs.
+ */
+ if (MONO_IS_COND_BRANCH_NOFP(bb->last_ins) && bb->next_bb == bb->last_ins->inst_true_bb) {
+ MonoBasicBlock *tmp = bb->last_ins->inst_true_bb;
+ bb->last_ins->inst_true_bb = bb->last_ins->inst_false_bb;
+ bb->last_ins->inst_false_bb = tmp;
+
+ if (bb->last_ins->opcode >= CEE_BEQ && bb->last_ins->opcode <= CEE_BLT_UN) {
+ bb->last_ins->opcode = reverse_map [bb->last_ins->opcode - CEE_BEQ];
+ } else if (bb->last_ins->opcode >= OP_FBEQ && bb->last_ins->opcode <= OP_FBLT_UN) {
+ bb->last_ins->opcode = reverse_fmap [bb->last_ins->opcode - OP_FBEQ];
+ } else if (bb->last_ins->opcode >= OP_LBEQ && bb->last_ins->opcode <= OP_LBLT_UN) {
+ bb->last_ins->opcode = reverse_lmap [bb->last_ins->opcode - OP_LBEQ];
+ } else if (bb->last_ins->opcode >= OP_IBEQ && bb->last_ins->opcode <= OP_IBLT_UN) {
+ bb->last_ins->opcode = reverse_imap [bb->last_ins->opcode - OP_IBEQ];
+ }
+ } else {
+ MonoInst *inst = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst));
+ inst->opcode = CEE_BR;
+ inst->inst_target_bb = bb->last_ins->inst_false_bb;
+ mono_bblock_add_inst (bb, inst);
+ }
+ }
+ }
+
+#ifdef DEBUG_SELECTION
+ if (cfg->verbose_level >= 4) {
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *tree = bb->code;
+ g_print ("DUMP BLOCK %d:\n", bb->block_num);
+ if (!tree)
+ continue;
+ for (; tree; tree = tree->next) {
+ mono_print_tree (tree);
+ g_print ("\n");
+ }
+ }
+ }
+#endif
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *tree = bb->code, *next;
+ MBState *mbstate;
+
+ if (!tree)
+ continue;
+ bb->code = NULL;
+ bb->last_ins = NULL;
+
+ cfg->cbb = bb;
+ mono_regstate_reset (cfg->rs);
+
+#ifdef DEBUG_SELECTION
+ if (cfg->verbose_level >= 3)
+ g_print ("LABEL BLOCK %d:\n", bb->block_num);
+#endif
+ for (; tree; tree = next) {
+ next = tree->next;
+#ifdef DEBUG_SELECTION
+ if (cfg->verbose_level >= 3) {
+ mono_print_tree (tree);
+ g_print ("\n");
+ }
+#endif
+
+ if (!(mbstate = mono_burg_label (tree, cfg))) {
+ g_warning ("unable to label tree %p", tree);
+ mono_print_tree (tree);
+ g_print ("\n");
+ g_assert_not_reached ();
+ }
+ emit_state (cfg, mbstate, MB_NTERM_stmt);
+ }
+ bb->max_ireg = cfg->rs->next_vireg;
+ bb->max_freg = cfg->rs->next_vfreg;
+
+ if (bb->last_ins)
+ bb->last_ins->next = NULL;
+
+ mono_mempool_empty (cfg->state_pool);
+ }
+ mono_mempool_destroy (cfg->state_pool);
+}
+
+void
+mono_codegen (MonoCompile *cfg)
+{
+ MonoJumpInfo *patch_info;
+ MonoBasicBlock *bb;
+ int i, max_epilog_size;
+ guint8 *code;
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ cfg->spill_count = 0;
+ /* we reuse dfn here */
+ /* bb->dfn = bb_count++; */
+ mono_arch_local_regalloc (cfg, bb);
+ }
+
+ if (cfg->prof_options & MONO_PROFILE_COVERAGE)
+ cfg->coverage_info = mono_profiler_coverage_alloc (cfg->method, cfg->num_bblocks);
+
+ code = mono_arch_emit_prolog (cfg);
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ code = mono_arch_instrument_prolog (cfg, mono_profiler_method_enter, code, FALSE);
+
+ cfg->code_len = code - cfg->native_code;
+ cfg->prolog_end = cfg->code_len;
+
+ mono_debug_open_method (cfg);
+
+ /* emit code all basic blocks */
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ bb->native_offset = cfg->code_len;
+ mono_arch_output_basic_block (cfg, bb);
+ }
+ cfg->bb_exit->native_offset = cfg->code_len;
+
+ code = cfg->native_code + cfg->code_len;
+
+ max_epilog_size = mono_arch_max_epilog_size (cfg);
+
+ /* we always allocate code in cfg->domain->code_mp to increase locality */
+ cfg->code_size = cfg->code_len + max_epilog_size;
+ /* fixme: align to MONO_ARCH_CODE_ALIGNMENT */
+
+ if (cfg->method->dynamic) {
+ MonoJitDynamicMethodInfo *dyn_ji;
+
+ /* Allocate the code into a separate memory pool so it can be freed */
+ dyn_ji = g_new0 (MonoJitDynamicMethodInfo, 1);
+ dyn_ji->code_mp = mono_code_manager_new_dynamic ();
+ mono_dynamic_code_hash_insert (cfg->method, dyn_ji);
+
+ code = mono_code_manager_reserve (dyn_ji->code_mp, cfg->code_size);
+ }
+ else {
+ mono_domain_lock (cfg->domain);
+ code = mono_code_manager_reserve (cfg->domain->code_mp, cfg->code_size);
+ mono_domain_unlock (cfg->domain);
+ }
+
+ memcpy (code, cfg->native_code, cfg->code_len);
+ g_free (cfg->native_code);
+ cfg->native_code = code;
+ code = cfg->native_code + cfg->code_len;
+
+ /* g_assert (((int)cfg->native_code & (MONO_ARCH_CODE_ALIGNMENT - 1)) == 0); */
+
+ cfg->epilog_begin = cfg->code_len;
+
+ if (cfg->prof_options & MONO_PROFILE_ENTER_LEAVE)
+ code = mono_arch_instrument_epilog (cfg, mono_profiler_method_leave, code, FALSE);
+
+ cfg->code_len = code - cfg->native_code;
+
+ mono_arch_emit_epilog (cfg);
+
+ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) {
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_ABS: {
+ MonoJitICallInfo *info = mono_find_jit_icall_by_addr (patch_info->data.target);
+ if (info) {
+ //printf ("TEST %s %p\n", info->name, patch_info->data.target);
+ if ((cfg->method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) &&
+ strstr (cfg->method->name, info->name))
+ /*
+ * This is an icall wrapper, and this is a call to the
+ * wrapped function.
+ */
+ ;
+ else {
+ patch_info->type = MONO_PATCH_INFO_INTERNAL_METHOD;
+ patch_info->data.name = info->name;
+ }
+ }
+ else {
+ MonoVTable *vtable = mono_find_class_init_trampoline_by_addr (patch_info->data.target);
+ if (vtable) {
+ patch_info->type = MONO_PATCH_INFO_CLASS_INIT;
+ patch_info->data.klass = vtable->klass;
+ }
+ }
+ break;
+ }
+ case MONO_PATCH_INFO_SWITCH: {
+ gpointer *table;
+ if (cfg->method->dynamic)
+ table = mono_code_manager_reserve (mono_dynamic_code_hash_lookup (cfg->method)->code_mp, sizeof (gpointer) * patch_info->table_size);
+ else {
+ mono_domain_lock (cfg->domain);
+ table = mono_code_manager_reserve (cfg->domain->code_mp, sizeof (gpointer) * patch_info->table_size);
+ mono_domain_unlock (cfg->domain);
+ }
+
+ patch_info->ip.i = patch_info->ip.label->inst_c0;
+ for (i = 0; i < patch_info->table_size; i++) {
+ table [i] = (gpointer)patch_info->data.table [i]->native_offset;
+ }
+ patch_info->data.target = table;
+ break;
+ }
+ default:
+ /* do nothing */
+ break;
+ }
+ }
+
+ if (cfg->verbose_level > 0)
+ g_print ("Method %s emitted at %p to %p [%s]\n",
+ mono_method_full_name (cfg->method, TRUE),
+ cfg->native_code, cfg->native_code + cfg->code_len, cfg->domain->friendly_name);
+
+ mono_arch_patch_code (cfg->method, cfg->domain, cfg->native_code, cfg->patch_info, cfg->run_cctors);
+
+ if (cfg->method->dynamic) {
+ mono_code_manager_commit (mono_dynamic_code_hash_lookup (cfg->method)->code_mp, cfg->native_code, cfg->code_size, cfg->code_len);
+ }
+ else {
+ mono_domain_lock (cfg->domain);
+ mono_code_manager_commit (cfg->domain->code_mp, cfg->native_code, cfg->code_size, cfg->code_len);
+ mono_domain_unlock (cfg->domain);
+ }
+
+ mono_arch_flush_icache (cfg->native_code, cfg->code_len);
+
+ mono_debug_close_method (cfg);
+}
+
+static void
+mono_cprop_copy_values (MonoCompile *cfg, MonoInst *tree, MonoInst **acp)
+{
+ MonoInst *cp;
+ int arity;
+
+ if (tree->ssa_op == MONO_SSA_LOAD && (tree->inst_i0->opcode == OP_LOCAL || tree->inst_i0->opcode == OP_ARG) &&
+ (cp = acp [tree->inst_i0->inst_c0]) && !tree->inst_i0->flags) {
+
+ if (cp->opcode == OP_ICONST) {
+ if (cfg->opt & MONO_OPT_CONSPROP) {
+ //{ static int c = 0; printf ("CCOPY %d %d %s\n", c++, cp->inst_c0, mono_method_full_name (cfg->method, TRUE)); }
+ *tree = *cp;
+ }
+ } else {
+ if (tree->inst_i0->inst_vtype->type == cp->inst_vtype->type) {
+ if (cfg->opt & MONO_OPT_COPYPROP) {
+ //{ static int c = 0; printf ("VCOPY %d\n", ++c); }
+ tree->inst_i0 = cp;
+ }
+ }
+ }
+ } else {
+ arity = mono_burg_arity [tree->opcode];
+
+ if (arity) {
+ mono_cprop_copy_values (cfg, tree->inst_i0, acp);
+ if (cfg->opt & MONO_OPT_CFOLD)
+ mono_constant_fold_inst (tree, NULL);
+ /* The opcode may have changed */
+ if (mono_burg_arity [tree->opcode] > 1) {
+ mono_cprop_copy_values (cfg, tree->inst_i1, acp);
+ if (cfg->opt & MONO_OPT_CFOLD)
+ mono_constant_fold_inst (tree, NULL);
+ }
+ mono_constant_fold_inst (tree, NULL);
+ }
+ }
+}
+
+static void
+mono_cprop_invalidate_values (MonoInst *tree, MonoInst **acp, int acp_size)
+{
+ int arity;
+
+ switch (tree->opcode) {
+ case CEE_STIND_I:
+ case CEE_STIND_I1:
+ case CEE_STIND_I2:
+ case CEE_STIND_I4:
+ case CEE_STIND_REF:
+ case CEE_STIND_I8:
+ case CEE_STIND_R4:
+ case CEE_STIND_R8:
+ case CEE_STOBJ:
+ if (tree->ssa_op == MONO_SSA_NOP) {
+ memset (acp, 0, sizeof (MonoInst *) * acp_size);
+ return;
+ }
+
+ break;
+ case CEE_CALL:
+ case OP_CALL_REG:
+ case CEE_CALLVIRT:
+ case OP_LCALL_REG:
+ case OP_LCALLVIRT:
+ case OP_LCALL:
+ case OP_FCALL_REG:
+ case OP_FCALLVIRT:
+ case OP_FCALL:
+ case OP_VCALL_REG:
+ case OP_VCALLVIRT:
+ case OP_VCALL:
+ case OP_VOIDCALL_REG:
+ case OP_VOIDCALLVIRT:
+ case OP_VOIDCALL: {
+ MonoCallInst *call = (MonoCallInst *)tree;
+ MonoMethodSignature *sig = call->signature;
+ int i, byref = FALSE;
+
+ for (i = 0; i < sig->param_count; i++) {
+ if (sig->params [i]->byref) {
+ byref = TRUE;
+ break;
+ }
+ }
+
+ if (byref)
+ memset (acp, 0, sizeof (MonoInst *) * acp_size);
+
+ return;
+ }
+ default:
+ break;
+ }
+
+ arity = mono_burg_arity [tree->opcode];
+
+ switch (arity) {
+ case 0:
+ break;
+ case 1:
+ mono_cprop_invalidate_values (tree->inst_i0, acp, acp_size);
+ break;
+ case 2:
+ mono_cprop_invalidate_values (tree->inst_i0, acp, acp_size);
+ mono_cprop_invalidate_values (tree->inst_i1, acp, acp_size);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+static void
+mono_local_cprop_bb (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **acp, int acp_size)
+{
+ MonoInst *tree = bb->code;
+ int i;
+
+ if (!tree)
+ return;
+
+ for (; tree; tree = tree->next) {
+
+ mono_cprop_copy_values (cfg, tree, acp);
+
+ mono_cprop_invalidate_values (tree, acp, acp_size);
+
+ if (tree->ssa_op == MONO_SSA_STORE &&
+ (tree->inst_i0->opcode == OP_LOCAL || tree->inst_i0->opcode == OP_ARG)) {
+ MonoInst *i1 = tree->inst_i1;
+
+ acp [tree->inst_i0->inst_c0] = NULL;
+
+ for (i = 0; i < acp_size; i++) {
+ if (acp [i] && acp [i]->opcode != OP_ICONST &&
+ acp [i]->inst_c0 == tree->inst_i0->inst_c0) {
+ acp [i] = NULL;
+ }
+ }
+
+ if (i1->opcode == OP_ICONST) {
+ acp [tree->inst_i0->inst_c0] = i1;
+ //printf ("DEF1 BB%d %d\n", bb->block_num,tree->inst_i0->inst_c0);
+ }
+ if (i1->ssa_op == MONO_SSA_LOAD &&
+ (i1->inst_i0->opcode == OP_LOCAL || i1->inst_i0->opcode == OP_ARG) &&
+ (i1->inst_i0->inst_c0 != tree->inst_i0->inst_c0)) {
+ acp [tree->inst_i0->inst_c0] = i1->inst_i0;
+ //printf ("DEF2 BB%d %d %d\n", bb->block_num,tree->inst_i0->inst_c0,i1->inst_i0->inst_c0);
+ }
+ }
+
+ /*
+ if (tree->opcode == CEE_BEQ) {
+ g_assert (tree->inst_i0->opcode == OP_COMPARE);
+ if (tree->inst_i0->inst_i0->opcode == OP_ICONST &&
+ tree->inst_i0->inst_i1->opcode == OP_ICONST) {
+
+ tree->opcode = CEE_BR;
+ if (tree->inst_i0->inst_i0->opcode == tree->inst_i0->inst_i1->opcode) {
+ tree->inst_target_bb = tree->inst_true_bb;
+ } else {
+ tree->inst_target_bb = tree->inst_false_bb;
+ }
+ }
+ }
+ */
+ }
+}
+
+static void
+mono_local_cprop (MonoCompile *cfg)
+{
+ MonoBasicBlock *bb;
+ MonoInst **acp;
+
+ acp = alloca (sizeof (MonoInst *) * cfg->num_varinfo);
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ memset (acp, 0, sizeof (MonoInst *) * cfg->num_varinfo);
+ mono_local_cprop_bb (cfg, bb, acp, cfg->num_varinfo);
+ }
+}
+
+MonoCompile*
+mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gboolean run_cctors, int parts)
+{
+ MonoMethodHeader *header = mono_method_get_header (method);
+ guint8 *ip = (guint8 *)header->code;
+ MonoCompile *cfg;
+ MonoJitInfo *jinfo;
+ int dfn = 0, i, code_size_ratio;
+
+ mono_jit_stats.methods_compiled++;
+ if (mono_profiler_get_events () & MONO_PROFILE_JIT_COMPILATION)
+ mono_profiler_method_jit (method);
+
+ cfg = g_new0 (MonoCompile, 1);
+ cfg->method = method;
+ cfg->mempool = mono_mempool_new ();
+ cfg->opt = opts;
+ cfg->prof_options = mono_profiler_get_events ();
+ cfg->run_cctors = run_cctors;
+ cfg->bb_hash = g_hash_table_new (NULL, NULL);
+ cfg->domain = domain;
+ cfg->verbose_level = mini_verbose;
+ cfg->intvars = mono_mempool_alloc0 (cfg->mempool, sizeof (guint16) * STACK_MAX *
+ mono_method_get_header (method)->max_stack);
+
+ if (cfg->verbose_level > 2)
+ g_print ("converting method %s\n", mono_method_full_name (method, TRUE));
+
+ /*
+ * create MonoInst* which represents arguments and local variables
+ */
+ mono_compile_create_vars (cfg);
+
+ if ((i = mono_method_to_ir (cfg, method, NULL, NULL, cfg->locals_start, NULL, NULL, NULL, 0, FALSE)) < 0) {
+ if (cfg->prof_options & MONO_PROFILE_JIT_COMPILATION)
+ mono_profiler_method_end_jit (method, MONO_PROFILE_FAILED);
+ mono_destroy_compile (cfg);
+ return NULL;
+ }
+
+ mono_jit_stats.basic_blocks += cfg->num_bblocks;
+ mono_jit_stats.max_basic_blocks = MAX (cfg->num_bblocks, mono_jit_stats.max_basic_blocks);
+
+ if (cfg->num_varinfo > 2000) {
+ /*
+ * we disable some optimizations if there are too many variables
+ * because JIT time may become too expensive. The actual number needs
+ * to be tweaked and eventually the non-linear algorithms should be fixed.
+ */
+ cfg->opt &= ~ (MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP);
+ cfg->disable_ssa = TRUE;
+ }
+ /*g_print ("numblocks = %d\n", cfg->num_bblocks);*/
+
+ /* Depth-first ordering on basic blocks */
+ cfg->bblocks = mono_mempool_alloc (cfg->mempool, sizeof (MonoBasicBlock*) * (cfg->num_bblocks + 1));
+
+ if (cfg->opt & MONO_OPT_BRANCH)
+ optimize_branches (cfg);
+
+ df_visit (cfg->bb_entry, &dfn, cfg->bblocks);
+ if (cfg->num_bblocks != dfn + 1) {
+ MonoBasicBlock *bb;
+
+ cfg->num_bblocks = dfn + 1;
+
+ if (!header->clauses) {
+ /* remove unreachable code, because the code in them may be
+ * inconsistent (access to dead variables for example) */
+ for (bb = cfg->bb_entry; bb;) {
+ MonoBasicBlock *bbn = bb->next_bb;
+
+ if (bbn && bbn->region == -1 && !bbn->dfn) {
+ if (cfg->verbose_level > 1)
+ g_print ("found unreachabel code in BB%d\n", bbn->block_num);
+ bb->next_bb = bbn->next_bb;
+ nullify_basic_block (bbn);
+ } else {
+ bb = bb->next_bb;
+ }
+ }
+ }
+ }
+
+ if (cfg->opt & MONO_OPT_LOOP) {
+ mono_compile_dominator_info (cfg, MONO_COMP_DOM | MONO_COMP_IDOM);
+ mono_compute_natural_loops (cfg);
+ }
+
+ /* after method_to_ir */
+ if (parts == 1)
+ return cfg;
+
+//#define DEBUGSSA "logic_run"
+#define DEBUGSSA_CLASS "Tests"
+#ifdef DEBUGSSA
+
+ if (!header->num_clauses && !cfg->disable_ssa) {
+ mono_local_cprop (cfg);
+ mono_ssa_compute (cfg);
+ }
+#else
+
+ /* fixme: add all optimizations which requires SSA */
+ if (cfg->opt & (MONO_OPT_DEADCE | MONO_OPT_ABCREM)) {
+ if (!(cfg->comp_done & MONO_COMP_SSA) && !header->num_clauses && !cfg->disable_ssa) {
+ mono_local_cprop (cfg);
+ mono_ssa_compute (cfg);
+
+ if (cfg->verbose_level >= 2) {
+ print_dfn (cfg);
+ }
+ }
+ }
+#endif
+
+ /* after SSA translation */
+ if (parts == 2)
+ return cfg;
+
+ if ((cfg->opt & MONO_OPT_CONSPROP) || (cfg->opt & MONO_OPT_COPYPROP)) {
+ if (cfg->comp_done & MONO_COMP_SSA) {
+ mono_ssa_cprop (cfg);
+ } else {
+ mono_local_cprop (cfg);
+ }
+ }
+
+ if (cfg->comp_done & MONO_COMP_SSA) {
+ mono_ssa_deadce (cfg);
+
+ //mono_ssa_strength_reduction (cfg);
+
+ if ((cfg->flags & MONO_CFG_HAS_LDELEMA) && (cfg->opt & MONO_OPT_ABCREM))
+ mono_perform_abc_removal (cfg);
+
+ mono_ssa_remove (cfg);
+
+ if (cfg->opt & MONO_OPT_BRANCH)
+ optimize_branches (cfg);
+ }
+
+ /* after SSA removal */
+ if (parts == 3)
+ return cfg;
+
+ decompose_pass (cfg);
+
+ if (cfg->opt & MONO_OPT_LINEARS) {
+ GList *vars, *regs;
+
+ /* fixme: maybe we can avoid to compute livenesss here if already computed ? */
+ cfg->comp_done &= ~MONO_COMP_LIVENESS;
+ if (!(cfg->comp_done & MONO_COMP_LIVENESS))
+ mono_analyze_liveness (cfg);
+
+ if ((vars = mono_arch_get_allocatable_int_vars (cfg))) {
+ regs = mono_arch_get_global_int_regs (cfg);
+ mono_linear_scan (cfg, vars, regs, &cfg->used_int_regs);
+ }
+ }
+
+ //mono_print_code (cfg);
+
+ //print_dfn (cfg);
+
+ /* variables are allocated after decompose, since decompose could create temps */
+ mono_arch_allocate_vars (cfg);
+
+ if (cfg->opt & MONO_OPT_CFOLD)
+ mono_constant_fold (cfg);
+
+ mini_select_instructions (cfg);
+
+ mono_codegen (cfg);
+ if (cfg->verbose_level >= 2) {
+ char *id = mono_method_full_name (cfg->method, FALSE);
+ mono_disassemble_code (cfg->native_code, cfg->code_len, id + 3);
+ g_free (id);
+ }
+
+ if (cfg->method->dynamic)
+ jinfo = g_new0 (MonoJitInfo, 1);
+ else
+ jinfo = mono_mempool_alloc0 (cfg->domain->mp, sizeof (MonoJitInfo));
+
+ jinfo->method = method;
+ jinfo->code_start = cfg->native_code;
+ jinfo->code_size = cfg->code_len;
+ jinfo->used_regs = cfg->used_int_regs;
+ jinfo->domain_neutral = (cfg->opt & MONO_OPT_SHARED) != 0;
+
+ if (header->num_clauses) {
+ int i;
+
+ jinfo->exvar_offset = cfg->exvar? cfg->exvar->inst_offset: 0;
+ jinfo->num_clauses = header->num_clauses;
+ jinfo->clauses = mono_mempool_alloc0 (cfg->domain->mp,
+ sizeof (MonoJitExceptionInfo) * header->num_clauses);
+
+ for (i = 0; i < header->num_clauses; i++) {
+ MonoExceptionClause *ec = &header->clauses [i];
+ MonoJitExceptionInfo *ei = &jinfo->clauses [i];
+ MonoBasicBlock *tblock;
+
+ ei->flags = ec->flags;
+
+ if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+ tblock = g_hash_table_lookup (cfg->bb_hash, ip + ec->data.filter_offset);
+ g_assert (tblock);
+ ei->data.filter = cfg->native_code + tblock->native_offset;
+ } else {
+ ei->data.catch_class = ec->data.catch_class;
+ }
+
+ tblock = g_hash_table_lookup (cfg->bb_hash, ip + ec->try_offset);
+ g_assert (tblock);
+ ei->try_start = cfg->native_code + tblock->native_offset;
+ g_assert (tblock->native_offset);
+ tblock = g_hash_table_lookup (cfg->bb_hash, ip + ec->try_offset + ec->try_len);
+ g_assert (tblock);
+ ei->try_end = cfg->native_code + tblock->native_offset;
+ g_assert (tblock->native_offset);
+ tblock = g_hash_table_lookup (cfg->bb_hash, ip + ec->handler_offset);
+ g_assert (tblock);
+ ei->handler_start = cfg->native_code + tblock->native_offset;
+ }
+ }
+
+ cfg->jit_info = jinfo;
+
+ mono_jit_info_table_add (cfg->domain, jinfo);
+
+ if (cfg->method->dynamic)
+ mono_dynamic_code_hash_lookup (cfg->method)->ji = jinfo;
+
+ /* collect statistics */
+ mono_jit_stats.allocated_code_size += cfg->code_len;
+ code_size_ratio = cfg->code_len;
+ if (code_size_ratio > mono_jit_stats.biggest_method_size) {
+ mono_jit_stats.biggest_method_size = code_size_ratio;
+ mono_jit_stats.biggest_method = method;
+ }
+ code_size_ratio = (code_size_ratio * 100) / mono_method_get_header (method)->code_size;
+ if (code_size_ratio > mono_jit_stats.max_code_size_ratio) {
+ mono_jit_stats.max_code_size_ratio = code_size_ratio;
+ mono_jit_stats.max_ratio_method = method;
+ }
+ mono_jit_stats.native_code_size += cfg->code_len;
+
+ if (cfg->prof_options & MONO_PROFILE_JIT_COMPILATION)
+ mono_profiler_method_end_jit (method, MONO_PROFILE_OK);
+
+ return cfg;
+}
+
+static gpointer
+mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain)
+{
+ MonoCompile *cfg;
+ GHashTable *jit_code_hash;
+ gpointer code = NULL;
+ guint32 opt;
+ MonoJitInfo *info;
+
+ opt = default_opt;
+
+ jit_code_hash = target_domain->jit_code_hash;
+
+#ifdef MONO_USE_AOT_COMPILER
+ if (!mono_compile_aot && (opt & MONO_OPT_AOT)) {
+ MonoJitInfo *info;
+ MonoDomain *domain = mono_domain_get ();
+
+ mono_domain_lock (domain);
+
+ mono_class_init (method->klass);
+ if ((info = mono_aot_get_method (domain, method))) {
+ g_hash_table_insert (domain->jit_code_hash, method, info);
+ mono_domain_unlock (domain);
+ mono_runtime_class_init (mono_class_vtable (domain, method->klass));
+ return info->code_start;
+ }
+
+ mono_domain_unlock (domain);
+ }
+#endif
+
+ if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
+ (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
+ MonoMethod *nm;
+ MonoMethodPInvoke* piinfo = (MonoMethodPInvoke *) method;
+
+ if (!piinfo->addr) {
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
+ piinfo->addr = mono_lookup_internal_call (method);
+ else
+ if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
+ mono_lookup_pinvoke_call (method, NULL, NULL);
+ }
+ nm = mono_marshal_get_native_wrapper (method);
+ return mono_compile_method (nm);
+
+ //if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
+ //mono_debug_add_wrapper (method, nm);
+ } else if ((method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
+ const char *name = method->name;
+ MonoMethod *nm;
+
+ if (method->klass->parent == mono_defaults.multicastdelegate_class) {
+ if (*name == '.' && (strcmp (name, ".ctor") == 0)) {
+ /* FIXME: uhm, we need a wrapper to handle exceptions? */
+ return (gpointer)mono_delegate_ctor;
+ } else if (*name == 'I' && (strcmp (name, "Invoke") == 0)) {
+ nm = mono_marshal_get_delegate_invoke (method);
+ return mono_jit_compile_method (nm);
+ } else if (*name == 'B' && (strcmp (name, "BeginInvoke") == 0)) {
+ nm = mono_marshal_get_delegate_begin_invoke (method);
+ return mono_jit_compile_method (nm);
+ } else if (*name == 'E' && (strcmp (name, "EndInvoke") == 0)) {
+ nm = mono_marshal_get_delegate_end_invoke (method);
+ return mono_jit_compile_method (nm);
+ }
+ }
+ return NULL;
+ }
+
+ cfg = mini_method_compile (method, opt, target_domain, TRUE, 0);
+
+ mono_domain_lock (target_domain);
+
+ /* Check if some other thread already did the job. In this case, we can
+ discard the code this thread generated. */
+
+ if ((info = g_hash_table_lookup (target_domain->jit_code_hash, method))) {
+ /* We can't use a domain specific method in another domain */
+ if ((target_domain == mono_domain_get ()) || info->domain_neutral) {
+ code = info->code_start;
+// printf("Discarding code for method %s\n", method->name);
+ }
+ }
+
+ if (code == NULL) {
+ g_hash_table_insert (jit_code_hash, method, cfg->jit_info);
+ code = cfg->native_code;
+ }
+
+ mono_destroy_compile (cfg);
+
+ if (target_domain->jump_target_hash) {
+ MonoJumpInfo patch_info;
+ GSList *list, *tmp;
+ list = g_hash_table_lookup (target_domain->jump_target_hash, method);
+ if (list) {
+ patch_info.next = NULL;
+ patch_info.ip.i = 0;
+ patch_info.type = MONO_PATCH_INFO_METHOD_JUMP;
+ patch_info.data.method = method;
+ g_hash_table_remove (target_domain->jump_target_hash, method);
+ }
+ for (tmp = list; tmp; tmp = tmp->next)
+ mono_arch_patch_code (NULL, target_domain, tmp->data, &patch_info, TRUE);
+ g_slist_free (list);
+ }
+
+ mono_domain_unlock (target_domain);
+
+ mono_runtime_class_init (mono_class_vtable (target_domain, method->klass));
+ return code;
+}
+
+static gpointer
+mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt)
+{
+ /* FIXME: later copy the code from mono */
+ MonoDomain *target_domain, *domain = mono_domain_get ();
+ MonoJitInfo *info;
+ gpointer p;
+
+ if (opt & MONO_OPT_SHARED)
+ target_domain = mono_get_root_domain ();
+ else
+ target_domain = domain;
+
+ mono_domain_lock (target_domain);
+
+ if ((info = g_hash_table_lookup (target_domain->jit_code_hash, method))) {
+ /* We can't use a domain specific method in another domain */
+ if (! ((domain != target_domain) && !info->domain_neutral)) {
+ mono_domain_unlock (target_domain);
+ mono_jit_stats.methods_lookups++;
+ mono_runtime_class_init (mono_class_vtable (domain, method->klass));
+ return info->code_start;
+ }
+ }
+
+ mono_domain_unlock (target_domain);
+ p = mono_jit_compile_method_inner (method, target_domain);
+ return p;
+}
+
+static gpointer
+mono_jit_compile_method (MonoMethod *method)
+{
+ return mono_jit_compile_method_with_opt (method, default_opt);
+}
+
+static void
+invalidated_delegate_trampoline (MonoClass *klass)
+{
+ g_error ("Unmanaged code called delegate of type %s which was already garbage collected.\n"
+ "See http://www.go-mono.com/delegate.html for an explanation and ways to fix this.",
+ mono_type_full_name (&klass->byval_arg));
+}
+
+/*
+ * mono_jit_free_method:
+ *
+ * Free all memory allocated by the JIT for METHOD.
+ */
+static void
+mono_jit_free_method (MonoMethod *method)
+{
+ MonoJitDynamicMethodInfo *ji;
+
+ g_assert (method->dynamic);
+
+#ifdef MONO_ARCH_HAVE_INVALIDATE_METHOD
+ if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
+ /*
+ * Instead of freeing the code, change it to call an error routine
+ * so people can fix their code.
+ */
+ EnterCriticalSection (&jit_mutex);
+ ji = g_hash_table_lookup (dynamic_code_hash, method);
+ LeaveCriticalSection (&jit_mutex);
+ if (ji){
+ char *type = mono_type_full_name (&method->klass->byval_arg);
+ char *type_and_method = g_strdup_printf ("%s.%s", type, method->name);
+
+ g_free (type);
+ mono_arch_invalidate_method (ji->ji, invalidated_delegate_trampoline, type_and_method);
+ }
+ return;
+ }
+#endif
+
+ EnterCriticalSection (&jit_mutex);
+ ji = g_hash_table_lookup (dynamic_code_hash, method);
+ if (!ji) {
+ LeaveCriticalSection (&jit_mutex);
+ return;
+ }
+ g_hash_table_remove (dynamic_code_hash, ji);
+ LeaveCriticalSection (&jit_mutex);
+
+ mono_code_manager_destroy (ji->code_mp);
+ mono_jit_info_table_remove (mono_domain_get (), ji->ji);
+ g_free (ji->ji);
+ g_free (ji);
+}
+
+static gpointer
+mono_jit_find_compiled_method (MonoDomain *domain, MonoMethod *method)
+{
+ MonoDomain *target_domain;
+ MonoJitInfo *info;
+
+ if (default_opt & MONO_OPT_SHARED)
+ target_domain = mono_get_root_domain ();
+ else
+ target_domain = domain;
+
+ mono_domain_lock (target_domain);
+
+ if ((info = g_hash_table_lookup (target_domain->jit_code_hash, method))) {
+ /* We can't use a domain specific method in another domain */
+ if (! ((domain != target_domain) && !info->domain_neutral)) {
+ mono_domain_unlock (target_domain);
+ mono_jit_stats.methods_lookups++;
+ return info->code_start;
+ }
+ }
+
+ mono_domain_unlock (target_domain);
+
+ return NULL;
+}
+
+/**
+ * mono_jit_runtime_invoke:
+ * @method: the method to invoke
+ * @obj: this pointer
+ * @params: array of parameter values.
+ * @exc: used to catch exceptions objects
+ */
+static MonoObject*
+mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
+{
+ MonoMethod *invoke;
+ MonoObject *(*runtime_invoke) (MonoObject *this, void **params, MonoObject **exc, void* compiled_method);
+ void* compiled_method;
+
+ if (obj == NULL && !(method->flags & METHOD_ATTRIBUTE_STATIC) && !method->string_ctor && (method->wrapper_type == 0)) {
+ g_warning ("Ignoring invocation of an instance method on a NULL instance.\n");
+ return NULL;
+ }
+
+ invoke = mono_marshal_get_runtime_invoke (method);
+ runtime_invoke = mono_jit_compile_method (invoke);
+
+ /* We need this here becuase mono_marshal_get_runtime_invoke can be place
+ * the helper method in System.Object and not the target class
+ */
+ mono_runtime_class_init (mono_class_vtable (mono_domain_get (), method->klass));
+
+ compiled_method = mono_jit_compile_method (method);
+ return runtime_invoke (obj, params, exc, compiled_method);
+}
+
+#ifdef PLATFORM_WIN32
+#define GET_CONTEXT \
+ struct sigcontext *ctx = (struct sigcontext*)_dummy;
+#else
+#ifdef __sparc
+#define GET_CONTEXT \
+ void *ctx = context;
+#elif defined(sun) // Solaris x86
+#define GET_CONTEXT \
+ ucontext_t *uctx = context; \
+ struct sigcontext *ctx = (struct sigcontext *)&(uctx->uc_mcontext);
+#elif defined(__ppc__) || defined (__powerpc__) || defined (__s390__) || defined (MONO_ARCH_USE_SIGACTION)
+#define GET_CONTEXT \
+ void *ctx = context;
+#else
+#define GET_CONTEXT \
+ void **_p = (void **)&_dummy; \
+ struct sigcontext *ctx = (struct sigcontext *)++_p;
+#endif
+#endif
+
+#ifdef MONO_ARCH_USE_SIGACTION
+#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, siginfo_t *info, void *context)
+#else
+#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy)
+#endif
+
+static void
+SIG_HANDLER_SIGNATURE (sigfpe_signal_handler)
+{
+ MonoException *exc = NULL;
+ GET_CONTEXT;
+
+#if defined(MONO_ARCH_HAVE_IS_INT_OVERFLOW)
+ if (mono_arch_is_int_overflow (ctx))
+ exc = mono_get_exception_arithmetic ();
+ else
+ exc = mono_get_exception_divide_by_zero ();
+#else
+ exc = mono_get_exception_divide_by_zero ();
+#endif
+
+ mono_arch_handle_exception (ctx, exc, FALSE);
+}
+
+static void
+SIG_HANDLER_SIGNATURE (sigill_signal_handler)
+{
+ MonoException *exc;
+ GET_CONTEXT
+ exc = mono_get_exception_execution_engine ("SIGILL");
+
+ mono_arch_handle_exception (ctx, exc, FALSE);
+}
+
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+
+static void
+sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
+{
+ MonoException *exc;
+ MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
+ struct sigcontext *ctx = (struct sigcontext *)&(((ucontext_t*)context)->uc_mcontext);
+
+ /* Can't allocate memory using Boehm GC on altstack */
+ if (jit_tls->stack_size &&
+ ((guint8*)info->si_addr >= (guint8*)jit_tls->end_of_stack - jit_tls->stack_size) &&
+ ((guint8*)info->si_addr < (guint8*)jit_tls->end_of_stack))
+ exc = mono_domain_get ()->stack_overflow_ex;
+ else
+ exc = mono_domain_get ()->null_reference_ex;
+
+ mono_arch_handle_exception (ctx, exc, FALSE);
+}
+
+#else
+
+static void
+SIG_HANDLER_SIGNATURE (sigsegv_signal_handler)
+{
+ GET_CONTEXT;
+
+ mono_arch_handle_exception (ctx, NULL, FALSE);
+}
+
+#endif
+
+static void
+SIG_HANDLER_SIGNATURE (sigusr1_signal_handler)
+{
+ gboolean running_managed;
+ MonoException *exc;
+
+ GET_CONTEXT
+
+ running_managed = (mono_jit_info_table_find (mono_domain_get (), mono_arch_ip_from_context(ctx)) != NULL);
+
+ exc = mono_thread_request_interruption (running_managed);
+ if (!exc) return;
+
+ mono_arch_handle_exception (ctx, exc, FALSE);
+}
+
+static void
+SIG_HANDLER_SIGNATURE (sigquit_signal_handler)
+{
+ MonoException *exc;
+ GET_CONTEXT
+
+ exc = mono_get_exception_execution_engine ("Interrupted (SIGQUIT).");
+
+ mono_arch_handle_exception (ctx, exc, FALSE);
+}
+
+static void
+SIG_HANDLER_SIGNATURE (sigint_signal_handler)
+{
+ MonoException *exc;
+ GET_CONTEXT
+
+ exc = mono_get_exception_execution_engine ("Interrupted (SIGINT).");
+
+ mono_arch_handle_exception (ctx, exc, FALSE);
+}
+
+#ifndef PLATFORM_WIN32
+static void
+add_signal_handler (int signo, gpointer handler)
+{
+ struct sigaction sa;
+
+#ifdef MONO_ARCH_USE_SIGACTION
+ sa.sa_sigaction = handler;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = SA_SIGINFO;
+#else
+ sa.sa_handler = handler;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+#endif
+ g_assert (sigaction (signo, &sa, NULL) != -1);
+}
+#endif
+
+static void
+mono_runtime_install_handlers (void)
+{
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ struct sigaction sa;
+#endif
+
+#ifdef PLATFORM_WIN32
+ win32_seh_init();
+ win32_seh_set_handler(SIGFPE, sigfpe_signal_handler);
+ win32_seh_set_handler(SIGILL, sigill_signal_handler);
+ win32_seh_set_handler(SIGSEGV, sigsegv_signal_handler);
+ if (getenv ("MONO_DEBUG"))
+ win32_seh_set_handler(SIGINT, sigint_signal_handler);
+#else /* !PLATFORM_WIN32 */
+
+ /* libpthreads has its own implementation of sigaction(),
+ * but it seems to work well with our current exception
+ * handlers. If not we must call syscall directly instead
+ * of sigaction */
+
+ if (getenv ("MONO_DEBUG")) {
+ add_signal_handler (SIGINT, sigint_signal_handler);
+ }
+
+ add_signal_handler (SIGFPE, sigfpe_signal_handler);
+ add_signal_handler (SIGQUIT, sigquit_signal_handler);
+ add_signal_handler (SIGILL, sigill_signal_handler);
+ add_signal_handler (SIGBUS, sigsegv_signal_handler);
+ add_signal_handler (mono_thread_get_abort_signal (), sigusr1_signal_handler);
+
+ /* catch SIGSEGV */
+#ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
+ sa.sa_sigaction = sigsegv_signal_handler;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
+ g_assert (sigaction (SIGSEGV, &sa, NULL) != -1);
+#else
+ add_signal_handler (SIGSEGV, sigsegv_signal_handler);
+#endif
+
+#endif /* PLATFORM_WIN32 */
+}
+
+/* mono_jit_create_remoting_trampoline:
+ * @method: pointer to the method info
+ *
+ * Creates a trampoline which calls the remoting functions. This
+ * is used in the vtable of transparent proxies.
+ *
+ * Returns: a pointer to the newly created code
+ */
+static gpointer
+mono_jit_create_remoting_trampoline (MonoMethod *method)
+{
+ MonoMethod *nm;
+ guint8 *addr = NULL;
+
+ if ((method->flags & METHOD_ATTRIBUTE_ABSTRACT) ||
+ (method->signature->hasthis && (method->klass->marshalbyref || method->klass == mono_defaults.object_class))) {
+ nm = mono_marshal_get_remoting_invoke (method);
+ addr = mono_compile_method (nm);
+ } else {
+ addr = mono_compile_method (method);
+ }
+ return addr;
+}
+
+MonoDomain *
+mini_init (const char *filename)
+{
+ MonoDomain *domain;
+
+ mono_arch_cpu_init ();
+
+ if (!g_thread_supported ())
+ g_thread_init (NULL);
+
+ MONO_GC_PRE_INIT ();
+
+ mono_jit_tls_id = TlsAlloc ();
+ setup_jit_tls_data ((gpointer)-1, mono_thread_abort);
+
+ InitializeCriticalSection (&jit_mutex);
+
+ mono_burg_init ();
+
+ if (default_opt & MONO_OPT_AOT)
+ mono_aot_init ();
+
+ mono_runtime_install_handlers ();
+ mono_threads_install_cleanup (mini_thread_cleanup);
+
+#define JIT_TRAMPOLINES_WORK
+#ifdef JIT_TRAMPOLINES_WORK
+ mono_install_compile_method (mono_jit_compile_method);
+ mono_install_free_method (mono_jit_free_method);
+ mono_install_trampoline (mono_create_jit_trampoline);
+ mono_install_remoting_trampoline (mono_jit_create_remoting_trampoline);
+#endif
+#define JIT_INVOKE_WORKS
+#ifdef JIT_INVOKE_WORKS
+ mono_install_runtime_invoke (mono_jit_runtime_invoke);
+ mono_install_handler (mono_arch_get_throw_exception ());
+#endif
+ mono_install_stack_walk (mono_jit_walk_stack);
+
+ domain = mono_init_from_assembly (filename, filename);
+ mono_init_icall ();
+
+ mono_add_internal_call ("System.Diagnostics.StackFrame::get_frame_info",
+ ves_icall_get_frame_info);
+ mono_add_internal_call ("System.Diagnostics.StackTrace::get_trace",
+ ves_icall_get_trace);
+ mono_add_internal_call ("Mono.Runtime::mono_runtime_install_handlers",
+ mono_runtime_install_handlers);
+
+
+ create_helper_signature ();
+
+#define JIT_CALLS_WORK
+#ifdef JIT_CALLS_WORK
+ /* Needs to be called here since register_jit_icall depends on it */
+ mono_marshal_init ();
+
+ mono_arch_register_lowlevel_calls ();
+ mono_register_jit_icall (mono_profiler_method_enter, "mono_profiler_method_enter", NULL, TRUE);
+ mono_register_jit_icall (mono_profiler_method_leave, "mono_profiler_method_leave", NULL, TRUE);
+ mono_register_jit_icall (mono_trace_enter_method, "mono_trace_enter_method", NULL, TRUE);
+ mono_register_jit_icall (mono_trace_leave_method, "mono_trace_leave_method", NULL, TRUE);
+ mono_register_jit_icall (mono_get_lmf_addr, "mono_get_lmf_addr", helper_sig_ptr_void, TRUE);
+ mono_register_jit_icall (mono_domain_get, "mono_domain_get", helper_sig_domain_get, TRUE);
+
+ mono_register_jit_icall (mono_arch_get_throw_exception (), "mono_arch_throw_exception", helper_sig_void_obj, TRUE);
+#ifdef MONO_ARCH_HAVE_RETHROW
+ mono_register_jit_icall (mono_arch_get_rethrow_exception (), "mono_arch_rethrow_exception", helper_sig_void_obj, TRUE);
+#endif
+ mono_register_jit_icall (mono_arch_get_throw_exception_by_name (), "mono_arch_throw_exception_by_name",
+ helper_sig_void_ptr, TRUE);
+ mono_register_jit_icall (mono_thread_get_pending_exception, "mono_thread_get_pending_exception", helper_sig_obj_void, FALSE);
+ mono_register_jit_icall (mono_thread_interruption_checkpoint, "mono_thread_interruption_checkpoint", helper_sig_void_void, FALSE);
+ mono_register_jit_icall (mono_load_remote_field_new, "mono_load_remote_field_new", helper_sig_obj_obj_ptr_ptr, FALSE);
+ mono_register_jit_icall (mono_store_remote_field_new, "mono_store_remote_field_new", helper_sig_void_obj_ptr_ptr_obj, FALSE);
+
+ /*
+ * NOTE, NOTE, NOTE, NOTE:
+ * when adding emulation for some opcodes, remember to also add a dummy
+ * rule to the burg files, because we need the arity information to be correct.
+ */
+ mono_register_opcode_emulation (OP_LMUL, "__emul_lmul", helper_sig_long_long_long, mono_llmult, TRUE);
+ mono_register_opcode_emulation (OP_LMUL_OVF_UN, "__emul_lmul_ovf_un", helper_sig_long_long_long, mono_llmult_ovf_un, FALSE);
+ mono_register_opcode_emulation (OP_LMUL_OVF, "__emul_lmul_ovf", helper_sig_long_long_long, mono_llmult_ovf, FALSE);
+ mono_register_opcode_emulation (OP_LDIV, "__emul_ldiv", helper_sig_long_long_long, mono_lldiv, FALSE);
+ mono_register_opcode_emulation (OP_LDIV_UN, "__emul_ldiv_un", helper_sig_long_long_long, mono_lldiv_un, FALSE);
+ mono_register_opcode_emulation (OP_LREM, "__emul_lrem", helper_sig_long_long_long, mono_llrem, FALSE);
+ mono_register_opcode_emulation (OP_LREM_UN, "__emul_lrem_un", helper_sig_long_long_long, mono_llrem_un, FALSE);
+
+#ifndef MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
+ mono_register_opcode_emulation (OP_LSHL, "__emul_lshl", helper_sig_long_long_int, mono_lshl, TRUE);
+ mono_register_opcode_emulation (OP_LSHR, "__emul_lshr", helper_sig_long_long_int, mono_lshr, TRUE);
+ mono_register_opcode_emulation (OP_LSHR_UN, "__emul_lshr_un", helper_sig_long_long_int, mono_lshr_un, TRUE);
+#endif
+
+ mono_register_opcode_emulation (OP_FCONV_TO_U8, "__emul_fconv_to_u8", helper_sig_ulong_double, mono_fconv_u8, FALSE);
+ mono_register_opcode_emulation (OP_FCONV_TO_U4, "__emul_fconv_to_u4", helper_sig_uint_double, mono_fconv_u4, FALSE);
+ mono_register_opcode_emulation (OP_FCONV_TO_OVF_I8, "__emul_fconv_to_ovf_i8", helper_sig_long_double, mono_fconv_ovf_i8, FALSE);
+ mono_register_opcode_emulation (OP_FCONV_TO_OVF_U8, "__emul_fconv_to_ovf_u8", helper_sig_ulong_double, mono_fconv_ovf_u8, FALSE);
+
+#ifdef MONO_ARCH_EMULATE_FCONV_TO_I8
+ mono_register_opcode_emulation (OP_FCONV_TO_I8, "__emul_fconv_to_i8", helper_sig_long_double, mono_fconv_i8, FALSE);
+#endif
+#ifdef MONO_ARCH_EMULATE_CONV_R8_UN
+ mono_register_opcode_emulation (CEE_CONV_R_UN, "__emul_conv_r_un", helper_sig_double_int, mono_conv_to_r8_un, FALSE);
+#endif
+#ifdef MONO_ARCH_EMULATE_LCONV_TO_R8
+ mono_register_opcode_emulation (OP_LCONV_TO_R8, "__emul_lconv_to_r8", helper_sig_double_long, mono_lconv_to_r8, FALSE);
+#endif
+#ifdef MONO_ARCH_EMULATE_LCONV_TO_R4
+ mono_register_opcode_emulation (OP_LCONV_TO_R4, "__emul_lconv_to_r4", helper_sig_float_long, mono_lconv_to_r4, FALSE);
+#endif
+#ifdef MONO_ARCH_EMULATE_LCONV_TO_R8_UN
+ mono_register_opcode_emulation (OP_LCONV_TO_R_UN, "__emul_lconv_to_r8_un", helper_sig_double_long, mono_lconv_to_r8_un, FALSE);
+#endif
+#ifdef MONO_ARCH_EMULATE_FREM
+ mono_register_opcode_emulation (OP_FREM, "__emul_frem", helper_sig_double_double_double, fmod, FALSE);
+#endif
+
+#if SIZEOF_VOID_P == 4
+ mono_register_opcode_emulation (OP_FCONV_TO_U, "__emul_fconv_to_u", helper_sig_uint_double, mono_fconv_u4, TRUE);
+#else
+#ifdef __GNUC__
+#warning "fixme: add opcode emulation"
+#endif
+#endif
+
+ /* other jit icalls */
+ mono_register_jit_icall (mono_class_static_field_address , "mono_class_static_field_address",
+ helper_sig_ptr_ptr_ptr, FALSE);
+ mono_register_jit_icall (mono_ldtoken_wrapper, "mono_ldtoken_wrapper", helper_sig_ptr_ptr_ptr, FALSE);
+ mono_register_jit_icall (mono_get_special_static_data, "mono_get_special_static_data", helper_sig_ptr_int, FALSE);
+ mono_register_jit_icall (mono_ldstr, "mono_ldstr", helper_sig_ldstr, FALSE);
+ mono_register_jit_icall (helper_memcpy, "helper_memcpy", helper_sig_memcpy, FALSE);
+ mono_register_jit_icall (helper_memset, "helper_memset", helper_sig_memset, FALSE);
+ mono_register_jit_icall (helper_initobj, "helper_initobj", helper_sig_initobj, FALSE);
+ mono_register_jit_icall (helper_stelem_ref, "helper_stelem_ref", helper_sig_stelem_ref, FALSE);
+ mono_register_jit_icall (helper_stelem_ref_check, "helper_stelem_ref_check", helper_sig_stelem_ref_check, FALSE);
+ mono_register_jit_icall (mono_object_new, "mono_object_new", helper_sig_object_new, FALSE);
+ mono_register_jit_icall (mono_object_new_specific, "mono_object_new_specific", helper_sig_object_new_specific, FALSE);
+ mono_register_jit_icall (mono_array_new, "mono_array_new", helper_sig_newarr, FALSE);
+ mono_register_jit_icall (mono_array_new_specific, "mono_array_new_specific", helper_sig_newarr_specific, FALSE);
+ mono_register_jit_icall (mono_runtime_class_init, "mono_runtime_class_init", helper_sig_void_ptr, FALSE);
+ mono_register_jit_icall (mono_ldftn, "mono_ldftn", helper_sig_compile, FALSE);
+ mono_register_jit_icall (mono_ldftn_nosync, "mono_ldftn_nosync", helper_sig_compile, FALSE);
+ mono_register_jit_icall (mono_ldvirtfn, "mono_ldvirtfn", helper_sig_compile_virt, FALSE);
+#endif
+
+#define JIT_RUNTIME_WORKS
+#ifdef JIT_RUNTIME_WORKS
+ mono_runtime_install_cleanup ((MonoDomainFunc)mini_cleanup);
+ mono_runtime_init (domain, mono_thread_start_cb, mono_thread_attach_cb);
+#endif
+
+ mono_thread_attach (domain);
+ return domain;
+}
+
+MonoJitStats mono_jit_stats = {0};
+
+static void
+print_jit_stats (void)
+{
+ if (mono_jit_stats.enabled) {
+ g_print ("Mono Jit statistics\n");
+ g_print ("Compiled methods: %ld\n", mono_jit_stats.methods_compiled);
+ g_print ("Methods from AOT: %ld\n", mono_jit_stats.methods_aot);
+ g_print ("Methods cache lookup: %ld\n", mono_jit_stats.methods_lookups);
+ g_print ("Method trampolines: %ld\n", mono_jit_stats.method_trampolines);
+ g_print ("Basic blocks: %ld\n", mono_jit_stats.basic_blocks);
+ g_print ("Max basic blocks: %ld\n", mono_jit_stats.max_basic_blocks);
+ g_print ("Allocated vars: %ld\n", mono_jit_stats.allocate_var);
+ g_print ("Analyze stack repeat: %ld\n", mono_jit_stats.analyze_stack_repeat);
+ g_print ("Compiled CIL code size: %ld\n", mono_jit_stats.cil_code_size);
+ g_print ("Native code size: %ld\n", mono_jit_stats.native_code_size);
+ g_print ("Max code size ratio: %.2f (%s::%s)\n", mono_jit_stats.max_code_size_ratio/100.0,
+ mono_jit_stats.max_ratio_method->klass->name, mono_jit_stats.max_ratio_method->name);
+ g_print ("Biggest method: %ld (%s::%s)\n", mono_jit_stats.biggest_method_size,
+ mono_jit_stats.biggest_method->klass->name, mono_jit_stats.biggest_method->name);
+ g_print ("Code reallocs: %ld\n", mono_jit_stats.code_reallocs);
+ g_print ("Allocated code size: %ld\n", mono_jit_stats.allocated_code_size);
+ g_print ("Inlineable methods: %ld\n", mono_jit_stats.inlineable_methods);
+ g_print ("Inlined methods: %ld\n", mono_jit_stats.inlined_methods);
+
+ g_print ("\nCreated object count: %ld\n", mono_stats.new_object_count);
+ g_print ("Initialized classes: %ld\n", mono_stats.initialized_class_count);
+ g_print ("Used classes: %ld\n", mono_stats.used_class_count);
+ g_print ("Static data size: %ld\n", mono_stats.class_static_data_size);
+ g_print ("VTable data size: %ld\n", mono_stats.class_vtable_size);
+
+ g_print ("\nGeneric instances: %ld\n", mono_stats.generic_instance_count);
+ g_print ("Inflated methods: %ld\n", mono_stats.inflated_method_count);
+ g_print ("Inflated types: %ld\n", mono_stats.inflated_type_count);
+ g_print ("Generics metadata size: %ld\n", mono_stats.generics_metadata_size);
+ }
+}
+
+void
+mini_cleanup (MonoDomain *domain)
+{
+ /*
+ * mono_runtime_cleanup() and mono_domain_finalize () need to
+ * be called early since they need the execution engine still
+ * fully working (mono_domain_finalize may invoke managed finalizers
+ * and mono_runtime_cleanup will wait for other threads to finish).
+ */
+ mono_domain_finalize (domain, 2000);
+
+ mono_runtime_cleanup (domain);
+
+ mono_profiler_shutdown ();
+
+ mono_debug_cleanup ();
+
+#ifdef PLATFORM_WIN32
+ win32_seh_cleanup();
+#endif
+
+ mono_domain_free (domain, TRUE);
+
+ print_jit_stats ();
+}
+
+void
+mono_set_defaults (int verbose_level, guint32 opts)
+{
+ mini_verbose = verbose_level;
+ default_opt = opts;
+}
+
+static void
+mono_precompile_assembly (MonoAssembly *ass, void *user_data)
+{
+ MonoImage *image = mono_assembly_get_image (ass);
+ MonoMethod *method, *invoke;
+ int i, count = 0;
+
+ if (mini_verbose > 0)
+ printf ("PRECOMPILE: %s.\n", mono_image_get_filename (image));
+
+ for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
+ if (method->flags & METHOD_ATTRIBUTE_ABSTRACT)
+ continue;
+
+ count++;
+ if (mini_verbose > 1) {
+ char * desc = mono_method_full_name (method, TRUE);
+ g_print ("Compiling %d %s\n", count, desc);
+ g_free (desc);
+ }
+ mono_compile_method (method);
+ if (strcmp (method->name, "Finalize") == 0) {
+ invoke = mono_marshal_get_runtime_invoke (method);
+ mono_compile_method (invoke);
+ }
+ if (method->klass->marshalbyref && method->signature->hasthis) {
+ invoke = mono_marshal_get_remoting_invoke_with_check (method);
+ mono_compile_method (invoke);
+ }
+ }
+}
+
+void mono_precompile_assemblies ()
+{
+ mono_assembly_foreach ((GFunc)mono_precompile_assembly, NULL);
+}
diff --git a/mono/mini/mini.h b/mono/mini/mini.h
new file mode 100644
index 00000000000..6d8921339d0
--- /dev/null
+++ b/mono/mini/mini.h
@@ -0,0 +1,846 @@
+#ifndef __MONO_MINI_H__
+#define __MONO_MINI_H__
+
+#include "config.h"
+#include <glib.h>
+#include <signal.h>
+#include <mono/metadata/loader.h>
+#include <mono/metadata/mempool.h>
+#include <mono/utils/monobitset.h>
+#include <mono/metadata/class.h>
+#include <mono/metadata/object.h>
+#include <mono/metadata/opcodes.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/domain-internals.h>
+#include "mono/metadata/class-internals.h"
+#include "mono/metadata/object-internals.h"
+#include <mono/metadata/profiler-private.h>
+
+#include "mini-arch.h"
+#include "regalloc.h"
+
+#define MONO_USE_AOT_COMPILER
+
+/* for 32 bit systems */
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define MINI_LS_WORD_OFFSET 0
+#define MINI_MS_WORD_OFFSET 4
+#define inst_ls_word data.op[0].const_val
+#define inst_ms_word data.op[1].const_val
+#else
+#define MINI_LS_WORD_OFFSET 4
+#define MINI_MS_WORD_OFFSET 0
+#define inst_ls_word data.op[1].const_val
+#define inst_ms_word data.op[0].const_val
+#endif
+
+/* Version number of the AOT file format */
+#define MONO_AOT_FILE_VERSION "9"
+
+#if 1
+#define mono_bitset_test_fast(set,n) (((guint32*)set)[2+(n)/32] & (1 << ((n) % 32)))
+#else
+#define mono_bitset_test_fast(set,n) mono_bitset_test(set,n)
+#endif
+
+#if 0
+#define mono_bitset_foreach_bit(set,b,n) \
+ for (b = 0; b < n; b++)\
+ if (mono_bitset_test_fast(set,b))
+#define mono_bitset_foreach_bit_rev(set,b,n) \
+ for (b = n - 1; b >= 0; b--)\
+ if (mono_bitset_test_fast(set,b))
+#else
+#define mono_bitset_foreach_bit(set,b,n) \
+ for (b = mono_bitset_find_first (set, -1); b < n && b >= 0; b = mono_bitset_find_first (set, b))
+#define mono_bitset_foreach_bit_rev(set,b,n) \
+ for (b = mono_bitset_find_last (set, n - 1); b >= 0; b = b ? mono_bitset_find_last (set, b) : -1)
+
+#endif
+
+/*
+ * Pull the list of opcodes
+ */
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
+ a = i,
+
+enum {
+#include "mono/cil/opcode.def"
+ CEE_LASTOP
+};
+#undef OPDEF
+
+#define MONO_VARINFO(cfg,varnum) ((cfg)->vars [varnum])
+
+#define MONO_INST_NEW(cfg,dest,op) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = (op); \
+ } while (0)
+
+#define MONO_INST_NEW_CALL(cfg,dest,op) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoCallInst)); \
+ (dest)->inst.opcode = (op); \
+ } while (0)
+
+#define MONO_ADD_INS(b,inst) do { \
+ if ((b)->last_ins) { \
+ (b)->last_ins->next = (inst); \
+ (b)->last_ins = (inst); \
+ } else { \
+ (b)->code = (b)->last_ins = (inst); \
+ } \
+ } while (0)
+
+typedef struct MonoInst MonoInst;
+typedef struct MonoCallInst MonoCallInst;
+typedef struct MonoEdge MonoEdge;
+typedef struct MonoMethodVar MonoMethodVar;
+typedef struct MonoBasicBlock MonoBasicBlock;
+typedef struct MonoLMF MonoLMF;
+typedef struct MonoSpillInfo MonoSpillInfo;
+typedef struct MonoTraceSpec MonoTraceSpec;
+
+extern guint32 mono_jit_tls_id;
+extern MonoTraceSpec *mono_jit_trace_calls;
+extern gboolean mono_break_on_exc;
+extern int mono_exc_esp_offset;
+extern gboolean mono_compile_aot;
+
+struct MonoEdge {
+ MonoEdge *next;
+ MonoBasicBlock *bb;
+ /* add edge type? */
+};
+
+struct MonoSpillInfo {
+ MonoSpillInfo *next;
+ int offset;
+};
+
+/*
+ * The IR-level basic block.
+ *
+ * A basic block can have multiple exits just fine, as long as the point of
+ * 'departure' is the last instruction in the basic block. Extended basic
+ * blocks, on the other hand, may have instructions that leave the block
+ * midstream. The important thing is that they cannot be _entered_
+ * midstream, ie, execution of a basic block (or extened bb) always start
+ * at the beginning of the block, never in the middle.
+ */
+struct MonoBasicBlock {
+ MonoInst *last_ins;
+
+ /* Points to the start of the CIL code that initiated this BB */
+ unsigned char* cil_code;
+
+ /* Length of the CIL block */
+ gint32 cil_length;
+
+ /* The address of the generated code, used for fixups */
+ int native_offset;
+ int max_offset;
+
+ gint32 dfn;
+
+ /* unique block number identification */
+ gint32 block_num;
+
+ /* Visited and reachable flags */
+ guint32 flags;
+
+ /* Basic blocks: incoming and outgoing counts and pointers */
+ gint16 out_count, in_count;
+ MonoBasicBlock **in_bb;
+ MonoBasicBlock **out_bb;
+
+ /* the next basic block in the order it appears in IL */
+ MonoBasicBlock *next_bb;
+
+ /*
+ * Before instruction selection it is the first tree in the
+ * forest and the first item in the list of trees. After
+ * instruction selection it is the first instruction and the
+ * first item in the list of instructions.
+ */
+ MonoInst *code;
+
+ /*
+ * SSA and loop based flags
+ */
+ MonoBitSet *dominators;
+ MonoBitSet *dfrontier;
+ MonoBasicBlock *idom;
+ GList *dominated;
+ /* fast dominator algorithm */
+ MonoBasicBlock *df_parent, *ancestor, *child, *label;
+ MonoEdge *bucket;
+ int size, sdom, idomn;
+
+ /* loop nesting and recognition */
+ GList *loop_blocks;
+ gint8 nesting;
+ gint8 loop_body_start;
+
+ /* use for liveness analysis */
+ MonoBitSet *gen_set;
+ MonoBitSet *kill_set;
+ MonoBitSet *live_in_set;
+ MonoBitSet *live_out_set;
+
+ /* fields to deal with non-empty stack slots at bb boundary */
+ guint16 out_scount, in_scount;
+ MonoInst **out_stack;
+ MonoInst **in_stack;
+
+ /* we use that to prevent merging of bblock covered by different clauses*/
+ guint real_offset;
+
+ /*
+ * The region encodes whether the basic block is inside
+ * a finally, catch, filter or none of thoese.
+ *
+ * If the value is -1, then it is neither finally, catch nor filter
+ *
+ * Otherwise the format is:
+ *
+ * Bits: | 0-3 | 4-7 | 8-31
+ * | | |
+ * | clause-flags | MONO_REGION | clause-index
+ *
+ */
+ guint region;
+
+ /* The current symbolic register number, used in local register allocation. */
+ guint32 max_ireg, max_freg;
+};
+
+/* BBlock flags */
+#define BB_VISITED 1
+#define BB_REACHABLE 2
+
+struct MonoInst {
+ union {
+ union {
+ MonoInst *src;
+ MonoMethodVar *var;
+ gssize const_val;
+ gpointer p;
+ MonoMethod *method;
+ MonoMethodSignature *signature;
+ MonoBasicBlock **many_blocks;
+ MonoBasicBlock *target_block;
+ MonoInst **args;
+ MonoType *vtype;
+ MonoClass *klass;
+ int *phi_args;
+ } op [2];
+ gint64 i8const;
+ double r8const;
+ } data;
+ guint16 opcode;
+ guint8 type; /* stack type */
+ guint ssa_op : 3;
+ guint8 flags : 5;
+
+ /* used by the register allocator */
+ gint32 dreg, sreg1, sreg2, unused;
+
+ MonoInst *next;
+ MonoClass *klass;
+ const unsigned char* cil_code; /* for debugging and bblock splitting */
+};
+
+struct MonoCallInst {
+ MonoInst inst;
+ MonoMethodSignature *signature;
+ MonoMethod *method;
+ MonoInst **args;
+ MonoInst *out_args;
+ gconstpointer fptr;
+ guint stack_usage;
+ gboolean virtual;
+ regmask_t used_iregs;
+ regmask_t used_fregs;
+#ifdef __x86_64__
+ GSList *out_ireg_args;
+ GSList *out_freg_args;
+#endif
+};
+
+/*
+ * flags for MonoInst
+ * Note: some of the values overlap, because they can't appear
+ * in the same MonoInst.
+ */
+enum {
+ MONO_INST_HAS_METHOD = 1,
+ /* temp local created by a DUP: used only within a BB */
+ MONO_INST_IS_TEMP = 1,
+ MONO_INST_INIT = 1, /* in localloc */
+ MONO_INST_IS_DEAD = 2,
+ MONO_INST_TAILCALL = 4,
+ MONO_INST_VOLATILE = 4,
+ MONO_INST_BRLABEL = 4,
+ MONO_INST_NOTYPECHECK = 4,
+ MONO_INST_UNALIGNED = 8,
+ /* the address of the variable has been taken */
+ MONO_INST_INDIRECT = 16,
+ MONO_INST_NORANGECHECK = 16
+};
+
+#define inst_c0 data.op[0].const_val
+#define inst_c1 data.op[1].const_val
+#define inst_i0 data.op[0].src
+#define inst_i1 data.op[1].src
+#define inst_p0 data.op[0].p
+#define inst_p1 data.op[1].p
+#define inst_l data.i8const
+#define inst_r data.r8const
+#define inst_left data.op[0].src
+#define inst_right data.op[1].src
+
+#define inst_newa_len data.op[0].src
+#define inst_newa_class data.op[1].klass
+
+#define inst_var data.op[0].var
+#define inst_vtype data.op[1].vtype
+/* in branch instructions */
+#define inst_many_bb data.op[1].many_blocks
+#define inst_target_bb data.op[0].target_block
+#define inst_true_bb data.op[1].many_blocks[0]
+#define inst_false_bb data.op[1].many_blocks[1]
+
+#define inst_basereg sreg1
+#define inst_indexreg sreg2
+#define inst_destbasereg dreg
+#define inst_offset data.op[0].const_val
+#define inst_imm data.op[1].const_val
+
+#define inst_phi_args data.op[1].phi_args
+
+/* instruction description for use in regalloc/scheduling */
+enum {
+ MONO_INST_DEST,
+ MONO_INST_SRC1,
+ MONO_INST_SRC2,
+ MONO_INST_FLAGS,
+ MONO_INST_CLOB,
+ MONO_INST_COST,
+ MONO_INST_DELAY,
+ MONO_INST_RES,
+ MONO_INST_LEN,
+ MONO_INST_MAX
+};
+
+typedef union {
+ struct {
+ guint16 tid; /* tree number */
+ guint16 bid; /* block number */
+ } pos ;
+ guint32 abs_pos;
+} MonoPosition;
+
+typedef struct {
+ MonoPosition first_use, last_use;
+} MonoLiveRange;
+
+/*
+ * Additional information about a variable
+ */
+struct MonoMethodVar {
+ guint idx; /* inside cfg->varinfo, cfg->vars */
+ guint last_name;
+ MonoBitSet *dfrontier;
+ MonoLiveRange range; /* generated by liveness analysis */
+ int reg; /* != -1 if allocated into a register */
+ int spill_costs;
+ MonoBitSet *def_in; /* used by SSA */
+ MonoInst *def; /* used by SSA */
+ MonoBasicBlock *def_bb; /* used by SSA */
+ GList *uses; /* used by SSA */
+ char cpstate; /* used by SSA conditional constant propagation */
+};
+
+typedef struct {
+ gpointer end_of_stack;
+ guint32 stack_size;
+ MonoLMF *lmf;
+ MonoLMF *first_lmf;
+ gpointer signal_stack;
+ guint32 signal_stack_size;
+ void (*abort_func) (MonoObject *object);
+} MonoJitTlsData;
+
+typedef enum {
+ MONO_PATCH_INFO_BB,
+ MONO_PATCH_INFO_ABS,
+ MONO_PATCH_INFO_LABEL,
+ MONO_PATCH_INFO_METHOD,
+ MONO_PATCH_INFO_METHOD_JUMP,
+ MONO_PATCH_INFO_METHOD_REL,
+ MONO_PATCH_INFO_METHODCONST,
+ MONO_PATCH_INFO_INTERNAL_METHOD,
+ MONO_PATCH_INFO_SWITCH,
+ MONO_PATCH_INFO_EXC,
+ MONO_PATCH_INFO_EXC_NAME,
+ MONO_PATCH_INFO_CLASS,
+ MONO_PATCH_INFO_IMAGE,
+ MONO_PATCH_INFO_FIELD,
+ MONO_PATCH_INFO_VTABLE,
+ MONO_PATCH_INFO_CLASS_INIT,
+ MONO_PATCH_INFO_SFLDA,
+ MONO_PATCH_INFO_LDSTR,
+ MONO_PATCH_INFO_LDTOKEN,
+ MONO_PATCH_INFO_TYPE_FROM_HANDLE,
+ MONO_PATCH_INFO_R4,
+ MONO_PATCH_INFO_R8,
+ MONO_PATCH_INFO_IP,
+ MONO_PATCH_INFO_IID,
+ MONO_PATCH_INFO_BB_OVF,
+ MONO_PATCH_INFO_EXC_OVF,
+ MONO_PATCH_INFO_WRAPPER
+} MonoJumpInfoType;
+
+/*
+ * We need to store the image which the token refers to along with the token,
+ * since the image might not be the same as the image of the method which
+ * contains the relocation, because of inlining.
+ */
+typedef struct MonoJumpInfoToken {
+ MonoImage *image;
+ guint32 token;
+} MonoJumpInfoToken;
+
+typedef struct MonoJumpInfo MonoJumpInfo;
+struct MonoJumpInfo {
+ MonoJumpInfo *next;
+ union {
+ int i;
+ guint8 *p;
+ MonoInst *label;
+ } ip;
+
+ MonoJumpInfoType type;
+ union {
+ gconstpointer target;
+#if SIZEOF_VOID_P == 8
+ gint64 offset;
+#else
+ int offset;
+#endif
+ MonoBasicBlock *bb;
+ MonoBasicBlock **table;
+ MonoInst *inst;
+ MonoMethod *method;
+ MonoClass *klass;
+ MonoClassField *field;
+ MonoImage *image;
+ MonoVTable *vtable;
+ const char *name;
+ MonoJumpInfoToken *token;
+ } data;
+
+ int table_size; /* use by switch */
+};
+
+/* optimization flags: keep up to date with the name array in driver.c */
+enum {
+ MONO_OPT_PEEPHOLE = 1 << 0,
+ MONO_OPT_BRANCH = 1 << 1,
+ MONO_OPT_INLINE = 1 << 2,
+ MONO_OPT_CFOLD = 1 << 3,
+ MONO_OPT_CONSPROP = 1 << 4,
+ MONO_OPT_COPYPROP = 1 << 5,
+ MONO_OPT_DEADCE = 1 << 6,
+ MONO_OPT_LINEARS = 1 << 7,
+ MONO_OPT_CMOV = 1 << 8,
+ MONO_OPT_SHARED = 1 << 9,
+ MONO_OPT_SCHED = 1 << 10,
+ MONO_OPT_INTRINS = 1 << 11,
+ MONO_OPT_TAILC = 1 << 12,
+ MONO_OPT_LOOP = 1 << 13,
+ MONO_OPT_FCMOV = 1 << 14,
+ MONO_OPT_LEAF = 1 << 15,
+ MONO_OPT_AOT = 1 << 16,
+ MONO_OPT_PRECOMP = 1 << 17,
+ MONO_OPT_ABCREM = 1 << 18
+};
+
+/* Bit-fields in the MonoBasicBlock.region */
+#define MONO_REGION_FINALLY 16
+#define MONO_REGION_CATCH 32
+#define MONO_REGION_FAULT 64 /* Currently unused */
+#define MONO_REGION_FILTER 128
+
+/*
+ * Control Flow Graph and compilation unit information
+ */
+typedef struct {
+ MonoMethod *method;
+ MonoMemPool *mempool;
+ MonoInst **varinfo;
+ MonoMethodVar **vars;
+ MonoInst *ret;
+ MonoBasicBlock *bb_entry;
+ MonoBasicBlock *bb_exit;
+ MonoBasicBlock *bb_init;
+ MonoBasicBlock **bblocks;
+ GHashTable *bb_hash;
+ MonoMemPool *state_pool; /* used by instruction selection */
+ MonoBasicBlock *cbb; /* used by instruction selection */
+ MonoInst *prev_ins; /* in decompose */
+ MonoJumpInfo *patch_info;
+ MonoJitInfo *jit_info;
+ guint num_bblocks;
+ guint locals_start;
+ guint num_varinfo; /* used items in varinfo */
+ guint varinfo_count; /* total storage in varinfo */
+ gint stack_offset;
+ gint max_ireg;
+ MonoRegState *rs;
+ MonoSpillInfo *spill_info; /* machine register spills */
+ MonoSpillInfo *spill_info_float; /* fp register spills */
+ gint spill_count;
+ /* unsigned char *cil_code; */
+ MonoMethod *inlined_method; /* the method which is currently inlined */
+
+ /* the exception object passed to catch/filter blocks */
+ MonoInst *exvar;
+
+ MonoInst *domainvar; /* a cache for the current domain */
+
+ /* A hashtable of region ID-> SP var mappings */
+ /* An SP var is a place to store the stack pointer (used by handlers)*/
+ GHashTable *spvars;
+
+ GList *ldstr_list; /* used by AOT */
+
+ MonoDomain *domain;
+
+ unsigned char *native_code;
+ guint code_size;
+ guint code_len;
+ guint prolog_end;
+ guint epilog_begin;
+ regmask_t used_int_regs;
+ guint32 opt;
+ guint32 prof_options;
+ guint32 flags;
+ guint32 comp_done;
+ guint32 verbose_level;
+ guint32 stack_usage;
+ guint32 param_area;
+ guint32 frame_reg;
+ gint32 sig_cookie;
+ gboolean disable_aot;
+ gboolean disable_ssa;
+ gboolean run_cctors;
+ gboolean need_lmf_area;
+ gpointer debug_info;
+ guint32 lmf_offset;
+ guint16 *intvars;
+ MonoProfileCoverageInfo *coverage_info;
+ MonoCompileArch arch;
+#ifdef __ia64
+ guint8 ins, locals, outs; /* reg stack region sizes */
+#endif /* __ia64 */
+} MonoCompile;
+
+typedef enum {
+ MONO_CFG_HAS_ALLOCA = 1 << 0,
+ MONO_CFG_HAS_CALLS = 1 << 1,
+ MONO_CFG_HAS_LDELEMA = 1 << 2,
+ MONO_CFG_HAS_VARARGS = 1 << 3,
+ MONO_CFG_HAS_TAIL = 1 << 4
+} MonoCompileFlags;
+
+typedef struct {
+ gulong methods_compiled;
+ gulong methods_aot;
+ gulong methods_lookups;
+ gulong method_trampolines;
+ gulong allocate_var;
+ gulong analyze_stack_repeat;
+ gulong cil_code_size;
+ gulong native_code_size;
+ gulong code_reallocs;
+ gulong max_code_size_ratio;
+ gulong biggest_method_size;
+ gulong allocated_code_size;
+ gulong inlineable_methods;
+ gulong inlined_methods;
+ gulong basic_blocks;
+ gulong max_basic_blocks;
+ MonoMethod *max_ratio_method;
+ MonoMethod *biggest_method;
+ gboolean enabled;
+} MonoJitStats;
+
+extern MonoJitStats mono_jit_stats;
+
+/* values for MonoInst.ssa_op */
+enum {
+ MONO_SSA_NOP,
+ MONO_SSA_LOAD,
+ MONO_SSA_STORE,
+ MONO_SSA_MAYBE_LOAD,
+ MONO_SSA_MAYBE_STORE
+};
+
+#define OP_CEQ (256+CEE_CEQ)
+#define OP_CLT (256+CEE_CLT)
+#define OP_CLT_UN (256+CEE_CLT_UN)
+#define OP_CGT (256+CEE_CGT)
+#define OP_CGT_UN (256+CEE_CGT_UN)
+#define OP_LOCALLOC (256+CEE_LOCALLOC)
+
+/* opcodes: value assigned after all the CIL opcodes */
+#ifdef MINI_OP
+#undef MINI_OP
+#endif
+#define MINI_OP(a,b) a,
+enum {
+ OP_START = MONO_CEE_LAST,
+#include "mini-ops.h"
+ OP_LAST
+};
+#undef MINI_OP
+
+#if SIZEOF_VOID_P == 8
+#define OP_PADD OP_LADD
+#define OP_PNEG OP_LNEG
+#define OP_PCONV_TO_U2 OP_LCONV_TO_U2
+#define OP_PCONV_TO_OVF_I1_UN OP_LCONV_TO_OVF_I1_UN
+#define OP_PCONV_TO_OVF_I1 OP_LCONV_TO_OVF_I1
+#define OP_PCEQ CEE_CEQ
+#define OP_STOREP_MEMBASE_REG OP_STOREI8_MEMBASE_REG
+#define OP_STOREP_MEMBASE_IMM OP_STOREI8_MEMBASE_IMM
+#else
+#define OP_PADD CEE_ADD
+#define OP_PNEG CEE_NEG
+#define OP_PCONV_TO_U2 CEE_CONV_U2
+#define OP_PCONV_TO_OVF_I1_UN CEE_CONV_OVF_I1_UN
+#define OP_PCONV_TO_OVF_I1 CEE_CONV_OVF_I1
+#define OP_PCEQ CEE_CEQ
+#define OP_STOREP_MEMBASE_REG OP_STOREI4_MEMBASE_REG
+#define OP_STOREP_MEMBASE_IMM OP_STOREI4_MEMBASE_IMM
+#endif
+
+typedef enum {
+ STACK_INV,
+ STACK_I4,
+ STACK_I8,
+ STACK_PTR,
+ STACK_R8,
+ STACK_MP,
+ STACK_OBJ,
+ STACK_VTYPE,
+ STACK_MAX
+} MonoStackType;
+
+typedef struct {
+ union {
+ double r8;
+ gint32 i4;
+ gint64 i8;
+ gpointer p;
+ MonoClass *klass;
+ } data;
+ int type;
+} StackSlot;
+
+enum {
+ MONO_COMP_DOM = 1,
+ MONO_COMP_IDOM = 2,
+ MONO_COMP_DFRONTIER = 4,
+ MONO_COMP_DOM_REV = 8,
+ MONO_COMP_LIVENESS = 16,
+ MONO_COMP_SSA = 32,
+ MONO_COMP_SSA_DEF_USE = 64,
+ MONO_COMP_REACHABILITY = 128,
+ MONO_COMP_LOOPS = 256
+};
+
+typedef enum {
+ MONO_GRAPH_CFG = 1,
+ MONO_GRAPH_DTREE = 2,
+ MONO_GRAPH_CFG_CODE = 4,
+ MONO_GRAPH_CFG_SSA = 8,
+ MONO_GRAPH_CFG_OPTCODE = 16
+} MonoGraphOptions;
+
+typedef struct {
+ guint16 size;
+ guint16 offset;
+ guint8 pad;
+} MonoJitArgumentInfo;
+
+typedef struct {
+ MonoJitInfo *ji;
+ MonoCodeManager *code_mp;
+} MonoJitDynamicMethodInfo;
+
+typedef void (*MonoInstFunc) (MonoInst *tree, gpointer data);
+
+/* main function */
+int mono_main (int argc, char* argv[]);
+void mono_set_defaults (int verbose_level, guint32 opts);
+MonoDomain* mini_init (const char *filename);
+void mini_cleanup (MonoDomain *domain);
+
+/* helper methods */
+MonoJumpInfoToken * mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token);
+MonoInst* mono_find_spvar_for_region (MonoCompile *cfg, int region);
+void mono_precompile_assemblies (void);
+int mono_parse_default_optimizations (const char* p);
+void mono_bblock_add_inst (MonoBasicBlock *bb, MonoInst *inst);
+void mono_constant_fold (MonoCompile *cfg);
+void mono_constant_fold_inst (MonoInst *inst, gpointer data);
+int mono_is_power_of_two (guint32 val);
+void mono_cprop_local (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **acp, int acp_size);
+MonoInst* mono_compile_create_var (MonoCompile *cfg, MonoType *type, int opcode);
+void mono_blockset_print (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom);
+void mono_print_tree (MonoInst *tree);
+void mono_print_tree_nl (MonoInst *tree);
+void mono_print_code (MonoCompile *cfg);
+void mono_print_method_from_ip (void *ip);
+void mono_select_instructions (MonoCompile *cfg);
+const char* mono_inst_name (int op);
+void mono_inst_foreach (MonoInst *tree, MonoInstFunc func, gpointer data);
+void mono_disassemble_code (guint8 *code, int size, char *id);
+guint mono_type_to_ldind (MonoType *t);
+guint mono_type_to_stind (MonoType *t);
+void mono_add_patch_info (MonoCompile *cfg, int ip, MonoJumpInfoType type, gconstpointer target);
+void mono_remove_patch_info (MonoCompile *cfg, int ip);
+gpointer mono_resolve_patch_target (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors);
+MonoLMF** mono_get_lmf_addr (void);
+GList *mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, gboolean sort_end);
+GList *mono_varlist_sort (MonoCompile *cfg, GList *list, int sort_type);
+void mono_analyze_liveness (MonoCompile *cfg);
+void mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_mask);
+void mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
+int mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options);
+MonoCompile *mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gboolean run_cctors, int parts);
+void mono_destroy_compile (MonoCompile *cfg);
+void mono_aot_init (void);
+MonoJitInfo* mono_aot_get_method (MonoDomain *domain,
+ MonoMethod *method);
+gboolean mono_method_blittable (MonoMethod *method);
+gboolean mono_method_same_domain (MonoJitInfo *caller, MonoJitInfo *callee);
+void mono_register_opcode_emulation (int opcode, const char* name, MonoMethodSignature *sig, gpointer func, gboolean no_throw);
+void mono_arch_register_lowlevel_calls (void);
+void mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options);
+void mono_add_varcopy_to_end (MonoCompile *cfg, MonoBasicBlock *bb, int src, int dest);
+
+int mono_find_method_opcode (MonoMethod *method);
+MonoJitICallInfo *mono_find_jit_icall_by_name (const char *name);
+MonoJitICallInfo *mono_find_jit_icall_by_addr (gconstpointer addr);
+MonoJitICallInfo *mono_register_jit_icall (gconstpointer func, const char *name, MonoMethodSignature *sig, gboolean is_save);
+gconstpointer mono_icall_get_wrapper (MonoJitICallInfo* callinfo);
+
+gpointer mono_create_jump_trampoline (MonoDomain *domain,
+ MonoMethod *method,
+ gboolean add_sync_wrapper);
+gpointer mono_create_class_init_trampoline (MonoVTable *vtable);
+gpointer mono_create_jit_trampoline (MonoMethod *method);
+MonoVTable* mono_find_class_init_trampoline_by_addr (gconstpointer addr);
+gboolean mono_running_on_valgrind (void);
+
+/* methods that must be provided by the arch-specific port */
+void mono_arch_cpu_init (void);
+guint32 mono_arch_cpu_optimizazions (guint32 *exclude_mask);
+void mono_arch_instrument_mem_needs (MonoMethod *method, int *stack, int *code);
+void *mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments);
+void *mono_arch_instrument_epilog (MonoCompile *cfg, void *func, void *p, gboolean enable_arguments);
+MonoCallInst *mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb, MonoCallInst *call, int is_virtual);
+gint mono_arch_get_opcode_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args);
+void mono_codegen (MonoCompile *cfg);
+const char *mono_arch_regname (int reg);
+gpointer mono_arch_get_throw_exception (void);
+gpointer mono_arch_get_rethrow_exception (void);
+gpointer mono_arch_get_throw_exception_by_name (void);
+gpointer mono_arch_create_jit_trampoline (MonoMethod *method);
+MonoJitInfo *mono_arch_create_jump_trampoline (MonoMethod *method);
+gpointer mono_arch_create_class_init_trampoline(MonoVTable *vtable);
+GList *mono_arch_get_allocatable_int_vars (MonoCompile *cfg);
+GList *mono_arch_get_global_int_regs (MonoCompile *cfg);
+guint32 mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv);
+void mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors);
+void mono_arch_flush_icache (guint8 *code, gint size);
+int mono_arch_max_epilog_size (MonoCompile *cfg);
+guint8 *mono_arch_emit_prolog (MonoCompile *cfg);
+void mono_arch_emit_epilog (MonoCompile *cfg);
+void mono_arch_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb);
+void mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb);
+gboolean mono_arch_has_unwind_info (gconstpointer addr);
+void mono_arch_setup_jit_tls_data (MonoJitTlsData *tls);
+void mono_arch_free_jit_tls_data (MonoJitTlsData *tls);
+void mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg);
+void mono_arch_allocate_vars (MonoCompile *m);
+int mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJitArgumentInfo *arg_info);
+gboolean mono_arch_print_tree (MonoInst *tree, int arity);
+MonoJitInfo *mono_arch_find_jit_info (MonoDomain *domain,
+ MonoJitTlsData *jit_tls,
+ MonoJitInfo *res,
+ MonoJitInfo *prev_ji,
+ MonoContext *ctx,
+ MonoContext *new_ctx,
+ char **trace,
+ MonoLMF **lmf,
+ int *native_offset,
+ gboolean *managed);
+gpointer mono_arch_get_call_filter (void);
+gpointer mono_arch_get_restore_context (void);
+gboolean mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only);
+gpointer mono_arch_ip_from_context (void *sigctx);
+void mono_arch_flush_register_windows (void);
+gboolean mono_arch_is_inst_imm (gint64 imm);
+MonoInst* mono_arch_get_domain_intrinsic (MonoCompile* cfg);
+MonoInst* mono_arch_get_thread_intrinsic (MonoCompile* cfg);
+gboolean mono_arch_is_int_overflow (void *sigctx);
+void mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg);
+
+/* Exception handling */
+gboolean mono_handle_exception (MonoContext *ctx, gpointer obj,
+ gpointer original_ip, gboolean test_only);
+void mono_jit_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data);
+MonoArray *ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info);
+MonoBoolean ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
+ MonoReflectionMethod **method,
+ gint32 *iloffset, gint32 *native_offset,
+ MonoString **file, gint32 *line, gint32 *column);
+
+/* Dominator/SSA methods */
+void mono_compile_dominator_info (MonoCompile *cfg, int dom_flags);
+void mono_compute_natural_loops (MonoCompile *cfg);
+MonoBitSet* mono_compile_iterated_dfrontier (MonoCompile *cfg, MonoBitSet *set);
+void mono_ssa_compute (MonoCompile *cfg);
+void mono_ssa_remove (MonoCompile *cfg);
+void mono_ssa_cprop (MonoCompile *cfg);
+void mono_ssa_deadce (MonoCompile *cfg);
+void mono_ssa_strength_reduction (MonoCompile *cfg);
+void mono_free_loop_info (MonoCompile *cfg);
+
+/* debugging support */
+void mono_debug_init_method (MonoCompile *cfg, MonoBasicBlock *start_block,
+ guint32 breakpoint_id);
+void mono_debug_open_method (MonoCompile *cfg);
+void mono_debug_close_method (MonoCompile *cfg);
+void mono_debug_open_block (MonoCompile *cfg, MonoBasicBlock *bb, guint32 address);
+void mono_debug_record_line_number (MonoCompile *cfg, MonoInst *ins, guint32 address);
+void mono_debug_serialize_debug_info (MonoCompile *cfg, guint8 **out_buf, guint32 *buf_len);
+void mono_debug_add_aot_method (MonoDomain *domain,
+ MonoMethod *method, guint8 *code_start,
+ guint8 *debug_info, guint32 debug_info_len);
+void mono_debug_add_icall_wrapper (MonoMethod *method, MonoJitICallInfo* info);
+
+
+/* Tracing */
+MonoTraceSpec *mono_trace_parse_options (char *options);
+void mono_trace_set_assembly (MonoAssembly *assembly);
+gboolean mono_trace_eval (MonoMethod *method);
+
+extern void
+mono_perform_abc_removal (MonoCompile *cfg);
+
+#endif /* __MONO_MINI_H__ */
diff --git a/mono/mini/mini.prj b/mono/mini/mini.prj
new file mode 100644
index 00000000000..b9bd7c25f61
--- /dev/null
+++ b/mono/mini/mini.prj
@@ -0,0 +1,28 @@
+;; -*- 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)
diff --git a/mono/mini/objects.cs b/mono/mini/objects.cs
new file mode 100644
index 00000000000..a16e88d541c
--- /dev/null
+++ b/mono/mini/objects.cs
@@ -0,0 +1,657 @@
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+struct Simple {
+ public int a;
+ public byte b;
+ public short c;
+ public long d;
+}
+
+struct Small {
+ public byte b1;
+ public byte b2;
+}
+
+class Sample {
+ public int a;
+ public Sample (int v) {
+ a = v;
+ }
+}
+
+[StructLayout ( LayoutKind.Explicit )]
+struct StructWithBigOffsets {
+ [ FieldOffset(10000) ] public byte b;
+ [ FieldOffset(11000) ] public short s;
+ [ FieldOffset(12000) ] public uint i;
+ [ FieldOffset(13000) ] public long l;
+ [ FieldOffset(14000) ] public float f;
+ [ FieldOffset(15000) ] public double d;
+}
+
+enum SampleEnum {
+ A,
+ B,
+ C
+}
+
+class Tests {
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static int test_0_return () {
+ Simple s;
+ s.a = 1;
+ s.b = 2;
+ s.c = (short)(s.a + s.b);
+ s.d = 4;
+ return s.a - 1;
+ }
+
+ static int test_0_string_access () {
+ string s = "Hello";
+ if (s [1] != 'e')
+ return 1;
+ return 0;
+ }
+
+ static int test_0_string_virtual_call () {
+ string s = "Hello";
+ string s2 = s.ToString ();
+ if (s2 [1] != 'e')
+ return 1;
+ return 0;
+ }
+
+ static int test_0_iface_call () {
+ string s = "Hello";
+ object o = ((ICloneable)s).Clone ();
+ return 0;
+ }
+
+ static int test_5_newobj () {
+ Sample s = new Sample (5);
+ return s.a;
+ }
+
+ static int test_4_box () {
+ object obj = 4;
+ return (int)obj;
+ }
+
+ static int test_0_enum_unbox () {
+ SampleEnum x = SampleEnum.A;
+ object o = x;
+
+ int res = 1;
+
+ res = (int)o;
+
+ return res;
+ }
+
+ static Simple get_simple (int v) {
+ Simple r = new Simple ();
+ r.a = v;
+ r.b = (byte)(v + 1);
+ r.c = (short)(v + 2);
+ r.d = v + 3;
+
+ return r;
+ }
+
+ static int test_3_return_struct () {
+ Simple v = get_simple (1);
+
+ if (v.a != 1)
+ return 0;
+ if (v.b != 2)
+ return 0;
+ if (v.c != 3)
+ return 0;
+ if (v.d != 4)
+ return 0;
+ return 3;
+ }
+
+ public virtual Simple v_get_simple (int v)
+ {
+ return get_simple (v);
+ }
+
+ static int test_2_return_struct_virtual () {
+ Tests t = new Tests ();
+ Simple v = t.v_get_simple (2);
+
+ if (v.a != 2)
+ return 0;
+ if (v.b != 3)
+ return 0;
+ if (v.c != 4)
+ return 0;
+ if (v.d != 5)
+ return 0;
+ return 2;
+ }
+
+ static int receive_simple (int a, Simple v, int b) {
+ if (v.a != 1)
+ return 1;
+ if (v.b != 2)
+ return 2;
+ if (v.c != 3)
+ return 3;
+ if (v.d != 4)
+ return 4;
+ if (a != 7)
+ return 5;
+ if (b != 9)
+ return 6;
+ return 0;
+ }
+
+ static int test_5_pass_struct () {
+ Simple v = get_simple (1);
+ if (receive_simple (7, v, 9) != 0)
+ return 0;
+ if (receive_simple (7, get_simple (1), 9) != 0)
+ return 1;
+ return 5;
+ }
+
+ // Test alignment of small structs
+
+ static Small get_small (byte v) {
+ Small r = new Small ();
+
+ r.b1 = v;
+ r.b2 = (byte)(v + 1);
+
+ return r;
+ }
+
+ static Small return_small (Small s) {
+ return s;
+ }
+
+ static int receive_small (int a, Small v, int b) {
+ if (v.b1 != 1)
+ return 1;
+ if (v.b2 != 2)
+ return 2;
+ return 0;
+ }
+
+ static int test_5_pass_small_struct () {
+ Small v = get_small (1);
+ if (receive_small (7, v, 9) != 0)
+ return 0;
+ if (receive_small (7, get_small (1), 9) != 0)
+ return 1;
+ v = return_small (v);
+ if (v.b1 != 1)
+ return 2;
+ if (v.b2 != 2)
+ return 3;
+ return 5;
+ }
+
+ struct AStruct {
+ public int i;
+
+ public AStruct (int i) {
+ this.i = i;
+ }
+
+ public override int GetHashCode () {
+ return i;
+ }
+ }
+
+ // Test that vtypes are unboxed during a virtual call
+ static int test_44_unbox_trampoline () {
+ AStruct s = new AStruct (44);
+ object o = s;
+ return o.GetHashCode ();
+ }
+
+ static int test_0_unbox_trampoline2 () {
+ int i = 12;
+ object o = i;
+
+ if (i.ToString () != "12")
+ return 1;
+ if (((Int32)o).ToString () != "12")
+ return 2;
+ if (o.ToString () != "12")
+ return 3;
+ return 0;
+ }
+
+ // Test fields with big offsets
+ static int test_0_fields_with_big_offsets () {
+ StructWithBigOffsets s = new StructWithBigOffsets ();
+ StructWithBigOffsets s2 = new StructWithBigOffsets ();
+
+ s.b = 0xde;
+ s.s = 0x12de;
+ s.i = 0xdeadbeef;
+ s.l = 0xcafebabe;
+ s.f = 3.14F;
+ s.d = 3.14;
+
+ s2.b = s.b;
+ s2.s = s.s;
+ s2.i = s.i;
+ s2.l = s.l;
+ s2.f = s.f;
+ s2.d = s.d;
+
+ if (s2.b != 0xde)
+ return 1;
+ if (s2.s != 0x12de)
+ return 2;
+ if (s2.i != 0xdeadbeef)
+ return 3;
+ if (s2.l != 0xcafebabe)
+ return 4;
+ if (s2.f != 3.14F)
+ return 5;
+ if (s2.d != 3.14)
+ return 6;
+
+ return 0;
+ }
+
+ class TestRegA {
+
+ long buf_start;
+ int buf_length, buf_offset;
+
+ public TestRegA () {
+ buf_start = 0;
+ buf_length = 0;
+ buf_offset = 0;
+ }
+
+ public long Seek (long position) {
+ long pos = position;
+ /* interaction between the register allocator and
+ * allocating arguments to registers */
+ if (pos >= buf_start && pos <= buf_start + buf_length) {
+ buf_offset = (int) (pos - buf_start);
+ return pos;
+ }
+ return buf_start;
+ }
+
+ }
+
+ static int test_0_seektest () {
+ TestRegA t = new TestRegA ();
+ return (int)t.Seek (0);
+ }
+
+ class Super : ICloneable {
+ public virtual object Clone () {
+ return null;
+ }
+ }
+ class Duper: Super {
+ }
+
+ static int test_0_super_cast () {
+ Duper d = new Duper ();
+ Super sup = d;
+ Object o = d;
+
+ if (!(o is Super))
+ return 1;
+ try {
+ d = (Duper)sup;
+ } catch {
+ return 2;
+ }
+ if (!(d is Object))
+ return 3;
+ try {
+ d = (Duper)(object)sup;
+ } catch {
+ return 4;
+ }
+ return 0;
+ }
+
+ static int test_0_super_cast_array () {
+ Duper[] d = new Duper [0];
+ Super[] sup = d;
+ Object[] o = d;
+
+ if (!(o is Super[]))
+ return 1;
+ try {
+ d = (Duper[])sup;
+ } catch {
+ return 2;
+ }
+ if (!(d is Object[]))
+ return 3;
+ try {
+ d = (Duper[])(object[])sup;
+ } catch {
+ return 4;
+ }
+ return 0;
+ }
+
+ static int test_0_multi_array_cast () {
+ Duper[,] d = new Duper [1, 1];
+ object[,] o = d;
+
+ try {
+ o [0, 0] = new Super ();
+ return 1;
+ }
+ catch (ArrayTypeMismatchException) {
+ }
+
+ return 0;
+ }
+
+ static int test_0_vector_array_cast () {
+ Array arr1 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {0});
+ Array arr2 = Array.CreateInstance (typeof (int), new int[] {1}, new int[] {10});
+
+ if (arr1.GetType () != typeof (int[]))
+ return 1;
+
+ if (arr2.GetType () == typeof (int[]))
+ return 2;
+
+ int[] b;
+
+ b = (int[])arr1;
+
+ try {
+ b = (int[])arr2;
+ return 3;
+ }
+ catch (InvalidCastException) {
+ }
+
+ if (arr2 is int[])
+ return 4;
+
+ return 0;
+ }
+
+ static int test_0_enum_array_cast () {
+ TypeCode[] tc = new TypeCode [0];
+ object[] oa;
+ ValueType[] vta;
+ int[] inta;
+ Array a = tc;
+ bool ok;
+
+ if (a is object[])
+ return 1;
+ if (a is ValueType[])
+ return 2;
+ if (a is Enum[])
+ return 3;
+ try {
+ ok = false;
+ oa = (object[])a;
+ } catch {
+ ok = true;
+ }
+ if (!ok)
+ return 4;
+ try {
+ ok = false;
+ vta = (ValueType[])a;
+ } catch {
+ ok = true;
+ }
+ if (!ok)
+ return 5;
+ try {
+ ok = true;
+ inta = (int[])a;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 6;
+ return 0;
+ }
+
+ static int test_0_more_cast_corner_cases () {
+ ValueType[] vta = new ValueType [0];
+ Enum[] ea = new Enum [0];
+ Array a = vta;
+ object[] oa;
+ bool ok;
+
+ if (!(a is object[]))
+ return 1;
+ if (!(a is ValueType[]))
+ return 2;
+ if (a is Enum[])
+ return 3;
+ a = ea;
+ if (!(a is object[]))
+ return 4;
+ if (!(a is ValueType[]))
+ return 5;
+ if (!(a is Enum[]))
+ return 6;
+
+ try {
+ ok = true;
+ oa = (object[])a;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 7;
+
+ try {
+ ok = true;
+ oa = (Enum[])a;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 8;
+
+ try {
+ ok = true;
+ oa = (ValueType[])a;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 9;
+
+ a = vta;
+ try {
+ ok = true;
+ oa = (object[])a;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 10;
+
+ try {
+ ok = true;
+ oa = (ValueType[])a;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 11;
+
+ try {
+ ok = false;
+ vta = (Enum[])a;
+ } catch {
+ ok = true;
+ }
+ if (!ok)
+ return 12;
+ return 0;
+ }
+
+ static int test_0_cast_iface_array () {
+ object o = new ICloneable [0];
+ object o2 = new Duper [0];
+ object t;
+ bool ok;
+
+ if (!(o is object[]))
+ return 1;
+ if (!(o2 is ICloneable[]))
+ return 2;
+
+ try {
+ ok = true;
+ t = (object[])o;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 3;
+
+ try {
+ ok = true;
+ t = (ICloneable[])o2;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 4;
+
+ try {
+ ok = true;
+ t = (ICloneable[])o;
+ } catch {
+ ok = false;
+ }
+ if (!ok)
+ return 5;
+
+ if (!(o is ICloneable[]))
+ return 6;
+
+ /* add tests for interfaces that 'inherit' interfaces */
+ return 0;
+ }
+
+ private static int[] daysmonthleap = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+ private static int AbsoluteDays (int year, int month, int day)
+ {
+ int temp = 0, m = 1;
+ int[] days = daysmonthleap;
+ while (m < month)
+ temp += days[m++];
+ return ((day-1) + temp + (365* (year-1)) + ((year-1)/4) - ((year-1)/100) + ((year-1)/400));
+ }
+
+ static int test_719162_complex_div () {
+ int adays = AbsoluteDays (1970, 1, 1);
+ return adays;
+ }
+
+ delegate int GetIntDel ();
+
+ static int return4 () {
+ return 4;
+ }
+
+ int return5 () {
+ return 5;
+ }
+
+ static int test_2_static_delegate () {
+ GetIntDel del = new GetIntDel (return4);
+ int v = del ();
+ if (v != 4)
+ return 0;
+ return 2;
+ }
+
+ static int test_2_instance_delegate () {
+ Tests t = new Tests ();
+ GetIntDel del = new GetIntDel (t.return5);
+ int v = del ();
+ if (v != 5)
+ return 0;
+ return 2;
+ }
+
+ static int test_1_store_decimal () {
+ decimal[,] a = {{1}};
+
+ if (a[0,0] != 1m)
+ return 0;
+ return 1;
+ }
+
+ static int test_2_intptr_stobj () {
+ System.IntPtr [] arr = { new System.IntPtr () };
+
+ if (arr [0] != (System.IntPtr)0)
+ return 1;
+ return 2;
+ }
+
+ static int llmult (int a, int b, int c, int d) {
+ return a + b + c + d;
+ }
+
+ /*
+ * Test that evaluation of complex arguments does not overwrite the
+ * arguments already in outgoing registers.
+ */
+ static int test_155_regalloc () {
+ int a = 10;
+ int b = 10;
+
+ int c = 0;
+ int d = 0;
+ int[] arr = new int [5];
+
+ return llmult (arr [c + d], 150, 5, 0);
+ }
+
+}
+
diff --git a/mono/mini/regalloc.c b/mono/mini/regalloc.c
new file mode 100644
index 00000000000..708af1db437
--- /dev/null
+++ b/mono/mini/regalloc.c
@@ -0,0 +1,113 @@
+/*
+ * regalloc.c: register state class
+ *
+ * Authors:
+ * Paolo Molaro (lupus@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include "mini.h"
+
+MonoRegState*
+mono_regstate_new (void)
+{
+ MonoRegState* rs = g_new0 (MonoRegState, 1);
+
+ mono_regstate_reset (rs);
+
+ return rs;
+}
+
+void
+mono_regstate_free (MonoRegState *rs) {
+ g_free (rs->iassign);
+ g_free (rs->fassign);
+ g_free (rs);
+}
+
+void
+mono_regstate_reset (MonoRegState *rs) {
+ rs->next_vireg = MONO_MAX_IREGS;
+ rs->next_vfreg = MONO_MAX_FREGS;
+}
+
+void
+mono_regstate_assign (MonoRegState *rs) {
+ int i;
+ rs->max_ireg = -1;
+ g_free (rs->iassign);
+ rs->iassign = g_malloc (MAX (MONO_MAX_IREGS, rs->next_vireg) * sizeof (int));
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ rs->iassign [i] = i;
+ rs->isymbolic [i] = 0;
+ }
+ for (; i < rs->next_vireg; ++i)
+ rs->iassign [i] = -1;
+
+ g_free (rs->fassign);
+ rs->fassign = g_malloc (MAX (MONO_MAX_FREGS, rs->next_vfreg) * sizeof (int));
+ for (i = 0; i < MONO_MAX_FREGS; ++i) {
+ rs->fassign [i] = i;
+ rs->fsymbolic [i] = 0;
+ }
+ for (; i < rs->next_vfreg; ++i)
+ rs->fassign [i] = -1;
+}
+
+int
+mono_regstate_alloc_int (MonoRegState *rs, regmask_t allow)
+{
+ int i;
+ regmask_t mask = allow & rs->ifree_mask;
+ for (i = 0; i < MONO_MAX_IREGS; ++i) {
+ if (mask & (1 << i)) {
+ rs->ifree_mask &= ~ (1 << i);
+ rs->max_ireg = MAX (rs->max_ireg, i);
+ return i;
+ }
+ }
+ return -1;
+}
+
+void
+mono_regstate_free_int (MonoRegState *rs, int reg)
+{
+ if (reg >= 0) {
+ rs->ifree_mask |= 1 << reg;
+ rs->isymbolic [reg] = 0;
+ }
+}
+
+int
+mono_regstate_alloc_float (MonoRegState *rs, regmask_t allow)
+{
+ int i;
+ regmask_t mask = allow & rs->ffree_mask;
+ for (i = 0; i < MONO_MAX_FREGS; ++i) {
+ if (mask & (1 << i)) {
+ rs->ffree_mask &= ~ (1 << i);
+ return i;
+ }
+ }
+ return -1;
+}
+
+void
+mono_regstate_free_float (MonoRegState *rs, int reg)
+{
+ if (reg >= 0) {
+ rs->ffree_mask |= 1 << reg;
+ rs->fsymbolic [reg] = 0;
+ }
+}
+
+inline int
+mono_regstate_next_long (MonoRegState *rs)
+{
+ int rval = rs->next_vireg;
+
+ rs->next_vireg += 2;
+
+ return rval;
+}
+
diff --git a/mono/mini/regalloc.h b/mono/mini/regalloc.h
new file mode 100644
index 00000000000..7147db5b57e
--- /dev/null
+++ b/mono/mini/regalloc.h
@@ -0,0 +1,59 @@
+
+typedef size_t regmask_t;
+
+enum {
+ MONO_REG_FREE,
+ MONO_REG_FREEABLE,
+ MONO_REG_MOVEABLE,
+ MONO_REG_BUSY,
+ MONO_REG_RESERVED
+};
+
+enum {
+ MONO_REG_INT,
+ MONO_REG_DOUBLE
+};
+
+typedef struct {
+ /* symbolic registers */
+ int next_vireg;
+ int next_vfreg;
+
+ /* hard registers */
+ int num_iregs;
+ int num_fregs;
+
+ regmask_t ifree_mask;
+ regmask_t ffree_mask;
+
+ /* symbolic -> hard register assignment */
+ /*
+ * If the register is spilled, then this contains -spill - 1, where 'spill'
+ * is the index of the spill variable.
+ */
+ int *iassign;
+ int *fassign;
+
+ /* hard -> symbolic */
+ int isymbolic [MONO_MAX_IREGS];
+ int fsymbolic [MONO_MAX_FREGS];
+
+ int max_ireg;
+ int ispills;
+} MonoRegState;
+
+#define mono_regstate_next_int(rs) ((rs)->next_vireg++)
+#define mono_regstate_next_float(rs) ((rs)->next_vfreg++)
+
+
+MonoRegState* mono_regstate_new (void);
+
+void mono_regstate_free (MonoRegState *rs);
+void mono_regstate_reset (MonoRegState *rs);
+void mono_regstate_assign (MonoRegState *rs);
+int mono_regstate_alloc_int (MonoRegState *rs, regmask_t allow);
+void mono_regstate_free_int (MonoRegState *rs, int reg);
+int mono_regstate_alloc_float (MonoRegState *rs, regmask_t allow);
+void mono_regstate_free_float (MonoRegState *rs, int reg);
+inline int mono_regstate_next_long (MonoRegState *rs);
+
diff --git a/mono/mini/s390-abi.cs b/mono/mini/s390-abi.cs
new file mode 100644
index 00000000000..ec404b10c83
--- /dev/null
+++ b/mono/mini/s390-abi.cs
@@ -0,0 +1,319 @@
+using System;
+using System.Reflection;
+
+/*
+ * Regression tests for the mono JIT.
+ *
+ * Each test needs to be of the form:
+ *
+ * static int test_<result>_<name> ();
+ *
+ * where <result> is an integer (the value that needs to be returned by
+ * the method to make it pass.
+ * <name> is a user-displayed name used to identify the test.
+ *
+ * The tests can be driven in two ways:
+ * *) running the program directly: Main() uses reflection to find and invoke
+ * the test methods (this is useful mostly to check that the tests are correct)
+ * *) with the --regression switch of the jit (this is the preferred way since
+ * all the tests will be run with optimizations on and off)
+ *
+ * The reflection logic could be moved to a .dll since we need at least another
+ * regression test file written in IL code to have better control on how
+ * the IL code looks.
+ */
+
+class Tests {
+
+ public struct TestStruct1
+ {
+ public int a;
+ }
+
+ public struct TestStruct2
+ {
+ public int a;
+ public int b;
+ }
+
+ public struct TestStruct3
+ {
+ public int a;
+ public int b;
+ public int c;
+ }
+
+ static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static void reg_struct(TestStruct1 regStruct)
+ {
+ regStruct.a = 1;
+ }
+
+ static int test_0_regstruct ()
+ {
+ TestStruct1 myStruct;
+ myStruct.a = 1;
+ reg_struct(myStruct);
+ if (myStruct.a == 1)
+ return 0;
+ else
+ return 1;
+ }
+
+ static int reg_struct_ret(TestStruct2 regStruct)
+ {
+ return regStruct.b;
+ }
+
+ static int test_0_reg_return ()
+ {
+ TestStruct2 myStruct;
+ myStruct.a = 0;
+ myStruct.b = 42;
+ if (reg_struct_ret(myStruct) == 42)
+ return 0;
+ return 2;
+ }
+
+ static int spill_regs (int a, int b, int c, int d, int e, int f)
+ {
+ return f;
+ }
+
+ static int test_0_spill_regs ()
+ {
+ if (spill_regs (1, 2, 3, 4, 5, 6) == 6)
+ return 0;
+ else
+ return 3;
+ }
+
+ static TestStruct3 spill_struct (TestStruct3 regStruct)
+ {
+ regStruct.c = 99;
+ return(regStruct);
+ }
+
+ static int spill_struct_void (TestStruct3 regStruct)
+ {
+ if (regStruct.c == 255)
+ return 0;
+ else
+ return 7;
+ }
+
+ static int receive_spill_struct (TestStruct2 regStruct)
+ {
+ if (regStruct.b == 181)
+ return 0;
+ else
+ return 8;
+ }
+
+ static int pass_spill_struct_big (int a, int b, int c, int d, int e, TestStruct3 regStruct)
+ {
+ int retVal;
+ retVal = receive_spill_struct_big(regStruct);
+ return retVal;
+ }
+
+ static int receive_spill_struct_big (TestStruct3 regStruct)
+ {
+ if (regStruct.c == 999)
+ return 0;
+ else
+ return 9;
+ }
+
+ static int receive_struct_spill (int a, int b, int c, int d, int e, TestStruct2 regStruct)
+ {
+ if (regStruct.b == 181)
+ return 0;
+ else
+ return 10;
+ }
+
+ static int receive_struct_spill_big (int a, int b, int c, int d, int e, TestStruct3 regStruct)
+ {
+ if (regStruct.c == 999)
+ return 0;
+ else
+ return 11;
+ }
+
+ static int pass_spill_struct (int a, int b, int c, int d, int e, TestStruct2 regStruct)
+ {
+ int retVal;
+ retVal = receive_spill_struct(regStruct);
+ return retVal;
+ }
+
+ static int pass_struct_spill (TestStruct2 regStruct)
+ {
+ int retVal;
+ retVal = receive_struct_spill(1,2,3,4,5,regStruct);
+ return retVal;
+ }
+
+ static int pass_struct_spill_big(TestStruct3 regStruct)
+ {
+ int retVal;
+ retVal = receive_struct_spill_big(1,2,3,4,5,regStruct);
+ return retVal;
+ }
+
+ static int pass_spill_struct_spill (int a, int b, int c, int d, int e, TestStruct2 regStruct)
+ {
+ int retVal;
+ retVal = receive_struct_spill(a,b,c,d,e,regStruct);
+ return retVal;
+ }
+
+ static int pass_spill_struct_spill_big(int a, int b, int c, int d, int e, TestStruct3 regStruct)
+ {
+ int retVal;
+ retVal = receive_struct_spill_big(a,b,c,d,e,regStruct);
+ return retVal;
+ }
+
+ static int test_0_spill ()
+ {
+ TestStruct3 myStruct;
+ myStruct.a = 64;
+ myStruct.b = 255;
+ myStruct.c = 127;
+ myStruct = spill_struct(myStruct);
+ if (myStruct.c == 99)
+ return 0;
+ return myStruct.c;
+ }
+
+ static int test_0_spill_void ()
+ {
+ TestStruct3 myStruct;
+ myStruct.a = 0;
+ myStruct.b = 127;
+ myStruct.c = 255;
+ return (spill_struct_void(myStruct));
+ }
+
+ static int spill_struct_ret (TestStruct3 regStruct)
+ {
+ return (regStruct.c);
+
+ }
+
+ static int test_0_spill_ret ()
+ {
+ TestStruct3 myStruct;
+ myStruct.a = 0;
+ myStruct.b = 0;
+ myStruct.c = 69;
+ if (spill_struct_ret(myStruct) == 69)
+ return 0;
+ return 5;
+ }
+
+ static TestStruct2 struct_ret(TestStruct2 regStruct)
+ {
+ regStruct.a = -1;
+ regStruct.b = 72;
+ return(regStruct);
+ }
+
+ static int test_0_struct_ret ()
+ {
+ TestStruct2 myStruct;
+ myStruct.a = 99;
+ myStruct.b = 14;
+ myStruct = struct_ret(myStruct);
+ if (myStruct.b == 72)
+ return 0;
+ else
+ return myStruct.b;
+ }
+
+ static float TestSingle (float a, float b, float c)
+ {
+ return b;
+ }
+
+ static int test_0_TestSingle ()
+ {
+ float a = 3F; float b = 4.5F; float c = 900F;
+ if (TestSingle(a, b, c) == b)
+ return 0;
+ else
+ return 6;
+ }
+
+ static int test_0_pass_spill ()
+ {
+ TestStruct2 myStruct;
+ myStruct.a = 32;
+ myStruct.b = 181;
+ return (pass_spill_struct (1, 2, 3, 4, 5, myStruct));
+ }
+
+ static int test_0_pass_spill_big ()
+ {
+ TestStruct3 myStruct;
+ myStruct.a = 32;
+ myStruct.b = 181;
+ myStruct.c = 999;
+ return (pass_spill_struct_big (1, 2, 3, 4, 5, myStruct));
+ }
+
+ static int test_0_pass_struct_spill ()
+ {
+ TestStruct2 myStruct;
+ myStruct.a = 32;
+ myStruct.b = 181;
+ return (pass_struct_spill (myStruct));
+ }
+
+ static int test_0_pass_struct_spill_big ()
+ {
+ TestStruct3 myStruct;
+ myStruct.a = 32;
+ myStruct.b = 181;
+ myStruct.c = 999;
+ return (pass_struct_spill_big (myStruct));
+ }
+
+ static int test_0_pass_spill_struct_spill ()
+ {
+ TestStruct2 myStruct;
+ myStruct.a = 32;
+ myStruct.b = 181;
+ return (pass_spill_struct_spill (1,2,3,4,5,myStruct));
+ }
+
+ static int test_0_pass_spill_struct_spill_big ()
+ {
+ TestStruct3 myStruct;
+ myStruct.a = 32;
+ myStruct.b = 181;
+ myStruct.c = 999;
+ return (pass_spill_struct_spill_big (1,2,3,4,5,myStruct));
+ }
+
+ static long pass_long_odd (int a, long b)
+ {
+ return (b);
+ }
+
+ static int test_0_pass_long_odd ()
+ {
+ int a = 5;
+ long b = 9000;
+ if (pass_long_odd(a,b) == 9000)
+ return 0;
+ else
+ return 9;
+ }
+
+}
diff --git a/mono/mini/ssa.c b/mono/mini/ssa.c
new file mode 100644
index 00000000000..dfb09e65abf
--- /dev/null
+++ b/mono/mini/ssa.c
@@ -0,0 +1,1236 @@
+/*
+ * ssa.c: Static single assign form support for the JIT compiler.
+ *
+ * Author:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+#include <string.h>
+#include <mono/metadata/debug-helpers.h>
+
+#include "mini.h"
+
+extern guint8 mono_burg_arity [];
+
+#define USE_ORIGINAL_VARS
+#define CREATE_PRUNED_SSA
+
+//#define DEBUG_SSA 1
+
+#define NEW_PHI(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_PHI; \
+ (dest)->inst_c0 = (val); \
+ } while (0)
+
+#define NEW_ICONST(cfg,dest,val) do { \
+ (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst)); \
+ (dest)->opcode = OP_ICONST; \
+ (dest)->inst_c0 = (val); \
+ (dest)->type = STACK_I4; \
+ } while (0)
+
+
+static GList*
+g_list_prepend_mempool (GList* l, MonoMemPool* mp, gpointer datum)
+{
+ GList* n = mono_mempool_alloc (mp, sizeof (GList));
+ n->next = l;
+ n->prev = NULL;
+ n->data = datum;
+ return n;
+}
+
+static void
+unlink_target (MonoBasicBlock *bb, MonoBasicBlock *target)
+{
+ int i;
+
+ for (i = 0; i < bb->out_count; i++) {
+ if (bb->out_bb [i] == target) {
+ bb->out_bb [i] = bb->out_bb [--bb->out_count];
+ break;
+ }
+ }
+ for (i = 0; i < target->in_count; i++) {
+ if (target->in_bb [i] == bb) {
+ target->in_bb [i] = target->in_bb [--target->in_count];
+ break;
+
+ }
+ }
+}
+
+static void
+unlink_unused_bblocks (MonoCompile *cfg)
+{
+ int i, j;
+ MonoBasicBlock *bb;
+
+ g_assert (cfg->comp_done & MONO_COMP_REACHABILITY);
+
+ for (bb = cfg->bb_entry; bb && bb->next_bb;) {
+ if (!(bb->next_bb->flags & BB_REACHABLE)) {
+ bb->next_bb = bb->next_bb->next_bb;
+ } else
+ bb = bb->next_bb;
+ }
+
+ for (i = 1; i < cfg->num_bblocks; i++) {
+ bb = cfg->bblocks [i];
+
+ if (!(bb->flags & BB_REACHABLE)) {
+ for (j = 0; j < bb->in_count; j++) {
+ unlink_target (bb->in_bb [j], bb);
+ }
+ for (j = 0; j < bb->out_count; j++) {
+ unlink_target (bb, bb->out_bb [j]);
+ }
+ }
+
+ }
+}
+
+
+
+static void
+replace_usage (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *inst, MonoInst **stack)
+{
+ int arity;
+
+ if (!inst)
+ return;
+
+ arity = mono_burg_arity [inst->opcode];
+
+ if ((inst->ssa_op == MONO_SSA_LOAD || inst->ssa_op == MONO_SSA_MAYBE_LOAD) &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG)) {
+ MonoInst *new_var;
+ int idx = inst->inst_i0->inst_c0;
+
+ if (stack [idx]) {
+ new_var = stack [idx];
+ } else {
+ new_var = cfg->varinfo [idx];
+
+ if ((new_var->opcode != OP_ARG) && (new_var->opcode != OP_LOCAL)) {
+ /* uninitialized variable ? */
+ g_warning ("using uninitialized variables %d in BB%d (%s)", idx, bb->block_num,
+ mono_method_full_name (cfg->method, TRUE));
+ //g_assert_not_reached ();
+ }
+ }
+#ifdef DEBUG_SSA
+ printf ("REPLACE BB%d %d %d\n", bb->block_num, idx, new_var->inst_c0);
+#endif
+ inst->inst_i0 = new_var;
+ } else {
+
+ if (arity) {
+ if (inst->ssa_op != MONO_SSA_STORE)
+ replace_usage (cfg, bb, inst->inst_left, stack);
+ if (arity > 1)
+ replace_usage (cfg, bb, inst->inst_right, stack);
+ }
+ }
+}
+
+static int
+extends_live (MonoInst *inst)
+{
+ int arity;
+
+ if (!inst)
+ return 0;
+
+ arity = mono_burg_arity [inst->opcode];
+
+ if (inst->ssa_op == MONO_SSA_LOAD &&
+ (inst->inst_i0->opcode == OP_LOCAL /*|| inst->inst_i0->opcode == OP_ARG*/)) {
+ return 1;
+ } else {
+ if (arity) {
+ if (inst->ssa_op != MONO_SSA_STORE)
+ if (extends_live (inst->inst_left))
+ return 1;
+ if (arity > 1)
+ if (extends_live (inst->inst_right))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static int
+replace_usage_new (MonoCompile *cfg, MonoInst *inst, int varnum, MonoInst *rep)
+{
+ int arity;
+
+ if (!inst)
+ return 0;
+
+ arity = mono_burg_arity [inst->opcode];
+
+ if ((inst->ssa_op == MONO_SSA_LOAD) &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG) &&
+ inst->inst_i0->inst_c0 == varnum && rep->type == inst->type) {
+ *inst = *rep;
+ return 1;
+ } else {
+ if (arity) {
+ if (inst->ssa_op != MONO_SSA_STORE)
+ if (replace_usage_new (cfg, inst->inst_left, varnum, rep))
+ return 1;
+ if (arity > 1)
+ if (replace_usage_new (cfg, inst->inst_right, varnum, rep))
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static void
+mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, MonoInst **stack)
+{
+ MonoInst *inst, *new_var;
+ int i, j, idx;
+ GList *tmp;
+ MonoInst **new_stack;
+
+#ifdef DEBUG_SSA
+ printf ("RENAME VARS BB%d %s\n", bb->block_num, mono_method_full_name (cfg->method, TRUE));
+#endif
+
+ for (inst = bb->code; inst; inst = inst->next) {
+ if (inst->opcode != OP_PHI)
+ replace_usage (cfg, bb, inst, stack);
+
+ if (inst->ssa_op == MONO_SSA_STORE &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG)) {
+ idx = inst->inst_i0->inst_c0;
+ g_assert (idx < max_vars);
+
+ if (!stack [idx] && bb == cfg->bb_init) {
+ new_var = cfg->varinfo [idx];
+ } else {
+ new_var = mono_compile_create_var (cfg, inst->inst_i0->inst_vtype, inst->inst_i0->opcode);
+ new_var->flags = inst->inst_i0->flags;
+ }
+#ifdef DEBUG_SSA
+ printf ("DEF %d %d\n", idx, new_var->inst_c0);
+#endif
+ inst->inst_i0 = new_var;
+
+#ifdef USE_ORIGINAL_VARS
+ cfg->vars [new_var->inst_c0]->reg = idx;
+#endif
+
+ stack [idx] = new_var;
+ }
+ }
+
+ for (i = 0; i < bb->out_count; i++) {
+ MonoBasicBlock *n = bb->out_bb [i];
+
+ for (j = 0; j < n->in_count; j++)
+ if (n->in_bb [j] == bb)
+ break;
+
+ for (inst = n->code; inst; inst = inst->next) {
+ if (inst->ssa_op == MONO_SSA_STORE && inst->inst_i1->opcode == OP_PHI) {
+ idx = inst->inst_i1->inst_c0;
+ if (stack [idx])
+ new_var = stack [idx];
+ else
+ new_var = cfg->varinfo [idx];
+#ifdef DEBUG_SSA
+ printf ("FOUND PHI %d (%d, %d)\n", idx, j, new_var->inst_c0);
+#endif
+ inst->inst_i1->inst_phi_args [j + 1] = new_var->inst_c0;
+
+ }
+ }
+ }
+
+ if (bb->dominated) {
+ new_stack = g_new (MonoInst*, max_vars);
+ for (tmp = bb->dominated; tmp; tmp = tmp->next) {
+ memcpy (new_stack, stack, sizeof (MonoInst *) * max_vars);
+ mono_ssa_rename_vars (cfg, max_vars, (MonoBasicBlock *)tmp->data, new_stack);
+ }
+ g_free (new_stack);
+ }
+}
+
+void
+mono_ssa_compute (MonoCompile *cfg)
+{
+ int i, idx;
+ MonoBitSet *set;
+ MonoMethodVar *vinfo = g_new0 (MonoMethodVar, cfg->num_varinfo);
+ MonoInst *inst, *store, **stack;
+
+ g_assert (!(cfg->comp_done & MONO_COMP_SSA));
+
+ /* we dont support methods containing exception clauses */
+ g_assert (mono_method_get_header (cfg->method)->num_clauses == 0);
+ g_assert (!cfg->disable_ssa);
+
+ //printf ("COMPUTS SSA %s %d\n", mono_method_full_name (cfg->method, TRUE), cfg->num_varinfo);
+
+#ifdef CREATE_PRUNED_SSA
+ /* we need liveness for pruned SSA */
+ if (!(cfg->comp_done & MONO_COMP_LIVENESS))
+ mono_analyze_liveness (cfg);
+#endif
+
+ mono_compile_dominator_info (cfg, MONO_COMP_DOM | MONO_COMP_IDOM | MONO_COMP_DFRONTIER);
+
+ for (i = 0; i < cfg->num_varinfo; ++i) {
+ vinfo [i].def_in = mono_bitset_new (cfg->num_bblocks, 0);
+ vinfo [i].idx = i;
+ /* implizit reference at start */
+ mono_bitset_set (vinfo [i].def_in, 0);
+ }
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ for (inst = cfg->bblocks [i]->code; inst; inst = inst->next) {
+ if (inst->ssa_op == MONO_SSA_STORE) {
+ idx = inst->inst_i0->inst_c0;
+ g_assert (idx < cfg->num_varinfo);
+ mono_bitset_set (vinfo [idx].def_in, i);
+ }
+ }
+ }
+
+ /* insert phi functions */
+ for (i = 0; i < cfg->num_varinfo; ++i) {
+ set = mono_compile_iterated_dfrontier (cfg, vinfo [i].def_in);
+ vinfo [i].dfrontier = set;
+ mono_bitset_foreach_bit (set, idx, cfg->num_bblocks) {
+ MonoBasicBlock *bb = cfg->bblocks [idx];
+
+ /* fixme: create pruned SSA? we would need liveness information for that */
+
+ if (bb == cfg->bb_exit)
+ continue;
+
+ if ((cfg->comp_done & MONO_COMP_LIVENESS) && !mono_bitset_test_fast (bb->live_in_set, i)) {
+ //printf ("%d is not live in BB%d %s\n", i, bb->block_num, mono_method_full_name (cfg->method, TRUE));
+ continue;
+ }
+
+ NEW_PHI (cfg, inst, i);
+
+ inst->inst_phi_args = mono_mempool_alloc0 (cfg->mempool, sizeof (int) * (cfg->bblocks [idx]->in_count + 1));
+ inst->inst_phi_args [0] = cfg->bblocks [idx]->in_count;
+
+ store = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoInst));
+ if (!cfg->varinfo [i]->inst_vtype->type)
+ g_assert_not_reached ();
+ store->opcode = mono_type_to_stind (cfg->varinfo [i]->inst_vtype);
+ store->ssa_op = MONO_SSA_STORE;
+ store->inst_i0 = cfg->varinfo [i];
+ store->inst_i1 = inst;
+ store->klass = store->inst_i0->klass;
+
+ store->next = bb->code;
+ bb->code = store;
+
+#ifdef DEBUG_SSA
+ printf ("ADD PHI BB%d %s\n", cfg->bblocks [idx]->block_num, mono_method_full_name (cfg->method, TRUE));
+#endif
+ }
+ }
+
+ /* free the stuff */
+ for (i = 0; i < cfg->num_varinfo; ++i)
+ mono_bitset_free (vinfo [i].def_in);
+ g_free (vinfo);
+
+
+ stack = alloca (sizeof (MonoInst *) * cfg->num_varinfo);
+
+ for (i = 0; i < cfg->num_varinfo; i++)
+ stack [i] = NULL;
+
+ mono_ssa_rename_vars (cfg, cfg->num_varinfo, cfg->bb_entry, stack);
+
+ cfg->comp_done |= MONO_COMP_SSA;
+}
+
+#ifndef USE_ORIGINAL_VARS
+static GPtrArray *
+mono_ssa_get_allocatable_vars (MonoCompile *cfg)
+{
+ GHashTable *type_hash;
+ GPtrArray *varlist_array = g_ptr_array_new ();
+ int tidx, i;
+
+ g_assert (cfg->comp_done & MONO_COMP_LIVENESS);
+
+ type_hash = g_hash_table_new (NULL, NULL);
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoInst *ins = cfg->varinfo [i];
+ MonoMethodVar *vmv = MONO_VARINFO (cfg, i);
+
+ /* unused vars */
+ if (vmv->range.first_use.abs_pos > vmv->range.last_use.abs_pos)
+ continue;
+
+ if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) ||
+ (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG) || vmv->reg != -1)
+ continue;
+
+ g_assert (ins->inst_vtype);
+ g_assert (vmv->reg == -1);
+ g_assert (i == vmv->idx);
+
+ if (!(tidx = (int)g_hash_table_lookup (type_hash, ins->inst_vtype))) {
+ GList *vars = g_list_append (NULL, vmv);
+ g_ptr_array_add (varlist_array, vars);
+ g_hash_table_insert (type_hash, ins->inst_vtype, (gpointer)varlist_array->len);
+ } else {
+ tidx--;
+ g_ptr_array_index (varlist_array, tidx) =
+ mono_varlist_insert_sorted (cfg, g_ptr_array_index (varlist_array, tidx), vmv, FALSE);
+ }
+ }
+
+ g_hash_table_destroy (type_hash);
+
+ return varlist_array;
+}
+#endif
+
+static void
+mono_ssa_replace_copies (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *inst, char *is_live)
+{
+ int arity;
+
+ if (!inst)
+ return;
+
+ arity = mono_burg_arity [inst->opcode];
+
+ if ((inst->ssa_op == MONO_SSA_LOAD || inst->ssa_op == MONO_SSA_MAYBE_LOAD || inst->ssa_op == MONO_SSA_STORE) &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG)) {
+ MonoInst *new_var;
+ int idx = inst->inst_i0->inst_c0;
+ MonoMethodVar *mv = cfg->vars [idx];
+
+ if (mv->reg != -1 && mv->reg != mv->idx) {
+
+ is_live [mv->reg] = 1;
+
+ new_var = cfg->varinfo [mv->reg];
+
+#if 0
+ printf ("REPLACE COPY BB%d %d %d\n", bb->block_num, idx, new_var->inst_c0);
+ g_assert (cfg->varinfo [mv->reg]->inst_vtype == cfg->varinfo [idx]->inst_vtype);
+#endif
+ inst->inst_i0 = new_var;
+ } else {
+ is_live [mv->idx] = 1;
+ }
+ }
+
+
+ if (arity) {
+ mono_ssa_replace_copies (cfg, bb, inst->inst_left, is_live);
+ if (arity > 1)
+ mono_ssa_replace_copies (cfg, bb, inst->inst_right, is_live);
+ }
+
+ if (inst->ssa_op == MONO_SSA_STORE && inst->inst_i1->ssa_op == MONO_SSA_LOAD &&
+ inst->inst_i0->inst_c0 == inst->inst_i1->inst_i0->inst_c0) {
+ inst->ssa_op = MONO_SSA_NOP;
+ inst->opcode = CEE_NOP;
+ }
+
+}
+
+void
+mono_ssa_remove (MonoCompile *cfg)
+{
+ MonoInst *inst, *phi;
+ char *is_live;
+ int i, j;
+#ifndef USE_ORIGINAL_VARS
+ GPtrArray *varlist_array;
+ GList *active;
+#endif
+ g_assert (cfg->comp_done & MONO_COMP_SSA);
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+ for (inst = bb->code; inst; inst = inst->next) {
+ if (inst->ssa_op == MONO_SSA_STORE && inst->inst_i1->opcode == OP_PHI) {
+
+ phi = inst->inst_i1;
+ g_assert (phi->inst_phi_args [0] == bb->in_count);
+
+ for (j = 0; j < bb->in_count; j++) {
+ MonoBasicBlock *pred = bb->in_bb [j];
+ int idx = phi->inst_phi_args [j + 1];
+ MonoMethodVar *mv = cfg->vars [idx];
+
+ if (mv->reg != -1 && mv->reg != mv->idx) {
+ //printf ("PHICOPY %d %d -> %d\n", idx, mv->reg, inst->inst_i0->inst_c0);
+ idx = mv->reg;
+ }
+
+
+ if (idx != inst->inst_i0->inst_c0) {
+#ifdef DEBUG_SSA
+ printf ("MOVE %d to %d in BB%d\n", idx, inst->inst_i0->inst_c0, pred->block_num);
+#endif
+ mono_add_varcopy_to_end (cfg, pred, idx, inst->inst_i0->inst_c0);
+ }
+ }
+
+ /* remove the phi functions */
+ inst->opcode = CEE_NOP;
+ inst->ssa_op = MONO_SSA_NOP;
+ }
+ }
+ }
+
+#ifndef USE_ORIGINAL_VARS
+ /* we compute liveness again */
+ cfg->comp_done &= ~MONO_COMP_LIVENESS;
+ mono_analyze_liveness (cfg);
+
+ varlist_array = mono_ssa_get_allocatable_vars (cfg);
+
+ for (i = 0; i < varlist_array->len; i++) {
+ GList *l, *regs, *vars = g_ptr_array_index (varlist_array, i);
+ MonoMethodVar *vmv, *amv;
+
+ if (g_list_length (vars) <= 1) {
+ continue;
+ }
+
+ active = NULL;
+ regs = NULL;
+
+ for (l = vars; l; l = l->next) {
+ vmv = l->data;
+
+ /* expire old intervals in active */
+ while (active) {
+ amv = (MonoMethodVar *)active->data;
+
+ if (amv->range.last_use.abs_pos >= vmv->range.first_use.abs_pos)
+ break;
+
+ active = g_list_delete_link (active, active);
+ regs = g_list_prepend (regs, (gpointer)amv->reg);
+ }
+
+ if (!regs)
+ regs = g_list_prepend (regs, (gpointer)vmv->idx);
+
+ vmv->reg = (int)regs->data;
+ regs = g_list_delete_link (regs, regs);
+ active = mono_varlist_insert_sorted (cfg, active, vmv, TRUE);
+ }
+
+ g_list_free (active);
+ g_list_free (regs);
+ g_list_free (vars);
+ }
+
+ g_ptr_array_free (varlist_array, TRUE);
+
+#endif
+
+ is_live = alloca (cfg->num_varinfo);
+ memset (is_live, 0, cfg->num_varinfo);
+
+ for (i = 0; i < cfg->num_bblocks; ++i) {
+ MonoBasicBlock *bb = cfg->bblocks [i];
+
+ for (inst = bb->code; inst; inst = inst->next)
+ mono_ssa_replace_copies (cfg, bb, inst, is_live);
+ }
+
+ for (i = 0; i < cfg->num_varinfo; ++i) {
+ cfg->vars [i]->reg = -1;
+ if (!is_live [i]) {
+ cfg->varinfo [i]->flags |= MONO_INST_IS_DEAD;
+ }
+ }
+
+ if (cfg->comp_done & MONO_COMP_REACHABILITY)
+ unlink_unused_bblocks (cfg);
+
+ cfg->comp_done &= ~MONO_COMP_SSA;
+}
+
+
+#define IS_CALL(op) (op == CEE_CALLI || op == CEE_CALL || op == CEE_CALLVIRT || (op >= OP_VOIDCALL && op <= OP_CALL_MEMBASE))
+
+typedef struct {
+ MonoBasicBlock *bb;
+ MonoInst *inst;
+} MonoVarUsageInfo;
+
+static void
+analyze_dev_use (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *root, MonoInst *inst)
+{
+ MonoMethodVar *info;
+ int i, idx, arity;
+
+ if (!inst)
+ return;
+
+ arity = mono_burg_arity [inst->opcode];
+
+ if ((inst->ssa_op == MONO_SSA_STORE) &&
+ (inst->inst_i0->opcode == OP_LOCAL /*|| inst->inst_i0->opcode == OP_ARG */)) {
+ idx = inst->inst_i0->inst_c0;
+ info = cfg->vars [idx];
+ //printf ("%d defined in BB%d %p\n", idx, bb->block_num, root);
+ if (info->def) {
+ g_warning ("more than one definition of variable %d in %s", idx,
+ mono_method_full_name (cfg->method, TRUE));
+ g_assert_not_reached ();
+ }
+ if (!IS_CALL (inst->inst_i1->opcode) /* && inst->inst_i1->opcode == OP_ICONST */) {
+ g_assert (inst == root);
+ info->def = root;
+ info->def_bb = bb;
+ }
+
+ if (inst->inst_i1->opcode == OP_PHI) {
+ for (i = inst->inst_i1->inst_phi_args [0]; i > 0; i--) {
+ MonoVarUsageInfo *ui = mono_mempool_alloc (cfg->mempool, sizeof (MonoVarUsageInfo));
+ idx = inst->inst_i1->inst_phi_args [i];
+ info = cfg->vars [idx];
+ //printf ("FOUND %d\n", idx);
+ ui->bb = bb;
+ ui->inst = root;
+ info->uses = g_list_prepend_mempool (info->uses, cfg->mempool, ui);
+ }
+ }
+ }
+
+ if ((inst->ssa_op == MONO_SSA_LOAD || inst->ssa_op == MONO_SSA_MAYBE_LOAD) &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG)) {
+ MonoVarUsageInfo *ui = mono_mempool_alloc (cfg->mempool, sizeof (MonoVarUsageInfo));
+ idx = inst->inst_i0->inst_c0;
+ info = cfg->vars [idx];
+ //printf ("FOUND %d\n", idx);
+ ui->bb = bb;
+ ui->inst = root;
+ info->uses = g_list_prepend_mempool (info->uses, cfg->mempool, ui);
+ } else {
+ if (arity) {
+ //if (inst->ssa_op != MONO_SSA_STORE)
+ analyze_dev_use (cfg, bb, root, inst->inst_left);
+ if (arity > 1)
+ analyze_dev_use (cfg, bb, root, inst->inst_right);
+ }
+ }
+}
+
+
+/* avoid unnecessary copies of variables:
+ * Y <= X; Z = Y; is translated to Z = X;
+ */
+static void
+mono_ssa_avoid_copies (MonoCompile *cfg)
+{
+ MonoInst *inst, *next;
+ MonoBasicBlock *bb;
+ MonoMethodVar *i1, *i2;
+
+ g_assert ((cfg->comp_done & MONO_COMP_SSA_DEF_USE));
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ for (inst = bb->code; inst; inst = inst->next) {
+ if (inst->ssa_op == MONO_SSA_STORE && inst->inst_i0->opcode == OP_LOCAL &&
+ !IS_CALL (inst->inst_i1->opcode) && inst->inst_i1->opcode != OP_PHI && !inst->flags) {
+ i1 = cfg->vars [inst->inst_i0->inst_c0];
+
+/* fixme: compiling mcs does not work when I enable this */
+#if 0
+ if (g_list_length (i1->uses) == 1 && !extends_live (inst->inst_i1)) {
+ MonoVarUsageInfo *vi = (MonoVarUsageInfo *)i1->uses->data;
+ u = vi->inst;
+
+ //printf ("VAR %d %s\n", i1->idx, mono_method_full_name (cfg->method, TRUE));
+ //mono_print_tree (inst); printf ("\n");
+ //mono_print_tree (u); printf ("\n");
+
+ if (replace_usage_new (cfg, u, inst->inst_i0->inst_c0, inst->inst_i1)) {
+
+ //mono_print_tree (u); printf ("\n");
+
+ inst->opcode = CEE_NOP;
+ inst->ssa_op = MONO_SSA_NOP;
+ }
+ }
+#endif
+ if ((next = inst->next) && next->ssa_op == MONO_SSA_STORE && next->inst_i0->opcode == OP_LOCAL &&
+ next->inst_i1->ssa_op == MONO_SSA_LOAD && next->inst_i1->inst_i0->opcode == OP_LOCAL &&
+ next->inst_i1->inst_i0->inst_c0 == inst->inst_i0->inst_c0 && g_list_length (i1->uses) == 1 &&
+ inst->opcode == next->opcode && inst->inst_i0->type == next->inst_i0->type) {
+ i2 = cfg->vars [next->inst_i0->inst_c0];
+ //printf ("ELIM. COPY in BB%d %s\n", bb->block_num, mono_method_full_name (cfg->method, TRUE));
+ inst->inst_i0 = next->inst_i0;
+ i2->def = inst;
+ i1->def = NULL;
+ i1->uses = NULL;
+ next->opcode = CEE_NOP;
+ next->ssa_op = MONO_SSA_NOP;
+ }
+ }
+ }
+ }
+}
+
+static void
+mono_ssa_create_def_use (MonoCompile *cfg)
+{
+ MonoBasicBlock *bb;
+
+ g_assert (!(cfg->comp_done & MONO_COMP_SSA_DEF_USE));
+
+ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
+ MonoInst *inst;
+ for (inst = bb->code; inst; inst = inst->next) {
+ analyze_dev_use (cfg, bb, inst, inst);
+ }
+ }
+
+ cfg->comp_done |= MONO_COMP_SSA_DEF_USE;
+}
+
+static int
+simulate_compare (int opcode, int a, int b)
+{
+ switch (opcode) {
+ case CEE_BEQ:
+ return a == b;
+ case CEE_BGE:
+ return a >= b;
+ case CEE_BGT:
+ return a > b;
+ case CEE_BLE:
+ return a <= b;
+ case CEE_BLT:
+ return a < b;
+ case CEE_BNE_UN:
+ return a != b;
+ case CEE_BGE_UN:
+ return (unsigned)a >= (unsigned)b;
+ case CEE_BGT_UN:
+ return (unsigned)a > (unsigned)b;
+ case CEE_BLE_UN:
+ return (unsigned)a <= (unsigned)b;
+ case CEE_BLT_UN:
+ return (unsigned)a < (unsigned)b;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return 0;
+}
+
+static int
+simulate_long_compare (int opcode, gint64 a, gint64 b)
+{
+ switch (opcode) {
+ case CEE_BEQ:
+ return a == b;
+ case CEE_BGE:
+ return a >= b;
+ case CEE_BGT:
+ return a > b;
+ case CEE_BLE:
+ return a <= b;
+ case CEE_BLT:
+ return a < b;
+ case CEE_BNE_UN:
+ return a != b;
+ case CEE_BGE_UN:
+ return (guint64)a >= (guint64)b;
+ case CEE_BGT_UN:
+ return (guint64)a > (guint64)b;
+ case CEE_BLE_UN:
+ return (guint64)a <= (guint64)b;
+ case CEE_BLT_UN:
+ return (guint64)a < (guint64)b;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return 0;
+}
+
+#define EVAL_CXX(name,op,cast) \
+ case name: \
+ if ((inst->inst_i0->opcode == OP_COMPARE) || (inst->inst_i0->opcode == OP_LCOMPARE)) { \
+ r1 = evaluate_const_tree (cfg, inst->inst_i0->inst_i0, &a, carray); \
+ r2 = evaluate_const_tree (cfg, inst->inst_i0->inst_i1, &b, carray); \
+ if (r1 == 1 && r2 == 1) { \
+ *res = ((cast)a op (cast)b); \
+ return 1; \
+ } else { \
+ return MAX (r1, r2); \
+ } \
+ } \
+ break;
+
+#define EVAL_BINOP(name,op) \
+ case name: \
+ r1 = evaluate_const_tree (cfg, inst->inst_i0, &a, carray); \
+ r2 = evaluate_const_tree (cfg, inst->inst_i1, &b, carray); \
+ if (r1 == 1 && r2 == 1) { \
+ *res = (a op b); \
+ return 1; \
+ } else { \
+ return MAX (r1, r2); \
+ } \
+ break;
+
+
+/* fixme: this only works for interger constants, but not for other types (long, float) */
+static int
+evaluate_const_tree (MonoCompile *cfg, MonoInst *inst, int *res, MonoInst **carray)
+{
+ MonoInst *c0;
+ int a, b, r1, r2;
+
+ if (!inst)
+ return 0;
+
+ if (inst->ssa_op == MONO_SSA_LOAD &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG) &&
+ (c0 = carray [inst->inst_i0->inst_c0])) {
+ *res = c0->inst_c0;
+ return 1;
+ }
+
+ switch (inst->opcode) {
+ case OP_ICONST:
+ *res = inst->inst_c0;
+ return 1;
+
+ EVAL_CXX (OP_CEQ,==,gint32)
+ EVAL_CXX (OP_CGT,>,gint32)
+ EVAL_CXX (OP_CGT_UN,>,guint32)
+ EVAL_CXX (OP_CLT,<,gint32)
+ EVAL_CXX (OP_CLT_UN,<,guint32)
+
+ EVAL_BINOP (CEE_ADD,+)
+ EVAL_BINOP (CEE_SUB,-)
+ EVAL_BINOP (CEE_MUL,*)
+ EVAL_BINOP (CEE_AND,&)
+ EVAL_BINOP (CEE_OR,|)
+ EVAL_BINOP (CEE_XOR,^)
+ EVAL_BINOP (CEE_SHL,<<)
+ EVAL_BINOP (CEE_SHR,>>)
+
+ default:
+ return 2;
+ }
+
+ return 2;
+}
+
+static void
+fold_tree (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *inst, MonoInst **carray)
+{
+ MonoInst *c0;
+ int arity, a, b;
+
+ if (!inst)
+ return;
+
+ arity = mono_burg_arity [inst->opcode];
+
+ if (inst->ssa_op == MONO_SSA_STORE &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG) &&
+ inst->inst_i1->opcode == OP_PHI && (c0 = carray [inst->inst_i0->inst_c0])) {
+ //{static int cn = 0; printf ("PHICONST %d %d %s\n", cn++, c0->inst_c0, mono_method_full_name (cfg->method, TRUE));}
+ *inst->inst_i1 = *c0;
+ } else if (inst->ssa_op == MONO_SSA_LOAD &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG) &&
+ (c0 = carray [inst->inst_i0->inst_c0])) {
+ //{static int cn = 0; printf ("YCCOPY %d %d %s\n", cn++, c0->inst_c0, mono_method_full_name (cfg->method, TRUE));}
+ *inst = *c0;
+ } else {
+
+ if (arity) {
+ fold_tree (cfg, bb, inst->inst_left, carray);
+ if (arity > 1)
+ fold_tree (cfg, bb, inst->inst_right, carray);
+ mono_constant_fold_inst (inst, NULL);
+ }
+ }
+
+ if ((inst->opcode >= CEE_BEQ && inst->opcode <= CEE_BLT_UN) &&
+ ((inst->inst_i0->opcode == OP_COMPARE) || (inst->inst_i0->opcode == OP_LCOMPARE))) {
+ MonoInst *v0 = inst->inst_i0->inst_i0;
+ MonoInst *v1 = inst->inst_i0->inst_i1;
+ MonoBasicBlock *target = NULL;
+
+ /* hack for longs to optimize the simply cases */
+ if (v0->opcode == OP_I8CONST && v1->opcode == OP_I8CONST) {
+ if (simulate_long_compare (inst->opcode, v0->inst_l, v1->inst_l)) {
+ //unlink_target (bb, inst->inst_false_bb);
+ target = inst->inst_true_bb;
+ } else {
+ //unlink_target (bb, inst->inst_true_bb);
+ target = inst->inst_false_bb;
+ }
+ } else if (evaluate_const_tree (cfg, v0, &a, carray) == 1 &&
+ evaluate_const_tree (cfg, v1, &b, carray) == 1) {
+ if (simulate_compare (inst->opcode, a, b)) {
+ //unlink_target (bb, inst->inst_false_bb);
+ target = inst->inst_true_bb;
+ } else {
+ //unlink_target (bb, inst->inst_true_bb);
+ target = inst->inst_false_bb;
+ }
+ }
+
+ if (target) {
+ bb->out_bb [0] = target;
+ bb->out_count = 1;
+ inst->opcode = CEE_BR;
+ inst->inst_target_bb = target;
+ }
+ } else if (inst->opcode == CEE_SWITCH && evaluate_const_tree (cfg, inst->inst_left, &a, carray) == 1) {
+ bb->out_bb [0] = inst->inst_many_bb [a];
+ bb->out_count = 1;
+ inst->inst_target_bb = bb->out_bb [0];
+ inst->opcode = CEE_BR;
+ }
+
+}
+
+static void
+change_varstate (MonoCompile *cfg, GList **cvars, MonoMethodVar *info, int state, MonoInst *c0, MonoInst **carray)
+{
+ if (info->cpstate >= state)
+ return;
+
+ info->cpstate = state;
+
+ //printf ("SETSTATE %d to %d\n", info->idx, info->cpstate);
+
+ if (state == 1)
+ carray [info->idx] = c0;
+ else
+ carray [info->idx] = NULL;
+
+ if (!g_list_find (*cvars, info)) {
+ *cvars = g_list_prepend (*cvars, info);
+ }
+}
+
+static void
+visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *inst, GList **cvars, GList **bblist, MonoInst **carray)
+{
+ g_assert (inst);
+
+ if (inst->opcode == CEE_SWITCH) {
+ int r1, i, a;
+
+ r1 = evaluate_const_tree (cfg, inst->inst_left, &a, carray);
+ if (r1 == 1) {
+ MonoBasicBlock *tb = inst->inst_many_bb [a];
+ if (!(tb->flags & BB_REACHABLE)) {
+ tb->flags |= BB_REACHABLE;
+ *bblist = g_list_prepend (*bblist, tb);
+ }
+ } else if (r1 == 2) {
+ for (i = (int)inst->klass; i >= 0; i--) {
+ MonoBasicBlock *tb = inst->inst_many_bb [i];
+ if (!(tb->flags & BB_REACHABLE)) {
+ tb->flags |= BB_REACHABLE;
+ *bblist = g_list_prepend (*bblist, tb);
+ }
+ }
+ }
+ } else if ((inst->opcode >= CEE_BEQ && inst->opcode <= CEE_BLT_UN) &&
+ ((inst->inst_i0->opcode == OP_COMPARE) || (inst->inst_i0->opcode == OP_LCOMPARE))) {
+ int a, b, r1, r2;
+ MonoInst *v0 = inst->inst_i0->inst_i0;
+ MonoInst *v1 = inst->inst_i0->inst_i1;
+
+ r1 = evaluate_const_tree (cfg, v0, &a, carray);
+ r2 = evaluate_const_tree (cfg, v1, &b, carray);
+
+ if (r1 == 1 && r2 == 1) {
+ MonoBasicBlock *target;
+
+ if (simulate_compare (inst->opcode, a, b)) {
+ target = inst->inst_true_bb;
+ } else {
+ target = inst->inst_false_bb;
+ }
+ if (!(target->flags & BB_REACHABLE)) {
+ target->flags |= BB_REACHABLE;
+ *bblist = g_list_prepend (*bblist, target);
+ }
+ } else if (r1 == 2 || r2 == 2) {
+ if (!(inst->inst_true_bb->flags & BB_REACHABLE)) {
+ inst->inst_true_bb->flags |= BB_REACHABLE;
+ *bblist = g_list_prepend (*bblist, inst->inst_true_bb);
+ }
+ if (!(inst->inst_false_bb->flags & BB_REACHABLE)) {
+ inst->inst_false_bb->flags |= BB_REACHABLE;
+ *bblist = g_list_prepend (*bblist, inst->inst_false_bb);
+ }
+ }
+ } else if (inst->ssa_op == MONO_SSA_STORE &&
+ (inst->inst_i0->opcode == OP_LOCAL || inst->inst_i0->opcode == OP_ARG)) {
+ MonoMethodVar *info = cfg->vars [inst->inst_i0->inst_c0];
+ MonoInst *i1 = inst->inst_i1;
+ int res;
+
+ if (info->cpstate < 2) {
+ if (i1->opcode == OP_ICONST) {
+ change_varstate (cfg, cvars, info, 1, i1, carray);
+ } else if (i1->opcode == OP_PHI) {
+ MonoInst *c0 = NULL;
+ int j;
+
+ for (j = 1; j <= i1->inst_phi_args [0]; j++) {
+ MonoMethodVar *mv = cfg->vars [i1->inst_phi_args [j]];
+ MonoInst *src = mv->def;
+
+ if (mv->def_bb && !(mv->def_bb->flags & BB_REACHABLE)) {
+ continue;
+ }
+
+ if (!mv->def || !src || src->ssa_op != MONO_SSA_STORE ||
+ !(src->inst_i0->opcode == OP_LOCAL || src->inst_i0->opcode == OP_ARG) ||
+ mv->cpstate == 2) {
+ change_varstate (cfg, cvars, info, 2, NULL, carray);
+ break;
+ }
+
+ if (mv->cpstate == 0)
+ continue;
+
+ //g_assert (src->inst_i1->opcode == OP_ICONST);
+ g_assert (carray [mv->idx]);
+
+ if (!c0) {
+ c0 = carray [mv->idx];
+ }
+
+ if (carray [mv->idx]->inst_c0 != c0->inst_c0) {
+ change_varstate (cfg, cvars, info, 2, NULL, carray);
+ break;
+ }
+ }
+
+ if (c0 && info->cpstate < 1) {
+ change_varstate (cfg, cvars, info, 1, c0, carray);
+ }
+ } else {
+ int state = evaluate_const_tree (cfg, i1, &res, carray);
+ if (state == 1) {
+ NEW_ICONST (cfg, i1, res);
+ change_varstate (cfg, cvars, info, 1, i1, carray);
+ } else {
+ change_varstate (cfg, cvars, info, 2, NULL, carray);
+ }
+ }
+ }
+ }
+}
+
+void
+mono_ssa_cprop (MonoCompile *cfg)
+{
+ MonoInst **carray;
+ MonoBasicBlock *bb;
+ GList *bblock_list, *cvars;
+ GList *tmp;
+ int i;
+ //printf ("SIMPLE OPTS BB%d %s\n", bb->block_num, mono_method_full_name (cfg->method, TRUE));
+
+ carray = g_new0 (MonoInst*, cfg->num_varinfo);
+
+ if (!(cfg->comp_done & MONO_COMP_SSA_DEF_USE))
+ mono_ssa_create_def_use (cfg);
+
+ bblock_list = g_list_prepend (NULL, cfg->bb_entry);
+ cfg->bb_entry->flags |= BB_REACHABLE;
+
+ memset (carray, 0, sizeof (MonoInst *) * cfg->num_varinfo);
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoMethodVar *info = cfg->vars [i];
+ if (!info->def)
+ info->cpstate = 2;
+ }
+
+ cvars = NULL;
+
+ while (bblock_list) {
+ MonoInst *inst;
+
+ bb = (MonoBasicBlock *)bblock_list->data;
+
+ bblock_list = g_list_delete_link (bblock_list, bblock_list);
+
+ g_assert (bb->flags & BB_REACHABLE);
+
+ if (bb->out_count == 1) {
+ if (!(bb->out_bb [0]->flags & BB_REACHABLE)) {
+ bb->out_bb [0]->flags |= BB_REACHABLE;
+ bblock_list = g_list_prepend (bblock_list, bb->out_bb [0]);
+ }
+ }
+
+ for (inst = bb->code; inst; inst = inst->next) {
+ visit_inst (cfg, bb, inst, &cvars, &bblock_list, carray);
+ }
+
+ while (cvars) {
+ MonoMethodVar *info = (MonoMethodVar *)cvars->data;
+ cvars = g_list_delete_link (cvars, cvars);
+
+ for (tmp = info->uses; tmp; tmp = tmp->next) {
+ MonoVarUsageInfo *ui = (MonoVarUsageInfo *)tmp->data;
+ if (!(ui->bb->flags & BB_REACHABLE))
+ continue;
+ visit_inst (cfg, ui->bb, ui->inst, &cvars, &bblock_list, carray);
+ }
+ }
+ }
+
+ for (bb = cfg->bb_entry->next_bb; bb; bb = bb->next_bb) {
+ MonoInst *inst;
+ for (inst = bb->code; inst; inst = inst->next) {
+ fold_tree (cfg, bb, inst, carray);
+ }
+ }
+
+ g_free (carray);
+
+ cfg->comp_done |= MONO_COMP_REACHABILITY;
+}
+
+static void
+add_to_dce_worklist (MonoCompile *cfg, MonoMethodVar *var, MonoMethodVar *use, GList **wl)
+{
+ GList *tmp;
+
+ *wl = g_list_prepend (*wl, use);
+
+ for (tmp = use->uses; tmp; tmp = tmp->next) {
+ MonoVarUsageInfo *ui = (MonoVarUsageInfo *)tmp->data;
+ if (ui->inst == var->def) {
+ /* from the mempool */
+ use->uses = g_list_remove_link (use->uses, tmp);
+ break;
+ }
+ }
+}
+
+void
+mono_ssa_deadce (MonoCompile *cfg)
+{
+ int i;
+ GList *work_list;
+
+ g_assert (cfg->comp_done & MONO_COMP_SSA);
+
+ //printf ("DEADCE %s\n", mono_method_full_name (cfg->method, TRUE));
+
+ /* fixme: we should update usage infos during cprop, instead of computing it again */
+ cfg->comp_done &= ~MONO_COMP_SSA_DEF_USE;
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoMethodVar *info = cfg->vars [i];
+ info->def = NULL;
+ info->uses = NULL;
+ }
+
+ if (!(cfg->comp_done & MONO_COMP_SSA_DEF_USE))
+ mono_ssa_create_def_use (cfg);
+
+ mono_ssa_avoid_copies (cfg);
+
+ work_list = NULL;
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoMethodVar *info = cfg->vars [i];
+ work_list = g_list_prepend (work_list, info);
+ }
+
+ while (work_list) {
+ MonoMethodVar *info = (MonoMethodVar *)work_list->data;
+ work_list = g_list_delete_link (work_list, work_list);
+
+ if (!info->uses && info->def && (!(cfg->varinfo [info->idx]->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT)))) {
+ MonoInst *i1;
+ //printf ("ELIMINATE %s: ", mono_method_full_name (cfg->method, TRUE)); mono_print_tree (info->def); printf ("\n");
+
+ i1 = info->def->inst_i1;
+ if (i1->opcode == OP_PHI) {
+ int j;
+ for (j = i1->inst_phi_args [0]; j > 0; j--) {
+ MonoMethodVar *u = cfg->vars [i1->inst_phi_args [j]];
+ add_to_dce_worklist (cfg, info, u, &work_list);
+ }
+ } else if (i1->ssa_op == MONO_SSA_LOAD &&
+ (i1->inst_i0->opcode == OP_LOCAL || i1->inst_i0->opcode == OP_ARG)) {
+ MonoMethodVar *u = cfg->vars [i1->inst_i0->inst_c0];
+ add_to_dce_worklist (cfg, info, u, &work_list);
+ }
+
+ info->def->opcode = CEE_NOP;
+ info->def->ssa_op = MONO_SSA_NOP;
+ }
+
+ }
+}
+
+#if 0
+void
+mono_ssa_strength_reduction (MonoCompile *cfg)
+{
+ MonoBasicBlock *bb;
+ int i;
+
+ g_assert (cfg->comp_done & MONO_COMP_SSA);
+ g_assert (cfg->comp_done & MONO_COMP_LOOPS);
+ g_assert (cfg->comp_done & MONO_COMP_SSA_DEF_USE);
+
+ for (bb = cfg->bb_entry->next_bb; bb; bb = bb->next_bb) {
+ GList *lp = bb->loop_blocks;
+
+ if (lp) {
+ MonoBasicBlock *h = (MonoBasicBlock *)lp->data;
+
+ /* we only consider loops with 2 in bblocks */
+ if (!h->in_count == 2)
+ continue;
+
+ for (i = 0; i < cfg->num_varinfo; i++) {
+ MonoMethodVar *info = cfg->vars [i];
+
+ if (info->def && info->def->ssa_op == MONO_SSA_STORE &&
+ info->def->inst_i0->opcode == OP_LOCAL && g_list_find (lp, info->def_bb)) {
+ MonoInst *v = info->def->inst_i1;
+
+
+ printf ("FOUND %d in %s\n", info->idx, mono_method_full_name (cfg->method, TRUE));
+ }
+ }
+ }
+ }
+}
+#endif
diff --git a/mono/mini/test.cs b/mono/mini/test.cs
new file mode 100644
index 00000000000..49e17ad14dd
--- /dev/null
+++ b/mono/mini/test.cs
@@ -0,0 +1,348 @@
+using System;
+
+namespace SSA {
+ class Test {
+
+ static void empty () {
+ }
+ static int ret_int () {
+ return 1;
+ }
+ static int simple_add (int a) {
+ int b = 5;
+ return a + b;
+ }
+
+ static int cmov (int a) {
+ return a >= 10? 1: 2;
+ }
+
+ static int many_shifts (int a, int b, int c) {
+ return a << b << c << 1;
+ }
+
+ static void test2 (int a) {
+ int x, y, z;
+
+ z = 1;
+ if (z > a) {
+ x = 1;
+ if (z > 2) {
+ y = x + 1;
+ return;
+ }
+ } else {
+ x = 2;
+ }
+ z = x -3;
+ x = 4;
+ goto next;
+ next:
+ z = x + 7;
+ }
+
+ static int rfib (int n) {
+ if (n < 2)
+ return 1;
+ return rfib (n - 2) + rfib (n - 1);
+ }
+
+ static int test1 (int v) {
+ int x, y;
+
+ x = 1;
+ if (v != 0) {
+ y = 2;
+ } else {
+ y = x + 1;
+ }
+ return y;
+ }
+
+ static int for_loop () {
+ int j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ return j;
+ }
+
+ static int many_bb2 () {
+ int j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ return j;
+ }
+
+ static int many_bb4 () {
+ int j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ return j;
+ }
+
+ static int many_bb8 () {
+ int j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ return j;
+ }
+
+ static int many_bb16 () {
+ int j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ j = 0;
+ for (int i = 0; i < 5; i++) {
+ j += i;
+ }
+ return j;
+ }
+
+ static int many_bb32 () {
+ int j;
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ j = 0; for (int i = 0; i < 5; i++) { j += i; }
+ return j;
+ }
+
+ /*static int fib (int n) {
+ int f0 = 0, f1 = 1, f2 = 0, i;
+
+ if (n <= 1) goto L3;
+ i = 2;
+ L1:
+ if (i <= n) goto L2;
+ return f2;
+ L2:
+ f2 = f0 + f1;
+ f0 = f1;
+ f1 = f2;
+ i++;
+ goto L1;
+ L3:
+ return n;
+ }*/
+
+ static int nested_loops (int n) {
+ int m = 1000;
+ int a = 0;
+ for (int i = 0; i < n; ++i) {
+ for (int j = 0; j < m; ++j) {
+ a++;
+ }
+ }
+ return a;
+ }
+
+ static int Main() {
+ if (test1 (1) != 2)
+ return 1;
+ return 0;
+ }
+ }
+}
+
diff --git a/mono/mini/trace.c b/mono/mini/trace.c
new file mode 100644
index 00000000000..74cdfd7f02f
--- /dev/null
+++ b/mono/mini/trace.c
@@ -0,0 +1,525 @@
+/*
+ * trace.c: Tracing facilities for the Mono Runtime.
+ *
+ * Author:
+ * Paolo Molaro (lupus@ximian.com)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2002 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+#include "mini.h"
+#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/assembly.h>
+#include "trace.h"
+
+static MonoTraceSpec trace_spec;
+
+gboolean
+mono_trace_eval (MonoMethod *method)
+{
+ int include = 0;
+ int i;
+
+ for (i = 0; i < trace_spec.len; i++){
+ MonoTraceOperation *op = &trace_spec.ops [i];
+ int inc = 0;
+
+ switch (op->op){
+ case MONO_TRACEOP_ALL:
+ inc = 1; break;
+ case MONO_TRACEOP_PROGRAM:
+ if (trace_spec.assembly && (method->klass->image == mono_assembly_get_image (trace_spec.assembly)))
+ inc = 1; break;
+ case MONO_TRACEOP_METHOD:
+ if (mono_method_desc_full_match ((MonoMethodDesc *) op->data, method))
+ inc = 1; break;
+ case MONO_TRACEOP_CLASS:
+ if (strcmp (method->klass->name_space, op->data) == 0)
+ if (strcmp (method->klass->name, op->data2) == 0)
+ inc = 1;
+ break;
+ case MONO_TRACEOP_ASSEMBLY:
+ if (strcmp (mono_image_get_name (method->klass->image), op->data) == 0)
+ inc = 1; break;
+ case MONO_TRACEOP_NAMESPACE:
+ if (strcmp (method->klass->name_space, op->data) == 0)
+ inc = 1;
+ }
+ if (op->exclude){
+ if (inc)
+ include = 0;
+ } else if (inc)
+ include = 1;
+ }
+ return include;
+}
+
+static int is_filenamechar (char p)
+{
+ if (p >= 'A' && p <= 'Z')
+ return TRUE;
+ if (p >= 'a' && p <= 'z')
+ return TRUE;
+ if (p >= '0' && p <= '9')
+ return TRUE;
+ if (p == '.' || p == ':' || p == '_')
+ return TRUE;
+ return FALSE;
+}
+
+static char *input;
+static char *value;
+
+static void get_string (void)
+{
+ char *start = input;
+ while (is_filenamechar (*input)){
+ input++;
+ }
+ if (value != NULL)
+ g_free (value);
+ value = g_malloc (input - start + 1);
+ strncpy (value, start, input-start);
+ value [input-start] = 0;
+}
+
+enum Token {
+ TOKEN_METHOD,
+ TOKEN_CLASS,
+ TOKEN_ALL,
+ TOKEN_PROGRAM,
+ TOKEN_NAMESPACE,
+ TOKEN_STRING,
+ TOKEN_EXCLUDE,
+ TOKEN_SEPARATOR,
+ TOKEN_END,
+ TOKEN_ERROR
+};
+
+static int
+get_token (void)
+{
+ while (*input != 0){
+ if (input [0] == 'M' && input [1] == ':'){
+ input += 2;
+ get_string ();
+ return TOKEN_METHOD;
+ }
+ if (input [0] == 'N' && input [1] == ':'){
+ input += 2;
+ get_string ();
+ return TOKEN_NAMESPACE;
+ }
+ if (input [0] == 'T' && input [1] == ':'){
+ input += 2;
+ get_string ();
+ return TOKEN_CLASS;
+ }
+ if (is_filenamechar (*input)){
+ get_string ();
+ if (strcmp (value, "all") == 0)
+ return TOKEN_ALL;
+ if (strcmp (value, "program") == 0)
+ return TOKEN_PROGRAM;
+ return TOKEN_STRING;
+ }
+ if (*input == '-'){
+ input++;
+ return TOKEN_EXCLUDE;
+ }
+ if (*input == ','){
+ input++;
+ return TOKEN_SEPARATOR;
+ }
+ input++;
+
+ }
+ return TOKEN_END;
+}
+
+static void
+cleanup (void)
+{
+ if (value != NULL)
+ g_free (value);
+}
+
+static int
+get_spec (int *last)
+{
+ int token = get_token ();
+ if (token == TOKEN_EXCLUDE){
+ token = get_spec (last);
+ if (token == TOKEN_EXCLUDE){
+ fprintf (stderr, "Expecting an expression");
+ return TOKEN_ERROR;
+ }
+ if (token == TOKEN_ERROR)
+ return token;
+ trace_spec.ops [(*last)-1].exclude = 1;
+ return TOKEN_SEPARATOR;
+ }
+ if (token == TOKEN_END || token == TOKEN_SEPARATOR || token == TOKEN_ERROR)
+ return token;
+
+ if (token == TOKEN_METHOD){
+ MonoMethodDesc *desc = mono_method_desc_new (value, TRUE);
+ if (desc == NULL){
+ fprintf (stderr, "Invalid method name: %s\n", value);
+ return TOKEN_ERROR;
+ }
+ trace_spec.ops [*last].op = MONO_TRACEOP_METHOD;
+ trace_spec.ops [*last].data = desc;
+ } else if (token == TOKEN_ALL)
+ trace_spec.ops [*last].op = MONO_TRACEOP_ALL;
+ else if (token == TOKEN_PROGRAM)
+ trace_spec.ops [*last].op = MONO_TRACEOP_PROGRAM;
+ else if (token == TOKEN_NAMESPACE){
+ trace_spec.ops [*last].op = MONO_TRACEOP_NAMESPACE;
+ trace_spec.ops [*last].data = g_strdup (value);
+ } else if (token == TOKEN_CLASS){
+ char *p = strrchr (value, '.');
+ if (p) {
+ *p++ = 0;
+ trace_spec.ops [*last].data = g_strdup (value);
+ trace_spec.ops [*last].data2 = g_strdup (p);
+ }
+ else {
+ trace_spec.ops [*last].data = g_strdup ("");
+ trace_spec.ops [*last].data2 = g_strdup (value);
+ }
+ trace_spec.ops [*last].op = MONO_TRACEOP_CLASS;
+ } else if (token == TOKEN_STRING){
+ trace_spec.ops [*last].op = MONO_TRACEOP_ASSEMBLY;
+ trace_spec.ops [*last].data = g_strdup (value);
+ }
+ else {
+ fprintf (stderr, "Syntax error in trace option specification\n");
+ return TOKEN_ERROR;
+ }
+ (*last)++;
+ return TOKEN_SEPARATOR;
+}
+
+MonoTraceSpec *
+mono_trace_parse_options (char *options)
+{
+ char *p = options;
+ int size = 1;
+ int last_used;
+ int token;
+
+ if (*p == 0){
+ trace_spec.len = 1;
+ trace_spec.ops = g_new0 (MonoTraceOperation, 1);
+ trace_spec.ops [0].op = MONO_TRACEOP_ALL;
+ return &trace_spec;
+ }
+
+ for (p = options; *p != 0; p++)
+ if (*p == ',')
+ size++;
+
+ trace_spec.ops = g_new0 (MonoTraceOperation, size);
+
+ input = options;
+ last_used = 0;
+
+ while ((token = (get_spec (&last_used))) != TOKEN_END){
+ if (token == TOKEN_ERROR)
+ return NULL;
+ if (token == TOKEN_SEPARATOR)
+ continue;
+ }
+ trace_spec.len = last_used;
+ cleanup ();
+ return &trace_spec;
+}
+
+void
+mono_trace_set_assembly (MonoAssembly *assembly)
+{
+ trace_spec.assembly = assembly;
+}
+
+static int indent_level = 0;
+
+static void indent (int diff) {
+ int v;
+ if (diff < 0)
+ indent_level += diff;
+ v = indent_level;
+ while (v-- > 0) {
+ printf (". ");
+ }
+ if (diff > 0)
+ indent_level += diff;
+}
+
+static gboolean enable_trace = TRUE;
+
+void
+mono_trace_enter_method (MonoMethod *method, char *ebp)
+{
+ int i, j;
+ MonoClass *class;
+ MonoObject *o;
+ MonoJitArgumentInfo *arg_info;
+ MonoMethodSignature *sig;
+ char *fname;
+
+ if (!enable_trace)
+ return;
+
+ fname = mono_method_full_name (method, TRUE);
+ indent (1);
+ printf ("ENTER: %s(", fname);
+ g_free (fname);
+
+ if (!ebp) {
+ printf (") ip: %p\n", __builtin_return_address (1));
+ return;
+ }
+ if (((int)ebp & (MONO_ARCH_FRAME_ALIGNMENT - 1)) != 0) {
+ g_error ("unaligned stack detected (%p)", ebp);
+ }
+
+ sig = method->signature;
+
+ arg_info = alloca (sizeof (MonoJitArgumentInfo) * (sig->param_count + 1));
+
+ mono_arch_get_argument_info (sig, sig->param_count, arg_info);
+
+ if (MONO_TYPE_ISSTRUCT (method->signature->ret)) {
+ g_assert (!method->signature->ret->byref);
+
+ printf ("VALUERET:%p, ", *((gpointer *)(ebp + 8)));
+ }
+
+ if (method->signature->hasthis) {
+ gpointer *this = (gpointer *)(ebp + arg_info [0].offset);
+ if (method->klass->valuetype) {
+ printf ("value:%p, ", *this);
+ } else {
+ o = *((MonoObject **)this);
+
+ if (o) {
+ class = o->vtable->klass;
+
+ if (class == mono_defaults.string_class) {
+ printf ("this:[STRING:%p:%s], ", o, mono_string_to_utf8 ((MonoString *)o));
+ } else {
+ printf ("this:%p[%s.%s %s], ", o, class->name_space, class->name, o->vtable->domain->friendly_name);
+ }
+ } else
+ printf ("this:NULL, ");
+ }
+ }
+
+ for (i = 0; i < method->signature->param_count; ++i) {
+ gpointer *cpos = (gpointer *)(ebp + arg_info [i + 1].offset);
+ int size = arg_info [i + 1].size;
+
+ MonoType *type = method->signature->params [i];
+
+ if (type->byref) {
+ printf ("[BYREF:%p], ", *cpos);
+ } else switch (type->type) {
+
+ case MONO_TYPE_I:
+ case MONO_TYPE_U:
+ printf ("%p, ", (gpointer)*((int *)(cpos)));
+ break;
+ case MONO_TYPE_BOOLEAN:
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ printf ("%d, ", *((gint8 *)(cpos)));
+ break;
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ printf ("%d, ", *((gint16 *)(cpos)));
+ break;
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ printf ("%d, ", *((int *)(cpos)));
+ break;
+ case MONO_TYPE_STRING: {
+ MonoString *s = *((MonoString **)cpos);
+ if (s) {
+ g_assert (((MonoObject *)s)->vtable->klass == mono_defaults.string_class);
+ printf ("[STRING:%p:%s], ", s, mono_string_to_utf8 (s));
+ } else
+ printf ("[STRING:null], ");
+ break;
+ }
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT: {
+ o = *((MonoObject **)cpos);
+ if (o) {
+ class = o->vtable->klass;
+
+ if (class == mono_defaults.string_class) {
+ printf ("[STRING:%p:%s], ", o, mono_string_to_utf8 ((MonoString *)o));
+ } else if (class == mono_defaults.int32_class) {
+ printf ("[INT32:%p:%d], ", o, *(gint32 *)((char *)o + sizeof (MonoObject)));
+ } else
+ printf ("[%s.%s:%p], ", class->name_space, class->name, o);
+ } else {
+ printf ("%p, ", *((gpointer *)(cpos)));
+ }
+ break;
+ }
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ printf ("%p, ", *((gpointer *)(cpos)));
+ break;
+ case MONO_TYPE_I8:
+ case MONO_TYPE_U8:
+ printf ("0x%016llx, ", *((gint64 *)(cpos)));
+ break;
+ case MONO_TYPE_R4:
+ printf ("%f, ", *((float *)(cpos)));
+ break;
+ case MONO_TYPE_R8:
+ printf ("%f, ", *((double *)(cpos)));
+ break;
+ case MONO_TYPE_VALUETYPE:
+ printf ("[");
+ for (j = 0; j < size; j++)
+ printf ("%02x,", *((guint8*)cpos +j));
+ printf ("], ");
+ break;
+ default:
+ printf ("XX, ");
+ }
+ }
+
+ printf (")\n");
+}
+
+void
+mono_trace_leave_method (MonoMethod *method, ...)
+{
+ MonoType *type;
+ char *fname;
+ va_list ap;
+
+ if (!enable_trace)
+ return;
+
+ va_start(ap, method);
+
+ fname = mono_method_full_name (method, TRUE);
+ indent (-1);
+ printf ("LEAVE: %s", fname);
+ g_free (fname);
+
+ type = method->signature->ret;
+
+handle_enum:
+ switch (type->type) {
+ case MONO_TYPE_VOID:
+ break;
+ case MONO_TYPE_BOOLEAN: {
+ int eax = va_arg (ap, int);
+ if (eax)
+ printf ("TRUE:%d", eax);
+ else
+ printf ("FALSE");
+
+ break;
+ }
+ case MONO_TYPE_CHAR:
+ case MONO_TYPE_I1:
+ case MONO_TYPE_U1:
+ case MONO_TYPE_I2:
+ case MONO_TYPE_U2:
+ case MONO_TYPE_I4:
+ case MONO_TYPE_U4:
+ case MONO_TYPE_I:
+ case MONO_TYPE_U: {
+ int eax = va_arg (ap, int);
+ printf ("result=%d", eax);
+ break;
+ }
+ case MONO_TYPE_STRING: {
+ MonoString *s = va_arg (ap, MonoString *);
+;
+ if (s) {
+ g_assert (((MonoObject *)s)->vtable->klass == mono_defaults.string_class);
+ printf ("[STRING:%p:%s]", s, mono_string_to_utf8 (s));
+ } else
+ printf ("[STRING:null], ");
+ break;
+ }
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT: {
+ MonoObject *o = va_arg (ap, MonoObject *);
+
+ if (o) {
+ if (o->vtable->klass == mono_defaults.boolean_class) {
+ printf ("[BOOLEAN:%p:%d]", o, *((guint8 *)o + sizeof (MonoObject)));
+ } else if (o->vtable->klass == mono_defaults.int32_class) {
+ printf ("[INT32:%p:%d]", o, *((gint32 *)((char *)o + sizeof (MonoObject))));
+ } else if (o->vtable->klass == mono_defaults.int64_class) {
+ printf ("[INT64:%p:%lld]", o, *((gint64 *)((char *)o + sizeof (MonoObject))));
+ } else
+ printf ("[%s.%s:%p]", o->vtable->klass->name_space, o->vtable->klass->name, o);
+ } else
+ printf ("[OBJECT:%p]", o);
+
+ break;
+ }
+ case MONO_TYPE_PTR:
+ case MONO_TYPE_FNPTR:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY: {
+ gpointer p = va_arg (ap, gpointer);
+ printf ("result=%p", p);
+ break;
+ }
+ case MONO_TYPE_I8: {
+ gint64 l = va_arg (ap, gint64);
+ printf ("lresult=0x%16llx", l);
+ break;
+ }
+ case MONO_TYPE_U8: {
+ gint64 l = va_arg (ap, gint64);
+ printf ("lresult=0x%16llx", l);
+ break;
+ }
+ case MONO_TYPE_R4:
+ case MONO_TYPE_R8: {
+ double f = va_arg (ap, double);
+ printf ("FP=%f\n", f);
+ break;
+ }
+ case MONO_TYPE_VALUETYPE:
+ if (type->data.klass->enumtype) {
+ type = type->data.klass->enum_basetype;
+ goto handle_enum;
+ } else {
+ guint8 *p = va_arg (ap, gpointer);
+ int j, size, align;
+ size = mono_type_size (type, &align);
+ printf ("[");
+ for (j = 0; p && j < size; j++)
+ printf ("%02x,", p [j]);
+ printf ("]");
+ }
+ break;
+ default:
+ printf ("(unknown return type %x)", method->signature->ret->type);
+ }
+
+ //printf (" ip: %p\n", __builtin_return_address (1));
+ printf ("\n");
+}
diff --git a/mono/mini/trace.h b/mono/mini/trace.h
new file mode 100644
index 00000000000..a7f884fb250
--- /dev/null
+++ b/mono/mini/trace.h
@@ -0,0 +1,32 @@
+#ifndef __MONO_TRACE_H__
+#define __MONO_TRACE_H__
+
+typedef enum {
+ MONO_TRACEOP_ALL,
+ MONO_TRACEOP_PROGRAM,
+ MONO_TRACEOP_METHOD,
+ MONO_TRACEOP_ASSEMBLY,
+ MONO_TRACEOP_CLASS,
+ MONO_TRACEOP_NAMESPACE
+} MonoTraceOpcode;
+
+typedef struct {
+ MonoTraceOpcode op;
+ int exclude;
+ void *data, *data2;
+} MonoTraceOperation;
+
+struct MonoTraceSpec {
+ int len;
+ MonoTraceOperation *ops;
+
+ MonoAssembly *assembly;
+};
+
+void
+mono_trace_enter_method (MonoMethod *method, char *ebp);
+
+void
+mono_trace_leave_method (MonoMethod *method, ...);
+
+#endif /* __MONO_TRACE_H__ */
diff --git a/mono/mini/tramp-amd64.c b/mono/mini/tramp-amd64.c
new file mode 100644
index 00000000000..a1479325ac7
--- /dev/null
+++ b/mono/mini/tramp-amd64.c
@@ -0,0 +1,491 @@
+/*
+ * tramp-x86.c: JIT trampoline code for x86
+ *
+ * Authors:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/arch/amd64/amd64-codegen.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
+
+#include "mini.h"
+#include "mini-amd64.h"
+
+typedef enum {
+ MONO_TRAMPOLINE_GENERIC,
+ MONO_TRAMPOLINE_JUMP,
+ MONO_TRAMPOLINE_CLASS_INIT
+} MonoTrampolineType;
+
+/*
+ * Address of the trampoline code. This is used by the debugger to check
+ * whether a method is a trampoline.
+ */
+guint8 *mono_generic_trampoline_code = NULL;
+
+/*
+ * AMD64 processors maintain icache coherency only for pages which are marked
+ * executable, so we have to alloc memory through a code manager.
+ */
+static CRITICAL_SECTION tramp_codeman_mutex;
+static MonoCodeManager *tramp_codeman;
+
+/*
+ * get_unbox_trampoline:
+ * @m: method pointer
+ * @addr: pointer to native code for @m
+ *
+ * when value type methods are called through the vtable we need to unbox the
+ * this argument. This method returns a pointer to a trampoline which does
+ * unboxing before calling the method
+ */
+static gpointer
+get_unbox_trampoline (MonoMethod *m, gpointer addr)
+{
+ guint8 *code, *start;
+ int this_reg = AMD64_RDI;
+ MonoDomain *domain = mono_domain_get ();
+
+ if (!m->signature->ret->byref && MONO_TYPE_ISSTRUCT (m->signature->ret))
+ this_reg = AMD64_RSI;
+
+ mono_domain_lock (domain);
+ start = code = mono_code_manager_reserve (domain->code_mp, 20);
+ mono_domain_unlock (domain);
+
+ amd64_alu_reg_imm (code, X86_ADD, this_reg, sizeof (MonoObject));
+ /* FIXME: Optimize this */
+ amd64_mov_reg_imm (code, AMD64_RAX, addr);
+ amd64_jump_reg (code, AMD64_RAX);
+ g_assert ((code - start) < 20);
+
+ mono_arch_flush_icache (start, code - start);
+
+ return start;
+}
+
+/**
+ * amd64_magic_trampoline:
+ */
+static gpointer
+amd64_magic_trampoline (long *regs, guint8 *code, MonoMethod *m, guint8* tramp)
+{
+ gpointer addr;
+ gpointer *vtable_slot;
+
+ addr = mono_compile_method (m);
+ g_assert (addr);
+
+ //printf ("ENTER: %s\n", mono_method_full_name (m, TRUE));
+
+ /* the method was jumped to */
+ if (!code)
+ return addr;
+
+ vtable_slot = mono_amd64_get_vcall_slot_addr (code, regs);
+
+ if (vtable_slot) {
+ if (m->klass->valuetype)
+ addr = get_unbox_trampoline (m, addr);
+
+ g_assert (*vtable_slot);
+
+ *vtable_slot = addr;
+ }
+ else {
+ /* Patch calling code */
+
+ if ((code [-13] == 0x49) && (code [-12] == 0xbb)) {
+ MonoJitInfo *ji =
+ mono_jit_info_table_find (mono_domain_get (), code);
+ MonoJitInfo *target_ji =
+ mono_jit_info_table_find (mono_domain_get (), addr);
+
+ if (mono_method_same_domain (ji, target_ji)) {
+ InterlockedExchangePointer ((gpointer*)(code - 11), addr);
+ }
+ }
+ else {
+ /* FIXME: handle more cases */
+ }
+
+ /* Patch trampoline */
+ /* FIXME: Make this thread safe */
+ if (!m->klass->valuetype) {
+ /*
+ * Valuetype method trampolines can't be patched since they are used for virtual
+ * calls which need an unbox trampoline.
+ */
+ amd64_mov_reg_imm (tramp, AMD64_R11, addr);
+ amd64_jump_reg (tramp, AMD64_R11);
+ }
+ }
+
+ return addr;
+}
+
+/**
+ * amd64_class_init_trampoline:
+ *
+ * This method calls mono_runtime_class_init () to run the static constructor
+ * for the type, then patches the caller code so it is not called again.
+ */
+static void
+amd64_class_init_trampoline (long *regs, guint8 *code, MonoVTable *vtable, guint8 *tramp)
+{
+ mono_runtime_class_init (vtable);
+
+ code -= 3;
+
+ if ((code [0] == 0x49) && (code [1] == 0xff)) {
+ if (!mono_running_on_valgrind ()) {
+ /* amd64_set_reg_template is 10 bytes long */
+ guint8* buf = code - 10;
+
+ /* FIXME: Make this thread safe */
+ /* Padding code suggested by the AMD64 Opt Manual */
+ buf [0] = 0x66;
+ buf [1] = 0x66;
+ buf [2] = 0x66;
+ buf [3] = 0x90;
+ buf [4] = 0x66;
+ buf [5] = 0x66;
+ buf [6] = 0x66;
+ buf [7] = 0x90;
+ buf [8] = 0x66;
+ buf [9] = 0x66;
+ buf [10] = 0x90;
+ buf [11] = 0x66;
+ buf [12] = 0x90;
+ }
+ }
+ else
+ if (code [0] == 0x90 || code [0] == 0xeb || code [0] == 0x66)
+ /* Already changed by another thread */
+ ;
+ else {
+ printf ("Invalid trampoline sequence: %x %x %x %x %x %x %x\n", code [0], code [1], code [2], code [3],
+ code [4], code [5], code [6]);
+ g_assert_not_reached ();
+ }
+}
+
+static guchar*
+create_trampoline_code (MonoTrampolineType tramp_type)
+{
+ guint8 *buf, *code, *tramp;
+ int i, lmf_offset, offset, method_offset, tramp_offset, saved_regs_offset, saved_fpregs_offset, framesize;
+ static guint8* generic_jump_trampoline = NULL;
+ static guint8 *generic_class_init_trampoline = NULL;
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ if (mono_generic_trampoline_code)
+ return mono_generic_trampoline_code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ if (generic_jump_trampoline)
+ return generic_jump_trampoline;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ if (generic_class_init_trampoline)
+ return generic_class_init_trampoline;
+ break;
+ }
+
+ EnterCriticalSection (&tramp_codeman_mutex);
+ code = buf = mono_code_manager_reserve (tramp_codeman, 512);
+ LeaveCriticalSection (&tramp_codeman_mutex);
+
+ framesize = 512 + sizeof (MonoLMF);
+ framesize = (framesize + (MONO_ARCH_FRAME_ALIGNMENT - 1)) & ~ (MONO_ARCH_FRAME_ALIGNMENT - 1);
+
+ offset = 0;
+
+ /*
+ * Allocate a new stack frame and transfer the two arguments received on
+ * the stack to our frame.
+ */
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_RSP, 8);
+ amd64_pop_reg (code, AMD64_R11);
+
+ amd64_push_reg (code, AMD64_RBP);
+ amd64_mov_reg_reg (code, AMD64_RBP, AMD64_RSP, 8);
+ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, framesize);
+
+ /*
+ * The method is at offset -8 from the new RBP, so no need to
+ * copy it.
+ */
+ offset += 8;
+ method_offset = - offset;
+
+ offset += 8;
+ tramp_offset = - offset;
+ amd64_mov_membase_reg (code, AMD64_RBP, tramp_offset, AMD64_R11, 8);
+
+ /* Save all registers */
+
+ offset += AMD64_NREG * 8;
+ saved_regs_offset = - offset;
+ for (i = 0; i < AMD64_NREG; ++i)
+ amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * 8), i, 8);
+ offset += 8 * 8;
+ saved_fpregs_offset = - offset;
+ for (i = 0; i < 8; ++i)
+ amd64_movsd_membase_reg (code, AMD64_RBP, saved_fpregs_offset + (i * 8), i);
+
+ /* Save LMF begin */
+
+ offset += sizeof (MonoLMF);
+ lmf_offset = - offset;
+
+ /* Save ip */
+ if (tramp_type == MONO_TRAMPOLINE_JUMP)
+ amd64_mov_reg_imm (code, AMD64_R11, 0);
+ else
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, 8, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, rip), AMD64_R11, 8);
+ /* Save fp */
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, ebp), AMD64_RBP, 8);
+ /* Save method */
+ if (tramp_type == MONO_TRAMPOLINE_GENERIC)
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, method_offset, 8);
+ else
+ amd64_mov_reg_imm (code, AMD64_R11, 0);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, method), AMD64_R11, 8);
+ /* Save callee saved regs */
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, rbx), AMD64_RBX, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r12), AMD64_R12, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r13), AMD64_R13, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r14), AMD64_R14, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, r15), AMD64_R15, 8);
+
+ amd64_mov_reg_imm (code, AMD64_R11, mono_get_lmf_addr);
+ amd64_call_reg (code, AMD64_R11);
+
+ /* Save lmf_addr */
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, lmf_addr), AMD64_RAX, 8);
+ /* Save previous_lmf */
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RAX, 0, 8);
+ amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, previous_lmf), AMD64_R11, 8);
+ /* Set new lmf */
+ amd64_lea_membase (code, AMD64_R11, AMD64_RBP, lmf_offset);
+ amd64_mov_membase_reg (code, AMD64_RAX, 0, AMD64_R11, 8);
+
+ /* Save LMF end */
+
+ /* Arg1 is the pointer to the saved registers */
+ amd64_lea_membase (code, AMD64_RDI, AMD64_RBP, saved_regs_offset);
+
+ /* Arg2 is the address of the calling code */
+ amd64_mov_reg_membase (code, AMD64_RSI, AMD64_RBP, 8, 8);
+
+ /* Arg3 is the method/vtable ptr */
+ amd64_mov_reg_membase (code, AMD64_RDX, AMD64_RBP, method_offset, 8);
+
+ /* Arg4 is the trampoline address */
+ amd64_mov_reg_membase (code, AMD64_RCX, AMD64_RBP, tramp_offset, 8);
+
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT)
+ tramp = (guint8*)amd64_class_init_trampoline;
+ else
+ tramp = (guint8*)amd64_magic_trampoline;
+
+ amd64_mov_reg_imm (code, AMD64_RAX, tramp);
+ amd64_call_reg (code, AMD64_RAX);
+
+ /* Restore LMF */
+
+ amd64_mov_reg_membase (code, AMD64_RCX, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, previous_lmf), 8);
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, lmf_offset + G_STRUCT_OFFSET (MonoLMF, lmf_addr), 8);
+ amd64_mov_membase_reg (code, AMD64_R11, 0, AMD64_RCX, 8);
+
+ /* Restore argument registers */
+ for (i = 0; i < AMD64_NREG; ++i)
+ if (AMD64_IS_ARGUMENT_REG (i))
+ amd64_mov_reg_membase (code, i, AMD64_RBP, saved_regs_offset + (i * 8), 8);
+
+ for (i = 0; i < 8; ++i)
+ amd64_movsd_reg_membase (code, i, AMD64_RBP, saved_fpregs_offset + (i * 8));
+
+ /* Restore stack */
+ amd64_leave (code);
+
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT)
+ amd64_ret (code);
+ else
+ /* call the compiled method */
+ amd64_jump_reg (code, X86_EAX);
+
+ g_assert ((code - buf) <= 512);
+
+ mono_arch_flush_icache (buf, code - buf);
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ mono_generic_trampoline_code = buf;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ generic_jump_trampoline = buf;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ generic_class_init_trampoline = buf;
+ break;
+ }
+
+ return buf;
+}
+
+#define TRAMPOLINE_SIZE 34
+
+static MonoJitInfo*
+create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain)
+{
+ MonoJitInfo *ji;
+ guint8 *code, *buf, *tramp;
+
+ tramp = create_trampoline_code (tramp_type);
+
+ mono_domain_lock (domain);
+ code = buf = mono_code_manager_reserve (domain->code_mp, TRAMPOLINE_SIZE);
+ mono_domain_unlock (domain);
+
+ /* push trampoline address */
+ amd64_lea_membase (code, AMD64_R11, AMD64_RIP, -7);
+ amd64_push_reg (code, AMD64_R11);
+
+ /* push argument */
+ amd64_mov_reg_imm (code, AMD64_R11, arg1);
+ amd64_push_reg (code, AMD64_R11);
+
+ /* FIXME: Optimize this */
+ amd64_mov_reg_imm (code, AMD64_R11, tramp);
+ amd64_jump_reg (code, AMD64_R11);
+
+ g_assert ((code - buf) <= TRAMPOLINE_SIZE);
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->code_start = buf;
+ ji->code_size = code - buf;
+
+ mono_jit_stats.method_trampolines++;
+
+ mono_arch_flush_icache (ji->code_start, ji->code_size);
+
+ return ji;
+}
+
+MonoJitInfo*
+mono_arch_create_jump_trampoline (MonoMethod *method)
+{
+ MonoJitInfo *ji = create_specific_trampoline (method, MONO_TRAMPOLINE_JUMP, mono_domain_get ());
+
+ ji->method = method;
+ return ji;
+}
+
+/**
+ * mono_arch_create_jit_trampoline:
+ * @method: pointer to the method info
+ *
+ * Creates a trampoline function for virtual methods. If the created
+ * code is called it first starts JIT compilation of method,
+ * and then calls the newly created method. I also replaces the
+ * corresponding vtable entry (see amd64_magic_trampoline).
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_jit_trampoline (MonoMethod *method)
+{
+ MonoJitInfo *ji;
+ gpointer code_start;
+
+ ji = create_specific_trampoline (method, MONO_TRAMPOLINE_GENERIC, mono_domain_get ());
+ code_start = ji->code_start;
+ g_free (ji);
+
+ return code_start;
+}
+
+/**
+ * mono_arch_create_class_init_trampoline:
+ * @vtable: the type to initialize
+ *
+ * Creates a trampoline function to run a type initializer.
+ * If the trampoline is called, it calls mono_runtime_class_init with the
+ * given vtable, then patches the caller code so it does not get called any
+ * more.
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_class_init_trampoline (MonoVTable *vtable)
+{
+ MonoJitInfo *ji;
+ gpointer code;
+
+ ji = create_specific_trampoline (vtable, MONO_TRAMPOLINE_CLASS_INIT, vtable->domain);
+ code = ji->code_start;
+ g_free (ji);
+
+ return code;
+}
+
+void
+mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
+{
+ /* FIXME: This is not thread safe */
+ guint8 *code = ji->code_start;
+
+ amd64_mov_reg_imm (code, AMD64_RDI, func_arg);
+ amd64_mov_reg_imm (code, AMD64_R11, func);
+
+ x86_push_imm (code, (guint64)func_arg);
+ amd64_call_reg (code, AMD64_R11);
+}
+
+/*
+ * This method is only called when running in the Mono Debugger.
+ */
+gpointer
+mono_debugger_create_notification_function (gpointer *notification_address)
+{
+ guint8 *ptr, *buf;
+
+ EnterCriticalSection (&tramp_codeman_mutex);
+ ptr = buf = mono_code_manager_reserve (tramp_codeman, 16);
+ LeaveCriticalSection (&tramp_codeman_mutex);
+
+ x86_breakpoint (buf);
+ if (notification_address)
+ *notification_address = buf;
+ x86_ret (buf);
+
+ return ptr;
+}
+
+void
+mono_amd64_tramp_init (void)
+{
+ InitializeCriticalSection (&tramp_codeman_mutex);
+
+ tramp_codeman = mono_code_manager_new ();
+
+ create_trampoline_code (MONO_TRAMPOLINE_GENERIC);
+ create_trampoline_code (MONO_TRAMPOLINE_JUMP);
+ create_trampoline_code (MONO_TRAMPOLINE_CLASS_INIT);
+}
diff --git a/mono/mini/tramp-ppc.c b/mono/mini/tramp-ppc.c
new file mode 100644
index 00000000000..24fc71b6e9a
--- /dev/null
+++ b/mono/mini/tramp-ppc.c
@@ -0,0 +1,573 @@
+/*
+ * tramp-ppc.c: JIT trampoline code for PowerPC
+ *
+ * Authors:
+ * Dietmar Maurer (dietmar@ximian.com)
+ * Paolo Molaro (lupus@ximian.com)
+ * Carlos Valiente <yo@virutass.net>
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/arch/ppc/ppc-codegen.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#include "mini.h"
+#include "mini-ppc.h"
+
+typedef enum {
+ MONO_TRAMPOLINE_GENERIC,
+ MONO_TRAMPOLINE_JUMP,
+ MONO_TRAMPOLINE_CLASS_INIT
+} MonoTrampolineType;
+
+/* adapt to mini later... */
+#define mono_jit_share_code (1)
+
+/*
+ * Address of the x86 trampoline code. This is used by the debugger to check
+ * whether a method is a trampoline.
+ */
+guint8 *mono_generic_trampoline_code = NULL;
+
+/*
+ * get_unbox_trampoline:
+ * @m: method pointer
+ * @addr: pointer to native code for @m
+ *
+ * when value type methods are called through the vtable we need to unbox the
+ * this argument. This method returns a pointer to a trampoline which does
+ * unboxing before calling the method
+ */
+static gpointer
+get_unbox_trampoline (MonoMethod *m, gpointer addr)
+{
+ guint8 *code, *start;
+ int this_pos = 3;
+
+ if (!m->signature->ret->byref && MONO_TYPE_ISSTRUCT (m->signature->ret))
+ this_pos = 4;
+
+ start = code = g_malloc (20);
+
+ ppc_load (code, ppc_r0, addr);
+ ppc_mtctr (code, ppc_r0);
+ ppc_addi (code, this_pos, this_pos, sizeof (MonoObject));
+ ppc_bcctr (code, 20, 0);
+ mono_arch_flush_icache (start, code - start);
+ g_assert ((code - start) <= 20);
+ /*g_print ("unbox trampoline at %d for %s:%s\n", this_pos, m->klass->name, m->name);
+ g_print ("unbox code is at %p for method at %p\n", start, addr);*/
+
+ return start;
+}
+
+/* Stack size for trampoline function
+ * PPC_MINIMAL_STACK_SIZE + 16 (args + alignment to ppc_magic_trampoline)
+ * + MonoLMF + 14 fp regs + 13 gregs + alignment
+ * #define STACK (PPC_MINIMAL_STACK_SIZE + 4 * sizeof (gulong) + sizeof (MonoLMF) + 14 * sizeof (double) + 13 * (sizeof (gulong)))
+ * STACK would be 444 for 32 bit darwin
+ */
+#define STACK (448)
+
+/* Method-specific trampoline code fragment size */
+#define METHOD_TRAMPOLINE_SIZE 64
+
+/* Jump-specific trampoline code fragment size */
+#define JUMP_TRAMPOLINE_SIZE 64
+
+/**
+ * ppc_magic_trampoline:
+ * @code: pointer into caller code
+ * @method: the method to translate
+ * @sp: stack pointer
+ *
+ * This method is called by the function 'arch_create_jit_trampoline', which in
+ * turn is called by the trampoline functions for virtual methods.
+ * After having called the JIT compiler to compile the method, it inspects the
+ * caller code to find the address of the method-specific part of the
+ * trampoline vtable slot for this method, updates it with a fragment that calls
+ * the newly compiled code and returns this address of the compiled code to
+ * 'arch_create_jit_trampoline'
+ */
+static gpointer
+ppc_magic_trampoline (MonoMethod *method, guint32 *code, char *sp)
+{
+ char *o = NULL;
+ gpointer addr;
+ int reg, offset = 0;
+
+ addr = mono_compile_method(method);
+ /*g_print ("method code at %p for %s:%s\n", addr, method->klass->name, method->name);*/
+ g_assert(addr);
+
+ if (!code){
+ return addr;
+ }
+
+ /* Locate the address of the method-specific trampoline. The call using
+ the vtable slot that took the processing flow to 'arch_create_jit_trampoline'
+ looks something like this:
+
+ mtlr rA ; Move rA (a register containing the
+ ; target address) to LR
+ blrl ; Call function at LR
+
+ PowerPC instructions are 32-bit long, which means that a 32-bit target
+ address cannot be encoded as an immediate value (because we already
+ have spent some bits to encode the branch instruction!). That's why a
+ 'b'ranch to the contents of the 'l'ink 'r'egister (with 'l'ink register
+ update) is needed, instead of a simpler 'branch immediate'. This
+ complicates our purpose here, because 'blrl' overwrites LR, which holds
+ the value we're interested in.
+
+ Therefore, we need to locate the 'mtlr rA' instruction to know which
+ register LR was loaded from, and then retrieve the value from that
+ register */
+
+ /* This is the 'blrl' instruction */
+ --code;
+
+ /*
+ * Note that methods are called also with the bl opcode.
+ */
+ if (((*code) >> 26) == 18) {
+ /*g_print ("direct patching\n");*/
+ ppc_patch ((char*)code, addr);
+ mono_arch_flush_icache ((char*)code, 4);
+ return addr;
+ }
+
+ /* Sanity check: instruction must be 'blrl' */
+ g_assert(*code == 0x4e800021);
+
+ /* OK, we're now at the 'blrl' instruction. Now walk backwards
+ till we get to a 'mtlr rA' */
+ for(; --code;) {
+ if((*code & 0x7c0803a6) == 0x7c0803a6) {
+ gint16 soff;
+ gint reg_offset;
+ /* Here we are: we reached the 'mtlr rA'.
+ Extract the register from the instruction */
+ reg = (*code & 0x03e00000) >> 21;
+ --code;
+ /* ok, this is a lwz reg, offset (vtreg)
+ * it is emitted with:
+ * ppc_emit32 (c, (32 << 26) | ((D) << 21) | ((a) << 16) | (guint16)(d))
+ */
+ soff = (*code & 0xffff);
+ offset = soff;
+ reg = (*code >> 16) & 0x1f;
+ g_assert (reg != ppc_r1);
+ /*g_print ("patching reg is %d\n", reg);*/
+ if (reg >= 13) {
+ /* saved in the MonoLMF structure */
+ reg_offset = STACK - sizeof (MonoLMF) + G_STRUCT_OFFSET (MonoLMF, iregs);
+ reg_offset += (reg - 13) * sizeof (gulong);
+ } else {
+ /* saved in the stack, see frame diagram below */
+ reg_offset = STACK - sizeof (MonoLMF) - (14 * sizeof (double)) - (13 * sizeof (gulong));
+ reg_offset += reg * sizeof (gulong);
+ }
+ /* o contains now the value of register reg */
+ o = *((char**) (sp + reg_offset));
+ break;
+ }
+ }
+
+ /* this is not done for non-virtual calls, because in that case
+ we won't have an object, but the actual pointer to the
+ valuetype as the this argument
+ */
+ if (method->klass->valuetype)
+ addr = get_unbox_trampoline (method, addr);
+
+ o += offset;
+ *((gpointer *)o) = addr;
+ return addr;
+}
+
+static void
+ppc_class_init_trampoline (void *vtable, guint32 *code, char *sp)
+{
+ mono_runtime_class_init (vtable);
+
+#if 0
+ /* This is the 'bl' instruction */
+ --code;
+
+ if (((*code) >> 26) == 18) {
+ ppc_ori (code, 0, 0, 0); /* nop */
+ mono_arch_flush_icache (code, 4);
+ return;
+ } else {
+ g_assert_not_reached ();
+ }
+#endif
+}
+
+/*
+ * Stack frame description when the generic trampoline is called.
+ * caller frame
+ * --------------------
+ * MonoLMF
+ * -------------------
+ * Saved FP registers 0-13
+ * -------------------
+ * Saved general registers 0-12
+ * -------------------
+ * param area for 3 args to ppc_magic_trampoline
+ * -------------------
+ * linkage area
+ * -------------------
+ */
+static guchar*
+create_trampoline_code (MonoTrampolineType tramp_type)
+{
+ guint8 *buf, *code = NULL;
+ static guint8* generic_jump_trampoline = NULL;
+ static guint8 *generic_class_init_trampoline = NULL;
+ int i, offset;
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ if (mono_generic_trampoline_code)
+ return mono_generic_trampoline_code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ if (generic_jump_trampoline)
+ return generic_jump_trampoline;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ if (generic_class_init_trampoline)
+ return generic_class_init_trampoline;
+ break;
+ }
+
+ if(!code) {
+ /* Now we'll create in 'buf' the PowerPC trampoline code. This
+ is the trampoline code common to all methods */
+
+ code = buf = g_malloc(512);
+
+ ppc_stwu (buf, ppc_r1, -STACK, ppc_r1);
+
+ /* start building the MonoLMF on the stack */
+ offset = STACK - sizeof (double) * MONO_SAVED_FREGS;
+ for (i = 14; i < 32; i++) {
+ ppc_stfd (buf, i, offset, ppc_r1);
+ offset += sizeof (double);
+ }
+ /*
+ * now the integer registers. r13 is already saved in the trampoline,
+ * and at this point contains the method to compile, so we skip it.
+ */
+ offset = STACK - sizeof (MonoLMF) + G_STRUCT_OFFSET (MonoLMF, iregs) + sizeof (gulong);
+ ppc_stmw (buf, ppc_r14, ppc_r1, offset);
+
+ /* Now save the rest of the registers below the MonoLMF struct, first 14
+ * fp regs and then the 13 gregs.
+ */
+ offset = STACK - sizeof (MonoLMF) - (14 * sizeof (double));
+ for (i = 0; i < 14; i++) {
+ ppc_stfd (buf, i, offset, ppc_r1);
+ offset += sizeof (double);
+ }
+ offset = STACK - sizeof (MonoLMF) - (14 * sizeof (double)) - (13 * sizeof (gulong));
+ for (i = 0; i < 13; i++) {
+ ppc_stw (buf, i, offset, ppc_r1);
+ offset += sizeof (gulong);
+ }
+ /* we got here through a jump to the ctr reg, we must save the lr
+ * in the parent frame (we do it here to reduce the size of the
+ * method-specific trampoline)
+ */
+ ppc_mflr (buf, ppc_r0);
+ ppc_stw (buf, ppc_r0, STACK + PPC_RET_ADDR_OFFSET, ppc_r1);
+
+ /* ok, now we can continue with the MonoLMF setup, mostly untouched
+ * from emit_prolog in mini-ppc.c
+ */
+ ppc_load (buf, ppc_r0, mono_get_lmf_addr);
+ ppc_mtlr (buf, ppc_r0);
+ ppc_blrl (buf);
+ /* we build the MonoLMF structure on the stack - see mini-ppc.h
+ * The pointer to the struct is put in ppc_r11.
+ */
+ ppc_addi (buf, ppc_r11, ppc_sp, STACK - sizeof (MonoLMF));
+ ppc_stw (buf, ppc_r3, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11);
+ /* new_lmf->previous_lmf = *lmf_addr */
+ ppc_lwz (buf, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3);
+ ppc_stw (buf, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11);
+ /* *(lmf_addr) = r11 */
+ ppc_stw (buf, ppc_r11, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3);
+ /* save method info (it's in r13) */
+ ppc_stw (buf, ppc_r13, G_STRUCT_OFFSET(MonoLMF, method), ppc_r11);
+ ppc_stw (buf, ppc_sp, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r11);
+ /* save the IP (caller ip) */
+ if (tramp_type == MONO_TRAMPOLINE_JUMP) {
+ ppc_li (buf, ppc_r0, 0);
+ } else {
+ ppc_lwz (buf, ppc_r0, STACK + PPC_RET_ADDR_OFFSET, ppc_r1);
+ }
+ ppc_stw (buf, ppc_r0, G_STRUCT_OFFSET(MonoLMF, eip), ppc_r11);
+
+ /*
+ * Now we're ready to call ppc_magic_trampoline ().
+ */
+ /* Arg 1: MonoMethod *method. It was put in r13 */
+ ppc_mr (buf, ppc_r3, ppc_r13);
+
+ /* Arg 2: code (next address to the instruction that called us) */
+ if (tramp_type == MONO_TRAMPOLINE_JUMP) {
+ ppc_li (buf, ppc_r4, 0);
+ } else {
+ ppc_lwz (buf, ppc_r4, STACK + PPC_RET_ADDR_OFFSET, ppc_r1);
+ }
+
+ /* Arg 3: stack pointer so that the magic trampoline can access the
+ * registers we saved above
+ */
+ ppc_mr (buf, ppc_r5, ppc_r1);
+
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT) {
+ ppc_lis (buf, ppc_r0, (guint32) ppc_class_init_trampoline >> 16);
+ ppc_ori (buf, ppc_r0, ppc_r0, (guint32) ppc_class_init_trampoline & 0xffff);
+ } else {
+ ppc_lis (buf, ppc_r0, (guint32) ppc_magic_trampoline >> 16);
+ ppc_ori (buf, ppc_r0, ppc_r0, (guint32) ppc_magic_trampoline & 0xffff);
+ }
+ ppc_mtlr (buf, ppc_r0);
+ ppc_blrl (buf);
+
+ /* OK, code address is now on r3. Move it to the counter reg
+ * so it will be ready for the final jump: this is safe since we
+ * won't do any more calls.
+ */
+ ppc_mtctr (buf, ppc_r3);
+
+ /*
+ * Now we restore the MonoLMF (see emit_epilogue in mini-ppc.c)
+ * and the rest of the registers, so the method called will see
+ * the same state as before we executed.
+ * The pointer to MonoLMF is in ppc_r11.
+ */
+ ppc_addi (buf, ppc_r11, ppc_r1, STACK - sizeof (MonoLMF));
+ /* r5 = previous_lmf */
+ ppc_lwz (buf, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11);
+ /* r6 = lmf_addr */
+ ppc_lwz (buf, ppc_r6, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11);
+ /* *(lmf_addr) = previous_lmf */
+ ppc_stw (buf, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r6);
+ /* restore iregs: this time include r13 */
+ ppc_lmw (buf, ppc_r13, ppc_r11, G_STRUCT_OFFSET(MonoLMF, iregs));
+ /* restore fregs */
+ for (i = 14; i < 32; i++) {
+ ppc_lfd (buf, i, G_STRUCT_OFFSET(MonoLMF, fregs) + ((i-14) * sizeof (gdouble)), ppc_r11);
+ }
+
+ /* restore the volatile registers, we skip r1, of course */
+ offset = STACK - sizeof (MonoLMF) - (14 * sizeof (double));
+ for (i = 0; i < 14; i++) {
+ ppc_lfd (buf, i, offset, ppc_r1);
+ offset += sizeof (double);
+ }
+ offset = STACK - sizeof (MonoLMF) - (14 * sizeof (double)) - (13 * sizeof (gulong));
+ ppc_lwz (buf, ppc_r0, offset, ppc_r1);
+ offset += 2 * sizeof (gulong);
+ for (i = 2; i < 13; i++) {
+ ppc_lwz (buf, i, offset, ppc_r1);
+ offset += sizeof (gulong);
+ }
+
+ /* Non-standard function epilogue. Instead of doing a proper
+ * return, we just hump to the compiled code.
+ */
+ /* Restore stack pointer and LR and jump to the code */
+ ppc_lwz (buf, ppc_r1, 0, ppc_r1);
+ ppc_lwz (buf, ppc_r11, PPC_RET_ADDR_OFFSET, ppc_r1);
+ ppc_mtlr (buf, ppc_r11);
+ ppc_bcctr (buf, 20, 0);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= 512);
+ }
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ mono_generic_trampoline_code = code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ generic_jump_trampoline = code;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ generic_class_init_trampoline = code;
+ break;
+ }
+
+ return code;
+}
+
+static MonoJitInfo*
+create_specific_tramp (MonoMethod *method, guint8* tramp, MonoDomain *domain) {
+ guint8 *code, *buf;
+ MonoJitInfo *ji;
+
+ mono_domain_lock (domain);
+ code = buf = mono_code_manager_reserve (domain->code_mp, 32);
+ mono_domain_unlock (domain);
+
+ /* Save r13 in the place it will have in the on-stack MonoLMF */
+ ppc_stw (buf, ppc_r13, -(MONO_SAVED_FREGS * 8 + MONO_SAVED_GREGS * sizeof (gpointer)), ppc_r1);
+
+ /* Prepare the jump to the generic trampoline code.*/
+ ppc_lis (buf, ppc_r13, (guint32) tramp >> 16);
+ ppc_ori (buf, ppc_r13, ppc_r13, (guint32) tramp & 0xffff);
+ ppc_mtctr (buf, ppc_r13);
+
+ /* And finally put 'method' in r13 and fly! */
+ ppc_lis (buf, ppc_r13, (guint32) method >> 16);
+ ppc_ori (buf, ppc_r13, ppc_r13, (guint32) method & 0xffff);
+ ppc_bcctr (buf, 20, 0);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ g_assert ((buf - code) <= 32);
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_start = code;
+ ji->code_size = buf - code;
+
+ mono_jit_stats.method_trampolines++;
+
+ return ji;
+}
+
+MonoJitInfo*
+mono_arch_create_jump_trampoline (MonoMethod *method)
+{
+ guint8 *tramp;
+ MonoDomain* domain = mono_domain_get ();
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_JUMP);
+ return create_specific_tramp (method, tramp, domain);
+}
+
+/**
+ * arch_create_jit_trampoline:
+ * @method: pointer to the method info
+ *
+ * Creates a trampoline function for virtual methods. If the created
+ * code is called it first starts JIT compilation of method,
+ * and then calls the newly created method. It also replaces the
+ * corresponding vtable entry (see ppc_magic_trampoline).
+ *
+ * A trampoline consists of two parts: a main fragment, shared by all method
+ * trampolines, and some code specific to each method, which hard-codes a
+ * reference to that method and then calls the main fragment.
+ *
+ * The main fragment contains a call to 'ppc_magic_trampoline', which performs
+ * call to the JIT compiler and substitutes the method-specific fragment with
+ * some code that directly calls the JIT-compiled method.
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_jit_trampoline (MonoMethod *method)
+{
+ guint8 *tramp;
+ MonoJitInfo *ji;
+ MonoDomain* domain = mono_domain_get ();
+ gpointer code_start;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_GENERIC);
+ /* FIXME: should pass the domain down to this function */
+ ji = create_specific_tramp (method, tramp, domain);
+ code_start = ji->code_start;
+ g_free (ji);
+
+ return code_start;
+}
+
+/**
+ * mono_arch_create_class_init_trampoline:
+ * @vtable: the type to initialize
+ *
+ * Creates a trampoline function to run a type initializer.
+ * If the trampoline is called, it calls mono_runtime_class_init with the
+ * given vtable, then patches the caller code so it does not get called any
+ * more.
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_class_init_trampoline (MonoVTable *vtable)
+{
+ guint8 *code, *buf, *tramp;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_CLASS_INIT);
+
+ /* This is the method-specific part of the trampoline. Its purpose is
+ to provide the generic part with the MonoMethod *method pointer. We'll
+ use r11 to keep that value, for instance. However, the generic part of
+ the trampoline relies on r11 having the same value it had before coming
+ here, so we must save it before. */
+ //code = buf = g_malloc(METHOD_TRAMPOLINE_SIZE);
+ mono_domain_lock (vtable->domain);
+ code = buf = mono_code_manager_reserve (vtable->domain->code_mp, METHOD_TRAMPOLINE_SIZE);
+ mono_domain_unlock (vtable->domain);
+
+ ppc_mflr (buf, ppc_r4);
+ ppc_stw (buf, ppc_r4, PPC_RET_ADDR_OFFSET, ppc_sp);
+ ppc_stwu (buf, ppc_sp, -64, ppc_sp);
+ ppc_load (buf, ppc_r3, vtable);
+ ppc_load (buf, ppc_r5, 0);
+
+ ppc_load (buf, ppc_r0, ppc_class_init_trampoline);
+ ppc_mtlr (buf, ppc_r0);
+ ppc_blrl (buf);
+
+ ppc_lwz (buf, ppc_r0, 64 + PPC_RET_ADDR_OFFSET, ppc_sp);
+ ppc_mtlr (buf, ppc_r0);
+ ppc_addic (buf, ppc_sp, ppc_sp, 64);
+ ppc_blr (buf);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= METHOD_TRAMPOLINE_SIZE);
+
+ mono_jit_stats.method_trampolines++;
+
+ return code;
+}
+
+/*
+ * This method is only called when running in the Mono Debugger.
+ */
+gpointer
+mono_debugger_create_notification_function (gpointer *notification_address)
+{
+ guint8 *ptr, *buf;
+
+ ptr = buf = g_malloc0 (16);
+ ppc_break (buf);
+ if (notification_address)
+ *notification_address = buf;
+ ppc_blr (buf);
+
+ return ptr;
+}
+
diff --git a/mono/mini/tramp-s390.c b/mono/mini/tramp-s390.c
new file mode 100644
index 00000000000..23ca8b3268a
--- /dev/null
+++ b/mono/mini/tramp-s390.c
@@ -0,0 +1,606 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - tramp-s390.c */
+/* */
+/* Function - JIT trampoline code for S/390. */
+/* */
+/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
+/* */
+/* Date - January, 2004 */
+/* */
+/* Derivation - From exceptions-x86 & exceptions-ppc */
+/* Paolo Molaro (lupus@ximian.com) */
+/* Dietmar Maurer (dietmar@ximian.com) */
+/* */
+/* Copyright - 2001 Ximian, Inc. */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define GR_SAVE_SIZE 4*sizeof(long)
+#define FP_SAVE_SIZE 16*sizeof(double)
+#define CREATE_STACK_SIZE (S390_MINIMAL_STACK_SIZE+GR_SAVE_SIZE+FP_SAVE_SIZE+2*sizeof(long))
+#define CREATE_GR_OFFSET S390_MINIMAL_STACK_SIZE
+#define CREATE_FP_OFFSET CREATE_GR_OFFSET+GR_SAVE_SIZE
+#define CREATE_LMF_OFFSET CREATE_FP_OFFSET+FP_SAVE_SIZE
+#define METHOD_SAVE_OFFSET S390_RET_ADDR_OFFSET-4
+
+/*------------------------------------------------------------------*/
+/* adapt to mini later... */
+/*------------------------------------------------------------------*/
+#define mono_jit_share_code (1)
+
+/*------------------------------------------------------------------*/
+/* Method-specific trampoline code fragment sizes */
+/*------------------------------------------------------------------*/
+#define METHOD_TRAMPOLINE_SIZE 64
+#define JUMP_TRAMPOLINE_SIZE 64
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/arch/s390/s390-codegen.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#include "mini.h"
+#include "mini-s390.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+typedef enum {
+ MONO_TRAMPOLINE_GENERIC,
+ MONO_TRAMPOLINE_JUMP,
+ MONO_TRAMPOLINE_CLASS_INIT
+} MonoTrampolineType;
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* P r o t o t y p e s */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* Address of the generic trampoline code. This is used by the */
+/* debugger to check whether a method is a trampoline. */
+/*------------------------------------------------------------------*/
+guint8 *mono_generic_trampoline_code = NULL;
+
+/*========================= End of Prototypes ======================*/
+
+/*------------------------------------------------------------------*/
+/* G l o b a l V a r i a b l e s */
+/*------------------------------------------------------------------*/
+
+
+/*====================== End of Global Variables ===================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_unbox_trampoline */
+/* */
+/* Function - Return a pointer to a trampoline which does the */
+/* unboxing before calling the method. */
+/* */
+/* When value type methods are called through the */
+/* vtable we need to unbox the 'this' argument. */
+/* */
+/* Parameters - method - Methd pointer */
+/* addr - Pointer to native code for method */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+get_unbox_trampoline (MonoMethod *method, gpointer addr)
+{
+ guint8 *code, *start;
+ int this_pos = s390_r2;
+
+ start = addr;
+ if ((method->klass->valuetype)) {
+// if ((method->klass->valuetype) &&
+// (method->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
+ if ((!method->signature->ret->byref) &&
+ (MONO_TYPE_ISSTRUCT (method->signature->ret)))
+ this_pos = s390_r3;
+
+ start = code = g_malloc (28);
+
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 4);
+ s390_word (code, addr);
+ s390_l (code, s390_r1, 0, s390_r13, 4);
+ s390_ahi (code, this_pos, sizeof(MonoObject));
+ s390_br (code, s390_r1);
+
+ g_assert ((code - start) <= 28);
+ }
+
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - s390_magic_trampoline */
+/* */
+/* Function - This method is called by the function */
+/* "arch_create_jit_trampoline", which in turn is */
+/* called by the trampoline functions for virtual */
+/* methods. After having called the JIT compiler to */
+/* compile the method, it inspects the caller code */
+/* to find the address of the method-specific part */
+/* of the trampoline vtable slot for this method, */
+/* updates it with a fragment that calls the newly */
+/* compiled code and returns this address. The calls */
+/* generated by mono for S/390 will look like either:*/
+/* 1. l %r1,xxx(%rx) */
+/* bras %r14,%r1 */
+/* 2. brasl %r14,xxxxxx */
+/* */
+/* Parameters - code - Pointer into caller code */
+/* method - The method to compile */
+/* sp - Stack pointer */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+s390_magic_trampoline (MonoMethod *method, guchar *code, char *sp)
+{
+ gpointer addr;
+ gint32 displace;
+ int reg, base;
+ unsigned short opcode;
+ char *fname;
+ MonoJitInfo *codeJi,
+ *addrJi;
+
+ addr = mono_compile_method(method);
+ g_assert(addr);
+
+
+ if (code) {
+
+ /* The top bit needs to be ignored on S/390 */
+ (guint32) code &= 0x7fffffff;
+
+ fname = mono_method_full_name (method, TRUE);
+ codeJi = mono_jit_info_table_find (mono_domain_get(), code);
+ addrJi = mono_jit_info_table_find (mono_domain_get(), addr);
+
+ opcode = *((unsigned short *) (code - 6));
+ switch (opcode) {
+ case 0x5810 :
+ /* This is a bras r14,r1 instruction */
+ code -= 4;
+ reg = *code >> 4;
+ displace = *((short *)code) & 0x0fff;
+ if (reg > 5)
+ base = *((int *) (sp + S390_REG_SAVE_OFFSET+
+ sizeof(int)*(reg-6)));
+ else
+ base = *((int *) (sp + CREATE_GR_OFFSET+
+ sizeof(int)*(reg-2)));
+ addr = get_unbox_trampoline(method, addr);
+ if (mono_method_same_domain (codeJi, addrJi)) {
+ code = base + displace;
+ s390_patch(code, addr);
+ }
+ break;
+ case 0xc0e5 :
+ /* This is the 'brasl' instruction */
+ code -= 4;
+ displace = ((gint32) addr - (gint32) (code - 2)) / 2;
+ if (mono_method_same_domain (codeJi, addrJi)) {
+ s390_patch (code, displace);
+ mono_arch_flush_icache (code, 4);
+ }
+ break;
+ default :
+ g_error("Unable to patch instruction prior to %p",code);
+ }
+ }
+
+
+ return addr;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - s390_class_init_trampoline */
+/* */
+/* Function - Initialize a class and then no-op the call to */
+/* the trampoline. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+s390_class_init_trampoline (void *vtable, guchar *code, char *sp)
+{
+ char patch[6] = {0x47, 0x00, 0x00, 0x00, 0x07, 0x00};
+
+ mono_runtime_class_init (vtable);
+
+ code = code - 6;
+
+ memcpy(code, patch, sizeof(patch));
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_trampoline_code */
+/* */
+/* Function - Create the designated type of trampoline according*/
+/* to the 'tramp_type' parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+static guchar*
+create_trampoline_code (MonoTrampolineType tramp_type)
+{
+
+ guint8 *buf, *code = NULL;
+ static guint8* generic_jump_trampoline = NULL;
+ static guint8 *generic_class_init_trampoline = NULL;
+ int i, offset;
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ if (mono_generic_trampoline_code)
+ return mono_generic_trampoline_code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ if (generic_jump_trampoline)
+ return generic_jump_trampoline;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ if (generic_class_init_trampoline)
+ return generic_class_init_trampoline;
+ break;
+ }
+
+ if(!code) {
+ /* Now we'll create in 'buf' the S/390 trampoline code. This
+ is the trampoline code common to all methods */
+
+ code = buf = g_malloc(512);
+
+ /*-----------------------------------------------------------
+ STEP 0: First create a non-standard function prologue with a
+ stack size big enough to save our registers.
+ -----------------------------------------------------------*/
+
+ s390_stm (buf, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_lr (buf, s390_r11, s390_r15);
+ s390_ahi (buf, STK_BASE, -CREATE_STACK_SIZE);
+ s390_st (buf, s390_r11, 0, STK_BASE, 0);
+ s390_stm (buf, s390_r2, s390_r5, STK_BASE, CREATE_GR_OFFSET);
+
+ /* Save the FP registers */
+ offset = CREATE_FP_OFFSET;
+ for (i = s390_f0; i <= s390_f15; ++i) {
+ s390_std (buf, i, 0, STK_BASE, offset);
+ offset += 8;
+ }
+
+ /*----------------------------------------------------------
+ STEP 1: call 'mono_get_lmf_addr()' to get the address of our
+ LMF. We'll need to restore it after the call to
+ 's390_magic_trampoline' and before the call to the native
+ method.
+ ----------------------------------------------------------*/
+
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 4);
+ s390_word (buf, mono_get_lmf_addr);
+ s390_l (buf, s390_r1, 0, s390_r13, 4);
+ s390_basr (buf, s390_r14, s390_r1);
+
+ /* XXX Update LMF !!! */
+
+ /*----------------------------------------------------------
+ STEP 2: call 's390_magic_trampoline()', who will compile the
+ code and fix the method vtable entry for us
+ ----------------------------------------------------------*/
+
+ /* Set arguments */
+
+ /* Arg 1: MonoMethod *method. It was put in r11 by the
+ method-specific trampoline code, and then saved before the call
+ to mono_get_lmf_addr()'. Restore r13, by the way :-) */
+ s390_l (buf, s390_r2, 0, s390_r11, METHOD_SAVE_OFFSET);
+
+ /* Arg 2: code (next address to the instruction that called us) */
+ if (tramp_type == MONO_TRAMPOLINE_JUMP) {
+ s390_lhi (buf, s390_r3, 0);
+ } else {
+ s390_l (buf, s390_r3, 0, s390_r11, S390_RET_ADDR_OFFSET);
+ }
+
+ /* Arg 3: stack pointer */
+ s390_lr (buf, s390_r4, STK_BASE);
+
+ /* Calculate call address and call
+ 's390_magic_trampoline'. Return value will be in r2 */
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 4);
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT) {
+ s390_word (buf, s390_class_init_trampoline);
+ } else {
+ s390_word (buf, s390_magic_trampoline);
+ }
+ s390_l (buf, s390_r1, 0, s390_r13, 4);
+ s390_basr (buf, s390_r14, s390_r1);
+
+ /* OK, code address is now on r2. Move it to r1, so that we
+ can restore r2 and use it from r1 later */
+ s390_lr (buf, s390_r1, s390_r2);
+
+
+ /*----------------------------------------------------------
+ STEP 3: Restore the LMF
+ ----------------------------------------------------------*/
+
+ /* XXX Do it !!! */
+
+ /*----------------------------------------------------------
+ STEP 4: call the compiled method
+ ----------------------------------------------------------*/
+
+ /* Restore registers */
+
+ s390_lm (buf, s390_r2, s390_r5, STK_BASE, CREATE_GR_OFFSET);
+
+ /* Restore the FP registers */
+ offset = CREATE_FP_OFFSET;
+ for (i = s390_f0; i <= s390_f15; ++i) {
+ s390_ld (buf, i, 0, STK_BASE, offset);
+ offset += 8;
+ }
+
+ /* Restore stack pointer and jump to the code -
+ R14 contains the return address to our caller */
+ s390_lr (buf, STK_BASE, s390_r11);
+ s390_lm (buf, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (buf, s390_r1);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= 512);
+ }
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ mono_generic_trampoline_code = code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ generic_jump_trampoline = code;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ generic_class_init_trampoline = code;
+ break;
+ }
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_jump_trampoline */
+/* */
+/* Function - Create the designated type of trampoline according*/
+/* to the 'tramp_type' parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoJitInfo *
+mono_arch_create_jump_trampoline (MonoMethod *method)
+{
+ guint8 *code, *buf, *tramp = NULL;
+ MonoJitInfo *ji;
+ MonoDomain *domain = mono_domain_get();
+ gint32 displace;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_JUMP);
+
+ mono_domain_lock (domain);
+ code = buf = mono_code_manager_reserve (domain->code_mp, METHOD_TRAMPOLINE_SIZE);
+ mono_domain_unlock (domain);
+
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 4);
+ s390_word (buf, method);
+ s390_l (buf, s390_r13, 0, s390_r13, 4);
+ displace = (tramp - buf) / 2;
+ s390_jcl (buf, S390_CC_UN, displace);
+
+ mono_arch_flush_icache (code, buf-code);
+
+ g_assert ((buf - code) <= JUMP_TRAMPOLINE_SIZE);
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_start = code;
+ ji->code_size = buf - code;
+
+ mono_jit_stats.method_trampolines++;
+
+ return ji;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_jit_trampoline */
+/* */
+/* Function - Creates a trampoline function for virtual methods.*/
+/* If the created code is called it first starts JIT */
+/* compilation and then calls the newly created */
+/* method. It also replaces the corresponding vtable */
+/* entry (see s390_magic_trampoline). */
+/* */
+/* A trampoline consists of two parts: a main */
+/* fragment, shared by all method trampolines, and */
+/* and some code specific to each method, which */
+/* hard-codes a reference to that method and then */
+/* calls the main fragment. */
+/* */
+/* The main fragment contains a call to */
+/* 's390_magic_trampoline', which performs a call */
+/* to the JIT compiler and substitutes the method- */
+/* specific fragment with some code that directly */
+/* calls the JIT-compiled method. */
+/* */
+/* Parameter - method - Pointer to the method information */
+/* */
+/* Returns - A pointer to the newly created code */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_create_jit_trampoline (MonoMethod *method)
+{
+ guint8 *code, *buf;
+ static guint8 *vc = NULL;
+ gint32 displace;
+
+ vc = create_trampoline_code (MONO_TRAMPOLINE_GENERIC);
+
+ /* This is the method-specific part of the trampoline. Its purpose is
+ to provide the generic part with the MonoMethod *method pointer. We'll
+ use r13 to keep that value, for instance. However, the generic part of
+ the trampoline relies on r11 having the same value it had before coming
+ here, so we must save it before. */
+ code = buf = g_malloc(METHOD_TRAMPOLINE_SIZE);
+
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 4);
+ s390_word (buf, method);
+ s390_l (buf, s390_r13, 0, s390_r13, 4);
+ displace = (vc - buf) / 2;
+ s390_jcl (buf, S390_CC_UN, displace);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= METHOD_TRAMPOLINE_SIZE);
+
+ mono_jit_stats.method_trampolines++;
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_class_init_trampoline */
+/* */
+/* Function - Creates a trampoline function to run a type init- */
+/* ializer. If the trampoline is called, it calls */
+/* mono_runtime_class_init with the given vtable, */
+/* then patches the caller code so it does not get */
+/* called any more. */
+/* */
+/* Parameter - vtable - The type to initialize */
+/* */
+/* Returns - A pointer to the newly created code */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_create_class_init_trampoline (MonoVTable *vtable)
+{
+ guint8 *code, *buf, *tramp;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_CLASS_INIT);
+
+ /* This is the method-specific part of the trampoline. Its purpose is
+ to provide the generic part with the MonoMethod *method pointer. We'll
+ use r11 to keep that value, for instance. However, the generic part of
+ the trampoline relies on r11 having the same value it had before coming
+ here, so we must save it before. */
+ code = buf = g_malloc(METHOD_TRAMPOLINE_SIZE);
+
+ s390_st (buf, s390_r14, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_ahi (buf, STK_BASE, -S390_MINIMAL_STACK_SIZE);
+
+ s390_basr (buf, s390_r1, 0);
+ s390_j (buf, 6);
+ s390_word (buf, vtable);
+ s390_word (buf, s390_class_init_trampoline);
+ s390_lr (buf, s390_r3, s390_r14);
+ s390_l (buf, s390_r2, 0, s390_r1, 4);
+ s390_lhi (buf, s390_r4, 0);
+ s390_l (buf, s390_r1, 0, s390_r1, 8);
+ s390_basr (buf, s390_r14, s390_r1);
+
+ s390_ahi (buf, STK_BASE, S390_MINIMAL_STACK_SIZE);
+ s390_l (buf, s390_r14, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_br (buf, s390_r14);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= METHOD_TRAMPOLINE_SIZE);
+
+ mono_jit_stats.method_trampolines++;
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_debuger_create_notification_function */
+/* */
+/* Function - This method is only called when running in the */
+/* Mono debugger. It returns a pointer to the */
+/* arch specific notification function. */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_debugger_create_notification_function (gpointer *notification_address)
+{
+ guint8 *ptr, *buf;
+
+ ptr = buf = g_malloc0 (16);
+ s390_break (buf);
+ if (notification_address)
+ *notification_address = buf;
+ s390_br (buf, s390_r14);
+
+ return ptr;
+}
+
+/*========================= End of Function ========================*/
diff --git a/mono/mini/tramp-s390x.c b/mono/mini/tramp-s390x.c
new file mode 100644
index 00000000000..3b91fbe8087
--- /dev/null
+++ b/mono/mini/tramp-s390x.c
@@ -0,0 +1,587 @@
+/*------------------------------------------------------------------*/
+/* */
+/* Name - tramp-s390.c */
+/* */
+/* Function - JIT trampoline code for S/390. */
+/* */
+/* Name - Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com) */
+/* */
+/* Date - January, 2004 */
+/* */
+/* Derivation - From exceptions-x86 & exceptions-ppc */
+/* Paolo Molaro (lupus@ximian.com) */
+/* Dietmar Maurer (dietmar@ximian.com) */
+/* */
+/* Copyright - 2001 Ximian, Inc. */
+/* */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* D e f i n e s */
+/*------------------------------------------------------------------*/
+
+#define GR_SAVE_SIZE 4*sizeof(long)
+#define FP_SAVE_SIZE 16*sizeof(double)
+#define CREATE_STACK_SIZE (S390_MINIMAL_STACK_SIZE+GR_SAVE_SIZE+FP_SAVE_SIZE+2*sizeof(long))
+#define CREATE_GR_OFFSET S390_MINIMAL_STACK_SIZE
+#define CREATE_FP_OFFSET CREATE_GR_OFFSET+GR_SAVE_SIZE
+#define CREATE_LMF_OFFSET CREATE_FP_OFFSET+FP_SAVE_SIZE
+#define METHOD_SAVE_OFFSET S390_RET_ADDR_OFFSET-8
+
+/*------------------------------------------------------------------*/
+/* adapt to mini later... */
+/*------------------------------------------------------------------*/
+#define mono_jit_share_code (1)
+
+/*------------------------------------------------------------------*/
+/* Method-specific trampoline code fragment sizes */
+/*------------------------------------------------------------------*/
+#define METHOD_TRAMPOLINE_SIZE 64
+#define JUMP_TRAMPOLINE_SIZE 64
+
+/*========================= End of Defines =========================*/
+
+/*------------------------------------------------------------------*/
+/* I n c l u d e s */
+/*------------------------------------------------------------------*/
+
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/arch/s390x/s390x-codegen.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#include "mini.h"
+#include "mini-s390x.h"
+
+/*========================= End of Includes ========================*/
+
+/*------------------------------------------------------------------*/
+/* T y p e d e f s */
+/*------------------------------------------------------------------*/
+
+typedef enum {
+ MONO_TRAMPOLINE_GENERIC,
+ MONO_TRAMPOLINE_JUMP,
+ MONO_TRAMPOLINE_CLASS_INIT
+} MonoTrampolineType;
+
+/*========================= End of Typedefs ========================*/
+
+/*------------------------------------------------------------------*/
+/* P r o t o t y p e s */
+/*------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------*/
+/* Address of the generic trampoline code. This is used by the */
+/* debugger to check whether a method is a trampoline. */
+/*------------------------------------------------------------------*/
+guint8 *mono_generic_trampoline_code = NULL;
+
+/*========================= End of Prototypes ======================*/
+
+/*------------------------------------------------------------------*/
+/* G l o b a l V a r i a b l e s */
+/*------------------------------------------------------------------*/
+
+
+/*====================== End of Global Variables ===================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - get_unbox_trampoline */
+/* */
+/* Function - Return a pointer to a trampoline which does the */
+/* unboxing before calling the method. */
+/* */
+/* When value type methods are called through the */
+/* vtable we need to unbox the 'this' argument. */
+/* */
+/* Parameters - method - Methd pointer */
+/* addr - Pointer to native code for method */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+get_unbox_trampoline (MonoMethod *method, gpointer addr)
+{
+ guint8 *code, *start;
+ int this_pos = s390_r2;
+
+ start = addr;
+ if ((method->klass->valuetype)) {
+ if ((!method->signature->ret->byref) &&
+ (MONO_TYPE_ISSTRUCT (method->signature->ret)))
+ this_pos = s390_r3;
+
+ start = code = g_malloc (28);
+
+ s390_basr (code, s390_r13, 0);
+ s390_j (code, 6);
+ s390_llong(code, addr);
+ s390_lg (code, s390_r1, 0, s390_r13, 4);
+ s390_aghi (code, this_pos, sizeof(MonoObject));
+ s390_br (code, s390_r1);
+
+ g_assert ((code - start) <= 28);
+ }
+
+ return start;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - s390_magic_trampoline */
+/* */
+/* Function - This method is called by the function */
+/* "arch_create_jit_trampoline", which in turn is */
+/* called by the trampoline functions for virtual */
+/* methods. After having called the JIT compiler to */
+/* compile the method, it inspects the caller code */
+/* to find the address of the method-specific part */
+/* of the trampoline vtable slot for this method, */
+/* updates it with a fragment that calls the newly */
+/* compiled code and returns this address. The calls */
+/* generated by mono for S/390 will look like either:*/
+/* 1. l %r1,xxx(%rx) */
+/* bras %r14,%r1 */
+/* 2. brasl %r14,xxxxxx */
+/* */
+/* Parameters - code - Pointer into caller code */
+/* method - The method to compile */
+/* sp - Stack pointer */
+/* */
+/*------------------------------------------------------------------*/
+
+static gpointer
+s390_magic_trampoline (MonoMethod *method, guchar *code, char *sp)
+{
+ gpointer addr;
+ guint32 displace;
+ gint64 base;
+ int reg;
+ unsigned short opcode;
+ char *fname;
+
+ addr = mono_compile_method(method);
+ g_assert(addr);
+
+ if (code) {
+
+ fname = mono_method_full_name (method, TRUE);
+
+ opcode = *((unsigned short *) (code - 6));
+ if (opcode == 0xc0e5) {
+ /* This is the 'brasl' instruction */
+ code -= 4;
+ displace = ((gint64) addr - (gint64) (code - 2)) / 2;
+ s390_patch (code, displace);
+ mono_arch_flush_icache (code, 4);
+ } else {
+ /* This is a bras rx,r1 instruction */
+ code -= 6;
+ reg = *code >> 4;
+ displace = ((*(char *)(code+2) << 8) |
+ (*((short *)code) & 0x0fff));
+ if (reg > 5)
+ base = *((gint64 *) (sp + S390_REG_SAVE_OFFSET+
+ sizeof(gint64)*(reg-6)));
+ else
+ base = *((gint64 *) (sp + CREATE_GR_OFFSET+
+ sizeof(gint64)*(reg-2)));
+ addr = get_unbox_trampoline(method, addr);
+ code = base + displace;
+ *((guint64 *) (code)) = addr;
+ }
+ }
+
+
+ return addr;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - s390_class_init_trampoline */
+/* */
+/* Function - Initialize a class and then no-op the call to */
+/* the trampoline. */
+/* */
+/*------------------------------------------------------------------*/
+
+static void
+s390_class_init_trampoline (void *vtable, guchar *code, char *sp)
+{
+ char patch[6] = {0x47, 0x00, 0x00, 0x00, 0x07, 0x00};
+
+ mono_runtime_class_init (vtable);
+
+ code = code - 6;
+
+ memcpy(code, patch, sizeof(patch));
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - create_trampoline_code */
+/* */
+/* Function - Create the designated type of trampoline according*/
+/* to the 'tramp_type' parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+static guchar*
+create_trampoline_code (MonoTrampolineType tramp_type)
+{
+
+ guint8 *buf, *code = NULL;
+ static guint8* generic_jump_trampoline = NULL;
+ static guint8 *generic_class_init_trampoline = NULL;
+ int i, offset;
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ if (mono_generic_trampoline_code)
+ return mono_generic_trampoline_code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ if (generic_jump_trampoline)
+ return generic_jump_trampoline;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ if (generic_class_init_trampoline)
+ return generic_class_init_trampoline;
+ break;
+ }
+
+ if(!code) {
+ /* Now we'll create in 'buf' the S/390 trampoline code. This
+ is the trampoline code common to all methods */
+
+ code = buf = g_malloc(512);
+
+ /*-----------------------------------------------------------
+ STEP 0: First create a non-standard function prologue with a
+ stack size big enough to save our registers.
+ -----------------------------------------------------------*/
+
+ s390_stmg (buf, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_lgr (buf, s390_r11, s390_r15);
+ s390_aghi (buf, STK_BASE, -CREATE_STACK_SIZE);
+ s390_stg (buf, s390_r11, 0, STK_BASE, 0);
+ s390_stmg (buf, s390_r2, s390_r5, STK_BASE, CREATE_GR_OFFSET);
+
+ /* Save the FP registers */
+ offset = CREATE_FP_OFFSET;
+ for (i = s390_f0; i <= s390_f15; ++i) {
+ s390_std (buf, i, 0, STK_BASE, offset);
+ offset += 8;
+ }
+
+ /*----------------------------------------------------------
+ STEP 1: call 'mono_get_lmf_addr()' to get the address of our
+ LMF. We'll need to restore it after the call to
+ 's390_magic_trampoline' and before the call to the native
+ method.
+ ----------------------------------------------------------*/
+
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 6);
+ s390_llong(buf, mono_get_lmf_addr);
+ s390_lg (buf, s390_r1, 0, s390_r13, 4);
+ s390_basr (buf, s390_r14, s390_r1);
+
+ /*----------------------------------------------------------
+ STEP 2: call 's390_magic_trampoline()', who will compile the
+ code and fix the method vtable entry for us
+ ----------------------------------------------------------*/
+
+ /* Set arguments */
+
+ /* Arg 1: MonoMethod *method. It was put in r11 by the
+ method-specific trampoline code, and then saved before the call
+ to mono_get_lmf_addr()'. Restore r13, by the way :-) */
+ s390_lg (buf, s390_r2, 0, s390_r11, METHOD_SAVE_OFFSET);
+
+ /* Arg 2: code (next address to the instruction that called us) */
+ if (tramp_type == MONO_TRAMPOLINE_JUMP) {
+ s390_lghi (buf, s390_r3, 0);
+ } else {
+ s390_lg (buf, s390_r3, 0, s390_r11, S390_RET_ADDR_OFFSET);
+ }
+
+ /* Arg 3: stack pointer */
+ s390_lgr (buf, s390_r4, STK_BASE);
+
+ /* Calculate call address and call
+ 's390_magic_trampoline'. Return value will be in r2 */
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 6);
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT) {
+ s390_llong(buf, s390_class_init_trampoline);
+ } else {
+ s390_llong(buf, s390_magic_trampoline);
+ }
+ s390_lg (buf, s390_r1, 0, s390_r13, 4);
+ s390_basr (buf, s390_r14, s390_r1);
+
+ /* OK, code address is now on r2. Move it to r1, so that we
+ can restore r2 and use it from r1 later */
+ s390_lgr (buf, s390_r1, s390_r2);
+
+
+ /*----------------------------------------------------------
+ STEP 3: Restore the LMF
+ ----------------------------------------------------------*/
+
+ /* XXX Do it !!! */
+
+ /*----------------------------------------------------------
+ STEP 4: call the compiled method
+ ----------------------------------------------------------*/
+
+ /* Restore registers */
+
+ s390_lmg (buf, s390_r2, s390_r5, STK_BASE, CREATE_GR_OFFSET);
+
+ /* Restore the FP registers */
+ offset = CREATE_FP_OFFSET;
+ for (i = s390_f0; i <= s390_f15; ++i) {
+ s390_ld (buf, i, 0, STK_BASE, offset);
+ offset += 8;
+ }
+
+ /* Restore stack pointer and jump to the code -
+ R14 contains the return address to our caller */
+ s390_lgr (buf, STK_BASE, s390_r11);
+ s390_lmg (buf, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET);
+ s390_br (buf, s390_r1);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= 512);
+ }
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ mono_generic_trampoline_code = code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ generic_jump_trampoline = code;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ generic_class_init_trampoline = code;
+ break;
+ }
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_jump_trampoline */
+/* */
+/* Function - Create the designated type of trampoline according*/
+/* to the 'tramp_type' parameter. */
+/* */
+/*------------------------------------------------------------------*/
+
+MonoJitInfo *
+mono_arch_create_jump_trampoline (MonoMethod *method)
+{
+ guint8 *code, *buf, *tramp = NULL;
+ MonoJitInfo *ji;
+ MonoDomain *domain = mono_domain_get();
+ gint32 displace;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_JUMP);
+
+ mono_domain_lock (domain);
+ code = buf = mono_code_manager_reserve (domain->code_mp, METHOD_TRAMPOLINE_SIZE);
+ mono_domain_unlock (domain);
+
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 6);
+ s390_llong(buf, method);
+ s390_lg (buf, s390_r13, 0, s390_r13, 4);
+ displace = (tramp - buf) / 2;
+ s390_jcl (buf, S390_CC_UN, displace);
+
+ mono_arch_flush_icache (code, buf-code);
+
+ g_assert ((buf - code) <= JUMP_TRAMPOLINE_SIZE);
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_start = code;
+ ji->code_size = buf - code;
+
+ mono_jit_stats.method_trampolines++;
+
+ return ji;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_jit_trampoline */
+/* */
+/* Function - Creates a trampoline function for virtual methods.*/
+/* If the created code is called it first starts JIT */
+/* compilation and then calls the newly created */
+/* method. It also replaces the corresponding vtable */
+/* entry (see s390_magic_trampoline). */
+/* */
+/* A trampoline consists of two parts: a main */
+/* fragment, shared by all method trampolines, and */
+/* and some code specific to each method, which */
+/* hard-codes a reference to that method and then */
+/* calls the main fragment. */
+/* */
+/* The main fragment contains a call to */
+/* 's390_magic_trampoline', which performs a call */
+/* to the JIT compiler and substitutes the method- */
+/* specific fragment with some code that directly */
+/* calls the JIT-compiled method. */
+/* */
+/* Parameter - method - Pointer to the method information */
+/* */
+/* Returns - A pointer to the newly created code */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_create_jit_trampoline (MonoMethod *method)
+{
+ guint8 *code, *buf;
+ static guint8 *vc = NULL;
+ gint32 displace;
+
+ vc = create_trampoline_code (MONO_TRAMPOLINE_GENERIC);
+
+ /* This is the method-specific part of the trampoline. Its purpose is
+ to provide the generic part with the MonoMethod *method pointer. We'll
+ use r13 to keep that value, for instance. However, the generic part of
+ the trampoline relies on r11 having the same value it had before coming
+ here, so we must save it before. */
+ code = buf = g_malloc(METHOD_TRAMPOLINE_SIZE);
+
+ s390_basr (buf, s390_r13, 0);
+ s390_j (buf, 6);
+ s390_llong(buf, method);
+ s390_lg (buf, s390_r13, 0, s390_r13, 4);
+ displace = (vc - buf) / 2;
+ s390_jcl (buf, S390_CC_UN, displace);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= METHOD_TRAMPOLINE_SIZE);
+
+ mono_jit_stats.method_trampolines++;
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_create_class_init_trampoline */
+/* */
+/* Function - Creates a trampoline function to run a type init- */
+/* ializer. If the trampoline is called, it calls */
+/* mono_runtime_class_init with the given vtable, */
+/* then patches the caller code so it does not get */
+/* called any more. */
+/* */
+/* Parameter - vtable - The type to initialize */
+/* */
+/* Returns - A pointer to the newly created code */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_create_class_init_trampoline (MonoVTable *vtable)
+{
+ guint8 *code, *buf, *tramp;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_CLASS_INIT);
+
+ /* This is the method-specific part of the trampoline. Its purpose is
+ to provide the generic part with the MonoMethod *method pointer. We'll
+ use r11 to keep that value, for instance. However, the generic part of
+ the trampoline relies on r11 having the same value it had before coming
+ here, so we must save it before. */
+ code = buf = g_malloc(METHOD_TRAMPOLINE_SIZE);
+
+ s390_stg (buf, s390_r14, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_aghi (buf, STK_BASE, -S390_MINIMAL_STACK_SIZE);
+
+ s390_basr (buf, s390_r1, 0);
+ s390_j (buf, 6);
+ s390_llong(buf, vtable);
+ s390_llong(buf, s390_class_init_trampoline);
+ s390_lgr (buf, s390_r3, s390_r14);
+ s390_lg (buf, s390_r2, 0, s390_r1, 4);
+ s390_lghi (buf, s390_r4, 0);
+ s390_lg (buf, s390_r1, 0, s390_r1, 8);
+ s390_basr (buf, s390_r14, s390_r1);
+
+ s390_aghi (buf, STK_BASE, S390_MINIMAL_STACK_SIZE);
+ s390_lg (buf, s390_r14, 0, STK_BASE, S390_RET_ADDR_OFFSET);
+ s390_br (buf, s390_r14);
+
+ /* Flush instruction cache, since we've generated code */
+ mono_arch_flush_icache (code, buf - code);
+
+ /* Sanity check */
+ g_assert ((buf - code) <= METHOD_TRAMPOLINE_SIZE);
+
+ mono_jit_stats.method_trampolines++;
+
+ return code;
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_debuger_create_notification_function */
+/* */
+/* Function - This method is only called when running in the */
+/* Mono debugger. It returns a pointer to the */
+/* arch specific notification function. */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_debugger_create_notification_function (gpointer *notification_address)
+{
+ guint8 *ptr, *buf;
+
+ ptr = buf = g_malloc0 (16);
+ s390_break (buf);
+ if (notification_address)
+ *notification_address = buf;
+ s390_br (buf, s390_r14);
+
+ return ptr;
+}
+
+/*========================= End of Function ========================*/
diff --git a/mono/mini/tramp-sparc.c b/mono/mini/tramp-sparc.c
new file mode 100644
index 00000000000..33402621f00
--- /dev/null
+++ b/mono/mini/tramp-sparc.c
@@ -0,0 +1,386 @@
+/*
+ * tramp-sparc.c: JIT trampoline code for Sparc 64
+ *
+ * Authors:
+ * Mark Crichton (crichton@gimp.org)
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/arch/sparc/sparc-codegen.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#include "mini.h"
+#include "mini-sparc.h"
+
+typedef enum {
+ MONO_TRAMPOLINE_GENERIC,
+ MONO_TRAMPOLINE_JUMP,
+ MONO_TRAMPOLINE_CLASS_INIT
+} MonoTrampolineType;
+
+/* adapt to mini later... */
+#define mono_jit_share_code (1)
+
+/*
+ * Address of the Sparc trampoline code. This is used by the debugger to check
+ * whether a method is a trampoline.
+ */
+guint8 *mono_generic_trampoline_code = NULL;
+
+/*
+ * get_unbox_trampoline:
+ * @m: method pointer
+ * @addr: pointer to native code for @m
+ *
+ * when value type methods are called through the vtable we need to unbox the
+ * this argument. This method returns a pointer to a trampoline which does
+ * unboxing before calling the method
+ */
+static gpointer
+get_unbox_trampoline (MonoMethod *m, gpointer addr)
+{
+ guint8 *code, *start;
+ int this_pos = 4, reg;
+
+ if (!m->signature->ret->byref && MONO_TYPE_ISSTRUCT (m->signature->ret))
+ this_pos = 8;
+
+ start = code = g_malloc (36);
+
+ /* This executes in the context of the caller, hence o0 */
+ sparc_add_imm (code, 0, sparc_o0, sizeof (MonoObject), sparc_o0);
+#ifdef SPARCV9
+ reg = sparc_g4;
+#else
+ reg = sparc_g1;
+#endif
+ sparc_set (code, addr, reg);
+ sparc_jmpl (code, reg, sparc_g0, sparc_g0);
+ sparc_nop (code);
+
+ g_assert ((code - start) <= 36);
+
+ mono_arch_flush_icache (start, code - start);
+
+ return start;
+}
+
+/**
+ * sparc_magic_trampoline:
+ * @m: the method to translate
+ * @code: the address of the call instruction
+ * @fp: address of the stack frame for the caller
+ *
+ * This method is called by the trampoline functions for methods. It calls the
+ * JIT compiler to compile the method, then patches the calling instruction so
+ * further calls will bypass the trampoline. For virtual methods, it finds the
+ * address of the vtable slot and updates it.
+ */
+static gpointer
+sparc_magic_trampoline (MonoMethod *m, guint32 *code, guint32 *fp)
+{
+ gpointer addr;
+ gpointer *vtable_slot;
+
+ addr = mono_compile_method (m);
+ g_assert (addr);
+
+ /*
+ * Check whenever this is a virtual call, and call an unbox trampoline if
+ * needed.
+ */
+ if (mono_sparc_is_virtual_call (code)) {
+ if (m->klass->valuetype)
+ addr = get_unbox_trampoline (m, addr);
+
+ /* Compute address of vtable slot */
+ vtable_slot = mono_sparc_get_vcall_slot_addr (code, fp);
+ *vtable_slot = addr;
+ }
+ else {
+ /* Patch calling code */
+ if (sparc_inst_op (*code) == 0x1) {
+ MonoJitInfo *ji =
+ mono_jit_info_table_find (mono_domain_get (), code);
+ MonoJitInfo *target_ji =
+ mono_jit_info_table_find (mono_domain_get (), addr);
+
+ if (mono_method_same_domain (ji, target_ji)) {
+ sparc_call_simple (code, (guint8*)addr - (guint8*)code);
+ }
+ }
+ }
+
+ return addr;
+}
+
+static void
+sparc_class_init_trampoline (MonoVTable *vtable, guint32 *code)
+{
+ mono_runtime_class_init (vtable);
+
+ /* Patch calling code */
+ sparc_nop (code);
+}
+
+#define ALIGN_TO(val,align) (((val) + ((align) - 1)) & ~((align) - 1))
+
+static guchar*
+create_trampoline_code (MonoTrampolineType tramp_type)
+{
+ guint8 *buf, *code, *tramp_addr;
+ guint32 lmf_offset, method_reg, i;
+ static guint8* generic_jump_trampoline = NULL;
+ static guint8 *generic_class_init_trampoline = NULL;
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ if (mono_generic_trampoline_code)
+ return mono_generic_trampoline_code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ if (generic_jump_trampoline)
+ return generic_jump_trampoline;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ if (generic_class_init_trampoline)
+ return generic_class_init_trampoline;
+ break;
+ }
+
+ code = buf = g_malloc (512);
+
+ sparc_save_imm (code, sparc_sp, -608, sparc_sp);
+
+#ifdef SPARCV9
+ method_reg = sparc_g4;
+#else
+ method_reg = sparc_g1;
+#endif
+
+#ifdef SPARCV9
+ /* Save fp regs since they are not preserved by calls */
+ for (i = 0; i < 16; i ++)
+ sparc_stdf_imm (code, sparc_f0 + (i * 2), sparc_sp, MONO_SPARC_STACK_BIAS + 320 + (i * 8));
+#endif
+
+ /* We receive the method address in %r1, so save it here */
+ sparc_sti_imm (code, method_reg, sparc_sp, MONO_SPARC_STACK_BIAS + 200);
+
+ /* Save lmf since compilation can raise exceptions */
+ lmf_offset = MONO_SPARC_STACK_BIAS - sizeof (MonoLMF);
+
+ /* Save the data for the parent (managed) frame */
+
+ /* Save ip */
+ sparc_sti_imm (code, sparc_i7, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, ip));
+ /* Save sp */
+ sparc_sti_imm (code, sparc_fp, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, sp));
+ /* Save fp */
+ /* Load previous fp from the saved register window */
+ sparc_flushw (code);
+ sparc_ldi_imm (code, sparc_fp, MONO_SPARC_STACK_BIAS + (sparc_i6 - 16) * sizeof (gpointer), sparc_o7);
+ sparc_sti_imm (code, sparc_o7, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, ebp));
+ /* Save method */
+ sparc_sti_imm (code, method_reg, sparc_fp, lmf_offset + G_STRUCT_OFFSET (MonoLMF, method));
+
+ sparc_set (code, mono_get_lmf_addr, sparc_o7);
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_o7);
+ sparc_nop (code);
+
+ code = mono_sparc_emit_save_lmf (code, lmf_offset);
+
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT)
+ tramp_addr = &sparc_class_init_trampoline;
+ else
+ tramp_addr = &sparc_magic_trampoline;
+ sparc_ldi_imm (code, sparc_sp, MONO_SPARC_STACK_BIAS + 200, sparc_o0);
+ /* pass parent frame address as third argument */
+ sparc_mov_reg_reg (code, sparc_fp, sparc_o2);
+ sparc_set (code, tramp_addr, sparc_o7);
+ /* set %o1 to caller address */
+ sparc_mov_reg_reg (code, sparc_i7, sparc_o1);
+ sparc_jmpl (code, sparc_o7, sparc_g0, sparc_o7);
+ sparc_nop (code);
+
+ /* Save result */
+ sparc_sti_imm (code, sparc_o0, sparc_sp, MONO_SPARC_STACK_BIAS + 304);
+
+ /* Restore lmf */
+ code = mono_sparc_emit_restore_lmf (code, lmf_offset);
+
+ /* Reload result */
+ sparc_ldi_imm (code, sparc_sp, MONO_SPARC_STACK_BIAS + 304, sparc_o0);
+
+#ifdef SPARCV9
+ /* Reload fp regs */
+ for (i = 0; i < 16; i ++)
+ sparc_lddf_imm (code, sparc_sp, MONO_SPARC_STACK_BIAS + 320 + (i * 8), sparc_f0 + (i * 2));
+#endif
+
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT)
+ sparc_ret (code);
+ else
+ sparc_jmpl (code, sparc_o0, sparc_g0, sparc_g0);
+
+ /* restore previous frame in delay slot */
+ sparc_restore_simple (code);
+
+/*
+{
+ gpointer addr;
+
+ sparc_save_imm (code, sparc_sp, -608, sparc_sp);
+ addr = code;
+ sparc_call_simple (code, 16);
+ sparc_nop (code);
+ sparc_rett_simple (code);
+ sparc_nop (code);
+
+ sparc_save_imm (code, sparc_sp, -608, sparc_sp);
+ sparc_ta (code, 1);
+ tramp_addr = &sparc_magic_trampoline;
+ sparc_call_simple (code, tramp_addr - code);
+ sparc_nop (code);
+ sparc_rett_simple (code);
+ sparc_nop (code);
+}
+*/
+
+ g_assert ((code - buf) <= 512);
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ mono_generic_trampoline_code = buf;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ generic_jump_trampoline = buf;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ generic_class_init_trampoline = buf;
+ break;
+ }
+
+ mono_arch_flush_icache (buf, code - buf);
+
+ return buf;
+}
+
+#define TRAMPOLINE_SIZE (((SPARC_SET_MAX_SIZE >> 2) * 2) + 2)
+
+static MonoJitInfo*
+create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoDomain *domain)
+{
+ MonoJitInfo *ji;
+ guint32 *code, *buf, *tramp;
+
+ tramp = create_trampoline_code (tramp_type);
+
+ mono_domain_lock (domain);
+ code = buf = mono_code_manager_reserve (domain->code_mp, TRAMPOLINE_SIZE * 4);
+ mono_domain_unlock (domain);
+
+ /* We have to use g5 here because there is no other free register */
+ sparc_set (code, tramp, sparc_g5);
+#ifdef SPARCV9
+ sparc_set (code, arg1, sparc_g4);
+#else
+ sparc_set (code, arg1, sparc_g1);
+#endif
+ sparc_jmpl (code, sparc_g5, sparc_g0, sparc_g0);
+ sparc_nop (code);
+
+ g_assert ((code - buf) <= TRAMPOLINE_SIZE);
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->code_start = buf;
+ ji->code_size = (code - buf) * 4;
+
+ mono_jit_stats.method_trampolines++;
+
+ mono_arch_flush_icache (ji->code_start, ji->code_size);
+
+ return ji;
+}
+
+MonoJitInfo*
+mono_arch_create_jump_trampoline (MonoMethod *method)
+{
+ MonoJitInfo *ji = create_specific_trampoline (method, MONO_TRAMPOLINE_JUMP, mono_domain_get ());
+
+ ji->method = method;
+ return ji;
+}
+
+/**
+ * mono_arch_create_jit_trampoline:
+ * @method: pointer to the method info
+ *
+ * Creates a trampoline function for virtual methods. If the created
+ * code is called it first starts JIT compilation of method,
+ * and then calls the newly created method. I also replaces the
+ * corresponding vtable entry (see sparc_magic_trampoline).
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_jit_trampoline (MonoMethod *method)
+{
+ MonoJitInfo *ji;
+ gpointer code_start;
+
+ ji = create_specific_trampoline (method, MONO_TRAMPOLINE_GENERIC, mono_domain_get ());
+ code_start = ji->code_start;
+ g_free (ji);
+
+ return code_start;
+}
+
+/**
+ * mono_arch_create_class_init_trampoline:
+ * @vtable: the type to initialize
+ *
+ * Creates a trampoline function to run a type initializer.
+ * If the trampoline is called, it calls mono_runtime_class_init with the
+ * given vtable, then patches the caller code so it does not get called any
+ * more.
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_class_init_trampoline (MonoVTable *vtable)
+{
+ MonoJitInfo *ji;
+ gpointer code;
+
+ ji = create_specific_trampoline (vtable, MONO_TRAMPOLINE_CLASS_INIT, vtable->domain);
+ code = ji->code_start;
+ g_free (ji);
+
+ return code;
+}
+
+/*
+ * This method is only called when running in the Mono Debugger.
+ */
+gpointer
+mono_debugger_create_notification_function (gpointer *notification_address)
+{
+ guint8 *ptr, *buf;
+
+ ptr = buf = g_malloc0 (16);
+ if (notification_address)
+ *notification_address = buf;
+
+ g_assert_not_reached ();
+
+ return ptr;
+}
diff --git a/mono/mini/tramp-x86.c b/mono/mini/tramp-x86.c
new file mode 100644
index 00000000000..6246e516c88
--- /dev/null
+++ b/mono/mini/tramp-x86.c
@@ -0,0 +1,486 @@
+/*
+ * tramp-x86.c: JIT trampoline code for x86
+ *
+ * Authors:
+ * Dietmar Maurer (dietmar@ximian.com)
+ *
+ * (C) 2001 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/marshal.h>
+#include <mono/metadata/tabledefs.h>
+#include <mono/arch/x86/x86-codegen.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
+
+#include "mini.h"
+#include "mini-x86.h"
+
+typedef enum {
+ MONO_TRAMPOLINE_GENERIC,
+ MONO_TRAMPOLINE_JUMP,
+ MONO_TRAMPOLINE_CLASS_INIT
+} MonoTrampolineType;
+
+/* adapt to mini later... */
+#define mono_jit_share_code (1)
+
+/*
+ * Address of the x86 trampoline code. This is used by the debugger to check
+ * whether a method is a trampoline.
+ */
+guint8 *mono_generic_trampoline_code = NULL;
+
+/*
+ * get_unbox_trampoline:
+ * @m: method pointer
+ * @addr: pointer to native code for @m
+ *
+ * when value type methods are called through the vtable we need to unbox the
+ * this argument. This method returns a pointer to a trampoline which does
+ * unboxing before calling the method
+ */
+static gpointer
+get_unbox_trampoline (MonoMethod *m, gpointer addr)
+{
+ guint8 *code, *start;
+ int this_pos = 4;
+
+ if (!m->signature->ret->byref && MONO_TYPE_ISSTRUCT (m->signature->ret))
+ this_pos = 8;
+
+ start = code = g_malloc (16);
+
+ x86_alu_membase_imm (code, X86_ADD, X86_ESP, this_pos, sizeof (MonoObject));
+ x86_jump_code (code, addr);
+ g_assert ((code - start) < 16);
+
+ return start;
+}
+
+/**
+ * x86_magic_trampoline:
+ * @eax: saved x86 register
+ * @ecx: saved x86 register
+ * @edx: saved x86 register
+ * @esi: saved x86 register
+ * @edi: saved x86 register
+ * @ebx: saved x86 register
+ * @code: pointer into caller code
+ * @method: the method to translate
+ *
+ * This method is called by the trampoline functions for virtual
+ * methods. It inspects the caller code to find the address of the
+ * vtable slot, then calls the JIT compiler and writes the address
+ * of the compiled method back to the vtable. All virtual methods
+ * are called with: x86_call_membase (inst, basereg, disp). We always
+ * use 32 bit displacement to ensure that the length of the call
+ * instruction is 6 bytes. We need to get the value of the basereg
+ * and the constant displacement.
+ */
+static gpointer
+x86_magic_trampoline (int eax, int ecx, int edx, int esi, int edi,
+ int ebx, guint8 *code, MonoMethod *m)
+{
+ guint8 reg = 0;
+ gint32 disp = 0;
+ char *o = NULL;
+ gpointer addr;
+
+ addr = mono_compile_method (m);
+ g_assert (addr);
+
+ /* the method was jumped to */
+ if (!code)
+ return addr;
+
+ /* go to the start of the call instruction
+ *
+ * address_byte = (m << 6) | (o << 3) | reg
+ * call opcode: 0xff address_byte displacement
+ * 0xff m=1,o=2 imm8
+ * 0xff m=2,o=2 imm32
+ */
+ code -= 6;
+ if ((code [1] != 0xe8) && (code [3] == 0xff) && ((code [4] & 0x18) == 0x10) && ((code [4] >> 6) == 1)) {
+ reg = code [4] & 0x07;
+ disp = (signed char)code [5];
+ } else {
+ if ((code [0] == 0xff) && ((code [1] & 0x18) == 0x10) && ((code [1] >> 6) == 2)) {
+ reg = code [1] & 0x07;
+ disp = *((gint32*)(code + 2));
+ } else if ((code [1] == 0xe8)) {
+ MonoJitInfo *ji =
+ mono_jit_info_table_find (mono_domain_get (), code);
+ MonoJitInfo *target_ji =
+ mono_jit_info_table_find (mono_domain_get (), addr);
+
+ if (mono_method_same_domain (ji, target_ji)) {
+ if (!mono_running_on_valgrind ()) {
+ InterlockedExchange ((gint32*)(code + 2), (guint)addr - ((guint)code + 1) - 5);
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+ /* Tell valgrind to recompile the patched code */
+ //VALGRIND_DISCARD_TRANSLATIONS (code + 2, code + 6);
+#endif
+ }
+ }
+ return addr;
+ } else if ((code [4] == 0xff) && (((code [5] >> 6) & 0x3) == 0) && (((code [5] >> 3) & 0x7) == 2)) {
+ /*
+ * This is a interface call: should check the above code can't catch it earlier
+ * 8b 40 30 mov 0x30(%eax),%eax
+ * ff 10 call *(%eax)
+ */
+ disp = 0;
+ reg = code [5] & 0x07;
+ } else {
+ printf ("Invalid trampoline sequence: %x %x %x %x %x %x %x\n", code [0], code [1], code [2], code [3],
+ code [4], code [5], code [6]);
+ g_assert_not_reached ();
+ }
+ }
+
+ switch (reg) {
+ case X86_EAX:
+ o = (gpointer)eax;
+ break;
+ case X86_EDX:
+ o = (gpointer)edx;
+ break;
+ case X86_ECX:
+ o = (gpointer)ecx;
+ break;
+ case X86_ESI:
+ o = (gpointer)esi;
+ break;
+ case X86_EDI:
+ o = (gpointer)edi;
+ break;
+ case X86_EBX:
+ o = (gpointer)ebx;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ o += disp;
+
+ if (m->klass->valuetype)
+ addr = get_unbox_trampoline (m, addr);
+
+ *((gpointer *)o) = addr;
+
+ return addr;
+}
+
+/**
+ * x86_class_init_trampoline:
+ * @eax: saved x86 register
+ * @ecx: saved x86 register
+ * @edx: saved x86 register
+ * @esi: saved x86 register
+ * @edi: saved x86 register
+ * @ebx: saved x86 register
+ * @code: pointer into caller code
+ * @vtable: the type to initialize
+ *
+ * This method calls mono_runtime_class_init () to run the static constructor
+ * for the type, then patches the caller code so it is not called again.
+ */
+static void
+x86_class_init_trampoline (int eax, int ecx, int edx, int esi, int edi,
+ int ebx, guint8 *code, MonoVTable *vtable)
+{
+ mono_runtime_class_init (vtable);
+
+ code -= 5;
+ if (code [0] == 0xe8) {
+ if (!mono_running_on_valgrind ()) {
+ guint32 ops;
+ /*
+ * Thread safe code patching using the algorithm from the paper
+ * 'Practicing JUDO: Java Under Dynamic Optimizations'
+ */
+ /*
+ * First atomically change the the first 2 bytes of the call to a
+ * spinning jump.
+ */
+ ops = 0xfeeb;
+ InterlockedExchange ((gint32*)code, ops);
+
+ /* Then change the other bytes to a nop */
+ code [2] = 0x90;
+ code [3] = 0x90;
+ code [4] = 0x90;
+
+ /* Then atomically change the first 4 bytes to a nop as well */
+ ops = 0x90909090;
+ InterlockedExchange ((guint32*)code, ops);
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+ /* FIXME: the calltree skin trips on the self modifying code above */
+
+ /* Tell valgrind to recompile the patched code */
+ //VALGRIND_DISCARD_TRANSLATIONS (code, code + 8);
+#endif
+ }
+ }
+ else
+ if (code [0] == 0x90 || code [0] == 0xeb)
+ /* Already changed by another thread */
+ ;
+ else {
+ printf ("Invalid trampoline sequence: %x %x %x %x %x %x %x\n", code [0], code [1], code [2], code [3],
+ code [4], code [5], code [6]);
+ g_assert_not_reached ();
+ }
+}
+
+static guchar*
+create_trampoline_code (MonoTrampolineType tramp_type)
+{
+ guint8 *buf, *code;
+ static guint8* generic_jump_trampoline = NULL;
+ static guint8 *generic_class_init_trampoline = NULL;
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ if (mono_generic_trampoline_code)
+ return mono_generic_trampoline_code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ if (generic_jump_trampoline)
+ return generic_jump_trampoline;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ if (generic_class_init_trampoline)
+ return generic_class_init_trampoline;
+ break;
+ }
+
+ code = buf = g_malloc (256);
+ /* save caller save regs because we need to do a call */
+ x86_push_reg (buf, X86_EDX);
+ x86_push_reg (buf, X86_EAX);
+ x86_push_reg (buf, X86_ECX);
+
+ /* save LMF begin */
+
+ /* save the IP (caller ip) */
+ if (tramp_type == MONO_TRAMPOLINE_JUMP)
+ x86_push_imm (buf, 0);
+ else
+ x86_push_membase (buf, X86_ESP, 16);
+
+ x86_push_reg (buf, X86_EBP);
+ x86_push_reg (buf, X86_ESI);
+ x86_push_reg (buf, X86_EDI);
+ x86_push_reg (buf, X86_EBX);
+
+ /* save method info */
+ x86_push_membase (buf, X86_ESP, 32);
+ /* get the address of lmf for the current thread */
+ x86_call_code (buf, mono_get_lmf_addr);
+ /* push lmf */
+ x86_push_reg (buf, X86_EAX);
+ /* push *lfm (previous_lmf) */
+ x86_push_membase (buf, X86_EAX, 0);
+ /* *(lmf) = ESP */
+ x86_mov_membase_reg (buf, X86_EAX, 0, X86_ESP, 4);
+ /* save LFM end */
+
+ /* push the method info */
+ x86_push_membase (buf, X86_ESP, 44);
+ /* push the return address onto the stack */
+ if (tramp_type == MONO_TRAMPOLINE_JUMP)
+ x86_push_imm (buf, 0);
+ else
+ x86_push_membase (buf, X86_ESP, 52);
+
+ /* save all register values */
+ x86_push_reg (buf, X86_EBX);
+ x86_push_reg (buf, X86_EDI);
+ x86_push_reg (buf, X86_ESI);
+ x86_push_membase (buf, X86_ESP, 64); /* EDX */
+ x86_push_membase (buf, X86_ESP, 64); /* ECX */
+ x86_push_membase (buf, X86_ESP, 64); /* EAX */
+
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT)
+ x86_call_code (buf, x86_class_init_trampoline);
+ else
+ x86_call_code (buf, x86_magic_trampoline);
+ x86_alu_reg_imm (buf, X86_ADD, X86_ESP, 8*4);
+
+ /* restore LMF start */
+ /* ebx = previous_lmf */
+ x86_pop_reg (buf, X86_EBX);
+ /* edi = lmf */
+ x86_pop_reg (buf, X86_EDI);
+ /* *(lmf) = previous_lmf */
+ x86_mov_membase_reg (buf, X86_EDI, 0, X86_EBX, 4);
+ /* discard method info */
+ x86_pop_reg (buf, X86_ESI);
+ /* restore caller saved regs */
+ x86_pop_reg (buf, X86_EBX);
+ x86_pop_reg (buf, X86_EDI);
+ x86_pop_reg (buf, X86_ESI);
+ x86_pop_reg (buf, X86_EBP);
+
+ /* discard save IP */
+ x86_alu_reg_imm (buf, X86_ADD, X86_ESP, 4);
+ /* restore LMF end */
+
+ x86_alu_reg_imm (buf, X86_ADD, X86_ESP, 16);
+
+ if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT)
+ x86_ret (buf);
+ else
+ /* call the compiled method */
+ x86_jump_reg (buf, X86_EAX);
+
+ g_assert ((buf - code) <= 256);
+
+ switch (tramp_type) {
+ case MONO_TRAMPOLINE_GENERIC:
+ mono_generic_trampoline_code = code;
+ break;
+ case MONO_TRAMPOLINE_JUMP:
+ generic_jump_trampoline = code;
+ break;
+ case MONO_TRAMPOLINE_CLASS_INIT:
+ generic_class_init_trampoline = code;
+ break;
+ }
+
+ return code;
+}
+
+#define TRAMPOLINE_SIZE 10
+
+MonoJitInfo*
+mono_arch_create_jump_trampoline (MonoMethod *method)
+{
+ guint8 *code, *buf, *tramp;
+ MonoJitInfo *ji;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_JUMP);
+
+ code = buf = g_malloc (TRAMPOLINE_SIZE);
+ x86_push_imm (buf, method);
+ x86_jump_code (buf, tramp);
+ g_assert ((buf - code) <= TRAMPOLINE_SIZE);
+
+ ji = g_new0 (MonoJitInfo, 1);
+ ji->method = method;
+ ji->code_start = code;
+ ji->code_size = buf - code;
+
+ mono_arch_flush_icache (ji->code_start, ji->code_size);
+
+ mono_jit_stats.method_trampolines++;
+
+ return ji;
+
+}
+
+/**
+ * mono_arch_create_jit_trampoline:
+ * @method: pointer to the method info
+ *
+ * Creates a trampoline function for virtual methods. If the created
+ * code is called it first starts JIT compilation of method,
+ * and then calls the newly created method. I also replaces the
+ * corresponding vtable entry (see x86_magic_trampoline).
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_jit_trampoline (MonoMethod *method)
+{
+ guint8 *code, *buf, *tramp;
+
+ /* previously created trampoline code */
+ if (method->info)
+ return method->info;
+
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ return mono_arch_create_jit_trampoline (mono_marshal_get_synchronized_wrapper (method));
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_GENERIC);
+
+ code = buf = g_malloc (TRAMPOLINE_SIZE);
+ x86_push_imm (buf, method);
+ x86_jump_code (buf, tramp);
+ g_assert ((buf - code) <= TRAMPOLINE_SIZE);
+
+ /* store trampoline address */
+ method->info = code;
+
+ mono_jit_stats.method_trampolines++;
+
+ return code;
+}
+
+/**
+ * mono_arch_create_class_init_trampoline:
+ * @vtable: the type to initialize
+ *
+ * Creates a trampoline function to run a type initializer.
+ * If the trampoline is called, it calls mono_runtime_class_init with the
+ * given vtable, then patches the caller code so it does not get called any
+ * more.
+ *
+ * Returns: a pointer to the newly created code
+ */
+gpointer
+mono_arch_create_class_init_trampoline (MonoVTable *vtable)
+{
+ guint8 *code, *buf, *tramp;
+
+ tramp = create_trampoline_code (MONO_TRAMPOLINE_CLASS_INIT);
+
+ code = buf = g_malloc (TRAMPOLINE_SIZE);
+ x86_push_imm (buf, vtable);
+ x86_jump_code (buf, tramp);
+ g_assert ((buf - code) <= TRAMPOLINE_SIZE);
+
+ mono_jit_stats.method_trampolines++;
+
+ return code;
+}
+
+void
+mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
+{
+ /* FIXME: This is not thread safe */
+ guint8 *code = ji->code_start;
+
+ x86_push_imm (code, func_arg);
+ x86_call_code (code, (guint8*)func);
+}
+
+/*
+ * This method is only called when running in the Mono Debugger.
+ */
+gpointer
+mono_debugger_create_notification_function (gpointer *notification_address)
+{
+ guint8 *ptr, *buf;
+
+ ptr = buf = g_malloc0 (16);
+ x86_breakpoint (buf);
+ if (notification_address)
+ *notification_address = buf;
+ x86_ret (buf);
+
+ return ptr;
+}
+
diff --git a/mono/mini/viewstat.pl b/mono/mini/viewstat.pl
new file mode 100644
index 00000000000..50bd05b6701
--- /dev/null
+++ b/mono/mini/viewstat.pl
@@ -0,0 +1,87 @@
+#!/usr/bin/perl
+
+use GD::Graph::bars;
+use GD::Graph::bars3d;
+use Getopt::Std;
+
+$Usage = "usage: $0 [-e] [-o file] statfile";
+
+# -e generate a 3D graph
+# -o file write the graph to file, instead of starting the viewer
+
+getopts('eo:', \%Opts)
+ or die "$Usage";
+die "$Usage\n"
+ unless (@ARGV == 1);
+
+$statfile = shift;
+
+sub save_chart
+{
+ my $chart = shift or die "Need a chart!";
+ my $name = shift or die "Need a name!";
+ local(*OUT);
+
+ open(OUT, ">$name") or
+ die "Cannot open $name.$ext for write: $!";
+ binmode OUT;
+ print OUT $chart->gd->png();
+ close OUT;
+}
+
+
+print STDERR "Processing file $statfile\n";
+
+if ($Opts{'e'}) {
+ $graph = new GD::Graph::bars3d(800, 600);
+} else {
+ $graph = new GD::Graph::bars(800, 600);
+}
+$graph->set(
+ y_label => 'Time',
+ y_long_ticks => 1,
+
+ x_long_ticks => 1,
+
+ y_tick_number => 8,
+
+ x_labels_vertical => 1,
+ bar_spacing => 5,
+
+ show_values => 1,
+ values_vertical => 1,
+
+ l_margin => 10,
+ b_margin => 10,
+ r_margin => 10,
+ t_margin => 10,
+
+ shadow_depth => 1,
+
+ transparent => 0,
+);
+
+if ($Opts{'e'}) {
+ $graph->set (overwrite => 1);
+ $graph->set (show_values => 0);
+}
+
+require $statfile;
+
+if ($stattitle ne "") {
+ $graph->set (title=> $stattitle);
+}
+
+$outfile = $Opts{'o'};
+
+if ($outfile eq "") {
+ $tmp = $outfile = "/tmp/viewstat" . $$ . ".png";
+}
+
+$graph->plot(\@data);
+save_chart($graph, $outfile);
+
+if ($tmp) {
+ `eog $outfile`;
+ `rm $tmp`;
+}
diff --git a/mono/monoburg/ChangeLog b/mono/monoburg/ChangeLog
index 1a80085a17b..d73c34dc0cc 100644
--- a/mono/monoburg/ChangeLog
+++ b/mono/monoburg/ChangeLog
@@ -1,3 +1,51 @@
+2004-06-24 David Waite <mass@akuma.org>
+
+ * monoburg.c: change to C90-style comments from C99/C++-style
+
+Wed Apr 14 12:40:54 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * monoburg.c, monoburg.h, monoburg.y: changed the grammar so that
+ the same emit code can be easily associated with multiple rules.
+ Coalesce identical emit functions to reduce code size (10 KB - 10 % -
+ with the current unchanged x86 JIT rules).
+
+2002-10-28 Dietmar Maurer <dietmar@ximian.com>
+
+ * monoburg.c (emit_state): use 16bit values for registers, removed
+ reg3 and spilled flag.
+
+2002-10-17 Dietmar Maurer <dietmar@ximian.com>
+
+ * monoburg.y: added missing semicolon
+
+2002-10-11 Dietmar Maurer <dietmar@ximian.com>
+
+ * monoburg.c (emit_tree_match): omit unnecessary compare
+ (emit_label_func): make it possible to print operator names in
+ error messages.
+
+2002-10-09 Dietmar Maurer <dietmar@ximian.com>
+
+ * monoburg.c (check_result): emit a warning instead of an error
+
+2002-10-03 Dietmar Maurer <dietmar@ximian.com>
+
+ * monoburg.c: added new %termprefix mode
+
+2002-09-30 Dietmar Maurer <dietmar@ximian.com>
+
+ * monoburg.c (main): add option to specify default costs, added
+ experimental code to handle several input files.
+
+2002-09-26 Dietmar Maurer <dietmar@ximian.com>
+
+ * monoburg.c (emit_state): include additional fields to handle
+ register allocation in dag_mode
+
+2002-09-25 Dietmar Maurer <dietmar@ximian.com>
+
+ * added -p and -e options. monoburg is now able to work with DAGs.
+
2002-04-20 Dietmar Maurer <dietmar@ximian.com>
* monoburg.y (yylex): bug fix in number parsing
diff --git a/mono/monoburg/Makefile.am b/mono/monoburg/Makefile.am
index 5f1f2f47707..e87ebf63637 100644
--- a/mono/monoburg/Makefile.am
+++ b/mono/monoburg/Makefile.am
@@ -11,7 +11,7 @@ parser.c: $(srcdir)/monoburg.y
bison $(srcdir)/monoburg.y -o parser.c
monoburg$(BUILD_EXEEXT): $(srcdir)/monoburg.c $(srcdir)/monoburg.h parser.c
- $(CC_FOR_BUILD) -o $@ $(srcdir)/monoburg.c parser.c $(INCLUDES) $(BUILD_GLIB_LIBS)
+ $(CC_FOR_BUILD) -o $@ $(srcdir)/monoburg.c parser.c $(INCLUDES) $(LDFLAGS) $(BUILD_GLIB_LIBS)
sample.c: monoburg$(BUILD_EXEEXT) $(srcdir)/sample.brg
./monoburg$(BUILD_EXEEXT) $(srcdir)/sample.brg > sample.c
diff --git a/mono/monoburg/monoburg.1 b/mono/monoburg/monoburg.1
index 5edf819801f..8310de4d5d9 100644
--- a/mono/monoburg/monoburg.1
+++ b/mono/monoburg/monoburg.1
@@ -11,8 +11,12 @@ monoburg \- code generator generator
.PP
.B monoburg
[\-h]
+[\-e]
+[\-p]
+[\-c VALUE]
[\-d HEADER]
-FILE
+[\-DVALUE]
+[FILE...]
.SH DESCRIPTION
The \fImonoburg\fP program is used to generate tree pattern matchers
from BURG specifications. \fImonoburg\fP accepts the following EBNF grammar.
@@ -24,6 +28,7 @@ spec: ccode `%%' { dcl } [`%%' ccode]
dcl: `%start' nonterm
`%term' { identifier [`=' integer] }
+ `%termprefix' { identifier }
nonterm `:' tree [cost] [ `{' ccode `}' ] [costfunc]
tree: term `(' tree `,' tree `)'
@@ -70,7 +75,8 @@ reg: Fetch (addr)
.RE
.fi
.PP
-
+A simple pre-processor is included, consisting of: %ifdef, %else and
+%endif. %ifdef operates on definitions from the command line.
.SH OPTIONS
The following options are supported:
.TP
@@ -79,6 +85,21 @@ Displays usage instructions.
.TP
.I "-d HEADER"
Writes a separate header file which contains all monoburg definitions.
+.TP
+.I "-p"
+Assume termainals are already defined. Its possible to omit the %term
+definitions in this mode if you use the %termprefix command. All symbols
+starting with a prefix specified in %termprefix are considered to be terminals.
+.TP
+.I "-e"
+Extended mode. Enables monoburg to work with DAGs.
+.TP
+.I "-c VALUE"
+Set the default costs to VALUE
+.TP
+.I "-Dvar"
+Defines the variable "var" as true. This is used with %ifdef, %else
+and %endif in the source files to perform conditional compilation.
.PP
.SH AUTHOR
monoburg was written by Dietmar Maurer. It is based on the papers from
diff --git a/mono/monoburg/monoburg.c b/mono/monoburg/monoburg.c
index 795b959fff3..067e110f1b9 100644
--- a/mono/monoburg/monoburg.c
+++ b/mono/monoburg/monoburg.c
@@ -19,12 +19,18 @@ static GList *term_list;
static GHashTable *nonterm_hash;
static GList *nonterm_list;
static GList *rule_list;
+static GList *prefix_list;
FILE *inputfd;
FILE *outputfd;
+GHashTable *definedvars;
static FILE *deffd;
static FILE *cfd;
+static int dag_mode = 0;
+static int predefined_terms = 0;
+static int default_cost = 0;
+
static void output (char *fmt, ...)
{
va_list ap;
@@ -34,16 +40,22 @@ static void output (char *fmt, ...)
va_end (ap);
}
-void
-create_rule (char *id, Tree *tree, char *code, char *cost, char *cfunc)
+Rule*
+make_rule (char *id, Tree *tree)
{
Rule *rule = g_new0 (Rule, 1);
+ rule->lhs = nonterm (id);
+ rule->tree = tree;
+
+ return rule;
+}
+void
+rule_add (Rule *rule, char *code, char *cost, char *cfunc)
+{
if (!cfunc && !cost)
- cost = "0";
+ cost = g_strdup_printf ("%d", default_cost);
- rule->lhs = nonterm (id);
- rule->tree = tree;
rule_list = g_list_append (rule_list, rule);
rule->cost = g_strdup (cost);
rule->cfunc = g_strdup (cfunc);
@@ -52,26 +64,55 @@ create_rule (char *id, Tree *tree, char *code, char *cost, char *cfunc)
if (cfunc) {
if (cost)
yyerror ("duplicated costs (constant costs and cost function)");
- else
- rule->cost = g_strdup_printf ("mono_burg_cost_%d (tree, data)",
- g_list_length (rule_list));
+ else {
+ if (dag_mode)
+ rule->cost = g_strdup_printf ("mono_burg_cost_%d (p, data)",
+ g_list_length (rule_list));
+ else
+ rule->cost = g_strdup_printf ("mono_burg_cost_%d (tree, data)",
+ g_list_length (rule_list));
+ }
}
rule->lhs->rules = g_list_append (rule->lhs->rules, rule);
- if (tree->op)
- tree->op->rules = g_list_append (tree->op->rules, rule);
+ if (rule->tree->op)
+ rule->tree->op->rules = g_list_append (rule->tree->op->rules, rule);
else
- tree->nonterm->chain = g_list_append (tree->nonterm->chain, rule);
+ rule->tree->nonterm->chain = g_list_append (rule->tree->nonterm->chain, rule);
+}
+
+void
+create_rule (char *id, Tree *tree, char *code, char *cost, char *cfunc)
+{
+ Rule *rule = make_rule (id, tree);
+
+ rule_add (rule, code, cost, cfunc);
}
Tree *
create_tree (char *id, Tree *left, Tree *right)
{
int arity = (left != NULL) + (right != NULL);
- Term *term = g_hash_table_lookup (term_hash, id);
+ Term *term = NULL;
Tree *tree = g_new0 (Tree, 1);
-
+
+ if (term_hash)
+ term = g_hash_table_lookup (term_hash, id);
+
+ /* try if id has termprefix */
+ if (!term) {
+ GList *pl;
+ for (pl = prefix_list; pl; pl = pl->next) {
+ char *pfx = (char *)pl->data;
+ if (!strncmp (pfx, id, strlen (pfx))) {
+ term = create_term (id, -1);
+ break;
+ }
+ }
+
+ }
+
if (term) {
if (term->arity == -1)
term->arity = arity;
@@ -98,11 +139,20 @@ check_term_num (char *key, Term *value, int num)
}
void
+create_term_prefix (char *id)
+{
+ if (!predefined_terms)
+ yyerror ("%termprefix is only available with -p option");
+
+ prefix_list = g_list_prepend (prefix_list, g_strdup (id));
+}
+
+Term *
create_term (char *id, int num)
{
Term *term;
- if (nonterm_list)
+ if (!predefined_terms && nonterm_list)
yyerror ("terminal definition after nonterminal definition");
if (num < -1)
@@ -122,6 +172,8 @@ create_term (char *id, int num)
term_list = g_list_append (term_list, term);
g_hash_table_insert (term_hash, term->name, term);
+
+ return term;
}
NonTerm *
@@ -246,8 +298,11 @@ emit_header ()
Term *t = (Term *)l->data;
if (t->number == -1)
t->number = next_term_num ();
-
- output ("#define MB_TERM_%s\t %d\n", t->name, t->number);
+
+ if (predefined_terms)
+ output ("#define MB_TERM_%s\t %s\n", t->name, t->name);
+ else
+ output ("#define MB_TERM_%s\t %d\n", t->name, t->number);
}
output ("\n");
@@ -276,6 +331,12 @@ emit_state ()
output ("typedef struct _MBState MBState;\n");
output ("struct _MBState {\n");
output ("\tint\t\t op;\n");
+
+ if (dag_mode) {
+ output ("\tMBTREE_TYPE\t *tree;\n");
+ output ("\tgint32 reg1, reg2;\n");
+ }
+
output ("\tMBState\t\t*left, *right;\n");
output ("\tguint16\t\tcost[%d];\n", g_list_length (nonterm_list) + 1);
@@ -314,19 +375,29 @@ static void
emit_tree_match (char *st, Tree *t)
{
char *tn;
+ int not_first = strcmp (st, "p->");
+
+ /* we can omit this check at the top level */
+ if (not_first) {
+ if (predefined_terms)
+ output ("\t\t\t%sop == %s /* %s */", st, t->op->name, t->op->name);
+ else
+ output ("\t\t\t%sop == %d /* %s */", st, t->op->number, t->op->name);
+ }
- output ("\t\t\t%sop == %d /* %s */", st, t->op->number, t->op->name);
-
if (t->left && t->left->op) {
tn = g_strconcat (st, "left->", NULL);
- output (" &&\n");
+ if (not_first)
+ output (" &&\n");
+ not_first = 1;
emit_tree_match (tn, t->left);
g_free (tn);
}
if (t->right && t->right->op) {
tn = g_strconcat (st, "right->", NULL);
- output (" &&\n");
+ if (not_first)
+ output (" &&\n");
emit_tree_match (tn, t->right);
g_free (tn);
}
@@ -399,35 +470,57 @@ emit_label_func ()
GList *l;
int i;
- output ("static MBState *\n");
- output ("mono_burg_label_priv (MBTREE_TYPE *tree, MBCOST_DATA *data) {\n");
+ if (dag_mode) {
+ output ("static void\n");
+ output ("mono_burg_label_priv (MBTREE_TYPE *tree, MBCOST_DATA *data, MBState *p) {\n");
+ } else {
+ output ("static MBState *\n");
+ output ("mono_burg_label_priv (MBTREE_TYPE *tree, MBCOST_DATA *data) {\n");
+ }
output ("\tint arity;\n");
output ("\tint c;\n");
- output ("\tMBState *p, *left, *right;\n\n");
+ if (!dag_mode)
+ output ("\tMBState *p;\n");
+ output ("\tMBState *left = NULL, *right = NULL;\n\n");
output ("\tswitch (mono_burg_arity [MBTREE_OP(tree)]) {\n");
output ("\tcase 0:\n");
- output ("\t\tleft = NULL;\n");
- output ("\t\tright = NULL;\n");
output ("\t\tbreak;\n");
output ("\tcase 1:\n");
- output ("\t\tleft = mono_burg_label_priv (MBTREE_LEFT(tree), data);\n");
- output ("\t\tright = NULL;\n");
+ if (dag_mode) {
+ output ("\t\tleft = MBALLOC_STATE;\n");
+ output ("\t\tmono_burg_label_priv (MBTREE_LEFT(tree), data, left);\n");
+ } else {
+ output ("\t\tleft = mono_burg_label_priv (MBTREE_LEFT(tree), data);\n");
+ output ("\t\tright = NULL;\n");
+ }
output ("\t\tbreak;\n");
output ("\tcase 2:\n");
- output ("\t\tleft = mono_burg_label_priv (MBTREE_LEFT(tree), data);\n");
- output ("\t\tright = mono_burg_label_priv (MBTREE_RIGHT(tree), data);\n");
+ if (dag_mode) {
+ output ("\t\tleft = MBALLOC_STATE;\n");
+ output ("\t\tmono_burg_label_priv (MBTREE_LEFT(tree), data, left);\n");
+ output ("\t\tright = MBALLOC_STATE;\n");
+ output ("\t\tmono_burg_label_priv (MBTREE_RIGHT(tree), data, right);\n");
+ } else {
+ output ("\t\tleft = mono_burg_label_priv (MBTREE_LEFT(tree), data);\n");
+ output ("\t\tright = mono_burg_label_priv (MBTREE_RIGHT(tree), data);\n");
+ }
output ("\t}\n\n");
output ("\tarity = (left != NULL) + (right != NULL);\n");
output ("\tg_assert (arity == mono_burg_arity [MBTREE_OP(tree)]);\n\n");
- output ("\tp = MBALLOC_STATE;\n");
+ if (!dag_mode)
+ output ("\tp = MBALLOC_STATE;\n");
+
output ("\tmemset (p, 0, sizeof (MBState));\n");
output ("\tp->op = MBTREE_OP(tree);\n");
output ("\tp->left = left;\n");
output ("\tp->right = right;\n");
+
+ if (dag_mode)
+ output ("\tp->tree = tree;\n");
for (l = nonterm_list, i = 0; l; l = l->next) {
output ("\tp->cost [%d] = 32767;\n", ++i);
@@ -438,7 +531,11 @@ emit_label_func ()
for (l = term_list; l; l = l->next) {
Term *t = (Term *)l->data;
GList *rl;
- output ("\tcase %d: /* %s */\n", t->number, t->name);
+
+ if (predefined_terms)
+ output ("\tcase %s: /* %s */\n", t->name, t->name);
+ else
+ output ("\tcase %d: /* %s */\n", t->number, t->name);
for (rl = t->rules; rl; rl = rl->next) {
Rule *rule = (Rule *)rl->data;
@@ -465,18 +562,28 @@ emit_label_func ()
}
output ("\tdefault:\n");
- output ("\t\tg_error (\"unknown operator\");\n");
+ output ("#ifdef MBGET_OP_NAME\n");
+ output ("\t\tg_error (\"unknown operator: %%s\", MBGET_OP_NAME(MBTREE_OP(tree)));\n");
+ output ("#else\n");
+ output ("\t\tg_error (\"unknown operator: 0x%%04x\", MBTREE_OP(tree));\n");
+ output ("#endif\n");
output ("\t}\n\n");
- output ("\tMBTREE_STATE(tree) = p;\n");
-
- output ("\treturn p;\n");
+ if (!dag_mode) {
+ output ("\tMBTREE_STATE(tree) = p;\n");
+ output ("\treturn p;\n");
+ }
output ("}\n\n");
output ("MBState *\n");
output ("mono_burg_label (MBTREE_TYPE *tree, MBCOST_DATA *data)\n{\n");
- output ("\tMBState *p = mono_burg_label_priv (tree, data);\n");
+ if (dag_mode) {
+ output ("\tMBState *p = MBALLOC_STATE;\n");
+ output ("\tmono_burg_label_priv (tree, data, p);\n");
+ } else {
+ output ("\tMBState *p = mono_burg_label_priv (tree, data);\n");
+ }
output ("\treturn p->rule_%s ? p : NULL;\n", ((NonTerm *)nonterm_list->data)->name);
output ("}\n\n");
}
@@ -491,11 +598,20 @@ compute_kids (char *ts, Tree *tree, int *n)
} else if (tree->op && tree->op->arity) {
char *res2 = NULL;
- res = compute_kids (g_strdup_printf ("MBTREE_LEFT(%s)", ts),
- tree->left, n);
- if (tree->op->arity == 2)
- res2 = compute_kids (g_strdup_printf ("MBTREE_RIGHT(%s)", ts),
- tree->right, n);
+ if (dag_mode) {
+ res = compute_kids (g_strdup_printf ("%s->left", ts),
+ tree->left, n);
+ if (tree->op->arity == 2)
+ res2 = compute_kids (g_strdup_printf ("%s->right", ts),
+ tree->right, n);
+ } else {
+ res = compute_kids (g_strdup_printf ("MBTREE_LEFT(%s)", ts),
+ tree->left, n);
+ if (tree->op->arity == 2)
+ res2 = compute_kids (g_strdup_printf ("MBTREE_RIGHT(%s)", ts),
+ tree->right, n);
+ }
+
return g_strconcat (res, res2, NULL);
}
return "";
@@ -529,11 +645,18 @@ emit_kids ()
output ("}\n\n");
- output ("MBTREE_TYPE **\n");
- output ("mono_burg_kids (MBTREE_TYPE *tree, int rulenr, MBTREE_TYPE *kids [])\n{\n");
- output ("\tg_return_val_if_fail (tree != NULL, NULL);\n");
- output ("\tg_return_val_if_fail (MBTREE_STATE(tree) != NULL, NULL);\n");
- output ("\tg_return_val_if_fail (kids != NULL, NULL);\n\n");
+ if (dag_mode) {
+ output ("MBState **\n");
+ output ("mono_burg_kids (MBState *state, int rulenr, MBState *kids [])\n{\n");
+ output ("\tg_return_val_if_fail (state != NULL, NULL);\n");
+ output ("\tg_return_val_if_fail (kids != NULL, NULL);\n\n");
+
+ } else {
+ output ("MBTREE_TYPE **\n");
+ output ("mono_burg_kids (MBTREE_TYPE *tree, int rulenr, MBTREE_TYPE *kids [])\n{\n");
+ output ("\tg_return_val_if_fail (tree != NULL, NULL);\n");
+ output ("\tg_return_val_if_fail (kids != NULL, NULL);\n\n");
+ }
output ("\tswitch (rulenr) {\n");
@@ -547,7 +670,11 @@ emit_kids ()
int kn = 0;
char *k;
- k = compute_kids ("tree", rule->tree, &kn);
+ if (dag_mode)
+ k = compute_kids ("state", rule->tree, &kn);
+ else
+ k = compute_kids ("tree", rule->tree, &kn);
+
for (j = 0; j < c; j++)
if (!strcmp (sa [j], k))
break;
@@ -576,24 +703,37 @@ static void
emit_emitter_func ()
{
GList *l;
- int i;
+ int i, rulen;
+ GHashTable *cache = g_hash_table_new (g_str_hash, g_str_equal);
for (l = rule_list, i = 0; l; l = l->next) {
Rule *rule = (Rule *)l->data;
if (rule->code) {
+ if ((rulen = GPOINTER_TO_INT (g_hash_table_lookup (cache, rule->code)))) {
+ emit_rule_string (rule, "");
+ output ("#define mono_burg_emit_%d mono_burg_emit_%d\n\n", i, rulen);
+ i++;
+ continue;
+ }
output ("static void ");
emit_rule_string (rule, "");
- output ("mono_burg_emit_%d (MBTREE_TYPE *tree, MBCGEN_TYPE *s)\n", i);
+ if (dag_mode)
+ output ("mono_burg_emit_%d (MBState *state, MBTREE_TYPE *tree, MBCGEN_TYPE *s)\n", i);
+ else
+ output ("mono_burg_emit_%d (MBTREE_TYPE *tree, MBCGEN_TYPE *s)\n", i);
output ("{\n");
output ("%s\n", rule->code);
output ("}\n\n");
+ g_hash_table_insert (cache, rule->code, GINT_TO_POINTER (i));
}
i++;
}
+ g_hash_table_destroy (cache);
+
output ("MBEmitFunc const mono_burg_func [] = {\n");
output ("\tNULL,\n");
for (l = rule_list, i = 0; l; l = l->next) {
@@ -620,8 +760,11 @@ emit_cost_func ()
output ("inline static guint16\n");
emit_rule_string (rule, "");
-
- output ("mono_burg_cost_%d (MBTREE_TYPE *tree, MBCOST_DATA *data)\n", i + 1);
+
+ if (dag_mode)
+ output ("mono_burg_cost_%d (MBState *state, MBCOST_DATA *data)\n", i + 1);
+ else
+ output ("mono_burg_cost_%d (MBTREE_TYPE *tree, MBCOST_DATA *data)\n", i + 1);
output ("{\n");
output ("%s\n", rule->cfunc);
output ("}\n\n");
@@ -682,28 +825,44 @@ emit_vardefs ()
int i, j, c, n, *si;
char **sa;
- output ("const guint8 mono_burg_arity [] = {\n");
- for (l = term_list, i = 0; l; l = l->next) {
- Term *t = (Term *)l->data;
+ if (predefined_terms) {
+ output ("guint8 mono_burg_arity [MBMAX_OPCODES];\n");
+
+ output ("void\nmono_burg_init (void)\n{\n");
+
+ for (l = term_list, i = 0; l; l = l->next) {
+ Term *t = (Term *)l->data;
+
+ output ("\tmono_burg_arity [%s] = %d; /* %s */\n", t->name, t->arity, t->name);
- while (i < t->number) {
- output ("\t0,\n");
- i++;
}
+
+ output ("}\n\n");
+
+ } else {
+ output ("const guint8 mono_burg_arity [] = {\n");
+ for (l = term_list, i = 0; l; l = l->next) {
+ Term *t = (Term *)l->data;
+
+ while (i < t->number) {
+ output ("\t0,\n");
+ i++;
+ }
- output ("\t%d, /* %s */\n", t->arity, t->name);
+ output ("\t%d, /* %s */\n", t->arity, t->name);
- i++;
- }
- output ("};\n\n");
+ i++;
+ }
+ output ("};\n\n");
- output ("const char *const mono_burg_term_string [] = {\n");
- output ("\tNULL,\n");
- for (l = term_list, i = 0; l; l = l->next) {
- Term *t = (Term *)l->data;
- output ("\t\"%s\",\n", t->name);
+ output ("const char *const mono_burg_term_string [] = {\n");
+ output ("\tNULL,\n");
+ for (l = term_list, i = 0; l; l = l->next) {
+ Term *t = (Term *)l->data;
+ output ("\t\"%s\",\n", t->name);
+ }
+ output ("};\n\n");
}
- output ("};\n\n");
output ("const char * const mono_burg_rule_string [] = {\n");
output ("\tNULL,\n");
@@ -749,8 +908,11 @@ emit_vardefs ()
static void
emit_prototypes ()
{
- output ("typedef void (*MBEmitFunc) (MBTREE_TYPE *tree, MBCGEN_TYPE *s);\n\n");
-
+ if (dag_mode)
+ output ("typedef void (*MBEmitFunc) (MBState *state, MBTREE_TYPE *tree, MBCGEN_TYPE *s);\n\n");
+ else
+ output ("typedef void (*MBEmitFunc) (MBTREE_TYPE *tree, MBCGEN_TYPE *s);\n\n");
+
output ("extern const char * const mono_burg_term_string [];\n");
output ("extern const char * const mono_burg_rule_string [];\n");
output ("extern const guint16 *const mono_burg_nts [];\n");
@@ -758,8 +920,13 @@ emit_prototypes ()
output ("MBState *mono_burg_label (MBTREE_TYPE *tree, MBCOST_DATA *data);\n");
output ("int mono_burg_rule (MBState *state, int goal);\n");
- output ("MBTREE_TYPE **mono_burg_kids (MBTREE_TYPE *tree, int rulenr, MBTREE_TYPE *kids []);\n");
+ if (dag_mode)
+ output ("MBState **mono_burg_kids (MBState *state, int rulenr, MBState *kids []);\n");
+ else
+ output ("MBTREE_TYPE **mono_burg_kids (MBTREE_TYPE *tree, int rulenr, MBTREE_TYPE *kids []);\n");
+
+ output ("extern void mono_burg_init (void);\n");
output ("\n");
}
@@ -804,7 +971,7 @@ check_result ()
for (l = nonterm_list; l; l = l->next) {
NonTerm *n = (NonTerm *)l->data;
if (!n->reached)
- g_error ("unreachable nonterm \"%s\"", n->name);
+ g_warning ("unreachable nonterm \"%s\"", n->name);
}
}
@@ -830,27 +997,34 @@ main (int argc, char *argv [])
{
char *cfile = NULL;
char *deffile = NULL;
- char *infile = NULL;
+ GList *infiles = NULL;
int i;
+ definedvars = g_hash_table_new (g_str_hash, g_str_equal);
g_log_set_handler (NULL, G_LOG_LEVEL_WARNING, warning_handler, stderr);
for (i = 1; i < argc; i++){
if (argv [i][0] == '-'){
if (argv [i][1] == 'h') {
usage ();
+ } else if (argv [i][1] == 'e') {
+ dag_mode = 1;
+ } else if (argv [i][1] == 'p') {
+ predefined_terms = 1;
} else if (argv [i][1] == 'd') {
deffile = argv [++i];
} else if (argv [i][1] == 's') {
cfile = argv [++i];
+ } else if (argv [i][1] == 'c') {
+ default_cost = atoi (argv [++i]);
+ } else if (argv [i][1] == 'D') {
+ g_hash_table_insert (definedvars, &argv [i][2],
+ GUINT_TO_POINTER (1));
} else {
usage ();
}
} else {
- if (infile)
- usage ();
- else
- infile = argv [i];
+ infiles = g_list_append (infiles, argv [i]);
}
}
@@ -866,17 +1040,27 @@ main (int argc, char *argv [])
outputfd = stdout;
- if (infile) {
- if (!(inputfd = fopen (infile, "r"))) {
- perror ("cant open input file");
- exit (-1);
+ if (infiles) {
+ GList *l = infiles;
+ while (l) {
+ char *infile = (char *)l->data;
+ if (!(inputfd = fopen (infile, "r"))) {
+ perror ("cant open input file");
+ exit (-1);
+ }
+
+ yyparse ();
+
+ reset_parser ();
+
+ l->data = inputfd;
+ l = l->next;
}
} else {
inputfd = stdin;
+ yyparse ();
}
- yyparse ();
-
check_result ();
if (!nonterm_list)
@@ -916,13 +1100,20 @@ main (int argc, char *argv [])
emit_kids ();
- yyparsetail ();
+ if (infiles) {
+ GList *l = infiles;
+ while (l) {
+ inputfd = l->data;
+ yyparsetail ();
+ fclose (inputfd);
+ l = l->next;
+ }
+ } else {
+ yyparsetail ();
+ }
if (cfile)
fclose (cfd);
- if (infile)
- fclose (inputfd);
-
return 0;
}
diff --git a/mono/monoburg/monoburg.h b/mono/monoburg/monoburg.h
index f1011867fab..6700fda0199 100644
--- a/mono/monoburg/monoburg.h
+++ b/mono/monoburg/monoburg.h
@@ -8,6 +8,7 @@ int yylex (void);
extern FILE *inputfd;
extern FILE *outputfd;
+extern GHashTable *definedvars;
typedef struct _Rule Rule;
@@ -49,15 +50,23 @@ struct _Rule {
Tree *create_tree (char *id, Tree *left, Tree *right);
-void create_term (char *id, int num);
+Term *create_term (char *id, int num);
+
+void create_term_prefix (char *id);
NonTerm *nonterm (char *id);
void start_nonterm (char *id);
+Rule *make_rule (char *id, Tree *tree);
+
+void rule_add (Rule *rule, char *code, char *cost, char *cfunc);
+
void create_rule (char *id, Tree *tree, char *code, char *cost,
char *cfunc);
void yyparsetail (void);
+void reset_parser (void);
+
#endif
diff --git a/mono/monoburg/monoburg.y b/mono/monoburg/monoburg.y
index 9c56a290a0d..ab461617dd2 100644
--- a/mono/monoburg/monoburg.y
+++ b/mono/monoburg/monoburg.y
@@ -27,6 +27,8 @@ static int yylinepos = 0;
char *text;
int ivalue;
Tree *tree;
+ Rule *rule;
+ GList *rule_list;
}
%token <text> IDENT
@@ -35,25 +37,46 @@ static int yylinepos = 0;
%token START
%token COST
%token TERM
+%token TERMPREFIX
%token <ivalue> INTEGER
%type <tree> tree
%type <text> optcost
%type <text> optcfunc
%type <text> optcode
+%type <rule> rule
+%type <rule_list> rule_list
%%
decls : /* empty */
| START IDENT { start_nonterm ($2); } decls
| TERM tlist decls
- | IDENT ':' tree optcost optcode optcfunc { create_rule ($1, $3, $5, $4, $6); } decls
+ | TERMPREFIX plist decls
+ | rule_list optcost optcode optcfunc {
+ GList *tmp;
+ for (tmp = $1; tmp; tmp = tmp->next) {
+ rule_add (tmp->data, $3, $2, $4);
+ }
+ g_list_free ($1);
+ } decls
;
-optcode : /* empty */ { $$ = NULL }
+rule : IDENT ':' tree { $$ = make_rule ($1, $3); }
+ ;
+
+rule_list : rule { $$ = g_list_append (NULL, $1); }
+ | rule ',' rule_list { $$ = g_list_prepend ($3, $1); }
+ ;
+
+optcode : /* empty */ { $$ = NULL; }
| CODE
;
+plist : /* empty */
+ | plist IDENT { create_term_prefix ($2);}
+ ;
+
tlist : /* empty */
| tlist IDENT { create_term ($2, -1);}
| tlist IDENT '=' INTEGER { create_term ($2, $4); }
@@ -93,10 +116,75 @@ yyerror (char *fmt, ...)
exit (-1);
}
+static int state = 0;
+
+void
+reset_parser ()
+{
+ state = 0;
+}
+
+struct pplist {
+ struct pplist *next;
+ gboolean ignore;
+};
+
+static struct pplist *pp = NULL;
+
+static char*
+getvar (const char *input)
+{
+ char *var = g_strchug (g_strdup (input));
+ char *ptr;
+
+ for (ptr = var; *ptr && *ptr != '\n'; ++ptr) {
+ if (g_ascii_isspace (*ptr)) {
+ break;
+ }
+ }
+ *ptr = '\0';
+
+ return var;
+}
+
+static void
+push_if (char *input, gboolean flip)
+{
+ struct pplist *new_pp = g_new (struct pplist, 1);
+ char *var = getvar (input);
+
+ new_pp->ignore = (g_hash_table_lookup (definedvars, var) == NULL) ^ flip;
+ new_pp->next = pp;
+
+ new_pp->ignore |= (pp ? pp->ignore : 0);
+ pp = new_pp;
+ g_free (var);
+}
+
+static void
+flip_if ()
+{
+ if (!pp)
+ yyerror ("%%else without %%if");
+
+ pp->ignore = !pp->ignore | (pp->next ? pp->next->ignore : 0);
+}
+
+static void
+pop_if ()
+{
+ struct pplist *prev_pp = pp;
+
+ if (!pp)
+ yyerror ("%%endif without %%if");
+
+ pp = pp->next;
+ g_free (prev_pp);
+}
+
static char
nextchar ()
{
- static int state = 0;
int next_state ;
gboolean ll;
@@ -110,6 +198,35 @@ nextchar ()
ll = (input [0] == '%' && input [1] == '%');
next_state = state;
+ if (state == 1) {
+ if (!ll && input [0] == '%') {
+ if (!strncmp (&input [1], "ifdef", 5)) {
+ push_if (&input [6], FALSE);
+ ll = TRUE;
+ continue;
+ }
+ else if (!strncmp (&input [1], "ifndef", 6)) {
+ push_if (&input [7], TRUE);
+ ll = TRUE;
+ continue;
+ }
+ else if (!strncmp (&input [1], "else", 4)) {
+ flip_if ();
+ ll = TRUE;
+ continue;
+ }
+ else if (!strncmp (&input [1], "endif", 5)) {
+ pop_if ();
+ ll = TRUE;
+ continue;
+ }
+ }
+ if (pp && pp->ignore) {
+ ll = TRUE;
+ continue;
+ }
+ }
+
switch (state) {
case 0:
if (ll) {
@@ -164,6 +281,11 @@ yylex (void)
return START;
}
+ if (!strncmp (next, "termprefix", 10) && isspace (next[10])) {
+ next += 10;
+ return TERMPREFIX;
+ }
+
if (!strncmp (next, "term", 4) && isspace (next[4])) {
next += 4;
return TERM;
diff --git a/mono/monoburg/sample.brg b/mono/monoburg/sample.brg
index 82812c7e322..619b6fc821d 100644
--- a/mono/monoburg/sample.brg
+++ b/mono/monoburg/sample.brg
@@ -26,7 +26,7 @@ struct _MBTree {
# we must fisrt define the terminals
# with or without numbers
#
-%term Assign Constant Fetch=3 Four=8 Mul=5 Plus=6
+%term Assign Constant Fetch=3 Four=8 Mul=5 Plus=6 AltFetch=7
#
# optional start nonterminal
@@ -54,6 +54,7 @@ addr: Plus(con,Mul(Four,reg)) 2
printf ("%s\n", mono_burg_rule_string [ern]);
}
+reg: AltFetch(addr),
reg: Fetch(addr) 1
{
int ern = mono_burg_rule (tree->state, MB_NTERM_reg);
diff --git a/mono/monograph/ChangeLog b/mono/monograph/ChangeLog
index 3ab82e73031..f1deb3ffe2e 100644
--- a/mono/monograph/ChangeLog
+++ b/mono/monograph/ChangeLog
@@ -1,4 +1,33 @@
+Mon May 24 13:36:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * monograph.c: default assembly name is "mscorlib" now.
+
+2003-11-12 Jackson Harper <jackson@ximian.com>
+
+ * monograph.c: Change default assembly name to mscorlib.dll
+
+Thu Feb 6 02:43:23 PST 2003 Piers Haken <piersh@friskit.com>
+
+ * monograph.c: more warning cleanups
+
+Tue Jan 28 18:53:08 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * monograph.c: more stats added.
+
+Mon Oct 7 12:25:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * monograph.c: added a --stats command line option to gather
+ statistics about the assembly code.
+
+2002-08-28 Dick Porter <dick@ximian.com>
+
+ * Makefile.am: Export HOST_CC for w32 builds
+
+Fri Jul 19 14:23:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * monograph.c: simple stats on opcode size.
+
Thu Mar 28 15:18:50 CET 2002 Paolo Molaro <lupus@ximian.com>
* monograph.c: some warning cleanups.
diff --git a/mono/monograph/Makefile.am b/mono/monograph/Makefile.am
index 5c1feb7e739..b66749cbef0 100644
--- a/mono/monograph/Makefile.am
+++ b/mono/monograph/Makefile.am
@@ -1,4 +1,8 @@
+if PLATFORM_WIN32
+export HOST_CC
+endif
+
bin_PROGRAMS = monograph
INCLUDES = \
@@ -7,9 +11,10 @@ INCLUDES = \
$(GLIB_CFLAGS)
monograph_LDADD = \
- ../metadata/libmetadata.a \
- ../io-layer/libwapi.a \
- ../utils/libmonoutils.a \
+ ../metadata/libmetadata.la \
+ ../io-layer/libwapi.la \
+ ../utils/libmonoutils.la \
+ $(LIBGC_LIBS) \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
-lm
diff --git a/mono/monograph/monograph.c b/mono/monograph/monograph.c
index 5098285e3b8..11f220226c1 100644
--- a/mono/monograph/monograph.c
+++ b/mono/monograph/monograph.c
@@ -1,11 +1,10 @@
#include <glib.h>
#include <string.h>
-#include "mono/metadata/class.h"
+#include "mono/metadata/class-internals.h"
#include "mono/metadata/assembly.h"
#include "mono/metadata/tokentype.h"
#include "mono/metadata/opcodes.h"
#include "mono/metadata/tabledefs.h"
-#include "mono/metadata/cil-coff.h" /* MonoCLIImageInfo */
#include "mono/metadata/mono-endian.h"
#include "mono/metadata/appdomain.h" /* mono_init */
#include "mono/metadata/debug-helpers.h"
@@ -33,14 +32,14 @@ print_subtypes (MonoImage *image, MonoClass *class, int depth) {
if (depth++ > max_depth)
return;
- t = &image->tables [MONO_TABLE_TYPEDEF];
+ t = mono_image_get_table_info (image, MONO_TABLE_TYPEDEF);
token = mono_metadata_token_index (class->type_token);
- token <<= TYPEDEFORREF_BITS;
- token |= TYPEDEFORREF_TYPEDEF;
+ token <<= MONO_TYPEDEFORREF_BITS;
+ token |= MONO_TYPEDEFORREF_TYPEDEF;
/* use a subgraph? */
- for (i = 0; i < t->rows; ++i) {
+ for (i = 0; i < mono_table_info_get_rows (t); ++i) {
if (token == mono_metadata_decode_row_col (t, i, MONO_TYPEDEF_EXTENDS)) {
child = mono_class_get (image, MONO_TOKEN_TYPE_DEF | (i + 1));
output_type_edge (class, child);
@@ -92,7 +91,7 @@ interface_graph (MonoImage *image, const char* cname) {
char *p;
guint32 cols [MONO_INTERFACEIMPL_SIZE];
guint32 token, i, count = 0;
- MonoTableInfo *intf = &image->tables [MONO_TABLE_INTERFACEIMPL];
+ MonoTableInfo *intf = mono_image_get_table_info (image, MONO_TABLE_INTERFACEIMPL);
cname = g_strdup (cname);
p = strrchr (cname, '.');
@@ -113,9 +112,9 @@ interface_graph (MonoImage *image, const char* cname) {
fprintf (output, "%s", graph_properties);
/* TODO: handle inetrface defined in one image and class defined in another. */
token = mono_metadata_token_index (class->type_token);
- token <<= TYPEDEFORREF_BITS;
- token |= TYPEDEFORREF_TYPEDEF;
- for (i = 0; i < intf->rows; ++i) {
+ token <<= MONO_TYPEDEFORREF_BITS;
+ token |= MONO_TYPEDEFORREF_TYPEDEF;
+ for (i = 0; i < mono_table_info_get_rows (intf); ++i) {
mono_metadata_decode_row (intf, i, cols, MONO_INTERFACEIMPL_SIZE);
/*g_print ("index: %d [%d implements %d]\n", index, cols [MONO_INTERFACEIMPL_CLASS], cols [MONO_INTERFACEIMPL_INTERFACE]);*/
if (token == cols [MONO_INTERFACEIMPL_INTERFACE]) {
@@ -130,6 +129,344 @@ interface_graph (MonoImage *image, const char* cname) {
}
+static int back_branch_waste = 0;
+static int branch_waste = 0;
+static int var_waste = 0;
+static int int_waste = 0;
+static int nop_waste = 0;
+static int has_exceptions = 0;
+static int num_exceptions = 0;
+static int max_exceptions = 0;
+static int has_locals = 0;
+static int num_locals = 0;
+static int max_locals = 0;
+static int has_args = 0;
+static int num_args = 0;
+static int max_args = 0;
+static int has_maxstack = 0;
+static int num_maxstack = 0;
+static int max_maxstack = 0;
+static int has_code = 0;
+static int num_code = 0;
+static int max_code = 0;
+static int has_branch = 0;
+static int num_branch = 0;
+static int max_branch = 0;
+static int has_condbranch = 0;
+static int num_condbranch = 0;
+static int max_condbranch = 0;
+static int has_calls = 0;
+static int num_calls = 0;
+static int max_calls = 0;
+static int has_throw = 0;
+static int num_throw = 0;
+static int max_throw = 0;
+static int has_switch = 0;
+static int num_switch = 0;
+static int max_switch = 0;
+static int cast_sealed = 0;
+static int cast_iface = 0;
+static int total_cast = 0;
+static int nonvirt_callvirt = 0;
+static int total_callvirt = 0;
+
+static void
+method_stats (MonoMethod *method) {
+ const MonoOpcode *opcode;
+ MonoMethodHeader *header;
+ const unsigned char *ip;
+ int i, n;
+ int local_branch = 0, local_condbranch = 0, local_throw = 0, local_calls = 0;
+ gint64 l;
+
+ if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))
+ return;
+ if (method->flags & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT))
+ return;
+
+ header = mono_method_get_header (method);
+ if (header->num_clauses)
+ has_exceptions++;
+ num_exceptions += header->num_clauses;
+ if (max_exceptions < header->num_clauses)
+ max_exceptions = header->num_clauses;
+ if (header->num_locals)
+ has_locals++;
+ num_locals += header->num_locals;
+ if (max_locals < header->num_locals)
+ max_locals = header->num_locals;
+
+ if (max_maxstack < header->max_stack)
+ max_maxstack = header->max_stack;
+ num_maxstack += header->max_stack;
+ if (header->max_stack != 8) /* just a guess */
+ has_maxstack++;
+
+ n = method->signature->hasthis + method->signature->param_count;
+ if (max_args < n)
+ max_args = n;
+ num_args += n;
+ if (n)
+ has_args++;
+
+ has_code++;
+ if (max_code < header->code_size)
+ max_code = header->code_size;
+ num_code += header->code_size;
+
+ ip = header->code;
+
+ while (ip < (header->code + header->code_size)) {
+ if (*ip == 0xfe) {
+ ++ip;
+ i = *ip + 256;
+ } else {
+ i = *ip;
+ }
+
+ opcode = &mono_opcodes [i];
+
+ switch (opcode->argument) {
+ case MonoInlineNone:
+ if (i == MONO_CEE_NOP)
+ nop_waste++;
+ ++ip;
+ break;
+ case MonoInlineI:
+ n = read32 (ip + 1);
+ if (n >= -1 && n <= 8) {
+ int_waste += 4;
+ g_print ("%s %d\n", mono_opcode_name (i), n);
+ } else if (n < 128 && n >= -128) {
+ int_waste += 3;
+ g_print ("%s %d\n", mono_opcode_name (i), n);
+ }
+ ip += 5;
+ break;
+ case MonoInlineType:
+ if (i == MONO_CEE_CASTCLASS || i == MONO_CEE_ISINST) {
+ guint32 token = read32 (ip + 1);
+ MonoClass *k = mono_class_get (method->klass->image, token);
+ if (k && k->flags & TYPE_ATTRIBUTE_SEALED)
+ cast_sealed++;
+ if (k && k->flags & TYPE_ATTRIBUTE_INTERFACE)
+ cast_iface++;
+ total_cast++;
+ }
+ ip += 5;
+ break;
+ case MonoInlineField:
+ case MonoInlineTok:
+ case MonoInlineString:
+ case MonoInlineSig:
+ case MonoShortInlineR:
+ ip += 5;
+ break;
+ case MonoInlineBrTarget:
+ n = read32 (ip + 1);
+ if (n < 128 && n >= -128) {
+ branch_waste += 3;
+ if (n < 0)
+ back_branch_waste += 3;
+ }
+ ip += 5;
+ break;
+ case MonoInlineVar:
+ n = read16 (ip + 1);
+ if (n < 256) {
+ if (n < 4) {
+ switch (i) {
+ case MONO_CEE_LDARG:
+ case MONO_CEE_LDLOC:
+ case MONO_CEE_STLOC:
+ var_waste += 3;
+ g_print ("%s %d\n", mono_opcode_name (i), n);
+ break;
+ default:
+ var_waste += 2;
+ g_print ("%s %d\n", mono_opcode_name (i), n);
+ break;
+ }
+ } else {
+ var_waste += 2;
+ g_print ("%s %d\n", mono_opcode_name (i), n);
+ }
+ }
+ ip += 3;
+ break;
+ case MonoShortInlineVar:
+ if ((signed char)ip [1] < 4 && (signed char)ip [1] >= 0) {
+ switch (i) {
+ case MONO_CEE_LDARG_S:
+ case MONO_CEE_LDLOC_S:
+ case MONO_CEE_STLOC_S:
+ var_waste++;
+ g_print ("%s %d\n", mono_opcode_name (i), (signed char)ip [1]);
+ break;
+ default:
+ break;
+ }
+ }
+ ip += 2;
+ break;
+ case MonoShortInlineI:
+ if ((signed char)ip [1] <= 8 && (signed char)ip [1] >= -1) {
+ g_print ("%s %d\n", mono_opcode_name (i), (signed char)ip [1]);
+ int_waste ++;
+ }
+ ip += 2;
+ break;
+ case MonoShortInlineBrTarget:
+ ip += 2;
+ break;
+ case MonoInlineSwitch: {
+ gint32 n;
+ ++ip;
+ n = read32 (ip);
+ ip += 4;
+ ip += 4 * n;
+ num_switch += n;
+ has_switch++;
+ if (max_switch < n)
+ max_switch = n;
+ break;
+ }
+ case MonoInlineR:
+ ip += 9;
+ break;
+ case MonoInlineI8:
+ l = read64 (ip + 1);
+ /* should load and convert */
+ if (l >= -1 && l <= 8) {
+ int_waste += 7;
+ } else if (l < 128 && l >= -128) {
+ int_waste += 6;
+ } else if (l <= 2147483647 && l >= (-2147483647 -1)) {
+ int_waste += 3;
+ }
+ ip += 9;
+ break;
+ case MonoInlineMethod:
+ if (i == MONO_CEE_CALLVIRT) {
+ MonoMethod *cm = mono_get_method (method->klass->image, read32 (ip + 1), NULL);
+ if (cm && !(cm->flags & METHOD_ATTRIBUTE_VIRTUAL))
+ nonvirt_callvirt++;
+ total_callvirt++;
+ }
+ ip += 5;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ switch (opcode->flow_type) {
+ case MONO_FLOW_BRANCH:
+ local_branch++;
+ break;
+ case MONO_FLOW_COND_BRANCH:
+ local_condbranch++;
+ break;
+ case MONO_FLOW_CALL:
+ local_calls++;
+ break;
+ case MONO_FLOW_ERROR:
+ local_throw++;
+ break;
+ }
+ }
+
+ if (local_branch)
+ has_branch++;
+ if (max_branch < local_branch)
+ max_branch = local_branch;
+ num_branch += local_branch;
+
+ if (local_condbranch)
+ has_condbranch++;
+ if (max_condbranch < local_condbranch)
+ max_condbranch = local_condbranch;
+ num_condbranch += local_condbranch;
+
+ if (local_calls)
+ has_calls++;
+ if (max_calls < local_calls)
+ max_calls = local_calls;
+ num_calls += local_calls;
+
+ if (local_throw)
+ has_throw++;
+ if (max_throw < local_throw)
+ max_throw = local_throw;
+ num_throw += local_throw;
+
+ return;
+}
+
+static int num_pdepth = 0;
+static int max_pdepth = 0;
+static int num_ifaces = 0;
+
+static void
+type_stats (MonoClass *klass) {
+ MonoClass *parent;
+ int depth = 0;
+
+ if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ num_ifaces++;
+ return;
+ }
+ parent = klass->parent;
+ while (parent) {
+ depth++;
+ parent = parent->parent;
+ }
+ num_pdepth += depth;
+ if (max_pdepth < depth)
+ max_pdepth = depth;
+}
+
+static void
+stats (MonoImage *image, const char *name) {
+ int i, num_methods, num_types;
+ MonoMethod *method;
+ MonoClass *klass;
+
+ num_methods = mono_image_get_table_rows (image, MONO_TABLE_METHOD);
+ for (i = 0; i < num_methods; ++i) {
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);
+ method_stats (method);
+ }
+ num_types = mono_image_get_table_rows (image, MONO_TABLE_TYPEDEF);
+ for (i = 0; i < num_types; ++i) {
+ klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | (i + 1));
+ type_stats (klass);
+ }
+
+ g_print ("Methods and code stats:\n");
+ g_print ("back branch waste: %d\n", back_branch_waste);
+ g_print ("branch waste: %d\n", branch_waste);
+ g_print ("var waste: %d\n", var_waste);
+ g_print ("int waste: %d\n", int_waste);
+ g_print ("nop waste: %d\n", nop_waste);
+ g_print ("has exceptions: %d/%d, total: %d, max: %d, mean: %f\n", has_exceptions, num_methods, num_exceptions, max_exceptions, num_exceptions/(double)has_exceptions);
+ g_print ("has locals: %d/%d, total: %d, max: %d, mean: %f\n", has_locals, num_methods, num_locals, max_locals, num_locals/(double)has_locals);
+ g_print ("has args: %d/%d, total: %d, max: %d, mean: %f\n", has_args, num_methods, num_args, max_args, num_args/(double)has_args);
+ g_print ("has maxstack: %d/%d, total: %d, max: %d, mean: %f\n", has_maxstack, num_methods, num_maxstack, max_maxstack, num_maxstack/(double)i);
+ g_print ("has code: %d/%d, total: %d, max: %d, mean: %f\n", has_code, num_methods, num_code, max_code, num_code/(double)has_code);
+ g_print ("has branch: %d/%d, total: %d, max: %d, mean: %f\n", has_branch, num_methods, num_branch, max_branch, num_branch/(double)has_branch);
+ g_print ("has condbranch: %d/%d, total: %d, max: %d, mean: %f\n", has_condbranch, num_methods, num_condbranch, max_condbranch, num_condbranch/(double)has_condbranch);
+ g_print ("has switch: %d/%d, total: %d, max: %d, mean: %f\n", has_switch, num_methods, num_switch, max_switch, num_switch/(double)has_switch);
+ g_print ("has calls: %d/%d, total: %d, max: %d, mean: %f\n", has_calls, num_methods, num_calls, max_calls, num_calls/(double)has_calls);
+ g_print ("has throw: %d/%d, total: %d, max: %d, mean: %f\n", has_throw, num_methods, num_throw, max_throw, num_throw/(double)has_throw);
+ g_print ("sealed type cast: %d/%d\n", cast_sealed, total_cast);
+ g_print ("interface type cast: %d/%d\n", cast_iface, total_cast);
+ g_print ("non virtual callvirt: %d/%d\n", nonvirt_callvirt, total_callvirt);
+
+ g_print ("\nType stats:\n");
+ g_print ("interface types: %d/%d\n", num_ifaces, num_types);
+ g_print ("parent depth: max: %d, mean: %d\n", max_pdepth, num_pdepth/(num_types - num_ifaces));
+}
+
static char *
get_signature (MonoMethod *method) {
GString *res;
@@ -191,7 +528,7 @@ print_method (MonoMethod *method, int depth) {
if (method->flags & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT))
return;
- header = ((MonoMethodNormal *)method)->header;
+ header = mono_method_get_header (method);
ip = header->code;
hash = g_hash_table_new (g_direct_hash, g_direct_equal);
@@ -269,9 +606,9 @@ method_graph (MonoImage *image, const char *name) {
MonoMethod *method = NULL;
if (!name) {
- guint32 token = ((MonoCLIImageInfo*)image->image_info)->cli_cli_header.ch_entry_point;
+ guint32 token = mono_image_get_entry_point (image);
if (!token || !(method = mono_get_method (image, token, NULL))) {
- g_print ("Cannot find entry point in %s: specify an explict method name.\n", image->name);
+ g_print ("Cannot find entry point in %s: specify an explict method name.\n", mono_image_get_filename (image));
exit (1);
}
} else {
@@ -318,10 +655,10 @@ link_bblock (MonoBasicBlock *from, MonoBasicBlock* to)
}
static int
-compare_bblock (void *a, void *b)
+compare_bblock (const void *a, const void *b)
{
- MonoBasicBlock **ab = a;
- MonoBasicBlock **bb = b;
+ MonoBasicBlock * const *ab = a;
+ MonoBasicBlock * const *bb = b;
return (*ab)->cil_code - (*bb)->cil_code;
}
@@ -458,7 +795,7 @@ mono_method_find_bblocks (MonoMethodHeader *header)
target = g_new0 (MonoBasicBlock, 1);
target->cil_code = itarget;
g_ptr_array_add (result, target);
- g_hash_table_insert (table, itarget, target);
+ g_hash_table_insert (table, (gpointer) itarget, target);
}
link_bblock (bb, target);
}
@@ -537,7 +874,7 @@ print_method_cfg (MonoMethod *method) {
int i, dfn;
char *code;
- header = ((MonoMethodNormal*)method)->header;
+ header = mono_method_get_header (method);
bblocks = mono_method_find_bblocks (header);
for (i = 0; i < bblocks->len; ++i) {
bb = (MonoBasicBlock*)g_ptr_array_index (bblocks, i);
@@ -558,7 +895,7 @@ print_method_cfg (MonoMethod *method) {
fprintf (output, "\tB%p -> B%p\n", bb, target);
}
}
-#if 0
+#if 1
for (i = 0; i < bblocks->len; ++i) {
bb = (MonoBasicBlock*)g_ptr_array_index (bblocks, i);
bb->dfn = 0;
@@ -580,9 +917,9 @@ method_cfg (MonoImage *image, const char *name) {
const static char *cfg_graph_properties = "\tnode [fontsize=8.0]\n\tedge [len=1.5,color=red]\n";
if (!name) {
- guint32 token = ((MonoCLIImageInfo*)image->image_info)->cli_cli_header.ch_entry_point;
+ guint32 token = mono_image_get_entry_point (image);
if (!token || !(method = mono_get_method (image, token, NULL))) {
- g_print ("Cannot find entry point in %s: specify an explict method name.\n", image->name);
+ g_print ("Cannot find entry point in %s: specify an explict method name.\n", mono_image_get_filename (image));
exit (1);
}
} else {
@@ -612,22 +949,25 @@ static void
usage (void) {
printf ("monograph 0.2 Copyright (c) 2002 Ximian, Inc\n");
printf ("Create call graph or type hierarchy information from CIL assemblies.\n");
- printf ("Usage: monograph [options] [assembly [typename|methodname]]\n");
+ printf ("Usage: monograph [options] [assembly [typename|methodname]]\n\n");
printf ("Valid options are:\n");
printf ("\t-c|--call output call graph instead of type hierarchy\n");
printf ("\t-C|--control-flow output control flow of methodname\n");
+ printf ("\t--stats output some statistics about the assembly\n");
printf ("\t-d|--depth num max depth recursion (default: 6)\n");
printf ("\t-o|--output filename write graph to file filename (default: stdout)\n");
printf ("\t-f|--fullname include namespace in type and method names\n");
printf ("\t-n|--neato invoke neato directly\n");
- printf ("\t-v|--verbose verbose operation\n");
- printf ("The default assembly is corlib.dll. The default method for\n");
- printf ("the --call and --control-flow options is the entrypoint.\n");
+ printf ("\t-v|--verbose verbose operation\n\n");
+ printf ("The default assembly is mscorlib.dll. The default method for\n");
+ printf ("the --call and --control-flow options is the entrypoint.\n\n");
printf ("When the --neato option is used the output type info is taken\n");
- printf ("from the output filename extension. You need the graphviz package installed\n");
- printf ("to be able to use this option.\n");
+ printf ("from the output filename extension. You need the graphviz package\n");
+ printf ("installed to be able to use this option and build bitmap files.\n");
+ printf ("Without --neato, monograph will create .dot files, a description\n");
+ printf ("file for a graph.\n\n");
printf ("Sample runs:\n");
- printf ("\tmonograph -n -o vt.png corlib.dll System.ValueType\n");
+ printf ("\tmonograph -n -o vt.png mscorlib.dll System.ValueType\n");
printf ("\tmonograph -n -o expr.png mcs.exe Mono.CSharp.Expression\n");
printf ("\tmonograph -n -o cfg.png -C mcs.exe Driver:Main\n");
printf ("\tmonograph -d 3 -n -o callgraph.png -c mis.exe\n");
@@ -638,7 +978,8 @@ enum {
GRAPH_TYPES,
GRAPH_CALL,
GRAPH_INTERFACE,
- GRAPH_CONTROL_FLOW
+ GRAPH_CONTROL_FLOW,
+ GRAPH_STATS
};
/*
@@ -658,6 +999,7 @@ enum {
int
main (int argc, char *argv[]) {
MonoAssembly *assembly;
+ MonoImage *image;
const char *cname = NULL;
const char *aname = NULL;
char *outputfile = NULL;
@@ -677,6 +1019,8 @@ main (int argc, char *argv[]) {
graphtype = GRAPH_CONTROL_FLOW;
} else if (strcmp (argv [i], "--interface") == 0 || strcmp (argv [i], "-i") == 0) {
graphtype = GRAPH_INTERFACE;
+ } else if (strcmp (argv [i], "--stats") == 0) {
+ graphtype = GRAPH_STATS;
} else if (strcmp (argv [i], "--fullname") == 0 || strcmp (argv [i], "-f") == 0) {
include_namespace = 1;
} else if (strcmp (argv [i], "--neato") == 0 || strcmp (argv [i], "-n") == 0) {
@@ -701,7 +1045,7 @@ main (int argc, char *argv[]) {
if (argc > i + 1)
cname = argv [i + 1];
if (!aname)
- aname = "corlib.dll";
+ aname = "mscorlib";
if (!cname && (graphtype == GRAPH_TYPES))
cname = "System.Object";
@@ -737,18 +1081,22 @@ main (int argc, char *argv[]) {
if (cname && strchr (cname, ':') && graphtype == GRAPH_TYPES)
graphtype = GRAPH_CALL;
+ image = mono_assembly_get_image (assembly);
switch (graphtype) {
case GRAPH_TYPES:
- type_graph (assembly->image, cname);
+ type_graph (image, cname);
break;
case GRAPH_CALL:
- method_graph (assembly->image, cname);
+ method_graph (image, cname);
break;
case GRAPH_INTERFACE:
- interface_graph (assembly->image, cname);
+ interface_graph (image, cname);
break;
case GRAPH_CONTROL_FLOW:
- method_cfg (assembly->image, cname);
+ method_cfg (image, cname);
+ break;
+ case GRAPH_STATS:
+ stats (image, cname);
break;
default:
g_error ("wrong graph type");
diff --git a/mono/os/.cvsignore b/mono/os/.cvsignore
index d0d610155fd..2e3104dd1a3 100644
--- a/mono/os/.cvsignore
+++ b/mono/os/.cvsignore
@@ -1,3 +1,5 @@
Makefile
Makefile.in
util.o
+.libs
+*.la
diff --git a/mono/os/Makefile.am b/mono/os/Makefile.am
index a2ea878301b..cdf8e46c4bd 100644
--- a/mono/os/Makefile.am
+++ b/mono/os/Makefile.am
@@ -1,10 +1,20 @@
+DIST_SUBDIRS = unix win32
+
+INCLUDES = -I$(top_srcdir)
+
+noinst_LTLIBRARIES = libmonoos.la
+
if PLATFORM_WIN32
-SUBDIRS = win32
+DIR=win32
else
-SUBDIRS = unix
+DIR=unix
endif
-EXTRA_DIST = util.h
+SUBDIRS = $(DIR)
+
+libmonoos_la_SOURCES = \
+ util.h \
+ gc_wrapper.h
+
+libmonoos_la_LIBADD = $(DIR)/libmonoos.la
-all:
- cp */*.a . \ No newline at end of file
diff --git a/mono/os/gc_wrapper.h b/mono/os/gc_wrapper.h
new file mode 100644
index 00000000000..bbc3e03e6e9
--- /dev/null
+++ b/mono/os/gc_wrapper.h
@@ -0,0 +1,49 @@
+#ifndef __MONO_OS_GC_WRAPPER_H__
+#define __MONO_OS_GC_WRAPPER_H__
+
+#include <config.h>
+
+#ifdef HAVE_BOEHM_GC
+
+ /* libgc specifies this on the command line,
+ * so we must define it ourselfs
+ */
+# define GC_GCJ_SUPPORT
+ /*
+ * Local allocation is only beneficial if we have __thread
+ * We had to fix a bug with include order in libgc, so only do
+ * it if it is the included one.
+ */
+
+# if defined(HAVE_KW_THREAD) && defined(USE_INCLUDED_LIBGC)
+# define GC_REDIRECT_TO_LOCAL
+# endif
+
+# ifdef HAVE_GC_GC_H
+# include <gc/gc.h>
+# include <gc/gc_typed.h>
+# include <gc/gc_mark.h>
+# include <gc/gc_gcj.h>
+# elif defined(HAVE_GC_H) || defined(USE_INCLUDED_LIBGC)
+# include <gc.h>
+# include <gc_typed.h>
+# include <gc_mark.h>
+# include <gc_gcj.h>
+# else
+# error have boehm GC without headers, you probably need to install them by hand
+# endif
+ /* for some strange resion, they want one extra byte on the end */
+# define MONO_GC_REGISTER_ROOT(x) \
+ GC_add_roots ((char*)&(x), (char*)&(x) + sizeof (x) + 1)
+ /* this needs to be called before ANY gc allocations. We can't use
+ * mono_gc_init here because we need to make allocations before that
+ * function is called
+ */
+# define MONO_GC_PRE_INIT() GC_init ()
+
+#else
+# define MONO_GC_REGISTER_ROOT(x) /* nop */
+# define MONO_GC_PRE_INIT()
+#endif
+
+#endif
diff --git a/mono/os/unix/.cvsignore b/mono/os/unix/.cvsignore
index d0d610155fd..7328b0dc2ac 100644
--- a/mono/os/unix/.cvsignore
+++ b/mono/os/unix/.cvsignore
@@ -1,3 +1,7 @@
Makefile
Makefile.in
util.o
+.deps
+.libs
+*.la
+*.lo
diff --git a/mono/os/unix/Makefile.am b/mono/os/unix/Makefile.am
index 244d475f22f..abdcab61738 100644
--- a/mono/os/unix/Makefile.am
+++ b/mono/os/unix/Makefile.am
@@ -1,6 +1,6 @@
INCLUDES = -I$(top_srcdir)
-noinst_LIBRARIES = libmonoos.a
+noinst_LTLIBRARIES = libmonoos.la
-libmonoos_a_SOURCES = util.c
+libmonoos_la_SOURCES = util.c
diff --git a/mono/os/unix/util.c b/mono/os/unix/util.c
index 442570c41d1..85d0fa6679f 100644
--- a/mono/os/unix/util.c
+++ b/mono/os/unix/util.c
@@ -11,13 +11,12 @@
/*
* mono_set_rootdir:
- * @vm_filename: The pathname of the code invoking us (argv [0])
*
* Informs the runtime of the root directory for the Mono installation,
* the vm_file
*/
void
-mono_set_rootdir (const char *vm_filename)
+mono_set_rootdir (void)
{
/* nothing on Unix */
}
diff --git a/mono/os/util.h b/mono/os/util.h
index e6b0ff3e7ec..fa78cd1aa3d 100644
--- a/mono/os/util.h
+++ b/mono/os/util.h
@@ -1,6 +1,6 @@
#ifndef _MONO_OS_UTIL_H_
#define _MONO_OS_UTIL_H_ 1
-void mono_set_rootdir (const char *vm_filename);
+void mono_set_rootdir (void);
#endif
diff --git a/mono/os/win32/.cvsignore b/mono/os/win32/.cvsignore
index d0d610155fd..7328b0dc2ac 100644
--- a/mono/os/win32/.cvsignore
+++ b/mono/os/win32/.cvsignore
@@ -1,3 +1,7 @@
Makefile
Makefile.in
util.o
+.deps
+.libs
+*.la
+*.lo
diff --git a/mono/os/win32/Makefile.am b/mono/os/win32/Makefile.am
index ed711878032..aff89782fc7 100644
--- a/mono/os/win32/Makefile.am
+++ b/mono/os/win32/Makefile.am
@@ -3,6 +3,6 @@ INCLUDES = \
$(GMODULE_CFLAGS) \
$(GLIB_CFLAGS)
-noinst_LIBRARIES = libmonoos.a
+noinst_LTLIBRARIES = libmonoos.la
-libmonoos_a_SOURCES = util.c
+libmonoos_la_SOURCES = util.c
diff --git a/mono/os/win32/util.c b/mono/os/win32/util.c
index 94f4dc6d7b9..8c95f0db6d3 100644
--- a/mono/os/win32/util.c
+++ b/mono/os/win32/util.c
@@ -7,25 +7,52 @@
* (C) 2002 Ximian, Inc. (http://www.ximian.com)
*/
#include <config.h>
+#include <windows.h>
#include <mono/metadata/metadata.h>
+#include <mono/metadata/assembly.h>
#include <mono/os/util.h>
+#ifdef UNDER_CE
+#undef GetModuleFileName
+#define GetModuleFileName ceGetModuleFileNameA
+
+DWORD ceGetModuleFileNameA(HMODULE hModule, char* lpFilename, DWORD nSize)
+{
+ DWORD res = 0;
+ wchar_t* wbuff = (wchar_t*)LocalAlloc(LPTR, nSize*2);
+ res = GetModuleFileNameW(hModule, wbuff, nSize);
+ if (res) {
+ int len = wcslen(wbuff);
+ WideCharToMultiByte(CP_ACP, 0, wbuff, len, lpFilename, len, NULL, NULL);
+ }
+ LocalFree(wbuff);
+ return res;
+}
+#endif
+
/*
* mono_set_rootdir:
- * @vm_filename: The pathname of the code invoking us (argv [0])
*
* Informs the runtime of the root directory for the Mono installation,
* the vm_file
*/
void
-mono_set_rootdir (const char *vm_filename)
+mono_set_rootdir (void)
{
- char *dir = g_dirname (vm_filename);
- char *root = g_strconcat (dir, "/../lib", NULL);
+ gunichar2 moddir [MAXPATHLEN];
+ gchar *bindir, *installdir, *root, *utf8name;
+
+ GetModuleFileNameW (NULL, moddir, sizeof(moddir));
+ utf8name = g_utf16_to_utf8 (moddir, -1, NULL, NULL, NULL);
+ bindir = g_path_get_dirname (utf8name);
+ installdir = g_path_get_dirname (bindir);
+ root = g_build_path (G_DIR_SEPARATOR_S, installdir, "lib", NULL);
mono_assembly_setrootdir (root);
g_free (root);
- g_free (dir);
+ g_free (installdir);
+ g_free (bindir);
+ g_free (utf8name);
}
diff --git a/mono/profiler/.cvsignore b/mono/profiler/.cvsignore
new file mode 100644
index 00000000000..3ff24e7a6bb
--- /dev/null
+++ b/mono/profiler/.cvsignore
@@ -0,0 +1,7 @@
+Makefile.in
+Makefile
+.deps
+.libs
+mono-cov.lo
+libmono-profiler-cov.la
+.cvsignore
diff --git a/mono/profiler/ChangeLog b/mono/profiler/ChangeLog
new file mode 100644
index 00000000000..e4f70e52634
--- /dev/null
+++ b/mono/profiler/ChangeLog
@@ -0,0 +1,12 @@
+2003-11-12 Jackson Harper <jackson@ximian.com>
+
+ * mono-cov.c: Change default assembly name to mscorlib.dll
+
+Tue Jul 1 11:26:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am: added.
+
+Mon Jun 16 18:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mono-cov.c: coverage profiler.
+
diff --git a/mono/profiler/Makefile.am b/mono/profiler/Makefile.am
new file mode 100644
index 00000000000..cc15ab8d52e
--- /dev/null
+++ b/mono/profiler/Makefile.am
@@ -0,0 +1,15 @@
+
+INCLUDES = \
+ -fexceptions -DMONO_USE_EXC_TABLES \
+ -I$(top_srcdir) \
+ $(GMODULE_CFLAGS) \
+ $(GLIB_CFLAGS)
+
+if JIT_SUPPORTED
+
+lib_LTLIBRARIES = libmono-profiler-cov.la
+endif
+
+libmono_profiler_cov_la_SOURCES = mono-cov.c
+libmono_profiler_cov_la_LIBADD = $(top_builddir)/mono/mini/libmono.la
+
diff --git a/mono/profiler/mono-cov.c b/mono/profiler/mono-cov.c
new file mode 100644
index 00000000000..3b41b0208e7
--- /dev/null
+++ b/mono/profiler/mono-cov.c
@@ -0,0 +1,148 @@
+#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>
+
+/*
+ * 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 + 3);
+ 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 + 3);
+ 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)
+{
+}
+
+/* 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_set_events (MONO_PROFILE_ENTER_LEAVE | MONO_PROFILE_COVERAGE);
+}
+
+
diff --git a/mono/tests/.cvsignore b/mono/tests/.cvsignore
index 602a0b0fd10..00a10e161d3 100644
--- a/mono/tests/.cvsignore
+++ b/mono/tests/.cvsignore
@@ -5,3 +5,6 @@ Makefile
.libs
libtest.la
libtest.lo
+TestDriver.dll
+0
+stest.dat
diff --git a/mono/tests/ChangeLog b/mono/tests/ChangeLog
new file mode 100644
index 00000000000..29c92467a8c
--- /dev/null
+++ b/mono/tests/ChangeLog
@@ -0,0 +1,338 @@
+2004-11-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.cs: Add test for loading dynamic assemblies using
+ Assembly.LoadWithPartialName ().
+
+2004-11-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * loader.cs: New file for assembly loading tests.
+
+2004-10-29 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * cattr-object.cs: Correct type checking so test will stop giving
+ false negatives.
+
+2004-10-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs: Add test for prefixing 'lib' to dll names.
+
+2004-09-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal.cs: Add test for GetFunctionPointerForDelegate.
+
+ * libtest.c pinvoke2.cs: Add test for returning delegates.
+
+2004-09-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Add marshal.cs.
+
+ * marshal.cs: New file for Marshal tests.
+
+2004-09-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c: Free memory using CoTaskMemFree on windows.
+ * libtest.c (mono_test_stdcall_name_mangling): Remove declspec(dllimport).
+
+2004-09-21 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c (mono_test_stdcall_name_mangling): Add test for stdcall
+ name mangling on windows.
+
+2004-09-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs libtest.c: Add test for stdcall name mangling on windows.
+
+2004-09-08 Lluis Sanchez Gual <lluis@novell.com>
+
+ * delegate8.cs: New regression test for bug #59299.
+ * Makefile.am: Added delegate8.cs.
+
+2004-09-07 Duncan Mak <duncan@ximian.com>
+
+ * typeof-ptr.cs: Add an unsafe section to the code that's using
+ direct pointers. This was breaking the test stage on the build boxes.
+
+2004-09-07 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c (mono_test_marshal_string_array): Add test for null
+ terminating string arrays.
+
+2004-09-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c: Mark delegates with __stdcall on windows.
+
+2004-09-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs libtest.c: Fix memory management in tests.
+
+ * pinvoke14.cs: Merge this into pinvoke2.cs.
+
+2004-09-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal9.cs libtest.c: Fix memory leaks in test.
+
+2004-08-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke16.cs: Merge this into pinvoke2.cs, and fix it.
+
+ * marshal9.cs: Clean up and expand custom marshalling tests.
+
+ * marshal10.cs: Merge this into marshal9.cs.
+
+ * pinvoke12.cs: Remove, this was merged into pinvoke2.cs a long time
+ ago.
+
+2004-08-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs libtest.c: New test for byref string arrays.
+
+2004-08-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs libtest.c: Add AMD64 structs-by-value tests.
+
+2004-07-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal10.cs libtest.c: Remove incorrect time_t custom marshalling
+ test.
+
+2004-07-06 Ben Maurer <bmaurer@ximian.com>
+
+ * reflection-const-field.cs: New test for reflection on
+ constant fields.
+
+2004-07-05 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am pinvoke3.cs pinvoke9.cs: Merge pinvoke9 into pinvoke3.
+
+2004-07-03 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke3.cs libtest.c: New test for returning delegates from a
+ delegate.
+
+ * pinvoke2.cs libtest.c: New tests for stringbuilder marshalling.
+
+2004-07-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (CLEANFILES): Delete .stdout files too.
+
+2004-05-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * invoke.cs: Add an Invoke test.
+
+2004-05-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke3.cs libtest.c: New tests for byref struct marshalling.
+
+ * static-constructor.cs: Add new regression test for bug #59193.
+
+ * setenv.cs: Fix this after marshalling changes.
+
+2004-05-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke3.cs libtest.c: Add tests for fnptr->delegate marshalling.
+
+ * Makefile.am (DISABLED_TESTS): appdomain-unload.exe seems to run too.
+
+2004-05-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (DISABLED_TESTS): Reenable remoting2 and remoting3.
+
+2004-05-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (PLATFORM_DISABLED_TESTS): Reenable thread abort test.
+
+2004-05-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal9.cs marshal10.cs: Fix custom marshalling tests.
+
+2004-05-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am (EXTRA_DIST): Distribute benchmarks as well.
+
+ * pinvoke2.cs libtest.c: Add tests for AsAny marshalling.
+
+2004-05-06 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Disable thread6.exe since it might hang. Fix check for
+ failed tests.
+
+ * Makefile.am: Only disable thread6.exe on x86.
+
+2004-04-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs libtest.c: New tests for long fields inside structs.
+
+2004-04-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am test-driver: Disable some failing tests.
+
+2004-04-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke3.cs libtest.c: Add test for string marshalling in delegates.
+
+2004-04-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c pinvoke2.cs marshal4.cs Makefile.am: Add more tests for
+ marshalling delegate fields in structs. Merge marshal4.cs into
+ pinvoke2.cs.
+
+ * libtest.c pinvoke2.cs: Add more tests for unicode marshalling.
+
+2004-04-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c pinvoke2.cs: Add test for unicode string array marshalling.
+
+2004-04-10 Bernie Solomon <bernard@ugsolutions.com>
+
+ * libtest.c: declare SetLastError on Windows
+
+2004-03-30 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * synchronized.cs: Monitor.Exit does not throw an exception anymore if the
+ lock is not owned by the current thread (see bug #56157). Modified test that
+ checked this.
+
+2004-03-16 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c pinvoke2.cs: Add new test for implicit [Out] marshalling
+ of char[].
+
+2004-03-15 Bernie Solomon <bernard@ugsolutions.com>
+
+ * libtest.c (mono_test_marshal_time_t): fix
+ for current code on 64 bit machines with 64bit time
+
+ * marshal9.cs marshal10.cs: Do arithmetic on
+ pointers as 64bits.
+
+2004-03-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * setenv.cs: Handle DllNotFoundException.
+
+ * pinvoke2.cs pinvoke12.cs: Merge pinvoke12.cs into pinvoke2.cs.
+
+2004-02-23 Zoltan Varga <vargaz@freemail.hu>
+
+ * many-locals.cs: Add tests for locals with large stack frame offsets.
+
+2004-02-18 Zoltan Varga <vargaz@freemail.hu>
+
+ * switch.cs: Add test for bug #54473.
+
+2004-02-14 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c: Add <time.h>
+
+ * delegate.cs: Add test for bug #52092.
+
+2004-02-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * marshal10.cs: Oops, wrong test.
+
+ * libtest.c: Add valuetype marshaling test.
+
+ * marshal9.cs: Fix after marshaling changes.
+
+ * marshal10.cs: Add valuetype marshaling test.
+
+2004-02-10 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Remove the SHELL=bash setting since some people do not seem to
+ have bash.
+
+2004-02-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs libtest.c: Add test for unicode StringBuilder marshalling.
+
+ * pinvoke.cs libtest.c: Add test for Sparc V8 split register/stack double
+ parameter passing.
+
+2004-01-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * setenv.cs: Make this run on platforms without setenv.
+
+2004-01-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * Makefile.am: Set SHELL to bash, since some commands require it.
+
+2004-01-22 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke17.cs: Fix test.
+
+2004-01-19 Zoltan Varga <vargaz@freemail.hu>
+
+ * pinvoke2.cs: Add tests for DllImport problems.
+
+ * pinvoke.cs: Make this run under linux.
+
+2004-01-09 Zoltan Varga <vargaz@freemail.hu>
+
+ * custom-attr.cs: Add test for properties with array type.
+
+2003-12-13 Patrik Torstensson <p@rxc.se>
+
+ * bug-42136.cs: invalid liveness analyse for locals
+ used in try and catch block. (exceptions not counted
+ for in the liveness analyse)
+ * Makefile.am: added bug-42136.cs
+
+2003-12-13 Patrik Torstensson <p@rxc.se>
+
+ * bug-48015.cs: new test for obj.Equals on ContextBound objects
+ * Makefile.am: added bug-48015.cs.
+
+2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
+
+ * context-static.cs: new test for ContextStaticAttribute.
+ * Makefile.am: added context-static.cs.
+
+2003-11-17 Zoltan Varga <vargaz@freemail.hu>
+
+ * cattr-object.cs: Fix test so it does not count the attributes on the
+ Object class.
+
+2003-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * appdomain-unload.cs: Get rid of hardcoded file names.
+
+ * appdomain-unload.cs: New file. AppDomain Unloading tests.
+
+ * Makefile: Add new test + enable IL tests now that we have a working
+ ilasm.
+
+ * delegate7.cs: Convert it to use the test driver + add regression test
+ for #50366.
+
+2003-10-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * libtest.c pinvoke2.cs: Add tests for [In,Out] marshalling of arrays.
+
+2003-10-15 Zoltan Varga <vargaz@freemail.hu>
+
+ * vararg.il: New file.
+
+ * Makefile.am: Added vararg.il.
+
+2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
+
+ * Makefile.am: fix so it works if builddir != srcdir
+
+ * libtest.c: (mono_test_empty_struct) make it exist for
+ non-GCC builds (and possibly pass depending on trampolines).
+ (mono_test_marshal_bool_byref) bools marshal as ints by default
+
+2003-10-13 Zoltan Varga <vargaz@freemail.hu>
+
+ * bug-46781.cs: New regression test.
+
+ * libtest.c pinvoke2.cs: Add new test for SetLastError functionality.
+
+ * Makefile.am (TEST_CS_SRC): Remove merged tests.
+
+ * pinvoke2.cs pinvoke3.cs: Merge tests 4-8 into these files +
+ convert tests so they run with the test driver used by mini.
+
+ * pinvoke3.cs libtest.c: Add tests for class arguments and return
+ values.
+
+ * pinvoke4.cs pinvoke5.cs pinvoke6.cs pinvoke7.cs pinvoke8.cs: Removed.
diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am
index 1498e9b7499..cc612feaaad 100644
--- a/mono/tests/Makefile.am
+++ b/mono/tests/Makefile.am
@@ -1,15 +1,16 @@
TEST_PROG=../interpreter/mint
-JITTEST_PROG=../jit/mono
-RUNTIME_ARGS=--config tests-config
-
-CSC=csc /unsafe
+JITTEST_PROG=../mini/mono
+RUNTIME_ARGS=--config tests-config --optimize=all
+#CSC=csc /unsafe
+CSC=mcs --unsafe -nowarn:0162
BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
-TESTSRC= \
+TEST_CS_SRC= \
array-init.cs \
arraylist.cs \
+ checked.cs \
char-isnumber.cs \
create-instance.cs \
field-layout.cs \
@@ -36,11 +37,27 @@ TESTSRC= \
exception12.cs \
exception13.cs \
exception14.cs \
+ exception15.cs \
+ exception16.cs \
struct.cs \
valuetype-gettype.cs \
+ typeof-ptr.cs \
static-constructor.cs \
pinvoke.cs \
pinvoke1.cs \
+ pinvoke2.cs \
+ pinvoke3.cs \
+ pinvoke10.cs \
+ pinvoke11.cs \
+ pinvoke13.cs \
+ pinvoke15.cs \
+ pinvoke17.cs \
+ pinvoke18.cs \
+ invoke.cs \
+ invoke2.cs \
+ runtime-invoke.cs \
+ invoke-string-ctors.cs \
+ reinit.cs \
box.cs \
array.cs \
enum.cs \
@@ -50,6 +67,8 @@ TESTSRC= \
assignable-tests.cs \
array-cast.cs \
cattr-compile.cs \
+ cattr-field.cs \
+ cattr-object.cs \
custom-attr.cs \
double-cast.cs \
newobj-valuetype.cs \
@@ -65,6 +84,7 @@ TESTSRC= \
reflection-prop.cs \
reflection4.cs \
reflection5.cs \
+ reflection-const-field.cs \
many-locals.cs \
string-compare.cs \
test-prime.cs \
@@ -89,10 +109,14 @@ TESTSRC= \
jit-float.cs \
pop.cs \
time.cs \
- appdomain.cs \
+ appdomain.cs \
+ appdomain1.cs \
+ appdomain2.cs \
+ appdomain3.cs \
appdomain-client.cs \
+ appdomain-unload.cs \
+ loader.cs \
pointer.cs \
- vararg.cs \
rounding.cs \
hashcode.cs \
delegate1.cs \
@@ -100,9 +124,14 @@ TESTSRC= \
delegate3.cs \
delegate4.cs \
delegate5.cs \
+ delegate6.cs \
+ delegate7.cs \
+ delegate8.cs \
remoting1.cs \
remoting2.cs \
remoting3.cs \
+ remoting4.cs \
+ remoting5.cs \
nonvirt.cs \
largeexp.cs \
largeexp2.cs \
@@ -112,59 +141,170 @@ TESTSRC= \
bound.cs \
array-invoke.cs \
decimal.cs \
+ decimal-array.cs \
+ marshal.cs \
marshal1.cs \
+ marshal2.cs \
+ marshal3.cs \
+ marshal5.cs \
+ marshal6.cs \
+ marshal7.cs \
+ marshal8.cs \
+ marshal9.cs \
+ test-byval-in-struct.cs \
+ thread.cs \
+ thread5.cs \
+ thread6.cs \
+ thread-static.cs \
+ context-static.cs \
+ float-pop.cs \
+ interfacecast.cs \
+ array3.cs \
+ classinit.cs \
+ classinit2.cs \
+ synchronized.cs \
+ async_read.cs \
+ threadpool.cs \
+ threadpool1.cs \
+ base-definition.cs \
+ bug-27420.cs \
+ bug-47295.cs \
+ bug-46781.cs \
+ bug-48015.cs \
+ bug-42136.cs
+
+if X86
+PLATFORM_DISABLED_TESTS=
+endif
+
+DISABLED_TESTS= \
+ $(PLATFORM_DISABLED_TESTS)
+
+# These only compile with MS CSC
+TEST_CSC_SRC= \
+ vararg.cs
+
+TEST_IL_SRC= \
cpblkTest.il \
- jmpTest.il \
+ jmpTest.il \
calliTest.il \
ckfiniteTest.il \
locallocTest.il \
- initblkTest.il
+ initblkTest.il \
+ qt-instance.il \
+ vararg.il \
+ bug-29859.il \
+ even-odd.il
-TESTSI_TMP=$(TESTSRC:.cs=.exe)
-TESTSI=$(TESTSI_TMP:.il=.exe)
+TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
+TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
TESTBS=$(BENCHSRC:.cs=.exe)
-EXTRA_DIST=test-driver $(TESTSRC)
+EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC)
%.exe: %.il
- ilasm $< /OUTPUT=$@
+ ilasm -out:$@ $<
-%.exe: %.cs
- $(CSC) $<
+%.exe: %.cs TestDriver.dll
+ $(CSC) -r:TestDriver.dll -out:$@ $<
+
+test: testjit
+
+TestDriver.dll:
+ $(CSC) -target:library -o $@ $(srcdir)/../mini/TestDriver.cs
+
+test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
+ @failed=0; \
+ passed=0; \
+ export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
+ for i in $(TESTSI_CS); do \
+ if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+ then \
+ passed=`expr $${passed} + 1`; \
+ else \
+ if [ $$? = 2 ]; then break; fi; \
+ failed=`expr $${failed} + 1`; \
+ fi \
+ done; \
+ echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) failed."; echo
-test: $(TEST_PROG) $(TESTSI) libtest.la
+test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
@failed=0; \
passed=0; \
export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
- for i in $(TESTSI); do \
- if ./test-driver $(TEST_PROG) $$i $(RUNTIME_ARGS); \
+ for i in $(TESTSI_IL); do \
+ if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
+ if [ $$? = 2 ]; then break; fi; \
failed=`expr $${failed} + 1`; \
fi \
done; \
- echo "$${passed} test(s) passed. $${failed} test(s) failed."
+ echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) failed."; echo
testb: $(TEST_PROG) $(TESTBS)
for i in $(TESTBS); do \
- ./test-driver $(TEST_PROG) $$ii $(RUNTIME_ARGS); \
+ $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
done
-testjit: $(JITTEST_PROG) $(TESTSI) $(TESTBS)
+testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
@failed=0; \
passed=0; \
+ failed_tests="";\
export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
- for i in $(TESTSI) $(TESTBS); do \
- if ./test-driver $(JITTEST_PROG) $$i $(RUNTIME_ARGS); \
+ for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
+ rm -f $${i}.so; \
+ if $(srcdir)/test-driver $(JITTEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
+ if [ $$? = 2 ]; then break; fi; \
failed=`expr $${failed} + 1`; \
+ failed_tests="$${failed_tests} $$i"; \
fi \
done; \
- echo "$${passed} test(s) passed. $${failed} test(s) failed."
+ echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
+ if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi;
+
+testaot: $(TESTSI_CS) $(TESTBS) libtest.la
+ @failed=0; \
+ passed=0; \
+ failed_tests="";\
+ export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
+ for i in $(TESTSI_CS) $(TESTBS); do \
+ rm -f $${i}.so; \
+ $(JITTEST_PROG) --aot $${i} > /dev/null; \
+ if $(srcdir)/test-driver $(JITTEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+ then \
+ passed=`expr $${passed} + 1`; \
+ else \
+ if [ $$? = 2 ]; then break; fi; \
+ failed=`expr $${failed} + 1`; \
+ failed_tests="$${failed_tests} $$i"; \
+ fi \
+ done; \
+ echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
+ if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi;
+
+testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
+ @failed=0; \
+ passed=0; \
+ failed_tests="";\
+ export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
+ for i in $(TESTSI_CS) $(TESTSI_IL); do \
+ if $(srcdir)/test-driver $(TEST_PROG) $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+ then \
+ passed=`expr $${passed} + 1`; \
+ else \
+ if [ $$? = 2 ]; then break; fi; \
+ failed=`expr $${failed} + 1`; \
+ failed_tests="$${failed_tests} $$i"; \
+ fi \
+ done; \
+ echo "$${passed} test(s) passed. $${failed} test(s) failed."; \
+ if [ $$failed != 0 ]; then echo -e "\nFailed tests:\n"; for i in $${failed_tests}; do echo $${i}; done; fi ;
testjitspeed: $(JITTEST_PROG) $(TESTBS)
for i in $(TESTBS); do \
@@ -177,5 +317,10 @@ check:
noinst_LTLIBRARIES = libtest.la
+INCLUDES = $(GLIB_CFLAGS)
+
libtest_la_LDFLAGS = -rpath `pwd`
libtest_la_SOURCES = libtest.c
+libtest_la_LIBADD = $(GLIB_LIBS)
+
+CLEANFILES = $(TESTSI_CS) $(TESTSI_IL) TestDriver.dll *.stdout
diff --git a/mono/tests/appdomain-client.cs b/mono/tests/appdomain-client.cs
index 4b9585bbd86..5cc311ee361 100644
--- a/mono/tests/appdomain-client.cs
+++ b/mono/tests/appdomain-client.cs
@@ -10,11 +10,10 @@ class Client {
int res = 0;
foreach (string s in args) {
- Console.WriteLine (s);
res += Convert.ToInt32 (s);
}
- Console.WriteLine ("Sum: " + res);
+ Console.WriteLine ("(appdomain-client.exe) Sum: " + res);
return res;
}
}
diff --git a/mono/tests/appdomain-unload.cs b/mono/tests/appdomain-unload.cs
new file mode 100644
index 00000000000..8da67e96037
--- /dev/null
+++ b/mono/tests/appdomain-unload.cs
@@ -0,0 +1,180 @@
+using System;
+using System.Threading;
+
+[Serializable]
+public class Foo {
+
+ ~Foo () {
+ Console.WriteLine ("FINALIZING IN DOMAIN " + AppDomain.CurrentDomain.FriendlyName + ": " + AppDomain.CurrentDomain.IsFinalizingForUnload ());
+ }
+}
+
+[Serializable]
+public class SlowFinalize {
+
+ ~SlowFinalize () {
+ Console.WriteLine ("FINALIZE1.");
+ try {
+ Thread.Sleep (500);
+ }
+ catch (Exception ex) {
+ Console.WriteLine ("A: " + ex);
+ }
+ Console.WriteLine ("FINALIZE2.");
+ }
+}
+
+[Serializable]
+public class AThread {
+
+ public AThread () {
+ new Thread (new ThreadStart (Run)).Start ();
+ }
+
+ public void Run () {
+ try {
+ while (true)
+ Thread.Sleep (100);
+ }
+ catch (ThreadAbortException ex) {
+ Console.WriteLine ("Thread aborted correctly.");
+ }
+ }
+}
+
+[Serializable]
+// A Thread which refuses to die
+public class BThread {
+
+ public BThread () {
+ new Thread (new ThreadStart (Run)).Start ();
+ }
+
+ public void Run () {
+ try {
+ while (true)
+ Thread.Sleep (100);
+ }
+ catch (ThreadAbortException ex) {
+ Thread.Sleep (1000000000);
+ }
+ }
+}
+
+public class UnloadThread {
+
+ AppDomain domain;
+
+ public UnloadThread (AppDomain domain) {
+ this.domain = domain;
+ }
+
+ public void Run () {
+ Console.WriteLine ("UNLOAD1");
+ AppDomain.Unload (domain);
+ Console.WriteLine ("UNLOAD2");
+ }
+}
+
+public class Tests
+{
+ public static int Main() {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ public static int test_0_unload () {
+ for (int i = 0; i < 10; ++i) {
+ AppDomain appDomain = AppDomain.CreateDomain("Test-unload" + i);
+ AppDomain.Unload(appDomain);
+ }
+
+ return 0;
+ }
+
+ public static int test_0_unload_default () {
+ try {
+ AppDomain.Unload (Thread.GetDomain ());
+ }
+ catch (CannotUnloadAppDomainException) {
+ return 0;
+ }
+ return 1;
+ }
+
+ public static int test_0_unload_after_unload () {
+ AppDomain domain = AppDomain.CreateDomain ("Test2");
+ AppDomain.Unload (domain);
+
+ try {
+ AppDomain.Unload (domain);
+ }
+ catch (Exception) {
+ return 0;
+ }
+
+ return 1;
+ }
+
+ public static int test_0_is_finalizing () {
+ AppDomain domain = AppDomain.CreateDomain ("Test-is-finalizing");
+ object o = domain.CreateInstanceFromAndUnwrap (typeof (Tests).Assembly.Location, "Foo");
+
+ if (domain.IsFinalizingForUnload ())
+ return 1;
+
+ AppDomain.Unload (domain);
+
+ return 0;
+ }
+
+ public static int test_0_unload_with_active_threads () {
+ AppDomain domain = AppDomain.CreateDomain ("Test3");
+ object o = domain.CreateInstanceFromAndUnwrap (typeof (Tests).Assembly.Location, "AThread");
+ Thread.Sleep (100);
+
+ AppDomain.Unload (domain);
+
+ return 0;
+ }
+
+ public static int test_0_unload_with_active_threads_timeout () {
+ AppDomain domain = AppDomain.CreateDomain ("Test4");
+ object o = domain.CreateInstanceFromAndUnwrap (typeof (Tests).Assembly.Location, "BThread");
+ Thread.Sleep (100);
+
+ try {
+ AppDomain.Unload (domain);
+ }
+ catch (Exception) {
+ return 0;
+ }
+
+ return 1;
+ }
+
+ // FIXME: This does not work yet, because the thread is finalized too
+ // early
+ /*
+ public static int test_0_unload_during_unload () {
+ AppDomain domain = AppDomain.CreateDomain ("Test3");
+ object o = domain.CreateInstanceFromAndUnwrap (typeof (Tests).Assembly.Location, "SlowFinalize");
+
+ UnloadThread t = new UnloadThread (domain);
+
+ // Start unloading in a separate thread
+ new Thread (new ThreadStart (t.Run)).Start ();
+
+ Thread.Sleep (100);
+
+ try {
+ AppDomain.Unload (domain);
+ }
+ catch (Exception) {
+ Console.WriteLine ("OK");
+ }
+
+ return 0;
+ }
+*/
+}
+
diff --git a/mono/tests/appdomain.cs b/mono/tests/appdomain.cs
index 32511033f46..577ab6e8567 100644
--- a/mono/tests/appdomain.cs
+++ b/mono/tests/appdomain.cs
@@ -22,14 +22,14 @@ class Container {
Console.WriteLine (AppDomain.CurrentDomain.FriendlyName);
- AppDomain newDomain = AppDomain.CreateDomain ("NewDomain", new Evidence (), setup);
+ AppDomain newDomain = AppDomain.CreateDomain ("NewDomain", null, setup);
string[] args = { "1", "2", "3"};
res = newDomain.ExecuteAssembly ("appdomain-client.exe", null, args);
if (res != arg_sum (args))
return 1;
- Console.WriteLine ("Ready");
+ Console.WriteLine ("test-ok");
return 0;
}
diff --git a/mono/tests/appdomain1.cs b/mono/tests/appdomain1.cs
new file mode 100644
index 00000000000..da62e738cb9
--- /dev/null
+++ b/mono/tests/appdomain1.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Security.Policy;
+using System.Runtime.Remoting;
+using System.Threading;
+
+class Container {
+
+ class MBRTest : MarshalByRefObject
+ {
+ public int Int {
+ get {
+ return (int) AppDomain.CurrentDomain.GetData("test_integer");
+ }
+ }
+
+ public string Str {
+ get {
+ return (string) AppDomain.CurrentDomain.GetData("test_string");
+ }
+ }
+
+ public bool Bool {
+ get {
+ return (bool) AppDomain.CurrentDomain.GetData("test_bool");
+ }
+ }
+
+ public int [] Arr {
+ get {
+ return (int []) AppDomain.CurrentDomain.GetData("test_array");
+ }
+ }
+ }
+
+ static int Main ()
+ {
+ Console.WriteLine ("Friendly name: " + AppDomain.CurrentDomain.FriendlyName);
+
+ AppDomain newDomain = AppDomain.CreateDomain ("NewDomain");
+
+ if (!RemotingServices.IsTransparentProxy(newDomain))
+ return 1;
+
+ // First test that this domain get's the right data from the other domain
+ newDomain.SetData ("test_string", "a");
+
+ object t = newDomain.GetData("test_string");
+ if (t.GetType() != typeof(string))
+ return 2;
+
+ if ((string) newDomain.GetData ("test_string") != "a")
+ return 3;
+
+ newDomain.SetData ("test_integer", 1);
+ if ((int) newDomain.GetData ("test_integer") != 1)
+ return 4;
+
+ newDomain.SetData ("test_bool", true);
+ if ((bool)newDomain.GetData ("test_bool") != true)
+ return 5;
+
+ newDomain.SetData ("test_bool", false);
+ if ((bool)newDomain.GetData ("test_bool") != false)
+ return 6;
+
+ int [] ta = { 1, 2, 3 };
+ newDomain.SetData ("test_array", ta);
+
+ int [] ca = (int [])newDomain.GetData ("test_array");
+
+ if (ca [0] != 1 || ca [1] != 2 || ca [2] != 3)
+ return 7;
+
+ // Creata a MBR object to test that the other domain has the correct info
+ MBRTest test = (MBRTest) newDomain.CreateInstanceAndUnwrap (typeof(MBRTest).Assembly.FullName, typeof(MBRTest).FullName);
+
+ if (!RemotingServices.IsTransparentProxy(test))
+ return 8;
+
+ // Time to test that the newDomain also have the same info
+ if (test.Int != 1)
+ return 9;
+
+ if (test.Str != "a")
+ return 10;
+
+ if (test.Bool != false)
+ return 11;
+
+ ca = test.Arr;
+
+ if (ca [0] != 1 || ca [1] != 2 || ca [2] != 3)
+ return 12;
+
+ Console.WriteLine("test-ok");
+
+ return 0;
+ }
+}
diff --git a/mono/tests/appdomain2.cs b/mono/tests/appdomain2.cs
new file mode 100644
index 00000000000..e970a5364e3
--- /dev/null
+++ b/mono/tests/appdomain2.cs
@@ -0,0 +1,73 @@
+using System;
+using System.IO;
+using System.Security.Policy;
+using System.Threading;
+using System.Runtime.Serialization;
+
+class Container {
+
+ [Serializable]
+ public struct c2 : ISerializable {
+ public int a;
+ public string s1;
+
+ private c2 (SerializationInfo info, StreamingContext context) {
+ a = info.GetInt32("a");
+ s1 = info.GetString("s1");
+ }
+
+ public void GetObjectData (SerializationInfo info, StreamingContext context) {
+ info.AddValue ("a", a);
+ if (s1 != null)
+ info.AddValue ("s1", s1);
+ else
+ info.AddValue ("s1", "(null)");
+ }
+ }
+
+ [Serializable]
+ public class c1 {
+ public int a = 1;
+ public int b = 2;
+ public string s1 = "TEST1";
+ [NonSerialized] public string s2 = "TEST2";
+ public c2 e1;
+ }
+
+ static int Main ()
+ {
+ Console.WriteLine ("Friendly name: " + AppDomain.CurrentDomain.FriendlyName);
+
+ AppDomainSetup setup = new AppDomainSetup ();
+ setup.ApplicationBase = Directory.GetCurrentDirectory ();
+
+ AppDomain newDomain = AppDomain.CreateDomain ("NewDomain", null, setup);
+
+ c1 a1 = new c1 ();
+ a1.e1.a = 3;
+ a1.e1.s1 = "SS";
+
+ newDomain.SetData ("TEST", a1);
+
+ c1 r1 = (c1)newDomain.GetData ("TEST");
+
+ if (r1.a != 1 || r1.b !=2)
+ return 1;
+
+ if (r1.s1 != "TEST1")
+ return 2;
+
+ if (r1.s2 != null)
+ return 3;
+
+ if (r1.e1.a != 3)
+ return 4;
+
+ if (r1.e1.s1 != "SS")
+ return 5;
+
+ Console.WriteLine("test-ok");
+
+ return 0;
+ }
+}
diff --git a/mono/tests/appdomain3.cs b/mono/tests/appdomain3.cs
new file mode 100755
index 00000000000..29a16e1edfa
--- /dev/null
+++ b/mono/tests/appdomain3.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Security.Policy;
+using System.Runtime.Remoting;
+using System.Threading;
+
+class Container {
+
+ static int Main ()
+ {
+ Console.WriteLine ("Friendly name: " + AppDomain.CurrentDomain.FriendlyName);
+
+ AppDomain newDomain = AppDomain.CreateDomain ("NewDomain");
+
+ AppDomain.Unload (newDomain);
+
+ Console.WriteLine("test-ok");
+
+ return 0;
+ }
+}
diff --git a/mono/tests/array-cast.cs b/mono/tests/array-cast.cs
index 0eeb8064e61..a7c6e687cd8 100644
--- a/mono/tests/array-cast.cs
+++ b/mono/tests/array-cast.cs
@@ -5,7 +5,13 @@ namespace Test {
public static int Main () {
Attribute[] attr_array = new Attribute [1];
object obj = (object) attr_array;
- object[] obj_array = (object[]) obj;
+ object [] obj_array = (object[]) obj;
+
+ obj_array = obj as object[];
+
+ if (obj_array == null)
+ return 1;
+
return 0;
}
}
diff --git a/mono/tests/array3.cs b/mono/tests/array3.cs
new file mode 100644
index 00000000000..ce31de2e9fc
--- /dev/null
+++ b/mono/tests/array3.cs
@@ -0,0 +1,19 @@
+
+
+using System;
+
+
+public class Test {
+
+
+ public static int Main () {
+ object[] array = new object[10];
+
+ if (array.GetType ().IsPublic)
+ return 0;
+
+ return 1;
+ }
+
+}
+
diff --git a/mono/tests/async_read.cs b/mono/tests/async_read.cs
new file mode 100644
index 00000000000..951c8d924d3
--- /dev/null
+++ b/mono/tests/async_read.cs
@@ -0,0 +1,45 @@
+using System;
+using System.IO;
+using System.Threading;
+
+class Test {
+
+ static int sum = 0;
+
+ static void async_callback (IAsyncResult ar)
+ {
+ byte [] buf = (byte [])ar.AsyncState;
+ sum += buf [0];
+ }
+
+ static int Main () {
+ byte [] buf = new byte [1];
+ AsyncCallback ac = new AsyncCallback (async_callback);
+ IAsyncResult ar;
+ int sum0 = 0;
+
+ FileStream s = new FileStream ("async_read.cs", FileMode.Open);
+
+ s.Position = 0;
+ sum0 = 0;
+ while (s.Read (buf, 0, 1) == 1)
+ sum0 += buf [0];
+
+ s.Position = 0;
+
+ do {
+ ar = s.BeginRead (buf, 0, 1, ac, buf);
+ } while (s.EndRead (ar) == 1);
+ sum -= buf [0];
+
+ Thread.Sleep (100);
+
+ s.Close ();
+
+ Console.WriteLine ("CSUM: " + sum + " " + sum0);
+ if (sum != sum0)
+ return 1;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/base-definition.cs b/mono/tests/base-definition.cs
new file mode 100644
index 00000000000..770cce3d0a3
--- /dev/null
+++ b/mono/tests/base-definition.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Reflection;
+
+abstract class test
+{
+ public static int Main ()
+ {
+ MethodInfo m = typeof (SubTestClass).GetMethod ("get_name");
+ MethodInfo bm = m.GetBaseDefinition ();
+ if (bm == null || bm.DeclaringType != typeof (TestClass) || bm.Name != "get_name") return 1;
+
+ m = typeof (SubTestClass).GetMethod ("get_name2");
+ bm = m.GetBaseDefinition ();
+ if (bm == null || bm.DeclaringType != typeof (TestClass) || bm.Name != "get_name2") return 2;
+
+ m = typeof (SubTestClass).GetMethod ("get_name3");
+ bm = m.GetBaseDefinition ();
+ if (bm == null || bm.DeclaringType != typeof (BaseTestClass) || bm.Name != "get_name3") return 3;
+
+ return 0;
+ }
+}
+
+abstract class BaseTestClass
+{
+ public abstract string name3
+ {
+ get;
+ }
+
+}
+
+abstract class TestClass : BaseTestClass
+{
+ public abstract string name
+ {
+ get;
+ }
+
+ public virtual string name2
+ {
+ get { return null; }
+ }
+}
+
+class SubTestClass : TestClass
+{
+ public override string name
+ {
+ get { return ""; }
+ }
+
+ public override string name2
+ {
+ get { return ""; }
+ }
+
+ public override string name3
+ {
+ get { return ""; }
+ }
+}
+
+
diff --git a/mono/tests/binwritter.cs b/mono/tests/binwritter.cs
new file mode 100755
index 00000000000..c8adfcc1816
--- /dev/null
+++ b/mono/tests/binwritter.cs
@@ -0,0 +1,40 @@
+using System;
+using System.IO;
+
+public class BinaryWrTest {
+ public static int Main () {
+ MemoryStream mr = new MemoryStream();
+ BinaryWriter wr = new BinaryWriter(mr);
+
+ wr.Write ((byte) 1);
+ wr.Write ((int) 1);
+ wr.Write ((int) -1);
+
+ byte [] arr = mr.ToArray();
+
+ Console.Write ("Array (should be: 1 1 0 0 0 ff ff ff ff): ");
+
+ for (int a = 0; a != arr.Length; a++)
+ Console.Write(arr[a].ToString("x") + " ");
+
+ Console.WriteLine();
+
+ if (arr.Length != 9)
+ return 4;
+
+ if (arr[0] != 1)
+ return 1;
+
+ if (arr[1] != 1 && arr[2] != 0 && arr[3] != 0 && arr[4] != 0)
+ return 2;
+
+ if (arr[5] != 0xff && arr[6] != 0xff && arr[7] != 0xff && arr[8] != 0xff)
+ return 3;
+
+ Console.WriteLine("test-ok");
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/tests/bug-27420.cs b/mono/tests/bug-27420.cs
new file mode 100644
index 00000000000..0866a0515e7
--- /dev/null
+++ b/mono/tests/bug-27420.cs
@@ -0,0 +1,32 @@
+//
+// bug-27420.cs: Using valuetypes in a loop leads to crash
+//
+
+using System;
+
+struct A1 {
+ int i, j, k, l, m, n, o, p;
+}
+
+// Allocate a big structure
+struct A2 {
+ A1 a, b, c, d, e, f;
+
+ public int g;
+}
+
+public class crash
+{
+ static A2 get_a2 () {
+ return new A2 ();
+ }
+
+ static void Main() {
+ int i;
+
+ for (int j = 0; j < 100000; ++j) {
+ // Force the runtime to create a temporary valuetype on the stack
+ i = get_a2 ().g;
+ }
+ }
+}
diff --git a/mono/tests/bug-29859.il b/mono/tests/bug-29859.il
new file mode 100644
index 00000000000..9f95999004d
--- /dev/null
+++ b/mono/tests/bug-29859.il
@@ -0,0 +1,54 @@
+.assembly extern mscorlib
+{
+ .ver 0:0:0:0
+}
+.assembly 'vtable'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+
+.class private auto ansi beforefieldinit X
+ extends [mscorlib]System.Object
+{
+
+ .method public hidebysig specialname rtspecialname
+ instance default void .ctor() cil managed
+ {
+ .maxstack 8
+
+ ldarg.0
+ call instance void valuetype [mscorlib]System.Object::.ctor()
+ ret
+ }
+
+ .method private static
+ default int32 foo() cil managed
+ {
+ .maxstack 4
+ .locals init (
+ object V_0)
+
+ ldc.i4.5
+ box [mscorlib]System.Int32
+ stloc.0
+ ldloc.0
+ ldloc.0
+ callvirt instance bool valuetype [mscorlib]System.Object::Equals(object)
+ ldc.i4.0
+ ceq
+ ret
+ }
+
+ .method private static
+ default int32 Main() cil managed
+ {
+ .entrypoint
+ .maxstack 8
+
+ ldftn instance bool [mscorlib]System.Int32::Equals(object)
+ pop
+ call int32 class X::foo()
+ ret
+ }
+}
diff --git a/mono/tests/bug-42136.cs b/mono/tests/bug-42136.cs
new file mode 100644
index 00000000000..dfa57cd99da
--- /dev/null
+++ b/mono/tests/bug-42136.cs
@@ -0,0 +1,29 @@
+using System;
+
+public class Test {
+
+ public static int test_0_liveness_exception() {
+ int id = 1;
+
+ try {
+ id = 2;
+ throw new Exception ();
+ }
+ catch (Exception) {
+ if (id != 2)
+ return id;
+ }
+
+ return 0;
+ }
+
+ public static int Main() {
+ int res = 0;
+
+ res = test_0_liveness_exception ();
+ if (res != 0)
+ Console.WriteLine ("error, test_0_liveness_exception res={0}", res);
+
+ return 0;
+ }
+}
diff --git a/mono/tests/bug-46781.cs b/mono/tests/bug-46781.cs
new file mode 100755
index 00000000000..419113949cc
--- /dev/null
+++ b/mono/tests/bug-46781.cs
@@ -0,0 +1,22 @@
+using System;
+
+public class Test {
+
+ private static IntPtr i = IntPtr.Zero;
+
+ public static IntPtr nati {
+ get {
+ if (i == IntPtr.Zero) {
+ i = (IntPtr) 10001;
+ }
+ return i;
+ }
+ }
+
+ public static int Main() {
+ IntPtr[] nati = new IntPtr [1];
+ nati [0] = Test.nati;
+ Console.WriteLine ("nati [0] " + nati [0]);
+ return 0;
+ }
+}
diff --git a/mono/tests/bug-47295.cs b/mono/tests/bug-47295.cs
new file mode 100755
index 00000000000..4bb18ac0a30
--- /dev/null
+++ b/mono/tests/bug-47295.cs
@@ -0,0 +1,85 @@
+//
+// bug-47295.cs:
+//
+// Regression test for bug #47295.
+//
+// Test from Marcus Urban (mathpup@mylinuxisp.com)
+//
+
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Runtime.InteropServices;
+
+
+public class Testing
+{
+ public static void Method(int value)
+ {
+ Console.WriteLine( "Method( {0} )", value );
+ }
+
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct DelegateList
+ {
+ internal Delegate del;
+ }
+
+
+ public static void Main()
+ {
+ // Create a dynamic assembly and module to contain the
+ // subclass of MulticastDelegate that we will create
+
+ AssemblyName asmName = new AssemblyName();
+ asmName.Name = "DynamicAssembly";
+
+ AssemblyBuilder asmBuilder =
+ AppDomain.CurrentDomain.DefineDynamicAssembly(
+ asmName, AssemblyBuilderAccess.Run );
+
+ ModuleBuilder modBuilder = asmBuilder.DefineDynamicModule
+( "DynamicModule" );
+
+ TypeBuilder typeBuilder = modBuilder.DefineType( "MyType",
+ TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.Sealed,
+ typeof( System.MulticastDelegate ) );
+
+ ConstructorBuilder cb = typeBuilder.DefineConstructor(
+ MethodAttributes.Public | MethodAttributes.HideBySig |
+ MethodAttributes.RTSpecialName | MethodAttributes.SpecialName,
+ CallingConventions.Standard,
+ new Type[] { typeof(Object), typeof (IntPtr) } );
+
+ cb.SetImplementationFlags( MethodImplAttributes.Runtime |
+MethodImplAttributes.Managed );
+
+ MethodBuilder mb = typeBuilder.DefineMethod(
+ "Invoke",
+ MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.
+HideBySig,
+ typeof(void),
+ new Type[] { typeof(int) } );
+
+ mb.SetImplementationFlags( MethodImplAttributes.Runtime |
+MethodImplAttributes.Managed );
+ ParameterBuilder pb = mb.DefineParameter (1, ParameterAttributes.HasFieldMarshal, "foo");
+ pb.SetMarshal (UnmanagedMarshal.DefineUnmanagedMarshal (UnmanagedType.I2));
+
+ // Create an instance of the delegate type and invoke it -- just to test
+
+ Type myDelegateType = typeBuilder.CreateType();
+ Delegate d = Delegate.CreateDelegate( myDelegateType, typeof
+( Testing ), "Method" );
+ d.DynamicInvoke( new object[] { 8 } );
+
+ DelegateList delegateList = new DelegateList();
+ delegateList.del = d;
+ IntPtr ptr = Marshal.AllocHGlobal( Marshal.SizeOf( delegateList ) );
+
+ // The execption seems to occur at this statement:
+ Marshal.StructureToPtr( delegateList, ptr, false );
+ }
+
+}
diff --git a/mono/tests/bug-48015.cs b/mono/tests/bug-48015.cs
new file mode 100644
index 00000000000..c5e7c303ae2
--- /dev/null
+++ b/mono/tests/bug-48015.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections;
+using System.Runtime.Remoting;
+
+public class Foo : System.ContextBoundObject {
+}
+
+public class Bar : System.ContextBoundObject {
+
+ public void Test(Foo f) {
+ if (RemotingServices.IsTransparentProxy (f))
+ Console.WriteLine ("Bar::Test(Foo) Is TP");
+ else
+ Console.WriteLine ("Bar::Test(Foo) Is NOT a TP (error!)");
+
+ if (!f.Equals (f))
+ Console.WriteLine ("Bar::Test(Foo) f.Equals (b) failed (error!)");
+ else
+ Console.WriteLine ("Bar::Test(Foo) f.Equals (f) ok!");
+ }
+}
+
+public class Driver {
+ public static void Main (string[] args) {
+ Foo f = new Foo();
+ Bar b = new Bar();
+
+ if (!b.Equals (b))
+ Console.WriteLine ("b.Equals (b) failed (error!)");
+ else
+ Console.WriteLine ("b.Equals (b) ok!");
+
+ if (RemotingServices.IsTransparentProxy (b))
+ Console.WriteLine ("b is a TP");
+ else
+ Console.WriteLine ("b is NOT a TP (error!)");
+
+ b.Test(f);
+
+ if (!f.Equals (f))
+ Console.WriteLine ("f.Equals (b) failed (error!)");
+ else
+ Console.WriteLine ("f.Equals (f) ok!");
+
+ Console.WriteLine ("test end.");
+ }
+}
+
diff --git a/mono/tests/cattr-field.cs b/mono/tests/cattr-field.cs
new file mode 100644
index 00000000000..b1517129bbd
--- /dev/null
+++ b/mono/tests/cattr-field.cs
@@ -0,0 +1,32 @@
+using System;
+
+[My(val=2,sval="str",bb=0,S="Buh",P=4)]
+class T {
+ static int Main() {
+ object[] a = Attribute.GetCustomAttributes (typeof (T), true);
+ My attr = (My)a [0];
+ if (attr.val != 2)
+ return 1;
+ if (attr.P != 4)
+ return 2;
+ if (attr.S != "Buh")
+ return 3;
+ return 0;
+ }
+}
+
+class My : Attribute {
+ public int val;
+ public uint prop;
+ public string s;
+ public string sval;
+ public byte bb;
+ public uint P {
+ set {prop = value;}
+ get {return prop;}
+ }
+ public string S {
+ set {s = value;}
+ get {return s;}
+ }
+}
diff --git a/mono/tests/cattr-object.cs b/mono/tests/cattr-object.cs
new file mode 100644
index 00000000000..51db9c5ae58
--- /dev/null
+++ b/mono/tests/cattr-object.cs
@@ -0,0 +1,41 @@
+using System;
+
+[My((long)1)]
+[My(TypeCode.Empty)]
+[My(typeof(System.Enum))]
+class T {
+ static int Main() {
+ object[] a = Attribute.GetCustomAttributes (typeof (T), false);
+ if (a.Length != 3)
+ return 1;
+ foreach (object o in a) {
+ My attr = (My)o;
+ if (attr.obj.GetType () == typeof(long)) {
+ long val = (long)attr.obj;
+ Console.WriteLine ("got value: {0}", val);
+ if (val != 1)
+ return 2;
+ } else if (attr.obj.GetType () == typeof(TypeCode)) {
+ int val = (int)attr.obj;
+ if (val != (int)TypeCode.Empty)
+ return 3;
+ } else {
+ Type t = attr.obj as Type;
+ if (t == null)
+ return 4;
+ if (t != typeof (System.Enum))
+ return 5;
+ }
+
+ }
+ return 0;
+ }
+}
+
+[AttributeUsage(AttributeTargets.All,AllowMultiple=true)]
+class My : Attribute {
+ public object obj;
+ public My (object o) {
+ obj = o;
+ }
+}
diff --git a/mono/tests/checked.cs b/mono/tests/checked.cs
new file mode 100755
index 00000000000..87c3f2ab23b
--- /dev/null
+++ b/mono/tests/checked.cs
@@ -0,0 +1,191 @@
+using System;
+
+namespace test {
+ public class tester {
+ public tester() {}
+
+ public static int Main () {
+ float a = 1e20f;
+ int i = 0;
+ uint ui = 0;
+
+ bool exception = false;
+
+ try {
+ int b = (int) a;
+ checked {
+ i = (int)a;
+ }
+ }
+ catch (OverflowException) {
+ exception = true;
+ }
+ catch (Exception) {
+ }
+
+
+ if (!exception)
+ return -1;
+
+ exception = false;
+
+ a = 1e5f;
+
+ try {
+ int b = (int) a;
+ checked {
+ i = (int)a;
+ }
+ } catch (Exception) {
+ return -2;
+ }
+
+
+ if (i != 100000)
+ return -3;
+
+ exception = false;
+
+ a = -1e30f;
+ try {
+ int b = (int) a;
+ checked {
+ i = (int)a;
+ }
+ }
+ catch (OverflowException) {
+ exception = true;
+ }
+ catch (Exception) {
+ }
+ exception = false;
+
+
+ a = -1e30f;
+ try {
+ uint b = (uint) a;
+ checked {
+ ui = (uint)a;
+ }
+
+ Console.WriteLine("No Exception");
+ }
+ catch (OverflowException) {
+ exception = true;
+ }
+ catch (Exception) {
+ }
+
+
+ if (!exception)
+ return -4;
+
+ a = 1e5f;
+ try {
+ uint b = (uint) a;
+ checked {
+ ui = (uint)a;
+ }
+ }
+ catch (Exception) {
+ return -5;
+ }
+
+ if (ui != 100000)
+ return -6;
+
+ // Check mul.ovf
+ checked {
+ int l;
+ int m;
+
+ int[][] cases = new int [][] {
+ new int [] {0, 0, 0},
+ new int [] {-5, 0, 0},
+ new int [] {3, -5, -15},
+ new int [] {3, 5, 15},
+ new int [] {-3, -5, 15},
+ new int [] {-3, 5, -15},
+ new int [] {-1, 32767, -32767},
+ new int [] {32767, -1, -32767}};
+
+
+ for (int j = 0; j < cases.Length; ++j)
+ if (cases [j][0] * cases [j][1] != cases [j][2])
+ return -7 - j;
+ }
+
+ checked {
+ int j;
+ int k;
+
+ j = k = 0;
+ if (j * k != 0)
+ return -7;
+
+ j = -5;
+ k = 0;
+ if (j * k != 0)
+ return -8;
+
+ j = 0;
+ k = -5;
+ if (j * k != 0)
+ return -9;
+
+ j = 3;
+ k = -5;
+ if (j * k != -15)
+ return -10;
+
+ j = 3;
+ k = 5;
+ if (j * k != 15)
+ return -11;
+
+ j = -3;
+ k = -5;
+ if (j * k != 15)
+ return -12;
+
+ j = -3;
+ k = 5;
+ if (j * k != -15)
+ return -13;
+
+ j = -1;
+ k = 32767;
+ if (j * k != -32767)
+ return -14;
+
+ j = 32767;
+ k = -1;
+ if (j * k != -32767)
+ return -15;
+ }
+
+ checked {
+ long l;
+ long m;
+
+ long[][] cases = new long [][] {
+ new long [] {0, 0, 0},
+ new long [] {-5, 0, 0},
+ new long [] {3, -5, -15},
+ new long [] {3, 5, 15},
+ new long [] {-3, -5, 15},
+ new long [] {-3, 5, -15},
+ new long [] {-1, 2147483647, -2147483647},
+ new long [] {2147483647, -1, -2147483647}};
+
+ for (int j = 0; j < cases.Length; ++j)
+ if (cases [j][0] * cases [j][1] != cases [j][2])
+ return -15 - j;
+ }
+
+ Console.WriteLine("test-ok");
+
+ return 0;
+ }
+ }
+}
diff --git a/mono/tests/ckfiniteTest.il b/mono/tests/ckfiniteTest.il
index 96092dfa283..05d0540ea2b 100644
--- a/mono/tests/ckfiniteTest.il
+++ b/mono/tests/ckfiniteTest.il
@@ -12,9 +12,12 @@
.class private auto ansi someTest
extends [mscorlib]System.Object {
- .method public static void go() cil managed {
+ .method public static int32 Main() cil managed {
.entrypoint
+ .locals (int32 res)
+ ldc.i4 3
+ stloc res
//TEST 1 - infinite
.try {
@@ -30,6 +33,10 @@ catch [mscorlib]System.ArithmeticException {
pop
ldstr "PASS"
call void [mscorlib]System.Console::WriteLine(string)
+ ldloc res
+ ldc.i4 1
+ sub
+ stloc res
leave test2
}
catch [mscorlib]System.Exception {
@@ -54,6 +61,10 @@ test2: nop
catch [mscorlib]System.ArithmeticException {
ldstr "PASS"
call void [mscorlib]System.Console::WriteLine(string)
+ ldloc res
+ ldc.i4 1
+ sub
+ stloc res
leave test3
}
catch [mscorlib]System.Exception {
@@ -72,6 +83,10 @@ test3: nop
bne.un FAIL
ldstr "PASS"
call void [mscorlib]System.Console::WriteLine(string)
+ ldloc res
+ ldc.i4 1
+ sub
+ stloc res
leave end
FAIL: ldstr "FAIL"
@@ -84,8 +99,10 @@ catch [mscorlib]System.Exception {
leave end
}
-end: ret
+end:
+ ldloc res
+ ret
}
-} \ No newline at end of file
+}
diff --git a/mono/tests/classinit.cs b/mono/tests/classinit.cs
new file mode 100644
index 00000000000..781f7e09715
--- /dev/null
+++ b/mono/tests/classinit.cs
@@ -0,0 +1,26 @@
+using System;
+
+class Foo {
+
+ static public int i = 0;
+}
+
+class Bar {
+
+ static public int j;
+
+ static Bar () {
+ j = Foo.i;
+ }
+}
+
+class Bug {
+
+ static public int Main () {
+ Foo.i = 5;
+ if (Bar.j != 5)
+ return 1;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/classinit2.cs b/mono/tests/classinit2.cs
new file mode 100644
index 00000000000..2d07a0218bf
--- /dev/null
+++ b/mono/tests/classinit2.cs
@@ -0,0 +1,20 @@
+class A {
+ static A() { System.Console.WriteLine("A"); M.a_run = true;}
+ public static void f() {}
+}
+class B {
+ static B() { System.Console.WriteLine("B"); A.f(); M.b_run = true;}
+ public static void f() {}
+}
+class M {
+ public static bool b_run = false;
+ public static bool a_run = false;
+ public static int Main() {
+ B.f();
+ if (!a_run)
+ return 1;
+ if (!b_run)
+ return 2;
+ return 0;
+ }
+}
diff --git a/mono/tests/codegen.cs b/mono/tests/codegen.cs
index 76f02358a3e..8886255cefd 100644
--- a/mono/tests/codegen.cs
+++ b/mono/tests/codegen.cs
@@ -39,6 +39,11 @@ class CGen {
Type t = tbuilder.CreateType ();
abuilder.SetEntryPoint (method);
abuilder.Save (name);
+ Console.WriteLine ("abuilder == module.assembly: {0}", abuilder == mbuilder.Assembly);
+ Console.WriteLine ("abuilder == type.assembly: {0}", abuilder == t.Assembly);
+ Console.WriteLine ("abuilder == tbuilder.assembly: {0}", abuilder == tbuilder.Assembly);
+ Console.WriteLine ("mbuilder == type.Module: {0}", mbuilder == t.Module);
+ Console.WriteLine ("mbuilder == tbuilder.Module: {0}", mbuilder == tbuilder.Module);
return 0;
}
}
diff --git a/mono/tests/context-static.cs b/mono/tests/context-static.cs
new file mode 100644
index 00000000000..4d8d7a5d68c
--- /dev/null
+++ b/mono/tests/context-static.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Runtime.Remoting.Contexts;
+
+[Synchronization (SynchronizationAttribute.REQUIRES_NEW)]
+class CBO: ContextBoundObject
+{
+ public bool Test () {
+ Console.WriteLine ("start value: {0}", T.var);
+ if (T.var != 0) return true;
+ T.var = 100;
+ Console.WriteLine ("end value: {0}", T.var);
+ return (T.var != 100);
+ }
+}
+
+class T {
+ [ContextStatic]
+ public static int var = 5;
+
+ static int Main () {
+ bool failed = false;
+ var = 10;
+
+ CBO cbo = new CBO();
+ failed = cbo.Test ();
+
+ if (var != 10)
+ failed = true;
+
+ Console.WriteLine ("value in main context: {0}", var);
+
+ if (failed)
+ return 1;
+ return 0;
+ }
+}
diff --git a/mono/tests/custom-attr.cs b/mono/tests/custom-attr.cs
index 4fa114186a9..7e8d50dd41d 100644
--- a/mono/tests/custom-attr.cs
+++ b/mono/tests/custom-attr.cs
@@ -17,8 +17,25 @@ namespace Test {
ival = blah;
}
}
+
+ public class My3Attribute : Attribute {
+ char[] array_val;
+
+ public char[] Prop {
+ get {
+ return array_val;
+ }
+ set {
+ array_val = value;
+ }
+ }
+
+ public char[] Prop2;
+ }
+
[My("testclass")]
[My2("testclass", 22)]
+ [My3(Prop = new char [] { 'A', 'B', 'C', 'D' }, Prop2 = new char [] { 'A', 'D' })]
public class Test {
static public int Main() {
System.Reflection.MemberInfo info = typeof (Test);
@@ -26,11 +43,24 @@ namespace Test {
for (int i = 0; i < attributes.Length; i ++) {
System.Console.WriteLine(attributes[i]);
}
- if (attributes.Length != 2)
+ if (attributes.Length != 3)
return 1;
- MyAttribute attr = (MyAttribute) attributes [0];
- if (attr.val != "testclass")
- return 2;
+ for (int i = 0; i < attributes.Length; ++i) {
+ if (attributes [i] is MyAttribute) {
+ if (((MyAttribute)attributes [i]).val != "testclass")
+ return 2;
+ }
+ if (attributes [i] is My3Attribute) {
+ if (new String (((My3Attribute)attributes [i]).Prop) != "ABCD") {
+ Console.WriteLine (new String (((My3Attribute)attributes [i]).Prop));
+ return 3;
+ }
+ if (new String (((My3Attribute)attributes [i]).Prop2) != "AD") {
+ Console.WriteLine (new String (((My3Attribute)attributes [i]).Prop2));
+ return 4;
+ }
+ }
+ }
return 0;
}
}
diff --git a/mono/tests/decimal-array.cs b/mono/tests/decimal-array.cs
new file mode 100644
index 00000000000..beb0079718d
--- /dev/null
+++ b/mono/tests/decimal-array.cs
@@ -0,0 +1,28 @@
+using System;
+
+class Test
+{
+ public static int Main()
+ {
+ decimal[,] tab = new decimal[2,2] {{3,4},{5,6}};
+ bool b1 = false;
+ decimal d;
+
+ try {
+ d = tab[1,2];
+ } catch (Exception e) {
+ b1 = true;
+ }
+
+ if (!b1)
+ return 1;
+
+ d = tab[1,1];
+ if (d != 6)
+ return 1;
+
+ return 0;
+ }
+}
+
+
diff --git a/mono/tests/delegate.cs b/mono/tests/delegate.cs
index 7c86a174f13..7a3987a56c5 100644
--- a/mono/tests/delegate.cs
+++ b/mono/tests/delegate.cs
@@ -1,6 +1,20 @@
using System;
using System.Runtime.InteropServices;
+class A {
+ public static bool b_cctor_run = false;
+}
+
+class B {
+ static B () {
+ A.b_cctor_run = true;
+ }
+ public static void method () {
+ }
+}
+
+delegate void DoIt ();
+
namespace Bah {
class Test {
[DllImport("cygwin1.dll", EntryPoint="puts", CharSet=CharSet.Ansi)]
@@ -34,6 +48,11 @@ class Test {
data = 5;
}
static int Main () {
+ // Check that creation of delegates do not runs the class cctor
+ DoIt doit = new DoIt (B.method);
+ if (A.b_cctor_run)
+ return 1;
+
Test test = new Test ();
SimpleDelegate d = new SimpleDelegate (F);
SimpleDelegate d1 = new SimpleDelegate (test.VF);
diff --git a/mono/tests/delegate4.cs b/mono/tests/delegate4.cs
index 5d4f03da1fa..04d58525164 100644
--- a/mono/tests/delegate4.cs
+++ b/mono/tests/delegate4.cs
@@ -6,18 +6,28 @@ using System.Runtime.Remoting.Messaging;
class Test {
public delegate int SimpleDelegate (int a, int b);
- [DllImport ("libtest.so", EntryPoint="mono_invoke_delegate")]
+ [DllImport ("libtest", EntryPoint="mono_invoke_delegate")]
static extern int mono_invoke_delegate (SimpleDelegate d);
public static int Add (int a, int b) {
- Console.WriteLine ("Test.Add from delegate: " + a + "+ " + b);
+ Console.WriteLine ("Test.Add from delegate: " + a + " + " + b);
+ return a + b;
+ }
+
+ public static int Add2 (int a, int b) {
+ Console.WriteLine ("Test.Add2 from delegate: " + a + " + " + b);
return a + b;
}
static int Main () {
SimpleDelegate d = new SimpleDelegate (Add);
+ SimpleDelegate d2 = new SimpleDelegate (Add2);
- mono_invoke_delegate (d);
+ if (mono_invoke_delegate (d) != 5)
+ return 1;
+
+ if (mono_invoke_delegate (d2) != 5)
+ return 1;
return 0;
}
diff --git a/mono/tests/delegate6.cs b/mono/tests/delegate6.cs
new file mode 100644
index 00000000000..0cfff223275
--- /dev/null
+++ b/mono/tests/delegate6.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Reflection;
+
+public class T
+{
+ public void Test ()
+ {
+ Console.WriteLine ("CreateDelegate success!");
+ }
+
+ public delegate void blah ();
+
+ public static void Main ()
+ {
+ T t = new T();
+ Delegate o = Delegate.CreateDelegate (typeof (T.blah), t, "Test");
+ o.DynamicInvoke (new Object[] {});
+ }
+}
+
+
diff --git a/mono/tests/delegate7.cs b/mono/tests/delegate7.cs
new file mode 100644
index 00000000000..6e1fe94e17a
--- /dev/null
+++ b/mono/tests/delegate7.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Runtime.InteropServices;
+
+class Tests {
+ delegate void SimpleDelegate ();
+
+ public static int v = 0;
+
+ static void F1 () {
+ v += 1;
+ Console.WriteLine ("Test.F1");
+ }
+ static void F2 () {
+ v += 2;
+ Console.WriteLine ("Test.F2");
+ }
+ static void F3 () {
+ v += 4;
+ Console.WriteLine ("Test.F3");
+ }
+
+ public static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ static public int test_0_test () {
+ SimpleDelegate t;
+ SimpleDelegate d1 = new SimpleDelegate (F1);
+ SimpleDelegate d2 = new SimpleDelegate (F2);
+ SimpleDelegate d3 = new SimpleDelegate (F3);
+
+ SimpleDelegate d12 = d1 + d2;
+ SimpleDelegate d13 = d1 + d3;
+ SimpleDelegate d23 = d2 + d3;
+ SimpleDelegate d123 = d1 + d2 + d3;
+
+ v = 0;
+ t = d123 - d13;
+ t ();
+ if (v != 7)
+ return 1;
+
+ v = 0;
+ t = d123 - d12;
+ t ();
+ if (v != 4)
+ return 1;
+
+ v = 0;
+ t = d123 - d23;
+ t ();
+ if (v != 1)
+ return 1;
+
+
+ return 0;
+ }
+
+ // Regression test for bug #50366
+ static public int test_0_delegate_equality () {
+ if (new SimpleDelegate (F1) == new SimpleDelegate (F1))
+ return 0;
+ else
+ return 1;
+ }
+}
diff --git a/mono/tests/delegate8.cs b/mono/tests/delegate8.cs
new file mode 100644
index 00000000000..fa004c59d50
--- /dev/null
+++ b/mono/tests/delegate8.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Threading;
+
+// Regression test for bug #59299
+
+public class Test
+{
+ delegate void M(ref object x, ref object y);
+
+ public static void Foo(ref object x, ref object y)
+ {
+ x = 20;
+ y = 30;
+ }
+
+ public static int Main()
+ {
+ IAsyncResult ar;
+ M m = new M(Foo);
+ object x1 = 10, x2 = 10;
+
+ ar = m.BeginInvoke(ref x1, ref x2, null, null);
+
+ m.EndInvoke(ref x1, ref x2, ar);
+
+ if ((int)x1 != 20 || (int)x2 != 30)
+ return 1;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/even-odd.il b/mono/tests/even-odd.il
new file mode 100644
index 00000000000..a393d9eeef6
--- /dev/null
+++ b/mono/tests/even-odd.il
@@ -0,0 +1,70 @@
+.assembly EvenOdd { }
+.class EvenOdd
+{ .method private static bool IsEven(int32 N) il managed
+ { .maxstack 2
+ ldarg.0 // N
+ ldc.i4.0
+ bne.un NonZero
+ ldc.i4.1
+ ret
+NonZero:
+ ldarg.0
+ ldc.i4.1
+ sub
+ tail.
+ call bool EvenOdd::IsOdd(int32)
+ ret
+ } // end of method `EvenOdd::IsEven'
+
+ .method private static bool IsOdd(int32 N) il managed
+ { .maxstack 2
+ // Demonstrates use of argument names and labels
+ // Notice that the assembler does not covert these
+ // automatically to their short versions
+ ldarg N
+ ldc.i4.0
+ bne.un NonZero
+ ldc.i4.0
+ ret
+NonZero:
+ ldarg N
+ ldc.i4.1
+ sub
+ tail.
+ call bool EvenOdd::IsEven(int32)
+ ret
+ } // end of method `EvenOdd::IsOdd'
+
+ .method public static void Test(int32 N) il managed
+ { .maxstack 1
+ ldarg N
+ call void [mscorlib]System.Console::Write(int32)
+ ldstr " is "
+ call void [mscorlib]System.Console::Write(class System.String)
+ ldarg N
+ call bool EvenOdd::IsEven(int32)
+ brfalse LoadOdd
+ ldstr "even"
+Print:
+ call void [mscorlib]System.Console::WriteLine(class System.String)
+ ret
+LoadOdd:
+ ldstr "odd"
+ br Print
+ } // end of method `EvenOdd::Test'
+} // end of class `EvenOdd'
+
+//Global method
+
+.method public static void main() il managed
+{ .entrypoint
+ .maxstack 1
+ ldc.i4 10000001
+ call void EvenOdd::Test(int32)
+ ret
+} // end of global method `main'
+
+
+
+
+
diff --git a/mono/tests/exception15.cs b/mono/tests/exception15.cs
new file mode 100644
index 00000000000..fed769abb02
--- /dev/null
+++ b/mono/tests/exception15.cs
@@ -0,0 +1,24 @@
+using System;
+
+class Tests {
+ public static int Main(){
+ int i = 0;
+ try{
+ try {
+ throw new NotImplementedException();
+ }
+ finally {
+ i++;
+ Console.WriteLine("Finally called");
+ }
+ } catch(NotImplementedException){
+ i++;
+ Console.WriteLine("Exception ignored");
+ }
+
+ if (i != 2)
+ return 1;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/exception16.cs b/mono/tests/exception16.cs
new file mode 100755
index 00000000000..87e45da4e4f
--- /dev/null
+++ b/mono/tests/exception16.cs
@@ -0,0 +1,44 @@
+using System;
+
+public class TestTryFinally
+{
+ static int result = 0;
+
+ public static void TrivialMain()
+ {
+ int i = 123;
+ string s = "Some string";
+ object o = s;
+
+ try {
+ // Illegal conversion; o contains a string not an int
+ i = (int) o;
+ }
+ finally {
+ Console.WriteLine("i = {0}", i);
+ result = i;
+ }
+ }
+
+ public static int Main()
+ {
+ try {
+ try {
+ TrivialMain();
+ }
+ finally {
+ Console.WriteLine("cleaning up");
+ }
+ }
+ catch(Exception) {
+ Console.WriteLine("catch expected exception");
+ result += 1;
+ }
+
+ if (result != 124)
+ return 1;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/exiting/appdomain.cs b/mono/tests/exiting/appdomain.cs
new file mode 100755
index 00000000000..a8721fdd981
--- /dev/null
+++ b/mono/tests/exiting/appdomain.cs
@@ -0,0 +1,14 @@
+
+using System;
+
+public class foo {
+ public static void Main() {
+ AppDomain domain=AppDomain.CreateDomain("Other");
+ Console.WriteLine("About to execute");
+ domain.ExecuteAssembly("main-exit.exe");
+ Console.WriteLine("Execute returns");
+ AppDomain.Unload(domain);
+ Console.WriteLine("finished");
+ }
+}
+
diff --git a/mono/tests/exiting/appdomain.out b/mono/tests/exiting/appdomain.out
new file mode 100755
index 00000000000..f9e4dcf5299
--- /dev/null
+++ b/mono/tests/exiting/appdomain.out
@@ -0,0 +1,5 @@
+About to execute
+Thread running
+Thread running
+Thread running
+Main thread exiting
diff --git a/mono/tests/exiting/delegate-async-exception.cs b/mono/tests/exiting/delegate-async-exception.cs
new file mode 100755
index 00000000000..cc531b354ca
--- /dev/null
+++ b/mono/tests/exiting/delegate-async-exception.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+class foo {
+ delegate void foo_delegate ();
+
+ static void function () {
+ Console.WriteLine ("Delegate method");
+ }
+
+ static void async_callback (IAsyncResult ar)
+ {
+ Console.WriteLine ("Async callback " + ar.AsyncState);
+ throw new SystemException("Async throws exception");
+ }
+
+ public static void Main () {
+ foo_delegate d = new foo_delegate (function);
+ AsyncCallback ac = new AsyncCallback (async_callback);
+ IAsyncResult ar1 = d.BeginInvoke (ac, "foo");
+
+ ar1.AsyncWaitHandle.WaitOne();
+ d.EndInvoke(ar1);
+
+ Thread.Sleep(1000);
+ Console.WriteLine("Main returns");
+ }
+}
diff --git a/mono/tests/exiting/delegate-async-exception.out b/mono/tests/exiting/delegate-async-exception.out
new file mode 100755
index 00000000000..ab488fd3a6a
--- /dev/null
+++ b/mono/tests/exiting/delegate-async-exception.out
Binary files differ
diff --git a/mono/tests/exiting/delegate-async-exit.cs b/mono/tests/exiting/delegate-async-exit.cs
new file mode 100755
index 00000000000..0e79a08d8dd
--- /dev/null
+++ b/mono/tests/exiting/delegate-async-exit.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+class foo {
+ delegate void foo_delegate ();
+
+ static void function () {
+ Console.WriteLine ("Delegate method");
+ }
+
+ static void async_callback (IAsyncResult ar)
+ {
+ Console.WriteLine ("Async callback " + ar.AsyncState);
+ Environment.Exit(42);
+ }
+
+ public static void Main () {
+ foo_delegate d = new foo_delegate (function);
+ AsyncCallback ac = new AsyncCallback (async_callback);
+ IAsyncResult ar1 = d.BeginInvoke (ac, "foo");
+
+ ar1.AsyncWaitHandle.WaitOne();
+ d.EndInvoke(ar1);
+
+ Thread.Sleep(1000);
+ Console.WriteLine("Main returns");
+ }
+}
diff --git a/mono/tests/exiting/delegate-async-exit.out b/mono/tests/exiting/delegate-async-exit.out
new file mode 100755
index 00000000000..ac86af50912
--- /dev/null
+++ b/mono/tests/exiting/delegate-async-exit.out
@@ -0,0 +1,2 @@
+Delegate method
+Async callback foo
diff --git a/mono/tests/exiting/delegate-delegate-exception.cs b/mono/tests/exiting/delegate-delegate-exception.cs
new file mode 100755
index 00000000000..029b955f76e
--- /dev/null
+++ b/mono/tests/exiting/delegate-delegate-exception.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+class foo {
+ delegate void foo_delegate ();
+
+ static void function () {
+ Console.WriteLine ("Delegate method");
+ throw new SystemException("delegate throws exception");
+ }
+
+ static void async_callback (IAsyncResult ar)
+ {
+ Console.WriteLine ("Async callback " + ar.AsyncState);
+ }
+
+ public static void Main () {
+ foo_delegate d = new foo_delegate (function);
+ AsyncCallback ac = new AsyncCallback (async_callback);
+ IAsyncResult ar1 = d.BeginInvoke (ac, "foo");
+
+ ar1.AsyncWaitHandle.WaitOne();
+ d.EndInvoke(ar1);
+
+ Thread.Sleep(1000);
+ Console.WriteLine("Main returns");
+ }
+}
diff --git a/mono/tests/exiting/delegate-delegate-exception.out b/mono/tests/exiting/delegate-delegate-exception.out
new file mode 100755
index 00000000000..c38ea1b78d4
--- /dev/null
+++ b/mono/tests/exiting/delegate-delegate-exception.out
Binary files differ
diff --git a/mono/tests/exiting/delegate-delegate-exit.cs b/mono/tests/exiting/delegate-delegate-exit.cs
new file mode 100755
index 00000000000..ad8864ba050
--- /dev/null
+++ b/mono/tests/exiting/delegate-delegate-exit.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+class foo {
+ delegate void foo_delegate ();
+
+ static void function () {
+ Console.WriteLine ("Delegate method");
+ Environment.Exit(42);
+ }
+
+ static void async_callback (IAsyncResult ar)
+ {
+ Console.WriteLine ("Async callback " + ar.AsyncState);
+ }
+
+ public static void Main () {
+ foo_delegate d = new foo_delegate (function);
+ AsyncCallback ac = new AsyncCallback (async_callback);
+ IAsyncResult ar1 = d.BeginInvoke (ac, "foo");
+
+ ar1.AsyncWaitHandle.WaitOne();
+ Thread.Sleep(1000);
+ d.EndInvoke(ar1);
+
+ Thread.Sleep(1000);
+ Console.WriteLine("Main returns");
+ }
+}
diff --git a/mono/tests/exiting/delegate-delegate-exit.out b/mono/tests/exiting/delegate-delegate-exit.out
new file mode 100755
index 00000000000..51a9f28abec
--- /dev/null
+++ b/mono/tests/exiting/delegate-delegate-exit.out
@@ -0,0 +1 @@
+Delegate method
diff --git a/mono/tests/exiting/delegate.cs b/mono/tests/exiting/delegate.cs
new file mode 100755
index 00000000000..bf4adfd981f
--- /dev/null
+++ b/mono/tests/exiting/delegate.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+class foo {
+ delegate void foo_delegate ();
+
+ static void function () {
+ Console.WriteLine ("Delegate method");
+ }
+
+ static void async_callback (IAsyncResult ar)
+ {
+ Console.WriteLine ("Async callback " + ar.AsyncState);
+ }
+
+ public static void Main () {
+ foo_delegate d = new foo_delegate (function);
+ AsyncCallback ac = new AsyncCallback (async_callback);
+ IAsyncResult ar1 = d.BeginInvoke (ac, "foo");
+
+ Console.WriteLine("Waiting");
+ ar1.AsyncWaitHandle.WaitOne();
+ Console.WriteLine("Sleeping");
+ Thread.Sleep(1000);
+ Console.WriteLine("EndInvoke");
+ d.EndInvoke(ar1);
+ Console.WriteLine("Sleeping");
+
+ Thread.Sleep(1000);
+ Console.WriteLine("Main returns");
+ }
+}
diff --git a/mono/tests/exiting/delegate.out b/mono/tests/exiting/delegate.out
new file mode 100755
index 00000000000..8c0341699ca
--- /dev/null
+++ b/mono/tests/exiting/delegate.out
@@ -0,0 +1,7 @@
+Waiting
+Delegate method
+Async callback foo
+Sleeping
+EndInvoke
+Sleeping
+Main returns
diff --git a/mono/tests/exiting/finalizer-abort.cs b/mono/tests/exiting/finalizer-abort.cs
new file mode 100755
index 00000000000..dc38316f5a4
--- /dev/null
+++ b/mono/tests/exiting/finalizer-abort.cs
@@ -0,0 +1,41 @@
+
+using System;
+using System.Collections;
+using System.Threading;
+
+public class foo {
+ public static LocalDataStoreSlot dataslot = Thread.AllocateDataSlot();
+ public static int final_count=0;
+
+ ~foo() {
+ // Demonstrate that this is still the same thread
+ string ID=(string)Thread.GetData(dataslot);
+ if(ID==null) {
+ Console.WriteLine("Set ID: foo");
+ Thread.SetData(dataslot, "foo");
+ }
+
+ // Don't run forever
+ if(final_count++>10) {
+ Environment.Exit(42);
+ }
+
+ Console.WriteLine("finalizer thread ID: {0}", (string)Thread.GetData(dataslot));
+ try {
+ Thread.CurrentThread.Abort();
+ } catch(ThreadAbortException) {
+ Console.WriteLine("Aborted!");
+ // No ResetAbort()!
+ }
+ }
+
+ public static void Main() {
+ ArrayList list = new ArrayList ();
+ Thread.SetData(dataslot, "ID is wibble");
+ while(true) {
+ foo instance = new foo();
+ list.Add (new WeakReference(instance));
+ }
+ }
+}
+
diff --git a/mono/tests/exiting/finalizer-abort.out b/mono/tests/exiting/finalizer-abort.out
new file mode 100755
index 00000000000..aaf076abc79
--- /dev/null
+++ b/mono/tests/exiting/finalizer-abort.out
@@ -0,0 +1,23 @@
+Set ID: foo
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
+finalizer thread ID: foo
+Aborted!
diff --git a/mono/tests/exiting/finalizer-exception.cs b/mono/tests/exiting/finalizer-exception.cs
new file mode 100755
index 00000000000..ae0c1d185d7
--- /dev/null
+++ b/mono/tests/exiting/finalizer-exception.cs
@@ -0,0 +1,36 @@
+
+using System;
+using System.Collections;
+using System.Threading;
+
+public class foo {
+ public static LocalDataStoreSlot dataslot = Thread.AllocateDataSlot();
+ public static int final_count=0;
+
+ ~foo() {
+ // Demonstrate that this is still the same thread
+ string ID=(string)Thread.GetData(dataslot);
+ if(ID==null) {
+ Console.WriteLine("Set ID: foo");
+ Thread.SetData(dataslot, "foo");
+ }
+
+ // Don't run forever
+ if(final_count++>10) {
+ Environment.Exit(42);
+ }
+
+ Console.WriteLine("finalizer thread ID: {0}", (string)Thread.GetData(dataslot));
+ throw new SystemException("wibble");
+ }
+
+ public static void Main() {
+ ArrayList list = new ArrayList ();
+ Thread.SetData(dataslot, "ID is wibble");
+ while(true) {
+ foo instance = new foo();
+ list.Add (new WeakReference(instance));
+ }
+ }
+}
+
diff --git a/mono/tests/exiting/finalizer-exception.out b/mono/tests/exiting/finalizer-exception.out
new file mode 100755
index 00000000000..374aa0bc8b8
--- /dev/null
+++ b/mono/tests/exiting/finalizer-exception.out
Binary files differ
diff --git a/mono/tests/exiting/finalizer-exit.cs b/mono/tests/exiting/finalizer-exit.cs
new file mode 100755
index 00000000000..af95ec9b0e8
--- /dev/null
+++ b/mono/tests/exiting/finalizer-exit.cs
@@ -0,0 +1,28 @@
+
+using System;
+using System.Collections;
+using System.Threading;
+
+public class foo {
+ public static LocalDataStoreSlot dataslot = Thread.AllocateDataSlot();
+
+ ~foo() {
+ string ID=(string)Thread.GetData(dataslot);
+ if(ID==null) {
+ Console.WriteLine("Set ID: foo");
+ Thread.SetData(dataslot, "foo");
+ }
+ Console.WriteLine("finalizer thread ID: {0}", (string)Thread.GetData(dataslot));
+ Environment.Exit(42);
+ }
+
+ public static void Main() {
+ ArrayList list = new ArrayList ();
+ Thread.SetData(dataslot, "ID is wibble");
+ while(true) {
+ foo instance = new foo();
+ list.Add (new WeakReference(instance));
+ }
+ }
+}
+
diff --git a/mono/tests/exiting/finalizer-exit.out b/mono/tests/exiting/finalizer-exit.out
new file mode 100755
index 00000000000..18a9961ad58
--- /dev/null
+++ b/mono/tests/exiting/finalizer-exit.out
@@ -0,0 +1,2 @@
+Set ID: foo
+finalizer thread ID: foo
diff --git a/mono/tests/exiting/main-exit.cs b/mono/tests/exiting/main-exit.cs
new file mode 100755
index 00000000000..bdf34f2e7d3
--- /dev/null
+++ b/mono/tests/exiting/main-exit.cs
@@ -0,0 +1,26 @@
+
+using System;
+using System.Threading;
+
+public class foo {
+ public static void Main() {
+ Thread thr=new Thread(new ThreadStart(foo.thread));
+ thr.Start();
+ Thread.Sleep(1200);
+ Console.WriteLine("Main thread exiting");
+ Environment.Exit(42);
+ }
+
+ public static void thread() {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ }
+}
+
diff --git a/mono/tests/exiting/main-exit.out b/mono/tests/exiting/main-exit.out
new file mode 100755
index 00000000000..28a9f46d902
--- /dev/null
+++ b/mono/tests/exiting/main-exit.out
@@ -0,0 +1,4 @@
+Thread running
+Thread running
+Thread running
+Main thread exiting
diff --git a/mono/tests/exiting/main-returns-abort-resetabort.cs b/mono/tests/exiting/main-returns-abort-resetabort.cs
new file mode 100755
index 00000000000..38aac7ec6e8
--- /dev/null
+++ b/mono/tests/exiting/main-returns-abort-resetabort.cs
@@ -0,0 +1,62 @@
+
+using System;
+using System.Threading;
+
+public class foo {
+ public static void Main() {
+ Thread thr=new Thread(new ThreadStart(foo.thread));
+ thr.Start();
+ Thread.Sleep(600);
+ Console.WriteLine("Aborting child thread");
+ thr.Abort();
+ Console.WriteLine("Main thread returns");
+ }
+
+ public static void thread() {
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ }
+}
+
diff --git a/mono/tests/exiting/main-returns-abort-resetabort.out b/mono/tests/exiting/main-returns-abort-resetabort.out
new file mode 100755
index 00000000000..d0fcbfa7710
--- /dev/null
+++ b/mono/tests/exiting/main-returns-abort-resetabort.out
@@ -0,0 +1,13 @@
+Thread running
+ThreadAbortException finally
+Thread running
+Aborting child thread
+Main thread returns
+Abort reset!
+ThreadAbortException finally
+Thread running
+ThreadAbortException finally
+Thread running
+ThreadAbortException finally
+Thread running
+ThreadAbortException finally
diff --git a/mono/tests/exiting/main-returns-background-abort-resetabort.cs b/mono/tests/exiting/main-returns-background-abort-resetabort.cs
new file mode 100755
index 00000000000..f2bbba20857
--- /dev/null
+++ b/mono/tests/exiting/main-returns-background-abort-resetabort.cs
@@ -0,0 +1,64 @@
+
+using System;
+using System.Threading;
+
+public class foo {
+ public static void Main() {
+ Thread thr=new Thread(new ThreadStart(foo.thread));
+ thr.IsBackground=true;
+ thr.Start();
+ Thread.Sleep(600);
+ Console.WriteLine("Aborting child thread");
+ thr.Abort();
+ Thread.Sleep(600);
+ Console.WriteLine("Main thread returns");
+ }
+
+ public static void thread() {
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ }
+}
+
diff --git a/mono/tests/exiting/main-returns-background-abort-resetabort.out b/mono/tests/exiting/main-returns-background-abort-resetabort.out
new file mode 100755
index 00000000000..35d8c072858
--- /dev/null
+++ b/mono/tests/exiting/main-returns-background-abort-resetabort.out
@@ -0,0 +1,10 @@
+Thread running
+ThreadAbortException finally
+Thread running
+Aborting child thread
+Abort reset!
+ThreadAbortException finally
+Thread running
+ThreadAbortException finally
+Thread running
+Main thread returns
diff --git a/mono/tests/exiting/main-returns-background-resetabort.cs b/mono/tests/exiting/main-returns-background-resetabort.cs
new file mode 100755
index 00000000000..127f1e50456
--- /dev/null
+++ b/mono/tests/exiting/main-returns-background-resetabort.cs
@@ -0,0 +1,61 @@
+
+using System;
+using System.Threading;
+
+public class foo {
+ public static void Main() {
+ Thread thr=new Thread(new ThreadStart(foo.thread));
+ thr.IsBackground=true;
+ thr.Start();
+ Thread.Sleep(1200);
+ Console.WriteLine("Main thread returns");
+ }
+
+ public static void thread() {
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ try {
+ Console.WriteLine("Thread running");
+ } catch(ThreadAbortException) {
+ Thread.ResetAbort();
+ Console.WriteLine("Abort reset!");
+ } finally {
+ Console.WriteLine("ThreadAbortException finally");
+ }
+ }
+}
+
diff --git a/mono/tests/exiting/main-returns-background-resetabort.out b/mono/tests/exiting/main-returns-background-resetabort.out
new file mode 100755
index 00000000000..a75645b1533
--- /dev/null
+++ b/mono/tests/exiting/main-returns-background-resetabort.out
@@ -0,0 +1,6 @@
+Thread running
+ThreadAbortException finally
+Thread running
+ThreadAbortException finally
+Thread running
+Main thread returns
diff --git a/mono/tests/exiting/main-returns-background.cs b/mono/tests/exiting/main-returns-background.cs
new file mode 100755
index 00000000000..024bdafa541
--- /dev/null
+++ b/mono/tests/exiting/main-returns-background.cs
@@ -0,0 +1,26 @@
+
+using System;
+using System.Threading;
+
+public class foo {
+ public static void Main() {
+ Thread thr=new Thread(new ThreadStart(foo.thread));
+ thr.IsBackground=true;
+ thr.Start();
+ Thread.Sleep(1200);
+ Console.WriteLine("Main thread returns");
+ }
+
+ public static void thread() {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ }
+}
+
diff --git a/mono/tests/exiting/main-returns-background.out b/mono/tests/exiting/main-returns-background.out
new file mode 100755
index 00000000000..d31f0145203
--- /dev/null
+++ b/mono/tests/exiting/main-returns-background.out
@@ -0,0 +1,4 @@
+Thread running
+Thread running
+Thread running
+Main thread returns
diff --git a/mono/tests/exiting/main-returns.cs b/mono/tests/exiting/main-returns.cs
new file mode 100755
index 00000000000..3a59c9b1d2c
--- /dev/null
+++ b/mono/tests/exiting/main-returns.cs
@@ -0,0 +1,25 @@
+
+using System;
+using System.Threading;
+
+public class foo {
+ public static void Main() {
+ Thread thr=new Thread(new ThreadStart(foo.thread));
+ thr.Start();
+ Thread.Sleep(1200);
+ Console.WriteLine("Main thread returns");
+ }
+
+ public static void thread() {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread running");
+ }
+}
+
diff --git a/mono/tests/exiting/main-returns.out b/mono/tests/exiting/main-returns.out
new file mode 100755
index 00000000000..315a8f5ec9b
--- /dev/null
+++ b/mono/tests/exiting/main-returns.out
@@ -0,0 +1,6 @@
+Thread running
+Thread running
+Thread running
+Main thread returns
+Thread running
+Thread running
diff --git a/mono/tests/exiting/subthread-exit.cs b/mono/tests/exiting/subthread-exit.cs
new file mode 100755
index 00000000000..b1429e0d116
--- /dev/null
+++ b/mono/tests/exiting/subthread-exit.cs
@@ -0,0 +1,20 @@
+
+using System;
+using System.Threading;
+
+public class foo {
+ public static void Main() {
+ Thread thr=new Thread(new ThreadStart(foo.thread));
+ thr.Start();
+ Thread.Sleep(1200);
+ Console.WriteLine("Main thread returns");
+ }
+
+ public static void thread() {
+ Console.WriteLine("Thread running");
+ Thread.Sleep(500);
+ Console.WriteLine("Thread exiting");
+ Environment.Exit(42);
+ }
+}
+
diff --git a/mono/tests/exiting/subthread-exit.out b/mono/tests/exiting/subthread-exit.out
new file mode 100755
index 00000000000..38711e42f8a
--- /dev/null
+++ b/mono/tests/exiting/subthread-exit.out
@@ -0,0 +1,2 @@
+Thread running
+Thread exiting
diff --git a/mono/tests/fib.cs b/mono/tests/fib.cs
index 212889482a0..eca6065a178 100755
--- a/mono/tests/fib.cs
+++ b/mono/tests/fib.cs
@@ -13,12 +13,17 @@ public class Fib {
if (args.Length == 1)
repeat = Convert.ToInt32 (args [0]);
- Console.WriteLine ("Repeat = " + repeat);
+// Console.WriteLine ("Repeat = " + repeat);
+ if (repeat > 32) {
+ Console.WriteLine ("{0}", fib (repeat));
+ return 0;
+ }
+
for (int i = 0; i < repeat; i++)
if (fib (32) != 3524578)
return 1;
-
+
return 0;
}
}
diff --git a/mono/tests/float-pop.cs b/mono/tests/float-pop.cs
new file mode 100644
index 00000000000..2cb61fc1ba2
--- /dev/null
+++ b/mono/tests/float-pop.cs
@@ -0,0 +1,26 @@
+using System;
+
+class Test {
+
+ static double test ()
+ {
+ return double.NaN;
+ }
+
+ static int Main()
+ {
+ ulong u = 3960077;
+ ulong f = 1000000;
+
+ for (int i = 0; i < 100; i++)
+ test ();
+
+ double d = u/(double)f;
+
+ if (d != 3.960077)
+ return 1;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/hostname.cs b/mono/tests/hostname.cs
new file mode 100644
index 00000000000..97c27cc656e
--- /dev/null
+++ b/mono/tests/hostname.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Net;
+
+public class A : MarshalByRefObject
+{
+ public void test()
+ {
+ Dns.GetHostByName("localhost");
+ }
+ public static void Main()
+ {
+ Console.WriteLine("aaa");
+ Dns.GetHostByName("localhost");
+ Console.WriteLine("bbb");
+ AppDomain domain = AppDomain.CreateDomain("aaa");
+ A a = (A)domain.CreateInstanceAndUnwrap(typeof(A).Assembly.FullName,
+typeof(A).FullName);
+ a.test();
+ }
+}
+
diff --git a/mono/tests/iface3.cs b/mono/tests/iface3.cs
index b3c8622354d..7d15381c4b7 100644
--- a/mono/tests/iface3.cs
+++ b/mono/tests/iface3.cs
@@ -30,11 +30,11 @@ public class Test {
if (r1.DoIt() != 5)
return 1;
+ // Console.WriteLine ("TEST {0}", ((ICommon)r1).DoIt ());
+
if (((ICommon)r1).DoIt() != 3)
return 2;
- //Console.WriteLine ("TEST {0}", ((ICommon)r1).DoIt ());
-
if (r2.DoIt() != 5)
return 3;
diff --git a/mono/tests/interfacecast.cs b/mono/tests/interfacecast.cs
new file mode 100644
index 00000000000..3f7080ca678
--- /dev/null
+++ b/mono/tests/interfacecast.cs
@@ -0,0 +1,23 @@
+using System;
+
+public class Test {
+
+ public enum MyEnum {
+ ZERO,
+ ONE
+ }
+
+ public static int Main() {
+ MyEnum en = MyEnum.ONE;
+ IComparable ic;
+ object o = en;
+
+ ic = (IComparable)o;
+
+ ic = (object)en as IComparable;
+ if (ic == null)
+ return 1;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/invoke-string-ctors.cs b/mono/tests/invoke-string-ctors.cs
new file mode 100644
index 00000000000..f132d04257f
--- /dev/null
+++ b/mono/tests/invoke-string-ctors.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Reflection;
+
+class T {
+
+ const int count = 10000;
+ static int Main () {
+ int res, i;
+ for (i = 0; i < count; ++i) {
+ res = run ();
+ if (res != 0)
+ return res;
+ }
+ return 0;
+ }
+
+ static unsafe int run () {
+ char[] val = new char[] {'h', 'e', 'l', 'l', 'o'};
+ string a;
+
+ a = (string)Activator.CreateInstance (typeof (string), new object[] {'a', 5});
+ if (a != "aaaaa") {
+ return 1;
+ }
+ a = (string)Activator.CreateInstance (typeof (string), new object[] {val});
+ if (a != "hello") {
+ return 2;
+ }
+ a = (string)Activator.CreateInstance (typeof (string), new object[] {val, 0, 3});
+ if (a != "hel") {
+ return 3;
+ }
+ /*
+ * The other ctors use pointers: maybe something like this is supposed to work some day.
+ fixed (char *c = val) {
+ a = (string)Activator.CreateInstance (typeof (string), new object[] {Pointer.Box (c, typeof (char*))});
+ if (a != "hello") {
+ return 4;
+ }
+ }*/
+ return 0;
+ }
+}
+
diff --git a/mono/tests/invoke.cs b/mono/tests/invoke.cs
new file mode 100644
index 00000000000..d304bbdc494
--- /dev/null
+++ b/mono/tests/invoke.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Reflection;
+
+class Test {
+
+ public struct SimpleStruct {
+ public bool a;
+ public bool b;
+ }
+
+ static void Test2 () {
+ Console.WriteLine ("Test2 called");
+ }
+
+ public static SimpleStruct Test1 (SimpleStruct ss) {
+ Console.WriteLine ("Test1 called " + ss.a + " " + ss.b);
+ SimpleStruct res = new SimpleStruct ();
+ res.a = !ss.a;
+ res.b = !ss.b;
+ return res;
+ }
+
+ public static void Foo(ref int x, ref int y)
+ {
+ x = 20;
+ y = 30;
+ }
+
+ static int Main () {
+ Type t = typeof (Test);
+
+ MethodInfo m2 = t.GetMethod ("Test2");
+ if (m2 != null)
+ return 1;
+
+ MethodInfo m1 = t.GetMethod ("Test1");
+ if (m1 == null)
+ return 1;
+
+ object [] args = new object [1];
+ SimpleStruct ss = new SimpleStruct ();
+ ss.a = true;
+ ss.b = false;
+ args [0] = ss;
+
+ SimpleStruct res = (SimpleStruct)m1.Invoke (null, args);
+
+ if (res.a == true)
+ return 1;
+ if (res.b == false)
+ return 1;
+
+ // Test that the objects for byref valuetype arguments are
+ // automatically created
+ MethodInfo m3 = typeof(Test).GetMethod("Foo");
+
+ args = new object[2];
+
+ m3.Invoke(null, args);
+
+ if ((((int)(args [0])) != 20) || (((int)(args [1])) != 30))
+ return 2;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/invoke2.cs b/mono/tests/invoke2.cs
new file mode 100644
index 00000000000..3dbf927efb4
--- /dev/null
+++ b/mono/tests/invoke2.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Reflection;
+
+class B {
+ public virtual int vmethod () {
+ return 0;
+ }
+}
+
+class T : B {
+
+ public override int vmethod () {
+ return 1;
+ }
+ static int stuff (int a) {
+ return 0;
+ }
+ static int stuff (char a) {
+ return 1;
+ }
+ static int Main () {
+ Type t = typeof (T);
+ Type b = typeof (B);
+ T obj = new T ();
+ Type[] char_types = new Type[1] {typeof(char)};
+ Type[] int_types = new Type[1] {typeof(int)};
+ object[] int_args = new object[1] {1};
+ object[] char_args = new object[1] {(char)1};
+ MethodBase m1, m2;
+ bool ok = false;
+ try {
+ m1 = t.GetMethod ("stuff", BindingFlags.Static|BindingFlags.NonPublic);
+ } catch (AmbiguousMatchException) {
+ ok = true;
+ }
+ if (!ok)
+ return 1;
+
+ m1 = t.GetMethod ("stuff", BindingFlags.Static|BindingFlags.NonPublic,
+ null, char_types, null);
+ Console.WriteLine ("m1: {0}", m1);
+ if (m1 == null)
+ return 2;
+
+ object m1res = m1.Invoke (null, char_args);
+ Console.WriteLine ("m1 invoke: {0}", m1res);
+ if ((int)m1res != 1)
+ return 3;
+
+ ok = false;
+ try {
+ m1res = m1.Invoke (null, int_args);
+ } catch (ArgumentException) {
+ ok = true;
+ }
+ if (!ok)
+ return 4;
+
+ m2 = b.GetMethod ("vmethod");
+ Console.WriteLine ("m2: {0}, declaring: {1}, reflected: {2}", m2, m2.DeclaringType, m2.ReflectedType);
+ object m2res = m2.Invoke (obj, null);
+ if ((int)m1res != 1)
+ return 5;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/libtest.c b/mono/tests/libtest.c
index 081e360adba..5523563956f 100644
--- a/mono/tests/libtest.c
+++ b/mono/tests/libtest.c
@@ -1,4 +1,134 @@
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+#include <errno.h>
+#include <time.h>
+
+#ifdef WIN32
+#define STDCALL __stdcall
+#else
+#define STDCALL
+#endif
+
+#ifdef WIN32
+extern __declspec(dllimport) __stdcall void CoTaskMemFree(void *ptr);
+#endif
+
+typedef int (STDCALL *SimpleDelegate) (int a);
+
+static void marshal_free (void *ptr)
+{
+#ifdef WIN32
+ CoTaskMemFree (ptr);
+#else
+ g_free (ptr);
+#endif
+}
+
+unsigned short*
+test_lpwstr_marshal (unsigned short* chars, long length)
+{
+ int i = 0;
+ unsigned short *res;
+
+ res = malloc (2 * (length + 1));
+
+ // printf("test_lpwstr_marshal()\n");
+
+ while ( i < length ) {
+ // printf("X|%u|\n", chars[i]);
+ res [i] = chars[i];
+ i++;
+ }
+
+ res [i] = 0;
+
+ return res;
+}
+
+typedef struct {
+ int b;
+ int a;
+ int c;
+} union_test_1_type;
+
+int mono_union_test_1 (union_test_1_type u1) {
+ // printf ("Got values %d %d %d\n", u1.b, u1.a, u1.c);
+ return u1.a + u1.b + u1.c;
+}
+
+int mono_return_int (int a) {
+ // printf ("Got value %d\n", a);
+ return a;
+}
+
+struct ss
+{
+ int i;
+};
+
+int mono_return_int_ss (struct ss a) {
+ // printf ("Got value %d\n", a.i);
+ return a.i;
+}
+
+struct ss mono_return_ss (struct ss a) {
+ // printf ("Got value %d\n", a.i);
+ a.i++;
+ return a;
+}
+
+struct sc1
+{
+ char c[1];
+};
+
+struct sc1 mono_return_sc1 (struct sc1 a) {
+ // printf ("Got value %d\n", a.c[0]);
+ a.c[0]++;
+ return a;
+}
+
+
+struct sc3
+{
+ char c[3];
+};
+
+struct sc3 mono_return_sc3 (struct sc3 a) {
+ // printf ("Got values %d %d %d\n", a.c[0], a.c[1], a.c[2]);
+ a.c[0]++;
+ a.c[1] += 2;
+ a.c[2] += 3;
+ return a;
+}
+
+struct sc5
+{
+ char c[5];
+};
+
+struct sc5 mono_return_sc5 (struct sc5 a) {
+ // printf ("Got values %d %d %d %d %d\n", a.c[0], a.c[1], a.c[2], a.c[3], a.c[4]);
+ a.c[0]++;
+ a.c[1] += 2;
+ a.c[2] += 3;
+ a.c[3] += 4;
+ a.c[4] += 5;
+ return a;
+}
+
+union su
+{
+ int i1;
+ int i2;
+};
+
+int mono_return_int_su (union su a) {
+ // printf ("Got value %d\n", a.i1);
+ return a.i1;
+}
int mono_test_many_int_arguments (int a, int b, int c, int d, int e,
int f, int g, int h, int i, int j);
@@ -25,25 +155,1119 @@ mono_test_many_byte_arguments (char a, char b, char c, char d, char e, char f, c
return a + b + c + d + e + f + g + h + i + j;
}
+float
+mono_test_many_float_arguments (float a, float b, float c, float d, float e, float f, float g, float h, float i, float j)
+{
+ return a + b + c + d + e + f + g + h + i + j;
+}
+
+double
+mono_test_many_double_arguments (double a, double b, double c, double d, double e, double f, double g, double h, double i, double j)
+{
+ return a + b + c + d + e + f + g + h + i + j;
+}
+
+double
+mono_test_split_double_arguments (double a, double b, float c, double d, double e)
+{
+ return a + b + c + d + e;
+}
+
int
mono_test_puts_static (char *s)
{
- printf ("TEST %s\n", s);
+ // printf ("TEST %s\n", s);
return 1;
}
-typedef int (*SimpleDelegate) (int a, int b);
+typedef int (STDCALL *SimpleDelegate3) (int a, int b);
int
-mono_invoke_delegate (SimpleDelegate delegate)
+mono_invoke_delegate (SimpleDelegate3 delegate)
{
int res;
- printf ("start invoke %p\n", delegate);
+ // printf ("start invoke %p\n", delegate);
res = delegate (2, 3);
- printf ("end invoke\n");
+ // printf ("end invoke\n");
+
+ return res;
+}
+
+int
+mono_test_marshal_char (short a1)
+{
+ if (a1 == 'a')
+ return 0;
+
+ return 1;
+}
+
+void
+mono_test_marshal_char_array (gunichar2 *s)
+{
+ const char m[] = "abcdef";
+ gunichar2* s2;
+ glong len;
+
+ s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL);
+
+ len = (len * 2) + 2;
+ memcpy (s, s2, len);
+
+ g_free (s2);
+}
+
+int
+mono_test_empty_pinvoke (int i)
+{
+ return i;
+}
+
+int
+mono_test_marshal_bool_byref (int a, int *b, int c)
+{
+ int res = *b;
+
+ *b = 1;
+
+ return res;
+}
+
+int
+mono_test_marshal_array (int *a1)
+{
+ int i, sum = 0;
+
+ for (i = 0; i < 50; i++)
+ sum += a1 [i];
+
+ return sum;
+}
+
+int
+mono_test_marshal_inout_array (int *a1)
+{
+ int i, sum = 0;
+
+ for (i = 0; i < 50; i++) {
+ sum += a1 [i];
+ a1 [i] = 50 - a1 [i];
+ }
+
+ return sum;
+}
+
+int
+mono_test_marshal_inout_nonblittable_array (gunichar2 *a1)
+{
+ int i, sum = 0;
+
+ for (i = 0; i < 10; i++) {
+ a1 [i] = 'F';
+ }
+
+ return sum;
+}
+
+typedef struct {
+ int a;
+ int b;
+ int c;
+ const char *d;
+} simplestruct;
+
+simplestruct
+mono_test_return_vtype (int i)
+{
+ simplestruct res;
+
+ res.a = 0;
+ res.b = 1;
+ res.c = 0;
+ res.d = "TEST";
+
+ return res;
+}
+
+void
+mono_test_delegate_struct (void)
+{
+ // printf ("TEST\n");
+}
+
+typedef char* (STDCALL *ReturnStringDelegate) (const char *s);
+
+char *
+mono_test_return_string (ReturnStringDelegate func)
+{
+ char *res;
+
+ // printf ("mono_test_return_string\n");
+
+ res = func ("TEST");
+ marshal_free (res);
+
+ // printf ("got string: %s\n", res);
+ return g_strdup ("12345");
+}
+
+typedef int (STDCALL *RefVTypeDelegate) (int a, simplestruct *ss, int b);
+
+int
+mono_test_ref_vtype (int a, simplestruct *ss, int b, RefVTypeDelegate func)
+{
+ if (a == 1 && b == 2 && ss->a == 0 && ss->b == 1 && ss->c == 0 &&
+ !strcmp (ss->d, "TEST1")) {
+ ss->a = 1;
+ ss->b = 0;
+ ss->c = 1;
+ ss->d = "TEST2";
+
+ return func (a, ss, b);
+ }
+
+ return 1;
+}
+
+typedef int (STDCALL *OutVTypeDelegate) (int a, simplestruct *ss, int b);
+
+int
+mono_test_marshal_out_struct (int a, simplestruct *ss, int b, OutVTypeDelegate func)
+{
+ int res;
+
+ /* Check that the input pointer is ignored */
+ ss->d = (gpointer)0x12345678;
+
+ func (a, ss, b);
+
+ if (ss->a && ss->b && ss->c && !strcmp (ss->d, "TEST3"))
+ return 0;
+ else
+ return 1;
+}
+
+typedef struct {
+ int a;
+ SimpleDelegate func, func2;
+} DelegateStruct;
+
+int
+mono_test_marshal_delegate_struct (DelegateStruct ds)
+{
+ return ds.func (ds.a) + ds.func2 (ds.a);
+}
+
+int
+mono_test_marshal_struct (simplestruct ss)
+{
+ if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
+ !strcmp (ss.d, "TEST"))
+ return 0;
+
+ return 1;
+}
+
+typedef struct {
+ int a;
+ int b;
+ int c;
+ char *d;
+ unsigned char e;
+ double f;
+ unsigned char g;
+ guint64 h;
+} simplestruct2;
+
+int
+mono_test_marshal_struct2 (simplestruct2 ss)
+{
+ if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
+ !strcmp (ss.d, "TEST") &&
+ ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123)
+ return 0;
+
+ return 1;
+}
+
+/* on HP some of the struct should be on the stack and not in registers */
+int
+mono_test_marshal_struct2_2 (int i, int j, int k, simplestruct2 ss)
+{
+ if (i != 10 || j != 11 || k != 12)
+ return 1;
+ if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
+ !strcmp (ss.d, "TEST") &&
+ ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123)
+ return 0;
+
+ return 1;
+}
+
+int
+mono_test_marshal_struct_array (simplestruct2 *ss)
+{
+ if (! (ss[0].a == 0 && ss[0].b == 1 && ss[0].c == 0 &&
+ !strcmp (ss[0].d, "TEST") &&
+ ss[0].e == 99 && ss[0].f == 1.5 && ss[0].g == 42 && ss[0].h == (guint64)123))
+ return 1;
+
+ if (! (ss[1].a == 0 && ss[1].b == 0 && ss[1].c == 0 &&
+ !strcmp (ss[1].d, "TEST2") &&
+ ss[1].e == 100 && ss[1].f == 2.5 && ss[1].g == 43 && ss[1].h == (guint64)124))
+ return 1;
+
+ return 0;
+}
+
+typedef struct long_align_struct {
+ gint32 a;
+ gint64 b;
+ gint64 c;
+} long_align_struct;
+
+int
+mono_test_marshal_long_align_struct_array (long_align_struct *ss)
+{
+ return ss[0].a + ss[0].b + ss[0].c + ss[1].a + ss[1].b + ss[1].c;
+}
+
+simplestruct2 *
+mono_test_marshal_class (int i, int j, int k, simplestruct2 *ss, int l)
+{
+ simplestruct2 *res;
+
+ if (!ss)
+ return NULL;
+
+ if (i != 10 || j != 11 || k != 12 || l != 14)
+ return NULL;
+ if (! (ss->a == 0 && ss->b == 1 && ss->c == 0 &&
+ !strcmp (ss->d, "TEST") &&
+ ss->e == 99 && ss->f == 1.5 && ss->g == 42 && ss->h == (guint64)123))
+ return NULL;
+
+ res = g_new0 (simplestruct2, 1);
+ memcpy (res, ss, sizeof (simplestruct2));
+ res->d = g_strdup ("TEST");
+ return res;
+}
+
+int
+mono_test_marshal_byref_class (simplestruct2 **ssp)
+{
+ simplestruct2 *ss = *ssp;
+ simplestruct2 *res;
+
+ if (! (ss->a == 0 && ss->b == 1 && ss->c == 0 &&
+ !strcmp (ss->d, "TEST") &&
+ ss->e == 99 && ss->f == 1.5 && ss->g == 42 && ss->h == (guint64)123))
+ return 1;
+
+ res = g_new0 (simplestruct2, 1);
+ memcpy (res, ss, sizeof (simplestruct2));
+ res->d = g_strdup ("TEST-RES");
+
+ *ssp = res;
+ return 0;
+}
+
+static void *
+get_sp (void)
+{
+ int i;
+ void *p;
+
+ p = &i;
+ return p;
+}
+
+int
+mono_test_marshal_delegate (SimpleDelegate delegate)
+{
+ void *sp1, *sp2;
+
+ /* Check that the delegate wrapper is stdcall */
+ delegate (2);
+ sp1 = get_sp ();
+ delegate (2);
+ sp2 = get_sp ();
+ g_assert (sp1 == sp2);
+
+ return delegate (2);
+}
+
+SimpleDelegate
+mono_test_marshal_return_delegate (SimpleDelegate delegate)
+{
+ return delegate;
+}
+
+typedef simplestruct (STDCALL *SimpleDelegate2) (simplestruct ss);
+
+int
+mono_test_marshal_delegate2 (SimpleDelegate2 delegate)
+{
+ simplestruct ss, res;
+
+ ss.a = 0;
+ ss.b = 1;
+ ss.c = 0;
+ ss.d = "TEST";
+
+ res = delegate (ss);
+ if (! (res.a && !res.b && res.c && !strcmp (res.d, "TEST-RES")))
+ return 1;
+
+ return 0;
+}
+
+typedef simplestruct* (STDCALL *SimpleDelegate4) (simplestruct *ss);
+
+int
+mono_test_marshal_delegate4 (SimpleDelegate4 delegate)
+{
+ simplestruct ss;
+ simplestruct *res;
+
+ ss.a = 0;
+ ss.b = 1;
+ ss.c = 0;
+ ss.d = "TEST";
+
+ /* Check argument */
+ res = delegate (&ss);
+ if (!res)
+ return 1;
+
+ /* Check return value */
+ if (! (!res->a && res->b && !res->c && !strcmp (res->d, "TEST")))
+ return 2;
+
+ /* Check NULL argument and NULL result */
+ res = delegate (NULL);
+ if (res)
+ return 3;
+
+ return 0;
+}
+
+typedef int (STDCALL *SimpleDelegate5) (simplestruct **ss);
+
+int
+mono_test_marshal_delegate5 (SimpleDelegate5 delegate)
+{
+ simplestruct ss;
+ int res;
+ simplestruct *ptr;
+
+ ss.a = 0;
+ ss.b = 1;
+ ss.c = 0;
+ ss.d = "TEST";
+
+ ptr = &ss;
+
+ res = delegate (&ptr);
+ if (res != 0)
+ return 1;
+
+ if (!(ptr->a && !ptr->b && ptr->c && !strcmp (ptr->d, "RES")))
+ return 2;
+
+ return 0;
+}
+
+int
+mono_test_marshal_delegate6 (SimpleDelegate5 delegate)
+{
+ int res;
+
+ res = delegate (NULL);
+
+ return 0;
+}
+
+typedef int (STDCALL *SimpleDelegate7) (simplestruct **ss);
+
+int
+mono_test_marshal_delegate7 (SimpleDelegate7 delegate)
+{
+ int res;
+ simplestruct *ptr;
+
+ /* Check that the input pointer is ignored */
+ ptr = (gpointer)0x12345678;
+
+ res = delegate (&ptr);
+ if (res != 0)
+ return 1;
+
+ if (!(ptr->a && !ptr->b && ptr->c && !strcmp (ptr->d, "RES")))
+ return 2;
+
+ return 0;
+}
+
+typedef int (STDCALL *SimpleDelegate8) (gunichar2 *s);
+
+int
+mono_test_marshal_delegate8 (SimpleDelegate8 delegate, gunichar2 *s)
+{
+ return delegate (s);
+}
+
+typedef int (STDCALL *return_int_fnt) (int i);
+typedef int (STDCALL *SimpleDelegate9) (return_int_fnt *d);
+
+int
+mono_test_marshal_delegate9 (SimpleDelegate9 delegate, gpointer ftn)
+{
+ return delegate (ftn);
+}
+
+int
+return_self (int i)
+{
+ return i;
+}
+
+int
+mono_test_marshal_delegate10 (SimpleDelegate9 delegate)
+{
+ return delegate (return_self);
+}
+
+typedef int (STDCALL *PrimitiveByrefDelegate) (int *i);
+
+int
+mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate delegate)
+{
+ int i = 1;
+
+ int res = delegate (&i);
+ if (res != 0)
+ return res;
+
+ if (i != 2)
+ return 2;
+
+ return 0;
+}
+
+typedef int (STDCALL *return_int_delegate) (int i);
+
+typedef return_int_delegate (STDCALL *ReturnDelegateDelegate) ();
+
+int
+mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d)
+{
+ return (d ()) (55);
+}
+
+
+int
+mono_test_marshal_stringbuilder (char *s, int n)
+{
+ const char m[] = "This is my message. Isn't it nice?";
+
+ if (strcmp (s, "ABCD") != 0)
+ return 1;
+ strncpy(s, m, n);
+ return 0;
+}
+
+int
+mono_test_marshal_stringbuilder_unicode (gunichar2 *s, int n)
+{
+ const char m[] = "This is my message. Isn't it nice?";
+ gunichar2* s2;
+ glong len;
+
+ s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL);
+
+ len = (len * 2) + 2;
+ if (len > n)
+ len = n;
+ memcpy (s, s2, len);
+
+ g_free (s2);
+
+ return 0;
+}
+
+typedef struct {
+#ifndef __GNUC__
+ char a;
+#endif
+} EmptyStruct;
+
+int
+mono_test_marshal_empty_string_array (char **array)
+{
+ return (array == NULL) ? 0 : 1;
+}
+
+int
+mono_test_marshal_string_array (char **array)
+{
+ if (strcmp (array [0], "ABC"))
+ return 1;
+ if (strcmp (array [1], "DEF"))
+ return 2;
+
+ if (array [2] != NULL)
+ return 3;
+
+ return 0;
+}
+
+int
+mono_test_marshal_byref_string_array (char ***array)
+{
+ if (*array == NULL)
+ return 0;
+
+ if (strcmp ((*array) [0], "Alpha"))
+ return 2;
+ if (strcmp ((*array) [1], "Beta"))
+ return 2;
+ if (strcmp ((*array) [2], "Gamma"))
+ return 2;
+
+ return 1;
+}
+
+int
+mono_test_marshal_stringbuilder_array (char **array)
+{
+ if (strcmp (array [0], "ABC"))
+ return 1;
+ if (strcmp (array [1], "DEF"))
+ return 2;
+
+ strcpy (array [0], "DEF");
+ strcpy (array [1], "ABC");
+
+ return 0;
+}
+
+int
+mono_test_marshal_unicode_string_array (gunichar2 **array, char **array2)
+{
+ GError *error = NULL;
+ char *s;
+
+ s = g_utf16_to_utf8 (array [0], -1, NULL, NULL, &error);
+ if (strcmp (s, "ABC")) {
+ g_free (s);
+ return 1;
+ }
+ else
+ g_free (s);
+
+ s = g_utf16_to_utf8 (array [1], -1, NULL, NULL, &error);
+ if (strcmp (s, "DEF")) {
+ g_free (s);
+ return 2;
+ }
+ else
+ g_free (s);
+
+ if (strcmp (array2 [0], "ABC"))
+ return 3;
+
+ if (strcmp (array2 [1], "DEF"))
+ return 4;
+
+ return 0;
+}
+
+/* this does not work on Redhat gcc 2.96 */
+int
+mono_test_empty_struct (int a, EmptyStruct es, int b)
+{
+ // printf ("mono_test_empty_struct %d %d\n", a, b);
+
+ if (a == 1 && b == 2)
+ return 0;
+ return 1;
+}
+
+typedef struct {
+ char a[100];
+} ByValStrStruct;
+
+ByValStrStruct *
+mono_test_byvalstr_gen (void)
+{
+ ByValStrStruct *ret;
+
+ ret = malloc(sizeof(ByValStrStruct));
+ memset(ret, 'a', sizeof(ByValStrStruct)-1);
+ ret->a[sizeof(ByValStrStruct)-1] = 0;
+
+ return ret;
+}
+
+int
+mono_test_byvalstr_check (ByValStrStruct* data, char* correctString)
+{
+ int ret;
+
+ ret = strcmp(data->a, correctString);
+ // printf ("T1: %s\n", data->a);
+ // printf ("T2: %s\n", correctString);
+
+ marshal_free (data);
+ return (ret != 0);
+}
+
+int
+HexDump(char *data)
+{
+ int i, res = 0;
+ char *p;
+
+ printf ("HEXDUMP DEFAULT VERSION\n");
+
+ p = data;
+ for (i=0; i < 8; ++i)
+ {
+ res += *p;
+ printf("%0x ", (int) *(p++));
+ }
+ putchar('\n');
return res;
}
+
+int
+HexDumpA(char *data)
+{
+ int i, res = 0;
+ char *p;
+
+ printf ("HEXDUMP ANSI VERSION\n");
+
+ p = data;
+ for (i=0; i < 8; ++i)
+ {
+ res += *p;
+ printf("%0x ", (int) *(p++));
+ }
+ putchar('\n');
+
+ return res + 100000;
+}
+
+int
+HexDump1W(char *data)
+{
+ int i, res = 0;
+ char *p;
+
+ printf ("HEXDUMP UNICODE VERSION\n");
+
+ p = data;
+ for (i=0; i < 8; ++i)
+ {
+ res += *p;
+ printf("%0x ", (int) *(p++));
+ }
+ putchar('\n');
+
+ return res + 1000000;
+}
+
+typedef int (STDCALL *intcharFunc)(const char*);
+
+void
+callFunction (intcharFunc f)
+{
+ f ("ABC");
+}
+
+typedef struct {
+ const char* str;
+ int i;
+} SimpleObj;
+
+int
+class_marshal_test0 (SimpleObj *obj1)
+{
+ // printf ("class_marshal_test0 %s %d\n", obj1->str, obj1->i);
+
+ if (strcmp(obj1->str, "T1"))
+ return -1;
+ if (obj1->i != 4)
+ return -2;
+
+ return 0;
+}
+
+int
+class_marshal_test4 (SimpleObj *obj1)
+{
+ if (obj1)
+ return -1;
+
+ return 0;
+}
+
+void
+class_marshal_test1 (SimpleObj **obj1)
+{
+ SimpleObj *res = malloc (sizeof (SimpleObj));
+
+ res->str = g_strdup ("ABC");
+ res->i = 5;
+
+ *obj1 = res;
+}
+
+int
+class_marshal_test2 (SimpleObj **obj1)
+{
+ // printf ("class_marshal_test2 %s %d\n", (*obj1)->str, (*obj1)->i);
+
+ if (strcmp((*obj1)->str, "ABC"))
+ return -1;
+ if ((*obj1)->i != 5)
+ return -2;
+
+ return 0;
+}
+
+int
+string_marshal_test0 (char *str)
+{
+ if (strcmp (str, "TEST0"))
+ return -1;
+
+ return 0;
+}
+
+void
+string_marshal_test1 (const char **str)
+{
+ *str = "TEST1";
+}
+
+int
+string_marshal_test2 (char **str)
+{
+ // printf ("string_marshal_test2 %s\n", *str);
+
+ if (strcmp (*str, "TEST1"))
+ return -1;
+
+ return 0;
+}
+
+int
+string_marshal_test3 (char *str)
+{
+ if (str)
+ return -1;
+
+ return 0;
+}
+
+typedef struct {
+ int a;
+ int b;
+} VectorList;
+
+
+VectorList* TestVectorList (VectorList *vl)
+{
+ VectorList *res;
+
+ // printf ("TestVectorList %d %d\n", vl->a, vl->b);
+
+ vl->a++;
+ vl->b++;
+
+ res = g_new0 (VectorList, 1);
+ memcpy (res, vl, sizeof (VectorList));
+
+ return res;
+}
+
+
+typedef struct _OSVERSIONINFO
+{
+ int a;
+ int b;
+} OSVERSIONINFO;
+
+int
+GetVersionEx (OSVERSIONINFO *osvi)
+{
+
+ // printf ("GOT %d %d\n", osvi->a, osvi->b);
+
+ osvi->a += 1;
+ osvi->b += 1;
+
+ return osvi->a + osvi->b;
+}
+
+int
+BugGetVersionEx (int a, int b, int c, int d, int e, int f, int g, int h, OSVERSIONINFO *osvi)
+{
+
+ // printf ("GOT %d %d\n", osvi->a, osvi->b);
+
+ osvi->a += 1;
+ osvi->b += 1;
+
+ return osvi->a + osvi->b;
+}
+
+typedef struct {
+ double x;
+ double y;
+} point;
+
+int
+mono_test_marshal_point (point pt)
+{
+ // printf("point %g %g\n", pt.x, pt.y);
+ if (pt.x == 1.25 && pt.y == 3.5)
+ return 0;
+
+ return 1;
+}
+
+typedef struct {
+ int x;
+ double y;
+} mixed_point;
+
+int
+mono_test_marshal_mixed_point (mixed_point pt)
+{
+ // printf("mixed point %d %g\n", pt.x, pt.y);
+ if (pt.x == 5 && pt.y == 6.75)
+ return 0;
+
+ return 1;
+}
+
+int
+mono_test_marshal_mixed_point_2 (mixed_point *pt)
+{
+ if (pt->x != 5 || pt->y != 6.75)
+ return 1;
+
+ pt->x = 10;
+ pt->y = 12.35;
+
+ return 0;
+}
+
+int
+marshal_test_ref_bool(int i, char *b1, short *b2, int *b3)
+{
+ int res = 1;
+ if (*b1 != 0 && *b1 != 1)
+ return 1;
+ if (*b2 != 0 && *b2 != -1) /* variant_bool */
+ return 1;
+ if (*b3 != 0 && *b3 != 1)
+ return 1;
+ if (i == ((*b1 << 2) | (-*b2 << 1) | *b3))
+ res = 0;
+ *b1 = !*b1;
+ *b2 = ~*b2;
+ *b3 = !*b3;
+ return res;
+}
+
+struct BoolStruct
+{
+ int i;
+ char b1;
+ short b2; /* variant_bool */
+ int b3;
+};
+
+int
+marshal_test_bool_struct(struct BoolStruct *s)
+{
+ int res = 1;
+ if (s->b1 != 0 && s->b1 != 1)
+ return 1;
+ if (s->b2 != 0 && s->b2 != -1)
+ return 1;
+ if (s->b3 != 0 && s->b3 != 1)
+ return 1;
+ if (s->i == ((s->b1 << 2) | (-s->b2 << 1) | s->b3))
+ res = 0;
+ s->b1 = !s->b1;
+ s->b2 = ~s->b2;
+ s->b3 = !s->b3;
+ return res;
+}
+
+#ifdef WIN32
+extern __declspec(dllimport) __stdcall void SetLastError(int x);
+#endif
+
+void
+mono_test_last_error (int err)
+{
+#ifdef WIN32
+ SetLastError (err);
+#else
+ errno = err;
+#endif
+}
+
+int
+mono_test_asany (void *ptr, int what)
+{
+ switch (what) {
+ case 1:
+ return (*(int*)ptr == 5) ? 0 : 1;
+ case 2:
+ return strcmp (ptr, "ABC") == 0 ? 0 : 1;
+ case 3: {
+ simplestruct2 ss = *(simplestruct2*)ptr;
+
+ if (ss.a == 0 && ss.b == 1 && ss.c == 0 &&
+ !strcmp (ss.d, "TEST") &&
+ ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123)
+ return 0;
+ else
+ return 1;
+ }
+ case 4: {
+ GError *error = NULL;
+ char *s;
+
+ s = g_utf16_to_utf8 (ptr, -1, NULL, NULL, &error);
+ if (!strcmp (s, "ABC")) {
+ g_free (s);
+ return 0;
+ }
+ else {
+ g_free (s);
+ return 1;
+ }
+ }
+ default:
+ g_assert_not_reached ();
+ }
+
+ return 1;
+}
+
+/*
+ * AMD64 marshalling tests.
+ */
+
+typedef struct amd64_struct1 {
+ int i;
+ int j;
+ int k;
+ int l;
+} amd64_struct1;
+
+amd64_struct1
+mono_test_marshal_amd64_pass_return_struct1 (amd64_struct1 s)
+{
+ s.i ++;
+ s.j ++;
+ s.k ++;
+ s.l ++;
+
+ return s;
+}
+
+typedef struct amd64_struct2 {
+ int i;
+ int j;
+} amd64_struct2;
+
+amd64_struct2
+mono_test_marshal_amd64_pass_return_struct2 (amd64_struct2 s)
+{
+ s.i ++;
+ s.j ++;
+
+ return s;
+}
+
+typedef struct amd64_struct3 {
+ int i;
+} amd64_struct3;
+
+amd64_struct3
+mono_test_marshal_amd64_pass_return_struct3 (amd64_struct3 s)
+{
+ s.i ++;
+
+ return s;
+}
+
+typedef struct amd64_struct4 {
+ double d1, d2;
+} amd64_struct4;
+
+amd64_struct4
+mono_test_marshal_amd64_pass_return_struct4 (amd64_struct4 s)
+{
+ s.d1 ++;
+ s.d2 ++;
+
+ return s;
+}
+
+static guint32 custom_res [2];
+
+void*
+mono_test_marshal_pass_return_custom (int i, guint32 *ptr, int j)
+{
+ /* ptr will be freed by CleanupNative, so make a copy */
+ custom_res [0] = 0; /* not allocated by AllocHGlobal */
+ custom_res [1] = ptr [1];
+
+ return &custom_res;
+}
+
+typedef void *(STDCALL *PassReturnPtrDelegate) (void *ptr);
+
+int
+mono_test_marshal_pass_return_custom_in_delegate (PassReturnPtrDelegate del)
+{
+ guint32 buf [2];
+ guint32 res;
+ guint32 *ptr;
+
+ buf [0] = 0;
+ buf [1] = 10;
+
+ ptr = del (&buf);
+
+ res = ptr [1];
+
+#ifdef WIN32
+ /* FIXME: Freed with FreeHGlobal */
+#else
+ g_free (ptr);
+#endif
+
+ return res;
+}
+
+STDCALL int
+mono_test_stdcall_name_mangling (int a, int b, int c)
+{
+ return a + b + c;
+}
diff --git a/mono/tests/loader.cs b/mono/tests/loader.cs
new file mode 100644
index 00000000000..caaec151ec0
--- /dev/null
+++ b/mono/tests/loader.cs
@@ -0,0 +1,46 @@
+//
+// loader.cs:
+//
+// Tests for assembly loading
+//
+
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+
+public class Tests {
+
+ public static int Main (string[] args)
+ {
+ return TestDriver.RunTests (typeof (Tests), args);
+ }
+
+ public static int test_0_load_partial_name ()
+ {
+ if (Assembly.LoadWithPartialName ("mscorlib") == null)
+ return 1;
+ else
+ return 0;
+ }
+
+ public static int test_0_load_dynamic ()
+ {
+ // Check that dynamic assemblies are not loaded by Assembly.Load
+ AssemblyName an = new AssemblyName();
+ an.Name = "NOT.EXISTS";
+
+ AssemblyBuilder ab =
+ AppDomain.CurrentDomain.DefineDynamicAssembly(an,
+ AssemblyBuilderAccess.RunAndSave);
+
+ ModuleBuilder mb = ab.DefineDynamicModule("NOT.EXISTS");
+
+ Assembly b = Assembly.LoadWithPartialName ("NOT.EXISTS");
+ if (b == null)
+ return 0;
+ else
+ return 1;
+ }
+}
+
+
diff --git a/mono/tests/many-locals.cs b/mono/tests/many-locals.cs
index 82470f770e1..01135a9c90c 100644
--- a/mono/tests/many-locals.cs
+++ b/mono/tests/many-locals.cs
@@ -218,6 +218,8 @@ namespace Simple {
T loc197 = new T (0xdeadbeef, 0xcafebabe);
T loc198 = new T (0xdeadbeef, 0xcafebabe);
T loc199 = new T (0xdeadbeef, 0xcafebabe);
+ int loc_i = 11;
+ long loc_j = 12;
if (loc0.A != 0xdeadbeef || loc0.B != 0xcafebabe) throw new System.Exception ();
if (loc1.A != 0xdeadbeef || loc1.B != 0xcafebabe) throw new System.Exception();
@@ -419,7 +421,8 @@ namespace Simple {
if (loc197.A != 0xdeadbeef || loc197.B != 0xcafebabe) throw new System.Exception();
if (loc198.A != 0xdeadbeef || loc198.B != 0xcafebabe) throw new System.Exception();
if (loc199.A != 0xdeadbeef || loc199.B != 0xcafebabe) throw new System.Exception();
-
+ if (loc_i != 11) throw new System.Exception ();
+ if (loc_j != 12) throw new System.Exception ();
return 0;
}
diff --git a/mono/tests/marshal.cs b/mono/tests/marshal.cs
new file mode 100644
index 00000000000..81af468afe1
--- /dev/null
+++ b/mono/tests/marshal.cs
@@ -0,0 +1,54 @@
+//
+// marshal.cs: tests for the System.Runtime.InteropServices.Marshal class
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+public class Tests {
+
+ public static int Main (string[] args) {
+ return TestDriver.RunTests (typeof (Tests), args);
+ }
+
+ public delegate int SimpleDelegate (int a);
+
+ public static int delegate_test (int a)
+ {
+ return a + 1;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate")]
+ public static extern int mono_test_marshal_delegate (IntPtr ptr);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate")]
+ public static extern IntPtr mono_test_marshal_return_delegate (SimpleDelegate d);
+
+ static int test_0_get_function_pointer_for_delegate () {
+ // This is a 2.0 feature
+ MethodInfo mi = typeof (Marshal).GetMethod ("GetFunctionPointerForDelegate");
+ if (mi == null)
+ return 0;
+
+ IntPtr fnPtr = (IntPtr)mi.Invoke (null, new object [] { new SimpleDelegate (delegate_test)});
+
+ if (mono_test_marshal_delegate (fnPtr) != 3)
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_get_delegate_for_function_pointer () {
+ // This is a 2.0 feature
+ MethodInfo mi = typeof (Marshal).GetMethod ("GetDelegateForFunctionPointer");
+ if (mi == null)
+ return 0;
+
+ IntPtr ptr = mono_test_marshal_return_delegate (new SimpleDelegate (delegate_test));
+
+ SimpleDelegate d = (SimpleDelegate)mi.Invoke (null, new object [] { ptr, typeof (SimpleDelegate) });
+
+ return d (5) == 6 ? 0 : 1;
+ }
+}
diff --git a/mono/tests/marshal1.cs b/mono/tests/marshal1.cs
index acdce6e0ab9..fff98171cf8 100755
--- a/mono/tests/marshal1.cs
+++ b/mono/tests/marshal1.cs
@@ -8,9 +8,6 @@ public class Test {
byte [] bytedest = new byte [20];
IntPtr dest = Marshal.AllocHGlobal (1024);
-
- foreach (byte b in bytesrc)
- b = 0;
bytesrc [2] = 2;
bytesrc [11] = 11;
diff --git a/mono/tests/marshal2.cs b/mono/tests/marshal2.cs
new file mode 100755
index 00000000000..9ba085f63f0
--- /dev/null
+++ b/mono/tests/marshal2.cs
@@ -0,0 +1,139 @@
+using System;
+using System.Runtime.InteropServices;
+
+public class Test {
+
+
+ [StructLayout (LayoutKind.Sequential)]
+ public class SimpleObj {
+ public int a;
+ public int b;
+
+ public void test () {}
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct SimpleStruct2 {
+ public int a;
+ public int b;
+ }
+
+ [StructLayout (LayoutKind.Sequential, CharSet=CharSet.Ansi)]
+ public struct SimpleStruct {
+ public int a;
+ public bool bool1;
+ public bool bool2;
+ public int b;
+ [MarshalAs (UnmanagedType.ByValArray, SizeConst=2)] public short[] a1;
+ [MarshalAs (UnmanagedType.ByValTStr, SizeConst=4)] public string s1;
+ public SimpleStruct2 emb1;
+ public SimpleObj emb2;
+ public string s2;
+ public double x;
+ }
+
+ public unsafe static int Main () {
+ SimpleStruct ss = new SimpleStruct ();
+ int size = Marshal.SizeOf (typeof (SimpleStruct));
+
+ Console.WriteLine ("SimpleStruct:" + size);
+ //if (size != 52)
+ //return 1;
+
+ IntPtr p = Marshal.AllocHGlobal (size);
+ ss.a = 1;
+ ss.bool1 = true;
+ ss.bool2 = false;
+ ss.b = 2;
+ ss.a1 = new short [2];
+ ss.a1 [0] = 6;
+ ss.a1 [1] = 5;
+ ss.s1 = "abcd";
+ ss.emb1 = new SimpleStruct2 ();
+ ss.emb1.a = 3;
+ ss.emb1.b = 4;
+ ss.emb2 = new SimpleObj ();
+ ss.emb2.a = 10;
+ ss.emb2.b = 11;
+ ss.s2 = "just a test";
+ ss.x = 1.5;
+
+ Marshal.StructureToPtr (ss, p, false);
+ Type t = ss.GetType ();
+
+ if (Marshal.ReadInt32 (p, (int)Marshal.OffsetOf (t, "a")) != 1)
+ return 1;
+ if (Marshal.ReadInt32 (p, (int)Marshal.OffsetOf (t, "bool1")) != 1)
+ return 2;
+ if (Marshal.ReadInt32 (p, (int)Marshal.OffsetOf (t, "bool2")) != 0)
+ return 3;
+ if (Marshal.ReadInt32 (p, (int)Marshal.OffsetOf (t, "b")) != 2)
+ return 4;
+ if (Marshal.ReadInt16 (p, 16) != 6)
+ return 5;
+ if (Marshal.ReadInt16 (p, 18) != 5)
+ return 6;
+ if (Marshal.ReadByte (p, 20) != 97)
+ return 7;
+ if (Marshal.ReadByte (p, 21) != 98)
+ return 8;
+ if (Marshal.ReadByte (p, 22) != 99)
+ return 9;
+ if (Marshal.ReadByte (p, 23) != 0)
+ return 10;
+ if (Marshal.ReadInt32 (p, 24) != 3)
+ return 11;
+ if (Marshal.ReadInt32 (p, 28) != 4)
+ return 12;
+ if (Marshal.ReadInt32 (p, 32) != 10)
+ return 13;
+ if (Marshal.ReadInt32 (p, 36) != 11)
+ return 14;
+ if (Marshal.ReadInt32 (p, (int)Marshal.OffsetOf (t, "s2")) == 0)
+ return 15;
+
+ SimpleStruct cp = (SimpleStruct)Marshal.PtrToStructure (p, ss.GetType ());
+
+ if (cp.a != 1)
+ return 16;
+
+ if (cp.bool1 != true)
+ return 17;
+
+ if (cp.bool2 != false)
+ return 18;
+
+ if (cp.b != 2)
+ return 19;
+
+ if (cp.a1 [0] != 6)
+ return 20;
+
+ if (cp.a1 [1] != 5)
+ return 21;
+
+ if (cp.s1 != "abc")
+ return 22;
+
+ if (cp.emb1.a != 3)
+ return 23;
+
+ if (cp.emb1.b != 4)
+ return 24;
+
+ if (cp.emb2.a != 10)
+ return 25;
+
+ if (cp.emb2.b != 11)
+ return 26;
+
+ if (cp.s2 != "just a test")
+ return 27;
+
+ if (cp.x != 1.5)
+ return 28;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/marshal3.cs b/mono/tests/marshal3.cs
new file mode 100755
index 00000000000..7f984b60b39
--- /dev/null
+++ b/mono/tests/marshal3.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Runtime.InteropServices;
+
+public class Test {
+
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct BlittableStruct {
+ public int a;
+ public int b;
+ }
+
+ public unsafe static int Main () {
+ BlittableStruct ss = new BlittableStruct ();
+ int size = Marshal.SizeOf (typeof (BlittableStruct));
+
+ Console.WriteLine ("BlittableStruct:" + size);
+ if (size != 8)
+ return 1;
+
+ IntPtr p = Marshal.AllocHGlobal (size);
+ ss.a = 123;
+ ss.b = 124;
+
+ Marshal.StructureToPtr (ss, p, false);
+ Type t = ss.GetType ();
+
+ if (Marshal.ReadInt32 (p, 0) != 123)
+ return 1;
+ if (Marshal.ReadInt32 (p, 4) != 124)
+ return 1;
+
+ BlittableStruct cp = (BlittableStruct)Marshal.PtrToStructure (p, ss.GetType ());
+
+ if (cp.a != 123)
+ return 2;
+
+ if (cp.b != 124)
+ return 2;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/marshal5.cs b/mono/tests/marshal5.cs
new file mode 100644
index 00000000000..63512171dae
--- /dev/null
+++ b/mono/tests/marshal5.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Runtime.InteropServices;
+
+public class Test
+{
+ [DllImport ("libtest", EntryPoint="mono_test_byvalstr_gen")]
+ public static extern IntPtr mono_test_byvalstr_gen();
+
+ [DllImport ("libtest", EntryPoint="mono_test_byvalstr_check")]
+ public static extern int mono_test_byvalstr_check(IntPtr data, string correctString);
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct ByValStrStruct
+ {
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst=100)]
+ public string a;
+ }
+
+ public unsafe static int Main ()
+ {
+ string testString = "A small string";
+
+ IntPtr udata = mono_test_byvalstr_gen();
+
+ ByValStrStruct data = new ByValStrStruct();
+ data.a = testString;
+
+ Marshal.StructureToPtr(data, udata, false);
+
+ return mono_test_byvalstr_check(udata, testString);
+ }
+}
+
diff --git a/mono/tests/marshal6.cs b/mono/tests/marshal6.cs
new file mode 100644
index 00000000000..fde486cd4af
--- /dev/null
+++ b/mono/tests/marshal6.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Runtime.InteropServices;
+
+
+[StructLayout(LayoutKind.Explicit, Size=32)]
+public class Dummy {
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst=16)]
+ [FieldOffset(0)]
+ public string a;
+}
+
+public class X {
+ public static int Main () {
+ Dummy dummy = new Dummy ();
+ dummy.a = "abcd";
+
+ IntPtr p = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Dummy)));
+ Marshal.StructureToPtr(dummy, p, false);
+
+ if(Marshal.ReadByte(p, 0) != 0x61) {
+ return 1;
+ }
+ if(Marshal.ReadByte(p, 1) != 0x62) {
+ return 1;
+ }
+ if(Marshal.ReadByte(p, 2) != 0x63) {
+ return 1;
+ }
+ if(Marshal.ReadByte(p, 3) != 0x64) {
+ return 1;
+ }
+ return 0;
+ }
+}
diff --git a/mono/tests/marshal7.cs b/mono/tests/marshal7.cs
new file mode 100644
index 00000000000..db8e8c8b796
--- /dev/null
+++ b/mono/tests/marshal7.cs
@@ -0,0 +1,105 @@
+using System;
+using System.Runtime.InteropServices;
+
+public class Test
+{
+ [StructLayout(LayoutKind.Sequential, Size=32)]
+ public class TestStruct1
+ {
+ public int a;
+ }
+
+ [StructLayout(LayoutKind.Sequential, Size=32)]
+ public class TestStruct2
+ {
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst=16)]
+ public string a;
+ public int b;
+ }
+
+ [StructLayout(LayoutKind.Sequential, Size=32)]
+ public class TestStruct3 : TestStruct2
+ {
+ public int c;
+ }
+
+ public unsafe static int Main ()
+ {
+ ///
+ /// Testing simple struct size
+ ///
+ if(Marshal.SizeOf(typeof(TestStruct1)) != 32)
+ {
+ return 1;
+ }
+
+ TestStruct1 myStruct = new TestStruct1();
+ myStruct.a = 0x12345678;
+
+ IntPtr p = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(TestStruct1)));
+ Marshal.StructureToPtr(myStruct, p, false);
+
+ Type testType = typeof(TestStruct1);
+ if (Marshal.ReadInt32(p, (int)Marshal.OffsetOf(testType, "a")) != myStruct.a)
+ return 2;
+
+ Marshal.FreeHGlobal(p);
+
+ ///
+ /// Testing struct size with ByValTStr string
+ ///
+ if(Marshal.SizeOf(typeof(TestStruct2)) != 32)
+ return 3;
+
+ TestStruct2 myStruct2 = new TestStruct2();
+ myStruct2.b = 0x12345678;
+
+ p = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(TestStruct2)));
+ Marshal.StructureToPtr(myStruct2, p, false);
+
+ Type testType2 = typeof(TestStruct2);
+ if (Marshal.ReadInt32(p, (int)Marshal.OffsetOf(testType2, "b")) != myStruct2.b)
+ return 4;
+
+ Marshal.FreeHGlobal(p);
+
+ ///
+ /// Test structure size and struct with inheritance
+ ///
+ if(Marshal.SizeOf(typeof(TestStruct3)) != 64)
+ return 5;
+
+ TestStruct3 myStruct3 = new TestStruct3();
+ myStruct3.b = 0x12345678;
+ myStruct3.c = 0x76543210;
+ p = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(TestStruct3)));
+ Marshal.StructureToPtr(myStruct3, p, false);
+
+ Type testType3 = typeof(TestStruct3);
+
+ if(Marshal.ReadInt32(p, (int)Marshal.OffsetOf(testType3, "b")) != myStruct3.b)
+ return 6;
+
+ if (Marshal.ReadInt32(p, (int)Marshal.OffsetOf(testType3, "c")) != myStruct3.c)
+ return 7;
+
+ Marshal.FreeHGlobal(p);
+
+ ///
+ /// Also make sure OffsetOf returns the correct Exception.
+ ///
+ try {
+ Marshal.OffsetOf(testType3, "blah");
+ return 8;
+ }
+ catch(ArgumentException e) {
+ /// Way to go :)
+ }
+ catch(Exception e) {
+ return 9;
+ }
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/marshal8.cs b/mono/tests/marshal8.cs
new file mode 100644
index 00000000000..00908acfba9
--- /dev/null
+++ b/mono/tests/marshal8.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Runtime.InteropServices;
+
+
+[StructLayout(LayoutKind.Sequential, Size=1024)]
+public class Dummy {
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=16)]
+ public byte[] a;
+
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=16)]
+ public float[] b;
+
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=16)]
+ public long[] c;
+}
+
+public class X {
+ public static unsafe int Main () {
+
+ ///
+ /// Structure to pointer
+ ///
+
+ Dummy dummy = new Dummy ();
+ dummy.a = new byte[16];
+ dummy.b = new float[16];
+ dummy.c = new long[16];
+
+ for(int i=0; i<16; i++)
+ dummy.a[i] = (byte)(dummy.b[i] = dummy.c[i] = i+1);
+
+ IntPtr p = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Dummy)));
+ Marshal.StructureToPtr(dummy, p, false);
+
+ int offset = (int)Marshal.OffsetOf(typeof(Dummy), "a");
+ byte *data1 = (byte*)p.ToPointer() + offset;
+ for(int i=0; i<16; i++) {
+ if(data1[i] != i+1)
+ return 1;
+ }
+
+ offset = (int)Marshal.OffsetOf(typeof(Dummy), "b");
+ float *data2 = (float*)((byte*)p.ToPointer() + offset);
+ for(int i=0; i<16; i++)
+ if(data2[i] != i+1)
+ return 2;
+
+ offset = (int)Marshal.OffsetOf(typeof(Dummy), "c");
+ long *data3 = (long*)((byte*)p.ToPointer() + offset);
+ for(int i=0; i<16; i++)
+ if(data3[i] != i+1)
+ return 3;
+
+ ///
+ /// Pointer to structure
+ ///
+ Dummy dummy2 = new Dummy ();
+ Marshal.PtrToStructure(p, dummy2);
+
+ if(dummy2.a.Length != dummy.a.Length) return 4;
+ if(dummy2.b.Length != dummy.b.Length) return 5;
+ if(dummy2.c.Length != dummy.c.Length) return 6;
+
+ for(int i=0; i<16; i++)
+ {
+ if(dummy2.a[i] != i+1) return 7;
+ if(dummy2.b[i] != i+1) return 8;
+ if(dummy2.c[i] != i+1) return 9;
+ }
+
+ Marshal.FreeHGlobal(p);
+
+ return 0;
+ }
+}
diff --git a/mono/tests/marshal9.cs b/mono/tests/marshal9.cs
new file mode 100644
index 00000000000..40d7e95929e
--- /dev/null
+++ b/mono/tests/marshal9.cs
@@ -0,0 +1,122 @@
+//
+// marshal9.cs: tests for custom marshalling
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+public class Marshal1 : ICustomMarshaler
+{
+ int param;
+
+ public static int cleanup_managed_count = 0;
+
+ public static int cleanup_native_count = 0;
+
+ public Marshal1 (int param) {
+ this.param = param;
+ }
+
+ public static ICustomMarshaler GetInstance (string s) {
+ int param = Int32.Parse (s);
+ return new Marshal1 (param);
+ }
+
+ public void CleanUpManagedData (object managedObj)
+ {
+ //Console.WriteLine ("CleanUpManagedData called");
+ cleanup_managed_count ++;
+ }
+
+ public void CleanUpNativeData (IntPtr pNativeData)
+ {
+ //Console.WriteLine("CleanUpNativeData:" + pNativeData);
+ /* Might be allocated in libtest.c using g_new0 so dont free it */
+ int alloc_type = Marshal.ReadInt32 (pNativeData);
+ if (alloc_type == 1)
+ Marshal.FreeHGlobal (pNativeData);
+ cleanup_native_count ++;
+ }
+
+ // I really do not understand the purpose of this method
+ // or went it would be called. In fact, Rotor never seems
+ // to call it.
+ public int GetNativeDataSize ()
+ {
+ //Console.WriteLine("GetNativeDataSize() called");
+ return 4;
+ }
+
+ public IntPtr MarshalManagedToNative (object managedObj)
+ {
+ int number;
+ IntPtr ptr;
+
+ number = Convert.ToInt32 (managedObj);
+ ptr = Marshal.AllocHGlobal (8);
+ Marshal.WriteInt32 (ptr, 1); /* Allocated by AllocHGlobal */
+ Marshal.WriteInt32(new IntPtr (ptr.ToInt64 () + 4), number);
+
+ //Console.WriteLine ("ToNative: " + ptr);
+ return ptr;
+ }
+
+ public object MarshalNativeToManaged (IntPtr pNativeData)
+ {
+ //Console.WriteLine ("ToManaged: " + pNativeData);
+ return param + Marshal.ReadInt32 (new IntPtr (pNativeData.ToInt64 () + 4));
+ }
+}
+
+public class Tests
+{
+ public static int Main (string[] args) {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ [DllImport ("libtest")]
+ [return : MarshalAs(UnmanagedType.CustomMarshaler,MarshalTypeRef = typeof
+ (Marshal1), MarshalCookie = "5")]
+ private static extern object mono_test_marshal_pass_return_custom (int i,
+ [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Marshal1), MarshalCookie = "5")] object number, int j);
+
+ public static int test_0_pass_return () {
+
+ Marshal1.cleanup_managed_count = 0;
+ Marshal1.cleanup_native_count = 0;
+
+ int res = (int)mono_test_marshal_pass_return_custom (5, 10, 5);
+
+ if (Marshal1.cleanup_managed_count != 0)
+ return 1;
+ if (Marshal1.cleanup_native_count != 2)
+ return 2;
+
+ return res == 15 ? 0 : 3;
+ }
+
+ [return : MarshalAs(UnmanagedType.CustomMarshaler,MarshalTypeRef = typeof
+(Marshal1), MarshalCookie = "5")] public delegate object pass_return_int_delegate ([MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Marshal1), MarshalCookie = "5")] object o);
+
+ [DllImport ("libtest")]
+ private static extern int mono_test_marshal_pass_return_custom_in_delegate (pass_return_int_delegate del);
+
+ private static object pass_return_int (object i) {
+ return (int)i;
+ }
+
+ public static int test_0_pass_return_delegate () {
+
+ Marshal1.cleanup_managed_count = 0;
+ Marshal1.cleanup_native_count = 0;
+
+ int res = mono_test_marshal_pass_return_custom_in_delegate (new pass_return_int_delegate (pass_return_int));
+
+ if (Marshal1.cleanup_managed_count != 2)
+ return 1;
+ if (Marshal1.cleanup_native_count != 0)
+ return 2;
+
+ return res == 15 ? 0 : 3;
+ }
+}
diff --git a/mono/tests/pinvoke.cs b/mono/tests/pinvoke.cs
index 81e4c13ea14..9421377621d 100755
--- a/mono/tests/pinvoke.cs
+++ b/mono/tests/pinvoke.cs
@@ -6,29 +6,49 @@ public class Test {
[DllImport("cygwin1.dll", EntryPoint="puts", CharSet=CharSet.Ansi)]
public static extern int puts (string name);
- [DllImport ("libtest.so", EntryPoint="mono_test_many_int_arguments")]
+ [DllImport ("libtest", EntryPoint="mono_test_many_int_arguments")]
public static extern int mono_test_many_int_arguments (int a, int b, int c, int d, int e,
int f, int g, int h, int i, int j);
- [DllImport ("libtest.so", EntryPoint="mono_test_many_short_arguments")]
+ [DllImport ("libtest", EntryPoint="mono_test_many_short_arguments")]
public static extern int mono_test_many_short_arguments (short a, short b, short c, short d, short e,
short f, short g, short h, short i, short j);
- [DllImport ("libtest.so", EntryPoint="mono_test_many_byte_arguments")]
+ [DllImport ("libtest", EntryPoint="mono_test_many_byte_arguments")]
public static extern int mono_test_many_byte_arguments (byte a, byte b, byte c, byte d, byte e,
byte f, byte g, byte h, byte i, byte j);
+ [DllImport ("libtest", EntryPoint="mono_test_many_float_arguments")]
+ public static extern float mono_test_many_float_arguments (float a, float b, float c, float d, float e,
+ float f, float g, float h, float i, float j);
+ [DllImport ("libtest", EntryPoint="mono_test_many_double_arguments")]
+ public static extern double mono_test_many_double_arguments (double a, double b, double c, double d, double e,
+ double f, double g, double h, double i, double j);
+ [DllImport ("libtest", EntryPoint="mono_test_split_double_arguments")]
+ public static extern double mono_test_split_double_arguments (double a, double b, float c, double d, double e);
public static int Main () {
- puts ("A simple Test for PInvoke");
-
+ try {
+ puts ("A simple Test for PInvoke");
+ }
+ catch (DllNotFoundException) {
+ }
+
if (Math.Cos (Math.PI) != -1)
return 1;
if (Math.Acos (1) != 0)
- return 1;
+ return 2;
if (mono_test_many_int_arguments (1, 1, 1, 1, 1, 1, 1, 1, 1, 1) != 10)
- return 1;
+ return 3;
if (mono_test_many_short_arguments (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) != 55)
- return 1;
+ return 4;
if (mono_test_many_byte_arguments (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) != 55)
- return 1;
+ return 5;
+ if (mono_test_many_float_arguments (1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f) != 55.0f)
+ return 6;
+ if (mono_test_many_double_arguments (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0) != 55.0)
+ return 7;
+
+ /* Test Sparc V8 split register/stack double parameter passing */
+ if (mono_test_split_double_arguments (1.0, 2.0, 3.0f, 4.0, 5.0) != 15.0)
+ return 8;
return 0;
}
diff --git a/mono/tests/pinvoke1.cs b/mono/tests/pinvoke1.cs
index 8e95d35461b..ab6c590661c 100755
--- a/mono/tests/pinvoke1.cs
+++ b/mono/tests/pinvoke1.cs
@@ -18,7 +18,7 @@ public class Test : T {
delegate int MyDelegate (string name);
- [DllImport ("libtest.so", EntryPoint="mono_test_puts_static")]
+ [DllImport ("libtest", EntryPoint="mono_test_puts_static")]
public static extern int puts_static (string name);
public static int Main () {
diff --git a/mono/tests/pinvoke10.cs b/mono/tests/pinvoke10.cs
new file mode 100755
index 00000000000..03d31866df2
--- /dev/null
+++ b/mono/tests/pinvoke10.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Runtime.InteropServices;
+
+public class Test {
+
+ [DllImport("libtest")]
+ [return: MarshalAs(UnmanagedType.LPWStr)]
+ private static extern string test_lpwstr_marshal(
+ [MarshalAs(UnmanagedType.LPWStr)] string s,
+ int length );
+
+
+ public static int Main () {
+
+ string s = "ABC";
+
+ Console.WriteLine(s.Length);
+ string res = test_lpwstr_marshal (s, s.Length);
+
+ Console.WriteLine (res);
+
+ if (res != "ABC")
+ return 1;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/pinvoke11.cs b/mono/tests/pinvoke11.cs
new file mode 100644
index 00000000000..bff30b58bd7
--- /dev/null
+++ b/mono/tests/pinvoke11.cs
@@ -0,0 +1,147 @@
+using System;
+using System.Runtime.InteropServices;
+
+[StructLayout(LayoutKind.Sequential)]
+public struct ss
+{
+ public int i1;
+}
+
+[StructLayout(LayoutKind.Explicit)]
+public struct su
+{
+ [FieldOffset(0)] public int i1;
+ [FieldOffset(0)] public int i2;
+}
+
+[StructLayout(LayoutKind.Sequential)]
+public struct cs
+{
+ public bool b1;
+ public int i1;
+ public su u1;
+}
+
+/* various small structs for testing struct-by-value where they are handled specially
+ on some platforms.
+*/
+[StructLayout(LayoutKind.Sequential)]
+public struct sc1
+{
+ public byte c0;
+}
+
+[StructLayout(LayoutKind.Sequential)]
+public struct sc3
+{
+ public byte c0;
+ public byte c1;
+ public byte c2;
+}
+
+[StructLayout(LayoutKind.Sequential)]
+public struct sc5
+{
+ public byte c0;
+ public byte c1;
+ public byte c2;
+ public byte c3;
+ public byte c4;
+}
+
+public class Test
+{
+ [DllImport ("libtest")]
+ public static extern int mono_union_test_1 (cs a);
+
+ [DllImport ("libtest")]
+ public static extern int mono_return_int (int a);
+
+ [DllImport ("libtest", EntryPoint="mono_return_int_ss")]
+ public static extern int mono_return_int_ss (ss a);
+
+ [DllImport ("libtest", EntryPoint="mono_return_ss")]
+ public static extern ss mono_return_ss (ss a);
+
+ [DllImport ("libtest", EntryPoint="mono_return_sc1")]
+ public static extern sc1 mono_return_sc1 (sc1 a);
+
+ [DllImport ("libtest", EntryPoint="mono_return_sc3")]
+ public static extern sc3 mono_return_sc3 (sc3 a);
+
+ [DllImport ("libtest", EntryPoint="mono_return_sc5")]
+ public static extern sc5 mono_return_sc5 (sc5 a);
+
+ [DllImport ("libtest", EntryPoint="mono_return_int_su")]
+ public static extern int mono_return_int_su (su a);
+
+ static int Main()
+ {
+ if (mono_return_int (5) != 5)
+ return 1;
+
+ ss s1;
+ s1.i1 = 4;
+ if (mono_return_int_ss (s1) != 4)
+ return 2;
+
+ s1 = mono_return_ss (s1);
+ if (s1.i1 != 5)
+ return 3;
+
+ su s2;
+ s2.i1 = 2;
+ s2.i2 = 3;
+ if (mono_return_int_su (s2) != 3)
+ return 4;
+
+ s2.i1 = 2;
+ if (mono_return_int_su (s2) != 2)
+ return 5;
+
+
+ cs s3;
+ s3.b1 = false;
+ s3.i1 = 12;
+ s3.u1.i1 = 2;
+ s3.u1.i2 = 1;
+
+ if (mono_union_test_1 (s3) != 13)
+ return 6;
+
+ s3.u1.i1 = 2;
+ if (mono_union_test_1 (s3) != 14)
+ return 7;
+
+ s3.b1 = true;
+ if (mono_union_test_1 (s3) != 15)
+ return 8;
+
+ sc1 s4;
+ s4.c0 = 3;
+ s4 = mono_return_sc1(s4);
+ if (s4.c0 != 4)
+ return 9;
+
+ sc3 s5;
+ s5.c0 = 4;
+ s5.c1 = 5;
+ s5.c2 = 6;
+ s5 = mono_return_sc3(s5);
+ if (s5.c0 != 5 || s5.c1 != 7 || s5.c2 != 9)
+ return 10;
+
+ sc5 s6;
+ s6.c0 = 4;
+ s6.c1 = 5;
+ s6.c2 = 6;
+ s6.c3 = 7;
+ s6.c4 = 8;
+ s6 = mono_return_sc5(s6);
+ if (s6.c0 != 5 || s6.c1 != 7 || s6.c2 != 9 || s6.c3 != 11 || s6.c4 != 13)
+ return 11;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/pinvoke13.cs b/mono/tests/pinvoke13.cs
new file mode 100644
index 00000000000..6a2a9cf38bf
--- /dev/null
+++ b/mono/tests/pinvoke13.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Runtime.InteropServices;
+
+public class DumpTest
+{
+ /* this should call HexDumpA with ANSI encoded string */
+ [DllImport("libtest", CharSet=CharSet.Ansi)]
+ private static extern int HexDump (string data);
+
+ /* this should call HexDump default version with Unicode string */
+ [DllImport("libtest", EntryPoint="HexDump", CharSet=CharSet.Unicode)]
+ private static extern int HexDump2(string data);
+
+ /* this should call HexDump1W with unicode encoding */
+ [DllImport("libtest", CharSet=CharSet.Unicode)]
+ private static extern int HexDump1(string data);
+
+ public static int Main()
+ {
+ int res;
+
+ res = HexDump ("First test");
+ Console.WriteLine (res);
+ if (res != 100769)
+ return 1;
+
+ res = HexDump2 ("First test");
+ Console.WriteLine (res);
+ if (res != 404)
+ return 2;
+
+ res = HexDump1 ("First test");
+ Console.WriteLine (res);
+ if (res != 1000404)
+ return 3;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/pinvoke14.cs b/mono/tests/pinvoke14.cs
new file mode 100644
index 00000000000..877b2f068ee
--- /dev/null
+++ b/mono/tests/pinvoke14.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Runtime.InteropServices;
+
+[StructLayout (LayoutKind.Sequential)]
+class SimpleObj
+{
+ public string str;
+ public int i;
+}
+
+class Test {
+
+ [DllImport ("libtest")]
+ static extern int class_marshal_test0 (SimpleObj obj);
+
+ [DllImport ("libtest")]
+ static extern void class_marshal_test1 (out SimpleObj obj);
+
+ [DllImport ("libtest")]
+ static extern int class_marshal_test2 (ref SimpleObj obj);
+
+ [DllImport ("libtest")]
+ static extern int class_marshal_test4 (SimpleObj obj);
+
+ static int Main ()
+ {
+ SimpleObj obj0 = new SimpleObj ();
+ obj0.str = "T1";
+ obj0.i = 4;
+
+ if (class_marshal_test0 (obj0) != 0)
+ return 1;
+
+ if (class_marshal_test4 (null) != 0)
+ return 2;
+
+ SimpleObj obj1;
+
+ class_marshal_test1 (out obj1);
+
+ if (obj1.str != "ABC")
+ return 3;
+
+ if (obj1.i != 5)
+ return 4;
+
+ if (class_marshal_test2 (ref obj1) != 0)
+ return 5;
+
+ return 0;
+ }
+}
diff --git a/mono/tests/pinvoke15.cs b/mono/tests/pinvoke15.cs
new file mode 100644
index 00000000000..b7af39c20b3
--- /dev/null
+++ b/mono/tests/pinvoke15.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Runtime.InteropServices;
+
+class Test {
+
+ [DllImport ("libtest")]
+ static extern int string_marshal_test0 (string str);
+
+ [DllImport ("libtest")]
+ static extern void string_marshal_test1 (out string str);
+
+ [DllImport ("libtest")]
+ static extern int string_marshal_test2 (ref string str);
+
+ [DllImport ("libtest")]
+ static extern int string_marshal_test3 (string str);
+
+ static int Main ()
+ {
+ if (string_marshal_test0 ("TEST0") != 0)
+ return 1;
+
+ string res;
+
+ string_marshal_test1 (out res);
+
+ if (res != "TEST1")
+ return 2;
+
+ if (string_marshal_test2 (ref res) != 0)
+ return 3;
+
+ if (string_marshal_test3 (null) != 0)
+ return 4;
+
+
+ return 0;
+ }
+}
diff --git a/mono/tests/pinvoke17.cs b/mono/tests/pinvoke17.cs
new file mode 100644
index 00000000000..4df6d561e78
--- /dev/null
+++ b/mono/tests/pinvoke17.cs
@@ -0,0 +1,96 @@
+using System;
+using System.Runtime.InteropServices;
+
+[StructLayout (LayoutKind.Sequential)]
+public class OSVersionInfo
+{
+ public int a;
+ public int b;
+}
+
+[StructLayout (LayoutKind.Sequential)]
+public struct OSVersionInfo2
+{
+ public int a;
+ public int b;
+}
+
+
+public class LibWrap
+{
+ [DllImport ("libtest")]
+ public static extern int GetVersionEx ([In, Out] OSVersionInfo osvi);
+
+ [DllImport ("libtest")]
+ public static extern int BugGetVersionEx (int a, int b, int c, int d, int e, int f, int g, int h, [In, Out] OSVersionInfo osvi);
+
+ [DllImport ("libtest", EntryPoint="GetVersionEx" )]
+ public static extern int GetVersionEx2 (ref OSVersionInfo2 osvi);
+}
+
+public class Test
+{
+ public static int Main()
+ {
+ Console.WriteLine( "\nPassing OSVersionInfo as class" );
+
+ OSVersionInfo osvi = new OSVersionInfo();
+ osvi.a = 1;
+ osvi.b = 2;
+
+ if (LibWrap.GetVersionEx (osvi) != 5)
+ return 1;
+
+ if (osvi.a != 2)
+ return 2;
+
+ if (osvi.b != 3)
+ return 3;
+
+ Console.WriteLine( "A: {0}", osvi.a);
+ Console.WriteLine( "B: {0}", osvi.b);
+
+ Console.WriteLine( "\nPassing OSVersionInfo as struct" );
+
+ OSVersionInfo2 osvi2 = new OSVersionInfo2();
+ osvi2.a = 1;
+ osvi2.b = 2;
+
+ if (LibWrap.GetVersionEx2 (ref osvi2) != 5)
+ return 4;
+
+ if (osvi2.a != 2)
+ return 5;
+
+ if (osvi2.b != 3)
+ return 6;
+
+ Console.WriteLine( "A: {0}", osvi2.a);
+ Console.WriteLine( "B: {0}", osvi2.b);
+
+ Console.WriteLine ("Testing with extra parameters at the beginning");
+
+ OSVersionInfo osvi3 = new OSVersionInfo();
+ osvi3.a = 1;
+ osvi3.b = 2;
+
+ if (LibWrap.BugGetVersionEx (10, 10, 10, 10, 20, 20, 20, 20, osvi3) != 5)
+ return 7;
+
+ if (osvi3.a != 2)
+ return 8;
+
+ if (osvi3.b != 3)
+ return 9;
+
+ Console.WriteLine( "A: {0}", osvi.a);
+ Console.WriteLine( "B: {0}", osvi.b);
+
+ Console.WriteLine( "\nPassing OSVersionInfo as struct" );
+
+ return 0;
+ }
+}
+
+
+
diff --git a/mono/tests/pinvoke18.cs b/mono/tests/pinvoke18.cs
new file mode 100644
index 00000000000..8e178e176b9
--- /dev/null
+++ b/mono/tests/pinvoke18.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Runtime.InteropServices;
+
+class Test
+{
+ [DllImport("libtest")]
+ extern static int marshal_test_ref_bool
+ (
+ int i,
+ [MarshalAs(UnmanagedType.I1)] ref bool b1,
+ [MarshalAs(UnmanagedType.VariantBool)] ref bool b2,
+ ref bool b3
+ );
+
+ struct BoolStruct
+ {
+ public int i;
+ [MarshalAs(UnmanagedType.I1)] public bool b1;
+ [MarshalAs(UnmanagedType.VariantBool)] public bool b2;
+ public bool b3;
+ }
+
+ [DllImport("libtest")]
+ extern static int marshal_test_bool_struct(ref BoolStruct s);
+
+ public static int Main()
+ {
+ for (int i = 0; i < 8; i++)
+ {
+ bool b1 = (i & 4) != 0;
+ bool b2 = (i & 2) != 0;
+ bool b3 = (i & 1) != 0;
+ bool orig_b1 = b1, orig_b2 = b2, orig_b3 = b3;
+ if (marshal_test_ref_bool(i, ref b1, ref b2, ref b3) != 0)
+ return 4 * i + 1;
+ if (b1 != !orig_b1)
+ return 4 * i + 2;
+ if (b2 != !orig_b2)
+ return 4 * i + 3;
+ if (b3 != !orig_b3)
+ return 4 * i + 4;
+ }
+
+ for (int i = 0; i < 8; i++)
+ {
+ BoolStruct s = new BoolStruct();
+ s.i = i;
+ s.b1 = (i & 4) != 0;
+ s.b2 = (i & 2) != 0;
+ s.b3 = (i & 1) != 0;
+ BoolStruct orig = s;
+ if (marshal_test_bool_struct(ref s) != 0)
+ return 4 * i + 33;
+ if (s.b1 != !orig.b1)
+ return 4 * i + 34;
+ if (s.b2 != !orig.b2)
+ return 4 * i + 35;
+ if (s.b3 != !orig.b3)
+ return 4 * i + 36;
+ }
+
+ Console.WriteLine("Success");
+ return 0;
+ }
+}
diff --git a/mono/tests/pinvoke2.cs b/mono/tests/pinvoke2.cs
new file mode 100755
index 00000000000..b6ccb5fe705
--- /dev/null
+++ b/mono/tests/pinvoke2.cs
@@ -0,0 +1,767 @@
+using System;
+using System.Text;
+using System.Runtime.InteropServices;
+
+public class Tests {
+
+ public static int delegate_test (int a)
+ {
+ if (a == 2)
+ return 0;
+
+ return 1;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct SimpleStruct {
+ public bool a;
+ public bool b;
+ public bool c;
+ public string d;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct SimpleStruct2 {
+ public bool a;
+ public bool b;
+ public bool c;
+ public string d;
+ public byte e;
+ public double f;
+ public byte g;
+ public long h;
+ }
+
+ [StructLayout (LayoutKind.Sequential, Size=0)]
+ public struct EmptyStruct {
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct DelegateStruct {
+ public int a;
+ public SimpleDelegate del;
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ public SimpleDelegate del2;
+ }
+
+ /* sparcv9 has complex conventions when passing structs with doubles in them
+ by value, some simple tests for them */
+ [StructLayout (LayoutKind.Sequential)]
+ public struct Point {
+ public double x;
+ public double y;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct MixedPoint {
+ public int x;
+ public double y;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public class SimpleClass {
+ public bool a;
+ public bool b;
+ public bool c;
+ public string d;
+ public byte e;
+ public double f;
+ public byte g;
+ public long h;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public class EmptyClass {
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct LongAlignStruct {
+ public int a;
+ public long b;
+ public long c;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public class VectorList
+ {
+ public int a = 1;
+ public int b = 2;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ class SimpleObj
+ {
+ public string str;
+ public int i;
+ }
+
+ [DllImport ("libnot-found", EntryPoint="not_found")]
+ public static extern int mono_library_not_found ();
+
+ [DllImport ("libtest", EntryPoint="not_found")]
+ public static extern int mono_entry_point_not_found ();
+
+ [DllImport ("libtest.dll", EntryPoint="mono_test_marshal_char")]
+ public static extern int mono_test_marshal_char_2 (char a1);
+
+ [DllImport ("test", EntryPoint="mono_test_marshal_char")]
+ public static extern int mono_test_marshal_char_3 (char a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_char")]
+ public static extern int mono_test_marshal_char (char a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_char_array")]
+ public static extern int mono_test_marshal_char_array (char[] a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_bool_byref")]
+ public static extern int mono_test_marshal_bool_byref (int a, ref bool b, int c);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_array")]
+ public static extern int mono_test_marshal_array (int [] a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_empty_string_array")]
+ public static extern int mono_test_marshal_empty_string_array (string [] a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_string_array")]
+ public static extern int mono_test_marshal_string_array (string [] a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_unicode_string_array", CharSet=CharSet.Unicode)]
+ public static extern int mono_test_marshal_unicode_string_array (string [] a1, [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)]string [] a2);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_stringbuilder_array")]
+ public static extern int mono_test_marshal_stringbuilder_array (StringBuilder [] a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_inout_array")]
+ public static extern int mono_test_marshal_inout_array ([In, Out] int [] a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_inout_nonblittable_array", CharSet = CharSet.Unicode)]
+ public static extern int mono_test_marshal_inout_nonblittable_array ([In, Out] char [] a1);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_struct")]
+ public static extern int mono_test_marshal_struct (SimpleStruct ss);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_struct2")]
+ public static extern int mono_test_marshal_struct2 (SimpleStruct2 ss);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_struct2_2")]
+ public static extern int mono_test_marshal_struct2_2 (int i, int j, int k, SimpleStruct2 ss);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_point")]
+ public static extern int mono_test_marshal_point (Point p);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_mixed_point")]
+ public static extern int mono_test_marshal_mixed_point (MixedPoint p);
+
+ [DllImport ("libtest", EntryPoint="mono_test_empty_struct")]
+ public static extern int mono_test_empty_struct (int a, EmptyStruct es, int b);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_struct_array")]
+ public static extern int mono_test_marshal_struct_array (SimpleStruct2[] ss);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_long_align_struct_array")]
+ public static extern int mono_test_marshal_long_align_struct_array (LongAlignStruct[] ss);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_class")]
+ public static extern SimpleClass mono_test_marshal_class (int i, int j, int k, SimpleClass ss, int l);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_byref_class")]
+ public static extern int mono_test_marshal_byref_class (ref SimpleClass ss);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate")]
+ public static extern int mono_test_marshal_delegate (SimpleDelegate d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate_struct")]
+ public static extern int mono_test_marshal_delegate_struct (DelegateStruct d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate")]
+ public static extern SimpleDelegate mono_test_marshal_return_delegate (SimpleDelegate d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_return_vtype")]
+ public static extern SimpleStruct mono_test_return_vtype (IntPtr i);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_stringbuilder")]
+ public static extern void mono_test_marshal_stringbuilder (StringBuilder sb, int len);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_stringbuilder_unicode", CharSet=CharSet.Unicode)]
+ public static extern void mono_test_marshal_stringbuilder_unicode (StringBuilder sb, int len);
+
+ [DllImport ("libtest", EntryPoint="mono_test_last_error", SetLastError=true)]
+ public static extern void mono_test_last_error (int err);
+
+ [DllImport ("libtest", EntryPoint="mono_test_asany")]
+ public static extern int mono_test_asany ([MarshalAs (UnmanagedType.AsAny)] object o, int what);
+
+ [DllImport ("libtest", EntryPoint="mono_test_asany", CharSet=CharSet.Unicode)]
+ public static extern int mono_test_asany_unicode ([MarshalAs (UnmanagedType.AsAny)] object o, int what);
+
+ [DllImport ("libtest")]
+ static extern int class_marshal_test0 (SimpleObj obj);
+
+ [DllImport ("libtest")]
+ static extern void class_marshal_test1 (out SimpleObj obj);
+
+ [DllImport ("libtest")]
+ static extern int class_marshal_test2 (ref SimpleObj obj);
+
+ [DllImport ("libtest")]
+ static extern int class_marshal_test4 (SimpleObj obj);
+
+ public delegate int SimpleDelegate (int a);
+
+ public static int Main (string[] args) {
+ return TestDriver.RunTests (typeof (Tests), args);
+ }
+
+ static int test_0_marshal_char () {
+ return mono_test_marshal_char ('a');
+ }
+
+ static int test_0_marshal_char_array () {
+ // char[] is implicitly marshalled as [Out]
+ char[] buf = new char [32];
+ mono_test_marshal_char_array (buf);
+ string s = new string (buf);
+ if (s.StartsWith ("abcdef"))
+ return 0;
+ else
+ return 1;
+ }
+
+ static int test_1225_marshal_array () {
+ int [] a1 = new int [50];
+ for (int i = 0; i < 50; i++)
+ a1 [i] = i;
+
+ return mono_test_marshal_array (a1);
+ }
+
+ static int test_1225_marshal_inout_array () {
+ int [] a1 = new int [50];
+ for (int i = 0; i < 50; i++)
+ a1 [i] = i;
+
+ int res = mono_test_marshal_inout_array (a1);
+
+ for (int i = 0; i < 50; i++)
+ if (a1 [i] != 50 - i) {
+ Console.WriteLine ("X: " + i + " " + a1 [i]);
+ return 2;
+ }
+
+ return res;
+ }
+
+ static int test_0_marshal_inout_nonblittable_array () {
+ char [] a1 = new char [10];
+ for (int i = 0; i < 10; i++)
+ a1 [i] = "Hello, World" [i];
+
+ int res = mono_test_marshal_inout_nonblittable_array (a1);
+
+ for (int i = 0; i < 10; i++)
+ if (a1 [i] != 'F')
+ return 2;
+
+ return res;
+ }
+
+ static int test_0_marshal_struct () {
+ SimpleStruct ss = new SimpleStruct ();
+ ss.b = true;
+ ss.d = "TEST";
+
+ return mono_test_marshal_struct (ss);
+ }
+
+ static int test_0_marshal_struct2 () {
+ SimpleStruct2 ss2 = new SimpleStruct2 ();
+ ss2.b = true;
+ ss2.d = "TEST";
+ ss2.e = 99;
+ ss2.f = 1.5;
+ ss2.g = 42;
+ ss2.h = 123L;
+
+ return mono_test_marshal_struct2 (ss2);
+ }
+
+ static int test_0_marshal_struct3 () {
+ SimpleStruct2 ss2 = new SimpleStruct2 ();
+ ss2.b = true;
+ ss2.d = "TEST";
+ ss2.e = 99;
+ ss2.f = 1.5;
+ ss2.g = 42;
+ ss2.h = 123L;
+
+ return mono_test_marshal_struct2_2 (10, 11, 12, ss2);
+ }
+
+ static int test_0_marshal_empty_struct () {
+ EmptyStruct es = new EmptyStruct ();
+
+ if (mono_test_empty_struct (1, es, 2) != 0)
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_marshal_struct_array () {
+ SimpleStruct2[] ss_arr = new SimpleStruct2 [2];
+
+ SimpleStruct2 ss2 = new SimpleStruct2 ();
+ ss2.b = true;
+ ss2.d = "TEST";
+ ss2.e = 99;
+ ss2.f = 1.5;
+ ss2.g = 42;
+ ss2.h = 123L;
+
+ ss_arr [0] = ss2;
+
+ ss2.b = false;
+ ss2.d = "TEST2";
+ ss2.e = 100;
+ ss2.f = 2.5;
+ ss2.g = 43;
+ ss2.h = 124L;
+
+ ss_arr [1] = ss2;
+
+ return mono_test_marshal_struct_array (ss_arr);
+ }
+
+ static int test_105_marshal_long_align_struct_array () {
+ LongAlignStruct[] ss_arr = new LongAlignStruct [2];
+
+ LongAlignStruct ss = new LongAlignStruct ();
+ ss.a = 5;
+ ss.b = 10;
+ ss.c = 15;
+
+ ss_arr [0] = ss;
+
+ ss.a = 20;
+ ss.b = 25;
+ ss.c = 30;
+
+ ss_arr [1] = ss;
+
+ return mono_test_marshal_long_align_struct_array (ss_arr);
+ }
+
+ /* Test classes as arguments and return values */
+ static int test_0_marshal_class () {
+ SimpleClass ss = new SimpleClass ();
+ ss.b = true;
+ ss.d = "TEST";
+ ss.e = 99;
+ ss.f = 1.5;
+ ss.g = 42;
+ ss.h = 123L;
+
+ SimpleClass res = mono_test_marshal_class (10, 11, 12, ss, 14);
+ if (res == null)
+ return 1;
+ if (! (res.a == ss.a && res.b == ss.b && res.c == ss.c &&
+ res.d == ss.d && res.e == ss.e && res.f == ss.f &&
+ res.g == ss.g && res.h == ss.h))
+ return 2;
+
+ /* Test null arguments and results */
+ res = mono_test_marshal_class (10, 11, 12, null, 14);
+ if (res != null)
+ return 3;
+
+ return 0;
+ }
+
+ static int test_0_marshal_byref_class () {
+ SimpleClass ss = new SimpleClass ();
+ ss.b = true;
+ ss.d = "TEST";
+ ss.e = 99;
+ ss.f = 1.5;
+ ss.g = 42;
+ ss.h = 123L;
+
+ int res = mono_test_marshal_byref_class (ref ss);
+ if (ss.d != "TEST-RES")
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_marshal_delegate () {
+ SimpleDelegate d = new SimpleDelegate (delegate_test);
+
+ return mono_test_marshal_delegate (d);
+ }
+
+ static int test_0_marshal_return_delegate () {
+ SimpleDelegate d = new SimpleDelegate (delegate_test);
+
+ SimpleDelegate d2 = mono_test_marshal_return_delegate (d);
+
+ return d2 (2);
+ }
+
+ static int test_0_marshal_delegate_struct () {
+ DelegateStruct s = new DelegateStruct ();
+
+ s.a = 2;
+ s.del = new SimpleDelegate (delegate_test);
+ s.del2 = new SimpleDelegate (delegate_test);
+
+ return mono_test_marshal_delegate_struct (s);
+ }
+
+ static int test_0_marshal_point () {
+ Point pt = new Point();
+ pt.x = 1.25;
+ pt.y = 3.5;
+
+ return mono_test_marshal_point(pt);
+ }
+
+ static int test_0_marshal_mixed_point () {
+ MixedPoint mpt = new MixedPoint();
+ mpt.x = 5;
+ mpt.y = 6.75;
+
+ return mono_test_marshal_mixed_point(mpt);
+ }
+
+ static int test_0_marshal_bool_byref () {
+ bool b = true;
+ if (mono_test_marshal_bool_byref (99, ref b, 100) != 1)
+ return 1;
+ b = false;
+ if (mono_test_marshal_bool_byref (99, ref b, 100) != 0)
+ return 12;
+ if (b != true)
+ return 13;
+
+ return 0;
+ }
+
+ static int test_0_return_vtype () {
+ SimpleStruct ss = mono_test_return_vtype (new IntPtr (5));
+
+ if (!ss.a && ss.b && !ss.c && ss.d == "TEST")
+ return 0;
+
+ return 1;
+ }
+
+ static int test_0_marshal_stringbuilder () {
+ StringBuilder sb = new StringBuilder(255);
+ sb.Append ("ABCD");
+ mono_test_marshal_stringbuilder (sb, sb.Capacity);
+ String res = sb.ToString();
+
+ if (res != "This is my message. Isn't it nice?")
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_marshal_stringbuilder_unicode () {
+ StringBuilder sb = new StringBuilder(255);
+ mono_test_marshal_stringbuilder_unicode (sb, sb.Capacity);
+ String res = sb.ToString();
+
+ if (res != "This is my message. Isn't it nice?")
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_marshal_empty_string_array () {
+ return mono_test_marshal_empty_string_array (null);
+ }
+
+ static int test_0_marshal_string_array () {
+ return mono_test_marshal_string_array (new String [] { "ABC", "DEF" });
+ }
+
+ static int test_0_marshal_unicode_string_array () {
+ return mono_test_marshal_unicode_string_array (new String [] { "ABC", "DEF" }, new String [] { "ABC", "DEF" });
+ }
+
+ static int test_0_marshal_stringbuilder_array () {
+ StringBuilder sb1 = new StringBuilder ("ABC");
+ StringBuilder sb2 = new StringBuilder ("DEF");
+
+ int res = mono_test_marshal_stringbuilder_array (new StringBuilder [] { sb1, sb2 });
+ if (res != 0)
+ return res;
+ if (sb1.ToString () != "DEF")
+ return 5;
+ if (sb2.ToString () != "ABC")
+ return 6;
+ return 0;
+ }
+
+ static int test_0_last_error () {
+ mono_test_last_error (5);
+ if (Marshal.GetLastWin32Error () == 5)
+ return 0;
+ else
+ return 1;
+ }
+
+ static int test_0_library_not_found () {
+
+ try {
+ mono_entry_point_not_found ();
+ return 1;
+ }
+ catch (EntryPointNotFoundException) {
+ }
+
+ return 0;
+ }
+
+ static int test_0_entry_point_not_found () {
+
+ try {
+ mono_library_not_found ();
+ return 1;
+ }
+ catch (DllNotFoundException) {
+ }
+
+ return 0;
+ }
+
+ /* Check that the runtime trims .dll from the library name */
+ static int test_0_trim_dll_from_name () {
+
+ mono_test_marshal_char_2 ('A');
+
+ return 0;
+ }
+
+ /* Check that the runtime adds lib to to the library name */
+ static int test_0_add_lib_to_name () {
+
+ mono_test_marshal_char_3 ('A');
+
+ return 0;
+ }
+
+ class C {
+ public int i;
+ }
+
+ static int test_0_asany () {
+ if (mono_test_asany (5, 1) != 0)
+ return 1;
+
+ if (mono_test_asany ("ABC", 2) != 0)
+ return 2;
+
+ SimpleStruct2 ss2 = new SimpleStruct2 ();
+ ss2.b = true;
+ ss2.d = "TEST";
+ ss2.e = 99;
+ ss2.f = 1.5;
+ ss2.g = 42;
+ ss2.h = 123L;
+
+ if (mono_test_asany (ss2, 3) != 0)
+ return 3;
+
+ if (mono_test_asany_unicode ("ABC", 4) != 0)
+ return 4;
+
+ try {
+ C c = new C ();
+ c.i = 5;
+ mono_test_asany (c, 0);
+ return 5;
+ }
+ catch (ArgumentException) {
+ }
+
+ try {
+ mono_test_asany (new Object (), 0);
+ return 6;
+ }
+ catch (ArgumentException) {
+ }
+
+ return 0;
+ }
+
+ /* Byref String Array */
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_byref_string_array")]
+ public static extern int mono_test_marshal_byref_string_array (ref string[] data);
+
+ public static int test_0_byref_string_array () {
+
+ string[] arr = null;
+
+ if (mono_test_marshal_byref_string_array (ref arr) != 0)
+ return 1;
+
+ arr = new string[] { "Alpha", "Beta", "Gamma" };
+
+ if (mono_test_marshal_byref_string_array (ref arr) != 1)
+ return 2;
+
+ /* FIXME: Test returned array and out case */
+
+ return 0;
+ }
+
+ /*
+ * AMD64 small structs-by-value tests.
+ */
+
+ /* TEST 1: 16 byte long INTEGER struct */
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Amd64Struct1 {
+ public int i;
+ public int j;
+ public int k;
+ public int l;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_amd64_pass_return_struct1")]
+ public static extern Amd64Struct1 mono_test_marshal_amd64_pass_return_struct1 (Amd64Struct1 s);
+
+ public static int test_0_amd64_struct1 () {
+ Amd64Struct1 s = new Amd64Struct1 ();
+ s.i = 5;
+ s.j = -5;
+ s.k = 0xffffff;
+ s.l = 0xfffffff;
+
+ Amd64Struct1 s2 = mono_test_marshal_amd64_pass_return_struct1 (s);
+
+ return ((s2.i == 6) && (s2.j == -4) && (s2.k == 0x1000000) && (s2.l == 0x10000000)) ? 0 : 1;
+ }
+
+ /* TEST 2: 8 byte long INTEGER struct */
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Amd64Struct2 {
+ public int i;
+ public int j;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_amd64_pass_return_struct2")]
+ public static extern Amd64Struct2 mono_test_marshal_amd64_pass_return_struct2 (Amd64Struct2 s);
+
+ public static int test_0_amd64_struct2 () {
+ Amd64Struct2 s = new Amd64Struct2 ();
+ s.i = 5;
+ s.j = -5;
+
+ Amd64Struct2 s2 = mono_test_marshal_amd64_pass_return_struct2 (s);
+
+ return ((s2.i == 6) && (s2.j == -4)) ? 0 : 1;
+ }
+
+ /* TEST 3: 4 byte long INTEGER struct */
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Amd64Struct3 {
+ public int i;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_amd64_pass_return_struct3")]
+ public static extern Amd64Struct3 mono_test_marshal_amd64_pass_return_struct3 (Amd64Struct3 s);
+
+ public static int test_0_amd64_struct3 () {
+ Amd64Struct3 s = new Amd64Struct3 ();
+ s.i = -5;
+
+ Amd64Struct3 s2 = mono_test_marshal_amd64_pass_return_struct3 (s);
+
+ return (s2.i == -4) ? 0 : 1;
+ }
+
+ /* Test 4: 16 byte long FLOAT struct */
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Amd64Struct4 {
+ public double d1, d2;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_amd64_pass_return_struct4")]
+ public static extern Amd64Struct4 mono_test_marshal_amd64_pass_return_struct4 (Amd64Struct4 s);
+
+ public static int test_0_amd64_struct4 () {
+ Amd64Struct4 s = new Amd64Struct4 ();
+ s.d1 = 5.0;
+ s.d2 = -5.0;
+
+ Amd64Struct4 s2 = mono_test_marshal_amd64_pass_return_struct4 (s);
+
+ return (s2.d1 == 6.0 && s2.d2 == -4.0) ? 0 : 1;
+ }
+
+ /* Blittable class */
+ [DllImport("libtest")]
+ private static extern VectorList TestVectorList (VectorList vl);
+
+ public static int test_0_marshal_blittable_class () {
+ VectorList v1 = new VectorList ();
+
+ /* Since it is blittable, it looks like it is passed as in/out */
+ VectorList v2 = TestVectorList (v1);
+
+ if (v1.a != 2 || v1.b != 3)
+ return 1;
+
+ if (v2.a != 2 || v2.b != 3)
+ return 2;
+
+ return 0;
+ }
+
+ static int test_0_marshal_byval_class () {
+ SimpleObj obj0 = new SimpleObj ();
+ obj0.str = "T1";
+ obj0.i = 4;
+
+ if (class_marshal_test0 (obj0) != 0)
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_marshal_byval_class_null () {
+ if (class_marshal_test4 (null) != 0)
+ return 1;
+
+ return 0;
+ }
+
+ static int test_0_marshal_out_class () {
+ SimpleObj obj1;
+
+ class_marshal_test1 (out obj1);
+
+ if (obj1.str != "ABC")
+ return 1;
+
+ if (obj1.i != 5)
+ return 2;
+
+ return 0;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_stdcall_name_mangling", CallingConvention=CallingConvention.StdCall)]
+ public static extern int mono_test_stdcall_name_mangling (int a, int b, int c);
+
+ static int test_0_stdcall_name_mangling () {
+ return mono_test_stdcall_name_mangling (0, 1, 2) == 3 ? 0 : 1;
+ }
+}
+
diff --git a/mono/tests/pinvoke3.cs b/mono/tests/pinvoke3.cs
new file mode 100755
index 00000000000..b38ee0c5e0b
--- /dev/null
+++ b/mono/tests/pinvoke3.cs
@@ -0,0 +1,315 @@
+//
+// pinvoke3.cs:
+//
+// Tests for native->managed marshalling
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+public class Tests {
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct SimpleStruct {
+ public bool a;
+ public bool b;
+ public bool c;
+ public string d;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public class SimpleClass {
+ public bool a;
+ public bool b;
+ public bool c;
+ public string d;
+ }
+
+ public static SimpleStruct delegate_test_struct (SimpleStruct ss)
+ {
+ SimpleStruct res;
+
+ res.a = !ss.a;
+ res.b = !ss.b;
+ res.c = !ss.c;
+ res.d = ss.d + "-RES";
+
+ return res;
+ }
+
+ public static int delegate_test_struct_byref (int a, ref SimpleStruct ss, int b)
+ {
+ if (a == 1 && b == 2 && ss.a && !ss.b && ss.c && ss.d == "TEST2") {
+ ss.a = true;
+ ss.b = true;
+ ss.c = true;
+ ss.d = "TEST3";
+ return 0;
+ }
+
+ return 1;
+ }
+
+ public static int delegate_test_struct_out (int a, out SimpleStruct ss, int b)
+ {
+ ss.a = true;
+ ss.b = true;
+ ss.c = true;
+ ss.d = "TEST3";
+
+ return 0;
+ }
+
+ public static SimpleClass delegate_test_class (SimpleClass ss)
+ {
+ if (ss == null)
+ return null;
+
+ if (! (!ss.a && ss.b && !ss.c && ss.d == "TEST"))
+ return null;
+
+ SimpleClass res = ss;
+
+ return res;
+ }
+
+ public static int delegate_test_class_byref (ref SimpleClass ss)
+ {
+ if (ss == null)
+ return -1;
+
+ if (!ss.a && ss.b && !ss.c && ss.d == "TEST") {
+ ss.a = true;
+ ss.b = false;
+ ss.c = true;
+ ss.d = "RES";
+
+ return 0;
+ }
+
+ return 1;
+ }
+
+ public static int delegate_test_class_out (out SimpleClass ss)
+ {
+ ss = new SimpleClass ();
+ ss.a = true;
+ ss.b = false;
+ ss.c = true;
+ ss.d = "RES";
+
+ return 0;
+ }
+
+ public static int delegate_test_primitive_byref (ref int i)
+ {
+ if (i != 1)
+ return 1;
+
+ i = 2;
+ return 0;
+ }
+
+ public static int delegate_test_string_marshalling (string s)
+ {
+ return s == "ABC" ? 0 : 1;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_ref_vtype")]
+ public static extern int mono_test_ref_vtype (int a, ref SimpleStruct ss, int b, TestDelegate d);
+
+ public delegate int OutStructDelegate (int a, out SimpleStruct ss, int b);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_out_struct")]
+ public static extern int mono_test_marshal_out_struct (int a, out SimpleStruct ss, int b, OutStructDelegate d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate2")]
+ public static extern int mono_test_marshal_delegate2 (SimpleDelegate2 d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate4")]
+ public static extern int mono_test_marshal_delegate4 (SimpleDelegate4 d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate5")]
+ public static extern int mono_test_marshal_delegate5 (SimpleDelegate5 d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate6")]
+ public static extern int mono_test_marshal_delegate6 (SimpleDelegate5 d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate7")]
+ public static extern int mono_test_marshal_delegate7 (SimpleDelegate7 d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate8", CharSet=CharSet.Unicode)]
+ public static extern int mono_test_marshal_delegate8 (SimpleDelegate8 d, string s);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate9")]
+ public static extern int mono_test_marshal_delegate9 (SimpleDelegate9 d, return_int_delegate d2);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate10")]
+ public static extern int mono_test_marshal_delegate10 (SimpleDelegate9 d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_primitive_byref_delegate")]
+ public static extern int mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate d);
+
+ [DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate_delegate")]
+ public static extern int mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d);
+
+ public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
+
+ public delegate SimpleStruct SimpleDelegate2 (SimpleStruct ss);
+
+ public delegate SimpleClass SimpleDelegate4 (SimpleClass ss);
+
+ public delegate int SimpleDelegate5 (ref SimpleClass ss);
+
+ public delegate int SimpleDelegate7 (out SimpleClass ss);
+
+ public delegate int SimpleDelegate8 ([MarshalAs (UnmanagedType.LPWStr)] string s1);
+
+ public delegate int return_int_delegate (int i);
+
+ public delegate int SimpleDelegate9 (return_int_delegate del);
+
+ public delegate int PrimitiveByrefDelegate (ref int i);
+
+ public delegate return_int_delegate ReturnDelegateDelegate ();
+
+ public static int Main () {
+ return TestDriver.RunTests (typeof (Tests));
+ }
+
+ /* Test structures as arguments and return values of delegates */
+ static int test_0_marshal_struct_delegate () {
+ SimpleDelegate2 d = new SimpleDelegate2 (delegate_test_struct);
+
+ return mono_test_marshal_delegate2 (d);
+ }
+
+ /* Test structures as byref arguments of delegates */
+ static int test_0_marshal_byref_struct_delegate () {
+ SimpleStruct ss = new SimpleStruct ();
+ TestDelegate d = new TestDelegate (delegate_test_struct_byref);
+
+ ss.b = true;
+ ss.d = "TEST1";
+
+ if (mono_test_ref_vtype (1, ref ss, 2, d) != 0)
+ return 1;
+
+ if (! (ss.a && ss.b && ss.c && ss.d == "TEST3"))
+ return 2;
+
+ return 0;
+ }
+
+ /* Test structures as out arguments of delegates */
+ static int test_0_marshal_out_struct_delegate () {
+ SimpleStruct ss = new SimpleStruct ();
+ OutStructDelegate d = new OutStructDelegate (delegate_test_struct_out);
+
+ return mono_test_marshal_out_struct (1, out ss, 2, d);
+ }
+
+ /* Test classes as arguments and return values of delegates */
+ static int test_0_marshal_class_delegate () {
+ SimpleDelegate4 d = new SimpleDelegate4 (delegate_test_class);
+
+ return mono_test_marshal_delegate4 (d);
+ }
+
+ /* Test classes as byref arguments of delegates */
+ static int test_0_marshal_byref_class_delegate () {
+ SimpleDelegate5 d = new SimpleDelegate5 (delegate_test_class_byref);
+
+ return mono_test_marshal_delegate5 (d);
+ }
+
+ /* Test classes as out arguments of delegates */
+ static int test_0_marshal_out_class_delegate () {
+ SimpleDelegate7 d = new SimpleDelegate7 (delegate_test_class_out);
+
+ return mono_test_marshal_delegate7 (d);
+ }
+
+ /* Test string marshalling with delegates */
+ static int test_0_marshal_string_delegate () {
+ SimpleDelegate8 d = new SimpleDelegate8 (delegate_test_string_marshalling);
+
+ return mono_test_marshal_delegate8 (d, "ABC");
+ }
+
+ /* Test that the delegate wrapper correctly catches null byref arguments */
+ static int test_0_marshal_byref_class_delegate_null () {
+ SimpleDelegate5 d = new SimpleDelegate5 (delegate_test_class_byref);
+
+ try {
+ mono_test_marshal_delegate6 (d);
+ return 1;
+ }
+ catch (ArgumentNullException ex) {
+ return 0;
+ }
+ }
+
+ static int return_self (int i) {
+ return i;
+ }
+
+ static int call_int_delegate (return_int_delegate d) {
+ return d (55);
+ }
+
+ static int test_55_marshal_delegate_delegate () {
+ SimpleDelegate9 d = new SimpleDelegate9 (call_int_delegate);
+
+ return mono_test_marshal_delegate9 (d, new return_int_delegate (return_self));
+ }
+
+ static int test_0_marshal_delegate_delegate_unmanaged_ftn () {
+ SimpleDelegate9 d = new SimpleDelegate9 (call_int_delegate);
+
+ try {
+ mono_test_marshal_delegate10 (d);
+ return 1;
+ }
+ catch (ArgumentException) {
+ return 0;
+ }
+
+ return 2;
+ }
+
+ static int test_0_marshal_primitive_byref_delegate () {
+ PrimitiveByrefDelegate d = new PrimitiveByrefDelegate (delegate_test_primitive_byref);
+
+ return mono_test_marshal_primitive_byref_delegate (d);
+ }
+
+ public static return_int_delegate return_delegate () {
+ return new return_int_delegate (return_self);
+ }
+
+ static int test_55_marshal_return_delegate_delegate () {
+ return mono_test_marshal_return_delegate_delegate (new ReturnDelegateDelegate (return_delegate));
+ }
+
+ /* Passing and returning strings */
+
+ public delegate String ReturnStringDelegate (String s);
+
+ [DllImport ("libtest", EntryPoint="mono_test_return_string")]
+ public static extern String mono_test_marshal_return_string_delegate (ReturnStringDelegate d);
+
+ public static String managed_return_string (String s) {
+ if (s != "TEST")
+ return "";
+ else
+ return "12345";
+ }
+
+ static int test_0_marshal_return_string_delegate () {
+ ReturnStringDelegate d = new ReturnStringDelegate (managed_return_string);
+ String s = mono_test_marshal_return_string_delegate (d);
+
+ return (s == "12345") ? 0 : 1;
+ }
+}
diff --git a/mono/tests/pointer.cs b/mono/tests/pointer.cs
index 3cf97d2f959..b425801b481 100644
--- a/mono/tests/pointer.cs
+++ b/mono/tests/pointer.cs
@@ -16,15 +16,19 @@ public class Test {
return num;
num++;
- if (sizeof (void*) != 4)
+ if (sizeof (void*) != sizeof(IntPtr))
return num;
num++;
- if (sizeof (byte*) != 4)
+ if (sizeof (byte*) != sizeof (void *))
return num;
num++;
- if (sizeof (int*) != 4)
+ if (sizeof (int*) != sizeof (int *))
+ return num;
+
+ num++;
+ if (sizeof (IntPtr) != 4 && sizeof (IntPtr) != 8)
return num;
return 0;
diff --git a/mono/tests/process1.cs b/mono/tests/process1.cs
new file mode 100755
index 00000000000..af6f364f249
--- /dev/null
+++ b/mono/tests/process1.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Diagnostics;
+using System.Threading;
+
+class Modules {
+ static void Run() {
+ Process proc = new Process();
+ bool ret;
+
+ proc.StartInfo.FileName="wibble";
+ proc.StartInfo.Arguments="arg1 arg2\targ3 \"arg4a arg4b\"";
+ proc.StartInfo.UseShellExecute=false;
+ ret=proc.Start();
+
+ Console.WriteLine("Start returns " + ret);
+ Console.WriteLine("Process is " + proc.ToString());
+ Console.WriteLine("Pid is " + proc.Id);
+ Console.WriteLine("Handle is " + proc.Handle);
+ Console.WriteLine("HandleCount is " + proc.HandleCount);
+
+ Console.WriteLine("Waiting for exit...");
+ proc.WaitForExit();
+ Console.WriteLine("Wait returned");
+ Console.WriteLine("Exit code is " + proc.ExitCode);
+ Console.WriteLine("Process started at " + proc.StartTime);
+ Console.WriteLine("Process ended at " + proc.ExitTime);
+ }
+
+ static void Main() {
+ Run();
+ System.Threading.Thread.Sleep(10000);
+ Run();
+ }
+}
+
diff --git a/mono/tests/process2.cs b/mono/tests/process2.cs
new file mode 100755
index 00000000000..25137e2762c
--- /dev/null
+++ b/mono/tests/process2.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Diagnostics;
+using System.Threading;
+
+class Modules {
+ static void Run() {
+ Process proc = new Process();
+ bool ret;
+
+ proc.StartInfo.FileName="wibble-redir";
+ proc.StartInfo.Arguments="arg1 arg2\targ3 \"arg4a arg4b\"";
+ proc.StartInfo.UseShellExecute=false;
+ proc.StartInfo.RedirectStandardInput=true;
+ ret=proc.Start();
+
+ Console.WriteLine("Start returns " + ret);
+ Console.WriteLine("Process is " + proc.ToString());
+ Console.WriteLine("Pid is " + proc.Id);
+ Console.WriteLine("Handle is " + proc.Handle);
+ Console.WriteLine("HandleCount is " + proc.HandleCount);
+
+ Console.WriteLine("Writing [foo bar]");
+ proc.StandardInput.WriteLine("foo bar");
+
+ System.Threading.Thread.Sleep(1000);
+
+ Console.WriteLine("Writing [wibble wobble]");
+ proc.StandardInput.WriteLine("wibble wobble");
+
+ System.Threading.Thread.Sleep(1000);
+
+ Console.WriteLine("Closing stdin");
+ proc.StandardInput.Close();
+
+ Console.WriteLine("Waiting for exit...");
+ proc.WaitForExit();
+ Console.WriteLine("Wait returned");
+ Console.WriteLine("Exit code is " + proc.ExitCode);
+ Console.WriteLine("Process started at " + proc.StartTime);
+ Console.WriteLine("Process ended at " + proc.ExitTime);
+ }
+
+ static void Main() {
+ Run();
+ }
+}
+
diff --git a/mono/tests/qt-instance.il b/mono/tests/qt-instance.il
new file mode 100755
index 00000000000..dad55228718
--- /dev/null
+++ b/mono/tests/qt-instance.il
@@ -0,0 +1,108 @@
+
+// Microsoft (R) .NET Framework IL Disassembler. Version 1.0.3705.0
+// Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.
+
+.assembly extern mscorlib
+{
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+ .ver 1:0:3300:0
+}
+.assembly 'qt-instance'
+{
+ // --- The following custom attribute is added automatically, do not uncomment -------
+ // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(bool,
+ // bool) = ( 01 00 00 01 00 00 )
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.module 'qt-instance.exe'
+// MVID: {187EE85D-D172-46C8-B3FC-38A5DA20CC99}
+.imagebase 0x00400000
+.subsystem 0x00000003
+.file alignment 512
+.corflags 0x00000001
+// Image base: 0x00a70000
+//
+// ============== CLASS STRUCTURE DECLARATION ==================
+//
+.class private sequential ansi sealed beforefieldinit QNull
+ extends [mscorlib]System.ValueType
+{
+} // end of class QNull
+
+.class public auto ansi beforefieldinit Testing
+ extends [mscorlib]System.Object
+{
+} // end of class Testing
+
+
+// =============================================================
+
+
+// =============== GLOBAL FIELDS AND METHODS ===================
+
+
+// =============================================================
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+// note that class flags, 'extends' and 'implements' clauses
+// are provided here for information only
+
+.class private sequential ansi sealed beforefieldinit QNull
+ extends [mscorlib]System.ValueType
+{
+ .pack 0
+ .size 1
+ .field private static valuetype QNull 'instance'
+ .method assembly hidebysig specialname static
+ valuetype QNull get_Instance() cil managed
+ {
+ // Code size 10 (0xa)
+ .maxstack 1
+ .locals init (valuetype QNull V_0)
+ IL_0000: ldsfld valuetype QNull QNull::'instance'
+ IL_0005: stloc.0
+ IL_0006: br.s IL_0008
+
+ IL_0008: ldloc.0
+ IL_0009: ret
+ } // end of method QNull::get_Instance
+
+ .property valuetype QNull Instance()
+ {
+ .get valuetype QNull QNull::get_Instance()
+ } // end of property QNull::Instance
+} // end of class QNull
+
+.class public auto ansi beforefieldinit Testing
+ extends [mscorlib]System.Object
+{
+ .method public hidebysig static void Main() cil managed
+ {
+ .entrypoint
+ // Code size 12 (0xc)
+ .maxstack 1
+ .locals init (object V_0)
+ IL_0000: call valuetype QNull QNull::get_Instance()
+ IL_0005: box QNull
+ IL_000a: stloc.0
+ IL_000b: ret
+ } // end of method Testing::Main
+
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 1
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method Testing::.ctor
+
+} // end of class Testing
+
+
+// =============================================================
+
+//*********** DISASSEMBLY COMPLETE ***********************
diff --git a/mono/tests/reflection-const-field.cs b/mono/tests/reflection-const-field.cs
new file mode 100644
index 00000000000..c2f838c88b6
--- /dev/null
+++ b/mono/tests/reflection-const-field.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Reflection;
+
+class T {
+
+ public const bool a = true;
+ public const byte b = 1;
+ public const sbyte c = 2;
+ public const sbyte cc = -3;
+ public const sbyte ccc = 0;
+ public const char d = 'a';
+ public const short e = 4;
+ public const short ee = -5;
+ public const short eee = 0;
+ public const ushort f = 6;
+ public const int g = 7;
+ public const int gg = -8;
+ public const int ggg = 0;
+ public const uint h = 9;
+ public const long i = 10;
+ public const long ii = -11;
+ public const long iii = 0;
+ public const ulong j = 12;
+ public const double k = 13.0;
+ public const double kk = -14.0;
+ public const double kkk = 0;
+ public const float l = 15;
+ public const float ll = -16;
+ public const float lll = 0;
+ public const string m = "la la la";
+ public const string n = null;
+
+ static void Main ()
+ {
+ X ("a", a);
+ X ("b", b);
+ X ("c", c);
+ X ("cc", cc);
+ X ("ccc", ccc);
+ X ("d", d);
+ X ("e", e);
+ X ("ee", ee);
+ X ("eee", eee);
+ X ("f", f);
+ X ("g", g);
+ X ("gg", gg);
+ X ("ggg", ggg);
+ X ("h", h);
+ X ("i", i);
+ X ("ii", ii);
+ X ("iii", iii);
+ X ("j", j);
+ X ("k", k);
+ X ("kk", kk);
+ X ("kkk", kkk);
+ X ("l", l);
+ X ("ll", ll);
+ X ("lll", lll);
+ X ("m", m);
+ X ("n", n);
+ }
+
+ static void X (string n, object o)
+ {
+ if (! Object.Equals (typeof (T).GetField (n).GetValue (null), o))
+ throw new Exception (n);
+ }
+} \ No newline at end of file
diff --git a/mono/tests/reinit.cs b/mono/tests/reinit.cs
new file mode 100644
index 00000000000..8c5bde036b8
--- /dev/null
+++ b/mono/tests/reinit.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Reflection;
+
+class T {
+ int v;
+ int a;
+ public T () {
+ v = 1;
+ // note: a not modified
+ }
+ static int Main () {
+ Type t = typeof (T);
+ T obj = new T ();
+ MethodBase m1;
+ Console.WriteLine ("after ctor a is {0}", obj.a);
+ Console.WriteLine ("after ctor v is {0}", obj.v);
+ obj.a = 2;
+ obj.v = 5;
+ Console.WriteLine ("a is {0}", obj.a);
+ Console.WriteLine ("v is {0}", obj.v);
+
+ m1 = t.GetConstructor (Type.EmptyTypes);
+ m1.Invoke (obj, null);
+ Console.WriteLine ("after reinit a is {0}", obj.a);
+ Console.WriteLine ("after reinit v is {0}", obj.v);
+ /* value not preserved */
+ if (obj.a != 2)
+ return 1;
+ /* value not reinitialized */
+ if (obj.v != 1)
+ return 2;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/remoting1.cs b/mono/tests/remoting1.cs
index fdc8a665936..912133c45fe 100644
--- a/mono/tests/remoting1.cs
+++ b/mono/tests/remoting1.cs
@@ -63,8 +63,11 @@ public struct MyStruct {
public int b;
public int c;
}
+
+interface R2 {
+}
-class R1 : MarshalByRefObject {
+class R1 : MarshalByRefObject, R2 {
public int test_field = 5;
@@ -82,7 +85,7 @@ class R1 : MarshalByRefObject {
}
public long nonvirtual_Add (int a, int b) {
- Console.WriteLine ("nonvirtual_Add");
+ Console.WriteLine ("nonvirtual_Add " + a + " + " + b);
return a + b;
}
}
@@ -112,6 +115,8 @@ class Test {
if (!RemotingServices.IsTransparentProxy (o))
return 2;
+ Console.WriteLine ("XXXXXXXXXXXX: " + RemotingServices.GetRealProxy (o));
+
if (o.GetType () != myobj.GetType ())
return 3;
@@ -171,6 +176,9 @@ class Test {
RemoteDelegate2 d2 = new RemoteDelegate2 (o.nonvirtual_Add);
d2 (6, 7);
+ if (!(real_proxy.GetTransparentProxy () is R2))
+ return 14;
+
return 0;
}
}
diff --git a/mono/tests/remoting3.cs b/mono/tests/remoting3.cs
index a7c726b1bae..77fb860e655 100644
--- a/mono/tests/remoting3.cs
+++ b/mono/tests/remoting3.cs
@@ -98,7 +98,6 @@ class Test {
MyProxy real_proxy = new MyProxy (myobj);
R1 o = (R1)real_proxy.GetTransparentProxy ();
-
RemoteDelegate1 d1 = new RemoteDelegate1 (o.Add);
diff --git a/mono/tests/remoting4.cs b/mono/tests/remoting4.cs
new file mode 100755
index 00000000000..7eb6a48fbe1
--- /dev/null
+++ b/mono/tests/remoting4.cs
@@ -0,0 +1,160 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Messaging;
+using System.Runtime.Remoting.Proxies;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Serialization;
+
+namespace RemotingTest
+{
+ class MyProxy : RealProxy
+ {
+ readonly MarshalByRefObject target;
+
+ public MyProxy (MarshalByRefObject target) : base (target.GetType())
+ {
+ this.target = target;
+ }
+
+ public override IMessage Invoke (IMessage request)
+ {
+ IMethodCallMessage call = (IMethodCallMessage)request;
+ Console.WriteLine ("Invoke " + call.MethodName);
+
+ Console.Write ("ARGS(");
+ for (int i = 0; i < call.ArgCount; i++)
+ {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (call.GetArgName (i) + " " +
+ call.GetArg (i));
+ }
+ Console.WriteLine (")");
+ Console.Write ("INARGS(");
+ for (int i = 0; i < call.InArgCount; i++)
+ {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (call.GetInArgName (i) + " " +
+ call.GetInArg (i));
+ }
+ Console.WriteLine (")");
+
+ IMethodReturnMessage res = RemotingServices.ExecuteMessage (target, call);
+
+ Console.Write ("RESARGS(");
+ for (int i = 0; i < res.ArgCount; i++)
+ {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (res.GetArgName (i) + " " +
+ res.GetArg (i));
+ }
+ Console.WriteLine (")");
+
+ Console.Write ("RESOUTARGS(");
+ for (int i = 0; i < res.OutArgCount; i++)
+ {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (res.GetOutArgName (i) + " " +
+ res.GetOutArg (i));
+ }
+ Console.WriteLine (")");
+
+ return res;
+ }
+ }
+
+ class R2
+ {
+ string sTest;
+ public R2()
+ {
+ sTest = "R2";
+ }
+
+ public void Print()
+ {
+ Console.WriteLine(sTest);
+ }
+ }
+
+ [Serializable]
+ class R2_MBV
+ {
+ string sTest;
+ public R2_MBV()
+ {
+ sTest = "R2";
+ }
+
+ public string Data
+ {
+ get
+ {
+ return sTest;
+ }
+ }
+ }
+
+ class R1 : MarshalByRefObject
+ {
+ public R2 TestMBV() {
+ return new R2();
+ }
+ }
+
+ class Class1
+ {
+ static int Main(string[] args)
+ {
+ Console.WriteLine("test " + AppDomain.CurrentDomain.FriendlyName);
+ AppDomain app2 = AppDomain.CreateDomain("2");
+
+ if (!RemotingServices.IsTransparentProxy(app2))
+ return 1;
+
+ ObjectHandle o = AppDomain.CurrentDomain.CreateInstance(typeof(R1).Assembly.FullName, typeof(R1).FullName);
+ R1 myobj = (R1) o.Unwrap();
+
+ // should not be a proxy in our domain..
+ if (RemotingServices.IsTransparentProxy(myobj))
+ {
+ Console.WriteLine("CreateInstance return TP for in our current domain");
+ return 2;
+ }
+
+ o = app2.CreateInstance(typeof(R1).Assembly.FullName, typeof(R1).FullName);
+
+ Console.WriteLine("type: " + o.GetType().ToString());
+
+ myobj = (R1) o.Unwrap();
+ if (!RemotingServices.IsTransparentProxy(myobj))
+ return 3;
+
+ Console.WriteLine("unwrapped type: " + myobj.GetType().ToString());
+
+ R2 r2 = null;
+ bool bSerExc = false;
+
+ // this should crash
+ try
+ {
+ r2 = myobj.TestMBV();
+ }
+ catch (SerializationException)
+ {
+ bSerExc = true;
+ }
+
+ if (!bSerExc)
+ return 4;
+
+ Console.WriteLine("test-ok");
+ return 0;
+ }
+ }
+}
diff --git a/mono/tests/remoting5.cs b/mono/tests/remoting5.cs
new file mode 100644
index 00000000000..b57206dc7b7
--- /dev/null
+++ b/mono/tests/remoting5.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Messaging;
+using System.Runtime.Remoting.Proxies;
+
+class MyProxy : RealProxy {
+ readonly MarshalByRefObject target;
+
+ public MyProxy (MarshalByRefObject target) : base (target.GetType())
+ {
+ this.target = target;
+ }
+
+ public override IMessage Invoke (IMessage request) {
+ IMethodCallMessage call = (IMethodCallMessage)request;
+ Console.WriteLine ("Invoke " + call.MethodName);
+
+ Console.Write ("ARGS(");
+ for (int i = 0; i < call.ArgCount; i++) {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (call.GetArgName (i) + " " +
+ call.GetArg (i));
+ }
+ Console.WriteLine (")");
+ Console.Write ("INARGS(");
+ for (int i = 0; i < call.InArgCount; i++) {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (call.GetInArgName (i) + " " +
+ call.GetInArg (i));
+ }
+ Console.WriteLine (")");
+
+ ((R1)target).test_field = 1;
+
+ IMethodReturnMessage res = RemotingServices.ExecuteMessage (target, call);
+
+ Console.Write ("RESARGS(");
+ for (int i = 0; i < res.ArgCount; i++) {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (res.GetArgName (i) + " " +
+ res.GetArg (i));
+ }
+ Console.WriteLine (")");
+
+ Console.Write ("RESOUTARGS(");
+ for (int i = 0; i < res.OutArgCount; i++) {
+ if (i != 0)
+ Console.Write (", ");
+ Console.Write (res.GetOutArgName (i) + " " +
+ res.GetOutArg (i));
+ }
+ Console.WriteLine (")");
+
+ return res;
+ }
+}
+
+
+class R1 : MarshalByRefObject {
+
+ public int test_field = 5;
+
+ public virtual int ldfield_test () {
+
+ MyProxy real_proxy = new MyProxy (this);
+ R1 o = (R1)real_proxy.GetTransparentProxy ();
+
+ if (o.test_field != 1)
+ return 1;
+
+ if (test_field != 1)
+ return 1;
+
+ return 0;
+ }
+}
+
+class Test {
+
+ static int Main () {
+ R1 myobj = new R1 ();
+
+ return myobj.ldfield_test ();
+ }
+}
diff --git a/mono/tests/runtime-invoke.cs b/mono/tests/runtime-invoke.cs
new file mode 100644
index 00000000000..7ffaf16ee4f
--- /dev/null
+++ b/mono/tests/runtime-invoke.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Reflection;
+
+public struct A
+{
+ public override string ToString ()
+ {
+ return "A";
+ }
+}
+
+public class D
+{
+ public string Test ()
+ {
+ return "Test";
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Assembly ass = Assembly.GetCallingAssembly ();
+ Type a_type = ass.GetType ("A");
+ MethodInfo a_method = a_type.GetMethod ("ToString");
+
+ Type d_type = ass.GetType ("D");
+ MethodInfo d_method = d_type.GetMethod ("Test");
+
+ Console.WriteLine ("TEST: {0} {1}", a_method, d_method);
+
+ A a = new A ();
+ D d = new D ();
+
+ object a_ret = a_method.Invoke (a, null);
+ Console.WriteLine (a_ret);
+
+ object d_ret = d_method.Invoke (d, null);
+ Console.WriteLine (d_ret);
+ }
+}
diff --git a/mono/tests/setenv.cs b/mono/tests/setenv.cs
index 63ad579fdc4..bd0d86eb0e4 100644
--- a/mono/tests/setenv.cs
+++ b/mono/tests/setenv.cs
@@ -7,17 +7,26 @@ namespace Test {
[DllImport("libc")]
static extern int setenv(string name, string value, int overwrite);
[DllImport("libc")]
- static extern string getenv(string name);
+ static extern IntPtr getenv(string name);
static int Main() {
- string name = "mono_test";
- string value = "val";
+ try {
+ string name = "mono_test";
+ string value = "val";
- setenv (name, value, 1);
- string ret = getenv (name);
+ setenv (name, value, 1);
+ string ret = Marshal.PtrToStringAnsi (getenv (name));
+
+ if (ret != value)
+ return 1;
+ }
+ catch (EntryPointNotFoundException) {
+ /* setenv is not available on some platforms */
+ }
+ catch (DllNotFoundException) {
+ /* libc might not be accessible by that name */
+ }
- if (ret != value)
- return 1;
return 0;
}
}
diff --git a/mono/tests/sieve.cs b/mono/tests/sieve.cs
index dbcd3aa2c24..0f4b3e8d88d 100644
--- a/mono/tests/sieve.cs
+++ b/mono/tests/sieve.cs
@@ -1,5 +1,5 @@
/* -*- mode: c -*-
- * $Id: sieve.cs,v 1.1 2001/11/19 06:52:53 lupus Exp $
+ * $Id: sieve.cs,v 1.2 2003/07/18 13:06:43 lupus Exp $
* http://www.bagley.org/~doug/shootout/
*/
@@ -26,7 +26,7 @@ static public int Main() {
}
}
}
- //printf("Count: %d\n", count);
+ System.Console.WriteLine("Count: {0}\n", count);
return(0);
}
}
diff --git a/mono/tests/static-constructor.cs b/mono/tests/static-constructor.cs
index 754022537d3..e520de65796 100755
--- a/mono/tests/static-constructor.cs
+++ b/mono/tests/static-constructor.cs
@@ -1,9 +1,22 @@
-public class GenRandom {
+using System;
+using System.Reflection;
+
+struct A {
+ public A (int i) {
+ }
+}
+
+struct B {
+ public B (int i) {
+ }
+}
+
+public class Tests {
static int last = 42;
static int burp;
- static GenRandom () {
+ static Tests () {
/*
* This is really at test of the compiler: it should init
* last before getting here.
@@ -18,6 +31,14 @@ public class GenRandom {
return 1;
if (burp != 4)
return 1;
+
+ // Regression test for bug #59193 (shared runtime wrappers)
+ ConstructorInfo con1 = typeof (A).GetConstructor (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type [1] { typeof (int) }, null);
+ ConstructorInfo con2 = typeof (B).GetConstructor (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type [1] { typeof (int) }, null);
+
+ con1.Invoke (null, new Object [] { 0 });
+ con2.Invoke (null, new Object [] { 0 });
+
return 0;
}
}
diff --git a/mono/tests/struct.cs b/mono/tests/struct.cs
index 1af2cfd14cf..7e8cf2d56c7 100755
--- a/mono/tests/struct.cs
+++ b/mono/tests/struct.cs
@@ -1,3 +1,5 @@
+using System;
+
struct Point
{
public int x, y, z;
@@ -53,6 +55,13 @@ public class test {
return 10;
if (zp.x != zp.y || zp.y != zp.z || zp.z != 0)
return 11;
+
+ // Test that the object is properly unboxed when called through
+ // the reflection interface
+ object o = Activator.CreateInstance (typeof (Point), new object [] { 1, 2 });
+ if (!(o is Point))
+ return 12;
+
return 0;
}
}
diff --git a/mono/tests/switch.cs b/mono/tests/switch.cs
index 10db17507ce..8310684808d 100755
--- a/mono/tests/switch.cs
+++ b/mono/tests/switch.cs
@@ -10,6 +10,20 @@ public class Switch {
}
return 100;
}
+
+ const string long_str =
+ "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}partnerLinks";
+
+ // bug #54473
+ public static int test_string (string s) {
+ switch (s) {
+ case "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}partnerLinks":
+ return 1;
+ default:
+ return 0;
+ }
+ }
+
public static int Main () {
if (test(0) != 1)
return 1;
@@ -19,6 +33,8 @@ public class Switch {
return 3;
if (test(3) != 0xff)
return 4;
+ if (test_string (long_str) != 1)
+ return 5;
return 0;
}
}
diff --git a/mono/tests/synchronized.cs b/mono/tests/synchronized.cs
new file mode 100644
index 00000000000..58eda9a209e
--- /dev/null
+++ b/mono/tests/synchronized.cs
@@ -0,0 +1,90 @@
+//
+// synchronized.cs:
+//
+// Tests for the 'synchronized' method attribute
+//
+
+using System;
+using System.Threading;
+using System.Runtime.CompilerServices;
+
+class Test {
+
+ [MethodImplAttribute(MethodImplOptions.Synchronized)]
+ public int test () {
+ Monitor.Exit (this);
+ Monitor.Enter (this);
+ return 2 + 2;
+ }
+
+ [MethodImplAttribute(MethodImplOptions.Synchronized)]
+ public static int test_static () {
+ Monitor.Exit (typeof (Test));
+ Monitor.Enter (typeof (Test));
+ return 2 + 2;
+ }
+
+ [MethodImplAttribute(MethodImplOptions.Synchronized)]
+ public int test_exception () {
+ Monitor.Exit (this);
+ throw new Exception ("A");
+ }
+
+ [MethodImplAttribute(MethodImplOptions.Synchronized)]
+ public virtual int test_virtual () {
+ Monitor.Exit (this);
+ Monitor.Enter (this);
+ return 2 + 2;
+ }
+
+ public delegate int Delegate1 ();
+
+ static public int Main (String[] args) {
+ Test b = new Test ();
+ int res;
+
+ Console.WriteLine ("Test1...");
+ b.test ();
+ Console.WriteLine ("Test2...");
+ test_static ();
+ Console.WriteLine ("Test3...");
+ try {
+ b.test_exception ();
+ }
+ catch (SynchronizationLockException ex) {
+ return 1;
+ }
+ catch (Exception ex) {
+ // OK
+ }
+
+ Console.WriteLine ("Test4...");
+ b.test_virtual ();
+
+ Console.WriteLine ("Test5...");
+ Delegate1 d = new Delegate1 (b.test);
+ res = d ();
+
+ Console.WriteLine ("Test6...");
+ d = new Delegate1 (test_static);
+ res = d ();
+
+ Console.WriteLine ("Test7...");
+ d = new Delegate1 (b.test_virtual);
+ res = d ();
+
+ Console.WriteLine ("Test8...");
+ d = new Delegate1 (b.test_exception);
+ try {
+ d ();
+ }
+ catch (SynchronizationLockException ex) {
+ return 2;
+ }
+ catch (Exception ex) {
+ // OK
+ }
+
+ return 0;
+ }
+}
diff --git a/mono/tests/test-byval-in-struct.cs b/mono/tests/test-byval-in-struct.cs
new file mode 100644
index 00000000000..c247714df6f
--- /dev/null
+++ b/mono/tests/test-byval-in-struct.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Runtime.InteropServices;
+
+[StructLayout (LayoutKind.Explicit)]
+struct TestStructure {
+ [FieldOffset (0)]
+ internal int number;
+ [FieldOffset (8)]
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst=1024)]
+ internal byte[] stuff;
+
+ static int Main () {
+ int size = Marshal.SizeOf(typeof(TestStructure));
+ Console.WriteLine("Size of t: {0}", size);
+ if (size != 1032)
+ return 1;
+
+ size = Marshal.SizeOf(typeof(TestStructure2));
+ Console.WriteLine("Size of t2: {0}", size);
+ if (size != 8)
+ return 2;
+
+ return 0;
+ }
+}
+
+[StructLayout (LayoutKind.Explicit)]
+struct TestStructure2 {
+ [FieldOffset (0)]
+ byte val;
+ [FieldOffset (2)]
+ int val2;
+}
diff --git a/mono/tests/test-driver b/mono/tests/test-driver
index 04d5dc85586..fb05809a098 100755
--- a/mono/tests/test-driver
+++ b/mono/tests/test-driver
@@ -1,7 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
my $interpreter = shift;
my $test = shift;
+my $disabled_tests = shift;
my $output = $test;
my $stdout = $test.'.stdout';
my $stderr = $test.'.stderr';
@@ -11,11 +12,20 @@ $output =~ s/\.exe$/.output/;
$| = 0;
print "Testing $test... ";
+if (index ($disabled_tests, $test) >= 0) {
+ print "disabled.\n";
+ exit (0);
+}
+
my $res = system("$interpreter @ARGV $test 2>/dev/null 1>$stdout");
if ($res) {
printf ("failed $? (%d) signal (%d).\n", $? >> 8, $? & 127);
- exit (1);
+ if (($? & 127) == 2) {
+ exit (2);
+ } else {
+ exit (1);
+ }
} elsif (-f $output) {
print "failed output.\n" if (read_file ($output) ne read_file ($stdout));
exit (1);
diff --git a/mono/tests/tests-config.in b/mono/tests/tests-config.in
new file mode 100644
index 00000000000..2c86105e9a0
--- /dev/null
+++ b/mono/tests/tests-config.in
@@ -0,0 +1,5 @@
+<configuration>
+ <dllmap dll="cygwin1.dll" target="@LIBC@" />
+ <dllmap dll="libc" target="@LIBC@" />
+</configuration>
+
diff --git a/mono/tests/thread-static.cs b/mono/tests/thread-static.cs
new file mode 100644
index 00000000000..351ead35355
--- /dev/null
+++ b/mono/tests/thread-static.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Threading;
+
+class T {
+ [ThreadStatic]
+ static int var = 5;
+
+ static bool tfailed = true;
+
+ static void thread () {
+ tfailed = false;
+ if (var != 0)
+ tfailed = true;
+ Console.WriteLine ("start value: {0}", var);
+ for (int i = 0; i < 10; ++i) {
+ var += 10;
+ Thread.Sleep (5);
+ }
+ Console.WriteLine ("end value: {0}", var);
+ if (var != 100)
+ tfailed = true;
+ }
+
+ static int Main () {
+ bool failed = false;
+ var = 10;
+ Thread thr = new Thread (new ThreadStart (thread));
+ thr.Start ();
+ if (var != 10)
+ failed = true;
+ var = 20;
+ Console.WriteLine ("value in main thread: {0}", var);
+ thr.Join ();
+ Console.WriteLine ("value in main thread after join: {0}", var);
+ if (var != 20)
+ failed = true;
+
+ if (failed)
+ return 1;
+ if (tfailed)
+ return 2;
+ return 0;
+ }
+}
diff --git a/mono/tests/thread6.cs b/mono/tests/thread6.cs
new file mode 100644
index 00000000000..eb7079637e1
--- /dev/null
+++ b/mono/tests/thread6.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Threading;
+
+public class MultiThreadExceptionTest {
+
+ public static int result = 0;
+
+ public static void ThreadStart1 () {
+ Console.WriteLine("{0} started",
+ Thread.CurrentThread.Name);
+
+ try {
+ try {
+ int i = 0;
+ try {
+ while (true) {
+ Console.WriteLine ("Count: " + i++);
+ Thread.Sleep (100);
+ }
+ } catch (ThreadAbortException e) {
+ Console.WriteLine ("cought exception level 2 " + e.ExceptionState);
+ Console.WriteLine (e);
+ if ((string)e.ExceptionState == "STATETEST")
+ result |= 1;
+ Thread.ResetAbort ();
+ throw e;
+ }
+ } catch (ThreadAbortException e) {
+ Console.WriteLine ("cought exception level 1 " + e.ExceptionState);
+ Console.WriteLine (e);
+ if (e.ExceptionState == null)
+ result |= 2;
+ }
+ } catch (Exception e) {
+ Console.WriteLine ("cought exception level 0");
+ Console.WriteLine (e);
+ result |= 4;
+ }
+
+ try {
+ Thread.ResetAbort ();
+ } catch (System.Threading.ThreadStateException e) {
+ result |= 8;
+ }
+
+ Console.WriteLine ("end");
+ result |= 16;
+ }
+
+ public static int Main() {
+ Thread t1 = new Thread(new ThreadStart
+ (MultiThreadExceptionTest.ThreadStart1));
+ t1.Name = "Thread 1";
+
+ Thread.Sleep (100);
+
+ t1.Start();
+
+ //Thread t0 = Thread.CurrentThread;
+ //t0.Abort ();
+
+ Thread.Sleep (200);
+ t1.Abort ("STATETEST");
+
+ t1.Join ();
+ Console.WriteLine ("Result: " + result);
+
+ if (result != 27)
+ return 1;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/threadpool.cs b/mono/tests/threadpool.cs
new file mode 100755
index 00000000000..cfcc6ee4c8a
--- /dev/null
+++ b/mono/tests/threadpool.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Threading;
+
+public class Test {
+
+ static int csum = 0;
+
+ public static void test_callback (object state) {
+ Console.WriteLine("test_casllback:" + state);
+ Thread.Sleep (200);
+ Interlocked.Increment (ref csum);
+ }
+
+ public static int Main () {
+ int workerThreads;
+ int completionPortThreads;
+
+ ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads);
+ Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);
+
+ ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
+ Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);
+
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST1");
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST2");
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST3");
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST4");
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST5");
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback));
+
+ while (csum < 6) {
+ Thread.Sleep (100);
+ }
+
+ Console.WriteLine ("CSUM: " + csum);
+
+ if (csum != 6)
+ return 1;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/threadpool1.cs b/mono/tests/threadpool1.cs
new file mode 100755
index 00000000000..ea3014a3da7
--- /dev/null
+++ b/mono/tests/threadpool1.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Threading;
+
+public class Test {
+
+ static int csum = 0;
+
+ public static void test_callback (object state) {
+ int workerThreads;
+ int completionPortThreads;
+ ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
+ Console.WriteLine("test_casllback:" + state + "ATH: " + workerThreads);
+ Thread.Sleep (10);
+
+ Interlocked.Increment (ref csum);
+ }
+
+ public static int Main () {
+ int workerThreads;
+ int completionPortThreads;
+ int runs = 10;
+
+ ThreadPool.GetMaxThreads (out workerThreads, out completionPortThreads);
+ Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);
+
+ ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
+ Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);
+
+ for (int i = 0; i < runs; i++) {
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST1 " + i);
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST2 " + i);
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST3 " + i);
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST4 " + i);
+ ThreadPool.QueueUserWorkItem (new WaitCallback (test_callback), "TEST5 " + i);
+
+ do {
+ ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
+ if (workerThreads == 0)
+ Thread.Sleep (100);
+ } while (workerThreads == 0);
+
+
+ ThreadPool.GetAvailableThreads (out workerThreads, out completionPortThreads);
+ Console.WriteLine ("workerThreads: {0} completionPortThreads: {1}", workerThreads, completionPortThreads);
+ }
+
+ while (csum < (runs * 5)) {
+ Thread.Sleep (100);
+
+ }
+
+ Console.WriteLine ("CSUM: " + csum);
+
+ if (csum != (runs * 5))
+ return 1;
+
+ return 0;
+ }
+}
+
diff --git a/mono/tests/typeof-ptr.cs b/mono/tests/typeof-ptr.cs
new file mode 100644
index 00000000000..69e75ca1745
--- /dev/null
+++ b/mono/tests/typeof-ptr.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Reflection;
+
+class T {
+ public static unsafe void meth (int a, int* b) {
+ }
+ static int Main () {
+ ParameterInfo[] args = typeof (T).GetMethod ("meth").GetParameters ();
+ if (args[0].ParameterType == args[1].ParameterType)
+ return 1;
+
+ unsafe {
+ if (typeof(int) == typeof (int*))
+ return 2;
+ }
+ if (args[0].ParameterType != typeof(int))
+ return 3;
+
+ unsafe {
+ if (args[1].ParameterType != typeof(int*))
+ return 4;
+ }
+
+ return 0;
+ }
+}
diff --git a/mono/tests/vararg.il b/mono/tests/vararg.il
new file mode 100644
index 00000000000..f501a8c4976
--- /dev/null
+++ b/mono/tests/vararg.il
@@ -0,0 +1,161 @@
+//
+// vararg.il: Tests for varargs and refany instructions
+//
+
+.assembly extern mscorlib {
+}
+
+.assembly extern TestDriver {
+}
+
+.assembly 'vararg' {
+}
+
+.module 'vararg'
+
+.class public auto ansi Tests extends [mscorlib]System.Object {
+
+ .method public static vararg void varargtest () cil managed {
+ .maxstack 16
+ .locals init (
+ valuetype [mscorlib]System.ArgIterator it
+ )
+
+ ldloca.s it
+ arglist
+ call instance void [mscorlib]System.ArgIterator::.ctor (valuetype [mscorlib]System.RuntimeArgumentHandle)
+ L0:
+ ldloca.s it
+ call instance int32 [mscorlib]System.ArgIterator::GetRemainingCount ()
+ ldc.i4.0
+ ceq
+ brtrue L1
+ ldloca.s it
+ call instance typedref [mscorlib]System.ArgIterator::GetNextArg ()
+ call object [mscorlib]System.TypedReference::ToObject (typedref)
+ call void [mscorlib]System.Console::WriteLine (object)
+ br.s L0
+ L1:
+ ret
+ }
+
+ // Test varargs
+ .method public static int32 test_0_varargs () cil managed {
+ .maxstack 16
+
+ ldc.i4.0
+ ldc.i4.1
+ call vararg void Tests::varargtest (..., int32, int32)
+ ldc.i4.0
+ ret
+ }
+
+ .method public static vararg int32 varargtest_refany () cil managed {
+ .maxstack 16
+ .locals init (
+ valuetype [mscorlib]System.ArgIterator it,
+ int32 sum
+ )
+
+ ldloca.s it
+ arglist
+ call instance void [mscorlib]System.ArgIterator::.ctor (valuetype [mscorlib]System.RuntimeArgumentHandle)
+ ldc.i4.0
+ stloc.s sum
+ L0:
+ ldloca.s it
+ call instance int32 [mscorlib]System.ArgIterator::GetRemainingCount ()
+ ldc.i4.0
+ ceq
+ brtrue L1
+ ldloca.s it
+ call instance typedref [mscorlib]System.ArgIterator::GetNextArg ()
+ ldloc.s sum
+ call void [mscorlib]System.Console::WriteLine (int32)
+ refanyval int32
+ ldind.i4
+ dup
+ call void [mscorlib]System.Console::WriteLine (int32)
+ ldloc.s sum
+ add
+ stloc.s sum
+ br.s L0
+ L1:
+ ldloc.s sum
+ ret
+ }
+
+ // Test varargs
+ .method public static int32 test_85_varargs_refany () cil managed {
+ .maxstack 16
+
+ ldc.i4 42
+ ldc.i4 43
+ call vararg int32 Tests::varargtest_refany (..., int32, int32)
+ ret
+ }
+
+ .method public static int32 test_0_refanytest () cil managed {
+ .maxstack 16
+ .locals init (
+ int32 sum,
+ typedref ref
+ )
+
+ ldloca.s sum
+ mkrefany int32
+ stloc.s ref
+
+ // Test refany with valid type
+ ldloc.s ref
+ refanyval int32
+ ldloca.s sum
+ ceq
+ brfalse ERR1
+
+ // Test refany with invalid type
+ .try {
+ ldloc.s ref
+ refanyval int64
+ pop
+ leave ERR2
+ }
+ catch [mscorlib]System.InvalidCastException {
+ pop
+ leave L_LEAVE
+ }
+ L_LEAVE:
+
+ // Test refanytype
+ ldloc.s ref
+ refanytype
+ call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle (valuetype [mscorlib]System.RuntimeTypeHandle)
+ ldtoken int32
+ call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle (valuetype [mscorlib]System.RuntimeTypeHandle)
+ ceq
+ brfalse ERR3
+
+ ldc.i4.0
+ ret
+ ERR1:
+ ldc.i4.1
+ ret
+ ERR2:
+ ldc.i4.2
+ ret
+ ERR3:
+ ldc.i4.3
+ ret
+ }
+
+ .method public static int32 Main () cil managed {
+ .maxstack 16
+ .entrypoint
+
+ ldtoken Tests
+ call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ call int32 class [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type)
+ ret
+
+ }
+} \ No newline at end of file
diff --git a/mono/utils/.cvsignore b/mono/utils/.cvsignore
index 051d1bd50ba..8550dbfc503 100644
--- a/mono/utils/.cvsignore
+++ b/mono/utils/.cvsignore
@@ -1,3 +1,6 @@
Makefile
Makefile.in
.deps
+.libs
+*.la
+*.lo
diff --git a/mono/utils/ChangeLog b/mono/utils/ChangeLog
index 9702e9e77d9..8bf8e30f086 100644
--- a/mono/utils/ChangeLog
+++ b/mono/utils/ChangeLog
@@ -1,3 +1,187 @@
+2004-10-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-codeman.c: Fall back to malloc if MAP_ANON is not defined.
+
+2004-09-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-codeman.c (new_codechunk): Set malloc'ed code pages as
+ executable.
+
+2004-09-07 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono-sha1.c: Remove uint32 and int32 types completely
+
+2004-09-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-codeman.c (new_codechunk): Remove g_assert_not_reached ().
+
+ * mono-codeman.c (new_codechunk): Fix windows build.
+
+ * mono-codeman.h mono-codeman.c: Generalize so it can be used to
+ allocate code for dynamic methods (one method per code manager).
+
+2004-07-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-logger.c (mono_trace_set_mask_string): Fix AOT tracing constant.
+
+2004-07-28 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-codeman.c (mono_code_manager_invalidate): Invalidate with
+ x86 break on AMD64 too.
+
+2004-07-23 zovarga <vargaz@freemail.hu>
+
+ * monobitset.c (my_g_bit_nth_msf): Add workaround for glib 2.2 bug on
+ 64 bit platforms.
+
+2004-07-09 Ben Maurer <bmaurer@ximain.com>
+
+ * mono-hash.c: register gc roots
+
+2004-07-02 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-logger.h mono-logger.c: Added AOT component.
+
+2004-06-30 Zoltan Varga <vargaz@freemail.hu>
+
+ * strtod.c: Use gint32 for 32 bit types.
+
+2004-06-29 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-sha1.c: Use gint32 for 32 types. Fixes random memory corruption
+ in SHA1Transform on 64 bit systems.
+
+2004-06-24 David Waite <mass@akuma.org>
+
+ * monobitset.c: change to C90-style comments from C99/C++-style
+
+2004-06-21 Atsushi Enomoto <atsushi@ximian.com>
+
+ * mono-sha1.c : close opened file in case of successful read. This
+ saves a bunch of System.Reflection Emit failures under windows.
+
+2004-06-18 Jackson Harper <jackson@ximian.com>
+
+ * mono-logger.c/h: Add a trace mask option for tracing loading
+ config files. A little white space love.
+
+2004-06-18 Jackson Harper <jackson@ximian.com>
+
+ * mono-logger.c: Change default logging level to ERROR. Make sure
+ that mono_trace_init is called if mono_tracev is our first trace
+ statement is mono_tracev. Little indentation fix.
+
+2004-05-25 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-codeman.c (mono_code_manager_invalidate): On x86, fill the
+ memory with 0xcc (x86 break).
+
+2004-05-02 Miguel de Icaza <miguel@ximian.com>
+
+ * mono-sha1.c: MacOS X defines "LITTLE_ENDIAN", you are supposed
+ to test against BYTE_ORDER, and this caused trouble. We now use
+ G_BYTE_ORDER and G_LITTLE_ENDIAN. This should fix the MacOS woes.
+
+2004-04-26 David Waite <mass@akuma.org>
+
+ * mono-logger.h: remove comma from end of enumeration declaration
+
+Fri Apr 23 11:04:33 EDT 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-codeman.c: macosx pretends an argument (which is ignored)
+ to be -1. Make sure the thunks area is zeroed.
+
+2004-03-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * monobitset.c (mono_bitset_test_bulk): New function to return multiple
+ bits at once.
+
+Thu Mar 4 15:46:20 PST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-codeman.c: add a define to force the use of malloc
+ instead of mmap.
+
+Tue Feb 17 21:45:12 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-codeman.c, mono-codeman.h: allocate extra room in memory close
+ to the native code for arch where calls have a limited immediate
+ displacement.
+
+Wed Feb 11 15:26:18 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Makefile.am, mono-codeman.h, mono-codeman.c: new support code
+ to deal with buffers of native code (handles exec bits and other
+ details).
+
+2004-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * strenc.c:
+ (mono_unicode_from_external): UTF8 is the default, not the preferred
+ encoding, ie, try MONO_EXTERNAL_ENCODINGS first. When "default_locale"
+ was passed in the env. var., it always failed because we were passing
+ "default_locale" to g_convert. Also fixed the byte count for non-UTF8
+ conversions.
+ (mono_utf8_from_external): UTF8 is the default, not the preferred one.
+
+ Fixes bug #53166.
+
+Thu Jan 8 19:56:08 CET 2004 Paolo Molaro <lupus@ximian.com>
+
+ * mono-uri.c: fixed compile problem.
+
+2003-12-02 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mono-math.c: fix for older C compilers and big endian machines
+
+2003-11-12 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-math.h mono-math.c: New file which contains implementations of
+ math functions/macros which are missing on some platforms.
+
+2003-11-10 Dick Porter <dick@ximian.com>
+
+ * strenc.c: Use platform-endian UTF16
+
+2003-10-28 Dick Porter <dick@ximian.com>
+
+ * strenc.h:
+ * strenc.c: New files, convert text to and from unicode or utf8,
+ and the user's chosen encoding.
+
+2003-08-26 Zoltan Varga <vargaz@freemail.hu>
+
+ * mono-hash.h mono-hash.c (mono_g_hash_table_remap): New function used
+ to remap hashtable values during a copying collection. Not used at the
+ moment.
+ * mono-hash.c (g_hash_node_new): Restructured to avoid the global lock
+ in the common case.
+ * mono-hash.c (mono_g_hash_table_new_full): Enable the optimization of
+ the key function even if the client supplied g_direct_equal instead of
+ NULL.
+
+2003-08-22 Duncan Mak <duncan@ximian.com>
+
+ * strtod.c: 64-bit related fixes from Laurent Morichetti
+ <l_m@pacbell.net>. Patch approval from Miguel.
+
+Fri Jun 6 19:09:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mono-logger.h, mono-logger.c, Makefile.am: added
+ selective logging code by Jerome Laban <jlaban@wanadoo.fr>.
+
+2003-03-05 Dietmar Maurer <dietmar@ximian.com>
+
+ * monobitset.c (mono_bitset_set_all): impl.
+
+Fri Sep 13 15:56:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * mono-digest.h, mono-sha1.c: Added mono_digest_get_public_token()
+ to get the public key token from a public key.
+
+Thu Jul 25 13:59:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * mono-digest.h, mono-md5.c, mono-sha1.c: MD5 and SHA1
+ implementations.
Mon Jun 3 15:59:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
diff --git a/mono/utils/Makefile.am b/mono/utils/Makefile.am
index 4d84e3cb635..77073464627 100644
--- a/mono/utils/Makefile.am
+++ b/mono/utils/Makefile.am
@@ -1,18 +1,31 @@
-lib_LIBRARIES = libmonoutils.a
+noinst_LTLIBRARIES = libmonoutils.la
-INCLUDES = $(GLIB_CFLAGS) $(GMODULE_CFLAGS) -I$(top_srcdir) -I$(top_srcdir)/mono
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS)
-libmonoutils_a_SOURCES = \
+libmonoutils_la_SOURCES = \
mono-hash.c \
- mono-hash.h \
- monobitset.h \
+ mono-md5.c \
+ mono-sha1.c \
+ mono-logger.c \
+ mono-codeman.c \
monobitset.c \
+ mono-math.c \
strtod.h \
- strtod.c
+ strtod.c \
+ strenc.h \
+ strenc.c \
+ mono-uri.c
libmonoutilsincludedir = $(includedir)/mono/utils
-libmonoutilsinclude_HEADERS =
+libmonoutilsinclude_HEADERS = \
+ monobitset.h \
+ mono-codeman.h \
+ mono-digest.h \
+ mono-logger.h \
+ mono-hash.h \
+ mono-math.h \
+ mono-uri.h
EXTRA_DIST = ChangeLog
diff --git a/mono/utils/mono-codeman.c b/mono/utils/mono-codeman.c
new file mode 100644
index 00000000000..b7b48125d37
--- /dev/null
+++ b/mono/utils/mono-codeman.c
@@ -0,0 +1,336 @@
+#include "config.h"
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef PLATFORM_WIN32
+#include <windows.h>
+#include <io.h>
+#else
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#endif
+
+#include "mono-codeman.h"
+
+#ifdef PLATFORM_WIN32
+#define FORCE_MALLOC
+#endif
+
+#define MIN_PAGES 8
+#define MIN_ALIGN 8
+/* if a chunk has less than this amount of free space it's considered full */
+#define MAX_WASTAGE 32
+
+#ifndef MAP_ANONYMOUS
+#ifdef MAP_ANON
+#define MAP_ANONYMOUS MAP_ANON
+#else
+#define FORCE_MALLOC
+#endif
+#endif
+
+typedef struct _CodeChunck CodeChunk;
+
+enum {
+ CODE_FLAG_MMAP,
+ CODE_FLAG_MALLOC
+};
+
+struct _CodeChunck {
+ char *data;
+ int pos;
+ int size;
+ CodeChunk *next;
+ unsigned int flags: 8;
+ /* this number of bytes is available to resolve addresses far in memory */
+ unsigned int bsize: 24;
+};
+
+struct _MonoCodeManager {
+ int dynamic;
+ CodeChunk *current;
+ CodeChunk *full;
+};
+
+MonoCodeManager*
+mono_code_manager_new (void)
+{
+ MonoCodeManager *cman = malloc (sizeof (MonoCodeManager));
+ if (!cman)
+ return NULL;
+ cman->current = NULL;
+ cman->full = NULL;
+ cman->dynamic = 0;
+ return cman;
+}
+
+MonoCodeManager*
+mono_code_manager_new_dynamic (void)
+{
+ MonoCodeManager *cman = mono_code_manager_new ();
+ cman->dynamic = 1;
+ return cman;
+}
+
+
+static void
+free_chunklist (CodeChunk *chunk)
+{
+ CodeChunk *dead;
+ for (; chunk; ) {
+ dead = chunk;
+ chunk = chunk->next;
+ if (dead->flags == CODE_FLAG_MMAP) {
+#ifndef FORCE_MALLOC
+ munmap (dead->data, dead->size);
+#endif
+ } else if (dead->flags == CODE_FLAG_MALLOC) {
+ free (dead->data);
+ }
+ free (dead);
+ }
+}
+
+void
+mono_code_manager_destroy (MonoCodeManager *cman)
+{
+ free_chunklist (cman->full);
+ free_chunklist (cman->current);
+ free (cman);
+}
+
+/* fill all the memory with the 0x2a (42) value */
+void
+mono_code_manager_invalidate (MonoCodeManager *cman)
+{
+ CodeChunk *chunk;
+
+#if defined(__i386__) || defined(__x86_64__)
+ int fill_value = 0xcc; /* x86 break */
+#else
+ int fill_value = 0x2a;
+#endif
+
+ for (chunk = cman->current; chunk; chunk = chunk->next)
+ memset (chunk->data, fill_value, chunk->size);
+ for (chunk = cman->full; chunk; chunk = chunk->next)
+ memset (chunk->data, fill_value, chunk->size);
+}
+
+void
+mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void *user_data)
+{
+ CodeChunk *chunk;
+ for (chunk = cman->current; chunk; chunk = chunk->next) {
+ if (func (chunk->data, chunk->size, chunk->bsize, user_data))
+ return;
+ }
+ for (chunk = cman->full; chunk; chunk = chunk->next) {
+ if (func (chunk->data, chunk->size, chunk->bsize, user_data))
+ return;
+ }
+}
+
+static int
+query_pagesize (void)
+{
+#ifdef PLATFORM_WIN32
+ SYSTEM_INFO info;
+ GetSystemInfo (&info);
+ return info.dwAllocationGranularity;
+#else
+ return getpagesize ();
+#endif
+}
+
+/* BIND_ROOM is the divisor for the chunck of code size dedicated
+ * to binding branches (branches not reachable with the immediate displacement)
+ * bind_size = size/BIND_ROOM;
+ * we should reduce it and make MIN_PAGES bigger for such systems
+ */
+#if defined(__ppc__) || defined(__powerpc__)
+#define BIND_ROOM 4
+#endif
+
+static CodeChunk*
+new_codechunk (int dynamic, int size)
+{
+ static int pagesize = 0;
+ int minsize, flags = CODE_FLAG_MMAP;
+ int chunk_size, bsize = 0;
+ CodeChunk *chunk;
+ void *ptr;
+
+#ifdef FORCE_MALLOC
+ flags = CODE_FLAG_MALLOC;
+#endif
+
+ if (dynamic) {
+ chunk_size = size;
+ flags = CODE_FLAG_MALLOC;
+ }
+ else {
+ if (!pagesize)
+ pagesize = query_pagesize ();
+
+ minsize = pagesize * MIN_PAGES;
+ if (size < minsize)
+ chunk_size = minsize;
+ else {
+ chunk_size = size;
+ chunk_size += pagesize - 1;
+ chunk_size &= ~ (pagesize - 1);
+ }
+ }
+#ifdef BIND_ROOM
+ bsize = chunk_size / BIND_ROOM;
+ if (chunk_size - size < bsize) {
+ if (dynamic)
+ chunk_size = size + bsize;
+ else
+ chunk_size += pagesize;
+ }
+#endif
+
+ /* does it make sense to use the mmap-like API? */
+ if (flags == CODE_FLAG_MALLOC) {
+ ptr = malloc (chunk_size);
+ if (!ptr)
+ return NULL;
+
+ }
+ else {
+#ifndef FORCE_MALLOC
+ ptr = mmap (0, chunk_size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
+ if (ptr == (void*)-1) {
+ int fd = open ("/dev/zero", O_RDONLY);
+ if (fd != -1) {
+ ptr = mmap (0, chunk_size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);
+ close (fd);
+ }
+ if (ptr == (void*)-1) {
+ ptr = malloc (chunk_size);
+ if (!ptr)
+ return NULL;
+ flags = CODE_FLAG_MALLOC;
+ }
+ }
+#else
+ return NULL;
+#endif
+ }
+
+ if (flags == CODE_FLAG_MALLOC) {
+ /*
+ * AMD64 processors maintain icache coherency only for pages which are
+ * marked executable.
+ */
+#ifndef PLATFORM_WIN32
+ {
+ char *page_start = (char *) (((unsigned long long) (ptr)) & ~ (pagesize - 1));
+ int pages = ((char*)ptr + chunk_size - page_start + pagesize - 1) / pagesize;
+ int err = mprotect (page_start, pages * pagesize, PROT_READ | PROT_WRITE | PROT_EXEC);
+ assert (!err);
+ }
+#else
+ {
+ DWORD oldp;
+ int err = VirtualProtect (ptr, chunk_size, PAGE_EXECUTE_READWRITE, &oldp);
+ assert (err);
+ }
+#endif
+
+ /* Make sure the thunks area is zeroed */
+ memset (ptr, 0, bsize);
+ }
+
+ chunk = malloc (sizeof (CodeChunk));
+ if (!chunk) {
+ if (flags == CODE_FLAG_MALLOC)
+ free (ptr);
+#ifndef FORCE_MALLOC
+ else
+ munmap (ptr, chunk_size);
+#endif
+ return NULL;
+ }
+ chunk->next = NULL;
+ chunk->size = chunk_size;
+ chunk->data = ptr;
+ chunk->flags = flags;
+ chunk->pos = bsize;
+ chunk->bsize = bsize;
+
+ /*printf ("code chunk at: %p\n", ptr);*/
+ return chunk;
+}
+
+void*
+mono_code_manager_reserve (MonoCodeManager *cman, int size)
+{
+ CodeChunk *chunk, *prev;
+ void *ptr;
+
+ size += MIN_ALIGN;
+ size &= ~ (MIN_ALIGN - 1);
+
+ if (!cman->current) {
+ cman->current = new_codechunk (cman->dynamic, size);
+ if (!cman->current)
+ return NULL;
+ }
+
+ for (chunk = cman->current; chunk; chunk = chunk->next) {
+ if (chunk->pos + size <= chunk->size) {
+ ptr = chunk->data + chunk->pos;
+ chunk->pos += size;
+ return ptr;
+ }
+ }
+ /*
+ * no room found, move one filled chunk to cman->full
+ * to keep cman->current from growing too much
+ */
+ prev = NULL;
+ for (chunk = cman->current; chunk; prev = chunk, chunk = chunk->next) {
+ if (chunk->pos + MIN_ALIGN * 4 <= chunk->size)
+ continue;
+ if (prev) {
+ prev->next = chunk->next;
+ } else {
+ cman->current = chunk->next;
+ }
+ chunk->next = cman->full;
+ cman->full = chunk;
+ break;
+ }
+ chunk = new_codechunk (cman->dynamic, size);
+ if (!chunk)
+ return NULL;
+ chunk->next = cman->current;
+ cman->current = chunk;
+ chunk->pos += size;
+ return chunk->data;
+}
+
+/*
+ * if we reserved too much room for a method and we didn't allocate
+ * already from the code manager, we can get back the excess allocation.
+ */
+void
+mono_code_manager_commit (MonoCodeManager *cman, void *data, int size, int newsize)
+{
+ newsize += MIN_ALIGN;
+ newsize &= ~ (MIN_ALIGN - 1);
+ size += MIN_ALIGN;
+ size &= ~ (MIN_ALIGN - 1);
+
+ if (cman->current && (size != newsize) && (data == cman->current->data + cman->current->pos - size)) {
+ cman->current->pos -= size - newsize;
+ }
+}
+
diff --git a/mono/utils/mono-codeman.h b/mono/utils/mono-codeman.h
new file mode 100644
index 00000000000..a35cbd83d80
--- /dev/null
+++ b/mono/utils/mono-codeman.h
@@ -0,0 +1,20 @@
+#ifndef __MONO_CODEMAN_H__
+#define __MONO_CODEMAN_H__
+
+typedef struct _MonoCodeManager MonoCodeManager;
+
+MonoCodeManager* mono_code_manager_new (void);
+MonoCodeManager* mono_code_manager_new_dynamic (void);
+void mono_code_manager_destroy (MonoCodeManager *cman);
+void mono_code_manager_invalidate (MonoCodeManager *cman);
+
+void* mono_code_manager_reserve (MonoCodeManager *cman, int size);
+void mono_code_manager_commit (MonoCodeManager *cman, void *data, int size, int newsize);
+
+/* find the extra block allocated to resolve branches close to code */
+typedef int (*MonoCodeManagerFunc) (void *data, int csize, int size, void *user_data);
+void mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void *user_data);
+
+
+#endif /* __MONO_CODEMAN_H__ */
+
diff --git a/mono/utils/mono-digest.h b/mono/utils/mono-digest.h
new file mode 100644
index 00000000000..1ff698f5051
--- /dev/null
+++ b/mono/utils/mono-digest.h
@@ -0,0 +1,64 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest. This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to rpmMD5Init, call rpmMD5Update as
+ * needed on buffers full of bytes, and then call rpmMD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+
+/* parts of this file are :
+ * Written March 1993 by Branko Lankester
+ * Modified June 1993 by Colin Plumb for altered md5.c.
+ * Modified October 1995 by Erik Troan for RPM
+ */
+
+
+#ifndef __MONO_DIGEST_H__
+#define __MONO_DIGEST_H__
+
+#include <glib.h>
+
+typedef struct {
+ guint32 buf[4];
+ guint32 bits[2];
+ guchar in[64];
+ gint doByteReverse;
+} MonoMD5Context;
+
+void mono_md5_get_digest (const gchar *buffer, gint buffer_size, guchar digest[16]);
+
+/* use this one when speed is needed */
+/* for use in provider code only */
+void mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16]);
+
+/* raw routines */
+void mono_md5_init (MonoMD5Context *ctx);
+void mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len);
+void mono_md5_final (MonoMD5Context *ctx, guchar digest[16]);
+
+typedef struct {
+ guint32 state[5];
+ guint32 count[2];
+ unsigned char buffer[64];
+} MonoSHA1Context;
+
+void mono_sha1_get_digest (const gchar *buffer, gint buffer_size, guchar digest [20]);
+void mono_sha1_get_digest_from_file (const gchar *filename, guchar digest [20]);
+
+void mono_sha1_init (MonoSHA1Context* context);
+void mono_sha1_update (MonoSHA1Context* context, const guchar* data, guint32 len);
+void mono_sha1_final (MonoSHA1Context* context, unsigned char digest[20]);
+
+void mono_digest_get_public_token (guchar* token, const guchar *pubkey, guint32 len);
+
+#endif /* __MONO_DIGEST_H__ */
diff --git a/mono/utils/mono-hash.c b/mono/utils/mono-hash.c
index 4dbba68f3e8..bd3479836e1 100644
--- a/mono/utils/mono-hash.c
+++ b/mono/utils/mono-hash.c
@@ -37,9 +37,7 @@
#endif
#include <glib.h>
-#if HAVE_BOEHM_GC
-#include <gc/gc.h>
-#endif
+#include <mono/os/gc_wrapper.h>
#include "mono-hash.h"
#define HASH_TABLE_MIN_SIZE 11
@@ -149,20 +147,25 @@ mono_g_hash_table_new_full (GHashFunc hash_func,
GDestroyNotify value_destroy_func)
{
MonoGHashTable *hash_table;
+ static gboolean inited = FALSE;
+ if (!inited) {
+ MONO_GC_REGISTER_ROOT (node_free_list);
+ inited = TRUE;
+ }
#if HAVE_BOEHM_GC
- hash_table = GC_malloc (sizeof (MonoGHashTable));
+ hash_table = GC_MALLOC (sizeof (MonoGHashTable));
#else
hash_table = g_new (MonoGHashTable, 1);
#endif
hash_table->size = HASH_TABLE_MIN_SIZE;
hash_table->nnodes = 0;
hash_table->hash_func = hash_func ? hash_func : g_direct_hash;
- hash_table->key_equal_func = key_equal_func;
+ hash_table->key_equal_func = key_equal_func == g_direct_equal ? NULL : key_equal_func;
hash_table->key_destroy_func = key_destroy_func;
hash_table->value_destroy_func = value_destroy_func;
#if HAVE_BOEHM_GC
- hash_table->nodes = GC_malloc (sizeof (MonoGHashNode*) * hash_table->size);
+ hash_table->nodes = GC_MALLOC (sizeof (MonoGHashNode*) * hash_table->size);
#else
hash_table->nodes = g_new0 (MonoGHashNode*, hash_table->size);
#endif
@@ -283,6 +286,50 @@ mono_g_hash_table_lookup_extended (MonoGHashTable *hash_table,
return FALSE;
}
+static inline MonoGHashNode*
+g_hash_node_new (gpointer key,
+ gpointer value)
+{
+ MonoGHashNode *hash_node = NULL;
+
+#if HAVE_BOEHM_GC
+ if (node_free_list) {
+ G_LOCK (g_hash_global);
+
+ if (node_free_list) {
+ hash_node = node_free_list;
+ node_free_list = node_free_list->next;
+ }
+ G_UNLOCK (g_hash_global);
+ }
+ if (!hash_node)
+ hash_node = GC_MALLOC (sizeof (MonoGHashNode));
+#else
+ G_LOCK (g_hash_global);
+ if (node_free_list)
+ {
+ hash_node = node_free_list;
+ node_free_list = node_free_list->next;
+ }
+ else
+ {
+ if (!node_mem_chunk)
+ node_mem_chunk = g_mem_chunk_new ("hash node mem chunk",
+ sizeof (MonoGHashNode),
+ 1024, G_ALLOC_ONLY);
+
+ hash_node = g_chunk_new (MonoGHashNode, node_mem_chunk);
+ }
+ G_UNLOCK (g_hash_global);
+#endif
+
+ hash_node->key = key;
+ hash_node->value = value;
+ hash_node->next = NULL;
+
+ return hash_node;
+}
+
/**
* g_hash_table_insert:
* @hash_table: a #GHashTable.
@@ -591,6 +638,30 @@ mono_g_hash_table_size (MonoGHashTable *hash_table)
return hash_table->nnodes;
}
+/**
+ * mono_g_hash_table_remap:
+ *
+ * Calls the given function for each key-value pair in the hash table,
+ * and replaces the value stored in the hash table by the value returned by
+ * the function.
+ *
+ **/
+void
+mono_g_hash_table_remap (MonoGHashTable *hash_table,
+ MonoGRemapperFunc func,
+ gpointer user_data)
+{
+ MonoGHashNode *node;
+ gint i;
+
+ g_return_if_fail (hash_table != NULL);
+ g_return_if_fail (func != NULL);
+
+ for (i = 0; i < hash_table->size; i++)
+ for (node = hash_table->nodes[i]; node; node = node->next)
+ node->value = (* func) (node->key, node->value, user_data);
+}
+
static void
g_hash_table_resize (MonoGHashTable *hash_table)
{
@@ -605,7 +676,7 @@ g_hash_table_resize (MonoGHashTable *hash_table)
new_size = CLAMP (new_size, HASH_TABLE_MIN_SIZE, HASH_TABLE_MAX_SIZE);
#if HAVE_BOEHM_GC
- new_nodes = GC_malloc (sizeof (MonoGHashNode*) * new_size);
+ new_nodes = GC_MALLOC (sizeof (MonoGHashNode*) * new_size);
#else
new_nodes = g_new0 (MonoGHashNode*, new_size);
#endif
@@ -629,40 +700,6 @@ g_hash_table_resize (MonoGHashTable *hash_table)
hash_table->size = new_size;
}
-static MonoGHashNode*
-g_hash_node_new (gpointer key,
- gpointer value)
-{
- MonoGHashNode *hash_node;
-
- G_LOCK (g_hash_global);
- if (node_free_list)
- {
- hash_node = node_free_list;
- node_free_list = node_free_list->next;
- }
- else
- {
-#if HAVE_BOEHM_GC
- hash_node = GC_malloc (sizeof (MonoGHashNode));
-#else
- if (!node_mem_chunk)
- node_mem_chunk = g_mem_chunk_new ("hash node mem chunk",
- sizeof (MonoGHashNode),
- 1024, G_ALLOC_ONLY);
-
- hash_node = g_chunk_new (MonoGHashNode, node_mem_chunk);
-#endif
- }
- G_UNLOCK (g_hash_global);
-
- hash_node->key = key;
- hash_node->value = value;
- hash_node->next = NULL;
-
- return hash_node;
-}
-
static void
g_hash_node_destroy (MonoGHashNode *hash_node,
GDestroyNotify key_destroy_func,
diff --git a/mono/utils/mono-hash.h b/mono/utils/mono-hash.h
index c76f7ca2620..29e9c621e14 100644
--- a/mono/utils/mono-hash.h
+++ b/mono/utils/mono-hash.h
@@ -39,6 +39,9 @@ G_BEGIN_DECLS
typedef struct _MonoGHashTable MonoGHashTable;
+typedef gpointer (*MonoGRemapperFunc) (gpointer key, gpointer value,
+ gpointer user_data);
+
/* Hash tables
*/
MonoGHashTable* mono_g_hash_table_new (GHashFunc hash_func,
@@ -75,6 +78,10 @@ guint mono_g_hash_table_foreach_steal (MonoGHashTable *hash_table,
gpointer user_data);
guint mono_g_hash_table_size (MonoGHashTable *hash_table);
+void mono_g_hash_table_remap (MonoGHashTable *hash_table,
+ MonoGRemapperFunc func,
+ gpointer user_data);
+
G_END_DECLS
#endif /* __MONO_G_HASH_H__ */
diff --git a/mono/utils/mono-logger.c b/mono/utils/mono-logger.c
new file mode 100644
index 00000000000..5bf36d5d7e7
--- /dev/null
+++ b/mono/utils/mono-logger.c
@@ -0,0 +1,241 @@
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <glib.h>
+
+#include "mono-logger.h"
+
+typedef struct {
+ GLogLevelFlags level;
+ MonoTraceMask mask;
+} MonoLogLevelEntry;
+
+static GLogLevelFlags current_level = G_LOG_LEVEL_ERROR;
+static MonoTraceMask current_mask = MONO_TRACE_ALL;
+
+static const char *mono_log_domain = "Mono";
+static GQueue *level_stack = NULL;
+
+/**
+ * mono_trace_init:
+ *
+ * Initializes the mono tracer.
+ */
+static void
+mono_trace_init (void)
+{
+ if(level_stack == NULL) {
+ level_stack = g_queue_new();
+
+ mono_trace_set_mask_string(getenv("MONO_LOG_MASK"));
+ mono_trace_set_level_string(getenv("MONO_LOG_LEVEL"));
+ }
+}
+
+/**
+ * mono_trace_cleanup:
+ *
+ * Releases the mono tracer.
+ */
+void
+mono_trace_cleanup (void)
+{
+ if(level_stack != NULL) {
+ while(!g_queue_is_empty (level_stack)) {
+ g_free (g_queue_pop_head (level_stack));
+ }
+
+ g_queue_free (level_stack);
+ level_stack = NULL;
+ }
+}
+
+/**
+ * mono_trace:
+ *
+ * @level: Verbose level of the specified message
+ * @mask: Type of the specified message
+ *
+ * Traces a new message, depending on the current logging level
+ * and trace mask.
+ */
+void
+mono_trace(GLogLevelFlags level, MonoTraceMask mask, const char *format, ...)
+{
+ if(level_stack == NULL)
+ mono_trace_init();
+
+ if(level <= current_level && mask & current_mask) {
+ va_list args;
+ va_start (args, format);
+ g_logv (mono_log_domain, level, format, args);
+ va_end (args);
+ }
+}
+
+/**
+ * mono_tracev:
+ *
+ * @level: Verbose level of the specified message
+ * @mask: Type of the specified message
+ *
+ * Traces a new message, depending on the current logging level
+ * and trace mask.
+ */
+void
+mono_tracev (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args)
+{
+ if (level_stack == NULL)
+ mono_trace_init ();
+
+ if(level <= current_level && mask & current_mask)
+ g_logv (mono_log_domain, level, format, args);
+}
+
+/**
+ * mono_trace_set_level:
+ *
+ * @level: Verbose level to set
+ *
+ * Sets the current logging level. Every subsequent call to
+ * mono_trace will check the visibility of a message against this
+ * value.
+ */
+void
+mono_trace_set_level (GLogLevelFlags level)
+{
+ if(level_stack == NULL)
+ mono_trace_init();
+
+ current_level = level;
+}
+
+/**
+ * mono_trace_set_mask:
+ *
+ * @mask: Mask of visible message types.
+ *
+ * Sets the current logging level. Every subsequent call to
+ * mono_trace will check the visibility of a message against this
+ * value.
+ */
+void
+mono_trace_set_mask (MonoTraceMask mask)
+{
+ if(level_stack == NULL)
+ mono_trace_init();
+
+ current_mask = mask;
+}
+
+/**
+ * mono_trace_push:
+ *
+ * @level: Verbose level to set
+ * @mask: Mask of visible message types.
+ *
+ * Saves the current values of level and mask then calls mono_trace_set
+ * with the specified new values.
+ */
+void
+mono_trace_push (GLogLevelFlags level, MonoTraceMask mask)
+{
+ if(level_stack == NULL)
+ g_error(G_GNUC_PRETTY_FUNCTION ": cannot use mono_trace_push without calling mono_trace_init first.");
+ else {
+ MonoLogLevelEntry *entry = g_malloc(sizeof(MonoLogLevelEntry));
+ entry->level = current_level;
+ entry->mask = current_mask;
+
+ g_queue_push_head (level_stack, (gpointer)entry);
+
+ /* Set the new level and mask
+ */
+ current_level = level;
+ current_mask = mask;
+ }
+}
+
+/**
+ * mono_trace_pop:
+ *
+ * Restores level and mask values saved from a previous call to mono_trace_push.
+ */
+void
+mono_trace_pop (void)
+{
+ if(level_stack == NULL)
+ g_error(G_GNUC_PRETTY_FUNCTION ": cannot use mono_trace_pop without calling mono_trace_init first.");
+ else {
+ if(!g_queue_is_empty (level_stack)) {
+ MonoLogLevelEntry *entry = (MonoLogLevelEntry*)g_queue_pop_head (level_stack);
+
+ /* Restore previous level and mask
+ */
+ current_level = entry->level;
+ current_mask = entry->mask;
+
+ g_free (entry);
+ }
+ }
+}
+
+
+void
+mono_trace_set_level_string (const char *value)
+{
+ int i = 0;
+ const char *valid_vals[] = {"error", "critical", "warning", "message", "info", "debug", NULL};
+ const GLogLevelFlags valid_ids[] = {G_LOG_LEVEL_ERROR, G_LOG_LEVEL_CRITICAL, G_LOG_LEVEL_WARNING,
+ G_LOG_LEVEL_MESSAGE, G_LOG_LEVEL_INFO, G_LOG_LEVEL_DEBUG };
+
+ if(!value)
+ return;
+
+ while(valid_vals[i]) {
+ if(!strcmp(valid_vals[i], value)){
+ mono_trace_set_level(valid_ids[i]);
+ return;
+ }
+ i++;
+ }
+
+ if(*value)
+ g_print("Unknown trace loglevel: %s\n", value);
+}
+
+void
+mono_trace_set_mask_string (char *value)
+{
+ int i;
+ char *tok;
+ guint32 flags = 0;
+
+ const char *valid_flags[] = {"asm", "type", "dll", "gc", "cfg", "aot", "all", NULL};
+ const MonoTraceMask valid_masks[] = {MONO_TRACE_ASSEMBLY, MONO_TRACE_TYPE, MONO_TRACE_DLLIMPORT,
+ MONO_TRACE_GC, MONO_TRACE_CONFIG, MONO_TRACE_AOT, MONO_TRACE_ALL };
+
+ if(!value)
+ return;
+
+ tok = strtok (value, ",");
+
+ if(!tok)
+ tok = value;
+
+ while (tok) {
+ for (i = 0; valid_flags[i]; i++) {
+ if (strcmp (tok, valid_flags[i]) == 0) {
+ flags |= valid_masks[i];
+ break;
+ }
+ }
+ if (!valid_flags[i])
+ g_print("Unknown trace flag: %s\n", tok);
+
+ tok = strtok (NULL, ",");
+ }
+
+ if(flags)
+ mono_trace_set_mask (flags);
+}
diff --git a/mono/utils/mono-logger.h b/mono/utils/mono-logger.h
new file mode 100644
index 00000000000..f5984ea50d4
--- /dev/null
+++ b/mono/utils/mono-logger.h
@@ -0,0 +1,92 @@
+#ifndef __MONO_LOGGER_H__
+#define __MONO_LOGGER_H__
+
+#include <glib.h>
+
+typedef enum {
+ MONO_TRACE_ASSEMBLY = (1<<0),
+ MONO_TRACE_TYPE = (1<<1),
+ MONO_TRACE_DLLIMPORT = (1<<2),
+ MONO_TRACE_GC = (1<<3),
+ MONO_TRACE_CONFIG = (1<<4),
+ MONO_TRACE_AOT = (1<<5),
+ MONO_TRACE_ALL = MONO_TRACE_ASSEMBLY |
+ MONO_TRACE_TYPE |
+ MONO_TRACE_DLLIMPORT |
+ MONO_TRACE_GC |
+ MONO_TRACE_CONFIG |
+ MONO_TRACE_AOT
+} MonoTraceMask;
+
+void
+mono_trace_cleanup (void);
+
+void
+mono_trace (GLogLevelFlags level, MonoTraceMask mask, const char *format, ...);
+
+void
+mono_tracev (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args);
+
+void
+mono_trace_set_level (GLogLevelFlags level);
+
+void
+mono_trace_set_level_string (const char *value);
+
+void
+mono_trace_set_mask (MonoTraceMask mask);
+
+void
+mono_trace_set_mask_string (char *value);
+
+void
+mono_trace_push (GLogLevelFlags level, MonoTraceMask mask);
+
+void
+mono_trace_pop (void);
+
+#ifdef G_HAVE_ISO_VARARGS
+#define mono_trace_error(...) mono_trace(G_LOG_LEVEL_ERROR, \
+ __VA_ARGS__)
+#define mono_trace_warning(...) mono_trace(G_LOG_LEVEL_WARNING, \
+ __VA_ARGS__)
+#define mono_trace_message(...) mono_trace(G_LOG_LEVEL_MESSAGE, \
+ __VA_ARGS__)
+#elif defined(G_HAVE_GNUC_VARARGS)
+#define mono_trace_error(format...) mono_trace(G_LOG_LEVEL_ERROR, \
+ format)
+#define mono_trace_warning(format...) mono_trace(G_LOG_LEVEL_WARNING, \
+ format)
+#define mono_trace_message(format...) mono_trace(G_LOG_LEVEL_MESSAGE, \
+ format)
+#else /* no varargs macros */
+static void
+mono_trace_error(MonoTraceMask mask, const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ mono_tracev(G_LOG_LEVEL_ERROR, mask, format, args);
+ va_end (args);
+}
+
+static void
+mono_trace_warning(MonoTraceMask mask, const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ mono_tracev(G_LOG_LEVEL_WARNING, mask, format, args);
+ va_end (args);
+}
+
+static void
+mono_trace_message(MonoTraceMask mask, const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ mono_tracev(G_LOG_LEVEL_MESSAGE, mask, format, args);
+ va_end (args);
+}
+
+#endif /* !__GNUC__ */
+
+#endif /* __MONO_LOGGER_H__ */
diff --git a/mono/utils/mono-math.c b/mono/utils/mono-math.c
new file mode 100644
index 00000000000..f75064ba3c1
--- /dev/null
+++ b/mono/utils/mono-math.c
@@ -0,0 +1,30 @@
+
+#include "mono-math.h"
+
+#ifndef HAVE_SIGNBIT
+
+int
+mono_signbit_float (float x)
+{
+ union { float f; int i; } u;
+
+ u.f = x;
+
+ return u.i < 0;
+}
+
+int
+mono_signbit_double (double x)
+{
+ union { double d; int i[2]; } u;
+
+ u.d = x;
+
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+ return u.i [1] < 0;
+#else
+ return u.i [0] < 0;
+#endif
+}
+
+#endif
diff --git a/mono/utils/mono-math.h b/mono/utils/mono-math.h
new file mode 100644
index 00000000000..90d14b6c611
--- /dev/null
+++ b/mono/utils/mono-math.h
@@ -0,0 +1,20 @@
+
+#ifndef __MONO_SIGNBIT_H__
+#define __MONO_SIGNBIT_H__
+
+#include <math.h>
+
+#ifdef HAVE_SIGNBIT
+#define mono_signbit signbit
+#else
+#define mono_signbit(x) (sizeof (x) == sizeof (float) ? mono_signbit_float (x) : mono_signbit_double (x))
+
+int
+mono_signbit_double (double x);
+
+int
+mono_signbit_float (float x);
+
+#endif
+
+#endif
diff --git a/mono/utils/mono-md5.c b/mono/utils/mono-md5.c
new file mode 100644
index 00000000000..28adc408fd8
--- /dev/null
+++ b/mono/utils/mono-md5.c
@@ -0,0 +1,357 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest. This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MonoMD5Context structure, pass it to mono_md5_init, call mono_md5_update as
+ * needed on buffers full of bytes, and then call md5_Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+
+/* parts of this file are :
+ * Written March 1993 by Branko Lankester
+ * Modified June 1993 by Colin Plumb for altered md5.c.
+ * Modified October 1995 by Erik Troan for RPM
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include "mono-digest.h"
+
+static void md5_transform (guint32 buf[4], const guint32 in[16]);
+
+static gint _ie = 0x44332211;
+static union _endian { gint i; gchar b[4]; } *_endian = (union _endian *)&_ie;
+#define IS_BIG_ENDIAN() (_endian->b[0] == '\x44')
+#define IS_LITTLE_ENDIAN() (_endian->b[0] == '\x11')
+
+
+/*
+ * Note: this code is harmless on little-endian machines.
+ */
+static void
+_byte_reverse (guchar *buf, guint32 longs)
+{
+ guint32 t;
+ do {
+ t = (guint32) ((guint32) buf[3] << 8 | buf[2]) << 16 |
+ ((guint32) buf[1] << 8 | buf[0]);
+ *(guint32 *) buf = t;
+ buf += 4;
+ } while (--longs);
+}
+
+/**
+ * mono_md5_init: Initialise an md5 context object
+ * @ctx: md5 context
+ *
+ * Initialise an md5 buffer.
+ *
+ **/
+void
+mono_md5_init (MonoMD5Context *ctx)
+{
+ ctx->buf[0] = 0x67452301;
+ ctx->buf[1] = 0xefcdab89;
+ ctx->buf[2] = 0x98badcfe;
+ ctx->buf[3] = 0x10325476;
+
+ ctx->bits[0] = 0;
+ ctx->bits[1] = 0;
+
+ if (IS_BIG_ENDIAN())
+ ctx->doByteReverse = 1;
+ else
+ ctx->doByteReverse = 0;
+}
+
+
+
+/**
+ * mono_md5_update: add a buffer to md5 hash computation
+ * @ctx: conetxt object used for md5 computaion
+ * @buf: buffer to add
+ * @len: buffer length
+ *
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes. Use this to progressively construct an md5 hash.
+ **/
+void
+mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len)
+{
+ guint32 t;
+
+ /* Update bitcount */
+
+ t = ctx->bits[0];
+ if ((ctx->bits[0] = t + ((guint32) len << 3)) < t)
+ ctx->bits[1]++; /* Carry from low to high */
+ ctx->bits[1] += len >> 29;
+
+ t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
+
+ /* Handle any leading odd-sized chunks */
+
+ if (t) {
+ guchar *p = (guchar *) ctx->in + t;
+
+ t = 64 - t;
+ if (len < t) {
+ memcpy (p, buf, len);
+ return;
+ }
+ memcpy (p, buf, t);
+ if (ctx->doByteReverse)
+ _byte_reverse (ctx->in, 16);
+ md5_transform (ctx->buf, (guint32 *) ctx->in);
+ buf += t;
+ len -= t;
+ }
+ /* Process data in 64-byte chunks */
+
+ while (len >= 64) {
+ memcpy (ctx->in, buf, 64);
+ if (ctx->doByteReverse)
+ _byte_reverse (ctx->in, 16);
+ md5_transform (ctx->buf, (guint32 *) ctx->in);
+ buf += 64;
+ len -= 64;
+ }
+
+ /* Handle any remaining bytes of data. */
+
+ memcpy (ctx->in, buf, len);
+}
+
+
+
+
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+/**
+ * mono_md5_final: copy the final md5 hash to a bufer
+ * @digest: 16 bytes buffer
+ * @ctx: context containing the calculated md5
+ *
+ * copy the final md5 hash to a bufer
+ **/
+void
+mono_md5_final (MonoMD5Context *ctx, guchar digest[16])
+{
+ guint32 count;
+ guchar *p;
+
+ /* Compute number of bytes mod 64 */
+ count = (ctx->bits[0] >> 3) & 0x3F;
+
+ /* Set the first char of padding to 0x80. This is safe since there is
+ always at least one byte free */
+ p = ctx->in + count;
+ *p++ = 0x80;
+
+ /* Bytes of padding needed to make 64 bytes */
+ count = 64 - 1 - count;
+
+ /* Pad out to 56 mod 64 */
+ if (count < 8) {
+ /* Two lots of padding: Pad the first block to 64 bytes */
+ memset (p, 0, count);
+ if (ctx->doByteReverse)
+ _byte_reverse (ctx->in, 16);
+ md5_transform (ctx->buf, (guint32 *) ctx->in);
+
+ /* Now fill the next block with 56 bytes */
+ memset (ctx->in, 0, 56);
+ } else {
+ /* Pad block to 56 bytes */
+ memset (p, 0, count - 8);
+ }
+ if (ctx->doByteReverse)
+ _byte_reverse (ctx->in, 14);
+
+ /* Append length in bits and transform */
+ ((guint32 *) ctx->in)[14] = ctx->bits[0];
+ ((guint32 *) ctx->in)[15] = ctx->bits[1];
+
+ md5_transform (ctx->buf, (guint32 *) ctx->in);
+ if (ctx->doByteReverse)
+ _byte_reverse ((guchar *) ctx->buf, 4);
+ memcpy (digest, ctx->buf, 16);
+}
+
+
+
+
+/* The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+/* This is the central step in the MD5 algorithm. */
+#define MD5STEP(f, w, x, y, z, data, s) \
+ ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data. md5_Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+static void
+md5_transform (guint32 buf[4], const guint32 in[16])
+{
+ register guint32 a, b, c, d;
+
+ a = buf[0];
+ b = buf[1];
+ c = buf[2];
+ d = buf[3];
+
+ MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+ MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+ MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17);
+ MD5STEP (F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+ MD5STEP (F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+ MD5STEP (F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+ MD5STEP (F1, c, d, a, b, in[6] + 0xa8304613, 17);
+ MD5STEP (F1, b, c, d, a, in[7] + 0xfd469501, 22);
+ MD5STEP (F1, a, b, c, d, in[8] + 0x698098d8, 7);
+ MD5STEP (F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+ MD5STEP (F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+ MD5STEP (F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+ MD5STEP (F1, a, b, c, d, in[12] + 0x6b901122, 7);
+ MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
+ MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
+ MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+ MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+ MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9);
+ MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+ MD5STEP (F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+ MD5STEP (F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+ MD5STEP (F2, d, a, b, c, in[10] + 0x02441453, 9);
+ MD5STEP (F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+ MD5STEP (F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+ MD5STEP (F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+ MD5STEP (F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+ MD5STEP (F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+ MD5STEP (F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+ MD5STEP (F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+ MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+ MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+ MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+ MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+ MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11);
+ MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+ MD5STEP (F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+ MD5STEP (F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+ MD5STEP (F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+ MD5STEP (F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+ MD5STEP (F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+ MD5STEP (F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+ MD5STEP (F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+ MD5STEP (F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+ MD5STEP (F3, b, c, d, a, in[6] + 0x04881d05, 23);
+ MD5STEP (F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+ MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+ MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+ MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+ MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6);
+ MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10);
+ MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+ MD5STEP (F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+ MD5STEP (F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+ MD5STEP (F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+ MD5STEP (F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+ MD5STEP (F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+ MD5STEP (F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+ MD5STEP (F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+ MD5STEP (F4, c, d, a, b, in[6] + 0xa3014314, 15);
+ MD5STEP (F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+ MD5STEP (F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+ MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+ MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+ MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
+}
+
+
+
+
+/**
+ * mono_md5_get_digest: get the md5 hash of a buffer
+ * @buffer: byte buffer
+ * @buffer_size: buffer size (in bytes)
+ * @digest: 16 bytes buffer receiving the hash code.
+ *
+ * Get the md5 hash of a buffer. The result is put in
+ * the 16 bytes buffer @digest .
+ **/
+void
+mono_md5_get_digest (const gchar *buffer, gint buffer_size, guchar digest[16])
+{
+ MonoMD5Context ctx;
+
+ mono_md5_init (&ctx);
+ mono_md5_update (&ctx, buffer, buffer_size);
+ mono_md5_final (&ctx, digest);
+
+}
+
+
+/**
+ * mono_md5_get_digest_from_file: get the md5 hash of a file
+ * @filename: file name
+ * @digest: 16 bytes buffer receiving the hash code.
+ *
+ * Get the md5 hash of a file. The result is put in
+ * the 16 bytes buffer @digest .
+ **/
+void
+mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16])
+{
+ MonoMD5Context ctx;
+ guchar tmp_buf[1024];
+ gint nb_bytes_read;
+ FILE *fp;
+
+ mono_md5_init (&ctx);
+ fp = fopen(filename, "r");
+ if (!fp) {
+ return;
+ }
+
+ while ((nb_bytes_read = fread (tmp_buf, sizeof (guchar), 1024, fp)) > 0)
+ mono_md5_update (&ctx, tmp_buf, nb_bytes_read);
+
+ if (ferror(fp)) {
+ fclose(fp);
+ return;
+ }
+
+ mono_md5_final (&ctx, digest);
+}
+
+
+
+
diff --git a/mono/utils/mono-sha1.c b/mono/utils/mono-sha1.c
new file mode 100644
index 00000000000..25084afc3cd
--- /dev/null
+++ b/mono/utils/mono-sha1.c
@@ -0,0 +1,303 @@
+/*
+SHA-1 in C
+By Steve Reid <sreid@sea-to-sky.net>
+100% Public Domain
+
+-----------------
+Modified 7/98
+By James H. Brown <jbrown@burgoyne.com>
+Still 100% Public Domain
+
+Corrected a problem which generated improper hash values on 16 bit machines
+Routine mono_sha1_update changed from
+ void mono_sha1_update(MonoSHA1Context* context, unsigned char* data, unsigned int
+len)
+to
+ void mono_sha1_update(MonoSHA1Context* context, unsigned char* data, unsigned
+long len)
+
+The 'len' parameter was declared an int which works fine on 32 bit machines.
+However, on 16 bit machines an int is too small for the shifts being done
+against
+it. This caused the hash function to generate incorrect values if len was
+greater than 8191 (8K - 1) due to the 'len << 3' on line 3 of mono_sha1_update().
+
+Since the file IO in main() reads 16K at a time, any file 8K or larger would
+be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million
+"a"s).
+
+I also changed the declaration of variables i & j in mono_sha1_update to
+unsigned long from unsigned int for the same reason.
+
+These changes should make no difference to any 32 bit implementations since
+an
+int and a long are the same size in those environments.
+
+--
+I also corrected a few compiler warnings generated by Borland C.
+1. Added #include <process.h> for exit() prototype
+2. Removed unused variable 'j' in mono_sha1_final
+3. Changed exit(0) to return(0) at end of main.
+
+ALL changes I made can be located by searching for comments containing 'JHB'
+-----------------
+Modified 8/98
+By Steve Reid <sreid@sea-to-sky.net>
+Still 100% public domain
+
+1- Removed #include <process.h> and used return() instead of exit()
+2- Fixed overwriting of finalcount in mono_sha1_final() (discovered by Chris Hall)
+3- Changed email address from steve@edmweb.com to sreid@sea-to-sky.net
+
+-----------------
+Modified 4/01
+By Saul Kravitz <Saul.Kravitz@celera.com>
+Still 100% PD
+Modified to run on Compaq Alpha hardware.
+
+
+*/
+
+/*
+Test Vectors (from FIPS PUB 180-1)
+"abc"
+ A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
+"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
+ 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1
+A million repetitions of "a"
+ 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
+*/
+
+#define SHA1HANDSOFF
+
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include "mono-digest.h"
+
+
+/* #include <process.h> */ /* prototype for exit() - JHB */
+/* Using return() instead of exit() - SWR */
+
+static void SHA1Transform(guint32 state[5], const guchar buffer[64]);
+
+#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
+
+/* blk0() and blk() perform the initial expand. */
+/* I got the idea of expanding during the round function from SSLeay */
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
+ |(rol(block->l[i],8)&0x00FF00FF))
+#else
+#define blk0(i) block->l[i]
+#endif
+#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \
+ ^block->l[(i+2)&15]^block->l[i&15],1))
+
+/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */
+#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);
+#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);
+#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);
+#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);
+#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);
+
+
+#ifdef VERBOSE /* SAK */
+static void SHAPrintContext(MonoSHA1Context *context, char *msg){
+ printf("%s (%d,%d) %x %x %x %x %x\n",
+ msg,
+ context->count[0], context->count[1],
+ context->state[0],
+ context->state[1],
+ context->state[2],
+ context->state[3],
+ context->state[4]);
+}
+#endif
+
+/* Hash a single 512-bit block. This is the core of the algorithm. */
+
+static void SHA1Transform(guint32 state[5], const guchar buffer[64])
+{
+guint32 a, b, c, d, e;
+typedef union {
+ unsigned char c[64];
+ guint32 l[16];
+} CHAR64LONG16;
+CHAR64LONG16* block;
+#ifdef SHA1HANDSOFF
+static unsigned char workspace[64];
+ block = (CHAR64LONG16*)workspace;
+ memcpy(block, buffer, 64);
+#else
+ block = (CHAR64LONG16*)buffer;
+#endif
+ /* Copy context->state[] to working vars */
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+ e = state[4];
+ /* 4 rounds of 20 operations each. Loop unrolled. */
+ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);
+ R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);
+ R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);
+ R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);
+ R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);
+ R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);
+ R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);
+ R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);
+ R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);
+ R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);
+ R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);
+ R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);
+ R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);
+ R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);
+ R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);
+ R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);
+ R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);
+ R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);
+ R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);
+ R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);
+ /* Add the working vars back into context.state[] */
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+ state[4] += e;
+ /* Wipe variables */
+ a = b = c = d = e = 0;
+}
+
+
+/* mono_sha1_init - Initialize new context */
+
+void mono_sha1_init(MonoSHA1Context* context)
+{
+ /* SHA1 initialization constants */
+ context->state[0] = 0x67452301;
+ context->state[1] = 0xEFCDAB89;
+ context->state[2] = 0x98BADCFE;
+ context->state[3] = 0x10325476;
+ context->state[4] = 0xC3D2E1F0;
+ context->count[0] = context->count[1] = 0;
+}
+
+
+/* Run your data through this. */
+
+void mono_sha1_update(MonoSHA1Context* context, const guchar* data, guint32 len) /*
+JHB */
+{
+guint32 i, j; /* JHB */
+
+#ifdef VERBOSE
+ SHAPrintContext(context, "before");
+#endif
+ j = (context->count[0] >> 3) & 63;
+ if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
+ context->count[1] += (len >> 29);
+ if ((j + len) > 63) {
+ memcpy(&context->buffer[j], data, (i = 64-j));
+ SHA1Transform(context->state, context->buffer);
+ for ( ; i + 63 < len; i += 64) {
+ SHA1Transform(context->state, &data[i]);
+ }
+ j = 0;
+ }
+ else i = 0;
+ memcpy(&context->buffer[j], &data[i], len - i);
+#ifdef VERBOSE
+ SHAPrintContext(context, "after ");
+#endif
+}
+
+
+/* Add padding and return the message digest. */
+
+void mono_sha1_final( MonoSHA1Context* context, unsigned char digest[20])
+{
+guint32 i; /* JHB */
+unsigned char finalcount[8];
+
+ for (i = 0; i < 8; i++) {
+ finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
+ >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */
+ }
+ mono_sha1_update(context, (unsigned char *)"\200", 1);
+ while ((context->count[0] & 504) != 448) {
+ mono_sha1_update(context, (unsigned char *)"\0", 1);
+ }
+ mono_sha1_update(context, finalcount, 8); /* Should cause a SHA1Transform()
+*/
+ for (i = 0; i < 20; i++) {
+ digest[i] = (unsigned char)
+ ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
+ }
+ /* Wipe variables */
+ i = 0; /* JHB */
+ memset(context->buffer, 0, 64);
+ memset(context->state, 0, 20);
+ memset(context->count, 0, 8);
+ memset(finalcount, 0, 8); /* SWR */
+#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */
+ SHA1Transform(context->state, context->buffer);
+#endif
+}
+
+void
+mono_sha1_get_digest (const gchar *buffer, gint buffer_size, guchar digest [20])
+{
+ MonoSHA1Context ctx;
+
+ mono_sha1_init (&ctx);
+ mono_sha1_update (&ctx, buffer, buffer_size);
+ mono_sha1_final (&ctx, digest);
+
+}
+
+void
+mono_sha1_get_digest_from_file (const gchar *filename, guchar digest [20])
+{
+ MonoSHA1Context ctx;
+ guchar tmp_buf[1024];
+ gint nb_bytes_read;
+ FILE *fp;
+
+ mono_sha1_init (&ctx);
+ fp = fopen(filename, "r");
+ if (!fp) {
+ return;
+ }
+
+ while ((nb_bytes_read = fread (tmp_buf, sizeof (guchar), 1024, fp)) > 0)
+ mono_sha1_update (&ctx, tmp_buf, nb_bytes_read);
+
+ if (ferror(fp)) {
+ fclose(fp);
+ return;
+ } else {
+ fclose(fp);
+ }
+
+ mono_sha1_final (&ctx, digest);
+}
+
+/*
+ * mono_digest_get_public_token:
+ *
+ * Get the public token from public key data.
+ * @token must point to at least 8 bytes of storage.
+ */
+void
+mono_digest_get_public_token (guchar* token, const guchar *pubkey, guint32 len)
+{
+ guchar digest [20];
+ int i;
+
+ g_return_if_fail (token != NULL);
+ mono_sha1_get_digest (pubkey, len, digest);
+ for (i = 0; i < 8; ++i)
+ token [i] = digest [19 - i];
+}
+
diff --git a/mono/utils/mono-uri.c b/mono/utils/mono-uri.c
new file mode 100644
index 00000000000..49342847a1b
--- /dev/null
+++ b/mono/utils/mono-uri.c
@@ -0,0 +1,95 @@
+/* GLIB - Library of useful routines for C programming
+ *
+ * gconvert.c: Convert between character sets using iconv
+ * Copyright Red Hat Inc., 2000
+ * Authors: Havoc Pennington <hp@redhat.com>, Owen Taylor <otaylor@redhat.com
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include <glib.h>
+#include "mono-uri.h"
+
+typedef enum {
+ UNSAFE_ALL = 0x1, /* Escape all unsafe characters */
+ UNSAFE_ALLOW_PLUS = 0x2, /* Allows '+' */
+ UNSAFE_PATH = 0x4, /* Allows '/' and '?' and '&' and '=' */
+ UNSAFE_DOS_PATH = 0x8, /* Allows '/' and '?' and '&' and '=' and ':' */
+ UNSAFE_HOST = 0x10, /* Allows '/' and ':' and '@' */
+ UNSAFE_SLASHES = 0x20 /* Allows all characters except for '/' and '%' */
+} UnsafeCharacterSet;
+
+static const guchar acceptable[96] = {
+ /* A table of the ASCII chars from space (32) to DEL (127) */
+ /* ! " # $ % & ' ( ) * + , - . / */
+ 0x00,0x3F,0x20,0x20,0x20,0x00,0x2C,0x3F,0x3F,0x3F,0x3F,0x22,0x20,0x3F,0x3F,0x1C,
+ /* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */
+ 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x38,0x20,0x20,0x2C,0x20,0x2C,
+ /* @ A B C D E F G H I J K L M N O */
+ 0x30,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
+ /* P Q R S T U V W X Y Z [ \ ] ^ _ */
+ 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x20,0x3F,
+ /* ` a b c d e f g h i j k l m n o */
+ 0x20,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
+ /* p q r s t u v w x y z { | } ~ DEL */
+ 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x20,0x20,0x20,0x3F,0x20
+};
+
+static const gchar hex[] = "0123456789ABCDEF";
+
+/* Note: This escape function works on file: URIs, but if you want to
+ * escape something else, please read RFC-2396 */
+gchar *
+mono_escape_uri_string (const gchar *string)
+{
+#define ACCEPTABLE(a) ((a)>=32 && (a)<128 && (acceptable[(a)-32] & use_mask))
+
+ const gchar *p;
+ gchar *q;
+ gchar *result;
+ int c;
+ gint unacceptable;
+ UnsafeCharacterSet use_mask;
+
+ unacceptable = 0;
+ use_mask = UNSAFE_DOS_PATH;
+ for (p = string; *p != '\0'; p++)
+ {
+ c = (guchar) *p;
+ if (!ACCEPTABLE (c))
+ unacceptable++;
+ }
+
+ result = g_malloc (p - string + unacceptable * 2 + 1);
+
+ for (q = result, p = string; *p != '\0'; p++)
+ {
+ c = (guchar) *p;
+
+ if (!ACCEPTABLE (c))
+ {
+ *q++ = '%'; /* means hex coming */
+ *q++ = hex[c >> 4];
+ *q++ = hex[c & 15];
+ }
+ else
+ *q++ = *p;
+ }
+
+ *q = '\0';
+
+ return result;
+}
+
diff --git a/mono/utils/mono-uri.h b/mono/utils/mono-uri.h
new file mode 100644
index 00000000000..dddb611f04c
--- /dev/null
+++ b/mono/utils/mono-uri.h
@@ -0,0 +1,7 @@
+#ifndef __MONO_URI_H
+#define __MONO_URI_H
+
+gchar * mono_escape_uri_string (const gchar *string);
+
+#endif /* __MONO_URI_H */
+
diff --git a/mono/utils/monobitset.c b/mono/utils/monobitset.c
index e3d195683da..a39820c51aa 100644
--- a/mono/utils/monobitset.c
+++ b/mono/utils/monobitset.c
@@ -2,6 +2,7 @@
#include <string.h>
#include "monobitset.h"
+#include "config.h"
#ifdef __GNUC__
#define MONO_ZERO_LEN_ARRAY 0
@@ -122,6 +123,24 @@ mono_bitset_test (const MonoBitSet *set, guint32 pos) {
}
/*
+ * mono_bitset_test_bulk:
+ * @set: bitset ptr
+ * @pos: test bit at this pos
+ *
+ * Return 32 bits from the bitset, starting from @pos, which must be divisible
+ * with 32.
+ */
+guint32
+mono_bitset_test_bulk (const MonoBitSet *set, guint32 pos) {
+ int j = pos / BITS_PER_CHUNK;
+
+ if (pos >= set->size)
+ return 0;
+ else
+ return set->data [j];
+}
+
+/*
* mono_bitset_clear:
* @set: bitset ptr
* @pos: unset bit at this pos
@@ -152,6 +171,19 @@ mono_bitset_clear_all (MonoBitSet *set) {
}
/*
+ * mono_bitset_set_all:
+ * @set: bitset ptr
+ *
+ * Set all bits.
+ */
+void
+mono_bitset_set_all (MonoBitSet *set) {
+ int i;
+ for (i = 0; i < set->size / BITS_PER_CHUNK; ++i)
+ set->data [i] = 0xffffffff;
+}
+
+/*
* mono_bitset_invert:
* @set: bitset ptr
*
@@ -267,6 +299,29 @@ my_g_bit_nth_lsf (guint32 mask, gint nth_bit)
#define my_g_bit_nth_lsf_nomask(m) (my_g_bit_nth_lsf((m),-1))
#endif
+#if SIZEOF_VOID_P == 8 && GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 4
+/*
+ * There was a 64 bit bug in glib-2.2: g_bit_nth_msf (0, -1) would return 32,
+ * causing infinite loops in dominator computation. So glib-2.4 is required.
+ */
+my_g_bit_nth_msf (gulong mask,
+ gint nth_bit)
+{
+ if (nth_bit < 0)
+ nth_bit = GLIB_SIZEOF_LONG * 8;
+ do
+ {
+ nth_bit--;
+ if (mask & (1UL << nth_bit))
+ return nth_bit;
+ }
+ while (nth_bit > 0);
+ return -1;
+}
+#else
+#define my_g_bit_nth_msf(mask,nth_bit) g_bit_nth_msf((mask),(nth_bit))
+#endif
+
/*
* mono_bitset_find_start:
* @set: bitset ptr
@@ -342,13 +397,13 @@ mono_bitset_find_last (const MonoBitSet *set, gint pos) {
g_return_val_if_fail (pos < set->size, -1);
if (set->data [j]) {
- result = g_bit_nth_msf (set->data [j], bit);
+ result = my_g_bit_nth_msf (set->data [j], bit);
if (result != -1)
return result + j * BITS_PER_CHUNK;
}
for (i = --j; i >= 0; --i) {
if (set->data [i])
- return g_bit_nth_msf (set->data [i], -1) + i * BITS_PER_CHUNK;
+ return my_g_bit_nth_msf (set->data [i], -1) + i * BITS_PER_CHUNK;
}
return -1;
}
@@ -455,7 +510,7 @@ mono_bitset_equal (const MonoBitSet *src, const MonoBitSet *src1) {
int i;
if (src->size != src1->size)
return FALSE;
-
+
for (i = 0; i < src->size / BITS_PER_CHUNK; ++i)
if (src->data [i] != src1->data [i])
return FALSE;
@@ -508,7 +563,7 @@ main() {
return error;
error++;
- //g_print("should be 33: %d\n", mono_bitset_find_first (set1, 0));
+ /* g_print("should be 33: %d\n", mono_bitset_find_first (set1, 0)); */
if (mono_bitset_find_first (set1, 0) != 33)
return error;
@@ -604,7 +659,7 @@ main() {
return error;
break;
}
- //g_print ("count got: %d at %d\n", count, i);
+ /* g_print ("count got: %d at %d\n", count, i); */
}
if (count != 3)
return error;
diff --git a/mono/utils/monobitset.h b/mono/utils/monobitset.h
index 0b62d441d4b..6807336a6c9 100644
--- a/mono/utils/monobitset.h
+++ b/mono/utils/monobitset.h
@@ -25,8 +25,12 @@ void mono_bitset_free (MonoBitSet *set);
void mono_bitset_set (MonoBitSet *set, guint32 pos);
+void mono_bitset_set_all (MonoBitSet *set);
+
int mono_bitset_test (const MonoBitSet *set, guint32 pos);
+guint32 mono_bitset_test_bulk (const MonoBitSet *set, guint32 pos);
+
void mono_bitset_clear (MonoBitSet *set, guint32 pos);
void mono_bitset_clear_all (MonoBitSet *set);
@@ -37,6 +41,8 @@ guint32 mono_bitset_size (const MonoBitSet *set);
guint32 mono_bitset_count (const MonoBitSet *set);
+void mono_bitset_low_high (const MonoBitSet *set, guint32 *low, guint32 *high);
+
int mono_bitset_find_start (const MonoBitSet *set);
int mono_bitset_find_first (const MonoBitSet *set, gint pos);
diff --git a/mono/utils/strenc.c b/mono/utils/strenc.c
new file mode 100644
index 00000000000..b2a5d7e46aa
--- /dev/null
+++ b/mono/utils/strenc.c
@@ -0,0 +1,195 @@
+/*
+ * strenc.c: string encoding conversions
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+#include <config.h>
+#include <glib.h>
+#include <string.h>
+
+#include "strenc.h"
+
+#undef DEBUG
+
+/* Tries to turn a NULL-terminated string into UTF16.
+ *
+ * First, see if it's valid UTF8, in which case just turn it directly
+ * into UTF16. Next, run through the colon-separated encodings in
+ * MONO_EXTERNAL_ENCODINGS and do an iconv conversion on each,
+ * returning the first successful conversion to UTF16. If no
+ * conversion succeeds, return NULL.
+ *
+ * Callers must free the returned string if not NULL. bytes holds the number
+ * of bytes in the returned string, not including the terminator.
+ */
+gunichar2 *mono_unicode_from_external (const gchar *in, gsize *bytes)
+{
+ gchar *res=NULL;
+ gchar **encodings;
+ const gchar *encoding_list;
+ int i;
+ glong lbytes;
+
+ if(in==NULL) {
+ return(NULL);
+ }
+
+ encoding_list=g_getenv ("MONO_EXTERNAL_ENCODINGS");
+ if(encoding_list==NULL) {
+ encoding_list = "";
+ }
+
+ encodings=g_strsplit (encoding_list, ":", 0);
+ for(i=0;encodings[i]!=NULL; i++) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Trying encoding [%s]",
+ encodings[i]);
+#endif
+ /* "default_locale" is a special case encoding */
+ if(!strcmp (encodings[i], "default_locale")) {
+ gchar *utf8=g_locale_to_utf8 (in, -1, NULL, NULL, NULL);
+ if(utf8!=NULL) {
+ res=(gchar *) g_utf8_to_utf16 (utf8, -1, NULL, &lbytes, NULL);
+ *bytes = (gsize) lbytes;
+ }
+ g_free (utf8);
+ } else {
+ res=g_convert (in, -1, "UTF16", encodings[i], NULL, bytes, NULL);
+ }
+
+ if(res!=NULL) {
+ g_strfreev (encodings);
+ *bytes *= 2;
+ return((gunichar2 *)res);
+ }
+ }
+
+ g_strfreev (encodings);
+
+ if(g_utf8_validate (in, -1, NULL)) {
+ gunichar2 *unires=g_utf8_to_utf16 (in, -1, NULL, (glong *)bytes, NULL);
+ *bytes *= 2;
+ return(unires);
+ }
+
+ return(NULL);
+}
+
+/* Tries to turn a NULL-terminated string into UTF8.
+ *
+ * First, see if it's valid UTF8, in which case there's nothing more
+ * to be done. Next, run through the colon-separated encodings in
+ * MONO_EXTERNAL_ENCODINGS and do an iconv conversion on each,
+ * returning the first successful conversion to utf8. If no
+ * conversion succeeds, return NULL.
+ *
+ * Callers must free the returned string if not NULL.
+ *
+ * This function is identical to mono_unicode_from_external, apart
+ * from returning utf8 not utf16; it's handy in a few places to work
+ * in utf8.
+ */
+gchar *mono_utf8_from_external (const gchar *in)
+{
+ gchar *res=NULL;
+ gchar **encodings;
+ const gchar *encoding_list;
+ int i;
+
+ if(in==NULL) {
+ return(NULL);
+ }
+
+ encoding_list=g_getenv ("MONO_EXTERNAL_ENCODINGS");
+ if(encoding_list==NULL) {
+ encoding_list = "";
+ }
+
+ encodings=g_strsplit (encoding_list, ":", 0);
+ for(i=0;encodings[i]!=NULL; i++) {
+#ifdef DEBUG
+ g_message (G_GNUC_PRETTY_FUNCTION ": Trying encoding [%s]",
+ encodings[i]);
+#endif
+
+ /* "default_locale" is a special case encoding */
+ if(!strcmp (encodings[i], "default_locale")) {
+ res=g_locale_to_utf8 (in, -1, NULL, NULL, NULL);
+ if(res!=NULL && !g_utf8_validate (res, -1, NULL)) {
+ g_free (res);
+ res=NULL;
+ }
+ } else {
+ res=g_convert (in, -1, "UTF8", encodings[i], NULL,
+ NULL, NULL);
+ }
+
+ if(res!=NULL) {
+ g_strfreev (encodings);
+ return(res);
+ }
+ }
+
+ g_strfreev (encodings);
+
+ if(g_utf8_validate (in, -1, NULL)) {
+ return(g_strdup (in));
+ }
+
+ return(NULL);
+}
+
+/* Turns NULL-terminated UTF16 into either UTF8, or the first
+ * working item in MONO_EXTERNAL_ENCODINGS if set. If no conversions
+ * work, then UTF8 is returned.
+ *
+ * Callers must free the returned string.
+ */
+gchar *mono_unicode_to_external (const gunichar2 *uni)
+{
+ gchar *utf8;
+ const gchar *encoding_list;
+
+ /* Turn the unicode into utf8 to start with, because its
+ * easier to work with gchar * than gunichar2 *
+ */
+ utf8=g_utf16_to_utf8 (uni, -1, NULL, NULL, NULL);
+ g_assert (utf8!=NULL);
+
+ encoding_list=g_getenv ("MONO_EXTERNAL_ENCODINGS");
+ if(encoding_list==NULL) {
+ /* Do UTF8 */
+ return(utf8);
+ } else {
+ gchar *res, **encodings;
+ int i;
+
+ encodings=g_strsplit (encoding_list, ":", 0);
+ for(i=0; encodings[i]!=NULL; i++) {
+ if(!strcmp (encodings[i], "default_locale")) {
+ res=g_locale_from_utf8 (utf8, -1, NULL, NULL,
+ NULL);
+ } else {
+ res=g_convert (utf8, -1, encodings[i], "UTF8",
+ NULL, NULL, NULL);
+ }
+
+ if(res!=NULL) {
+ g_free (utf8);
+ g_strfreev (encodings);
+
+ return(res);
+ }
+ }
+
+ g_strfreev (encodings);
+ }
+
+ /* Nothing else worked, so just return the utf8 */
+ return(utf8);
+}
+
diff --git a/mono/utils/strenc.h b/mono/utils/strenc.h
new file mode 100644
index 00000000000..996674e0bff
--- /dev/null
+++ b/mono/utils/strenc.h
@@ -0,0 +1,19 @@
+/*
+ * strenc.h: string encoding conversions
+ *
+ * Author:
+ * Dick Porter (dick@ximian.com)
+ *
+ * (C) 2003 Ximian, Inc.
+ */
+
+#ifndef _MONO_STRENC_H_
+#define _MONO_STRENC_H_ 1
+
+#include <glib.h>
+
+extern gunichar2 *mono_unicode_from_external (const gchar *in, gsize *bytes);
+extern gchar *mono_utf8_from_external (const gchar *in);
+extern gchar *mono_unicode_to_external (const gunichar2 *uni);
+
+#endif /* _MONO_STRENC_H_ */
diff --git a/mono/utils/strtod.c b/mono/utils/strtod.c
index c36b148b1c4..2fe48a4d43b 100644
--- a/mono/utils/strtod.c
+++ b/mono/utils/strtod.c
@@ -11,6 +11,8 @@
*
* Taken from the FreeBSD distribution.
*/
+#include <glib.h>
+
#include "strtod.h"
/*-
@@ -138,12 +140,33 @@ static char sccsid[] = "@(#)strtod.c 8.1 (Berkeley) 6/4/93";
* FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
*/
-#if defined(i386) || defined(mips) && defined(MIPSEL)
+#if defined(i386) || defined(mips) && defined(MIPSEL) || defined (__arm__)
+
+#define IEEE_8087
+
+#elif defined(__x86_64__)
+
#define IEEE_8087
+
+#elif defined(__ia64)
+
+# ifdef __hpux
+# define IEEE_MC68k
+# else
+# define IEEE_8087
+# endif
+
+#elif defined(__hppa)
+
+# define IEEE_MC68k
+
#else
#define IEEE_MC68k
#endif
+#define Long gint32
+#define ULong guint32
+
#ifdef DEBUG
#include "stdio.h"
#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}
@@ -233,11 +256,11 @@ Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
#endif
#ifdef IEEE_8087
-#define word0(x) ((unsigned long *)&x)[1]
-#define word1(x) ((unsigned long *)&x)[0]
+#define word0(x) ((ULong *)&x)[1]
+#define word1(x) ((ULong *)&x)[0]
#else
-#define word0(x) ((unsigned long *)&x)[0]
-#define word1(x) ((unsigned long *)&x)[1]
+#define word0(x) ((ULong *)&x)[0]
+#define word1(x) ((ULong *)&x)[1]
#endif
/* The following definition of Storeinc is appropriate for MIPS processors.
@@ -382,7 +405,7 @@ extern "C" char *__dtoa(double d, int mode, int ndigits,
Bigint {
struct Bigint *next;
int k, maxwds, sign, wds;
- unsigned long x[1];
+ ULong x[1];
};
typedef struct Bigint Bigint;
@@ -399,7 +422,7 @@ Balloc
Bigint *rv;
x = 1 << k;
- rv = (Bigint *)malloc(sizeof(Bigint) + (x-1)*sizeof(long));
+ rv = (Bigint *)malloc(sizeof(Bigint) + (x-1)*sizeof(Long));
rv->k = k;
rv->maxwds = x;
rv->sign = rv->wds = 0;
@@ -418,7 +441,7 @@ Bfree
}
#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
-y->wds*sizeof(long) + 2*sizeof(int))
+y->wds*sizeof(Long) + 2*sizeof(int))
static Bigint *
multadd
@@ -429,9 +452,9 @@ multadd
#endif
{
int i, wds;
- unsigned long *x, y;
+ ULong *x, y;
#ifdef Pack_32
- unsigned long xi, z;
+ ULong xi, z;
#endif
Bigint *b1;
@@ -467,14 +490,14 @@ multadd
static Bigint *
s2b
#ifdef KR_headers
- (s, nd0, nd, y9) CONST char *s; int nd0, nd; unsigned long y9;
+ (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9;
#else
- (CONST char *s, int nd0, int nd, unsigned long y9)
+ (CONST char *s, int nd0, int nd, ULong y9)
#endif
{
Bigint *b;
int i, k;
- long x, y;
+ Long x, y;
x = (nd + 8) / 9;
for (k = 0, y = 1; x > y; y <<= 1, k++) ;
@@ -505,9 +528,9 @@ s2b
static int
hi0bits
#ifdef KR_headers
- (x) register unsigned long x;
+ (x) register ULong x;
#else
- (register unsigned long x)
+ (register ULong x)
#endif
{
register int k = 0;
@@ -539,13 +562,13 @@ hi0bits
static int
lo0bits
#ifdef KR_headers
- (y) unsigned long *y;
+ (y) ULong *y;
#else
- (unsigned long *y)
+ (ULong *y)
#endif
{
register int k;
- register unsigned long x = *y;
+ register ULong x = *y;
if (x & 7) {
if (x & 1)
@@ -610,10 +633,10 @@ mult
{
Bigint *c;
int k, wa, wb, wc;
- unsigned long carry, y, z;
- unsigned long *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
+ ULong carry, y, z;
+ ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
#ifdef Pack_32
- unsigned long z2;
+ ULong z2;
#endif
if (a->wds < b->wds) {
@@ -736,7 +759,7 @@ lshift
{
int i, k1, n, n1;
Bigint *b1;
- unsigned long *x, *x1, *xe, z;
+ ULong *x, *x1, *xe, z;
#ifdef Pack_32
n = k >> 5;
@@ -793,7 +816,7 @@ cmp
(Bigint *a, Bigint *b)
#endif
{
- unsigned long *xa, *xa0, *xb, *xb0;
+ ULong *xa, *xa0, *xb, *xb0;
int i, j;
i = a->wds;
@@ -829,10 +852,10 @@ diff
{
Bigint *c;
int i, wa, wb;
- long borrow, y; /* We need signed shifts here. */
- unsigned long *xa, *xae, *xb, *xbe, *xc;
+ Long borrow, y; /* We need signed shifts here. */
+ ULong *xa, *xae, *xb, *xbe, *xc;
#ifdef Pack_32
- long z;
+ Long z;
#endif
i = cmp(a,b);
@@ -906,7 +929,7 @@ ulp
(double x)
#endif
{
- register long L;
+ register Long L;
double a;
L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1;
@@ -942,11 +965,11 @@ b2d
(Bigint *a, int *e)
#endif
{
- unsigned long *xa, *xa0, w, y, z;
+ ULong *xa, *xa0, w, y, z;
int k;
double d;
#ifdef VAX
- unsigned long d0, d1;
+ ULong d0, d1;
#else
#define d0 word0(d)
#define d1 word1(d)
@@ -1013,9 +1036,9 @@ d2b
{
Bigint *b;
int de, i, k;
- unsigned long *x, y, z;
+ ULong *x, y, z;
#ifdef VAX
- unsigned long d0, d1;
+ ULong d0, d1;
d0 = word0(d) >> 16 | word0(d) << 16;
d1 = word1(d) >> 16 | word1(d) << 16;
#else
@@ -1206,8 +1229,8 @@ bsd_strtod
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
CONST char *s, *s0, *s1;
double aadj, aadj1, adj, rv, rv0;
- long L;
- unsigned long y, z;
+ Long L;
+ ULong y, z;
Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
char decimal_point = '.';
@@ -1718,12 +1741,12 @@ quorem
#endif
{
int n;
- long borrow, y;
- unsigned long carry, q, ys;
- unsigned long *bx, *bxe, *sx, *sxe;
+ Long borrow, y;
+ ULong carry, q, ys;
+ ULong *bx, *bxe, *sx, *sxe;
#ifdef Pack_32
- long z;
- unsigned long si, zs;
+ Long z;
+ ULong si, zs;
#endif
n = S->wds;
@@ -1894,10 +1917,10 @@ __bsd_dtoa
int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
spec_case, try_quick;
- long L;
+ Long L;
#ifndef Sudden_Underflow
int denorm;
- unsigned long x;
+ ULong x;
#endif
Bigint *b, *b1, *delta, *mlo, *mhi, *S;
double d2, ds, eps;
diff --git a/monowiz.win32.nsi b/monowiz.win32.nsi
new file mode 100644
index 00000000000..fba80ef2e3a
--- /dev/null
+++ b/monowiz.win32.nsi
@@ -0,0 +1,650 @@
+; =================================================================
+; mono.nsi - This NSIS script creates Mono Setup wizard for Windows
+;
+; Requires NSIS 2.0 (Nullsoft Scriptable Install System)
+; From http://nsis.sourceforge.net/site/index.php
+; =================================================================
+;
+; (C) Copyright 2003 by Johannes Roith
+; (C) Copyright 2003, 2004 by Daniel Morgan
+;
+; Authors:
+; Johannes Roith <johannes@jroith.de>
+; Daniel Morgan <danielmorgan@verizon.net>
+; Urs C Muff <umuff@quark.com>
+; Gonzalo Paniagua Javier <gonzalo@ximian.com>
+;
+; This .nsi includes code from the NSIS Archives:
+; function StrReplace and VersionCheck
+; by Hendri Adriaens
+; HendriAdriaens@hotmail.com
+;
+; =====================================================
+;
+; This script can build a binary setup wizard of mono.
+; It is released under the GNU GPL.
+
+!include "MUI.nsh"
+!include "Sections.nsh"
+
+;
+; =====================================================
+; SET MILESTONE & SOURCE DIR
+; =====================================================
+; set by makefile!!
+
+;!define MILESTONE 0.91.99
+;!define BUILDNUM 2
+;!define SOURCE_INSTALL_DIR ..\install\*.*
+
+; Used to install mcs.exe
+!define PROFILE_VERSION 1.0
+
+; =====================================================
+; SET LOGO
+; =====================================================
+;
+; Beautification:
+;
+; This adds a Mono-specific Image on the left
+; You can choose between the light or dark one.
+;
+; If you wish no mono-specifi logo, please outcomment
+; the lines.
+;
+; "light" is enabled.
+;
+; !define MUI_SPECIALBITMAP "mono-win32-setup-dark.bmp"
+ !define MUI_SPECIALBITMAP "mono-win32-setup-light.bmp"
+
+; =====================================================
+; BUILDING
+; =====================================================
+;
+; 1. Build mono to a clean directory prefix.
+;
+; 2. In your install directory, delete the *.a files.
+; Most people won't need them and it saves ~ 4 MB.
+;
+; 3. Type "make win32setup"
+;
+; 4. The output file is mono-[MILESTONE]-win32-[BUILDNUM].exe
+;
+;
+; =====================================================
+; MONO & REGISTRY / DETECTING MONO
+; =====================================================
+;
+;
+; This setup creates several Registry Keys:
+;
+; HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
+; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot
+; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory
+; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir
+;
+; =====================================================
+;
+; To get the current Mono Install Directory:
+;
+; 1. Get DefaultCLR
+; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE SdkInstallRoot
+;
+; =====================================================
+;
+; To get the current Mono assembly Directory:
+;
+; 1. Get DefaultCLR
+; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE FrameworkAssemblyDirectory
+;
+; =====================================================
+; Do not edit below
+; =====================================================
+;
+;
+; =====================================================
+; GENERAL SETTING - NEED NOT TO BE CHANGED
+; =====================================================
+
+!define NAME "Mono"
+!define TARGET_INSTALL_DIR "$PROGRAMFILES\Mono-${MILESTONE}"
+!define OUTFILE mono-${MILESTONE}-win32-${BUILDNUM}.exe
+
+Name ${NAME}
+Caption "Mono ${MILESTONE} Build ${BUILDNUM} Setup"
+
+SetCompressor bzip2
+SilentInstall normal
+ShowInstDetails show
+SetDateSave on
+SetDatablockOptimize on
+CRCCheck on
+BGGradient 000000 800000 FFFFFF
+InstallColors FF8080 000030
+XPStyle on
+AutoCloseWindow false
+
+; =====================================================
+; SCRIPT
+; =====================================================
+
+#!define MUI_WELCOMEPAGE
+#!define MUI_DIRECTORYPAGE
+#!define MUI_DIRECTORYSELECTIONPAGE
+
+!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Mono for Windows.\r\n\r\n\r\n$_CLICK"
+
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+
+!define MUI_FINISHPAGE_LINK "Visit Mono's website for the latest news"
+!define MUI_FINISHPAGE_LINK_LOCATION "http://www.go-mono.com/"
+
+!define MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+!insertmacro MUI_PAGE_FINISH
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE "ENGLISH"
+
+AutoCloseWindow false
+ShowInstDetails show
+
+OutFile ${OUTFILE}
+InstallDir "${TARGET_INSTALL_DIR}"
+
+;========================
+; Uninstaller
+;========================
+
+Section "Uninstall"
+
+ MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall
+
+ Delete "$INSTDIR\Uninst.exe" ; delete Uninstaller
+ DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} ; Remove Entry in Software List
+
+ MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1
+ RMDir /r $INSTDIR
+ GoNext1:
+
+ DeleteRegKey HKLM SOFTWARE\Mono\${MILESTONE}
+
+ ; If the Default-Key is the current Milestone, we just remove the wrappers
+
+ ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
+ StrCmp $0 ${MILESTONE} DeleteWrappers
+
+ MessageBox MB_YESNO "Mono ${MILESTONE} Build ${BUILDNUM} has been removed, but the default installation of Mono differs form this version. Should the wrappers and the Mono registry key be still be removed? This could disable other Mono installations." IDNO GoNext2
+
+ DeleteWrappers:
+
+ ; Complete Uninstall
+
+ GoNext2:
+ NoUnInstall:
+
+SectionEnd
+
+
+ Section
+
+ ; Warn people if a newer Mono is already installed
+
+ ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
+ Push $0
+ Push ${MILESTONE}
+ Call VersionCheck
+ Pop $0
+ StrCmp $0 0 NoAskInstall
+ StrCmp $0 2 NoAskInstall
+ MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall
+
+ NoAskInstall:
+
+ DetailPrint "Installing Mono Files..."
+ SetOverwrite on
+ SetOutPath $INSTDIR
+ File /r ${SOURCE_INSTALL_DIR}
+
+ WriteUninstaller Uninst.exe
+
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot $INSTDIR
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory $INSTDIR\lib
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir $INSTDIR\etc
+ ;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR ${MILESTONE}
+
+ ; Mono Uninstall Entry in Windows Software List in the Control panel
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} DisplayName "Mono ${MILESTONE}"
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} UninstallString $INSTDIR\uninst.exe
+
+ ;original string is like C:\mono-0.20\install
+ StrCpy $5 $INSTDIR
+ Push $5
+ Push "\" ;search for this string
+ Push "/" ;replace with this string
+ Call StrReplace
+ ;resulting string which is like C:/mono-0.20/install
+ Pop $6
+
+;
+; These wrappers are copied to the windows directory.
+;
+
+;========================
+; Write the path file
+;========================
+
+Push "mint"
+Call windowsBatCore
+
+Push "mono"
+Call windowsBatCore
+
+Push "monodis"
+Call windowsBatCore
+
+Push "monograph"
+Call windowsBatCore
+
+Push "pedump"
+Call windowsBatCore
+
+Push "mcs"
+Call windowsBatProfile
+
+Push "mbas"
+Call windowsBatProfile
+
+Push $0
+Call PushBatFiles
+Call createWindowsBatFiles
+Pop $0
+
+; ============= glib-2.0.pc ===============
+FileOpen $0 "$INSTDIR\lib\pkgconfig\glib-2.0.pc" "w"
+FileWrite $0 "prefix=$6$\r$\n"
+FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
+FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
+FileWrite $0 "includedir=$${prefix}/include$\r$\n"
+FileWrite $0 "$\r$\n"
+FileWrite $0 "glib_genmarshal=glib-genmarshal$\r$\n"
+FileWrite $0 "gobject_query=gobject-query$\r$\n"
+FileWrite $0 "glib_mkenums=glib-mkenums$\r$\n"
+FileWrite $0 "$\r$\n"
+FileWrite $0 "Name: GLib$\r$\n"
+FileWrite $0 "Description: C Utility Library$\r$\n"
+FileWrite $0 "Version: 2.0.4$\r$\n"
+FileWrite $0 "Libs: -L$${libdir} -lglib-2.0 -lintl -liconv $\r$\n"
+FileWrite $0 "Cflags: -I$${includedir}/glib-2.0 -I$${libdir}/glib-2.0/include $\r$\n"
+FileClose $0
+
+; ============= gmodule-2.0.pc ===============
+FileOpen $0 "$INSTDIR\lib\pkgconfig\gmodule-2.0.pc" "w"
+FileWrite $0 "prefix=$6$\r$\n"
+FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
+FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
+FileWrite $0 "includedir=$${prefix}/include$\r$\n"
+FileWrite $0 "$\r$\n"
+FileWrite $0 "gmodule_supported=true$\r$\n"
+FileWrite $0 "$\r$\n"
+FileWrite $0 "Name: GModule$\r$\n"
+FileWrite $0 "Description: Dynamic module loader for GLib$\r$\n"
+FileWrite $0 "Requires: glib-2.0$\r$\n"
+FileWrite $0 "Version: 2.0.4$\r$\n"
+FileWrite $0 "Libs: -L$${libdir} -lgmodule-2.0 $\r$\n"
+FileWrite $0 "Cflags:$\r$\n"
+FileClose $0
+
+; ============= gobject-2.0.pc ===============
+FileOpen $0 "$INSTDIR\lib\pkgconfig\gobject-2.0.pc" "w"
+FileWrite $0 "prefix=$6$\r$\n"
+FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
+FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
+FileWrite $0 "includedir=$${prefix}/include$\r$\n"
+FileWrite $0 "$\r$\n"
+FileWrite $0 "Name: GObject$\r$\n"
+FileWrite $0 "Description: GLib Type, Object, Parameter and Signal Library$\r$\n"
+FileWrite $0 "Requires: glib-2.0$\r$\n"
+FileWrite $0 "Version: 2.0.4$\r$\n"
+FileWrite $0 "Libs: -L$${libdir} -lgobject-2.0$\r$\n"
+FileWrite $0 "Cflags:$\r$\n"
+FileClose $0
+
+; ============= gthread-2.0.pc ===============
+FileOpen $0 "$INSTDIR\lib\pkgconfig\gthread-2.0.pc" "w"
+FileWrite $0 "prefix=$6$\r$\n"
+FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
+FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
+FileWrite $0 "includedir=$${prefix}/include$\r$\n"
+FileWrite $0 "$\r$\n"
+FileWrite $0 "Name: GThread$\r$\n"
+FileWrite $0 "Description: Thread support for GLib$\r$\n"
+FileWrite $0 "Requires: glib-2.0$\r$\n"
+FileWrite $0 "Version: 2.0.4$\r$\n"
+FileWrite $0 "Libs: -L$${libdir} -lgthread-2.0 $\r$\n"
+FileWrite $0 "Cflags: -D_REENTRANT$\r$\n"
+FileClose $0
+
+; ============= libintl.pc ===============
+FileOpen $0 "$INSTDIR\lib\pkgconfig\libintl.pc" "w"
+FileWrite $0 "prefix=$6$\r$\n"
+FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
+FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
+FileWrite $0 "includedir=$${prefix}/include$\r$\n"
+FileWrite $0 "$\r$\n"
+FileWrite $0 "Name: libintl$\r$\n"
+FileWrite $0 "Description: The intl library from GNU gettext$\r$\n"
+FileWrite $0 "Version: 0.10.40-tml$\r$\n"
+FileWrite $0 "Libs: -L$${libdir} -lintl$\r$\n"
+FileWrite $0 "Cflags: -I$${includedir}$\r$\n"
+FileClose $0
+
+Call CreateSetMonoPath
+Call RunGacutil
+
+MessageBox MB_ICONINFORMATION "Don't forget to prepend $INSTDIR\bin to your PATH when using Mono ${MILESTONE} Build ${BUILDNUM}.$\r$\nYou can use $INSTDIR\bin\setmonopath.bat to do it."
+NoInstall:
+
+SectionEnd
+
+Function PushBatFiles
+ Push ""
+ Push "al"
+ Push "cert2spc"
+ Push "certmgr"
+ Push "chktrust"
+ Push "cilc"
+ Push "disco"
+ Push "gacutil"
+ Push "genxs"
+ Push "ilasm"
+ Push "ilasm"
+ Push "monop"
+ Push "monoresgen"
+ Push "secutil"
+ Push "sqlsharp"
+ Push "makecert"
+ Push "setreg"
+ Push "signcode"
+ Push "sn"
+ Push "soapsuds"
+ Push "wsdl"
+ Push "xsd"
+FunctionEnd
+
+Function createWindowsBatFiles
+createloop:
+ Pop $0
+ StrCmp "$0" "" endcreateloop
+ Push $0
+ Call windowsBat
+ Goto createloop
+endcreateloop:
+FunctionEnd
+
+Function CreateCreategac
+ Push $1
+ FileOpen $1 "$INSTDIR\creategac.bat" "w"
+ FileWrite $1 "@echo off$\r$\n"
+ FileWrite $1 "echo Mono version ${MILESTONE} Build ${BUILDNUM}$\r$\n"
+ FileWrite $1 "echo Running gacutil to install system assemblies into the GAC$\r$\n"
+ FileWrite $1 "SETLOCAL$\r$\n"
+ FileWrite $1 "PATH=$INSTDIR\bin;%PATH%$\r$\n"
+ FileWrite $1 '"$INSTDIR\bin\gacutil.bat" -il "$INSTDIR\lib\mono\${PROFILE_VERSION}\full-path-assemblies.lst"$\r$\n'
+ FileWrite $1 "ENDLOCAL$\r$\n"
+ FileClose $1
+ Pop $1
+FunctionEnd
+
+Function CreateSetMonoPath
+ Push $1
+ FileOpen $1 "$INSTDIR\bin\setmonopath.bat" "w"
+ FileWrite $1 "@echo off$\r$\n"
+ FileWrite $1 "echo Mono version ${MILESTONE} Build ${BUILDNUM}$\r$\n"
+ FileWrite $1 "echo Prepending '$INSTDIR\bin' to PATH$\r$\n"
+ FileWrite $1 "PATH=$INSTDIR\bin;%PATH%$\r$\n"
+ FileClose $1
+ Pop $1
+FunctionEnd
+
+Function RunGacutil
+ Push $1
+ Push $2
+ Push $3
+ FileOpen $1 "$INSTDIR\lib\mono\${PROFILE_VERSION}\assemblies.lst" "r"
+ FileOpen $2 "$INSTDIR\lib\mono\${PROFILE_VERSION}\full-path-assemblies.lst" "w"
+nextline:
+ FileRead $1 $3
+ StrCmp "$3" "" giveup
+ FileWrite $2 "$INSTDIR\lib\mono\${PROFILE_VERSION}\$3"
+ goto nextline
+giveup:
+ FileClose $1
+ FileClose $2
+ ExecWait '"$INSTDIR\bin\gacutil.bat" -il "$INSTDIR\lib\mono\${PROFILE_VERSION}\full-path-assemblies.lst"'
+ IfErrors errrun noerr
+errrun:
+ MessageBox MB_ICONEXCLAMATION 'Error running gacutil!$\r$\nRun "$INSTDIR\creategac.bat" after finishing setup program.'
+ Call CreateCreategac
+ ;Delete "$INSTDIR\lib\mono\${PROFILE_VERSION}\assemblies.lst"
+ ;Delete "$INSTDIR\lib\mono\${PROFILE_VERSION}\full-path-assemblies.lst"
+noerr:
+ Pop $3
+ Pop $2
+ Pop $1
+FunctionEnd
+
+Function windowsBatCore
+ Exch $1 ;core exe name
+
+ FileOpen $0 "$INSTDIR\bin\$1.bat" "w"
+ FileWrite $0 "@ECHO OFF$\r$\n"
+ FileWrite $0 "SET MONOARGS=$\r$\n"
+ FileWrite $0 ":loop$\r$\n"
+ FileWrite $0 "IF x%1 == x goto :done$\r$\n"
+ FileWrite $0 'SET MONOARGS=%MONOARGS% %1$\r$\n'
+ FileWrite $0 "SHIFT$\r$\n"
+ FileWrite $0 "GOTO loop$\r$\n"
+ FileWrite $0 ":done$\r$\n"
+ FileWrite $0 "SETLOCAL$\r$\n"
+ FileWrite $0 'SET PATH=$INSTDIR\bin;%PATH%$\r$\n'
+ FileWrite $0 'SET MONO_PATH=$INSTDIR\lib$\r$\n'
+ FileWrite $0 'SET MONO_CFG_DIR=$INSTDIR\etc$\r$\n'
+ FileWrite $0 '"$INSTDIR\lib\$1.exe" %MONOARGS%$\r$\n'
+ FileWrite $0 "ENDLOCAL$\r$\n"
+ FileClose $0
+
+ FileOpen $0 "$INSTDIR\bin\$1" "w"
+ FileWrite $0 "#!/bin/sh$\n"
+ FileWrite $0 'IDIRUNIX="`cygpath -u '
+ FileWrite $0 "'$INSTDIR'`"
+ FileWrite $0 '"$\n'
+ FileWrite $0 'PATH="$${IDIRUNIX}/bin:$$PATH"$\n'
+ FileWrite $0 "MONO_PATH='$INSTDIR\lib'$\n"
+ FileWrite $0 "MONO_CFG_DIR='$INSTDIR\etc'$\n"
+ FileWrite $0 "export PATH MONO_PATH MONO_CFG_DIR$\n"
+ FileWrite $0 'exec "$6/lib/$1.exe" "$$@"$\n'
+ FileClose $0
+
+ Pop $1
+FunctionEnd
+
+Function windowsBat
+ Exch $1 ;tool name
+
+ FileOpen $0 "$INSTDIR\bin\$1.bat" "w"
+ FileWrite $0 "@ECHO OFF$\r$\n"
+ FileWrite $0 "SET MONOARGS=$\r$\n"
+ FileWrite $0 ":loop$\r$\n"
+ FileWrite $0 "IF x%1 == x GOTO :done$\r$\n"
+ FileWrite $0 'SET MONOARGS=%MONOARGS% %1$\r$\n'
+ FileWrite $0 "SHIFT$\r$\n"
+ FileWrite $0 "GOTO loop$\r$\n"
+ FileWrite $0 ":done$\r$\n"
+ FileWrite $0 "SETLOCAL$\r$\n"
+ FileWrite $0 'SET PATH=$INSTDIR\bin;%PATH%$\r$\n'
+ FileWrite $0 'SET MONO_PATH=$INSTDIR\lib$\r$\n'
+ FileWrite $0 'SET MONO_CFG_DIR=$INSTDIR\etc$\r$\n'
+ FileWrite $0 '"$INSTDIR\lib\mono.exe" "$INSTDIR\lib\$1.exe" %MONOARGS%$\r$\n'
+ FileWrite $0 "ENDLOCAL$\r$\n"
+ FileClose $0
+
+ FileOpen $0 "$INSTDIR\bin\$1" "w"
+ FileWrite $0 "#!/bin/sh$\n"
+ FileWrite $0 'IDIRUNIX="`cygpath -u '
+ FileWrite $0 "'$INSTDIR'`"
+ FileWrite $0 '"$\n'
+ FileWrite $0 'PATH="$${IDIRUNIX}/bin:$$PATH"$\n'
+ FileWrite $0 "MONO_PATH='$INSTDIR\lib'$\n"
+ FileWrite $0 "MONO_CFG_DIR='$INSTDIR\etc'$\n"
+ FileWrite $0 "export PATH MONO_PATH MONO_CFG_DIR$\n"
+ FileWrite $0 'exec "$6/lib/mono.exe" "$6/lib/$1.exe" "$$@"$\n'
+ FileClose $0
+
+ Pop $1
+FunctionEnd
+
+Function windowsBatProfile
+ Exch $1 ;tool name
+
+ FileOpen $0 "$INSTDIR\bin\$1.bat" "w"
+ FileWrite $0 "@ECHO OFF$\r$\n"
+ FileWrite $0 "SET MONOARGS=$\r$\n"
+ FileWrite $0 ":loop$\r$\n"
+ FileWrite $0 "IF x%1 == x GOTO :done$\r$\n"
+ FileWrite $0 'SET MONOARGS=%MONOARGS% %1$\r$\n'
+ FileWrite $0 "SHIFT$\r$\n"
+ FileWrite $0 "GOTO loop$\r$\n"
+ FileWrite $0 ":done$\r$\n"
+ FileWrite $0 "SETLOCAL$\r$\n"
+ FileWrite $0 'SET PATH=$INSTDIR\bin;%PATH%$\r$\n'
+ FileWrite $0 'SET MONO_PATH=$INSTDIR\lib$\r$\n'
+ FileWrite $0 'SET MONO_CFG_DIR=$INSTDIR\etc$\r$\n'
+ FileWrite $0 '"$INSTDIR\lib\mono.exe" "$INSTDIR\lib\mono\${PROFILE_VERSION}\$1.exe" %MONOARGS%$\r$\n'
+ FileWrite $0 "ENDLOCAL$\r$\n"
+ FileClose $0
+
+ FileOpen $0 "$INSTDIR\bin\$1" "w"
+ FileWrite $0 "#!/bin/sh$\n"
+ FileWrite $0 'IDIRUNIX="`cygpath -u '
+ FileWrite $0 "'$INSTDIR'`"
+ FileWrite $0 '"$\n'
+ FileWrite $0 'PATH="$$IDIRUNIX/bin:$$PATH"$\n'
+ FileWrite $0 "MONO_PATH='$INSTDIR\lib'$\n"
+ FileWrite $0 "MONO_CFG_DIR='$INSTDIR\etc'$\n"
+ FileWrite $0 "export PATH MONO_PATH MONO_CFG_DIR$\n"
+ FileWrite $0 'exec "$6/lib/mono.exe" "$6/lib/mono/${PROFILE_VERSION}/$1.exe" "$$@"$\n'
+ FileClose $0
+
+ Pop $1
+FunctionEnd
+
+; function StrReplace
+; by Hendri Adriaens
+; HendriAdriaens@hotmail.com
+; found in the NSIS Archives
+function StrReplace
+ Exch $0 ;this will replace wrong characters
+ Exch
+ Exch $1 ;needs to be replaced
+ Exch
+ Exch 2
+ Exch $2 ;the orginal string
+ Push $3 ;counter
+ Push $4 ;temp character
+ Push $5 ;temp string
+ Push $6 ;length of string that need to be replaced
+ Push $7 ;length of string that will replace
+ Push $R0 ;tempstring
+ Push $R1 ;tempstring
+ Push $R2 ;tempstring
+ StrCpy $3 "-1"
+ StrCpy $5 ""
+ StrLen $6 $1
+ StrLen $7 $0
+ Loop:
+ IntOp $3 $3 + 1
+ StrCpy $4 $2 $6 $3
+ StrCmp $4 "" ExitLoop
+ StrCmp $4 $1 Replace
+ Goto Loop
+ Replace:
+ StrCpy $R0 $2 $3
+ IntOp $R2 $3 + $6
+ StrCpy $R1 $2 "" $R2
+ StrCpy $2 $R0$0$R1
+ IntOp $3 $3 + $7
+ Goto Loop
+ ExitLoop:
+ StrCpy $0 $2
+ Pop $R2
+ Pop $R1
+ Pop $R0
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Exch $0
+FunctionEnd
+
+Function VersionCheck
+ Exch $0 ;second versionnumber
+ Exch
+ Exch $1 ;first versionnumber
+ Push $R0 ;counter for $0
+ Push $R1 ;counter for $1
+ Push $3 ;temp char
+ Push $4 ;temp string for $0
+ Push $5 ;temp string for $1
+ StrCpy $R0 "-1"
+ StrCpy $R1 "-1"
+ Start:
+ StrCpy $4 ""
+ DotLoop0:
+ IntOp $R0 $R0 + 1
+ StrCpy $3 $0 1 $R0
+ StrCmp $3 "" DotFound0
+ StrCmp $3 "." DotFound0
+ StrCpy $4 $4$3
+ Goto DotLoop0
+ DotFound0:
+ StrCpy $5 ""
+ DotLoop1:
+ IntOp $R1 $R1 + 1
+ StrCpy $3 $1 1 $R1
+ StrCmp $3 "" DotFound1
+ StrCmp $3 "." DotFound1
+ StrCpy $5 $5$3
+ Goto DotLoop1
+ DotFound1:
+ Strcmp $4 "" 0 Not4
+ StrCmp $5 "" Equal
+ Goto Ver2Less
+ Not4:
+ StrCmp $5 "" Ver2More
+ IntCmp $4 $5 Start Ver2Less Ver2More
+ Equal:
+ StrCpy $0 "0"
+ Goto Finish
+ Ver2Less:
+ StrCpy $0 "1"
+ Goto Finish
+ Ver2More:
+ StrCpy $0 "2"
+ Finish:
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $R1
+ Pop $R0
+ Pop $1
+ Exch $0
+FunctionEnd
diff --git a/runtime/.cvsignore b/runtime/.cvsignore
index f914cb46763..0b138db27d2 100644
--- a/runtime/.cvsignore
+++ b/runtime/.cvsignore
@@ -1,3 +1,5 @@
Makefile
Makefile.in
*.dll
+*.mdb
+mcs.exe.config
diff --git a/runtime/Makefile.am b/runtime/Makefile.am
index ef83eaf2854..0096563a6f7 100644
--- a/runtime/Makefile.am
+++ b/runtime/Makefile.am
@@ -1,39 +1,109 @@
-#
# This is just used to copy and install the DLL files that are currently
# being compiled on windows.
#
-assemblies_DATA = \
- corlib.dll \
- System.dll \
- System.Data.dll \
- System.Xml.dll \
- System.Web.dll \
- System.Drawing.dll
+SUBDIRS = . net_1_1 net_2_0
+
+monobins_DATA = \
+ monoresgen.exe \
+ monoresgen.exe.mdb \
+ secutil.exe \
+ secutil.exe.mdb \
+ ilasm.exe \
+ ilasm.exe.mdb \
+ cilc.exe \
+ cilc.exe.mdb \
+ xsd.exe \
+ xsd.exe.mdb \
+ wsdl.exe \
+ wsdl.exe.mdb \
+ wsdl2.exe \
+ wsdl2.exe.mdb \
+ genxs.exe \
+ genxs.exe.mdb \
+ al.exe \
+ al.exe.mdb \
+ disco.exe \
+ disco.exe.mdb \
+ sqlsharp.exe \
+ sqlsharp.exe.mdb \
+ signcode.exe \
+ signcode.exe.mdb \
+ chktrust.exe \
+ chktrust.exe.mdb \
+ soapsuds.exe \
+ soapsuds.exe.mdb \
+ monop.exe \
+ monop.exe.mdb \
+ mono-find-provides.exe \
+ mono-find-provides.exe.mdb \
+ mono-find-requires.exe \
+ mono-find-requires.exe.mdb \
+ setreg.exe \
+ setreg.exe.mdb \
+ cert2spc.exe \
+ cert2spc.exe.mdb \
+ certmgr.exe \
+ certmgr.exe.mdb \
+ MakeCert.exe \
+ MakeCert.exe.mdb \
+ gacutil.exe \
+ gacutil.exe.mdb \
+ sn.exe \
+ sn.exe.mdb
+
+monoone_DATA = \
+ mcs.exe \
+ mcs.exe.mdb \
+ mcs.exe.config \
+ mbas.exe
+
+if ! PLATFORM_WIN32
+gmcs_exe = gmcs.exe gmcs.exe.config gmcs.exe.mdb
+endif
+monotwo_DATA = $(gmcs_exe)
-monobins_DATA = mcs.exe
+EXTRA_DIST= $(monobins_DATA) $(monoone_DATA) $(monotwo_DATA)
-EXTRA_DIST = $(monobins_DATA) $(assemblies_DATA)
+MAINTAINERCLEANFILES = $(EXTRA_DIST)
#
# Keep in sync with mono/mono/metadata/Makefile.am
#
-assembliesdir = $(libdir)
+if PLATFORM_WIN32
+monobinsdir = $(libdir)
+monoonedir = $(libdir)
+monotwodir = $(libdir)
+else
monobinsdir = $(bindir)
+monoonedir = $(libdir)/mono/1.0/
+monotwodir = $(libdir)/mono/2.0/
+endif
-$(assemblies_DATA):
- cp $(top_srcdir)/../mcs/class/lib/$@ . || cp $(assembliesdir)/$@ . || touch $@
-
-$(monobins_DATA):
- cp $(top_srcdir)/../mcs/mcs/$@ . || cp $(monobinsdir)/$@ . || touch $@
-
-dist-hook:
- for i in $(monobins_DATA) $(assemblies_DATA); do \
- if test ! -s $(srcdir)/$$i; then echo $$i is empty && exit 1; fi \
- done
+$(monoone_DATA) $(monotwo_DATA) $(monobins_DATA):
+ @name=`echo "$@" | sed 's,\.exe.*$$,,'`; \
+ case $$name in \
+ mcs | mbas | monoresgen | gmcs | ilasm) d=$$name ;; \
+ cilc | genxs | al | disco | soapsuds | monop | browsercaps-updater | gacutil) d=tools/$$name ;; \
+ chktrust | signcode | MakeCert | cert2spc | certmgr | secutil | setreg | sn) d=tools/security ;; \
+ mono-find-provides | mono-find-requires) d=tools/mono-rpm-helpers/$$name ;; \
+ xsd) d=tools/mono-xsd ;; \
+ wsdl*) d=tools/wsdl ;; \
+ sqlsharp) d=tools/SqlSharp ;; \
+ esac; \
+ echo "test -f $(mcs_topdir)/$$d/$@" ; \
+ test -f $(mcs_topdir)/$$d/$@ || exit 1 ; \
+ echo "rm -f $(srcdir)/$@" ; \
+ rm -f $(srcdir)/$@ ; \
+ echo "cd $(srcdir) && $(LN_S) $(mcs_topdir_from_srcdir)/$$d/$@ $@" ; \
+ cd $(srcdir) && $(LN_S) $(mcs_topdir_from_srcdir)/$$d/$@ $@
copy_dlls:
cp /nt/mono/mcs/class/*/*.dll .
push_dlls:
scp -o "Protocol 1" *.dll *.exe snapshot@mono-cvs.ximian.com:dlls
+
+cleanassemblies:
+ find -name \*.dll -exec rm -vf {} \;
+ find -name \*.exe -exec rm -vf {} \;
diff --git a/runtime/net_1_1/.cvsignore b/runtime/net_1_1/.cvsignore
new file mode 100644
index 00000000000..e362b9f8326
--- /dev/null
+++ b/runtime/net_1_1/.cvsignore
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.dll
+*.mdb
diff --git a/runtime/net_1_1/Makefile.am b/runtime/net_1_1/Makefile.am
new file mode 100644
index 00000000000..01175e008e5
--- /dev/null
+++ b/runtime/net_1_1/Makefile.am
@@ -0,0 +1,116 @@
+# This is just used to copy and install the DLL files that are currently
+# being compiled on windows.
+#
+
+gacutil=$(srcdir)/../gacutil.exe
+framework_version = 1.0
+
+if USE_JIT
+mono_runtime = $(top_builddir)/mono/mini/mono
+else
+mono_runtime = $(top_builddir)/mono/interpreter/mint
+endif
+
+MONO_CSHARP_DEBUGGER = Mono.CompilerServices.SymbolWriter
+if PLATFORM_WIN32
+GAC_DIR = `cygpath -w $(libdir)`
+GAC_ROOT_DIR = `cygpath -w $(DESTDIR)$(libdir)`
+else
+GAC_DIR = $(libdir)
+GAC_ROOT_DIR = $(DESTDIR)$(libdir)
+endif
+
+gac_assemblies_list = \
+ Accessibility \
+ ByteFX.Data \
+ Commons.Xml.Relaxng \
+ cscompmgd \
+ I18N.CJK \
+ I18N \
+ I18N.MidEast \
+ I18N.Other \
+ I18N.Rare \
+ I18N.West \
+ IBM.Data.DB2 \
+ ICSharpCode.SharpZipLib \
+ Microsoft.VisualBasic \
+ Microsoft.VisualC \
+ Microsoft.Vsa \
+ Mono.Cairo \
+ $(MONO_CSHARP_DEBUGGER) \
+ Mono.Data.SybaseClient \
+ Mono.Data.SqliteClient \
+ Mono.Data.TdsClient \
+ Mono.Data.Tds \
+ Mono.GetOptions \
+ Mono.Http \
+ Mono.Posix \
+ Mono.Security \
+ Mono.Security.Win32 \
+ Novell.Directory.Ldap \
+ Npgsql \
+ nunit.util \
+ nunit.core \
+ nunit.framework \
+ PEAPI \
+ System.Configuration.Install \
+ System.Data \
+ System.Data.OracleClient \
+ System \
+ System.Design \
+ System.DirectoryServices \
+ System.Drawing.Design \
+ System.Drawing \
+ System.EnterpriseServices \
+ System.Management \
+ System.Messaging \
+ System.Runtime.Remoting \
+ System.Runtime.Serialization.Formatters.Soap \
+ System.Security \
+ System.ServiceProcess \
+ System.Web \
+ System.Web.Services \
+ System.Windows.Forms \
+ System.Xml
+
+gac_assemblies = $(gac_assemblies_list:=.dll)
+mdb_files = $(gac_assemblies:=.mdb)
+
+corlibdir = $(libdir)/mono/$(framework_version)
+corlib_DATA = mscorlib.dll
+
+EXTRA_DIST = $(gac_assemblies) $(corlib_DATA) $(mdb_files)
+MAINTAINERCLEANFILES = $(EXTRA_DIST)
+
+mscorlib.dll $(gac_assemblies) $(mdb_files):
+ test -f $(mcs_topdir)/class/lib/default/$@
+ -rm -f $(srcdir)/$@
+ cd $(srcdir) && $(LN_S) $(mcs_topdir_from_srcdir)/class/lib/default/$@ $@
+
+all-local: $(gac_assemblies) $(mdb_files)
+
+install-data-local:
+ @if test -f $(srcdir)/mscorlib.dll.mdb; then \
+ echo $(INSTALL_DATA) $(srcdir)/mscorlib.dll.mdb $(DESTDIR)$(corlibdir)/mscorlib.dll.mdb; \
+ $(INSTALL_DATA) $(srcdir)/mscorlib.dll.mdb $(DESTDIR)$(corlibdir)/mscorlib.dll.mdb; \
+ fi
+ @if test -n '$(gac_assemblies)'; then \
+ for i in ''$(gac_assemblies); do \
+ echo "MONO_PATH=$(srcdir) $(mono_runtime) --config ../../data/config $(gacutil) /i $(srcdir)/$$i /f /package $(framework_version) /gacdir $(GAC_DIR) /root $(GAC_ROOT_DIR)" ; \
+ MONO_PATH=$(srcdir) \
+ $(LIBTOOL) --mode=execute $(mono_runtime) --config ../../data/config $(gacutil) /i $(srcdir)/$$i /f /package $(framework_version) /gacdir $(GAC_DIR) /root $(GAC_ROOT_DIR) || exit 1 ; \
+ done; fi
+
+uninstall-local:
+ @if test -n '$(gac_assemblies_list)'; then \
+ for i in ''$(gac_assemblies_list); do \
+ echo "MONO_PATH=$(srcdir) $(mono_runtime) $(gacutil) /u $$i /gacdir $(GAC_DIR) /root $(GAC_ROOT_DIR)" ; \
+ MONO_PATH=$(srcdir) \
+ $(LIBTOOL) --mode=execute $(mono_runtime) --config ../../data/config $(gacutil) /u $$i /gacdir $(GAC_DIR) /root $(GAC_ROOT_DIR) || true ; \
+ done; fi
+
+copy_dlls:
+ cp /nt/mono/mcs/class/*/*.dll .
+
+push_dlls:
+ scp -o "Protocol 1" *.dll *.exe snapshot@mono-cvs.ximian.com:dlls
diff --git a/runtime/net_2_0/.cvsignore b/runtime/net_2_0/.cvsignore
new file mode 100644
index 00000000000..e362b9f8326
--- /dev/null
+++ b/runtime/net_2_0/.cvsignore
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.dll
+*.mdb
diff --git a/runtime/net_2_0/Makefile.am b/runtime/net_2_0/Makefile.am
new file mode 100644
index 00000000000..29b9c852fac
--- /dev/null
+++ b/runtime/net_2_0/Makefile.am
@@ -0,0 +1,121 @@
+# This is just used to copy and install the DLL files that are currently
+# being compiled on windows.
+#
+
+gacutil=$(srcdir)/../gacutil.exe
+framework_version = 2.0
+
+if USE_JIT
+mono_runtime = $(top_builddir)/mono/mini/mono
+else
+mono_runtime = $(top_builddir)/mono/interpreter/mint
+endif
+
+if PLATFORM_WIN32
+MONO_CSHARP_DEBUGGER =
+else
+MONO_CSHARP_DEBUGGER = Mono.CompilerServices.SymbolWriter
+endif
+
+gac_assemblies_list = \
+ Accessibility \
+ ByteFX.Data \
+ Commons.Xml.Relaxng \
+ cscompmgd \
+ I18N.CJK \
+ I18N \
+ I18N.MidEast \
+ I18N.Other \
+ I18N.Rare \
+ I18N.West \
+ ICSharpCode.SharpZipLib \
+ Microsoft.VisualBasic \
+ Microsoft.VisualC \
+ Microsoft.Vsa \
+ Mono.Cairo \
+ $(MONO_CSHARP_DEBUGGER) \
+ Mono.Data.SybaseClient \
+ Mono.Data.SqliteClient \
+ Mono.Data.TdsClient \
+ Mono.Data.Tds \
+ Mono.GetOptions \
+ Mono.Http \
+ Mono.Posix \
+ Mono.Security \
+ Mono.Security.Win32 \
+ Novell.Directory.Ldap \
+ Npgsql \
+ PEAPI \
+ System.Configuration.Install \
+ System.Data \
+ System.Data.OracleClient \
+ System \
+ System.Design \
+ System.DirectoryServices \
+ System.Drawing.Design \
+ System.Drawing \
+ System.EnterpriseServices \
+ System.Management \
+ System.Messaging \
+ System.Runtime.Remoting \
+ System.Runtime.Serialization.Formatters.Soap \
+ System.Security \
+ System.ServiceProcess \
+ System.Web \
+ System.Web.Services \
+ System.Windows.Forms \
+ System.Xml
+
+if PLATFORM_WIN32
+gac_assemblies =
+mdb_files =
+local_mscorlib =
+else
+gac_assemblies = $(gac_assemblies_list:=.dll)
+mdb_files = $(gac_assemblies:=.mdb)
+local_mscorlib = mscorlib.dll
+endif
+
+corlibdir = $(libdir)/mono/$(framework_version)
+corlib_DATA = $(local_mscorlib)
+
+EXTRA_DIST = $(gac_assemblies) $(corlib_DATA) $(mdb_files)
+MAINTAINERCLEANFILES = $(EXTRA_DIST)
+
+mscorlib.dll $(gac_assemblies) $(mdb_files):
+ test -f $(mcs_topdir)/class/lib/net_2_0/$@
+ -rm -f $(srcdir)/$@
+ cd $(srcdir) && $(LN_S) $(mcs_topdir_from_srcdir)/class/lib/net_2_0/$@ $@
+
+all-local: $(gac_assemblies) $(mdb_files)
+
+if INSTALL_2_0
+install-data-local:
+ @if test -f $(srcdir)/mscorlib.dll.mdb; then \
+ echo $(INSTALL_DATA) $(srcdir)/mscorlib.dll.mdb $(DESTDIR)$(corlibdir)/mscorlib.dll.mdb; \
+ $(INSTALL_DATA) $(srcdir)/mscorlib.dll.mdb $(DESTDIR)$(corlibdir)/mscorlib.dll.mdb; \
+ fi
+ @if test -n '$(gac_assemblies)'; then \
+ for i in ''$(gac_assemblies); do \
+ echo "MONO_PATH=$(srcdir)/../net_1_1 $(mono_runtime) --config ../../data/config $(gacutil) /i $(srcdir)/$$i /f /package $(framework_version) /root $(DESTDIR)$(libdir)" ; \
+ MONO_PATH=$(srcdir)/../net_1_1 \
+ $(LIBTOOL) --mode=execute $(mono_runtime) --config ../../data/config $(gacutil) /i $(srcdir)/$$i /f /package $(framework_version) /root $(DESTDIR)$(libdir) || exit 1 ; \
+ done; fi
+
+uninstall-local:
+ @if test -n '$(gac_assemblies_list)'; then \
+ for i in ''$(gac_assemblies_list); do \
+ echo "MONO_PATH=$(srcdir)/../net_1_1 $(mono_runtime) $(gacutil) /u $$i /root $(DESTDIR)$(libdir)" ; \
+ MONO_PATH=$(srcdir)/../net_1_1 \
+ $(LIBTOOL) --mode=execute $(mono_runtime) $(gacutil) /u $$i /root $(DESTDIR)$(libdir) || true ; \
+ done; fi
+else
+install-data-local uninstall-local:
+ @:
+endif
+
+copy_dlls:
+ cp /nt/mono/mcs/class/*/*.dll .
+
+push_dlls:
+ scp -o "Protocol 1" *.dll *.exe snapshot@mono-cvs.ximian.com:dlls
diff --git a/samples/.cvsignore b/samples/.cvsignore
new file mode 100644
index 00000000000..0cf0c5381c3
--- /dev/null
+++ b/samples/.cvsignore
@@ -0,0 +1,3 @@
+Makefile.in
+Makefile
+.cvsignore
diff --git a/samples/Makefile.am b/samples/Makefile.am
new file mode 100644
index 00000000000..d6769d8d70a
--- /dev/null
+++ b/samples/Makefile.am
@@ -0,0 +1,8 @@
+
+dist-hook:
+ mkdir $(distdir)/embed
+ mkdir $(distdir)/profiler
+ cp $(srcdir)/profiler/sample.c $(distdir)/profiler
+ cp $(srcdir)/embed/test.cs $(srcdir)/embed/teste.c $(distdir)/embed
+ cp $(srcdir)/embed/test-metadata.c $(distdir)/embed
+ cp $(srcdir)/embed/test-invoke.c $(srcdir)/embed/invoke.cs $(distdir)/embed
diff --git a/samples/embed/invoke.cs b/samples/embed/invoke.cs
new file mode 100644
index 00000000000..19e2775d3a5
--- /dev/null
+++ b/samples/embed/invoke.cs
@@ -0,0 +1,50 @@
+using System;
+
+namespace Embed {
+ class MyType {
+ int val = 5;
+ string str = "hello";
+
+ MyType () {
+ Console.WriteLine ("In ctor val is: {0}", val);
+ Console.WriteLine ("In ctor str is: {0}", str);
+ }
+
+ MyType (int v, byte[] array) {
+ Console.WriteLine ("In ctor (int, byte[]) got value: {0}, array len: {1}", v, array.Length);
+ }
+
+ void method () {
+ Console.WriteLine ("In method val is {0}", val);
+ Console.WriteLine ("In method str is: {0}", str);
+ }
+
+ int Value {
+ get {
+ return val;
+ }
+ }
+
+ string Message {
+ get {
+ return str;
+ }
+ }
+
+ void Values (ref int v, ref string s) {
+ Console.WriteLine ("In Values () v is {0}", v);
+ Console.WriteLine ("In Values () s is: {0}", s);
+ v = val;
+ s = str;
+ }
+
+ static void Fail () {
+ throw new Exception ();
+ }
+
+ static void Main () {
+ /* we do nothing here... */
+ }
+ }
+}
+
diff --git a/samples/embed/test-invoke.c b/samples/embed/test-invoke.c
new file mode 100644
index 00000000000..899a6b228a8
--- /dev/null
+++ b/samples/embed/test-invoke.c
@@ -0,0 +1,356 @@
+#include <mono/jit/jit.h>
+#include <mono/metadata/environment.h>
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/debug-helpers.h>
+#include <string.h>
+#include <stdlib.h>
+
+/*
+ * Simple mono embedding example.
+ * We show how to create objects and invoke methods and set fields in them.
+ * Compile with:
+ * gcc -Wall -o test-invoke test-invoke.c `pkg-config --cflags --libs mono` -lm
+ * mcs invoke.cs
+ * Run with:
+ * ./test-invoke invoke.exe
+ */
+
+typedef struct
+{
+ MonoDomain *domain;
+ const char *file;
+ int argc;
+ char **argv;
+} MainThreadArgs;
+
+static void
+access_valuetype_field (MonoObject *obj)
+{
+ MonoClass *klass;
+ MonoClassField *field;
+ int val;
+
+ klass = mono_object_get_class (obj);
+
+ /* Now we'll change the value of the 'val' field (see invoke.cs) */
+ field = mono_class_get_field_from_name (klass, "val");
+
+ /* This time we also add a bit of error checking... */
+ if (!field) {
+ fprintf (stderr, "Can't find field val in MyType\n");
+ exit (1);
+ }
+ /* Check that val is an int (if you're paranoid or if you need to
+ * show how this API is used)
+ */
+ if (mono_type_get_type (mono_field_get_type (field)) != MONO_TYPE_I4) {
+ fprintf (stderr, "Field val is not a 32 bit integer\n");
+ exit (1);
+ }
+
+ /* Note we pass a pointer to the value */
+ mono_field_get_value (obj, field, &val);
+ printf ("Value of field is: %d\n", val);
+ val = 10;
+
+ /* Note we pass a pointer to the value here as well */
+ mono_field_set_value (obj, field, &val);
+
+}
+
+static void
+access_reference_field (MonoObject *obj)
+{
+ MonoClass *klass;
+ MonoDomain *domain;
+ MonoClassField *str;
+ MonoString *strval;
+ char *p;
+
+ klass = mono_object_get_class (obj);
+ domain = mono_object_get_domain (obj);
+
+ /* Now we'll see that a reference type is handled slightly differently.
+ * First, get the MonoClassField representing it.
+ */
+ str = mono_class_get_field_from_name (klass, "str");
+
+ /* No change here, we always pass a pointer */
+ mono_field_get_value (obj, str, &strval);
+
+ /* get the string in UTF-8 encoding to print it */
+ p = mono_string_to_utf8 (strval);
+ printf ("Value of str is: %s\n", p);
+ /* we need to free the result from mono_string_to_utf8 () */
+ g_free (p);
+
+ /* string are immutable, so we need to create a different string */
+ strval = mono_string_new (domain, "hello from the embedding API");
+
+ /* Here is the slight difference: for reference types we pass
+ * the pointer directly, instead of a pointer to the value.
+ */
+ mono_field_set_value (obj, str, strval);
+
+}
+
+/* Demostrate how to call methods */
+static void
+call_methods (MonoObject *obj)
+{
+ MonoClass *klass;
+ MonoDomain *domain;
+ MonoMethod *method = NULL, *m = NULL, *ctor = NULL, *fail = NULL, *mvalues;
+ MonoProperty *prop;
+ MonoObject *result, *exception;
+ MonoString *str;
+ char *p;
+ gpointer iter;
+ gpointer args [2];
+ int val;
+
+ klass = mono_object_get_class (obj);
+ domain = mono_object_get_domain (obj);
+
+ /* retrieve all the methods we need */
+ iter = NULL;
+ while ((m = mono_class_get_methods (klass, &iter))) {
+ if (strcmp (mono_method_get_name (m), "method") == 0) {
+ method = m;
+ } else if (strcmp (mono_method_get_name (m), "Fail") == 0) {
+ fail = m;
+ } else if (strcmp (mono_method_get_name (m), "Values") == 0) {
+ mvalues = m;
+ } else if (strcmp (mono_method_get_name (m), ".ctor") == 0) {
+ /* Check it's the ctor that takes two args:
+ * as you see a contrsuctor is a method like any other.
+ */
+ MonoMethodSignature * sig = mono_method_signature (m);
+ if (mono_signature_get_param_count (sig) == 2) {
+ ctor = m;
+ }
+ }
+ }
+ /* Now we'll call method () on obj: since it takes no arguments
+ * we can pass NULL as the third argument to mono_runtime_invoke ().
+ * The method will print the updated value.
+ */
+ mono_runtime_invoke (method, obj, NULL, NULL);
+
+ /* mono_object_new () doesn't call any constructor: this means that
+ * we'll have to invoke the constructor if needed ourselves. Note:
+ * invoking a constructor is no different than calling any other method,
+ * so we'll still call mono_runtime_invoke (). This also means that we
+ * can invoke a constructor at any time, like now.
+ * First, setup the array of arguments and their values.
+ */
+
+ /* As usual, we use the address of the data for valuetype arguments */
+ val = 7;
+ args [0] = &val;
+ /* and the pointer for reference types: mono_array_new () returns a MonoArray* */
+ args [1] = mono_array_new (domain, mono_get_byte_class (), 256);
+ mono_runtime_invoke (ctor, obj, args, NULL);
+
+ /* A property exists only as a metadata entity, so getting or setting the value
+ * is nothing more than calling mono_runtime_invoke () on the getter or setter method.
+ */
+ prop = mono_class_get_property_from_name (klass, "Value");
+ method = mono_property_get_get_method (prop);
+ result = mono_runtime_invoke (method, obj, NULL, NULL);
+ /* mono_runtime_invoke () always boxes the return value if it's a valuetype */
+ val = *(int*)mono_object_unbox (result);
+
+ printf ("Value of val from property is: %d\n", val);
+
+ /* we also have an helper method: note that reference types are returned as is */
+ prop = mono_class_get_property_from_name (klass, "Message");
+ str = (MonoString*)mono_property_get_value (prop, obj, NULL, NULL);
+ /* get the string in UTF-8 encoding to print it */
+ p = mono_string_to_utf8 (str);
+ printf ("Value of str from property is: %s\n", p);
+ /* we need to free the result from mono_string_to_utf8 () */
+ g_free (p);
+
+ /* Now we'll show two things:
+ * 1) static methods are invoked with mono_runtime_invoke () as well,
+ * we just pass NULL as the second argument.
+ * 2) we can catch exceptions thrown by the called method.
+ * Note: fail is declared as static void Fail () in invoke.cs.
+ * We first set result to NULL: if after the invocation it will have
+ * a different value, it will be the exception that was thrown from
+ * the Fail () method. Note that if an exception was thrown, the return
+ * value (if any) is undefined and can't be used in any way (yes, the above
+ * invocations don't have this type of error checking to make things simpler).
+ */
+ exception = NULL;
+ mono_runtime_invoke (fail, NULL, NULL, &exception);
+ if (exception) {
+ printf ("An exception was thrown in Fail ()\n");
+ }
+
+ /* Now let's see how to handle methods that take by ref arguments:
+ * Valuetypes continue to be passed as pointers to the data.
+ * Reference arguments passed by ref (ref or out is the same)
+ * are handled the same way: a pointer to the pointer is used
+ * (so that the result can be read back).
+ * Small note: in this case (a System.Int32 valuetype) we can just
+ * use &val where val is a C 32 bit integer. In the general case
+ * unmanaged code doesn't know the size of a valuetype, since the
+ * runtime may decide to lay it out in what it thinks is a better way
+ * (unless ExplicitLayout is set). To avoid issues, the best thing is to
+ * create an object of the valuetype's class and retrieve the pointer
+ * to the data with the mono_object_unbox () function.
+ */
+ val = 100;
+ str = mono_string_new (domain, "another string");
+ args [0] = &val;
+ args [1] = &str;
+ mono_runtime_invoke (mvalues, obj, args, NULL);
+ /* get the string in UTF-8 encoding to print it */
+ p = mono_string_to_utf8 (str);
+ printf ("Values of str/val from Values () are: %s/%d\n", p, val);
+ /* we need to free the result from mono_string_to_utf8 () */
+ g_free (p);
+}
+
+static void
+more_methods (MonoDomain *domain)
+{
+ MonoClass *klass;
+ MonoMethodDesc* mdesc;
+ MonoMethod *method, *vtmethod;
+ MonoString *str;
+ MonoObject *obj;
+ char *p;
+ int val;
+
+ /* Now let's call an instance method on a valuetype. There are two
+ * different case:
+ * 1) calling a virtual method defined in a base class, like ToString ():
+ * we need to pass the value boxed in an object
+ * 2) calling a normal instance method: in this case
+ * we pass the address to the valuetype as the second argument
+ * instead of an object.
+ * First some initialization.
+ */
+ val = 25;
+ klass = mono_get_int32_class ();
+ obj = mono_value_box (domain, klass, &val);
+
+ /* A different way to search for a method */
+ mdesc = mono_method_desc_new (":ToString()", FALSE);
+ vtmethod = mono_method_desc_search_in_class (mdesc, klass);
+
+ str = (MonoString*)mono_runtime_invoke (vtmethod, &val, NULL, NULL);
+ /* get the string in UTF-8 encoding to print it */
+ p = mono_string_to_utf8 (str);
+ printf ("25.ToString (): %s\n", p);
+ /* we need to free the result from mono_string_to_utf8 () */
+ g_free (p);
+
+ /* Now: see how the result is different if we search for the ToString ()
+ * method in System.Object: mono_runtime_invoke () doesn't do any sort of
+ * virtual method invocation: it calls the exact method that it was given
+ * to execute. If a virtual call is needed, mono_object_get_virtual_method ()
+ * can be called.
+ */
+ method = mono_method_desc_search_in_class (mdesc, mono_get_object_class ());
+ str = (MonoString*)mono_runtime_invoke (method, obj, NULL, NULL);
+ /* get the string in UTF-8 encoding to print it */
+ p = mono_string_to_utf8 (str);
+ printf ("25.ToString (), from System.Object: %s\n", p);
+ /* we need to free the result from mono_string_to_utf8 () */
+ g_free (p);
+
+ /* Now get the method that overrides ToString () in obj */
+ vtmethod = mono_object_get_virtual_method (obj, method);
+ if (mono_class_is_valuetype (mono_method_get_class (vtmethod))) {
+ printf ("Need to unbox this for call to virtual ToString () for %s\n", mono_class_get_name (klass));
+ }
+
+ mono_method_desc_free (mdesc);
+}
+
+static void
+create_object (MonoDomain *domain, MonoImage *image)
+{
+ MonoClass *klass;
+ MonoObject *obj;
+
+ klass = mono_class_from_name (image, "Embed", "MyType");
+ if (!klass) {
+ fprintf (stderr, "Can't find MyType in assembly %s\n", mono_image_get_filename (image));
+ exit (1);
+ }
+
+ obj = mono_object_new (domain, klass);
+ /* mono_object_new () only allocates the storage:
+ * it doesn't run any constructor. Tell the runtime to run
+ * the default argumentless constructor.
+ */
+ mono_runtime_object_init (obj);
+
+ access_valuetype_field (obj);
+ access_reference_field (obj);
+
+ call_methods (obj);
+ more_methods (domain);
+}
+
+static void main_thread_handler (gpointer user_data)
+{
+ MainThreadArgs *main_args=(MainThreadArgs *)user_data;
+ MonoAssembly *assembly;
+
+ /* Loading an assembly makes the runtime setup everything
+ * needed to execute it. If we're just interested in the metadata
+ * we'd use mono_image_load (), instead and we'd get a MonoImage*.
+ */
+ assembly = mono_domain_assembly_open (main_args->domain,
+ main_args->file);
+ if (!assembly)
+ exit (2);
+ /*
+ * mono_jit_exec() will run the Main() method in the assembly.
+ * The return value needs to be looked up from
+ * System.Environment.ExitCode.
+ */
+ mono_jit_exec (main_args->domain, assembly, main_args->argc,
+ main_args->argv);
+
+ create_object (main_args->domain, mono_assembly_get_image (assembly));
+}
+
+int
+main (int argc, char* argv[]) {
+ MonoDomain *domain;
+ const char *file;
+ int retval;
+ MainThreadArgs main_args;
+
+ if (argc < 2){
+ fprintf (stderr, "Please provide an assembly to load\n");
+ return 1;
+ }
+ file = argv [1];
+ /*
+ * mono_jit_init() creates a domain: each assembly is
+ * loaded and run in a MonoDomain.
+ */
+ domain = mono_jit_init (file);
+
+ main_args.domain=domain;
+ main_args.file=file;
+ main_args.argc=argc-1;
+ main_args.argv=argv+1;
+
+ mono_runtime_exec_managed_code (domain, main_thread_handler,
+ &main_args);
+
+ retval=mono_environment_exitcode_get ();
+
+ mono_jit_cleanup (domain);
+ return retval;
+}
+
diff --git a/samples/embed/test-metadata.c b/samples/embed/test-metadata.c
new file mode 100644
index 00000000000..689a30d55ac
--- /dev/null
+++ b/samples/embed/test-metadata.c
@@ -0,0 +1,132 @@
+#include <mono/jit/jit.h>
+
+/*
+ * Very simple mono embedding example.
+ * This sample shows how to access metadata elements from an image.
+ * Compile with:
+ * gcc -o test-metadata test-metadata.c `pkg-config --cflags --libs mono` -lm
+ * Run with:
+ * ./test-metadata namespace name
+ */
+
+void
+output_desc (MonoClass* klass) {
+ printf ("Class name: %s.%s\n", mono_class_get_namespace (klass), mono_class_get_name (klass));
+ printf ("Rank: %d, flags 0x%0x\n", mono_class_get_rank (klass), mono_class_get_flags (klass));
+}
+
+void
+output_ifaces (MonoClass* klass) {
+ MonoClass *iface;
+ gpointer iter = NULL;
+
+ printf ("Implements: ");
+ while ((iface = mono_class_get_interfaces (klass, &iter))) {
+ printf ("%s ", mono_class_get_name (iface));
+ }
+ printf ("\n");
+}
+
+void
+output_nested (MonoClass* klass) {
+ MonoClass *nested;
+ gpointer iter = NULL;
+
+ printf ("Has nested types: ");
+ while ((nested = mono_class_get_nested_types (klass, &iter))) {
+ printf ("%s ", mono_class_get_name (nested));
+ }
+ printf ("\n");
+}
+
+void
+output_fields (MonoClass* klass) {
+ MonoClassField *field;
+ gpointer iter = NULL;
+
+ while ((field = mono_class_get_fields (klass, &iter))) {
+ printf ("Field: %s, flags 0x%x\n", mono_field_get_name (field),
+ mono_field_get_flags (field));
+ }
+}
+
+void
+output_methods (MonoClass* klass) {
+ MonoMethod *method;
+ gpointer iter = NULL;
+
+ while ((method = mono_class_get_methods (klass, &iter))) {
+ guint32 flags, iflags;
+ flags = mono_method_get_flags (method, &iflags);
+ printf ("Method: %s, flags 0x%x, iflags 0x%x\n",
+ mono_method_get_name (method), flags, iflags);
+ }
+}
+
+void
+output_properties (MonoClass* klass) {
+ MonoProperty *prop;
+ gpointer iter = NULL;
+
+ while ((prop = mono_class_get_properties (klass, &iter))) {
+ printf ("Property: %s, flags 0x%x\n", mono_property_get_name (prop),
+ mono_property_get_flags (prop));
+ }
+}
+
+void
+output_events (MonoClass* klass) {
+ MonoEvent *event;
+ gpointer iter = NULL;
+
+ while ((event = mono_class_get_events (klass, &iter))) {
+ printf ("Event: %s, flags: 0x%x\n", mono_event_get_name (event),
+ mono_event_get_flags (event));
+ }
+}
+
+int
+main (int argc, char* argv[]) {
+ MonoDomain *domain;
+ MonoClass *klass;
+ MonoImage *image;
+ const char *ns, *name;
+
+ if (argc < 3){
+ fprintf (stderr, "Please provide namespace and name of a type in mscorlib.\n");
+ return 1;
+ }
+ ns = argv [1];
+ name = argv [2];
+ /*
+ * mono_jit_init() creates a domain: each assembly is
+ * loaded and run in a MonoDomain.
+ */
+ domain = mono_jit_init (argv [0]);
+ if (argc > 3) {
+ MonoImageOpenStatus status;
+ image = mono_image_open (argv [3], &status);
+ if (!image) {
+ fprintf (stderr, "Can't load assembly \"%s\".\n", argv [3]);
+ return 1;
+ }
+ } else {
+ /* we default to using mscorlib */
+ image = mono_get_corlib ();
+ }
+ klass = mono_class_from_name (image, ns, name);
+ if (!klass) {
+ fprintf (stderr, "Class \"%s.%s\" not found.\n", ns, name);
+ return 1;
+ }
+ output_desc (klass);
+ output_ifaces (klass);
+ output_nested (klass);
+ output_fields (klass);
+ output_methods (klass);
+ output_properties (klass);
+ output_events (klass);
+ mono_jit_cleanup (domain);
+ return 0;
+}
+
diff --git a/samples/embed/test.cs b/samples/embed/test.cs
new file mode 100644
index 00000000000..3283006d8b3
--- /dev/null
+++ b/samples/embed/test.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Runtime.CompilerServices;
+
+class MonoEmbed {
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static string gimme();
+
+ static void Main() {
+ Console.WriteLine (gimme ());
+ }
+}
diff --git a/samples/embed/teste.c b/samples/embed/teste.c
new file mode 100644
index 00000000000..d67720a145f
--- /dev/null
+++ b/samples/embed/teste.c
@@ -0,0 +1,81 @@
+#include <mono/jit/jit.h>
+#include <mono/metadata/environment.h>
+
+/*
+ * Very simple mono embedding example.
+ * Compile with:
+ * gcc -o teste teste.c `pkg-config --cflags --libs mono` -lm
+ * mcs test.cs
+ * Run with:
+ * ./teste test.exe
+ */
+
+static MonoString*
+gimme () {
+ return mono_string_new (mono_domain_get (), "All your monos are belong to us!");
+}
+
+typedef struct
+{
+ MonoDomain *domain;
+ const char *file;
+ int argc;
+ char **argv;
+} MainThreadArgs;
+
+static void main_thread_handler (gpointer user_data)
+{
+ MainThreadArgs *main_args=(MainThreadArgs *)user_data;
+ MonoAssembly *assembly;
+
+ assembly = mono_domain_assembly_open (main_args->domain,
+ main_args->file);
+ if (!assembly)
+ exit (2);
+ /*
+ * mono_jit_exec() will run the Main() method in the assembly.
+ * The return value needs to be looked up from
+ * System.Environment.ExitCode.
+ */
+ mono_jit_exec (main_args->domain, assembly, main_args->argc,
+ main_args->argv);
+}
+
+
+int
+main(int argc, char* argv[]) {
+ MonoDomain *domain;
+ const char *file;
+ int retval;
+ MainThreadArgs main_args;
+
+ if (argc < 2){
+ fprintf (stderr, "Please provide an assembly to load");
+ return 1;
+ }
+ file = argv [1];
+ /*
+ * mono_jit_init() creates a domain: each assembly is
+ * loaded and run in a MonoDomain.
+ */
+ domain = mono_jit_init (file);
+ /*
+ * We add our special internal call, so that C# code
+ * can call us back.
+ */
+ mono_add_internal_call ("MonoEmbed::gimme", gimme);
+
+ main_args.domain=domain;
+ main_args.file=file;
+ main_args.argc=argc-1;
+ main_args.argv=argv+1;
+
+ mono_runtime_exec_managed_code (domain, main_thread_handler,
+ &main_args);
+
+ retval=mono_environment_exitcode_get ();
+
+ mono_jit_cleanup (domain);
+ return retval;
+}
+
diff --git a/samples/embed/testi.c b/samples/embed/testi.c
new file mode 100644
index 00000000000..a1ea82b633f
--- /dev/null
+++ b/samples/embed/testi.c
@@ -0,0 +1,81 @@
+#include <mono/interpreter/embed.h>
+#include <mono/metadata/environment.h>
+
+/*
+ * Very simple mint embedding example.
+ * Compile with:
+ * gcc -o testi testi.c `pkg-config --cflags --libs mint` -lm
+ * mcs test.cs
+ * Run with:
+ * ./testi test.exe
+ */
+
+static MonoString*
+gimme () {
+ return mono_string_new (mono_domain_get (), "All your monos are belong to us!");
+}
+
+typedef struct
+{
+ MonoDomain *domain;
+ const char *file;
+ int argc;
+ char **argv;
+} MainThreadArgs;
+
+static void main_thread_handler (gpointer user_data)
+{
+ MainThreadArgs *main_args=(MainThreadArgs *)user_data;
+ MonoAssembly *assembly;
+
+ assembly = mono_domain_assembly_open (main_args->domain,
+ main_args->file);
+ if (!assembly)
+ exit (2);
+ /*
+ * mono_jit_exec() will run the Main() method in the assembly.
+ * The return value needs to be looked up from
+ * System.Environment.ExitCode.
+ */
+ mono_interp_exec (main_args->domain, assembly, main_args->argc,
+ main_args->argv);
+}
+
+
+int
+main(int argc, char* argv[]) {
+ MonoDomain *domain;
+ const char *file;
+ int retval;
+ MainThreadArgs main_args;
+
+ if (argc < 2){
+ fprintf (stderr, "Please provide an assembly to load\n");
+ return 1;
+ }
+ file = argv [1];
+ /*
+ * mono_jit_init() creates a domain: each assembly is
+ * loaded and run in a MonoDomain.
+ */
+ domain = mono_interp_init (file);
+ /*
+ * We add our special internal call, so that C# code
+ * can call us back.
+ */
+ mono_add_internal_call ("MonoEmbed::gimme", gimme);
+
+ main_args.domain=domain;
+ main_args.file=file;
+ main_args.argc=argc-1;
+ main_args.argv=argv+1;
+
+ mono_runtime_exec_managed_code (domain, main_thread_handler,
+ &main_args);
+
+ retval=mono_environment_exitcode_get ();
+
+ mono_interp_cleanup (domain);
+ return retval;
+}
+
diff --git a/samples/profiler/sample.c b/samples/profiler/sample.c
new file mode 100644
index 00000000000..49af781a55a
--- /dev/null
+++ b/samples/profiler/sample.c
@@ -0,0 +1,48 @@
+#include <mono/metadata/profiler.h>
+
+/*
+ * 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.
+ * Then run mono with:
+ * mono --profile=sample your_application.exe
+ */
+
+struct _MonoProfiler {
+ int ncalls;
+};
+
+/* called at the end of the program */
+static void
+sample_shutdown (MonoProfiler *prof)
+{
+ g_print ("total number of calls: %d\n", prof->ncalls);
+}
+
+static void
+sample_method_enter (MonoProfiler *prof, MonoMethod *method)
+{
+ prof->ncalls++;
+}
+
+static void
+sample_method_leave (MonoProfiler *prof, MonoMethod *method)
+{
+}
+
+/* the entry point */
+void
+mono_profiler_startup (const char *desc)
+{
+ MonoProfiler *prof;
+
+ prof = g_new0 (MonoProfiler, 1);
+
+ mono_profiler_install (prof, sample_shutdown);
+
+ mono_profiler_install_enter_leave (sample_method_enter, sample_method_leave);
+
+ mono_profiler_set_events (MONO_PROFILE_ENTER_LEAVE);
+}
+
+
diff --git a/scripts/.cvsignore b/scripts/.cvsignore
index 18805a6a484..7d44991f43f 100644
--- a/scripts/.cvsignore
+++ b/scripts/.cvsignore
@@ -1,3 +1,28 @@
Makefile
Makefile.in
+cilc
+ilasm
+mbas
mcs
+monoresgen
+secutil
+sqlsharp
+xsd
+wsdl
+genxs
+chktrust
+signcode
+disco
+al
+soapsuds
+sn
+cert2spc
+setreg
+makecert
+certmgr
+gmcs
+monop
+resgen
+gacutil
+mono-find-provides
+mono-find-requires
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index e43f643e445..b301ff5df55 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,9 +1,61 @@
-EXTRA_DIST = mcs.in
+EXTRA_DIST = mcs.in mbas.in ilasm.in cilc.in monoresgen.in resgen.in secutil.in sqlsharp.in xsd.in wsdl.in genxs.in soapsuds.in chktrust.in signcode.in disco.in sn.in al.in cert2spc.in setreg.in makecert.in certmgr.in monop.in gacutil.in gmcs.in mono-find-provides.in mono-find-requires.in
-bin_SCRIPTS = mcs
+bin_SCRIPTS = mcs mbas ilasm cilc monoresgen resgen secutil sqlsharp xsd wsdl al genxs soapsuds chktrust signcode disco sn cert2spc setreg makecert certmgr monop gacutil gmcs mono-find-requires mono-find-provides
-CLEANFILES = mcs
+CLEANFILES = $(bin_SCRIPTS)
+
+if USE_JIT
+MONO_INTERP = mono
+else
+MONO_INTERP = mint
+endif
+
+if PLATFORM_WIN32
+plat_bindir = $(shell cygpath -m $(libdir))
+mono_one_instdir = $(shell cygpath -m $(libdir))/mono/1.0
+monO_two_instdir = $(shell cygpath -m $(libdir))/mono/2.0
+else
+plat_bindir = $(bindir)
+mono_one_instdir = $(libdir)/mono/1.0
+mono_two_instdir = $(libdir)/mono/2.0
+endif
+
+REWRITE = sed \
+ -e 's,@''bindir@,$(bindir),g' \
+ -e 's,@''plat_bindir@,$(plat_bindir),g' \
+ -e 's,@''mono_one_instdir@,$(mono_one_instdir),g' \
+ -e 's,@''mono_two_instdir@,$(mono_two_instdir),g' \
+ -e 's,@''gtkdir@,$(gtkdir),g' \
+ -e 's,@''mono_interp@,$(MONO_INTERP),g'
+
+$(bin_SCRIPTS): Makefile.am
+ $(REWRITE) $(srcdir)/$@.in > $@.tmp
+ mv $@.tmp $@
mcs: mcs.in
- sed -e 's^\@bindir\@^$(bindir)^g' < $(srcdir)/mcs.in > mcs.tmp \
- && mv mcs.tmp mcs
+gmcs: gmcs.in
+mbas: mbas.in
+ilasm: ilasm.in
+cilc: cilc.in
+monoresgen: monoresgen.in
+resgen: resgen.in
+secutil: secutil.in
+sqlsharp: sqlsharp.in
+xsd: xsd.in
+wsdl: wsdl.in
+wsdl2: wsdl2.in
+al: al.in
+genxs: genxs.in
+disco: disco.in
+soapsuds: soapsuds.in
+chktrust: chktrust.in
+signcode: signcode.in
+sn: sn.in
+cert2spc: cert2spc.in
+setreg: setreg.in
+makecert: makecert.in
+certmgr: certmgr.in
+monop: monop.in
+gacutil: gacutil.in
+mono-find-provides: mono-find-provides.in
+mono-find-requires: mono-find-requires.in
diff --git a/scripts/al.in b/scripts/al.in
new file mode 100644
index 00000000000..cc83c136454
--- /dev/null
+++ b/scripts/al.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/al.exe "$@"
diff --git a/scripts/cert2spc.in b/scripts/cert2spc.in
new file mode 100644
index 00000000000..df973685c4a
--- /dev/null
+++ b/scripts/cert2spc.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/cert2spc.exe "$@"
diff --git a/scripts/certmgr.in b/scripts/certmgr.in
new file mode 100644
index 00000000000..1d3eed078f2
--- /dev/null
+++ b/scripts/certmgr.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/certmgr.exe "$@"
diff --git a/scripts/chktrust.in b/scripts/chktrust.in
new file mode 100644
index 00000000000..5c9e1be097e
--- /dev/null
+++ b/scripts/chktrust.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/chktrust.exe "$@"
diff --git a/scripts/cilc.in b/scripts/cilc.in
new file mode 100644
index 00000000000..ba15bd4f22c
--- /dev/null
+++ b/scripts/cilc.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/cilc.exe "$@"
diff --git a/scripts/disco.in b/scripts/disco.in
new file mode 100644
index 00000000000..7d0c1341b96
--- /dev/null
+++ b/scripts/disco.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/disco.exe "$@"
diff --git a/scripts/gacutil.in b/scripts/gacutil.in
new file mode 100644
index 00000000000..ce28b4e9ede
--- /dev/null
+++ b/scripts/gacutil.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/gacutil.exe "$@"
diff --git a/scripts/genxs.in b/scripts/genxs.in
new file mode 100644
index 00000000000..c1ae8c95f77
--- /dev/null
+++ b/scripts/genxs.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/genxs.exe "$@"
diff --git a/scripts/gmcs.in b/scripts/gmcs.in
new file mode 100644
index 00000000000..704dcf29ae9
--- /dev/null
+++ b/scripts/gmcs.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+MONO_PATH="@mono_two_instdir@:$MONO_PATH" exec @bindir@/@mono_interp@ @mono_two_instdir@/gmcs.exe "$@"
diff --git a/scripts/ilasm.in b/scripts/ilasm.in
new file mode 100644
index 00000000000..f68edb31e3f
--- /dev/null
+++ b/scripts/ilasm.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/ilasm.exe "$@"
diff --git a/scripts/makecert.in b/scripts/makecert.in
new file mode 100644
index 00000000000..d9739d3b7c8
--- /dev/null
+++ b/scripts/makecert.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/MakeCert.exe "$@"
diff --git a/scripts/mbas.in b/scripts/mbas.in
new file mode 100644
index 00000000000..6860e8db14c
--- /dev/null
+++ b/scripts/mbas.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @mono_one_instdir@/mbas.exe "$@"
diff --git a/scripts/mcs.in b/scripts/mcs.in
index 2528d81d52d..f8ce4ffad06 100644
--- a/scripts/mcs.in
+++ b/scripts/mcs.in
@@ -1,2 +1,2 @@
#!/bin/sh
-@bindir@/mono @bindir@/mcs.exe "$@"
+exec @bindir@/@mono_interp@ @mono_one_instdir@/mcs.exe "$@"
diff --git a/scripts/mono-find-provides.in b/scripts/mono-find-provides.in
new file mode 100644
index 00000000000..e287f2d7017
--- /dev/null
+++ b/scripts/mono-find-provides.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/mono-find-provides.exe "$@"
diff --git a/scripts/mono-find-requires.in b/scripts/mono-find-requires.in
new file mode 100644
index 00000000000..2493842ecb5
--- /dev/null
+++ b/scripts/mono-find-requires.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/mono-find-requires.exe "$@"
diff --git a/scripts/monop.in b/scripts/monop.in
new file mode 100644
index 00000000000..5dfba65a5c1
--- /dev/null
+++ b/scripts/monop.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/monop.exe "$@"
diff --git a/scripts/monoresgen.in b/scripts/monoresgen.in
new file mode 100644
index 00000000000..b50ebeeb6af
--- /dev/null
+++ b/scripts/monoresgen.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/monoresgen.exe "$@"
diff --git a/scripts/resgen.in b/scripts/resgen.in
new file mode 100644
index 00000000000..b50ebeeb6af
--- /dev/null
+++ b/scripts/resgen.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/monoresgen.exe "$@"
diff --git a/scripts/secutil.in b/scripts/secutil.in
new file mode 100644
index 00000000000..51ad921621f
--- /dev/null
+++ b/scripts/secutil.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/secutil.exe "$@"
diff --git a/scripts/setreg.in b/scripts/setreg.in
new file mode 100644
index 00000000000..a87c98ac86c
--- /dev/null
+++ b/scripts/setreg.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/setreg.exe "$@"
diff --git a/scripts/signcode.in b/scripts/signcode.in
new file mode 100644
index 00000000000..5cdc1e05df6
--- /dev/null
+++ b/scripts/signcode.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/signcode.exe "$@"
diff --git a/scripts/sn.in b/scripts/sn.in
new file mode 100644
index 00000000000..6884c00cbf8
--- /dev/null
+++ b/scripts/sn.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/sn.exe "$@"
diff --git a/scripts/soapsuds.in b/scripts/soapsuds.in
new file mode 100644
index 00000000000..8c7dfe5eb52
--- /dev/null
+++ b/scripts/soapsuds.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/soapsuds.exe "$@"
diff --git a/scripts/sqlsharp.in b/scripts/sqlsharp.in
new file mode 100644
index 00000000000..f93bf07e873
--- /dev/null
+++ b/scripts/sqlsharp.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/sqlsharp.exe "$@"
diff --git a/scripts/wsdl.in b/scripts/wsdl.in
new file mode 100644
index 00000000000..458c6427147
--- /dev/null
+++ b/scripts/wsdl.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/wsdl.exe "$@"
diff --git a/scripts/wsdl2.in b/scripts/wsdl2.in
new file mode 100644
index 00000000000..b3e3bcdb9cb
--- /dev/null
+++ b/scripts/wsdl2.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/wsdl2.exe "$@"
diff --git a/scripts/xsd.in b/scripts/xsd.in
new file mode 100644
index 00000000000..6d5cc580bdf
--- /dev/null
+++ b/scripts/xsd.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/@mono_interp@ @plat_bindir@/xsd.exe "$@"
diff --git a/status/ChangeLog b/status/ChangeLog
index e9949e49263..fc3bda6155d 100755
--- a/status/ChangeLog
+++ b/status/ChangeLog
@@ -1,3 +1,24 @@
+2002-07-13 Jonathan Pryor <jonpryor@vt.edu>
+ * class.xml: Added entries for the following classes from System.Diagnostics:
+ - CounterCreationData.cs: Implemented
+ - CounterCreationDataCollection.cs: Implemented
+ - CounterSample.cs: Stubbed Out
+ - CounterSampleCalculator.cs: Stubbed Out
+ - InstanceData.cs: Implemented
+ - InstanceDataCollection.cs: Implemented
+ - InstanceDataCollectionCollection.cs: Implemented
+ - MonitoringDescriptionAttribute.cs: Implemented
+ - PerformanceCounter.cs: Stubbed Out
+ - PerformanceCounterCategory.cs: Stubbed Out
+ - PerformanceCounterInstaller.cs: Stubbed Out
+ - PerformanceCounterManager.cs: Stubbed Out
+ - PerformanceCounterPermission.cs: Stubbed Out
+ - PerformanceCounterPermissionAccess.cs: Implemented
+ - PerformanceCounterPermissionAttribute.cs: Stubbed Out
+ - PerformanceCounterPermissionEntry.cs: Stubbed Out
+ - PerformanceCounterPermissionEntryCollection.cs: Implemented
+ - PerformanceCounterType.cs: Implemented
+
2002-06-09 Jonathan Pryor <jonpryor@vt.edu>
* class.xml: Added entries for the following classes from System.Diagnostics:
- EntryWrittenEventArgs
diff --git a/status/class.xml b/status/class.xml
index 4a044c84eb7..4d49af3a4c0 100755
--- a/status/class.xml
+++ b/status/class.xml
@@ -849,6 +849,42 @@
<maintainer>ndrochak@gol.com</maintainer>
</maintainers>
</class>
+ <class name="System.Diagnostics.CounterCreationData">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>99</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.CounterCreationDataCollection">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>99</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.CounterSample">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>80</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.CounterSampleCalculator">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>5</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
<class name="System.Diagnostics.Debug">
<last-activity>March-08-2002</last-activity>
<implementation>yes</implementation>
@@ -1020,6 +1056,132 @@
<maintainer>jonpryor@vt.edu</maintainer>
</maintainers>
</class>
+ <class name="System.Diagnostics.InstanceData">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>99</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.InstanceDataCollection">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>99</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.InstanceDataCollectionCollection">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>99</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.MonitoringDescriptionAttribute">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>99</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounter">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>25</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterCategory">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>5</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterInstaller">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>5</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterManager">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>5</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterPermission">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>5</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterPermissionAccess">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>100</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterPermissionAttribute">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>5</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterPermissionEntry">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>5</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterPermissionEntryCollection">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>99</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
+ <class name="System.Diagnostics.PerformanceCounterType">
+ <last-activity>Jul-13-2002</last-activity>
+ <implementation>yes</implementation>
+ <test-suite>no</test-suite>
+ <completion>100</completion>
+ <maintainers>
+ <maintainer>jonpryor@vt.edu</maintainer>
+ </maintainers>
+ </class>
<class name="System.Diagnostics.Process">
<last-activity>Apr-04-2002</last-activity>
<implementation>yes</implementation>
diff --git a/support/.cvsignore b/support/.cvsignore
new file mode 100644
index 00000000000..6c01cd04084
--- /dev/null
+++ b/support/.cvsignore
@@ -0,0 +1,23 @@
+Makefile.in
+Makefile
+.deps
+.libs
+libMonoPosixHelper.la
+macros.lo
+map.lo
+dirent.lo
+errno.lo
+fcntl.lo
+grp.lo
+map.lo
+old-map.lo
+pwd.lo
+stdio.lo
+stdlib.lo
+sys-mman.lo
+sys-mount.lo
+sys-stat.lo
+sys-wait.lo
+time.lo
+unistd.lo
+zlib_macros.lo
diff --git a/support/Makefile.am b/support/Makefile.am
new file mode 100644
index 00000000000..0b6cc241ac2
--- /dev/null
+++ b/support/Makefile.am
@@ -0,0 +1,50 @@
+if PLATFORM_WIN32
+lib_LTLIBRARIES=
+else
+lib_LTLIBRARIES= libMonoPosixHelper.la
+endif
+
+INCLUDES = \
+ $(GLIB_CFLAGS) \
+ -I$(top_srcdir)
+
+MPH_H = mph.h
+
+MPH_SOURCE = \
+ dirent.c \
+ errno.c \
+ fcntl.c \
+ grp.c \
+ map.c \
+ pwd.c \
+ old-map.c \
+ stdio.c \
+ stdlib.c \
+ sys-mman.c \
+ sys-mount.c \
+ sys-sendfile.c \
+ sys-stat.c \
+ sys-wait.c \
+ time.c \
+ unistd.c
+
+if HAVE_ZLIB
+libMonoPosixHelper_la_SOURCES = \
+ $(MPH_SOURCE) zlib_macros.c
+
+libMonoPosixHelper_la_LIBADD = -lz
+else
+libMonoPosixHelper_la_SOURCES = $(MPH_SOURCE)
+endif
+
+libMonoPosixHelper_la_LDFLAGS = -no-undefined -version-info 1:0:1
+
+EXTRA_DIST = \
+ $(MPH_H)
+
+#
+# Use this target to refresh the values in map.[ch]
+#
+refresh:
+ mono ../../mcs/class/Mono.Posix/Mono.Posix/make-map.exe ../../mcs/class/lib/Mono.Posix.dll map
+
diff --git a/support/dirent.c b/support/dirent.c
new file mode 100644
index 00000000000..4be44d8a1de
--- /dev/null
+++ b/support/dirent.c
@@ -0,0 +1,99 @@
+/*
+ * <dirent.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <dirent.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+struct Mono_Posix_Syscall__Dirent {
+ /* ino_t */ mph_ino_t d_ino;
+ /* off_t */ mph_off_t d_off;
+ /* ushort */ unsigned short d_reclen;
+ /* byte */ unsigned char d_type;
+ /* string */ char *d_name;
+};
+
+gint32
+Mono_Posix_Syscall_seekdir (DIR *dir, mph_off_t offset)
+{
+ mph_return_if_off_t_overflow (offset);
+
+ errno = 0;
+
+ seekdir (dir, (off_t) offset);
+
+ return errno != 0;
+}
+
+mph_off_t
+Mono_Posix_Syscall_telldir (DIR *dir)
+{
+ return telldir (dir);
+}
+
+static void
+copy_dirent (struct Mono_Posix_Syscall__Dirent *to, struct dirent *from)
+{
+ to->d_ino = from->d_ino;
+#ifdef MPH_ON_BSD
+ to->d_off = 0;
+#else
+ to->d_off = from->d_off;
+#endif
+ to->d_reclen = from->d_reclen;
+ to->d_type = from->d_type;
+ to->d_name = strdup (from->d_name);
+}
+
+gint32
+Mono_Posix_Syscall_readdir (DIR *dirp, struct Mono_Posix_Syscall__Dirent *entry)
+{
+ struct dirent *d;
+
+ if (entry == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ d = readdir (dirp);
+
+ if (d == NULL) {
+ return -1;
+ }
+
+ copy_dirent (entry, d);
+
+ return 0;
+}
+
+gint32
+Mono_Posix_Syscall_readdir_r (DIR *dirp, struct Mono_Posix_Syscall__Dirent *entry, void **result)
+{
+ struct dirent _entry;
+ int r;
+
+ r = readdir_r (dirp, &_entry, (struct dirent**) result);
+
+ if (r == 0 && result != NULL) {
+ copy_dirent (entry, &_entry);
+ }
+
+ return r;
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/errno.c b/support/errno.c
new file mode 100644
index 00000000000..9794fec59a0
--- /dev/null
+++ b/support/errno.c
@@ -0,0 +1,34 @@
+/*
+ * <errno.h> wrapper functions.
+ */
+
+/* to get XPG's strerror_r declaration */
+#undef _GNU_SOURCE
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
+
+#include <errno.h>
+#include <string.h>
+#include "mph.h"
+#include <stdio.h>
+
+G_BEGIN_DECLS
+
+void
+Mono_Posix_Syscall_SetLastError (int error_number)
+{
+ errno = error_number;
+}
+
+gint32
+Mono_Posix_Syscall_strerror_r (int errnum, char *buf, mph_size_t n)
+{
+ mph_return_if_size_t_overflow (n);
+ return strerror_r (errnum, buf, (size_t) n);
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/fcntl.c b/support/fcntl.c
new file mode 100644
index 00000000000..3e0424cb901
--- /dev/null
+++ b/support/fcntl.c
@@ -0,0 +1,160 @@
+/*
+ * <fcntl.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "map.h"
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+struct Mono_Posix_Flock {
+ gint16 l_type;
+ gint16 l_whence;
+ mph_off_t l_start;
+ mph_off_t l_len;
+ mph_pid_t l_pid;
+};
+
+gint32
+Mono_Posix_Syscall_fcntl (gint32 fd, gint32 cmd)
+{
+ if (Mono_Posix_FromFcntlCommand (cmd, &cmd) == -1)
+ return -1;
+ return fcntl (fd, cmd);
+}
+
+gint32
+Mono_Posix_Syscall_fcntl_arg (gint32 fd, gint32 cmd, gint64 arg)
+{
+ long _arg;
+ gint32 _cmd;
+
+ mph_return_if_long_overflow (arg);
+
+#ifdef F_NOTIFY
+ if (cmd == F_NOTIFY) {
+ int _argi;
+ if (Mono_Posix_FromDirectoryNotifyFlags (arg, &_argi) == -1) {
+ return -1;
+ }
+ _arg = _argi;
+ }
+ else
+#endif
+ _arg = (long) arg;
+
+ if (Mono_Posix_FromFcntlCommand (cmd, &_cmd) == -1)
+ return -1;
+ return fcntl (fd, cmd, _arg);
+}
+
+gint32
+Mono_Posix_Syscall_fcntl_lock (gint32 fd, gint32 cmd, struct Mono_Posix_Flock *lock)
+{
+ struct flock _lock;
+ int r;
+
+ if (lock == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ mph_return_if_off_t_overflow (lock->l_start);
+ mph_return_if_off_t_overflow (lock->l_len);
+
+ if (Mono_Posix_FromLockType (lock->l_type, &lock->l_type) == -1)
+ return -1;
+ _lock.l_type = lock->l_type;
+ _lock.l_whence = lock->l_whence;
+ _lock.l_start = lock->l_start;
+ _lock.l_len = lock->l_len;
+ _lock.l_pid = lock->l_pid;
+
+ r = fcntl (fd, cmd, &_lock);
+
+ if (Mono_Posix_ToLockType (_lock.l_type, &_lock.l_type) == -1)
+ r = -1;
+ lock->l_type = _lock.l_type;
+ lock->l_whence = _lock.l_whence;
+ lock->l_start = _lock.l_start;
+ lock->l_len = _lock.l_len;
+ lock->l_pid = _lock.l_pid;
+
+ return r;
+}
+
+gint32
+Mono_Posix_Syscall_open (const char *pathname, gint32 flags)
+{
+ if (Mono_Posix_FromOpenFlags (flags, &flags) == -1)
+ return -1;
+
+ return open (pathname, flags);
+}
+
+gint32
+Mono_Posix_Syscall_open_mode (const char *pathname, gint32 flags, guint32 mode)
+{
+ if (Mono_Posix_FromOpenFlags (flags, &flags) == -1)
+ return -1;
+ if (Mono_Posix_FromFilePermissions (mode, &mode) == -1)
+ return -1;
+
+ return open (pathname, flags, mode);
+}
+
+gint32
+Mono_Posix_Syscall_creat (const char *pathname, guint32 mode)
+{
+ if (Mono_Posix_FromFilePermissions (mode, &mode) == -1)
+ return -1;
+
+ return creat (pathname, mode);
+}
+
+#ifdef HAVE_POSIX_FADVISE
+gint32
+Mono_Posix_Syscall_posix_fadvise (gint32 fd, mph_off_t offset, mph_off_t len,
+ gint32 advice)
+{
+ mph_return_if_off_t_overflow (offset);
+ mph_return_if_off_t_overflow (len);
+
+ if (Mono_Posix_FromPosixFadviseAdvice (advice, &advice) == -1)
+ return -1;
+
+ return posix_fadvise (fd, (off_t) offset, (off_t) len, advice);
+}
+#endif /* ndef HAVE_POSIX_FADVISE */
+
+#ifdef HAVE_POSIX_FALLOCATE
+gint32
+Mono_Posix_Syscall_posix_fallocate (gint32 fd, mph_off_t offset, mph_size_t len)
+{
+ mph_return_if_off_t_overflow (offset);
+ mph_return_if_size_t_overflow (len);
+
+ return posix_fallocate (fd, (off_t) offset, (size_t) len);
+}
+#endif /* ndef HAVE_POSIX_FALLOCATE */
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/grp.c b/support/grp.c
new file mode 100644
index 00000000000..f6c4832cc0c
--- /dev/null
+++ b/support/grp.c
@@ -0,0 +1,280 @@
+/*
+ * <grp.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <grp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h> /* for setgroups on Mac OS X */
+
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+struct Mono_Posix_Syscall__Group {
+ /* string */ char *gr_name;
+ /* string */ char *gr_passwd;
+ /* gid_t */ mph_gid_t gr_gid;
+ /* int */ int _gr_nmem_;
+ /* string */ char **gr_mem;
+ /* string */ char *_gr_buf_; /* holds all but gr_mem */
+};
+
+static void
+count_members (char **gr_mem, int *count, size_t *mem)
+{
+ char *cur;
+ *count = 0;
+
+ // ensure that later (*mem)+1 doesn't result in integer overflow
+ if (*mem > INT_MAX - 1)
+ return;
+
+ for (cur = *gr_mem; cur != NULL; cur = *++gr_mem) {
+ size_t len;
+ len = strlen (cur);
+
+ if (!(len < INT_MAX - ((*mem) + 1)))
+ break;
+
+ ++(*count);
+ *mem += (len + 1);
+ }
+}
+
+static int
+copy_group (struct Mono_Posix_Syscall__Group *to, struct group *from)
+{
+ size_t nlen, plen, buflen;
+ int i, count;
+ char *cur;
+
+ to->gr_gid = from->gr_gid;
+
+ to->gr_name = NULL;
+ to->gr_passwd = NULL;
+ to->gr_mem = NULL;
+ to->_gr_buf_ = NULL;
+
+ nlen = strlen (from->gr_name);
+ plen = strlen (from->gr_passwd);
+
+ buflen = 2;
+
+ if (!(nlen < INT_MAX - buflen))
+ return -1;
+ buflen += nlen;
+
+ if (!(plen < INT_MAX - buflen))
+ return -1;
+ buflen += plen;
+
+ count = 0;
+ count_members (from->gr_mem, &count, &buflen);
+
+ to->_gr_nmem_ = count;
+ cur = to->_gr_buf_ = (char*) malloc (buflen);
+ to->gr_mem = (char **) malloc (sizeof(char*)*(count+1));
+ if (to->_gr_buf_ == NULL || to->gr_mem == NULL) {
+ free (to->_gr_buf_);
+ free (to->gr_mem);
+ return -1;
+ }
+
+ to->gr_name = strcpy (cur, from->gr_name);
+ cur += (nlen + 1);
+ to->gr_passwd = strcpy (cur, from->gr_passwd);
+ cur += (plen + 1);
+
+ for (i = 0; i != count; ++i) {
+ to->gr_mem[i] = strcpy (cur, from->gr_mem[i]);
+ cur += (strlen (from->gr_mem[i])+1);
+ }
+ to->gr_mem[i] = NULL;
+
+ return 0;
+}
+
+gint32
+Mono_Posix_Syscall_getgrnam (const char *name, struct Mono_Posix_Syscall__Group *gbuf)
+{
+ struct group *_gbuf;
+
+ if (gbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ _gbuf = getgrnam (name);
+ if (_gbuf == NULL)
+ return -1;
+
+ if (copy_group (gbuf, _gbuf) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+
+gint32
+Mono_Posix_Syscall_getgrgid (mph_gid_t gid, struct Mono_Posix_Syscall__Group *gbuf)
+{
+ struct group *_gbuf;
+
+ if (gbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ _gbuf = getgrgid (gid);
+ if (_gbuf == NULL)
+ return -1;
+
+ if (copy_group (gbuf, _gbuf) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+
+#ifdef HAVE_GETGRNAM_R
+gint32
+Mono_Posix_Syscall_getgrnam_r (const char *name,
+ struct Mono_Posix_Syscall__Group *gbuf,
+ struct group **gbufp)
+{
+ char *buf, *buf2;
+ size_t buflen;
+ int r;
+ struct group _grbuf;
+
+ if (gbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ buf = buf2 = NULL;
+ buflen = 2;
+
+ do {
+ buf2 = realloc (buf, buflen *= 2);
+ if (buf2 == NULL) {
+ free (buf);
+ errno = ENOMEM;
+ return -1;
+ }
+ buf = buf2;
+ } while ((r = getgrnam_r (name, &_grbuf, buf, buflen, gbufp)) &&
+ recheck_range (r));
+
+ if (r == 0 && copy_group (gbuf, &_grbuf) == -1)
+ r = errno = ENOMEM;
+ free (buf);
+
+ return r;
+}
+#endif /* ndef HAVE_GETGRNAM_R */
+
+#ifdef HAVE_GETGRGID_R
+gint32
+Mono_Posix_Syscall_getgrgid_r (mph_gid_t gid,
+ struct Mono_Posix_Syscall__Group *gbuf,
+ struct group **gbufp)
+{
+ char *buf, *buf2;
+ size_t buflen;
+ int r;
+ struct group _grbuf;
+
+ if (gbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ buf = buf2 = NULL;
+ buflen = 2;
+
+ do {
+ buf2 = realloc (buf, buflen *= 2);
+ if (buf2 == NULL) {
+ free (buf);
+ errno = ENOMEM;
+ return -1;
+ }
+ buf = buf2;
+ } while ((r = getgrgid_r (gid, &_grbuf, buf, buflen, gbufp)) &&
+ recheck_range (r));
+
+ if (r == 0 && copy_group (gbuf, &_grbuf) == -1)
+ r = errno = ENOMEM;
+ free (buf);
+
+ return r;
+}
+#endif /* ndef HAVE_GETGRGID_R */
+
+gint32
+Mono_Posix_Syscall_getgrent (struct Mono_Posix_Syscall__Group *grbuf)
+{
+ struct group *gr;
+
+ if (grbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ gr = getgrent ();
+ if (gr == NULL)
+ return -1;
+
+ if (copy_group (grbuf, gr) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+
+#ifdef HAVE_FGETGRENT
+gint32
+Mono_Posix_Syscall_fgetgrent (FILE *stream, struct Mono_Posix_Syscall__Group *grbuf)
+{
+ struct group *gr;
+
+ if (grbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ gr = fgetgrent (stream);
+ if (gr == NULL)
+ return -1;
+
+ if (copy_group (grbuf, gr) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+#endif /* ndef HAVE_FGETGRENT */
+
+gint32
+Mono_Posix_Syscall_setgroups (mph_size_t size, mph_gid_t *list)
+{
+ mph_return_if_size_t_overflow (size);
+ return setgroups ((size_t) size, list);
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/macros.c b/support/macros.c
new file mode 100644
index 00000000000..c64c7dae528
--- /dev/null
+++ b/support/macros.c
@@ -0,0 +1,144 @@
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <grp.h>
+#include <errno.h>
+#include <dirent.h>
+#include <string.h>
+
+int wifexited (int status)
+{
+ return WIFEXITED (status);
+}
+
+int wexitstatus (int status)
+{
+ return WEXITSTATUS (status);
+}
+
+int wifsignaled (int status)
+{
+ return WIFSIGNALED (status);
+}
+
+int wtermsig (int status)
+{
+ return WTERMSIG (status);
+}
+
+int wifstopped (int status)
+{
+ return WIFSTOPPED (status);
+}
+
+int wstopsig (int status)
+{
+ return WSTOPSIG (status);
+}
+
+int helper_Mono_Posix_Stat(char *filename, int dereference,
+ int *device,
+ int *inode,
+ int *mode,
+ int *nlinks,
+ int *uid,
+ int *gid,
+ int *rdev,
+ long *size,
+ long *blksize,
+ long *blocks,
+ long *atime,
+ long *mtime,
+ long *ctime
+ ) {
+ int ret;
+ struct stat buf;
+
+ if (!dereference)
+ ret = stat(filename, &buf);
+ else
+ ret = lstat(filename, &buf);
+
+ if (ret) return ret;
+
+ *device = buf.st_dev;
+ *inode = buf.st_ino;
+ *mode = buf.st_mode;
+ *nlinks = buf.st_nlink;
+ *uid = buf.st_uid;
+ *gid = buf.st_gid;
+ *rdev = buf.st_rdev;
+ *size = buf.st_size;
+ *blksize = buf.st_blksize;
+ *blocks = buf.st_blocks;
+ *atime = buf.st_atime;
+ *mtime = buf.st_mtime;
+ *ctime = buf.st_ctime;
+ return 0;
+}
+
+char *helper_Mono_Posix_GetUserName(int uid) {
+ struct passwd *p = getpwuid(uid);
+ if (p == NULL) return NULL;
+ return strdup (p->pw_name);
+}
+char *helper_Mono_Posix_GetGroupName(int gid) {
+ struct group *p = getgrgid(gid);
+ if (p == NULL) return NULL;
+ return strdup (p->gr_name);
+}
+
+char *helper_Mono_Posix_readdir(DIR *dir) {
+ struct dirent* e = readdir(dir);
+ if (e == NULL) return NULL;
+ return strdup (e->d_name);
+}
+
+int helper_Mono_Posix_getpwnamuid (int mode, char *in_name, int in_uid,
+ char **account,
+ char **password,
+ int *uid,
+ int *gid,
+ char **name,
+ char **home,
+ char **shell
+ ) {
+
+ struct passwd pw, *pwp;
+ char buf[4096];
+ int ret;
+
+ if (mode == 0)
+ ret = getpwnam_r (in_name, &pw, buf, 4096, &pwp);
+ else
+ ret = getpwuid_r (in_uid, &pw, buf, 4096, &pwp);
+
+ if (ret == 0 && pwp == NULL) {
+ // Don't know why this happens, but it does.
+ // ret == 0, errno == 0, but no record was found.
+ ret = ENOENT;
+ }
+
+ if (ret) {
+ *account = NULL; // prevent marshalling unset pointers
+ *password = NULL;
+ *uid = 0;
+ *gid = 0;
+ *name = NULL;
+ *home = NULL;
+ *shell = NULL;
+ return ret;
+ }
+
+ *account = pwp->pw_name;
+ *password = pwp->pw_passwd;
+ *uid = pwp->pw_uid;
+ *gid = pwp->pw_gid;
+ *name = pwp->pw_gecos;
+ *home = pwp->pw_dir;
+ *shell = pwp->pw_shell;
+
+ return 0;
+}
diff --git a/support/map.c b/support/map.c
new file mode 100644
index 00000000000..5e12b5151f9
--- /dev/null
+++ b/support/map.c
@@ -0,0 +1,5789 @@
+/*
+ * This file was automatically generated by make-map from Mono.Posix.dll.
+ *
+ * DO NOT MODIFY.
+ */
+
+#include "map.h"
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif /* ndef _GNU_SOURCE */
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE
+#endif /* ndef _XOPEN_SOURCE */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/poll.h>
+#include <sys/wait.h>
+#include <sys/mount.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <grp.h>
+#include <errno.h>
+
+int Mono_Posix_FromError (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_Error_EPERM)
+#ifdef EPERM
+ {*r = EPERM; return 0;}
+#else /* def EPERM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EPERM */
+ if (x == Mono_Posix_Error_ENOENT)
+#ifdef ENOENT
+ {*r = ENOENT; return 0;}
+#else /* def ENOENT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOENT */
+ if (x == Mono_Posix_Error_ESRCH)
+#ifdef ESRCH
+ {*r = ESRCH; return 0;}
+#else /* def ESRCH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ESRCH */
+ if (x == Mono_Posix_Error_EINTR)
+#ifdef EINTR
+ {*r = EINTR; return 0;}
+#else /* def EINTR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EINTR */
+ if (x == Mono_Posix_Error_EIO)
+#ifdef EIO
+ {*r = EIO; return 0;}
+#else /* def EIO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EIO */
+ if (x == Mono_Posix_Error_ENXIO)
+#ifdef ENXIO
+ {*r = ENXIO; return 0;}
+#else /* def ENXIO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENXIO */
+ if (x == Mono_Posix_Error_E2BIG)
+#ifdef E2BIG
+ {*r = E2BIG; return 0;}
+#else /* def E2BIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef E2BIG */
+ if (x == Mono_Posix_Error_ENOEXEC)
+#ifdef ENOEXEC
+ {*r = ENOEXEC; return 0;}
+#else /* def ENOEXEC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOEXEC */
+ if (x == Mono_Posix_Error_EBADF)
+#ifdef EBADF
+ {*r = EBADF; return 0;}
+#else /* def EBADF */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBADF */
+ if (x == Mono_Posix_Error_ECHILD)
+#ifdef ECHILD
+ {*r = ECHILD; return 0;}
+#else /* def ECHILD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ECHILD */
+ if (x == Mono_Posix_Error_EAGAIN)
+#ifdef EAGAIN
+ {*r = EAGAIN; return 0;}
+#else /* def EAGAIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EAGAIN */
+ if (x == Mono_Posix_Error_ENOMEM)
+#ifdef ENOMEM
+ {*r = ENOMEM; return 0;}
+#else /* def ENOMEM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOMEM */
+ if (x == Mono_Posix_Error_EACCES)
+#ifdef EACCES
+ {*r = EACCES; return 0;}
+#else /* def EACCES */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EACCES */
+ if (x == Mono_Posix_Error_EFAULT)
+#ifdef EFAULT
+ {*r = EFAULT; return 0;}
+#else /* def EFAULT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EFAULT */
+ if (x == Mono_Posix_Error_ENOTBLK)
+#ifdef ENOTBLK
+ {*r = ENOTBLK; return 0;}
+#else /* def ENOTBLK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTBLK */
+ if (x == Mono_Posix_Error_EBUSY)
+#ifdef EBUSY
+ {*r = EBUSY; return 0;}
+#else /* def EBUSY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBUSY */
+ if (x == Mono_Posix_Error_EEXIST)
+#ifdef EEXIST
+ {*r = EEXIST; return 0;}
+#else /* def EEXIST */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EEXIST */
+ if (x == Mono_Posix_Error_EXDEV)
+#ifdef EXDEV
+ {*r = EXDEV; return 0;}
+#else /* def EXDEV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EXDEV */
+ if (x == Mono_Posix_Error_ENODEV)
+#ifdef ENODEV
+ {*r = ENODEV; return 0;}
+#else /* def ENODEV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENODEV */
+ if (x == Mono_Posix_Error_ENOTDIR)
+#ifdef ENOTDIR
+ {*r = ENOTDIR; return 0;}
+#else /* def ENOTDIR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTDIR */
+ if (x == Mono_Posix_Error_EISDIR)
+#ifdef EISDIR
+ {*r = EISDIR; return 0;}
+#else /* def EISDIR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EISDIR */
+ if (x == Mono_Posix_Error_EINVAL)
+#ifdef EINVAL
+ {*r = EINVAL; return 0;}
+#else /* def EINVAL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EINVAL */
+ if (x == Mono_Posix_Error_ENFILE)
+#ifdef ENFILE
+ {*r = ENFILE; return 0;}
+#else /* def ENFILE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENFILE */
+ if (x == Mono_Posix_Error_EMFILE)
+#ifdef EMFILE
+ {*r = EMFILE; return 0;}
+#else /* def EMFILE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EMFILE */
+ if (x == Mono_Posix_Error_ENOTTY)
+#ifdef ENOTTY
+ {*r = ENOTTY; return 0;}
+#else /* def ENOTTY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTTY */
+ if (x == Mono_Posix_Error_ETXTBSY)
+#ifdef ETXTBSY
+ {*r = ETXTBSY; return 0;}
+#else /* def ETXTBSY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ETXTBSY */
+ if (x == Mono_Posix_Error_EFBIG)
+#ifdef EFBIG
+ {*r = EFBIG; return 0;}
+#else /* def EFBIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EFBIG */
+ if (x == Mono_Posix_Error_ENOSPC)
+#ifdef ENOSPC
+ {*r = ENOSPC; return 0;}
+#else /* def ENOSPC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOSPC */
+ if (x == Mono_Posix_Error_ESPIPE)
+#ifdef ESPIPE
+ {*r = ESPIPE; return 0;}
+#else /* def ESPIPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ESPIPE */
+ if (x == Mono_Posix_Error_EROFS)
+#ifdef EROFS
+ {*r = EROFS; return 0;}
+#else /* def EROFS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EROFS */
+ if (x == Mono_Posix_Error_EMLINK)
+#ifdef EMLINK
+ {*r = EMLINK; return 0;}
+#else /* def EMLINK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EMLINK */
+ if (x == Mono_Posix_Error_EPIPE)
+#ifdef EPIPE
+ {*r = EPIPE; return 0;}
+#else /* def EPIPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EPIPE */
+ if (x == Mono_Posix_Error_EDOM)
+#ifdef EDOM
+ {*r = EDOM; return 0;}
+#else /* def EDOM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EDOM */
+ if (x == Mono_Posix_Error_ERANGE)
+#ifdef ERANGE
+ {*r = ERANGE; return 0;}
+#else /* def ERANGE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ERANGE */
+ if (x == Mono_Posix_Error_EDEADLK)
+#ifdef EDEADLK
+ {*r = EDEADLK; return 0;}
+#else /* def EDEADLK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EDEADLK */
+ if (x == Mono_Posix_Error_ENAMETOOLONG)
+#ifdef ENAMETOOLONG
+ {*r = ENAMETOOLONG; return 0;}
+#else /* def ENAMETOOLONG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENAMETOOLONG */
+ if (x == Mono_Posix_Error_ENOLCK)
+#ifdef ENOLCK
+ {*r = ENOLCK; return 0;}
+#else /* def ENOLCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOLCK */
+ if (x == Mono_Posix_Error_ENOSYS)
+#ifdef ENOSYS
+ {*r = ENOSYS; return 0;}
+#else /* def ENOSYS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOSYS */
+ if (x == Mono_Posix_Error_ENOTEMPTY)
+#ifdef ENOTEMPTY
+ {*r = ENOTEMPTY; return 0;}
+#else /* def ENOTEMPTY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTEMPTY */
+ if (x == Mono_Posix_Error_ELOOP)
+#ifdef ELOOP
+ {*r = ELOOP; return 0;}
+#else /* def ELOOP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ELOOP */
+ if (x == Mono_Posix_Error_EWOULDBLOCK)
+#ifdef EWOULDBLOCK
+ {*r = EWOULDBLOCK; return 0;}
+#else /* def EWOULDBLOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EWOULDBLOCK */
+ if (x == Mono_Posix_Error_ENOMSG)
+#ifdef ENOMSG
+ {*r = ENOMSG; return 0;}
+#else /* def ENOMSG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOMSG */
+ if (x == Mono_Posix_Error_EIDRM)
+#ifdef EIDRM
+ {*r = EIDRM; return 0;}
+#else /* def EIDRM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EIDRM */
+ if (x == Mono_Posix_Error_ECHRNG)
+#ifdef ECHRNG
+ {*r = ECHRNG; return 0;}
+#else /* def ECHRNG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ECHRNG */
+ if (x == Mono_Posix_Error_EL2NSYNC)
+#ifdef EL2NSYNC
+ {*r = EL2NSYNC; return 0;}
+#else /* def EL2NSYNC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EL2NSYNC */
+ if (x == Mono_Posix_Error_EL3HLT)
+#ifdef EL3HLT
+ {*r = EL3HLT; return 0;}
+#else /* def EL3HLT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EL3HLT */
+ if (x == Mono_Posix_Error_EL3RST)
+#ifdef EL3RST
+ {*r = EL3RST; return 0;}
+#else /* def EL3RST */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EL3RST */
+ if (x == Mono_Posix_Error_ELNRNG)
+#ifdef ELNRNG
+ {*r = ELNRNG; return 0;}
+#else /* def ELNRNG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ELNRNG */
+ if (x == Mono_Posix_Error_EUNATCH)
+#ifdef EUNATCH
+ {*r = EUNATCH; return 0;}
+#else /* def EUNATCH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EUNATCH */
+ if (x == Mono_Posix_Error_ENOCSI)
+#ifdef ENOCSI
+ {*r = ENOCSI; return 0;}
+#else /* def ENOCSI */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOCSI */
+ if (x == Mono_Posix_Error_EL2HLT)
+#ifdef EL2HLT
+ {*r = EL2HLT; return 0;}
+#else /* def EL2HLT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EL2HLT */
+ if (x == Mono_Posix_Error_EBADE)
+#ifdef EBADE
+ {*r = EBADE; return 0;}
+#else /* def EBADE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBADE */
+ if (x == Mono_Posix_Error_EBADR)
+#ifdef EBADR
+ {*r = EBADR; return 0;}
+#else /* def EBADR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBADR */
+ if (x == Mono_Posix_Error_EXFULL)
+#ifdef EXFULL
+ {*r = EXFULL; return 0;}
+#else /* def EXFULL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EXFULL */
+ if (x == Mono_Posix_Error_ENOANO)
+#ifdef ENOANO
+ {*r = ENOANO; return 0;}
+#else /* def ENOANO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOANO */
+ if (x == Mono_Posix_Error_EBADRQC)
+#ifdef EBADRQC
+ {*r = EBADRQC; return 0;}
+#else /* def EBADRQC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBADRQC */
+ if (x == Mono_Posix_Error_EBADSLT)
+#ifdef EBADSLT
+ {*r = EBADSLT; return 0;}
+#else /* def EBADSLT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBADSLT */
+ if (x == Mono_Posix_Error_EDEADLOCK)
+#ifdef EDEADLOCK
+ {*r = EDEADLOCK; return 0;}
+#else /* def EDEADLOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EDEADLOCK */
+ if (x == Mono_Posix_Error_EBFONT)
+#ifdef EBFONT
+ {*r = EBFONT; return 0;}
+#else /* def EBFONT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBFONT */
+ if (x == Mono_Posix_Error_ENOSTR)
+#ifdef ENOSTR
+ {*r = ENOSTR; return 0;}
+#else /* def ENOSTR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOSTR */
+ if (x == Mono_Posix_Error_ENODATA)
+#ifdef ENODATA
+ {*r = ENODATA; return 0;}
+#else /* def ENODATA */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENODATA */
+ if (x == Mono_Posix_Error_ETIME)
+#ifdef ETIME
+ {*r = ETIME; return 0;}
+#else /* def ETIME */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ETIME */
+ if (x == Mono_Posix_Error_ENOSR)
+#ifdef ENOSR
+ {*r = ENOSR; return 0;}
+#else /* def ENOSR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOSR */
+ if (x == Mono_Posix_Error_ENONET)
+#ifdef ENONET
+ {*r = ENONET; return 0;}
+#else /* def ENONET */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENONET */
+ if (x == Mono_Posix_Error_ENOPKG)
+#ifdef ENOPKG
+ {*r = ENOPKG; return 0;}
+#else /* def ENOPKG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOPKG */
+ if (x == Mono_Posix_Error_EREMOTE)
+#ifdef EREMOTE
+ {*r = EREMOTE; return 0;}
+#else /* def EREMOTE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EREMOTE */
+ if (x == Mono_Posix_Error_ENOLINK)
+#ifdef ENOLINK
+ {*r = ENOLINK; return 0;}
+#else /* def ENOLINK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOLINK */
+ if (x == Mono_Posix_Error_EADV)
+#ifdef EADV
+ {*r = EADV; return 0;}
+#else /* def EADV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EADV */
+ if (x == Mono_Posix_Error_ESRMNT)
+#ifdef ESRMNT
+ {*r = ESRMNT; return 0;}
+#else /* def ESRMNT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ESRMNT */
+ if (x == Mono_Posix_Error_ECOMM)
+#ifdef ECOMM
+ {*r = ECOMM; return 0;}
+#else /* def ECOMM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ECOMM */
+ if (x == Mono_Posix_Error_EPROTO)
+#ifdef EPROTO
+ {*r = EPROTO; return 0;}
+#else /* def EPROTO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EPROTO */
+ if (x == Mono_Posix_Error_EMULTIHOP)
+#ifdef EMULTIHOP
+ {*r = EMULTIHOP; return 0;}
+#else /* def EMULTIHOP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EMULTIHOP */
+ if (x == Mono_Posix_Error_EDOTDOT)
+#ifdef EDOTDOT
+ {*r = EDOTDOT; return 0;}
+#else /* def EDOTDOT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EDOTDOT */
+ if (x == Mono_Posix_Error_EBADMSG)
+#ifdef EBADMSG
+ {*r = EBADMSG; return 0;}
+#else /* def EBADMSG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBADMSG */
+ if (x == Mono_Posix_Error_EOVERFLOW)
+#ifdef EOVERFLOW
+ {*r = EOVERFLOW; return 0;}
+#else /* def EOVERFLOW */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EOVERFLOW */
+ if (x == Mono_Posix_Error_ENOTUNIQ)
+#ifdef ENOTUNIQ
+ {*r = ENOTUNIQ; return 0;}
+#else /* def ENOTUNIQ */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTUNIQ */
+ if (x == Mono_Posix_Error_EBADFD)
+#ifdef EBADFD
+ {*r = EBADFD; return 0;}
+#else /* def EBADFD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EBADFD */
+ if (x == Mono_Posix_Error_EREMCHG)
+#ifdef EREMCHG
+ {*r = EREMCHG; return 0;}
+#else /* def EREMCHG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EREMCHG */
+ if (x == Mono_Posix_Error_ELIBACC)
+#ifdef ELIBACC
+ {*r = ELIBACC; return 0;}
+#else /* def ELIBACC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ELIBACC */
+ if (x == Mono_Posix_Error_ELIBBAD)
+#ifdef ELIBBAD
+ {*r = ELIBBAD; return 0;}
+#else /* def ELIBBAD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ELIBBAD */
+ if (x == Mono_Posix_Error_ELIBSCN)
+#ifdef ELIBSCN
+ {*r = ELIBSCN; return 0;}
+#else /* def ELIBSCN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ELIBSCN */
+ if (x == Mono_Posix_Error_ELIBMAX)
+#ifdef ELIBMAX
+ {*r = ELIBMAX; return 0;}
+#else /* def ELIBMAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ELIBMAX */
+ if (x == Mono_Posix_Error_ELIBEXEC)
+#ifdef ELIBEXEC
+ {*r = ELIBEXEC; return 0;}
+#else /* def ELIBEXEC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ELIBEXEC */
+ if (x == Mono_Posix_Error_EILSEQ)
+#ifdef EILSEQ
+ {*r = EILSEQ; return 0;}
+#else /* def EILSEQ */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EILSEQ */
+ if (x == Mono_Posix_Error_ERESTART)
+#ifdef ERESTART
+ {*r = ERESTART; return 0;}
+#else /* def ERESTART */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ERESTART */
+ if (x == Mono_Posix_Error_ESTRPIPE)
+#ifdef ESTRPIPE
+ {*r = ESTRPIPE; return 0;}
+#else /* def ESTRPIPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ESTRPIPE */
+ if (x == Mono_Posix_Error_EUSERS)
+#ifdef EUSERS
+ {*r = EUSERS; return 0;}
+#else /* def EUSERS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EUSERS */
+ if (x == Mono_Posix_Error_ENOTSOCK)
+#ifdef ENOTSOCK
+ {*r = ENOTSOCK; return 0;}
+#else /* def ENOTSOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTSOCK */
+ if (x == Mono_Posix_Error_EDESTADDRREQ)
+#ifdef EDESTADDRREQ
+ {*r = EDESTADDRREQ; return 0;}
+#else /* def EDESTADDRREQ */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EDESTADDRREQ */
+ if (x == Mono_Posix_Error_EMSGSIZE)
+#ifdef EMSGSIZE
+ {*r = EMSGSIZE; return 0;}
+#else /* def EMSGSIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EMSGSIZE */
+ if (x == Mono_Posix_Error_EPROTOTYPE)
+#ifdef EPROTOTYPE
+ {*r = EPROTOTYPE; return 0;}
+#else /* def EPROTOTYPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EPROTOTYPE */
+ if (x == Mono_Posix_Error_ENOPROTOOPT)
+#ifdef ENOPROTOOPT
+ {*r = ENOPROTOOPT; return 0;}
+#else /* def ENOPROTOOPT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOPROTOOPT */
+ if (x == Mono_Posix_Error_EPROTONOSUPPORT)
+#ifdef EPROTONOSUPPORT
+ {*r = EPROTONOSUPPORT; return 0;}
+#else /* def EPROTONOSUPPORT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EPROTONOSUPPORT */
+ if (x == Mono_Posix_Error_ESOCKTNOSUPPORT)
+#ifdef ESOCKTNOSUPPORT
+ {*r = ESOCKTNOSUPPORT; return 0;}
+#else /* def ESOCKTNOSUPPORT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ESOCKTNOSUPPORT */
+ if (x == Mono_Posix_Error_EOPNOTSUPP)
+#ifdef EOPNOTSUPP
+ {*r = EOPNOTSUPP; return 0;}
+#else /* def EOPNOTSUPP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EOPNOTSUPP */
+ if (x == Mono_Posix_Error_EPFNOSUPPORT)
+#ifdef EPFNOSUPPORT
+ {*r = EPFNOSUPPORT; return 0;}
+#else /* def EPFNOSUPPORT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EPFNOSUPPORT */
+ if (x == Mono_Posix_Error_EAFNOSUPPORT)
+#ifdef EAFNOSUPPORT
+ {*r = EAFNOSUPPORT; return 0;}
+#else /* def EAFNOSUPPORT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EAFNOSUPPORT */
+ if (x == Mono_Posix_Error_EADDRINUSE)
+#ifdef EADDRINUSE
+ {*r = EADDRINUSE; return 0;}
+#else /* def EADDRINUSE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EADDRINUSE */
+ if (x == Mono_Posix_Error_EADDRNOTAVAIL)
+#ifdef EADDRNOTAVAIL
+ {*r = EADDRNOTAVAIL; return 0;}
+#else /* def EADDRNOTAVAIL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EADDRNOTAVAIL */
+ if (x == Mono_Posix_Error_ENETDOWN)
+#ifdef ENETDOWN
+ {*r = ENETDOWN; return 0;}
+#else /* def ENETDOWN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENETDOWN */
+ if (x == Mono_Posix_Error_ENETUNREACH)
+#ifdef ENETUNREACH
+ {*r = ENETUNREACH; return 0;}
+#else /* def ENETUNREACH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENETUNREACH */
+ if (x == Mono_Posix_Error_ENETRESET)
+#ifdef ENETRESET
+ {*r = ENETRESET; return 0;}
+#else /* def ENETRESET */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENETRESET */
+ if (x == Mono_Posix_Error_ECONNABORTED)
+#ifdef ECONNABORTED
+ {*r = ECONNABORTED; return 0;}
+#else /* def ECONNABORTED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ECONNABORTED */
+ if (x == Mono_Posix_Error_ECONNRESET)
+#ifdef ECONNRESET
+ {*r = ECONNRESET; return 0;}
+#else /* def ECONNRESET */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ECONNRESET */
+ if (x == Mono_Posix_Error_ENOBUFS)
+#ifdef ENOBUFS
+ {*r = ENOBUFS; return 0;}
+#else /* def ENOBUFS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOBUFS */
+ if (x == Mono_Posix_Error_EISCONN)
+#ifdef EISCONN
+ {*r = EISCONN; return 0;}
+#else /* def EISCONN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EISCONN */
+ if (x == Mono_Posix_Error_ENOTCONN)
+#ifdef ENOTCONN
+ {*r = ENOTCONN; return 0;}
+#else /* def ENOTCONN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTCONN */
+ if (x == Mono_Posix_Error_ESHUTDOWN)
+#ifdef ESHUTDOWN
+ {*r = ESHUTDOWN; return 0;}
+#else /* def ESHUTDOWN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ESHUTDOWN */
+ if (x == Mono_Posix_Error_ETOOMANYREFS)
+#ifdef ETOOMANYREFS
+ {*r = ETOOMANYREFS; return 0;}
+#else /* def ETOOMANYREFS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ETOOMANYREFS */
+ if (x == Mono_Posix_Error_ETIMEDOUT)
+#ifdef ETIMEDOUT
+ {*r = ETIMEDOUT; return 0;}
+#else /* def ETIMEDOUT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ETIMEDOUT */
+ if (x == Mono_Posix_Error_ECONNREFUSED)
+#ifdef ECONNREFUSED
+ {*r = ECONNREFUSED; return 0;}
+#else /* def ECONNREFUSED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ECONNREFUSED */
+ if (x == Mono_Posix_Error_EHOSTDOWN)
+#ifdef EHOSTDOWN
+ {*r = EHOSTDOWN; return 0;}
+#else /* def EHOSTDOWN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EHOSTDOWN */
+ if (x == Mono_Posix_Error_EHOSTUNREACH)
+#ifdef EHOSTUNREACH
+ {*r = EHOSTUNREACH; return 0;}
+#else /* def EHOSTUNREACH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EHOSTUNREACH */
+ if (x == Mono_Posix_Error_EALREADY)
+#ifdef EALREADY
+ {*r = EALREADY; return 0;}
+#else /* def EALREADY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EALREADY */
+ if (x == Mono_Posix_Error_EINPROGRESS)
+#ifdef EINPROGRESS
+ {*r = EINPROGRESS; return 0;}
+#else /* def EINPROGRESS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EINPROGRESS */
+ if (x == Mono_Posix_Error_ESTALE)
+#ifdef ESTALE
+ {*r = ESTALE; return 0;}
+#else /* def ESTALE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ESTALE */
+ if (x == Mono_Posix_Error_EUCLEAN)
+#ifdef EUCLEAN
+ {*r = EUCLEAN; return 0;}
+#else /* def EUCLEAN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EUCLEAN */
+ if (x == Mono_Posix_Error_ENOTNAM)
+#ifdef ENOTNAM
+ {*r = ENOTNAM; return 0;}
+#else /* def ENOTNAM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOTNAM */
+ if (x == Mono_Posix_Error_ENAVAIL)
+#ifdef ENAVAIL
+ {*r = ENAVAIL; return 0;}
+#else /* def ENAVAIL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENAVAIL */
+ if (x == Mono_Posix_Error_EISNAM)
+#ifdef EISNAM
+ {*r = EISNAM; return 0;}
+#else /* def EISNAM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EISNAM */
+ if (x == Mono_Posix_Error_EREMOTEIO)
+#ifdef EREMOTEIO
+ {*r = EREMOTEIO; return 0;}
+#else /* def EREMOTEIO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EREMOTEIO */
+ if (x == Mono_Posix_Error_EDQUOT)
+#ifdef EDQUOT
+ {*r = EDQUOT; return 0;}
+#else /* def EDQUOT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EDQUOT */
+ if (x == Mono_Posix_Error_ENOMEDIUM)
+#ifdef ENOMEDIUM
+ {*r = ENOMEDIUM; return 0;}
+#else /* def ENOMEDIUM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ENOMEDIUM */
+ if (x == Mono_Posix_Error_EMEDIUMTYPE)
+#ifdef EMEDIUMTYPE
+ {*r = EMEDIUMTYPE; return 0;}
+#else /* def EMEDIUMTYPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef EMEDIUMTYPE */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToError (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef EPERM
+ if (x == EPERM)
+ {*r = Mono_Posix_Error_EPERM; return 0;}
+#endif /* ndef EPERM */
+#ifdef ENOENT
+ if (x == ENOENT)
+ {*r = Mono_Posix_Error_ENOENT; return 0;}
+#endif /* ndef ENOENT */
+#ifdef ESRCH
+ if (x == ESRCH)
+ {*r = Mono_Posix_Error_ESRCH; return 0;}
+#endif /* ndef ESRCH */
+#ifdef EINTR
+ if (x == EINTR)
+ {*r = Mono_Posix_Error_EINTR; return 0;}
+#endif /* ndef EINTR */
+#ifdef EIO
+ if (x == EIO)
+ {*r = Mono_Posix_Error_EIO; return 0;}
+#endif /* ndef EIO */
+#ifdef ENXIO
+ if (x == ENXIO)
+ {*r = Mono_Posix_Error_ENXIO; return 0;}
+#endif /* ndef ENXIO */
+#ifdef E2BIG
+ if (x == E2BIG)
+ {*r = Mono_Posix_Error_E2BIG; return 0;}
+#endif /* ndef E2BIG */
+#ifdef ENOEXEC
+ if (x == ENOEXEC)
+ {*r = Mono_Posix_Error_ENOEXEC; return 0;}
+#endif /* ndef ENOEXEC */
+#ifdef EBADF
+ if (x == EBADF)
+ {*r = Mono_Posix_Error_EBADF; return 0;}
+#endif /* ndef EBADF */
+#ifdef ECHILD
+ if (x == ECHILD)
+ {*r = Mono_Posix_Error_ECHILD; return 0;}
+#endif /* ndef ECHILD */
+#ifdef EAGAIN
+ if (x == EAGAIN)
+ {*r = Mono_Posix_Error_EAGAIN; return 0;}
+#endif /* ndef EAGAIN */
+#ifdef ENOMEM
+ if (x == ENOMEM)
+ {*r = Mono_Posix_Error_ENOMEM; return 0;}
+#endif /* ndef ENOMEM */
+#ifdef EACCES
+ if (x == EACCES)
+ {*r = Mono_Posix_Error_EACCES; return 0;}
+#endif /* ndef EACCES */
+#ifdef EFAULT
+ if (x == EFAULT)
+ {*r = Mono_Posix_Error_EFAULT; return 0;}
+#endif /* ndef EFAULT */
+#ifdef ENOTBLK
+ if (x == ENOTBLK)
+ {*r = Mono_Posix_Error_ENOTBLK; return 0;}
+#endif /* ndef ENOTBLK */
+#ifdef EBUSY
+ if (x == EBUSY)
+ {*r = Mono_Posix_Error_EBUSY; return 0;}
+#endif /* ndef EBUSY */
+#ifdef EEXIST
+ if (x == EEXIST)
+ {*r = Mono_Posix_Error_EEXIST; return 0;}
+#endif /* ndef EEXIST */
+#ifdef EXDEV
+ if (x == EXDEV)
+ {*r = Mono_Posix_Error_EXDEV; return 0;}
+#endif /* ndef EXDEV */
+#ifdef ENODEV
+ if (x == ENODEV)
+ {*r = Mono_Posix_Error_ENODEV; return 0;}
+#endif /* ndef ENODEV */
+#ifdef ENOTDIR
+ if (x == ENOTDIR)
+ {*r = Mono_Posix_Error_ENOTDIR; return 0;}
+#endif /* ndef ENOTDIR */
+#ifdef EISDIR
+ if (x == EISDIR)
+ {*r = Mono_Posix_Error_EISDIR; return 0;}
+#endif /* ndef EISDIR */
+#ifdef EINVAL
+ if (x == EINVAL)
+ {*r = Mono_Posix_Error_EINVAL; return 0;}
+#endif /* ndef EINVAL */
+#ifdef ENFILE
+ if (x == ENFILE)
+ {*r = Mono_Posix_Error_ENFILE; return 0;}
+#endif /* ndef ENFILE */
+#ifdef EMFILE
+ if (x == EMFILE)
+ {*r = Mono_Posix_Error_EMFILE; return 0;}
+#endif /* ndef EMFILE */
+#ifdef ENOTTY
+ if (x == ENOTTY)
+ {*r = Mono_Posix_Error_ENOTTY; return 0;}
+#endif /* ndef ENOTTY */
+#ifdef ETXTBSY
+ if (x == ETXTBSY)
+ {*r = Mono_Posix_Error_ETXTBSY; return 0;}
+#endif /* ndef ETXTBSY */
+#ifdef EFBIG
+ if (x == EFBIG)
+ {*r = Mono_Posix_Error_EFBIG; return 0;}
+#endif /* ndef EFBIG */
+#ifdef ENOSPC
+ if (x == ENOSPC)
+ {*r = Mono_Posix_Error_ENOSPC; return 0;}
+#endif /* ndef ENOSPC */
+#ifdef ESPIPE
+ if (x == ESPIPE)
+ {*r = Mono_Posix_Error_ESPIPE; return 0;}
+#endif /* ndef ESPIPE */
+#ifdef EROFS
+ if (x == EROFS)
+ {*r = Mono_Posix_Error_EROFS; return 0;}
+#endif /* ndef EROFS */
+#ifdef EMLINK
+ if (x == EMLINK)
+ {*r = Mono_Posix_Error_EMLINK; return 0;}
+#endif /* ndef EMLINK */
+#ifdef EPIPE
+ if (x == EPIPE)
+ {*r = Mono_Posix_Error_EPIPE; return 0;}
+#endif /* ndef EPIPE */
+#ifdef EDOM
+ if (x == EDOM)
+ {*r = Mono_Posix_Error_EDOM; return 0;}
+#endif /* ndef EDOM */
+#ifdef ERANGE
+ if (x == ERANGE)
+ {*r = Mono_Posix_Error_ERANGE; return 0;}
+#endif /* ndef ERANGE */
+#ifdef EDEADLK
+ if (x == EDEADLK)
+ {*r = Mono_Posix_Error_EDEADLK; return 0;}
+#endif /* ndef EDEADLK */
+#ifdef ENAMETOOLONG
+ if (x == ENAMETOOLONG)
+ {*r = Mono_Posix_Error_ENAMETOOLONG; return 0;}
+#endif /* ndef ENAMETOOLONG */
+#ifdef ENOLCK
+ if (x == ENOLCK)
+ {*r = Mono_Posix_Error_ENOLCK; return 0;}
+#endif /* ndef ENOLCK */
+#ifdef ENOSYS
+ if (x == ENOSYS)
+ {*r = Mono_Posix_Error_ENOSYS; return 0;}
+#endif /* ndef ENOSYS */
+#ifdef ENOTEMPTY
+ if (x == ENOTEMPTY)
+ {*r = Mono_Posix_Error_ENOTEMPTY; return 0;}
+#endif /* ndef ENOTEMPTY */
+#ifdef ELOOP
+ if (x == ELOOP)
+ {*r = Mono_Posix_Error_ELOOP; return 0;}
+#endif /* ndef ELOOP */
+#ifdef EWOULDBLOCK
+ if (x == EWOULDBLOCK)
+ {*r = Mono_Posix_Error_EWOULDBLOCK; return 0;}
+#endif /* ndef EWOULDBLOCK */
+#ifdef ENOMSG
+ if (x == ENOMSG)
+ {*r = Mono_Posix_Error_ENOMSG; return 0;}
+#endif /* ndef ENOMSG */
+#ifdef EIDRM
+ if (x == EIDRM)
+ {*r = Mono_Posix_Error_EIDRM; return 0;}
+#endif /* ndef EIDRM */
+#ifdef ECHRNG
+ if (x == ECHRNG)
+ {*r = Mono_Posix_Error_ECHRNG; return 0;}
+#endif /* ndef ECHRNG */
+#ifdef EL2NSYNC
+ if (x == EL2NSYNC)
+ {*r = Mono_Posix_Error_EL2NSYNC; return 0;}
+#endif /* ndef EL2NSYNC */
+#ifdef EL3HLT
+ if (x == EL3HLT)
+ {*r = Mono_Posix_Error_EL3HLT; return 0;}
+#endif /* ndef EL3HLT */
+#ifdef EL3RST
+ if (x == EL3RST)
+ {*r = Mono_Posix_Error_EL3RST; return 0;}
+#endif /* ndef EL3RST */
+#ifdef ELNRNG
+ if (x == ELNRNG)
+ {*r = Mono_Posix_Error_ELNRNG; return 0;}
+#endif /* ndef ELNRNG */
+#ifdef EUNATCH
+ if (x == EUNATCH)
+ {*r = Mono_Posix_Error_EUNATCH; return 0;}
+#endif /* ndef EUNATCH */
+#ifdef ENOCSI
+ if (x == ENOCSI)
+ {*r = Mono_Posix_Error_ENOCSI; return 0;}
+#endif /* ndef ENOCSI */
+#ifdef EL2HLT
+ if (x == EL2HLT)
+ {*r = Mono_Posix_Error_EL2HLT; return 0;}
+#endif /* ndef EL2HLT */
+#ifdef EBADE
+ if (x == EBADE)
+ {*r = Mono_Posix_Error_EBADE; return 0;}
+#endif /* ndef EBADE */
+#ifdef EBADR
+ if (x == EBADR)
+ {*r = Mono_Posix_Error_EBADR; return 0;}
+#endif /* ndef EBADR */
+#ifdef EXFULL
+ if (x == EXFULL)
+ {*r = Mono_Posix_Error_EXFULL; return 0;}
+#endif /* ndef EXFULL */
+#ifdef ENOANO
+ if (x == ENOANO)
+ {*r = Mono_Posix_Error_ENOANO; return 0;}
+#endif /* ndef ENOANO */
+#ifdef EBADRQC
+ if (x == EBADRQC)
+ {*r = Mono_Posix_Error_EBADRQC; return 0;}
+#endif /* ndef EBADRQC */
+#ifdef EBADSLT
+ if (x == EBADSLT)
+ {*r = Mono_Posix_Error_EBADSLT; return 0;}
+#endif /* ndef EBADSLT */
+#ifdef EDEADLOCK
+ if (x == EDEADLOCK)
+ {*r = Mono_Posix_Error_EDEADLOCK; return 0;}
+#endif /* ndef EDEADLOCK */
+#ifdef EBFONT
+ if (x == EBFONT)
+ {*r = Mono_Posix_Error_EBFONT; return 0;}
+#endif /* ndef EBFONT */
+#ifdef ENOSTR
+ if (x == ENOSTR)
+ {*r = Mono_Posix_Error_ENOSTR; return 0;}
+#endif /* ndef ENOSTR */
+#ifdef ENODATA
+ if (x == ENODATA)
+ {*r = Mono_Posix_Error_ENODATA; return 0;}
+#endif /* ndef ENODATA */
+#ifdef ETIME
+ if (x == ETIME)
+ {*r = Mono_Posix_Error_ETIME; return 0;}
+#endif /* ndef ETIME */
+#ifdef ENOSR
+ if (x == ENOSR)
+ {*r = Mono_Posix_Error_ENOSR; return 0;}
+#endif /* ndef ENOSR */
+#ifdef ENONET
+ if (x == ENONET)
+ {*r = Mono_Posix_Error_ENONET; return 0;}
+#endif /* ndef ENONET */
+#ifdef ENOPKG
+ if (x == ENOPKG)
+ {*r = Mono_Posix_Error_ENOPKG; return 0;}
+#endif /* ndef ENOPKG */
+#ifdef EREMOTE
+ if (x == EREMOTE)
+ {*r = Mono_Posix_Error_EREMOTE; return 0;}
+#endif /* ndef EREMOTE */
+#ifdef ENOLINK
+ if (x == ENOLINK)
+ {*r = Mono_Posix_Error_ENOLINK; return 0;}
+#endif /* ndef ENOLINK */
+#ifdef EADV
+ if (x == EADV)
+ {*r = Mono_Posix_Error_EADV; return 0;}
+#endif /* ndef EADV */
+#ifdef ESRMNT
+ if (x == ESRMNT)
+ {*r = Mono_Posix_Error_ESRMNT; return 0;}
+#endif /* ndef ESRMNT */
+#ifdef ECOMM
+ if (x == ECOMM)
+ {*r = Mono_Posix_Error_ECOMM; return 0;}
+#endif /* ndef ECOMM */
+#ifdef EPROTO
+ if (x == EPROTO)
+ {*r = Mono_Posix_Error_EPROTO; return 0;}
+#endif /* ndef EPROTO */
+#ifdef EMULTIHOP
+ if (x == EMULTIHOP)
+ {*r = Mono_Posix_Error_EMULTIHOP; return 0;}
+#endif /* ndef EMULTIHOP */
+#ifdef EDOTDOT
+ if (x == EDOTDOT)
+ {*r = Mono_Posix_Error_EDOTDOT; return 0;}
+#endif /* ndef EDOTDOT */
+#ifdef EBADMSG
+ if (x == EBADMSG)
+ {*r = Mono_Posix_Error_EBADMSG; return 0;}
+#endif /* ndef EBADMSG */
+#ifdef EOVERFLOW
+ if (x == EOVERFLOW)
+ {*r = Mono_Posix_Error_EOVERFLOW; return 0;}
+#endif /* ndef EOVERFLOW */
+#ifdef ENOTUNIQ
+ if (x == ENOTUNIQ)
+ {*r = Mono_Posix_Error_ENOTUNIQ; return 0;}
+#endif /* ndef ENOTUNIQ */
+#ifdef EBADFD
+ if (x == EBADFD)
+ {*r = Mono_Posix_Error_EBADFD; return 0;}
+#endif /* ndef EBADFD */
+#ifdef EREMCHG
+ if (x == EREMCHG)
+ {*r = Mono_Posix_Error_EREMCHG; return 0;}
+#endif /* ndef EREMCHG */
+#ifdef ELIBACC
+ if (x == ELIBACC)
+ {*r = Mono_Posix_Error_ELIBACC; return 0;}
+#endif /* ndef ELIBACC */
+#ifdef ELIBBAD
+ if (x == ELIBBAD)
+ {*r = Mono_Posix_Error_ELIBBAD; return 0;}
+#endif /* ndef ELIBBAD */
+#ifdef ELIBSCN
+ if (x == ELIBSCN)
+ {*r = Mono_Posix_Error_ELIBSCN; return 0;}
+#endif /* ndef ELIBSCN */
+#ifdef ELIBMAX
+ if (x == ELIBMAX)
+ {*r = Mono_Posix_Error_ELIBMAX; return 0;}
+#endif /* ndef ELIBMAX */
+#ifdef ELIBEXEC
+ if (x == ELIBEXEC)
+ {*r = Mono_Posix_Error_ELIBEXEC; return 0;}
+#endif /* ndef ELIBEXEC */
+#ifdef EILSEQ
+ if (x == EILSEQ)
+ {*r = Mono_Posix_Error_EILSEQ; return 0;}
+#endif /* ndef EILSEQ */
+#ifdef ERESTART
+ if (x == ERESTART)
+ {*r = Mono_Posix_Error_ERESTART; return 0;}
+#endif /* ndef ERESTART */
+#ifdef ESTRPIPE
+ if (x == ESTRPIPE)
+ {*r = Mono_Posix_Error_ESTRPIPE; return 0;}
+#endif /* ndef ESTRPIPE */
+#ifdef EUSERS
+ if (x == EUSERS)
+ {*r = Mono_Posix_Error_EUSERS; return 0;}
+#endif /* ndef EUSERS */
+#ifdef ENOTSOCK
+ if (x == ENOTSOCK)
+ {*r = Mono_Posix_Error_ENOTSOCK; return 0;}
+#endif /* ndef ENOTSOCK */
+#ifdef EDESTADDRREQ
+ if (x == EDESTADDRREQ)
+ {*r = Mono_Posix_Error_EDESTADDRREQ; return 0;}
+#endif /* ndef EDESTADDRREQ */
+#ifdef EMSGSIZE
+ if (x == EMSGSIZE)
+ {*r = Mono_Posix_Error_EMSGSIZE; return 0;}
+#endif /* ndef EMSGSIZE */
+#ifdef EPROTOTYPE
+ if (x == EPROTOTYPE)
+ {*r = Mono_Posix_Error_EPROTOTYPE; return 0;}
+#endif /* ndef EPROTOTYPE */
+#ifdef ENOPROTOOPT
+ if (x == ENOPROTOOPT)
+ {*r = Mono_Posix_Error_ENOPROTOOPT; return 0;}
+#endif /* ndef ENOPROTOOPT */
+#ifdef EPROTONOSUPPORT
+ if (x == EPROTONOSUPPORT)
+ {*r = Mono_Posix_Error_EPROTONOSUPPORT; return 0;}
+#endif /* ndef EPROTONOSUPPORT */
+#ifdef ESOCKTNOSUPPORT
+ if (x == ESOCKTNOSUPPORT)
+ {*r = Mono_Posix_Error_ESOCKTNOSUPPORT; return 0;}
+#endif /* ndef ESOCKTNOSUPPORT */
+#ifdef EOPNOTSUPP
+ if (x == EOPNOTSUPP)
+ {*r = Mono_Posix_Error_EOPNOTSUPP; return 0;}
+#endif /* ndef EOPNOTSUPP */
+#ifdef EPFNOSUPPORT
+ if (x == EPFNOSUPPORT)
+ {*r = Mono_Posix_Error_EPFNOSUPPORT; return 0;}
+#endif /* ndef EPFNOSUPPORT */
+#ifdef EAFNOSUPPORT
+ if (x == EAFNOSUPPORT)
+ {*r = Mono_Posix_Error_EAFNOSUPPORT; return 0;}
+#endif /* ndef EAFNOSUPPORT */
+#ifdef EADDRINUSE
+ if (x == EADDRINUSE)
+ {*r = Mono_Posix_Error_EADDRINUSE; return 0;}
+#endif /* ndef EADDRINUSE */
+#ifdef EADDRNOTAVAIL
+ if (x == EADDRNOTAVAIL)
+ {*r = Mono_Posix_Error_EADDRNOTAVAIL; return 0;}
+#endif /* ndef EADDRNOTAVAIL */
+#ifdef ENETDOWN
+ if (x == ENETDOWN)
+ {*r = Mono_Posix_Error_ENETDOWN; return 0;}
+#endif /* ndef ENETDOWN */
+#ifdef ENETUNREACH
+ if (x == ENETUNREACH)
+ {*r = Mono_Posix_Error_ENETUNREACH; return 0;}
+#endif /* ndef ENETUNREACH */
+#ifdef ENETRESET
+ if (x == ENETRESET)
+ {*r = Mono_Posix_Error_ENETRESET; return 0;}
+#endif /* ndef ENETRESET */
+#ifdef ECONNABORTED
+ if (x == ECONNABORTED)
+ {*r = Mono_Posix_Error_ECONNABORTED; return 0;}
+#endif /* ndef ECONNABORTED */
+#ifdef ECONNRESET
+ if (x == ECONNRESET)
+ {*r = Mono_Posix_Error_ECONNRESET; return 0;}
+#endif /* ndef ECONNRESET */
+#ifdef ENOBUFS
+ if (x == ENOBUFS)
+ {*r = Mono_Posix_Error_ENOBUFS; return 0;}
+#endif /* ndef ENOBUFS */
+#ifdef EISCONN
+ if (x == EISCONN)
+ {*r = Mono_Posix_Error_EISCONN; return 0;}
+#endif /* ndef EISCONN */
+#ifdef ENOTCONN
+ if (x == ENOTCONN)
+ {*r = Mono_Posix_Error_ENOTCONN; return 0;}
+#endif /* ndef ENOTCONN */
+#ifdef ESHUTDOWN
+ if (x == ESHUTDOWN)
+ {*r = Mono_Posix_Error_ESHUTDOWN; return 0;}
+#endif /* ndef ESHUTDOWN */
+#ifdef ETOOMANYREFS
+ if (x == ETOOMANYREFS)
+ {*r = Mono_Posix_Error_ETOOMANYREFS; return 0;}
+#endif /* ndef ETOOMANYREFS */
+#ifdef ETIMEDOUT
+ if (x == ETIMEDOUT)
+ {*r = Mono_Posix_Error_ETIMEDOUT; return 0;}
+#endif /* ndef ETIMEDOUT */
+#ifdef ECONNREFUSED
+ if (x == ECONNREFUSED)
+ {*r = Mono_Posix_Error_ECONNREFUSED; return 0;}
+#endif /* ndef ECONNREFUSED */
+#ifdef EHOSTDOWN
+ if (x == EHOSTDOWN)
+ {*r = Mono_Posix_Error_EHOSTDOWN; return 0;}
+#endif /* ndef EHOSTDOWN */
+#ifdef EHOSTUNREACH
+ if (x == EHOSTUNREACH)
+ {*r = Mono_Posix_Error_EHOSTUNREACH; return 0;}
+#endif /* ndef EHOSTUNREACH */
+#ifdef EALREADY
+ if (x == EALREADY)
+ {*r = Mono_Posix_Error_EALREADY; return 0;}
+#endif /* ndef EALREADY */
+#ifdef EINPROGRESS
+ if (x == EINPROGRESS)
+ {*r = Mono_Posix_Error_EINPROGRESS; return 0;}
+#endif /* ndef EINPROGRESS */
+#ifdef ESTALE
+ if (x == ESTALE)
+ {*r = Mono_Posix_Error_ESTALE; return 0;}
+#endif /* ndef ESTALE */
+#ifdef EUCLEAN
+ if (x == EUCLEAN)
+ {*r = Mono_Posix_Error_EUCLEAN; return 0;}
+#endif /* ndef EUCLEAN */
+#ifdef ENOTNAM
+ if (x == ENOTNAM)
+ {*r = Mono_Posix_Error_ENOTNAM; return 0;}
+#endif /* ndef ENOTNAM */
+#ifdef ENAVAIL
+ if (x == ENAVAIL)
+ {*r = Mono_Posix_Error_ENAVAIL; return 0;}
+#endif /* ndef ENAVAIL */
+#ifdef EISNAM
+ if (x == EISNAM)
+ {*r = Mono_Posix_Error_EISNAM; return 0;}
+#endif /* ndef EISNAM */
+#ifdef EREMOTEIO
+ if (x == EREMOTEIO)
+ {*r = Mono_Posix_Error_EREMOTEIO; return 0;}
+#endif /* ndef EREMOTEIO */
+#ifdef EDQUOT
+ if (x == EDQUOT)
+ {*r = Mono_Posix_Error_EDQUOT; return 0;}
+#endif /* ndef EDQUOT */
+#ifdef ENOMEDIUM
+ if (x == ENOMEDIUM)
+ {*r = Mono_Posix_Error_ENOMEDIUM; return 0;}
+#endif /* ndef ENOMEDIUM */
+#ifdef EMEDIUMTYPE
+ if (x == EMEDIUMTYPE)
+ {*r = Mono_Posix_Error_EMEDIUMTYPE; return 0;}
+#endif /* ndef EMEDIUMTYPE */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromOpenFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_OpenFlags_O_RDONLY) == Mono_Posix_OpenFlags_O_RDONLY)
+#ifdef O_RDONLY
+ *r |= O_RDONLY;
+#else /* def O_RDONLY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_RDONLY */
+ if ((x & Mono_Posix_OpenFlags_O_WRONLY) == Mono_Posix_OpenFlags_O_WRONLY)
+#ifdef O_WRONLY
+ *r |= O_WRONLY;
+#else /* def O_WRONLY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_WRONLY */
+ if ((x & Mono_Posix_OpenFlags_O_RDWR) == Mono_Posix_OpenFlags_O_RDWR)
+#ifdef O_RDWR
+ *r |= O_RDWR;
+#else /* def O_RDWR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_RDWR */
+ if ((x & Mono_Posix_OpenFlags_O_CREAT) == Mono_Posix_OpenFlags_O_CREAT)
+#ifdef O_CREAT
+ *r |= O_CREAT;
+#else /* def O_CREAT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_CREAT */
+ if ((x & Mono_Posix_OpenFlags_O_EXCL) == Mono_Posix_OpenFlags_O_EXCL)
+#ifdef O_EXCL
+ *r |= O_EXCL;
+#else /* def O_EXCL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_EXCL */
+ if ((x & Mono_Posix_OpenFlags_O_NOCTTY) == Mono_Posix_OpenFlags_O_NOCTTY)
+#ifdef O_NOCTTY
+ *r |= O_NOCTTY;
+#else /* def O_NOCTTY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_NOCTTY */
+ if ((x & Mono_Posix_OpenFlags_O_TRUNC) == Mono_Posix_OpenFlags_O_TRUNC)
+#ifdef O_TRUNC
+ *r |= O_TRUNC;
+#else /* def O_TRUNC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_TRUNC */
+ if ((x & Mono_Posix_OpenFlags_O_APPEND) == Mono_Posix_OpenFlags_O_APPEND)
+#ifdef O_APPEND
+ *r |= O_APPEND;
+#else /* def O_APPEND */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_APPEND */
+ if ((x & Mono_Posix_OpenFlags_O_NONBLOCK) == Mono_Posix_OpenFlags_O_NONBLOCK)
+#ifdef O_NONBLOCK
+ *r |= O_NONBLOCK;
+#else /* def O_NONBLOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_NONBLOCK */
+ if ((x & Mono_Posix_OpenFlags_O_SYNC) == Mono_Posix_OpenFlags_O_SYNC)
+#ifdef O_SYNC
+ *r |= O_SYNC;
+#else /* def O_SYNC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_SYNC */
+ if ((x & Mono_Posix_OpenFlags_O_NOFOLLOW) == Mono_Posix_OpenFlags_O_NOFOLLOW)
+#ifdef O_NOFOLLOW
+ *r |= O_NOFOLLOW;
+#else /* def O_NOFOLLOW */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_NOFOLLOW */
+ if ((x & Mono_Posix_OpenFlags_O_DIRECTORY) == Mono_Posix_OpenFlags_O_DIRECTORY)
+#ifdef O_DIRECTORY
+ *r |= O_DIRECTORY;
+#else /* def O_DIRECTORY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_DIRECTORY */
+ if ((x & Mono_Posix_OpenFlags_O_DIRECT) == Mono_Posix_OpenFlags_O_DIRECT)
+#ifdef O_DIRECT
+ *r |= O_DIRECT;
+#else /* def O_DIRECT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_DIRECT */
+ if ((x & Mono_Posix_OpenFlags_O_ASYNC) == Mono_Posix_OpenFlags_O_ASYNC)
+#ifdef O_ASYNC
+ *r |= O_ASYNC;
+#else /* def O_ASYNC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_ASYNC */
+ if ((x & Mono_Posix_OpenFlags_O_LARGEFILE) == Mono_Posix_OpenFlags_O_LARGEFILE)
+#ifdef O_LARGEFILE
+ *r |= O_LARGEFILE;
+#else /* def O_LARGEFILE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef O_LARGEFILE */
+ return 0;
+}
+
+int Mono_Posix_ToOpenFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef O_RDONLY
+ if ((x & O_RDONLY) == O_RDONLY)
+ *r |= Mono_Posix_OpenFlags_O_RDONLY;
+#endif /* ndef O_RDONLY */
+#ifdef O_WRONLY
+ if ((x & O_WRONLY) == O_WRONLY)
+ *r |= Mono_Posix_OpenFlags_O_WRONLY;
+#endif /* ndef O_WRONLY */
+#ifdef O_RDWR
+ if ((x & O_RDWR) == O_RDWR)
+ *r |= Mono_Posix_OpenFlags_O_RDWR;
+#endif /* ndef O_RDWR */
+#ifdef O_CREAT
+ if ((x & O_CREAT) == O_CREAT)
+ *r |= Mono_Posix_OpenFlags_O_CREAT;
+#endif /* ndef O_CREAT */
+#ifdef O_EXCL
+ if ((x & O_EXCL) == O_EXCL)
+ *r |= Mono_Posix_OpenFlags_O_EXCL;
+#endif /* ndef O_EXCL */
+#ifdef O_NOCTTY
+ if ((x & O_NOCTTY) == O_NOCTTY)
+ *r |= Mono_Posix_OpenFlags_O_NOCTTY;
+#endif /* ndef O_NOCTTY */
+#ifdef O_TRUNC
+ if ((x & O_TRUNC) == O_TRUNC)
+ *r |= Mono_Posix_OpenFlags_O_TRUNC;
+#endif /* ndef O_TRUNC */
+#ifdef O_APPEND
+ if ((x & O_APPEND) == O_APPEND)
+ *r |= Mono_Posix_OpenFlags_O_APPEND;
+#endif /* ndef O_APPEND */
+#ifdef O_NONBLOCK
+ if ((x & O_NONBLOCK) == O_NONBLOCK)
+ *r |= Mono_Posix_OpenFlags_O_NONBLOCK;
+#endif /* ndef O_NONBLOCK */
+#ifdef O_SYNC
+ if ((x & O_SYNC) == O_SYNC)
+ *r |= Mono_Posix_OpenFlags_O_SYNC;
+#endif /* ndef O_SYNC */
+#ifdef O_NOFOLLOW
+ if ((x & O_NOFOLLOW) == O_NOFOLLOW)
+ *r |= Mono_Posix_OpenFlags_O_NOFOLLOW;
+#endif /* ndef O_NOFOLLOW */
+#ifdef O_DIRECTORY
+ if ((x & O_DIRECTORY) == O_DIRECTORY)
+ *r |= Mono_Posix_OpenFlags_O_DIRECTORY;
+#endif /* ndef O_DIRECTORY */
+#ifdef O_DIRECT
+ if ((x & O_DIRECT) == O_DIRECT)
+ *r |= Mono_Posix_OpenFlags_O_DIRECT;
+#endif /* ndef O_DIRECT */
+#ifdef O_ASYNC
+ if ((x & O_ASYNC) == O_ASYNC)
+ *r |= Mono_Posix_OpenFlags_O_ASYNC;
+#endif /* ndef O_ASYNC */
+#ifdef O_LARGEFILE
+ if ((x & O_LARGEFILE) == O_LARGEFILE)
+ *r |= Mono_Posix_OpenFlags_O_LARGEFILE;
+#endif /* ndef O_LARGEFILE */
+ return 0;
+}
+
+int Mono_Posix_FromFilePermissions (unsigned int x, unsigned int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_FilePermissions_S_ISUID) == Mono_Posix_FilePermissions_S_ISUID)
+#ifdef S_ISUID
+ *r |= S_ISUID;
+#else /* def S_ISUID */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_ISUID */
+ if ((x & Mono_Posix_FilePermissions_S_ISGID) == Mono_Posix_FilePermissions_S_ISGID)
+#ifdef S_ISGID
+ *r |= S_ISGID;
+#else /* def S_ISGID */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_ISGID */
+ if ((x & Mono_Posix_FilePermissions_S_ISVTX) == Mono_Posix_FilePermissions_S_ISVTX)
+#ifdef S_ISVTX
+ *r |= S_ISVTX;
+#else /* def S_ISVTX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_ISVTX */
+ if ((x & Mono_Posix_FilePermissions_S_IRUSR) == Mono_Posix_FilePermissions_S_IRUSR)
+#ifdef S_IRUSR
+ *r |= S_IRUSR;
+#else /* def S_IRUSR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IRUSR */
+ if ((x & Mono_Posix_FilePermissions_S_IWUSR) == Mono_Posix_FilePermissions_S_IWUSR)
+#ifdef S_IWUSR
+ *r |= S_IWUSR;
+#else /* def S_IWUSR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IWUSR */
+ if ((x & Mono_Posix_FilePermissions_S_IXUSR) == Mono_Posix_FilePermissions_S_IXUSR)
+#ifdef S_IXUSR
+ *r |= S_IXUSR;
+#else /* def S_IXUSR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IXUSR */
+ if ((x & Mono_Posix_FilePermissions_S_IRGRP) == Mono_Posix_FilePermissions_S_IRGRP)
+#ifdef S_IRGRP
+ *r |= S_IRGRP;
+#else /* def S_IRGRP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IRGRP */
+ if ((x & Mono_Posix_FilePermissions_S_IWGRP) == Mono_Posix_FilePermissions_S_IWGRP)
+#ifdef S_IWGRP
+ *r |= S_IWGRP;
+#else /* def S_IWGRP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IWGRP */
+ if ((x & Mono_Posix_FilePermissions_S_IXGRP) == Mono_Posix_FilePermissions_S_IXGRP)
+#ifdef S_IXGRP
+ *r |= S_IXGRP;
+#else /* def S_IXGRP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IXGRP */
+ if ((x & Mono_Posix_FilePermissions_S_IROTH) == Mono_Posix_FilePermissions_S_IROTH)
+#ifdef S_IROTH
+ *r |= S_IROTH;
+#else /* def S_IROTH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IROTH */
+ if ((x & Mono_Posix_FilePermissions_S_IWOTH) == Mono_Posix_FilePermissions_S_IWOTH)
+#ifdef S_IWOTH
+ *r |= S_IWOTH;
+#else /* def S_IWOTH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IWOTH */
+ if ((x & Mono_Posix_FilePermissions_S_IXOTH) == Mono_Posix_FilePermissions_S_IXOTH)
+#ifdef S_IXOTH
+ *r |= S_IXOTH;
+#else /* def S_IXOTH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IXOTH */
+ if ((x & Mono_Posix_FilePermissions_S_IRWXG) == Mono_Posix_FilePermissions_S_IRWXG)
+#ifdef S_IRWXG
+ *r |= S_IRWXG;
+#else /* def S_IRWXG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IRWXG */
+ if ((x & Mono_Posix_FilePermissions_S_IRWXU) == Mono_Posix_FilePermissions_S_IRWXU)
+#ifdef S_IRWXU
+ *r |= S_IRWXU;
+#else /* def S_IRWXU */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IRWXU */
+ if ((x & Mono_Posix_FilePermissions_S_IRWXO) == Mono_Posix_FilePermissions_S_IRWXO)
+#ifdef S_IRWXO
+ *r |= S_IRWXO;
+#else /* def S_IRWXO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IRWXO */
+ if ((x & Mono_Posix_FilePermissions_ACCESSPERMS) == Mono_Posix_FilePermissions_ACCESSPERMS)
+#ifdef ACCESSPERMS
+ *r |= ACCESSPERMS;
+#else /* def ACCESSPERMS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ACCESSPERMS */
+ if ((x & Mono_Posix_FilePermissions_ALLPERMS) == Mono_Posix_FilePermissions_ALLPERMS)
+#ifdef ALLPERMS
+ *r |= ALLPERMS;
+#else /* def ALLPERMS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef ALLPERMS */
+ if ((x & Mono_Posix_FilePermissions_DEFFILEMODE) == Mono_Posix_FilePermissions_DEFFILEMODE)
+#ifdef DEFFILEMODE
+ *r |= DEFFILEMODE;
+#else /* def DEFFILEMODE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DEFFILEMODE */
+ if ((x & Mono_Posix_FilePermissions_S_IFMT) == Mono_Posix_FilePermissions_S_IFMT)
+#ifdef S_IFMT
+ *r |= S_IFMT;
+#else /* def S_IFMT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFMT */
+ if ((x & Mono_Posix_FilePermissions_S_IFDIR) == Mono_Posix_FilePermissions_S_IFDIR)
+#ifdef S_IFDIR
+ *r |= S_IFDIR;
+#else /* def S_IFDIR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFDIR */
+ if ((x & Mono_Posix_FilePermissions_S_IFCHR) == Mono_Posix_FilePermissions_S_IFCHR)
+#ifdef S_IFCHR
+ *r |= S_IFCHR;
+#else /* def S_IFCHR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFCHR */
+ if ((x & Mono_Posix_FilePermissions_S_IFBLK) == Mono_Posix_FilePermissions_S_IFBLK)
+#ifdef S_IFBLK
+ *r |= S_IFBLK;
+#else /* def S_IFBLK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFBLK */
+ if ((x & Mono_Posix_FilePermissions_S_IFREG) == Mono_Posix_FilePermissions_S_IFREG)
+#ifdef S_IFREG
+ *r |= S_IFREG;
+#else /* def S_IFREG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFREG */
+ if ((x & Mono_Posix_FilePermissions_S_IFIFO) == Mono_Posix_FilePermissions_S_IFIFO)
+#ifdef S_IFIFO
+ *r |= S_IFIFO;
+#else /* def S_IFIFO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFIFO */
+ if ((x & Mono_Posix_FilePermissions_S_IFLNK) == Mono_Posix_FilePermissions_S_IFLNK)
+#ifdef S_IFLNK
+ *r |= S_IFLNK;
+#else /* def S_IFLNK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFLNK */
+ if ((x & Mono_Posix_FilePermissions_S_IFSOCK) == Mono_Posix_FilePermissions_S_IFSOCK)
+#ifdef S_IFSOCK
+ *r |= S_IFSOCK;
+#else /* def S_IFSOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IFSOCK */
+ return 0;
+}
+
+int Mono_Posix_ToFilePermissions (unsigned int x, unsigned int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef S_ISUID
+ if ((x & S_ISUID) == S_ISUID)
+ *r |= Mono_Posix_FilePermissions_S_ISUID;
+#endif /* ndef S_ISUID */
+#ifdef S_ISGID
+ if ((x & S_ISGID) == S_ISGID)
+ *r |= Mono_Posix_FilePermissions_S_ISGID;
+#endif /* ndef S_ISGID */
+#ifdef S_ISVTX
+ if ((x & S_ISVTX) == S_ISVTX)
+ *r |= Mono_Posix_FilePermissions_S_ISVTX;
+#endif /* ndef S_ISVTX */
+#ifdef S_IRUSR
+ if ((x & S_IRUSR) == S_IRUSR)
+ *r |= Mono_Posix_FilePermissions_S_IRUSR;
+#endif /* ndef S_IRUSR */
+#ifdef S_IWUSR
+ if ((x & S_IWUSR) == S_IWUSR)
+ *r |= Mono_Posix_FilePermissions_S_IWUSR;
+#endif /* ndef S_IWUSR */
+#ifdef S_IXUSR
+ if ((x & S_IXUSR) == S_IXUSR)
+ *r |= Mono_Posix_FilePermissions_S_IXUSR;
+#endif /* ndef S_IXUSR */
+#ifdef S_IRGRP
+ if ((x & S_IRGRP) == S_IRGRP)
+ *r |= Mono_Posix_FilePermissions_S_IRGRP;
+#endif /* ndef S_IRGRP */
+#ifdef S_IWGRP
+ if ((x & S_IWGRP) == S_IWGRP)
+ *r |= Mono_Posix_FilePermissions_S_IWGRP;
+#endif /* ndef S_IWGRP */
+#ifdef S_IXGRP
+ if ((x & S_IXGRP) == S_IXGRP)
+ *r |= Mono_Posix_FilePermissions_S_IXGRP;
+#endif /* ndef S_IXGRP */
+#ifdef S_IROTH
+ if ((x & S_IROTH) == S_IROTH)
+ *r |= Mono_Posix_FilePermissions_S_IROTH;
+#endif /* ndef S_IROTH */
+#ifdef S_IWOTH
+ if ((x & S_IWOTH) == S_IWOTH)
+ *r |= Mono_Posix_FilePermissions_S_IWOTH;
+#endif /* ndef S_IWOTH */
+#ifdef S_IXOTH
+ if ((x & S_IXOTH) == S_IXOTH)
+ *r |= Mono_Posix_FilePermissions_S_IXOTH;
+#endif /* ndef S_IXOTH */
+#ifdef S_IRWXG
+ if ((x & S_IRWXG) == S_IRWXG)
+ *r |= Mono_Posix_FilePermissions_S_IRWXG;
+#endif /* ndef S_IRWXG */
+#ifdef S_IRWXU
+ if ((x & S_IRWXU) == S_IRWXU)
+ *r |= Mono_Posix_FilePermissions_S_IRWXU;
+#endif /* ndef S_IRWXU */
+#ifdef S_IRWXO
+ if ((x & S_IRWXO) == S_IRWXO)
+ *r |= Mono_Posix_FilePermissions_S_IRWXO;
+#endif /* ndef S_IRWXO */
+#ifdef ACCESSPERMS
+ if ((x & ACCESSPERMS) == ACCESSPERMS)
+ *r |= Mono_Posix_FilePermissions_ACCESSPERMS;
+#endif /* ndef ACCESSPERMS */
+#ifdef ALLPERMS
+ if ((x & ALLPERMS) == ALLPERMS)
+ *r |= Mono_Posix_FilePermissions_ALLPERMS;
+#endif /* ndef ALLPERMS */
+#ifdef DEFFILEMODE
+ if ((x & DEFFILEMODE) == DEFFILEMODE)
+ *r |= Mono_Posix_FilePermissions_DEFFILEMODE;
+#endif /* ndef DEFFILEMODE */
+#ifdef S_IFMT
+ if ((x & S_IFMT) == S_IFMT)
+ *r |= Mono_Posix_FilePermissions_S_IFMT;
+#endif /* ndef S_IFMT */
+#ifdef S_IFDIR
+ if ((x & S_IFDIR) == S_IFDIR)
+ *r |= Mono_Posix_FilePermissions_S_IFDIR;
+#endif /* ndef S_IFDIR */
+#ifdef S_IFCHR
+ if ((x & S_IFCHR) == S_IFCHR)
+ *r |= Mono_Posix_FilePermissions_S_IFCHR;
+#endif /* ndef S_IFCHR */
+#ifdef S_IFBLK
+ if ((x & S_IFBLK) == S_IFBLK)
+ *r |= Mono_Posix_FilePermissions_S_IFBLK;
+#endif /* ndef S_IFBLK */
+#ifdef S_IFREG
+ if ((x & S_IFREG) == S_IFREG)
+ *r |= Mono_Posix_FilePermissions_S_IFREG;
+#endif /* ndef S_IFREG */
+#ifdef S_IFIFO
+ if ((x & S_IFIFO) == S_IFIFO)
+ *r |= Mono_Posix_FilePermissions_S_IFIFO;
+#endif /* ndef S_IFIFO */
+#ifdef S_IFLNK
+ if ((x & S_IFLNK) == S_IFLNK)
+ *r |= Mono_Posix_FilePermissions_S_IFLNK;
+#endif /* ndef S_IFLNK */
+#ifdef S_IFSOCK
+ if ((x & S_IFSOCK) == S_IFSOCK)
+ *r |= Mono_Posix_FilePermissions_S_IFSOCK;
+#endif /* ndef S_IFSOCK */
+ return 0;
+}
+
+int Mono_Posix_FromFcntlCommand (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_FcntlCommand_F_DUPFD)
+#ifdef F_DUPFD
+ {*r = F_DUPFD; return 0;}
+#else /* def F_DUPFD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_DUPFD */
+ if (x == Mono_Posix_FcntlCommand_F_GETFD)
+#ifdef F_GETFD
+ {*r = F_GETFD; return 0;}
+#else /* def F_GETFD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_GETFD */
+ if (x == Mono_Posix_FcntlCommand_F_SETFD)
+#ifdef F_SETFD
+ {*r = F_SETFD; return 0;}
+#else /* def F_SETFD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_SETFD */
+ if (x == Mono_Posix_FcntlCommand_F_GETFL)
+#ifdef F_GETFL
+ {*r = F_GETFL; return 0;}
+#else /* def F_GETFL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_GETFL */
+ if (x == Mono_Posix_FcntlCommand_F_SETFL)
+#ifdef F_SETFL
+ {*r = F_SETFL; return 0;}
+#else /* def F_SETFL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_SETFL */
+ if (x == Mono_Posix_FcntlCommand_F_GETLK)
+#ifdef F_GETLK
+ {*r = F_GETLK; return 0;}
+#else /* def F_GETLK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_GETLK */
+ if (x == Mono_Posix_FcntlCommand_F_SETLK)
+#ifdef F_SETLK
+ {*r = F_SETLK; return 0;}
+#else /* def F_SETLK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_SETLK */
+ if (x == Mono_Posix_FcntlCommand_F_SETLKW)
+#ifdef F_SETLKW
+ {*r = F_SETLKW; return 0;}
+#else /* def F_SETLKW */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_SETLKW */
+ if (x == Mono_Posix_FcntlCommand_F_SETOWN)
+#ifdef F_SETOWN
+ {*r = F_SETOWN; return 0;}
+#else /* def F_SETOWN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_SETOWN */
+ if (x == Mono_Posix_FcntlCommand_F_GETOWN)
+#ifdef F_GETOWN
+ {*r = F_GETOWN; return 0;}
+#else /* def F_GETOWN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_GETOWN */
+ if (x == Mono_Posix_FcntlCommand_F_SETSIG)
+#ifdef F_SETSIG
+ {*r = F_SETSIG; return 0;}
+#else /* def F_SETSIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_SETSIG */
+ if (x == Mono_Posix_FcntlCommand_F_GETSIG)
+#ifdef F_GETSIG
+ {*r = F_GETSIG; return 0;}
+#else /* def F_GETSIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_GETSIG */
+ if (x == Mono_Posix_FcntlCommand_F_SETLEASE)
+#ifdef F_SETLEASE
+ {*r = F_SETLEASE; return 0;}
+#else /* def F_SETLEASE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_SETLEASE */
+ if (x == Mono_Posix_FcntlCommand_F_GETLEASE)
+#ifdef F_GETLEASE
+ {*r = F_GETLEASE; return 0;}
+#else /* def F_GETLEASE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_GETLEASE */
+ if (x == Mono_Posix_FcntlCommand_F_NOTIFY)
+#ifdef F_NOTIFY
+ {*r = F_NOTIFY; return 0;}
+#else /* def F_NOTIFY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_NOTIFY */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToFcntlCommand (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef F_DUPFD
+ if (x == F_DUPFD)
+ {*r = Mono_Posix_FcntlCommand_F_DUPFD; return 0;}
+#endif /* ndef F_DUPFD */
+#ifdef F_GETFD
+ if (x == F_GETFD)
+ {*r = Mono_Posix_FcntlCommand_F_GETFD; return 0;}
+#endif /* ndef F_GETFD */
+#ifdef F_SETFD
+ if (x == F_SETFD)
+ {*r = Mono_Posix_FcntlCommand_F_SETFD; return 0;}
+#endif /* ndef F_SETFD */
+#ifdef F_GETFL
+ if (x == F_GETFL)
+ {*r = Mono_Posix_FcntlCommand_F_GETFL; return 0;}
+#endif /* ndef F_GETFL */
+#ifdef F_SETFL
+ if (x == F_SETFL)
+ {*r = Mono_Posix_FcntlCommand_F_SETFL; return 0;}
+#endif /* ndef F_SETFL */
+#ifdef F_GETLK
+ if (x == F_GETLK)
+ {*r = Mono_Posix_FcntlCommand_F_GETLK; return 0;}
+#endif /* ndef F_GETLK */
+#ifdef F_SETLK
+ if (x == F_SETLK)
+ {*r = Mono_Posix_FcntlCommand_F_SETLK; return 0;}
+#endif /* ndef F_SETLK */
+#ifdef F_SETLKW
+ if (x == F_SETLKW)
+ {*r = Mono_Posix_FcntlCommand_F_SETLKW; return 0;}
+#endif /* ndef F_SETLKW */
+#ifdef F_SETOWN
+ if (x == F_SETOWN)
+ {*r = Mono_Posix_FcntlCommand_F_SETOWN; return 0;}
+#endif /* ndef F_SETOWN */
+#ifdef F_GETOWN
+ if (x == F_GETOWN)
+ {*r = Mono_Posix_FcntlCommand_F_GETOWN; return 0;}
+#endif /* ndef F_GETOWN */
+#ifdef F_SETSIG
+ if (x == F_SETSIG)
+ {*r = Mono_Posix_FcntlCommand_F_SETSIG; return 0;}
+#endif /* ndef F_SETSIG */
+#ifdef F_GETSIG
+ if (x == F_GETSIG)
+ {*r = Mono_Posix_FcntlCommand_F_GETSIG; return 0;}
+#endif /* ndef F_GETSIG */
+#ifdef F_SETLEASE
+ if (x == F_SETLEASE)
+ {*r = Mono_Posix_FcntlCommand_F_SETLEASE; return 0;}
+#endif /* ndef F_SETLEASE */
+#ifdef F_GETLEASE
+ if (x == F_GETLEASE)
+ {*r = Mono_Posix_FcntlCommand_F_GETLEASE; return 0;}
+#endif /* ndef F_GETLEASE */
+#ifdef F_NOTIFY
+ if (x == F_NOTIFY)
+ {*r = Mono_Posix_FcntlCommand_F_NOTIFY; return 0;}
+#endif /* ndef F_NOTIFY */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromLockType (short x, short *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_LockType_F_RDLCK)
+#ifdef F_RDLCK
+ {*r = F_RDLCK; return 0;}
+#else /* def F_RDLCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_RDLCK */
+ if (x == Mono_Posix_LockType_F_WRLCK)
+#ifdef F_WRLCK
+ {*r = F_WRLCK; return 0;}
+#else /* def F_WRLCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_WRLCK */
+ if (x == Mono_Posix_LockType_F_UNLCK)
+#ifdef F_UNLCK
+ {*r = F_UNLCK; return 0;}
+#else /* def F_UNLCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_UNLCK */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToLockType (short x, short *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef F_RDLCK
+ if (x == F_RDLCK)
+ {*r = Mono_Posix_LockType_F_RDLCK; return 0;}
+#endif /* ndef F_RDLCK */
+#ifdef F_WRLCK
+ if (x == F_WRLCK)
+ {*r = Mono_Posix_LockType_F_WRLCK; return 0;}
+#endif /* ndef F_WRLCK */
+#ifdef F_UNLCK
+ if (x == F_UNLCK)
+ {*r = Mono_Posix_LockType_F_UNLCK; return 0;}
+#endif /* ndef F_UNLCK */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromSeekFlags (short x, short *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_SeekFlags_SEEK_SET)
+#ifdef SEEK_SET
+ {*r = SEEK_SET; return 0;}
+#else /* def SEEK_SET */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SEEK_SET */
+ if (x == Mono_Posix_SeekFlags_SEEK_CUR)
+#ifdef SEEK_CUR
+ {*r = SEEK_CUR; return 0;}
+#else /* def SEEK_CUR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SEEK_CUR */
+ if (x == Mono_Posix_SeekFlags_SEEK_END)
+#ifdef SEEK_END
+ {*r = SEEK_END; return 0;}
+#else /* def SEEK_END */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SEEK_END */
+ if (x == Mono_Posix_SeekFlags_L_SET)
+#ifdef L_SET
+ {*r = L_SET; return 0;}
+#else /* def L_SET */
+ {errno = EINVAL; return -1;}
+#endif /* ndef L_SET */
+ if (x == Mono_Posix_SeekFlags_L_INCR)
+#ifdef L_INCR
+ {*r = L_INCR; return 0;}
+#else /* def L_INCR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef L_INCR */
+ if (x == Mono_Posix_SeekFlags_L_XTND)
+#ifdef L_XTND
+ {*r = L_XTND; return 0;}
+#else /* def L_XTND */
+ {errno = EINVAL; return -1;}
+#endif /* ndef L_XTND */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToSeekFlags (short x, short *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef SEEK_SET
+ if (x == SEEK_SET)
+ {*r = Mono_Posix_SeekFlags_SEEK_SET; return 0;}
+#endif /* ndef SEEK_SET */
+#ifdef SEEK_CUR
+ if (x == SEEK_CUR)
+ {*r = Mono_Posix_SeekFlags_SEEK_CUR; return 0;}
+#endif /* ndef SEEK_CUR */
+#ifdef SEEK_END
+ if (x == SEEK_END)
+ {*r = Mono_Posix_SeekFlags_SEEK_END; return 0;}
+#endif /* ndef SEEK_END */
+#ifdef L_SET
+ if (x == L_SET)
+ {*r = Mono_Posix_SeekFlags_L_SET; return 0;}
+#endif /* ndef L_SET */
+#ifdef L_INCR
+ if (x == L_INCR)
+ {*r = Mono_Posix_SeekFlags_L_INCR; return 0;}
+#endif /* ndef L_INCR */
+#ifdef L_XTND
+ if (x == L_XTND)
+ {*r = Mono_Posix_SeekFlags_L_XTND; return 0;}
+#endif /* ndef L_XTND */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromDirectoryNotifyFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_DirectoryNotifyFlags_DN_ACCESS) == Mono_Posix_DirectoryNotifyFlags_DN_ACCESS)
+#ifdef DN_ACCESS
+ *r |= DN_ACCESS;
+#else /* def DN_ACCESS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DN_ACCESS */
+ if ((x & Mono_Posix_DirectoryNotifyFlags_DN_MODIFY) == Mono_Posix_DirectoryNotifyFlags_DN_MODIFY)
+#ifdef DN_MODIFY
+ *r |= DN_MODIFY;
+#else /* def DN_MODIFY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DN_MODIFY */
+ if ((x & Mono_Posix_DirectoryNotifyFlags_DN_CREATE) == Mono_Posix_DirectoryNotifyFlags_DN_CREATE)
+#ifdef DN_CREATE
+ *r |= DN_CREATE;
+#else /* def DN_CREATE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DN_CREATE */
+ if ((x & Mono_Posix_DirectoryNotifyFlags_DN_DELETE) == Mono_Posix_DirectoryNotifyFlags_DN_DELETE)
+#ifdef DN_DELETE
+ *r |= DN_DELETE;
+#else /* def DN_DELETE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DN_DELETE */
+ if ((x & Mono_Posix_DirectoryNotifyFlags_DN_RENAME) == Mono_Posix_DirectoryNotifyFlags_DN_RENAME)
+#ifdef DN_RENAME
+ *r |= DN_RENAME;
+#else /* def DN_RENAME */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DN_RENAME */
+ if ((x & Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB) == Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB)
+#ifdef DN_ATTRIB
+ *r |= DN_ATTRIB;
+#else /* def DN_ATTRIB */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DN_ATTRIB */
+ if ((x & Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT) == Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT)
+#ifdef DN_MULTISHOT
+ *r |= DN_MULTISHOT;
+#else /* def DN_MULTISHOT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef DN_MULTISHOT */
+ return 0;
+}
+
+int Mono_Posix_ToDirectoryNotifyFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef DN_ACCESS
+ if ((x & DN_ACCESS) == DN_ACCESS)
+ *r |= Mono_Posix_DirectoryNotifyFlags_DN_ACCESS;
+#endif /* ndef DN_ACCESS */
+#ifdef DN_MODIFY
+ if ((x & DN_MODIFY) == DN_MODIFY)
+ *r |= Mono_Posix_DirectoryNotifyFlags_DN_MODIFY;
+#endif /* ndef DN_MODIFY */
+#ifdef DN_CREATE
+ if ((x & DN_CREATE) == DN_CREATE)
+ *r |= Mono_Posix_DirectoryNotifyFlags_DN_CREATE;
+#endif /* ndef DN_CREATE */
+#ifdef DN_DELETE
+ if ((x & DN_DELETE) == DN_DELETE)
+ *r |= Mono_Posix_DirectoryNotifyFlags_DN_DELETE;
+#endif /* ndef DN_DELETE */
+#ifdef DN_RENAME
+ if ((x & DN_RENAME) == DN_RENAME)
+ *r |= Mono_Posix_DirectoryNotifyFlags_DN_RENAME;
+#endif /* ndef DN_RENAME */
+#ifdef DN_ATTRIB
+ if ((x & DN_ATTRIB) == DN_ATTRIB)
+ *r |= Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB;
+#endif /* ndef DN_ATTRIB */
+#ifdef DN_MULTISHOT
+ if ((x & DN_MULTISHOT) == DN_MULTISHOT)
+ *r |= Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT;
+#endif /* ndef DN_MULTISHOT */
+ return 0;
+}
+
+int Mono_Posix_FromPosixFadviseAdvice (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NORMAL)
+#ifdef POSIX_FADV_NORMAL
+ {*r = POSIX_FADV_NORMAL; return 0;}
+#else /* def POSIX_FADV_NORMAL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_FADV_NORMAL */
+ if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_RANDOM)
+#ifdef POSIX_FADV_RANDOM
+ {*r = POSIX_FADV_RANDOM; return 0;}
+#else /* def POSIX_FADV_RANDOM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_FADV_RANDOM */
+ if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_SEQUENTIAL)
+#ifdef POSIX_FADV_SEQUENTIAL
+ {*r = POSIX_FADV_SEQUENTIAL; return 0;}
+#else /* def POSIX_FADV_SEQUENTIAL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_FADV_SEQUENTIAL */
+ if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_WILLNEED)
+#ifdef POSIX_FADV_WILLNEED
+ {*r = POSIX_FADV_WILLNEED; return 0;}
+#else /* def POSIX_FADV_WILLNEED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_FADV_WILLNEED */
+ if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_DONTNEED)
+#ifdef POSIX_FADV_DONTNEED
+ {*r = POSIX_FADV_DONTNEED; return 0;}
+#else /* def POSIX_FADV_DONTNEED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_FADV_DONTNEED */
+ if (x == Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NOREUSE)
+#ifdef POSIX_FADV_NOREUSE
+ {*r = POSIX_FADV_NOREUSE; return 0;}
+#else /* def POSIX_FADV_NOREUSE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_FADV_NOREUSE */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToPosixFadviseAdvice (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef POSIX_FADV_NORMAL
+ if (x == POSIX_FADV_NORMAL)
+ {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NORMAL; return 0;}
+#endif /* ndef POSIX_FADV_NORMAL */
+#ifdef POSIX_FADV_RANDOM
+ if (x == POSIX_FADV_RANDOM)
+ {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_RANDOM; return 0;}
+#endif /* ndef POSIX_FADV_RANDOM */
+#ifdef POSIX_FADV_SEQUENTIAL
+ if (x == POSIX_FADV_SEQUENTIAL)
+ {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_SEQUENTIAL; return 0;}
+#endif /* ndef POSIX_FADV_SEQUENTIAL */
+#ifdef POSIX_FADV_WILLNEED
+ if (x == POSIX_FADV_WILLNEED)
+ {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_WILLNEED; return 0;}
+#endif /* ndef POSIX_FADV_WILLNEED */
+#ifdef POSIX_FADV_DONTNEED
+ if (x == POSIX_FADV_DONTNEED)
+ {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_DONTNEED; return 0;}
+#endif /* ndef POSIX_FADV_DONTNEED */
+#ifdef POSIX_FADV_NOREUSE
+ if (x == POSIX_FADV_NOREUSE)
+ {*r = Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NOREUSE; return 0;}
+#endif /* ndef POSIX_FADV_NOREUSE */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromPosixMadviseAdvice (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_NORMAL)
+#ifdef POSIX_MADV_NORMAL
+ {*r = POSIX_MADV_NORMAL; return 0;}
+#else /* def POSIX_MADV_NORMAL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_MADV_NORMAL */
+ if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_RANDOM)
+#ifdef POSIX_MADV_RANDOM
+ {*r = POSIX_MADV_RANDOM; return 0;}
+#else /* def POSIX_MADV_RANDOM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_MADV_RANDOM */
+ if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_SEQUENTIAL)
+#ifdef POSIX_MADV_SEQUENTIAL
+ {*r = POSIX_MADV_SEQUENTIAL; return 0;}
+#else /* def POSIX_MADV_SEQUENTIAL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_MADV_SEQUENTIAL */
+ if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_WILLNEED)
+#ifdef POSIX_MADV_WILLNEED
+ {*r = POSIX_MADV_WILLNEED; return 0;}
+#else /* def POSIX_MADV_WILLNEED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_MADV_WILLNEED */
+ if (x == Mono_Posix_PosixMadviseAdvice_POSIX_MADV_DONTNEED)
+#ifdef POSIX_MADV_DONTNEED
+ {*r = POSIX_MADV_DONTNEED; return 0;}
+#else /* def POSIX_MADV_DONTNEED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POSIX_MADV_DONTNEED */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToPosixMadviseAdvice (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef POSIX_MADV_NORMAL
+ if (x == POSIX_MADV_NORMAL)
+ {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_NORMAL; return 0;}
+#endif /* ndef POSIX_MADV_NORMAL */
+#ifdef POSIX_MADV_RANDOM
+ if (x == POSIX_MADV_RANDOM)
+ {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_RANDOM; return 0;}
+#endif /* ndef POSIX_MADV_RANDOM */
+#ifdef POSIX_MADV_SEQUENTIAL
+ if (x == POSIX_MADV_SEQUENTIAL)
+ {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_SEQUENTIAL; return 0;}
+#endif /* ndef POSIX_MADV_SEQUENTIAL */
+#ifdef POSIX_MADV_WILLNEED
+ if (x == POSIX_MADV_WILLNEED)
+ {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_WILLNEED; return 0;}
+#endif /* ndef POSIX_MADV_WILLNEED */
+#ifdef POSIX_MADV_DONTNEED
+ if (x == POSIX_MADV_DONTNEED)
+ {*r = Mono_Posix_PosixMadviseAdvice_POSIX_MADV_DONTNEED; return 0;}
+#endif /* ndef POSIX_MADV_DONTNEED */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromSignum (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_Signum_SIGHUP)
+#ifdef SIGHUP
+ {*r = SIGHUP; return 0;}
+#else /* def SIGHUP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGHUP */
+ if (x == Mono_Posix_Signum_SIGINT)
+#ifdef SIGINT
+ {*r = SIGINT; return 0;}
+#else /* def SIGINT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGINT */
+ if (x == Mono_Posix_Signum_SIGQUIT)
+#ifdef SIGQUIT
+ {*r = SIGQUIT; return 0;}
+#else /* def SIGQUIT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGQUIT */
+ if (x == Mono_Posix_Signum_SIGILL)
+#ifdef SIGILL
+ {*r = SIGILL; return 0;}
+#else /* def SIGILL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGILL */
+ if (x == Mono_Posix_Signum_SIGTRAP)
+#ifdef SIGTRAP
+ {*r = SIGTRAP; return 0;}
+#else /* def SIGTRAP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGTRAP */
+ if (x == Mono_Posix_Signum_SIGABRT)
+#ifdef SIGABRT
+ {*r = SIGABRT; return 0;}
+#else /* def SIGABRT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGABRT */
+ if (x == Mono_Posix_Signum_SIGIOT)
+#ifdef SIGIOT
+ {*r = SIGIOT; return 0;}
+#else /* def SIGIOT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGIOT */
+ if (x == Mono_Posix_Signum_SIGBUS)
+#ifdef SIGBUS
+ {*r = SIGBUS; return 0;}
+#else /* def SIGBUS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGBUS */
+ if (x == Mono_Posix_Signum_SIGFPE)
+#ifdef SIGFPE
+ {*r = SIGFPE; return 0;}
+#else /* def SIGFPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGFPE */
+ if (x == Mono_Posix_Signum_SIGKILL)
+#ifdef SIGKILL
+ {*r = SIGKILL; return 0;}
+#else /* def SIGKILL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGKILL */
+ if (x == Mono_Posix_Signum_SIGUSR1)
+#ifdef SIGUSR1
+ {*r = SIGUSR1; return 0;}
+#else /* def SIGUSR1 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGUSR1 */
+ if (x == Mono_Posix_Signum_SIGSEGV)
+#ifdef SIGSEGV
+ {*r = SIGSEGV; return 0;}
+#else /* def SIGSEGV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGSEGV */
+ if (x == Mono_Posix_Signum_SIGUSR2)
+#ifdef SIGUSR2
+ {*r = SIGUSR2; return 0;}
+#else /* def SIGUSR2 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGUSR2 */
+ if (x == Mono_Posix_Signum_SIGPIPE)
+#ifdef SIGPIPE
+ {*r = SIGPIPE; return 0;}
+#else /* def SIGPIPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGPIPE */
+ if (x == Mono_Posix_Signum_SIGALRM)
+#ifdef SIGALRM
+ {*r = SIGALRM; return 0;}
+#else /* def SIGALRM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGALRM */
+ if (x == Mono_Posix_Signum_SIGTERM)
+#ifdef SIGTERM
+ {*r = SIGTERM; return 0;}
+#else /* def SIGTERM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGTERM */
+ if (x == Mono_Posix_Signum_SIGSTKFLT)
+#ifdef SIGSTKFLT
+ {*r = SIGSTKFLT; return 0;}
+#else /* def SIGSTKFLT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGSTKFLT */
+ if (x == Mono_Posix_Signum_SIGCHLD)
+#ifdef SIGCHLD
+ {*r = SIGCHLD; return 0;}
+#else /* def SIGCHLD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGCHLD */
+ if (x == Mono_Posix_Signum_SIGCLD)
+#ifdef SIGCLD
+ {*r = SIGCLD; return 0;}
+#else /* def SIGCLD */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGCLD */
+ if (x == Mono_Posix_Signum_SIGCONT)
+#ifdef SIGCONT
+ {*r = SIGCONT; return 0;}
+#else /* def SIGCONT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGCONT */
+ if (x == Mono_Posix_Signum_SIGSTOP)
+#ifdef SIGSTOP
+ {*r = SIGSTOP; return 0;}
+#else /* def SIGSTOP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGSTOP */
+ if (x == Mono_Posix_Signum_SIGTSTP)
+#ifdef SIGTSTP
+ {*r = SIGTSTP; return 0;}
+#else /* def SIGTSTP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGTSTP */
+ if (x == Mono_Posix_Signum_SIGTTIN)
+#ifdef SIGTTIN
+ {*r = SIGTTIN; return 0;}
+#else /* def SIGTTIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGTTIN */
+ if (x == Mono_Posix_Signum_SIGTTOU)
+#ifdef SIGTTOU
+ {*r = SIGTTOU; return 0;}
+#else /* def SIGTTOU */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGTTOU */
+ if (x == Mono_Posix_Signum_SIGURG)
+#ifdef SIGURG
+ {*r = SIGURG; return 0;}
+#else /* def SIGURG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGURG */
+ if (x == Mono_Posix_Signum_SIGXCPU)
+#ifdef SIGXCPU
+ {*r = SIGXCPU; return 0;}
+#else /* def SIGXCPU */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGXCPU */
+ if (x == Mono_Posix_Signum_SIGXFSZ)
+#ifdef SIGXFSZ
+ {*r = SIGXFSZ; return 0;}
+#else /* def SIGXFSZ */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGXFSZ */
+ if (x == Mono_Posix_Signum_SIGVTALRM)
+#ifdef SIGVTALRM
+ {*r = SIGVTALRM; return 0;}
+#else /* def SIGVTALRM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGVTALRM */
+ if (x == Mono_Posix_Signum_SIGPROF)
+#ifdef SIGPROF
+ {*r = SIGPROF; return 0;}
+#else /* def SIGPROF */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGPROF */
+ if (x == Mono_Posix_Signum_SIGWINCH)
+#ifdef SIGWINCH
+ {*r = SIGWINCH; return 0;}
+#else /* def SIGWINCH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGWINCH */
+ if (x == Mono_Posix_Signum_SIGIO)
+#ifdef SIGIO
+ {*r = SIGIO; return 0;}
+#else /* def SIGIO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGIO */
+ if (x == Mono_Posix_Signum_SIGPOLL)
+#ifdef SIGPOLL
+ {*r = SIGPOLL; return 0;}
+#else /* def SIGPOLL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGPOLL */
+ if (x == Mono_Posix_Signum_SIGPWR)
+#ifdef SIGPWR
+ {*r = SIGPWR; return 0;}
+#else /* def SIGPWR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGPWR */
+ if (x == Mono_Posix_Signum_SIGSYS)
+#ifdef SIGSYS
+ {*r = SIGSYS; return 0;}
+#else /* def SIGSYS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGSYS */
+ if (x == Mono_Posix_Signum_SIGUNUSED)
+#ifdef SIGUNUSED
+ {*r = SIGUNUSED; return 0;}
+#else /* def SIGUNUSED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef SIGUNUSED */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToSignum (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef SIGHUP
+ if (x == SIGHUP)
+ {*r = Mono_Posix_Signum_SIGHUP; return 0;}
+#endif /* ndef SIGHUP */
+#ifdef SIGINT
+ if (x == SIGINT)
+ {*r = Mono_Posix_Signum_SIGINT; return 0;}
+#endif /* ndef SIGINT */
+#ifdef SIGQUIT
+ if (x == SIGQUIT)
+ {*r = Mono_Posix_Signum_SIGQUIT; return 0;}
+#endif /* ndef SIGQUIT */
+#ifdef SIGILL
+ if (x == SIGILL)
+ {*r = Mono_Posix_Signum_SIGILL; return 0;}
+#endif /* ndef SIGILL */
+#ifdef SIGTRAP
+ if (x == SIGTRAP)
+ {*r = Mono_Posix_Signum_SIGTRAP; return 0;}
+#endif /* ndef SIGTRAP */
+#ifdef SIGABRT
+ if (x == SIGABRT)
+ {*r = Mono_Posix_Signum_SIGABRT; return 0;}
+#endif /* ndef SIGABRT */
+#ifdef SIGIOT
+ if (x == SIGIOT)
+ {*r = Mono_Posix_Signum_SIGIOT; return 0;}
+#endif /* ndef SIGIOT */
+#ifdef SIGBUS
+ if (x == SIGBUS)
+ {*r = Mono_Posix_Signum_SIGBUS; return 0;}
+#endif /* ndef SIGBUS */
+#ifdef SIGFPE
+ if (x == SIGFPE)
+ {*r = Mono_Posix_Signum_SIGFPE; return 0;}
+#endif /* ndef SIGFPE */
+#ifdef SIGKILL
+ if (x == SIGKILL)
+ {*r = Mono_Posix_Signum_SIGKILL; return 0;}
+#endif /* ndef SIGKILL */
+#ifdef SIGUSR1
+ if (x == SIGUSR1)
+ {*r = Mono_Posix_Signum_SIGUSR1; return 0;}
+#endif /* ndef SIGUSR1 */
+#ifdef SIGSEGV
+ if (x == SIGSEGV)
+ {*r = Mono_Posix_Signum_SIGSEGV; return 0;}
+#endif /* ndef SIGSEGV */
+#ifdef SIGUSR2
+ if (x == SIGUSR2)
+ {*r = Mono_Posix_Signum_SIGUSR2; return 0;}
+#endif /* ndef SIGUSR2 */
+#ifdef SIGPIPE
+ if (x == SIGPIPE)
+ {*r = Mono_Posix_Signum_SIGPIPE; return 0;}
+#endif /* ndef SIGPIPE */
+#ifdef SIGALRM
+ if (x == SIGALRM)
+ {*r = Mono_Posix_Signum_SIGALRM; return 0;}
+#endif /* ndef SIGALRM */
+#ifdef SIGTERM
+ if (x == SIGTERM)
+ {*r = Mono_Posix_Signum_SIGTERM; return 0;}
+#endif /* ndef SIGTERM */
+#ifdef SIGSTKFLT
+ if (x == SIGSTKFLT)
+ {*r = Mono_Posix_Signum_SIGSTKFLT; return 0;}
+#endif /* ndef SIGSTKFLT */
+#ifdef SIGCHLD
+ if (x == SIGCHLD)
+ {*r = Mono_Posix_Signum_SIGCHLD; return 0;}
+#endif /* ndef SIGCHLD */
+#ifdef SIGCLD
+ if (x == SIGCLD)
+ {*r = Mono_Posix_Signum_SIGCLD; return 0;}
+#endif /* ndef SIGCLD */
+#ifdef SIGCONT
+ if (x == SIGCONT)
+ {*r = Mono_Posix_Signum_SIGCONT; return 0;}
+#endif /* ndef SIGCONT */
+#ifdef SIGSTOP
+ if (x == SIGSTOP)
+ {*r = Mono_Posix_Signum_SIGSTOP; return 0;}
+#endif /* ndef SIGSTOP */
+#ifdef SIGTSTP
+ if (x == SIGTSTP)
+ {*r = Mono_Posix_Signum_SIGTSTP; return 0;}
+#endif /* ndef SIGTSTP */
+#ifdef SIGTTIN
+ if (x == SIGTTIN)
+ {*r = Mono_Posix_Signum_SIGTTIN; return 0;}
+#endif /* ndef SIGTTIN */
+#ifdef SIGTTOU
+ if (x == SIGTTOU)
+ {*r = Mono_Posix_Signum_SIGTTOU; return 0;}
+#endif /* ndef SIGTTOU */
+#ifdef SIGURG
+ if (x == SIGURG)
+ {*r = Mono_Posix_Signum_SIGURG; return 0;}
+#endif /* ndef SIGURG */
+#ifdef SIGXCPU
+ if (x == SIGXCPU)
+ {*r = Mono_Posix_Signum_SIGXCPU; return 0;}
+#endif /* ndef SIGXCPU */
+#ifdef SIGXFSZ
+ if (x == SIGXFSZ)
+ {*r = Mono_Posix_Signum_SIGXFSZ; return 0;}
+#endif /* ndef SIGXFSZ */
+#ifdef SIGVTALRM
+ if (x == SIGVTALRM)
+ {*r = Mono_Posix_Signum_SIGVTALRM; return 0;}
+#endif /* ndef SIGVTALRM */
+#ifdef SIGPROF
+ if (x == SIGPROF)
+ {*r = Mono_Posix_Signum_SIGPROF; return 0;}
+#endif /* ndef SIGPROF */
+#ifdef SIGWINCH
+ if (x == SIGWINCH)
+ {*r = Mono_Posix_Signum_SIGWINCH; return 0;}
+#endif /* ndef SIGWINCH */
+#ifdef SIGIO
+ if (x == SIGIO)
+ {*r = Mono_Posix_Signum_SIGIO; return 0;}
+#endif /* ndef SIGIO */
+#ifdef SIGPOLL
+ if (x == SIGPOLL)
+ {*r = Mono_Posix_Signum_SIGPOLL; return 0;}
+#endif /* ndef SIGPOLL */
+#ifdef SIGPWR
+ if (x == SIGPWR)
+ {*r = Mono_Posix_Signum_SIGPWR; return 0;}
+#endif /* ndef SIGPWR */
+#ifdef SIGSYS
+ if (x == SIGSYS)
+ {*r = Mono_Posix_Signum_SIGSYS; return 0;}
+#endif /* ndef SIGSYS */
+#ifdef SIGUNUSED
+ if (x == SIGUNUSED)
+ {*r = Mono_Posix_Signum_SIGUNUSED; return 0;}
+#endif /* ndef SIGUNUSED */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromMountFlags (guint64 x, guint64 *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_MountFlags_MS_RDONLY) == Mono_Posix_MountFlags_MS_RDONLY)
+#ifdef MS_RDONLY
+ *r |= MS_RDONLY;
+#else /* def MS_RDONLY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_RDONLY */
+ if ((x & Mono_Posix_MountFlags_MS_NOSUID) == Mono_Posix_MountFlags_MS_NOSUID)
+#ifdef MS_NOSUID
+ *r |= MS_NOSUID;
+#else /* def MS_NOSUID */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_NOSUID */
+ if ((x & Mono_Posix_MountFlags_MS_NODEV) == Mono_Posix_MountFlags_MS_NODEV)
+#ifdef MS_NODEV
+ *r |= MS_NODEV;
+#else /* def MS_NODEV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_NODEV */
+ if ((x & Mono_Posix_MountFlags_MS_NOEXEC) == Mono_Posix_MountFlags_MS_NOEXEC)
+#ifdef MS_NOEXEC
+ *r |= MS_NOEXEC;
+#else /* def MS_NOEXEC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_NOEXEC */
+ if ((x & Mono_Posix_MountFlags_MS_SYNCHRONOUS) == Mono_Posix_MountFlags_MS_SYNCHRONOUS)
+#ifdef MS_SYNCHRONOUS
+ *r |= MS_SYNCHRONOUS;
+#else /* def MS_SYNCHRONOUS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_SYNCHRONOUS */
+ if ((x & Mono_Posix_MountFlags_MS_REMOUNT) == Mono_Posix_MountFlags_MS_REMOUNT)
+#ifdef MS_REMOUNT
+ *r |= MS_REMOUNT;
+#else /* def MS_REMOUNT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_REMOUNT */
+ if ((x & Mono_Posix_MountFlags_MS_MANDLOCK) == Mono_Posix_MountFlags_MS_MANDLOCK)
+#ifdef MS_MANDLOCK
+ *r |= MS_MANDLOCK;
+#else /* def MS_MANDLOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_MANDLOCK */
+ if ((x & Mono_Posix_MountFlags_S_WRITE) == Mono_Posix_MountFlags_S_WRITE)
+#ifdef S_WRITE
+ *r |= S_WRITE;
+#else /* def S_WRITE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_WRITE */
+ if ((x & Mono_Posix_MountFlags_S_APPEND) == Mono_Posix_MountFlags_S_APPEND)
+#ifdef S_APPEND
+ *r |= S_APPEND;
+#else /* def S_APPEND */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_APPEND */
+ if ((x & Mono_Posix_MountFlags_S_IMMUTABLE) == Mono_Posix_MountFlags_S_IMMUTABLE)
+#ifdef S_IMMUTABLE
+ *r |= S_IMMUTABLE;
+#else /* def S_IMMUTABLE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef S_IMMUTABLE */
+ if ((x & Mono_Posix_MountFlags_MS_NOATIME) == Mono_Posix_MountFlags_MS_NOATIME)
+#ifdef MS_NOATIME
+ *r |= MS_NOATIME;
+#else /* def MS_NOATIME */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_NOATIME */
+ if ((x & Mono_Posix_MountFlags_MS_NODIRATIME) == Mono_Posix_MountFlags_MS_NODIRATIME)
+#ifdef MS_NODIRATIME
+ *r |= MS_NODIRATIME;
+#else /* def MS_NODIRATIME */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_NODIRATIME */
+ if ((x & Mono_Posix_MountFlags_MS_BIND) == Mono_Posix_MountFlags_MS_BIND)
+#ifdef MS_BIND
+ *r |= MS_BIND;
+#else /* def MS_BIND */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_BIND */
+ if ((x & Mono_Posix_MountFlags_MS_RMT_MASK) == Mono_Posix_MountFlags_MS_RMT_MASK)
+#ifdef MS_RMT_MASK
+ *r |= MS_RMT_MASK;
+#else /* def MS_RMT_MASK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_RMT_MASK */
+ if ((x & Mono_Posix_MountFlags_MS_MGC_VAL) == Mono_Posix_MountFlags_MS_MGC_VAL)
+#ifdef MS_MGC_VAL
+ *r |= MS_MGC_VAL;
+#else /* def MS_MGC_VAL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_MGC_VAL */
+ if ((x & Mono_Posix_MountFlags_MS_MGC_MSK) == Mono_Posix_MountFlags_MS_MGC_MSK)
+#ifdef MS_MGC_MSK
+ *r |= MS_MGC_MSK;
+#else /* def MS_MGC_MSK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MS_MGC_MSK */
+ return 0;
+}
+
+int Mono_Posix_ToMountFlags (guint64 x, guint64 *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef MS_RDONLY
+ if ((x & MS_RDONLY) == MS_RDONLY)
+ *r |= Mono_Posix_MountFlags_MS_RDONLY;
+#endif /* ndef MS_RDONLY */
+#ifdef MS_NOSUID
+ if ((x & MS_NOSUID) == MS_NOSUID)
+ *r |= Mono_Posix_MountFlags_MS_NOSUID;
+#endif /* ndef MS_NOSUID */
+#ifdef MS_NODEV
+ if ((x & MS_NODEV) == MS_NODEV)
+ *r |= Mono_Posix_MountFlags_MS_NODEV;
+#endif /* ndef MS_NODEV */
+#ifdef MS_NOEXEC
+ if ((x & MS_NOEXEC) == MS_NOEXEC)
+ *r |= Mono_Posix_MountFlags_MS_NOEXEC;
+#endif /* ndef MS_NOEXEC */
+#ifdef MS_SYNCHRONOUS
+ if ((x & MS_SYNCHRONOUS) == MS_SYNCHRONOUS)
+ *r |= Mono_Posix_MountFlags_MS_SYNCHRONOUS;
+#endif /* ndef MS_SYNCHRONOUS */
+#ifdef MS_REMOUNT
+ if ((x & MS_REMOUNT) == MS_REMOUNT)
+ *r |= Mono_Posix_MountFlags_MS_REMOUNT;
+#endif /* ndef MS_REMOUNT */
+#ifdef MS_MANDLOCK
+ if ((x & MS_MANDLOCK) == MS_MANDLOCK)
+ *r |= Mono_Posix_MountFlags_MS_MANDLOCK;
+#endif /* ndef MS_MANDLOCK */
+#ifdef S_WRITE
+ if ((x & S_WRITE) == S_WRITE)
+ *r |= Mono_Posix_MountFlags_S_WRITE;
+#endif /* ndef S_WRITE */
+#ifdef S_APPEND
+ if ((x & S_APPEND) == S_APPEND)
+ *r |= Mono_Posix_MountFlags_S_APPEND;
+#endif /* ndef S_APPEND */
+#ifdef S_IMMUTABLE
+ if ((x & S_IMMUTABLE) == S_IMMUTABLE)
+ *r |= Mono_Posix_MountFlags_S_IMMUTABLE;
+#endif /* ndef S_IMMUTABLE */
+#ifdef MS_NOATIME
+ if ((x & MS_NOATIME) == MS_NOATIME)
+ *r |= Mono_Posix_MountFlags_MS_NOATIME;
+#endif /* ndef MS_NOATIME */
+#ifdef MS_NODIRATIME
+ if ((x & MS_NODIRATIME) == MS_NODIRATIME)
+ *r |= Mono_Posix_MountFlags_MS_NODIRATIME;
+#endif /* ndef MS_NODIRATIME */
+#ifdef MS_BIND
+ if ((x & MS_BIND) == MS_BIND)
+ *r |= Mono_Posix_MountFlags_MS_BIND;
+#endif /* ndef MS_BIND */
+#ifdef MS_RMT_MASK
+ if ((x & MS_RMT_MASK) == MS_RMT_MASK)
+ *r |= Mono_Posix_MountFlags_MS_RMT_MASK;
+#endif /* ndef MS_RMT_MASK */
+#ifdef MS_MGC_VAL
+ if ((x & MS_MGC_VAL) == MS_MGC_VAL)
+ *r |= Mono_Posix_MountFlags_MS_MGC_VAL;
+#endif /* ndef MS_MGC_VAL */
+#ifdef MS_MGC_MSK
+ if ((x & MS_MGC_MSK) == MS_MGC_MSK)
+ *r |= Mono_Posix_MountFlags_MS_MGC_MSK;
+#endif /* ndef MS_MGC_MSK */
+ return 0;
+}
+
+int Mono_Posix_FromUmountFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_UmountFlags_MNT_FORCE) == Mono_Posix_UmountFlags_MNT_FORCE)
+#ifdef MNT_FORCE
+ *r |= MNT_FORCE;
+#else /* def MNT_FORCE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MNT_FORCE */
+ if ((x & Mono_Posix_UmountFlags_MNT_DETACH) == Mono_Posix_UmountFlags_MNT_DETACH)
+#ifdef MNT_DETACH
+ *r |= MNT_DETACH;
+#else /* def MNT_DETACH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef MNT_DETACH */
+ return 0;
+}
+
+int Mono_Posix_ToUmountFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef MNT_FORCE
+ if ((x & MNT_FORCE) == MNT_FORCE)
+ *r |= Mono_Posix_UmountFlags_MNT_FORCE;
+#endif /* ndef MNT_FORCE */
+#ifdef MNT_DETACH
+ if ((x & MNT_DETACH) == MNT_DETACH)
+ *r |= Mono_Posix_UmountFlags_MNT_DETACH;
+#endif /* ndef MNT_DETACH */
+ return 0;
+}
+
+int Mono_Posix_FromWaitOptions (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_WaitOptions_WNOHANG) == Mono_Posix_WaitOptions_WNOHANG)
+#ifdef WNOHANG
+ *r |= WNOHANG;
+#else /* def WNOHANG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef WNOHANG */
+ if ((x & Mono_Posix_WaitOptions_WUNTRACED) == Mono_Posix_WaitOptions_WUNTRACED)
+#ifdef WUNTRACED
+ *r |= WUNTRACED;
+#else /* def WUNTRACED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef WUNTRACED */
+ return 0;
+}
+
+int Mono_Posix_ToWaitOptions (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef WNOHANG
+ if ((x & WNOHANG) == WNOHANG)
+ *r |= Mono_Posix_WaitOptions_WNOHANG;
+#endif /* ndef WNOHANG */
+#ifdef WUNTRACED
+ if ((x & WUNTRACED) == WUNTRACED)
+ *r |= Mono_Posix_WaitOptions_WUNTRACED;
+#endif /* ndef WUNTRACED */
+ return 0;
+}
+
+int Mono_Posix_FromAccessMode (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_AccessMode_R_OK) == Mono_Posix_AccessMode_R_OK)
+#ifdef R_OK
+ *r |= R_OK;
+#else /* def R_OK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef R_OK */
+ if ((x & Mono_Posix_AccessMode_W_OK) == Mono_Posix_AccessMode_W_OK)
+#ifdef W_OK
+ *r |= W_OK;
+#else /* def W_OK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef W_OK */
+ if ((x & Mono_Posix_AccessMode_X_OK) == Mono_Posix_AccessMode_X_OK)
+#ifdef X_OK
+ *r |= X_OK;
+#else /* def X_OK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef X_OK */
+ if ((x & Mono_Posix_AccessMode_F_OK) == Mono_Posix_AccessMode_F_OK)
+#ifdef F_OK
+ *r |= F_OK;
+#else /* def F_OK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_OK */
+ return 0;
+}
+
+int Mono_Posix_ToAccessMode (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef R_OK
+ if ((x & R_OK) == R_OK)
+ *r |= Mono_Posix_AccessMode_R_OK;
+#endif /* ndef R_OK */
+#ifdef W_OK
+ if ((x & W_OK) == W_OK)
+ *r |= Mono_Posix_AccessMode_W_OK;
+#endif /* ndef W_OK */
+#ifdef X_OK
+ if ((x & X_OK) == X_OK)
+ *r |= Mono_Posix_AccessMode_X_OK;
+#endif /* ndef X_OK */
+#ifdef F_OK
+ if ((x & F_OK) == F_OK)
+ *r |= Mono_Posix_AccessMode_F_OK;
+#endif /* ndef F_OK */
+ return 0;
+}
+
+int Mono_Posix_FromPathConf (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_PathConf__PC_LINK_MAX)
+#ifdef _PC_LINK_MAX
+ {*r = _PC_LINK_MAX; return 0;}
+#else /* def _PC_LINK_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_LINK_MAX */
+ if (x == Mono_Posix_PathConf__PC_MAX_CANON)
+#ifdef _PC_MAX_CANON
+ {*r = _PC_MAX_CANON; return 0;}
+#else /* def _PC_MAX_CANON */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_MAX_CANON */
+ if (x == Mono_Posix_PathConf__PC_MAX_INPUT)
+#ifdef _PC_MAX_INPUT
+ {*r = _PC_MAX_INPUT; return 0;}
+#else /* def _PC_MAX_INPUT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_MAX_INPUT */
+ if (x == Mono_Posix_PathConf__PC_NAME_MAX)
+#ifdef _PC_NAME_MAX
+ {*r = _PC_NAME_MAX; return 0;}
+#else /* def _PC_NAME_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_NAME_MAX */
+ if (x == Mono_Posix_PathConf__PC_PATH_MAX)
+#ifdef _PC_PATH_MAX
+ {*r = _PC_PATH_MAX; return 0;}
+#else /* def _PC_PATH_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_PATH_MAX */
+ if (x == Mono_Posix_PathConf__PC_PIPE_BUF)
+#ifdef _PC_PIPE_BUF
+ {*r = _PC_PIPE_BUF; return 0;}
+#else /* def _PC_PIPE_BUF */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_PIPE_BUF */
+ if (x == Mono_Posix_PathConf__PC_CHOWN_RESTRICTED)
+#ifdef _PC_CHOWN_RESTRICTED
+ {*r = _PC_CHOWN_RESTRICTED; return 0;}
+#else /* def _PC_CHOWN_RESTRICTED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_CHOWN_RESTRICTED */
+ if (x == Mono_Posix_PathConf__PC_NO_TRUNC)
+#ifdef _PC_NO_TRUNC
+ {*r = _PC_NO_TRUNC; return 0;}
+#else /* def _PC_NO_TRUNC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_NO_TRUNC */
+ if (x == Mono_Posix_PathConf__PC_VDISABLE)
+#ifdef _PC_VDISABLE
+ {*r = _PC_VDISABLE; return 0;}
+#else /* def _PC_VDISABLE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_VDISABLE */
+ if (x == Mono_Posix_PathConf__PC_SYNC_IO)
+#ifdef _PC_SYNC_IO
+ {*r = _PC_SYNC_IO; return 0;}
+#else /* def _PC_SYNC_IO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_SYNC_IO */
+ if (x == Mono_Posix_PathConf__PC_ASYNC_IO)
+#ifdef _PC_ASYNC_IO
+ {*r = _PC_ASYNC_IO; return 0;}
+#else /* def _PC_ASYNC_IO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_ASYNC_IO */
+ if (x == Mono_Posix_PathConf__PC_PRIO_IO)
+#ifdef _PC_PRIO_IO
+ {*r = _PC_PRIO_IO; return 0;}
+#else /* def _PC_PRIO_IO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_PRIO_IO */
+ if (x == Mono_Posix_PathConf__PC_SOCK_MAXBUF)
+#ifdef _PC_SOCK_MAXBUF
+ {*r = _PC_SOCK_MAXBUF; return 0;}
+#else /* def _PC_SOCK_MAXBUF */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_SOCK_MAXBUF */
+ if (x == Mono_Posix_PathConf__PC_FILESIZEBITS)
+#ifdef _PC_FILESIZEBITS
+ {*r = _PC_FILESIZEBITS; return 0;}
+#else /* def _PC_FILESIZEBITS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_FILESIZEBITS */
+ if (x == Mono_Posix_PathConf__PC_REC_INCR_XFER_SIZE)
+#ifdef _PC_REC_INCR_XFER_SIZE
+ {*r = _PC_REC_INCR_XFER_SIZE; return 0;}
+#else /* def _PC_REC_INCR_XFER_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_REC_INCR_XFER_SIZE */
+ if (x == Mono_Posix_PathConf__PC_REC_MAX_XFER_SIZE)
+#ifdef _PC_REC_MAX_XFER_SIZE
+ {*r = _PC_REC_MAX_XFER_SIZE; return 0;}
+#else /* def _PC_REC_MAX_XFER_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_REC_MAX_XFER_SIZE */
+ if (x == Mono_Posix_PathConf__PC_REC_MIN_XFER_SIZE)
+#ifdef _PC_REC_MIN_XFER_SIZE
+ {*r = _PC_REC_MIN_XFER_SIZE; return 0;}
+#else /* def _PC_REC_MIN_XFER_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_REC_MIN_XFER_SIZE */
+ if (x == Mono_Posix_PathConf__PC_REC_XFER_ALIGN)
+#ifdef _PC_REC_XFER_ALIGN
+ {*r = _PC_REC_XFER_ALIGN; return 0;}
+#else /* def _PC_REC_XFER_ALIGN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_REC_XFER_ALIGN */
+ if (x == Mono_Posix_PathConf__PC_ALLOC_SIZE_MIN)
+#ifdef _PC_ALLOC_SIZE_MIN
+ {*r = _PC_ALLOC_SIZE_MIN; return 0;}
+#else /* def _PC_ALLOC_SIZE_MIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_ALLOC_SIZE_MIN */
+ if (x == Mono_Posix_PathConf__PC_SYMLINK_MAX)
+#ifdef _PC_SYMLINK_MAX
+ {*r = _PC_SYMLINK_MAX; return 0;}
+#else /* def _PC_SYMLINK_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_SYMLINK_MAX */
+ if (x == Mono_Posix_PathConf__PC_2_SYMLINKS)
+#ifdef _PC_2_SYMLINKS
+ {*r = _PC_2_SYMLINKS; return 0;}
+#else /* def _PC_2_SYMLINKS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _PC_2_SYMLINKS */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToPathConf (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef _PC_LINK_MAX
+ if (x == _PC_LINK_MAX)
+ {*r = Mono_Posix_PathConf__PC_LINK_MAX; return 0;}
+#endif /* ndef _PC_LINK_MAX */
+#ifdef _PC_MAX_CANON
+ if (x == _PC_MAX_CANON)
+ {*r = Mono_Posix_PathConf__PC_MAX_CANON; return 0;}
+#endif /* ndef _PC_MAX_CANON */
+#ifdef _PC_MAX_INPUT
+ if (x == _PC_MAX_INPUT)
+ {*r = Mono_Posix_PathConf__PC_MAX_INPUT; return 0;}
+#endif /* ndef _PC_MAX_INPUT */
+#ifdef _PC_NAME_MAX
+ if (x == _PC_NAME_MAX)
+ {*r = Mono_Posix_PathConf__PC_NAME_MAX; return 0;}
+#endif /* ndef _PC_NAME_MAX */
+#ifdef _PC_PATH_MAX
+ if (x == _PC_PATH_MAX)
+ {*r = Mono_Posix_PathConf__PC_PATH_MAX; return 0;}
+#endif /* ndef _PC_PATH_MAX */
+#ifdef _PC_PIPE_BUF
+ if (x == _PC_PIPE_BUF)
+ {*r = Mono_Posix_PathConf__PC_PIPE_BUF; return 0;}
+#endif /* ndef _PC_PIPE_BUF */
+#ifdef _PC_CHOWN_RESTRICTED
+ if (x == _PC_CHOWN_RESTRICTED)
+ {*r = Mono_Posix_PathConf__PC_CHOWN_RESTRICTED; return 0;}
+#endif /* ndef _PC_CHOWN_RESTRICTED */
+#ifdef _PC_NO_TRUNC
+ if (x == _PC_NO_TRUNC)
+ {*r = Mono_Posix_PathConf__PC_NO_TRUNC; return 0;}
+#endif /* ndef _PC_NO_TRUNC */
+#ifdef _PC_VDISABLE
+ if (x == _PC_VDISABLE)
+ {*r = Mono_Posix_PathConf__PC_VDISABLE; return 0;}
+#endif /* ndef _PC_VDISABLE */
+#ifdef _PC_SYNC_IO
+ if (x == _PC_SYNC_IO)
+ {*r = Mono_Posix_PathConf__PC_SYNC_IO; return 0;}
+#endif /* ndef _PC_SYNC_IO */
+#ifdef _PC_ASYNC_IO
+ if (x == _PC_ASYNC_IO)
+ {*r = Mono_Posix_PathConf__PC_ASYNC_IO; return 0;}
+#endif /* ndef _PC_ASYNC_IO */
+#ifdef _PC_PRIO_IO
+ if (x == _PC_PRIO_IO)
+ {*r = Mono_Posix_PathConf__PC_PRIO_IO; return 0;}
+#endif /* ndef _PC_PRIO_IO */
+#ifdef _PC_SOCK_MAXBUF
+ if (x == _PC_SOCK_MAXBUF)
+ {*r = Mono_Posix_PathConf__PC_SOCK_MAXBUF; return 0;}
+#endif /* ndef _PC_SOCK_MAXBUF */
+#ifdef _PC_FILESIZEBITS
+ if (x == _PC_FILESIZEBITS)
+ {*r = Mono_Posix_PathConf__PC_FILESIZEBITS; return 0;}
+#endif /* ndef _PC_FILESIZEBITS */
+#ifdef _PC_REC_INCR_XFER_SIZE
+ if (x == _PC_REC_INCR_XFER_SIZE)
+ {*r = Mono_Posix_PathConf__PC_REC_INCR_XFER_SIZE; return 0;}
+#endif /* ndef _PC_REC_INCR_XFER_SIZE */
+#ifdef _PC_REC_MAX_XFER_SIZE
+ if (x == _PC_REC_MAX_XFER_SIZE)
+ {*r = Mono_Posix_PathConf__PC_REC_MAX_XFER_SIZE; return 0;}
+#endif /* ndef _PC_REC_MAX_XFER_SIZE */
+#ifdef _PC_REC_MIN_XFER_SIZE
+ if (x == _PC_REC_MIN_XFER_SIZE)
+ {*r = Mono_Posix_PathConf__PC_REC_MIN_XFER_SIZE; return 0;}
+#endif /* ndef _PC_REC_MIN_XFER_SIZE */
+#ifdef _PC_REC_XFER_ALIGN
+ if (x == _PC_REC_XFER_ALIGN)
+ {*r = Mono_Posix_PathConf__PC_REC_XFER_ALIGN; return 0;}
+#endif /* ndef _PC_REC_XFER_ALIGN */
+#ifdef _PC_ALLOC_SIZE_MIN
+ if (x == _PC_ALLOC_SIZE_MIN)
+ {*r = Mono_Posix_PathConf__PC_ALLOC_SIZE_MIN; return 0;}
+#endif /* ndef _PC_ALLOC_SIZE_MIN */
+#ifdef _PC_SYMLINK_MAX
+ if (x == _PC_SYMLINK_MAX)
+ {*r = Mono_Posix_PathConf__PC_SYMLINK_MAX; return 0;}
+#endif /* ndef _PC_SYMLINK_MAX */
+#ifdef _PC_2_SYMLINKS
+ if (x == _PC_2_SYMLINKS)
+ {*r = Mono_Posix_PathConf__PC_2_SYMLINKS; return 0;}
+#endif /* ndef _PC_2_SYMLINKS */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromSysConf (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_SysConf__SC_ARG_MAX)
+#ifdef _SC_ARG_MAX
+ {*r = _SC_ARG_MAX; return 0;}
+#else /* def _SC_ARG_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_ARG_MAX */
+ if (x == Mono_Posix_SysConf__SC_CHILD_MAX)
+#ifdef _SC_CHILD_MAX
+ {*r = _SC_CHILD_MAX; return 0;}
+#else /* def _SC_CHILD_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CHILD_MAX */
+ if (x == Mono_Posix_SysConf__SC_CLK_TCK)
+#ifdef _SC_CLK_TCK
+ {*r = _SC_CLK_TCK; return 0;}
+#else /* def _SC_CLK_TCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CLK_TCK */
+ if (x == Mono_Posix_SysConf__SC_NGROUPS_MAX)
+#ifdef _SC_NGROUPS_MAX
+ {*r = _SC_NGROUPS_MAX; return 0;}
+#else /* def _SC_NGROUPS_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NGROUPS_MAX */
+ if (x == Mono_Posix_SysConf__SC_OPEN_MAX)
+#ifdef _SC_OPEN_MAX
+ {*r = _SC_OPEN_MAX; return 0;}
+#else /* def _SC_OPEN_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_OPEN_MAX */
+ if (x == Mono_Posix_SysConf__SC_STREAM_MAX)
+#ifdef _SC_STREAM_MAX
+ {*r = _SC_STREAM_MAX; return 0;}
+#else /* def _SC_STREAM_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_STREAM_MAX */
+ if (x == Mono_Posix_SysConf__SC_TZNAME_MAX)
+#ifdef _SC_TZNAME_MAX
+ {*r = _SC_TZNAME_MAX; return 0;}
+#else /* def _SC_TZNAME_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TZNAME_MAX */
+ if (x == Mono_Posix_SysConf__SC_JOB_CONTROL)
+#ifdef _SC_JOB_CONTROL
+ {*r = _SC_JOB_CONTROL; return 0;}
+#else /* def _SC_JOB_CONTROL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_JOB_CONTROL */
+ if (x == Mono_Posix_SysConf__SC_SAVED_IDS)
+#ifdef _SC_SAVED_IDS
+ {*r = _SC_SAVED_IDS; return 0;}
+#else /* def _SC_SAVED_IDS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SAVED_IDS */
+ if (x == Mono_Posix_SysConf__SC_REALTIME_SIGNALS)
+#ifdef _SC_REALTIME_SIGNALS
+ {*r = _SC_REALTIME_SIGNALS; return 0;}
+#else /* def _SC_REALTIME_SIGNALS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_REALTIME_SIGNALS */
+ if (x == Mono_Posix_SysConf__SC_PRIORITY_SCHEDULING)
+#ifdef _SC_PRIORITY_SCHEDULING
+ {*r = _SC_PRIORITY_SCHEDULING; return 0;}
+#else /* def _SC_PRIORITY_SCHEDULING */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PRIORITY_SCHEDULING */
+ if (x == Mono_Posix_SysConf__SC_TIMERS)
+#ifdef _SC_TIMERS
+ {*r = _SC_TIMERS; return 0;}
+#else /* def _SC_TIMERS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TIMERS */
+ if (x == Mono_Posix_SysConf__SC_ASYNCHRONOUS_IO)
+#ifdef _SC_ASYNCHRONOUS_IO
+ {*r = _SC_ASYNCHRONOUS_IO; return 0;}
+#else /* def _SC_ASYNCHRONOUS_IO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_ASYNCHRONOUS_IO */
+ if (x == Mono_Posix_SysConf__SC_PRIORITIZED_IO)
+#ifdef _SC_PRIORITIZED_IO
+ {*r = _SC_PRIORITIZED_IO; return 0;}
+#else /* def _SC_PRIORITIZED_IO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PRIORITIZED_IO */
+ if (x == Mono_Posix_SysConf__SC_SYNCHRONIZED_IO)
+#ifdef _SC_SYNCHRONIZED_IO
+ {*r = _SC_SYNCHRONIZED_IO; return 0;}
+#else /* def _SC_SYNCHRONIZED_IO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SYNCHRONIZED_IO */
+ if (x == Mono_Posix_SysConf__SC_FSYNC)
+#ifdef _SC_FSYNC
+ {*r = _SC_FSYNC; return 0;}
+#else /* def _SC_FSYNC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_FSYNC */
+ if (x == Mono_Posix_SysConf__SC_MAPPED_FILES)
+#ifdef _SC_MAPPED_FILES
+ {*r = _SC_MAPPED_FILES; return 0;}
+#else /* def _SC_MAPPED_FILES */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MAPPED_FILES */
+ if (x == Mono_Posix_SysConf__SC_MEMLOCK)
+#ifdef _SC_MEMLOCK
+ {*r = _SC_MEMLOCK; return 0;}
+#else /* def _SC_MEMLOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MEMLOCK */
+ if (x == Mono_Posix_SysConf__SC_MEMLOCK_RANGE)
+#ifdef _SC_MEMLOCK_RANGE
+ {*r = _SC_MEMLOCK_RANGE; return 0;}
+#else /* def _SC_MEMLOCK_RANGE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MEMLOCK_RANGE */
+ if (x == Mono_Posix_SysConf__SC_MEMORY_PROTECTION)
+#ifdef _SC_MEMORY_PROTECTION
+ {*r = _SC_MEMORY_PROTECTION; return 0;}
+#else /* def _SC_MEMORY_PROTECTION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MEMORY_PROTECTION */
+ if (x == Mono_Posix_SysConf__SC_MESSAGE_PASSING)
+#ifdef _SC_MESSAGE_PASSING
+ {*r = _SC_MESSAGE_PASSING; return 0;}
+#else /* def _SC_MESSAGE_PASSING */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MESSAGE_PASSING */
+ if (x == Mono_Posix_SysConf__SC_SEMAPHORES)
+#ifdef _SC_SEMAPHORES
+ {*r = _SC_SEMAPHORES; return 0;}
+#else /* def _SC_SEMAPHORES */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SEMAPHORES */
+ if (x == Mono_Posix_SysConf__SC_SHARED_MEMORY_OBJECTS)
+#ifdef _SC_SHARED_MEMORY_OBJECTS
+ {*r = _SC_SHARED_MEMORY_OBJECTS; return 0;}
+#else /* def _SC_SHARED_MEMORY_OBJECTS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SHARED_MEMORY_OBJECTS */
+ if (x == Mono_Posix_SysConf__SC_AIO_LISTIO_MAX)
+#ifdef _SC_AIO_LISTIO_MAX
+ {*r = _SC_AIO_LISTIO_MAX; return 0;}
+#else /* def _SC_AIO_LISTIO_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_AIO_LISTIO_MAX */
+ if (x == Mono_Posix_SysConf__SC_AIO_MAX)
+#ifdef _SC_AIO_MAX
+ {*r = _SC_AIO_MAX; return 0;}
+#else /* def _SC_AIO_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_AIO_MAX */
+ if (x == Mono_Posix_SysConf__SC_AIO_PRIO_DELTA_MAX)
+#ifdef _SC_AIO_PRIO_DELTA_MAX
+ {*r = _SC_AIO_PRIO_DELTA_MAX; return 0;}
+#else /* def _SC_AIO_PRIO_DELTA_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_AIO_PRIO_DELTA_MAX */
+ if (x == Mono_Posix_SysConf__SC_DELAYTIMER_MAX)
+#ifdef _SC_DELAYTIMER_MAX
+ {*r = _SC_DELAYTIMER_MAX; return 0;}
+#else /* def _SC_DELAYTIMER_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_DELAYTIMER_MAX */
+ if (x == Mono_Posix_SysConf__SC_MQ_OPEN_MAX)
+#ifdef _SC_MQ_OPEN_MAX
+ {*r = _SC_MQ_OPEN_MAX; return 0;}
+#else /* def _SC_MQ_OPEN_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MQ_OPEN_MAX */
+ if (x == Mono_Posix_SysConf__SC_MQ_PRIO_MAX)
+#ifdef _SC_MQ_PRIO_MAX
+ {*r = _SC_MQ_PRIO_MAX; return 0;}
+#else /* def _SC_MQ_PRIO_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MQ_PRIO_MAX */
+ if (x == Mono_Posix_SysConf__SC_VERSION)
+#ifdef _SC_VERSION
+ {*r = _SC_VERSION; return 0;}
+#else /* def _SC_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_VERSION */
+ if (x == Mono_Posix_SysConf__SC_PAGESIZE)
+#ifdef _SC_PAGESIZE
+ {*r = _SC_PAGESIZE; return 0;}
+#else /* def _SC_PAGESIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PAGESIZE */
+ if (x == Mono_Posix_SysConf__SC_RTSIG_MAX)
+#ifdef _SC_RTSIG_MAX
+ {*r = _SC_RTSIG_MAX; return 0;}
+#else /* def _SC_RTSIG_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_RTSIG_MAX */
+ if (x == Mono_Posix_SysConf__SC_SEM_NSEMS_MAX)
+#ifdef _SC_SEM_NSEMS_MAX
+ {*r = _SC_SEM_NSEMS_MAX; return 0;}
+#else /* def _SC_SEM_NSEMS_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SEM_NSEMS_MAX */
+ if (x == Mono_Posix_SysConf__SC_SEM_VALUE_MAX)
+#ifdef _SC_SEM_VALUE_MAX
+ {*r = _SC_SEM_VALUE_MAX; return 0;}
+#else /* def _SC_SEM_VALUE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SEM_VALUE_MAX */
+ if (x == Mono_Posix_SysConf__SC_SIGQUEUE_MAX)
+#ifdef _SC_SIGQUEUE_MAX
+ {*r = _SC_SIGQUEUE_MAX; return 0;}
+#else /* def _SC_SIGQUEUE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SIGQUEUE_MAX */
+ if (x == Mono_Posix_SysConf__SC_TIMER_MAX)
+#ifdef _SC_TIMER_MAX
+ {*r = _SC_TIMER_MAX; return 0;}
+#else /* def _SC_TIMER_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TIMER_MAX */
+ if (x == Mono_Posix_SysConf__SC_BC_BASE_MAX)
+#ifdef _SC_BC_BASE_MAX
+ {*r = _SC_BC_BASE_MAX; return 0;}
+#else /* def _SC_BC_BASE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_BC_BASE_MAX */
+ if (x == Mono_Posix_SysConf__SC_BC_DIM_MAX)
+#ifdef _SC_BC_DIM_MAX
+ {*r = _SC_BC_DIM_MAX; return 0;}
+#else /* def _SC_BC_DIM_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_BC_DIM_MAX */
+ if (x == Mono_Posix_SysConf__SC_BC_SCALE_MAX)
+#ifdef _SC_BC_SCALE_MAX
+ {*r = _SC_BC_SCALE_MAX; return 0;}
+#else /* def _SC_BC_SCALE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_BC_SCALE_MAX */
+ if (x == Mono_Posix_SysConf__SC_BC_STRING_MAX)
+#ifdef _SC_BC_STRING_MAX
+ {*r = _SC_BC_STRING_MAX; return 0;}
+#else /* def _SC_BC_STRING_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_BC_STRING_MAX */
+ if (x == Mono_Posix_SysConf__SC_COLL_WEIGHTS_MAX)
+#ifdef _SC_COLL_WEIGHTS_MAX
+ {*r = _SC_COLL_WEIGHTS_MAX; return 0;}
+#else /* def _SC_COLL_WEIGHTS_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_COLL_WEIGHTS_MAX */
+ if (x == Mono_Posix_SysConf__SC_EQUIV_CLASS_MAX)
+#ifdef _SC_EQUIV_CLASS_MAX
+ {*r = _SC_EQUIV_CLASS_MAX; return 0;}
+#else /* def _SC_EQUIV_CLASS_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_EQUIV_CLASS_MAX */
+ if (x == Mono_Posix_SysConf__SC_EXPR_NEST_MAX)
+#ifdef _SC_EXPR_NEST_MAX
+ {*r = _SC_EXPR_NEST_MAX; return 0;}
+#else /* def _SC_EXPR_NEST_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_EXPR_NEST_MAX */
+ if (x == Mono_Posix_SysConf__SC_LINE_MAX)
+#ifdef _SC_LINE_MAX
+ {*r = _SC_LINE_MAX; return 0;}
+#else /* def _SC_LINE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LINE_MAX */
+ if (x == Mono_Posix_SysConf__SC_RE_DUP_MAX)
+#ifdef _SC_RE_DUP_MAX
+ {*r = _SC_RE_DUP_MAX; return 0;}
+#else /* def _SC_RE_DUP_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_RE_DUP_MAX */
+ if (x == Mono_Posix_SysConf__SC_CHARCLASS_NAME_MAX)
+#ifdef _SC_CHARCLASS_NAME_MAX
+ {*r = _SC_CHARCLASS_NAME_MAX; return 0;}
+#else /* def _SC_CHARCLASS_NAME_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CHARCLASS_NAME_MAX */
+ if (x == Mono_Posix_SysConf__SC_2_VERSION)
+#ifdef _SC_2_VERSION
+ {*r = _SC_2_VERSION; return 0;}
+#else /* def _SC_2_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_VERSION */
+ if (x == Mono_Posix_SysConf__SC_2_C_BIND)
+#ifdef _SC_2_C_BIND
+ {*r = _SC_2_C_BIND; return 0;}
+#else /* def _SC_2_C_BIND */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_C_BIND */
+ if (x == Mono_Posix_SysConf__SC_2_C_DEV)
+#ifdef _SC_2_C_DEV
+ {*r = _SC_2_C_DEV; return 0;}
+#else /* def _SC_2_C_DEV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_C_DEV */
+ if (x == Mono_Posix_SysConf__SC_2_FORT_DEV)
+#ifdef _SC_2_FORT_DEV
+ {*r = _SC_2_FORT_DEV; return 0;}
+#else /* def _SC_2_FORT_DEV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_FORT_DEV */
+ if (x == Mono_Posix_SysConf__SC_2_FORT_RUN)
+#ifdef _SC_2_FORT_RUN
+ {*r = _SC_2_FORT_RUN; return 0;}
+#else /* def _SC_2_FORT_RUN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_FORT_RUN */
+ if (x == Mono_Posix_SysConf__SC_2_SW_DEV)
+#ifdef _SC_2_SW_DEV
+ {*r = _SC_2_SW_DEV; return 0;}
+#else /* def _SC_2_SW_DEV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_SW_DEV */
+ if (x == Mono_Posix_SysConf__SC_2_LOCALEDEF)
+#ifdef _SC_2_LOCALEDEF
+ {*r = _SC_2_LOCALEDEF; return 0;}
+#else /* def _SC_2_LOCALEDEF */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_LOCALEDEF */
+ if (x == Mono_Posix_SysConf__SC_PII)
+#ifdef _SC_PII
+ {*r = _SC_PII; return 0;}
+#else /* def _SC_PII */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII */
+ if (x == Mono_Posix_SysConf__SC_PII_XTI)
+#ifdef _SC_PII_XTI
+ {*r = _SC_PII_XTI; return 0;}
+#else /* def _SC_PII_XTI */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_XTI */
+ if (x == Mono_Posix_SysConf__SC_PII_SOCKET)
+#ifdef _SC_PII_SOCKET
+ {*r = _SC_PII_SOCKET; return 0;}
+#else /* def _SC_PII_SOCKET */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_SOCKET */
+ if (x == Mono_Posix_SysConf__SC_PII_INTERNET)
+#ifdef _SC_PII_INTERNET
+ {*r = _SC_PII_INTERNET; return 0;}
+#else /* def _SC_PII_INTERNET */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_INTERNET */
+ if (x == Mono_Posix_SysConf__SC_PII_OSI)
+#ifdef _SC_PII_OSI
+ {*r = _SC_PII_OSI; return 0;}
+#else /* def _SC_PII_OSI */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_OSI */
+ if (x == Mono_Posix_SysConf__SC_POLL)
+#ifdef _SC_POLL
+ {*r = _SC_POLL; return 0;}
+#else /* def _SC_POLL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_POLL */
+ if (x == Mono_Posix_SysConf__SC_SELECT)
+#ifdef _SC_SELECT
+ {*r = _SC_SELECT; return 0;}
+#else /* def _SC_SELECT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SELECT */
+ if (x == Mono_Posix_SysConf__SC_UIO_MAXIOV)
+#ifdef _SC_UIO_MAXIOV
+ {*r = _SC_UIO_MAXIOV; return 0;}
+#else /* def _SC_UIO_MAXIOV */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_UIO_MAXIOV */
+ if (x == Mono_Posix_SysConf__SC_IOV_MAX)
+#ifdef _SC_IOV_MAX
+ {*r = _SC_IOV_MAX; return 0;}
+#else /* def _SC_IOV_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_IOV_MAX */
+ if (x == Mono_Posix_SysConf__SC_PII_INTERNET_STREAM)
+#ifdef _SC_PII_INTERNET_STREAM
+ {*r = _SC_PII_INTERNET_STREAM; return 0;}
+#else /* def _SC_PII_INTERNET_STREAM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_INTERNET_STREAM */
+ if (x == Mono_Posix_SysConf__SC_PII_INTERNET_DGRAM)
+#ifdef _SC_PII_INTERNET_DGRAM
+ {*r = _SC_PII_INTERNET_DGRAM; return 0;}
+#else /* def _SC_PII_INTERNET_DGRAM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_INTERNET_DGRAM */
+ if (x == Mono_Posix_SysConf__SC_PII_OSI_COTS)
+#ifdef _SC_PII_OSI_COTS
+ {*r = _SC_PII_OSI_COTS; return 0;}
+#else /* def _SC_PII_OSI_COTS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_OSI_COTS */
+ if (x == Mono_Posix_SysConf__SC_PII_OSI_CLTS)
+#ifdef _SC_PII_OSI_CLTS
+ {*r = _SC_PII_OSI_CLTS; return 0;}
+#else /* def _SC_PII_OSI_CLTS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_OSI_CLTS */
+ if (x == Mono_Posix_SysConf__SC_PII_OSI_M)
+#ifdef _SC_PII_OSI_M
+ {*r = _SC_PII_OSI_M; return 0;}
+#else /* def _SC_PII_OSI_M */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PII_OSI_M */
+ if (x == Mono_Posix_SysConf__SC_T_IOV_MAX)
+#ifdef _SC_T_IOV_MAX
+ {*r = _SC_T_IOV_MAX; return 0;}
+#else /* def _SC_T_IOV_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_T_IOV_MAX */
+ if (x == Mono_Posix_SysConf__SC_THREADS)
+#ifdef _SC_THREADS
+ {*r = _SC_THREADS; return 0;}
+#else /* def _SC_THREADS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREADS */
+ if (x == Mono_Posix_SysConf__SC_THREAD_SAFE_FUNCTIONS)
+#ifdef _SC_THREAD_SAFE_FUNCTIONS
+ {*r = _SC_THREAD_SAFE_FUNCTIONS; return 0;}
+#else /* def _SC_THREAD_SAFE_FUNCTIONS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_SAFE_FUNCTIONS */
+ if (x == Mono_Posix_SysConf__SC_GETGR_R_SIZE_MAX)
+#ifdef _SC_GETGR_R_SIZE_MAX
+ {*r = _SC_GETGR_R_SIZE_MAX; return 0;}
+#else /* def _SC_GETGR_R_SIZE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_GETGR_R_SIZE_MAX */
+ if (x == Mono_Posix_SysConf__SC_GETPW_R_SIZE_MAX)
+#ifdef _SC_GETPW_R_SIZE_MAX
+ {*r = _SC_GETPW_R_SIZE_MAX; return 0;}
+#else /* def _SC_GETPW_R_SIZE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_GETPW_R_SIZE_MAX */
+ if (x == Mono_Posix_SysConf__SC_LOGIN_NAME_MAX)
+#ifdef _SC_LOGIN_NAME_MAX
+ {*r = _SC_LOGIN_NAME_MAX; return 0;}
+#else /* def _SC_LOGIN_NAME_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LOGIN_NAME_MAX */
+ if (x == Mono_Posix_SysConf__SC_TTY_NAME_MAX)
+#ifdef _SC_TTY_NAME_MAX
+ {*r = _SC_TTY_NAME_MAX; return 0;}
+#else /* def _SC_TTY_NAME_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TTY_NAME_MAX */
+ if (x == Mono_Posix_SysConf__SC_THREAD_DESTRUCTOR_ITERATIONS)
+#ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
+ {*r = _SC_THREAD_DESTRUCTOR_ITERATIONS; return 0;}
+#else /* def _SC_THREAD_DESTRUCTOR_ITERATIONS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_DESTRUCTOR_ITERATIONS */
+ if (x == Mono_Posix_SysConf__SC_THREAD_KEYS_MAX)
+#ifdef _SC_THREAD_KEYS_MAX
+ {*r = _SC_THREAD_KEYS_MAX; return 0;}
+#else /* def _SC_THREAD_KEYS_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_KEYS_MAX */
+ if (x == Mono_Posix_SysConf__SC_THREAD_STACK_MIN)
+#ifdef _SC_THREAD_STACK_MIN
+ {*r = _SC_THREAD_STACK_MIN; return 0;}
+#else /* def _SC_THREAD_STACK_MIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_STACK_MIN */
+ if (x == Mono_Posix_SysConf__SC_THREAD_THREADS_MAX)
+#ifdef _SC_THREAD_THREADS_MAX
+ {*r = _SC_THREAD_THREADS_MAX; return 0;}
+#else /* def _SC_THREAD_THREADS_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_THREADS_MAX */
+ if (x == Mono_Posix_SysConf__SC_THREAD_ATTR_STACKADDR)
+#ifdef _SC_THREAD_ATTR_STACKADDR
+ {*r = _SC_THREAD_ATTR_STACKADDR; return 0;}
+#else /* def _SC_THREAD_ATTR_STACKADDR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_ATTR_STACKADDR */
+ if (x == Mono_Posix_SysConf__SC_THREAD_ATTR_STACKSIZE)
+#ifdef _SC_THREAD_ATTR_STACKSIZE
+ {*r = _SC_THREAD_ATTR_STACKSIZE; return 0;}
+#else /* def _SC_THREAD_ATTR_STACKSIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_ATTR_STACKSIZE */
+ if (x == Mono_Posix_SysConf__SC_THREAD_PRIORITY_SCHEDULING)
+#ifdef _SC_THREAD_PRIORITY_SCHEDULING
+ {*r = _SC_THREAD_PRIORITY_SCHEDULING; return 0;}
+#else /* def _SC_THREAD_PRIORITY_SCHEDULING */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_PRIORITY_SCHEDULING */
+ if (x == Mono_Posix_SysConf__SC_THREAD_PRIO_INHERIT)
+#ifdef _SC_THREAD_PRIO_INHERIT
+ {*r = _SC_THREAD_PRIO_INHERIT; return 0;}
+#else /* def _SC_THREAD_PRIO_INHERIT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_PRIO_INHERIT */
+ if (x == Mono_Posix_SysConf__SC_THREAD_PRIO_PROTECT)
+#ifdef _SC_THREAD_PRIO_PROTECT
+ {*r = _SC_THREAD_PRIO_PROTECT; return 0;}
+#else /* def _SC_THREAD_PRIO_PROTECT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_PRIO_PROTECT */
+ if (x == Mono_Posix_SysConf__SC_THREAD_PROCESS_SHARED)
+#ifdef _SC_THREAD_PROCESS_SHARED
+ {*r = _SC_THREAD_PROCESS_SHARED; return 0;}
+#else /* def _SC_THREAD_PROCESS_SHARED */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_PROCESS_SHARED */
+ if (x == Mono_Posix_SysConf__SC_NPROCESSORS_CONF)
+#ifdef _SC_NPROCESSORS_CONF
+ {*r = _SC_NPROCESSORS_CONF; return 0;}
+#else /* def _SC_NPROCESSORS_CONF */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NPROCESSORS_CONF */
+ if (x == Mono_Posix_SysConf__SC_NPROCESSORS_ONLN)
+#ifdef _SC_NPROCESSORS_ONLN
+ {*r = _SC_NPROCESSORS_ONLN; return 0;}
+#else /* def _SC_NPROCESSORS_ONLN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NPROCESSORS_ONLN */
+ if (x == Mono_Posix_SysConf__SC_PHYS_PAGES)
+#ifdef _SC_PHYS_PAGES
+ {*r = _SC_PHYS_PAGES; return 0;}
+#else /* def _SC_PHYS_PAGES */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PHYS_PAGES */
+ if (x == Mono_Posix_SysConf__SC_AVPHYS_PAGES)
+#ifdef _SC_AVPHYS_PAGES
+ {*r = _SC_AVPHYS_PAGES; return 0;}
+#else /* def _SC_AVPHYS_PAGES */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_AVPHYS_PAGES */
+ if (x == Mono_Posix_SysConf__SC_ATEXIT_MAX)
+#ifdef _SC_ATEXIT_MAX
+ {*r = _SC_ATEXIT_MAX; return 0;}
+#else /* def _SC_ATEXIT_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_ATEXIT_MAX */
+ if (x == Mono_Posix_SysConf__SC_PASS_MAX)
+#ifdef _SC_PASS_MAX
+ {*r = _SC_PASS_MAX; return 0;}
+#else /* def _SC_PASS_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PASS_MAX */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_VERSION)
+#ifdef _SC_XOPEN_VERSION
+ {*r = _SC_XOPEN_VERSION; return 0;}
+#else /* def _SC_XOPEN_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_VERSION */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_XCU_VERSION)
+#ifdef _SC_XOPEN_XCU_VERSION
+ {*r = _SC_XOPEN_XCU_VERSION; return 0;}
+#else /* def _SC_XOPEN_XCU_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_XCU_VERSION */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_UNIX)
+#ifdef _SC_XOPEN_UNIX
+ {*r = _SC_XOPEN_UNIX; return 0;}
+#else /* def _SC_XOPEN_UNIX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_UNIX */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_CRYPT)
+#ifdef _SC_XOPEN_CRYPT
+ {*r = _SC_XOPEN_CRYPT; return 0;}
+#else /* def _SC_XOPEN_CRYPT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_CRYPT */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_ENH_I18N)
+#ifdef _SC_XOPEN_ENH_I18N
+ {*r = _SC_XOPEN_ENH_I18N; return 0;}
+#else /* def _SC_XOPEN_ENH_I18N */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_ENH_I18N */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_SHM)
+#ifdef _SC_XOPEN_SHM
+ {*r = _SC_XOPEN_SHM; return 0;}
+#else /* def _SC_XOPEN_SHM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_SHM */
+ if (x == Mono_Posix_SysConf__SC_2_CHAR_TERM)
+#ifdef _SC_2_CHAR_TERM
+ {*r = _SC_2_CHAR_TERM; return 0;}
+#else /* def _SC_2_CHAR_TERM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_CHAR_TERM */
+ if (x == Mono_Posix_SysConf__SC_2_C_VERSION)
+#ifdef _SC_2_C_VERSION
+ {*r = _SC_2_C_VERSION; return 0;}
+#else /* def _SC_2_C_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_C_VERSION */
+ if (x == Mono_Posix_SysConf__SC_2_UPE)
+#ifdef _SC_2_UPE
+ {*r = _SC_2_UPE; return 0;}
+#else /* def _SC_2_UPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_UPE */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_XPG2)
+#ifdef _SC_XOPEN_XPG2
+ {*r = _SC_XOPEN_XPG2; return 0;}
+#else /* def _SC_XOPEN_XPG2 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_XPG2 */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_XPG3)
+#ifdef _SC_XOPEN_XPG3
+ {*r = _SC_XOPEN_XPG3; return 0;}
+#else /* def _SC_XOPEN_XPG3 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_XPG3 */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_XPG4)
+#ifdef _SC_XOPEN_XPG4
+ {*r = _SC_XOPEN_XPG4; return 0;}
+#else /* def _SC_XOPEN_XPG4 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_XPG4 */
+ if (x == Mono_Posix_SysConf__SC_CHAR_BIT)
+#ifdef _SC_CHAR_BIT
+ {*r = _SC_CHAR_BIT; return 0;}
+#else /* def _SC_CHAR_BIT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CHAR_BIT */
+ if (x == Mono_Posix_SysConf__SC_CHAR_MAX)
+#ifdef _SC_CHAR_MAX
+ {*r = _SC_CHAR_MAX; return 0;}
+#else /* def _SC_CHAR_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CHAR_MAX */
+ if (x == Mono_Posix_SysConf__SC_CHAR_MIN)
+#ifdef _SC_CHAR_MIN
+ {*r = _SC_CHAR_MIN; return 0;}
+#else /* def _SC_CHAR_MIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CHAR_MIN */
+ if (x == Mono_Posix_SysConf__SC_INT_MAX)
+#ifdef _SC_INT_MAX
+ {*r = _SC_INT_MAX; return 0;}
+#else /* def _SC_INT_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_INT_MAX */
+ if (x == Mono_Posix_SysConf__SC_INT_MIN)
+#ifdef _SC_INT_MIN
+ {*r = _SC_INT_MIN; return 0;}
+#else /* def _SC_INT_MIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_INT_MIN */
+ if (x == Mono_Posix_SysConf__SC_LONG_BIT)
+#ifdef _SC_LONG_BIT
+ {*r = _SC_LONG_BIT; return 0;}
+#else /* def _SC_LONG_BIT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LONG_BIT */
+ if (x == Mono_Posix_SysConf__SC_WORD_BIT)
+#ifdef _SC_WORD_BIT
+ {*r = _SC_WORD_BIT; return 0;}
+#else /* def _SC_WORD_BIT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_WORD_BIT */
+ if (x == Mono_Posix_SysConf__SC_MB_LEN_MAX)
+#ifdef _SC_MB_LEN_MAX
+ {*r = _SC_MB_LEN_MAX; return 0;}
+#else /* def _SC_MB_LEN_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MB_LEN_MAX */
+ if (x == Mono_Posix_SysConf__SC_NZERO)
+#ifdef _SC_NZERO
+ {*r = _SC_NZERO; return 0;}
+#else /* def _SC_NZERO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NZERO */
+ if (x == Mono_Posix_SysConf__SC_SSIZE_MAX)
+#ifdef _SC_SSIZE_MAX
+ {*r = _SC_SSIZE_MAX; return 0;}
+#else /* def _SC_SSIZE_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SSIZE_MAX */
+ if (x == Mono_Posix_SysConf__SC_SCHAR_MAX)
+#ifdef _SC_SCHAR_MAX
+ {*r = _SC_SCHAR_MAX; return 0;}
+#else /* def _SC_SCHAR_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SCHAR_MAX */
+ if (x == Mono_Posix_SysConf__SC_SCHAR_MIN)
+#ifdef _SC_SCHAR_MIN
+ {*r = _SC_SCHAR_MIN; return 0;}
+#else /* def _SC_SCHAR_MIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SCHAR_MIN */
+ if (x == Mono_Posix_SysConf__SC_SHRT_MAX)
+#ifdef _SC_SHRT_MAX
+ {*r = _SC_SHRT_MAX; return 0;}
+#else /* def _SC_SHRT_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SHRT_MAX */
+ if (x == Mono_Posix_SysConf__SC_SHRT_MIN)
+#ifdef _SC_SHRT_MIN
+ {*r = _SC_SHRT_MIN; return 0;}
+#else /* def _SC_SHRT_MIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SHRT_MIN */
+ if (x == Mono_Posix_SysConf__SC_UCHAR_MAX)
+#ifdef _SC_UCHAR_MAX
+ {*r = _SC_UCHAR_MAX; return 0;}
+#else /* def _SC_UCHAR_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_UCHAR_MAX */
+ if (x == Mono_Posix_SysConf__SC_UINT_MAX)
+#ifdef _SC_UINT_MAX
+ {*r = _SC_UINT_MAX; return 0;}
+#else /* def _SC_UINT_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_UINT_MAX */
+ if (x == Mono_Posix_SysConf__SC_ULONG_MAX)
+#ifdef _SC_ULONG_MAX
+ {*r = _SC_ULONG_MAX; return 0;}
+#else /* def _SC_ULONG_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_ULONG_MAX */
+ if (x == Mono_Posix_SysConf__SC_USHRT_MAX)
+#ifdef _SC_USHRT_MAX
+ {*r = _SC_USHRT_MAX; return 0;}
+#else /* def _SC_USHRT_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_USHRT_MAX */
+ if (x == Mono_Posix_SysConf__SC_NL_ARGMAX)
+#ifdef _SC_NL_ARGMAX
+ {*r = _SC_NL_ARGMAX; return 0;}
+#else /* def _SC_NL_ARGMAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NL_ARGMAX */
+ if (x == Mono_Posix_SysConf__SC_NL_LANGMAX)
+#ifdef _SC_NL_LANGMAX
+ {*r = _SC_NL_LANGMAX; return 0;}
+#else /* def _SC_NL_LANGMAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NL_LANGMAX */
+ if (x == Mono_Posix_SysConf__SC_NL_MSGMAX)
+#ifdef _SC_NL_MSGMAX
+ {*r = _SC_NL_MSGMAX; return 0;}
+#else /* def _SC_NL_MSGMAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NL_MSGMAX */
+ if (x == Mono_Posix_SysConf__SC_NL_NMAX)
+#ifdef _SC_NL_NMAX
+ {*r = _SC_NL_NMAX; return 0;}
+#else /* def _SC_NL_NMAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NL_NMAX */
+ if (x == Mono_Posix_SysConf__SC_NL_SETMAX)
+#ifdef _SC_NL_SETMAX
+ {*r = _SC_NL_SETMAX; return 0;}
+#else /* def _SC_NL_SETMAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NL_SETMAX */
+ if (x == Mono_Posix_SysConf__SC_NL_TEXTMAX)
+#ifdef _SC_NL_TEXTMAX
+ {*r = _SC_NL_TEXTMAX; return 0;}
+#else /* def _SC_NL_TEXTMAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NL_TEXTMAX */
+ if (x == Mono_Posix_SysConf__SC_XBS5_ILP32_OFF32)
+#ifdef _SC_XBS5_ILP32_OFF32
+ {*r = _SC_XBS5_ILP32_OFF32; return 0;}
+#else /* def _SC_XBS5_ILP32_OFF32 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XBS5_ILP32_OFF32 */
+ if (x == Mono_Posix_SysConf__SC_XBS5_ILP32_OFFBIG)
+#ifdef _SC_XBS5_ILP32_OFFBIG
+ {*r = _SC_XBS5_ILP32_OFFBIG; return 0;}
+#else /* def _SC_XBS5_ILP32_OFFBIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XBS5_ILP32_OFFBIG */
+ if (x == Mono_Posix_SysConf__SC_XBS5_LP64_OFF64)
+#ifdef _SC_XBS5_LP64_OFF64
+ {*r = _SC_XBS5_LP64_OFF64; return 0;}
+#else /* def _SC_XBS5_LP64_OFF64 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XBS5_LP64_OFF64 */
+ if (x == Mono_Posix_SysConf__SC_XBS5_LPBIG_OFFBIG)
+#ifdef _SC_XBS5_LPBIG_OFFBIG
+ {*r = _SC_XBS5_LPBIG_OFFBIG; return 0;}
+#else /* def _SC_XBS5_LPBIG_OFFBIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XBS5_LPBIG_OFFBIG */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_LEGACY)
+#ifdef _SC_XOPEN_LEGACY
+ {*r = _SC_XOPEN_LEGACY; return 0;}
+#else /* def _SC_XOPEN_LEGACY */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_LEGACY */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_REALTIME)
+#ifdef _SC_XOPEN_REALTIME
+ {*r = _SC_XOPEN_REALTIME; return 0;}
+#else /* def _SC_XOPEN_REALTIME */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_REALTIME */
+ if (x == Mono_Posix_SysConf__SC_XOPEN_REALTIME_THREADS)
+#ifdef _SC_XOPEN_REALTIME_THREADS
+ {*r = _SC_XOPEN_REALTIME_THREADS; return 0;}
+#else /* def _SC_XOPEN_REALTIME_THREADS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_XOPEN_REALTIME_THREADS */
+ if (x == Mono_Posix_SysConf__SC_ADVISORY_INFO)
+#ifdef _SC_ADVISORY_INFO
+ {*r = _SC_ADVISORY_INFO; return 0;}
+#else /* def _SC_ADVISORY_INFO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_ADVISORY_INFO */
+ if (x == Mono_Posix_SysConf__SC_BARRIERS)
+#ifdef _SC_BARRIERS
+ {*r = _SC_BARRIERS; return 0;}
+#else /* def _SC_BARRIERS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_BARRIERS */
+ if (x == Mono_Posix_SysConf__SC_BASE)
+#ifdef _SC_BASE
+ {*r = _SC_BASE; return 0;}
+#else /* def _SC_BASE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_BASE */
+ if (x == Mono_Posix_SysConf__SC_C_LANG_SUPPORT)
+#ifdef _SC_C_LANG_SUPPORT
+ {*r = _SC_C_LANG_SUPPORT; return 0;}
+#else /* def _SC_C_LANG_SUPPORT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_C_LANG_SUPPORT */
+ if (x == Mono_Posix_SysConf__SC_C_LANG_SUPPORT_R)
+#ifdef _SC_C_LANG_SUPPORT_R
+ {*r = _SC_C_LANG_SUPPORT_R; return 0;}
+#else /* def _SC_C_LANG_SUPPORT_R */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_C_LANG_SUPPORT_R */
+ if (x == Mono_Posix_SysConf__SC_CLOCK_SELECTION)
+#ifdef _SC_CLOCK_SELECTION
+ {*r = _SC_CLOCK_SELECTION; return 0;}
+#else /* def _SC_CLOCK_SELECTION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CLOCK_SELECTION */
+ if (x == Mono_Posix_SysConf__SC_CPUTIME)
+#ifdef _SC_CPUTIME
+ {*r = _SC_CPUTIME; return 0;}
+#else /* def _SC_CPUTIME */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_CPUTIME */
+ if (x == Mono_Posix_SysConf__SC_THREAD_CPUTIME)
+#ifdef _SC_THREAD_CPUTIME
+ {*r = _SC_THREAD_CPUTIME; return 0;}
+#else /* def _SC_THREAD_CPUTIME */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_CPUTIME */
+ if (x == Mono_Posix_SysConf__SC_DEVICE_IO)
+#ifdef _SC_DEVICE_IO
+ {*r = _SC_DEVICE_IO; return 0;}
+#else /* def _SC_DEVICE_IO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_DEVICE_IO */
+ if (x == Mono_Posix_SysConf__SC_DEVICE_SPECIFIC)
+#ifdef _SC_DEVICE_SPECIFIC
+ {*r = _SC_DEVICE_SPECIFIC; return 0;}
+#else /* def _SC_DEVICE_SPECIFIC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_DEVICE_SPECIFIC */
+ if (x == Mono_Posix_SysConf__SC_DEVICE_SPECIFIC_R)
+#ifdef _SC_DEVICE_SPECIFIC_R
+ {*r = _SC_DEVICE_SPECIFIC_R; return 0;}
+#else /* def _SC_DEVICE_SPECIFIC_R */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_DEVICE_SPECIFIC_R */
+ if (x == Mono_Posix_SysConf__SC_FD_MGMT)
+#ifdef _SC_FD_MGMT
+ {*r = _SC_FD_MGMT; return 0;}
+#else /* def _SC_FD_MGMT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_FD_MGMT */
+ if (x == Mono_Posix_SysConf__SC_FIFO)
+#ifdef _SC_FIFO
+ {*r = _SC_FIFO; return 0;}
+#else /* def _SC_FIFO */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_FIFO */
+ if (x == Mono_Posix_SysConf__SC_PIPE)
+#ifdef _SC_PIPE
+ {*r = _SC_PIPE; return 0;}
+#else /* def _SC_PIPE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_PIPE */
+ if (x == Mono_Posix_SysConf__SC_FILE_ATTRIBUTES)
+#ifdef _SC_FILE_ATTRIBUTES
+ {*r = _SC_FILE_ATTRIBUTES; return 0;}
+#else /* def _SC_FILE_ATTRIBUTES */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_FILE_ATTRIBUTES */
+ if (x == Mono_Posix_SysConf__SC_FILE_LOCKING)
+#ifdef _SC_FILE_LOCKING
+ {*r = _SC_FILE_LOCKING; return 0;}
+#else /* def _SC_FILE_LOCKING */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_FILE_LOCKING */
+ if (x == Mono_Posix_SysConf__SC_FILE_SYSTEM)
+#ifdef _SC_FILE_SYSTEM
+ {*r = _SC_FILE_SYSTEM; return 0;}
+#else /* def _SC_FILE_SYSTEM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_FILE_SYSTEM */
+ if (x == Mono_Posix_SysConf__SC_MONOTONIC_CLOCK)
+#ifdef _SC_MONOTONIC_CLOCK
+ {*r = _SC_MONOTONIC_CLOCK; return 0;}
+#else /* def _SC_MONOTONIC_CLOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MONOTONIC_CLOCK */
+ if (x == Mono_Posix_SysConf__SC_MULTI_PROCESS)
+#ifdef _SC_MULTI_PROCESS
+ {*r = _SC_MULTI_PROCESS; return 0;}
+#else /* def _SC_MULTI_PROCESS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_MULTI_PROCESS */
+ if (x == Mono_Posix_SysConf__SC_SINGLE_PROCESS)
+#ifdef _SC_SINGLE_PROCESS
+ {*r = _SC_SINGLE_PROCESS; return 0;}
+#else /* def _SC_SINGLE_PROCESS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SINGLE_PROCESS */
+ if (x == Mono_Posix_SysConf__SC_NETWORKING)
+#ifdef _SC_NETWORKING
+ {*r = _SC_NETWORKING; return 0;}
+#else /* def _SC_NETWORKING */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_NETWORKING */
+ if (x == Mono_Posix_SysConf__SC_READER_WRITER_LOCKS)
+#ifdef _SC_READER_WRITER_LOCKS
+ {*r = _SC_READER_WRITER_LOCKS; return 0;}
+#else /* def _SC_READER_WRITER_LOCKS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_READER_WRITER_LOCKS */
+ if (x == Mono_Posix_SysConf__SC_SPIN_LOCKS)
+#ifdef _SC_SPIN_LOCKS
+ {*r = _SC_SPIN_LOCKS; return 0;}
+#else /* def _SC_SPIN_LOCKS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SPIN_LOCKS */
+ if (x == Mono_Posix_SysConf__SC_REGEXP)
+#ifdef _SC_REGEXP
+ {*r = _SC_REGEXP; return 0;}
+#else /* def _SC_REGEXP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_REGEXP */
+ if (x == Mono_Posix_SysConf__SC_REGEX_VERSION)
+#ifdef _SC_REGEX_VERSION
+ {*r = _SC_REGEX_VERSION; return 0;}
+#else /* def _SC_REGEX_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_REGEX_VERSION */
+ if (x == Mono_Posix_SysConf__SC_SHELL)
+#ifdef _SC_SHELL
+ {*r = _SC_SHELL; return 0;}
+#else /* def _SC_SHELL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SHELL */
+ if (x == Mono_Posix_SysConf__SC_SIGNALS)
+#ifdef _SC_SIGNALS
+ {*r = _SC_SIGNALS; return 0;}
+#else /* def _SC_SIGNALS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SIGNALS */
+ if (x == Mono_Posix_SysConf__SC_SPAWN)
+#ifdef _SC_SPAWN
+ {*r = _SC_SPAWN; return 0;}
+#else /* def _SC_SPAWN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SPAWN */
+ if (x == Mono_Posix_SysConf__SC_SPORADIC_SERVER)
+#ifdef _SC_SPORADIC_SERVER
+ {*r = _SC_SPORADIC_SERVER; return 0;}
+#else /* def _SC_SPORADIC_SERVER */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SPORADIC_SERVER */
+ if (x == Mono_Posix_SysConf__SC_THREAD_SPORADIC_SERVER)
+#ifdef _SC_THREAD_SPORADIC_SERVER
+ {*r = _SC_THREAD_SPORADIC_SERVER; return 0;}
+#else /* def _SC_THREAD_SPORADIC_SERVER */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_THREAD_SPORADIC_SERVER */
+ if (x == Mono_Posix_SysConf__SC_SYSTEM_DATABASE)
+#ifdef _SC_SYSTEM_DATABASE
+ {*r = _SC_SYSTEM_DATABASE; return 0;}
+#else /* def _SC_SYSTEM_DATABASE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SYSTEM_DATABASE */
+ if (x == Mono_Posix_SysConf__SC_SYSTEM_DATABASE_R)
+#ifdef _SC_SYSTEM_DATABASE_R
+ {*r = _SC_SYSTEM_DATABASE_R; return 0;}
+#else /* def _SC_SYSTEM_DATABASE_R */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SYSTEM_DATABASE_R */
+ if (x == Mono_Posix_SysConf__SC_TIMEOUTS)
+#ifdef _SC_TIMEOUTS
+ {*r = _SC_TIMEOUTS; return 0;}
+#else /* def _SC_TIMEOUTS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TIMEOUTS */
+ if (x == Mono_Posix_SysConf__SC_TYPED_MEMORY_OBJECTS)
+#ifdef _SC_TYPED_MEMORY_OBJECTS
+ {*r = _SC_TYPED_MEMORY_OBJECTS; return 0;}
+#else /* def _SC_TYPED_MEMORY_OBJECTS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TYPED_MEMORY_OBJECTS */
+ if (x == Mono_Posix_SysConf__SC_USER_GROUPS)
+#ifdef _SC_USER_GROUPS
+ {*r = _SC_USER_GROUPS; return 0;}
+#else /* def _SC_USER_GROUPS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_USER_GROUPS */
+ if (x == Mono_Posix_SysConf__SC_USER_GROUPS_R)
+#ifdef _SC_USER_GROUPS_R
+ {*r = _SC_USER_GROUPS_R; return 0;}
+#else /* def _SC_USER_GROUPS_R */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_USER_GROUPS_R */
+ if (x == Mono_Posix_SysConf__SC_2_PBS)
+#ifdef _SC_2_PBS
+ {*r = _SC_2_PBS; return 0;}
+#else /* def _SC_2_PBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_PBS */
+ if (x == Mono_Posix_SysConf__SC_2_PBS_ACCOUNTING)
+#ifdef _SC_2_PBS_ACCOUNTING
+ {*r = _SC_2_PBS_ACCOUNTING; return 0;}
+#else /* def _SC_2_PBS_ACCOUNTING */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_PBS_ACCOUNTING */
+ if (x == Mono_Posix_SysConf__SC_2_PBS_LOCATE)
+#ifdef _SC_2_PBS_LOCATE
+ {*r = _SC_2_PBS_LOCATE; return 0;}
+#else /* def _SC_2_PBS_LOCATE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_PBS_LOCATE */
+ if (x == Mono_Posix_SysConf__SC_2_PBS_MESSAGE)
+#ifdef _SC_2_PBS_MESSAGE
+ {*r = _SC_2_PBS_MESSAGE; return 0;}
+#else /* def _SC_2_PBS_MESSAGE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_PBS_MESSAGE */
+ if (x == Mono_Posix_SysConf__SC_2_PBS_TRACK)
+#ifdef _SC_2_PBS_TRACK
+ {*r = _SC_2_PBS_TRACK; return 0;}
+#else /* def _SC_2_PBS_TRACK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_PBS_TRACK */
+ if (x == Mono_Posix_SysConf__SC_SYMLOOP_MAX)
+#ifdef _SC_SYMLOOP_MAX
+ {*r = _SC_SYMLOOP_MAX; return 0;}
+#else /* def _SC_SYMLOOP_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_SYMLOOP_MAX */
+ if (x == Mono_Posix_SysConf__SC_STREAMS)
+#ifdef _SC_STREAMS
+ {*r = _SC_STREAMS; return 0;}
+#else /* def _SC_STREAMS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_STREAMS */
+ if (x == Mono_Posix_SysConf__SC_2_PBS_CHECKPOINT)
+#ifdef _SC_2_PBS_CHECKPOINT
+ {*r = _SC_2_PBS_CHECKPOINT; return 0;}
+#else /* def _SC_2_PBS_CHECKPOINT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_2_PBS_CHECKPOINT */
+ if (x == Mono_Posix_SysConf__SC_V6_ILP32_OFF32)
+#ifdef _SC_V6_ILP32_OFF32
+ {*r = _SC_V6_ILP32_OFF32; return 0;}
+#else /* def _SC_V6_ILP32_OFF32 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_V6_ILP32_OFF32 */
+ if (x == Mono_Posix_SysConf__SC_V6_ILP32_OFFBIG)
+#ifdef _SC_V6_ILP32_OFFBIG
+ {*r = _SC_V6_ILP32_OFFBIG; return 0;}
+#else /* def _SC_V6_ILP32_OFFBIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_V6_ILP32_OFFBIG */
+ if (x == Mono_Posix_SysConf__SC_V6_LP64_OFF64)
+#ifdef _SC_V6_LP64_OFF64
+ {*r = _SC_V6_LP64_OFF64; return 0;}
+#else /* def _SC_V6_LP64_OFF64 */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_V6_LP64_OFF64 */
+ if (x == Mono_Posix_SysConf__SC_V6_LPBIG_OFFBIG)
+#ifdef _SC_V6_LPBIG_OFFBIG
+ {*r = _SC_V6_LPBIG_OFFBIG; return 0;}
+#else /* def _SC_V6_LPBIG_OFFBIG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_V6_LPBIG_OFFBIG */
+ if (x == Mono_Posix_SysConf__SC_HOST_NAME_MAX)
+#ifdef _SC_HOST_NAME_MAX
+ {*r = _SC_HOST_NAME_MAX; return 0;}
+#else /* def _SC_HOST_NAME_MAX */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_HOST_NAME_MAX */
+ if (x == Mono_Posix_SysConf__SC_TRACE)
+#ifdef _SC_TRACE
+ {*r = _SC_TRACE; return 0;}
+#else /* def _SC_TRACE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TRACE */
+ if (x == Mono_Posix_SysConf__SC_TRACE_EVENT_FILTER)
+#ifdef _SC_TRACE_EVENT_FILTER
+ {*r = _SC_TRACE_EVENT_FILTER; return 0;}
+#else /* def _SC_TRACE_EVENT_FILTER */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TRACE_EVENT_FILTER */
+ if (x == Mono_Posix_SysConf__SC_TRACE_INHERIT)
+#ifdef _SC_TRACE_INHERIT
+ {*r = _SC_TRACE_INHERIT; return 0;}
+#else /* def _SC_TRACE_INHERIT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TRACE_INHERIT */
+ if (x == Mono_Posix_SysConf__SC_TRACE_LOG)
+#ifdef _SC_TRACE_LOG
+ {*r = _SC_TRACE_LOG; return 0;}
+#else /* def _SC_TRACE_LOG */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_TRACE_LOG */
+ if (x == Mono_Posix_SysConf__SC_LEVEL1_ICACHE_SIZE)
+#ifdef _SC_LEVEL1_ICACHE_SIZE
+ {*r = _SC_LEVEL1_ICACHE_SIZE; return 0;}
+#else /* def _SC_LEVEL1_ICACHE_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL1_ICACHE_SIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL1_ICACHE_ASSOC)
+#ifdef _SC_LEVEL1_ICACHE_ASSOC
+ {*r = _SC_LEVEL1_ICACHE_ASSOC; return 0;}
+#else /* def _SC_LEVEL1_ICACHE_ASSOC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL1_ICACHE_ASSOC */
+ if (x == Mono_Posix_SysConf__SC_LEVEL1_ICACHE_LINESIZE)
+#ifdef _SC_LEVEL1_ICACHE_LINESIZE
+ {*r = _SC_LEVEL1_ICACHE_LINESIZE; return 0;}
+#else /* def _SC_LEVEL1_ICACHE_LINESIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL1_ICACHE_LINESIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL1_DCACHE_SIZE)
+#ifdef _SC_LEVEL1_DCACHE_SIZE
+ {*r = _SC_LEVEL1_DCACHE_SIZE; return 0;}
+#else /* def _SC_LEVEL1_DCACHE_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL1_DCACHE_SIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL1_DCACHE_ASSOC)
+#ifdef _SC_LEVEL1_DCACHE_ASSOC
+ {*r = _SC_LEVEL1_DCACHE_ASSOC; return 0;}
+#else /* def _SC_LEVEL1_DCACHE_ASSOC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL1_DCACHE_ASSOC */
+ if (x == Mono_Posix_SysConf__SC_LEVEL1_DCACHE_LINESIZE)
+#ifdef _SC_LEVEL1_DCACHE_LINESIZE
+ {*r = _SC_LEVEL1_DCACHE_LINESIZE; return 0;}
+#else /* def _SC_LEVEL1_DCACHE_LINESIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL1_DCACHE_LINESIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL2_CACHE_SIZE)
+#ifdef _SC_LEVEL2_CACHE_SIZE
+ {*r = _SC_LEVEL2_CACHE_SIZE; return 0;}
+#else /* def _SC_LEVEL2_CACHE_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL2_CACHE_SIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL2_CACHE_ASSOC)
+#ifdef _SC_LEVEL2_CACHE_ASSOC
+ {*r = _SC_LEVEL2_CACHE_ASSOC; return 0;}
+#else /* def _SC_LEVEL2_CACHE_ASSOC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL2_CACHE_ASSOC */
+ if (x == Mono_Posix_SysConf__SC_LEVEL2_CACHE_LINESIZE)
+#ifdef _SC_LEVEL2_CACHE_LINESIZE
+ {*r = _SC_LEVEL2_CACHE_LINESIZE; return 0;}
+#else /* def _SC_LEVEL2_CACHE_LINESIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL2_CACHE_LINESIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL3_CACHE_SIZE)
+#ifdef _SC_LEVEL3_CACHE_SIZE
+ {*r = _SC_LEVEL3_CACHE_SIZE; return 0;}
+#else /* def _SC_LEVEL3_CACHE_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL3_CACHE_SIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL3_CACHE_ASSOC)
+#ifdef _SC_LEVEL3_CACHE_ASSOC
+ {*r = _SC_LEVEL3_CACHE_ASSOC; return 0;}
+#else /* def _SC_LEVEL3_CACHE_ASSOC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL3_CACHE_ASSOC */
+ if (x == Mono_Posix_SysConf__SC_LEVEL3_CACHE_LINESIZE)
+#ifdef _SC_LEVEL3_CACHE_LINESIZE
+ {*r = _SC_LEVEL3_CACHE_LINESIZE; return 0;}
+#else /* def _SC_LEVEL3_CACHE_LINESIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL3_CACHE_LINESIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL4_CACHE_SIZE)
+#ifdef _SC_LEVEL4_CACHE_SIZE
+ {*r = _SC_LEVEL4_CACHE_SIZE; return 0;}
+#else /* def _SC_LEVEL4_CACHE_SIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL4_CACHE_SIZE */
+ if (x == Mono_Posix_SysConf__SC_LEVEL4_CACHE_ASSOC)
+#ifdef _SC_LEVEL4_CACHE_ASSOC
+ {*r = _SC_LEVEL4_CACHE_ASSOC; return 0;}
+#else /* def _SC_LEVEL4_CACHE_ASSOC */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL4_CACHE_ASSOC */
+ if (x == Mono_Posix_SysConf__SC_LEVEL4_CACHE_LINESIZE)
+#ifdef _SC_LEVEL4_CACHE_LINESIZE
+ {*r = _SC_LEVEL4_CACHE_LINESIZE; return 0;}
+#else /* def _SC_LEVEL4_CACHE_LINESIZE */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _SC_LEVEL4_CACHE_LINESIZE */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToSysConf (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef _SC_ARG_MAX
+ if (x == _SC_ARG_MAX)
+ {*r = Mono_Posix_SysConf__SC_ARG_MAX; return 0;}
+#endif /* ndef _SC_ARG_MAX */
+#ifdef _SC_CHILD_MAX
+ if (x == _SC_CHILD_MAX)
+ {*r = Mono_Posix_SysConf__SC_CHILD_MAX; return 0;}
+#endif /* ndef _SC_CHILD_MAX */
+#ifdef _SC_CLK_TCK
+ if (x == _SC_CLK_TCK)
+ {*r = Mono_Posix_SysConf__SC_CLK_TCK; return 0;}
+#endif /* ndef _SC_CLK_TCK */
+#ifdef _SC_NGROUPS_MAX
+ if (x == _SC_NGROUPS_MAX)
+ {*r = Mono_Posix_SysConf__SC_NGROUPS_MAX; return 0;}
+#endif /* ndef _SC_NGROUPS_MAX */
+#ifdef _SC_OPEN_MAX
+ if (x == _SC_OPEN_MAX)
+ {*r = Mono_Posix_SysConf__SC_OPEN_MAX; return 0;}
+#endif /* ndef _SC_OPEN_MAX */
+#ifdef _SC_STREAM_MAX
+ if (x == _SC_STREAM_MAX)
+ {*r = Mono_Posix_SysConf__SC_STREAM_MAX; return 0;}
+#endif /* ndef _SC_STREAM_MAX */
+#ifdef _SC_TZNAME_MAX
+ if (x == _SC_TZNAME_MAX)
+ {*r = Mono_Posix_SysConf__SC_TZNAME_MAX; return 0;}
+#endif /* ndef _SC_TZNAME_MAX */
+#ifdef _SC_JOB_CONTROL
+ if (x == _SC_JOB_CONTROL)
+ {*r = Mono_Posix_SysConf__SC_JOB_CONTROL; return 0;}
+#endif /* ndef _SC_JOB_CONTROL */
+#ifdef _SC_SAVED_IDS
+ if (x == _SC_SAVED_IDS)
+ {*r = Mono_Posix_SysConf__SC_SAVED_IDS; return 0;}
+#endif /* ndef _SC_SAVED_IDS */
+#ifdef _SC_REALTIME_SIGNALS
+ if (x == _SC_REALTIME_SIGNALS)
+ {*r = Mono_Posix_SysConf__SC_REALTIME_SIGNALS; return 0;}
+#endif /* ndef _SC_REALTIME_SIGNALS */
+#ifdef _SC_PRIORITY_SCHEDULING
+ if (x == _SC_PRIORITY_SCHEDULING)
+ {*r = Mono_Posix_SysConf__SC_PRIORITY_SCHEDULING; return 0;}
+#endif /* ndef _SC_PRIORITY_SCHEDULING */
+#ifdef _SC_TIMERS
+ if (x == _SC_TIMERS)
+ {*r = Mono_Posix_SysConf__SC_TIMERS; return 0;}
+#endif /* ndef _SC_TIMERS */
+#ifdef _SC_ASYNCHRONOUS_IO
+ if (x == _SC_ASYNCHRONOUS_IO)
+ {*r = Mono_Posix_SysConf__SC_ASYNCHRONOUS_IO; return 0;}
+#endif /* ndef _SC_ASYNCHRONOUS_IO */
+#ifdef _SC_PRIORITIZED_IO
+ if (x == _SC_PRIORITIZED_IO)
+ {*r = Mono_Posix_SysConf__SC_PRIORITIZED_IO; return 0;}
+#endif /* ndef _SC_PRIORITIZED_IO */
+#ifdef _SC_SYNCHRONIZED_IO
+ if (x == _SC_SYNCHRONIZED_IO)
+ {*r = Mono_Posix_SysConf__SC_SYNCHRONIZED_IO; return 0;}
+#endif /* ndef _SC_SYNCHRONIZED_IO */
+#ifdef _SC_FSYNC
+ if (x == _SC_FSYNC)
+ {*r = Mono_Posix_SysConf__SC_FSYNC; return 0;}
+#endif /* ndef _SC_FSYNC */
+#ifdef _SC_MAPPED_FILES
+ if (x == _SC_MAPPED_FILES)
+ {*r = Mono_Posix_SysConf__SC_MAPPED_FILES; return 0;}
+#endif /* ndef _SC_MAPPED_FILES */
+#ifdef _SC_MEMLOCK
+ if (x == _SC_MEMLOCK)
+ {*r = Mono_Posix_SysConf__SC_MEMLOCK; return 0;}
+#endif /* ndef _SC_MEMLOCK */
+#ifdef _SC_MEMLOCK_RANGE
+ if (x == _SC_MEMLOCK_RANGE)
+ {*r = Mono_Posix_SysConf__SC_MEMLOCK_RANGE; return 0;}
+#endif /* ndef _SC_MEMLOCK_RANGE */
+#ifdef _SC_MEMORY_PROTECTION
+ if (x == _SC_MEMORY_PROTECTION)
+ {*r = Mono_Posix_SysConf__SC_MEMORY_PROTECTION; return 0;}
+#endif /* ndef _SC_MEMORY_PROTECTION */
+#ifdef _SC_MESSAGE_PASSING
+ if (x == _SC_MESSAGE_PASSING)
+ {*r = Mono_Posix_SysConf__SC_MESSAGE_PASSING; return 0;}
+#endif /* ndef _SC_MESSAGE_PASSING */
+#ifdef _SC_SEMAPHORES
+ if (x == _SC_SEMAPHORES)
+ {*r = Mono_Posix_SysConf__SC_SEMAPHORES; return 0;}
+#endif /* ndef _SC_SEMAPHORES */
+#ifdef _SC_SHARED_MEMORY_OBJECTS
+ if (x == _SC_SHARED_MEMORY_OBJECTS)
+ {*r = Mono_Posix_SysConf__SC_SHARED_MEMORY_OBJECTS; return 0;}
+#endif /* ndef _SC_SHARED_MEMORY_OBJECTS */
+#ifdef _SC_AIO_LISTIO_MAX
+ if (x == _SC_AIO_LISTIO_MAX)
+ {*r = Mono_Posix_SysConf__SC_AIO_LISTIO_MAX; return 0;}
+#endif /* ndef _SC_AIO_LISTIO_MAX */
+#ifdef _SC_AIO_MAX
+ if (x == _SC_AIO_MAX)
+ {*r = Mono_Posix_SysConf__SC_AIO_MAX; return 0;}
+#endif /* ndef _SC_AIO_MAX */
+#ifdef _SC_AIO_PRIO_DELTA_MAX
+ if (x == _SC_AIO_PRIO_DELTA_MAX)
+ {*r = Mono_Posix_SysConf__SC_AIO_PRIO_DELTA_MAX; return 0;}
+#endif /* ndef _SC_AIO_PRIO_DELTA_MAX */
+#ifdef _SC_DELAYTIMER_MAX
+ if (x == _SC_DELAYTIMER_MAX)
+ {*r = Mono_Posix_SysConf__SC_DELAYTIMER_MAX; return 0;}
+#endif /* ndef _SC_DELAYTIMER_MAX */
+#ifdef _SC_MQ_OPEN_MAX
+ if (x == _SC_MQ_OPEN_MAX)
+ {*r = Mono_Posix_SysConf__SC_MQ_OPEN_MAX; return 0;}
+#endif /* ndef _SC_MQ_OPEN_MAX */
+#ifdef _SC_MQ_PRIO_MAX
+ if (x == _SC_MQ_PRIO_MAX)
+ {*r = Mono_Posix_SysConf__SC_MQ_PRIO_MAX; return 0;}
+#endif /* ndef _SC_MQ_PRIO_MAX */
+#ifdef _SC_VERSION
+ if (x == _SC_VERSION)
+ {*r = Mono_Posix_SysConf__SC_VERSION; return 0;}
+#endif /* ndef _SC_VERSION */
+#ifdef _SC_PAGESIZE
+ if (x == _SC_PAGESIZE)
+ {*r = Mono_Posix_SysConf__SC_PAGESIZE; return 0;}
+#endif /* ndef _SC_PAGESIZE */
+#ifdef _SC_RTSIG_MAX
+ if (x == _SC_RTSIG_MAX)
+ {*r = Mono_Posix_SysConf__SC_RTSIG_MAX; return 0;}
+#endif /* ndef _SC_RTSIG_MAX */
+#ifdef _SC_SEM_NSEMS_MAX
+ if (x == _SC_SEM_NSEMS_MAX)
+ {*r = Mono_Posix_SysConf__SC_SEM_NSEMS_MAX; return 0;}
+#endif /* ndef _SC_SEM_NSEMS_MAX */
+#ifdef _SC_SEM_VALUE_MAX
+ if (x == _SC_SEM_VALUE_MAX)
+ {*r = Mono_Posix_SysConf__SC_SEM_VALUE_MAX; return 0;}
+#endif /* ndef _SC_SEM_VALUE_MAX */
+#ifdef _SC_SIGQUEUE_MAX
+ if (x == _SC_SIGQUEUE_MAX)
+ {*r = Mono_Posix_SysConf__SC_SIGQUEUE_MAX; return 0;}
+#endif /* ndef _SC_SIGQUEUE_MAX */
+#ifdef _SC_TIMER_MAX
+ if (x == _SC_TIMER_MAX)
+ {*r = Mono_Posix_SysConf__SC_TIMER_MAX; return 0;}
+#endif /* ndef _SC_TIMER_MAX */
+#ifdef _SC_BC_BASE_MAX
+ if (x == _SC_BC_BASE_MAX)
+ {*r = Mono_Posix_SysConf__SC_BC_BASE_MAX; return 0;}
+#endif /* ndef _SC_BC_BASE_MAX */
+#ifdef _SC_BC_DIM_MAX
+ if (x == _SC_BC_DIM_MAX)
+ {*r = Mono_Posix_SysConf__SC_BC_DIM_MAX; return 0;}
+#endif /* ndef _SC_BC_DIM_MAX */
+#ifdef _SC_BC_SCALE_MAX
+ if (x == _SC_BC_SCALE_MAX)
+ {*r = Mono_Posix_SysConf__SC_BC_SCALE_MAX; return 0;}
+#endif /* ndef _SC_BC_SCALE_MAX */
+#ifdef _SC_BC_STRING_MAX
+ if (x == _SC_BC_STRING_MAX)
+ {*r = Mono_Posix_SysConf__SC_BC_STRING_MAX; return 0;}
+#endif /* ndef _SC_BC_STRING_MAX */
+#ifdef _SC_COLL_WEIGHTS_MAX
+ if (x == _SC_COLL_WEIGHTS_MAX)
+ {*r = Mono_Posix_SysConf__SC_COLL_WEIGHTS_MAX; return 0;}
+#endif /* ndef _SC_COLL_WEIGHTS_MAX */
+#ifdef _SC_EQUIV_CLASS_MAX
+ if (x == _SC_EQUIV_CLASS_MAX)
+ {*r = Mono_Posix_SysConf__SC_EQUIV_CLASS_MAX; return 0;}
+#endif /* ndef _SC_EQUIV_CLASS_MAX */
+#ifdef _SC_EXPR_NEST_MAX
+ if (x == _SC_EXPR_NEST_MAX)
+ {*r = Mono_Posix_SysConf__SC_EXPR_NEST_MAX; return 0;}
+#endif /* ndef _SC_EXPR_NEST_MAX */
+#ifdef _SC_LINE_MAX
+ if (x == _SC_LINE_MAX)
+ {*r = Mono_Posix_SysConf__SC_LINE_MAX; return 0;}
+#endif /* ndef _SC_LINE_MAX */
+#ifdef _SC_RE_DUP_MAX
+ if (x == _SC_RE_DUP_MAX)
+ {*r = Mono_Posix_SysConf__SC_RE_DUP_MAX; return 0;}
+#endif /* ndef _SC_RE_DUP_MAX */
+#ifdef _SC_CHARCLASS_NAME_MAX
+ if (x == _SC_CHARCLASS_NAME_MAX)
+ {*r = Mono_Posix_SysConf__SC_CHARCLASS_NAME_MAX; return 0;}
+#endif /* ndef _SC_CHARCLASS_NAME_MAX */
+#ifdef _SC_2_VERSION
+ if (x == _SC_2_VERSION)
+ {*r = Mono_Posix_SysConf__SC_2_VERSION; return 0;}
+#endif /* ndef _SC_2_VERSION */
+#ifdef _SC_2_C_BIND
+ if (x == _SC_2_C_BIND)
+ {*r = Mono_Posix_SysConf__SC_2_C_BIND; return 0;}
+#endif /* ndef _SC_2_C_BIND */
+#ifdef _SC_2_C_DEV
+ if (x == _SC_2_C_DEV)
+ {*r = Mono_Posix_SysConf__SC_2_C_DEV; return 0;}
+#endif /* ndef _SC_2_C_DEV */
+#ifdef _SC_2_FORT_DEV
+ if (x == _SC_2_FORT_DEV)
+ {*r = Mono_Posix_SysConf__SC_2_FORT_DEV; return 0;}
+#endif /* ndef _SC_2_FORT_DEV */
+#ifdef _SC_2_FORT_RUN
+ if (x == _SC_2_FORT_RUN)
+ {*r = Mono_Posix_SysConf__SC_2_FORT_RUN; return 0;}
+#endif /* ndef _SC_2_FORT_RUN */
+#ifdef _SC_2_SW_DEV
+ if (x == _SC_2_SW_DEV)
+ {*r = Mono_Posix_SysConf__SC_2_SW_DEV; return 0;}
+#endif /* ndef _SC_2_SW_DEV */
+#ifdef _SC_2_LOCALEDEF
+ if (x == _SC_2_LOCALEDEF)
+ {*r = Mono_Posix_SysConf__SC_2_LOCALEDEF; return 0;}
+#endif /* ndef _SC_2_LOCALEDEF */
+#ifdef _SC_PII
+ if (x == _SC_PII)
+ {*r = Mono_Posix_SysConf__SC_PII; return 0;}
+#endif /* ndef _SC_PII */
+#ifdef _SC_PII_XTI
+ if (x == _SC_PII_XTI)
+ {*r = Mono_Posix_SysConf__SC_PII_XTI; return 0;}
+#endif /* ndef _SC_PII_XTI */
+#ifdef _SC_PII_SOCKET
+ if (x == _SC_PII_SOCKET)
+ {*r = Mono_Posix_SysConf__SC_PII_SOCKET; return 0;}
+#endif /* ndef _SC_PII_SOCKET */
+#ifdef _SC_PII_INTERNET
+ if (x == _SC_PII_INTERNET)
+ {*r = Mono_Posix_SysConf__SC_PII_INTERNET; return 0;}
+#endif /* ndef _SC_PII_INTERNET */
+#ifdef _SC_PII_OSI
+ if (x == _SC_PII_OSI)
+ {*r = Mono_Posix_SysConf__SC_PII_OSI; return 0;}
+#endif /* ndef _SC_PII_OSI */
+#ifdef _SC_POLL
+ if (x == _SC_POLL)
+ {*r = Mono_Posix_SysConf__SC_POLL; return 0;}
+#endif /* ndef _SC_POLL */
+#ifdef _SC_SELECT
+ if (x == _SC_SELECT)
+ {*r = Mono_Posix_SysConf__SC_SELECT; return 0;}
+#endif /* ndef _SC_SELECT */
+#ifdef _SC_UIO_MAXIOV
+ if (x == _SC_UIO_MAXIOV)
+ {*r = Mono_Posix_SysConf__SC_UIO_MAXIOV; return 0;}
+#endif /* ndef _SC_UIO_MAXIOV */
+#ifdef _SC_IOV_MAX
+ if (x == _SC_IOV_MAX)
+ {*r = Mono_Posix_SysConf__SC_IOV_MAX; return 0;}
+#endif /* ndef _SC_IOV_MAX */
+#ifdef _SC_PII_INTERNET_STREAM
+ if (x == _SC_PII_INTERNET_STREAM)
+ {*r = Mono_Posix_SysConf__SC_PII_INTERNET_STREAM; return 0;}
+#endif /* ndef _SC_PII_INTERNET_STREAM */
+#ifdef _SC_PII_INTERNET_DGRAM
+ if (x == _SC_PII_INTERNET_DGRAM)
+ {*r = Mono_Posix_SysConf__SC_PII_INTERNET_DGRAM; return 0;}
+#endif /* ndef _SC_PII_INTERNET_DGRAM */
+#ifdef _SC_PII_OSI_COTS
+ if (x == _SC_PII_OSI_COTS)
+ {*r = Mono_Posix_SysConf__SC_PII_OSI_COTS; return 0;}
+#endif /* ndef _SC_PII_OSI_COTS */
+#ifdef _SC_PII_OSI_CLTS
+ if (x == _SC_PII_OSI_CLTS)
+ {*r = Mono_Posix_SysConf__SC_PII_OSI_CLTS; return 0;}
+#endif /* ndef _SC_PII_OSI_CLTS */
+#ifdef _SC_PII_OSI_M
+ if (x == _SC_PII_OSI_M)
+ {*r = Mono_Posix_SysConf__SC_PII_OSI_M; return 0;}
+#endif /* ndef _SC_PII_OSI_M */
+#ifdef _SC_T_IOV_MAX
+ if (x == _SC_T_IOV_MAX)
+ {*r = Mono_Posix_SysConf__SC_T_IOV_MAX; return 0;}
+#endif /* ndef _SC_T_IOV_MAX */
+#ifdef _SC_THREADS
+ if (x == _SC_THREADS)
+ {*r = Mono_Posix_SysConf__SC_THREADS; return 0;}
+#endif /* ndef _SC_THREADS */
+#ifdef _SC_THREAD_SAFE_FUNCTIONS
+ if (x == _SC_THREAD_SAFE_FUNCTIONS)
+ {*r = Mono_Posix_SysConf__SC_THREAD_SAFE_FUNCTIONS; return 0;}
+#endif /* ndef _SC_THREAD_SAFE_FUNCTIONS */
+#ifdef _SC_GETGR_R_SIZE_MAX
+ if (x == _SC_GETGR_R_SIZE_MAX)
+ {*r = Mono_Posix_SysConf__SC_GETGR_R_SIZE_MAX; return 0;}
+#endif /* ndef _SC_GETGR_R_SIZE_MAX */
+#ifdef _SC_GETPW_R_SIZE_MAX
+ if (x == _SC_GETPW_R_SIZE_MAX)
+ {*r = Mono_Posix_SysConf__SC_GETPW_R_SIZE_MAX; return 0;}
+#endif /* ndef _SC_GETPW_R_SIZE_MAX */
+#ifdef _SC_LOGIN_NAME_MAX
+ if (x == _SC_LOGIN_NAME_MAX)
+ {*r = Mono_Posix_SysConf__SC_LOGIN_NAME_MAX; return 0;}
+#endif /* ndef _SC_LOGIN_NAME_MAX */
+#ifdef _SC_TTY_NAME_MAX
+ if (x == _SC_TTY_NAME_MAX)
+ {*r = Mono_Posix_SysConf__SC_TTY_NAME_MAX; return 0;}
+#endif /* ndef _SC_TTY_NAME_MAX */
+#ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
+ if (x == _SC_THREAD_DESTRUCTOR_ITERATIONS)
+ {*r = Mono_Posix_SysConf__SC_THREAD_DESTRUCTOR_ITERATIONS; return 0;}
+#endif /* ndef _SC_THREAD_DESTRUCTOR_ITERATIONS */
+#ifdef _SC_THREAD_KEYS_MAX
+ if (x == _SC_THREAD_KEYS_MAX)
+ {*r = Mono_Posix_SysConf__SC_THREAD_KEYS_MAX; return 0;}
+#endif /* ndef _SC_THREAD_KEYS_MAX */
+#ifdef _SC_THREAD_STACK_MIN
+ if (x == _SC_THREAD_STACK_MIN)
+ {*r = Mono_Posix_SysConf__SC_THREAD_STACK_MIN; return 0;}
+#endif /* ndef _SC_THREAD_STACK_MIN */
+#ifdef _SC_THREAD_THREADS_MAX
+ if (x == _SC_THREAD_THREADS_MAX)
+ {*r = Mono_Posix_SysConf__SC_THREAD_THREADS_MAX; return 0;}
+#endif /* ndef _SC_THREAD_THREADS_MAX */
+#ifdef _SC_THREAD_ATTR_STACKADDR
+ if (x == _SC_THREAD_ATTR_STACKADDR)
+ {*r = Mono_Posix_SysConf__SC_THREAD_ATTR_STACKADDR; return 0;}
+#endif /* ndef _SC_THREAD_ATTR_STACKADDR */
+#ifdef _SC_THREAD_ATTR_STACKSIZE
+ if (x == _SC_THREAD_ATTR_STACKSIZE)
+ {*r = Mono_Posix_SysConf__SC_THREAD_ATTR_STACKSIZE; return 0;}
+#endif /* ndef _SC_THREAD_ATTR_STACKSIZE */
+#ifdef _SC_THREAD_PRIORITY_SCHEDULING
+ if (x == _SC_THREAD_PRIORITY_SCHEDULING)
+ {*r = Mono_Posix_SysConf__SC_THREAD_PRIORITY_SCHEDULING; return 0;}
+#endif /* ndef _SC_THREAD_PRIORITY_SCHEDULING */
+#ifdef _SC_THREAD_PRIO_INHERIT
+ if (x == _SC_THREAD_PRIO_INHERIT)
+ {*r = Mono_Posix_SysConf__SC_THREAD_PRIO_INHERIT; return 0;}
+#endif /* ndef _SC_THREAD_PRIO_INHERIT */
+#ifdef _SC_THREAD_PRIO_PROTECT
+ if (x == _SC_THREAD_PRIO_PROTECT)
+ {*r = Mono_Posix_SysConf__SC_THREAD_PRIO_PROTECT; return 0;}
+#endif /* ndef _SC_THREAD_PRIO_PROTECT */
+#ifdef _SC_THREAD_PROCESS_SHARED
+ if (x == _SC_THREAD_PROCESS_SHARED)
+ {*r = Mono_Posix_SysConf__SC_THREAD_PROCESS_SHARED; return 0;}
+#endif /* ndef _SC_THREAD_PROCESS_SHARED */
+#ifdef _SC_NPROCESSORS_CONF
+ if (x == _SC_NPROCESSORS_CONF)
+ {*r = Mono_Posix_SysConf__SC_NPROCESSORS_CONF; return 0;}
+#endif /* ndef _SC_NPROCESSORS_CONF */
+#ifdef _SC_NPROCESSORS_ONLN
+ if (x == _SC_NPROCESSORS_ONLN)
+ {*r = Mono_Posix_SysConf__SC_NPROCESSORS_ONLN; return 0;}
+#endif /* ndef _SC_NPROCESSORS_ONLN */
+#ifdef _SC_PHYS_PAGES
+ if (x == _SC_PHYS_PAGES)
+ {*r = Mono_Posix_SysConf__SC_PHYS_PAGES; return 0;}
+#endif /* ndef _SC_PHYS_PAGES */
+#ifdef _SC_AVPHYS_PAGES
+ if (x == _SC_AVPHYS_PAGES)
+ {*r = Mono_Posix_SysConf__SC_AVPHYS_PAGES; return 0;}
+#endif /* ndef _SC_AVPHYS_PAGES */
+#ifdef _SC_ATEXIT_MAX
+ if (x == _SC_ATEXIT_MAX)
+ {*r = Mono_Posix_SysConf__SC_ATEXIT_MAX; return 0;}
+#endif /* ndef _SC_ATEXIT_MAX */
+#ifdef _SC_PASS_MAX
+ if (x == _SC_PASS_MAX)
+ {*r = Mono_Posix_SysConf__SC_PASS_MAX; return 0;}
+#endif /* ndef _SC_PASS_MAX */
+#ifdef _SC_XOPEN_VERSION
+ if (x == _SC_XOPEN_VERSION)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_VERSION; return 0;}
+#endif /* ndef _SC_XOPEN_VERSION */
+#ifdef _SC_XOPEN_XCU_VERSION
+ if (x == _SC_XOPEN_XCU_VERSION)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_XCU_VERSION; return 0;}
+#endif /* ndef _SC_XOPEN_XCU_VERSION */
+#ifdef _SC_XOPEN_UNIX
+ if (x == _SC_XOPEN_UNIX)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_UNIX; return 0;}
+#endif /* ndef _SC_XOPEN_UNIX */
+#ifdef _SC_XOPEN_CRYPT
+ if (x == _SC_XOPEN_CRYPT)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_CRYPT; return 0;}
+#endif /* ndef _SC_XOPEN_CRYPT */
+#ifdef _SC_XOPEN_ENH_I18N
+ if (x == _SC_XOPEN_ENH_I18N)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_ENH_I18N; return 0;}
+#endif /* ndef _SC_XOPEN_ENH_I18N */
+#ifdef _SC_XOPEN_SHM
+ if (x == _SC_XOPEN_SHM)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_SHM; return 0;}
+#endif /* ndef _SC_XOPEN_SHM */
+#ifdef _SC_2_CHAR_TERM
+ if (x == _SC_2_CHAR_TERM)
+ {*r = Mono_Posix_SysConf__SC_2_CHAR_TERM; return 0;}
+#endif /* ndef _SC_2_CHAR_TERM */
+#ifdef _SC_2_C_VERSION
+ if (x == _SC_2_C_VERSION)
+ {*r = Mono_Posix_SysConf__SC_2_C_VERSION; return 0;}
+#endif /* ndef _SC_2_C_VERSION */
+#ifdef _SC_2_UPE
+ if (x == _SC_2_UPE)
+ {*r = Mono_Posix_SysConf__SC_2_UPE; return 0;}
+#endif /* ndef _SC_2_UPE */
+#ifdef _SC_XOPEN_XPG2
+ if (x == _SC_XOPEN_XPG2)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_XPG2; return 0;}
+#endif /* ndef _SC_XOPEN_XPG2 */
+#ifdef _SC_XOPEN_XPG3
+ if (x == _SC_XOPEN_XPG3)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_XPG3; return 0;}
+#endif /* ndef _SC_XOPEN_XPG3 */
+#ifdef _SC_XOPEN_XPG4
+ if (x == _SC_XOPEN_XPG4)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_XPG4; return 0;}
+#endif /* ndef _SC_XOPEN_XPG4 */
+#ifdef _SC_CHAR_BIT
+ if (x == _SC_CHAR_BIT)
+ {*r = Mono_Posix_SysConf__SC_CHAR_BIT; return 0;}
+#endif /* ndef _SC_CHAR_BIT */
+#ifdef _SC_CHAR_MAX
+ if (x == _SC_CHAR_MAX)
+ {*r = Mono_Posix_SysConf__SC_CHAR_MAX; return 0;}
+#endif /* ndef _SC_CHAR_MAX */
+#ifdef _SC_CHAR_MIN
+ if (x == _SC_CHAR_MIN)
+ {*r = Mono_Posix_SysConf__SC_CHAR_MIN; return 0;}
+#endif /* ndef _SC_CHAR_MIN */
+#ifdef _SC_INT_MAX
+ if (x == _SC_INT_MAX)
+ {*r = Mono_Posix_SysConf__SC_INT_MAX; return 0;}
+#endif /* ndef _SC_INT_MAX */
+#ifdef _SC_INT_MIN
+ if (x == _SC_INT_MIN)
+ {*r = Mono_Posix_SysConf__SC_INT_MIN; return 0;}
+#endif /* ndef _SC_INT_MIN */
+#ifdef _SC_LONG_BIT
+ if (x == _SC_LONG_BIT)
+ {*r = Mono_Posix_SysConf__SC_LONG_BIT; return 0;}
+#endif /* ndef _SC_LONG_BIT */
+#ifdef _SC_WORD_BIT
+ if (x == _SC_WORD_BIT)
+ {*r = Mono_Posix_SysConf__SC_WORD_BIT; return 0;}
+#endif /* ndef _SC_WORD_BIT */
+#ifdef _SC_MB_LEN_MAX
+ if (x == _SC_MB_LEN_MAX)
+ {*r = Mono_Posix_SysConf__SC_MB_LEN_MAX; return 0;}
+#endif /* ndef _SC_MB_LEN_MAX */
+#ifdef _SC_NZERO
+ if (x == _SC_NZERO)
+ {*r = Mono_Posix_SysConf__SC_NZERO; return 0;}
+#endif /* ndef _SC_NZERO */
+#ifdef _SC_SSIZE_MAX
+ if (x == _SC_SSIZE_MAX)
+ {*r = Mono_Posix_SysConf__SC_SSIZE_MAX; return 0;}
+#endif /* ndef _SC_SSIZE_MAX */
+#ifdef _SC_SCHAR_MAX
+ if (x == _SC_SCHAR_MAX)
+ {*r = Mono_Posix_SysConf__SC_SCHAR_MAX; return 0;}
+#endif /* ndef _SC_SCHAR_MAX */
+#ifdef _SC_SCHAR_MIN
+ if (x == _SC_SCHAR_MIN)
+ {*r = Mono_Posix_SysConf__SC_SCHAR_MIN; return 0;}
+#endif /* ndef _SC_SCHAR_MIN */
+#ifdef _SC_SHRT_MAX
+ if (x == _SC_SHRT_MAX)
+ {*r = Mono_Posix_SysConf__SC_SHRT_MAX; return 0;}
+#endif /* ndef _SC_SHRT_MAX */
+#ifdef _SC_SHRT_MIN
+ if (x == _SC_SHRT_MIN)
+ {*r = Mono_Posix_SysConf__SC_SHRT_MIN; return 0;}
+#endif /* ndef _SC_SHRT_MIN */
+#ifdef _SC_UCHAR_MAX
+ if (x == _SC_UCHAR_MAX)
+ {*r = Mono_Posix_SysConf__SC_UCHAR_MAX; return 0;}
+#endif /* ndef _SC_UCHAR_MAX */
+#ifdef _SC_UINT_MAX
+ if (x == _SC_UINT_MAX)
+ {*r = Mono_Posix_SysConf__SC_UINT_MAX; return 0;}
+#endif /* ndef _SC_UINT_MAX */
+#ifdef _SC_ULONG_MAX
+ if (x == _SC_ULONG_MAX)
+ {*r = Mono_Posix_SysConf__SC_ULONG_MAX; return 0;}
+#endif /* ndef _SC_ULONG_MAX */
+#ifdef _SC_USHRT_MAX
+ if (x == _SC_USHRT_MAX)
+ {*r = Mono_Posix_SysConf__SC_USHRT_MAX; return 0;}
+#endif /* ndef _SC_USHRT_MAX */
+#ifdef _SC_NL_ARGMAX
+ if (x == _SC_NL_ARGMAX)
+ {*r = Mono_Posix_SysConf__SC_NL_ARGMAX; return 0;}
+#endif /* ndef _SC_NL_ARGMAX */
+#ifdef _SC_NL_LANGMAX
+ if (x == _SC_NL_LANGMAX)
+ {*r = Mono_Posix_SysConf__SC_NL_LANGMAX; return 0;}
+#endif /* ndef _SC_NL_LANGMAX */
+#ifdef _SC_NL_MSGMAX
+ if (x == _SC_NL_MSGMAX)
+ {*r = Mono_Posix_SysConf__SC_NL_MSGMAX; return 0;}
+#endif /* ndef _SC_NL_MSGMAX */
+#ifdef _SC_NL_NMAX
+ if (x == _SC_NL_NMAX)
+ {*r = Mono_Posix_SysConf__SC_NL_NMAX; return 0;}
+#endif /* ndef _SC_NL_NMAX */
+#ifdef _SC_NL_SETMAX
+ if (x == _SC_NL_SETMAX)
+ {*r = Mono_Posix_SysConf__SC_NL_SETMAX; return 0;}
+#endif /* ndef _SC_NL_SETMAX */
+#ifdef _SC_NL_TEXTMAX
+ if (x == _SC_NL_TEXTMAX)
+ {*r = Mono_Posix_SysConf__SC_NL_TEXTMAX; return 0;}
+#endif /* ndef _SC_NL_TEXTMAX */
+#ifdef _SC_XBS5_ILP32_OFF32
+ if (x == _SC_XBS5_ILP32_OFF32)
+ {*r = Mono_Posix_SysConf__SC_XBS5_ILP32_OFF32; return 0;}
+#endif /* ndef _SC_XBS5_ILP32_OFF32 */
+#ifdef _SC_XBS5_ILP32_OFFBIG
+ if (x == _SC_XBS5_ILP32_OFFBIG)
+ {*r = Mono_Posix_SysConf__SC_XBS5_ILP32_OFFBIG; return 0;}
+#endif /* ndef _SC_XBS5_ILP32_OFFBIG */
+#ifdef _SC_XBS5_LP64_OFF64
+ if (x == _SC_XBS5_LP64_OFF64)
+ {*r = Mono_Posix_SysConf__SC_XBS5_LP64_OFF64; return 0;}
+#endif /* ndef _SC_XBS5_LP64_OFF64 */
+#ifdef _SC_XBS5_LPBIG_OFFBIG
+ if (x == _SC_XBS5_LPBIG_OFFBIG)
+ {*r = Mono_Posix_SysConf__SC_XBS5_LPBIG_OFFBIG; return 0;}
+#endif /* ndef _SC_XBS5_LPBIG_OFFBIG */
+#ifdef _SC_XOPEN_LEGACY
+ if (x == _SC_XOPEN_LEGACY)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_LEGACY; return 0;}
+#endif /* ndef _SC_XOPEN_LEGACY */
+#ifdef _SC_XOPEN_REALTIME
+ if (x == _SC_XOPEN_REALTIME)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_REALTIME; return 0;}
+#endif /* ndef _SC_XOPEN_REALTIME */
+#ifdef _SC_XOPEN_REALTIME_THREADS
+ if (x == _SC_XOPEN_REALTIME_THREADS)
+ {*r = Mono_Posix_SysConf__SC_XOPEN_REALTIME_THREADS; return 0;}
+#endif /* ndef _SC_XOPEN_REALTIME_THREADS */
+#ifdef _SC_ADVISORY_INFO
+ if (x == _SC_ADVISORY_INFO)
+ {*r = Mono_Posix_SysConf__SC_ADVISORY_INFO; return 0;}
+#endif /* ndef _SC_ADVISORY_INFO */
+#ifdef _SC_BARRIERS
+ if (x == _SC_BARRIERS)
+ {*r = Mono_Posix_SysConf__SC_BARRIERS; return 0;}
+#endif /* ndef _SC_BARRIERS */
+#ifdef _SC_BASE
+ if (x == _SC_BASE)
+ {*r = Mono_Posix_SysConf__SC_BASE; return 0;}
+#endif /* ndef _SC_BASE */
+#ifdef _SC_C_LANG_SUPPORT
+ if (x == _SC_C_LANG_SUPPORT)
+ {*r = Mono_Posix_SysConf__SC_C_LANG_SUPPORT; return 0;}
+#endif /* ndef _SC_C_LANG_SUPPORT */
+#ifdef _SC_C_LANG_SUPPORT_R
+ if (x == _SC_C_LANG_SUPPORT_R)
+ {*r = Mono_Posix_SysConf__SC_C_LANG_SUPPORT_R; return 0;}
+#endif /* ndef _SC_C_LANG_SUPPORT_R */
+#ifdef _SC_CLOCK_SELECTION
+ if (x == _SC_CLOCK_SELECTION)
+ {*r = Mono_Posix_SysConf__SC_CLOCK_SELECTION; return 0;}
+#endif /* ndef _SC_CLOCK_SELECTION */
+#ifdef _SC_CPUTIME
+ if (x == _SC_CPUTIME)
+ {*r = Mono_Posix_SysConf__SC_CPUTIME; return 0;}
+#endif /* ndef _SC_CPUTIME */
+#ifdef _SC_THREAD_CPUTIME
+ if (x == _SC_THREAD_CPUTIME)
+ {*r = Mono_Posix_SysConf__SC_THREAD_CPUTIME; return 0;}
+#endif /* ndef _SC_THREAD_CPUTIME */
+#ifdef _SC_DEVICE_IO
+ if (x == _SC_DEVICE_IO)
+ {*r = Mono_Posix_SysConf__SC_DEVICE_IO; return 0;}
+#endif /* ndef _SC_DEVICE_IO */
+#ifdef _SC_DEVICE_SPECIFIC
+ if (x == _SC_DEVICE_SPECIFIC)
+ {*r = Mono_Posix_SysConf__SC_DEVICE_SPECIFIC; return 0;}
+#endif /* ndef _SC_DEVICE_SPECIFIC */
+#ifdef _SC_DEVICE_SPECIFIC_R
+ if (x == _SC_DEVICE_SPECIFIC_R)
+ {*r = Mono_Posix_SysConf__SC_DEVICE_SPECIFIC_R; return 0;}
+#endif /* ndef _SC_DEVICE_SPECIFIC_R */
+#ifdef _SC_FD_MGMT
+ if (x == _SC_FD_MGMT)
+ {*r = Mono_Posix_SysConf__SC_FD_MGMT; return 0;}
+#endif /* ndef _SC_FD_MGMT */
+#ifdef _SC_FIFO
+ if (x == _SC_FIFO)
+ {*r = Mono_Posix_SysConf__SC_FIFO; return 0;}
+#endif /* ndef _SC_FIFO */
+#ifdef _SC_PIPE
+ if (x == _SC_PIPE)
+ {*r = Mono_Posix_SysConf__SC_PIPE; return 0;}
+#endif /* ndef _SC_PIPE */
+#ifdef _SC_FILE_ATTRIBUTES
+ if (x == _SC_FILE_ATTRIBUTES)
+ {*r = Mono_Posix_SysConf__SC_FILE_ATTRIBUTES; return 0;}
+#endif /* ndef _SC_FILE_ATTRIBUTES */
+#ifdef _SC_FILE_LOCKING
+ if (x == _SC_FILE_LOCKING)
+ {*r = Mono_Posix_SysConf__SC_FILE_LOCKING; return 0;}
+#endif /* ndef _SC_FILE_LOCKING */
+#ifdef _SC_FILE_SYSTEM
+ if (x == _SC_FILE_SYSTEM)
+ {*r = Mono_Posix_SysConf__SC_FILE_SYSTEM; return 0;}
+#endif /* ndef _SC_FILE_SYSTEM */
+#ifdef _SC_MONOTONIC_CLOCK
+ if (x == _SC_MONOTONIC_CLOCK)
+ {*r = Mono_Posix_SysConf__SC_MONOTONIC_CLOCK; return 0;}
+#endif /* ndef _SC_MONOTONIC_CLOCK */
+#ifdef _SC_MULTI_PROCESS
+ if (x == _SC_MULTI_PROCESS)
+ {*r = Mono_Posix_SysConf__SC_MULTI_PROCESS; return 0;}
+#endif /* ndef _SC_MULTI_PROCESS */
+#ifdef _SC_SINGLE_PROCESS
+ if (x == _SC_SINGLE_PROCESS)
+ {*r = Mono_Posix_SysConf__SC_SINGLE_PROCESS; return 0;}
+#endif /* ndef _SC_SINGLE_PROCESS */
+#ifdef _SC_NETWORKING
+ if (x == _SC_NETWORKING)
+ {*r = Mono_Posix_SysConf__SC_NETWORKING; return 0;}
+#endif /* ndef _SC_NETWORKING */
+#ifdef _SC_READER_WRITER_LOCKS
+ if (x == _SC_READER_WRITER_LOCKS)
+ {*r = Mono_Posix_SysConf__SC_READER_WRITER_LOCKS; return 0;}
+#endif /* ndef _SC_READER_WRITER_LOCKS */
+#ifdef _SC_SPIN_LOCKS
+ if (x == _SC_SPIN_LOCKS)
+ {*r = Mono_Posix_SysConf__SC_SPIN_LOCKS; return 0;}
+#endif /* ndef _SC_SPIN_LOCKS */
+#ifdef _SC_REGEXP
+ if (x == _SC_REGEXP)
+ {*r = Mono_Posix_SysConf__SC_REGEXP; return 0;}
+#endif /* ndef _SC_REGEXP */
+#ifdef _SC_REGEX_VERSION
+ if (x == _SC_REGEX_VERSION)
+ {*r = Mono_Posix_SysConf__SC_REGEX_VERSION; return 0;}
+#endif /* ndef _SC_REGEX_VERSION */
+#ifdef _SC_SHELL
+ if (x == _SC_SHELL)
+ {*r = Mono_Posix_SysConf__SC_SHELL; return 0;}
+#endif /* ndef _SC_SHELL */
+#ifdef _SC_SIGNALS
+ if (x == _SC_SIGNALS)
+ {*r = Mono_Posix_SysConf__SC_SIGNALS; return 0;}
+#endif /* ndef _SC_SIGNALS */
+#ifdef _SC_SPAWN
+ if (x == _SC_SPAWN)
+ {*r = Mono_Posix_SysConf__SC_SPAWN; return 0;}
+#endif /* ndef _SC_SPAWN */
+#ifdef _SC_SPORADIC_SERVER
+ if (x == _SC_SPORADIC_SERVER)
+ {*r = Mono_Posix_SysConf__SC_SPORADIC_SERVER; return 0;}
+#endif /* ndef _SC_SPORADIC_SERVER */
+#ifdef _SC_THREAD_SPORADIC_SERVER
+ if (x == _SC_THREAD_SPORADIC_SERVER)
+ {*r = Mono_Posix_SysConf__SC_THREAD_SPORADIC_SERVER; return 0;}
+#endif /* ndef _SC_THREAD_SPORADIC_SERVER */
+#ifdef _SC_SYSTEM_DATABASE
+ if (x == _SC_SYSTEM_DATABASE)
+ {*r = Mono_Posix_SysConf__SC_SYSTEM_DATABASE; return 0;}
+#endif /* ndef _SC_SYSTEM_DATABASE */
+#ifdef _SC_SYSTEM_DATABASE_R
+ if (x == _SC_SYSTEM_DATABASE_R)
+ {*r = Mono_Posix_SysConf__SC_SYSTEM_DATABASE_R; return 0;}
+#endif /* ndef _SC_SYSTEM_DATABASE_R */
+#ifdef _SC_TIMEOUTS
+ if (x == _SC_TIMEOUTS)
+ {*r = Mono_Posix_SysConf__SC_TIMEOUTS; return 0;}
+#endif /* ndef _SC_TIMEOUTS */
+#ifdef _SC_TYPED_MEMORY_OBJECTS
+ if (x == _SC_TYPED_MEMORY_OBJECTS)
+ {*r = Mono_Posix_SysConf__SC_TYPED_MEMORY_OBJECTS; return 0;}
+#endif /* ndef _SC_TYPED_MEMORY_OBJECTS */
+#ifdef _SC_USER_GROUPS
+ if (x == _SC_USER_GROUPS)
+ {*r = Mono_Posix_SysConf__SC_USER_GROUPS; return 0;}
+#endif /* ndef _SC_USER_GROUPS */
+#ifdef _SC_USER_GROUPS_R
+ if (x == _SC_USER_GROUPS_R)
+ {*r = Mono_Posix_SysConf__SC_USER_GROUPS_R; return 0;}
+#endif /* ndef _SC_USER_GROUPS_R */
+#ifdef _SC_2_PBS
+ if (x == _SC_2_PBS)
+ {*r = Mono_Posix_SysConf__SC_2_PBS; return 0;}
+#endif /* ndef _SC_2_PBS */
+#ifdef _SC_2_PBS_ACCOUNTING
+ if (x == _SC_2_PBS_ACCOUNTING)
+ {*r = Mono_Posix_SysConf__SC_2_PBS_ACCOUNTING; return 0;}
+#endif /* ndef _SC_2_PBS_ACCOUNTING */
+#ifdef _SC_2_PBS_LOCATE
+ if (x == _SC_2_PBS_LOCATE)
+ {*r = Mono_Posix_SysConf__SC_2_PBS_LOCATE; return 0;}
+#endif /* ndef _SC_2_PBS_LOCATE */
+#ifdef _SC_2_PBS_MESSAGE
+ if (x == _SC_2_PBS_MESSAGE)
+ {*r = Mono_Posix_SysConf__SC_2_PBS_MESSAGE; return 0;}
+#endif /* ndef _SC_2_PBS_MESSAGE */
+#ifdef _SC_2_PBS_TRACK
+ if (x == _SC_2_PBS_TRACK)
+ {*r = Mono_Posix_SysConf__SC_2_PBS_TRACK; return 0;}
+#endif /* ndef _SC_2_PBS_TRACK */
+#ifdef _SC_SYMLOOP_MAX
+ if (x == _SC_SYMLOOP_MAX)
+ {*r = Mono_Posix_SysConf__SC_SYMLOOP_MAX; return 0;}
+#endif /* ndef _SC_SYMLOOP_MAX */
+#ifdef _SC_STREAMS
+ if (x == _SC_STREAMS)
+ {*r = Mono_Posix_SysConf__SC_STREAMS; return 0;}
+#endif /* ndef _SC_STREAMS */
+#ifdef _SC_2_PBS_CHECKPOINT
+ if (x == _SC_2_PBS_CHECKPOINT)
+ {*r = Mono_Posix_SysConf__SC_2_PBS_CHECKPOINT; return 0;}
+#endif /* ndef _SC_2_PBS_CHECKPOINT */
+#ifdef _SC_V6_ILP32_OFF32
+ if (x == _SC_V6_ILP32_OFF32)
+ {*r = Mono_Posix_SysConf__SC_V6_ILP32_OFF32; return 0;}
+#endif /* ndef _SC_V6_ILP32_OFF32 */
+#ifdef _SC_V6_ILP32_OFFBIG
+ if (x == _SC_V6_ILP32_OFFBIG)
+ {*r = Mono_Posix_SysConf__SC_V6_ILP32_OFFBIG; return 0;}
+#endif /* ndef _SC_V6_ILP32_OFFBIG */
+#ifdef _SC_V6_LP64_OFF64
+ if (x == _SC_V6_LP64_OFF64)
+ {*r = Mono_Posix_SysConf__SC_V6_LP64_OFF64; return 0;}
+#endif /* ndef _SC_V6_LP64_OFF64 */
+#ifdef _SC_V6_LPBIG_OFFBIG
+ if (x == _SC_V6_LPBIG_OFFBIG)
+ {*r = Mono_Posix_SysConf__SC_V6_LPBIG_OFFBIG; return 0;}
+#endif /* ndef _SC_V6_LPBIG_OFFBIG */
+#ifdef _SC_HOST_NAME_MAX
+ if (x == _SC_HOST_NAME_MAX)
+ {*r = Mono_Posix_SysConf__SC_HOST_NAME_MAX; return 0;}
+#endif /* ndef _SC_HOST_NAME_MAX */
+#ifdef _SC_TRACE
+ if (x == _SC_TRACE)
+ {*r = Mono_Posix_SysConf__SC_TRACE; return 0;}
+#endif /* ndef _SC_TRACE */
+#ifdef _SC_TRACE_EVENT_FILTER
+ if (x == _SC_TRACE_EVENT_FILTER)
+ {*r = Mono_Posix_SysConf__SC_TRACE_EVENT_FILTER; return 0;}
+#endif /* ndef _SC_TRACE_EVENT_FILTER */
+#ifdef _SC_TRACE_INHERIT
+ if (x == _SC_TRACE_INHERIT)
+ {*r = Mono_Posix_SysConf__SC_TRACE_INHERIT; return 0;}
+#endif /* ndef _SC_TRACE_INHERIT */
+#ifdef _SC_TRACE_LOG
+ if (x == _SC_TRACE_LOG)
+ {*r = Mono_Posix_SysConf__SC_TRACE_LOG; return 0;}
+#endif /* ndef _SC_TRACE_LOG */
+#ifdef _SC_LEVEL1_ICACHE_SIZE
+ if (x == _SC_LEVEL1_ICACHE_SIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL1_ICACHE_SIZE; return 0;}
+#endif /* ndef _SC_LEVEL1_ICACHE_SIZE */
+#ifdef _SC_LEVEL1_ICACHE_ASSOC
+ if (x == _SC_LEVEL1_ICACHE_ASSOC)
+ {*r = Mono_Posix_SysConf__SC_LEVEL1_ICACHE_ASSOC; return 0;}
+#endif /* ndef _SC_LEVEL1_ICACHE_ASSOC */
+#ifdef _SC_LEVEL1_ICACHE_LINESIZE
+ if (x == _SC_LEVEL1_ICACHE_LINESIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL1_ICACHE_LINESIZE; return 0;}
+#endif /* ndef _SC_LEVEL1_ICACHE_LINESIZE */
+#ifdef _SC_LEVEL1_DCACHE_SIZE
+ if (x == _SC_LEVEL1_DCACHE_SIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL1_DCACHE_SIZE; return 0;}
+#endif /* ndef _SC_LEVEL1_DCACHE_SIZE */
+#ifdef _SC_LEVEL1_DCACHE_ASSOC
+ if (x == _SC_LEVEL1_DCACHE_ASSOC)
+ {*r = Mono_Posix_SysConf__SC_LEVEL1_DCACHE_ASSOC; return 0;}
+#endif /* ndef _SC_LEVEL1_DCACHE_ASSOC */
+#ifdef _SC_LEVEL1_DCACHE_LINESIZE
+ if (x == _SC_LEVEL1_DCACHE_LINESIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL1_DCACHE_LINESIZE; return 0;}
+#endif /* ndef _SC_LEVEL1_DCACHE_LINESIZE */
+#ifdef _SC_LEVEL2_CACHE_SIZE
+ if (x == _SC_LEVEL2_CACHE_SIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL2_CACHE_SIZE; return 0;}
+#endif /* ndef _SC_LEVEL2_CACHE_SIZE */
+#ifdef _SC_LEVEL2_CACHE_ASSOC
+ if (x == _SC_LEVEL2_CACHE_ASSOC)
+ {*r = Mono_Posix_SysConf__SC_LEVEL2_CACHE_ASSOC; return 0;}
+#endif /* ndef _SC_LEVEL2_CACHE_ASSOC */
+#ifdef _SC_LEVEL2_CACHE_LINESIZE
+ if (x == _SC_LEVEL2_CACHE_LINESIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL2_CACHE_LINESIZE; return 0;}
+#endif /* ndef _SC_LEVEL2_CACHE_LINESIZE */
+#ifdef _SC_LEVEL3_CACHE_SIZE
+ if (x == _SC_LEVEL3_CACHE_SIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL3_CACHE_SIZE; return 0;}
+#endif /* ndef _SC_LEVEL3_CACHE_SIZE */
+#ifdef _SC_LEVEL3_CACHE_ASSOC
+ if (x == _SC_LEVEL3_CACHE_ASSOC)
+ {*r = Mono_Posix_SysConf__SC_LEVEL3_CACHE_ASSOC; return 0;}
+#endif /* ndef _SC_LEVEL3_CACHE_ASSOC */
+#ifdef _SC_LEVEL3_CACHE_LINESIZE
+ if (x == _SC_LEVEL3_CACHE_LINESIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL3_CACHE_LINESIZE; return 0;}
+#endif /* ndef _SC_LEVEL3_CACHE_LINESIZE */
+#ifdef _SC_LEVEL4_CACHE_SIZE
+ if (x == _SC_LEVEL4_CACHE_SIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL4_CACHE_SIZE; return 0;}
+#endif /* ndef _SC_LEVEL4_CACHE_SIZE */
+#ifdef _SC_LEVEL4_CACHE_ASSOC
+ if (x == _SC_LEVEL4_CACHE_ASSOC)
+ {*r = Mono_Posix_SysConf__SC_LEVEL4_CACHE_ASSOC; return 0;}
+#endif /* ndef _SC_LEVEL4_CACHE_ASSOC */
+#ifdef _SC_LEVEL4_CACHE_LINESIZE
+ if (x == _SC_LEVEL4_CACHE_LINESIZE)
+ {*r = Mono_Posix_SysConf__SC_LEVEL4_CACHE_LINESIZE; return 0;}
+#endif /* ndef _SC_LEVEL4_CACHE_LINESIZE */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromConfStr (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_ConfStr__CS_PATH)
+#ifdef _CS_PATH
+ {*r = _CS_PATH; return 0;}
+#else /* def _CS_PATH */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_PATH */
+ if (x == Mono_Posix_ConfStr__CS_V6_WIDTH_RESTRICTED_ENVS)
+#ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
+ {*r = _CS_V6_WIDTH_RESTRICTED_ENVS; return 0;}
+#else /* def _CS_V6_WIDTH_RESTRICTED_ENVS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
+ if (x == Mono_Posix_ConfStr__CS_GNU_LIBC_VERSION)
+#ifdef _CS_GNU_LIBC_VERSION
+ {*r = _CS_GNU_LIBC_VERSION; return 0;}
+#else /* def _CS_GNU_LIBC_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_GNU_LIBC_VERSION */
+ if (x == Mono_Posix_ConfStr__CS_GNU_LIBPTHREAD_VERSION)
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+ {*r = _CS_GNU_LIBPTHREAD_VERSION; return 0;}
+#else /* def _CS_GNU_LIBPTHREAD_VERSION */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
+ if (x == Mono_Posix_ConfStr__CS_LFS_CFLAGS)
+#ifdef _CS_LFS_CFLAGS
+ {*r = _CS_LFS_CFLAGS; return 0;}
+#else /* def _CS_LFS_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_LFS_LDFLAGS)
+#ifdef _CS_LFS_LDFLAGS
+ {*r = _CS_LFS_LDFLAGS; return 0;}
+#else /* def _CS_LFS_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_LFS_LIBS)
+#ifdef _CS_LFS_LIBS
+ {*r = _CS_LFS_LIBS; return 0;}
+#else /* def _CS_LFS_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_LFS_LINTFLAGS)
+#ifdef _CS_LFS_LINTFLAGS
+ {*r = _CS_LFS_LINTFLAGS; return 0;}
+#else /* def _CS_LFS_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_LFS64_CFLAGS)
+#ifdef _CS_LFS64_CFLAGS
+ {*r = _CS_LFS64_CFLAGS; return 0;}
+#else /* def _CS_LFS64_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS64_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_LFS64_LDFLAGS)
+#ifdef _CS_LFS64_LDFLAGS
+ {*r = _CS_LFS64_LDFLAGS; return 0;}
+#else /* def _CS_LFS64_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS64_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_LFS64_LIBS)
+#ifdef _CS_LFS64_LIBS
+ {*r = _CS_LFS64_LIBS; return 0;}
+#else /* def _CS_LFS64_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS64_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_LFS64_LINTFLAGS)
+#ifdef _CS_LFS64_LINTFLAGS
+ {*r = _CS_LFS64_LINTFLAGS; return 0;}
+#else /* def _CS_LFS64_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_LFS64_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_CFLAGS)
+#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
+ {*r = _CS_XBS5_ILP32_OFF32_CFLAGS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFF32_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LDFLAGS)
+#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
+ {*r = _CS_XBS5_ILP32_OFF32_LDFLAGS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFF32_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LIBS)
+#ifdef _CS_XBS5_ILP32_OFF32_LIBS
+ {*r = _CS_XBS5_ILP32_OFF32_LIBS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFF32_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LINTFLAGS)
+#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
+ {*r = _CS_XBS5_ILP32_OFF32_LINTFLAGS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFF32_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_CFLAGS)
+#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
+ {*r = _CS_XBS5_ILP32_OFFBIG_CFLAGS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFFBIG_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LDFLAGS)
+#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+ {*r = _CS_XBS5_ILP32_OFFBIG_LDFLAGS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LIBS)
+#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
+ {*r = _CS_XBS5_ILP32_OFFBIG_LIBS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFFBIG_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LINTFLAGS)
+#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+ {*r = _CS_XBS5_ILP32_OFFBIG_LINTFLAGS; return 0;}
+#else /* def _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_CFLAGS)
+#ifdef _CS_XBS5_LP64_OFF64_CFLAGS
+ {*r = _CS_XBS5_LP64_OFF64_CFLAGS; return 0;}
+#else /* def _CS_XBS5_LP64_OFF64_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LDFLAGS)
+#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
+ {*r = _CS_XBS5_LP64_OFF64_LDFLAGS; return 0;}
+#else /* def _CS_XBS5_LP64_OFF64_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LIBS)
+#ifdef _CS_XBS5_LP64_OFF64_LIBS
+ {*r = _CS_XBS5_LP64_OFF64_LIBS; return 0;}
+#else /* def _CS_XBS5_LP64_OFF64_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LINTFLAGS)
+#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
+ {*r = _CS_XBS5_LP64_OFF64_LINTFLAGS; return 0;}
+#else /* def _CS_XBS5_LP64_OFF64_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_CFLAGS)
+#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+ {*r = _CS_XBS5_LPBIG_OFFBIG_CFLAGS; return 0;}
+#else /* def _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LDFLAGS)
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+ {*r = _CS_XBS5_LPBIG_OFFBIG_LDFLAGS; return 0;}
+#else /* def _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LIBS)
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
+ {*r = _CS_XBS5_LPBIG_OFFBIG_LIBS; return 0;}
+#else /* def _CS_XBS5_LPBIG_OFFBIG_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS)
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+ {*r = _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS; return 0;}
+#else /* def _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_CFLAGS)
+#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+ {*r = _CS_POSIX_V6_ILP32_OFF32_CFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LDFLAGS)
+#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+ {*r = _CS_POSIX_V6_ILP32_OFF32_LDFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LIBS)
+#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
+ {*r = _CS_POSIX_V6_ILP32_OFF32_LIBS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFF32_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS)
+#ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+ {*r = _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS)
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+ {*r = _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS)
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+ {*r = _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LIBS)
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+ {*r = _CS_POSIX_V6_ILP32_OFFBIG_LIBS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS)
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+ {*r = _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_CFLAGS)
+#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
+ {*r = _CS_POSIX_V6_LP64_OFF64_CFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_LP64_OFF64_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LDFLAGS)
+#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+ {*r = _CS_POSIX_V6_LP64_OFF64_LDFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LIBS)
+#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
+ {*r = _CS_POSIX_V6_LP64_OFF64_LIBS; return 0;}
+#else /* def _CS_POSIX_V6_LP64_OFF64_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LINTFLAGS)
+#ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+ {*r = _CS_POSIX_V6_LP64_OFF64_LINTFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS)
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+ {*r = _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS)
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+ {*r = _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LIBS)
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+ {*r = _CS_POSIX_V6_LPBIG_OFFBIG_LIBS; return 0;}
+#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
+ if (x == Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS)
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+ {*r = _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS; return 0;}
+#else /* def _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
+ {errno = EINVAL; return -1;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToConfStr (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef _CS_PATH
+ if (x == _CS_PATH)
+ {*r = Mono_Posix_ConfStr__CS_PATH; return 0;}
+#endif /* ndef _CS_PATH */
+#ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
+ if (x == _CS_V6_WIDTH_RESTRICTED_ENVS)
+ {*r = Mono_Posix_ConfStr__CS_V6_WIDTH_RESTRICTED_ENVS; return 0;}
+#endif /* ndef _CS_V6_WIDTH_RESTRICTED_ENVS */
+#ifdef _CS_GNU_LIBC_VERSION
+ if (x == _CS_GNU_LIBC_VERSION)
+ {*r = Mono_Posix_ConfStr__CS_GNU_LIBC_VERSION; return 0;}
+#endif /* ndef _CS_GNU_LIBC_VERSION */
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+ if (x == _CS_GNU_LIBPTHREAD_VERSION)
+ {*r = Mono_Posix_ConfStr__CS_GNU_LIBPTHREAD_VERSION; return 0;}
+#endif /* ndef _CS_GNU_LIBPTHREAD_VERSION */
+#ifdef _CS_LFS_CFLAGS
+ if (x == _CS_LFS_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_LFS_CFLAGS; return 0;}
+#endif /* ndef _CS_LFS_CFLAGS */
+#ifdef _CS_LFS_LDFLAGS
+ if (x == _CS_LFS_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_LFS_LDFLAGS; return 0;}
+#endif /* ndef _CS_LFS_LDFLAGS */
+#ifdef _CS_LFS_LIBS
+ if (x == _CS_LFS_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_LFS_LIBS; return 0;}
+#endif /* ndef _CS_LFS_LIBS */
+#ifdef _CS_LFS_LINTFLAGS
+ if (x == _CS_LFS_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_LFS_LINTFLAGS; return 0;}
+#endif /* ndef _CS_LFS_LINTFLAGS */
+#ifdef _CS_LFS64_CFLAGS
+ if (x == _CS_LFS64_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_LFS64_CFLAGS; return 0;}
+#endif /* ndef _CS_LFS64_CFLAGS */
+#ifdef _CS_LFS64_LDFLAGS
+ if (x == _CS_LFS64_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_LFS64_LDFLAGS; return 0;}
+#endif /* ndef _CS_LFS64_LDFLAGS */
+#ifdef _CS_LFS64_LIBS
+ if (x == _CS_LFS64_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_LFS64_LIBS; return 0;}
+#endif /* ndef _CS_LFS64_LIBS */
+#ifdef _CS_LFS64_LINTFLAGS
+ if (x == _CS_LFS64_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_LFS64_LINTFLAGS; return 0;}
+#endif /* ndef _CS_LFS64_LINTFLAGS */
+#ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
+ if (x == _CS_XBS5_ILP32_OFF32_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_CFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_CFLAGS */
+#ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
+ if (x == _CS_XBS5_ILP32_OFF32_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LDFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_LDFLAGS */
+#ifdef _CS_XBS5_ILP32_OFF32_LIBS
+ if (x == _CS_XBS5_ILP32_OFF32_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LIBS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_LIBS */
+#ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
+ if (x == _CS_XBS5_ILP32_OFF32_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LINTFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFF32_LINTFLAGS */
+#ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
+ if (x == _CS_XBS5_ILP32_OFFBIG_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_CFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_CFLAGS */
+#ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+ if (x == _CS_XBS5_ILP32_OFFBIG_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LDFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LDFLAGS */
+#ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
+ if (x == _CS_XBS5_ILP32_OFFBIG_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LIBS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LIBS */
+#ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+ if (x == _CS_XBS5_ILP32_OFFBIG_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LINTFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
+#ifdef _CS_XBS5_LP64_OFF64_CFLAGS
+ if (x == _CS_XBS5_LP64_OFF64_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_CFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_CFLAGS */
+#ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
+ if (x == _CS_XBS5_LP64_OFF64_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LDFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_LDFLAGS */
+#ifdef _CS_XBS5_LP64_OFF64_LIBS
+ if (x == _CS_XBS5_LP64_OFF64_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LIBS; return 0;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_LIBS */
+#ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
+ if (x == _CS_XBS5_LP64_OFF64_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LINTFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_LP64_OFF64_LINTFLAGS */
+#ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+ if (x == _CS_XBS5_LPBIG_OFFBIG_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_CFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_CFLAGS */
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+ if (x == _CS_XBS5_LPBIG_OFFBIG_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LDFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS */
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
+ if (x == _CS_XBS5_LPBIG_OFFBIG_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LIBS; return 0;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LIBS */
+#ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+ if (x == _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS; return 0;}
+#endif /* ndef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
+#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+ if (x == _CS_POSIX_V6_ILP32_OFF32_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_CFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
+#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+ if (x == _CS_POSIX_V6_ILP32_OFF32_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LDFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
+#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
+ if (x == _CS_POSIX_V6_ILP32_OFF32_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LIBS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LIBS */
+#ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+ if (x == _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+ if (x == _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+ if (x == _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+ if (x == _CS_POSIX_V6_ILP32_OFFBIG_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LIBS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
+#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+ if (x == _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS */
+#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
+ if (x == _CS_POSIX_V6_LP64_OFF64_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_CFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_CFLAGS */
+#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+ if (x == _CS_POSIX_V6_LP64_OFF64_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LDFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
+#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
+ if (x == _CS_POSIX_V6_LP64_OFF64_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LIBS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LIBS */
+#ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+ if (x == _CS_POSIX_V6_LP64_OFF64_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LINTFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS */
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+ if (x == _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+ if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+ if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LIBS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LIBS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
+#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+ if (x == _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS)
+ {*r = Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS; return 0;}
+#endif /* ndef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromLockFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if (x == Mono_Posix_LockFlags_F_ULOCK)
+#ifdef F_ULOCK
+ {*r = F_ULOCK; return 0;}
+#else /* def F_ULOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_ULOCK */
+ if (x == Mono_Posix_LockFlags_F_LOCK)
+#ifdef F_LOCK
+ {*r = F_LOCK; return 0;}
+#else /* def F_LOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_LOCK */
+ if (x == Mono_Posix_LockFlags_F_TLOCK)
+#ifdef F_TLOCK
+ {*r = F_TLOCK; return 0;}
+#else /* def F_TLOCK */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_TLOCK */
+ if (x == Mono_Posix_LockFlags_F_TEST)
+#ifdef F_TEST
+ {*r = F_TEST; return 0;}
+#else /* def F_TEST */
+ {errno = EINVAL; return -1;}
+#endif /* ndef F_TEST */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_ToLockFlags (int x, int *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef F_ULOCK
+ if (x == F_ULOCK)
+ {*r = Mono_Posix_LockFlags_F_ULOCK; return 0;}
+#endif /* ndef F_ULOCK */
+#ifdef F_LOCK
+ if (x == F_LOCK)
+ {*r = Mono_Posix_LockFlags_F_LOCK; return 0;}
+#endif /* ndef F_LOCK */
+#ifdef F_TLOCK
+ if (x == F_TLOCK)
+ {*r = Mono_Posix_LockFlags_F_TLOCK; return 0;}
+#endif /* ndef F_TLOCK */
+#ifdef F_TEST
+ if (x == F_TEST)
+ {*r = Mono_Posix_LockFlags_F_TEST; return 0;}
+#endif /* ndef F_TEST */
+ errno = EINVAL; return -1;
+}
+
+int Mono_Posix_FromPollEvents (short x, short *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+ if ((x & Mono_Posix_PollEvents_POLLIN) == Mono_Posix_PollEvents_POLLIN)
+#ifdef POLLIN
+ *r |= POLLIN;
+#else /* def POLLIN */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLIN */
+ if ((x & Mono_Posix_PollEvents_POLLPRI) == Mono_Posix_PollEvents_POLLPRI)
+#ifdef POLLPRI
+ *r |= POLLPRI;
+#else /* def POLLPRI */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLPRI */
+ if ((x & Mono_Posix_PollEvents_POLLOUT) == Mono_Posix_PollEvents_POLLOUT)
+#ifdef POLLOUT
+ *r |= POLLOUT;
+#else /* def POLLOUT */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLOUT */
+ if ((x & Mono_Posix_PollEvents_POLLERR) == Mono_Posix_PollEvents_POLLERR)
+#ifdef POLLERR
+ *r |= POLLERR;
+#else /* def POLLERR */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLERR */
+ if ((x & Mono_Posix_PollEvents_POLLHUP) == Mono_Posix_PollEvents_POLLHUP)
+#ifdef POLLHUP
+ *r |= POLLHUP;
+#else /* def POLLHUP */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLHUP */
+ if ((x & Mono_Posix_PollEvents_POLLNVAL) == Mono_Posix_PollEvents_POLLNVAL)
+#ifdef POLLNVAL
+ *r |= POLLNVAL;
+#else /* def POLLNVAL */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLNVAL */
+ if ((x & Mono_Posix_PollEvents_POLLRDNORM) == Mono_Posix_PollEvents_POLLRDNORM)
+#ifdef POLLRDNORM
+ *r |= POLLRDNORM;
+#else /* def POLLRDNORM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLRDNORM */
+ if ((x & Mono_Posix_PollEvents_POLLRDBAND) == Mono_Posix_PollEvents_POLLRDBAND)
+#ifdef POLLRDBAND
+ *r |= POLLRDBAND;
+#else /* def POLLRDBAND */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLRDBAND */
+ if ((x & Mono_Posix_PollEvents_POLLWRNORM) == Mono_Posix_PollEvents_POLLWRNORM)
+#ifdef POLLWRNORM
+ *r |= POLLWRNORM;
+#else /* def POLLWRNORM */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLWRNORM */
+ if ((x & Mono_Posix_PollEvents_POLLWRBAND) == Mono_Posix_PollEvents_POLLWRBAND)
+#ifdef POLLWRBAND
+ *r |= POLLWRBAND;
+#else /* def POLLWRBAND */
+ {errno = EINVAL; return -1;}
+#endif /* ndef POLLWRBAND */
+ return 0;
+}
+
+int Mono_Posix_ToPollEvents (short x, short *r)
+{
+ *r = 0;
+ if (x == 0)
+ return 0;
+#ifdef POLLIN
+ if ((x & POLLIN) == POLLIN)
+ *r |= Mono_Posix_PollEvents_POLLIN;
+#endif /* ndef POLLIN */
+#ifdef POLLPRI
+ if ((x & POLLPRI) == POLLPRI)
+ *r |= Mono_Posix_PollEvents_POLLPRI;
+#endif /* ndef POLLPRI */
+#ifdef POLLOUT
+ if ((x & POLLOUT) == POLLOUT)
+ *r |= Mono_Posix_PollEvents_POLLOUT;
+#endif /* ndef POLLOUT */
+#ifdef POLLERR
+ if ((x & POLLERR) == POLLERR)
+ *r |= Mono_Posix_PollEvents_POLLERR;
+#endif /* ndef POLLERR */
+#ifdef POLLHUP
+ if ((x & POLLHUP) == POLLHUP)
+ *r |= Mono_Posix_PollEvents_POLLHUP;
+#endif /* ndef POLLHUP */
+#ifdef POLLNVAL
+ if ((x & POLLNVAL) == POLLNVAL)
+ *r |= Mono_Posix_PollEvents_POLLNVAL;
+#endif /* ndef POLLNVAL */
+#ifdef POLLRDNORM
+ if ((x & POLLRDNORM) == POLLRDNORM)
+ *r |= Mono_Posix_PollEvents_POLLRDNORM;
+#endif /* ndef POLLRDNORM */
+#ifdef POLLRDBAND
+ if ((x & POLLRDBAND) == POLLRDBAND)
+ *r |= Mono_Posix_PollEvents_POLLRDBAND;
+#endif /* ndef POLLRDBAND */
+#ifdef POLLWRNORM
+ if ((x & POLLWRNORM) == POLLWRNORM)
+ *r |= Mono_Posix_PollEvents_POLLWRNORM;
+#endif /* ndef POLLWRNORM */
+#ifdef POLLWRBAND
+ if ((x & POLLWRBAND) == POLLWRBAND)
+ *r |= Mono_Posix_PollEvents_POLLWRBAND;
+#endif /* ndef POLLWRBAND */
+ return 0;
+}
+
diff --git a/support/map.h b/support/map.h
new file mode 100644
index 00000000000..e5cbd419095
--- /dev/null
+++ b/support/map.h
@@ -0,0 +1,620 @@
+/*
+ * This file was automatically generated by make-map from Mono.Posix.dll.
+ *
+ * DO NOT MODIFY.
+ */
+
+#ifndef INC_Mono_Posix_map_H
+#define INC_Mono_Posix_map_H
+
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+#define Mono_Posix_Error_EPERM 0x00000001
+#define Mono_Posix_Error_ENOENT 0x00000002
+#define Mono_Posix_Error_ESRCH 0x00000003
+#define Mono_Posix_Error_EINTR 0x00000004
+#define Mono_Posix_Error_EIO 0x00000005
+#define Mono_Posix_Error_ENXIO 0x00000006
+#define Mono_Posix_Error_E2BIG 0x00000007
+#define Mono_Posix_Error_ENOEXEC 0x00000008
+#define Mono_Posix_Error_EBADF 0x00000009
+#define Mono_Posix_Error_ECHILD 0x0000000a
+#define Mono_Posix_Error_EAGAIN 0x0000000b
+#define Mono_Posix_Error_ENOMEM 0x0000000c
+#define Mono_Posix_Error_EACCES 0x0000000d
+#define Mono_Posix_Error_EFAULT 0x0000000e
+#define Mono_Posix_Error_ENOTBLK 0x0000000f
+#define Mono_Posix_Error_EBUSY 0x00000010
+#define Mono_Posix_Error_EEXIST 0x00000011
+#define Mono_Posix_Error_EXDEV 0x00000012
+#define Mono_Posix_Error_ENODEV 0x00000013
+#define Mono_Posix_Error_ENOTDIR 0x00000014
+#define Mono_Posix_Error_EISDIR 0x00000015
+#define Mono_Posix_Error_EINVAL 0x00000016
+#define Mono_Posix_Error_ENFILE 0x00000017
+#define Mono_Posix_Error_EMFILE 0x00000018
+#define Mono_Posix_Error_ENOTTY 0x00000019
+#define Mono_Posix_Error_ETXTBSY 0x0000001a
+#define Mono_Posix_Error_EFBIG 0x0000001b
+#define Mono_Posix_Error_ENOSPC 0x0000001c
+#define Mono_Posix_Error_ESPIPE 0x0000001d
+#define Mono_Posix_Error_EROFS 0x0000001e
+#define Mono_Posix_Error_EMLINK 0x0000001f
+#define Mono_Posix_Error_EPIPE 0x00000020
+#define Mono_Posix_Error_EDOM 0x00000021
+#define Mono_Posix_Error_ERANGE 0x00000022
+#define Mono_Posix_Error_EDEADLK 0x00000023
+#define Mono_Posix_Error_ENAMETOOLONG 0x00000024
+#define Mono_Posix_Error_ENOLCK 0x00000025
+#define Mono_Posix_Error_ENOSYS 0x00000026
+#define Mono_Posix_Error_ENOTEMPTY 0x00000027
+#define Mono_Posix_Error_ELOOP 0x00000028
+#define Mono_Posix_Error_EWOULDBLOCK 0x0000000b
+#define Mono_Posix_Error_ENOMSG 0x0000002a
+#define Mono_Posix_Error_EIDRM 0x0000002b
+#define Mono_Posix_Error_ECHRNG 0x0000002c
+#define Mono_Posix_Error_EL2NSYNC 0x0000002d
+#define Mono_Posix_Error_EL3HLT 0x0000002e
+#define Mono_Posix_Error_EL3RST 0x0000002f
+#define Mono_Posix_Error_ELNRNG 0x00000030
+#define Mono_Posix_Error_EUNATCH 0x00000031
+#define Mono_Posix_Error_ENOCSI 0x00000032
+#define Mono_Posix_Error_EL2HLT 0x00000033
+#define Mono_Posix_Error_EBADE 0x00000034
+#define Mono_Posix_Error_EBADR 0x00000035
+#define Mono_Posix_Error_EXFULL 0x00000036
+#define Mono_Posix_Error_ENOANO 0x00000037
+#define Mono_Posix_Error_EBADRQC 0x00000038
+#define Mono_Posix_Error_EBADSLT 0x00000039
+#define Mono_Posix_Error_EDEADLOCK 0x00000023
+#define Mono_Posix_Error_EBFONT 0x0000003b
+#define Mono_Posix_Error_ENOSTR 0x0000003c
+#define Mono_Posix_Error_ENODATA 0x0000003d
+#define Mono_Posix_Error_ETIME 0x0000003e
+#define Mono_Posix_Error_ENOSR 0x0000003f
+#define Mono_Posix_Error_ENONET 0x00000040
+#define Mono_Posix_Error_ENOPKG 0x00000041
+#define Mono_Posix_Error_EREMOTE 0x00000042
+#define Mono_Posix_Error_ENOLINK 0x00000043
+#define Mono_Posix_Error_EADV 0x00000044
+#define Mono_Posix_Error_ESRMNT 0x00000045
+#define Mono_Posix_Error_ECOMM 0x00000046
+#define Mono_Posix_Error_EPROTO 0x00000047
+#define Mono_Posix_Error_EMULTIHOP 0x00000048
+#define Mono_Posix_Error_EDOTDOT 0x00000049
+#define Mono_Posix_Error_EBADMSG 0x0000004a
+#define Mono_Posix_Error_EOVERFLOW 0x0000004b
+#define Mono_Posix_Error_ENOTUNIQ 0x0000004c
+#define Mono_Posix_Error_EBADFD 0x0000004d
+#define Mono_Posix_Error_EREMCHG 0x0000004e
+#define Mono_Posix_Error_ELIBACC 0x0000004f
+#define Mono_Posix_Error_ELIBBAD 0x00000050
+#define Mono_Posix_Error_ELIBSCN 0x00000051
+#define Mono_Posix_Error_ELIBMAX 0x00000052
+#define Mono_Posix_Error_ELIBEXEC 0x00000053
+#define Mono_Posix_Error_EILSEQ 0x00000054
+#define Mono_Posix_Error_ERESTART 0x00000055
+#define Mono_Posix_Error_ESTRPIPE 0x00000056
+#define Mono_Posix_Error_EUSERS 0x00000057
+#define Mono_Posix_Error_ENOTSOCK 0x00000058
+#define Mono_Posix_Error_EDESTADDRREQ 0x00000059
+#define Mono_Posix_Error_EMSGSIZE 0x0000005a
+#define Mono_Posix_Error_EPROTOTYPE 0x0000005b
+#define Mono_Posix_Error_ENOPROTOOPT 0x0000005c
+#define Mono_Posix_Error_EPROTONOSUPPORT 0x0000005d
+#define Mono_Posix_Error_ESOCKTNOSUPPORT 0x0000005e
+#define Mono_Posix_Error_EOPNOTSUPP 0x0000005f
+#define Mono_Posix_Error_EPFNOSUPPORT 0x00000060
+#define Mono_Posix_Error_EAFNOSUPPORT 0x00000061
+#define Mono_Posix_Error_EADDRINUSE 0x00000062
+#define Mono_Posix_Error_EADDRNOTAVAIL 0x00000063
+#define Mono_Posix_Error_ENETDOWN 0x00000064
+#define Mono_Posix_Error_ENETUNREACH 0x00000065
+#define Mono_Posix_Error_ENETRESET 0x00000066
+#define Mono_Posix_Error_ECONNABORTED 0x00000067
+#define Mono_Posix_Error_ECONNRESET 0x00000068
+#define Mono_Posix_Error_ENOBUFS 0x00000069
+#define Mono_Posix_Error_EISCONN 0x0000006a
+#define Mono_Posix_Error_ENOTCONN 0x0000006b
+#define Mono_Posix_Error_ESHUTDOWN 0x0000006c
+#define Mono_Posix_Error_ETOOMANYREFS 0x0000006d
+#define Mono_Posix_Error_ETIMEDOUT 0x0000006e
+#define Mono_Posix_Error_ECONNREFUSED 0x0000006f
+#define Mono_Posix_Error_EHOSTDOWN 0x00000070
+#define Mono_Posix_Error_EHOSTUNREACH 0x00000071
+#define Mono_Posix_Error_EALREADY 0x00000072
+#define Mono_Posix_Error_EINPROGRESS 0x00000073
+#define Mono_Posix_Error_ESTALE 0x00000074
+#define Mono_Posix_Error_EUCLEAN 0x00000075
+#define Mono_Posix_Error_ENOTNAM 0x00000076
+#define Mono_Posix_Error_ENAVAIL 0x00000077
+#define Mono_Posix_Error_EISNAM 0x00000078
+#define Mono_Posix_Error_EREMOTEIO 0x00000079
+#define Mono_Posix_Error_EDQUOT 0x0000007a
+#define Mono_Posix_Error_ENOMEDIUM 0x0000007b
+#define Mono_Posix_Error_EMEDIUMTYPE 0x0000007c
+int Mono_Posix_FromError (int x, int *r);
+int Mono_Posix_ToError (int x, int *r);
+
+#define Mono_Posix_OpenFlags_O_RDONLY 0x00000000
+#define Mono_Posix_OpenFlags_O_WRONLY 0x00000001
+#define Mono_Posix_OpenFlags_O_RDWR 0x00000002
+#define Mono_Posix_OpenFlags_O_CREAT 0x00000004
+#define Mono_Posix_OpenFlags_O_EXCL 0x00000008
+#define Mono_Posix_OpenFlags_O_NOCTTY 0x00000010
+#define Mono_Posix_OpenFlags_O_TRUNC 0x00000020
+#define Mono_Posix_OpenFlags_O_APPEND 0x00000040
+#define Mono_Posix_OpenFlags_O_NONBLOCK 0x00000080
+#define Mono_Posix_OpenFlags_O_SYNC 0x00000100
+#define Mono_Posix_OpenFlags_O_NOFOLLOW 0x00000200
+#define Mono_Posix_OpenFlags_O_DIRECTORY 0x00000400
+#define Mono_Posix_OpenFlags_O_DIRECT 0x00000800
+#define Mono_Posix_OpenFlags_O_ASYNC 0x00001000
+#define Mono_Posix_OpenFlags_O_LARGEFILE 0x00002000
+int Mono_Posix_FromOpenFlags (int x, int *r);
+int Mono_Posix_ToOpenFlags (int x, int *r);
+
+#define Mono_Posix_FilePermissions_S_ISUID 0x00000800
+#define Mono_Posix_FilePermissions_S_ISGID 0x00000400
+#define Mono_Posix_FilePermissions_S_ISVTX 0x00000200
+#define Mono_Posix_FilePermissions_S_IRUSR 0x00000100
+#define Mono_Posix_FilePermissions_S_IWUSR 0x00000080
+#define Mono_Posix_FilePermissions_S_IXUSR 0x00000040
+#define Mono_Posix_FilePermissions_S_IRGRP 0x00000020
+#define Mono_Posix_FilePermissions_S_IWGRP 0x00000010
+#define Mono_Posix_FilePermissions_S_IXGRP 0x00000008
+#define Mono_Posix_FilePermissions_S_IROTH 0x00000004
+#define Mono_Posix_FilePermissions_S_IWOTH 0x00000002
+#define Mono_Posix_FilePermissions_S_IXOTH 0x00000001
+#define Mono_Posix_FilePermissions_S_IRWXG 0x00000038
+#define Mono_Posix_FilePermissions_S_IRWXU 0x000001c0
+#define Mono_Posix_FilePermissions_S_IRWXO 0x00000007
+#define Mono_Posix_FilePermissions_ACCESSPERMS 0x000001ff
+#define Mono_Posix_FilePermissions_ALLPERMS 0x00000fff
+#define Mono_Posix_FilePermissions_DEFFILEMODE 0x000001b6
+#define Mono_Posix_FilePermissions_S_IFMT 0x0000f000
+#define Mono_Posix_FilePermissions_S_IFDIR 0x00004000
+#define Mono_Posix_FilePermissions_S_IFCHR 0x00002000
+#define Mono_Posix_FilePermissions_S_IFBLK 0x00006000
+#define Mono_Posix_FilePermissions_S_IFREG 0x00008000
+#define Mono_Posix_FilePermissions_S_IFIFO 0x00001000
+#define Mono_Posix_FilePermissions_S_IFLNK 0x0000a000
+#define Mono_Posix_FilePermissions_S_IFSOCK 0x0000c000
+int Mono_Posix_FromFilePermissions (unsigned int x, unsigned int *r);
+int Mono_Posix_ToFilePermissions (unsigned int x, unsigned int *r);
+
+#define Mono_Posix_FcntlCommand_F_DUPFD 0x00000000
+#define Mono_Posix_FcntlCommand_F_GETFD 0x00000001
+#define Mono_Posix_FcntlCommand_F_SETFD 0x00000002
+#define Mono_Posix_FcntlCommand_F_GETFL 0x00000003
+#define Mono_Posix_FcntlCommand_F_SETFL 0x00000004
+#define Mono_Posix_FcntlCommand_F_GETLK 0x0000000c
+#define Mono_Posix_FcntlCommand_F_SETLK 0x0000000d
+#define Mono_Posix_FcntlCommand_F_SETLKW 0x0000000e
+#define Mono_Posix_FcntlCommand_F_SETOWN 0x00000008
+#define Mono_Posix_FcntlCommand_F_GETOWN 0x00000009
+#define Mono_Posix_FcntlCommand_F_SETSIG 0x0000000a
+#define Mono_Posix_FcntlCommand_F_GETSIG 0x0000000b
+#define Mono_Posix_FcntlCommand_F_SETLEASE 0x00000400
+#define Mono_Posix_FcntlCommand_F_GETLEASE 0x00000401
+#define Mono_Posix_FcntlCommand_F_NOTIFY 0x00000402
+int Mono_Posix_FromFcntlCommand (int x, int *r);
+int Mono_Posix_ToFcntlCommand (int x, int *r);
+
+#define Mono_Posix_LockType_F_RDLCK 0x00000000
+#define Mono_Posix_LockType_F_WRLCK 0x00000001
+#define Mono_Posix_LockType_F_UNLCK 0x00000002
+int Mono_Posix_FromLockType (short x, short *r);
+int Mono_Posix_ToLockType (short x, short *r);
+
+#define Mono_Posix_SeekFlags_SEEK_SET 0x00000000
+#define Mono_Posix_SeekFlags_SEEK_CUR 0x00000001
+#define Mono_Posix_SeekFlags_SEEK_END 0x00000002
+#define Mono_Posix_SeekFlags_L_SET 0x00000000
+#define Mono_Posix_SeekFlags_L_INCR 0x00000001
+#define Mono_Posix_SeekFlags_L_XTND 0x00000002
+int Mono_Posix_FromSeekFlags (short x, short *r);
+int Mono_Posix_ToSeekFlags (short x, short *r);
+
+#define Mono_Posix_DirectoryNotifyFlags_DN_ACCESS 0x00000001
+#define Mono_Posix_DirectoryNotifyFlags_DN_MODIFY 0x00000002
+#define Mono_Posix_DirectoryNotifyFlags_DN_CREATE 0x00000004
+#define Mono_Posix_DirectoryNotifyFlags_DN_DELETE 0x00000008
+#define Mono_Posix_DirectoryNotifyFlags_DN_RENAME 0x00000010
+#define Mono_Posix_DirectoryNotifyFlags_DN_ATTRIB 0x00000020
+#define Mono_Posix_DirectoryNotifyFlags_DN_MULTISHOT 0x80000000
+int Mono_Posix_FromDirectoryNotifyFlags (int x, int *r);
+int Mono_Posix_ToDirectoryNotifyFlags (int x, int *r);
+
+#define Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NORMAL 0x00000000
+#define Mono_Posix_PosixFadviseAdvice_POSIX_FADV_RANDOM 0x00000001
+#define Mono_Posix_PosixFadviseAdvice_POSIX_FADV_SEQUENTIAL 0x00000002
+#define Mono_Posix_PosixFadviseAdvice_POSIX_FADV_WILLNEED 0x00000003
+#define Mono_Posix_PosixFadviseAdvice_POSIX_FADV_DONTNEED 0x00000004
+#define Mono_Posix_PosixFadviseAdvice_POSIX_FADV_NOREUSE 0x00000005
+int Mono_Posix_FromPosixFadviseAdvice (int x, int *r);
+int Mono_Posix_ToPosixFadviseAdvice (int x, int *r);
+
+#define Mono_Posix_PosixMadviseAdvice_POSIX_MADV_NORMAL 0x00000000
+#define Mono_Posix_PosixMadviseAdvice_POSIX_MADV_RANDOM 0x00000001
+#define Mono_Posix_PosixMadviseAdvice_POSIX_MADV_SEQUENTIAL 0x00000002
+#define Mono_Posix_PosixMadviseAdvice_POSIX_MADV_WILLNEED 0x00000003
+#define Mono_Posix_PosixMadviseAdvice_POSIX_MADV_DONTNEED 0x00000004
+int Mono_Posix_FromPosixMadviseAdvice (int x, int *r);
+int Mono_Posix_ToPosixMadviseAdvice (int x, int *r);
+
+#define Mono_Posix_Signum_SIGHUP 0x00000001
+#define Mono_Posix_Signum_SIGINT 0x00000002
+#define Mono_Posix_Signum_SIGQUIT 0x00000003
+#define Mono_Posix_Signum_SIGILL 0x00000004
+#define Mono_Posix_Signum_SIGTRAP 0x00000005
+#define Mono_Posix_Signum_SIGABRT 0x00000006
+#define Mono_Posix_Signum_SIGIOT 0x00000006
+#define Mono_Posix_Signum_SIGBUS 0x00000007
+#define Mono_Posix_Signum_SIGFPE 0x00000008
+#define Mono_Posix_Signum_SIGKILL 0x00000009
+#define Mono_Posix_Signum_SIGUSR1 0x0000000a
+#define Mono_Posix_Signum_SIGSEGV 0x0000000b
+#define Mono_Posix_Signum_SIGUSR2 0x0000000c
+#define Mono_Posix_Signum_SIGPIPE 0x0000000d
+#define Mono_Posix_Signum_SIGALRM 0x0000000e
+#define Mono_Posix_Signum_SIGTERM 0x0000000f
+#define Mono_Posix_Signum_SIGSTKFLT 0x00000010
+#define Mono_Posix_Signum_SIGCHLD 0x00000011
+#define Mono_Posix_Signum_SIGCLD 0x00000011
+#define Mono_Posix_Signum_SIGCONT 0x00000012
+#define Mono_Posix_Signum_SIGSTOP 0x00000013
+#define Mono_Posix_Signum_SIGTSTP 0x00000014
+#define Mono_Posix_Signum_SIGTTIN 0x00000015
+#define Mono_Posix_Signum_SIGTTOU 0x00000016
+#define Mono_Posix_Signum_SIGURG 0x00000017
+#define Mono_Posix_Signum_SIGXCPU 0x00000018
+#define Mono_Posix_Signum_SIGXFSZ 0x00000019
+#define Mono_Posix_Signum_SIGVTALRM 0x0000001a
+#define Mono_Posix_Signum_SIGPROF 0x0000001b
+#define Mono_Posix_Signum_SIGWINCH 0x0000001c
+#define Mono_Posix_Signum_SIGIO 0x0000001d
+#define Mono_Posix_Signum_SIGPOLL 0x0000001d
+#define Mono_Posix_Signum_SIGPWR 0x0000001e
+#define Mono_Posix_Signum_SIGSYS 0x0000001f
+#define Mono_Posix_Signum_SIGUNUSED 0x0000001f
+int Mono_Posix_FromSignum (int x, int *r);
+int Mono_Posix_ToSignum (int x, int *r);
+
+#define Mono_Posix_MountFlags_MS_RDONLY 0x00000001
+#define Mono_Posix_MountFlags_MS_NOSUID 0x00000002
+#define Mono_Posix_MountFlags_MS_NODEV 0x00000004
+#define Mono_Posix_MountFlags_MS_NOEXEC 0x00000008
+#define Mono_Posix_MountFlags_MS_SYNCHRONOUS 0x00000010
+#define Mono_Posix_MountFlags_MS_REMOUNT 0x00000020
+#define Mono_Posix_MountFlags_MS_MANDLOCK 0x00000040
+#define Mono_Posix_MountFlags_S_WRITE 0x00000080
+#define Mono_Posix_MountFlags_S_APPEND 0x00000100
+#define Mono_Posix_MountFlags_S_IMMUTABLE 0x00000200
+#define Mono_Posix_MountFlags_MS_NOATIME 0x00000400
+#define Mono_Posix_MountFlags_MS_NODIRATIME 0x00000800
+#define Mono_Posix_MountFlags_MS_BIND 0x00001000
+#define Mono_Posix_MountFlags_MS_RMT_MASK 0x00000041
+#define Mono_Posix_MountFlags_MS_MGC_VAL 0xc0ed0000
+#define Mono_Posix_MountFlags_MS_MGC_MSK 0xffff0000
+int Mono_Posix_FromMountFlags (guint64 x, guint64 *r);
+int Mono_Posix_ToMountFlags (guint64 x, guint64 *r);
+
+#define Mono_Posix_UmountFlags_MNT_FORCE 0x00000001
+#define Mono_Posix_UmountFlags_MNT_DETACH 0x00000002
+int Mono_Posix_FromUmountFlags (int x, int *r);
+int Mono_Posix_ToUmountFlags (int x, int *r);
+
+#define Mono_Posix_WaitOptions_WNOHANG 0x00000001
+#define Mono_Posix_WaitOptions_WUNTRACED 0x00000002
+int Mono_Posix_FromWaitOptions (int x, int *r);
+int Mono_Posix_ToWaitOptions (int x, int *r);
+
+#define Mono_Posix_AccessMode_R_OK 0x00000001
+#define Mono_Posix_AccessMode_W_OK 0x00000002
+#define Mono_Posix_AccessMode_X_OK 0x00000004
+#define Mono_Posix_AccessMode_F_OK 0x00000008
+int Mono_Posix_FromAccessMode (int x, int *r);
+int Mono_Posix_ToAccessMode (int x, int *r);
+
+#define Mono_Posix_PathConf__PC_LINK_MAX 0x00000000
+#define Mono_Posix_PathConf__PC_MAX_CANON 0x00000001
+#define Mono_Posix_PathConf__PC_MAX_INPUT 0x00000002
+#define Mono_Posix_PathConf__PC_NAME_MAX 0x00000003
+#define Mono_Posix_PathConf__PC_PATH_MAX 0x00000004
+#define Mono_Posix_PathConf__PC_PIPE_BUF 0x00000005
+#define Mono_Posix_PathConf__PC_CHOWN_RESTRICTED 0x00000006
+#define Mono_Posix_PathConf__PC_NO_TRUNC 0x00000007
+#define Mono_Posix_PathConf__PC_VDISABLE 0x00000008
+#define Mono_Posix_PathConf__PC_SYNC_IO 0x00000009
+#define Mono_Posix_PathConf__PC_ASYNC_IO 0x0000000a
+#define Mono_Posix_PathConf__PC_PRIO_IO 0x0000000b
+#define Mono_Posix_PathConf__PC_SOCK_MAXBUF 0x0000000c
+#define Mono_Posix_PathConf__PC_FILESIZEBITS 0x0000000d
+#define Mono_Posix_PathConf__PC_REC_INCR_XFER_SIZE 0x0000000e
+#define Mono_Posix_PathConf__PC_REC_MAX_XFER_SIZE 0x0000000f
+#define Mono_Posix_PathConf__PC_REC_MIN_XFER_SIZE 0x00000010
+#define Mono_Posix_PathConf__PC_REC_XFER_ALIGN 0x00000011
+#define Mono_Posix_PathConf__PC_ALLOC_SIZE_MIN 0x00000012
+#define Mono_Posix_PathConf__PC_SYMLINK_MAX 0x00000013
+#define Mono_Posix_PathConf__PC_2_SYMLINKS 0x00000014
+int Mono_Posix_FromPathConf (int x, int *r);
+int Mono_Posix_ToPathConf (int x, int *r);
+
+#define Mono_Posix_SysConf__SC_ARG_MAX 0x00000000
+#define Mono_Posix_SysConf__SC_CHILD_MAX 0x00000001
+#define Mono_Posix_SysConf__SC_CLK_TCK 0x00000002
+#define Mono_Posix_SysConf__SC_NGROUPS_MAX 0x00000003
+#define Mono_Posix_SysConf__SC_OPEN_MAX 0x00000004
+#define Mono_Posix_SysConf__SC_STREAM_MAX 0x00000005
+#define Mono_Posix_SysConf__SC_TZNAME_MAX 0x00000006
+#define Mono_Posix_SysConf__SC_JOB_CONTROL 0x00000007
+#define Mono_Posix_SysConf__SC_SAVED_IDS 0x00000008
+#define Mono_Posix_SysConf__SC_REALTIME_SIGNALS 0x00000009
+#define Mono_Posix_SysConf__SC_PRIORITY_SCHEDULING 0x0000000a
+#define Mono_Posix_SysConf__SC_TIMERS 0x0000000b
+#define Mono_Posix_SysConf__SC_ASYNCHRONOUS_IO 0x0000000c
+#define Mono_Posix_SysConf__SC_PRIORITIZED_IO 0x0000000d
+#define Mono_Posix_SysConf__SC_SYNCHRONIZED_IO 0x0000000e
+#define Mono_Posix_SysConf__SC_FSYNC 0x0000000f
+#define Mono_Posix_SysConf__SC_MAPPED_FILES 0x00000010
+#define Mono_Posix_SysConf__SC_MEMLOCK 0x00000011
+#define Mono_Posix_SysConf__SC_MEMLOCK_RANGE 0x00000012
+#define Mono_Posix_SysConf__SC_MEMORY_PROTECTION 0x00000013
+#define Mono_Posix_SysConf__SC_MESSAGE_PASSING 0x00000014
+#define Mono_Posix_SysConf__SC_SEMAPHORES 0x00000015
+#define Mono_Posix_SysConf__SC_SHARED_MEMORY_OBJECTS 0x00000016
+#define Mono_Posix_SysConf__SC_AIO_LISTIO_MAX 0x00000017
+#define Mono_Posix_SysConf__SC_AIO_MAX 0x00000018
+#define Mono_Posix_SysConf__SC_AIO_PRIO_DELTA_MAX 0x00000019
+#define Mono_Posix_SysConf__SC_DELAYTIMER_MAX 0x0000001a
+#define Mono_Posix_SysConf__SC_MQ_OPEN_MAX 0x0000001b
+#define Mono_Posix_SysConf__SC_MQ_PRIO_MAX 0x0000001c
+#define Mono_Posix_SysConf__SC_VERSION 0x0000001d
+#define Mono_Posix_SysConf__SC_PAGESIZE 0x0000001e
+#define Mono_Posix_SysConf__SC_RTSIG_MAX 0x0000001f
+#define Mono_Posix_SysConf__SC_SEM_NSEMS_MAX 0x00000020
+#define Mono_Posix_SysConf__SC_SEM_VALUE_MAX 0x00000021
+#define Mono_Posix_SysConf__SC_SIGQUEUE_MAX 0x00000022
+#define Mono_Posix_SysConf__SC_TIMER_MAX 0x00000023
+#define Mono_Posix_SysConf__SC_BC_BASE_MAX 0x00000024
+#define Mono_Posix_SysConf__SC_BC_DIM_MAX 0x00000025
+#define Mono_Posix_SysConf__SC_BC_SCALE_MAX 0x00000026
+#define Mono_Posix_SysConf__SC_BC_STRING_MAX 0x00000027
+#define Mono_Posix_SysConf__SC_COLL_WEIGHTS_MAX 0x00000028
+#define Mono_Posix_SysConf__SC_EQUIV_CLASS_MAX 0x00000029
+#define Mono_Posix_SysConf__SC_EXPR_NEST_MAX 0x0000002a
+#define Mono_Posix_SysConf__SC_LINE_MAX 0x0000002b
+#define Mono_Posix_SysConf__SC_RE_DUP_MAX 0x0000002c
+#define Mono_Posix_SysConf__SC_CHARCLASS_NAME_MAX 0x0000002d
+#define Mono_Posix_SysConf__SC_2_VERSION 0x0000002e
+#define Mono_Posix_SysConf__SC_2_C_BIND 0x0000002f
+#define Mono_Posix_SysConf__SC_2_C_DEV 0x00000030
+#define Mono_Posix_SysConf__SC_2_FORT_DEV 0x00000031
+#define Mono_Posix_SysConf__SC_2_FORT_RUN 0x00000032
+#define Mono_Posix_SysConf__SC_2_SW_DEV 0x00000033
+#define Mono_Posix_SysConf__SC_2_LOCALEDEF 0x00000034
+#define Mono_Posix_SysConf__SC_PII 0x00000035
+#define Mono_Posix_SysConf__SC_PII_XTI 0x00000036
+#define Mono_Posix_SysConf__SC_PII_SOCKET 0x00000037
+#define Mono_Posix_SysConf__SC_PII_INTERNET 0x00000038
+#define Mono_Posix_SysConf__SC_PII_OSI 0x00000039
+#define Mono_Posix_SysConf__SC_POLL 0x0000003a
+#define Mono_Posix_SysConf__SC_SELECT 0x0000003b
+#define Mono_Posix_SysConf__SC_UIO_MAXIOV 0x0000003c
+#define Mono_Posix_SysConf__SC_IOV_MAX 0x0000003c
+#define Mono_Posix_SysConf__SC_PII_INTERNET_STREAM 0x0000003d
+#define Mono_Posix_SysConf__SC_PII_INTERNET_DGRAM 0x0000003e
+#define Mono_Posix_SysConf__SC_PII_OSI_COTS 0x0000003f
+#define Mono_Posix_SysConf__SC_PII_OSI_CLTS 0x00000040
+#define Mono_Posix_SysConf__SC_PII_OSI_M 0x00000041
+#define Mono_Posix_SysConf__SC_T_IOV_MAX 0x00000042
+#define Mono_Posix_SysConf__SC_THREADS 0x00000043
+#define Mono_Posix_SysConf__SC_THREAD_SAFE_FUNCTIONS 0x00000044
+#define Mono_Posix_SysConf__SC_GETGR_R_SIZE_MAX 0x00000045
+#define Mono_Posix_SysConf__SC_GETPW_R_SIZE_MAX 0x00000046
+#define Mono_Posix_SysConf__SC_LOGIN_NAME_MAX 0x00000047
+#define Mono_Posix_SysConf__SC_TTY_NAME_MAX 0x00000048
+#define Mono_Posix_SysConf__SC_THREAD_DESTRUCTOR_ITERATIONS 0x00000049
+#define Mono_Posix_SysConf__SC_THREAD_KEYS_MAX 0x0000004a
+#define Mono_Posix_SysConf__SC_THREAD_STACK_MIN 0x0000004b
+#define Mono_Posix_SysConf__SC_THREAD_THREADS_MAX 0x0000004c
+#define Mono_Posix_SysConf__SC_THREAD_ATTR_STACKADDR 0x0000004d
+#define Mono_Posix_SysConf__SC_THREAD_ATTR_STACKSIZE 0x0000004e
+#define Mono_Posix_SysConf__SC_THREAD_PRIORITY_SCHEDULING 0x0000004f
+#define Mono_Posix_SysConf__SC_THREAD_PRIO_INHERIT 0x00000050
+#define Mono_Posix_SysConf__SC_THREAD_PRIO_PROTECT 0x00000051
+#define Mono_Posix_SysConf__SC_THREAD_PROCESS_SHARED 0x00000052
+#define Mono_Posix_SysConf__SC_NPROCESSORS_CONF 0x00000053
+#define Mono_Posix_SysConf__SC_NPROCESSORS_ONLN 0x00000054
+#define Mono_Posix_SysConf__SC_PHYS_PAGES 0x00000055
+#define Mono_Posix_SysConf__SC_AVPHYS_PAGES 0x00000056
+#define Mono_Posix_SysConf__SC_ATEXIT_MAX 0x00000057
+#define Mono_Posix_SysConf__SC_PASS_MAX 0x00000058
+#define Mono_Posix_SysConf__SC_XOPEN_VERSION 0x00000059
+#define Mono_Posix_SysConf__SC_XOPEN_XCU_VERSION 0x0000005a
+#define Mono_Posix_SysConf__SC_XOPEN_UNIX 0x0000005b
+#define Mono_Posix_SysConf__SC_XOPEN_CRYPT 0x0000005c
+#define Mono_Posix_SysConf__SC_XOPEN_ENH_I18N 0x0000005d
+#define Mono_Posix_SysConf__SC_XOPEN_SHM 0x0000005e
+#define Mono_Posix_SysConf__SC_2_CHAR_TERM 0x0000005f
+#define Mono_Posix_SysConf__SC_2_C_VERSION 0x00000060
+#define Mono_Posix_SysConf__SC_2_UPE 0x00000061
+#define Mono_Posix_SysConf__SC_XOPEN_XPG2 0x00000062
+#define Mono_Posix_SysConf__SC_XOPEN_XPG3 0x00000063
+#define Mono_Posix_SysConf__SC_XOPEN_XPG4 0x00000064
+#define Mono_Posix_SysConf__SC_CHAR_BIT 0x00000065
+#define Mono_Posix_SysConf__SC_CHAR_MAX 0x00000066
+#define Mono_Posix_SysConf__SC_CHAR_MIN 0x00000067
+#define Mono_Posix_SysConf__SC_INT_MAX 0x00000068
+#define Mono_Posix_SysConf__SC_INT_MIN 0x00000069
+#define Mono_Posix_SysConf__SC_LONG_BIT 0x0000006a
+#define Mono_Posix_SysConf__SC_WORD_BIT 0x0000006b
+#define Mono_Posix_SysConf__SC_MB_LEN_MAX 0x0000006c
+#define Mono_Posix_SysConf__SC_NZERO 0x0000006d
+#define Mono_Posix_SysConf__SC_SSIZE_MAX 0x0000006e
+#define Mono_Posix_SysConf__SC_SCHAR_MAX 0x0000006f
+#define Mono_Posix_SysConf__SC_SCHAR_MIN 0x00000070
+#define Mono_Posix_SysConf__SC_SHRT_MAX 0x00000071
+#define Mono_Posix_SysConf__SC_SHRT_MIN 0x00000072
+#define Mono_Posix_SysConf__SC_UCHAR_MAX 0x00000073
+#define Mono_Posix_SysConf__SC_UINT_MAX 0x00000074
+#define Mono_Posix_SysConf__SC_ULONG_MAX 0x00000075
+#define Mono_Posix_SysConf__SC_USHRT_MAX 0x00000076
+#define Mono_Posix_SysConf__SC_NL_ARGMAX 0x00000077
+#define Mono_Posix_SysConf__SC_NL_LANGMAX 0x00000078
+#define Mono_Posix_SysConf__SC_NL_MSGMAX 0x00000079
+#define Mono_Posix_SysConf__SC_NL_NMAX 0x0000007a
+#define Mono_Posix_SysConf__SC_NL_SETMAX 0x0000007b
+#define Mono_Posix_SysConf__SC_NL_TEXTMAX 0x0000007c
+#define Mono_Posix_SysConf__SC_XBS5_ILP32_OFF32 0x0000007d
+#define Mono_Posix_SysConf__SC_XBS5_ILP32_OFFBIG 0x0000007e
+#define Mono_Posix_SysConf__SC_XBS5_LP64_OFF64 0x0000007f
+#define Mono_Posix_SysConf__SC_XBS5_LPBIG_OFFBIG 0x00000080
+#define Mono_Posix_SysConf__SC_XOPEN_LEGACY 0x00000081
+#define Mono_Posix_SysConf__SC_XOPEN_REALTIME 0x00000082
+#define Mono_Posix_SysConf__SC_XOPEN_REALTIME_THREADS 0x00000083
+#define Mono_Posix_SysConf__SC_ADVISORY_INFO 0x00000084
+#define Mono_Posix_SysConf__SC_BARRIERS 0x00000085
+#define Mono_Posix_SysConf__SC_BASE 0x00000086
+#define Mono_Posix_SysConf__SC_C_LANG_SUPPORT 0x00000087
+#define Mono_Posix_SysConf__SC_C_LANG_SUPPORT_R 0x00000088
+#define Mono_Posix_SysConf__SC_CLOCK_SELECTION 0x00000089
+#define Mono_Posix_SysConf__SC_CPUTIME 0x0000008a
+#define Mono_Posix_SysConf__SC_THREAD_CPUTIME 0x0000008b
+#define Mono_Posix_SysConf__SC_DEVICE_IO 0x0000008c
+#define Mono_Posix_SysConf__SC_DEVICE_SPECIFIC 0x0000008d
+#define Mono_Posix_SysConf__SC_DEVICE_SPECIFIC_R 0x0000008e
+#define Mono_Posix_SysConf__SC_FD_MGMT 0x0000008f
+#define Mono_Posix_SysConf__SC_FIFO 0x00000090
+#define Mono_Posix_SysConf__SC_PIPE 0x00000091
+#define Mono_Posix_SysConf__SC_FILE_ATTRIBUTES 0x00000092
+#define Mono_Posix_SysConf__SC_FILE_LOCKING 0x00000093
+#define Mono_Posix_SysConf__SC_FILE_SYSTEM 0x00000094
+#define Mono_Posix_SysConf__SC_MONOTONIC_CLOCK 0x00000095
+#define Mono_Posix_SysConf__SC_MULTI_PROCESS 0x00000096
+#define Mono_Posix_SysConf__SC_SINGLE_PROCESS 0x00000097
+#define Mono_Posix_SysConf__SC_NETWORKING 0x00000098
+#define Mono_Posix_SysConf__SC_READER_WRITER_LOCKS 0x00000099
+#define Mono_Posix_SysConf__SC_SPIN_LOCKS 0x0000009a
+#define Mono_Posix_SysConf__SC_REGEXP 0x0000009b
+#define Mono_Posix_SysConf__SC_REGEX_VERSION 0x0000009c
+#define Mono_Posix_SysConf__SC_SHELL 0x0000009d
+#define Mono_Posix_SysConf__SC_SIGNALS 0x0000009e
+#define Mono_Posix_SysConf__SC_SPAWN 0x0000009f
+#define Mono_Posix_SysConf__SC_SPORADIC_SERVER 0x000000a0
+#define Mono_Posix_SysConf__SC_THREAD_SPORADIC_SERVER 0x000000a1
+#define Mono_Posix_SysConf__SC_SYSTEM_DATABASE 0x000000a2
+#define Mono_Posix_SysConf__SC_SYSTEM_DATABASE_R 0x000000a3
+#define Mono_Posix_SysConf__SC_TIMEOUTS 0x000000a4
+#define Mono_Posix_SysConf__SC_TYPED_MEMORY_OBJECTS 0x000000a5
+#define Mono_Posix_SysConf__SC_USER_GROUPS 0x000000a6
+#define Mono_Posix_SysConf__SC_USER_GROUPS_R 0x000000a7
+#define Mono_Posix_SysConf__SC_2_PBS 0x000000a8
+#define Mono_Posix_SysConf__SC_2_PBS_ACCOUNTING 0x000000a9
+#define Mono_Posix_SysConf__SC_2_PBS_LOCATE 0x000000aa
+#define Mono_Posix_SysConf__SC_2_PBS_MESSAGE 0x000000ab
+#define Mono_Posix_SysConf__SC_2_PBS_TRACK 0x000000ac
+#define Mono_Posix_SysConf__SC_SYMLOOP_MAX 0x000000ad
+#define Mono_Posix_SysConf__SC_STREAMS 0x000000ae
+#define Mono_Posix_SysConf__SC_2_PBS_CHECKPOINT 0x000000af
+#define Mono_Posix_SysConf__SC_V6_ILP32_OFF32 0x000000b0
+#define Mono_Posix_SysConf__SC_V6_ILP32_OFFBIG 0x000000b1
+#define Mono_Posix_SysConf__SC_V6_LP64_OFF64 0x000000b2
+#define Mono_Posix_SysConf__SC_V6_LPBIG_OFFBIG 0x000000b3
+#define Mono_Posix_SysConf__SC_HOST_NAME_MAX 0x000000b4
+#define Mono_Posix_SysConf__SC_TRACE 0x000000b5
+#define Mono_Posix_SysConf__SC_TRACE_EVENT_FILTER 0x000000b6
+#define Mono_Posix_SysConf__SC_TRACE_INHERIT 0x000000b7
+#define Mono_Posix_SysConf__SC_TRACE_LOG 0x000000b8
+#define Mono_Posix_SysConf__SC_LEVEL1_ICACHE_SIZE 0x000000b9
+#define Mono_Posix_SysConf__SC_LEVEL1_ICACHE_ASSOC 0x000000ba
+#define Mono_Posix_SysConf__SC_LEVEL1_ICACHE_LINESIZE 0x000000bb
+#define Mono_Posix_SysConf__SC_LEVEL1_DCACHE_SIZE 0x000000bc
+#define Mono_Posix_SysConf__SC_LEVEL1_DCACHE_ASSOC 0x000000bd
+#define Mono_Posix_SysConf__SC_LEVEL1_DCACHE_LINESIZE 0x000000be
+#define Mono_Posix_SysConf__SC_LEVEL2_CACHE_SIZE 0x000000bf
+#define Mono_Posix_SysConf__SC_LEVEL2_CACHE_ASSOC 0x000000c0
+#define Mono_Posix_SysConf__SC_LEVEL2_CACHE_LINESIZE 0x000000c1
+#define Mono_Posix_SysConf__SC_LEVEL3_CACHE_SIZE 0x000000c2
+#define Mono_Posix_SysConf__SC_LEVEL3_CACHE_ASSOC 0x000000c3
+#define Mono_Posix_SysConf__SC_LEVEL3_CACHE_LINESIZE 0x000000c4
+#define Mono_Posix_SysConf__SC_LEVEL4_CACHE_SIZE 0x000000c5
+#define Mono_Posix_SysConf__SC_LEVEL4_CACHE_ASSOC 0x000000c6
+#define Mono_Posix_SysConf__SC_LEVEL4_CACHE_LINESIZE 0x000000c7
+int Mono_Posix_FromSysConf (int x, int *r);
+int Mono_Posix_ToSysConf (int x, int *r);
+
+#define Mono_Posix_ConfStr__CS_PATH 0x00000000
+#define Mono_Posix_ConfStr__CS_V6_WIDTH_RESTRICTED_ENVS 0x00000001
+#define Mono_Posix_ConfStr__CS_GNU_LIBC_VERSION 0x00000002
+#define Mono_Posix_ConfStr__CS_GNU_LIBPTHREAD_VERSION 0x00000003
+#define Mono_Posix_ConfStr__CS_LFS_CFLAGS 0x000003e8
+#define Mono_Posix_ConfStr__CS_LFS_LDFLAGS 0x000003e9
+#define Mono_Posix_ConfStr__CS_LFS_LIBS 0x000003ea
+#define Mono_Posix_ConfStr__CS_LFS_LINTFLAGS 0x000003eb
+#define Mono_Posix_ConfStr__CS_LFS64_CFLAGS 0x000003ec
+#define Mono_Posix_ConfStr__CS_LFS64_LDFLAGS 0x000003ed
+#define Mono_Posix_ConfStr__CS_LFS64_LIBS 0x000003ee
+#define Mono_Posix_ConfStr__CS_LFS64_LINTFLAGS 0x000003ef
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_CFLAGS 0x0000044c
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LDFLAGS 0x0000044d
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LIBS 0x0000044e
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFF32_LINTFLAGS 0x0000044f
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_CFLAGS 0x00000450
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LDFLAGS 0x00000451
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LIBS 0x00000452
+#define Mono_Posix_ConfStr__CS_XBS5_ILP32_OFFBIG_LINTFLAGS 0x00000453
+#define Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_CFLAGS 0x00000454
+#define Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LDFLAGS 0x00000455
+#define Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LIBS 0x00000456
+#define Mono_Posix_ConfStr__CS_XBS5_LP64_OFF64_LINTFLAGS 0x00000457
+#define Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_CFLAGS 0x00000458
+#define Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LDFLAGS 0x00000459
+#define Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LIBS 0x0000045a
+#define Mono_Posix_ConfStr__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 0x0000045b
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_CFLAGS 0x0000045c
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LDFLAGS 0x0000045d
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LIBS 0x0000045e
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS 0x0000045f
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 0x00000460
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 0x00000461
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LIBS 0x00000462
+#define Mono_Posix_ConfStr__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS 0x00000463
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_CFLAGS 0x00000464
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LDFLAGS 0x00000465
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LIBS 0x00000466
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LP64_OFF64_LINTFLAGS 0x00000467
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 0x00000468
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 0x00000469
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LIBS 0x0000046a
+#define Mono_Posix_ConfStr__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS 0x0000046b
+int Mono_Posix_FromConfStr (int x, int *r);
+int Mono_Posix_ToConfStr (int x, int *r);
+
+#define Mono_Posix_LockFlags_F_ULOCK 0x00000000
+#define Mono_Posix_LockFlags_F_LOCK 0x00000001
+#define Mono_Posix_LockFlags_F_TLOCK 0x00000002
+#define Mono_Posix_LockFlags_F_TEST 0x00000003
+int Mono_Posix_FromLockFlags (int x, int *r);
+int Mono_Posix_ToLockFlags (int x, int *r);
+
+#define Mono_Posix_PollEvents_POLLIN 0x00000001
+#define Mono_Posix_PollEvents_POLLPRI 0x00000002
+#define Mono_Posix_PollEvents_POLLOUT 0x00000004
+#define Mono_Posix_PollEvents_POLLERR 0x00000008
+#define Mono_Posix_PollEvents_POLLHUP 0x00000010
+#define Mono_Posix_PollEvents_POLLNVAL 0x00000020
+#define Mono_Posix_PollEvents_POLLRDNORM 0x00000040
+#define Mono_Posix_PollEvents_POLLRDBAND 0x00000080
+#define Mono_Posix_PollEvents_POLLWRNORM 0x00000100
+#define Mono_Posix_PollEvents_POLLWRBAND 0x00000200
+int Mono_Posix_FromPollEvents (short x, short *r);
+int Mono_Posix_ToPollEvents (short x, short *r);
+
+G_END_DECLS
+
+#endif /* ndef INC_Mono_Posix_map_H */
+
diff --git a/support/mph.h b/support/mph.h
new file mode 100644
index 00000000000..49a5e9781fc
--- /dev/null
+++ b/support/mph.h
@@ -0,0 +1,133 @@
+/*
+ * Common/shared macros and routines.
+ *
+ * This file contains macros of the form
+ *
+ * mph_return_if_TYPE_overflow(val);
+ *
+ * Which tests `val' for a TYPE underflow/overflow (that is, is `val' within
+ * the range for TYPE?). If `val' can't fit in TYPE, errno is set to
+ * EOVERFLOW, and `return -1' is executed (which is why it's a macro).
+ *
+ * Assumptions:
+ *
+ * I'm working from GLibc, so that's the basis for my assumptions. They may
+ * not be completely portable, in which case I'll need to fix my assumptions.
+ * :-(
+ *
+ * See the typedefs for type size assumptions. These typedefs *must* be kept
+ * in sync with the types used in Mono.Posix.dll.
+ */
+
+#ifndef INC_mph_H
+#define INC_mph_H
+
+#include <config.h>
+
+#include <limits.h> /* LONG_MAX, ULONG_MAX */
+#include <errno.h> /* for ERANGE */
+#include <glib/gtypes.h> /* for g* types, etc. */
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h> /* for SIZE_MAX */
+#endif
+
+#if __APPLE__ || __BSD__
+#define MPH_ON_BSD
+#endif
+
+typedef gint64 mph_blkcnt_t;
+typedef gint64 mph_blksize_t;
+typedef guint64 mph_dev_t;
+typedef guint64 mph_ino_t;
+typedef guint64 mph_nlink_t;
+typedef gint64 mph_off_t;
+typedef guint64 mph_size_t;
+typedef gint64 mph_ssize_t;
+typedef gint32 mph_pid_t;
+typedef guint32 mph_gid_t;
+typedef guint32 mph_uid_t;
+typedef gint64 mph_time_t;
+typedef gint64 mph_clock_t;
+
+#ifdef HAVE_LARGE_FILE_SUPPORT
+#define MPH_OFF_T_MAX G_MAXINT64
+#define MPH_OFF_T_MIN G_MININT64
+#else
+#define MPH_OFF_T_MAX G_MAXINT32
+#define MPH_OFF_T_MIN G_MININT32
+#endif
+
+#ifdef SIZE_MAX
+#define MPH_SIZE_T_MAX SIZE_MAX
+#elif SIZEOF_SIZE_T == 8
+#define MPH_SIZE_T_MAX G_MAXUINT64
+#elif SIZEOF_SIZE_T == 4
+#define MPH_SIZE_T_MAX G_MAXUINT32
+#else
+#error "sizeof(size_t) is unknown!"
+#endif
+
+#define _mph_return_val_if_cb_(val, ret, cb) G_STMT_START{ \
+ if (cb (val)) { \
+ errno = EOVERFLOW; \
+ return ret; \
+ }}G_STMT_END
+
+#define mph_have_long_overflow(var) ((var) > LONG_MAX || (var) < LONG_MIN)
+
+#define mph_return_val_if_long_overflow(var, ret) \
+ _mph_return_val_if_cb_(var, ret, mph_have_long_overflow)
+
+#define mph_return_if_long_overflow(var) mph_return_val_if_long_overflow(var, -1)
+
+#define mph_have_ulong_overflow(var) ((var) > ULONG_MAX)
+
+#define mph_return_val_if_ulong_overflow(var, ret) \
+ _mph_return_val_if_cb_(var, ret, mph_have_ulong_overflow)
+
+#define mph_return_if_ulong_overflow(var) mph_return_val_if_ulong_overflow(var, -1)
+
+#define mph_have_size_t_overflow(var) ((var) > MPH_SIZE_T_MAX)
+
+#define mph_return_val_if_size_t_overflow(var, ret) \
+ _mph_return_val_if_cb_(var, ret, mph_have_size_t_overflow)
+
+#define mph_return_if_size_t_overflow(var) mph_return_val_if_size_t_overflow(var, -1)
+
+#define mph_have_off_t_overflow(var) \
+ (((var) < MPH_OFF_T_MIN) || ((var) > MPH_OFF_T_MAX))
+
+#define mph_return_val_if_off_t_overflow(var, ret) \
+ _mph_return_val_if_cb_(var, ret, mph_have_off_t_overflow)
+
+#define mph_return_if_off_t_overflow(var) mph_return_val_if_size_t_overflow(var, -1)
+
+#define mph_return_if_time_t_overflow(var) mph_return_if_long_overflow(var)
+
+/*
+ * Helper function for functions which use ERANGE (such as getpwnam_r and
+ * getgrnam_r). These functions accept buffers which are dynamically
+ * allocated so that they're only as large as necessary. However, Linux and
+ * Mac OS X differ on how to signal an error value.
+ *
+ * Linux returns the error value directly, while Mac OS X is more traditional,
+ * returning -1 and setting errno accordingly.
+ *
+ * Unify the checking in one place.
+ */
+static inline int
+recheck_range (int ret)
+{
+ if (ret == ERANGE)
+ return 1;
+ if (ret == -1)
+ return errno == ERANGE;
+ return 0;
+}
+
+#endif /* ndef INC_mph_H */
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/old-map.c b/support/old-map.c
new file mode 100644
index 00000000000..dee52b7d6b6
--- /dev/null
+++ b/support/old-map.c
@@ -0,0 +1,177 @@
+/* This file was automatically generated by make-map from Mono.Posix.dll */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <poll.h>
+#include "old-map.h"
+int map_Mono_Posix_OpenFlags (int x)
+{
+ int r = 0;
+ if ((x & Mono_Posix_OpenFlags_O_RDONLY) != 0)
+ r |= O_RDONLY;
+ if ((x & Mono_Posix_OpenFlags_O_WRONLY) != 0)
+ r |= O_WRONLY;
+ if ((x & Mono_Posix_OpenFlags_O_RDWR) != 0)
+ r |= O_RDWR;
+ if ((x & Mono_Posix_OpenFlags_O_CREAT) != 0)
+ r |= O_CREAT;
+ if ((x & Mono_Posix_OpenFlags_O_EXCL) != 0)
+ r |= O_EXCL;
+ if ((x & Mono_Posix_OpenFlags_O_NOCTTY) != 0)
+ r |= O_NOCTTY;
+ if ((x & Mono_Posix_OpenFlags_O_TRUNC) != 0)
+ r |= O_TRUNC;
+ if ((x & Mono_Posix_OpenFlags_O_APPEND) != 0)
+ r |= O_APPEND;
+ if ((x & Mono_Posix_OpenFlags_O_NONBLOCK) != 0)
+ r |= O_NONBLOCK;
+#ifdef O_SYNC
+ if ((x & Mono_Posix_OpenFlags_O_SYNC) != 0)
+ r |= O_SYNC;
+#endif
+ return r;
+}
+
+int map_Mono_Posix_FileMode (int x)
+{
+ int r = 0;
+ if ((x & Mono_Posix_FileMode_S_ISUID) != 0)
+ r |= S_ISUID;
+ if ((x & Mono_Posix_FileMode_S_ISGID) != 0)
+ r |= S_ISGID;
+ if ((x & Mono_Posix_FileMode_S_ISVTX) != 0)
+ r |= S_ISVTX;
+ if ((x & Mono_Posix_FileMode_S_IRUSR) != 0)
+ r |= S_IRUSR;
+ if ((x & Mono_Posix_FileMode_S_IWUSR) != 0)
+ r |= S_IWUSR;
+ if ((x & Mono_Posix_FileMode_S_IXUSR) != 0)
+ r |= S_IXUSR;
+ if ((x & Mono_Posix_FileMode_S_IRGRP) != 0)
+ r |= S_IRGRP;
+ if ((x & Mono_Posix_FileMode_S_IWGRP) != 0)
+ r |= S_IWGRP;
+ if ((x & Mono_Posix_FileMode_S_IXGRP) != 0)
+ r |= S_IXGRP;
+ if ((x & Mono_Posix_FileMode_S_IROTH) != 0)
+ r |= S_IROTH;
+ if ((x & Mono_Posix_FileMode_S_IWOTH) != 0)
+ r |= S_IWOTH;
+ if ((x & Mono_Posix_FileMode_S_IXOTH) != 0)
+ r |= S_IXOTH;
+ return r;
+}
+
+int map_Mono_Posix_WaitOptions (int x)
+{
+ int r = 0;
+ if ((x & Mono_Posix_WaitOptions_WNOHANG) != 0)
+ r |= WNOHANG;
+ if ((x & Mono_Posix_WaitOptions_WUNTRACED) != 0)
+ r |= WUNTRACED;
+ return r;
+}
+
+int map_Mono_Posix_AccessMode (int x)
+{
+ int r = 0;
+ if ((x & Mono_Posix_AccessMode_R_OK) != 0)
+ r |= R_OK;
+ if ((x & Mono_Posix_AccessMode_W_OK) != 0)
+ r |= W_OK;
+ if ((x & Mono_Posix_AccessMode_X_OK) != 0)
+ r |= X_OK;
+ if ((x & Mono_Posix_AccessMode_F_OK) != 0)
+ r |= F_OK;
+ return r;
+}
+
+int map_Mono_Posix_Signals (int x)
+{
+ if (x == Mono_Posix_Signals_SIGHUP)
+ return SIGHUP;
+ if (x == Mono_Posix_Signals_SIGINT)
+ return SIGINT;
+ if (x == Mono_Posix_Signals_SIGQUIT)
+ return SIGQUIT;
+ if (x == Mono_Posix_Signals_SIGILL)
+ return SIGILL;
+ if (x == Mono_Posix_Signals_SIGTRAP)
+ return SIGTRAP;
+ if (x == Mono_Posix_Signals_SIGABRT)
+ return SIGABRT;
+ if (x == Mono_Posix_Signals_SIGBUS)
+ return SIGBUS;
+ if (x == Mono_Posix_Signals_SIGFPE)
+ return SIGFPE;
+ if (x == Mono_Posix_Signals_SIGKILL)
+ return SIGKILL;
+ if (x == Mono_Posix_Signals_SIGUSR1)
+ return SIGUSR1;
+ if (x == Mono_Posix_Signals_SIGSEGV)
+ return SIGSEGV;
+ if (x == Mono_Posix_Signals_SIGUSR2)
+ return SIGUSR2;
+ if (x == Mono_Posix_Signals_SIGPIPE)
+ return SIGPIPE;
+ if (x == Mono_Posix_Signals_SIGALRM)
+ return SIGALRM;
+ if (x == Mono_Posix_Signals_SIGTERM)
+ return SIGTERM;
+ if (x == Mono_Posix_Signals_SIGCHLD)
+ return SIGCHLD;
+ if (x == Mono_Posix_Signals_SIGCONT)
+ return SIGCONT;
+ if (x == Mono_Posix_Signals_SIGSTOP)
+ return SIGSTOP;
+ if (x == Mono_Posix_Signals_SIGTSTP)
+ return SIGTSTP;
+ if (x == Mono_Posix_Signals_SIGTTIN)
+ return SIGTTIN;
+ if (x == Mono_Posix_Signals_SIGTTOU)
+ return SIGTTOU;
+ if (x == Mono_Posix_Signals_SIGURG)
+ return SIGURG;
+ if (x == Mono_Posix_Signals_SIGXCPU)
+ return SIGXCPU;
+ if (x == Mono_Posix_Signals_SIGXFSZ)
+ return SIGXFSZ;
+ if (x == Mono_Posix_Signals_SIGVTALRM)
+ return SIGVTALRM;
+ if (x == Mono_Posix_Signals_SIGPROF)
+ return SIGPROF;
+ if (x == Mono_Posix_Signals_SIGWINCH)
+ return SIGWINCH;
+ if (x == Mono_Posix_Signals_SIGIO)
+ return SIGIO;
+ if (x == Mono_Posix_Signals_SIGSYS)
+ return SIGSYS;
+ return -1;
+}
+
+int map_Mono_Posix_PollEvents (int x)
+{
+ int r = 0;
+ if ((x & Mono_Posix_PollEvents_POLLIN) != 0)
+ r |= POLLIN;
+ if ((x & Mono_Posix_PollEvents_POLLPRI) != 0)
+ r |= POLLPRI;
+ if ((x & Mono_Posix_PollEvents_POLLOUT) != 0)
+ r |= POLLOUT;
+ if ((x & Mono_Posix_PollEvents_POLLERR) != 0)
+ r |= POLLERR;
+ if ((x & Mono_Posix_PollEvents_POLLHUP) != 0)
+ r |= POLLHUP;
+ if ((x & Mono_Posix_PollEvents_POLLNVAL) != 0)
+ r |= POLLNVAL;
+ return r;
+}
+
diff --git a/support/old-map.h b/support/old-map.h
new file mode 100644
index 00000000000..369c1778018
--- /dev/null
+++ b/support/old-map.h
@@ -0,0 +1,71 @@
+/* This file was automatically generated by make-map from Mono.Posix.dll */
+
+#define Mono_Posix_OpenFlags_O_RDONLY 0x00000000
+#define Mono_Posix_OpenFlags_O_WRONLY 0x00000001
+#define Mono_Posix_OpenFlags_O_RDWR 0x00000002
+#define Mono_Posix_OpenFlags_O_CREAT 0x00000004
+#define Mono_Posix_OpenFlags_O_EXCL 0x00000008
+#define Mono_Posix_OpenFlags_O_NOCTTY 0x00000010
+#define Mono_Posix_OpenFlags_O_TRUNC 0x00000020
+#define Mono_Posix_OpenFlags_O_APPEND 0x00000040
+#define Mono_Posix_OpenFlags_O_NONBLOCK 0x00000080
+#define Mono_Posix_OpenFlags_O_SYNC 0x00000100
+
+#define Mono_Posix_FileMode_S_ISUID 0x00000800
+#define Mono_Posix_FileMode_S_ISGID 0x00000400
+#define Mono_Posix_FileMode_S_ISVTX 0x00000200
+#define Mono_Posix_FileMode_S_IRUSR 0x00000100
+#define Mono_Posix_FileMode_S_IWUSR 0x00000080
+#define Mono_Posix_FileMode_S_IXUSR 0x00000040
+#define Mono_Posix_FileMode_S_IRGRP 0x00000020
+#define Mono_Posix_FileMode_S_IWGRP 0x00000010
+#define Mono_Posix_FileMode_S_IXGRP 0x00000008
+#define Mono_Posix_FileMode_S_IROTH 0x00000004
+#define Mono_Posix_FileMode_S_IWOTH 0x00000002
+#define Mono_Posix_FileMode_S_IXOTH 0x00000001
+
+#define Mono_Posix_WaitOptions_WNOHANG 0x00000000
+#define Mono_Posix_WaitOptions_WUNTRACED 0x00000001
+
+#define Mono_Posix_AccessMode_R_OK 0x00000001
+#define Mono_Posix_AccessMode_W_OK 0x00000002
+#define Mono_Posix_AccessMode_X_OK 0x00000004
+#define Mono_Posix_AccessMode_F_OK 0x00000008
+
+#define Mono_Posix_Signals_SIGHUP 0x00000000
+#define Mono_Posix_Signals_SIGINT 0x00000001
+#define Mono_Posix_Signals_SIGQUIT 0x00000002
+#define Mono_Posix_Signals_SIGILL 0x00000003
+#define Mono_Posix_Signals_SIGTRAP 0x00000004
+#define Mono_Posix_Signals_SIGABRT 0x00000005
+#define Mono_Posix_Signals_SIGBUS 0x00000006
+#define Mono_Posix_Signals_SIGFPE 0x00000007
+#define Mono_Posix_Signals_SIGKILL 0x00000008
+#define Mono_Posix_Signals_SIGUSR1 0x00000009
+#define Mono_Posix_Signals_SIGSEGV 0x0000000a
+#define Mono_Posix_Signals_SIGUSR2 0x0000000b
+#define Mono_Posix_Signals_SIGPIPE 0x0000000c
+#define Mono_Posix_Signals_SIGALRM 0x0000000d
+#define Mono_Posix_Signals_SIGTERM 0x0000000e
+#define Mono_Posix_Signals_SIGCHLD 0x0000000f
+#define Mono_Posix_Signals_SIGCONT 0x00000010
+#define Mono_Posix_Signals_SIGSTOP 0x00000011
+#define Mono_Posix_Signals_SIGTSTP 0x00000012
+#define Mono_Posix_Signals_SIGTTIN 0x00000013
+#define Mono_Posix_Signals_SIGTTOU 0x00000014
+#define Mono_Posix_Signals_SIGURG 0x00000015
+#define Mono_Posix_Signals_SIGXCPU 0x00000016
+#define Mono_Posix_Signals_SIGXFSZ 0x00000017
+#define Mono_Posix_Signals_SIGVTALRM 0x00000018
+#define Mono_Posix_Signals_SIGPROF 0x00000019
+#define Mono_Posix_Signals_SIGWINCH 0x0000001a
+#define Mono_Posix_Signals_SIGIO 0x0000001b
+#define Mono_Posix_Signals_SIGSYS 0x0000001c
+
+#define Mono_Posix_PollEvents_POLLIN 0x00000002
+#define Mono_Posix_PollEvents_POLLPRI 0x00000003
+#define Mono_Posix_PollEvents_POLLOUT 0x00000004
+#define Mono_Posix_PollEvents_POLLERR 0x00000005
+#define Mono_Posix_PollEvents_POLLHUP 0x00000006
+#define Mono_Posix_PollEvents_POLLNVAL 0x00000007
+
diff --git a/support/pwd.c b/support/pwd.c
new file mode 100644
index 00000000000..05357f4f617
--- /dev/null
+++ b/support/pwd.c
@@ -0,0 +1,264 @@
+/*
+ * <pwd.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <pwd.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+struct Mono_Posix_Syscall__Passwd {
+ /* string */ char *pw_name;
+ /* string */ char *pw_passwd;
+ /* uid_t */ mph_uid_t pw_uid;
+ /* gid_t */ mph_gid_t pw_gid;
+ /* string */ char *pw_gecos;
+ /* string */ char *pw_dir;
+ /* string */ char *pw_shell;
+ /* string */ char *_pw_buf_;
+};
+
+/*
+ * Copy the native `passwd' structure to it's managed representation.
+ *
+ * To minimize separate mallocs, all the strings are allocated within the same
+ * memory block (stored in _pw_buf_).
+ */
+static int
+copy_passwd (struct Mono_Posix_Syscall__Passwd *to, struct passwd *from)
+{
+ enum {PW_NAME = 0, PW_PASSWD, PW_GECOS, PW_DIR, PW_SHELL, PW_LAST};
+ size_t buflen, len[PW_LAST];
+ /* bool */ unsigned char copy[PW_LAST] = {0};
+ const char *source[PW_LAST];
+ char **dest[PW_LAST];
+ int i;
+ char *cur;
+
+ to->pw_uid = from->pw_uid;
+ to->pw_gid = from->pw_gid;
+
+ to->pw_name = NULL;
+ to->pw_passwd = NULL;
+ to->pw_gecos = NULL;
+ to->pw_dir = NULL;
+ to->pw_shell = NULL;
+ to->_pw_buf_ = NULL;
+
+ source[PW_NAME] = from->pw_name;
+ source[PW_PASSWD] = from->pw_passwd;
+ source[PW_GECOS] = from->pw_gecos;
+ source[PW_DIR] = from->pw_dir;
+ source[PW_SHELL] = from->pw_shell;
+
+ dest[PW_NAME] = &to->pw_name;
+ dest[PW_PASSWD] = &to->pw_passwd;
+ dest[PW_GECOS] = &to->pw_gecos;
+ dest[PW_DIR] = &to->pw_dir;
+ dest[PW_SHELL] = &to->pw_shell;
+
+ buflen = PW_LAST;
+
+ /* over-rigorous checking for integer overflow */
+ for (i = 0; i != PW_LAST; ++i) {
+ len[i] = strlen (source[i]);
+ if (len[i] < INT_MAX - buflen) {
+ buflen += len[i];
+ copy[i] = 1;
+ }
+ }
+
+ cur = to->_pw_buf_ = (char*) malloc (buflen);
+ if (cur == NULL) {
+ return -1;
+ }
+
+ for (i = 0; i != PW_LAST; ++i) {
+ if (copy[i]) {
+ *dest[i] = strcpy (cur, source[i]);
+ cur += (len[i] + 1);
+ }
+ }
+
+ return 0;
+}
+
+gint32
+Mono_Posix_Syscall_getpwnam (const char *name, struct Mono_Posix_Syscall__Passwd *pwbuf)
+{
+ struct passwd *pw;
+
+ if (pwbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ pw = getpwnam (name);
+ if (pw == NULL)
+ return -1;
+
+ if (copy_passwd (pwbuf, pw) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+
+gint32
+Mono_Posix_Syscall_getpwuid (mph_uid_t uid, struct Mono_Posix_Syscall__Passwd *pwbuf)
+{
+ struct passwd *pw;
+
+ if (pwbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ errno = 0;
+ pw = getpwuid (uid);
+ if (pw == NULL) {
+ return -1;
+ }
+
+ if (copy_passwd (pwbuf, pw) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+
+#ifdef HAVE_GETPWNAM_R
+gint32
+Mono_Posix_Syscall_getpwnam_r (const char *name,
+ struct Mono_Posix_Syscall__Passwd *pwbuf,
+ struct passwd **pwbufp)
+{
+ char *buf, *buf2;
+ size_t buflen;
+ int r;
+ struct passwd _pwbuf;
+
+ if (pwbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ buf = buf2 = NULL;
+ buflen = 2;
+
+ do {
+ buf2 = realloc (buf, buflen *= 2);
+ if (buf2 == NULL) {
+ free (buf);
+ errno = ENOMEM;
+ return -1;
+ }
+ buf = buf2;
+ } while ((r = getpwnam_r (name, &_pwbuf, buf, buflen, pwbufp)) &&
+ recheck_range (r));
+
+ if (r == 0 && copy_passwd (pwbuf, &_pwbuf) == -1)
+ r = errno = ENOMEM;
+ free (buf);
+
+ return r;
+}
+#endif /* ndef HAVE_GETPWNAM_R */
+
+#ifdef HAVE_GETPWUID_R
+gint32
+Mono_Posix_Syscall_getpwuid_r (mph_uid_t uid,
+ struct Mono_Posix_Syscall__Passwd *pwbuf,
+ struct passwd **pwbufp)
+{
+ char *buf, *buf2;
+ size_t buflen;
+ int r;
+ struct passwd _pwbuf;
+
+ if (pwbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ buf = buf2 = NULL;
+ buflen = 2;
+
+ do {
+ buf2 = realloc (buf, buflen *= 2);
+ if (buf2 == NULL) {
+ free (buf);
+ errno = ENOMEM;
+ return -1;
+ }
+ buf = buf2;
+ } while ((r = getpwuid_r (uid, &_pwbuf, buf, buflen, pwbufp)) &&
+ recheck_range (r));
+
+ if (r == 0 && copy_passwd (pwbuf, &_pwbuf) == -1)
+ r = errno = ENOMEM;
+ free (buf);
+
+ return r;
+}
+#endif /* ndef HAVE_GETPWUID_R */
+
+gint32
+Mono_Posix_Syscall_getpwent (struct Mono_Posix_Syscall__Passwd *pwbuf)
+{
+ struct passwd *pw;
+
+ if (pwbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ pw = getpwent ();
+ if (pw == NULL)
+ return -1;
+
+ if (copy_passwd (pwbuf, pw) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+
+#ifdef HAVE_FGETPWENT
+gint32
+Mono_Posix_Syscall_fgetpwent (FILE *stream, struct Mono_Posix_Syscall__Passwd *pwbuf)
+{
+ struct passwd *pw;
+
+ if (pwbuf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ pw = fgetpwent (stream);
+ if (pw == NULL)
+ return -1;
+
+ if (copy_passwd (pwbuf, pw) == -1) {
+ errno = ENOMEM;
+ return -1;
+ }
+ return 0;
+}
+#endif /* ndef HAVE_FGETPWENT */
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/stdio.c b/support/stdio.c
new file mode 100644
index 00000000000..d4231259a51
--- /dev/null
+++ b/support/stdio.c
@@ -0,0 +1,32 @@
+/*
+ * <stdio.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <stdio.h>
+
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+gint32
+Mono_Posix_Syscall_L_ctermid (void)
+{
+ return L_ctermid;
+}
+
+gint32
+Mono_Posix_Syscall_L_cuserid (void)
+{
+ return L_cuserid;
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/stdlib.c b/support/stdlib.c
new file mode 100644
index 00000000000..d29c57b0fef
--- /dev/null
+++ b/support/stdlib.c
@@ -0,0 +1,47 @@
+/*
+ * <stdlib.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <stdlib.h>
+
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+void*
+Mono_Posix_Stdlib_calloc (mph_size_t nmemb, mph_size_t size)
+{
+ if (mph_have_size_t_overflow(nmemb) || mph_have_size_t_overflow(size))
+ return NULL;
+
+ return calloc ((size_t) nmemb, (size_t) size);
+}
+
+void*
+Mono_Posix_Stdlib_malloc (mph_size_t size)
+{
+ if (mph_have_size_t_overflow(size))
+ return NULL;
+
+ return malloc ((size_t) size);
+}
+
+void*
+Mono_Posix_Stdlib_realloc (void* ptr, mph_size_t size)
+{
+ if (mph_have_size_t_overflow(size))
+ return NULL;
+
+ return realloc (ptr, (size_t) size);
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/sys-mman.c b/support/sys-mman.c
new file mode 100644
index 00000000000..a91f4f841e6
--- /dev/null
+++ b/support/sys-mman.c
@@ -0,0 +1,36 @@
+/*
+ * <sys/mman.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#define _XOPEN_SOURCE 600
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <errno.h>
+
+#include "map.h"
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+gint32
+Mono_Posix_Syscall_posix_madvise (void *addr, mph_size_t len, gint32 advice)
+{
+ mph_return_if_size_t_overflow (len);
+
+ if (Mono_Posix_FromPosixMadviseAdvice (advice, &advice) == -1)
+ return -1;
+
+ return posix_madvise (addr, (size_t) len, advice);
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/sys-mount.c b/support/sys-mount.c
new file mode 100644
index 00000000000..b13933c7f71
--- /dev/null
+++ b/support/sys-mount.c
@@ -0,0 +1,56 @@
+/*
+ * <sys/mount.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <sys/mount.h>
+#include <glib/gtypes.h>
+
+#include "mph.h"
+#include "map.h"
+
+G_BEGIN_DECLS
+
+gint32
+Mono_Posix_Syscall_mount (const char *source, const char *target,
+ const char *filesystemtype, guint64 mountflags, void *data)
+{
+ if (Mono_Posix_FromMountFlags (mountflags, &mountflags) == -1)
+ return -1;
+
+#ifdef MPH_ON_BSD
+ return mount (filesystemtype, target, mountflags, data);
+#else
+ return mount (source, target, filesystemtype, (unsigned long) mountflags, data);
+#endif
+}
+
+gint32
+Mono_Posix_Syscall_umount (const char *source)
+{
+#ifdef MPH_ON_BSD
+ return unmount (source, MNT_FORCE);
+#else
+ return umount (source);
+#endif
+}
+
+gint32
+Mono_Posix_Syscall_umount2 (const char *source, gint32 flags)
+{
+#ifdef MPH_ON_BSD
+ return unmount (source, flags);
+#else
+ return umount2 (source, flags);
+#endif
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/sys-sendfile.c b/support/sys-sendfile.c
new file mode 100644
index 00000000000..0a6c7f6d59f
--- /dev/null
+++ b/support/sys-sendfile.c
@@ -0,0 +1,43 @@
+/*
+ * <sys/sendfile.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <sys/types.h>
+#include <errno.h>
+
+#ifdef HAVE_SYS_SENDFILE_H
+#include <sys/sendfile.h>
+#endif /* ndef HAVE_SYS_SENDFILE_H */
+
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+#ifdef HAVE_SENDFILE
+mph_ssize_t
+Mono_Posix_Syscall_sendfile (int out_fd, int in_fd, mph_off_t *offset, mph_size_t count)
+{
+ off_t _offset;
+ ssize_t r;
+ mph_return_if_off_t_overflow (*offset);
+
+ _offset = *offset;
+
+ r = sendfile (out_fd, in_fd, &_offset, (size_t) count);
+
+ *offset = _offset;
+
+ return r;
+}
+#endif /* ndef HAVE_SENDFILE */
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/sys-stat.c b/support/sys-stat.c
new file mode 100644
index 00000000000..3ff4888316e
--- /dev/null
+++ b/support/sys-stat.c
@@ -0,0 +1,118 @@
+/*
+ * <sys/stat.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif /* ndef _GNU_SOURCE */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "map.h"
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+struct Mono_Posix_Syscall_Stat {
+ /* dev_t */ mph_dev_t st_dev; /* device */
+ /* ino_t */ mph_ino_t st_ino; /* inode */
+ /* mode_t */ guint32 st_mode; /* protection */
+ guint32 _padding_; /* structure padding */
+ /* nlink_t */ mph_nlink_t st_nlink; /* number of hard links */
+ /* uid_t */ mph_uid_t st_uid; /* user ID of owner */
+ /* gid_t */ mph_gid_t st_gid; /* group ID of owner */
+ /* dev_t */ mph_dev_t st_rdev; /* device type (if inode device) */
+ /* off_t */ mph_off_t st_size; /* total size, in bytes */
+ /* blksize_t */ mph_blksize_t st_blksize; /* blocksize for filesystem I/O */
+ /* blkcnt_t */ mph_blkcnt_t st_blocks; /* number of blocks allocated */
+
+ /* st_atime, st_mtime, and st_ctime are macros (!), so use a slightly
+ * different name to appease CPP */
+
+ /* time_t */ mph_time_t st_atime_; /* time of last access */
+ /* time_t */ mph_time_t st_mtime_; /* time of last modification */
+ /* time_t */ mph_time_t st_ctime_; /* time of last status change */
+};
+
+static int
+copy_stat (struct Mono_Posix_Syscall_Stat *to, struct stat *from)
+{
+ if (Mono_Posix_ToFilePermissions (from->st_mode, &to->st_mode) == -1)
+ return -1;
+ to->st_dev = from->st_dev;
+ to->st_ino = from->st_ino;
+ to->st_nlink = from->st_nlink;
+ to->st_uid = from->st_uid;
+ to->st_gid = from->st_gid;
+ to->st_rdev = from->st_rdev;
+ to->st_size = from->st_size;
+ to->st_blksize = from->st_blksize;
+ to->st_blocks = from->st_blocks;
+ to->st_atime_ = from->st_atime;
+ to->st_mtime_ = from->st_mtime;
+ to->st_ctime_ = from->st_ctime;
+ return 0;
+}
+
+gint32
+Mono_Posix_Syscall_stat (const char *file_name, struct Mono_Posix_Syscall_Stat *buf)
+{
+ int r;
+ struct stat _buf;
+
+ if (buf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+ r = stat (file_name, &_buf);
+ if (r != -1 && copy_stat (buf, &_buf) == -1)
+ r = -1;
+ return r;
+}
+
+gint32
+Mono_Posix_Syscall_fstat (int filedes, struct Mono_Posix_Syscall_Stat *buf)
+{
+ int r;
+ struct stat _buf;
+
+ if (buf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+ r = fstat (filedes, &_buf);
+ if (r != -1 && copy_stat (buf, &_buf) == -1)
+ r = -1;
+ return r;
+}
+
+gint32
+Mono_Posix_Syscall_lstat (const char *file_name, struct Mono_Posix_Syscall_Stat *buf)
+{
+ int r;
+ struct stat _buf;
+
+ if (buf == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+ r = lstat (file_name, &_buf);
+ if (r != -1 && copy_stat (buf, &_buf) == -1)
+ r = -1;
+ return r;
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/sys-wait.c b/support/sys-wait.c
new file mode 100644
index 00000000000..12a4b1701a7
--- /dev/null
+++ b/support/sys-wait.c
@@ -0,0 +1,59 @@
+/*
+ * <sys/wait.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <glib/gtypes.h>
+
+#include "map.h"
+
+G_BEGIN_DECLS
+
+gint32
+Mono_Posix_Syscall_WIFEXITED (gint32 status)
+{
+ return WIFEXITED (status);
+}
+
+gint32
+Mono_Posix_Syscall_WEXITSTATUS (gint32 status)
+{
+ return WEXITSTATUS (status);
+}
+
+gint32
+Mono_Posix_Syscall_WIFSIGNALED (gint32 status)
+{
+ return WIFSIGNALED (status);
+}
+
+gint32
+Mono_Posix_Syscall_WTERMSIG (gint32 status)
+{
+ return WTERMSIG (status);
+}
+
+gint32
+Mono_Posix_Syscall_WIFSTOPPED (gint32 status)
+{
+ return WIFSTOPPED (status);
+}
+
+gint32
+Mono_Posix_Syscall_WSTOPSIG (gint32 status)
+{
+ return WSTOPSIG (status);
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/time.c b/support/time.c
new file mode 100644
index 00000000000..71bbae9d037
--- /dev/null
+++ b/support/time.c
@@ -0,0 +1,56 @@
+/*
+ * <time.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#define _SVID_SOURCE
+#include <time.h>
+#include <errno.h>
+
+#include "mph.h"
+#include <glib/gtypes.h>
+
+G_BEGIN_DECLS
+
+#ifdef HAVE_STIME
+gint32
+Mono_Posix_Syscall_stime (mph_time_t *t)
+{
+ time_t _t;
+ if (t == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+ mph_return_if_time_t_overflow (*t);
+ _t = (time_t) *t;
+ return stime (&_t);
+}
+#endif /* ndef HAVE_STIME */
+
+mph_time_t
+Mono_Posix_Syscall_time (mph_time_t *t)
+{
+ time_t _t, r;
+ if (t == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ mph_return_if_time_t_overflow (*t);
+
+ _t = (time_t) *t;
+ r = time (&_t);
+ *t = _t;
+
+ return r;
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/unistd.c b/support/unistd.c
new file mode 100644
index 00000000000..33a640895dc
--- /dev/null
+++ b/support/unistd.c
@@ -0,0 +1,233 @@
+/*
+ * <unistd.h> wrapper functions.
+ *
+ * Authors:
+ * Jonathan Pryor (jonpryor@vt.edu)
+ *
+ * Copyright (C) 2004 Jonathan Pryor
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif /* ndef _GNU_SOURCE */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+#include <string.h> /* for swab(3) on Mac OS X */
+
+#include "map.h"
+#include "mph.h"
+
+G_BEGIN_DECLS
+
+mph_off_t
+Mono_Posix_Syscall_lseek (gint32 fd, mph_off_t offset, gint32 whence)
+{
+ short _whence;
+ mph_return_if_off_t_overflow (offset);
+ if (Mono_Posix_FromSeekFlags (whence, &_whence) == -1)
+ return -1;
+ whence = _whence;
+
+ return lseek (fd, offset, whence);
+}
+
+mph_ssize_t
+Mono_Posix_Syscall_read (gint32 fd, void *buf, mph_size_t count)
+{
+ mph_return_if_size_t_overflow (count);
+ return read (fd, buf, (size_t) count);
+}
+
+mph_ssize_t
+Mono_Posix_Syscall_write (gint32 fd, const void *buf, mph_size_t count)
+{
+ mph_return_if_size_t_overflow (count);
+ return write (fd, buf, (size_t) count);
+}
+
+mph_ssize_t
+Mono_Posix_Syscall_pread (gint32 fd, void *buf, mph_size_t count, mph_off_t offset)
+{
+ mph_return_if_size_t_overflow (count);
+ mph_return_if_off_t_overflow (offset);
+
+ return pread (fd, buf, (size_t) count, (off_t) offset);
+}
+
+mph_ssize_t
+Mono_Posix_Syscall_pwrite (gint32 fd, const void *buf, mph_size_t count, mph_off_t offset)
+{
+ mph_return_if_size_t_overflow (count);
+ mph_return_if_off_t_overflow (offset);
+
+ return pwrite (fd, buf, (size_t) count, (off_t) offset);
+}
+
+gint32
+Mono_Posix_Syscall_pipe (gint32 *reading, gint32 *writing)
+{
+ int filedes[2] = {-1, -1};
+ int r;
+
+ if (reading == NULL || writing == NULL) {
+ errno = EFAULT;
+ return -1;
+ }
+
+ r = pipe (filedes);
+
+ *reading = filedes[0];
+ *writing = filedes[1];
+ return r;
+}
+
+char*
+Mono_Posix_Syscall_getcwd (char *buf, mph_size_t size)
+{
+ mph_return_val_if_size_t_overflow (size, NULL);
+ return getcwd (buf, (size_t) size);
+}
+
+gint64
+Mono_Posix_Syscall_fpathconf (int filedes, int name)
+{
+ if (Mono_Posix_FromPathConf (name, &name) == -1)
+ return -1;
+ return fpathconf (filedes, name);
+}
+
+gint64
+Mono_Posix_Syscall_pathconf (char *path, int name)
+{
+ if (Mono_Posix_FromPathConf (name, &name) == -1)
+ return -1;
+ return pathconf (path, name);
+}
+
+gint64
+Mono_Posix_Syscall_sysconf (int name)
+{
+ if (Mono_Posix_FromSysConf (name, &name) == -1)
+ return -1;
+ return sysconf (name);
+}
+
+gint64
+Mono_Posix_Syscall_confstr (int name, char *buf, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ if (Mono_Posix_FromConfStr (name, &name) == -1)
+ return -1;
+ return confstr (name, buf, (size_t) len);
+}
+
+#ifdef HAVE_TTYNAME_R
+gint32
+Mono_Posix_Syscall_ttyname_r (int fd, char *buf, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ return ttyname_r (fd, buf, (size_t) len);
+}
+#endif /* ndef HAVE_TTYNAME_R */
+
+gint32
+Mono_Posix_Syscall_readlink (const char *path, char *buf, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ return readlink (path, buf, (size_t) len);
+}
+
+gint32
+Mono_Posix_Syscall_getlogin_r (char *buf, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ return getlogin_r (buf, (size_t) len);
+}
+
+gint32
+Mono_Posix_Syscall_gethostname (char *buf, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ return gethostname (buf, (size_t) len);
+}
+
+gint32
+Mono_Posix_Syscall_sethostname (const char *name, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ return sethostname (name, (size_t) len);
+}
+
+gint64
+Mono_Posix_Syscall_gethostid (void)
+{
+ return gethostid ();
+}
+
+gint32
+Mono_Posix_Syscall_sethostid (gint64 hostid)
+{
+ mph_return_if_long_overflow (hostid);
+#ifdef MPH_ON_BSD
+ sethostid ((long) hostid);
+ return 0;
+#else
+ return sethostid ((long) hostid);
+#endif
+}
+
+gint32
+Mono_Posix_Syscall_getdomainname (char *name, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ return getdomainname (name, (size_t) len);
+}
+
+gint32
+Mono_Posix_Syscall_setdomainname (const char *name, mph_size_t len)
+{
+ mph_return_if_size_t_overflow (len);
+ return setdomainname (name, (size_t) len);
+}
+
+gint32
+Mono_Posix_Syscall_truncate (const char *path, mph_off_t length)
+{
+ mph_return_if_off_t_overflow (length);
+ return truncate (path, (off_t) length);
+}
+
+gint32
+Mono_Posix_Syscall_ftruncate (int fd, mph_off_t length)
+{
+ mph_return_if_off_t_overflow (length);
+ return ftruncate (fd, (off_t) length);
+}
+
+gint32
+Mono_Posix_Syscall_lockf (int fd, int cmd, mph_off_t len)
+{
+ mph_return_if_off_t_overflow (len);
+ if (Mono_Posix_FromLockFlags (cmd, &cmd) == -1)
+ return -1;
+ return lockf (fd, cmd, (off_t) len);
+}
+
+void
+Mono_Posix_Syscall_swab (void *from, void *to, mph_ssize_t n)
+{
+ if (mph_have_long_overflow (n))
+ return;
+ swab (from, to, (ssize_t) n);
+}
+
+G_END_DECLS
+
+/*
+ * vim: noexpandtab
+ */
diff --git a/support/zlib_macros.c b/support/zlib_macros.c
new file mode 100644
index 00000000000..69423f2339b
--- /dev/null
+++ b/support/zlib_macros.c
@@ -0,0 +1,107 @@
+/*
+ * Helper routines to use Zlib
+ *
+ * Author:
+ * Christopher Lahey (clahey@ximian.co)
+ *
+ * (C) 2004 Novell, Inc.
+ */
+#include <zlib.h>
+#include <stdlib.h>
+
+z_stream *
+create_z_stream(int compress, unsigned char gzip)
+{
+ z_stream *z;
+ int retval;
+
+ z = malloc (sizeof (z_stream));
+ z->next_in = Z_NULL;
+ z->avail_in = 0;
+ z->next_out = Z_NULL;
+ z->avail_out = 0;
+ z->zalloc = Z_NULL;
+ z->zfree = Z_NULL;
+ z->opaque = NULL;
+ if (compress) {
+ retval = deflateInit2 (z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, gzip ? 31 : -15, 8, Z_DEFAULT_STRATEGY);
+ } else {
+ retval = inflateInit2 (z, gzip ? 31 : -15);
+ }
+
+ if (retval == Z_OK)
+ return z;
+
+ free (z);
+ return NULL;
+}
+
+void
+free_z_stream(z_stream *z, int compress)
+{
+ if (compress) {
+ deflateEnd (z);
+ } else {
+ inflateEnd (z);
+ }
+ free (z);
+}
+
+void
+z_stream_set_next_in(z_stream *z, unsigned char *next_in)
+{
+ z->next_in = next_in;
+}
+
+void
+z_stream_set_avail_in(z_stream *z, int avail_in)
+{
+ z->avail_in = avail_in;
+}
+
+int
+z_stream_get_avail_in(z_stream *z)
+{
+ return z->avail_in;
+}
+
+void
+z_stream_set_next_out(z_stream *z, unsigned char *next_out)
+{
+ z->next_out = next_out;
+}
+
+void
+z_stream_set_avail_out(z_stream *z, int avail_out)
+{
+ z->avail_out = avail_out;
+}
+
+int
+z_stream_deflate (z_stream *z, int flush, unsigned char *next_out, int *avail_out)
+{
+ int ret_val;
+
+ z->next_out = next_out;
+ z->avail_out = *avail_out;
+
+ ret_val = deflate (z, flush);
+
+ *avail_out = z->avail_out;
+
+ return ret_val;
+}
+
+int
+z_stream_inflate (z_stream *z, int *avail_out)
+{
+ int ret_val;
+
+ z->avail_out = *avail_out;
+
+ ret_val = inflate (z, Z_NO_FLUSH);
+
+ *avail_out = z->avail_out;
+
+ return ret_val;
+}
diff --git a/tools/.cvsignore b/tools/.cvsignore
new file mode 100644
index 00000000000..3dda72986fc
--- /dev/null
+++ b/tools/.cvsignore
@@ -0,0 +1,2 @@
+Makefile.in
+Makefile
diff --git a/tools/Makefile.am b/tools/Makefile.am
new file mode 100644
index 00000000000..f887e94a520
--- /dev/null
+++ b/tools/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = locale-builder
diff --git a/tools/locale-builder/.cvsignore b/tools/locale-builder/.cvsignore
new file mode 100644
index 00000000000..f41ac81a574
--- /dev/null
+++ b/tools/locale-builder/.cvsignore
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+culture-info-tables.h
diff --git a/tools/locale-builder/ChangeLog b/tools/locale-builder/ChangeLog
new file mode 100644
index 00000000000..7c9de0a198e
--- /dev/null
+++ b/tools/locale-builder/ChangeLog
@@ -0,0 +1,75 @@
+
+Mon Aug 9 13:24:09 CEST 2004 Paolo Molaro <lupus@ximian.com>
+
+ * Driver.cs, Entry.cs, CultureInfoEntry.cs, DateTimeFormatEntry.cs,
+ NumberFormatEntry.cs: create a more compact representation of the
+ data.
+
+2004-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Driver.cs: handle single quotes in the pattern. We used to fail for,
+ at least, es and pt cultures with full patterns like
+ "EEEE d' de 'MMMM' de 'yyyy".
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Driver.cs : To make "extra pattern only" xxxFormatLength possible,
+ fill values only when the exact element was available.
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DateTimeFormatEntry.cs : Use "{0}" for empty array.
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DateTimeFormatEntry.cs : Added "all datetime patterns" support.
+ * Driver.cs : Added "all datetime patterns" support and fixed some
+ XPathNavigator use to strictly navigate to "pattern" element.
+
+2004-06-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Driver.cs : Percent patterns are not properly parsed since they are
+ in fact not separated by '.'
+ * Entry.cs : Escape '\' to "\\" (for Japanese yen-sign fix).
+
+2004-06-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Driver.cs :
+ - NumberDecimalDigits are almost differently specified by locale
+ xml files. Almost all of them have ".###", but we need ".##" in
+ almost all the locale. So let's *assume* that the number of
+ digit is always +1 extraneous by this Driver itself.
+ This change accompanies with some existing supp/*.xml changes.
+
+ - For decimal patterns and currency patterns, when numeric patterns
+ does not have ';'-separated patterns, it ignored the whole pattern
+ string. Fixed it by just copying the same patterns.
+
+ - When parsing percent patterns, '%' characters were in the way.
+ - When the decimal part of the percent pattern ends with ".##0",
+ the value of PercentDecimalDigits is 2.
+ - Assume PercentDecimalDigits as 2 by default.
+
+2004-06-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Driver.cs : Let's ignore DTD that takes most of the running time.
+
+2004-06-03 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Driver.cs : {3} is the almost default number for group digits.
+
+2004-05-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Driver.cs : for af_ZA locale, am/pm part got required to support
+ "empty" string. So check am/pm elements and overwrite AMDesigner/
+ PMDesigner value even if they consist of empty string.
+
+ * (moved logs for supp/ content to supp/)
+
+2004-05-25 Jackson Harper <jackson@ximian.com>
+
+ * Makefile.am: Extract xml files.
+
+2004-05-24 Jackson Harper <jackson@ximian.com>
+
+ * Driver.cs: Filter on GetFiles so we only get the xml locale files.
diff --git a/tools/locale-builder/CultureInfoEntry.cs b/tools/locale-builder/CultureInfoEntry.cs
new file mode 100644
index 00000000000..cf36ae8c240
--- /dev/null
+++ b/tools/locale-builder/CultureInfoEntry.cs
@@ -0,0 +1,94 @@
+//
+// Mono.Tools.LocaleBuilder.CultureInfoEntry
+//
+// Author(s):
+// Jackson Harper (jackson@ximian.com)
+//
+// (C) 2004 Novell, Inc (http://www.novell.com)
+//
+
+
+using System;
+using System.Text;
+
+namespace Mono.Tools.LocaleBuilder {
+
+ public class CultureInfoEntry : Entry {
+
+ public string Language;
+ public string Territory;
+ public string EnglishName;
+ public string DisplayName;
+ public string NativeName;
+ public string IcuName;
+ public string Win3Lang;
+ public string ISO2Lang;
+ public string ISO3Lang;
+ public string Lcid;
+ public string ParentLcid;
+ public string SpecificLcid;
+ public DateTimeFormatEntry DateTimeFormatEntry;
+ public NumberFormatEntry NumberFormatEntry;
+ public int [] CalendarData = new int [5];
+ public int DateTimeIndex;
+ public int NumberIndex;
+
+
+ public int Row;
+
+ public CultureInfoEntry ()
+ {
+ DateTimeFormatEntry = new DateTimeFormatEntry ();
+ NumberFormatEntry = new NumberFormatEntry ();
+ }
+
+ public string Name {
+ get {
+ if (Territory == null)
+ return Language;
+ return Language + "-" + Territory;
+ }
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder builder = new StringBuilder ();
+ AppendTableRow (builder);
+ return builder.ToString ();
+ }
+
+ public void AppendTableRow (StringBuilder builder)
+ {
+ builder.Append ("\t{");
+ builder.AppendFormat ("{0}, {1}, {2}, " +
+ "{3}, {4}, {5}, " +
+ "{6}, {7}, {8}, " +
+ "{9}, {10}, " +
+ "{11}, " +
+ "{12}, {13}",
+ Lcid, ParentLcid, SpecificLcid,
+ EncodeStringIdx (Name), EncodeStringIdx (IcuName), EncodeStringIdx (EnglishName),
+ EncodeStringIdx (DisplayName), EncodeStringIdx (NativeName), EncodeStringIdx (Win3Lang),
+ EncodeStringIdx (ISO3Lang), EncodeStringIdx (ISO2Lang),
+ ValuesString (CalendarData),
+ DateTimeFormatEntry == null ? -1 : DateTimeFormatEntry.Row,
+ NumberFormatEntry == null ? -1 : NumberFormatEntry.Row);
+ builder.Append ('}');
+ }
+
+ private string ValuesString (int [] values)
+ {
+ StringBuilder builder = new StringBuilder ();
+ builder.Append ('{');
+ for (int i=0; i<values.Length; i++) {
+ builder.Append (values [i].ToString ());
+ if (i+1 < values.Length)
+ builder.Append (", ");
+ }
+ builder.Append ("}");
+ return builder.ToString ();
+ }
+ }
+
+}
+
diff --git a/tools/locale-builder/DateTimeFormatEntry.cs b/tools/locale-builder/DateTimeFormatEntry.cs
new file mode 100644
index 00000000000..03a7101b3aa
--- /dev/null
+++ b/tools/locale-builder/DateTimeFormatEntry.cs
@@ -0,0 +1,124 @@
+//
+// Mono.Tools.LocaleBuilder.DateTimeFormatEntry
+//
+// Author(s):
+// Jackson Harper (jackson@ximian.com)
+//
+// (C) 2004, Novell, Inc (http://www.novell.com)
+//
+
+
+using System;
+using System.Text;
+using System.Collections;
+
+namespace Mono.Tools.LocaleBuilder {
+
+ public class DateTimeFormatEntry : Entry {
+
+ public string CalendarType;
+ public ArrayList AbbreviatedDayNames = new ArrayList ();
+ public ArrayList AbbreviatedMonthNames = new ArrayList ();
+ public string AMDesignator;
+ public int CalendarWeekRule;
+ public string DateSeparator;
+ public ArrayList DayNames = new ArrayList ();
+ public int FirstDayOfWeek;
+ public string FullDateTimePattern;
+ public string LongDatePattern;
+ public string LongTimePattern;
+ public string MonthDayPattern;
+ public ArrayList MonthNames = new ArrayList ();
+ public string PMDesignator;
+ public string ShortDatePattern;
+ public string ShortTimePattern;
+ public string TimeSeparator;
+ public string YearMonthPattern;
+ public int [] OptionalCalendars = new int [5];
+ public ArrayList ShortDatePatterns = new ArrayList (14);
+ public ArrayList LongDatePatterns = new ArrayList (8);
+ public ArrayList ShortTimePatterns = new ArrayList (5);
+ public ArrayList LongTimePatterns = new ArrayList (6);
+
+ public int Row;
+
+ public void AppendTableRow (StringBuilder builder)
+ {
+ builder.Append ("\t{");
+ builder.Append (EncodeStringIdx (FullDateTimePattern) + ", ");
+ builder.Append (EncodeStringIdx (LongDatePattern) + ", ");
+ builder.Append (EncodeStringIdx (ShortDatePattern) + ", ");
+
+ builder.Append (EncodeStringIdx (LongTimePattern) + ", ");
+ builder.Append (EncodeStringIdx (ShortTimePattern) + ", ");
+
+ builder.Append (EncodeStringIdx (YearMonthPattern) + ", ");
+ builder.Append (EncodeStringIdx (MonthDayPattern) + ", ");
+
+ builder.Append (EncodeStringIdx (AMDesignator) + ", ");
+ builder.Append (EncodeStringIdx (PMDesignator) + ", ");
+
+ AppendNames (builder, DayNames);
+ builder.Append (", ");
+ AppendNames (builder, AbbreviatedDayNames);
+ builder.Append (", ");
+
+ AppendNames (builder, MonthNames);
+ builder.Append (", ");
+ AbbreviatedMonthNames.Add (String.Empty); /* ALLWAYS ?? */
+ AppendNames (builder, AbbreviatedMonthNames);
+ builder.Append (", ");
+
+ builder.Append (CalendarWeekRule + ", ");
+ builder.Append (FirstDayOfWeek + ", ");
+
+ builder.Append (EncodeStringIdx (DateSeparator) + ", ");
+ builder.Append (EncodeStringIdx (TimeSeparator) + ", ");
+
+ AppendPatterns (builder, ShortDatePatterns);
+ builder.Append (',');
+ AppendPatterns (builder, LongDatePatterns);
+ builder.Append (',');
+ AppendPatterns (builder, ShortTimePatterns);
+ builder.Append (',');
+ AppendPatterns (builder, LongTimePatterns);
+
+ builder.Append ('}');
+ }
+
+ private void AppendPatterns (StringBuilder builder, ArrayList al)
+ {
+ string [] patterns = al.ToArray (typeof (string)) as string [];
+ builder.Append ('{');
+ for (int i = 0; i < patterns.Length; i++) {
+ string s = EncodeStringIdx (patterns [i]);
+ builder.Append (s);
+ if (i + 1 < patterns.Length)
+ builder.Append (',');
+ }
+ if (patterns.Length == 0)
+ builder.Append ('0');
+ builder.Append ('}');
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder builder = new StringBuilder ();
+ AppendTableRow (builder);
+ return builder.ToString ();
+ }
+
+ private void AppendNames (StringBuilder builder, ArrayList names)
+ {
+ builder.Append ('{');
+ for (int i=0; i<names.Count; i++) {
+ builder.Append (EncodeStringIdx (names [i].ToString ()));
+ if (i+1 < names.Count)
+ builder.Append (", ");
+ }
+ builder.Append ("}");
+ }
+ }
+}
+
+
diff --git a/tools/locale-builder/Driver.cs b/tools/locale-builder/Driver.cs
new file mode 100644
index 00000000000..384b25ff7e4
--- /dev/null
+++ b/tools/locale-builder/Driver.cs
@@ -0,0 +1,972 @@
+//
+// Mono.Tools.LocalBuilder.Driver
+//
+// Author(s):
+// Jackson Harper (jackson@ximian.com)
+//
+// (C) 2004 Novell, Inc (http://www.novell.com)
+//
+
+
+using System;
+using System.IO;
+using System.Text;
+using System.Xml;
+using System.Xml.XPath;
+using System.Collections;
+using System.Globalization;
+using System.Text.RegularExpressions;
+
+namespace Mono.Tools.LocaleBuilder {
+
+ public class Driver {
+
+ public static void Main (string [] args)
+ {
+ Driver d = new Driver ();
+ ParseArgs (args, d);
+ d.Run ();
+ }
+
+ private static void ParseArgs (string [] args, Driver d)
+ {
+ for (int i = 0; i < args.Length; i++) {
+ if (args [i] == "--lang" && i+1 < args.Length)
+ d.Lang = args [++i];
+ else if (args [i] == "--locales" && i+1 < args.Length)
+ d.Locales = args [++i];
+ else if (args [i] == "--header" && i + 1 < args.Length)
+ d.HeaderFileName = args [++i];
+ }
+ }
+
+ private string lang;
+ private string locales;
+ private string header_name;
+ private ArrayList cultures;
+ private Hashtable langs;
+ private Hashtable currency_types;
+
+ // The lang is the language that display names will be displayed in
+ public string Lang {
+ get {
+ if (lang == null)
+ lang = "en";
+ return lang;
+ }
+ set { lang = value; }
+ }
+
+ public string Locales {
+ get { return locales; }
+ set { locales = value; }
+ }
+
+ public string HeaderFileName {
+ get {
+ if (header_name == null)
+ return "culture-info-tables.h";
+ return header_name;
+ }
+ set { header_name = value; }
+ }
+
+ public void Run ()
+ {
+ Regex locales_regex = null;
+ if (Locales != null)
+ locales_regex = new Regex (Locales);
+
+ langs = new Hashtable ();
+ cultures = new ArrayList ();
+
+ LookupCurrencyTypes ();
+
+ foreach (string file in Directory.GetFiles ("locales", "*.xml")) {
+ string fn = Path.GetFileNameWithoutExtension (file);
+ if (locales_regex == null || locales_regex.IsMatch (fn)) {
+ ParseLocale (fn);
+ }
+ }
+
+ /**
+ * Dump each table individually. Using StringBuilders
+ * because it is easier to debug, should switch to just
+ * writing to streams eventually.
+ */
+ using (StreamWriter writer = new StreamWriter (HeaderFileName, false, new UTF8Encoding (false, true))) {
+
+ writer.WriteLine ();
+ writer.WriteLine ("/* This is a generated file. Do not edit. See tools/locale-builder. */");
+ writer.WriteLine ("#ifndef MONO_METADATA_CULTURE_INFO_TABLES");
+ writer.WriteLine ("#define MONO_METADATA_CULTURE_INFO_TABLES 1");
+ writer.WriteLine ("\n");
+
+ writer.WriteLine ("#define NUM_CULTURE_ENTRIES " + cultures.Count);
+ writer.WriteLine ("\n");
+
+ // Sort the cultures by lcid
+ cultures.Sort (new LcidComparer ());
+
+ StringBuilder builder = new StringBuilder ();
+ int row = 0;
+ int count = cultures.Count;
+ for (int i = 0; i < count; i++) {
+ CultureInfoEntry ci = (CultureInfoEntry) cultures [i];
+ if (ci.DateTimeFormatEntry == null)
+ continue;
+ ci.DateTimeFormatEntry.AppendTableRow (builder);
+ ci.DateTimeFormatEntry.Row = row++;
+ if (i + 1 < count)
+ builder.Append (',');
+ builder.Append ('\n');
+ }
+
+ writer.WriteLine ("static const DateTimeFormatEntry datetime_format_entries [] = {");
+ writer.Write (builder);
+ writer.WriteLine ("};\n\n");
+
+ builder = new StringBuilder ();
+ row = 0;
+ for (int i=0; i < count; i++) {
+ CultureInfoEntry ci = (CultureInfoEntry) cultures [i];
+ if (ci.NumberFormatEntry == null)
+ continue;
+ ci.NumberFormatEntry.AppendTableRow (builder);
+ ci.NumberFormatEntry.Row = row++;
+ if (i + 1 < count)
+ builder.Append (',');
+ builder.Append ('\n');
+ }
+
+ writer.WriteLine ("static const NumberFormatEntry number_format_entries [] = {");
+ writer.Write (builder);
+ writer.WriteLine ("};\n\n");
+
+ builder = new StringBuilder ();
+ row = 0;
+ for (int i = 0; i < count; i++) {
+ CultureInfoEntry ci = (CultureInfoEntry) cultures [i];
+ ci.AppendTableRow (builder);
+ ci.Row = row++;
+ if (i + 1 < count)
+ builder.Append (',');
+ builder.Append ('\n');
+ }
+
+ writer.WriteLine ("static const CultureInfoEntry culture_entries [] = {");
+ writer.Write (builder);
+ writer.WriteLine ("};\n\n");
+
+ cultures.Sort (new NameComparer ()); // Sort based on name
+ builder = new StringBuilder ();
+ for (int i = 0; i < count; i++) {
+ CultureInfoEntry ci = (CultureInfoEntry) cultures [i];
+ builder.Append ("\t{" + Entry.EncodeStringIdx (ci.Name.ToLower ()) + ", ");
+ builder.Append (ci.Row + "}");
+ if (i + 1 < count)
+ builder.Append (',');
+ builder.Append ('\n');
+ }
+
+ writer.WriteLine ("static const CultureInfoNameEntry culture_name_entries [] = {");
+ writer.Write (builder);
+ writer.WriteLine ("};\n\n");
+
+ writer.WriteLine ("static const char locale_strings [] = {");
+ writer.Write (Entry.GetStrings ());
+ writer.WriteLine ("};\n\n");
+
+ writer.WriteLine ("#endif\n");
+ }
+ }
+
+ private XPathDocument GetXPathDocument (string path)
+ {
+ XmlTextReader xtr = new XmlTextReader (path);
+ xtr.XmlResolver = null;
+ return new XPathDocument (xtr);
+ }
+
+ private bool ParseLang (string lang)
+ {
+ XPathDocument doc = GetXPathDocument (Path.Combine ("langs", lang + ".xml"));
+ XPathNavigator nav = doc.CreateNavigator ();
+ CultureInfoEntry ci = new CultureInfoEntry ();
+ string lang_type, terr_type;
+
+// ci.Name = lang; // TODO: might need to be mapped.
+
+ lang_type = nav.Evaluate ("string (ldml/identity/language/@type)").ToString ();
+ terr_type = nav.Evaluate ("string (ldml/identity/territory/@type)").ToString ();
+
+ ci.Language = (lang_type == String.Empty ? null : lang_type);
+ ci.Territory = (terr_type == String.Empty ? null : terr_type);
+
+ if (!LookupLcids (ci))
+ return false;
+
+ doc = GetXPathDocument (Path.Combine ("langs", Lang + ".xml"));
+ nav = doc.CreateNavigator ();
+ ci.DisplayName = LookupFullName (ci, nav);
+
+ if (Lang == "en") {
+ ci.EnglishName = ci.DisplayName;
+ } else {
+ doc = GetXPathDocument (Path.Combine ("langs", Lang + ".xml"));
+ nav = doc.CreateNavigator ();
+ ci.EnglishName = LookupFullName (ci, nav);
+ }
+
+ if (ci.Language == Lang) {
+ ci.NativeName = ci.DisplayName;
+ } else {
+ doc = GetXPathDocument (Path.Combine ("langs", lang + ".xml"));
+ nav = doc.CreateNavigator ();
+ ci.NativeName = LookupFullName (ci, nav);
+ }
+
+ // Null these out because langs dont have them
+ ci.DateTimeFormatEntry = null;
+ ci.NumberFormatEntry = null;
+
+ langs [lang] = ci;
+ cultures.Add (ci);
+
+ return true;
+ }
+
+ private void ParseLocale (string locale)
+ {
+ CultureInfoEntry ci;
+
+ ci = LookupCulture (locale);
+
+ if (ci == null)
+ return;
+
+ if (langs [ci.Language] == null) {
+ if (!ParseLang (ci.Language)) // If we can't parse the lang we cant have the locale
+ return;
+ }
+
+ cultures.Add (ci);
+ }
+
+ private CultureInfoEntry LookupCulture (string locale)
+ {
+ XPathDocument doc = GetXPathDocument (Path.Combine ("locales", locale + ".xml"));
+ XPathNavigator nav = doc.CreateNavigator ();
+ CultureInfoEntry ci = new CultureInfoEntry ();
+ string supp;
+
+// ci.Name = locale; // TODO: Some of these need to be mapped.
+
+ // First thing we do is get the lang-territory combo, lcid, and full names
+ ci.Language = nav.Evaluate ("string (ldml/identity/language/@type)").ToString ();
+ ci.Territory = nav.Evaluate ("string (ldml/identity/territory/@type)").ToString ();
+
+ if (!LookupLcids (ci))
+ return null;
+ LookupNames (ci);
+
+ /**
+ * Locale generation is done in six steps, first we
+ * read the root file which is the base invariant data
+ * then the supplemental root data,
+ * then the language file, the supplemental languages
+ * file then the locale file, then the supplemental
+ * locale file. Values in each descending file can
+ * overwrite previous values.
+ */
+ doc = GetXPathDocument (Path.Combine ("langs", "root.xml"));
+ nav = doc.CreateNavigator ();
+ Lookup (nav, ci);
+
+ doc = GetXPathDocument (Path.Combine ("supp", "root.xml"));
+ nav = doc.CreateNavigator ();
+ Lookup (nav, ci);
+
+ doc = GetXPathDocument (Path.Combine ("langs", ci.Language + ".xml"));
+ nav = doc.CreateNavigator ();
+ Lookup (nav, ci);
+
+ supp = Path.Combine ("supp", ci.Language + ".xml");
+ if (File.Exists (supp)) {
+ doc = GetXPathDocument (supp);
+ nav = doc.CreateNavigator ();
+ Lookup (nav, ci);
+ }
+
+ doc = GetXPathDocument (Path.Combine ("locales", locale + ".xml"));
+ nav = doc.CreateNavigator ();
+ Lookup (nav, ci);
+
+ supp = Path.Combine ("supp", locale + ".xml");
+ if (File.Exists (supp)) {
+ doc = GetXPathDocument (supp);
+ nav = doc.CreateNavigator ();
+ Lookup (nav, ci);
+ }
+
+ return ci;
+ }
+
+ private void Lookup (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ LookupDateTimeInfo (nav, ci);
+ LookupNumberInfo (nav, ci);
+ }
+
+ private void LookupNames (CultureInfoEntry ci)
+ {
+ XPathDocument doc = GetXPathDocument (Path.Combine ("langs", Lang + ".xml"));
+ XPathNavigator nav = doc.CreateNavigator ();
+
+ ci.DisplayName = LookupFullName (ci, nav);
+
+ if (Lang == "en") {
+ ci.EnglishName = ci.DisplayName;
+ } else {
+ doc = GetXPathDocument (Path.Combine ("langs", "en.xml"));
+ nav = doc.CreateNavigator ();
+ ci.EnglishName = LookupFullName (ci, nav);
+ }
+
+ if (ci.Language == Lang) {
+ ci.NativeName = ci.DisplayName;
+ } else {
+ doc = GetXPathDocument (Path.Combine ("langs", ci.Language + ".xml"));
+ nav = doc.CreateNavigator ();
+ ci.NativeName = LookupFullName (ci, nav);
+ }
+ }
+
+ private void LookupDateTimeInfo (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ /**
+ * TODO: Does anyone have multiple calendars?
+ */
+ XPathNodeIterator ni =(XPathNodeIterator) nav.Evaluate ("ldml/dates/calendars/calendar");
+
+ while (ni.MoveNext ()) {
+ DateTimeFormatEntry df = ci.DateTimeFormatEntry;
+ string cal_type = ni.Current.GetAttribute ("type", String.Empty);
+
+ if (cal_type != String.Empty)
+ df.CalendarType = cal_type;
+
+ XPathNodeIterator ni2 = (XPathNodeIterator) ni.Current.Evaluate ("optionalCalendars/calendar");
+ int opt_cal_count = 0;
+ while (ni2.MoveNext ()) {
+ int type;
+ string greg_type_str;
+ XPathNavigator df_nav = ni2.Current;
+ switch (df_nav.GetAttribute ("type", String.Empty)) {
+ case "Gregorian":
+ type = 0;
+ break;
+ case "Hijri":
+ type = 0x01;
+ break;
+ case "ThaiBuddhist":
+ type = 0x02;
+ break;
+ default:
+ Console.WriteLine ("unknown calendar type: " +
+ df_nav.GetAttribute ("type", String.Empty));
+ continue;
+ }
+ type <<= 24;
+ greg_type_str = df_nav.GetAttribute ("greg_type", String.Empty);
+ if (greg_type_str != null && greg_type_str != String.Empty) {
+ GregorianCalendarTypes greg_type = (GregorianCalendarTypes)
+ Enum.Parse (typeof (GregorianCalendarTypes), greg_type_str);
+ int greg_type_int = (int) greg_type;
+ type |= greg_type_int;
+
+ }
+ Console.WriteLine ("Setting cal type: {0:X} for {1}", type, ci.Name);
+ ci.CalendarData [opt_cal_count++] = type;
+ }
+
+ ni2 = (XPathNodeIterator) ni.Current.Evaluate ("monthNames/month");
+ while (ni2.MoveNext ()) {
+ if (ni2.CurrentPosition == 1)
+ df.MonthNames.Clear ();
+ df.MonthNames.Add (ni2.Current.Value);
+ }
+
+ ni2 = (XPathNodeIterator) ni.Current.Evaluate ("dayNames/day");
+ while (ni2.MoveNext ()) {
+ if (ni2.CurrentPosition == 1)
+ df.DayNames.Clear ();
+ df.DayNames.Add (ni2.Current.Value);
+ }
+
+ ni2 = (XPathNodeIterator) ni.Current.Evaluate ("dayAbbr/day");
+ while (ni2.MoveNext ()) {
+ if (ni2.CurrentPosition == 1)
+ df.AbbreviatedDayNames.Clear ();
+ df.AbbreviatedDayNames.Add (ni2.Current.Value);
+ }
+
+ ni2 = (XPathNodeIterator) ni.Current.Evaluate ("monthAbbr/month");
+ while (ni2.MoveNext ()) {
+ if (ni2.CurrentPosition == 1)
+ df.AbbreviatedMonthNames.Clear ();
+ df.AbbreviatedMonthNames.Add (ni2.Current.Value);
+ }
+
+ ni2 = (XPathNodeIterator) ni.Current.Evaluate ("dateFormats/dateFormatLength");
+ while (ni2.MoveNext ()) {
+ XPathNavigator df_nav = ni2.Current;
+ XPathNodeIterator p = df_nav.Select ("dateFormat/pattern");
+ string value = null;
+ if (p.MoveNext ())
+ value = p.Current.Value;
+ XPathNodeIterator ext = null;
+ switch (df_nav.GetAttribute ("type", String.Empty)) {
+ case "full":
+ if (value != null)
+ ParseFullDateFormat (df, value);
+ break;
+ case "long":
+ if (value != null)
+ df.LongDatePattern = value;
+ ext = df_nav.Select ("extraPatterns/pattern");
+ if (ext.MoveNext ()) {
+ df.LongDatePatterns.Clear ();
+ do {
+ df.LongDatePatterns.Add (ext.Current.Value);
+ } while (ext.MoveNext ());
+ }
+ break;
+ case "short":
+ if (value != null)
+ df.ShortDatePattern = value;
+ ext = df_nav.Select ("extraPatterns/pattern");
+ if (ext.MoveNext ()) {
+ df.ShortDatePatterns.Clear ();
+ do {
+ df.ShortDatePatterns.Add (ext.Current.Value);
+ } while (ext.MoveNext ());
+ }
+ break;
+ case "year_month":
+ if (value != null)
+ df.YearMonthPattern = value;
+ break;
+ case "month_day":
+ if (value != null)
+ df.MonthDayPattern = value;
+ break;
+ }
+ }
+
+ ni2 = (XPathNodeIterator) ni.Current.Evaluate ("timeFormats/timeFormatLength");
+ while (ni2.MoveNext ()) {
+ XPathNavigator df_nav = ni2.Current;
+ XPathNodeIterator p = df_nav.Select ("timeFormat/pattern");
+ string value = null;
+ if (p.MoveNext ())
+ value = p.Current.Value;
+ XPathNodeIterator ext = null;
+ switch (df_nav.GetAttribute ("type", String.Empty)) {
+ case "long":
+ if (value != null)
+ df.LongTimePattern = value.Replace ('a', 't');
+ ext = df_nav.Select ("extraPatterns/pattern");
+ if (ext.MoveNext ()) {
+ df.LongTimePatterns.Clear ();
+ do {
+ df.LongTimePatterns.Add (ext.Current.Value);
+ } while (ext.MoveNext ());
+ }
+ break;
+ case "short":
+ if (value != null)
+ df.ShortTimePattern = value.Replace ('a', 't');
+ ext = df_nav.Select ("extraPatterns/pattern");
+ if (ext.MoveNext ()) {
+ df.ShortTimePatterns.Clear ();
+ do {
+ df.ShortTimePatterns.Add (ext.Current.Value);
+ } while (ext.MoveNext ());
+ }
+ break;
+ }
+ }
+
+ ni2 = (XPathNodeIterator) ni.Current.Evaluate ("dateTimeFormats/dateTimeFormatLength/dateTimeFormat/pattern");
+ if (ni2.MoveNext ())
+ df.FullDateTimePattern = String.Format (ni2.Current.ToString (),
+ df.LongTimePattern, df.LongDatePattern);
+
+ XPathNodeIterator am = ni.Current.SelectChildren ("am", "");
+ if (am.MoveNext ())
+ df.AMDesignator = am.Current.Value;
+ XPathNodeIterator pm = ni.Current.SelectChildren ("pm", "");
+ if (pm.MoveNext ())
+ df.PMDesignator = pm.Current.Value;
+/*
+ string am = (string) ni.Current.Evaluate ("string(am)");
+ string pm = (string) ni.Current.Evaluate ("string(pm)");
+
+ if (am != String.Empty)
+ df.AMDesignator = am;
+ if (pm != String.Empty)
+ df.PMDesignator = pm;
+*/
+ }
+
+ string date_sep = (string) nav.Evaluate ("string(ldml/dates/symbols/dateSeparator)");
+ string time_sep = (string) nav.Evaluate ("string(ldml/dates/symbols/timeSeparator)");
+
+ if (date_sep != String.Empty)
+ ci.DateTimeFormatEntry.DateSeparator = date_sep;
+ if (time_sep != String.Empty)
+ ci.DateTimeFormatEntry.TimeSeparator = time_sep;
+ }
+
+ private void LookupNumberInfo (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ XPathNodeIterator ni =(XPathNodeIterator) nav.Evaluate ("ldml/numbers");
+
+ while (ni.MoveNext ()) {
+ LookupNumberSymbols (ni.Current, ci);
+ LookupDecimalFormat (ni.Current, ci);
+ LookupPercentFormat (ni.Current, ci);
+ LookupCurrencyFormat (ni.Current, ci);
+ LookupCurrencySymbol (ni.Current, ci);
+ }
+ }
+
+ private void LookupDecimalFormat (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ string format = (string) nav.Evaluate ("string(decimalFormats/" +
+ "decimalFormatLength/decimalFormat/pattern)");
+
+ if (format == String.Empty)
+ return;
+
+ string [] part_one, part_two;
+ string [] pos_neg = format.Split (new char [1] {';'}, 2);
+
+ // Most of the patterns are common in positive and negative
+ if (pos_neg.Length == 1)
+ pos_neg = new string [] {pos_neg [0], pos_neg [0]};
+
+ if (pos_neg.Length == 2) {
+
+ part_one = pos_neg [0].Split (new char [1] {'.'}, 2);
+ if (part_one.Length == 1)
+ part_one = new string [] {part_one [0], String.Empty};
+
+ if (part_one.Length == 2) {
+ // assumed same for both positive and negative
+ // decimal digit side
+ ci.NumberFormatEntry.NumberDecimalDigits = 0;
+ for (int i = 0; i < part_one [1].Length; i++) {
+ if (part_one [1][i] == '#') {
+ ci.NumberFormatEntry.NumberDecimalDigits ++;
+ } else
+ break; }
+ // FIXME: This should be actually done by modifying culture xml files, but too many files to be modified.
+ if (ci.NumberFormatEntry.NumberDecimalDigits > 0)
+ ci.NumberFormatEntry.NumberDecimalDigits --;
+
+ // decimal grouping side
+ part_two = part_one [0].Split (',');
+ if (part_two.Length > 1) {
+ int len = part_two.Length - 1;
+ ci.NumberFormatEntry.NumberGroupSizes = new int [len];
+ for (int i = 0; i < len; i++) {
+ string pat = part_two [i + 1];
+ ci.NumberFormatEntry.NumberGroupSizes [i] = pat.Length;
+ }
+ } else {
+ ci.NumberFormatEntry.NumberGroupSizes = new int [1] { 3 };
+ }
+
+ if (pos_neg [1].StartsWith ("(") && pos_neg [1].EndsWith (")")) {
+ ci.NumberFormatEntry.NumberNegativePattern = 0;
+ } else if (pos_neg [1].StartsWith ("- ")) {
+ ci.NumberFormatEntry.NumberNegativePattern = 2;
+ } else if (pos_neg [1].StartsWith ("-")) {
+ ci.NumberFormatEntry.NumberNegativePattern = 1;
+ } else if (pos_neg [1].EndsWith (" -")) {
+ ci.NumberFormatEntry.NumberNegativePattern = 4;
+ } else if (pos_neg [1].EndsWith ("-")) {
+ ci.NumberFormatEntry.NumberNegativePattern = 3;
+ } else {
+ ci.NumberFormatEntry.NumberNegativePattern = 1;
+ }
+ }
+ }
+ }
+
+ private void LookupPercentFormat (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ string format = (string) nav.Evaluate ("string(percentFormats/" +
+ "percentFormatLength/percentFormat/pattern)");
+
+ if (format == String.Empty)
+ return;
+
+ string [] part_one, part_two;
+
+ // we don't have percentNegativePattern in CLDR so
+ // the percentNegativePattern are just guesses
+ if (format.StartsWith ("%")) {
+ ci.NumberFormatEntry.PercentPositivePattern = 2;
+ ci.NumberFormatEntry.PercentNegativePattern = 2;
+ format = format.Substring (1);
+ } else if (format.EndsWith (" %")) {
+ ci.NumberFormatEntry.PercentPositivePattern = 0;
+ ci.NumberFormatEntry.PercentNegativePattern = 0;
+ format = format.Substring (0, format.Length - 2);
+ } else if (format.EndsWith ("%")) {
+ ci.NumberFormatEntry.PercentPositivePattern = 1;
+ ci.NumberFormatEntry.PercentNegativePattern = 1;
+ format = format.Substring (0, format.Length - 1);
+ } else {
+ ci.NumberFormatEntry.PercentPositivePattern = 0;
+ ci.NumberFormatEntry.PercentNegativePattern = 0;
+ }
+
+ part_one = format.Split (new char [1] {'.'}, 2);
+ if (part_one.Length == 2) {
+ // assumed same for both positive and negative
+ // decimal digit side
+ ci.NumberFormatEntry.PercentDecimalDigits = 0;
+ for (int i = 0; i < part_one [1].Length; i++) {
+ if (part_one [1][i] == '#')
+ ci.NumberFormatEntry.PercentDecimalDigits++;
+ else
+ break;
+ }
+ }
+
+ if (part_one.Length > 0) {
+ // percent grouping side
+ part_two = part_one [0].Split (',');
+ if (part_two.Length > 1) {
+ int len = part_two.Length - 1;
+ ci.NumberFormatEntry.PercentGroupSizes = new int [len];
+ for (int i = 0; i < len; i++) {
+ string pat = part_two [i + 1];
+ if (pat [pat.Length -1] == '0')
+ ci.NumberFormatEntry.PercentDecimalDigits = pat.Length - 1;
+ ci.NumberFormatEntry.PercentGroupSizes [i] = pat.Length;
+ }
+ } else {
+ ci.NumberFormatEntry.PercentGroupSizes = new int [1] { 3 };
+ ci.NumberFormatEntry.PercentDecimalDigits = 2;
+ }
+ }
+ }
+
+ private void LookupCurrencyFormat (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ string format = (string) nav.Evaluate ("string(currencyFormats/" +
+ "currencyFormatLength/currencyFormat/pattern)");
+
+ if (format == String.Empty)
+ return;
+
+ string [] part_one, part_two;
+ string [] pos_neg = format.Split (new char [1] {';'}, 2);
+
+ // Most of the patterns are common in positive and negative
+ if (pos_neg.Length == 1)
+ pos_neg = new string [] {pos_neg [0], pos_neg [0]};
+
+ if (pos_neg.Length == 2) {
+ part_one = pos_neg [0].Split (new char [1] {'.'}, 2);
+ if (part_one.Length == 1)
+ part_one = new string [] {part_one [0], String.Empty};
+ if (part_one.Length == 2) {
+ // assumed same for both positive and negative
+ // decimal digit side
+ ci.NumberFormatEntry.CurrencyDecimalDigits = 0;
+ for (int i = 0; i < part_one [1].Length; i++) {
+ if (part_one [1][i] == '0')
+ ci.NumberFormatEntry.CurrencyDecimalDigits++;
+ else
+ break;
+ }
+
+ // decimal grouping side
+ part_two = part_one [0].Split (',');
+ if (part_two.Length > 1) {
+ int len = part_two.Length - 1;
+ ci.NumberFormatEntry.CurrencyGroupSizes = new int [len];
+ for (int i = 0; i < len; i++) {
+ string pat = part_two [i + 1];
+ ci.NumberFormatEntry.CurrencyGroupSizes [i] = pat.Length;
+ }
+ } else {
+ ci.NumberFormatEntry.CurrencyGroupSizes = new int [1] { 3 };
+ }
+
+ if (pos_neg [1].StartsWith ("(\u00a4 ") && pos_neg [1].EndsWith (")")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 14;
+ } else if (pos_neg [1].StartsWith ("(\u00a4") && pos_neg [1].EndsWith (")")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 0;
+ } else if (pos_neg [1].StartsWith ("\u00a4 ") && pos_neg [1].EndsWith ("-")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 11;
+ } else if (pos_neg [1].StartsWith ("\u00a4") && pos_neg [1].EndsWith ("-")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 3;
+ } else if (pos_neg [1].StartsWith ("(") && pos_neg [1].EndsWith (" \u00a4")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 15;
+ } else if (pos_neg [1].StartsWith ("(") && pos_neg [1].EndsWith ("\u00a4")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 4;
+ } else if (pos_neg [1].StartsWith ("-") && pos_neg [1].EndsWith (" \u00a4")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 8;
+ } else if (pos_neg [1].StartsWith ("-") && pos_neg [1].EndsWith ("\u00a4")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 5;
+ } else if (pos_neg [1].StartsWith ("-\u00a4 ")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 9;
+ } else if (pos_neg [1].StartsWith ("-\u00a4")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 1;
+ } else if (pos_neg [1].StartsWith ("\u00a4 -")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 12;
+ } else if (pos_neg [1].StartsWith ("\u00a4-")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 2;
+ } else if (pos_neg [1].EndsWith (" \u00a4-")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 10;
+ } else if (pos_neg [1].EndsWith ("\u00a4-")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 7;
+ } else if (pos_neg [1].EndsWith ("- \u00a4")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 13;
+ } else if (pos_neg [1].EndsWith ("-\u00a4")) {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 6;
+ } else {
+ ci.NumberFormatEntry.CurrencyNegativePattern = 0;
+ }
+
+ if (pos_neg [0].StartsWith ("\u00a4 ")) {
+ ci.NumberFormatEntry.CurrencyPositivePattern = 2;
+ } else if (pos_neg [0].StartsWith ("\u00a4")) {
+ ci.NumberFormatEntry.CurrencyPositivePattern = 0;
+ } else if (pos_neg [0].EndsWith (" \u00a4")) {
+ ci.NumberFormatEntry.CurrencyPositivePattern = 3;
+ } else if (pos_neg [0].EndsWith ("\u00a4")) {
+ ci.NumberFormatEntry.CurrencyPositivePattern = 1;
+ } else {
+ ci.NumberFormatEntry.CurrencyPositivePattern = 0;
+ }
+ }
+ }
+ }
+
+ private void LookupNumberSymbols (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ string dec = (string) nav.Evaluate ("string(symbols/decimal)");
+ string group = (string) nav.Evaluate ("string(symbols/group)");
+ string percent = (string) nav.Evaluate ("string(symbols/percentSign)");
+ string positive = (string) nav.Evaluate ("string(symbols/plusSign)");
+ string negative = (string) nav.Evaluate ("string(symbols/minusSign)");
+ string per_mille = (string) nav.Evaluate ("string(symbols/perMille)");
+ string infinity = (string) nav.Evaluate ("string(symbols/infinity)");
+ string nan = (string) nav.Evaluate ("string(symbols/nan)");
+
+ if (dec != String.Empty) {
+ ci.NumberFormatEntry.NumberDecimalSeparator = dec;
+ ci.NumberFormatEntry.PercentDecimalSeparator = dec;
+ ci.NumberFormatEntry.CurrencyDecimalSeparator = dec;
+ }
+
+ if (group != String.Empty) {
+ ci.NumberFormatEntry.NumberGroupSeparator = group;
+ ci.NumberFormatEntry.PercentGroupSeparator = group;
+ ci.NumberFormatEntry.CurrencyGroupSeparator = group;
+ }
+
+ if (percent != String.Empty)
+ ci.NumberFormatEntry.PercentSymbol = percent;
+ if (positive != String.Empty)
+ ci.NumberFormatEntry.PositiveSign = positive;
+ if (negative != String.Empty)
+ ci.NumberFormatEntry.NegativeSign = negative;
+ if (per_mille != String.Empty)
+ ci.NumberFormatEntry.PerMilleSymbol = per_mille;
+ if (infinity != String.Empty)
+ ci.NumberFormatEntry.PositiveInfinitySymbol = infinity;
+ if (nan != String.Empty)
+ ci.NumberFormatEntry.NaNSymbol = nan;
+ }
+
+ private void LookupCurrencySymbol (XPathNavigator nav, CultureInfoEntry ci)
+ {
+ string type = currency_types [ci.Territory] as string;
+
+ if (type == null) {
+ Console.WriteLine ("no currency type for: " + ci.Territory);
+ return;
+ }
+
+ string cur = (string) nav.Evaluate ("string(currencies/currency [@type='" +
+ type + "']/symbol)");
+
+ if (cur != String.Empty)
+ ci.NumberFormatEntry.CurrencySymbol = cur;
+ }
+
+ private bool LookupLcids (CultureInfoEntry ci)
+ {
+ XPathDocument doc = GetXPathDocument ("lcids.xml");
+ XPathNavigator nav = doc.CreateNavigator ();
+ string name = ci.Language;
+
+ if (ci.Territory != null)
+ name += "-" + ci.Territory;
+
+ XPathNodeIterator ni =(XPathNodeIterator) nav.Evaluate ("lcids/lcid[@name='"
+ + name + "']");
+ if (!ni.MoveNext ()) {
+ string file;
+ if (ci.Territory != null) {
+ file = Path.Combine ("locales", ci.Language + "_" + ci.Territory + ".xml");
+ File.Delete (file);
+ Console.WriteLine ("deleting file: " + file);
+ }
+ Console.WriteLine ("no lcid found for: " + name);
+ return false;
+ }
+
+ string id = ni.Current.GetAttribute ("id", String.Empty);
+ string parent = ni.Current.GetAttribute ("parent", String.Empty);
+ string specific = ni.Current.GetAttribute ("specific", String.Empty);
+ string iso2 = ni.Current.GetAttribute ("iso2", String.Empty);
+ string iso3 = ni.Current.GetAttribute ("iso3", String.Empty);
+ string win = ni.Current.GetAttribute ("win", String.Empty);
+ string icu = ni.Current.GetAttribute ("icu_name", String.Empty);
+
+ // lcids are in 0x<hex> format
+ ci.Lcid = id;
+ ci.ParentLcid = parent;
+ ci.SpecificLcid = specific;
+ ci.ISO2Lang = iso2;
+ ci.ISO3Lang = iso3;
+ ci.Win3Lang = win;
+ ci.IcuName = icu;
+
+ return true;
+ }
+
+ private string LookupFullName (CultureInfoEntry ci, XPathNavigator nav)
+ {
+ string pre = "ldml/localeDisplayNames/";
+ string ret;
+
+ ret = (string) nav.Evaluate ("string("+
+ pre + "languages/language[@type='" + ci.Language + "'])");
+
+ if (ci.Territory == null)
+ return ret;
+ ret += " (" + (string) nav.Evaluate ("string("+
+ pre + "territories/territory[@type='" + ci.Territory + "'])") + ")";
+
+ return ret;
+ }
+
+ private void LookupCurrencyTypes ()
+ {
+ XPathDocument doc = GetXPathDocument ("supplementalData.xml");
+ XPathNavigator nav = doc.CreateNavigator ();
+
+ currency_types = new Hashtable ();
+
+ XPathNodeIterator ni =(XPathNodeIterator) nav.Evaluate ("supplementalData/currencyData/region");
+ while (ni.MoveNext ()) {
+ string territory = (string) ni.Current.GetAttribute ("iso3166", String.Empty);
+ string currency = (string) ni.Current.Evaluate ("string(currency/@iso4217)");
+ currency_types [territory] = currency;
+ }
+ }
+
+ static string control_chars = "ghmsftz";
+
+ // HACK: We are trying to build year_month and month_day patterns from the full pattern.
+ private void ParseFullDateFormat (DateTimeFormatEntry df, string full)
+ {
+
+ string month_day = String.Empty;
+ string year_month = String.Empty;
+ bool in_month_data = false;
+ bool in_year_data = false;
+ int month_end = 0;
+ int year_end = 0;
+ bool inquote = false;
+
+ for (int i = 0; i < full.Length; i++) {
+ char c = full [i];
+ if (!inquote && c == 'M') {
+ month_day += c;
+ year_month += c;
+ in_year_data = true;
+ in_month_data = true;
+ month_end = month_day.Length;
+ year_end = year_month.Length;
+ } else if (!inquote && Char.ToLower (c) == 'd') {
+ month_day += c;
+ in_month_data = true;
+ in_year_data = false;
+ month_end = month_day.Length;
+ } else if (!inquote && Char.ToLower (c) == 'y') {
+ year_month += c;
+ in_year_data = true;
+ in_month_data = false;
+ year_end = year_month.Length;
+ } else if (!inquote && control_chars.IndexOf (Char.ToLower (c)) >= 0) {
+ in_year_data = false;
+ in_month_data = false;
+ } else if (in_year_data || in_month_data) {
+ if (in_month_data)
+ month_day += c;
+ if (in_year_data)
+ year_month += c;
+ }
+
+ if (c == '\'') {
+ inquote = !inquote;
+ }
+ }
+
+ if (month_day != String.Empty) {
+ month_day = month_day.Substring (0, month_end);
+ df.MonthDayPattern = month_day;
+ }
+ if (year_month != String.Empty) {
+ year_month = year_month.Substring (0, year_end);
+ df.YearMonthPattern = year_month;
+ }
+ }
+
+ private class LcidComparer : IComparer {
+
+ public int Compare (object a, object b)
+ {
+ CultureInfoEntry aa = (CultureInfoEntry) a;
+ CultureInfoEntry bb = (CultureInfoEntry) b;
+
+ return aa.Lcid.CompareTo (bb.Lcid);
+ }
+ }
+
+ private class NameComparer : IComparer {
+
+ public int Compare (object a, object b)
+ {
+ CultureInfoEntry aa = (CultureInfoEntry) a;
+ CultureInfoEntry bb = (CultureInfoEntry) b;
+
+ return aa.Name.ToLower ().CompareTo (bb.Name.ToLower ());
+ }
+ }
+ }
+}
+
+
diff --git a/tools/locale-builder/Entry.cs b/tools/locale-builder/Entry.cs
new file mode 100644
index 00000000000..07beccdb53e
--- /dev/null
+++ b/tools/locale-builder/Entry.cs
@@ -0,0 +1,84 @@
+//
+//
+//
+
+using System;
+using System.Text;
+using System.Collections;
+
+namespace Mono.Tools.LocaleBuilder {
+
+ public class Entry {
+
+ // maps strings to indexes
+ static Hashtable hash;
+ static ArrayList string_order;
+ // idx 0 is reserved to indicate null
+ static int curpos = 1;
+
+ // serialize the strings in Hashtable.
+ public static string GetStrings () {
+ Console.WriteLine ("Total string data size: {0}", curpos);
+ if (curpos > UInt16.MaxValue)
+ throw new Exception ("need to increase idx size in culture-info.h");
+ StringBuilder ret = new StringBuilder ();
+ // the null entry
+ ret.Append ("\"\\0\"\n");
+ foreach (string s in string_order) {
+ ret.Append ("\t\"");
+ ret.Append (s);
+ ret.Append ("\\0\"\n");
+ }
+ return ret.ToString ();
+ }
+ static Entry () {
+ hash = new Hashtable ();
+ string_order = new ArrayList ();
+ }
+ static int AddString (string s, int size) {
+ object o = hash [s];
+ if (o == null) {
+ int ret;
+ string_order.Add (s);
+ ret = curpos;
+ hash [s] = curpos;
+ curpos += size + 1; // null terminator
+ return ret;
+ } else {
+ return (int)o;
+ }
+ }
+
+ protected static String EncodeStringIdx (string str)
+ {
+ if (str == null)
+ return "0";
+
+ StringBuilder ret = new StringBuilder ();
+ byte [] ba = new UTF8Encoding ().GetBytes (str);
+ bool in_hex = false;
+ foreach (byte b in ba) {
+ if (b > 127 || (in_hex && is_hex (b))) {
+ ret.AppendFormat ("\\x{0:x}", b);
+ in_hex = true;
+ } else {
+ if (b == '\\')
+ ret.Append ('\\');
+ ret.Append ((char) b);
+ in_hex = false;
+ }
+ }
+ int res = AddString (ret.ToString (), ba.Length);
+ return res.ToString ();
+ }
+
+ private static bool is_hex (int e)
+ {
+ return (e >= '0' && e <= '9') || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
+ }
+ }
+}
+
+
+
+
diff --git a/tools/locale-builder/Makefile.am b/tools/locale-builder/Makefile.am
new file mode 100644
index 00000000000..8422f6bf504
--- /dev/null
+++ b/tools/locale-builder/Makefile.am
@@ -0,0 +1,43 @@
+
+MCS = mcs
+RUNTIME = mono
+MCSFLAGS = -g
+
+CLEANFILES = locale-builder.exe
+
+locale_builder_sources = Driver.cs \
+ CultureInfoEntry.cs \
+ DateTimeFormatEntry.cs \
+ NumberFormatEntry.cs \
+ Entry.cs
+
+supp_data_files = supp/ar_AE.xml supp/ar_EG.xml supp/ar_KW.xml supp/ar_MA.xml \
+ supp/ar_YE.xml supp/en_PH.xml supp/en_ZA.xml supp/th.xml \
+ supp/ar_IQ.xml supp/ar_LB.xml supp/ar_OM.xml supp/ar_TN.xml \
+ supp/en_US.xml supp/en_ZW.xml supp/ar_DZ.xml supp/ar_JO.xml \
+ supp/ar_QA.xml supp/ar.xml supp/en_IE.xml supp/en.xml \
+ supp/ar_SY.xml supp/ar_BH.xml supp/en_CA.xml supp/ar_LY.xml \
+ supp/root.xml
+
+EXTRA_DIST = $(locale_builder_sources) $(supp_data_files) lcids.xml supplementalData.xml
+
+locale-builder.exe: $(locale_builder_sources)
+ $(MCS) $(MCSFLAGS) /out:$@ $^
+
+culture-table: locale-builder.exe lang-data locale-data
+ $(RUNTIME) locale-builder.exe
+
+lang-data:
+ if ! test -f langs/en.xml ; then \
+ wget http://primates.ximian.com/~jackson/icu_langs.tar.gz ; \
+ tar xzvf icu_langs.tar.gz ; \
+ fi
+
+locale-data:
+ if ! test -f locales/en_US.xml ; then \
+ wget http://primates.ximian.com/~jackson/icu_locales.tar.gz ; \
+ tar xzvf icu_locales.tar.gz ; \
+ fi
+
+install-culture-table: culture-table
+ cp -f culture-info-tables.h ../../mono/metadata/. \ No newline at end of file
diff --git a/tools/locale-builder/NumberFormatEntry.cs b/tools/locale-builder/NumberFormatEntry.cs
new file mode 100644
index 00000000000..5c74fcfcd5a
--- /dev/null
+++ b/tools/locale-builder/NumberFormatEntry.cs
@@ -0,0 +1,117 @@
+//
+// Mono.Tools.LocaleBuilder.NumberFormatEntry
+//
+// Author(s):
+// Jackson Harper (jackson@ximian.com)
+//
+// (C) 2004 Novell, Inc (http://www.novell.com)
+//
+
+
+using System;
+using System.Text;
+
+namespace Mono.Tools.LocaleBuilder {
+
+ public class NumberFormatEntry : Entry {
+
+ public static readonly int MaxGroupSize = 5;
+
+ public int CurrencyDecimalDigits;
+ public string CurrencyDecimalSeparator;
+ public string CurrencyGroupSeparator;
+ public int [] CurrencyGroupSizes;
+ public int CurrencyNegativePattern;
+ public int CurrencyPositivePattern;
+ public string CurrencySymbol;
+ public string NaNSymbol;
+ public string NegativeSign;
+ public int NumberDecimalDigits;
+ public string NumberDecimalSeparator;
+ public string NumberGroupSeparator;
+ public int [] NumberGroupSizes;
+ public int NumberNegativePattern;
+ public int PercentDecimalDigits;
+ public string PercentDecimalSeparator;
+ public string PercentGroupSeparator;
+ public int [] PercentGroupSizes;
+ public int PercentNegativePattern;
+ public int PercentPositivePattern;
+ public string PercentSymbol;
+ public string PerMilleSymbol;
+ public string PositiveInfinitySymbol;
+ public string PositiveSign;
+
+ public int Row;
+
+ public string NegativeInfinitySymbol {
+ get {
+ return NegativeSign + PositiveInfinitySymbol;
+ }
+ }
+
+ public void AppendTableRow (StringBuilder builder)
+ {
+ builder.Append ("\t{");
+
+ 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 (EncodeStringIdx (CurrencySymbol) + ", ");
+ builder.Append (EncodeStringIdx (PercentSymbol) + ", ");
+ builder.Append (EncodeStringIdx (NaNSymbol) + ", ");
+ builder.Append (EncodeStringIdx (PerMilleSymbol) + ", ");
+ builder.Append (EncodeStringIdx (NegativeInfinitySymbol) + ", ");
+ builder.Append (EncodeStringIdx (PositiveInfinitySymbol) + ", ");
+
+ builder.Append (EncodeStringIdx (NegativeSign) + ", ");
+ builder.Append (EncodeStringIdx (PositiveSign) + ", ");
+
+ builder.Append (CurrencyNegativePattern + ", ");
+ builder.Append (CurrencyPositivePattern + ", ");
+ builder.Append (PercentNegativePattern + ", ");
+ builder.Append (PercentPositivePattern + ", ");
+ 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 ('}');
+ }
+
+ private void AppendGroupSizes (StringBuilder builder, int [] gs)
+ {
+ int len = (gs == null ? 0 : gs.Length);
+
+ builder.Append ('{');
+ for (int i = 0; i < MaxGroupSize; i++) {
+ if (i < len)
+ builder.Append (gs [0]);
+ else
+ builder.Append (-1);
+ if (i+1 < MaxGroupSize)
+ builder.Append (", ");
+ }
+ builder.Append ('}');
+ }
+
+ public override string ToString ()
+ {
+ StringBuilder builder = new StringBuilder ();
+ AppendTableRow (builder);
+ return builder.ToString ();
+ }
+ }
+}
+
diff --git a/tools/locale-builder/langs/.cvsignore b/tools/locale-builder/langs/.cvsignore
new file mode 100644
index 00000000000..6722cd96e78
--- /dev/null
+++ b/tools/locale-builder/langs/.cvsignore
@@ -0,0 +1 @@
+*.xml
diff --git a/tools/locale-builder/lcids.xml b/tools/locale-builder/lcids.xml
new file mode 100755
index 00000000000..c57f7e6c6ad
--- /dev/null
+++ b/tools/locale-builder/lcids.xml
@@ -0,0 +1,174 @@
+<lcids>
+ <lcid name="ar" id="0x0001" parent="0x007F" specific="0x0401" iso2="ar" iso3="ara" win="ARA" icu_name="Arabic" />
+ <lcid name="bg" id="0x0002" parent="0x007F" specific="0x0402" iso2="bg" iso3="bul" win="BGR" icu_name="Bulgarian" />
+ <lcid name="ca" id="0x0003" parent="0x007F" specific="0x0403" iso2="ca" iso3="cat" win="CAT" icu_name="Catalan" />
+ <lcid name="zh-CHS" id="0x0004" parent="0x007F" specific="0x0000" iso2="zh" iso3="zho" win="CHS" icu_name="Chinese" />
+ <lcid name="cs" id="0x0005" parent="0x007F" specific="0x0405" iso2="cs" iso3="ces" win="CSY" icu_name="Czech" />
+ <lcid name="da" id="0x0006" parent="0x007F" specific="0x0406" iso2="da" iso3="dan" win="DAN" icu_name="Danish" />
+ <lcid name="de" id="0x0007" parent="0x007F" specific="0x0407" iso2="de" iso3="deu" win="DEU" icu_name="German" />
+ <lcid name="el" id="0x0008" parent="0x007F" specific="0x0408" iso2="el" iso3="ell" win="ELL" icu_name="Greek" />
+ <lcid name="en" id="0x0009" parent="0x007F" specific="0x0409" iso2="en" iso3="eng" win="ENU" icu_name="English" />
+ <lcid name="ar-KW" id="0x3401" parent="0x0001" specific="0x3401" iso2="ar" iso3="ara" win="ARK" icu_name="Arabic (Kuwait)" />
+ <lcid name="fi" id="0x000B" parent="0x007F" specific="0x040B" iso2="fi" iso3="fin" win="FIN" icu_name="Finnish" />
+ <lcid name="fr" id="0x000C" parent="0x007F" specific="0x040C" iso2="fr" iso3="fra" win="FRA" icu_name="French" />
+ <lcid name="he" id="0x000D" parent="0x007F" specific="0x040D" iso2="he" iso3="heb" win="HEB" icu_name="Hebrew" />
+ <lcid name="hu" id="0x000E" parent="0x007F" specific="0x040E" iso2="hu" iso3="hun" win="HUN" icu_name="Hungarian" />
+ <lcid name="is" id="0x000F" parent="0x007F" specific="0x040F" iso2="is" iso3="isl" win="ISL" icu_name="Icelandic" />
+ <lcid name="it" id="0x0010" parent="0x007F" specific="0x0410" iso2="it" iso3="ita" win="ITA" icu_name="Italian" />
+ <lcid name="ja" id="0x0011" parent="0x007F" specific="0x0411" iso2="ja" iso3="jpn" win="JPN" icu_name="Japanese" />
+ <lcid name="en-PH" id="0x3409" parent="0x0009" specific="0x3409" iso2="en" iso3="eng" win="ENP" icu_name="English (Philippines)" />
+ <lcid name="nl" id="0x0013" parent="0x007F" specific="0x0413" iso2="nl" iso3="nld" win="NLD" icu_name="Dutch" />
+ <lcid name="ko" id="0x0012" parent="0x007F" specific="0x0412" iso2="ko" iso3="kor" win="KOR" icu_name="Korean" />
+ <lcid name="ar-SA" id="0x0401" parent="0x0001" specific="0x0401" iso2="ar" iso3="ara" win="ARA" icu_name="Arabic (Saudi Arabia)" />
+ <lcid name="bg-BG" id="0x0402" parent="0x0002" specific="0x0402" iso2="bg" iso3="bul" win="BGR" icu_name="Bulgarian (Bulgaria)" />
+ <lcid name="ca-ES" id="0x0403" parent="0x0003" specific="0x0403" iso2="ca" iso3="cat" win="CAT" icu_name="Catalan (Spain)" />
+ <lcid name="zh-TW" id="0x0404" parent="0x7C04" specific="0x0404" iso2="zh" iso3="zho" win="CHT" icu_name="Chinese (Taiwan)" />
+ <lcid name="cs-CZ" id="0x0405" parent="0x0005" specific="0x0405" iso2="cs" iso3="ces" win="CSY" icu_name="Czech (Czech Republic)" />
+ <lcid name="hr" id="0x001A" parent="0x007F" specific="0x041A" iso2="hr" iso3="hrv" win="HRV" icu_name="Croatian" />
+ <lcid name="de-DE" id="0x0407" parent="0x0007" specific="0x0407" iso2="de" iso3="deu" win="DEU" icu_name="German (Germany)" />
+ <lcid name="sq" id="0x001C" parent="0x007F" specific="0x041C" iso2="sq" iso3="sqi" win="SQI" icu_name="Albanian" />
+ <lcid name="en-US" id="0x0409" parent="0x0009" specific="0x0409" iso2="en" iso3="eng" win="ENU" icu_name="English (United States)" />
+ <lcid name="ar-AE" id="0x3801" parent="0x0001" specific="0x3801" iso2="ar" iso3="ara" win="ARU" icu_name="Arabic (United Arab Emirates)" />
+ <lcid name="fi-FI" id="0x040B" parent="0x000B" specific="0x040B" iso2="fi" iso3="fin" win="FIN" icu_name="Finnish (Finland)" />
+ <lcid name="fr-FR" id="0x040C" parent="0x000C" specific="0x040C" iso2="fr" iso3="fra" win="FRA" icu_name="French (France)" />
+ <lcid name="he-IL" id="0x040D" parent="0x000D" specific="0x040D" iso2="he" iso3="heb" win="HEB" icu_name="Hebrew (Israel)" />
+ <lcid name="hu-HU" id="0x040E" parent="0x000E" specific="0x040E" iso2="hu" iso3="hun" win="HUN" icu_name="Hungarian (Hungary)" />
+ <lcid name="be" id="0x0023" parent="0x007F" specific="0x0423" iso2="be" iso3="bel" win="BEL" icu_name="Belarusian" />
+ <lcid name="id" id="0x0021" parent="0x007F" specific="0x0421" iso2="id" iso3="ind" win="IND" icu_name="Indonesian" />
+ <lcid name="et" id="0x0025" parent="0x007F" specific="0x0425" iso2="et" iso3="est" win="ETI" icu_name="Estonian" />
+ <lcid name="ko-KR" id="0x0412" parent="0x0012" specific="0x0412" iso2="ko" iso3="kor" win="KOR" icu_name="Korean (South Korea)" />
+ <lcid name="nl-NL" id="0x0413" parent="0x0013" specific="0x0413" iso2="nl" iso3="nld" win="NLD" icu_name="Dutch (Netherlands)" />
+ <lcid name="no" id="0x0014" parent="0x007F" specific="0x0414" iso2="no" iso3="nor" win="NOR" icu_name="Norwegian" />
+ <lcid name="fa" id="0x0029" parent="0x007F" specific="0x0429" iso2="fa" iso3="fas" win="FAR" icu_name="Persian" />
+ <lcid name="lt" id="0x0027" parent="0x007F" specific="0x0427" iso2="lt" iso3="lit" win="LTH" icu_name="Lithuanian" />
+ <lcid name="hy" id="0x002B" parent="0x007F" specific="0x042B" iso2="hy" iso3="hye" win="HYE" icu_name="Armenian" />
+ <lcid name="zh-CN" id="0x0804" parent="0x0004" specific="0x0804" iso2="zh" iso3="zho" win="CHS" icu_name="Chinese (China)" />
+ <lcid name="eu" id="0x002D" parent="0x007F" specific="0x042D" iso2="eu" iso3="eus" win="EUQ" icu_name="Basque" />
+ <lcid name="hr-HR" id="0x041A" parent="0x001A" specific="0x041A" iso2="hr" iso3="hrv" win="HRV" icu_name="Croatian (Croatia)" />
+ <lcid name="de-CH" id="0x0807" parent="0x0007" specific="0x0807" iso2="de" iso3="deu" win="DES" icu_name="German (Switzerland)" />
+ <lcid name="sq-AL" id="0x041C" parent="0x001C" specific="0x041C" iso2="sq" iso3="sqi" win="SQI" icu_name="Albanian (Albania)" />
+ <lcid name="en-GB" id="0x0809" parent="0x0009" specific="0x0809" iso2="en" iso3="eng" win="ENG" icu_name="English (United Kingdom)" />
+ <lcid name="ar-BH" id="0x3C01" parent="0x0001" specific="0x3C01" iso2="ar" iso3="ara" win="ARH" icu_name="Arabic (Bahrain)" />
+ <lcid name="pl" id="0x0015" parent="0x007F" specific="0x0415" iso2="pl" iso3="pol" win="PLK" icu_name="Polish" />
+ <lcid name="fr-BE" id="0x080C" parent="0x000C" specific="0x080C" iso2="fr" iso3="fra" win="FRB" icu_name="French (Belgium)" />
+ <lcid name="id-ID" id="0x0421" parent="0x0021" specific="0x0421" iso2="id" iso3="ind" win="IND" icu_name="Indonesian (Indonesia)" />
+ <lcid name="af" id="0x0036" parent="0x007F" specific="0x0436" iso2="af" iso3="afr" win="AFK" icu_name="Afrikaans" />
+ <lcid name="be-BY" id="0x0423" parent="0x0023" specific="0x0423" iso2="be" iso3="bel" win="BEL" icu_name="Belarusian (Belarus)" />
+ <lcid name="fo" id="0x0038" parent="0x007F" specific="0x0438" iso2="fo" iso3="fao" win="FOS" icu_name="Faroese" />
+ <lcid name="et-EE" id="0x0425" parent="0x0025" specific="0x0425" iso2="et" iso3="est" win="ETI" icu_name="Estonian (Estonia)" />
+ <lcid name="lv-LV" id="0x0426" parent="0x0026" specific="0x0426" iso2="lv" iso3="lav" win="LVI" icu_name="Latvian (Latvia)" />
+ <lcid name="nl-BE" id="0x0813" parent="0x0013" specific="0x0813" iso2="nl" iso3="nld" win="NLB" icu_name="Dutch (Belgium)" />
+ <lcid name="da-DK" id="0x0406" parent="0x0006" specific="0x0406" iso2="da" iso3="dan" win="DAN" icu_name="Danish (Denmark)" />
+ <lcid name="fa-IR" id="0x0429" parent="0x0029" specific="0x0429" iso2="fa" iso3="fas" win="FAR" icu_name="Persian (Iran)" />
+ <lcid name="el-GR" id="0x0408" parent="0x0008" specific="0x0408" iso2="el" iso3="ell" win="ELL" icu_name="Greek (Greece)" />
+ <lcid name="hy-AM" id="0x042B" parent="0x002B" specific="0x042B" iso2="hy" iso3="hye" win="HYE" icu_name="Armenian (Armenia)" />
+ <lcid name="zh-HK" id="0x0C04" parent="0x7C04" specific="0x0C04" iso2="zh" iso3="zho" win="ZHH" icu_name="Chinese (Hong Kong S.A.R., China)" />
+ <lcid name="eu-ES" id="0x042D" parent="0x002D" specific="0x042D" iso2="eu" iso3="eus" win="EUQ" icu_name="Basque (Spain)" />
+ <lcid name="hi" id="0x0039" parent="0x007F" specific="0x0439" iso2="hi" iso3="hin" win="HIN" icu_name="Hindi" />
+ <lcid name="de-AT" id="0x0C07" parent="0x0007" specific="0x0C07" iso2="de" iso3="deu" win="DEA" icu_name="German (Austria)" />
+ <lcid name="lv" id="0x0026" parent="0x007F" specific="0x0426" iso2="lv" iso3="lav" win="LVI" icu_name="Latvian" />
+ <lcid name="en-AU" id="0x0C09" parent="0x0009" specific="0x0C09" iso2="en" iso3="eng" win="ENA" icu_name="English (Australia)" />
+ <lcid name="ar-QA" id="0x4001" parent="0x0001" specific="0x4001" iso2="ar" iso3="ara" win="ARQ" icu_name="Arabic (Qatar)" />
+ <lcid name="gu" id="0x0047" parent="0x007F" specific="0x0447" iso2="gu" iso3="guj" win="GUJ" icu_name="Gujarati" />
+ <lcid name="fr-CA" id="0x0C0C" parent="0x000C" specific="0x0C0C" iso2="fr" iso3="fra" win="FRC" icu_name="French (Canada)" />
+ <lcid name="ru" id="0x0019" parent="0x007F" specific="0x0419" iso2="ru" iso3="rus" win="RUS" icu_name="Russian" />
+ <lcid name="af-ZA" id="0x0436" parent="0x0036" specific="0x0436" iso2="af" iso3="afr" win="AFK" icu_name="Afrikaans (South Africa)" />
+ <lcid name="kn" id="0x004B" parent="0x007F" specific="0x044B" iso2="kn" iso3="kan" win="KAN" icu_name="Kannada" />
+ <lcid name="fo-FO" id="0x0438" parent="0x0038" specific="0x0438" iso2="fo" iso3="fao" win="FOS" icu_name="Faroese (Faroe Islands)" />
+ <lcid name="hi-IN" id="0x0439" parent="0x0039" specific="0x0439" iso2="hi" iso3="hin" win="HIN" icu_name="Hindi (India)" />
+ <lcid name="mr" id="0x004E" parent="0x007F" specific="0x044E" iso2="mr" iso3="mar" win="MAR" icu_name="Marathi" />
+ <lcid name="ru-RU" id="0x0419" parent="0x0019" specific="0x0419" iso2="ru" iso3="rus" win="RUS" icu_name="Russian (Russia)" />
+ <lcid name="mk" id="0x002F" parent="0x007F" specific="0x042F" iso2="mk" iso3="mkd" win="MKI" icu_name="Macedonian" />
+ <lcid name="ar-LY" id="0x1001" parent="0x0001" specific="0x1001" iso2="ar" iso3="ara" win="ARL" icu_name="Arabic (Libya)" />
+ <lcid name="pt" id="0x0016" parent="0x007F" specific="0x0416" iso2="pt" iso3="por" win="PTB" icu_name="Portuguese" />
+ <lcid name="sk" id="0x001B" parent="0x007F" specific="0x041B" iso2="sk" iso3="slk" win="SKY" icu_name="Slovak" />
+ <lcid name="zh-SG" id="0x1004" parent="0x0004" specific="0x1004" iso2="zh" iso3="zho" win="ZHI" icu_name="Chinese (Singapore)" />
+ <lcid name="sw" id="0x0041" parent="0x007F" specific="0x0441" iso2="sw" iso3="swa" win="SWK" icu_name="Swahili" />
+ <lcid name="gl" id="0x0056" parent="0x007F" specific="0x0456" iso2="gl" iso3="glg" win="GLC" icu_name="Gallegan" />
+ <lcid name="de-LU" id="0x1007" parent="0x0007" specific="0x1007" iso2="de" iso3="deu" win="DEL" icu_name="German (Luxembourg)" />
+ <lcid name="ro" id="0x0018" parent="0x007F" specific="0x0418" iso2="ro" iso3="ron" win="ROM" icu_name="Romanian" />
+ <lcid name="en-CA" id="0x1009" parent="0x0009" specific="0x1009" iso2="en" iso3="eng" win="ENC" icu_name="English (Canada)" />
+ <lcid name="sl" id="0x0024" parent="0x007F" specific="0x0424" iso2="sl" iso3="slv" win="SLV" icu_name="Slovenian" />
+ <lcid name="gu-IN" id="0x0447" parent="0x0047" specific="0x0447" iso2="gu" iso3="guj" win="GUJ" icu_name="Gujarati (India)" />
+ <lcid name="fr-CH" id="0x100C" parent="0x000C" specific="0x100C" iso2="fr" iso3="fra" win="FRS" icu_name="French (Switzerland)" />
+ <lcid name="es-BO" id="0x400A" parent="0x000A" specific="0x400A" iso2="es" iso3="spa" win="ESB" icu_name="Spanish (Bolivia)" />
+ <lcid name="lt-LT" id="0x0427" parent="0x0027" specific="0x0427" iso2="lt" iso3="lit" win="LTH" icu_name="Lithuanian (Lithuania)" />
+ <lcid name="kn-IN" id="0x044B" parent="0x004B" specific="0x044B" iso2="kn" iso3="kan" win="KAN" icu_name="Kannada (India)" />
+ <lcid name="es" id="0x000A" parent="0x007F" specific="0x0C0A" iso2="es" iso3="spa" win="ESP" icu_name="Spanish" />
+ <lcid name="sv" id="0x001D" parent="0x007F" specific="0x041D" iso2="sv" iso3="swe" win="SVE" icu_name="Swedish" />
+ <lcid name="mr-IN" id="0x044E" parent="0x004E" specific="0x044E" iso2="mr" iso3="mar" win="MAR" icu_name="Marathi (India)" />
+ <lcid name="kok" id="0x0057" parent="0x007F" specific="0x0457" iso2="hi" iso3="kok" win="KNK" icu_name="Konkani" />
+ <lcid name="th" id="0x001E" parent="0x007F" specific="0x041E" iso2="th" iso3="tha" win="THA" icu_name="Thai" />
+ <lcid name="ar-DZ" id="0x1401" parent="0x0001" specific="0x1401" iso2="ar" iso3="ara" win="ARG" icu_name="Arabic (Algeria)" />
+ <lcid name="mk-MK" id="0x042F" parent="0x002F" specific="0x042F" iso2="mk" iso3="mkd" win="MKI" icu_name="Macedonian (Macedonia)" />
+ <lcid name="is-IS" id="0x040F" parent="0x000F" specific="0x040F" iso2="is" iso3="isl" win="ISL" icu_name="Icelandic (Iceland)" />
+ <lcid name="zh-MO" id="0x1404" parent="0x0004" specific="0x1404" iso2="zh" iso3="zho" win="ZHM" icu_name="Chinese (Macao S.A.R. China)" />
+ <lcid name="ja-JP" id="0x0411" parent="0x0011" specific="0x0411" iso2="ja" iso3="jpn" win="JPN" icu_name="Japanese (Japan)" />
+ <lcid name="gl-ES" id="0x0456" parent="0x0056" specific="0x0456" iso2="gl" iso3="glg" win="GLC" icu_name="Gallegan (Spain)" />
+ <lcid name="ar-IQ" id="0x0801" parent="0x0001" specific="0x0801" iso2="ar" iso3="ara" win="ARI" icu_name="Arabic (Iraq)" />
+ <lcid name="nb-NO" id="0x0414" parent="0x0014" specific="0x0414" iso2="nb" iso3="nob" win="NOR" icu_name="Norwegian Bokm?l (Norway)" />
+ <lcid name="en-NZ" id="0x1409" parent="0x0009" specific="0x1409" iso2="en" iso3="eng" win="ENZ" icu_name="English (New Zealand)" />
+ <lcid name="pt-BR" id="0x0416" parent="0x0016" specific="0x0416" iso2="pt" iso3="por" win="PTB" icu_name="Portuguese (Brazil)" />
+ <lcid name="tr" id="0x001F" parent="0x007F" specific="0x041F" iso2="tr" iso3="tur" win="TRK" icu_name="Turkish" />
+ <lcid name="fr-LU" id="0x140C" parent="0x000C" specific="0x140C" iso2="fr" iso3="fra" win="FRL" icu_name="French (Luxembourg)" />
+ <lcid name="ta" id="0x0049" parent="0x007F" specific="0x0449" iso2="ta" iso3="tam" win="TAM" icu_name="Tamil" />
+ <lcid name="te" id="0x004A" parent="0x007F" specific="0x044A" iso2="te" iso3="tel" win="TEL" icu_name="Telugu" />
+ <lcid name="sk-SK" id="0x041B" parent="0x001B" specific="0x041B" iso2="sk" iso3="slk" win="SKY" icu_name="Slovak (Slovakia)" />
+ <lcid name="es-MX" id="0x080A" parent="0x000A" specific="0x080A" iso2="es" iso3="spa" win="ESM" icu_name="Spanish (Mexico)" />
+ <lcid name="sv-SE" id="0x041D" parent="0x001D" specific="0x041D" iso2="sv" iso3="swe" win="SVE" icu_name="Swedish (Sweden)" />
+ <lcid name="th-TH" id="0x041E" parent="0x001E" specific="0x041E" iso2="th" iso3="tha" win="THA" icu_name="Thai (Thailand)" />
+ <lcid name="es-HN" id="0x480A" parent="0x000A" specific="0x480A" iso2="es" iso3="spa" win="ESH" icu_name="Spanish (Honduras)" />
+ <lcid name="vi" id="0x002A" parent="0x007F" specific="0x042A" iso2="vi" iso3="vie" win="VIT" icu_name="Vietnamese" />
+ <lcid name="ar-MA" id="0x1801" parent="0x0001" specific="0x1801" iso2="ar" iso3="ara" win="ARM" icu_name="Arabic (Morocco)" />
+ <lcid name="zh-CHT" id="0x7C04" parent="0x007F" specific="0x0000" iso2="zh" iso3="zho" win="CHT" icu_name="Chinese (Taiwan)" />
+ <lcid name="uk" id="0x0022" parent="0x007F" specific="0x0422" iso2="uk" iso3="ukr" win="UKR" icu_name="Ukrainian" />
+ <lcid name="nn-NO" id="0x0814" parent="0x0014" specific="0x0814" iso2="nn" iso3="nno" win="NON" icu_name="Norwegian Nynorsk (Norway)" />
+ <lcid name="pt-PT" id="0x0816" parent="0x0016" specific="0x0816" iso2="pt" iso3="por" win="PTG" icu_name="Portuguese (Portugal)" />
+ <lcid name="en-IE" id="0x1809" parent="0x0009" specific="0x1809" iso2="en" iso3="eng" win="ENI" icu_name="English (Ireland)" />
+ <lcid name="es-PA" id="0x180A" parent="0x000A" specific="0x180A" iso2="es" iso3="spa" win="ESA" icu_name="Spanish (Panama)" />
+ <lcid name="fr-MC" id="0x180C" parent="0x000C" specific="0x180C" iso2="fr" iso3="fra" win="FRM" icu_name="French (Monaco)" />
+ <lcid name="sv-FI" id="0x081D" parent="0x001D" specific="0x081D" iso2="sv" iso3="swe" win="SVF" icu_name="Swedish (Finland)" />
+ <lcid name="it-IT" id="0x0410" parent="0x0010" specific="0x0410" iso2="it" iso3="ita" win="ITA" icu_name="Italian (Italy)" />
+ <lcid name="es-NI" id="0x4C0A" parent="0x000A" specific="0x4C0A" iso2="es" iso3="spa" win="ESI" icu_name="Spanish (Nicaragua)" />
+ <lcid name="ar-TN" id="0x1C01" parent="0x0001" specific="0x1C01" iso2="ar" iso3="ara" win="ART" icu_name="Arabic (Tunisia)" />
+ <lcid name="kok-IN" id="0x0457" parent="0x0057" specific="0x0457" iso2="kok" iso3="kok" win="KNK" icu_name="Konkani (India)" />
+ <lcid name="es-SV" id="0x440A" parent="0x000A" specific="0x440A" iso2="es" iso3="spa" win="ESE" icu_name="Spanish (El Salvador)" />
+ <lcid name="ro-RO" id="0x0418" parent="0x0018" specific="0x0418" iso2="ro" iso3="ron" win="ROM" icu_name="Romanian (Romania)" />
+ <lcid name="en-ZA" id="0x1C09" parent="0x0009" specific="0x1C09" iso2="en" iso3="eng" win="ENS" icu_name="English (South Africa)" />
+ <lcid name="es-DO" id="0x1C0A" parent="0x000A" specific="0x1C0A" iso2="es" iso3="spa" win="ESD" icu_name="Spanish (Dominican Republic)" />
+ <lcid name="tr-TR" id="0x041F" parent="0x001F" specific="0x041F" iso2="tr" iso3="tur" win="TRK" icu_name="Turkish (Turkey)" />
+ <lcid name="sw-KE" id="0x0441" parent="0x0041" specific="0x0441" iso2="sw" iso3="swa" win="SWK" icu_name="Swahili (Kenya)" />
+ <lcid name="ar-EG" id="0x0C01" parent="0x0001" specific="0x0C01" iso2="ar" iso3="ara" win="ARE" icu_name="Arabic (Egypt)" />
+ <lcid name="ar-OM" id="0x2001" parent="0x0001" specific="0x2001" iso2="ar" iso3="ara" win="ARO" icu_name="Arabic (Oman)" />
+ <lcid name="ta-IN" id="0x0449" parent="0x0049" specific="0x0449" iso2="ta" iso3="tam" win="TAM" icu_name="Tamil (India)" />
+ <lcid name="te-IN" id="0x044A" parent="0x004A" specific="0x044A" iso2="te" iso3="tel" win="TEL" icu_name="Telugu (India)" />
+ <lcid name="vi-VN" id="0x042A" parent="0x002A" specific="0x042A" iso2="vi" iso3="vie" win="VIT" icu_name="Vietnamese (Vietnam)" />
+ <lcid name="es-ES" id="0x0C0A" parent="0x000A" specific="0x0C0A" iso2="es" iso3="spa" win="ESN" icu_name="Spanish (Spain)" />
+ <lcid name="en-JM" id="0x2009" parent="0x0009" specific="0x2009" iso2="en" iso3="eng" win="ENJ" icu_name="English (Jamaica)" />
+ <lcid name="es-VE" id="0x200A" parent="0x000A" specific="0x200A" iso2="es" iso3="spa" win="ESV" icu_name="Spanish (Venezuela)" />
+ <lcid name="pl-PL" id="0x0415" parent="0x0015" specific="0x0415" iso2="pl" iso3="pol" win="PLK" icu_name="Polish (Poland)" />
+ <lcid name="de-LI" id="0x1407" parent="0x0007" specific="0x1407" iso2="de" iso3="deu" win="DEC" icu_name="German (Liechtenstein)" />
+ <lcid name="ar-YE" id="0x2401" parent="0x0001" specific="0x2401" iso2="ar" iso3="ara" win="ARY" icu_name="Arabic (Yemen)" />
+ <lcid name="es-CR" id="0x140A" parent="0x000A" specific="0x140A" iso2="es" iso3="spa" win="ESC" icu_name="Spanish (Costa Rica)" />
+ <lcid name="Cy-sr-SP" id="0x0C1A" parent="0x001A" specific="0x0C1A" iso2="sr" iso3="srp" win="SRB" icu_name="Serbian" />
+ <lcid name="es-CL" id="0x340A" parent="0x000A" specific="0x340A" iso2="es" iso3="spa" win="ESL" icu_name="Spanish (Chile)" />
+ <lcid name="it-CH" id="0x0810" parent="0x0010" specific="0x0810" iso2="it" iso3="ita" win="ITS" icu_name="Italian (Switzerland)" />
+ <lcid name="en-CB" id="0x2409" parent="0x0009" specific="0x2409" iso2="en" iso3="eng" win="ENB" icu_name="English (U.S. Virgin Islands)" />
+ <lcid name="es-CO" id="0x240A" parent="0x000A" specific="0x240A" iso2="es" iso3="spa" win="ESO" icu_name="Spanish (Colombia)" />
+ <lcid name="es-PR" id="0x500A" parent="0x000A" specific="0x500A" iso2="es" iso3="spa" win="ESU" icu_name="Spanish (Puerto Rico)" />
+ <lcid name="uk-UA" id="0x0422" parent="0x0022" specific="0x0422" iso2="uk" iso3="ukr" win="UKR" icu_name="Ukrainian (Ukraine)" />
+ <lcid name="sl-SI" id="0x0424" parent="0x0024" specific="0x0424" iso2="sl" iso3="slv" win="SLV" icu_name="Slovenian (Slovenia)" />
+ <lcid name="Lt-sr-SP" id="0x081A" parent="0x001A" specific="0x081A" iso2="sr" iso3="srp" win="SRL" icu_name="Serbo-Croatian" />
+ <lcid name="ar-SY" id="0x2801" parent="0x0001" specific="0x2801" iso2="ar" iso3="ara" win="ARS" icu_name="Arabic (Syria)" />
+ <lcid name="en-BZ" id="0x2809" parent="0x0009" specific="0x2809" iso2="en" iso3="eng" win="ENL" icu_name="English (Belize)" />
+ <lcid name="es-PE" id="0x280A" parent="0x000A" specific="0x280A" iso2="es" iso3="spa" win="ESR" icu_name="Spanish (Peru)" />
+ <lcid name="es-GT" id="0x100A" parent="0x000A" specific="0x100A" iso2="es" iso3="spa" win="ESG" icu_name="Spanish (Guatemala)" />
+ <lcid name="ar-JO" id="0x2C01" parent="0x0001" specific="0x2C01" iso2="ar" iso3="ara" win="ARJ" icu_name="Arabic (Jordan)" />
+ <lcid name="en-TT" id="0x2C09" parent="0x0009" specific="0x2C09" iso2="en" iso3="eng" win="ENT" icu_name="English (Trinidad and Tobago)" />
+ <lcid name="es-AR" id="0x2C0A" parent="0x000A" specific="0x2C0A" iso2="es" iso3="spa" win="ESS" icu_name="Spanish (Argentina)" />
+ <lcid name="es-PY" id="0x3C0A" parent="0x000A" specific="0x3C0A" iso2="es" iso3="spa" win="ESZ" icu_name="Spanish (Paraguay)" />
+ <lcid name="es-UY" id="0x380A" parent="0x000A" specific="0x380A" iso2="es" iso3="spa" win="ESY" icu_name="Spanish (Uruguay)" />
+ <lcid name="ar-LB" id="0x3001" parent="0x0001" specific="0x3001" iso2="ar" iso3="ara" win="ARB" icu_name="Arabic (Lebanon)" />
+ <lcid name="en-ZW" id="0x3009" parent="0x0009" specific="0x3009" iso2="en" iso3="eng" win="ENW" icu_name="English (Zimbabwe)" />
+ <lcid name="es-EC" id="0x300A" parent="0x000A" specific="0x300A" iso2="es" iso3="spa" win="ESF" icu_name="Spanish (Ecuador)" />
+</lcids> \ No newline at end of file
diff --git a/tools/locale-builder/locales/.cvsignore b/tools/locale-builder/locales/.cvsignore
new file mode 100644
index 00000000000..6722cd96e78
--- /dev/null
+++ b/tools/locale-builder/locales/.cvsignore
@@ -0,0 +1 @@
+*.xml
diff --git a/tools/locale-builder/supp/ChangeLog b/tools/locale-builder/supp/ChangeLog
new file mode 100755
index 00000000000..aac15bd01ce
--- /dev/null
+++ b/tools/locale-builder/supp/ChangeLog
@@ -0,0 +1,70 @@
+2004-10-06 Jackson Harper <jackson@ximian.com>
+
+ * pt.xml: We need a space after R$. Is there a better way to do
+ this? I should know...
+ * pt_BR.xml: Fix currency format.
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ja.xml : added extra datetime patterns.
+ * renamed ca.xml to added ca_ES.xml.
+ * ca_ES.xml, ko_KR.xml, pt_BR.xml : fixed percent patterns.
+
+2004-06-08 Atsushi Enomoto <atsushi@ximian.com>
+
+ * en.xml : added "all datetime" pattern strings.
+ * ca.xml, da.xml, el.xml, fi.xml, fr_FR.xml, he.xml, hu.xml,
+ nl_NL.xml : fixed percent patterns.
+
+2004-06-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * en_US.xml : fixed percent pattern.
+ * en_ZA.xml : fixed NumberDecimalDigits.
+ * id_ID.xml : fixed CurrencyDecimalDigits.
+ * ja_JP.xml : added currencySymbol (MS assigns 0x5c).
+
+2004-06-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * fr_CH.xml : missing updates.
+ * Renamed cs.xml as cs_CZ.xml and added number format.
+ Also renamed lt.xml as lt_LT.xml. They are files' precedence matter.
+ * es_NI.xml : added.
+ * en.xml, en_CA.xml, en_IE.xml, en_PH.xml, en_US.xml, en_ZW.xml :
+ Change with related to the change of NumberDecimalDigits handling.
+ * es_PR.xml, ja.xml, ko_KR.xml :
+ Added number format.
+
+2004-05-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * en_PH.xml, en_ZW.xml, fr_CA.xml, fr_CH.xml, fr_FR.xml, fr_LU.xml :
+ fixed incorrect markup.
+
+2004-05-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * Added ChangeLog also here (and moved the last msg from ..).
+
+ * af_ZA.xml, ar_SA.xml, be_BY.xml, de_AT.xml, en_AU.xml, en_GB.xml,
+ en_NZ.xml, es_AR.xml, es_BO.xml, es_CL.xml, es_CO.xml, es_CR.xml,
+ es_DO.xml, es_EC.xml, es_ES.xml, es_GT.xml, es_HN.xml, es_MX.xml,
+ es_PA.xml, es_PE.xml, es_PR.xml, es_PY.xml, es_SV.xml, es_UY.xml,
+ es_VE.xml, eu_ES.xml,
+ fo_FO.xml, fr_BE.xml, fr_CA.xml, fr_FR.xml, fr_CH.xml, fr_FR.xml,
+ fr_LU.xml, hi_IN.xml, id_ID.xml, it_CH.xml, it_IT.xml, ko_KR.xml,
+ nl_BE.xml, nl_NL.xml, pt_BR.xml, pt_PT.xml, sv_FI.xml, sv_SE.xml,
+ sw_KE.xml, bg.xml, ca.xml, cs.xml, da.xml, de.xml, el.xml, es.xml,
+ et.xml, fa.xml, fi.xml, he.xml, hr.xml, hu.xml, hy.xml, is.xml,
+ lt.xml, lv.xml, mk.xml, ro.xml, ru.xml, sk.xml, sl.xml, sq.xml,
+ tr.xml, uk.xml, vi.xml :
+ Added shortdate/longtime/am/pm etc. for DateTime.ToString().
+ * ar_AE.xml, ar_BH.xml, ar_DZ.xml, ar_EG.xml, ar_JO.xml, ar_KW.xml,
+ ar_LB.xml, ar_LY.xml, ar_MA.xml, ar_OM.xml, ar_QA.xml, ar_SY.xml,
+ ar_TN.xml, ar_YE.xml, en_CA.xml, en_IE.xml, en_PH.xml, en_ZA.xml,
+ en_ZW.xml :
+ Added shortdate/longtime.
+ * th.xml : ditto.
+ * ja.xml : I incorrectly modified long time format. Reverting.
+
+2004-05-26 Atsushi Enomoto <atsushi@ximian.com>
+
+ * pl.xml,
+ ja.xml : Added overriding formats. pl.xml fixes bug #58186.
diff --git a/tools/locale-builder/supp/af_ZA.xml b/tools/locale-builder/supp/af_ZA.xml
new file mode 100755
index 00000000000..1d1b18aacb4
--- /dev/null
+++ b/tools/locale-builder/supp/af_ZA.xml
@@ -0,0 +1,26 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <!-- hmm, LongTimePattern contains "tt", but neither "VM" nor "NM" is not in output. -->
+ <am></am>
+ <pm></pm>
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy/MM/dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/ar.xml b/tools/locale-builder/supp/ar.xml
new file mode 100644
index 00000000000..3f0e3f0b8e7
--- /dev/null
+++ b/tools/locale-builder/supp/ar.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar>
+ <optionalCalendars>
+ <calendar type="Hijri" />
+ </optionalCalendars>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_AE.xml b/tools/locale-builder/supp/ar_AE.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_AE.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_BH.xml b/tools/locale-builder/supp/ar_BH.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_BH.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_DZ.xml b/tools/locale-builder/supp/ar_DZ.xml
new file mode 100644
index 00000000000..c1e4e1d4956
--- /dev/null
+++ b/tools/locale-builder/supp/ar_DZ.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
+
+
diff --git a/tools/locale-builder/supp/ar_EG.xml b/tools/locale-builder/supp/ar_EG.xml
new file mode 100644
index 00000000000..2a0f8bbe9c6
--- /dev/null
+++ b/tools/locale-builder/supp/ar_EG.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_IQ.xml b/tools/locale-builder/supp/ar_IQ.xml
new file mode 100644
index 00000000000..e348fc6c7a9
--- /dev/null
+++ b/tools/locale-builder/supp/ar_IQ.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar>
+ <optionalCalendars>
+ <calendar type="Gregorian" greg_type="USEnglish" />
+ <calendar type="Gregorian" greg_type="Localized" />
+ </optionalCalendars>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_JO.xml b/tools/locale-builder/supp/ar_JO.xml
new file mode 100644
index 00000000000..952f8414928
--- /dev/null
+++ b/tools/locale-builder/supp/ar_JO.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
+
diff --git a/tools/locale-builder/supp/ar_KW.xml b/tools/locale-builder/supp/ar_KW.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_KW.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_LB.xml b/tools/locale-builder/supp/ar_LB.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_LB.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_LY.xml b/tools/locale-builder/supp/ar_LY.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_LY.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_MA.xml b/tools/locale-builder/supp/ar_MA.xml
new file mode 100644
index 00000000000..4f4b835e5a0
--- /dev/null
+++ b/tools/locale-builder/supp/ar_MA.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_OM.xml b/tools/locale-builder/supp/ar_OM.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_OM.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_QA.xml b/tools/locale-builder/supp/ar_QA.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_QA.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_SA.xml b/tools/locale-builder/supp/ar_SA.xml
new file mode 100755
index 00000000000..76a8d61c512
--- /dev/null
+++ b/tools/locale-builder/supp/ar_SA.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_SY.xml b/tools/locale-builder/supp/ar_SY.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_SY.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ar_TN.xml b/tools/locale-builder/supp/ar_TN.xml
new file mode 100644
index 00000000000..c1e4e1d4956
--- /dev/null
+++ b/tools/locale-builder/supp/ar_TN.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
+
+
diff --git a/tools/locale-builder/supp/ar_YE.xml b/tools/locale-builder/supp/ar_YE.xml
new file mode 100644
index 00000000000..8c6d6846ca8
--- /dev/null
+++ b/tools/locale-builder/supp/ar_YE.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="GregorianCalendar" />
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/be_BY.xml b/tools/locale-builder/supp/be_BY.xml
new file mode 100755
index 00000000000..b06059803bf
--- /dev/null
+++ b/tools/locale-builder/supp/be_BY.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/bg.xml b/tools/locale-builder/supp/bg.xml
new file mode 100755
index 00000000000..f8de93b7dff
--- /dev/null
+++ b/tools/locale-builder/supp/bg.xml
@@ -0,0 +1,17 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <default type="medium"/>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.M.yyyy 'Đł.'</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/ca_ES.xml b/tools/locale-builder/supp/ca_ES.xml
new file mode 100755
index 00000000000..ba2db28c017
--- /dev/null
+++ b/tools/locale-builder/supp/ca_ES.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/cs_CZ.xml b/tools/locale-builder/supp/cs_CZ.xml
new file mode 100755
index 00000000000..080578bef87
--- /dev/null
+++ b/tools/locale-builder/supp/cs_CZ.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d.M.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/da.xml b/tools/locale-builder/supp/da.xml
new file mode 100755
index 00000000000..566be9f5f93
--- /dev/null
+++ b/tools/locale-builder/supp/da.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/de.xml b/tools/locale-builder/supp/de.xml
new file mode 100755
index 00000000000..882fb0e8cb6
--- /dev/null
+++ b/tools/locale-builder/supp/de.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/de_AT.xml b/tools/locale-builder/supp/de_AT.xml
new file mode 100755
index 00000000000..882fb0e8cb6
--- /dev/null
+++ b/tools/locale-builder/supp/de_AT.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/el.xml b/tools/locale-builder/supp/el.xml
new file mode 100755
index 00000000000..83247170921
--- /dev/null
+++ b/tools/locale-builder/supp/el.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d/M/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en.xml b/tools/locale-builder/supp/en.xml
new file mode 100644
index 00000000000..26f0e4ac81a
--- /dev/null
+++ b/tools/locale-builder/supp/en.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM "http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM "http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ <scientificFormats>
+ <scientificFormatLength >
+ <scientificFormat >
+ <pattern>#E0</pattern>
+ </scientificFormat>
+ </scientificFormatLength >
+ </scientificFormats>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,###.##0%</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ <currencyFormats>
+ <currencyFormatLength >
+ <currencyFormat >
+ <pattern>¤#,###0.00;-¤#,###0.00</pattern>
+ </currencyFormat>
+ </currencyFormatLength >
+ </currencyFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <default type="medium"/>
+ <dateFormatLength type="long">
+ <dateFormat >
+ <pattern>dddd, MMMM dd, yyyy</pattern>
+ </dateFormat>
+ <extraPatterns>
+ <pattern>dddd, MMMM dd, yyyy</pattern>
+ <pattern>MMMM dd, yyyy</pattern>
+ <pattern>dddd, dd MMMM, yyyy</pattern>
+ <pattern>dd, MMMM, yyyy</pattern>
+ </extraPatterns>
+ </dateFormatLength >
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>M/d/yyyy</pattern>
+ </dateFormat>
+ <extraPatterns>
+ <pattern>M/d/yyyy</pattern>
+ <pattern>M/d/yy</pattern>
+ <pattern>M/d/yy</pattern>
+ <pattern>MM/dd/yy</pattern>
+ <pattern>MM/dd/yyyy</pattern>
+ <pattern>yy/MM/dd</pattern>
+ <pattern>yyyy-MM-dd</pattern>
+ <pattern>dd-MMM-yy</pattern>
+ </extraPatterns>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <default type="medium"/>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ <extraPatterns>
+ <pattern>h:mm:ss tt</pattern>
+ <pattern>hh:mm:ss tt</pattern>
+ <pattern>H:mm:ss</pattern>
+ <pattern>HH:mm:ss</pattern>
+ </extraPatterns>
+ </timeFormatLength >
+ <timeFormatLength type="medium">
+ <timeFormat >
+ <pattern>h:mm:ss a</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ <timeFormatLength type="short">
+ <timeFormat >
+ <pattern>h:mm tt</pattern>
+ </timeFormat>
+ <extraPatterns>
+ <pattern>h:mm tt</pattern>
+ <pattern>hh:mm tt</pattern>
+ <pattern>H:mm</pattern>
+ <pattern>HH:mm</pattern>
+ </extraPatterns>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
diff --git a/tools/locale-builder/supp/en_AU.xml b/tools/locale-builder/supp/en_AU.xml
new file mode 100755
index 00000000000..e4fa640494f
--- /dev/null
+++ b/tools/locale-builder/supp/en_AU.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_CA.xml b/tools/locale-builder/supp/en_CA.xml
new file mode 100644
index 00000000000..ee3149ae466
--- /dev/null
+++ b/tools/locale-builder/supp/en_CA.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_GB.xml b/tools/locale-builder/supp/en_GB.xml
new file mode 100755
index 00000000000..3f097c8e61b
--- /dev/null
+++ b/tools/locale-builder/supp/en_GB.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_IE.xml b/tools/locale-builder/supp/en_IE.xml
new file mode 100644
index 00000000000..2b6f3751bc4
--- /dev/null
+++ b/tools/locale-builder/supp/en_IE.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_NZ.xml b/tools/locale-builder/supp/en_NZ.xml
new file mode 100755
index 00000000000..b36c1b43d4d
--- /dev/null
+++ b/tools/locale-builder/supp/en_NZ.xml
@@ -0,0 +1,25 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <am>a.m.</am>
+ <pm>p.m.</pm>
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_PH.xml b/tools/locale-builder/supp/en_PH.xml
new file mode 100644
index 00000000000..99096d93701
--- /dev/null
+++ b/tools/locale-builder/supp/en_PH.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <am>AM</am>
+ <pm>PM</pm>
+ <dateFormats>
+ <default type="medium"/>
+ <dateFormatLength type="medium">
+ <dateFormat >
+ <pattern>MM d, yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>M/d/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat>
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength>
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_US.xml b/tools/locale-builder/supp/en_US.xml
new file mode 100644
index 00000000000..28864d4964e
--- /dev/null
+++ b/tools/locale-builder/supp/en_US.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_ZA.xml b/tools/locale-builder/supp/en_ZA.xml
new file mode 100644
index 00000000000..8d3234e11fc
--- /dev/null
+++ b/tools/locale-builder/supp/en_ZA.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy/MM/dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/en_ZW.xml b/tools/locale-builder/supp/en_ZW.xml
new file mode 100644
index 00000000000..496808e0313
--- /dev/null
+++ b/tools/locale-builder/supp/en_ZW.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <am>AM</am>
+ <pm>PM</pm>
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>M/d/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es.xml b/tools/locale-builder/supp/es.xml
new file mode 100755
index 00000000000..973908fbe72
--- /dev/null
+++ b/tools/locale-builder/supp/es.xml
@@ -0,0 +1,25 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <am>a.m.</am>
+ <pm>p.m.</pm>
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>MM/dd/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_AR.xml b/tools/locale-builder/supp/es_AR.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_AR.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_BO.xml b/tools/locale-builder/supp/es_BO.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_BO.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_CL.xml b/tools/locale-builder/supp/es_CL.xml
new file mode 100755
index 00000000000..f486ab117c5
--- /dev/null
+++ b/tools/locale-builder/supp/es_CL.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_CO.xml b/tools/locale-builder/supp/es_CO.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_CO.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_CR.xml b/tools/locale-builder/supp/es_CR.xml
new file mode 100755
index 00000000000..eccff247ae1
--- /dev/null
+++ b/tools/locale-builder/supp/es_CR.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_DO.xml b/tools/locale-builder/supp/es_DO.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_DO.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_EC.xml b/tools/locale-builder/supp/es_EC.xml
new file mode 100755
index 00000000000..8b62186686e
--- /dev/null
+++ b/tools/locale-builder/supp/es_EC.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_ES.xml b/tools/locale-builder/supp/es_ES.xml
new file mode 100755
index 00000000000..7f80edb874c
--- /dev/null
+++ b/tools/locale-builder/supp/es_ES.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_GT.xml b/tools/locale-builder/supp/es_GT.xml
new file mode 100755
index 00000000000..eccff247ae1
--- /dev/null
+++ b/tools/locale-builder/supp/es_GT.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_HN.xml b/tools/locale-builder/supp/es_HN.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_HN.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_MX.xml b/tools/locale-builder/supp/es_MX.xml
new file mode 100755
index 00000000000..eccff247ae1
--- /dev/null
+++ b/tools/locale-builder/supp/es_MX.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_NI.xml b/tools/locale-builder/supp/es_NI.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_NI.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_PA.xml b/tools/locale-builder/supp/es_PA.xml
new file mode 100755
index 00000000000..5308262c274
--- /dev/null
+++ b/tools/locale-builder/supp/es_PA.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>MM/dd/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_PE.xml b/tools/locale-builder/supp/es_PE.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_PE.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_PR.xml b/tools/locale-builder/supp/es_PR.xml
new file mode 100755
index 00000000000..a7fb435604c
--- /dev/null
+++ b/tools/locale-builder/supp/es_PR.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_PY.xml b/tools/locale-builder/supp/es_PY.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_PY.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_SV.xml b/tools/locale-builder/supp/es_SV.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_SV.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_UY.xml b/tools/locale-builder/supp/es_UY.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_UY.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/es_VE.xml b/tools/locale-builder/supp/es_VE.xml
new file mode 100755
index 00000000000..49a89c2f9bb
--- /dev/null
+++ b/tools/locale-builder/supp/es_VE.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/et.xml b/tools/locale-builder/supp/et.xml
new file mode 100755
index 00000000000..9fe6be5eb04
--- /dev/null
+++ b/tools/locale-builder/supp/et.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/eu_ES.xml b/tools/locale-builder/supp/eu_ES.xml
new file mode 100755
index 00000000000..5a3dada9618
--- /dev/null
+++ b/tools/locale-builder/supp/eu_ES.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy/MM/dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fa.xml b/tools/locale-builder/supp/fa.xml
new file mode 100755
index 00000000000..8a232e66aa6
--- /dev/null
+++ b/tools/locale-builder/supp/fa.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>M/d/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>hh:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fi.xml b/tools/locale-builder/supp/fi.xml
new file mode 100755
index 00000000000..2720792fb93
--- /dev/null
+++ b/tools/locale-builder/supp/fi.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d.M.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fo_FO.xml b/tools/locale-builder/supp/fo_FO.xml
new file mode 100755
index 00000000000..cea2ce57a14
--- /dev/null
+++ b/tools/locale-builder/supp/fo_FO.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH.mm.ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fr_BE.xml b/tools/locale-builder/supp/fr_BE.xml
new file mode 100755
index 00000000000..91cc07b9010
--- /dev/null
+++ b/tools/locale-builder/supp/fr_BE.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fr_CA.xml b/tools/locale-builder/supp/fr_CA.xml
new file mode 100755
index 00000000000..15c09065bb0
--- /dev/null
+++ b/tools/locale-builder/supp/fr_CA.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy-MM-dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fr_CH.xml b/tools/locale-builder/supp/fr_CH.xml
new file mode 100755
index 00000000000..0883ec00a7c
--- /dev/null
+++ b/tools/locale-builder/supp/fr_CH.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fr_FR.xml b/tools/locale-builder/supp/fr_FR.xml
new file mode 100755
index 00000000000..ff3cd20b2a5
--- /dev/null
+++ b/tools/locale-builder/supp/fr_FR.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/fr_LU.xml b/tools/locale-builder/supp/fr_LU.xml
new file mode 100755
index 00000000000..88a4f57f0ce
--- /dev/null
+++ b/tools/locale-builder/supp/fr_LU.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/he.xml b/tools/locale-builder/supp/he.xml
new file mode 100755
index 00000000000..c95fbfd9646
--- /dev/null
+++ b/tools/locale-builder/supp/he.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>%#,##0</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/hi_IN.xml b/tools/locale-builder/supp/hi_IN.xml
new file mode 100755
index 00000000000..371d2236351
--- /dev/null
+++ b/tools/locale-builder/supp/hi_IN.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/hr.xml b/tools/locale-builder/supp/hr.xml
new file mode 100755
index 00000000000..177812f3bb5
--- /dev/null
+++ b/tools/locale-builder/supp/hr.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d.M.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/hu.xml b/tools/locale-builder/supp/hu.xml
new file mode 100755
index 00000000000..107618cf666
--- /dev/null
+++ b/tools/locale-builder/supp/hu.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy. MM. dd.</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/hy.xml b/tools/locale-builder/supp/hy.xml
new file mode 100755
index 00000000000..b06059803bf
--- /dev/null
+++ b/tools/locale-builder/supp/hy.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/id_ID.xml b/tools/locale-builder/supp/id_ID.xml
new file mode 100755
index 00000000000..03a91e091c9
--- /dev/null
+++ b/tools/locale-builder/supp/id_ID.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <currencyFormats>
+ <currencyFormatLength >
+ <currencyFormat >
+ <pattern>#,##0;-#,##0</pattern>
+ </currencyFormat>
+ </currencyFormatLength >
+ </currencyFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <default type="medium"/>
+ <dateFormatLength type="medium">
+ <dateFormat >
+ <pattern>dd MMM yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/is.xml b/tools/locale-builder/supp/is.xml
new file mode 100755
index 00000000000..aee8c359b4d
--- /dev/null
+++ b/tools/locale-builder/supp/is.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d.M.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/it_CH.xml b/tools/locale-builder/supp/it_CH.xml
new file mode 100755
index 00000000000..882fb0e8cb6
--- /dev/null
+++ b/tools/locale-builder/supp/it_CH.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/it_IT.xml b/tools/locale-builder/supp/it_IT.xml
new file mode 100755
index 00000000000..4dc3b55bfd2
--- /dev/null
+++ b/tools/locale-builder/supp/it_IT.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H.mm.ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/ja.xml b/tools/locale-builder/supp/ja.xml
new file mode 100755
index 00000000000..2fda6ce803b
--- /dev/null
+++ b/tools/locale-builder/supp/ja.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <numbers>
+ <currencies>
+ <currency type="JPY">
+ <symbol>\</symbol>
+ </currency>
+ </currencies>
+ <currencyFormats>
+ <currencyFormatLength >
+ <currencyFormat >
+ <pattern>#,##0;-#,##0</pattern>
+ </currencyFormat>
+ </currencyFormatLength >
+ </currencyFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy/MM/dd</pattern>
+ </dateFormat>
+ <extraPatterns>
+ <pattern>yyyy/MM/dd</pattern>
+ <pattern>yy/MM/dd</pattern>
+ <pattern>yy/M/d</pattern>
+ <pattern>yyyy/M/d</pattern>
+ <pattern>yy/MM/dd' ('ddd')'</pattern>
+ <pattern>yy/M/d' ('ddd')'</pattern>
+ <pattern>yyyy/M/d' ('ddd')'</pattern>
+ <!-- we should not need yyyy-MM-dd that should be covered by yyyy/MM/dd -->
+ </extraPatterns>
+ </dateFormatLength >
+ <dateFormatLength type="long">
+ <extraPatterns>
+ <pattern>yyyy'年'M'月'd'日'</pattern>
+ <pattern>yyyy'年'MM'月'dd'日'</pattern>
+ <pattern>yyyy'年'M'月'd'日' dddd</pattern>
+ <pattern>yyyy'年'MM'月'dd'日' dddd</pattern>
+ </extraPatterns>
+ </dateFormatLength>
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <extraPatterns>
+ <pattern>H:mm:ss</pattern>
+ <pattern>HH:mm:ss</pattern>
+ <pattern>tt h:mm:ss</pattern>
+ <pattern>tt hh:mm:ss</pattern>
+ </extraPatterns>
+ </timeFormatLength>
+ <timeFormatLength type="short">
+ <extraPatterns>
+ <pattern>H:mm</pattern>
+ <pattern>HH:mm</pattern>
+ <pattern>tt h:mm</pattern>
+ <pattern>tt hh:mm</pattern>
+ </extraPatterns>
+ </timeFormatLength>
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
diff --git a/tools/locale-builder/supp/ko_KR.xml b/tools/locale-builder/supp/ko_KR.xml
new file mode 100755
index 00000000000..646116b7e5b
--- /dev/null
+++ b/tools/locale-builder/supp/ko_KR.xml
@@ -0,0 +1,39 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <currencyFormats>
+ <currencyFormatLength >
+ <currencyFormat >
+ <pattern>#,##0;-#,##0</pattern>
+ </currencyFormat>
+ </currencyFormatLength >
+ </currencyFormats>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy-MM-dd tt</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/lt_LT.xml b/tools/locale-builder/supp/lt_LT.xml
new file mode 100755
index 00000000000..fc35ffda4e6
--- /dev/null
+++ b/tools/locale-builder/supp/lt_LT.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <decimalFormats>
+ <decimalFormatLength >
+ <decimalFormat >
+ <pattern>#,##0.###;-#,##0.###</pattern>
+ </decimalFormat>
+ </decimalFormatLength >
+ </decimalFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy.MM.dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/lv.xml b/tools/locale-builder/supp/lv.xml
new file mode 100755
index 00000000000..140bacd379e
--- /dev/null
+++ b/tools/locale-builder/supp/lv.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy.MM.dd.</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/mk.xml b/tools/locale-builder/supp/mk.xml
new file mode 100755
index 00000000000..882fb0e8cb6
--- /dev/null
+++ b/tools/locale-builder/supp/mk.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/nl_BE.xml b/tools/locale-builder/supp/nl_BE.xml
new file mode 100755
index 00000000000..91cc07b9010
--- /dev/null
+++ b/tools/locale-builder/supp/nl_BE.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/nl_NL.xml b/tools/locale-builder/supp/nl_NL.xml
new file mode 100755
index 00000000000..a48b923a7b2
--- /dev/null
+++ b/tools/locale-builder/supp/nl_NL.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <percentFormats>
+ <percentFormatLength >
+ <percentFormat >
+ <pattern>#,##0 %</pattern>
+ </percentFormat>
+ </percentFormatLength >
+ </percentFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d-M-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/pl.xml b/tools/locale-builder/supp/pl.xml
new file mode 100755
index 00000000000..41e6c775c80
--- /dev/null
+++ b/tools/locale-builder/supp/pl.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <identity>
+ <version number="2.0"/>
+ <generation date="2003-12-19" />
+ <language type="pl" />
+ </identity>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy-MM-dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
diff --git a/tools/locale-builder/supp/pt.xml b/tools/locale-builder/supp/pt.xml
new file mode 100755
index 00000000000..c424d37d4fa
--- /dev/null
+++ b/tools/locale-builder/supp/pt.xml
@@ -0,0 +1,12 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <currencies>
+ <currency type="BRL">
+ <displayName>Real Brasileiro</displayName>
+ <symbol>R$ </symbol>
+ </currency>
+ </currencies>
+ </numbers>
+</ldml>
+
diff --git a/tools/locale-builder/supp/pt_BR.xml b/tools/locale-builder/supp/pt_BR.xml
new file mode 100755
index 00000000000..f06421234f3
--- /dev/null
+++ b/tools/locale-builder/supp/pt_BR.xml
@@ -0,0 +1,32 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <numbers>
+ <currencyFormats>
+ <currencyFormatLength >
+ <currencyFormat >
+ <pattern>#,##0.00;(#,##0.00)</pattern>
+ </currencyFormat>
+ </currencyFormatLength >
+ </currencyFormats>
+ </numbers>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d/M/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/pt_PT.xml b/tools/locale-builder/supp/pt_PT.xml
new file mode 100755
index 00000000000..db5f50a577d
--- /dev/null
+++ b/tools/locale-builder/supp/pt_PT.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd-MM-yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/ro.xml b/tools/locale-builder/supp/ro.xml
new file mode 100755
index 00000000000..882fb0e8cb6
--- /dev/null
+++ b/tools/locale-builder/supp/ro.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/root.xml b/tools/locale-builder/supp/root.xml
new file mode 100644
index 00000000000..664e75f3af2
--- /dev/null
+++ b/tools/locale-builder/supp/root.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<ldml>
+ <dates>
+ <symbols>
+ <dateSeparator>/</dateSeparator>
+ <timeSeparator>:</timeSeparator>
+ </symbols>
+ </dates>
+ <numbers>
+ <symbols>
+ <nan>NaN</nan>
+ <infinity>Infinity</infinity>
+ </symbols>
+ </numbers>
+</ldml>
+
diff --git a/tools/locale-builder/supp/ru.xml b/tools/locale-builder/supp/ru.xml
new file mode 100755
index 00000000000..b06059803bf
--- /dev/null
+++ b/tools/locale-builder/supp/ru.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/sk.xml b/tools/locale-builder/supp/sk.xml
new file mode 100755
index 00000000000..f9a84b22fbf
--- /dev/null
+++ b/tools/locale-builder/supp/sk.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d. M. yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/sl.xml b/tools/locale-builder/supp/sl.xml
new file mode 100755
index 00000000000..177812f3bb5
--- /dev/null
+++ b/tools/locale-builder/supp/sl.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d.M.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/sq.xml b/tools/locale-builder/supp/sq.xml
new file mode 100755
index 00000000000..38821e5e695
--- /dev/null
+++ b/tools/locale-builder/supp/sq.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy-MM-dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss.tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/sv_FI.xml b/tools/locale-builder/supp/sv_FI.xml
new file mode 100755
index 00000000000..aee8c359b4d
--- /dev/null
+++ b/tools/locale-builder/supp/sv_FI.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d.M.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/sv_SE.xml b/tools/locale-builder/supp/sv_SE.xml
new file mode 100755
index 00000000000..f546969abce
--- /dev/null
+++ b/tools/locale-builder/supp/sv_SE.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>yyyy-MM-dd</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/sw_KE.xml b/tools/locale-builder/supp/sw_KE.xml
new file mode 100755
index 00000000000..f1937e16c75
--- /dev/null
+++ b/tools/locale-builder/supp/sw_KE.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>M/d/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h.mm.ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/th.xml b/tools/locale-builder/supp/th.xml
new file mode 100644
index 00000000000..c8a5cf99099
--- /dev/null
+++ b/tools/locale-builder/supp/th.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE ldml SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldml.dtd"
+[
+ <!ENTITY % icu SYSTEM " http://www.openi18n.org/spec/ldml/1.0/ldmlICU.dtd">
+%icu;
+]
+>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar_type type="ThaiBuddhistCalendar" />
+ <calendar type="ThaiBuddhistCalendar">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>d/M/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml>
+
diff --git a/tools/locale-builder/supp/tr.xml b/tools/locale-builder/supp/tr.xml
new file mode 100755
index 00000000000..882fb0e8cb6
--- /dev/null
+++ b/tools/locale-builder/supp/tr.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>HH:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/uk.xml b/tools/locale-builder/supp/uk.xml
new file mode 100755
index 00000000000..b06059803bf
--- /dev/null
+++ b/tools/locale-builder/supp/uk.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd.MM.yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>H:mm:ss</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supp/vi.xml b/tools/locale-builder/supp/vi.xml
new file mode 100755
index 00000000000..5f96b53b009
--- /dev/null
+++ b/tools/locale-builder/supp/vi.xml
@@ -0,0 +1,23 @@
+ďťż<?xml version="1.0" encoding="UTF-8" ?>
+<ldml>
+ <dates>
+ <calendars>
+ <calendar type="gregorian">
+ <dateFormats>
+ <dateFormatLength type="short">
+ <dateFormat >
+ <pattern>dd/MM/yyyy</pattern>
+ </dateFormat>
+ </dateFormatLength >
+ </dateFormats>
+ <timeFormats>
+ <timeFormatLength type="long">
+ <timeFormat >
+ <pattern>h:mm:ss tt</pattern>
+ </timeFormat>
+ </timeFormatLength >
+ </timeFormats>
+ </calendar>
+ </calendars>
+ </dates>
+</ldml> \ No newline at end of file
diff --git a/tools/locale-builder/supplementalData.xml b/tools/locale-builder/supplementalData.xml
new file mode 100644
index 00000000000..ca4620776b8
--- /dev/null
+++ b/tools/locale-builder/supplementalData.xml
@@ -0,0 +1,968 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE supplementalData SYSTEM "http://www.openi18n.org/spec/ldml/1.0/ldmlSupplemental.dtd" >
+<supplementalData>
+ <currencyData>
+ <fractions>
+ <info iso4217="ADP" digits="0" />
+ <info iso4217="BHD" digits="3" />
+ <info iso4217="BIF" digits="0" />
+ <info iso4217="BYR" digits="0" />
+ <info iso4217="CHF" digits="2" rounding="5" />
+ <info iso4217="CLF" digits="0" />
+ <info iso4217="CLP" digits="0" />
+ <info iso4217="DEFAULT" digits="2" />
+ <info iso4217="DJF" digits="0" />
+ <info iso4217="GNF" digits="0" />
+ <info iso4217="IQD" digits="3" />
+ <info iso4217="JOD" digits="3" />
+ <info iso4217="JPY" digits="0" />
+ <info iso4217="KMF" digits="0" />
+ <info iso4217="KRW" digits="0" />
+ <info iso4217="KWD" digits="3" />
+ <info iso4217="LYD" digits="3" />
+ <info iso4217="MGF" digits="0" />
+ <info iso4217="OMR" digits="3" />
+ <info iso4217="PYG" digits="0" />
+ <info iso4217="RWF" digits="0" />
+ <info iso4217="TND" digits="3" />
+ <info iso4217="TRL" digits="0" />
+ <info iso4217="TTD" digits="0" />
+ <info iso4217="VUV" digits="0" />
+ <info iso4217="XAF" digits="0" />
+ <info iso4217="XOF" digits="0" />
+ <info iso4217="XPF" digits="0" />
+ </fractions>
+ <region iso3166="AE">
+ <currency iso4217="AED" >
+ </currency>
+ </region>
+ <region iso3166="AF">
+ <currency iso4217="AFN" >
+ </currency>
+ </region>
+ <region iso3166="AG">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="AI">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="AL">
+ <currency iso4217="ALL" >
+ </currency>
+ </region>
+ <region iso3166="AM">
+ <currency iso4217="AMD" >
+ </currency>
+ </region>
+ <region iso3166="AN">
+ <currency iso4217="ANG" >
+ </currency>
+ </region>
+ <region iso3166="AO">
+ <currency iso4217="AOA" >
+ </currency>
+ </region>
+ <region iso3166="AR">
+ <currency iso4217="ARS" >
+ </currency>
+ </region>
+ <region iso3166="AS">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="AT">
+ <currency iso4217="EUR" >
+ <alternate iso4217="ATS"/>
+ </currency>
+ </region>
+ <region iso3166="AU">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="AW">
+ <currency iso4217="AWG" >
+ </currency>
+ </region>
+ <region iso3166="AZ">
+ <currency iso4217="AZM" >
+ </currency>
+ </region>
+ <region iso3166="BA">
+ <currency iso4217="BAM" >
+ </currency>
+ </region>
+ <region iso3166="BB">
+ <currency iso4217="BBD" >
+ </currency>
+ </region>
+ <region iso3166="BD">
+ <currency iso4217="BDT" >
+ </currency>
+ </region>
+ <region iso3166="BE">
+ <currency iso4217="EUR" >
+ <alternate iso4217="BEF"/>
+ </currency>
+ </region>
+ <region iso3166="BF">
+ <currency iso4217="XOF" >
+ </currency>
+ </region>
+ <region iso3166="BG">
+ <currency iso4217="BGN" >
+ </currency>
+ </region>
+ <region iso3166="BH">
+ <currency iso4217="BHD" >
+ </currency>
+ </region>
+ <region iso3166="BI">
+ <currency iso4217="BIF" >
+ </currency>
+ </region>
+ <region iso3166="BJ">
+ <currency iso4217="XOF" >
+ </currency>
+ </region>
+ <region iso3166="BM">
+ <currency iso4217="BMD" >
+ </currency>
+ </region>
+ <region iso3166="BN">
+ <currency iso4217="BND" >
+ </currency>
+ </region>
+ <region iso3166="BO">
+ <currency iso4217="BOB" >
+ </currency>
+ </region>
+ <region iso3166="BR">
+ <currency iso4217="BRL" >
+ </currency>
+ </region>
+ <region iso3166="BS">
+ <currency iso4217="BSD" >
+ </currency>
+ </region>
+ <region iso3166="BV">
+ <currency iso4217="NOK" >
+ </currency>
+ </region>
+ <region iso3166="BW">
+ <currency iso4217="BWP" >
+ </currency>
+ </region>
+ <region iso3166="BY">
+ <currency iso4217="BYR" >
+ </currency>
+ </region>
+ <region iso3166="BZ">
+ <currency iso4217="BZD" >
+ </currency>
+ </region>
+ <region iso3166="CA">
+ <currency iso4217="CAD" >
+ </currency>
+ </region>
+ <region iso3166="CC">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="CD">
+ <currency iso4217="CDF" >
+ </currency>
+ </region>
+ <region iso3166="CF">
+ <currency iso4217="XAF" >
+ </currency>
+ </region>
+ <region iso3166="CG">
+ <currency iso4217="XAF" >
+ </currency>
+ </region>
+ <region iso3166="CH">
+ <currency iso4217="CHF" >
+ </currency>
+ </region>
+ <region iso3166="CI">
+ <currency iso4217="XOF" >
+ </currency>
+ </region>
+ <region iso3166="CK">
+ <currency iso4217="NZD" >
+ </currency>
+ </region>
+ <region iso3166="CL">
+ <currency iso4217="CLP" >
+ </currency>
+ </region>
+ <region iso3166="CM">
+ <currency iso4217="XAF" >
+ </currency>
+ </region>
+ <region iso3166="CN">
+ <currency iso4217="CNY" >
+ </currency>
+ </region>
+ <region iso3166="CO">
+ <currency iso4217="COP" >
+ </currency>
+ </region>
+ <region iso3166="CR">
+ <currency iso4217="CRC" >
+ </currency>
+ </region>
+ <region iso3166="CU">
+ <currency iso4217="CUP" >
+ </currency>
+ </region>
+ <region iso3166="CV">
+ <currency iso4217="CVE" >
+ </currency>
+ </region>
+ <region iso3166="CX">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="CY">
+ <currency iso4217="CYP" >
+ </currency>
+ </region>
+ <region iso3166="CZ">
+ <currency iso4217="CZK" >
+ </currency>
+ </region>
+ <region iso3166="DE">
+ <currency iso4217="EUR" >
+ <alternate iso4217="DEM"/>
+ </currency>
+ </region>
+ <region iso3166="DJ">
+ <currency iso4217="DJF" >
+ </currency>
+ </region>
+ <region iso3166="DK">
+ <currency iso4217="DKK" >
+ </currency>
+ </region>
+ <region iso3166="DM">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="DO">
+ <currency iso4217="DOP" >
+ </currency>
+ </region>
+ <region iso3166="DZ">
+ <currency iso4217="DZD" >
+ </currency>
+ </region>
+ <region iso3166="EC">
+ <currency iso4217="ECS" >
+ </currency>
+ </region>
+ <region iso3166="EE">
+ <currency iso4217="EEK" >
+ </currency>
+ </region>
+ <region iso3166="EG">
+ <currency iso4217="EGP" >
+ </currency>
+ </region>
+ <region iso3166="EH">
+ <currency iso4217="MAD" >
+ </currency>
+ </region>
+ <region iso3166="ER">
+ <currency iso4217="ERN" >
+ </currency>
+ </region>
+ <region iso3166="ES">
+ <currency iso4217="EUR" >
+ <alternate iso4217="ESP"/>
+ </currency>
+ </region>
+ <region iso3166="ET">
+ <currency iso4217="ETB" >
+ </currency>
+ </region>
+ <region iso3166="FI">
+ <currency iso4217="EUR" >
+ <alternate iso4217="FIM"/>
+ </currency>
+ </region>
+ <region iso3166="FJ">
+ <currency iso4217="FJD" >
+ </currency>
+ </region>
+ <region iso3166="FK">
+ <currency iso4217="FKP" >
+ </currency>
+ </region>
+ <region iso3166="FM">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="FO">
+ <currency iso4217="DKK" >
+ </currency>
+ </region>
+ <region iso3166="FR">
+ <currency iso4217="EUR" >
+ <alternate iso4217="FRF"/>
+ </currency>
+ </region>
+ <region iso3166="GA">
+ <currency iso4217="XAF" >
+ </currency>
+ </region>
+ <region iso3166="GB">
+ <currency iso4217="GBP" >
+ </currency>
+ </region>
+ <region iso3166="GD">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="GE">
+ <currency iso4217="GEL" >
+ </currency>
+ </region>
+ <region iso3166="GF">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="GH">
+ <currency iso4217="GHC" >
+ </currency>
+ </region>
+ <region iso3166="GI">
+ <currency iso4217="GIP" >
+ </currency>
+ </region>
+ <region iso3166="GL">
+ <currency iso4217="DKK" >
+ </currency>
+ </region>
+ <region iso3166="GM">
+ <currency iso4217="GMD" >
+ </currency>
+ </region>
+ <region iso3166="GN">
+ <currency iso4217="GNF" >
+ </currency>
+ </region>
+ <region iso3166="GP">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="GQ">
+ <currency iso4217="XAF" >
+ </currency>
+ </region>
+ <region iso3166="GR">
+ <currency iso4217="EUR" >
+ <alternate iso4217="GRD"/>
+ </currency>
+ </region>
+ <region iso3166="GT">
+ <currency iso4217="GTQ" >
+ </currency>
+ </region>
+ <region iso3166="GU">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="GY">
+ <currency iso4217="GYD" >
+ </currency>
+ </region>
+ <region iso3166="HK">
+ <currency iso4217="HKD" >
+ </currency>
+ </region>
+ <region iso3166="HM">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="HN">
+ <currency iso4217="HNL" >
+ </currency>
+ </region>
+ <region iso3166="HR">
+ <currency iso4217="HRK" >
+ </currency>
+ </region>
+ <region iso3166="HU">
+ <currency iso4217="HUF" >
+ </currency>
+ </region>
+ <region iso3166="ID">
+ <currency iso4217="IDR" >
+ </currency>
+ </region>
+ <region iso3166="IE">
+ <currency iso4217="EUR" >
+ <alternate iso4217="IEP"/>
+ </currency>
+ </region>
+ <region iso3166="IL">
+ <currency iso4217="ILS" >
+ </currency>
+ </region>
+ <region iso3166="IN">
+ <currency iso4217="INR" >
+ </currency>
+ </region>
+ <region iso3166="IO">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="IQ">
+ <currency iso4217="IQD" >
+ </currency>
+ </region>
+ <region iso3166="IR">
+ <currency iso4217="IRR" >
+ </currency>
+ </region>
+ <region iso3166="IS">
+ <currency iso4217="ISK" >
+ </currency>
+ </region>
+ <region iso3166="IT">
+ <currency iso4217="EUR" >
+ <alternate iso4217="ITL"/>
+ </currency>
+ </region>
+ <region iso3166="JM">
+ <currency iso4217="JMD" >
+ </currency>
+ </region>
+ <region iso3166="JO">
+ <currency iso4217="JOD" >
+ </currency>
+ </region>
+ <region iso3166="JP">
+ <currency iso4217="JPY" >
+ </currency>
+ </region>
+ <region iso3166="KE">
+ <currency iso4217="KES" >
+ </currency>
+ </region>
+ <region iso3166="KG">
+ <currency iso4217="KGS" >
+ </currency>
+ </region>
+ <region iso3166="KH">
+ <currency iso4217="KHR" >
+ </currency>
+ </region>
+ <region iso3166="KI">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="KM">
+ <currency iso4217="KMF" >
+ </currency>
+ </region>
+ <region iso3166="KN">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="KP">
+ <currency iso4217="KPW" >
+ </currency>
+ </region>
+ <region iso3166="KR">
+ <currency iso4217="KRW" >
+ </currency>
+ </region>
+ <region iso3166="KW">
+ <currency iso4217="KWD" >
+ </currency>
+ </region>
+ <region iso3166="KY">
+ <currency iso4217="KYD" >
+ </currency>
+ </region>
+ <region iso3166="KZ">
+ <currency iso4217="KZT" >
+ </currency>
+ </region>
+ <region iso3166="LA">
+ <currency iso4217="LAK" >
+ </currency>
+ </region>
+ <region iso3166="LB">
+ <currency iso4217="LBP" >
+ </currency>
+ </region>
+ <region iso3166="LC">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="LI">
+ <currency iso4217="CHF" >
+ </currency>
+ </region>
+ <region iso3166="LK">
+ <currency iso4217="LKR" >
+ </currency>
+ </region>
+ <region iso3166="LR">
+ <currency iso4217="LRD" >
+ </currency>
+ </region>
+ <region iso3166="LT">
+ <currency iso4217="LTL" >
+ </currency>
+ </region>
+ <region iso3166="LU">
+ <currency iso4217="EUR" >
+ <alternate iso4217="LUF"/>
+ </currency>
+ </region>
+ <region iso3166="LV">
+ <currency iso4217="LVL" >
+ </currency>
+ </region>
+ <region iso3166="LY">
+ <currency iso4217="LYD" >
+ </currency>
+ </region>
+ <region iso3166="MA">
+ <currency iso4217="MAD" >
+ </currency>
+ </region>
+ <region iso3166="MC">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="MD">
+ <currency iso4217="MDL" >
+ </currency>
+ </region>
+ <region iso3166="MG">
+ <currency iso4217="MGF" >
+ </currency>
+ </region>
+ <region iso3166="MH">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="MK">
+ <currency iso4217="MKD" >
+ </currency>
+ </region>
+ <region iso3166="ML">
+ <currency iso4217="XOF" >
+ </currency>
+ </region>
+ <region iso3166="MM">
+ <currency iso4217="MMK" >
+ </currency>
+ </region>
+ <region iso3166="MN">
+ <currency iso4217="MNT" >
+ </currency>
+ </region>
+ <region iso3166="MO">
+ <currency iso4217="MOP" >
+ </currency>
+ </region>
+ <region iso3166="MP">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="MQ">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="MR">
+ <currency iso4217="MRO" >
+ </currency>
+ </region>
+ <region iso3166="MS">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="MT">
+ <currency iso4217="MTL" >
+ </currency>
+ </region>
+ <region iso3166="MU">
+ <currency iso4217="MUR" >
+ </currency>
+ </region>
+ <region iso3166="MV">
+ <currency iso4217="MVR" >
+ </currency>
+ </region>
+ <region iso3166="MW">
+ <currency iso4217="MWK" >
+ </currency>
+ </region>
+ <region iso3166="MX">
+ <currency iso4217="MXN" >
+ </currency>
+ </region>
+ <region iso3166="MY">
+ <currency iso4217="MYR" >
+ </currency>
+ </region>
+ <region iso3166="MZ">
+ <currency iso4217="MZM" >
+ </currency>
+ </region>
+ <region iso3166="NC">
+ <currency iso4217="XPF" >
+ </currency>
+ </region>
+ <region iso3166="NE">
+ <currency iso4217="XOF" >
+ </currency>
+ </region>
+ <region iso3166="NF">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="NG">
+ <currency iso4217="NGN" >
+ </currency>
+ </region>
+ <region iso3166="NI">
+ <currency iso4217="NIO" >
+ </currency>
+ </region>
+ <region iso3166="NL">
+ <currency iso4217="EUR" >
+ <alternate iso4217="NLG"/>
+ </currency>
+ </region>
+ <region iso3166="NO">
+ <currency iso4217="NOK" >
+ </currency>
+ </region>
+ <region iso3166="NP">
+ <currency iso4217="NPR" >
+ </currency>
+ </region>
+ <region iso3166="NR">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="NU">
+ <currency iso4217="NZD" >
+ </currency>
+ </region>
+ <region iso3166="NZ">
+ <currency iso4217="NZD" >
+ </currency>
+ </region>
+ <region iso3166="OM">
+ <currency iso4217="OMR" >
+ </currency>
+ </region>
+ <region iso3166="PA">
+ <currency iso4217="PAB" >
+ </currency>
+ </region>
+ <region iso3166="PE">
+ <currency iso4217="PEN" >
+ </currency>
+ </region>
+ <region iso3166="PF">
+ <currency iso4217="XPF" >
+ </currency>
+ </region>
+ <region iso3166="PG">
+ <currency iso4217="PGK" >
+ </currency>
+ </region>
+ <region iso3166="PH">
+ <currency iso4217="PHP" >
+ </currency>
+ </region>
+ <region iso3166="PK">
+ <currency iso4217="PKR" >
+ </currency>
+ </region>
+ <region iso3166="PL">
+ <currency iso4217="PLN" >
+ </currency>
+ </region>
+ <region iso3166="PM">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="PN">
+ <currency iso4217="NZD" >
+ </currency>
+ </region>
+ <region iso3166="PR">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="PT">
+ <currency iso4217="EUR" >
+ <alternate iso4217="PTE"/>
+ </currency>
+ </region>
+ <region iso3166="PW">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="PY">
+ <currency iso4217="PYG" >
+ </currency>
+ </region>
+ <region iso3166="QA">
+ <currency iso4217="QAR" >
+ </currency>
+ </region>
+ <region iso3166="RE">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="RO">
+ <currency iso4217="ROL" >
+ </currency>
+ </region>
+ <region iso3166="RU">
+ <currency iso4217="RUR" >
+ </currency>
+ </region>
+ <region iso3166="RW">
+ <currency iso4217="RWF" >
+ </currency>
+ </region>
+ <region iso3166="SA">
+ <currency iso4217="SAR" >
+ </currency>
+ </region>
+ <region iso3166="SB">
+ <currency iso4217="SBD" >
+ </currency>
+ </region>
+ <region iso3166="SC">
+ <currency iso4217="SCR" >
+ </currency>
+ </region>
+ <region iso3166="SD">
+ <currency iso4217="SDD" >
+ </currency>
+ </region>
+ <region iso3166="SE">
+ <currency iso4217="SEK" >
+ </currency>
+ </region>
+ <region iso3166="SG">
+ <currency iso4217="SGD" >
+ </currency>
+ </region>
+ <region iso3166="SH">
+ <currency iso4217="SHP" >
+ </currency>
+ </region>
+ <region iso3166="SI">
+ <currency iso4217="SIT" >
+ </currency>
+ </region>
+ <region iso3166="SJ">
+ <currency iso4217="NOK" >
+ </currency>
+ </region>
+ <region iso3166="SK">
+ <currency iso4217="SKK" >
+ </currency>
+ </region>
+ <region iso3166="SL">
+ <currency iso4217="SLL" >
+ </currency>
+ </region>
+ <region iso3166="SM">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="SN">
+ <currency iso4217="XOF" >
+ </currency>
+ </region>
+ <region iso3166="SO">
+ <currency iso4217="SOS" >
+ </currency>
+ </region>
+ <region iso3166="SR">
+ <currency iso4217="SRG" >
+ </currency>
+ </region>
+ <region iso3166="ST">
+ <currency iso4217="STD" >
+ </currency>
+ </region>
+ <region iso3166="SV">
+ <currency iso4217="SVC" >
+ </currency>
+ </region>
+ <region iso3166="SY">
+ <currency iso4217="SYP" >
+ </currency>
+ </region>
+ <region iso3166="SZ">
+ <currency iso4217="SZL" >
+ </currency>
+ </region>
+ <region iso3166="TC">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="TD">
+ <currency iso4217="XAF" >
+ </currency>
+ </region>
+ <region iso3166="TF">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="TG">
+ <currency iso4217="XOF" >
+ </currency>
+ </region>
+ <region iso3166="TH">
+ <currency iso4217="THB" >
+ </currency>
+ </region>
+ <region iso3166="TJ">
+ <currency iso4217="TJS" >
+ </currency>
+ </region>
+ <region iso3166="TK">
+ <currency iso4217="NZD" >
+ </currency>
+ </region>
+ <region iso3166="TL">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="TM">
+ <currency iso4217="TMM" >
+ </currency>
+ </region>
+ <region iso3166="TN">
+ <currency iso4217="TND" >
+ </currency>
+ </region>
+ <region iso3166="TO">
+ <currency iso4217="TOP" >
+ </currency>
+ </region>
+ <region iso3166="TR">
+ <currency iso4217="TRL" >
+ </currency>
+ </region>
+ <region iso3166="TT">
+ <currency iso4217="TTD" >
+ </currency>
+ </region>
+ <region iso3166="TV">
+ <currency iso4217="AUD" >
+ </currency>
+ </region>
+ <region iso3166="TW">
+ <currency iso4217="TWD" >
+ </currency>
+ </region>
+ <region iso3166="TZ">
+ <currency iso4217="TZS" >
+ </currency>
+ </region>
+ <region iso3166="UA">
+ <currency iso4217="UAH" >
+ </currency>
+ </region>
+ <region iso3166="UG">
+ <currency iso4217="UGX" >
+ </currency>
+ </region>
+ <region iso3166="UM">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="US">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="UY">
+ <currency iso4217="UYU" >
+ </currency>
+ </region>
+ <region iso3166="UZ">
+ <currency iso4217="UZS" >
+ </currency>
+ </region>
+ <region iso3166="VA">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="VC">
+ <currency iso4217="XCD" >
+ </currency>
+ </region>
+ <region iso3166="VE">
+ <currency iso4217="VEB" >
+ </currency>
+ </region>
+ <region iso3166="VG">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="VI">
+ <currency iso4217="USD" >
+ </currency>
+ </region>
+ <region iso3166="VN">
+ <currency iso4217="VND" >
+ </currency>
+ </region>
+ <region iso3166="VU">
+ <currency iso4217="VUV" >
+ </currency>
+ </region>
+ <region iso3166="WF">
+ <currency iso4217="XPF" >
+ </currency>
+ </region>
+ <region iso3166="WS">
+ <currency iso4217="WST" >
+ </currency>
+ </region>
+ <region iso3166="YE">
+ <currency iso4217="YER" >
+ </currency>
+ </region>
+ <region iso3166="YT">
+ <currency iso4217="EUR" >
+ </currency>
+ </region>
+ <region iso3166="YU">
+ <currency iso4217="YUM" >
+ </currency>
+ </region>
+ <region iso3166="ZA">
+ <currency iso4217="ZAR" >
+ </currency>
+ </region>
+ <region iso3166="ZM">
+ <currency iso4217="ZMK" >
+ </currency>
+ </region>
+ <region iso3166="ZW">
+ <currency iso4217="ZWD" >
+ </currency>
+ </region>
+ </currencyData>
+</supplementalData>
diff --git a/web/.cvsignore b/web/.cvsignore
index 6d3ceb93234..433abaf84a9 100644
--- a/web/.cvsignore
+++ b/web/.cvsignore
@@ -2,3 +2,4 @@ Makefile.in
Makefile
all-docs
pending-classes.in
+class-status-*
diff --git a/web/ChangeLog b/web/ChangeLog
new file mode 100755
index 00000000000..3136a8aa3ce
--- /dev/null
+++ b/web/ChangeLog
@@ -0,0 +1,109 @@
+2004-10-11 Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
+
+ * web/team.xml: Update my info.
+
+2004-10-04 Zoltan Varga <vargaz@freemail.hu>
+
+ * web/team.xml: Update my info.
+
+2004-09-02 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : updates on 2.0 stuff. deprecating XPathDocument,
+ updating XQuery status etc.
+
+2004-08-03 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : some updates on 2.0 stuff.
+
+2004-07-12 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : oops, list styles.
+
+2004-07-11 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : updates and plans/ideas for Mono 1.2.
+
+2004-06-15 Sebastien Pouliot <sebastien@ximian.com>
+
+ * crypto: Updated status for beta 3. Removed stuff that is better
+ documented in monodoc.
+
+2004-06-08 Duncan Mak <duncan@ximian.com>
+
+ * download: Add MacOS X installer.
+
+2004-06-05 Duncan Mak <duncan@ximian.com>
+
+ * download: Add section for Fedora Core 2.
+
+2004-06-02 Duncan Mak <duncan@ximian.com>
+
+ * download: Use the correct yum-repository.
+
+2004-05-17 Duncan Mak <duncan@ximian.com>
+
+ * languages: Added section on Nemerle, per request from Kamil
+ Skalski.
+
+2004-05-10 Duncan Mak <duncan@ximian.com>
+
+ * download: Add link to packagers page.
+
+2004-05-06 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : updates
+
+2004-04-10 Daniel Morgan <danielmorgan@verizon.net>
+
+ * ado-net
+ * sqlclient
+ * oracle
+ * postgresql
+ * mysql: clean up Mono ADO.NET web pages
+
+ * makefile: remove building of obsolete web page tds-providers
+
+2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
+
+ * mono-todo: I finished the vtable task :-).
+
+2004-03-04 Sebastien Pouliot <sebastien@ximian.com>
+
+ * mono-hacking-roadmap.html: Updated status about assembly
+ signing.
+
+2004-02-05 Aaron Weber <aaron@ximian.com>
+
+ * README: update to describe better how to use the doc/web stuff
+
+ * index: change layout, move old news to oldnews page, rewrite
+ content, add new headings, decrease size of other headings.
+
+ * jit-debug: change link to martin's page; now it points to the
+ dir holding the debugger files. Fix grammar in one sentence.
+
+ * oldnews: erase very old news, add slightly old news removed from
+ index
+
+ * web/htmlify: shrink size of newsitem headings.
+
+2004-02-03 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : updates
+
+2004-01-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : status update, additional infos.
+
+2004-01-16 Atsushi Enomoto <atsushi@ximian.com>
+
+ * web/commands : Added xml-classes (forgot to commit).
+ * mono-build-w32.sh : Added icu support as well as glib.
+ * ChangeLog : tiny fix
+
+2004-01-11 Atsushi Enomoto <atsushi@ximian.com>
+
+ * xml-classes : added v2 info. schema status updates.
+
+ Added ChangeLog. (There is no reason not to keep ChangeLog for
+ documents, at least for not a little changes ;-)
diff --git a/web/Makefile.am b/web/Makefile.am
index 8ef4e422c5d..2588b2aa714 100644
--- a/web/Makefile.am
+++ b/web/Makefile.am
@@ -1,9 +1,14 @@
-WEB_FILES= \
- ado-net c-sharp class-library contact contributing documentation download \
- faq gcc-frontend ideas index passport rationale resources \
- roadmap runtime status team testing thanks tools porting anoncvs monodoc-xml winforms
-
-OTHERS= pending resources-pending todo mono-build.sh mono-build-w32.sh
+WEB_FILES= \
+ ado-net anoncvs asp-net books ccvs c-sharp class-library contact contributing devel-faq documentation download \
+ embedded-api faq firebird gcc-frontend hackers ideas index \
+ java jit-debug languages mailing-lists monodoc-xml mysql odbc \
+ oledb papers \
+ passport plans porting postgresql ppc projects rationale \
+ resources roadmap runtime sqlclient sqlite sybase tdsclient \
+ tds-providers status testing thanks tools \
+ porting anoncvs monodoc-xml winforms delegate
+
+OTHERS= pending resources-pending todo mono-build.sh mono-build-w32.sh print-stack
EXTRA_DIST = $(WEB_FILES) README $(OTHERS)
@@ -12,8 +17,8 @@ all-docs: $(WEB_FILES)
runtime documentation download faq contributing \
resources status > all-docs
-class-status: class-status.in pending-classes Makefile.am
- cat class-status.in pending-classes > class-status
+class-status: class-status.in Makefile.am
+ cat class-status.in > class-status
pending-classes:
diff --git a/web/MonoBeta1PressCoverage.html b/web/MonoBeta1PressCoverage.html
new file mode 100644
index 00000000000..75a800469e0
--- /dev/null
+++ b/web/MonoBeta1PressCoverage.html
@@ -0,0 +1 @@
+ <h1>Mono Beta 1 press coverage report</h1> <div> <br> <p>May 14, 2004</p> <p>by Kevan Barney, Novell</p> <p>The chronological listing below represents a good portion, but not all, of the English-language press coverage to date.</p> </div><div> <br> <p><b>Mono project achieves beta release, invites developer input</b>,<br><i>LinuxDevices.com</i> (May 5, 2004, <a href="http://www.linuxdevices.com/news/NS9523685217.html">Link</a>)</p> <p><b>Mono Project Releases Beta 1</b>,<br><i>Slashdot</i> (May 5, 2004, <a href="http://slashdot.org/articles/04/05/05/0443213.shtml?tid=106&amp;tid=185&amp;tid=190&amp;tid=201">Link</a>) </p> <p><b>Mono goes beta</b>,<br><i>O’Reilly Network</i> Edd Dumbill (May 5, 2004, <a href="http://www.onlamp.com/pub/wlg/4799">Link</a>) </p> <p><b>Mono Development Platform Moves into Beta</b>,<br><i>eWeek</i>, Matt Hicks (May 6, 2004, <a href="http://www.eweek.com/article2/0,1759,1586734,00.asp">Link</a>)</p> <p><b>Novell launches test of open-source project</b>,<br><i>CNET News.com</i>, Mike Ricciuti (May 6, 2004, <a href="http://news.com.com/2100-7344_3-5207192.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>InfoWorld</i>, Robert McMillan (May 6, 2004, <a href="http://www.infoworld.com/article/04/05/06/HNnovellmono_1.html">Link</a>)</p> <p><b>Novell launches test of open-source project</b>,<br><i>ZDNet</i>, Mike Ricciuti (May 6, 2004, <a href="http://zdnet.com.com/2100-1104_2-5207192.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>Computerworld</i>, Robert McMillan (May 6, 2004, <a href="http://www.computerworld.com/developmenttopics/development/story/0,10801,92971,00.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>Network World</i>, Robert McMillan (May 6, 2004, <a href="http://www.nwfusion.com/news/2004/0506novelrelea.html">Link</a>)</p> <p><b>Novell Releases Project Mono Beta</b>,<br><i>Linux Pipeline</i>, Mitch Wagner (May 6, 2004, <a href="http://www.linuxpipeline.com/showArticle.jhtml?articleID=20000052">Link</a>)</p> <p><b>Enterprise Unix Roundup — Red Hat's Desktop Epiphany</b>,<br><i>ServerWatch</i>, Michael Hall (May 6, 2004, <a href="http://www.serverwatch.com/news/article.php/10824_3350491_2">Link</a>)</p> <p><b>Novell Releases Project Mono Beta</b>,<br><i>CRN</i>, Mitch Wagner (May 7, 2004, <a href="http://www.crn.com/sections/BreakingNews/dailyarchives.asp?ArticleID=49983">Link</a>)</p> <p><b>Novell debuts open source toolkit for .NET</b>,<br><i>The Register</i>, John Leyden (May 7, 2004, <a href="http://www.theregister.co.uk/2004/05/07/mono/">Link</a>)</p> <p><b>Novell Targets .NET with Mono Beta</b>,<br><i>NewsFactor Network</i>, Jay Wrolstad (May 7, 2004, <a href="http://www.newsfactor.com/story.xhtml?story_title=Novell_Targets__NET_with_Mono_Beta&amp;story_id=23961&amp;category=hardware">Link</a>)</p> <p><b>.NET Goes Open Source and Catches Mono</b>,<br><i>internetnews.com</i>, Sean Michael Kerner (May 7, 2004, <a href="http://www.internetnews.com/dev-news/article.php/3351561">Link</a>)</p> <p><b>.Net developers can write for Linux using Mono</b>,<br><i>ZDNet UK</i>, Munir Kotadia (May 7, 2004, <a href="http://news.zdnet.co.uk/software/developer/0,39020387,39154054,00.htm">Link</a>)</p> <p><b>Mono Goes to Beta</b>,<br><i>LinuxWorld</i>, Maureen O’Gara (May 7, 2004, <a href="http://www.linuxworld.com/story/44739.htm">Link</a>)</p> <p><b>Mono betas the Open Source route to .Net</b>,<br><i>PC Pro</i>, Matt Whipp (May 7, 2004, <a href="http://www.pcpro.co.uk/?http://www.pcpro.co.uk/news/news_story.php?id=57267">Link</a>)</p> <p><b>Novell Debuts Mono Beta To Challenge .NET</b>,<br><i>LinuxInsider</i>, Gene J. Koprowski (May 7, 2004) <a href="http://www.linuxinsider.com/story/opensource/33696.html">Link</a>)</p> <p><b>Novell tests .Net on open source</b>,<br><i>ZDNet UK</i>, Mike Ricciuti (May 7, 2004, <a href="http://news.zdnet.co.uk/0,39020330,39153957,00.htm">Link</a>)</p> <p><b>Novell gives first glimpse of giant killer</b>,<br><i>Techworld</i>, Robert McMillan (May 7, 2004, <a href="http://www.techworld.com/opsys/news/index.cfm?NewsID=1513&amp;Page=1&amp;pagePos=4">Link</a>)</p> <p><b>Open Source .NET Reaches Beta</b>,<br><i>Computer Business Review</i> (May 7, 2004, <a href="http://www.cbronline.com/currentnews/60cd600cf1c4e6d680256e8d0032e284">Link</a>)</p> <p><b>Novell's Mono Closes Linux Gap</b>,<br><i>Enterprise Linux I.T.</i>, Jay Wrolstad (May 7, 2004, <a href="http://enterprise-linux-it.newsfactor.com/story.xhtml?story_title=Novell-s-Mono-Closes-Linux-Gap&amp;story_id=23972">Link</a>)</p> <p><b>Novell's Mono Closes Linux Gap</b>,<br><i>Enterprise Windows I.T.</i>, Jay Wrolstad (May 7, 2004, <a href="http://enterprise-windows-it.newsfactor.com/story.xhtml?story_title=Novell_s_Mono_Closes_Linux_Gap&amp;story_id=23972&amp;category=dotnet">Link</a>)</p> <p><b>For the record 7 May</b>,<br><i>ElectricNews.net</i>, Matthew Clark (May 7, 2004, <a href="http://www.enn.ie/news.html?code=9411166">Link</a>)</p> <p><b>Novell releases Project Mono beta</b>,<br><i>IT News Australia</i>, Mitch Wagner (May 7, 2004, <a href="http://www.itnews.com.au/ibmstorycontent.asp?ID=10&amp;Art_ID=19502">Link</a>)</p> <p><b>Novell releases open source platform for .Net</b>,<br><i>The Inquirer</i> (May 7, 2004, <a href="http://www.theinquirer.net/?article=15763">Link</a>)</p> <p><b>Final Mono version by June-end</b>,<br><i>The Age</i> (May 7, 2004, <a href="http://www.theage.com.au/articles/2004/05/07/1083881478476.html">Link</a>)</p> <p><b>Novell launches test of open-source project</b>,<br><i>CNETAsia</i>, Mike Ricciuti (May 7, 2004, <a href="http://asia.cnet.com/newstech/applications/0,39001094,39178338,00.htm">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>PC World Australia</i>, Robert McMillan (May 7, 2004, <a href="http://www.pcworld.idg.com.au/index.php/id;2103806279;fp;2;fpid;1">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>Computerworld Australia</i>, Robert McMillan (May 7, 2004, <a href="http://www.computerworld.com.au/index.php/id;2103806279;fp;16;fpid;0">Link</a>)</p> <p><b>Novell's Mono Closes Linux Gap</b>,<br><i>CIO Today</i>, Jay Wrolstad (May 7, 2004, <a href="http://cio-today.newsfactor.com/story.xhtml?story_title=Novell_s_Mono_Closes_Linux_Gap&amp;story_id=23972">Link</a>)</p> <p><b>Final Mono version by June-end</b>,<br><i>Sydney Morning Herald</i> (May 7, 2004, <a href="http://www.smh.com.au/articles/2004/05/07/1083881478476.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>LinuxWorld Australia</i>, Robert McMillan (May 7, 2004, <a href="http://www.linuxworld.com.au/index.php/id;2103806279;fp;2;fpid;1">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>IDG Singapore</i>, Robert McMillan (May 7, 2004, <a href="http://www.idg.com.sg/idgwww.nsf/0/FF7C3882D9F923D248256E8D002C1C85?OpenDocument">Link</a>)</p> <p><b>Novell brings .net to open source with first Mono beta</b>,<br><i>ComputerWeekly.com</i>, Robert McMillan (May 10, 2004, <a href="http://www.computerweekly.com/articles/article.asp?liArticleID=130385&amp;liArticleTypeID=1&amp;liCategoryID=1&amp;liChannelID=171&amp;liFlavourID=1&amp;sSearch=&amp;nPage=1">Link</a>)</p> <p><b>Novell brings .net to open source with first Mono beta</b>,<br><i>MicroScope</i>, Robert McMillan (May 10, 2004, <a href="http://www.microscope.co.uk/articles/article.asp?liArticleID=130385&amp;liArticleTypeID=20&amp;liCategoryID=1&amp;liChannelID=171&amp;liFlavourID=2&amp;sSearch=&amp;nPage=1">Link</a>)</p> <p><b>Spreading Mono</b>,<br><i>Developer Pipeline</i>, Matt McKenzie (May 11, 2004, <a href="http://www.developerpipeline.com/showArticle.jhtml;jsessionid=03TBR0R5TZBUMQSNDBNCKHQ?articleId=20300292">Link</a>)</p> <p><b>Developers catching Mono beta release</b>,<br><i>SearchEnterpriseLinux.com</i>, Michael S. Mimoso (May 11, 2004, <a href="http://searchenterpriselinux.techtarget.com/originalContent/0,289142,sid39_gci963407,00.html">Link</a>)</p> <p><b>Mono Brings .NET to Open Systems</b>,<br><i>ENT News</i>, Stephen Swoyer (May 11, 2004, <a href="http://www.entmag.com/news/article.asp?EditorialsID=6231">Link</a>)</p> <p><b>Spreading Mono</b>,<br><i>Linux Pipeline</i>, Matt McKenzie (May 11, 2004, <a href="http://www.linuxpipeline.com/showArticle.jhtml?articleID=20300445">Link</a>)</p> <p><b>Developers catching Mono beta release</b>,<br><i>SearchWebServices.com</i>, Michael S. Mimoso (May 11, 2004, <a href="http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_gci963386,00.html">Link</a>)</p> <p><b>Mono Project Brings Microsoft’s Insular .NET Technologies to Open Systems</b>,<br><i>Enterprise Systems</i>, Stephen Swoyer (May 11, 2004, <a href="http://www.esj.com/enterprise/article.asp?EditorialsID=962">Link</a>)</p> <p><b>Utah business in brief</b>,<br><i>Salt Lake Tribune</i> (May 13, 2004, <a href="http://www.sltrib.com/2004/May/05132004/business/165937.asp">Link</a>)</p> </div> \ No newline at end of file
diff --git a/mcs/MonoIcon.png b/web/MonoIcon.png
index c670edb5011..c670edb5011 100644
--- a/mcs/MonoIcon.png
+++ b/web/MonoIcon.png
Binary files differ
diff --git a/web/README b/web/README
index 333d133943f..f10cd5d88de 100644
--- a/web/README
+++ b/web/README
@@ -15,3 +15,40 @@ To publish changes:
cd web
make push
+
+################ Requirements
+
+You must have complete and working "mono" and "mcs" checkouts from
+CVS. You will probably need to bootstrap your Mono installation,
+although an existing install from RPMs may permit you to build the CVS
+versions more easily.
+
+############## Samples
+
+
+ If you want to add a new item in the left menu
+ you have to edit mono/doc/web/commands and add
+ the entry there.
+
+ For new files you can add something as:
+ level,entry,path_to_the_file,file.src
+
+ ex: 1,COBOL#,cobol.html,cobol.src
+
+ If you just want to add a link to the menu:
+ 1,MyEntry,URL
+
+ ex: 1,About Linux,http://www.linux.org
+
+ To test the results under Linux:
+ 1. Edit mono/doc/web/makefile
+
+ Delete all the references to class status
+ and the deploy/index.rss as well as the
+ mono.exe commands.
+
+ 2. make
+ 3. Open your browser and point to the
+ file:///(YOUR PATH HERE)mono/doc/web/deploy/index.html
+
+
diff --git a/web/ado-net b/web/ado-net
index 8fe648e1da3..0095d79ef79 100644
--- a/web/ado-net
+++ b/web/ado-net
@@ -1,796 +1,198 @@
* ADO.NET
- The coordinator for the ADO.NET implementation is <a
- href="mailto:rodrigo@ximian.com">Rodrigo Moya</a>, with
- the collaboration of <a href="mailto:danmorg@sc.rr.com">Daniel
- Morgan</a> and <a href="mailto:tim@timcoleman.com">Tim Coleman</a>.
-
-
-* Action plan
-
- The current plan to implement ADO.NET is as follows:
-
- <b>Step 1:</b> Initial <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatasqlclient.asp?frame=true">System.Data.SqlClient</a> Provider:
-
- <ul>
- * Initial implementation of System.Data.SqlClient is based on
- the <a href="http://www.postgresql.org/idocs/">PostgreSQL C API</a> which is a
- client API to the PostgreSQL DBMS. PostgreSQL was chosen so we could quickly
- create and test the System.Data classes.
-
- * Once the <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatasqlclient.asp?frame=true">System.Data.SqlClient</a>
- code is functional and is usable by other people, we willl move it to
- Mono.Data.PostgreSQL, and will convert the existing
- System.Data.SqlClient to be just a wrapper around
- Mono.Data.PostgreSQL.
-
- </ul>
-
- <b>Step 2:</b> <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataOleDb.asp?frame=true">System.Data.OleDb</a> Provider:
-
- <ul>
- * <p>On Unix systems: System.Data.OleDb will use the
- <a href="http://www.gnome-db.org/">LibGDA</a>
- engine.
-
- <p>LibGDA is a data access engine like ADO/OLE-DB, but for Unix. The
- GDA in libGDA stands for GNU/GNOME Data Access, but it does not require GNOME.
- It only requires glib2 and libxml2. LibGDA is used by
- libgnomedb, GNOME-DB, and gaSQL.
-
- <p>There is work under way to get libgda working under
- Windows using Cygwin by the GNOME-DB developers.
-
- <p>LibGDA has providers for MySQL, PostgreSQL, XML, ODBC,
- and MDB Tools (MS Access support).
-
- * On Windows systems: System.Data.OleDb will use OLE-DB as
- its engine. It may have the option of using libgda too.
- </ul>
-
- <b>Step 3:</b> <a href="http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatasqlclient.asp?frame=true">System.Data.SqlClient</a> Provider:
+** Data Access in Mono
- <ul>
- * <p>System.Data.SqlClient will then become a managed
- provider for Microsoft SQL Server, both on Windows and
- Linux, to be compatible with applications written
- for the Microsoft .NET Development Framework.
-
- <p>Once Step 1 has been completed and the PostgreSQL
- provider support has been moved to its own place at
- System.Data.PostgreSQL, we will use
- <a href="http://www.freetds.org/">FreeTDS</a> as the basis
- for providing access to Microsoft SQL Server databases.
-
- <P>FreeTDS is a C API for Unix and Windows that implements
- the TDS (Tabular Data Stream) protocol used in accessing
- Microsoft SQL Server and Sybase databases. A .NET Data Provider could be
- created for Sybase databases as well, but this would be put in Mono.Data.Sybase.
- </ul>
-
- <b>Step 4:</b> <a href="http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/668/msdncompositedoc.xml&frame=true">System.Data.Odbc</a> Provider:
+<ul>
+ <li>Today, our goal is to be compatible with .NET 1.1 and .NET 1.0. We also would like
+ to extend data access beyond what is included with .NET 1.0 and .NET 1.1,
+ such as, include access to more databases, such as, PostgreSQL and MySQL,
+ but also provide classes that help in creating data source-agnostic code, such as,
+ Mono.Data.ProviderFactory.</li>
+
+ <li>In the future, we would like to be compatible with .NET 1.2. This includes features
+ like <a href="http://longhorn.msdn.microsoft.com/lhsdk/ndp/daconworkingwithobjectspacesarchitecture.aspx">ObjectSpaces</a></li>
- <ul>
- * We will create a .NET Managaed Provider for ODBC
- in System.Data.Odbc for those using ODBC.
- On Unix and Windows, <a href="http://www.unixodbc.org/">unixODBC</a> mabye used.
- iODBC is an alternative to using unixODBC.
-
- <p>unixODBC works on Unix and Windows. Well, I have not actually
- used it on Cygwin, but it does build and install without problems.
-
- <p>unixODBC has providers for:
- Oracle, Microsoft SQL Server and Sybase via FreeTDS,
- MySQL, PostgreSQL, Informix, IBM DB2 (Universal Database),
- Interbase, miniSQL (mSQL), AdabasD, Empress, YARD SQL, and others.
-
- </ul>
+</ul>
- <b>Step 5:</b> Other System.Data providers:
+** Bugs and Feature Requests
- <ul>
- * <p>The idea in Microsoft .NET System.Data is to have
- a managed provider for each supported DBMS. System.Data.SqlClient
- for Microsoft SQL Server.
- System.Data.OracleClient for Oracle 8i and 9i.
+<ul>
- <p>We will need to have Mono.Data.MySQL, Mono.Data.PostgreSQL,
- Mono.Data.DB2, and Mono.Data.miniSQL. Others,
- of course, are welcomed.
-
- <p>System.Data has been designed so
- non-database providers can be created too.
- </ul>
+ <li>Bugs with Mono or any data provider in Mono should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have a Bugzilla user account, it is free
+ and easy to create
+ one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
-* Current Status
+ <li>Any requests for new features or missing functionality
+ can entered as a bug in Bugzilla too</li>
- <p>We are working on Steps 1, 2, and 5. We have only just begun on
- steps 2 and 5 though. We still have tons and tons of stuff to do.
- If you have any ideas, let us know.
-
- <p>For Step 1, the PostgreSQL is starting to come together - it
- still needs a lot of work.
+</ul>
- <p>For Step 2, Rodrigo Moya has begun System.Data.OleDb which will use libgda
- which is an OLE-DB/ADO data access for Unix. The C-Sharp bindings to libgda
- currently work - meaning they can compile, run, and you can connect to a
- PostgreSQL database via libgda via the C-Sharp bindings to libgda. He has also
- added class stubs for System.Data.OleDb to cvs.
+** ADO.NET Data Providers
- <p>For Step 3, we need someone to start the FreeTDS .NET Data Provider so
- we can have data access to Microsoft SQL Server and Sybase databases, or either
- add the support in libgda.
-
- <p>For Step 4, we need someone to start the unixODBC .NET Data Provider, or add
- the support in libgda.
-
- <p>For Step 5, we have just begun creating a Mono.Data .NET Provider - a MySQL
- .NET Provider that uses the MySQL C Client Library. This provider is
- found in Mono.Data.MySql. We can currently connect and do a SQL INSERT and insert
- a row into a MySQL database. However, it currently only works on Cygwin because
- the MySQL client library libmySQL.dll is different
- from the library on Linux libmysqlclient.dll. Another problem, mysql thread functions
- do not load for some reason. Also, the provider only runs if you use "mint" (the Mono
- runtime interpreter). It does not work on "mono" (the Mono Just-In-Time compiler).
- The C# Bindings to MySQL are thanks to Brad Meril.
-
- <p>We are able to do simple CREATE TABLE, DROP TABLE, UPDATE, INSERT, and
- DELETE SQL commands using the ExecuteNonQuery method in SqlCommand.
-
- <p>We can execute multiple queries and do a NextResult() in SqlDataReader()
- to get the next result set.
-
- <p>We are also able to do simple aggregate functions,
- ie, count(), sum(), min(), and max()
- in a simple SELECT SQL query using the ExecuteScalar() now.
-
- <p>We are also able to retrieve data with a simple SELECT SQL query
- using ExecuteReader() which returns a SqlDataReader. We are able to
- use GetSchemaTable() to get the meta data about the table columns.
- We are able to Read() to get each row from the result set.
-
- <p>Here is a sample of code that is based on PostgresTest.cs and
- TestSqlDataReader.cs tests:
-<pre>
-
- static void SelectData (IDbConnection cnc) {
-
- IDbCommand selectCommand = cnc.CreateCommand();
- IDataReader reader;
-
- selectCommand.CommandType = CommandType.Text;
- selectCommand.CommandText =
- "select * from pg_user;" +
- "select * from pg_tables;" +
- "select * from pg_database";
-
- reader = selectCommand.ExecuteReader ();
-
- do {
- // get the DataTable that holds
- // the schema
- DataTable dt = rdr.GetSchemaTable();
-
- if(rdr.RecordsAffected != -1) {
- // Results for
- // SQL INSERT, UPDATE, DELETE Commands
- // have RecordsAffected >= 0
- Console.WriteLine("Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- }
- else if (dt == null)
- Console.WriteLine("Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: " + rdr.RecordsAffected);
- else {
- // Results for
- // SQL not INSERT, UPDATE, nor DELETE
- // have RecordsAffected = -1
- Console.WriteLine("Result is from a SQL SELECT Query. Records Affected: " + rdr.RecordsAffected);
-
- // Results for a SQL Command (CREATE TABLE, SET, etc)
- // will have a null reference returned from GetSchemaTable()
- //
- // Results for a SQL SELECT Query
- // will have a DataTable returned from GetSchemaTable()
-
- results++;
- Console.WriteLine("Result Set " + results + "...");
-
- // number of columns in the table
- Console.WriteLine(" Total Columns: " +
- dt.Columns.Count);
-
- // display the schema
- foreach (DataRow schemaRow in dt.Rows) {
- foreach (DataColumn schemaCol in dt.Columns)
- Console.WriteLine(schemaCol.ColumnName +
- " = " +
- schemaRow[schemaCol]);
- Console.WriteLine();
- }
-
- int nRows = 0;
- string output, metadataValue, dataValue;
- // Read and display the rows
- Console.WriteLine("Gonna do a Read() now...");
- while(rdr.Read()) {
- Console.WriteLine(" Row " + nRows + ": ");
-
- for(c = 0; c < rdr.FieldCount; c++) {
- // column meta data
- DataRow dr = dt.Rows[c];
- metadataValue =
- " Col " +
- c + ": " +
- dr["ColumnName"];
-
- // column data
- if(rdr.IsDBNull(c) == true)
- dataValue = " is NULL";
- else
- dataValue =
- ": " +
- rdr.GetValue(c);
-
- // display column meta data and data
- output = metadataValue + dataValue;
- Console.WriteLine(output);
- }
- nRows++;
- }
- Console.WriteLine(" Total Rows: " +
- nRows);
- }
- } while(rdr.NextResult());
- Console.WriteLine("Total Result sets: " + results);
-
- rdr.Close();
- }
-
-</pre>
-
- <p>We are able to get
- String data (char, character, text, varchar), Int16 (smallint),
- Int32 (integer), Int64 (bigint), DateTime (time, date, timestamp),
- Boolean (boolean), Single (float), and Double (double).
- More data types will come later. Note, the types that do work still
- need thorough testing.
-
- <p>Rows that are returned which contain columns that are NULL are handled now.
- The SqlDataReader method IsDBNull() needs to be called to determine
- if a field IS NULL before trying to read data from that field.
-
- <p>Calling PostgreSQL stored procedures works. It does not work perfectly. It may not
- even work to specification - yet. If you want to test it yourself, look at
- TestSqlDataReader.cs or PostgresTest.cs in
- mcs/class/System.Data/Test.
-
- <p>Below, I have some sample code you can
- use to call a PostgreSQL stored procedure named "version". This stored
- procedure returns a string containing the PostgreSQL server version. Notice
- the CommandType is StoredProcedure and the method ExecuteScalar() is called.
-
- <p>ExecuteScalar() is a lightweight method in class SqlCommand that only returns
- one row and one column as one object - even if there is more than row or column.
-
-<pre>
- static string GetDatabaseServerVersion (SqlConnection cnc)
- {
- SqlCommand cmd = cnc.CreateCommand ();
- string data;
-
- cmd.CommandType = CommandType.StoredProcedure;
- cmd.CommandText = "version";
-
- data = (string) cmd.ExecuteScalar ();
-
- return data;
- }
-</pre>
-
- <p>We have the beginnings of Parameters support PostgreSQL. Only
- Input Parameters are currently supported. Output, Input/Output,
- and Return parameters still need to be done.
-
- <p>A lot of functionality in System.Data is missing, but the
- infrastructure is starting to come together.
-
- <p>A lot of Exceptions need to be thrown for various exceptions. However,
- SqlException, SqlErrorCollection, and SqlError have been partially
- implemented.
-
- <p>Tim Coleman and Rodrigo Moya got the beginnings of the
- SqlDataAdapter/DataSet/DataTable/DataRow to work. Currently,
- the SqlDataAdapter can Fill() relational data into a DataTable in a DataSet.
- See the test mcs/class/System.Data/Test/TestSqlDataAdapter.cs to see it in action.
- Below, I show a snippets from the test:
-
-<pre>
- string connectionString;
- string sqlQuery;
- SqlDataAdapter adapter;
- DataSet dataSet = null;
-
- connectionString =
- "host=localhost;" +
- "dbname=test;" +
- "user=postgres";
-
- sqlQuery = "select * from pg_tables";
-
- adapter = new SqlDataAdapter (sqlQuery,
- connectionString);
-
- dataSet = new DataSet ();
-
- adapter.Fill (dataSet);
+<p>Mono has many ADO.NET Data Providers to get you connected:
- if (dataSet != null) {
- foreach (DataRow row in dataSet.Tables["Table"].Rows)
- Console.WriteLine("tablename: " + row["tablename"]);
- }
-</pre>
-
- <p>We do need help on the DataSet/DataAdaptor/DataTable/DataRelation/XML
- functionality so we can integrate with
- the ASP.NET controls and Windows.Forms controls by allowing the controls to bind
- to a data source. Gonzalo, Gaurav, Leen, Patrik, Duncan, and others are
- working very hard on the ASP.NET support. If you want to help,
- contact <a href="mailto:gonzalo@ximian.com">Gonzalo Paniagua Javier</a>
-
- <P>Need to add XML support in System.Data. This involves working on
- the classes: DataSet and XmlDataDocument and the ExecuteXmlReader() in SqlCommand.
-
- <p>The System.Data.dll gets built with the rest of the class library.
- To compile the System.Data.dll assembly separately, you need:
-
- <b>On Unix</b>
-
+<ul>
+ <li><a href="http://www.go-mono.com/ibmdb2.html">IBM DB2 Universal Database</a></li>
+ <li><a href="http://www.go-mono.com/mysql.html">MySQL</a></li>
+ <li><a href="http://www.go-mono.com/odbc.html">ODBC</a></li>
+ <li><a href="http://www.go-mono.com/oracle.html">Oracle</a></li>
+ <li><a href="http://www.go-mono.com/oledb.html">OLE DB</a></li>
+ <li><a href="http://www.go-mono.com/postgresql.html">PostgreSQL</a></li>
+ <li><a href="http://www.go-mono.com/sqlclient.html">Microsoft SQL Server</a></li>
+ <li><a href="http://www.go-mono.com/sqlite.html">SQL Lite</a></li>
+ <li><a href="http://www.go-mono.com/sybase.html">Sybase</a></li>
+ <li><a href="http://www.go-mono.com/tdsclient.html">Older Microsoft SQL Server and Sybase databases</a></li>
+</ul>
+
+<p>External Projects that have created ADO.NET Providers that work on Mono:
+
+<ul>
+
+ <li><a href="http://www.go-mono.com/firebird.html">Firebird Interbase</a></li> is a
+ Firebird SQL Managed data provider. It can be used with Interbase databases too. It
+ is written in 100%C# and does not require a client library. Works on .NET and Mono.</a>
+ <li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a> is a
+ PostgreSQL Managed data provider written
+ in 100% C#, does not require a client library, and works on .NET and Mono</li>
+ <li><a href="http://sourceforge.net/projects/mysqlnet/">MySQLNet</a> is a
+ MySQL Managed data provider written in 100% C#, does not
+ require a client library, and works on .NET and Mono</li>
+</ul>
+
+** Tools
+
+<p>Some tools that can be used for ADO.NET and other technologies (ASP.NET, XML, etc).
+
+<ul>
+ <li>sqlsharp.exe
+ <ul>
+ <li>SQL# is a command line query tool included with Mono to enter and execute SQL statements</li>
+ </ul>
+ </li>
+ <li>xsd.exe
+ <ul>
+ <li>XML Schema Definition tool</li>
+ <ul>
+ <li><b>XDR to XSD</b> - used to generate an XML schema from an XDR (XML Data Reduced schema) file.
+ XDR was used by Microsoft prior to XSD becoming a W3C recommendation. So, this needs
+ to be supported for legacy reasons</li>
+ <li><b>XML to XSD</b> - used to generate an XML schema from an XML file</li>
+ <li><b>XSD to DataSet</b> - used to generate DataSet classes from an XSD schema file. The
+ DataSet classes created can then be used with XML data</li>
+ <li><b>XSD to Classes</b> - used to generate classes from an XSD schema file. The
+ classes created can be used with System.XML.Serialization.XMLSerializer
+ to read and write XML code that follows the schema</li>
+ <li><b>Classes to XSD</b> - used to generate an XML schema
+ from type(s) in a assembly file. The
+ XML schema created by the tool defines the XML format used
+ by System.XML.Serialization.XMLSerializer</li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+</ul>
+
+** Extra Classes in Mono ADO.NET
+
+ <p>An ADO.NET <a href="http://www.go-mono.com/provider-factory.html">Provider Factory</a>
+ was created by Brian Ritchie. The
+ Provider Factory is a way to dynamically create
+ connections, commands, parameters, and data adapters based on configuration
+ information.
+
+** Database Access from ASP.NET
<ul>
- * update your mono sources. Be sure you have latest mcs.exe
- and .dll's, since there have been many fixes needed for
- compilation on Linux.
-
- * compile System.Data.dll:
-<pre>
- cd mcs/class/System.Data<br>
- mcs --target library -o System.Data.dll @list
-</pre>
+ <li>Take a look at xsp in cvs and look at the examples in test: dbpage1.aspx
+ and dbpage2.aspx:
+ <ul>
+ <li>Notice that the namespace System.Data is imported via <b>import</b></li>
+ <li>A NameValueCollection is gotten using ConfigurationSettings.AppSetings. These
+ settings are gotten from the file server.exe.config which is a XML file. The XML
+ file has a section appSettings. In the appSettings section, you have keys
+ for DBProviderAssembly, DBConnectionType, and DBConnectionString.
+ <ul>
+ <li><b>DBProviderAssembly</b> is the assembly of the ADO.NET provider.
+ For example:
+ "ByteFX.Data"</li>
+ <li><b>DBConnectionType</b> is the System.Type of the class that
+ implements System.Data.IDbConnection that is found
+ in the DBProviderAssembly.
+ For example:
+ "ByteFX.Data.MySqlConnection"</li>
+ <li><b>DBConnectionString</b> is the ConnectionString to set to the
+ IDbConnection object to use in opening a connection to a data source.
+ For Example:
+ "hostaddr=127.0.0.1;user=monotest;password=monotest;dbname=monotest"</li>
+ </ul>
+ <li>The function GetConnectionData() gets the database provider assembly, connection type,
+ and connection string parameters if they exist; otherwise, it uses default values. This is
+ done during the loading of the web page.</li>
+ <li>With the connection parameters, the assembly is loaded, the connection type is verified that
+ it implements IDbConnection and an instance of the class can be created, creates a instance
+ of the class, sets the connection string, and opens the connection.</li>
+ </ul>
+ </li>
</ul>
- <b>On Windows</b>
-
- <ul>
- * update your mono sources. Be sure you have latest mcs.exe
- and .dll's. You can use the same method as Linux,
- or you can use NAnt.
-
- * To use NAnt:
-
-<pre>
- cd mcs/class/System.Data
- ../../nant/NAnt.exe
-</pre>
+** Testing
+
+<ul>
+ <li>Testing connection-oriented classes are done
+ via the provider specific tests
+ found in the mcs source at mcs/class</br>
+ <table border=1>
+ <tr>
+ <td><b>Name</b></td>
+ <td><b>Assembly /</br> Namespace</b></td>
+ <td><b>Test</b></td>
+ </tr>
- This will automatically copy the System.Data.dll to Test.
- If you need to do a clean for the System.Data.dll assembly,<br><br>
-
-<pre>
- cd mcs/class/System.Data
- ../../nant/NAnt.exe clean
-</pre>
- </ul>
-
-* Testing
-
- <p>In order to test System.Data.SqlClient, you will need to have
- access to a remote PostgreSQL DBMS, or you will have to install
- one locally. PostgreSQL is the DBMS used for the initial
- implementation of System.Data.SqlClient.
-
- <p>Why? Because it is open source, has a client
- library that is easy to use, PostgreSQL is easy to install on
- Unix and Windows (using the Cygwin install program), not difficult to setup after
- installation, and it runs under: Linux,
- Windows (via cygwin and ipc-daemon), Unix, and
- others. This allowed us to create the
- System.Data functionality in Mono much quicker.
-
- <p>If you plan on using a remote PostgreSQL DBMS Server,
- than you will need to have the PostgreSQL client software on your
- local computer that includes libpq.so (pq.dll on Windows).
-
- <p>The System.Data tests use this connection string to connect
- to the PostgreSQL database named "test" at host "localhost" as
- user "postgres".
-
-<pre>
-"host=localhost;dbname=test;user=postgres"
-</pre>
-
- <p>Installation instructions for PostgreSQL DBMS:
-
- <b>On Unix</b>
-
- <ul>
- * Read the PostgreSQL Installation Instructions
- at \usr\doc\postgresql-x.x.x\html\installation.html
-
- * Depending on your Unix system,
- PostgreSQL maybe already installed, a database user 'postgres' created,
- a linux user 'postgres' created and initdb ran. Or maybe not.
-
-<pre>
- su
- adduser postgres
- mkdir /usr/local/pgsql/data
- chown postgres /usr/local/pgsql/data
- su - postgres
- initdb -D /usr/local/pgsql/data
- postmaster -i -D /usr/local/pgsql/data
- createdb test
- psql test
-</pre>
-
- * Make sure you have a database user named postgres. It is best to install
- the PostgreSQL DBMS under linux user postgres. When you run the postmaster,
- run it under the user postgres as well. If this was not done, then you
- will need to create a user named postgres for the System.Data tests.
-
- * If you already installed PostgeSQL and you do not have a database
- user named postgres, then you can create user postgres using psql:
-
-<pre>
-psql test
-create user postgres with password 'fun2db';
-</pre>
-
- * The postmaster must be run with -i option.
-
- * In the /usr/local/pgsql/data/pg_hba.conf file, you need
- to have the AUTH_TYPE set to md5. You can read more on this at
- /usr/doc/postgresql-7.2.1/html/client-authentication.html
- or wherever your
- PostgreSQL html docs are located. See the 2nd line below,
- host 127.0.0.1 has an AUTH_TYPE md5 in pg_hba.conf.
-
-<pre>
- # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE
-
- local all trust
- host all 127.0.0.1 255.255.255.255 md5
-</pre>
-
- * If you can not find your PostgreSQL documentation locally or you
- did not install it, then you
- can get it <a href="http://www.postgresql.org/idocs/">here</a>.
-
- </ul>
-
- <b>On Windows</b>
-
- <ul>
- * Use the <a href="http://www.cygwin.com/">Cygwin</a> installer to
- install the PostgreSQL DBMS. It is
- found in the database category.
-
- * <p>Read the file postgres-x.x.README at /usr/doc/Cygwin and read
- the requirements to install PostgreSQL. Those requirements
- are included with cygwin except cygipc. A default installtion
- of cygwin does not install everything you will need, so on the
- safe side, just include everything when installing cygwin.
-
- * <p>The -x.x in postgres-x.x is the version of your PostgreSQL DBMS.
-
- * <p>Once Cygwin has installed the PostgreSQL DBMS on your computer,
- read the file FAQ_MSWIN which is available
- in /usr/doc/postgres-x.x
-
- * <p>Important notes from this file are:
-
- <ul>
- <p><b>2.</b> - Install the latest <a href="http://www.neuro.gatech.edu/users/cwilson/cygutils/OBSOLETE/V1.1/cygipc/index.html">CygIPC</a> package.
-
- <p>The cygipc package contains the ipc-daemon you will need
- to run before you can
- run the PostgreSQL DBMS Server daemon (postmaster) or run
- initdb which initializes the PostgreSQL database.
-
- <p><b>3.</b> The Cygwin bin directory has to be placed in
- the path before the Windows program directories,
- for example, C:\cygwin\bin
-
- <p><b>My own note.</b> In the Windows control panel, I set
- the environment variables PATH to my cygwin /usr/local/bin,
- /usr/bin, and /bin. I also set my LD_LIBRARY_PATH to
- /usr/local/lib and /usr/lib. For example:
-
- <p>
-<pre>
-PATH=c:\cygwin\usr\local\bin;c:\cygwin\usr\bin;c:\cygwin\bin;
-LD_LIBRARY_PATH=c:\cygwin\usr\local\lib;c:\cygwin\usr\lib;
-</pre>
-
- <p><b>4.</b> Start the ipc-daemon that came with the cygipc
- package. There
- are two ways to do this: run it from the command line as:
-
- <p>
-<pre>
-ipc-daemon &
-</pre>
- <p>or you can set it up as a Windows service. See the
- file cygrunsrv.README at /usr/doc/Cygwin on how to do this
- for ipc-daemon and postmaster. Note the
- troubleshooting section at the end of
- the cygrunsrv.README file.
-
- <p>To install ipc-daemon as a service,
- you just have to run
-
- <p>
-<pre>
-ipc-daemon --install-as-service' (--remove-as-service)
-</pre>
-
- <p>and then run
-
-<pre>
-net start ipc-daemon
-</pre>
- </ul>
-
- <p>Read the installation.html file
- at /usr/doc/postgresql-x.x/html/installation.html
+ <tr>
+ <td>Microsoft</br> SQL</br> Server</br></td>
+ <td>System.Data /</br> System.Data.SqlClient</td>
+ <td>SqlTest.cs at</br> System.Data/Test</td>
+ </tr>
+
+ <tr>
+ <td>PostgreSQL</br> (Npgsql)</td>
+ <td>Npgsql /</br> Npgsql</td>
+ <td>*.cs at</br> Npgsql/Test</td>
+ </tr>
+
+ <tr>
+ <td>Oracle</br> (Mono)</td>
+ <td>System.Data.OracleClient /</br> System.Data.OracleClient</td>
+ <td>TestOracleClient.cs at</br> System.Data.OracleClient/Test</td>
+ </tr>
+
+ <tr>
+ <td>ODBC</br> (Mono)</td>
+ <td>System.Data.Odbc /</br> System.Data</td>
+ <td>OdbcTest.cs (to connect to MS SQL Server)at</br> System.Data/Test</td>
+ </tr>
+
+ </table>
+
+
+ <li><a href="http://www.go-mono.com/testing.html">Testing non-connection classes</a> are
+ done via mono's modified version of NUnit.
+ <ul>
+ <li>To run all the NUnit tests for Mono, you need the mcs source. cd to the root
+ of the mcs source. To run it:
+ <ul>
+ <li>make test</li>
+ </ul>
+ </li>
+ <li>If you just want to run the NUnit tests for System.Data, you would cd into
+ the mcs source at class/System.Data/Test and run it:
+ <ul>
+ <li>make test</li>
+ </ul>
+ </li>
+ </ul>
+ </li>
- <p>You will see in this file that you will need to
- run the following commands:
-
- <p>
-<pre>
-mkdir /usr/local/pgsql/data
-initdb -D /usr/local/pgsql/data
-postmaster -D /usr/local/pgsql/data
-createdb test
-psql test
-</pre>
-
- <p>When you need to connect to the database,
- you will need ipc-daemon and postmaster running. Start ipc-daemon
- before any of the command above. If you restart your computer, you
- need to start ipc-daemon and postmaster either manually or as a
- service.
-
- <p>psql is a command-line PostgreSQL client tool to
- enter and run SQL commands and queries.
-
- <p>If there is no database user named postgres, create a user named
- postgres with the following SQL command in the client tool psql:
-
- <p>
-<pre>
-psql test
-create user postgres with password 'fun2db';
-</pre>
- <p>The only reason I say this is so you can easily use the System.Data tests
- without having to change the database, userid, etc.
- </ul>
-
- <p>In the path mcs/class/System.Data/Test
- there is a PostgreSQL test program named
- PostgreTest.cs. Thanks goes to Gonzalo for creating the original
- PostgreSQL test.
-
- <p>To use it to test System.Data, you
- modify the file to your PostgreSQL database
- connection requirements:
-
- <p>
- <ul>
- <li><b>dbname</b> database, ie., test</li>
- <li><b>host</b> hostname of the PostgreSQL DBMS Server to connect to, ie., localhost</li>
- <li><b>user</b> username, ie., someuser</li>
- <li><b>password</b> password, ie., mypass1234</li>
- </ul>
-
- <p>The connection string is in OLE-DB connection string format. Internally,
- SqlConnection converts this to the PostgreSQL connection string format.
-
- <p>
-<pre>
- OLE-DB: "host=localhost;dbname=test;user=joe;password=smoe"
-PostgreSQL: "host=localhost dbname=test user=joe password=smoe"
-</pre>
-
- <p>
- Note that OLE-DB includes the semicolons while PostgreSQL's connection
- string does not.
-
- <p>
- To compile the PostgresTest.cs program, do:
-
- <p>
-<pre>
-mcs PostgresTest.cs -r System.Data.dll
-</pre>
-
- <p>
- To run using mint, do:
-
- <p>
-<pre>
-mint PostgresTest.exe
-</pre>
-
- <p>
- To run using mono, do:
-<pre>
-mono PostgresTest.exe
-</pre>
-
- <p>Below, I show how the output from PostgresTest. I have omitted a lot
- of the meta data for the columns except two columns. The classes
- used were from System.Data.SqlClient and were used to connect to a
- PostgreSQL database and retrieve data.
+</ul>
-<p>
-<pre>
-
-danmorg@DANPC ~/mono/mcs/class/System.Data/Test
-$ mcs PostgresTest.cs -r System.Data.dll
-
-danmorg@DANPC ~/mono/mcs/class/System.Data/Test
-$ mono PostgresTest.exe
- Postgres provider specific tests...
-
- Drop table:
-Error (don't worry about this one)SqlError:PGRES_FATAL_ERROR ERROR: table "mono
-_postgres_test" does not exist
- <Stack Trace>
-
- Create table with all supported types:
-OK
- Insert values for all known types:
-OK
- Update values:
-OK
- Insert values for all known types:
-OK
-Aggregate: count(*)
-Agg Result: 2
-Aggregate: min(text_value)
-Agg Result: This is a text
-Aggregate: max(int4_value)
-Agg Result: 1048000
-Aggregate: sum(int4_value)
-Agg Result: 1048003
- Select values from the database:
-Result is from a SELECT SQL Query. Records Affected: -1
-Result Set 1...
- Total Columns: 28
-ColumnName = boolean_value
-ColumnOrdinal = 1
-ColumnSize = 1
-NumericPrecision = 0
-NumericScale = 0
-IsUnique = False
-IsKey =
-BaseCatalogName =
-BaseColumnName = boolean_value
-BaseSchemaName =
-BaseTableName =
-DataType = System.Boolean
-AllowDBNull = False
-ProviderType = 16
-IsAliased = False
-IsExpression = False
-IsIdentity = False
-IsAutoIncrement = False
-IsRowVersion = False
-IsHidden = False
-IsLong = False
-IsReadOnly = False
-
- ...
-
- ColumnName = null_timestamp_value
- ColumnOrdinal = 28
- ColumnSize = 8
- NumericPrecision = 0
- NumericScale = 0
- IsUnique = False
- IsKey =
- BaseCatalogName =
- BaseColumnName = null_timestamp_value
- BaseSchemaName =
- BaseTableName =
- DataType = System.DateTime
- AllowDBNull = False
- ProviderType = 1184
- IsAliased = False
- IsExpression = False
- IsIdentity = False
- IsAutoIncrement = False
- IsRowVersion = False
- IsHidden = False
- IsLong = False
- IsReadOnly = False
-
- Gonna do a Read() now...
- Row 0:
- Col 0: boolean_value: False
- Col 1: int2_value: 5
- Col 2: int4_value: 3
- Col 3: bigint_value: 9
- Col 4: float_value: 3.141590
- Col 5: double_value: 3.14159
- Col 6: numeric_value: 123456789012.345
- Col 7: char_value: Mono.Data!
- Col 8: varchar_value: It was not me!
- Col 9: text_value: We got data!
- Col 10: point_value: (1,0)
- Col 11: time_value: 01/01/1 21:13:14
- Col 12: date_value: 02/29/2000 00:00:00
- Col 13: timestamp_value: 02/29/2004 14:00:11
- Col 14: null_boolean_value is NULL
- Col 15: null_int2_value is NULL
- Col 16: null_int4_value is NULL
- Col 17: null_bigint_value is NULL
- Col 18: null_float_value is NULL
- Col 19: null_double_value is NULL
- Col 20: null_numeric_value is NULL
- Col 21: null_char_value is NULL
- Col 22: null_varchar_value is NULL
- Col 23: null_text_value is NULL
- Col 24: null_point_value is NULL
- Col 25: null_time_value is NULL
- Col 26: null_date_value is NULL
- Col 27: null_timestamp_value is NULL
- Row 1:
- Col 0: boolean_value: True
- Col 1: int2_value: -22
- Col 2: int4_value: 1048000
- Col 3: bigint_value: 123456789012345
- Col 4: float_value: 3.141590
- Col 5: double_value: 3.14159
- Col 6: numeric_value: 123456789012.345
- Col 7: char_value: This is a char
- Col 8: varchar_value: This is a varchar
- Col 9: text_value: This is a text
- Col 10: point_value: (1,0)
- Col 11: time_value: 01/01/1 21:13:14
- Col 12: date_value: 02/29/2000 00:00:00
- Col 13: timestamp_value: 02/29/2004 14:00:11
- Col 14: null_boolean_value is NULL
- Col 15: null_int2_value is NULL
- Col 16: null_int4_value is NULL
- Col 17: null_bigint_value is NULL
- Col 18: null_float_value is NULL
- Col 19: null_double_value is NULL
- Col 20: null_numeric_value is NULL
- Col 21: null_char_value is NULL
- Col 22: null_varchar_value is NULL
- Col 23: null_text_value is NULL
- Col 24: null_point_value is NULL
- Col 25: null_time_value is NULL
- Col 26: null_date_value is NULL
- Col 27: null_timestamp_value is NULL
- Total Rows Retrieved: 2
- Total Result sets: 1
- Call ExecuteReader with a SQL Command. (Not INSERT,UPDATE,DELETE
- ).
- Result is from a SQL Command not (INSERT,UPDATE,DELETE). Records Affected: -1
- Total Result sets: 0
- Call ExecuteReader with a SQL Command. (Is INSERT,UPDATE,DELETE)
- .
- Result is from a SQL Command (INSERT,UPDATE,DELETE). Records Affected: 1
- Total Result sets: 0
- Calling stored procedure version()
- Result: PostgreSQL 7.2.1 on i686-pc-cygwin, compiled by GCC 2.95.3-5
- Database Server Version: PostgreSQL 7.2.1 on i686-pc-cygwin, compiled by GCC 2.9
- 5.3-5
- Clean up...
- Drop table...
- OK
- RESULT: 0
-
-</pre>
-
diff --git a/web/anoncvs b/web/anoncvs
index ed70a4c0074..c52d510fc53 100644
--- a/web/anoncvs
+++ b/web/anoncvs
@@ -2,7 +2,7 @@
Anonymous access to the Mono is available currently from three
servers (anoncvs-spain-1.go-mono.com,
- anoncvs-spain-2.go-mono.com and anoncvs-us-1.go-mono.com).
+ anoncvs-spain-2.go-mono.com and us-anoncvs.go-mono.com).
You can also use `anoncvs.go-mono.com', and that will pick a
server automatically for you.
@@ -30,7 +30,7 @@
To update your sources every day, you use this command:
<pre>
- export CVSROOT=:pserver:anonymous@reypastor.hispalinux.es:/mono
+ export CVSROOT=:pserver:anonymous@anoncvs.go-mono.com:/mono
cvs -z3 update -dP mcs mono gtk-sharp
</pre>
@@ -43,10 +43,13 @@
Special thanks to Jesus Climent, Rodrigo Moya, Juantomás
García and Ismael Olea for making this happen.
+ Thanks to Matt Liotta of MontaraSoftware for hosting our
+ US-based AnonCVS server.
+
<a name="#mirror">
** Becoming an AnonCVS mirror
- To become an AnonCVS mirror, you currently need about 20
+ To become an AnonCVS mirror, you currently need about 40
megabytes of free disk space and bandwidth that you do not
mind sharing (you probably want enough to spare).
diff --git a/web/asp-net b/web/asp-net
index 258c9725be6..562c7e411f9 100755
--- a/web/asp-net
+++ b/web/asp-net
@@ -1,102 +1,79 @@
* ASP.NET
- The classes for running ASP.NET are being actively written.
- Gaurav, Leen and Patrik have been building the classes
- required to run ASP.NET web application as well as a small
- embeddable web server.
+ ASP.NET support is divided in two pieces:
+ <ul>
+ * Web Forms (Web Applications infrastructure).
- There are a couple of components to the puzzle:
+ * Web Services (the SOAP-based rpc system).
+ </ul>
- <ul>
- * .aspx page parser (converts .aspx to C# code).
+ Both are fully functional at this point.
- * System.Web.HttpRuntime support.
+ Publicly available applications such as <a
+ href="http://www.asp.net/Default.aspx?tabindex=5&tabid=42">
+ IBuySpy</a>, <a href="http://www.ngallery.org/">nGallery</a> and
+ many others are known to work.
+
+ Web Services stack is being used for commercial applications
+ such as <a
+ href="http://www.ximian.com/about_us/press_center/press_releases/index.html?pr=sourcegear">
+ SourceGear</a>'s <a
+ href="http://www.sourcegear.com/vault/index.asp">Vault</a>. They
+ even funded the development of our Web Services classes back in
+ 2002. Another example is OpenLink's
+ <a href="http://www.openlinksw.com/virtuoso/">Virtuoso</a>. People
+ from OpenLink also contributed to Mono.
- * Web controls (System.Web.UI.HtmlControls and
- System.Web.UI.WebControls).
-
- * Underlying infrastructure for the controls (System.Web.UI).
-
- * HttpRuntime.ProcessRequest is the core of the ASP.NET
- implementation.
- </ul>
+* Hosting ASP.NET
- Gonzalo has been working on an ASP.NET parser that takes .aspx
- files and generated the code required to run them (the code lives in
- module `xsp' along with a little web server for testing).
+ Using ASP.NET System.Web.Hosting namespace classes you can make
+ your own ASP.NET enabled server.
- Most of the runtime support was mostly written by Patrik Torstensson
- (now at Intel). This was interesting, because in order to implement
- some of its features, Patrik had to go into the runtime/JIT engine and
- he spent a few weeks doing work there.
-
- Duncan got our System.Web assembly to compile.
-
-** HttpRuntime
+ However, if you want to take the easy path, we provide two
+ different mechanisms for hosting ASP.NET applications:
+ <ul>
+ * <a href="#xsp">XSP</a>: A light-weight web server
+ written in C#.
- Patrik has authored most of the HttpRuntime support (both on
- the System.Web and on the foundation) but it is still not
- ready to run.
+ * <a href="#mod_mono">mod_mono</a>: An <a
+ href="http://httpd.apache.org">Apache</a> module that
+ works with both 1.3 and 2.0 versions.
+ </ul>
+<a name="xsp">
** XSP
- Currently XSP provides the .aspx compiler to C#. It would be
- interesting to see if it makes sense to extend the ASP.NET
- syntax to make it simpler to develop applications.
-
- Gonzalo is in charge of the compiler.
-
-** Controls
-
- A lot of work has been put in the various classes that
- implement the controls (UI.HtmlControls and UI.WebControls),
- but they have been coded mostly in the dark, and without being
- able to test them in real life: Gaurav and Leen worked very
- hard on this namespace, but needs to be finished.
-
- We can now render all HtmlControls and some WebControls. Work is
- ongoing to make all WebControls render HTML.
-
-** Extending ASP.NET
-
- Currently you have to reference in your ASP.NET the control
- and all of its properties, which works fine if you have a GUI
- designer, but is harder for people used to develop using text
- editors.
-
- Since we have a parser, we could extend this parser to allow
- people to still use ASP.NET controls, using a simpler syntax.
- For example people doing blogs and editing their templates
- over the web probably do not want to use direct ASP.NET but a
- wrapper around it.
-
-** Roadmap
-
- 1. The Parser.
-
- 2. Get the parser to generate output compatible with ASP.NET.
-
- 3. Run the sample output with the real Microsoft runtime
- but using our generated page.
+ XSP is a simple web server written in C# that can be used to
+ run your ASP.NET applications. The code is available from our
+ <a href="download.html">download page</a> or from the <a
+ href="anoncvs.html">Anonymous CVS</a> repository (module name:
+ xsp).
+
+ A couple of classes of this new server can be reused/extended
+ to make an apache module/cgi using mono (MonoWorkerRequest and
+ MonoApplicationHost). This server also uses a couple of
+ plugins distributed with Mono to support gzip HTTP transfers.
- 4. Run the sample with our classes with the .NET runtime.
- <b>We are here</b>.
+ There is also a set of pages, controls and web services that you
+ can use to test the server and see how ASP.NET looks like.
- 5. Finish HttpRuntime.
+ As XSP is written in C# and uses System.Web classes to perform
+ its job, it also works under MS runtime.
- 6. Running our sample code with our classes with our runtime.
-
-** How to Help
+<a name="mod_mono">
+** mod_mono
- Currently we are testing and fixing HtmlControls, WebControls and
- validators.
+ This Apache module is available from our <a
+ href="download.html">download page</a>. The <a href="anoncvs.html">
+ cvs</a> module name is mod_mono.
- In the CVS module XSP you can find the aspx to C# page parser,
- a little web server used for testing and a directory containing
- sample aspx pages.
+ It allows apache to serve ASP.NET pages by proxying the requests
+ to a slightly modified version of our XSP called mod-mono-server
+ that is installed along with XSP.
- You have some documentation under doc directory and in the README
- file of each directory. They explain how to test our System.Web.
- Testing is really easy!
+ It does not work on Windows.
+<div align="bottom">
+<small>Last updated: Sat, 12 Jun 2004 05:07:31 GMT</small>
+</div>
diff --git a/web/beta1-press b/web/beta1-press
new file mode 100644
index 00000000000..75a800469e0
--- /dev/null
+++ b/web/beta1-press
@@ -0,0 +1 @@
+ <h1>Mono Beta 1 press coverage report</h1> <div> <br> <p>May 14, 2004</p> <p>by Kevan Barney, Novell</p> <p>The chronological listing below represents a good portion, but not all, of the English-language press coverage to date.</p> </div><div> <br> <p><b>Mono project achieves beta release, invites developer input</b>,<br><i>LinuxDevices.com</i> (May 5, 2004, <a href="http://www.linuxdevices.com/news/NS9523685217.html">Link</a>)</p> <p><b>Mono Project Releases Beta 1</b>,<br><i>Slashdot</i> (May 5, 2004, <a href="http://slashdot.org/articles/04/05/05/0443213.shtml?tid=106&amp;tid=185&amp;tid=190&amp;tid=201">Link</a>) </p> <p><b>Mono goes beta</b>,<br><i>O’Reilly Network</i> Edd Dumbill (May 5, 2004, <a href="http://www.onlamp.com/pub/wlg/4799">Link</a>) </p> <p><b>Mono Development Platform Moves into Beta</b>,<br><i>eWeek</i>, Matt Hicks (May 6, 2004, <a href="http://www.eweek.com/article2/0,1759,1586734,00.asp">Link</a>)</p> <p><b>Novell launches test of open-source project</b>,<br><i>CNET News.com</i>, Mike Ricciuti (May 6, 2004, <a href="http://news.com.com/2100-7344_3-5207192.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>InfoWorld</i>, Robert McMillan (May 6, 2004, <a href="http://www.infoworld.com/article/04/05/06/HNnovellmono_1.html">Link</a>)</p> <p><b>Novell launches test of open-source project</b>,<br><i>ZDNet</i>, Mike Ricciuti (May 6, 2004, <a href="http://zdnet.com.com/2100-1104_2-5207192.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>Computerworld</i>, Robert McMillan (May 6, 2004, <a href="http://www.computerworld.com/developmenttopics/development/story/0,10801,92971,00.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>Network World</i>, Robert McMillan (May 6, 2004, <a href="http://www.nwfusion.com/news/2004/0506novelrelea.html">Link</a>)</p> <p><b>Novell Releases Project Mono Beta</b>,<br><i>Linux Pipeline</i>, Mitch Wagner (May 6, 2004, <a href="http://www.linuxpipeline.com/showArticle.jhtml?articleID=20000052">Link</a>)</p> <p><b>Enterprise Unix Roundup — Red Hat's Desktop Epiphany</b>,<br><i>ServerWatch</i>, Michael Hall (May 6, 2004, <a href="http://www.serverwatch.com/news/article.php/10824_3350491_2">Link</a>)</p> <p><b>Novell Releases Project Mono Beta</b>,<br><i>CRN</i>, Mitch Wagner (May 7, 2004, <a href="http://www.crn.com/sections/BreakingNews/dailyarchives.asp?ArticleID=49983">Link</a>)</p> <p><b>Novell debuts open source toolkit for .NET</b>,<br><i>The Register</i>, John Leyden (May 7, 2004, <a href="http://www.theregister.co.uk/2004/05/07/mono/">Link</a>)</p> <p><b>Novell Targets .NET with Mono Beta</b>,<br><i>NewsFactor Network</i>, Jay Wrolstad (May 7, 2004, <a href="http://www.newsfactor.com/story.xhtml?story_title=Novell_Targets__NET_with_Mono_Beta&amp;story_id=23961&amp;category=hardware">Link</a>)</p> <p><b>.NET Goes Open Source and Catches Mono</b>,<br><i>internetnews.com</i>, Sean Michael Kerner (May 7, 2004, <a href="http://www.internetnews.com/dev-news/article.php/3351561">Link</a>)</p> <p><b>.Net developers can write for Linux using Mono</b>,<br><i>ZDNet UK</i>, Munir Kotadia (May 7, 2004, <a href="http://news.zdnet.co.uk/software/developer/0,39020387,39154054,00.htm">Link</a>)</p> <p><b>Mono Goes to Beta</b>,<br><i>LinuxWorld</i>, Maureen O’Gara (May 7, 2004, <a href="http://www.linuxworld.com/story/44739.htm">Link</a>)</p> <p><b>Mono betas the Open Source route to .Net</b>,<br><i>PC Pro</i>, Matt Whipp (May 7, 2004, <a href="http://www.pcpro.co.uk/?http://www.pcpro.co.uk/news/news_story.php?id=57267">Link</a>)</p> <p><b>Novell Debuts Mono Beta To Challenge .NET</b>,<br><i>LinuxInsider</i>, Gene J. Koprowski (May 7, 2004) <a href="http://www.linuxinsider.com/story/opensource/33696.html">Link</a>)</p> <p><b>Novell tests .Net on open source</b>,<br><i>ZDNet UK</i>, Mike Ricciuti (May 7, 2004, <a href="http://news.zdnet.co.uk/0,39020330,39153957,00.htm">Link</a>)</p> <p><b>Novell gives first glimpse of giant killer</b>,<br><i>Techworld</i>, Robert McMillan (May 7, 2004, <a href="http://www.techworld.com/opsys/news/index.cfm?NewsID=1513&amp;Page=1&amp;pagePos=4">Link</a>)</p> <p><b>Open Source .NET Reaches Beta</b>,<br><i>Computer Business Review</i> (May 7, 2004, <a href="http://www.cbronline.com/currentnews/60cd600cf1c4e6d680256e8d0032e284">Link</a>)</p> <p><b>Novell's Mono Closes Linux Gap</b>,<br><i>Enterprise Linux I.T.</i>, Jay Wrolstad (May 7, 2004, <a href="http://enterprise-linux-it.newsfactor.com/story.xhtml?story_title=Novell-s-Mono-Closes-Linux-Gap&amp;story_id=23972">Link</a>)</p> <p><b>Novell's Mono Closes Linux Gap</b>,<br><i>Enterprise Windows I.T.</i>, Jay Wrolstad (May 7, 2004, <a href="http://enterprise-windows-it.newsfactor.com/story.xhtml?story_title=Novell_s_Mono_Closes_Linux_Gap&amp;story_id=23972&amp;category=dotnet">Link</a>)</p> <p><b>For the record 7 May</b>,<br><i>ElectricNews.net</i>, Matthew Clark (May 7, 2004, <a href="http://www.enn.ie/news.html?code=9411166">Link</a>)</p> <p><b>Novell releases Project Mono beta</b>,<br><i>IT News Australia</i>, Mitch Wagner (May 7, 2004, <a href="http://www.itnews.com.au/ibmstorycontent.asp?ID=10&amp;Art_ID=19502">Link</a>)</p> <p><b>Novell releases open source platform for .Net</b>,<br><i>The Inquirer</i> (May 7, 2004, <a href="http://www.theinquirer.net/?article=15763">Link</a>)</p> <p><b>Final Mono version by June-end</b>,<br><i>The Age</i> (May 7, 2004, <a href="http://www.theage.com.au/articles/2004/05/07/1083881478476.html">Link</a>)</p> <p><b>Novell launches test of open-source project</b>,<br><i>CNETAsia</i>, Mike Ricciuti (May 7, 2004, <a href="http://asia.cnet.com/newstech/applications/0,39001094,39178338,00.htm">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>PC World Australia</i>, Robert McMillan (May 7, 2004, <a href="http://www.pcworld.idg.com.au/index.php/id;2103806279;fp;2;fpid;1">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>Computerworld Australia</i>, Robert McMillan (May 7, 2004, <a href="http://www.computerworld.com.au/index.php/id;2103806279;fp;16;fpid;0">Link</a>)</p> <p><b>Novell's Mono Closes Linux Gap</b>,<br><i>CIO Today</i>, Jay Wrolstad (May 7, 2004, <a href="http://cio-today.newsfactor.com/story.xhtml?story_title=Novell_s_Mono_Closes_Linux_Gap&amp;story_id=23972">Link</a>)</p> <p><b>Final Mono version by June-end</b>,<br><i>Sydney Morning Herald</i> (May 7, 2004, <a href="http://www.smh.com.au/articles/2004/05/07/1083881478476.html">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>LinuxWorld Australia</i>, Robert McMillan (May 7, 2004, <a href="http://www.linuxworld.com.au/index.php/id;2103806279;fp;2;fpid;1">Link</a>)</p> <p><b>Novell releases first Mono beta</b>,<br><i>IDG Singapore</i>, Robert McMillan (May 7, 2004, <a href="http://www.idg.com.sg/idgwww.nsf/0/FF7C3882D9F923D248256E8D002C1C85?OpenDocument">Link</a>)</p> <p><b>Novell brings .net to open source with first Mono beta</b>,<br><i>ComputerWeekly.com</i>, Robert McMillan (May 10, 2004, <a href="http://www.computerweekly.com/articles/article.asp?liArticleID=130385&amp;liArticleTypeID=1&amp;liCategoryID=1&amp;liChannelID=171&amp;liFlavourID=1&amp;sSearch=&amp;nPage=1">Link</a>)</p> <p><b>Novell brings .net to open source with first Mono beta</b>,<br><i>MicroScope</i>, Robert McMillan (May 10, 2004, <a href="http://www.microscope.co.uk/articles/article.asp?liArticleID=130385&amp;liArticleTypeID=20&amp;liCategoryID=1&amp;liChannelID=171&amp;liFlavourID=2&amp;sSearch=&amp;nPage=1">Link</a>)</p> <p><b>Spreading Mono</b>,<br><i>Developer Pipeline</i>, Matt McKenzie (May 11, 2004, <a href="http://www.developerpipeline.com/showArticle.jhtml;jsessionid=03TBR0R5TZBUMQSNDBNCKHQ?articleId=20300292">Link</a>)</p> <p><b>Developers catching Mono beta release</b>,<br><i>SearchEnterpriseLinux.com</i>, Michael S. Mimoso (May 11, 2004, <a href="http://searchenterpriselinux.techtarget.com/originalContent/0,289142,sid39_gci963407,00.html">Link</a>)</p> <p><b>Mono Brings .NET to Open Systems</b>,<br><i>ENT News</i>, Stephen Swoyer (May 11, 2004, <a href="http://www.entmag.com/news/article.asp?EditorialsID=6231">Link</a>)</p> <p><b>Spreading Mono</b>,<br><i>Linux Pipeline</i>, Matt McKenzie (May 11, 2004, <a href="http://www.linuxpipeline.com/showArticle.jhtml?articleID=20300445">Link</a>)</p> <p><b>Developers catching Mono beta release</b>,<br><i>SearchWebServices.com</i>, Michael S. Mimoso (May 11, 2004, <a href="http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_gci963386,00.html">Link</a>)</p> <p><b>Mono Project Brings Microsoft’s Insular .NET Technologies to Open Systems</b>,<br><i>Enterprise Systems</i>, Stephen Swoyer (May 11, 2004, <a href="http://www.esj.com/enterprise/article.asp?EditorialsID=962">Link</a>)</p> <p><b>Utah business in brief</b>,<br><i>Salt Lake Tribune</i> (May 13, 2004, <a href="http://www.sltrib.com/2004/May/05132004/business/165937.asp">Link</a>)</p> </div> \ No newline at end of file
diff --git a/web/blogs b/web/blogs
new file mode 100644
index 00000000000..1fb66df3c07
--- /dev/null
+++ b/web/blogs
@@ -0,0 +1,38 @@
+
+ You can read the aggregates news from the Mono developers in
+ <a href="http://www.go-mono.com/monologue">Monologue</a>. You
+ can also download our aggregator from the <a
+ href="anoncvs.html">AnonCVS</a> server.
+
+ Various Mono contributors maintain blogs, some are listed here:
+
+ <a href="http://codeblogs.ximian.com/blogs/benm/index.rdf"><img align="center" src="images/xml.gif"></a>
+ <a href="http://codeblogs.ximian.com/blogs/benm/">Ben Maurer</a>
+ <br>
+ <a href="http://ada.fciencias.unam.mx/~olopez/jscript/cesar.rss2"><img align="center" src="images/xml.gif"></a>
+ <a href="http://ada.fciencias.unam.mx/~olopez/jscript/">Cesar Nataren</a>
+ <br>
+ <a href="http://www.jacksonh.net/jackson/blog/jackson.rss2"><img align="center" src="images/xml.gif"></a>
+ <a href="http://www.jacksonh.net/jackson/blog/">Jackson Harper</a>
+ <br>
+ <a href="http://primates.ximian.com/~lluis/blog/index.rdf"><img align="center" src="images/xml.gif"></a>
+ <a href="http://primates.ximian.com/~lluis/blog/">Lluis S&aacute;nchez</a>
+ <br>
+ <a href="http://primates.ximian.com/~martin/blog/rss.xml"><img align="center" src="images/xml.gif"></a>
+ <a href="http://primates.ximian.com/~martin/blog/">Martin Baulig</a>
+ <br>
+ <a href="http://primates.ximian.com/~miguel/miguel.rss2"><img align="center" src="images/xml.gif"></a>
+ <a href="http://primates.ximian.com/~miguel/activity-log.php">Miguel de Icaza</a>
+ <br>
+ <a href="http://primates.ximian.com/~mkestner/blog/index.rdf"><img align="center" src="images/xml.gif"></a>
+ <a href="http://primates.ximian.com/~mkestner/blog/">Mike Kestner</a>
+ <br>
+ <a href="http://pages.infinit.net/ctech/poupou.rss"><img align="center" src="images/xml.gif"></a>
+ <a href="http://pages.infinit.net/ctech/poupou.html">Sebastien Pouliot</a>
+ <br>
+ <a href="http://primates.ximian.com/~gonzalo/mono/blog/index.xml"><img align="center" src="images/xml.gif"></a>
+ <a href="http://primates.ximian.com/~gonzalo/mono/blog/">Gonzalo Paniagua</a>
+ <br>
+ <a href="http://codeblogs.ximian.com/blogs/ndrochak/index.rdf"><img align="center" src="images/xml.gif"></a>
+ <a href="http://codeblogs.ximian.com/blogs/ndrochak/">Nick Drochak</a>
+
diff --git a/web/books b/web/books
index d5933e79836..00ed239bb73 100644
--- a/web/books
+++ b/web/books
@@ -1,11 +1,38 @@
-* C# Books
+* Mono
+
+ <a href="http://www.amazon.de/exec/obidos/ASIN/3827264928/qid=1050051051/sr=2-1/ref=sr_2_3_1/028-2755135-1623712">
+ Mono: .NET-kompatible Anwendungen mit dem Open Source-Framework
+ </a>
+
+* C#
A Programmer's Introduction to C# - Second Edition: Eric Gunnerson
+* .NET Framework
+
+ Avery good techincal book about .NET is Don Box's <a
+ href="http://service.bfast.com/bfast/click?bfmid=2181&sourceid=39391960&isbn=0201734117">Essential
+ .NET</a>
+
* Remoting
- <a href="http://www.dotnetremoting.cc/book/AdvancedDotNetRemoting.asp">
- Advanced .NET Remoting: Ingo Rammer</a>
+ <a href="http://www.dotnetremoting.cc/book/AdvancedDotNetRemoting.asp">Advanced .NET Remoting: Ingo Rammer</a>
+
+* Threading
+
+ .NET Multithreading: Alan L. Dennis (ISBN 1-930110-54-5)
+
+* Web Services
+
+ Web Services: Architecture and Implementation with .NET: Keith Ballinger
+
+* ASP.NET
+
+ Essential ASP.NET with Examples in C# by Fritz Onion
+
+ ASP.NET in a Nutshell by G. Andrew Duthie & Matthew MacDonald
+
+ Programming ASP.NET by Jessy Liberty & Dan Hurtwitz
* Compiler Implementation
@@ -34,4 +61,4 @@
MIPS Processor supplement</a>
<a href="http://www.sparc.org/standards/V8.pdf">The SPARC Architecture
- Manual Version 8</a> \ No newline at end of file
+ Manual Version 8</a>
diff --git a/web/bugs b/web/bugs
new file mode 100644
index 00000000000..7b3272b569c
--- /dev/null
+++ b/web/bugs
@@ -0,0 +1,82 @@
+* Bug reporting
+
+ To report bugs you need to create a <a
+ href="http://bugzilla.ximian.com/createaccount.cgi">Bugzilla
+ Account</a>.
+
+ Here are some convenient shortcuts to browse or add bug reports.
+
+ <ul>
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Class+Libraries&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&newqueryname=&form_name=query&order=bugs.priority%2C%20bugs.bug_id">[Query]</> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Class%20Libraries">[Add]</a> Class Libraries
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Compilers&component=IL+assembler&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Compilers&component=IL%20assembler">[Add]</a> IL Assembler.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Compilers&component=C%23&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Compilers&component=C%23">[Add]</a> C# Compiler.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Runtime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Runtime">[Add]</a> Runtime
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Doctools&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Doctools">[Add]</a> Documentation system.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=gtk%23&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=gtk%23">[Add]</a> Gtk#
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Class+Libraries&component=System.Web&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Class%20Libraries&component=System.Web">[Add]</a> ASP.NET WebForms
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Class+Libraries&component=System.Web.Services&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Class%20Libraries&component=System.Web.Services">[Add]</a> ASP.NET Web Services
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%3A+Debugger&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Debugger">[Add]</a> Debugger.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono+Develop&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&cmdtype=doit&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> <a href="http://bugzilla.ximian.com/enter_bug.cgi?product=Mono+Develop">[Add]</a> Mono Develop.
+
+ * <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono+Tasks&product=Mono%3A+Class+Libraries&product=Mono%3A+Compilers&product=Mono%3A+Debugger&product=Mono%3A+Doctools&product=Mono%3A+Runtime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">[Query]</a> All core components.
+
+ </ul>
+
+<a name="goodbugreport"/>
+** How to make good bug reports
+
+ <ol>
+ * Submit a test case, the smaller it is, the better.
+
+ <p>You can do this by clicking on the "Create a new
+ attachment" link. When attaching a file, please set the
+ correct MIME type from the list. For source code, "Plain
+ text" is ok. For tar.gz or .gz files, you can enter
+ "application/x-gzip" in the "Other" text box.
+
+ * Use <a href="http://bugzilla.ximian.com">
+ http://bugzilla.ximian.com</a> to report the bug.
+
+ <p>In <b>addition</b> to bugzilla, posting to the list is
+ fine if the bug merits larger exposure or design
+ discussions to solve; posting to the list twice or more
+ is just a way to annoy people and make them waste time,
+ specially when you start a new thread about it.
+
+ * If the test involves libraries or assemblies that are
+ not part of mono, add info about where to download all
+ the dependencies, and how to compile/install them.
+
+ * If compiling the test case requires more than:
+ <pre> mcs test.cs </pre>
+ provide the <b>full command line</b> you used to compile
+ the test.
+
+ * If running the test requires more than:
+ <pre> mono test.exe </pre>
+ provide the <b>full command line</b> needed to replicate
+ the bug.
+
+ * Provide info about the version of the software you're
+ using (both mono and the operating system or relevant
+ libraries).
+
+ * Provide the output you expect the test case to produce.
+
+ * Provide the actual output <b>you</b> get from the test case.
+ </ol>
+
+ A good bug report complies with at least 6 items from the list.
+ If your bug report complies with 3 or less items, it is very
+ poor and it means it will take much more time to fix (when it's
+ not ignored).
+
diff --git a/web/c-sharp b/web/c-sharp
index fa4dad1d732..ffa0b574bef 100644
--- a/web/c-sharp
+++ b/web/c-sharp
@@ -1,22 +1,18 @@
* MCS: The Ximian C# compiler
- MCS is currently able to compile itself and many more C#
- programs (there is a test suite included that you can use).
+ The Mono C# compiler is considered feature C# 1.0 complete at
+ this point and mature. MCS is able to compile itself and many
+ more C# programs (there is a test suite included that you can
+ use). It is routinely used to compile Mono, roughly 1.7
+ million lines of C# code.
- We are in feature completion mode right now. There are still
- a couple of areas that are not covered by the Mono compiler, but
- they are very very few at this point.
+ The compiler is also fairly fast. On a IBM ThinkPad t40 it
+ compiles 18,000 lines of C# code per second.
- MCS was able to parse itself on April 2001, MCS compiled itself
- for the first time on December 28 2001. MCS became self hosting
- on January 3rd, 2002.
-
- The Mono Runtime and the Mono execution engine were able to make
- our compiler self hosting on March 12, 2002.
-
- A test suite is maintained to track the progress of
- the compiler and various programs are routinely compiled and
- ran.
+ Work on C# 2.0 has started: some pieces of it are available on
+ the standard compiler with the -2 switch (iterators, method
+ conversions) and some others are available on the `gmcs'
+ branch on CVS (generics)
** Obtaining MCS
@@ -27,8 +23,8 @@
** Running MCS
MCS is written in C# and uses heavily the .NET APIs. MCS runs
- on Linux (with the Mono runtime) and Windows (with the .NET
- framework runtime)
+ on Linux with the Mono runtime and on Windows with both the
+ .NET runtime and the Mono runtime.
** Reporting Bugs in MCS
@@ -103,36 +99,53 @@
able to use this generic CIL optimizer in their projects
reducing their time to develop a production compiler.
-<a name="tasks">
-** Current pending tasks
+* Open bugs
- Simple tasks:
+ See the <a href="bugs.html">bugs page</a> for more information.
- <ul>
- * Redo the way we deal with built-in operators.
- </ul>
+ A test suite is maintained to track the progress of
+ the compiler and various programs are routinely compiled and
+ ran.
- Larger tasks:
- <ul>
+* Slides
- * Jay does not work correctly with `error'
- productions, making parser errors hard to point. It
- would be best to port the Bison-To-Java compiler to
- become Bison-to-C# compiler.
-
- Nick Drochak has started a project on SourceForge for this.
- You can find the project at: <a href="http://sourceforge.net/projects/jb2csharp/">
- http://sourceforge.net/projects/jb2csharp/</a>
+ Slides for the Mono C# Compiler presentation at .NET ONE are
+ available <a
+ href="http://primates.ximian.com/~miguel/slides-europe-nov-2002/Mono_C_Sharp_Overview_1007.sxi">here</a>
+ in StarOffice format.
- * Semantic Analysis: Return path coverage and
- initialization before use coverage are two great
- features of C# that help reduce the number of bugs
- in applications. It is one interesting hack.
+** History
- </ul>
+ MCS was able to parse itself on April 2001, MCS compiled itself
+ for the first time on December 28 2001. MCS became self hosting
+ on January 3rd, 2002.
+
+ The Mono Runtime and the Mono execution engine were able to make
+ our compiler self hosting on March 12, 2002.
** Questions and Answers
+Q: Does the Mono C# compiler support C# 2.0?
+
+A: At this point the Mono C# compiler supports some of the features of
+ C# 2.0, but the support has not been completed. To enable 2.0 features
+ you must use the -2 flag to the compiler.
+
+Q: What features are available as of Feb 2004?
+
+A: Iterators have been implemented as well as method group implicit
+ conversion to delegates on the main compiler branch.
+
+ We have a branch of the compiler in the module `mcs/gmcs' which is
+ where we are developing the Generics support for the compiler. Plenty
+ of tests work (see mcs/tests/gen-*.cs for a list of tests), but work
+ remains to be done.
+
+Q: Will the C# 2.0 features be part of the Mono 1.0 release?
+
+A: Only a few, the generic compiler will not be part of the 1.0
+ stable release, but a beta preview will be distributed.
+
Q: Why not write a C# front-end for GCC?
A: I wanted to learn about C#, and this was an exercise in this
diff --git a/web/ccvs b/web/ccvs
index c7710b56601..e5a53432682 100644
--- a/web/ccvs
+++ b/web/ccvs
@@ -1,28 +1,282 @@
* CVS Access
- If you are an active Mono developer, you can get a CVS account
- that hosts the Mono source code.
+ Here we describe how one obtains commit access to the Mono CVS
+ repository and the responsibilities that come with that access
+ privilege.
- If you are not a developer, but want to track the development, please
- see the <a href="anoncvs.html">AnonCVS</a> instructions.
+ These only apply to the Mono CVS repository, and not to the <a
+ href="http://forge.novell.com/modules/xfmod/community/?monocomm">Mono
+ Community</a> repositories at Novell Forge.
- Send an e-mail to miguel with your public SSH key for this
- purpose. Please specify if the key was generated with SSH1 or SSH2.
+** What is CVS?
- If you are using SSH2, please generate your key using:
+ Briefly, CVS is a system tool used to store and maintain files and
+ a history of their changes over time. The Mono source code and related
+ files are kept on a CVS server at Ximian.
+
+** What Access?
+
+ We mean "commit" access. This is the privilege to make permanent
+ changes to the Mono source code and related files. You need an account
+ created by the CVS server administrator in order to commit changes to
+ the files on that server.
+
+** How Does One Obtain Access?
+
+ Any active Mono developer can get a CVS account. Normally one is
+ considered an 'active' developer after sending several patches to the
+ mailing lists and/or bugzilla for review.
+
+ If you are not a developer, but want to access the latest sources,
+ please see the <a href="anoncvs.html">AnonCVS</a>
+ instructions. If you are not a direct contributor to Mono,
+ but want to host your .NET or Mono-based project, you can use
+ <a href="forge.html">Novell Forge</a>.
+
+
+ If you feel you are ready for a CVS account send an e-mail to
+ <a href="mailto:miguel@ximian.com">miguel</a> with your public OpenSSH
+ key for this purpose. We only support SSH2 at this point.
+
+* Policies
+
+ It is necessary that everyone with CVS commit access respect and
+ adhere to the following rules. If you ask for and are granted CVS
+ access, you are agreeing to follow these policies.
+
+** Code License
+
+ If you are about to commit code to a module, the code that is
+ being committed should be released under the same license as
+ the code that the module has.
+
+ Check the license if you are unsure, but it is basically:
+ class libraries X11; compiler and tools: GPL; runtime: LGPL.
+
+ If in doubt, check with the maintainers of the module, or send
+ mail to mono-hackers-list@ximian.com.
+
+** Changing code
+
+ Even if you have CVS commit access, that doesn't mean you can change
+ code at will in any directory or module. Directories and Namespaces
+ have a sort of unofficial ownership. If you are not the owner of a
+ piece of code and you want to make changes/fixes to it, there are two
+ cases.
+
+ <ul>
+ <li> The change is a typo fix or a one-liner build or trivial fix. In
+ this case almost anyone can commit (always remembering to add the
+ proper changelog entry to explain the change). We say "almost anyone",
+ because changes to certain directories almost always should be reviewed
+ first. Such as changes to core stuff: corlib/System, System.Collections,
+ mini/, metadata/, System.IO.
+
+ <li> The change is larger. In this case the patch *must* be sent to
+ mono-devel-list for review by the owner of the code and by the other
+ hackers. Always submit such patches to the list or bugzilla, although
+ you may put the owner of the code in the CC header. Hackers come and go.
+ Mailing a patch to only a personal address is a good way to get the
+ patch forgotten and missed. Plus, getting the patches reviewed as well
+ as reviewing them, is a good thing, so try to get used to it.
+ </ul>
+
+ Note: If the patch is an addition of code and doesn't change any of the
+ existing code, the rules are slightly relaxed: there is more freedom
+ in committing such changes, if they don't interfere with the existing
+ codebase.
+
+** Owning Code
+
+ Now, how do you get to be the owner of a chunk of code? The answer is
+ simple. You wrote the code, so you're the unofficial owner. There is
+ also another way. After sending a few patches for the code, the
+ owner (or the core developers of mono, if the owner somehow disappeared)
+ trusts you and tells you you're free to commit without getting his
+ review first.
+
+
+ Here is a (partial) list of namespaces/directories with their owners:
+ <ul>
+ <li>Debugger module and debug code in mono: martin
+ <li>mcs compiler: miguel, martin, ravi
+ <li>Reflection/Reflection.Emit: lupus, zoltan
+ <li>IO-layer: dick
+ <li>mini: lupus, dietmar
+ <li>test suite: nickd (though anyone should feel free to add test cases)
+ <li>System.IO: dick, ville
+ <li>security stuff: spouliot
+ <li>ilasm: jackson
+ <li>System.Web and related: gonzalo
+ <li>System.Xml: eno, piers
+ <li>Remoting: dietmar, lluis
+ <li>interop/marshal: dietmar
+ <li>threads: dick
+ </ul>
+
+ If you are the owner of a piece of code, feel free to commit code, and
+ delegate the work to others.
+
+ But, if you're not the owner of the code, committing a rewrite without
+ getting a review first is not good cvsitizenship (especially when the
+ rewrite claimed to fix bugs, but not a single regression test has been
+ added to the suite).
+
+** Commit Rules
+
+ Once you know you can commit a patch (because of the rules above) there
+ are a few other small rules to follow:
+
+ <ul>
+ <li>Always add a ChangeLog entry with a meaningful
+ explanation, this file should be located in the same directory
+ as the change you make.
+
+ <li>The ChangeLog entry <b>must</b> be pasted on the CVS
+ commit log, so the CVS commit log can be used to map to the
+ changes as well.
+
+ <li>The ChangeLog and the files that comprise related changes
+ should be committed together, not one by one, otherwise the
+ history is pretty much useless if related changes are
+ separated during the commit.
+
+ <li>If you fix a bug, add a regression test for it in the regression
+ suite.
+
+ <li>Don't commit unrelated changes together with a fix: do fine-grained
+ commits.
+
+ <li>Always check what you're committing: make sure you're only committing
+ what you need and make sure you don't change line endings and
+ whitespace. Do a 'cvs diff -u' of the files you're going to commit and
+ check the changes.
+
+ <li>Don't do reformatting commits, unless you're the original author of
+ the code.
+
+ <li>When fixing bugs, don't follow the documentation blindly, it may
+ well be wrong. Test the behavior on the MS runtime or ask on the list
+ for discussion if unsure. Don't be afraid of having your changes
+ reviewed.
+
+ <li>Never remove copyright notices from the code.
+
+ <li>Never remove licensing info from code.
+
+ <li>Never commit code you didn't write yourself or code that doesn't
+ have a suitable license.
+
+ <li>Follow the style conventions.
+
+ <li>Keep an eye on performance considerations, especially for code in
+ core classes, ask on the list for guidance.
+
+ <li>Do a regression test run and a bootstrapping build if making changes
+ to core functionality before committing. Do not commit code that would
+ break the compile, because that wastes everybody's time. Two things
+ are important in this step: trying to build your sources and making
+ sure that you add all the new files before you do a commit.
+
+ </ul>
+
+ Also, remember to pat yourself on the back after the commit, smile and
+ think we're a step closer to a better free software world.
+
+* Branches
+
+ We have branched the CVS modules `mono', `mcs' and
+ `libgdiplus', the tag to fetch these branches is: `mono-1-0',
+ so you use the following command to fetch the mono-1-0
+ branches:
+
+<pre>
+ cvs co -r mono-1-0 mono
+ cvs co -r mono-1-0 mcs
+ cvs co -r mono-1-0 libgdiplus
+</pre>
+
+ I personally use a directory called `mono-1-0' to keep these
+ together and a separate directory keeps my HEAD development,
+ and I configure each one to different prefixes, so I can test
+ and run code with HEAD or mono-1-0.
+
+*** mono-1-0 policy
+
+ This branch will only get bug fixes to critical and major errors.
+ You must still get approval from the maintainer of the code to
+ check-in code into this branch.
+
+ Before submitting a patch for this branch, you should run all
+ appropriate regression tests. Upcoming mono-1.0.x versions
+ will be produced from this branch.
+
+*** mono HEAD policy
+
+ HEAD should continue to build at all times: HEAD is not a
+ dumping ground for partial work: you still must ensure that
+ the build is not broken, and that no regressions are caused.
+ Unlike the main branch, you do not need approval to minor
+ changes, the same old rules apply.
+
+ But for any large architectural change, you must check with
+ the maintainers and get approval for the patches. For these
+ large changes, if you are touching someone else's code, you
+ should contact the maintainer of that code and get approval
+ from them.
+
+ You must assume that HEAD will be packaged and distributed at
+ any point, this will be the branch that we use for making the
+ mono-1.1.x releases that will lead to our stable mono-1.2.x
+ release.
+
+ So, the bottom line is: do not check-in known regressions that
+ break the build. A lot of work is underway, and we must
+ ensure the tree works.
+
+
+* Using CVS.
+
+ This is a small tutorial for using CVS.
+
+** Generating an SSH key
+
+ If you are using SSH version 2, please generate your key using:
<pre>
ssh-keygen -t rsa
</pre>
- And mail me the id_rsa.pub file.
+ And mail <a href="mailto:miguel@ximian.com">miguel</a> the
+ id_rsa.pub file.
- If you are using SSH1, run:
+ If you are using SSH version 1, run:
<pre>
ssh-keygen
</pre>
- And mail me your identity.pub file.
+ And mail <a href="mailto:miguel@ximian.com">miguel</a> your
+ identity.pub file.
+
+ If you are using SSH from SSH Communications Security (they offer
+ a free SSH client for personal use), you have to use OpenSSH to
+ convert your public key to the required format. You have to use
+ OpenSSH's ssh-keygen program and write the following:
+
+<pre>
+ ssh-keygen -i -f id_XXX.pub > my_public_key.pub
+</pre>
+
+ where the file id_XXX.pub is your public key file,
+ normally located under ~/.ssh/ or ~/.ssh2/.
+ Send to <a href="mailto:miguel@ximian.com">miguel</a> the
+ my_public_key.pub file.
+
+ The *exact* format for this file must be:
+
+<pre>
+ ssh-rsa XXXXX....
+</pre>
You will need CVS and SSH. Windows users can get both by
installing Cygwin (<a
@@ -58,7 +312,7 @@
** Making patches
Usually you will want to make a patch to contribute, and let
- other people review it before commiting it. To obtain such a
+ other people review it before committing it. To obtain such a
"patch", you type:
<pre>
@@ -67,7 +321,96 @@
mail mono-list@ximian.com < file.diff
</pre>
-** Keeping track of changes.
+** Committing your work
+
+ Once you get approval to commit to the CVS, or if you are
+ committing code that you are the maintainer of, you will want
+ to commit your code to CVS.
+
+ To do this, you have to "add" any new files that you created:
+
+<pre>
+ cvs add new-file.cs
+</pre>
+
+ And then commit your changes to the repository:
+
+<pre>
+ cvs commit file-1.cs file-2.cs
+</pre>
+
+* Using SVN
+
+ This is a small tutorial for using SVN (subversion).
+ For a more complete tutorial on subversion, look at
+ <a href="http://svnbook.red-bean.com/">the svn book</a>
+ or <a href="http://subversion.tigris.org">the svn homepage</a>
+
+** Generating a key
+
+ Follow the cvs instructions above.
+
+** Checking out the sources
+
+ To checkout the sources for the first time use the command:
+
+ Note: You should be running 0.35.1 (latest) of svn before attempting
+ anything here.
+
+<pre>
+ svn co svn+ssh://mono-cvs.ximian.com/svn/monodevelop/trunk/MonoDevelop
+</pre>
+
+ If you have a different username on mono-cvs and the local computer
+ you can do the following:
+
+<pre>
+ svn co svn+ssh://username@mono-cvs.ximian.com/svn/monodevelop/trunk/MonoDevelop
+</pre>
+
+ before checking out.
+
+** Updating your sources
+
+ You can update your repository to the latest copy of MonoDevelop by
+ running the following command:
+
+<pre>
+ svn up
+</pre>
+
+ from inside your repository.
+
+** Committing your work
+
+ Before you commit anything, you should first update to the latest
+ sources by following the updating directions. After you are up to date
+ you need to run a:
+
+<pre>
+ svn add filename
+</pre>
+
+ for every file that you have created. You can get a list of these files
+ by running:
+
+<pre>
+ svn status
+</pre>
+
+ After all the files are added, run:
+
+<pre>
+ svn commit
+</pre>
+
+ to commit your changes.
+
+** For more information
+
+ Look at the MonoDevelop website (coming soon)
+
+* Keeping track of changes.
We provide two e-mail based mechanisms to keep track of
changes to the code base:
@@ -86,28 +429,6 @@
We hope to offer LXR and Bonsai in the future as well.
-** Commiting your work
-
- Once you get approval to commit to the CVS, or if you are
- commiting code that you are the maintainer of, you will want
- to commit your code to CVS.
-
- To do this, you have to "add" any new files that you created:
-
-<pre>
- cvs add new-file.cs
-</pre>
-
- And then commit your changes to the repository:
-
-<pre>
- cvs commit file-1.cs file-2.cs
-</pre>
-
-** The Mailing List
-
- To keep track of the various development and changes to the
- CVS tree, you can subscribe to the mono-cvs-list@ximian.com.
To subscribe, send an email message to
mono-cvs-list-request@ximian.com and in the body of the
message put `subscribe'.
@@ -115,24 +436,8 @@
This will send you an email message every time a change is
made to the CVS repository, together with the information that
the author of the changes submitted.
-
-** Recommendations
-
- Please do not commit code that would break the compile to the
- CVS, because that normally wastes everybody's time. Two things
- are important in this step: trying to build your sources and making
- sure that you add all the new files before you do a commit.
-
- To build the sources, most of the type trying the `make' command
- is enough. In some cases (the class libraries) we use nant, so
- you need to run nant manually.
-
- Use ChangeLog entries so we can keep textual descriptions of
- your work, and use the contents of your ChangeLog file as the
- CVS commit message (ie, paste the contents of this into the
- editor buffer).
- If you are making changes to someone else's code, please make
- sure you get in touch with the maintainer of that code before
- applying patches. You want to avoid commiting conflicting
- work to someone else's code.
+ You might also want to track the live changes, subscribe to
+ the <a
+ href="mailto:mono-patches-request@ximian.com">mono-patches@ximian.com</a>
+ to receive the patches as they are checked into CVS.
diff --git a/web/class-status.in b/web/class-status.in
index a66aa18092e..3e023c7380b 100644
--- a/web/class-status.in
+++ b/web/class-status.in
@@ -1,17 +1,46 @@
* Status of the various pieces of the class library
- You can browse the status of the class library and see who has
- registered to work on what parts of the system. These list
- work-in-progress components currently.
-
- Browse the current <a href="class-status/index.html">status</a>.
-
- You can also download the XML <a
- href="class-status/maintainers.xml">maintainers</a> file that
- contains the actual maintainers list.
-
- You can also download the master <a
- href="class-status/class.xml">Class Status XML</a> file.
+ Classes in Mono are organized by the assembly that they belong to.
+
+ Here is the status of the different assemblies:
+ <ul>
+ <li><a href="http://www.go-mono.com/class-status-corlib.html">corlib</a>: The core library.
+ <li><a href="http://www.go-mono.com/class-status-cscompmgd.html">cscompmgd</a>:
+ Managed interface for C# compiler.
+ <li><a href="http://www.go-mono.com/class-status-System.html">System</a>: Extra modules
+ <li><a href="http://www.go-mono.com/class-status-System.Xml.html">System.Xml</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.Configuration.Install.html">System.Configuration.Install</a>.
+ <li><a
+ href="http://www.go-mono.com/class-status-System.Data.html">System.Data</a>:
+ Database access functionality (also check the <a href="ado-net.html">Mono ADO.NET status</a> pages).
+ <li><a href="http://www.go-mono.com/class-status-System.Data.OracleClient.html">System.Data.OracleClient</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.Design.html">System.Design</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.Drawing.html">System.Drawing</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.Drawing.Design.html">System.Drawing.Design</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.DirectoryServices.html">System.DirectoryServices</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.Management.html">System.Management</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.Messaging.html">System.Messaging</a>.
+ <li><a
+ href="http://www.go-mono.com/class-status-System.Web.html">System.Web</a>:
+ ASP.NET classes, also check the <a href="asp-net.html">Mono ASP.NET status pages</a>
+ <li><a href="http://www.go-mono.com/class-status-System.Web.Services.html">System.Web.Services</a>.
+ <li><a
+ href="http://www.go-mono.com/class-status-Microsoft.VisualBasic.html">Microsoft.VisualBasic</a>:
+ Support runtime for Visual Basic applications
+ <li><a href="http://www.go-mono.com/class-status-System.EnterpriseServices.html">System.EnterpriseServices</a>.
+ <li><a href="http://www.go-mono.com/class-status-System.Runtime.Remoting.html">System.Runtime.Remoting</a>.
+ <li><a
+ href="http://www.go-mono.com/class-status-System.Windows.Forms.html">Windows.Forms</a>:
+ there is also a <a
+ href="http://lists.ximian.com/mailman/listinfo/mono-winforms-list">mailing
+ list available</a>
+ <li><a
+ href="http://www.go-mono.com/class-status-System.Runtime.Serialization.Formatters.Soap.html">System.Runtime.Serialization.Formatters.Soap</a>.
+ <li><a
+ href="http://www.go-mono.com/class-status-System.Security.html">System.Security</a>:
+ Xml Signature Security classes, also check the <a href="crypto.html">Cryptography status pages</a>
+
+ </ul>
* List of not-implemented classes
diff --git a/web/classlib-doc b/web/classlib-doc
index 14fdc9e7191..d86969ed119 100644
--- a/web/classlib-doc
+++ b/web/classlib-doc
@@ -2,104 +2,48 @@
** Summary
- <em>
- [This documentation is in progress. Comments to
- <a href="mailto:jbarn@httcb.net">jbarn@httcb.net</a>.]
- </em>
-
While using inline XML tags to document classes is certainly
convenient, properly verbose documentation quickly overwhelms
the code, making the source quite difficult to read. Furthermore,
multilingual documentation makes for significant additional text.
- With these considerations in mind, Mono will use external XML files
- for type documentation, rather than documenting the source inline.
-
- Several tools will be created for managing, verifying, generating,
- and updating class library documentation, including:
-
- <ul>
- <li><a href="#docstub">docstub</a></li>
- <li><a href="#docverify">docverify</a></li>
- <li><a href="#docconv">docconv</a></li>
- <li><a href="#docgen">docgen</a></li>
- <li><a href="#monodoc">monodoc</a></li>
- </ul>
-
-** XML Documentation Files and Formats
+ With these considerations in mind, Mono is using external XML files
+ for class documentation, rather than documenting the source
+ inline. The XML file format used is inspired by the XML format used
+ to document the ECMA APIs.
+ Several tools exist for managing, verifying, generating,
+ and updating class library documentation.
+
+ The documentation infrastructure is part of the `Monodoc'
+ module. Monodoc includes a graphical GUI browser and tools to
+ generate the initial stubbed XML document out of an assembly.
-*** Monodoc XML
- This XML is similar to the XML documentation described in the
- C# standard, with added tags for internationalization and a
- slightly different structure. Documentation and a DTD/Schema
- for Monodoc XML is forthcoming.
-
- Monodoc XML does not contain any definitive type information,
- and is only useful in conjunction with the Type definition for
- whatever is being documented.
-
- This XML could be generated by hand, by monostub, or by monodoc.
-
-*** Assembly XML
- This XML is generated by combining runtime type information for
- an Assembly with a collection of Monodoc XML files. The resultant
- XML (in the best of cases) contains both complete type and
- documentary information for each type in the assembly.
-
- This XML contains enough information to be transformed into
- user-accessible documentation. It is likely that scripts
- will be created to generate reference docs as HTML and other
- formats.
-
- Documentation and a DTD/Schema for Assembly XML is forthcoming.
-
+ Download `monodoc' to start producing documentation for your
+ application.
+
+ For instructions, read the monodoc/README file.
+
** Documentation Tools
-*** <a name="docstub">docstub</a>
- Given a type name and an assembly, generates stub Monodoc XML
- documentation for the type. Optionally, docstub can attempt to
- populate initial documentation from an XML file in the format
- published along with the ECMA standard.
-
-*** <a name="docverify">docverify</a>
- Given a Monodoc XML file and an assembly, verifies that the
- documentation matches the compiled type. Checks signatures,
- parameters, et cetera.
-
-*** <a name="docconv">docconv</a>
- Converts from Monodoc XML to the standard C# compiler-emitted
- XML format and vice versa.
-
-*** <a name="docgen">docgen</a>
- Given an assembly and a collection of Monodoc XML files, creates
- an Assembly XML file containing all documentation and type information
- available. This output is suitable for transforming into user
- documentation.
-
-*** <a name="monodoc">monodoc</a>
- A GUI tool for documentation and translation, this encapsulates
- the capabilities of docstub, docverify, docconv, and docgen in
- a friendly user interface. In addition, monodoc provides features
- to ease translation, such as side-by-side editing and coverage
- statistics.
-
-** Status and Roadmap
+*** <a name="monodoc">MonoDoc</a>
-*** 2 January 2002
+ The MonoDoc system offers both a GUI client as well as a <a
+ href="http://www.go-mono.com:8080">Web-based interface</a> to
+ the documentation.
- As I write the initial version of this document, very little has been
- implemented. Currently, there is a:
-
- <ul>
- <li>Preliminary version of the Monodoc XML format</li>
- <li>Preliminary version of the docstub utility</li>
- </ul>
-
- Here's hoping for frequent, productive updates.
+ The GUI edition uses <a
+ href="http://gtk-sharp.sf.net">Gtk#</a> and the Web edition
+ uses Mono's ASP.NET implementation.
+
+ <img src="images/Screenshot-Monodoc.png">
** Get Involved
- Help us define Mono's documentation structure! Subscribe to
+ Help us develop Mono's documentation tools! Subscribe to
<a href="http://lists.ximian.com/mailman/listinfo/mono-docs-list">mono-docs-list</a>
and wade right in.
+
+ Monodoc today also supports a GUI-based collaborative editing
+ system. You can now edit the documentation from the MonoDoc
+ Browser and upload your contributions directly to the Mono site.
diff --git a/web/compiling b/web/compiling
new file mode 100644
index 00000000000..95281a93683
--- /dev/null
+++ b/web/compiling
@@ -0,0 +1,235 @@
+* Compiling Mono
+
+ This document describes how to compile and install Mono from
+ its source code. If you are only interested in running Mono,
+ you might want to install Mono from packages, which have been
+ tested.
+
+ The core of Mono is split in two components:
+
+ <ul>
+ * C components (available in the mono package)
+
+ * C# components (available in the mcs package).
+ </ul>
+
+ Mono is also available in various forms:
+
+ <dl>
+ <dt>Officially <a href="download.html">released</a> packages.</dt>
+ <dd>
+ <p>This is the format of choice for people to use, since these
+ have been tested and are known to build and work.
+ </dd>
+ <dt><a href="daily">Daily</a> packages.</dt>
+ <dd>
+ <p>This is a service offered for people who want to try out the
+ daily changes. Baked daily.</dd>
+ <dt>CVS source code.</dt>
+ <dd>
+ <p>These are available to Mono <a href="ccvs.html">developers</a> and
+ also for enthusiasts through <a href="anoncvs.html">anonymous CVS</a>.
+ </dd>
+ <dt>CVS snapshots.</dt>
+ <dd>
+ <p>Available for curious developers which do not necessarily want to
+ install the CVS source. Baked daily.
+ </dd>
+ </dl>
+
+* Compiling the code
+
+ There are a number of ways of compiling Mono
+
+ <ul>
+ <li>From the <a href="#scripts">scripts</A>
+
+ <LI><a href="#install">Manually</a> for the first time.
+
+ <li>Manually, <a href="#upgrade">while upgrading</a> to CVS
+ </ul>
+
+ (which is an easy way to get the latest CVS information)
+
+<a name="scripts">
+* Compiling with scripts
+
+ These scripts should be used for installing from packages, specially
+ on Windows, where dependencies have not always been installed.
+
+ There are scripts to help build mono for both Unix and Windows. Get
+ <a href="mono-build.sh">mono-build.sh</a> for Unix, or <a
+ href="mono-build-w32.sh">mono-build-w32.sh</a> for Windows.
+ These scripts automate the installation of GLIB and pkgconfig
+ (building from source on Unix, and using binary packages
+ provided by the GIMP for Windows project on Windows.) To use
+ the script, follow these simple steps:
+
+ <ul>
+ * Save the script for your platform somewhere (e.g. /usr/local/bin)
+ * Make the script executable (i.e chmod 755 /usr/local/bin/mono-build.sh)
+ * Create a directory to hold the mono source, and the compiled binaries (e.g. mkdir ~/mono)
+ * Change to the new directory (i.e. cd ~/mono)
+ * run the script (i.e. /usr/local/bin/mono-build.sh)
+ </ul>
+
+ The script requires wget on either platform, and building the
+ software requires make, gcc, automake, autoconf, and libtool.
+ You should install these packages from your distribution or
+ with the cygwin installer. You should also take care of setting
+ the right environment variables as the PKG_CONFIG_FLAGS, etc.
+
+ The script will download required packages from
+ www.go-mono.com and do a cvs checkout of mono in the current
+ directory. <b>IMPORTANT!:</b> The cvs server chosen defaults to
+ anonymous cvs;
+ set your CVSROOT environment variable before running the script to
+ select a particular cvs server.
+
+<a name="install">
+
+** Building the software manually
+
+ You will need to obtain the Mono dependencies first: <a
+ href="http://www.gtk.org">glib 2.x</a> and
+ <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a>.
+
+*** Building From Packages
+
+ This applies to both the officially released packages, as well as the
+ daily tarball packages.
+
+ <ul>
+ Unpack the Mono runtime distribution:
+ <pre class="shell">
+ tar xzvf mono-X.XX.tar.gz
+ cd mono-X.XX</pre>
+ <p>
+
+ Then configure, compile and install:
+
+ <pre class="shell">
+ ./configure --prefix=/usr/local
+ make
+ make install</pre>
+
+ This will give you a runtime, C# compiler and runtime
+ libraries.
+
+ If you want to recompile the runtime and the compiler,
+ follow these steps, first unpack the MCS package:
+
+ <pre class="shell">
+ tar xzvf mcs-X.XX.tar.gz</pre>
+
+ Then use the following command to compile and install:
+
+ <pre class="shell">
+ ./configure --profile=atomic
+ make</pre>
+
+ You can change /usr/local to something else if you want.
+ </ul>
+
+*** Building from CVS
+
+ To upgrade your Mono installation from CVS, it is very
+ important that you update your Mono and MCS modules from CVS
+ at the same time. Failure to do so might result in a
+ problematic installation as the runtime and the class
+ libraries will be out of sync.
+
+ Run the following commands to update your CVS tree (more
+ details in <a href="ccvs.html">Cvs and Mono</a> and the <A
+ href="anoncvs.html">AnonCVS and Mono</a> pages).
+
+ <pre>
+ (cd mono; cvs update -dP .)
+ (cd mcs; cvs update -dP .)
+ </pre>
+
+ Then you can run:
+
+ <pre>
+ (cd mono; make bootstrap)
+ </pre>
+
+ Now you can install the result:
+
+ <pre>
+ (cd mono; make install)
+ </pre>
+
+ Notice that following the above procedure does not require you
+ to manually install the software in the `mcs' directory, as
+ the relevant files will be copied by the `mono' makefiles.
+
+* Software resources and notes
+
+ The required and additional software can be downloaded here:
+
+ * Microsoft's .NET Framework SDK from
+ <a href="http://msdn.microsoft.com/downloads">
+ msdn.microsoft.com/downloads</a>.
+
+ * Cygwin and the GNU Make tools from
+ <a href="http://www.cygwin.com">www.cygwin.com</a>.
+ Some people observed problems with autoconf 2.52. Installing
+ autoconf 2.13 helped in those cases.
+
+ * Precompiled GLIB 2.0 and pkg-config packages (and
+ their dependencies) by the <a href="http://www.gimp.org/~tml/gimp/win32//index.html">GIMP for Windows</a> project from
+ <a href="http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip">http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip</a><br>
+ <a href="http://www.go-mono.com/archive/glib-2.0.4-20020703.zip">http://www.go-mono.com/archive/glib-2.0.4-20020703.zip</a> <br>
+ <a href="http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip">http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip</a> <br>
+ <a href="http://www.go-mono.com/archive/libiconv-1.7.zip">http://www.go-mono.com/archive/libiconv-1.7.zip</a> <br>
+ <a href="http://www.go-mono.com/archive/libiconv-dev-1.7.zip">http://www.go-mono.com/archive/libiconv-dev-1.7-20020101.zip</a> <br>
+ <a href="http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip">http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip</a><br>
+
+
+ * Download the Mono source code from the
+ <a href="download.html">packaged versions</a> or
+ the <a href="http://www.go-mono.com/snapshots">
+ nightly snapshots</a> or the <a href="anoncvs.html">
+ Anonymous CVS</a>. The nightly snapshots are done every
+ night at 10pm EST (Boston Time). The nightly snapshots are
+ not guaranteed to build, but most of the time they should.
+ </ul>
+
+
+*** Notes on compiling GLIB 2.0 and pkg-config from source:
+
+
+ <ul>
+
+ * Some people observed problems with autoconf 2.52. Installing
+ autoconf 2.13 helped in those cases (don't forget to do a
+ `make maintainer-clean' after the update).
+
+ * Download, compile and install <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a> from source.
+ (I had to change line 674 of
+ <nobr><tt>pkg-config-0.8.0/glib-1.2.8/gstrfuncs.c</tt></nobr> from
+ <nobr><tt>extern char *strsignal (int sig);</tt></nobr> to
+ <nobr><tt>extern const char *strsignal (int sig);</tt></nobr>.
+
+<pre class="shell">
+tar xzvf pkg-config-0.8.0.tar.gz
+cd pkg-config-0.8.0
+./configure --prefix=/usr
+make
+make install
+</pre>
+
+ * Download, compile and install <a href="ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.7.tar.gz">libiconv</a> from source.<br>
+ If you dont have MS Visual C/C++ 4.0 or 5.0 or 6.0 you can also try
+ the binary package available at <a
+ href="http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip">
+ http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.bin.woe32.zip</a>
+
+
+ * Download, compile and install the
+ <a href="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.6.tar.gz">
+ glib 2.0</a> from source.
+
+ </ul>
+
diff --git a/web/contact b/web/contact
index 74e09d9a195..d9bbda12540 100644
--- a/web/contact
+++ b/web/contact
@@ -9,5 +9,5 @@
href="http://primates.ximian.com/~miguel">http://primates.ximian.com/~miguel"</a>
You can also <a
- href="http://www.ximian.com/about/contact.php3">reach Ximian.</a>
+ href="http://www.ximian.com/about_us/contact/">reach Ximian.</a>
diff --git a/web/contributing b/web/contributing
index ffadd989e98..0a80bcb91b1 100644
--- a/web/contributing
+++ b/web/contributing
@@ -1,18 +1,51 @@
* Contributing to the Mono project
- There are many ways in which you can help in the Mono project:
-
- <ul>
- * <b>Programmers:</b> You can work on a free
- implementation of the <a
- href="class-library.html">class libraries</a>, the
- <a href="runtime.html">runtime engine</a>, <a
- href="tools.html">the tools</a>, the <a
- href="testing.html">testing framework</a>
-
- * <b>Writers:</b> You can help us bywriting <a
- href="documentation.html">documentation</a>.
- </ul>
+ Mono has not been completed yet. It is a project under
+ active development and with a vibrant community. If you are
+ looking at ways of helping the project, you have come to the
+ right web page.
+
+ There are three different philosophical approaches to helping
+ the Mono project, the selfish way, the altruistic or the
+ educational way.
+
+ The <b>selfish</b> way is packed with adventure. You start by
+ building your own software, and start using the compiler and
+ tools that come with Mono. Eventually you will run into
+ missing features, or a bug in the software. Since we ship all
+ the source code for Mono, you can start tracking down the
+ problem. Depending on how much time you have to devote to the
+ problem you could: <a href="http://bugzilla.ximian.com">File a
+ bug report</a> (read <a href="#goodbugreport">this</a>); track
+ down the problem and provide a better
+ <a href="http://bugzilla.ximian.com">bug report</a>; fix the
+ bug and provide a patch (you can <a
+ href="mailto:mono-list@ximian.com">post it</a> to the <a
+ href="http://lists.ximian.com/mailman/listinfo/mono-list">mono
+ mailing list</a>; or discuss the solution on the mailing
+ list. Ideally you will also write a <a
+ href="testing.html">regression test</a> so the bug does not
+ get re-introduced in the future.
+
+ The <b>altruistic</b> is probably the easiest because you get
+ to pick a piece of Mono that you might want to work on. You
+ can pick an unfinished <a href="class-library.html">class</a> (from our <a
+ href="class-status.html">class status page</a>); help with the
+ <a href="documentation.html">documentation effort</a> (<a
+ href="http://lists.ximian.com/mailman/listinfo/mono-docs-list">mailing
+ list for the documentation effort</a>); fix existing <a
+ href=http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FRuntime&component=CORLIB&component=misc&component=System&component=System.Web&component=System.XML&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">runtime
+ bugs</a>; <a
+ href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FMCS&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time&form_name=query">compiler
+ bugs</a>; help with the <a href="tools.html">tools</a> or
+ writing <a href="testing.html">tests</a> that help make Mono
+ more robust or help with the <a
+ href="http://www.go-mono.com/winforms.html">Winforms
+ effort</a>.
+
+ The <b>educational</b> way is an interesting one, because you
+ pick a technology you are interested in, and work on that
+ technology to learn the technology.
Those are just broad things that need to be worked on, but
something that would help tremendously would be to help with
@@ -20,6 +53,11 @@
You can see what needs to be done in the class libraries <a href="class-status.html">here</a>
+* IRC Channel
+
+ Many developers get together on the <b>#mono</b> irc channel
+ on the <b>irc.gnome.org</b> server.
+
** To start contributing
As a programmer, you can contribute in three different scenarios to Mono:
@@ -61,7 +99,7 @@
world that only has a test suite.
To get started writing tests see the <a href="testing.html">Test Suite</a>
- section. <a href="mono-contribution-howto">Here</a> there is a good All-In-One introduction to the art of writing tests.
+ section. <a href="mono-contribution-howto.html">Here</a> there is a good All-In-One introduction to the art of writing tests.
*** Contributing to the runtime engine
@@ -90,6 +128,53 @@
You can review the list of current bugs by going <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FMCS&product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=%27Importance%27&form_name=query">here</a>
+ Check our <a href="bugs.html">Bugs</a> that contains links to
+ easily add a bug report, or to query the existing bugs.
+
+<a name="goodbugreport"/>
+** How to make good bug reports
+
+ A mail from Paolo to mono-devel-list contained this check list:
+ <ol>
+ * Submit a test case, the smaller it is, the better
+
+ * Use <a href="http://bugzilla.ximian.com">
+ http://bugzilla.ximian.com</a> to report the bug.
+
+ <p>In <b>addition</b> to bugzilla, posting to the list is
+ fine if the bug merits larger exposure or design
+ discussions to solve; posting to the list twice or more
+ is just a way to annoy people and make them waste time,
+ specially when you start a new thread about it.
+
+ * If the test involves libraries or assemblies that are
+ not part of mono, add info about where to download all
+ the dependencies, and how to compile/install them.
+
+ * If compiling the test case requires more than:
+ <pre> mcs test.cs </pre>
+ provide the <b>full command line</b> you used to compile
+ the test.
+
+ * If running the test requires more than:
+ <pre> mono test.exe </pre>
+ provide the <b>full command line</b> needed to replicate
+ the bug.
+
+ * Provide info about the version of the software you're
+ using (both mono and the operating system or relevant
+ libraries).
+
+ * Provide the output you expect the test case to produce.
+
+ * Provide the actual output <b>you</b> get from the test case.
+ </ol>
+
+ A good bug report complies with at least 6 items from the list.
+ If your bug report complies with 3 or less items, it is very
+ poor and it means it will take much more time to fix (when it's
+ not ignored).
+
** Small tasks
A few smaller tasks are here, dropped in no particular order:
diff --git a/web/crypto b/web/crypto
new file mode 100644
index 00000000000..56fbde78316
--- /dev/null
+++ b/web/crypto
@@ -0,0 +1,335 @@
+* Cryptography
+
+ In the .NET framework cryptography can be found under a number of
+ namespaces in several assemblies. Mono also has it's own assemblies
+ to provide missing security functionalities from the .NET framework.
+
+** Assembly: corlib
+
+*** Namespace: <b>System.Security.Cryptography</b>
+
+ Thanks to the work of many people this namespace is almost complete.
+
+**** Status
+ <ul>
+ * All classes are present. Most of them have (minimal)
+ documentation in <b>monodoc</b>.
+
+ * Most classes have their unit tests. Some tests like <code>
+ SymmetricAlgorithmTest</code> are generated by external
+ tools.
+ </ul>
+
+*** Namespace: <b>System.Security.Cryptography.X509Certificates</b>
+
+**** Status
+ <ul>
+ * X.509 certificates are parsed using 100% managed code
+ (using the Mono.Security.ASN1 class).
+
+ * Software Publisher Certificates (SPC) used by Authenticode
+ (tm) to sign assemblies are supported and <b>minimally</b>
+ validated.
+
+ * Unit tests are generated from a set of existing certificates
+ (about a dozen) each having different properties. Another
+ set of certificates (more than 700) are used for a more
+ complete test (but isn't part of the standard test suite for
+ size and time consideration, i.e. a 7.5Mb C# source file).
+ </ul>
+
+**** Notes
+ <ul>
+ * The class Mono.Security.X509.X509Certificate (in Mono.Security
+ assembly) is becoming a much better alternative - and will
+ continue to evolve to support the security tools.
+ </ul>
+
+<hr>
+** Assembly: System.Security
+
+*** Namespace: <b>System.Security.Cryptography.Xml</b>
+
+ This namespace implements the <a href="http://www.w3.org/TR/xmldsig-core/">
+ XML Digital Signature</a> specification from
+ <a href="http://www.w3.org/">W3C</a>.
+
+**** Status
+ <ul>
+ * We pass the fifteen tests from Merlin's xmldsig suite with
+ success. Which is funny because Microsoft fails in one case
+ where both a X509Certificate and an X509CRL are present in
+ an X509Data. We also pass most Phaos tests.
+
+ * Most classes have their unit tests. Some standalone tests
+ are also in CVS to test C14N and both Merlin and Phaos test
+ suites.
+ </ul>
+
+<hr>
+** Assembly: Mono.Security
+
+ <b>Rational: </b>
+ This assembly provides the missing pieces to .NET security. On Windows
+ CryptoAPI is often used to provide much needed functionalities (like
+ some cryptographic algorithms, code signing, X.509 certificates). Mono,
+ for platform independance, implements these functionalities in 100%
+ managed code.
+
+*** Namespace: Mono.Security
+ <ul>
+ * Structures (ASN1, PKCS7) and primitives (PKCS1).
+ </ul>
+*** Namespace: Mono.Security.Authenticode
+ <ul>
+ * Code signing and verification.
+ * Support for SPC (Software Publisher Certificate) files and
+ PVK (Private Key) files.
+ </ul>
+*** Namespace: Mono.Security.Cryptography
+ <ul>
+ * Additional algorithms: MD2, MD4, ARCFOUR (required for SSL)
+ * Convertion helpers
+ </ul>
+*** Namespace: Mono.Security.Protocol.*
+ <ul>
+ * Tls: An 100% managed SSLv3 and TLSv1 implementation from
+ Carlos Guzman Alvarez.
+ * Ntlm: NTLM authentication (used for HTTP and SQL Server).
+ </ul>
+*** Namespace: Mono.Security.X509.*
+ <ul>
+ * X.509 structures (certificate, CRL...) building and decoding.
+ * PKCS#12 decoding and encoding.
+ * X.509 extensions (from public X.509 to private PKIX, Netsapce,
+ Microsoft, Entrust...).
+ </ul>
+
+**** Status
+ <ul>
+ * A big part of this assembly is also included inside Mono's
+ corlib. The classes are duplicated in this assembly so the
+ functionalities can be used without a dependency on Mono's
+ corlib (which depends on Mono's runtime).
+
+ * Unit test coverage isn't (yet) complete.
+
+ * Most classes have minimal documentation available in
+ <b>monodoc</b>.
+ </ul>
+
+<hr>
+** Assembly: Mono.Security.Win32
+
+ <b>Rational: </b>
+ This assembly goal is to provide maximum compatibility with CryptoAPI
+ to application running with Mono's runtime on the Windows operating
+ system.
+
+ <b>This assembly should NEVER be used directly by any application</b>
+ (e.g. referecing the assembly from a project).
+ The classes should only be used by modifying the <code>machine.config
+ </code> configuration file (and then only if this increased
+ compatibility is required by an application).
+
+ See the file <code><a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/~checkout~/mcs/class/Mono.Security.Win32/README?rev=1.1&content-type=text/plain&cvsroot=mono">/mcs/class/Mono.Security.Win32/README</a></code>
+ for complete instructions.
+
+*** Namespace: Mono.Security.Cryptography
+
+**** Status
+ <ul>
+ * A RNGCryptoServiceProvider built on top of CryptoAPI.
+
+ * Wrapper classes for unmanaged versions of hash algorithms:
+ MD2, MD4, MD5 and SHA1 are supported. <b>note</b>: some
+ algorithms shouldn't be used in new design (MD4 is broken,
+ MD2 and MD5 aren't considered safe for some usage). They are
+ included to preserve interoperability with older applications
+ (e.g. some old, but still valid, X.509 certificates use MD2,
+ MD4 is required for NTLM authentication ...).
+
+ * Classes have minimal documentation available in
+ <b>monodoc</b>.
+ </ul>
+
+**** TODO
+ <ul>
+ * Wrapper classes for unmanaged versions of symmetric
+ encryption algorithms (like DES, TripleDES, RC2 and others
+ present in default CSP).
+
+ * Wrapper classes for unmanaged versions of asymmetric
+ algorithms (like DSA and RSA) which persist their keypair
+ into the specified CSP.
+ </ul>
+
+**** Ideas
+ <ul>
+ * Similar assemblies (e.g. <code>Mono.Security.XXX</code>)
+ could be created for <a href="http://www.openssl.org">OpenSSL</a>,
+ <a href="http://www.mozilla.org/projects/security/pki/nss/">NSS</a>,
+ <a href="http://www.eskimo.com/~weidai/cryptlib.html">crypto++</a>,
+ <a href="http://www.cryptlib.orion.co.nz/">cryptlib</a> ... for
+ improved performance and/or HSM (Hardware Security Module) support
+ under Linux and/or Windows.
+ </ul>
+<hr>
+** Assembly: Microsoft.Web.Services
+
+ Microsoft Web Service Enhancement (WSE), known as Web Service
+ Development Kit (WSDK) in it's beta days, is an add-on the .NET
+ framework that implements WS-Security (and other WS-* specifications).
+ It also includes improved support for XML Signature (replacing and/or
+ extending <code>System.Security.Cryptography.Xml</code>) and X.509
+ certificates classes.
+
+ Note: WSE is distributed as an add-on because some specifications,
+ like WS-Security, aren't yet completed by
+ <a href="http://www.oasis-open.org/committees/wss/">OASIS</a> or
+ other committees.
+
+*** Namespace: Microsoft.Web.Services.Security
+
+**** Status
+ <ul>
+ * Most WSE 1.0 classes are implemented.
+ </ul>
+
+**** TODO
+ <ul>
+ * Some classes from System.Security assembly need to be
+ duplicated (and somewhat fixed) in WSE for XMLDSIG.
+
+ * There are still missing classes and <b>many</b> missing
+ unit tests.
+ </ul>
+
+
+*** Namespace: Microsoft.Web.Services.Timestamp
+
+**** Status
+ <ul>
+ * This seems complete for WSE 1.0 but some new classes were
+ introduced in WSE 2.0.
+ </ul>
+
+*** Namespace: Microsoft.Web.Services.Security.X509
+
+**** Status
+ <ul>
+ * X509Certificate support is complete for both WSE 1.0 and 2.0.
+ </ul>
+
+**** TODO
+ <ul>
+ * We need to define certificate stores (for both users and
+ machines). These sames stores must be linked with asymmetric
+ keypairs. This could also be used to store the SPC roots.
+ </ul>
+
+*** Notes
+ <ul>
+ * Microsoft has released WSE 2.
+ </ul>
+
+<hr>
+** Tools
+
+ There are many tools in the .NET framework that indirectly interacts
+ with some cryptographic classes. Unless noted the tools should work on
+ any CLR (tested with both Mono and Microsoft).
+
+**** Status
+
+ The following tools are complete (or mostly complete):
+ <ul>
+ * <code>secutil</code> is a tool to extract certificates and
+ strongnames from assemblies in a format that can be easily
+ re-used in source code (C# or VB.NET syntax).
+
+ * <code>cert2spc</code> is a tool to transform multiple X.509
+ certificates and CRLs into a Software Publisher Certificate
+ (SPC) file - which is a long name for a simple PKCS#7 file.
+
+ * <code>makecert</code> to create X.509 test certificates that
+ can be used (once transformed in SPC) to sign assemblies. It's
+ now possible to generate SSL certificates for web servers.
+
+ * <code>sn</code> is a clone of the <code>sn</code> to manage
+ strongnames. Current version can create, convert, sign and
+ verify strongnames signatures. Some configuration options
+ are still missing, some will only works with Mono.
+
+ * <code>signcode</code> and <code>chktrust</code> for signing
+ and validating Authenticode(tm) signatures on assemblies (or
+ any PE file) are now working (signature and timestamps) but
+ some options aren't yet supported.
+
+ * <code>setreg</code> can change some cryptographic parameters
+ of the runtime. Currently it can add or remove two root test
+ certificates (the one used by Mono's <code>makecert</code>,
+ the other used by Microsoft's <code>makecert</code>).
+
+ * <code>certmgr</code> can add and remove certificates from
+ the stores. Most common use is to add new trusted certificates
+ or remove them.
+ </ul>
+
+ Somewhat usable, somewhat incomplete:
+ <ul>
+ * <code>certview</code> is a certificate viewer for
+ <code>System.Windows.Forms</code> (right now only working on
+ Windows), while <code>gcertview</code> is the same viewer
+ implemented for GTK# (working on both Windows and Linux).
+ </ul>
+
+
+**** TODO
+ The following tools are still missing or largely incomplete:
+ <ul>
+ * Other tools like a, GUI-based, certificate manager...
+ </ul>
+
+ Note that many of the tools requires the class library and/or the
+ runtime to be ready for them. E.g. StrongName and Authenticode signatures
+ tools are of limited use until supported by the runtime.
+
+<hr>
+** References
+
+ <ul>
+ * RSA Laboratories' <a href="http://www.rsasecurity.com/rsalabs/faq/index.html">
+ Frequently Asked Questions</a> About Today's Cryptography, Version 4.1
+
+ * Public-Key Cryptography Standards (<a href="http://www.rsasecurity.com/rsalabs/pkcs/index.html">
+ PKCS</a>)
+
+ * National Institute of Standards and Technology - Federal
+ Information Processing Standards <a href="http://csrc.nist.gov/publications/fips/index.html">
+ NIST FIPS</a>
+ </ul>
+
+<hr>
+** How to Help
+
+ <ul>
+ * Complete any of the TODO (and feel good about it ;-).
+
+ * Analyse the current coverage of the unit tests on the
+ cryptographic classes and complete the unit tests. <b><code>
+ monocov</code> does a great job at this! Now we just need to
+ complete the missing unit tests.</b>
+
+ * Optimization can also be done on most algorithms as crypto
+ is never fast enough. Some have been done using the
+ Community Edition of BoundChecker (a free VisualStudio
+ addon) - recommanded! Just be sure to test every optimization
+ (using the unit tests) carefully - it's so fast to break an
+ algorithm ;-).
+
+ * Write some documentation or add some sample code for the
+ cryptographic classes in <b>monodoc</b>.
+ </ul>
+<hr>
+Last reviewed: June 26, 2004 (mono release candidate 1)
diff --git a/web/delegate b/web/delegate
new file mode 100644
index 00000000000..8d2a77151e6
--- /dev/null
+++ b/web/delegate
@@ -0,0 +1,23 @@
+* Your Delegate Has Been Garbage Collected.
+
+ The program that you are running passed a delegate into the
+ unmanaged world but failed to keep a reference to this
+ delegate in the managed world, so the delegate was garbage
+ collected.
+
+ This means that the the delegate is no longer valid, but the
+ unmanaged library or unmanaged code tried to call it.
+
+ To fix this problem make sure that you keep a handle to the
+ delegate that you are passing into the unmanaged world.
+
+ This happens since Mono has no visibility into the unmanaged
+ world and it does not know that the unmanaged world has kept a
+ reference to your delegate. As far as the Mono runtime is
+ concerned the delegate must be garbage collected.
+
+ For more information see:
+
+ <a href="http://blogs.msdn.com/dangriff/archive/2003/11/19/51709.aspx">http://blogs.msdn.com/dangriff/archive/2003/11/19/51709.aspx</a>
+
+
diff --git a/web/documentation b/web/documentation
index 4ed2e6a6639..40085e85126 100644
--- a/web/documentation
+++ b/web/documentation
@@ -14,26 +14,219 @@
<ul>
* The development tools (compilers, assembler tools,
- language reference, design time features).
+ language reference, design time features): these
+ live in the `monodoc' CVS module.
* Frequently Asked Question compilations.
* HOWTO documents.
- * The Class Libraries
+ * The Class Libraries (Both the original .NET class
+ libraries as well as the class libraries produced by
+ the project).
- * Tutorials on Mono and the specifics of running it.
+ * Tutorials on Mono and the specifics of running it
+ (The <a href="http://www.monohispano.org">Mono
+ Hispano</a> team has produced lots of <a
+ href="http://www.monohispano.org/tutoriales.php">tutorials
+ in spanish</a>
* A guide to Mono as compared to the Microsoft.NET
Framework SDK
</ul>
-** Class Library documentation
+* Class Library documentation
We are moving to a new setup for documenting the class libraries,
and you can read about it <a href="classlib-doc.html">here</a>.
+ There are two classes of documentation: free documentation for
+ existing .NET classes and documentation for the classes that
+ we have developed on top of .NET.
+
+ There is a large body of documentation that came from the ECMA
+ standarization effort that has been checked into CVS. It does
+ not contain everything Mono and .NET have, so they need to be
+ updated and augmented.
+
+** Gtk# documentation
+
+ We also have a large body of class libraries that are specific
+ to Mono, for example the documentation for Gtk#.
+
+ We have checked in stub documentation for Gtk# into the CVS
+ repository (on gtk-sharp/doc) and we need volunteers to help
+ populate the documentation for it. Since Gtk# is a wrapper
+ for Gtk, plenty of documentation exists in the <a
+ href="http://developer.gnome.org/doc/API">Gnome developer
+ site</a>.
+
+ To get started:
+
+ You need to download Gtk# from the CVS repository. The module
+ name is `gtk-sharp'. You can obtain a copy from both the CVS
+ repository or the anonymous CVS repository.
+
+ To pull your copy type:
+
+<pre>
+ cvs co gtk-sharp
+</pre>
+ Documentation lives in gtk-sharp/doc/en. The "en" indicates the
+ English language, the first one we are targeting. We can later
+ do translations, but for now we are focusing on a single
+ language.
+
+ In that directory you will find the documentation organized by
+ namespaces. One directory per namespace. In the directories
+ you will find one XML file per class that needs to be
+ documented. The mission is to fill in the data with useful
+ information. Feel free to grab liberally information from the
+ Gtk documentation from:
+
+ <a href="http://developer.gnome.org/doc/API/">http://developer.gnome.org/doc/API/</a>
+
+ Of course, the API does not apply directly. It only applies at
+ a foundational level, so you can not really just copy and
+ paste. Summaries, and remarks sections can probably be lifted
+ with little or no effort.
+
+ Gtk# uses properties to represent get/set operations in the C
+ API, so you can also use some bits from there.
+
+ Most of the documentation contains already place holders for
+ text, we use the internationally approved phrase for this
+ purpose, `To be added'. So the quest is to remove all of the
+ "To be added" strings with information with resembles as closely
+ as possible the toolkit reality.
+
+*** The pieces to be filled.
+
+ Summaries are one or two line descriptions of the element
+ (class, struct, interface, method, field, event, delegate), and
+ its used to render summary pages. So it has to be short.
+
+ The "remarks" section is used to describe in detail the element.
+
+**** Tags.
+
+ As you document Gtk# you will have a number of tags that you can
+ use inside the summary and remarks sections, these are:
+
+<pre>
+&lt;para&gt; &lt;/para&gt;
+</pre>
+ Used to separate paragraphs.
+
+<pre>
+&lt;paramref name="param_name"/&gt;
+</pre>
+ Used to reference a formal parameter to a function.
+
+<pre>
+&lt;see cref="T:SomeTypeName"/&gt;
+</pre>
+ Use this to reference a type, this will include an hyper
+ link to the page for type SomeTypeName.
+
+ For example, to reference "System.Enum", do:
+
+<pre>
+ &lt;see cref="T:System.Enum"/&gt;
+</pre>
+
+<pre>
+&lt;see cref="P:SomeTypeName.Property"/&gt;
+</pre>
+ Use this to reference a property, this will include an hyper
+ link to the page for the property `Property' of type `SomeTypeName'.
+
+ For example, to reference the BaseType property in System.Type, do:
+
+<pre>
+ &lt;see cref="P:System.Type.BaseType"/&gt;
+</pre>
+
+<pre>
+&lt;see cref="M:SomeTypeName.Method(type,type)"/&gt;
+</pre>
+ Use this to reference a method, this will include an hyper
+ link to the page for the method `Method' of type `SomeTypeName'.
+
+ For example, to reference the ToString method in System.Object, do:
+
+<pre>
+ &lt;see cref="M:System.Object.ToString()"/&gt;
+</pre>
+
+<pre>
+&lt;see langword="keyword"/&gt;
+</pre>
+ Use this to link to a keyword in the C# language, for
+ example to link to `true', do:
+
+<pre>
+ &lt;see langword="true"/&gt;
+</pre>
+
+<pre>
+&lt;example&gt; ... &lt;/example&gt;
+</pre>
+ Use example to insert an example. The example can
+ contain explanatory text and code.
+
+<pre>
+&lt;code lang="C#"&gt;.. &lt;/code&gt;
+</pre>
+
+ Use this to provide a sample C# program, typically used
+ within the &lt;example&gt; tags.
+
+ When providing examples, try to provide a full example,
+ we would like to be able to have a button to compile and
+ run samples embedded into the documentation, or pop up
+ an editor to let the user play with the sample.
+
+ You can link to an example like this:
+
+<pre>
+ &lt;code lang="C#" source="file.cs"&gt; &lt;/code&gt;
+</pre>
+
+<pre>
+&lt;item&gt;
+</pre>
+
+<pre>
+&lt;list type="bullet"&gt; &lt;/list&gt;
+</pre>
+
+ Use this to create lists. Lists contains &lt;item&gt;
+ elements which have to contain &lt;term&gt; containers.
+
+<pre>
+&lt;list type="table"&gt; &lt;/lits&gt;
+ &lt;listheader&gt;
+ &lt;term&gt;YOUR FIRST COLUMN&lt;/term&gt;
+ &lt;description&gt;YOUR DESCRIPTION&lt;/description&gt;
+ &lt;/listheader&gt;
+</pre>
+ For two-column tables. Inside use:
+
+<pre>
+&lt;item&gt;
+ &lt;term&gt;First&lt;/term&gt;
+ &lt;description&gt;First descritpion&lt;/description&gt;
+&lt;/item&gt;
+&lt;item&gt;
+ &lt;term&gt;Second&lt;/term&gt;
+ &lt;description&gt;Second descirption&lt;/description&gt;
+&lt;/item&gt;
+</pre>
+
+** Words of warning.
+
A few words of warning and advice for class documentors:
A well-documented API can ease hours of frustration; as Mono
@@ -57,6 +250,11 @@
please don't open the Microsoft docs and refer to them for each member
you document.
+ The best way of documenting is to read our source code
+ implementation and explain in your own words what our implementation
+ does, and what the user can do with it.
+
There's a lot of domain expertise among the class library contributors;
let's put the same personal stamp on the class library documentation
- that we have on the class libraries themselves. \ No newline at end of file
+ that we have on the class libraries themselves.
+
diff --git a/web/download b/web/download
index c4eff0e7c18..3992312f61f 100644
--- a/web/download
+++ b/web/download
@@ -1,381 +1,1984 @@
* Software Availability
The Virtual Execution System is available in package `mono'.
- Currently this contains a metadata library and the
- disassembler. Please refer to our <a
- href="runtime.html">Runtime</a> description for more details
- on this part of the project.
-
- The code for the C# compiler as well as the language error
- test suite and the class library are in the `mcs' package, we
- will move this later into `mono' itself.
-
- In order to make mcs and the class libraries you will need a computer
- running Windows with the <strong>GNU make tools</strong> from the
- <strong>Cygwin</strong> environment, <strong>Microsoft's .NET Framework
- SDK</strong>, <strong>GLIB 2.0</strong> and
- <strong>pkg-config</strong>.
-
- When installing Cygwin, don't forget to include
- <tt>mingw-runtime</tt>. If you omit this, you will encounter
- configure problems regarding not being able to generate
- executables.
-
-<a name="sources">
-*** Sources
-
- Stay up to date on the Mono team's development using the
- <a href="http://lists.ximian.com/mailman/listinfo/mono-cvs-list">
- mono-cvs-list</a> mailing list. The CVS source code can also
- be browsed <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?cvsroot=Mono#dirlist">here</a>
-
-<a name="jun-7">
- <b>Mono 0.12</b>
-
- New packaged versions of the Mono C# compiler and Mono runtime
- are now available. The latest version is 0.12.
+ Please refer to our <a href="runtime.html">Runtime</a>
+ description for more details on this part of the project.
+
+ Optional packages are `libgdiplus' (if you want to do
+ graphics), `winelib' (if you want to run the alpha winforms
+ support). The package `mcs' contains the C# source code to
+ the compilers and class libraries.
+
+ To run ASP.NET applications you need xsp and if you want to
+ optionally integrate with Apache, get mod_mono.
+
+ Online API documentation for Mono is available in the `monodoc' package.
+
+ Gtk# is package to build GUI applications with the Gtk+ toolkit.
+
+ The software is also available on the `Mono' channel in <a href="http://www.ximian.com/products/redcarpet/">Red Carpet</a>.
+
+ Packagers can find RPM Spec files and other resources in the <a
+ href="http://www.go-mono.com/packagers/">packagers page</a>.
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Mono 1.0</b><br>
+ <a href="archive/1.0/index.html">Release notes</a><br>
+ June 30th, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/1.0/mono-1.0.tar.gz">Mono Runtime 1.0</a>
+ <li><a href="archive/1.0/mcs-1.0.tar.gz">Mono Class Libraries and C# Compiler 1.0</a>
+ <li><a href="archive/1.0/libgdiplus-1.0.tar.gz">libgdiplus 1.0</a>
+ <p>
+ <li><a href="archive/1.0/monodoc-1.0.tar.gz">MonoDoc 1.0</a>
+ <li><a href="archive/1.0/xsp-1.0.tar.gz">XSP web server 1.0</a>
+ <li><a href="archive/1.0/mod_mono-1.0.tar.gz">Apache Mono module 1.0</a>
+ <p>
+ <li><a href="archive/1.0/winelib-0.3.tar.gz">Winelib 0.3</a>
+ <p>
+ <li><a href="archive/1.0/gtk-sharp-1.0.tar.gz">Gtk# 1.0</a>
+ <li><a href="archive/1.0/gecko-sharp-0.5.tar.gz">Gecko# 0.5</a>
+ <li><a href="archive/1.0/gtksourceview-sharp-0.5.tar.gz">Gtk SourceView# 0.5</a>
+ <li><a href="archive/1.0/monodevelop-0.5.tar.gz">MonoDevelop IDE 0.5</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/1.0/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/1.0/fedora-1-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-1-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 2/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/1.0/fedora-2-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-2-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SLES 8/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/1.0/sles-8-i386/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/1.0/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9.1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/1.0/suse-91-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <div align="left"><img src="images/windows-36.gif"></div>
+ <div align="right"><b>Windows installer</b><br><small>Win2k and above</small></div>
+ </td>
+ <td>
+ <a href="archive/1.0/windows/mono-1.0-win32-1.exe">Mono Setup</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/macos-36.gif"><b>Mac OS X package</b>
+ </td>
+ <td>
+ <a href="archive/1.0/macos/MonoFramework-1.0.dmg">MonoFramework-1.0.dmg</a> in /Library/Framework
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <hr>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release Candidate</b><br>
+ <!-- <a href="archive/beta3/beta3.html">Release notes</a><br> -->
+ June 25th, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/rc/mono-0.97.tar.gz">Mono Runtime 0.97</a>
+ <li><a href="archive/rc/mcs-0.97.tar.gz">Mono Class Libraries and C# Compiler 0.97</a>
+ <li><a href="archive/rc/libgdiplus-0.10.tar.gz">libgdiplus 0.10</a>
+ <p>
+ <li><a href="archive/rc/monodoc-0.18.tar.gz">MonoDoc 0.18</a>
+ <li><a href="archive/rc/xsp-0.16.tar.gz">XSP web server 0.16</a>
+ <li><a href="archive/rc/mod_mono-0.13.tar.gz">Apache Mono module 0.13</a>
+ <p>
+ <li><a href="archive/rc/gtk-sharp-0.99.tar.gz">Gtk# 0.99</a>
+ <!-- <li><a href="archive/rc/gecko-sharp-0.5.tar.gz">Gecko# 0.5</a> -->
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/rc/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/rc/fedora-1-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-1-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 2/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/rc/fedora-2-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-2-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SLES 8/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/rc/sles-8-i386/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/rc/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9.1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/rc/suse-91-i586/">Packages</a>
+ </td>
+ </tr>
+<!-- <tr> -->
+<!-- <td bgcolor="#999999"> -->
+<!-- <div align="left"><img src="images/windows-36.gif"></div> -->
+<!-- <div align="right"><b>Windows installer</b><br><small>Win2k and above</small></div> -->
+<!-- </td> -->
+<!-- <td> -->
+<!-- <a href="archive/beta3/windows/mono-Beta3-win32-1.exe">Mono Setup</a> -->
+<!-- </td> -->
+<!-- </tr> -->
+<!-- <tr> -->
+<!-- <td bgcolor="#999999"> -->
+<!-- <img src="images/macos-36.gif"><b>Mac OS X package</b> -->
+<!-- </td> -->
+<!-- <td> -->
+<!-- <a href="archive/beta3/macos/mono-0.96.dmg">mono-0.96.dmg</a> in /opt. -->
+<!-- <br/><br/> -->
+<!-- <a href="archive/beta3/macos/MonoFramework-0.96.dmg">MonoFramework-0.96.dmg</a> in /Library/Framework -->
+<!-- </td> -->
+<!-- </tr> -->
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Beta 3</b><br>
+ <!-- <a href="archive/beta3/beta3.html">Release notes</a><br> -->
+ June 15th, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/beta3/mono-0.96.tar.gz">Mono Runtime 0.96</a>
+ <li><a href="archive/beta3/mcs-0.96.tar.gz">Mono Class Libraries and C# Compiler 0.96</a>
+ <li><a href="archive/beta3/libgdiplus-0.9.tar.gz">libgdiplus 0.9</a>
+ <p>
+ <li><a href="archive/beta3/monodoc-0.17.tar.gz">MonoDoc 0.17</a>
+ <li><a href="archive/beta3/xsp-0.15.tar.gz">XSP web server 0.15</a>
+ <li><a href="archive/beta3/mod_mono-0.11.tar.gz">Apache Mono module 0.11</a>
+ <p>
+ <li><a href="archive/beta3/gtk-sharp-0.98.tar.gz">Gtk# 0.98</a>
+ <li><a href="archive/beta3/gecko-sharp-0.5.tar.gz">Gecko# 0.5</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta3/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta3/fedora-1-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-1-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 2/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta3/fedora-2-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-2-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SLES 8/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta3/sles-8-i386/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta3/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9.1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta3/suse-91-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <div align="left"><img src="images/windows-36.gif"></div>
+ <div align="right"><b>Windows installer</b><br><small>Win2k and above</small></div>
+ </td>
+ <td>
+ <a href="archive/beta3/windows/mono-Beta3-win32-1.exe">Mono Setup</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/macos-36.gif"><b>Mac OS X package</b>
+ </td>
+ <td>
+ <a href="archive/beta3/macos/mono-0.96.dmg">mono-0.96.dmg</a> in /opt.
+ <br/><br/>
+ <a href="archive/beta3/macos/MonoFramework-0.96.dmg">MonoFramework-0.96.dmg</a> in /Library/Framework
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Beta 2</b><br>
+ <a href="archive/beta2/beta2.html">Release notes</a><br>
+ June 1st, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/beta2/mono-0.95.tar.gz">Mono Runtime 0.95</a>
+ <li><a href="archive/beta2/mcs-0.95.tar.gz">Mono Class Libraries and C# Compiler 0.95</a>
+ <li><a href="archive/beta2/libgdiplus-0.8.tar.gz">libgdiplus 0.8</a>
+ <li><a href="archive/beta2/winelib-0.3.tar.gz">winelib 0.3</a>
+ <p>
+ <li><a href="archive/beta2/monodoc-0.16.tar.gz">MonoDoc 0.16</a>
+ <li><a href="archive/beta2/xsp-0.14.tar.gz">XSP web server 0.14</a>
+ <li><a href="archive/beta2/mod_mono-0.10.tar.gz">Apache Mono module 0.10</a>
+ <p>
+ <li><a href="archive/beta2/gtk-sharp-0.93.tar.gz">Gtk# 0.93</a>
+ <li><a href="archive/beta2/gecko-sharp-0.4.tar.gz">Gecko# 0.4</a>
+ <p>
+ <li><a href="archive/beta2/monodevelop-0.4.tar.gz">MonoDevelop 0.4</a>
+ <li><a href="archive/beta2/gtksourceview-sharp-0.3.tar.gz">GtkSourceView# 0.93</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta2/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta2/fedora-1-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-1-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 2/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta2/fedora-2-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/yum-repository/fedora-2-i386">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SLES 8/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta2/sles-8-i386/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta2/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9.1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta2/suse-91-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <div align="left"><img src="images/windows-36.gif"></div>
+ <div align="right"><b>Windows installer</b><br><small>Win2k and above</small></div>
+ </td>
+ <td>
+ <a href="archive/beta2/windows/mono-Beta2-win32-1.exe">Mono Setup</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/macos-36.gif"><b>Mac OS X package</b>
+ </td>
+ <td>
+ <a href="archive/beta2/macos/Mono_0.95_Beta_2.dmg">Mono_0.95_Beta_2.dmg</a>: on /Library/Framework.<br>
+ <a href="archive/beta2/macos/mono-0.95.dmg">mono-0.95.dmg</a> On /opt.
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Beta 1</b><br>
+ <a href="archive/beta1/beta1.html">Release notes</a><br>
+ May 5th, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/beta1/mono-0.91.tar.gz">Mono Runtime 0.91</a>
+ <li><a href="archive/beta1/mcs-0.91.tar.gz">Mono Class Libraries and C# Compiler 0.91</a>
+ <li><a href="archive/beta1/libgdiplus-0.5.tar.gz">libgdiplus 0.5</a>
+ <li><a href="archive/beta1/winelib-0.2.tar.gz">winelib 0.2</a>
+ <p>
+ <li><a href="archive/beta1/monodoc-0.15.tar.gz">MonoDoc 0.15</a>
+ <li><a href="archive/beta1/xsp-0.13.tar.gz">XSP web server 0.13</a>
+ <li><a href="archive/beta1/mod_mono-0.9.tar.gz">Apache Mono module 0.9</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta1/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta1/fedora-1-i386">Packages</a>
+ <p><a href="http://www.go-mono.com/archive/beta1/fedora-1-i386/">YUM Repository</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SLES 8/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta1/sles-8-i386/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta1/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9.1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/beta1/suse-91-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ </td>
+ <td>
+ <a href="archive/beta1/windows/mono-Beta1-win32-2.exe">Mono Setup</a>
+ Updated on May 12.
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/macos-36.gif"><b>Mac OS X package</b>
+ </td>
+ <td>
+ <a href="archive/beta1/macos/mono-0.91.mpkg.tar.gz">mono-0.91.mpkg.tar.gz</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.31</b><br>
+ <a href="archive/mono-0.31.html">Release notes</a><br>
+ Mar 18th, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.31.tar.gz">Mono Class Libraries and C# Compiler 0.31</a>
+ <li><a href="archive/mono-0.31.tar.gz">Mono Runtime 0.31</a>
+ <li><a href="archive/libgdiplus-0.2.tar.gz">libgdiplus 0.2</a>
+ <li><a href="archive/winelib-0.1.tar.gz">winelib 0.1</a>
+ <p>
+ <li><a href="archive/monodoc-0.13.tar.gz">MonoDoc 0.13</a>
+ <li><a href="archive/xsp-0.12.tar.gz">XSP web server 0.12</a>
+ <li><a href="archive/mod_mono-0.8.tar.gz">Apache Mono module 0.8</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.31/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.31/fedora-1-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.31/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/debian-36.gif"><b>Debian Packages</b><br>
+ </td>
+ <td>
+ <a href="http://pkg-mono.alioth.debian.org/">Packages (third party provider)</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ </td>
+ <td>
+ <a href="archive/0.31/windows/mono-0.31-win32-1.exe">Mono Setup</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.30.2</b><br>
+ <a href="archive/mono-0.30.1.html">Release notes</a><br>
+ Feb 27th, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.30.2.tar.gz">Mono Class Libraries and C# Compiler 0.30.2</a>
+ <li><a href="archive/mono-0.30.2.tar.gz">Mono Runtime 0.30.2</a>
+ <li><a href="archive/monodoc-0.11.tar.gz">MonoDoc 0.11</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30.2/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30.2/fedora-1-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30.2/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/debian-36.gif"><b>Debian Packages</b><br>
+ </td>
+ <td>
+ <a href="http://pkg-mono.alioth.debian.org/">Packages (third party provider)</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ </td>
+ <td>
+ No Windows Installer for 0.30.2 exist yet, you can download
+ version 0.30.0 for now:
+
+ <a href="archive/0.30/windows/mono-0.30-win32-2.exe">Mono Setup</a>
+ <a href="archive/0.30/windows/mono-0.30-gtksharp-0.15-win32-1.exe">Gtk# Setup</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.30.1</b><br>
+ <a href="archive/mono-0.30.1.html">Release notes</a><br>
+ Feb 13th, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.30.1.tar.gz">Mono Class Libraries and C# Compiler 0.30.</a>
+ <li><a href="archive/mono-0.30.1.tar.gz">Mono Runtime 0.30</a>
+ <li><a href="archive/xsp-0.9.tar.gz">XSP web server 0.9</a>
+ <li><a href="archive/mod_mono-0.7.tar.gz">Apache Mono module 0.7</a>
+ <li><a href="archive/monodoc-0.11.tar.gz">MonoDoc 0.11</a>
+ <li><a href="archive/libgdiplus-0.1.tar.gz">libgdiplus 0.1</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30.1/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30.1/fedora-1-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30.1/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/debian-36.gif"><b>Debian Packages</b><br>
+ </td>
+ <td>
+ <a href="http://pkg-mono.alioth.debian.org/">Packages (third party provider)</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ </td>
+ <td>
+ No Windows Installer for 0.30.1 exist yet, you can download
+ version 0.30.0 for now:
+
+ <a href="archive/0.30/windows/mono-0.30-win32-2.exe">Mono Setup</a>
+ <a href="archive/0.30/windows/mono-0.30-gtksharp-0.15-win32-1.exe">Gtk# Setup</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.30</b><br>
+ <a href="archive/mono-0.30.html">Release notes</a><br>
+ Feb 2nd, 2004
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.30.tar.gz">Mono Class Libraries and C# Compiler 0.30.</a>
+ <li><a href="archive/mono-0.30.tar.gz">Mono Runtime 0.30</a>
+ <li><a href="archive/xsp-0.9.tar.gz">XSP web server 0.9</a>
+ <li><a href="archive/mod_mono-0.7.tar.gz">Apache Mono module 0.7</a>
+ <li><a href="archive/monodoc-0.10.tar.gz">MonoDoc 0.10</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30/redhat-9-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Fedora Core 1/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30/fedora-1-i386">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SUSE 9/x86</b><br>
+ </td>
+ <td>
+ <a href="archive/0.30/suse-90-i586/">Packages</a>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/debian-36.gif"><b>Debian Packages</b><br>
+ </td>
+ <td>
+ <a href="http://pkg-mono.alioth.debian.org/">Packages (third party provider)</a>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ </td>
+ <td>
+ <a href="archive/0.30/windows/mono-0.30-win32-2.exe">Mono Setup</a>
+ <a href="archive/0.30/windows/mono-0.30-gtksharp-0.15-win32-1.exe">Gtk# Setup</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.29</b><br>
+ <a href="archive/mono-0.29.html">Release notes</a><br>
+ Dec 2nd, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.29.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.29.tar.gz">Mono Runtime</a>
+ <li><a href="archive/xsp-0.8.tar.gz">XSP web server (0.8)</a>
+ <li><a href="archive/mod_mono-0.6.tar.gz">Apache Mono module 0.6 (mod_mono)</a>
+ <li><a href="archive/monodoc-0.9.tar.gz">MonoDoc 0.9</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#bbbbbb">
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 8.0, Red Hat 9.0/x86</b><br>
+ <img src="images/mandrake-36.gif"><b>Mandrake 9.1/x86</b><br>
+ <img src="images/suse-36.gif"><b>SuSE 8.2</b><br>
+ </td>
+ <td>
+ Packages are available on <a
+ href="http://www.ximian.com/products/redcarpet/download.html">Red
+ Carpet's</a> Mono channel.
+
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ </td>
+ <td>
+ <a href="archive/mono-0.29-win32-1.exe">mono-0.29-win32-1.exe</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.28</b><br>
+ <a href="archive/mono-0.28.html">Release notes</a><br>
+ Oct 1st, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.28.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.28.tar.gz">Mono Runtime</a>
+ <li><a href="archive/xsp-0.6.tar.gz">XSP web server (0.6)</a>
+ <li><a href="archive/mod_mono-0.5.tar.gz">Apache Mono module (mod_mono)</a>
+ <li><a href="archive/monodoc-0.7.tar.gz">MonoDoc 0.7</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/redhat-90-i386/mono-0.28-1.ximian.6.1.src.rpm">mono-0.28-1.src.rpm (RH9)</a>
+ <li><a href="archive/redhat-90-i386/mono-0.28-1.ximian.6.1.src.rpm">mono-0.28-1.src.rpm (RH8)</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-90-i386/mono-0.28-1.ximian.6.1.i386.rpm">mono-0.28-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-devel-0.28-1.ximian.6.1.i386.rpm">mono-devel-0.28-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-debuginfo-0.28-1.ximian.6.1.i386.rpm">mono-debuginfo-0.28-1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-90-i386/mono-wine-20030318-1.ximian.6.4.i386.rpm">mono-wine-20030318-1.ximian.6.4.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-wine-debuginfo-20030318-1.ximian.6.4.i386.rpm">mono-wine-debuginfo-20030318-1.ximian.6.4.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-80-i386/mono-0.28-1.ximian.5.1.i386.rpm">mono-0.28-1.ximian.5.1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-devel-0.28-1.ximian.5.1.i386.rpm">mono-devel-0.28-1.ximian.5.1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-80-i386/mono-wine-20030318-1.ximian.5.3.i386.rpm">mono-wine-20030318-1.ximian.5.3.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/mandrake-36.gif"><b>Mandrake 9.1/x86</b>
+ <ul>
+ <li><a href="archive/mandrake-91-i586/mono-0.28-1.ximian.6.1.i586.rpm">mono-0.28-1.ximian.6.1.i586.rpm</a>
+ <li><a href="archive/mandrake-91-i586/mono-devel-0.28-1.ximian.6.1.i586.rpm">mono-devel-0.28-1.ximian.6.1.i586.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Linux s390</b>
+ <ul>
+ <li><a href="archive/s390/libgc-6.1-1.s390.rpm">libgc-6.1-1.s390.rpm</a>
+ <li><a href="archive/s390/libgc-devel-6.1-1.s390.rpm">libgc-devel-6.1-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-0.28-1.s390.rpm">mono-0.28-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-devel-0.28-1.s390.rpm">mono-devel-0.28-1.s390.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SuSE 8.2</b>
+ <ul>
+ <li><a href="archive/suse-82-i586/mono-0.28-1.ximian.7.1.i586.rpm">mono-0.28-1.ximian.7.1.i586.rpm</a>
+ <li><a href="archive/suse-82-i586/mono-devel-0.28-1.ximian.7.1.i586.rpm">mono-devel-0.28-1.ximian.7.1.i586.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ <ul>
+ <li><a href="archive/mono-0.28-win32-1.exe">mono-0.28-win32-1.exe</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.26</b><br>
+ <a href="archive/mono-0.26.html">Release notes</a><br>
+ Aug 14, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.26.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.26.tar.gz">Mono Runtime</a>
+ <li><a href="archive/xsp-0.5.tar.gz">XSP web server (0.5)</a>
+ <li><a href="archive/mod_mono-0.4.tar.gz">Apache Mono module (mod_mono)</a>
+ <li><a href="archive/monodoc-0.6.tar.gz">MonoDoc 0.6</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.6.1.src.rpm">mono-0.26-1.src.rpm (RH9)</a>
+ <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.6.1.src.rpm">mono-0.26-1.src.rpm (RH8)</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-90-i386/mono-0.26-1.ximian.6.1.i386.rpm">mono-0.26-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-devel-0.26-1.ximian.6.1.i386.rpm">mono-devel-0.26-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-debuginfo-0.26-1.ximian.6.1.i386.rpm">mono-debuginfo-0.26-1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-90-i386/libpixregion-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/libic-0.1.0-1.ximian.6.1.i386.rpm">libic-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xc-0.1.0-1.ximian.6.1.i386.rpm">xc-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xr-0.1.0-1.ximian.6.1.i386.rpm">xr-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-90-i386/monodoc-0.6-1.ximian.6.1.i386.rpm">monodoc-0.6-1.ximian.6.1.i386.rpm</a> (To be used only with CVS gtk-sharp)
+ <li><a href="archive/redhat-90-i386/monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm">monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-wine-20030318-1.ximian.6.3.i386.rpm">mono-wine-20030318-1.ximian.6.3.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-wine-debuginfo-20030318-1.ximian.6.3.i386.rpm">mono-wine-debuginfo-20030318-1.ximian.6.3.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-80-i386/mono-0.26-2.ximian.5.1.i386.rpm">mono-0.26-2.ximian.5.1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-devel-0.26-2.ximian.5.1.i386.rpm">mono-devel-0.26-2.ximian.5.1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-80-i386/monodoc-0.5-1.ximian.5.1.i386.rpm">monodoc-0.5-1.ximian.5.1.i386.rpm</a> (To be used only with CVS gtk-sharp)
+ <li><a href="archive/redhat-80-i386/mono-wine-20030318-1.ximian.5.3.i386.rpm">mono-wine-20030318-1.ximian.5.3.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/debian-36.gif"><b>Debian</b>
+ <ul>
+ <li><a href="http://www.debianplanet.com/mono/">Debian Packages here.</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/mandrake-36.gif"><b>Mandrake 9.1/x86</b>
+ <ul>
+ <li><a href="archive/mandrake-91-i586/mono-0.26-1.ximian.6.1.i586.rpm">mono-0.26-1.ximian.6.1.i586.rpm</a>
+ <li><a href="archive/mandrake-91-i586/mono-devel-0.26-1.ximian.6.1.i586.rpm">mono-devel-0.26-1.ximian.6.1.i586.rpm</a>
+<!-- <li><a href="archive/mandrake-91-i586/monodoc-0.5-1.ximian.6.1.i586.rpm">monodoc-0.5-1.ximian.6.1.i586.rpm</a> -->
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SuSE 8.2</b>
+ <ul>
+ <li><a href="archive/suse-82-i586/mono-0.26-2.ximian.7.1.i586.rpm">mono-0.26-2.ximian.7.1.i586.rpm</a>
+ <li><a href="archive/suse-82-i586/mono-devel-0.26-2.ximian.7.1.i586.rpm">mono-devel-0.26-2.ximian.7.1.i586.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows installer</b>
+ <ul>
+ <li><a href="archive/mono-0.26-win32-2.exe">mono-0.26-win32-2.exe</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </table>
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.25</b><br>
+ <a href="archive/mono-0.25.html">Release notes</a><br>
+ Jun 26, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.25.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.25.tar.gz">Mono Runtime</a>
+ <li><a href="archive/xsp-0.4.tar.gz">XSP web server (0.4)</a>
+ <li><a href="archive/monodoc-0.5.tar.gz">MonoDoc 0.5</a>
+ <li><a href="archive/gtk-sharp-0.11.tar.gz">Gtk# 0.11</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/redhat-80-i386/mono-0.25-1.ximian.5.1.src.rpm">mono-0.25-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-90-i386/mono-0.25-1.ximian.6.1.i386.rpm">mono-0.25-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-devel-0.25-1.ximian.6.1.i386.rpm">mono-devel-0.25-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-debuginfo-0.25-1.ximian.6.1.i386.rpm">mono-debuginfo-0.25-1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-90-i386/libpixregion-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libpixregion-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/libic-0.1.0-1.ximian.6.1.i386.rpm">libic-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">libic-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xc-0.1.0-1.ximian.6.1.i386.rpm">xc-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xc-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xr-0.1.0-1.ximian.6.1.i386.rpm">xr-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm">xr-debuginfo-0.1.0-1.ximian.6.1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-90-i386/gtk-sharp-0.10-1.ximian.6.1.i386.rpm">gtk-sharp-0.10-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/gtk-sharp-gapi-0.10-1.ximian.6.1.i386.rpm">gtk-sharp-gapi-0.10-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/gtk-sharp-debuginfo-0.10-1.ximian.6.1.i386.rpm">gtk-sharp-debuginfo-0.10-1.ximian.6.1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-90-i386/monodoc-0.5-1.ximian.6.1.i386.rpm">monodoc-0.5-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm">monodoc-debuginfo-0.5-1.ximian.6.1.i386.rpm</a>
+ <li><a href="archive/mono-wine-20030318-1.ximian.6.2.i386.rpm">mono-wine-20030318-1.ximian.6.2.i386.rpm</a>
+ <li><a href="archive/mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm">mono-wine-debuginfo-20030318-1.ximian.6.2.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-80-i386/mono-0.25-1.ximian.5.1.i386.rpm">mono-0.25-1.ximian.5.1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-devel-0.25-1.ximian.5.1.i386.rpm">mono-devel-0.25-1.ximian.5.1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-80-i386/gtk-sharp-0.10-1.ximian.5.1.i386.rpm">gtk-sharp-0.10-1.ximian.5.1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/gtk-sharp-gapi-0.10-1.ximian.5.1.i386.rpm">gtk-sharp-gapi-0.10-1.ximian.5.1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/monodoc-0.5-1.ximian.5.1.i386.rpm">monodoc-0.5-1.ximian.5.1.i386.rpm</a>
+ <li><a href="archive/mono-wine-20030318-1.ximian.5.2.i386.rpm">mono-wine-20030318-1.ximian.5.2.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/debian-36.gif"><b>Debian</b>
+ <ul>
+ <li><a href="http://www.debianplanet.com/mono/">Debian Packages here.</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows Setup Wizard (XP, 2000, NT)</b>
+ <ul>
+ <li><a href="archive/mono-0.25-win32-1.exe">Setup program.</a>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 7.3/x86</b>
+ <ul>
+ <li><a href="archive/redhat-73-i386/mono-0.25-1.ximian.4.1.i386.rpm">mono-0.25-1.ximian.4.1.i386.rpm</a>
+ <li><a href="archive/redhat-73-i386/mono-devel-0.25-1.ximian.4.1.i386.rpm">mono-devel-0.25-1.ximian.4.1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/mandrake-36.gif"><b>Mandrake 9.1/x86</b>
+ <ul>
+ <li><a href="archive/mandrake-91-i586/mono-0.25-1.ximian.6.1.i586.rpm">mono-0.25-1.ximian.6.1.i586.rpm</a>
+ <li><a href="archive/mandrake-91-i586/mono-devel-0.25-1.ximian.6.1.i586.rpm">mono-devel-0.25-1.ximian.6.1.i586.rpm</a>
+ <li><a href="archive/mandrake-91-i586/gtk-sharp-0.10-1.ximian.6.1.i586.rpm">gtk-sharp-0.10-1.ximian.6.1.i586.rpm</a>
+ <li><a href="archive/mandrake-91-i586/gtk-sharp-gapi-0.10-1.ximian.6.1.i586.rpm">gtk-sharp-gapi-0.10-1.ximian.6.1.i586.rpm</a>
+ <li><a href="archive/mandrake-91-i586/monodoc-0.5-1.ximian.6.1.i586.rpm">monodoc-0.5-1.ximian.6.1.i586.rpm</a>
+ </ul>
+ </td>
+ </tr>
+
+ <!--
+ We don't have SuSE packages right now
+ -->
+<!-- <tr> -->
+<!-- <td bgcolor="#999999"> -->
+<!-- <img src="images/suse-36.gif"><b>SuSE 8.2/x86</b> -->
+<!-- <ul> -->
+<!-- <li><a href="archive/suse-80-i386/mono-0.25-1.i386.rpm">mono-0.25-1.i386.rpm</a> -->
+<!-- <li><a href="archive/suse-80-i386/mono-devel-0.25-1.i386.rpm">mono-devel-0.25-1.i386.rpm</a> -->
+<!-- </ul> -->
+<!-- </td> -->
+<!-- </tr> -->
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <tr bgcolor="#CCCCC">
+ <td>
+ <b>Regression Tests</b><br>
+ </td>
+ <td>
+ You can get binaries for the Mono Regression Test
+ Suite <a href="archive/mono-tests.tar.gz">here</a>
+ </td>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+
+* Older Releases:
+
+ We provide binaries for older releases until we have packages for the new release.
+
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.24</b><br>
+ <a href="archive/mono-0.24.html">Release notes</a><br>
+ May 6, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.24.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.24.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ <li><a href="archive/xsp-0.4.tar.gz">XSP web server (0.4)</a>
+ <li><a href="archive/monodoc-0.4.tar.gz">MonoDoc 0.4</a>
+ <li><a href="archive/gtk-sharp-0.9.tar.gz">Gtk# 0.9</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.24-1.src.rpm">mono-0.24-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 9.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-90-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-0.24-1.i386.rpm">mono-0.24-1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-devel-0.24-1.i386.rpm">mono-devel-0.24-1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/mono-debuginfo-0.24-1.i386.rpm">mono-debuginfo-0.24-1.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-90-i386/gtk-sharp-0.9-1.i386.rpm">gtk-sharp-0.9-1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/gtk-sharp-debuginfo-0.9-1.i386.rpm">gtk-sharp-debuginfo-0.9-1.i386.rpm</a>
+ <li><a href="archive/redhat-90-i386/monodoc-0.4-1.i386.rpm">monodoc-0.4-1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-0.24-2.i386.rpm">mono-0.24-2.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-devel-0.24-2.i386.rpm">mono-devel-0.24-2.i386.rpm</a>
+ <br>
+ <li><a href="archive/redhat-80-i386/gtk-sharp-0.9-1.i386.rpm">gtk-sharp-0.9-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/monodoc-0.4-1.i386.rpm">monodoc-0.4-1.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/debian-36.gif"><b>Debian</b>
+ <ul>
+ <li><a href="http://www.debianplanet.com/mono/">Debian Packages here.</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/windows-36.gif"><b>Windows Setup Wizard (XP, 2000, NT)</b>
+ <ul>
+ <li><a href="archive/mono-0.24-win32-1.exe">Setup program.</a>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/redhat-36.gif"><b>Red Hat 7.3/x86</b>
+ <ul>
+ <li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-73-i386/mono-0.24-1.i386.rpm">mono-0.24-1.i386.rpm</a>
+ <li><a href="archive/redhat-73-i386/mono-devel-0.24-1.i386.rpm">mono-devel-0.24-1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <img src="images/mandrake-36.gif"><b>Mandrake 8.2/x86</b>
+ <ul>
+ <li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
+ <li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
+ <li><a href="archive/mandrake-82-i386/mono-0.24-1.i586.rpm">mono-0.24-1.i586.rpm</a>
+ <li><a href="archive/mandrake-82-i386/mono-devel-0.24-1.i586.rpm">mono-devel-0.24-1.i586.rpm</a>
+ </ul>
+ </td>
+ </tr>
+
+ <tr>
+ <td bgcolor="#999999">
+ <img src="images/suse-36.gif"><b>SuSE 8.0/x86</b>
+ <ul>
+ <li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/suse-80-i386/mono-0.24-1.i386.rpm">mono-0.24-1.i386.rpm</a>
+ <li><a href="archive/suse-80-i386/mono-devel-0.24-1.i386.rpm">mono-devel-0.24-1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Linux s/390</b>
+ <ul>
+ <li><a href="archive/s390/libgc-6.1-1.s390.rpm">libgc-6.1-1.s390.rpm</a>
+ <li><a href="archive/s390/libgc-devel-6.1-1.s390.rpm">libgc-devel-6.1-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-0.24-1.s390.rpm">mono-0.24-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-devel-0.24-1.s390.rpm">mono-devel-0.24-1.s390.rpm</a>
+ </ul>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <tr bgcolor="#CCCCC">
+ <td>
+ <b>Regression Tests</b><br>
+ </td>
+ <td>
+ You can get binaries for the Mono Regression Test
+ Suite <a href="archive/mono-tests.tar.gz">here</a>
+ </td>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.23</b><br>
+ <a href="archive/mono-0.23">Release notes</a><br>
+ March 5, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.23.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.23.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ <li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
+ <li><a href="archive/mono-debugger-0.2.2.tar.gz">Mono Debugger 0.2.2</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.23-1.src.rpm">mono-0.23-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Red Hat 7.3/x86</b>
+ <ul>
+ <li><a href="archive/redhat-73-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-73-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-73-i386/mono-0.23-1.i386.rpm">mono-0.23-1.i386.rpm</a>
+ <li><a href="archive/redhat-73-i386/mono-devel-0.23-1.i386.rpm">mono-devel-0.23-1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Red Hat 7.2/x86</b>
+ <ul>
+ <li><a href="archive/redhat-72-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-72-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-72-i386/mono-0.23-1.i386.rpm">mono-0.23-1.i386.rpm</a>
+ <li><a href="archive/redhat-72-i386/mono-devel-0.23-1.i386.rpm">mono-devel-0.23-1.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Red Hat 7.1/x86</b>
+ <ul>
+ <li><a href="archive/redhat-71-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-71-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-71-i386/mono-0.23-1.i386.rpm">mono-0.23-1.i386.rpm</a>
+ <li><a href="archive/redhat-71-i386/mono-devel-0.23-1.i386.rpm">mono-devel-0.23-1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Mandrake 8.2/x86</b>
+ <ul>
+ <li><a href="archive/mandrake-82-i386/libgc-6.1-1.i586.rpm">libgc-6.1-1.i586.rpm</a>
+ <li><a href="archive/mandrake-82-i386/libgc-devel-6.1-1.i586.rpm">libgc-devel-6.1-1.i586.rpm</a>
+ <li><a href="archive/mandrake-82-i386/mono-0.23-1.i586.rpm">mono-0.23-1.i586.rpm</a>
+ <li><a href="archive/mandrake-82-i386/mono-devel-0.23-1.i586.rpm">mono-devel-0.23-1.i586.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>SuSE 8.0/x86</b>
+ <ul>
+ <li><a href="archive/suse-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/suse-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/suse-80-i386/mono-0.23-1.i386.rpm">mono-0.23-1.i386.rpm</a>
+ <li><a href="archive/suse-80-i386/mono-devel-0.23-1.i386.rpm">mono-devel-0.23-1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Red Hat 8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-0.23-1.i386.rpm">mono-0.23-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-devel-0.23-1.i386.rpm">mono-devel-0.23-1.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Windows Setup Wizard (NT/2000/XP)</b>
+ <ul>
+ <li><a href="archive/mono-0.23-win32-2.exe">Mono-Setup</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Linux S/390</b>
+ <ul>
+ <li><a href="archive/s390/libgc-6.1-1.s390.rpm">libgc-6.1-1.s390.rpm</a>
+ <li><a href="archive/s390/libgc-devel-6.1-1.s390.rpm">libgc-devel-6.1-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-0.23-1.s390.rpm">mono-0.23-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-devel-0.23-1.s390.rpm">mono-devel-0.23-1.s390.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <tr bgcolor="#CCCCC">
+ <td>
+ <b>Regression Tests</b><br>
+ </td>
+ <td>
+ You can get binaries for the Mono Regression Test
+ Suite <a href="archive/mono-tests.tar.gz">here</a>
+ </td>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.22</b><br>
+ <a href="archive/mono-0.22">Release notes</a><br>
+ March 5, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.22.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.22.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ <li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.22-1.src.rpm">mono-0.22-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Windows Setup Wizard (NT/2000/XP)</b>
+ <ul>
+ <li><a href="archive/mono-0.22-win32-1.exe">Mono-Setup</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <tr bgcolor="#CCCCC">
+ <td>
+ <b>Regression Tests</b><br>
+ </td>
+ <td>
+ You can get binaries for the Mono Regression Test
+ Suite <a href="archive/mono-tests.tar.gz">here</a>
+ </td>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.21</b><br>
+ <a href="archive/mono-0.21">Release notes</a><br>
+ Feb 27th, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.21.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.21.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ <li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.21-1.src.rpm">mono-0.21-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Debian packages</b>
+ <ul>
+ <li><a href="http://www.atoker.com/mono/">Alp's web site</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <tr bgcolor="#CCCCC">
+ <td>
+ <b>Regression Tests</b><br>
+ </td>
+ <td>
+ You can get binaries for the Mono Regression Test
+ Suite <a href="archive/mono-tests.tar.gz">here</a>
+ </td>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.20</b><br>
+ <a href="archive/mono-0.20">Release notes</a><br>
+ Feb 20th, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.20.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.20.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ <li><a href="archive/xsp-0.3.tar.gz">XSP web server (0.3)</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/redhat-73-i386/mono-0.20-1.src.rpm">mono-0.20-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Red Hat 8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-80-i386/libgc-6.1-1.i386.rpm">libgc-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/libgc-devel-6.1-1.i386.rpm">libgc-devel-6.1-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-0.20-1.i386.rpm">mono-0.20-1.i386.rpm</a>
+ <li><a href="archive/redhat-80-i386/mono-devel-0.20-1.i386.rpm">mono-devel-0.20-1.i386.rpm</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Debian packages</b>
+ <ul>
+ <li><a href="http://www.atoker.com/mono/">Alp's web site</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Windows Setup Wizard (NT/2000/XP)</b>
+ <ul>
+ <li><a href="archive/mono-0.20-stable-win32-2.exe">Mono-Setup</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <tr bgcolor="#CCCCC">
+ <td>
+ <b>Regression Tests</b><br>
+ </td>
+ <td>
+ You can get binaries for the Mono Regression Test
+ Suite <a href="archive/mono-tests.tar.gz">here</a>
+ </td>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.19</b><br>
+ <a href="archive/mono-0.19">Release notes</a><br>
+ Jan 20th, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.19.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.19.tar.gz">Mono Runtime</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.19-1.src.rpm">mono-0.19-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.18</b><br>
+ <a href="archive/mono-0.18">Release notes</a><br>
+ Jan 12th, 2003
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.18.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.18.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ <li><a href="archive/xsp-0.2.tar.gz">XSP web server</a> <b><font color="#dd0000">New!</font></b>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.18-1.src.rpm">mono-0.18-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.17</b><br>
+ <a href="archive/mono-0.17">Release notes</a><br>
+ Dec 9th, 2002.
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.17.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.17.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b><br>
+ (No RPMS for XSP).
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.17-2.src.rpm">mono-0.17-2.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Windows Setup Wizard (NT/2000/XP)</b>
+ <ul>
+ <li><a href="archive/mono-0.17-stable.exe">Mono-Setup</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Debian packages</b>
+ <ul>
+ <li><a href="http://www.atoker.com/mono/">Alp's web site</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.16</b><br>
+ <a href="archive/mono-0.16">Release notes</a><br>
+ Oct 1st, 2002.
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.16.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.16.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1.tar.gz">Boehm GC 6.1</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1-1.src.rpm">libgc-6.1-1.src.rpm</a>
+ <li><a href="archive/mono-0.16-1.src.rpm">mono-0.16-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+ <tr>
+ <td bgcolor="#999999">
+ <b>Linux s390</b>
+ <ul>
+ <li><a href="archive/s390/glib2-2.0.6-13.s390.rpm">glib2-2.0.6-13.s390.rpm</a>
+ <li><a href="archive/s390/glib2-devel-2.0.6-13.s390.rpm">glib2-devel-2.0.6-13.s390.rpm</a>
+ <li><a href="archive/s390/libgc-6.1alpha5-1.s390.rpm">libgc-6.1alpha5-1.s390.rpm</a>
+ <li><a href="archive/s390/libgc-devel-6.1alpha5-1.s390.rpm">libgc-devel-6.1alpha5-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-0.16-1.s390.rpm">mono-0.16-1.s390.rpm</a>
+ <li><a href="archive/s390/mono-devel-0.16-1.s390.rpm">mono-devel-0.16-1.s390.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ </tr>
+ </tr>
+ </tbody>
+ </table>
+
+ <table>
+ <tbody>
+ <tr bgcolor="#DDDDDD">
+ <td>
+ <b>Release 0.15</b><br>
+ <a href="archive/mono-0.15">Release notes</a><br>
+ Aug 23rd, 2002.
+ </td>
+ <td>
+ <table cellspacing="1" cellpadding="3">
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source Code</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/mcs-0.15.tar.gz">Mono Class Libraries and C# Compiler.</a>
+ <li><a href="archive/mono-0.15.tar.gz">Mono Runtime</a>
+ <li><a href="archive/gc6.1alpha5.tar.gz">Boehm GC 6.1alpha5</a>
+ </ul>
+ </td>
+ </tr>
+ <tr bgcolor="#BBBBBB">
+ <td>
+ <b>Source RPMs</b>
+ </td>
+ <td>
+ <ul>
+ <li><a href="archive/libgc-6.1alpha5-1.src.rpm">libgc-6.1alpha5-1.src.rpm</a>
+ <li><a href="archive/mono-0.15-1.src.rpm">mono-0.15-1.src.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ </tr>
+
+ <tr bgcolor="#999999">
+ <td>
+ <b>Windows (win95 friendly)</b>
+ <ul>
+ <li><a href="archive/mono-w32-Aug_28_2002.zip">Mono-w32</a>
+ </ul>
+ </td>
+ <td bgcolor="#999999">
+ <b>Red Hat null-8.0/x86</b>
+ <ul>
+ <li><a href="archive/redhat-null-i386/libgc-6.1alpha5-1.i386.rpm">libgc-6.1alpha5-1.i386.rpm</a>
+ <li><a href="archive/redhat-null-i386/libgc-devel-6.1alpha5-1.i386.rpm">libgc-devel-6.1alpha5-1.i386.rpm</a>
+ <li><a href="archive/redhat-null-i386/mono-0.15-1.i386.rpm">mono-0.15-1.i386.rpm</a>
+ <li><a href="archive/redhat-null-i386/mono-devel-0.15-1.i386.rpm">mono-devel-0.15-1.i386.rpm</a>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+* Binaries for other platforms.
+
+ Already daily volunteer's made binaries:
<ul>
- * <a href="archive/mono-0.12">Mono 0.12 release notes</a>
-
- * <a href="archive/mcs-0.12.tar.gz">mcs-0.12.tar.gz</a>
- Mono C# compiler with class library source code.
-
- * <a href="archive/mono-0.12.tar.gz">mono-0.12.tar.gz</a>
- Mono runtime.
+ * <a href="http://pkg-mono.alioth.debian.org/">http://pkg-mono.alioth.debian.org/</a>
</ul>
-* Snapshots
-
- Volunteers package up daily the sources:
-
- <ul>
- * <a href="http://www.atoker.com/mono">Debian Linux</a>
- * <a href="http://mono.baselabs.org/index.php/software">Red Hat Linux</a>
- * <a href="http://www.superin.formativ.net/mono/mono.htm">Windows</a> (works without cygwin!)
- </ul>
+* Snapshots
<a name="snapshots">
- For up to date sources, it is recommended that you use the Mono
- source code from either the
- <a href="http://www.go-mono.com/snapshots">nightly snapshots</a> or
- the <a href="anoncvs.html">Anonymous CVS</a>. The nightly
- snapshots are done every night at 10pm EST (Boston Time).
-
- The nightly snapshots are not guaranteed to build, but most of the
- time they should. They should give you a window to see what we are
- up to.
-
- You can download the GNU make tools and the Cygwin environment from
- <a href="http://www.cygwin.com">www.cygwin.com</a>.
-
- You can download Microsoft's .NET Framework SDK from
- <a href="http://msdn.microsoft.com/downloads">
- msdn.microsoft.com/downloads</a>.
-
- There are scripts to help build mono for both Unix and Windows. Get
- <a href="mono-build.sh">mono-build.sh</a> for Unix, or <a
- href="mono-build-w32.sh">mono-build-w32.sh</a> for Windows.
- These scripts automate the installation of GLIB and pkgconfig
- (building from source on Unix, and using binary packages
- provided by the GIMP for Windows project on Windows.) To use
- the script, follow these simple steps:
-
- <ul>
- * Save the script for your platform somewhere (e.g. /usr/local/bin)
- * Make the script executable (i.e chmod 755 /usr/local/bin/mono-build.sh)
- * Create a directory to hold the mono source, and the compiled binaries (e.g. mkdir ~/mono)
- * Change to the new directory (i.e. cd ~/mono)
- * run the script (i.e. /usr/local/bin/mono-build.sh)
- </ul>
-
- The script requires wget on either platform, and building the
- software requires make, gcc, automake, autoconf, and libtool.
- You should install these packages from your distribution or
- with the cygwin installer.
-
- The script will download required packages from
- www.go-mono.com and do a cvs checkout of mono in the current
- directory. The cvs server chosen defaults to anonymous cvs;
- set your CVSROOT environment variable before running the script to
- select a particular cvs server.
-
-** Mono Regression Test Suite
- You can get binaries for the Mono Regression Test Suite <a
- href="archive/mono-tests.tar.gz">here</a>
-
-<a name="install">
-** Building the software manually
+ <a href="http://www.go-mono.com/snapshots">Nightly snapshots</a> of
+ the CVS repository are made every day at 10pm EST (Boston
+ Time). These are not guaranteed to build, they are just a
+ snapshot of the tree.
-*** Download the required software.
-
- <ul>
-
- * Microsoft's .NET Framework SDK from
- <a href="http://msdn.microsoft.com/downloads">
- msdn.microsoft.com/downloads</a>.
-
- * Cygwin and the GNU Make tools from
- <a href="http://www.cygwin.com">www.cygwin.com</a>.
- Some people observed problems with autoconf 2.52. Installing
- autoconf 2.13 helped in those cases.
-
- * Precompiled GLIB 1.3 and pkg-config packages (and
- their dependencies) by the <a href="http://www.gimp.org/~tml/gimp/win32//index.html">GIMP for Windows</a> project from
- <a href="http://www.go-mono.com/archive/pkgconfig-0.80-tml-20020101.zip">http://www.go-mono.com/archive/pkgconfig-0.80-tml-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/glib-1.3.12-20020101.zip">http://www.go-mono.com/archive/glib-1.3.12-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/glib-dev-1.3.12-20020101.zip">http://www.go-mono.com/archive/glib-dev-1.3.12-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/libiconv-1.7.zip">http://www.go-mono.com/archive/libiconv-1.7.zip</a>
- <a href="http://www.go-mono.com/archive/libiconv-dev-1.7.zip">http://www.go-mono.com/archive/libiconv-dev-1.7-20020101.zip</a>
- <a href="http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip">http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip</a>
-
- * Download the Mono source code from the
- <a href="#feb-11">packaged versions</a> or
- the <a href="http://www.go-mono.com/snapshots">
- nightly snapshots</a> or the <a href="anoncvs.html">
- Anonymous CVS</a>. The nightly snapshots are done every
- night at 10pm EST (Boston Time). The nightly snapshots are
- not guaranteed to build, but most of the time they should.
-
-
- </ul>
-
-
-*** Install Cygwin and the GNU build tools, Microsoft's .NET Framework SDK and the precompiled GLIB 1.3 and pkg-config libraries.
-
- <ul>
-
- * Install <a href="http://www.cygwin.com">Cygwin</a>.
-
- * Install <a href="http://msdn.microsoft.com/downloads">
- Microsoft .NET Framework SDK</a>.
-
- * Change to the <strong>/usr/local</strong> directory
- of your Cygwin installation.<br>
- Unzip the precompiled packages listed above.
-
- </ul>
-
-*** On Windows, to install and work on the compiler and the class libraries:
-
- <ul>
+ The <a href="anoncvs.html">anoncvs</a> mirrors provided by
+ Hispalinux are updated every six hours.
- * If you downloaded the Mono
- <a href="http://www.go-mono.com/snapshots">nightly snapshot
- </a>, untar the snapshot.
-
- * Change directories to <strong>"mcs"</strong>.
-
- * Compile:
-
-<pre>
-<strong>make windows</strong>
-</pre>
-
- </ul>
-
-*** On Windows, to compile the mono runtime:
-
- <ul>
-
- * If you downloaded the Mono
- <a href="http://www.go-mono.com/snapshots">nightly snapshot
- </a>, untar the snapshot.
-
- * Change directories to <strong>"mono"</strong>.
-
- * Configure, compile and install:
-
-<pre><strong>
-./configure --prefix=c:/mono
-make
-make install
-</strong></pre>
-
- </ul>
-
-*** On Unix, to compile the mono runtime:
-
- <ul>
-
- * Install <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a>.
-
- * Install glib 1.3. You can download it
- from <a href="ftp://ftp.gtk.org/pub/gtk/v1.3/glib-1.3.12.tar.gz">ftp.gtk.org</a>. Maybe you need
- to modify your ACLOCAL_FLAGS for pkg-config, for example if
- your install prefix is /usr/local:
-<pre>
-<strong>export ACLOCAL_FLAGS="-I /usr/local/share/aclocal"</strong>
-</pre>
-
- * If you downloaded the Mono
- <a href="http://www.go-mono.com/snapshots">nightly snapshots
- </a>, untar the snapshot.
-
- * Change directories to <strong>"mono"</strong>.
-
- * Configure, compile and install:
-<pre><strong>
-./configure
-make
-make install</strong>
-</pre>
- </ul>
-
-*** Notes on compiling GLIB 1.3 and pkg-config from source:
-
-
- <ul>
-
- * Some people observed problems with autoconf 2.52. Installing
- autoconf 2.13 helped in those cases (don't forget to do a
- `make maintainer-clean' after the update).
-
- * Download, compile and install <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a> from source.
- (I had to change line 674 of
- <nobr><tt>pkg-config-0.8.0/glib-1.2.8/gstrfuncs.c</tt></nobr> from
- <nobr><tt>extern char *strsignal (int sig);</tt></nobr> to
- <nobr><tt>extern const char *strsignal (int sig);</tt></nobr>.
-
-<pre><strong>
-tar xzvf pkg-config-0.8.0.tar.gz
-cd pkg-config-0.8.0
-./configure --prefix=/usr
-make
-make install</strong>
-</pre>
-
- * Download, compile and install <a href="ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.7.tar.gz">libiconv</a> from source.<br>
- If you dont have MS Visual C/C++ 4.0 or 5.0 or 6.0 you can also try
- the binary package available at <a
- href="http://www.gimp.org/win32/libiconv-dev-20001007.zip">
- http://www.gimp.org/win32/libiconv-dev-20001007.zip</a>.
-
-
- * Download, compile and install the
- <a href="ftp://ftp.gtk.org/pub/gtk/v1.3/glib-1.3.12.tar.gz">
- glib 1.3</a> from source.
-
- </ul>
-
-
-<a name="oldreleases">
-
-*** Old releases.
-
- <ul>
-
- <ul>
- <a name="apr-24">
- <b>Mono 0.11; April 24, 2002</b>
- * <a href="archive/mono-0.11">Mono 0.11 release notes</a>
-
- * <a href="archive/mcs-0.11.tar.gz">mcs-0.11.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.11.tar.gz">mono-0.11.tar.gz</a>
- Mono runtime
- </ul>
-
- <ul>
- <a name="mar-27">
- <b>Mono 0.10; March 27, 2002</b>
- * <a href="archive/mono-0.10">Mono 0.10 release notes</a>
- * <a href="archive/mcs-0.10.tar.gz">mcs-0.10.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.10.tar.gz">mono-0.10.tar.gz</a>
- Mono runtime
- </ul>
-
- <ul>
- <a name="feb-22">
- <b>Mono 0.9; February 22, 2002</b>
- * <a href="archive/mono-0.9">Mono 0.9 release notes</a>
-
- * <a href="archive/mcs-0.9.tar.gz">mcs-0.9.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.9.tar.gz">mono-0.9.tar.gz</a>
- Mono runtime
- </ul>
-
- <a name="feb-11">
- <b>February 11, 2002</b>
- * <a href="archive/mcs-0.8.tar.gz">mcs-0.8.tar.gz</a>
- Mono C# compiler
- * <a href="archive/mono-0.8.tar.gz">mono-0.8.tar.gz</a>
- Mono runtime
- </ul>
-
- <a name="sep-18">
- <b>September 18, 2001</b>
- <ul>
- * <a href="archive/mono-0.7.tar.gz">mono-0.7.tar.gz</a>: Mono Runtime 0.7 release.
- * <a href="archive/mcs-0.7.tar.gz">mcs-0.7.tar.gz</a>: Mono Compiler and Classes 0.7 release.
- * <a href="archive/mono-0.7">Release Notes.</a>
- </ul>
-
- <a name="august-22">
- <b>August 22, 2001</b>
- <ul>
- * <a href="archive/mono-0.6.tar.gz">mono-0.6.tar.gz</a>: Mono Runtime 0.6 release.
- * <a href="archive/mono-compiler-classes-0.6.tar.gz">mono-compiler-classes-0.6.tar.gz</a>: Mono Compiler and Classes 0.6 release.
- * <a href="archive/mono-0.6">Release Notes.</a>
- </ul>
-
-
- <a name="july-29">
- <b>July 29, 2001</b>
- <ul>
- * <a href="archive/mono-0.5.tar.gz">mono-0.5.tar.gz</a>: Mono Runtime 0.5 release.
- * <a href="archive/mono-0.5">Release Notes.</a>
- </ul>
-
-
- <a name="july-22">
- <b>July 22, 2001</b>
- <ul>
- * <a href="archive/mcs-22-Jul-2001.tar.gz">mcs-22-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mcs-Jul-22-Jul-19-2001.tar.gz">Differences since 19</a>: CVS snapshot.
- * <a href="archive/mcs-22">Release Notes.</a>
- </ul>
-
- <a name="july-19">
- <b>July 19th, 2001</b>
- <ul>
- * <a href="archive/mcs-19-Jul-2001.tar.gz">mcs-19-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mcs-Jul-17-Jul-19-2001.tar.gz">Differences since 17</a>: CVS snapshot.
- * <a href="archive/mcs-19">Release Notes.</a>
- </ul>
-
- <a name="july-17">
- <b>July 17th, 2001</b>
- <ul>
- * <a href="archive/mcs-17-Jul-2001.tar.gz">mcs-17-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mcs-Jul-15-Jul-17-2001.tar.gz">Differences since 15</a>: CVS snapshot.
- * <a href="archive/mcs-17">Release Notes.</a>
- </ul>
-
- <a name="july-15">
- <b>July 15th, 2001</b>
- <ul>
- * <a href="archive/mcs-15-Jul-2001.tar.gz">mcs-15-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mono-0.4.tar.gz">mono-0.4.tar.gz</a>: Packaged Source Code.
- * <a href="archive/mono-0.4">Release Notes.</a>
- </ul>
-
- <a name="july-14">
- <b>July 14th, 2001</b>
- <ul>
- * <a href="archive/mcs-12-Jul-2001.tar.gz">mcs-12-Jul-2001.tar.gz</a>: CVS snapshot.
- * <a href="archive/mono-0.3.tar.gz">mono-0.3.tar.gz</a>: Packaged Source Code.
- </ul>
-
- <a name="july-8">
- <b>July 8th, 2001</b>
-
- <ul>
- * <a href="archive/mcs-08-Jul-2001.tar.gz">mcs-08-Jul-2001.tar.gz</a>: CVS Snapshot
- * <a href="archive/mono-08-Jul-2001.tar.gz">mono-08-Jul-2001.tar.gz</a>: CVS Snapshot
- </ul>
- </ul>
+* Compilation
+ For instructions on how to build Mono, please refer to the
+ <a href="compiling.html">compiling</a> page.
diff --git a/web/drawing b/web/drawing
new file mode 100644
index 00000000000..987301236d4
--- /dev/null
+++ b/web/drawing
@@ -0,0 +1,51 @@
+* Drawing
+
+ Mono provides two mechanism to draw. The first exposes the
+ Microsoft System.Drawing API and the second exposes the <a
+ href="http://www.cairographics.org">Cairo</a> API.
+
+* System.Drawing
+
+ The System.Drawing implementation in Mono is designed to be
+ compatible with the Microsoft API. The imaging model is very
+ similar to the PDF 1.4 composition-based imaging model.
+
+ Our implementation is a C# wrapper around the GDI+ C API (also
+ called the <a
+ href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlusReference.asp">"GDI+
+ Flat API"</a>).
+
+ This means that the C# code is the same for Windows and Unix
+ systems. The following graph explains the situation:
+
+ <center>
+ <img src="images/system-drawing.png">
+ </center>
+
+ In Windows Mono uses the GDI+ library that is included with
+ the operating system (<tt>GDIPLUS.DLL</tt>, while in Unix we
+ provide an implementation of this API in the
+ <tt>libgdiplus.so</tt> shared library. Our
+ <tt>libgdiplus.so</tt> has the same C Flat API as the
+ <tt>GDIPLUS.DLL</tt>. Our implementation uses Cairo to do
+ the heavy lifting.
+
+ The implementation of GDI+ lives in the libgdiplus cvs module
+ and requires <a
+ href="http://www.cairographics.org">Cairo</a> to be installed
+ to get the package built.
+
+ The C# code that implement System.Drawing is the same for
+ Windows and Unix builds.
+
+ Since this is an implementation of an existing Microsoft API
+ no architectural changes go here.
+
+* Mono.Cairo
+
+ The Mono.Cairo.dll assembly exposes the Cairo API to managed
+ applications. The mapping is a pretty straightforward one,
+ and the programming model is very close to the C API.
+
+ This API is still unstable due to the nature of the underlying
+ API being used and will be revisited as Cairo evolves.
diff --git a/web/embedded-api b/web/embedded-api
new file mode 100755
index 00000000000..3b405c98ddd
--- /dev/null
+++ b/web/embedded-api
@@ -0,0 +1,305 @@
+* Embedding the Mono runtime, preliminary version
+
+ This document describes how to embed the Mono runtime in your
+ application, and how to invoke CIL methods from C, and how to
+ invoke C code from CIL
+
+ Slides for Paolo's presentation at .NET ONE on the embedding
+ API are available here: <a
+ href="http://primates.ximian.com/~lupus/slides/embed">Hosting the Mono
+ Runtime</a>. You can also get his <a
+ href="http://primates.ximian.com/~lupus/slides/embed/Mono-0.01.tar.gz">sample
+ Mono module for Perl</a>
+
+ Authors: Paolo Molaro, Miguel de Icaza.
+
+* Embedding the runtime.
+
+ Embedding the runtime consists of various steps:
+
+ <ul>
+ * Compiling and linking the Mono runtime
+
+ * Initializing the Mono runtime
+
+ * Optionally expose C code to the C#/CIL universe.
+
+ </ul>
+
+ These are discussed in detail next.
+
+** Compiling and Linking
+
+ To embed the runtime, you have to link your code against the
+ Mono runtime libraries. To do this, you want to pass the
+ flags returned by pkg-config to your compiler:
+
+ <pre>
+ pkg-config --cflags --libs mono
+ </pre>
+
+ Like this:
+
+ <pre>
+ gcc sample.c `pkg-config --cflags --libs mono`
+ </pre>
+
+ You can separate the compilation flags from the linking flags, for
+ instance, you can use the following macros in your makefile:
+
+ <pre>
+ CFLAGS=`pkg-config --cflags mono`
+ LDFLAGS=`pkg-config --libs mono`
+ </pre>
+
+** Initializing the Mono runtime
+
+ To initialize the runtime, call mono_jit_init, like this:
+
+ <pre>
+ MonoDomain *domain;
+
+ domain = mono_jit_init ("domain-name");
+ </pre>
+
+ That will return a MonoDomain where your code will be
+ executed. You can create multiple domains. Each domain is
+ isolated from the other domains and code in one domain will
+ not interfere with code in other domains. This is useful if
+ you want to host different applications in your program.
+
+ Now, it is necessary to transfer control to Mono, and setup
+ the threading infrastructure, you do this like this:
+
+ <pre>
+ void *user_data = NULL;
+
+ mono_runtime_exec_managed_code (domain, main_thread_handler, user_data);
+ </pre>
+
+ Where your main_thread_handler can load your assembly and execute it:
+
+ <pre>
+ static void main_thread_handler (gpointer user_data)
+ {
+ MonoAssembly *assembly;
+
+ assembly = mono_domain_assembly_open (domain, "file.dll");
+ if (!assembly)
+ error ();
+ </pre>
+
+ In the above example, the contents of `file.dll' will be
+ loaded into the domain. This only loads the code, but it will
+ not execute anything yet. You can replace `file.dll' with
+ another transport file, like `file.exe'
+
+ To start executing code, you must invoke a method in the
+ assembly, or if you have provided a static Main method (an
+ entry point), you can use the convenience function:
+
+ <pre>
+ retval = mono_jit_exec (domain, assembly, argc - 1, argv + 1);
+ </pre>
+
+ If you want to invoke a different method, look at the
+ `Invoking Methods in the CIL universe' section later on.
+
+** Shutting down the runtime
+
+ To shutdown the Mono runtime, you have to clean up all the
+ domains that were created, use this function:
+
+ <pre>
+ mono_jit_cleanup (domain);
+ </pre>
+
+** Applications that use threads.
+
+ The Boehm GC system needs to catch your calls to the pthreads
+ layer, so in each file where you use pthread.h you should
+ include the &lt;gc/gc.h&gt; file.
+
+ If you can not do this for any reasons, just remember that you
+ can not store pointers to Mono Objects on the stack, you can
+ store them safely in the heap, or in global variables though
+
+* Exposing C code to the CIL universe
+
+ The Mono runtime provides two mechanisms to expose C code to
+ the CIL universe: internal calls and native C code. Internal
+ calls are tightly integrated with the runtime, and have the
+ least overhead, as they use the same data types that the
+ runtime uses.
+
+ The other option is to use the Platform Invoke (P/Invoke) to
+ call C code from the CIL universe, using the standard P/Invoke
+ mechanisms.
+
+ To register an internal call, use this call in the C code:
+
+ <pre>
+ mono_add_internal_call ("Hello::Sample", sample);
+ </pre>
+
+ Now, you need to declare this on the C# side:
+
+ <pre>
+ using System;
+ using System.Runtime.CompilerServices;
+ </pre>
+
+
+ <pre>
+ class Hello {
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ extern static string Sample ();
+ }
+ </pre>
+
+ Since this routine returns a string, here is the C definition:
+
+ <pre>
+ static MonoString*
+ Sample ()
+ {
+ return mono_string_new (mono_domain_get (), "Hello!");
+ }
+ </pre>
+
+ Notice that we have to return a `MonoString', and we use the
+ `mono_string_new' API call to obtain this from a string.
+
+* Invoking Methods in the CIL universe
+
+ Calling a method in the CIL universe from C requires a number of steps:
+
+ <ul>
+ * Obtaining the MonoMethod handle to the method.
+
+ * The method invocation.
+ </ul>
+
+** Obtaining a MonoMethod
+
+ To get a MonoMethod there are several ways.
+
+ You can get a MonoClass (the structure representing a type)
+ using:
+
+ <pre>
+ MonoClass *
+ mono_class_from_name (MonoImage *image, const char* name_space, const char *name);
+ </pre>
+
+ and then loop in the returned class method array until you get
+ the one you're looking for. There are examples of such
+ searches as static functions in several C files in
+ metadata/*.c: we need to expose one through the API and remove
+ the duplicates.
+
+ The other, simpler, way is to use the functions in
+ debug-helpers.h: there are examples of their use in monograph,
+ mint and the jit as well. You basically use a string
+ description of the method, like:
+
+ <pre>
+ "System.Object:GetHashCode()"
+ </pre>
+
+ and create a MonoMethodDesc out of it with:
+
+ <pre>
+ MonoMethodDesc* mono_method_desc_new (const char *name, gboolean include_namespace);
+ </pre>
+
+ You can then use:
+
+ <pre>
+ MonoMethod* mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass);
+ MonoMethod* mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image);
+ </pre>
+
+ to search for the method in a class or in an image. You would
+ tipically do this just once at the start of the program and
+ store the result for reuse somewhere.
+
+** Invoking a Method
+
+ There are two functions to call a managed method:
+
+ <pre>
+ MonoObject*
+ mono_runtime_invoke (MonoMethod *method, void *obj, void **params,
+ MonoObject **exc);
+ and
+ MonoObject*
+ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
+ MonoObject **exc);
+ </pre>
+
+ obj is the 'this' pointer, it should be NULL for static
+ methods, a MonoObject* for object instances and a pointer to
+ the value type for value types.
+
+ The params array contains the arguments to the method with the
+ same convention: MonoObject* pointers for object instances and
+ pointers to the value type otherwise. The _invoke_array
+ variant takes a C# object[] as the params argument (MonoArray
+ *params): in this case the value types are boxed inside the
+ respective reference representation.
+
+ From unmanaged code you'll usually use the
+ mono_runtime_invoke() variant.
+
+ Note that this function doesn't handle virtual methods for
+ you, it will exec the exact method you pass: we still need to
+ expose a function to lookup the derived class implementation
+ of a virtual method (there are examples of this in the code,
+ though).
+
+ You can pass NULL as the exc argument if you don't want to
+ catch exceptions, otherwise, *exc will be set to the exception
+ thrown, if any. if an exception is thrown, you can't use the
+ MonoObject* result from the function.
+
+ If the method returns a value type, it is boxed in an object
+ reference.
+
+ We have plans for providing an additional method that returns
+ an unmanaged->managed thunk like this:
+
+ <pre>
+ void* mono_method_get_unmanaged_thunk (MonoMethod *method);
+ </pre>
+
+ You'll be able to store the returned pointer in a function
+ pointer with the proper signature and call that directly from
+ C:
+
+ <pre>
+ typedef gint32 (*GetHashCode) (MonoObject *obj);
+
+ GetHashCode func = mono_method_get_unmanaged_thunk (System_Object_GetHashCode_method);
+
+ gint32 hashvalue = func (myobject);
+ </pre>
+
+ It may not be possible to manage exceptions in that case,
+ though. I need to think more about it.
+
+** Threading issues
+
+ If your application creates threads on its own, and you want them to
+ be able to call code into the CIL universe with Mono, you have to
+ register the thread with Mono before issuing the call.
+
+ To do so, call the mono_thread_attach() function before you execute
+ any managed code from the thread
+
+* Samples
+
+ See the sample programs in mono/sample/embed for examples of
+ embedding the Mono runtime in your application.
+
+
diff --git a/web/faq b/web/faq
index f07c9822b24..9a45337118c 100644
--- a/web/faq
+++ b/web/faq
@@ -1,11 +1,15 @@
<a href="#basics">Basics</a><br>
-<a href="#ximian">The Ximian Role in the Mono project</a><br>
+<a href="#novell">The Novell Role in the Mono project</a><br>
<a href="#gnome">Mono and GNOME</a><br>
<a href="#gui">Building GUI applications with Mono</a><br>
<a href="#msft">Mono and Microsoft</a><br>
+<a href="#platforms">Mono platforms</a><br>
+<a href="#compatibility">Compatibility</a></br>
<a href="#pnpproject">Mono and the Portable.NET Project</a><br>
<a href="#webservices">Web Services</a><br>
<a href="#asp">Mono and ASP.NET</a><br>
+<a href="#ado">Mono and ADO.NET</a><br>
+<a href="#monodoc">MonoDoc</a><br>
<a href="#devel">Development Tools and Issues</a><br>
<a href="#java">Mono and Java</a><br>
<a href="#extending">Extending Mono</a><br>
@@ -16,7 +20,12 @@
<a href="#licensing">Licensing</a><br>
<a href="#patents">Patents</a><br>
<a href="#etc">Miscellaneous Questions</a><br>
+<a href="#obfuscation">Obfuscation</a></br>
+<a href="#problems">Mono Common Problems</a><br>
+A <a
+href="http://www.monohispano.org/tutoriales/mono-puf//">Spanish
+translation</a> is also available (it is outdated though)
<a name="basics"></a>
** Basics
@@ -31,14 +40,55 @@ A: The Mono Project is an open development initiative sponsored by
implement various technologies developed by Microsoft that have now
been submitted to the ECMA for standardization.
+ The Mono project has also sparked a lot of interest in developing
+ C#-based components, libraries and frameworks. Today Mono is not
+ limited to implement the .NET Framework, but also contains other
+ components. Some of the components of the Mono platform were
+ developed by the Mono team, and some others we have incorporated
+ from other open source efforts, the most important ones:
+
+ <ul>
+ <li><a
+ href="http://remoting-corba.sourceforge.net/">Remoting.CORBA</a>: A
+ CORBA implementation for Mono.
+
+ <li>Ginzu: An implementation on top of Remoting for the <a
+ href="http://www.zeroc.com">ICE</a> stack
+
+ <li><a href="http://gtk-sharp.sf.net">Gtk#</a>: Bindings for
+ the popular Gtk+ GUI toolkit for Unix and Windows systems.
+ Other bindings are available: Diacanvas-Sharp and MrProject.
+
+ <li><a
+ href="http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx">#ZipLib</a>:
+ A library to manipulate various kinds of compressed files and
+ archives (Zip and tar).
+
+ <li>GlGen (available from the Mono CVS): Bindings for OpenGL.
+
+ <li>Mono.LDAP: LDAP access for .NET apps.
+
+ <li>Mono.Data: We ship support for Postgress, MySql, Sybase,
+ DB2, SqlLite, Tds (SQL server protocol) and Oracle databases.
+
+ <li>Mono.Cairo: Bindings for the <a
+ href="http://www.cairographics.org">Cairo</a> rendering
+ engine (Our System.Drawing is implemented on top of this).
+
+ <li>Mono.Posix: Bindings for building POSIX applications using
+ C#.
+
+ <li>Mono.Http: Support for creating custom, embedded HTTP
+ servers and common HTTP handlers for your applications.
+ </ul>
+
Q: What is the difference between Mono and the .NET Initiative?
A: The ".NET Initiative" is a somewhat nebulous company-wide effort by
Microsoft, one part of which is a cross-platform development
framework. Mono is an implementation of the development framework,
but not an implementation of anything else related to the .NET
- Initiative, such as Passport, software-as-a-service, or
- corporate rebranding.
+ Initiative, such as Passport or software-as-a-service.
Q: What technologies are included in Mono?
@@ -51,7 +101,9 @@ A: Mono contains a number of components useful for building new
compiler, and a garbage collecting runtime.
* A class library that can work with any language
- which works on the CLR.
+ which works on the CLR. Both .NET compatible class
+ libraries as well as Mono-provided class libraries
+ are included.
* A compiler for the C# language. In the future we
might work on other compilers that target the Common
@@ -62,7 +114,7 @@ A: Mono contains a number of components useful for building new
Windows has compilers that target the virtual machine from <a
href="http://msdn.microsoft.com/net/thirdparty/default.asp#lang">a
number of languages:</a> Managed C++, Java Script, Eiffel,
- Component Pascal, APL, Cobol, Oberon, Perl, Python, Scheme,
+ Component Pascal, APL, Cobol, Perl, Python, Scheme,
Smalltalk, Standard ML, Haskell, Mercury and Oberon.
The CLR and the Common Type System (CTS) enables applications and
@@ -79,10 +131,12 @@ A: Mono contains a number of components useful for building new
Q: Where can I find the specification for these technologies?
-A: You can find the work-in-progress documentation from the T3G ECMA
- group here:
+A: You can find the information here:
- <a href="http://www.dotnetexperts.com">http://www.dotnetexperts.com</a>
+
+ C# <a href="http://www.ecma.ch/ecma1/STAND/ecma-334.htm">http://www.ecma.ch/ecma1/STAND/ecma-334.htm</a>
+
+ CLI <a href="http://www.ecma.ch/ecma1/STAND/ecma-335.htm">http://www.ecma.ch/ecma1/STAND/ecma-335.htm</a>
Q: Will you implement the .NET Framework SDK class libraries?
@@ -91,39 +145,28 @@ A: Yes, we will be implementing the APIs of the .NET Framework SDK
Q: Will you offer an ECMA-compliant set of class libraries?
-A: Eventually we will. Our current focus is on interoperating
+A: Eventually we will. Our current focus is on inter-operating
with the Microsoft SDK, but we will also offer an ECMA compliant
- set of libraries.
+ subset of the libraries.
Q: What does the name "Mono" mean?
-A: Mono is the word for `monkey' in Spanish. We like monkeys.
+A: Mono is the word for `monkey' in Spanish. We like monkeys.
-Q: Is Mono usable?
+Q: Does Mono work today?
-A: The JIT engine is usable on Intel x86 machines. An interpreter
- can be used on other non-Intel x86 machines.
+A: The execution engine works on various platforms, we support
+ Just-in-Time and Ahead-of-Time compilations on Intel x86 machines
+ (and soon PowerPC).
- The class libraries are mature enough to run some real applications
- (the compiler for instance, and every day more and more applications
- are natively developed with Mono).
+ The class libraries are mature enough to run various real
+ applications: our C# compiler, ASP.NET, and Gtk#-based
+ applications.
-Q: When will you ship it?
+Q: When will you ship Mono?
-A: Different parts of Mono will achieve usability at different stages,
- once we are comfortable with the compiler, we will release "Mono Core",
- which contains everything needed to develop applications with the base
- class libraries. This should be available at some point during 2002.
-
- Other higher level class libraries (ASP.NET, ADO.NET, Windows.Forms) will
- be released when they become stable.
-
-Q: What major components will you include in Mono?
-
-A: Hopefully eveyrthing that Microsoft ships on their Framework
- (ADO.NET, ASP.NET, Windows.Forms), and
- we encourage third party developers to create reusable components that
- work on both Mono and Windows.
+A: Please see the <a href="mono-roadmap.html">Mono Roadmap</a> for
+ more details on the release plans.
Q: How can I contribute?
@@ -145,26 +188,26 @@ Q: Miguel said once that Mono was being implemented in COBOL. Is that true?.
A: No. It was a joke.
-<a name="ximian"></a>
+<a name="novell"></a>
-** The Ximian Role in the Mono Project
+** The Novell Role in the Mono Project
-Q: Why is Ximian working on .NET?
+Q: Why is Novell working on .NET?
-A: Ximian is interested in providing the best tools for programmers to
- develop applications for Free Operating Systems.
+A: Novell is interested in providing the best tools for programmers to
+ develop applications for Free Operating Systems.
For more information, read the project <a
href="rationale.html">rationale</a> page.
-Q: Will Ximian be able to take on a project of this size?
+Q: Will Novell be able to take on a project of this size?
-A: Of course not. Ximian a supporter of the Mono project, but the only way
+A: Of course not. Novell is a supporter of the Mono project, but the only way
to implement something of this size is for the entire free software
community to get involved. Visit the <a href="contributing.html">contributing</a>
page if you'd like to help out.
-Q: What pieces will Ximian be working on?
+Q: What pieces is Novell working on?
A: We will devote most of our resources to work on the pieces which are
on the critical path to release a development and execution
@@ -172,25 +215,30 @@ A: We will devote most of our resources to work on the pieces which are
the real world, it will achieve a critical mass of developers to
improve it further.
-Q: Will Ximian offer Mono commercially?
+Q: Will Novell offer Mono commercially?
A: When Mono is ready to be shipped Ximian will offer a commercial
- support and services for Mono.
+ support and services for Mono. Mono components are also
+ available to be licensed commercially. For licensing details,
+ contact <a
+ href="mailto:mono-licensing@ximian.com">mono-licensing@ximian.com</a>
-Q: Does Ximian provide consulting services around Mono?
+Q: Does Novell provide consulting services around Mono?
-A: Yes, Ximian does provide consulting services around Mono to
+A: Yes, Novell does provide consulting services around Mono to
make it suitable to your needs. Porting the runtime engine,
customizing it, working on specific classes or tuning the code
for your particular needs.
+ Please contact <a
+ href="mailto:mono-licensing@ximian.com">mono-licensing@ximian.com</a>
+ for consulting services information.
+
Q: Will you wait until Mono is finished?
A: Mono will ship on various stages as they mature. Some people
- require only a subset of the technologies, those will ship first.
-
- More advanced features will take more time to develop. A support
- timeline will be available in June 2002.
+ require only a subset of the technologies, those will ship first,
+ see the <a href="mono-roadmap.html">Mono Roadmap</a> for details
<a name="gnome"></a>
** Mono and GNOME
@@ -204,6 +252,10 @@ A: In a number of ways. This project was born out of the need of
implement Winforms and the Drawing2D API and are considering
GObject support.
+ Mono team members work actively on the <a
+ href="http://gtk-sharp.sf.net">Gtk#</a> project: a binding of the
+ GNOME class libraries for .NET and Mono.
+
Q: Has the GNOME Foundation or the GNOME team adopted Mono?
A: Mono is too new to be adopted by those groups. We hope that the
@@ -219,7 +271,7 @@ A: It is still far to early for discussions of "switching over." No
We encourage GNOME developers to continue using the existing tools,
libraries and components. Improvements made to GNOME will have an
- impact on Mono, as they would be the "backend" for various classes.
+ impact on Mono, as they would be the "back-end" for various classes.
Q: Will Mono include compatibility with Bonobo components? What is the
relationship between Mono and Bonobo?
@@ -232,25 +284,80 @@ A: Yes, we will provide a set of classes for implementing and using
Q: Does Mono depend on GNOME?
A: No, Mono does not depend on GNOME. We use a few packages produced by
- the GNOME team like the `glib' library.
+ the GNOME team like the `glib' library, we also use other
+ third-party open source libraries like Cairo and ICU.
Q: But will I be able to build GNOME applications?
A: Yes, we will enable people to write GNOME applications using Mono.
+Q: Do you have C# bindings for GNOME?.
+
+A: Yes, the <a href="http://gtk-sharp.sf.net">Gtk# project</a>
+ provides bindings for Gtk+, Gdk, Atk, libgnome, libgnomecanvas, and
+ libgnomeui. Other libraries under the GNOME framework will be
+ added on an as-needed (and as-requested) basis.
+
<a name="gui"></a>
** GUI applications
Q: Will Mono enable GUI applications to be authored?
-A: Yes, you will be able to build GUI applications. Indeed, that is our
- main focus. We will provide both the Windows.Forms API and the Gtk# API.
+A: Yes, you will be able to build GUI applications. Indeed, that is
+ our main focus. Today you can use Gtk# or #WT to develop GUI
+ applications, and support for Windows.Forms is underway.
Q: What is the difference between Gtk# and System.Windows.Forms?
A: Gtk# is a set of bindings for the Gtk+ toolkit for C# (and other
- CIL-enabled languages). System.Windows.Forms is an API defined
- by Microsoft to build GUI applications.
+ CIL-enabled languages), it integrates natively with the Gnome
+ desktop. System.Windows.Forms is an API defined by Microsoft to
+ build GUI applications.
+
+Q: What are you using to implement Windows.Forms?
+
+A: Windows.Forms is currently being implemented on top of a modified
+ version of Wine that can be used as a library: WineLib.
+
+ Essentially Wine is used as a library that happens to implement the
+ "Win32" toolkit and our Windows.Forms becomes a managed layer on
+ top of this toolkit.
+
+ There are several advantages in this approach: we get Wndproc
+ message compatibility for free (Wndproc is an overridable method in
+ the Control class and it is used to perform advanced tricks with
+ the GUI toolkit) as well as allowing third-party controls that are
+ used to P/Invoke into Win32 in the Windows world to work out of the
+ box on Linux/MacOS.
+
+Q: Why not implement System.Windows.Forms on top of Gtk# or Qt#?
+
+A: Compatibility.
+
+ Although it is possible to run simple Windows.Forms applications
+ with the Gtk#-based backend of Windows.Forms, it is very unlikely
+ that the implementation will ever implement everything needed for
+ full compatibility with Windows.Forms.
+
+ The reason is that Windows.Forms is not a complete toolkit, and to
+ work around this problem some of the underlying Win32 foundation is
+ exposed to the programmer in the form of exposing the Windows
+ message handler (WndProc). Any control can override this method.
+ Also developers often P/Invoke into Win32 to get to functionality
+ that was not wrapped.
+
+ To achieve full compatibility, we would have to emulate this, and
+ it would take too long.
+
+ For more details see the <a href="winforms.html">winforms page</a>
+
+Q: Wine applications do not look like native applications, what are
+ you going to do about this?
+
+A: We have already a few patches into our version of Windows.Forms
+ that makes Wine use the colors and font settings from your desktop,
+ improving the integration a lot. In the future, we will continue
+ to improve this interoperability scenario.
Q: Will I be able to run my smart clients on systems powered by Mono?
@@ -258,9 +365,9 @@ A: As long as your applications are 100% .NET and do not make use
of P/Invoke to call Win32 functions, your smart client applications
will run on Mono platforms.
-Q: Where can I learn mora about Gtk#?
+Q: Where can I learn more about Gtk#?
-A: The following <a href="http://gtk-sharp.sourceforge.net>link</a> sends you to the page of the project.
+A: The following <a href="http://gtk-sharp.sourceforge.net">link</a> sends you to the page of the project.
Q: What can I do with Gtk#?.
@@ -270,26 +377,47 @@ A: Gtk# is becoming very usable and you can create applications and
Q: How can I compile my HelloWorld.cs which uses Gtk#?.
-A: Try: mcs --unsafe -o HelloWorld.exe -r glib-sharp -r pango-sharp -r
- atk-sharp -r gdk-sharp -r gtk-sharp -r gdk-imaging-sharp
- HelloWorld.cs
+A: Try: mcs -r:gtk-sharp HelloWorld.cs
+
+Q: Is there any way how to connect DataAdapter to some GTK# controls?
+
+A: There is a sample file called `DbClient' in gtk-sharp/samples that you
+ might to look at. It is a sample program in Gtk# that adds/updates/deletes
+ information on a Postgress database. When we have the new table/tree widgets,
+ I am sure someone would write an adapter for System.Data (in Gtk2 the
+ tree/list widgets are written using a view/model, so you only need to write
+ a model that maps to the database). You can have a look at
+ gtk-sharp/sample/DbClient, where there is a GTK# application that uses
+ System.Data. It does not use DataAdapter, but DataReader though.
+
+Q: Do you have an estimate for when Windows.Forms will be released?
+A: The plan currently is aimed at Q4/2004.
+
+
+Q: Do you have a comparission chart about the various toolkit
+ offerings?
+
+A: A document explaining this is available at: <a
+ href="http://primates.ximian.com/~miguel/toolkits.html">http://primates.ximian.com/~miguel/toolkits.html</a>.
<a name="msft"></a>
** Mono and Microsoft
Q: Is Microsoft helping Ximian with this project?
-A: No. Ximian CTO Miguel de Icaza had a friendly conversation with
- Microsoft software architect David Stutz, but that's about the
- extent of the contact. Microsoft is interested in other
- implementations of .NET and are willing to help make the ECMA spec
- more accurate for this purpose.
+A: There is no high level communication between Ximian and Microsoft
+ at this point, but engineers who work on .NET or the ECMA groups
+ have been very friendly, and very nice to answer our questions, or
+ clarify part of the specification for us.
+
+ Microsoft is interested in other implementations of .NET and are
+ willing to help make the ECMA spec more accurate for this purpose.
- Ximian representatives have also spoken with Sam Ruby at the ECMA
- TG3 committee to discuss the same issues.
+ Ximian was also invited to participate in the ECMA committee
+ meetings for C# and the CLI.
-Q: Is Microsoft or Corel paying Ximian to do this?
+Q: Are Microsoft or Corel paying Ximian to do this?
A: No.
@@ -298,7 +426,7 @@ Q: Do you fear that Microsoft will change the spec and render Mono
A: No. Microsoft proved with the CLI and the C# language that it was
possible to create a powerful foundation for many languages to
- interoperate. We will always have that.
+ inter-operate. We will always have that.
Even if changes happened in the platform which were undocumented,
the existing platform would a value on its own.
@@ -328,13 +456,6 @@ A: No. MS Passport is unrelated to running .NET compatible applications
produced with the Mono tools. The only thing you will need is a
just-in-time compiler (JIT).
-Q: What is a 100% .NET application?
-
-A: A `100% .NET application' is one that only uses the APIs defined
- under the System namespace and does not use PInvoke. These
- applications would in theory run unmodified on Windows, Linux,
- HP-UX, Solaris, MacOS X and others.
-
Q: If Microsoft will release a port of their .NET platform under the
`Shared Source' license, why should I bother with anything else?
@@ -372,6 +493,199 @@ A: No, it will not. Microsoft Office is a Windows application. To
learn more about running Windows applications on Intel Unix systems
refer to <a href="http://www.winehq.com">the Wine Project</a>.
+Q: Can mono run the WebMatrix?
+
+A: No. That requires System.Windows.Forms support which is not
+ currently implemented.
+
+Q: Does mono have something like Passport?
+ Will mono have a server side Passport/Similar framework for XSP as well as client classes?
+
+A: Not yet, but the client side API for authentication is not the problem.
+ We will likely have a lot of other authentication APIs, like the Liberty
+ Alliance APIs. The problem is people on the web provider end that might use
+ this for authentication.
+
+<a name="platforms"></a>
+** Mono Platforms
+
+Q: What operating systems does Mono run on?
+
+A: Mono is known to run on Linux, Unix and Windows systems.
+
+Q: Can I run Mono applications without using `mono program.exe'?
+
+A: Yes, this is possible on Linux systems, to do this, use something like:
+
+<pre>
+if [ ! -e /proc/sys/fs/binfmt_misc/register ]; then
+ /sbin/modprobe binfmt_misc
+ mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
+fi
+
+if [ -e /proc/sys/fs/binfmt_misc/register ]; then
+ echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register
+else
+ echo "No binfmt_misc support"
+ exit 1
+fi
+</pre>
+
+Q: What architectures does Mono support?
+
+A: Mono today ships with a Just-in-Time compiler for x86, PowerPC and
+ SPARC-based systems. It is tested regularly on Linux, FreeBSD and
+ Windows (with the XP/NT core).
+
+ There is also an interpreter, which is slower that runs on the
+ s390, SPARC, HPPA, StrongARM and PowerPC architectures.
+
+Q: Can Mono run on Windows 9x, or ME editions?
+
+A: Mono requires Unicode versions of Win32 APIs to run,
+ and only a handful of *W functions is supported under Win9x.
+
+ There is Microsoft Layer for Unicode that provides implementation
+ of these APIs on 9x systems.
+
+ Unfortunately it uses linker trick for delayed load that is not
+ supported by ld, so some sort of adapter is necessary.
+
+ You will need MSLU and one of the following libs to link Mono to
+ unicows.dll <a
+ href="http://mono.eurosoft.od.ua/files/unimono.zip">http://mono.eurosoft.od.ua/files/unimono.zip</a>
+ or alternatively search the net for "libunicows".
+
+ No changes to Mono source code required, the only thing is to make
+ sure that linker will resolve imports to adapter library instead of
+ Win32 libs. This is achieved by inserting -lunimono before
+ -lkerner32/user32 in the linker's specs file.
+
+Q: Why support Windows, when you can run the real thing?
+
+A: There are various reasons:
+
+ <ul>
+ <li> About half the contributors to Mono are Windows developers.
+ They have many different for contributing to the effort, and
+ we find it very important to let those developers run the runtime on Windows without forcing
+ them to use a new operating system.
+
+ <li> Supporting Windows helps us identify the portable portions
+ of Mono from the non-portable versions of it, helping Mono
+ become more portable in the future.
+
+ <li> Mono does not heavily modify the windows registry, update system DLLs,
+ install DLLs to the Windows/System32 path. Another words, I knew Mono would
+ not cause any legacy enterprise applications to stop working - and it
+ hasn't. However, our CIO er is againt it because of the changes that would
+ be made to Windows 2000, such as, affecting security.
+ </ul>
+
+<a name="compatibility"></a>
+** Compatibility
+
+Q: Can Mono run applications developed with the Microsoft.NET framework?
+
+A: Yes, Mono can run applications developed with the Microsoft .NET Framework
+ on Unix. There are a few caveats to keep in mind: Mono has not
+ been completed yet, so a few API calls might be missing; And in
+ some cases the Mono behavior *might* be incorrect.
+
+Q: Will missing API entry points be implemented?
+
+A: Yes, the goal of Mono is to implement precisely the .NET Framework
+ API (as well as compile-time selectable subsets, for those
+ interested in a lighter version of Mono).
+
+Q: If the behavior of an API call is different, will you fix it?
+
+A: Yes, we will. But we will need your assistance for this. If you find a bug
+ in the Mono implementation, please fill a bug report in <a
+ href="http://bugzilla.ximian.com">http://bugzilla.ximian.com</a>.
+ Do not assume we know about the problem, we might not, and using the bug tracking
+ system helps us organize the development process.
+
+Q: Can I develop my applications on Windows, and deploy on a supported
+ Mono platform (like Linux)?
+
+A: Yes, you can.
+
+ As of today, Mono is not 100% finished, so it is sometimes useful
+ to compile the code with Mono, to find out if your application
+ depends on unimplemented functionality.
+
+Q: Will applications run out the box with Mono?
+
+A: Sometimes they will. But sometimes a .NET application might invoke
+ Win32 API calls, or assume certain patterns that are not correct
+ for cross-platform applications.
+
+Q: What is a 100% .NET application?
+
+A: A `100% .NET application' is one that only uses the APIs defined
+ under the System namespace and does not use P/Invoke. These
+ applications would in theory run unmodified on Windows, Linux,
+ HP-UX, Solaris, MacOS X and others.
+
+ Note that this requirement also holds for all assemblies used by the
+ application. If one of them is Windows-specific, then the entire program
+ is not a 100% .NET application.
+
+ Furthermore, a 100% .NET application must not contain non-standard data
+ streams in the assembly. For example, Visual Studio .NET will insert a
+ <tt>#-</tt> stream into assemblies built under the "Debug" target.
+ This stream contains debugging information for use by Visual Studio .NET;
+ however, this stream can not be interpreted by Mono (unless you're willing
+ to donate support).
+
+ Thus, it is recommended that all Visual Studio .NET-compiled code be
+ compiled under the Release target before it is executed under Mono.
+
+Q: Can I execute my Visual Studio .NET program (Visual Basic .NET, Visual C#,
+ Managed Extensions for C++, etc.) under Mono?
+
+A: Yes, with some reservations.
+
+ The .NET program must either be a 100% .NET application, or (somehow) have
+ all dependent assemblies available on all desired platforms. (How to do so
+ is outside the bounds of this FAQ.)
+
+ Mono must also have an implementation for the .NET assemblies used. For
+ example the System.EnterpriseServices namespace is part of .NET, but it
+ has not been implemented in Mono. Thus, any applications using this
+ namespace will not run under Mono.
+
+ With regards to languages, C# applications tend to be most portable.
+
+ Visual Basic .NET applications are portable, but Mono's
+ Microsoft.VisualBasic.dll implementation is incomplete. It is recommended
+ to either avoid using this assembly in your own code, only use the
+ portions that Mono has implemented, or to help implement the missing
+ features. Additionally, you can set 'Option Strict On', which
+ eliminates the implicit calls to the unimplemented
+ Microsoft.VisualBasic.CompilerServices.ObjectType class.
+ (Thanks to JĂśrg Rosenkranz.)
+
+ Managed Extensions for C++ is least likely to operate under Mono. Mono
+ does not support mixed mode assemblies (that is, assemblies containing both
+ managed and unmanaged code, which Managed C++ can produce). You need a
+ fully-managed assembly to run under Mono, and getting the Visual C++ .NET
+ compiler to generate such an executable can be difficult. You need to use
+ only the .NET-framework assemblies, not the C libraries (you can't use
+ <b>printf</b>(3) for example.), and you need to use
+ the linker options <tt>/nodefaultlib /entry:main mscoree.lib</tt> in
+ addition to the <tt>/clr</tt> compiler flag. You can still use certain
+ compiler intrinsic functions (such as <b>memcpy</b>(3)) and the STL.
+ You should also see <a
+ href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vcgrfconvertingmanagedextensionsforcprojectsfrommixed-modetopureil.asp"
+ >Converting Managed Extensions for C++ Projects from Mixed Mode to Pure
+ Intermediate Language</a> at MSDN.
+ Finally, you can use PEVERIFY.EXE from the .NET SDK to determine if the
+ assembly is fully managed.
+
+ Thanks to Serge Chaban for the linker flags to use.
+
<a name="pnpproject"></a>
** Mono and Portable.NET
@@ -383,45 +697,132 @@ A: Most of Mono is being written using C#, with only
It is easier to describe what is unique about Mono:
<ul>
+ <li> An advanced native-code compilation engine: Both
+ just-in-time compilation (JIT) and pre-compilation of CIL
+ bytecodes into native code are supported.
+
+ <li> A foundation for code optimization: The new code generator in
+ Mono builds on the experience of our first JIT engine, and enables
+ us to implement various advanced compiler optimization
+ tricks. With an SSA-framework, plenty of new optimizations are possible.
+
+ The current list of optimizations are: Peephole postpass,
+ Branch optimizations, Inline method calls, Constant folding, Constant
+ propagation, Copy propagation, Dead code elimination, Linear scan
+ global reg allocation, Conditional moves, Emit per-domain code,
+ Instruction scheduling, Intrinsic method implementations, Tail
+ recursion and tail calls, Loop related optimizations, Fast x86 FP
+ compares, Leaf procedures optimizations
+
<li> A self-hosting C# compiler written in C#, which is clean, easy
to maintain.
+ <li> Focus on the .NET Framework: we are tracking down the .NET
+ Framework API definition, as we believe it is the API people
+ will be most familiar with.
+
<li> A multi-platform runtime engine: both a JIT engine and an
- interpreter exist. The JIT engine runs currently on x86
- systems, while the interpreter works on Sparc, StrongARM and
- PowerPC systems.
+ interpreter exist. The JIT engine runs currently on x86,
+ PowerPC Sparc and S390 systems, while the interpreter works on
+ x86, SPARC, StrongARM, s390 and PowerPC systems.
- <li> Supports Linux, Windows and Solaris at this point.
+ The JIT engine is being ported to amd64 systems as of this
+ time.
+
+ <li> Supports Linux, BSD, MacOS, Windows and Solaris at this point.
<li> The JIT engine is written using a portable instruction
- selector which not only generates good code (we are told
- that we are faster than Rotor, but it is hard to tell) but
- is also the foundation to retarget the JIT engine to other
+ selector which not only generates good code but
+ is also the foundation to re-target the JIT engine to other
systems.
- The system employed is described in various compiler
- books and it is very similar to what is described in the
- book that covers LCC, the Ansi C retargetable C compiler.
-
- <li> The JIT engine supports inlining, constant folding and propagation,
-
- <li> Full support for remoting in the runtime, but the class
- libraries are still behind.
+ <li> Full support for remoting in the runtime.
<li> The C# compiler, the JIT engine and the class libraries are
- mature enough that the whole system is self-hosting, ie, that
- it can be fully developed with itself at this point.
-
- <li> We are not yet done, and there is a lot of work left to be
- done
+ mature enough that the whole system has been self-hosting
+ since April 2002. This means that we develop Mono
+ completely with itself at this point.
+
+ By forcing ourselves to use our own code to develop our
+ tools, we bug fix problems rapidly, and the system is
+ overall more robust and tested than if we did not.
+
+ <li> Our class libraries are licensed under the terms of the MIT
+ X11 license which is a very liberal license as opposed to
+ the GNU GPL with exceptions, this means that Mono can be
+ used in places where the GPL with exceptions is not
+ permissible.
+
+ <li> Mono has a complete Web Services stack: we implement ASP.NET
+ web servers and web clients as well as implementing the
+ Remoting-based SOAP infrastructure.
+
+ <li> Remoting implementation: Mono has a complete remoting
+ infrastructure that is used in our own codebase to provide
+ added functionality and performance to our ASP.NET engine
+ and more.
+
+ <li> Mono has a complete <a href="c-sharp.html">C# 1.0</a>
+ implementation and has been stress tested a lot more than
+ Portable.NET's compiler.
+
+ <li> Mono's C# compiler has strong error handling and has closer
+ adherence to the specification with support for definite
+ assignment (required to generate verifiable IL code) and
+ CLS conformance checking.
+
+ <li> Mono's C# compiler is written in C# which is easier for new
+ developers to come in and improve, fix and tune. The Mono
+ C# compiler in C# is faster than their C-based compiler.
+
+ <li> Preview of C# 2.0: a work in progress for a 2.0
+ implementation of our compiler is available (iterators,
+ generics and anonymous methods are available in our
+ "preview" compiler).
+
+ <li> Mono has a complete Reflection and Reflection.Emit: these
+ are important for advanced applications, compilers and
+ dynamic code generation.
+
+ <li> Mono has a <a href="xml-classes.html">complete managed XML
+ stack</a>: XML, XPath, XML Serializer, XML Schema handling
+ are fully functional, feature complete and tuned for
+ performance.
+
+ <li> Mono has a <a href="crypto.html">complete cryptography stack
+ </a>: we implement the 1.0 and 1.1 APIs as well as using our
+ fully managed stack to implement the SSL/TLS transports.
+
+ <li> <a href="ado-net.html">Extensive database support</a>: Mono
+ ships with database provides for <a
+ href="firebird.html">Firebird</a>, <a href="ibmdb2.html">IBM
+ DB2</a>, <a href="oracle.html">Oracle</a>, <a
+ href="sybase.html">Sybase</a>, Microsoft <a
+ href="tdsclient.html">SQL Server</a>, <a
+ href="sqlite.html">SQL Lite</a>, <a
+ href="mysql.html">MySQL</a>, <a
+ href="postgresql.html">PostgresSQL</A>, <a href="oledb.html">Ole
+ DB</a> and <a href="odbc.html">ODBC</a>.
+
+ <li> Mono includes full LDAP support.
<li> We have a great community of developers, without which Mono
would not be possible.
-
- <li> We will provide an ahead of time compilation mode in the
- future.
</ul>
+ In general, Mono is more mature and complete since it has been used
+ to develop itself, which is a big motivator for stability and
+ correctness, while Portable.NET remains pretty much an untested
+ platform.
+
+Q: I hear Mono keeps changing the P/Invoke API, why?
+
+A: We are just fixing our implementation to be compatible with the
+ Microsoft implementation. In other words, the Mono P/Invoke API is
+ more complete when compared to the Portable.NET version, hence
+ various pieces of software that depend on this extended
+ functionality fail to work properly with Portable.NET.
+
<a name="webservices"></a>
** Web Services
@@ -437,7 +838,7 @@ A: Mono is only related to Web Services in that it will implement the
Q: Can I author Web Services with Mono?
A: You will be able to write Web Services on .NET that run on Mono and
- viceversa.
+ vice-versa.
Q: If Mono implements the SDK classes, will I be able to write and
execute .NET Web Services with it?
@@ -451,7 +852,7 @@ Q: What about Soup? Can I use Soup without Mono?
A: Soup is a library for GNOME applications to create SOAP servers and
SOAP clients, and can be used without Mono. You can browse the
source code for soup using <a
- href="http://cvs.gnome.org/bonsai">GNOME's Bonsai</a>.
+ href="http://cvs.gnome.org/bonsai/">GNOME's Bonsai</a>.
Q: Can I use CORBA?
@@ -459,30 +860,78 @@ A: Yes. The CLI contains enough information about a class that
exposing it to other RPC systems (like CORBA) is really simple, and
does not even require support from an object.
- We will be implementing CORBA interoperation as an extension to the
- Mono classes so that we can integrate with Bonobo, just like
- Microsoft provides COM interoperation classes and support
- mechanisms.
+ <a href="http://remoting-corba.sourceforge.net/">Remoting.CORBA</a> is
+ a CORBA implementation that is gaining momentum.
+
+ Building an implementation of the Bonobo interfaces once this is ready
+ should be relatively simple.
Q: Can I serialize my objects to other things other than XML?
A: Yes, although the serializing tools have not yet been planned, and
-you would probably have to implement them yourself.
+ you would probably have to implement them yourself.
Q: Will Mono use ORBit?
-A: No. Mono will be using a new implementation of CORBA that isn't still started.
+A: There are a few advantages in using ORBit, like reusing existing code
+ and leveraging all the work done on it. Michael Meeks has posted
+ a few <a href="http://lists.ximian.com/archives/public/mono-list/2002-September/008592.html">reasons</a>,
+ as well as some <a href="http://lists.ximian.com/archives/public/mono-list/2002-September/008657.html">ideas</a>
+ that could be used to reuse ORBit.
+
+ Most users are likely to choose a native .NET solution, like <a href="http://cvs.gnome.org/bonsai">Remoting.CORBA</a>
+
+
+<a name="monodoc"></a>
+** MonoDoc
+
+Q: What is MonoDoc?
+
+A: MonoDoc is a graphical documentation browser for the Mono class
+ libraries. Currently, monodoc consists of a Gtk# application and is
+ in heavy development.
<a name="devel"></a>
** Development Tools and Issues
-Q: Will it be possible to use the CLI features without using bytecodes
- or the JIT?
+Q: I am having trouble compiling a new version of Mono from CVS, it
+ complains about my runtime being out of sync.
+
+A: To upgrade your class libraries and compiler, see the
+ INSTALL.txt in the MCS directory.
+
+ The single biggest source of confusion seems to be the "Your
+ runtime is out of sync" messages. Realize that this is *normal*
+ while BUILDING. Think about it: you're building a new class
+ library with the old runtime. If the new class library references
+ a function that the old runtime knows nothing about, the runtime
+ system issues this warning.
+
+ Basically what needs to happen is for a new mono runtime to be
+ compiled, then the corlib class library be compiled, and once this
+ is done, install the new runtime, followed by corlib.
+
+ Once this is done, you can continue building your entire
+ environment.
+
+ For instance you just need to:
+ 1.- Upgrade your Mono runtime (you might better do it with the
+ mono-build.sh script available in the <a
+ href="http://www.go-mono.com">download</a> page.
+ 2.- Get the latest mono-lite tarball from the daily snapshots
+ <a href="http://www.go-mono.com/daily/">page</a>, unzip and
+ untar and copy all the dll files to your install path lib
+ directory (typically pointed by the $MONO_PATH variable).
+ Copy all the exe files to the install path bin directory.
+ 3.- Then checkout or update your mcs CVS copy. Then follow
+ the steps described in mcs/INSTALL.txt.
+
+Q: Will it be possible to use the CLI features without using byte codes or the JIT?
A: Yes. The CLI engine will be made available as a shared library.
The garbage collection engine, the threading abstraction, the
- object system, the dynamic type code system and the JIT will be
- available for C developers to integreate with their applications if
+ object system, the dynamic type code system and the JIT are
+ available for C developers to integrate with their applications if
they wish to do so.
Q: Will you have new development tools?
@@ -492,6 +941,9 @@ A: With any luck, Free Software enthusiasts will contribute tools to
initially using the Microsoft implementation of the CLI and then
executed later with Mono.
+ We are recommending people to use and contribute to existing
+ projects like SharpDevelop, Anjuta and Eclipse.
+
Q: What kind of rules make the Common Intermediate Language useful for
JITers?
@@ -519,45 +971,169 @@ A: In Mono, xsp is just the name of the C# code generator for ASP.NET
Pages" technology so as they are very different things, they don't
conflict.
-Q: What about using something like Jabber instead of the System.Messaging
- namespace?.
+Q: Is there any plan to develop an aspx server for Mono?.
-A: In short, MSMQ is not something like Jabber, but asynchronous messaging
- through queues. Usefull queues do more than serialize messages, they are
- also platform bridges.
+A: The XSP reference server is available and you can also use mod_mono
+ with Apache.
-Q: Are you supporting XMLDocument and relatives?.
+Q: Is there any way I can develop the class libraries using Linux yet?
-A: Currently, we aren't implementing them yet. It would require updates to
- most of the XmlNode derivatives so it's not a trivial task. We are
- currently focusing on getting XPath support working.
+A: Yes. Mono has been self hosting since May 2002.
-Q: Is there any plan to develop an aspx server for Mono?.
+Q: Is there any way I can install a known working copy of mono in /usr,
+ and an experimental copy somewhere else, and have both copies use
+ their own libraries? (I'm still not very good at library paths in
+ Linux)
-A: The webserver turned out to be very simple compared to the rest of the
- work. Gonzalo has got the page generator mostly done (a module called
- xsp, who has nothing to do with the XSP term used in the Apache Project).
- Patrik has done a lot of the work to get the ProcessRequest to work.
- You can try to help in the final touches to the System.Web classes and
- writing regression tests for the widgets we have.
+A: Yes. Just use two installation prefixes.
+
+Q: How should I write tests or a tests suite?
+
+A: If you do a test suite for C#, you might want to keep it
+ independent of the Mono C# compiler, so that other compiler
+ implementations can later use it.
+
+Q: Would it be too terrible to have another corlib signed as mscorlib?
+
+A: We rename corlib to mscorlib also when saving the PE files, in fact,
+ the runtime can execute program created by mono just fine.
+
+Q: Is it possible to build a C# file to some sort of intermediate format which
+ can linked into a final module, like the traditional .c -> .o -> .so path?
+
+A: You can use:
+
+ mcs /target:library file1.cs, mcs /target:library file2.cs,
+ mcs /target:exe file1.dll file2.dll /out:mybin.exe
+
+Q: Is there any plans for implementing remoting in the near future?
+
+A: The remoting infrastructure is in place. We have implementations
+ of the TcpChannel, HttpChannel and the Soap and Binary Formatters.
+ They are compatible with .NET.
+
+ However, some classes from the library may have a different binary
+ representation, because they may have a different internal data
+ structure, so for example you won't be able to exchange a Hastable
+ object between Mono and MS.NET. It should not be a problem if you
+ are using primitive types, arrays or your own classes. In any case,
+ could you post a test case?
+
+
+Q: My C code uses the __stdcall which is not availble on Linux, how can I
+ make the code portable Windows/Unix across platforms?
+
+A: Replace the __stdcall attribute with the STDCALL macro, and include this
+ in your C code for newer gcc versions:
+
+ #ifndef STDCALL
+ #define STDCALL __attribute__((stdcall))
+ #endif
+
+Q: I want to be able to execute Mono binaries, without having to use the "mono"
+ command. How can I do this?
+
+A: From Carlos PerellĂł:
+
+ <i>I think that the best solution is the binfmt feature with the
+ wrapper that exists with Debian packages at:
+
+ <a href="http://www.debianplanet.org/mono/dists/unstable/main/source/admin/">http://www.debianplanet.org/mono/dists/unstable/main/source/admin/</a>
+
+ If you want use it with Big endian machines, you should apply a patch
+ (<a href="http://carlos.pemas.net/debian/mono/binfmt-detector-cli.c.diff">http://carlos.pemas.net/debian/mono/binfmt-detector-cli.c.diff</a>)
+
+ It works really good and lets you use wine also, it reads the .exe file
+ headers and check if it's a .net executable.
+
+ This way you just execute: ./my-cool-mono-application.exe and it works
+ without the need of any wrapper.</i>
+
+Q: I see funny characters when I run programs, what is the problem?
+
+A: (From Peter Williams and Gonzalo Paniagua):
+
+ This is Red Hat 9 (probably) using UTF8 on its console; the bytes are
+ the UTF8 endianness markers. You can do:
+
+ LC_ALL=C mono myexe.exe
+
+ And they wont show up.
+
+ Alternatively, you can do:
+
+ $ echo -e "\033%G"
+
+ to enable UTF-8 on the console.
<a name="asp">
** Mono and ASP.NET
-Q: Is Mono supporting ASP.NET?
+Q: Does Mono support ASP.NET?
-A: Yes. The development of the support for ASP.NET comes in various stages,
- here is what Gonzalo has been working on: 1. The Parser. 2. Getting the
- parser to generate output compatible with ASP.NET. 3. Running the sample
- output with the real Microsoft runtime but using our generated page. 4.
- Running the sample with our classes with the .NET runtime. 5. Running
- our sample code with our classes with our runtime. This is the process
- we are following. Currently Gonzalo has reached point 3.
+A: Yes.
-Q: I have heard that their is a webserver developed with Mono. Is it true?.
+ Mono supports ASP.NET, we have shown an unmodified IBuySpy
+ installation running on Mono as well as various other programs. You can
+ try it yourself downloading the XSP server.
-A: Yes. You can find it <a href="http://home.adelphia.net/~aljames/webserver.htm">here</a>
- Read the README for more info.
+Q: Do I need install cygwin to work on ASP.NET in mono or Linux is enough since
+ it is self host right now.
+
+A: Linux is enough.
+
+Q: How can I run ASP.NET-based applications with Mono?
+
+A: You need the Mono runtime and a hosting web server. Currently we distribute a
+ small web server called `xsp' which is used to debug applications, or you can choose
+ to use Daniel's Apache 2 module.
+
+Q: Any plan to make ASP.NET in mono works with Apache in Linux?.
+
+A: Daniel has authored an Apache2 Module for Mono that hosts the ASP.NET runtime
+ and is available here: <a
+ href="http://apacheworld.org/modmono/">http://apacheworld.org/modmono/</a>
+
+Q: Will you support Apache 1?
+
+A: Modules developed for Apache 2 are not compatible with Apache 1.3
+ Daniel plans to support Apache 1.3 in the future but the current focus is on
+ Apache 2, because of the better support for threading and Windows.
+
+Q: Can I run Apache 1 and Apache 2 on the same machine?
+
+ You can always keep a copy of Apache 2 running in parallel with your Apache
+ 1.3 (either different port or using a reverse proxy).
+
+ You can also bind the two servers to different IP addresses on the
+ same physical machine.
+
+<a name="ado">
+** Mono and ADO.NET
+
+Q: What is the status of ADO.NET support?. Could I start migrating
+ applications from MS.NET to Mono?.
+
+A: You could start right now using the ADO.NET support in mono, of course,
+ if you want to help filling the missing gaps while you develop your app
+ :-) Well, what I mean is that we're not that far to having full ADO.NET
+ support in Mono, and we've got a lot of working things, so if we could
+ get more help, we'd finish it really soon :-)
+
+Q: In developing the data architecture for the application are there and
+ objects I should stay away from in order to insure the smoothest possible
+ transition (minimum code rewrite) to Mono's ADO.NET implementation? (For
+ example, strongly typed datasets versus untyped datasets, etc...)
+
+A: We are implementing all the classes in Microsoft .NET's System.Data, so
+ you can be sure that things will work the same in Mono as with the Microsoft
+ implementation.
+
+Q: Does Mono can to connect to Sybase by using Mono.Data.*?
+
+A: Yes. use Mono.Data.SybaseClient. First of all you have to create a
+ SybaseConnection, and then, from it, use it as any other
+ IDbConnection-based class.
<a name="java">
** Mono and Java
@@ -568,12 +1144,13 @@ Q: Why don't you use Java? After all, there are many languages that
A: You can get very good tools for doing Java development on free
systems right now. <a href="http://www.redhat.com">Red Hat</a> has
contributed a <a href="http://gcc.gnu.org">GCC</a> <a
- href="http://gcc.gnu.org/java">frontend for Java</a> that can take
+ href="http://gcc.gnu.org/java/">front-end for Java</a> that can take
Java sources or Java byte codes and generate native executables; <a
- href="http://www.transvirtual.com">Transvirtual</a> has implemented
+ href="http://www.google.com/search?q=transvirtual">Transvirtual</a>
+ implemented
<a href="http://www.kaffe.org">Kaffe</a> a JIT engine for Java;
Intel also has a Java VM called <a
- href="http://www.intel.com/research/mrl/orp">ORP</a>.
+ href="http://www.intel.com/research/mrl/orp/">ORP</a>.
The JVM is not designed to be a general purpose virtual machine.
The Common Intermediate Language (CIL), on the other hand, is
@@ -583,44 +1160,36 @@ A: You can get very good tools for doing Java development on free
Q: Could Java target the CLI?
-A: Yes, Java could target the CLI. We have details on a <a
- href="ideas.html#guavac">project</a> that someone could take on to
- make this happen.
+A: Yes, Java could target the CLI, Microsoft's J# compiler does that.
- Microsoft has an implemenation of the Java language called J# that
- can target the CIL execution engine.
+ The <a href="http://weblog.ikvm.net/">IKVM</a> project builds a
+ Java runtime that works on top of .NET and on top of Mono. IKVM is
+ essentially a JIT compiler that translates from JVM bytecodes into
+ CIL instructions, and then lets the native JIT engine take over.
-Q: Is it possible to write a JVM byte code to CIL convertor?
+Q: Is it possible to write a JVM byte code to CIL converter?
-A: Yes, it is possible. Here are a few starting point:
+A: Yes, this is what <a href="http://weblog.ikvm.net">IKVM</a> does.
- <ul>
- * A byte code representation is really a flattened forest of
- trees. Look at the Mono JIT engine to see how we compute
- the basic blocks (this is used to figure out the "trees").
+Q: Could mono become a hybrid CIL/java platform?
- The forest is just an array of trees.
+A: This can be obtained easily with IKVM.
- Indeed, run the JIT engine with -d (mono -d prog.exe) and
- you will see how these trees look like.
+Q: Do you plan to implement a Javascript compiler?
- You will have to do something similar for Java.
+A: Yes. The beginnings of the JScript compiler can be found on CVS.
+ Cesar coordinates this effort.
- * Each "forest of trees" has a meaning. This meaning can now
- be translated into the equivalent "meaning" in CLR-land.
- </ul>
+Q: Can Mono or .NET share system classes (loaded from mscore.dll and other
+ libs) or will it behave like Sun's Java VM?
-Q: Could mono become a hybrid cil/java platform?
-
-A: No. It is quite far from the philosophy of the project. The idea of Mono
- is, to have only _one_ VM, on which all can run. And if there existing a
- binary-converter from Java-.class to IL and if there existing something
- like J-Sharp on Mono, you can write programs in Java, which than can run
- on Mono. You do not need two bindings (like your example: GTK-Sharp _and_
- Java-Gnome). You need only _one_ of it (GTK-Sharp). Thats the idea of Mono.
- An other point is, that there are no people, who use OpenSource-JVMs. They
- all prefer Suns original. But for Unix there don't exist a .NET-Framework.
- So it is possible, that in the future Mono is the standard .NET for unixes.
+A: What you can do with mono is to load different applications in their own
+ application domain: this is a feature of the CLR that allows sandboxing
+ applications inside a single process space. This is usualy exploited to
+ compartmentalize different parts of the same app, but it can also be
+ effectively used to reduce the startup and memory overhead.
+ Using different appdomains the runtime representation of types and
+ methods is shared across applications.
<a name="extending"></a>
** Extending Mono
@@ -645,11 +1214,32 @@ Q: Do you plan to Embrace and Extend .NET?
A: Embracing a good technology is good. Extending technologies in
incompatible ways is bad for the users, so we do not plan on
- extending the technologies.
+ making incompatible changes to the technologies.
If you have innovative ideas, and want to create new classes, we
encourage you to make those classes operate correctly well in both
- Mono and .NET
+ Mono and .NET.
+
+ Today Mono ships with a number of extra libraries that were
+ developed either by members of the Mono community, or other
+ groups.
+
+ In some cases, we have found the bits from Microsoft to be
+ incomplete, but we avoid breaking the API, instead we expose the
+ missing functionality in new assemblies (See Mono.Security and
+ System.Security).
+
+Q: Is there any way I can develop the class libraries using Linux yet?
+
+A: Yes. Mono has been selfhosting since March 2002.
+
+Q: Is there any way I can install a known working copy of mono in /usr,
+ and an experimental copy somewhere else, and have both copies use
+ their own libraries? (I'm still not very good at library paths in
+ Linux)
+
+A: Yes. Just use two installation prefixes.
+
<a name="portability"></a>
** Portability
@@ -664,31 +1254,34 @@ Q: What about Mono on non Linux-based systems?
A: Our main intention at Ximian is to be able to develop GNOME
applications with Mono, but if you are interested in providing a
- port of the Winform classes to other platforms (frame buffer or
+ port of the Winforms classes to other platforms (frame buffer or
MacOS X for example), we would gladly integrate them, as long
they are under an open source license.
Q: What operating systems/CPUs do you support
-A: Mono currently runs on Linux, Windows, Solaris and FreeBSD.
+A: Mono currently runs on Linux, Windows, Solaris, FreeBSD, HP-UX and
+ MacOS X.
+
There is a JIT engine available for x86 processors that can
generate code and optimizations tailored for a particular CPU.
- Interpreters exist for the SPARC, PowerPC and StrongARM cpus.
+ Interpreters exist for the SPARC v8, SPARC v9, Itanium, HP-PA,
+ PowerPC and StrongARM CPUs.
Q: Does Mono run on Windows?
-A: Yes. The Compiler and the runtime both run on Windows.
+A: Yes. You can get pre-compiled
+ binaries from <a href="http://www.go-mono.com/download.html">http://www.go-mono.com/download.html</a>
-Q: When will mono and mcs compile on Linux?.
+Q: Does Mono run on Linux?
-A: That happend a long time ago. Know you can download and compile
- them or even install them from already made binary packages for
- Windows and for Linux (RPM/DEB).
+A: Yes. You can get pre-compiled
+ binaries from <a href="http://www.go-mono.com/download.html">http://www.go-mono.com/download.html</a>
Q: Will I require Cygwin to run mono?
-A: No. While you'll need it to compile it, it runs without cygwin and does not even require cygwin1.dll
+A: No. Cygwin is only required to build Mono.
Q: Will Mono depend on GNOME?
@@ -697,6 +1290,15 @@ A: It will depend only if you are using a particular assembly (for
in Mono for implementing a `Hello World Enterprise P2P Web
Service', you will not need any GNOME components.
+Q: Do you plan to port Rhino to C#?.
+
+A: Eto Demerzal has started a Rhino port to C#.
+
+Q: Has anyone succeeded in building a Mac version of the C# environment.
+ If so can you explain how?
+
+A: Yes, Mono works on Linux/PPC and MacOS X (10.2 and 10.3)
+
<a name="reuse"></a>
** Reusing Existing Code
@@ -705,47 +1307,77 @@ Q: What projects will you reuse or build upon?
A: We want to get Mono in the hands of programmers soon. We are
interested in reusing existing open source software.
-Q: What about Intel's research JIT framework, ORP?
+Q: Will I be able to use Microsoft SQL Server 2000 or will I need to switch
+ to a specific Open Source Database. Will I need to recode?
+
+A: There is no need to rewrite your code as long as you keep using
+ Microsoft SQL Server. If you want to use an open source database,
+ you might need to make changes to your code.
+
+Q: What do I need to watch out for when programming in VB.NET so that I'm
+ sure to be able to run those apps on Linux?
+
+A: Not making any P/Invoke or DLL calls should and not using anything in
+ the Microsoft.* namespaces should suffice. Also do not use any
+ Methods/Classes marked as "This type/method supports the .NET Framework
+ infrastructure and is not intended to be used directly from your code."
+ even if you know what these classes/methods do.
+
+Q: Will built-in reporting be supported for crystal reports? This is a
+ heavily used part of our system.
+
+A: . Crystal Reports are propriety. Someone may try to emulate
+ the behavior, but no-one has yet volunteered.
-A: At this time, we are investigating whether we can use elements of
- ORP for Mono. ORP is a research JIT engine that has a clearly
- defined API that splits the JIT from the GC system and the actual
- byte code implementation.
+Q: Who about writing to the registry? As I understand it, Linux does not have
+ a counterpart to the registry. Should I avoid relying on that feature?
- We are using some pieces of ORP (Their code generation interface)
- and we use it as a source of inspiration for optimizations. Paolo
- and Dietmar consider ORP as being one of the best JIT engines out
- there (and their research work and papers are very useful if you are
- interested in JIT technology).
+A: Try to avoid it. Although there would be a emulation for registry in
+ Mono too. GNOME does have a registry like mechanism for configuration. But
+ Even if gnome has a configuration system similar to the registry, the keys
+ will not be equal, so you will probably end up having to do some runtime
+ detection, and depending on this load an assembly that has your
+ platform-specific hacks.
-Q: What about using GNU Lightning?
+Q: System.Data.SqlClient with FreeTDS, will you port parts of these to C# and
+ use them?
-A: We are not using GNU Lightning. Our JIT is using an instruction
- selector based on tree-pattern matching, and a code generation
- interface that is very tied to the current architecture.
+A: This has been done.
<a name="gcc"></a>
** Mono and GCC
-Q: Are you working on a GCC front-end to C#? A GCC backend that will
- generate CIL images? What about making a front-end to GCC that
- takes CIL images and generates native code?
+Q: Are you working on a GCC front-end to C#?
-A: We are currently seeking volunteers for those projects.
- Visit the <a href="contributing.html">contributing</a> section if
- you are interested.
+A: We are not working on a GCC front-end for C#
-Q: But would this work around the GPL in the GCC compiler and allow
- people to work on non-free front-ends?
+Q: Will you support C/C++ on the Mono VM?
-A: People can already do this by targeting the JVM byte codes (there
- are about 130 compilers for various languages that target the JVM).
+A:The open64 compiler effort from SGI helps a lot in this direction.
-Q: Why are you writing a JIT engine instead of a front-end to GCC?
+ The Open64 compiler is a modified version of GCC that
+ generates a new intermediate language instead of RTL. This could be
+ the foundation to generate CIL code, and to implement the upcoming
+ Managed extensions to C++ from ECMA.
+
+ Open64 (and other derivative forks of GCC) split the gcc front-ends
+ from the backends by using the WHIRL intermediate representation.
+ Kris has begun the implementation of a translator from WHIRL to CIL.
+
+ So it will be possible to use the GCC compilers to target the CIL.
+
+Q: What about Managed C++?
+
+A: Once a full translator for WHIRL exists, we are interested in
+ looking at expanding the GCC frontends to include extensions for
+ Managed C++.
+
+Q: What about making a front-end to GCC that takes CIL images and
+ generates native code?
+
+A: There is no active work on this area, but Mono already provides
+ pre-compilation services (Ahead-of-Time compilation).
-A: We want the JIT engine and runtime engine because they will be able
- to execute CIL executables generated on Windows, and so no recompilation
- will be necessary.
<a name="performance"></a>
** Performance
@@ -755,16 +1387,23 @@ Q: How fast will Mono be?
A: We can not predict the future, but a conservative estimate is that
it would be at least `as fast as other JIT engines'.
- We would like to ship various JIT engines with Mono, just like
- Microsoft has done with their .NET development platform. We could
- provide a faster, JIT for fast load times but lower performance,
- and an and an optimizing JIT that would be slower at generating
- code but produce more optimal output.
+ Mono's JIT engine has been recently re-architected, and it provides
+ many new features, and layers suitable for optimization. It is
+ relatively easy to add new optimizations to Mono.
+
+ The CIL has some advantages over the Java byte code: The existance
+ of structs in addition to classes helps a lot the performance and
+ minimizes the memory footprint of applications.
- The CIL has some advantages over the Java byte code: it is really
- an intermediate representation and there are a number of
- restrictions on how you can emit CIL code that simplify creating
- better JIT engines.
+ Generics in the CLI world are first-class citizens, they are not
+ just a strong-typing addition to the language. The generic
+ specifications are embedded into the instruction stream, the JIT
+ uses this information to JIT a unique instances of a method that is
+ optimized for the type arguments.
+
+ The CIL is really an intermediate representation and there are a
+ number of restrictions on how you can emit CIL code that simplify
+ creating better JIT engines.
For example, on the CIL, the stack is not really an abstraction
available for the code generator to use at will. Rather, it is a
@@ -793,6 +1432,14 @@ A: The C# Compiler is released under the terms of the <a
href="http://www.opensource.org/licenses/mit-license.html">MIT X11</a>
license.
+ The Mono runtime and the Mono C# Compiler are also available under
+ a proprietary license for those who can not use the LGPL and the
+ GPL in their code.
+
+ For licensing details, contact <a
+ href="mailto:mono-licensing@ximian.com">mono-licensing@ximian.com</a>
+
+
Q: I would like to contribute code to Mono under a particular
license. What licenses will you accept?
@@ -800,32 +1447,124 @@ A: We will have to evaluate the licenses for compatibility first,
but as a general rule, we will accept the code under the same
terms of the "container" module.
-<a name="patents></a>
+<a name="patents"></a>
** Patents
Q: Could patents be used to completely disable Mono (either submarine
patents filed now, or changes made by Microsoft specifically to
create patent problems)?
-A: No. First, its basic functional capabilities have pre-existed too
- long to be held up by patents. The basic components of Mono are
- technologically equivalent to Sun's Java technology, which has been
- around for years. Mono will also implement multi-language and
- multi-architecture support, but there are previous technologies
- such as UCSD p-code and ANDF that also support multiple languages
- using a common intermediate language. The libraries are similar
- to other language's libraries, so again, they're too similar to
- be patentable in large measure.
-
- However, if Microsoft does patent some technology, then our plan is
- to either (1) work around it, (2) chop out patented pieces, (3)
- find prior art that would render the patent useless.
+A: First some background information.
+
+ The .NET Framework is divided in two parts: the ECMA/ISO covered
+ technologies and the other technologies developed on top of it like
+ ADO.NET, ASP.NET and Windows.Forms.
+
+ Mono implements the ECMA/ISO covered parts, as well as being a
+ project that aims to implement the higher level blocks like
+ ASP.NET, ADO.NET and Windows.Forms.
+
+ The Mono project has gone beyond both of those components and has
+ developed and integrated third party class libraries, the most
+ important being: Debugging APIs, integration with the Gnome
+ platform (Accessibility, Pango rendering, Gdk/Gtk, Glade, GnomeUI),
+ Mozilla, OpenGL, extensive database support (Microsoft only
+ supports a couple of providers out of the box, while Mono has
+ support for 11 different providers), our POSIX integration
+ libraries and finally the embedded API (used to add scripting to
+ applications and host the CLI, or for example as an embedded
+ runtime in Apache).
+
+ The core of the .NET Framework, and what has been patented by
+ Microsoft falls under the ECMA/ISO submission. Jim Miller at
+ Microsoft has made a statement on the patents covering ISO/ECMA,
+ (he is one of the inventors listed in the patent): <a
+ href="http://web.archive.org/web/20030609164123/http://mailserver.di.unipi.it/pipermail/dotnet-sscli/msg00218.html">here</a>.
+
+ Basically a grant is given to anyone who want to implement those
+ components for free and for any purpose.
+
+ The controversial elements are the ASP.NET, ADO.NET and
+ Windows.Forms subsets. Those are convenient for people who need
+ full compatibility with the Windows platform, but are not required
+ for the open source Mono platform, nor integration with today's
+ Mono's rich support of Linux.
+
+ The Mono strategy for dealing with these technologies is as
+ follows: (1) work around the patent by using a different
+ implementation technique that retains the API, but changes the
+ mechanism; if that is not possible, we would (2) remove the pieces
+ of code that were covered by those patents, and also (3) find prior
+ art that would render the patent useless.
Not providing a patented capability would weaken the
interoperability, but it would still provide the free software /
open source software community with good development tools, which
is the primary reason for developing Mono.
+ The patents do not apply in countries where software patents are
+ not allowed.
+
+ For Linux server and desktop development, we only need the ECMA
+ components, and things that we have developed (like Gtk#) or Apache
+ integration.
+
+Q: Is Mono only an implementation of the .NET Framework?
+
+A: Mono implements both the .NET Framework, as well as plenty of class
+ libraries that are either Unix specific, <a
+ href="http://www.gnome.org">Gnome</a> specific, or that are not
+ part of the .NET Framework but people find useful.
+
+ The following map shows the relationship between the components:
+
+ <img src="http://primates.ximian.com/~miguel/tmp/map.png">
+
+<a name="obfuscation"></a>
+** Obfuscation
+
+Q: Are there any obfuscation programs for Mono/Linux?
+
+A: We are not aware of these, but some from Windows might work.
+
+Q: What could I do to avoid people decompiling my program?
+
+A: You can use the bundle functionality in Mono.
+
+ This would bundle your binary inside a Mono runtime instance, so
+ you distribute a single executable that contains the code inside.
+ Notice that for this to work and be practical, you need to get a
+ commercial license to the Mono runtime.
+
+ The reason is that the bundle functionality is covered by the LGPL:
+ so you would have to distribute your assemblies separatedly to allow
+ developers to relink mono which would defeat the purpose of bundling
+ for obscuring your code.
+
+ It is not impossible to break, just like any other obfuscators.
+
+ That being said, value these days does not lie in particular
+ tiny routines, but lies in the large body of work, and if someone
+ steals your code, you are likely going to find out anyways.
+
+Q: Any other option?
+
+A: You could precompile with --aot your code, then disassemble the
+ original .exe, and remove all the code, then re-assemble and ship
+ both the vessel .exe and the precompiled code.
+
+ This is not a supported configuration of Mono, and you would be
+ on your own in terms of dealing with bugs and problems here.
+
+ Get the companies that build the obfuscation packages to read
+ the ECMA spec and fix the bugs in their products that generate
+ non-standard binaries (or, if they expose a bug in mono, please
+ file a report in our bugzilla).
+
+ Pay Ximian/Novell to spend the development time needed to get mono
+ to support the broken binaries that some of the obfuscation
+ packages generate (or contribute that support).
+
<a name="etc"></a>
** Miscellaneous Questions
@@ -836,11 +1575,11 @@ A: The key difference between CORBA (and COM) and the CLI is that the
CLI allows "data-level interoperability" because every
language/component uses the same data layout and memory management.
- This means you can operate directly upon the datatypes that someone
+ This means you can operate directly upon the data types that someone
else provides, without having to go via their interfaces. It also
- means you don't have to "marshall" (convert) parameters (data
+ means you don't have to "marshal" (convert) parameters (data
layouts are the same, so you can just pass components directly) and
- you don't have to worry about memory managment, because all
+ you don't have to worry about memory management, because all
languages/components share the same garbage collector and address
space. This means much less copying and no need for reference
counting.
@@ -854,7 +1593,78 @@ Q: Will Ximian offer certifications on Mono or related technologies?.
A: It's possible. But there is no plan about this. So the short answer is no.
-Q: Are there any Boehm's gc binaries?
+Q: How can I report a bug?
+
+A: The best thing is to track down the bug and provide a simple test
+ to reproduce the bug. You can then add the bug to our bug tracking
+ system. You can use our <a href="bugs.html">Bug Form</a> to enter
+ bugs for the appropriate component.
+
+ Please provide information about what version of mono you're using
+ and any relevant details to be able to reproduce the bug. Note that
+ bugs reported on the mailing-list may be easily forgotten, so it's
+ better to file them in the <a href="http://bugzilla.ximian.com/enter_bug.cgi">bug tracking system</a>.
+
+Q: Does mcs support the same command line options as the MS C#
+ compiler?
+
+A: The Mono C# compiler now supports the same command line
+ arguments as the Microsoft C# compiler does.
+
+Q: How about getting searchable archives on lists.ximian.com?
+
+A: You can perform a search on the mono-related mailing lists
+ <a href="http://www.go-mono.com/mailing-lists.html">here</a>.
+
+Q: When using mono from cvs or from a snapshot, I get an error messaage
+ saying that Mono and the runtime are out of sync. How do I fix that?
+
+A: If you use mono from cvs, you need to be prepared for changes in the
+ runtime internals. This means that you should keep a working setup
+ before blindling updating (a working setup may just be the last released
+ tarball or a recent binary snapshot).
+ Usually, compiling corlib with mcs before recompiling the C runtime does
+ the right thing (but occasionally you may need to do it the other
+ way around).
+
+Q: Why are you going for a GtkHtml implementation?
+
+A: GtkHTML is just a lightweight HTML rendering engine that does not
+ support CSS, so we need it to look decent for those of us that will
+ be using the documentation in our day-to-day work on Linux. The
+ Web-based interfaces lack the agility that you get from a native GUI
+ tool to browse your documentation. Probably later on, we will write
+ scripts and generate a full documentation set that is web-browsable,
+ but we need a command-line and GUI tools that we can use natively on
+ Linux when disconnected from the Web (and that has better
+ interactions than a web page).
+
+Q: Is there a command-line tool that allows me to access .NET interactively?
+
+A: There are several but one that is free software and uses MCS is the one
+ Dennis Lu from Rice University is working on; a REPL C# interpreter.
+
+Q: Is it possible to use Visual C++ with Mono?.
+
+A: It's possible to run VC++ generated apps under Mono, but we do not
+ provide a Manager C++ compiler ourselves.
+
+Q: Does Mono support generics?.
+
+A: Yes, the Mono runtime now supports the new Generics extensions, and
+ there is also support for generics in our new compiler: `gmcs'.
+
+ The Mono C# 1.0 compiler (mcs) will ship with various C# 2.0
+ features, but generics will remain on the separate compiler (gmcs)
+ as this code is not as tested as the main compiler.
+
+<a name="problems"></a>
+** Mono Common Problems
+
+ If you are having problems compiling or running Mono software
+ or if you think that you found a bug, etc. Please visit the
+ <a href="http://monoevo.sf.net/mono-common-problems.html">Mono Common Problems</a> document and try there.
-A: Yes. You can find them <a href="http://java.thn.htu.se/~toor/">here</a>
+** Credits
+ The FAQ contains material contributed by Miguel de Icaza, Jaime Anguiano, Lluis Sánchez.
diff --git a/web/firebird b/web/firebird
new file mode 100755
index 00000000000..6d3bc0b33f3
--- /dev/null
+++ b/web/firebird
@@ -0,0 +1,140 @@
+* Firebird and Interbase Data Provider
+
+<ul>
+ <li>ADO.NET Data Provider for Firebird and Interbase databases</li>
+
+ <li>Does not exist in Mono, but is a separate project</li>
+
+ <li>The <a href="http://firebird.sourceforge.net/index.php">Firebird Relational Database</a> is
+ is an independent project which uses source code based on the Interbase source code released
+ by Borland under the Interbase Public License</li>
+
+ <li>Both the Firebird Relational Database and the Firebird .NET Data Provider can be
+ downloaded from <a href="http://sourceforge.net/projects/firebird/">here</a></li>
+
+ <li>The Firebird .NET Data provider has been made
+ available by Carlos Guzmán Álvarez (aka "Carlos G.A."), who has also made a
+ number of contributions to the OdbcJdbc code</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+</ul>
+
+** Current Status
+
+<ul>
+ <li>Current stable version: 1.5.1</li>
+
+ <li>Current developement version: 1.6</li>
+
+ <li>The new data provider/driver is written in C# and provides a high-performance native
+ implementation of the GDS32/API functions. This means that .Net developers
+ will be able to access Firebird databases without the need of Firebird
+ client install</li>
+
+ <li>In support of the new module, a new mailing list
+ <a href="http://lists.sourceforge.net/lists/listinfo/firebird-net-provider">firebird-net-provider</a> has
+ been created. Please use this list for any
+ questions that you may have about the provider</li>
+</ul>
+
+** New features & enhancements in 1.6 version
+
+<ul>
+ <li>Firebird Embedded Server support.</li>
+ <li>New FbScript class implementation.</li>
+ <li>Improved connection pooling.</li>
+ <li>Improved array datatype support.</li>
+</ul>
+
+** Testing
+
+<ul>
+
+ <li>Need a working mono and mcs</li>
+
+ <li>Need access to a Firebird Relational Database or you can download
+ it from <a href="http://firebird.sourceforge.net">here</a></li>
+
+ <li>Get the Firebird .NET data provider from here as
+ <a href="http://lists.sourceforge.net/lists/listinfo/firebird-net-provider">firebird-net-provider</a>. Make
+ sure the Firebird .NET data provider binary assembly FirebirdSql.Data.Firebird.dll is
+ installed in the same place as the mono class libraries.</li>
+
+ <li>Has a ConnectionString format:
+<pre>
+ "Database=databasefile.gdb;User=user;Password=pass;Dialect=3;Server=hostname"
+</pre>
+
+ </li>
+
+ <li>C# Example:
+
+<pre>
+ using System;
+ using System.Data;
+ using FirebirdSql.Data.Firebird;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Database=C:\\PROGRAM FILES\\FIREBIRD\\EXAMPLES\\EMPLOYEE.GDB;" +
+ "User=SYSDBA;" +
+ "Password=masterkey;" +
+ "Dialect=3;" +
+ "Server=localhost";
+
+ IDbConnection dbcon = new FbConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ string sql = "SELECT * FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ object dataValue = reader.GetValue(0);
+ string sValue = dataValue.ToString();
+ Console.WriteLine("Value: " + sValue);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r FirebirdSql.Data.Firebird.dll
+</pre>
+ </li>
+ <li>Build on Windows via Cygwin:
+<pre>
+ mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
+ TestExample.cs \
+ -lib:C:/cygwin/home/MyHome/mono/install/lib \
+ -r System.Data.dll -r FirebirdSql.Data.Firebird.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+</li>
+
+</ul>
+
diff --git a/web/forge b/web/forge
new file mode 100644
index 00000000000..3f85b3dc897
--- /dev/null
+++ b/web/forge
@@ -0,0 +1,72 @@
+* Novell Forge
+
+ Novell Forge (<a
+ href="http://forge.novell.com/">http://forge.novell.com/</a>)
+ is a website managed by Novell to promote the development of
+ open source applications and solutions. Novell Forge features
+ communities, akin to foundries on SourceForge.net, which exist
+ for the purpose of facilitating collaboration and information
+ exchange about certain technologies or solutions. At Miguel's
+ request, we have created a Mono community on Novell Forge that
+ is administered by Miguel. This community, located at
+ http://forge.novell.com/modules/xfmod/community/?monocomm,
+ provides a resource for interaction and collaboration on Mono
+ and associated solutions. Each community has the ability to
+ provide forums, mailing lists, FAQs, news, documentation,
+ surveys, sample code, and links to related applications. The
+ Mono community has been created for anyone interested in Mono
+ to use, and the exact set of features offered at the community
+ is determined by Miguel.
+
+ Any individual or group that wishes to provide Mono-based solutions in
+ an open source fashion is encouraged to host their solution on the
+ Novell Forge website, free of charge. Once the project is hosted on
+ Novell Forge, you can send Miguel an e-mail requesting that your project
+ be associated with the Mono project. This promotes a symbiotic
+ relationship where the growth of Mono applications helps to improve
+ Mono, and the growth of Mono likewise helps to increase the visibility
+ and usefulness of your applications.
+
+* Creating an Account
+
+ A Novell Forge account is required in order to create a project on
+ Novell Forge as well as for certain levels of participation within a
+ community like the Mono community. In order to create an account, do
+ the following:
+
+ <ul>
+
+ <li>Go to http://forge.novell.com/ and click on the "Register" link.
+
+ <li>You will be redirected to the Novell Login page. This one resource
+ is used by all of Novell's websites that require authentication, so if
+ you already have a Novell login you may use that login here. Otherwise,
+ simply create a login account.
+
+ <li>You will be redirected back to the Novell Forge page. Click on the
+ "create my Novell Forge account" link, near the top left of the page.
+
+ <li>A form should be filled in with the correct information for you.
+ If you like, choose an avatar and then submit the form.
+
+ <li>Confirm the creation of your account.
+ </ul>
+
+
+ You should be good to go at this point. Now, to create a project,
+ simply choose the "Start New Project" link from the left menu and follow
+ the steps.
+
+ Novell Forge offers a limited set of context-sensitive help links and a
+ full help section. If you have trouble, go to the help section at
+ http://forge.novell.com/modules/xfmod/help/about.php.
+
+
+* Important Links:
+
+ Novell Forge - <a href="http://forge.novell.com/">http://forge.novell.com/</a>
+
+ Mono Community - <a href="http://forge.novell.com/modules/xfmod/community/?monocomm">http://forge.novell.com/modules/xfmod/community/?monocomm</a>
+
+ Novell Forge Help - <a href="http://forge.novell.com/modules/xfmod/help/about.php">http://forge.novell.com/modules/xfmod/help/about.php</a>
+
diff --git a/web/gcc-frontend b/web/gcc-frontend
index 2b15346db69..c892749c036 100644
--- a/web/gcc-frontend
+++ b/web/gcc-frontend
@@ -1,9 +1,7 @@
* The GCC front-end
- The GCC front-end will accept input in a binary file with
- codes in the Common Intermediate Language (CIL), and generate
- native code.
-
- This will allow pre-compilation and full optimization to take
- place before a program is executed.
+ Jeremy Singer has developed a .NET backend for GCC, his
+ research work is available <a
+ href="http://www.cl.cam.ac.uk/~jds31/research/gccnet/">here</a>.
+
diff --git a/web/gtk-sharp b/web/gtk-sharp
new file mode 100644
index 00000000000..0100f667327
--- /dev/null
+++ b/web/gtk-sharp
@@ -0,0 +1,157 @@
+* Gtk#
+
+ <a href="http://gtk-sharp.sourceforge.net">Gtk#</a> (Gtk
+ sharp) is a set of C# language bindings for the
+ <a href="http://www.gtk.org">Gtk+</a> toolkit and other
+ libraries that are part of the
+ <a href="http://www.gnome.org">GNOME</a> platform .
+
+* Wiki
+
+ There is a <a
+ href="http://www.nullenvoid.com/gtksharp/wiki/index.php/">Gtk#
+ Wiki</a>. You are encouraged to contribute to it.
+
+** API of Gtk#
+
+ The Gtk# API is documented using the ECMA XML document format, you can read
+ more about it <a href="documentation.html">here</a>. You can
+ also use the MonoDoc tool that ships with Gtk# documentation.
+
+** Where to learn more.
+
+ Visit the official site for the <a href="http://gtk-sharp.sourceforge.net">Gtk# Project</a>.
+ The <a href="http://www.go-mono.org/faq.html">Mono FAQ</a> has some useful
+ information too.
+
+** GTK# On Linux
+
+<p>Where to get distributions of GTK# for Linux:
+ <ul>
+ <li><a href="http://gtk-sharp.sourceforge.net">RPMs</a></li>
+ <li><a href="http://www.debianplanet.org/mono/">Debs</a></li>
+ </ul>
+
+<p>Buidling on Linux:
+
+<ul>
+ <li>Get GTK# source from <a href="http://gtk-sharp.sourceforge.net">Gtk# Project</a>.</li>
+ <li>run ./autogen.sh --prefix=my_mono_installation_prefix</li>
+ <li>make</li>
+ <li>make install</li>
+</ul>
+
+** GTK# On Windows
+
+<p>Look at our Wiki for installation instructions <a href="http://www.nullenvoid.com/gtksharp/wiki/index.php/InstallingBeginnersGuide">here</a>
+
+
+<p>If you want to build GTK# yourself on Windows:
+
+<p>To build gtk# under windows, you will need the following:
+
+<ul>
+ <li>cygwin from <a href="http://www.cygwin.com/">here</a> When installing Cygwin via setup.exe,
+ by default binutils and other tools do not get installed; you have to make
+ sure to select these items. Just make
+ sure Base and Development are set to Install.</li>
+ <li>Mono 0.17 or later from <a href="http://www.go-mono.com/download.html">here</a>
+ You can use Windows Setup Wizard (NT/2000/XP).</li>
+ <li>GTK+ 2.0 (and dependencies). You can obtain gtk+ 2.0 by either of the
+following:
+ <ul>
+ <li>You can get a Windows Installer at:
+ <a href="http://www.dropline.net/gtk/download.php">here</a> </li>
+ <li>or get the separate binary and dev/lib packages at
+ at <a href="http://www.gimp.org/~tml/gimp/win32/downloads.html">here</a> </li>
+ <li>or binary package from Dev-C++ site <a href="http://www.bloodshed.net/dev/packages/gtk.html">here</a> </li>
+ <li>or get Gtk4Win <a href="http://wingtk.sourceforge.net/index.html">here</a> </li>
+ <li>or the source at <a href="http://www.gtk.org/">here</a> </li>
+ </ul>
+ </li>
+ <li>binary distriubtion of a current web browser
+ like Internet Explorer 4.0, Mozilla 1.0, or Netscape 7.0 which
+ includes things like msvcrt.dll.</li>
+ <li>Microsoft .NET Framework at
+ <a href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">here</a> </li>
+
+
+<p>Environment Variables to set:
+<ul>
+<li>PATH - set to your mono installation bin and lib path.
+ For example, my mono installation prefix is:
+<pre>
+F:/cygwin/home/DanielMorgan/mono/install
+</pre>
+ <p>So, I would set my PATH in the Windows Control Panel as:
+<pre>
+F:/cygwin/home/DanielMorgan/mono/install/bin;F:/cygwin/home/DanielMorgan/mono/install/lib</li>
+</pre>
+</li>
+<li>LD_LIBRARY_PATH - set to your mono installation lib path</li>
+<li>PKG_CONFIG_PATH - set to your mono installation lib/pkgconfig path, such
+ as,
+<pre>
+ F:/cygwin/home/DanielMorgan/mono/install/lib/pkgconfig</li>
+</pre>
+
+ <p>If you got the gtk-sharp source, cd to the gtk-sharp directory, type:
+<pre>
+ ./autogen.sh --prefix=~/mono/install
+</pre>
+
+ <p>Set your --prefix= to whatever your mono installation prefix is located.
+ This will take awhile to go through the ./autogen.sh and ./configure...
+
+ <p>After that it finishes succesfully, you run make with the makefile.win32
+ like:
+<pre>
+ make -f makefile.win32
+</pre>
+
+ <p>After that finishes succesfully, you can copy to your mono installation lib
+ path like:
+<pre>
+ cp */*.dll ~/mono/install/lib
+</pre>
+</ul>
+
+<p>The pkg-config files for
+gtk+ 2.0 and dependencies will need to be set correctly if they haven't
+already been.
+
+<p>Look in your mono installation/lib/pkgconfig, such as,
+<pre>
+F:/cygwin/home/DanielMorgan/mono/install/lib/pkgconfig
+</pre>
+
+<p>You will find files like: gtk+-2.0.pc
+
+<p>Edit the line that says
+
+<pre>
+ prefix=something
+</pre>
+
+<p>And set it to your mono installation prefix, such as,
+
+<pre>
+ prefix=F:/cygwin/home/DanielMorgan/mono/install
+</pre>
+
+<p>Do this for all the .pc files in that directory. If there are not any, then
+you will need to create them. Or get them from somewhere like the dev
+packages at
+<a href="http://www.gimp.org/~tml/gimp/win32/downloads.html">here</a>
+
+** GTK# On FreeBSD
+
+ TODO. Any volunteers?
+
+** GTK# On Solaris
+
+ TODO. Any volunteers?
+
+** GTK# On AIX
+
+ TODO. Any volunteers?
diff --git a/web/hackers b/web/hackers
new file mode 100644
index 00000000000..abe607e425b
--- /dev/null
+++ b/web/hackers
@@ -0,0 +1,67 @@
+* Mono Hackers Hall Of Fame
+
+Without the help, the skills and the time of many passionate developers outside of
+the Ximian Mono team, Mono would not be where it is today.
+
+Many of them do it for fun, some do it because they really want a nice CLR they
+can hack on, some do it because they need a working solution to some development
+issues and mono is the ideal tool for the job.
+
+Some of them may start contributing because they want a mention in the
+<b>Mono Hackers Hall Of Fame</b>! Whatever the cause, join us in a big<br>
+<h1 align="center">Thank you!</h1>
+
+* Mono Hackers
+
+** John Luke
+
+John Luke has touched many aspects of Mono, including the core
+libraries, Gtk#, MonoDevelop, and Monodoc. His skills are apparent
+from his work. He sets an example by writing documentation along with
+his patches.
+
+** Dan Morgan
+
+Dan Morgan is an important contributor to the System.Data related
+assemblies but their code and has contributions that have touched
+plenty of areas in the Mono project as well as helping with the Win32
+installers on the early Mono days.
+
+** Tim Coleman
+
+Tim Coleman contributions span System.Data and set the foundation for
+some of the later work on System.Web.Services and has contributed all
+around Mono.
+
+** Todd Berman
+
+Todd Berman is a steady contributor to Mono. He has worked
+everywhere: from the Class Libraries, to the early implementation of
+the GAC and most recently has lead the effort to develop, port and
+maintain MonoDevelop an IDE for the Mono environment. His help has
+been key to the development of Mono.
+
+** Zoltan Varga
+
+Zoltan has contributed significantly to Mono, with bug reports and bug
+fixes as well as pushing the envelope of the things that can be done in
+and with the mono runtime: the gcc-based ngen compiler, code coverage
+and more recently his work with Reflection.Emit that got mono to the
+point of running the IKVM Java virtual machine.
+
+** Sergey Chaban
+
+Sergey has been a long time contributor to the project, from the early
+work on the class libraries that were critical to Mono's origin: every
+time you use a Hashtable in Mono, it runs Sergey's code, to the
+low-level optimizations on the JIT engine and to his work on ILASM and
+the PEToolkit. And countless other things.
+
+** Nick Drochak
+
+The first, deserved, entry in the <b>Mono Hackers Hall Of Fame</b> is for
+Nick Drochak, who joined us in the first days of Mono and built the testing
+infrastructure for the C# assemblies, fixed tons of bugs and even adventured
+himself in the lands of the C runtime. His work is invaluable for keeping
+Mono on the right track through the daily changes in the codebase.
+
diff --git a/web/ibmdb2 b/web/ibmdb2
new file mode 100755
index 00000000000..d8c919adf46
--- /dev/null
+++ b/web/ibmdb2
@@ -0,0 +1,59 @@
+* IBM DB2 Data Provider
+<ul>
+ <li>ADO.NET Data Provider for <a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a>.</li>
+
+ <li>Exists in namespace IBM.Data.DB2 and assembly IBM.Data.DB2. The source code is located in the mcs/class/IBM.Data.DB2 directory.</li>
+
+ <li>This IBM DB2 data provider is built on top of Call Level Interface, a C interface similar to ODBC.</li>
+ The required libraries are db2cli.dll on Windows and db2_36.so under Linux.
+
+ <li>The data provider is maintained by <a href="http://www.hqsoftconsult.com">HQSoftware Consulting</a> team.</li>
+ Our objective in developing this managed provider is to simplify the process of migrating enterprise solutions with demanding data processing requirements from Windows to Linux. For questions, complaints or anything else regarding the managed provider please <a href="mailto:office@hqsoftconsult.com">contact us</a>.
+
+ <li>Bugs with Mono or the data provider should be reported in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you do not have Bugzilla user account, it is free and easy to create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+</ul>
+
+** Current Status
+
+<ul>
+ This IBM DB2 managed provider is in a stable stage. It was tested on Linux and Windows platforms on x86 hardware. All the features one would expect from a .NET managed provider are implemented, including:
+ <ul>
+ <li>Connecting / disconneting to local and remote datasources</li>
+ <li>Connection pooling</li>
+ <li>Statement execution support using the ExecuteNonQuery(), ExecuteScalar(), ExecuteReader() methods of the DB2Command</li>
+ <li>Transactions support</li>
+ <li>Filling datasets with the DB2DataAdapter from direct statement execution or from stored procedures cursors</li>
+ <li>Updating datasources with the changes in DataSets using DB2DataAdapter.Update() method</li>
+ <li>Full stored procedures invocation support; IN/OUT/INOUT and return parameters</li>
+ <li>Generating Insert/Update/Delete commands with the DB2CommandBuilder</li>
+ </ul>
+</ul>
+
+** Action Plan
+
+<ul>
+ <li>Future plans:
+ <ul>
+ <li>Fixing all the bugs as soon as they will be discovered</li>
+ <li>Exhaustive test cases suite</li>
+ <li>Enhanced bulk insert operations support</li>
+ <li>Switching from the C interface to the DB2 wire protocol </li>
+ </ul>
+ </li>
+
+</ul>
+
+** Testing
+<br>
+In order to test.
+<ul>
+ <li>Download and install mono from <a href="http://www.go-mono.com/download.html">http://www.go-mono.com/download.html</a></li>
+ <li>Make sure you have a working C compiler on the machine you will install DB2 on, since this will be required for compiling stored procedures</li>
+ <li>Install IBM DB2 and make sure you have created the links for the DB2 files using the db2ln command. </li>
+ You can register and download IBM DB2 Personal Developer Edition from <a href="http://www14.software.ibm.com/webapp/download/search.jsp?rs=db2pde">here</a>.
+ If you cannot install DB2 using the automatic installation due to the java user interface issues, you can perform a manual installation following these <a href="http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/start/t0006742.htm">instructions</a>.
+
+ <li>Make sure the assembly IBM.Data.DB2.dll was built and installed where the other class libraries are installed.</li>
+</ul>
+
diff --git a/web/ideas b/web/ideas
index 0a97cdcc4d2..83e4eb3a1c5 100644
--- a/web/ideas
+++ b/web/ideas
@@ -15,25 +15,13 @@
<a name="runtime">
** Runtime
- We need a verifier that can be run on an executable (assembly)
- and tells whether the metadata for the executable is correct
- or not. It should report any anomalies.
-
- For a list of anomalies in assemblies, check the various assertions
- that are described on the ECMA documentation.
-
- This will help test our generated executables and can be also
- used as an external verifier.
-
<a name="classes">
** Classes
<ul>
-TODO=jxta,The JXTA Peer to Peer foundation
* Implement a JXTA protocol implementation:
<a href="http://www.jxta.org">http://www.jxta.org</a>
-TODO=camel,Mail API
* Implement a Mail API, similar to Camel or JavaMail (Camel has
significant architecture features that are required on a real
mailer).
@@ -45,7 +33,6 @@ TODO=camel,Mail API
Such an implementation could be used both with
Microsoft .NET and Mono.
-TODO=multimedia
* Interfacing to Multimedia systems. You might want
to look into the Quicktime API. I know <a
href="mailto:vladimir@ximian.com">Vladimir</a> has
@@ -56,40 +43,12 @@ TODO=multimedia
<a name="projects">
** Projects
- <ul>
-TODO=xmlStorage,
- * Implement an xmlStorageSystem for the CLI:
- <a href="http://www.soapware.org/xmlStorageSystem">
- http://www.soapware.org/xmlStorageSystem</a>
-
-TODO=guavac,Java compiler for .NET
- * You could take one of the existing Java compilers
- (Guavac comes to mind as it is so nice) and modify
- it to generate .NET code rather than JVM byte
- codes.
-
- This should be a pretty straightforward task.
- Guavac has the advantage of being written in C++ and
- it could be compiled with the Microsoft Managed C++
- compiler and produce a .NET executable with it.
-
-TODO=CORBA,CORBA implementation
- * Build a CORBA interoperability engine for the CLR.
- You do not need to do all of the work, just talking
- the protocol will get us a long way (<a
- href="http://www.omg.org">The OMG site</a> has the
- CORBA specs).
-
- Get in touch with David Taylor (dtaylo11 at bigpond
- dot net dot au) as he has been working on this
- project.
-
-TODO=Bonobo,Bonobo for Mono
- * Once CORBA is done, implement the Bonobo interfaces
+ This list of projects ideas is outdated
+
+ * Once <a href="http://remoting-corba.sourceforge.net/">CORBA</a> is done, implement the Bonobo interfaces
to allow people to use Bonobo components in Mono and
Mono components with Bonobo. The best of both worlds!
-TODO=moniker,Object Naming System with Monikers
* A naming space for Mono. An object naming space is
a very powerful tool. Bonobo implements a moniker
system that is more powerful than the original
diff --git a/web/index b/web/index
index b67e5f3dec3..52a8ced8b09 100644
--- a/web/index
+++ b/web/index
@@ -1,70 +1,51 @@
+<meta http-equiv="Refresh" content="0"; URL=http://www.mono-project.com/">
<link rel="alternate" type="application/rss+xml" title="RSS" href="index.rss"/>
-<table>
- <tr>
- <td>
- <a href="http://www.ximian.com">Ximian</a> announced the
- launch of the Mono project, an effort to create an open source
- implementation of the .NET Development Framework.
-
- Mono includes: <a href="c-sharp.html">a compiler</a> for the
- C# language, a <a href="runtime.html">runtime</a> for the
- Common Language Infrastructure (the CLR) and a set of <a
- href="class-library.html">class libraries</a>.
-
- You can read our <a href="rationale.html">rationale</a> for
- this project. If you have questions about the project, please
- read our list of <a href="faq.html">Frequently Asked
- Questions</a> or <a href="mailto:mono-list@ximian.com">contact us.</a>
-
- You might also want to <a href="download.html">Download the
- source</a> for our work so far. Grab a <a
- href="snapshots">snapshot</a> of our current work, or <a
- href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=Mono">browse
- the sources</a>
-
- You might want to <a
- href="mailing-lists.html">subscribe</a> to our mono-list
- and mono-announce-list
-
- You can contact the team at: <a
- href="mailto:mono-list@ximian.com">mono-list@ximian.com</a>
- </td>
- <td>
- <table border=1>
+
+ <table align="right" border=1 padding=0 width=25%>
+ <tr>
+ <td colspan="2" bgcolor=lightgrey>
+ <b><center>Mono Status</center></b>
+ </td>
+ </tr>
<tr>
<td>
- <b><a href="c-sharp.html">C# Compiler</a></b>
+ <b><a href="c-sharp.html">C# Compiler:</a></b>
</td>
<td>
- <b>Self hosting on Linux</b><br>
- Self hosting on .NET.
+ Self hosting on Linux and .NET
</td>
</tr>
<tr>
<td>
- <b>JIT</b>
+ <b>JIT:</b>
</td>
<td>
- Linux/x86 working.
+ Linux/x86<br>
+ Solaris/SPARC<br>
+ PowerPC: MacOS and Linux.<br>
+ S390: Linux.
</td>
</tr>
<tr>
<td>
- <b>Interpreter</b>
+ <b>Interpreter:</b>
</td>
<td>
- Working:<br>
- Linux/x86, Linux/PPC<br>
- In progress: StrongARM, SPARC.
+ Works for
+ Linux/x86, Linux/PPC, S390, StrongARM, SPARC, HPPA, SPARC v9
</td>
</tr>
<tr>
+ <td><b><a href="asp-net.html">ASP.NET</a></b></td>
+ <td>Webforms and WebServices working<br></td>
+ </tr>
+ <tr>
<td>
<b><a href="class-status.html">Classes</a></b>
</td>
<td>
- Corlib is self hosting.
+ All assemblies compile.
</td>
</tr>
<tr>
@@ -75,1150 +56,420 @@
<a href="index.rss"><img src="images/xml.gif"></a>
</td>
</tr>
- </table>
- </td>
- </tr>
-</table>
-
-@item Jun 24, 2002
-
- Duncan has written a few sample <a
- href="http://primates.ximian.com/~duncan/Mono">gtk# demo apps</a>..
-
-@item Jun 20, 2002
-
- Gonzalo has got the Mono ASP.NET implementation can now render all Html
- Controls, and 21 out of the 26 Web Controls. Session tracking is
- next. Look in xsp/test for a collection of tests that render with Mono.
-
- Ajay has been very busy improving and extending the
- XmlSerialization code. All fields had to be re-ordered to
- match the Microsoft implementation.
-
-@item Jun 19, 2002
-
- You can now download a fresh tarball of the libraries and the MCS
- compiler daily from <a href="http://www.atoker.com/mono/">Alp Toker's
- website</a>.
-
- New libgc RPMS for Redhat 7.3 are available on <a href="
- http://java.thn.htu.se/~toor/">Richard Torkar's site</a>.
-
-@item Jun 10, 2002
-
- Ajay <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-June/000128.html">announced</a>
- today that the reading code for XmlSchemas is almost complete.
-
-@item Jun 7, 2002
-
- <b>Mono 0.12 is out!</b> More classes! More working code!
- Better compiler! Faster runtime! Less bugs!
-
- You can get it <a
- href="download.html#jun-7">Here</a> (quick links: <a
- href="archive/mono-0.12.tar.gz">runtime</a> and <a
- href="archive/mcs-0.12.tar.gz">compiler/classes</a>).
-
-@item Jun 3rd, 2002
-
- CodeDOM implementation from Daniel Stodden has got C# output support.
-
-@item May 31, 2002
-
- Gonzalo got the Mono XSP page parser to render its first ASP.NET
- .aspx file today without using MS System.Web.Hosting classes.
- It is currently on its infancy. But very good news, now we need to
- upgrade our System.Web runtime to run natively on Linux.
-
- Sergey's code for architecture and size-specific CPBLK has
- been checked into CVS.
-
- Paolo has checked the configuration code for Mono (to map
- PInvoke dlls to other libraries).
-
- <a href="ado-net.html">ADO support</a>: Daniel has checked in
- a modified version of the MySQL data provider from Brad. And Rodrigo
- started the OleDB using LibGDA.
-
-@item May 27, 2002
-
- An <a href="index.rss">RSS feed</a> is now available for the
- Mono news. I find it surprising that there are so many tools
- that process this data.
-
- Binaries for <a href="http://www.superin.formativ.net/mono/mono.htm">Windows</a> are
- now location independent, do not require Cygwin and come with a Wizard.
-
-@item May 26, 2002
-
- Daniel Morgan checked in his Sql# Cli tool into the
- System.Data class library.
-
-@item May 24, 2002
-
- Ajay <a
- href="http://lists.ximian.com/archives/public/mono-patches/2002-May/003953.html">has
- checked in</a> a major update to the System.Xml.Schema namespace.
-
- Gonzalo moved XSP along this week: Added support for
- templates, columns inside DataGrid, HTML comments, code render
- and data binding tags, style properties in style tags,
- ListItem inside list controls, float and double properties.
-
-@item May 22, 2002
-
- <a href="http://monologo.sourceforge.net/">MonoLogo</a> runs
- on the Mono runtime. This <a
- href="http://monologo.sourceforge.net/gtk.png">screenshot</a> shows
- MonoLogo running Gtk#.
-
-@item May 21, 2002
-
- Martin has improved the debugging infrastructure in Mono, now
- it is possible to get <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-May/005717.html">line
- number</a> information on stack traces.
-
-@item May 20, 2002
-
- XSP <a href="asp-net">our ASP.NET</a> .aspx page parser is now
- available on the AnonCVS servers. This is part of the ASP.NET
- support in Mono. Gonzalo is the developer on charge of it.
-
- Many updates to the <a href="ado-net.html">ADO.NET
- implementation</a> from Dan, Tim and Rodrigo.
-
- Radek got the Mono C# compiler running on Linux/PPC and
- compiling most of our regression test suite.
-
- Lawrence has been working really hard in fixing, improving and
- polishing the underlying network infrastructure.
-
- The Rafael and Chris have commited the beginning of the
- VisualBasic.NET runtime support to CVS.
-
- Jesus has contributed the beginning of the SoapFormatter
-
-@item May 9, 2002
-
- Linear register allocator has been deployed in the Mono JIT
- engine. Read <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-May/005489.html">about
- it</a>
-
-@item May 5, 2002
-
- We are able to retrieve simple data from the database
- using our ADO.NET like functionality. Only string and integer data
- types are supported right now but more are in the works.
+ <tr>
+ <td colspan="2" bgcolor=lightgrey>
+ <b><center>In the news</center></b>
+ </td>
+ </tr>
- You can find more information
- at <a href="http://www.go-mono.com/ado-net.html">The Mono ADO-NET Page</a>
+ <tr>
+ <td>
+ <b>Beta 1 Press Coverage</b>
+ </td>
+ <td>
+ <a href="http://www.go-mono.com/beta1-press.html" target="blank">May 2004</a>: Mono Beta 1 rallies the press
+ </td>
+ </tr>
+ <tr>
- Thanks goes to Chris, Daniel, Duncan, Gonzalo, Miguel, Rodrigo, Tim,
- and others for these bits.
-
-@item May 4th, 2002
-
- Rodrigo Moya announced <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-May/005366.html">new
- LibGDA</a>: LibGDA is an ADO-like library for Unix systems.
- This one removes all the CORBA and GConf dependencies, which
- should make it easier to use and compile.
-
- This is another milestone for our <a
- href="ado-net.html">ADO.NET implementation plans</a>
-
- We have a little surprise for everyone tracking the news on tuesday ;-)
-
-@item May 2nd, 2002
-
- Mark Crichton csvorbis port (C# port of Vorbis player) and
- Richard Hestilow's <a href="http://monologo.sf.net">MonoLogo compiler</a> are now
- on the CVS, and you can get them from AnonCVS.
-
- Dick implemented inter-process sharing of handles as well as
- simplifying the implementation of WaitForMultipleObjects, now
- we have a `handles' subsystem in Mono. This is needed to fully
- emulate the handle behavior that Win32 exposes, and that the .NET API
- expose to applications.
-
- News from the <a
- href="http://gtk-sharp.sourceforge.net">Gtk#</a> front: <a
- href="http://gtk-sharp.sourceforge.net/menu.png">Menu
- support</a>, Mike <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-May/000064.html">tells
- the story</a>
-
-@item May 1st, 2002
-
- Daily packages for <a href="http://www.debian.org">Debian</a> are available
- <a href="http://www.atoker.com/mono/">here</a>
-
-@item Apr 26, 2002
-
- Binary packages of Mono 0.11 are available for <a
- href="http://www.superin.formativ.net/mono/mono.htm">Windows</a>
- (Thanks to Johannes Roith) and for
- <a
- href="http://mono.baselabs.org/index.php/software/">Linux</a> (thanks
- to BaseLabs).
-
-@item Apr 24, 2002
-
- <b>Mono 0.11 is out!</b> Mostly performance improvements, bug
- fixes and more classes are included.
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure. Binaries are
- included. The <a href="archive/mono-0.11">Release Notes</a>
- are available.
-
- You can get it <a
- href="download.html#apr-24">Here</a> (quick links: <a
- href="archive/mono-0.11.tar.gz">runtime</a> and <a
- href="archive/mcs-0.11.tar.gz">compiler/classes</a>).
-
-@item Apr 23, 2002
-
- SharpDevelop 0.88a <a href="http://www.icsharpcode.net/OpenSource/SD">is out!</a>
-
- Congratulations to the developers behind SharpDevelop for
- their new release.
-
-@item Apr 20, 2002
-
- Some updates from the hacking lines:
-
- <b>The web:</b> Patrik Torstensson last week contributed the
- http runtime support and started work on thread pools. This
- is part of the ASP.NET support.
-
- <b>Docs:</b> John Barnette, John Sohn and Adam Treat have been
- hacking on MonoDoc.
-
- <b>ADO.NET:</b> Daniel Morgan and Rodrigo Moya have been
- working on the <a href="ado-net">ADO.NET</a> support, and got
- the first signs of life this week (we can connect, insert
- rows; do transactions: commit/rollback; SQL errors and
- exceptions work). Check <a
- href="mailing-lists.html">mono-patches</a> for all the
- goodies.
-
- <b>Optimizations:</b> A number of optimizations in the runtime
- made the compiler twice as fast this week:
-
- Early this week Patrik started the string
- rewrite in the runtime. Today Dietmar finished the
- constructors and deployed the new layout.
-
- Paolo got the JIT engine to generate profiles, which were in
- turn used to find hot spots in Reflection, which he improved.
-
- Daniel Lewis (of Regex fame) noticed the performance issues
- with our current array layout, and contributed a new array
- representation.
-
- At the same time Dietmar started the the JIT inline code and
- implemented constant propagation. These two optimizations
- together are very powerful.
-
- <b>Bug fixing:</b> And of course everyone has been helping out
- with the bug fixing (Duncan, Gonzalo, Jonathan, Miguel, Nick,
- Ravi, Sergey)
-
-
-@item Apr 18, 2002
-
- Dietmar's inlining for the JIT engine just landed into
- CVS. This is only a first cut and more improvements will come later.
-
- Patrik, Paolo, Dietmar and Gonzalo have been busy optimizing
- our class libraries and runtime engine to become faster. Many changes
- on CVS as well.
-
-@item Apr 11, 2002
-
- Gtk# 0.1 "ButtonHook" has been <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-April/000048.html">released</a>
-
- Binaries for the Mono Regression Test Suite are <a
- href="archive/mono-tests.tar.gz">available</a> for
- people porting the Mono Runtime to new platforms.
-
-@item Apr 6, 2002
-
- <a href="http://www.dotnetremoting.cc/book/AdvancedDotNetRemoting.asp">
- Advanced .NET Remoting</a> from Ingo Rammer is now available. Ingo
- helped us to implement the proxy support and the book is a valuable
- resource for anyone interested in remoting.
-
-@item Apr 5, 2002
-
- Transparent proxy support has been finished, congrats to
- Dietmar. Our JIT engine on CVS contains the implementation.
- This should enable people to test the remoting framework on
- Mono.
-
-@item Mar 28, 2002
-
- Debugging information is now generated by the compiler thanks
- to Martin's work. The resulting dwarf file can be used to
- single step C# code in GDB. A document will be shortly published with
- the details.
-
-@item Mar 27, 2002
-
- <b>Mono 0.10 is out!</b> The self hosting release of Mono has
- been released.
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure. Binaries are
- included. The <a href="archive/mono-0.10">Release Notes</a>
- are available.
-
- You can get it <a
- href="download.html#mar-27">Here</a> (quick links: <a
- href="archive/mono-0.10.tar.gz">runtime</a> and <a
- href="archive/mcs-0.10.tar.gz">compiler/classes</a>).
-
-@item Mar 26, 2002
-
- Paolo finally fixed the last bug in the JITer that stopped
- us from using it to run the Mono C# compiler. Goodies are on
- CVS.
-
- <a href="http://gtk-sharp.sourceforge.net">Gtk#</a> runs <a
- href="http://gtk-sharp.sourceforge.net/gtk-hello-world.png">Hello
- World</a>. Mike posted some <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-March/000034.html">details.</a>
-
-
-@item Mar 19, 2002
+ <td>
+ <b>Linux Planet</b>
+ </td>
+ <td>
+ <a href="http://www.linuxplanet.com/linuxplanet/reports/5375/4/">May 3rd, 2004</a>: And then there's Mono
+ </td>
+ </tr>
- Martin has been working on our debugging infrastructure, both
- on the JIT side of things (adding dward support) as well as on
- the class libraries (so that MCS can start generating
- debugging information).
+ <tr>
+ <td>
+ <b>DevChannel</b>
+ </td>
+ <td>
+ <a href="http://tools.devchannel.org/devtoolschannel/04/04/21/169234.shtml?tid=46">Apr 26th, 2004</a>: What is Mono and why should you care ?
+ </td>
+</tr><tr>
+ </tr>
+ <tr>
+ <td>
+ <img src="images/2003osdirwinnerbadge.gif">
+ </td>
+ <td>
+ <a href="http://osdir.com/Article198.phtml">Dec 19th, 2003</a>: Editor's Choice Award.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="images/netmagazine.png">
+ </td>
+ <td>
+
+ <a href="http://www.ftponline.com/wss/2003_TE/magazine/columns/trends">May 31st, 2003</a>: CLI integration.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="images/infoworld.png">
+ </td>
+ <td>
+ <a href="http://www.infoworld.com/article/03/05/22/HNmono_1.html">May 22nd, 2003</a>: Mono 1.0 plans.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="images/infoworld.png">
+ </td>
+ <td>
+ <a href="http://www.infoworld.com/article/03/03/14/11stratdev_1.html">Mar 14th, 2003</a>: Whither Mono?
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="images/b2.png">
+ </td>
+ <td>
+ <a href="http://www.infoworld.com/article/03/05/22/HNmono_1.html">Dec, 2002</a>: The Penguin takes flight.
+ </td>
+ </tr>
+ </table>
+
+
+<p>
+ The Mono project is an open source effort sponsored by <a
+ href="http://novell.com">Novell</a> to create a free
+ implementation of the .NET Development Framework.
+</p>
+
+<p>
+ Mono includes <a href="c-sharp.html">a compiler</a> for the
+ C# language, a <a href="runtime.html">Common Language
+ Runtime</a> (CLR) for the Common Language Infrastructure (CLI) and a
+ set of <a href="class-library.html">class libraries</a>. The
+ runtime can be <a href="embedded-api.html">embedded</a> into your
+ application. It implements both <a href="ado-net.html">ADO.NET</a>
+ and <a href="asp-net.html">ASP.NET</a>.
+</p>
+<p>
+ If you have questions about the project, read <a
+ href="rationale.html">the project launch statement</a>
+ or visit our list of <a href="faq.html">Frequently Asked
+ Questions</a>.
+</p>
+
+<p>
+ For details on the project's future direction, read the
+ <a href="mono-roadmap.html">roadmap</a>, and <a
+ href="download.html">download</a> the latest software version.
+ You can also get a <a href="snapshots">snapshot</a> of our
+ current work, or <a
+ href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=mono">browse
+ the source tree.</a>
+</p>
+<p>
+ To participate in discussion and development, <a
+ href="mailing-lists.html">subscribe to our mailing lists</a>.
+ You can also visit the <a
+ href="http://www.gotmono.com/cgi-bin/yabb/YaBB.pl">forum</a> at <a
+ href="http://www.gotmono.com">GotMono</a> or the <a
+ href="http://www.nullenvoid.com/gtksharp/wiki">Gtk#</a> and
+ <a href="http://www.nullenvoid.com/mono/wiki">Mono
+ </a> Wikis.
+</p>
+
+@item Jun 30th, 2004: Mono 1.0
+
+ <table>
+ <tr>
+ <td>
+ <img
+ src="http://www.go-mono.com/archive/1.0/mono1.gif"></td>
+ <td>
+ <b>Mono 1.0 has been released!</b><br/>
+
+ <p>Be the first kid in your block to install the
+ <i>it-took-us-three-years-but-we-did-it</i> development platform.
+
+ <p>Read the <a
+ href="http://www.go-mono.com/archive/1.0/index.html">release notes</a>
+ or <a href="http://www.go-mono.com/download.html">download it</a></p>
+ </td>
+ </tr>
+ </table>
- Jason and Kral keep working on the System.Xml namespace,
- allowing Mike to move more to self-hosting his Gtk# code.
-
- The System.Web classes are now part of the build (and they are
- also part of the class status now). Ajay contributed a large
- chunk of code to the System.Xml.Schema namespace
-
- Dan (of regex fame) has been working on internal calls
- support: moving more code from the old monowrapper to become
- internal calls.
-
- Paolo and Dietmar are working steadily on our runtime
- environment, fixing bugs, adding missing features and allowing
- us to run the compiler on Linux.
-
- Remember to post your bug reports.
-
- The nice class status on the right is brought to you by
- endless hacking hours from Piers and Nick. These status
- report pages have been helping us track down various mistakes
- in our classes (very useful, check it out for yourself)
-
-@item Mar 12, 2002
-
- At midnight, in Italy, Paolo got the Mono C# compiler to self
- host on Linux, the last bug has been squashed to self
- hostingness. We have now a fully self hosting compiler in Linux.
-
- A release will follow up shortly.
-
-@item Mar 9, 2002
-
- Updated the <a href="class-status.html">class status</a>, now
- it is possible to use the right-side menu to browse a specific
- assembly.
-
-@item Mar 7, 2002
-
- MCS compiles on Linux!
-
- Today Paolo got the <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-March/003726.html">MCS
- compiler compiling itself on Linux</a>
- completely for the first time! The resulting image still contains
- some errors, but the whole compiler process goes now. Later in the day
- and a couple of small optimizations and bug fixes, the compile
- speed was improved in 400%
-
- We are very close to have a complete self hosting environment now.
-
- Mono is temporarly using the Bohem GC garbage collector while
- we deploy the more advanced ORP one.
-
-@item Mar 5, 2002
-
- The CVS repository <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=Mono">can be browsed</a>
-
- Jason has got an incredible amount of work on the Xml
- classes during the weekend, and Gaurav is very close to have
- the complete System.Web.UI.WebControls namespace implemented.
-
- Martin and Duco have been killing bugs by using the recently
- revamped regression test suite.
-
- Piers has updated our <a href="class-status.html">class
- status</a> page again, with even more information available.
-
- The C# compiler has full constant folding implemented now and Ravi
- killed bugs of bugs in the <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FMCS&product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=%27Importance%27&form_name=query">Mono Bug List</a>
-
-@item Mar 1, 2002
-
- RPMs of Mono 0.9 are available at <a href="http://mono.baselabs.org/#download">mono.baselabs.com</a>
-
-@item Feb 28, 2002
-
- <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/003464.html">Christophe</a>
- has setup his <a href="http://mono.baselabs.org">First Steps in Mono</a> web site, which
- shows you a step-by-step process on getting Mono running on your system.
-
- RPMs of Mono 0.9 are available at <a href="http://mono.baselabs.org/index.php/software/">mono.baselabs.org</a>
-
-@item Feb 27, 2002
-
- New <a href="class-status.html">class status</a> engine that
- provides detailed information about missing functionality in
- our class libraries. Nick built the cormissing tool and Piers
- did the XSLT and DHTML magic.
-
- More compiler progress on Linux: our support runtime now
- enables the compiler to compile `MIS' on Linux (MIS being
- Dick's Mono sample HTTP server ;-)
-
-@item Feb 26, 2002
-
- Paolo posted a list of <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/003266.html">ways
- you can help</a> if you do not have Windows right now. Sergey followed up with
- <a href="http://lists.ximian.com/archives/public/mono-list/2002-February/003268.html">his</a>
- suggestions.
-
-@item Feb 25, 2002
-
- StrongARM port from Sergey Chaban has been checked into CVS.
-
-@item Feb 24, 2002
-
- SPARC: 44 out of 74 tests pass now (Jeff)
-
- Power PC: delegates are working now (Radek)
-
-@item Feb 22, 2002
-
- <b>Mono 0.9 has been released!</b>
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure. The <a
- href="archive/mono-0.9">Release Notes</a>
-
- You can get it <a
- href="download.html#feb-22">Here</a> (quick links: <a
- href="archive/mono-0.9.tar.gz">runtime</a> and <a
- href="archive/mcs-0.9.tar.gz">compiler/classes</a>).
-
-@item Feb 21, 2002
-
- Paolo got our compiler natively to compile 117 of our tests.
- Self hosting is closer every day.
-
- Unsafe support is finished in the C# compiler.
-
-@item Feb 20, 2002
-
- Gaurav got DataGrid and DataGridItemCollection done.
-
- C# compiler: Unsafe support is mostly complete (only stackalloc is missing).
-
- New easy to run scripts for compiling Mono on Unix and Windows
- is <a href="download.html">available</a>. We can now easily compile
- Mono on Windows and Linux. If you had trouble before, use the
- above scripts which will get the setup right for you.
-
- There are now three machines that can provide AnonCVS, just
- use anoncvs.go-mono.com as the hostname for your CVSROOT and
- you will get one of the machines.
-
-@item Feb 19, 2002
-
- Do you want to see what <a href="http://people.debian.org/~lupus/mono/">Mono Looks Like?</a>
-
-@item Feb 18, 2002
-
- Application Domains now support the two LoaderOptimization
- modes: share code or do not share code, and you can control
- this with the --share-code command line option.
-
- Paolo has now 100+ test cases run on Linux now with our class
- libraries.
-
- PowerPC and SPARC ports are moving along (Radek and Jeff)
-
-@item Feb 13, 2002
-
- Excellent news since the 11th, here is a quick rundown:
-
- AppDomains have been deployed (Dietmar). Socket work is done
- (Dick). Corlib compiled with no refs to mscorlib (Dan). New
- comprehensive tests for colib bits (David). Nick is driving the
- regression test suite efforts and class library completeness.
- New System.Data work (Chris). Bug fixes (Paolo, Duncan, Ravi, Miguel)
-
- Miguel is off to the <a
- href="http://www.fosdem.org">FOSDEM</a> conference in Brussels.
-
-@item Feb 11, 2002
-
- <b>Mono 0.8 has been released!</b>
-
- A new version of the runtime, compiler and class libraries has
- been packaged for your download pleasure.
-
- You can get it <a
- href="download.html#feb-11">Here</a> (quick links: <a
- href="archive/mono-0.8.tar.gz">runtime</a> and <a
- href="archive/mcs-0.8.tar.gz">compiler/classes</a>)
-
-@item Feb 11, 2002
-
- We would like to welcome all the new developers that have
- joined the project in the last couple of days. The classes
- are rapidly moving.
-
- An explanation of the relationship between <a
- href="http://mail.gnome.org/archives/gnome-hackers/2002-February/msg00031.html">GNOME
- and Mono</a>.
-
- Nick is still leading our test suite platform. I can not
- stress how important it is to have a good regression test suite
- for our platform, as buggy class libraries are what are
- stopping the compiler from running completely on Linux.
-
- We are of course psyched to see Mono run on
- non-Linux systems. Work is moving on native code generation
- for StrongARM, PowerPC, and SPARC as well as porting Mono to
- other systems.
-
- There are a couple of debates on the Mono list on implementing
- a set of web server classes for <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/002911.html">enabling
- ASP.NET</a> on Mono.
-
- Paolo also <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/002944.html">
- posted a list of pending tasks</a> to enable the compiler to run on Linux
-
-@item Feb 10, 2002
-
- Mike Kestner has posted an <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-February/000024.html">Update
- on his Gtk#</a> activities.
-
-@item Feb 4, 2002
-
- Adam has done <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-February/002808.html">Qt
- bindings</a> for .NET. Adam is cool.
-
-@item Jan 29, 2002
-
- Dan Lewis has contributed a major missing set of classes to
- Mono: <a
- href="http://lists.ximian.com/archives/public/mono-list/2002-January/002745.html">
- System.Text.RegularExpressions</a>.
-
- This is a fully .NET compatible implementation of the .NET regular expressions,
- fully Unicode aware. This contribution is very appreciated, as implementing this
- was not entirely trivial (supporting Unicode, plus a regex engine which is a super
- set of the Perl regex engine).
-
-@item Jan 28, 2002
-
- The Mono contributors have relicensed the Class Libraries under
- the terms of the
- <a href="http://www.opensource.org/licenses/mit-license.html">MIT X11</a> license.
-
- This license is an Open Source license, and is used by other projects
- (most notably, the XFree86 project).
-
- The runtime (JIT, metadata library, interpreter) remains under
- the LGPL and the C# compiler remains under the GPL.
-
- Our <a
- href="http://www.ximian.com/about_us/press_center/press_releases/mono_partners.html">Press
- Release</a>
-
- Press coverage: <a
- href="http://news.com.com/2100-1001-823734.html">CNet</a>, <a
- href="http://www.wired.com/news/technology/0,1282,50037-2,00.html">Wired</a>,
- <a href="http://www.infoworld.com/articles/hn/xml/02/01/28/020128hnopennet.xml">InfoWorld</a>,
- <a href="http://www.newsforge.com/article.pl?sid=02/01/27/2232231">NewsForge</a>.
-
-@item Jan 23, 2002
-
- New mailing list: <a href="mailto:mono-patches-request@ximian.com">mono-patches@ximian.com</a>.
- This mailing list will receive automatically the patches that are submitted
- to the Mono CVS to any of its modules.
-
- This allows anyone who wants to participate in the peer-review of the
- code submitted to CVS to receive patches on e-mail. It should also
- expose to everyone the changes that are being done by the team every day.
-
-@item Jan 21, 2002
-
- Dick has got a simple web server running with Mono (`MIS: Mono
- Internet Server') that is mostly used to test our IO layer, a
- <a href="http://primates.ximian.com/~miguel/dick-mis-server.png">screenshot</a>
-
- Paolo and Dietmar are busy making our runtime self sufficient on
- non-Windows platforms.
-
- C# compiler front: A lot of focus in the past weeks after
- the C# became self hosting has been in making the compiler a useful
- tool for development: improve error handling, provide better error
- reports, fixing all known bugs, and finally profiling of the compiler
- has begun.
-
-@item Jan 8, 2002
-
- Our compiler has been self-supporting since January 3rd. In
- the meantime, we have been busy working on making it run on
- Linux. Today Paolo got more work done on Reflection.Emit and
- the compiler compiled `console.cs' (a sample Mono program) on
- Linux.
-
-@item Jan 4, 2002
-
- Dietmar landed the Unicode support patch. Class libraries and
- runtimes are now fully Unicode aware. The details are <a href=
- "http://lists.ximian.com/archives/public/mono-list/2002-January/002409.html">
- here</a>
-
- Last minute breaking news: Paolo got our compiler in Linux to
- compile fib.cs, patches are comming tomorrow once we have
- ChangeLog entries.
-
-@item Jan 4, 2002
-
- Mike Kestner posted an update on Gtk# <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-January/000021.html"><i>New
- year, new direction</i></a>.
-
- Gtk# will be our foundation on which we will be implementing
- System.Windows.Forms.
-
-@item Jan 3, 2002
-
- Mono C# compiler becomes self-sufficient. We can now continue
- development of the compiler with itself.
-
- Work on the class libraries is still underway for having a full
- self hosting system. We hope to achieve our goal of self-hosting
- on Linux before the end of the month.
-
- Join the fun by downloading either tonight's <a
- href="snapshots">snapshot</a> or getting your sources from our
- <a href="anoncvs.html">Anonymous CVS server</a>.
-
-@item Dec 28, 2001
-
- After a lot of work, the C# compiler can compile itself.
- There are still errors in the generated image, but they are
- being fixed quickly.
-
- We will soon have the first non-Microsoft C# implementation!
-
-@item Dec 18, 2001
-
- JIT: More work on our IO abstraction layer (Dick).
-
- JIT: exception handling for unmanaged code (Dietmar)
-
- System.Reflection: Support for PropertyInfo and
- PropertyBuilder as well as the various queries for MethodBase.
-
- C#: Pre-processor; Rewrite of MemberLookup which fixed many of
- the outstanding issues. More bug fixing allows it to compile
- more programs.
-
-@item Dec 14, 2001
-
- Dietmar has improved the register allocation and now Mono performs
- two to three times as fast as it did yesterday. Amazing.
-
- The compiler keeps moving along, explicit interface
- implementation is there.
-
-@item Dec 11, 2001
-
- The JIT engine can now run all the compiler regression tests as
- well as assorted other programs, many more opcodes added
- recently. Currently the JIT engine uses a very simplistic register
- allocator (just enough to allow us to focus on feature completeness)
- and that will be the next major task to improve performance and
- reduce spills and reloads.
-
- On the C# compiler front: language features are now pretty
- much complete. The big missing tasks are unsafe code support,
- visibility, explicit interface implementation plus static flow
- analysis. There are many small bugs that need to be addressed.
-
- You can get your copy of the <a href="snapshots">latest Mono</a>
-
- More work is also required on fixing the foundation class
- libraries, it is easy to find spots now since Nick got the
- `make test' going.
-
-@item Dec 1, 2001
-
- AnonCVS access to Mono is here (updated every hour). Thanks
- to <a href="http://www.hispalinux.es">HispaLinux</a> and Jesus
- Climent for helping to set this up.
+@item Jun 23rd, 2004: The Mono Hackers Hall of Fame welcomes John Luke, Dan Morgan and Tim Coleman.
+
+ The <a href="http://www.go-mono.com/hackers.html">Mono Hackers Hall Of Fame</a>
+ continues to show our appreciation to the excellent
+ contributors that make <b>mono::</b> a successful free
+ software project.
+
+ John Luke, Dan Morgan and Tim Coleman are now part of the Mono
+ Hackers Hall of Fame.
+
+@item Jun 15th, 2004: Mono Beta 3 has been released
+
+ <table>
+ <tr>
+ <td>
+ <img
+ src="http://www.go-mono.com/images/beta3.gif"></td>
+ <td>
+ Our third beta has been released.
+
+ Packages and source code are available <a
+ href="download.html">on our download</a> page.
+ </td>
+ </tr>
+ </table>
-@item Nov 30, 2001
+@item Jun 1st, 2004: Mono Beta 2 has been released
+
+ <table>
+ <tr>
+ <td>
+</td>
+ <td>Mono Beta 2 has been released. See our <a
+ href="http://www.go-mono.com/archive/beta2/beta2.html">Release
+ Notes</a>, or go directly to the <a href="download.html">download</a> page.
+ </td>
+ </tr>
+ </table>
- All tests from the mono runtime work with the JIT engine now
- (Dietmar).
+@item May 17th, 2004: Huge press response for Mono 1.0 Beta 1
+
+ Two weeks after the release of Mono 1.0 Beta 1, we take a
+ look at the <a href="http://www.go-mono.com/beta1-press.html" target='_blank'>press coverage</a> that followed the
+ beta release.
+
+@item May 10th, 2004: The Mono Hackers Hall of Fame welcomes Todd Berman
+
+ The <a href="http://www.go-mono.com/hackers.html">Mono Hackers Hall Of Fame</a>
+ continues to show our appreciation to the excellent
+ contributors that make <b>mono::</b> a successful free
+ software project.
+
+ Todd Berman is a steady contributor to Mono. He has worked
+ everywhere: from the Class Libraries, to the early implementation of
+ the GAC and most recently has lead the effort to develop, port and
+ maintain MonoDevelop an IDE for the Mono environment. His help has
+ been key to the development of Mono.
+
+@item May 4th, 2004: Mono Beta 1 available
+
+ <table>
+ <tr>
+ <td>
+ <img
+ src="http://www.go-mono.com/images/beta1-anim.gif"></td>
+ <td>Mono Beta 1 has been released. See our <a
+ href="http://www.go-mono.com/archive/beta1/beta1.html">Release
+ Notes</a>, or go directly to the <a href="download.html">download</a> page.
+ </td>
+ </tr>
+ </table>
- Recursive enumeration definition in the C# compiler are
- working now (Ravi).
+@item May 2nd, 2004: mDnsResponder.Net; Global Assembly Cache.
- More work on the Web classes (Gaurav).
+ Brady Anderson has released the first version of his <a href=
+ "http://forge.novell.com/modules/xfmod/project/?mdnsresponder">multicast
+ DNS responder</a> written in C# for the Mono and .NET
+ platforms. This is the foundation for implementing
+ rendezvous-like functionality in your applications.
-@item Nov 28, 2001
+ The tree has started to stabilize after all the changes last
+ week to integrate the Global Assembly Cache work that Jackson,
+ Sebastien, Todd and all the volunteers helped us deploy.
- JIT land: Paolo got GDB support into the JIT engine while
- Dietmar added exceptions support to it.
+@item Apr 22nd, 2004: XSP 0.12 released.
- The C# compiler supports all array initializations now, and the
- switch statement as well as fixing many existing bugs. Many
- new more tests.
+ A new release of XSP is available. It fixes a bug that made Web Services
+ unusable from client proxies. You can download it from <a
+ href="/archive/xsp-0.12.tar.gz">here</a>.
- Nick keeps working on improving our class library test suite.
-
- Dick has almost completed the Mono IO layer.
-
-@item Nov 16, 2001
-
-<blockquote>
- Mike Kestner has posted an <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2001-November/000015.html">update</a>
- on Gtk# development.
-</blockquote>
-
-@item Nov 14, 2001
-
-<blockquote>
- Paolo today got the Mono C# compiler running <a
- href="http://lists.ximian.com/archives/public/mono-list/2001-November/001941.html">on
- Linux</a>. It compiles a sample program and then the sample
- program is executed.
-
- Mutator unary operators (++ and --) in the compiler are fully
- functional, they used to only work on variables, and now they
- are complete.
-
- To sum things up: The Mono C# compiler is written in C# and
- uses the .NET classes to get its work done. To make this work
- on Linux work has to happen in various fronts:
-<ul>
- * The C# compiler is being worked on and can compile
- many programs now (our test suite at this point is
- made up of 40 tests).
-
- * The class libraries need to be mature enough to support
- the compiler, particularly System.Reflection.Emit (which is
- what Paolo has been working on lately).
+@item Apr 21st, 2004: XSP 0.11 and mod_mono 0.8 released.
- The compiler currently requires 103 classes from the
- .NET runtime (you can get the list by running: <b>monodis --typeref mcs.exe</b>
+ Gonzalo has made new releases of XSP and mod_mono (The ASP.NET
+ hosting service for Mono).
- * The interpreter should be mature enough to run the actual
- compiler byte codes and the corlib bytecodes.
-</ul>
+ Check the XSP/mod_mono <a href="archive/xsp-0.10.html">
+ Release Notes</a> to see what is new and to obtain the source
+ packages.
- At the same time, Dietmar is working on the JIT engine which will
- replace our interpreter in production.
-</blockquote>
+@item Apr 20, 2004: S390 port; Interpreted Updated; Identity classes; System.Drawing; Mono Debugger.
-@item Nov 12, 2001
+ Neale who originally wrote the S390 interpreter support for
+ Mono has checked into CVS his port of the S390 JIT engine.
+ Now, if we could only have one of those in our living room.
-<blockquote>
- Dietmar got value types working on the JIT engine. Sean has
- got assembly loading in the runtime (required for NUnit).
+ Bernie has checked into CVS a new interpreter for the Mono
+ runtime. This new interpreter translates the CIL opcodes into
+ a new intermediate representation. The new IL representation
+ avoids doing costly lookups during interpretation which means that the
+ interpreter is a lot faster now.
- More progress on enumerations and attributes from Ravi.
+ Performance wise, the new interpreter is three times faster
+ than the old one when doing a compiler bootstrap.
- Nick keeps working on improving our class libraries.
-</blockquote>
+ Sebastien has recently completed the identity classes in the
+ Mono Runtime, you can see more details on his <a
+ href="http://pages.infinit.net/ctech/poupou.html">blog</a>
-@item Nov 8, 2001
+ New progress on the GDI+ front: Jordi has completed the region
+ code; Ravindra the various brushes that we must support;
+ Sanjay the Icon and BMP loaders (with Mark) and Vladimir has
+ contributed various codecs and a new fresh implementation of
+ Image.LockBits.
-<blockquote>
- Enumerations, array access and attributes for the C# compiler are into the CVS now.
+ Lluis and Atsushi in the meantime has been in charge of
+ completing various pending items from our class libraries:
+ basically an API audit of the things missing for the Mono 1.0
+ release, small but important things.
- Full array support is not complete, but moving along.
-</blockquote>
+ Martin has replaced the old command-line language in the
+ debugger with our home-grown "Command Line" language, a
+ TCL-like command line language that we built for it (its a
+ tiny .NETized Tcl-like language). The interaction process is
+ a lot smoother than it used to be and we are focusing on the
+ usability of the command line language to improve the
+ debugging experience.
-@item Nov 5, 2001
+@item Apr 02, 2004: Mono C# Compiler gets CLS support; Basic Runtime Contribution from Mainsoft.
-<blockquote>
- Dietmar's new set of patches to the JIT have 20 out of 33
- tests running now.
-</blockquote>
+ Marek Safar has been working for a few months on adding
+ support to the C# compiler to support the various checks required
+ by the Common Language Specification (CLS).
-@item Nov 4, 2001
+ In the past the C# compiler was unable to flag any problems
+ related to the creation of cross-language libraries. Today
+ with this patch the compiler will properly flag errors in CLS
+ compliance. Tests for all of the errors have also been
+ included on CVS.
-<blockquote>
- Mike Kestner, main Gtk# contributor has posted a very interesting <a
- href="http://lists.ximian.com/archives/public/gtk-sharp-list/2001-November/000013.html">
- update</a> on his work on Gtk#.
+ <a href="http://www.mainsoft.com">Mainsoft</a> has contributed
+ an implementation of their Basic runtime to the project. The
+ runtime they wrote is written in Java and we are translating
+ this into C# code. The code will reach CVS within the next
+ few weeks.
- Ravi commited the initial support for Attributes in the
- compiler.
+ Mainsoft also contributed an extensive regression test suite
+ for the Basic runtime, a port of the NIST XML tests and their
+ own in-house developed XML tests.
- Many HTML Controls from Leen checked into CVS.
+@item Mar 31st, 2004: Gtk# 0.18, MonoDoc 0.13, MonoDevelop 0.2 released
- Paolo checked in his new System.Reflection and
- System.Reflection.Emit implementations. He has been working
- steadily on this huge task for a few weeks now. This is the
- foundation for the Mono C# compiler, and hence a very
- important piece of the puzzle.
-</blockquote>
+ New versions of Gtk# and MonoDoc have been released.
-@item Nov 3, 2001
+ Gtk# is available from <a
+ href="http://gtk-sharp.sf.net">Gtk# home page</a> and MonoDoc 0.13
+ is available from our <a href="download.html">download</a>
+ page.
-<blockquote>
- Many clean ups have been going into the class library by Nick Drochak.
+ Gtk# now features [ConnectBefore] attribute for hooking up
+ signals; An automake/autoconf setup; the System.Drawing
+ dependency has been dropped and many more docs.
- Mega patch from Dietmar: he commited the flow analysis code
- for the JITer.
+ And <a href="http://www.monodevelop.com/">MonoDevelop 0.2</a>
+ has been released.
- A lot of work has been going into the WebControls by Gaurav (4
- new controls plus improved and bug fixed base classes).
-</blockquote>
+@item Mar 18th, 2004: Mono 0.31 has been released
-@item Nov 1, 2001
+ We have released version 0.31 of Mono. All the new features
+ and improvements are described in our <a
+ href="archive/mono-0.31.html">Mono 0.31 Release Notes</a>.
-<blockquote>
- Ravi commited the caller-side method selection of methods with
- variable length arguments. Now he depends on Miguel finishing
- the array handling support.
-</blockquote>
+ You can download Mono 0.31 packages using Red Carpet, or pick
+ the individual packages from our <a
+ href="download.html">download</a> page.
-@item Oct 27, 2001
+@item Mar 15th, 2004: Async IO lands on Mono.
-<blockquote>
- Lots of classes for System.Web from Gaurav were commited this
- morning.
+ Gonzalo has completed the implementation of Async I/O for Mono
+ using the kernel aio_* interfaces. If your operating system supports
+ the aio_ POSIX interface, the FileStream methods that
+ expose asynchronous methods will use this facility instead of
+ emulating it with threads as we have done in the past.
- Some large recent developments:
+ We had this request come to us from various people in the
+ past, and we are now looking for your help to test and debug
+ this.
- The Decimal implementation from Martin Weindel has been
- partially integrated (we need to put the internalcalls in
- place now and compile and link the decimal code).
+@item Mar 11th, 2004: Mono JIT ported to SPARC.
- Derek Holden commited recently the IntegerFormatter code into
- the CVS, so we got a pretty comprehensive integer formatting
- engine that we can finally use all over the place.
+ Zoltan Varga announced today that the SPARC port of the Mono
+ JIT engine has been completed. Congratulations to Zoltan for
+ this amazing development.
- Compiler got support for lock as well as assorted bug fixes.
- Ravi is still working on array support (and then we can
- optimize foreach for the array case).
+@item Feb 26th, 2004: Agenda: Mono Meeting in Boston.
- Dietmar is busy working on flow analysis on the JITer, the
- previous mechanism of generating the forest was wrong. Paolo
- has been a busy bee reworking the System.Reflection.Emit
- support code, and we should have some pretty nice stuff next
- week. Dick on the other hand is still working on the
- WaitOne/WaitAll emulation code. WaitAll is like select on
- steroids: it can wait for different kinds of objects: files,
- mutexes, events and a couple of others.
+ The agenda for the Mono Meeting is now available: <a
+ href="http://primates.ximian.com/~miguel/MonoMeet.html">Mono Meeting
+ Agenda</a>
- Mike Kestner is busy working on Gtk# which is now using the
- .defs files to quickly wrap the API.
-</blockquote>
+@item Feb 24th, 2004: Mono Meeting in Boston.
-@item Oct 18, 2001
+ On March 5th-6th (Friday and Saturday) there will be an
+ open-house meeting for people interested in Mono to get
+ together with the Mono developers at the Novell offices in
+ in Cambridge Massachusetts (<a
+ href="http://www.ximian.com/about_us/contact/">directions</a>).
-<blockquote>
- Reworking expressions to support cleanly indexers and
- properties. <a href="http://www.nat.org/evolution.php3">11
- days</a> until Evolution 1.0 ships.
+ The whole Novell Mono team will be here (Atsushi Enomoto, Dick
+ Porter, Duncan Mak, Erik Dasque, Gonzalo Paniagua, Jackson
+ Harper, Jordi Mas, Lluis Sanches, Manjula, Martin Baulig,
+ Miguel de Icaza, Mike Kestner, Paolo Molaro, Peter Bartok,
+ Sebastien Pouliot, Sachin Kumar) and hopefully Joe Shaw, Nat
+ Friedman, Peter Williams and Ravi Pratap will be joining us as
+ well. Expect to see Todd Berman from MonoDevelop as well.
- Ximian users around the world <!--a
- href="http://www.bez.it/IMAGES/nora.jpg"-->rejoice<!--/a--> with
- recent C# compiler progress.
-</blockquote>
+ If you are coming, please notify <a
+ href="mailto:edasque@ximian.com">edasque@ximian.com</a> about it, so
+ we can add you to the security list, and use the `open house
+ confirmation' subject in your email.
-@item Oct 17, 2001
+@item Feb 13, 2004: Mono 0.30.1 released
-<blockquote>
- Delegate support has been checked into the compiler
- (definition and invocation); break/continue implemented.
-</blockquote>
+ We have released a small bug-fix release of Mono, the release
+ notes are available <a
+ href="archive/mono-0.30.1.html">here</a> and you can download
+ it from our <a href="download.html">download</a> page.
-@item Oct 15, 2001
+@item Feb 13, 2004: Mono Performance Optimization
-<blockquote>
- JIT engine supports many of the object constructs now (object
- creation, vtable setup, interface table setup).
+ We have a new document that describes some <a
+ href="performance.html">common tricks to improve the
+ performance</a> of your Mono or .NET application. These are a
+ summary of techniques that we employed to tune our own C#
+ compiler.
- The C# compiler now has almost full property support (only
- missing bit are pre-post increment/decrement operations),
- delegates are now created (still missing delegate invocation).
- try/catch/finally is also supported in the compiler now.
+@item Feb 2nd, 2004: Mono 0.30 has been released
- System.Decimal implementation is in, as well as many crypto
- classes.
-</blockquote>
+ Check out the <a
+ href="http://www.go-mono.com/archive/mono-0.30.html">Release
+ notes</a> for details on Mono 0.30. Or go directly to our <a
+ href="download.html">download</a> section
-@item Oct 5, 2001
+@item Jan 18th, 2004: LDAP class libraries in Mono tutorial.
-<blockquote>
- Sergey has released his first version of the <b>ilasm</b>
- assembler written in C#. You can get it from his web page:
- <a
- href="http://mono.eurosoft.od.ua">http://mono.eurosoft.od.ua</a>.
+ Sunil Kumar has written an <a
+ href="http://www.novell.com/coolsolutions/cooldev/features/a_net_cplus_ldap_library_cdev.html">introduction
+ to Novell.LDAP</a> class libraries, which are part of Mono.
- The plan is to integrate ildasm into the Mono CVS soon. This
- component should in theory also be reusable for SharpDevelop
- eventually.
-</blockquote>
+@item Jan 13th, 2004: MonoDoc 0.9 released.
-@item Oct 4, 2001
+ A new edition of MonoDoc, the Mono Documentation Browser, has been released, available in source form from:
+ <a href="archive/monodoc-0.9.tar.gz">archive/monodoc-0.9.tar.gz</a>
-<blockquote>
- Our System.Reflection.Emit implementation created its first
- executable today. This means that a very simple .NET program
- that was compiled on Windows was able to generate a .NET program
- while running on Linux using the Mono runtime.
+@item Jan 11th, 2004: Call for Stories
- The various piece of the puzzle are starting to get together:
- the compiler can compile simple programs now and we are
- basically focusing on completeness now.
-</blockquote>
+ If you have a success story about using Mono or one of the Mono
+ components in any way, we want to hear about you. Please mail
+ your details to miguel@ximian.com
-@item Sep 28, 2001
+@item Jan 4th, 2004: Windows Installer for Mono 0.29
-<blockquote>
- <a
- href="http://www.icsharpcode.net/OpenSource/SD/default.asp">Sharp
- Develop 0.80</a> was released today.
-</blockquote>
-
-@item Sep 26, 2001
-
-<blockquote>
- More progress: more opcodes are working (Paolo); The compiler
- runs up to a point in Mint (Paolo); operator overloading works
- (both unary and binary) all over the place (Miguel); Completed decimal
- type conversions (Miguel); New build system in place based on
- Ant (Sean and Sergey); Refactored and documented the
- internals of the JIT engine (Dietmar); StatementExpressions
- handled correctly (Miguel).
-</blockquote>
-
-@item Sep 21, 2001
-
-<blockquote>
- A couple of news-worthy items: Dick got the initial thread
- support into mint; Paolo implemented many new opcodes; Dietmar
- got long operations and mul/div working on the JITer; Ravi rewrote
- the Method selector for expressions to be conformant; Miguel
- got i++ working. All in tonight's snapshot
-</blockquote>
-
-@item Sep 19, 2001
-
-<blockquote>
- Paolo has written a section on <a href="porting.html">Porting
- Mono</a> to othre architectures.
-</blockquote>
-
-@item Sep 18, 2001
-
-<blockquote>
- <A a href="download.html#sep-18">Mono 0.7</a> has been
- released (runtime engine, class libraries
- and C# compiler). Check the <a href="archive/mono-0.7">Mono
- 0.7 announcement</a> for details
-</blockquote>
-
-@item Sep 17, 2001
-
-<blockquote>
- Mike Kestner's Gtk# (Gtk-sharp) was checked into the CVS
- repository. Gtk# can run a simple hello world application.
- The binding is nice, as it maps Gtk+ signals to delegates in
- C#. You can see the Gtk# Hello World program <a href="src/HelloWorld.cs">here</a>
-
- Gtk-sharp should be available on the next snapshot set.
-</blockquote>
-
-@item Sep 10, 2001
-
-<blockquote>
- Dietmar checked in his CIL tree/forest regeneration and most
- importantly, the x86 instruction selector burg grammar.
-</blockquote>
-
-
-@item Sep 5, 2001
-
-<blockquote>
- The MCS compiler <b>can compile the sample Hello World</b>
- application and generate a Windows/CIL executable that runs!
-
- This executable runs with the Mono Interpreter of course (see
- August 28)
-</blockquote>
-
-@item Sep 4, 2001
-
-<blockquote>
- Dietmar checked into CVS the `monoburg' architecture
- independent instruction selector for the JIT engine.
-</blockquote>
-
-@item Aug 28, 2001
-
-<blockquote>
- <b>.NET Hello World is working under Mono!</b> The latest snapshots
- will let you run it.
-
- Hello World consits of 1821 CIL instructions,
- performs 66 subroutine calls and loads 12 classes from the corlib.dll
-
- Good work Mono team!
-</blockquote>
-
-@item Aug 23, 2001
-
-<blockquote>
- Lloyd Dupont has announced his OpenGL bindings for C#, they
- are available here: <a
- href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
-</blockquote>
-
-@item Aug 22, 2001
-
-<blockquote>
- New version of the Mono Runtime, Compiler and Classes has been
- <a
- href="download.html#august-22">released.</a> Check the <a
- href="archive/mono-0.6">0.6 announcement</a>.
-</blockquote>
-
-@item Aug 20, 2001
-
-<blockquote>
- A new <a href="contributing.html#compile-service">Compilation
- service</a> has been made available by Derek to allow people
- without access to the <a
- href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">.NET SDK</a>
-</blockquote>
-
-@item Aug 3, 2001
-
-<blockquote>
- Daily snapshots of mcs and mono are now available, they will
- run every night at 10pm Boston time.
-</blockquote>
-
-@item Jul 29, 2001
-
-<blockquote>
- Mono Runtime 0.5 has been <a
- href="download.html#july-29">released.</a> Check the <a
- href="archive/mono-0.5">release notes</a>
-</blockquote>
-
-@item Jul 25, 2001
-
-<blockquote>
- The slides for <A href="Presentations/O-Reilly">my
- presentation</a> at <a href="http://www.oreilly.com">O'Reilly
- Open Source Software Convention</a>
-</blockquote>
-
-@item Jul 22, 2001
-
-<blockquote>
- Another release of the class libraries is out, check the <a
- href="archive/mcs-22">MCS 22-July Release Notes</a>. You can
- get the new class libraries from <a
- href="download.html#july-22">here</a>
-</blockquote>
-
-@item Jul 19, 2001
-
-<blockquote>
- Another release of the class libraries is out, check the <a
- href="archive/mcs-19">MCS 19-July Release Notes</a>. You can
- get the new class libraries from <a
- href="download.html#july-19">here</a>
-</blockquote>
+ There is a <a href="archive/mono-0.29-win32-1.exe">Windows
+ Installer for Mono 0.29</a> available now.
-@item Jul 17, 2001
-
-<blockquote>
- Another release of the class libraries is out, check the <a
- href="archive/mcs-17">MCS 17-July Release Notes</a>. You can
- get the new class libraries from <a
- href="download.html#july-17">here</a>
-
- Do not forget to check out the updated <a href="faq.html">FAQ</a>.
-
- Got Sean's new Class
- Status web pages up. These are a lot better than mine, and
- we are now keeping better track of contributors.
-</blockquote>
-
-@item Jul 15, 2001
-
-<blockquote>
- Another release of Mono is out, check the <a
- href="archive/mono-0.4">Mono 0.4 Release Notes</a>. Get it <a
- href="download.html#july-15">here</a>.
-</blockquote>
-
-@item Jul 14, 2001
-
-<blockquote>
- A <a
- href="http://lists.ximian.com/archives/public/mono-list/2001-July/000399.html">new
- release</a> of the
- runtime, compiler and classes has been made. Get it <a href="download.html#july-14">here</a>
-</blockquote>
-
-@item Jul 12, 2001
-
-<blockquote>
- I keep getting questions about my opinion on Passport, even when
- Mono has <b>nothing</b> to do with it. I finally <a
- href="passport.html">wrote something.</a>
-</blockquote>
-
-@item Jul 9, 2001
-
-<blockquote>
- Project launched.
-</blockquote>
+<h2>Older News</h2>
-@item O'Reilly
+ Click <a href="oldnews.html">here</a> to see older news.
-<blockquote>
- Brian posted a story on <a
- href="http://www.oreillynet.com/dotnet">O'Reilly Network .NET</a>
-</blockquote>
diff --git a/web/issues b/web/issues
new file mode 100644
index 00000000000..abf91eeadfa
--- /dev/null
+++ b/web/issues
@@ -0,0 +1,54 @@
+<a name="wapi"></a>
+* ~/.wapi error message
+
+Q: What does the following error message mean?
+
+ <pre>
+ Failed to attach shared memory!
+ Falling back to non-shared handles
+ </pre>
+
+A: To properly implement the handle semantics expected by .NET
+ applications where a handle number is all that its needed to pass
+ a descriptor from one process to another and have it just work.
+
+ Handles are used to specify: files, events, locks, semaphores,
+ sockets, pipes and processes descriptors. So two Mono processes
+ can share any of those resources just by exchanging the handle
+ tokens (a number) between them.
+
+ This is accomplished by using a helper process that is launched by
+ the first Mono invocation (that is why you see two mono processes
+ running on your machine).
+
+ The various Mono processes communicate with each other with a local
+ file in the ~/.wapi directory (one per hostname, so this works fine
+ over NFS).
+
+ If the system crashes, or all of the Mono processes are killed
+ without a chance to shut down properly those files will remain
+ there, but there will no longer be an owner for them. If a new
+ Mono start up, it will notice that the file exists, but it will
+ fail to contact the helper process, issuing the above warning.
+
+Q: How do I fix the problem?
+
+A: If you are sure that no other Mono process is running, you can just
+ delete the contents of the ~/.wapi directory:
+
+<pre>
+ rm -i ~/.wapi/*
+</pre>
+
+ If you can not delete those files (because say, you have a running
+ Mono, you can disable the use of the shared handles setup by
+ setting the MONO_DISABLE_SHM environment variable as well:
+
+<pre>
+ # Notice: Highly discouraged
+ bash$ export MONO_DISABLE_SHM=1
+</pre>
+
+ The above is highly discouraged as that will make process execution
+ fail, and without that many things like XSP/ASP.NET or the C#
+ compiler's -pkg: support will not work.
diff --git a/web/java b/web/java
index cf1afa1a39e..adcd888f1be 100755
--- a/web/java
+++ b/web/java
@@ -1,5 +1,9 @@
* Java
+ <b>This is an outline on how to support Java, actual
+ implementations of ideas like this can be found <a href="http://radio.weblogs.com/0109845/">here</a></b>
+
+
It would be interesting to support the Java language as part
of the Mono project.
diff --git a/web/jit-debug b/web/jit-debug
index 867738101ae..57ec9065263 100644
--- a/web/jit-debug
+++ b/web/jit-debug
@@ -1,181 +1,78 @@
-* How to debug your C# application with the JIT engine
+* Debugging information
- To debug a C# application you need to run the JIT in your debugger.
+ Compile your programs using the `-g' flag in MCS, that will all a special
+ resource containing debugging information to your executable.
- Before you can do anything useful in a debugger, you need a symbol
- file which tells your debugger about functions, types, line numbers
- and such. Unfortunately, this symbol file needs to be recreated each
- time the JIT compiles a new method since it doesn't know anything
- about this method (especially not its memory address) before actually
- compiling it.
+ To get stack traces with line number information, you need to run your
+ program like this:
- You have two ways of creating a symbol file:
+ <b>
+ mono --debug program.exe
+ </b>
-** Letting the JIT dynamically create the symbol file
+ Notice that the program will need to be compiled with the -g
+ flag and that running with --debug will slow down the execution.
- This'll give you a symbol file which is suitable for debugging IL byte
- code - you won't see your C# source code.
+* Debugging with GDB
- However, this method has the advantage that it works with every assembly,
- no matter whether it has been compiled with Mono's C# compiler (MCS) or
- with any other compiler. It's currently the only way to debug
- <tt>corlib.dll</tt> or any other library which cannot be compiled with
- our compiler yet.
+ If you use GDB to debug your mono process, you can use the function
+ print_method_from_ip(void *address) to obtain the name of a method
+ given an address.
- All that you need is a dump of the IL bytecode for each assembly (including
- all assemblies this assembly is referencing). This is done by using the
- <tt>monodis</tt> utility:
+ For example:
<pre>
- monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il<br>
- monodis /home/export/martin/MONO-LINUX/lib/System.dll > System.il<br>
- monodis /home/export/martin/MONO-LINUX/bin/mcs.exe > mcs.il
- </pre>
+(gdb) where
+#0 ves_icall_System_String_GetHashCode (me=0x80795d0) at string-icalls.c:861
+#1 0x0817f490 in ?? ()
+#2 0x0817f42a in ?? ()
+#3 0x0817f266 in ?? ()
+#4 0x0817f1a5 in ?? ()
+</pre>
- Make sure that all the .il files have the same name as their corresponding
- assembly and that they're all created in the current directory.
+ You can now use:
- The JIT supports two different debugging file formats:
+<pre>
+(gdb) p print_method_from_ip (0x0817f490)
+IP 0x817f490 at offset 0x28 of method (wrapper managed-to-native) System.String:GetHashCode () (0x817f468 0x817f4a4)
+$1 = void
+(gdb) p print_method_from_ip (0x0817f42a)
+IP 0x817f42a at offset 0x52 of method System.Collections.Hashtable:GetHash (object) (0x817f3d8 0x817f43b)
+$2 = void
+</pre>
- <ul>
- * STABS: This is a very simple debugging format, but it may be the only one
- which is supported on your system. It is limited to source files of no more
- than 65.535 lines and it's type support is also very limited. You should only
- use this if your debugger doesn't support DWARF 2.
+ Mono support libraries use a couple of signals internally that
+ confuse gdb, you might want to add this to your .gdbinit file:
- To generate STABS output, use the <tt>--stabs</tt> command line argument.
+<pre>
+ handle SIGPWR nostop noprint
+ handle SIGXCPU nostop noprint
+</pre>
+* Mono Debugger
- * DWARF 2: The DWARF 2 debugging format is a very powerful debugging format
- which can handle source files of arbitrary size and has a highly sophisticated
- type support. It's the recommended format unless you need to use STABS because
- your debugger doesn't support DWARF 2.
+ The Mono debugger is written in C# and can debug both managed
+ and unmanaged applications, support for multiple-threaded
+ applications and should be relatively easy to port to new
+ platforms.
- To generate DWARF 2 output, use the <tt>--dwarf</tt> command line argument.
- </ul>
+ Details of the release are available in <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-January/011415.html">post</a>.
+
+ The debugger contains both Gtk# and command line interfaces.
+ The debugging file format used in Dwarf (it's already supported
+ by our class libraries and the Mono C# compiler; To debug C
+ applications, you need a recent GCC, or to pass the -gdwarf-2
+ flag to gcc).
+ You can download the releases from <a
+ href="http://primates.ximian.com/~martin/debugger/">Martin Baulig's
+ home page.</a>
- You need to regenerate the symbol file each time the JIT compiled a new
- method and each time you restart the JIT. You cannot reuse your symbol file
- if you start the JIT a second file, not even if you're running the same
- application with the same input data a second time.
- Regenerating the symbol file is done by calling the JIT's
- <tt>mono_debug_make_symbols ()</tt> function from within your debugger and
- then reloading the symbol files. This function creates a <tt>filename-dwarf.s</tt>
- (or <tt>filename-stabs.s</tt>) assembler input file in the current directory and
- an object file in <tt>/tmp/filename.o</tt> - you need to tell your debugger to
- add this object file as symbol file.
-
- If you're using the GNU debugger, this is done like this:
-
- <pre>
- call mono_debug_make_symbols ()
- add-symbol-file /tmp/corlib.o
- add-symbol-file /tmp/mcs.o
- add-symbol-file /tmp/Mono.CSharp.Debugger.o
- </pre>
-
- You can also write a GDB macro like this:
-
- <pre>
- define reload
- call mono_debug_make_symbols ()
- add-symbol-file /tmp/corlib.o
- add-symbol-file /tmp/mcs.o
- add-symbol-file /tmp/Mono.CSharp.Debugger.o
- end
- </pre>
-
- Then you can just say <tt>reload</tt> to have GDB recreate the symbol file.
-
- There's also an <a href="jit-debug-sample.html">example debugging session</a> using
- the GNU debugger.
-
-** Using a symbol file which have been created by the Mono C# compiler
-
- If you compiled your application with Mono's C# compiler (MCS), you can tell it to
- create a symbol file which is then processed and rewritten by the JIT engine.
-
- To do this, you must give MCS the <tt>-g</tt> option:
-
- <pre>
- $ mcs -g Foo.cs
- </pre>
-
- This creates a <tt>Foo-debug.s</tt> assembler input file.
-
- To use this in the JIT, you must first copy it to the target machine (the machine
- where you want to run the JIT to debug your application) and run it through the
- assembler to produce an object file <tt>Foo-debug.o</tt>. This object file must be
- in the current directory.
-
- Then start the JIT in your debugger and give it the <tt>--dwarf-plus</tt> command
- line argument.
-
- Each time you call <tt>mono_debug_make_symbols ()</tt> from withing your debugger,
- the JIT will read this <tt>Foo-debug.o</tt>, fix some machine dependent things like
- memory addresses etc. in it and write it back to disk.
-
- If you're using the GNU debugger, you'll want to use a macro like this:
-
- <pre>
- define relocate
- call mono_debug_make_symbols ()
- add-symbol-file /tmp/corlib.o
- add-symbol-file mcs-debug.o
- add-symbol-file Mono.CSharp.Debugger-debug.o
- end
- </pre>
-
- If there is no <tt>assembly-debug.o</tt> file, but an <tt>assembly.il</tt> one, the
- JIT will fall back to normal DWARF 2 (in the example above, <tt>corlib.dll</tt> was
- compiled with Microsoft's compiler and the JIT is thus using DWARF to debug it).
-
- This debugging method only works if you compiled your assembly with MCS, but it'll
- allow you to actually debug your C# source code :-)
-
- Here's an <a href="jit-debug-sample2.html">example debugging session</a> using
- the GNU debugger.
-
-** Breakpoints and single stepping
-
- The JIT has a <tt>--debug</tt> command line argument to insert a breakpoint at the
- beginning of this method. It takes a <tt>Namespace.Class:Method</tt> argument which
- is the method. This argument can be given multiple times.
-
- However, once your application is stopped in GDB you may want to insert a breakpoint
- the next time the JIT compiles a method. There's a global variable
- <tt>mono_debug_insert_breakpoint</tt> which you can modify in your debugger.
-
- If this variable is set to a non-zero value, the JIT's <tt>arch_compile_method</tt>
- will insert a breakpoint the next time it is called, ie. at the top of the next
- method it compiles. If this value has a positive value, it acts as a counter and is
- decremented after inserting the breakpoint - setting it to a negative value will let
- the JIT insert the breakpoint each time it compiles a new method.
-
- There's also global variable <tt>mono_debug_last_breakpoint_address</tt> which always
- contains the address of the last inserted breakpoint. You may manually override this
- address with a <tt>nop</tt> instruction to delete the breakpoint.
-
- For instance, I have a GDB macro called <tt>enter</tt> which I use to enter a method
- rather than stepping over it:
-
- <pre>
- define enter
- set mono_debug_insert_breakpoint = 1
- continue
- set *mono_debug_last_breakpoint_address = 0x90
- relocate
- frame
- </pre>
-
- Btw. speaking of single stepping - you should use your debuggers <tt>next</tt> command,
- not its <tt>step</tt> command for single stepping unless you compiled the JIT without
- debugging support. The reason for this is that the JIT creates machine code which contains
- calls to JIT methods such as <tt>mono_object_new_wrapper</tt> at places where you don't
- expect them - so unless the JIT is compiled at least without line numbers, your debugger
- will enter such methods if you use <tt>step</tt> rather than <tt>next</tt>.
+
+
+
diff --git a/web/jit-debug-sample b/web/jit-debug-sample
deleted file mode 100644
index a0c5d2d8b48..00000000000
--- a/web/jit-debug-sample
+++ /dev/null
@@ -1,86 +0,0 @@
-* A debugging session using a dynamically generated symbol file.
-
- Let's assume we have the following C# application which we want to debug:
-
- <pre>
- using System;
-
- public class Foo
- {
- public struct MyStruct {
- int a;
- long b;
- double c;
- }
-
- public static void Main ()
- {
- Int32 value = 5;
- long test = 512;
-
- MyStruct my_struct;
- my_struct.a = 5;
- my_struct.b = test;
- my_struct.c = 23323.5235;
- }
- }
- </pre>
-
- First of all, we need to compile it and create the .il files:
-
- <pre>
- $ mcs ./Foo.cs
- $ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
- $ monodis Foo.exe > Foo.il
- </pre>
-
- Now we can start the JIT in the debugger:
-
- <pre>
- $ gdb ~/monocvs/mono/mono/jit/mono
- (gdb) r --dwarf --debug Foo:Main ./Foo.exe
- Starting program: /home/martin/monocvs/mono/mono/jit/mono --dwarf --debug Foo:Main ./Foo.exe
- 0x081e8911 in ?? ()
- (gdb) call mono_debug_make_symbols ()
- (gdb) add-symbol-file /tmp/Foo.o
- Reading symbols from /tmp/Foo.o...done.
- Current language: auto; currently c++
- (gdb) frame
- #0 Foo.Main () at Foo.il:26
- 26 // method line 2
- (gdb) n
- Foo.Main () at Foo.il:38
- 38 IL_0000: ldc.i4.5
- (gdb) list
- 33 .maxstack 2
- 34 .locals (
- 35 int32 V_0,
- 36 int64 V_1,
- 37 valuetype MyStruct V_2)
- 38 IL_0000: ldc.i4.5
- 39 IL_0001: stloc.0
- 40 IL_0002: ldc.i4 512
- 41 IL_0007: conv.i8
- 42 IL_0008: stloc.1
- 43 IL_0009: ldloca.s 2
- 44 IL_000b: ldc.i4.5
- 45 IL_000c: stfld int32 .MyStruct::a
- 46 IL_0011: ldloca.s 2
- 47 IL_0013: ldloc.1
- 48 IL_0014: stfld int64 .MyStruct::b
- 49 IL_0019: ldloca.s 2
- 50 IL_001b: ldc.r8 23323.5
- 51 IL_0024: stfld float64 .MyStruct::c
- 52 IL_0029: ret
- (gdb) until 52
- Foo.Main () at Foo.il:53
- 53 }
- (gdb) info locals
- V_0 = 5
- V_1 = 512
- V_2 = {a = 5, b = 512, c = 23323.523499999999}
- </pre>
-
- As you see in this example, you need to know IL code to use this debugging method - but
- it may be the only way to debug a library.
-
diff --git a/web/jit-debug-sample2 b/web/jit-debug-sample2
deleted file mode 100644
index ae75ceed591..00000000000
--- a/web/jit-debug-sample2
+++ /dev/null
@@ -1,70 +0,0 @@
-* A debugging session using a symbol file which has been created by MCS.
-
- Let's assume we have the following C# application which we want to debug:
-
- <pre>
- using System;
-
- public class Foo
- {
- public struct MyStruct {
- int a;
- long b;
- double c;
- }
-
- public static void Main ()
- {
- Int32 value = 5;
- long test = 512;
-
- MyStruct my_struct;
- my_struct.a = 5;
- my_struct.b = test;
- my_struct.c = 23323.5235;
- }
- }
- </pre>
-
- First of all, we need to compile it with MCS, assemble the generated .s file and
- create the .il files for all referenced assemblies which were not compiled with MCS:
-
- <pre>
- $ mcs -g ./Foo.cs
- $ as -o Foo-debug.o Foo-debug.s
- $ monodis /home/export/martin/MONO-LINUX/lib/corlib.dll > corlib.il
- </pre>
-
- Now we can start the JIT in the debugger:
-
- <pre>
- $ gdb ~/monocvs/mono/mono/jit/mono
- (gdb) r --dwarf-plus --debug Foo:Main ./Foo.exe
- Starting program: /home/martin/monocvs/mono/mono/jit/mono --dwarf-plus --debug Foo:Main ./Foo.exe
- Program received signal SIGTRAP, Trace/breakpoint trap.
- 0x081e8681 in ?? ()
- (gdb) call mono_debug_make_symbols ()
- (gdb) add-symbol-file Foo-debug.o
- (gdb) add-symbol-file /tmp/corlib.o
-` (gdb) frame
- #0 Main () at ./Foo.cs:11
- 11 public static void Main ()
- (gdb) n
- Main () at ./Foo.cs:13
- 13 Int32 value = 5;
- (gdb)
- 14 long test = 512;
- (gdb)
- 17 my_struct.a = 5;
- (gdb)
- 18 my_struct.b = test;
- (gdb)
- 19 my_struct.c = 23323.5235;
- (gdb)
- 20 }
- (gdb) info locals
- value = 5
- test = 512
- my_struct = { a = 5, b = 512, c = 23323.5235 }
- </pre>
-
diff --git a/web/languages b/web/languages
index 5325bdbdc57..1d76ada4cdc 100755
--- a/web/languages
+++ b/web/languages
@@ -8,22 +8,54 @@
* <a href="#MonoLogo">MonoLogo</a>
* <a href="#Oberon">Oberon</a>
* <a href="#Forth">Forth</a>
+ * <a href="#mbas">Mono Basic</a> (Mono's VB.NET compiler)
+ * <a href="#dotlist">dotLisp</a>
+ * <a href="#nemerle">Nemerle</a>
+ * <a href="#python">Python</a>
+ </ul>
+
+ Languages which are known to run, but we have not done a
+ complete ran of all their regression tests to validate it:
+
+ <ul>
+ * Kylix.NET.
</ul>
Languages we would like to have supported, with links to resources:
<ul>
* <a href="#JavaScript">Java Script</a>
- * <a href="java.html">Java</a>
+ * <a href="#java.html">Java</a>
* <a href="#c">C</a>
</ul>
- Some experimental languages:
+ Some experimental bindings:
<ul>
* <a href="#Tachy">Tachy</a> (scheme-like)
</ul>
+<a name="Java"></a>
+** Java
+
+ Java is supported through the <a href="http://www.ikvm.net">IKVM</a> virtual machine.
+
+ Zoltan worked with Jeroen to get IKVM to work with Mono.
+
+<a name="nemerle">
+* Nemerle
+
+ Nemerle is a new hybrid (functional, object-oriented and
+ imperative) programming language for the .NET platform. It is
+ available from <a
+ href="http://www.nemerle.org/">http://www.nemerle.org</a>.
+
+<a name="PHP">
+** PHP
+
+ Sterling has code to allow PHP developers to use Mono code, in
+ his <a href="http://www.php.net/~sterling/mono/">site</a>
+
<a name="MonoLogo">
** MonoLogo
@@ -33,29 +65,41 @@
hosted in the <a href="ccvs.html">Mono CVS</a> repository
and also available on the <a href="anoncvs.html">AnonCVS</a> mirrors.
+<a name="mbas">
+** Mono Basic (Mono's VB.NET compiler)
+
+ Work has resumed on the Mono Visual Basic compiler (currently
+ called mbas). It is part of the standard Mono distribution,
+ but its still an early compiler.
+
<a name="Oberon">
** Oberon
This Oberon compiler is written in Oberon.NET (another self
- hosting compiler):
+ hosting compiler).
- <a href="http://www.superin.formativ.net/mono/oberon/oberon.zip">http://www.superin.formativ.net/mono/oberon/oberon.zip</a>
+ The main site <a href="http://www.oberon.ethz.ch/oberon.net/">http://www.oberon.ethz.ch/oberon.net/</a>
+
+ Download:
+ <a href="http://www.oberon.ethz.ch/oberon.net/download/">http://www.oberon.ethz.ch/oberon.net/download/</a>
+
+ Examples:
+ <a href="http://www.oberon.ethz.ch/oberon.net/examples/">http://www.oberon.ethz.ch/oberon.net/examples/</a>
<a name="ComponentPascal">
** Component Pascal
The Component Pascal compiler: <a
- href="http://www2.fit.qut.edu.au/CompSci/PLAS/ComponentPascal">Home
+ href="http://www.citi.qut.edu.au/research/plas/projects/cp_files/cpnet.html">Home
Page</a>, you can <a
- href="http://www2.fit.qut.edu.au/CompSci/PLAS/ComponentPascal/gpcp1.1.4-netRTM.zip">
+ href="http://www.citi.qut.edu.au/research/plas/projects/cp_files/cpdownload.html">
download it</a>
<a name="Forth">
** Delta Forth
- The Delta Forth.NET project: <a
- href="http://www.codeproject.com/dotnet/dforthnet.asp">Home
- Page</a> and <a href="http://www.dataman.ro/dforth/index.html">more
+ The Delta Forth.NET project: <a href="http://www.dataman.ro/dforth">Home
+ Page</a> and <a href="http://www.dataman.ro/dforth">more
details here</a>.
@@ -65,26 +109,33 @@
A subset of Scheme language called <a
href="http://radio.weblogs.com/0101156/stories/2002/03/19/tachy.html">Tachy</a>
-* Missing languages
+<a name="Python"></a>
+** Python
- Here is a list of a few languages that we would like to see
- supported. We will try to maintain a set of links here with
- technical information for those interested in porting,
- implementing or adapting a compiler for any of these
- languages:
+ <a href="mailto:brian@No.Spam.zope.com">Brian Lloyd</a> is
+ working on linking the Python runtime with the .NET runtime.
+ More information on the PS.NET project can be found <a
+ href="http://www.zope.org/Members/Brian/PythonNet">here</a>.
+
+<a name="dotlisp"></a>
+** dotLisp
+
+ DotLisp is available from: <a
+ href="http://sourceforge.net/projects/dotlisp/">http://sourceforge.net/projects/dotlisp/</a>
<a name="JavaScript">
* Java Script
- The Mozilla project has an implementation of JavaScript
- written in Java called <a
- href="http://www.mozilla.org/rhino/">Rhino</a>.
+ Cesar is working on Mono's implementation of JScript, the code
+ is available on CVS on module `mcs'.
- You could port this code from Java to C#.
+* Missing languages
- Note that since JavaScript allows for evaluation at runtime,
- the compiler has to be built as a class that can be invoked at
- runtime.
+ Here is a list of a few languages that we would like to see
+ supported. We will try to maintain a set of links here with
+ technical information for those interested in porting,
+ implementing or adapting a compiler for any of these
+ languages:
<a name="c">
* C
@@ -92,17 +143,20 @@
Ideally GCC could be modified to generate CIL, but it is a
big task. That would give us various compilers in one pass.
- Rumor is that the next version of the LCC compiler will
- include an IL backend. We do not know how extensive the support
- for integration with .NET will be, but it would be an interesting
- excercise to add an extension to C to call into .NET code.
+ <a href="http://www.cs.princeton.edu/software/lcc">LCC</a> 4.2
+ has been recently released. This release adds support for compiling
+ ANSI C programs to CIL. Note that the CIL support only works on Win32
+ right now, but should be easy to convert to Mono/other architectures.
LCC is not an open source compiler, but it is free as long as you
do not profit from selling it.
-<a name="Java">
-* Java
+<a name="ada"></a>
+* ADA
+
+ A# is an ADA compiler for the CIL platform, it can be downloaded from:
+ <a
+ href="http://www.usafa.af.mil/dfcs/bios/mcc_html/a_sharp.html">http://www.usafa.af.mil/dfcs/bios/mcc_html/a_sharp.html</a>
- We have a <a href="java.html">separate page</a> for Java.
diff --git a/web/mailing-lists b/web/mailing-lists
index 6e7d1e6598b..ad2aa170ae4 100644
--- a/web/mailing-lists
+++ b/web/mailing-lists
@@ -1,8 +1,21 @@
* Mailing Lists
- There are a number of mailing lists for Mono
+ Most of the mailing lists are in english, but there is also
+ Mono Hispano that has lists in Spanish. <a
+ href="http://www.monohispano.org/mailman/listinfo/mono-hispano">Mono Hispano list</a>
- <table>
+ There are a number of mailing lists for Mono in English:
+
+ <table border=1>
+ <tr>
+ <td>
+ <b><a
+ href="http://lists.ximian.com/mailman/listinfo/mono-announce-list">mono-announce-list</a></b>
+ </td>
+ <td>
+ Announcements of Mono developments.
+ </td>
+ </tr>
<tr>
<td>
<b><a
@@ -15,11 +28,39 @@
<tr>
<td>
<b><a
- href="http://lists.ximian.com/mailman/listinfo/mono-announce-list">mono-announce-list</a></b>
+ href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">mono-devel-list</a></b>
+ </td>
+ <td>
+ A mailing list specifically dedicated to discussions
+ about developing Mono and programming *with* Mono.
+ Programmers that work on Mono are _strongly_ encouraged
+ to join this list. Third-party programmers interested
+ in running or compiling their managed applications with
+ Mono or that are interested in using mono-specific
+ technologies should join the list as well.
+ <p>
+ Examples of on-topic arguments are:
+ <ul>
+ <li>proposals and patches for new features for the mono runtime and programs
+ <li>discussions about bugs in the mono runtime and programs
+ <li>discussions about future directions
+ <li>embedding API, scripting language bridges
+ <li>mono/mcs build issues
+ <li>programming with mono-specific assemblies
+ <li>discussions about third-party compilers that target and/or use directly the CLR
+ <li>discussions about getting a managed application run with mono
+ </ul>
+
+ <p>Topics that are better discussed on other mailing lists:
+ <ul>
+ <li> general C# questions (use the specific lists at develop.com)
+ <li> issues that are already covered by a more specific mono
+ mailing list (like System.Windows.Forms or Gtk#)
+ <li> success reports about new apps running on mono, including
+ runtime/buildtime support for new programming languages (use
+ mono-list to reach a wider audience)
+ </ul>
</td>
- <td>
- Announcements of Mono developments.
- </td>
</tr>
<tr>
<td>
@@ -36,7 +77,7 @@
href="http://lists.ximian.com/mailman/listinfo/mono-patches">mono-patches</a></b>
</td>
<td>
- Track the CVS activity of Mono on this mailing list (patches are sent to recipients).
+ Track the CVS activity of Mono on this mailing list (patches are sent to recipients). <p>
You can get <a href="http://www.go-mono.com/snapshots">daily snapshots</a> as well.
</td>
</tr>
@@ -67,6 +108,33 @@
in <a href="http://bugzilla.ximian.com">Bugzilla.ximian.com</a>
</td>
</tr>
+ <tr>
+ <td>
+ <b><a
+ href="http://lists.ximian.com/mailman/listinfo/mono-winforms-list">mono-winforms-list</a></b>
+ </td>
+ <td>
+ Used to discuss the Windows.Forms implementatation for Mono using Wine.
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><a
+ href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">gtk-sharp-list</a></b>
+ </td>
+ <td>
+ Used to discuss the Gtk bindings for Mono (<a href="http://gtk-sharp.sf.net">Gtk#</a>).
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><a
+ href="http://lists.ximian.com/mailman/listinfo/mono-vb">mono-vb</a></b>
+ </td>
+ <td>
+ Mono's implementation of Visual Basic.NET.
+ </td>
+ </tr>
</table>
Other mailing lists of interest:
@@ -79,6 +147,11 @@
</ul>
</ul>
+* Alternative archive site
+
+ An alternate site that archives Mono List is available <a
+ href="http://archive.neotonic.com/archive/mono-list">http://archive.neotonic.com/archive/mono-list</a>
+
* Google search of the archives
<!-- Google Search with mods -->
@@ -86,7 +159,7 @@
<table>
<tr>
-<td><a href="http://www.google.com/search"><img src="mailing-lists_files/Logo_40wht.gif" border="0" alt="Google" align="middle"></a></td>
+<td><a href="http://www.google.com/search"><img src="images/Logo_40wht.gif" border="0" alt="Google" align="middle"></a></td>
<td>
<table>
diff --git a/web/mbas b/web/mbas
new file mode 100644
index 00000000000..25dd5f4a2df
--- /dev/null
+++ b/web/mbas
@@ -0,0 +1,57 @@
+* mbas: Mono's VisualBasic.NET Compiler.
+
+ MonoBASIC (mbas) is a CIL compiler for the VisualBasic.NET language,
+ an extended version of Visual Basic. It's based on the MCS compiler
+ and still in heavy development, though many language features are
+ already supported. See mcs/mbas/
+
+** What works
+
+ <ul>
+
+ * Classes, Fields and Methods. Properties are still
+ being worked on.
+
+ * Module definition and Sub/Function functionality
+
+ * Namespace Import, so can you reference, instantiate
+ and call external assemblies
+
+ * Parameter passing between Sub's. ByVal and ByRef
+ parameters are being worked on.
+
+ * Delegates
+
+ * Object creation
+
+ * Events - to a limited extent. You can declare a
+ Class-Field as 'WithEvents' and dynamic events (i.e
+ AddHandler MyButton.Click, Button1_OnClick). Please
+ beware: just after committing the code, I discovered
+ that the handler field in the AddHandler call is
+ case-sensitive, a remnant of mBas' mcs heritage)
+
+ * Statements supported are 'If..Then..Else' ,
+ 'While..End While' and assignment statements. Simple
+ operators (+, -, *, /, >, <, =) should also
+ work. Other statements (For..Next, etc.) should be
+ quite trivial to implement.
+ </ul>
+
+ A lot of this stuff is implemented rebuilding proper expressions and
+ statements on top of the classes based on those of mcs (look at the grammar -
+ mb-parser.jay - and compare it with cs-parser.jay, if interested), but some
+ are getting deeply changed, to better conform to VB.NET semantics.
+
+** TODO-list
+
+ At this stage almost every element of the language must be still checked for
+ conformance to MS' implementation.
+ We'd like to implement the missing statements, exception handling,
+ structures and actual event support (not necessarily in this order). Once we
+ have all this stuff set up and reasonably bug-free, more work could be done
+ on helper functions and Object-vars handling.
+
+ Also work on the supporting library (we don't currently depend on it as much
+ as MS vbc-compiled programs, but especially for late-binding scenarios we will)
+ is surely needed: it's in mcs/class/Microsoft.VisualBasic/
diff --git a/web/mono-1.0.html b/web/mono-1.0.html
new file mode 100644
index 00000000000..40730ced1a1
--- /dev/null
+++ b/web/mono-1.0.html
@@ -0,0 +1,103 @@
+<html>
+<head>
+<title>Mono 1.0 assemblies</title>
+</head>
+
+<body>
+<h1>Assemblies</h1>
+
+ <b>Notice that these are *assemblies*, they are not
+ namespaces. </b>
+
+ <b>Each assembly normally contains code that spans multiple
+ namespaces (mscorlib contains 37 namespaces), but there are a
+ lot of people who seem confused about this.
+
+<pre>
+Stable:
+ Commons.RelaxNG
+ cscompmgd
+ Mono.Data
+ Mono.Data.Tds
+ Mono.Posix
+ Mono.Security
+ Mono.Security.Win32
+ System.Web
+ System.Configuration.Install
+ System.Data
+ System.Data.OracleClient
+ System.DirectoryServices
+ System
+ System.Drawing
+ System.Runtime.Remoting
+ System.Security
+ System.Web.Services
+ System.XML
+
+Unstable:
+ Accessibility
+ Mono.Cairo
+ Mono.CSharp.Debugger
+ Mono.Data.DB2Client
+ Mono.Data.SqlLite
+ Mono.Data.SybaseClient
+ Mono.GetOptions
+ System.Web.Mobile
+ System.Design
+ System.Drawing.Design
+ System.Windows.Forms
+ Formatters.Soap
+ Mono.Data.TdsClient (older Sybase and MS SQL)
+
+Missing:
+ System.EnterpriseServices
+ System.Management
+ System.Messaging
+ System.ServiceProcess
+ System.Web.RegularExpressions
+
+Third party assemblies.
+ ByteFX.Data
+ Npgsql
+ PEAPI
+ SharpZipLib.
+
+ Java integration with IKVM.NET
+
+</pre>
+
+<h1>Languages</h1>
+
+<pre>
+Stable:
+ C#
+
+Unstable:
+ VB.NET
+
+Not ready:
+ JScript
+</pre>
+
+<h1>Virtual Machine</h1>
+
+<pre>
+JIT, 32 bits:
+ PPC
+ x86
+ SPARC
+
+JIT, 32 bits, unstable:
+ S390
+
+Interpreter, 32 bits:
+ s390
+ HPPA
+ StrongARM
+ SPARC v8
+
+Interpreter, 64 bits:
+ ia64
+ SPARC v9
+</body>
+</html>
diff --git a/web/mono-beginning b/web/mono-beginning
new file mode 100644
index 00000000000..4b193712113
--- /dev/null
+++ b/web/mono-beginning
@@ -0,0 +1,36 @@
+* Mono for beginners
+
+ <b>WARNING: This page is outdated</b>
+
+ Hinne Hettema and Jaime Anguiano Olarra are providing us with
+ nice and complete set of documents (HOWTOs) about how to install,
+ configure, run and test the software developed by the Mono Project.
+
+ You can read them online, get PDF versions or get the XML sources.
+
+
+ HTML Format (read it online)
+
+ For <a href="mono-beginning/t1.html">RPM Linux based systems</a>
+
+ For <a href="http://monoevo.sourceforge.net/mono-windows/mono-beginning-windows/t1.html">Microsoft Windows</a>
+
+
+ PDF Format
+
+ For <a href="mono-beginning.pdf">RPM Linux based systems</a>
+
+
+ XML Source
+
+ For <a href="mono-beginning.xml">RPM Linux based systems</a>
+
+ For <a href="http://monoevo.sourceforge.net/mono-windows/mono-beginning-windows.xml">Microsoft Windows</a>
+
+
+ Currently Hinne is working on a Mono Tools HOWTO. Which will be
+ very useful for the hackers that would like to get in touch with
+ Mono and Jaime is working out a Mono Beginning HOWTO for Debian
+ users.
+
+
diff --git a/web/mono-beginning-windows.xml b/web/mono-beginning-windows.xml
new file mode 100644
index 00000000000..a6f34da77f0
--- /dev/null
+++ b/web/mono-beginning-windows.xml
@@ -0,0 +1,1065 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" []>
+<article>
+
+ <articleinfo>
+
+ <!-- Use "HOWTO", "mini HOWTO", "FAQ" in title, if appropriate -->
+ <title>Mono Beginners HOWTO for Windows users</title>
+
+ <author>
+ <firstname>Jaime</firstname>
+ <surname>Anguiano Olarra</surname>
+ <affiliation>
+ <address><email>jaime@geneura.ugr.es</email></address>
+ </affiliation>
+ </author>
+
+ <author>
+ <firstname>Hinne</firstname>
+ <surname>Hettema</surname>
+ <affiliation>
+ <address><email>h.hettema@auckland.ac.nz</email></address>
+ </affiliation>
+ </author>
+
+ <pubdate>2002-08</pubdate>
+
+ <!-- Most recent revision goes at the top; list in descending order -->
+ <!-- All dates specified in ISO "YYYY-MM-DD" format -->
+ <revhistory>
+ <revision>
+ <revnumber>0.1</revnumber>
+ <date>2002-08-05</date>
+ <authorinitials>JA</authorinitials>
+ <revremark>First release</revremark>
+ </revision>
+ </revhistory>
+
+ <!-- Provide a good abstract; a couple of sentences is sufficient -->
+ <abstract>
+ <para>
+ The goal of this document is to guide people through the setup of a Mono
+ framework in a Windows box. Because some people might want to just test
+ Mono a bit and use the compiler, etc, I have made two distinctions, one
+ for the Mono user that only wants to get precompiled binaries and another
+ for the one how wants to build Mono from the CVS and probably contribute
+ to the project actively. Each kind of user has to read the corresponding
+ part of this document. I hope a lot of Windows users will get a nice
+ approach to the free software world by starting using Mono.
+ </para>
+ </abstract>
+
+ </articleinfo>
+
+<sect1 id="intro">
+<title>Introduction</title>
+
+<para>
+Mono is an open source implementation of the Common Language Infrastructure
+(CLI) specified in ECMA standard 335. It comes with a C# compiler and
+provides an extensible platform to develop and run applications that
+are interoperable with Microsoft .NET.
+</para>
+
+<para>
+Mono is not finished--it is a project still under development. As a
+result, installation and configuration may not be as smooth as you
+will be used to from other Linux or Windows applications. Nevertheless,
+mono is in a state that will allow you to get it up and running and gain
+experience with it--which is, I would suggest, a very smart thing to do.
+</para>
+
+<para>
+This document is aimed at the mono beginner, and aims to present a complete
+view of a minimal installation, which will allow you to experiment with
+mono to some degree. It also describes some of those experiments. We
+expect that after reading this document you'll go on to do either of
+two things:
+</para>
+<orderedlist>
+<listitem>
+<para>
+Continue to contribute to the mono project in some shape or form. The
+website has some ideas and suggestions under the heading 'Contributing'.
+</para>
+</listitem>
+<listitem>
+<para>
+Continue to write applications that run in mono.
+</para>
+</listitem>
+</orderedlist>
+
+<para>
+We hope this document will be useful to you in your first steps with mono.
+Happy hacking!
+</para>
+
+<sect2 id="disclaimer"> <title>Disclaimer</title>
+
+<para>
+No liability for the contents of this document can be accepted.
+Use the concepts, examples and information at your own risk. There may
+be errors and inaccuracies, that could be damaging to your system.
+Proceed with caution, and although this is highly unlikely, the author(s)
+do not take any responsibility.
+</para>
+
+<para>
+All copyrights are held by their by their respective owners,
+unless specifically noted otherwise. Use of a term in this document
+should not be regarded as affecting the validity of any trademark or
+service mark. Naming of particular products or brands should not be
+seen as endorsements.
+</para>
+</sect2>
+
+<!-- Give credit where credit is due...very important -->
+<sect2 id="credits"> <title>Credits / Contributors</title>
+
+<para> Credits are due to </para>
+<itemizedlist>
+<listitem>
+<para>Hinne Hettema <email>h.hettema@auckland.ac.nz</email>
+for creating the xml template I used for this document, for
+reviewing and make an excellent job with the other HOWTO and
+for his feedback. As you can see a lot of his work has been
+included in this document too.
+</para>
+</listitem>
+<listitem>
+<para>
+The Mono Hackers.
+</para>
+</listitem>
+</itemizedlist>
+</sect2>
+
+<!-- Feedback -->
+<sect2 id="feedback"> <title>Feedback</title>
+
+<para>
+Feedback is most certainly welcome for this document. Send your
+additions, comments and criticisms to the following email address:
+<email>mono-docs-list@ximian.com</email>. I am lurking on this list
+and will maintain this document as required.
+</para>
+</sect2>
+</sect1>
+
+<!-- This is the preamble stuff over with the rest of document follows... -->
+<sect1 id="installation">
+<title> Installing Mono</title>
+
+<sect2 id="obtaining">
+<title>Obtaining Mono</title>
+<para>
+In order to obtain the required software you just need to visit the
+Mono download page at http://www.go-mono.org/download or any of the
+related sites.
+</para>
+
+<para>
+You'll be able to complete everything in this document if you just install
+the runtime, but taking a look at the compiler package is well worth the
+effort. The compiler is written in C# and is 'self hosting' which means it
+is able to compile itself.
+</para>
+
+<para>
+This page also lists the current versions of the software
+mono depends on. Make sure that your system has all the
+required versions, otherwise mono won't compile.
+</para>
+
+</sect2>
+
+<sect2 id="easyinstall">
+<title>Installing Mono on Windows, the easy way</title>
+<para>
+ Oh. This is a very easy task now. If you just want to take a look at
+ the possibilities of Mono get the Mono installer from the site of
+ Johannes Roith &lt;johannes\@jroith.de&gt;:
+</para>
+
+<para>
+ http://www.superin.informativ.net/mono/mono.htm. You can get a link in
+</para>
+<para>
+ the download section of the Mono site too: http://www.go-mono.org/download
+</para>
+<para>
+ Then you just need a Windows machine. Better use
+ Windows 2000 Professional. </para>
+<para>
+ Once you've got it, run the installer.
+</para>
+<para>
+ Remember, building your own Mono runtime and compiler from the sources
+ is strongly recommended. You won't discover the power of Mono until
+ you get it made this way. If you feel hungry about real programming with
+ Mono, proceed like in the next section.
+</para>
+</sect2>
+
+<sect2 id="hardinstall">
+<title>Building Mono under Windows</title>
+<itemizedlist>
+ <listitem>
+ <para>
+ 1.- Get Windows 2000 Professional or any Windows System supporting .NET SDK.
+ Avoid using XP and the redistributable version of the SDK (necessary for
+ WinME, etc).
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ 2.- Get the latest Cygwin distribution, be sure you install the GNU Build Tools
+ packages. Take the openssh package if you plan to contribute to the project.
+ If you feel insecure about the packages you need to install, install all of
+ them, of course, Text, Admin, Games and Web are not necessary at all and you
+ can pass of those. The fitness of your choice will depend of your knowledge
+ on Linux and/or Cygwin. If in doubt install all.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ 3.- Install the .NET SDK.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 4.- Install Cygwin.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 5.- Get http://www.go-mono.org/mono-build-w32.sh and put it into your home
+ directory in the cygwin setup.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ 6.- Enter your cygwin environment. If you have an account in the mono cvs, then
+ export the variables as shown in http://www.go-mono.org/ccvs.html
+ </para>
+
+ <programlisting>
+ This means. Enter: export CVSROOT=user@mono-cvs.ximian.com:/cvs/public
+
+ and export CVS_RSH=ssh
+ </programlisting>
+ <para>
+ If you have no account DO NOTHING.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 7.- Enter:
+ <programlisting>
+ export ACLOCAL_FLAGS="-I /usr/local/share/aclocal"
+ and this: export PKG_CONFIG_PATH="/usr/local/bin"
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 8.- Run the script (mono-build-w32.sh)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 9.- All should work fine know and you should see it download what necessary and
+ build mono.
+ </para>
+</listitem>
+</itemizedlist>
+</sect2>
+
+<sect2 id="errors">
+<title>Troubleshooting</title>
+<para>
+ If you have noticed problems during step 8 and the execution stops because of
+ errors as I cannot find that or such library or alike, try to:
+</para>
+
+<itemizedlist>
+<listitem>
+ <para>
+ 1.- Create a directory mono-temp for example.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ 2.- Move and unzip all the zips the mono-build script downloads to /usr/local
+ to that new directory. Do it one by one, copying the content of the created
+ subdirectories (include, bin, etc) to their respectives in /usr/local. Take
+ care, some libraries like libglib... must go into /usr/local/bin and not
+ into /usr/local/lib.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ 3.- Jump into the /usr/local/mono directory and run ./autogen.sh
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ 4.- Then run ./configure and after it: make and finally: make install.
+ </para>
+ </listitem>
+</itemizedlist>
+</sect2>
+</sect1>
+
+<sect1 id="running">
+<title>Running mono</title>
+<sect2 id="basic">
+<title>Basic steps</title>
+<para>
+To work with mono, you first have to create a C# program. Open up
+your favourite editor, and type in the following code:
+</para>
+<programlisting>
+using System;
+
+class Hello
+{
+public static void Main(String[] args)
+ {
+ Console.WriteLine("mono:: is alive and well...");
+
+ for (int i = 0; i < args.Length; i++)
+ Console.WriteLine("Argument {0} = {1}", i, args[i]);
+ }
+}
+</programlisting>
+
+<para>
+Save the file as hello.cs. To compile this into a working program,
+type mcs hello.cs. If you get the following:
+</para>
+<programlisting>
+ mcs hello.cs
+RESULT: 0
+</programlisting>
+<para>
+you know the compile worked fine. If you see some strange error
+messages including the word 'parser' somewhere, you made a mistake in
+your program. Fix this up first.
+</para>
+
+<para>
+You are now ready to execute your first mono program. To execute
+the code, type
+</para>
+
+<programlisting>
+ mono hello.exe arg1 arg2 arg 3
+</programlisting>
+<para>
+(where we have given some arguments just for fun) and you'll
+see the following:
+</para>
+
+<programlisting>
+mono:: is alive and well...
+Argument 0 = arg1
+Argument 1 = arg2
+Argument 2 = arg
+Argument 3 = 3
+RESULT: 0
+</programlisting>
+<para>
+As you can see, mono printed the line "mono:: is alive and well"
+and printed the list of arguments. This completes the creation
+and execution of your first mono program.
+</para>
+</sect2>
+
+<sect2 id="interpreter">
+<title>Interpreter</title>
+<para>
+But mono will allow you to do more. First of all, mono is the
+compiled mono execution environment which uses the Just in
+Time (JIT) compiler. Mono also comes with an interpreted
+environment, which can be accessed using the command 'mint'
+as follows
+</para>
+<programlisting>
+ mint hello.exe arg1 arg 2
+mono:: is alive and well...
+Argument 0 = arg1
+Argument 1 = arg
+Argument 2 = 2
+</programlisting>
+<para>
+As you can see, it makes no difference to mono output which
+environment you use, but what happens under the hood is very
+different. If you use 'mono' as the command line tool, you
+call the 'production' execution environment which will read
+your portable executable (PE) file, and call the just in
+time (JIT) compiler to compile the PE code down to machine
+level code (in my case, an x86 architecture) after which
+it is executed.
+</para>
+<para>
+If you use mint, the JIT is not used, and the PE code is
+interpreted into x86 instructions for execution. In fact,
+for our simple 'hello' mint is slightly faster. The point
+is that the JIT compiler will take some time to compile the
+code of our program and store it in some location in memory,
+but the subsequent execution of the code is faster with mono.
+</para>
+
+<para>
+After this simple run of mono, it is time to play with some options.
+I won't cover these in detail since there are quite a few, and also because
+I assume you downloaded mono to hack it around in the first place. So
+I'll leave some pointers.
+</para>
+
+
+<sect3 id="debugging">
+<title>Debugging</title>
+<para>
+Mono supports a debugging option when you specify the "-d" flag while running
+the runtime. Utilising this flag will get you a significant amount of output,
+and it may be an idea to specify an output file as well. The interesting aspect
+of this file is that it allows you to see to some extent (quite precisely,
+actually) what the JIT compiler is up to.
+</para>
+</sect3>
+
+<sect3 id="statistics">
+<title>Statistics</title>
+<para>
+It is also possible to collect some runtime statistics on your program. These
+will give you some idea of the resource utilisation of your program.
+</para>
+<programlisting>
+ mono --stats hello.exe
+mono:: is alive and well...
+RESULT: 0
+Mono Jit statistics
+Compiled methods: 58
+Methods cache lookup: 15
+Method trampolines: 698
+Basic blocks: 188
+Max basic blocks: 15
+Allocated vars: 238
+Analyze stack repeat: 61
+Compiled CIL code size: 2450
+Native code size: 10167
+Max code size ratio: 7.13 (FileStream::FlushBuffer)
+Biggest method: 1016 (StreamWriter::Write)
+Code reallocs: 27
+Allocated code size: 22073
+Inlineable methods: 17
+Inlined methods: 22
+
+Created object count: 18
+Initialized classes: 127
+Used classes: 37
+Static data size: 288
+VTable data size: 8292
+</programlisting>
+</sect3>
+
+</sect2>
+
+<sect2 id="ILAsm_code" >
+<title>Inspecting IL Assembly code</title>
+<para>
+Mono also provides a small tool that will let you disassemble
+the executable (.exe) file so you can have a peek
+under the hood. This tool is monodis, and is run as
+follows:
+
+</para>
+<programlisting>
+ monodis hello.exe
+.assembly extern mscorlib
+{
+ .ver 0:0:0:0
+}
+.assembly 'hello'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+ .class private auto ansi beforefieldinit Hello
+ extends [mscorlib]System.Object
+ {
+
+ // method line 1
+ .method public hidebysig specialname rtspecialname
+ instance default void .ctor() cil managed
+ {
+ // Method begins at RVA 0x20ec
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void System.Object::.ctor()
+ IL_0006: ret
+ } // end of method instance default void .ctor()
+
+ // method line 2
+ .method public static
+ default void Main(string[] args) cil managed
+ {
+ // Method begins at RVA 0x20f4
+ .entrypoint
+ // Code size 56 (0x38)
+ .maxstack 5
+ .locals init (
+ int32 V_0,
+ int32 V_1)
+ IL_0000: ldstr "mono:: is alive and well..."
+ IL_0005: call void System.Console::WriteLine(string)
+ IL_000a: ldc.i4.0
+ IL_000b: stloc.0
+ IL_000c: ldloc.0
+ IL_000d: ldarg.s 0
+ IL_000f: ldlen
+ IL_0010: clt
+ IL_0012: brfalse IL_0037
+
+ IL_0017: ldstr "Argument {0} = {1}"
+ IL_001c: ldloc.0
+ IL_001d: box [mscorlib]System.Int32
+ IL_0022: ldarg.s 0
+ IL_0024: ldloc.0
+ IL_0025: ldelem.ref
+ IL_0026: call void System.Console::WriteLine(string, object, object)
+ IL_002b: nop
+ IL_002c: ldloc.0
+ IL_002d: ldc.i4.1
+ IL_002e: add
+ IL_002f: stloc.1
+ IL_0030: ldloc.1
+ IL_0031: stloc.0
+ IL_0032: br IL_000c
+
+ IL_0037: ret
+ } // end of method default void Main(string[] args)
+
+ } // end of type Hello
+
+
+</programlisting>
+<para>
+This is the listing of the code of your program in a language
+called IL assembly, or Common Intermediate Language (CIL). The
+CIL provides the portability of the mono platform, and ensures
+that code compiled with Microsoft's .NET framework will work
+on mono and vice versa.
+</para>
+</sect2>
+
+<sect2 id="man_pages">
+<title>Man pages</title>
+
+<para>
+Mono has man pages already installed, and generally, typing <command>
+man</command> before the command you wish to execute should help in
+getting a list of the options. In many cases, it's still up to you
+to figure out what they do.
+</para>
+
+</sect2>
+
+
+</sect1>
+
+
+<sect1 id="problems">
+<title>Problems</title>
+<para>
+With mono being as new as it is, it is likely that you will have some
+problems with installation. The following are some ideas to help you
+out in a bind:
+</para>
+
+<orderedlist>
+<listitem>
+<para>
+See the Ximian Bugzilla page to find out if there is a bug
+report about your specific issue.
+</para>
+</listitem>
+
+<listitem>
+<para>Read this document. If it does not solve your problem, we want to
+know about it. Please send a message to the email address listed for
+feedback at the beginning of the document.</para>
+</listitem>
+
+<listitem>
+
+<para>
+Visit the mono mailing lists' archives and do a little
+research in there for threads talking about the problem you have.
+</para>
+</listitem>
+
+<listitem>
+<para>
+If you still cannot correct the problem, send a message to the
+mono list. When you do this, please be as precise as possible--i.e.
+mention the system you are running, the version of mono that you have the
+problem with, and give any error codes and other output that might appear.
+</para>
+</listitem>
+</orderedlist>
+
+</sect1>
+
+
+<!-- Legal Sections --> <sect1 id="copyright">
+ <title>Copyright and License</title>
+
+ <!-- The LDP recommends, but doesn't require, the GFDL --> <para>
+ This document, <emphasis>Running mono</emphasis>, is copyrighted
+ (c) 2002 by <emphasis>Hinne Hettema</emphasis> and
+ <emphasis>Jaime Anguiano Olarra</emphasis>. Permission is
+ granted to copy, distribute and/or modify this document under the
+ terms of the GNU Free Documentation License, Version 1.1 or any later
+ version published by the Free Software Foundation; with no Invariant
+ Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU Free
+ Documentation License".
+ </para>
+
+<sect2 id="gfdl"> <title>GNU Free Documentation License</title>
+<!-- GNU Project - Free Software Foundation (FSF) -->
+
+<para>Version 1.1, March 2000</para>
+
+<blockquote> <para>Copyright (C) 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is
+permitted to copy and distribute verbatim copies of this license document,
+but changing it is not allowed.</para> </blockquote>
+
+<sect3 id="gfdl-0"> <title>PREAMBLE</title>
+
+<para>The purpose of this License is to make a manual, textbook,
+ or other written document "free" in the sense of freedom: to assure
+ everyone the effective freedom to copy and redistribute it, with
+ or without modifying it, either commercially or noncommercially.
+ Secondarily, this License preserves for the author and publisher
+ a way to get credit for their work, while not being considered
+ responsible for modifications made by others.</para>
+
+<para>This License is a kind of "copyleft", which means that
+ derivative works of the document must themselves be free in the
+ same sense. It complements the GNU General Public License, which
+ is a copyleft license designed for free software.</para>
+
+<para>We have designed this License in order to use it for manuals
+ for free software, because free software needs free documentation:
+ a free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to software
+ manuals; it can be used for any textual work, regardless of subject
+ matter or whether it is published as a printed book. We recommend
+ this License principally for works whose purpose is instruction
+ or reference.</para>
+</sect3>
+
+<sect3 id="gfdl-1"> <title>APPLICABILITY AND DEFINITIONS</title>
+
+<para>This License applies to any manual or other work that
+ contains a notice placed by the copyright holder saying it can be
+ distributed under the terms of this License. The "Document", below,
+ refers to any such manual or work. Any member of the public is a
+ licensee, and is addressed as "you".</para>
+
+<para>A "Modified Version" of the Document means any work
+ containing the Document or a portion of it, either copied verbatim,
+ or with modifications and/or translated into another language.</para>
+
+<para>A "Secondary Section" is a named appendix or a front-matter
+ section of the Document that deals exclusively with the relationship
+ of the publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could fall
+ directly within that overall subject. (For example, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.</para>
+
+<para>The "Invariant Sections" are certain Secondary Sections
+ whose titles are designated, as being those of Invariant Sections,
+ in the notice that says that the Document is released under this
+ License.</para>
+
+<para>The "Cover Texts" are certain short passages of text that
+ are listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License.</para>
+
+<para>A "Transparent" copy of the Document means a
+ machine-readable copy, represented in a format whose specification
+ is available to the general public, whose contents can be viewed and
+ edited directly and straightforwardly with generic text editors
+ or (for images composed of pixels) generic paint programs or
+ (for drawings) some widely available drawing editor, and that is
+ suitable for input to text formatters or for automatic translation
+ to a variety of formats suitable for input to text formatters.
+ A copy made in an otherwise Transparent file format whose markup
+ has been designed to thwart or discourage subsequent modification
+ by readers is not Transparent. A copy that is not "Transparent"
+ is called "Opaque".</para>
+
+<para>Examples of suitable formats for Transparent copies include
+ plain ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and standard-conforming
+ simple HTML designed for human modification. Opaque formats include
+ PostScript, PDF, proprietary formats that can be read and edited
+ only by proprietary word processors, SGML or XML for which the
+ DTD and/or processing tools are not generally available, and the
+ machine-generated HTML produced by some word processors for output
+ purposes only.</para>
+
+<para>The "Title Page" means, for a printed book, the title page
+ itself, plus such following pages as are needed to hold, legibly,
+ the material this License requires to appear in the title page.
+ For works in formats which do not have any title page as such,
+ "Title Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.</para>
+</sect3>
+
+<sect3 id="gfdl-2"> <title>VERBATIM COPYING</title>
+
+<para>You may copy and distribute the Document in any medium,
+ either commercially or noncommercially, provided that this License,
+ the copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that
+ you add no other conditions whatsoever to those of this License.
+ You may not use technical measures to obstruct or control the
+ reading or further copying of the copies you make or distribute.
+ However, you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow the
+ conditions in section 3.</para>
+
+<para>You may also lend copies, under the same conditions stated
+ above, and you may publicly display copies.</para>
+</sect3>
+
+<sect3 id="gfdl-3"> <title>COPYING IN QUANTITY</title>
+
+<para>If you publish printed copies of the Document numbering more
+ than 100, and the Document's license notice requires Cover Texts, you
+ must enclose the copies in covers that carry, clearly and legibly,
+ all these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The front
+ cover must present the full title with all words of the title equally
+ prominent and visible. You may add other material on the covers
+ in addition. Copying with changes limited to the covers, as long as
+ they preserve the title of the Document and satisfy these conditions,
+ can be treated as verbatim copying in other respects.</para>
+
+<para>If the required texts for either cover are too voluminous to
+ fit legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto adjacent
+ pages.</para>
+
+<para>If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a machine-readable
+ Transparent copy along with each Opaque copy, or state in or with each
+ Opaque copy a publicly-accessible computer-network location containing
+ a complete Transparent copy of the Document, free of added material,
+ which the general network-using public has access to download
+ anonymously at no charge using public-standard network protocols.
+ If you use the latter option, you must take reasonably prudent steps,
+ when you begin distribution of Opaque copies in quantity, to ensure
+ that this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you distribute
+ an Opaque copy (directly or through your agents or retailers) of
+ that edition to the public.</para>
+
+<para>It is requested, but not required, that you contact the
+ authors of the Document well before redistributing any large number
+ of copies, to give them a chance to provide you with an updated
+ version of the Document.</para>
+</sect3>
+
+<sect3 id="gfdl-4"> <title>MODIFICATIONS</title>
+
+<para>You may copy and distribute a Modified Version of the
+ Document under the conditions of sections 2 and 3 above, provided
+ that you release the Modified Version under precisely this License,
+ with the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version
+ to whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:</para>
+
+<orderedlist numeration="upperalpha"> <listitem><para>Use in the
+Title Page
+ (and on the covers, if any) a title distinct from that of the
+ Document, and from those of previous versions (which should, if
+ there were any, be listed in the History section of the Document).
+ You may use the same title as a previous version if the original
+ publisher of that version gives permission.</para>
+</listitem>
+
+<listitem><para>List on the Title Page,
+ as authors, one or more persons or entities responsible for
+ authorship of the modifications in the Modified Version, together
+ with at least five of the principal authors of the Document (all
+ of its principal authors, if it has less than five).</para>
+</listitem>
+
+<listitem><para>State on the Title page
+ the name of the publisher of the Modified Version, as the
+ publisher.</para>
+</listitem>
+
+<listitem><para>Preserve all the
+ copyright notices of the Document.</para>
+</listitem>
+
+<listitem><para>Add an appropriate
+ copyright notice for your modifications adjacent to the other
+ copyright notices.</para>
+</listitem>
+
+<listitem><para>Include, immediately
+ after the copyright notices, a license notice giving the public
+ permission to use the Modified Version under the terms of this
+ License, in the form shown in the Addendum below.</para>
+</listitem>
+
+<listitem><para>Preserve in that license
+ notice the full lists of Invariant Sections and required Cover
+ Texts given in the Document's license notice.</para>
+</listitem>
+
+<listitem><para>Include an unaltered
+ copy of this License.</para>
+</listitem>
+
+<listitem><para>Preserve the section
+ entitled "History", and its title, and add to it an item stating at
+ least the title, year, new authors, and publisher of the Modified
+ Version as given on the Title Page. If there is no section entitled
+ "History" in the Document, create one stating the title, year,
+ authors, and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in the
+ previous sentence.</para>
+</listitem>
+
+<listitem><para>Preserve the network
+ location, if any, given in the Document for public access to
+ a Transparent copy of the Document, and likewise the network
+ locations given in the Document for previous versions it was
+ based on. These may be placed in the "History" section. You may
+ omit a network location for a work that was published at least four
+ years before the Document itself, or if the original publisher of
+ the version it refers to gives permission.</para>
+</listitem>
+
+<listitem><para>In any section entitled
+ "Acknowledgements" or "Dedications", preserve the section's title,
+ and preserve in the section all the substance and tone of each
+ of the contributor acknowledgements and/or dedications given
+ therein.</para>
+</listitem>
+
+<listitem><para>Preserve all the
+ Invariant Sections of the Document, unaltered in their text and in
+ their titles. Section numbers or the equivalent are not considered
+ part of the section titles.</para>
+</listitem>
+
+<listitem><para>Delete any section
+ entitled "Endorsements". Such a section may not be included in
+ the Modified Version.</para>
+</listitem>
+
+<listitem><para>Do not retitle any
+ existing section as "Endorsements" or to conflict in title with
+ any Invariant Section.</para>
+</listitem> </orderedlist> <para>If the Modified Version includes new
+front-matter sections
+ or appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option designate
+ some or all of these sections as invariant. To do this, add their
+ titles to the list of Invariant Sections in the Modified Version's
+ license notice. These titles must be distinct from any other section
+ titles.</para>
+
+<para>You may add a section entitled "Endorsements", provided it
+ contains nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text has
+ been approved by an organization as the authoritative definition of
+ a standard.</para>
+
+<para>You may add a passage of up to five words as a Front-Cover
+ Text, and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one passage
+ of Front-Cover Text and one of Back-Cover Text may be added by (or
+ through arrangements made by) any one entity. If the Document already
+ includes a cover text for the same cover, previously added by you or
+ by arrangement made by the same entity you are acting on behalf of,
+ you may not add another; but you may replace the old one, on explicit
+ permission from the previous publisher that added the old one.</para>
+
+<para>The author(s) and publisher(s) of the Document do not by
+ this License give permission to use their names for publicity for
+ or to assert or imply endorsement of any Modified Version.</para>
+</sect3>
+
+<sect3 id="gfdl-5"> <title>COMBINING DOCUMENTS</title>
+
+<para>You may combine the Document with other documents released
+ under this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination all of
+ the Invariant Sections of all of the original documents, unmodified,
+ and list them all as Invariant Sections of your combined work in
+ its license notice.</para>
+
+<para>The combined work need only contain one copy of this
+ License, and multiple identical Invariant Sections may be replaced
+ with a single copy. If there are multiple Invariant Sections with
+ the same name but different contents, make the title of each such
+ section unique by adding at the end of it, in parentheses, the
+ name of the original author or publisher of that section if known,
+ or else a unique number. Make the same adjustment to the section
+ titles in the list of Invariant Sections in the license notice of
+ the combined work.</para>
+
+<para>In the combination, you must combine any sections entitled
+ "History" in the various original documents, forming one section
+ entitled "History"; likewise combine any sections entitled
+ "Acknowledgements", and any sections entitled "Dedications".
+ You must delete all sections entitled "Endorsements."</para>
+</sect3>
+
+<sect3 id="gfdl-6"> <title>COLLECTIONS OF DOCUMENTS</title>
+
+<para>You may make a collection consisting of the Document and
+ other documents released under this License, and replace the
+ individual copies of this License in the various documents with a
+ single copy that is included in the collection, provided that you
+ follow the rules of this License for verbatim copying of each of
+ the documents in all other respects.</para>
+
+<para>You may extract a single document from such a collection,
+ and distribute it individually under this License, provided you
+ insert a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.</para>
+</sect3>
+
+<sect3 id="gfdl-7"> <title>AGGREGATION WITH INDEPENDENT WORKS</title>
+<para>A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume
+ of a storage or distribution medium, does not as a whole count
+ as a Modified Version of the Document, provided no compilation
+ copyright is claimed for the compilation. Such a compilation is
+ called an "aggregate", and this License does not apply to the other
+ self-contained works thus compiled with the Document, on account
+ of their being thus compiled, if they are not themselves derivative
+ works of the Document.</para>
+
+<para>If the Cover Text requirement of section 3 is applicable to
+ these copies of the Document, then if the Document is less than
+ one quarter of the entire aggregate, the Document's Cover Texts
+ may be placed on covers that surround only the Document within
+ the aggregate. Otherwise they must appear on covers around the
+ whole aggregate.</para>
+</sect3>
+
+<sect3 id="gfdl-8"> <title>TRANSLATION</title>
+
+<para>Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section 4.
+ Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include
+ a translation of this License provided that you also include the
+ original English version of this License. In case of a disagreement
+ between the translation and the original English version of this
+ License, the original English version will prevail.</para>
+</sect3>
+
+<sect3 id="gfdl-9"> <title>TERMINATION</title> <para>You may not copy,
+modify, sublicense, or distribute the
+ Document except as expressly provided for under this License.
+ Any other attempt to copy, modify, sublicense or distribute the
+ Document is void, and will automatically terminate your rights under
+ this License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses terminated
+ so long as such parties remain in full compliance.</para>
+</sect3>
+
+<sect3 id="gfdl-10"> <title>FUTURE REVISIONS OF THIS LICENSE</title>
+
+<para>The Free Software Foundation may publish new, revised
+ versions of the GNU Free Documentation License from
+ time to time. Such new versions will be similar
+ in spirit to the present version, but may differ in
+ detail to address new problems or concerns. See <ulink
+ url="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</ulink>.</para>
+
+<para>Each version of the License is given a distinguishing
+ version number. If the Document specifies that a particular
+ numbered version of this License "or any later version" applies
+ to it, you have the option of following the terms and conditions
+ either of that specified version or of any later version that has
+ been published (not as a draft) by the Free Software Foundation.
+ If the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.</para>
+</sect3>
+
+<sect3 id="gfdl-11"> <title>How to use this License for your
+documents</title>
+
+<para>To use this License in a document you have written, include
+ a copy of the License in the document and put the following copyright
+ and license notices just after the title page:</para>
+
+<blockquote><para> Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation License,
+ Version 1.1 or any later version published by the Free Software
+ Foundation; with the Invariant Sections being LIST THEIR TITLES,
+ with the Front-Cover Texts being LIST, and with the Back-Cover
+ Texts being LIST. A copy of the license is included in the section
+ entitled "GNU Free Documentation License".
+</para></blockquote>
+
+<para>If you have no Invariant Sections, write "with no Invariant
+ Sections" instead of saying which ones are invariant. If you
+ have no Front-Cover Texts, write "no Front-Cover Texts" instead of
+ "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.</para>
+
+<para>If your document contains nontrivial examples of program
+ code, we recommend releasing these examples in parallel under your
+ choice of free software license, such as the GNU General Public
+ License, to permit their use in free software.</para>
+</sect3> </sect2> </sect1>
+
+</article>
+
+
+
+
+<!-- This document is dedicated to all my friends and to the Mono hackers.
+
+ License
+
+Here goes the GFDL, GNU Free Documentation License. -->
+
diff --git a/web/mono-beginning.xml b/web/mono-beginning.xml
new file mode 100644
index 00000000000..6ab1019c225
--- /dev/null
+++ b/web/mono-beginning.xml
@@ -0,0 +1,1294 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" []>
+<article>
+
+ <articleinfo>
+
+ <!-- Use "HOWTO", "mini HOWTO", "FAQ" in title, if appropriate -->
+ <title>Running Mono</title>
+
+
+ <author>
+ <firstname>Hinne</firstname>
+ <surname>Hettema</surname>
+ <affiliation>
+ <address><email>h.hettema@auckland.ac.nz</email></address>
+ </affiliation>
+ </author>
+ <author>
+ <firstname>Jaime</firstname>
+ <surname>Anguiano Olarra</surname>
+ <affiliation>
+ <address><email>jaime@genuara.ugr.es</email></address>
+ </affiliation>
+ </author>
+
+ <pubdate>2002-06</pubdate>
+
+ <!-- Most recent revision goes at the top; list in descending order -->
+ <!-- All dates specified in ISO "YYYY-MM-DD" format -->
+ <revhistory>
+ <revision>
+ <revnumber>0.1</revnumber>
+ <date>2002-06-20</date>
+ <authorinitials>HH</authorinitials>
+ <revremark>First release</revremark>
+ </revision>
+ </revhistory>
+
+ <!-- Provide a good abstract; a couple of sentences is sufficient -->
+ <abstract>
+ <para>
+ This document describes how to install mono on your Linux system
+ from the source and describes some simple experiments you can
+ perform with this installation.
+ </para>
+ </abstract>
+
+ </articleinfo>
+
+
+<sect1 id="intro">
+<title>Introduction</title>
+
+<para>
+Mono is an open source implementation of the Common Language Infrastructure
+(CLI) specified in ECMA standard 335. It comes with a C# compiler and
+provides an extensible platform to develop and run applications that
+are interoperable with Microsoft .NET.
+</para>
+
+<para>
+Mono is not finished--it is a project still under development. As a
+result, installation and configuration may not be as smooth as you
+will be used to from other Linux applications. Nevertheless, mono is
+in a state that will allow you to get it up and running and gain
+experience with it--which is, I would suggest, a very smart thing to do.
+</para>
+
+<para>
+This document is limited in the following sense: it describes how to
+download a 'stable' version of mono as a 'tarball' and get it to run on
+your computer. I'm also assuming you run mono on Linux rather than
+on Windows. All the examples have been tested on a 'vanilla' Red Hat 7.3
+installation.
+</para>
+
+<para>
+There are two items this document will <emphasis>not
+</emphasis> cover: the first is how to self host the mcs compiler
+under linux and the second is the graphical user environment
+which is implemented as GTK#. These two interesting topics
+are the subject of two more howto's that I'm planning.
+</para>
+
+<para>
+This document is also less useful for two types of people.
+</para>
+<itemizedlist>
+<listitem>
+<para>
+If you are a very inexperienced linux user and want to know what mono is
+all about, there is an easier way to install mono. Go to mono.baselabs.org
+and download the rpm's ready for installation on your system. This site also
+runs a tutorial that is worth reading.
+</para>
+</listitem>
+<listitem>
+<para>
+If you are a very experienced user wanting to contribute to the mono code,
+you should probably regularly do a CVS download. At the moment, the mono
+code grows very fast, and the 'stable' releases still appear too slowly.
+</para>
+</listitem>
+
+</itemizedlist>
+
+<para>
+This document is aimed at the mono beginner, and aims to present a complete
+view of a minimal installation, which will allow you to experiment with
+mono to some degree. It also describes some of those experiments. We
+expect that after reading this document you'll go on to do either of
+two things:
+</para>
+<orderedlist>
+<listitem>
+<para>
+Continue to contribute to the mono project in some shape or form. The
+website has some ideas and suggestions under the heading 'Contributing'.
+</para>
+</listitem>
+<listitem>
+<para>
+Continue to write applications that run in mono.
+</para>
+</listitem>
+</orderedlist>
+
+<para>
+We hope this document will be useful to you in your first steps with mono.
+Happy hacking!
+</para>
+
+<sect2 id="note">
+<title>A note on the development of this document</title>
+<para>
+This document is expected to grow into a full 'running mono howto' over time.
+As of yet, it does not really discuss some of the excellent efforts of others
+to package mono into an rpm or deb and prepare it for easy installation.
+It is our aim to include this in future versions of this document.
+</para>
+</sect2>
+
+<sect2 id="prerequisites">
+<title>Prerequisites</title>
+<para>
+This document assumes you are somewhat familiar with the architecture
+of the Common Language Infrastructure and the C# programming language.
+</para>
+
+<para>
+To compile mono on your system, you will also have to satisfy
+some dependencies on other software. A list of these are given
+on the mono download page. Read through this list to see if
+you've got all components.
+</para>
+
+<para>
+On a practical note, I had no dependency issues with the
+installation of mono 0.12 on a 'standard issue' Red Hat 7.3 build.
+</para>
+
+</sect2>
+
+<sect2 id="disclaimer"> <title>Disclaimer</title>
+
+<para>
+No liability for the contents of this document can be accepted.
+Use the concepts, examples and information at your own risk. There may
+be errors and inaccuracies, that could be damaging to your system.
+Proceed with caution, and although this is highly unlikely, the author(s)
+do not take any responsibility.
+</para>
+
+<para>
+All copyrights are held by their by their respective owners,
+unless specifically noted otherwise. Use of a term in this document
+should not be regarded as affecting the validity of any trademark or
+service mark. Naming of particular products or brands should not be
+seen as endorsements.
+</para>
+</sect2>
+
+<!-- Give credit where credit is due...very important --> <sect2
+id="credits"> <title>Credits / Contributors</title>
+
+<para> This document was originally created by Jaime Anguiano Olarra,
+but has been extensively rewritten. Credits are due to </para>
+<itemizedlist>
+<listitem>
+<para>Jaime Anguiano Olarra <email>jaime@geneura.ugr.es</email>
+for creating the original version of this document, and in fact
+the document that got me through installing mono for the first time.
+</para>
+</listitem>
+<listitem>
+<para>
+My partner Margaret for support on my more exotic ventures.
+</para>
+</listitem>
+</itemizedlist>
+</sect2>
+
+<!-- Feedback -->
+<sect2 id="feedback"> <title>Feedback</title>
+
+<para>
+Feedback is most certainly welcome for this document. Send your
+additions, comments and criticisms to the following email address:
+<email>mono-docs-list@ximian.com</email>. I am lurking on this list
+and will maintain this document as required.
+</para>
+</sect2>
+</sect1>
+
+<!-- This is the preamble stuff over with the rest of document
+follows... -->
+<sect1 id="installation">
+<title> Installing Mono</title>
+
+<sect2 id="obtaining">
+<title>Obtaining Mono</title>
+<para>
+There are several ways to get Mono running on your computer. This
+document will discuss only one of those: downloading the source tarball
+and utilising the make utilities to get mono up and running. There is
+only one mono package to worry about if you are just after a 'base' install
+of mono: the mono runtime. This package, found under the name "mono-x.xx"
+has got a compiled version of the compiler built in.
+</para>
+
+<para>
+You'll be able to complete everything in this document if you just install
+the runtime, but taking a look at the compiler package is well worth the
+effort. The compiler is written in C# and is 'self hosting' which means it
+is able to compile itself.
+</para>
+
+<para>
+As of this moment, it is my understanding that there are still some issues
+with the 'self hosting' bit of the compiler on linux, although this is
+expected to work in later versions of mono. If you are just interested in
+finding out how mono will work under linux, I would not worry about the
+self-hosting bit for now. The self-hosting of the compiler will be the
+topic of a future howto.
+</para>
+
+<para>
+See <ulink url="http://www.go-mono.com/download">the mono download
+site</ulink> for the source of the tarballs.
+</para>
+
+<para>
+This page also lists the current versions of the software
+mono depends on. Make sure that your system has all the
+required versions, otherwise mono won't compile.
+</para>
+
+<para>
+At a minimum for mono 0.12, you'll need to:
+</para>
+
+<itemizedlist>
+<listitem>
+<para>
+download and install
+<ulink url="http//www.freedesktop.org/software/pkgconfig">
+pkg-config</ulink>.
+</para>
+</listitem>
+<listitem>
+<para>
+download and install
+<ulink url="ftp://ftp.gtk.org/pub/gtk/v1.3/glib-1.3.12.tar.gz">
+glib 1.3</ulink>.
+</para>
+</listitem>
+</itemizedlist>
+
+<para>
+Installing the tarballs is done via GNU autoconf and
+automake. The general upshot of running autoconf and automake is that you
+can type <command>./configure</command> and then <command> make</command>
+to do the build.
+Typing <command>make install</command> completes the installation of mono
+on your system.
+</para>
+
+<para>
+To build the mono runtime package, unzip the tarball to some useful
+location. I tend to use <command>/usr/src</command> as the location,
+but you could really do it anywhere. For the install process, it is
+also a good idea to be 'root'. The installation process will shuttle
+some executables into <command>/usr/local/bin</command> (more about
+that later).
+</para>
+
+<para>
+Unzipping the tarballs will have created two directories in <command>
+/usr/src/</command>, one called something like mono-x.xx and the other
+mcs-x.xx. The one called 'mono' is the runtime environment, and this contains
+all that is initially needed to run mono and investigate its inner workings.
+</para>
+
+<para>
+To start building the mono runtime, first type <command>./configure</command>.
+You will see an output like this:
+</para>
+<programlisting>
+[root@taurus mono-0.12]# ./configure
+loading cache ./config.cache
+checking host system type... i686-pc-linux-gnu
+checking target system type... i686-pc-linux-gnu
+checking build system type... i686-pc-linux-gnu
+checking for a BSD compatible install... (cached) /usr/bin/install -c
+checking whether build environment is sane... yes
+checking whether make sets ${MAKE}... (cached) yes
+checking for working aclocal... found
+
+
+snip ....
+
+
+checking BASE_DEPENDENCIES_CFLAGS... -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
+checking BASE_DEPENDENCIES_LIBS... -lglib-2.0
+checking for GC_malloc in -lgc... (cached) no
+configure: warning: Compiling mono without GC.
+checking if off_t is 64 bits wide... no
+checking if _FILE_OFFSET_BITS=64 gives 64 bit off_t... ok
+
+snip ...
+
+creating Makefile
+creating mono/Makefile
+creating mono/utils/Makefile
+creating mono/metadata/Makefile
+creating mono/dis/Makefile
+creating mono/cil/Makefile
+creating mono/arch/Makefile
+creating mono/os/Makefile
+creating mono/os/win32/Makefile
+creating mono/os/unix/Makefile
+creating mono/arch/x86/Makefile
+creating mono/arch/ppc/Makefile
+creating mono/arch/sparc/Makefile
+creating mono/arch/arm/Makefile
+creating mono/interpreter/Makefile
+creating mono/tests/Makefile
+creating mono/benchmark/Makefile
+creating mono/monoburg/Makefile
+creating mono/monograph/Makefile
+creating mono/jit/Makefile
+creating mono/io-layer/Makefile
+creating mono/handles/Makefile
+creating runtime/Makefile
+creating scripts/Makefile
+creating man/Makefile
+creating doc/Makefile
+creating docs/Makefile
+creating config.h
+config.h is unchanged
+
+
+ GC: auto
+
+
+[root@taurus mono-0.12]#
+</programlisting>
+
+
+<para>
+This means that the configure script has now created all the
+makefiles necessary to complete the build on your system.
+Note the "GC: auto" at the end of the list of commands.
+GC stands for "garbage collection" and it
+will be addressed in a later section of this document.
+</para>
+<para>
+You are now ready to start the mono "build" process. To kick
+this off, you can type <command>make</command> at the
+command prompt. You'll see something like this:
+</para>
+
+<programlisting>
+[root@taurus mono-0.12]# make
+make all-recursive
+make[1]: Entering directory `/usr/src/mono-0.12'
+Making all in mono
+make[2]: Entering directory `/usr/src/mono-0.12/mono'
+Making all in utils
+make[3]: Entering directory `/usr/src/mono-0.12/mono/utils'
+gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/include/glib-2.0
+-I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0
+-I/usr/lib/glib-2.0/include -I../.. -I../../mono
+-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -Wall
+-Wunused -Wmissing-prototypes -Wmissing-declarations
+-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
+-Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings
+-c mono-hash.c
+
+</programlisting>
+<para>
+and this will continue for a while. On my 1 GHz Duron with 256 MB of RAM the
+total build process takes about three minutes. All the terrible flags after gcc
+have essentially been set by the configure script and there is no need to worry
+about these.
+</para>
+<para>
+To finally install mono, you can type <command>make install</command>
+to get a working version of mono. This command will copy the
+scripts that run the executables to a place where the operating system
+will be ale to find them. This location is <command>/usr/local/bin</command>
+on my system.
+</para>
+
+</sect2>
+
+<sect2 id="garbage_collection">
+<title> Garbage Collection</title>
+<para>
+To make the mint interpreter work with garbage collection, you first need to
+install a garbage collection package on your system. Mono works with
+Boehm Garbage collection, which is found at
+<ulink url="http://www.hpl.hp.com/personal/Hans_Boehm/gc/">
+http://www.hpl.hp.com/personal/Hans_Boehm/gc/
+</ulink>.
+</para>
+
+<para>
+To get garbage collection to work, I downloaded the source tarball
+into <command>/usr/src/</command> and typed <command>./configure</command>
+followed by <command>make</command> and <command>make install</command>.
+</para>
+
+<para>
+There is one glitch to work around. The header file for the garbage collection
+<command>gc.h</command> is found in the <command>/usr/src/gc6.0/include
+</command> directory (at least on my system). The mono build process will break
+on this location: it is looking for the header file in some other place called
+<command>/usr/include/gc/</command> and won't be able to find the correct
+header file.
+</para>
+
+<para>
+The solution is to build a symbolic link between these two locations as
+follows
+</para>
+
+<programlisting>
+[root@taurus include]# ln -s /usr/src/gc6.0/include/ /usr/include/gc
+</programlisting>
+
+<para>
+after which you'll be able to list the directory contents as if they were
+in <command>/usr/include</command>
+</para>
+
+<programlisting>
+[root@taurus include]# pwd
+/usr/include
+[root@taurus include]# ls /usr/include/gc
+cord.h gc_backptr.h gc_inline.h javaxfc.h
+ec.h gc_cpp.h gc_local_alloc.h leak_detector.h
+gc gc_gcj.h gc_mark.h new_gc_alloc.h
+gc_alloc.h gc.h gc_pthread_redirects.h private
+gc_amiga_redirects.h gc_inl.h gc_typed.h weakpointer.h
+[root@taurus include]#
+</programlisting>
+
+<para>
+To get mono to work with garbage collection, you'll have to rebuild the
+environment. This is done easily by typing <command>make distclean</command>
+to clean up any existing executables.
+</para>
+
+<para>
+Continue the build by typing <command>./configure</command>, and look at
+the last line. It should read:
+</para>
+
+<programlisting>
+
+snip...
+
+creating config.h
+
+
+ GC: boehm
+
+
+[root@taurus mono-0.12]#
+
+</programlisting>
+
+<para>
+The GC: boehm tells you that garbage collection has been turned on. Now to
+compile the runtime, you type <command>make</command> and <command> make
+install</command> as previously.
+</para>
+
+<para>
+You now have mono working with Garbage Collection.
+</para>
+
+<para>
+Although my experimentation is incomplete as of this time, I have found some
+issues with running Garbage Collection continuously, and my recommendation
+would be to turn it off for now.
+</para>
+
+<para>
+To turn garbage collection off again, you have to go to the <command>/usr/src
+</command> directory where you extracted the tarball. Enter the <command>gc6.0
+</command> directory and type <command>make uninstall</command> to uninstall
+Garbage Collection. Then in your <command>mono</command> directory, type
+<command>make distclean</command> followed by <command>./configure</command>,
+<command>make</command> and <command>make install</command>.
+</para>
+
+</sect2>
+
+</sect1>
+
+<sect1 id="running">
+<title>Running mono</title>
+<sect2 id="basic">
+<title>Basic steps</title>
+<para>
+To work with mono, you first have to create a C# program. Open up
+your favourite editor, and type in the following code:
+</para>
+<programlisting>
+using System;
+
+class Hello
+{
+public static void Main(String[] args)
+ {
+ Console.WriteLine("mono:: is alive and well...");
+
+ for (int i = 0; i < args.Length; i++)
+ Console.WriteLine("Argument {0} = {1}", i, args[i]);
+ }
+}
+</programlisting>
+
+<para>
+Save the file as hello.cs. To compile this into a working program,
+type mcs hello.cs. If you get the following:
+</para>
+<programlisting>
+[hinne@taurus hello]$ mcs hello.cs
+RESULT: 0
+[hinne@taurus hello]$
+</programlisting>
+<para>
+you know the compile worked fine. If you see some strange error
+messages including the word 'parser' somewhere, you made a mistake in
+your program. Fix this up first.
+</para>
+
+<para>
+You are now ready to execute your first mono program. To execute
+the code, type
+</para>
+
+<programlisting>
+[hinne@taurus hello]$ mono hello.exe arg1 arg2 arg 3
+</programlisting>
+<para>
+(where we have given some arguments just for fun) and you'll
+see the following:
+</para>
+
+<programlisting>
+mono:: is alive and well...
+Argument 0 = arg1
+Argument 1 = arg2
+Argument 2 = arg
+Argument 3 = 3
+RESULT: 0
+</programlisting>
+<para>
+As you can see, mono printed the line "mono:: is alive and well"
+and printed the list of arguments. This completes the creation
+and execution of your first mono program.
+</para>
+</sect2>
+
+<sect2 id="interpreter">
+<title>Interpreter</title>
+<para>
+But mono will allow you to do more. First of all, mono is the
+compiled mono execution environment which uses the Just in
+Time (JIT) compiler. Mono also comes with an interpreted
+environment, which can be accessed using the command 'mint'
+as follows
+</para>
+<programlisting>
+[hinne@taurus hello]$ mint hello.exe arg1 arg 2
+mono:: is alive and well...
+Argument 0 = arg1
+Argument 1 = arg
+Argument 2 = 2
+[hinne@taurus hello]$
+</programlisting>
+<para>
+As you can see, it makes no difference to mono output which
+environment you use, but what happens under the hood is very
+different. If you use 'mono' as the command line tool, you
+call the 'production' execution environment which will read
+your portable executable (PE) file, and call the just in
+time (JIT) compiler to compile the PE code down to machine
+level code (in my case, an x86 architecture) after which
+it is executed.
+</para>
+<para>
+If you use mint, the JIT is not used, and the PE code is
+interpreted into x86 instructions for execution. In fact,
+for our simple 'hello' mint is slightly faster. The point
+is that the JIT compiler will take some time to compile the
+code of our program and store it in some location in memory,
+but the subsequent execution of the code is faster with mono.
+</para>
+<para>
+
+You can see what happens below (the thing to look for is the
+'user' time: 0.1 seconds with mono and 0.06 seconds with mint):
+
+</para>
+<programlisting>
+[hinne@taurus hello]$ time mono hello.exe arg1 arg 2
+mono:: is alive and well...
+Argument 0 = arg1
+Argument 1 = arg
+Argument 2 = 2
+RESULT: 0
+
+real 0m0.575s
+user 0m0.100s
+sys 0m0.010s
+[hinne@taurus hello]$ time mint hello.exe arg1 arg 2
+mono:: is alive and well...
+Argument 0 = arg1
+Argument 1 = arg
+Argument 2 = 2
+
+real 0m0.545s
+user 0m0.060s
+sys 0m0.000s
+[hinne@taurus hello]$
+</programlisting>
+<para>
+After this simple run of mono, it is time to play with some options.
+I won't cover these in detail since there are quite a few, and also because
+I assume you downloaded mono to hack it around in the first place. So
+I'll leave some pointers.
+</para>
+
+
+<sect3 id="debugging">
+<title>Debugging</title>
+<para>
+Mono supports a debugging option when you specify the "-d" flag while running
+the runtime. Utilising this flag will get you a significant amount of output,
+and it may be an idea to specify an output file as well. The interesting aspect
+of this file is that it allows you to see to some extent (quite precisely,
+actually) what the JIT compiler is up to.
+</para>
+</sect3>
+
+<sect3 id="statistics">
+<title>Statistics</title>
+<para>
+It is also possible to collect some runtime statistics on your program. These
+will give you some idea of the resource utilisation of your program.
+</para>
+<programlisting>
+[hinne@taurus hello]$ mono --stats hello.exe
+mono:: is alive and well...
+RESULT: 0
+Mono Jit statistics
+Compiled methods: 58
+Methods cache lookup: 15
+Method trampolines: 698
+Basic blocks: 188
+Max basic blocks: 15
+Allocated vars: 238
+Analyze stack repeat: 61
+Compiled CIL code size: 2450
+Native code size: 10167
+Max code size ratio: 7.13 (FileStream::FlushBuffer)
+Biggest method: 1016 (StreamWriter::Write)
+Code reallocs: 27
+Allocated code size: 22073
+Inlineable methods: 17
+Inlined methods: 22
+
+Created object count: 18
+Initialized classes: 127
+Used classes: 37
+Static data size: 288
+VTable data size: 8292
+</programlisting>
+</sect3>
+
+</sect2>
+
+<sect2 id="ILAsm_code" >
+<title>Inspecting IL Assembly code</title>
+<para>
+Mono also provides a small tool that will let you disassemble
+the executable (.exe) file so you can have a peek
+under the hood. This tool is monodis, and is run as
+follows:
+
+</para>
+<programlisting>
+[hinne@taurus hello]$ monodis hello.exe
+.assembly extern mscorlib
+{
+ .ver 0:0:0:0
+}
+.assembly 'hello'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+ .class private auto ansi beforefieldinit Hello
+ extends [mscorlib]System.Object
+ {
+
+ // method line 1
+ .method public hidebysig specialname rtspecialname
+ instance default void .ctor() cil managed
+ {
+ // Method begins at RVA 0x20ec
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void System.Object::.ctor()
+ IL_0006: ret
+ } // end of method instance default void .ctor()
+
+ // method line 2
+ .method public static
+ default void Main(string[] args) cil managed
+ {
+ // Method begins at RVA 0x20f4
+ .entrypoint
+ // Code size 56 (0x38)
+ .maxstack 5
+ .locals init (
+ int32 V_0,
+ int32 V_1)
+ IL_0000: ldstr "mono:: is alive and well..."
+ IL_0005: call void System.Console::WriteLine(string)
+ IL_000a: ldc.i4.0
+ IL_000b: stloc.0
+ IL_000c: ldloc.0
+ IL_000d: ldarg.s 0
+ IL_000f: ldlen
+ IL_0010: clt
+ IL_0012: brfalse IL_0037
+
+ IL_0017: ldstr "Argument {0} = {1}"
+ IL_001c: ldloc.0
+ IL_001d: box [mscorlib]System.Int32
+ IL_0022: ldarg.s 0
+ IL_0024: ldloc.0
+ IL_0025: ldelem.ref
+ IL_0026: call void System.Console::WriteLine(string, object, object)
+ IL_002b: nop
+ IL_002c: ldloc.0
+ IL_002d: ldc.i4.1
+ IL_002e: add
+ IL_002f: stloc.1
+ IL_0030: ldloc.1
+ IL_0031: stloc.0
+ IL_0032: br IL_000c
+
+ IL_0037: ret
+ } // end of method default void Main(string[] args)
+
+ } // end of type Hello
+
+[hinne@taurus hello]$
+</programlisting>
+<para>
+This is the listing of the code of your program in a language
+called IL assembly, or Common Intermediate Language (CIL). The
+CIL provides the portability of the mono platform, and ensures
+that code compiled with Microsoft's .NET framework will work
+on mono and vice versa.
+</para>
+</sect2>
+
+<sect2 id="man_pages">
+<title>Man pages</title>
+
+<para>
+Mono has man pages already installed, and generally, typing <command>
+man</command> before the command you wish to execute should help in
+getting a list of the options. In many cases, it's still up to you
+to figure out what they do.
+</para>
+
+</sect2>
+
+
+</sect1>
+
+
+<sect1 id="problems">
+<title>Problems</title>
+<para>
+With mono being as new as it is, it is likely that you will have some
+problems with installation. The following are some ideas to help you
+out in a bind:
+</para>
+
+<orderedlist>
+<listitem>
+<para>
+See the Ximian Bugzilla page to find out if there is a bug
+report about your specific issue.
+</para>
+</listitem>
+
+<listitem>
+<para>Read this document. If it does not solve your problem, we want to
+know about it. Please send a message to the email address listed for
+feedback at the beginning of the document.</para>
+</listitem>
+
+<listitem>
+
+<para>
+Visit the mono mailing lists' archives and do a little
+research in there for threads talking about the problem you have.
+</para>
+</listitem>
+
+<listitem>
+<para>
+If you still cannot correct the problem, send a message to the
+mono list. When you do this, please be as precise as possible--i.e.
+mention the system you are running, the version of mono that you have the
+problem with, and give any error codes and other output that might appear.
+</para>
+</listitem>
+</orderedlist>
+
+</sect1>
+
+<sect1 id="knownproblems">
+<title>Known Problems</title>
+
+<para> mcs fails to compile in Linux.
+To the best of my knowledge, as of yet mcs cannot compile in Linux.
+Try to install the already made packages from
+http://mono.baselabs.org/index.php/software. </para>
+</sect1>
+
+<!-- Legal Sections --> <sect1 id="copyright">
+ <title>Copyright and License</title>
+
+ <!-- The LDP recommends, but doesn't require, the GFDL --> <para>
+ This document, <emphasis>Running mono</emphasis>, is copyrighted
+ (c) 2002 by <emphasis>Hinne Hettema</emphasis> and
+ <emphasis>Jaime Anguiano Olarra</emphasis>. Permission is
+ granted to copy, distribute and/or modify this document under the
+ terms of the GNU Free Documentation License, Version 1.1 or any later
+ version published by the Free Software Foundation; with no Invariant
+ Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU Free
+ Documentation License".
+ </para>
+
+<sect2 id="gfdl"> <title>GNU Free Documentation License</title>
+<!-- GNU Project - Free Software Foundation (FSF) -->
+
+<para>Version 1.1, March 2000</para>
+
+<blockquote> <para>Copyright (C) 2000 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is
+permitted to copy and distribute verbatim copies of this license document,
+but changing it is not allowed.</para> </blockquote>
+
+<sect3 id="gfdl-0"> <title>PREAMBLE</title>
+
+<para>The purpose of this License is to make a manual, textbook,
+ or other written document "free" in the sense of freedom: to assure
+ everyone the effective freedom to copy and redistribute it, with
+ or without modifying it, either commercially or noncommercially.
+ Secondarily, this License preserves for the author and publisher
+ a way to get credit for their work, while not being considered
+ responsible for modifications made by others.</para>
+
+<para>This License is a kind of "copyleft", which means that
+ derivative works of the document must themselves be free in the
+ same sense. It complements the GNU General Public License, which
+ is a copyleft license designed for free software.</para>
+
+<para>We have designed this License in order to use it for manuals
+ for free software, because free software needs free documentation:
+ a free program should come with manuals providing the same freedoms
+ that the software does. But this License is not limited to software
+ manuals; it can be used for any textual work, regardless of subject
+ matter or whether it is published as a printed book. We recommend
+ this License principally for works whose purpose is instruction
+ or reference.</para>
+</sect3>
+
+<sect3 id="gfdl-1"> <title>APPLICABILITY AND DEFINITIONS</title>
+
+<para>This License applies to any manual or other work that
+ contains a notice placed by the copyright holder saying it can be
+ distributed under the terms of this License. The "Document", below,
+ refers to any such manual or work. Any member of the public is a
+ licensee, and is addressed as "you".</para>
+
+<para>A "Modified Version" of the Document means any work
+ containing the Document or a portion of it, either copied verbatim,
+ or with modifications and/or translated into another language.</para>
+
+<para>A "Secondary Section" is a named appendix or a front-matter
+ section of the Document that deals exclusively with the relationship
+ of the publishers or authors of the Document to the Document's overall
+ subject (or to related matters) and contains nothing that could fall
+ directly within that overall subject. (For example, if the Document
+ is in part a textbook of mathematics, a Secondary Section may not
+ explain any mathematics.) The relationship could be a matter of
+ historical connection with the subject or with related matters, or
+ of legal, commercial, philosophical, ethical or political position
+ regarding them.</para>
+
+<para>The "Invariant Sections" are certain Secondary Sections
+ whose titles are designated, as being those of Invariant Sections,
+ in the notice that says that the Document is released under this
+ License.</para>
+
+<para>The "Cover Texts" are certain short passages of text that
+ are listed, as Front-Cover Texts or Back-Cover Texts, in the notice
+ that says that the Document is released under this License.</para>
+
+<para>A "Transparent" copy of the Document means a
+ machine-readable copy, represented in a format whose specification
+ is available to the general public, whose contents can be viewed and
+ edited directly and straightforwardly with generic text editors
+ or (for images composed of pixels) generic paint programs or
+ (for drawings) some widely available drawing editor, and that is
+ suitable for input to text formatters or for automatic translation
+ to a variety of formats suitable for input to text formatters.
+ A copy made in an otherwise Transparent file format whose markup
+ has been designed to thwart or discourage subsequent modification
+ by readers is not Transparent. A copy that is not "Transparent"
+ is called "Opaque".</para>
+
+<para>Examples of suitable formats for Transparent copies include
+ plain ASCII without markup, Texinfo input format, LaTeX input format,
+ SGML or XML using a publicly available DTD, and standard-conforming
+ simple HTML designed for human modification. Opaque formats include
+ PostScript, PDF, proprietary formats that can be read and edited
+ only by proprietary word processors, SGML or XML for which the
+ DTD and/or processing tools are not generally available, and the
+ machine-generated HTML produced by some word processors for output
+ purposes only.</para>
+
+<para>The "Title Page" means, for a printed book, the title page
+ itself, plus such following pages as are needed to hold, legibly,
+ the material this License requires to appear in the title page.
+ For works in formats which do not have any title page as such,
+ "Title Page" means the text near the most prominent appearance of the
+ work's title, preceding the beginning of the body of the text.</para>
+</sect3>
+
+<sect3 id="gfdl-2"> <title>VERBATIM COPYING</title>
+
+<para>You may copy and distribute the Document in any medium,
+ either commercially or noncommercially, provided that this License,
+ the copyright notices, and the license notice saying this License
+ applies to the Document are reproduced in all copies, and that
+ you add no other conditions whatsoever to those of this License.
+ You may not use technical measures to obstruct or control the
+ reading or further copying of the copies you make or distribute.
+ However, you may accept compensation in exchange for copies. If you
+ distribute a large enough number of copies you must also follow the
+ conditions in section 3.</para>
+
+<para>You may also lend copies, under the same conditions stated
+ above, and you may publicly display copies.</para>
+</sect3>
+
+<sect3 id="gfdl-3"> <title>COPYING IN QUANTITY</title>
+
+<para>If you publish printed copies of the Document numbering more
+ than 100, and the Document's license notice requires Cover Texts, you
+ must enclose the copies in covers that carry, clearly and legibly,
+ all these Cover Texts: Front-Cover Texts on the front cover, and
+ Back-Cover Texts on the back cover. Both covers must also clearly
+ and legibly identify you as the publisher of these copies. The front
+ cover must present the full title with all words of the title equally
+ prominent and visible. You may add other material on the covers
+ in addition. Copying with changes limited to the covers, as long as
+ they preserve the title of the Document and satisfy these conditions,
+ can be treated as verbatim copying in other respects.</para>
+
+<para>If the required texts for either cover are too voluminous to
+ fit legibly, you should put the first ones listed (as many as fit
+ reasonably) on the actual cover, and continue the rest onto adjacent
+ pages.</para>
+
+<para>If you publish or distribute Opaque copies of the Document
+ numbering more than 100, you must either include a machine-readable
+ Transparent copy along with each Opaque copy, or state in or with each
+ Opaque copy a publicly-accessible computer-network location containing
+ a complete Transparent copy of the Document, free of added material,
+ which the general network-using public has access to download
+ anonymously at no charge using public-standard network protocols.
+ If you use the latter option, you must take reasonably prudent steps,
+ when you begin distribution of Opaque copies in quantity, to ensure
+ that this Transparent copy will remain thus accessible at the stated
+ location until at least one year after the last time you distribute
+ an Opaque copy (directly or through your agents or retailers) of
+ that edition to the public.</para>
+
+<para>It is requested, but not required, that you contact the
+ authors of the Document well before redistributing any large number
+ of copies, to give them a chance to provide you with an updated
+ version of the Document.</para>
+</sect3>
+
+<sect3 id="gfdl-4"> <title>MODIFICATIONS</title>
+
+<para>You may copy and distribute a Modified Version of the
+ Document under the conditions of sections 2 and 3 above, provided
+ that you release the Modified Version under precisely this License,
+ with the Modified Version filling the role of the Document, thus
+ licensing distribution and modification of the Modified Version
+ to whoever possesses a copy of it. In addition, you must do these
+ things in the Modified Version:</para>
+
+<orderedlist numeration="upperalpha"> <listitem><para>Use in the
+Title Page
+ (and on the covers, if any) a title distinct from that of the
+ Document, and from those of previous versions (which should, if
+ there were any, be listed in the History section of the Document).
+ You may use the same title as a previous version if the original
+ publisher of that version gives permission.</para>
+</listitem>
+
+<listitem><para>List on the Title Page,
+ as authors, one or more persons or entities responsible for
+ authorship of the modifications in the Modified Version, together
+ with at least five of the principal authors of the Document (all
+ of its principal authors, if it has less than five).</para>
+</listitem>
+
+<listitem><para>State on the Title page
+ the name of the publisher of the Modified Version, as the
+ publisher.</para>
+</listitem>
+
+<listitem><para>Preserve all the
+ copyright notices of the Document.</para>
+</listitem>
+
+<listitem><para>Add an appropriate
+ copyright notice for your modifications adjacent to the other
+ copyright notices.</para>
+</listitem>
+
+<listitem><para>Include, immediately
+ after the copyright notices, a license notice giving the public
+ permission to use the Modified Version under the terms of this
+ License, in the form shown in the Addendum below.</para>
+</listitem>
+
+<listitem><para>Preserve in that license
+ notice the full lists of Invariant Sections and required Cover
+ Texts given in the Document's license notice.</para>
+</listitem>
+
+<listitem><para>Include an unaltered
+ copy of this License.</para>
+</listitem>
+
+<listitem><para>Preserve the section
+ entitled "History", and its title, and add to it an item stating at
+ least the title, year, new authors, and publisher of the Modified
+ Version as given on the Title Page. If there is no section entitled
+ "History" in the Document, create one stating the title, year,
+ authors, and publisher of the Document as given on its Title Page,
+ then add an item describing the Modified Version as stated in the
+ previous sentence.</para>
+</listitem>
+
+<listitem><para>Preserve the network
+ location, if any, given in the Document for public access to
+ a Transparent copy of the Document, and likewise the network
+ locations given in the Document for previous versions it was
+ based on. These may be placed in the "History" section. You may
+ omit a network location for a work that was published at least four
+ years before the Document itself, or if the original publisher of
+ the version it refers to gives permission.</para>
+</listitem>
+
+<listitem><para>In any section entitled
+ "Acknowledgements" or "Dedications", preserve the section's title,
+ and preserve in the section all the substance and tone of each
+ of the contributor acknowledgements and/or dedications given
+ therein.</para>
+</listitem>
+
+<listitem><para>Preserve all the
+ Invariant Sections of the Document, unaltered in their text and in
+ their titles. Section numbers or the equivalent are not considered
+ part of the section titles.</para>
+</listitem>
+
+<listitem><para>Delete any section
+ entitled "Endorsements". Such a section may not be included in
+ the Modified Version.</para>
+</listitem>
+
+<listitem><para>Do not retitle any
+ existing section as "Endorsements" or to conflict in title with
+ any Invariant Section.</para>
+</listitem> </orderedlist> <para>If the Modified Version includes new
+front-matter sections
+ or appendices that qualify as Secondary Sections and contain no
+ material copied from the Document, you may at your option designate
+ some or all of these sections as invariant. To do this, add their
+ titles to the list of Invariant Sections in the Modified Version's
+ license notice. These titles must be distinct from any other section
+ titles.</para>
+
+<para>You may add a section entitled "Endorsements", provided it
+ contains nothing but endorsements of your Modified Version by various
+ parties--for example, statements of peer review or that the text has
+ been approved by an organization as the authoritative definition of
+ a standard.</para>
+
+<para>You may add a passage of up to five words as a Front-Cover
+ Text, and a passage of up to 25 words as a Back-Cover Text, to the end
+ of the list of Cover Texts in the Modified Version. Only one passage
+ of Front-Cover Text and one of Back-Cover Text may be added by (or
+ through arrangements made by) any one entity. If the Document already
+ includes a cover text for the same cover, previously added by you or
+ by arrangement made by the same entity you are acting on behalf of,
+ you may not add another; but you may replace the old one, on explicit
+ permission from the previous publisher that added the old one.</para>
+
+<para>The author(s) and publisher(s) of the Document do not by
+ this License give permission to use their names for publicity for
+ or to assert or imply endorsement of any Modified Version.</para>
+</sect3>
+
+<sect3 id="gfdl-5"> <title>COMBINING DOCUMENTS</title>
+
+<para>You may combine the Document with other documents released
+ under this License, under the terms defined in section 4 above for
+ modified versions, provided that you include in the combination all of
+ the Invariant Sections of all of the original documents, unmodified,
+ and list them all as Invariant Sections of your combined work in
+ its license notice.</para>
+
+<para>The combined work need only contain one copy of this
+ License, and multiple identical Invariant Sections may be replaced
+ with a single copy. If there are multiple Invariant Sections with
+ the same name but different contents, make the title of each such
+ section unique by adding at the end of it, in parentheses, the
+ name of the original author or publisher of that section if known,
+ or else a unique number. Make the same adjustment to the section
+ titles in the list of Invariant Sections in the license notice of
+ the combined work.</para>
+
+<para>In the combination, you must combine any sections entitled
+ "History" in the various original documents, forming one section
+ entitled "History"; likewise combine any sections entitled
+ "Acknowledgements", and any sections entitled "Dedications".
+ You must delete all sections entitled "Endorsements."</para>
+</sect3>
+
+<sect3 id="gfdl-6"> <title>COLLECTIONS OF DOCUMENTS</title>
+
+<para>You may make a collection consisting of the Document and
+ other documents released under this License, and replace the
+ individual copies of this License in the various documents with a
+ single copy that is included in the collection, provided that you
+ follow the rules of this License for verbatim copying of each of
+ the documents in all other respects.</para>
+
+<para>You may extract a single document from such a collection,
+ and distribute it individually under this License, provided you
+ insert a copy of this License into the extracted document, and follow
+ this License in all other respects regarding verbatim copying of
+ that document.</para>
+</sect3>
+
+<sect3 id="gfdl-7"> <title>AGGREGATION WITH INDEPENDENT WORKS</title>
+<para>A compilation of the Document or its derivatives with other
+ separate and independent documents or works, in or on a volume
+ of a storage or distribution medium, does not as a whole count
+ as a Modified Version of the Document, provided no compilation
+ copyright is claimed for the compilation. Such a compilation is
+ called an "aggregate", and this License does not apply to the other
+ self-contained works thus compiled with the Document, on account
+ of their being thus compiled, if they are not themselves derivative
+ works of the Document.</para>
+
+<para>If the Cover Text requirement of section 3 is applicable to
+ these copies of the Document, then if the Document is less than
+ one quarter of the entire aggregate, the Document's Cover Texts
+ may be placed on covers that surround only the Document within
+ the aggregate. Otherwise they must appear on covers around the
+ whole aggregate.</para>
+</sect3>
+
+<sect3 id="gfdl-8"> <title>TRANSLATION</title>
+
+<para>Translation is considered a kind of modification, so you may
+ distribute translations of the Document under the terms of section 4.
+ Replacing Invariant Sections with translations requires special
+ permission from their copyright holders, but you may include
+ translations of some or all Invariant Sections in addition to the
+ original versions of these Invariant Sections. You may include
+ a translation of this License provided that you also include the
+ original English version of this License. In case of a disagreement
+ between the translation and the original English version of this
+ License, the original English version will prevail.</para>
+</sect3>
+
+<sect3 id="gfdl-9"> <title>TERMINATION</title> <para>You may not copy,
+modify, sublicense, or distribute the
+ Document except as expressly provided for under this License.
+ Any other attempt to copy, modify, sublicense or distribute the
+ Document is void, and will automatically terminate your rights under
+ this License. However, parties who have received copies, or rights,
+ from you under this License will not have their licenses terminated
+ so long as such parties remain in full compliance.</para>
+</sect3>
+
+<sect3 id="gfdl-10"> <title>FUTURE REVISIONS OF THIS LICENSE</title>
+
+<para>The Free Software Foundation may publish new, revised
+ versions of the GNU Free Documentation License from
+ time to time. Such new versions will be similar
+ in spirit to the present version, but may differ in
+ detail to address new problems or concerns. See <ulink
+ url="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</ulink>.</para>
+
+<para>Each version of the License is given a distinguishing
+ version number. If the Document specifies that a particular
+ numbered version of this License "or any later version" applies
+ to it, you have the option of following the terms and conditions
+ either of that specified version or of any later version that has
+ been published (not as a draft) by the Free Software Foundation.
+ If the Document does not specify a version number of this License,
+ you may choose any version ever published (not as a draft) by the
+ Free Software Foundation.</para>
+</sect3>
+
+<sect3 id="gfdl-11"> <title>How to use this License for your
+documents</title>
+
+<para>To use this License in a document you have written, include
+ a copy of the License in the document and put the following copyright
+ and license notices just after the title page:</para>
+
+<blockquote><para> Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this
+ document under the terms of the GNU Free Documentation License,
+ Version 1.1 or any later version published by the Free Software
+ Foundation; with the Invariant Sections being LIST THEIR TITLES,
+ with the Front-Cover Texts being LIST, and with the Back-Cover
+ Texts being LIST. A copy of the license is included in the section
+ entitled "GNU Free Documentation License".
+</para></blockquote>
+
+<para>If you have no Invariant Sections, write "with no Invariant
+ Sections" instead of saying which ones are invariant. If you
+ have no Front-Cover Texts, write "no Front-Cover Texts" instead of
+ "Front-Cover Texts being LIST"; likewise for Back-Cover Texts.</para>
+
+<para>If your document contains nontrivial examples of program
+ code, we recommend releasing these examples in parallel under your
+ choice of free software license, such as the GNU General Public
+ License, to permit their use in free software.</para>
+</sect3> </sect2> </sect1>
+
+</article>
+
diff --git a/web/mono-build-mac-fw-release.sh b/web/mono-build-mac-fw-release.sh
new file mode 100644
index 00000000000..ab4bf563c1e
--- /dev/null
+++ b/web/mono-build-mac-fw-release.sh
@@ -0,0 +1,217 @@
+#!/bin/sh
+
+# this horrid little script updates a mono revision
+# Author: Andy Satori <dru@satori-assoc.com>
+# Modifications: kangaroo
+# Changes June 10/2004
+# - Updated for beta3 0.96
+# Changes June 2/2004
+# - Updated for beta2 0.95
+# - Updated to boehm.gc.a6
+# - Updated to glib-2.4.1
+
+set -e
+
+INITIALDIR=$PWD
+VERSION=0.96
+PREFIX=/Library/Frameworks/Mono.framework/Versions/$VERSION
+
+export C_INCLUDE_PATH=$C_INCLUDE_PATH:$PREFIX/include
+export LDFLAGS=-L$PREFIX/lib
+export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/X11R6/lib:$PREFIX/lib
+
+if test ! -d "$INITIALDIR/Dependancies"; then
+ mkdir $INITIALDIR/Dependancies
+fi
+
+# make the directories as need for the Framework (which isn't really
+# a framework, but it looks like one and makes a nice placeholder until
+# someone smarter than I am can come in and make it better)
+
+if test ! -d "/Library/Frameworks/Mono.framework"; then
+ mkdir /Library/Frameworks/Mono.framework
+ mkdir /Library/Frameworks/Mono.framework/Versions
+fi
+
+if test ! -d "/Library/Frameworks/Mono.framework/Versions/$VERSION"; then
+ mkdir /Library/Frameworks/Mono.framework/Versions/$VERSION
+fi
+
+# set up the environment for the build
+export PATH=$PREFIX/bin:/usr/X11R6/bin:$PATH
+export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal/"
+export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/X11R6/lib/pkgconfig
+
+
+cd $INITIALDIR/Dependancies
+
+# pkg-config
+
+echo +++ processing pkg-config
+
+if test ! -f "$PREFIX/bin/pkg-config"; then
+ if test ! -d "pkgconfig-0.15.0"; then
+ curl http://www.freedesktop.org/software/pkgconfig/releases/pkgconfig-0.15.0.tar.gz -O
+ tar xzf pkgconfig-0.15.0.tar.gz
+ rm pkgconfig-0.15.0.tar.gz
+ fi
+
+ cd pkgconfig-0.15.0
+
+ ./configure --prefix=$PREFIX
+ make
+ make install
+ make clean
+
+ cd ..
+fi
+
+# gettext
+
+echo +++ processing gettext
+
+if test ! -f "$PREFIX/bin/gettext"; then
+
+ if test ! -d "gettext-0.14.1"; then
+ curl http://ftp.gnu.org/pub/gnu/gettext/gettext-0.14.1.tar.gz -O
+ tar xzf gettext-0.14.1.tar.gz
+ rm gettext-0.14.1.tar.gz
+ fi
+
+ cd gettext-0.14.1
+
+ ./configure --prefix=$PREFIX
+ make
+ make install
+ make clean
+
+ cd ..
+fi
+
+# glib2
+
+echo +++ processing glib2
+
+if test ! -f "$PREFIX/lib/libgobject-2.0.la"; then
+ if test ! -d "glib-2.4.1"; then
+ curl ftp://ftp.gtk.org/pub/gtk/v2.4/glib-2.4.1.tar.gz -O
+ tar xzf glib-2.4.1.tar.gz
+ rm glib-2.4.1.tar.gz
+ fi
+
+ cd glib-2.4.1
+
+ ./configure --prefix=$PREFIX
+ make
+ make install
+ make clean
+
+ cd ..
+fi
+
+# boehm gc, is now built-in (since 0.95)
+
+# icu ( http://oss.software.ibm.com/icu/index.html )
+
+echo +++ processing ICU
+
+if test ! -f "$PREFIX/lib/libicuuc.dylib.28.0"; then
+ if test ! -d "icu"; then
+ curl ftp://www-126.ibm.com/pub/icu/2.8/icu-2.8.tgz -O --disable-epsv
+ tar xzf icu-2.8.tgz
+ rm icu-2.8.tgz
+ fi
+
+ cd icu/source
+
+ ./runConfigureICU MacOSX --with-data-packaging=library --prefix=$PREFIX --libdir=$PREFIX/lib/
+ gnumake
+ make install
+ make clean
+
+ cd $PREFIX/lib
+
+ # libicudata
+ install_name_tool -id $PREFIX/lib/libicudata.dylib.28 libicudata.dylib.28.0
+
+ # libicui18n
+ install_name_tool -id $PREFIX/lib/libicui18n.dylib.28 libicui18n.dylib.28.0
+ install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicui18n.dylib.28.0
+ install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicui18n.dylib.28.0
+
+ # libicuio
+ install_name_tool -id $PREFIX/lib/libicuio.dylib.28 libicuio.dylib.28.0
+ install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicuio.dylib.28.0
+ install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicuio.dylib.28.0
+ install_name_tool -change libicui18n.dylib.28 $PREFIX/lib/libicui18n.dylib.28 libicuio.dylib.28.0
+
+ # libicule
+ install_name_tool -id $PREFIX/lib/libicule.dylib.28 libicule.dylib.28.0
+ install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicule.dylib.28.0
+ install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicule.dylib.28.0
+
+ # libiculx
+ install_name_tool -id $PREFIX/lib/libiculx.dylib.28 libiculx.dylib.28.0
+ install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libiculx.dylib.28.0
+ install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libiculx.dylib.28.0
+ install_name_tool -change libicule.dylib.28 $PREFIX/lib/libicule.dylib.28 libiculx.dylib.28.0
+
+ # libicutoolutil
+ install_name_tool -id $PREFIX/lib/libicutoolutil.dylib.28 libicutoolutil.dylib.28.0
+ install_name_tool -change libicuuc.dylib.28 $PREFIX/lib/libicuuc.dylib.28 libicutoolutil.dylib.28.0
+ install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicutoolutil.dylib.28.0
+
+ # libicuuc
+ install_name_tool -id $PREFIX/lib/libicuuc.dylib.28 libicuuc.dylib.28.0
+ install_name_tool -change libicudata.dylib.28 $PREFIX/lib/libicudata.dylib.28 libicuuc.dylib.28.0
+
+ cd $INITIALDIR
+fi
+
+# mono
+
+echo +++ patching libintl to not be statically linked
+perl -pi -e "s/old_library='libintl.a'/old_library=''/" $PREFIX/lib/libintl.la
+echo +++ processing mono run-time libraries
+
+if test ! -f "$PREFIX/bin/mono"; then
+ if test ! -d "$INITIALDIR/Bootstrap"; then
+ mkdir $INITIALDIR/Bootstrap
+ fi
+ cd $INITIALDIR/Bootstrap
+
+ if test ! -d "mono-$VERSION"; then
+ curl http://www.go-mono.com/archive/beta3/mono-$VERSION.tar.gz -O
+ tar xzf mono-$VERSION.tar.gz
+ rm mono-$VERSION.tar.gz
+ fi
+
+ cd mono-$VERSION
+
+ ./configure --prefix=$PREFIX
+ make
+ make install
+ make clean
+
+ cd ..
+fi
+
+# setup the Current symlink
+
+cd /Library/Frameworks/Mono.framework/Versions
+
+if test -e "/Library/Frameworks/Mono.framework/Versions/Current"; then
+ rm Current
+fi
+ln -s $VERSION Current
+echo +++ Setup the rest of the framework
+cd /Library/Frameworks/Mono.framework
+ln -s Versions/Current/lib Libraries
+ln -s Versions/Current/include Headers
+ln -s Versions/Current/bin Commands
+for binfile in Commands/*; do
+ sudo rm -f /usr/bin/`echo $binfile | perl -pe 's/\.exe//' | perl -pe 's/Commands\///'`
+ sudo ln -s /Library/Frameworks/Mono.framework/`echo $binfile | perl -pe 's/\.exe//'` /usr/bin/`echo $binfile | perl -pe 's/\.exe//' | perl -pe 's/Commands\///'`
+done
+
+# update the installer source file
diff --git a/web/mono-build-w32.sh b/web/mono-build-w32.sh
index 28768d97df8..fe9d061fe51 100755
--- a/web/mono-build-w32.sh
+++ b/web/mono-build-w32.sh
@@ -16,6 +16,13 @@ test -z "$here" && here=`pwd`
echo "Building Mono and dependencies in $here, installing to $here/install"
PATH=$here/install/bin:$here/install/lib:$PATH
+export C_INCLUDE_PATH=$here/install/include
+
+# Make sure cygwin's libiconv is installed, or libtool blows its tiny mind
+if [ ! -f /usr/lib/libiconv.la ]; then
+ echo "You need to install the cygwin \"libiconv\" package!"
+ exit -1
+fi
# Check mono out first, so we can run aclocal from inside the mono dir (it
# needs to see which version of the real aclocal to run)
@@ -42,15 +49,28 @@ fi
cvs checkout mono || exit -1
-if [ ! -z "${AUTO_STABLE}" -o -e /usr/autotool/stable ]; then
- export AUTO_STABLE=${AUTO_STABLE:-/usr/autotool/stable}
- export AUTO_DEVEL=${AUTO_STABLE}
+echo "Checking automake version"
+automake_required="1.6.2"
+automake_version=`automake --version | head -1 | awk '{print $4}' | tr -d '[a-zA-Z]' | sed 's/-.*$//g'`
+echo "Found automake version $automake_version"
+if expr $automake_version \< $automake_required > /dev/null; then
+ echo "Your automake is too old! You need version $automake_required or newer."
+ exit -1
+else
+ echo "Automake version new enough."
fi
+# This causes libgc-not-found problem
+#
+## Select the stable version anyway...
+#if [ ! -z "${AUTO_STABLE}" -o -e /usr/autotool/stable ]; then
+# export AUTO_STABLE=${AUTO_STABLE:-/usr/autotool/stable}
+# export AUTO_DEVEL=${AUTO_STABLE}
+#fi
+
# Need to install pkgconfig and set ACLOCAL_FLAGS if there is not a
# pkgconfig installed already. Otherwise set PKG_CONFIG_PATH to the
-# glib we're about to install in $here/install. This script could
-# attempt to be clever and see if glib 2 is already installed, too.
+# glib we're about to install in $here/install.
# --print-ac-dir was added in 1.2h according to the ChangeLog. This
@@ -61,15 +81,17 @@ fi
# it finds two copies of the m4 macros). The GIMP for Windows
# pkgconfig sets its prefix based on the location of its binary, so we
# dont need PKG_CONFIG_PATH (the internal pkgconfig config file
-# $prefix is handled similarly).
+# $prefix is handled similarly). For the cygwin pkgconfig we do need to
+# set it, and we need to edit the mingw pc files too.
function aclocal_scan () {
# Quietly ignore the rogue '-I' and other aclocal flags that
# aren't actually directories...
#
# cd into mono/ so that the aclocal wrapper can work out which version
- # of aclocal to run
- for i in `(cd mono && aclocal --print-ac-dir)` $ACLOCAL_FLAGS
+ # of aclocal to run, and add /usr/share/aclocal too cos aclocal looks there
+ # too.
+ for i in `(cd mono && aclocal --print-ac-dir)` /usr/share/aclocal $ACLOCAL_FLAGS
do
if [ -f $i/$1 ]; then
return 0
@@ -79,6 +101,15 @@ function aclocal_scan () {
return 1
}
+function install_icuconfig() {
+ if [ ! -f $here/install/bin/icu-config ]; then
+ wget http://www.go-mono.com/archive/icu-config
+ mv icu-config $here/install/bin
+ chmod 755 $here/install/bin/icu-config
+ fi
+}
+
+
function install_package() {
zipfile=$1
markerfile=$2
@@ -96,12 +127,21 @@ function install_package() {
fi
}
-if ! aclocal_scan pkg.m4 ; then
- ACLOCAL_FLAGS="-I $here/install/share/aclocal $ACLOCAL_FLAGS"
+# pkgconfig is only used during the build, so we can use the cygwin version
+# if it exists
+if aclocal_scan pkg.m4 ; then
+ install_pkgconfig=no
+else
+ install_pkgconfig=yes
fi
-export PATH
-export ACLOCAL_FLAGS
+# This causes libgc-not-found problem
+#
+## But we still need to use the mingw libs for glib & co
+#ACLOCAL_FLAGS="-I $here/install/share/aclocal $ACLOCAL_FLAGS"
+
+#export PATH
+#export ACLOCAL_FLAGS
# Grab pkg-config, glib etc
if [ ! -d $here/install ]; then
@@ -110,19 +150,34 @@ fi
# Fetch and install pkg-config, glib, iconv, intl
-install_package pkgconfig-0.80-tml-20020101.zip bin/pkg-config.exe pkgconfig
-install_package glib-1.3.12-20020101.zip lib/libglib-1.3-12.dll glib
-install_package glib-dev-1.3.12-20020101.zip lib/glib-1.3.lib glib-dev
+if [ $install_pkgconfig = "yes" ]; then
+ install_package pkgconfig-0.11-20020310.zip bin/pkg-config.exe pkgconfig
+else
+ echo "Not installing pkgconfig, you already seem to have it installed"
+fi
+install_package glib-2.0.4-20020703.zip lib/libglib-2.0-0.dll glib
+install_package glib-dev-2.0.4-20020703.zip lib/glib-2.0.lib glib-dev
install_package libiconv-1.7.zip lib/iconv.dll iconv
-install_package libiconv-dev-1.7.zip lib/iconv.lib iconv-dev
install_package libintl-0.10.40-20020101.zip lib/libintl-1.dll intl
install_package libgc-dev.zip lib/gc.dll gc-dev
+install_package icu-2.6.1-Win32_msvc7.zip icu/bin/icuuc26.dll icu
+
+install_icuconfig
+
+if [ $install_pkgconfig = "no" ]; then
+ echo "Fixing up the pkgconfig paths"
+ for i in $here/install/lib/pkgconfig/*.pc
+ do
+ mv $i $i.orig
+ sed -e "s@^prefix=/target\$@prefix=$here/install@" < $i.orig > $i
+ done
+ export PKG_CONFIG_PATH=$here/install/lib/pkgconfig
+fi
-# Needed to find the libiconv bits
-CPPFLAGS="$CPPFLAGS -I$here/install/include"
-LDFLAGS="$LDFLAGS -L$here/install/lib"
-export CPPFLAGS
-export LDFLAGS
+# Needed to find the libgc bits
+export CFLAGS="-I $here/install/include -I $here/install/icu/include"
+export LDFLAGS="-L$here/install/lib -L$here/install/icu/lib"
+export PATH="$here/install/icu/bin:$PATH"
# Make sure we build native w32, not cygwin
#CC="gcc -mno-cygwin"
diff --git a/web/mono-build.sh b/web/mono-build.sh
index 10878bf2780..17b604cc273 100755
--- a/web/mono-build.sh
+++ b/web/mono-build.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! /usr/bin/env bash
# Script to automate the building of mono and its dependencies.
# Relies on wget being installed (could make it fall back to using
@@ -17,6 +17,44 @@ echo "Building Mono and dependencies in $here, installing to $here/install"
PATH=$here/install/bin:$PATH
LD_LIBRARY_PATH=$here/install/lib:$LD_LIBRARY_PATH
+# Find a tool to fetch files. It must take an HTTP URL on the command line and
+# save the file in the current directory. (It must also talk HTTP/1.1, which
+# rules out BSD's ftp(1), at least on FreeBSD 4.4.)
+viable_downloaders="wget fetch"
+for i in $viable_downloaders
+do
+ if which $i > /dev/null; then
+ downloader=`which $i`
+ break
+ fi
+done
+
+if [ -z "$downloader" ]; then
+ echo "Can't find a commandline download tool (tried: $viable_downloaders)"
+ exit -1
+else
+ echo "Using $downloader to fetch files"
+fi
+
+# We need to prefer GNU make if there's a choice. BSD make falls over in
+# the glib build if gtk-doc is disabled.
+viable_makers="gmake make"
+for i in $viable_makers
+do
+ if which $i > /dev/null; then
+ MAKE=$i
+ break
+ fi
+done
+
+if [ -z "$MAKE" ]; then
+ echo "Can't find a make tool (tried: $viable_makers)"
+ exit -1
+else
+ echo "Using $MAKE"
+ export MAKE
+fi
+
# Need to install pkgconfig and set ACLOCAL_FLAGS if there is not a
# pkgconfig installed already. Otherwise set PKG_CONFIG_PATH to the
# glib we're about to install in $here/install. This script could
@@ -64,14 +102,14 @@ function install_package() {
echo "Installing $name..."
if [ ! -f $here/$tarfile ]; then
- wget http://www.go-mono.org/archive/$tarfile
+ (cd $here && $downloader http://www.go-mono.com/archive/$tarfile)
fi
# Assume that the package built correctly if the dir is there
if [ ! -d $here/$dirname ]; then
# Build and install package
- tar xzf $here/$tarfile || exit -1
- (cd $here/$dirname; ./configure --prefix=$here/install $configure_options || exit -1; make || exit -1; make install || exit -1)
+ (cd $here && tar xzf $tarfile) || exit -1
+ (cd $here/$dirname; ./configure --prefix=$here/install $configure_options || exit -1; $MAKE || exit -1; $MAKE install || exit -1)
success=$?
if [ $success -ne 0 ]; then
echo "***** $name build failure. Run rm -rf $here/$dirname to have this script attempt to build $name again next time"
@@ -113,12 +151,45 @@ export LD_LIBRARY_PATH
export ACLOCAL_FLAGS
export PKG_CONFIG_PATH
-CPPFLAGS="$CPPFLAGS -I$here/install/include"
-LDFLAGS="$LDFLAGS -L$here/install/lib"
+# Freebsd puts iconv in /usr/local, so see if we need to add
+# /usr/local/include and /usr/local/lib to CPPFLAGS and LDFLAGS. We could
+# skip this if it would add /usr/include and /usr/lib, but leaving it
+# shouldnt break anything.
+#
+# Actually, it does break stuff :-( gcc 3.2 prints gratuitous warnings
+# and configure fails to find header files because of this cpp output.
+
+if [ ! -f /usr/include/iconv.h ]; then
+ iconvdirs="/usr/local/include"
+ for i in $iconvdirs
+ do
+ if [ -f $i/iconv.h ]; then
+ iconvh_dir=$i
+ break
+ fi
+ done
+
+ if [ -z "$iconvh_dir" ]; then
+ echo "Can't find iconv headers (looked in $iconvdirs)"
+ exit -1
+ fi
+
+ iconvlib_dir=`echo $iconvh_dir | sed -e 's/include/lib/'`
+
+ echo "Adding $iconvh_dir to CPPFLAGS"
+ echo "Adding $iconvlib_dir to LDFLAGS"
+
+ CPPFLAGS="$CPPFLAGS -I$here/install/include -I$iconvh_dir"
+ LDFLAGS="$LDFLAGS -L$here/install/lib -L$iconvlib_dir"
+else
+ CPPFLAGS="$CPPFLAGS -I$here/install/include"
+ LDFLAGS="$LDFLAGS -L$here/install/lib"
+fi
+
export CPPFLAGS
export LDFLAGS
-# Grab pkg-config-0.8, glib-1.3.12 if necessary
+# Grab pkg-config, glib and libgc if necessary
if [ $install_pkgconfig = "yes" ]; then
install_package pkgconfig-0.8.0.tar.gz pkgconfig-0.8.0 pkgconfig ""
@@ -127,16 +198,16 @@ else
fi
if [ $install_glib = "yes" ]; then
- install_package glib-1.3.13.tar.gz glib-1.3.13 glib ""
+ install_package glib-2.0.6.tar.gz glib-2.0.6 glib ""
else
echo "Not installing glib, you already seem to have it installed"
fi
if [ $install_libgc = "yes" ]; then
- LIBS="-ldl" install_package gc6.0.tar.gz gc6.0 libgc "--enable-threads=pthreads"
+ install_package gc6.1alpha5.tar.gz gc6.1alpha5 libgc "--enable-threads=pthreads"
# make install didnt do the headers!
mkdir -p $here/install/include/gc
- cp -r $here/gc6.0/include/* $here/install/include/gc
+ cp -r $here/gc6.1alpha5/include/* $here/install/include/gc
else
echo "Not installing libgc, you already seem to have it installed"
fi
@@ -166,12 +237,12 @@ elif [ ${CVSROOT:0:9} = ":pserver:" ]; then
fi
fi
-cvs checkout mono || exit -1
+(cd $here && cvs checkout mono) || exit -1
# Build and install mono
echo "Building and installing mono"
-(cd $here/mono; ./autogen.sh --prefix=$here/install || exit -1; make || exit -1; make install || exit -1) || exit -1
+(cd $here/mono; ./autogen.sh --prefix=$here/install || exit -1; $MAKE || exit -1; $MAKE install || exit -1) || exit -1
echo ""
diff --git a/web/mono-common-problems b/web/mono-common-problems
deleted file mode 100644
index b528a6cebed..00000000000
--- a/web/mono-common-problems
+++ /dev/null
@@ -1,160 +0,0 @@
- Common Problems with Mono (see the bottom)
- ------------------------------------------
-
-
- (c) 2002, Jaime Anguiano Olarra
- <jaime@geneura.ugr.es>
-
-
-Getting it:
-
- There are several ways to get Mono running on your computer.
- Although the purpose of this document I will add some info
- here for completness. After all you need the software if you
- want to get in trouble :).
-
- RPMs or DEBs can be found at Baselabs <a href="http://mono.baselabs.org/index.php/software">http://mono.baselabs.org/index.php/software</a>.
-
- See <a href="http://www.go-mono.com/download">http://www.go-mono.com/download</a> for more information.
-
-Installing it:
-
- Here comes the real fun. This is what some people have claimed for as
- a 'foolproff way to get started'.
-
- First, assume you have the packages.
- You must know that:
-
- 1.- Mono can be compiled in Linux and Windows but mcs
- cannot. Please don't write to the list telling that
- you have downloaded the mcs-X.XX.tar.gz and that
- you can't build it. It's a 'status' problem. The
- mcs compiler can't be compiled under Linux yet.
- This means, entering in mcs-X.XX and running 'make'
- will show you something as:
-
- [jaime@localhost mcs-0.12]$ make
- for i in jay nant mcs class nunit tools; do
- \ (cd $i; make linux) || exit 1; \
- done
- make[1]: Cambiando a directorio `/home/jaime/utils/mcs-0.12/jay'
- make[1]: No se hace nada para `linux'.
- make[1]: Saliendo directorio `/home/jaime/utils/mcs-0.12/jay'
- make[1]: Cambiando a directorio `/home/jaime/utils/mcs-0.12/nant'
- csc /out:NAnt.exe /recurse:*.cs
- /bin/sh: csc: command not found
- make[1]: *** [NAnt.exe] Error 127
- make[1]: Saliendo directorio `/home/jaime/utils/mcs-0.12/nant'
- make: *** [linux] Error 1
-
-
- 2.- You need to get the packages refered in the Mono
- download page. These are: glib 1.3, pkgconfig...
-
- Second, read all the READMEs and INSTALLs.
-
- For short, you will normally will be able to install the RPMs and DEBs as
- usual:
-
- rpm -Uhv mono-X.XX_baselabs-XXXXXXXX.rpm
-
- See the BaseLabs page for a full explanation.
-
- Building your own binaries it's easy too!.
- Unzip and untar the tarball (will work only for Mono, remember!!)
-
- tar -zxvf mono-X.XX.tar.gz
-
- Enter the directory where the sources reside:
-
- cd mono-X.XX
-
- Run the configure script:
-
- ./configure.in
-
- Then make the package:
-
- make
-
- Now you are able to install it:
-
- make install
-
- Remember once again. mcs cannot be compiled under Linux. You need a Windows system
- where to build it. The only way for you to get the mcs in Linux without building
- it by your own in a Windows machine (including the VMWare alternative) is to install
- the binaries from the BaseLabs page. It's also important to say that there are
- NUnit packages too in that site but that you probably won't need to care about that
- if you are reading this document.
-
-Running it:
-
- If you want to compile a little program using the mcs, let's say "konnichiwa.cs"
- do this:
-
- mcs konnichiwa.cs
-
- The output will depend on wether your program is compilable or not, if it is a
- "RESULT: 0" will be printed in your gnome-terminal (or whatever 'console' you use).
- You should see a file called "konnichiwa.exe" in the same directory (folder) where
- the source (konnichiwa.cs) is.
-
- To run the binary you have to options. The most used is:
-
- mono konnichiwa.exe
-
- but it might be better to use this other approach instead (calling the interpreter):
-
- mint konnichiwa.exe
-
- That's it. The Mono mcs compiler allows you to perform more complicated compilations
- and I will show an example using three source files. Suppose you have three files:
- person.cs, employee.cs, Test.cs. The first one could contain an abstract class Person
- while the second one could be the source for a concrete class derived from Person and
- called Employee. The last one, Test.cs could be a simple class to show how the classes
- work and it contains an entry point (the Main() method, signed with the appropiate
- attributes 'public static' and the correct type 'void'). Then you could get the
- Text.exe program by calling:
-
- mcs Test.cs person.cs employee.cs
-
- You might want to see my slides, source code and other material from the course on
- CSharp I am preparing to teach at the University of Granada, Spain. If you are a newbie
- HTH.
-
-A note about problems:
-
- First see the <a href="http://bugzilla.ximian.com">Ximian Bugzilla</a> page in order
- to get know if the bug has already been reported.
-
- Second, read this document.
-
- Third, visit the mono mailing lists' archives and do a little research in there for
- threads talking about the problems you are having.
-
- Fourth if you still cannot override the problem, contact the lists.
-
-Known problems:
-
- 1.- mcs fails to compile in Linux.
-
- sol. mcs cannot compile in Linux. Try to install the already made packages
- from http://mono.baselabs.org/index.php/software
-
- 2.- mono fails to compile in my Linux box.
-
- sol. Uhg... a generic 'question'. Proceed as above. (note for geeks: GOTO: 1.-)
-
- 3.- I cannot install mono under RedHat 7.3.
-
- sol. Try to upgrade your libc6 packages. In general, check that you have the
- right versions for the packages glib, pkgconfig, libc...
-
- 4.- I cannot compile mcs nor mono under Windows. Are you fooling me?.
-
- sol. No, we are not. Have you read carefully the <a href="http://www.go-mono.com">download</a>
- page?. You need CygWin among other things. Check all of that before
- trying to compile.
-
-
diff --git a/web/mono-contribution-howto b/web/mono-contribution-howto
index 7a48fcd32aa..ea3a4eaae53 100644
--- a/web/mono-contribution-howto
+++ b/web/mono-contribution-howto
@@ -1,9 +1,10 @@
<Mono newbie coders start file>
+ <h1> A little help for mono newbie coders </h1>
For those who are new to Mono and are impatient to contribute
- with code (uhh... you are brave!!) here is the document you
+ with code (uhh... you are brave!!) here is the document you
should read.
@@ -15,118 +16,128 @@
* Start with the NUnit Tests Guidelines. In the cvs
they are located at: mcs/class/doc/NUnitGuideli...
- But wait, this is a document for impatient
+ * But wait, this is a document for impatient
people. So EVERYTHING should be here. Well, it is.
</ul>
--------------------- cut here --------------------
-Mono NUnit Test Guidelines and Best Practices
+ <h2> The NUnit Tests Guidelines document </h2>
-Authors: Nick Drochak <ndrochak@gol.com>
- Martin Baulig <martin@gnome.org>
-Last Update: 2002-03-02
-Rev: 0.3
+ Mono NUnit Test Guidelines and Best Practices
-* Purpose
+ Authors: Nick Drochak <ndrochak@gol.com>
+ Martin Baulig <martin@gnome.org>
+ Last Update: 2002-03-02
+ Rev: 0.3
-This document captures all the good ideas people have had about
-writing NUnit tests for the mono project. This document will be useful
-for anyone who writes or maintains unit tests.
+ <b> Purpose </b>
+
+ This document captures all the good ideas people have had
+ about writing NUnit tests for the mono project. This document
+ will be useful for anyone who writes or maintains unit tests.
+
+ <b> Other resources </b>
-* Other resources
- mcs/class/README has an explanation of the build process and
how it relates to the tests.
- - http://nunit.sourceforge.net is the place to find out about NUnit
+ - http://nunit.sourceforge.net is the place to find out about
+ NUnit
-* Getting Started
+ <b> Getting Started </b>
-If you are new to writing NUnit tests, there is a template you may use
-to help get started. The file is:
+ If you are new to writing NUnit tests, there is a template
+ you may use to help get started. The file is:
mcs/class/doc/TemplateTest.cs
- (2.- This is the point two!. This file is just after the end of the
- guidelines. Copy/paste it in another buffer. And keep reading.)
+ (2.- This is the point two!. This file is just after the end
+ of the guidelines. Copy/paste it in another buffer. And keep
+ reading.)
+ Save a copy of this file in the appropriate test subdirecty
+ (see below), and replace all the [text] markers with
+ appropriate code. Comments in the template are there to guide
+ you. You should also look at existing tests to see how other
+ people have written them.
-Save a copy of this file in the appropriate test subdirecty (see
-below), and replace all the [text] markers with appropriate
-code. Comments in the template are there to guide you. You should also
-look at existing tests to see how other people have written them.
-mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs is a
-small one that might help.
+ mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
- (3.- You reached the third point. And as expected, it's just here to
- tell you that the content of CollectionBaseTest.cs is after the
- TemplateTest.cs code at the end of these guidelines.)
+ is a small one that might help.
-The directory that will contain your new file depends on the
-assembly/namespace of the class for which you are creating the
-tests. Under mcs/class there is a directory for each assembly. In each
-assembly there is a Test directory, e.g. mcs/class/corlib/Test. In the
-Test directory there are sub-directories for each namespace in the
-assembly, e.g. mcs/class/corlib/Test/Sytem. Put your new test file in
-the appropriate sub-directory under Test for the class you are
-testing.
+ (3.- You reached the third point. And as expected, it's just
+ here to tell you that the content of CollectionBaseTest.cs is
+ after the TemplateTest.cs code at the end of these
+ guidelines.)
-Once your test class is complete, you need to add it to the
-AllTests.cs file in the same directory as your new test. Add a call to
-"suite.AddTest()" passing the name of your new test class's suite
-property as the parameter. You will see examples in the AllTests.cs
-file, so just copy and paste inside there.
+ The directory that will contain your new file depends on the
+ assembly/namespace of the class for which you are creating the
+ tests. Under mcs/class there is a directory for each assembly.
+ In each assembly there is a Test directory, e.g.
+ mcs/class/corlib/Test. In the Test directory there are
+ sub-directories for each namespace in the assembly, e.g.
+ mcs/class/corlib/Test/Sytem. Put your new test file in the
+ appropriate sub-directory under Test for the class you are
+ testing.
-Once all of that is done, you can do a 'make test' from the top mcs
-directory. Your test class will be automagically included in the
-build and the tests will be run along with all the others.
+ Once your test class is complete, you need to add it to the
+ AllTests.cs file in the same directory as your new test. Add a
+ call to "suite.AddTest()" passing the name of your new test
+ class's suite property as the parameter. You will see examples
+ in the AllTests.cs file, so just copy and paste inside there.
-* Tips
+ Once all of that is done, you can do a 'make test' from the top
+ mcs directory. Your test class will be automagically included
+ in the build and the tests will be run along with all the
+ others.
-** Provide an unique error message for Assert()
+ <b> Tips </b>
-Include an unique message for each Assert() so that when the assert
-fails, it is trivial to locate the failing one. Otherwise, it may be
-difficult to determine which part of the test is failing. A good way
-to ensure unique messages is to use something like #A01, #A02 etc.
+ <b> Provide an unique error message for Assert() </b>
- Bad:
+ Include an unique message for each Assert() so that when the
+ assert fails, it is trivial to locate the failing one.
+ Otherwise, it may be difficult to determine which part of the
+ test is failing. A good way to ensure unique messages is to use
+ something like #A01, #A02 etc.
+
+ Bad:
<pre>
AssertEquals("array match", compare[0], i1[0]);
AssertEquals("array match", compare[1], i1[1]);
AssertEquals("array match", compare[2], i1[2]);
AssertEquals("array match", compare[3], i1[3]);
</pre>
- Good:
+ Good:
<pre>
AssertEquals("#A01", compare[0], i1[0]);
AssertEquals("#A02", compare[1], i1[1]);
AssertEquals("#A03", compare[2], i1[2]);
AssertEquals("#A04", compare[3], i1[3]);
</pre>
-Once you used such a number in an Assert(), don't change it later on -
-people might use it it identify the test in bug reports or in mailing
-lists.
+ Once you used such a number in an Assert(), don't change it
+ later on - people might use it it identify the test in bug
+ reports or in mailing lists.
-** Use AssertEquals() to compare things, not Assert().
+ <b> Use AssertEquals() to compare things, not Assert(). </b>
-Never compare two values with Assert() - if the test fails, people
-have no idea what went wrong while AssertEquals() reports the failed
-value.
+ Never compare two values with Assert() - if the test fails,
+ people have no idea what went wrong while AssertEquals()
+ reports the failed value.
- Bad:
+ Bad:
<pre>
Assert ("A01", myTicks[0] == t1.Ticks);
</pre>
- Good:
+ Good:
<pre>
AssertEquals ("A01", myTicks[0], t1.Ticks);
</pre>
-** Constructors
+ <b> Constructors </b>
-When writing your testcase, please make sure to provide a constructor
-which takes no arguments:
+ When writing your testcase, please make sure to provide a
+ constructor which takes no arguments:
<pre>
public class DateTimeTest : TestCase
@@ -145,7 +156,7 @@ which takes no arguments:
}
</pre>
-* Namespace
+ <b> Namespace </b>
Please keep the namespace within each test directory
consistent - all tests which are referenced in the same
@@ -157,7 +168,7 @@ which takes no arguments:
and you have a subdirectory called "System", you can put all
the tests in that dir into namespace "MonoTests.System".
-* Test your test with the microsoft runtime
+ <b> Test your test with the microsoft runtime </b>
If possible, try to run your testsuite with the Microsoft
runtime on Windows and make sure all tests in it pass. This is
@@ -177,51 +188,53 @@ which takes no arguments:
we'll forward this to the Microsoft people from time to time
to help them fix their documentation and runtime.
--------------------- cut here ------------------------
-
<pre>
-------------------- TemplateTest.cs begins ----------
-// this is a template for making NUnit tests. Text enclosed in square
-// brackets (and the brackets themselves) should be replaced by appropiate
-// code.
-
-// [File Name].cs - NUnit Test Cases for [explain here]
-//
-// [Author Name] ([Author email Address])
-//
-// (C) [Copyright holder]
-//
-
-// these are the standard namespaces you will need. You may need to add more
-// depending on your tests.
-using NUnit.Framework;
-using System;
-
-// all test namespaces start with "MonoTests." Append the Namespace that
-// contains the class you are testing, e.g. MonoTests.System.Collections
-namespace MonoTests.[Namespace]
-{
-
-// the class name should end with "Test" and start with the name of the class
-// you are testing, e.g. CollectionBaseTest
-public class [Class to be tested]Test : TestCase {
+ // this is a template for making NUnit tests. Text enclosed
+ // in square brackets (and the brackets themselves) should be
+ // replaced by appropiate code.
+
+ // [File Name].cs - NUnit Test Cases for [explain here]
+ //
+ // [Author Name] ([Author email Address])
+ //
+ // (C) [Copyright holder]
+ //
+
+ // these are the standard namespaces you will need. You may
+ // need to add more depending on your tests.
+ using NUnit.Framework;
+ using System;
+
+ // all test namespaces start with "MonoTests." Append the
+ // Namespace that contains the class you are testing, e.g.
+ // MonoTests.System.Collections
+ namespace MonoTests.[Namespace]
+ {
+
+ // the class name should end with "Test" and start with the name
+ // of the class you are testing, e.g. CollectionBaseTest
+ public class [Class to be tested]Test : TestCase {
- // there should be two constructors for your class. The first one
- // (without parameters) should set the name to something unique.
- // Of course the name of the method is the same as the name of the
- // class
+ // there should be two constructors for your class. The first
+ // one (without parameters) should set the name to something
+ // unique.
+ // Of course the name of the method is the same as the name of
+ // the class
public [Constructor]() : base ("[Namespace.Class]") {}
public [Constructor](string name) : base(name) {}
- // this method is run before each Test* method is called. You can put
- // variable initialization, etc. here that is common to each test.
+ // this method is run before each Test* method is called. You
+ // can put variable initialization, etc. here that is common to
+ // each test.
// Just leave the method empty if you don't need to use it.
protected override void SetUp() {}
- // this method is run after each Test* method is called. You can put
- // clean-up code, etc. here. Whatever needs to be done after each test.
- // Just leave the method empty if you don't need to use it.
+ // this method is run after each Test* method is called. You
+ // can put clean-up code, etc. here. Whatever needs to be done
+ // after each test. Just leave the method empty if you don't need
+ // to use it.
protected override void TearDown() {}
// this property is required. You need change the parameter for
@@ -232,159 +245,181 @@ public class [Class to be tested]Test : TestCase {
}
}
- // this is just one of probably many test methods in your test class.
- // each test method must start with "Test". All methods in your class
- // which start with "Test" will be automagically called by the NUnit
- // framework.
+ // this is just one of probably many test methods in your test
+ // class. each test method must start with "Test". All methods
+ // in your class which start with "Test" will be automagically
+ // called by the NUnit framework.
public void Test[Something] {
- // inside here you will exercise your class and then call Assert()
+ // inside here you will exercise your class and then
+ // call Assert()
}
}
---------------------- TemplateTest.cs ends --------------
+
---------------------- CollectionBaseTest.cs begins ------
-//
-// System.Collections.CollectionBase
-// Test suite for System.Collections.CollectionBase
-//
-// Author:
-// Nick D. Drochak II
-//
-// (C) 2001 Nick D. Drochak II
-//
-
-
-using System;
-using System.Collections;
-using NUnit.Framework;
-
-namespace MonoTests.System.Collections
-{
-
-public class CollectionBaseTest : TestCase
-{
- public CollectionBaseTest () : base ("System.Collection.CollectionBase testsuite") {}
- public CollectionBaseTest (String name) : base (name) {}
-
- // We need a concrete class to test the abstract base class
- public class ConcreteCollection : CollectionBase
+ //
+ // System.Collections.CollectionBase
+ // Test suite for System.Collections.CollectionBase
+ //
+ // Author:
+ // Nick D. Drochak II
+ //
+ // (C) 2001 Nick D. Drochak II
+ //
+
+
+ using System;
+ using System.Collections;
+ using NUnit.Framework;
+
+ namespace MonoTests.System.Collections
+ {
+
+ public class CollectionBaseTest : TestCase
{
- // These fields are used as markers to test the On* hooks.
- public bool onClearFired;
- public bool onClearCompleteFired;
-
- public bool onInsertFired;
- public int onInsertIndex;
- public bool onInsertCompleteFired;
- public int onInsertCompleteIndex;
-
- public bool onRemoveFired;
- public int onRemoveIndex;
- public bool onRemoveCompleteFired;
- public int onRemoveCompleteIndex;
-
- public bool onSetFired;
- public int onSetOldValue;
- public int onSetNewValue;
- public bool onSetCompleteFired;
- public int onSetCompleteOldValue;
- public int onSetCompleteNewValue;
-
- // This constructor is used to test OnValid()
- public ConcreteCollection()
+ public CollectionBaseTest () : base
+ ("System.Collection.CollectionBase testsuite")
+ {}
+ public CollectionBaseTest (String name) : base (name)
+ {}
+
+ // We need a concrete class to test the abstract base
+ // class
+ public class ConcreteCollection : CollectionBase
{
- IList listObj;
- listObj = this;
- listObj.Add(null);
- }
+ // These fields are used as markers to test
+ // the On* hooks.
+ public bool onClearFired;
+ public bool onClearCompleteFired;
+
+ public bool onInsertFired;
+ public int onInsertIndex;
+ public bool onInsertCompleteFired;
+ public int onInsertCompleteIndex;
+
+ public bool onRemoveFired;
+ public int onRemoveIndex;
+ public bool onRemoveCompleteFired;
+ public int onRemoveCompleteIndex;
+
+ public bool onSetFired;
+ public int onSetOldValue;
+ public int onSetNewValue;
+ public bool onSetCompleteFired;
+ public int onSetCompleteOldValue;
+ public int onSetCompleteNewValue;
+
+ // This constructor is used to test OnValid()
+ public ConcreteCollection()
+ {
+ IList listObj;
+ listObj = this;
+ listObj.Add(null);
+ }
- // This constructor puts consecutive integers into the list
- public ConcreteCollection(int i) {
- IList listObj;
- listObj = this;
+ // This constructor puts consecutive integers into the list
+ public ConcreteCollection(int i) {
+ IList listObj;
+ listObj = this;
- int j;
- for (j = 0; j< i; j++) {
- listObj.Add(j);
+ int j;
+ for (j = 0; j< i; j++) {
+ listObj.Add(j);
+ }
}
- }
- // A helper method to look at a value in the list at a specific index
- public int PeekAt(int index)
- {
- IList listObj;
- listObj = this;
- return (int) listObj[index];
- }
+ // A helper method to look at a value in the
+ // list at a specific index
+ public int PeekAt(int index)
+ {
+ IList listObj;
+ listObj = this;
+ return (int) listObj[index];
+ }
- // Mark the flag if this hook is fired
- protected override void OnClear() {
- this.onClearFired = true;
- }
+ // Mark the flag if this hook is fired
+ protected override void OnClear() {
+ this.onClearFired = true;
+ }
- // Mark the flag if this hook is fired
- protected override void OnClearComplete()
- {
- this.onClearCompleteFired = true;
- }
+ // Mark the flag if this hook is fired
+ protected override void OnClearComplete()
+ {
+ this.onClearCompleteFired = true;
+ }
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsert(int index, object value)
- {
- this.onInsertFired = true;
- this.onInsertIndex = index;
- }
+ // Mark the flag, and save the paramter if
+ // this hook is fired
+ protected override void OnInsert(int index,
+ object value)
+ {
+ this.onInsertFired = true;
+ this.onInsertIndex = index;
+ }
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnInsertComplete(int index, object value)
- {
- this.onInsertCompleteFired = true;
- this.onInsertCompleteIndex = index;
- }
+ // Mark the flag, and save the paramter if
+ // this hook is fired
+ protected override void OnInsertComplete(int index,
+ object value)
+ {
+ this.onInsertCompleteFired = true;
+ this.onInsertCompleteIndex = index;
+ }
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemove(int index, object value)
- {
- this.onRemoveFired = true;
- this.onRemoveIndex = index;
- }
+ // Mark the flag, and save the paramter if this hook
+ // is fired
+ protected override void OnRemove(int index,
+ object value)
+ {
+ this.onRemoveFired = true;
+ this.onRemoveIndex = index;
+ }
- // Mark the flag, and save the paramter if this hook is fired
- protected override void OnRemoveComplete(int index, object value)
- {
- this.onRemoveCompleteFired = true;
- this.onRemoveCompleteIndex = index;
- }
+ // Mark the flag, and save the paramter if this hook
+ // is fired
+ protected override void OnRemoveComplete(int index,
+ object value)
+ {
+ this.onRemoveCompleteFired = true;
+ this.onRemoveCompleteIndex = index;
+ }
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSet(int index, object oldValue, object newValue)
- {
- this.onSetFired = true;
- this.onSetOldValue = (int) oldValue;
- this.onSetNewValue = (int) newValue;
- }
+ // Mark the flag, and save the paramters if this hook
+ // is fired
+ protected override void OnSet(int index, object oldValue,
+ object newValue)
+ {
+ this.onSetFired = true;
+ this.onSetOldValue = (int) oldValue;
+ this.onSetNewValue = (int) newValue;
+ }
- // Mark the flag, and save the paramters if this hook is fired
- protected override void OnSetComplete(int index, object oldValue, object newValue)
- {
- this.onSetCompleteFired = true;
- this.onSetCompleteOldValue = (int) oldValue;
- this.onSetCompleteNewValue = (int) newValue;
- }
- } // public class ConcreteCollection
+ // Mark the flag, and save the paramters if this hook
+ // is fired
+ protected override void OnSetComplete(int index,
+ object oldValue,
+ object newValue)
+ {
+ this.onSetCompleteFired = true;
+ this.onSetCompleteOldValue = (int) oldValue;
+ this.onSetCompleteNewValue = (int) newValue;
+ }
+ } // public class ConcreteCollection
- public static ITest Suite {
- get {
- return new TestSuite (typeof(CollectionBaseTest));
+ public static ITest Suite {
+ get {
+ return new TestSuite
+ (typeof(CollectionBaseTest));
+ }
}
- }
- // Check the count property
- public void TestCount() {
- ConcreteCollection myCollection;
- myCollection = new ConcreteCollection(4);
- Assert(4 == myCollection.Count);
- }
+ // Check the count property
+ public void TestCount() {
+ ConcreteCollection myCollection;
+ myCollection = new ConcreteCollection(4);
+ Assert(4 == myCollection.Count);
+ }
// Make sure GetEnumerator returns an object
public void TestGetEnumerator() {
@@ -480,26 +515,37 @@ public class CollectionBaseTest : TestCase
}
----------------------- CollectionBaseTest.cs ends --------
+
</pre>
<ul>
- * If you use Emacs, you might want to use the .emacs file and the
- package developed by Brad Merrill mailto:zbrad@cybercom.net. It
- will allow you to highlight and indent in C# style in your Emacs
- editor. (XEmacs will still work but it'll also complain).
-
- * CSharpDevelop is a GPLed IDE developed by IC#Code. Search for it
- at sourceforge if you are interested in it.
-
- * For those who Java: "A comparison of Microsoft's C# programming
- language to Sun Microsystem's Java Programming language" by Dare
- Obasanjo is a really good (very complete) text to read.
-
- * Suggest this point and more, now I can't think of anything more.
+ * If you use Emacs, you might want to use the .emacs
+ file and the package developed by Brad Merrill
+ mailto:zbrad@cybercom.net. It will allow you to
+ highlight and indent in C# style in your Emacs
+ editor. (XEmacs will still work but it'll also
+ complain).
+
+ * CSharpDevelop is a GPLed IDE developed by IC#Code.
+ Search for it at sourceforge if you are interested
+ in it.
+
+ * For those who Java: "A comparison of Microsoft's
+ C# programming language to Sun Microsystem's Java
+ Programming language" by Dare Obasanjo is a really good
+ (very complete) text to read.
+
+ * Suggest this point and more, now I can't think of
+ anything more.
</ul>
Enjoy!!.
- (c) Jaime Anguiano Olarra.
+ (c) 2002, <a href="mailto:jaime@geneura.ugr.es">Jaime Anguiano Olarra</a>.
+
+ The parts included in this document are property of their
+ respective authors.
- The parts included in this document are property of their respective authors.
+ Note: The identation of the source code has been changed a bit
+ so it could fit better in the website. Anyway, as nothing more
+ changed, the files should work as expected.
diff --git a/web/mono-hacking-roadmap.html b/web/mono-hacking-roadmap.html
new file mode 100644
index 00000000000..134a1d42541
--- /dev/null
+++ b/web/mono-hacking-roadmap.html
@@ -0,0 +1,312 @@
+<html>
+<head><title>Mono Hacking Roadmap</title>
+<style type="text/css">
+h1 {
+color: #efefef;
+font-size: 18pt;
+font-family: "Trebuchet MS";
+border: 0;
+margin: 0;
+padding: 1em;
+background: #666666;
+}
+
+h2, h3, h4, h5, h6 {
+font-family: Verdana,sans-serif;
+font-weight: bold;
+margin: 9pt;
+}
+
+h2, h3 {
+font-size: 18px;
+}
+
+h2 {
+padding: 3px;
+color: #000000;
+}
+
+h3 {
+font-size: 13px;
+border-bottom: 2px solid #dddddd;
+}
+
+h4 {
+border-bottom: 2px solid #dddddd;
+}
+
+body, table {
+background-color: #ffffff;
+font-family: Verdana, sans-serif; font-size: 12px;
+color: black;
+margin: 0;
+padding: 0;
+border: 0;
+ margin-left: 20%;
+ margin-right: 20%;
+}
+
+p {
+margin-left: 2em;
+margin-right: 2em;
+}
+
+ul li {
+margin-left: 2em;
+}
+
+img {
+border: 0;
+vertical-align: top;
+}
+
+</style>
+</head>
+<body>
+<center>
+ <h1>
+ Mono Hacking Roadmap
+ <br>
+
+ <font size=1>Miguel de Icaza (<a href="mailto:miguel@ximian.com">miguel@ximian.com</a>)</font>
+
+ </h1>
+ <p>
+</center>
+
+<h3>Introductory notes</h3>
+
+ <p>The intention of this document and the <a
+ href="http://www.go-mono.com/mono-roadmap.html">Mono
+ Roadmap</a> is to be a basis for discussion. I want to build
+ on these two documents, and update as we get more insight into
+ the release process and the technologies we want to ship.
+
+<h3>Background</h3>
+
+ <p>At the 2003 PDC Microsoft introduced many new technologies,
+ which many of us are very excited about. To me, it underlined
+ the importance of having a roadmap for users of Mono
+ technologies. That way they know precisely what to expect
+ from us when. We have been working on Mono for more than two
+ years, and it is important that we release a stable product to
+ the public.
+
+ <p>We have various degrees of maturity and feature
+ completeness in our code base, and I do not believe that we
+ should aim to be full implementation .NET 1.0 or .NET 1.1 in
+ our 1.0 release, that would just push the release at least for
+ another year . The <a
+ href="http://www.go-mono.com/mono-roadmap.html">Mono
+ Roadmap</a> emphasizes this assumption.
+
+ <p>The 1.0 release is critical for the adoption of Mono on the
+ Linux environment, even if it is not as complete as the
+ Framework, lets get something stable, and fun to people to
+ use.
+
+<h3>Mono 1.0: missing functionality.</h3>
+
+ <p>For the 1.0 release, there are a number of features that we
+ will have to complete, in no particular order:
+
+ <ul>
+ <li>We need to fix corcompare and our cor-compare
+ pages to support both 1.0 and 1.1 API API compares.
+
+ We might want to move this outside of the Mono site,
+ to reduce the complexity of the HTML hackage, and use
+ ASP.NET to implement this. Bonus points if we use
+ Piers' nice dynamic tree to load the CorCompare data
+ dynamically.
+
+ <li>Global Assembly Cache: Needed to support the
+ parallel installation of .NET 1.0 and 1.1 assemblies,
+ and to fix the various Assembly loading routines.
+
+ <li>PowerPC port.
+
+ <li>ECMA profile: We will like take care of this one
+ at Novell.
+
+ <li>Assembly signing: There are two ways to sign
+ assemblies.<br>
+
+ <b>StrongNames</b> - It is possible to sign
+ and verify strongname signatures using the
+ sn.exe security tool. This same tool can also
+ create the required key pairs to sign the
+ assemblies. What we are lacking:
+ <ul>
+ <li>The runtime doesn't check
+ strongname signatures (if present)
+ when loading an assembly outside the
+ GAC;
+ <li>sn.exe cannot be used to sign,
+ nor verify, an assembly that contains
+ the "ECMA public key";
+ <li>sn.exe doesn't support all options
+ to turn on/off runtime verification
+ for some assemblies;
+ <li>StrongNameIdentityPermission
+ support isn't complete as it depends
+ on CAS.
+ </ul>
+
+ <b>Authenticode</b> - It is possible today
+ to sign assemblies (in fact any PE file) with
+ an Authenticode(r) compatible signature (with
+ or without a timestamp) using the security
+ tools cert2spc.exe and signcode.exe. We also
+ have support to test this using the tools
+ makecert.exe, chktrust.exe and setreg.exe.
+ What we are lacking:
+ <ul>
+ <li>Currently our X.509 certificate
+ chaining is very limited and we do
+ not support certificate revocation
+ in anyway;
+ <li>Not every options are implemented
+ in all tools (and some do not really
+ apply to Mono);
+ <li>PublisherIdentityPermission
+ support isn't complete as it depends
+ on CAS.
+ </ul>
+
+ <li>ASP.NET caching: Non-existant at this point, this
+ needs to be implemented.
+
+ <li>Stability of ASP.NET and Mod_Mono. They are both
+ functional, but they fail under load. Much debugging
+ and testing must go into these components. As we use
+ more of it, we have found more little problems surface
+ on it.
+
+ <li>Codebase audit: Duncan did an audit of Corlib, but
+ we must do an audit of all the assemblies that we we
+ are going to ship, just to get an idea of the major
+ areas missing.
+ </ul>
+
+ <p>The team at Novell will focus on these areas. We of course
+ welcomes the contribution of the rest of the Mono team and
+ encourage the developers to focus on 1.0, to have a solid
+ release, and a solid foundation that can lead to 1.2
+
+ <p>We will use Bugzilla milestones to track these issues.
+
+<h3>Synchronized releases</h3>
+
+ <p>It would be great if we can ship Mono 1.0 with Gtk# 1.0 and
+ a preview of Monodoc with the early documentation.
+
+<h3>Alpha components.</h3>
+
+ <p>Various Mono developers are working on areas that will not
+ make it into the 1.0 timeframe: JScript, WSE, VB.NET,
+ Windows.Forms, Generics. We should continue to work on
+ those components, as they will come shortly after, and they
+ are probably more fun to develop than stabilizing the core.
+
+<h3>New components: Whidbey and Longhorn features</h3>
+
+ <p>Everyone is probably very excited about the new features in
+ the Whidbey release of .NET, and most importantly the Longhorn
+ features. I am sure that many of us will not resist the urge
+ to put some of the new assemblies on CVS.
+
+ <p>We will likely add a profile for those of you that want to
+ work on this, and can not wait to get your hands in the code,
+ although keep in mind that your contributions wont reach the
+ general audience until we successfully ship 1.0.
+
+ <p>The things to keep in mind while adding code which is not
+ in .NET 1.0 and .NET 1.1:
+
+ <ul>
+ <li>Make sure you surround new classes and methods
+ with the appropriate define: NET_1_2 for things
+ available on the .NET 1.2 SDK (Whidbey) and NET_3
+ define for things only available on the Longhorn API.
+ We need this so that these methods do not appear on
+ the 1.0 and 1.1 builds.
+
+ <li>If you add generic types or methods, also surround
+ the method with GENERICS for now, since our compiler
+ can not currently build this code yet. This is
+ redundant with the NET_1_2 define but important.
+
+ <li>For every assembly you update, make sure that you
+ also add the relevant AssemblyInfo versioning
+ information. If possible, when you add methods from
+ .NET 1.2 to the build, also update the AssemblyInfo.cs
+ for the library.
+ </ul>
+
+ <p>There are three areas of new hot features:
+
+ <ul>
+ <li>Class library improvements (Whidbey, Mono 1.2
+ time frames).
+
+ <li>Indigo: They will release this in 2005 or 2006 and
+ wont make it into the 2004 Whidbey .NET 1.2 release.
+
+ <li>Avalon: Definitely a Longhorn-bound feature.
+ </ul>
+
+ <p>Most code that will reach the users in the short time frame
+ (next year) will be related to the Whidbey improvements, so I
+ encourage developers to work on those pieces, as they are the
+ ones that will help Mono the most.
+
+<h3>ASP.NET 2.0 plans</h3>
+
+ <p>Gonzalo will continue to coordinate this effort; At this
+ time ASP.NET 2.0 features will not make it into Mono 1.0.
+
+<h3>Avalon plans</h3>
+
+ <p>On the surface Avalon seems like it uses something like
+ GdiPlus/Cairo for rendering. That was my initial feeling, but
+ it turns out that they had to rewrite everything to have a
+ performing rendering engine, and implement some very advanced
+ rendering features that include compositing with video
+ streams, also their brushes seem to be fairly powerful.
+
+ <p>XAML, a new markup language that binds tags to .NET classes
+ was also presented, but this is the least interesting part. A
+ tiny compiler translates the XAML source files into C# code.
+ The whole process is just like Glade, and should be easy to
+ do.
+
+ <p>The really elaborate parts are the rendering engine, and the
+ composition model for widgets. It is a complete new toolkit,
+ and if we want to implement this one, we will have to have a
+ new toolkit on Unix, incompatible with everything else, maybe
+ stressing the importance of working with other open source
+ projects in defining a cross-toolkit theming strategy to
+ address this particular problem.
+
+ <p>A Mini-Avalon is easy to do, but a complete one will
+ require much interaction with other groups: the Cairo folks
+ are probably the most qualified to assist us.
+
+<h3>Indigo Plans</h3>
+
+ <p>Indigo is still an early product (<a
+ href="http://msdn.microsoft.com/Longhorn/understanding/pillars/Indigo/default.aspx?pull=/library/en-us/dnlong/html/indigofaq1.asp">FAQ</a>),
+ but it could benefit from continued development of our WSE1
+ and WSE2 components, later to bring some of the code to it.
+
+ <p>Again, since people are visibly excited about this
+ technology, we will lay down in the next few days a framework
+ to contribute to it.
+
+
+<p>
+<i>Last Updated: Nov 1st, 2003</i>
+
+</body>
+</html>
diff --git a/web/mono-roadmap.html b/web/mono-roadmap.html
new file mode 100644
index 00000000000..29344af5560
--- /dev/null
+++ b/web/mono-roadmap.html
@@ -0,0 +1,396 @@
+<html>
+<head><title>Mono Roadmap</title>
+<style type="text/css">
+h1 {
+color: #efefef;
+font-size: 18pt;
+font-family: "Trebuchet MS";
+border: 0;
+margin: 0;
+padding: 1em;
+background: #666666;
+}
+
+h2, h3, h4, h5, h6 {
+font-family: Verdana,sans-serif;
+font-weight: bold;
+margin: 9pt;
+}
+
+h2, h3 {
+font-size: 18px;
+}
+
+h2 {
+padding: 3px;
+color: #000000;
+}
+
+h3 {
+font-size: 13px;
+border-bottom: 2px solid #dddddd;
+}
+
+h4 {
+border-bottom: 2px solid #dddddd;
+}
+
+body, table {
+background-color: #ffffff;
+font-family: Verdana, sans-serif; font-size: 12px;
+color: black;
+margin: 0;
+padding: 0;
+border: 0;
+ margin-left: 20%;
+ margin-right: 20%;
+}
+
+p {
+margin-left: 2em;
+margin-right: 2em;
+}
+
+ul li {
+margin-left: 2em;
+}
+
+img {
+border: 0;
+vertical-align: top;
+}
+
+</style>
+</head>
+<body>
+
+<center>
+ <h1>
+ Mono Project Roadmap
+ <br>
+ <font size=1>Miguel de Icaza (miguel@ximian.com)</font>
+ </h1>
+ <p>
+</center>
+
+<i>Last update: Jan 18th, 2004</i>
+
+<h3>Introduction</h3>
+
+ <p>This document describes the high-level roadmap for <a
+ href="http://www.go-mono.com">Mono</a>.
+
+ <p>The Mono project started in 2001 as an effort to implement
+ the .NET Framework to Unix. To bring both the new programming
+ model based on the Common Language Infrastructure and C# as
+ well as helping people migrate their existing knowledge and
+ applications to Unix. Mono today supports a wide variety of
+ operating systems, CPUs and a large chunk of the functionality
+ available in the .NET Framework.
+
+ <p>At the October 2003 PDC conference a number of new
+ technologies were announced. From the Mono release schedule
+ perspective, we should think about these technologies from
+ their release time standpoint, and the features that must be
+ supported.
+
+ <p>This document outlines the roadmap for the Mono project
+ from my perspective: what we can effectively deliver on the
+ dates outlined. Since Mono is a large open source project,
+ things might change and new features can be incorporated
+ into the plan if external sources devote enough attention to
+ those problems.
+
+ <p>This is the timeline:
+ <p>
+ <center>
+ <img src="roadmap.png">
+ </center>
+
+<h3>Background</h3>
+
+ <p>So far Microsoft has published two versions of the .NET
+ Framework: 1.0 and 1.1, the later with incremental updates to
+ the changes in 1.0
+
+ <p>The Mono project has been tracking some of the
+ improvements available in those two releases, some of the
+ highlights of our work so far are:
+
+ <ul>
+ <li> Core: mscorlib, System, System.Security and
+ System.XML assemblies.
+
+ <li> ADO.NET: System.Data and various other database
+ providers.
+
+ <li> ASP.NET: WebForms and Web Services are
+ supported. Work on WSE1/WSE2 has also started.
+
+ <li> Compilers: C#, VB.NET and various command line tools
+ that are part of the SDK.
+
+ <li> Open Source, Unix and Gnome specific libraries.
+ </ul>
+
+ <p>Other components like Windows.Forms, Directory.Services,
+ Enterprise Services and JScript are being developed but are not
+ as mature as the other components but are under development by
+ various people.
+
+ <p>Some other smaller and less used components do not have yet
+ a Mono equivalent (System.Management, System.Drawing.Design).
+
+<h3>Mono release strategy</h3>
+
+ <p>The levels of maturity of Mono fluctuate depending on the
+ development effort we have put into it, and the use we have
+ given to them. For example, the virtual machine and the C#
+ compiler very mature, while less commonly used functionality
+ in Mono like Windows.Forms or VB.NET are still under heavy
+ development.
+
+ <p>Our strategy is to release the mature components as Mono
+ 1.0, and have upcoming versions of Mono add extra
+ functionality.
+
+<h3>Mono 1.0 goals</h3>
+
+ <p>The Mono 1.0 release would include the following
+ components:
+
+ <ul>
+ <li>C# compiler.
+
+ <li>VM, with JIT and pre-compiler.
+
+ <li>IL assembler, disassembler.
+
+ <li>Development and security tools.
+
+ <li>Core libraries: mscorlib, System, System.XML.
+
+ <li>System.Data and Mono database providers.
+
+ <li>System.Web: Web applications platform and Apache
+ integration module.
+
+ <li>System.Web.Services: client and server support.
+
+ <li>System.Drawing.
+
+ <li>System.DirectoryServices
+
+ <li>JIT support: x86, SPARC and PPC architectures
+ (interpreter available for other architectures).
+
+ <li>ECMA profiles: special build options to build
+ Mono as an implementation of the various ECMA profiles
+ will be available.
+
+ <li>Java integration through IKVM.
+
+ <li>Embedding interface for the runtime.
+ </ul>
+
+ <p>Packaging:
+
+ <ul>
+ <li>mono: will contain the above features implementing
+ the .NET 1.1 API.
+
+ <li>mono-1.0-compat: Will include a build of the
+ libraries with the .NET 1.0 API, this is a
+ compatibility build for people running .NET 1.0
+ applications.
+
+ <li>mono-unstable: Will contain a snapshot of the
+ other technologies under development for developer's
+ convenience, but will be unsupported at this time.
+ These include the Generics edition of the C#
+ compiler.
+
+ <li>mono-ecma: A build that only includes the ECMA
+ components.
+ </ul>
+
+ <p>Release target: Q2/2004.
+
+ <p>Bug fix releases would be done on a monthly basis.
+
+ <p>For a detailed list, see the <a
+ href="mono-1.0.html">mono-1.0 feature list.</a>
+
+<h3>Microsoft's Whidbey</h3>
+
+ <p>To understand post 1.0 editions of Mono, it is important to
+ put it into perspective with the Microsoft Whidbey product, to
+ be released in 2004.
+
+ <p>The new features in the Whidbey release of the .NET Framework
+ include:
+
+ <ul>
+ <li><b>Generic types</b><br>
+ These introduce changes to the compiler, runtime and
+ class libraries.
+
+ <li><b>ASP.NET 2</b><br>
+ Many tools to simplify web application development:
+ Master pages, new controls for common operations,
+ personalization and themes.
+
+ <li><b>Remoting</b><br>
+ New security channels and version-resistant remoting
+ (good news in the interop department).
+
+ <li><b>XML</b><br>
+ XQuery debuts on this release as well as an improved
+ XmlDocument system based on XPath: XPathDocument.
+
+ <li><b>Networking</b><br>
+ FTP client, Ssl streams.
+
+ <li><b>Console and Serial ports:</b></br>
+ Console terminal input/output is available as well as
+ serial port handling.
+
+ <li><b>Windows.Forms</b><br>
+ Layout containers finally appeared on Windows.Forms as
+ well as various new controls.
+
+ <li><b>ObjectSpaces</b><br>
+ An API for simpler data-base access.
+ </ul>
+
+<h3>Mono 1.2</h3>
+
+ <p>The Mono team is developing in parallel some features that
+ wont make it to the 1.0 release in stable form. These will be
+ the foundation for the 1.2 release. The focus of this release
+ is to track the core API for the .NET Framework 1.2, but
+ again, only a subset of the total framework will be
+ available.
+
+ <p>Mostly, Mono 1.2 consists of components that were not
+ stable enough for Mono 1.0, but that would be mature at this
+ point, plus the incorporation of some new features from
+ Whidbey. In addition to the Mono 1.0 components, this release
+ will add:
+
+ <ul>
+ <li>Generic types support: C# compiler, execution
+ system and core class libraries.
+
+ <li>ASP.NET 2.0 improvements.
+
+ <li>Remoting improvements from Whidbey.
+
+ <li>System.XML: simpler improvements from Whidbey,
+ lacking the large additions (XQuery for example).
+
+ <li>Console and Serial ports support.
+
+ <li>New compilers: VB.NET and JScript support.
+
+ <li>WSE1/WSE2 implementations.
+
+ <li>System.Windows.Forms officially debuts with .NET
+ 1.0 API; 1.2 API available as an unstable addition.
+ </ul>
+
+ <p>This release will by default provide .NET 1.2 APIs, but
+ compatibility libraries for 1.0 and 1.1 will be distributed in
+ the mono-compat package. The unstable components of Mono will
+ be distributed on the `mono-unstable' package, the libraries
+ in this release will be unsupported.
+
+ <p>Release target: Q4/2004.
+
+<h3>Mono 1.4</h3>
+
+ <p>A refresh update on the Mono 1.2 release containing the
+ missing components from the previous release and complete any
+ under performing pieces. Updates to System.Xml, ASP.NET and
+ Windows.Forms to match the .NET 1.2 API.
+
+ <p>Release target: Q2/2005.
+
+<h3>Peer projects</h3>
+
+ <p>Other projects like the debugger, the documentation
+ browser, Java integration through IKVM and Gtk# will remain on
+ their own schedules. This page will be updated to contain
+ that information when it becomes available.
+
+<h3>Unscheduled activities</h3>
+
+ <p>A missing component of Mono is the Code Access Security
+ (CAS). This functionality is not needed in today's Mono as
+ currently Mono is being used to run fully trusted
+ applications, and we are not using it on embedded scenarios
+ where assemblies would have different trust levels.
+
+ <p>This is an important component, but requires three major
+ pieces of work:
+
+ <ul>
+ <li>Runtime support for implementing the security
+ demands.
+
+ <li>A guidelines document outlining what and where
+ must have security demands in place.
+
+ <li>A full audit of our class libraries: method by
+ method
+ </ul>
+
+ <p>All of these are major pieces of work, and we currently
+ have no plans to implement any of those. A volunteer effort might be
+ able to help with the runtime requirements and the document,
+ but until those are done, we are unlikely to start doing any
+ work on the actual class library audit and instrumentation.
+
+<h3>Mono and WinFX: 2006</h3>
+
+ <p>WinFX is the name given to the new set of libraries that
+ makes up .NET in the Longhorn operating system: the existing
+ .NET set of class libraries, plus the new functionality
+ available in the OS.
+
+ <p>WinFX adds things like storage facilities (WinFS), a
+ new versatile communications stack (Indigo) and a new
+ eye-candy packed GUI programming system (Avalon).
+
+ <p>Although WinFS, Avalon and Indigo are very exciting
+ components, at this time it is too early to tell when those
+ components will be available for Mono. Open source developers
+ will very likely start work on these, but since they are still
+ far from being officially released, they are not in the radar
+ at this point.
+
+<h3>Unsupported technologies</h3>
+
+ <p>Some technologies are very hard to implement or are being
+ phased out by components in the Longhorn time frame. In some
+ cases, we feel that they are not crucial to the future of the
+ open source desktop.
+
+ <p>System.EnterpriseServices and System.Management come to
+ mind, and we are unlikely to put any resources into the task.
+ We would gladly host the code if someone cares to implement
+ it, but they would likely remain unsupported features of Mono.
+
+<h3>Mono Developer Strategy</h3>
+
+ <p>Mono Developers should read the <a
+ href="mono-hacking-roadmap.html">Mono Hacking Roadmap</a>
+
+<h3>Comments</h3>
+
+ <p>Feel free to send your comments or questions the roadmap to
+ <a href="mailto:miguel@ximian.com">miguel@ximian.com</a>
+
+
+<p>
+<i>Last Updated: Nov 1st, 2003</i> \ No newline at end of file
diff --git a/web/mono-todo b/web/mono-todo
new file mode 100644
index 00000000000..c57c430c9b2
--- /dev/null
+++ b/web/mono-todo
@@ -0,0 +1,266 @@
+* Mono hacking TODO list
+
+ From time to time people that want to contribute to Mono ask
+ on the mailing list what they can help with. The generic
+ answer is always:
+ <ul>
+ <li> Write documentation.
+ <li> Write regression tests.
+ <li> Complete the implementations of the class libraries.
+ <li> Help fix the bugs filed in our bugzilla database.
+ </ul>
+
+ The proposed tasks are very important for the Mono project and
+ are suitable for people that can dedicate even just an hour
+ per week to contribute. But some people may need something
+ more focused to work on, such as students that want to do a
+ thesis on their contribution to Mono. For such people (and
+ also for professors who want ideas for thesis regarding JIT or
+ VM technologies), here is a list of tasks that need attention.
+
+ The estimated time to complete any of the tasks is between 1
+ week to several months to accomodate for different hacking
+ possibilities.
+
+ Note on the time estimates: they are very rough estimates, a
+ smart and dedicated hacker can complete the tasks in half of
+ the minimum time, a part-time hacker that also has a social
+ life can take more than double the max time, but there's
+ nothing to worry as long as progress is being done.
+
+ If some people (or group of people) want to take on a task,
+ they should write to the mono-devel mailing list and in the
+ relative bugzilla bug report. Discussions about how to
+ implement a feature or additional information on the task
+ should be mailed to the list or in the bugzilla report as well
+ so that people can keep informed on the progress or have the
+ information needed to start contributing.
+
+ Mono is an excellent platform for research on JITs, virtual
+ machines and specifically the CLR because it provides an
+ advanced free software implementation that can be used as a
+ basis for more optimizations, new approaches to problems and
+ new features.
+
+ There are different areas of interest where high-level
+ contributions can be made:
+
+ <ul>
+ * <b>JIT compiler</b>: tasks can be: adding more optimizations, reducing
+ compile time, porting to different architectures.
+
+ * <b>AOT compiler</b>: optimizing the compiler output and the AOT loader,
+ better support for multiple application domains.
+
+ * <b>VM runtime</b>: optimizing the runtime data structures, experimenting with
+ different garbage collectors, integration with different component models.
+
+ * <b>Class library</b>: many opportunities in the implementation of regular
+ expressions, Xml related technologies (XPath, XLST, etc).
+
+ * <b>Compilers</b>: writing compilers, interpreters and runtimes for langauges
+ so that they run on the CLR (using Reflection.Emit support, for example).
+ </ul>
+
+Happy hacking!
+
+<table border=1 cellspacing="0" cellpadding="0">
+ <tr>
+ <th>Area<th>Description<th>Difficulty<th>Time estimate<th>Bugzilla ID
+ </tr>
+
+ <tr>
+ <td>System assembly (mcs/class/System/)
+ <td>Implement the IL-based regular expression engine. Instead of
+ intepreting the regular expression pattern, a method is created at runtime using
+ Reflection.Emit. This makes for faster pattern matching because there is no
+ intepreter overhead and the matching code is jitted to fast native code.
+ Bonus points if the compiled regular expression is compatible with the ones generated
+ by the MS runtime.
+ <td>Medium-hard (thesis subject)
+ <td>2-4 months
+ <td><a href="http://bugzilla.ximian.com/show_bug.cgi?id=52605">52605</a>
+ </tr>
+
+ <tr>
+ <td>JIT (mono/mini/)
+ <td>Implement common subexpression elimination.
+ Global and local common subexpression elimination needs to be implemented
+ to achieve better performance. The local case is easier and may take just one month.
+ It should be implemented in the context of the SSA framework (mini/ssa.c).
+ <td>Hard (thesis subject)
+ <td>2-4 months
+ <td>not assigned
+ </tr>
+
+ <tr>
+ <td>JIT (mono/mini/)
+ <td>Optimize AOT compiler output.
+ Currently the code generated by the AOT compiler may be significantly slower than
+ jitted code. This is mostly because the AOT code supports multiple application domains
+ and some values that are constant at JIT-time are not constant at AOT-time. It may be
+ needed to write a simple dynamic linker and/or binary object writer. Bonus poinst if
+ it supports ELF, PE/COFF and mach-O binary formats. A possible idea for improvements
+ is also the use of appdomain ID-indexed tables to get at the appdomain specific data.
+ <td>Medium-hard (thesis subject)
+ <td>3-6 months
+ <td>not assigned
+ </tr>
+
+ <tr>
+ <td>JIT (mono/mini/)
+ <td>Port the JIT to additional architectures.
+ Currently ports exist for x86, ppc, sparc and s390.
+
+ Ports to more architectures are welcome as well.
+ <td>Medium-hard
+ <td>3-6 months per arch
+ <td>not assigned
+ </tr>
+
+ <tr>
+ <td>Runtime and JIT (mono/metadata and mono/mini/)
+ <td>Add support for COM and/or XPCOM and/or ORBit.
+ We need a way to seamlessy use existing component technologies inside the mono runtime.
+ The COM support needs to match the MS runtime behaviour and is targeted at windows systems.
+ XPCOM and ORBit support are important on Unix platforms. Bonus points for developing
+ the runtime support so that different component systems can be used at the same time.
+ <td>Medium-hard (thesis subject)
+ <td>3-4 months for each
+ <td>not assigned
+ </tr>
+
+ <tr>
+ <td>Runtime and JIT (mono/metadata and mono/mini/)
+ <td>Implement support for Code Access Security.
+ Support needs to be added to the JIT and the runtime to ensure
+ code that executes privileged operations is permitted to do so.
+ The task includes loading the security information from metadata,
+ collecting evidence, inserting calls to the permission objects,
+ stack walking to collect security info.
+ <td>Medium-hard (thesis subject)
+ <td>4-5 months
+ <td><a href="http://bugzilla.ximian.com/show_bug.cgi?id=52606">52606</a>
+ </tr>
+
+ <tr>
+ <td>Runtime and JIT (mono/metadata and mono/mini/)
+ <td>Implement support for a generational GC.
+ We're currently using a conservative non-moving GC.
+ Support for a generational and moving GC requires changes to the JIT
+ (to record locations in frames as well as registers that may contain
+ pointers to GC-allocated memory) and to the runtime code (when
+ objects are manipulated directly we should make sure they are pinned
+ and reachable by the GC also in the C unmanaged code). Code from an existing
+ precise GC such as the ORP one could be reused or a new GC may be developed
+ (increasing the estimated development time).
+ <td>Hard (thesis subject)
+ <td>6-8 months
+ <td>not assigned
+ </tr>
+
+ <tr>
+ <td>Compilers for dynamic languages
+ <td>Write a IL compiler and runtime support for dynamic languages like
+ Python, Perl, Ruby, PHP.
+ <td>Medium-hard (thesis subject)
+ <td>6-12 months
+ <td>not assigned
+ </tr>
+
+ <tr>
+ <td>Linker tool.
+
+ <td>Write a tool that given a list of methods and
+ classes extracts them from an existing assembly and
+ produces a new assembly with these classes and any
+ dependencies they might have.
+
+ <br>The idea is to have a way of creating custom
+ libraries that can either be embedded with Mono's
+ bundle setup or to create smaller editions of the
+ libraries for embedded systems.
+
+ <td>Medium
+ <td>4-6 months
+ <td>
+ </tr>
+
+ <tr>
+ <td>Tools
+ <td>Write an implementation of the MSBuild compilation tool available in .NET 1.2
+ <td>Medium
+ <td>4-6 months
+ <td>not assigned
+ </tr>
+ <tr>
+ <td>Build tools.
+ <td>Currently it is easy for people doing daily
+ updates from CVS to break their installation. Design a mechanism by
+ which Mono never fails to compile.
+ <td>Easy
+ <td>1-2 weeks
+ <td>not assigned
+ </tr>
+ <tr>
+ <td>Documentation.
+ <td>Editorial review of the Monkeyguide: The monkeyguide is known to contain outdated
+ statements, it needs to be reviewed and it needs an
+ editor to take control over it. Some simple tasks
+ include flattening out the Monkeyguide, since it is
+ too nested today.
+ <td>Easy
+ <td>Ongoing work.
+ <td>not assigned
+ </tr>
+ <tr>
+ <td>Documentation
+ <td>GNOME.NET Chapter should probably be separated
+ from the Monkeyguide. This is probably the most
+ complete chapter, but it is burried in various nested
+ levels of stuff, and because of this, it is not being
+ updated. Write a chapter on custom control
+ authoring and common patterns of app development.
+ <td>Easy
+ <td>Ongoing work.
+ <td>not assigned
+ </tr>
+ <tr>
+ <td>Documentation Tools
+ <td>The Monodoc collaborative service needs a better
+ administration tool than it has today; Someone needs
+ to redo the UI and streamline its process.
+ <td>Easy
+ <td>2-3 months.
+ <td>not assigned
+ </tr>
+ <tr>
+ <td>Comment Service API
+ <td>Design a full system for comments and ratings so
+ people can annotate the documentation in Monodoc.
+ <td>Easy
+ <td>2-3 months.
+ <td>not assigned
+ </tr>
+ <tr>
+ <td>System.Data updates
+ <td>.NET 1.2 will introduce many new updates to the
+ System.Data namespace: MARS and ObjectSpaces are the
+ big ones.
+ <td>Medium
+ <td>6-9 months.
+ <td>Work with the mono-devel-list to keep track of things.
+ </tr>
+ <tr>
+ <td>System.XML updates
+
+ <td>.NET 2.0 will introduce many new updates to the
+ System.Xml namespace: XQuery and new XPathDocument are
+ the big changes.
+
+ <td>Medium
+ <td>6-9 months.
+ <td>Work with the mono-devel-list to keep track of things.
+ </tr>
+</table>
+
diff --git a/web/mysql b/web/mysql
new file mode 100755
index 00000000000..2449bc1f4e7
--- /dev/null
+++ b/web/mysql
@@ -0,0 +1,181 @@
+* MySQL Data Provider
+
+ <p>There are two ADO.NET providers in Mono
+ for a <a href="http://www.mysql.com/">MySQL</a> database:
+
+<ul>
+ <li><a href="http://sourceforge.net/projects/mysqlnet/">ByteFX.Data.MySQLClient</a>
+ <ul>
+ <li>Written in 100% C#</li>
+ <li>Does not require a client library</li>
+ <li>Works on Mono and Microsoft .NET</li>
+ <li>Requires at least Mono 0.18 and MySQLNet 0.65 for it to work on Mono</li>
+ <li>Works in the SQL# command-line and GTK# GUI version</li>
+ </ul>
+ </li>
+
+ <li>Mono.Data.MySql (DEPRECATED)
+ <ul>
+ <li>Deprecated in favor of ByteFX.Data.MySQLClient. Mono.Data.MySql is no longer included in
+ Mono releases.</li>
+ </ul>
+ </li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+</ul>
+
+ <p><a href="http://www.mysql.com/articles/dotnet/">Exploring MySQL
+ in the Microsoft .NET Environment</a> is a nice article to read.</li>
+
+** Current Status
+
+ Current Status of the MySQL providers:
+
+<ul>
+
+ <li>ByteFX.Data.MySqlClient
+ <ul>
+ <li>Build and Runs on Microsoft .NET and Mono</li>
+ <li>Works with SQL# (command-line and GTK# GUI versions)</li>
+ <li>MySQLCommandBuilder now implemented</li>
+ <li>Transaction support now implemented (not all table types support this)</li>
+ <li>GetSchemaTable fixed to not use xsd (for Mono)</li>
+ <li>Driver is now Mono-compatible</li>
+ <li>TIME data type now supported</li>
+ <li>More work to improve Timestamp data type handling</li>
+ <li>Changed signatures of all classes to match corresponding SqlClient classes</li>
+ <li>Protocol compression using <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a></li>
+ <li>Named pipes on Windows now working properly</li>
+ <li>Work done to improve Timestamp data type handling</li>
+ <li>Implemented IEnumerable on DataReader so DataGrid would work</li>
+ <li>Speed increased dramatically by removing bugging network sync code</li>
+ <li>Driver no longer buffers rows of data (more ADO.Net compliant)</li>
+ <li>Conversion bugs related to TIMESTAMP and DATETIME fields fixed</li>
+
+ </ul>
+ </li>
+
+ <li>Mono.Data.MySql (DEPRECATED)
+ </li>
+
+</ul>
+
+** Action plan
+
+ The current plan for the MySQL data providers:
+
+ <ul>
+ <li>ByteFX.Data.MySqlClient
+ <ul>
+ <li>Testing and fixes</li>
+ <li>Implement missing features</li>
+ <li>Only fixes for bugs to build and run MySQLClient on Mono
+ will be accepted in mono-cvs. Most bugs and any new features will
+ go into sourceforge cvs. Anytime there is a release of MySQLClient,
+ the source code will be copied from sourceforge cvs to mono-cvs</li>
+ <li>Releases of MySQLClient are determined by Reggie Burnett and releases
+ of Mono are determined by Miguel de Icaza</li>
+ <li>Implement any missing features or fix any bugs in Mono to get new
+ features all of MySQLClient to work on Mono</li>
+ </ul>
+ </li>
+ <li>Mono.Data.MySql (DEPRECATED)
+ </li>
+</ul>
+
+** Testing for MySQLNet provider (ByteFX.Data.MySQLClient)
+
+<ul>
+ <li>Have access to a MySQL database or download it from
+ <ul>
+ <li><a href="http://www.mysql.com/downloads/index.html">MySQL AB</a></li>
+ </ul>
+ </li>
+
+ <li>MySQLNet can be gotten from <a href="http://sourceforge.net/projects/mysqlnet/">here</a> and the
+ binary assembly ByteFX.Data.dll needs to be installed
+ in the same place as the mono class libraries.</li>
+
+ <li>MySQLNet requires <a href="http://www.icsharpcode.net/OpenSource/SharpZipLib/default.asp">SharpZipLib</a> which is
+ a Zip Library written in 100% C#. This is used for compression/decompression of data
+ sent/received over the network. The SharpZipLib binary assembly SharpZipLib.dll should
+ be installed in the same place as the mono class libraries.</li>
+
+ <li>Has a ConnectionString format:
+<pre>
+"Server=hostname;" +
+"Database=database;" +
+"User ID=username;" +
+"Password=password"
+</pre>
+ </li>
+ <li>C# Example:
+<pre>
+ using System;
+ using System.Data;
+ using ByteFX.Data.MySqlClient;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Server=localhost;" +
+ "Database=test;" +
+ "User ID=myuserid;" +
+ "Password=mypassword;";
+ IDbConnection dbcon;
+ dbcon = new MySqlConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ // requires a table to be created named employee
+ // with columns firstname and lastname
+ // such as,
+ // CREATE TABLE employee (
+ // firstname varchar(32),
+ // lastname varchar(32));
+ string sql =
+ "SELECT firstname, lastname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["firstname"];
+ string LastName = (string) reader["lastname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r ByteFX.Data.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+
+</ul>
+
diff --git a/web/odbc b/web/odbc
new file mode 100755
index 00000000000..80143fcb7eb
--- /dev/null
+++ b/web/odbc
@@ -0,0 +1,218 @@
+* ODBC Data Provider
+
+<ul>
+
+ <li>ADO.NET Data Provider for Data Sources
+ that have <a href="http://www.microsoft.com/data/odbc/">ODBC</a> support.</li>
+
+ <li>Exists in namespace System.Data.Odbc and assembly System.Data</li>
+
+ <li>Works on Windows and Linux. Should have no problems working on UNIX too.</li>
+
+ <li>Works on Windows via the native Windows odbc32.dll</li>
+
+ <li>Works on Linux via:
+
+ <ul>
+ <li><a href="http://www.unixodbc.org/">unixODBC</a> which has
+ commercial support
+ from <a href="http://www.easysoft.com/">Easysoft</a></li>
+
+ <li><a href="http://www.iodbc.org/">iODBC</a> which has
+ commercial support
+ from <a href="http://oplweb.openlinksw.com:8080/download/">OpenLink Software</a></li>
+ </ul>
+
+ <li>List of unixODBC <a href="http://www.unixodbc.org/drivers.html">drivers</a>
+
+ <li>List of <a href="http://www.sqlsummit.com/odbcvend.htm">ODBC Vendors</a>
+
+ <li>ODBC can connect to various databases which has an ODBC driver installed:
+ <ul>
+ <li><a href="http://www.mysql.com/">MySQL</a></li>
+ <li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
+ <li><a href="http://www.oracle.com/">Oracle</a></li>
+ <li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a></li>
+ <li><a href="http://www.sybase.com/downloads">Sybase</a> (
+ via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)</li>
+ <li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a> (
+ via <a href="http://www.freetds.org/">FreeTDS</a> on UNIX)</li>
+ <li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
+ <li><a href="http://www.microsoft.com/office/access">MS Access</a>
+ (via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a> on UNIX)</li>
+ </ul>
+
+ <li>ODBC Provider created by Brian Ritchie.</li>
+
+ <li>Does not support trusted connections</li>
+
+</ul>
+
+** Current Status
+
+<ul>
+ <li>Can Connect on:
+ <ul>
+ <li>Windows via native Windows odbc32.dll</a></li>
+ <li>Linux via:
+ <ul>
+ <li>unixODBC's libodbc.so</li>
+ <li>iODBC's libiodbc.so</li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+
+ <li>Various databases have been tested using their
+ ODBC drivers: MySQL, PostgreSQL, Oracle, IBM DB2, and Microsoft SQL Server</li>
+
+ <li>Can execute non-query commands via ExecuteNonQuery of a OdbcCommand</li>
+
+ <li>Can execute aggreates and retrieve a single row single column result via
+ ExecuteScalar of a OdbcCommand</li>
+
+ <li>Can execute queries via ExecuteReader of a OdbcCommand and
+ retrieve results using an OdbcDataReader</li>
+
+ <li>Can get a DataTable containing schema info via GetSchemaTable() in a OdbcDataReader</li>
+
+ <li>Can Fill a DataTable in a DataSet via an OdbcDataAdapter</li>
+
+ <li>Works in SQL#, but Column names don't show up correctly.</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+
+</ul>
+
+** Action Plan
+
+<ul>
+
+ <li>Fixing bugs
+
+ <li>Testing with other setups
+</ul>
+
+** Testing ODBC provider with IBM DB2 Universal Database
+
+<ul>
+ <li>You need a working mono and mcs</li>
+
+ <li>For Unix, you will need unixODBC or iODBC installed</li>
+
+ <li>Have acess to a <a href="http://www-306.ibm.com/software/data/db2/">IBM DB2 Universal Database</a> or
+ you can download from IBM</li>
+
+ <li>Read these web pages about Unix, ODBC, and IBM DB2
+
+ <ul>
+ <li><a href="http://www.unixodbc.com/doc/db2.html">unixODBC web page about IBM DB2</a></li>
+ <li><a href="http://www-306.ibm.com/software/data/db2/udb/ad/v8/cli/t0010406.htm">IBM web page about unixODBC and DB2</a></li>
+ </ul>
+ </li>
+
+ <li>The ODBC provider is similar to the <a href="http://www.go-mono.com/ibmdb2.html">IBM DB2</a> provider.</li>
+</ul>
+
+** Testing ODBC provider with MySQL
+
+<p>You can test Mono's ODBC provider System.Data.Odbc with the MySQL ODBC driver MyODBC
+
+<p><ul>
+ <li>Take a look at OdbcTest.cs in mcs/class/System.Data/Test</li>
+
+ <li>Here is a ConnectionString format if you have a DSN setup:
+<pre>
+"DSN=dataSetName;UID=myuserid;PWD=mypassword"
+</pre>
+ </li>
+ <li>Here is a ConnectionString format if you do not have a DSN (have not
+ gotten this to work though):
+<pre>
+"DRIVER={MySQL ODBC 3.51 Driver};" +
+"SERVER=localhost;DATABASE=test;" +
+"UID=myuserid;PASSWORD=mypassword;" +
+"OPTION=3";
+
+</pre>
+ </li>
+ <li>C# Example:
+<pre>
+ using System;
+ using System.Data;
+ using System.Data.Odbc;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ // have an ODBC DSN setup named MYSQLDSN
+ // that accesses a MySQL database via
+ // MyODBC driver for ODBC with a
+ // hostname of localhost and database test
+ string connectionString =
+ "DSN=MYSQLDSN;" +
+ "UID=myuserid;" +
+ "PWD=mypassword";
+ IDbConnection dbcon;
+ dbcon.Open();
+ dbcon = new OdbcConnection(connectionString);
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ // requires a table to be created named employee
+ // with columns firstname and lastname
+ // such as,
+ // CREATE TABLE employee (
+ // firstname varchar(32),
+ // lastname varchar(32));
+ string sql =
+ "SELECT firstname, lastname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["firstname"];
+ string LastName = (string) reader["lastname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll
+</pre>
+ </li>
+ <li>Build on Windows via Cygwin:
+<pre>
+ mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
+ TestExample.cs \
+ -lib:C:/cygwin/home/MyHome/mono/install/lib \
+ -r System.Data.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+
+</ul>
diff --git a/web/oldnews b/web/oldnews
new file mode 100644
index 00000000000..55632f3ffbb
--- /dev/null
+++ b/web/oldnews
@@ -0,0 +1,2917 @@
+@item Dec 21st 2003: Mono on PowerPC Progress.
+
+ Paolo reports today that the Mono JIT on the PowerPC was able
+ to successfully run the Mono C# compiler to build its first
+ programs. This is by no means complete (exception handling is
+ missing, and Boehm GC seems to fail on MacOS X), this shows
+ the excellent progress Paolo has been making.
+
+ Zoltan has added support for modules to MCS (generation and
+ consumption).
+
+@item Dec 10th, 2003: Mono Debugger 0.5 released
+
+ Martin Baulig has <a
+ href="http://primates.ximian.com/~martin/blog/archives/000231.html">released</a>
+ a new version of the Mono Debugger.
+
+@item Dec 2nd, 2003: Mono 0.29 has been released
+
+ Check out the <a
+ href="http://www.go-mono.com/archive/mono-0.29.html">Release
+ notes</a> for details on Mono 0.29.
+
+ This release includes the PPC JIT engine running `Hello World'
+ and ASP.NET is considered feature-complete.
+
+@item Nov 25th, 2003: Gtk# 0.14, System.DirectoryServices
+
+ Gtk# 0.14 has been released, and it is available from <a
+ href="http://gtk-sharp.sf.net">the Gtk# web site</a>.
+
+ Sunil has checked in the implementation of
+ System.DirectoryServices as well as the Novell.Directory.Ldap
+ code into Mono CVS.
+
+@item Nov 14th, 2003: Gtk# 0.13 released.
+
+ Mike Kestner has <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-November/016943.html">announced</a>
+ the release of the <a href="http://gtk-sharp.sf.net">Gtk#</a>
+ GUI toolkit for .NET and Mono.
+
+@item Nov 13th, 2003: Managed LDAP binding for Mono and .NET
+
+ Sunil Kumar at Novell has <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-November/016907.html">announced</a>
+ the availability of a fully managed implementation of LDAP for
+ Mono and the .NET Framework.
+
+ You can obtain the library from <a
+ href="http://forge.novell.com">Novell Forge's</a> <a
+ href="http://forge.novell.com/modules/xfmod/cvs/cvsbrowse.php/ldapcsharp/CsharpLDAP">CSharpLDAP</a>
+ module.
+
+@item Nov 4th, 2003: Mono Roadmap announced.
+
+ The <a href="mono-roadmap.html">Mono Roadmap</a> and <a
+ href="mono-hacking-roadmap.html">Mono Hackers Roadmap</a> have
+ been released.
+
+@item Oct 28th, 2003: Mono Get Together at the PDC. GTK# 0.12 Released.
+
+ We will be getting together at the West Tower Lobby on Tuesday
+ 28th at 6pm to talk about the Mono project. You have 24 hours to
+ notify all of your friends, open source buddies and free software
+ folks.
+
+ We will bring Mono t-shirts.
+
+ Mike Kestner released <a href="http://gtk-sharp.sourceforge.net">Gtk#</a> 0.12 today. GTK# source tar balls
+ and RPMs are available. A windows installer was contributed by Johannes Roith.
+
+@item Oct 26th, 2003: Last Minute Mono BOF
+
+ The first in a series of undercover Mono BOFs at the PDC will take
+ place tonight at 7pm on the Academy meeting, in room 411. Come join us
+ to plot the evolution.
+
+
+@item Oct 25th, 2003: GTK# 0.11+ Windows Installer available
+
+ Johannes created a Windows
+ Installer for GTK# 0.11+ and works
+ with Mono 0.28 for Windows.
+
+@item Oct 21st, 2003: Mono Community at Novell Forge
+
+ Mono Developers that are looking for a public repository for
+ hosting their projects can now use <a
+ href="http://forge.novell.com">Novell Forge's</a> which hosts
+ a <a
+ href="http://forge.novell.com/modules/xfmod/community/?monocomm">Mono
+ Community</a>.
+
+ Novell Forge offers mailing lists, cvs repository, bug
+ tracking and mailing list services and all the other services
+ you expect. Mono will continue to be hosted in our own CVS
+ repository, and using our <a href="anoncvs.html">anonymous CVS
+ servers</a>
+
+@item Oct 13th, 2003: SPARC V9, HPPA, Internationalization, GdiPlus
+
+ Dick Porter has checked in our rewrite of the international
+ substrate in Mono that uses the <a
+ href="http://oss.software.ibm.com/icu/">International
+ Components for Unicode</a> library from IBM. This means that
+ we got CultureInfo support through the whole code base now.
+
+ Alexandre Pigolkine has checked-in the new implementation of
+ System.Drawing. We have now dropped the old implementation
+ with multiple-backends that we had, and replaced it with an
+ implementation that P/Invokes into GDI+. A GDI+
+ implementation on top of <a
+ href="http://www.cairographics.org">Cairo</a> is used on Unix
+ systems. This step vastly simplifies the development and
+ maintenance of System.Drawing.
+
+ There are plenty of updates to Mono as well, we encourage you
+ to read the <a
+ href="http://www.go-mono.com/monologue">Monologue</a> to keep
+ an eye on recent developments.
+
+ Bernie Solomon just <a
+ href="http://lists.ximian.com/archives/public/mono-devel-list/2003-October/002460.html">checked
+ in</a> 64-bit support for SPARC v9 and HPPA into the Mono
+ runtime. This also improves the SPARC-32 support.
+
+@item Oct 6th, 2003: Linux s390 Mono packages available.
+
+ Neale Ferguson has contributed Mono packages for the
+ Linux/s390. You can get them from the <a
+ href="download.html">download</a> page.
+
+@item Oct 5th, 2003: Monologue aggregates Mono Blogs
+
+ You can now read an aggregated view of the <a
+ href="blogs.html">blogs</a> maintained by Mono developers in
+ <a href="http://www.go-mono.com/monologue">Monologue</a>.
+ Monologue is available as an HTML page or as an <a
+ href="monologue/index.rss">RSS feed</a>.
+
+@item Oct 2nd, 2003: Windows packages, MonoDoc 0.7
+
+ Windows packages for Mono 0.28 are now available from our <a
+ href="download.html">download</a> page.
+
+ A new version of MonoDoc has been released. The new version
+ is available <a href="archive/monodoc-0.7.tar.gz">here</a>
+
+@item Oct 1st, 2003: Mono 0.28 has been released.
+
+ Check out the <a
+ href="http://www.go-mono.com/archive/mono-0.28.html">Release
+ notes</a> for details on Mono 0.28. This release marks the
+ completion of the SourceGear project to add web services
+ functionality to Mono and improve its reliability.
+
+@item Sep 30th, 2003: Mono Kick Start book available
+
+ The Mono Kick Start book is now <a
+ href="http://www.amazon.com/exec/obidos/tg/detail/-/0672325799/qid=1064937318/sr=8-1/ref=sr_8_1/103-9624440-8714218?v=glance&s=books&n=507846">available</a>
+ in English. Originally available only in <a
+ href="http://www.amazon.de/exec/obidos/ASIN/3827264928/qid=1050051051/sr=2-1/ref=sr_2_3_1/028-2755135-1623712">German</a>.
+ The book technical review was done by <a
+ href="http://www.maurer-it.com/">Dietmar Maurer</a> JIT
+ architect at the Mono team.
+
+@item Sep 26th, 2003: DiaCanvas# 0.1 released, Gtk# 0.11 released.
+
+ Mike Kestner has <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2003-September/002475.html">released</a>
+ a new version of <a href="http://gtk-sharp.sf.net">Gtk#</a>.
+
+ Martin has also
+ <a href="http://mwh.sysrq.dk/programs/announcements/diacanvas-sharp-0.1.0.html">released</a>
+ his binding to <a href="http://diacanvas.sf.net">DiaCanvas</a> for C#.
+
+@item Sep 16th, 2003: WineLib, Authenticode, Generics, Xslt updates, Wsdl compiler, WSE.
+
+ <b>WineLib:</b> Vladimir has added new libraries to the Wine
+ process, which we will soon bring into our packages: the
+ various Windows common dialogs can now be used (screenshots:
+ <a href="images/colordlg.png">here</a>, <a
+ href="images/fontdlg.png">here</a>, <a
+ href="images/filedlg.png">here</a> and <a
+ href="images/finddlg.png">here</a>.
+
+ Johannes has patches to have Wine track the Gtk theme,
+ screenshot here (link got broken).
+
+ <b>Security:</b> New authenticode support from Sebastien has
+ been checked into CVS.
+
+ <b>Xslt:</b> Plenty of conformance updates to the managed
+ implementation of Xslt, as well as breaking the libxslt speed
+ barrier. Our managed implementation is now faster than the
+ C-based libxslt that we used before.
+
+ <b>Generics:</b> Work continues on generics support, feel free
+ to try it out. The compiler is currently on a separate
+ directory until we stability it (gmcs) and you need to compile
+ the class libraries with the `generics' profile to try it
+ out. Sample generic programs are included in the CVS module.
+
+ <b>Wsdl:</b> We now have Wsdl support in Mono: a wsdl compiler
+ command line tool, and support on ASP.NET to generate the wsdl
+ file from an .asmx file.
+
+ <b>AOT:</b> Many robustness updates to the ahead-of-time
+ compiler and a new locking and threading system that avoids
+ having "big locks" around the mono kernel, and moves to a
+ fine-grained locking system. The design includes a lattice to
+ avoid deadlocks.
+
+ <b>Dogfooding:</b> We are now running Mono's ASP.NET on
+ go-mono.com to find problems. It is currently hosting our
+ Monodoc documentation. The <a
+ href="http://www.go-mono.com/docs/index.html">Apache module
+ version</a> and the <a href="http://www.go-mono.com:8080/">XSP
+ version</a>.
+
+ <b>WSE:</b> The Web Services Enhancements season has begun.
+ The Microsoft.Web.Services namespace and classes are now
+ checked into CVS.
+
+@item Sep 1st, 2003: Ice for Mono; XmlSerializer generators; Monodoc progress.
+
+ <b>Ice:</b> Vladimir has checked into CVS (Module ginzu) an
+ implementation of <a href="http://www.zeroc.com">ZeroC's</a>
+ <a href="http://www.zeroc.com/ice.html">ICE</a> protocol. It
+ is implemented using Remoting. If you were looking for an
+ efficient binary protocol to use with Remoting, this is it.
+
+ ICE is simpler to use than CORBA, and was created by people
+ who were deeply involved in CORBA and wanted to fix its
+ problems (you can see a <a
+ href="http://www.zeroc.com/iceVsCorba.html">list of
+ differences</a>).
+
+ <b>XmlSerializer</b>: Lluis has checked in a new technology
+ for use in our XmlSerializer: the XmlSerializer code
+ generator. Currently our XmlSerializer generates a
+ description of instructions for serializing data, these
+ instructions are later interpreted while using it: Reflection
+ is used to pull all the data. The code generator is the first
+ step into turning the Serializer from an intepreter into a
+ compiler and improving the performance of it.
+
+ Currently was used internally to implement the WSDL
+ serializer, in the future it will just be part of the standard
+ serialization process.
+
+ <b>MonoDoc:</b> New providers! Thanks to <a
+ href="http://www.jaggersoft.com/">Jon Jagger</a> for providing
+ us with his master XML files for the C# specification we now
+ have integrated the C# spec into Monodoc. Another provider is
+ the Error provider: now we include all the C# compiler errors
+ in the help system.
+
+ Alp has contributed various user interface improvement, and
+ updated our list widget for key navigation; Ben made the
+ matches window more useful and Joshua has helped us clean up
+ the ECMA provider even more.
+
+@item Aug 14th, 2003: Mono 0.26 has been released
+
+ A new version of Mono is available, the new features include:
+ <a href="http://www.cairographics.org/">Cairo support</a>, <a
+ href="http://remoting-corba.sf.net">Remoting.Corba</a>
+ support, as well as a managed XSLT implementation.
+
+ Existing features have been improved vastly: better
+ Windows.Forms, runtime, faster compiler, web services, better
+ compliance to the spec and more.
+
+ Check out the <a
+ href="http://www.go-mono.com/archive/mono-0.26.html">Release
+ notes</a> for details.
+
+@item Aug 9th, 2003: Python for .NET Preview 2 available; Mono Documentation site up.
+
+ Brian Lloyd has <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-August/015313.html">announced</a>
+ the availability of his Python binding to .NET. This works
+ with .NET and Mono. For more information about it, see
+ Brian's site at <a href="
+ http://zope.org/Members/Brian/PythonNet/">http://zope.org/Members/Brian/PythonNet/</a>
+
+ We have uploaded the current Mono Documentation (core
+ libraries and Gtk#) to <a
+ href="http://mono.ximian.com:8080"/>http://mono.ximian.com:8080</a>.
+ The site is running the ASP.NET edition of <a
+ href="archive/monodoc-0.6.tar.gz">MonoDoc 0.6</a> on XSP.
+
+@item Aug 6th, 2003: Winforms samples
+
+ Timothy Parez is coordinating the effort to create sample
+ programs that exercise the various Windows.Forms controls. We
+ are using this as graphical regression test suite for the Mono
+ implementation.
+
+ The screenshots of the various widgets, together with the
+ source code is available on the <a
+ href="http://www.nullenvoid.com/mono/wiki/index.php/WineSamples">WineSamples</a>
+ page on the <a
+ href="http://www.nullenvoid.com/mono/wiki/">Mono Wiki</a>.
+
+ A new cvs module called `winforms' has been created that
+ contains the source code for the samples. To run the samples,
+ you can install the WineLib packages available from our <a
+ href="download.html">download page</a>.
+
+@item Aug 5th, 2003: New Apache Module architecture: 1.3 and 2.x supported
+
+ Gonzalo rearchitected our Apache module for hosting Mono and
+ ASP.NET. The previous incarnation hosted a Mono runtime on
+ each Apache process, which lead to a slow setup for webforms.
+ The new setup uses a shared mono process for all the incoming
+ requests. Daniel later improved up the new architecture and
+ added dual support, so now in addition to Apache 2.x, we
+ support Apache 1.3 with the same codebase.
+
+ The new code is available on CVS, on module `mod_mono', and
+ now requires an XSP installation to be available.
+
+@item Aug 4th, 2003: Ximian acquired by Novell.
+
+ Today <a href="http://www.novell.com">Novell</a> acquired <a
+ href="http://www.ximian.com">Ximian</a>. The press release is
+ available <a
+ href="http://www.ximian.com./about_us/press_center/press_releases/index.html?pr=novell">here</a>.
+
+ Mono and Gnome form an integral part of the Novell strategy.
+
+@item Jul 30th, 2003: Remoting.CORBA, Managed XSLT.
+
+ Today Lluis announced that Mono CVS contains all the fixes to
+ run <a
+ href="http://remoting-corba.sourceforge.net/">Remoting.CORBA</a>:
+ both client and server channels work; We are interested in people
+ testing it with other ORBs.
+
+ Ben checked-in today his managed implementation of Xslt that
+ we mentioned on Jul 19th; This uncovered various limitations
+ on the XPath implementation, which Piers has swifly removed.
+ Monodoc, NUnit and our Corcompare work with it. Since this is
+ implementation is not completed yet, we still support the
+ libxslt-based version by default. For more details on how to
+ try the new XSLT implementation, see <a
+ href="http://lists.ximian.com/archives/public/mono-devel-list/2003-July/001681.html">Ben's
+ post</a>
+
+@item Jul 27th, 2003: Wine packages and Daily Snapshots
+
+ MonoWine packages (used to run System.Windows.Forms) software
+ are now available from our (<a
+ href="download.html">download</a> page). You can track the
+ progress on our <a
+ href="http://www.nullenvoid.com/mono/wiki/index.php/WineSamples">Wiki
+ page.</a>
+
+ We're now building daily snapshots of Mono. They come in
+ three distinct flavors:
+
+ <ul>
+ * mono snapshot tarballs - These are 'release-style' tarballs and
+ contain everything necessary to setup a new
+ installation from scratch. This includes the Mono
+ runtime and all the assemblies we distribute.
+
+ * monocharge tarballs - These tarballs contain only
+ the assemblies built on that day.
+
+ * monolite tarballs - These tarballs contain a copy of
+ 'corlib.dll', 'mcs.exe', 'System.dll', 'System.Xml.dll' and
+ 'Mono.CSharp.Debugger.dll'. They can be used to
+ re-bootstrap an out-of-sync installation.
+ </ul>
+
+ The daily builds are availble here: <a href="http://go-mono.com/daily">http://go-mono.com/daily</a>
+
+ If you find that the builds are broken, please notify Duncan.
+
+@item Jul 19th, 2003: Recent developments
+
+ Since Mono has matured, we have limited the news on the site
+ to major accomplishments that are finished, but this week, it
+ is worth devoting some time to talk about some of the
+ work-in-progress projects that are progressing.
+
+ Jackson has added support to the IL assembler for generics as
+ well as to the PEAPI library, and it has assembled its first
+ generic program. Support for handling images with generics
+ has been on our file format reader for a while, but the JIT
+ engine is still incomplete.
+
+ On the XSLT world, Atsushi and Ben continue to make big
+ improvements. Ben recently got the prototype managed XSLT
+ implementation to run its first stylesheet. Although
+ currently Mono uses libxslt to implement the System.Xml.Xsl
+ namespace, to have a fully .NET compliant implementation we
+ will need a managed version, and this is the beginning of it.
+
+ Lluis recently posted an update on the <a
+ href="http://lists.ximian.com/archives/public/mono-devel-list/2003-July/001550.html">state
+ of WSDL</a> in Mono. Now that the web services runtime is
+ ready, the WSDL compiler becomes more important as a
+ development tool.
+
+ Atsushi continues his work on the DTD validating reader in
+ System.Xml, as well as improving our XML Schema support.
+
+@item Jul 14th, 2003: New build system; IPV6 support.
+
+ Peter Williams has contributed a new build system that
+ addresses many of the annoyance we had with our previous build
+ system. He has worked on this for a few weeks, and Gonzalo
+ helped test it and get it into CVS. We no longer have the
+ historical dual build system: make for Unix and nant for
+ Windows.
+
+ This system also offers the opportunity to compile our class
+ libraries with different profiles (.NET 1.0, .NET 1.1 and the
+ various ECMA subsets).
+
+ Peter explains the new build system <a
+ href="http://lists.ximian.com/archives/public/mono-devel-list/2003-July/001506.html">here</a>
+
+ Jerome's IPV6 code has been checked into CVS; With Peter's new
+ build system, we will be able to expose it (as part of the
+ NET_1_1 build).
+
+@item Jul 9th, 2003: ASP.NET web services, coverage tools.
+
+ Web Services keep advancing: now we also support server-side
+ authoring of Web Services as well as web service clients
+ (which shipped in Mono 0.25). This works using our ASP.NET
+ runtime, so it works with either XSP or the Apache module. The
+ new Web Services work from Lluis added the missing bits:
+ <ul>
+ <li> .asmx files.
+ <li> Method calls with complex parameters (whatever XmlSerializer can currently serialize, which is a quite a lot).
+ <li> ref and out parameters.
+ <li> Soap headers (In, Out and InOut).
+ <li> Soap extensions, both global (configured in web.config) and particular to methods (configured using attributes).
+ </ul>
+
+ For more details, see Lluis <a href="http://lists.ximian.com/archives/public/mono-devel-list/2003-July/001449.html">post</a>
+
+ GUI-wise: Work on <a href="http://xr.xwin.org">Xr</a> to
+ implement System.Drawing continues. This will provide a full
+ GDI+ implementation for Mono, and this will be hooked up into
+ Gtk# and System.Windows.Forms.
+
+ MonoDoc keeps moving along, with a new web-based version
+ coming up next, and we are also exploring a collaborative
+ extension to allow people to contribute documentation through
+ their web browsers.
+
+ Zoltan's Coverage analysis tool has been checked into CVS.
+ With this tool it is now possible to find which class library
+ code paths are missing regression tests. The module is
+ `monocov'. Details are <a
+ href="http://www.nexus.hu/vargaz/">here</a>. A fresh Gtk#
+ version is available now.
+
+ Jean's remoting-based Soap implenentation is also maturing.
+
+@item Jun 26th, 2003: Mono 0.25 has been released.
+
+ We have released Mono 0.25. A list of the new features is
+ available <a href="archive/mono-0.25.html">here</a>.
+
+ Packages for Windows, and various Linux distributions are
+ available on our <a href="download.html">download</a> page.
+
+@item Jun 17th, 2003: Web Services client; Profiling hooks
+
+ Lluis and Gonzalo have checked into CVS the support for web
+ services in the Mono runtime. This allows Mono to work as a
+ web services client. We still require a WSDL compiler to
+ compile the initial stub, but Erik has the beginning of a WSDL
+ compiler ready and Atsushi has continued work on his
+ experimental Xml Schema to C# class generator.
+
+ As part of this, the Mono Http runtime has been rewritten to
+ increase reliability, scalability and conformance to the
+ specs. Also our io-layer has been extended to not have
+ arbitrary limits. This was done as part of our collaboration
+ with SourceGear.
+
+ Paolo has commited the new pluggable profiling API to the Mono
+ runtime: now the profiler is built as a module, and a new code
+ coverage analysis has been checked in (and Zoltan already
+ added improvements to it).
+
+ Mark's Mozilla bindings continue to improve, and we will shortly
+ migrate the Mono documentation browser to use Mozilla, to take
+ advantage of the tutorial's use of CSS.
+
+ Jackson's work on the IL assembler and Ben on running
+ regression tests have provided us with a very needed tool in
+ the Mono toolkit. One of the last missing pieces on the SDK.
+
+ On the crypto world, we got Sebastien's certificate viewer
+ checked into CVS and the crypto code keeps advancing by leaps
+ and bounds.
+
+ Alexandre and Aleksey Work continues on Windows.Forms on top
+ of Wine and Gtk# (the former for full compatibility, the later
+ for ease-of-authoring).
+
+ Cesar checked in the beginning of the semantic analysis code
+ for his JScript compiler, and will be working on it full time.
+
+@item Jun 11th, 2003: SourceGear and Ximian announce partnership
+
+ Ximian, Inc., the leading provider of desktop and server
+ solutions enabling enterprise Linux adoption, today announced
+ that SourceGear Corporation will use Mono\x{2122} Project
+ technology to offer cross-platform versions of its
+ products. In addition, the companies have entered into a
+ development partnership under which Ximian will provide
+ custom Mono development to enable delivery of SourceGear
+ products later this year. As a result, SourceGear will offer
+ both UNIX and Linux clients for its SourceGear Vault source
+ code management tool, enabling broader use of its solutions in
+ mixed-platform development organizations.
+
+ <a href="http://www.ximian.com/about_us/press_center/press_releases/index.html?pr=sourcegear">Read more...</a>
+
+ Some technical details are available <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-June/014334.html">here</a>.
+
+@item May 20th, 2003: OpenLink releases WineLib patches.
+
+ OpenLink <a
+ href="http://lists.ximian.com/archives/public/mono-winforms-list/2003-May/000284.html">announced</a>
+ the release of Vladimir's work to turn Wine into a library
+ that can be used dynamically from Mono. This work simplifies
+ the work on System.Windows.Forms as it is no longer necessary
+ have a special version of the GC, nor have a stub program.
+ The patches are available <a
+ href="http://www.openlinksw.com/mono/">here</a>.
+
+ Mono packages for the Linux/s390 are available now in the <a
+ href="download.html">download page</a>.
+
+@item May 10th, 2003: Eclipse runs on Mono
+
+ Today Zoltan Varga announced that he got the <a
+ href="http://www.eclipse.org">Eclipse IDE</a> running on top
+ of Mono+<a href="http://www.ikvm.net">IKVM</a>.
+
+ A screenshot of Eclipse running with Mono can be found <a
+ href="images/ikvm-screenshot.png">here</a>
+
+@item May 6th, 2003: Mono 0.24 ships
+
+ We have released Mono 0.24 which includes our new code
+ generation engine. A list of the new features is available <a
+ href="archive/mono-0.24.html">here</a>.
+
+ Packages for Windows, and various Linux distributions are
+ available on our <a href="download.html">download</a> page.
+ We are shipping Gtk# and MonoDoc packages for the first time.
+
+@item Apr 21st, 2003: Virtuoso 3.0 ships.
+
+ <a href="http://www.openlinksw.com">OpenLink's</a> released
+ their <a href="http://www.openlinksw.com/press/virt3rel.htm">Virtuoso
+ 3.0</a> database system. Virtuoso ships on Windows and Linux.
+ On Linux they use Mono as their runtime to host C#, .NET and
+ ASP.NET. Congratulations to OpenLink for their release.
+
+ Virtuoso can be downloaded <a
+ href="http://oplweb2.openlinksw.com:8080/download/virtuoso.vsp">here</a>
+ and a demo is available <a
+ href="http://demo.openlinksw.com:8890/tutorial/hosting/ho_s_2/ho_s_2.vsp">here</a>.
+
+ OpenLink is contributing fixes and code to the Mono project on
+ an ongoing basis.
+
+ Jon Udell wrote a small <a
+ href="http://www.infoworld.com/article/03/03/14/11stratdev_1.html">entry</a>
+
+@item Apr 19th, 2003: RelaxNG validating reader; Activities.
+
+ Atsushi has created a <a
+ href="http://www24.brinkster.com/ginga/RelaxngValidatingReader/">RelaxNG</a>
+ validating XML reader.
+
+ There is activity on the <a
+ href="http://www.gotmono.com">GotMono forums</a> and the <a
+ href="http://www.nullenvoid.com/gtksharp/wiki/">Gtk# Wiki</a>
+
+@item Apr 11th, 2003: First Mono Book is out; Team pages.
+
+ The first book to cover Mono is out. This book is currently
+ only available in German, you can find it <a
+ href="http://www.amazon.de/exec/obidos/ASIN/3827264928/qid=1050051051/sr=2-1/ref=sr_2_3_1/028-2755135-1623712">here</a>
+
+ We now have a page for the <a href="team.html">Mono Team</a>
+ where we include a list of some of the people who have made
+ Mono possible. If you have CVS access, please update the page
+ to include your information.
+
+@item Apr 5th, 2003: New compilation engine.
+
+ The new Mono compilation engine has been placed on CVS, the
+ details are <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-April/013269.html">here</a>
+
+ Zoltan has commited his <a
+ href="http://lists.ximian.com/archives/public/mono-devel-list/2003-April/000274.html">typed
+ allocation</a> patches to CVS as well.
+
+@item Apr 3rd, 2003: NUnit 2.0 GTK# GUI; GtkMozEmbed; SWT#
+
+ Gonzalo has checked in his <a href="http://gtk-sharp.sf.net">Gtk#</a>-based
+ <a href="http://nunit.org">NUnit</a> tool. Screenshots are <a
+ href="http://primates.ximian.com/~gonzalo/mono/shots/running.png">here</a>
+ and <a
+ href="http://primates.ximian.com/~gonzalo/mono/shots/finished.png">here</a>
+
+ Mark has checked his bindings for Gtk-based Mozilla into CVS,
+ module name: `GtkMozEmbed'. Read the <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-April/013247.html">details</a>
+
+ The SWT port to C# using Gtk is <a
+ href="http://lists.ximian.com/archives/public/sd-mono-port/2003-March/000114.html">progressing</a>. Screenshots are
+ <a href="http://www.roboto.ch/swt">here</a>.
+
+@item Mar 28th, 2003: Mono community site.
+
+ <a href="http://www.gotmono.com">www.gotmono.com</a> has
+ openend its door: Got Mono is a Mono Community site.
+
+@item Mar 25th, 2003: Second Mono Survey
+
+ <table width="100%" cellpadding="0" cellspacing="1" border="0" bgcolor="blue">
+ <tr>
+ <td valign="top">
+ <div style="background: #c0d0ff; margin: 0px 0px 0px 0px; padding: 1px;">
+ What do you think about Mono?
+
+ Is your company involved with the development and
+ deployment of web applications? Is Linux becoming an
+ important part of your company's business application
+ strategy? Are you considering Mono for your next
+ project? Would you like to shape the future of Mono
+ and the use of Linux in business critical
+ applications?
+
+ If you answered yes to any of these questions, we
+ would like to talk with you. If interested, please
+ email us at <a
+ href="mailto:mbadgett@ximian.com">mbadgett@ximian.com</a>.
+ </div>
+ </td>
+ </tr>
+ </table>
+
+@item Mar 20th: Windows.Forms and Wine.
+
+ Alexandre has provided a modified version of the GC system
+ that will work with and Mono. See the mono-winforms-list. It
+ is now possible to run our Win32-based implementation of
+ Windows.Forms with Mono on Linux.
+
+@item Mar 7th, 2003: Mono 0.23
+
+ A new freshly baked release of Mono is available. Release
+ notes are <a href="archive/mono-0.23">here</a>. This is mostly a
+ bug fix release. No new features.
+
+@item Mar 5th, 2003: Mono 0.22; MonoDoc 0.2; Debugger 0.2.1: Release-o-Rama.
+
+ Mono 0.22 has been released. See the <a
+ href="archive/mono-0.22">release notes</a>. This is a bug fix
+ release.
+
+ A new preview of MonoDoc 0.2, the Mono Documentation browser
+ has been <a href="http://lists.ximian.com/archives/public/gtk-sharp-list/2003-March/001266.html">released</a>.
+
+ Martin also announced a <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-March/012756.html">new
+ release</a> of the Mono Debugger (both GUI and command line).
+
+@item Mar 3rd, 2003: The Mono Hackers Hall Of Fame welcomes Zoltan Varga
+
+ The <a href="hackers.html">Mono Hackers Hall Of Fame</a>
+ continues to show our appreciation to the excellent
+ contributors that make <b>mono::</b> a successful free
+ software project.
+
+ Zoltan has contributed significantly to Mono, with bug reports and bug
+ fixes as well as pushing the envelope of the things that can be done in
+ and with the mono runtime: the gcc-based ngen compiler, code coverage
+ and more recently his work with Reflection.Emit that got mono to the
+ point of running the <a href="http://www.ikvm.net">IKVM</a> Java virtual
+ machine.
+
+@item Mar 2nd, 2003: New Mono mailing list.
+
+ A new mailing list for <a
+ href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">Mono
+ Development</a> has been created.
+
+@item Feb 27th, 2003: Mono 0.21 released
+
+ Mono 0.21 has been released. This is only a bug fix release.
+ The <a href="archive/mono-0.21">release notes</a> are available.
+
+ Windows binary is available <a href="archive/mono-0.21-win32-1.exe">here</a>
+
+@item Feb 25th, 2003: Mono 0.20 for Windows released; New Apache module released.
+
+ Packages of Mono for Windows have been <a
+ href="archive/mono-0.20-stable-win32-2.exe">released</a>.
+ Thanks to Daniel, Johannes and Paolo for setting this up.
+
+ Daniel has released a new version of his Mono Apache module that
+ handles ASP.NET. The code is available at <a
+ href="http://apacheworld.org/modmono/">here</a>
+
+ Nick has posted an update on the progress on our <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-February/012467.html">regression
+ tests</a>. We are looking for more tests, and more volunteers to write them.
+
+ Also, remember to contribute to the Gtk# documentation effort,
+ momentum is picking up! See the entry for Feb 18th for more details.
+
+@item Feb, 23rd, 2003: Mono 0.20 released; Gtk# 0.8 released.
+
+ Mono 0.20 has been released. Check out the <a
+ href="archive/mono-0.20">release notes</a> for an overview of
+ the changes. You can get it <a href="download.html">here</a>.
+ There are no major features in this release, mostly bug fixes
+ and performance improvements.
+
+ Gtk# 0.8 has been <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2003-February/001114.html">released</a>
+
+ <b>Important</b>: The contributed binaries for Windows
+ binaries of Mono 0.20 contain a virus. Please read <a
+ href="virus.html">this</a> if you installed the binary.
+
+@item Feb 18th, 2003: Volunteers to document Gtk#
+
+ With the availability of a documentation browser, we are
+ looking for volunteers to help us complete the documentation
+ of the Gtk# binding for Mono.
+
+ Experience with Gtk is useful, but not mandatory. We have
+ checked in stubs, and we have instructions, and resources to
+ how to complete this process <a
+ href="documentation.html">here</a>. Mail the <a
+ href="mailto:mono-docs-list@ximian.com">mono-docs-list@ximian.com</a>
+ for further discussion.
+
+@item Feb 14th, 2003: OpenGL# bindings for Mono; Mono Basic updates.
+
+ Mark Crichton has completed his OpenGL/GLUT bindings for
+ Gnome. A screenshot can be seen <a
+ href="sshots/oglcs.png">here</a>. The bindings are available
+ on the Mono CVS repository on the module `glgen'. This is a
+ straight binding to the C API.
+
+ Marco has <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-February/011752.html">posted
+ an update</a> on the current state of the free VB.NET compiler
+ for Mono.
+
+ We are looking for contributors and maintainers to the
+ JavaScript compiler as well (Janet)
+
+@item Feb 12th, 2003: New assemblies, Gtk# stub documentation, Authenticode, Polish site
+
+ Mono now distributes a few new assemblies: Mono.Security.Win32
+ as a layer to use the crypto functionality on Win32. The
+ Mono.Posix assembly which contains functionality for taking
+ advantage of Unix facilities.
+
+ A <a href="http://www.go-mono.pl/">Mono site in Poland</a>.
+
+ Stubs for the Gtk# documentation have been checked into CVS.
+ If you want to contribute please read <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-February/012108.html">this
+ message</a>
+
+ Mono development is moving quickly: Tim and Daniel have been
+ improving the Oracle database provider and Sebastien Pouliot
+ has got code signing to work using Authenticode with pure open
+ source and managed code. Plenty of new VB.NET work from Marco
+ (compiler) and Daniel (runtime). Also Jackson has resumed
+ work on the IL assembler and the fully managed library to
+ generate CIL images (Sergey wrote the first Mono.PEToolkit).
+
+@item Feb 11th, 2003: Mono Weekly News, New assemblies.
+
+ <a href="http://monoevo.sourceforge.net/mwn/index.html">Mono
+ Weekly News</a>: Includes a new interview, software
+ announcements and the PHP/Mono integration.
+
+@item Feb 5th, 2003: MonoDoc 0.1
+
+ A <a
+ href="http://www.go-mono.com/archive/monodoc-0.1.tar.gz">preliminary
+ release</a> of the Mono Documentation Browser is now availble.
+ Release <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-February/011935.html">notes</a>
+
+@item Jan, 22th, 2003: Mono wins award, OpenLink releases Virtuoso.
+
+ Mono won the `Best Open Source Project' award at the Linux
+ World Expo. A description is <a
+ href="http://linuxtoday.com/news_story.php3?ltsn=2003-01-23-024-26-OP-EV">here</a>
+
+ Open Link has a <a
+ href="http://biz.yahoo.com/prnews/030123/neth013_1.html">press
+ release</a> about Virtuoso 3.0: the first commercial product
+ shipping that uses Mono.
+
+@item Jan, 20th, 2003: Mono 0.19 released; Screenshots page; Gtk# 0.7
+
+ Mono 0.19 has been released. Check out the <a
+ href="archive/mono-0.19">release notes</a> for an overview of
+ the changes. You can get it <a href="download.html">here</a>.
+ There are no major features in this release, mostly bug fixes
+ and performance improvements.
+
+ We have now a new section <a href="screenshots.html">with
+ screenshots</a> of various Mono applications. You can see
+ there the new released Debugger, as well as the work in
+ progress on the documentation browser.
+
+ <a href="http://gtk-sharp.sf.net">Gtk# 0.7</a> has been <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-January/005222.html">released</a>
+
+@item Jan, 19th, 2003: Mono Debugger released.
+
+ After six month of extensive development, Martin Baulig has
+ released the first version of the Mono debugger. The Mono
+ debugger is written in C# and can debug both managed and
+ unmanaged applications, support for multiple-threaded
+ applications and should be relatively easy to port to new
+ platforms.
+
+ Details of the release are available in <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-January/005192.html">post</a>.
+
+ The debugger contains both Gtk# and command line interfaces.
+ The debugging file format used in Dwarf (its already supported
+ by our class libraries and the Mono C# compiler; To debug C
+ applications, you need a recent GCC, or to pass the -gdwarf-2
+ flag to gcc).
+
+@item Jan, 17th, 2003: DB2 provider, MacOS X
+
+ Christopher Bockner has contributed a DB2 System.Data client.
+
+ MacOS X support on the runtime has been integrated into the
+ distribution, and MCS works with it.
+
+ Zoltan has managed to get <a
+ href="http://radio.weblogs.com/0109845/">IKVM</a> (a Java VM
+ for .NET) to run with Mono. The HelloWorld.class runs with
+ the Mono runtime.
+
+@item Jan, 13th, 2003: Mono 0.18 released
+
+ Mono 0.18 has been released. Check out the <a
+ href="archive/mono-0.18">release notes</a> for an overview of
+ the changes. You can get it <a href="download.html">here</a>.
+
+@item Jan 10th, 2003: Mono Weekly News.
+
+ A new issue of the <a
+ href="http://lists.ximian.com/archives/public/mono-list/2003-January/004903.html">Mono
+ Weekly News</a> has been published.
+
+ Check out the <a href="crypto.html">Crypto status</a> page
+ that Sebastien has put together.
+
+@item Jan 3rd, 2003: Glade#, Code Coverage, Apache, MBas, Debugger.
+
+ Rachel has made Glade# use attributes so binding C# widgets to
+ the designed widgets is now easier than ever. Alp has
+ improved this to use implicit names as well.
+
+ Martin's Mono debugger now has support for multi-thread
+ debugging. Special feature: breakpoints can be defined in a
+ per-thread basis now.
+
+ Daniel López has checked in his Apache module to integrate
+ Mono and Mono's ASP.NET support as an Apache module. Gonzalo
+ has folded his new Mono hosting classes into this module (they
+ are now shared between XSP and mod_mono). You can get the
+ mod_apache from CVS (module name: mod_mono).
+
+ Mono Basic improvements: Marco has added support for more
+ statements on the grammar.
+
+ Zoltan has <a href="http://www.nexus.hu/vargaz2/">posted</a>
+ his Code Coverage analysis tool for Mono.
+
+@item Dec 17th, 2002: Mono: Commercial uses.
+
+ <a href="http://www.tipic.com">Tipic</a> today <a
+ href="http://www.ximian.com/about_us/press_center/press_releases/index.html?pr=tipic_mono">announced</a>
+ their work on porting their Instant Messaging Server platform
+ to run on Mono.
+
+ <a href="http://www.winfessor.com">Winfessor</a> also <a
+ href="http://www.winfessor.com/press.asp">announced</a> the
+ availability of their Jabber SDK to run on Mono.
+
+ Also two weeks ago we mentioned <a
+ href="http://www.openlinksw.com">OpenLink Software's</a> <a
+ href="http://www.ximian.com/about_us/press_center/press_releases/index.html?pr=openlink_mono">announcement</a>
+ of their product, also using Mono.
+
+@item Dec 10th, 2002: Gtk# 0.6 released; Mono 0.17 packages for Windows and Debian.
+
+ Mike Kestner <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-December/003961.html">announced
+ Gtk# 0.6</a>. This new release includes many new features and
+ bug fixes, and is the perfect companion to the <a
+ href="archive/mono-0.17">Mono 0.17</a> release.
+
+ Johannes has contributed a Windows-ready package of Mono 0.17,
+ and its available from our <a
+ href="download.html">download</a> page.
+
+ Alp Toker has <a href="http://www.atoker.com/mono/">Debian packages</a>
+
+@item Dec 9th, 2002: Mono 0.17 has been released
+
+ Mono 0.17 has been released. Check out the <a
+ href="archive/mono-0.17">release notes</a> for a more detailed
+ list. You can get it <a href="download.html">here</a>.
+
+ Many new features as well as plenty of bug fixes. Many new
+ System.Data providers and a more mature System.Web (ASP.NET)
+ which can now be hosted in any web server. A simple <a
+ href="archive/xsp-0.2.tar.gz">test web server</a> to host
+ asp.net has been released as well.
+
+ This version also integrates Neale's s390 port.
+
+ This release also includes a new exception handling system
+ that uses the gcc exception information that vastly improves
+ our internalcall speed (15% faster mcs compilation times).
+
+@item Dec 8th, 2002: VB.NET, Oracle Provider.
+
+ Marco has got the Mono Basic compiler up to speed (support for
+ classes, modules, expressions, object creation, method
+ invocation, local variables, and some statements). The
+ compiler is based on the work from Rafael Teixeira on MCS.
+
+ Screenshots: <a
+ href="http://modgb.sourceforge.net/monobasic_snap.png">in
+ Windows doing Windows.Forms</a> and in Linux doing <a
+ href="images/gtk-vb.png">VB with Gtk#</a> (courtesy of Alp).
+
+ Daniel Morgan has checked in his Oracle provider to the CVS
+ repository as well.
+
+@item Nov 27th, 2002: Press release, tutorials, Windows Forms, ADO.NET, Magazine.
+
+ <a
+ href="http://www.business2.com/articles/mag/0,1640,45454,FF.html">The
+ Penguin Takes Flight</a>: an article written by Erick
+ Schonfeld appears on the December issue of <a
+ href="http://www.business2.com/">Business 2.0</a> magazine.
+
+ <a href="http://www.openlinksw.com">OpenLink</a> and <a
+ href="http://www.ximian.com">Ximian</a> made <a
+ href="http://www.ximian.com/about_us/press_center/press_releases/index.html?pr=openlink_mono">joint
+ announcement</a> on the plans of OpenLink to ship their <a
+ href="http://www.openlinksw.com/virtuoso/index.htm">Virtuoso</a>
+ server on Unix using Mono.
+
+ Martin Willemoes's <a href="gnometutorial">GNOME.NET
+ tutorial</a> is now available from the main Mono site. This
+ tutorial is a collaborative effort to teach developers how to
+ use Mono to create Mono applications using <a href="http://gtk-sharp.sf.net">Gtk#</a>
+
+ Dennis Hayes has posted and <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-December/003800.html">update</a>
+ on the work to get Windows.Forms working on Mono. There is a
+ new test application that people can use to test their
+ controls. If you are interested in working on Windows.Forms,
+ you can participate in the <a
+ href="http://lists.ximian.com/mailman/listinfo/mono-winforms-list">mono-winforms
+ mailing list</a>
+
+ Brian Ritchie has been working on an ADO.NET <a
+ href="http://brianritchie.webhop.net/ideas/adocodegen.aspx">data
+ layer</a> and an <a
+ href="http://brianritchie.webhop.net/ideas/appserver.aspx">application
+ server</a> for Mono.
+
+ Dan Morgan has checked in his Oracle provider, and Tim Coleman
+ continues to work on the TDS implementation of the data classes.
+
+ The rest of the team has been working on bug fixing in the
+ runtime, the compiler, and the class libraries. Also,
+ compilation speed has increased recently by performing a
+ number of simple optimizations in the compiler.
+
+@item Nov 19th, 2002: Crypto update; Books; Gtk# Datagrid; .NET ONE Slides
+
+ Sebastien has got DSA and RSA signatures <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-November/003497.html">working</a>
+ as well as RSA <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-November/003502.html">encryption</a>.
+ We now distribute Chew Keong TAN's BigInteger classes.
+
+ Brian has contributed a System.Data multiplexor in Mono, it
+ can be found in the Mono.Data assembly. The details of this
+ new technology are <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-November/003400.html">here</a>.
+ It works in Mono and the .NET Framework.
+
+ Larry O'Brien has announced the candidate book for <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-November/003500.html">
+ Thinking in C#</a>. The book is Mono-friendly.
+
+ Another book that covers mono (available in German only) is <a
+ href="http://www.databecker.de/frames.php?PHPSESSD=4948515556575049525459495248485949485348&PHPSESSID=6cc68dbcfbcbacd7b82a984b0700d5d6&t=2">
+ here</a>.
+
+ Dan Morgan has implemented a DataGrid widget for Gtk#, you can
+ see Windows screenshots for it <a
+ href="images/GtkSharpDataGridScreenshot.png">here</a> and <a
+ href="images/SqlSharpGtkScreenshot4.png">here</a>.
+
+ Slides from the Mono developers for the .NET ONE conference are available now:
+ <ul>
+ <li><a
+ href="http://primates.ximian.com/~miguel/slides-europe-nov-2002/DotNetOneKeynote.sxi">
+ Mono Keynote presentation</a>
+
+ <li><a href="http://primates.ximian.com/~lupus/slides/embed/">Hosting the Mono Runtime</a><br>
+ The simple embedding of Mono in Perl is available <a
+ href="http://primates.ximian.com/~lupus/slides/embed/Mono-0.01.tar.gz">here</a>
+
+ <li><a href="http://primates.ximian.com/~lupus/slides/jit/">The Mono JIT compiler</a>
+
+ <li><a href="http://primates.ximian.com/~miguel/slides-europe-nov-2002/Mono_C_Sharp_Overview_1007.sxi">
+ Mono C# Compiler Overview</a>
+ </ul>
+
+ A couple of other presentations from Miguel's trip to Europe
+ are available <a
+ href="http://primates.ximian.com/~miguel/slides-europe-nov-2002/">here</a>
+ in Open Office file format.
+
+@item Nov 8th, 2002: Mono s390, Database work, new JIT updates.
+
+ Neale Ferguson has contributed <a href="download.html">RPM
+ packages</a> of Mono for the Linux/s390.
+
+ Tim Coleman posted an <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-November/003329.html">update</a>
+ on the improvements in the System.Data
+
+ The new JIT engine can run 72 out of our 154 tests for the
+ virtual machine, and it also got exception support this week.
+
+@item Nov 1st, 2002: TDS, Crypto, Gtk#, Winforms, bug fixes.
+
+ Tim's SqlClient is <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-November/003161.html">now
+ capable</a> of communicating with the Microsoft SQL server
+ using the TDS protocol. A screenshot showing a sample client
+ running with <a href="http://gtk-sharp.sf.net">Gtk#</a> on
+ Windows is shown <a
+ href="images/SqlSharpGtkSceenshot3.png">here</a>
+
+ Sebastien has made all symetric ciphers functional on all
+ supported modes; All the classes in Security.Cryptography are
+ present and the X590 certificates are now in too. Jackson has
+ been working on the Security classes.
+
+ Many bug fixes all over the place: class libraries (Dick,
+ Piers, Ville, Zoltan, Gonzalo, Dan, Atsushi, Nick, Phillip),
+ compiler, runtime engine. A big thank goes for everyone who
+ has been providing bug reports for us to track down.
+
+ Gaurav has been working on multiple WebControls. Gonzalo migrated
+ the ASP.NET engine to use POST for interaction.
+
+ In the Gtk# land saw the integration of gda, gnome-db and GStreamer
+ bindings.
+
+ Windows.Forms classes now build on Linux and Windows, check
+ out the status pages for areas of collaboration.
+
+@item Oct 24th, 2002: S390 support, XSP/ASP.NET, Win32 contributors, TDS.
+
+ Today Neal Ferguson's support for the IBM S390 was checked
+ into CVS.
+
+ The XSP processor has been fully integrated into the
+ System.Web assembly, and Gonzalo has finished the hosting
+ interfaces in Mono. This means that it is possible to embed
+ ASP.NET with the same APIs used in Windows, and is possible to
+ easily embed it with Apache for example. The XSP module has
+ now become a shell for testing the System.Web classes.
+
+ We are looking for contributors that know Win32 to contribute
+ to the Windows.Forms implementation. If you want to help
+ write some controls using the Win32 API, get in touch with our new <a
+ href="http://lists.ximian.com/mailman/listinfo/mono-winforms-list">mono-winforms-list@ximian.com
+ list</a> mailing list.
+
+ Tim's TDS System.Data set of classes can now talk to SQL
+ servers using the TDS protocol (version 4.2) with
+ connection pooling. Currently it can connect, run
+ transactions, update/insert/delete, and read some types. A
+ data adapter is also coming soon.
+
+@item Oct 21th, 2002: Crypto, Winforms list, Database, GConf, Debugger.
+
+ Sebastien Poliot has made a lot of progress, he reports that
+ DES and TripleDES have been fixed; Rijndael and CFB modes
+ still have problems in some configurations and some areas that
+ are not supported by the .NET framework.
+
+ Last week we created a new <a
+ href="http://lists.ximian.com/mailman/listinfo/mono-winforms-list">mailing
+ list</a> to discuss the Mono Winforms implementation.
+
+ Tim has started a full C# implementation of the TDS protocol
+ and the providers, and Brian continues his work on his ODBC
+ binding.
+
+ Rachel Hestilow has also checked in a binding for GConf. This
+ binding <a
+ href="http://toxic.magnesium.net/~hestilow/gconfsharp/intro.html">is
+ unique</a> in that it uses some features in the CLI to support
+ complex data types, and allows the user to keep only one
+ representation of the types instead of two (the master types
+ is defined in CLI-land). Also Property Editors (<a
+ href="http://primates.ximian.com/~miguel/shots/gconf-shot.png">shot</a>)
+ simplify the creation of user interfaces that bind their
+ configuration to backend keys, following the <a
+ href="http://developer.gnome.org/projects/gup/hig/1.0/">GNOME
+ Human Interface Guidelines.</a>
+
+ Martin is now on vacation, but before leaving he produced a
+ number of documents detailing the state of the debugger. The
+ major missing feature is full support for debugging unmanaged
+ applications (it requires dwarf-2 handlers for types). We
+ will do some polishing of the user interface (<a
+ href="http://primates.ximian.com/~miguel/shots/debugger-4.png">new
+ shot</a>) to expose the existing and rich functionality to the
+ users and try to release a preview of the debugger at the same
+ time as Mono 0.17.
+
+@item Oct 14th, 2002: Crypto, Database work, Debugger, Documentation.
+
+ Brian, Daniel and Rodrigo have been busy working on the ODBC
+ provider for Mono. Daniel posted some <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-October/002755.html">updates</a>.
+ Brian posted <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-October/002758.html">details
+ about the ODBC.NET</a> provider.
+
+ Also Sebastien Pouliot has been improving the various
+ cryptographic classes in Mono, something that we had not done
+ in quite some time. We are looking for a way to handle
+ big-nums. We need either a managed or unmanaged set of
+ classes for handling large numbers, and some volunteers to
+ expose this functionality to C# (Either as an internal
+ assembly, or as a set of P/Invoke, Internal call wrappers).
+
+ Martin has got our debugger to support adding breakpoints at
+ file/line combos. This was more complex than generic
+ breakpoints in routines, because these breakpoints are set on
+ routines that probably have not been JITed just yet. Martin's
+ focus now is on stabilizing our debugger and aim for a public
+ release of it.
+
+ We have also imported the ECMA documentation into a separate
+ module, and with the help from Scott Bronson we will have the
+ necessary XSLT tools to finish our native documentation
+ browser for Mono. This together with the work from Adam will
+ be the foundation for the <a href="classlib-doc.html">Mono
+ Documentation Tools</a>.
+
+@item Oct 9th, 2002: Various Mono updates.
+
+ Brian Ritchie, Daniel Morgan, Rodrigo Moya and Ville Palo have
+ been working on various database providers. The MySQL has
+ seen a lot of work, and a new ODBC provider is now on CVS and
+ more extensive regression tests have been checked in.
+
+ Dick Porter is our background hero and keeps fixing the
+ low-level bugs in the portability layer. Now the Mono handle
+ daemon should be a lot more robust and will no longer leave IPC
+ regions. Gonzalo Paniagua has initiated the migration of XSP
+ into the System.Web class libraries now that we have a
+ complete HttpRuntime implementation. This means that you are
+ able to embed the ASP.NET processor into any web server you
+ want. This also includes support for the system-wide
+ configuration file `machine.config'.
+
+ Martin Baulig has been busy with the Mono Debugger, you can see how
+ it looks <a
+ href="http://primates.ximian.com/~miguel/debugger-1.png">here</a>
+ and <a
+ href="http://primates.ximian.com/~miguel/debugger-2.png">here</a>.
+ Now local variables and breakpoints are supported, and we are
+ working on the UI elements to simplify their use (as seen on
+ the screenshot).
+
+ <a href="http://gtk-sharp.sf.net">Gtk#</a> has seen a lot of
+ activity specially as we start to build larger applications.
+ Vladimir Vukicevic, Kristian Rietveld, Rachel Hestilow, Mike
+ Kestner and Miguel de Icaza have been busy improving it.
+ mPhoto which is a Photo management application for Mono and
+ Gtk# is seen <a
+ href="http://primates.ximian.com/~miguel/shots/mphoto-2.jpg">here</a>.
+
+ Chris Toshok the man behind LDAP in Evolution continues to
+ work on the Mono.LDAP# implementation.
+
+ Dietmar Maurer and Paolo Molaro are still busy working on our
+ new optimized JIT/ATC engine and are making great progress.
+ The code base has been designed to ease the implementation of
+ more advanced compiler optimizations, and optimizations can be
+ chosen individually so they can be tuned for a particular
+ processor, or use profile-based information to improve the
+ performance.
+
+@item Oct 1st, 2002: Mono 0.16 released; Debugger updates.
+
+ Mono 0.16 has been released. Source and RPMs are <a
+ href="download.html">available</a>. The release notes are <a
+ href="archive/mono-0.16">here</a>.
+
+ Martin's debugger can debug both managed and unmanaged code.
+ Recently Martin added support for locals, parameters, and
+ breakpoints on top of the existing infrastructure (his
+ debugger supported instruction-level and source-code level
+ single-stepping).
+
+@item Sep 19th, 2002: Mono Survey.
+
+ Help us plan for the future of Mono by filing out the <a
+ href="http://primates.ximian.com/~miguel/monosurvey">First Mono
+ Survey</a>
+
+@item Sep 17th, 2002: Mono Hackers Hall of Fame: Sergey Chaban
+
+ The <a href="hackers.html">Mono Hackers Hall Of Fame</a>
+ continues to show our appreciation to the excellent
+ contributors that made <b>mono::</b> a successful free
+ software project.
+
+ This time the Hall of Fame welcomes Sergey Chaban. Sergey has
+ been a long time contributor to the project, from the early
+ work on the class libraries that were critical to Mono's
+ origin: every time you use a Hashtable in Mono, it runs
+ Sergey's code, to the low-level optimizations on the JIT
+ engine and to his work on ILASM and the PEToolkit.
+
+
+@item Sep 16th, 2002: Documentation Tools, ILASM, Debugger, Mono LDAP, Winforms
+
+ Adam Treat has started moving the documentation universe again. We
+ have a new strategy to document our APIs (given that we have
+ chosen <a href="classlib-doc.html">not to document the code
+ inline</a>). This includes the use of a master reference file
+ that will hold the entry points to document. All master files
+ for our assemblies have been checked into CVS now.
+
+ Sergey Chaban's Mono.PEToolkit and ILASM tools have been
+ checked into CVS. Although ILASM is old and will soon be
+ updated, we wanted to get the build issues sorted out.
+
+ Martin Baulig's Mono Debugger is still on its early stages,
+ but you can run and run step by step your C# code and C code
+ (including the Mono runtime). Dwarf-2 is required to compile
+ your code. The regular step, step-into, and assembly-level
+ step and step-into are supported. And comes with a Gtk#
+ UI. The debugger is written mostly in C# with some C glue
+ code. Most of the work is on the engine, we will be working
+ on making a good UI in the future.
+
+ Chris Toshok of the Hungry Programmer's fame has checked in
+ Mono.Directory.LDAP, a C# wrapper for the LDAP libraries.
+ This is the substrate for implementing the
+ System.DirectoryServices assembly.
+
+ Andrew has also continued with some of the cryptographic
+ classes implementation.
+
+ After much public debate, we have chosen a new <a
+ href="winforms.html">strategy to implement winforms</a>.
+ Implementing a Gtk, Qt or Aqua based version of Winforms was
+ going to be almost as complex as implementing Wine itself. So
+ the new strategy is to only roll out a WineLib-based
+ implementation.
+
+@item Sep 4th, 2002: .NET One 2002 Program available
+
+ The <a
+ href="http://www.sigs-datacom.de/sd/kongresse/dotnet_2002/index.htm">.NET
+ ONE 2002</a> conference in Frankfurt is now available. Paolo
+ will be talking about the Mono JIT and embedding the Mono
+ runtime in your Windows and Linux applications. Mike Kestner
+ will talk about <a href="http://gtk-sharp.sf.net">Gtk#</a> and
+ the automatic binding generator used by Gtk# and Miguel will
+ be talking about the Mono project on Monday's keynote and on
+ the Mono C# compiler on Tuesday.
+
+@item Sep 3rd, 2002: Apache integration
+
+ <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-September/001862.html">Sterling</a>
+ announced an Apache module that hosts
+ Mono, and allows CIL code to run from within Apache, giving the
+ module access to the Apache runtime. This uses the Mono embedding
+ API.
+
+@item Aug 24th, 2002: Gtk# 0.4 released
+
+ Shortly after <a href="download.html">Mono 0.15</a> was
+ released a fresh version of <a
+ href="http://gtk-sharp.sf.net">Gtk#</a> was <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-August/001702.html">announced</a>.
+
+@item Aug 23rd, 2002: Mono 0.15 released
+
+ Mono 0.15 has been released. Source and RPMs are <a
+ href="download.html">available</a>. The release notes are <a
+ href="archive/mono-0.15">here</a>
+
+@item Aug 21th, 2002: Portable.NET encodings integrated into Mono.
+
+ Rhys Weatherley has contributed the Portable.NET encoders to
+ the Mono class libraries. This is a great step towards
+ cooperation between these projects. Thanks to Paolo for doing the
+ merger on our side.
+
+ His encoders are more complete than the iconv-based approach
+ that mono used, which was unreliable under certain
+ circumstances.
+
+@item Aug 20th, 2002: Remoting work, Resources, SPARC checkins, ADO.NET
+
+ <b>San Francisco</b>: August 14th. Linux World Expo.
+
+ Mark Crichton has checked in his patches to get the SPARC port
+ on par with the PPC port.
+
+ Dick has checked-in the resource reader and resource writers
+ to the class libraries, and Dietmar checked in the C# support
+ code for the remoting infrastructure.
+
+ More work on System.Data: the LibGDA (our OleDB backend) based
+ providers are quickly maturing, and recently they executed
+ their first query.
+
+@item Aug 13th, 2002: MCS news, Gtk# progress, Windows.Forms, ADO.NET
+
+ Martin Baulig has been fixing all the known bugs in the C#
+ compiler and now has moved into improving the compilation
+ speed and the generated code quality of MCS. Today we got a
+ 50% speedup in the bootstrap of MCS going from 24 seconds to 12 seconds.
+
+ Gtk# has been making a lot of progress, some interesting
+ corner cases are now supported:, you can now create canvas items as
+ well as using the tree widget. Here is a shot of <a
+ href="images/mocil.png">MonoCIL</a>.
+
+ On the runtime front, focus has been on improving remoting
+ support, exception handling, as well as completing the support
+ for structure marshaling.
+
+ Patrik is also back in action: the HttpRuntime infrastructure
+ is rapidly improving, and Gonzalo is working into moving XSP
+ into our main class library and providing the missing pieces
+ to integrate with Patrik's code.
+
+ Dennis and his team are working on a WineLib-based
+ implementation of Windows Forms to guarantee that the corner
+ cases of Windows.Forms can be handled, and we are back on track again.
+
+ A lot more work on the ADO.NET and WebServices has also been
+ checked into CVS.
+
+@item Aug 1st, 2002: Mono Hackers Hall of Fame
+
+ The <a href="hackers.html">Mono Hackers Hall Of Fame</a> has been started
+ to show our appreciation to the excellent contributors that made <b>mono::</b>
+ a successful free software project.
+
+ The first, deserved, entry goes to
+ Nick Drochak, who joined us in the first days of Mono and built the testing
+ infrastructure for the C# assemblies, fixed tons of bugs and even adventured
+ himself in the lands of the C runtime. His work is invaluable for keeping
+ Mono on the right track through the daily changes in the codebase.
+
+@item Looking for volunteers
+
+ We are looking for volunteers to help complete various pieces
+ of Mono and help move the project forward, we need
+ contributions to:
+
+ <ul>
+ * More tests to the existing class libraries.
+
+ * Finish existing class libraries, check our <a
+ href="class-status.html">class status</a> pages to see
+ all the missing things. There are open tasks all over
+ the place: XML, Database access, enterprise services,
+ configuration, ASP.NET, Drawing APIs, and more.
+
+ * Since we have now ASP.NET running, we would like to
+ create an ASP.NET application to maintain our class
+ library documentation.
+
+ We have some special needs (read them <a
+ href="classlib-doc.html">here</a>). There is a
+ prototype written using Windows.Forms, but we believe
+ it will be faster to have this done using ASP.NET (and
+ it is also a nice way of stress testing it).
+
+ * Support for the VB runtime: we need contributions
+ to make our VB runtime mature enough to host
+ applications compiled with the VB.NET to run with
+ Mono.
+
+ * We need people to help write the documentation: you
+ can start editing our XML files by hand, and once we
+ have the ASP.NET tool, upgrade to that.
+ </ul>
+
+@item July 31st, 2002: Flow Analysis
+
+ Martin has checked into CVS the data flow analysis patch for
+ MCS, this means that we now correctly implement definite
+ assignment in the C# language.
+
+@item Jul 31st, 2002: Most ASP.NET controls render, Gtk# structs.
+
+ Gonzalo <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-August/001234.html">posted
+ an update</a> on the ASP.NET widgets that are still pending. Patrik is back, and he is
+ working with Gonzalo to streamline the pipeline
+
+ Rachel quietly committed to Gtk-Sharp support for marshaling
+ structures (very important for Gtk#). This uses extensively
+ the new marshaling code that Dietmar added to the runtime.
+
+ Dietmar is also now sharing more code for P/Invoke using his
+ intermediate representation. Another step to share more code, and
+ simplify the porting and maintenance process.
+
+@item Jul 27th, 2002: NGEN tool for Mono.
+
+ Zoltan <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-July/001117.html">announced</a>
+ the availability of his CIL to C compiler. This allows your Mono assemblies to be pre-compiled
+ and optimized by GCC in your platform, increasing the speed significantly of your code.
+
+@item Jul 26th, 2002: Mono 0.13 has been released.
+
+ <b>Mono 0.13 has been released!</b> (details <a
+ href="archive/mono-0.13">here</a>). Get
+ your sources for the <a
+ href="archive/mono-0.13.tar.gz">runtime</a> and
+ <a href="archive/mcs-0.13.tar.gz">compiler and class libraries</a>.
+ <p>
+ Alp made Debian packages and they are <a
+ href="http://www.atoker.com/mono/">here</a>. Cristophe made
+ packages for Red Hat and they are <a
+ href="http://mono.baselabs.org/software">here</a>.
+ And Windows packages have been <a href="http://www.superin.formativ.net/mono/mono.htm">contributed</a>
+
+@item Jul 23rd, 2002: Mono Verifier, System.Web.Services, ASP.NET samples.
+
+ Mono now has a verifier. It is used by the runtime, or you can invoke it manually to
+ verify an image by using the `pedump' tool.
+
+ Tim Coleman has started work on the System.Web.Services
+ assembly (you can also track the status here on the web page).
+ Contact him if you want to help in this assembly or with the
+ associated web service tools.
+
+ Various samples for ASP.NET have landed in CVS.
+
+@item Jul 20th, 2002: Spanish Mono Tutorial.
+
+ A Spanish tutorial on using Mono is <a
+ href="http://mono.es.gnome.org/tutoriales/mono-linux/">here</a>.
+ Also the <a
+ href="http://mono.es.gnome.org/tutoriales/mono-puf/">FAQ</a>
+ has been translated as well.
+
+@item Jul 19th, 2002: File handle redirection, Embeddable Mono and Mono Linux compilation.
+
+ Dick's code for file handle redirection is complete and has
+ now landed on the CVS repository.
+
+ The Mono runtime can now be embedded into your application
+ (also known as "CLR hosting"). See the sample in
+ mono/samples/embed. This allows your application to link with
+ the Mono runtime, then your C code can call into the C#/CIL
+ universe and back.
+
+ Peter Williams and Martin contributed some Makefiles to
+ compile all of Mono on Linux. Details are <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-July/000916.html">here</a>.
+
+@item Jul 17th, 2002
+
+ The first documentary on Ximian's development team is now
+ available online, from young director <a
+ href="mailto:erik.pukinskis@uconn.edu">Erik Pukinskis</a>: <a
+ href="http://www.ximian.com/devzone/projects/codemonkey.html">"Code
+ Monkey At Work"</a>.
+
+ A Tutorial on getting Mono installed from sources is now <a
+ href="http://www.go-mono.com/mono-beginning/x70.html">online</a>.
+
+ More progress on the ASP.NET front: user defined controls are
+ now being rendered, as well as many of the sample programs
+ from www.asp.net. Gonzalo's work can be found on module XSP
+ (this implements the .aspx compiler).
+
+ Sergey Chaban has got Gtk# working on Windows, you can see
+ some screenshots: <a href="sshots/Gtksharp-1.jpg">sample apps</a> and
+ <a href="sshots/Gtksharp-2.jpg">running with a Russian charset</a>.
+
+@item Jul 16th, 2002
+
+ Paolo today got mono to complete host itself on Linux. This
+ means that we can now compile the `corlib' using the Mono C#
+ compiler and the Mono runtime.
+
+ Compiling the corlib was rather tricky, because the types that
+ the compiler uses during the compilation process will come
+ from the source code it is compiling.
+
+ After a few months of work, we have finally fleshed out all
+ the remaining bugs. Now the next step is to update the makefiles
+ to compile with the Mono tool-chain.
+
+ A recapitulation:
+ <ul>
+ * The Mono C# compiler was able to compile itself on December 28th, 2001.
+ The resulting image contained errors though.
+
+ * The Mono C# compiler was able to self-compile in on
+ January 3rd, 2002. Becoming a self-hosting compiler on Windows.
+
+ * The Mono runtime matured enough by March 12, 2002 that it
+ was able to bootstrap the Mono C# compiler on Linux using our interpreter.
+ This means that our development tool was self sufficient.
+
+ * On March 26th, the JIT engine was fixed, so we could use this to
+ run the compiler on Linux.
+
+ * Martin fixed the remaining bugs in the compiler that stopped it from
+ compiling the `corlib'. The resulting image still contained errors though.
+
+ * On July 8th, Radek got the PowerPC port to bootstrap
+ the C# compiler. This is important, because it exposed
+ various tricky issues in a big-endian system.
+
+ * Today: we can bootstrap the compiler using libraries
+ and the compiler compiled with itself on Linux. The process is complete.
+ </ul>
+
+ In the meantime, Dietmar has quietly implemented the remaining
+ pieces of Marshalling in the Mono runtime. This is very
+ important for the Gtk# guys to move on with their bindings.
+
+ To make things more interesting, he replaced most of the
+ architecture specific code generation for trampolines
+ (delegates, invocations, function and p/invoke trampolines) to
+ use CIL. This CIL is then compiled on the flight by the JIT
+ Compiler engine. By doing this, we have reduced the burden to
+ port the JITer to new architectures, and that our trampoline
+ code is cross platform.
+
+@item Jul 9th, 2002
+
+ Ajay was the first to notice <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-July/000641.html">
+ Mono's first birthday</a>.
+
+ In a year, we have achieved plenty:
+ <ul>
+ * 94 contributors with CVS access (84 non-Ximian developers).
+ * A complete CLI implementation:
+ <ul>
+ <li> A fast and performing x86 JIT engine (inlining, constant propagation).
+ <li> An interpreter for other systems (PPC, Sparc, StrongArm).
+ </ul>
+ * A self-hosting C# compiler, which can compile its class libraries.
+ * 37,140 file changes in CVS.
+ * 92,000 lines of C code.
+ * 437,000 lines of C# code (compiler, classes, tests)
+ * A working core for ASP.NET and ADO.NET.
+ * Major subsystems are functional: RegularExpressions,
+ System.XML, XML.Schema, System.Data, System.Web.
+ * The Gtk# project, which is maturing rapidly.
+ </ul>
+
+ Thanks to everyone who has made Mono possible with their
+ feedback, regression tests, their comments, their help on the mailing
+ list, code contributions, complete classes, bug reporting, the
+ countless hours of bug hunting. This project would not have
+ been possible without every contribution.
+
+ It has been a great year for everyone involved in the
+ project. I think we have built a new and exciting community.
+
+ Now we have a solid foundation to build on, so this next year
+ looks even more exciting: not only because we will see more
+ Mono applications, but we will begin using Mono as an
+ `library' to be linked with applications that want to get
+ scripting-like features; Gtk# is our ticket to create nice
+ GNOME applications; And we will be developing CORBA bindings
+ to integrate with other object systems.
+
+ Also, for those interested in optimizations and tuning, this
+ year we will get to play with more advanced optimizations and
+ all kinds of interesting research ideas for improving Mono
+ code generation.
+
+ A special thanks to the Mono developers at Ximian for managing
+ to survive their manager and a special thanks to our
+ regression test marshal Nick Drochak, who has been hunting
+ down, and fixing code in our class libraries and keeping us on
+ track for so long.
+
+@item Jul 8th, 2002
+
+ Radek today fixed the last bugs to get Mono to self host on
+ Linux/PowerPC.
+
+ Alp Toker has released version 0.5 of <a
+ href="http://www.atoker.com/phonic/">Phonic</a>, a media
+ player for .NET. Phonic makes extensive use of Mono-developed
+ technologies such as Gtk# and csvorbis (Ogg player ported by
+ Mark). Hopefully we will be seeing many more exciting
+ applications like these in the near future.
+
+ Dietmar has been moving a lot of the architecture specific
+ code in the JIT engine to our internal representation. This
+ means that porting the JIT is simpler now, as there is less
+ architecture-specific code to maintain. The inliner, constant
+ folder and constant propagation are also done at the
+ architecture independent layer.
+
+ Gonzalo is now running the sample ASP.NET applications on
+ Linux with the Mono runtime. It still needs polishing though,
+ and help with the various ASP.NET controls would be
+ appreciated. The ASP.NET community seems more poor than the
+ PHP community, we need to have a few open source controls to
+ do things dynamic rendering (libart+gdk-pixbuf again can do
+ most of the work), charts and components like the kind of
+ thing you see in the PHP universe: to bring nice GPL code to
+ the masses of Windows developers, lure them into the world of
+ Linux.
+
+ Dick has also got us the new Process implementation that
+ implements the Win32 semantics. Now only redirection is
+ missing.
+
+@item Jul 3rd, 2002
+
+ Listen to Paolo Molaro do a talk on Mono at the WebIT
+ conference in Padova, Italy this coming friday. Details are
+ <a href="http://www.webbit2001.org/event/eventview/534/">here</a>
+
+ You can also see a trip report from the Gnome in the South trip:
+ <a href="http://primates.ximian.com/~miguel/sur.html">here</a>
+
+ Miguel will be doing a couple of talks at the O'Reilly
+ conference about Mono: status update, progress and developing
+ applications with it. Details are <a
+ href="http://conferences.oreillynet.com/cs/os2002/view/e_sess/2994">here</a>
+ and <a
+ href="http://conferences.oreillynet.com/cs/os2002/view/e_sess/2996">here</a>
+
+@item Jun 30, 2002
+
+ Martin Baulig fixed the remaining bugs that prevented MCS to
+ compile our corlib. The compilation was tricky because of the way
+ MCS bootstraps the compile (internally mcs uses the types that are
+ being defined at that point to perform compares).
+
+ Martin and Paolo have been working hard on fixing the
+ remaining issues. Currently 102 test pass and 15 fail with
+ our resulting corlib.
+
+ Jesus' SoapFormatter classes are now in CVS.
+
+ I have been redoing the type lookup system for MCS. The
+ interesting bit is that I did most of this work on an airplane
+ using MCS itself. Which is a good test that the compiler is
+ now a good development tool.
+
+ Duncan, Mike and Rachel have been hard at work with Gtk#, now
+ there are bindings for the GtkHTML widget (the one used by
+ Evolution's composer). And Rachel also got the beginning of GNOME
+ bindings, that should simplify application development.
+
+ A big thanks goes to Dennis Hayes for getting the
+ Windows.Forms work together, and committing so many stubs for Windows.Forms.
+
+@item Jun 25, 2002
+
+ I am updating the Mono site from the UNESCO offices in
+ Uruguay, the <a href="http://www.gnome.org/resources/calendar/roadshow/GNOMEenelSur.html">South-America trip</a>
+ to promote free software is going very well.
+
+ Many news in Mono-land this week so far:
+
+ Mike Kestner got bindings for GtkHTML last night for Gtk#,
+ this is using GtkHTML 2.0.
+
+ On Monday Piers Haken <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-June/000380.html">contributed</a>
+ the core to support XPath in Mono: most of the w3c spec is
+ implemented (modulo a few pending bits).
+
+ Dick checked in his implementation of the Process classes:
+ process forking and waiting support committed, with some functions to
+ query status. This was complex as we had to emulate the Win32
+ environment, but this is another step to be fully compatible.
+ This means for example that any process can check on the
+ status of any other process (without the parent/child relationship)
+
+ Of course, those interested
+ in only the Unix semantics can always P/Invoke the Unix calls.
+
+@item Jun 24, 2002
+
+
+ Duncan has written a few sample <a
+ href="http://primates.ximian.com/~duncan/Mono">Gtk# demo
+ applications</a> (<a
+ href="http://primates.ximian.com/~duncan/Mono/img/ImageViewer.png">screen
+ shot</a>, <a
+ href="http://primates.ximian.com/~duncan/Mono/img/ImageBrowser.png">another</a>)
+
+ Rachel also got the beginning of Gnome bindings (<a
+ href="http://primates.ximian.com/~tvgm/gnome-hello.png">screenshot</a>).
+ She also got some <a
+ href="http://primates.ximian.com/~tvgm/gtk-sharp-docs/">documentation</a>
+ up now.
+
+@item Jun 22, 2002
+
+ Mono's ASP.NET has rendered its first page on Linux for the
+ first time (Gonzalo and Paolo).
+
+ Also, we are getting close to
+ self hosting. Paolo posted a <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-June/000345.html">list
+ of pending issues</a> which are now very small.
+
+ Steam is picking up in <a
+ href="http://gtk-sharp.sf.net">Gtk#</a> as the bindings become more
+ complete and small applications are starting to emerge. Gtk#
+ now compiles completely on Linux. This uses a lot of the XML
+ libraries, which is nice to see.
+
+@item Jun 20, 2002
+
+ Gonzalo has got the Mono ASP.NET implementation can now render all Html
+ Controls, and 21 out of the 26 Web Controls. Session tracking is
+ next. Look in xsp/test for a collection of tests that render with Mono.
+
+ Ajay has been very busy improving and extending the
+ XmlSerialization code. All fields had to be re-ordered to
+ match the Microsoft implementation.
+
+@item Jun 19, 2002
+
+ You can now download a fresh tarball of the libraries and the MCS
+ compiler daily from <a href="http://www.atoker.com/mono/">Alp Toker's
+ website</a>.
+
+ New libgc RPMS for Redhat 7.3 are available on <a href="
+ http://java.thn.htu.se/~toor/">Richard Torkar's site</a>.
+
+@item Jun 10, 2002
+
+ Ajay <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-June/000128.html">announced</a>
+ today that the reading code for XmlSchemas is almost complete.
+
+@item Jun 7, 2002
+
+ <b>Mono 0.12 is out!</b> More classes! More working code!
+ Better compiler! Faster runtime! Less bugs!
+
+ You can get it <a
+ href="download.html#jun-7">Here</a> (quick links: <a
+ href="archive/mono-0.12.tar.gz">runtime</a> and <a
+ href="archive/mcs-0.12.tar.gz">compiler/classes</a>).
+
+@item Jun 3rd, 2002
+
+ CodeDOM implementation from Daniel Stodden has got C# output support.
+
+@item May 31, 2002
+
+ Gonzalo got the Mono XSP page parser to render its first ASP.NET
+ .aspx file today without using MS System.Web.Hosting classes.
+ It is currently on its infancy. But very good news, now we need to
+ upgrade our System.Web runtime to run natively on Linux.
+
+ Sergey's code for architecture and size-specific CPBLK has
+ been checked into CVS.
+
+ Paolo has checked the configuration code for Mono (to map
+ PInvoke dlls to other libraries).
+
+ <a href="ado-net.html">ADO support</a>: Daniel has checked in
+ a modified version of the MySQL data provider from Brad. And Rodrigo
+ started the OleDB using LibGDA.
+
+@item May 27, 2002
+
+ An <a href="index.rss">RSS feed</a> is now available for the
+ Mono news. I find it surprising that there are so many tools
+ that process this data.
+
+ Binaries for <a href="http://www.superin.formativ.net/mono/mono.htm">Windows</a> are
+ now location independent, do not require Cygwin and come with a Wizard.
+
+@item May 26, 2002
+
+ Daniel Morgan checked in his Sql# Cli tool into the
+ System.Data class library.
+
+@item May 24, 2002
+
+ Ajay <a
+ href="http://lists.ximian.com/archives/public/mono-patches/2002-May/003953.html">has
+ checked in</a> a major update to the System.Xml.Schema namespace.
+
+ Gonzalo moved XSP along this week: Added support for
+ templates, columns inside DataGrid, HTML comments, code render
+ and data binding tags, style properties in style tags,
+ ListItem inside list controls, float and double properties.
+
+@item May 22, 2002
+
+ <a href="http://monologo.sourceforge.net/">MonoLogo</a> runs
+ on the Mono runtime. This <a
+ href="http://monologo.sourceforge.net/gtk.png">screenshot</a> shows
+ MonoLogo running Gtk#.
+
+@item May 21, 2002
+
+ Martin has improved the debugging infrastructure in Mono, now
+ it is possible to get <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-May/005717.html">line
+ number</a> information on stack traces.
+
+@item May 20, 2002
+
+ XSP <a href="asp-net">our ASP.NET</a> .aspx page parser is now
+ available on the AnonCVS servers. This is part of the ASP.NET
+ support in Mono. Gonzalo is the developer on charge of it.
+
+ Many updates to the <a href="ado-net.html">ADO.NET
+ implementation</a> from Dan, Tim and Rodrigo.
+
+ Radek got the Mono C# compiler running on Linux/PPC and
+ compiling most of our regression test suite.
+
+ Lawrence has been working really hard in fixing, improving and
+ polishing the underlying network infrastructure.
+
+ The Rafael and Chris have committed the beginning of the
+ VisualBasic.NET runtime support to CVS.
+
+ Jesus has contributed the beginning of the SoapFormatter
+
+@item May 9, 2002
+
+ Linear register allocator has been deployed in the Mono JIT
+ engine. Read <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-May/005489.html">about
+ it</a>
+
+@item May 5, 2002
+
+ We are able to retrieve simple data from the database
+ using our ADO.NET like functionality. Only string and integer data
+ types are supported right now but more are in the works.
+
+ You can find more information
+ at <a href="http://www.go-mono.com/ado-net.html">The Mono ADO-NET Page</a>
+
+ Thanks goes to Chris, Daniel, Duncan, Gonzalo, Miguel, Rodrigo, Tim,
+ and others for these bits.
+
+@item May 4th, 2002
+
+ Rodrigo Moya announced <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-May/005366.html">new
+ LibGDA</a>: LibGDA is an ADO-like library for Unix systems.
+ This one removes all the CORBA and GConf dependencies, which
+ should make it easier to use and compile.
+
+ This is another milestone for our <a
+ href="ado-net.html">ADO.NET implementation plans</a>
+
+ We have a little surprise for everyone tracking the news on Tuesday ;-)
+
+@item May 2nd, 2002
+
+ Mark Crichton csvorbis port (C# port of Vorbis player) and
+ Richard Hestilow's <a href="http://monologo.sf.net">MonoLogo compiler</a> are now
+ on the CVS, and you can get them from AnonCVS.
+
+ Dick implemented inter-process sharing of handles as well as
+ simplifying the implementation of WaitForMultipleObjects, now
+ we have a `handles' subsystem in Mono. This is needed to fully
+ emulate the handle behavior that Win32 exposes, and that the .NET API
+ expose to applications.
+
+ News from the <a
+ href="http://gtk-sharp.sourceforge.net">Gtk#</a> front: <a
+ href="http://gtk-sharp.sourceforge.net/menu.png">Menu
+ support</a>, Mike <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-May/000064.html">tells
+ the story</a>
+
+@item May 1st, 2002
+
+ Daily packages for <a href="http://www.debian.org">Debian</a> are available
+ <a href="http://www.atoker.com/mono/">here</a>
+
+@item Apr 26, 2002
+
+ Binary packages of Mono 0.11 are available for <a
+ href="http://www.superin.formativ.net/mono/mono.htm">Windows</a>
+ (Thanks to Johannes Roith) and for
+ <a
+ href="http://mono.baselabs.org/index.php/software/">Linux</a> (thanks
+ to BaseLabs).
+
+@item Apr 24, 2002
+
+ <b>Mono 0.11 is out!</b> Mostly performance improvements, bug
+ fixes and more classes are included.
+
+ A new version of the runtime, compiler and class libraries has
+ been packaged for your download pleasure. Binaries are
+ included. The <a href="archive/mono-0.11">Release Notes</a>
+ are available.
+
+ You can get it <a
+ href="download.html#apr-24">Here</a> (quick links: <a
+ href="archive/mono-0.11.tar.gz">runtime</a> and <a
+ href="archive/mcs-0.11.tar.gz">compiler/classes</a>).
+
+@item Apr 23, 2002
+
+ SharpDevelop 0.88a <a href="http://www.icsharpcode.net/OpenSource/SD">is out!</a>
+
+ Congratulations to the developers behind SharpDevelop for
+ their new release.
+
+@item Apr 20, 2002
+
+ Some updates from the hacking lines:
+
+ <b>The web:</b> Patrik Torstensson last week contributed the
+ http runtime support and started work on thread pools. This
+ is part of the ASP.NET support.
+
+ <b>Docs:</b> John Barnette, John Sohn and Adam Treat have been
+ hacking on MonoDoc.
+
+ <b>ADO.NET:</b> Daniel Morgan and Rodrigo Moya have been
+ working on the <a href="ado-net">ADO.NET</a> support, and got
+ the first signs of life this week (we can connect, insert
+ rows; do transactions: commit/rollback; SQL errors and
+ exceptions work). Check <a
+ href="mailing-lists.html">mono-patches</a> for all the
+ goodies.
+
+ <b>Optimizations:</b> A number of optimizations in the runtime
+ made the compiler twice as fast this week:
+
+ Early this week Patrik started the string
+ rewrite in the runtime. Today Dietmar finished the
+ constructors and deployed the new layout.
+
+ Paolo got the JIT engine to generate profiles, which were in
+ turn used to find hot spots in Reflection, which he improved.
+
+ Daniel Lewis (of Regex fame) noticed the performance issues
+ with our current array layout, and contributed a new array
+ representation.
+
+ At the same time Dietmar started the the JIT inline code and
+ implemented constant propagation. These two optimizations
+ together are very powerful.
+
+ <b>Bug fixing:</b> And of course everyone has been helping out
+ with the bug fixing (Duncan, Gonzalo, Jonathan, Miguel, Nick,
+ Ravi, Sergey)
+
+
+@item Apr 18, 2002
+
+ Dietmar's inlining for the JIT engine just landed into
+ CVS. This is only a first cut and more improvements will come later.
+
+ Patrik, Paolo, Dietmar and Gonzalo have been busy optimizing
+ our class libraries and runtime engine to become faster. Many changes
+ on CVS as well.
+
+@item Apr 11, 2002
+
+ Gtk# 0.1 "ButtonHook" has been <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-April/000048.html">released</a>
+
+ Binaries for the Mono Regression Test Suite are <a
+ href="archive/mono-tests.tar.gz">available</a> for
+ people porting the Mono Runtime to new platforms.
+
+@item Apr 6, 2002
+
+ <a href="http://www.dotnetremoting.cc/book/AdvancedDotNetRemoting.asp">
+ Advanced .NET Remoting</a> from Ingo Rammer is now available. Ingo
+ helped us to implement the proxy support and the book is a valuable
+ resource for anyone interested in remoting.
+
+@item Apr 5, 2002
+
+ Transparent proxy support has been finished, congrats to
+ Dietmar. Our JIT engine on CVS contains the implementation.
+ This should enable people to test the remoting framework on
+ Mono.
+
+@item Mar 28, 2002
+
+ Debugging information is now generated by the compiler thanks
+ to Martin's work. The resulting dwarf file can be used to
+ single step C# code in GDB. A document will be shortly published with
+ the details.
+
+@item Mar 27, 2002
+
+ <b>Mono 0.10 is out!</b> The self hosting release of Mono has
+ been released.
+
+ A new version of the runtime, compiler and class libraries has
+ been packaged for your download pleasure. Binaries are
+ included. The <a href="archive/mono-0.10">Release Notes</a>
+ are available.
+
+ You can get it <a
+ href="download.html#mar-27">Here</a> (quick links: <a
+ href="archive/mono-0.10.tar.gz">runtime</a> and <a
+ href="archive/mcs-0.10.tar.gz">compiler/classes</a>).
+
+@item Mar 26, 2002
+
+ Paolo finally fixed the last bug in the JITer that stopped
+ us from using it to run the Mono C# compiler. Goodies are on
+ CVS.
+
+ <a href="http://gtk-sharp.sourceforge.net">Gtk#</a> runs <a
+ href="http://gtk-sharp.sourceforge.net/gtk-hello-world.png">Hello
+ World</a>. Mike posted some <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-March/000034.html">details.</a>
+
+
+@item Mar 19, 2002
+
+ Martin has been working on our debugging infrastructure, both
+ on the JIT side of things (adding dward support) as well as on
+ the class libraries (so that MCS can start generating
+ debugging information).
+
+ Jason and Kral keep working on the System.Xml namespace,
+ allowing Mike to move more to self-hosting his Gtk# code.
+
+ The System.Web classes are now part of the build (and they are
+ also part of the class status now). Ajay contributed a large
+ chunk of code to the System.Xml.Schema namespace
+
+ Dan (of regex fame) has been working on internal calls
+ support: moving more code from the old monowrapper to become
+ internal calls.
+
+ Paolo and Dietmar are working steadily on our runtime
+ environment, fixing bugs, adding missing features and allowing
+ us to run the compiler on Linux.
+
+ Remember to post your bug reports.
+
+ The nice class status on the right is brought to you by
+ endless hacking hours from Piers and Nick. These status
+ report pages have been helping us track down various mistakes
+ in our classes (very useful, check it out for yourself)
+
+@item Mar 12, 2002
+
+ At midnight, in Italy, Paolo got the Mono C# compiler to self
+ host on Linux, the last bug has been squashed to self
+ hostingness. We have now a fully self hosting compiler in Linux.
+
+ A release will follow up shortly.
+
+@item Mar 9, 2002
+
+ Updated the <a href="class-status.html">class status</a>, now
+ it is possible to use the right-side menu to browse a specific
+ assembly.
+
+@item Mar 7, 2002
+
+ MCS compiles on Linux!
+
+ Today Paolo got the <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-March/003726.html">MCS
+ compiler compiling itself on Linux</a>
+ completely for the first time! The resulting image still contains
+ some errors, but the whole compiler process goes now. Later in the day
+ and a couple of small optimizations and bug fixes, the compile
+ speed was improved in 400%
+
+ We are very close to have a complete self hosting environment now.
+
+ Mono is temporarily using the Bohem GC garbage collector while
+ we deploy the more advanced ORP one.
+
+@item Mar 5, 2002
+
+ The CVS repository <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?hidenonreadable=1&f=u&logsort=date&sortby=file&hideattic=1&cvsroot=Mono">can be browsed</a>
+
+ Jason has got an incredible amount of work on the Xml
+ classes during the weekend, and Gaurav is very close to have
+ the complete System.Web.UI.WebControls namespace implemented.
+
+ Martin and Duco have been killing bugs by using the recently
+ revamped regression test suite.
+
+ Piers has updated our <a href="class-status.html">class
+ status</a> page again, with even more information available.
+
+ The C# compiler has full constant folding implemented now and Ravi
+ killed bugs of bugs in the <a href="http://bugzilla.ximian.com/buglist.cgi?product=Mono%2FClass+Libraries&product=Mono%2FMCS&product=Mono%2FRuntime&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&short_desc=&short_desc_type=substring&long_desc=&long_desc_type=substring&bug_file_loc=&bug_file_loc_type=substring&keywords=&keywords_type=anywords&op_sys_details=&op_sys_details_type=substring&version_details=&version_details_type=substring&cmdtype=doit&order=%27Importance%27&form_name=query">Mono Bug List</a>
+
+@item Mar 1, 2002
+
+ RPMs of Mono 0.9 are available at <a href="http://mono.baselabs.org/#download">mono.baselabs.com</a>
+
+@item Feb 28, 2002
+
+ <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-February/003464.html">Christophe</a>
+ has setup his <a href="http://mono.baselabs.org">First Steps in Mono</a> web site, which
+ shows you a step-by-step process on getting Mono running on your system.
+
+ RPMs of Mono 0.9 are available at <a href="http://mono.baselabs.org/index.php/software/">mono.baselabs.org</a>
+
+@item Feb 27, 2002
+
+ New <a href="class-status.html">class status</a> engine that
+ provides detailed information about missing functionality in
+ our class libraries. Nick built the cormissing tool and Piers
+ did the XSLT and DHTML magic.
+
+ More compiler progress on Linux: our support runtime now
+ enables the compiler to compile `MIS' on Linux (MIS being
+ Dick's Mono sample HTTP server ;-)
+
+@item Feb 26, 2002
+
+ Paolo posted a list of <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-February/003266.html">ways
+ you can help</a> if you do not have Windows right now. Sergey followed up with
+ <a href="http://lists.ximian.com/archives/public/mono-list/2002-February/003268.html">his</a>
+ suggestions.
+
+@item Feb 25, 2002
+
+ StrongARM port from Sergey Chaban has been checked into CVS.
+
+@item Feb 24, 2002
+
+ SPARC: 44 out of 74 tests pass now (Jeff)
+
+ Power PC: delegates are working now (Radek)
+
+@item Feb 22, 2002
+
+ <b>Mono 0.9 has been released!</b>
+
+ A new version of the runtime, compiler and class libraries has
+ been packaged for your download pleasure. The <a
+ href="archive/mono-0.9">Release Notes</a>
+
+ You can get it <a
+ href="download.html#feb-22">Here</a> (quick links: <a
+ href="archive/mono-0.9.tar.gz">runtime</a> and <a
+ href="archive/mcs-0.9.tar.gz">compiler/classes</a>).
+
+@item Feb 21, 2002
+
+ Paolo got our compiler natively to compile 117 of our tests.
+ Self hosting is closer every day.
+
+ Unsafe support is finished in the C# compiler.
+
+@item Feb 20, 2002
+
+ Gaurav got DataGrid and DataGridItemCollection done.
+
+ C# compiler: Unsafe support is mostly complete (only stackalloc is missing).
+
+ New easy to run scripts for compiling Mono on Unix and Windows
+ is <a href="download.html">available</a>. We can now easily compile
+ Mono on Windows and Linux. If you had trouble before, use the
+ above scripts which will get the setup right for you.
+
+ There are now three machines that can provide AnonCVS, just
+ use anoncvs.go-mono.com as the hostname for your CVSROOT and
+ you will get one of the machines.
+
+@item Feb 19, 2002
+
+ Do you want to see what <a href="http://people.debian.org/~lupus/mono/">Mono Looks Like?</a>
+
+@item Feb 18, 2002
+
+ Application Domains now support the two LoaderOptimization
+ modes: share code or do not share code, and you can control
+ this with the --share-code command line option.
+
+ Paolo has now 100+ test cases run on Linux now with our class
+ libraries.
+
+ PowerPC and SPARC ports are moving along (Radek and Jeff)
+
+@item Feb 13, 2002
+
+ Excellent news since the 11th, here is a quick rundown:
+
+ AppDomains have been deployed (Dietmar). Socket work is done
+ (Dick). Corlib compiled with no refs to mscorlib (Dan). New
+ comprehensive tests for corlib bits (David). Nick is driving the
+ regression test suite efforts and class library completeness.
+ New System.Data work (Chris). Bug fixes (Paolo, Duncan, Ravi, Miguel)
+
+ Miguel is off to the <a
+ href="http://www.fosdem.org">FOSDEM</a> conference in Brussels.
+
+@item Feb 11, 2002
+
+ <b>Mono 0.8 has been released!</b>
+
+ A new version of the runtime, compiler and class libraries has
+ been packaged for your download pleasure.
+
+ You can get it <a
+ href="download.html#feb-11">Here</a> (quick links: <a
+ href="archive/mono-0.8.tar.gz">runtime</a> and <a
+ href="archive/mcs-0.8.tar.gz">compiler/classes</a>)
+
+@item Feb 11, 2002
+
+ We would like to welcome all the new developers that have
+ joined the project in the last couple of days. The classes
+ are rapidly moving.
+
+ An explanation of the relationship between <a
+ href="http://mail.gnome.org/archives/gnome-hackers/2002-February/msg00031.html">GNOME
+ and Mono</a>.
+
+ Nick is still leading our test suite platform. I can not
+ stress how important it is to have a good regression test suite
+ for our platform, as buggy class libraries are what are
+ stopping the compiler from running completely on Linux.
+
+ We are of course psyched to see Mono run on
+ non-Linux systems. Work is moving on native code generation
+ for StrongARM, PowerPC, and SPARC as well as porting Mono to
+ other systems.
+
+ There are a couple of debates on the Mono list on implementing
+ a set of web server classes for <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-February/002911.html">enabling
+ ASP.NET</a> on Mono.
+
+ Paolo also <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-February/002944.html">
+ posted a list of pending tasks</a> to enable the compiler to run on Linux
+
+@item Feb 10, 2002
+
+ Mike Kestner has posted an <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-February/000024.html">Update
+ on his Gtk#</a> activities.
+
+@item Feb 4, 2002
+
+ Adam has done <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-February/002808.html">Qt
+ bindings</a> for .NET. Adam is cool.
+
+@item Jan 29, 2002
+
+ Dan Lewis has contributed a major missing set of classes to
+ Mono: <a
+ href="http://lists.ximian.com/archives/public/mono-list/2002-January/002745.html">
+ System.Text.RegularExpressions</a>.
+
+ This is a fully .NET compatible implementation of the .NET regular expressions,
+ fully Unicode aware. This contribution is very appreciated, as implementing this
+ was not entirely trivial (supporting Unicode, plus a regex engine which is a super
+ set of the Perl regex engine).
+
+@item Jan 28, 2002
+
+ The Mono contributors have relicensed the Class Libraries under
+ the terms of the
+ <a href="http://www.opensource.org/licenses/mit-license.html">MIT X11</a> license.
+
+ This license is an Open Source license, and is used by other projects
+ (most notably, the XFree86 project).
+
+ The runtime (JIT, metadata library, interpreter) remains under
+ the LGPL and the C# compiler remains under the GPL.
+
+ Our <a
+ href="http://www.ximian.com/about_us/press_center/press_releases/mono_partners.html">Press
+ Release</a>
+
+ Press coverage: <a
+ href="http://news.com.com/2100-1001-823734.html">CNet</a>, <a
+ href="http://www.wired.com/news/technology/0,1282,50037-2,00.html">Wired</a>,
+ <a href="http://www.infoworld.com/articles/hn/xml/02/01/28/020128hnopennet.xml">InfoWorld</a>,
+ <a href="http://www.newsforge.com/article.pl?sid=02/01/27/2232231">NewsForge</a>.
+
+@item Jan 23, 2002
+
+ New mailing list: <a href="mailto:mono-patches-request@ximian.com">mono-patches@ximian.com</a>.
+ This mailing list will receive automatically the patches that are submitted
+ to the Mono CVS to any of its modules.
+
+ This allows anyone who wants to participate in the peer-review of the
+ code submitted to CVS to receive patches on e-mail. It should also
+ expose to everyone the changes that are being done by the team every day.
+
+@item Jan 21, 2002
+
+ Dick has got a simple web server running with Mono (`MIS: Mono
+ Internet Server') that is mostly used to test our IO layer, a
+ <a href="http://primates.ximian.com/~miguel/dick-mis-server.png">screenshot</a>
+
+ Paolo and Dietmar are busy making our runtime self sufficient on
+ non-Windows platforms.
+
+ C# compiler front: A lot of focus in the past weeks after
+ the C# became self hosting has been in making the compiler a useful
+ tool for development: improve error handling, provide better error
+ reports, fixing all known bugs, and finally profiling of the compiler
+ has begun.
+
+@item Jan 8, 2002
+
+ Our compiler has been self-supporting since January 3rd. In
+ the meantime, we have been busy working on making it run on
+ Linux. Today Paolo got more work done on Reflection.Emit and
+ the compiler compiled `console.cs' (a sample Mono program) on
+ Linux.
+
+@item Jan 4, 2002
+
+ Dietmar landed the Unicode support patch. Class libraries and
+ runtimes are now fully Unicode aware. The details are <a href=
+ "http://lists.ximian.com/archives/public/mono-list/2002-January/002409.html">
+ here</a>
+
+ Last minute breaking news: Paolo got our compiler in Linux to
+ compile fib.cs, patches are coming tomorrow once we have
+ ChangeLog entries.
+
+@item Jan 4, 2002
+
+ Mike Kestner posted an update on Gtk# <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2002-January/000021.html"><i>New
+ year, new direction</i></a>.
+
+ Gtk# will be our foundation on which we will be implementing
+ System.Windows.Forms.
+
+@item Jan 3, 2002
+
+ Mono C# compiler becomes self-sufficient. We can now continue
+ development of the compiler with itself.
+
+ Work on the class libraries is still underway for having a full
+ self hosting system. We hope to achieve our goal of self-hosting
+ on Linux before the end of the month.
+
+ Join the fun by downloading either tonight's <a
+ href="snapshots">snapshot</a> or getting your sources from our
+ <a href="anoncvs.html">Anonymous CVS server</a>.
+
+@item Dec 28, 2001
+
+ After a lot of work, the C# compiler can compile itself.
+ There are still errors in the generated image, but they are
+ being fixed quickly.
+
+ We will soon have the first non-Microsoft C# implementation!
+
+@item Dec 18, 2001
+
+ JIT: More work on our IO abstraction layer (Dick).
+
+ JIT: exception handling for unmanaged code (Dietmar)
+
+ System.Reflection: Support for PropertyInfo and
+ PropertyBuilder as well as the various queries for MethodBase.
+
+ C#: Pre-processor; Rewrite of MemberLookup which fixed many of
+ the outstanding issues. More bug fixing allows it to compile
+ more programs.
+
+@item Dec 14, 2001
+
+ Dietmar has improved the register allocation and now Mono performs
+ two to three times as fast as it did yesterday. Amazing.
+
+ The compiler keeps moving along, explicit interface
+ implementation is there.
+
+@item Dec 11, 2001
+
+ The JIT engine can now run all the compiler regression tests as
+ well as assorted other programs, many more opcodes added
+ recently. Currently the JIT engine uses a very simplistic register
+ allocator (just enough to allow us to focus on feature completeness)
+ and that will be the next major task to improve performance and
+ reduce spills and reloads.
+
+ On the C# compiler front: language features are now pretty
+ much complete. The big missing tasks are unsafe code support,
+ visibility, explicit interface implementation plus static flow
+ analysis. There are many small bugs that need to be addressed.
+
+ You can get your copy of the <a href="snapshots">latest Mono</a>
+
+ More work is also required on fixing the foundation class
+ libraries, it is easy to find spots now since Nick got the
+ `make test' going.
+
+@item Dec 1, 2001
+
+ AnonCVS access to Mono is here (updated every hour). Thanks
+ to <a href="http://www.hispalinux.es">HispaLinux</a> and Jesus
+ Climent for helping to set this up.
+
+@item Nov 30, 2001
+
+ All tests from the mono runtime work with the JIT engine now
+ (Dietmar).
+
+ Recursive enumeration definition in the C# compiler are
+ working now (Ravi).
+
+ More work on the Web classes (Gaurav).
+
+@item Nov 28, 2001
+
+ JIT land: Paolo got GDB support into the JIT engine while
+ Dietmar added exceptions support to it.
+
+ The C# compiler supports all array initializations now, and the
+ switch statement as well as fixing many existing bugs. Many
+ new more tests.
+
+ Nick keeps working on improving our class library test suite.
+
+ Dick has almost completed the Mono IO layer.
+
+@item Nov 16, 2001
+
+<blockquote>
+ Mike Kestner has posted an <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2001-November/000015.html">update</a>
+ on Gtk# development.
+</blockquote>
+
+@item Nov 14, 2001
+
+<blockquote>
+ Paolo today got the Mono C# compiler running <a
+ href="http://lists.ximian.com/archives/public/mono-list/2001-November/001941.html">on
+ Linux</a>. It compiles a sample program and then the sample
+ program is executed.
+
+ Mutator unary operators (++ and --) in the compiler are fully
+ functional, they used to only work on variables, and now they
+ are complete.
+
+ To sum things up: The Mono C# compiler is written in C# and
+ uses the .NET classes to get its work done. To make this work
+ on Linux work has to happen in various fronts:
+<ul>
+ * The C# compiler is being worked on and can compile
+ many programs now (our test suite at this point is
+ made up of 40 tests).
+
+ * The class libraries need to be mature enough to support
+ the compiler, particularly System.Reflection.Emit (which is
+ what Paolo has been working on lately).
+
+ The compiler currently requires 103 classes from the
+ .NET runtime (you can get the list by running: <b>monodis --typeref mcs.exe</b>
+
+ * The interpreter should be mature enough to run the actual
+ compiler byte codes and the corlib bytecodes.
+</ul>
+
+ At the same time, Dietmar is working on the JIT engine which will
+ replace our interpreter in production.
+</blockquote>
+
+@item Nov 12, 2001
+
+<blockquote>
+ Dietmar got value types working on the JIT engine. Sean has
+ got assembly loading in the runtime (required for NUnit).
+
+ More progress on enumerations and attributes from Ravi.
+
+ Nick keeps working on improving our class libraries.
+</blockquote>
+
+@item Nov 8, 2001
+
+<blockquote>
+ Enumerations, array access and attributes for the C# compiler are into the CVS now.
+
+ Full array support is not complete, but moving along.
+</blockquote>
+
+@item Nov 5, 2001
+
+<blockquote>
+ Dietmar's new set of patches to the JIT have 20 out of 33
+ tests running now.
+</blockquote>
+
+@item Nov 4, 2001
+
+<blockquote>
+ Mike Kestner, main Gtk# contributor has posted a very interesting <a
+ href="http://lists.ximian.com/archives/public/gtk-sharp-list/2001-November/000013.html">
+ update</a> on his work on Gtk#.
+
+ Ravi committed the initial support for Attributes in the
+ compiler.
+
+ Many HTML Controls from Leen checked into CVS.
+
+ Paolo checked in his new System.Reflection and
+ System.Reflection.Emit implementations. He has been working
+ steadily on this huge task for a few weeks now. This is the
+ foundation for the Mono C# compiler, and hence a very
+ important piece of the puzzle.
+</blockquote>
+
+@item Nov 3, 2001
+
+<blockquote>
+ Many clean ups have been going into the class library by Nick Drochak.
+
+ Mega patch from Dietmar: he committed the flow analysis code
+ for the JITer.
+
+ A lot of work has been going into the WebControls by Gaurav (4
+ new controls plus improved and bug fixed base classes).
+</blockquote>
+
+@item Nov 1, 2001
+
+<blockquote>
+ Ravi committed the caller-side method selection of methods with
+ variable length arguments. Now he depends on Miguel finishing
+ the array handling support.
+</blockquote>
+
+@item Oct 27, 2001
+
+<blockquote>
+ Lots of classes for System.Web from Gaurav were committed this
+ morning.
+
+ Some large recent developments:
+
+ The Decimal implementation from Martin Weindel has been
+ partially integrated (we need to put the internalcalls in
+ place now and compile and link the decimal code).
+
+ Derek Holden committed recently the IntegerFormatter code into
+ the CVS, so we got a pretty comprehensive integer formatting
+ engine that we can finally use all over the place.
+
+ Compiler got support for lock as well as assorted bug fixes.
+ Ravi is still working on array support (and then we can
+ optimize foreach for the array case).
+
+ Dietmar is busy working on flow analysis on the JITer, the
+ previous mechanism of generating the forest was wrong. Paolo
+ has been a busy bee reworking the System.Reflection.Emit
+ support code, and we should have some pretty nice stuff next
+ week. Dick on the other hand is still working on the
+ WaitOne/WaitAll emulation code. WaitAll is like select on
+ steroids: it can wait for different kinds of objects: files,
+ mutexes, events and a couple of others.
+
+ Mike Kestner is busy working on Gtk# which is now using the
+ .defs files to quickly wrap the API.
+</blockquote>
+
+@item Oct 18, 2001
+
+<blockquote>
+ Reworking expressions to support cleanly indexers and
+ properties. <a href="http://www.nat.org/evolution.php3">11
+ days</a> until Evolution 1.0 ships.
+
+ Ximian users around the world <!--a
+ href="http://www.bez.it/IMAGES/nora.jpg"-->rejoice<!--/a--> with
+ recent C# compiler progress.
+</blockquote>
+
+@item Oct 17, 2001
+
+<blockquote>
+ Delegate support has been checked into the compiler
+ (definition and invocation); break/continue implemented.
+</blockquote>
+
+@item Oct 15, 2001
+
+<blockquote>
+ JIT engine supports many of the object constructs now (object
+ creation, vtable setup, interface table setup).
+
+ The C# compiler now has almost full property support (only
+ missing bit are pre-post increment/decrement operations),
+ delegates are now created (still missing delegate invocation).
+ try/catch/finally is also supported in the compiler now.
+
+ System.Decimal implementation is in, as well as many crypto
+ classes.
+</blockquote>
+
+@item Oct 5, 2001
+
+<blockquote>
+ Sergey has released his first version of the <b>ilasm</b>
+ assembler written in C#. You can get it from his web page:
+ <a
+ href="http://mono.eurosoft.od.ua">http://mono.eurosoft.od.ua</a>.
+
+ The plan is to integrate ildasm into the Mono CVS soon. This
+ component should in theory also be reusable for SharpDevelop
+ eventually.
+</blockquote>
+
+@item Oct 4, 2001
+
+<blockquote>
+ Our System.Reflection.Emit implementation created its first
+ executable today. This means that a very simple .NET program
+ that was compiled on Windows was able to generate a .NET program
+ while running on Linux using the Mono runtime.
+
+ The various piece of the puzzle are starting to get together:
+ the compiler can compile simple programs now and we are
+ basically focusing on completeness now.
+</blockquote>
+
+@item Sep 28, 2001
+
+<blockquote>
+ <a
+ href="http://www.icsharpcode.net/OpenSource/SD/default.asp">Sharp
+ Develop 0.80</a> was released today.
+</blockquote>
+
+@item Sep 26, 2001
+
+<blockquote>
+ More progress: more opcodes are working (Paolo); The compiler
+ runs up to a point in Mint (Paolo); operator overloading works
+ (both unary and binary) all over the place (Miguel); Completed decimal
+ type conversions (Miguel); New build system in place based on
+ Ant (Sean and Sergey); Refactored and documented the
+ internals of the JIT engine (Dietmar); StatementExpressions
+ handled correctly (Miguel).
+</blockquote>
+
+@item Sep 21, 2001
+
+<blockquote>
+ A couple of news-worthy items: Dick got the initial thread
+ support into mint; Paolo implemented many new opcodes; Dietmar
+ got long operations and mul/div working on the JITer; Ravi rewrote
+ the Method selector for expressions to be conformant; Miguel
+ got i++ working. All in tonight's snapshot
+</blockquote>
+
+@item Sep 19, 2001
+
+<blockquote>
+ Paolo has written a section on <a href="porting.html">Porting
+ Mono</a> to other architectures.
+</blockquote>
+
+@item Sep 18, 2001
+
+<blockquote>
+ <A a href="download.html#sep-18">Mono 0.7</a> has been
+ released (runtime engine, class libraries
+ and C# compiler). Check the <a href="archive/mono-0.7">Mono
+ 0.7 announcement</a> for details
+</blockquote>
+
+@item Sep 17, 2001
+
+<blockquote>
+ Mike Kestner's Gtk# (Gtk-sharp) was checked into the CVS
+ repository. Gtk# can run a simple hello world application.
+ The binding is nice, as it maps Gtk+ signals to delegates in
+ C#. You can see the Gtk# Hello World program <a href="src/HelloWorld.cs">here</a>
+
+ Gtk-sharp should be available on the next snapshot set.
+</blockquote>
+
+@item Sep 10, 2001
+
+<blockquote>
+ Dietmar checked in his CIL tree/forest regeneration and most
+ importantly, the x86 instruction selector burg grammar.
+</blockquote>
+
+
+@item Sep 5, 2001
+
+<blockquote>
+ The MCS compiler <b>can compile the sample Hello World</b>
+ application and generate a Windows/CIL executable that runs!
+
+ This executable runs with the Mono Interpreter of course (see
+ August 28)
+</blockquote>
+
+@item Sep 4, 2001
+
+<blockquote>
+ Dietmar checked into CVS the `monoburg' architecture
+ independent instruction selector for the JIT engine.
+</blockquote>
+
+@item Aug 28, 2001
+
+<blockquote>
+ <b>.NET Hello World is working under Mono!</b> The latest snapshots
+ will let you run it.
+
+ Hello World consists of 1821 CIL instructions,
+ performs 66 subroutine calls and loads 12 classes from the corlib.dll
+
+ Good work Mono team!
+</blockquote>
+
+@item Aug 23, 2001
+
+<blockquote>
+ Lloyd Dupont has announced his OpenGL bindings for C#, they
+ are available here: <a
+ href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
+</blockquote>
+
+@item Aug 22, 2001
+
+<blockquote>
+ New version of the Mono Runtime, Compiler and Classes has been
+ <a
+ href="download.html#august-22">released.</a> Check the <a
+ href="archive/mono-0.6">0.6 announcement</a>.
+</blockquote>
+
+@item Aug 20, 2001
+
+<blockquote>
+ A new <a href="contributing.html#compile-service">Compilation
+ service</a> has been made available by Derek to allow people
+ without access to the <a
+ href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">.NET SDK</a>
+</blockquote>
+
+@item Aug 3, 2001
+
+<blockquote>
+ Daily snapshots of mcs and mono are now available, they will
+ run every night at 10pm Boston time.
+</blockquote>
+
+@item Jul 29, 2001
+
+<blockquote>
+ Mono Runtime 0.5 has been <a
+ href="download.html#july-29">released.</a> Check the <a
+ href="archive/mono-0.5">release notes</a>
+</blockquote>
+
+@item Jul 25, 2001
+
+<blockquote>
+ The slides for <A href="Presentations/O-Reilly">my
+ presentation</a> at <a href="http://www.oreilly.com">O'Reilly
+ Open Source Software Convention</a>
+</blockquote>
+
+@item Jul 22, 2001
+
+<blockquote>
+ Another release of the class libraries is out, check the <a
+ href="archive/mcs-22">MCS 22-July Release Notes</a>. You can
+ get the new class libraries from <a
+ href="download.html#july-22">here</a>
+</blockquote>
+
+@item Jul 19, 2001
+
+<blockquote>
+ Another release of the class libraries is out, check the <a
+ href="archive/mcs-19">MCS 19-July Release Notes</a>. You can
+ get the new class libraries from <a
+ href="download.html#july-19">here</a>
+</blockquote>
+
+@item Jul 17, 2001
+
+<blockquote>
+ Another release of the class libraries is out, check the <a
+ href="archive/mcs-17">MCS 17-July Release Notes</a>. You can
+ get the new class libraries from <a
+ href="download.html#july-17">here</a>
+
+ Do not forget to check out the updated <a href="faq.html">FAQ</a>.
+
+ Got Sean's new Class
+ Status web pages up. These are a lot better than mine, and
+ we are now keeping better track of contributors.
+</blockquote>
+
+@item Jul 15, 2001
+
+<blockquote>
+ Another release of Mono is out, check the <a
+ href="archive/mono-0.4">Mono 0.4 Release Notes</a>. Get it <a
+ href="download.html#july-15">here</a>.
+</blockquote>
+
+@item Jul 14, 2001
+
+<blockquote>
+ A <a
+ href="http://lists.ximian.com/archives/public/mono-list/2001-July/000399.html">new
+ release</a> of the
+ runtime, compiler and classes has been made. Get it <a href="download.html#july-14">here</a>
+</blockquote>
+
+@item Jul 12, 2001
+
+<blockquote>
+ I keep getting questions about my opinion on Passport, even when
+ Mono has <b>nothing</b> to do with it. I finally <a
+ href="passport.html">wrote something.</a>
+</blockquote>
+
+@item Jul 9, 2001
+
+<blockquote>
+ Project launched.
+</blockquote>
+
+@item O'Reilly
+
+<blockquote>
+ Brian posted a story on <a
+ href="http://www.oreillynet.com/dotnet">O'Reilly Network .NET</a>
+</blockquote>
diff --git a/web/oledb b/web/oledb
new file mode 100755
index 00000000000..1dabe6244ed
--- /dev/null
+++ b/web/oledb
@@ -0,0 +1,153 @@
+* OLE DB Provider
+
+<ul>
+ <li> Provides a OleDb-like provider for Mono
+ using <a href="http://www.gnome-db.org/">GDA</a> as the data access layer.</li>
+
+ <li> Exists in namespace System.Data.OleDb and assembly System.Data</li>
+
+ <li>Created by Rodrigo Moya</li>
+
+ <li>LibGDA has providers for:</li>
+ <ul>
+ <li><a href="http://www.mysql.com/">MySQL</a></li>
+ <li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
+ <li>XML</li>
+ <li>ODBC (via <a href="http://www.unixodbc.org/">unixODBC</a>)</li>
+ <li><a href="http://www.oracle.com/">Oracle</a></li>
+ <li><a href="http://www.borland.com/products/downloads/download_interbase.html">Interbase</a></li>
+ <li><a href="http://www.sybase.com/downloads">Sybase</a> and
+ <a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a> (
+ via <a href="http://www.freetds.org/">FreeTDS</a>)</li>
+ <li><a href="http://www-3.ibm.com/software/data/db2/">IBM DB2 Universal Database</a></li>
+ <li><a href="http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a></li>
+ <li><a href="http://www.microsoft.com/office/access/default.asp">MS Access</a></li>
+ (via <a href="http://mdbtools.sourceforge.net/">MDB Tools</a>)</li>
+ </ul>
+ </li>
+
+ <li>Does not support trusted connections</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+
+</ul>
+
+** Current Status
+ <ul>
+ <li>The OleDb provider is working with libgda (an OLE-DB/ADO data access for Unix).
+ The C-Sharp bindings to libgda currently work - meaning they can compile, run,
+ and you can connect to a
+ PostgreSQL database via libgda via the C-Sharp bindings to libgda.</li>
+
+ <li>Basic
+ functionality (execution of commands, data retrieval, transactions, etc) are
+ now working.</li>
+
+ <li>An inital implementation of GetSchemaTable() for
+ the OleDbDataReader has been checked into cvs. GetSchemaTable() isn't correct for OleDb,
+ but the foundation is there.</li>
+ </ul>
+
+** Action Plan
+ <ul>
+ <li>Current focus is on filling up the missing pieces (Data adapters
+ mainly) and schema support.</li>
+
+ <li>We need help building libgda on Windows though. libgda
+ builds find on linux though.</li>
+
+ <li>Need to make the OleDb provider compatible with the OleDb provider in Microsoft .NET</li>
+ </ul>
+
+** Testing OleDb with libgda's PostgreSQL provider
+
+<ul>
+ <li>Requires a working mono and mcs</li>
+ <li>Requires Linux because the OleDb provider uses libgda and libgda only
+ works on Linux.</li>
+ <li>Connection String format: "Provider=providerName;...". providerName is the
+ name of the Provider you use, such as, PostgreSQL, MySQL, etc. The elipsis ...
+ means that the connection parameters are dependent upon the provider being used and
+ are passed to libgda for connecting. Such paramters, can be: Database, User ID, Password,
+ Server, etc...</li>
+ <li>See the test TestOleDb.cs found at mcs/class/System.Data/System.Data.OleDb</li>
+ <li>C# Example for Mono's System.Data.OleDb:
+<pre>
+ using System;
+ using System.Data;
+ using System.Data.OleDb;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ // there is a libgda PostgreSQL provider
+ string connectionString =
+ "Provider=PostgreSQL;" +
+ "Addr=127.0.0.1;" +
+ "Database=test;" +
+ "User ID=postgres;" +
+ "Password=fun2db";
+ IDbConnection dbcon;
+ dbcon = new OleDbConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ // requires a table to be created named employee
+ // with columns firstname and lastname
+ // such as,
+ // CREATE TABLE employee (
+ // firstname varchar(32),
+ // lastname varchar(32));
+ string sql =
+ "SELECT firstname, lastname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["firstname"];
+ string LastName = (string) reader["lastname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll
+</pre>
+ </li>
+ <li>Build on Windows via Cygwin:
+<pre>
+ mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
+ TestExample.cs \
+ -lib:C:/cygwin/home/MyHome/mono/install/lib \
+ -r System.Data.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+</li>
+
+</ul>
+
diff --git a/web/oracle b/web/oracle
new file mode 100755
index 00000000000..a83eb776c35
--- /dev/null
+++ b/web/oracle
@@ -0,0 +1,168 @@
+* Oracle Data Provider
+
+<ul>
+
+ <li>ADO.NET Data Provider for <a href="http://www.oracle.com/">Oracle</a> databases</li>
+
+ <li>Exists in namespace System.Data.OracleClient and assembly System.Data.OracleClient</li>
+
+ <li>Works on Windows and Linux</li>
+
+ <li>Works with Oracle 8i and 9i.</li>
+
+ <li>Uses the Oracle CLI (Call Level Interface) which is a C library (API) for the Oracle Client
+ software</li>
+
+ <li>Internally, the OracleClient provider has OCI abstracted to an object-oriented programming model</li>
+
+ <li>Created by Daniel Morgan and Tim Coleman</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+</ul>
+
+** Current Status
+
+<ul>
+ <li>OracleConnection can connect and disconnect to an Oracle 8i or 9i database on
+ Windows and Linux via OCI (Oracle Call-level Interface)</li>
+
+ <li>Can have multiple connections with different transactions where each transaction is
+ separated from the others, so a rollback or commit in one transaction
+ does not affect the other.</li>
+
+ <li>Can execute simple DML SQL statements, such as,
+ INSERT a row into the EMP table via the OracleCommand's ExecuteNonQuery method</li>
+
+ <li>Can retrieve data via ExecuteReader and OracleDataReader. Currently,
+ supports character, numeric, some date data types. ExecuteScalar
+ also works.</li>
+
+ <li>Simple input parameters (character and numeric data) can now
+ be used in SQL queries. Output parameters do not yet work.</li>
+
+ <li>OracleException and Error handling exists now.</li>
+
+ <li>Message handling needs to be added for non-critical messages
+ received from Oracle</li>
+
+ <li>Handling of various data types need to be added.</li>
+
+ <li>Data Adapter exists, and a DataSet can be filled using it.</li>
+
+ <li>Lots of missing functionality and bugs.</li>
+
+ <li>Works with SQL# command-line and GTK# GUI versions.</li>
+
+</ul>
+
+** Action Plan
+
+<ul>
+ <li>Be able to retrieve results via a data reader (WORKING)</li>
+ <li>Parameters support (IN PROGRESS)</li>
+ <li>transactions (WORKING)</li>
+ <li>Stored Procedures, Functions, and Packages support</li>
+ <li>Be able to fill a DataTable in a DataSet via a data adapter (IN PROGRESS)</li>
+ <li>Support for Oracle 8i on Linux and Windows (WORKING)</li>
+ <li>Support for Oracle 9i on Linux and Windows (WORKING)</li>
+ <li>Support for Oracle 10g on Linux and Windows [TODO]. Please let us
+ know on mono-list if Mono OracleClient works with Oracle 10g or not. If not, what errors do you get</li>
+ <li>Support Large OBjects</li>
+ <li>Support all the data types</li>
+ <li>Implement Connection pooling</li>
+ <li>Security</li>
+
+</ul>
+
+** Testing System.Data.OracleClient
+
+<ul>
+ <li>Have a working mono and mcs</li>
+
+ <li>Have access to an Oracle 8i or 9i database or download it from
+ <a href="http://www.oracle.com/">Oracle</a>. If you are connecting
+ remotely to an Oracle database, you need the Oracle client software.
+ Registration to the <a href="http://technet.oracle.com/">Oracle Technology Network</a> is free. If installing on Linux,
+ I suggest you do a lot of searching to see how others installed Oracle on Linux.</li>
+
+ <li>Make sure System.Data.OracleClient.dll assembly is built.</li>
+
+ <li>Take a look at TestOracleClient.cs found at mcs/class/System.Data.OracleClient/Test</li>
+
+ <li>The Data Source is an Oracle TNSNAME</li>
+
+ <li>Has a connection string format:
+<pre>
+"Data Source=tnsname;User ID=userid;Password=password"
+</pre>
+ </li>
+ <li>C# Example:
+<pre>
+ using System;
+ using System.Data;
+ using System.Data.OracleClient;
+
+ public class Test
+ {
+ public static void Main (string[] args)
+ {
+ string connectionString =
+ "Data Source=testdb;" +
+ "User ID=scott;" +
+ "Password=tiger;";
+ OracleConnection dbcon = null;
+ dbcon = new OracleConnection (connectionString);
+ dbcon.Open ();
+ OracleCommand dbcmd = dbcon.CreateCommand ();
+ string sql = "SELECT ename, job FROM scott.emp";
+ dbcmd.CommandText = sql;
+ OracleDataReader reader = dbcmd.ExecuteReader ();
+ while (reader.Read ()) {
+ string employeeName = (string) reader["ename"];
+ string job = (string) reader["job"];
+ Console.WriteLine ("Employee Name: {0} Job: {1}",
+ employeeName, job);
+ }
+ // clean up
+ reader.Close ();
+ reader = null;
+ dbcmd.CommandText = sql;
+ dbcmd.ExecuteNonQuery ();
+ dbcmd.Dispose ();
+ dbcmd = null;
+ dbcon.Close ();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r System.Data.OracleClient.dll
+</pre>
+ </li>
+ <li>Build on Windows:
+<pre>
+ mcs TestExample.cs /r:System.Data.dll \
+ /r:System.Data.OracleClient.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+
+</ul>
+
diff --git a/web/other b/web/other
new file mode 100644
index 00000000000..f37cb18208a
--- /dev/null
+++ b/web/other
@@ -0,0 +1,42 @@
+* International sites
+
+ <ul>
+
+ <li><a href="http://www.monohispano.org">Mono
+ Hispano</a>: The spanish-speaking community of Mono
+ developers and users. They have quite a number of
+ unique documents and tutorials.
+
+ <li><a href="http://www.go-mono.pl">Mono Poland</a>:
+ Mono site for polish users.
+
+ <li><a href="http://primates.ximian.com/~atsushi/mono-jp/">Mono Japanese Translation</a>:
+ Mono site Japanese translation pages. Translated sources are maintained at <a href="http://forge.novell.com/modules/xfmod/project/?mono-jp">Novell Forge</a>.
+
+ <li><a href="http://www.go-mono.nl/">Neatherlands Mono
+ Site</a>: Mono forum in the Neatherlands.
+
+ <li><a href="http://monobrasil.softwarelivre.org">Mono Brasil</a>:
+ Mono discussion site for brazilian users.
+ </ul>
+
+* User sites
+
+ <ul>
+
+ <li>Alp Toker's <a
+ href="http://www.atoker.com/mono/">site</a>: He is an
+ active Mono developer (gsirc, platano) and produces
+ very nice Debian packages of Mono.
+
+ <li>Brian Ritchie's <a
+ href="http://www12.brinkster.com/brianr/">site</a>:
+ Brian is a contributor to Mono's class library (ODBC
+ provider and the database multiplexing assembly), and
+ has built an application server for .NET and Mono.
+ His site contains news, software, as well as his
+ weblog.
+
+ </ul>
+
+
diff --git a/web/papers b/web/papers
index 36a31988e83..162f79d1637 100644
--- a/web/papers
+++ b/web/papers
@@ -94,3 +94,8 @@
href="http://citeseer.nj.nec.com/seligmann95incremental.html">
Incremental Collection of Mature Objects: Richard Hudson, Eliot Moss</a>
+* Threads
+
+ <a
+ href="http://research.microsoft.com/~birrell/papers/ThreadsCSharp.pdf">
+ Programming with Threads in C#: Andrew Birrell</a>
diff --git a/web/passport b/web/passport
index fd402772293..3ffe0dfeef9 100644
--- a/web/passport
+++ b/web/passport
@@ -100,6 +100,11 @@
available, means that trojans or worms could be built
into the products by malicious engineers.
+ Various government officials in non-US countries also
+ have a policy that no state sensitive information can
+ be held by foreign companies in foreign soil. A natural
+ matter of national security to some.
+
* <b>Security:</b> With a centralized system like
Passport, imagine the repercussions of a malicious
hacker gaining access to the Passport database.
diff --git a/web/performance b/web/performance
new file mode 100644
index 00000000000..3760197ed14
--- /dev/null
+++ b/web/performance
@@ -0,0 +1,215 @@
+* Writing better performing .NET and Mono applications
+
+<center>
+Miguel de Icaza (miguel@novell.com)<br>
+Ben Maurer (bmaurer@users.sourceforge.net)
+</center>
+
+ The following document contains a few hints on how to improve
+ the performance of your Mono/.NET applications.
+
+ These are just guidelines, and you should still profile your
+ code to find the actual performance problems in your
+ application. It is never a smart idea to make a change with the
+ hopes of improving the performance of your code without first
+ measuring. In general, these guidelines should serve as ideas
+ to help you figure out `how can I make this method run faster'.
+
+ It is up to you to figure out, `Which method is running slowly.'
+
+** Using the Mono profiler
+
+ So, how does one measure what method are running slowly? A profiler
+ helps with this task. Mono includes a profiler that is built
+ into the runtime system. You can invoke this profiler on your program
+ by running with the --profile flag.
+
+<pre class="shell">
+ mono --profile program.exe
+</pre>
+
+ The above will instruct Mono to instrument your application
+ for profiling. The default Mono profiler will record the time
+ spent on a routine, the number of times the routine called,
+ the memory consumed by each method broken down by invoker, and
+ the total amount of memory consumed.
+
+ It does this by asking the JIT to insert a call to the profiler
+ every time a method is entered or left. The profiler times the
+ amount of time elapsed between the beginning and the end of the
+ call. The profiler is also notified of allocations.
+
+ When the program has finished executing, the profiler prints the
+ data in human readable format. It looks like:
+
+<pre class="shell">
+Total time spent compiling 227 methods (sec): 0.07154
+Slowest method to compile (sec): 0.01893: System.Console::.cctor()
+Time(ms) Count P/call(ms) Method name
+########################
+ 91.681 1 91.681 .DebugOne::Main()
+ Callers (with count) that contribute at least for 1%:
+ 1 100 % .DebugOne::Main(object,intptr,intptr)
+...
+Total number of calls: 3741
+...
+Allocation profiler
+Total mem Method
+########################
+ 406 KB .DebugOne::Main()
+ 406 KB 1000 System.Int32[]
+ Callers (with count) that contribute at least for 1%:
+ 1 100 % .DebugOne::Main(object,intptr,intptr)
+Total memory allocated: 448 KB
+</pre>
+
+ At the top, it shows each method that is called. The data is sorted
+ by the total time that the program spent within the method. Then
+ it shows how many times the method was called, and the average time
+ per call.
+
+ Below this, it shows the top callers of the method. This is very useful
+ data. If you find, for example, that the method Data::Computate () takes
+ a very long time to run, you can look to see if any of the calls can be
+ avoided.
+
+ Two warnings must be given about the method data. First,
+ the profiler has an overhead associated with it. As such,
+ a high number of calls to a method may show up as consuming
+ lots of time, when in reality they do not consume much time
+ at all. If you see a method that has a very high number of
+ calls, you may be able to ignore it. However, do consider
+ removing calls if possible, as that will sometimes help
+ performance. This problem is often seen with the use
+ of built in collection types.
+
+ Secondly, due to the nature of the profiler, recursive calls
+ have extremely large times (because the profiler double counts
+ when the method calls itself). One easy way to see this problem
+ is that if a method is shown as taking more time than the Main
+ method, it is very likely recursive, and causing this problem.
+
+ Below the method data, allocation data is shown. This shows
+ how much memory each method allocates. The number beside
+ the method is the total amount of memory. Below that, it
+ is broken down into types. Then, the caller data is given. This
+ data is again useful when you want to figure out how to eliminate calls.
+
+ You might want to keep a close eye on the memory consumption
+ and on the method invocation counts. A lot of the
+ performance gains in MCS for example came from reducing its
+ memory usage, as opposed to changes in the execution path.
+
+** Profiling without JIT instrumentation
+
+ You might also be interested in using mono --aot to generate
+ precompiled code, and then use a system like `oprofile' to
+ profile your programs.
+
+** Memory Management in the .NET/Mono world.
+
+ Since Mono and .NET offer automatic garbage collection, the
+ programmer is freed from having to track and dispose the
+ objects it consumes (except for IDispose-like classes). This
+ is a great productivity gain, but if you create thousands of
+ objects, that will make the garbage collector do more work,
+ and it might slow down your application.
+
+ Remember, each time you allocate an object, the GC is forced
+ to find space for the object. Each object has an 8 byte overhead
+ (4 to tell what type it is, then 4 for a sync block). If
+ the GC finds that it is running out of room, it will scan every
+ object for pointers, looking for unreferenced objects. If you allocate
+ extra objects, the GC then must take the effort to free the objects.
+
+ Mono uses the Boehm GC, which is a conservative collector,
+ and this might lead to some memory fragmentation and unlike
+ generational GC systems, it has to scan the entire allocated
+ memory pool.
+
+*** Boxing
+ The .NET framework provides a rich hierarchy of object types.
+ Each object not only has value information, but also type
+ information associated with it. This type information makes
+ many types of programs easier to write. It also has a cost
+ associated with it. The type information takes up space.
+
+ In order to reduce the cost of type information, almost every
+ Object Oriented language has the concept of `primitives'.
+ They usually map to types such as integers and booleans. These
+ types do not have any type information associated with them.
+
+ However, the language also must be able to treat primitives
+ as first class datums -- in the class with objects. Languages
+ handle this issue in different ways. Some choose to make a
+ special class for each primitive, and force the user to do an
+ operation such as:
+<pre class="shell">
+// This is Java
+list.add (new Integer (1));
+System.out.println (list.get (1).intValue ());
+</pre>
+
+ The C# design team was not satisfied with this type
+ of construct. They added a notion of `boxing' to the language.
+
+ Boxing preforms the same thing as Java's <code>new Integer (1)</code>.
+ The user is not forced to write the extra code. However,
+ behind the scenes the <em>same thing</em> is being done
+ by the runtime. Each time a primitive is cast to an object,
+ a new object is allocated.
+
+ You must be careful when casting a primitive to an object.
+ Note that because it is an implicit conversion, you will
+ not see it in your code. For example, boxing is happening here:
+
+<pre class="shell">
+ArrayList foo = new ArrayList ();
+foo.Add (1);
+</pre>
+
+ In high performance code, this operation can be very costly.
+
+*** Using structs instead of classes for small objects
+
+ For small objects, you might want to consider using value
+ types (structs) instead of object (classes).
+
+ However, you must be careful that you do not use the struct
+ as an object, in that case it will actually be more costly.
+
+ As a rule of thumb, only use structs if you have a small
+ number of fields (totaling less than 32 bytes), and
+ need to pass the item `by value'. You should not box the object.
+
+*** Assisting the Garbage Collector
+
+ Although the Garbage Collector will do the right thing in
+ terms of releasing and finalizing objects on time, you can
+ assist the garbage collector by clearing the fields that
+ points to objects. This means that some objects might be
+ eligible for collection earlier than they would, this can help
+ reduce the memory consumption and reduce the work that the GC
+ has to do.
+
+** Common problems with <tt>foreach</tt>
+
+ The <tt>foreach</tt> C# statement handles various kinds of
+ different constructs (about seven different code patterns are
+ generated). Typically foreach generates more efficient code
+ than loops constructed manually, and also ensures that objects
+ which implement IDispose are properly released.
+
+ But foreach sometimes might generate code that under stress
+ performs badly. Foreach performs badly when its used in tight
+ loops, and its use leads to the creation of many enumerators.
+ Although technically obtaining an enumerator for some objects
+ like ArrayList is more efficient than using the ArrayList
+ indexer, the pressure introduced due to the extra memory
+ requirements and the demands on the garbage collector make it
+ more inefficient.
+
+ There is no straight-forward rule on when to use foreach, and
+ when to use a manual loop. The best thing to do is to always
+ use foreach, and only when profile shows a problem, replace
+ foreach with for loops.
diff --git a/web/plans b/web/plans
index db6f6dde7c8..f53aecd4e95 100755
--- a/web/plans
+++ b/web/plans
@@ -8,7 +8,7 @@
Currently you can read our plans for <a
href="ado-net.html">ADO.NET</a>, <a
- href="asp-net">ASP.NET</a>, <a href="java.html">Java</a> and
+ href="asp-net.html">ASP.NET</a>, <a href="java.html">Java</a> and
<a href="winforms.html">WinForms</a>.
diff --git a/web/postgresql b/web/postgresql
new file mode 100644
index 00000000000..90c3f4f6009
--- /dev/null
+++ b/web/postgresql
@@ -0,0 +1,365 @@
+* PostgreSQL and Mono
+
+ When it comes to Mono and PostgreSQL, there are many ways
+ you can access your data.
+
+* Data Providers
+
+ There are many ADO.NET data providers for <a href="http://www.postgresql.org/">PostgreSQL</a>:
+
+ There are two providers created specifically for PostgreSQL included with Mono:
+
+<ul>
+
+ <li><a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>
+ <ul>
+ <li>included with Mono</li>
+
+ <li>a .NET Managed Data Provider for PostgreSQL</li>
+
+ <li>Written in 100% C#</li>
+
+ <li>does not require a client library</li>
+
+ <li>works on Mono and Microsoft .NET</li>
+
+ <li>created by Francisco Figueiredo jr. and has many developers working on it
+
+ <li>works in the SQL# (command-line and GTK# GUI versions)</li>
+
+ <li>in namespace Npgsql and assembly Npgsql and is found in mcs
+ at mcs/class/Npgsql</li>
+ </ul>
+ </li>
+
+ <li>Mono.Data.PostgreSqlClient (DEPRECATED)
+ <ul>
+
+ <li>Deprecated in favor of Npgsql. No longer included in a release of Mono.</li>
+
+ </ul>
+ </li>
+
+ <li><a href="http://sourceforge.net/projects/mysqlnet/">ByteFX.Data</a> has a provider for PostgreSQL too, but I do not know how well it works with Mono.</li>
+
+ <li>There is another .NET data provider for PostgreSQL named <a href="http://sourceforge.net/projects/pgsqlclient/">PgSqlClient</a>, but I do not know if it works with Mono.</li>
+
+ <li>If none of the above providers meet your needs. There is the ODBC and OLEDB providers included with Mono.</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+
+</ul>
+
+** Current Status
+
+<ul>
+ <li>Npgsql
+ <ul>
+ <li>Builds and Runs on both Microsoft .NET and Mono.</li>
+ <li>Works using SQL# (command-line and GTK# versions)</li>
+ <li>You can send insert, update, delete queries
+ through NpgsqlCommand.ExecuteNonQuery() method.</li>
+ <li>You can send queries like, select count(*) from table, select version()
+ with NpgsqlCommand.ExecuteScalar() method.</li>
+ <li>There is logging support. (Thanks Dave Page)
+ To use it, place code like that in your program:</li>
+
+<pre>
+ // Enable logging.
+ NpgsqlEventLog.Level = LogLevel.Debug; // LogLevel.
+ NpgsqlEventLog.LogName = "NpgsqlTests.LogFile"; // LogFile.
+</pre>
+
+ <li>You can use Npgsql with Mono (Thanks Kristis Makris). It is not working perfectly.</li>
+ <li>There is a winforms test suite (Thanks Dave Page).</li>
+ <li>Clearer code in NpgsqlConnection removing *magic* numbers and constants. (Thanks Kristis Makris)</li>
+ <li>Better support of ODBC-like ConnectionString in NpgsqlConnection (Thanks Dave Page)</li>
+ <li>Thanks Ulrich Sprick for all discussion and ideas.</li>
+
+ </ul>
+ </li>
+</ul>
+
+** Action Plan
+ <ul>
+ <li>More testing and fixing bugs</li>
+
+ <li>Better error handling</li>
+
+ <li>More Data Types to use</li>
+
+ <li>Any features for Npgsql should be implemented in Npgsql's main cvs repository at
+ gborg.postgresql.org. Most bugs should be fixed in gborg.postgresql.org's cvs.
+ Only bugs neccessary for building and running of Npgsql on Mono can be done in Mono cvs,
+ but once applied they should be sent to Npgsql's mailing list
+ at gborg.postgresql.org for inclusion into cvs there. Whenever there is
+ a release of Npgsql (determined by Francisco Figueiredo jr. or a release
+ of Mono (determined by Miguel de Icaza), then the Npgsql source
+ in gborg.postgresql.org's cvs will be used to update the Npgsql source in
+ Mono's cvs.
+ </li>
+
+ <li>Add any missing functionality to Npgsql. If this funtionality works on
+ .NET but not on Mono, implement the missing features or fix the bugs in Mono</li>
+
+ <li>Npgsql has been replaced Mono.Data.PostgreSqlClient as the provider of
+ choice to use. Mono.Data.PostgreSqlClient is deprecated and is no longer included in
+ Mono releases. Please use Npgsql for PostgreSQL data access.</li>
+
+ <li>Implement new features of PostgreSQL.</li>
+ </ul>
+
+</ul>
+
+** Testing Npgsql
+
+<ul>
+ <li>Have a working mono and mcs</li>
+
+ <li>Get <a href="http://gborg.postgresql.org/project/npgsql/projdisplay.php">Npgsql</a>
+ and make sure the binary assembly Npgsql.dll is installed in the same place that the
+ mono class libraries are located.
+
+ <li>C# Example for Npgsql:
+<pre>
+ using System;
+ using System.Data;
+ using Npgsql;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Server=localhost;" +
+ "Database=test;" +
+ "User ID=postgres;" +
+ "Password=fun2db;";
+ IDbConnection dbcon;
+ dbcon = new NpgsqlConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ // requires a table to be created named employee
+ // with columns firstname and lastname
+ // such as,
+ // CREATE TABLE employee (
+ // firstname varchar(32),
+ // lastname varchar(32));
+ string sql =
+ "SELECT firstname, lastname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["firstname"];
+ string LastName = (string) reader["lastname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r Npgsql.dll
+</pre>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+</li>
+</ul>
+
+
+** Installation instructions for PostgreSQL DBMS:
+ <p><b>On Unix</b>
+
+ <ul>
+ * Read the PostgreSQL Installation Instructions
+ at \usr\doc\postgresql-x.x.x\html\installation.html
+
+ * Depending on your Unix system,
+ PostgreSQL maybe already installed, a database user 'postgres' created,
+ a linux user 'postgres' created and initdb ran. Or maybe not.
+
+<pre>
+ su
+ adduser postgres
+ mkdir /usr/local/pgsql/data
+ chown postgres /usr/local/pgsql/data
+ su - postgres
+ initdb -D /usr/local/pgsql/data
+ postmaster -i -D /usr/local/pgsql/data
+ createdb test
+ psql test
+</pre>
+
+ * Make sure you have a database user named postgres. It is best to install
+ the PostgreSQL DBMS under linux user postgres. When you run the postmaster,
+ run it under the user postgres as well. If this was not done, then you
+ will need to create a user named postgres for the System.Data tests.
+
+ * If you already installed PostgeSQL and you do not have a database
+ user named postgres, then you can create user postgres using psql:
+
+<pre>
+psql test
+create user postgres with password 'fun2db';
+</pre>
+
+ * The postmaster must be run with -i option.
+
+ * In the /usr/local/pgsql/data/pg_hba.conf file, you need
+ to have the AUTH_TYPE set to md5. You can read more on this at
+ /usr/doc/postgresql-7.2.1/html/client-authentication.html
+ or wherever your
+ PostgreSQL html docs are located. See the 2nd line below,
+ host 127.0.0.1 has an AUTH_TYPE md5 in pg_hba.conf.
+
+<pre>
+ # TYPE DATABASE IP_ADDRESS MASK AUTH_TYPE
+
+ local all trust
+ host all 127.0.0.1 255.255.255.255 md5
+</pre>
+
+ * If you can not find your PostgreSQL documentation locally or you
+ did not install it, then you
+ can get it <a href="http://www.postgresql.org/idocs/">here</a>.
+
+ </ul>
+
+ <b>On Windows</b>
+
+ <ul>
+ * Use the <a href="http://www.cygwin.com/">Cygwin</a> installer to
+ install the PostgreSQL DBMS. It is
+ found in the database category.
+
+ * <p>Read the file postgres-x.x.README at /usr/doc/Cygwin and read
+ the requirements to install PostgreSQL. Those requirements
+ are included with cygwin except cygipc. A default installtion
+ of cygwin does not install everything you will need, so on the
+ safe side, just include everything when installing cygwin.
+
+ * <p>The -x.x in postgres-x.x is the version of your PostgreSQL DBMS.
+
+ * <p>Once Cygwin has installed the PostgreSQL DBMS on your computer,
+ read the file FAQ_MSWIN which is available
+ in /usr/doc/postgres-x.x
+
+ * <p>Important notes from this file are:
+
+ <ul>
+ <p><b>2.</b> - Install the latest <a href="http://www.neuro.gatech.edu/users/cwilson/cygutils/cygipc/index.html">CygIPC</a> package.
+ Cygwin includes a utility bunzip2 which can be used to unzip it. Now, change to
+ the root directory by
+ typing "cd /" then
+ you can use "tar xvf cygipc.xxx.tar" to untar it
+ in the root directory in cygwin.
+
+ <p>The cygipc package contains the support to run ipc-daemon
+ that you will need
+ to run before you can
+ run the PostgreSQL DBMS Server daemon (postmaster) or run
+ initdb which initializes the PostgreSQL database.
+
+ <p><b>3.</b> The Cygwin bin directory has to be placed in
+ the path before the Windows program directories,
+ for example, C:\cygwin\bin
+
+ <p><b>My own note.</b> In the Windows control panel, I set
+ the environment variables PATH to my cygwin /usr/local/bin,
+ /usr/bin, and /bin. I also set my LD_LIBRARY_PATH to
+ /usr/local/lib and /usr/lib. For example:
+
+ <p>
+<pre>
+PATH=c:\cygwin\usr\local\bin;c:\cygwin\usr\bin;c:\cygwin\bin;
+LD_LIBRARY_PATH=c:\cygwin\usr\local\lib;c:\cygwin\usr\lib;
+</pre>
+
+ <p><b>4.</b> Start the ipc-daemon that came with the cygipc
+ package. There
+ are two ways to do this: run it from the command line as:
+
+ <p>
+<pre>
+ipc-daemon &
+</pre>
+ <p>or you can set it up as a Windows service. See the
+ file cygrunsrv.README at /usr/doc/Cygwin on how to do this
+ for ipc-daemon and postmaster. Note the
+ troubleshooting section at the end of
+ the cygrunsrv.README file.
+
+ <p>To install ipc-daemon as a service,
+ you just have to run
+
+ <p>
+<pre>
+ipc-daemon --install-as-service' (--remove-as-service)
+</pre>
+
+ <p>and then run
+
+<pre>
+net start ipc-daemon
+</pre>
+ </ul>
+
+ <p>Read the installation.html file
+ at /usr/doc/postgresql-x.x/html/installation.html
+
+ <p>You will see in this file that you will need to
+ run the following commands:
+
+ <p>
+<pre>
+mkdir /usr/local/pgsql/data
+initdb -D /usr/local/pgsql/data
+postmaster -D /usr/local/pgsql/data
+createdb test
+psql test
+</pre>
+
+ <p>When you need to connect to the database,
+ you will need ipc-daemon and postmaster running. Start ipc-daemon
+ before any of the command above. If you restart your computer, you
+ need to start ipc-daemon and postmaster either manually or as a
+ service.
+
+ <p>psql is a command-line PostgreSQL client tool to
+ enter and run SQL commands and queries.
+
+ <p>If there is no database user named postgres, create a user named
+ postgres with the following SQL command in the client tool psql:
+
+ <p>
+<pre>
+psql test
+create user postgres with password 'fun2db';
+</pre>
+ <p>The only reason I say this is so you can easily use the System.Data tests
+ without having to change the database, userid, etc.
+ </ul>
+
+
diff --git a/web/ppc b/web/ppc
index 44c9ac4cd9a..bc2295f7aa4 100644
--- a/web/ppc
+++ b/web/ppc
@@ -3,28 +3,37 @@
** Status
-78 test(s) passed. 11 test(s) failed. (same as x86 :-)
+ It passes and compiles the same amount of mono tests as on the x86 architecture.
-mcs in interpreter could compile hello world application.
-
-** To do
+ mcs is self hosting on Linux/PPC.
*** Interpreter
-Up to date.
+ Up to date.
-*** Jitter
+*** JIT and code precompiled:
-Start the port
+ Works on MacOS X 10.2, 10.3 and Linux/PPC, exception handling
+ is currently broken on the JIT.
** Documentation
-<B>PowerPC architecture:</B>
+*** PowerPC architecture:
<A HREF="http://e-www.motorola.com/brdata/PDFDB/docs/MPCFPE32B.pdf">PowerPC Programming environments manual</A><BR>
<A HREF="http://e-www.motorola.com/brdata/PDFDB/docs/MPC7410UM.pdf">G4 (7410) User's manual</A>
+
+ There's a very nice introduction to PowerPC assembly language
+ at <a
+ href="http://www-106.ibm.com/developerworks/library/l-ppc/">http://www-106.ibm.com/developerworks/library/l-ppc/</a>.
+
+*** Calling conventions:
-<B>Calling conventions:</B>
+ Linux on PPC32 uses the <a
+ href="http://refspecs.freestandards.org/elf/elfspec_ppc.pdf">The
+ PowerPC SystemV ABI specification</a>.
- &lt;add me&gt;
+ On MacOS X, the conventions are documented in the <a
+ href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/MachORuntime.pdf">Mach-O
+ Runtime Architecture</a>.
diff --git a/web/print-stack b/web/print-stack
new file mode 100755
index 00000000000..1bf79581801
--- /dev/null
+++ b/web/print-stack
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+MANAGED_CALLS=`gdb -silent $1 -pid $2 << EOF | awk '/.* in \?\? \(\)/ {printf("call print_method_from_ip(%s)\n", $2);}'
+set height 0
+thread apply all bt
+quit
+EOF`
+
+gdb -silent $1 -pid $2 << EOF
+set height 0
+thread apply all bt
+$MANAGED_CALLS
+quit
+EOF
+
diff --git a/web/projects b/web/projects
index 47df1e71098..8f4a40a275c 100755
--- a/web/projects
+++ b/web/projects
@@ -10,8 +10,6 @@
** EOG component
-** XmlStorageSystem component
-
* Gtk# related projects
Gnome Canvas Bindings.
diff --git a/web/provider-factory b/web/provider-factory
new file mode 100755
index 00000000000..37309ec4324
--- /dev/null
+++ b/web/provider-factory
@@ -0,0 +1,156 @@
+* Provider Factory
+
+<p>Brian Ritchie contributed a Provider Factory and Data Tools for Mono ADO.NET<br>
+which gives us a foundation for abstract data provider access within Mono
+
+** Here are the deails:
+
+<ul>
+ <li>The Provider information is seperate from the connection string information.<br>
+ This allows the list of providers to be stored in the machine.config file.</li>
+ <li>Provider and ProviderCollection objects are available to access <br>
+ the list of providers and modify them at runtime.</li>
+ <li>The ProviderFactory object is used to create new connections, commands,<br>
+ dataadapters, parameters, etc.</li>
+</ul>
+
+** Overview of the ProviderFactory object model:
+
+<ul>
+ <li><b>ProviderFactory</b>: used to create new Connections, Commands,<br>
+ DataAdapters, or Commands. All objects are returned using <br>
+ the provider interfaces such as IDbConnection, IDbCommand,<br>
+ IDbDataAdapter, or IDataParamter</li>
+
+ <li><b>DataTools</b>: static methods for doing <br>
+ common tasks like filling a DataSet <br>
+ with the contents of a select statement.</li>
+
+ <li><b>ProviderCollection</b>: list of providers configured <br>
+ in the system. Initially loaded from app.config, but can <br>
+ be modified at run-time.</li>
+
+ <li><b>Provider</b>: represents a given provider (factory) <br>
+ and holds information needed to <br>
+ create the types.</li>
+
+ <li><b>ProviderSectionHandler</b>: works behind the <br>
+ scenes to load the list of <br>
+ providers from the app.config into a ProviderCollection.</li>
+</ul>
+
+** C# source code samples for creating a connection:
+
+<pre>
+ // Create connection using enhanced connection string
+ // The factory attribute specifies which provider
+ // to use. The factory attribute is parsed out, the
+ // object is created, and then the rest of the
+ // connection string is passed into the provider. The
+ // providers are defined in
+ // the app.config (or machine.config).
+ IDbConnection conn;
+ string connectionString =
+ "factory=System.Data.SqlClient;" +
+ "server=speedy;database=pubs;uid=sa";
+ conn = ProviderFactory.CreateConnection(connectionString);
+
+ // Create connection specifying provider
+ // and standard connection string
+ IDbConnection conn;
+ string provider = "System.Data.SqlClient";
+ string connectionString = "server=speedy;database=pubs;uid=sa";
+ conn = ProviderFactory.CreateConnection(provider,connectionString);
+
+ // Create connection using connection string stored
+ // in app.config under &lt;appSettings&gt;
+ IDbConnection conn;
+ string appSetting = "PubsConnStr";
+ conn = ProviderFactory.CreateConnectionFromConfig(appSetting);
+</pre>
+
+
+<p>C# Sample for Creating a DataAdapter and filling a DataSet.
+
+<pre>
+// Create Connection
+IDbConnection conn =
+ProviderFactory.CreateConnectionFromConfig("PubsConnStr");
+
+// Select command
+IDbCommand cmd=conn.CreateCommand();
+cmd.Text="select * from author";
+
+// Data Adapter
+DataSet ds=new DataSet();
+IDbDataAdapter adapter=ProviderFactory.CreateDataAdapter(cmd);
+adapter.Fill(ds, "Table1");
+</pre>
+
+<p>Creating a DataAdapter and filling a DataSet. <br>
+The super lazy method for people like me.
+<pre>
+// Create Connection
+IDbConnection conn =
+ProviderFactory.CreateConnectionFromConfig("TdsPubsConnStr");
+
+// Data Adapter
+DataSet ds=DataTools.FillDataSet(conn, "select * from author");
+</pre>
+
+
+<p>Here's some sample code on displaying a list <br>
+ of configured ADO.NET providers:
+<pre>
+Console.WriteLine("Configured Providers:");
+foreach (Provider p in ProviderFactory.Providers)
+ Console.WriteLine(p.Description);
+</pre>
+
+<p>A Super lazy overload to the FillDataSet method (in <br>
+DataTools.cs) that will fill a dataset in one line of code.
+
+<pre>
+DataSet ds=DataTools.FillDataSet("PubsConnStr", "select * from authors");
+</pre>
+
+** About Configuration Files
+
+<p>Information about <a href="http://msdn.microsoft.com/library/en-us/vbcon/html/vboriintroductiontoapplicationsettingstorage.asp?frame=true">app.config</a> files
+can be found at <a href="http://msdn.microsoft.com/">MSDN</a>.
+
+<p>See the mcs/class/Mono.Data/app.config for sample configuration file in<br>
+mcs source. Basically, if your application is named blah.exe, <br>
+you would create an app.config file named blah.exe.config
+
+<p>Here's a sample app.config file showing the provider <br>
+declarations along with sample connection strings:
+
+<pre>
+
+&lt;?xml version="1.0" encoding="utf-8" ?&gt;
+&lt;configuration&gt;
+ &lt;configSections&gt;
+ &lt;sectionGroup name="mono.data"&gt;
+ &lt;section name="providers" type="Mono.Data.ProviderSectionHandler,Mono.Data" /&gt;
+ &lt;/sectionGroup&gt;
+ &lt;/configSections&gt;
+ &lt;appSettings&gt;
+ &lt;add key="PubsConnStr" value="factory=System.Data.SqlClient;server=speedy;database=pubs;uid=sa;pwd=" /&gt;
+ &lt;/appSettings&gt;
+ &lt;mono.data&gt;
+ &lt;providers&gt;
+ &lt;provider name="System.Data.SqlClient" connection="System.Data.SqlClient.SqlConnection" adapter="System.Data.SqlClient.SqlDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
+ &lt;provider name="System.Data.OleDb" connection="System.Data.OleDb.OleDbConnection" adapter="System.Data.OleDb.OleDbDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
+ &lt;provider name="System.Data.Odbc" connection="System.Data.Odbc.OdbcConnection" adapter="System.Data.OleDb.OdbcDataAdapter" assembly="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
+ &lt;provider name="Mono.Data.TdsClient" connection="Mono.Data.TdsClient.TdsConnection" adapter="Mono.Data.TdsClient.TdsDataAdapter" assembly="Mono.Data.TdsClient" /&gt;
+ &lt;provider name="Mono.Data.MySql" connection="Mono.Data.MySql.MySqlConnection" adapter="Mono.Data.MySql.MySqlDataAdapter" assembly="Mono.Data.MySql" /&gt;
+ &lt;provider name="Mono.Data.PostgreSqlClient" connection="Mono.Data.PostgreSqlClient.PgSqlConnection" adapter="Mono.Data.PostgreSqlClient.PgSqlDataAdapter" assembly="Mono.Data.PostgreSqlClient" /&gt;
+ &lt;provider name="Mono.Data.SqliteClient" connection="Mono.Data.SqliteClient.SqliteConnection" adapter="Mono.Data.SqliteClient.SqliteDataAdapter" assembly="Mono.Data.SqliteClient" /&gt;
+ &lt;provider name="Mono.Data.SybaseClient" connection="Mono.Data.SybaseClient.SybaseConnection" adapter="Mono.Data.SybaseClient.SybaseDataAdapter" assembly="Mono.Data.SybaseClient" /&gt;
+ &lt;/providers&gt;
+ &lt;/mono.data&gt;
+&lt;/configuration&gt;
+
+</pre>
+
diff --git a/web/rationale b/web/rationale
index d63cf225a59..91cd3c7af7b 100644
--- a/web/rationale
+++ b/web/rationale
@@ -18,7 +18,7 @@
standard GNOME interfaces for easily creating reusable,
language independent components, controls and compound
documents. This technology is known as <a
- href="http://developer.ximian.com/tech/bonobo.html">Bonobo</a>.
+ href="http://developer.ximian.com/articles/whitepapers/bonobo">Bonobo</a>.
Interfaces to Bonobo exist for C, Perl, Python, and
Java.
@@ -134,25 +134,51 @@
** What makes up Mono?
- There are various pieces that will make up Mono:
+ There are various pieces that make up Mono today:
<ul>
* A C# compiler.
- * The Virtual Execution System: that will have the
+ * The Virtual Execution System: that has the
Just-in-Time compiler, garbage collector, loader,
threading engine.
- A byte code interpreter will be provided for quickly
+ A byte code interpreter is provided for quickly
porting Mono to new systems and debugging the JIT
purposes, but it is not intended to be the ideal
execution environment.
- * An implemenation of the .NET class library.
+ * An implemenation of the .NET class libraries:
+ Remoting, Reflection, Reflection.Emit, Xml, Xpath,
+ Xslt, Xml Serialization, Web Services support.
- * Visual development tools.
+ * Cross platform class libraries for data access:
+ Postgress, MySQL, DB2, TDS, Sybase, Oracle, ODBC and
+ Gnome's GDA.
- * A CIL GCC frontend.
+ * Unix class libraries: Mono.Posix
+
+ * Gnome-specific class libraries: The Gtk# family.
+
+ * A code pre-compiler to generate native code ahead of
+ time.
+
+ * Gtk# a toolkit to develop GNOME applications on Unix
+ and Windows.
+
+ * An implementation of the Remoting infrastructure in
+ .NET
+ </ul>
+
+ Other work-in-progress components:
+
+ <ul>
+ * A VB.NET compiler and JScript compilers are in the works.
+
+ * Web services on the server side.
+
+ * We are planning to include Remoting.CORBA as part of
+ Mono standard distribution.
</ul>
** Why use GNOME components?
diff --git a/web/remap b/web/remap
new file mode 100644
index 00000000000..28daca0acfc
--- /dev/null
+++ b/web/remap
@@ -0,0 +1,36 @@
+* History of remapping
+
+ The Mono runtime was shipped with the .NET 1.1 library APIs,
+ but until recently we did not have strong names or Global
+ Assembly Cache support so our libraries did not actually
+ encode the proper information about references.
+
+ Lacking this, in the early days of Mono we hardcoded our code
+ generator to set the values to the version of the .NET 1.0 API
+ to allow code to move back and forth between Windows and Linux.
+
+ With the deployment of the GAC to Mono we no longer distribute
+ assemblies without version information, and they are only
+ available through a versioned directory.
+
+ To assist people in migrating their applications from the
+ pre-Beta rollout of Mono, the runtime has a special feature to
+ remap references to the System.* assemblies with version 3300
+ to version 5000 but a warning is displayed:
+
+ <pre>
+ Compat mode: the request from XXXX to load YYYY was remapped (http://www.go-mono.com/remap.html)
+ </pre>
+
+ To solve this issue, use a new version of Mono to rebuild the
+ program listed as XXXX, this will remove the warning.
+
+ Alternatively, if you do not have the source, you can set the
+ environment variable MONO_SILENT_WARNING to eliminate those
+ messages:
+
+ <pre>
+ export MONO_SILENT_WARNING=1
+ </pre>
+
+
diff --git a/web/resources b/web/resources
index 7efc6d8909d..4e61aa7c75a 100644
--- a/web/resources
+++ b/web/resources
@@ -7,21 +7,48 @@
If you want to send suggestions for links, address them to <a
mailto="web-mono@ximian.com">web-mono@ximian.com</a>.
+** Routine Tests
+
+ Various test results that are run continously on Mono are available
+ at <a
+ href="http://www.go-mono.com/tests/index.php">www.go-mono.com/tests/index.php</a>
+
** Microsoft .NET
- The <a href="http://msdn.microsoft.com/net">Microsoft.NET site.</a>
+ The <a href="http://msdn.microsoft.com/netframework">Microsoft.NET site.</a>
- The Microsoft .NET Framework 1.0 can be downloaded <a href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/000/976/msdncompositedoc.xml&frame=true">here</a>
+ The Microsoft .NET Framework can be downloaded <a
+ href="http://msdn.microsoft.com/library/default.asp?url=/downloads/list/netdevframework.asp">here</a>
- New methods that are not documented in 1.0, are documented <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/framewrkaddend.asp">here</a>
+ New methods that are not documented in 1.0, are documented <a
+ href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/framewrkaddend.asp">here</a>
+
+ The changes between .NET 1.0 and .NET 1.1 are available <a href="http://www.csharphelp.com/archives2/archive406.html">here</a>
** IRC
Various Mono contributors get together on channel #mono on
irc.gnome.org
+** International Sites
+
+ See our <a href="other.html">page</a> with information on Mono International Sites.
+
** Mono related sites.
+ The Mono Tutorial:
+
+ <a href="http://go-mono.com/tutorial/">GNOME.NET Tutorial</a>
+
+ and other useful tutorials (Gtk#, Glade#, Embeded, etc) (in Spanish) at
+
+ <a href="http://www.monohispano.org">The Mono Hispano site</a>.
+
+ Community site for Mono at <a href="http://www.gotmono.com">Got Mono</a>
+
+ Wikis: <a href="http://www.nullenvoid.com/gtksharp/wiki">Gtk# Wiki</a>
+ and <a href="http://www.nullenvoid.com/mono/wiki">Mono Wiki</a>.
+
Sergey's web page on Mono resources:
<a href="http://mono.eurosoft.od.ua">http://mono.eurosoft.od.ua</a>
@@ -30,9 +57,9 @@
<a href="http://www.gotdotnet.com">Got Dot Net</a>
- MonoMail:
+ Got Mono:
- <a href="http://sourceforge.net/projects/monomail/">http://sourceforge.net/projects/monomail/</a>
+ <a href="http://www.gotmono.com">Got Mono</a>
Zip classes:
@@ -45,21 +72,21 @@
href="http://www.foundstone.com/pdf/dotnet-security-framework.pdf">.NET
security architecture</a>.
-** Presentations
+** Development Tools
+
+ A tool to compare two assemblies:
- Currently the <a href="Presentations/O-Reilly">O'Reilly</a>
- presentation on Mono is available. Arturo Espinosa has given
- a talk on Mono in Mexico and made <a
- href="http://construct.ximian.com/~arturo/Presentations/Mono.OLS/html">spanish
- slides</a>
+ <ul>
+ <li><a href="http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=winchurn">http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=winchurn</a>
+ </ul>
** ECMA Documentation.
You can get the documentation for the ECMA specs from:
<ul>
- * <a href="http://www.ecma.ch/ecma1/STAND/ecma-334.htm">C# Language Specification</a>
- * <a href="http://www.ecma.ch/ecma1/STAND/ecma-335.htm">Common Language Infrastructure</a>
+ * <a href="http://www.ecma-international.org/publications/standards/Ecma-334.HTM">C# Language Specification</a>
+ * <a href="http://www.ecma-international.org/publications/standards/Ecma-335.HTM">Common Language Infrastructure</a>
</ul>
@@ -68,7 +95,6 @@
<ul>
* <a href="http://msdn.microsoft.com/net/ecma">At MSDN</a>
* <a href="http://www.dotnetexperts.com">Dot Net Experts</a>
- * <a href="http://developer.intel.com/software/idap/ecma">Intel</a>
* <a href="http://lightning.csse.monash.edu.au/.net/CLI">Monash University</a>
</ul>
@@ -103,26 +129,57 @@
There are a number of related projects to Mono:
+ <li><b>Development tools</b></li>
<ul>
* <a
href="http://www.icsharpcode.net/OpenSource/SD/default.asp">Sharp
Develop:</a> an IDE for the C# language written in C#.
+ * <a href="http://nunit.sourceforge.net">NUnit:</a> A
+ testing framework for .NET classes.
+
* <a
- href="http://www.improve-technologies.com/alpha/esharp/">Eclipse
- Plugin for C#</a>
+ href="http://xmarks.sourceforge.net/doc.html">XMarks DOC.NET:</a> For
+ creating online documentation you can browse for your own classes.
+
+ * <a
+ href="http://www.cl.cam.ac.uk/~jds31/research/gccnet/">GCC .NET backend</a>.
+ Jeremy Singer has developed a .NET backend for GCC. This is research work.
+ </ul>
+
+ <li><b>Class Libraries</b></li>
+ <ul>
+ * <a href="http://cs-sdl.sourceforge.net/">SDL for
+ .NET:</a> Bindings for the popular SDL graphics library.
+
+
+ * C# bindings for OpenGL and SDL are available here: <a
+ href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
+
+ * <a
+ href="http://qtcsharp.sourceforge.net">Qt#:</a>
+ C# bindings for the Qt toolkit.
+
+ * <a
+ href="http://codigolivre.org.br/projects/monoqle">Project MonoQLE:</a> a C# Message Queue Server.
+ Sorry only in portuguese, for now.
+
+ </ul>
+
+ <li><b>Programming languages:</b></li>
+ <ul>
* <a
href="http://janet-js.sourceforge.net/">Janet:</a>
an implemention of ECMAScript (the standarized
version of JavaScript) in C#
+ </ul>
+ <li><b>Other projects</b></li>
+ <ul>
* <a
- href="http://xmarks.sourceforge.net/doc.html">XMarks DOC.NET:</a> For
- creating online documentation you can browse for your own classes.
-
- * <a href="http://nunit.sourceforge.net">NUnit:</a> A
- testing framework for .NET classes.
+ href="http://www.improve-technologies.com/alpha/esharp/">Eclipse
+ Plugin for C#</a>
* <a href="http://www.kaffe.org">Kaffe:</a> A popular
Free Software JIT engine for Java.
@@ -130,18 +187,14 @@
* <a href="http://www.intel.com/research/mrl/orp">ORP:</a> A research
JIT/VM/GC system from Intel.
- * C# bindings for OpenGL and SDL are available here: <a
- href="http://csgl.sourceforge.net">http://csgl.sourceforge.net</a>
-
* <a
href="http://www.southern-storm.com.au/portable_net.html">Portable.NET:</a>
Another implementation of the CLI and C# compiler.
-
</ul>
** GNOME Documentation
- Documnetation on GNOME, and the GNOME APIs is available from
+ Documentation on GNOME, and the GNOME APIs is available from
the <a href="http://developer.gnome.org">developer</a> site at
GNOME:
diff --git a/web/runtime b/web/runtime
index 908600e8f84..d1dabab9968 100644
--- a/web/runtime
+++ b/web/runtime
@@ -1,70 +1,82 @@
* The Mono runtime
- The Mono runtime implements a JIT engine for the CIL virtual
- machine (as well as a byte code interpreter, this is to
- quickly port it to new systems), the class loader, the garbage
- collector, threading system and metadata access libraries.
+ The Mono runtime engine is considered feature complete.
+
+ It implements a Just-in-Time compiler engine for the CIL
+ virtual machine, the class loader, the garbage collector,
+ threading system and metadata access libraries.
We currently have two runtimes:
<ul>
- * <b>mono:</b> The Just In Time compiler implemented
- using a BURS instruction selector. We only support
- x86 machines in the JIT engine at this point.
+ * <b>mono:</b> Our Just-in-Time and Ahead-of-Time code
+ generator for maximum performance. This supports
+ x86, PowerPC and SPARC cpus.
* <b>mint:</b> The Mono interpreter. This is an
easy-to-port runtime engine.
</ul>
- Currently we are using the Bohem conservative garbage
- collector, but we working on incorporating the ORP GC engine.
+ We are using the Boehm conservative garbage collector.
+
+ The Mono runtime can be used as a stand-alone process, or it
+ can be <a href="embedded-api.html">embedded into applications</a> (see
+ the documentation in mono/samples/embed for more details).
-** Executing MSIL/CIL images
+ Embedding the Mono runtime allows applications to be extended
+ in C# while reusing all of the existing C and C++ code.
- The code will load an executable and map the references to
- external assemblies to our own version of the assemblies on
- Linux.
+ Paolo Molaro did a presentation on the current JIT engine and
+ the new JIT engine. You can find his <a
+ href="http://primates.ximian.com/~lupus/slides/jit/">slides
+ here</a>
- Our roadmap looks like this, this has been updated as of
- <b>Dec 18, 2001</b>:
+** Current JIT Engine: technical details (<b>updated, June 28th, 2003</b>)
+
+ We have re-written our JIT compiler. We wanted to support a
+ number of features that were missing:
<ul>
+ * Ahead-of-time compilation.
- * Milestone 1: <b>Done</b> Fully read and parse all CIL byte-codes
- and metadata tokens (ie, a disassembler).
+ The idea is to allow developers to pre-compile their code
+ to native code to reduce startup time, and the working
+ set that is used at runtime in the just-in-time compiler.
- * Milestone 2: <b>Done</b> Complete an interpreter for CIL byte
- codes. This interpreter can be used temporarly to
- run CIL byte code on a system where no JIT is
- available.
+ Although in Mono this has not been a visible problem, we
+ wanted to pro-actively address this problem.
- * Milestone 3: <b>Done</b>Define an <i>lburg</i>-like
- instruction selector for the JITer for Intel.
+ When an assembly (a Mono/.NET executable) is installed in
+ the system, it would then be possible to pre-compile the
+ code, and have the JIT compiler tune the generated code
+ to the particular CPU on which the software is
+ installed.
- * Milestone 4: <b>Done</b> Implement JITer. This is where our
- current efforts are focused on, the JITer currently runs
- all of the code we have tested on it. The major limitation
- is that our class libraries are not complete, and hence not
- every application can be ran.
+ This is done in the Microsoft.NET world with a tool
+ called ngen.exe
- * Milestone 5: Port of the JITer to non IA32 systems.
- </ul>
+ * Have a good platform for doing code optimizations.
- A setup similar to the Kaffe JIT engine will be used to
- layout the code to support non-IA32 architectures. Our work
- will be focused on getting a IA32 version running first.
+ The design called for a good architecture that would
+ enable various levels of optimizations: some
+ optimizations are better performed on high-level
+ intermediate representations, some on medium-level and
+ some at low-level representations.
- The JIT engine works on Linux and Win32, although you
- will need to install the CygWin32 development tools to get a
- Unix-like compilation environment (mostly we use GNU make in
- a few of the makefiles).
+ Also it should be possible to conditionally turn these on
+ or off. Some optimizations are too expensive to be used
+ in just-in-time compilation scenarios, but these
+ expensive optimizations can be turned on for
+ ahead-of-time compilations or when using profile-guided
+ optimizations on a subset of the executed methods.
-** JIT Engine (<b>updated, April 21, 2002</b>)
+ * Reduce the effort required to port the Mono code
+ generator to new architectures.
- The JIT engine uses a code-generator generator approach for
- compilation. Given the properties of CIL byte codes, we can
- take full advantage of a real instruction selector for our
- code generator.
+ For Mono to gain wide adoption in the Unix world, it is
+ necessary that the JIT engine works in most of today's
+ commercial hardware platforms.
+ </ul>
The JIT engine implements a number of optimizations:
@@ -75,11 +87,18 @@
* Inlining.
- * Constant folding.
+ * Constant folding, copy propagation, dead code elimination.
Although compilers typically do
constant folding, the combination of inlining with
constant folding gives some very good results.
+
+ * Linear scan register allocation. In the past,
+ register allocation was our achilles heel, but now
+ we have left this problem behind.
+
+ * SSA-based framework. Various optimizations are
+ implemented on top of this framework
</ul>
There are a couple of books that deal with this technique: "A
@@ -88,7 +107,13 @@
technical description of <a
href="http://research.microsoft.com/copyright/accept.asp?path=http://www.research.microsoft.com/~drh/pubs/iburg.pdf&pub=ACM">lbrug</a>.
- A few papers that describe the instruction selector:
+ The new JIT engines uses three intermediate representations:
+ the source is the CIL which is transformed into a forest of
+ trees; This is fed into a BURS instruction selector that
+ generates the final low-level intermediate representation.
+
+ The instruction selector is documented in the following
+ papers:
<ul>
* <a href="http://research.microsoft.com/copyright/accept.asp?path=http://www.research.microsoft.com/~drh/pubs/interface.pdf&pub=wiley">A code generation interface for ANSI C</a>
@@ -98,30 +123,13 @@
</ul>
-** Future plans
-
- We are evaluating the future directions for the JIT engine:
- both from our needs (optimizations like inlining, better register allocation,
- instruction scheduling, and porting to other CPUs).
-
- We have not yet decided how we will evolve the JIT engine. We
- might just upgrade our current architecture, and provide optimizations as
- an extra layer.
-
** Garbage Collection
- Currently we are using the Boehm conservative GC. Although our plans
- are to move to the Intel ORP GC engine, our plans on a next generation
- dual-JIT engine have to be taken into account.
-
- We will be using the Intel ORP GC engine as it provides a precise
+ We are using the Boehm conservative GC. We might consider
+ adopting other GC engines in the future, like the Intel ORP GC
+ engine. The Intel ORP GC engine as it provides a precise
garbage collector engine, similar to what is available on the
- .NET environment.
-
- Although using a conservative garbage collector like Bohem's
- would work, all the type information is available at runtime,
- so we can actually implement a better collector than a
- conservative collector.
+ .NET environment.
<ul>
* Garbage collection list and FAQ:<br>
@@ -145,7 +153,7 @@
The ECMA runtime and the .NET runtime assume an IO model and a
threading model that is very similar to the Win32 API.
- Dick Porter has been working on the Mono abstraction layer
+ Dick Porter has developed WAPI: the Mono abstraction layer
that allows our runtime to execute code that depend on this
behaviour.
@@ -174,7 +182,8 @@
as well as talking to system libraries.
Initially we used libffi, but it was fairly slow, so we have
- reused parts of the JIT work to create efficient PInvoke trampolines.
+ reused parts of the JIT work to create efficient PInvoke
+ trampolines.
** Remoting
diff --git a/web/screenshots b/web/screenshots
new file mode 100644
index 00000000000..25cc06998d7
--- /dev/null
+++ b/web/screenshots
@@ -0,0 +1,229 @@
+* Screenshots
+
+** Mono Debugger
+
+ Some shots of the <a href="jit-debug.html">Mono Debugger</a>
+
+ <table border=1>
+ <tr>
+ <td>
+ <a href="images/Screenshot-Debugger-1.png"><img src="images/Screenshot-Debugger-1-thumb.png"></a>
+ </td>
+ </tr>
+ <tr>
+ Debugger showing the source code view.
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <a href="images/Screenshot-Debugger-2.png"><img src="images/Screenshot-Debugger-2-thumb.png"></a>
+ </td>
+ </tr>
+ <tr>
+ Debugger showing the CPU view.
+ </tr>
+ </table>
+
+** Mono Documentation Browser
+
+ The Mono Documentation Browser is available from <a
+ href="anoncvs.html">CVS</a>, module `monodoc'.
+
+ <table border=1>
+ <tr>
+ <td>
+ <a href="images/Screenshot-B2.png"><img src="images/Screenshot-B2-thumb.png"></a>
+ </td>
+ </tr>
+ <tr>
+ Mono Documentation Browser rendering a method description.
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <a href="images/Screenshot-MethodSummary.png"><img src="images/Screenshot-MethodSummary-thumb.png"></a>
+ </td>
+ </tr>
+ <tr>
+ Mono Documentation Browser rendering the class method summary
+ </tr>
+ </table>
+
+** Eclipse running with Mono
+
+ Zoltan Varga made the Java VM for .NET <a
+ href="http://www.ikvm.net">IKVM</a> run <a
+ href="http://www.eclipse.org">Eclipse</a>, the IBM Open Source IDE.
+
+ <a href="images/ikvm-screenshot.png"><img src="images/ikvm-screenshot-thumb.png"></a>
+
+** Mono Basic
+
+ The Mono Basic compiler ships with the Mono distribution.
+
+ <table border=1>
+ <tr>
+ <td>
+ <a href="images/gtk-vb.png"><img src="images/gtk-vb-thumb.png"></a>
+ </td>
+ </tr>
+ <tr>
+ Mono Basic running a sample Gtk# application.
+ </tr>
+ </table>
+
+** Platano Media Player
+
+ Alp's <a href="http://www.atoker.com/platano/">Platano</a>
+ Media Player is written with Gtk# (with GStreamer support):
+
+ <table border=1>
+ <tr>
+ <td>
+ <img src="images/platano_s.png"></a>
+ </td>
+ </tr>
+ <tr>
+ Platano startup.
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <img src="images/platano-playing_s.png">
+ </td>
+ </tr>
+ <tr>
+ Platano playing the <a
+ href="http://developer.ximian.com/projects/third_party/codemonkey/index.html">Code
+ Monkey At Work</a> video.
+ </tr>
+ </table>
+
+** GSIRC
+
+ Alp's <a href="http://www.atoker.com/gsirc/">GSIRC</a>
+ Gtk-Sharp IRC written with Gtk#
+
+ <table border=1>
+ <tr>
+ <td>
+ <a href="http://go-mono.com/images/gsirc-0.2a_overview.jpg"><img src="images/gsirc-0.2a_overview-thumb.jpg"></a>
+ </td>
+ </tr>
+ <tr>
+ GSIRC is shown with the preferences dialog and chatting on some channels (rooms).
+ </tr>
+ </table>
+
+** SQL# For GTK#
+
+ Daniel Morgan's SQL query tool that runs on Mono on Linux and Windows. It is
+ written in C# and allows you to connect to various Mono ADO.NET providers and
+ enter SQL commands.
+
+ <table border=1>
+ <tr>
+ <td>
+ <img src="http://go-mono.com/images/sqlsharp.png">
+ </td>
+ </tr>
+ <tr>
+ SQL# For GTK# is shown retrieving data from a Microsoft SQL Server 2000 database.
+ </tr>
+ </table>
+
+** Type Reflector
+
+ Type Reflector is a tool included in Mono to inspect your assemblies.
+
+ <table border=1>
+ <tr>
+ <td>
+ <img src="images/type-reflector.png">
+ </td>
+ </tr>
+ </table>
+
+** Object Browser
+
+ Radek Doulik's Object Browser (in Mono CVS) is a useful tool
+ to inspect existing assemblies and their source code:
+
+ <table border=1>
+ <tr>
+ <td>
+ <img src="images/Screenshot-ObjectBrowserDemo.png">
+ </td>
+ </tr>
+ </table>
+
+** Windows.Forms
+
+ Windows.Forms running with Wine on Linux:
+
+ <table border=1>
+ <tr>
+ <td>
+ <a href="http://go-mono.com/images/monomdi.jpg"><img src="http://go-mono.com/images/monomdi-thumb.jpg"></a>
+ </td>
+ </tr>
+ </table>
+
+ <table border=1>
+ <tr>
+ <td>
+ <a href="http://go-mono.com/images/WINESWF.JPG"><img src="http://go-mono.com/images/WINESWF-thumb.JPG"></a>
+ </td>
+ </tr>
+ </table>
+
+** Mono running on the iPaq
+
+ <table border=1>
+ <tr>
+ <td>
+ <img src="images/familiar-mint-hello.png">
+ </td>
+ </tr>
+ </table>
+
+
+** Mono Certificate Viewer
+
+ <table border=1>
+ <tr>
+ <td>
+ <img src="images/swf-certview.png">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ running on Windows using SWF
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <img src="images/gtk-certview.png">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ running on Linux (RH9) using GTK#
+ </td>
+ </tr>
+ </table>
+
+** SkyNET
+
+ SkyNET is written in C# and uses GTK# for displaying a star chart.
+
+ <table border=1>
+ <tr>
+ <td>
+ <img src="http://go-mono.com/images/skynet.png">
+ </td>
+ </tr>
+ </table>
diff --git a/web/sqlclient b/web/sqlclient
new file mode 100755
index 00000000000..eca4906cbe3
--- /dev/null
+++ b/web/sqlclient
@@ -0,0 +1,263 @@
+* Microsoft SQL Server Provider
+
+<ul>
+ <li>ADO.NET Provider for Microsoft SQL Server 7/2000 databases</li>
+
+ <li>Exists in namespace System.Data.SqlClient and assembly System.Data</li>
+
+ <li>Created by Tim Coleman</li>
+
+ <li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
+ <a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
+
+ <li>Implemented in 100% C#</li>
+
+ <li>Is similar to the Mono.Data.TdsClient and Mono.Data.SybaseClient providers.</li>
+
+ <li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
+
+ <li>Uses TDS Protocol Version 7.0</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+</ul>
+
+
+** Current Status
+
+
+<ul>
+
+ <li>Connect to Microsoft SQL Server 7/2000 databases via SQL Server authentication and NT Authentication.</li>
+
+ <li>Connection pooling works.</li>
+
+ <li>Stored Procedures work.</li>
+
+ <li>Parameters work.</li>
+
+ <li>Prepare works.</li>
+
+ <li>SQL commands can be executed
+ via ExecuteNonQuery() of a SqlCommand.</li>
+
+ <li>SQL aggregates can be executed and a single row and single column
+ result can be retrieved via ExecuteScalar() of a SqlCommand</li>
+
+ <li>SQL queries can be executed via ExecuteReader() and results
+ can be retrieved via SqlDataReader.</li>
+
+ <li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
+ in a SqlDataReader</li>
+
+ <li>XML can be read via ExecuteXmlReader in a SqlCommand.</li>
+
+ <li>Data can be filled in a DataTable in a DataSet via a SqlDataAdapter</li>
+
+ <li>Works in the SQL# command-line and GTK# GUI version</li>
+</ul>
+
+** Action plan
+
+<ul>
+
+ <li>Needs more testing and fixing bugs</li>
+
+ <li>Start work on TDS Protocol Version 8.0 support</li>
+
+ <li>Add support for the .NET Framework 2.0 (Whidbey)</li>
+
+ <li>Add support for Microsoft SQL Server 2005 (Yukon) support</li>
+
+</ul>
+
+** Testing
+
+<ul>
+ <li>Have a working mono and mcs installed</li>
+
+ <li>Have access to a Microsoft SQL Server database
+ or either download it:
+ <ul>
+ <li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a></li>
+ </ul>
+ </li>
+
+ <li><b>IMPORTANT:</b> If using Microsoft SQL Server 2000, make sure
+ you are using at least Service Pack 3 for Microsoft SQL Server 2000. If using
+ MSDE 2000, make sure you have the special Service Pack 3 for MSDE 2000. You
+ can get it from <a href="http://www.microsoft.com/sql/downloads/2000/sp3.asp">here</a></li>
+
+ <li>For those that only have MSDE installed. You can change the authentication mode
+ from Windows Only Authentication to SQL Server and Windows Authentications (also knows as Mixed-mode authentication)
+ via the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322336&sd=tech#4">registry</a></li>. It is
+ the LoginMode you need to change. By default,
+ MSDE is installed with Windows Only Authentication. If you want SqlClient to work with MSDE via SQL Server authentication, you will
+ need to change the setting. Otherwise, you wil have to use NT Authentication.</a>
+
+ <li>If using MSDE, you might need to create a new user with password. Give
+ this user access to various databases in this MSDE instance. Also, for each
+ database, give this new user at least SELECT access to the various tables you want
+ to retrieve data from.</li>
+
+ <li>If you have Enterprise Manager, you can easily change the authentication mode
+ for both MSDE and Microsoft SQL Server. To change the authentication mode in
+ Enterprise Mananger, select the instance, right-click on it, and select properites.
+ The SQL Server properties dialog for that instance will pop up. Choose the Security
+ tab. Change the Authentication from Windows Only to SQL Server and Windows. If
+ the instance of your database does not show up in Enterprise Manager, Register first
+ by selecting the Action menu and choosing New SQL Server Registration.</li>
+
+ <li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
+ named SqlTest.cs and you could use this as a basis for your test.</li>
+
+ <li>If you want to use Integrated Security (aka NT Authentication aka Trusted Connection aka Domain Login), you
+ will need to specify the Domain User ID and Password. This is because Mono is not integrated with Windows
+ nor SQL Server.</li>
+
+ <li>Has a connection string format for SQL Server Authentication:
+<pre>
+ Server=hostname;
+ Database=databaseName;
+ User ID=sqlServerUserid;
+ Password=sqlServerPassword
+</pre>
+ </li>
+ <li>Has a connection string format for NT Authentication:
+<pre>
+ Server=hostname;
+ Database=databaseName;
+ User ID=windowsDomain\windowsUserid;
+ Password=windowsPassword;
+ Integrated Security=SSPI
+</pre>
+ </li>
+
+ <li>The Server part can be used three ways:
+
+ <table border=1>
+ <tr>
+ <td><b>Server Definition</b></td> <td><b>Example</b></td>
+ </tr>
+
+ <tr>
+ <td>hostname</td> <td>Server=MYHOST</td>
+ </tr>
+
+ <tr>
+ <td>hostname,port</td> <td>Server=MYHOST,1433</td>
+ </tr>
+
+ <tr>
+ <td>hostname\instance</td> <td>Server=MYHOST\NETSDK</td>
+ </tr>
+ </table>
+ </li>
+
+ <li>C# Example using SQL Server Authentication:
+<pre>
+ using System;
+ using System.Data;
+ using System.Data.SqlClient;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Server=MyServer;" +
+ "Database=pubs;" +
+ "User ID=MySqlServerUserId;" +
+ "Password=MySqlServerPassword;";
+ IDbConnection dbcon;
+ dbcon = new SqlConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ string sql =
+ "SELECT fname, lname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["fname"];
+ string LastName = (string) reader["lname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+
+ <li>C# Example using NT Authentication (Integrated Security)
+<pre>
+ using System;
+ using System.Data;
+ using System.Data.SqlClient;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Server=MyServer;" +
+ "Database=pubs;" +
+ "User ID=MyWindowsDomain\\MyWindowsUserid;" +
+ "Password=MyWindowsPassword;" +
+ "Integrated Security=SSPI";
+ IDbConnection dbcon;
+ dbcon = new SqlConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ string sql =
+ "SELECT fname, lname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["fname"];
+ string LastName = (string) reader["lname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+
+</ul>
+
diff --git a/web/sqlite b/web/sqlite
new file mode 100755
index 00000000000..8c866571c4e
--- /dev/null
+++ b/web/sqlite
@@ -0,0 +1,143 @@
+* SQL Lite Data Provider
+
+<ul>
+ <li>ADO.NET Data Provider for
+ the <a href"http://www.hwaci.com/sw/sqlite/">SQL Lite</a> which
+ is an embeddable SQL database engine</li>
+
+ <li>From the SQL Lite web page: SQLite is a C library that
+ implements an embeddable SQL database engine. Programs that link with
+ the SQLite library can have SQL database access without
+ running a separate RDBMS process. The distribution
+ comes with a standalone command-line access program (sqlite) that
+ can be used to administer an SQLite database and which serves
+ as an example of how to use the SQLite library. SQLite is not a client library
+ used to connect to a big database server. SQLite is the server. The SQLite
+ library reads and writes directly to and from the database files on disk.</li>
+
+ <li>SQL Lite can be downloaded
+ from <a href="http://www.hwaci.com/sw/sqlite/download.html">here</a>.
+ binaries exist for Linux and Windows. sqlite.dll on Windows
+ and sqlite.so on Linux. The source code is available too.</li>
+
+ <li>Exists in namespace and assembly Mono.Data.SqliteClient</li>
+
+ <li>Created by Vladimir Vukicevic so he could have a database of
+ thumbnail images for mPhoto. mPhoto is GUI application
+ for cataloging images. mPhoto runs on Mono
+ and uses <a href="http://www.go-mono.com/gtk-sharp.html">GTK#</a> for its GUI.</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+</ul>
+
+** Current Status
+
+<ul>
+ <li>Able to connect, execute commands, and retrieve data...</li>
+
+ <li>Works in mPhoto by providing access to a SQL Lite database to store images.</li>
+</ul>
+
+** Action Plan
+
+<ul>
+ <li>Create a DataAdapter for SQL Lite named SqliteDataAdapter that can be used to
+ Fill a DataTable in a DataSet</li>
+
+ <li>Get the method GetSchemaTable() in class SqliteDataReader to return a DataTable
+ that works</li>
+</ul>
+
+** Testing
+
+<ul>
+ <li>Have a working mcs and mono</li>
+
+ <li>Make sure Mono.Data.SqliteClient.dll was built and is installed
+ in the same place as the mono class libraries.</li>
+
+ <li>If you do not have <a href"http://www.hwaci.com/sw/sqlite/download.html">SQL Lite</a>,
+ download it. There are binaries for Windows and Linux.</li>
+
+ <li>There is a test named SqliteTest.cs found at mcs/class/Mono.Data.SqliteTest/Test</li>
+
+ <li>Has a connection string format of "URI=file:some/path". For example,
+ the connection string "URI=file:SqliteTest.db" will use the database file
+ named SqliteTest.db, if it does not exist, the file will be created.</li>
+
+ <li>C# Example:
+<pre>
+ using System;
+ using System.Data;
+ using Mono.Data.SqliteClient;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString = "URI=file:SqliteTest.db";
+ IDbConnection dbcon;
+ dbcon = new SqliteConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ // requires a table to be created named employee
+ // with columns firstname and lastname
+ // such as,
+ // CREATE TABLE employee (
+ // firstname varchar(32),
+ // lastname varchar(32));
+ string sql =
+ "SELECT firstname, lastname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader[0];
+ string LastName = (string) reader[1];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r Mono.Data.SqliteClient.dll
+</pre>
+ </li>
+ <li>Build on Windows via Cygwin:
+<pre>
+ mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
+ TestExample.cs \
+ -lib:C:/cygwin/home/MyHome/mono/install/lib \
+ -r System.Data.dll \
+ -r Mono.Data.SqliteClient.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+
+</ul>
+
diff --git a/web/sybase b/web/sybase
new file mode 100755
index 00000000000..85deca1a67c
--- /dev/null
+++ b/web/sybase
@@ -0,0 +1,153 @@
+* Sybase Data Provider
+
+<ul>
+ <li>ADO.NET Provider for Sybase SQL Server databases</li>
+
+ <li>Exists in namespace Mono.Data.SybaseClient and assembly Mono.Data.SybaseClient</li>
+
+ <li>Created by Tim Coleman</li>
+
+ <li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
+ <a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
+
+ <li>Implemented in 100% C#</li>
+
+ <li>Is similar to the Mono.Data.TdsClient and System.Data.SqlClient providers.</li>
+
+ <li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
+
+ <li>Uses TDS Protocol Version 5.0</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+
+</ul>
+
+** Current Status
+
+<ul>
+ <li>Able to connect to Sybase databases</li>
+
+ <li>SQL commands can be executed
+ via ExecuteNonQuery() of a SybaseCommand.</li>
+
+ <li>SQL aggregates can be executed and a single row and single column
+ result can be retrieved via ExecuteScalar() of a SybaseCommand</li>
+
+ <li>SQL queries can be executed via ExecuteReader() and results
+ can be retrieved via SybaseDataReader.</li>
+
+ <li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
+ in a SybaseDataReader</li>
+
+ <li>Data can be filled in a DataTable in a DataSet via a SybaseDataAdapter</li>
+</ul>
+
+** Action plan
+
+<ul>
+ <li>Connection timeouts is being developed now.
+
+ <li>Needs more testing...
+
+</ul>
+
+** Testing
+
+<ul>
+ <li>Have a working mono and mcs installed</li>
+
+ <li>Have access to a Sybase database
+ or either download it:
+ <ul>
+ <li><a href="http://www.sybase.com/downloads">Sybase</a></li>
+ </ul>
+ </li>
+
+ <li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
+ named SqlTest.cs and you could use this as a basis for your test.</li>
+
+ <li>Has a connection string format:
+<pre>
+ Server=hostname;Database=databaseName;User ID=userid;Password=password
+</pre>
+ </li>
+ <li>The Server part can be used two ways:
+ <ul>
+ <li>hostname - "Server=MYHOST"</li>
+ <li>hostname,port - "Server=MYHOST,1533"</li>
+ </ul>
+ </li>
+
+ <li>C# Example:
+<pre>
+ using System;
+ using System.Data;
+ using Mono.Data.SybaseClient;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Server=localhost;" +
+ "Database=pubs;" +
+ "User ID=myuserid;" +
+ "Password=mypassword;";
+ IDbConnection dbcon;
+ dbcon = new SybaseConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ string sql =
+ "SELECT fname, lname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["fname"];
+ string LastName = (string) reader["lname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r Mono.Data.SybaseClient.dll
+</pre>
+ </li>
+ <li>Build on Windows via Cygwin:
+<pre>
+ mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
+ TestExample.cs \
+ -lib:C:/cygwin/home/MyHome/mono/install/lib \
+ -r System.Data.dll -r Mono.Data.SybaseClient.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+
+</ul>
+
diff --git a/web/tds-providers b/web/tds-providers
new file mode 100644
index 00000000000..6442e69601a
--- /dev/null
+++ b/web/tds-providers
@@ -0,0 +1,164 @@
+* Design of the Microsoft SQL Server, Sybase, and TDS Data Providers in Mono
+
+ <ul>
+ * After much discussion among the Mono ADO.NET developers,
+ we have come up with the design of implementing a Sybase, Microsoft
+ SQL Server, and TDS Generic ADO.NET providers. These providers have
+ been created and are actively developed by Tim Coleman.
+
+ * Since Sybase and Microsoft SQL Server databases both
+ use the TDS protocol for data access, and other implementations
+ of TDS (FreeTDS and jTDS) have included support for multiple
+ versions of the TDS, we have decided to do the same.
+
+ * The TdsClient ADO.NET provider will be Mono's first provider
+ written completely in C# without any dependencies except
+ the usual suspects: corlib.dll, System.dll, and System.Xml.dll.
+ </ul>
+
+* New ADO.NET Providers
+
+<p>There will be three ADO.NET providers that will use TDS.
+
+ <ol>
+ <li><p>Mono.Data.SybaseClient namepace and assembly will
+ hold the ADO.NET provider for Sybase SQL Server database.
+ This provider uses TDS version 5.0 which
+ can only be used with Sybase databases.
+
+ <li><p>System.Data.SqlClient namespace and System.Data assembly
+ will hold the ADO.NET provider
+ for Microsoft SQL Server 7.0/2000 databases. This provider is to be
+ compatible with SqlClient in Microsoft .NET and uses TDS version 7.0
+ which only supports Microsoft SQL Server 7.0/2000.
+ There is TDS version 8.0
+ which we will need to support as well, but it is used for
+ Microsoft SQL Server 2000 databases.
+
+ <li><p>Mono.Data.TdsClient namespace and assembly is a generic
+ provider for older TDS databases. This provider will default to
+ using TDS version 4.2 which can be used by older Sybase and
+ Microsoft SQL Server databases.
+ </ol>
+
+* Building The New Providers
+
+ <p> All three providers will use common internal code
+ at Mono.Data.TdsClient.Internal. Any classes in
+ Mono.Data.TdsClient.Internal will have the internal
+ keyword and will be built with the assembly of that provider.
+ <ol>
+ <li><p>SqlClient will build its assembly System.Data using files
+ from System.Data, System.Data.SqlClient, System.Data.SqlTypes,
+ System.Data.Common, and Mono.Data.TdsClient.Internal.
+
+ <p>SqlClient
+ will only reference the usual
+ suspects: corlib.dll, System.dll, and System.Xml.dll. SqlClient will be
+ a wrapper around TdsClient.Internal, but provide specific functionality to
+ Microsoft SQL Server 7.0/2000 databases.
+
+ <p>SqlClient build example:
+
+<pre>
+ mcs -target:library -out:System.Data.dll \
+ System.Data.SqlClient/*.cs \
+ ..\Mono.Data.TdsClient\Mono.Data.TdsClient.Internal\*.cs \
+ [any other classes in System.Data assembly...] \
+ -r corlib.dll -r System.dll -r System.Xml.dll
+</pre>
+
+ <li><p>SybaseClient will build its assembly Mono.Data.SybaseClient using
+ files from Mono.Data.SybaseClient and Mono.Data.TdsClient.Internal.
+ SybaseClient will reference
+ the usual suspects plus System.Data.dll SybaseClient will
+ be a wrapper around TdsClient.Internal, but provide specific
+ functionality to Sybase.
+
+ <p>SybaseClient build example:
+
+<pre>
+ mcs -target:library -out:Mono.Data.SybaseClient.dll \
+ Mono.Data.SybaseClient\*.cs \
+ ..\Mono.Data.TdsClient\Mono.Data.TdsClient.Internal\*.cs
+ -r corlib.dll -r System.dll -r System.Xml.dll -r System.Data.dll
+</pre>
+
+ <li><p>TdsClient will build its assembly Mono.Data.TdsClient
+ using files from Mono.Data.TdsClient
+ and Mono.Data.TdsClient.Internal. TdsClient will reference the
+ usual suspects plus System.Data.dll TdsClient is a wrapper
+ provider around TdsClient.Internal used for generic
+ unit tests. TdsClient will a wrapper around TdsClient.Internal
+ as a generic TDS provider
+ and allow TDS configuration options not exposed in SqlClient
+ nor SybaseClient, such as, TdsVersion will be exposed in TdsClient
+ but not in SqlClient nor SybaseClient.
+
+ <p>TdsClient build example:
+
+<pre>
+mcs -target:library -out:Mono.Data.TdsClient.dll \
+ Mono.Data.TdsClient\*.cs \
+ Mono.Data.TdsClient.Internal\*.cs \
+ -r corlib.dll -r System.dll -r System.Xml.dll -r System.Data.dll
+</pre>
+ </ol>
+
+* Classes in Mono.Data.TdsClient.Internal will:
+
+ <ul>
+ <li>use the internal keyword to prevent exposing these classes
+ to the System.Data.dll assembly.
+
+ <li> implement the ADO.NET interfaces just like any other ADO.NET provider, such as,
+ IDbConnection, IDbCommand, IDataReader, IDataRecord, IDataAdapter, etc...
+
+ <li> be sealed just like other providers
+
+ <li> provide features to be directly used by the SqlClient and SybaseClient
+ providers, such
+ as, setting the default TDS version: SqlClient to 7.0 and SybaseClient
+ to 5.0 and TdsClient to 4.2.
+
+ <li> be written completely in C# or IL assembly language (if need be).
+
+ <li> implement the TDS protocol version 4.2, 5.0, 7.0, and 8.0. This
+ is where most of the
+ work will take place.
+
+ <li> be an internal ADO.NET provider to the public ADO.NET providers:
+ System.Data.SqlClient, Mono.Data.SybaseClient, and Mono.Data.TdsClient.
+ </ul>
+
+* Implementation Details of the TDS Protocol
+
+ <ul>
+ * will be implemented in pure C# from scratch
+
+ * will reside in Mono.Data.TdsClient.Internal
+
+ * will use FreeTDS and jTDS as rerferences.
+ </ul>
+
+* More Information
+
+ <ul>
+ * <a href="http://www.freetds.org/">FreeTDS</a> is C API that implements
+ the TDS protocol. Has libraries for tds, ctlib, and dblib. It builds
+ and runs on Windows, Linux, and other platforms. FreeTDS provides
+ data access to Microsoft SQL Server and Sybase databases.
+
+ * <a href="http://jtds.sf.net/">jTDS</a> is a 100% Java JDBC provider
+ for Microsoft SQL Server and Sybase databases.
+
+ * <a href="http://www.freetds.org/tds.html">TDS Protocol</a>
+ </ul>
+
+* Contribute
+
+ <p>Anybody willing to help? If so,
+ contact any of the people working on the ADO.NET support
+ in Mono: Rodrigo Moya, Tim Coleman, Daniel Morgan, Brian Ritchie,
+ Vladimir Vukicevic, Ville Palo, Franklin Wise, and others.
+
diff --git a/web/tdsclient b/web/tdsclient
new file mode 100755
index 00000000000..2c58aea698f
--- /dev/null
+++ b/web/tdsclient
@@ -0,0 +1,157 @@
+* TDS Generic Provider
+
+<ul>
+ <li>ADO.NET Provider for older Sybase and Microsoft SQL Server databases</li>
+
+ <li>Exists in namespace Mono.Data.TdsClient and assembly Mono.Data.TdsClient</li>
+
+ <li>Created by Tim Coleman</li>
+
+ <li>Used the <a href="http://www.freetds.org/">FreeTDS</a> and
+ <a href="http://jtds.sourceforge.net/">jTDS</a> projects as resources.</li>
+
+ <li>Implemented in 100% C#</li>
+
+ <li>Is similar to the Mono.Data.SybaseClient and System.Data.SqlClient providers.</li>
+
+ <li>Requires the assembly Mono.Data.Tds.dll which implements the TDS protocol in 100% C#.</li>
+
+ <li>Uses TDS Protocol Version 4.2 by default</li>
+
+ <li>Bugs with Mono or the data provider should be reported
+ in Mono's Bugzilla <a href="http://bugzilla.ximian.com/">here</a>. If you
+ do not have Bugzilla user account, it is free
+ and easy to
+ create one <a href="http://bugzilla.ximian.com/createaccount.cgi">here</a>.</li>
+
+</ul>
+
+** Current Status
+
+
+<ul>
+ <li>Only builds on Windows currently due to mcs does not support modules and mcs
+ has problems with code that is internal.</li>
+
+ <li>Able to connect to Microsoft SQL Server and Sybase databases</li>
+
+ <li>SQL commands can be executed
+ via ExecuteNonQuery() of a TdsCommand.</li>
+
+ <li>SQL aggregates can be executed and a single row and single column
+ result can be retrieved via ExecuteScalar() of a TdsCommand</li>
+
+ <li>SQL queries can be executed via ExecuteReader() and results
+ can be retrieved via TdsDataReader.</li>
+
+ <li>a DataTable with schema info about a result can be gotten via GetSchemaTable()
+ in a TdsDataReader</li>
+
+ <li>Data can be filled in a DataTable in a DataSet via a TdsDataAdapter</li>
+</ul>
+
+** Action plan
+
+<ul>
+ <li>Connection timeouts is being developed now.</li>
+
+ <li>TODO</li>
+</ul>
+
+** Testing
+
+<ul>
+ <li>Have a working mono and mcs installed</li>
+
+ <li>Have access to a Sybase or Microsoft SQL Server database
+ or either download it:
+ <ul>
+ <li><a href="http://www.microsoft.com/sql/default.asp">Microsoft SQL Server</a></li>
+ <li><a href="http://www.sybase.com/downloads">Sybase</a></li>
+ </ul>
+ </li>
+ <li>If using Microsoft SQL Server 2000, make sure
+ you are using at least Service Pack 3 for Microsoft SQL Server 2000</li>
+
+ <li>Located at mcs/class/System.Data/Test is a test for System.Data.SqlClient
+ named SqlTest.cs and you could use this as a basis for your test.</li>
+
+ <li>Has a connection string format:
+<pre>
+ Server=hostname;Database=databaseName;User ID=userid;Password=password
+</pre>
+ </li>
+ <li>The Server part can be used two ways:
+ <ul>
+ <li>hostname - "Server=MYHOST"</li>
+ <li>hostname,port - "Server=MYHOST,1533"</li>
+ </ul>
+ </li>
+
+ <li>C# Example:
+<pre>
+ using System;
+ using System.Data;
+ using Mono.Data.TdsClient;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ "Server=localhost;" +
+ "Database=pubs;" +
+ "User ID=myuserid;" +
+ "Password=mypassword;";
+ IDbConnection dbcon;
+ dbcon = new TdsConnection(connectionString);
+ dbcon.Open();
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ string sql =
+ "SELECT fname, lname " +
+ "FROM employee";
+ dbcmd.CommandText = sql;
+ IDataReader reader = dbcmd.ExecuteReader();
+ while(reader.Read()) {
+ string FirstName = (string) reader["fname"];
+ string LastName = (string) reader["lname"];
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
+</pre>
+ </li>
+ <li>Building C# Example:
+ <ul>
+ <li>Save the example to a file, such as, TestExample.cs</li>
+ <li>Build on Linux:
+<pre>
+ mcs TestExample.cs -r System.Data.dll \
+ -r Mono.Data.TdsClient.dll
+</pre>
+ </li>
+ <li>Build on Windows via Cygwin:
+<pre>
+ mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe \
+ TestExample.cs \
+ -lib:C:/cygwin/home/MyHome/mono/install/lib \
+ -r System.Data.dll -r Mono.Data.TdsClient.dll
+</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Running the Example:
+<pre>
+mono TestExample.exe
+</pre>
+ </li>
+</ul>
+
diff --git a/web/team b/web/team
deleted file mode 100644
index eff7bc9d3d5..00000000000
--- a/web/team
+++ /dev/null
@@ -1,2 +0,0 @@
-* The MonoNet Team
-
diff --git a/web/testing b/web/testing
index f97902ec306..ab60d7fe4d3 100644
--- a/web/testing
+++ b/web/testing
@@ -1,21 +1,168 @@
* Testing
+ Daily <a href="http://www.go-mono.com/tests/index.php">test</a> results.
+
Testing is an important part of the Mono project: every one of its
three major components has a test suite tailored for its needs. This
is very helpful, because in the course of developing the software it
is very common to introduce bugs in existing code. A test suite
helps us fix the bugs as soon as they are introduced.
-** Class Library Tests
+ There are various kinds of tests in Mono:
+ <ul>
+ <li><a href="#unit"><b>Class Library Unit
+ Tests:</b></a> These are used to test the class
+ libraries.
+
+ <li><a href="#compiler"><b>Compiler tests</b></a>: Both
+ tests that should pass and tests that should fail are included.
+
+ <li><a href="#runtime"><b>Runtime tests</b></a>: Tests for
+ the virtual machine.
+
+ <li><a href="#aspnet"><b>ASP.NET tests</b></a>: ASP.NET tests.
+
+ <li><a href="#ws"><b>Web Services tests</b></a>: Web Services
+ client/server tests.
+ </ul>
+
+<a name="unit"></a>
+* Class Library Tests
All classes in Mono libraries should have comprehensive unit test
- suites to go with them. Unit testing is a software engineering
- methodology that makes it easier to build correct code. Every
+ suites to go with them. Unit testing is a software engineering
+ methodology that makes it easier to build correct code. Every
method in every class should have a set of tests to verify
- that they work correctly. Mono also needs a testing framework
+ that they work correctly. Mono also needs a testing framework
to make it easy to write and run lots of tests.
- Try <a href="http://nunit.sourceforge.net">NUnit</a>
+ In some classes, we might also provide standalone tests because of
+ some reasons such as too huge testcases, another downloading and so on.
+ (For example, managed XSLT has standalone test which downloads and
+ expands some megabytes of OASIS test suite.)
+
+ Here I list them up as long as I know. If you are going to add another
+ standalone tests, please add one line here. It is also recommended that
+ you add some notes on how to build and run tests.
+
+ <ul>
+
+ * Mono.Data/test/
+ * System.Data/Test, and some individual ADO.NET libraries:
+ there are some standalone tests. See the bottom of <a href="ado-net.html">
+ ADO.NET page</a> for detail.
+ * System.Web/Test/TestMonoWeb : see README
+ * System.Web.Services/Test/standalone : see README
+ * System.Windows.Forms/SWFTest/
+ * System.XML/Test/System.Xml/standalone_tests : see README
+ * System.XML/Test/System.Xml.Schema/standalone_tests : see README
+ * System.XML/System.Xml.Serialization/standalone_tests/
+ * System.XML/Test/System.Xml.Xsl/standalone_tests : see README
+ * Commons.Xml.Relaxng/Test/standalone_tests : see README
+
+ </ul>
+
+** Getting started
+
+ If you are new to writing NUnit tests, there is a template you may use
+ to help get started. The file is:
+
+ <b>mcs/class/doc/TemplateTest.cs</b>
+
+ Save a copy of this file in the appropriate test subdirecty
+ (see below), and replace all the {text} markers with
+ appropriate code. Comments in the template are there to guide
+ you. You should also look at existing tests to see how other
+ people have written them.
+ mcs/class/corlib/Test/System.Collections/CollectionBaseTest.cs
+ is a small one that might help.
+
+ The directory that will contain your new file depends on the
+ assembly/namespace of the class for which you are creating the
+ tests. Under mcs/class there is a directory for each
+ assembly. In each assembly there is a Test directory,
+ e.g. mcs/class/corlib/Test. In the Test directory there are
+ sub-directories for each namespace in the assembly,
+ e.g. mcs/class/corlib/Test/Sytem. Put your new test file in
+ the appropriate sub-directory under Test for the class you are
+ testing.
+
+ Once all of that is done, you can do a 'make test' from the top mcs
+ directory. Your test class needs also to be listed in the
+ .sources file at the top of the Test directory.
+
+* Tips on writing Unit tests.
+
+ You should look at the <a href="http://nunit.org">NUnit documentation</a>,
+ as it is a fantastic product, and includes fantastic documentation,
+ but here are some tips for those of you who are already reading
+ this web page.
+
+
+** Provide an unique error message for Assert()
+
+ Include an unique message for each Assert() so that when the assert
+ fails, it is trivial to locate it in the source. Otherwise, it may be
+ difficult to determine which part of the test is failing. A good way
+ to ensure unique messages is to use something like #A01, #A02 etc.
+
+ Ok:
+ <pre>
+
+ AssertEquals("array match", compare[0], i1[0]);
+ AssertEquals("array match", compare[1], i1[1]);
+ AssertEquals("array match", compare[2], i1[2]);
+ AssertEquals("array match", compare[3], i1[3]);
+ </pre>
+
+ Excellent:
+ <pre>
+ AssertEquals("#A01", compare[0], i1[0]);
+ AssertEquals("#A02", compare[1], i1[1]);
+ AssertEquals("#A03", compare[2], i1[2]);
+ AssertEquals("#A04", compare[3], i1[3]);
+ </pre>
+
+ Once you used such a number in an Assert(), don't change it later on -
+ people might use it it identify the test in bug reports or in mailing
+ lists.
+
+** Use AssertEquals() to compare things, not Assert().
+
+ Do not compare two values with Assert() - if the test fails,
+ people have no idea what went wrong while AssertEquals()
+ reports the failed value.
+
+ Ok:
+ <pre>
+ Assert ("A01", myTicks[0] == t1.Ticks);
+ </pre>
+
+ Excellent:
+ <pre>
+ AssertEquals ("A01", myTicks[0], t1.Ticks);
+ </pre>
+
+** Test your test with the Microsoft runtime
+
+ If possible, try to run your testsuite with the Microsoft runtime on
+ .NET on Windows and make sure all tests in it pass. This is especially
+ important if you're writing a totally new testcase - without this
+ check you can never be sure that your testcase contains no bugs ....
+
+ Don't worry if you're writing your test on Linux, other people can
+ test it for you on Windows.
+
+ Sometimes you may discover that a test doesn't show the expected
+ result when run with the Microsoft runtime - either because there is a
+ bug in their runtime or something is misleading or wrong in their
+ documentation. In this case, please put a detailed description of the
+ problem to mcs/class/doc/API-notes and do also report it to the
+ <a href="mailing-lists.html">mailing list</a> - we'll forward this to the
+ Microsoft people from time to time to help them fix their documentation
+ and runtime.
+
+** Unit tests.
Why do unit testing? It becomes simple to run automated tests
for the whole library. Unit tests are a safety net - you can
@@ -44,3 +191,83 @@
Normally, after you send a couple of well-written new files
and/or patches to the list, you will be given cvs access.
+<a name="compiler"></a>
+* Compiler tests
+
+ Mono ships with three compilers: C#, VB.NET and JScript. The
+ tests are ran by running the makefile target `make
+ run-test-local' in the appropriate directory.
+
+ The C# compilation tests live in mcs/tests, and the C# error
+ tests live in mcs/errors.
+
+ The VB.NET compilation tests live in mcs/btests.
+
+<a name="runtime"></a>
+* Runtime Tests
+
+ These tests verify the virtual machine, to run these tests, do:
+
+<pre>
+ cd mono/mono/tests
+ make test
+</pre>
+
+<a name="aspnet"></a>
+* ASP.NET tests
+
+ XSP, the Mono ASP.NET server has tests for ASP.NET pages. It uses
+ <a href="http://nunitasp.sourceforge.net">NUnitAsp</a>. Right now
+ it only has standalone tests, ie., tests that do not need their own
+ global.asax or web.config files.
+
+ If you want to run them, get the xsp CVS module and install it. Then:
+<pre>
+ cd xsp/nunit-tests
+ make
+ cd standalone
+ xsp
+</pre>
+
+ And from another terminal:
+<pre>
+ cd xsp/nunit-tests/standalone
+ nunit-console standalone-tests.dll
+</pre>
+
+<a name="ws"></a>
+* Web Services tests
+
+ The Test directory for the System.Web.Services assembly contains a
+ standalone test suite for testing web services. It tests:
+
+ <ul>
+ <li>Proxy generation using the wsdl tool</li>
+ <li>Access to web services using the generated client proxies</li>
+ <li>Execution of web services in the server</li>
+ </ul>
+
+ This suite not only tests web services running on XSP, but it can also test
+ services running on other platforms and that are available in internet. This
+ will help track down interoperability issues.
+
+ To build the test suite, just run:
+
+<pre>
+ cd mcs/class/System.Web.Services/Test/standalone
+ xsp --root server
+</pre>
+
+ And from another terminal:
+<pre>
+ cd mcs/class/System.Web.Services/Test/standalone
+ make
+ nunit-console testclient.dll
+</pre>
+
+ This will download the wsdl documents, generate the proxies, build a dll with
+ the proxies, and build the nunit tests. Then you can use nunit-console or
+ gnunit to run the tests (the nunit dll is testclient.dll).
+
+ Read the README file in mcs/class/System.Web.Services/Test/standalone for
+ more info.
diff --git a/web/todo b/web/todo
index abae8cdfb40..178950afe0d 100644
--- a/web/todo
+++ b/web/todo
@@ -1 +1,53 @@
-Discuss with write new JIT \ No newline at end of file
+** System.Windows.Forms
+
+ Progress on Windows.Forms has been good, but we need more work
+ on this area. Currently redrawing of controls is not
+ funcional.
+
+** Languages work
+
+ Mono has work-in-progress implementations of JScript and the
+ VB.NET languages
+
+ <ul>
+ <li>Write positive tests for those languages.
+
+ <li>Write negative tests for those languages.
+
+ <li>Mono-devel-list is the mailing list to discuss
+ improvements and fixes to those compilers.
+ </ul>
+
+** Debugger
+
+ <ul>
+ <li>The Mono debugger needs some better widgets to
+ provide a useful environment, many of those have been
+ authored for Anjuta/gIDE, we should wrap those for the
+ debugger
+
+ <li>Design a small tool-command-language like Tcl to
+ build the debugger on top of it.
+
+ <li>Design work: a new UI design must be done
+ for the debugger and later implemented.
+ </ul>
+
+** Research topics
+
+ <ul>
+ <li>Design and implement a command processor like the
+ Unix shell, but which uses .NET objects as commands.
+ This shell would be a CLS consumer ideally, and only
+ later a CLS producer. This should make it simple for
+ people to explore the .NET API interactively.
+ </ul>
+
+** IDE development
+
+ Mono lacks an IDE, and we depend on third-parties to work on
+ these.
+
+ <ul>
+ Sharp
+ </ul> \ No newline at end of file
diff --git a/web/tools b/web/tools
index eabef48bb88..84444ed0eee 100644
--- a/web/tools
+++ b/web/tools
@@ -1,67 +1,10 @@
* Tools
- We need a number of tools to make people productive using a
- Mono-based solution. Some of these tools can be developed on
- Windows before Mono is fully finished.
+ The SDK tools have now been built.
- All of these tools should be written using C#.
+ If you are interested in contributing to the IDE effort,
+ please visit the <a href="http://www.monodevelop.com">Mono
+ Develop</a> web site.
- For the tools that are typically command line tools: Try to
- write these as components that could load their input from
- streams or collections of streams, and implement the command
- line tools as wrappers around those classes.
-
- For example, we will be making the C# compiler a component
- that could be reused by applications that might have a use for
- the various bits of the compiler (either to embed the
- compiler, or reuse the code generator part of it).
-
- This is important so that these components (compiler,
- assembler, linker, etc) can be integrated later into the
- visual development environment (hopefully with the help of the
- SharpDevelop hackers).
-
-TODO=ilasm,IL Assembler
-** IL Assembler.
-
- This assembler should basically take as input a file
- containing IL bytecodes as specified in the `Partition II' of
- the ECMA spec, and produce a binary file.
-
-TODO=al,Assembly Linker
-** Assembly Linker.
-
- This tool is used to construct assemblies, which are basically
- deployment units for CLI executables.
-
-TODO=debugger,Debugger
-** Debugger
-
- We will need a debugging API to debug CLI applications and
- then a debugger component that can be used in an IDE
- environment.
-
-TODO=ide,Integrated Development Environment
-** Integrated Development Environment
-
- There is already a project to create a C# development
- environment: <a
- href="http://www.icsharpcode.net/OpenSource/SD/default.asp">SharpDevelop</a>.
- People should work with the SharpDevelop hackers to produce a
- unified development environment.
-
- Please work with the SharpDevelop hackers to build a good IDE.
- We will work on creating an embedable compiler component and
- an embeddable debugger component that can be used withing
- SharpDevelop
-
-TODO=hbrowser,Help Browser
-** Help Browser
-
- We need a good help browser that can be used to browse
- documentation. Ideally this help browser can accept as input
- XML Docbook input and an assorted set of file formats
- (Microsoft Help, Unix manual pages, Unix Info pages)
-
- Look at the GNOME DevHelp for a good set of ideas on how to
- implement this. \ No newline at end of file
+ To help on the documentation effort, use the MonoDoc system to
+ contribute from your own computer.
diff --git a/web/web/.cvsignore b/web/web/.cvsignore
index a023a6f9c7c..7eeb440a427 100644
--- a/web/web/.cvsignore
+++ b/web/web/.cvsignore
@@ -1,2 +1,4 @@
*.src
*.html
+masterinfos
+src
diff --git a/web/web/commands b/web/web/commands
index 75c6bc1a02b..d2a2087d04c 100644
--- a/web/web/commands
+++ b/web/web/commands
@@ -1,43 +1,89 @@
0,Home,index.html,index.src
+1,Roadmap,mono-roadmap.html
1,FAQ,faq.html,faq.src
+1,Screenshots,screenshots.html,screenshots.src
+1,Team,team.html,team.src
+1,Other sites,other.html,other.src
+1,Old News,oldnews.html,oldnews.src
+2,Press Coverage,beta1-press.html,beta1-press.src
+1,Bug Reporting,bugs.html,bugs.src
0,Mono,rationale.html,rationale.src
1,Runtime,runtime.html,runtime.src
+2,Embedding,embedded-api.html,embedded-api.src
1,Classes,class-library.html,class-library.src
-1,Gtk#,http://gtk-sharp.sourceforge.net
-1,Class Status,class-status.html,class-status.src,cm/cormissing.css,cm/cormissing.js
-2,corlib,class-status-corlib.html,class-status-corlib.src,cm/cormissing.css,cm/cormissing.js
-2,System,class-status-System.html,class-status-System.src,cm/cormissing.css,cm/cormissing.js
-2,System.Xml,class-status-System.Xml.html,class-status-System.Xml.src,cm/cormissing.css,cm/cormissing.js
-2,System.Data,class-status-System.Data.html,class-status-System.Data.src,cm/cormissing.css,cm/cormissing.js
-2,System.Drawing,class-status-System.Drawing.html,class-status-System.Drawing.src,cm/cormissing.css,cm/cormissing.js
-2,System.Web,class-status-System.Web.html,class-status-System.Web.src,cm/cormissing.css,cm/cormissing.js
+1,Gtk#,gtk-sharp.html,gtk-sharp.src
+1,ASP.NET,asp-net.html,asp-net.src
+1,ADO.NET,ado-net.html,ado-net.src
1,C# Compiler,c-sharp.html,c-sharp.src
-1,Status,status.html,status.src
+1,VB Compiler,mbas.html,mbas.src
0,Download,download.html,download.src
1,CVS access,ccvs.html,ccvs.src
1,AnonCVS access,anoncvs.html,anoncvs.src
+1,Forge,forge.html,forge.src
+1,Compiling,compiling.html,compiling.src
0,Contributing,contributing.html,contributing.src
+1,Hackers,hackers.html,hackers.src
1,Documentation,documentation.html,documentation.src
1,Class Docs,classlib-doc.html,classlib-doc.src
-1,Doc format,monodoc-xml.html,monodoc-xml.src
1,Test Suite,testing.html,testing.src
+1,Mono TODO,mono-todo.html,mono-todo.src
1,Tools,tools.html,tools.src
1,Porting,porting.html,porting.src
2,PowerPC,ppc.html,ppc.src
1,HOWTO,mono-contribution-howto.html,mono-contribution-howto.src
-0,Plans,plans.html,plans.src
-1,ADO.NET,ado-net.html,ado-net.src
-1,ASP.NET,asp-net.html,asp-net.src
-1,Java,java.html,java.src
-1,Windows.Forms,winforms.html,winforms.src
0,Resources,resources.html,resources.src
1,Mailing Lists,mailing-lists.html,mailing-lists.src
+1,Blogs,http://www.go-mono.com/monologue/
1,Ideas,ideas.html,ideas.src
1,Passport,passport.html,passport.src
1,Books,books.html,books.src
1,Papers,papers.html,papers.src
1,Languages,languages.html,languages.src
1,Debugging,jit-debug.html,jit-debug.src
-2,Example 1,jit-debug-sample.html,jit-debug-sample.src
-2,Example 2,jit-debug-sample2.html,jit-debug-sample2.src
+1,Performance,performance.html,performance.src
+0,Plans,plans.html,plans.src
+1,Drawing,drawing.html,drawing.src
+1,ADO.NET,ado-net.html,ado-net.src
+2,ProviderFactory,provider-factory.html,provider-factory.src
+2,Firebird Interbase,firebird.html,firebird.src
+2,IBM DB2,ibmdb2.html,ibmdb2.src
+2,Microsft SQL Server,sqlclient.html,sqlclient.src
+2,MySQL,mysql.html,mysql.src
+2,ODBC,odbc.html,odbc.src
+2,OLE DB,oledb.html,oledb.src
+2,Oracle,oracle.html,oracle.src
+2,PostgreSQL,postgresql.html,postgresql.src
+2,SQL Lite,sqlite.html,sqlite.src
+2,Sybase,sybase.html,sybase.src
+2,TDS Generic,tdsclient.html,tdsclient.src
+2,TDS Providers,tds-providers.html,tds-providers.src
+1,Remap,remap.html,remap.src
+1,Known Issues,issues.html,issues.src
+1,Crypto,crypto.html,crypto.src
+1,Java,java.html,java.src
+1,Delegates,delegate.html,delegate.src
+1,Windows.Forms,winforms.html,winforms.src
+1,XML Classes,xml-classes.html,xml-classes.src
+0,Class Status,class-status.html,class-status.src,cm/cormissing.css,cm/cormissing.js
+1,corlib,class-status-corlib.html,class-status-corlib.src,cm/cormissing.css,cm/cormissing.js
+1,System,class-status-System.html,class-status-System.src,cm/cormissing.css,cm/cormissing.js
+1,Xml,class-status-System.Xml.html,class-status-System.Xml.src,cm/cormissing.css,cm/cormissing.js
+1,Configuration.Install,class-status-System.Configuration.Install.html,class-status-System.Configuration.Install.src,cm/cormissing.css,cm/cormissing.js
+1,Data,class-status-System.Data.html,class-status-System.Data.src,cm/cormissing.css,cm/cormissing.js
+1,Data.OracleClient,class-status-System.Data.OracleClient.html,class-status-System.Data.OracleClient.src,cm/cormissing.css,cm/cormissing.js
+1,Design,class-status-System.Design.html,class-status-System.Design.src,cm/cormissing.css,cm/cormissing.js
+1,Drawing,class-status-System.Drawing.html,class-status-System.Drawing.src,cm/cormissing.css,cm/cormissing.js
+1,Drawing.Design,class-status-System.Drawing.Design.html,class-status-System.Drawing.Design.src,cm/cormissing.css,cm/cormissing.js
+1,Management,class-status-System.Management.html,class-status-System.Management.src,cm/cormissing.css,cm/cormissing.js
+1,Messaging,class-status-System.Messaging.html,class-status-System.Messaging.src,cm/cormissing.css,cm/cormissing.js
+1,Web,class-status-System.Web.html,class-status-System.Web.src,cm/cormissing.css,cm/cormissing.js
+1,Web.Services,class-status-System.Web.Services.html,class-status-System.Web.Services.src,cm/cormissing.css,cm/cormissing.js
+1,Microsoft.VisualBasic,class-status-Microsoft.VisualBasic.html,class-status-Microsoft.VisualBasic.src,cm/cormissing.css,cm/cormissing.js
+1,Windows.Forms,class-status-System.Windows.Forms.html,class-status-System.Windows.Forms.src,cm/cormissing.css,cm/cormissing.js
+1,DirectoryServices,class-status-System.DirectoryServices.html,class-status-System.DirectoryServices.src,cm/cormissing.css,cm/cormissing.js
+1,EnterpriseSvcs,class-status-System.EnterpriseServices.html,class-status-System.EnterpriseServices.src,cm/cormissing.css,cm/cormissing.js
+1,Remoting,class-status-System.Runtime.Remoting.html,class-status-System.Runtime.Remoting.src,cm/cormissing.css,cm/cormissing.js
+1,Formatters.Soap,class-status-System.Runtime.Serialization.Formatters.Soap.html,class-status-System.Runtime.Serialization.Formatters.Soap.src,cm/cormissing.css,cm/cormissing.js
+1,cscompmgd,class-status-cscompmgd.html,class-status-cscompmgd.src,cm/cormissing.css,cm/cormissing.js
+1,System.Security,class-status-System.Security.html,class-status-System.Security.src,cm/cormissing.css,cm/cormissing.js
0,Contact,contact.html,contact.src
diff --git a/web/web/deploy/.cvsignore b/web/web/deploy/.cvsignore
index 2d19fc766d9..b47a07bc167 100755
--- a/web/web/deploy/.cvsignore
+++ b/web/web/deploy/.cvsignore
@@ -1 +1,3 @@
*.html
+index.rss
+team
diff --git a/web/web/deploy/cm/cormissing.js b/web/web/deploy/cm/cormissing.js
index e6b12ac4fd2..2f2e74dcb85 100644
--- a/web/web/deploy/cm/cormissing.js
+++ b/web/web/deploy/cm/cormissing.js
@@ -212,10 +212,13 @@ function clickHandler (evt)
if (evt.ctrlKey)
{
var strRoot = 'http://cvs.hispalinux.es/cgi-bin/cvsweb/mcs/class/';
- var strExtra = '?cvsroot=Mono';
+ var strExtra = '?cvsroot=mono';
if (strAssembly)
{
+ if (strAssembly == 'mscorlib')
+ strAssembly = 'corlib';
+
strRoot = strRoot + strAssembly + '/';
if (strNamespace)
{
diff --git a/web/web/htmlify b/web/web/htmlify
index e4e61961f3b..f0473ba56c1 100644
--- a/web/web/htmlify
+++ b/web/web/htmlify
@@ -6,7 +6,7 @@ while (<>){
if (/^\* (.*)$/){
print "<h1>$1</h1>\n";
} elsif (/^\*\* (.*)$/) {
- print "<h2>$1</h2>\n";
+ print "<h3>$1</h3>\n";
} elsif (/^\*\*\* (.*)$/) {
print "<h3>$1</h3>\n";
} elsif (/^\*\*\*\* (.*)$/) {
@@ -19,7 +19,11 @@ while (<>){
$name = $link = $1;
$link =~ s/ //g;
print "<a name=\"$link\">\n";
- print "<h2>$name</h2>\n";
+ if (/Beta 1/){
+ print "<h2>$name</h2>\n";
+ } else {
+ print "<h3>$name</h3>\n";
+ }
} elsif (/^Q: (.*)$/){
print "<p><a name=\"q$q\"></a><b>Question $q:</b> $1\n";
$q++;
diff --git a/web/web/images/gtk-certview.png b/web/web/images/gtk-certview.png
new file mode 100644
index 00000000000..d26d03ae2d3
--- /dev/null
+++ b/web/web/images/gtk-certview.png
Binary files differ
diff --git a/web/web/images/mono-new.gif b/web/web/images/mono-new.gif
new file mode 100755
index 00000000000..9aa496940a8
--- /dev/null
+++ b/web/web/images/mono-new.gif
Binary files differ
diff --git a/web/web/images/swf-certview.png b/web/web/images/swf-certview.png
new file mode 100644
index 00000000000..0c4200458ac
--- /dev/null
+++ b/web/web/images/swf-certview.png
Binary files differ
diff --git a/web/web/infos/.cvsignore b/web/web/infos/.cvsignore
new file mode 100644
index 00000000000..6722cd96e78
--- /dev/null
+++ b/web/web/infos/.cvsignore
@@ -0,0 +1 @@
+*.xml
diff --git a/web/web/makefile b/web/web/makefile
index 41e55a59bf7..e44938a61ed 100644
--- a/web/web/makefile
+++ b/web/web/makefile
@@ -1,76 +1,156 @@
-CSCRIPT = $(SYSTEMROOT)/system32/cscript.exe
-CSC=csc
+ifeq ($(findstring CYGWIN,$(shell uname)),)
+CSC=mcs
+RUN_MONO=mono --debug
+else
+CSC=csc /nologo
+endif
+
CORCOMPARE=../../../mcs/tools/corcompare
-OBJECTS= \
- deploy/ado-net.html \
- deploy/anoncvs.html \
- deploy/asp-net.html \
- deploy/books.html \
- deploy/contributing.html \
- deploy/class-status.html \
- deploy/class-status-corlib.html \
- deploy/class-status-System.html \
- deploy/class-status-System.Xml.html \
- deploy/class-status-System.Drawing.html \
- deploy/class-status-System.Data.html \
- deploy/class-status-System.Web.html \
- deploy/class-library.html \
- deploy/classlib-doc.html \
- deploy/contact.html \
- deploy/c-sharp.html \
- deploy/ccvs.html \
- deploy/documentation.html \
- deploy/download.html \
- deploy/faq.html \
- deploy/gcc-frontend.html \
- deploy/index.html \
- deploy/ideas.html \
- deploy/java.html \
- deploy/jit-debug.html \
- deploy/jit-debug-sample.html \
- deploy/jit-debug-sample2.html \
- deploy/languages.html \
- deploy/mailing-lists.html \
- deploy/mono-contribution-howto.html \
- deploy/monodoc-xml.html \
- deploy/papers.html \
- deploy/passport.html \
- deploy/plans.html \
- deploy/porting.html \
- deploy/ppc.html \
- deploy/rationale.html \
- deploy/resources.html \
- deploy/roadmap.html \
- deploy/runtime.html \
- deploy/status.html \
- deploy/testing.html \
- deploy/tools.html \
- deploy/winforms.html
-
-# deploy/class-status-System.html \
-
-NON_HTML_SOURCES= \
+OBJECTS= \
+ deploy/ado-net.html \
+ deploy/anoncvs.html \
+ deploy/asp-net.html \
+ deploy/beta1-press.html \
+ deploy/blogs.html \
+ deploy/books.html \
+ deploy/bugs.html \
+ deploy/contributing.html \
+ deploy/contact.html \
+ deploy/c-sharp.html \
+ deploy/ccvs.html \
+ deploy/delegate.html \
+ deploy/documentation.html \
+ deploy/download.html \
+ deploy/drawing.html \
+ deploy/compiling.html \
+ deploy/crypto.html \
+ deploy/embedded-api.html \
+ deploy/faq.html \
+ deploy/firebird.html \
+ deploy/forge.html \
+ deploy/gcc-frontend.html \
+ deploy/gtk-sharp.html \
+ deploy/hackers.html \
+ deploy/ideas.html \
+ deploy/ibmdb2.html \
+ deploy/index.html \
+ deploy/issues.html \
+ deploy/oldnews.html \
+ deploy/java.html \
+ deploy/jit-debug.html \
+ deploy/languages.html \
+ deploy/mailing-lists.html \
+ deploy/mbas.html \
+ deploy/mono-beginning.html \
+ deploy/mono-contribution-howto.html \
+ deploy/mono-todo.html \
+ deploy/monodoc-xml.html \
+ deploy/mysql.html \
+ deploy/odbc.html \
+ deploy/oledb.html \
+ deploy/oracle.html \
+ deploy/other.html \
+ deploy/papers.html \
+ deploy/passport.html \
+ deploy/performance.html \
+ deploy/plans.html \
+ deploy/porting.html \
+ deploy/postgresql.html \
+ deploy/ppc.html \
+ deploy/provider-factory.html \
+ deploy/rationale.html \
+ deploy/resources.html \
+ deploy/runtime.html \
+ deploy/screenshots.html \
+ deploy/sqlclient.html \
+ deploy/sqlite.html \
+ deploy/status.html \
+ deploy/sybase.html \
+ deploy/tdsclient.html \
+ deploy/team.html \
+ deploy/testing.html \
+ deploy/tools.html \
+ deploy/remap.html \
+ deploy/winforms.html \
+ deploy/xml-classes.html \
+ deploy/class-library.html \
+ deploy/classlib-doc.html \
+ deploy/class-status.html \
+ deploy/class-status-corlib.html \
+ deploy/class-status-System.html \
+ deploy/class-status-System.Xml.html \
+ deploy/class-status-System.Configuration.Install.html \
+ deploy/class-status-System.Data.html \
+ deploy/class-status-System.Data.OracleClient.html \
+ deploy/class-status-System.Design.html \
+ deploy/class-status-System.Management.html \
+ deploy/class-status-System.Messaging.html \
+ deploy/class-status-System.Security.html \
+ deploy/class-status-System.Web.html \
+ deploy/class-status-System.Web.Services.html \
+ deploy/class-status-System.Drawing.html \
+ deploy/class-status-System.Drawing.Design.html \
+ deploy/class-status-Microsoft.VisualBasic.html \
+ deploy/class-status-System.Windows.Forms.html \
+ deploy/class-status-System.DirectoryServices.html \
+ deploy/class-status-System.EnterpriseServices.html \
+ deploy/class-status-System.Runtime.Remoting.html \
+ deploy/class-status-cscompmgd.html \
+ deploy/class-status-System.Runtime.Serialization.Formatters.Soap.html
+
+HTML_SOURCES = ../mono-roadmap.html
+
+#2,Configuration.Install,class-status-System.Configuration.Install.html,class-status-System.Configuration.Install.src,cm/cormissing.css,cm/cormissing.js
+#2,Runtime.Remoting,class-status-System.Runtime.Remoting.html,class-status-System.Runtime.Remoting.src,cm/cormissing.css,cm/cormissing.js
+
+# deploy/class-status-System.Configuration.Install.html \
+# deploy/class-status-System.Runtime.Remoting.html \
+
+NON_HTML_SOURCES= \
../mono-build.sh \
../mono-build-w32.sh
-
-all: $(OBJECTS) deploy/index.rss
+all: $(OBJECTS) deploy/index.rss ../team
perl process.pl commands template.html.in deploy
+ cp $(HTML_SOURCES) deploy
+ test -d deploy/team || mkdir deploy/team
+ cp team/*png deploy/team
+
+tutorial: mono-beginning.html.stamp mono-beginning.pdf
+ cp -a mono-beginning mono-beginning.xml mono-beginning.pdf deploy
+
+mono-beginning.html.stamp: mono-beginning.xml
+ db2html mono-beginning.xml
+ touch mono-beginning.html.stamp
+
+mono-beginning.pdf: mono-beginning.xml
+ db2pdf mono-beginning.xml
+
+mono-beginning.xml: ../mono-beginning.xml
+ cp ../mono-beginning.xml .
deploy/index.rss: mono-rss.exe ../index
- ./mono-rss.exe ../index deploy/index.rss
+ $(RUN_MONO) ./mono-rss.exe ../index deploy/index.rss
mono-rss.exe: mono-rss.cs rss.cs
$(CSC) mono-rss.cs rss.cs
+../team: render-team-page.exe team.xml
+ $(RUN_MONO) ./render-team-page.exe team.xml "../team"
+
+render-team-page.exe: render-team-page.cs
+ $(CSC) render-team-page.cs
+
clean:
- rm -f $(OBJECTS) $(patsubst deploy/%.html,src/%.src, $(OBJECTS)) src/*.xml src/*.html.in ../class-status-* ../class-status
+ rm -f $(OBJECTS) $(patsubst deploy/%.html,src/%.src, $(OBJECTS)) src/*.xml src/*.html.in ../class-status-* ../class-status infos/*.xml
push:
cp -f $(NON_HTML_SOURCES) deploy
- echo scp -P 2200 -r deploy/* www@www.ximian.com:/web/cvsmodules/mono
- (cd deploy; rsync --verbose --recursive --checksum --update --rsh='ssh -p 2200' . www@www.ximian.com:/web/cvsmodules/mono )
+ cp ../mono-roadmap.html deploy
+ #echo scp -P 2200 -r deploy/* www@www.go-mono.com:/web/cvsmodules/mono
+ (cd deploy; rsync --verbose --recursive --checksum --update --rsh='ssh' . mono-web@www.go-mono.com:go-mono)
+
push2:
scp -r deploy/* primates:public_html/xxx
@@ -79,32 +159,58 @@ $(OBJECTS): $(patsubst deploy/%.html,src/%.src, $(OBJECTS))
#.PRECIOUS: $(patsubst deploy/%.html,src/%.src, $(OBJECTS))
+transform.exe: transform.cs
+ $(CSC) transform.cs
.PRECIOUS: src/%.src
-src/%.src: ../% commands makefile template.html.in
+src/%.src: ../% commands template.html.in makefile
perl htmlify $< > $@
-
-
.PRECIOUS: ../class-status-%
../class-status-%: src/%.html.in ../class-status.in
cat ../class-status.in $< > $@
.PRECIOUS: src/%.html.in
-src/%.html.in: src/%.xml $(CORCOMPARE)/transform.js $(CORCOMPARE)/cormissing.xsl
- $(CSCRIPT) /nologo $(CORCOMPARE)/transform.js $< $(CORCOMPARE)/cormissing.xsl > $@
+src/%.html.in: src/%.xml transform.exe $(CORCOMPARE)/mono-api.xsl
+ $(RUN_MONO) ./transform.exe $< $(CORCOMPARE)/mono-api.xsl > $@ || (rm -f $@ && exit 1)
+.PRECIOUS: infos/%.xml
+infos/%.xml: ../../../mcs/class/lib/default/%.dll $(CORCOMPARE)/mono-api-info.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-info.exe $< > $@ || (rm -f $@ && exit 1)
.PRECIOUS: src/%.xml
-src/%.xml: ../../../mcs/class/lib/%.dll $(CORCOMPARE)/CorCompare.exe
- $(CORCOMPARE)/CorCompare.exe -x $@ $<
+src/%.xml: infos/%.xml $(CORCOMPARE)/mono-api-diff.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-diff.exe masterinfos/$(notdir $<) $< > $@ || (rm -f $@ && exit 1)
+
+# corlib, corlib...
+infos/mscorlib.xml: ../../../mcs/class/lib/default/mscorlib.dll $(CORCOMPARE)/mono-api-info.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-info.exe $(notdir $(basename $<)) > $@ || (rm -f $@ && exit 1)
+
+src/corlib.xml: infos/mscorlib.xml $(CORCOMPARE)/mono-api-diff.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-diff.exe masterinfos/mscorlib.xml $< > $@ || (rm -f $@ && exit 1)
-src/corlib.xml: ../../../mcs/class/lib/corlib_cmp.dll $(CORCOMPARE)/CorCompare.exe
- $(CORCOMPARE)/CorCompare.exe -f corlib -ms mscorlib -x $@ $<
+# System
+infos/System.xml: ../../../mcs/class/lib/default/System.dll $(CORCOMPARE)/mono-api-info.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-info.exe $(notdir $(basename $<)) > $@ || (rm -f $@ && exit 1)
+src/System.xml: infos/System.xml $(CORCOMPARE)/mono-api-diff.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-diff.exe masterinfos/System.xml $< > $@ || (rm -f $@ && exit 1)
+
+# System.Xml
+infos/System.Xml.xml: ../../../mcs/class/lib/default/System.Xml.dll $(CORCOMPARE)/mono-api-info.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-info.exe $(notdir $(basename $<)) > $@ || (rm -f $@ && exit 1)
+
+src/System.Xml.xml: infos/System.Xml.xml $(CORCOMPARE)/mono-api-diff.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-diff.exe masterinfos/System.Xml.xml $< > $@ || (rm -f $@ && exit 1)
+
+src/System.DirectoryServices.xml: infos/System.DirectoryServices.xml $(CORCOMPARE)/mono-api-diff.exe
+ $(RUN_MONO) $(CORCOMPARE)/mono-api-diff.exe masterinfos/System.DirectoryServices.xml $< > $@ || (rm -f $@ && exit 1)
../class-status: ../class-status.in
cp -f $< $@
+
+make-rss:
+ $(CSC) make-rss.cs -o
diff --git a/web/web/masterinfos/.cvsignore b/web/web/masterinfos/.cvsignore
new file mode 100644
index 00000000000..6722cd96e78
--- /dev/null
+++ b/web/web/masterinfos/.cvsignore
@@ -0,0 +1 @@
+*.xml
diff --git a/web/web/masterinfos/Makefile b/web/web/masterinfos/Makefile
new file mode 100644
index 00000000000..73f0b96341b
--- /dev/null
+++ b/web/web/masterinfos/Makefile
@@ -0,0 +1,96 @@
+# Note that you will need Microsoft.NET to generate those masterinfos
+
+# Customize to indicate your own installation dir.
+DLL_PATH=c:/WINDOWS/Microsoft.NET/Framework/v1.1.4322
+# DLL_PATH=c:/WINDOWS/Microsoft.NET/Framework/v1.2.30703
+
+all: \
+ mscorlib.xml \
+ System.xml \
+ System.Xml.xml \
+ System.Configuration.Install.xml \
+ System.Data.xml \
+ System.Data.OracleClient.xml \
+ System.Design.xml \
+ System.Management.xml \
+ System.Messaging.xml \
+ System.Web.xml \
+ System.Web.Services.xml \
+ System.Runtime.Serialization.Formatters.Soap.xml \
+ System.Drawing.xml \
+ System.Drawing.Design.xml \
+ System.Security.xml \
+ System.DirectoryServices.xml \
+ System.EnterpriseServices.xml \
+ System.Runtime.Remoting.xml \
+ System.Windows.Forms.xml \
+ Microsoft.VisualBasic.xml \
+ Cscompmgd.xml
+
+mscorlib.xml :
+ mono-api-info $(DLL_PATH)/mscorlib.dll > mscorlib.xml
+
+System.xml :
+ mono-api-info $(DLL_PATH)/System.dll > System.xml
+
+System.Xml.xml :
+ mono-api-info $(DLL_PATH)/System.Xml.dll > System.Xml.xml
+
+System.Configuration.Install.xml :
+ mono-api-info $(DLL_PATH)/System.Configuration.Install.dll > System.Configuration.Install.xml
+
+System.Data.xml :
+ mono-api-info $(DLL_PATH)/System.Data.dll > System.Data.xml
+
+System.Data.OracleClient.xml :
+ mono-api-info $(DLL_PATH)/System.Data.OracleClient.dll > System.Data.OracleClient.xml
+
+System.Design.xml :
+ mono-api-info $(DLL_PATH)/System.Design.dll > System.Design.xml
+
+System.Management.xml :
+ mono-api-info $(DLL_PATH)/System.Management.dll > System.Management.xml
+
+System.Messaging.xml :
+ mono-api-info $(DLL_PATH)/System.Messaging.dll > System.Messaging.xml
+
+System.Web.xml :
+ mono-api-info $(DLL_PATH)/System.Web.dll > System.Web.xml
+
+System.Web.Services.xml :
+ mono-api-info $(DLL_PATH)/System.Web.Services.dll > System.Web.Services.xml
+
+System.Runtime.Remoting.xml :
+ mono-api-info $(DLL_PATH)/System.Runtime.Remoting.dll > System.Runtime.Remoting.xml
+
+System.Runtime.Serialization.Formatters.Soap.xml :
+ mono-api-info $(DLL_PATH)/System.Runtime.Serialization.Formatters.Soap.dll > System.Runtime.Serialization.Formatters.Soap.xml
+
+System.Drawing.xml :
+ mono-api-info $(DLL_PATH)/System.Drawing.dll > System.Drawing.xml
+
+System.Drawing.Design.xml :
+ mono-api-info $(DLL_PATH)/System.Drawing.Design.dll > System.Drawing.Design.xml
+
+System.Security.xml :
+ mono-api-info $(DLL_PATH)/System.Security.dll > System.Security.xml
+
+System.DirectoryServices.xml :
+ mono-api-info $(DLL_PATH)/System.DirectoryServices.dll > System.DirectoryServices.xml
+
+System.EnterpriseServices.xml :
+ mono-api-info $(DLL_PATH)/System.EnterpriseServices.dll > System.EnterpriseServices.xml
+
+System.Windows.Forms.xml :
+ mono-api-info $(DLL_PATH)/System.Windows.Forms.dll > System.Windows.Forms.xml
+
+Cscompmgd.xml :
+ mono-api-info $(DLL_PATH)/Cscompmgd.dll > Cscompmgd.xml
+
+Microsoft.VisualBasic.xml :
+ mono-api-info $(DLL_PATH)/Microsoft.VisualBasic.dll > Microsoft.VisualBasic.xml
+
+clean:
+ rm mscorlib.xml System.xml System.Xml.xml System.Configuration.Install.xml System.Data.xml System.Data.OracleClient.xml System.Design.xml System.Drawing.Design.xml System.Management.xml System.Messaging.xml System.Web.xml System.Web.Services.xml System.Runtime.Serialization.Formatters.Soap.xml System.Drawing.xml System.Security.xml System.DirectoryServices.xml System.EnterpriseServices.xml System.Runtime.Remoting.xml System.Windows.Forms.xml Cscompmgd.xml Microsoft.VisualBasic.xml
+
+
diff --git a/web/web/mono-rss.cs b/web/web/mono-rss.cs
index a4fdd49c365..ab39f6e91c5 100755
--- a/web/web/mono-rss.cs
+++ b/web/web/mono-rss.cs
@@ -6,18 +6,50 @@
using System;
using System.IO;
using System.Xml;
+using System.Text;
using RSS;
class X {
static RSS.RSS rss;
static Channel c;
static int item_count;
+ static int line;
+ static int GetMonth (string s)
+ {
+ switch (s){
+ case "Jan": return 1;
+ case "Feb": return 2;
+ case "Mar": return 3;
+ case "Apr": return 4;
+ case "May": return 5;
+ case "Jun": return 6;
+ case "Jul": return 7;
+ case "Aug": return 8;
+ case "Sep": return 9;
+ case "Oct": return 10;
+ case "Nov": return 11;
+ case "Dec": return 12;
+ }
+ throw new Exception ("Can not parse month name: " + s);
+ }
+
+ static int GetDay (string s)
+ {
+ int d = s [0] - '0';
+
+ if (Char.IsDigit (s [1])){
+ d = d * 10 + (s [1] - '0');
+ }
+ return d;
+ }
+
static void PopulateRSS (StreamReader input)
{
string s;
while ((s = input.ReadLine ()) != null){
+ line++;
if (s.StartsWith ("@item "))
break;
}
@@ -49,9 +81,12 @@ class X {
i = c.NewItem ();
i.Title = title;
i.Link = link;
+ DateTime dt = new DateTime (2004, GetMonth (s.Substring (6, 3)), GetDay (s.Substring (10, 2)));
+ i.PubDate = dt.ToString ("R");
} else {
description += "\n" + (s == "\n" ? "<p>" : s);
}
+ line++;
} while ((s = input.ReadLine ()) != null);
if (i != null){
@@ -76,7 +111,12 @@ class X {
using (FileStream fs = new FileStream (input, FileMode.Open)){
using (StreamReader input_stream = new StreamReader (fs)){
- PopulateRSS (input_stream);
+ try {
+ PopulateRSS (input_stream);
+ } catch {
+ Console.WriteLine ("{0} failure while loading: {1}", line, input);
+ throw;
+ }
}
}
diff --git a/web/web/process.pl b/web/web/process.pl
index 9739f9b4384..48766f8f0b8 100755
--- a/web/web/process.pl
+++ b/web/web/process.pl
@@ -26,7 +26,7 @@ while (<COMMANDS>) {
$menu .= "<tr><td valign=\"top\" class=\"navi" . $command[0];
$menu .= "\"><a class=\"navi" . $command[0];
$menu .= "\"";
- $menu .= "HREF=\"$command[2]\">$command[1]</A></td></tr>\n\n";
+ $menu .= " HREF=\"$command[2]\">$command[1]</A></td></tr>\n\n";
}
}
close COMMANDS;
diff --git a/web/web/render-team-page.cs b/web/web/render-team-page.cs
new file mode 100644
index 00000000000..39ad660855e
--- /dev/null
+++ b/web/web/render-team-page.cs
@@ -0,0 +1,352 @@
+//
+// RenderTeamPage.cs - Renders an HTML page with team member information from an XML file
+//
+// Author: Duncan Mak (duncan@ximian.com)
+//
+// (C) Copyright 2003, Ximian Inc.
+//
+
+using System;
+using System.Collections;
+using System.IO;
+using System.Text;
+using System.Xml;
+
+class Write {
+
+ static Contributor [] list;
+ static public XmlNamespaceManager nsmgr;
+
+ static void Main (string [] args)
+ {
+ if (args.Length != 2) {
+ Console.WriteLine ("write.exe <input.xml> <output.html>");
+ Environment.Exit (0);
+ }
+
+ string input = args [0];
+ string output = args [1];
+ XmlDocument document = new XmlDocument ();
+ document.Load (input);
+
+ nsmgr = new XmlNamespaceManager (document.NameTable);
+ nsmgr.AddNamespace ("t", "http://go-mono.org/team.xsd");
+ XmlNodeList contributors = document.SelectNodes ("/t:contributors/t:contributor", nsmgr);
+ list = new Contributor [contributors.Count];
+
+ Page p = new Page ();
+
+ int count = 0;
+ foreach (XmlNode n in contributors) {
+ list [count] = new Contributor (n, p.Document);
+ count ++;
+ }
+
+ Array.Sort (list, new ContributorComparer ());
+
+ int length = list.Length % 2 == 0 ? list.Length : list.Length + 1;
+
+ int i = 0;
+ while (i < length) {
+ try {
+ p.AddRow (list [i].RenderHtml (), list [i + 1].RenderHtml ());
+ } catch (IndexOutOfRangeException) {
+ p.AddRow (list [i].RenderHtml (), null);
+ }
+ i += 2;
+ }
+
+ p.Write (output);
+ }
+}
+
+public class ContributorComparer : IComparer
+{
+ public int Compare (object x, object y)
+ {
+ return String.Compare (x.ToString (), y.ToString ());
+ }
+}
+
+class Contributor {
+
+ public Name name;
+ public string email;
+ public string image;
+ public string location;
+ public string organization;
+ public string description;
+ public string[] tasks;
+
+ public XmlDocument document;
+
+ public Contributor (XmlNode node, XmlDocument document)
+ {
+
+ name = GetName (node);
+ image = GetImage (node);
+ email = GetField (node, "t:e-mail");
+ location = GetField (node, "t:location");
+ organization = GetField (node, "t:organization");
+ description = GetField (node, "t:description");
+ tasks = GetTasks (node);
+
+ this.document = document;
+ }
+
+ public override string ToString ()
+ {
+ return name.ToString ();
+ }
+
+ public static string GetImage (XmlNode node)
+ {
+ string result = GetField (node, "t:image");
+
+ if (result == String.Empty)
+ return "none.png";
+
+ else
+ return result;
+ }
+
+ public static string GetField (XmlNode node, string selector)
+ {
+ XmlNode result = node.SelectSingleNode (selector, Write.nsmgr);
+
+ if (result == null)
+ return String.Empty;
+
+ return result.InnerText;
+ }
+
+ public static Name GetName (XmlNode node)
+ {
+ string first_name = GetField (node, "t:name/t:first-name");
+ string last_name = GetField (node, "t:name/t:last-name");
+
+ return new Name (first_name, last_name);
+ }
+
+ public static string [] GetTasks (XmlNode node)
+ {
+ XmlNodeList nodes = node.SelectNodes ("t:tasks/t:task", Write.nsmgr);
+
+ string [] result = new string [nodes.Count];
+
+ int i = 0;
+ foreach (XmlNode n in nodes) {
+ result [i] = n.InnerText;
+
+ i++;
+ }
+
+ return result;
+ }
+
+ public XmlElement RenderHtml ()
+ {
+ XmlElement root = document.CreateElement ("td");
+ XmlElement table = document.CreateElement ("table");
+ table.SetAttribute ("cellPadding", "0");
+ table.SetAttribute ("border", "0");
+ XmlElement tr = document.CreateElement ("tr");
+ XmlElement td = document.CreateElement ("td");
+ td.SetAttribute ("bgcolor", "#c3cda7");
+ td.SetAttribute ("valign", "top");
+ td.SetAttribute ("width", "1%");
+ tr.AppendChild (td);
+ table.AppendChild (tr);
+ root.AppendChild (table);
+
+ XmlElement img = document.CreateElement ("img");
+ img.SetAttribute ("align", "top");
+ img.SetAttribute ("border", "0");
+ img.SetAttribute ("height", "48");
+ img.SetAttribute ("width", "48");
+ img.SetAttribute ("src", "team/" + image);
+ td.AppendChild (img);
+
+ td = document.CreateElement ("TD");
+ td.SetAttribute ("bgcolor", "#c3cda7");
+ td.SetAttribute ("valign", "bottom");
+ td.SetAttribute ("width", "100%");
+ tr.AppendChild (td);
+
+ td.AppendChild (name.ToXml (document));
+ td.AppendChild (document.CreateElement ("br"));
+ td.AppendChild (RenderEmail ());
+
+ tr = document.CreateElement ("tr");
+ table.AppendChild (tr);
+ td = document.CreateElement ("td");
+ td.SetAttribute ("bgcolor", "#f5f8e4");
+ td.SetAttribute ("valign", "top");
+ tr.AppendChild (td);
+ td.AppendChild (RenderLabel ("Location: "));
+
+ td = document.CreateElement ("td");
+ td.SetAttribute ("bgcolor", "#f5f8e4");
+ td.SetAttribute ("valign", "top");
+ tr.AppendChild (td);
+ td.AppendChild (document.CreateTextNode (location));
+
+ tr = document.CreateElement ("tr");
+ table.AppendChild (tr);
+ td = document.CreateElement ("td");
+ td.SetAttribute ("bgcolor", "#f5f8e4");
+ td.SetAttribute ("valign", "top");
+ tr.AppendChild (td);
+ td.AppendChild (RenderLabel ("Description: "));
+
+ td = document.CreateElement ("td");
+ td.SetAttribute ("bgcolor", "#f5f8e4");
+ td.SetAttribute ("valign", "top");
+ tr.AppendChild (td);
+ td.AppendChild (document.CreateTextNode (description));
+
+ tr = document.CreateElement ("tr");
+ table.AppendChild (tr);
+ td = document.CreateElement ("td");
+ td.SetAttribute ("bgcolor", "#f5f8e4");
+ td.SetAttribute ("valign", "top");
+ tr.AppendChild (td);
+ td.AppendChild (RenderLabel ("Tasks: "));
+
+ td = document.CreateElement ("td");
+ td.SetAttribute ("bgcolor", "#f5f8e4");
+ td.SetAttribute ("valign", "top");
+ tr.AppendChild (td);
+ td.AppendChild (RenderTasks ());
+
+ return root;
+ }
+
+ public XmlNode RenderTasks ()
+ {
+
+ XmlElement element = document.CreateElement ("ol");
+ element.SetAttribute ("type", "I");
+
+ foreach (string task in tasks) {
+ XmlElement li = document.CreateElement ("li");
+ li.AppendChild (document.CreateTextNode (task));
+ element.AppendChild (li);
+ }
+
+ return element;
+ }
+
+ public XmlNode RenderEmail ()
+ {
+ XmlElement a = document.CreateElement ("a");
+ a.SetAttribute ("href", "mailto:" + email);
+ XmlElement font = document.CreateElement ("font");
+ font.SetAttribute ("size", "3");
+ XmlText t = document.CreateTextNode (email);
+ a.AppendChild (font);
+ font.AppendChild (t);
+
+ return a;
+ }
+
+ public XmlNode RenderLabel (string label)
+ {
+ string text = String.Format ("{0}: ", label);
+ XmlElement element = document.CreateElement ("b");
+ XmlText t = document.CreateTextNode (label );
+ element.AppendChild (t);
+
+ return element;
+ }
+}
+
+class Page {
+
+ XmlDocument document;
+ XmlElement tbody;
+
+ public Page ()
+ {
+ document = new XmlDocument ();
+
+ XmlElement table = document.CreateElement ("table");
+ document.AppendChild (table);
+
+ tbody = document.CreateElement ("tbody");
+ table.AppendChild (tbody);
+ }
+
+ public XmlDocument Document {
+ get { return document; }
+ }
+
+ public void AddRow (XmlNode left, XmlNode right)
+ {
+ if (left == null && right == null)
+ return;
+
+ XmlElement tr = document.CreateElement ("tr");
+ tbody.AppendChild (tr);
+ tr.AppendChild (left);
+
+ if (right == null)
+ tr.AppendChild (document.CreateElement ("td"));
+ else {
+ tr.SetAttribute ("valign", "top");
+ tr.AppendChild (right);
+ }
+ }
+
+ public void Write (TextWriter text_writer)
+ {
+ XmlTextWriter writer = new XmlTextWriter (text_writer);
+ writer.Formatting = Formatting.Indented;
+
+ document.WriteContentTo (writer);
+
+ writer.Flush ();
+ }
+
+ public void Write (string filename)
+ {
+ XmlTextWriter writer = new XmlTextWriter (filename, Encoding.Default);
+ writer.Formatting = Formatting.Indented;
+
+ document.WriteContentTo (writer);
+ writer.Flush ();
+ }
+}
+
+
+class Name {
+
+ string first_name;
+ string last_name;
+
+ public Name (string a, string b)
+ {
+ this.first_name = a;
+ this.last_name = b;
+ }
+
+ public override string ToString ()
+ {
+ if (first_name == null && last_name == null)
+ return String.Empty;
+
+ return first_name + " " + last_name;
+ }
+
+ public XmlNode ToXml (XmlDocument document)
+ {
+ XmlElement element = document.CreateElement ("font");
+ element.SetAttribute ("size", "3");
+ XmlElement b = document.CreateElement ("B");
+ XmlText t = document.CreateTextNode (ToString ());
+ b.AppendChild (t);
+ element.AppendChild (b);
+
+ return element;
+ }
+}
diff --git a/web/web/rss.cs b/web/web/rss.cs
index c8966e51e52..3bdaa95a843 100755
--- a/web/web/rss.cs
+++ b/web/web/rss.cs
@@ -13,7 +13,7 @@ namespace RSS {
public class Item {
XmlDocument doc;
XmlNode item;
- XmlText title, link, description;
+ XmlText title, link, description, pubdate;
public Item (XmlDocument doc, XmlNode item)
{
@@ -76,6 +76,21 @@ namespace RSS {
description.Value = value;
}
}
+
+ public string PubDate {
+ get {
+ if (pubdate == null)
+ return null;
+
+ return pubdate.Value;
+ }
+
+ set {
+ if (pubdate == null)
+ pubdate = MakeTextElement ("pubDate");
+ pubdate.Value = value;
+ }
+ }
}
public class Channel {
diff --git a/web/web/src/.cvsignore b/web/web/src/.cvsignore
index 5053fb08904..783c2406b33 100755
--- a/web/web/src/.cvsignore
+++ b/web/web/src/.cvsignore
@@ -1 +1,3 @@
*.src
+*.xml
+*.html.in
diff --git a/web/web/team.xml b/web/web/team.xml
new file mode 100644
index 00000000000..6a1055f71dc
--- /dev/null
+++ b/web/web/team.xml
@@ -0,0 +1,1629 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+
+
+
+<!--
+
+ Please, keep this file at 2-space indents.
+
+-->
+
+
+
+<contributors xmlns="http://go-mono.org/team.xsd">
+
+<contributor>
+
+ <name>
+
+ <first-name>Joel</first-name>
+
+ <last-name>Basson</last-name>
+
+ </name>
+
+ <e-mail>jstrike@mweb.co.za</e-mail>
+
+ <image>none.png</image>
+
+ <location>Cape Town, South Africa</location>
+
+ <organization></organization>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>System.Windows.Forms Gtk</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Alejandro</first-name>
+
+ <last-name>Sánchez Acosta</last-name>
+
+ </name>
+
+ <e-mail>asanchez@gnu.org</e-mail>
+
+ <image>none.png</image>
+
+ <location>Madrid, Spain</location>
+
+ <organization>Mono Hispano</organization>
+
+ <description>Mono contributor.</description>
+
+ <tasks>
+
+ <task>Documentation.</task>
+
+ <task>Gtk# stuff.</task>
+
+ <task>Class Libraries.</task>
+
+ <task>Mcs tests samples.</task>
+
+ <task>MONO Hispano Manager.</task>
+
+ </tasks>
+
+ </contributor>
+
+
+ <contributor>
+
+ <name>
+
+ <first-name>Tim</first-name>
+
+ <last-name>Haynes</last-name>
+
+ </name>
+
+ <e-mail>thaynes@openlinksw.co.uk</e-mail>
+
+ <image></image>
+
+ <location>Croydon, UK</location>
+
+ <organization>OpenLink Software</organization>
+
+ <description>http://www.openlinksw.com/</description>
+
+ <tasks>
+
+ <task>Anything related to using mono to host the CLR from other applications</task>
+
+ </tasks>
+
+ </contributor>
+
+
+ <contributor>
+
+ <name>
+
+ <first-name>Duncan</first-name>
+
+ <last-name>Mak</last-name>
+
+ </name>
+
+ <e-mail>duncan@ximian.com</e-mail>
+
+ <image>duncan.png</image>
+
+ <location>Boston / Hong Kong</location>
+
+ <organization>Ximian.</organization>
+
+ <description>Ximian intern</description>
+
+ <tasks>
+
+ <task>XML Schema</task>
+
+ <task>Documentation</task>
+
+ <task>Other useful stuff</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Miguel</first-name>
+
+ <last-name>de Icaza</last-name>
+
+ </name>
+
+ <e-mail>miguel@ximian.com</e-mail>
+
+ <image>miguel.png</image>
+
+ <location>Boston / Mexico City</location>
+
+ <organization>Ximian/Gnome.</organization>
+
+ <description>Ximian CTO</description>
+
+ <tasks>
+
+ <task>Mono Project Manager</task>
+
+ <task>MCS compiler</task>
+
+ <task>Core class libraries</task>
+
+ <task>MonoDoc, Gtk#</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Gaurav</first-name>
+
+ <last-name>Vaish</last-name>
+
+ </name>
+
+ <e-mail>gvaish_mono.nospam@nospam.lycos.com</e-mail>
+
+ <image>gvaish.png</image>
+
+ <location>Noida, India</location>
+
+ <organization>Adobe Systems Inc.</organization>
+
+ <description>Not a nerd yet</description>
+
+ <tasks>
+
+ <task>WebControls</task>
+
+ <task>MobileControls</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Paolo</first-name>
+
+ <last-name>Molaro</last-name>
+
+ </name>
+
+ <e-mail>lupus@ximian.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>Italy</location>
+
+ <organization>Ximian/Debian/Gnome.</organization>
+
+ <description>Mono hacker</description>
+
+ <tasks>
+
+ <task>Runtime implementation</task>
+
+ <task>Core class libraries</task>
+
+ <task>JIT compiler</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Dietmar</first-name>
+
+ <last-name>Maurer</last-name>
+
+ </name>
+
+ <e-mail>dietmar@ximian.com</e-mail>
+
+ <image>dietmar.png</image>
+
+ <location>Austria</location>
+
+ <organization>Dietmar IT/Ximian</organization>
+
+ <description>Mono hacker</description>
+
+ <tasks>
+
+ <task>Runtime implementation</task>
+
+ <task>Core class libraries</task>
+
+ <task>JIT compiler</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Patrik</first-name>
+
+ <last-name>Torstensson</last-name>
+
+ </name>
+
+ <e-mail>Patrik.Torstensson AT intel.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>Sweden</location>
+
+ <organization></organization>
+
+ <description>Mono hacker</description>
+
+ <tasks>
+
+ <task>System.Web core classes (ASP.NET)</task>
+
+ <task>Runtime implementation</task>
+
+ <task>Core class libraries (Threading, Remoting)</task>
+
+ <task>Random fixes (JIT)</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Juli</first-name>
+
+ <last-name>Mallett</last-name>
+
+ </name>
+
+ <e-mail>jmallett@FreeBSD.org</e-mail>
+
+ <location>Honolulu, Hawai`i</location>
+
+ <tasks>
+
+ <task>(Runtime) Portability</task>
+
+ <task>FreeBSD packaging</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Pedro</first-name>
+
+ <last-name>Martinez</last-name>
+
+ </name>
+
+ <e-mail>yoros@wanadoo.es</e-mail>
+
+ <image>pedro.png</image>
+
+ <location>Murcia, Spain</location>
+
+ <organization>None</organization>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>Testing core class libraries</task>
+
+ <task>Fixing little bugs</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Alp</first-name>
+
+ <last-name>Toker</last-name>
+
+ </name>
+
+ <e-mail>alp@atoker.com</e-mail>
+
+ <location>London, UK</location>
+
+ <tasks>
+
+ <task>Debian packaging</task>
+
+ <task>Gtk# hacks</task>
+
+ <task>Random fixes</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Marco</first-name>
+
+ <last-name>Ridoni</last-name>
+
+ </name>
+
+ <e-mail>marco.ridoni@virgilio.it</e-mail>
+
+ <location>Rome, Italy</location>
+
+ <tasks>
+
+ <task>MonoBasic</task>
+
+ <task>MonoBasic runtime</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Tim</first-name>
+
+ <last-name>Coleman</last-name>
+
+ </name>
+
+ <e-mail>tim@timcoleman.com</e-mail>
+
+ <image>timc.png</image>
+
+ <location>Waterloo, Ontario, Canada</location>
+
+ <tasks>
+
+ <task>ADO.NET</task>
+
+ <task>Web Services</task>
+
+ <task>Class library hacking</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Martin Willemoes</first-name>
+
+ <last-name>Hansen</last-name>
+
+ </name>
+
+ <e-mail>mwh -AT- sysrq.dkNOSPAM</e-mail>
+
+ <image>mwh.png</image>
+
+ <location>Aarhus, Denmark</location>
+
+ <description>Wannabe mono hacker</description>
+
+ <tasks>
+
+ <task>NUnit1 -&gt; NUnit2 conversion</task>
+
+ <task>Mono Handbook, Documentation</task>
+
+ <task>DiaCanvas#</task>
+
+ <task>Various fixes</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Piers</first-name>
+
+ <last-name>Haken</last-name>
+
+ </name>
+
+ <e-mail>piersh@friskit.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>San Francisco, CA</location>
+
+ <organization>Friskit Inc.</organization>
+
+ <tasks>
+
+ <task>XPath</task>
+
+ <task>corcompare / class-status</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Johannes</first-name>
+
+ <last-name>Roith</last-name>
+
+ </name>
+
+ <e-mail>johannes@jroith.de</e-mail>
+
+ <image>johannes.png</image>
+
+ <location>Germany</location>
+
+ <organization>None</organization>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>Mono Handbook</task>
+
+ <task>Windows packaging</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Per</first-name>
+
+ <last-name>Arneng</last-name>
+
+ </name>
+
+ <e-mail>pt99par@student.bth.se</e-mail>
+
+ <image>per.png</image>
+
+ <location>Ronneby, Sweden</location>
+
+ <organization>None</organization>
+
+ <description>Job seeking student</description>
+
+ <tasks>
+
+ <task>Class libraries</task>
+
+ <task>Class Documentation</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Sebastien</first-name>
+
+ <last-name>Pouliot</last-name>
+
+ </name>
+
+ <e-mail>sebastien at ximian dot com</e-mail>
+
+ <image>spouliot.png</image>
+
+ <location>Quebec City, Canada</location>
+
+ <organization>Novell Ximian</organization>
+
+ <description>Cryptoman</description>
+
+ <tasks>
+
+ <task>Cryptography</task>
+
+ <task>Security</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Cesar</first-name>
+
+ <last-name>Lopez Nataren</last-name>
+
+ </name>
+
+ <e-mail>cesar@ciencias.unam.mx</e-mail>
+
+ <image>cesar.png</image>
+
+ <location>Mexico City/Tuxtla Gutierrez, Chiapas.</location>
+
+ <description>Contributor</description>
+
+ <tasks>
+
+ <task>Random little patches</task>
+
+ <task>JScript compiler</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Hector</first-name>
+
+ <last-name>Gomez Morales</last-name>
+
+ </name>
+
+ <e-mail>hgomez_36@flashmail.com</e-mail>
+
+ <image>hector.png</image>
+
+ <location>Mexico City/Tijuana, BC.</location>
+
+ <description>Contributor</description>
+
+ <tasks>
+
+ <task>Random little patches</task>
+
+ <task>Documentation</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Jackson </first-name>
+
+ <last-name>Harper</last-name>
+
+ </name>
+
+ <e-mail>jackson@ximian.com</e-mail>
+
+ <image>jackson.png</image>
+
+ <location>Victoria, Canada</location>
+
+ <description>Hacker</description>
+
+ <tasks>
+
+ <task>IL Assembler</task>
+
+ <task>System.Web</task>
+
+ <task>Bug Fix0r</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Nick</first-name>
+
+ <last-name>Drochak</last-name>
+
+ </name>
+
+ <e-mail>ndrochak AT ieee.org</e-mail>
+
+ <image>nickd.png</image>
+
+ <location>Tokyo, Japan</location>
+
+ <organization>The Ingenium Group</organization>
+
+ <description>Programmer-type dude</description>
+
+ <tasks>
+
+ <task>Unit Tests</task>
+
+ <task>Quality Assurance</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Alan, Siu Lung</first-name>
+
+ <last-name>Tam</last-name>
+
+ </name>
+
+ <e-mail>Tam@SiuLung.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>Hong Kong SAR, People's Republic of China</location>
+
+ <description>Programmer-type dude</description>
+
+ <tasks>
+
+ <task>ADO.NET</task>
+
+ <task>Chinese encodings</task>
+
+ <task>Misc bug fixes</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Lluis</first-name>
+
+ <last-name>Sanchez</last-name>
+
+ </name>
+
+ <e-mail>lluis@ximian.com</e-mail>
+
+ <image>lluis.png</image>
+
+ <location>Barcelona, Spain</location>
+
+ <organization>Novell / Ximian</organization>
+
+ <description>Mono Hacker</description>
+
+ <tasks>
+
+ <task>Remoting</task>
+
+ <task>Serialization</task>
+
+ <task>Web Services</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Martin</first-name>
+
+ <last-name>Baulig</last-name>
+
+ </name>
+
+ <e-mail>martin@ximian.com</e-mail>
+
+ <image>martin.png</image>
+
+ <location>Germany</location>
+
+ <organization>Novell / Ximian</organization>
+
+ <description>Mono Hacker</description>
+
+ <tasks>
+
+ <task>Debugger/Debugging support</task>
+
+ <task>C# compiler</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Mike</first-name>
+
+ <last-name>Kestner</last-name>
+
+ </name>
+
+ <e-mail>mkestner@ximian.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>USA</location>
+
+ <organization>Ximian.</organization>
+
+ <description>Evolution developer</description>
+
+ <tasks>
+
+ <task>Gtk# language binding</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Rachel</first-name>
+
+ <last-name>Hestilow</last-name>
+
+ </name>
+
+ <e-mail>rachel@nullenvoid.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>USA</location>
+
+ <organization></organization>
+
+ <description></description>
+
+ <tasks>
+
+ <task>Gtk# language binding</task>
+
+ <task>MonoLOGO</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Jonathan</first-name>
+
+ <last-name>Pryor</last-name>
+
+ </name>
+
+ <e-mail>jonpryor@vt.edu</e-mail>
+
+ <image>jonpryor.png</image>
+
+ <location>Richmond, Virginia</location>
+
+ <organization>Cadmus Professional Communications</organization>
+
+ <description>Mono Hacker</description>
+
+ <tasks>
+
+ <task>Type Reflector</task>
+ <task>S.Diagnostics Trace/Debug/Listeners</task>
+ <task>Config File Support</task>
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Ben</first-name>
+
+ <last-name>Maurer</last-name>
+
+ </name>
+
+ <e-mail>bmaurer@users.sf.net</e-mail>
+
+ <image>none.png</image>
+
+ <location>USA</location>
+
+ <organization>N/A</organization>
+
+ <description>Mono hacker</description>
+
+ <tasks>
+
+ <task>Mono.Math.BigInteger</task>
+
+ <task>Other random stuff.</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Daniel</first-name>
+
+ <last-name>Morgan</last-name>
+
+ </name>
+
+ <e-mail>danielmorgan@verizon.net</e-mail>
+
+ <image>none.png</image>
+
+ <location>Richmond, Virginia, USA</location>
+
+ <organization>an insurance company</organization>
+
+ <description>Mono hacker</description>
+
+ <tasks>
+
+ <task>ADO.NET</task>
+
+ <task>SQL# Query Tool</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Gonzalo</first-name>
+
+ <last-name>Paniagua Javier</last-name>
+
+ </name>
+
+ <e-mail>gonzalo@ximian.com</e-mail>
+
+ <image>gonzalo.png</image>
+
+ <location>Spain</location>
+
+ <organization>Ximian.</organization>
+
+ <description>Mono hacker</description>
+
+ <tasks>
+
+ <task>System.Web core classes (ASP.NET)</task>
+
+ <task>Core class libraries</task>
+
+ <task>Gtk#</task>
+
+ <task>nunit-gtk (NUnit2 Gtk# frontend)</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Rafael</first-name>
+
+ <last-name>Teixeira</last-name>
+
+ </name>
+
+ <e-mail>rafaelteixeirabr@hotmail.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>Săo Paulo</location>
+
+ <organization>WEBforAll.</organization>
+
+ <description>Mono/MonoQLE hacker</description>
+
+ <tasks>
+
+ <task>MonoBASIC (mbas)</task>
+
+ <task>Mono.GetOptions</task>
+
+ <task>System.Messaging</task>
+
+ <task>System.ServiceProcess</task>
+
+ <task>System.Configuration.Install</task>
+
+ <task>System.DirectoryServices</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Atsushi</first-name>
+
+ <last-name>Enomoto</last-name>
+
+ </name>
+
+ <e-mail>atsushi@ximian.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>Tokyo, Japan</location>
+
+ <organization>Ximian</organization>
+
+ <description>Mono Hacker</description>
+
+ <tasks>
+
+ <task>System.Xml</task>
+
+ <task>RELAX NG</task>
+
+ <task>Japanese Website Translation</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Ravi</first-name>
+
+ <last-name>Pratap M</last-name>
+
+ </name>
+
+ <e-mail>ravi@ximian.com</e-mail>
+
+ <image>rpratap.png</image>
+
+ <location>St. Louis</location>
+
+ <organization>Ximian (formerly)</organization>
+
+ <description>Ximian hacker</description>
+
+ <tasks>
+
+ <task>MCS Compiler</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Mark</first-name>
+
+ <last-name>Crichton</last-name>
+
+ </name>
+
+ <e-mail>reverse_gro.pmig@nothcirc</e-mail>
+
+ <image>none.png</image>
+
+ <location>Amherst, MA</location>
+
+ <organization>Univ. of Mass., Amherst</organization>
+
+ <description>Research Asst.</description>
+
+ <tasks>
+
+ <task>Vorbis#</task>
+
+ <task>GtkMozEmbed#</task>
+
+ <task>SPARC Work</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Dick</first-name>
+
+ <last-name>Porter</last-name>
+
+ </name>
+
+ <e-mail>dick@ximian.com</e-mail>
+
+ <image>none.png</image>
+
+ <location>Swansea</location>
+
+ <organization>Ximian</organization>
+
+ <description>Hacker</description>
+
+ <tasks>
+
+ <task>Runtime implementation</task>
+
+ <task>Core class libraries</task>
+
+ <task>Host system integration</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Alexandre</first-name>
+
+ <last-name>Pigolkine</last-name>
+
+ </name>
+
+ <e-mail>pigolkine@gmx.de</e-mail>
+
+ <image>none.png</image>
+
+ <location>Germany</location>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>System.Windows.Forms</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Lee</first-name>
+
+ <last-name>Mallabone</last-name>
+
+ </name>
+
+ <e-mail>mono-docs@fonicmonkey.net</e-mail>
+
+ <image>none.png</image>
+
+ <location>Cambridge, UK</location>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>Gtk#</task>
+
+ <task>Technical documentation</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Eduardo</first-name>
+
+ <last-name>Garcia Cebollero</last-name>
+
+ </name>
+
+ <e-mail>kiwnix@yahoo.es</e-mail>
+
+ <image>none.png</image>
+
+ <location>Madrid, Spain</location>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>Small Bugfixes</task>
+
+ <task>NUnit Tests</task>
+
+ </tasks>
+
+ </contributor>
+
+
+ <contributor>
+
+ <name>
+
+ <first-name>Reggie</first-name>
+
+ <last-name>Burnett</last-name>
+
+ </name>
+
+ <e-mail>reggie@bytefx.com</e-mail>
+
+ <image>reggie.png</image>
+
+ <location>Tennessee, USA</location>
+
+ <organization>ByteFX, Inc.</organization>
+
+ <description>Consultant</description>
+
+ <tasks>
+
+ <task>MySQL ADO.Net Provider</task>
+
+ <task>SWF libraries</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Jean-Marc</first-name>
+
+ <last-name>Andre</last-name>
+
+ </name>
+
+ <e-mail>jean-marc.andre@polymtl.ca</e-mail>
+
+ <image>none.png</image>
+
+ <location>Montreal, Canada</location>
+
+ <organization>Ecole Polytechnique de Montreal</organization>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>SOAP formatting</task>
+
+ <task>NUnit tests</task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+ <name>
+ <first-name>Aleksey</first-name>
+ <last-name>Ryabchuk</last-name>
+ </name>
+ <e-mail>ryabchuk@yahoo.com</e-mail>
+ <image>aleksey.png</image>
+ <location>Ireland</location>
+ <description>External Contributor</description>
+ <tasks>
+ <task>System.Windows.Forms</task>
+ </tasks>
+ </contributor>
+ <contributor>
+ <name>
+ <first-name>Ville</first-name>
+ <last-name>Palo</last-name>
+ </name>
+ <e-mail>vi64pa - AT - kolumbus.fi</e-mail>
+ <image>none.png</image>
+ <location>Finland</location>
+ <description>Contributor</description>
+ <tasks>
+ <task>System.Data</task>
+ <task>System.IO</task>
+ </tasks>
+ </contributor>
+
+
+ <contributor>
+
+ <name>
+
+ <first-name>Charles Iliya</first-name>
+
+ <last-name>Krempeaux</last-name>
+
+ </name>
+
+ <e-mail>charles@reptile.ca</e-mail>
+
+ <image>none.png</image>
+
+ <location>Surrey, BC, Canada</location>
+
+ <organization>Reptile Consulting &amp; Services Ltd.</organization>
+
+ <description>Consultant</description>
+
+ <tasks>
+
+ <task>Gtk# - GNOME .NET binding</task>
+
+ <task>System.Drawing.Printing</task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+
+ <name>
+
+ <first-name>Vladimir</first-name>
+
+ <last-name>Kaluzhny</last-name>
+
+ </name>
+
+ <e-mail>vkaluzhny@openlinksw.co.uk</e-mail>
+
+ <image>none.png</image>
+
+ <location>Novosibirsk, Russia</location>
+
+ <organization>Openlink Software</organization>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>System.Windows.Forms</task>
+
+ <task>WineLib</task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+
+ <name>
+
+ <first-name>Jaime</first-name>
+
+ <last-name>Anguiano Olarra</last-name>
+
+ </name>
+
+ <e-mail>jaime@gnome.org</e-mail>
+
+ <image>none.png</image>
+
+ <location>Malaga/Granada, Spain</location>
+
+ <organization>The Mono Project?</organization>
+
+ <description>Wanabee, MWN maintainer</description>
+
+ <tasks>
+
+ <task>I try to help everywhere I can</task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+
+ <name>
+
+ <first-name>Zoltan</first-name>
+
+ <last-name>Varga</last-name>
+
+ </name>
+
+ <e-mail>vargaz CONCAT gmail CONCAT com</e-mail>
+
+ <image>none.png</image>
+
+ <location>Hungary</location>
+
+ <organization></organization>
+
+ <description></description>
+
+ <tasks>
+
+ <task>IKVM port</task>
+
+ <task>Sparc and AMD64 port</task>
+
+ <task>Marshalling/Interop</task>
+
+ <task>Reflection and Ref.Emit</task>
+
+ <task>Random runtime hacking</task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+
+ <name>
+
+ <first-name>John</first-name>
+
+ <last-name>Luke</last-name>
+
+ </name>
+
+ <e-mail>jluke@cfl.rr.com</e-mail>
+
+ <image>jluke.png</image>
+
+ <location>Daytona, FL</location>
+
+ <organization></organization>
+
+ <description>Contributor.</description>
+
+ <tasks>
+
+ <task>Documentation.</task>
+
+ <task>Monodoc.</task>
+
+ <task>Gtk#</task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+
+ <name>
+
+ <first-name>Peter</first-name>
+
+ <last-name>Williams</last-name>
+
+ </name>
+
+ <e-mail>peter@newton.cx</e-mail>
+
+ <image>peterw.png</image>
+
+ <location>Cambridge, MA</location>
+
+ <organization></organization>
+
+ <description>Makefile Magician</description>
+
+ <tasks>
+
+ <task>MCS build system </task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+
+ <name>
+
+ <first-name>Todd</first-name>
+
+ <last-name>Berman</last-name>
+
+ </name>
+
+ <e-mail>tberman@sevenl.net</e-mail>
+
+ <image>tberman.png</image>
+
+ <location>Toronto, ON, CA</location>
+
+ <organization></organization>
+
+ <description>hacker</description>
+
+ <tasks>
+
+ <task>WSE2</task>
+
+ <task>gacutil</task>
+
+ <task>MonoDevelop</task>
+
+ </tasks>
+
+ </contributor>
+ <contributor>
+
+ <name>
+
+ <first-name>Carlos</first-name>
+
+ <last-name>Guzmán Álvarez</last-name>
+
+ </name>
+
+ <e-mail>carlosga@telefonica.net</e-mail>
+
+ <image>none.png</image>
+
+ <location>Vigo, Spain</location>
+
+ <organization></organization>
+
+ <description>Contributor</description>
+
+ <tasks>
+
+ <task>TLS protocol</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Jordi</first-name>
+
+ <last-name>Mas i Hernŕndez</last-name>
+
+ </name>
+
+ <e-mail>jordi [at] ximian.com</e-mail>
+
+ <image>jordi.png</image>
+
+ <location>Barcelona, Spain</location>
+
+ <organization></organization>
+
+ <description>Developer</description>
+
+ <tasks>
+
+ <task>System.Drawing implementation</task>
+ <task>Windows.Forms implementation</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Pedro</first-name>
+
+ <last-name>Abelleira Seco</last-name>
+
+ </name>
+
+ <e-mail>pedroabelleira@yahoo.es</e-mail>
+
+ <image>pedroas.png</image>
+
+ <location>Galicia, Spain</location>
+
+ <organization></organization>
+
+ <description>Developer</description>
+
+ <tasks>
+
+ <task>MonoDevelop</task>
+
+ </tasks>
+
+ </contributor>
+
+ <contributor>
+
+ <name>
+
+ <first-name>Neale</first-name>
+
+ <last-name>Ferguson</last-name>
+
+ </name>
+
+ <e-mail>Neale.Ferguson@SoftwareAG-usa.com</e-mail>
+
+ <image></image>
+
+ <location>Leesburg, VA, USA</location>
+
+ <organization></organization>
+
+ <description>External Contributor</description>
+
+ <tasks>
+
+ <task>JIT for Linux on zSeries</task>
+
+ </tasks>
+
+ </contributor>
+
+</contributors>
diff --git a/web/web/team.xsd b/web/web/team.xsd
new file mode 100755
index 00000000000..30143d7c26c
--- /dev/null
+++ b/web/web/team.xsd
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<xs:schema id="contributors" targetNamespace="http://go-mono.org/team.xsd" xmlns="http://go-mono.org/team.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="contributor">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" minOccurs="0" maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="first-name" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="last-name" type="xs:string" minOccurs="0" maxOccurs="1" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="e-mail" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="image" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="location" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="organization" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" />
+ <xs:element name="tasks" minOccurs="0" maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="task" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
+
diff --git a/web/web/team/aleksey.png b/web/web/team/aleksey.png
new file mode 100755
index 00000000000..2b650587e01
--- /dev/null
+++ b/web/web/team/aleksey.png
Binary files differ
diff --git a/web/web/team/cesar.png b/web/web/team/cesar.png
new file mode 100644
index 00000000000..d416c35829b
--- /dev/null
+++ b/web/web/team/cesar.png
Binary files differ
diff --git a/web/web/team/dietmar.png b/web/web/team/dietmar.png
new file mode 100644
index 00000000000..e6086982d61
--- /dev/null
+++ b/web/web/team/dietmar.png
Binary files differ
diff --git a/web/web/team/duncan.png b/web/web/team/duncan.png
new file mode 100755
index 00000000000..69b5e638c55
--- /dev/null
+++ b/web/web/team/duncan.png
Binary files differ
diff --git a/web/web/team/gonzalo.png b/web/web/team/gonzalo.png
new file mode 100644
index 00000000000..6379362df31
--- /dev/null
+++ b/web/web/team/gonzalo.png
Binary files differ
diff --git a/web/web/team/gvaish.png b/web/web/team/gvaish.png
new file mode 100644
index 00000000000..131f9ae5966
--- /dev/null
+++ b/web/web/team/gvaish.png
Binary files differ
diff --git a/web/web/team/hector.png b/web/web/team/hector.png
new file mode 100644
index 00000000000..0e0781f961b
--- /dev/null
+++ b/web/web/team/hector.png
Binary files differ
diff --git a/web/web/team/jackson.png b/web/web/team/jackson.png
new file mode 100644
index 00000000000..2fb5545ee61
--- /dev/null
+++ b/web/web/team/jackson.png
Binary files differ
diff --git a/web/web/team/jluke.png b/web/web/team/jluke.png
new file mode 100644
index 00000000000..d8578ad8258
--- /dev/null
+++ b/web/web/team/jluke.png
Binary files differ
diff --git a/web/web/team/johannes.png b/web/web/team/johannes.png
new file mode 100755
index 00000000000..096f88205dc
--- /dev/null
+++ b/web/web/team/johannes.png
Binary files differ
diff --git a/web/web/team/jonpryor.png b/web/web/team/jonpryor.png
new file mode 100644
index 00000000000..d921a2dc051
--- /dev/null
+++ b/web/web/team/jonpryor.png
Binary files differ
diff --git a/web/web/team/jordi.png b/web/web/team/jordi.png
new file mode 100644
index 00000000000..126e5dff5f4
--- /dev/null
+++ b/web/web/team/jordi.png
Binary files differ
diff --git a/web/web/team/lluis.png b/web/web/team/lluis.png
new file mode 100644
index 00000000000..b22edbfcd9a
--- /dev/null
+++ b/web/web/team/lluis.png
Binary files differ
diff --git a/web/web/team/martin.png b/web/web/team/martin.png
new file mode 100644
index 00000000000..7bfe4a04e41
--- /dev/null
+++ b/web/web/team/martin.png
Binary files differ
diff --git a/web/web/team/miguel.png b/web/web/team/miguel.png
new file mode 100644
index 00000000000..534ccd4caf4
--- /dev/null
+++ b/web/web/team/miguel.png
Binary files differ
diff --git a/web/web/team/mwh.png b/web/web/team/mwh.png
new file mode 100644
index 00000000000..4a390c5bb86
--- /dev/null
+++ b/web/web/team/mwh.png
Binary files differ
diff --git a/web/web/team/nickd.png b/web/web/team/nickd.png
new file mode 100644
index 00000000000..c9a1561a3d5
--- /dev/null
+++ b/web/web/team/nickd.png
Binary files differ
diff --git a/web/web/team/none.png b/web/web/team/none.png
new file mode 100755
index 00000000000..deba20e455e
--- /dev/null
+++ b/web/web/team/none.png
Binary files differ
diff --git a/web/web/team/pedro.png b/web/web/team/pedro.png
new file mode 100644
index 00000000000..a3a4496a0d6
--- /dev/null
+++ b/web/web/team/pedro.png
Binary files differ
diff --git a/web/web/team/pedroas.png b/web/web/team/pedroas.png
new file mode 100644
index 00000000000..6905a00ff30
--- /dev/null
+++ b/web/web/team/pedroas.png
Binary files differ
diff --git a/web/web/team/per.png b/web/web/team/per.png
new file mode 100644
index 00000000000..5374cb64e2c
--- /dev/null
+++ b/web/web/team/per.png
Binary files differ
diff --git a/web/web/team/peterw.png b/web/web/team/peterw.png
new file mode 100644
index 00000000000..1cb36eab7c8
--- /dev/null
+++ b/web/web/team/peterw.png
Binary files differ
diff --git a/web/web/team/reggie.png b/web/web/team/reggie.png
new file mode 100644
index 00000000000..4f5dd4f1f70
--- /dev/null
+++ b/web/web/team/reggie.png
Binary files differ
diff --git a/web/web/team/rpratap.png b/web/web/team/rpratap.png
new file mode 100644
index 00000000000..5c51c7db283
--- /dev/null
+++ b/web/web/team/rpratap.png
Binary files differ
diff --git a/web/web/team/spouliot.png b/web/web/team/spouliot.png
new file mode 100644
index 00000000000..5c85a17b0f0
--- /dev/null
+++ b/web/web/team/spouliot.png
Binary files differ
diff --git a/web/web/team/tberman.png b/web/web/team/tberman.png
new file mode 100755
index 00000000000..9a26c2be737
--- /dev/null
+++ b/web/web/team/tberman.png
Binary files differ
diff --git a/web/web/team/timc.png b/web/web/team/timc.png
new file mode 100644
index 00000000000..a129020576c
--- /dev/null
+++ b/web/web/team/timc.png
Binary files differ
diff --git a/web/web/template.html.in b/web/web/template.html.in
index 16508b36201..169ff8b7ce9 100644
--- a/web/web/template.html.in
+++ b/web/web/template.html.in
@@ -2,17 +2,20 @@
<html>
<head>
<title>#TITLE#</title>
+<link rel="icon" href="MonoIcon.png" type="image/png">
+<!-- background-image: url("images/bgsquares.gif"); -->
<style type="text/css">
<!--
body { font-family: "trebuchet ms", lucida, verdana, helvetica;
- background-image: url("images/bgsquares.gif");
- background-attachment: fixed; }
+
+ }
body, td, table { font-family: "trebuchet ms", lucida, verdana, helvetica;
font-size: 14px; }
.navi0 { font-size: 14px; font-weight: bold; background: #444444; }
.navi1 { font-size: 14px; font-weight: bold; left-margin: 10pt}
.navi2 { font-size: 10px; font-weight: bold; left-margin: 20pt}
+ .topmenu { font-size: 14px; font-weight: bold; }
.footnote { font-size: 12px; color: #aaaaaa; }
a.navi0 { color: #ffffff; text-decoration: none}
@@ -27,7 +30,23 @@
a.navi2:visited { color: #cccccc; }
a.navi2:hover { color: #ee9900; text-decoration: underline; }
-// -->
+ a.topmenu { color: #ffffff; text-decoration: none; margin-left: 7px;}
+ a.topmenu:visited { color: #cccccc; }
+ a.topmenu:hover { color: #ee9900; text-decoration: underline; }
+
+ h1 {
+ border-bottom: 2px solid #dddddd;
+ }
+
+ pre { font-size: 12px; }
+
+ .shell {
+ border-style: solid; background: #000000; color: #bbbbbb;
+ #777777; border-width:
+ 1px; padding: 2pt;
+ margin:15px;
+ }
+// -->
</style>
#CSS#
#SCRIPT#
@@ -36,11 +55,28 @@
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
- <td><img src="images/pixel.gif" alt=""></td><!-- left border -->
- <td colspan="4">
- <a href="http://www.go-mono.com"><img src="images/mono.gif"
- alt="mono-logo" border="0"></a></td>
- <td><img src="images/pixel.gif" alt=""></td><!-- right border -->
+ <td><img src="images/pixel.gif" alt=""></td><!-- left border
+ -->
+ <td colspan="4">
+ <table>
+ <tr>
+ <td>
+ <a href="http://www.go-mono.com"><img
+ src="images/mono-new.gif" alt="mono-logo" border="0"></a>
+ </td>
+ <td>
+ <a class="topmenu" href="download.html">Downloads</a> |
+ <a class="topmenu" href="http://go-mono.com/daily/">Daily snapshots</a> |
+ <a class="topmenu" href="screenshots.html">Screenshots</a> |
+ <a class="topmenu" href="http://www.go-mono.com:8080">Documentation</a> |
+ <a class="topmenu" href="bugs.html">Bugs</a> |
+ <a class="topmenu" href="http://www.go-mono.com/monologue/">Blogs</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td><img src="images/pixel.gif" alt=""></td><!-- right border
+ -->
</tr>
<tr>
<td><img src="images/pixel.gif" width="1" height="1" alt=""></td>
diff --git a/web/web/transform.cs b/web/web/transform.cs
new file mode 100644
index 00000000000..af6424f90c3
--- /dev/null
+++ b/web/web/transform.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Xml;
+using System.Xml.Xsl;
+
+namespace Transform
+{
+ class Transform
+ {
+ public static void Main (string [] rgstrArgs)
+ {
+ XmlDocument xml = new XmlDocument ();
+ xml.Load (rgstrArgs [0]);
+
+ XslTransform xsl = new XslTransform ();
+ xsl.Load (rgstrArgs [1]);
+
+ xsl.Transform (xml, null, Console.Out);
+ }
+ }
+}
diff --git a/web/winforms b/web/winforms
index 2d8c1e3d79d..a9a5e8ae54c 100644
--- a/web/winforms
+++ b/web/winforms
@@ -1,90 +1,81 @@
* System.Windows.Forms
- System.Windows.Forms eventually will support multiple
- toolkits. Ximian will be delivering a product that will allow
- for System.Windows.Forms applications to integrate with GNOME
- through Gtk and MacOS X using Cocoa.
-
- There are no current plans to support embedded devices, but
- Gtk/FrameBuffer is an option. If you have suggestions or
- recommendations, please let us <a
- href="mailto:mono-hackers-list@ximian.com">let us know</a>
-
-* Contributing
-
- Currently Ximian developers are busy making our JIT engine
- feature complete, and dealing with the low-level details of
- the Mono runtime.
-
- If you are interested in contributing, you can start stubbing
- out classes and providing enumerations. That will help us
- significantly when we start working on the actual bindings.
-
- Christian Meyer is currently organizing this effort.
+ <p>Currently Windows.Forms support is under heavy development. Check Mono's <a
+ href = "http://www.go-mono.com/mono-roadmap.html">Roadmap</a> for more
+ details on when it is going to be available.
+
+ <p>System.Windows.Forms in Mono is implemented using System.Drawing. All controls
+ are natively drawn through System.Drawing. System.Windows.Forms implements it's own
+ driver interface to communicate with the host OS windowing system. Currently,
+ we have a driver for Win32 and a driver for X11.
+ The drivers translate the native window messages into WndProc compatible messages,
+ to provide as much compatibility with native .Net as possible.
+
+ <p>In terms of integrating visually with the desktop, we have a (still incomplete)
+ themeing interface, currently with a classic Win32 theme and a Gtk theme.
-* System.Drawing
+ <p>The current implementation is still very incomplete, with several large controls
+ (Edit, ListBox, ComboBox, Menus), etc, still being developed. It is too early to
+ file bugs if you cannot compile or run a certain application because of controls
+ missing.
- Using existing libraries to implement some of the functionality required
+* Why not use Wine?
<ul>
- * gdk-pixbuf is a generic image loader that loads an image
- and leaves it into an RGB buffer. It hides all the details
- about what image file format is being loaded.
- * Libart is a general framework for rendering RGB/RGBA
- buffers into RGB buffers and rendering postscript-like paths into
- RGB/RGBA buffers.
+ <li>Debugging with Wine was extremely hard, and Wine was a moving target,
+ some of the calls we relied on changed from release to release.
+ <li>Wine/GDI+ interactions were not efficient.
+ <li>Too many cooks contributed to the core, so it was hard to maintain.
+ <li>To many dependencies on install, many people where having problems getting
+ the very strict winelib requirements right.
+
</ul>
- We want to use gdk-pixbuf as the image loader for the image
- classes, and then we need operations to render that into the
- windowing system (Gtk+, MacOS, etc). But notice how there is
- very little dependnecies in Gdk-pixbuf on gtk, and libart has
- none.
+ The driver interface should allow us to also create a Wine based driver for
+ System.Windows.Forms, to support applications performing Win32 P/Invokes, but
+ for now this is not a priority.
+
- They are pretty independent from a windowing system
- (gdk-pixbuf comes with some "helper" routines for rendering
- data into a pixmap and to load pixmaps into RGB buffers).
+* Installation
- A few things to keep in mind:
+ <p>To get the Windows.Forms support working, you need:
<ul>
- * gdk-pixbuf can be used to load images for Gtk+,
- MacOS X and Windows, it should be pretty portable,
- although we might need in the future to back-port
- some new features from Gtk head.
-
- * Libart is probably only going to be used with X11,
- as the MacOS X provides the same features in Quartz,
- and Win32 *probably* has that in GDI+. If not, we
- should use libart in Win32 as well (or for older
- Windows systems).
+ <li> The latest <a href = "http://www.go-mono.com/download.html">Mono</a> package.
+ <li> The latest <a href = "http://www.go-mono.com/download.html">libgdiplus</a> library.
+ <li> The latest <a href = "http://www.cairographics.org/download">Cairo</a> vector graphics library.
+
</ul>
-* Directory Layout
+ The current source of System.Windows.Forms resides in mcs/class/Managed.Windows.Forms.
+ The previous version of System.Windows.Forms, based on Wine, still can be found in
+ mcs/class/System.Windows.Forms, but it is no longer being worked on.
- System.Drawing (assembly directory)
- System.Drawing.Blah
- Common code for "Blah"
- Stubs for "Blah" to ease ports.
+ <p>To use the latest version, go into Managed.Windows.Forms and issue a 'make clean',
+ followed by a 'make install'. Afterwards, the new implementation should be available
+ in the GAC for your use.
- Gtk
- System.Drawing.Blah.
- Gtk ports of "System.Drawing.Blah"
- MacOS
- System.Drawing.Blah
- MacOS ports of "System.Drawing.Blah"
- Win32
- System.Drawing.Blah
- Win32 ports of "System.Drawing.Blah"
+* Contributing
- Then we use nant targets to include/exclude the right set of
- files to create the assembly.
+ <p>The Winforms effort is being coordinated in the <a
+ href="mailto:mono-winforms-list@ximian.com">mono-winforms-list@ximian.com</a>.
+ If you are interested in helping out with this effort,
+ subscribe to it by sending an email message to <a
+ href="mailto:mono-winforms-list-request@ximian.com">mono-winforms-list-request@ximian.com</a>.
+
+ <p>If you want to help, you can pick a control and start implementing it's
+ methods. You can do this either on Windows or on Linux. All controls must be drawn
+ using System.Drawing calls, tied into the themeing interface, and not stubbed.
+
+ <p>If you choose a particular control to work on, send a note to the
+ winforms list to avoid duplication of effort.
+
+
+* System.Drawing
-* Open questions:
+ <p>For details, see the <a
+ href="drawing.html">System.Drawing implementation notes</a>
+ section of the web site.
- I believe that the graphics contexts that are used to render
- can accept either libart-like rendering operations and
- X11-like rendering operations. This complicates matters, but
- I am not sure. Someone needs to investigate this.
diff --git a/web/xml-classes b/web/xml-classes
new file mode 100755
index 00000000000..143a3af60f5
--- /dev/null
+++ b/web/xml-classes
@@ -0,0 +1,464 @@
+* XML Classes Status and Tasks
+
+** Abstract
+
+ XML library is used by several areas of Mono such as ADO.NET and XML
+ Digital Signature (xmldsig). Here I write about System.Xml.dll and
+ related tools. This page won't include any classes which are in other
+ assemblies such as XmlDataDocument.
+
+ Note that current corlib has its own XML parser class (Mono.Xml.MiniParser).
+
+ Basically System.XML.dll feature is almost finished, so I write this
+ document mainly for bugs and improvement hints.
+
+** Status
+
+*** System.Xml namespace
+
+
+**** Document Object Model (Core)
+
+ DOM implementation has finished and our DOM implementation scores better
+ than MS.NET as to the NIST DOM test results (it is ported by Mainsoft
+ hackers and in our unit tests).
+
+**** Xml Writer
+
+ Here XmlWriter almost equals to XmlTextWriter. If you want to see
+ another implementation, check XmlNodeWriter.cs and DTMXPathDocumentWriter.cs
+ in System.XML sources.
+
+ XmlTextWriter is completed, though it looks a bit slower than MS.NET (I
+ tried 1.1).
+
+**** XmlResolver
+
+ XmlUrlResolver is implemented.
+
+ XmlSecureResolver, which is introduced in MS .NET Framework 1.1 is basically
+ implemented, but it requires CAS (code access security) feature. We need to
+ fixup this class after ongoing CAS effort works.
+
+ You might also be interested in an improved <a href="http://codeblogs.ximian.com/blogs/benm/archives/000039.html">XmlCachingResolver</a> by Ben Maurer.
+ If even one time download is not acceptable, you can use <a href="http://primates.ximian.com/~atsushi/XmlStoredResolver.cs">this one</a>.
+
+ [2.0] XmlDataSourceResolver is not implemented as yet.
+
+**** XmlNameTable
+
+ NameTable is implemented, but also needs performance improvement.
+ It affects on the whole XML processing performance so much.
+ Optimization hackings are welcome. There is also a <a
+ href="http://bugzilla.ximian.com/show_bug.cgi?id=59537">bugzilla entry</a>
+ for this matter.
+
+**** XML Reader
+
+ XmlTextReader, XmlNodeReader and XmlValidatingReader are almost finished.
+
+ <ul>
+ * All OASIS conformance test passes as Microsoft does. Some
+ W3C tests fail, but it looks better.
+ * Entity expansion and its well-formedness check is incomplete.
+ It incorrectly allows divided content models. It incorrectly
+ treats its Base URI, so some dtd parse fails.
+ * I won't add any XDR support on XmlValidatingReader. (I haven't
+ ever seen XDR used other than Microsoft's BizTalk Server 2000,
+ and Now they have 2002 with XML Schema support). If anyone
+ contributes an implementation, it would be still nice.
+ </ul>
+
+ XmlTextReader and XmlValidatingReader should be faster than now. Currently
+ XmlTextReader looks nearly twice as slow as MS.NET, and XmlValidatingReader
+ (which uses this slow XmlTextReader) looks nearly three times slower. (Note
+ that XmlValidatingReader wouldn't be so slow as itself. It uses schema
+ validating reader and dtd validating reader.)
+
+
+**** Some Advantages
+
+ The design of Mono's XmlValidatingReader is radically different from
+ that of Microsoft's implementation. Under MS.NET, DTD content validation
+ engine is in fact simple replacement of XML Schema validation engine.
+ Mono's DTD validation is designed fully separate and does validation
+ as normal XML parser does. For example, Mono allows non-deterministic DTD.
+
+ Another advantage of this XmlValidatingReader is support for *any* XmlReader.
+ Microsoft supports only XmlTextReader (this bug is fixed in .NET 2.0 beta,
+ taking shape of XmlReader.Create()).
+
+ <del>I added extra support interface named "IHasXmlParserContext", which is
+ considered in XmlValidatingReader.ResolveEntity(). </del><ins>This is now
+ made as internal interface.</ins> Microsoft failed to design XmlReader
+ so that XmlReader cannot be subtree-pluggable (i.e. wrapping use of other
+ XmlReader) since XmlParserContext shoud be supplied for DTD information
+ support (e.g. entity references cannot be expanded) and namespace manager.
+ (In .NET 2.0, Microsoft also supported similar to IHasXmlParserContext,
+ named IXmlNamespaceResolver, but it still does not provide DTD information.)
+
+ We also have RELAX NG validating reader (described later).
+
+
+*** System.Xml.Schema
+
+**** Summary
+
+ Basically it is completed. You can test how current schema validation engine
+ is complete (incomplete) by using standalone test module (see
+ mcs/class/System.XML/Test/System.Xml.Schema/standalone_tests).
+ At least in my box, msxsdtest fails only 30 cases with bugfixed catalog -
+ this score is better than that of Microsoft implementation. But instead,
+ we need performance boost. There should be many points to improve
+ schema compilation and validation.
+
+**** Schema Object Model
+
+ Completed, except for some things to be fixed:
+
+ <ul>
+ * Complete facet support. Currently some of them is missing.
+ Recently David Sheldon is doing several fixes on them.
+ * ContentTypeParticle for pointless xs:choice is incomplete
+ (fixing this arose another bugs in compilation.
+ Interestingly, MS.NET also fails around here, so it might
+ be nature of ContentTypeParticle design)
+ * Some derivation by restriction (DBR) handling is incorrect.
+ </ul>
+
+**** Validating Reader
+
+ Basically this is implemented and actually its feature is complete,
+ but I have only did validation feature testing. So we have to write more
+ tests on properties, methods, and events (validation errors).
+
+
+*** System.Xml.Serialization
+
+ Lluis rules ;-)
+
+ Well, in fact XmlSerializer is almost finished and is on bugfix phase.
+
+ However, we appliciate more tests. Please try
+
+ <ul>
+ * System.Web.Services to invoke SOAP services.
+ * xsd.exe and wsdl.exe to create classes.
+ </ul>
+
+ And if any problems were found, please file it to bugzilla.
+
+ Lluis also built interesting standalone test system placed under
+ mcs/class/System.Web.Services/Test/standalone.
+
+ You might also interested in "genxs", which enables you to create custom
+ XML serializer. This is not included in Microsoft.NET.
+ See <a
+ href="http://primates.ximian.com/~lluis/blog/archives/000120.html">here</a>
+ and manpages for details. Code files are in mcs/tools/genxs.
+
+ Lluis also created "sgen", that based on XmlSerializer.GenerateSerializer().
+ Code files are in mcs/tools/sgen.
+
+*** System.Xml.XPath and System.Xml.Xsl
+
+ There are two XSLT implementations. One and historical implementation is
+ based on libxslt (aka Unmanaged XSLT). Now we uses fully implemented and
+ managed XSLT by default. To use Unmanaged XSLT, set MONO_UNMANAGED_XSLT
+ environment value (any value is acceptable).
+
+ As for Managed XSLT, we support msxsl:script.
+
+ It would be nice if we can support <a href="http://www.exslt.org/">EXSLT</a>.
+ <a href="http://msdn.microsoft.com/WebServices/default.aspx?pull=/library/en-us/dnexxml/html/xml05192003.asp">Microsoft has tried to do some of them</a>,
+ but it is not successful because of System.Xml.Xsl design problem:
+
+ <ul>
+ * In general, .NET's "extension objects" (including
+ msxsl:script) is not useful to return node-sets (MS XSLT
+ implementation rejects just overriden XPathNodeIterator,
+ but accepts only their hidden classes. And are the same
+ in Mono though classes are different)
+
+ * In .NET's extension object design, extension function name
+ is a valid method name that cannot contain some characters
+ such as '-'. That is, implementing EXSLT in C# is impossible.
+ </ul>
+
+ So if we support EXSLT, it has to be done inside our System.XML.dll.
+ Microsoft developers are also aware of this problem and some of them wish
+ to have EXSLT support in WinFX (not whidbey). If anyone is interested
+ in it, it would be nice.
+
+ Our managed XSLT implementation is slower than MS XSLT for some kind of
+ stylesheets, and faster for some.
+
+
+*** RELAX NG
+
+ I implemented an experimental RelaxngValidatingReader. It is still not
+ complete, for example some simplification stuff (see RELAX NG spec
+ chapter 4; especially 4.17-19) and some constraints (especially 7.3).
+ See mcs/class/Commons.Xml.Relaxng/README for details.
+
+ Currently we have
+
+ <ul>
+ * Custom datatype support. Right now, you can use XML schema
+ datatypes ( http://www.w3.org/2001/XMLSchema-datatypes )
+ as well as RELAX NG default datatypes (as used in relaxng.rng).
+
+ * RELAX NG Compact Syntax support, though not yet stable.
+ See Commons.Xml.Relaxng.Rnc.RncParser class.
+</ul>
+
+
+** System.Xml v2.0
+
+ Microsoft released the first public beta version of .NET Framework 2.0,
+ available from <a href="http://www.microsoft.com/downloads/details.aspx?familyid=916EC067-8BDC-4737-9430-6CEC9667655C&displaylang=en">MSDN</a>.
+ It contains several new classes.
+
+ There are two assemblies related to System.Xml v2.0; System.Xml.dll and
+ System.Data.SqlXml.dll. Now that System.Data.SqlXml.dll is little important.
+ It just contains only XQueryCommand class inside System.Xml.* namespace.
+ Most of the important part are in System.Xml.dll.
+
+ Note that .NET Framework is pre-release version, so they are subject
+ to change. Actually many of the pre-released classes vanished.
+
+ System.Xml 2.0 contains several features such as:
+
+ <ul>
+ * new XPathNavigator <del>and XPathDocument</del><ins>XPathDocument is <a href="http://blogs.msdn.com/dareobasanjo/archive/2004/08/25/220251.aspx">being reverted</a></ins>
+ * XmlReaderSettings, XmlWriterSettings and factory methods
+ * Strongly typed XmlReader and XmlWriter.
+ * XML Schema design changes
+ * XSD Inference
+ * Well-documented and improved XmlSerializer.
+ * XQuery execution engine
+ * XQuery and XSLT per-stylesheet assembly generator
+ </ul>
+
+*** System.Xml 2.0
+
+**** XmlReader/XmlWrier Factory methods
+
+ In .NET 2.0, XmlTextReader, XmlNodeReader, XmlValidatingReader are
+ obsolete and XmlReader.Create() is recommended (there is however no
+ alternative way to create XmlNodeReader). Similarly, there are
+ XmlWriter.Create() overloads.
+
+ Currently, Microsoft's XmlWriter.Create() is unreliable and maybe there
+ will be changes. So basically XmlWriter.Create() is supposed to be done
+ after the next beta version of .NET 2.0.
+
+ Some of XmlReader.Create() overloads are implemented, with limited
+ XmlReaderSettings support.
+
+
+**** Typed XmlReader/XmlWriter
+
+ In .NET 2.0, XmlReader is supposed to support strongly-typed data reading.
+ They are based on W3C "XML Schema Datatypes" Recommendation and "XQuery 1.0
+ and XPath 2.0 Data Model" Working Draft.
+
+ Some of XmlReader.ReadValueAsXxx() and XmlWriter.WriteValue() overloads are
+ implemented, though incompletely. They are based on internal XQueryConvert.
+
+
+**** Sub-tree handling in XmlReader/XmlWriter/XPathNavigator
+
+ Currently XmlReader.ReadSubtree(), XmlWriter.WriteSubtree() and
+ XPathNavigator.ReadSubtree() are implemented, though not well-tested.
+ They are based on Mono.Xml.SubtreeXmlReader and
+ Mono.Xml.XPath.XPathNavigatorReader classes.
+
+
+*** System.Xml.Schema 2.0
+
+ Since .NET 1.x is not so compliant with W3C XML Schema specification,
+ Microsoft had to redesign System.Xml.Schema classes. We also have to
+ change many things.
+
+ 1) It does not expose XmlSchemaDatatype anymore (except for obsolete
+ members). Primitive types are represented as XmlSchemaSimpleType
+ instances (thus there are ElementSchemaType, AttributeSchemaType,
+ BaseXmlSchemaType that replace some existing properties).
+
+ 2) "XQuery 1.0 and XPath 2.0 Data Model" datatypes (such as
+ xdt:dayTimeDuration) are newly supported. They are partially implemented
+ yet. This task is partly done.
+
+ 3) schema structures are now bound in parent-child relationship. It is
+ not yet implemented. With related to it, there seems bunch of schema
+ compilation bugfixes.
+
+ 4) XmlSchemaCollection is not used anymore to represent effective set of
+ schemas. Instead, new XmlSchemaSet class is used. It should affect on
+ schema compilation design. In fact, I've implemented XmlSchemaCollection
+ as more conformant to W3C specification, but there are still many changes
+ required. This task is partly done.
+
+
+**** XSD Inference
+
+ In .NET 2.0, there is an XML Schema inference implementation. Now that
+ XmlSchemaSet is basically implemented, it can be separately done by anyone.
+ Volunteer efforts are welcome here.
+
+
+*** System.Xml.XPath 2.0
+
+**** Editable XPathDocument
+
+ <del>
+ in .NET 2.0 XPathDocument is supposed to be editable. Currently we provide
+ fast document table model based implementation (DTMXPathNavigator), but
+ by that design change, we (and they) cannot provide fast read only
+ XPathNavigator from XPathDocument anymore.
+ </del><ins>
+ It is being reverted to the original (.NET 1.x) XPathDocument. We still have
+ them, but we'll revert them too in the future. So our XPathDocument will be still faster one.
+ </ins>
+
+ Currently, new XPathDocument implementation is provided. The actual
+ implementation is Mono.Xml.XPath.XPathDocument2, that is simple dom-like
+ tree model. XPathDocument2 implements the same interfaces as XPathDocument
+ does. And XPathDocument delegates most of the methods to that class (for
+ example, XPathDocument.CreateEditor() calls XPathDocument2.CreateEditor()).
+
+ Currently Mono.Xml.XPath.XPathDocument2 is unstable (it does not pass
+ the standalone XSLT tests unlike existing DTMXPathDocument does). So
+ it did not replace existing XPathDocument implementation, but you can use
+ new implementation by explicitly setting environment value
+ USE_XPATH_DOCUMENT_2 = yes. Currently it supports (well, is supposed
+ to support) basic editor feature such as AppendChild(). Other members
+ are untested (such as RejectChanges()).
+
+**** extra stuff - XPathEditableDocument
+
+ Currently we provide another IXPathEditable; XPathEditableDocument. That is
+ based on the idea that handles XmlDocument as editor target. It is
+ implemented as Mono.Xml.XPath.XPathEditableDocument. We might provide this
+ class as extra set (might be different mono-specific XML assembly).
+
+
+**** System.Xml.XQuery
+
+ In this namespace, there are two significant classes. XsltCommand and
+ XQueryCommand.
+
+ XsltCommand implements XSLT transformation. It is almost the same as
+ System.Xml.Xsl.XslTransform, but this class transforms documents twice
+ to four times as fast as XslTransform. Instead, stylesheet compilation
+ is much slower, because it generates compiled stylesheet assembly.
+
+ XQueryCommand implements XQuery. XQuery is a new face XML document
+ manipulation language (at least new face in .NET world). It is similar
+ to XSLT, but extended to support XML Schema based datatypes (and it is
+ not XML based langauge). It is similar to XPath, but it can construct
+ XML nodes. It has no complicated template resolution, but works like
+ functional languages.
+
+ Under MS.NET, XQuery implementation is mainly in System.Xml.Query and
+ MS.Internal.Xml.* namespaces. The implementation is mostly
+ in System.Xml.dll. It is also true to our System.Xml.dll. Our XQueryCommand
+ in System.Data.SqlXml.dll just invokes the actual XQuery processor
+ (Mono.Xml.XPath2.XQueryCommandImpl) which resides in System.Xml.dll via
+ reflection.
+
+ Currently we are not implementing MS.Internal.Xml.* classes. MS
+ implementation is based on an old version of the W3C specification, and
+ our implementation is currently based on
+ <a href="http://www.w3.org/TR/2004/WD-xquery-20040723/">23 July 2004
+ version</a> (latest as of now) of the working draft.
+
+ XQuery implementation tasks are:
+
+ <ul>
+ * XQuery syntax parser that parses xquery string to AST
+ (abstract syntax tree). -> partly not done.
+
+ * XQuery AST compiler into static context -> partly not done.
+
+ * XQuery (dynamic context) runtime = XQuery expression evaluator
+ + sequence iterator. -> partly not done.
+
+ * XPathItem data model and (mainly) conversion support.
+ -> partly done.
+
+ * Applied expression classes for XQuery/XPath 2.0 functions and
+ operators. -> partly done.
+
+ * Optimization, and design per-query assembly code generator (later)
+ </ul>
+
+ It already handles some queries, while major part implementation is missing
+ or buggy (like FLWOR, expressions for sequence type handling, built-in
+ function support etc.).
+
+
+*** Relax NG and DSDL in Mono 1.2
+
+ Currently we support only RELAX NG as one part of ISO DSDL effort. There
+ is existing Schematron implementation (NMatrix Project: <a
+ href="http://sourceforge.net/projects/dotnetopensrc/">
+ http://sourceforge.net/projects/dotnetopensrc/</a>). With a few changes,
+ it can be used with mono.
+
+ We also don't have multi-language based validation support, namely
+ Namespace-based Validation Dispatch Language (NVDL). To support unwrapping,
+ one special XmlReader implementation is required (other schema validation
+ support can be done by ReadSubtree()). Note that we had seen RELAX
+ Namespace, Modular Namespace (MNS) and Namespace Routing Language (NRL)
+ - that is, standardization effort is still ongoing (though NVDL looks
+ mostly the same as NRL).
+
+ In Mono 1.2, there might be improvements on Commons.Xml.Relaxng.
+
+ <ul>
+ * Currently RelaxngPattern.Compile() provides cheap compilation
+ error information. At least it can provide error location.
+ Also, the type of error should be kind of
+ RelaxngGrammarException.
+
+ * Right now there is no ambiguity detection implementation that
+ would be useful for RelaxngPattern based xml serialization (if
+ there is need).
+
+ * Because of lack of ambiguity detection, there is no way to
+ provide XmlMapping (XmlTypeMapping/XmlMemberMapping). But
+ If anyone is interested in such effort, integration with
+ XmlSerializer would be interesting task.
+ </ul>
+
+
+** Tools
+
+*** xsd.exe
+
+ See <a href="ado-net.html">ADO.NET page</a>.
+
+
+** Miscellaneous
+
+*** Mutual assembly dependency
+
+ Sometimes I hear complain about System.dll and System.Xml.dll mutual
+ dependency: System.dll references to System.Xml.dll (e.g.
+ System.Configuration.ConfigXmlDocument extended from XmlDocument), while
+ System.Xml.dll vice versa (e.g. XmlUrlResolver.ResolveUri takes System.Uri).
+ Since they are in public method signatures, so at least we cannot get rid
+ of these mutual references.
+
+ Nowadays System.Xml.dll is built using incomplete System.dll (lacking
+ System.Xml dependent classes such as ConfigXmlDocument). Full System.dll
+ is built after System.Xml.dll is done.
+
+ Note that you still need System.dll to run mcs.
+
+
+ Atsushi Eno <asushi@ximian.com>
+ last updated 09/02/2004
+